From 9bd03c45e3b6ed0dd2dc9b60efe8ef575eaf003b Mon Sep 17 00:00:00 2001
From: Deepak Selvakumar <77007253+deepaksibm@users.noreply.github.com>
Date: Mon, 4 Mar 2024 17:53:33 +0530
Subject: [PATCH] feat(release): Update SDK to use API released on 2024-02-20
Signed-off-by: Deepak Selvakumar <77007253+deepaksibm@users.noreply.github.com>
---
README.md | 2 +-
examples/test_vpc_v1_examples.py | 297 +-
ibm_vpc/vpc_v1.py | 147435 ++++++++++++++++------------
test/unit/test_vpc_v1.py | 90380 +++++++++--------
4 files changed, 135406 insertions(+), 102708 deletions(-)
diff --git a/README.md b/README.md
index c8cbda1..b2f0e0c 100644
--- a/README.md
+++ b/README.md
@@ -51,7 +51,7 @@ Service Name | Imported Class Name
* An [IBM Cloud][ibm-cloud-onboarding] account.
* An IAM API key to allow the SDK to access your account. Create an apikey [here](https://cloud.ibm.com/iam/apikeys).
-* Python version 3.7.6 or above.
+* Python version 3.8 or above.
## Installation
diff --git a/examples/test_vpc_v1_examples.py b/examples/test_vpc_v1_examples.py
index 819ab6b..c690b9c 100644
--- a/examples/test_vpc_v1_examples.py
+++ b/examples/test_vpc_v1_examples.py
@@ -164,6 +164,7 @@ def test_create_hub_vpc_example(self):
except ApiException as e:
pytest.fail(str(e))
+
@needscredentials
def test_get_vpc_example(self):
"""
@@ -2247,6 +2248,219 @@ def test_update_instance_volume_attachment_example(self):
except ApiException as e:
pytest.fail(str(e))
+ @needscredentials
+ def test_list_reservations_example(self):
+ """
+ list_reservations request example
+ """
+ try:
+ print('\nlist_reservations() result:')
+ # begin-list_reservations
+
+ reservation_collection = vpc_service.list_reservations().get_result()
+
+ # end-list_instance_profiles
+ assert reservation_collection is not None
+ except ApiException as e:
+ pytest.fail(str(e))
+
+ @needscredentials
+ def test_create_reservation_example(self):
+ """
+ create_reservation request example
+ """
+ try:
+ print('\ncreate_reservation() result:')
+ # begin-create_reservation
+
+ capacity_model = {}
+ capacity_model['total'] = 10
+
+ committed_use_model = {}
+ committed_use_model['term'] = 'one_year'
+
+ profile_model = {}
+ profile_model['name'] = 'ba2-2x8'
+ profile_model['resource_type'] = 'instance_profile'
+
+ zone_identity_model = {}
+ zone_identity_model['name'] = data['zone']
+
+ reservation = vpc_service.create_reservation(
+ capacity=capacity_model,
+ committed_use=committed_use_model,
+ profile=profile_model,
+ zone=zone_identity_model,
+ name='my-reservation').get_result()
+
+ # end-create_reservation
+ assert reservation['id'] is not None
+ data['reservationId']=reservation['id']
+
+ except ApiException as e:
+ pytest.fail(str(e))
+
+ @needscredentials
+ def test_update_reservation_example(self):
+ """
+ update_reservation request example
+ """
+ try:
+ print('\nupdate_reservation() result:')
+ # begin-update_reservation
+
+ reservation_patch_model = {}
+ reservation_patch_model['name'] ='my-reservation-updated'
+
+ reservation = vpc_service.update_reservation(
+ id=data['reservationId'], reservation_patch=reservation_patch_model).get_result()
+
+ # end-update_reservation
+ assert reservation is not None
+
+ except ApiException as e:
+ pytest.fail(str(e))
+
+ @needscredentials
+ def test_activate_reservation_example(self):
+ """
+ activate_reservation request example
+ """
+ try:
+ print('\nactivate_reservation() result:')
+ # begin-activate_reservation
+
+ response = vpc_service.activate_reservation(
+ id=data['reservationId']).get_result()
+
+ # end-activate_reservation
+ except ApiException as e:
+ pytest.fail(str(e))
+
+ @needscredentials
+ def test_get_reservation_example(self):
+ """
+ get_reservation request example
+ """
+ try:
+ print('\nget_reservation() result:')
+ # begin-activate_reservation
+
+ reservation = vpc_service.get_reservation(
+ id=data['reservationId']).get_result()
+
+ # end-get_reservation
+ assert reservation is not None
+ except ApiException as e:
+ pytest.fail(str(e))
+
+ @needscredentials
+ def test_create_instance_with_reservation_example(self):
+ """
+ create_instance with reservation request example
+ """
+ try:
+ print('\ncreate_instance_with_reservation() result:')
+ # begin-create_instance
+
+ subnet_identity_model = {}
+ subnet_identity_model['id'] = data['subnetId']
+
+ network_interface_prototype_model = {}
+ network_interface_prototype_model['name'] = 'my-network-interface'
+ network_interface_prototype_model['subnet'] = subnet_identity_model
+
+ instance_profile_identity_model = {}
+ instance_profile_identity_model['name'] = 'bx2-2x8'
+
+ vpc_identity_model = {}
+ vpc_identity_model['id'] = data['vpcID']
+
+ zone_identity_model = {}
+ zone_identity_model['name'] = data['zone']
+
+ reservation_identity_model = {}
+ reservation_identity_model['id'] = data['reservationId']
+
+ reservation_affinity_model = {}
+ reservation_affinity_model['policy'] = 'manual'
+ reservation_affinity_model['pool'] = [reservation_identity_model]
+
+ image_identity_model = {}
+ image_identity_model['id'] = data['imageId']
+
+ instance_prototype_model = {}
+ instance_prototype_model['name'] = 'my-instance-with-res'
+ instance_prototype_model['profile'] = instance_profile_identity_model
+ instance_prototype_model['vpc'] = vpc_identity_model
+ instance_prototype_model['primary_network_interface'] = network_interface_prototype_model
+ instance_prototype_model['zone'] = zone_identity_model
+ instance_prototype_model['image'] = image_identity_model
+ instance_prototype_model['reservation_affinity'] = reservation_affinity_model
+
+ instance = vpc_service.create_instance(
+ instance_prototype=instance_prototype_model).get_result()
+
+ # end-create_instance
+
+ assert instance is not None
+ data['instanceIdWithRes']=instance['id']
+
+ except ApiException as e:
+ pytest.fail(str(e))
+
+ @needscredentials
+ def test_update_instance_with_reservation_example(self):
+ """
+ update_instance with reservation request example
+ """
+ try:
+ print('\nupdate_instance_with_reservation() result:')
+ # begin-update_instance
+
+ reservation_identity_model = {}
+ reservation_identity_model['id'] = data['reservationId']
+
+ reservation_affinity_model = {}
+ reservation_affinity_model['policy'] = 'manual'
+ reservation_affinity_model['pool'] = [reservation_identity_model]
+
+ instance_patch_model = {}
+ instance_patch_model['name']='my-instance-updated'
+ instance_patch_model['reservation_affinity'] = reservation_affinity_model
+
+ instance = vpc_service.update_instance(
+ id=data['instanceId'],
+ instance_patch=instance_patch_model).get_result()
+
+ # end-update_instance
+ assert instance is not None
+
+ except ApiException as e:
+ pytest.fail(str(e))
+
+
+ @needscredentials
+ @pytest.mark.skip(reason="mock")
+ def test_delete_reservation_example(self):
+ """
+ delete_reservation request example
+ """
+ try:
+ # begin-delete_reservation
+
+ response = vpc_service.delete_reservation(
+ id=data['reservationId'])
+
+ assert response is not None
+
+ # end-delete_reservation
+ print('\ndelete_reservation() response status code: ',
+ response.get_status_code())
+
+ except ApiException as e:
+ pytest.fail(str(e))
+
@needscredentials
def test_list_instance_groups_example(self):
"""
@@ -4988,7 +5202,30 @@ def test_disconnect_vpn_client_example(self):
except ApiException as e:
pytest.fail(str(e))
+
+ @needscredentials
+ def test_create_vpn_server_route_example(self):
+ """
+ create_vpn_server_route request example
+ """
+ try:
+ print('\ncreate_vpn_server_route() result:')
+ # begin-create_vpn_server_route
+
+ vpn_server_route = vpc_service.create_vpn_server_route(
+ vpn_server_id=data['vpnserverId'],
+ destination='172.16.0.0/16',
+ name='my-vpn-server-route'
+ ).get_result()
+
+ print(json.dumps(vpn_server_route, indent=2))
+
+ # end-create_vpn_server_route
+ data['vpnserverrouteId']=vpn_server_route['id']
+ except ApiException as e:
+ pytest.fail(str(e))
@needscredentials
+ @pytest.mark.skip(reason="mock")
def test_list_vpn_server_routes_example(self):
"""
list_vpn_server_routes request example
@@ -5016,28 +5253,6 @@ def test_list_vpn_server_routes_example(self):
except ApiException as e:
pytest.fail(str(e))
- @needscredentials
- def test_create_vpn_server_route_example(self):
- """
- create_vpn_server_route request example
- """
- try:
- print('\ncreate_vpn_server_route() result:')
- # begin-create_vpn_server_route
-
- vpn_server_route = vpc_service.create_vpn_server_route(
- vpn_server_id=data['vpnserverId'],
- destination='172.16.0.0/16',
- name='my-vpn-server-route'
- ).get_result()
-
- print(json.dumps(vpn_server_route, indent=2))
-
- # end-create_vpn_server_route
- data['vpnserverrouteId']=vpn_server_route['id']
- except ApiException as e:
- pytest.fail(str(e))
-
@needscredentials
def test_get_vpn_server_route_example(self):
"""
@@ -6269,20 +6484,23 @@ def test_create_bare_metal_server_example(self):
'id': data['subnetId'],
},
}
-
+ bare_metal_server_profile_identity_model = {
+ 'name': 'bmx2-48x768',
+ }
zone_identity_model = {
'name': data['zone'],
}
-
- bare_metal_server = vpc_service.create_bare_metal_server(
- initialization=bare_metal_server_initialization_prototype_model,
- primary_network_interface=
+ bare_metal_server_prototype_model = {
+ 'initialization': bare_metal_server_initialization_prototype_model,
+ 'primary_network_interface':
bare_metal_server_primary_network_interface_prototype_model,
- profile={
- 'name': 'bmx2-48x768'
- },
- name='my-baremetal-server',
- zone=zone_identity_model).get_result()
+ 'profile': bare_metal_server_profile_identity_model,
+ 'name':'my-baremetal-server',
+ 'zone':zone_identity_model
+ }
+ bare_metal_server = vpc_service.create_bare_metal_server(
+ bare_metal_server_prototype=bare_metal_server_prototype_model,
+ ).get_result()
# end-create_bare_metal_server
assert bare_metal_server is not None
@@ -6807,12 +7025,14 @@ def test_create_backup_policy_example(self):
'deletion_trigger': backup_policy_plan_deletion_trigger_prototype_model,
'name': 'my-backup-policy-plan',
}
-
+ backup_policy_prototype = {
+ 'match_user_tags': ['my-daily-backup-policy'],
+ 'match_resource_type':['volume'],
+ 'name':'my-backup-policy',
+ 'plans':[backup_policy_plan_prototype_model],
+ }
backup_policy_response = vpc_service.create_backup_policy(
- match_user_tags=['my-daily-backup-policy'],
- match_resource_types=['volume'],
- name='my-backup-policy',
- plans=[backup_policy_plan_prototype_model],
+ backup_policy_prototype = backup_policy_prototype
)
backup_policy = backup_policy_response.get_result()
data['backupPolicyETag'] = backup_policy_response.get_headers()['ETag']
@@ -6951,6 +7171,7 @@ def test_update_backup_policy_plan_example(self):
pytest.fail(str(e))
@needscredentials
+ @pytest.mark.skip(reason="mock")
def test_list_backup_policy_jobs_example(self):
"""
list_backup_policy_jobs request example
@@ -6976,6 +7197,7 @@ def test_list_backup_policy_jobs_example(self):
data['backupPolicyJobID'] = all_results[0]['id']
@needscredentials
+ @pytest.mark.skip(reason="mock")
def test_get_backup_policy_job_example(self):
"""
get_backup_policy_job request example
@@ -7915,6 +8137,7 @@ def test_delete_vpc_dns_resolution_binding_example(self):
except ApiException as e:
pytest.fail(str(e))
+
@needscredentials
def test_delete_vpc_example(self):
"""
diff --git a/ibm_vpc/vpc_v1.py b/ibm_vpc/vpc_v1.py
index 8d74058..b305e0d 100644
--- a/ibm_vpc/vpc_v1.py
+++ b/ibm_vpc/vpc_v1.py
@@ -1,6 +1,6 @@
# coding: utf-8
-# (C) Copyright IBM Corp. 2021, 2022, 2023.
+# (C) Copyright IBM Corp. 2024.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -14,19 +14,19 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-# IBM OpenAPI SDK Code Generator Version: 3.80.0-29334a73-20230925-151553
+# IBM OpenAPI SDK Code Generator Version: 3.85.0-75c38f8f-20240206-210220
"""
The IBM Cloud Virtual Private Cloud (VPC) API can be used to programmatically provision
and manage virtual server instances, along with subnets, volumes, load balancers, and
more.
-API Version: 2023-10-24
+API Version: 2023-12-05
"""
from datetime import datetime
from enum import Enum
-from typing import Dict, List
+from typing import Dict, List, Optional
import base64
import json
import logging
@@ -53,17 +53,17 @@ class VpcV1(BaseService):
@classmethod
def new_instance(
cls,
- version: str = '2023-10-24',
+ version: str = '2024-02-20',
service_name: str = DEFAULT_SERVICE_NAME,
- generation: int = 2,
+ generation: Optional[int] = 2,
) -> 'VpcV1':
"""
Return a new client for the vpc service using the specified parameters and
external configuration.
:param str version: The API version, in format `YYYY-MM-DD`. For the API
- behavior documented here, specify any date between `2023-10-10` and
- `2023-11-15`.
+ behavior documented here, specify any date between `2023-12-05` and
+ `2024-02-21`.
"""
if version is None:
raise ValueError('version must be provided')
@@ -79,16 +79,16 @@ def new_instance(
def __init__(
self,
- version: str = '2023-10-24',
+ version: str = '2024-02-20',
authenticator: Authenticator = None,
- generation: int = 2,
+ generation: Optional[int] = 2,
) -> None:
"""
Construct a new client for the vpc service.
:param str version: The API version, in format `YYYY-MM-DD`. For the API
- behavior documented here, specify any date between `2023-10-10` and
- `2023-11-15`.
+ behavior documented here, specify any date between `2023-12-05` and
+ `2024-02-21`.
:param Authenticator authenticator: The authenticator specifies the authentication mechanism.
Get up to date information from https://github.com/IBM/python-sdk-core/blob/main/README.md
@@ -108,10 +108,10 @@ def __init__(
def list_vpcs(
self,
*,
- start: str = None,
- limit: int = None,
- resource_group_id: str = None,
- classic_access: bool = None,
+ start: Optional[str] = None,
+ limit: Optional[int] = None,
+ resource_group_id: Optional[str] = None,
+ classic_access: Optional[bool] = None,
**kwargs,
) -> DetailedResponse:
"""
@@ -171,11 +171,11 @@ def list_vpcs(
def create_vpc(
self,
*,
- address_prefix_management: str = None,
- classic_access: bool = None,
- dns: 'VPCDNSPrototype' = None,
- name: str = None,
- resource_group: 'ResourceGroupIdentity' = None,
+ address_prefix_management: Optional[str] = None,
+ classic_access: Optional[bool] = None,
+ dns: Optional['VPCDNSPrototype'] = None,
+ name: Optional[str] = None,
+ resource_group: Optional['ResourceGroupIdentity'] = None,
**kwargs,
) -> DetailedResponse:
"""
@@ -262,7 +262,7 @@ def delete_vpc(
self,
id: str,
*,
- if_match: str = None,
+ if_match: Optional[str] = None,
**kwargs,
) -> DetailedResponse:
"""
@@ -376,7 +376,7 @@ def update_vpc(
id: str,
vpc_patch: 'VPCPatch',
*,
- if_match: str = None,
+ if_match: Optional[str] = None,
**kwargs,
) -> DetailedResponse:
"""
@@ -600,8 +600,8 @@ def list_vpc_address_prefixes(
self,
vpc_id: str,
*,
- start: str = None,
- limit: int = None,
+ start: Optional[str] = None,
+ limit: Optional[int] = None,
**kwargs,
) -> DetailedResponse:
"""
@@ -660,8 +660,8 @@ def create_vpc_address_prefix(
cidr: str,
zone: 'ZoneIdentity',
*,
- is_default: bool = None,
- name: str = None,
+ is_default: Optional[bool] = None,
+ name: Optional[str] = None,
**kwargs,
) -> DetailedResponse:
"""
@@ -922,13 +922,13 @@ def list_vpc_dns_resolution_bindings(
self,
vpc_id: str,
*,
- sort: str = None,
- start: str = None,
- limit: int = None,
- name: str = None,
- vpc_crn: str = None,
- vpc_name: str = None,
- account_id: str = None,
+ sort: Optional[str] = None,
+ start: Optional[str] = None,
+ limit: Optional[int] = None,
+ name: Optional[str] = None,
+ vpc_crn: Optional[str] = None,
+ vpc_name: Optional[str] = None,
+ account_id: Optional[str] = None,
**kwargs,
) -> DetailedResponse:
"""
@@ -1021,7 +1021,7 @@ def create_vpc_dns_resolution_binding(
vpc_id: str,
vpc: 'VPCIdentity',
*,
- name: str = None,
+ name: Optional[str] = None,
**kwargs,
) -> DetailedResponse:
"""
@@ -1110,14 +1110,15 @@ def delete_vpc_dns_resolution_binding(
Delete a DNS resolution binding.
This request deletes a DNS resolution binding. This operation cannot be reversed.
- A DNS resolution binding for a VPC with `dns.enable_hub` set to `true` cannot be
- deleted.
+ For this request to succeed, the VPC specified by the identifier in the URL must
+ not have
+ `dns.resolver.type` set to `delegated`.
:param str vpc_id: The VPC identifier.
:param str id: The DNS resolution binding 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 `VPCDNSResolutionBinding` object
"""
if not vpc_id:
@@ -1140,6 +1141,7 @@ def delete_vpc_dns_resolution_binding(
if 'headers' in kwargs:
headers.update(kwargs.get('headers'))
del kwargs['headers']
+ headers['Accept'] = 'application/json'
path_param_keys = ['vpc_id', 'id']
path_param_values = self.encode_path_vars(vpc_id, id)
@@ -1282,9 +1284,9 @@ def list_vpc_routes(
self,
vpc_id: str,
*,
- zone_name: str = None,
- start: str = None,
- limit: int = None,
+ zone_name: Optional[str] = None,
+ start: Optional[str] = None,
+ limit: Optional[int] = None,
**kwargs,
) -> DetailedResponse:
"""
@@ -1354,10 +1356,11 @@ def create_vpc_route(
destination: str,
zone: 'ZoneIdentity',
*,
- action: str = None,
- name: str = None,
- next_hop: 'RoutePrototypeNextHop' = None,
- priority: int = None,
+ action: Optional[str] = None,
+ advertise: Optional[bool] = None,
+ name: Optional[str] = None,
+ next_hop: Optional['RoutePrototypeNextHop'] = None,
+ priority: Optional[int] = None,
**kwargs,
) -> DetailedResponse:
"""
@@ -1375,9 +1378,16 @@ def create_vpc_route(
and
`priority`, and only if both routes have an `action` of `deliver` and the
`next_hop` is an IP address.
- :param ZoneIdentity zone: The zone to apply the route to. (Traffic from
- subnets in this zone will be
- subject to this route.).
+ :param ZoneIdentity zone: The zone to apply the route to.
+ If subnets are attached to the route's routing table, egress traffic from
+ those
+ subnets in this zone will be subject to this route. If this route's routing
+ table
+ has any of `route_direct_link_ingress`, `route_internet_ingress`,
+ `route_transit_gateway_ingress` or `route_vpc_zone_ingress` set to`true`,
+ traffic
+ from those ingress sources arriving in this zone will be subject to this
+ route.
:param str action: (optional) The action to perform with a packet matching
the route:
- `delegate`: delegate to system-provided routes
@@ -1385,6 +1395,12 @@ def create_vpc_route(
Internet-bound routes
- `deliver`: deliver the packet to the specified `next_hop`
- `drop`: drop the packet.
+ :param bool advertise: (optional) Indicates whether this route will be
+ advertised to the ingress sources specified by the `advertise_routes_to`
+ routing table property.
+ All routes in a routing table with the same `destination` and `zone` must
+ have the same
+ `advertise` value.
:param str name: (optional) The name for this route. The name must not be
used by another route in the routing table. Names starting with `ibm-` are
reserved for system-provided routes, and are not allowed. If unspecified,
@@ -1437,6 +1453,7 @@ def create_vpc_route(
'destination': destination,
'zone': zone,
'action': action,
+ 'advertise': advertise,
'name': name,
'next_hop': next_hop,
'priority': priority,
@@ -1654,9 +1671,9 @@ def list_vpc_routing_tables(
self,
vpc_id: str,
*,
- start: str = None,
- limit: int = None,
- is_default: bool = None,
+ start: Optional[str] = None,
+ limit: Optional[int] = None,
+ is_default: Optional[bool] = None,
**kwargs,
) -> DetailedResponse:
"""
@@ -1721,13 +1738,14 @@ def create_vpc_routing_table(
self,
vpc_id: str,
*,
- accept_routes_from: List['ResourceFilter'] = None,
- name: str = None,
- route_direct_link_ingress: bool = None,
- route_internet_ingress: bool = None,
- route_transit_gateway_ingress: bool = None,
- route_vpc_zone_ingress: bool = None,
- routes: List['RoutePrototype'] = None,
+ accept_routes_from: Optional[List['ResourceFilter']] = None,
+ advertise_routes_to: Optional[List[str]] = None,
+ name: Optional[str] = None,
+ route_direct_link_ingress: Optional[bool] = None,
+ route_internet_ingress: Optional[bool] = None,
+ route_transit_gateway_ingress: Optional[bool] = None,
+ route_vpc_zone_ingress: Optional[bool] = None,
+ routes: Optional[List['RoutePrototype']] = None,
**kwargs,
) -> DetailedResponse:
"""
@@ -1743,6 +1761,9 @@ def create_vpc_routing_table(
At present, only the `resource_type` filter is permitted, and only the
`vpn_server` value is supported, but filter support is expected to expand
in the future.
+ :param List[str] advertise_routes_to: (optional) The ingress sources to
+ advertise routes to. Routes in the table with `advertise` enabled will be
+ advertised to these sources.
:param str name: (optional) The name for this routing table. The name must
not be used by another routing table in the VPC. If unspecified, the name
will be a hyphenated list of randomly-selected words.
@@ -1826,6 +1847,7 @@ def create_vpc_routing_table(
data = {
'accept_routes_from': accept_routes_from,
+ 'advertise_routes_to': advertise_routes_to,
'name': name,
'route_direct_link_ingress': route_direct_link_ingress,
'route_internet_ingress': route_internet_ingress,
@@ -1862,7 +1884,7 @@ def delete_vpc_routing_table(
vpc_id: str,
id: str,
*,
- if_match: str = None,
+ if_match: Optional[str] = None,
**kwargs,
) -> DetailedResponse:
"""
@@ -1979,7 +2001,7 @@ def update_vpc_routing_table(
id: str,
routing_table_patch: 'RoutingTablePatch',
*,
- if_match: str = None,
+ if_match: Optional[str] = None,
**kwargs,
) -> DetailedResponse:
"""
@@ -2051,8 +2073,8 @@ def list_vpc_routing_table_routes(
vpc_id: str,
routing_table_id: str,
*,
- start: str = None,
- limit: int = None,
+ start: Optional[str] = None,
+ limit: Optional[int] = None,
**kwargs,
) -> DetailedResponse:
"""
@@ -2121,10 +2143,11 @@ def create_vpc_routing_table_route(
destination: str,
zone: 'ZoneIdentity',
*,
- action: str = None,
- name: str = None,
- next_hop: 'RoutePrototypeNextHop' = None,
- priority: int = None,
+ action: Optional[str] = None,
+ advertise: Optional[bool] = None,
+ name: Optional[str] = None,
+ next_hop: Optional['RoutePrototypeNextHop'] = None,
+ priority: Optional[int] = None,
**kwargs,
) -> DetailedResponse:
"""
@@ -2142,9 +2165,16 @@ def create_vpc_routing_table_route(
and
`priority`, and only if both routes have an `action` of `deliver` and the
`next_hop` is an IP address.
- :param ZoneIdentity zone: The zone to apply the route to. (Traffic from
- subnets in this zone will be
- subject to this route.).
+ :param ZoneIdentity zone: The zone to apply the route to.
+ If subnets are attached to the route's routing table, egress traffic from
+ those
+ subnets in this zone will be subject to this route. If this route's routing
+ table
+ has any of `route_direct_link_ingress`, `route_internet_ingress`,
+ `route_transit_gateway_ingress` or `route_vpc_zone_ingress` set to`true`,
+ traffic
+ from those ingress sources arriving in this zone will be subject to this
+ route.
:param str action: (optional) The action to perform with a packet matching
the route:
- `delegate`: delegate to system-provided routes
@@ -2152,6 +2182,12 @@ def create_vpc_routing_table_route(
Internet-bound routes
- `deliver`: deliver the packet to the specified `next_hop`
- `drop`: drop the packet.
+ :param bool advertise: (optional) Indicates whether this route will be
+ advertised to the ingress sources specified by the `advertise_routes_to`
+ routing table property.
+ All routes in a routing table with the same `destination` and `zone` must
+ have the same
+ `advertise` value.
:param str name: (optional) The name for this route. The name must not be
used by another route in the routing table. Names starting with `ibm-` are
reserved for system-provided routes, and are not allowed. If unspecified,
@@ -2202,6 +2238,7 @@ def create_vpc_routing_table_route(
'destination': destination,
'zone': zone,
'action': action,
+ 'advertise': advertise,
'name': name,
'next_hop': next_hop,
'priority': priority,
@@ -2425,15 +2462,15 @@ def update_vpc_routing_table_route(
def list_subnets(
self,
*,
- start: str = None,
- limit: int = None,
- resource_group_id: str = None,
- zone_name: str = None,
- vpc_id: str = None,
- vpc_crn: str = None,
- vpc_name: str = None,
- routing_table_id: str = None,
- routing_table_name: str = None,
+ start: Optional[str] = None,
+ limit: Optional[int] = None,
+ resource_group_id: Optional[str] = None,
+ zone_name: Optional[str] = None,
+ vpc_id: Optional[str] = None,
+ vpc_crn: Optional[str] = None,
+ vpc_name: Optional[str] = None,
+ routing_table_id: Optional[str] = None,
+ routing_table_name: Optional[str] = None,
**kwargs,
) -> DetailedResponse:
"""
@@ -2570,11 +2607,11 @@ def delete_subnet(
This request deletes a subnet. This operation cannot be reversed. For this request
to succeed, the subnet must not be referenced by any bare metal server network
- interfaces, instance network interfaces, VPN gateways, or load balancers. A delete
- operation automatically detaches the subnet from any network ACLs, public
- gateways, or endpoint gateways. All flow log collectors with `auto_delete` set to
- `true` targeting the subnet or any resource in the subnet are automatically
- deleted.
+ interfaces, instance network interfaces, virtual network interfaces, VPN gateways,
+ or load balancers. A delete operation automatically detaches the subnet from any
+ network ACLs, public gateways, or endpoint gateways. All flow log collectors with
+ `auto_delete` set to `true` targeting the subnet or any resource in the subnet are
+ automatically deleted.
:param str id: The subnet identifier.
:param dict headers: A `dict` containing the request headers
@@ -3066,8 +3103,8 @@ def replace_subnet_routing_table(
This request replaces the existing routing table for a subnet with the routing
table specified in the request body.
For this request to succeed, the routing table `route_direct_link_ingress`,
- `route_transit_gateway_ingress`, and `route_vpc_zone_ingress` properties must be
- `false`.
+ `route_internet_ingress`, `route_transit_gateway_ingress`, and
+ `route_vpc_zone_ingress` properties must be `false`.
:param str id: The subnet identifier.
:param RoutingTableIdentity routing_table_identity: The routing table
@@ -3123,9 +3160,13 @@ def list_subnet_reserved_ips(
self,
subnet_id: str,
*,
- start: str = None,
- limit: int = None,
- sort: str = None,
+ start: Optional[str] = None,
+ limit: Optional[int] = None,
+ sort: Optional[str] = None,
+ target_id: Optional[str] = None,
+ target_crn: Optional[str] = None,
+ target_name: Optional[str] = None,
+ target_resource_type: Optional[str] = None,
**kwargs,
) -> DetailedResponse:
"""
@@ -3143,6 +3184,15 @@ def list_subnet_reserved_ips(
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 target_id: (optional) Filters the collection to resources with a
+ `target.id` property matching the specified identifier.
+ :param str target_crn: (optional) Filters the collection to resources with
+ a `target.crn` property matching the specified CRN.
+ :param str target_name: (optional) Filters the collection to resources with
+ a `target.name` property matching the exact specified name.
+ :param str target_resource_type: (optional) Filters the collection to
+ resources with a `target.resource_type` property matching the specified
+ value.
:param dict headers: A `dict` containing the request headers
:return: A `DetailedResponse` containing the result, headers and HTTP status code.
:rtype: DetailedResponse with `dict` result representing a `ReservedIPCollection` object
@@ -3164,6 +3214,10 @@ def list_subnet_reserved_ips(
'start': start,
'limit': limit,
'sort': sort,
+ 'target.id': target_id,
+ 'target.crn': target_crn,
+ 'target.name': target_name,
+ 'target.resource_type': target_resource_type,
}
if 'headers' in kwargs:
@@ -3189,10 +3243,10 @@ def create_subnet_reserved_ip(
self,
subnet_id: str,
*,
- address: str = None,
- auto_delete: bool = None,
- name: str = None,
- target: 'ReservedIPTargetPrototype' = None,
+ address: Optional[str] = None,
+ auto_delete: Optional[bool] = None,
+ name: Optional[str] = None,
+ target: Optional['ReservedIPTargetPrototype'] = None,
**kwargs,
) -> DetailedResponse:
"""
@@ -3216,9 +3270,10 @@ def create_subnet_reserved_ip(
unspecified, the name will be a hyphenated list of randomly-selected words.
:param ReservedIPTargetPrototype target: (optional) The target to bind this
reserved IP to. The target must be in the same VPC.
- At present, only endpoint gateway targets are supported. The endpoint
- gateway must
- not be already bound to a reserved IP in the subnet's zone.
+ The following targets are supported:
+ - An endpoint gateway not already bound to a reserved IP in the subnet's
+ zone.
+ - A virtual network interface.
If unspecified, the reserved IP will be created unbound.
:param dict headers: A `dict` containing the request headers
:return: A `DetailedResponse` containing the result, headers and HTTP status code.
@@ -3283,9 +3338,9 @@ def delete_subnet_reserved_ip(
This request releases a reserved IP. This operation cannot be reversed.
For this request to succeed, the reserved IP must not be required by another
- resource, such as a bare metal server network interface or instance network
- interface for which it is the primary IP. A provider-owned reserved IP is not
- allowed to be deleted.
+ resource, such as a bare metal server network interface, instance network
+ interface or virtual network interface for which it is the primary IP. A
+ provider-owned reserved IP is not allowed to be deleted.
:param str subnet_id: The subnet identifier.
:param str id: The reserved IP identifier.
@@ -3458,12 +3513,12 @@ def update_subnet_reserved_ip(
def list_images(
self,
*,
- start: str = None,
- limit: int = None,
- resource_group_id: str = None,
- name: str = None,
- status: List[str] = None,
- visibility: str = None,
+ start: Optional[str] = None,
+ limit: Optional[int] = None,
+ resource_group_id: Optional[str] = None,
+ name: Optional[str] = None,
+ status: Optional[List[str]] = None,
+ visibility: Optional[str] = None,
**kwargs,
) -> DetailedResponse:
"""
@@ -3869,7 +3924,7 @@ def list_image_export_jobs(
self,
image_id: str,
*,
- name: str = None,
+ name: Optional[str] = None,
**kwargs,
) -> DetailedResponse:
"""
@@ -3930,8 +3985,8 @@ def create_image_export_job(
image_id: str,
storage_bucket: 'CloudObjectStorageBucketIdentity',
*,
- format: str = None,
- name: str = None,
+ format: Optional[str] = None,
+ name: Optional[str] = None,
**kwargs,
) -> DetailedResponse:
"""
@@ -4191,8 +4246,8 @@ def update_image_export_job(
def list_operating_systems(
self,
*,
- start: str = None,
- limit: int = None,
+ start: Optional[str] = None,
+ limit: Optional[int] = None,
**kwargs,
) -> DetailedResponse:
"""
@@ -4296,8 +4351,8 @@ def get_operating_system(
def list_keys(
self,
*,
- start: str = None,
- limit: int = None,
+ start: Optional[str] = None,
+ limit: Optional[int] = None,
**kwargs,
) -> DetailedResponse:
"""
@@ -4349,9 +4404,9 @@ def create_key(
self,
public_key: str,
*,
- name: str = None,
- resource_group: 'ResourceGroupIdentity' = None,
- type: str = None,
+ name: Optional[str] = None,
+ resource_group: Optional['ResourceGroupIdentity'] = None,
+ type: Optional[str] = None,
**kwargs,
) -> DetailedResponse:
"""
@@ -4953,19 +5008,22 @@ def update_instance_template(
def list_instances(
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,
- dedicated_host_id: str = None,
- dedicated_host_crn: str = None,
- dedicated_host_name: str = None,
- placement_group_id: str = None,
- placement_group_crn: str = None,
- placement_group_name: str = None,
+ start: Optional[str] = None,
+ limit: Optional[int] = None,
+ resource_group_id: Optional[str] = None,
+ name: Optional[str] = None,
+ vpc_id: Optional[str] = None,
+ vpc_crn: Optional[str] = None,
+ vpc_name: Optional[str] = None,
+ dedicated_host_id: Optional[str] = None,
+ dedicated_host_crn: Optional[str] = None,
+ dedicated_host_name: Optional[str] = None,
+ placement_group_id: Optional[str] = None,
+ placement_group_crn: Optional[str] = None,
+ placement_group_name: Optional[str] = None,
+ reservation_id: Optional[str] = None,
+ reservation_crn: Optional[str] = None,
+ reservation_name: Optional[str] = None,
**kwargs,
) -> DetailedResponse:
"""
@@ -5004,6 +5062,12 @@ def list_instances(
:param str placement_group_name: (optional) Filters the collection to
instances with a `placement_target.name` property matching the exact
specified placement group name.
+ :param str reservation_id: (optional) Filters the collection to instances
+ with a `reservation.id` property matching the specified identifier.
+ :param str reservation_crn: (optional) Filters the collection to instances
+ with a `reservation.crn` property matching the specified CRN.
+ :param str reservation_name: (optional) Filters the collection to resources
+ with a `reservation.name` property matching the exact specified name.
:param dict headers: A `dict` containing the request headers
:return: A `DetailedResponse` containing the result, headers and HTTP status code.
:rtype: DetailedResponse with `dict` result representing a `InstanceCollection` object
@@ -5033,6 +5097,9 @@ def list_instances(
'placement_group.id': placement_group_id,
'placement_group.crn': placement_group_crn,
'placement_group.name': placement_group_name,
+ 'reservation.id': reservation_id,
+ 'reservation.crn': reservation_crn,
+ 'reservation.name': reservation_name,
}
if 'headers' in kwargs:
@@ -5110,6 +5177,8 @@ def create_instance(
def delete_instance(
self,
id: str,
+ *,
+ if_match: Optional[str] = None,
**kwargs,
) -> DetailedResponse:
"""
@@ -5117,10 +5186,16 @@ def delete_instance(
This request deletes an instance. This operation cannot be reversed. Any floating
IPs associated with instance network interfaces are implicitly disassociated. All
- flow log collectors with `auto_delete` set to `true` targeting the instance and/or
- the instance network interfaces are automatically deleted.
+ virtual network interfaces with `auto_delete` set to `true` targeting instance
+ network attachments on the instance are automatically deleted. All flow log
+ collectors with
+ `auto_delete` set to `true` targeting the instance, the instance network
+ attachments, the instance network interfaces, or the automatically deleted virtual
+ network interfaces are automatically deleted.
:param str id: The virtual server instance identifier.
+ :param str if_match: (optional) If present, the request will fail if the
+ specified ETag value does not match the resource's current ETag value.
:param dict headers: A `dict` containing the request headers
:return: A `DetailedResponse` containing the result, headers and HTTP status code.
:rtype: DetailedResponse
@@ -5128,7 +5203,9 @@ def delete_instance(
if not id:
raise ValueError('id must be provided')
- headers = {}
+ headers = {
+ 'If-Match': if_match,
+ }
sdk_headers = get_sdk_headers(
service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
@@ -5213,6 +5290,8 @@ def update_instance(
self,
id: str,
instance_patch: 'InstancePatch',
+ *,
+ if_match: Optional[str] = None,
**kwargs,
) -> DetailedResponse:
"""
@@ -5224,6 +5303,9 @@ def update_instance(
:param str id: The virtual server instance identifier.
:param InstancePatch instance_patch: The instance patch.
+ :param str if_match: (optional) If present, the request will fail if the
+ specified ETag value does not match the resource's current ETag value.
+ Required if the request body includes an array.
:param dict headers: A `dict` containing the request headers
:return: A `DetailedResponse` containing the result, headers and HTTP status code.
:rtype: DetailedResponse with `dict` result representing a `Instance` object
@@ -5235,7 +5317,9 @@ def update_instance(
raise ValueError('instance_patch must be provided')
if isinstance(instance_patch, InstancePatch):
instance_patch = convert_model(instance_patch)
- headers = {}
+ headers = {
+ 'If-Match': if_match,
+ }
sdk_headers = get_sdk_headers(
service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
@@ -5328,7 +5412,7 @@ def create_instance_action(
instance_id: str,
type: str,
*,
- force: bool = None,
+ force: Optional[bool] = None,
**kwargs,
) -> DetailedResponse:
"""
@@ -5396,7 +5480,7 @@ def create_instance_console_access_token(
instance_id: str,
console_type: str,
*,
- force: bool = None,
+ force: Optional[bool] = None,
**kwargs,
) -> DetailedResponse:
"""
@@ -5636,6 +5720,321 @@ def update_instance_disk(
response = self.send(request, **kwargs)
return response
+ def list_instance_network_attachments(
+ self,
+ instance_id: str,
+ **kwargs,
+ ) -> DetailedResponse:
+ """
+ List all network attachments on an instance.
+
+ This request lists all network attachments on an instance. A network attachment
+ represents a device on the instance to which a virtual network interface is
+ attached.
+ The network attachments will be sorted by their `created_at` property values, with
+ newest network attachments first. Network attachments with identical `created_at`
+ property values will in turn be sorted by ascending `name` property values.
+
+ :param str instance_id: The virtual server instance 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 `InstanceNetworkAttachmentCollection` object
+ """
+
+ if not instance_id:
+ raise ValueError('instance_id must be provided')
+ headers = {}
+ sdk_headers = get_sdk_headers(
+ service_name=self.DEFAULT_SERVICE_NAME,
+ service_version='V1',
+ operation_id='list_instance_network_attachments',
+ )
+ headers.update(sdk_headers)
+
+ params = {
+ 'version': self.version,
+ 'generation': self.generation,
+ }
+
+ if 'headers' in kwargs:
+ headers.update(kwargs.get('headers'))
+ del kwargs['headers']
+ headers['Accept'] = 'application/json'
+
+ path_param_keys = ['instance_id']
+ path_param_values = self.encode_path_vars(instance_id)
+ path_param_dict = dict(zip(path_param_keys, path_param_values))
+ url = '/instances/{instance_id}/network_attachments'.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_instance_network_attachment(
+ self,
+ instance_id: str,
+ virtual_network_interface: 'InstanceNetworkAttachmentPrototypeVirtualNetworkInterface',
+ *,
+ name: Optional[str] = None,
+ **kwargs,
+ ) -> DetailedResponse:
+ """
+ Create a network attachment on an instance.
+
+ This request creates a new instance network attachment from an instance network
+ attachment prototype object. The prototype object is structured in the same way as
+ a retrieved instance network attachment, and contains the information necessary to
+ create the new instance network attachment.
+
+ :param str instance_id: The virtual server instance identifier.
+ :param InstanceNetworkAttachmentPrototypeVirtualNetworkInterface
+ virtual_network_interface: A virtual network interface for the instance
+ network attachment. This can be specified
+ using an existing virtual network interface, or a prototype object for a
+ new virtual
+ network interface.
+ If an existing virtual network interface is specified,
+ `enable_infrastructure_nat` must be
+ `true`.
+ :param str name: (optional) The name for this network attachment. Names
+ must be unique within the instance the network attachment resides in. If
+ unspecified, the name will be a hyphenated list of randomly-selected words.
+ :param dict headers: A `dict` containing the request headers
+ :return: A `DetailedResponse` containing the result, headers and HTTP status code.
+ :rtype: DetailedResponse with `dict` result representing a `InstanceNetworkAttachment` object
+ """
+
+ if not instance_id:
+ raise ValueError('instance_id must be provided')
+ if virtual_network_interface is None:
+ raise ValueError('virtual_network_interface must be provided')
+ virtual_network_interface = convert_model(virtual_network_interface)
+ headers = {}
+ sdk_headers = get_sdk_headers(
+ service_name=self.DEFAULT_SERVICE_NAME,
+ service_version='V1',
+ operation_id='create_instance_network_attachment',
+ )
+ headers.update(sdk_headers)
+
+ params = {
+ 'version': self.version,
+ 'generation': self.generation,
+ }
+
+ data = {
+ 'virtual_network_interface': virtual_network_interface,
+ 'name': name,
+ }
+ data = {k: v for (k, v) in data.items() if v is not None}
+ data = json.dumps(data)
+ headers['content-type'] = 'application/json'
+
+ if 'headers' in kwargs:
+ headers.update(kwargs.get('headers'))
+ del kwargs['headers']
+ headers['Accept'] = 'application/json'
+
+ path_param_keys = ['instance_id']
+ path_param_values = self.encode_path_vars(instance_id)
+ path_param_dict = dict(zip(path_param_keys, path_param_values))
+ url = '/instances/{instance_id}/network_attachments'.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_instance_network_attachment(
+ self,
+ instance_id: str,
+ id: str,
+ **kwargs,
+ ) -> DetailedResponse:
+ """
+ Delete an instance network attachment.
+
+ This request deletes an instance network attachment. This operation cannot be
+ reversed. Any floating IPs associated with the instance network attachment are
+ implicitly disassociated. All flow log collectors with `auto_delete` set to `true`
+ targeting the instance network attachment are automatically deleted. The primary
+ instance network attachment is not allowed to be deleted.
+
+ :param str instance_id: The virtual server instance identifier.
+ :param str id: The instance network attachment identifier.
+ :param dict headers: A `dict` containing the request headers
+ :return: A `DetailedResponse` containing the result, headers and HTTP status code.
+ :rtype: DetailedResponse
+ """
+
+ if not instance_id:
+ raise ValueError('instance_id must be provided')
+ if not id:
+ raise ValueError('id must be provided')
+ headers = {}
+ sdk_headers = get_sdk_headers(
+ service_name=self.DEFAULT_SERVICE_NAME,
+ service_version='V1',
+ operation_id='delete_instance_network_attachment',
+ )
+ headers.update(sdk_headers)
+
+ params = {
+ 'version': self.version,
+ 'generation': self.generation,
+ }
+
+ if 'headers' in kwargs:
+ headers.update(kwargs.get('headers'))
+ del kwargs['headers']
+
+ path_param_keys = ['instance_id', 'id']
+ path_param_values = self.encode_path_vars(instance_id, id)
+ path_param_dict = dict(zip(path_param_keys, path_param_values))
+ url = '/instances/{instance_id}/network_attachments/{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_instance_network_attachment(
+ self,
+ instance_id: str,
+ id: str,
+ **kwargs,
+ ) -> DetailedResponse:
+ """
+ Retrieve an instance network attachment.
+
+ This request retrieves a single instance network attachment specified by the
+ identifier in the URL.
+
+ :param str instance_id: The virtual server instance identifier.
+ :param str id: The instance network attachment 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 `InstanceNetworkAttachment` object
+ """
+
+ if not instance_id:
+ raise ValueError('instance_id must be provided')
+ if not id:
+ raise ValueError('id must be provided')
+ headers = {}
+ sdk_headers = get_sdk_headers(
+ service_name=self.DEFAULT_SERVICE_NAME,
+ service_version='V1',
+ operation_id='get_instance_network_attachment',
+ )
+ headers.update(sdk_headers)
+
+ params = {
+ 'version': self.version,
+ 'generation': self.generation,
+ }
+
+ if 'headers' in kwargs:
+ headers.update(kwargs.get('headers'))
+ del kwargs['headers']
+ headers['Accept'] = 'application/json'
+
+ path_param_keys = ['instance_id', 'id']
+ path_param_values = self.encode_path_vars(instance_id, id)
+ path_param_dict = dict(zip(path_param_keys, path_param_values))
+ url = '/instances/{instance_id}/network_attachments/{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_instance_network_attachment(
+ self,
+ instance_id: str,
+ id: str,
+ instance_network_attachment_patch: 'InstanceNetworkAttachmentPatch',
+ **kwargs,
+ ) -> DetailedResponse:
+ """
+ Update an instance network attachment.
+
+ This request updates an instance network attachment with the information provided
+ in an instance network interface patch object. The instance network attachment
+ patch object is structured in the same way as a retrieved instance network
+ attachment and needs to contain only the information to be updated.
+
+ :param str instance_id: The virtual server instance identifier.
+ :param str id: The instance network attachment identifier.
+ :param InstanceNetworkAttachmentPatch instance_network_attachment_patch:
+ The instance network attachment 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 `InstanceNetworkAttachment` object
+ """
+
+ if not instance_id:
+ raise ValueError('instance_id must be provided')
+ if not id:
+ raise ValueError('id must be provided')
+ if instance_network_attachment_patch is None:
+ raise ValueError('instance_network_attachment_patch must be provided')
+ if isinstance(instance_network_attachment_patch, InstanceNetworkAttachmentPatch):
+ instance_network_attachment_patch = convert_model(instance_network_attachment_patch)
+ headers = {}
+ sdk_headers = get_sdk_headers(
+ service_name=self.DEFAULT_SERVICE_NAME,
+ service_version='V1',
+ operation_id='update_instance_network_attachment',
+ )
+ headers.update(sdk_headers)
+
+ params = {
+ 'version': self.version,
+ 'generation': self.generation,
+ }
+
+ data = json.dumps(instance_network_attachment_patch)
+ headers['content-type'] = 'application/merge-patch+json'
+
+ if 'headers' in kwargs:
+ headers.update(kwargs.get('headers'))
+ del kwargs['headers']
+ headers['Accept'] = 'application/json'
+
+ path_param_keys = ['instance_id', 'id']
+ path_param_values = self.encode_path_vars(instance_id, id)
+ path_param_dict = dict(zip(path_param_keys, path_param_values))
+ url = '/instances/{instance_id}/network_attachments/{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_instance_network_interfaces(
self,
instance_id: str,
@@ -5650,6 +6049,11 @@ def list_instance_network_interfaces(
any subnet in the zone, including subnets that are already attached to the
instance. Multiple network interfaces on the instance may also attach to the same
subnet.
+ If this instance has network attachments, each returned network interface is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface.
:param str instance_id: The virtual server instance identifier.
:param dict headers: A `dict` containing the request headers
@@ -5696,10 +6100,10 @@ def create_instance_network_interface(
instance_id: str,
subnet: 'SubnetIdentity',
*,
- allow_ip_spoofing: bool = None,
- name: str = None,
- primary_ip: 'NetworkInterfaceIPPrototype' = None,
- security_groups: List['SecurityGroupIdentity'] = None,
+ allow_ip_spoofing: Optional[bool] = None,
+ name: Optional[str] = None,
+ primary_ip: Optional['NetworkInterfaceIPPrototype'] = None,
+ security_groups: Optional[List['SecurityGroupIdentity']] = None,
**kwargs,
) -> DetailedResponse:
"""
@@ -5711,11 +6115,21 @@ def create_instance_network_interface(
create the new instance network interface. Any subnet in the instance's VPC may be
specified. Addresses on the instance network interface must be within the
specified subnet's CIDR blocks.
+ If this instance has network attachments, each network interface is a [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and new network interfaces are not allowed to be created.
:param str instance_id: The virtual server instance identifier.
:param SubnetIdentity subnet: The associated subnet.
:param bool allow_ip_spoofing: (optional) Indicates whether source IP
spoofing is allowed on this instance network interface.
+ If this instance has network attachments, this network interface is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and source IP spoofing is managed on the attached virtual
+ network interface.
:param str name: (optional) The name for the instance network interface.
The name must not be used by another network interface on the virtual
server instance. If unspecified, the name will be a hyphenated list of
@@ -5804,6 +6218,10 @@ def delete_instance_network_interface(
implicitly disassociated. All flow log collectors with `auto_delete` set to `true`
targeting the instance network interface are automatically deleted. The primary
instance network interface is not allowed to be deleted.
+ If this instance has network attachments, this network interface is a [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and is not allowed to be deleted.
:param str instance_id: The virtual server instance identifier.
:param str id: The instance network interface identifier.
@@ -5858,6 +6276,11 @@ def get_instance_network_interface(
This request retrieves a single instance network interface specified by the
identifier in the URL.
+ If this instance has network attachments, the retrieved network interface is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface.
:param str instance_id: The virtual server instance identifier.
:param str id: The instance network interface identifier.
@@ -5916,6 +6339,10 @@ def update_instance_network_interface(
in an instance network interface patch object. The instance network interface
patch object is structured in the same way as a retrieved instance network
interface and needs to contain only the information to be updated.
+ If this instance has network attachments, this network interface is a [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and is not allowed to be updated.
:param str instance_id: The virtual server instance identifier.
:param str id: The instance network interface identifier.
@@ -6152,9 +6579,11 @@ def add_instance_network_interface_floating_ip(
Associate a floating IP with an instance network interface.
This request associates the specified floating IP with the specified instance
- network interface, replacing any existing association. For this request to
- succeed, the existing floating IP must not be required by another resource, such
- as a public gateway. A request body is not required, and if provided, is ignored.
+ network interface, replacing any existing association.
+ The existing floating IP must:
+ - not be required by another resource, such as a public gateway
+ - be in the same `zone` as the instance
+ A request body is not required, and if provided, is ignored.
:param str instance_id: The virtual server instance identifier.
:param str network_interface_id: The instance network interface identifier.
@@ -6207,8 +6636,8 @@ def list_instance_network_interface_ips(
instance_id: str,
network_interface_id: str,
*,
- start: str = None,
- limit: int = None,
+ start: Optional[str] = None,
+ limit: Optional[int] = None,
**kwargs,
) -> DetailedResponse:
"""
@@ -6379,8 +6808,8 @@ def create_instance_volume_attachment(
instance_id: str,
volume: 'VolumeAttachmentPrototypeVolume',
*,
- delete_volume_on_instance_delete: bool = None,
- name: str = None,
+ delete_volume_on_instance_delete: Optional[bool] = None,
+ name: Optional[str] = None,
**kwargs,
) -> DetailedResponse:
"""
@@ -6637,8 +7066,8 @@ def update_instance_volume_attachment(
def list_instance_groups(
self,
*,
- start: str = None,
- limit: int = None,
+ start: Optional[str] = None,
+ limit: Optional[int] = None,
**kwargs,
) -> DetailedResponse:
"""
@@ -6690,12 +7119,12 @@ def create_instance_group(
instance_template: 'InstanceTemplateIdentity',
subnets: List['SubnetIdentity'],
*,
- application_port: int = None,
- load_balancer: 'LoadBalancerIdentity' = None,
- load_balancer_pool: 'LoadBalancerPoolIdentity' = None,
- membership_count: int = None,
- name: str = None,
- resource_group: 'ResourceGroupIdentity' = None,
+ application_port: Optional[int] = None,
+ load_balancer: Optional['LoadBalancerIdentity'] = None,
+ load_balancer_pool: Optional['LoadBalancerPoolIdentity'] = None,
+ membership_count: Optional[int] = None,
+ name: Optional[str] = None,
+ resource_group: Optional['ResourceGroupIdentity'] = None,
**kwargs,
) -> DetailedResponse:
"""
@@ -7018,8 +7447,8 @@ def list_instance_group_managers(
self,
instance_group_id: str,
*,
- start: str = None,
- limit: int = None,
+ start: Optional[str] = None,
+ limit: Optional[int] = None,
**kwargs,
) -> DetailedResponse:
"""
@@ -7312,8 +7741,8 @@ def list_instance_group_manager_actions(
instance_group_id: str,
instance_group_manager_id: str,
*,
- start: str = None,
- limit: int = None,
+ start: Optional[str] = None,
+ limit: Optional[int] = None,
**kwargs,
) -> DetailedResponse:
"""
@@ -7631,8 +8060,8 @@ def list_instance_group_manager_policies(
instance_group_id: str,
instance_group_manager_id: str,
*,
- start: str = None,
- limit: int = None,
+ start: Optional[str] = None,
+ limit: Optional[int] = None,
**kwargs,
) -> DetailedResponse:
"""
@@ -8001,8 +8430,8 @@ def list_instance_group_memberships(
self,
instance_group_id: str,
*,
- start: str = None,
- limit: int = None,
+ start: Optional[str] = None,
+ limit: Optional[int] = None,
**kwargs,
) -> DetailedResponse:
"""
@@ -8231,6 +8660,392 @@ def update_instance_group_membership(
response = self.send(request, **kwargs)
return response
+ #########################
+ # Reservations
+ #########################
+
+ def list_reservations(
+ self,
+ *,
+ start: Optional[str] = None,
+ limit: Optional[int] = None,
+ name: Optional[str] = None,
+ resource_group_id: Optional[str] = None,
+ zone_name: Optional[str] = None,
+ **kwargs,
+ ) -> DetailedResponse:
+ """
+ List all reservations.
+
+ This request lists all reservations in the region. A reservation provides reserved
+ capacity for a specified profile in a specified zone. A reservation can also
+ include a long-term committed use discount.
+ The reservations will be sorted by their `created_at` property values, with newest
+ reservations first. Reservations with identical `created_at` property values will
+ in turn be sorted by ascending `name` property values.
+
+ :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 name: (optional) Filters the collection to resources with a
+ `name` property matching the exact specified name.
+ :param str resource_group_id: (optional) Filters the collection to
+ resources with a `resource_group.id` property matching the specified
+ identifier.
+ :param str zone_name: (optional) Filters the collection to resources with a
+ `zone.name` property matching the exact specified name.
+ :param dict headers: A `dict` containing the request headers
+ :return: A `DetailedResponse` containing the result, headers and HTTP status code.
+ :rtype: DetailedResponse with `dict` result representing a `ReservationCollection` object
+ """
+
+ headers = {}
+ sdk_headers = get_sdk_headers(
+ service_name=self.DEFAULT_SERVICE_NAME,
+ service_version='V1',
+ operation_id='list_reservations',
+ )
+ headers.update(sdk_headers)
+
+ params = {
+ 'version': self.version,
+ 'generation': self.generation,
+ 'start': start,
+ 'limit': limit,
+ 'name': name,
+ 'resource_group.id': resource_group_id,
+ 'zone.name': zone_name,
+ }
+
+ if 'headers' in kwargs:
+ headers.update(kwargs.get('headers'))
+ del kwargs['headers']
+ headers['Accept'] = 'application/json'
+
+ url = '/reservations'
+ request = self.prepare_request(
+ method='GET',
+ url=url,
+ headers=headers,
+ params=params,
+ )
+
+ response = self.send(request, **kwargs)
+ return response
+
+ def create_reservation(
+ self,
+ capacity: 'ReservationCapacityPrototype',
+ committed_use: 'ReservationCommittedUsePrototype',
+ profile: 'ReservationProfilePrototype',
+ zone: 'ZoneIdentity',
+ *,
+ affinity_policy: Optional[str] = None,
+ name: Optional[str] = None,
+ resource_group: Optional['ResourceGroupIdentity'] = None,
+ **kwargs,
+ ) -> DetailedResponse:
+ """
+ Create a reservation.
+
+ This request creates a new reservation from a reservation prototype object. The
+ prototype object is structured in the same way as a retrieved reservation, and
+ contains the information necessary to create the new reservation.
+
+ :param ReservationCapacityPrototype capacity: The capacity reservation
+ configuration to use.
+ :param ReservationCommittedUsePrototype committed_use: The committed use
+ configuration to use for this reservation.
+ :param ReservationProfilePrototype profile: The
+ [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for
+ this
+ reservation.
+ :param ZoneIdentity zone: The zone to use for this reservation.
+ :param str affinity_policy: (optional) The affinity policy to use for this
+ reservation:
+ - `restricted`: The reservation must be manually requested.
+ :param str name: (optional) The name for this reservation. The name must
+ not be used by another reservation in the region. If unspecified, the name
+ will be a hyphenated list of randomly-selected words.
+ :param ResourceGroupIdentity resource_group: (optional) The resource group
+ to use. If unspecified, the account's [default resource
+ group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be
+ 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 `Reservation` object
+ """
+
+ if capacity is None:
+ raise ValueError('capacity must be provided')
+ if committed_use is None:
+ raise ValueError('committed_use must be provided')
+ if profile is None:
+ raise ValueError('profile must be provided')
+ if zone is None:
+ raise ValueError('zone must be provided')
+ capacity = convert_model(capacity)
+ committed_use = convert_model(committed_use)
+ profile = convert_model(profile)
+ zone = convert_model(zone)
+ 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_reservation',
+ )
+ headers.update(sdk_headers)
+
+ params = {
+ 'version': self.version,
+ 'generation': self.generation,
+ }
+
+ data = {
+ 'capacity': capacity,
+ 'committed_use': committed_use,
+ 'profile': profile,
+ 'zone': zone,
+ 'affinity_policy': affinity_policy,
+ 'name': name,
+ 'resource_group': resource_group,
+ }
+ data = {k: v for (k, v) in data.items() if v is not None}
+ data = json.dumps(data)
+ headers['content-type'] = 'application/json'
+
+ if 'headers' in kwargs:
+ headers.update(kwargs.get('headers'))
+ del kwargs['headers']
+ headers['Accept'] = 'application/json'
+
+ url = '/reservations'
+ request = self.prepare_request(
+ method='POST',
+ url=url,
+ headers=headers,
+ params=params,
+ data=data,
+ )
+
+ response = self.send(request, **kwargs)
+ return response
+
+ def delete_reservation(
+ self,
+ id: str,
+ **kwargs,
+ ) -> DetailedResponse:
+ """
+ Delete a reservation.
+
+ This request deletes a reservation. This operation cannot be reversed.
+ Reservations with a `status` of `active` are not allowed to be deleted.
+
+ :param str id: The reservation 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 `Reservation` object
+ """
+
+ if not id:
+ raise ValueError('id must be provided')
+ headers = {}
+ sdk_headers = get_sdk_headers(
+ service_name=self.DEFAULT_SERVICE_NAME,
+ service_version='V1',
+ operation_id='delete_reservation',
+ )
+ headers.update(sdk_headers)
+
+ params = {
+ 'version': self.version,
+ 'generation': self.generation,
+ }
+
+ if 'headers' in kwargs:
+ headers.update(kwargs.get('headers'))
+ del kwargs['headers']
+ headers['Accept'] = 'application/json'
+
+ path_param_keys = ['id']
+ path_param_values = self.encode_path_vars(id)
+ path_param_dict = dict(zip(path_param_keys, path_param_values))
+ url = '/reservations/{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_reservation(
+ self,
+ id: str,
+ **kwargs,
+ ) -> DetailedResponse:
+ """
+ Retrieve a reservation.
+
+ This request retrieves a single reservation specified by identifier in the URL.
+
+ :param str id: The reservation 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 `Reservation` object
+ """
+
+ if not id:
+ raise ValueError('id must be provided')
+ headers = {}
+ sdk_headers = get_sdk_headers(
+ service_name=self.DEFAULT_SERVICE_NAME,
+ service_version='V1',
+ operation_id='get_reservation',
+ )
+ headers.update(sdk_headers)
+
+ params = {
+ 'version': self.version,
+ 'generation': self.generation,
+ }
+
+ if 'headers' in kwargs:
+ headers.update(kwargs.get('headers'))
+ del kwargs['headers']
+ headers['Accept'] = 'application/json'
+
+ path_param_keys = ['id']
+ path_param_values = self.encode_path_vars(id)
+ path_param_dict = dict(zip(path_param_keys, path_param_values))
+ url = '/reservations/{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_reservation(
+ self,
+ id: str,
+ reservation_patch: 'ReservationPatch',
+ **kwargs,
+ ) -> DetailedResponse:
+ """
+ Update a reservation.
+
+ This request updates a reservation with the information provided in a reservation
+ patch object. The patch object is structured in the same way as a retrieved
+ reservation and needs to contain only the information to be updated.
+
+ :param str id: The reservation identifier.
+ :param ReservationPatch reservation_patch: The reservation 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 `Reservation` object
+ """
+
+ if not id:
+ raise ValueError('id must be provided')
+ if reservation_patch is None:
+ raise ValueError('reservation_patch must be provided')
+ if isinstance(reservation_patch, ReservationPatch):
+ reservation_patch = convert_model(reservation_patch)
+ headers = {}
+ sdk_headers = get_sdk_headers(
+ service_name=self.DEFAULT_SERVICE_NAME,
+ service_version='V1',
+ operation_id='update_reservation',
+ )
+ headers.update(sdk_headers)
+
+ params = {
+ 'version': self.version,
+ 'generation': self.generation,
+ }
+
+ data = json.dumps(reservation_patch)
+ headers['content-type'] = 'application/merge-patch+json'
+
+ if 'headers' in kwargs:
+ headers.update(kwargs.get('headers'))
+ del kwargs['headers']
+ headers['Accept'] = 'application/json'
+
+ path_param_keys = ['id']
+ path_param_values = self.encode_path_vars(id)
+ path_param_dict = dict(zip(path_param_keys, path_param_values))
+ url = '/reservations/{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 activate_reservation(
+ self,
+ id: str,
+ **kwargs,
+ ) -> DetailedResponse:
+ """
+ Activate a reservation.
+
+ This request activates a reservation. For this request to succeed, the reservation
+ status must be `inactive`.
+
+ :param str id: The reservation identifier.
+ :param dict headers: A `dict` containing the request headers
+ :return: A `DetailedResponse` containing the result, headers and HTTP status code.
+ :rtype: DetailedResponse
+ """
+
+ if not id:
+ raise ValueError('id must be provided')
+ headers = {}
+ sdk_headers = get_sdk_headers(
+ service_name=self.DEFAULT_SERVICE_NAME,
+ service_version='V1',
+ operation_id='activate_reservation',
+ )
+ headers.update(sdk_headers)
+
+ params = {
+ 'version': self.version,
+ 'generation': self.generation,
+ }
+
+ if 'headers' in kwargs:
+ headers.update(kwargs.get('headers'))
+ del kwargs['headers']
+
+ path_param_keys = ['id']
+ path_param_values = self.encode_path_vars(id)
+ path_param_dict = dict(zip(path_param_keys, path_param_values))
+ url = '/reservations/{id}/activate'.format(**path_param_dict)
+ request = self.prepare_request(
+ method='POST',
+ url=url,
+ headers=headers,
+ params=params,
+ )
+
+ response = self.send(request, **kwargs)
+ return response
+
#########################
# Dedicated hosts
#########################
@@ -8238,11 +9053,11 @@ def update_instance_group_membership(
def list_dedicated_host_groups(
self,
*,
- start: str = None,
- limit: int = None,
- resource_group_id: str = None,
- zone_name: str = None,
- name: str = None,
+ start: Optional[str] = None,
+ limit: Optional[int] = None,
+ resource_group_id: Optional[str] = None,
+ zone_name: Optional[str] = None,
+ name: Optional[str] = None,
**kwargs,
) -> DetailedResponse:
"""
@@ -8307,8 +9122,8 @@ def create_dedicated_host_group(
family: str,
zone: 'ZoneIdentity',
*,
- name: str = None,
- resource_group: 'ResourceGroupIdentity' = None,
+ name: Optional[str] = None,
+ resource_group: Optional['ResourceGroupIdentity'] = None,
**kwargs,
) -> DetailedResponse:
"""
@@ -8551,8 +9366,8 @@ def update_dedicated_host_group(
def list_dedicated_host_profiles(
self,
*,
- start: str = None,
- limit: int = None,
+ start: Optional[str] = None,
+ limit: Optional[int] = None,
**kwargs,
) -> DetailedResponse:
"""
@@ -8656,12 +9471,12 @@ def get_dedicated_host_profile(
def list_dedicated_hosts(
self,
*,
- dedicated_host_group_id: str = None,
- start: str = None,
- limit: int = None,
- resource_group_id: str = None,
- zone_name: str = None,
- name: str = None,
+ dedicated_host_group_id: Optional[str] = None,
+ start: Optional[str] = None,
+ limit: Optional[int] = None,
+ resource_group_id: Optional[str] = None,
+ zone_name: Optional[str] = None,
+ name: Optional[str] = None,
**kwargs,
) -> DetailedResponse:
"""
@@ -9119,11 +9934,11 @@ def update_dedicated_host(
def list_backup_policies(
self,
*,
- start: str = None,
- limit: int = None,
- resource_group_id: str = None,
- name: str = None,
- tag: str = None,
+ start: Optional[str] = None,
+ limit: Optional[int] = None,
+ resource_group_id: Optional[str] = None,
+ name: Optional[str] = None,
+ tag: Optional[str] = None,
**kwargs,
) -> DetailedResponse:
"""
@@ -9184,13 +9999,7 @@ def list_backup_policies(
def create_backup_policy(
self,
- match_user_tags: List[str],
- *,
- match_resource_types: List[str] = None,
- name: str = None,
- plans: List['BackupPolicyPlanPrototype'] = None,
- resource_group: 'ResourceGroupIdentity' = None,
- scope: 'BackupPolicyScopePrototype' = None,
+ backup_policy_prototype: 'BackupPolicyPrototype',
**kwargs,
) -> DetailedResponse:
"""
@@ -9200,37 +10009,17 @@ def create_backup_policy(
The prototype object is structured in the same way as a retrieved backup policy,
and contains the information necessary to create the new backup policy.
- :param List[str] match_user_tags: The user tags this backup policy will
- apply to. Resources that have both a matching user tag and a matching type
- will be subject to the backup policy.
- :param List[str] match_resource_types: (optional) The resource types this
- backup policy will apply to. Resources that have both a matching type and a
- matching user tag will be subject to the backup policy.
- :param str name: (optional) The name for this backup policy. The name must
- not be used by another backup policy in the region. If unspecified, the
- name will be a hyphenated list of randomly-selected words.
- :param List[BackupPolicyPlanPrototype] plans: (optional) The prototype
- objects for backup plans to be created for this backup policy.
- :param ResourceGroupIdentity resource_group: (optional) The resource group
- to use. If unspecified, the account's [default resource
- group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be
- used.
- :param BackupPolicyScopePrototype scope: (optional) The scope to use for
- this backup policy.
- If unspecified, the policy will be scoped to the account.
+ :param BackupPolicyPrototype backup_policy_prototype: The backup policy
+ 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 `BackupPolicy` object
"""
- if match_user_tags is None:
- raise ValueError('match_user_tags must be provided')
- if plans is not None:
- plans = [convert_model(x) for x in plans]
- if resource_group is not None:
- resource_group = convert_model(resource_group)
- if scope is not None:
- scope = convert_model(scope)
+ if backup_policy_prototype is None:
+ raise ValueError('backup_policy_prototype must be provided')
+ if isinstance(backup_policy_prototype, BackupPolicyPrototype):
+ backup_policy_prototype = convert_model(backup_policy_prototype)
headers = {}
sdk_headers = get_sdk_headers(
service_name=self.DEFAULT_SERVICE_NAME,
@@ -9244,16 +10033,7 @@ def create_backup_policy(
'generation': self.generation,
}
- data = {
- 'match_user_tags': match_user_tags,
- 'match_resource_types': match_resource_types,
- 'name': name,
- 'plans': plans,
- 'resource_group': resource_group,
- 'scope': scope,
- }
- data = {k: v for (k, v) in data.items() if v is not None}
- data = json.dumps(data)
+ data = json.dumps(backup_policy_prototype)
headers['content-type'] = 'application/json'
if 'headers' in kwargs:
@@ -9277,14 +10057,14 @@ def list_backup_policy_jobs(
self,
backup_policy_id: str,
*,
- status: str = None,
- backup_policy_plan_id: str = None,
- start: str = None,
- limit: int = None,
- sort: str = None,
- source_id: str = None,
- target_snapshots_id: str = None,
- target_snapshots_crn: str = None,
+ status: Optional[str] = None,
+ backup_policy_plan_id: Optional[str] = None,
+ start: Optional[str] = None,
+ limit: Optional[int] = None,
+ sort: Optional[str] = None,
+ source_id: Optional[str] = None,
+ target_snapshots_id: Optional[str] = None,
+ target_snapshots_crn: Optional[str] = None,
**kwargs,
) -> DetailedResponse:
"""
@@ -9421,7 +10201,7 @@ def list_backup_policy_plans(
self,
backup_policy_id: str,
*,
- name: str = None,
+ name: Optional[str] = None,
**kwargs,
) -> DetailedResponse:
"""
@@ -9478,13 +10258,13 @@ def create_backup_policy_plan(
backup_policy_id: str,
cron_spec: str,
*,
- active: bool = None,
- attach_user_tags: List[str] = None,
- clone_policy: 'BackupPolicyPlanClonePolicyPrototype' = None,
- copy_user_tags: bool = None,
- deletion_trigger: 'BackupPolicyPlanDeletionTriggerPrototype' = None,
- name: str = None,
- remote_region_policies: List['BackupPolicyPlanRemoteRegionPolicyPrototype'] = None,
+ active: Optional[bool] = None,
+ attach_user_tags: Optional[List[str]] = None,
+ clone_policy: Optional['BackupPolicyPlanClonePolicyPrototype'] = None,
+ copy_user_tags: Optional[bool] = None,
+ deletion_trigger: Optional['BackupPolicyPlanDeletionTriggerPrototype'] = None,
+ name: Optional[str] = None,
+ remote_region_policies: Optional[List['BackupPolicyPlanRemoteRegionPolicyPrototype']] = None,
**kwargs,
) -> DetailedResponse:
"""
@@ -9588,7 +10368,7 @@ def delete_backup_policy_plan(
backup_policy_id: str,
id: str,
*,
- if_match: str = None,
+ if_match: Optional[str] = None,
**kwargs,
) -> DetailedResponse:
"""
@@ -9710,7 +10490,7 @@ def update_backup_policy_plan(
id: str,
backup_policy_plan_patch: 'BackupPolicyPlanPatch',
*,
- if_match: str = None,
+ if_match: Optional[str] = None,
**kwargs,
) -> DetailedResponse:
"""
@@ -9782,7 +10562,7 @@ def delete_backup_policy(
self,
id: str,
*,
- if_match: str = None,
+ if_match: Optional[str] = None,
**kwargs,
) -> DetailedResponse:
"""
@@ -9893,7 +10673,7 @@ def update_backup_policy(
id: str,
backup_policy_patch: 'BackupPolicyPatch',
*,
- if_match: str = None,
+ if_match: Optional[str] = None,
**kwargs,
) -> DetailedResponse:
"""
@@ -9964,8 +10744,8 @@ def update_backup_policy(
def list_placement_groups(
self,
*,
- start: str = None,
- limit: int = None,
+ start: Optional[str] = None,
+ limit: Optional[int] = None,
**kwargs,
) -> DetailedResponse:
"""
@@ -10016,8 +10796,8 @@ def create_placement_group(
self,
strategy: str,
*,
- name: str = None,
- resource_group: 'ResourceGroupIdentity' = None,
+ name: Optional[str] = None,
+ resource_group: Optional['ResourceGroupIdentity'] = None,
**kwargs,
) -> DetailedResponse:
"""
@@ -10259,8 +11039,8 @@ def update_placement_group(
def list_bare_metal_server_profiles(
self,
*,
- start: str = None,
- limit: int = None,
+ start: Optional[str] = None,
+ limit: Optional[int] = None,
**kwargs,
) -> DetailedResponse:
"""
@@ -10364,13 +11144,13 @@ def get_bare_metal_server_profile(
def list_bare_metal_servers(
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,
+ start: Optional[str] = None,
+ limit: Optional[int] = None,
+ resource_group_id: Optional[str] = None,
+ name: Optional[str] = None,
+ vpc_id: Optional[str] = None,
+ vpc_crn: Optional[str] = None,
+ vpc_name: Optional[str] = None,
**kwargs,
) -> DetailedResponse:
"""
@@ -10435,17 +11215,7 @@ def list_bare_metal_servers(
def create_bare_metal_server(
self,
- initialization: 'BareMetalServerInitializationPrototype',
- primary_network_interface: 'BareMetalServerPrimaryNetworkInterfacePrototype',
- profile: 'BareMetalServerProfileIdentity',
- zone: 'ZoneIdentity',
- *,
- enable_secure_boot: bool = None,
- name: str = None,
- network_interfaces: List['BareMetalServerNetworkInterfacePrototype'] = None,
- resource_group: 'ResourceGroupIdentity' = None,
- trusted_platform_module: 'BareMetalServerTrustedPlatformModulePrototype' = None,
- vpc: 'VPCIdentity' = None,
+ bare_metal_server_prototype: 'BareMetalServerPrototype',
**kwargs,
) -> DetailedResponse:
"""
@@ -10456,59 +11226,17 @@ def create_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: The primary bare metal server network interface
- to create.
- :param BareMetalServerProfileIdentity profile: The
- [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-bare-metal-servers-profile)
- to use for this bare metal server.
- :param ZoneIdentity zone: The zone this bare metal server will reside in.
- :param bool enable_secure_boot: (optional) Indicates whether secure boot is
- enabled. If enabled, the image must support secure boot or the server will
- fail to boot.
- :param str name: (optional) The name for this bare metal server. The name
- must not be used by another bare metal server in the region. If
- unspecified, the name will be a hyphenated list of randomly-selected words.
- The system hostname will be based on this name.
- :param List[BareMetalServerNetworkInterfacePrototype] network_interfaces:
- (optional) The additional bare metal server network interfaces to create.
- :param ResourceGroupIdentity resource_group: (optional) The resource group
- to use. If unspecified, the account's [default resource
- group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be
- used.
- :param BareMetalServerTrustedPlatformModulePrototype
- trusted_platform_module: (optional)
- :param VPCIdentity vpc: (optional) The VPC this bare metal server will
- reside in.
- If specified, it must match the VPC for the subnets that the network
- interfaces of
- the bare metal server are attached to.
+ :param BareMetalServerPrototype bare_metal_server_prototype: The bare metal
+ server 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 `BareMetalServer` object
"""
- 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 trusted_platform_module is not None:
- trusted_platform_module = convert_model(trusted_platform_module)
- if vpc is not None:
- vpc = convert_model(vpc)
+ if bare_metal_server_prototype is None:
+ raise ValueError('bare_metal_server_prototype must be provided')
+ if isinstance(bare_metal_server_prototype, BareMetalServerPrototype):
+ bare_metal_server_prototype = convert_model(bare_metal_server_prototype)
headers = {}
sdk_headers = get_sdk_headers(
service_name=self.DEFAULT_SERVICE_NAME,
@@ -10522,20 +11250,7 @@ def create_bare_metal_server(
'generation': self.generation,
}
- data = {
- 'initialization': initialization,
- 'primary_network_interface': primary_network_interface,
- 'profile': profile,
- 'zone': zone,
- 'enable_secure_boot': enable_secure_boot,
- 'name': name,
- 'network_interfaces': network_interfaces,
- 'resource_group': resource_group,
- 'trusted_platform_module': trusted_platform_module,
- 'vpc': vpc,
- }
- data = {k: v for (k, v) in data.items() if v is not None}
- data = json.dumps(data)
+ data = json.dumps(bare_metal_server_prototype)
headers['content-type'] = 'application/json'
if 'headers' in kwargs:
@@ -10560,7 +11275,7 @@ def create_bare_metal_server_console_access_token(
bare_metal_server_id: str,
console_type: str,
*,
- force: bool = None,
+ force: Optional[bool] = None,
**kwargs,
) -> DetailedResponse:
"""
@@ -10802,12 +11517,323 @@ def update_bare_metal_server_disk(
response = self.send(request, **kwargs)
return response
+ def list_bare_metal_server_network_attachments(
+ self,
+ bare_metal_server_id: str,
+ *,
+ start: Optional[str] = None,
+ limit: Optional[int] = None,
+ **kwargs,
+ ) -> DetailedResponse:
+ """
+ List all network attachments on a bare metal server.
+
+ This request lists all network attachments on a bare metal server. A bare metal
+ server network attachment is an abstract representation of a network device and
+ attaches a bare metal server to a single subnet. Each network interface on a bare
+ metal server can attach to any subnet in the zone, including subnets that are
+ already attached to the bare metal server.
+ The network attachments will be sorted by their `created_at` property values, with
+ newest network attachments first. Network attachments with identical `created_at`
+ property values will in turn be sorted by ascending `name` property values.
+
+ :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 dict headers: A `dict` containing the request headers
+ :return: A `DetailedResponse` containing the result, headers and HTTP status code.
+ :rtype: DetailedResponse with `dict` result representing a `BareMetalServerNetworkAttachmentCollection` object
+ """
+
+ if not bare_metal_server_id:
+ raise ValueError('bare_metal_server_id must be provided')
+ headers = {}
+ sdk_headers = get_sdk_headers(
+ service_name=self.DEFAULT_SERVICE_NAME,
+ service_version='V1',
+ operation_id='list_bare_metal_server_network_attachments',
+ )
+ headers.update(sdk_headers)
+
+ params = {
+ 'version': self.version,
+ 'generation': self.generation,
+ 'start': start,
+ 'limit': limit,
+ }
+
+ if 'headers' in kwargs:
+ headers.update(kwargs.get('headers'))
+ del kwargs['headers']
+ headers['Accept'] = 'application/json'
+
+ path_param_keys = ['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_attachments'.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_bare_metal_server_network_attachment(
+ self,
+ bare_metal_server_id: str,
+ bare_metal_server_network_attachment_prototype: 'BareMetalServerNetworkAttachmentPrototype',
+ **kwargs,
+ ) -> DetailedResponse:
+ """
+ Create a network attachment on a bare metal server.
+
+ This request creates a new bare metal server network attachment from a bare metal
+ server network attachment prototype object. The prototype object is structured in
+ the same way as a retrieved bare metal server network attachment, and contains the
+ information necessary to create the new bare metal server network attachment.
+
+ :param str bare_metal_server_id: The bare metal server identifier.
+ :param BareMetalServerNetworkAttachmentPrototype
+ bare_metal_server_network_attachment_prototype: The bare metal server
+ network attachment 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 `BareMetalServerNetworkAttachment` object
+ """
+
+ if not bare_metal_server_id:
+ raise ValueError('bare_metal_server_id must be provided')
+ if bare_metal_server_network_attachment_prototype is None:
+ raise ValueError('bare_metal_server_network_attachment_prototype must be provided')
+ if isinstance(bare_metal_server_network_attachment_prototype, BareMetalServerNetworkAttachmentPrototype):
+ bare_metal_server_network_attachment_prototype = convert_model(bare_metal_server_network_attachment_prototype)
+ headers = {}
+ sdk_headers = get_sdk_headers(
+ service_name=self.DEFAULT_SERVICE_NAME,
+ service_version='V1',
+ operation_id='create_bare_metal_server_network_attachment',
+ )
+ headers.update(sdk_headers)
+
+ params = {
+ 'version': self.version,
+ 'generation': self.generation,
+ }
+
+ data = json.dumps(bare_metal_server_network_attachment_prototype)
+ headers['content-type'] = 'application/json'
+
+ if 'headers' in kwargs:
+ headers.update(kwargs.get('headers'))
+ del kwargs['headers']
+ headers['Accept'] = 'application/json'
+
+ path_param_keys = ['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_attachments'.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_bare_metal_server_network_attachment(
+ self,
+ bare_metal_server_id: str,
+ id: str,
+ **kwargs,
+ ) -> DetailedResponse:
+ """
+ Delete a bare metal server network attachment.
+
+ This request deletes a bare metal server network attachment. This operation cannot
+ be reversed. Any floating IPs associated with the bare metal server network
+ attachment are implicitly disassociated.
+ The bare metal server's primary network attachment cannot be deleted.
+
+ :param str bare_metal_server_id: The bare metal server identifier.
+ :param str id: The bare metal server network attachment identifier.
+ :param dict headers: A `dict` containing the request headers
+ :return: A `DetailedResponse` containing the result, headers and HTTP status code.
+ :rtype: DetailedResponse
+ """
+
+ if not bare_metal_server_id:
+ raise ValueError('bare_metal_server_id must be provided')
+ if not id:
+ raise ValueError('id must be provided')
+ headers = {}
+ sdk_headers = get_sdk_headers(
+ service_name=self.DEFAULT_SERVICE_NAME,
+ service_version='V1',
+ operation_id='delete_bare_metal_server_network_attachment',
+ )
+ headers.update(sdk_headers)
+
+ params = {
+ 'version': self.version,
+ 'generation': self.generation,
+ }
+
+ if 'headers' in kwargs:
+ headers.update(kwargs.get('headers'))
+ del kwargs['headers']
+
+ path_param_keys = ['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}/network_attachments/{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_bare_metal_server_network_attachment(
+ self,
+ bare_metal_server_id: str,
+ id: str,
+ **kwargs,
+ ) -> DetailedResponse:
+ """
+ Retrieve a bare metal server network attachment.
+
+ This request retrieves a single bare metal server network attachment specified by
+ the identifier in the URL.
+
+ :param str bare_metal_server_id: The bare metal server identifier.
+ :param str id: The bare metal server network attachment 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 `BareMetalServerNetworkAttachment` object
+ """
+
+ if not bare_metal_server_id:
+ raise ValueError('bare_metal_server_id must be provided')
+ if not id:
+ raise ValueError('id must be provided')
+ headers = {}
+ sdk_headers = get_sdk_headers(
+ service_name=self.DEFAULT_SERVICE_NAME,
+ service_version='V1',
+ operation_id='get_bare_metal_server_network_attachment',
+ )
+ headers.update(sdk_headers)
+
+ params = {
+ 'version': self.version,
+ 'generation': self.generation,
+ }
+
+ if 'headers' in kwargs:
+ headers.update(kwargs.get('headers'))
+ del kwargs['headers']
+ headers['Accept'] = 'application/json'
+
+ path_param_keys = ['bare_metal_server_id', '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}/network_attachments/{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_bare_metal_server_network_attachment(
+ self,
+ bare_metal_server_id: str,
+ id: str,
+ bare_metal_server_network_attachment_patch: 'BareMetalServerNetworkAttachmentPatch',
+ **kwargs,
+ ) -> DetailedResponse:
+ """
+ Update a bare metal server network attachment.
+
+ This request updates a bare metal server network attachment with the information
+ provided in a bare metal server network attachment patch object. The bare metal
+ server network attachment patch object is structured in the same way as a
+ retrieved bare metal server network attachment and contains only the information
+ to be updated.
+
+ :param str bare_metal_server_id: The bare metal server identifier.
+ :param str id: The bare metal server network attachment identifier.
+ :param BareMetalServerNetworkAttachmentPatch
+ bare_metal_server_network_attachment_patch: The bare metal server network
+ attachment 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 `BareMetalServerNetworkAttachment` object
+ """
+
+ if not bare_metal_server_id:
+ raise ValueError('bare_metal_server_id must be provided')
+ if not id:
+ raise ValueError('id must be provided')
+ if bare_metal_server_network_attachment_patch is None:
+ raise ValueError('bare_metal_server_network_attachment_patch must be provided')
+ if isinstance(bare_metal_server_network_attachment_patch, BareMetalServerNetworkAttachmentPatch):
+ bare_metal_server_network_attachment_patch = convert_model(bare_metal_server_network_attachment_patch)
+ headers = {}
+ sdk_headers = get_sdk_headers(
+ service_name=self.DEFAULT_SERVICE_NAME,
+ service_version='V1',
+ operation_id='update_bare_metal_server_network_attachment',
+ )
+ headers.update(sdk_headers)
+
+ params = {
+ 'version': self.version,
+ 'generation': self.generation,
+ }
+
+ data = json.dumps(bare_metal_server_network_attachment_patch)
+ headers['content-type'] = 'application/merge-patch+json'
+
+ if 'headers' in kwargs:
+ headers.update(kwargs.get('headers'))
+ del kwargs['headers']
+ headers['Accept'] = 'application/json'
+
+ path_param_keys = ['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}/network_attachments/{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_bare_metal_server_network_interfaces(
self,
bare_metal_server_id: str,
*,
- start: str = None,
- limit: int = None,
+ start: Optional[str] = None,
+ limit: Optional[int] = None,
**kwargs,
) -> DetailedResponse:
"""
@@ -10818,6 +11844,11 @@ def list_bare_metal_server_network_interfaces(
attaches a bare metal server to a single subnet. Each network interface on a bare
metal server can attach to any subnet in the zone, including subnets that are
already attached to the bare metal server.
+ If this bare metal server has network attachments, each returned network interface
+ is a [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface.
:param str bare_metal_server_id: The bare metal server identifier.
:param str start: (optional) A server-provided token determining what
@@ -10880,6 +11911,11 @@ def create_bare_metal_server_network_interface(
subnet in the bare metal server's VPC may be specified, even if it is already
attached to another bare metal server network interface. Addresses on the bare
metal server network interface must be within the specified subnet's CIDR blocks.
+ If this bare metal server has network attachments, each network interface is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and new network interfaces are not allowed to be created.
:param str bare_metal_server_id: The bare metal server identifier.
:param BareMetalServerNetworkInterfacePrototype
@@ -10945,6 +11981,11 @@ def delete_bare_metal_server_network_interface(
be reversed. Any floating IPs associated with the bare metal server network
interface are implicitly disassociated. The primary bare metal server network
interface is not allowed to be deleted.
+ If this bare metal server has network attachments, this network interface is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and is not allowed to be deleted.
:param str bare_metal_server_id: The bare metal server identifier.
:param str id: The bare metal server network interface identifier.
@@ -10999,6 +12040,11 @@ def get_bare_metal_server_network_interface(
This request retrieves a single bare metal server network interface specified by
the identifier in the URL.
+ If this bare metal server has network attachments, the retrieved network interface
+ is a [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface.
:param str bare_metal_server_id: The bare metal server identifier.
:param str id: The bare metal server network interface identifier.
@@ -11058,6 +12104,11 @@ def update_bare_metal_server_network_interface(
server network interface patch object is structured in the same way as a retrieved
bare metal server network interface and needs to contain only the information to
be updated.
+ If this bare metal server has network attachments, this network interface is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and is not allowed to be updated.
:param str bare_metal_server_id: The bare metal server identifier.
:param str id: The bare metal server network interface identifier.
@@ -11301,9 +12352,11 @@ def add_bare_metal_server_network_interface_floating_ip(
This request associates the specified floating IP with the specified bare metal
server network interface. If `enable_infrastructure_nat` is `false`, this adds the
IP to any existing associations. If `enable_infrastructure_nat` is `true`, this
- replaces any existing association. For this request to succeed, the existing
- floating IP must not be required by another resource, such as a public gateway. A
- request body is not required, and if provided, is ignored.
+ replaces any existing association.
+ The existing floating IP must:
+ - not be required by another resource, such as a public gateway
+ - be in the same `zone` as the bare metal server
+ A request body is not required, and if provided, is ignored.
:param str bare_metal_server_id: The bare metal server identifier.
:param str network_interface_id: The bare metal server network interface
@@ -11857,8 +12910,8 @@ def stop_bare_metal_server(
def list_volume_profiles(
self,
*,
- start: str = None,
- limit: int = None,
+ start: Optional[str] = None,
+ limit: Optional[int] = None,
**kwargs,
) -> DetailedResponse:
"""
@@ -11961,14 +13014,14 @@ def get_volume_profile(
def list_volumes(
self,
*,
- start: str = None,
- limit: int = None,
- name: str = None,
- attachment_state: str = None,
- encryption: str = None,
- operating_system_family: str = None,
- operating_system_architecture: str = None,
- zone_name: str = None,
+ start: Optional[str] = None,
+ limit: Optional[int] = None,
+ name: Optional[str] = None,
+ attachment_state: Optional[str] = None,
+ encryption: Optional[str] = None,
+ operating_system_family: Optional[str] = None,
+ operating_system_architecture: Optional[str] = None,
+ zone_name: Optional[str] = None,
**kwargs,
) -> DetailedResponse:
"""
@@ -12101,7 +13154,7 @@ def delete_volume(
self,
id: str,
*,
- if_match: str = None,
+ if_match: Optional[str] = None,
**kwargs,
) -> DetailedResponse:
"""
@@ -12208,7 +13261,7 @@ def update_volume(
id: str,
volume_patch: 'VolumePatch',
*,
- if_match: str = None,
+ if_match: Optional[str] = None,
**kwargs,
) -> DetailedResponse:
"""
@@ -12276,6 +13329,311 @@ def update_volume(
# Snapshots
#########################
+ def list_snapshot_consistency_groups(
+ self,
+ *,
+ start: Optional[str] = None,
+ limit: Optional[int] = None,
+ resource_group_id: Optional[str] = None,
+ name: Optional[str] = None,
+ sort: Optional[str] = None,
+ backup_policy_plan_id: Optional[str] = None,
+ **kwargs,
+ ) -> DetailedResponse:
+ """
+ List all snapshot consistency groups.
+
+ This request lists all snapshot consistency groups in the region. A snapshot
+ consistency group is a collection of individual snapshots taken at the same time.
+
+ :param str start: (optional) A server-provided token determining what
+ resource to start the page on.
+ :param int limit: (optional) The number of resources to return on a page.
+ :param str resource_group_id: (optional) Filters the collection to
+ resources with a `resource_group.id` property matching the specified
+ identifier.
+ :param str name: (optional) Filters the collection to resources with a
+ `name` property matching the exact specified name.
+ :param str sort: (optional) Sorts the returned collection by the specified
+ property name in ascending order. A `-` may be prepended to the name to
+ sort in descending order. For example, the value `-created_at` sorts the
+ collection by the `created_at` property in descending order, and the value
+ `name` sorts it by the `name` property in ascending order.
+ :param str backup_policy_plan_id: (optional) Filters the collection to
+ backup policy jobs with a `backup_policy_plan.id` property matching the
+ specified identifier.
+ :param dict headers: A `dict` containing the request headers
+ :return: A `DetailedResponse` containing the result, headers and HTTP status code.
+ :rtype: DetailedResponse with `dict` result representing a `SnapshotConsistencyGroupCollection` object
+ """
+
+ headers = {}
+ sdk_headers = get_sdk_headers(
+ service_name=self.DEFAULT_SERVICE_NAME,
+ service_version='V1',
+ operation_id='list_snapshot_consistency_groups',
+ )
+ headers.update(sdk_headers)
+
+ params = {
+ 'version': self.version,
+ 'generation': self.generation,
+ 'start': start,
+ 'limit': limit,
+ 'resource_group.id': resource_group_id,
+ 'name': name,
+ 'sort': sort,
+ 'backup_policy_plan.id': backup_policy_plan_id,
+ }
+
+ if 'headers' in kwargs:
+ headers.update(kwargs.get('headers'))
+ del kwargs['headers']
+ headers['Accept'] = 'application/json'
+
+ url = '/snapshot_consistency_groups'
+ request = self.prepare_request(
+ method='GET',
+ url=url,
+ headers=headers,
+ params=params,
+ )
+
+ response = self.send(request, **kwargs)
+ return response
+
+ def create_snapshot_consistency_group(
+ self,
+ snapshot_consistency_group_prototype: 'SnapshotConsistencyGroupPrototype',
+ **kwargs,
+ ) -> DetailedResponse:
+ """
+ Create a snapshot consistency group.
+
+ This request creates a new snapshot consistency group from a snapshot consistency
+ group object. The prototype object is structured in the same way as a retrieved
+ consistency group, and contains the information necessary to provision the new
+ snapshot consistency group.
+
+ :param SnapshotConsistencyGroupPrototype
+ snapshot_consistency_group_prototype: The snapshot consistency group
+ 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 `SnapshotConsistencyGroup` object
+ """
+
+ if snapshot_consistency_group_prototype is None:
+ raise ValueError('snapshot_consistency_group_prototype must be provided')
+ if isinstance(snapshot_consistency_group_prototype, SnapshotConsistencyGroupPrototype):
+ snapshot_consistency_group_prototype = convert_model(snapshot_consistency_group_prototype)
+ headers = {}
+ sdk_headers = get_sdk_headers(
+ service_name=self.DEFAULT_SERVICE_NAME,
+ service_version='V1',
+ operation_id='create_snapshot_consistency_group',
+ )
+ headers.update(sdk_headers)
+
+ params = {
+ 'version': self.version,
+ 'generation': self.generation,
+ }
+
+ data = json.dumps(snapshot_consistency_group_prototype)
+ headers['content-type'] = 'application/json'
+
+ if 'headers' in kwargs:
+ headers.update(kwargs.get('headers'))
+ del kwargs['headers']
+ headers['Accept'] = 'application/json'
+
+ url = '/snapshot_consistency_groups'
+ request = self.prepare_request(
+ method='POST',
+ url=url,
+ headers=headers,
+ params=params,
+ data=data,
+ )
+
+ response = self.send(request, **kwargs)
+ return response
+
+ def delete_snapshot_consistency_group(
+ self,
+ id: str,
+ **kwargs,
+ ) -> DetailedResponse:
+ """
+ Delete a snapshot consistency group.
+
+ This request deletes snapshot consistency group. This operation cannot be
+ reversed. If the `delete_snapshots_on_delete` property is `true`, all snapshots in
+ the consistency group will also be deleted.
+
+ :param str id: The snapshot consistency 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 `SnapshotConsistencyGroup` object
+ """
+
+ if not id:
+ raise ValueError('id must be provided')
+ headers = {}
+ sdk_headers = get_sdk_headers(
+ service_name=self.DEFAULT_SERVICE_NAME,
+ service_version='V1',
+ operation_id='delete_snapshot_consistency_group',
+ )
+ headers.update(sdk_headers)
+
+ params = {
+ 'version': self.version,
+ 'generation': self.generation,
+ }
+
+ if 'headers' in kwargs:
+ headers.update(kwargs.get('headers'))
+ del kwargs['headers']
+ headers['Accept'] = 'application/json'
+
+ path_param_keys = ['id']
+ path_param_values = self.encode_path_vars(id)
+ path_param_dict = dict(zip(path_param_keys, path_param_values))
+ url = '/snapshot_consistency_groups/{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_snapshot_consistency_group(
+ self,
+ id: str,
+ **kwargs,
+ ) -> DetailedResponse:
+ """
+ Retrieve a snapshot consistency group.
+
+ This request retrieves a single snapshot consistency group specified by the
+ identifier in the URL.
+
+ :param str id: The snapshot consistency 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 `SnapshotConsistencyGroup` object
+ """
+
+ if not id:
+ raise ValueError('id must be provided')
+ headers = {}
+ sdk_headers = get_sdk_headers(
+ service_name=self.DEFAULT_SERVICE_NAME,
+ service_version='V1',
+ operation_id='get_snapshot_consistency_group',
+ )
+ headers.update(sdk_headers)
+
+ params = {
+ 'version': self.version,
+ 'generation': self.generation,
+ }
+
+ if 'headers' in kwargs:
+ headers.update(kwargs.get('headers'))
+ del kwargs['headers']
+ headers['Accept'] = 'application/json'
+
+ path_param_keys = ['id']
+ path_param_values = self.encode_path_vars(id)
+ path_param_dict = dict(zip(path_param_keys, path_param_values))
+ url = '/snapshot_consistency_groups/{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_snapshot_consistency_group(
+ self,
+ id: str,
+ snapshot_consistency_group_patch: 'SnapshotConsistencyGroupPatch',
+ *,
+ if_match: Optional[str] = None,
+ **kwargs,
+ ) -> DetailedResponse:
+ """
+ Update a snapshot consistency group.
+
+ This request updates a snapshot consistency group with the information in a
+ provided snapshot consistency group patch. The snapshot consistency group patch
+ object is structured in the same way as a retrieved snapshot consistency group and
+ contains only the information to be updated.
+
+ :param str id: The snapshot consistency group identifier.
+ :param SnapshotConsistencyGroupPatch snapshot_consistency_group_patch: The
+ snapshot consistency group patch.
+ :param str if_match: (optional) If present, the request will fail if the
+ specified ETag value does not match the resource's current ETag value.
+ Required if the request body includes an array.
+ :param dict headers: A `dict` containing the request headers
+ :return: A `DetailedResponse` containing the result, headers and HTTP status code.
+ :rtype: DetailedResponse with `dict` result representing a `SnapshotConsistencyGroup` object
+ """
+
+ if not id:
+ raise ValueError('id must be provided')
+ if snapshot_consistency_group_patch is None:
+ raise ValueError('snapshot_consistency_group_patch must be provided')
+ if isinstance(snapshot_consistency_group_patch, SnapshotConsistencyGroupPatch):
+ snapshot_consistency_group_patch = convert_model(snapshot_consistency_group_patch)
+ headers = {
+ 'If-Match': if_match,
+ }
+ sdk_headers = get_sdk_headers(
+ service_name=self.DEFAULT_SERVICE_NAME,
+ service_version='V1',
+ operation_id='update_snapshot_consistency_group',
+ )
+ headers.update(sdk_headers)
+
+ params = {
+ 'version': self.version,
+ 'generation': self.generation,
+ }
+
+ data = json.dumps(snapshot_consistency_group_patch)
+ headers['content-type'] = 'application/merge-patch+json'
+
+ if 'headers' in kwargs:
+ headers.update(kwargs.get('headers'))
+ del kwargs['headers']
+ headers['Accept'] = 'application/json'
+
+ path_param_keys = ['id']
+ path_param_values = self.encode_path_vars(id)
+ path_param_dict = dict(zip(path_param_keys, path_param_values))
+ url = '/snapshot_consistency_groups/{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 delete_snapshots(
self,
source_volume_id: str,
@@ -12327,26 +13685,28 @@ def delete_snapshots(
def list_snapshots(
self,
*,
- start: str = None,
- limit: int = None,
- tag: str = None,
- resource_group_id: str = None,
- name: str = None,
- source_volume_id: str = None,
- source_volume_crn: str = None,
- source_image_id: str = None,
- source_image_crn: str = None,
- sort: str = None,
- backup_policy_plan_id: str = None,
- copies_id: str = None,
- copies_name: str = None,
- copies_crn: str = None,
- copies_remote_region_name: str = None,
- source_snapshot_id: str = None,
- source_snapshot_remote_region_name: str = None,
- source_volume_remote_region_name: str = None,
- source_image_remote_region_name: str = None,
- clones_zone_name: str = None,
+ start: Optional[str] = None,
+ limit: Optional[int] = None,
+ tag: Optional[str] = None,
+ resource_group_id: Optional[str] = None,
+ name: Optional[str] = None,
+ source_volume_id: Optional[str] = None,
+ source_volume_crn: Optional[str] = None,
+ source_image_id: Optional[str] = None,
+ source_image_crn: Optional[str] = None,
+ sort: Optional[str] = None,
+ backup_policy_plan_id: Optional[str] = None,
+ copies_id: Optional[str] = None,
+ copies_name: Optional[str] = None,
+ copies_crn: Optional[str] = None,
+ copies_remote_region_name: Optional[str] = None,
+ source_snapshot_id: Optional[str] = None,
+ source_snapshot_remote_region_name: Optional[str] = None,
+ source_volume_remote_region_name: Optional[str] = None,
+ source_image_remote_region_name: Optional[str] = None,
+ clones_zone_name: Optional[str] = None,
+ snapshot_consistency_group_id: Optional[str] = None,
+ snapshot_consistency_group_crn: Optional[str] = None,
**kwargs,
) -> DetailedResponse:
"""
@@ -12414,6 +13774,12 @@ def list_snapshots(
:param str clones_zone_name: (optional) Filters the collection to snapshots
with an item in the `clones` property with a `zone.name` property matching
the exact specified name.
+ :param str snapshot_consistency_group_id: (optional) Filters the collection
+ to resources with a `snapshot_consistency_group.id` property matching the
+ specified identifier.
+ :param str snapshot_consistency_group_crn: (optional) Filters the
+ collection to resources with a `snapshot_consistency_group.crn` property
+ matching the specified identifier.
:param dict headers: A `dict` containing the request headers
:return: A `DetailedResponse` containing the result, headers and HTTP status code.
:rtype: DetailedResponse with `dict` result representing a `SnapshotCollection` object
@@ -12450,6 +13816,8 @@ def list_snapshots(
'source_volume.remote.region.name': source_volume_remote_region_name,
'source_image.remote.region.name': source_image_remote_region_name,
'clones[].zone.name': clones_zone_name,
+ 'snapshot_consistency_group.id': snapshot_consistency_group_id,
+ 'snapshot_consistency_group.crn': snapshot_consistency_group_crn,
}
if 'headers' in kwargs:
@@ -12527,7 +13895,7 @@ def delete_snapshot(
self,
id: str,
*,
- if_match: str = None,
+ if_match: Optional[str] = None,
**kwargs,
) -> DetailedResponse:
"""
@@ -12633,7 +14001,7 @@ def update_snapshot(
id: str,
snapshot_patch: 'SnapshotPatch',
*,
- if_match: str = None,
+ if_match: Optional[str] = None,
**kwargs,
) -> DetailedResponse:
"""
@@ -12920,9 +14288,9 @@ def create_snapshot_clone(
def list_share_profiles(
self,
*,
- start: str = None,
- limit: int = None,
- sort: str = None,
+ start: Optional[str] = None,
+ limit: Optional[int] = None,
+ sort: Optional[str] = None,
**kwargs,
) -> DetailedResponse:
"""
@@ -13032,12 +14400,12 @@ def get_share_profile(
def list_shares(
self,
*,
- start: str = None,
- limit: int = None,
- resource_group_id: str = None,
- name: str = None,
- sort: str = None,
- replication_role: str = None,
+ start: Optional[str] = None,
+ limit: Optional[int] = None,
+ resource_group_id: Optional[str] = None,
+ name: Optional[str] = None,
+ sort: Optional[str] = None,
+ replication_role: Optional[str] = None,
**kwargs,
) -> DetailedResponse:
"""
@@ -13161,7 +14529,7 @@ def delete_share(
self,
id: str,
*,
- if_match: str = None,
+ if_match: Optional[str] = None,
**kwargs,
) -> DetailedResponse:
"""
@@ -13274,7 +14642,7 @@ def update_share(
id: str,
share_patch: 'SharePatch',
*,
- if_match: str = None,
+ if_match: Optional[str] = None,
**kwargs,
) -> DetailedResponse:
"""
@@ -13342,8 +14710,8 @@ def failover_share(
self,
share_id: str,
*,
- fallback_policy: str = None,
- timeout: int = None,
+ fallback_policy: Optional[str] = None,
+ timeout: Optional[int] = None,
**kwargs,
) -> DetailedResponse:
"""
@@ -13421,9 +14789,9 @@ def list_share_mount_targets(
self,
share_id: str,
*,
- name: str = None,
- start: str = None,
- limit: int = None,
+ name: Optional[str] = None,
+ start: Optional[str] = None,
+ limit: Optional[int] = None,
**kwargs,
) -> DetailedResponse:
"""
@@ -14049,9 +15417,9 @@ def get_region_zone(
def list_virtual_network_interfaces(
self,
*,
- start: str = None,
- limit: int = None,
- resource_group_id: str = None,
+ start: Optional[str] = None,
+ limit: Optional[int] = None,
+ resource_group_id: Optional[str] = None,
**kwargs,
) -> DetailedResponse:
"""
@@ -14109,30 +15477,105 @@ def list_virtual_network_interfaces(
response = self.send(request, **kwargs)
return response
- def get_virtual_network_interface(
+ def create_virtual_network_interface(
self,
- id: str,
+ *,
+ allow_ip_spoofing: Optional[bool] = None,
+ auto_delete: Optional[bool] = None,
+ enable_infrastructure_nat: Optional[bool] = None,
+ ips: Optional[List['VirtualNetworkInterfaceIPPrototype']] = None,
+ name: Optional[str] = None,
+ primary_ip: Optional['VirtualNetworkInterfacePrimaryIPPrototype'] = None,
+ resource_group: Optional['ResourceGroupIdentity'] = None,
+ security_groups: Optional[List['SecurityGroupIdentity']] = None,
+ subnet: Optional['SubnetIdentity'] = None,
**kwargs,
) -> DetailedResponse:
"""
- Retrieve a virtual network interface.
+ Create a virtual network interface.
- This request retrieves a single virtual network interface specified by the
- identifier in the URL.
+ This request creates a new virtual network interface from a virtual network
+ interface prototype object. The prototype object is structured in the same way as
+ a retrieved virtual network interface, and contains the information necessary to
+ create the new virtual network interface.
- :param str id: The virtual network interface identifier.
+ :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 auto_delete: (optional) Indicates whether this virtual network
+ interface will be automatically deleted when
+ `target` is deleted. Must be `false` if the virtual network interface is
+ unbound.
+ :param bool enable_infrastructure_nat: (optional) If `true`:
+ - The VPC infrastructure performs any needed NAT operations.
+ - `floating_ips` must not have more than one floating IP.
+ If `false`:
+ - Packets are passed unchanged to/from the virtual network interface,
+ allowing the workload to perform any needed NAT operations.
+ - `allow_ip_spoofing` must be `false`.
+ - Can only be attached to a `target` with a `resource_type` of
+ `bare_metal_server_network_attachment`.
+ :param List[VirtualNetworkInterfaceIPPrototype] ips: (optional) Additional
+ IP addresses to bind to the virtual network interface. Each item may be
+ either a reserved IP identity, or a reserved IP prototype object which will
+ be used to create a new reserved IP. All IP addresses must be in the
+ primary IP's subnet.
+ If reserved IP identities are provided, the specified reserved IPs must be
+ unbound.
+ If reserved IP prototype objects with addresses are provided, the addresses
+ must be available on the virtual network interface's subnet. For any
+ prototype objects that do not specify an address, an available address on
+ the subnet will be automatically selected and reserved.
+ :param str name: (optional) The name for this virtual network interface.
+ The name must not be used by another virtual network interface in the VPC.
+ If unspecified, the name will be a hyphenated list of randomly-selected
+ words. Names beginning with `ibm-` are reserved for provider-owned
+ resources, and are not allowed.
+ :param VirtualNetworkInterfacePrimaryIPPrototype primary_ip: (optional) The
+ primary IP address to bind to the virtual network interface. May be either
+ a
+ reserved IP identity, or a reserved IP prototype object which will be used
+ to create a
+ new reserved IP.
+ If a reserved IP identity is provided, the specified reserved IP must be
+ unbound.
+ If a reserved IP prototype object with an address is provided, the address
+ must be
+ available on the virtual network interface's subnet. If no address is
+ specified,
+ an available address on the subnet will be automatically selected and
+ reserved.
+ :param ResourceGroupIdentity resource_group: (optional) The resource group
+ to use. If unspecified, the account's [default resource
+ group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be
+ used.
+ :param List[SecurityGroupIdentity] security_groups: (optional) The security
+ groups to use for this virtual network interface. If unspecified, the
+ default security group of the VPC for the subnet is used.
+ :param SubnetIdentity subnet: (optional) The associated subnet. Required if
+ `primary_ip` does not specify a reserved IP
+ identity.
:param dict headers: A `dict` containing the request headers
:return: A `DetailedResponse` containing the result, headers and HTTP status code.
:rtype: DetailedResponse with `dict` result representing a `VirtualNetworkInterface` object
"""
- if not id:
- raise ValueError('id must be provided')
+ if ips is not None:
+ ips = [convert_model(x) for x in ips]
+ if primary_ip is not None:
+ primary_ip = convert_model(primary_ip)
+ if resource_group is not None:
+ resource_group = convert_model(resource_group)
+ if security_groups is not None:
+ security_groups = [convert_model(x) for x in security_groups]
+ if subnet is not None:
+ subnet = convert_model(subnet)
headers = {}
sdk_headers = get_sdk_headers(
service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='get_virtual_network_interface',
+ operation_id='create_virtual_network_interface',
)
headers.update(sdk_headers)
@@ -14141,58 +15584,64 @@ def get_virtual_network_interface(
'generation': self.generation,
}
+ data = {
+ 'allow_ip_spoofing': allow_ip_spoofing,
+ 'auto_delete': auto_delete,
+ 'enable_infrastructure_nat': enable_infrastructure_nat,
+ 'ips': ips,
+ 'name': name,
+ 'primary_ip': primary_ip,
+ 'resource_group': resource_group,
+ 'security_groups': security_groups,
+ 'subnet': subnet,
+ }
+ data = {k: v for (k, v) in data.items() if v is not None}
+ data = json.dumps(data)
+ headers['content-type'] = 'application/json'
+
if 'headers' in kwargs:
headers.update(kwargs.get('headers'))
del kwargs['headers']
headers['Accept'] = 'application/json'
- path_param_keys = ['id']
- path_param_values = self.encode_path_vars(id)
- path_param_dict = dict(zip(path_param_keys, path_param_values))
- url = '/virtual_network_interfaces/{id}'.format(**path_param_dict)
+ url = '/virtual_network_interfaces'
request = self.prepare_request(
- method='GET',
+ method='POST',
url=url,
headers=headers,
params=params,
+ data=data,
)
response = self.send(request, **kwargs)
return response
- def update_virtual_network_interface(
+ def delete_virtual_network_interfaces(
self,
id: str,
- virtual_network_interface_patch: 'VirtualNetworkInterfacePatch',
**kwargs,
) -> DetailedResponse:
"""
- Update a virtual network interface.
+ Delete a virtual network interface.
- This request updates a virtual network interface with the information in a
- provided virtual network interface patch. The virtual network interface patch
- object is structured in the same way as a retrieved virtual network interface and
- contains only the information to be updated.
+ This request deletes a virtual network interface. This operation cannot be
+ reversed. For this request to succeed, the virtual network interface must not be
+ required by another resource, such as the primary network attachment for an
+ instance.
:param str id: The virtual network interface identifier.
- :param VirtualNetworkInterfacePatch virtual_network_interface_patch: The
- virtual network interface patch.
:param dict headers: A `dict` containing the request headers
:return: A `DetailedResponse` containing the result, headers and HTTP status code.
- :rtype: DetailedResponse with `dict` result representing a `VirtualNetworkInterface` object
+ :rtype: DetailedResponse
"""
if not id:
raise ValueError('id must be provided')
- if virtual_network_interface_patch is None:
- raise ValueError('virtual_network_interface_patch must be provided')
- if isinstance(virtual_network_interface_patch, VirtualNetworkInterfacePatch):
- virtual_network_interface_patch = convert_model(virtual_network_interface_patch)
headers = {}
sdk_headers = get_sdk_headers(
service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='update_virtual_network_interface',
+ operation_id='delete_virtual_network_interfaces',
)
headers.update(sdk_headers)
@@ -14201,74 +15650,54 @@ def update_virtual_network_interface(
'generation': self.generation,
}
- data = json.dumps(virtual_network_interface_patch)
- headers['content-type'] = 'application/merge-patch+json'
-
if 'headers' in kwargs:
headers.update(kwargs.get('headers'))
del kwargs['headers']
- headers['Accept'] = 'application/json'
path_param_keys = ['id']
path_param_values = self.encode_path_vars(id)
path_param_dict = dict(zip(path_param_keys, path_param_values))
url = '/virtual_network_interfaces/{id}'.format(**path_param_dict)
request = self.prepare_request(
- method='PATCH',
+ method='DELETE',
url=url,
headers=headers,
params=params,
- data=data,
)
response = self.send(request, **kwargs)
return response
- #########################
- # Public gateways
- #########################
-
- def list_public_gateways(
+ def get_virtual_network_interface(
self,
- *,
- start: str = None,
- limit: int = None,
- resource_group_id: str = None,
+ id: str,
**kwargs,
) -> DetailedResponse:
"""
- List all public gateways.
+ Retrieve a virtual network interface.
- 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 retrieves a single virtual network interface specified by the
+ identifier in the URL.
- :param str start: (optional) A server-provided token determining what
- resource to start the page on.
- :param int limit: (optional) The number of resources to return on a page.
- :param str resource_group_id: (optional) Filters the collection to
- resources with a `resource_group.id` property matching the specified
- identifier.
+ :param str id: The virtual network interface identifier.
:param dict headers: A `dict` containing the request headers
:return: A `DetailedResponse` containing the result, headers and HTTP status code.
- :rtype: DetailedResponse with `dict` result representing a `PublicGatewayCollection` object
+ :rtype: DetailedResponse with `dict` result representing a `VirtualNetworkInterface` object
"""
+ if not id:
+ raise ValueError('id must be provided')
headers = {}
sdk_headers = get_sdk_headers(
service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='list_public_gateways',
+ operation_id='get_virtual_network_interface',
)
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:
@@ -14276,7 +15705,10 @@ def list_public_gateways(
del kwargs['headers']
headers['Accept'] = 'application/json'
- url = '/public_gateways'
+ path_param_keys = ['id']
+ path_param_values = self.encode_path_vars(id)
+ path_param_dict = dict(zip(path_param_keys, path_param_values))
+ url = '/virtual_network_interfaces/{id}'.format(**path_param_dict)
request = self.prepare_request(
method='GET',
url=url,
@@ -14287,57 +15719,39 @@ def list_public_gateways(
response = self.send(request, **kwargs)
return response
- def create_public_gateway(
+ def update_virtual_network_interface(
self,
- vpc: 'VPCIdentity',
- zone: 'ZoneIdentity',
- *,
- floating_ip: 'PublicGatewayFloatingIPPrototype' = None,
- name: str = None,
- resource_group: 'ResourceGroupIdentity' = None,
+ id: str,
+ virtual_network_interface_patch: 'VirtualNetworkInterfacePatch',
**kwargs,
) -> DetailedResponse:
"""
- Create a public gateway.
+ Update a virtual network interface.
- 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 updates a virtual network interface with the information in a
+ provided virtual network interface patch. The virtual network interface patch
+ object is structured in the same way as a retrieved virtual network interface and
+ contains only the information to be updated.
- :param VPCIdentity vpc: The VPC this public gateway will reside in.
- :param ZoneIdentity zone: The zone this public gateway will reside in.
- :param PublicGatewayFloatingIPPrototype floating_ip: (optional)
- :param str name: (optional) The name for this public gateway. The name must
- not be used by another public gateway in the VPC. If unspecified, the name
- will be a hyphenated list of randomly-selected words.
- :param ResourceGroupIdentity resource_group: (optional) The resource group
- to use. If unspecified, the account's [default resource
- group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be
- used.
+ :param str id: The virtual network interface identifier.
+ :param VirtualNetworkInterfacePatch virtual_network_interface_patch: The
+ virtual network interface patch.
:param dict headers: A `dict` containing the request headers
:return: A `DetailedResponse` containing the result, headers and HTTP status code.
- :rtype: DetailedResponse with `dict` result representing a `PublicGateway` object
+ :rtype: DetailedResponse with `dict` result representing a `VirtualNetworkInterface` 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 not id:
+ raise ValueError('id must be provided')
+ if virtual_network_interface_patch is None:
+ raise ValueError('virtual_network_interface_patch must be provided')
+ if isinstance(virtual_network_interface_patch, VirtualNetworkInterfacePatch):
+ virtual_network_interface_patch = convert_model(virtual_network_interface_patch)
headers = {}
sdk_headers = get_sdk_headers(
service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='create_public_gateway',
+ operation_id='update_virtual_network_interface',
)
headers.update(sdk_headers)
@@ -14346,25 +15760,20 @@ def create_public_gateway(
'generation': self.generation,
}
- data = {
- 'vpc': vpc,
- 'zone': zone,
- 'floating_ip': floating_ip,
- 'name': name,
- 'resource_group': resource_group,
- }
- data = {k: v for (k, v) in data.items() if v is not None}
- data = json.dumps(data)
- headers['content-type'] = 'application/json'
+ data = json.dumps(virtual_network_interface_patch)
+ headers['content-type'] = 'application/merge-patch+json'
if 'headers' in kwargs:
headers.update(kwargs.get('headers'))
del kwargs['headers']
headers['Accept'] = 'application/json'
- url = '/public_gateways'
+ path_param_keys = ['id']
+ path_param_values = self.encode_path_vars(id)
+ path_param_dict = dict(zip(path_param_keys, path_param_values))
+ url = '/virtual_network_interfaces/{id}'.format(**path_param_dict)
request = self.prepare_request(
- method='POST',
+ method='PATCH',
url=url,
headers=headers,
params=params,
@@ -14374,50 +15783,64 @@ def create_public_gateway(
response = self.send(request, **kwargs)
return response
- def delete_public_gateway(
+ def list_network_interface_floating_ips(
self,
- id: str,
+ virtual_network_interface_id: str,
+ *,
+ start: Optional[str] = None,
+ limit: Optional[int] = None,
+ sort: Optional[str] = None,
**kwargs,
) -> DetailedResponse:
"""
- Delete a public gateway.
+ List all floating IPs associated with a virtual network interface.
- 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 lists all floating IPs associated with a virtual network interface.
- :param str id: The public gateway identifier.
+ :param str virtual_network_interface_id: The virtual network interface
+ identifier.
+ :param str start: (optional) A server-provided token determining what
+ resource to start the page on.
+ :param int limit: (optional) The number of resources to return on a page.
+ :param 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
+ `-name` sorts the collection by the `name` 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
+ :rtype: DetailedResponse with `dict` result representing a `FloatingIPCollectionVirtualNetworkInterfaceContext` object
"""
- if not id:
- raise ValueError('id must be provided')
+ if not virtual_network_interface_id:
+ raise ValueError('virtual_network_interface_id must be provided')
headers = {}
sdk_headers = get_sdk_headers(
service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='delete_public_gateway',
+ operation_id='list_network_interface_floating_ips',
)
headers.update(sdk_headers)
params = {
'version': self.version,
'generation': self.generation,
+ 'start': start,
+ 'limit': limit,
+ 'sort': sort,
}
if 'headers' in kwargs:
headers.update(kwargs.get('headers'))
del kwargs['headers']
+ headers['Accept'] = 'application/json'
- path_param_keys = ['id']
- path_param_values = self.encode_path_vars(id)
+ path_param_keys = ['virtual_network_interface_id']
+ path_param_values = self.encode_path_vars(virtual_network_interface_id)
path_param_dict = dict(zip(path_param_keys, path_param_values))
- url = '/public_gateways/{id}'.format(**path_param_dict)
+ url = '/virtual_network_interfaces/{virtual_network_interface_id}/floating_ips'.format(**path_param_dict)
request = self.prepare_request(
- method='DELETE',
+ method='GET',
url=url,
headers=headers,
params=params,
@@ -14426,30 +15849,35 @@ def delete_public_gateway(
response = self.send(request, **kwargs)
return response
- def get_public_gateway(
+ def remove_network_interface_floating_ip(
self,
+ virtual_network_interface_id: str,
id: str,
**kwargs,
) -> DetailedResponse:
"""
- Retrieve a public gateway.
+ Disassociate a floating IP from a virtual network interface.
- This request retrieves a single public gateway specified by the identifier in the
- URL.
+ This request disassociates the specified floating IP from the specified virtual
+ network interface.
- :param str id: The public gateway identifier.
+ :param str virtual_network_interface_id: The virtual 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 `PublicGateway` object
+ :rtype: DetailedResponse
"""
+ if not virtual_network_interface_id:
+ raise ValueError('virtual_network_interface_id must be provided')
if not id:
raise ValueError('id must be provided')
headers = {}
sdk_headers = get_sdk_headers(
service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='get_public_gateway',
+ operation_id='remove_network_interface_floating_ip',
)
headers.update(sdk_headers)
@@ -14461,14 +15889,13 @@ def get_public_gateway(
if 'headers' in kwargs:
headers.update(kwargs.get('headers'))
del kwargs['headers']
- headers['Accept'] = 'application/json'
- path_param_keys = ['id']
- path_param_values = self.encode_path_vars(id)
+ path_param_keys = ['virtual_network_interface_id', 'id']
+ path_param_values = self.encode_path_vars(virtual_network_interface_id, id)
path_param_dict = dict(zip(path_param_keys, path_param_values))
- url = '/public_gateways/{id}'.format(**path_param_dict)
+ url = '/virtual_network_interfaces/{virtual_network_interface_id}/floating_ips/{id}'.format(**path_param_dict)
request = self.prepare_request(
- method='GET',
+ method='DELETE',
url=url,
headers=headers,
params=params,
@@ -14477,35 +15904,35 @@ def get_public_gateway(
response = self.send(request, **kwargs)
return response
- def update_public_gateway(
+ def get_network_interface_floating_ip(
self,
+ virtual_network_interface_id: str,
id: str,
- public_gateway_patch: 'PublicGatewayPatch',
**kwargs,
) -> DetailedResponse:
"""
- Update a public gateway.
+ Retrieve associated floating IP.
- This request updates a public gateway's name.
+ This request retrieves a specified floating IP if it is associated with the
+ virtual network interface specified in the URL.
- :param str id: The public gateway identifier.
- :param PublicGatewayPatch public_gateway_patch: The public gateway patch.
+ :param str virtual_network_interface_id: The virtual 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 `PublicGateway` object
+ :rtype: DetailedResponse with `dict` result representing a `FloatingIPReference` object
"""
+ if not virtual_network_interface_id:
+ raise ValueError('virtual_network_interface_id must be provided')
if not id:
raise ValueError('id must be provided')
- if public_gateway_patch is None:
- raise ValueError('public_gateway_patch must be provided')
- if isinstance(public_gateway_patch, PublicGatewayPatch):
- public_gateway_patch = convert_model(public_gateway_patch)
headers = {}
sdk_headers = get_sdk_headers(
service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='update_public_gateway',
+ operation_id='get_network_interface_floating_ip',
)
headers.update(sdk_headers)
@@ -14514,79 +15941,72 @@ def update_public_gateway(
'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'))
del kwargs['headers']
headers['Accept'] = 'application/json'
- path_param_keys = ['id']
- path_param_values = self.encode_path_vars(id)
+ path_param_keys = ['virtual_network_interface_id', 'id']
+ path_param_values = self.encode_path_vars(virtual_network_interface_id, id)
path_param_dict = dict(zip(path_param_keys, path_param_values))
- url = '/public_gateways/{id}'.format(**path_param_dict)
+ url = '/virtual_network_interfaces/{virtual_network_interface_id}/floating_ips/{id}'.format(**path_param_dict)
request = self.prepare_request(
- method='PATCH',
+ method='GET',
url=url,
headers=headers,
params=params,
- data=data,
)
response = self.send(request, **kwargs)
return response
- #########################
- # Floating IPs
- #########################
-
- def list_floating_ips(
+ def add_network_interface_floating_ip(
self,
- *,
- start: str = None,
- limit: int = None,
- resource_group_id: str = None,
- sort: str = None,
+ virtual_network_interface_id: str,
+ id: str,
**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.
+ Add an association between a floating IP and a virtual network interface.
+
+ This request adds an association between the specified floating IP and the
+ specified virtual network interface.
+ If the virtual network interface has `enable_infrastructure_nat` set to `true`, no
+ more than one floating IP can be associated, and network address translation is
+ performed between the floating IP address and the virtual network interface's
+ `primary_ip` address.
+ If the virtual network interface has `enable_infrastructure_nat` set to `false`,
+ packets are passed unchanged to/from the virtual network interface.
+ The floating IP must:
+ - be in the same `zone` as the virtual network interface
+ - not currently be associated with another resource
+ The virtual network interface's `target` must not currently be a file share mount
+ target.
+ A request body is not required, and if provided, is ignored.
- :param str start: (optional) A server-provided token determining what
- resource to start the page on.
- :param int limit: (optional) The number of resources to return on a page.
- :param str resource_group_id: (optional) Filters the collection to
- resources with a `resource_group.id` property matching the specified
+ :param str virtual_network_interface_id: The virtual network interface
identifier.
- :param str sort: (optional) Sorts the returned collection by the specified
- property name in ascending order. A `-` may be prepended to the name to
- sort in descending order. For example, the value `-created_at` sorts the
- collection by the `created_at` property in descending order, and the value
- `name` sorts it by the `name` property in ascending order.
+ :param str id: The 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 `FloatingIPCollection` object
+ :rtype: DetailedResponse with `dict` result representing a `FloatingIPReference` object
"""
+ if not virtual_network_interface_id:
+ raise ValueError('virtual_network_interface_id must be provided')
+ if not id:
+ raise ValueError('id must be provided')
headers = {}
sdk_headers = get_sdk_headers(
service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='list_floating_ips',
+ operation_id='add_network_interface_floating_ip',
)
headers.update(sdk_headers)
params = {
'version': self.version,
'generation': self.generation,
- 'start': start,
- 'limit': limit,
- 'resource_group.id': resource_group_id,
- 'sort': sort,
}
if 'headers' in kwargs:
@@ -14594,9 +16014,12 @@ def list_floating_ips(
del kwargs['headers']
headers['Accept'] = 'application/json'
- url = '/floating_ips'
+ path_param_keys = ['virtual_network_interface_id', 'id']
+ path_param_values = self.encode_path_vars(virtual_network_interface_id, id)
+ path_param_dict = dict(zip(path_param_keys, path_param_values))
+ url = '/virtual_network_interfaces/{virtual_network_interface_id}/floating_ips/{id}'.format(**path_param_dict)
request = self.prepare_request(
- method='GET',
+ method='PUT',
url=url,
headers=headers,
params=params,
@@ -14605,85 +16028,103 @@ def list_floating_ips(
response = self.send(request, **kwargs)
return response
- def create_floating_ip(
+ def list_virtual_network_interface_ips(
self,
- floating_ip_prototype: 'FloatingIPPrototype',
+ virtual_network_interface_id: str,
+ *,
+ start: Optional[str] = None,
+ limit: Optional[int] = None,
+ sort: Optional[str] = None,
**kwargs,
) -> DetailedResponse:
"""
- Reserve a floating IP.
+ List all reserved IPs bound to a virtual network interface.
- This request reserves a new floating IP.
+ This request lists all reserved IPs bound to a virtual network interface.
- :param FloatingIPPrototype floating_ip_prototype: The floating IP prototype
- object.
+ :param str virtual_network_interface_id: The virtual network interface
+ identifier.
+ :param str start: (optional) A server-provided token determining what
+ resource to start the page on.
+ :param int limit: (optional) The number of resources to return on a page.
+ :param 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
+ `-name` sorts the collection by the `name` 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 `FloatingIP` object
+ :rtype: DetailedResponse with `dict` result representing a `ReservedIPCollectionVirtualNetworkInterfaceContext` object
"""
- if floating_ip_prototype is None:
- raise ValueError('floating_ip_prototype must be provided')
- if isinstance(floating_ip_prototype, FloatingIPPrototype):
- floating_ip_prototype = convert_model(floating_ip_prototype)
+ if not virtual_network_interface_id:
+ raise ValueError('virtual_network_interface_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='list_virtual_network_interface_ips',
)
headers.update(sdk_headers)
params = {
'version': self.version,
'generation': self.generation,
+ 'start': start,
+ 'limit': limit,
+ 'sort': sort,
}
- data = json.dumps(floating_ip_prototype)
- headers['content-type'] = 'application/json'
-
if 'headers' in kwargs:
headers.update(kwargs.get('headers'))
del kwargs['headers']
headers['Accept'] = 'application/json'
- url = '/floating_ips'
+ path_param_keys = ['virtual_network_interface_id']
+ path_param_values = self.encode_path_vars(virtual_network_interface_id)
+ path_param_dict = dict(zip(path_param_keys, path_param_values))
+ url = '/virtual_network_interfaces/{virtual_network_interface_id}/ips'.format(**path_param_dict)
request = self.prepare_request(
- method='POST',
+ method='GET',
url=url,
headers=headers,
params=params,
- data=data,
)
response = self.send(request, **kwargs)
return response
- def delete_floating_ip(
+ def remove_virtual_network_interface_ip(
self,
+ virtual_network_interface_id: str,
id: str,
**kwargs,
) -> DetailedResponse:
"""
- Delete a floating IP.
+ Unbind a reserved IP from a virtual network interface.
- 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 unbinds the specified reserved IP from the specified virtual network
+ interface. If the reserved IP has `auto_delete` set to `true`, the reserved IP
+ will be deleted.
+ The reserved IP for the `primary_ip` cannot be unbound.
- :param str id: The floating IP identifier.
+ :param str virtual_network_interface_id: The virtual network interface
+ identifier.
+ :param str id: The reserved IP identifier.
:param dict headers: A `dict` containing the request headers
:return: A `DetailedResponse` containing the result, headers and HTTP status code.
:rtype: DetailedResponse
"""
+ if not virtual_network_interface_id:
+ raise ValueError('virtual_network_interface_id must be provided')
if not id:
raise ValueError('id must be provided')
headers = {}
sdk_headers = get_sdk_headers(
service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='delete_floating_ip',
+ operation_id='remove_virtual_network_interface_ip',
)
headers.update(sdk_headers)
@@ -14696,10 +16137,10 @@ def delete_floating_ip(
headers.update(kwargs.get('headers'))
del kwargs['headers']
- path_param_keys = ['id']
- path_param_values = self.encode_path_vars(id)
+ path_param_keys = ['virtual_network_interface_id', 'id']
+ path_param_values = self.encode_path_vars(virtual_network_interface_id, id)
path_param_dict = dict(zip(path_param_keys, path_param_values))
- url = '/floating_ips/{id}'.format(**path_param_dict)
+ url = '/virtual_network_interfaces/{virtual_network_interface_id}/ips/{id}'.format(**path_param_dict)
request = self.prepare_request(
method='DELETE',
url=url,
@@ -14710,30 +16151,35 @@ def delete_floating_ip(
response = self.send(request, **kwargs)
return response
- def get_floating_ip(
+ def get_virtual_network_interface_ip(
self,
+ virtual_network_interface_id: str,
id: str,
**kwargs,
) -> DetailedResponse:
"""
- Retrieve a floating IP.
+ Retrieve bound reserved IP.
- This request retrieves a single floating IP specified by the identifier in the
- URL.
+ This request retrieves the specified reserved IP address if it is bound to the
+ virtual network interface specified in the URL.
- :param str id: The floating IP identifier.
+ :param str virtual_network_interface_id: The virtual network interface
+ identifier.
+ :param str id: The reserved IP identifier.
:param dict headers: A `dict` containing the request headers
:return: A `DetailedResponse` containing the result, headers and HTTP status code.
- :rtype: DetailedResponse with `dict` result representing a `FloatingIP` object
+ :rtype: DetailedResponse with `dict` result representing a `ReservedIPReference` object
"""
+ if not virtual_network_interface_id:
+ raise ValueError('virtual_network_interface_id must be provided')
if not id:
raise ValueError('id must be provided')
headers = {}
sdk_headers = get_sdk_headers(
service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='get_floating_ip',
+ operation_id='get_virtual_network_interface_ip',
)
headers.update(sdk_headers)
@@ -14747,10 +16193,10 @@ def get_floating_ip(
del kwargs['headers']
headers['Accept'] = 'application/json'
- path_param_keys = ['id']
- path_param_values = self.encode_path_vars(id)
+ path_param_keys = ['virtual_network_interface_id', 'id']
+ path_param_values = self.encode_path_vars(virtual_network_interface_id, id)
path_param_dict = dict(zip(path_param_keys, path_param_values))
- url = '/floating_ips/{id}'.format(**path_param_dict)
+ url = '/virtual_network_interfaces/{virtual_network_interface_id}/ips/{id}'.format(**path_param_dict)
request = self.prepare_request(
method='GET',
url=url,
@@ -14761,35 +16207,38 @@ def get_floating_ip(
response = self.send(request, **kwargs)
return response
- def update_floating_ip(
+ def add_virtual_network_interface_ip(
self,
+ virtual_network_interface_id: str,
id: str,
- floating_ip_patch: 'FloatingIPPatch',
**kwargs,
) -> DetailedResponse:
"""
- Update a floating IP.
+ Bind a reserved IP to a virtual network interface.
- This request updates a floating IP's name and/or target.
+ This request binds the specified reserved IP to the specified virtual network
+ interface.
+ The reserved IP must currently be unbound and in the primary IP's subnet. The
+ virtual network interface's `target` must not currently be a file share mount
+ target.
- :param str id: The floating IP identifier.
- :param FloatingIPPatch floating_ip_patch: The floating IP patch.
+ :param str virtual_network_interface_id: The virtual network interface
+ identifier.
+ :param str id: The reserved IP identifier.
:param dict headers: A `dict` containing the request headers
:return: A `DetailedResponse` containing the result, headers and HTTP status code.
- :rtype: DetailedResponse with `dict` result representing a `FloatingIP` object
+ :rtype: DetailedResponse with `dict` result representing a `ReservedIPReference` object
"""
+ if not virtual_network_interface_id:
+ raise ValueError('virtual_network_interface_id must be provided')
if not id:
raise ValueError('id must be provided')
- if floating_ip_patch is None:
- raise ValueError('floating_ip_patch must be provided')
- if isinstance(floating_ip_patch, FloatingIPPatch):
- floating_ip_patch = convert_model(floating_ip_patch)
headers = {}
sdk_headers = get_sdk_headers(
service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='update_floating_ip',
+ operation_id='add_virtual_network_interface_ip',
)
headers.update(sdk_headers)
@@ -14798,48 +16247,44 @@ def update_floating_ip(
'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'))
del kwargs['headers']
headers['Accept'] = 'application/json'
- path_param_keys = ['id']
- path_param_values = self.encode_path_vars(id)
+ path_param_keys = ['virtual_network_interface_id', 'id']
+ path_param_values = self.encode_path_vars(virtual_network_interface_id, id)
path_param_dict = dict(zip(path_param_keys, path_param_values))
- url = '/floating_ips/{id}'.format(**path_param_dict)
+ url = '/virtual_network_interfaces/{virtual_network_interface_id}/ips/{id}'.format(**path_param_dict)
request = self.prepare_request(
- method='PATCH',
+ method='PUT',
url=url,
headers=headers,
params=params,
- data=data,
)
response = self.send(request, **kwargs)
return response
#########################
- # Network ACLs
+ # Public gateways
#########################
- def list_network_acls(
+ def list_public_gateways(
self,
*,
- start: str = None,
- limit: int = None,
- resource_group_id: str = None,
+ start: Optional[str] = None,
+ limit: Optional[int] = None,
+ resource_group_id: Optional[str] = None,
**kwargs,
) -> DetailedResponse:
"""
- List all network ACLs.
+ List all public gateways.
- 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 public gateways in the region. A public gateway is a
+ virtual network device associated with a VPC, which allows access to the Internet.
+ A public gateway resides in a zone and can be connected to subnets in the same
+ zone only.
:param str start: (optional) A server-provided token determining what
resource to start the page on.
@@ -14849,14 +16294,14 @@ def list_network_acls(
identifier.
:param dict headers: A `dict` containing the request headers
:return: A `DetailedResponse` containing the result, headers and HTTP status code.
- :rtype: DetailedResponse with `dict` result representing a `NetworkACLCollection` object
+ :rtype: DetailedResponse with `dict` result representing a `PublicGatewayCollection` object
"""
headers = {}
sdk_headers = get_sdk_headers(
service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='list_network_acls',
+ operation_id='list_public_gateways',
)
headers.update(sdk_headers)
@@ -14873,7 +16318,7 @@ def list_network_acls(
del kwargs['headers']
headers['Accept'] = 'application/json'
- url = '/network_acls'
+ url = '/public_gateways'
request = self.prepare_request(
method='GET',
url=url,
@@ -14884,34 +16329,57 @@ def list_network_acls(
response = self.send(request, **kwargs)
return response
- def create_network_acl(
+ def create_public_gateway(
self,
- network_acl_prototype: 'NetworkACLPrototype',
+ vpc: 'VPCIdentity',
+ zone: 'ZoneIdentity',
+ *,
+ floating_ip: Optional['PublicGatewayFloatingIPPrototype'] = None,
+ name: Optional[str] = None,
+ resource_group: Optional['ResourceGroupIdentity'] = None,
**kwargs,
) -> DetailedResponse:
"""
- Create a network ACL.
+ Create a public gateway.
- This request creates a new stateless network ACL from a network ACL prototype
- object. The prototype object is structured in the same way as a retrieved network
- ACL, and contains the information necessary to create the new network ACL.
+ This request 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 NetworkACLPrototype network_acl_prototype: The network ACL prototype
- object.
+ :param VPCIdentity vpc: The VPC this public gateway will reside in.
+ :param ZoneIdentity zone: The zone this public gateway will reside in.
+ :param PublicGatewayFloatingIPPrototype floating_ip: (optional)
+ :param str name: (optional) The name for this public gateway. The name must
+ not be used by another public gateway in the VPC. If unspecified, the name
+ will be a hyphenated list of randomly-selected words.
+ :param ResourceGroupIdentity resource_group: (optional) The resource group
+ to use. If unspecified, the account's [default resource
+ group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be
+ 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 `NetworkACL` object
+ :rtype: DetailedResponse with `dict` result representing a `PublicGateway` object
"""
- if network_acl_prototype is None:
- raise ValueError('network_acl_prototype must be provided')
- if isinstance(network_acl_prototype, NetworkACLPrototype):
- network_acl_prototype = convert_model(network_acl_prototype)
+ if 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='create_network_acl',
+ operation_id='create_public_gateway',
)
headers.update(sdk_headers)
@@ -14920,7 +16388,15 @@ def create_network_acl(
'generation': self.generation,
}
- data = json.dumps(network_acl_prototype)
+ 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:
@@ -14928,7 +16404,7 @@ def create_network_acl(
del kwargs['headers']
headers['Accept'] = 'application/json'
- url = '/network_acls'
+ url = '/public_gateways'
request = self.prepare_request(
method='POST',
url=url,
@@ -14940,19 +16416,20 @@ def create_network_acl(
response = self.send(request, **kwargs)
return response
- def delete_network_acl(
+ def delete_public_gateway(
self,
id: str,
**kwargs,
) -> DetailedResponse:
"""
- Delete a network ACL.
+ Delete a public gateway.
- 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 public gateway. This operation cannot be reversed. For this
+ request to succeed, the public gateway must not be attached to any subnets. The
+ public gateway's floating IP will be automatically unbound. If the floating IP was
+ created when the public gateway was created, it will be deleted.
- :param str id: The network ACL 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
@@ -14964,7 +16441,7 @@ def delete_network_acl(
sdk_headers = get_sdk_headers(
service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='delete_network_acl',
+ operation_id='delete_public_gateway',
)
headers.update(sdk_headers)
@@ -14980,7 +16457,7 @@ def delete_network_acl(
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 = '/public_gateways/{id}'.format(**path_param_dict)
request = self.prepare_request(
method='DELETE',
url=url,
@@ -14991,21 +16468,21 @@ def delete_network_acl(
response = self.send(request, **kwargs)
return response
- def get_network_acl(
+ def get_public_gateway(
self,
id: str,
**kwargs,
) -> DetailedResponse:
"""
- Retrieve a network ACL.
+ Retrieve a public gateway.
- This request retrieves a single network ACL specified by the identifier in the
+ This request retrieves a single public gateway specified by the identifier in the
URL.
- :param str id: The network ACL 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 `NetworkACL` object
+ :rtype: DetailedResponse with `dict` result representing a `PublicGateway` object
"""
if not id:
@@ -15014,7 +16491,7 @@ def get_network_acl(
sdk_headers = get_sdk_headers(
service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='get_network_acl',
+ operation_id='get_public_gateway',
)
headers.update(sdk_headers)
@@ -15031,7 +16508,7 @@ def get_network_acl(
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 = '/public_gateways/{id}'.format(**path_param_dict)
request = self.prepare_request(
method='GET',
url=url,
@@ -15042,35 +16519,35 @@ def get_network_acl(
response = self.send(request, **kwargs)
return response
- def update_network_acl(
+ def update_public_gateway(
self,
id: str,
- network_acl_patch: 'NetworkACLPatch',
+ public_gateway_patch: 'PublicGatewayPatch',
**kwargs,
) -> DetailedResponse:
"""
- Update a network ACL.
+ Update a public gateway.
- This request updates a network ACL's name.
+ This request updates a public gateway's name.
- :param str id: The network ACL identifier.
- :param NetworkACLPatch network_acl_patch: The network ACL patch.
+ :param str id: The public gateway identifier.
+ :param PublicGatewayPatch public_gateway_patch: The public gateway patch.
:param dict headers: A `dict` containing the request headers
:return: A `DetailedResponse` containing the result, headers and HTTP status code.
- :rtype: DetailedResponse with `dict` result representing a `NetworkACL` object
+ :rtype: DetailedResponse with `dict` result representing a `PublicGateway` object
"""
if not id:
raise ValueError('id must be provided')
- if network_acl_patch is None:
- raise ValueError('network_acl_patch must be provided')
- if isinstance(network_acl_patch, NetworkACLPatch):
- network_acl_patch = convert_model(network_acl_patch)
+ if 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_network_acl',
+ operation_id='update_public_gateway',
)
headers.update(sdk_headers)
@@ -15079,7 +16556,7 @@ def update_network_acl(
'generation': self.generation,
}
- data = json.dumps(network_acl_patch)
+ data = json.dumps(public_gateway_patch)
headers['content-type'] = 'application/merge-patch+json'
if 'headers' in kwargs:
@@ -15090,7 +16567,7 @@ def update_network_acl(
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 = '/public_gateways/{id}'.format(**path_param_dict)
request = self.prepare_request(
method='PATCH',
url=url,
@@ -15102,40 +16579,59 @@ def update_network_acl(
response = self.send(request, **kwargs)
return response
- def list_network_acl_rules(
+ #########################
+ # Floating IPs
+ #########################
+
+ def list_floating_ips(
self,
- network_acl_id: str,
*,
- start: str = None,
- limit: int = None,
- direction: str = None,
+ start: Optional[str] = None,
+ limit: Optional[int] = None,
+ resource_group_id: Optional[str] = None,
+ sort: Optional[str] = None,
+ target_id: Optional[str] = None,
+ target_crn: Optional[str] = None,
+ target_name: Optional[str] = None,
+ target_resource_type: Optional[str] = None,
**kwargs,
) -> DetailedResponse:
"""
- List all rules for a network ACL.
+ List all floating IPs.
- This request lists all rules for a network ACL. These rules can allow or deny
- traffic between a source CIDR block and a destination CIDR block over a particular
- protocol and port range.
+ This request lists all floating IPs in the region. Floating IPs allow inbound and
+ outbound traffic from the Internet to an instance.
- :param str network_acl_id: The network ACL identifier.
:param str start: (optional) A server-provided token determining what
resource to start the page on.
:param int limit: (optional) The number of resources to return on a page.
- :param str direction: (optional) Filters the collection to rules with a
- `direction` property matching the specified value.
+ :param str resource_group_id: (optional) Filters the collection to
+ resources with a `resource_group.id` property matching the specified
+ identifier.
+ :param str sort: (optional) Sorts the returned collection by the specified
+ property name in ascending order. A `-` may be prepended to the name to
+ sort in descending order. For example, the value `-created_at` sorts the
+ collection by the `created_at` property in descending order, and the value
+ `name` sorts it by the `name` property in ascending order.
+ :param str target_id: (optional) Filters the collection to resources with a
+ `target.id` property matching the specified identifier.
+ :param str target_crn: (optional) Filters the collection to resources with
+ a `target.crn` property matching the specified CRN.
+ :param str target_name: (optional) Filters the collection to resources with
+ a `target.name` property matching the exact specified name.
+ :param str target_resource_type: (optional) Filters the collection to
+ resources with a `target.resource_type` property matching the specified
+ value.
:param dict headers: A `dict` containing the request headers
:return: A `DetailedResponse` containing the result, headers and HTTP status code.
- :rtype: DetailedResponse with `dict` result representing a `NetworkACLRuleCollection` object
+ :rtype: DetailedResponse with `dict` result representing a `FloatingIPCollection` object
"""
- if not network_acl_id:
- raise ValueError('network_acl_id must be provided')
headers = {}
sdk_headers = get_sdk_headers(
service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='list_network_acl_rules',
+ operation_id='list_floating_ips',
)
headers.update(sdk_headers)
@@ -15144,7 +16640,12 @@ def list_network_acl_rules(
'generation': self.generation,
'start': start,
'limit': limit,
- 'direction': direction,
+ 'resource_group.id': resource_group_id,
+ 'sort': sort,
+ 'target.id': target_id,
+ 'target.crn': target_crn,
+ 'target.name': target_name,
+ 'target.resource_type': target_resource_type,
}
if 'headers' in kwargs:
@@ -15152,10 +16653,7 @@ def list_network_acl_rules(
del kwargs['headers']
headers['Accept'] = 'application/json'
- path_param_keys = ['network_acl_id']
- path_param_values = self.encode_path_vars(network_acl_id)
- path_param_dict = dict(zip(path_param_keys, path_param_values))
- url = '/network_acls/{network_acl_id}/rules'.format(**path_param_dict)
+ url = '/floating_ips'
request = self.prepare_request(
method='GET',
url=url,
@@ -15166,38 +16664,32 @@ def list_network_acl_rules(
response = self.send(request, **kwargs)
return response
- def create_network_acl_rule(
+ def create_floating_ip(
self,
- network_acl_id: str,
- network_acl_rule_prototype: 'NetworkACLRulePrototype',
+ floating_ip_prototype: 'FloatingIPPrototype',
**kwargs,
) -> DetailedResponse:
"""
- Create a rule for a network ACL.
+ Reserve a floating IP.
- 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 reserves a new floating IP.
- :param str network_acl_id: The network ACL identifier.
- :param NetworkACLRulePrototype network_acl_rule_prototype: The network ACL
- rule prototype object.
+ :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 `NetworkACLRule` object
+ :rtype: DetailedResponse with `dict` result representing a `FloatingIP` object
"""
- if not network_acl_id:
- raise ValueError('network_acl_id must be provided')
- if network_acl_rule_prototype is None:
- raise ValueError('network_acl_rule_prototype must be provided')
- if isinstance(network_acl_rule_prototype, NetworkACLRulePrototype):
- network_acl_rule_prototype = convert_model(network_acl_rule_prototype)
+ if 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_network_acl_rule',
+ operation_id='create_floating_ip',
)
headers.update(sdk_headers)
@@ -15206,7 +16698,7 @@ def create_network_acl_rule(
'generation': self.generation,
}
- data = json.dumps(network_acl_rule_prototype)
+ data = json.dumps(floating_ip_prototype)
headers['content-type'] = 'application/json'
if 'headers' in kwargs:
@@ -15214,10 +16706,7 @@ def create_network_acl_rule(
del kwargs['headers']
headers['Accept'] = 'application/json'
- path_param_keys = ['network_acl_id']
- path_param_values = self.encode_path_vars(network_acl_id)
- path_param_dict = dict(zip(path_param_keys, path_param_values))
- url = '/network_acls/{network_acl_id}/rules'.format(**path_param_dict)
+ url = '/floating_ips'
request = self.prepare_request(
method='POST',
url=url,
@@ -15229,33 +16718,31 @@ def create_network_acl_rule(
response = self.send(request, **kwargs)
return response
- def delete_network_acl_rule(
+ def delete_floating_ip(
self,
- network_acl_id: str,
id: str,
**kwargs,
) -> DetailedResponse:
"""
- Delete a network ACL rule.
+ Delete a floating IP.
- This request deletes a rule. This operation cannot be reversed.
+ 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 network_acl_id: The network ACL identifier.
- :param str id: The rule identifier.
+ :param str id: The floating IP identifier.
:param dict headers: A `dict` containing the request headers
:return: A `DetailedResponse` containing the result, headers and HTTP status code.
:rtype: DetailedResponse
"""
- if not network_acl_id:
- raise ValueError('network_acl_id must be provided')
if not id:
raise ValueError('id must be provided')
headers = {}
sdk_headers = get_sdk_headers(
service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='delete_network_acl_rule',
+ operation_id='delete_floating_ip',
)
headers.update(sdk_headers)
@@ -15268,10 +16755,10 @@ def delete_network_acl_rule(
headers.update(kwargs.get('headers'))
del kwargs['headers']
- path_param_keys = ['network_acl_id', 'id']
- path_param_values = self.encode_path_vars(network_acl_id, id)
+ path_param_keys = ['id']
+ path_param_values = self.encode_path_vars(id)
path_param_dict = dict(zip(path_param_keys, path_param_values))
- url = '/network_acls/{network_acl_id}/rules/{id}'.format(**path_param_dict)
+ url = '/floating_ips/{id}'.format(**path_param_dict)
request = self.prepare_request(
method='DELETE',
url=url,
@@ -15282,33 +16769,30 @@ def delete_network_acl_rule(
response = self.send(request, **kwargs)
return response
- def get_network_acl_rule(
+ def get_floating_ip(
self,
- network_acl_id: str,
id: str,
**kwargs,
) -> DetailedResponse:
"""
- Retrieve a network ACL rule.
+ Retrieve a floating IP.
- This request retrieves a single rule specified by the identifier in the URL.
+ This request retrieves a single floating IP specified by the identifier in the
+ URL.
- :param str network_acl_id: The network ACL identifier.
- :param str id: The rule identifier.
+ :param str id: The 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 `NetworkACLRule` object
+ :rtype: DetailedResponse with `dict` result representing a `FloatingIP` object
"""
- if not network_acl_id:
- raise ValueError('network_acl_id must be provided')
if not id:
raise ValueError('id must be provided')
headers = {}
sdk_headers = get_sdk_headers(
service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='get_network_acl_rule',
+ operation_id='get_floating_ip',
)
headers.update(sdk_headers)
@@ -15322,10 +16806,10 @@ def get_network_acl_rule(
del kwargs['headers']
headers['Accept'] = 'application/json'
- path_param_keys = ['network_acl_id', 'id']
- path_param_values = self.encode_path_vars(network_acl_id, id)
+ path_param_keys = ['id']
+ path_param_values = self.encode_path_vars(id)
path_param_dict = dict(zip(path_param_keys, path_param_values))
- url = '/network_acls/{network_acl_id}/rules/{id}'.format(**path_param_dict)
+ url = '/floating_ips/{id}'.format(**path_param_dict)
request = self.prepare_request(
method='GET',
url=url,
@@ -15336,42 +16820,35 @@ def get_network_acl_rule(
response = self.send(request, **kwargs)
return response
- def update_network_acl_rule(
+ def update_floating_ip(
self,
- network_acl_id: str,
id: str,
- network_acl_rule_patch: 'NetworkACLRulePatch',
+ floating_ip_patch: 'FloatingIPPatch',
**kwargs,
) -> DetailedResponse:
"""
- Update a network ACL rule.
+ Update a floating IP.
- This request updates a rule with the information in a provided rule patch. The
- rule patch object contains only the information to be updated. The request will
- fail if the information is not applicable to the rule's protocol.
+ This request updates a floating IP's name and/or target.
- :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 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 `NetworkACLRule` object
+ :rtype: DetailedResponse with `dict` result representing a `FloatingIP` object
"""
- if not network_acl_id:
- raise ValueError('network_acl_id must be provided')
if not id:
raise ValueError('id must be provided')
- if network_acl_rule_patch is None:
- raise ValueError('network_acl_rule_patch must be provided')
- if isinstance(network_acl_rule_patch, NetworkACLRulePatch):
- network_acl_rule_patch = convert_model(network_acl_rule_patch)
+ if 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_network_acl_rule',
+ operation_id='update_floating_ip',
)
headers.update(sdk_headers)
@@ -15380,7 +16857,7 @@ def update_network_acl_rule(
'generation': self.generation,
}
- data = json.dumps(network_acl_rule_patch)
+ data = json.dumps(floating_ip_patch)
headers['content-type'] = 'application/merge-patch+json'
if 'headers' in kwargs:
@@ -15388,10 +16865,10 @@ def update_network_acl_rule(
del kwargs['headers']
headers['Accept'] = 'application/json'
- path_param_keys = ['network_acl_id', 'id']
- path_param_values = self.encode_path_vars(network_acl_id, id)
+ path_param_keys = ['id']
+ path_param_values = self.encode_path_vars(id)
path_param_dict = dict(zip(path_param_keys, path_param_values))
- url = '/network_acls/{network_acl_id}/rules/{id}'.format(**path_param_dict)
+ url = '/floating_ips/{id}'.format(**path_param_dict)
request = self.prepare_request(
method='PATCH',
url=url,
@@ -15404,29 +16881,24 @@ def update_network_acl_rule(
return response
#########################
- # Security groups
+ # Network ACLs
#########################
- def list_security_groups(
+ def list_network_acls(
self,
*,
- start: str = None,
- limit: int = None,
- resource_group_id: str = None,
- vpc_id: str = None,
- vpc_crn: str = None,
- vpc_name: str = None,
+ start: Optional[str] = None,
+ limit: Optional[int] = None,
+ resource_group_id: Optional[str] = None,
**kwargs,
) -> DetailedResponse:
"""
- List all security groups.
+ List all network ACLs.
- This request lists all security groups in the region. Security groups provide a
- way to apply IP filtering rules to instances in the associated VPC. With security
- groups, all traffic is denied by default, and rules added to security groups
- define which traffic the security group permits. Security group rules are stateful
- such that reverse traffic in response to allowed traffic is automatically
- permitted.
+ This request lists all 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 start: (optional) A server-provided token determining what
resource to start the page on.
@@ -15434,22 +16906,16 @@ def list_security_groups(
:param str resource_group_id: (optional) Filters the collection to
resources with a `resource_group.id` property matching the specified
identifier.
- :param str vpc_id: (optional) Filters the collection to resources with a
- `vpc.id` property matching the specified identifier.
- :param str vpc_crn: (optional) Filters the collection to resources with a
- `vpc.crn` property matching the specified CRN.
- :param str vpc_name: (optional) Filters the collection to resources with a
- `vpc.name` property matching the exact specified name.
:param dict headers: A `dict` containing the request headers
:return: A `DetailedResponse` containing the result, headers and HTTP status code.
- :rtype: DetailedResponse with `dict` result representing a `SecurityGroupCollection` object
+ :rtype: DetailedResponse with `dict` result representing a `NetworkACLCollection` object
"""
headers = {}
sdk_headers = get_sdk_headers(
service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='list_security_groups',
+ operation_id='list_network_acls',
)
headers.update(sdk_headers)
@@ -15459,9 +16925,6 @@ def list_security_groups(
'start': start,
'limit': limit,
'resource_group.id': resource_group_id,
- 'vpc.id': vpc_id,
- 'vpc.crn': vpc_crn,
- 'vpc.name': vpc_name,
}
if 'headers' in kwargs:
@@ -15469,7 +16932,7 @@ def list_security_groups(
del kwargs['headers']
headers['Accept'] = 'application/json'
- url = '/security_groups'
+ url = '/network_acls'
request = self.prepare_request(
method='GET',
url=url,
@@ -15480,53 +16943,34 @@ def list_security_groups(
response = self.send(request, **kwargs)
return response
- def create_security_group(
+ def create_network_acl(
self,
- vpc: 'VPCIdentity',
- *,
- name: str = None,
- resource_group: 'ResourceGroupIdentity' = None,
- rules: List['SecurityGroupRulePrototype'] = None,
+ network_acl_prototype: 'NetworkACLPrototype',
**kwargs,
) -> DetailedResponse:
"""
- Create a security group.
+ Create a network ACL.
- This request creates a new security group from a security group prototype object.
- The prototype object is structured in the same way as a retrieved security group,
- and contains the information necessary to create the new security group. If
- security group rules are included in the prototype object, those rules will be
- added to the security group. Each security group is scoped to one VPC. Only
- resources in that VPC can be added to the security group.
+ This request creates a new stateless network ACL from a network ACL prototype
+ object. The prototype object is structured in the same way as a retrieved network
+ ACL, and contains the information necessary to create the new network ACL.
- :param VPCIdentity vpc: The VPC this security group will reside in.
- :param str name: (optional) The name for this security group. The name must
- not be used by another security group for the VPC. If unspecified, the name
- will be a hyphenated list of randomly-selected words.
- :param ResourceGroupIdentity resource_group: (optional) The resource group
- to use. If unspecified, the account's [default resource
- group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be
- 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 NetworkACLPrototype network_acl_prototype: The network ACL prototype
+ object.
:param dict headers: A `dict` containing the request headers
:return: A `DetailedResponse` containing the result, headers and HTTP status code.
- :rtype: DetailedResponse with `dict` result representing a `SecurityGroup` object
+ :rtype: DetailedResponse with `dict` result representing a `NetworkACL` 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]
+ if network_acl_prototype is None:
+ raise ValueError('network_acl_prototype must be provided')
+ if isinstance(network_acl_prototype, NetworkACLPrototype):
+ network_acl_prototype = convert_model(network_acl_prototype)
headers = {}
sdk_headers = get_sdk_headers(
service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='create_security_group',
+ operation_id='create_network_acl',
)
headers.update(sdk_headers)
@@ -15535,14 +16979,7 @@ def create_security_group(
'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)
+ data = json.dumps(network_acl_prototype)
headers['content-type'] = 'application/json'
if 'headers' in kwargs:
@@ -15550,7 +16987,7 @@ def create_security_group(
del kwargs['headers']
headers['Accept'] = 'application/json'
- url = '/security_groups'
+ url = '/network_acls'
request = self.prepare_request(
method='POST',
url=url,
@@ -15562,19 +16999,19 @@ def create_security_group(
response = self.send(request, **kwargs)
return response
- def delete_security_group(
+ def delete_network_acl(
self,
id: str,
**kwargs,
) -> DetailedResponse:
"""
- Delete a security group.
+ Delete a network ACL.
- This request deletes a security group. A security group cannot be deleted if it is
- referenced by any security group targets or rules. Additionally, a VPC's default
- security group cannot be deleted. This operation cannot be reversed.
+ This request deletes a network ACL. This operation cannot be reversed. For this
+ request to succeed, the network ACL must not be the default network ACL for any
+ VPCs, and the network ACL must not be attached to any subnets.
- :param str id: The security group 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
@@ -15586,7 +17023,7 @@ def delete_security_group(
sdk_headers = get_sdk_headers(
service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='delete_security_group',
+ operation_id='delete_network_acl',
)
headers.update(sdk_headers)
@@ -15602,7 +17039,7 @@ def delete_security_group(
path_param_keys = ['id']
path_param_values = self.encode_path_vars(id)
path_param_dict = dict(zip(path_param_keys, path_param_values))
- url = '/security_groups/{id}'.format(**path_param_dict)
+ url = '/network_acls/{id}'.format(**path_param_dict)
request = self.prepare_request(
method='DELETE',
url=url,
@@ -15613,21 +17050,21 @@ def delete_security_group(
response = self.send(request, **kwargs)
return response
- def get_security_group(
+ def get_network_acl(
self,
id: str,
**kwargs,
) -> DetailedResponse:
"""
- Retrieve a security group.
+ Retrieve a network ACL.
- This request retrieves a single security group specified by the identifier in the
- URL path.
+ This request retrieves a single network ACL specified by the identifier in the
+ URL.
- :param str id: The security group 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 `SecurityGroup` object
+ :rtype: DetailedResponse with `dict` result representing a `NetworkACL` object
"""
if not id:
@@ -15636,7 +17073,7 @@ def get_security_group(
sdk_headers = get_sdk_headers(
service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='get_security_group',
+ operation_id='get_network_acl',
)
headers.update(sdk_headers)
@@ -15653,7 +17090,7 @@ def get_security_group(
path_param_keys = ['id']
path_param_values = self.encode_path_vars(id)
path_param_dict = dict(zip(path_param_keys, path_param_values))
- url = '/security_groups/{id}'.format(**path_param_dict)
+ url = '/network_acls/{id}'.format(**path_param_dict)
request = self.prepare_request(
method='GET',
url=url,
@@ -15664,37 +17101,35 @@ def get_security_group(
response = self.send(request, **kwargs)
return response
- def update_security_group(
+ def update_network_acl(
self,
id: str,
- security_group_patch: 'SecurityGroupPatch',
+ network_acl_patch: 'NetworkACLPatch',
**kwargs,
) -> DetailedResponse:
"""
- Update a security group.
+ Update a network ACL.
- This request updates a security group with the information provided in a security
- group patch object. The security group patch object is structured in the same way
- as a retrieved security group and contains only the information to be updated.
+ This request updates a network ACL's name.
- :param str id: The security group identifier.
- :param SecurityGroupPatch security_group_patch: The security group patch.
+ :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 `SecurityGroup` object
+ :rtype: DetailedResponse with `dict` result representing a `NetworkACL` object
"""
if not id:
raise ValueError('id must be provided')
- if security_group_patch is None:
- raise ValueError('security_group_patch must be provided')
- if isinstance(security_group_patch, SecurityGroupPatch):
- security_group_patch = convert_model(security_group_patch)
+ if 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='update_security_group',
+ operation_id='update_network_acl',
)
headers.update(sdk_headers)
@@ -15703,7 +17138,7 @@ def update_security_group(
'generation': self.generation,
}
- data = json.dumps(security_group_patch)
+ data = json.dumps(network_acl_patch)
headers['content-type'] = 'application/merge-patch+json'
if 'headers' in kwargs:
@@ -15714,7 +17149,7 @@ def update_security_group(
path_param_keys = ['id']
path_param_values = self.encode_path_vars(id)
path_param_dict = dict(zip(path_param_keys, path_param_values))
- url = '/security_groups/{id}'.format(**path_param_dict)
+ url = '/network_acls/{id}'.format(**path_param_dict)
request = self.prepare_request(
method='PATCH',
url=url,
@@ -15726,37 +17161,49 @@ def update_security_group(
response = self.send(request, **kwargs)
return response
- def list_security_group_rules(
+ def list_network_acl_rules(
self,
- security_group_id: str,
+ network_acl_id: str,
+ *,
+ start: Optional[str] = None,
+ limit: Optional[int] = None,
+ direction: Optional[str] = None,
**kwargs,
) -> DetailedResponse:
"""
- List all rules in a security group.
+ List all rules for a network ACL.
- This request lists all rules in a security group. These rules define what traffic
- the security group permits. Security group rules are stateful, such that reverse
- traffic in response to allowed traffic is automatically permitted.
+ This request lists all 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 security_group_id: The security group identifier.
+ :param str network_acl_id: The network ACL identifier.
+ :param str start: (optional) A server-provided token determining what
+ resource to start the page on.
+ :param int limit: (optional) The number of resources to return on a page.
+ :param str direction: (optional) Filters the collection to rules with a
+ `direction` property matching the specified value.
:param dict headers: A `dict` containing the request headers
:return: A `DetailedResponse` containing the result, headers and HTTP status code.
- :rtype: DetailedResponse with `dict` result representing a `SecurityGroupRuleCollection` object
+ :rtype: DetailedResponse with `dict` result representing a `NetworkACLRuleCollection` object
"""
- if not security_group_id:
- raise ValueError('security_group_id must be provided')
+ if not network_acl_id:
+ raise ValueError('network_acl_id must be provided')
headers = {}
sdk_headers = get_sdk_headers(
service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='list_security_group_rules',
+ operation_id='list_network_acl_rules',
)
headers.update(sdk_headers)
params = {
'version': self.version,
'generation': self.generation,
+ 'start': start,
+ 'limit': limit,
+ 'direction': direction,
}
if 'headers' in kwargs:
@@ -15764,10 +17211,10 @@ def list_security_group_rules(
del kwargs['headers']
headers['Accept'] = 'application/json'
- path_param_keys = ['security_group_id']
- path_param_values = self.encode_path_vars(security_group_id)
+ path_param_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 = '/security_groups/{security_group_id}/rules'.format(**path_param_dict)
+ url = '/network_acls/{network_acl_id}/rules'.format(**path_param_dict)
request = self.prepare_request(
method='GET',
url=url,
@@ -15778,44 +17225,38 @@ def list_security_group_rules(
response = self.send(request, **kwargs)
return response
- def create_security_group_rule(
+ def create_network_acl_rule(
self,
- security_group_id: str,
- security_group_rule_prototype: 'SecurityGroupRulePrototype',
+ network_acl_id: str,
+ network_acl_rule_prototype: 'NetworkACLRulePrototype',
**kwargs,
) -> DetailedResponse:
"""
- Create a rule for a security group.
+ Create a rule for a network ACL.
- This request creates a new security group rule from a security group rule
- prototype object. The prototype object is structured in the same way as a
- retrieved security group rule and contains the information necessary to create the
- rule. As part of creating a new rule in a security group, the rule is applied to
- all the networking interfaces in the security group. Rules specify which IP
- traffic a security group will allow. Security group rules are stateful, such that
- reverse traffic in response to allowed traffic is automatically permitted. A rule
- allowing inbound TCP traffic on port 80 also allows outbound TCP traffic on port
- 80 without the need for an additional rule.
+ This request 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 security_group_id: The security group identifier.
- :param SecurityGroupRulePrototype security_group_rule_prototype: The
- properties of the security group rule to be created.
+ :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 `SecurityGroupRule` object
+ :rtype: DetailedResponse with `dict` result representing a `NetworkACLRule` object
"""
- if not security_group_id:
- raise ValueError('security_group_id must be provided')
- if security_group_rule_prototype is None:
- raise ValueError('security_group_rule_prototype must be provided')
- if isinstance(security_group_rule_prototype, SecurityGroupRulePrototype):
- security_group_rule_prototype = convert_model(security_group_rule_prototype)
+ if not network_acl_id:
+ raise ValueError('network_acl_id must be provided')
+ if network_acl_rule_prototype is None:
+ raise ValueError('network_acl_rule_prototype must be provided')
+ if isinstance(network_acl_rule_prototype, NetworkACLRulePrototype):
+ network_acl_rule_prototype = convert_model(network_acl_rule_prototype)
headers = {}
sdk_headers = get_sdk_headers(
service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='create_security_group_rule',
+ operation_id='create_network_acl_rule',
)
headers.update(sdk_headers)
@@ -15824,7 +17265,7 @@ def create_security_group_rule(
'generation': self.generation,
}
- data = json.dumps(security_group_rule_prototype)
+ data = json.dumps(network_acl_rule_prototype)
headers['content-type'] = 'application/json'
if 'headers' in kwargs:
@@ -15832,10 +17273,10 @@ def create_security_group_rule(
del kwargs['headers']
headers['Accept'] = 'application/json'
- path_param_keys = ['security_group_id']
- path_param_values = self.encode_path_vars(security_group_id)
+ path_param_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 = '/security_groups/{security_group_id}/rules'.format(**path_param_dict)
+ url = '/network_acls/{network_acl_id}/rules'.format(**path_param_dict)
request = self.prepare_request(
method='POST',
url=url,
@@ -15847,35 +17288,33 @@ def create_security_group_rule(
response = self.send(request, **kwargs)
return response
- def delete_security_group_rule(
+ def delete_network_acl_rule(
self,
- security_group_id: str,
+ network_acl_id: str,
id: str,
**kwargs,
) -> DetailedResponse:
"""
- Delete a security group rule.
+ Delete a network ACL rule.
- 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 deletes a rule. This operation cannot be reversed.
- :param str security_group_id: The security group identifier.
+ :param str network_acl_id: The network ACL identifier.
:param str id: The rule identifier.
:param dict headers: A `dict` containing the request headers
:return: A `DetailedResponse` containing the result, headers and HTTP status code.
:rtype: DetailedResponse
"""
- if not security_group_id:
- raise ValueError('security_group_id must be provided')
+ if not network_acl_id:
+ raise ValueError('network_acl_id must be provided')
if not id:
raise ValueError('id must be provided')
headers = {}
sdk_headers = get_sdk_headers(
service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='delete_security_group_rule',
+ operation_id='delete_network_acl_rule',
)
headers.update(sdk_headers)
@@ -15888,10 +17327,10 @@ def delete_security_group_rule(
headers.update(kwargs.get('headers'))
del kwargs['headers']
- path_param_keys = ['security_group_id', 'id']
- path_param_values = self.encode_path_vars(security_group_id, id)
+ path_param_keys = ['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 = '/security_groups/{security_group_id}/rules/{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,
@@ -15902,34 +17341,33 @@ def delete_security_group_rule(
response = self.send(request, **kwargs)
return response
- def get_security_group_rule(
+ def get_network_acl_rule(
self,
- security_group_id: str,
+ network_acl_id: str,
id: str,
**kwargs,
) -> DetailedResponse:
"""
- Retrieve a security group rule.
+ Retrieve a network ACL rule.
- This request retrieves a single security group rule specified by the identifier in
- the URL path.
+ This request retrieves a single rule specified by the identifier in the URL.
- :param str security_group_id: The security group 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 `SecurityGroupRule` object
+ :rtype: DetailedResponse with `dict` result representing a `NetworkACLRule` object
"""
- if not security_group_id:
- raise ValueError('security_group_id must be provided')
+ if not network_acl_id:
+ raise ValueError('network_acl_id must be provided')
if not id:
raise ValueError('id must be provided')
headers = {}
sdk_headers = get_sdk_headers(
service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='get_security_group_rule',
+ operation_id='get_network_acl_rule',
)
headers.update(sdk_headers)
@@ -15943,10 +17381,10 @@ def get_security_group_rule(
del kwargs['headers']
headers['Accept'] = 'application/json'
- path_param_keys = ['security_group_id', 'id']
- path_param_values = self.encode_path_vars(security_group_id, id)
+ path_param_keys = ['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 = '/security_groups/{security_group_id}/rules/{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,
@@ -15957,42 +17395,42 @@ def get_security_group_rule(
response = self.send(request, **kwargs)
return response
- def update_security_group_rule(
+ def update_network_acl_rule(
self,
- security_group_id: str,
+ network_acl_id: str,
id: str,
- security_group_rule_patch: 'SecurityGroupRulePatch',
+ network_acl_rule_patch: 'NetworkACLRulePatch',
**kwargs,
) -> DetailedResponse:
"""
- Update a security group rule.
+ Update a network ACL rule.
- 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 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 security_group_id: The security group identifier.
+ :param str network_acl_id: The network ACL identifier.
:param str id: The rule identifier.
- :param SecurityGroupRulePatch security_group_rule_patch: The security group
- rule patch.
+ :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 `SecurityGroupRule` object
+ :rtype: DetailedResponse with `dict` result representing a `NetworkACLRule` object
"""
- if not security_group_id:
- raise ValueError('security_group_id must be provided')
+ if not network_acl_id:
+ raise ValueError('network_acl_id must be provided')
if not id:
raise ValueError('id must be provided')
- if security_group_rule_patch is None:
- raise ValueError('security_group_rule_patch must be provided')
- if isinstance(security_group_rule_patch, SecurityGroupRulePatch):
- security_group_rule_patch = convert_model(security_group_rule_patch)
+ if 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_security_group_rule',
+ operation_id='update_network_acl_rule',
)
headers.update(sdk_headers)
@@ -16001,7 +17439,7 @@ def update_security_group_rule(
'generation': self.generation,
}
- data = json.dumps(security_group_rule_patch)
+ data = json.dumps(network_acl_rule_patch)
headers['content-type'] = 'application/merge-patch+json'
if 'headers' in kwargs:
@@ -16009,10 +17447,10 @@ def update_security_group_rule(
del kwargs['headers']
headers['Accept'] = 'application/json'
- path_param_keys = ['security_group_id', 'id']
- path_param_values = self.encode_path_vars(security_group_id, id)
+ path_param_keys = ['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 = '/security_groups/{security_group_id}/rules/{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,
@@ -16024,36 +17462,53 @@ def update_security_group_rule(
response = self.send(request, **kwargs)
return response
- def list_security_group_targets(
+ #########################
+ # Security groups
+ #########################
+
+ def list_security_groups(
self,
- security_group_id: str,
*,
- start: str = None,
- limit: int = None,
+ start: Optional[str] = None,
+ limit: Optional[int] = None,
+ resource_group_id: Optional[str] = None,
+ vpc_id: Optional[str] = None,
+ vpc_crn: Optional[str] = None,
+ vpc_name: Optional[str] = None,
**kwargs,
) -> DetailedResponse:
"""
- List all targets associated with a security group.
+ List all security groups.
- This request lists all targets associated with a security group, to which the
- rules in the security group are applied.
+ 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 security_group_id: The security group identifier.
:param str start: (optional) A server-provided token determining what
resource to start the page on.
:param int limit: (optional) The number of resources to return on a page.
+ :param str resource_group_id: (optional) Filters the collection to
+ resources with a `resource_group.id` property matching the specified
+ identifier.
+ :param str vpc_id: (optional) Filters the collection to resources with a
+ `vpc.id` property matching the specified identifier.
+ :param str vpc_crn: (optional) Filters the collection to resources with a
+ `vpc.crn` property matching the specified CRN.
+ :param str vpc_name: (optional) Filters the collection to resources with a
+ `vpc.name` property matching the exact specified name.
:param dict headers: A `dict` containing the request headers
:return: A `DetailedResponse` containing the result, headers and HTTP status code.
- :rtype: DetailedResponse with `dict` result representing a `SecurityGroupTargetCollection` object
+ :rtype: DetailedResponse with `dict` result representing a `SecurityGroupCollection` object
"""
- if not security_group_id:
- raise ValueError('security_group_id must be provided')
headers = {}
sdk_headers = get_sdk_headers(
service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='list_security_group_targets',
+ operation_id='list_security_groups',
)
headers.update(sdk_headers)
@@ -16062,6 +17517,10 @@ def list_security_group_targets(
'generation': self.generation,
'start': start,
'limit': limit,
+ 'resource_group.id': resource_group_id,
+ 'vpc.id': vpc_id,
+ 'vpc.crn': vpc_crn,
+ 'vpc.name': vpc_name,
}
if 'headers' in kwargs:
@@ -16069,10 +17528,7 @@ def list_security_group_targets(
del kwargs['headers']
headers['Accept'] = 'application/json'
- path_param_keys = ['security_group_id']
- path_param_values = self.encode_path_vars(security_group_id)
- path_param_dict = dict(zip(path_param_keys, path_param_values))
- url = '/security_groups/{security_group_id}/targets'.format(**path_param_dict)
+ url = '/security_groups'
request = self.prepare_request(
method='GET',
url=url,
@@ -16083,43 +17539,53 @@ def list_security_group_targets(
response = self.send(request, **kwargs)
return response
- def delete_security_group_target_binding(
+ def create_security_group(
self,
- security_group_id: str,
- id: str,
+ vpc: 'VPCIdentity',
+ *,
+ name: Optional[str] = None,
+ resource_group: Optional['ResourceGroupIdentity'] = None,
+ rules: Optional[List['SecurityGroupRulePrototype']] = None,
**kwargs,
) -> DetailedResponse:
"""
- Remove a target from a security group.
+ Create a security group.
- This request removes a target from a security group. For this request to succeed,
- the target must be attached to at least one other security group. The specified
- target identifier can be:
- - A bare metal server network interface identifier
- - A virtual network interface identifier
- - A VPN server identifier
- - A load balancer identifier
- - An endpoint gateway identifier
- - An instance network interface identifier
- Security groups are stateful, so any changes to a target's security groups are
- applied to new connections. Existing connections are not affected.
+ This request creates a new security group from a security group prototype object.
+ The prototype object is structured in the same way as a retrieved security group,
+ and contains the information necessary to create the new security group. If
+ security group rules are included in the prototype object, those rules will be
+ added to the security group. Each security group is scoped to one VPC. Only
+ resources in that VPC can be added to the security group.
- :param str security_group_id: The security group identifier.
- :param str id: The security group target identifier.
+ :param VPCIdentity vpc: The VPC this security group will reside in.
+ :param str name: (optional) The name for this security group. The name must
+ not be used by another security group for the VPC. If unspecified, the name
+ will be a hyphenated list of randomly-selected words.
+ :param ResourceGroupIdentity resource_group: (optional) The resource group
+ to use. If unspecified, the account's [default resource
+ group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be
+ 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
+ :rtype: DetailedResponse with `dict` result representing a `SecurityGroup` object
"""
- if not security_group_id:
- raise ValueError('security_group_id must be provided')
- if not id:
- raise ValueError('id 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='delete_security_group_target_binding',
+ operation_id='create_security_group',
)
headers.update(sdk_headers)
@@ -16128,52 +17594,58 @@ def delete_security_group_target_binding(
'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'))
del kwargs['headers']
+ headers['Accept'] = 'application/json'
- path_param_keys = ['security_group_id', 'id']
- path_param_values = self.encode_path_vars(security_group_id, id)
- path_param_dict = dict(zip(path_param_keys, path_param_values))
- url = '/security_groups/{security_group_id}/targets/{id}'.format(**path_param_dict)
+ url = '/security_groups'
request = self.prepare_request(
- method='DELETE',
+ method='POST',
url=url,
headers=headers,
params=params,
+ data=data,
)
response = self.send(request, **kwargs)
return response
- def get_security_group_target(
+ def delete_security_group(
self,
- security_group_id: str,
id: str,
**kwargs,
) -> DetailedResponse:
"""
- Retrieve a security group target.
+ Delete a security group.
- 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 deletes a security group. A security group cannot be deleted if it is
+ referenced by any security group targets or rules. Additionally, a VPC's default
+ security group cannot be deleted. This operation cannot be reversed.
- :param str security_group_id: The security group identifier.
- :param str id: The security group target 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 `SecurityGroupTargetReference` object
+ :rtype: DetailedResponse
"""
- if not security_group_id:
- raise ValueError('security_group_id must be provided')
if not id:
raise ValueError('id must be provided')
headers = {}
sdk_headers = get_sdk_headers(
service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='get_security_group_target',
+ operation_id='delete_security_group',
)
headers.update(sdk_headers)
@@ -16185,14 +17657,13 @@ def get_security_group_target(
if 'headers' in kwargs:
headers.update(kwargs.get('headers'))
del kwargs['headers']
- headers['Accept'] = 'application/json'
- path_param_keys = ['security_group_id', 'id']
- path_param_values = self.encode_path_vars(security_group_id, id)
+ path_param_keys = ['id']
+ path_param_values = self.encode_path_vars(id)
path_param_dict = dict(zip(path_param_keys, path_param_values))
- url = '/security_groups/{security_group_id}/targets/{id}'.format(**path_param_dict)
+ url = '/security_groups/{id}'.format(**path_param_dict)
request = self.prepare_request(
- method='GET',
+ method='DELETE',
url=url,
headers=headers,
params=params,
@@ -16201,42 +17672,30 @@ def get_security_group_target(
response = self.send(request, **kwargs)
return response
- def create_security_group_target_binding(
+ def get_security_group(
self,
- security_group_id: str,
id: str,
**kwargs,
) -> DetailedResponse:
"""
- Add a target to a security group.
+ Retrieve a security group.
- This request adds a resource to an existing security group. The specified target
- identifier can be:
- - A bare metal server network interface identifier
- - A virtual network interface identifier
- - A VPN server identifier
- - A load balancer identifier
- - An endpoint gateway identifier
- - An instance network interface identifier
- When a target is added to a security group, the security group rules are applied
- to the target. A request body is not required, and if provided, is ignored.
+ This request retrieves a single security group specified by the identifier in the
+ URL path.
- :param str security_group_id: The security group identifier.
- :param str id: The security group target 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 `SecurityGroupTargetReference` object
+ :rtype: DetailedResponse with `dict` result representing a `SecurityGroup` object
"""
- if not security_group_id:
- raise ValueError('security_group_id must be provided')
if not id:
raise ValueError('id must be provided')
headers = {}
sdk_headers = get_sdk_headers(
service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='create_security_group_target_binding',
+ operation_id='get_security_group',
)
headers.update(sdk_headers)
@@ -16250,12 +17709,12 @@ def create_security_group_target_binding(
del kwargs['headers']
headers['Accept'] = 'application/json'
- path_param_keys = ['security_group_id', 'id']
- path_param_values = self.encode_path_vars(security_group_id, id)
+ path_param_keys = ['id']
+ path_param_values = self.encode_path_vars(id)
path_param_dict = dict(zip(path_param_keys, path_param_values))
- url = '/security_groups/{security_group_id}/targets/{id}'.format(**path_param_dict)
+ url = '/security_groups/{id}'.format(**path_param_dict)
request = self.prepare_request(
- method='PUT',
+ method='GET',
url=url,
headers=headers,
params=params,
@@ -16264,110 +17723,93 @@ def create_security_group_target_binding(
response = self.send(request, **kwargs)
return response
- #########################
- # VPN gateways
- #########################
-
- def list_ike_policies(
+ def update_security_group(
self,
- *,
- start: str = None,
- limit: int = None,
+ id: str,
+ security_group_patch: 'SecurityGroupPatch',
**kwargs,
) -> DetailedResponse:
"""
- List all IKE policies.
+ Update a security group.
- This request lists all IKE policies in the region.
+ 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 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 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 `IKEPolicyCollection` object
+ :rtype: DetailedResponse with `dict` result representing a `SecurityGroup` object
"""
+ if not id:
+ raise ValueError('id must be provided')
+ if security_group_patch is None:
+ raise ValueError('security_group_patch must be provided')
+ if isinstance(security_group_patch, SecurityGroupPatch):
+ security_group_patch = convert_model(security_group_patch)
headers = {}
sdk_headers = get_sdk_headers(
service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='list_ike_policies',
+ operation_id='update_security_group',
)
headers.update(sdk_headers)
params = {
'version': self.version,
'generation': self.generation,
- 'start': start,
- 'limit': limit,
}
+ data = json.dumps(security_group_patch)
+ headers['content-type'] = 'application/merge-patch+json'
+
if 'headers' in kwargs:
headers.update(kwargs.get('headers'))
del kwargs['headers']
headers['Accept'] = 'application/json'
- url = '/ike_policies'
+ path_param_keys = ['id']
+ path_param_values = self.encode_path_vars(id)
+ path_param_dict = dict(zip(path_param_keys, path_param_values))
+ url = '/security_groups/{id}'.format(**path_param_dict)
request = self.prepare_request(
- method='GET',
+ method='PATCH',
url=url,
headers=headers,
params=params,
+ data=data,
)
response = self.send(request, **kwargs)
return response
- def create_ike_policy(
+ def list_security_group_rules(
self,
- authentication_algorithm: str,
- dh_group: int,
- encryption_algorithm: str,
- ike_version: int,
- *,
- key_lifetime: int = None,
- name: str = None,
- resource_group: 'ResourceGroupIdentity' = None,
+ security_group_id: str,
**kwargs,
) -> DetailedResponse:
"""
- Create an IKE policy.
+ List all rules in a security group.
- This request creates a new IKE policy.
+ This request lists all rules in a security group. These rules define what traffic
+ the security group permits. Security group rules are stateful, such that reverse
+ traffic in response to allowed traffic is automatically permitted.
- :param str authentication_algorithm: The authentication algorithm.
- :param int dh_group: The Diffie-Hellman group.
- :param str encryption_algorithm: The encryption algorithm.
- :param int ike_version: The IKE protocol version.
- :param int key_lifetime: (optional) The key lifetime in seconds.
- :param str name: (optional) The name for this IKE policy. The name must not
- be used by another IKE policies in the region. If unspecified, the name
- will be a hyphenated list of randomly-selected words.
- :param ResourceGroupIdentity resource_group: (optional) The resource group
- to use. If unspecified, the account's [default resource
- group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be
- used.
+ :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 `IKEPolicy` object
+ :rtype: DetailedResponse with `dict` result representing a `SecurityGroupRuleCollection` object
"""
- if authentication_algorithm is None:
- raise ValueError('authentication_algorithm must be provided')
- if dh_group is None:
- raise ValueError('dh_group must be provided')
- if encryption_algorithm is None:
- raise ValueError('encryption_algorithm must be provided')
- if ike_version is None:
- raise ValueError('ike_version must be provided')
- if resource_group is not None:
- resource_group = convert_model(resource_group)
+ if not security_group_id:
+ raise ValueError('security_group_id must be provided')
headers = {}
sdk_headers = get_sdk_headers(
service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='create_ike_policy',
+ operation_id='list_security_group_rules',
)
headers.update(sdk_headers)
@@ -16376,61 +17818,63 @@ def create_ike_policy(
'generation': self.generation,
}
- data = {
- 'authentication_algorithm': authentication_algorithm,
- 'dh_group': dh_group,
- 'encryption_algorithm': encryption_algorithm,
- 'ike_version': ike_version,
- 'key_lifetime': key_lifetime,
- 'name': name,
- 'resource_group': resource_group,
- }
- data = {k: v for (k, v) in data.items() if v is not None}
- data = json.dumps(data)
- headers['content-type'] = 'application/json'
-
if 'headers' in kwargs:
headers.update(kwargs.get('headers'))
del kwargs['headers']
headers['Accept'] = 'application/json'
- url = '/ike_policies'
+ path_param_keys = ['security_group_id']
+ path_param_values = self.encode_path_vars(security_group_id)
+ path_param_dict = dict(zip(path_param_keys, path_param_values))
+ url = '/security_groups/{security_group_id}/rules'.format(**path_param_dict)
request = self.prepare_request(
- method='POST',
+ method='GET',
url=url,
headers=headers,
params=params,
- data=data,
)
response = self.send(request, **kwargs)
return response
- def delete_ike_policy(
+ def create_security_group_rule(
self,
- id: str,
+ security_group_id: str,
+ security_group_rule_prototype: 'SecurityGroupRulePrototype',
**kwargs,
) -> DetailedResponse:
"""
- Delete an IKE policy.
+ Create a rule for a security group.
- 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 creates a new security group rule from a security group rule
+ prototype object. The prototype object is structured in the same way as a
+ retrieved security group rule and contains the information necessary to create the
+ rule. As part of creating a new rule in a security group, the rule is applied to
+ all the networking interfaces in the security group. Rules specify which IP
+ traffic a security group will allow. Security group rules are stateful, such that
+ reverse traffic in response to allowed traffic is automatically permitted. A rule
+ allowing inbound TCP traffic on port 80 also allows outbound TCP traffic on port
+ 80 without the need for an additional rule.
- :param str id: The IKE policy identifier.
+ :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
+ :rtype: DetailedResponse with `dict` result representing a `SecurityGroupRule` object
"""
- if not id:
- raise ValueError('id must be provided')
+ if not security_group_id:
+ raise ValueError('security_group_id must be provided')
+ if security_group_rule_prototype is None:
+ raise ValueError('security_group_rule_prototype must be provided')
+ if isinstance(security_group_rule_prototype, SecurityGroupRulePrototype):
+ security_group_rule_prototype = convert_model(security_group_rule_prototype)
headers = {}
sdk_headers = get_sdk_headers(
service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='delete_ike_policy',
+ operation_id='create_security_group_rule',
)
headers.update(sdk_headers)
@@ -16439,47 +17883,58 @@ def delete_ike_policy(
'generation': self.generation,
}
+ data = json.dumps(security_group_rule_prototype)
+ headers['content-type'] = 'application/json'
+
if 'headers' in kwargs:
headers.update(kwargs.get('headers'))
del kwargs['headers']
+ headers['Accept'] = 'application/json'
- path_param_keys = ['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 = '/ike_policies/{id}'.format(**path_param_dict)
+ url = '/security_groups/{security_group_id}/rules'.format(**path_param_dict)
request = self.prepare_request(
- method='DELETE',
+ method='POST',
url=url,
headers=headers,
params=params,
+ data=data,
)
response = self.send(request, **kwargs)
return response
- def get_ike_policy(
+ def delete_security_group_rule(
self,
+ security_group_id: str,
id: str,
**kwargs,
) -> DetailedResponse:
"""
- Retrieve an IKE policy.
+ Delete a security group rule.
- This request retrieves a single IKE policy specified by the identifier in the URL.
+ This request deletes a security group rule. This operation cannot be reversed.
+ Removing a security group rule will not end existing connections allowed by that
+ rule.
- :param str id: The IKE policy identifier.
+ :param str security_group_id: The security group identifier.
+ :param str id: The rule identifier.
:param dict headers: A `dict` containing the request headers
:return: A `DetailedResponse` containing the result, headers and HTTP status code.
- :rtype: DetailedResponse with `dict` result representing a `IKEPolicy` object
+ :rtype: DetailedResponse
"""
+ if not security_group_id:
+ raise ValueError('security_group_id must be provided')
if not id:
raise ValueError('id must be provided')
headers = {}
sdk_headers = get_sdk_headers(
service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='get_ike_policy',
+ operation_id='delete_security_group_rule',
)
headers.update(sdk_headers)
@@ -16491,14 +17946,13 @@ def get_ike_policy(
if 'headers' in kwargs:
headers.update(kwargs.get('headers'))
del kwargs['headers']
- headers['Accept'] = 'application/json'
- path_param_keys = ['id']
- path_param_values = self.encode_path_vars(id)
+ path_param_keys = ['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 = '/ike_policies/{id}'.format(**path_param_dict)
+ url = '/security_groups/{security_group_id}/rules/{id}'.format(**path_param_dict)
request = self.prepare_request(
- method='GET',
+ method='DELETE',
url=url,
headers=headers,
params=params,
@@ -16507,35 +17961,34 @@ def get_ike_policy(
response = self.send(request, **kwargs)
return response
- def update_ike_policy(
+ def get_security_group_rule(
self,
+ security_group_id: str,
id: str,
- ike_policy_patch: 'IKEPolicyPatch',
**kwargs,
) -> DetailedResponse:
"""
- Update an IKE policy.
+ Retrieve a security group rule.
- This request updates the properties of an existing IKE policy.
+ This request retrieves a single security group rule specified by the identifier in
+ the URL path.
- :param str id: The IKE policy identifier.
- :param IKEPolicyPatch ike_policy_patch: The IKE policy patch.
+ :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 `IKEPolicy` object
+ :rtype: DetailedResponse with `dict` result representing a `SecurityGroupRule` object
"""
+ if not security_group_id:
+ raise ValueError('security_group_id must be provided')
if not id:
raise ValueError('id must be provided')
- if 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='update_ike_policy',
+ operation_id='get_security_group_rule',
)
headers.update(sdk_headers)
@@ -16544,52 +17997,61 @@ def update_ike_policy(
'generation': self.generation,
}
- data = json.dumps(ike_policy_patch)
- headers['content-type'] = 'application/merge-patch+json'
-
if 'headers' in kwargs:
headers.update(kwargs.get('headers'))
del kwargs['headers']
headers['Accept'] = 'application/json'
- path_param_keys = ['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 = '/ike_policies/{id}'.format(**path_param_dict)
+ url = '/security_groups/{security_group_id}/rules/{id}'.format(**path_param_dict)
request = self.prepare_request(
- method='PATCH',
+ method='GET',
url=url,
headers=headers,
params=params,
- data=data,
)
response = self.send(request, **kwargs)
return response
- def list_ike_policy_connections(
+ def update_security_group_rule(
self,
+ security_group_id: str,
id: str,
+ security_group_rule_patch: 'SecurityGroupRulePatch',
**kwargs,
) -> DetailedResponse:
"""
- List all VPN gateway connections that use a specified IKE policy.
+ Update a security group rule.
- This request lists all VPN gateway connections that use a policy.
+ This request updates a security group rule with the information in a provided rule
+ patch object. The rule patch object contains only the information to be updated.
+ The request will fail if the information is not applicable to the rule's protocol.
- :param str id: The IKE policy 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 with `dict` result representing a `VPNGatewayConnectionCollection` object
+ :rtype: DetailedResponse with `dict` result representing a `SecurityGroupRule` object
"""
+ if not security_group_id:
+ raise ValueError('security_group_id must be provided')
if not id:
raise ValueError('id must be provided')
+ if 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='list_ike_policy_connections',
+ operation_id='update_security_group_rule',
)
headers.update(sdk_headers)
@@ -16598,50 +18060,59 @@ def list_ike_policy_connections(
'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'))
del kwargs['headers']
headers['Accept'] = 'application/json'
- path_param_keys = ['id']
- path_param_values = self.encode_path_vars(id)
+ path_param_keys = ['security_group_id', 'id']
+ path_param_values = self.encode_path_vars(security_group_id, id)
path_param_dict = dict(zip(path_param_keys, path_param_values))
- url = '/ike_policies/{id}/connections'.format(**path_param_dict)
+ url = '/security_groups/{security_group_id}/rules/{id}'.format(**path_param_dict)
request = self.prepare_request(
- method='GET',
+ method='PATCH',
url=url,
headers=headers,
params=params,
+ data=data,
)
response = self.send(request, **kwargs)
return response
- def list_ipsec_policies(
+ def list_security_group_targets(
self,
+ security_group_id: str,
*,
- start: str = None,
- limit: int = None,
+ start: Optional[str] = None,
+ limit: Optional[int] = None,
**kwargs,
) -> DetailedResponse:
"""
- List all IPsec policies.
+ List all targets associated with a security group.
- This request lists all IPsec policies in the region.
+ This request lists all targets associated with a security group, to which the
+ rules in the security group are applied.
+ :param str security_group_id: The security group identifier.
:param str start: (optional) A server-provided token determining what
resource to start the page on.
:param int limit: (optional) The number of resources to return on a page.
:param dict headers: A `dict` containing the request headers
:return: A `DetailedResponse` containing the result, headers and HTTP status code.
- :rtype: DetailedResponse with `dict` result representing a `IPsecPolicyCollection` object
+ :rtype: DetailedResponse with `dict` result representing a `SecurityGroupTargetCollection` object
"""
+ if not security_group_id:
+ raise ValueError('security_group_id must be provided')
headers = {}
sdk_headers = get_sdk_headers(
service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='list_ipsec_policies',
+ operation_id='list_security_group_targets',
)
headers.update(sdk_headers)
@@ -16657,7 +18128,10 @@ def list_ipsec_policies(
del kwargs['headers']
headers['Accept'] = 'application/json'
- url = '/ipsec_policies'
+ 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)
request = self.prepare_request(
method='GET',
url=url,
@@ -16668,118 +18142,43 @@ def list_ipsec_policies(
response = self.send(request, **kwargs)
return response
- def create_ipsec_policy(
+ def delete_security_group_target_binding(
self,
- authentication_algorithm: str,
- encryption_algorithm: str,
- pfs: str,
- *,
- key_lifetime: int = None,
- name: str = None,
- resource_group: 'ResourceGroupIdentity' = None,
+ security_group_id: str,
+ id: str,
**kwargs,
) -> DetailedResponse:
"""
- Create an IPsec policy.
+ Remove a target from a security group.
- This request creates a new IPsec policy.
+ This request removes a target from a security group. For this request to succeed,
+ the target must be attached to at least one other security group. The specified
+ target identifier can be:
+ - A bare metal server network interface identifier
+ - A virtual network interface identifier
+ - A VPN server identifier
+ - A load balancer identifier
+ - An endpoint gateway identifier
+ - An instance network interface identifier
+ Security groups are stateful, so any changes to a target's security groups are
+ applied to new connections. Existing connections are not affected.
- :param str authentication_algorithm: The authentication algorithm
- Must be `disabled` if and only if the `encryption_algorithm` is
- `aes128gcm16`, `aes192gcm16`, or `aes256gcm16`.
- :param str encryption_algorithm: The encryption algorithm
- The `authentication_algorithm` must be `disabled` if and only if
- `encryption_algorithm` is `aes128gcm16`, `aes192gcm16`, or
- `aes256gcm16`.
- :param str pfs: Perfect Forward Secrecy.
- :param int key_lifetime: (optional) The key lifetime in seconds.
- :param str name: (optional) The name for this IPsec policy. The name must
- not be used by another IPsec policies in the region. If unspecified, the
- name will be a hyphenated list of randomly-selected words.
- :param ResourceGroupIdentity resource_group: (optional) The resource group
- to use. If unspecified, the account's [default resource
- group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be
- 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 `IPsecPolicy` 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 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_ipsec_policy',
- )
- headers.update(sdk_headers)
-
- params = {
- 'version': self.version,
- 'generation': self.generation,
- }
-
- data = {
- 'authentication_algorithm': authentication_algorithm,
- 'encryption_algorithm': encryption_algorithm,
- 'pfs': pfs,
- 'key_lifetime': key_lifetime,
- 'name': name,
- 'resource_group': resource_group,
- }
- data = {k: v for (k, v) in data.items() if v is not None}
- data = json.dumps(data)
- headers['content-type'] = 'application/json'
-
- if 'headers' in kwargs:
- headers.update(kwargs.get('headers'))
- del kwargs['headers']
- headers['Accept'] = 'application/json'
-
- url = '/ipsec_policies'
- request = self.prepare_request(
- method='POST',
- url=url,
- headers=headers,
- params=params,
- data=data,
- )
-
- response = self.send(request, **kwargs)
- return response
-
- def delete_ipsec_policy(
- self,
- id: str,
- **kwargs,
- ) -> DetailedResponse:
- """
- Delete an IPsec policy.
-
- 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 IPsec policy 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
"""
+ if not security_group_id:
+ raise ValueError('security_group_id must be provided')
if not id:
raise ValueError('id must be provided')
headers = {}
sdk_headers = get_sdk_headers(
service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='delete_ipsec_policy',
+ operation_id='delete_security_group_target_binding',
)
headers.update(sdk_headers)
@@ -16792,10 +18191,10 @@ def delete_ipsec_policy(
headers.update(kwargs.get('headers'))
del kwargs['headers']
- path_param_keys = ['id']
- path_param_values = self.encode_path_vars(id)
+ path_param_keys = ['security_group_id', 'id']
+ path_param_values = self.encode_path_vars(security_group_id, id)
path_param_dict = dict(zip(path_param_keys, path_param_values))
- url = '/ipsec_policies/{id}'.format(**path_param_dict)
+ url = '/security_groups/{security_group_id}/targets/{id}'.format(**path_param_dict)
request = self.prepare_request(
method='DELETE',
url=url,
@@ -16806,30 +18205,34 @@ def delete_ipsec_policy(
response = self.send(request, **kwargs)
return response
- def get_ipsec_policy(
+ def get_security_group_target(
self,
+ security_group_id: str,
id: str,
**kwargs,
) -> DetailedResponse:
"""
- Retrieve an IPsec policy.
+ Retrieve a security group target.
- This request retrieves a single IPsec policy specified by the identifier in the
- URL.
+ 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 id: The IPsec policy 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 `IPsecPolicy` object
+ :rtype: DetailedResponse with `dict` result representing a `SecurityGroupTargetReference` object
"""
+ if not security_group_id:
+ raise ValueError('security_group_id must be provided')
if not id:
raise ValueError('id must be provided')
headers = {}
sdk_headers = get_sdk_headers(
service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='get_ipsec_policy',
+ operation_id='get_security_group_target',
)
headers.update(sdk_headers)
@@ -16843,10 +18246,10 @@ def get_ipsec_policy(
del kwargs['headers']
headers['Accept'] = 'application/json'
- path_param_keys = ['id']
- path_param_values = self.encode_path_vars(id)
+ path_param_keys = ['security_group_id', 'id']
+ path_param_values = self.encode_path_vars(security_group_id, id)
path_param_dict = dict(zip(path_param_keys, path_param_values))
- url = '/ipsec_policies/{id}'.format(**path_param_dict)
+ url = '/security_groups/{security_group_id}/targets/{id}'.format(**path_param_dict)
request = self.prepare_request(
method='GET',
url=url,
@@ -16857,35 +18260,42 @@ def get_ipsec_policy(
response = self.send(request, **kwargs)
return response
- def update_ipsec_policy(
+ def create_security_group_target_binding(
self,
+ security_group_id: str,
id: str,
- i_psec_policy_patch: 'IPsecPolicyPatch',
**kwargs,
) -> DetailedResponse:
"""
- Update an IPsec policy.
+ Add a target to a security group.
- This request updates the properties of an existing IPsec policy.
+ This request adds a resource to an existing security group. The specified target
+ identifier can be:
+ - A bare metal server network interface identifier
+ - A virtual network interface identifier
+ - A VPN server identifier
+ - A load balancer identifier
+ - An endpoint gateway identifier
+ - An instance network interface identifier
+ When a target is added to a security group, the security group rules are applied
+ to the target. A request body is not required, and if provided, is ignored.
- :param str id: The IPsec policy identifier.
- :param IPsecPolicyPatch i_psec_policy_patch: The IPsec policy 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 `IPsecPolicy` object
+ :rtype: DetailedResponse with `dict` result representing a `SecurityGroupTargetReference` object
"""
+ if not security_group_id:
+ raise ValueError('security_group_id must be provided')
if not id:
raise ValueError('id must be provided')
- if i_psec_policy_patch is None:
- raise ValueError('i_psec_policy_patch must be provided')
- if isinstance(i_psec_policy_patch, IPsecPolicyPatch):
- i_psec_policy_patch = convert_model(i_psec_policy_patch)
headers = {}
sdk_headers = get_sdk_headers(
service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='update_ipsec_policy',
+ operation_id='create_security_group_target_binding',
)
headers.update(sdk_headers)
@@ -16894,58 +18304,62 @@ def update_ipsec_policy(
'generation': self.generation,
}
- data = json.dumps(i_psec_policy_patch)
- headers['content-type'] = 'application/merge-patch+json'
-
if 'headers' in kwargs:
headers.update(kwargs.get('headers'))
del kwargs['headers']
headers['Accept'] = 'application/json'
- 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 = '/ipsec_policies/{id}'.format(**path_param_dict)
+ url = '/security_groups/{security_group_id}/targets/{id}'.format(**path_param_dict)
request = self.prepare_request(
- method='PATCH',
+ method='PUT',
url=url,
headers=headers,
params=params,
- data=data,
)
response = self.send(request, **kwargs)
return response
- def list_ipsec_policy_connections(
+ #########################
+ # VPN gateways
+ #########################
+
+ def list_ike_policies(
self,
- id: str,
+ *,
+ start: Optional[str] = None,
+ limit: Optional[int] = None,
**kwargs,
) -> DetailedResponse:
"""
- List all VPN gateway connections that use a specified IPsec policy.
+ List all IKE policies.
- This request lists all VPN gateway connections that use a policy.
+ This request lists all IKE policies in the region.
- :param str id: The IPsec policy 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 `IKEPolicyCollection` object
"""
- if not id:
- raise ValueError('id must be provided')
headers = {}
sdk_headers = get_sdk_headers(
service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='list_ipsec_policy_connections',
+ operation_id='list_ike_policies',
)
headers.update(sdk_headers)
params = {
'version': self.version,
'generation': self.generation,
+ 'start': start,
+ 'limit': limit,
}
if 'headers' in kwargs:
@@ -16953,10 +18367,7 @@ def list_ipsec_policy_connections(
del kwargs['headers']
headers['Accept'] = 'application/json'
- path_param_keys = ['id']
- path_param_values = self.encode_path_vars(id)
- path_param_dict = dict(zip(path_param_keys, path_param_values))
- url = '/ipsec_policies/{id}/connections'.format(**path_param_dict)
+ url = '/ike_policies'
request = self.prepare_request(
method='GET',
url=url,
@@ -16967,99 +18378,118 @@ def list_ipsec_policy_connections(
response = self.send(request, **kwargs)
return response
- def list_vpn_gateways(
+ def create_ike_policy(
self,
+ authentication_algorithm: str,
+ dh_group: int,
+ encryption_algorithm: str,
+ ike_version: int,
*,
- start: str = None,
- limit: int = None,
- resource_group_id: str = None,
- sort: str = None,
- mode: str = None,
+ key_lifetime: Optional[int] = None,
+ name: Optional[str] = None,
+ resource_group: Optional['ResourceGroupIdentity'] = None,
**kwargs,
) -> DetailedResponse:
"""
- List all VPN gateways.
+ Create an IKE policy.
- This request lists all VPN gateways in the region.
+ This request creates a new IKE policy.
- :param str start: (optional) A server-provided token determining what
- resource to start the page on.
- :param int limit: (optional) The number of resources to return on a page.
- :param str resource_group_id: (optional) Filters the collection to
- resources with a `resource_group.id` property matching the specified
- identifier.
- :param str sort: (optional) Sorts the returned collection by the specified
- property name in ascending order. A `-` may be prepended to the name to
- sort in descending order. For example, the value `-created_at` sorts the
- collection by the `created_at` property in descending order, and the value
- `name` sorts it by the `name` property in ascending order.
- :param str mode: (optional) Filters the collection to VPN gateways with a
- `mode` property matching the specified value.
+ :param str authentication_algorithm: The authentication algorithm.
+ :param int dh_group: The Diffie-Hellman group.
+ :param str encryption_algorithm: The encryption algorithm.
+ :param int ike_version: The IKE protocol version.
+ :param int key_lifetime: (optional) The key lifetime in seconds.
+ :param str name: (optional) The name for this IKE policy. The name must not
+ be used by another IKE policies in the region. If unspecified, the name
+ will be a hyphenated list of randomly-selected words.
+ :param ResourceGroupIdentity resource_group: (optional) The resource group
+ to use. If unspecified, the account's [default resource
+ group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be
+ 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 `VPNGatewayCollection` object
+ :rtype: DetailedResponse with `dict` result representing a `IKEPolicy` 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)
headers = {}
sdk_headers = get_sdk_headers(
service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='list_vpn_gateways',
+ operation_id='create_ike_policy',
)
headers.update(sdk_headers)
params = {
'version': self.version,
'generation': self.generation,
- 'start': start,
- 'limit': limit,
- 'resource_group.id': resource_group_id,
- 'sort': sort,
- 'mode': mode,
}
+ data = {
+ 'authentication_algorithm': authentication_algorithm,
+ 'dh_group': dh_group,
+ 'encryption_algorithm': encryption_algorithm,
+ 'ike_version': ike_version,
+ 'key_lifetime': key_lifetime,
+ 'name': name,
+ 'resource_group': resource_group,
+ }
+ data = {k: v for (k, v) in data.items() if v is not None}
+ data = json.dumps(data)
+ headers['content-type'] = 'application/json'
+
if 'headers' in kwargs:
headers.update(kwargs.get('headers'))
del kwargs['headers']
headers['Accept'] = 'application/json'
- url = '/vpn_gateways'
+ url = '/ike_policies'
request = self.prepare_request(
- method='GET',
+ method='POST',
url=url,
headers=headers,
params=params,
+ data=data,
)
response = self.send(request, **kwargs)
return response
- def create_vpn_gateway(
+ def delete_ike_policy(
self,
- vpn_gateway_prototype: 'VPNGatewayPrototype',
+ id: str,
**kwargs,
) -> DetailedResponse:
"""
- Create a VPN gateway.
+ Delete an IKE policy.
- This request creates a new VPN gateway.
+ 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 VPNGatewayPrototype vpn_gateway_prototype: The VPN gateway prototype
- object.
+ :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 `VPNGateway` object
+ :rtype: DetailedResponse
"""
- if vpn_gateway_prototype is None:
- raise ValueError('vpn_gateway_prototype must be provided')
- if isinstance(vpn_gateway_prototype, VPNGatewayPrototype):
- vpn_gateway_prototype = convert_model(vpn_gateway_prototype)
+ if not id:
+ raise ValueError('id must be provided')
headers = {}
sdk_headers = get_sdk_headers(
service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='create_vpn_gateway',
+ operation_id='delete_ike_policy',
)
headers.update(sdk_headers)
@@ -17068,43 +18498,38 @@ def create_vpn_gateway(
'generation': self.generation,
}
- data = json.dumps(vpn_gateway_prototype)
- headers['content-type'] = 'application/json'
-
if 'headers' in kwargs:
headers.update(kwargs.get('headers'))
del kwargs['headers']
- headers['Accept'] = 'application/json'
- url = '/vpn_gateways'
+ path_param_keys = ['id']
+ path_param_values = self.encode_path_vars(id)
+ path_param_dict = dict(zip(path_param_keys, path_param_values))
+ url = '/ike_policies/{id}'.format(**path_param_dict)
request = self.prepare_request(
- method='POST',
+ method='DELETE',
url=url,
headers=headers,
params=params,
- data=data,
)
response = self.send(request, **kwargs)
return response
- def delete_vpn_gateway(
+ def get_ike_policy(
self,
id: str,
**kwargs,
) -> DetailedResponse:
"""
- Delete a VPN gateway.
+ Retrieve an IKE policy.
- 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 retrieves a single IKE policy specified by the identifier in the URL.
- :param str id: The VPN gateway 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
+ :rtype: DetailedResponse with `dict` result representing a `IKEPolicy` object
"""
if not id:
@@ -17113,7 +18538,7 @@ def delete_vpn_gateway(
sdk_headers = get_sdk_headers(
service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='delete_vpn_gateway',
+ operation_id='get_ike_policy',
)
headers.update(sdk_headers)
@@ -17125,13 +18550,14 @@ def delete_vpn_gateway(
if 'headers' in kwargs:
headers.update(kwargs.get('headers'))
del kwargs['headers']
+ headers['Accept'] = 'application/json'
path_param_keys = ['id']
path_param_values = self.encode_path_vars(id)
path_param_dict = dict(zip(path_param_keys, path_param_values))
- url = '/vpn_gateways/{id}'.format(**path_param_dict)
+ url = '/ike_policies/{id}'.format(**path_param_dict)
request = self.prepare_request(
- method='DELETE',
+ method='GET',
url=url,
headers=headers,
params=params,
@@ -17140,30 +18566,35 @@ def delete_vpn_gateway(
response = self.send(request, **kwargs)
return response
- def get_vpn_gateway(
+ def update_ike_policy(
self,
id: str,
+ ike_policy_patch: 'IKEPolicyPatch',
**kwargs,
) -> DetailedResponse:
"""
- Retrieve a VPN gateway.
+ Update an IKE policy.
- This request retrieves a single VPN gateway specified by the identifier in the
- URL.
+ This request updates the properties of an existing IKE policy.
- :param str id: The VPN gateway identifier.
+ :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 with `dict` result representing a `VPNGateway` object
+ :rtype: DetailedResponse with `dict` result representing a `IKEPolicy` object
"""
if not id:
raise ValueError('id must be provided')
+ if ike_policy_patch is None:
+ raise ValueError('ike_policy_patch must be provided')
+ if isinstance(ike_policy_patch, IKEPolicyPatch):
+ ike_policy_patch = convert_model(ike_policy_patch)
headers = {}
sdk_headers = get_sdk_headers(
service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='get_vpn_gateway',
+ operation_id='update_ike_policy',
)
headers.update(sdk_headers)
@@ -17172,6 +18603,9 @@ def get_vpn_gateway(
'generation': self.generation,
}
+ data = json.dumps(ike_policy_patch)
+ headers['content-type'] = 'application/merge-patch+json'
+
if 'headers' in kwargs:
headers.update(kwargs.get('headers'))
del kwargs['headers']
@@ -17180,46 +18614,41 @@ def get_vpn_gateway(
path_param_keys = ['id']
path_param_values = self.encode_path_vars(id)
path_param_dict = dict(zip(path_param_keys, path_param_values))
- url = '/vpn_gateways/{id}'.format(**path_param_dict)
+ url = '/ike_policies/{id}'.format(**path_param_dict)
request = self.prepare_request(
- method='GET',
+ method='PATCH',
url=url,
headers=headers,
params=params,
+ data=data,
)
response = self.send(request, **kwargs)
return response
- def update_vpn_gateway(
+ def list_ike_policy_connections(
self,
id: str,
- vpn_gateway_patch: 'VPNGatewayPatch',
**kwargs,
) -> DetailedResponse:
"""
- Update a VPN gateway.
+ List all VPN gateway connections that use a specified IKE policy.
- This request updates the properties of an existing VPN gateway.
+ This request lists all VPN gateway connections that use a policy.
- :param str id: The VPN gateway identifier.
- :param VPNGatewayPatch vpn_gateway_patch: The VPN gateway patch.
+ :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 `VPNGateway` object
+ :rtype: DetailedResponse with `dict` result representing a `VPNGatewayConnectionCollection` object
"""
if not id:
raise ValueError('id must be provided')
- if vpn_gateway_patch is None:
- raise ValueError('vpn_gateway_patch must be provided')
- if isinstance(vpn_gateway_patch, VPNGatewayPatch):
- vpn_gateway_patch = convert_model(vpn_gateway_patch)
headers = {}
sdk_headers = get_sdk_headers(
service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='update_vpn_gateway',
+ operation_id='list_ike_policy_connections',
)
headers.update(sdk_headers)
@@ -17228,9 +18657,6 @@ def update_vpn_gateway(
'generation': self.generation,
}
- data = json.dumps(vpn_gateway_patch)
- headers['content-type'] = 'application/merge-patch+json'
-
if 'headers' in kwargs:
headers.update(kwargs.get('headers'))
del kwargs['headers']
@@ -17239,52 +18665,50 @@ def update_vpn_gateway(
path_param_keys = ['id']
path_param_values = self.encode_path_vars(id)
path_param_dict = dict(zip(path_param_keys, path_param_values))
- url = '/vpn_gateways/{id}'.format(**path_param_dict)
+ url = '/ike_policies/{id}/connections'.format(**path_param_dict)
request = self.prepare_request(
- method='PATCH',
+ method='GET',
url=url,
headers=headers,
params=params,
- data=data,
)
response = self.send(request, **kwargs)
return response
- def list_vpn_gateway_connections(
+ def list_ipsec_policies(
self,
- vpn_gateway_id: str,
*,
- status: str = None,
+ start: Optional[str] = None,
+ limit: Optional[int] = None,
**kwargs,
) -> DetailedResponse:
"""
- List all connections of a VPN gateway.
+ List all IPsec policies.
- This request lists all connections of a VPN gateway.
+ This request lists all IPsec policies in the region.
- :param str vpn_gateway_id: The VPN gateway identifier.
- :param str status: (optional) Filters the collection to VPN gateway
- connections with a `status` property matching the specified value.
+ :param str 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 `IPsecPolicyCollection` object
"""
- if not vpn_gateway_id:
- raise ValueError('vpn_gateway_id must be provided')
headers = {}
sdk_headers = get_sdk_headers(
service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='list_vpn_gateway_connections',
+ operation_id='list_ipsec_policies',
)
headers.update(sdk_headers)
params = {
'version': self.version,
'generation': self.generation,
- 'status': status,
+ 'start': start,
+ 'limit': limit,
}
if 'headers' in kwargs:
@@ -17292,10 +18716,7 @@ def list_vpn_gateway_connections(
del kwargs['headers']
headers['Accept'] = 'application/json'
- path_param_keys = ['vpn_gateway_id']
- path_param_values = self.encode_path_vars(vpn_gateway_id)
- path_param_dict = dict(zip(path_param_keys, path_param_values))
- url = '/vpn_gateways/{vpn_gateway_id}/connections'.format(**path_param_dict)
+ url = '/ipsec_policies'
request = self.prepare_request(
method='GET',
url=url,
@@ -17306,36 +18727,56 @@ def list_vpn_gateway_connections(
response = self.send(request, **kwargs)
return response
- def create_vpn_gateway_connection(
+ def create_ipsec_policy(
self,
- vpn_gateway_id: str,
- vpn_gateway_connection_prototype: 'VPNGatewayConnectionPrototype',
+ authentication_algorithm: str,
+ encryption_algorithm: str,
+ pfs: str,
+ *,
+ key_lifetime: Optional[int] = None,
+ name: Optional[str] = None,
+ resource_group: Optional['ResourceGroupIdentity'] = None,
**kwargs,
) -> DetailedResponse:
"""
- Create a connection for a VPN gateway.
+ Create an IPsec policy.
- This request creates a new VPN gateway connection.
+ This request creates a new IPsec policy.
- :param str vpn_gateway_id: The VPN gateway identifier.
- :param VPNGatewayConnectionPrototype vpn_gateway_connection_prototype: The
- VPN gateway connection prototype object.
+ :param str authentication_algorithm: The authentication algorithm
+ Must be `disabled` if and only if the `encryption_algorithm` is
+ `aes128gcm16`, `aes192gcm16`, or `aes256gcm16`.
+ :param str encryption_algorithm: The encryption algorithm
+ The `authentication_algorithm` must be `disabled` if and only if
+ `encryption_algorithm` is `aes128gcm16`, `aes192gcm16`, or
+ `aes256gcm16`.
+ :param str pfs: Perfect Forward Secrecy.
+ :param int key_lifetime: (optional) The key lifetime in seconds.
+ :param str name: (optional) The name for this IPsec policy. The name must
+ not be used by another IPsec policies in the region. If unspecified, the
+ name will be a hyphenated list of randomly-selected words.
+ :param ResourceGroupIdentity resource_group: (optional) The resource group
+ to use. If unspecified, the account's [default resource
+ group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be
+ 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 `VPNGatewayConnection` object
+ :rtype: DetailedResponse with `dict` result representing a `IPsecPolicy` object
"""
- if not vpn_gateway_id:
- raise ValueError('vpn_gateway_id must be provided')
- if vpn_gateway_connection_prototype is None:
- raise ValueError('vpn_gateway_connection_prototype must be provided')
- if isinstance(vpn_gateway_connection_prototype, VPNGatewayConnectionPrototype):
- vpn_gateway_connection_prototype = convert_model(vpn_gateway_connection_prototype)
+ if authentication_algorithm is None:
+ raise ValueError('authentication_algorithm must be provided')
+ if encryption_algorithm is None:
+ raise ValueError('encryption_algorithm must be provided')
+ if pfs is None:
+ raise ValueError('pfs must be provided')
+ if resource_group is not None:
+ resource_group = convert_model(resource_group)
headers = {}
sdk_headers = get_sdk_headers(
service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='create_vpn_gateway_connection',
+ operation_id='create_ipsec_policy',
)
headers.update(sdk_headers)
@@ -17344,7 +18785,16 @@ def create_vpn_gateway_connection(
'generation': self.generation,
}
- data = json.dumps(vpn_gateway_connection_prototype)
+ data = {
+ 'authentication_algorithm': authentication_algorithm,
+ 'encryption_algorithm': encryption_algorithm,
+ 'pfs': pfs,
+ 'key_lifetime': key_lifetime,
+ 'name': name,
+ 'resource_group': resource_group,
+ }
+ data = {k: v for (k, v) in data.items() if v is not None}
+ data = json.dumps(data)
headers['content-type'] = 'application/json'
if 'headers' in kwargs:
@@ -17352,10 +18802,7 @@ def create_vpn_gateway_connection(
del kwargs['headers']
headers['Accept'] = 'application/json'
- path_param_keys = ['vpn_gateway_id']
- path_param_values = self.encode_path_vars(vpn_gateway_id)
- path_param_dict = dict(zip(path_param_keys, path_param_values))
- url = '/vpn_gateways/{vpn_gateway_id}/connections'.format(**path_param_dict)
+ url = '/ipsec_policies'
request = self.prepare_request(
method='POST',
url=url,
@@ -17367,35 +18814,31 @@ def create_vpn_gateway_connection(
response = self.send(request, **kwargs)
return response
- def delete_vpn_gateway_connection(
+ def delete_ipsec_policy(
self,
- vpn_gateway_id: str,
id: str,
**kwargs,
) -> DetailedResponse:
"""
- Delete a VPN gateway connection.
+ Delete an IPsec policy.
- 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 deletes an IPsec policy. This operation cannot be reversed. For this
+ request to succeed, there must not be any VPN gateway connections using this
+ policy.
- :param str vpn_gateway_id: The VPN gateway identifier.
- :param str id: The VPN gateway connection identifier.
+ :param str id: The IPsec policy identifier.
:param dict headers: A `dict` containing the request headers
:return: A `DetailedResponse` containing the result, headers and HTTP status code.
:rtype: DetailedResponse
"""
- if not vpn_gateway_id:
- raise ValueError('vpn_gateway_id must be provided')
if not id:
raise ValueError('id must be provided')
headers = {}
sdk_headers = get_sdk_headers(
service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='delete_vpn_gateway_connection',
+ operation_id='delete_ipsec_policy',
)
headers.update(sdk_headers)
@@ -17408,10 +18851,10 @@ def delete_vpn_gateway_connection(
headers.update(kwargs.get('headers'))
del kwargs['headers']
- path_param_keys = ['vpn_gateway_id', 'id']
- path_param_values = self.encode_path_vars(vpn_gateway_id, id)
+ 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}'.format(**path_param_dict)
+ url = '/ipsec_policies/{id}'.format(**path_param_dict)
request = self.prepare_request(
method='DELETE',
url=url,
@@ -17422,34 +18865,30 @@ def delete_vpn_gateway_connection(
response = self.send(request, **kwargs)
return response
- def get_vpn_gateway_connection(
+ def get_ipsec_policy(
self,
- vpn_gateway_id: str,
id: str,
**kwargs,
) -> DetailedResponse:
"""
- Retrieve a VPN gateway connection.
+ Retrieve an IPsec policy.
- This request retrieves a single VPN gateway connection specified by the identifier
- in the URL.
+ This request retrieves a single IPsec 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 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 `VPNGatewayConnection` object
+ :rtype: DetailedResponse with `dict` result representing a `IPsecPolicy` object
"""
- if not vpn_gateway_id:
- raise ValueError('vpn_gateway_id must be provided')
if not id:
raise ValueError('id must be provided')
headers = {}
sdk_headers = get_sdk_headers(
service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='get_vpn_gateway_connection',
+ operation_id='get_ipsec_policy',
)
headers.update(sdk_headers)
@@ -17463,10 +18902,10 @@ def get_vpn_gateway_connection(
del kwargs['headers']
headers['Accept'] = 'application/json'
- path_param_keys = ['vpn_gateway_id', 'id']
- path_param_values = self.encode_path_vars(vpn_gateway_id, id)
+ path_param_keys = ['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}'.format(**path_param_dict)
+ url = '/ipsec_policies/{id}'.format(**path_param_dict)
request = self.prepare_request(
method='GET',
url=url,
@@ -17477,40 +18916,35 @@ def get_vpn_gateway_connection(
response = self.send(request, **kwargs)
return response
- def update_vpn_gateway_connection(
+ def update_ipsec_policy(
self,
- vpn_gateway_id: str,
id: str,
- vpn_gateway_connection_patch: 'VPNGatewayConnectionPatch',
+ i_psec_policy_patch: 'IPsecPolicyPatch',
**kwargs,
) -> DetailedResponse:
"""
- Update a VPN gateway connection.
+ Update an IPsec policy.
- This request updates the properties of an existing VPN gateway connection.
+ This request updates the properties of an existing IPsec policy.
- :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 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 `VPNGatewayConnection` object
+ :rtype: DetailedResponse with `dict` result representing a `IPsecPolicy` object
"""
- if not vpn_gateway_id:
- raise ValueError('vpn_gateway_id must be provided')
if not id:
raise ValueError('id must be provided')
- if 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)
+ 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_vpn_gateway_connection',
+ operation_id='update_ipsec_policy',
)
headers.update(sdk_headers)
@@ -17519,7 +18953,7 @@ def update_vpn_gateway_connection(
'generation': self.generation,
}
- data = json.dumps(vpn_gateway_connection_patch)
+ data = json.dumps(i_psec_policy_patch)
headers['content-type'] = 'application/merge-patch+json'
if 'headers' in kwargs:
@@ -17527,10 +18961,10 @@ def update_vpn_gateway_connection(
del kwargs['headers']
headers['Accept'] = 'application/json'
- path_param_keys = ['vpn_gateway_id', 'id']
- path_param_values = self.encode_path_vars(vpn_gateway_id, id)
+ path_param_keys = ['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}'.format(**path_param_dict)
+ url = '/ipsec_policies/{id}'.format(**path_param_dict)
request = self.prepare_request(
method='PATCH',
url=url,
@@ -17542,34 +18976,29 @@ def update_vpn_gateway_connection(
response = self.send(request, **kwargs)
return response
- def list_vpn_gateway_connection_local_cidrs(
+ def list_ipsec_policy_connections(
self,
- vpn_gateway_id: str,
id: str,
**kwargs,
) -> DetailedResponse:
"""
- List all local CIDRs for a VPN gateway connection.
+ List all VPN gateway connections that use a specified IPsec policy.
- This request lists all local CIDRs for a VPN gateway connection.
- This request is only supported for policy mode VPN gateways.
+ This request lists all VPN gateway connections that use a policy.
- :param str vpn_gateway_id: The VPN gateway identifier.
- :param str id: The VPN gateway connection identifier.
+ :param str id: The 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 `VPNGatewayConnectionLocalCIDRs` object
+ :rtype: DetailedResponse with `dict` result representing a `VPNGatewayConnectionCollection` object
"""
- if not vpn_gateway_id:
- raise ValueError('vpn_gateway_id must be provided')
if not id:
raise ValueError('id must be provided')
headers = {}
sdk_headers = get_sdk_headers(
service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='list_vpn_gateway_connection_local_cidrs',
+ operation_id='list_ipsec_policy_connections',
)
headers.update(sdk_headers)
@@ -17583,10 +19012,10 @@ def list_vpn_gateway_connection_local_cidrs(
del kwargs['headers']
headers['Accept'] = 'application/json'
- path_param_keys = ['vpn_gateway_id', 'id']
- path_param_values = self.encode_path_vars(vpn_gateway_id, id)
+ path_param_keys = ['id']
+ path_param_values = self.encode_path_vars(id)
path_param_dict = dict(zip(path_param_keys, path_param_values))
- url = '/vpn_gateways/{vpn_gateway_id}/connections/{id}/local_cidrs'.format(**path_param_dict)
+ url = '/ipsec_policies/{id}/connections'.format(**path_param_dict)
request = self.prepare_request(
method='GET',
url=url,
@@ -17597,60 +19026,65 @@ def list_vpn_gateway_connection_local_cidrs(
response = self.send(request, **kwargs)
return response
- def remove_vpn_gateway_connection_local_cidr(
+ def list_vpn_gateways(
self,
- vpn_gateway_id: str,
- id: str,
- cidr_prefix: str,
- prefix_length: str,
+ *,
+ start: Optional[str] = None,
+ limit: Optional[int] = None,
+ resource_group_id: Optional[str] = None,
+ sort: Optional[str] = None,
+ mode: Optional[str] = None,
**kwargs,
) -> DetailedResponse:
"""
- Remove a local CIDR from a VPN gateway connection.
+ List all VPN gateways.
- This request removes a CIDR from a VPN gateway connection.
- This request is only supported for policy mode VPN gateways.
+ This request lists all VPN gateways 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 str resource_group_id: (optional) Filters the collection to
+ resources with a `resource_group.id` property matching the specified
+ identifier.
+ :param str sort: (optional) Sorts the returned collection by the specified
+ property name in ascending order. A `-` may be prepended to the name to
+ sort in descending order. For example, the value `-created_at` sorts the
+ collection by the `created_at` property in descending order, and the value
+ `name` sorts it by the `name` property in ascending order.
+ :param str mode: (optional) Filters the collection to VPN gateways with a
+ `mode` property matching the specified value.
:param dict headers: A `dict` containing the request headers
:return: A `DetailedResponse` containing the result, headers and HTTP status code.
- :rtype: DetailedResponse
+ :rtype: DetailedResponse with `dict` result representing a `VPNGatewayCollection` object
"""
- if not vpn_gateway_id:
- raise ValueError('vpn_gateway_id must be provided')
- if not id:
- raise ValueError('id must be provided')
- if not cidr_prefix:
- raise ValueError('cidr_prefix must be provided')
- if not prefix_length:
- raise ValueError('prefix_length must be provided')
headers = {}
sdk_headers = get_sdk_headers(
service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='remove_vpn_gateway_connection_local_cidr',
+ operation_id='list_vpn_gateways',
)
headers.update(sdk_headers)
params = {
'version': self.version,
'generation': self.generation,
+ 'start': start,
+ 'limit': limit,
+ 'resource_group.id': resource_group_id,
+ 'sort': sort,
+ 'mode': mode,
}
if 'headers' in kwargs:
headers.update(kwargs.get('headers'))
del kwargs['headers']
+ headers['Accept'] = 'application/json'
- 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 = '/vpn_gateways'
request = self.prepare_request(
- method='DELETE',
+ method='GET',
url=url,
headers=headers,
params=params,
@@ -17659,43 +19093,32 @@ def remove_vpn_gateway_connection_local_cidr(
response = self.send(request, **kwargs)
return response
- def check_vpn_gateway_connection_local_cidr(
+ def create_vpn_gateway(
self,
- vpn_gateway_id: str,
- id: str,
- cidr_prefix: str,
- prefix_length: str,
+ vpn_gateway_prototype: 'VPNGatewayPrototype',
**kwargs,
) -> DetailedResponse:
"""
- Check if the specified local CIDR exists on a VPN gateway connection.
+ Create a VPN gateway.
- This request succeeds if a CIDR exists on the specified VPN gateway connection,
- and fails otherwise.
- This request is only supported for policy mode VPN gateways.
+ This request creates a new VPN gateway.
- :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 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
+ :rtype: DetailedResponse with `dict` result representing a `VPNGateway` object
"""
- if not vpn_gateway_id:
- raise ValueError('vpn_gateway_id must be provided')
- if not id:
- raise ValueError('id must be provided')
- if not cidr_prefix:
- raise ValueError('cidr_prefix must be provided')
- if not prefix_length:
- raise ValueError('prefix_length must be provided')
+ if 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='check_vpn_gateway_connection_local_cidr',
+ operation_id='create_vpn_gateway',
)
headers.update(sdk_headers)
@@ -17704,62 +19127,52 @@ def check_vpn_gateway_connection_local_cidr(
'generation': self.generation,
}
+ data = json.dumps(vpn_gateway_prototype)
+ headers['content-type'] = 'application/json'
+
if 'headers' in kwargs:
headers.update(kwargs.get('headers'))
del kwargs['headers']
+ headers['Accept'] = 'application/json'
- path_param_keys = ['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 = '/vpn_gateways'
request = self.prepare_request(
- method='GET',
+ method='POST',
url=url,
headers=headers,
params=params,
+ data=data,
)
response = self.send(request, **kwargs)
return response
- def add_vpn_gateway_connection_local_cidr(
+ def delete_vpn_gateway(
self,
- vpn_gateway_id: str,
id: str,
- cidr_prefix: str,
- prefix_length: str,
**kwargs,
) -> DetailedResponse:
"""
- Set a local CIDR on a VPN gateway connection.
+ Delete a VPN gateway.
- This request adds the specified CIDR to the specified VPN gateway connection. This
- request succeeds if the specified CIDR already exists. A request body is not
- required, and if provided, is ignored.
- This request is only supported for policy mode VPN gateways.
+ This request deletes 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 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 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 not vpn_gateway_id:
- raise ValueError('vpn_gateway_id must be provided')
if not id:
raise ValueError('id must be provided')
- if not cidr_prefix:
- raise ValueError('cidr_prefix must be provided')
- if not prefix_length:
- raise ValueError('prefix_length must be provided')
headers = {}
sdk_headers = get_sdk_headers(
service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='add_vpn_gateway_connection_local_cidr',
+ operation_id='delete_vpn_gateway',
)
headers.update(sdk_headers)
@@ -17772,12 +19185,12 @@ def add_vpn_gateway_connection_local_cidr(
headers.update(kwargs.get('headers'))
del kwargs['headers']
- path_param_keys = ['vpn_gateway_id', 'id', 'cidr_prefix', 'prefix_length']
- path_param_values = self.encode_path_vars(vpn_gateway_id, id, cidr_prefix, prefix_length)
+ path_param_keys = ['id']
+ path_param_values = self.encode_path_vars(id)
path_param_dict = dict(zip(path_param_keys, path_param_values))
- url = '/vpn_gateways/{vpn_gateway_id}/connections/{id}/local_cidrs/{cidr_prefix}/{prefix_length}'.format(**path_param_dict)
+ url = '/vpn_gateways/{id}'.format(**path_param_dict)
request = self.prepare_request(
- method='PUT',
+ method='DELETE',
url=url,
headers=headers,
params=params,
@@ -17786,34 +19199,30 @@ def add_vpn_gateway_connection_local_cidr(
response = self.send(request, **kwargs)
return response
- def list_vpn_gateway_connection_peer_cidrs(
+ def get_vpn_gateway(
self,
- vpn_gateway_id: str,
id: str,
**kwargs,
) -> DetailedResponse:
"""
- List all peer CIDRs for a VPN gateway connection.
+ Retrieve a VPN gateway.
- This request lists all peer CIDRs for a VPN gateway connection.
- This request is only supported for policy mode VPN gateways.
+ This request retrieves a single VPN gateway 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 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 `VPNGatewayConnectionPeerCIDRs` object
+ :rtype: DetailedResponse with `dict` result representing a `VPNGateway` object
"""
- if not vpn_gateway_id:
- raise ValueError('vpn_gateway_id must be provided')
if not id:
raise ValueError('id must be provided')
headers = {}
sdk_headers = get_sdk_headers(
service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='list_vpn_gateway_connection_peer_cidrs',
+ operation_id='get_vpn_gateway',
)
headers.update(sdk_headers)
@@ -17827,10 +19236,10 @@ def list_vpn_gateway_connection_peer_cidrs(
del kwargs['headers']
headers['Accept'] = 'application/json'
- path_param_keys = ['vpn_gateway_id', 'id']
- path_param_values = self.encode_path_vars(vpn_gateway_id, id)
+ path_param_keys = ['id']
+ path_param_values = self.encode_path_vars(id)
path_param_dict = dict(zip(path_param_keys, path_param_values))
- url = '/vpn_gateways/{vpn_gateway_id}/connections/{id}/peer_cidrs'.format(**path_param_dict)
+ url = '/vpn_gateways/{id}'.format(**path_param_dict)
request = self.prepare_request(
method='GET',
url=url,
@@ -17841,42 +19250,35 @@ def list_vpn_gateway_connection_peer_cidrs(
response = self.send(request, **kwargs)
return response
- def remove_vpn_gateway_connection_peer_cidr(
+ def update_vpn_gateway(
self,
- vpn_gateway_id: str,
id: str,
- cidr_prefix: str,
- prefix_length: str,
+ vpn_gateway_patch: 'VPNGatewayPatch',
**kwargs,
) -> DetailedResponse:
"""
- Remove a peer CIDR from a VPN gateway connection.
+ Update a VPN gateway.
- This request removes a CIDR from a VPN gateway connection.
- This request is only supported for policy mode VPN gateways.
+ This request updates the properties of an existing VPN gateway.
- :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 VPN gateway identifier.
+ :param VPNGatewayPatch vpn_gateway_patch: The VPN gateway patch.
:param dict headers: A `dict` containing the request headers
:return: A `DetailedResponse` containing the result, headers and HTTP status code.
- :rtype: DetailedResponse
+ :rtype: DetailedResponse with `dict` result representing a `VPNGateway` object
"""
- if not vpn_gateway_id:
- raise ValueError('vpn_gateway_id must be provided')
if not id:
raise ValueError('id must be provided')
- if not cidr_prefix:
- raise ValueError('cidr_prefix must be provided')
- if not prefix_length:
- raise ValueError('prefix_length must be provided')
+ if 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='remove_vpn_gateway_connection_peer_cidr',
+ operation_id='update_vpn_gateway',
)
headers.update(sdk_headers)
@@ -17885,77 +19287,74 @@ def remove_vpn_gateway_connection_peer_cidr(
'generation': self.generation,
}
+ data = json.dumps(vpn_gateway_patch)
+ headers['content-type'] = 'application/merge-patch+json'
+
if 'headers' in kwargs:
headers.update(kwargs.get('headers'))
del kwargs['headers']
+ headers['Accept'] = 'application/json'
- path_param_keys = ['vpn_gateway_id', 'id', 'cidr_prefix', 'prefix_length']
- path_param_values = self.encode_path_vars(vpn_gateway_id, id, cidr_prefix, prefix_length)
+ path_param_keys = ['id']
+ path_param_values = self.encode_path_vars(id)
path_param_dict = dict(zip(path_param_keys, path_param_values))
- url = '/vpn_gateways/{vpn_gateway_id}/connections/{id}/peer_cidrs/{cidr_prefix}/{prefix_length}'.format(**path_param_dict)
+ url = '/vpn_gateways/{id}'.format(**path_param_dict)
request = self.prepare_request(
- method='DELETE',
+ method='PATCH',
url=url,
headers=headers,
params=params,
+ data=data,
)
response = self.send(request, **kwargs)
return response
- def check_vpn_gateway_connection_peer_cidr(
+ def list_vpn_gateway_connections(
self,
vpn_gateway_id: str,
- id: str,
- cidr_prefix: str,
- prefix_length: str,
+ *,
+ status: Optional[str] = None,
**kwargs,
) -> DetailedResponse:
"""
- Check if the specified peer CIDR exists on a VPN gateway connection.
+ List all connections of a VPN gateway.
- This request succeeds if a CIDR exists on the specified VPN gateway connection,
- and fails otherwise.
- This request is only supported for policy mode VPN gateways.
+ This request lists all connections of a VPN gateway.
: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 status: (optional) Filters the collection to VPN gateway
+ connections with a `status` property matching the specified value.
:param dict headers: A `dict` containing the request headers
:return: A `DetailedResponse` containing the result, headers and HTTP status code.
- :rtype: DetailedResponse
+ :rtype: DetailedResponse with `dict` result representing a `VPNGatewayConnectionCollection` object
"""
if not vpn_gateway_id:
raise ValueError('vpn_gateway_id must be provided')
- if not id:
- raise ValueError('id must be provided')
- if not cidr_prefix:
- raise ValueError('cidr_prefix must be provided')
- if not prefix_length:
- raise ValueError('prefix_length must be provided')
headers = {}
sdk_headers = get_sdk_headers(
service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='check_vpn_gateway_connection_peer_cidr',
+ operation_id='list_vpn_gateway_connections',
)
headers.update(sdk_headers)
params = {
'version': self.version,
'generation': self.generation,
+ 'status': status,
}
if 'headers' in kwargs:
headers.update(kwargs.get('headers'))
del kwargs['headers']
+ headers['Accept'] = 'application/json'
- path_param_keys = ['vpn_gateway_id', 'id', 'cidr_prefix', 'prefix_length']
- path_param_values = self.encode_path_vars(vpn_gateway_id, id, cidr_prefix, prefix_length)
+ path_param_keys = ['vpn_gateway_id']
+ path_param_values = self.encode_path_vars(vpn_gateway_id)
path_param_dict = dict(zip(path_param_keys, path_param_values))
- url = '/vpn_gateways/{vpn_gateway_id}/connections/{id}/peer_cidrs/{cidr_prefix}/{prefix_length}'.format(**path_param_dict)
+ url = '/vpn_gateways/{vpn_gateway_id}/connections'.format(**path_param_dict)
request = self.prepare_request(
method='GET',
url=url,
@@ -17966,44 +19365,36 @@ def check_vpn_gateway_connection_peer_cidr(
response = self.send(request, **kwargs)
return response
- def add_vpn_gateway_connection_peer_cidr(
+ def create_vpn_gateway_connection(
self,
vpn_gateway_id: str,
- id: str,
- cidr_prefix: str,
- prefix_length: str,
+ vpn_gateway_connection_prototype: 'VPNGatewayConnectionPrototype',
**kwargs,
) -> DetailedResponse:
"""
- Set a peer CIDR on a VPN gateway connection.
+ Create a connection for a VPN gateway.
- This request adds the specified CIDR to the specified VPN gateway connection. This
- request succeeds if the specified CIDR already exists. A request body is not
- required, and if provided, is ignored.
- This request is only supported for policy mode VPN gateways.
+ This request creates a new VPN gateway connection.
: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 VPNGatewayConnectionPrototype vpn_gateway_connection_prototype: The
+ VPN gateway connection prototype object.
:param dict headers: A `dict` containing the request headers
:return: A `DetailedResponse` containing the result, headers and HTTP status code.
- :rtype: DetailedResponse
+ :rtype: DetailedResponse with `dict` result representing a `VPNGatewayConnection` object
"""
if not vpn_gateway_id:
raise ValueError('vpn_gateway_id must be provided')
- if not id:
- raise ValueError('id must be provided')
- if not cidr_prefix:
- raise ValueError('cidr_prefix must be provided')
- if not prefix_length:
- raise ValueError('prefix_length must be provided')
+ if 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='add_vpn_gateway_connection_peer_cidr',
+ operation_id='create_vpn_gateway_connection',
)
headers.update(sdk_headers)
@@ -18012,87 +19403,76 @@ def add_vpn_gateway_connection_peer_cidr(
'generation': self.generation,
}
+ data = json.dumps(vpn_gateway_connection_prototype)
+ headers['content-type'] = 'application/json'
+
if 'headers' in kwargs:
headers.update(kwargs.get('headers'))
del kwargs['headers']
+ headers['Accept'] = 'application/json'
- path_param_keys = ['vpn_gateway_id', 'id', 'cidr_prefix', 'prefix_length']
- path_param_values = self.encode_path_vars(vpn_gateway_id, id, cidr_prefix, prefix_length)
+ path_param_keys = ['vpn_gateway_id']
+ path_param_values = self.encode_path_vars(vpn_gateway_id)
path_param_dict = dict(zip(path_param_keys, path_param_values))
- url = '/vpn_gateways/{vpn_gateway_id}/connections/{id}/peer_cidrs/{cidr_prefix}/{prefix_length}'.format(**path_param_dict)
+ url = '/vpn_gateways/{vpn_gateway_id}/connections'.format(**path_param_dict)
request = self.prepare_request(
- method='PUT',
+ method='POST',
url=url,
headers=headers,
params=params,
+ data=data,
)
response = self.send(request, **kwargs)
return response
- #########################
- # VPN servers
- #########################
-
- def list_vpn_servers(
+ def delete_vpn_gateway_connection(
self,
- *,
- name: str = None,
- start: str = None,
- limit: int = None,
- resource_group_id: str = None,
- sort: str = None,
+ vpn_gateway_id: str,
+ id: str,
**kwargs,
) -> DetailedResponse:
"""
- List all VPN servers.
+ Delete a VPN gateway connection.
- This request lists all VPN servers.
+ 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 name: (optional) Filters the collection to resources with a
- `name` property matching the exact specified name.
- :param str start: (optional) A server-provided token determining what
- resource to start the page on.
- :param int limit: (optional) The number of resources to return on a page.
- :param str resource_group_id: (optional) Filters the collection to
- resources with a `resource_group.id` property matching the specified
- identifier.
- :param str sort: (optional) Sorts the returned collection by the specified
- property name in ascending order. A `-` may be prepended to the name to
- sort in descending order. For example, the value `-created_at` sorts the
- collection by the `created_at` property in descending order, and the value
- `name` sorts it by the `name` property in ascending order.
+ :param str 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 `VPNServerCollection` object
+ :rtype: DetailedResponse
"""
+ if not vpn_gateway_id:
+ raise ValueError('vpn_gateway_id must be provided')
+ if not id:
+ raise ValueError('id must be provided')
headers = {}
sdk_headers = get_sdk_headers(
service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='list_vpn_servers',
+ operation_id='delete_vpn_gateway_connection',
)
headers.update(sdk_headers)
params = {
'version': self.version,
'generation': self.generation,
- 'name': name,
- 'start': start,
- 'limit': limit,
- 'resource_group.id': resource_group_id,
- 'sort': sort,
}
if 'headers' in kwargs:
headers.update(kwargs.get('headers'))
del kwargs['headers']
- headers['Accept'] = 'application/json'
- url = '/vpn_servers'
+ path_param_keys = ['vpn_gateway_id', 'id']
+ path_param_values = self.encode_path_vars(vpn_gateway_id, id)
+ path_param_dict = dict(zip(path_param_keys, path_param_values))
+ url = '/vpn_gateways/{vpn_gateway_id}/connections/{id}'.format(**path_param_dict)
request = self.prepare_request(
- method='GET',
+ method='DELETE',
url=url,
headers=headers,
params=params,
@@ -18101,94 +19481,34 @@ def list_vpn_servers(
response = self.send(request, **kwargs)
return response
- def create_vpn_server(
+ def get_vpn_gateway_connection(
self,
- certificate: 'CertificateInstanceIdentity',
- client_authentication: List['VPNServerAuthenticationPrototype'],
- client_ip_pool: str,
- subnets: List['SubnetIdentity'],
- *,
- client_dns_server_ips: List['IP'] = None,
- client_idle_timeout: int = None,
- enable_split_tunneling: bool = None,
- name: str = None,
- port: int = None,
- protocol: str = None,
- resource_group: 'ResourceGroupIdentity' = None,
- security_groups: List['SecurityGroupIdentity'] = None,
+ vpn_gateway_id: str,
+ id: str,
**kwargs,
) -> DetailedResponse:
"""
- Create a VPN server.
+ Retrieve a VPN gateway connection.
- This request creates a new VPN server.
+ This request retrieves a single VPN gateway connection specified by the identifier
+ in the URL.
- :param CertificateInstanceIdentity certificate: The certificate instance
- for this VPN server.
- :param List[VPNServerAuthenticationPrototype] client_authentication: The
- methods used to authenticate VPN clients to this VPN server. VPN clients
- must authenticate against all specified methods.
- :param str client_ip_pool: The VPN client IPv4 address pool, expressed in
- CIDR format. The request must not overlap with any existing address
- prefixes in the VPC or any of the following reserved address ranges:
- - `127.0.0.0/8` (IPv4 loopback addresses)
- - `161.26.0.0/16` (IBM services)
- - `166.8.0.0/14` (Cloud Service Endpoints)
- - `169.254.0.0/16` (IPv4 link-local addresses)
- - `224.0.0.0/4` (IPv4 multicast addresses)
- The prefix length of the client IP address pool's CIDR must be between
- `/9` (8,388,608 addresses) and `/22` (1024 addresses). A CIDR block that
- contains twice the number of IP addresses that are required to enable the
- maximum number of concurrent connections is recommended.
- :param List[SubnetIdentity] subnets: The subnets to provision this VPN
- server in. Use subnets in different zones for high availability.
- :param List[IP] client_dns_server_ips: (optional) The DNS server addresses
- that will be provided to VPN clients connected to this VPN server.
- :param int client_idle_timeout: (optional) The seconds a VPN client can be
- idle before this VPN server will disconnect it. Specify `0` to prevent
- the server from disconnecting idle clients.
- :param bool enable_split_tunneling: (optional) Indicates whether the split
- tunneling is enabled on this VPN server.
- :param str name: (optional) The name for this VPN server. The name must not
- be used by another VPN server in the VPC. If unspecified, the name will be
- a hyphenated list of randomly-selected words.
- :param int port: (optional) The port number to use for this VPN server.
- :param str protocol: (optional) The transport protocol to use for this VPN
- server.
- :param ResourceGroupIdentity resource_group: (optional) The resource group
- to use. If unspecified, the account's [default resource
- group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be
- used.
- :param List[SecurityGroupIdentity] security_groups: (optional) The security
- groups to use for this VPN server. If unspecified, the VPC's default
- security group is used.
+ :param str 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 `VPNServer` object
+ :rtype: DetailedResponse with `dict` result representing a `VPNGatewayConnection` object
"""
- if certificate is None:
- raise ValueError('certificate must be provided')
- if client_authentication is None:
- raise ValueError('client_authentication must be provided')
- if client_ip_pool is None:
- raise ValueError('client_ip_pool must be provided')
- if subnets is None:
- raise ValueError('subnets must be provided')
- certificate = convert_model(certificate)
- client_authentication = [convert_model(x) for x in client_authentication]
- subnets = [convert_model(x) for x in subnets]
- if client_dns_server_ips is not None:
- client_dns_server_ips = [convert_model(x) for x in client_dns_server_ips]
- if resource_group is not None:
- resource_group = convert_model(resource_group)
- if security_groups is not None:
- security_groups = [convert_model(x) for x in security_groups]
+ if not vpn_gateway_id:
+ raise ValueError('vpn_gateway_id must be provided')
+ if not id:
+ raise ValueError('id must be provided')
headers = {}
sdk_headers = get_sdk_headers(
service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='create_vpn_server',
+ operation_id='get_vpn_gateway_connection',
)
headers.update(sdk_headers)
@@ -18197,70 +19517,59 @@ def create_vpn_server(
'generation': self.generation,
}
- data = {
- 'certificate': certificate,
- 'client_authentication': client_authentication,
- 'client_ip_pool': client_ip_pool,
- 'subnets': subnets,
- 'client_dns_server_ips': client_dns_server_ips,
- 'client_idle_timeout': client_idle_timeout,
- 'enable_split_tunneling': enable_split_tunneling,
- 'name': name,
- 'port': port,
- 'protocol': protocol,
- 'resource_group': resource_group,
- 'security_groups': security_groups,
- }
- data = {k: v for (k, v) in data.items() if v is not None}
- data = json.dumps(data)
- headers['content-type'] = 'application/json'
-
if 'headers' in kwargs:
headers.update(kwargs.get('headers'))
del kwargs['headers']
headers['Accept'] = 'application/json'
- url = '/vpn_servers'
+ path_param_keys = ['vpn_gateway_id', 'id']
+ path_param_values = self.encode_path_vars(vpn_gateway_id, id)
+ path_param_dict = dict(zip(path_param_keys, path_param_values))
+ url = '/vpn_gateways/{vpn_gateway_id}/connections/{id}'.format(**path_param_dict)
request = self.prepare_request(
- method='POST',
+ method='GET',
url=url,
headers=headers,
params=params,
- data=data,
)
response = self.send(request, **kwargs)
return response
- def delete_vpn_server(
+ def update_vpn_gateway_connection(
self,
+ vpn_gateway_id: str,
id: str,
- *,
- if_match: str = None,
+ vpn_gateway_connection_patch: 'VPNGatewayConnectionPatch',
**kwargs,
) -> DetailedResponse:
"""
- Delete a VPN server.
+ Update a VPN gateway connection.
- This request deletes a VPN server. This operation cannot be reversed.
+ This request updates the properties of an existing VPN gateway connection.
- :param str id: The VPN server identifier.
- :param str if_match: (optional) If present, the request will fail if the
- specified ETag value does not match the resource's current ETag value.
+ :param str vpn_gateway_id: The VPN gateway identifier.
+ :param str id: The VPN gateway connection identifier.
+ :param VPNGatewayConnectionPatch vpn_gateway_connection_patch: The VPN
+ gateway connection patch.
:param dict headers: A `dict` containing the request headers
:return: A `DetailedResponse` containing the result, headers and HTTP status code.
- :rtype: DetailedResponse
+ :rtype: DetailedResponse with `dict` result representing a `VPNGatewayConnection` object
"""
+ if not vpn_gateway_id:
+ raise ValueError('vpn_gateway_id must be provided')
if not id:
raise ValueError('id must be provided')
- headers = {
- 'If-Match': if_match,
- }
+ if vpn_gateway_connection_patch is None:
+ raise ValueError('vpn_gateway_connection_patch must be provided')
+ if isinstance(vpn_gateway_connection_patch, VPNGatewayConnectionPatch):
+ vpn_gateway_connection_patch = convert_model(vpn_gateway_connection_patch)
+ headers = {}
sdk_headers = get_sdk_headers(
service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='delete_vpn_server',
+ operation_id='update_vpn_gateway_connection',
)
headers.update(sdk_headers)
@@ -18269,47 +19578,57 @@ def delete_vpn_server(
'generation': self.generation,
}
+ data = json.dumps(vpn_gateway_connection_patch)
+ headers['content-type'] = 'application/merge-patch+json'
+
if 'headers' in kwargs:
headers.update(kwargs.get('headers'))
del kwargs['headers']
+ headers['Accept'] = 'application/json'
- path_param_keys = ['id']
- path_param_values = self.encode_path_vars(id)
+ path_param_keys = ['vpn_gateway_id', 'id']
+ path_param_values = self.encode_path_vars(vpn_gateway_id, id)
path_param_dict = dict(zip(path_param_keys, path_param_values))
- url = '/vpn_servers/{id}'.format(**path_param_dict)
+ url = '/vpn_gateways/{vpn_gateway_id}/connections/{id}'.format(**path_param_dict)
request = self.prepare_request(
- method='DELETE',
+ method='PATCH',
url=url,
headers=headers,
params=params,
+ data=data,
)
response = self.send(request, **kwargs)
return response
- def get_vpn_server(
+ def list_vpn_gateway_connection_local_cidrs(
self,
+ vpn_gateway_id: str,
id: str,
**kwargs,
) -> DetailedResponse:
"""
- Retrieve a VPN server.
+ List all local CIDRs for a VPN gateway connection.
- This request retrieves a single VPN server specified by the identifier in the URL.
+ This request lists all local CIDRs for a VPN gateway connection.
+ This request is only supported for policy mode VPN gateways.
- :param str id: The VPN server 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 `VPNServer` object
+ :rtype: DetailedResponse with `dict` result representing a `VPNGatewayConnectionLocalCIDRs` object
"""
+ if not vpn_gateway_id:
+ raise ValueError('vpn_gateway_id must be provided')
if not id:
raise ValueError('id must be provided')
headers = {}
sdk_headers = get_sdk_headers(
service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='get_vpn_server',
+ operation_id='list_vpn_gateway_connection_local_cidrs',
)
headers.update(sdk_headers)
@@ -18323,10 +19642,10 @@ def get_vpn_server(
del kwargs['headers']
headers['Accept'] = 'application/json'
- path_param_keys = ['id']
- path_param_values = self.encode_path_vars(id)
+ path_param_keys = ['vpn_gateway_id', 'id']
+ path_param_values = self.encode_path_vars(vpn_gateway_id, id)
path_param_dict = dict(zip(path_param_keys, path_param_values))
- url = '/vpn_servers/{id}'.format(**path_param_dict)
+ url = '/vpn_gateways/{vpn_gateway_id}/connections/{id}/local_cidrs'.format(**path_param_dict)
request = self.prepare_request(
method='GET',
url=url,
@@ -18337,44 +19656,42 @@ def get_vpn_server(
response = self.send(request, **kwargs)
return response
- def update_vpn_server(
+ def remove_vpn_gateway_connection_local_cidr(
self,
+ vpn_gateway_id: str,
id: str,
- vpn_server_patch: 'VPNServerPatch',
- *,
- if_match: str = None,
+ cidr_prefix: str,
+ prefix_length: str,
**kwargs,
) -> DetailedResponse:
"""
- Update a VPN server.
+ Remove a local CIDR from a VPN gateway connection.
- This request updates the properties of an existing VPN server. Any property
- changes will cause all connected VPN clients are disconnected from this VPN server
- except for the name change.
+ This request removes a CIDR from a VPN gateway connection.
+ This request is only supported for policy mode VPN gateways.
- :param str id: The VPN server identifier.
- :param VPNServerPatch vpn_server_patch: The VPN server patch.
- :param str if_match: (optional) If present, the request will fail if the
- specified ETag value does not match the resource's current ETag value.
- Required if the request body includes an array.
+ :param 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 `VPNServer` object
+ :rtype: DetailedResponse
"""
+ if not vpn_gateway_id:
+ raise ValueError('vpn_gateway_id must be provided')
if not id:
raise ValueError('id must be provided')
- if vpn_server_patch is None:
- raise ValueError('vpn_server_patch must be provided')
- if isinstance(vpn_server_patch, VPNServerPatch):
- vpn_server_patch = convert_model(vpn_server_patch)
- headers = {
- 'If-Match': if_match,
- }
+ if not cidr_prefix:
+ raise ValueError('cidr_prefix must be provided')
+ if not prefix_length:
+ raise ValueError('prefix_length must be provided')
+ headers = {}
sdk_headers = get_sdk_headers(
service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='update_vpn_server',
+ operation_id='remove_vpn_gateway_connection_local_cidr',
)
headers.update(sdk_headers)
@@ -18383,54 +19700,61 @@ def update_vpn_server(
'generation': self.generation,
}
- data = json.dumps(vpn_server_patch)
- headers['content-type'] = 'application/merge-patch+json'
-
if 'headers' in kwargs:
headers.update(kwargs.get('headers'))
del kwargs['headers']
- headers['Accept'] = 'application/json'
- path_param_keys = ['id']
- path_param_values = self.encode_path_vars(id)
+ path_param_keys = ['vpn_gateway_id', 'id', 'cidr_prefix', 'prefix_length']
+ path_param_values = self.encode_path_vars(vpn_gateway_id, id, cidr_prefix, prefix_length)
path_param_dict = dict(zip(path_param_keys, path_param_values))
- url = '/vpn_servers/{id}'.format(**path_param_dict)
+ url = '/vpn_gateways/{vpn_gateway_id}/connections/{id}/local_cidrs/{cidr_prefix}/{prefix_length}'.format(**path_param_dict)
request = self.prepare_request(
- method='PATCH',
+ method='DELETE',
url=url,
headers=headers,
params=params,
- data=data,
)
response = self.send(request, **kwargs)
return response
- def get_vpn_server_client_configuration(
+ def check_vpn_gateway_connection_local_cidr(
self,
+ vpn_gateway_id: str,
id: str,
+ cidr_prefix: str,
+ prefix_length: str,
**kwargs,
) -> DetailedResponse:
"""
- Retrieve client configuration.
+ Check if the specified local CIDR exists on a VPN gateway connection.
- This request retrieves OpenVPN client configuration on a single VPN server
- specified by the identifier in the URL. This configuration includes directives
- compatible with OpenVPN releases 2.4 and 2.5.
+ This request succeeds if a CIDR exists on the specified VPN gateway connection,
+ and fails otherwise.
+ This request is only supported for policy mode VPN gateways.
- :param str id: The VPN server 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 `str` result
+ :rtype: DetailedResponse
"""
+ if not vpn_gateway_id:
+ raise ValueError('vpn_gateway_id must be provided')
if not id:
raise ValueError('id must be provided')
+ if not cidr_prefix:
+ raise ValueError('cidr_prefix must be provided')
+ if not prefix_length:
+ raise ValueError('prefix_length must be provided')
headers = {}
sdk_headers = get_sdk_headers(
service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='get_vpn_server_client_configuration',
+ operation_id='check_vpn_gateway_connection_local_cidr',
)
headers.update(sdk_headers)
@@ -18442,12 +19766,11 @@ def get_vpn_server_client_configuration(
if 'headers' in kwargs:
headers.update(kwargs.get('headers'))
del kwargs['headers']
- headers['Accept'] = 'text/plain'
- path_param_keys = ['id']
- path_param_values = self.encode_path_vars(id)
+ path_param_keys = ['vpn_gateway_id', 'id', 'cidr_prefix', 'prefix_length']
+ path_param_values = self.encode_path_vars(vpn_gateway_id, id, cidr_prefix, prefix_length)
path_param_dict = dict(zip(path_param_keys, path_param_values))
- url = '/vpn_servers/{id}/client_configuration'.format(**path_param_dict)
+ url = '/vpn_gateways/{vpn_gateway_id}/connections/{id}/local_cidrs/{cidr_prefix}/{prefix_length}'.format(**path_param_dict)
request = self.prepare_request(
method='GET',
url=url,
@@ -18458,63 +19781,62 @@ def get_vpn_server_client_configuration(
response = self.send(request, **kwargs)
return response
- def list_vpn_server_clients(
+ def add_vpn_gateway_connection_local_cidr(
self,
- vpn_server_id: str,
- *,
- start: str = None,
- limit: int = None,
- sort: str = None,
+ vpn_gateway_id: str,
+ id: str,
+ cidr_prefix: str,
+ prefix_length: str,
**kwargs,
) -> DetailedResponse:
"""
- List all VPN clients for a VPN server.
+ Set a local CIDR on a VPN gateway connection.
- This request retrieves all connected VPN clients, and any disconnected VPN clients
- that the VPN server has not yet deleted based on its auto-deletion policy.
+ This request adds the specified CIDR to the specified VPN gateway connection. This
+ request succeeds if the specified CIDR already exists. A request body is not
+ required, and if provided, is ignored.
+ This request is only supported for policy mode VPN gateways.
- :param str vpn_server_id: The VPN server identifier.
- :param str start: (optional) A server-provided token determining what
- resource to start the page on.
- :param int limit: (optional) The number of resources to return on a page.
- :param str sort: (optional) Sorts the returned collection by the specified
- property name in ascending order. A `-` may be prepended to the name to
- sort in descending order. For example, the value `-created_at` sorts the
- collection by the `created_at` property in descending order.
+ :param str 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 `VPNServerClientCollection` object
+ :rtype: DetailedResponse
"""
- if not vpn_server_id:
- raise ValueError('vpn_server_id must be provided')
+ if not vpn_gateway_id:
+ raise ValueError('vpn_gateway_id must be provided')
+ if not id:
+ raise ValueError('id must be provided')
+ if not cidr_prefix:
+ raise ValueError('cidr_prefix must be provided')
+ if not prefix_length:
+ raise ValueError('prefix_length must be provided')
headers = {}
sdk_headers = get_sdk_headers(
service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='list_vpn_server_clients',
+ operation_id='add_vpn_gateway_connection_local_cidr',
)
headers.update(sdk_headers)
params = {
'version': self.version,
'generation': self.generation,
- 'start': start,
- 'limit': limit,
- 'sort': sort,
}
if 'headers' in kwargs:
headers.update(kwargs.get('headers'))
del kwargs['headers']
- headers['Accept'] = 'application/json'
- path_param_keys = ['vpn_server_id']
- path_param_values = self.encode_path_vars(vpn_server_id)
+ path_param_keys = ['vpn_gateway_id', 'id', 'cidr_prefix', 'prefix_length']
+ path_param_values = self.encode_path_vars(vpn_gateway_id, id, cidr_prefix, prefix_length)
path_param_dict = dict(zip(path_param_keys, path_param_values))
- url = '/vpn_servers/{vpn_server_id}/clients'.format(**path_param_dict)
+ url = '/vpn_gateways/{vpn_gateway_id}/connections/{id}/local_cidrs/{cidr_prefix}/{prefix_length}'.format(**path_param_dict)
request = self.prepare_request(
- method='GET',
+ method='PUT',
url=url,
headers=headers,
params=params,
@@ -18523,35 +19845,34 @@ def list_vpn_server_clients(
response = self.send(request, **kwargs)
return response
- def delete_vpn_server_client(
+ def list_vpn_gateway_connection_peer_cidrs(
self,
- vpn_server_id: str,
+ vpn_gateway_id: str,
id: str,
**kwargs,
) -> DetailedResponse:
"""
- Delete a VPN client.
+ List all peer CIDRs for a VPN gateway connection.
- This request disconnects and deletes the VPN client from the VPN server. The VPN
- client may reconnect unless its authentication permissions for the configured
- authentication methods (such as its client certificate) have been revoked.
+ This request lists all peer CIDRs for a VPN gateway connection.
+ This request is only supported for policy mode VPN gateways.
- :param str vpn_server_id: The VPN server identifier.
- :param str id: The VPN client 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
+ :rtype: DetailedResponse with `dict` result representing a `VPNGatewayConnectionPeerCIDRs` object
"""
- if not vpn_server_id:
- raise ValueError('vpn_server_id must be provided')
+ if not vpn_gateway_id:
+ raise ValueError('vpn_gateway_id must be provided')
if not id:
raise ValueError('id must be provided')
headers = {}
sdk_headers = get_sdk_headers(
service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='delete_vpn_server_client',
+ operation_id='list_vpn_gateway_connection_peer_cidrs',
)
headers.update(sdk_headers)
@@ -18563,13 +19884,14 @@ def delete_vpn_server_client(
if 'headers' in kwargs:
headers.update(kwargs.get('headers'))
del kwargs['headers']
+ headers['Accept'] = 'application/json'
- path_param_keys = ['vpn_server_id', 'id']
- path_param_values = self.encode_path_vars(vpn_server_id, id)
+ path_param_keys = ['vpn_gateway_id', 'id']
+ path_param_values = self.encode_path_vars(vpn_gateway_id, id)
path_param_dict = dict(zip(path_param_keys, path_param_values))
- url = '/vpn_servers/{vpn_server_id}/clients/{id}'.format(**path_param_dict)
+ url = '/vpn_gateways/{vpn_gateway_id}/connections/{id}/peer_cidrs'.format(**path_param_dict)
request = self.prepare_request(
- method='DELETE',
+ method='GET',
url=url,
headers=headers,
params=params,
@@ -18578,33 +19900,42 @@ def delete_vpn_server_client(
response = self.send(request, **kwargs)
return response
- def get_vpn_server_client(
+ def remove_vpn_gateway_connection_peer_cidr(
self,
- vpn_server_id: str,
+ vpn_gateway_id: str,
id: str,
+ cidr_prefix: str,
+ prefix_length: str,
**kwargs,
) -> DetailedResponse:
"""
- Retrieve a VPN client.
+ Remove a peer CIDR from a VPN gateway connection.
- This request retrieves a single VPN client specified by the identifier in the URL.
+ This request removes a CIDR from a VPN gateway connection.
+ This request is only supported for policy mode VPN gateways.
- :param str vpn_server_id: The VPN server identifier.
- :param str id: The VPN client 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 `VPNServerClient` object
+ :rtype: DetailedResponse
"""
- if not vpn_server_id:
- raise ValueError('vpn_server_id must be provided')
+ if not vpn_gateway_id:
+ raise ValueError('vpn_gateway_id must be provided')
if not id:
raise ValueError('id must be provided')
+ if not cidr_prefix:
+ raise ValueError('cidr_prefix must be provided')
+ if not prefix_length:
+ raise ValueError('prefix_length must be provided')
headers = {}
sdk_headers = get_sdk_headers(
service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='get_vpn_server_client',
+ operation_id='remove_vpn_gateway_connection_peer_cidr',
)
headers.update(sdk_headers)
@@ -18616,14 +19947,13 @@ def get_vpn_server_client(
if 'headers' in kwargs:
headers.update(kwargs.get('headers'))
del kwargs['headers']
- headers['Accept'] = 'application/json'
- path_param_keys = ['vpn_server_id', 'id']
- path_param_values = self.encode_path_vars(vpn_server_id, id)
+ path_param_keys = ['vpn_gateway_id', 'id', 'cidr_prefix', 'prefix_length']
+ path_param_values = self.encode_path_vars(vpn_gateway_id, id, cidr_prefix, prefix_length)
path_param_dict = dict(zip(path_param_keys, path_param_values))
- url = '/vpn_servers/{vpn_server_id}/clients/{id}'.format(**path_param_dict)
+ url = '/vpn_gateways/{vpn_gateway_id}/connections/{id}/peer_cidrs/{cidr_prefix}/{prefix_length}'.format(**path_param_dict)
request = self.prepare_request(
- method='GET',
+ method='DELETE',
url=url,
headers=headers,
params=params,
@@ -18632,36 +19962,43 @@ def get_vpn_server_client(
response = self.send(request, **kwargs)
return response
- def disconnect_vpn_client(
+ def check_vpn_gateway_connection_peer_cidr(
self,
- vpn_server_id: str,
+ vpn_gateway_id: str,
id: str,
+ cidr_prefix: str,
+ prefix_length: str,
**kwargs,
) -> DetailedResponse:
"""
- Disconnect a VPN client.
+ Check if the specified peer CIDR exists on a VPN gateway connection.
- This request disconnects the specified VPN client, and deletes the client
- according to the VPN server's auto-deletion policy. The VPN client may reconnect
- unless its authentication permissions for the configured authentication methods
- (such as its client certificate) have been revoked.
+ This request succeeds if a CIDR exists on the specified VPN gateway connection,
+ and fails otherwise.
+ This request is only supported for policy mode VPN gateways.
- :param str vpn_server_id: The VPN server identifier.
- :param str id: The VPN client identifier.
+ :param str vpn_gateway_id: The VPN gateway identifier.
+ :param str id: The VPN gateway connection identifier.
+ :param str cidr_prefix: The address prefix part of the CIDR.
+ :param str prefix_length: The prefix length part of the CIDR.
:param dict headers: A `dict` containing the request headers
:return: A `DetailedResponse` containing the result, headers and HTTP status code.
:rtype: DetailedResponse
"""
- if not vpn_server_id:
- raise ValueError('vpn_server_id must be provided')
+ if not vpn_gateway_id:
+ raise ValueError('vpn_gateway_id must be provided')
if not id:
raise ValueError('id must be provided')
+ if not cidr_prefix:
+ raise ValueError('cidr_prefix must be provided')
+ if not prefix_length:
+ raise ValueError('prefix_length must be provided')
headers = {}
sdk_headers = get_sdk_headers(
service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='disconnect_vpn_client',
+ operation_id='check_vpn_gateway_connection_peer_cidr',
)
headers.update(sdk_headers)
@@ -18674,12 +20011,12 @@ def disconnect_vpn_client(
headers.update(kwargs.get('headers'))
del kwargs['headers']
- path_param_keys = ['vpn_server_id', 'id']
- path_param_values = self.encode_path_vars(vpn_server_id, id)
+ path_param_keys = ['vpn_gateway_id', 'id', 'cidr_prefix', 'prefix_length']
+ path_param_values = self.encode_path_vars(vpn_gateway_id, id, cidr_prefix, prefix_length)
path_param_dict = dict(zip(path_param_keys, path_param_values))
- url = '/vpn_servers/{vpn_server_id}/clients/{id}/disconnect'.format(**path_param_dict)
+ url = '/vpn_gateways/{vpn_gateway_id}/connections/{id}/peer_cidrs/{cidr_prefix}/{prefix_length}'.format(**path_param_dict)
request = self.prepare_request(
- method='POST',
+ method='GET',
url=url,
headers=headers,
params=params,
@@ -18688,66 +20025,62 @@ def disconnect_vpn_client(
response = self.send(request, **kwargs)
return response
- def list_vpn_server_routes(
+ def add_vpn_gateway_connection_peer_cidr(
self,
- vpn_server_id: str,
- *,
- start: str = None,
- limit: int = None,
- sort: str = None,
+ vpn_gateway_id: str,
+ id: str,
+ cidr_prefix: str,
+ prefix_length: str,
**kwargs,
) -> DetailedResponse:
"""
- List all VPN routes for a VPN server.
+ Set a peer CIDR on a VPN gateway connection.
- This request lists all VPN routes in a VPN server. All VPN routes are provided to
- the VPN client when the connection is established. Packets received from the VPN
- client will be dropped by the VPN server if there is no VPN route matching their
- specified destinations. All VPN routes must be unique within the VPN server.
+ This request adds the specified CIDR to the specified VPN gateway connection. This
+ request succeeds if the specified CIDR already exists. A request body is not
+ required, and if provided, is ignored.
+ This request is only supported for policy mode VPN gateways.
- :param str vpn_server_id: The VPN server identifier.
- :param str start: (optional) A server-provided token determining what
- resource to start the page on.
- :param int limit: (optional) The number of resources to return on a page.
- :param str sort: (optional) Sorts the returned collection by the specified
- property name in ascending order. A `-` may be prepended to the name to
- sort in descending order. For example, the value `-created_at` sorts the
- collection by the `created_at` property in descending order, and the value
- `name` sorts it by the `name` property in ascending order.
+ :param str vpn_gateway_id: The VPN gateway identifier.
+ :param str id: The VPN gateway connection identifier.
+ :param 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 `VPNServerRouteCollection` object
+ :rtype: DetailedResponse
"""
- if not vpn_server_id:
- raise ValueError('vpn_server_id must be provided')
+ if not vpn_gateway_id:
+ raise ValueError('vpn_gateway_id must be provided')
+ if not id:
+ raise ValueError('id must be provided')
+ if not cidr_prefix:
+ raise ValueError('cidr_prefix must be provided')
+ if not prefix_length:
+ raise ValueError('prefix_length must be provided')
headers = {}
sdk_headers = get_sdk_headers(
service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='list_vpn_server_routes',
+ operation_id='add_vpn_gateway_connection_peer_cidr',
)
headers.update(sdk_headers)
params = {
'version': self.version,
'generation': self.generation,
- 'start': start,
- 'limit': limit,
- 'sort': sort,
}
if 'headers' in kwargs:
headers.update(kwargs.get('headers'))
del kwargs['headers']
- headers['Accept'] = 'application/json'
- path_param_keys = ['vpn_server_id']
- path_param_values = self.encode_path_vars(vpn_server_id)
+ path_param_keys = ['vpn_gateway_id', 'id', 'cidr_prefix', 'prefix_length']
+ path_param_values = self.encode_path_vars(vpn_gateway_id, id, cidr_prefix, prefix_length)
path_param_dict = dict(zip(path_param_keys, path_param_values))
- url = '/vpn_servers/{vpn_server_id}/routes'.format(**path_param_dict)
+ url = '/vpn_gateways/{vpn_gateway_id}/connections/{id}/peer_cidrs/{cidr_prefix}/{prefix_length}'.format(**path_param_dict)
request = self.prepare_request(
- method='GET',
+ method='PUT',
url=url,
headers=headers,
params=params,
@@ -18756,119 +20089,165 @@ def list_vpn_server_routes(
response = self.send(request, **kwargs)
return response
- def create_vpn_server_route(
+ #########################
+ # VPN servers
+ #########################
+
+ def list_vpn_servers(
self,
- vpn_server_id: str,
- destination: str,
*,
- action: str = None,
- name: str = None,
+ name: Optional[str] = None,
+ start: Optional[str] = None,
+ limit: Optional[int] = None,
+ resource_group_id: Optional[str] = None,
+ sort: Optional[str] = None,
**kwargs,
) -> DetailedResponse:
"""
- Create a VPN route for a VPN server.
+ List all VPN servers.
- This request creates a new VPN route in the VPN server. All VPN routes are
- provided to the VPN client when the connection is established. Packets received
- from the VPN client will be dropped by the VPN server if there is no VPN route
- matching their specified destinations. All VPN routes must be unique within the
- VPN server. destination of the packet.
+ This request lists all VPN servers.
- :param str vpn_server_id: The VPN server identifier.
- :param str destination: The destination to use for this VPN route in the
- VPN server. Must be unique within the VPN server. If an incoming packet
- does not match any destination, it will be dropped.
- :param str action: (optional) The action to perform with a packet matching
- the VPN route:
- - `translate`: translate the source IP address to one of the private IP
- addresses of the VPN server, then deliver the packet to target.
- - `deliver`: deliver the packet to the target.
- - `drop`: drop the packet
- The enumerated values for this property are expected to expand in the
- future. When processing this property, check for and log unknown values.
- Optionally halt processing and surface the error, or bypass the VPN route
- on which the unexpected property value was encountered.
- :param str name: (optional) The name for this VPN server route. The name
- must not be used by another route for the VPN server. If unspecified, the
- name will be a hyphenated list of randomly-selected words.
+ :param str name: (optional) Filters the collection to resources with a
+ `name` property matching the exact specified name.
+ :param str start: (optional) A server-provided token determining what
+ resource to start the page on.
+ :param int limit: (optional) The number of resources to return on a page.
+ :param str resource_group_id: (optional) Filters the collection to
+ resources with a `resource_group.id` property matching the specified
+ identifier.
+ :param str sort: (optional) Sorts the returned collection by the specified
+ property name in ascending order. A `-` may be prepended to the name to
+ sort in descending order. For example, the value `-created_at` sorts the
+ collection by the `created_at` property in descending order, and the value
+ `name` sorts it by the `name` property in ascending order.
:param dict headers: A `dict` containing the request headers
:return: A `DetailedResponse` containing the result, headers and HTTP status code.
- :rtype: DetailedResponse with `dict` result representing a `VPNServerRoute` object
+ :rtype: DetailedResponse with `dict` result representing a `VPNServerCollection` object
"""
- if not vpn_server_id:
- raise ValueError('vpn_server_id must be provided')
- if destination is None:
- raise ValueError('destination must be provided')
headers = {}
sdk_headers = get_sdk_headers(
service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='create_vpn_server_route',
+ operation_id='list_vpn_servers',
)
headers.update(sdk_headers)
params = {
'version': self.version,
'generation': self.generation,
- }
-
- data = {
- 'destination': destination,
- 'action': action,
'name': name,
+ 'start': start,
+ 'limit': limit,
+ 'resource_group.id': resource_group_id,
+ 'sort': sort,
}
- data = {k: v for (k, v) in data.items() if v is not None}
- data = json.dumps(data)
- headers['content-type'] = 'application/json'
if 'headers' in kwargs:
headers.update(kwargs.get('headers'))
del kwargs['headers']
headers['Accept'] = 'application/json'
- path_param_keys = ['vpn_server_id']
- path_param_values = self.encode_path_vars(vpn_server_id)
- path_param_dict = dict(zip(path_param_keys, path_param_values))
- url = '/vpn_servers/{vpn_server_id}/routes'.format(**path_param_dict)
+ url = '/vpn_servers'
request = self.prepare_request(
- method='POST',
+ method='GET',
url=url,
headers=headers,
params=params,
- data=data,
)
response = self.send(request, **kwargs)
return response
- def delete_vpn_server_route(
+ def create_vpn_server(
self,
- vpn_server_id: str,
- id: str,
+ certificate: 'CertificateInstanceIdentity',
+ client_authentication: List['VPNServerAuthenticationPrototype'],
+ client_ip_pool: str,
+ subnets: List['SubnetIdentity'],
+ *,
+ client_dns_server_ips: Optional[List['IP']] = None,
+ client_idle_timeout: Optional[int] = None,
+ enable_split_tunneling: Optional[bool] = None,
+ name: Optional[str] = None,
+ port: Optional[int] = None,
+ protocol: Optional[str] = None,
+ resource_group: Optional['ResourceGroupIdentity'] = None,
+ security_groups: Optional[List['SecurityGroupIdentity']] = None,
**kwargs,
) -> DetailedResponse:
"""
- Delete a VPN route.
+ Create a VPN server.
- This request deletes a VPN route. This operation cannot be reversed.
+ This request creates a new VPN server.
- :param str vpn_server_id: The VPN server identifier.
- :param str id: The VPN route identifier.
+ :param CertificateInstanceIdentity certificate: The certificate instance
+ for this VPN server.
+ :param List[VPNServerAuthenticationPrototype] client_authentication: The
+ methods used to authenticate VPN clients to this VPN server. VPN clients
+ must authenticate against all specified methods.
+ :param str client_ip_pool: The VPN client IPv4 address pool, expressed in
+ CIDR format. The request must not overlap with any existing address
+ prefixes in the VPC or any of the following reserved address ranges:
+ - `127.0.0.0/8` (IPv4 loopback addresses)
+ - `161.26.0.0/16` (IBM services)
+ - `166.8.0.0/14` (Cloud Service Endpoints)
+ - `169.254.0.0/16` (IPv4 link-local addresses)
+ - `224.0.0.0/4` (IPv4 multicast addresses)
+ The prefix length of the client IP address pool's CIDR must be between
+ `/9` (8,388,608 addresses) and `/22` (1024 addresses). A CIDR block that
+ contains twice the number of IP addresses that are required to enable the
+ maximum number of concurrent connections is recommended.
+ :param List[SubnetIdentity] subnets: The subnets to provision this VPN
+ server in. Use subnets in different zones for high availability.
+ :param List[IP] client_dns_server_ips: (optional) The DNS server addresses
+ that will be provided to VPN clients connected to this VPN server.
+ :param int client_idle_timeout: (optional) The seconds a VPN client can be
+ idle before this VPN server will disconnect it. Specify `0` to prevent
+ the server from disconnecting idle clients.
+ :param bool enable_split_tunneling: (optional) Indicates whether the split
+ tunneling is enabled on this VPN server.
+ :param str name: (optional) The name for this VPN server. The name must not
+ be used by another VPN server in the VPC. If unspecified, the name will be
+ a hyphenated list of randomly-selected words.
+ :param int port: (optional) The port number to use for this VPN server.
+ :param str protocol: (optional) The transport protocol to use for this VPN
+ server.
+ :param ResourceGroupIdentity resource_group: (optional) The resource group
+ to use. If unspecified, the account's [default resource
+ group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be
+ used.
+ :param List[SecurityGroupIdentity] security_groups: (optional) The security
+ groups to use for this VPN server. If unspecified, the VPC's default
+ security group is used.
:param dict headers: A `dict` containing the request headers
:return: A `DetailedResponse` containing the result, headers and HTTP status code.
- :rtype: DetailedResponse
+ :rtype: DetailedResponse with `dict` result representing a `VPNServer` object
"""
- if not vpn_server_id:
- raise ValueError('vpn_server_id must be provided')
- if not id:
- raise ValueError('id must be provided')
+ if certificate is None:
+ raise ValueError('certificate must be provided')
+ if client_authentication is None:
+ raise ValueError('client_authentication must be provided')
+ if client_ip_pool is None:
+ raise ValueError('client_ip_pool must be provided')
+ if subnets is None:
+ raise ValueError('subnets must be provided')
+ certificate = convert_model(certificate)
+ client_authentication = [convert_model(x) for x in client_authentication]
+ subnets = [convert_model(x) for x in subnets]
+ if client_dns_server_ips is not None:
+ client_dns_server_ips = [convert_model(x) for x in client_dns_server_ips]
+ if resource_group is not None:
+ resource_group = convert_model(resource_group)
+ if security_groups is not None:
+ security_groups = [convert_model(x) for x in security_groups]
headers = {}
sdk_headers = get_sdk_headers(
service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='delete_vpn_server_route',
+ operation_id='create_vpn_server',
)
headers.update(sdk_headers)
@@ -18877,51 +20256,70 @@ def delete_vpn_server_route(
'generation': self.generation,
}
+ data = {
+ 'certificate': certificate,
+ 'client_authentication': client_authentication,
+ 'client_ip_pool': client_ip_pool,
+ 'subnets': subnets,
+ 'client_dns_server_ips': client_dns_server_ips,
+ 'client_idle_timeout': client_idle_timeout,
+ 'enable_split_tunneling': enable_split_tunneling,
+ 'name': name,
+ 'port': port,
+ 'protocol': protocol,
+ 'resource_group': resource_group,
+ 'security_groups': security_groups,
+ }
+ data = {k: v for (k, v) in data.items() if v is not None}
+ data = json.dumps(data)
+ headers['content-type'] = 'application/json'
+
if 'headers' in kwargs:
headers.update(kwargs.get('headers'))
del kwargs['headers']
+ headers['Accept'] = 'application/json'
- path_param_keys = ['vpn_server_id', 'id']
- path_param_values = self.encode_path_vars(vpn_server_id, id)
- path_param_dict = dict(zip(path_param_keys, path_param_values))
- url = '/vpn_servers/{vpn_server_id}/routes/{id}'.format(**path_param_dict)
+ url = '/vpn_servers'
request = self.prepare_request(
- method='DELETE',
+ method='POST',
url=url,
headers=headers,
params=params,
+ data=data,
)
response = self.send(request, **kwargs)
return response
- def get_vpn_server_route(
+ def delete_vpn_server(
self,
- vpn_server_id: str,
id: str,
+ *,
+ if_match: Optional[str] = None,
**kwargs,
) -> DetailedResponse:
"""
- Retrieve a VPN route.
+ Delete a VPN server.
- This request retrieves a single VPN route specified by the identifier in the URL.
+ This request deletes a VPN server. This operation cannot be reversed.
- :param str vpn_server_id: The VPN server identifier.
- :param str id: The VPN route identifier.
+ :param str id: The VPN server identifier.
+ :param str if_match: (optional) If present, the request will fail if the
+ specified ETag value does not match the resource's current ETag value.
:param dict headers: A `dict` containing the request headers
:return: A `DetailedResponse` containing the result, headers and HTTP status code.
- :rtype: DetailedResponse with `dict` result representing a `VPNServerRoute` object
+ :rtype: DetailedResponse
"""
- if not vpn_server_id:
- raise ValueError('vpn_server_id must be provided')
if not id:
raise ValueError('id must be provided')
- headers = {}
+ headers = {
+ 'If-Match': if_match,
+ }
sdk_headers = get_sdk_headers(
service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='get_vpn_server_route',
+ operation_id='delete_vpn_server',
)
headers.update(sdk_headers)
@@ -18933,14 +20331,13 @@ def get_vpn_server_route(
if 'headers' in kwargs:
headers.update(kwargs.get('headers'))
del kwargs['headers']
- headers['Accept'] = 'application/json'
- path_param_keys = ['vpn_server_id', 'id']
- path_param_values = self.encode_path_vars(vpn_server_id, id)
+ path_param_keys = ['id']
+ path_param_values = self.encode_path_vars(id)
path_param_dict = dict(zip(path_param_keys, path_param_values))
- url = '/vpn_servers/{vpn_server_id}/routes/{id}'.format(**path_param_dict)
+ url = '/vpn_servers/{id}'.format(**path_param_dict)
request = self.prepare_request(
- method='GET',
+ method='DELETE',
url=url,
headers=headers,
params=params,
@@ -18949,41 +20346,29 @@ def get_vpn_server_route(
response = self.send(request, **kwargs)
return response
- def update_vpn_server_route(
+ def get_vpn_server(
self,
- vpn_server_id: str,
id: str,
- vpn_server_route_patch: 'VPNServerRoutePatch',
**kwargs,
) -> DetailedResponse:
"""
- Update a VPN route.
+ Retrieve a VPN server.
- This request updates a VPN route with the information in a provided VPN route
- patch. The VPN route patch object is structured in the same way as a retrieved VPN
- route and contains only the information to be updated.
+ This request retrieves a single VPN server specified by the identifier in the URL.
- :param str vpn_server_id: The VPN server identifier.
- :param str id: The VPN route identifier.
- :param VPNServerRoutePatch vpn_server_route_patch: The VPN route patch.
+ :param str id: The VPN server identifier.
:param dict headers: A `dict` containing the request headers
:return: A `DetailedResponse` containing the result, headers and HTTP status code.
- :rtype: DetailedResponse with `dict` result representing a `VPNServerRoute` object
+ :rtype: DetailedResponse with `dict` result representing a `VPNServer` object
"""
- if not vpn_server_id:
- raise ValueError('vpn_server_id must be provided')
if not id:
raise ValueError('id must be provided')
- if vpn_server_route_patch is None:
- raise ValueError('vpn_server_route_patch must be provided')
- if isinstance(vpn_server_route_patch, VPNServerRoutePatch):
- vpn_server_route_patch = convert_model(vpn_server_route_patch)
headers = {}
sdk_headers = get_sdk_headers(
service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='update_vpn_server_route',
+ operation_id='get_vpn_server',
)
headers.update(sdk_headers)
@@ -18992,109 +20377,119 @@ def update_vpn_server_route(
'generation': self.generation,
}
- data = json.dumps(vpn_server_route_patch)
- headers['content-type'] = 'application/merge-patch+json'
-
if 'headers' in kwargs:
headers.update(kwargs.get('headers'))
del kwargs['headers']
headers['Accept'] = 'application/json'
- path_param_keys = ['vpn_server_id', 'id']
- path_param_values = self.encode_path_vars(vpn_server_id, id)
+ path_param_keys = ['id']
+ path_param_values = self.encode_path_vars(id)
path_param_dict = dict(zip(path_param_keys, path_param_values))
- url = '/vpn_servers/{vpn_server_id}/routes/{id}'.format(**path_param_dict)
+ url = '/vpn_servers/{id}'.format(**path_param_dict)
request = self.prepare_request(
- method='PATCH',
+ method='GET',
url=url,
headers=headers,
params=params,
- data=data,
)
response = self.send(request, **kwargs)
return response
- #########################
- # Load balancers
- #########################
-
- def list_load_balancer_profiles(
+ def update_vpn_server(
self,
+ id: str,
+ vpn_server_patch: 'VPNServerPatch',
*,
- start: str = None,
- limit: int = None,
+ if_match: Optional[str] = None,
**kwargs,
) -> DetailedResponse:
"""
- List all load balancer profiles.
+ Update a VPN server.
- This request lists all load balancer profiles available in the region. A load
- balancer profile specifies the performance characteristics and pricing model for a
- load balancer.
+ This request updates the properties of an existing VPN server. Any property
+ changes will cause all connected VPN clients are disconnected from this VPN server
+ except for the name change.
- :param str 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 id: The VPN server identifier.
+ :param VPNServerPatch vpn_server_patch: The VPN server patch.
+ :param str if_match: (optional) If present, the request will fail if the
+ specified ETag value does not match the resource's current ETag value.
+ Required if the request body includes an array.
:param dict headers: A `dict` containing the request headers
:return: A `DetailedResponse` containing the result, headers and HTTP status code.
- :rtype: DetailedResponse with `dict` result representing a `LoadBalancerProfileCollection` object
+ :rtype: DetailedResponse with `dict` result representing a `VPNServer` object
"""
- headers = {}
+ if not id:
+ raise ValueError('id must be provided')
+ if vpn_server_patch is None:
+ raise ValueError('vpn_server_patch must be provided')
+ if isinstance(vpn_server_patch, VPNServerPatch):
+ vpn_server_patch = convert_model(vpn_server_patch)
+ headers = {
+ 'If-Match': if_match,
+ }
sdk_headers = get_sdk_headers(
service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='list_load_balancer_profiles',
+ operation_id='update_vpn_server',
)
headers.update(sdk_headers)
params = {
'version': self.version,
'generation': self.generation,
- 'start': start,
- 'limit': limit,
}
+ data = json.dumps(vpn_server_patch)
+ headers['content-type'] = 'application/merge-patch+json'
+
if 'headers' in kwargs:
headers.update(kwargs.get('headers'))
del kwargs['headers']
headers['Accept'] = 'application/json'
- url = '/load_balancer/profiles'
+ path_param_keys = ['id']
+ path_param_values = self.encode_path_vars(id)
+ path_param_dict = dict(zip(path_param_keys, path_param_values))
+ url = '/vpn_servers/{id}'.format(**path_param_dict)
request = self.prepare_request(
- method='GET',
+ method='PATCH',
url=url,
headers=headers,
params=params,
+ data=data,
)
response = self.send(request, **kwargs)
return response
- def get_load_balancer_profile(
+ def get_vpn_server_client_configuration(
self,
- name: str,
+ id: str,
**kwargs,
) -> DetailedResponse:
"""
- Retrieve a load balancer profile.
+ Retrieve client configuration.
- This request retrieves a load balancer profile specified by the name in the URL.
+ This request retrieves OpenVPN client configuration on a single VPN server
+ specified by the identifier in the URL. This configuration includes directives
+ compatible with OpenVPN releases 2.4 and 2.5.
- :param str name: The load balancer profile name.
+ :param str id: The VPN server identifier.
:param dict headers: A `dict` containing the request headers
:return: A `DetailedResponse` containing the result, headers and HTTP status code.
- :rtype: DetailedResponse with `dict` result representing a `LoadBalancerProfile` object
+ :rtype: DetailedResponse with `str` result
"""
- if not name:
- raise ValueError('name must be provided')
+ if not id:
+ raise ValueError('id must be provided')
headers = {}
sdk_headers = get_sdk_headers(
service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='get_load_balancer_profile',
+ operation_id='get_vpn_server_client_configuration',
)
headers.update(sdk_headers)
@@ -19106,12 +20501,12 @@ def get_load_balancer_profile(
if 'headers' in kwargs:
headers.update(kwargs.get('headers'))
del kwargs['headers']
- headers['Accept'] = 'application/json'
+ headers['Accept'] = 'text/plain'
- 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 = '/vpn_servers/{id}/client_configuration'.format(**path_param_dict)
request = self.prepare_request(
method='GET',
url=url,
@@ -19122,31 +20517,41 @@ def get_load_balancer_profile(
response = self.send(request, **kwargs)
return response
- def list_load_balancers(
+ def list_vpn_server_clients(
self,
+ vpn_server_id: str,
*,
- start: str = None,
- limit: int = None,
+ start: Optional[str] = None,
+ limit: Optional[int] = None,
+ sort: Optional[str] = None,
**kwargs,
) -> DetailedResponse:
"""
- List all load balancers.
+ List all VPN clients for a VPN server.
- This request lists all load balancers in the region.
+ This request retrieves all connected VPN clients, and any disconnected VPN clients
+ that the VPN server has not yet deleted based on its auto-deletion policy.
+ :param str vpn_server_id: The VPN server identifier.
:param str start: (optional) A server-provided token determining what
resource to start the page on.
:param int limit: (optional) The number of resources to return on a page.
+ :param str sort: (optional) Sorts the returned collection by the specified
+ property name in ascending order. A `-` may be prepended to the name to
+ sort in descending order. For example, the value `-created_at` sorts the
+ collection by the `created_at` property in descending order.
:param dict headers: A `dict` containing the request headers
:return: A `DetailedResponse` containing the result, headers and HTTP status code.
- :rtype: DetailedResponse with `dict` result representing a `LoadBalancerCollection` object
+ :rtype: DetailedResponse with `dict` result representing a `VPNServerClientCollection` object
"""
+ if not vpn_server_id:
+ raise ValueError('vpn_server_id must be provided')
headers = {}
sdk_headers = get_sdk_headers(
service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='list_load_balancers',
+ operation_id='list_vpn_server_clients',
)
headers.update(sdk_headers)
@@ -19155,6 +20560,7 @@ def list_load_balancers(
'generation': self.generation,
'start': start,
'limit': limit,
+ 'sort': sort,
}
if 'headers' in kwargs:
@@ -19162,7 +20568,10 @@ def list_load_balancers(
del kwargs['headers']
headers['Accept'] = 'application/json'
- url = '/load_balancers'
+ path_param_keys = ['vpn_server_id']
+ path_param_values = self.encode_path_vars(vpn_server_id)
+ path_param_dict = dict(zip(path_param_keys, path_param_values))
+ url = '/vpn_servers/{vpn_server_id}/clients'.format(**path_param_dict)
request = self.prepare_request(
method='GET',
url=url,
@@ -19173,105 +20582,35 @@ def list_load_balancers(
response = self.send(request, **kwargs)
return response
- def create_load_balancer(
+ def delete_vpn_server_client(
self,
- is_public: bool,
- subnets: List['SubnetIdentity'],
- *,
- datapath: 'LoadBalancerLoggingDatapathPrototype' = None,
- dns: 'LoadBalancerDNSPrototype' = None,
- listeners: List['LoadBalancerListenerPrototypeLoadBalancerContext'] = None,
- logging: 'LoadBalancerLoggingPrototype' = None,
- name: str = None,
- pools: List['LoadBalancerPoolPrototype'] = None,
- profile: 'LoadBalancerProfileIdentity' = None,
- resource_group: 'ResourceGroupIdentity' = None,
- route_mode: bool = None,
- security_groups: List['SecurityGroupIdentity'] = None,
+ vpn_server_id: str,
+ id: str,
**kwargs,
) -> DetailedResponse:
"""
- Create a load balancer.
+ Delete a VPN client.
- This request creates and provisions a new load balancer.
+ This request disconnects and deletes the VPN client from the VPN server. The VPN
+ client may reconnect unless its authentication permissions for the configured
+ authentication methods (such as its client certificate) have been revoked.
- :param bool is_public: Indicates whether this load balancer is public.
- At present, if route mode is enabled, the load balancer must not be public.
- :param List[SubnetIdentity] subnets: The subnets to provision this load
- balancer in. The subnets must be in the same VPC. The load balancer's
- availability will depend on the availability of the zones that the subnets
- reside in.
- Load balancers in the `network` family allow only one subnet to be
- specified.
- :param LoadBalancerLoggingDatapathPrototype datapath: (optional) The
- datapath logging configuration for this load balancer.
- :param LoadBalancerDNSPrototype dns: (optional) The DNS configuration for
- this load balancer.
- If unspecified, DNS `A` records for this load balancer's `hostname`
- property will be added
- to the public DNS zone `lb.appdomain.cloud`. Otherwise, those DNS `A`
- records will be
- added to the specified `zone`.
- :param List[LoadBalancerListenerPrototypeLoadBalancerContext] listeners:
- (optional) The listeners of this load balancer.
- :param LoadBalancerLoggingPrototype logging: (optional) The logging
- configuration to use for this load balancer. See [VPC Datapath
- Logging](https://cloud.ibm.com/docs/vpc?topic=vpc-datapath-logging) on the
- logging
- format, fields and permitted values.
- To activate logging, the load balancer profile must support the specified
- logging type.
- :param str name: (optional) The name for this load balancer. The name must
- not be used by another load balancer in the VPC. If unspecified, the name
- will be a hyphenated list of randomly-selected words.
- :param List[LoadBalancerPoolPrototype] pools: (optional) The pools of this
- load balancer.
- :param LoadBalancerProfileIdentity profile: (optional) The profile to use
- for this load balancer.
- If unspecified, `application` will be used.
- :param ResourceGroupIdentity resource_group: (optional) The resource group
- to use. If unspecified, the account's [default resource
- group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be
- used.
- :param bool route_mode: (optional) Indicates whether route mode is enabled
- for this load balancer.
- At present, public load balancers are not supported with route mode
- enabled.
- :param List[SecurityGroupIdentity] security_groups: (optional) The security
- groups to use for this load balancer. If unspecified, the VPC's default
- security group is used.
- The load balancer profile must support security groups.
+ :param str vpn_server_id: The VPN server identifier.
+ :param str id: The VPN client identifier.
:param dict headers: A `dict` containing the request headers
:return: A `DetailedResponse` containing the result, headers and HTTP status code.
- :rtype: DetailedResponse with `dict` result representing a `LoadBalancer` object
+ :rtype: DetailedResponse
"""
- if is_public is None:
- raise ValueError('is_public must be provided')
- if subnets is None:
- raise ValueError('subnets must be provided')
- subnets = [convert_model(x) for x in subnets]
- if datapath is not None:
- datapath = convert_model(datapath)
- if dns is not None:
- dns = convert_model(dns)
- if listeners is not None:
- listeners = [convert_model(x) for x in listeners]
- if logging is not None:
- logging = convert_model(logging)
- if pools is not None:
- pools = [convert_model(x) for x in pools]
- if profile is not None:
- profile = convert_model(profile)
- if resource_group is not None:
- resource_group = convert_model(resource_group)
- if security_groups is not None:
- security_groups = [convert_model(x) for x in security_groups]
+ if not vpn_server_id:
+ raise ValueError('vpn_server_id must be provided')
+ if not id:
+ raise ValueError('id must be provided')
headers = {}
sdk_headers = get_sdk_headers(
service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='create_load_balancer',
+ operation_id='delete_vpn_server_client',
)
headers.update(sdk_headers)
@@ -19280,71 +20619,51 @@ def create_load_balancer(
'generation': self.generation,
}
- data = {
- 'is_public': is_public,
- 'subnets': subnets,
- 'datapath': datapath,
- 'dns': dns,
- 'listeners': listeners,
- 'logging': logging,
- 'name': name,
- 'pools': pools,
- 'profile': profile,
- 'resource_group': resource_group,
- 'route_mode': route_mode,
- 'security_groups': security_groups,
- }
- data = {k: v for (k, v) in data.items() if v is not None}
- data = json.dumps(data)
- headers['content-type'] = 'application/json'
-
if 'headers' in kwargs:
headers.update(kwargs.get('headers'))
del kwargs['headers']
- headers['Accept'] = 'application/json'
- url = '/load_balancers'
+ path_param_keys = ['vpn_server_id', 'id']
+ path_param_values = self.encode_path_vars(vpn_server_id, id)
+ path_param_dict = dict(zip(path_param_keys, path_param_values))
+ url = '/vpn_servers/{vpn_server_id}/clients/{id}'.format(**path_param_dict)
request = self.prepare_request(
- method='POST',
+ method='DELETE',
url=url,
headers=headers,
params=params,
- data=data,
)
response = self.send(request, **kwargs)
return response
- def delete_load_balancer(
+ def get_vpn_server_client(
self,
+ vpn_server_id: str,
id: str,
- *,
- if_match: str = None,
**kwargs,
) -> DetailedResponse:
"""
- Delete a load balancer.
+ Retrieve a VPN client.
- This request deletes a load balancer. This operation cannot be reversed. A load
- balancer cannot be deleted if its `provisioning_status` is `delete_pending`.
+ This request retrieves a single VPN client specified by the identifier in the URL.
- :param str id: The load balancer identifier.
- :param str if_match: (optional) If present, the request will fail if the
- specified ETag value does not match the resource's current ETag value.
+ :param str vpn_server_id: The VPN server identifier.
+ :param str id: The VPN client identifier.
:param dict headers: A `dict` containing the request headers
:return: A `DetailedResponse` containing the result, headers and HTTP status code.
- :rtype: DetailedResponse
+ :rtype: DetailedResponse with `dict` result representing a `VPNServerClient` object
"""
+ if not vpn_server_id:
+ raise ValueError('vpn_server_id must be provided')
if not id:
raise ValueError('id must be provided')
- headers = {
- 'If-Match': if_match,
- }
+ headers = {}
sdk_headers = get_sdk_headers(
service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='delete_load_balancer',
+ operation_id='get_vpn_server_client',
)
headers.update(sdk_headers)
@@ -19356,13 +20675,14 @@ def delete_load_balancer(
if 'headers' in kwargs:
headers.update(kwargs.get('headers'))
del kwargs['headers']
+ headers['Accept'] = 'application/json'
- path_param_keys = ['id']
- path_param_values = self.encode_path_vars(id)
+ path_param_keys = ['vpn_server_id', 'id']
+ path_param_values = self.encode_path_vars(vpn_server_id, id)
path_param_dict = dict(zip(path_param_keys, path_param_values))
- url = '/load_balancers/{id}'.format(**path_param_dict)
+ url = '/vpn_servers/{vpn_server_id}/clients/{id}'.format(**path_param_dict)
request = self.prepare_request(
- method='DELETE',
+ method='GET',
url=url,
headers=headers,
params=params,
@@ -19371,30 +20691,36 @@ def delete_load_balancer(
response = self.send(request, **kwargs)
return response
- def get_load_balancer(
+ def disconnect_vpn_client(
self,
+ vpn_server_id: str,
id: str,
**kwargs,
) -> DetailedResponse:
"""
- Retrieve a load balancer.
+ Disconnect a VPN client.
- This request retrieves a single load balancer specified by the identifier in the
- URL path.
+ This request disconnects the specified VPN client, and deletes the client
+ according to the VPN server's auto-deletion policy. The VPN client may reconnect
+ unless its authentication permissions for the configured authentication methods
+ (such as its client certificate) have been revoked.
- :param str id: The load balancer identifier.
+ :param str vpn_server_id: The VPN server identifier.
+ :param str id: The VPN client identifier.
:param dict headers: A `dict` containing the request headers
:return: A `DetailedResponse` containing the result, headers and HTTP status code.
- :rtype: DetailedResponse with `dict` result representing a `LoadBalancer` object
+ :rtype: DetailedResponse
"""
+ if not vpn_server_id:
+ raise ValueError('vpn_server_id must be provided')
if not id:
raise ValueError('id must be provided')
headers = {}
sdk_headers = get_sdk_headers(
service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='get_load_balancer',
+ operation_id='disconnect_vpn_client',
)
headers.update(sdk_headers)
@@ -19406,14 +20732,13 @@ def get_load_balancer(
if 'headers' in kwargs:
headers.update(kwargs.get('headers'))
del kwargs['headers']
- headers['Accept'] = 'application/json'
- path_param_keys = ['id']
- path_param_values = self.encode_path_vars(id)
+ path_param_keys = ['vpn_server_id', 'id']
+ path_param_values = self.encode_path_vars(vpn_server_id, id)
path_param_dict = dict(zip(path_param_keys, path_param_values))
- url = '/load_balancers/{id}'.format(**path_param_dict)
+ url = '/vpn_servers/{vpn_server_id}/clients/{id}/disconnect'.format(**path_param_dict)
request = self.prepare_request(
- method='GET',
+ method='POST',
url=url,
headers=headers,
params=params,
@@ -19422,99 +20747,123 @@ def get_load_balancer(
response = self.send(request, **kwargs)
return response
- def update_load_balancer(
+ def list_vpn_server_routes(
self,
- id: str,
- load_balancer_patch: 'LoadBalancerPatch',
+ vpn_server_id: str,
*,
- if_match: str = None,
+ start: Optional[str] = None,
+ limit: Optional[int] = None,
+ sort: Optional[str] = None,
**kwargs,
) -> DetailedResponse:
"""
- Update a load balancer.
+ List all VPN routes for a VPN server.
- This request updates a load balancer with the information in a provided load
- balancer patch. The load balancer patch object is structured in the same way as a
- retrieved load balancer and contains only the information to be updated. A load
- balancer can only be updated if its `provisioning_status` is `active`.
+ This request lists all VPN routes in a VPN server. All VPN routes are provided to
+ the VPN client when the connection is established. Packets received from the VPN
+ client will be dropped by the VPN server if there is no VPN route matching their
+ specified destinations. All VPN routes must be unique within the VPN server.
- :param str id: The load balancer identifier.
- :param LoadBalancerPatch load_balancer_patch: The load balancer patch.
- :param str if_match: (optional) If present, the request will fail if the
- specified ETag value does not match the resource's current ETag value.
- Required if the request body includes an array.
+ :param str vpn_server_id: The VPN server identifier.
+ :param str start: (optional) A server-provided token determining what
+ resource to start the page on.
+ :param int limit: (optional) The number of resources to return on a page.
+ :param str sort: (optional) Sorts the returned collection by the specified
+ property name in ascending order. A `-` may be prepended to the name to
+ sort in descending order. For example, the value `-created_at` sorts the
+ collection by the `created_at` property in descending order, and the value
+ `name` sorts it by the `name` property in ascending order.
:param dict headers: A `dict` containing the request headers
:return: A `DetailedResponse` containing the result, headers and HTTP status code.
- :rtype: DetailedResponse with `dict` result representing a `LoadBalancer` object
+ :rtype: DetailedResponse with `dict` result representing a `VPNServerRouteCollection` object
"""
- if not id:
- raise ValueError('id must be provided')
- if load_balancer_patch is None:
- raise ValueError('load_balancer_patch must be provided')
- if isinstance(load_balancer_patch, LoadBalancerPatch):
- load_balancer_patch = convert_model(load_balancer_patch)
- headers = {
- 'If-Match': if_match,
- }
+ if not vpn_server_id:
+ raise ValueError('vpn_server_id must be provided')
+ headers = {}
sdk_headers = get_sdk_headers(
service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='update_load_balancer',
+ operation_id='list_vpn_server_routes',
)
headers.update(sdk_headers)
params = {
'version': self.version,
'generation': self.generation,
+ 'start': start,
+ 'limit': limit,
+ 'sort': sort,
}
- data = json.dumps(load_balancer_patch)
- headers['content-type'] = 'application/merge-patch+json'
-
if 'headers' in kwargs:
headers.update(kwargs.get('headers'))
del kwargs['headers']
headers['Accept'] = 'application/json'
- path_param_keys = ['id']
- path_param_values = self.encode_path_vars(id)
+ path_param_keys = ['vpn_server_id']
+ path_param_values = self.encode_path_vars(vpn_server_id)
path_param_dict = dict(zip(path_param_keys, path_param_values))
- url = '/load_balancers/{id}'.format(**path_param_dict)
+ url = '/vpn_servers/{vpn_server_id}/routes'.format(**path_param_dict)
request = self.prepare_request(
- method='PATCH',
+ method='GET',
url=url,
headers=headers,
params=params,
- data=data,
)
response = self.send(request, **kwargs)
return response
- def get_load_balancer_statistics(
+ def create_vpn_server_route(
self,
- id: str,
+ vpn_server_id: str,
+ destination: str,
+ *,
+ action: Optional[str] = None,
+ name: Optional[str] = None,
**kwargs,
) -> DetailedResponse:
"""
- List all statistics of a load balancer.
+ Create a VPN route for a VPN server.
- This request lists statistics of a load balancer.
+ This request creates a new VPN route in the VPN server. All VPN routes are
+ provided to the VPN client when the connection is established. Packets received
+ from the VPN client will be dropped by the VPN server if there is no VPN route
+ matching their specified destinations. All VPN routes must be unique within the
+ VPN server. destination of the packet.
- :param str id: The load balancer identifier.
+ :param str vpn_server_id: The VPN server identifier.
+ :param str destination: The destination to use for this VPN route in the
+ VPN server. Must be unique within the VPN server. If an incoming packet
+ does not match any destination, it will be dropped.
+ :param str action: (optional) The action to perform with a packet matching
+ the VPN route:
+ - `translate`: translate the source IP address to one of the private IP
+ addresses of the VPN server, then deliver the packet to target.
+ - `deliver`: deliver the packet to the target.
+ - `drop`: drop the packet
+ The enumerated values for this property are expected to expand in the
+ future. When processing this property, check for and log unknown values.
+ Optionally halt processing and surface the error, or bypass the VPN route
+ on which the unexpected property value was encountered.
+ :param str name: (optional) The name for this VPN server route. The name
+ must not be used by another route for the VPN server. If unspecified, the
+ name will be a hyphenated list of randomly-selected words.
:param dict headers: A `dict` containing the request headers
:return: A `DetailedResponse` containing the result, headers and HTTP status code.
- :rtype: DetailedResponse with `dict` result representing a `LoadBalancerStatistics` object
+ :rtype: DetailedResponse with `dict` result representing a `VPNServerRoute` object
"""
- if not id:
- raise ValueError('id must be provided')
+ if not vpn_server_id:
+ raise ValueError('vpn_server_id must be provided')
+ if destination is None:
+ raise ValueError('destination must be provided')
headers = {}
sdk_headers = get_sdk_headers(
service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='get_load_balancer_statistics',
+ operation_id='create_vpn_server_route',
)
headers.update(sdk_headers)
@@ -19523,48 +20872,62 @@ def get_load_balancer_statistics(
'generation': self.generation,
}
+ data = {
+ 'destination': destination,
+ 'action': action,
+ 'name': name,
+ }
+ data = {k: v for (k, v) in data.items() if v is not None}
+ data = json.dumps(data)
+ headers['content-type'] = 'application/json'
+
if 'headers' in kwargs:
headers.update(kwargs.get('headers'))
del kwargs['headers']
headers['Accept'] = 'application/json'
- path_param_keys = ['id']
- path_param_values = self.encode_path_vars(id)
+ path_param_keys = ['vpn_server_id']
+ path_param_values = self.encode_path_vars(vpn_server_id)
path_param_dict = dict(zip(path_param_keys, path_param_values))
- url = '/load_balancers/{id}/statistics'.format(**path_param_dict)
+ url = '/vpn_servers/{vpn_server_id}/routes'.format(**path_param_dict)
request = self.prepare_request(
- method='GET',
+ method='POST',
url=url,
headers=headers,
params=params,
+ data=data,
)
response = self.send(request, **kwargs)
return response
- def list_load_balancer_listeners(
+ def delete_vpn_server_route(
self,
- load_balancer_id: str,
+ vpn_server_id: str,
+ id: str,
**kwargs,
) -> DetailedResponse:
"""
- List all listeners for a load balancer.
+ Delete a VPN route.
- This request lists all listeners for a load balancer.
+ This request deletes a VPN route. This operation cannot be reversed.
- :param str load_balancer_id: The load balancer identifier.
+ :param str vpn_server_id: The VPN server identifier.
+ :param str id: The VPN route identifier.
:param dict headers: A `dict` containing the request headers
:return: A `DetailedResponse` containing the result, headers and HTTP status code.
- :rtype: DetailedResponse with `dict` result representing a `LoadBalancerListenerCollection` object
+ :rtype: DetailedResponse
"""
- if not load_balancer_id:
- raise ValueError('load_balancer_id must be provided')
+ if not vpn_server_id:
+ raise ValueError('vpn_server_id must be provided')
+ if not id:
+ raise ValueError('id must be provided')
headers = {}
sdk_headers = get_sdk_headers(
service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='list_load_balancer_listeners',
+ operation_id='delete_vpn_server_route',
)
headers.update(sdk_headers)
@@ -19576,14 +20939,13 @@ def list_load_balancer_listeners(
if 'headers' in kwargs:
headers.update(kwargs.get('headers'))
del kwargs['headers']
- headers['Accept'] = 'application/json'
- path_param_keys = ['load_balancer_id']
- path_param_values = self.encode_path_vars(load_balancer_id)
+ path_param_keys = ['vpn_server_id', 'id']
+ path_param_values = self.encode_path_vars(vpn_server_id, id)
path_param_dict = dict(zip(path_param_keys, path_param_values))
- url = '/load_balancers/{load_balancer_id}/listeners'.format(**path_param_dict)
+ url = '/vpn_servers/{vpn_server_id}/routes/{id}'.format(**path_param_dict)
request = self.prepare_request(
- method='GET',
+ method='DELETE',
url=url,
headers=headers,
params=params,
@@ -19592,122 +20954,33 @@ def list_load_balancer_listeners(
response = self.send(request, **kwargs)
return response
- def create_load_balancer_listener(
+ def get_vpn_server_route(
self,
- load_balancer_id: str,
- protocol: str,
- *,
- accept_proxy_protocol: bool = None,
- certificate_instance: 'CertificateInstanceIdentity' = None,
- connection_limit: int = None,
- default_pool: 'LoadBalancerPoolIdentity' = None,
- https_redirect: 'LoadBalancerListenerHTTPSRedirectPrototype' = None,
- idle_connection_timeout: int = None,
- policies: List['LoadBalancerListenerPolicyPrototype'] = None,
- port: int = None,
- port_max: int = None,
- port_min: int = None,
+ vpn_server_id: str,
+ id: str,
**kwargs,
) -> DetailedResponse:
"""
- Create a listener for a load balancer.
+ Retrieve a VPN route.
- This request creates a new listener for a load balancer.
+ This request retrieves a single VPN route specified by the identifier in the URL.
- :param str load_balancer_id: The load balancer identifier.
- :param str protocol: The listener protocol. Each listener in the load
- balancer must have a unique `port` and `protocol` combination.
- Load balancers in the `network` family support `tcp` and `udp` (if
- `udp_supported` is `true`). Load balancers in the `application` family
- support `tcp`, `http` and
- `https`.
- Additional restrictions:
- - If `default_pool` is set, the pool's protocol must match, or be
- compatible with
- the listener's protocol. At present, the compatible protocols are `http`
- and
- `https`.
- - If `https_redirect` is set, the protocol must be `http`.
- :param bool accept_proxy_protocol: (optional) If set to `true`, this
- listener will accept and forward PROXY protocol information. Supported by
- load balancers in the `application` family (otherwise always `false`).
- Additional restrictions:
- - If this listener has `https_redirect` specified, its
- `accept_proxy_protocol` value must
- match the `accept_proxy_protocol` value of the `https_redirect` listener.
- - If this listener is the target of another listener's `https_redirect`,
- its
- `accept_proxy_protocol` value must match that listener's
- `accept_proxy_protocol` value.
- :param CertificateInstanceIdentity certificate_instance: (optional) The
- certificate instance to use for SSL termination. The listener must have a
- `protocol` of `https`.
- :param int connection_limit: (optional) The connection limit of the
- listener.
- :param LoadBalancerPoolIdentity default_pool: (optional) The default pool
- for this listener. If specified, the pool must:
- - Belong to this load balancer.
- - Have the same `protocol` as this listener, or have a compatible protocol.
- At present, the compatible protocols are `http` and `https`.
- - Not already be the `default_pool` for another listener.
- If unspecified, this listener will be created with no default pool, but one
- may be
- subsequently set.
- :param LoadBalancerListenerHTTPSRedirectPrototype https_redirect:
- (optional) The target listener that requests will be redirected to. This
- listener must have a
- `protocol` of `http`, and the target listener must have a `protocol` of
- `https`.
- :param int idle_connection_timeout: (optional) The idle connection timeout
- of the listener in seconds. Supported for load balancers in the
- `application` family.
- :param List[LoadBalancerListenerPolicyPrototype] policies: (optional) The
- policy prototype objects for this listener. The load balancer must be in
- the
- `application` family.
- :param int port: (optional) The listener port number, or the inclusive
- lower bound of the port range. Each listener in the load balancer must have
- a unique `port` and `protocol` combination.
- Not supported for load balancers operating with route mode enabled.
- :param int port_max: (optional) The inclusive upper bound of the range of
- ports used by this listener. Must not be less than `port_min`.
- At present, only load balancers operating with route mode enabled, and
- public load balancers in the `network` family support different values for
- `port_min` and
- `port_max`. When route mode is enabled, the value `65535` must be
- specified.
- The specified port range must not overlap with port ranges used by other
- listeners for this load balancer using the same protocol.
- :param int port_min: (optional) The inclusive lower bound of the range of
- ports used by this listener. Must not be greater than `port_max`.
- At present, only load balancers operating with route mode enabled, and
- public load balancers in the `network` family support different values for
- `port_min` and
- `port_max`. When route mode is enabled, the value `1` must be specified.
- The specified port range must not overlap with port ranges used by other
- listeners for this load balancer using the same protocol.
+ :param str vpn_server_id: The VPN server identifier.
+ :param str id: The VPN route identifier.
:param dict headers: A `dict` containing the request headers
:return: A `DetailedResponse` containing the result, headers and HTTP status code.
- :rtype: DetailedResponse with `dict` result representing a `LoadBalancerListener` object
+ :rtype: DetailedResponse with `dict` result representing a `VPNServerRoute` object
"""
- if not load_balancer_id:
- raise ValueError('load_balancer_id must be provided')
- if protocol is None:
- raise ValueError('protocol must be provided')
- if certificate_instance is not None:
- certificate_instance = convert_model(certificate_instance)
- if default_pool is not None:
- default_pool = convert_model(default_pool)
- if https_redirect is not None:
- https_redirect = convert_model(https_redirect)
- if policies is not None:
- policies = [convert_model(x) for x in policies]
+ if not vpn_server_id:
+ raise ValueError('vpn_server_id must be provided')
+ if not id:
+ raise ValueError('id must be provided')
headers = {}
sdk_headers = get_sdk_headers(
service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='create_load_balancer_listener',
+ operation_id='get_vpn_server_route',
)
headers.update(sdk_headers)
@@ -19716,72 +20989,60 @@ def create_load_balancer_listener(
'generation': self.generation,
}
- data = {
- 'protocol': protocol,
- 'accept_proxy_protocol': accept_proxy_protocol,
- 'certificate_instance': certificate_instance,
- 'connection_limit': connection_limit,
- 'default_pool': default_pool,
- 'https_redirect': https_redirect,
- 'idle_connection_timeout': idle_connection_timeout,
- 'policies': policies,
- 'port': port,
- 'port_max': port_max,
- 'port_min': port_min,
- }
- data = {k: v for (k, v) in data.items() if v is not None}
- data = json.dumps(data)
- headers['content-type'] = 'application/json'
-
if 'headers' in kwargs:
headers.update(kwargs.get('headers'))
del kwargs['headers']
headers['Accept'] = 'application/json'
- path_param_keys = ['load_balancer_id']
- path_param_values = self.encode_path_vars(load_balancer_id)
+ path_param_keys = ['vpn_server_id', 'id']
+ path_param_values = self.encode_path_vars(vpn_server_id, id)
path_param_dict = dict(zip(path_param_keys, path_param_values))
- url = '/load_balancers/{load_balancer_id}/listeners'.format(**path_param_dict)
+ url = '/vpn_servers/{vpn_server_id}/routes/{id}'.format(**path_param_dict)
request = self.prepare_request(
- method='POST',
+ method='GET',
url=url,
headers=headers,
params=params,
- data=data,
)
response = self.send(request, **kwargs)
return response
- def delete_load_balancer_listener(
+ def update_vpn_server_route(
self,
- load_balancer_id: str,
+ vpn_server_id: str,
id: str,
+ vpn_server_route_patch: 'VPNServerRoutePatch',
**kwargs,
) -> DetailedResponse:
"""
- Delete a load balancer listener.
+ Update a VPN route.
- This request deletes a load balancer listener. This operation cannot be reversed.
- For this operation to succeed, the listener must not be the target of another load
- balancer listener.
+ This request updates a VPN route with the information in a provided VPN route
+ patch. The VPN route patch object is structured in the same way as a retrieved VPN
+ route and contains only the information to be updated.
- :param str load_balancer_id: The load balancer identifier.
- :param str id: The listener identifier.
+ :param str vpn_server_id: The VPN server identifier.
+ :param str id: The VPN route identifier.
+ :param VPNServerRoutePatch vpn_server_route_patch: The VPN route patch.
:param dict headers: A `dict` containing the request headers
:return: A `DetailedResponse` containing the result, headers and HTTP status code.
- :rtype: DetailedResponse
+ :rtype: DetailedResponse with `dict` result representing a `VPNServerRoute` object
"""
- if not load_balancer_id:
- raise ValueError('load_balancer_id must be provided')
+ if not vpn_server_id:
+ raise ValueError('vpn_server_id must be provided')
if not id:
raise ValueError('id must be provided')
+ if vpn_server_route_patch is None:
+ raise ValueError('vpn_server_route_patch must be provided')
+ if isinstance(vpn_server_route_patch, VPNServerRoutePatch):
+ vpn_server_route_patch = convert_model(vpn_server_route_patch)
headers = {}
sdk_headers = get_sdk_headers(
service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='delete_load_balancer_listener',
+ operation_id='update_vpn_server_route',
)
headers.update(sdk_headers)
@@ -19790,58 +21051,68 @@ def delete_load_balancer_listener(
'generation': self.generation,
}
+ data = json.dumps(vpn_server_route_patch)
+ headers['content-type'] = 'application/merge-patch+json'
+
if 'headers' in kwargs:
headers.update(kwargs.get('headers'))
del kwargs['headers']
+ headers['Accept'] = 'application/json'
- path_param_keys = ['load_balancer_id', 'id']
- path_param_values = self.encode_path_vars(load_balancer_id, id)
+ path_param_keys = ['vpn_server_id', 'id']
+ path_param_values = self.encode_path_vars(vpn_server_id, id)
path_param_dict = dict(zip(path_param_keys, path_param_values))
- url = '/load_balancers/{load_balancer_id}/listeners/{id}'.format(**path_param_dict)
+ url = '/vpn_servers/{vpn_server_id}/routes/{id}'.format(**path_param_dict)
request = self.prepare_request(
- method='DELETE',
+ method='PATCH',
url=url,
headers=headers,
params=params,
+ data=data,
)
response = self.send(request, **kwargs)
return response
- def get_load_balancer_listener(
+ #########################
+ # Load balancers
+ #########################
+
+ def list_load_balancer_profiles(
self,
- load_balancer_id: str,
- id: str,
+ *,
+ start: Optional[str] = None,
+ limit: Optional[int] = None,
**kwargs,
) -> DetailedResponse:
"""
- Retrieve a load balancer listener.
+ List all load balancer profiles.
- This request retrieves a single listener 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 listener 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 `LoadBalancerListener` object
+ :rtype: DetailedResponse with `dict` result representing a `LoadBalancerProfileCollection` object
"""
- if not load_balancer_id:
- raise ValueError('load_balancer_id must be provided')
- if not id:
- raise ValueError('id must be provided')
headers = {}
sdk_headers = get_sdk_headers(
service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='get_load_balancer_listener',
+ operation_id='list_load_balancer_profiles',
)
headers.update(sdk_headers)
params = {
'version': self.version,
'generation': self.generation,
+ 'start': start,
+ 'limit': limit,
}
if 'headers' in kwargs:
@@ -19849,10 +21120,7 @@ def get_load_balancer_listener(
del kwargs['headers']
headers['Accept'] = 'application/json'
- path_param_keys = ['load_balancer_id', 'id']
- path_param_values = self.encode_path_vars(load_balancer_id, id)
- path_param_dict = dict(zip(path_param_keys, path_param_values))
- url = '/load_balancers/{load_balancer_id}/listeners/{id}'.format(**path_param_dict)
+ url = '/load_balancer/profiles'
request = self.prepare_request(
method='GET',
url=url,
@@ -19863,40 +21131,29 @@ def get_load_balancer_listener(
response = self.send(request, **kwargs)
return response
- def update_load_balancer_listener(
+ def get_load_balancer_profile(
self,
- load_balancer_id: str,
- id: str,
- load_balancer_listener_patch: 'LoadBalancerListenerPatch',
+ name: str,
**kwargs,
) -> DetailedResponse:
"""
- Update a load balancer listener.
+ Retrieve a load balancer profile.
- This request updates a load balancer listener from a listener 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 listener identifier.
- :param LoadBalancerListenerPatch load_balancer_listener_patch: The load
- balancer listener 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 `LoadBalancerListener` object
+ :rtype: DetailedResponse with `dict` result representing a `LoadBalancerProfile` object
"""
- if not load_balancer_id:
- raise ValueError('load_balancer_id must be provided')
- if not id:
- raise ValueError('id must be provided')
- if load_balancer_listener_patch is None:
- raise ValueError('load_balancer_listener_patch must be provided')
- if isinstance(load_balancer_listener_patch, LoadBalancerListenerPatch):
- load_balancer_listener_patch = convert_model(load_balancer_listener_patch)
+ if not name:
+ raise ValueError('name must be provided')
headers = {}
sdk_headers = get_sdk_headers(
service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='update_load_balancer_listener',
+ operation_id='get_load_balancer_profile',
)
headers.update(sdk_headers)
@@ -19905,62 +21162,58 @@ def update_load_balancer_listener(
'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'))
del kwargs['headers']
headers['Accept'] = 'application/json'
- path_param_keys = ['load_balancer_id', 'id']
- path_param_values = self.encode_path_vars(load_balancer_id, id)
+ path_param_keys = ['name']
+ path_param_values = self.encode_path_vars(name)
path_param_dict = dict(zip(path_param_keys, path_param_values))
- url = '/load_balancers/{load_balancer_id}/listeners/{id}'.format(**path_param_dict)
+ url = '/load_balancer/profiles/{name}'.format(**path_param_dict)
request = self.prepare_request(
- method='PATCH',
+ method='GET',
url=url,
headers=headers,
params=params,
- data=data,
)
response = self.send(request, **kwargs)
return response
- def list_load_balancer_listener_policies(
+ def list_load_balancers(
self,
- load_balancer_id: str,
- listener_id: str,
+ *,
+ start: Optional[str] = None,
+ limit: Optional[int] = None,
**kwargs,
) -> DetailedResponse:
"""
- List all policies for a load balancer listener.
+ List all load balancers.
- This request lists all policies for a load balancer listener.
+ This request lists all load balancers in the region.
- :param str load_balancer_id: The load balancer identifier.
- :param str listener_id: The listener 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 `LoadBalancerListenerPolicyCollection` object
+ :rtype: DetailedResponse with `dict` result representing a `LoadBalancerCollection` object
"""
- if not load_balancer_id:
- raise ValueError('load_balancer_id must be provided')
- if not listener_id:
- raise ValueError('listener_id must be provided')
headers = {}
sdk_headers = get_sdk_headers(
service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='list_load_balancer_listener_policies',
+ operation_id='list_load_balancers',
)
headers.update(sdk_headers)
params = {
'version': self.version,
'generation': self.generation,
+ 'start': start,
+ 'limit': limit,
}
if 'headers' in kwargs:
@@ -19968,10 +21221,7 @@ def list_load_balancer_listener_policies(
del kwargs['headers']
headers['Accept'] = 'application/json'
- path_param_keys = ['load_balancer_id', 'listener_id']
- path_param_values = self.encode_path_vars(load_balancer_id, listener_id)
- path_param_dict = dict(zip(path_param_keys, path_param_values))
- url = '/load_balancers/{load_balancer_id}/listeners/{listener_id}/policies'.format(**path_param_dict)
+ url = '/load_balancers'
request = self.prepare_request(
method='GET',
url=url,
@@ -19982,65 +21232,101 @@ def list_load_balancer_listener_policies(
response = self.send(request, **kwargs)
return response
- def create_load_balancer_listener_policy(
+ def create_load_balancer(
self,
- load_balancer_id: str,
- listener_id: str,
- action: str,
- priority: int,
+ is_public: bool,
+ subnets: List['SubnetIdentity'],
*,
- name: str = None,
- rules: List['LoadBalancerListenerPolicyRulePrototype'] = None,
- target: 'LoadBalancerListenerPolicyTargetPrototype' = None,
+ dns: Optional['LoadBalancerDNSPrototype'] = None,
+ listeners: Optional[List['LoadBalancerListenerPrototypeLoadBalancerContext']] = None,
+ logging: Optional['LoadBalancerLoggingPrototype'] = None,
+ name: Optional[str] = None,
+ pools: Optional[List['LoadBalancerPoolPrototype']] = None,
+ profile: Optional['LoadBalancerProfileIdentity'] = None,
+ resource_group: Optional['ResourceGroupIdentity'] = None,
+ route_mode: Optional[bool] = None,
+ security_groups: Optional[List['SecurityGroupIdentity']] = None,
**kwargs,
) -> DetailedResponse:
"""
- Create a policy for a load balancer listener.
+ Create a load balancer.
- Creates a new policy for a load balancer listener.
+ This request creates and provisions a new load balancer.
- :param str load_balancer_id: The load balancer identifier.
- :param str listener_id: The listener identifier.
- :param str action: The policy action.
- The enumerated values for this property are expected to expand in the
- future. When processing this property, check for and log unknown values.
- Optionally halt processing and surface the error, or bypass the policy on
- which the unexpected property value was encountered.
- :param int priority: Priority of the policy. Lower value indicates higher
- priority.
- :param str name: (optional) The name for this policy. The name must not be
- used by another policy for the load balancer listener. If unspecified, the
- name will be a hyphenated list of randomly-selected words.
- :param List[LoadBalancerListenerPolicyRulePrototype] rules: (optional) The
- rule prototype objects for this policy.
- :param LoadBalancerListenerPolicyTargetPrototype target: (optional) - If
- `action` is `forward`, specify a `LoadBalancerPoolIdentity`.
- - If `action` is `redirect`, specify a
- `LoadBalancerListenerPolicyRedirectURLPrototype`.
- - If `action` is `https_redirect`, specify a
- `LoadBalancerListenerPolicyHTTPSRedirectPrototype`.
+ :param bool is_public: Indicates whether this load balancer is public.
+ At present, if route mode is enabled, the load balancer must not be public.
+ :param List[SubnetIdentity] subnets: The subnets to provision this load
+ balancer in. The subnets must be in the same VPC. The load balancer's
+ availability will depend on the availability of the zones that the subnets
+ reside in.
+ Load balancers in the `network` family allow only one subnet to be
+ specified.
+ :param LoadBalancerDNSPrototype dns: (optional) The DNS configuration for
+ this load balancer.
+ If unspecified, DNS `A` records for this load balancer's `hostname`
+ property will be added
+ to the public DNS zone `lb.appdomain.cloud`. Otherwise, those DNS `A`
+ records will be
+ added to the specified `zone`.
+ :param List[LoadBalancerListenerPrototypeLoadBalancerContext] listeners:
+ (optional) The listeners of this load balancer.
+ :param LoadBalancerLoggingPrototype logging: (optional) The logging
+ configuration to use for this load balancer. See [VPC Datapath
+ Logging](https://cloud.ibm.com/docs/vpc?topic=vpc-datapath-logging) on the
+ logging
+ format, fields and permitted values. If unspecified, `datapath.active` will
+ be `false`.
+ To activate logging, the load balancer profile must support the specified
+ logging type.
+ :param str name: (optional) The name for this load balancer. The name must
+ not be used by another load balancer in the VPC. If unspecified, the name
+ will be a hyphenated list of randomly-selected words.
+ :param List[LoadBalancerPoolPrototype] pools: (optional) The pools of this
+ load balancer.
+ :param LoadBalancerProfileIdentity profile: (optional) The profile to use
+ for this load balancer.
+ If unspecified, `application` will be used.
+ :param ResourceGroupIdentity resource_group: (optional) The resource group
+ to use. If unspecified, the account's [default resource
+ group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be
+ 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 `LoadBalancerListenerPolicy` object
+ :rtype: DetailedResponse with `dict` result representing a `LoadBalancer` object
"""
- if not load_balancer_id:
- raise ValueError('load_balancer_id must be provided')
- if not listener_id:
- raise ValueError('listener_id must be provided')
- if action is None:
- raise ValueError('action must be provided')
- if priority is None:
- raise ValueError('priority must be provided')
- if rules is not None:
- rules = [convert_model(x) for x in rules]
- if target is not None:
- target = convert_model(target)
+ if 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 dns is not None:
+ dns = convert_model(dns)
+ if listeners is not None:
+ listeners = [convert_model(x) for x in listeners]
+ if logging is not None:
+ logging = convert_model(logging)
+ if pools is not None:
+ pools = [convert_model(x) for x in pools]
+ if profile is not None:
+ profile = convert_model(profile)
+ if resource_group is not None:
+ resource_group = convert_model(resource_group)
+ if security_groups is not None:
+ security_groups = [convert_model(x) for x in security_groups]
headers = {}
sdk_headers = get_sdk_headers(
service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='create_load_balancer_listener_policy',
+ operation_id='create_load_balancer',
)
headers.update(sdk_headers)
@@ -20050,11 +21336,17 @@ def create_load_balancer_listener_policy(
}
data = {
- 'action': action,
- 'priority': priority,
+ 'is_public': is_public,
+ 'subnets': subnets,
+ 'dns': dns,
+ 'listeners': listeners,
+ 'logging': logging,
'name': name,
- 'rules': rules,
- 'target': target,
+ '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)
@@ -20065,10 +21357,7 @@ def create_load_balancer_listener_policy(
del kwargs['headers']
headers['Accept'] = 'application/json'
- path_param_keys = ['load_balancer_id', 'listener_id']
- path_param_values = self.encode_path_vars(load_balancer_id, listener_id)
- path_param_dict = dict(zip(path_param_keys, path_param_values))
- url = '/load_balancers/{load_balancer_id}/listeners/{listener_id}/policies'.format(**path_param_dict)
+ url = '/load_balancers'
request = self.prepare_request(
method='POST',
url=url,
@@ -20080,37 +21369,37 @@ def create_load_balancer_listener_policy(
response = self.send(request, **kwargs)
return response
- def delete_load_balancer_listener_policy(
+ def delete_load_balancer(
self,
- load_balancer_id: str,
- listener_id: str,
id: str,
+ *,
+ if_match: Optional[str] = None,
**kwargs,
) -> DetailedResponse:
"""
- Delete a load balancer listener policy.
+ Delete a load balancer.
- Deletes a policy of the load balancer listener. This operation cannot be reversed.
+ This request deletes a load balancer. This operation cannot be reversed. A load
+ balancer cannot be deleted if its `provisioning_status` is `delete_pending` or it
+ is referenced by a resource.
- :param str load_balancer_id: The load balancer identifier.
- :param str listener_id: The listener identifier.
- :param str id: The policy identifier.
+ :param str id: The load balancer identifier.
+ :param str if_match: (optional) If present, the request will fail if the
+ specified ETag value does not match the resource's current ETag value.
:param dict headers: A `dict` containing the request headers
:return: A `DetailedResponse` containing the result, headers and HTTP status code.
:rtype: DetailedResponse
"""
- if not load_balancer_id:
- raise ValueError('load_balancer_id must be provided')
- if not listener_id:
- raise ValueError('listener_id must be provided')
if not id:
raise ValueError('id must be provided')
- headers = {}
+ headers = {
+ 'If-Match': if_match,
+ }
sdk_headers = get_sdk_headers(
service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='delete_load_balancer_listener_policy',
+ operation_id='delete_load_balancer',
)
headers.update(sdk_headers)
@@ -20123,10 +21412,10 @@ def delete_load_balancer_listener_policy(
headers.update(kwargs.get('headers'))
del kwargs['headers']
- path_param_keys = ['load_balancer_id', 'listener_id', 'id']
- path_param_values = self.encode_path_vars(load_balancer_id, listener_id, id)
+ path_param_keys = ['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/{listener_id}/policies/{id}'.format(**path_param_dict)
+ url = '/load_balancers/{id}'.format(**path_param_dict)
request = self.prepare_request(
method='DELETE',
url=url,
@@ -20137,37 +21426,30 @@ def delete_load_balancer_listener_policy(
response = self.send(request, **kwargs)
return response
- def get_load_balancer_listener_policy(
+ def get_load_balancer(
self,
- load_balancer_id: str,
- listener_id: str,
id: str,
**kwargs,
) -> DetailedResponse:
"""
- Retrieve a load balancer listener policy.
+ Retrieve a load balancer.
- Retrieve a single policy specified by the identifier in the URL path.
+ This request retrieves a single load balancer specified by the identifier in the
+ URL path.
- :param str load_balancer_id: The load balancer identifier.
- :param str listener_id: The listener identifier.
- :param str id: The policy identifier.
+ :param str id: The load balancer identifier.
:param dict headers: A `dict` containing the request headers
:return: A `DetailedResponse` containing the result, headers and HTTP status code.
- :rtype: DetailedResponse with `dict` result representing a `LoadBalancerListenerPolicy` object
+ :rtype: DetailedResponse with `dict` result representing a `LoadBalancer` object
"""
- if not load_balancer_id:
- raise ValueError('load_balancer_id must be provided')
- if not listener_id:
- raise ValueError('listener_id must be provided')
if not id:
raise ValueError('id must be provided')
headers = {}
sdk_headers = get_sdk_headers(
service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='get_load_balancer_listener_policy',
+ operation_id='get_load_balancer',
)
headers.update(sdk_headers)
@@ -20181,10 +21463,10 @@ def get_load_balancer_listener_policy(
del kwargs['headers']
headers['Accept'] = 'application/json'
- path_param_keys = ['load_balancer_id', 'listener_id', 'id']
- path_param_values = self.encode_path_vars(load_balancer_id, listener_id, id)
+ path_param_keys = ['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/{listener_id}/policies/{id}'.format(**path_param_dict)
+ url = '/load_balancers/{id}'.format(**path_param_dict)
request = self.prepare_request(
method='GET',
url=url,
@@ -20195,44 +21477,45 @@ def get_load_balancer_listener_policy(
response = self.send(request, **kwargs)
return response
- def update_load_balancer_listener_policy(
+ def update_load_balancer(
self,
- load_balancer_id: str,
- listener_id: str,
id: str,
- load_balancer_listener_policy_patch: 'LoadBalancerListenerPolicyPatch',
+ load_balancer_patch: 'LoadBalancerPatch',
+ *,
+ if_match: Optional[str] = None,
**kwargs,
) -> DetailedResponse:
"""
- Update a load balancer listener policy.
+ Update a load balancer.
- Updates a policy from a policy patch.
+ This request updates a load balancer with the information in a provided load
+ balancer patch. The load balancer patch object is structured in the same way as a
+ retrieved load balancer and contains only the information to be updated. A load
+ balancer can only be updated if its `provisioning_status` is `active`.
- :param str load_balancer_id: The load balancer identifier.
- :param str listener_id: The listener identifier.
- :param str id: The policy identifier.
- :param LoadBalancerListenerPolicyPatch load_balancer_listener_policy_patch:
- The listener policy patch.
+ :param str id: The load balancer identifier.
+ :param LoadBalancerPatch load_balancer_patch: The load balancer patch.
+ :param str if_match: (optional) If present, the request will fail if the
+ specified ETag value does not match the resource's current ETag value.
+ Required if the request body includes an array.
:param dict headers: A `dict` containing the request headers
:return: A `DetailedResponse` containing the result, headers and HTTP status code.
- :rtype: DetailedResponse with `dict` result representing a `LoadBalancerListenerPolicy` object
+ :rtype: DetailedResponse with `dict` result representing a `LoadBalancer` object
"""
- if not load_balancer_id:
- raise ValueError('load_balancer_id must be provided')
- if not listener_id:
- raise ValueError('listener_id must be provided')
if not id:
raise ValueError('id must be provided')
- if load_balancer_listener_policy_patch is None:
- raise ValueError('load_balancer_listener_policy_patch must be provided')
- if isinstance(load_balancer_listener_policy_patch, LoadBalancerListenerPolicyPatch):
- load_balancer_listener_policy_patch = convert_model(load_balancer_listener_policy_patch)
- headers = {}
+ if load_balancer_patch is None:
+ raise ValueError('load_balancer_patch must be provided')
+ if isinstance(load_balancer_patch, LoadBalancerPatch):
+ load_balancer_patch = convert_model(load_balancer_patch)
+ headers = {
+ 'If-Match': if_match,
+ }
sdk_headers = get_sdk_headers(
service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='update_load_balancer_listener_policy',
+ operation_id='update_load_balancer',
)
headers.update(sdk_headers)
@@ -20241,7 +21524,7 @@ def update_load_balancer_listener_policy(
'generation': self.generation,
}
- data = json.dumps(load_balancer_listener_policy_patch)
+ data = json.dumps(load_balancer_patch)
headers['content-type'] = 'application/merge-patch+json'
if 'headers' in kwargs:
@@ -20249,10 +21532,10 @@ def update_load_balancer_listener_policy(
del kwargs['headers']
headers['Accept'] = 'application/json'
- path_param_keys = ['load_balancer_id', 'listener_id', 'id']
- path_param_values = self.encode_path_vars(load_balancer_id, listener_id, id)
+ path_param_keys = ['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/{listener_id}/policies/{id}'.format(**path_param_dict)
+ url = '/load_balancers/{id}'.format(**path_param_dict)
request = self.prepare_request(
method='PATCH',
url=url,
@@ -20264,37 +21547,79 @@ def update_load_balancer_listener_policy(
response = self.send(request, **kwargs)
return response
- def list_load_balancer_listener_policy_rules(
+ def get_load_balancer_statistics(
+ self,
+ id: str,
+ **kwargs,
+ ) -> DetailedResponse:
+ """
+ List all statistics of a load balancer.
+
+ This request lists statistics of a load balancer.
+
+ :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 `LoadBalancerStatistics` object
+ """
+
+ if not id:
+ raise ValueError('id must be provided')
+ headers = {}
+ sdk_headers = get_sdk_headers(
+ service_name=self.DEFAULT_SERVICE_NAME,
+ service_version='V1',
+ operation_id='get_load_balancer_statistics',
+ )
+ headers.update(sdk_headers)
+
+ params = {
+ 'version': self.version,
+ 'generation': self.generation,
+ }
+
+ if 'headers' in kwargs:
+ headers.update(kwargs.get('headers'))
+ del kwargs['headers']
+ headers['Accept'] = 'application/json'
+
+ path_param_keys = ['id']
+ path_param_values = self.encode_path_vars(id)
+ path_param_dict = dict(zip(path_param_keys, path_param_values))
+ url = '/load_balancers/{id}/statistics'.format(**path_param_dict)
+ request = self.prepare_request(
+ method='GET',
+ url=url,
+ headers=headers,
+ params=params,
+ )
+
+ response = self.send(request, **kwargs)
+ return response
+
+ def list_load_balancer_listeners(
self,
load_balancer_id: str,
- listener_id: str,
- policy_id: str,
**kwargs,
) -> DetailedResponse:
"""
- List all rules of a load balancer listener policy.
+ List all listeners for a load balancer.
- This request lists all rules of a load balancer listener policy.
+ This request lists all listeners for a load balancer.
:param str load_balancer_id: The load balancer identifier.
- :param str listener_id: The listener identifier.
- :param str policy_id: The policy identifier.
:param dict headers: 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 `LoadBalancerListenerCollection` object
"""
if not load_balancer_id:
raise ValueError('load_balancer_id must be provided')
- if not listener_id:
- raise ValueError('listener_id must be provided')
- if not policy_id:
- raise ValueError('policy_id must be provided')
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_load_balancer_listeners',
)
headers.update(sdk_headers)
@@ -20308,10 +21633,10 @@ def list_load_balancer_listener_policy_rules(
del kwargs['headers']
headers['Accept'] = 'application/json'
- path_param_keys = ['load_balancer_id', 'listener_id', 'policy_id']
- path_param_values = self.encode_path_vars(load_balancer_id, listener_id, policy_id)
+ path_param_keys = ['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/{listener_id}/policies/{policy_id}/rules'.format(**path_param_dict)
+ url = '/load_balancers/{load_balancer_id}/listeners'.format(**path_param_dict)
request = self.prepare_request(
method='GET',
url=url,
@@ -20322,62 +21647,122 @@ def list_load_balancer_listener_policy_rules(
response = self.send(request, **kwargs)
return response
- def create_load_balancer_listener_policy_rule(
+ def create_load_balancer_listener(
self,
load_balancer_id: str,
- listener_id: str,
- policy_id: str,
- condition: str,
- type: str,
- value: str,
+ protocol: str,
*,
- field: str = None,
+ accept_proxy_protocol: Optional[bool] = None,
+ certificate_instance: Optional['CertificateInstanceIdentity'] = None,
+ connection_limit: Optional[int] = None,
+ default_pool: Optional['LoadBalancerPoolIdentity'] = None,
+ https_redirect: Optional['LoadBalancerListenerHTTPSRedirectPrototype'] = None,
+ idle_connection_timeout: Optional[int] = None,
+ policies: Optional[List['LoadBalancerListenerPolicyPrototype']] = None,
+ port: Optional[int] = None,
+ port_max: Optional[int] = None,
+ port_min: Optional[int] = None,
**kwargs,
) -> DetailedResponse:
"""
- Create a rule for a load balancer listener policy.
+ Create a listener for a load balancer.
- Creates a new rule for the load balancer listener policy.
+ This request creates a new listener for a load balancer.
:param str load_balancer_id: The load balancer identifier.
- :param str listener_id: The listener identifier.
- :param str policy_id: The policy identifier.
- :param str 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 protocol: The listener protocol. Each listener in the load
+ balancer must have a unique `port` and `protocol` combination.
+ Load balancers in the `network` family support `tcp` and `udp` (if
+ `udp_supported` is `true`). Load balancers in the `application` family
+ support `tcp`, `http` and
+ `https`.
+ Additional restrictions:
+ - If `default_pool` is set, the pool's protocol must match, or be
+ compatible with
+ the listener's protocol. At present, the compatible protocols are `http`
+ and
+ `https`.
+ - If `https_redirect` is set, the protocol must be `http`.
+ :param bool accept_proxy_protocol: (optional) If set to `true`, this
+ listener will accept and forward PROXY protocol information. Supported by
+ load balancers in the `application` family (otherwise always `false`).
+ Additional restrictions:
+ - If this listener has `https_redirect` specified, its
+ `accept_proxy_protocol` value must
+ match the `accept_proxy_protocol` value of the `https_redirect` listener.
+ - If this listener is the target of another listener's `https_redirect`,
+ its
+ `accept_proxy_protocol` value must match that listener's
+ `accept_proxy_protocol` value.
+ :param CertificateInstanceIdentity certificate_instance: (optional) The
+ certificate instance to use for SSL termination. The listener must have a
+ `protocol` of `https`.
+ :param int connection_limit: (optional) The connection limit of the
+ listener.
+ :param LoadBalancerPoolIdentity default_pool: (optional) The default pool
+ for this listener. If specified, the pool must:
+ - Belong to this load balancer.
+ - Have the same `protocol` as this listener, or have a compatible protocol.
+ At present, the compatible protocols are `http` and `https`.
+ - Not already be the `default_pool` for another listener.
+ If unspecified, this listener will be created with no default pool, but one
+ may be
+ subsequently set.
+ :param LoadBalancerListenerHTTPSRedirectPrototype https_redirect:
+ (optional) The target listener that requests will be redirected to. This
+ listener must have a
+ `protocol` of `http`, and the target listener must have a `protocol` of
+ `https`.
+ :param int idle_connection_timeout: (optional) The idle connection timeout
+ of the listener in seconds. Supported for load balancers in the
+ `application` family.
+ :param List[LoadBalancerListenerPolicyPrototype] policies: (optional) The
+ policy prototype objects for this listener. The load balancer must be in
+ the
+ `application` family.
+ :param int port: (optional) The listener port number, or the inclusive
+ lower bound of the port range. Each listener in the load balancer must have
+ a unique `port` and `protocol` combination.
+ Not supported for load balancers operating with route mode enabled.
+ :param int port_max: (optional) The inclusive upper bound of the range of
+ ports used by this listener. Must not be less than `port_min`.
+ At present, only load balancers operating with route mode enabled, and
+ public load balancers in the `network` family support different values for
+ `port_min` and
+ `port_max`. When route mode is enabled, the value `65535` must be
+ specified.
+ The specified port range must not overlap with port ranges used by other
+ listeners for this load balancer using the same protocol.
+ :param int port_min: (optional) The inclusive lower bound of the range of
+ ports used by this listener. Must not be greater than `port_max`.
+ At present, only load balancers operating with route mode enabled, and
+ public load balancers in the `network` family support different values for
+ `port_min` and
+ `port_max`. When route mode is enabled, the value `1` must be specified.
+ The specified port range must not overlap with port ranges used by other
+ listeners for this load balancer using the same protocol.
:param dict headers: A `dict` containing the request headers
:return: A `DetailedResponse` containing the result, headers and HTTP status code.
- :rtype: DetailedResponse with `dict` result representing a `LoadBalancerListenerPolicyRule` object
+ :rtype: DetailedResponse with `dict` result representing a `LoadBalancerListener` object
"""
if not load_balancer_id:
raise ValueError('load_balancer_id must be provided')
- if not listener_id:
- raise ValueError('listener_id must be provided')
- if not policy_id:
- raise ValueError('policy_id must be provided')
- if condition is None:
- raise ValueError('condition must be provided')
- if type is None:
- raise ValueError('type must be provided')
- if value is None:
- raise ValueError('value must be provided')
+ if 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_load_balancer_listener_policy_rule',
+ operation_id='create_load_balancer_listener',
)
headers.update(sdk_headers)
@@ -20387,10 +21772,17 @@ def create_load_balancer_listener_policy_rule(
}
data = {
- 'condition': condition,
- 'type': type,
- 'value': value,
- 'field': field,
+ 'protocol': protocol,
+ 'accept_proxy_protocol': accept_proxy_protocol,
+ 'certificate_instance': certificate_instance,
+ 'connection_limit': connection_limit,
+ 'default_pool': default_pool,
+ 'https_redirect': https_redirect,
+ 'idle_connection_timeout': idle_connection_timeout,
+ 'policies': policies,
+ 'port': port,
+ 'port_max': port_max,
+ 'port_min': port_min,
}
data = {k: v for (k, v) in data.items() if v is not None}
data = json.dumps(data)
@@ -20401,10 +21793,10 @@ def create_load_balancer_listener_policy_rule(
del kwargs['headers']
headers['Accept'] = 'application/json'
- path_param_keys = ['load_balancer_id', 'listener_id', 'policy_id']
- path_param_values = self.encode_path_vars(load_balancer_id, listener_id, policy_id)
+ path_param_keys = ['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/{listener_id}/policies/{policy_id}/rules'.format(**path_param_dict)
+ url = '/load_balancers/{load_balancer_id}/listeners'.format(**path_param_dict)
request = self.prepare_request(
method='POST',
url=url,
@@ -20416,24 +21808,21 @@ def create_load_balancer_listener_policy_rule(
response = self.send(request, **kwargs)
return response
- def delete_load_balancer_listener_policy_rule(
+ def delete_load_balancer_listener(
self,
load_balancer_id: str,
- listener_id: str,
- policy_id: str,
id: str,
**kwargs,
) -> DetailedResponse:
"""
- Delete a load balancer listener policy rule.
+ Delete a load balancer listener.
- Deletes a rule from the load balancer listener policy. This operation cannot be
- reversed.
+ This request deletes a load balancer listener. This operation cannot be reversed.
+ For this operation to succeed, the listener must not be the target of another load
+ balancer listener.
:param str load_balancer_id: The load balancer identifier.
- :param str listener_id: The listener identifier.
- :param str policy_id: The policy identifier.
- :param str id: The rule 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
@@ -20441,17 +21830,13 @@ def delete_load_balancer_listener_policy_rule(
if not load_balancer_id:
raise ValueError('load_balancer_id must be provided')
- if not listener_id:
- raise ValueError('listener_id must be provided')
- if not policy_id:
- raise ValueError('policy_id must be provided')
if not id:
raise ValueError('id must be provided')
headers = {}
sdk_headers = get_sdk_headers(
service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='delete_load_balancer_listener_policy_rule',
+ operation_id='delete_load_balancer_listener',
)
headers.update(sdk_headers)
@@ -20464,10 +21849,10 @@ def delete_load_balancer_listener_policy_rule(
headers.update(kwargs.get('headers'))
del kwargs['headers']
- path_param_keys = ['load_balancer_id', 'listener_id', 'policy_id', 'id']
- path_param_values = self.encode_path_vars(load_balancer_id, listener_id, policy_id, id)
+ 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}/listeners/{listener_id}/policies/{policy_id}/rules/{id}'.format(**path_param_dict)
+ url = '/load_balancers/{load_balancer_id}/listeners/{id}'.format(**path_param_dict)
request = self.prepare_request(
method='DELETE',
url=url,
@@ -20478,41 +21863,34 @@ def delete_load_balancer_listener_policy_rule(
response = self.send(request, **kwargs)
return response
- def get_load_balancer_listener_policy_rule(
+ def get_load_balancer_listener(
self,
load_balancer_id: str,
- listener_id: str,
- policy_id: str,
id: str,
**kwargs,
) -> DetailedResponse:
"""
- Retrieve a load balancer listener policy rule.
+ Retrieve a load balancer listener.
- Retrieves a single rule specified by the identifier in the URL path.
+ This request retrieves a single listener specified by the identifier in the URL
+ path.
:param str load_balancer_id: The load balancer identifier.
- :param str listener_id: The listener identifier.
- :param str policy_id: The policy identifier.
- :param str id: The rule 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 `LoadBalancerListenerPolicyRule` object
+ :rtype: DetailedResponse with `dict` result representing a `LoadBalancerListener` object
"""
if not load_balancer_id:
raise ValueError('load_balancer_id must be provided')
- if not listener_id:
- raise ValueError('listener_id must be provided')
- if not policy_id:
- raise ValueError('policy_id must be provided')
if not id:
raise ValueError('id must be provided')
headers = {}
sdk_headers = get_sdk_headers(
service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='get_load_balancer_listener_policy_rule',
+ operation_id='get_load_balancer_listener',
)
headers.update(sdk_headers)
@@ -20526,10 +21904,10 @@ def get_load_balancer_listener_policy_rule(
del kwargs['headers']
headers['Accept'] = 'application/json'
- path_param_keys = ['load_balancer_id', 'listener_id', 'policy_id', 'id']
- path_param_values = self.encode_path_vars(load_balancer_id, listener_id, policy_id, id)
+ path_param_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}/listeners/{listener_id}/policies/{policy_id}/rules/{id}'.format(**path_param_dict)
+ url = '/load_balancers/{load_balancer_id}/listeners/{id}'.format(**path_param_dict)
request = self.prepare_request(
method='GET',
url=url,
@@ -20540,48 +21918,40 @@ def get_load_balancer_listener_policy_rule(
response = self.send(request, **kwargs)
return response
- def update_load_balancer_listener_policy_rule(
+ def update_load_balancer_listener(
self,
load_balancer_id: str,
- listener_id: str,
- policy_id: str,
id: str,
- load_balancer_listener_policy_rule_patch: 'LoadBalancerListenerPolicyRulePatch',
+ load_balancer_listener_patch: 'LoadBalancerListenerPatch',
**kwargs,
) -> DetailedResponse:
"""
- Update a load balancer listener policy rule.
+ Update a load balancer listener.
- Updates a rule of the load balancer listener policy.
+ This request updates a load balancer listener from a listener 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 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 `LoadBalancerListenerPolicyRule` object
+ :rtype: DetailedResponse with `dict` result representing a `LoadBalancerListener` object
"""
if not load_balancer_id:
raise ValueError('load_balancer_id must be provided')
- if not listener_id:
- raise ValueError('listener_id must be provided')
- if not policy_id:
- raise ValueError('policy_id must be provided')
if not id:
raise ValueError('id must be provided')
- if load_balancer_listener_policy_rule_patch is None:
- raise ValueError('load_balancer_listener_policy_rule_patch must be provided')
- if isinstance(load_balancer_listener_policy_rule_patch, LoadBalancerListenerPolicyRulePatch):
- load_balancer_listener_policy_rule_patch = convert_model(load_balancer_listener_policy_rule_patch)
+ if load_balancer_listener_patch is None:
+ raise ValueError('load_balancer_listener_patch must be provided')
+ if isinstance(load_balancer_listener_patch, LoadBalancerListenerPatch):
+ load_balancer_listener_patch = convert_model(load_balancer_listener_patch)
headers = {}
sdk_headers = get_sdk_headers(
service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='update_load_balancer_listener_policy_rule',
+ operation_id='update_load_balancer_listener',
)
headers.update(sdk_headers)
@@ -20590,7 +21960,7 @@ def update_load_balancer_listener_policy_rule(
'generation': self.generation,
}
- data = json.dumps(load_balancer_listener_policy_rule_patch)
+ data = json.dumps(load_balancer_listener_patch)
headers['content-type'] = 'application/merge-patch+json'
if 'headers' in kwargs:
@@ -20598,10 +21968,10 @@ def update_load_balancer_listener_policy_rule(
del kwargs['headers']
headers['Accept'] = 'application/json'
- path_param_keys = ['load_balancer_id', 'listener_id', 'policy_id', 'id']
- path_param_values = self.encode_path_vars(load_balancer_id, listener_id, policy_id, id)
+ path_param_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}/listeners/{listener_id}/policies/{policy_id}/rules/{id}'.format(**path_param_dict)
+ url = '/load_balancers/{load_balancer_id}/listeners/{id}'.format(**path_param_dict)
request = self.prepare_request(
method='PATCH',
url=url,
@@ -20613,29 +21983,33 @@ def update_load_balancer_listener_policy_rule(
response = self.send(request, **kwargs)
return response
- def list_load_balancer_pools(
+ def list_load_balancer_listener_policies(
self,
load_balancer_id: str,
+ listener_id: str,
**kwargs,
) -> DetailedResponse:
"""
- List all pools of a load balancer.
+ List all policies for a load balancer listener.
- This request lists all pools of a load balancer.
+ This request lists all policies for a load balancer listener.
: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 `LoadBalancerPoolCollection` object
+ :rtype: DetailedResponse with `dict` result representing a `LoadBalancerListenerPolicyCollection` object
"""
if not load_balancer_id:
raise ValueError('load_balancer_id must be provided')
+ if not listener_id:
+ raise ValueError('listener_id must be provided')
headers = {}
sdk_headers = get_sdk_headers(
service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='list_load_balancer_pools',
+ operation_id='list_load_balancer_listener_policies',
)
headers.update(sdk_headers)
@@ -20649,10 +22023,10 @@ def list_load_balancer_pools(
del kwargs['headers']
headers['Accept'] = 'application/json'
- path_param_keys = ['load_balancer_id']
- path_param_values = self.encode_path_vars(load_balancer_id)
+ path_param_keys = ['load_balancer_id', 'listener_id']
+ path_param_values = self.encode_path_vars(load_balancer_id, listener_id)
path_param_dict = dict(zip(path_param_keys, path_param_values))
- url = '/load_balancers/{load_balancer_id}/pools'.format(**path_param_dict)
+ url = '/load_balancers/{load_balancer_id}/listeners/{listener_id}/policies'.format(**path_param_dict)
request = self.prepare_request(
method='GET',
url=url,
@@ -20663,71 +22037,65 @@ def list_load_balancer_pools(
response = self.send(request, **kwargs)
return response
- def create_load_balancer_pool(
+ def create_load_balancer_listener_policy(
self,
load_balancer_id: str,
- algorithm: str,
- health_monitor: 'LoadBalancerPoolHealthMonitorPrototype',
- protocol: str,
+ listener_id: str,
+ action: str,
+ priority: int,
*,
- members: List['LoadBalancerPoolMemberPrototype'] = None,
- name: str = None,
- proxy_protocol: str = None,
- session_persistence: 'LoadBalancerPoolSessionPersistencePrototype' = None,
+ name: Optional[str] = None,
+ rules: Optional[List['LoadBalancerListenerPolicyRulePrototype']] = None,
+ target: Optional['LoadBalancerListenerPolicyTargetPrototype'] = None,
**kwargs,
) -> DetailedResponse:
"""
- Create a load balancer pool.
+ Create a policy for a load balancer listener.
- This request creates a new pool from a pool prototype object.
+ Creates a new policy for a load balancer listener.
:param str load_balancer_id: The load balancer identifier.
- :param str algorithm: The load balancing algorithm.
- :param LoadBalancerPoolHealthMonitorPrototype health_monitor: The health
- monitor of this pool.
- :param str protocol: The protocol used for this load balancer pool. Load
- balancers in the `network` family support `tcp` and `udp` (if
- `udp_supported` is `true`). Load balancers in the
- `application` family support `tcp`, `http`, and `https`.
- :param List[LoadBalancerPoolMemberPrototype] members: (optional) The
- members for this load balancer pool. For load balancers in the `network`
- family, the same `port` and `target` tuple cannot be shared by a pool
- member of any other load balancer in the same VPC.
- :param str name: (optional) The name for this load balancer pool. The name
- must not be used by another pool for the load balancer. If unspecified, the
+ :param str listener_id: The listener identifier.
+ :param str action: The policy action.
+ The enumerated values for this property are expected to expand in the
+ future. When processing this property, check for and log unknown values.
+ Optionally halt processing and surface the error, or bypass the policy on
+ which the unexpected property value was encountered.
+ :param int priority: Priority of the policy. Lower value indicates higher
+ priority.
+ :param str name: (optional) The name for this policy. The name must not be
+ used by another policy for the load balancer listener. If unspecified, the
name will be a hyphenated list of randomly-selected words.
- :param 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 List[LoadBalancerListenerPolicyRulePrototype] rules: (optional) The
+ rule prototype objects for this policy.
+ :param LoadBalancerListenerPolicyTargetPrototype target: (optional) - If
+ `action` is `forward`, specify a `LoadBalancerPoolIdentity`.
+ - If `action` is `redirect`, specify a
+ `LoadBalancerListenerPolicyRedirectURLPrototype`.
+ - If `action` is `https_redirect`, specify a
+ `LoadBalancerListenerPolicyHTTPSRedirectPrototype`.
:param dict headers: A `dict` containing the request headers
:return: A `DetailedResponse` containing the result, headers and HTTP status code.
- :rtype: DetailedResponse with `dict` result representing a `LoadBalancerPool` object
+ :rtype: DetailedResponse with `dict` result representing a `LoadBalancerListenerPolicy` object
"""
if not load_balancer_id:
raise ValueError('load_balancer_id must be provided')
- if algorithm is None:
- raise ValueError('algorithm must be provided')
- if health_monitor is None:
- raise ValueError('health_monitor must be provided')
- if protocol is None:
- raise ValueError('protocol must be provided')
- health_monitor = convert_model(health_monitor)
- if members is not None:
- members = [convert_model(x) for x in members]
- if session_persistence is not None:
- session_persistence = convert_model(session_persistence)
+ if not listener_id:
+ raise ValueError('listener_id must be provided')
+ if action is None:
+ raise ValueError('action must be provided')
+ if priority is None:
+ raise ValueError('priority must be provided')
+ if rules is not None:
+ rules = [convert_model(x) for x in rules]
+ if target is not None:
+ target = convert_model(target)
headers = {}
sdk_headers = get_sdk_headers(
service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='create_load_balancer_pool',
+ operation_id='create_load_balancer_listener_policy',
)
headers.update(sdk_headers)
@@ -20737,13 +22105,11 @@ def create_load_balancer_pool(
}
data = {
- 'algorithm': algorithm,
- 'health_monitor': health_monitor,
- 'protocol': protocol,
- 'members': members,
+ 'action': action,
+ 'priority': priority,
'name': name,
- 'proxy_protocol': proxy_protocol,
- 'session_persistence': session_persistence,
+ 'rules': rules,
+ 'target': target,
}
data = {k: v for (k, v) in data.items() if v is not None}
data = json.dumps(data)
@@ -20754,10 +22120,10 @@ def create_load_balancer_pool(
del kwargs['headers']
headers['Accept'] = 'application/json'
- path_param_keys = ['load_balancer_id']
- path_param_values = self.encode_path_vars(load_balancer_id)
+ path_param_keys = ['load_balancer_id', 'listener_id']
+ path_param_values = self.encode_path_vars(load_balancer_id, listener_id)
path_param_dict = dict(zip(path_param_keys, path_param_values))
- url = '/load_balancers/{load_balancer_id}/pools'.format(**path_param_dict)
+ url = '/load_balancers/{load_balancer_id}/listeners/{listener_id}/policies'.format(**path_param_dict)
request = self.prepare_request(
method='POST',
url=url,
@@ -20769,20 +22135,21 @@ def create_load_balancer_pool(
response = self.send(request, **kwargs)
return response
- def delete_load_balancer_pool(
+ def delete_load_balancer_listener_policy(
self,
load_balancer_id: str,
+ listener_id: str,
id: str,
**kwargs,
) -> DetailedResponse:
"""
- Delete a load balancer pool.
+ Delete a load balancer listener policy.
- 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.
+ Deletes a policy of the load balancer listener. This operation cannot be reversed.
:param str load_balancer_id: The load balancer identifier.
- :param str id: The pool 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
@@ -20790,13 +22157,15 @@ def delete_load_balancer_pool(
if not load_balancer_id:
raise ValueError('load_balancer_id must be provided')
+ if not listener_id:
+ raise ValueError('listener_id must be provided')
if not id:
raise ValueError('id must be provided')
headers = {}
sdk_headers = get_sdk_headers(
service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='delete_load_balancer_pool',
+ operation_id='delete_load_balancer_listener_policy',
)
headers.update(sdk_headers)
@@ -20809,10 +22178,10 @@ def delete_load_balancer_pool(
headers.update(kwargs.get('headers'))
del kwargs['headers']
- path_param_keys = ['load_balancer_id', 'id']
- path_param_values = self.encode_path_vars(load_balancer_id, id)
+ path_param_keys = ['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}/pools/{id}'.format(**path_param_dict)
+ url = '/load_balancers/{load_balancer_id}/listeners/{listener_id}/policies/{id}'.format(**path_param_dict)
request = self.prepare_request(
method='DELETE',
url=url,
@@ -20823,33 +22192,37 @@ def delete_load_balancer_pool(
response = self.send(request, **kwargs)
return response
- def get_load_balancer_pool(
+ def get_load_balancer_listener_policy(
self,
load_balancer_id: str,
+ listener_id: str,
id: str,
**kwargs,
) -> DetailedResponse:
"""
- Retrieve a load balancer pool.
+ Retrieve a load balancer listener policy.
- This request retrieves a single pool specified by the identifier in the URL path.
+ Retrieve a single policy specified by the identifier in the URL path.
:param str load_balancer_id: The load balancer identifier.
- :param str id: The pool identifier.
+ :param str 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 `LoadBalancerPool` object
+ :rtype: DetailedResponse with `dict` result representing a `LoadBalancerListenerPolicy` object
"""
if not load_balancer_id:
raise ValueError('load_balancer_id must be provided')
+ if not listener_id:
+ raise ValueError('listener_id must be provided')
if not id:
raise ValueError('id must be provided')
headers = {}
sdk_headers = get_sdk_headers(
service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='get_load_balancer_pool',
+ operation_id='get_load_balancer_listener_policy',
)
headers.update(sdk_headers)
@@ -20863,10 +22236,10 @@ def get_load_balancer_pool(
del kwargs['headers']
headers['Accept'] = 'application/json'
- path_param_keys = ['load_balancer_id', 'id']
- path_param_values = self.encode_path_vars(load_balancer_id, id)
+ path_param_keys = ['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}/pools/{id}'.format(**path_param_dict)
+ url = '/load_balancers/{load_balancer_id}/listeners/{listener_id}/policies/{id}'.format(**path_param_dict)
request = self.prepare_request(
method='GET',
url=url,
@@ -20877,40 +22250,44 @@ def get_load_balancer_pool(
response = self.send(request, **kwargs)
return response
- def update_load_balancer_pool(
+ def update_load_balancer_listener_policy(
self,
load_balancer_id: str,
+ listener_id: str,
id: str,
- load_balancer_pool_patch: 'LoadBalancerPoolPatch',
+ load_balancer_listener_policy_patch: 'LoadBalancerListenerPolicyPatch',
**kwargs,
) -> DetailedResponse:
"""
- Update a load balancer pool.
+ Update a load balancer listener policy.
- This request updates a load balancer pool from a pool patch.
+ Updates a policy from a policy 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 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 `LoadBalancerPool` object
+ :rtype: DetailedResponse with `dict` result representing a `LoadBalancerListenerPolicy` object
"""
if not load_balancer_id:
raise ValueError('load_balancer_id must be provided')
+ if not listener_id:
+ raise ValueError('listener_id must be provided')
if not id:
raise ValueError('id must be provided')
- if load_balancer_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 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='update_load_balancer_pool',
+ operation_id='update_load_balancer_listener_policy',
)
headers.update(sdk_headers)
@@ -20919,7 +22296,7 @@ def update_load_balancer_pool(
'generation': self.generation,
}
- data = json.dumps(load_balancer_pool_patch)
+ data = json.dumps(load_balancer_listener_policy_patch)
headers['content-type'] = 'application/merge-patch+json'
if 'headers' in kwargs:
@@ -20927,10 +22304,10 @@ def update_load_balancer_pool(
del kwargs['headers']
headers['Accept'] = 'application/json'
- path_param_keys = ['load_balancer_id', 'id']
- path_param_values = self.encode_path_vars(load_balancer_id, id)
+ path_param_keys = ['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}/pools/{id}'.format(**path_param_dict)
+ url = '/load_balancers/{load_balancer_id}/listeners/{listener_id}/policies/{id}'.format(**path_param_dict)
request = self.prepare_request(
method='PATCH',
url=url,
@@ -20942,33 +22319,37 @@ def update_load_balancer_pool(
response = self.send(request, **kwargs)
return response
- def list_load_balancer_pool_members(
+ def list_load_balancer_listener_policy_rules(
self,
load_balancer_id: str,
- pool_id: str,
+ listener_id: str,
+ policy_id: str,
**kwargs,
) -> DetailedResponse:
"""
- List all members of a load balancer pool.
+ List all rules of a load balancer listener policy.
- This request lists all members of a load balancer pool.
+ This request lists all rules of a load balancer listener policy.
:param str load_balancer_id: The load balancer identifier.
- :param str pool_id: The pool 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 `LoadBalancerPoolMemberCollection` object
+ :rtype: DetailedResponse with `dict` result representing a `LoadBalancerListenerPolicyRuleCollection` object
"""
if not load_balancer_id:
raise ValueError('load_balancer_id must be provided')
- if not pool_id:
- raise ValueError('pool_id must be provided')
+ if not listener_id:
+ raise ValueError('listener_id must be provided')
+ if not policy_id:
+ raise ValueError('policy_id must be provided')
headers = {}
sdk_headers = get_sdk_headers(
service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='list_load_balancer_pool_members',
+ operation_id='list_load_balancer_listener_policy_rules',
)
headers.update(sdk_headers)
@@ -20982,10 +22363,10 @@ def list_load_balancer_pool_members(
del kwargs['headers']
headers['Accept'] = 'application/json'
- path_param_keys = ['load_balancer_id', 'pool_id']
- path_param_values = self.encode_path_vars(load_balancer_id, pool_id)
+ path_param_keys = ['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}/pools/{pool_id}/members'.format(**path_param_dict)
+ url = '/load_balancers/{load_balancer_id}/listeners/{listener_id}/policies/{policy_id}/rules'.format(**path_param_dict)
request = self.prepare_request(
method='GET',
url=url,
@@ -20996,61 +22377,62 @@ def list_load_balancer_pool_members(
response = self.send(request, **kwargs)
return response
- def create_load_balancer_pool_member(
+ def create_load_balancer_listener_policy_rule(
self,
load_balancer_id: str,
- pool_id: str,
- port: int,
- target: 'LoadBalancerPoolMemberTargetPrototype',
+ listener_id: str,
+ policy_id: str,
+ condition: str,
+ type: str,
+ value: str,
*,
- weight: int = None,
+ field: Optional[str] = None,
**kwargs,
) -> DetailedResponse:
"""
- Create a member in a load balancer pool.
+ Create a rule for a load balancer listener policy.
- This request creates a new member and adds the member to the pool.
+ Creates a new rule for the load balancer listener policy.
:param str load_balancer_id: The load balancer identifier.
- :param str pool_id: The pool identifier.
- :param int port: The port the member will receive load balancer traffic on.
- Applies only to load balancer traffic received on a listener with a single
- port. (If the traffic is received on a listener with a port range, the
- member will receive the traffic on the same port the listener received it
- on.)
- This port will also be used for health checks unless the `port` property of
- `health_monitor` property is specified.
- The port must be unique across all members for all pools associated with
- this pool's listener.
- :param LoadBalancerPoolMemberTargetPrototype target: The pool member
- target. Load balancers in the `network` family support virtual server
- instances. Load balancers in the `application` family support IP addresses.
- If the load
- balancer has route mode enabled, the member must be in a zone the load
- balancer has a
- subnet in.
- :param int weight: (optional) Weight of the server member. Applicable only
- if the pool algorithm is
- `weighted_round_robin`.
+ :param 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 `LoadBalancerPoolMember` object
+ :rtype: DetailedResponse with `dict` result representing a `LoadBalancerListenerPolicyRule` object
"""
if not load_balancer_id:
raise ValueError('load_balancer_id must be provided')
- if not pool_id:
- raise ValueError('pool_id must be provided')
- if port is None:
- raise ValueError('port must be provided')
- if target is None:
- raise ValueError('target must be provided')
- target = convert_model(target)
+ if not listener_id:
+ raise ValueError('listener_id must be provided')
+ if not policy_id:
+ raise ValueError('policy_id must be provided')
+ if condition is None:
+ raise ValueError('condition must be provided')
+ if type is None:
+ raise ValueError('type must be provided')
+ if value is None:
+ raise ValueError('value must be provided')
headers = {}
sdk_headers = get_sdk_headers(
service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='create_load_balancer_pool_member',
+ operation_id='create_load_balancer_listener_policy_rule',
)
headers.update(sdk_headers)
@@ -21060,9 +22442,10 @@ def create_load_balancer_pool_member(
}
data = {
- 'port': port,
- 'target': target,
- 'weight': weight,
+ '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)
@@ -21073,10 +22456,10 @@ def create_load_balancer_pool_member(
del kwargs['headers']
headers['Accept'] = 'application/json'
- path_param_keys = ['load_balancer_id', 'pool_id']
- path_param_values = self.encode_path_vars(load_balancer_id, pool_id)
+ path_param_keys = ['load_balancer_id', '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}/pools/{pool_id}/members'.format(**path_param_dict)
+ url = '/load_balancers/{load_balancer_id}/listeners/{listener_id}/policies/{policy_id}/rules'.format(**path_param_dict)
request = self.prepare_request(
method='POST',
url=url,
@@ -21088,40 +22471,42 @@ def create_load_balancer_pool_member(
response = self.send(request, **kwargs)
return response
- def replace_load_balancer_pool_members(
+ def delete_load_balancer_listener_policy_rule(
self,
load_balancer_id: str,
- pool_id: str,
- members: List['LoadBalancerPoolMemberPrototype'],
+ listener_id: str,
+ policy_id: str,
+ id: str,
**kwargs,
) -> DetailedResponse:
"""
- Replace load balancer pool members.
+ Delete a load balancer listener policy rule.
- This request replaces the existing members of the load balancer pool with new
- members created from the collection of member prototype objects.
+ Deletes a rule from the load balancer listener policy. 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 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 `LoadBalancerPoolMemberCollection` object
+ :rtype: DetailedResponse
"""
if not load_balancer_id:
raise ValueError('load_balancer_id must be provided')
- if not pool_id:
- raise ValueError('pool_id must be provided')
- if members is None:
- raise ValueError('members must be provided')
- members = [convert_model(x) for x in members]
+ if not listener_id:
+ raise ValueError('listener_id must be provided')
+ if not policy_id:
+ raise ValueError('policy_id must be provided')
+ if not id:
+ raise ValueError('id must be provided')
headers = {}
sdk_headers = get_sdk_headers(
service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='replace_load_balancer_pool_members',
+ operation_id='delete_load_balancer_listener_policy_rule',
)
headers.update(sdk_headers)
@@ -21130,64 +22515,59 @@ def replace_load_balancer_pool_members(
'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'))
del kwargs['headers']
- headers['Accept'] = 'application/json'
- path_param_keys = ['load_balancer_id', 'pool_id']
- path_param_values = self.encode_path_vars(load_balancer_id, pool_id)
+ path_param_keys = ['load_balancer_id', 'listener_id', 'policy_id', 'id']
+ path_param_values = self.encode_path_vars(load_balancer_id, listener_id, policy_id, id)
path_param_dict = dict(zip(path_param_keys, path_param_values))
- url = '/load_balancers/{load_balancer_id}/pools/{pool_id}/members'.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='PUT',
+ method='DELETE',
url=url,
headers=headers,
params=params,
- data=data,
)
response = self.send(request, **kwargs)
return response
- def delete_load_balancer_pool_member(
+ def get_load_balancer_listener_policy_rule(
self,
load_balancer_id: str,
- pool_id: str,
+ listener_id: str,
+ policy_id: str,
id: str,
**kwargs,
) -> DetailedResponse:
"""
- Delete a load balancer pool member.
+ Retrieve a load balancer listener policy rule.
- This request deletes a member from the pool. This operation cannot be reversed.
+ Retrieves a single rule 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 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
+ :rtype: DetailedResponse with `dict` result representing a `LoadBalancerListenerPolicyRule` object
"""
if not load_balancer_id:
raise ValueError('load_balancer_id must be provided')
- if not pool_id:
- raise ValueError('pool_id must be provided')
+ if not listener_id:
+ raise ValueError('listener_id must be provided')
+ if not policy_id:
+ raise ValueError('policy_id must be provided')
if not id:
raise ValueError('id must be provided')
headers = {}
sdk_headers = get_sdk_headers(
service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='delete_load_balancer_pool_member',
+ operation_id='get_load_balancer_listener_policy_rule',
)
headers.update(sdk_headers)
@@ -21199,13 +22579,14 @@ def delete_load_balancer_pool_member(
if 'headers' in kwargs:
headers.update(kwargs.get('headers'))
del kwargs['headers']
+ headers['Accept'] = 'application/json'
- path_param_keys = ['load_balancer_id', 'pool_id', 'id']
- path_param_values = self.encode_path_vars(load_balancer_id, pool_id, 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 = '/load_balancers/{load_balancer_id}/pools/{pool_id}/members/{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',
+ method='GET',
url=url,
headers=headers,
params=params,
@@ -21214,38 +22595,48 @@ def delete_load_balancer_pool_member(
response = self.send(request, **kwargs)
return response
- def get_load_balancer_pool_member(
+ def update_load_balancer_listener_policy_rule(
self,
load_balancer_id: str,
- pool_id: str,
+ listener_id: str,
+ policy_id: str,
id: str,
+ load_balancer_listener_policy_rule_patch: 'LoadBalancerListenerPolicyRulePatch',
**kwargs,
) -> DetailedResponse:
"""
- Retrieve a load balancer pool member.
+ Update a load balancer listener policy rule.
- This request retrieves a single member specified by the identifier in the URL
- path.
+ Updates a rule of the load balancer listener policy.
:param str load_balancer_id: The load balancer identifier.
- :param str pool_id: The pool identifier.
- :param str id: The member 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 `LoadBalancerPoolMember` object
+ :rtype: DetailedResponse with `dict` result representing a `LoadBalancerListenerPolicyRule` object
"""
if not load_balancer_id:
raise ValueError('load_balancer_id must be provided')
- if not pool_id:
- raise ValueError('pool_id must be provided')
+ if not listener_id:
+ raise ValueError('listener_id must be provided')
+ if not policy_id:
+ raise ValueError('policy_id must be provided')
if not id:
raise ValueError('id must be provided')
+ if load_balancer_listener_policy_rule_patch is None:
+ raise ValueError('load_balancer_listener_policy_rule_patch must be provided')
+ if isinstance(load_balancer_listener_policy_rule_patch, LoadBalancerListenerPolicyRulePatch):
+ load_balancer_listener_policy_rule_patch = convert_model(load_balancer_listener_policy_rule_patch)
headers = {}
sdk_headers = get_sdk_headers(
service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='get_load_balancer_pool_member',
+ operation_id='update_load_balancer_listener_policy_rule',
)
headers.update(sdk_headers)
@@ -21254,63 +22645,52 @@ def get_load_balancer_pool_member(
'generation': self.generation,
}
+ data = json.dumps(load_balancer_listener_policy_rule_patch)
+ headers['content-type'] = 'application/merge-patch+json'
+
if 'headers' in kwargs:
headers.update(kwargs.get('headers'))
del kwargs['headers']
headers['Accept'] = 'application/json'
- path_param_keys = ['load_balancer_id', 'pool_id', 'id']
- path_param_values = self.encode_path_vars(load_balancer_id, pool_id, 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 = '/load_balancers/{load_balancer_id}/pools/{pool_id}/members/{id}'.format(**path_param_dict)
+ url = '/load_balancers/{load_balancer_id}/listeners/{listener_id}/policies/{policy_id}/rules/{id}'.format(**path_param_dict)
request = self.prepare_request(
- method='GET',
+ method='PATCH',
url=url,
headers=headers,
params=params,
+ data=data,
)
response = self.send(request, **kwargs)
return response
- def update_load_balancer_pool_member(
+ def list_load_balancer_pools(
self,
load_balancer_id: str,
- pool_id: str,
- id: str,
- load_balancer_pool_member_patch: 'LoadBalancerPoolMemberPatch',
**kwargs,
) -> DetailedResponse:
"""
- Update a load balancer pool member.
+ List all pools of a load balancer.
- This request updates an existing member from a member patch.
+ This request lists all pools 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 dict headers: 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 `LoadBalancerPoolCollection` object
"""
if not load_balancer_id:
raise ValueError('load_balancer_id must be provided')
- if not pool_id:
- raise ValueError('pool_id must be provided')
- if not id:
- raise ValueError('id must be provided')
- if load_balancer_pool_member_patch is None:
- raise ValueError('load_balancer_pool_member_patch must be provided')
- if isinstance(load_balancer_pool_member_patch, LoadBalancerPoolMemberPatch):
- load_balancer_pool_member_patch = convert_model(load_balancer_pool_member_patch)
headers = {}
sdk_headers = get_sdk_headers(
service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='update_load_balancer_pool_member',
+ operation_id='list_load_balancer_pools',
)
headers.update(sdk_headers)
@@ -21319,174 +22699,159 @@ def update_load_balancer_pool_member(
'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'))
del kwargs['headers']
headers['Accept'] = 'application/json'
- path_param_keys = ['load_balancer_id', 'pool_id', 'id']
- path_param_values = self.encode_path_vars(load_balancer_id, pool_id, id)
+ path_param_keys = ['load_balancer_id']
+ path_param_values = self.encode_path_vars(load_balancer_id)
path_param_dict = dict(zip(path_param_keys, path_param_values))
- url = '/load_balancers/{load_balancer_id}/pools/{pool_id}/members/{id}'.format(**path_param_dict)
+ url = '/load_balancers/{load_balancer_id}/pools'.format(**path_param_dict)
request = self.prepare_request(
- method='PATCH',
+ method='GET',
url=url,
headers=headers,
params=params,
- data=data,
)
response = self.send(request, **kwargs)
return response
- #########################
- # Endpoint gateways
- #########################
-
- def list_endpoint_gateways(
+ def create_load_balancer_pool(
self,
+ load_balancer_id: str,
+ algorithm: str,
+ health_monitor: 'LoadBalancerPoolHealthMonitorPrototype',
+ protocol: str,
*,
- name: str = None,
- start: str = None,
- limit: int = None,
- resource_group_id: str = None,
- vpc_id: str = None,
- vpc_crn: str = None,
- vpc_name: str = None,
- allow_dns_resolution_binding: bool = None,
+ members: Optional[List['LoadBalancerPoolMemberPrototype']] = None,
+ name: Optional[str] = None,
+ proxy_protocol: Optional[str] = None,
+ session_persistence: Optional['LoadBalancerPoolSessionPersistencePrototype'] = None,
**kwargs,
) -> DetailedResponse:
"""
- List all endpoint gateways.
+ Create a load balancer pool.
- 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 creates a new pool from a pool prototype object.
- :param str name: (optional) Filters the collection to resources with a
- `name` property matching the exact specified name.
- :param str start: (optional) A server-provided token determining what
- resource to start the page on.
- :param int limit: (optional) The number of resources to return on a page.
- :param str resource_group_id: (optional) Filters the collection to
- resources with a `resource_group.id` property matching the specified
- identifier.
- :param str vpc_id: (optional) Filters the collection to resources with a
- `vpc.id` property matching the specified identifier.
- :param str vpc_crn: (optional) Filters the collection to resources with a
- `vpc.crn` property matching the specified CRN.
- :param str vpc_name: (optional) Filters the collection to resources with a
- `vpc.name` property matching the exact specified name.
- :param bool allow_dns_resolution_binding: (optional) Filters the collection
- to endpoint gateways with an `allow_dns_resolution_binding` property
- matching the specified value.
+ :param str load_balancer_id: The load balancer identifier.
+ :param str algorithm: The load balancing algorithm.
+ :param LoadBalancerPoolHealthMonitorPrototype health_monitor: The health
+ monitor of this pool.
+ :param str protocol: The protocol used for this load balancer pool. Load
+ balancers in the `network` family support `tcp` and `udp` (if
+ `udp_supported` is `true`). Load balancers in the
+ `application` family support `tcp`, `http`, and `https`.
+ :param List[LoadBalancerPoolMemberPrototype] members: (optional) The
+ members for this load balancer pool. For load balancers in the `network`
+ family, the same `port` and `target` tuple cannot be shared by a pool
+ member of any other load balancer in the same VPC.
+ :param str name: (optional) The name for this load balancer pool. The name
+ must not be used by another pool for the load balancer. If unspecified, the
+ name will be a hyphenated list of randomly-selected words.
+ :param str proxy_protocol: (optional) The PROXY protocol setting for this
+ pool:
+ - `v1`: Enabled with version 1 (human-readable header format)
+ - `v2`: Enabled with version 2 (binary header format)
+ - `disabled`: Disabled
+ Supported by load balancers in the `application` family (otherwise always
+ `disabled`).
+ :param LoadBalancerPoolSessionPersistencePrototype session_persistence:
+ (optional) The session persistence of this pool.
:param dict headers: A `dict` containing the request headers
:return: A `DetailedResponse` containing the result, headers and HTTP status code.
- :rtype: DetailedResponse with `dict` result representing a `EndpointGatewayCollection` object
+ :rtype: DetailedResponse with `dict` result representing a `LoadBalancerPool` object
"""
+ if not load_balancer_id:
+ raise ValueError('load_balancer_id must be provided')
+ if algorithm is None:
+ raise ValueError('algorithm must be provided')
+ if health_monitor is None:
+ raise ValueError('health_monitor must be provided')
+ if protocol is None:
+ raise ValueError('protocol must be provided')
+ health_monitor = convert_model(health_monitor)
+ if members is not None:
+ members = [convert_model(x) for x in members]
+ if session_persistence is not None:
+ session_persistence = convert_model(session_persistence)
headers = {}
sdk_headers = get_sdk_headers(
service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='list_endpoint_gateways',
+ operation_id='create_load_balancer_pool',
)
headers.update(sdk_headers)
params = {
'version': self.version,
'generation': self.generation,
+ }
+
+ data = {
+ 'algorithm': algorithm,
+ 'health_monitor': health_monitor,
+ 'protocol': protocol,
+ 'members': members,
'name': name,
- 'start': start,
- 'limit': limit,
- 'resource_group.id': resource_group_id,
- 'vpc.id': vpc_id,
- 'vpc.crn': vpc_crn,
- 'vpc.name': vpc_name,
- 'allow_dns_resolution_binding': allow_dns_resolution_binding,
+ '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'))
del kwargs['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}/pools'.format(**path_param_dict)
request = self.prepare_request(
- method='GET',
+ method='POST',
url=url,
headers=headers,
params=params,
+ data=data,
)
response = self.send(request, **kwargs)
return response
- def create_endpoint_gateway(
+ def delete_load_balancer_pool(
self,
- target: 'EndpointGatewayTargetPrototype',
- vpc: 'VPCIdentity',
- *,
- allow_dns_resolution_binding: bool = None,
- ips: List['EndpointGatewayReservedIP'] = None,
- name: str = None,
- resource_group: 'ResourceGroupIdentity' = None,
- security_groups: List['SecurityGroupIdentity'] = None,
+ load_balancer_id: str,
+ id: str,
**kwargs,
) -> DetailedResponse:
"""
- Create an endpoint gateway.
+ Delete a load balancer pool.
- 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 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 EndpointGatewayTargetPrototype target: The target to use for this
- endpoint gateway. Must not already be the target of another
- endpoint gateway in the VPC.
- :param VPCIdentity vpc: The VPC this endpoint gateway will reside in.
- :param bool allow_dns_resolution_binding: (optional) Indicates whether to
- allow DNS resolution for this endpoint gateway when the VPC this endpoint
- gateway resides in has a DNS resolution binding to a VPC with
- `dns.enable_hub` set to `true`.
- Must be `true` if the VPC this endpoint gateway resides in has
- `dns.enable_hub` set to
- `true`.
- :param List[EndpointGatewayReservedIP] ips: (optional) The reserved IPs to
- bind to this endpoint gateway. At most one reserved IP per zone is allowed.
- :param str name: (optional) The name for this endpoint gateway. The name
- must not be used by another endpoint gateway in the VPC. If unspecified,
- the name will be a hyphenated list of randomly-selected words.
- :param ResourceGroupIdentity resource_group: (optional) The resource group
- to use. If unspecified, the account's [default resource
- group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be
- used.
- :param List[SecurityGroupIdentity] security_groups: (optional) The security
- groups to use for this endpoint gateway. If unspecified, the VPC's default
- security group is used.
+ :param str load_balancer_id: The load balancer identifier.
+ :param str 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 `EndpointGateway` object
+ :rtype: DetailedResponse
"""
- if target is None:
- raise ValueError('target must be provided')
- if vpc is None:
- raise ValueError('vpc must be provided')
- target = convert_model(target)
- vpc = convert_model(vpc)
- if ips is not None:
- ips = [convert_model(x) for x in ips]
- if resource_group is not None:
- resource_group = convert_model(resource_group)
- if security_groups is not None:
- security_groups = [convert_model(x) for x in security_groups]
+ if not load_balancer_id:
+ raise ValueError('load_balancer_id must be provided')
+ if not id:
+ raise ValueError('id must be provided')
headers = {}
sdk_headers = get_sdk_headers(
service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='create_endpoint_gateway',
+ operation_id='delete_load_balancer_pool',
)
headers.update(sdk_headers)
@@ -21495,80 +22860,57 @@ def create_endpoint_gateway(
'generation': self.generation,
}
- data = {
- 'target': target,
- 'vpc': vpc,
- 'allow_dns_resolution_binding': allow_dns_resolution_binding,
- 'ips': ips,
- 'name': name,
- 'resource_group': resource_group,
- 'security_groups': security_groups,
- }
- data = {k: v for (k, v) in data.items() if v is not None}
- data = json.dumps(data)
- headers['content-type'] = 'application/json'
-
if 'headers' in kwargs:
headers.update(kwargs.get('headers'))
del kwargs['headers']
- headers['Accept'] = 'application/json'
- url = '/endpoint_gateways'
+ 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='POST',
+ method='DELETE',
url=url,
headers=headers,
params=params,
- data=data,
)
response = self.send(request, **kwargs)
return response
- def list_endpoint_gateway_ips(
+ def get_load_balancer_pool(
self,
- endpoint_gateway_id: str,
- *,
- start: str = None,
- limit: int = None,
- sort: str = None,
+ load_balancer_id: str,
+ id: str,
**kwargs,
) -> DetailedResponse:
"""
- List all reserved IPs bound to an endpoint gateway.
+ Retrieve a load balancer pool.
- This request lists all reserved IPs bound to an endpoint gateway.
+ This request retrieves a single pool specified by the identifier in the URL path.
- :param str endpoint_gateway_id: The endpoint gateway identifier.
- :param str start: (optional) A server-provided token determining what
- resource to start the page on.
- :param int limit: (optional) The number of resources to return on a page.
- :param str sort: (optional) Sorts the returned collection by the specified
- property name in ascending order. A `-` may be prepended to the name to
- sort in descending order. For example, the value `-created_at` sorts the
- collection by the `created_at` property in descending order, and the value
- `name` sorts it by the `name` property in ascending order.
+ :param str load_balancer_id: The load balancer identifier.
+ :param str 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 `ReservedIPCollectionEndpointGatewayContext` object
+ :rtype: DetailedResponse with `dict` result representing a `LoadBalancerPool` object
"""
- if not endpoint_gateway_id:
- raise ValueError('endpoint_gateway_id must be provided')
+ if not load_balancer_id:
+ raise ValueError('load_balancer_id must be provided')
+ if not id:
+ raise ValueError('id must be provided')
headers = {}
sdk_headers = get_sdk_headers(
service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='list_endpoint_gateway_ips',
+ operation_id='get_load_balancer_pool',
)
headers.update(sdk_headers)
params = {
'version': self.version,
'generation': self.generation,
- 'start': start,
- 'limit': limit,
- 'sort': sort,
}
if 'headers' in kwargs:
@@ -21576,10 +22918,10 @@ def list_endpoint_gateway_ips(
del kwargs['headers']
headers['Accept'] = 'application/json'
- path_param_keys = ['endpoint_gateway_id']
- path_param_values = self.encode_path_vars(endpoint_gateway_id)
+ path_param_keys = ['load_balancer_id', '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)
+ url = '/load_balancers/{load_balancer_id}/pools/{id}'.format(**path_param_dict)
request = self.prepare_request(
method='GET',
url=url,
@@ -21590,35 +22932,40 @@ def list_endpoint_gateway_ips(
response = self.send(request, **kwargs)
return response
- def remove_endpoint_gateway_ip(
+ def update_load_balancer_pool(
self,
- endpoint_gateway_id: str,
+ load_balancer_id: str,
id: str,
+ load_balancer_pool_patch: 'LoadBalancerPoolPatch',
**kwargs,
) -> DetailedResponse:
"""
- Unbind a reserved IP from an endpoint gateway.
+ Update a load balancer pool.
- 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 updates a load balancer pool from a pool 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 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
+ :rtype: DetailedResponse with `dict` result representing a `LoadBalancerPool` object
"""
- if not endpoint_gateway_id:
- raise ValueError('endpoint_gateway_id must be provided')
+ if not load_balancer_id:
+ raise ValueError('load_balancer_id must be provided')
if not id:
raise ValueError('id must be provided')
+ if load_balancer_pool_patch is None:
+ raise ValueError('load_balancer_pool_patch must be provided')
+ if isinstance(load_balancer_pool_patch, LoadBalancerPoolPatch):
+ load_balancer_pool_patch = convert_model(load_balancer_pool_patch)
headers = {}
sdk_headers = get_sdk_headers(
service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='remove_endpoint_gateway_ip',
+ operation_id='update_load_balancer_pool',
)
headers.update(sdk_headers)
@@ -21627,52 +22974,56 @@ def remove_endpoint_gateway_ip(
'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'))
del kwargs['headers']
+ headers['Accept'] = 'application/json'
- path_param_keys = ['endpoint_gateway_id', 'id']
- path_param_values = self.encode_path_vars(endpoint_gateway_id, id)
+ path_param_keys = ['load_balancer_id', '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)
+ url = '/load_balancers/{load_balancer_id}/pools/{id}'.format(**path_param_dict)
request = self.prepare_request(
- method='DELETE',
+ method='PATCH',
url=url,
headers=headers,
params=params,
+ data=data,
)
response = self.send(request, **kwargs)
return response
- def get_endpoint_gateway_ip(
+ def list_load_balancer_pool_members(
self,
- endpoint_gateway_id: str,
- id: str,
+ load_balancer_id: str,
+ pool_id: str,
**kwargs,
) -> DetailedResponse:
"""
- Retrieve a reserved IP bound to an endpoint gateway.
+ List all members of a load balancer pool.
- This request retrieves the specified reserved IP address if it is bound to the
- endpoint gateway specified in the URL.
+ This request lists all members of a load balancer pool.
- :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 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 `ReservedIP` object
+ :rtype: DetailedResponse with `dict` result representing a `LoadBalancerPoolMemberCollection` object
"""
- if not endpoint_gateway_id:
- raise ValueError('endpoint_gateway_id must be provided')
- if not id:
- raise ValueError('id must be provided')
+ if not load_balancer_id:
+ raise ValueError('load_balancer_id must be provided')
+ if not pool_id:
+ raise ValueError('pool_id must be provided')
headers = {}
sdk_headers = get_sdk_headers(
service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='get_endpoint_gateway_ip',
+ operation_id='list_load_balancer_pool_members',
)
headers.update(sdk_headers)
@@ -21686,10 +23037,10 @@ def get_endpoint_gateway_ip(
del kwargs['headers']
headers['Accept'] = 'application/json'
- path_param_keys = ['endpoint_gateway_id', 'id']
- path_param_values = self.encode_path_vars(endpoint_gateway_id, id)
+ path_param_keys = ['load_balancer_id', '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 = '/endpoint_gateways/{endpoint_gateway_id}/ips/{id}'.format(**path_param_dict)
+ url = '/load_balancers/{load_balancer_id}/pools/{pool_id}/members'.format(**path_param_dict)
request = self.prepare_request(
method='GET',
url=url,
@@ -21700,37 +23051,61 @@ def get_endpoint_gateway_ip(
response = self.send(request, **kwargs)
return response
- def add_endpoint_gateway_ip(
+ def create_load_balancer_pool_member(
self,
- endpoint_gateway_id: str,
- id: str,
+ load_balancer_id: str,
+ pool_id: str,
+ port: int,
+ target: 'LoadBalancerPoolMemberTargetPrototype',
+ *,
+ weight: Optional[int] = None,
**kwargs,
) -> DetailedResponse:
"""
- Bind a reserved IP to an endpoint gateway.
+ Create a member in a load balancer pool.
- 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 creates a new member and adds the member to the pool.
- :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 pool_id: The pool identifier.
+ :param int port: The port the member will receive load balancer traffic on.
+ Applies only to load balancer traffic received on a listener with a single
+ port. (If the traffic is received on a listener with a port range, the
+ member will receive the traffic on the same port the listener received it
+ on.)
+ This port will also be used for health checks unless the `port` property of
+ `health_monitor` property is specified.
+ The port must be unique across all members for all pools associated with
+ this pool's listener.
+ :param LoadBalancerPoolMemberTargetPrototype target: The pool member
+ target. Load balancers in the `network` family support virtual server
+ instances. Load balancers in the `application` family support IP addresses.
+ If the load
+ balancer has route mode enabled, the member must be in a zone the load
+ balancer has a
+ subnet in.
+ :param int weight: (optional) Weight of the server member. Applicable only
+ if the pool algorithm is
+ `weighted_round_robin`.
:param dict headers: A `dict` containing the request headers
:return: A `DetailedResponse` containing the result, headers and HTTP status code.
- :rtype: DetailedResponse with `dict` result representing a `ReservedIP` object
+ :rtype: DetailedResponse with `dict` result representing a `LoadBalancerPoolMember` object
"""
- if not endpoint_gateway_id:
- raise ValueError('endpoint_gateway_id must be provided')
- if not id:
- raise ValueError('id must be provided')
+ if not load_balancer_id:
+ raise ValueError('load_balancer_id must be provided')
+ if not pool_id:
+ raise ValueError('pool_id must be provided')
+ if port is None:
+ raise ValueError('port must be provided')
+ if target is None:
+ raise ValueError('target must be provided')
+ target = convert_model(target)
headers = {}
sdk_headers = get_sdk_headers(
service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='add_endpoint_gateway_ip',
+ operation_id='create_load_balancer_pool_member',
)
headers.update(sdk_headers)
@@ -21739,50 +23114,135 @@ def add_endpoint_gateway_ip(
'generation': self.generation,
}
+ data = {
+ 'port': port,
+ 'target': target,
+ 'weight': weight,
+ }
+ data = {k: v for (k, v) in data.items() if v is not None}
+ data = json.dumps(data)
+ headers['content-type'] = 'application/json'
+
if 'headers' in kwargs:
headers.update(kwargs.get('headers'))
del kwargs['headers']
headers['Accept'] = 'application/json'
- path_param_keys = ['endpoint_gateway_id', 'id']
- path_param_values = self.encode_path_vars(endpoint_gateway_id, id)
+ 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 = '/endpoint_gateways/{endpoint_gateway_id}/ips/{id}'.format(**path_param_dict)
+ 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 not load_balancer_id:
+ raise ValueError('load_balancer_id must be provided')
+ if not pool_id:
+ raise ValueError('pool_id must be provided')
+ if members is None:
+ raise ValueError('members must be provided')
+ members = [convert_model(x) for x in members]
+ headers = {}
+ sdk_headers = get_sdk_headers(
+ service_name=self.DEFAULT_SERVICE_NAME,
+ service_version='V1',
+ operation_id='replace_load_balancer_pool_members',
+ )
+ headers.update(sdk_headers)
+
+ 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'))
+ del kwargs['headers']
+ headers['Accept'] = 'application/json'
+
+ path_param_keys = ['load_balancer_id', 'pool_id']
+ path_param_values = self.encode_path_vars(load_balancer_id, pool_id)
+ path_param_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_endpoint_gateway(
+ def delete_load_balancer_pool_member(
self,
+ load_balancer_id: str,
+ pool_id: str,
id: str,
**kwargs,
) -> DetailedResponse:
"""
- Delete an endpoint gateway.
+ Delete a load balancer pool member.
- 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.
+ This request deletes a member from the pool. This operation cannot be reversed.
- :param str id: The endpoint gateway identifier.
+ :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 not load_balancer_id:
+ raise ValueError('load_balancer_id must be provided')
+ if not pool_id:
+ raise ValueError('pool_id must be provided')
if not id:
raise ValueError('id must be provided')
headers = {}
sdk_headers = get_sdk_headers(
service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='delete_endpoint_gateway',
+ operation_id='delete_load_balancer_pool_member',
)
headers.update(sdk_headers)
@@ -21795,10 +23255,10 @@ def delete_endpoint_gateway(
headers.update(kwargs.get('headers'))
del kwargs['headers']
- path_param_keys = ['id']
- path_param_values = self.encode_path_vars(id)
+ path_param_keys = ['load_balancer_id', '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 = '/endpoint_gateways/{id}'.format(**path_param_dict)
+ url = '/load_balancers/{load_balancer_id}/pools/{pool_id}/members/{id}'.format(**path_param_dict)
request = self.prepare_request(
method='DELETE',
url=url,
@@ -21809,30 +23269,38 @@ def delete_endpoint_gateway(
response = self.send(request, **kwargs)
return response
- def get_endpoint_gateway(
+ def get_load_balancer_pool_member(
self,
+ load_balancer_id: str,
+ pool_id: str,
id: str,
**kwargs,
) -> DetailedResponse:
"""
- Retrieve an endpoint gateway.
+ Retrieve a load balancer pool member.
- This request retrieves a single endpoint gateway specified by the identifier in
- the URL.
+ This request retrieves a single member specified by the identifier in the URL
+ path.
- :param str id: The endpoint gateway identifier.
+ :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 `EndpointGateway` object
+ :rtype: DetailedResponse with `dict` result representing a `LoadBalancerPoolMember` object
"""
+ if not load_balancer_id:
+ raise ValueError('load_balancer_id must be provided')
+ if not pool_id:
+ raise ValueError('pool_id must be provided')
if not id:
raise ValueError('id must be provided')
headers = {}
sdk_headers = get_sdk_headers(
service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='get_endpoint_gateway',
+ operation_id='get_load_balancer_pool_member',
)
headers.update(sdk_headers)
@@ -21846,10 +23314,10 @@ def get_endpoint_gateway(
del kwargs['headers']
headers['Accept'] = 'application/json'
- path_param_keys = ['id']
- path_param_values = self.encode_path_vars(id)
+ path_param_keys = ['load_balancer_id', '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 = '/endpoint_gateways/{id}'.format(**path_param_dict)
+ url = '/load_balancers/{load_balancer_id}/pools/{pool_id}/members/{id}'.format(**path_param_dict)
request = self.prepare_request(
method='GET',
url=url,
@@ -21860,36 +23328,44 @@ def get_endpoint_gateway(
response = self.send(request, **kwargs)
return response
- def update_endpoint_gateway(
+ def update_load_balancer_pool_member(
self,
+ load_balancer_id: str,
+ pool_id: str,
id: str,
- endpoint_gateway_patch: 'EndpointGatewayPatch',
+ load_balancer_pool_member_patch: 'LoadBalancerPoolMemberPatch',
**kwargs,
) -> DetailedResponse:
"""
- Update an endpoint gateway.
+ Update a load balancer pool member.
- This request updates an endpoint gateway's name.
+ This request updates an existing member from a member patch.
- :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 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 `EndpointGateway` object
+ :rtype: DetailedResponse with `dict` result representing a `LoadBalancerPoolMember` object
"""
+ if not load_balancer_id:
+ raise ValueError('load_balancer_id must be provided')
+ if not pool_id:
+ raise ValueError('pool_id must be provided')
if not id:
raise ValueError('id must be provided')
- if 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)
+ 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_endpoint_gateway',
+ operation_id='update_load_balancer_pool_member',
)
headers.update(sdk_headers)
@@ -21898,7 +23374,7 @@ def update_endpoint_gateway(
'generation': self.generation,
}
- data = json.dumps(endpoint_gateway_patch)
+ data = json.dumps(load_balancer_pool_member_patch)
headers['content-type'] = 'application/merge-patch+json'
if 'headers' in kwargs:
@@ -21906,10 +23382,10 @@ def update_endpoint_gateway(
del kwargs['headers']
headers['Accept'] = 'application/json'
- path_param_keys = ['id']
- path_param_values = self.encode_path_vars(id)
+ path_param_keys = ['load_balancer_id', '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 = '/endpoint_gateways/{id}'.format(**path_param_dict)
+ url = '/load_balancers/{load_balancer_id}/pools/{pool_id}/members/{id}'.format(**path_param_dict)
request = self.prepare_request(
method='PATCH',
url=url,
@@ -21922,74 +23398,69 @@ def update_endpoint_gateway(
return response
#########################
- # Flow log collectors
+ # Endpoint gateways
#########################
- def list_flow_log_collectors(
+ def list_endpoint_gateways(
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,
+ name: Optional[str] = None,
+ start: Optional[str] = None,
+ limit: Optional[int] = None,
+ resource_group_id: Optional[str] = None,
+ vpc_id: Optional[str] = None,
+ vpc_crn: Optional[str] = None,
+ vpc_name: Optional[str] = None,
+ allow_dns_resolution_binding: Optional[bool] = None,
**kwargs,
) -> DetailedResponse:
"""
- List all flow log collectors.
+ List all endpoint gateways.
- This request lists all flow log collectors in the region. A flow log collector
- summarizes data sent over the instance network interfaces contained within its
- target.
+ This request lists all endpoint gateways in the region. An endpoint gateway maps
+ one or more reserved IPs in a VPC to a target outside the VPC.
+ :param str name: (optional) Filters the collection to resources with a
+ `name` property matching the exact specified name.
:param str start: (optional) A server-provided token determining what
resource to start the page on.
:param int limit: (optional) The number of resources to return on a page.
:param str resource_group_id: (optional) Filters the collection to
resources with a `resource_group.id` property matching the specified
identifier.
- :param str name: (optional) Filters the collection to resources with a
- `name` property matching the exact specified name.
:param str vpc_id: (optional) Filters the collection to resources with a
`vpc.id` property matching the specified identifier.
:param str vpc_crn: (optional) Filters the collection to resources with a
`vpc.crn` property matching the specified CRN.
:param str vpc_name: (optional) Filters the collection to resources with a
`vpc.name` property matching the exact specified name.
- :param str target_id: (optional) Filters the collection to resources with a
- `target.id` property matching the specified identifier.
- :param str target_resource_type: (optional) Filters the collection to
- resources with a `target.resource_type` property matching the specified
- value.
+ :param bool allow_dns_resolution_binding: (optional) Filters the collection
+ to endpoint gateways with an `allow_dns_resolution_binding` property
+ matching the specified value.
:param dict headers: A `dict` containing the request headers
:return: A `DetailedResponse` containing the result, headers and HTTP status code.
- :rtype: DetailedResponse with `dict` result representing a `FlowLogCollectorCollection` object
+ :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_flow_log_collectors',
+ 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,
- 'name': name,
'vpc.id': vpc_id,
'vpc.crn': vpc_crn,
'vpc.name': vpc_name,
- 'target.id': target_id,
- 'target.resource_type': target_resource_type,
+ 'allow_dns_resolution_binding': allow_dns_resolution_binding,
}
if 'headers' in kwargs:
@@ -21997,7 +23468,7 @@ def list_flow_log_collectors(
del kwargs['headers']
headers['Accept'] = 'application/json'
- url = '/flow_log_collectors'
+ url = '/endpoint_gateways'
request = self.prepare_request(
method='GET',
url=url,
@@ -22008,63 +23479,69 @@ def list_flow_log_collectors(
response = self.send(request, **kwargs)
return response
- def create_flow_log_collector(
+ def create_endpoint_gateway(
self,
- storage_bucket: 'LegacyCloudObjectStorageBucketIdentity',
- target: 'FlowLogCollectorTargetPrototype',
+ target: 'EndpointGatewayTargetPrototype',
+ vpc: 'VPCIdentity',
*,
- active: bool = None,
- name: str = None,
- resource_group: 'ResourceGroupIdentity' = None,
+ allow_dns_resolution_binding: Optional[bool] = None,
+ ips: Optional[List['EndpointGatewayReservedIP']] = None,
+ name: Optional[str] = None,
+ resource_group: Optional['ResourceGroupIdentity'] = None,
+ security_groups: Optional[List['SecurityGroupIdentity']] = None,
**kwargs,
) -> DetailedResponse:
"""
- Create a flow log collector.
+ Create an endpoint gateway.
- This request creates and starts a new flow log collector from a flow log collector
- prototype object. The prototype object is structured in the same way as a
- retrieved flow log collector, and contains the information necessary to create and
- start the new flow log collector.
+ This request creates a new endpoint gateway. An endpoint gateway maps one or more
+ reserved IPs in a VPC to a target outside the VPC.
- :param LegacyCloudObjectStorageBucketIdentity storage_bucket: The Cloud
- Object Storage bucket where the collected flows will be logged.
- The bucket must exist and an IAM service authorization must grant
- `IBM Cloud Flow Logs` resources of `VPC Infrastructure Services` writer
- access to the bucket. For more information, see [Creating a flow log
- collector](https://cloud.ibm.com/docs/vpc?topic=vpc-ordering-flow-log-collector).
- :param FlowLogCollectorTargetPrototype target: The target this collector
- will collect flow logs for. If the target is an instance,
- subnet, or VPC, flow logs will not be collected for any instance network
- interfaces within
- the target that are themselves the target of a more specific flow log
- collector.
- :param bool active: (optional) Indicates whether this collector will be
- active upon creation.
- :param str name: (optional) The name for this flow log collector. The name
- must not be used by another flow log collector in the VPC. If unspecified,
+ :param EndpointGatewayTargetPrototype target: The target to use for this
+ endpoint gateway. Must not already be the target of another
+ endpoint gateway in the VPC.
+ :param VPCIdentity vpc: The VPC this endpoint gateway will reside in.
+ :param bool allow_dns_resolution_binding: (optional) Indicates whether to
+ allow DNS resolution for this endpoint gateway when the VPC this endpoint
+ gateway resides in has a DNS resolution binding to a VPC with
+ `dns.enable_hub` set to `true`.
+ Must be `true` if the VPC this endpoint gateway resides in has
+ `dns.enable_hub` set to
+ `true`.
+ :param List[EndpointGatewayReservedIP] ips: (optional) The reserved IPs to
+ bind to this endpoint gateway. At most one reserved IP per zone is allowed.
+ :param str name: (optional) The name for this endpoint gateway. The name
+ must not be used by another endpoint gateway in the VPC. If unspecified,
the name will be a hyphenated list of randomly-selected words.
:param ResourceGroupIdentity resource_group: (optional) The resource group
to use. If unspecified, the account's [default resource
group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be
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 `FlowLogCollector` object
+ :rtype: DetailedResponse with `dict` result representing a `EndpointGateway` 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)
+ 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_flow_log_collector',
+ operation_id='create_endpoint_gateway',
)
headers.update(sdk_headers)
@@ -22074,11 +23551,13 @@ def create_flow_log_collector(
}
data = {
- 'storage_bucket': storage_bucket,
'target': target,
- 'active': active,
+ 'vpc': vpc,
+ 'allow_dns_resolution_binding': allow_dns_resolution_binding,
+ '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)
@@ -22089,7 +23568,7 @@ def create_flow_log_collector(
del kwargs['headers']
headers['Accept'] = 'application/json'
- url = '/flow_log_collectors'
+ url = '/endpoint_gateways'
request = self.prepare_request(
method='POST',
url=url,
@@ -22101,50 +23580,63 @@ def create_flow_log_collector(
response = self.send(request, **kwargs)
return response
- def delete_flow_log_collector(
+ def list_endpoint_gateway_ips(
self,
- id: str,
+ endpoint_gateway_id: str,
+ *,
+ start: Optional[str] = None,
+ limit: Optional[int] = None,
+ sort: Optional[str] = None,
**kwargs,
) -> DetailedResponse:
"""
- Delete a flow log collector.
+ List all reserved IPs bound to an endpoint gateway.
- This request stops and deletes a flow log collector. This operation cannot be
- reversed.
- Collected flow logs remain available within the flow log collector's Cloud Object
- Storage bucket.
+ This request lists all reserved IPs bound to an endpoint gateway.
- :param str id: The flow log collector identifier.
+ :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
+ :rtype: DetailedResponse with `dict` result representing a `ReservedIPCollectionEndpointGatewayContext` object
"""
- if not id:
- raise ValueError('id must be provided')
+ if not endpoint_gateway_id:
+ raise ValueError('endpoint_gateway_id must be provided')
headers = {}
sdk_headers = get_sdk_headers(
service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='delete_flow_log_collector',
+ operation_id='list_endpoint_gateway_ips',
)
headers.update(sdk_headers)
params = {
'version': self.version,
'generation': self.generation,
+ 'start': start,
+ 'limit': limit,
+ 'sort': sort,
}
if 'headers' in kwargs:
headers.update(kwargs.get('headers'))
del kwargs['headers']
+ headers['Accept'] = 'application/json'
- path_param_keys = ['id']
- path_param_values = self.encode_path_vars(id)
+ 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 = '/flow_log_collectors/{id}'.format(**path_param_dict)
+ url = '/endpoint_gateways/{endpoint_gateway_id}/ips'.format(**path_param_dict)
request = self.prepare_request(
- method='DELETE',
+ method='GET',
url=url,
headers=headers,
params=params,
@@ -22153,30 +23645,35 @@ def delete_flow_log_collector(
response = self.send(request, **kwargs)
return response
- def get_flow_log_collector(
+ def remove_endpoint_gateway_ip(
self,
+ endpoint_gateway_id: str,
id: str,
**kwargs,
) -> DetailedResponse:
"""
- Retrieve a flow log collector.
+ Unbind a reserved IP from an endpoint gateway.
- This request retrieves a single flow log collector specified by the identifier in
- the URL.
+ 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 id: The flow log collector identifier.
+ :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 `FlowLogCollector` object
+ :rtype: DetailedResponse
"""
+ if not endpoint_gateway_id:
+ raise ValueError('endpoint_gateway_id must be provided')
if not id:
raise ValueError('id must be provided')
headers = {}
sdk_headers = get_sdk_headers(
service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='get_flow_log_collector',
+ operation_id='remove_endpoint_gateway_ip',
)
headers.update(sdk_headers)
@@ -22188,14 +23685,13 @@ def get_flow_log_collector(
if 'headers' in kwargs:
headers.update(kwargs.get('headers'))
del kwargs['headers']
- headers['Accept'] = 'application/json'
- path_param_keys = ['id']
- path_param_values = self.encode_path_vars(id)
+ path_param_keys = ['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 = '/flow_log_collectors/{id}'.format(**path_param_dict)
+ url = '/endpoint_gateways/{endpoint_gateway_id}/ips/{id}'.format(**path_param_dict)
request = self.prepare_request(
- method='GET',
+ method='DELETE',
url=url,
headers=headers,
params=params,
@@ -22204,39 +23700,34 @@ def get_flow_log_collector(
response = self.send(request, **kwargs)
return response
- def update_flow_log_collector(
+ def get_endpoint_gateway_ip(
self,
+ endpoint_gateway_id: str,
id: str,
- flow_log_collector_patch: 'FlowLogCollectorPatch',
**kwargs,
) -> DetailedResponse:
"""
- Update a flow log collector.
+ Retrieve a reserved IP bound to an endpoint gateway.
- This request updates a flow log collector with the information in a provided flow
- log collector patch. The flow log collector patch object is structured in the same
- way as a retrieved flow log collector and contains only the information to be
- updated.
+ This request retrieves the specified reserved IP address if it is bound to the
+ endpoint gateway specified in the URL.
- :param str id: The flow log collector identifier.
- :param FlowLogCollectorPatch flow_log_collector_patch: The flow log
- collector patch.
+ :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 `FlowLogCollector` object
+ :rtype: DetailedResponse with `dict` result representing a `ReservedIP` object
"""
+ if not endpoint_gateway_id:
+ raise ValueError('endpoint_gateway_id must be provided')
if not id:
raise ValueError('id must be provided')
- 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',
+ operation_id='get_endpoint_gateway_ip',
)
headers.update(sdk_headers)
@@ -22245,286 +23736,602 @@ def update_flow_log_collector(
'generation': self.generation,
}
- data = json.dumps(flow_log_collector_patch)
- headers['content-type'] = 'application/merge-patch+json'
-
if 'headers' in kwargs:
headers.update(kwargs.get('headers'))
del kwargs['headers']
headers['Accept'] = 'application/json'
- path_param_keys = ['id']
- path_param_values = self.encode_path_vars(id)
+ path_param_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 = '/flow_log_collectors/{id}'.format(**path_param_dict)
+ url = '/endpoint_gateways/{endpoint_gateway_id}/ips/{id}'.format(**path_param_dict)
request = self.prepare_request(
- method='PATCH',
+ method='GET',
url=url,
headers=headers,
params=params,
- data=data,
)
response = self.send(request, **kwargs)
return response
-
-class ListVpcDnsResolutionBindingsEnums:
- """
- Enums for list_vpc_dns_resolution_bindings 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 add_endpoint_gateway_ip(
+ self,
+ endpoint_gateway_id: str,
+ id: str,
+ **kwargs,
+ ) -> DetailedResponse:
"""
+ Bind a reserved IP to an endpoint gateway.
- CREATED_AT = 'created_at'
- NAME = 'name'
-
-
-class ListSubnetReservedIpsEnums:
- """
- Enums for list_subnet_reserved_ips parameters.
- """
+ This request binds the specified reserved IP to the specified endpoint gateway.
+ The reserved IP:
+ - must currently be unbound, or not required by its target
+ - must not be in the same zone as any other reserved IP bound to the endpoint
+ gateway.
- class Sort(str, Enum):
- """
- Sorts the returned collection by the specified property name in ascending order. A
- `-` may be prepended to the name to sort in descending order. For example, the
- value `-created_at` sorts the collection by the `created_at` property in
- descending order, and the value `name` sorts it by the `name` property in
- ascending order.
+ :param str 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
"""
- ADDRESS = 'address'
- CREATED_AT = 'created_at'
- NAME = 'name'
-
+ if not endpoint_gateway_id:
+ raise ValueError('endpoint_gateway_id must be provided')
+ if not id:
+ raise ValueError('id must be provided')
+ headers = {}
+ sdk_headers = get_sdk_headers(
+ service_name=self.DEFAULT_SERVICE_NAME,
+ service_version='V1',
+ operation_id='add_endpoint_gateway_ip',
+ )
+ headers.update(sdk_headers)
-class ListImagesEnums:
- """
- Enums for list_images parameters.
- """
+ params = {
+ 'version': self.version,
+ 'generation': self.generation,
+ }
- class Status(str, Enum):
- """
- Filters the collection to images with a `status` property matching one of the
- specified comma-separated values.
- """
+ if 'headers' in kwargs:
+ headers.update(kwargs.get('headers'))
+ del kwargs['headers']
+ headers['Accept'] = 'application/json'
- AVAILABLE = 'available'
- DELETING = 'deleting'
- DEPRECATED = 'deprecated'
- FAILED = 'failed'
- OBSOLETE = 'obsolete'
- PENDING = 'pending'
- UNUSABLE = 'unusable'
- class Visibility(str, Enum):
- """
- Filters the collection to images with a `visibility` property matching the
- specified value.
- """
+ 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,
+ )
- PRIVATE = 'private'
- PUBLIC = 'public'
+ response = self.send(request, **kwargs)
+ return response
+ def delete_endpoint_gateway(
+ self,
+ id: str,
+ **kwargs,
+ ) -> DetailedResponse:
+ """
+ Delete an endpoint gateway.
-class ListBackupPolicyJobsEnums:
- """
- Enums for list_backup_policy_jobs parameters.
- """
+ 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.
- class Status(str, Enum):
- """
- Filters the collection to backup policy jobs with a `status` property matching the
- specified value.
+ :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
"""
- FAILED = 'failed'
- RUNNING = 'running'
- SUCCEEDED = 'succeeded'
- class Sort(str, Enum):
- """
- Sorts the returned collection by the specified property name in ascending order. A
- `-` may be prepended to the name to sort in descending order. For example, the
- value `-created_at` sorts the collection by the `created_at` property in
- descending order, and the value `name` sorts it by the `name` property in
- ascending order.
- """
+ if not id:
+ raise ValueError('id must be provided')
+ headers = {}
+ sdk_headers = get_sdk_headers(
+ service_name=self.DEFAULT_SERVICE_NAME,
+ service_version='V1',
+ operation_id='delete_endpoint_gateway',
+ )
+ headers.update(sdk_headers)
- CREATED_AT = 'created_at'
- NAME = 'name'
+ params = {
+ 'version': self.version,
+ 'generation': self.generation,
+ }
+ if 'headers' in kwargs:
+ headers.update(kwargs.get('headers'))
+ del kwargs['headers']
-class ListVolumesEnums:
- """
- Enums for list_volumes parameters.
- """
+ 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,
+ )
- class AttachmentState(str, Enum):
- """
- Filters the collection to volumes with an `attachment_state` property matching the
- specified value.
- """
+ response = self.send(request, **kwargs)
+ return response
- ATTACHED = 'attached'
- UNATTACHED = 'unattached'
- UNUSABLE = 'unusable'
- class Encryption(str, Enum):
- """
- Filters the collection to resources with an `encryption` property matching the
- specified value.
+ def get_endpoint_gateway(
+ self,
+ id: str,
+ **kwargs,
+ ) -> DetailedResponse:
"""
+ Retrieve an endpoint gateway.
- PROVIDER_MANAGED = 'provider_managed'
- USER_MANAGED = 'user_managed'
-
-
-class ListSnapshotsEnums:
- """
- Enums for list_snapshots parameters.
- """
+ This request retrieves a single endpoint gateway specified by the identifier in
+ the URL.
- class Sort(str, Enum):
- """
- Sorts the returned collection by the specified property name in ascending order. A
- `-` may be prepended to the name to sort in descending order. For example, the
- value `-created_at` sorts the collection by the `created_at` property in
- descending order, and the value `name` sorts it by the `name` property in
- ascending order.
+ :param str 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
"""
- CREATED_AT = 'created_at'
- NAME = 'name'
-
-
-class ListShareProfilesEnums:
- """
- Enums for list_share_profiles parameters.
- """
+ if not id:
+ raise ValueError('id must be provided')
+ headers = {}
+ sdk_headers = get_sdk_headers(
+ service_name=self.DEFAULT_SERVICE_NAME,
+ service_version='V1',
+ operation_id='get_endpoint_gateway',
+ )
+ headers.update(sdk_headers)
- class Sort(str, Enum):
- """
- Sorts the returned collection by the specified property name in ascending order. A
- `-` may be prepended to the name to sort in descending order. For example, the
- value `-created_at` sorts the collection by the `created_at` property in
- descending order, and the value `name` sorts it by the `name` property in
- ascending order.
- """
+ params = {
+ 'version': self.version,
+ 'generation': self.generation,
+ }
- CREATED_AT = 'created_at'
- NAME = 'name'
+ if 'headers' in kwargs:
+ headers.update(kwargs.get('headers'))
+ del kwargs['headers']
+ headers['Accept'] = 'application/json'
+ path_param_keys = ['id']
+ path_param_values = self.encode_path_vars(id)
+ path_param_dict = dict(zip(path_param_keys, path_param_values))
+ url = '/endpoint_gateways/{id}'.format(**path_param_dict)
+ request = self.prepare_request(
+ method='GET',
+ url=url,
+ headers=headers,
+ params=params,
+ )
-class ListSharesEnums:
- """
- Enums for list_shares parameters.
- """
+ response = self.send(request, **kwargs)
+ return response
- class Sort(str, Enum):
- """
- Sorts the returned collection by the specified property name in ascending order. A
- `-` may be prepended to the name to sort in descending order. For example, the
- value `-created_at` sorts the collection by the `created_at` property in
- descending order, and the value `name` sorts it by the `name` property in
- ascending order.
+ def update_endpoint_gateway(
+ self,
+ id: str,
+ endpoint_gateway_patch: 'EndpointGatewayPatch',
+ **kwargs,
+ ) -> DetailedResponse:
"""
+ Update an endpoint gateway.
- CREATED_AT = 'created_at'
- NAME = 'name'
- class ReplicationRole(str, Enum):
- """
- Filters the collection to file shares with a `replication_role` property matching
- the specified value.
+ 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
"""
- NONE = 'none'
- REPLICA = 'replica'
- SOURCE = 'source'
+ if not id:
+ raise ValueError('id must be provided')
+ if endpoint_gateway_patch is None:
+ raise ValueError('endpoint_gateway_patch must be provided')
+ if isinstance(endpoint_gateway_patch, EndpointGatewayPatch):
+ endpoint_gateway_patch = convert_model(endpoint_gateway_patch)
+ headers = {}
+ sdk_headers = get_sdk_headers(
+ service_name=self.DEFAULT_SERVICE_NAME,
+ service_version='V1',
+ operation_id='update_endpoint_gateway',
+ )
+ headers.update(sdk_headers)
+ params = {
+ 'version': self.version,
+ 'generation': self.generation,
+ }
-class ListFloatingIpsEnums:
- """
- Enums for list_floating_ips parameters.
- """
+ data = json.dumps(endpoint_gateway_patch)
+ headers['content-type'] = 'application/merge-patch+json'
- class Sort(str, Enum):
- """
- Sorts the returned collection by the specified property name in ascending order. A
- `-` may be prepended to the name to sort in descending order. For example, the
- value `-created_at` sorts the collection by the `created_at` property in
- descending order, and the value `name` sorts it by the `name` property in
- ascending order.
- """
+ if 'headers' in kwargs:
+ headers.update(kwargs.get('headers'))
+ del kwargs['headers']
+ headers['Accept'] = 'application/json'
- CREATED_AT = 'created_at'
- NAME = '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 = '/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
-class ListNetworkAclRulesEnums:
- """
- Enums for list_network_acl_rules parameters.
- """
+ #########################
+ # Flow log collectors
+ #########################
- class Direction(str, Enum):
- """
- Filters the collection to rules with a `direction` property matching the specified
- value.
+ def list_flow_log_collectors(
+ self,
+ *,
+ start: Optional[str] = None,
+ limit: Optional[int] = None,
+ resource_group_id: Optional[str] = None,
+ name: Optional[str] = None,
+ vpc_id: Optional[str] = None,
+ vpc_crn: Optional[str] = None,
+ vpc_name: Optional[str] = None,
+ target_id: Optional[str] = None,
+ target_resource_type: Optional[str] = None,
+ **kwargs,
+ ) -> DetailedResponse:
"""
+ List all flow log collectors.
- INBOUND = 'inbound'
- OUTBOUND = 'outbound'
-
-
-class ListVpnGatewaysEnums:
- """
- Enums for list_vpn_gateways parameters.
- """
+ This request lists all flow log collectors in the region. A flow log collector
+ summarizes data sent over the instance network interfaces and instance network
+ attachments contained within its target.
- class Sort(str, Enum):
- """
- Sorts the returned collection by the specified property name in ascending order. A
- `-` may be prepended to the name to sort in descending order. For example, the
- value `-created_at` sorts the collection by the `created_at` property in
- descending order, and the value `name` sorts it by the `name` property in
- ascending order.
+ :param str start: (optional) A server-provided token determining what
+ resource to start the page on.
+ :param int limit: (optional) The number of resources to return on a page.
+ :param str resource_group_id: (optional) Filters the collection to
+ resources with a `resource_group.id` property matching the specified
+ identifier.
+ :param str name: (optional) Filters the collection to resources with a
+ `name` property matching the exact specified name.
+ :param str vpc_id: (optional) Filters the collection to resources with a
+ `vpc.id` property matching the specified identifier.
+ :param str vpc_crn: (optional) Filters the collection to resources with a
+ `vpc.crn` property matching the specified CRN.
+ :param str vpc_name: (optional) Filters the collection to resources with a
+ `vpc.name` property matching the exact specified name.
+ :param str target_id: (optional) Filters the collection to resources with a
+ `target.id` property matching the specified identifier.
+ :param str target_resource_type: (optional) Filters the collection to
+ resources with a `target.resource_type` property matching the specified
+ value.
+ :param dict headers: A `dict` containing the request headers
+ :return: A `DetailedResponse` containing the result, headers and HTTP status code.
+ :rtype: DetailedResponse with `dict` result representing a `FlowLogCollectorCollection` object
"""
- CREATED_AT = 'created_at'
- NAME = 'name'
- class Mode(str, Enum):
- """
- Filters the collection to VPN gateways with a `mode` property matching the
- specified value.
- """
+ 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)
- POLICY = 'policy'
- ROUTE = 'route'
+ params = {
+ 'version': self.version,
+ 'generation': self.generation,
+ 'start': start,
+ 'limit': limit,
+ 'resource_group.id': resource_group_id,
+ 'name': name,
+ 'vpc.id': vpc_id,
+ 'vpc.crn': vpc_crn,
+ 'vpc.name': vpc_name,
+ 'target.id': target_id,
+ 'target.resource_type': target_resource_type,
+ }
+
+ if 'headers' in kwargs:
+ headers.update(kwargs.get('headers'))
+ del kwargs['headers']
+ headers['Accept'] = 'application/json'
+ url = '/flow_log_collectors'
+ request = self.prepare_request(
+ method='GET',
+ url=url,
+ headers=headers,
+ params=params,
+ )
-class ListVpnGatewayConnectionsEnums:
- """
- Enums for list_vpn_gateway_connections parameters.
- """
+ response = self.send(request, **kwargs)
+ return response
- class Status(str, Enum):
- """
- Filters the collection to VPN gateway connections with a `status` property
- matching the specified value.
+ def create_flow_log_collector(
+ self,
+ storage_bucket: 'LegacyCloudObjectStorageBucketIdentity',
+ target: 'FlowLogCollectorTargetPrototype',
+ *,
+ active: Optional[bool] = None,
+ name: Optional[str] = None,
+ resource_group: Optional['ResourceGroupIdentity'] = None,
+ **kwargs,
+ ) -> DetailedResponse:
"""
+ Create a flow log collector.
- DOWN = 'down'
- UP = 'up'
+ This request creates and starts a new flow log collector from a flow log collector
+ prototype object. The prototype object is structured in the same way as a
+ retrieved flow log collector, and contains the information necessary to create and
+ start the new flow log collector.
+ :param LegacyCloudObjectStorageBucketIdentity storage_bucket: The Cloud
+ Object Storage bucket where the collected flows will be logged.
+ The bucket must exist and an IAM service authorization must grant
+ `IBM Cloud Flow Logs` resources of `VPC Infrastructure Services` writer
+ access to the bucket. For more information, see [Creating a flow log
+ collector](https://cloud.ibm.com/docs/vpc?topic=vpc-ordering-flow-log-collector).
+ :param FlowLogCollectorTargetPrototype target: The target this collector
+ will collect flow logs for.
+ If the target is an instance, subnet, or VPC, flow logs will not be
+ collected for any
+ instance network attachments, virtual network interfaces or instance
+ network interfaces
+ within the target that are themselves the target of a more specific flow
+ log collector.
+ The target must not be a virtual network interface that is attached to a
+ bare metal server
+ network attachment or to a file share mount target.
+ :param bool active: (optional) Indicates whether this collector will be
+ active upon creation.
+ :param str name: (optional) The name for this flow log collector. The name
+ must not be used by another flow log collector in the VPC. If unspecified,
+ the name will be a hyphenated list of randomly-selected words.
+ :param ResourceGroupIdentity resource_group: (optional) The resource group
+ to use. If unspecified, the account's [default resource
+ group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be
+ 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
+ """
-class ListVpnServersEnums:
+ if storage_bucket is None:
+ raise ValueError('storage_bucket must be provided')
+ if target is None:
+ raise ValueError('target must be provided')
+ storage_bucket = convert_model(storage_bucket)
+ target = convert_model(target)
+ if resource_group is not None:
+ resource_group = convert_model(resource_group)
+ headers = {}
+ sdk_headers = get_sdk_headers(
+ service_name=self.DEFAULT_SERVICE_NAME,
+ service_version='V1',
+ operation_id='create_flow_log_collector',
+ )
+ headers.update(sdk_headers)
+
+ params = {
+ 'version': self.version,
+ 'generation': self.generation,
+ }
+
+ data = {
+ 'storage_bucket': storage_bucket,
+ 'target': target,
+ 'active': active,
+ 'name': name,
+ 'resource_group': resource_group,
+ }
+ data = {k: v for (k, v) in data.items() if v is not None}
+ data = json.dumps(data)
+ headers['content-type'] = 'application/json'
+
+ if 'headers' in kwargs:
+ headers.update(kwargs.get('headers'))
+ del kwargs['headers']
+ headers['Accept'] = 'application/json'
+
+ url = '/flow_log_collectors'
+ request = self.prepare_request(
+ method='POST',
+ url=url,
+ headers=headers,
+ params=params,
+ data=data,
+ )
+
+ response = self.send(request, **kwargs)
+ return response
+
+ def delete_flow_log_collector(
+ self,
+ id: str,
+ **kwargs,
+ ) -> DetailedResponse:
+ """
+ Delete a flow log collector.
+
+ This request stops and deletes a flow log collector. This operation cannot be
+ reversed.
+ Collected flow logs remain available within the flow log collector's Cloud Object
+ Storage bucket.
+
+ :param str id: The flow log collector identifier.
+ :param dict headers: A `dict` containing the request headers
+ :return: A `DetailedResponse` containing the result, headers and HTTP status code.
+ :rtype: DetailedResponse
+ """
+
+ if not id:
+ raise ValueError('id must be provided')
+ headers = {}
+ sdk_headers = get_sdk_headers(
+ service_name=self.DEFAULT_SERVICE_NAME,
+ service_version='V1',
+ operation_id='delete_flow_log_collector',
+ )
+ headers.update(sdk_headers)
+
+ params = {
+ 'version': self.version,
+ 'generation': self.generation,
+ }
+
+ if 'headers' in kwargs:
+ headers.update(kwargs.get('headers'))
+ del kwargs['headers']
+
+ path_param_keys = ['id']
+ path_param_values = self.encode_path_vars(id)
+ path_param_dict = dict(zip(path_param_keys, path_param_values))
+ url = '/flow_log_collectors/{id}'.format(**path_param_dict)
+ request = self.prepare_request(
+ method='DELETE',
+ url=url,
+ headers=headers,
+ params=params,
+ )
+
+ response = self.send(request, **kwargs)
+ return response
+
+ def get_flow_log_collector(
+ self,
+ id: str,
+ **kwargs,
+ ) -> DetailedResponse:
+ """
+ Retrieve a flow log collector.
+
+ This request retrieves a single flow log collector specified by the identifier in
+ the URL.
+
+ :param str id: The flow log collector identifier.
+ :param dict headers: A `dict` containing the request headers
+ :return: A `DetailedResponse` containing the result, headers and HTTP status code.
+ :rtype: DetailedResponse with `dict` result representing a `FlowLogCollector` object
+ """
+
+ if not id:
+ raise ValueError('id must be provided')
+ headers = {}
+ sdk_headers = get_sdk_headers(
+ service_name=self.DEFAULT_SERVICE_NAME,
+ service_version='V1',
+ operation_id='get_flow_log_collector',
+ )
+ headers.update(sdk_headers)
+
+ params = {
+ 'version': self.version,
+ 'generation': self.generation,
+ }
+
+ if 'headers' in kwargs:
+ headers.update(kwargs.get('headers'))
+ del kwargs['headers']
+ headers['Accept'] = 'application/json'
+
+ path_param_keys = ['id']
+ path_param_values = self.encode_path_vars(id)
+ path_param_dict = dict(zip(path_param_keys, path_param_values))
+ url = '/flow_log_collectors/{id}'.format(**path_param_dict)
+ request = self.prepare_request(
+ method='GET',
+ url=url,
+ headers=headers,
+ params=params,
+ )
+
+ response = self.send(request, **kwargs)
+ return response
+
+ def update_flow_log_collector(
+ self,
+ id: str,
+ flow_log_collector_patch: 'FlowLogCollectorPatch',
+ **kwargs,
+ ) -> DetailedResponse:
+ """
+ Update a flow log collector.
+
+ This request updates a flow log collector with the information in a provided flow
+ log collector patch. The flow log collector patch object is structured in the same
+ way as a retrieved flow log collector and contains only the information to be
+ updated.
+
+ :param str id: The flow log collector identifier.
+ :param FlowLogCollectorPatch flow_log_collector_patch: The flow log
+ collector patch.
+ :param dict headers: A `dict` containing the request headers
+ :return: A `DetailedResponse` containing the result, headers and HTTP status code.
+ :rtype: DetailedResponse with `dict` result representing a `FlowLogCollector` object
+ """
+
+ if not id:
+ raise ValueError('id must be provided')
+ if flow_log_collector_patch is None:
+ raise ValueError('flow_log_collector_patch must be provided')
+ if isinstance(flow_log_collector_patch, FlowLogCollectorPatch):
+ flow_log_collector_patch = convert_model(flow_log_collector_patch)
+ headers = {}
+ sdk_headers = get_sdk_headers(
+ service_name=self.DEFAULT_SERVICE_NAME,
+ service_version='V1',
+ operation_id='update_flow_log_collector',
+ )
+ headers.update(sdk_headers)
+
+ params = {
+ 'version': self.version,
+ 'generation': self.generation,
+ }
+
+ data = json.dumps(flow_log_collector_patch)
+ headers['content-type'] = 'application/merge-patch+json'
+
+ if 'headers' in kwargs:
+ headers.update(kwargs.get('headers'))
+ del kwargs['headers']
+ headers['Accept'] = 'application/json'
+
+ path_param_keys = ['id']
+ path_param_values = self.encode_path_vars(id)
+ path_param_dict = dict(zip(path_param_keys, path_param_values))
+ url = '/flow_log_collectors/{id}'.format(**path_param_dict)
+ request = self.prepare_request(
+ method='PATCH',
+ url=url,
+ headers=headers,
+ params=params,
+ data=data,
+ )
+
+ response = self.send(request, **kwargs)
+ return response
+
+
+class ListVpcDnsResolutionBindingsEnums:
"""
- Enums for list_vpn_servers parameters.
+ Enums for list_vpc_dns_resolution_bindings parameters.
"""
class Sort(str, Enum):
@@ -22540,9 +24347,9 @@ class Sort(str, Enum):
NAME = 'name'
-class ListVpnServerClientsEnums:
+class ListSubnetReservedIpsEnums:
"""
- Enums for list_vpn_server_clients parameters.
+ Enums for list_subnet_reserved_ips parameters.
"""
class Sort(str, Enum):
@@ -22550,17 +24357,57 @@ 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.
+ descending order, and the value `name` sorts it by the `name` property in
+ ascending order.
"""
+ ADDRESS = 'address'
CREATED_AT = 'created_at'
+ NAME = 'name'
-class ListVpnServerRoutesEnums:
+class ListImagesEnums:
"""
- Enums for list_vpn_server_routes parameters.
+ Enums for list_images parameters.
+ """
+
+ class Status(str, Enum):
+ """
+ Filters the collection to images with a `status` property matching one of the
+ specified comma-separated values.
+ """
+
+ AVAILABLE = 'available'
+ DELETING = 'deleting'
+ DEPRECATED = 'deprecated'
+ FAILED = 'failed'
+ OBSOLETE = 'obsolete'
+ PENDING = 'pending'
+ UNUSABLE = 'unusable'
+ class Visibility(str, Enum):
+ """
+ Filters the collection to images with a `visibility` property matching the
+ specified value.
+ """
+
+ PRIVATE = 'private'
+ PUBLIC = 'public'
+
+
+class ListBackupPolicyJobsEnums:
+ """
+ Enums for list_backup_policy_jobs parameters.
"""
+ class Status(str, Enum):
+ """
+ Filters the collection to backup policy jobs with a `status` property matching the
+ specified value.
+ """
+
+ FAILED = 'failed'
+ RUNNING = 'running'
+ SUCCEEDED = 'succeeded'
class Sort(str, Enum):
"""
Sorts the returned collection by the specified property name in ascending order. A
@@ -22574,9 +24421,33 @@ class Sort(str, Enum):
NAME = 'name'
-class ListEndpointGatewayIpsEnums:
+class ListVolumesEnums:
"""
- Enums for list_endpoint_gateway_ips parameters.
+ Enums for list_volumes parameters.
+ """
+
+ class AttachmentState(str, Enum):
+ """
+ Filters the collection to volumes with an `attachment_state` property matching the
+ specified value.
+ """
+
+ ATTACHED = 'attached'
+ UNATTACHED = 'unattached'
+ UNUSABLE = 'unusable'
+ class Encryption(str, Enum):
+ """
+ Filters the collection to resources with an `encryption` property matching the
+ specified value.
+ """
+
+ PROVIDER_MANAGED = 'provider_managed'
+ USER_MANAGED = 'user_managed'
+
+
+class ListSnapshotConsistencyGroupsEnums:
+ """
+ Enums for list_snapshot_consistency_groups parameters.
"""
class Sort(str, Enum):
@@ -22588,186 +24459,429 @@ class Sort(str, Enum):
ascending order.
"""
- ADDRESS = 'address'
CREATED_AT = 'created_at'
NAME = 'name'
-##############################################################################
-# Models
-##############################################################################
+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.
+ """
-class AccountReference:
+ CREATED_AT = 'created_at'
+ NAME = 'name'
+
+
+class ListShareProfilesEnums:
"""
- AccountReference.
+ Enums for list_share_profiles parameters.
+ """
+
+ class Sort(str, Enum):
+ """
+ Sorts the returned collection by the specified property name in ascending order. A
+ `-` may be prepended to the name to sort in descending order. For example, the
+ value `-created_at` sorts the collection by the `created_at` property in
+ descending order, and the value `name` sorts it by the `name` property in
+ ascending order.
+ """
- :attr str id: The unique identifier for this account.
- :attr str resource_type: The resource type.
+ CREATED_AT = 'created_at'
+ NAME = 'name'
+
+
+class ListSharesEnums:
+ """
+ Enums for list_shares parameters.
"""
- def __init__(
- self,
- id: str,
- resource_type: str,
- ) -> None:
+ 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.
"""
- Initialize a AccountReference object.
- :param str id: The unique identifier for this account.
- :param str resource_type: The resource type.
+ CREATED_AT = 'created_at'
+ NAME = 'name'
+ class ReplicationRole(str, Enum):
+ """
+ Filters the collection to file shares with a `replication_role` property matching
+ the specified value.
"""
- self.id = id
- self.resource_type = resource_type
- @classmethod
- def from_dict(cls, _dict: Dict) -> 'AccountReference':
- """Initialize a AccountReference object from a json dictionary."""
- args = {}
- if 'id' in _dict:
- args['id'] = _dict.get('id')
- else:
- raise ValueError('Required property \'id\' not present in AccountReference JSON')
- if 'resource_type' in _dict:
- args['resource_type'] = _dict.get('resource_type')
- else:
- raise ValueError('Required property \'resource_type\' not present in AccountReference JSON')
- return cls(**args)
+ NONE = 'none'
+ REPLICA = 'replica'
+ SOURCE = 'source'
- @classmethod
- def _from_dict(cls, _dict):
- """Initialize a AccountReference object from a json dictionary."""
- return cls.from_dict(_dict)
- def to_dict(self) -> Dict:
- """Return a json dictionary representing this model."""
- _dict = {}
- if hasattr(self, 'id') and self.id is not None:
- _dict['id'] = self.id
- if hasattr(self, 'resource_type') and self.resource_type is not None:
- _dict['resource_type'] = self.resource_type
- return _dict
+class ListNetworkInterfaceFloatingIpsEnums:
+ """
+ Enums for list_network_interface_floating_ips parameters.
+ """
- def _to_dict(self):
- """Return a json dictionary representing this model."""
- return self.to_dict()
+ 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
+ `-name` sorts the collection by the `name` property in descending order, and the
+ value `name` sorts it by the `name` property in ascending order.
+ """
- def __str__(self) -> str:
- """Return a `str` version of this AccountReference object."""
- return json.dumps(self.to_dict(), indent=2)
+ ADDRESS = 'address'
+ NAME = 'name'
- def __eq__(self, other: 'AccountReference') -> bool:
- """Return `true` when self and other are equal, false otherwise."""
- if not isinstance(other, self.__class__):
- return False
- return self.__dict__ == other.__dict__
- def __ne__(self, other: 'AccountReference') -> bool:
- """Return `true` when self and other are not equal, false otherwise."""
- return not self == other
+class ListVirtualNetworkInterfaceIpsEnums:
+ """
+ Enums for list_virtual_network_interface_ips parameters.
+ """
- class ResourceTypeEnum(str, Enum):
+ class Sort(str, Enum):
"""
- The resource type.
+ 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
+ `-name` sorts the collection by the `name` property in descending order, and the
+ value `name` sorts it by the `name` property in ascending order.
"""
- ACCOUNT = 'account'
-
+ ADDRESS = 'address'
+ NAME = 'name'
-class AddressPrefix:
+class ListFloatingIpsEnums:
"""
- AddressPrefix.
-
- :attr str cidr: The CIDR block for this prefix.
- :attr datetime created_at: The date and time that the prefix was created.
- :attr bool has_subnets: Indicates whether subnets exist with addresses from this
- prefix.
- :attr str href: The URL for this address prefix.
- :attr str id: The unique identifier for this address prefix.
- :attr bool is_default: Indicates whether this is the default prefix for this
- zone in this VPC. If a default prefix was automatically created when the VPC was
- created, the prefix is automatically named using a hyphenated list of
- randomly-selected words, but may be changed.
- :attr str name: The name for this address prefix. The name must not be used by
- another address prefix for the VPC.
- :attr ZoneReference zone: The zone this address prefix resides in.
+ Enums for list_floating_ips parameters.
"""
- def __init__(
- self,
- cidr: str,
- created_at: datetime,
- has_subnets: bool,
- href: str,
- id: str,
- is_default: bool,
- name: str,
- zone: 'ZoneReference',
- ) -> None:
+ class Sort(str, Enum):
"""
- Initialize a AddressPrefix object.
-
- :param str cidr: The CIDR block for this prefix.
- :param datetime created_at: The date and time that the prefix was created.
- :param bool has_subnets: Indicates whether subnets exist with addresses
- from this prefix.
- :param str href: The URL for this address prefix.
- :param str id: The unique identifier for this address prefix.
- :param bool is_default: Indicates whether this is the default prefix for
- this zone in this VPC. If a default prefix was automatically created when
- the VPC was created, the prefix is automatically named using a hyphenated
- list of randomly-selected words, but may be changed.
- :param str name: The name for this address prefix. The name must not be
- used by another address prefix for the VPC.
- :param ZoneReference zone: The zone this address prefix resides in.
+ Sorts the returned collection by the specified property name in ascending order. A
+ `-` may be prepended to the name to sort in descending order. For example, the
+ value `-created_at` sorts the collection by the `created_at` property in
+ descending order, and the value `name` sorts it by the `name` property in
+ ascending order.
"""
- self.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)
+ CREATED_AT = 'created_at'
+ NAME = 'name'
+
+
+class ListNetworkAclRulesEnums:
+ """
+ Enums for list_network_acl_rules parameters.
+ """
+
+ class Direction(str, Enum):
+ """
+ Filters the collection to rules with a `direction` property matching the specified
+ value.
+ """
+
+ INBOUND = 'inbound'
+ OUTBOUND = 'outbound'
+
+
+class ListVpnGatewaysEnums:
+ """
+ Enums for list_vpn_gateways parameters.
+ """
+
+ class Sort(str, Enum):
+ """
+ Sorts the returned collection by the specified property name in ascending order. A
+ `-` may be prepended to the name to sort in descending order. For example, the
+ value `-created_at` sorts the collection by the `created_at` property in
+ descending order, and the value `name` sorts it by the `name` property in
+ ascending order.
+ """
+
+ CREATED_AT = 'created_at'
+ NAME = 'name'
+ class Mode(str, Enum):
+ """
+ Filters the collection to VPN gateways with a `mode` property matching the
+ specified value.
+ """
+
+ POLICY = 'policy'
+ ROUTE = 'route'
+
+
+class ListVpnGatewayConnectionsEnums:
+ """
+ Enums for list_vpn_gateway_connections parameters.
+ """
+
+ class Status(str, Enum):
+ """
+ Filters the collection to VPN gateway connections with a `status` property
+ matching the specified value.
+ """
+
+ DOWN = 'down'
+ UP = 'up'
+
+
+class ListVpnServersEnums:
+ """
+ Enums for list_vpn_servers parameters.
+ """
+
+ class Sort(str, Enum):
+ """
+ Sorts the returned collection by the specified property name in ascending order. A
+ `-` may be prepended to the name to sort in descending order. For example, the
+ value `-created_at` sorts the collection by the `created_at` property in
+ descending order, and the value `name` sorts it by the `name` property in
+ ascending order.
+ """
+
+ CREATED_AT = 'created_at'
+ NAME = 'name'
+
+
+class ListVpnServerClientsEnums:
+ """
+ Enums for list_vpn_server_clients parameters.
+ """
+
+ class Sort(str, Enum):
+ """
+ Sorts the returned collection by the specified property name in ascending order. A
+ `-` may be prepended to the name to sort in descending order. For example, the
+ value `-created_at` sorts the collection by the `created_at` property in
+ descending order.
+ """
+
+ CREATED_AT = 'created_at'
+
+
+class ListVpnServerRoutesEnums:
+ """
+ Enums for list_vpn_server_routes parameters.
+ """
+
+ class Sort(str, Enum):
+ """
+ Sorts the returned collection by the specified property name in ascending order. A
+ `-` may be prepended to the name to sort in descending order. For example, the
+ value `-created_at` sorts the collection by the `created_at` property in
+ descending order, and the value `name` sorts it by the `name` property in
+ ascending order.
+ """
+
+ CREATED_AT = 'created_at'
+ NAME = 'name'
+
+
+class ListEndpointGatewayIpsEnums:
+ """
+ Enums for list_endpoint_gateway_ips parameters.
+ """
+
+ class Sort(str, Enum):
+ """
+ Sorts the returned collection by the specified property name in ascending order. A
+ `-` may be prepended to the name to sort in descending order. For example, the
+ value `-created_at` sorts the collection by the `created_at` property in
+ descending order, and the value `name` sorts it by the `name` property in
+ ascending order.
+ """
+
+ ADDRESS = 'address'
+ CREATED_AT = 'created_at'
+ NAME = 'name'
+
+
+##############################################################################
+# Models
+##############################################################################
+
+
+class AccountReference:
+ """
+ AccountReference.
+
+ :param str id: The unique identifier for this account.
+ :param str resource_type: The resource type.
+ """
+
+ def __init__(
+ self,
+ id: str,
+ resource_type: str,
+ ) -> None:
+ """
+ Initialize a AccountReference object.
+
+ :param str id: The unique identifier for this account.
+ :param str resource_type: The resource type.
+ """
+ self.id = id
+ self.resource_type = resource_type
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'AccountReference':
+ """Initialize a AccountReference object from a json dictionary."""
+ args = {}
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
+ else:
+ raise ValueError('Required property \'id\' not present in AccountReference JSON')
+ if (resource_type := _dict.get('resource_type')) is not None:
+ args['resource_type'] = resource_type
+ else:
+ raise ValueError('Required property \'resource_type\' not present in AccountReference JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a AccountReference object from a json dictionary."""
+ return cls.from_dict(_dict)
+
+ def to_dict(self) -> Dict:
+ """Return a json dictionary representing this model."""
+ _dict = {}
+ if hasattr(self, 'id') and self.id is not None:
+ _dict['id'] = self.id
+ if hasattr(self, 'resource_type') and self.resource_type is not None:
+ _dict['resource_type'] = self.resource_type
+ return _dict
+
+ def _to_dict(self):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
+
+ def __str__(self) -> str:
+ """Return a `str` version of this AccountReference object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'AccountReference') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'AccountReference') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+ class ResourceTypeEnum(str, Enum):
+ """
+ The resource type.
+ """
+
+ ACCOUNT = 'account'
+
+
+
+class AddressPrefix:
+ """
+ AddressPrefix.
+
+ :param str cidr: The CIDR block for this prefix.
+ :param datetime created_at: The date and time that the prefix was created.
+ :param bool has_subnets: Indicates whether subnets exist with addresses from
+ this prefix.
+ :param str href: The URL for this address prefix.
+ :param str id: The unique identifier for this address prefix.
+ :param bool is_default: Indicates whether this is the default prefix for this
+ zone in this VPC. If a default prefix was automatically created when the VPC was
+ created, the prefix is automatically named using a hyphenated list of
+ randomly-selected words, but may be changed.
+ :param str name: The name for this address prefix. The name must not be used by
+ another address prefix for the VPC.
+ :param ZoneReference zone: The zone this address prefix resides in.
+ """
+
+ def __init__(
+ self,
+ cidr: str,
+ created_at: datetime,
+ has_subnets: bool,
+ href: str,
+ id: str,
+ is_default: bool,
+ name: str,
+ zone: 'ZoneReference',
+ ) -> None:
+ """
+ Initialize a AddressPrefix object.
+
+ :param str cidr: The CIDR block for this prefix.
+ :param datetime created_at: The date and time that the prefix was created.
+ :param bool has_subnets: Indicates whether subnets exist with addresses
+ from this prefix.
+ :param str href: The URL for this address prefix.
+ :param str id: The unique identifier for this address prefix.
+ :param bool is_default: Indicates whether this is the default prefix for
+ this zone in this VPC. If a default prefix was automatically created when
+ the VPC was created, the prefix is automatically named using a hyphenated
+ list of randomly-selected words, but may be changed.
+ :param str name: The name for this address prefix. The name must not be
+ used by another address prefix for the VPC.
+ :param ZoneReference zone: The zone this address prefix resides in.
+ """
+ self.cidr = cidr
+ self.created_at = created_at
+ self.has_subnets = has_subnets
+ self.href = href
+ self.id = id
+ self.is_default = is_default
+ self.name = name
+ self.zone = zone
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'AddressPrefix':
+ """Initialize a AddressPrefix object from a json dictionary."""
+ args = {}
+ if (cidr := _dict.get('cidr')) is not None:
+ args['cidr'] = cidr
+ else:
+ raise ValueError('Required property \'cidr\' not present in AddressPrefix JSON')
+ if (created_at := _dict.get('created_at')) is not None:
+ args['created_at'] = string_to_datetime(created_at)
+ else:
+ raise ValueError('Required property \'created_at\' not present in AddressPrefix JSON')
+ if (has_subnets := _dict.get('has_subnets')) is not None:
+ args['has_subnets'] = has_subnets
+ else:
+ raise ValueError('Required property \'has_subnets\' not present in AddressPrefix JSON')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
+ else:
+ raise ValueError('Required property \'href\' not present in AddressPrefix JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
+ else:
+ raise ValueError('Required property \'id\' not present in AddressPrefix JSON')
+ if (is_default := _dict.get('is_default')) is not None:
+ args['is_default'] = is_default
+ else:
+ raise ValueError('Required property \'is_default\' not present in AddressPrefix JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ else:
+ raise ValueError('Required property \'name\' not present in AddressPrefix JSON')
+ if (zone := _dict.get('zone')) is not None:
+ args['zone'] = ZoneReference.from_dict(zone)
+ else:
+ raise ValueError('Required property \'zone\' not present in AddressPrefix JSON')
+ return cls(**args)
@classmethod
def _from_dict(cls, _dict):
@@ -22821,14 +24935,15 @@ 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
+ :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.
- :attr AddressPrefixCollectionNext next: (optional) A link to the next page of
+ :param 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.
+ :param int total_count: The total number of resources across all pages.
"""
def __init__(
@@ -22838,7 +24953,7 @@ def __init__(
limit: int,
total_count: int,
*,
- next: 'AddressPrefixCollectionNext' = None,
+ next: Optional['AddressPrefixCollectionNext'] = None,
) -> None:
"""
Initialize a AddressPrefixCollection object.
@@ -22864,22 +24979,22 @@ def __init__(
def from_dict(cls, _dict: Dict) -> 'AddressPrefixCollection':
"""Initialize a AddressPrefixCollection object from a json dictionary."""
args = {}
- if 'address_prefixes' in _dict:
- args['address_prefixes'] = [AddressPrefix.from_dict(v) for v in _dict.get('address_prefixes')]
+ if (address_prefixes := _dict.get('address_prefixes')) is not None:
+ args['address_prefixes'] = [AddressPrefix.from_dict(v) for v in 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'))
+ if (first := _dict.get('first')) is not None:
+ args['first'] = AddressPrefixCollectionFirst.from_dict(first)
else:
raise ValueError('Required property \'first\' not present in AddressPrefixCollection JSON')
- if 'limit' in _dict:
- args['limit'] = _dict.get('limit')
+ if (limit := _dict.get('limit')) is not None:
+ args['limit'] = limit
else:
raise ValueError('Required property \'limit\' not present in AddressPrefixCollection JSON')
- if 'next' in _dict:
- args['next'] = AddressPrefixCollectionNext.from_dict(_dict.get('next'))
- if 'total_count' in _dict:
- args['total_count'] = _dict.get('total_count')
+ if (next := _dict.get('next')) is not None:
+ args['next'] = AddressPrefixCollectionNext.from_dict(next)
+ if (total_count := _dict.get('total_count')) is not None:
+ args['total_count'] = total_count
else:
raise ValueError('Required property \'total_count\' not present in AddressPrefixCollection JSON')
return cls(**args)
@@ -22939,7 +25054,7 @@ class AddressPrefixCollectionFirst:
"""
A link to the first page of resources.
- :attr str href: The URL for a page of resources.
+ :param str href: The URL for a page of resources.
"""
def __init__(
@@ -22957,8 +25072,8 @@ def __init__(
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')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
raise ValueError('Required property \'href\' not present in AddressPrefixCollectionFirst JSON')
return cls(**args)
@@ -22999,7 +25114,7 @@ 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.
+ :param str href: The URL for a page of resources.
"""
def __init__(
@@ -23017,8 +25132,8 @@ def __init__(
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')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
raise ValueError('Required property \'href\' not present in AddressPrefixCollectionNext JSON')
return cls(**args)
@@ -23058,20 +25173,20 @@ class AddressPrefixPatch:
"""
AddressPrefixPatch.
- :attr bool is_default: (optional) Indicates whether this is the default prefix
+ :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.
- :attr str name: (optional) The name for this address prefix. The name must not
+ :param str name: (optional) The name for this address prefix. The name must not
be used by another address prefix for the VPC.
"""
def __init__(
self,
*,
- is_default: bool = None,
- name: str = None,
+ is_default: Optional[bool] = None,
+ name: Optional[str] = None,
) -> None:
"""
Initialize a AddressPrefixPatch object.
@@ -23091,10 +25206,10 @@ def __init__(
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')
+ if (is_default := _dict.get('is_default')) is not None:
+ args['is_default'] = is_default
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
return cls(**args)
@classmethod
@@ -23134,15 +25249,16 @@ class BackupPolicy:
"""
BackupPolicy.
- :attr datetime created_at: The date and time that the backup policy was created.
- :attr str crn: The CRN for this backup policy.
- :attr List[BackupPolicyHealthReason] health_reasons: The reasons for the current
- `health_state` (if any).
+ :param datetime created_at: The date and time that the backup policy was
+ created.
+ :param str crn: The CRN for this backup policy.
+ :param List[BackupPolicyHealthReason] health_reasons: The reasons for the
+ current `health_state` (if any).
The enumerated reason code values for this property will expand in the future.
When processing this property, check for and log unknown values. Optionally halt
processing and surface the error, or bypass the resource on which the unexpected
reason code was encountered.
- :attr str health_state: The health of this resource.
+ :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
@@ -23151,29 +25267,29 @@ class BackupPolicy:
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 backup policy.
- :attr str id: The unique identifier for this backup policy.
- :attr datetime last_job_completed_at: (optional) The date and time that the most
- recent job for this backup policy completed.
+ :param str href: The URL for this backup policy.
+ :param str id: The unique identifier for this backup policy.
+ :param datetime last_job_completed_at: (optional) The date and time that the
+ most recent job for this backup policy completed.
If absent, no job has yet completed for this backup policy.
- :attr str lifecycle_state: The lifecycle state of the backup policy.
- :attr List[str] match_resource_types: The resource types this backup policy
- applies to. Resources that have both a matching type and a matching user tag
- will be subject to the backup policy.
- The enumerated values for this property will expand in the future. When
+ :param str lifecycle_state: The lifecycle state of the backup policy.
+ :param str match_resource_type: The resource type this backup policy applies to.
+ Resources that have both a matching type and a matching user tag will be subject
+ to the backup policy.
+ The enumerated values for this property 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 backup policy on which the
unexpected property value was encountered.
- :attr List[str] match_user_tags: The user tags this backup policy applies to.
+ :param List[str] match_user_tags: The user tags this backup policy applies to.
Resources that have both a matching user tag and a matching type will be subject
to the backup policy.
- :attr str name: The name for this backup policy. The name is unique across all
+ :param str name: The name for this backup policy. The name is unique across all
backup policies in the region.
- :attr List[BackupPolicyPlanReference] plans: The plans for the backup policy.
- :attr ResourceGroupReference resource_group: The resource group for this backup
+ :param List[BackupPolicyPlanReference] plans: The plans for the backup policy.
+ :param ResourceGroupReference resource_group: The resource group for this backup
policy.
- :attr str resource_type: The resource type.
- :attr BackupPolicyScope scope: The scope for this backup policy.
+ :param str resource_type: The resource type.
+ :param BackupPolicyScope scope: The scope for this backup policy.
"""
def __init__(
@@ -23185,7 +25301,7 @@ def __init__(
href: str,
id: str,
lifecycle_state: str,
- match_resource_types: List[str],
+ match_resource_type: str,
match_user_tags: List[str],
name: str,
plans: List['BackupPolicyPlanReference'],
@@ -23193,7 +25309,7 @@ def __init__(
resource_type: str,
scope: 'BackupPolicyScope',
*,
- last_job_completed_at: datetime = None,
+ last_job_completed_at: Optional[datetime] = None,
) -> None:
"""
Initialize a BackupPolicy object.
@@ -23220,10 +25336,10 @@ def __init__(
:param str href: The URL for this backup policy.
:param str id: The unique identifier for this backup policy.
:param str lifecycle_state: The lifecycle state of the backup policy.
- :param List[str] match_resource_types: The resource types this backup
- policy applies to. Resources that have both a matching type and a matching
- user tag will be subject to the backup policy.
- The enumerated values for this property will expand in the future. When
+ :param str match_resource_type: The resource type this backup policy
+ applies to. Resources that have both a matching type and a matching user
+ tag will be subject to the backup policy.
+ The enumerated values for this property 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 backup policy on which the
unexpected property value was encountered.
@@ -23242,161 +25358,10 @@ def __init__(
the most recent job for this backup policy completed.
If absent, no job has yet completed for this backup policy.
"""
- self.created_at = created_at
- self.crn = crn
- self.health_reasons = health_reasons
- self.health_state = health_state
- self.href = href
- self.id = id
- self.last_job_completed_at = last_job_completed_at
- self.lifecycle_state = lifecycle_state
- self.match_resource_types = match_resource_types
- self.match_user_tags = match_user_tags
- self.name = name
- self.plans = plans
- self.resource_group = resource_group
- self.resource_type = resource_type
- self.scope = scope
-
- @classmethod
- def from_dict(cls, _dict: Dict) -> 'BackupPolicy':
- """Initialize a BackupPolicy object from a json dictionary."""
- args = {}
- if 'created_at' in _dict:
- args['created_at'] = string_to_datetime(_dict.get('created_at'))
- else:
- raise ValueError('Required property \'created_at\' not present in BackupPolicy JSON')
- if 'crn' in _dict:
- args['crn'] = _dict.get('crn')
- else:
- raise ValueError('Required property \'crn\' not present in BackupPolicy JSON')
- if 'health_reasons' in _dict:
- args['health_reasons'] = [BackupPolicyHealthReason.from_dict(v) for v in _dict.get('health_reasons')]
- else:
- raise ValueError('Required property \'health_reasons\' not present in BackupPolicy JSON')
- if 'health_state' in _dict:
- args['health_state'] = _dict.get('health_state')
- else:
- raise ValueError('Required property \'health_state\' not present in BackupPolicy JSON')
- if 'href' in _dict:
- args['href'] = _dict.get('href')
- else:
- raise ValueError('Required property \'href\' not present in BackupPolicy JSON')
- if 'id' in _dict:
- args['id'] = _dict.get('id')
- else:
- raise ValueError('Required property \'id\' not present in BackupPolicy JSON')
- if 'last_job_completed_at' in _dict:
- args['last_job_completed_at'] = string_to_datetime(_dict.get('last_job_completed_at'))
- if 'lifecycle_state' in _dict:
- args['lifecycle_state'] = _dict.get('lifecycle_state')
- else:
- raise ValueError('Required property \'lifecycle_state\' not present in BackupPolicy JSON')
- if 'match_resource_types' in _dict:
- args['match_resource_types'] = _dict.get('match_resource_types')
- else:
- raise ValueError('Required property \'match_resource_types\' not present in BackupPolicy JSON')
- if 'match_user_tags' in _dict:
- args['match_user_tags'] = _dict.get('match_user_tags')
- else:
- raise ValueError('Required property \'match_user_tags\' not present in BackupPolicy JSON')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
- else:
- raise ValueError('Required property \'name\' not present in BackupPolicy JSON')
- if 'plans' in _dict:
- args['plans'] = [BackupPolicyPlanReference.from_dict(v) for v in _dict.get('plans')]
- else:
- raise ValueError('Required property \'plans\' not present in BackupPolicy JSON')
- if 'resource_group' in _dict:
- args['resource_group'] = ResourceGroupReference.from_dict(_dict.get('resource_group'))
- else:
- raise ValueError('Required property \'resource_group\' not present in BackupPolicy JSON')
- if 'resource_type' in _dict:
- args['resource_type'] = _dict.get('resource_type')
- else:
- raise ValueError('Required property \'resource_type\' not present in BackupPolicy JSON')
- if 'scope' in _dict:
- args['scope'] = _dict.get('scope')
- else:
- raise ValueError('Required property \'scope\' not present in BackupPolicy JSON')
- return cls(**args)
-
- @classmethod
- def _from_dict(cls, _dict):
- """Initialize a BackupPolicy object from a json dictionary."""
- return cls.from_dict(_dict)
-
- def to_dict(self) -> Dict:
- """Return a json dictionary representing this model."""
- _dict = {}
- if hasattr(self, 'created_at') and self.created_at is not None:
- _dict['created_at'] = datetime_to_string(self.created_at)
- if hasattr(self, 'crn') and self.crn is not None:
- _dict['crn'] = self.crn
- if hasattr(self, 'health_reasons') and self.health_reasons is not None:
- health_reasons_list = []
- for v in self.health_reasons:
- if isinstance(v, dict):
- health_reasons_list.append(v)
- else:
- health_reasons_list.append(v.to_dict())
- _dict['health_reasons'] = health_reasons_list
- if hasattr(self, 'health_state') and self.health_state is not None:
- _dict['health_state'] = self.health_state
- if hasattr(self, 'href') and self.href is not None:
- _dict['href'] = self.href
- if hasattr(self, 'id') and self.id is not None:
- _dict['id'] = self.id
- if hasattr(self, 'last_job_completed_at') and self.last_job_completed_at is not None:
- _dict['last_job_completed_at'] = datetime_to_string(self.last_job_completed_at)
- if hasattr(self, 'lifecycle_state') and self.lifecycle_state is not None:
- _dict['lifecycle_state'] = self.lifecycle_state
- if hasattr(self, 'match_resource_types') and self.match_resource_types is not None:
- _dict['match_resource_types'] = self.match_resource_types
- if hasattr(self, 'match_user_tags') and self.match_user_tags is not None:
- _dict['match_user_tags'] = self.match_user_tags
- if hasattr(self, 'name') and self.name is not None:
- _dict['name'] = self.name
- if hasattr(self, 'plans') and self.plans is not None:
- plans_list = []
- for v in self.plans:
- if isinstance(v, dict):
- plans_list.append(v)
- else:
- plans_list.append(v.to_dict())
- _dict['plans'] = plans_list
- if hasattr(self, 'resource_group') and self.resource_group is not None:
- if isinstance(self.resource_group, dict):
- _dict['resource_group'] = self.resource_group
- else:
- _dict['resource_group'] = self.resource_group.to_dict()
- if hasattr(self, 'resource_type') and self.resource_type is not None:
- _dict['resource_type'] = self.resource_type
- if hasattr(self, 'scope') and self.scope is not None:
- if isinstance(self.scope, dict):
- _dict['scope'] = self.scope
- else:
- _dict['scope'] = self.scope.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 BackupPolicy object."""
- return json.dumps(self.to_dict(), indent=2)
-
- def __eq__(self, other: 'BackupPolicy') -> bool:
- """Return `true` when self and other are equal, false otherwise."""
- if not isinstance(other, self.__class__):
- return False
- return self.__dict__ == other.__dict__
-
- def __ne__(self, other: 'BackupPolicy') -> bool:
- """Return `true` when self and other are not equal, false otherwise."""
- return not self == other
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['BackupPolicyMatchResourceTypeInstance', 'BackupPolicyMatchResourceTypeVolume'])
+ )
+ raise Exception(msg)
class HealthStateEnum(str, Enum):
"""
@@ -23430,11 +25395,17 @@ class LifecycleStateEnum(str, Enum):
WAITING = 'waiting'
- class MatchResourceTypesEnum(str, Enum):
+ class MatchResourceTypeEnum(str, Enum):
"""
- The resource type.
+ The resource type this backup policy applies to. Resources that have both a
+ matching type and a matching user tag will be subject to the backup policy.
+ The enumerated values for this property 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 backup policy on which the unexpected property
+ value was encountered.
"""
+ INSTANCE = 'instance'
VOLUME = 'volume'
@@ -23451,14 +25422,14 @@ class BackupPolicyCollection:
"""
BackupPolicyCollection.
- :attr List[BackupPolicy] backup_policies: Collection of backup policies.
- :attr BackupPolicyCollectionFirst first: A link to the first page of resources.
- :attr int limit: The maximum number of resources that can be returned by the
+ :param List[BackupPolicy] backup_policies: Collection of backup policies.
+ :param BackupPolicyCollectionFirst first: A link to the first page of resources.
+ :param int limit: The maximum number of resources that can be returned by the
request.
- :attr BackupPolicyCollectionNext next: (optional) A link to the next page of
+ :param BackupPolicyCollectionNext next: (optional) A link to the next page of
resources. This property is present for all pages
except the last page.
- :attr int total_count: The total number of resources across all pages.
+ :param int total_count: The total number of resources across all pages.
"""
def __init__(
@@ -23468,7 +25439,7 @@ def __init__(
limit: int,
total_count: int,
*,
- next: 'BackupPolicyCollectionNext' = None,
+ next: Optional['BackupPolicyCollectionNext'] = None,
) -> None:
"""
Initialize a BackupPolicyCollection object.
@@ -23493,22 +25464,22 @@ def __init__(
def from_dict(cls, _dict: Dict) -> 'BackupPolicyCollection':
"""Initialize a BackupPolicyCollection object from a json dictionary."""
args = {}
- if 'backup_policies' in _dict:
- args['backup_policies'] = [BackupPolicy.from_dict(v) for v in _dict.get('backup_policies')]
+ if (backup_policies := _dict.get('backup_policies')) is not None:
+ args['backup_policies'] = backup_policies
else:
raise ValueError('Required property \'backup_policies\' not present in BackupPolicyCollection JSON')
- if 'first' in _dict:
- args['first'] = BackupPolicyCollectionFirst.from_dict(_dict.get('first'))
+ if (first := _dict.get('first')) is not None:
+ args['first'] = BackupPolicyCollectionFirst.from_dict(first)
else:
raise ValueError('Required property \'first\' not present in BackupPolicyCollection JSON')
- if 'limit' in _dict:
- args['limit'] = _dict.get('limit')
+ if (limit := _dict.get('limit')) is not None:
+ args['limit'] = limit
else:
raise ValueError('Required property \'limit\' not present in BackupPolicyCollection JSON')
- if 'next' in _dict:
- args['next'] = BackupPolicyCollectionNext.from_dict(_dict.get('next'))
- if 'total_count' in _dict:
- args['total_count'] = _dict.get('total_count')
+ if (next := _dict.get('next')) is not None:
+ args['next'] = BackupPolicyCollectionNext.from_dict(next)
+ if (total_count := _dict.get('total_count')) is not None:
+ args['total_count'] = total_count
else:
raise ValueError('Required property \'total_count\' not present in BackupPolicyCollection JSON')
return cls(**args)
@@ -23568,7 +25539,7 @@ class BackupPolicyCollectionFirst:
"""
A link to the first page of resources.
- :attr str href: The URL for a page of resources.
+ :param str href: The URL for a page of resources.
"""
def __init__(
@@ -23586,8 +25557,8 @@ def __init__(
def from_dict(cls, _dict: Dict) -> 'BackupPolicyCollectionFirst':
"""Initialize a BackupPolicyCollectionFirst object from a json dictionary."""
args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
raise ValueError('Required property \'href\' not present in BackupPolicyCollectionFirst JSON')
return cls(**args)
@@ -23628,7 +25599,7 @@ class BackupPolicyCollectionNext:
A link to the next page of resources. This property is present for all pages except
the last page.
- :attr str href: The URL for a page of resources.
+ :param str href: The URL for a page of resources.
"""
def __init__(
@@ -23646,8 +25617,8 @@ def __init__(
def from_dict(cls, _dict: Dict) -> 'BackupPolicyCollectionNext':
"""Initialize a BackupPolicyCollectionNext object from a json dictionary."""
args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
raise ValueError('Required property \'href\' not present in BackupPolicyCollectionNext JSON')
return cls(**args)
@@ -23687,10 +25658,10 @@ class BackupPolicyHealthReason:
"""
BackupPolicyHealthReason.
- :attr str code: A snake case string succinctly identifying the reason for this
+ :param str code: A snake case string succinctly identifying the reason for this
health state.
- :attr str message: An explanation of the reason for this health state.
- :attr str more_info: (optional) Link to documentation about the reason for this
+ :param str message: An explanation of the reason for this health state.
+ :param str more_info: (optional) Link to documentation about the reason for this
health state.
"""
@@ -23699,7 +25670,7 @@ def __init__(
code: str,
message: str,
*,
- more_info: str = None,
+ more_info: Optional[str] = None,
) -> None:
"""
Initialize a BackupPolicyHealthReason object.
@@ -23718,16 +25689,16 @@ def __init__(
def from_dict(cls, _dict: Dict) -> 'BackupPolicyHealthReason':
"""Initialize a BackupPolicyHealthReason object from a json dictionary."""
args = {}
- if 'code' in _dict:
- args['code'] = _dict.get('code')
+ if (code := _dict.get('code')) is not None:
+ args['code'] = code
else:
raise ValueError('Required property \'code\' not present in BackupPolicyHealthReason JSON')
- if 'message' in _dict:
- args['message'] = _dict.get('message')
+ if (message := _dict.get('message')) is not None:
+ args['message'] = message
else:
raise ValueError('Required property \'message\' not present in BackupPolicyHealthReason JSON')
- if 'more_info' in _dict:
- args['more_info'] = _dict.get('more_info')
+ if (more_info := _dict.get('more_info')) is not None:
+ args['more_info'] = more_info
return cls(**args)
@classmethod
@@ -23777,43 +25748,43 @@ class BackupPolicyJob:
"""
BackupPolicyJob.
- :attr bool auto_delete: Indicates whether this backup policy job will be
+ :param bool auto_delete: Indicates whether this backup policy job will be
automatically deleted after it completes. At present, this is always `true`, but
may be modifiable in the future.
- :attr int auto_delete_after: If `auto_delete` is `true`, the days after
+ :param int auto_delete_after: If `auto_delete` is `true`, the days after
completion that this backup policy job will be deleted. This value may be
modifiable in the future.
- :attr BackupPolicyPlanReference backup_policy_plan: The backup policy plan
+ :param BackupPolicyPlanReference backup_policy_plan: The backup policy plan
operated this backup policy job (may be
[deleted](https://cloud.ibm.com/apidocs/vpc#deleted-resources)).
- :attr datetime completed_at: (optional) The date and time that the backup policy
- job was completed.
+ :param datetime completed_at: (optional) The date and time that the backup
+ policy job was completed.
If absent, the backup policy job has not yet completed.
- :attr datetime created_at: The date and time that the backup policy job was
+ :param datetime created_at: The date and time that the backup policy job was
created.
- :attr str href: The URL for this backup policy job.
- :attr str id: The unique identifier for this backup policy job.
- :attr str job_type: The type of backup policy job.
+ :param str href: The URL for this backup policy job.
+ :param str id: The unique identifier for this backup policy job.
+ :param str job_type: The type of backup policy job.
The enumerated values for this property will expand in the future. When
processing this property, check for and log unknown values. Optionally halt
processing and surface the error, or bypass the backup policy job on which the
unexpected property value was encountered.
- :attr str resource_type: The resource type.
- :attr BackupPolicyJobSource source: The source this backup was created from (may
- be
+ :param str resource_type: The resource type.
+ :param BackupPolicyJobSource source: The source this backup was created from
+ (may be
[deleted](https://cloud.ibm.com/apidocs/vpc#deleted-resources)).
- :attr str status: The status of the backup policy job.
+ :param str status: The status of the backup policy job.
The enumerated values for this property will expand in the future. When
processing this property, check for and log unknown values. Optionally halt
processing and surface the error, or bypass the backup policy job on which the
unexpected property value was encountered.
- :attr List[BackupPolicyJobStatusReason] status_reasons: The reasons for the
+ :param List[BackupPolicyJobStatusReason] status_reasons: The reasons for the
current status (if any).
The enumerated reason code values for this property will expand in the future.
When processing this property, check for and log unknown values. Optionally halt
processing and surface the error, or bypass the resource on which the unexpected
reason code was encountered.
- :attr List[SnapshotReference] target_snapshots: The snapshots operated on by
+ :param List[SnapshotReference] target_snapshots: The snapshots operated on by
this backup policy job (may be
[deleted](https://cloud.ibm.com/apidocs/vpc#deleted-resources)).
"""
@@ -23833,7 +25804,7 @@ def __init__(
status_reasons: List['BackupPolicyJobStatusReason'],
target_snapshots: List['SnapshotReference'],
*,
- completed_at: datetime = None,
+ completed_at: Optional[datetime] = None,
) -> None:
"""
Initialize a BackupPolicyJob object.
@@ -23896,54 +25867,54 @@ def __init__(
def from_dict(cls, _dict: Dict) -> 'BackupPolicyJob':
"""Initialize a BackupPolicyJob object from a json dictionary."""
args = {}
- if 'auto_delete' in _dict:
- args['auto_delete'] = _dict.get('auto_delete')
+ if (auto_delete := _dict.get('auto_delete')) is not None:
+ args['auto_delete'] = auto_delete
else:
raise ValueError('Required property \'auto_delete\' not present in BackupPolicyJob JSON')
- if 'auto_delete_after' in _dict:
- args['auto_delete_after'] = _dict.get('auto_delete_after')
+ if (auto_delete_after := _dict.get('auto_delete_after')) is not None:
+ args['auto_delete_after'] = auto_delete_after
else:
raise ValueError('Required property \'auto_delete_after\' not present in BackupPolicyJob JSON')
- if 'backup_policy_plan' in _dict:
- args['backup_policy_plan'] = BackupPolicyPlanReference.from_dict(_dict.get('backup_policy_plan'))
+ if (backup_policy_plan := _dict.get('backup_policy_plan')) is not None:
+ args['backup_policy_plan'] = BackupPolicyPlanReference.from_dict(backup_policy_plan)
else:
raise ValueError('Required property \'backup_policy_plan\' not present in BackupPolicyJob JSON')
- if 'completed_at' in _dict:
- args['completed_at'] = string_to_datetime(_dict.get('completed_at'))
- if 'created_at' in _dict:
- args['created_at'] = string_to_datetime(_dict.get('created_at'))
+ if (completed_at := _dict.get('completed_at')) is not None:
+ args['completed_at'] = string_to_datetime(completed_at)
+ if (created_at := _dict.get('created_at')) is not None:
+ args['created_at'] = string_to_datetime(created_at)
else:
raise ValueError('Required property \'created_at\' not present in BackupPolicyJob JSON')
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
raise ValueError('Required property \'href\' not present in BackupPolicyJob JSON')
- if 'id' in _dict:
- args['id'] = _dict.get('id')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
else:
raise ValueError('Required property \'id\' not present in BackupPolicyJob JSON')
- if 'job_type' in _dict:
- args['job_type'] = _dict.get('job_type')
+ if (job_type := _dict.get('job_type')) is not None:
+ args['job_type'] = job_type
else:
raise ValueError('Required property \'job_type\' not present in BackupPolicyJob JSON')
- if 'resource_type' in _dict:
- args['resource_type'] = _dict.get('resource_type')
+ if (resource_type := _dict.get('resource_type')) is not None:
+ args['resource_type'] = resource_type
else:
raise ValueError('Required property \'resource_type\' not present in BackupPolicyJob JSON')
- if 'source' in _dict:
- args['source'] = _dict.get('source')
+ if (source := _dict.get('source')) is not None:
+ args['source'] = source
else:
raise ValueError('Required property \'source\' not present in BackupPolicyJob JSON')
- if 'status' in _dict:
- args['status'] = _dict.get('status')
+ if (status := _dict.get('status')) is not None:
+ args['status'] = status
else:
raise ValueError('Required property \'status\' not present in BackupPolicyJob JSON')
- if 'status_reasons' in _dict:
- args['status_reasons'] = [BackupPolicyJobStatusReason.from_dict(v) for v in _dict.get('status_reasons')]
+ if (status_reasons := _dict.get('status_reasons')) is not None:
+ args['status_reasons'] = [BackupPolicyJobStatusReason.from_dict(v) for v in status_reasons]
else:
raise ValueError('Required property \'status_reasons\' not present in BackupPolicyJob JSON')
- if 'target_snapshots' in _dict:
- args['target_snapshots'] = [SnapshotReference.from_dict(v) for v in _dict.get('target_snapshots')]
+ if (target_snapshots := _dict.get('target_snapshots')) is not None:
+ args['target_snapshots'] = [SnapshotReference.from_dict(v) for v in target_snapshots]
else:
raise ValueError('Required property \'target_snapshots\' not present in BackupPolicyJob JSON')
return cls(**args)
@@ -24060,15 +26031,15 @@ class BackupPolicyJobCollection:
"""
BackupPolicyJobCollection.
- :attr BackupPolicyJobCollectionFirst first: A link to the first page of
+ :param BackupPolicyJobCollectionFirst first: A link to the first page of
resources.
- :attr List[BackupPolicyJob] jobs: Collection of backup policy jobs.
- :attr int limit: The maximum number of resources that can be returned by the
+ :param List[BackupPolicyJob] jobs: Collection of backup policy jobs.
+ :param int limit: The maximum number of resources that can be returned by the
request.
- :attr BackupPolicyJobCollectionNext next: (optional) A link to the next page of
+ :param BackupPolicyJobCollectionNext next: (optional) A link to the next page of
resources. This property is present for all pages
except the last page.
- :attr int total_count: The total number of resources across all pages.
+ :param int total_count: The total number of resources across all pages.
"""
def __init__(
@@ -24078,7 +26049,7 @@ def __init__(
limit: int,
total_count: int,
*,
- next: 'BackupPolicyJobCollectionNext' = None,
+ next: Optional['BackupPolicyJobCollectionNext'] = None,
) -> None:
"""
Initialize a BackupPolicyJobCollection object.
@@ -24103,22 +26074,22 @@ def __init__(
def from_dict(cls, _dict: Dict) -> 'BackupPolicyJobCollection':
"""Initialize a BackupPolicyJobCollection object from a json dictionary."""
args = {}
- if 'first' in _dict:
- args['first'] = BackupPolicyJobCollectionFirst.from_dict(_dict.get('first'))
+ if (first := _dict.get('first')) is not None:
+ args['first'] = BackupPolicyJobCollectionFirst.from_dict(first)
else:
raise ValueError('Required property \'first\' not present in BackupPolicyJobCollection JSON')
- if 'jobs' in _dict:
- args['jobs'] = [BackupPolicyJob.from_dict(v) for v in _dict.get('jobs')]
+ if (jobs := _dict.get('jobs')) is not None:
+ args['jobs'] = [BackupPolicyJob.from_dict(v) for v in jobs]
else:
raise ValueError('Required property \'jobs\' not present in BackupPolicyJobCollection JSON')
- if 'limit' in _dict:
- args['limit'] = _dict.get('limit')
+ if (limit := _dict.get('limit')) is not None:
+ args['limit'] = limit
else:
raise ValueError('Required property \'limit\' not present in BackupPolicyJobCollection JSON')
- if 'next' in _dict:
- args['next'] = BackupPolicyJobCollectionNext.from_dict(_dict.get('next'))
- if 'total_count' in _dict:
- args['total_count'] = _dict.get('total_count')
+ if (next := _dict.get('next')) is not None:
+ args['next'] = BackupPolicyJobCollectionNext.from_dict(next)
+ if (total_count := _dict.get('total_count')) is not None:
+ args['total_count'] = total_count
else:
raise ValueError('Required property \'total_count\' not present in BackupPolicyJobCollection JSON')
return cls(**args)
@@ -24178,7 +26149,7 @@ class BackupPolicyJobCollectionFirst:
"""
A link to the first page of resources.
- :attr str href: The URL for a page of resources.
+ :param str href: The URL for a page of resources.
"""
def __init__(
@@ -24196,8 +26167,8 @@ def __init__(
def from_dict(cls, _dict: Dict) -> 'BackupPolicyJobCollectionFirst':
"""Initialize a BackupPolicyJobCollectionFirst object from a json dictionary."""
args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
raise ValueError('Required property \'href\' not present in BackupPolicyJobCollectionFirst JSON')
return cls(**args)
@@ -24238,7 +26209,7 @@ class BackupPolicyJobCollectionNext:
A link to the next page of resources. This property is present for all pages except
the last page.
- :attr str href: The URL for a page of resources.
+ :param str href: The URL for a page of resources.
"""
def __init__(
@@ -24256,8 +26227,8 @@ def __init__(
def from_dict(cls, _dict: Dict) -> 'BackupPolicyJobCollectionNext':
"""Initialize a BackupPolicyJobCollectionNext object from a json dictionary."""
args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
raise ValueError('Required property \'href\' not present in BackupPolicyJobCollectionNext JSON')
return cls(**args)
@@ -24308,7 +26279,7 @@ def __init__(
"""
msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['BackupPolicyJobSourceVolumeReference'])
+ ", ".join(['BackupPolicyJobSourceVolumeReference', 'BackupPolicyJobSourceInstanceReference'])
)
raise Exception(msg)
@@ -24317,7 +26288,7 @@ class BackupPolicyJobStatusReason:
"""
BackupPolicyJobStatusReason.
- :attr str code: A snake case string succinctly identifying the status reason:
+ :param str code: A snake case string succinctly identifying the status reason:
- `internal_error`: Internal error (contact IBM support)
- `snapshot_pending`: Cannot delete backup (snapshot) in the `pending` lifecycle
state
@@ -24325,8 +26296,8 @@ class BackupPolicyJobStatusReason:
reached
- `source_volume_busy`: The source volume has `busy` set (after multiple
retries).
- :attr str message: An explanation of the status reason.
- :attr str more_info: (optional) Link to documentation about this status reason.
+ :param str message: An explanation of the status reason.
+ :param str more_info: (optional) Link to documentation about this status reason.
"""
def __init__(
@@ -24334,7 +26305,7 @@ def __init__(
code: str,
message: str,
*,
- more_info: str = None,
+ more_info: Optional[str] = None,
) -> None:
"""
Initialize a BackupPolicyJobStatusReason object.
@@ -24360,16 +26331,16 @@ def __init__(
def from_dict(cls, _dict: Dict) -> 'BackupPolicyJobStatusReason':
"""Initialize a BackupPolicyJobStatusReason object from a json dictionary."""
args = {}
- if 'code' in _dict:
- args['code'] = _dict.get('code')
+ if (code := _dict.get('code')) is not None:
+ args['code'] = code
else:
raise ValueError('Required property \'code\' not present in BackupPolicyJobStatusReason JSON')
- if 'message' in _dict:
- args['message'] = _dict.get('message')
+ if (message := _dict.get('message')) is not None:
+ args['message'] = message
else:
raise ValueError('Required property \'message\' not present in BackupPolicyJobStatusReason JSON')
- if 'more_info' in _dict:
- args['more_info'] = _dict.get('more_info')
+ if (more_info := _dict.get('more_info')) is not None:
+ args['more_info'] = more_info
return cls(**args)
@classmethod
@@ -24428,22 +26399,31 @@ class BackupPolicyPatch:
"""
BackupPolicyPatch.
- :attr List[str] match_user_tags: (optional) The user tags this backup policy
+ :param List[str] included_content: (optional) The included content for backups
+ created using this policy:
+ - `boot_volume`: Include the instance's boot volume.
+ - `data_volumes`: Include the instance's data volumes.
+ :param List[str] match_user_tags: (optional) The user tags this backup policy
will apply to (replacing any existing tags). Resources that have both a matching
user tag and a matching type will be subject to the backup policy.
- :attr str name: (optional) The name for this backup policy. The name must not be
- used by another backup policy in the region.
+ :param str name: (optional) The name for this backup policy. The name must not
+ be used by another backup policy in the region.
"""
def __init__(
self,
*,
- match_user_tags: List[str] = None,
- name: str = None,
+ included_content: Optional[List[str]] = None,
+ match_user_tags: Optional[List[str]] = None,
+ name: Optional[str] = None,
) -> None:
"""
Initialize a BackupPolicyPatch object.
+ :param List[str] included_content: (optional) The included content for
+ backups created using this policy:
+ - `boot_volume`: Include the instance's boot volume.
+ - `data_volumes`: Include the instance's data volumes.
:param List[str] match_user_tags: (optional) The user tags this backup
policy will apply to (replacing any existing tags). Resources that have
both a matching user tag and a matching type will be subject to the backup
@@ -24451,6 +26431,7 @@ def __init__(
:param str name: (optional) The name for this backup policy. The name must
not be used by another backup policy in the region.
"""
+ self.included_content = included_content
self.match_user_tags = match_user_tags
self.name = name
@@ -24458,10 +26439,12 @@ def __init__(
def from_dict(cls, _dict: Dict) -> 'BackupPolicyPatch':
"""Initialize a BackupPolicyPatch object from a json dictionary."""
args = {}
- if 'match_user_tags' in _dict:
- args['match_user_tags'] = _dict.get('match_user_tags')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
+ if (included_content := _dict.get('included_content')) is not None:
+ args['included_content'] = included_content
+ if (match_user_tags := _dict.get('match_user_tags')) is not None:
+ args['match_user_tags'] = match_user_tags
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
return cls(**args)
@classmethod
@@ -24472,6 +26455,8 @@ def _from_dict(cls, _dict):
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
+ if hasattr(self, 'included_content') and self.included_content is not None:
+ _dict['included_content'] = self.included_content
if hasattr(self, 'match_user_tags') and self.match_user_tags is not None:
_dict['match_user_tags'] = self.match_user_tags
if hasattr(self, 'name') and self.name is not None:
@@ -24496,34 +26481,43 @@ def __ne__(self, other: 'BackupPolicyPatch') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
+ class IncludedContentEnum(str, Enum):
+ """
+ An item to include.
+ """
+
+ BOOT_VOLUME = 'boot_volume'
+ DATA_VOLUMES = 'data_volumes'
+
+
class BackupPolicyPlan:
"""
BackupPolicyPlan.
- :attr bool active: Indicates whether the plan is active.
- :attr List[str] attach_user_tags: The user tags to attach to backups (snapshots)
- created by this plan.
- :attr BackupPolicyPlanClonePolicy clone_policy:
- :attr bool copy_user_tags: Indicates whether to copy the source's user tags to
+ :param bool active: Indicates whether the plan is active.
+ :param List[str] attach_user_tags: The user tags to attach to backups
+ (snapshots) created by this plan.
+ :param BackupPolicyPlanClonePolicy clone_policy:
+ :param bool copy_user_tags: Indicates whether to copy the source's user tags to
the created backups (snapshots).
- :attr datetime created_at: The date and time that the backup policy plan was
+ :param datetime created_at: The date and time that the backup policy plan was
created.
- :attr str cron_spec: The cron specification for the backup schedule. The backup
+ :param str cron_spec: The cron specification for the backup schedule. The backup
policy jobs
(which create and delete backups for this plan) will not start until this time,
and may start for up to 90 minutes after this time.
All backup schedules for plans in the same policy must be at least an hour
apart.
- :attr BackupPolicyPlanDeletionTrigger deletion_trigger:
- :attr str href: The URL for this backup policy plan.
- :attr str id: The unique identifier for this backup policy plan.
- :attr str lifecycle_state: The lifecycle state of this backup policy plan.
- :attr str name: The name for this backup policy plan. The name is unique across
+ :param BackupPolicyPlanDeletionTrigger deletion_trigger:
+ :param str href: The URL for this backup policy plan.
+ :param str id: The unique identifier for this backup policy plan.
+ :param str lifecycle_state: The lifecycle state of this backup policy plan.
+ :param str name: The name for this backup policy plan. The name is unique across
all plans in the backup policy.
- :attr List[BackupPolicyPlanRemoteRegionPolicy] remote_region_policies: The
+ :param List[BackupPolicyPlanRemoteRegionPolicy] remote_region_policies: The
policies for additional backups in remote regions.
- :attr str resource_type: The resource type.
+ :param str resource_type: The resource type.
"""
def __init__(
@@ -24587,56 +26581,56 @@ def __init__(
def from_dict(cls, _dict: Dict) -> 'BackupPolicyPlan':
"""Initialize a BackupPolicyPlan object from a json dictionary."""
args = {}
- if 'active' in _dict:
- args['active'] = _dict.get('active')
+ if (active := _dict.get('active')) is not None:
+ args['active'] = active
else:
raise ValueError('Required property \'active\' not present in BackupPolicyPlan JSON')
- if 'attach_user_tags' in _dict:
- args['attach_user_tags'] = _dict.get('attach_user_tags')
+ if (attach_user_tags := _dict.get('attach_user_tags')) is not None:
+ args['attach_user_tags'] = attach_user_tags
else:
raise ValueError('Required property \'attach_user_tags\' not present in BackupPolicyPlan JSON')
- if 'clone_policy' in _dict:
- args['clone_policy'] = BackupPolicyPlanClonePolicy.from_dict(_dict.get('clone_policy'))
+ if (clone_policy := _dict.get('clone_policy')) is not None:
+ args['clone_policy'] = BackupPolicyPlanClonePolicy.from_dict(clone_policy)
else:
raise ValueError('Required property \'clone_policy\' not present in BackupPolicyPlan JSON')
- if 'copy_user_tags' in _dict:
- args['copy_user_tags'] = _dict.get('copy_user_tags')
+ if (copy_user_tags := _dict.get('copy_user_tags')) is not None:
+ args['copy_user_tags'] = copy_user_tags
else:
raise ValueError('Required property \'copy_user_tags\' not present in BackupPolicyPlan JSON')
- if 'created_at' in _dict:
- args['created_at'] = string_to_datetime(_dict.get('created_at'))
+ if (created_at := _dict.get('created_at')) is not None:
+ args['created_at'] = string_to_datetime(created_at)
else:
raise ValueError('Required property \'created_at\' not present in BackupPolicyPlan JSON')
- if 'cron_spec' in _dict:
- args['cron_spec'] = _dict.get('cron_spec')
+ if (cron_spec := _dict.get('cron_spec')) is not None:
+ args['cron_spec'] = cron_spec
else:
raise ValueError('Required property \'cron_spec\' not present in BackupPolicyPlan JSON')
- if 'deletion_trigger' in _dict:
- args['deletion_trigger'] = BackupPolicyPlanDeletionTrigger.from_dict(_dict.get('deletion_trigger'))
+ if (deletion_trigger := _dict.get('deletion_trigger')) is not None:
+ args['deletion_trigger'] = BackupPolicyPlanDeletionTrigger.from_dict(deletion_trigger)
else:
raise ValueError('Required property \'deletion_trigger\' not present in BackupPolicyPlan JSON')
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
raise ValueError('Required property \'href\' not present in BackupPolicyPlan JSON')
- if 'id' in _dict:
- args['id'] = _dict.get('id')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
else:
raise ValueError('Required property \'id\' not present in BackupPolicyPlan JSON')
- if 'lifecycle_state' in _dict:
- args['lifecycle_state'] = _dict.get('lifecycle_state')
+ if (lifecycle_state := _dict.get('lifecycle_state')) is not None:
+ args['lifecycle_state'] = lifecycle_state
else:
raise ValueError('Required property \'lifecycle_state\' not present in BackupPolicyPlan JSON')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
else:
raise ValueError('Required property \'name\' not present in BackupPolicyPlan JSON')
- if 'remote_region_policies' in _dict:
- args['remote_region_policies'] = [BackupPolicyPlanRemoteRegionPolicy.from_dict(v) for v in _dict.get('remote_region_policies')]
+ if (remote_region_policies := _dict.get('remote_region_policies')) is not None:
+ args['remote_region_policies'] = [BackupPolicyPlanRemoteRegionPolicy.from_dict(v) for v in remote_region_policies]
else:
raise ValueError('Required property \'remote_region_policies\' not present in BackupPolicyPlan JSON')
- if 'resource_type' in _dict:
- args['resource_type'] = _dict.get('resource_type')
+ if (resource_type := _dict.get('resource_type')) is not None:
+ args['resource_type'] = resource_type
else:
raise ValueError('Required property \'resource_type\' not present in BackupPolicyPlan JSON')
return cls(**args)
@@ -24734,9 +26728,9 @@ class BackupPolicyPlanClonePolicy:
"""
BackupPolicyPlanClonePolicy.
- :attr int max_snapshots: The maximum number of recent snapshots (per source)
+ :param int max_snapshots: The maximum number of recent snapshots (per source)
that will keep clones.
- :attr List[ZoneReference] zones: The zone this backup policy plan will create
+ :param List[ZoneReference] zones: The zone this backup policy plan will create
snapshot clones in.
"""
@@ -24760,12 +26754,12 @@ def __init__(
def from_dict(cls, _dict: Dict) -> 'BackupPolicyPlanClonePolicy':
"""Initialize a BackupPolicyPlanClonePolicy object from a json dictionary."""
args = {}
- if 'max_snapshots' in _dict:
- args['max_snapshots'] = _dict.get('max_snapshots')
+ if (max_snapshots := _dict.get('max_snapshots')) is not None:
+ args['max_snapshots'] = max_snapshots
else:
raise ValueError('Required property \'max_snapshots\' not present in BackupPolicyPlanClonePolicy JSON')
- if 'zones' in _dict:
- args['zones'] = [ZoneReference.from_dict(v) for v in _dict.get('zones')]
+ if (zones := _dict.get('zones')) is not None:
+ args['zones'] = [ZoneReference.from_dict(v) for v in zones]
else:
raise ValueError('Required property \'zones\' not present in BackupPolicyPlanClonePolicy JSON')
return cls(**args)
@@ -24813,9 +26807,9 @@ class BackupPolicyPlanClonePolicyPatch:
"""
BackupPolicyPlanClonePolicyPatch.
- :attr int max_snapshots: (optional) The maximum number of recent snapshots (per
+ :param int max_snapshots: (optional) The maximum number of recent snapshots (per
source) that will keep clones.
- :attr List[ZoneIdentity] zones: (optional) The zones this backup policy plan
+ :param List[ZoneIdentity] zones: (optional) The zones this backup policy plan
will create snapshot clones in. Updating this value does not change the clones
for snapshots that have already been created by this plan.
"""
@@ -24823,8 +26817,8 @@ class BackupPolicyPlanClonePolicyPatch:
def __init__(
self,
*,
- max_snapshots: int = None,
- zones: List['ZoneIdentity'] = None,
+ max_snapshots: Optional[int] = None,
+ zones: Optional[List['ZoneIdentity']] = None,
) -> None:
"""
Initialize a BackupPolicyPlanClonePolicyPatch object.
@@ -24842,10 +26836,10 @@ def __init__(
def from_dict(cls, _dict: Dict) -> 'BackupPolicyPlanClonePolicyPatch':
"""Initialize a BackupPolicyPlanClonePolicyPatch object from a json dictionary."""
args = {}
- if 'max_snapshots' in _dict:
- args['max_snapshots'] = _dict.get('max_snapshots')
- if 'zones' in _dict:
- args['zones'] = _dict.get('zones')
+ if (max_snapshots := _dict.get('max_snapshots')) is not None:
+ args['max_snapshots'] = max_snapshots
+ if (zones := _dict.get('zones')) is not None:
+ args['zones'] = zones
return cls(**args)
@classmethod
@@ -24891,9 +26885,9 @@ class BackupPolicyPlanClonePolicyPrototype:
"""
BackupPolicyPlanClonePolicyPrototype.
- :attr int max_snapshots: (optional) The maximum number of recent snapshots (per
+ :param int max_snapshots: (optional) The maximum number of recent snapshots (per
source) that will keep clones.
- :attr List[ZoneIdentity] zones: The zone this backup policy plan will create
+ :param List[ZoneIdentity] zones: The zone this backup policy plan will create
snapshot clones in.
"""
@@ -24901,7 +26895,7 @@ def __init__(
self,
zones: List['ZoneIdentity'],
*,
- max_snapshots: int = None,
+ max_snapshots: Optional[int] = None,
) -> None:
"""
Initialize a BackupPolicyPlanClonePolicyPrototype object.
@@ -24918,10 +26912,10 @@ def __init__(
def from_dict(cls, _dict: Dict) -> 'BackupPolicyPlanClonePolicyPrototype':
"""Initialize a BackupPolicyPlanClonePolicyPrototype object from a json dictionary."""
args = {}
- if 'max_snapshots' in _dict:
- args['max_snapshots'] = _dict.get('max_snapshots')
- if 'zones' in _dict:
- args['zones'] = _dict.get('zones')
+ if (max_snapshots := _dict.get('max_snapshots')) is not None:
+ args['max_snapshots'] = max_snapshots
+ if (zones := _dict.get('zones')) is not None:
+ args['zones'] = zones
else:
raise ValueError('Required property \'zones\' not present in BackupPolicyPlanClonePolicyPrototype JSON')
return cls(**args)
@@ -24969,7 +26963,7 @@ class BackupPolicyPlanCollection:
"""
BackupPolicyPlanCollection.
- :attr List[BackupPolicyPlan] plans: Collection of backup policy plans.
+ :param List[BackupPolicyPlan] plans: Collection of backup policy plans.
"""
def __init__(
@@ -24987,8 +26981,8 @@ def __init__(
def from_dict(cls, _dict: Dict) -> 'BackupPolicyPlanCollection':
"""Initialize a BackupPolicyPlanCollection object from a json dictionary."""
args = {}
- if 'plans' in _dict:
- args['plans'] = [BackupPolicyPlan.from_dict(v) for v in _dict.get('plans')]
+ if (plans := _dict.get('plans')) is not None:
+ args['plans'] = [BackupPolicyPlan.from_dict(v) for v in plans]
else:
raise ValueError('Required property \'plans\' not present in BackupPolicyPlanCollection JSON')
return cls(**args)
@@ -25034,9 +27028,9 @@ class BackupPolicyPlanDeletionTrigger:
"""
BackupPolicyPlanDeletionTrigger.
- :attr int delete_after: The maximum number of days to keep each backup after
+ :param int delete_after: The maximum number of days to keep each backup after
creation.
- :attr int delete_over_count: (optional) The maximum number of recent backups to
+ :param int delete_over_count: (optional) The maximum number of recent backups to
keep. If absent, there is no maximum.
"""
@@ -25044,7 +27038,7 @@ def __init__(
self,
delete_after: int,
*,
- delete_over_count: int = None,
+ delete_over_count: Optional[int] = None,
) -> None:
"""
Initialize a BackupPolicyPlanDeletionTrigger object.
@@ -25061,12 +27055,12 @@ def __init__(
def from_dict(cls, _dict: Dict) -> 'BackupPolicyPlanDeletionTrigger':
"""Initialize a BackupPolicyPlanDeletionTrigger object from a json dictionary."""
args = {}
- if 'delete_after' in _dict:
- args['delete_after'] = _dict.get('delete_after')
+ if (delete_after := _dict.get('delete_after')) is not None:
+ args['delete_after'] = delete_after
else:
raise ValueError('Required property \'delete_after\' not present in BackupPolicyPlanDeletionTrigger JSON')
- if 'delete_over_count' in _dict:
- args['delete_over_count'] = _dict.get('delete_over_count')
+ if (delete_over_count := _dict.get('delete_over_count')) is not None:
+ args['delete_over_count'] = delete_over_count
return cls(**args)
@classmethod
@@ -25106,17 +27100,17 @@ class BackupPolicyPlanDeletionTriggerPatch:
"""
BackupPolicyPlanDeletionTriggerPatch.
- :attr int delete_after: (optional) The maximum number of days to keep each
+ :param int delete_after: (optional) The maximum number of days to keep each
backup after creation.
- :attr int delete_over_count: (optional) The maximum number of recent backups to
+ :param int delete_over_count: (optional) The maximum number of recent backups to
keep. Specify `null` to remove any existing maximum.
"""
def __init__(
self,
*,
- delete_after: int = None,
- delete_over_count: int = None,
+ delete_after: Optional[int] = None,
+ delete_over_count: Optional[int] = None,
) -> None:
"""
Initialize a BackupPolicyPlanDeletionTriggerPatch object.
@@ -25133,10 +27127,10 @@ def __init__(
def from_dict(cls, _dict: Dict) -> 'BackupPolicyPlanDeletionTriggerPatch':
"""Initialize a BackupPolicyPlanDeletionTriggerPatch object from a json dictionary."""
args = {}
- if 'delete_after' in _dict:
- args['delete_after'] = _dict.get('delete_after')
- if 'delete_over_count' in _dict:
- args['delete_over_count'] = _dict.get('delete_over_count')
+ if (delete_after := _dict.get('delete_after')) is not None:
+ args['delete_after'] = delete_after
+ if (delete_over_count := _dict.get('delete_over_count')) is not None:
+ args['delete_over_count'] = delete_over_count
return cls(**args)
@classmethod
@@ -25176,17 +27170,17 @@ class BackupPolicyPlanDeletionTriggerPrototype:
"""
BackupPolicyPlanDeletionTriggerPrototype.
- :attr int delete_after: (optional) The maximum number of days to keep each
+ :param int delete_after: (optional) The maximum number of days to keep each
backup after creation.
- :attr int delete_over_count: (optional) The maximum number of recent backups to
+ :param int delete_over_count: (optional) The maximum number of recent backups to
keep. If unspecified, there will be no maximum.
"""
def __init__(
self,
*,
- delete_after: int = None,
- delete_over_count: int = None,
+ delete_after: Optional[int] = None,
+ delete_over_count: Optional[int] = None,
) -> None:
"""
Initialize a BackupPolicyPlanDeletionTriggerPrototype object.
@@ -25203,10 +27197,10 @@ def __init__(
def from_dict(cls, _dict: Dict) -> 'BackupPolicyPlanDeletionTriggerPrototype':
"""Initialize a BackupPolicyPlanDeletionTriggerPrototype object from a json dictionary."""
args = {}
- if 'delete_after' in _dict:
- args['delete_after'] = _dict.get('delete_after')
- if 'delete_over_count' in _dict:
- args['delete_over_count'] = _dict.get('delete_over_count')
+ if (delete_after := _dict.get('delete_after')) is not None:
+ args['delete_after'] = delete_after
+ if (delete_over_count := _dict.get('delete_over_count')) is not None:
+ args['delete_over_count'] = delete_over_count
return cls(**args)
@classmethod
@@ -25246,23 +27240,23 @@ class BackupPolicyPlanPatch:
"""
BackupPolicyPlanPatch.
- :attr bool active: (optional) Indicates whether the plan is active.
- :attr List[str] attach_user_tags: (optional) The user tags to attach to backups
+ :param bool active: (optional) Indicates whether the plan is active.
+ :param List[str] attach_user_tags: (optional) The user tags to attach to backups
(snapshots) created by this plan. Updating this value does not change the user
tags for backups that have already been created by this plan.
- :attr BackupPolicyPlanClonePolicyPatch clone_policy: (optional)
- :attr bool copy_user_tags: (optional) Indicates whether to copy the source's
+ :param BackupPolicyPlanClonePolicyPatch clone_policy: (optional)
+ :param bool copy_user_tags: (optional) Indicates whether to copy the source's
user tags to the created backups (snapshots).
- :attr str cron_spec: (optional) The cron specification for the backup schedule.
+ :param str cron_spec: (optional) The cron specification for the backup schedule.
The backup policy jobs
(which create and delete backups for this plan) will not start until this time,
and may start for up to 90 minutes after this time.
All backup schedules for plans in the same policy must be at least an hour
apart.
- :attr BackupPolicyPlanDeletionTriggerPatch deletion_trigger: (optional)
- :attr str name: (optional) The name for this backup policy plan. The name must
+ :param BackupPolicyPlanDeletionTriggerPatch deletion_trigger: (optional)
+ :param str name: (optional) The name for this backup policy plan. The name must
not be used by another plan for the backup policy.
- :attr List[BackupPolicyPlanRemoteRegionPolicyPrototype] remote_region_policies:
+ :param List[BackupPolicyPlanRemoteRegionPolicyPrototype] remote_region_policies:
(optional) The policies for additional backups in remote regions (replacing any
existing policies).
"""
@@ -25270,14 +27264,14 @@ class BackupPolicyPlanPatch:
def __init__(
self,
*,
- active: bool = None,
- attach_user_tags: List[str] = None,
- clone_policy: 'BackupPolicyPlanClonePolicyPatch' = None,
- copy_user_tags: bool = None,
- cron_spec: str = None,
- deletion_trigger: 'BackupPolicyPlanDeletionTriggerPatch' = None,
- name: str = None,
- remote_region_policies: List['BackupPolicyPlanRemoteRegionPolicyPrototype'] = None,
+ active: Optional[bool] = None,
+ attach_user_tags: Optional[List[str]] = None,
+ clone_policy: Optional['BackupPolicyPlanClonePolicyPatch'] = None,
+ copy_user_tags: Optional[bool] = None,
+ cron_spec: Optional[str] = None,
+ deletion_trigger: Optional['BackupPolicyPlanDeletionTriggerPatch'] = None,
+ name: Optional[str] = None,
+ remote_region_policies: Optional[List['BackupPolicyPlanRemoteRegionPolicyPrototype']] = None,
) -> None:
"""
Initialize a BackupPolicyPlanPatch object.
@@ -25316,22 +27310,22 @@ def __init__(
def from_dict(cls, _dict: Dict) -> 'BackupPolicyPlanPatch':
"""Initialize a BackupPolicyPlanPatch object from a json dictionary."""
args = {}
- if 'active' in _dict:
- args['active'] = _dict.get('active')
- if 'attach_user_tags' in _dict:
- args['attach_user_tags'] = _dict.get('attach_user_tags')
- if 'clone_policy' in _dict:
- args['clone_policy'] = BackupPolicyPlanClonePolicyPatch.from_dict(_dict.get('clone_policy'))
- if 'copy_user_tags' in _dict:
- args['copy_user_tags'] = _dict.get('copy_user_tags')
- if 'cron_spec' in _dict:
- args['cron_spec'] = _dict.get('cron_spec')
- if 'deletion_trigger' in _dict:
- args['deletion_trigger'] = BackupPolicyPlanDeletionTriggerPatch.from_dict(_dict.get('deletion_trigger'))
- if 'name' in _dict:
- args['name'] = _dict.get('name')
- if 'remote_region_policies' in _dict:
- args['remote_region_policies'] = [BackupPolicyPlanRemoteRegionPolicyPrototype.from_dict(v) for v in _dict.get('remote_region_policies')]
+ if (active := _dict.get('active')) is not None:
+ args['active'] = active
+ if (attach_user_tags := _dict.get('attach_user_tags')) is not None:
+ args['attach_user_tags'] = attach_user_tags
+ if (clone_policy := _dict.get('clone_policy')) is not None:
+ args['clone_policy'] = BackupPolicyPlanClonePolicyPatch.from_dict(clone_policy)
+ if (copy_user_tags := _dict.get('copy_user_tags')) is not None:
+ args['copy_user_tags'] = copy_user_tags
+ if (cron_spec := _dict.get('cron_spec')) is not None:
+ args['cron_spec'] = cron_spec
+ if (deletion_trigger := _dict.get('deletion_trigger')) is not None:
+ args['deletion_trigger'] = BackupPolicyPlanDeletionTriggerPatch.from_dict(deletion_trigger)
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ if (remote_region_policies := _dict.get('remote_region_policies')) is not None:
+ args['remote_region_policies'] = [BackupPolicyPlanRemoteRegionPolicyPrototype.from_dict(v) for v in remote_region_policies]
return cls(**args)
@classmethod
@@ -25395,23 +27389,23 @@ class BackupPolicyPlanPrototype:
"""
BackupPolicyPlanPrototype.
- :attr bool active: (optional) Indicates whether the plan is active.
- :attr List[str] attach_user_tags: (optional) User tags to attach to each backup
+ :param bool active: (optional) Indicates whether the plan is active.
+ :param List[str] attach_user_tags: (optional) User tags to attach to each backup
(snapshot) created by this plan. If unspecified, no user tags will be attached.
- :attr BackupPolicyPlanClonePolicyPrototype clone_policy: (optional)
- :attr bool copy_user_tags: (optional) Indicates whether to copy the source's
+ :param BackupPolicyPlanClonePolicyPrototype clone_policy: (optional)
+ :param bool copy_user_tags: (optional) Indicates whether to copy the source's
user tags to the created backups (snapshots).
- :attr str cron_spec: The cron specification for the backup schedule. The backup
+ :param str cron_spec: The cron specification for the backup schedule. The backup
policy jobs
(which create and delete backups for this plan) will not start until this time,
and may start for up to 90 minutes after this time.
All backup schedules for plans in the same policy must be at least an hour
apart.
- :attr BackupPolicyPlanDeletionTriggerPrototype deletion_trigger: (optional)
- :attr str name: (optional) The name for this backup policy plan. The name must
+ :param BackupPolicyPlanDeletionTriggerPrototype deletion_trigger: (optional)
+ :param str name: (optional) The name for this backup policy plan. The name must
not be used by another plan for the backup policy. If unspecified, the name will
be a hyphenated list of randomly-selected words.
- :attr List[BackupPolicyPlanRemoteRegionPolicyPrototype] remote_region_policies:
+ :param List[BackupPolicyPlanRemoteRegionPolicyPrototype] remote_region_policies:
(optional) The policies for additional backups in remote regions.
"""
@@ -25419,13 +27413,13 @@ def __init__(
self,
cron_spec: str,
*,
- active: bool = None,
- attach_user_tags: List[str] = None,
- clone_policy: 'BackupPolicyPlanClonePolicyPrototype' = None,
- copy_user_tags: bool = None,
- deletion_trigger: 'BackupPolicyPlanDeletionTriggerPrototype' = None,
- name: str = None,
- remote_region_policies: List['BackupPolicyPlanRemoteRegionPolicyPrototype'] = None,
+ active: Optional[bool] = None,
+ attach_user_tags: Optional[List[str]] = None,
+ clone_policy: Optional['BackupPolicyPlanClonePolicyPrototype'] = None,
+ copy_user_tags: Optional[bool] = None,
+ deletion_trigger: Optional['BackupPolicyPlanDeletionTriggerPrototype'] = None,
+ name: Optional[str] = None,
+ remote_region_policies: Optional[List['BackupPolicyPlanRemoteRegionPolicyPrototype']] = None,
) -> None:
"""
Initialize a BackupPolicyPlanPrototype object.
@@ -25465,24 +27459,24 @@ def __init__(
def from_dict(cls, _dict: Dict) -> 'BackupPolicyPlanPrototype':
"""Initialize a BackupPolicyPlanPrototype object from a json dictionary."""
args = {}
- if 'active' in _dict:
- args['active'] = _dict.get('active')
- if 'attach_user_tags' in _dict:
- args['attach_user_tags'] = _dict.get('attach_user_tags')
- if 'clone_policy' in _dict:
- args['clone_policy'] = BackupPolicyPlanClonePolicyPrototype.from_dict(_dict.get('clone_policy'))
- if 'copy_user_tags' in _dict:
- args['copy_user_tags'] = _dict.get('copy_user_tags')
- if 'cron_spec' in _dict:
- args['cron_spec'] = _dict.get('cron_spec')
+ if (active := _dict.get('active')) is not None:
+ args['active'] = active
+ if (attach_user_tags := _dict.get('attach_user_tags')) is not None:
+ args['attach_user_tags'] = attach_user_tags
+ if (clone_policy := _dict.get('clone_policy')) is not None:
+ args['clone_policy'] = BackupPolicyPlanClonePolicyPrototype.from_dict(clone_policy)
+ if (copy_user_tags := _dict.get('copy_user_tags')) is not None:
+ args['copy_user_tags'] = copy_user_tags
+ if (cron_spec := _dict.get('cron_spec')) is not None:
+ args['cron_spec'] = cron_spec
else:
raise ValueError('Required property \'cron_spec\' not present in BackupPolicyPlanPrototype JSON')
- if 'deletion_trigger' in _dict:
- args['deletion_trigger'] = BackupPolicyPlanDeletionTriggerPrototype.from_dict(_dict.get('deletion_trigger'))
- if 'name' in _dict:
- args['name'] = _dict.get('name')
- if 'remote_region_policies' in _dict:
- args['remote_region_policies'] = [BackupPolicyPlanRemoteRegionPolicyPrototype.from_dict(v) for v in _dict.get('remote_region_policies')]
+ if (deletion_trigger := _dict.get('deletion_trigger')) is not None:
+ args['deletion_trigger'] = BackupPolicyPlanDeletionTriggerPrototype.from_dict(deletion_trigger)
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ if (remote_region_policies := _dict.get('remote_region_policies')) is not None:
+ args['remote_region_policies'] = [BackupPolicyPlanRemoteRegionPolicyPrototype.from_dict(v) for v in remote_region_policies]
return cls(**args)
@classmethod
@@ -25546,17 +27540,17 @@ class BackupPolicyPlanReference:
"""
BackupPolicyPlanReference.
- :attr BackupPolicyPlanReferenceDeleted deleted: (optional) If present, this
+ :param BackupPolicyPlanReferenceDeleted deleted: (optional) If present, this
property indicates the referenced resource has been deleted, and provides
some supplementary information.
- :attr str href: The URL for this backup policy plan.
- :attr str id: The unique identifier for this backup policy plan.
- :attr str name: The name for this backup policy plan. The name is unique across
+ :param str href: The URL for this backup policy plan.
+ :param str id: The unique identifier for this backup policy plan.
+ :param str name: The name for this backup policy plan. The name is unique across
all plans in the backup policy.
- :attr BackupPolicyPlanRemote remote: (optional) If present, this property
+ :param BackupPolicyPlanRemote remote: (optional) If present, this property
indicates that the resource associated with this reference
is remote and therefore may not be directly retrievable.
- :attr str resource_type: The resource type.
+ :param str resource_type: The resource type.
"""
def __init__(
@@ -25566,8 +27560,8 @@ def __init__(
name: str,
resource_type: str,
*,
- deleted: 'BackupPolicyPlanReferenceDeleted' = None,
- remote: 'BackupPolicyPlanRemote' = None,
+ deleted: Optional['BackupPolicyPlanReferenceDeleted'] = None,
+ remote: Optional['BackupPolicyPlanRemote'] = None,
) -> None:
"""
Initialize a BackupPolicyPlanReference object.
@@ -25596,24 +27590,24 @@ def __init__(
def from_dict(cls, _dict: Dict) -> 'BackupPolicyPlanReference':
"""Initialize a BackupPolicyPlanReference object from a json dictionary."""
args = {}
- if 'deleted' in _dict:
- args['deleted'] = BackupPolicyPlanReferenceDeleted.from_dict(_dict.get('deleted'))
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ if (deleted := _dict.get('deleted')) is not None:
+ args['deleted'] = BackupPolicyPlanReferenceDeleted.from_dict(deleted)
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
raise ValueError('Required property \'href\' not present in BackupPolicyPlanReference JSON')
- if 'id' in _dict:
- args['id'] = _dict.get('id')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
else:
raise ValueError('Required property \'id\' not present in BackupPolicyPlanReference JSON')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
else:
raise ValueError('Required property \'name\' not present in BackupPolicyPlanReference JSON')
- if 'remote' in _dict:
- args['remote'] = BackupPolicyPlanRemote.from_dict(_dict.get('remote'))
- if 'resource_type' in _dict:
- args['resource_type'] = _dict.get('resource_type')
+ if (remote := _dict.get('remote')) is not None:
+ args['remote'] = BackupPolicyPlanRemote.from_dict(remote)
+ if (resource_type := _dict.get('resource_type')) is not None:
+ args['resource_type'] = resource_type
else:
raise ValueError('Required property \'resource_type\' not present in BackupPolicyPlanReference JSON')
return cls(**args)
@@ -25678,7 +27672,7 @@ class BackupPolicyPlanReferenceDeleted:
If present, this property indicates the referenced resource has been deleted, and
provides some supplementary information.
- :attr str more_info: Link to documentation about deleted resources.
+ :param str more_info: Link to documentation about deleted resources.
"""
def __init__(
@@ -25696,8 +27690,8 @@ def __init__(
def from_dict(cls, _dict: Dict) -> 'BackupPolicyPlanReferenceDeleted':
"""Initialize a BackupPolicyPlanReferenceDeleted object from a json dictionary."""
args = {}
- if 'more_info' in _dict:
- args['more_info'] = _dict.get('more_info')
+ if (more_info := _dict.get('more_info')) is not None:
+ args['more_info'] = more_info
else:
raise ValueError('Required property \'more_info\' not present in BackupPolicyPlanReferenceDeleted JSON')
return cls(**args)
@@ -25738,7 +27732,7 @@ class BackupPolicyPlanRemote:
If present, this property indicates that the resource associated with this reference
is remote and therefore may not be directly retrievable.
- :attr RegionReference region: (optional) If present, this property indicates
+ :param RegionReference region: (optional) If present, this property indicates
that the referenced resource is remote to this
region, and identifies the native region.
"""
@@ -25746,7 +27740,7 @@ class BackupPolicyPlanRemote:
def __init__(
self,
*,
- region: 'RegionReference' = None,
+ region: Optional['RegionReference'] = None,
) -> None:
"""
Initialize a BackupPolicyPlanRemote object.
@@ -25761,8 +27755,8 @@ def __init__(
def from_dict(cls, _dict: Dict) -> 'BackupPolicyPlanRemote':
"""Initialize a BackupPolicyPlanRemote object from a json dictionary."""
args = {}
- if 'region' in _dict:
- args['region'] = RegionReference.from_dict(_dict.get('region'))
+ if (region := _dict.get('region')) is not None:
+ args['region'] = RegionReference.from_dict(region)
return cls(**args)
@classmethod
@@ -25803,11 +27797,11 @@ class BackupPolicyPlanRemoteRegionPolicy:
"""
BackupPolicyPlanRemoteRegionPolicy.
- :attr int delete_over_count: The region this backup policy plan will create
+ :param int delete_over_count: The region this backup policy plan will create
backups in.
- :attr EncryptionKeyReference encryption_key: The root key used to rewrap the
+ :param EncryptionKeyReference encryption_key: The root key used to rewrap the
data encryption key for the backup (snapshot).
- :attr RegionReference region: The region this backup policy plan will create
+ :param RegionReference region: The region this backup policy plan will create
backups in.
"""
@@ -25835,16 +27829,16 @@ def __init__(
def from_dict(cls, _dict: Dict) -> 'BackupPolicyPlanRemoteRegionPolicy':
"""Initialize a BackupPolicyPlanRemoteRegionPolicy object from a json dictionary."""
args = {}
- if 'delete_over_count' in _dict:
- args['delete_over_count'] = _dict.get('delete_over_count')
+ if (delete_over_count := _dict.get('delete_over_count')) is not None:
+ args['delete_over_count'] = delete_over_count
else:
raise ValueError('Required property \'delete_over_count\' not present in BackupPolicyPlanRemoteRegionPolicy JSON')
- if 'encryption_key' in _dict:
- args['encryption_key'] = EncryptionKeyReference.from_dict(_dict.get('encryption_key'))
+ if (encryption_key := _dict.get('encryption_key')) is not None:
+ args['encryption_key'] = EncryptionKeyReference.from_dict(encryption_key)
else:
raise ValueError('Required property \'encryption_key\' not present in BackupPolicyPlanRemoteRegionPolicy JSON')
- if 'region' in _dict:
- args['region'] = RegionReference.from_dict(_dict.get('region'))
+ if (region := _dict.get('region')) is not None:
+ args['region'] = RegionReference.from_dict(region)
else:
raise ValueError('Required property \'region\' not present in BackupPolicyPlanRemoteRegionPolicy JSON')
return cls(**args)
@@ -25894,13 +27888,13 @@ class BackupPolicyPlanRemoteRegionPolicyPrototype:
"""
BackupPolicyPlanRemoteRegionPolicyPrototype.
- :attr int delete_over_count: (optional) The region this backup policy plan will
+ :param int delete_over_count: (optional) The region this backup policy plan will
create backups in.
- :attr EncryptionKeyIdentity encryption_key: (optional) The root key to use to
+ :param EncryptionKeyIdentity encryption_key: (optional) The root key to use to
rewrap the data encryption key for the backup (snapshot).
If unspecified, the source's `encryption_key` will be used.
The specified key may be in a different account, subject to IAM policies.
- :attr RegionIdentity region: The region this backup policy plan will create
+ :param RegionIdentity region: The region this backup policy plan will create
backups in.
"""
@@ -25908,8 +27902,8 @@ def __init__(
self,
region: 'RegionIdentity',
*,
- delete_over_count: int = None,
- encryption_key: 'EncryptionKeyIdentity' = None,
+ delete_over_count: Optional[int] = None,
+ encryption_key: Optional['EncryptionKeyIdentity'] = None,
) -> None:
"""
Initialize a BackupPolicyPlanRemoteRegionPolicyPrototype object.
@@ -25931,12 +27925,12 @@ def __init__(
def from_dict(cls, _dict: Dict) -> 'BackupPolicyPlanRemoteRegionPolicyPrototype':
"""Initialize a BackupPolicyPlanRemoteRegionPolicyPrototype object from a json dictionary."""
args = {}
- if 'delete_over_count' in _dict:
- args['delete_over_count'] = _dict.get('delete_over_count')
- if 'encryption_key' in _dict:
- args['encryption_key'] = _dict.get('encryption_key')
- if 'region' in _dict:
- args['region'] = _dict.get('region')
+ if (delete_over_count := _dict.get('delete_over_count')) is not None:
+ args['delete_over_count'] = delete_over_count
+ if (encryption_key := _dict.get('encryption_key')) is not None:
+ args['encryption_key'] = encryption_key
+ if (region := _dict.get('region')) is not None:
+ args['region'] = region
else:
raise ValueError('Required property \'region\' not present in BackupPolicyPlanRemoteRegionPolicyPrototype JSON')
return cls(**args)
@@ -25982,6 +27976,78 @@ def __ne__(self, other: 'BackupPolicyPlanRemoteRegionPolicyPrototype') -> bool:
return not self == other
+class BackupPolicyPrototype:
+ """
+ BackupPolicyPrototype.
+
+ :param str match_resource_type: The resource type this backup policy will apply
+ to. Resources that have both a matching type and a matching user tag will be
+ subject to the backup policy.
+ :param List[str] match_user_tags: The user tags this backup policy will apply
+ to. Resources that have both a matching user tag and a matching type will be
+ subject to the backup policy.
+ :param str name: (optional) The name for this backup policy. The name must not
+ be used by another backup policy in the region. If unspecified, the name will be
+ a hyphenated list of randomly-selected words.
+ :param List[BackupPolicyPlanPrototype] plans: (optional) The prototype objects
+ for backup plans to be created for this backup policy.
+ :param ResourceGroupIdentity resource_group: (optional) The resource group to
+ use. If unspecified, the account's [default resource
+ group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be
+ used.
+ :param BackupPolicyScopePrototype scope: (optional) The scope to use for this
+ backup policy.
+ If unspecified, the policy will be scoped to the account.
+ """
+
+ def __init__(
+ self,
+ match_resource_type: str,
+ match_user_tags: List[str],
+ *,
+ name: Optional[str] = None,
+ plans: Optional[List['BackupPolicyPlanPrototype']] = None,
+ resource_group: Optional['ResourceGroupIdentity'] = None,
+ scope: Optional['BackupPolicyScopePrototype'] = None,
+ ) -> None:
+ """
+ Initialize a BackupPolicyPrototype object.
+
+ :param str match_resource_type: The resource type this backup policy will
+ apply to. Resources that have both a matching type and a matching user tag
+ will be subject to the backup policy.
+ :param List[str] match_user_tags: The user tags this backup policy will
+ apply to. Resources that have both a matching user tag and a matching type
+ will be subject to the backup policy.
+ :param str name: (optional) The name for this backup policy. The name must
+ not be used by another backup policy in the region. If unspecified, the
+ name will be a hyphenated list of randomly-selected words.
+ :param List[BackupPolicyPlanPrototype] plans: (optional) The prototype
+ objects for backup plans to be created for this backup policy.
+ :param ResourceGroupIdentity resource_group: (optional) The resource group
+ to use. If unspecified, the account's [default resource
+ group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be
+ used.
+ :param BackupPolicyScopePrototype scope: (optional) The scope to use for
+ this backup policy.
+ If unspecified, the policy will be scoped to the account.
+ """
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['BackupPolicyPrototypeBackupPolicyMatchResourceTypeVolumePrototype', 'BackupPolicyPrototypeBackupPolicyMatchResourceTypeInstancePrototype'])
+ )
+ raise Exception(msg)
+
+ class MatchResourceTypeEnum(str, Enum):
+ """
+ The resource type this backup policy will apply to. Resources that have both a
+ matching type and a matching user tag will be subject to the backup policy.
+ """
+
+ INSTANCE = 'instance'
+ VOLUME = 'volume'
+
+
+
class BackupPolicyScope:
"""
The scope for this backup policy.
@@ -26025,52 +28091,69 @@ class BareMetalServer:
"""
BareMetalServer.
- :attr int bandwidth: The total bandwidth (in megabits per second) shared across
- the bare metal server network interfaces.
- :attr BareMetalServerBootTarget boot_target: The possible resource types for
+ :param int bandwidth: The total bandwidth (in megabits per second) shared across
+ the bare metal server network attachments or bare metal server network
+ interfaces.
+ :param 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
+ :param BareMetalServerCPU cpu: The bare metal server CPU configuration.
+ :param 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,
+ :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`.
- :attr bool enable_secure_boot: Indicates whether secure boot is enabled. If
+ :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.
- :attr str href: The URL for this bare metal server.
- :attr str id: The unique identifier for this bare metal server.
- :attr List[BareMetalServerLifecycleReason] lifecycle_reasons: The reasons for
+ :param str href: The URL for this bare metal server.
+ :param str id: The unique identifier for this bare metal server.
+ :param List[BareMetalServerLifecycleReason] lifecycle_reasons: The reasons for
the current `lifecycle_state` (if any).
The enumerated reason code values for this property will expand in the future.
When processing this property, check for and log unknown values. Optionally halt
processing and surface the error, or bypass the resource on which the unexpected
reason code was encountered.
- :attr str lifecycle_state: The lifecycle state of the bare metal server.
- :attr int memory: The amount of memory, truncated to whole gibibytes.
- :attr str name: The name for this bare metal server. The name is unique across
+ :param str lifecycle_state: The lifecycle state of the bare metal server.
+ :param int memory: The amount of memory, truncated to whole gibibytes.
+ :param str name: The name for this bare metal server. The name is unique across
all bare metal servers in the region.
- :attr List[NetworkInterfaceBareMetalServerContextReference] network_interfaces:
+ :param List[BareMetalServerNetworkAttachmentReference] network_attachments:
+ (optional) The network attachments for this bare metal server, including the
+ primary network attachment.
+ :param List[NetworkInterfaceBareMetalServerContextReference] network_interfaces:
The network interfaces for this bare metal server, including the primary network
interface.
- :attr NetworkInterfaceBareMetalServerContextReference primary_network_interface:
- The primary network interface for this bare metal server.
- :attr BareMetalServerProfileReference profile: The
+ If this bare metal server has network attachments, each network interface is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface.
+ :param BareMetalServerNetworkAttachmentReference primary_network_attachment:
+ (optional) The primary network attachment for this bare metal server.
+ :param NetworkInterfaceBareMetalServerContextReference
+ primary_network_interface: The primary network interface for this bare metal
+ server.
+ If this bare metal server has network attachments, this primary network
+ interface is
+ a [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of the primary network attachment and its attached virtual network interface.
+ :param BareMetalServerProfileReference profile: The
[profile](https://cloud.ibm.com/docs/vpc?topic=vpc-bare-metal-servers-profile)
for this bare metal server.
- :attr ResourceGroupReference resource_group: The resource group for this bare
+ :param 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
+ :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.
- :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.
+ :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.
"""
def __init__(
@@ -26098,12 +28181,16 @@ def __init__(
trusted_platform_module: 'BareMetalServerTrustedPlatformModule',
vpc: 'VPCReference',
zone: 'ZoneReference',
+ *,
+ network_attachments: Optional[List['BareMetalServerNetworkAttachmentReference']] = None,
+ primary_network_attachment: Optional['BareMetalServerNetworkAttachmentReference'] = None,
) -> None:
"""
Initialize a BareMetalServer object.
:param int bandwidth: The total bandwidth (in megabits per second) shared
- across the bare metal server network interfaces.
+ across the bare metal server network attachments or bare metal server
+ network interfaces.
:param BareMetalServerBootTarget boot_target: The possible resource types
for this property are expected to expand in the future.
:param BareMetalServerCPU cpu: The bare metal server CPU configuration.
@@ -26131,9 +28218,21 @@ def __init__(
:param List[NetworkInterfaceBareMetalServerContextReference]
network_interfaces: The network interfaces for this bare metal server,
including the primary network interface.
+ If this bare metal server has network attachments, each network interface
+ is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface.
:param NetworkInterfaceBareMetalServerContextReference
primary_network_interface: The primary network interface for this bare
metal server.
+ If this bare metal server has network attachments, this primary network
+ interface is
+ a [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of the primary network attachment and its attached virtual network
+ interface.
:param BareMetalServerProfileReference profile: The
[profile](https://cloud.ibm.com/docs/vpc?topic=vpc-bare-metal-servers-profile)
for this bare metal server.
@@ -26150,6 +28249,12 @@ def __init__(
:param BareMetalServerTrustedPlatformModule trusted_platform_module:
:param VPCReference vpc: The VPC this bare metal server resides in.
:param ZoneReference zone: The zone this bare metal server resides in.
+ :param List[BareMetalServerNetworkAttachmentReference] network_attachments:
+ (optional) The network attachments for this bare metal server, including
+ the primary network attachment.
+ :param BareMetalServerNetworkAttachmentReference
+ primary_network_attachment: (optional) The primary network attachment for
+ this bare metal server.
"""
self.bandwidth = bandwidth
self.boot_target = boot_target
@@ -26164,7 +28269,9 @@ def __init__(
self.lifecycle_state = lifecycle_state
self.memory = memory
self.name = name
+ self.network_attachments = network_attachments
self.network_interfaces = network_interfaces
+ self.primary_network_attachment = primary_network_attachment
self.primary_network_interface = primary_network_interface
self.profile = profile
self.resource_group = resource_group
@@ -26179,96 +28286,100 @@ def __init__(
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')
+ if (bandwidth := _dict.get('bandwidth')) is not None:
+ args['bandwidth'] = bandwidth
else:
raise ValueError('Required property \'bandwidth\' not present in BareMetalServer JSON')
- if 'boot_target' in _dict:
- args['boot_target'] = _dict.get('boot_target')
+ if (boot_target := _dict.get('boot_target')) is not None:
+ args['boot_target'] = 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'))
+ if (cpu := _dict.get('cpu')) is not None:
+ args['cpu'] = BareMetalServerCPU.from_dict(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'))
+ if (created_at := _dict.get('created_at')) is not None:
+ args['created_at'] = string_to_datetime(created_at)
else:
raise ValueError('Required property \'created_at\' not present in BareMetalServer JSON')
- if 'crn' in _dict:
- args['crn'] = _dict.get('crn')
+ if (crn := _dict.get('crn')) is not None:
+ args['crn'] = crn
else:
raise ValueError('Required property \'crn\' not present in BareMetalServer JSON')
- if 'disks' in _dict:
- args['disks'] = [BareMetalServerDisk.from_dict(v) for v in _dict.get('disks')]
+ if (disks := _dict.get('disks')) is not None:
+ args['disks'] = [BareMetalServerDisk.from_dict(v) for v in 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')
+ if (enable_secure_boot := _dict.get('enable_secure_boot')) is not None:
+ args['enable_secure_boot'] = 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')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
raise ValueError('Required property \'href\' not present in BareMetalServer JSON')
- if 'id' in _dict:
- args['id'] = _dict.get('id')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
else:
raise ValueError('Required property \'id\' not present in BareMetalServer JSON')
- if 'lifecycle_reasons' in _dict:
- args['lifecycle_reasons'] = [BareMetalServerLifecycleReason.from_dict(v) for v in _dict.get('lifecycle_reasons')]
+ if (lifecycle_reasons := _dict.get('lifecycle_reasons')) is not None:
+ args['lifecycle_reasons'] = [BareMetalServerLifecycleReason.from_dict(v) for v in lifecycle_reasons]
else:
raise ValueError('Required property \'lifecycle_reasons\' not present in BareMetalServer JSON')
- if 'lifecycle_state' in _dict:
- args['lifecycle_state'] = _dict.get('lifecycle_state')
+ if (lifecycle_state := _dict.get('lifecycle_state')) is not None:
+ args['lifecycle_state'] = lifecycle_state
else:
raise ValueError('Required property \'lifecycle_state\' not present in BareMetalServer JSON')
- if 'memory' in _dict:
- args['memory'] = _dict.get('memory')
+ if (memory := _dict.get('memory')) is not None:
+ args['memory'] = memory
else:
raise ValueError('Required property \'memory\' not present in BareMetalServer JSON')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
else:
raise ValueError('Required property \'name\' not present in BareMetalServer JSON')
- if 'network_interfaces' in _dict:
- args['network_interfaces'] = [NetworkInterfaceBareMetalServerContextReference.from_dict(v) for v in _dict.get('network_interfaces')]
+ if (network_attachments := _dict.get('network_attachments')) is not None:
+ args['network_attachments'] = [BareMetalServerNetworkAttachmentReference.from_dict(v) for v in network_attachments]
+ if (network_interfaces := _dict.get('network_interfaces')) is not None:
+ args['network_interfaces'] = [NetworkInterfaceBareMetalServerContextReference.from_dict(v) for v in 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'))
+ if (primary_network_attachment := _dict.get('primary_network_attachment')) is not None:
+ args['primary_network_attachment'] = BareMetalServerNetworkAttachmentReference.from_dict(primary_network_attachment)
+ if (primary_network_interface := _dict.get('primary_network_interface')) is not None:
+ args['primary_network_interface'] = NetworkInterfaceBareMetalServerContextReference.from_dict(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'))
+ if (profile := _dict.get('profile')) is not None:
+ args['profile'] = BareMetalServerProfileReference.from_dict(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'))
+ if (resource_group := _dict.get('resource_group')) is not None:
+ args['resource_group'] = ResourceGroupReference.from_dict(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')
+ if (resource_type := _dict.get('resource_type')) is not None:
+ args['resource_type'] = resource_type
else:
raise ValueError('Required property \'resource_type\' not present in BareMetalServer JSON')
- if 'status' in _dict:
- args['status'] = _dict.get('status')
+ if (status := _dict.get('status')) is not None:
+ args['status'] = status
else:
raise ValueError('Required property \'status\' not present in BareMetalServer JSON')
- if 'status_reasons' in _dict:
- args['status_reasons'] = [BareMetalServerStatusReason.from_dict(v) for v in _dict.get('status_reasons')]
+ if (status_reasons := _dict.get('status_reasons')) is not None:
+ args['status_reasons'] = [BareMetalServerStatusReason.from_dict(v) for v in 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'))
+ if (trusted_platform_module := _dict.get('trusted_platform_module')) is not None:
+ args['trusted_platform_module'] = BareMetalServerTrustedPlatformModule.from_dict(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'))
+ if (vpc := _dict.get('vpc')) is not None:
+ args['vpc'] = VPCReference.from_dict(vpc)
else:
raise ValueError('Required property \'vpc\' not present in BareMetalServer JSON')
- if 'zone' in _dict:
- args['zone'] = ZoneReference.from_dict(_dict.get('zone'))
+ if (zone := _dict.get('zone')) is not None:
+ args['zone'] = ZoneReference.from_dict(zone)
else:
raise ValueError('Required property \'zone\' not present in BareMetalServer JSON')
return cls(**args)
@@ -26325,6 +28436,14 @@ def to_dict(self) -> Dict:
_dict['memory'] = self.memory
if hasattr(self, 'name') and self.name is not None:
_dict['name'] = self.name
+ if hasattr(self, 'network_attachments') and self.network_attachments is not None:
+ network_attachments_list = []
+ for v in self.network_attachments:
+ if isinstance(v, dict):
+ network_attachments_list.append(v)
+ else:
+ network_attachments_list.append(v.to_dict())
+ _dict['network_attachments'] = network_attachments_list
if hasattr(self, 'network_interfaces') and self.network_interfaces is not None:
network_interfaces_list = []
for v in self.network_interfaces:
@@ -26333,6 +28452,11 @@ def to_dict(self) -> Dict:
else:
network_interfaces_list.append(v.to_dict())
_dict['network_interfaces'] = network_interfaces_list
+ if hasattr(self, 'primary_network_attachment') and self.primary_network_attachment is not None:
+ if isinstance(self.primary_network_attachment, dict):
+ _dict['primary_network_attachment'] = self.primary_network_attachment
+ else:
+ _dict['primary_network_attachment'] = self.primary_network_attachment.to_dict()
if hasattr(self, 'primary_network_interface') and self.primary_network_interface is not None:
if isinstance(self.primary_network_interface, dict):
_dict['primary_network_interface'] = self.primary_network_interface
@@ -26457,10 +28581,10 @@ 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.
+ :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.
"""
def __init__(
@@ -26487,20 +28611,20 @@ def __init__(
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')
+ if (architecture := _dict.get('architecture')) is not None:
+ args['architecture'] = architecture
else:
raise ValueError('Required property \'architecture\' not present in BareMetalServerCPU JSON')
- if 'core_count' in _dict:
- args['core_count'] = _dict.get('core_count')
+ if (core_count := _dict.get('core_count')) is not None:
+ args['core_count'] = 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')
+ if (socket_count := _dict.get('socket_count')) is not None:
+ args['socket_count'] = socket_count
else:
raise ValueError('Required property \'socket_count\' not present in BareMetalServerCPU JSON')
- if 'threads_per_core' in _dict:
- args['threads_per_core'] = _dict.get('threads_per_core')
+ if (threads_per_core := _dict.get('threads_per_core')) is not None:
+ args['threads_per_core'] = threads_per_core
else:
raise ValueError('Required property \'threads_per_core\' not present in BareMetalServerCPU JSON')
return cls(**args)
@@ -26546,16 +28670,16 @@ class BareMetalServerCollection:
"""
BareMetalServerCollection.
- :attr List[BareMetalServer] bare_metal_servers: Collection of bare metal
+ :param List[BareMetalServer] bare_metal_servers: Collection of bare metal
servers.
- :attr BareMetalServerCollectionFirst first: A link to the first page of
+ :param BareMetalServerCollectionFirst first: A link to the first page of
resources.
- :attr int limit: The maximum number of resources that can be returned by the
+ :param 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
+ :param 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.
+ :param int total_count: The total number of resources across all pages.
"""
def __init__(
@@ -26565,7 +28689,7 @@ def __init__(
limit: int,
total_count: int,
*,
- next: 'BareMetalServerCollectionNext' = None,
+ next: Optional['BareMetalServerCollectionNext'] = None,
) -> None:
"""
Initialize a BareMetalServerCollection object.
@@ -26591,22 +28715,22 @@ def __init__(
def from_dict(cls, _dict: Dict) -> 'BareMetalServerCollection':
"""Initialize a BareMetalServerCollection object from a json dictionary."""
args = {}
- if 'bare_metal_servers' in _dict:
- args['bare_metal_servers'] = [BareMetalServer.from_dict(v) for v in _dict.get('bare_metal_servers')]
+ if (bare_metal_servers := _dict.get('bare_metal_servers')) is not None:
+ args['bare_metal_servers'] = [BareMetalServer.from_dict(v) for v in bare_metal_servers]
else:
raise ValueError('Required property \'bare_metal_servers\' not present in BareMetalServerCollection JSON')
- if 'first' in _dict:
- args['first'] = BareMetalServerCollectionFirst.from_dict(_dict.get('first'))
+ if (first := _dict.get('first')) is not None:
+ args['first'] = BareMetalServerCollectionFirst.from_dict(first)
else:
raise ValueError('Required property \'first\' not present in BareMetalServerCollection JSON')
- if 'limit' in _dict:
- args['limit'] = _dict.get('limit')
+ if (limit := _dict.get('limit')) is not None:
+ args['limit'] = 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')
+ if (next := _dict.get('next')) is not None:
+ args['next'] = BareMetalServerCollectionNext.from_dict(next)
+ if (total_count := _dict.get('total_count')) is not None:
+ args['total_count'] = total_count
else:
raise ValueError('Required property \'total_count\' not present in BareMetalServerCollection JSON')
return cls(**args)
@@ -26666,7 +28790,7 @@ class BareMetalServerCollectionFirst:
"""
A link to the first page of resources.
- :attr str href: The URL for a page of resources.
+ :param str href: The URL for a page of resources.
"""
def __init__(
@@ -26684,8 +28808,8 @@ def __init__(
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')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
raise ValueError('Required property \'href\' not present in BareMetalServerCollectionFirst JSON')
return cls(**args)
@@ -26726,7 +28850,7 @@ 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.
+ :param str href: The URL for a page of resources.
"""
def __init__(
@@ -26744,8 +28868,8 @@ def __init__(
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')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
raise ValueError('Required property \'href\' not present in BareMetalServerCollectionNext JSON')
return cls(**args)
@@ -26785,16 +28909,16 @@ 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
+ :param 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
+ :param 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
+ :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.
- :attr str href: The URL to access this bare metal server console.
+ :param str href: The URL to access this bare metal server console.
"""
def __init__(
@@ -26833,28 +28957,28 @@ def __init__(
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')
+ if (access_token := _dict.get('access_token')) is not None:
+ args['access_token'] = 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')
+ if (console_type := _dict.get('console_type')) is not None:
+ args['console_type'] = 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'))
+ if (created_at := _dict.get('created_at')) is not None:
+ args['created_at'] = string_to_datetime(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'))
+ if (expires_at := _dict.get('expires_at')) is not None:
+ args['expires_at'] = string_to_datetime(expires_at)
else:
raise ValueError('Required property \'expires_at\' not present in BareMetalServerConsoleAccessToken JSON')
- if 'force' in _dict:
- args['force'] = _dict.get('force')
+ if (force := _dict.get('force')) is not None:
+ args['force'] = force
else:
raise ValueError('Required property \'force\' not present in BareMetalServerConsoleAccessToken JSON')
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
raise ValueError('Required property \'href\' not present in BareMetalServerConsoleAccessToken JSON')
return cls(**args)
@@ -26913,10 +29037,10 @@ 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.
+ :param datetime created_at: The date and time that the disk was created.
+ :param str href: The URL for this bare metal server disk.
+ :param str id: The unique identifier for this bare metal server disk.
+ :param str interface_type: The disk interface used for attaching the disk.
- `fcp`: Attached using Fiber Channel Protocol
- `sata`: Attached using Serial Advanced Technology Attachment
- `nvme`: Attached using Non-Volatile Memory Express
@@ -26924,10 +29048,10 @@ class BareMetalServerDisk:
When processing this property, check for and log unknown values. Optionally halt
processing and surface the error, or bypass the resource on which the unexpected
property value was encountered.
- :attr str name: The name for this bare metal server disk. The name is unique
+ :param str name: The name for this bare metal server disk. The name is unique
across all disks on the bare metal server.
- :attr str resource_type: The resource type.
- :attr int size: The size of the disk in GB (gigabytes).
+ :param str resource_type: The resource type.
+ :param int size: The size of the disk in GB (gigabytes).
"""
def __init__(
@@ -26971,32 +29095,32 @@ def __init__(
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'))
+ if (created_at := _dict.get('created_at')) is not None:
+ args['created_at'] = string_to_datetime(created_at)
else:
raise ValueError('Required property \'created_at\' not present in BareMetalServerDisk JSON')
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
raise ValueError('Required property \'href\' not present in BareMetalServerDisk JSON')
- if 'id' in _dict:
- args['id'] = _dict.get('id')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
else:
raise ValueError('Required property \'id\' not present in BareMetalServerDisk JSON')
- if 'interface_type' in _dict:
- args['interface_type'] = _dict.get('interface_type')
+ if (interface_type := _dict.get('interface_type')) is not None:
+ args['interface_type'] = interface_type
else:
raise ValueError('Required property \'interface_type\' not present in BareMetalServerDisk JSON')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
else:
raise ValueError('Required property \'name\' not present in BareMetalServerDisk JSON')
- if 'resource_type' in _dict:
- args['resource_type'] = _dict.get('resource_type')
+ if (resource_type := _dict.get('resource_type')) is not None:
+ args['resource_type'] = resource_type
else:
raise ValueError('Required property \'resource_type\' not present in BareMetalServerDisk JSON')
- if 'size' in _dict:
- args['size'] = _dict.get('size')
+ if (size := _dict.get('size')) is not None:
+ args['size'] = size
else:
raise ValueError('Required property \'size\' not present in BareMetalServerDisk JSON')
return cls(**args)
@@ -27073,7 +29197,7 @@ class BareMetalServerDiskCollection:
"""
BareMetalServerDiskCollection.
- :attr List[BareMetalServerDisk] disks: Collection of the bare metal server's
+ :param List[BareMetalServerDisk] disks: Collection of the bare metal server's
disks.
"""
@@ -27093,8 +29217,8 @@ def __init__(
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(v) for v in _dict.get('disks')]
+ if (disks := _dict.get('disks')) is not None:
+ args['disks'] = [BareMetalServerDisk.from_dict(v) for v in disks]
else:
raise ValueError('Required property \'disks\' not present in BareMetalServerDiskCollection JSON')
return cls(**args)
@@ -27140,14 +29264,14 @@ class BareMetalServerDiskPatch:
"""
BareMetalServerDiskPatch.
- :attr str name: (optional) The name for this bare metal server disk. The name
+ :param str name: (optional) The name for this bare metal server disk. The name
must not be used by another disk on the bare metal server.
"""
def __init__(
self,
*,
- name: str = None,
+ name: Optional[str] = None,
) -> None:
"""
Initialize a BareMetalServerDiskPatch object.
@@ -27161,8 +29285,8 @@ def __init__(
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')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
return cls(**args)
@classmethod
@@ -27201,7 +29325,7 @@ 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.
+ :param str more_info: Link to documentation about deleted resources.
"""
def __init__(
@@ -27219,8 +29343,8 @@ def __init__(
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')
+ if (more_info := _dict.get('more_info')) is not None:
+ args['more_info'] = more_info
else:
raise ValueError('Required property \'more_info\' not present in BareMetalServerDiskReferenceDeleted JSON')
return cls(**args)
@@ -27260,10 +29384,10 @@ class BareMetalServerInitialization:
"""
BareMetalServerInitialization.
- :attr ImageReference image: The image the bare metal server was provisioned
+ :param 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
+ :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.
"""
@@ -27292,16 +29416,16 @@ def __init__(
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'))
+ if (image := _dict.get('image')) is not None:
+ args['image'] = ImageReference.from_dict(image)
else:
raise ValueError('Required property \'image\' not present in BareMetalServerInitialization JSON')
- if 'keys' in _dict:
- args['keys'] = [KeyReference.from_dict(v) for v in _dict.get('keys')]
+ if (keys := _dict.get('keys')) is not None:
+ args['keys'] = [KeyReference.from_dict(v) for v in keys]
else:
raise ValueError('Required property \'keys\' not present in BareMetalServerInitialization JSON')
- if 'user_accounts' in _dict:
- args['user_accounts'] = _dict.get('user_accounts')
+ if (user_accounts := _dict.get('user_accounts')) is not None:
+ args['user_accounts'] = user_accounts
else:
raise ValueError('Required property \'user_accounts\' not present in BareMetalServerInitialization JSON')
return cls(**args)
@@ -27360,9 +29484,9 @@ 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
+ :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.
@@ -27370,8 +29494,8 @@ class BareMetalServerInitializationPrototype:
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.
+ :param str user_data: (optional) User data to be made available when
+ initializing the bare metal server.
"""
def __init__(
@@ -27379,7 +29503,7 @@ def __init__(
image: 'ImageIdentity',
keys: List['KeyIdentity'],
*,
- user_data: str = None,
+ user_data: Optional[str] = None,
) -> None:
"""
Initialize a BareMetalServerInitializationPrototype object.
@@ -27405,16 +29529,16 @@ def __init__(
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')
+ if (image := _dict.get('image')) is not None:
+ args['image'] = image
else:
raise ValueError('Required property \'image\' not present in BareMetalServerInitializationPrototype JSON')
- if 'keys' in _dict:
- args['keys'] = _dict.get('keys')
+ if (keys := _dict.get('keys')) is not None:
+ args['keys'] = keys
else:
raise ValueError('Required property \'keys\' not present in BareMetalServerInitializationPrototype JSON')
- if 'user_data' in _dict:
- args['user_data'] = _dict.get('user_data')
+ if (user_data := _dict.get('user_data')) is not None:
+ args['user_data'] = user_data
return cls(**args)
@classmethod
@@ -27484,10 +29608,10 @@ class BareMetalServerLifecycleReason:
"""
BareMetalServerLifecycleReason.
- :attr str code: A snake case string succinctly identifying the reason for this
+ :param str code: A snake case string succinctly identifying the reason for this
lifecycle state.
- :attr str message: An explanation of the reason for this lifecycle state.
- :attr str more_info: (optional) Link to documentation about the reason for this
+ :param str message: An explanation of the reason for this lifecycle state.
+ :param str more_info: (optional) Link to documentation about the reason for this
lifecycle state.
"""
@@ -27496,7 +29620,7 @@ def __init__(
code: str,
message: str,
*,
- more_info: str = None,
+ more_info: Optional[str] = None,
) -> None:
"""
Initialize a BareMetalServerLifecycleReason object.
@@ -27515,16 +29639,16 @@ def __init__(
def from_dict(cls, _dict: Dict) -> 'BareMetalServerLifecycleReason':
"""Initialize a BareMetalServerLifecycleReason object from a json dictionary."""
args = {}
- if 'code' in _dict:
- args['code'] = _dict.get('code')
+ if (code := _dict.get('code')) is not None:
+ args['code'] = code
else:
raise ValueError('Required property \'code\' not present in BareMetalServerLifecycleReason JSON')
- if 'message' in _dict:
- args['message'] = _dict.get('message')
+ if (message := _dict.get('message')) is not None:
+ args['message'] = message
else:
raise ValueError('Required property \'message\' not present in BareMetalServerLifecycleReason JSON')
- if 'more_info' in _dict:
- args['more_info'] = _dict.get('more_info')
+ if (more_info := _dict.get('more_info')) is not None:
+ args['more_info'] = more_info
return cls(**args)
@classmethod
@@ -27570,229 +29694,161 @@ class CodeEnum(str, Enum):
-class BareMetalServerNetworkInterface:
+class BareMetalServerNetworkAttachment:
"""
- BareMetalServerNetworkInterface.
+ BareMetalServerNetworkAttachment.
- :attr bool allow_ip_spoofing: Indicates whether source IP spoofing is allowed on
- this bare metal server network interface.
- :attr datetime created_at: The date and time that the bare metal server network
- interface was created.
- :attr bool enable_infrastructure_nat: If `true`:
- - The VPC infrastructure performs any needed NAT operations.
- - `floating_ips` must not have more than one floating IP.
- If `false`:
- - Packets are passed unchanged to/from the bare metal server network interface,
- allowing the workload to perform any needed NAT operations.
- - `allow_ip_spoofing` must be `false`.
- - `interface_type` must not be `hipersocket`.
- :attr List[FloatingIPReference] floating_ips: The floating IPs associated with
- this bare metal server network interface.
- :attr str href: The URL for this bare metal server network interface.
- :attr str id: The unique identifier for this bare metal server network
- interface.
- :attr str interface_type: The interface type:
- - `hipersocket`: a virtual device that provides high-speed TCP/IP connectivity
- within a `s390x` based system
+ :param datetime created_at: The date and time that the bare metal server network
+ attachment was created.
+ :param str href: The URL for this bare metal server network attachment.
+ :param str id: The unique identifier for this bare metal server network
+ attachment.
+ :param str interface_type: The network attachment's 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
+ to use the PCI attachment
- Cannot directly use an IEEE 802.1Q tag.
- `vlan`: a virtual device, used through a `pci` device that has the `vlan` in
its
array of `allowed_vlans`.
- Must use an IEEE 802.1Q tag.
- - Has its own security groups and does not inherit those of the PCI device
- through
- which traffic flows.
The enumerated values for this property are expected to expand in the future.
When processing this property, check for and log unknown values. Optionally halt
processing and surface the error, or bypass the resource on which the unexpected
property value was encountered.
- :attr str mac_address: The MAC address of this bare metal server network
- interface. If the MAC address has not yet been selected, the value will be an
- empty string.
- :attr str name: The name for this bare metal server network interface.
- :attr int port_speed: The bare metal server network interface port speed in
- Mbps.
- :attr ReservedIPReference primary_ip:
- :attr str resource_type: The resource type.
- :attr List[SecurityGroupReference] security_groups: The security groups
- targeting this bare metal server network interface.
- :attr str status: The status of the bare metal server network interface.
- :attr SubnetReference subnet: The associated subnet.
- :attr str type: The bare metal server network interface type.
+ :param str lifecycle_state: The lifecycle state of the bare metal server network
+ attachment.
+ :param str name: The name for this bare metal server network attachment. The
+ name is unique across all network attachments for the bare metal server.
+ :param int port_speed: The port speed for this bare metal server network
+ attachment in Mbps.
+ :param ReservedIPReference primary_ip: The primary IP address of the virtual
+ network interface for the bare metal server
+ network attachment.
+ :param str resource_type: The resource type.
+ :param SubnetReference subnet: The subnet of the virtual network interface for
+ the bare metal server network
+ attachment.
+ :param str type: The bare metal server network attachment type.
+ :param VirtualNetworkInterfaceReferenceAttachmentContext
+ virtual_network_interface: The virtual network interface for this bare metal
+ server network attachment.
"""
def __init__(
self,
- allow_ip_spoofing: bool,
created_at: datetime,
- enable_infrastructure_nat: bool,
- floating_ips: List['FloatingIPReference'],
href: str,
id: str,
interface_type: str,
- mac_address: str,
+ lifecycle_state: str,
name: str,
port_speed: int,
primary_ip: 'ReservedIPReference',
resource_type: str,
- security_groups: List['SecurityGroupReference'],
- status: str,
subnet: 'SubnetReference',
type: str,
+ virtual_network_interface: 'VirtualNetworkInterfaceReferenceAttachmentContext',
) -> None:
"""
- Initialize a BareMetalServerNetworkInterface object.
+ Initialize a BareMetalServerNetworkAttachment object.
- :param bool allow_ip_spoofing: Indicates whether source IP spoofing is
- allowed on this bare metal server network interface.
:param datetime created_at: The date and time that the bare metal server
- network interface was created.
- :param bool enable_infrastructure_nat: If `true`:
- - The VPC infrastructure performs any needed NAT operations.
- - `floating_ips` must not have more than one floating IP.
- If `false`:
- - Packets are passed unchanged to/from the bare metal server network
- interface,
- allowing the workload to perform any needed NAT operations.
- - `allow_ip_spoofing` must be `false`.
- - `interface_type` must not be `hipersocket`.
- :param List[FloatingIPReference] floating_ips: The floating IPs associated
- with this bare metal server network interface.
- :param str href: The URL for this bare metal server network interface.
+ network attachment was created.
+ :param str href: The URL for this bare metal server network attachment.
:param str id: The unique identifier for this bare metal server network
- interface.
- :param str interface_type: The interface type:
- - `hipersocket`: a virtual device that provides high-speed TCP/IP
- connectivity
- within a `s390x` based system
+ attachment.
+ :param str interface_type: The network attachment's 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
+ to use the PCI attachment
- Cannot directly use an IEEE 802.1Q tag.
- `vlan`: a virtual device, used through a `pci` device that has the `vlan`
in its
array of `allowed_vlans`.
- Must use an IEEE 802.1Q tag.
- - Has its own security groups and does not inherit those of the PCI
- device through
- which traffic flows.
The enumerated values for this property are expected to expand in the
future. When processing this property, check for and log unknown values.
Optionally halt processing and surface the error, or bypass the resource on
which the unexpected property value was encountered.
- :param str mac_address: The MAC address of this bare metal server network
- interface. If the MAC address has not yet been selected, the value will be
- an empty string.
- :param str name: The name for this bare metal server network interface.
- :param int port_speed: The bare metal server network interface port speed
- in Mbps.
- :param ReservedIPReference primary_ip:
+ :param str lifecycle_state: The lifecycle state of the bare metal server
+ network attachment.
+ :param str name: The name for this bare metal server network attachment.
+ The name is unique across all network attachments for the bare metal
+ server.
+ :param int port_speed: The port speed for this bare metal server network
+ attachment in Mbps.
+ :param ReservedIPReference primary_ip: The primary IP address of the
+ virtual network interface for the bare metal server
+ network attachment.
:param str resource_type: The resource type.
- :param List[SecurityGroupReference] security_groups: The security groups
- targeting this bare metal server network interface.
- :param str status: The status of the bare metal server network interface.
- :param SubnetReference subnet: The associated subnet.
- :param str type: The bare metal server network interface type.
+ :param SubnetReference subnet: The subnet of the virtual network interface
+ for the bare metal server network
+ attachment.
+ :param str type: The bare metal server network attachment type.
+ :param VirtualNetworkInterfaceReferenceAttachmentContext
+ virtual_network_interface: The virtual network interface for this bare
+ metal server network attachment.
"""
msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['BareMetalServerNetworkInterfaceByHiperSocket', 'BareMetalServerNetworkInterfaceByPCI', 'BareMetalServerNetworkInterfaceByVLAN'])
- )
- raise Exception(msg)
-
- @classmethod
- def from_dict(cls, _dict: Dict) -> 'BareMetalServerNetworkInterface':
- """Initialize a BareMetalServerNetworkInterface object from a json dictionary."""
- disc_class = cls._get_class_by_discriminator(_dict)
- if disc_class != cls:
- return disc_class.from_dict(_dict)
- msg = "Cannot convert dictionary into an instance of base class 'BareMetalServerNetworkInterface'. The discriminator value should map to a valid subclass: {1}".format(
- ", ".join(['BareMetalServerNetworkInterfaceByHiperSocket', 'BareMetalServerNetworkInterfaceByPCI', 'BareMetalServerNetworkInterfaceByVLAN'])
+ ", ".join(['BareMetalServerNetworkAttachmentByPCI', 'BareMetalServerNetworkAttachmentByVLAN'])
)
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['hipersocket'] = 'BareMetalServerNetworkInterfaceByHiperSocket'
- mapping['pci'] = 'BareMetalServerNetworkInterfaceByPCI'
- mapping['vlan'] = 'BareMetalServerNetworkInterfaceByVLAN'
- disc_value = _dict.get('interface_type')
- if disc_value is None:
- raise ValueError('Discriminator property \'interface_type\' not found in BareMetalServerNetworkInterface JSON')
- class_name = mapping.get(disc_value, disc_value)
- try:
- disc_class = getattr(sys.modules[__name__], class_name)
- except AttributeError:
- disc_class = cls
- if isinstance(disc_class, object):
- return disc_class
- raise TypeError('%s is not a discriminator class' % class_name)
-
class InterfaceTypeEnum(str, Enum):
"""
- The interface type:
- - `hipersocket`: a virtual device that provides high-speed TCP/IP connectivity
- within a `s390x` based system
+ The network attachment's 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
+ to use the PCI attachment
- Cannot directly use an IEEE 802.1Q tag.
- `vlan`: a virtual device, used through a `pci` device that has the `vlan` in its
array of `allowed_vlans`.
- Must use an IEEE 802.1Q tag.
- - Has its own security groups and does not inherit those of the PCI device
- through
- which traffic flows.
The enumerated values for this property are expected to expand in the future. When
processing this property, check for and log unknown values. Optionally halt
processing and surface the error, or bypass the resource on which the unexpected
property value was encountered.
"""
- HIPERSOCKET = 'hipersocket'
PCI = 'pci'
VLAN = 'vlan'
- class ResourceTypeEnum(str, Enum):
+ class LifecycleStateEnum(str, Enum):
"""
- The resource type.
+ The lifecycle state of the bare metal server network attachment.
"""
- NETWORK_INTERFACE = 'network_interface'
+ DELETING = 'deleting'
+ FAILED = 'failed'
+ PENDING = 'pending'
+ STABLE = 'stable'
+ SUSPENDED = 'suspended'
+ UPDATING = 'updating'
+ WAITING = 'waiting'
- class StatusEnum(str, Enum):
+ class ResourceTypeEnum(str, Enum):
"""
- The status of the bare metal server network interface.
+ The resource type.
"""
- AVAILABLE = 'available'
- DELETING = 'deleting'
- FAILED = 'failed'
- PENDING = 'pending'
+ BARE_METAL_SERVER_NETWORK_ATTACHMENT = 'bare_metal_server_network_attachment'
class TypeEnum(str, Enum):
"""
- The bare metal server network interface type.
+ The bare metal server network attachment type.
"""
PRIMARY = 'primary'
@@ -27800,78 +29856,78 @@ class TypeEnum(str, Enum):
-class BareMetalServerNetworkInterfaceCollection:
+class BareMetalServerNetworkAttachmentCollection:
"""
- BareMetalServerNetworkInterfaceCollection.
+ BareMetalServerNetworkAttachmentCollection.
- :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
+ :param BareMetalServerNetworkAttachmentCollectionFirst first: A link to the
+ first page of resources.
+ :param int limit: The maximum number of resources that can be returned by the
request.
- :attr List[BareMetalServerNetworkInterface] network_interfaces: Collection of
- bare metal server network interfaces.
- :attr BareMetalServerNetworkInterfaceCollectionNext next: (optional) A link to
+ :param List[BareMetalServerNetworkAttachment] network_attachments: Collection of
+ bare metal server network attachments.
+ :param BareMetalServerNetworkAttachmentCollectionNext 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.
+ :param int total_count: The total number of resources across all pages.
"""
def __init__(
self,
- first: 'BareMetalServerNetworkInterfaceCollectionFirst',
+ first: 'BareMetalServerNetworkAttachmentCollectionFirst',
limit: int,
- network_interfaces: List['BareMetalServerNetworkInterface'],
+ network_attachments: List['BareMetalServerNetworkAttachment'],
total_count: int,
*,
- next: 'BareMetalServerNetworkInterfaceCollectionNext' = None,
+ next: Optional['BareMetalServerNetworkAttachmentCollectionNext'] = None,
) -> None:
"""
- Initialize a BareMetalServerNetworkInterfaceCollection object.
+ Initialize a BareMetalServerNetworkAttachmentCollection object.
- :param BareMetalServerNetworkInterfaceCollectionFirst first: A link to the
+ :param BareMetalServerNetworkAttachmentCollectionFirst first: A link to the
first page of resources.
:param int limit: The maximum number of resources that can be returned by
the request.
- :param List[BareMetalServerNetworkInterface] network_interfaces: Collection
- of bare metal server network interfaces.
+ :param List[BareMetalServerNetworkAttachment] network_attachments:
+ Collection of bare metal server network attachments.
:param int total_count: The total number of resources across all pages.
- :param BareMetalServerNetworkInterfaceCollectionNext next: (optional) A
+ :param BareMetalServerNetworkAttachmentCollectionNext 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.network_attachments = network_attachments
self.next = next
self.total_count = total_count
@classmethod
- def from_dict(cls, _dict: Dict) -> 'BareMetalServerNetworkInterfaceCollection':
- """Initialize a BareMetalServerNetworkInterfaceCollection object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'BareMetalServerNetworkAttachmentCollection':
+ """Initialize a BareMetalServerNetworkAttachmentCollection object from a json dictionary."""
args = {}
- if 'first' in _dict:
- args['first'] = BareMetalServerNetworkInterfaceCollectionFirst.from_dict(_dict.get('first'))
+ if (first := _dict.get('first')) is not None:
+ args['first'] = BareMetalServerNetworkAttachmentCollectionFirst.from_dict(first)
else:
- raise ValueError('Required property \'first\' not present in BareMetalServerNetworkInterfaceCollection JSON')
- if 'limit' in _dict:
- args['limit'] = _dict.get('limit')
+ raise ValueError('Required property \'first\' not present in BareMetalServerNetworkAttachmentCollection JSON')
+ if (limit := _dict.get('limit')) is not None:
+ args['limit'] = limit
else:
- raise ValueError('Required property \'limit\' not present in BareMetalServerNetworkInterfaceCollection JSON')
- if 'network_interfaces' in _dict:
- args['network_interfaces'] = [BareMetalServerNetworkInterface.from_dict(v) for v in _dict.get('network_interfaces')]
+ raise ValueError('Required property \'limit\' not present in BareMetalServerNetworkAttachmentCollection JSON')
+ if (network_attachments := _dict.get('network_attachments')) is not None:
+ args['network_attachments'] = network_attachments
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')
+ raise ValueError('Required property \'network_attachments\' not present in BareMetalServerNetworkAttachmentCollection JSON')
+ if (next := _dict.get('next')) is not None:
+ args['next'] = BareMetalServerNetworkAttachmentCollectionNext.from_dict(next)
+ if (total_count := _dict.get('total_count')) is not None:
+ args['total_count'] = total_count
else:
- raise ValueError('Required property \'total_count\' not present in BareMetalServerNetworkInterfaceCollection JSON')
+ raise ValueError('Required property \'total_count\' not present in BareMetalServerNetworkAttachmentCollection JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a BareMetalServerNetworkInterfaceCollection object from a json dictionary."""
+ """Initialize a BareMetalServerNetworkAttachmentCollection object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -27884,14 +29940,14 @@ def to_dict(self) -> Dict:
_dict['first'] = self.first.to_dict()
if hasattr(self, 'limit') and self.limit is not None:
_dict['limit'] = self.limit
- if hasattr(self, 'network_interfaces') and self.network_interfaces is not None:
- network_interfaces_list = []
- for v in self.network_interfaces:
+ if hasattr(self, 'network_attachments') and self.network_attachments is not None:
+ network_attachments_list = []
+ for v in self.network_attachments:
if isinstance(v, dict):
- network_interfaces_list.append(v)
+ network_attachments_list.append(v)
else:
- network_interfaces_list.append(v.to_dict())
- _dict['network_interfaces'] = network_interfaces_list
+ network_attachments_list.append(v.to_dict())
+ _dict['network_attachments'] = network_attachments_list
if hasattr(self, 'next') and self.next is not None:
if isinstance(self.next, dict):
_dict['next'] = self.next
@@ -27906,25 +29962,25 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this BareMetalServerNetworkInterfaceCollection object."""
+ """Return a `str` version of this BareMetalServerNetworkAttachmentCollection object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'BareMetalServerNetworkInterfaceCollection') -> bool:
+ def __eq__(self, other: 'BareMetalServerNetworkAttachmentCollection') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'BareMetalServerNetworkInterfaceCollection') -> bool:
+ def __ne__(self, other: 'BareMetalServerNetworkAttachmentCollection') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class BareMetalServerNetworkInterfaceCollectionFirst:
+class BareMetalServerNetworkAttachmentCollectionFirst:
"""
A link to the first page of resources.
- :attr str href: The URL for a page of resources.
+ :param str href: The URL for a page of resources.
"""
def __init__(
@@ -27932,25 +29988,25 @@ def __init__(
href: str,
) -> None:
"""
- Initialize a BareMetalServerNetworkInterfaceCollectionFirst object.
+ Initialize a BareMetalServerNetworkAttachmentCollectionFirst object.
:param str href: The URL for a page of resources.
"""
self.href = href
@classmethod
- def from_dict(cls, _dict: Dict) -> 'BareMetalServerNetworkInterfaceCollectionFirst':
- """Initialize a BareMetalServerNetworkInterfaceCollectionFirst object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'BareMetalServerNetworkAttachmentCollectionFirst':
+ """Initialize a BareMetalServerNetworkAttachmentCollectionFirst object from a json dictionary."""
args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'href\' not present in BareMetalServerNetworkInterfaceCollectionFirst JSON')
+ raise ValueError('Required property \'href\' not present in BareMetalServerNetworkAttachmentCollectionFirst JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a BareMetalServerNetworkInterfaceCollectionFirst object from a json dictionary."""
+ """Initialize a BareMetalServerNetworkAttachmentCollectionFirst object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -27965,26 +30021,26 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this BareMetalServerNetworkInterfaceCollectionFirst object."""
+ """Return a `str` version of this BareMetalServerNetworkAttachmentCollectionFirst object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'BareMetalServerNetworkInterfaceCollectionFirst') -> bool:
+ def __eq__(self, other: 'BareMetalServerNetworkAttachmentCollectionFirst') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'BareMetalServerNetworkInterfaceCollectionFirst') -> bool:
+ def __ne__(self, other: 'BareMetalServerNetworkAttachmentCollectionFirst') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class BareMetalServerNetworkInterfaceCollectionNext:
+class BareMetalServerNetworkAttachmentCollectionNext:
"""
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.
+ :param str href: The URL for a page of resources.
"""
def __init__(
@@ -27992,25 +30048,25 @@ def __init__(
href: str,
) -> None:
"""
- Initialize a BareMetalServerNetworkInterfaceCollectionNext object.
+ Initialize a BareMetalServerNetworkAttachmentCollectionNext object.
:param str href: The URL for a page of resources.
"""
self.href = href
@classmethod
- def from_dict(cls, _dict: Dict) -> 'BareMetalServerNetworkInterfaceCollectionNext':
- """Initialize a BareMetalServerNetworkInterfaceCollectionNext object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'BareMetalServerNetworkAttachmentCollectionNext':
+ """Initialize a BareMetalServerNetworkAttachmentCollectionNext object from a json dictionary."""
args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'href\' not present in BareMetalServerNetworkInterfaceCollectionNext JSON')
+ raise ValueError('Required property \'href\' not present in BareMetalServerNetworkAttachmentCollectionNext JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a BareMetalServerNetworkInterfaceCollectionNext object from a json dictionary."""
+ """Initialize a BareMetalServerNetworkAttachmentCollectionNext object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -28025,106 +30081,71 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this BareMetalServerNetworkInterfaceCollectionNext object."""
+ """Return a `str` version of this BareMetalServerNetworkAttachmentCollectionNext object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'BareMetalServerNetworkInterfaceCollectionNext') -> bool:
+ def __eq__(self, other: 'BareMetalServerNetworkAttachmentCollectionNext') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'BareMetalServerNetworkInterfaceCollectionNext') -> bool:
+ def __ne__(self, other: 'BareMetalServerNetworkAttachmentCollectionNext') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class BareMetalServerNetworkInterfacePatch:
+class BareMetalServerNetworkAttachmentPatch:
"""
- BareMetalServerNetworkInterfacePatch.
+ BareMetalServerNetworkAttachmentPatch.
- :attr bool allow_ip_spoofing: (optional) Indicates whether source IP spoofing is
- allowed on this bare metal server network interface.
- :attr List[int] allowed_vlans: (optional) The VLAN IDs to allow for `vlan`
- interfaces using this PCI interface, replacing any existing VLAN IDs. The
- specified values must include IDs for all `vlan` interfaces currently using this
- PCI interface.
- :attr bool enable_infrastructure_nat: (optional) If `true`:
- - The VPC infrastructure performs any needed NAT operations.
- - `floating_ips` must not have more than one floating IP.
- If `false`:
- - Packets are passed unchanged to/from the bare metal server network interface,
- allowing the workload to perform any needed NAT operations.
- - `allow_ip_spoofing` must be `false`.
- - `interface_type` must not be `hipersocket`.
- :attr str name: (optional) The name for this bare metal server network
- interface. The name must not be used by another network interface on the bare
- metal server.
+ :param List[int] allowed_vlans: (optional) The VLAN IDs to allow for `vlan`
+ attachments using this PCI attachment, replacing any existing VLAN IDs. The
+ specified values must include IDs for all `vlan` attachments currently using
+ this PCI attachment.
+ :param str name: (optional) The name for this network attachment. The name must
+ not be used by another network attachment for the bare metal server.
"""
def __init__(
self,
*,
- allow_ip_spoofing: bool = None,
- allowed_vlans: List[int] = None,
- enable_infrastructure_nat: bool = None,
- name: str = None,
+ allowed_vlans: Optional[List[int]] = None,
+ name: Optional[str] = None,
) -> None:
"""
- Initialize a BareMetalServerNetworkInterfacePatch object.
+ Initialize a BareMetalServerNetworkAttachmentPatch object.
- :param bool allow_ip_spoofing: (optional) Indicates whether source IP
- spoofing is allowed on this bare metal server network interface.
:param List[int] allowed_vlans: (optional) The VLAN IDs to allow for `vlan`
- interfaces using this PCI interface, replacing any existing VLAN IDs. The
- specified values must include IDs for all `vlan` interfaces currently using
- this PCI interface.
- :param bool enable_infrastructure_nat: (optional) If `true`:
- - The VPC infrastructure performs any needed NAT operations.
- - `floating_ips` must not have more than one floating IP.
- If `false`:
- - Packets are passed unchanged to/from the bare metal server network
- interface,
- allowing the workload to perform any needed NAT operations.
- - `allow_ip_spoofing` must be `false`.
- - `interface_type` must not be `hipersocket`.
- :param str name: (optional) The name for this bare metal server network
- interface. The name must not be used by another network interface on the
- bare metal server.
+ attachments using this PCI attachment, replacing any existing VLAN IDs. The
+ specified values must include IDs for all `vlan` attachments currently
+ using this PCI attachment.
+ :param str name: (optional) The name for this network attachment. The name
+ must not be used by another network attachment for the bare metal server.
"""
- self.allow_ip_spoofing = allow_ip_spoofing
self.allowed_vlans = allowed_vlans
- self.enable_infrastructure_nat = enable_infrastructure_nat
self.name = name
@classmethod
- def from_dict(cls, _dict: Dict) -> 'BareMetalServerNetworkInterfacePatch':
- """Initialize a BareMetalServerNetworkInterfacePatch object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'BareMetalServerNetworkAttachmentPatch':
+ """Initialize a BareMetalServerNetworkAttachmentPatch 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')
+ if (allowed_vlans := _dict.get('allowed_vlans')) is not None:
+ args['allowed_vlans'] = allowed_vlans
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a BareMetalServerNetworkInterfacePatch object from a json dictionary."""
+ """Initialize a BareMetalServerNetworkAttachmentPatch object from 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
@@ -28134,98 +30155,70 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this BareMetalServerNetworkInterfacePatch object."""
+ """Return a `str` version of this BareMetalServerNetworkAttachmentPatch object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'BareMetalServerNetworkInterfacePatch') -> bool:
+ def __eq__(self, other: 'BareMetalServerNetworkAttachmentPatch') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'BareMetalServerNetworkInterfacePatch') -> bool:
+ def __ne__(self, other: 'BareMetalServerNetworkAttachmentPatch') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class BareMetalServerNetworkInterfacePrototype:
+class BareMetalServerNetworkAttachmentPrototype:
"""
- BareMetalServerNetworkInterfacePrototype.
+ BareMetalServerNetworkAttachmentPrototype.
- :attr bool allow_ip_spoofing: (optional) Indicates whether source IP spoofing is
- allowed on this bare metal server network interface.
- :attr bool enable_infrastructure_nat: (optional) If `true`:
- - The VPC infrastructure performs any needed NAT operations.
- - `floating_ips` must not have more than one floating IP.
- If `false`:
- - Packets are passed unchanged to/from the bare metal server network interface,
- allowing the workload to perform any needed NAT operations.
- - `allow_ip_spoofing` must be `false`.
- - `interface_type` must not be `hipersocket`.
- :attr str interface_type: The interface type:
- - `hipersocket`: a virtual device that provides high-speed TCP/IP connectivity
- within a `s390x` based system
- - Not supported on bare metal servers with a `cpu.architecture` of `amd64`
+ :param str interface_type: The network attachment's 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
+ to use the PCI attachment
- Cannot directly use an IEEE 802.1Q tag.
- Not supported on bare metal servers with a `cpu.architecture` of `s390x`
- `vlan`: a virtual device, used through a `pci` device that has the `vlan` in
its
array of `allowed_vlans`.
- Must use an IEEE 802.1Q tag.
- - Has its own security groups and does not inherit those of the PCI device
- through
- which traffic flows.
- Not supported on bare metal servers with a `cpu.architecture` of `s390x`.
- :attr str name: (optional) The name for this bare metal server network
- interface. The name must not be used by another network interface on the bare
- metal server. If unspecified, the name will be a hyphenated list of
+ :param str name: (optional) The name for this bare metal server network
+ attachment. Names must be unique within the bare metal server the network
+ attachment resides in. If unspecified, the name will be a hyphenated list of
randomly-selected words.
- :attr NetworkInterfaceIPPrototype primary_ip: (optional) The primary IP address
- to bind to the bare metal server network interface. This can be
- specified using an existing reserved IP, or a prototype object for a new
- reserved IP.
- If an existing reserved IP or a prototype object with an address is specified,
- it must
- be available on the bare metal server network interface's subnet. Otherwise, an
- available address on the subnet will be automatically selected and reserved.
- :attr List[SecurityGroupIdentity] security_groups: (optional) The security
- groups to use for this bare metal server network interface. If unspecified, the
- VPC's default security group is used.
- :attr SubnetIdentity subnet: The associated subnet.
+ :param BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterface
+ virtual_network_interface: A virtual network interface for the bare metal server
+ network attachment. This can be
+ specified using an existing virtual network interface, or a prototype object for
+ a new
+ virtual network interface.
+ If an existing virtual network interface is specified, it must not be the target
+ of a flow
+ log collector.
"""
def __init__(
self,
interface_type: str,
- subnet: 'SubnetIdentity',
+ virtual_network_interface: 'BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterface',
*,
- allow_ip_spoofing: bool = None,
- enable_infrastructure_nat: bool = None,
- name: str = None,
- primary_ip: 'NetworkInterfaceIPPrototype' = None,
- security_groups: List['SecurityGroupIdentity'] = None,
+ name: Optional[str] = None,
) -> None:
"""
- Initialize a BareMetalServerNetworkInterfacePrototype object.
+ Initialize a BareMetalServerNetworkAttachmentPrototype object.
- :param str interface_type: The interface type:
- - `hipersocket`: a virtual device that provides high-speed TCP/IP
- connectivity
- within a `s390x` based system
- - Not supported on bare metal servers with a `cpu.architecture` of
- `amd64`
+ :param str interface_type: The network attachment's 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
+ to use the PCI attachment
- Cannot directly use an IEEE 802.1Q tag.
- Not supported on bare metal servers with a `cpu.architecture` of
`s390x`
@@ -28233,148 +30226,197 @@ def __init__(
in its
array of `allowed_vlans`.
- Must use an IEEE 802.1Q tag.
- - Has its own security groups and does not inherit those of the PCI
- device through
- which traffic flows.
- Not supported on bare metal servers with a `cpu.architecture` of
`s390x`.
- :param SubnetIdentity subnet: The associated subnet.
- :param bool allow_ip_spoofing: (optional) Indicates whether source IP
- spoofing is allowed on this bare metal server network interface.
- :param bool enable_infrastructure_nat: (optional) If `true`:
- - The VPC infrastructure performs any needed NAT operations.
- - `floating_ips` must not have more than one floating IP.
- If `false`:
- - Packets are passed unchanged to/from the bare metal server network
- interface,
- allowing the workload to perform any needed NAT operations.
- - `allow_ip_spoofing` must be `false`.
- - `interface_type` must not be `hipersocket`.
+ :param BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterface
+ virtual_network_interface: A virtual network interface for the bare metal
+ server network attachment. This can be
+ specified using an existing virtual network interface, or a prototype
+ object for a new
+ virtual network interface.
+ If an existing virtual network interface is specified, it must not be the
+ target of a flow
+ log collector.
:param str name: (optional) The name for this bare metal server network
- interface. The name must not be used by another network interface on the
- bare metal server. If unspecified, the name will be a hyphenated list of
- randomly-selected words.
- :param NetworkInterfaceIPPrototype primary_ip: (optional) The primary IP
- address to bind to the bare metal server network interface. This can be
- specified using an existing reserved IP, or a prototype object for a new
- reserved IP.
- If an existing reserved IP or a prototype object with an address is
- specified, it must
- be available on the bare metal server network interface's subnet.
- Otherwise, an
- available address on the subnet will be automatically selected and
- reserved.
- :param List[SecurityGroupIdentity] security_groups: (optional) The security
- groups to use for this bare metal server network interface. If unspecified,
- the VPC's default security group is used.
+ attachment. Names must be unique within the bare metal server the network
+ attachment 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(['BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype', '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(['BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype', 'BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPCIPrototype', 'BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVLANPrototype'])
+ ", ".join(['BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByPCIPrototype', 'BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByVLANPrototype'])
)
raise Exception(msg)
- @classmethod
- def _from_dict(cls, _dict: Dict):
- """Initialize a BareMetalServerNetworkInterfacePrototype object from a json dictionary."""
- return cls.from_dict(_dict)
-
- @classmethod
- def _get_class_by_discriminator(cls, _dict: Dict) -> object:
- mapping = {}
- mapping['hipersocket'] = 'BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype'
- mapping['pci'] = 'BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPCIPrototype'
- mapping['vlan'] = 'BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVLANPrototype'
- disc_value = _dict.get('interface_type')
- if disc_value is None:
- raise ValueError('Discriminator property \'interface_type\' not found in BareMetalServerNetworkInterfacePrototype JSON')
- class_name = mapping.get(disc_value, disc_value)
- try:
- disc_class = getattr(sys.modules[__name__], class_name)
- except AttributeError:
- disc_class = cls
- if isinstance(disc_class, object):
- return disc_class
- raise TypeError('%s is not a discriminator class' % class_name)
-
class InterfaceTypeEnum(str, Enum):
"""
- The interface type:
- - `hipersocket`: a virtual device that provides high-speed TCP/IP connectivity
- within a `s390x` based system
- - Not supported on bare metal servers with a `cpu.architecture` of `amd64`
+ The network attachment's 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
+ to use the PCI attachment
- Cannot directly use an IEEE 802.1Q tag.
- Not supported on bare metal servers with a `cpu.architecture` of `s390x`
- `vlan`: a virtual device, used through a `pci` device that has the `vlan` in its
array of `allowed_vlans`.
- Must use an IEEE 802.1Q tag.
- - Has its own security groups and does not inherit those of the PCI device
- through
- which traffic flows.
- Not supported on bare metal servers with a `cpu.architecture` of `s390x`.
"""
- HIPERSOCKET = 'hipersocket'
PCI = 'pci'
VLAN = 'vlan'
-class BareMetalServerNetworkInterfaceReferenceDeleted:
+class BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterface:
"""
- If present, this property indicates the referenced resource has been deleted, and
- provides some supplementary information.
+ A virtual network interface for the bare metal server network attachment. This can be
+ specified using an existing virtual network interface, or a prototype object for a new
+ virtual network interface.
+ If an existing virtual network interface is specified, it must not be the target of a
+ flow log collector.
- :attr str more_info: Link to documentation about deleted resources.
"""
def __init__(
self,
- more_info: str,
) -> None:
"""
- Initialize a BareMetalServerNetworkInterfaceReferenceDeleted object.
+ Initialize a BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterface 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(['BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeBareMetalServerNetworkAttachmentContext', 'BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentity'])
+ )
+ raise Exception(msg)
+
+
+class BareMetalServerNetworkAttachmentReference:
+ """
+ BareMetalServerNetworkAttachmentReference.
+
+ :param BareMetalServerNetworkAttachmentReferenceDeleted 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 network attachment.
+ :param str id: The unique identifier for this bare metal server network
+ attachment.
+ :param str name: The name for this bare metal server network attachment. The
+ name is unique across all network attachments for the bare metal server.
+ :param ReservedIPReference primary_ip: The primary IP address of the virtual
+ network interface for the bare metal server
+ network attachment.
+ :param str resource_type: The resource type.
+ :param SubnetReference subnet: The subnet of the virtual network interface for
+ the bare metal server network
+ attachment.
+ """
+
+ def __init__(
+ self,
+ href: str,
+ id: str,
+ name: str,
+ primary_ip: 'ReservedIPReference',
+ resource_type: str,
+ subnet: 'SubnetReference',
+ *,
+ deleted: Optional['BareMetalServerNetworkAttachmentReferenceDeleted'] = None,
+ ) -> None:
+ """
+ Initialize a BareMetalServerNetworkAttachmentReference object.
+
+ :param str href: The URL for this bare metal server network attachment.
+ :param str id: The unique identifier for this bare metal server network
+ attachment.
+ :param str name: The name for this bare metal server network attachment.
+ The name is unique across all network attachments for the bare metal
+ server.
+ :param ReservedIPReference primary_ip: The primary IP address of the
+ virtual network interface for the bare metal server
+ network attachment.
+ :param str resource_type: The resource type.
+ :param SubnetReference subnet: The subnet of the virtual network interface
+ for the bare metal server network
+ attachment.
+ :param BareMetalServerNetworkAttachmentReferenceDeleted 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_ip = primary_ip
+ self.resource_type = resource_type
+ self.subnet = subnet
@classmethod
- def from_dict(cls, _dict: Dict) -> 'BareMetalServerNetworkInterfaceReferenceDeleted':
- """Initialize a BareMetalServerNetworkInterfaceReferenceDeleted object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'BareMetalServerNetworkAttachmentReference':
+ """Initialize a BareMetalServerNetworkAttachmentReference object from a json dictionary."""
args = {}
- if 'more_info' in _dict:
- args['more_info'] = _dict.get('more_info')
+ if (deleted := _dict.get('deleted')) is not None:
+ args['deleted'] = BareMetalServerNetworkAttachmentReferenceDeleted.from_dict(deleted)
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'more_info\' not present in BareMetalServerNetworkInterfaceReferenceDeleted JSON')
+ raise ValueError('Required property \'href\' not present in BareMetalServerNetworkAttachmentReference JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
+ else:
+ raise ValueError('Required property \'id\' not present in BareMetalServerNetworkAttachmentReference JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ else:
+ raise ValueError('Required property \'name\' not present in BareMetalServerNetworkAttachmentReference JSON')
+ if (primary_ip := _dict.get('primary_ip')) is not None:
+ args['primary_ip'] = ReservedIPReference.from_dict(primary_ip)
+ else:
+ raise ValueError('Required property \'primary_ip\' not present in BareMetalServerNetworkAttachmentReference JSON')
+ if (resource_type := _dict.get('resource_type')) is not None:
+ args['resource_type'] = resource_type
+ else:
+ raise ValueError('Required property \'resource_type\' not present in BareMetalServerNetworkAttachmentReference JSON')
+ if (subnet := _dict.get('subnet')) is not None:
+ args['subnet'] = SubnetReference.from_dict(subnet)
+ else:
+ raise ValueError('Required property \'subnet\' not present in BareMetalServerNetworkAttachmentReference JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a BareMetalServerNetworkInterfaceReferenceDeleted object from a json dictionary."""
+ """Initialize a BareMetalServerNetworkAttachmentReference object from 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, 'deleted') and self.deleted is not None:
+ if isinstance(self.deleted, dict):
+ _dict['deleted'] = self.deleted
+ else:
+ _dict['deleted'] = self.deleted.to_dict()
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
+ if hasattr(self, 'id') and self.id is not None:
+ _dict['id'] = self.id
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ if hasattr(self, 'primary_ip') and self.primary_ip is not None:
+ if isinstance(self.primary_ip, dict):
+ _dict['primary_ip'] = self.primary_ip
+ else:
+ _dict['primary_ip'] = self.primary_ip.to_dict()
+ if hasattr(self, 'resource_type') and self.resource_type is not None:
+ _dict['resource_type'] = self.resource_type
+ if hasattr(self, 'subnet') and self.subnet is not None:
+ if isinstance(self.subnet, dict):
+ _dict['subnet'] = self.subnet
+ else:
+ _dict['subnet'] = self.subnet.to_dict()
return _dict
def _to_dict(self):
@@ -28382,26 +30424,34 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this BareMetalServerNetworkInterfaceReferenceDeleted object."""
+ """Return a `str` version of this BareMetalServerNetworkAttachmentReference object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'BareMetalServerNetworkInterfaceReferenceDeleted') -> bool:
+ def __eq__(self, other: 'BareMetalServerNetworkAttachmentReference') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'BareMetalServerNetworkInterfaceReferenceDeleted') -> bool:
+ def __ne__(self, other: 'BareMetalServerNetworkAttachmentReference') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
+ class ResourceTypeEnum(str, Enum):
+ """
+ The resource type.
+ """
-class BareMetalServerNetworkInterfaceReferenceTargetContextDeleted:
+ BARE_METAL_SERVER_NETWORK_ATTACHMENT = 'bare_metal_server_network_attachment'
+
+
+
+class BareMetalServerNetworkAttachmentReferenceDeleted:
"""
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.
+ :param str more_info: Link to documentation about deleted resources.
"""
def __init__(
@@ -28409,25 +30459,25 @@ def __init__(
more_info: str,
) -> None:
"""
- Initialize a BareMetalServerNetworkInterfaceReferenceTargetContextDeleted object.
+ Initialize a BareMetalServerNetworkAttachmentReferenceDeleted object.
:param str more_info: Link to documentation about deleted resources.
"""
self.more_info = more_info
@classmethod
- def from_dict(cls, _dict: Dict) -> 'BareMetalServerNetworkInterfaceReferenceTargetContextDeleted':
- """Initialize a BareMetalServerNetworkInterfaceReferenceTargetContextDeleted object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'BareMetalServerNetworkAttachmentReferenceDeleted':
+ """Initialize a BareMetalServerNetworkAttachmentReferenceDeleted object from a json dictionary."""
args = {}
- if 'more_info' in _dict:
- args['more_info'] = _dict.get('more_info')
+ if (more_info := _dict.get('more_info')) is not None:
+ args['more_info'] = more_info
else:
- raise ValueError('Required property \'more_info\' not present in BareMetalServerNetworkInterfaceReferenceTargetContextDeleted JSON')
+ raise ValueError('Required property \'more_info\' not present in BareMetalServerNetworkAttachmentReferenceDeleted JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a BareMetalServerNetworkInterfaceReferenceTargetContextDeleted object from a json dictionary."""
+ """Initialize a BareMetalServerNetworkAttachmentReferenceDeleted object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -28442,121 +30492,39 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this BareMetalServerNetworkInterfaceReferenceTargetContextDeleted object."""
+ """Return a `str` version of this BareMetalServerNetworkAttachmentReferenceDeleted object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'BareMetalServerNetworkInterfaceReferenceTargetContextDeleted') -> bool:
+ def __eq__(self, other: 'BareMetalServerNetworkAttachmentReferenceDeleted') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'BareMetalServerNetworkInterfaceReferenceTargetContextDeleted') -> bool:
+ def __ne__(self, other: 'BareMetalServerNetworkAttachmentReferenceDeleted') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class BareMetalServerPatch:
+class BareMetalServerNetworkInterface:
"""
- BareMetalServerPatch.
+ BareMetalServerNetworkInterface.
- :attr bool enable_secure_boot: (optional) Indicates whether secure boot is
- enabled. If enabled, the image must support secure boot or the bare metal server
- will fail to boot.
- For `enable_secure_boot` to be changed, the bare metal server `status` must be
- `stopped`.
- :attr str name: (optional) The name for this bare metal server. The name must
- not be used by another bare metal server in the region. Changing the name will
- not affect the system hostname.
- :attr BareMetalServerTrustedPlatformModulePatch trusted_platform_module:
- (optional)
- """
-
- def __init__(
- self,
- *,
- enable_secure_boot: bool = None,
- name: str = None,
- trusted_platform_module: 'BareMetalServerTrustedPlatformModulePatch' = None,
- ) -> None:
- """
- Initialize a BareMetalServerPatch object.
-
- :param bool enable_secure_boot: (optional) Indicates whether secure boot is
- enabled. If enabled, the image must support secure boot or the bare metal
- server will fail to boot.
- For `enable_secure_boot` to be changed, the bare metal server `status` must
- be
- `stopped`.
- :param str name: (optional) The name for this bare metal server. The name
- must not be used by another bare metal server in the region. Changing the
- name will not affect the system hostname.
- :param BareMetalServerTrustedPlatformModulePatch trusted_platform_module:
- (optional)
- """
- self.enable_secure_boot = enable_secure_boot
- self.name = name
- self.trusted_platform_module = trusted_platform_module
-
- @classmethod
- def from_dict(cls, _dict: Dict) -> 'BareMetalServerPatch':
- """Initialize a BareMetalServerPatch object from a json dictionary."""
- args = {}
- if 'enable_secure_boot' in _dict:
- args['enable_secure_boot'] = _dict.get('enable_secure_boot')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
- if 'trusted_platform_module' in _dict:
- args['trusted_platform_module'] = BareMetalServerTrustedPlatformModulePatch.from_dict(_dict.get('trusted_platform_module'))
- return cls(**args)
-
- @classmethod
- def _from_dict(cls, _dict):
- """Initialize a 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, 'enable_secure_boot') and self.enable_secure_boot is not None:
- _dict['enable_secure_boot'] = self.enable_secure_boot
- if hasattr(self, 'name') and self.name is not None:
- _dict['name'] = self.name
- if hasattr(self, 'trusted_platform_module') and self.trusted_platform_module is not None:
- if isinstance(self.trusted_platform_module, dict):
- _dict['trusted_platform_module'] = self.trusted_platform_module
- else:
- _dict['trusted_platform_module'] = self.trusted_platform_module.to_dict()
- return _dict
-
- def _to_dict(self):
- """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 bare metal server network interface.
- :attr List[int] allowed_vlans: (optional) The VLAN IDs allowed for `vlan`
- interfaces using this PCI interface.
- :attr bool enable_infrastructure_nat: (optional) If `true`:
+ :param bool allow_ip_spoofing: Indicates whether source IP spoofing is allowed
+ on this bare metal server network interface.
+ If this bare metal server has network attachments, this network interface is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and source IP spoofing is managed on the attached virtual network
+ interface.
+ :param datetime created_at: The date and time that the bare metal server network
+ interface was created.
+ If this bare metal server has network attachments, this network interface was
+ created as a [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ when its corresponding network attachment was created.
+ :param bool enable_infrastructure_nat: If `true`:
- The VPC infrastructure performs any needed NAT operations.
- `floating_ips` must not have more than one floating IP.
If `false`:
@@ -28564,10 +30532,35 @@ class BareMetalServerPrimaryNetworkInterfacePrototype:
allowing the workload to perform any needed NAT operations.
- `allow_ip_spoofing` must be `false`.
- `interface_type` must not be `hipersocket`.
- :attr str interface_type: (optional) The interface type:
+ If this bare metal server has network attachments, this network interface is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and infrastructure NAT is managed on the attached virtual network
+ interface.
+ :param List[FloatingIPReference] floating_ips: The floating IPs associated with
+ this bare metal server network interface.
+ If this bare metal server has network attachments, this network interface is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and the floating IPs are associated with the attached virtual network
+ interface.
+ :param str href: The URL for this bare metal server network interface.
+ If this bare metal server has network attachments, this network interface is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment.
+ :param str id: The unique identifier for this bare metal server network
+ interface.
+ If this bare metal server has network attachments, this network interface is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and the identifier is that of the corresponding network attachment.
+ :param str interface_type: The interface type:
- `hipersocket`: a virtual device that provides high-speed TCP/IP connectivity
- within a `s390x` based system.
- - Not supported on bare metal servers with a `cpu.architecture` of `amd64`
+ within a `s390x` based system
- `pci`: a physical PCI device which can only be created or deleted when the
bare metal
server is stopped
@@ -28575,46 +30568,107 @@ class BareMetalServerPrimaryNetworkInterfacePrototype:
permitted
to use the PCI interface
- Cannot directly use an IEEE 802.1Q tag.
- - Not supported on bare metal servers with a `cpu.architecture` of `s390x`.
- :attr str name: (optional) The name for this bare metal server network
- interface. The name must not be used by another network interface on the bare
- metal server. If unspecified, the name will be a hyphenated list of
- randomly-selected words.
- :attr NetworkInterfaceIPPrototype primary_ip: (optional) The primary IP address
- to bind to the bare metal server network interface. This can be
- specified using an existing reserved IP, or a prototype object for a new
- reserved IP.
- If an existing reserved IP or a prototype object with an address is specified,
- it must
- be available on the bare metal server network interface's subnet. Otherwise, an
- available address on the subnet will be automatically selected and reserved.
- :attr List[SecurityGroupIdentity] security_groups: (optional) The security
- groups to use for this bare metal server network interface. If unspecified, the
- VPC's default security group is used.
- :attr SubnetIdentity subnet: The associated subnet.
+ - `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.
+ If this bare metal server has network attachments, this network interface is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and the interface type is that of the corresponding network
+ attachment.
+ The enumerated values for this property are expected to expand in the future.
+ When processing this property, check for and log unknown values. Optionally halt
+ processing and surface the error, or bypass the resource on which the unexpected
+ property value was encountered.
+ :param str mac_address: The MAC address of this bare metal server network
+ interface. If the MAC address has not yet been selected, the value will be an
+ empty string.
+ If this bare metal server has network attachments, this network interface is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and the MAC address is that of the attached virtual network
+ interface.
+ :param str name: The name for this bare metal server network interface.
+ If this bare metal server has network attachments, this network interface is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and the name matches its corresponding network attachment.
+ :param int port_speed: The bare metal server network interface port speed in
+ Mbps.
+ If this bare metal server has network attachments, this network interface is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and the port speed is that of its corresponding network attachment.
+ :param ReservedIPReference primary_ip:
+ :param str resource_type: The resource type.
+ :param List[SecurityGroupReference] security_groups: The security groups
+ targeting this bare metal server network interface.
+ If this bare metal server has network attachments, this network interface is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and the security groups are associated with the attached virtual
+ network interface.
+ :param str status: The status of the bare metal server network interface.
+ If this bare metal server has network attachments, this network interface is a
+ read-only representation of its corresponding network attachment and its
+ attached virtual network interface, and the status is [computed from
+ them](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients).
+ :param SubnetReference subnet: The associated subnet.
+ :param str type: The bare metal server network interface type.
+ If this bare metal server has network attachments, this network interface is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and the type is that of its corresponding network attachment.
"""
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_ip: 'NetworkInterfaceIPPrototype' = None,
- security_groups: List['SecurityGroupIdentity'] = None,
+ allow_ip_spoofing: bool,
+ created_at: datetime,
+ enable_infrastructure_nat: bool,
+ floating_ips: List['FloatingIPReference'],
+ href: str,
+ id: str,
+ interface_type: str,
+ mac_address: str,
+ name: str,
+ port_speed: int,
+ primary_ip: 'ReservedIPReference',
+ resource_type: str,
+ security_groups: List['SecurityGroupReference'],
+ status: str,
+ subnet: 'SubnetReference',
+ type: str,
) -> None:
"""
- Initialize a BareMetalServerPrimaryNetworkInterfacePrototype object.
+ Initialize a BareMetalServerNetworkInterface object.
- :param SubnetIdentity subnet: The associated subnet.
- :param bool allow_ip_spoofing: (optional) Indicates whether source IP
- spoofing is allowed on this bare metal server network interface.
- :param List[int] allowed_vlans: (optional) The VLAN IDs allowed for `vlan`
- interfaces using this PCI interface.
- :param bool enable_infrastructure_nat: (optional) If `true`:
+ :param bool allow_ip_spoofing: Indicates whether source IP spoofing is
+ allowed on this bare metal server network interface.
+ If this bare metal server has network attachments, this network interface
+ is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and source IP spoofing is managed on the attached virtual
+ network interface.
+ :param datetime created_at: The date and time that the bare metal server
+ network interface was created.
+ If this bare metal server has network attachments, this network interface
+ was created as a [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ when its corresponding network attachment was created.
+ :param bool enable_infrastructure_nat: If `true`:
- The VPC infrastructure performs any needed NAT operations.
- `floating_ips` must not have more than one floating IP.
If `false`:
@@ -28623,12 +30677,41 @@ def __init__(
allowing the workload to perform any needed NAT operations.
- `allow_ip_spoofing` must be `false`.
- `interface_type` must not be `hipersocket`.
- :param str interface_type: (optional) The interface type:
+ If this bare metal server has network attachments, this network interface
+ is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and infrastructure NAT is managed on the attached virtual
+ network interface.
+ :param List[FloatingIPReference] floating_ips: The floating IPs associated
+ with this bare metal server network interface.
+ If this bare metal server has network attachments, this network interface
+ is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and the floating IPs are associated with the attached virtual
+ network interface.
+ :param str href: The URL for this bare metal server network interface.
+ If this bare metal server has network attachments, this network interface
+ is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment.
+ :param str id: The unique identifier for this bare metal server network
+ interface.
+ If this bare metal server has network attachments, this network interface
+ is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and the identifier is that of the corresponding network
+ attachment.
+ :param str interface_type: The interface type:
- `hipersocket`: a virtual device that provides high-speed TCP/IP
connectivity
- within a `s390x` based system.
- - Not supported on bare metal servers with a `cpu.architecture` of
- `amd64`
+ within a `s390x` based system
- `pci`: a physical PCI device which can only be created or deleted when
the bare metal
server is stopped
@@ -28636,121 +30719,119 @@ def __init__(
permitted
to use the PCI interface
- Cannot directly use an IEEE 802.1Q tag.
- - Not supported on bare metal servers with a `cpu.architecture` of
- `s390x`.
- :param str name: (optional) The name for this bare metal server network
- interface. The name must not be used by another network interface on the
- bare metal server. If unspecified, the name will be a hyphenated list of
- randomly-selected words.
- :param NetworkInterfaceIPPrototype primary_ip: (optional) The primary IP
- address to bind to the bare metal server network interface. This can be
- specified using an existing reserved IP, or a prototype object for a new
- reserved IP.
- If an existing reserved IP or a prototype object with an address is
- specified, it must
- be available on the bare metal server network interface's subnet.
- Otherwise, an
- available address on the subnet will be automatically selected and
- reserved.
- :param List[SecurityGroupIdentity] security_groups: (optional) The security
- groups to use for this bare metal server network interface. If unspecified,
- the VPC's default security group is used.
+ - `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.
+ If this bare metal server has network attachments, this network interface
+ is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and the interface type is that of the corresponding network
+ attachment.
+ The enumerated values for this property are expected to expand in the
+ future. When processing this property, check for and log unknown values.
+ Optionally halt processing and surface the error, or bypass the resource on
+ which the unexpected property value was encountered.
+ :param str mac_address: The MAC address of this bare metal server network
+ interface. If the MAC address has not yet been selected, the value will be
+ an empty string.
+ If this bare metal server has network attachments, this network interface
+ is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and the MAC address is that of the attached virtual network
+ interface.
+ :param str name: The name for this bare metal server network interface.
+ If this bare metal server has network attachments, this network interface
+ is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and the name matches its corresponding network attachment.
+ :param int port_speed: The bare metal server network interface port speed
+ in Mbps.
+ If this bare metal server has network attachments, this network interface
+ is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and the port speed is that of its corresponding network
+ attachment.
+ :param ReservedIPReference primary_ip:
+ :param str resource_type: The resource type.
+ :param List[SecurityGroupReference] security_groups: The security groups
+ targeting this bare metal server network interface.
+ If this bare metal server has network attachments, this network interface
+ is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and the security groups are associated with the attached virtual
+ network interface.
+ :param str status: The status of the bare metal server network interface.
+ If this bare metal server has network attachments, this network interface
+ is a read-only representation of its corresponding network attachment and
+ its attached virtual network interface, and the status is [computed from
+ them](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients).
+ :param SubnetReference subnet: The associated subnet.
+ :param str type: The bare metal server network interface type.
+ If this bare metal server has network attachments, this network interface
+ is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and the type is that of its corresponding network attachment.
"""
- self.allow_ip_spoofing = allow_ip_spoofing
- self.allowed_vlans = allowed_vlans
- self.enable_infrastructure_nat = enable_infrastructure_nat
- self.interface_type = interface_type
- self.name = name
- self.primary_ip = primary_ip
- self.security_groups = security_groups
- self.subnet = subnet
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['BareMetalServerNetworkInterfaceByHiperSocket', 'BareMetalServerNetworkInterfaceByPCI', 'BareMetalServerNetworkInterfaceByVLAN'])
+ )
+ raise Exception(msg)
@classmethod
- def from_dict(cls, _dict: Dict) -> '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_ip' in _dict:
- args['primary_ip'] = _dict.get('primary_ip')
- if 'security_groups' in _dict:
- args['security_groups'] = _dict.get('security_groups')
- if 'subnet' in _dict:
- args['subnet'] = _dict.get('subnet')
- else:
- raise ValueError('Required property \'subnet\' not present in BareMetalServerPrimaryNetworkInterfacePrototype JSON')
- return cls(**args)
+ def from_dict(cls, _dict: Dict) -> 'BareMetalServerNetworkInterface':
+ """Initialize a BareMetalServerNetworkInterface object from a json dictionary."""
+ disc_class = cls._get_class_by_discriminator(_dict)
+ if disc_class != cls:
+ return disc_class.from_dict(_dict)
+ msg = "Cannot convert dictionary into an instance of base class 'BareMetalServerNetworkInterface'. The discriminator value should map to a valid subclass: {1}".format(
+ ", ".join(['BareMetalServerNetworkInterfaceByHiperSocket', 'BareMetalServerNetworkInterfaceByPCI', 'BareMetalServerNetworkInterfaceByVLAN'])
+ )
+ raise Exception(msg)
@classmethod
- def _from_dict(cls, _dict):
- """Initialize a BareMetalServerPrimaryNetworkInterfacePrototype object from a json dictionary."""
+ def _from_dict(cls, _dict: Dict):
+ """Initialize a BareMetalServerNetworkInterface object from a json dictionary."""
return cls.from_dict(_dict)
- def to_dict(self) -> Dict:
- """Return a json dictionary representing this model."""
- _dict = {}
- if hasattr(self, 'allow_ip_spoofing') and self.allow_ip_spoofing is not None:
- _dict['allow_ip_spoofing'] = self.allow_ip_spoofing
- if hasattr(self, 'allowed_vlans') and self.allowed_vlans is not None:
- _dict['allowed_vlans'] = self.allowed_vlans
- if hasattr(self, 'enable_infrastructure_nat') and self.enable_infrastructure_nat is not None:
- _dict['enable_infrastructure_nat'] = self.enable_infrastructure_nat
- if hasattr(self, 'interface_type') and self.interface_type is not None:
- _dict['interface_type'] = self.interface_type
- if hasattr(self, 'name') and self.name is not None:
- _dict['name'] = self.name
- if hasattr(self, 'primary_ip') and self.primary_ip is not None:
- if isinstance(self.primary_ip, dict):
- _dict['primary_ip'] = self.primary_ip
- else:
- _dict['primary_ip'] = self.primary_ip.to_dict()
- if hasattr(self, 'security_groups') and self.security_groups is not None:
- security_groups_list = []
- for v in self.security_groups:
- if isinstance(v, dict):
- security_groups_list.append(v)
- else:
- security_groups_list.append(v.to_dict())
- _dict['security_groups'] = security_groups_list
- if hasattr(self, 'subnet') and self.subnet is not None:
- if isinstance(self.subnet, dict):
- _dict['subnet'] = self.subnet
- else:
- _dict['subnet'] = self.subnet.to_dict()
- return _dict
-
- def _to_dict(self):
- """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
+ @classmethod
+ def _get_class_by_discriminator(cls, _dict: Dict) -> object:
+ mapping = {}
+ mapping['hipersocket'] = 'BareMetalServerNetworkInterfaceByHiperSocket'
+ mapping['pci'] = 'BareMetalServerNetworkInterfaceByPCI'
+ mapping['vlan'] = 'BareMetalServerNetworkInterfaceByVLAN'
+ disc_value = _dict.get('interface_type')
+ if disc_value is None:
+ raise ValueError('Discriminator property \'interface_type\' not found in BareMetalServerNetworkInterface JSON')
+ class_name = mapping.get(disc_value, disc_value)
+ try:
+ disc_class = getattr(sys.modules[__name__], class_name)
+ except AttributeError:
+ disc_class = cls
+ if isinstance(disc_class, object):
+ return disc_class
+ raise TypeError('%s is not a discriminator class' % class_name)
class InterfaceTypeEnum(str, Enum):
"""
The interface type:
- `hipersocket`: a virtual device that provides high-speed TCP/IP connectivity
- within a `s390x` based system.
- - Not supported on bare metal servers with a `cpu.architecture` of `amd64`
+ within a `s390x` based system
- `pci`: a physical PCI device which can only be created or deleted when the bare
metal
server is stopped
@@ -28758,224 +30839,165 @@ class InterfaceTypeEnum(str, Enum):
permitted
to use the PCI interface
- Cannot directly use an IEEE 802.1Q tag.
- - Not supported on bare metal servers with a `cpu.architecture` of `s390x`.
+ - `vlan`: a virtual device, used through a `pci` device that has the `vlan` in its
+ array of `allowed_vlans`.
+ - Must use an IEEE 802.1Q tag.
+ - Has its own security groups and does not inherit those of the PCI device
+ through
+ which traffic flows.
+ If this bare metal server has network attachments, this network interface is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and the interface type is that of the corresponding network attachment.
+ The enumerated values for this property are expected to expand in the future. When
+ processing this property, check for and log unknown values. Optionally halt
+ processing and surface the error, or bypass the resource on which the unexpected
+ property value was encountered.
"""
HIPERSOCKET = 'hipersocket'
PCI = 'pci'
+ VLAN = 'vlan'
+
+
+ class ResourceTypeEnum(str, Enum):
+ """
+ The resource type.
+ """
+ NETWORK_INTERFACE = 'network_interface'
-class BareMetalServerProfile:
+ class StatusEnum(str, Enum):
+ """
+ The status of the bare metal server network interface.
+ If this bare metal server has network attachments, this network interface is a
+ read-only representation of its corresponding network attachment and its attached
+ virtual network interface, and the status is [computed from
+ them](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients).
+ """
+
+ AVAILABLE = 'available'
+ DELETING = 'deleting'
+ FAILED = 'failed'
+ PENDING = 'pending'
+
+
+ class TypeEnum(str, Enum):
+ """
+ The bare metal server network interface type.
+ If this bare metal server has network attachments, this network interface is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and the type is that of its corresponding network attachment.
+ """
+
+ PRIMARY = 'primary'
+ SECONDARY = 'secondary'
+
+
+
+class BareMetalServerNetworkInterfaceCollection:
"""
- BareMetalServerProfile.
+ BareMetalServerNetworkInterfaceCollection.
- :attr BareMetalServerProfileBandwidth bandwidth:
- :attr BareMetalServerProfileConsoleTypes console_types: The console type
- configuration for a bare metal server with this profile.
- :attr BareMetalServerProfileCPUArchitecture cpu_architecture:
- :attr BareMetalServerProfileCPUCoreCount cpu_core_count:
- :attr BareMetalServerProfileCPUSocketCount cpu_socket_count:
- :attr List[BareMetalServerProfileDisk] disks: Collection of the bare metal
- server profile's disks.
- :attr str family: The product family this bare metal server profile belongs to.
- :attr str href: The URL for this bare metal server profile.
- :attr BareMetalServerProfileMemory memory:
- :attr str name: The name for this bare metal server profile.
- :attr BareMetalServerProfileNetworkInterfaceCount network_interface_count:
- :attr BareMetalServerProfileOSArchitecture os_architecture:
- :attr str resource_type: The resource type.
- :attr BareMetalServerProfileSupportedTrustedPlatformModuleModes
- supported_trusted_platform_module_modes: The supported trusted platform module
- modes for this bare metal server profile.
+ :param BareMetalServerNetworkInterfaceCollectionFirst first: A link to the first
+ page of resources.
+ :param int limit: The maximum number of resources that can be returned by the
+ request.
+ :param List[BareMetalServerNetworkInterface] network_interfaces: Collection of
+ bare metal server network interfaces.
+ :param BareMetalServerNetworkInterfaceCollectionNext next: (optional) A link to
+ the next page of resources. This property is present for all pages
+ except the last page.
+ :param int total_count: The total number of resources across all pages.
"""
def __init__(
self,
- bandwidth: 'BareMetalServerProfileBandwidth',
- console_types: 'BareMetalServerProfileConsoleTypes',
- cpu_architecture: 'BareMetalServerProfileCPUArchitecture',
- cpu_core_count: 'BareMetalServerProfileCPUCoreCount',
- cpu_socket_count: 'BareMetalServerProfileCPUSocketCount',
- disks: List['BareMetalServerProfileDisk'],
- family: str,
- href: str,
- memory: 'BareMetalServerProfileMemory',
- name: str,
- network_interface_count: 'BareMetalServerProfileNetworkInterfaceCount',
- os_architecture: 'BareMetalServerProfileOSArchitecture',
- resource_type: str,
- supported_trusted_platform_module_modes: 'BareMetalServerProfileSupportedTrustedPlatformModuleModes',
+ first: 'BareMetalServerNetworkInterfaceCollectionFirst',
+ limit: int,
+ network_interfaces: List['BareMetalServerNetworkInterface'],
+ total_count: int,
+ *,
+ next: Optional['BareMetalServerNetworkInterfaceCollectionNext'] = None,
) -> None:
"""
- Initialize a BareMetalServerProfile object.
+ Initialize a BareMetalServerNetworkInterfaceCollection object.
- :param BareMetalServerProfileBandwidth bandwidth:
- :param BareMetalServerProfileConsoleTypes console_types: The console type
- configuration for a bare metal server with this profile.
- :param BareMetalServerProfileCPUArchitecture cpu_architecture:
- :param BareMetalServerProfileCPUCoreCount cpu_core_count:
- :param BareMetalServerProfileCPUSocketCount cpu_socket_count:
- :param List[BareMetalServerProfileDisk] disks: Collection of the bare metal
- server profile's disks.
- :param str family: The product family this bare metal server profile
- belongs to.
- :param str href: The URL for this bare metal server profile.
- :param BareMetalServerProfileMemory memory:
- :param str name: The name for this bare metal server profile.
- :param BareMetalServerProfileNetworkInterfaceCount network_interface_count:
- :param BareMetalServerProfileOSArchitecture os_architecture:
- :param str resource_type: The resource type.
- :param BareMetalServerProfileSupportedTrustedPlatformModuleModes
- supported_trusted_platform_module_modes: The supported trusted platform
- module modes for this bare metal server profile.
+ :param BareMetalServerNetworkInterfaceCollectionFirst first: A link to the
+ first page of resources.
+ :param int limit: The maximum number of resources that can be returned by
+ the request.
+ :param List[BareMetalServerNetworkInterface] network_interfaces: Collection
+ of bare metal server network interfaces.
+ :param int total_count: The total number of resources across all pages.
+ :param BareMetalServerNetworkInterfaceCollectionNext next: (optional) A
+ link to the next page of resources. This property is present for all pages
+ except the last page.
"""
- self.bandwidth = bandwidth
- self.console_types = console_types
- self.cpu_architecture = cpu_architecture
- self.cpu_core_count = cpu_core_count
- self.cpu_socket_count = cpu_socket_count
- self.disks = disks
- self.family = family
- self.href = href
- self.memory = memory
- self.name = name
- self.network_interface_count = network_interface_count
- self.os_architecture = os_architecture
- self.resource_type = resource_type
- self.supported_trusted_platform_module_modes = supported_trusted_platform_module_modes
+ self.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) -> 'BareMetalServerProfile':
- """Initialize a BareMetalServerProfile object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'BareMetalServerNetworkInterfaceCollection':
+ """Initialize a BareMetalServerNetworkInterfaceCollection object from a json dictionary."""
args = {}
- if 'bandwidth' in _dict:
- args['bandwidth'] = _dict.get('bandwidth')
- else:
- raise ValueError('Required property \'bandwidth\' not present in BareMetalServerProfile JSON')
- if 'console_types' in _dict:
- args['console_types'] = BareMetalServerProfileConsoleTypes.from_dict(_dict.get('console_types'))
- else:
- raise ValueError('Required property \'console_types\' not present in BareMetalServerProfile JSON')
- if 'cpu_architecture' in _dict:
- args['cpu_architecture'] = BareMetalServerProfileCPUArchitecture.from_dict(_dict.get('cpu_architecture'))
- else:
- raise ValueError('Required property \'cpu_architecture\' not present in BareMetalServerProfile JSON')
- if 'cpu_core_count' in _dict:
- args['cpu_core_count'] = _dict.get('cpu_core_count')
- else:
- raise ValueError('Required property \'cpu_core_count\' not present in BareMetalServerProfile JSON')
- if 'cpu_socket_count' in _dict:
- args['cpu_socket_count'] = _dict.get('cpu_socket_count')
- else:
- raise ValueError('Required property \'cpu_socket_count\' not present in BareMetalServerProfile JSON')
- if 'disks' in _dict:
- args['disks'] = [BareMetalServerProfileDisk.from_dict(v) for v in _dict.get('disks')]
- else:
- raise ValueError('Required property \'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 'network_interface_count' in _dict:
- args['network_interface_count'] = _dict.get('network_interface_count')
+ if (first := _dict.get('first')) is not None:
+ args['first'] = BareMetalServerNetworkInterfaceCollectionFirst.from_dict(first)
else:
- raise ValueError('Required property \'network_interface_count\' not present in BareMetalServerProfile JSON')
- if 'os_architecture' in _dict:
- args['os_architecture'] = BareMetalServerProfileOSArchitecture.from_dict(_dict.get('os_architecture'))
+ raise ValueError('Required property \'first\' not present in BareMetalServerNetworkInterfaceCollection JSON')
+ if (limit := _dict.get('limit')) is not None:
+ args['limit'] = limit
else:
- raise ValueError('Required property \'os_architecture\' not present in BareMetalServerProfile JSON')
- if 'resource_type' in _dict:
- args['resource_type'] = _dict.get('resource_type')
+ raise ValueError('Required property \'limit\' not present in BareMetalServerNetworkInterfaceCollection JSON')
+ if (network_interfaces := _dict.get('network_interfaces')) is not None:
+ args['network_interfaces'] = [BareMetalServerNetworkInterface.from_dict(v) for v in network_interfaces]
else:
- raise ValueError('Required property \'resource_type\' not present in BareMetalServerProfile JSON')
- if 'supported_trusted_platform_module_modes' in _dict:
- args['supported_trusted_platform_module_modes'] = BareMetalServerProfileSupportedTrustedPlatformModuleModes.from_dict(_dict.get('supported_trusted_platform_module_modes'))
+ raise ValueError('Required property \'network_interfaces\' not present in BareMetalServerNetworkInterfaceCollection JSON')
+ if (next := _dict.get('next')) is not None:
+ args['next'] = BareMetalServerNetworkInterfaceCollectionNext.from_dict(next)
+ if (total_count := _dict.get('total_count')) is not None:
+ args['total_count'] = total_count
else:
- raise ValueError('Required property \'supported_trusted_platform_module_modes\' not present in BareMetalServerProfile JSON')
+ raise ValueError('Required property \'total_count\' not present in BareMetalServerNetworkInterfaceCollection JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a BareMetalServerProfile object from a json dictionary."""
+ """Initialize a BareMetalServerNetworkInterfaceCollection object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'bandwidth') and self.bandwidth is not None:
- if isinstance(self.bandwidth, dict):
- _dict['bandwidth'] = self.bandwidth
- else:
- _dict['bandwidth'] = self.bandwidth.to_dict()
- if hasattr(self, 'console_types') and self.console_types is not None:
- if isinstance(self.console_types, dict):
- _dict['console_types'] = self.console_types
- else:
- _dict['console_types'] = self.console_types.to_dict()
- if hasattr(self, 'cpu_architecture') and self.cpu_architecture is not None:
- if isinstance(self.cpu_architecture, dict):
- _dict['cpu_architecture'] = self.cpu_architecture
- else:
- _dict['cpu_architecture'] = self.cpu_architecture.to_dict()
- if hasattr(self, 'cpu_core_count') and self.cpu_core_count is not None:
- if isinstance(self.cpu_core_count, dict):
- _dict['cpu_core_count'] = self.cpu_core_count
- else:
- _dict['cpu_core_count'] = self.cpu_core_count.to_dict()
- if hasattr(self, 'cpu_socket_count') and self.cpu_socket_count is not None:
- if isinstance(self.cpu_socket_count, dict):
- _dict['cpu_socket_count'] = self.cpu_socket_count
+ if hasattr(self, 'first') and self.first is not None:
+ if isinstance(self.first, dict):
+ _dict['first'] = self.first
else:
- _dict['cpu_socket_count'] = self.cpu_socket_count.to_dict()
- if hasattr(self, 'disks') and self.disks is not None:
- disks_list = []
- for v in self.disks:
+ _dict['first'] = self.first.to_dict()
+ if hasattr(self, 'limit') and self.limit is not None:
+ _dict['limit'] = self.limit
+ if hasattr(self, 'network_interfaces') and self.network_interfaces is not None:
+ network_interfaces_list = []
+ for v in self.network_interfaces:
if isinstance(v, dict):
- disks_list.append(v)
+ network_interfaces_list.append(v)
else:
- disks_list.append(v.to_dict())
- _dict['disks'] = disks_list
- if hasattr(self, 'family') and self.family is not None:
- _dict['family'] = self.family
- if hasattr(self, 'href') and self.href is not None:
- _dict['href'] = self.href
- if hasattr(self, 'memory') and self.memory is not None:
- if isinstance(self.memory, dict):
- _dict['memory'] = self.memory
- else:
- _dict['memory'] = self.memory.to_dict()
- if hasattr(self, 'name') and self.name is not None:
- _dict['name'] = self.name
- if hasattr(self, 'network_interface_count') and self.network_interface_count is not None:
- if isinstance(self.network_interface_count, dict):
- _dict['network_interface_count'] = self.network_interface_count
- else:
- _dict['network_interface_count'] = self.network_interface_count.to_dict()
- if hasattr(self, 'os_architecture') and self.os_architecture is not None:
- if isinstance(self.os_architecture, dict):
- _dict['os_architecture'] = self.os_architecture
- else:
- _dict['os_architecture'] = self.os_architecture.to_dict()
- if hasattr(self, 'resource_type') and self.resource_type is not None:
- _dict['resource_type'] = self.resource_type
- if hasattr(self, 'supported_trusted_platform_module_modes') and self.supported_trusted_platform_module_modes is not None:
- if isinstance(self.supported_trusted_platform_module_modes, dict):
- _dict['supported_trusted_platform_module_modes'] = self.supported_trusted_platform_module_modes
+ network_interfaces_list.append(v.to_dict())
+ _dict['network_interfaces'] = network_interfaces_list
+ if hasattr(self, 'next') and self.next is not None:
+ if isinstance(self.next, dict):
+ _dict['next'] = self.next
else:
- _dict['supported_trusted_platform_module_modes'] = self.supported_trusted_platform_module_modes.to_dict()
+ _dict['next'] = self.next.to_dict()
+ if hasattr(self, 'total_count') and self.total_count is not None:
+ _dict['total_count'] = self.total_count
return _dict
def _to_dict(self):
@@ -28983,107 +31005,58 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this BareMetalServerProfile object."""
+ """Return a `str` version of this BareMetalServerNetworkInterfaceCollection object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'BareMetalServerProfile') -> bool:
+ def __eq__(self, other: 'BareMetalServerNetworkInterfaceCollection') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'BareMetalServerProfile') -> bool:
+ def __ne__(self, other: 'BareMetalServerNetworkInterfaceCollection') -> 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:
+class BareMetalServerNetworkInterfaceCollectionFirst:
"""
- BareMetalServerProfileCPUArchitecture.
+ A link to the first page of resources.
- :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.
+ :param str href: The URL for a page of resources.
"""
def __init__(
self,
- type: str,
- value: str,
- *,
- default: str = None,
+ href: str,
) -> None:
"""
- Initialize a BareMetalServerProfileCPUArchitecture object.
+ Initialize a BareMetalServerNetworkInterfaceCollectionFirst 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.
+ :param str href: The URL for a page of resources.
"""
- self.default = default
- self.type = type
- self.value = value
+ self.href = href
@classmethod
- def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileCPUArchitecture':
- """Initialize a BareMetalServerProfileCPUArchitecture object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'BareMetalServerNetworkInterfaceCollectionFirst':
+ """Initialize a BareMetalServerNetworkInterfaceCollectionFirst 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')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'value\' not present in BareMetalServerProfileCPUArchitecture JSON')
+ raise ValueError('Required property \'href\' not present in BareMetalServerNetworkInterfaceCollectionFirst JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a BareMetalServerProfileCPUArchitecture object from a json dictionary."""
+ """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, '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, 'href') and self.href is not None:
+ _dict['href'] = self.href
return _dict
def _to_dict(self):
@@ -29091,165 +31064,59 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this BareMetalServerProfileCPUArchitecture object."""
+ """Return a `str` version of this BareMetalServerNetworkInterfaceCollectionFirst object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'BareMetalServerProfileCPUArchitecture') -> bool:
+ def __eq__(self, other: 'BareMetalServerNetworkInterfaceCollectionFirst') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'BareMetalServerProfileCPUArchitecture') -> bool:
+ def __ne__(self, other: 'BareMetalServerNetworkInterfaceCollectionFirst') -> 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:
+class BareMetalServerNetworkInterfaceCollectionNext:
"""
- BareMetalServerProfileCollection.
+ A link to the next page of resources. This property is present for all pages except
+ the last page.
- :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.
+ :param str href: The URL for a page of resources.
"""
def __init__(
self,
- first: 'BareMetalServerProfileCollectionFirst',
- limit: int,
- profiles: List['BareMetalServerProfile'],
- total_count: int,
- *,
- next: 'BareMetalServerProfileCollectionNext' = None,
+ href: str,
) -> None:
"""
- Initialize a BareMetalServerProfileCollection object.
+ Initialize a BareMetalServerNetworkInterfaceCollectionNext 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.
+ :param str href: The URL for a page of resources.
"""
- self.first = first
- self.limit = limit
- self.next = next
- self.profiles = profiles
- self.total_count = total_count
+ self.href = href
@classmethod
- def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileCollection':
- """Initialize a BareMetalServerProfileCollection object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'BareMetalServerNetworkInterfaceCollectionNext':
+ """Initialize a BareMetalServerNetworkInterfaceCollectionNext 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(v) for v in _dict.get('profiles')]
- else:
- raise ValueError('Required property \'profiles\' not present in BareMetalServerProfileCollection JSON')
- if 'total_count' in _dict:
- args['total_count'] = _dict.get('total_count')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'total_count\' not present in BareMetalServerProfileCollection JSON')
+ raise ValueError('Required property \'href\' not present in BareMetalServerNetworkInterfaceCollectionNext JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a BareMetalServerProfileCollection object from a json dictionary."""
+ """Initialize a BareMetalServerNetworkInterfaceCollectionNext object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'first') and self.first is not None:
- if isinstance(self.first, dict):
- _dict['first'] = self.first
- else:
- _dict['first'] = self.first.to_dict()
- if hasattr(self, 'limit') and self.limit is not None:
- _dict['limit'] = self.limit
- if hasattr(self, 'next') and self.next is not None:
- if isinstance(self.next, dict):
- _dict['next'] = self.next
- else:
- _dict['next'] = self.next.to_dict()
- if hasattr(self, 'profiles') and self.profiles is not None:
- profiles_list = []
- for v in self.profiles:
- if isinstance(v, dict):
- profiles_list.append(v)
- else:
- profiles_list.append(v.to_dict())
- _dict['profiles'] = profiles_list
- if hasattr(self, 'total_count') and self.total_count is not None:
- _dict['total_count'] = self.total_count
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
return _dict
def _to_dict(self):
@@ -29257,58 +31124,134 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this BareMetalServerProfileCollection object."""
+ """Return a `str` version of this BareMetalServerNetworkInterfaceCollectionNext object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'BareMetalServerProfileCollection') -> bool:
+ def __eq__(self, other: 'BareMetalServerNetworkInterfaceCollectionNext') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'BareMetalServerProfileCollection') -> bool:
+ def __ne__(self, other: 'BareMetalServerNetworkInterfaceCollectionNext') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class BareMetalServerProfileCollectionFirst:
+class BareMetalServerNetworkInterfacePatch:
"""
- A link to the first page of resources.
+ BareMetalServerNetworkInterfacePatch.
- :attr str href: The URL for a page of resources.
+ :param bool allow_ip_spoofing: (optional) Indicates whether source IP spoofing
+ is allowed on this bare metal server network interface.
+ If this bare metal server has network attachments, this network interface is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and source IP spoofing is managed on the attached virtual network
+ interface.
+ :param List[int] allowed_vlans: (optional) The VLAN IDs to allow for `vlan`
+ interfaces using this PCI interface, replacing any existing VLAN IDs. The
+ specified values must include IDs for all `vlan` interfaces currently using this
+ PCI interface.
+ :param bool enable_infrastructure_nat: (optional) If `true`:
+ - The VPC infrastructure performs any needed NAT operations.
+ - `floating_ips` must not have more than one floating IP.
+ If `false`:
+ - Packets are passed unchanged to/from the bare metal server network interface,
+ allowing the workload to perform any needed NAT operations.
+ - `allow_ip_spoofing` must be `false`.
+ - `interface_type` must not be `hipersocket`.
+ If this bare metal server has network attachments, this network interface is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and infrastructure NAT is managed on the attached virtual network
+ interface.
+ :param str name: (optional) The name for this bare metal server network
+ interface. The name must not be used by another network interface on the bare
+ metal server.
"""
def __init__(
self,
- href: str,
+ *,
+ allow_ip_spoofing: Optional[bool] = None,
+ allowed_vlans: Optional[List[int]] = None,
+ enable_infrastructure_nat: Optional[bool] = None,
+ name: Optional[str] = None,
) -> None:
"""
- Initialize a BareMetalServerProfileCollectionFirst object.
+ Initialize a BareMetalServerNetworkInterfacePatch object.
- :param str href: The URL for a page of resources.
+ :param bool allow_ip_spoofing: (optional) Indicates whether source IP
+ spoofing is allowed on this bare metal server network interface.
+ If this bare metal server has network attachments, this network interface
+ is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and source IP spoofing is managed on the attached virtual
+ network interface.
+ :param List[int] allowed_vlans: (optional) The VLAN IDs to allow for `vlan`
+ interfaces using this PCI interface, replacing any existing VLAN IDs. The
+ specified values must include IDs for all `vlan` interfaces currently using
+ this PCI interface.
+ :param bool enable_infrastructure_nat: (optional) If `true`:
+ - The VPC infrastructure performs any needed NAT operations.
+ - `floating_ips` must not have more than one floating IP.
+ If `false`:
+ - Packets are passed unchanged to/from the bare metal server network
+ interface,
+ allowing the workload to perform any needed NAT operations.
+ - `allow_ip_spoofing` must be `false`.
+ - `interface_type` must not be `hipersocket`.
+ If this bare metal server has network attachments, this network interface
+ is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and infrastructure NAT is managed on the attached virtual
+ network interface.
+ :param str name: (optional) The name for this bare metal server network
+ interface. The name must not be used by another network interface on the
+ bare metal server.
"""
- self.href = href
+ 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) -> 'BareMetalServerProfileCollectionFirst':
- """Initialize a BareMetalServerProfileCollectionFirst object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'BareMetalServerNetworkInterfacePatch':
+ """Initialize a BareMetalServerNetworkInterfacePatch 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')
+ if (allow_ip_spoofing := _dict.get('allow_ip_spoofing')) is not None:
+ args['allow_ip_spoofing'] = allow_ip_spoofing
+ if (allowed_vlans := _dict.get('allowed_vlans')) is not None:
+ args['allowed_vlans'] = allowed_vlans
+ if (enable_infrastructure_nat := _dict.get('enable_infrastructure_nat')) is not None:
+ args['enable_infrastructure_nat'] = enable_infrastructure_nat
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a BareMetalServerProfileCollectionFirst object from a json dictionary."""
+ """Initialize a BareMetalServerNetworkInterfacePatch object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'href') and self.href is not None:
- _dict['href'] = self.href
+ 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):
@@ -29316,130 +31259,273 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this BareMetalServerProfileCollectionFirst object."""
+ """Return a `str` version of this BareMetalServerNetworkInterfacePatch object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'BareMetalServerProfileCollectionFirst') -> bool:
+ def __eq__(self, other: 'BareMetalServerNetworkInterfacePatch') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'BareMetalServerProfileCollectionFirst') -> bool:
+ def __ne__(self, other: 'BareMetalServerNetworkInterfacePatch') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class BareMetalServerProfileCollectionNext:
+class BareMetalServerNetworkInterfacePrototype:
"""
- A link to the next page of resources. This property is present for all pages except
- the last page.
+ BareMetalServerNetworkInterfacePrototype.
- :attr str href: The URL for a page of resources.
+ :param bool allow_ip_spoofing: (optional) Indicates whether source IP spoofing
+ is allowed on this bare metal server network interface.
+ If this bare metal server has network attachments, this network interface is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and source IP spoofing is managed on the attached virtual network
+ interface.
+ :param bool enable_infrastructure_nat: (optional) If `true`:
+ - The VPC infrastructure performs any needed NAT operations.
+ - `floating_ips` must not have more than one floating IP.
+ If `false`:
+ - Packets are passed unchanged to/from the bare metal server network interface,
+ allowing the workload to perform any needed NAT operations.
+ - `allow_ip_spoofing` must be `false`.
+ - `interface_type` must not be `hipersocket`.
+ If this bare metal server has network attachments, this network interface is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and infrastructure NAT is managed on the attached virtual network
+ interface.
+ :param str interface_type: The interface type:
+ - `hipersocket`: a virtual device that provides high-speed TCP/IP connectivity
+ within a `s390x` based system
+ - Not supported on bare metal servers with a `cpu.architecture` of `amd64`
+ - `pci`: a physical PCI device which can only be created or deleted when the
+ bare metal
+ server is stopped
+ - Has an `allowed_vlans` property which controls the VLANs that will be
+ permitted
+ to use the PCI interface
+ - Cannot directly use an IEEE 802.1Q tag.
+ - Not supported on bare metal servers with a `cpu.architecture` of `s390x`
+ - `vlan`: a virtual device, used through a `pci` device that has the `vlan` in
+ its
+ array of `allowed_vlans`.
+ - Must use an IEEE 802.1Q tag.
+ - Has its own security groups and does not inherit those of the PCI device
+ through
+ which traffic flows.
+ - Not supported on bare metal servers with a `cpu.architecture` of `s390x`.
+ :param str name: (optional) The name for this bare metal server network
+ interface. The name must not be used by another network interface on the bare
+ metal server. If unspecified, the name will be a hyphenated list of
+ randomly-selected words.
+ :param NetworkInterfaceIPPrototype primary_ip: (optional) The primary IP address
+ to bind to the bare metal server network interface. This can be
+ specified using an existing reserved IP, or a prototype object for a new
+ reserved IP.
+ If an existing reserved IP or a prototype object with an address is specified,
+ it must
+ be available on the bare metal server network interface's subnet. Otherwise, an
+ available address on the subnet will be automatically selected and reserved.
+ :param List[SecurityGroupIdentity] security_groups: (optional) The security
+ groups to use for this bare metal server network interface. If unspecified, the
+ VPC's default security group is used.
+ :param SubnetIdentity subnet: The associated subnet.
"""
def __init__(
self,
- href: str,
+ interface_type: str,
+ subnet: 'SubnetIdentity',
+ *,
+ allow_ip_spoofing: Optional[bool] = None,
+ enable_infrastructure_nat: Optional[bool] = None,
+ name: Optional[str] = None,
+ primary_ip: Optional['NetworkInterfaceIPPrototype'] = None,
+ security_groups: Optional[List['SecurityGroupIdentity']] = None,
) -> None:
"""
- Initialize a BareMetalServerProfileCollectionNext object.
+ Initialize a BareMetalServerNetworkInterfacePrototype object.
- :param str href: The URL for a page of resources.
+ :param str interface_type: The interface type:
+ - `hipersocket`: a virtual device that provides high-speed TCP/IP
+ connectivity
+ within a `s390x` based system
+ - Not supported on bare metal servers with a `cpu.architecture` of
+ `amd64`
+ - `pci`: a physical PCI device which can only be created or deleted when
+ the bare metal
+ server is stopped
+ - Has an `allowed_vlans` property which controls the VLANs that will be
+ permitted
+ to use the PCI interface
+ - Cannot directly use an IEEE 802.1Q tag.
+ - Not supported on bare metal servers with a `cpu.architecture` of
+ `s390x`
+ - `vlan`: a virtual device, used through a `pci` device that has the `vlan`
+ in its
+ array of `allowed_vlans`.
+ - Must use an IEEE 802.1Q tag.
+ - Has its own security groups and does not inherit those of the PCI
+ device through
+ which traffic flows.
+ - Not supported on bare metal servers with a `cpu.architecture` of
+ `s390x`.
+ :param SubnetIdentity subnet: The associated subnet.
+ :param bool allow_ip_spoofing: (optional) Indicates whether source IP
+ spoofing is allowed on this bare metal server network interface.
+ If this bare metal server has network attachments, this network interface
+ is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and source IP spoofing is managed on the attached virtual
+ network interface.
+ :param bool enable_infrastructure_nat: (optional) If `true`:
+ - The VPC infrastructure performs any needed NAT operations.
+ - `floating_ips` must not have more than one floating IP.
+ If `false`:
+ - Packets are passed unchanged to/from the bare metal server network
+ interface,
+ allowing the workload to perform any needed NAT operations.
+ - `allow_ip_spoofing` must be `false`.
+ - `interface_type` must not be `hipersocket`.
+ If this bare metal server has network attachments, this network interface
+ is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and infrastructure NAT is managed on the attached virtual
+ network interface.
+ :param str name: (optional) The name for this bare metal server network
+ interface. The name must not be used by another network interface on the
+ bare metal server. If unspecified, the name will be a hyphenated list of
+ randomly-selected words.
+ :param NetworkInterfaceIPPrototype primary_ip: (optional) The primary IP
+ address to bind to the bare metal server network interface. This can be
+ specified using an existing reserved IP, or a prototype object for a new
+ reserved IP.
+ If an existing reserved IP or a prototype object with an address is
+ specified, it must
+ be available on the bare metal server network interface's subnet.
+ Otherwise, an
+ available address on the subnet will be automatically selected and
+ reserved.
+ :param List[SecurityGroupIdentity] security_groups: (optional) The security
+ groups to use for this bare metal server network interface. If unspecified,
+ the VPC's default security group is used.
"""
- self.href = href
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype', 'BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPCIPrototype', 'BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVLANPrototype'])
+ )
+ raise Exception(msg)
@classmethod
- def from_dict(cls, _dict: Dict) -> '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)
+ def from_dict(cls, _dict: Dict) -> 'BareMetalServerNetworkInterfacePrototype':
+ """Initialize a BareMetalServerNetworkInterfacePrototype object from a json dictionary."""
+ disc_class = cls._get_class_by_discriminator(_dict)
+ if disc_class != cls:
+ return disc_class.from_dict(_dict)
+ msg = "Cannot convert dictionary into an instance of base class 'BareMetalServerNetworkInterfacePrototype'. The discriminator value should map to a valid subclass: {1}".format(
+ ", ".join(['BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype', 'BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPCIPrototype', 'BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVLANPrototype'])
+ )
+ raise Exception(msg)
@classmethod
- def _from_dict(cls, _dict):
- """Initialize a BareMetalServerProfileCollectionNext object from a json dictionary."""
+ def _from_dict(cls, _dict: Dict):
+ """Initialize a BareMetalServerNetworkInterfacePrototype object from 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()
+ @classmethod
+ def _get_class_by_discriminator(cls, _dict: Dict) -> object:
+ mapping = {}
+ mapping['hipersocket'] = 'BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype'
+ mapping['pci'] = 'BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPCIPrototype'
+ mapping['vlan'] = 'BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVLANPrototype'
+ disc_value = _dict.get('interface_type')
+ if disc_value is None:
+ raise ValueError('Discriminator property \'interface_type\' not found in BareMetalServerNetworkInterfacePrototype JSON')
+ class_name = mapping.get(disc_value, disc_value)
+ try:
+ disc_class = getattr(sys.modules[__name__], class_name)
+ except AttributeError:
+ disc_class = cls
+ if isinstance(disc_class, object):
+ return disc_class
+ raise TypeError('%s is not a discriminator class' % class_name)
- def __str__(self) -> str:
- """Return a `str` version of this BareMetalServerProfileCollectionNext object."""
- return json.dumps(self.to_dict(), indent=2)
+ class InterfaceTypeEnum(str, Enum):
+ """
+ The interface type:
+ - `hipersocket`: a virtual device that provides high-speed TCP/IP connectivity
+ within a `s390x` based system
+ - Not supported on bare metal servers with a `cpu.architecture` of `amd64`
+ - `pci`: a physical PCI device which can only be created or deleted when the bare
+ metal
+ server is stopped
+ - Has an `allowed_vlans` property which controls the VLANs that will be
+ permitted
+ to use the PCI interface
+ - Cannot directly use an IEEE 802.1Q tag.
+ - Not supported on bare metal servers with a `cpu.architecture` of `s390x`
+ - `vlan`: a virtual device, used through a `pci` device that has the `vlan` in its
+ array of `allowed_vlans`.
+ - Must use an IEEE 802.1Q tag.
+ - Has its own security groups and does not inherit those of the PCI device
+ through
+ which traffic flows.
+ - Not supported on bare metal servers with a `cpu.architecture` of `s390x`.
+ """
- def __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__
+ HIPERSOCKET = 'hipersocket'
+ PCI = 'pci'
+ VLAN = 'vlan'
- def __ne__(self, other: 'BareMetalServerProfileCollectionNext') -> bool:
- """Return `true` when self and other are not equal, false otherwise."""
- return not self == other
-class BareMetalServerProfileConsoleTypes:
+class BareMetalServerNetworkInterfaceReferenceDeleted:
"""
- The console type configuration for a bare metal server with this profile.
+ 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 List[str] values: The console types for a bare metal server with this
- profile.
+ :param str more_info: Link to documentation about deleted resources.
"""
def __init__(
self,
- type: str,
- values: List[str],
+ more_info: str,
) -> None:
"""
- Initialize a BareMetalServerProfileConsoleTypes object.
+ Initialize a BareMetalServerNetworkInterfaceReferenceDeleted object.
- :param str type: The type for this profile field.
- :param List[str] values: The console types for a bare metal server with
- this profile.
+ :param str more_info: Link to documentation about deleted resources.
"""
- self.type = type
- self.values = values
+ self.more_info = more_info
@classmethod
- def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileConsoleTypes':
- """Initialize a BareMetalServerProfileConsoleTypes object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'BareMetalServerNetworkInterfaceReferenceDeleted':
+ """Initialize a BareMetalServerNetworkInterfaceReferenceDeleted object from a json dictionary."""
args = {}
- if 'type' in _dict:
- args['type'] = _dict.get('type')
- else:
- raise ValueError('Required property \'type\' not present in BareMetalServerProfileConsoleTypes JSON')
- if 'values' in _dict:
- args['values'] = _dict.get('values')
+ if (more_info := _dict.get('more_info')) is not None:
+ args['more_info'] = more_info
else:
- raise ValueError('Required property \'values\' not present in BareMetalServerProfileConsoleTypes JSON')
+ raise ValueError('Required property \'more_info\' not present in BareMetalServerNetworkInterfaceReferenceDeleted JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a BareMetalServerProfileConsoleTypes object from a json dictionary."""
+ """Initialize a BareMetalServerNetworkInterfaceReferenceDeleted object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, '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, 'more_info') and self.more_info is not None:
+ _dict['more_info'] = self.more_info
return _dict
def _to_dict(self):
@@ -29447,105 +31533,59 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this BareMetalServerProfileConsoleTypes object."""
+ """Return a `str` version of this BareMetalServerNetworkInterfaceReferenceDeleted object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'BareMetalServerProfileConsoleTypes') -> bool:
+ def __eq__(self, other: 'BareMetalServerNetworkInterfaceReferenceDeleted') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'BareMetalServerProfileConsoleTypes') -> bool:
+ def __ne__(self, other: 'BareMetalServerNetworkInterfaceReferenceDeleted') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class TypeEnum(str, Enum):
- """
- The type for this profile field.
- """
-
- ENUM = 'enum'
-
-
- class ValuesEnum(str, Enum):
- """
- A console type.
- """
-
- SERIAL = 'serial'
- VNC = 'vnc'
-
-
-class BareMetalServerProfileDisk:
+class BareMetalServerNetworkInterfaceReferenceTargetContextDeleted:
"""
- Disks provided by this profile.
+ If present, this property indicates the referenced resource has been deleted, and
+ provides some supplementary information.
- :attr BareMetalServerProfileDiskQuantity quantity:
- :attr BareMetalServerProfileDiskSize size:
- :attr BareMetalServerProfileDiskSupportedInterfaces supported_interface_types:
+ :param str more_info: Link to documentation about deleted resources.
"""
def __init__(
self,
- quantity: 'BareMetalServerProfileDiskQuantity',
- size: 'BareMetalServerProfileDiskSize',
- supported_interface_types: 'BareMetalServerProfileDiskSupportedInterfaces',
+ more_info: str,
) -> None:
"""
- Initialize a BareMetalServerProfileDisk object.
+ Initialize a BareMetalServerNetworkInterfaceReferenceTargetContextDeleted object.
- :param BareMetalServerProfileDiskQuantity quantity:
- :param BareMetalServerProfileDiskSize size:
- :param BareMetalServerProfileDiskSupportedInterfaces
- supported_interface_types:
+ :param str more_info: Link to documentation about deleted resources.
"""
- self.quantity = quantity
- self.size = size
- self.supported_interface_types = supported_interface_types
+ self.more_info = more_info
@classmethod
- def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileDisk':
- """Initialize a BareMetalServerProfileDisk object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'BareMetalServerNetworkInterfaceReferenceTargetContextDeleted':
+ """Initialize a BareMetalServerNetworkInterfaceReferenceTargetContextDeleted 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')
+ if (more_info := _dict.get('more_info')) is not None:
+ args['more_info'] = more_info
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')
+ raise ValueError('Required property \'more_info\' not present in BareMetalServerNetworkInterfaceReferenceTargetContextDeleted JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a BareMetalServerProfileDisk object from a json dictionary."""
+ """Initialize a BareMetalServerNetworkInterfaceReferenceTargetContextDeleted object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'quantity') and self.quantity is not None:
- if isinstance(self.quantity, dict):
- _dict['quantity'] = self.quantity
- else:
- _dict['quantity'] = self.quantity.to_dict()
- if hasattr(self, 'size') and self.size is not None:
- if isinstance(self.size, dict):
- _dict['size'] = self.size
- else:
- _dict['size'] = self.size.to_dict()
- if hasattr(self, 'supported_interface_types') and self.supported_interface_types is not None:
- if isinstance(self.supported_interface_types, dict):
- _dict['supported_interface_types'] = self.supported_interface_types
- else:
- _dict['supported_interface_types'] = self.supported_interface_types.to_dict()
+ if hasattr(self, 'more_info') and self.more_info is not None:
+ _dict['more_info'] = self.more_info
return _dict
def _to_dict(self):
@@ -29553,132 +31593,91 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this BareMetalServerProfileDisk object."""
+ """Return a `str` version of this BareMetalServerNetworkInterfaceReferenceTargetContextDeleted object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'BareMetalServerProfileDisk') -> bool:
+ def __eq__(self, other: 'BareMetalServerNetworkInterfaceReferenceTargetContextDeleted') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'BareMetalServerProfileDisk') -> bool:
+ def __ne__(self, other: 'BareMetalServerNetworkInterfaceReferenceTargetContextDeleted') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class BareMetalServerProfileDiskQuantity:
- """
- BareMetalServerProfileDiskQuantity.
-
- """
-
- def __init__(
- self,
- ) -> None:
- """
- Initialize a BareMetalServerProfileDiskQuantity object.
-
- """
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['BareMetalServerProfileDiskQuantityFixed', 'BareMetalServerProfileDiskQuantityRange', 'BareMetalServerProfileDiskQuantityEnum', 'BareMetalServerProfileDiskQuantityDependent'])
- )
- raise Exception(msg)
-
-
-class BareMetalServerProfileDiskSize:
- """
- BareMetalServerProfileDiskSize.
-
- """
-
- def __init__(
- self,
- ) -> None:
- """
- Initialize a BareMetalServerProfileDiskSize object.
-
- """
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['BareMetalServerProfileDiskSizeFixed', 'BareMetalServerProfileDiskSizeRange', 'BareMetalServerProfileDiskSizeEnum', 'BareMetalServerProfileDiskSizeDependent'])
- )
- raise Exception(msg)
-
-
-class BareMetalServerProfileDiskSupportedInterfaces:
+class BareMetalServerPatch:
"""
- BareMetalServerProfileDiskSupportedInterfaces.
+ BareMetalServerPatch.
- :attr str default: The disk interface used for attaching the disk.
- - `fcp`: Attached using Fiber Channel Protocol
- - `sata`: Attached using Serial Advanced Technology Attachment
- - `nvme`: Attached using Non-Volatile Memory Express
- The enumerated values for this property are expected to expand in the future.
- When processing this property, check for and log unknown values. Optionally halt
- processing and surface the error, or bypass the resource on which the unexpected
- property value was encountered.
- :attr str type: The type for this profile field.
- :attr List[str] values: The supported disk interfaces used for attaching the
- disk.
+ :param bool enable_secure_boot: (optional) Indicates whether secure boot is
+ enabled. If enabled, the image must support secure boot or the bare metal server
+ will fail to boot.
+ For `enable_secure_boot` to be changed, the bare metal server `status` must be
+ `stopped`.
+ :param str name: (optional) The name for this bare metal server. The name must
+ not be used by another bare metal server in the region. Changing the name will
+ not affect the system hostname.
+ :param BareMetalServerTrustedPlatformModulePatch trusted_platform_module:
+ (optional)
"""
def __init__(
self,
- default: str,
- type: str,
- values: List[str],
+ *,
+ enable_secure_boot: Optional[bool] = None,
+ name: Optional[str] = None,
+ trusted_platform_module: Optional['BareMetalServerTrustedPlatformModulePatch'] = None,
) -> None:
"""
- Initialize a BareMetalServerProfileDiskSupportedInterfaces object.
+ Initialize a BareMetalServerPatch object.
- :param str default: The disk interface used for attaching the disk.
- - `fcp`: Attached using Fiber Channel Protocol
- - `sata`: Attached using Serial Advanced Technology Attachment
- - `nvme`: Attached using Non-Volatile Memory Express
- The enumerated values for this property are expected to expand in the
- future. When processing this property, check for and log unknown values.
- Optionally halt processing and surface the error, or bypass the resource on
- 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 bool enable_secure_boot: (optional) Indicates whether secure boot is
+ enabled. If enabled, the image must support secure boot or the bare metal
+ server will fail to boot.
+ For `enable_secure_boot` to be changed, the bare metal server `status` must
+ be
+ `stopped`.
+ :param str name: (optional) The name for this bare metal server. The name
+ must not be used by another bare metal server in the region. Changing the
+ name will not affect the system hostname.
+ :param BareMetalServerTrustedPlatformModulePatch trusted_platform_module:
+ (optional)
"""
- self.default = default
- self.type = type
- self.values = values
+ self.enable_secure_boot = enable_secure_boot
+ self.name = name
+ self.trusted_platform_module = trusted_platform_module
@classmethod
- def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileDiskSupportedInterfaces':
- """Initialize a BareMetalServerProfileDiskSupportedInterfaces object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'BareMetalServerPatch':
+ """Initialize a BareMetalServerPatch 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')
+ if (enable_secure_boot := _dict.get('enable_secure_boot')) is not None:
+ args['enable_secure_boot'] = enable_secure_boot
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ if (trusted_platform_module := _dict.get('trusted_platform_module')) is not None:
+ args['trusted_platform_module'] = BareMetalServerTrustedPlatformModulePatch.from_dict(trusted_platform_module)
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a BareMetalServerProfileDiskSupportedInterfaces object from a json dictionary."""
+ """Initialize a BareMetalServerPatch object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, '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, 'enable_secure_boot') and self.enable_secure_boot is not None:
+ _dict['enable_secure_boot'] = self.enable_secure_boot
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ if hasattr(self, 'trusted_platform_module') and self.trusted_platform_module is not None:
+ if isinstance(self.trusted_platform_module, dict):
+ _dict['trusted_platform_module'] = self.trusted_platform_module
+ else:
+ _dict['trusted_platform_module'] = self.trusted_platform_module.to_dict()
return _dict
def _to_dict(self):
@@ -29686,181 +31685,321 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this BareMetalServerProfileDiskSupportedInterfaces object."""
+ """Return a `str` version of this BareMetalServerPatch object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'BareMetalServerProfileDiskSupportedInterfaces') -> bool:
+ def __eq__(self, other: 'BareMetalServerPatch') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'BareMetalServerProfileDiskSupportedInterfaces') -> bool:
+ def __ne__(self, other: 'BareMetalServerPatch') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class DefaultEnum(str, Enum):
- """
- The disk interface used for attaching the disk.
- - `fcp`: Attached using Fiber Channel Protocol
- - `sata`: Attached using Serial Advanced Technology Attachment
- - `nvme`: Attached using Non-Volatile Memory Express
- The enumerated values for this property are expected to expand in the future. When
- processing this property, check for and log unknown values. Optionally halt
- processing and surface the error, or bypass the resource on which the unexpected
- property value was encountered.
- """
-
- FCP = 'fcp'
- NVME = 'nvme'
- SATA = 'sata'
-
-
- class TypeEnum(str, Enum):
- """
- The type for this profile field.
- """
-
- ENUM = 'enum'
-
-
- class ValuesEnum(str, Enum):
- """
- The disk interface used for attaching the disk.
- - `fcp`: Attached using Fiber Channel Protocol
- - `sata`: Attached using Serial Advanced Technology Attachment
- - `nvme`: Attached using Non-Volatile Memory Express
- The enumerated values for this property are expected to expand in the future. When
- processing this property, check for and log unknown values. Optionally halt
- processing and surface the error, or bypass the resource on which the unexpected
- property value was encountered.
- """
-
- FCP = 'fcp'
- NVME = 'nvme'
- SATA = 'sata'
-
-
-class BareMetalServerProfileIdentity:
+class BareMetalServerPrimaryNetworkAttachmentPrototype:
"""
- Identifies a bare metal server profile by a unique property.
+ BareMetalServerPrimaryNetworkAttachmentPrototype.
+ :param str interface_type: (optional) The network attachment's 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 attachment
+ - Cannot directly use an IEEE 802.1Q tag.
+ - Not supported on bare metal servers with a `cpu.architecture` of `s390x`.
+ :param str name: (optional) The name for this bare metal server network
+ attachment. Names must be unique within the bare metal server the network
+ attachment resides in. If unspecified, the name will be a hyphenated list of
+ randomly-selected words.
+ :param BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterface
+ virtual_network_interface: A virtual network interface for the bare metal server
+ network attachment. This can be
+ specified using an existing virtual network interface, or a prototype object for
+ a new
+ virtual network interface.
+ If an existing virtual network interface is specified, it must not be the target
+ of a flow
+ log collector.
"""
def __init__(
self,
+ virtual_network_interface: 'BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterface',
+ *,
+ interface_type: Optional[str] = None,
+ name: Optional[str] = None,
) -> None:
"""
- Initialize a BareMetalServerProfileIdentity object.
+ Initialize a BareMetalServerPrimaryNetworkAttachmentPrototype object.
+ :param BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterface
+ virtual_network_interface: A virtual network interface for the bare metal
+ server network attachment. This can be
+ specified using an existing virtual network interface, or a prototype
+ object for a new
+ virtual network interface.
+ If an existing virtual network interface is specified, it must not be the
+ target of a flow
+ log collector.
+ :param str interface_type: (optional) The network attachment's 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 attachment
+ - Cannot directly use an IEEE 802.1Q tag.
+ - Not supported on bare metal servers with a `cpu.architecture` of
+ `s390x`.
+ :param str name: (optional) The name for this bare metal server network
+ attachment. Names must be unique within the bare metal server the network
+ attachment 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(['BareMetalServerProfileIdentityByName', 'BareMetalServerProfileIdentityByHref'])
+ ", ".join(['BareMetalServerPrimaryNetworkAttachmentPrototypeBareMetalServerPrimaryNetworkAttachmentByPCIPrototype'])
)
raise Exception(msg)
-
-class BareMetalServerProfileMemory:
- """
- BareMetalServerProfileMemory.
-
- """
-
- def __init__(
- self,
- ) -> None:
+ class InterfaceTypeEnum(str, Enum):
"""
- Initialize a BareMetalServerProfileMemory object.
-
+ The network attachment's 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 attachment
+ - Cannot directly use an IEEE 802.1Q tag.
+ - Not supported on bare metal servers with a `cpu.architecture` of `s390x`.
"""
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['BareMetalServerProfileMemoryFixed', 'BareMetalServerProfileMemoryRange', 'BareMetalServerProfileMemoryEnum', 'BareMetalServerProfileMemoryDependent'])
- )
- raise Exception(msg)
-
-
-class BareMetalServerProfileNetworkInterfaceCount:
- """
- BareMetalServerProfileNetworkInterfaceCount.
-
- """
- def __init__(
- self,
- ) -> None:
- """
- Initialize a BareMetalServerProfileNetworkInterfaceCount object.
+ PCI = 'pci'
- """
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['BareMetalServerProfileNetworkInterfaceCountRange', 'BareMetalServerProfileNetworkInterfaceCountDependent'])
- )
- raise Exception(msg)
-class BareMetalServerProfileOSArchitecture:
+class BareMetalServerPrimaryNetworkInterfacePrototype:
"""
- BareMetalServerProfileOSArchitecture.
+ BareMetalServerPrimaryNetworkInterfacePrototype.
- :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.
+ :param bool allow_ip_spoofing: (optional) Indicates whether source IP spoofing
+ is allowed on this bare metal server network interface.
+ If this bare metal server has network attachments, this network interface is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and source IP spoofing is managed on the attached virtual network
+ interface.
+ :param List[int] allowed_vlans: (optional) The VLAN IDs allowed for `vlan`
+ interfaces using this PCI interface.
+ If this bare metal server has network attachments, this network interface is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and the VLAN IDs match the `allow_vlans` of the corresponding network
+ attachment.
+ :param bool enable_infrastructure_nat: (optional) If `true`:
+ - The VPC infrastructure performs any needed NAT operations.
+ - `floating_ips` must not have more than one floating IP.
+ If `false`:
+ - Packets are passed unchanged to/from the bare metal server network interface,
+ allowing the workload to perform any needed NAT operations.
+ - `allow_ip_spoofing` must be `false`.
+ - `interface_type` must not be `hipersocket`.
+ If this bare metal server has network attachments, this network interface is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and infrastructure NAT is managed on the attached virtual network
+ interface.
+ :param str interface_type: (optional) The interface type:
+ - `hipersocket`: a virtual device that provides high-speed TCP/IP connectivity
+ within a `s390x` based system.
+ - Not supported on bare metal servers with a `cpu.architecture` of `amd64`
+ - `pci`: a physical PCI device which can only be created or deleted when the
+ bare metal
+ server is stopped
+ - Has an `allowed_vlans` property which controls the VLANs that will be
+ permitted
+ to use the PCI interface
+ - Cannot directly use an IEEE 802.1Q tag.
+ - Not supported on bare metal servers with a `cpu.architecture` of `s390x`.
+ :param str name: (optional) The name for this bare metal server network
+ interface. The name must not be used by another network interface on the bare
+ metal server. If unspecified, the name will be a hyphenated list of
+ randomly-selected words.
+ :param NetworkInterfaceIPPrototype primary_ip: (optional) The primary IP address
+ to bind to the bare metal server network interface. This can be
+ specified using an existing reserved IP, or a prototype object for a new
+ reserved IP.
+ If an existing reserved IP or a prototype object with an address is specified,
+ it must
+ be available on the bare metal server network interface's subnet. Otherwise, an
+ available address on the subnet will be automatically selected and reserved.
+ :param List[SecurityGroupIdentity] security_groups: (optional) The security
+ groups to use for this bare metal server network interface. If unspecified, the
+ VPC's default security group is used.
+ :param SubnetIdentity subnet: The associated subnet.
"""
def __init__(
self,
- default: str,
- type: str,
- values: List[str],
+ subnet: 'SubnetIdentity',
+ *,
+ allow_ip_spoofing: Optional[bool] = None,
+ allowed_vlans: Optional[List[int]] = None,
+ enable_infrastructure_nat: Optional[bool] = None,
+ interface_type: Optional[str] = None,
+ name: Optional[str] = None,
+ primary_ip: Optional['NetworkInterfaceIPPrototype'] = None,
+ security_groups: Optional[List['SecurityGroupIdentity']] = None,
) -> None:
"""
- Initialize a BareMetalServerProfileOSArchitecture object.
+ Initialize a BareMetalServerPrimaryNetworkInterfacePrototype object.
- :param str default: The default OS architecture for a bare metal server
- with this profile.
- :param str type: The type for this profile field.
- :param List[str] values: The supported OS architecture(s) for a bare metal
- server with this profile.
+ :param SubnetIdentity subnet: The associated subnet.
+ :param bool allow_ip_spoofing: (optional) Indicates whether source IP
+ spoofing is allowed on this bare metal server network interface.
+ If this bare metal server has network attachments, this network interface
+ is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and source IP spoofing is managed on the attached virtual
+ network interface.
+ :param List[int] allowed_vlans: (optional) The VLAN IDs allowed for `vlan`
+ interfaces using this PCI interface.
+ If this bare metal server has network attachments, this network interface
+ is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and the VLAN IDs match the `allow_vlans` of the corresponding
+ network attachment.
+ :param bool enable_infrastructure_nat: (optional) If `true`:
+ - The VPC infrastructure performs any needed NAT operations.
+ - `floating_ips` must not have more than one floating IP.
+ If `false`:
+ - Packets are passed unchanged to/from the bare metal server network
+ interface,
+ allowing the workload to perform any needed NAT operations.
+ - `allow_ip_spoofing` must be `false`.
+ - `interface_type` must not be `hipersocket`.
+ If this bare metal server has network attachments, this network interface
+ is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and infrastructure NAT is managed on the attached virtual
+ network interface.
+ :param str interface_type: (optional) The interface type:
+ - `hipersocket`: a virtual device that provides high-speed TCP/IP
+ connectivity
+ within a `s390x` based system.
+ - Not supported on bare metal servers with a `cpu.architecture` of
+ `amd64`
+ - `pci`: a physical PCI device which can only be created or deleted when
+ the bare metal
+ server is stopped
+ - Has an `allowed_vlans` property which controls the VLANs that will be
+ permitted
+ to use the PCI interface
+ - Cannot directly use an IEEE 802.1Q tag.
+ - Not supported on bare metal servers with a `cpu.architecture` of
+ `s390x`.
+ :param str name: (optional) The name for this bare metal server network
+ interface. The name must not be used by another network interface on the
+ bare metal server. If unspecified, the name will be a hyphenated list of
+ randomly-selected words.
+ :param NetworkInterfaceIPPrototype primary_ip: (optional) The primary IP
+ address to bind to the bare metal server network interface. This can be
+ specified using an existing reserved IP, or a prototype object for a new
+ reserved IP.
+ If an existing reserved IP or a prototype object with an address is
+ specified, it must
+ be available on the bare metal server network interface's subnet.
+ Otherwise, an
+ available address on the subnet will be automatically selected and
+ reserved.
+ :param List[SecurityGroupIdentity] security_groups: (optional) The security
+ groups to use for this bare metal server network interface. If unspecified,
+ the VPC's default security group is used.
"""
- self.default = default
- self.type = type
- self.values = values
+ self.allow_ip_spoofing = allow_ip_spoofing
+ self.allowed_vlans = allowed_vlans
+ self.enable_infrastructure_nat = enable_infrastructure_nat
+ self.interface_type = interface_type
+ self.name = name
+ self.primary_ip = primary_ip
+ self.security_groups = security_groups
+ self.subnet = subnet
@classmethod
- def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileOSArchitecture':
- """Initialize a BareMetalServerProfileOSArchitecture object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'BareMetalServerPrimaryNetworkInterfacePrototype':
+ """Initialize a BareMetalServerPrimaryNetworkInterfacePrototype 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')
+ if (allow_ip_spoofing := _dict.get('allow_ip_spoofing')) is not None:
+ args['allow_ip_spoofing'] = allow_ip_spoofing
+ if (allowed_vlans := _dict.get('allowed_vlans')) is not None:
+ args['allowed_vlans'] = allowed_vlans
+ if (enable_infrastructure_nat := _dict.get('enable_infrastructure_nat')) is not None:
+ args['enable_infrastructure_nat'] = enable_infrastructure_nat
+ if (interface_type := _dict.get('interface_type')) is not None:
+ args['interface_type'] = interface_type
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ if (primary_ip := _dict.get('primary_ip')) is not None:
+ args['primary_ip'] = primary_ip
+ if (security_groups := _dict.get('security_groups')) is not None:
+ args['security_groups'] = security_groups
+ if (subnet := _dict.get('subnet')) is not None:
+ args['subnet'] = subnet
else:
- raise ValueError('Required property \'values\' not present in BareMetalServerProfileOSArchitecture JSON')
+ raise ValueError('Required property \'subnet\' not present in BareMetalServerPrimaryNetworkInterfacePrototype JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a BareMetalServerProfileOSArchitecture object from a json dictionary."""
+ """Initialize a BareMetalServerPrimaryNetworkInterfacePrototype object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, '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, 'allow_ip_spoofing') and self.allow_ip_spoofing is not None:
+ _dict['allow_ip_spoofing'] = self.allow_ip_spoofing
+ if hasattr(self, 'allowed_vlans') and self.allowed_vlans is not None:
+ _dict['allowed_vlans'] = self.allowed_vlans
+ if hasattr(self, 'enable_infrastructure_nat') and self.enable_infrastructure_nat is not None:
+ _dict['enable_infrastructure_nat'] = self.enable_infrastructure_nat
+ if hasattr(self, 'interface_type') and self.interface_type is not None:
+ _dict['interface_type'] = self.interface_type
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ if hasattr(self, 'primary_ip') and self.primary_ip is not None:
+ if isinstance(self.primary_ip, dict):
+ _dict['primary_ip'] = self.primary_ip
+ else:
+ _dict['primary_ip'] = self.primary_ip.to_dict()
+ if hasattr(self, 'security_groups') and self.security_groups is not None:
+ security_groups_list = []
+ for v in self.security_groups:
+ if isinstance(v, dict):
+ security_groups_list.append(v)
+ else:
+ security_groups_list.append(v.to_dict())
+ _dict['security_groups'] = security_groups_list
+ if hasattr(self, 'subnet') and self.subnet is not None:
+ if isinstance(self.subnet, dict):
+ _dict['subnet'] = self.subnet
+ else:
+ _dict['subnet'] = self.subnet.to_dict()
return _dict
def _to_dict(self):
@@ -29868,86 +32007,281 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this BareMetalServerProfileOSArchitecture object."""
+ """Return a `str` version of this BareMetalServerPrimaryNetworkInterfacePrototype object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'BareMetalServerProfileOSArchitecture') -> bool:
+ def __eq__(self, other: 'BareMetalServerPrimaryNetworkInterfacePrototype') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'BareMetalServerProfileOSArchitecture') -> bool:
+ def __ne__(self, other: 'BareMetalServerPrimaryNetworkInterfacePrototype') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class TypeEnum(str, Enum):
+ class InterfaceTypeEnum(str, Enum):
"""
- The type for this profile field.
+ The interface type:
+ - `hipersocket`: a virtual device that provides high-speed TCP/IP connectivity
+ within a `s390x` based system.
+ - Not supported on bare metal servers with a `cpu.architecture` of `amd64`
+ - `pci`: a physical PCI device which can only be created or deleted when the bare
+ metal
+ server is stopped
+ - Has an `allowed_vlans` property which controls the VLANs that will be
+ permitted
+ to use the PCI interface
+ - Cannot directly use an IEEE 802.1Q tag.
+ - Not supported on bare metal servers with a `cpu.architecture` of `s390x`.
"""
- ENUM = 'enum'
+ HIPERSOCKET = 'hipersocket'
+ PCI = 'pci'
-class BareMetalServerProfileReference:
+class BareMetalServerProfile:
"""
- BareMetalServerProfileReference.
+ BareMetalServerProfile.
- :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.
+ :param BareMetalServerProfileBandwidth bandwidth:
+ :param BareMetalServerProfileConsoleTypes console_types: The console type
+ configuration for a bare metal server with this profile.
+ :param BareMetalServerProfileCPUArchitecture cpu_architecture:
+ :param BareMetalServerProfileCPUCoreCount cpu_core_count:
+ :param BareMetalServerProfileCPUSocketCount cpu_socket_count:
+ :param List[BareMetalServerProfileDisk] disks: Collection of the bare metal
+ server profile's disks.
+ :param str family: The product family this bare metal server profile belongs to.
+ :param str href: The URL for this bare metal server profile.
+ :param BareMetalServerProfileMemory memory:
+ :param str name: The name for this bare metal server profile.
+ :param BareMetalServerProfileNetworkAttachmentCount network_attachment_count:
+ :param BareMetalServerProfileNetworkInterfaceCount network_interface_count:
+ :param BareMetalServerProfileOSArchitecture os_architecture:
+ :param str resource_type: The resource type.
+ :param BareMetalServerProfileSupportedTrustedPlatformModuleModes
+ supported_trusted_platform_module_modes: The supported trusted platform module
+ modes for this bare metal server profile.
+ :param BareMetalServerProfileVirtualNetworkInterfacesSupported
+ virtual_network_interfaces_supported: Indicates whether this profile supports
+ virtual network interfaces.
"""
def __init__(
self,
+ bandwidth: 'BareMetalServerProfileBandwidth',
+ console_types: 'BareMetalServerProfileConsoleTypes',
+ cpu_architecture: 'BareMetalServerProfileCPUArchitecture',
+ cpu_core_count: 'BareMetalServerProfileCPUCoreCount',
+ cpu_socket_count: 'BareMetalServerProfileCPUSocketCount',
+ disks: List['BareMetalServerProfileDisk'],
+ family: str,
href: str,
+ memory: 'BareMetalServerProfileMemory',
name: str,
+ network_attachment_count: 'BareMetalServerProfileNetworkAttachmentCount',
+ network_interface_count: 'BareMetalServerProfileNetworkInterfaceCount',
+ os_architecture: 'BareMetalServerProfileOSArchitecture',
resource_type: str,
+ supported_trusted_platform_module_modes: 'BareMetalServerProfileSupportedTrustedPlatformModuleModes',
+ virtual_network_interfaces_supported: 'BareMetalServerProfileVirtualNetworkInterfacesSupported',
) -> None:
"""
- Initialize a BareMetalServerProfileReference object.
+ Initialize a BareMetalServerProfile object.
+ :param BareMetalServerProfileBandwidth bandwidth:
+ :param BareMetalServerProfileConsoleTypes console_types: The console type
+ configuration for a bare metal server with this profile.
+ :param BareMetalServerProfileCPUArchitecture cpu_architecture:
+ :param BareMetalServerProfileCPUCoreCount cpu_core_count:
+ :param BareMetalServerProfileCPUSocketCount cpu_socket_count:
+ :param List[BareMetalServerProfileDisk] disks: Collection of the bare metal
+ server profile's disks.
+ :param str family: The product family this bare metal server profile
+ belongs to.
:param str href: The URL for this bare metal server profile.
+ :param BareMetalServerProfileMemory memory:
:param str name: The name for this bare metal server profile.
+ :param BareMetalServerProfileNetworkAttachmentCount
+ network_attachment_count:
+ :param BareMetalServerProfileNetworkInterfaceCount network_interface_count:
+ :param BareMetalServerProfileOSArchitecture os_architecture:
:param str resource_type: The resource type.
+ :param BareMetalServerProfileSupportedTrustedPlatformModuleModes
+ supported_trusted_platform_module_modes: The supported trusted platform
+ module modes for this bare metal server profile.
+ :param BareMetalServerProfileVirtualNetworkInterfacesSupported
+ virtual_network_interfaces_supported: Indicates whether this profile
+ supports virtual network interfaces.
"""
+ self.bandwidth = bandwidth
+ self.console_types = console_types
+ self.cpu_architecture = cpu_architecture
+ self.cpu_core_count = cpu_core_count
+ self.cpu_socket_count = cpu_socket_count
+ self.disks = disks
+ self.family = family
self.href = href
+ self.memory = memory
self.name = name
+ self.network_attachment_count = network_attachment_count
+ self.network_interface_count = network_interface_count
+ self.os_architecture = os_architecture
self.resource_type = resource_type
+ self.supported_trusted_platform_module_modes = supported_trusted_platform_module_modes
+ self.virtual_network_interfaces_supported = virtual_network_interfaces_supported
@classmethod
- def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileReference':
- """Initialize a BareMetalServerProfileReference object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfile':
+ """Initialize a BareMetalServerProfile object from a json dictionary."""
args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ if (bandwidth := _dict.get('bandwidth')) is not None:
+ args['bandwidth'] = bandwidth
else:
- raise ValueError('Required property \'href\' not present in BareMetalServerProfileReference JSON')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
+ raise ValueError('Required property \'bandwidth\' not present in BareMetalServerProfile JSON')
+ if (console_types := _dict.get('console_types')) is not None:
+ args['console_types'] = BareMetalServerProfileConsoleTypes.from_dict(console_types)
else:
- raise ValueError('Required property \'name\' not present in BareMetalServerProfileReference JSON')
- if 'resource_type' in _dict:
- args['resource_type'] = _dict.get('resource_type')
+ raise ValueError('Required property \'console_types\' not present in BareMetalServerProfile JSON')
+ if (cpu_architecture := _dict.get('cpu_architecture')) is not None:
+ args['cpu_architecture'] = BareMetalServerProfileCPUArchitecture.from_dict(cpu_architecture)
else:
- raise ValueError('Required property \'resource_type\' not present in BareMetalServerProfileReference JSON')
+ raise ValueError('Required property \'cpu_architecture\' not present in BareMetalServerProfile JSON')
+ if (cpu_core_count := _dict.get('cpu_core_count')) is not None:
+ args['cpu_core_count'] = cpu_core_count
+ else:
+ raise ValueError('Required property \'cpu_core_count\' not present in BareMetalServerProfile JSON')
+ if (cpu_socket_count := _dict.get('cpu_socket_count')) is not None:
+ args['cpu_socket_count'] = cpu_socket_count
+ else:
+ raise ValueError('Required property \'cpu_socket_count\' not present in BareMetalServerProfile JSON')
+ if (disks := _dict.get('disks')) is not None:
+ args['disks'] = [BareMetalServerProfileDisk.from_dict(v) for v in disks]
+ else:
+ raise ValueError('Required property \'disks\' not present in BareMetalServerProfile JSON')
+ if (family := _dict.get('family')) is not None:
+ args['family'] = family
+ else:
+ raise ValueError('Required property \'family\' not present in BareMetalServerProfile JSON')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
+ else:
+ raise ValueError('Required property \'href\' not present in BareMetalServerProfile JSON')
+ if (memory := _dict.get('memory')) is not None:
+ args['memory'] = memory
+ else:
+ raise ValueError('Required property \'memory\' not present in BareMetalServerProfile JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ else:
+ raise ValueError('Required property \'name\' not present in BareMetalServerProfile JSON')
+ if (network_attachment_count := _dict.get('network_attachment_count')) is not None:
+ args['network_attachment_count'] = network_attachment_count
+ else:
+ raise ValueError('Required property \'network_attachment_count\' not present in BareMetalServerProfile JSON')
+ if (network_interface_count := _dict.get('network_interface_count')) is not None:
+ args['network_interface_count'] = network_interface_count
+ else:
+ raise ValueError('Required property \'network_interface_count\' not present in BareMetalServerProfile JSON')
+ if (os_architecture := _dict.get('os_architecture')) is not None:
+ args['os_architecture'] = BareMetalServerProfileOSArchitecture.from_dict(os_architecture)
+ else:
+ raise ValueError('Required property \'os_architecture\' not present in BareMetalServerProfile JSON')
+ if (resource_type := _dict.get('resource_type')) is not None:
+ args['resource_type'] = resource_type
+ else:
+ raise ValueError('Required property \'resource_type\' not present in BareMetalServerProfile JSON')
+ if (supported_trusted_platform_module_modes := _dict.get('supported_trusted_platform_module_modes')) is not None:
+ args['supported_trusted_platform_module_modes'] = BareMetalServerProfileSupportedTrustedPlatformModuleModes.from_dict(supported_trusted_platform_module_modes)
+ else:
+ raise ValueError('Required property \'supported_trusted_platform_module_modes\' not present in BareMetalServerProfile JSON')
+ if (virtual_network_interfaces_supported := _dict.get('virtual_network_interfaces_supported')) is not None:
+ args['virtual_network_interfaces_supported'] = BareMetalServerProfileVirtualNetworkInterfacesSupported.from_dict(virtual_network_interfaces_supported)
+ else:
+ raise ValueError('Required property \'virtual_network_interfaces_supported\' not present in BareMetalServerProfile JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a BareMetalServerProfileReference object from a json dictionary."""
+ """Initialize a BareMetalServerProfile object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
+ if hasattr(self, 'bandwidth') and self.bandwidth is not None:
+ if isinstance(self.bandwidth, dict):
+ _dict['bandwidth'] = self.bandwidth
+ else:
+ _dict['bandwidth'] = self.bandwidth.to_dict()
+ if hasattr(self, 'console_types') and self.console_types is not None:
+ if isinstance(self.console_types, dict):
+ _dict['console_types'] = self.console_types
+ else:
+ _dict['console_types'] = self.console_types.to_dict()
+ if hasattr(self, 'cpu_architecture') and self.cpu_architecture is not None:
+ if isinstance(self.cpu_architecture, dict):
+ _dict['cpu_architecture'] = self.cpu_architecture
+ else:
+ _dict['cpu_architecture'] = self.cpu_architecture.to_dict()
+ if hasattr(self, 'cpu_core_count') and self.cpu_core_count is not None:
+ if isinstance(self.cpu_core_count, dict):
+ _dict['cpu_core_count'] = self.cpu_core_count
+ else:
+ _dict['cpu_core_count'] = self.cpu_core_count.to_dict()
+ if hasattr(self, 'cpu_socket_count') and self.cpu_socket_count is not None:
+ if isinstance(self.cpu_socket_count, dict):
+ _dict['cpu_socket_count'] = self.cpu_socket_count
+ else:
+ _dict['cpu_socket_count'] = self.cpu_socket_count.to_dict()
+ if hasattr(self, 'disks') and self.disks is not None:
+ disks_list = []
+ for v in self.disks:
+ if isinstance(v, dict):
+ disks_list.append(v)
+ else:
+ disks_list.append(v.to_dict())
+ _dict['disks'] = disks_list
+ if hasattr(self, 'family') and self.family is not None:
+ _dict['family'] = self.family
if hasattr(self, 'href') and self.href is not None:
_dict['href'] = self.href
+ if hasattr(self, 'memory') and self.memory is not None:
+ if isinstance(self.memory, dict):
+ _dict['memory'] = self.memory
+ else:
+ _dict['memory'] = self.memory.to_dict()
if hasattr(self, 'name') and self.name is not None:
_dict['name'] = self.name
+ if hasattr(self, 'network_attachment_count') and self.network_attachment_count is not None:
+ if isinstance(self.network_attachment_count, dict):
+ _dict['network_attachment_count'] = self.network_attachment_count
+ else:
+ _dict['network_attachment_count'] = self.network_attachment_count.to_dict()
+ if hasattr(self, 'network_interface_count') and self.network_interface_count is not None:
+ if isinstance(self.network_interface_count, dict):
+ _dict['network_interface_count'] = self.network_interface_count
+ else:
+ _dict['network_interface_count'] = self.network_interface_count.to_dict()
+ if hasattr(self, 'os_architecture') and self.os_architecture is not None:
+ if isinstance(self.os_architecture, dict):
+ _dict['os_architecture'] = self.os_architecture
+ else:
+ _dict['os_architecture'] = self.os_architecture.to_dict()
if hasattr(self, 'resource_type') and self.resource_type is not None:
_dict['resource_type'] = self.resource_type
+ if hasattr(self, 'supported_trusted_platform_module_modes') and self.supported_trusted_platform_module_modes is not None:
+ if isinstance(self.supported_trusted_platform_module_modes, dict):
+ _dict['supported_trusted_platform_module_modes'] = self.supported_trusted_platform_module_modes
+ else:
+ _dict['supported_trusted_platform_module_modes'] = self.supported_trusted_platform_module_modes.to_dict()
+ if hasattr(self, 'virtual_network_interfaces_supported') and self.virtual_network_interfaces_supported is not None:
+ if isinstance(self.virtual_network_interfaces_supported, dict):
+ _dict['virtual_network_interfaces_supported'] = self.virtual_network_interfaces_supported
+ else:
+ _dict['virtual_network_interfaces_supported'] = self.virtual_network_interfaces_supported.to_dict()
return _dict
def _to_dict(self):
@@ -29955,16 +32289,16 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this BareMetalServerProfileReference object."""
+ """Return a `str` version of this BareMetalServerProfile object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'BareMetalServerProfileReference') -> bool:
+ def __eq__(self, other: 'BareMetalServerProfile') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'BareMetalServerProfileReference') -> bool:
+ def __ne__(self, other: 'BareMetalServerProfile') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
@@ -29977,54 +32311,86 @@ class ResourceTypeEnum(str, Enum):
-class BareMetalServerProfileSupportedTrustedPlatformModuleModes:
+class BareMetalServerProfileBandwidth:
"""
- The supported trusted platform module modes for this bare metal server profile.
+ 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 type: The type for this profile field.
- :attr List[str] values: The supported trusted platform module modes.
+ :param str default: (optional) The default CPU architecture for a bare metal
+ server with this profile.
+ :param str type: The type for this profile field.
+ :param str value: The CPU architecture for a bare metal server with this
+ profile.
"""
def __init__(
self,
type: str,
- values: List[str],
+ value: str,
+ *,
+ default: Optional[str] = None,
) -> None:
"""
- Initialize a BareMetalServerProfileSupportedTrustedPlatformModuleModes object.
+ Initialize a BareMetalServerProfileCPUArchitecture object.
:param str type: The type for this profile field.
- :param List[str] values: The supported trusted platform module modes.
+ :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.values = values
+ self.value = value
@classmethod
- def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileSupportedTrustedPlatformModuleModes':
- """Initialize a BareMetalServerProfileSupportedTrustedPlatformModuleModes object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileCPUArchitecture':
+ """Initialize a BareMetalServerProfileCPUArchitecture object from a json dictionary."""
args = {}
- if 'type' in _dict:
- args['type'] = _dict.get('type')
+ if (default := _dict.get('default')) is not None:
+ args['default'] = default
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
else:
- raise ValueError('Required property \'type\' not present in BareMetalServerProfileSupportedTrustedPlatformModuleModes JSON')
- if 'values' in _dict:
- args['values'] = _dict.get('values')
+ raise ValueError('Required property \'type\' not present in BareMetalServerProfileCPUArchitecture JSON')
+ if (value := _dict.get('value')) is not None:
+ args['value'] = value
else:
- raise ValueError('Required property \'values\' not present in BareMetalServerProfileSupportedTrustedPlatformModuleModes JSON')
+ raise ValueError('Required property \'value\' not present in BareMetalServerProfileCPUArchitecture JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a BareMetalServerProfileSupportedTrustedPlatformModuleModes object from a json dictionary."""
+ """Initialize a BareMetalServerProfileCPUArchitecture object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
+ if hasattr(self, 'default') and self.default is not None:
+ _dict['default'] = self.default
if hasattr(self, 'type') and self.type is not None:
_dict['type'] = self.type
- if hasattr(self, 'values') and self.values is not None:
- _dict['values'] = self.values
+ if hasattr(self, 'value') and self.value is not None:
+ _dict['value'] = self.value
return _dict
def _to_dict(self):
@@ -30032,16 +32398,16 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this BareMetalServerProfileSupportedTrustedPlatformModuleModes object."""
+ """Return a `str` version of this BareMetalServerProfileCPUArchitecture object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'BareMetalServerProfileSupportedTrustedPlatformModuleModes') -> bool:
+ def __eq__(self, other: 'BareMetalServerProfileCPUArchitecture') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'BareMetalServerProfileSupportedTrustedPlatformModuleModes') -> bool:
+ def __ne__(self, other: 'BareMetalServerProfileCPUArchitecture') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
@@ -30050,96 +32416,147 @@ class TypeEnum(str, Enum):
The type for this profile field.
"""
- ENUM = 'enum'
+ FIXED = 'fixed'
- class ValuesEnum(str, Enum):
+
+class BareMetalServerProfileCPUCoreCount:
+ """
+ BareMetalServerProfileCPUCoreCount.
+
+ """
+
+ def __init__(
+ self,
+ ) -> None:
"""
- The trusted platform module (TPM) mode:
- - `disabled`: No TPM functionality
- - `tpm_2`: TPM 2.0
- The enumerated values for this property are expected to expand in the future. When
- processing this property, check for and log unknown values. Optionally halt
- processing and surface the error, or bypass the resource on which the unexpected
- property value was encountered.
+ Initialize a BareMetalServerProfileCPUCoreCount object.
+
"""
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['BareMetalServerProfileCPUCoreCountFixed', 'BareMetalServerProfileCPUCoreCountRange', 'BareMetalServerProfileCPUCoreCountEnum', 'BareMetalServerProfileCPUCoreCountDependent'])
+ )
+ raise Exception(msg)
- DISABLED = 'disabled'
- TPM_2 = 'tpm_2'
+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 BareMetalServerStatusReason:
+
+class BareMetalServerProfileCollection:
"""
- BareMetalServerStatusReason.
+ BareMetalServerProfileCollection.
- :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.
+ :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 BareMetalServerProfileCollectionNext next: (optional) A link to the next
+ page of resources. This property is present for all pages
+ except the last page.
+ :param List[BareMetalServerProfile] profiles: Collection of bare metal server
+ profiles.
+ :param int total_count: The total number of resources across all pages.
"""
def __init__(
self,
- code: str,
- message: str,
+ first: 'BareMetalServerProfileCollectionFirst',
+ limit: int,
+ profiles: List['BareMetalServerProfile'],
+ total_count: int,
*,
- more_info: str = None,
+ next: Optional['BareMetalServerProfileCollectionNext'] = None,
) -> None:
"""
- Initialize a BareMetalServerStatusReason object.
+ Initialize a BareMetalServerProfileCollection 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.
+ :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.code = code
- self.message = message
- 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) -> 'BareMetalServerStatusReason':
- """Initialize a BareMetalServerStatusReason object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileCollection':
+ """Initialize a BareMetalServerProfileCollection object from a json dictionary."""
args = {}
- if 'code' in _dict:
- args['code'] = _dict.get('code')
+ if (first := _dict.get('first')) is not None:
+ args['first'] = BareMetalServerProfileCollectionFirst.from_dict(first)
else:
- raise ValueError('Required property \'code\' not present in BareMetalServerStatusReason JSON')
- if 'message' in _dict:
- args['message'] = _dict.get('message')
+ raise ValueError('Required property \'first\' not present in BareMetalServerProfileCollection JSON')
+ if (limit := _dict.get('limit')) is not None:
+ args['limit'] = limit
else:
- raise ValueError('Required property \'message\' not present in BareMetalServerStatusReason JSON')
- if 'more_info' in _dict:
- args['more_info'] = _dict.get('more_info')
+ raise ValueError('Required property \'limit\' not present in BareMetalServerProfileCollection JSON')
+ if (next := _dict.get('next')) is not None:
+ args['next'] = BareMetalServerProfileCollectionNext.from_dict(next)
+ if (profiles := _dict.get('profiles')) is not None:
+ args['profiles'] = [BareMetalServerProfile.from_dict(v) for v in profiles]
+ else:
+ raise ValueError('Required property \'profiles\' not present in BareMetalServerProfileCollection JSON')
+ if (total_count := _dict.get('total_count')) is not None:
+ args['total_count'] = 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 BareMetalServerStatusReason object from a json dictionary."""
+ """Initialize a BareMetalServerProfileCollection object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'code') and self.code is not None:
- _dict['code'] = self.code
- if hasattr(self, 'message') and self.message is not None:
- _dict['message'] = self.message
- if hasattr(self, 'more_info') and self.more_info is not None:
- _dict['more_info'] = self.more_info
+ if hasattr(self, 'first') and self.first is not None:
+ if isinstance(self.first, dict):
+ _dict['first'] = self.first
+ else:
+ _dict['first'] = self.first.to_dict()
+ if hasattr(self, 'limit') and self.limit is not None:
+ _dict['limit'] = self.limit
+ if hasattr(self, 'next') and self.next is not None:
+ if isinstance(self.next, dict):
+ _dict['next'] = self.next
+ else:
+ _dict['next'] = self.next.to_dict()
+ if hasattr(self, 'profiles') and self.profiles is not None:
+ profiles_list = []
+ for v in self.profiles:
+ if isinstance(v, dict):
+ profiles_list.append(v)
+ else:
+ profiles_list.append(v.to_dict())
+ _dict['profiles'] = profiles_list
+ if hasattr(self, 'total_count') and self.total_count is not None:
+ _dict['total_count'] = self.total_count
return _dict
def _to_dict(self):
@@ -30147,109 +32564,58 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this BareMetalServerStatusReason object."""
+ """Return a `str` version of this BareMetalServerProfileCollection object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'BareMetalServerStatusReason') -> bool:
+ def __eq__(self, other: 'BareMetalServerProfileCollection') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'BareMetalServerStatusReason') -> bool:
+ def __ne__(self, other: 'BareMetalServerProfileCollection') -> 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:
+class BareMetalServerProfileCollectionFirst:
"""
- BareMetalServerTrustedPlatformModule.
+ A link to the first page of resources.
- :attr bool enabled: Indicates whether the trusted platform module is enabled.
- :attr str mode: The trusted platform module (TPM) mode:
- - `disabled`: No TPM functionality
- - `tpm_2`: TPM 2.0
- The enumerated values for this property are expected to expand in the future.
- When processing this property, check for and log unknown values. Optionally halt
- processing and surface the error, or bypass the resource on which the unexpected
- property value was encountered.
- :attr List[str] supported_modes: The supported trusted platform module modes.
+ :param str href: The URL for a page of resources.
"""
def __init__(
self,
- enabled: bool,
- mode: str,
- supported_modes: List[str],
+ href: str,
) -> None:
"""
- Initialize a BareMetalServerTrustedPlatformModule object.
+ Initialize a BareMetalServerProfileCollectionFirst object.
- :param bool enabled: Indicates whether the trusted platform module is
- enabled.
- :param str mode: The trusted platform module (TPM) mode:
- - `disabled`: No TPM functionality
- - `tpm_2`: TPM 2.0
- The enumerated values for this property are expected to expand in the
- future. When processing this property, check for and log unknown values.
- Optionally halt processing and surface the error, or bypass the resource on
- which the unexpected property value was encountered.
- :param List[str] supported_modes: The supported trusted platform module
- modes.
+ :param str href: The URL for a page of resources.
"""
- self.enabled = enabled
- self.mode = mode
- self.supported_modes = supported_modes
+ self.href = href
@classmethod
- def from_dict(cls, _dict: Dict) -> 'BareMetalServerTrustedPlatformModule':
- """Initialize a BareMetalServerTrustedPlatformModule object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileCollectionFirst':
+ """Initialize a BareMetalServerProfileCollectionFirst 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')
- else:
- raise ValueError('Required property \'mode\' not present in BareMetalServerTrustedPlatformModule JSON')
- if 'supported_modes' in _dict:
- args['supported_modes'] = _dict.get('supported_modes')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'supported_modes\' not present in BareMetalServerTrustedPlatformModule JSON')
+ raise ValueError('Required property \'href\' not present in BareMetalServerProfileCollectionFirst JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a BareMetalServerTrustedPlatformModule object from a json dictionary."""
+ """Initialize a BareMetalServerProfileCollectionFirst object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'enabled') and self.enabled is not None:
- _dict['enabled'] = self.enabled
- if hasattr(self, 'mode') and self.mode is not None:
- _dict['mode'] = self.mode
- if hasattr(self, 'supported_modes') and self.supported_modes is not None:
- _dict['supported_modes'] = self.supported_modes
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
return _dict
def _to_dict(self):
@@ -30257,94 +32623,59 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this BareMetalServerTrustedPlatformModule object."""
+ """Return a `str` version of this BareMetalServerProfileCollectionFirst object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'BareMetalServerTrustedPlatformModule') -> bool:
+ def __eq__(self, other: 'BareMetalServerProfileCollectionFirst') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'BareMetalServerTrustedPlatformModule') -> bool:
+ def __ne__(self, other: 'BareMetalServerProfileCollectionFirst') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class ModeEnum(str, Enum):
- """
- The trusted platform module (TPM) mode:
- - `disabled`: No TPM functionality
- - `tpm_2`: TPM 2.0
- The enumerated values for this property are expected to expand in the future. When
- processing this property, check for and log unknown values. Optionally halt
- processing and surface the error, or bypass the resource on which the unexpected
- property value was encountered.
- """
-
- DISABLED = 'disabled'
- TPM_2 = 'tpm_2'
-
-
- class SupportedModesEnum(str, Enum):
- """
- The trusted platform module (TPM) mode:
- - `disabled`: No TPM functionality
- - `tpm_2`: TPM 2.0
- The enumerated values for this property are expected to expand in the future. When
- processing this property, check for and log unknown values. Optionally halt
- processing and surface the error, or bypass the resource on which the unexpected
- property value was encountered.
- """
-
- DISABLED = 'disabled'
- TPM_2 = 'tpm_2'
-
-
-class BareMetalServerTrustedPlatformModulePatch:
+class BareMetalServerProfileCollectionNext:
"""
- BareMetalServerTrustedPlatformModulePatch.
+ A link to the next page of resources. This property is present for all pages except
+ the last page.
- :attr str mode: (optional) The trusted platform module mode to use. The
- specified value must be listed in the bare metal server's `supported_modes`.
- For the trusted platform module mode to be changed, the bare metal server
- `status` must be `stopped`.
+ :param str href: The URL for a page of resources.
"""
def __init__(
self,
- *,
- mode: str = None,
+ href: str,
) -> None:
"""
- Initialize a BareMetalServerTrustedPlatformModulePatch object.
+ Initialize a BareMetalServerProfileCollectionNext object.
- :param str mode: (optional) The trusted platform module mode to use. The
- specified value must be listed in the bare metal server's
- `supported_modes`.
- For the trusted platform module mode to be changed, the bare metal server
- `status` must be `stopped`.
+ :param str href: The URL for a page of resources.
"""
- self.mode = mode
+ self.href = href
@classmethod
- def from_dict(cls, _dict: Dict) -> 'BareMetalServerTrustedPlatformModulePatch':
- """Initialize a BareMetalServerTrustedPlatformModulePatch object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileCollectionNext':
+ """Initialize a BareMetalServerProfileCollectionNext object from a json dictionary."""
args = {}
- if 'mode' in _dict:
- args['mode'] = _dict.get('mode')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
+ else:
+ raise ValueError('Required property \'href\' not present in BareMetalServerProfileCollectionNext JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a BareMetalServerTrustedPlatformModulePatch object from a json dictionary."""
+ """Initialize a BareMetalServerProfileCollectionNext object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'mode') and self.mode is not None:
- _dict['mode'] = self.mode
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
return _dict
def _to_dict(self):
@@ -30352,73 +32683,70 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this BareMetalServerTrustedPlatformModulePatch object."""
+ """Return a `str` version of this BareMetalServerProfileCollectionNext object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'BareMetalServerTrustedPlatformModulePatch') -> bool:
+ def __eq__(self, other: 'BareMetalServerProfileCollectionNext') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'BareMetalServerTrustedPlatformModulePatch') -> bool:
+ def __ne__(self, other: 'BareMetalServerProfileCollectionNext') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class ModeEnum(str, Enum):
- """
- The trusted platform module mode to use. The specified value must be listed in the
- bare metal server's `supported_modes`.
- For the trusted platform module mode to be changed, the bare metal server `status`
- must be `stopped`.
- """
- DISABLED = 'disabled'
- TPM_2 = 'tpm_2'
+class BareMetalServerProfileConsoleTypes:
+ """
+ The console type configuration for a bare metal server with this profile.
-
-
-class BareMetalServerTrustedPlatformModulePrototype:
- """
- BareMetalServerTrustedPlatformModulePrototype.
-
- :attr str mode: (optional) The trusted platform module mode to use. The
- specified value must be listed in the bare metal server profile's
- `supported_trusted_platform_module_modes`.
+ :param str type: The type for this profile field.
+ :param List[str] values: The console types for a bare metal server with this
+ profile.
"""
def __init__(
self,
- *,
- mode: str = None,
+ type: str,
+ values: List[str],
) -> None:
"""
- Initialize a BareMetalServerTrustedPlatformModulePrototype object.
+ Initialize a BareMetalServerProfileConsoleTypes object.
- :param str mode: (optional) The trusted platform module mode to use. The
- specified value must be listed in the bare metal server profile's
- `supported_trusted_platform_module_modes`.
+ :param str type: The type for this profile field.
+ :param List[str] values: The console types for a bare metal server with
+ this profile.
"""
- self.mode = mode
+ self.type = type
+ self.values = values
@classmethod
- def from_dict(cls, _dict: Dict) -> 'BareMetalServerTrustedPlatformModulePrototype':
- """Initialize a BareMetalServerTrustedPlatformModulePrototype object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileConsoleTypes':
+ """Initialize a BareMetalServerProfileConsoleTypes object from a json dictionary."""
args = {}
- if 'mode' in _dict:
- args['mode'] = _dict.get('mode')
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
+ else:
+ raise ValueError('Required property \'type\' not present in BareMetalServerProfileConsoleTypes JSON')
+ if (values := _dict.get('values')) is not None:
+ args['values'] = values
+ else:
+ raise ValueError('Required property \'values\' not present in BareMetalServerProfileConsoleTypes JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a BareMetalServerTrustedPlatformModulePrototype object from a json dictionary."""
+ """Initialize a BareMetalServerProfileConsoleTypes object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'mode') and self.mode is not None:
- _dict['mode'] = self.mode
+ if hasattr(self, 'type') and self.type is not None:
+ _dict['type'] = self.type
+ if hasattr(self, 'values') and self.values is not None:
+ _dict['values'] = self.values
return _dict
def _to_dict(self):
@@ -30426,56 +32754,148 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this BareMetalServerTrustedPlatformModulePrototype object."""
+ """Return a `str` version of this BareMetalServerProfileConsoleTypes object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'BareMetalServerTrustedPlatformModulePrototype') -> bool:
+ def __eq__(self, other: 'BareMetalServerProfileConsoleTypes') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'BareMetalServerTrustedPlatformModulePrototype') -> bool:
+ def __ne__(self, other: 'BareMetalServerProfileConsoleTypes') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class ModeEnum(str, Enum):
+ class TypeEnum(str, Enum):
"""
- The trusted platform module mode to use. The specified value must be listed in the
- bare metal server profile's `supported_trusted_platform_module_modes`.
+ The type for this profile field.
"""
- DISABLED = 'disabled'
- TPM_2 = 'tpm_2'
+ ENUM = 'enum'
+
+
+ class ValuesEnum(str, Enum):
+ """
+ A console type.
+ """
+ SERIAL = 'serial'
+ VNC = 'vnc'
-class CatalogOfferingIdentity:
+
+class BareMetalServerProfileDisk:
"""
- Identifies a
- [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) offering
- by a unique property.
+ Disks provided by this profile.
+ :param BareMetalServerProfileDiskQuantity quantity:
+ :param BareMetalServerProfileDiskSize size:
+ :param BareMetalServerProfileDiskSupportedInterfaces supported_interface_types:
"""
def __init__(
self,
+ quantity: 'BareMetalServerProfileDiskQuantity',
+ size: 'BareMetalServerProfileDiskSize',
+ supported_interface_types: 'BareMetalServerProfileDiskSupportedInterfaces',
) -> None:
"""
- Initialize a CatalogOfferingIdentity object.
+ 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 := _dict.get('quantity')) is not None:
+ args['quantity'] = quantity
+ else:
+ raise ValueError('Required property \'quantity\' not present in BareMetalServerProfileDisk JSON')
+ if (size := _dict.get('size')) is not None:
+ args['size'] = size
+ else:
+ raise ValueError('Required property \'size\' not present in BareMetalServerProfileDisk JSON')
+ if (supported_interface_types := _dict.get('supported_interface_types')) is not None:
+ args['supported_interface_types'] = BareMetalServerProfileDiskSupportedInterfaces.from_dict(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:
+ if isinstance(self.supported_interface_types, dict):
+ _dict['supported_interface_types'] = self.supported_interface_types
+ else:
+ _dict['supported_interface_types'] = self.supported_interface_types.to_dict()
+ return _dict
+
+ def _to_dict(self):
+ """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(['CatalogOfferingIdentityCatalogOfferingByCRN'])
+ ", ".join(['BareMetalServerProfileDiskQuantityFixed', 'BareMetalServerProfileDiskQuantityRange', 'BareMetalServerProfileDiskQuantityEnum', 'BareMetalServerProfileDiskQuantityDependent'])
)
raise Exception(msg)
-class CatalogOfferingVersionIdentity:
+class BareMetalServerProfileDiskSize:
"""
- Identifies a version of a
- [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) offering
- by a unique property.
+ BareMetalServerProfileDiskSize.
"""
@@ -30483,57 +32903,89 @@ def __init__(
self,
) -> None:
"""
- Initialize a CatalogOfferingVersionIdentity object.
+ Initialize a BareMetalServerProfileDiskSize object.
"""
msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['CatalogOfferingVersionIdentityCatalogOfferingVersionByCRN'])
+ ", ".join(['BareMetalServerProfileDiskSizeFixed', 'BareMetalServerProfileDiskSizeRange', 'BareMetalServerProfileDiskSizeEnum', 'BareMetalServerProfileDiskSizeDependent'])
)
raise Exception(msg)
-class CatalogOfferingVersionReference:
+class BareMetalServerProfileDiskSupportedInterfaces:
"""
- CatalogOfferingVersionReference.
+ BareMetalServerProfileDiskSupportedInterfaces.
- :attr str crn: The CRN for this version of a
- [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user)
- offering.
+ :param str default: The disk interface used for attaching the disk.
+ - `fcp`: Attached using Fiber Channel Protocol
+ - `sata`: Attached using Serial Advanced Technology Attachment
+ - `nvme`: Attached using Non-Volatile Memory Express
+ The enumerated values for this property are expected to expand in the future.
+ When processing this property, check for and log unknown values. Optionally halt
+ processing and surface the error, or bypass the resource on which the unexpected
+ property value was encountered.
+ :param str type: The type for this profile field.
+ :param List[str] values: The supported disk interfaces used for attaching the
+ disk.
"""
def __init__(
self,
- crn: str,
+ default: str,
+ type: str,
+ values: List[str],
) -> None:
"""
- Initialize a CatalogOfferingVersionReference object.
+ Initialize a BareMetalServerProfileDiskSupportedInterfaces object.
- :param str crn: The CRN for this version of a
- [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user)
- offering.
+ :param str default: The disk interface used for attaching the disk.
+ - `fcp`: Attached using Fiber Channel Protocol
+ - `sata`: Attached using Serial Advanced Technology Attachment
+ - `nvme`: Attached using Non-Volatile Memory Express
+ The enumerated values for this property are expected to expand in the
+ future. When processing this property, check for and log unknown values.
+ Optionally halt processing and surface the error, or bypass the resource on
+ which the unexpected property value was encountered.
+ :param str type: The type for this profile field.
+ :param List[str] values: The supported disk interfaces used for attaching
+ the disk.
"""
- self.crn = crn
+ self.default = default
+ self.type = type
+ self.values = values
@classmethod
- def from_dict(cls, _dict: Dict) -> 'CatalogOfferingVersionReference':
- """Initialize a CatalogOfferingVersionReference object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileDiskSupportedInterfaces':
+ """Initialize a BareMetalServerProfileDiskSupportedInterfaces object from a json dictionary."""
args = {}
- if 'crn' in _dict:
- args['crn'] = _dict.get('crn')
+ if (default := _dict.get('default')) is not None:
+ args['default'] = default
else:
- raise ValueError('Required property \'crn\' not present in CatalogOfferingVersionReference JSON')
+ raise ValueError('Required property \'default\' not present in BareMetalServerProfileDiskSupportedInterfaces JSON')
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
+ else:
+ raise ValueError('Required property \'type\' not present in BareMetalServerProfileDiskSupportedInterfaces JSON')
+ if (values := _dict.get('values')) is not None:
+ args['values'] = values
+ else:
+ raise ValueError('Required property \'values\' not present in BareMetalServerProfileDiskSupportedInterfaces JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a CatalogOfferingVersionReference object from a json dictionary."""
+ """Initialize a BareMetalServerProfileDiskSupportedInterfaces object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'crn') and self.crn is not None:
- _dict['crn'] = self.crn
+ if hasattr(self, 'default') and self.default is not None:
+ _dict['default'] = self.default
+ if hasattr(self, 'type') and self.type is not None:
+ _dict['type'] = self.type
+ if hasattr(self, 'values') and self.values is not None:
+ _dict['values'] = self.values
return _dict
def _to_dict(self):
@@ -30541,23 +32993,65 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this CatalogOfferingVersionReference object."""
+ """Return a `str` version of this BareMetalServerProfileDiskSupportedInterfaces object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'CatalogOfferingVersionReference') -> bool:
+ def __eq__(self, other: 'BareMetalServerProfileDiskSupportedInterfaces') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'CatalogOfferingVersionReference') -> bool:
+ def __ne__(self, other: 'BareMetalServerProfileDiskSupportedInterfaces') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
+ class DefaultEnum(str, Enum):
+ """
+ The disk interface used for attaching the disk.
+ - `fcp`: Attached using Fiber Channel Protocol
+ - `sata`: Attached using Serial Advanced Technology Attachment
+ - `nvme`: Attached using Non-Volatile Memory Express
+ The enumerated values for this property are expected to expand in the future. When
+ processing this property, check for and log unknown values. Optionally halt
+ processing and surface the error, or bypass the resource on which the unexpected
+ property value was encountered.
+ """
-class CertificateInstanceIdentity:
+ FCP = 'fcp'
+ NVME = 'nvme'
+ SATA = 'sata'
+
+
+ class TypeEnum(str, Enum):
+ """
+ The type for this profile field.
+ """
+
+ ENUM = 'enum'
+
+
+ class ValuesEnum(str, Enum):
+ """
+ The disk interface used for attaching the disk.
+ - `fcp`: Attached using Fiber Channel Protocol
+ - `sata`: Attached using Serial Advanced Technology Attachment
+ - `nvme`: Attached using Non-Volatile Memory Express
+ The enumerated values for this property are expected to expand in the future. When
+ processing this property, check for and log unknown values. Optionally halt
+ processing and surface the error, or bypass the resource on which the unexpected
+ property value was encountered.
+ """
+
+ FCP = 'fcp'
+ NVME = 'nvme'
+ SATA = 'sata'
+
+
+
+class BareMetalServerProfileIdentity:
"""
- Identifies a certificate instance by a unique property.
+ Identifies a bare metal server profile by a unique property.
"""
@@ -30565,77 +33059,56 @@ def __init__(
self,
) -> None:
"""
- Initialize a CertificateInstanceIdentity object.
+ Initialize a BareMetalServerProfileIdentity object.
"""
msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['CertificateInstanceIdentityByCRN'])
+ ", ".join(['BareMetalServerProfileIdentityByName', 'BareMetalServerProfileIdentityByHref'])
)
raise Exception(msg)
-class CertificateInstanceReference:
+class BareMetalServerProfileMemory:
"""
- CertificateInstanceReference.
+ BareMetalServerProfileMemory.
- :attr str crn: The CRN for this certificate instance.
"""
def __init__(
self,
- crn: str,
) -> None:
"""
- Initialize a CertificateInstanceReference object.
+ Initialize a BareMetalServerProfileMemory 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)
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['BareMetalServerProfileMemoryFixed', 'BareMetalServerProfileMemoryRange', 'BareMetalServerProfileMemoryEnum', 'BareMetalServerProfileMemoryDependent'])
+ )
+ raise Exception(msg)
- 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()
+class BareMetalServerProfileNetworkAttachmentCount:
+ """
+ BareMetalServerProfileNetworkAttachmentCount.
- 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 __init__(
+ self,
+ ) -> None:
+ """
+ Initialize a BareMetalServerProfileNetworkAttachmentCount object.
- def __ne__(self, other: 'CertificateInstanceReference') -> 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(['BareMetalServerProfileNetworkAttachmentCountRange', 'BareMetalServerProfileNetworkAttachmentCountDependent'])
+ )
+ raise Exception(msg)
-class CloudObjectStorageBucketIdentity:
+class BareMetalServerProfileNetworkInterfaceCount:
"""
- Identifies a Cloud Object Storage bucket by a unique property.
+ BareMetalServerProfileNetworkInterfaceCount.
"""
@@ -30643,64 +33116,77 @@ def __init__(
self,
) -> None:
"""
- Initialize a CloudObjectStorageBucketIdentity object.
+ Initialize a BareMetalServerProfileNetworkInterfaceCount object.
"""
msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['CloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName', 'CloudObjectStorageBucketIdentityByCRN'])
+ ", ".join(['BareMetalServerProfileNetworkInterfaceCountRange', 'BareMetalServerProfileNetworkInterfaceCountDependent'])
)
raise Exception(msg)
-class CloudObjectStorageBucketReference:
+class BareMetalServerProfileOSArchitecture:
"""
- CloudObjectStorageBucketReference.
+ BareMetalServerProfileOSArchitecture.
- :attr str crn: The CRN of this Cloud Object Storage bucket.
- :attr str name: The globally unique name of this Cloud Object Storage bucket.
+ :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.
"""
def __init__(
self,
- crn: str,
- name: str,
+ default: str,
+ type: str,
+ values: List[str],
) -> None:
"""
- Initialize a CloudObjectStorageBucketReference object.
+ Initialize a BareMetalServerProfileOSArchitecture object.
- :param str crn: The CRN of this Cloud Object Storage bucket.
- :param str name: The globally unique name of this Cloud Object Storage
- bucket.
+ :param 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.crn = crn
- self.name = name
+ self.default = default
+ self.type = type
+ self.values = values
@classmethod
- def from_dict(cls, _dict: Dict) -> 'CloudObjectStorageBucketReference':
- """Initialize a CloudObjectStorageBucketReference object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileOSArchitecture':
+ """Initialize a BareMetalServerProfileOSArchitecture object from a json dictionary."""
args = {}
- if 'crn' in _dict:
- args['crn'] = _dict.get('crn')
+ if (default := _dict.get('default')) is not None:
+ args['default'] = default
else:
- raise ValueError('Required property \'crn\' not present in CloudObjectStorageBucketReference JSON')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
+ raise ValueError('Required property \'default\' not present in BareMetalServerProfileOSArchitecture JSON')
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
else:
- raise ValueError('Required property \'name\' not present in CloudObjectStorageBucketReference JSON')
+ raise ValueError('Required property \'type\' not present in BareMetalServerProfileOSArchitecture JSON')
+ if (values := _dict.get('values')) is not None:
+ args['values'] = values
+ else:
+ raise ValueError('Required property \'values\' not present in BareMetalServerProfileOSArchitecture JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a CloudObjectStorageBucketReference object from a json dictionary."""
+ """Initialize a BareMetalServerProfileOSArchitecture object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'crn') and self.crn is not None:
- _dict['crn'] = self.crn
- if hasattr(self, 'name') and self.name is not None:
- _dict['name'] = self.name
+ 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):
@@ -30708,60 +33194,86 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this CloudObjectStorageBucketReference object."""
+ """Return a `str` version of this BareMetalServerProfileOSArchitecture object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'CloudObjectStorageBucketReference') -> bool:
+ def __eq__(self, other: 'BareMetalServerProfileOSArchitecture') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'CloudObjectStorageBucketReference') -> bool:
+ def __ne__(self, other: 'BareMetalServerProfileOSArchitecture') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
+ class TypeEnum(str, Enum):
+ """
+ The type for this profile field.
+ """
-class CloudObjectStorageObjectReference:
+ ENUM = 'enum'
+
+
+
+class BareMetalServerProfileReference:
"""
- CloudObjectStorageObjectReference.
+ BareMetalServerProfileReference.
- :attr str name: The name of this Cloud Object Storage object. Names are unique
- within a Cloud Object Storage bucket.
+ :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.
"""
def __init__(
self,
+ href: str,
name: str,
+ resource_type: str,
) -> None:
"""
- Initialize a CloudObjectStorageObjectReference object.
+ Initialize a BareMetalServerProfileReference object.
- :param str name: The name of this Cloud Object Storage object. Names are
- unique within a Cloud Object Storage bucket.
+ :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) -> 'CloudObjectStorageObjectReference':
- """Initialize a CloudObjectStorageObjectReference object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileReference':
+ """Initialize a BareMetalServerProfileReference object from a json dictionary."""
args = {}
- if 'name' in _dict:
- args['name'] = _dict.get('name')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'name\' not present in CloudObjectStorageObjectReference JSON')
+ raise ValueError('Required property \'href\' not present in BareMetalServerProfileReference JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ else:
+ raise ValueError('Required property \'name\' not present in BareMetalServerProfileReference JSON')
+ if (resource_type := _dict.get('resource_type')) is not None:
+ args['resource_type'] = 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 CloudObjectStorageObjectReference object from a json dictionary."""
+ """Initialize a BareMetalServerProfileReference object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
+ if hasattr(self, '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):
@@ -30769,77 +33281,76 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this CloudObjectStorageObjectReference object."""
+ """Return a `str` version of this BareMetalServerProfileReference object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'CloudObjectStorageObjectReference') -> bool:
+ def __eq__(self, other: 'BareMetalServerProfileReference') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'CloudObjectStorageObjectReference') -> bool:
+ def __ne__(self, other: 'BareMetalServerProfileReference') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-
-class DNSInstanceIdentity:
- """
- Identifies a DNS instance by a unique property.
-
- """
-
- def __init__(
- self,
- ) -> None:
+ class ResourceTypeEnum(str, Enum):
"""
- Initialize a DNSInstanceIdentity object.
-
+ The resource type.
"""
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['DNSInstanceIdentityByCRN'])
- )
- raise Exception(msg)
+
+ BARE_METAL_SERVER_PROFILE = 'bare_metal_server_profile'
-class DNSInstanceReference:
+
+class BareMetalServerProfileSupportedTrustedPlatformModuleModes:
"""
- DNSInstanceReference.
+ The supported trusted platform module modes for this bare metal server profile.
- :attr str crn: The CRN for this DNS instance.
+ :param str type: The type for this profile field.
+ :param List[str] values: The supported trusted platform module modes.
"""
def __init__(
self,
- crn: str,
+ type: str,
+ values: List[str],
) -> None:
"""
- Initialize a DNSInstanceReference object.
+ Initialize a BareMetalServerProfileSupportedTrustedPlatformModuleModes object.
- :param str crn: The CRN for this DNS instance.
+ :param str type: The type for this profile field.
+ :param List[str] values: The supported trusted platform module modes.
"""
- self.crn = crn
+ self.type = type
+ self.values = values
@classmethod
- def from_dict(cls, _dict: Dict) -> 'DNSInstanceReference':
- """Initialize a DNSInstanceReference object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileSupportedTrustedPlatformModuleModes':
+ """Initialize a BareMetalServerProfileSupportedTrustedPlatformModuleModes object from a json dictionary."""
args = {}
- if 'crn' in _dict:
- args['crn'] = _dict.get('crn')
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
else:
- raise ValueError('Required property \'crn\' not present in DNSInstanceReference JSON')
+ raise ValueError('Required property \'type\' not present in BareMetalServerProfileSupportedTrustedPlatformModuleModes JSON')
+ if (values := _dict.get('values')) is not None:
+ args['values'] = values
+ else:
+ raise ValueError('Required property \'values\' not present in BareMetalServerProfileSupportedTrustedPlatformModuleModes JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a DNSInstanceReference object from a json dictionary."""
+ """Initialize a BareMetalServerProfileSupportedTrustedPlatformModuleModes object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'crn') and self.crn is not None:
- _dict['crn'] = self.crn
+ if hasattr(self, 'type') and self.type is not None:
+ _dict['type'] = self.type
+ if hasattr(self, 'values') and self.values is not None:
+ _dict['values'] = self.values
return _dict
def _to_dict(self):
@@ -30847,163 +33358,91 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this DNSInstanceReference object."""
+ """Return a `str` version of this BareMetalServerProfileSupportedTrustedPlatformModuleModes object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'DNSInstanceReference') -> bool:
+ def __eq__(self, other: 'BareMetalServerProfileSupportedTrustedPlatformModuleModes') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'DNSInstanceReference') -> bool:
+ 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.
+ """
-class DNSServer:
- """
- A DNS server.
+ ENUM = 'enum'
- :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 ZoneReference zone_affinity: (optional) If present, DHCP configuration for
- this zone will have this DNS server listed first.
- """
- def __init__(
- self,
- address: str,
- *,
- zone_affinity: 'ZoneReference' = None,
- ) -> None:
+ class ValuesEnum(str, Enum):
"""
- Initialize a DNSServer 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 ZoneReference zone_affinity: (optional) If present, DHCP
- configuration for this zone will have this DNS server listed first.
+ The trusted platform module (TPM) mode:
+ - `disabled`: No TPM functionality
+ - `tpm_2`: TPM 2.0
+ The enumerated values for this property are expected to expand in the future. When
+ processing this property, check for and log unknown values. Optionally halt
+ processing and surface the error, or bypass the resource on which the unexpected
+ property value was encountered.
"""
- self.address = address
- self.zone_affinity = zone_affinity
-
- @classmethod
- def from_dict(cls, _dict: Dict) -> 'DNSServer':
- """Initialize a DNSServer object from a json dictionary."""
- args = {}
- if 'address' in _dict:
- args['address'] = _dict.get('address')
- else:
- raise ValueError('Required property \'address\' not present in DNSServer JSON')
- if 'zone_affinity' in _dict:
- args['zone_affinity'] = ZoneReference.from_dict(_dict.get('zone_affinity'))
- return cls(**args)
-
- @classmethod
- def _from_dict(cls, _dict):
- """Initialize a DNSServer object from 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, 'zone_affinity') and self.zone_affinity is not None:
- if isinstance(self.zone_affinity, dict):
- _dict['zone_affinity'] = self.zone_affinity
- else:
- _dict['zone_affinity'] = self.zone_affinity.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 DNSServer object."""
- return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'DNSServer') -> bool:
- """Return `true` when self and other are equal, false otherwise."""
- if not isinstance(other, self.__class__):
- return False
- return self.__dict__ == other.__dict__
+ DISABLED = 'disabled'
+ TPM_2 = 'tpm_2'
- def __ne__(self, other: 'DNSServer') -> bool:
- """Return `true` when self and other are not equal, false otherwise."""
- return not self == other
-class DNSServerPrototype:
+class BareMetalServerProfileVirtualNetworkInterfacesSupported:
"""
- DNSServerPrototype.
+ Indicates whether this profile supports virtual network interfaces.
- :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 ZoneIdentity zone_affinity: (optional) DHCP configuration for the
- specified zone will have this DNS server listed first.
+ :param str type: The type for this profile field.
+ :param bool value: The value for this profile field.
"""
def __init__(
self,
- address: str,
- *,
- zone_affinity: 'ZoneIdentity' = None,
+ type: str,
+ value: bool,
) -> None:
"""
- Initialize a DNSServerPrototype object.
+ Initialize a BareMetalServerProfileVirtualNetworkInterfacesSupported 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 ZoneIdentity zone_affinity: (optional) DHCP configuration for the
- specified zone will have this DNS server listed first.
+ :param str type: The type for this profile field.
+ :param bool value: The value for this profile field.
"""
- self.address = address
- self.zone_affinity = zone_affinity
+ self.type = type
+ self.value = value
@classmethod
- def from_dict(cls, _dict: Dict) -> 'DNSServerPrototype':
- """Initialize a DNSServerPrototype object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileVirtualNetworkInterfacesSupported':
+ """Initialize a BareMetalServerProfileVirtualNetworkInterfacesSupported object from a json dictionary."""
args = {}
- if 'address' in _dict:
- args['address'] = _dict.get('address')
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
else:
- raise ValueError('Required property \'address\' not present in DNSServerPrototype JSON')
- if 'zone_affinity' in _dict:
- args['zone_affinity'] = _dict.get('zone_affinity')
+ raise ValueError('Required property \'type\' not present in BareMetalServerProfileVirtualNetworkInterfacesSupported JSON')
+ if (value := _dict.get('value')) is not None:
+ args['value'] = value
+ else:
+ raise ValueError('Required property \'value\' not present in BareMetalServerProfileVirtualNetworkInterfacesSupported JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a DNSServerPrototype object from a json dictionary."""
+ """Initialize a BareMetalServerProfileVirtualNetworkInterfacesSupported object from 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, 'zone_affinity') and self.zone_affinity is not None:
- if isinstance(self.zone_affinity, dict):
- _dict['zone_affinity'] = self.zone_affinity
- else:
- _dict['zone_affinity'] = self.zone_affinity.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):
@@ -31011,77 +33450,173 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this DNSServerPrototype object."""
+ """Return a `str` version of this BareMetalServerProfileVirtualNetworkInterfacesSupported object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'DNSServerPrototype') -> bool:
+ def __eq__(self, other: 'BareMetalServerProfileVirtualNetworkInterfacesSupported') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'DNSServerPrototype') -> bool:
+ def __ne__(self, other: 'BareMetalServerProfileVirtualNetworkInterfacesSupported') -> 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 DNSZoneIdentity:
+
+
+class BareMetalServerPrototype:
"""
- Identifies a DNS zone by a unique property.
+ BareMetalServerPrototype.
+ :param bool enable_secure_boot: (optional) Indicates whether secure boot is
+ enabled. If enabled, the image must support secure boot or the server will fail
+ to boot.
+ :param BareMetalServerInitializationPrototype initialization:
+ :param str name: (optional) The name for this bare metal server. The name must
+ not be used by another bare metal server in the region. If unspecified, the name
+ will be a hyphenated list of randomly-selected words.
+ The system hostname will be based on this name.
+ :param BareMetalServerProfileIdentity profile: The
+ [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-bare-metal-servers-profile)
+ to use for this 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) will be
+ used.
+ :param BareMetalServerTrustedPlatformModulePrototype trusted_platform_module:
+ (optional)
+ :param VPCIdentity vpc: (optional) The VPC this bare metal server will reside
+ in.
+ If specified, it must match the VPC for the subnets that the network attachments
+ or
+ network interfaces of the bare metal server are attached to.
+ :param ZoneIdentity zone: The zone this bare metal server will reside in.
"""
def __init__(
self,
+ initialization: 'BareMetalServerInitializationPrototype',
+ profile: 'BareMetalServerProfileIdentity',
+ zone: 'ZoneIdentity',
+ *,
+ enable_secure_boot: Optional[bool] = None,
+ name: Optional[str] = None,
+ resource_group: Optional['ResourceGroupIdentity'] = None,
+ trusted_platform_module: Optional['BareMetalServerTrustedPlatformModulePrototype'] = None,
+ vpc: Optional['VPCIdentity'] = None,
) -> None:
"""
- Initialize a DNSZoneIdentity object.
+ Initialize a BareMetalServerPrototype object.
+ :param BareMetalServerInitializationPrototype initialization:
+ :param BareMetalServerProfileIdentity profile: The
+ [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-bare-metal-servers-profile)
+ to use for this bare metal server.
+ :param ZoneIdentity zone: The zone this bare metal server will reside in.
+ :param bool enable_secure_boot: (optional) Indicates whether secure boot is
+ enabled. If enabled, the image must support secure boot or the server will
+ fail to boot.
+ :param str name: (optional) The name for this bare metal server. The name
+ must not be used by another bare metal server in the region. If
+ unspecified, the name will be a hyphenated list of randomly-selected words.
+ The system hostname will be based on this name.
+ :param 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) will be
+ used.
+ :param BareMetalServerTrustedPlatformModulePrototype
+ trusted_platform_module: (optional)
+ :param VPCIdentity vpc: (optional) The VPC this bare metal server will
+ reside in.
+ If specified, it must match the VPC for the subnets that the network
+ attachments or
+ network interfaces of the bare metal server are attached to.
"""
msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['DNSZoneIdentityById'])
+ ", ".join(['BareMetalServerPrototypeBareMetalServerByNetworkAttachment', 'BareMetalServerPrototypeBareMetalServerByNetworkInterface'])
)
raise Exception(msg)
-class DNSZoneReference:
+class BareMetalServerStatusReason:
"""
- DNSZoneReference.
+ BareMetalServerStatusReason.
- :attr str id:
+ :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.
"""
def __init__(
self,
- id: str,
+ code: str,
+ message: str,
+ *,
+ more_info: Optional[str] = None,
) -> None:
"""
- Initialize a DNSZoneReference object.
+ Initialize a BareMetalServerStatusReason object.
- :param str id:
+ :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.id = id
+ self.code = code
+ self.message = message
+ self.more_info = more_info
@classmethod
- def from_dict(cls, _dict: Dict) -> 'DNSZoneReference':
- """Initialize a DNSZoneReference object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'BareMetalServerStatusReason':
+ """Initialize a BareMetalServerStatusReason object from a json dictionary."""
args = {}
- if 'id' in _dict:
- args['id'] = _dict.get('id')
+ if (code := _dict.get('code')) is not None:
+ args['code'] = code
else:
- raise ValueError('Required property \'id\' not present in DNSZoneReference JSON')
+ raise ValueError('Required property \'code\' not present in BareMetalServerStatusReason JSON')
+ if (message := _dict.get('message')) is not None:
+ args['message'] = message
+ else:
+ raise ValueError('Required property \'message\' not present in BareMetalServerStatusReason JSON')
+ if (more_info := _dict.get('more_info')) is not None:
+ args['more_info'] = more_info
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a DNSZoneReference object from a json dictionary."""
+ """Initialize a BareMetalServerStatusReason object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'id') and self.id is not None:
- _dict['id'] = self.id
+ 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):
@@ -31089,348 +33624,109 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this DNSZoneReference object."""
+ """Return a `str` version of this BareMetalServerStatusReason object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'DNSZoneReference') -> bool:
+ def __eq__(self, other: 'BareMetalServerStatusReason') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'DNSZoneReference') -> bool:
+ def __ne__(self, other: 'BareMetalServerStatusReason') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
+ class CodeEnum(str, Enum):
+ """
+ The status reason code:
+ - `cannot_start`: Failed to start due to an internal error
+ - `cannot_start_capacity`: Insufficient capacity within the selected zone
+ - `cannot_start_compute`: An error occurred while allocating compute resources
+ - `cannot_start_ip_address`: An error occurred while allocating an IP address
+ - `cannot_start_network`: An error occurred while allocating network resources.
+ """
+
+ 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 DedicatedHost:
+
+class BareMetalServerTrustedPlatformModule:
"""
- DedicatedHost.
+ BareMetalServerTrustedPlatformModule.
- :attr int available_memory: The amount of memory in gibibytes that is currently
- available for instances.
- :attr VCPU available_vcpu: The available VCPU for the dedicated host.
- :attr datetime created_at: The date and time that the dedicated host was
- created.
- :attr str crn: The CRN for this dedicated host.
- :attr List[DedicatedHostDisk] disks: Collection of the dedicated host's disks.
- :attr DedicatedHostGroupReference group: The dedicated host group this dedicated
- host is in.
- :attr str href: The URL for this dedicated host.
- :attr str id: The unique identifier for this dedicated host.
- :attr bool instance_placement_enabled: If set to true, instances can be placed
- on this dedicated host.
- :attr List[InstanceReference] instances: The instances that are allocated to
- this dedicated host.
- :attr str lifecycle_state: The lifecycle state of the dedicated host.
- :attr int memory: The total amount of memory in gibibytes for this host.
- :attr str name: The name for this dedicated host. The name is unique across all
- dedicated hosts in the region.
- :attr DedicatedHostNUMA numa: The dedicated host NUMA configuration.
- :attr DedicatedHostProfileReference profile: The
- [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-dh-profiles) for this
- dedicated host.
- :attr bool provisionable: Indicates whether this dedicated host is available for
- instance creation.
- :attr ResourceGroupReference resource_group: The resource group for this
- dedicated host.
- :attr str resource_type: The resource type.
- :attr int socket_count: The total number of sockets for this host.
- :attr str state: The administrative state of the dedicated host.
+ :param bool enabled: Indicates whether the trusted platform module is enabled.
+ :param str mode: The trusted platform module (TPM) mode:
+ - `disabled`: No TPM functionality
+ - `tpm_2`: TPM 2.0
The enumerated values for this property are expected to expand in the future.
When processing this property, check for and log unknown values. Optionally halt
- processing and surface the error, or bypass the 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.
+ processing and surface the error, or bypass the resource on which the unexpected
+ property value was encountered.
+ :param List[str] supported_modes: The supported trusted platform module modes.
"""
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,
- numa: 'DedicatedHostNUMA',
- profile: 'DedicatedHostProfileReference',
- provisionable: bool,
- resource_group: 'ResourceGroupReference',
- resource_type: str,
- socket_count: int,
- state: str,
- supported_instance_profiles: List['InstanceProfileReference'],
- vcpu: 'VCPU',
- zone: 'ZoneReference',
+ enabled: bool,
+ mode: str,
+ supported_modes: List[str],
) -> None:
"""
- Initialize a DedicatedHost object.
+ Initialize a BareMetalServerTrustedPlatformModule 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 name for this dedicated host. The name is unique
- across all dedicated hosts in the region.
- :param DedicatedHostNUMA numa: The dedicated host NUMA configuration.
- :param DedicatedHostProfileReference profile: The
- [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-dh-profiles) for this
- dedicated host.
- :param bool provisionable: Indicates whether this dedicated host is
- available for instance creation.
- :param ResourceGroupReference resource_group: The resource group for this
- dedicated host.
- :param str resource_type: The resource type.
- :param int socket_count: The total number of sockets for this host.
- :param str state: The administrative state of the dedicated host.
+ :param bool enabled: Indicates whether the trusted platform module is
+ enabled.
+ :param str mode: The trusted platform module (TPM) mode:
+ - `disabled`: No TPM functionality
+ - `tpm_2`: TPM 2.0
The enumerated values for this property are expected to expand in the
future. When processing this property, check for and log unknown values.
- Optionally halt processing and surface the error, or bypass the 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.
+ Optionally halt processing and surface the error, or bypass the resource on
+ which the unexpected property value was encountered.
+ :param List[str] supported_modes: The supported trusted platform module
+ modes.
"""
- self.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.numa = numa
- self.profile = profile
- self.provisionable = provisionable
- self.resource_group = resource_group
- self.resource_type = resource_type
- self.socket_count = socket_count
- self.state = state
- self.supported_instance_profiles = supported_instance_profiles
- self.vcpu = vcpu
- self.zone = zone
+ self.enabled = enabled
+ self.mode = mode
+ self.supported_modes = supported_modes
@classmethod
- def from_dict(cls, _dict: Dict) -> 'DedicatedHost':
- """Initialize a DedicatedHost object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'BareMetalServerTrustedPlatformModule':
+ """Initialize a BareMetalServerTrustedPlatformModule 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(v) for v in _dict.get('disks')]
- else:
- raise ValueError('Required property \'disks\' not present in DedicatedHost JSON')
- if 'group' in _dict:
- args['group'] = DedicatedHostGroupReference.from_dict(_dict.get('group'))
- else:
- raise ValueError('Required property \'group\' not present in DedicatedHost JSON')
- if 'href' in _dict:
- args['href'] = _dict.get('href')
- else:
- raise ValueError('Required property \'href\' not present in 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(v) for v in _dict.get('instances')]
- else:
- raise ValueError('Required property \'instances\' not present in DedicatedHost JSON')
- if 'lifecycle_state' in _dict:
- args['lifecycle_state'] = _dict.get('lifecycle_state')
- else:
- raise ValueError('Required property \'lifecycle_state\' not present in DedicatedHost JSON')
- if 'memory' in _dict:
- args['memory'] = _dict.get('memory')
- else:
- raise ValueError('Required property \'memory\' not present in DedicatedHost JSON')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
- else:
- raise ValueError('Required property \'name\' not present in DedicatedHost JSON')
- if 'numa' in _dict:
- args['numa'] = DedicatedHostNUMA.from_dict(_dict.get('numa'))
- else:
- raise ValueError('Required property \'numa\' 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(v) for v in _dict.get('supported_instance_profiles')]
+ if (enabled := _dict.get('enabled')) is not None:
+ args['enabled'] = enabled
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 \'enabled\' not present in BareMetalServerTrustedPlatformModule JSON')
+ if (mode := _dict.get('mode')) is not None:
+ args['mode'] = mode
else:
- raise ValueError('Required property \'vcpu\' not present in DedicatedHost JSON')
- if 'zone' in _dict:
- args['zone'] = ZoneReference.from_dict(_dict.get('zone'))
+ raise ValueError('Required property \'mode\' not present in BareMetalServerTrustedPlatformModule JSON')
+ if (supported_modes := _dict.get('supported_modes')) is not None:
+ args['supported_modes'] = supported_modes
else:
- raise ValueError('Required property \'zone\' not present in DedicatedHost JSON')
+ raise ValueError('Required property \'supported_modes\' not present in BareMetalServerTrustedPlatformModule JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a DedicatedHost object from a json dictionary."""
+ """Initialize a BareMetalServerTrustedPlatformModule object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'available_memory') and self.available_memory is not None:
- _dict['available_memory'] = self.available_memory
- if hasattr(self, 'available_vcpu') and self.available_vcpu is not None:
- if isinstance(self.available_vcpu, dict):
- _dict['available_vcpu'] = self.available_vcpu
- else:
- _dict['available_vcpu'] = self.available_vcpu.to_dict()
- if hasattr(self, 'created_at') and self.created_at is not None:
- _dict['created_at'] = datetime_to_string(self.created_at)
- if hasattr(self, 'crn') and self.crn is not None:
- _dict['crn'] = self.crn
- if hasattr(self, 'disks') and self.disks is not None:
- disks_list = []
- for v in self.disks:
- if isinstance(v, dict):
- disks_list.append(v)
- else:
- disks_list.append(v.to_dict())
- _dict['disks'] = disks_list
- if hasattr(self, 'group') and self.group is not None:
- if isinstance(self.group, dict):
- _dict['group'] = self.group
- else:
- _dict['group'] = self.group.to_dict()
- if hasattr(self, 'href') and self.href is not None:
- _dict['href'] = self.href
- if hasattr(self, 'id') and self.id is not None:
- _dict['id'] = self.id
- if hasattr(self, 'instance_placement_enabled') and self.instance_placement_enabled is not None:
- _dict['instance_placement_enabled'] = self.instance_placement_enabled
- if hasattr(self, 'instances') and self.instances is not None:
- instances_list = []
- for v in self.instances:
- if isinstance(v, dict):
- instances_list.append(v)
- else:
- instances_list.append(v.to_dict())
- _dict['instances'] = instances_list
- if hasattr(self, 'lifecycle_state') and self.lifecycle_state is not None:
- _dict['lifecycle_state'] = self.lifecycle_state
- if hasattr(self, 'memory') and self.memory is not None:
- _dict['memory'] = self.memory
- if hasattr(self, 'name') and self.name is not None:
- _dict['name'] = self.name
- if hasattr(self, 'numa') and self.numa is not None:
- if isinstance(self.numa, dict):
- _dict['numa'] = self.numa
- else:
- _dict['numa'] = self.numa.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, 'provisionable') and self.provisionable is not None:
- _dict['provisionable'] = self.provisionable
- if hasattr(self, 'resource_group') and self.resource_group is not None:
- if isinstance(self.resource_group, dict):
- _dict['resource_group'] = self.resource_group
- else:
- _dict['resource_group'] = self.resource_group.to_dict()
- if hasattr(self, 'resource_type') and self.resource_type is not None:
- _dict['resource_type'] = self.resource_type
- if hasattr(self, 'socket_count') and self.socket_count is not None:
- _dict['socket_count'] = self.socket_count
- if hasattr(self, 'state') and self.state is not None:
- _dict['state'] = self.state
- if hasattr(self, 'supported_instance_profiles') and self.supported_instance_profiles is not None:
- supported_instance_profiles_list = []
- for v in self.supported_instance_profiles:
- if isinstance(v, dict):
- supported_instance_profiles_list.append(v)
- else:
- supported_instance_profiles_list.append(v.to_dict())
- _dict['supported_instance_profiles'] = supported_instance_profiles_list
- if hasattr(self, 'vcpu') and self.vcpu is not None:
- if isinstance(self.vcpu, dict):
- _dict['vcpu'] = self.vcpu
- else:
- _dict['vcpu'] = self.vcpu.to_dict()
- if hasattr(self, 'zone') and self.zone is not None:
- if isinstance(self.zone, dict):
- _dict['zone'] = self.zone
- else:
- _dict['zone'] = self.zone.to_dict()
+ if hasattr(self, 'enabled') and self.enabled is not None:
+ _dict['enabled'] = self.enabled
+ if hasattr(self, 'mode') and self.mode is not None:
+ _dict['mode'] = self.mode
+ if hasattr(self, 'supported_modes') and self.supported_modes is not None:
+ _dict['supported_modes'] = self.supported_modes
return _dict
def _to_dict(self):
@@ -31438,153 +33734,94 @@ 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 BareMetalServerTrustedPlatformModule object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'DedicatedHost') -> bool:
+ def __eq__(self, other: 'BareMetalServerTrustedPlatformModule') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'DedicatedHost') -> bool:
+ def __ne__(self, other: 'BareMetalServerTrustedPlatformModule') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class LifecycleStateEnum(str, Enum):
+ class ModeEnum(str, Enum):
"""
- The lifecycle state of the dedicated host.
+ The trusted platform module (TPM) mode:
+ - `disabled`: No TPM functionality
+ - `tpm_2`: TPM 2.0
+ The enumerated values for this property are expected to expand in the future. When
+ processing this property, check for and log unknown values. Optionally halt
+ processing and surface the error, or bypass the resource on which the unexpected
+ property value was encountered.
"""
- 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'
+ DISABLED = 'disabled'
+ TPM_2 = 'tpm_2'
- class StateEnum(str, Enum):
+ class SupportedModesEnum(str, Enum):
"""
- The administrative state of the dedicated host.
+ The trusted platform module (TPM) mode:
+ - `disabled`: No TPM functionality
+ - `tpm_2`: TPM 2.0
The enumerated values for this property are expected to expand in the future. When
processing this property, check for and log unknown values. Optionally halt
- processing and surface the error, or bypass the dedicated host on which the
- unexpected property value was encountered.
+ processing and surface the error, or bypass the resource on which the unexpected
+ property value was encountered.
"""
- AVAILABLE = 'available'
- DEGRADED = 'degraded'
- MIGRATING = 'migrating'
- UNAVAILABLE = 'unavailable'
+ DISABLED = 'disabled'
+ TPM_2 = 'tpm_2'
-class DedicatedHostCollection:
+class BareMetalServerTrustedPlatformModulePatch:
"""
- DedicatedHostCollection.
+ BareMetalServerTrustedPlatformModulePatch.
- :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.
+ :param str mode: (optional) The trusted platform module mode to use. The
+ specified value must be listed in the bare metal server's `supported_modes`.
+ For the trusted platform module mode to be changed, the bare metal server
+ `status` must be `stopped`.
"""
def __init__(
self,
- dedicated_hosts: List['DedicatedHost'],
- first: 'DedicatedHostCollectionFirst',
- limit: int,
- total_count: int,
*,
- next: 'DedicatedHostCollectionNext' = None,
+ mode: Optional[str] = None,
) -> None:
"""
- Initialize a DedicatedHostCollection object.
+ Initialize a BareMetalServerTrustedPlatformModulePatch 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.
+ :param str mode: (optional) The trusted platform module mode to use. The
+ specified value must be listed in the bare metal server's
+ `supported_modes`.
+ For the trusted platform module mode to be changed, the bare metal server
+ `status` must be `stopped`.
"""
- self.dedicated_hosts = dedicated_hosts
- self.first = first
- self.limit = limit
- self.next = next
- self.total_count = total_count
+ self.mode = mode
@classmethod
- def from_dict(cls, _dict: Dict) -> 'DedicatedHostCollection':
- """Initialize a DedicatedHostCollection object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'BareMetalServerTrustedPlatformModulePatch':
+ """Initialize a BareMetalServerTrustedPlatformModulePatch object from a json dictionary."""
args = {}
- if 'dedicated_hosts' in _dict:
- args['dedicated_hosts'] = [DedicatedHost.from_dict(v) for v in _dict.get('dedicated_hosts')]
- 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')
+ if (mode := _dict.get('mode')) is not None:
+ args['mode'] = mode
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a DedicatedHostCollection object from a json dictionary."""
+ """Initialize a BareMetalServerTrustedPlatformModulePatch object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'dedicated_hosts') and self.dedicated_hosts is not None:
- dedicated_hosts_list = []
- for v in self.dedicated_hosts:
- if isinstance(v, dict):
- dedicated_hosts_list.append(v)
- else:
- dedicated_hosts_list.append(v.to_dict())
- _dict['dedicated_hosts'] = dedicated_hosts_list
- if hasattr(self, 'first') and self.first is not None:
- if isinstance(self.first, dict):
- _dict['first'] = self.first
- else:
- _dict['first'] = self.first.to_dict()
- if hasattr(self, 'limit') and self.limit is not None:
- _dict['limit'] = self.limit
- if hasattr(self, 'next') and self.next is not None:
- if isinstance(self.next, dict):
- _dict['next'] = self.next
- else:
- _dict['next'] = self.next.to_dict()
- if hasattr(self, 'total_count') and self.total_count is not None:
- _dict['total_count'] = self.total_count
+ if hasattr(self, 'mode') and self.mode is not None:
+ _dict['mode'] = self.mode
return _dict
def _to_dict(self):
@@ -31592,58 +33829,73 @@ 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 BareMetalServerTrustedPlatformModulePatch object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'DedicatedHostCollection') -> bool:
+ def __eq__(self, other: 'BareMetalServerTrustedPlatformModulePatch') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'DedicatedHostCollection') -> bool:
+ def __ne__(self, other: 'BareMetalServerTrustedPlatformModulePatch') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
+ class ModeEnum(str, Enum):
+ """
+ The trusted platform module mode to use. The specified value must be listed in the
+ bare metal server's `supported_modes`.
+ For the trusted platform module mode to be changed, the bare metal server `status`
+ must be `stopped`.
+ """
+
+ DISABLED = 'disabled'
+ TPM_2 = 'tpm_2'
+
-class DedicatedHostCollectionFirst:
+
+class BareMetalServerTrustedPlatformModulePrototype:
"""
- A link to the first page of resources.
+ BareMetalServerTrustedPlatformModulePrototype.
- :attr str href: The URL for a page of resources.
+ :param str mode: (optional) The trusted platform module mode to use. The
+ specified value must be listed in the bare metal server profile's
+ `supported_trusted_platform_module_modes`.
"""
def __init__(
self,
- href: str,
+ *,
+ mode: Optional[str] = None,
) -> None:
"""
- Initialize a DedicatedHostCollectionFirst object.
+ Initialize a BareMetalServerTrustedPlatformModulePrototype object.
- :param str href: The URL for a page of resources.
+ :param str mode: (optional) The trusted platform module mode to use. The
+ specified value must be listed in the bare metal server profile's
+ `supported_trusted_platform_module_modes`.
"""
- self.href = href
+ self.mode = mode
@classmethod
- def from_dict(cls, _dict: Dict) -> 'DedicatedHostCollectionFirst':
- """Initialize a DedicatedHostCollectionFirst object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'BareMetalServerTrustedPlatformModulePrototype':
+ """Initialize a BareMetalServerTrustedPlatformModulePrototype 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')
+ if (mode := _dict.get('mode')) is not None:
+ args['mode'] = mode
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a DedicatedHostCollectionFirst object from a json dictionary."""
+ """Initialize a BareMetalServerTrustedPlatformModulePrototype object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'href') and self.href is not None:
- _dict['href'] = self.href
+ if hasattr(self, 'mode') and self.mode is not None:
+ _dict['mode'] = self.mode
return _dict
def _to_dict(self):
@@ -31651,59 +33903,114 @@ 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 BareMetalServerTrustedPlatformModulePrototype object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'DedicatedHostCollectionFirst') -> bool:
+ def __eq__(self, other: 'BareMetalServerTrustedPlatformModulePrototype') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'DedicatedHostCollectionFirst') -> bool:
+ def __ne__(self, other: 'BareMetalServerTrustedPlatformModulePrototype') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
+ class ModeEnum(str, Enum):
+ """
+ The trusted platform module mode to use. The specified value must be listed in the
+ bare metal server profile's `supported_trusted_platform_module_modes`.
+ """
+
+ DISABLED = 'disabled'
+ TPM_2 = 'tpm_2'
+
-class DedicatedHostCollectionNext:
+
+class CatalogOfferingIdentity:
"""
- A link to the next page of resources. This property is present for all pages except
- the last page.
+ Identifies a
+ [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) offering
+ by a unique property.
- :attr str href: The URL for a page of resources.
"""
def __init__(
self,
- href: str,
) -> None:
"""
- Initialize a DedicatedHostCollectionNext object.
+ Initialize a CatalogOfferingIdentity object.
- :param str href: The URL for a page of resources.
"""
- self.href = href
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['CatalogOfferingIdentityCatalogOfferingByCRN'])
+ )
+ raise Exception(msg)
+
+
+class CatalogOfferingVersionIdentity:
+ """
+ Identifies a version of a
+ [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) offering
+ by a unique property.
+
+ """
+
+ def __init__(
+ self,
+ ) -> None:
+ """
+ Initialize a CatalogOfferingVersionIdentity object.
+
+ """
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['CatalogOfferingVersionIdentityCatalogOfferingVersionByCRN'])
+ )
+ raise Exception(msg)
+
+
+class CatalogOfferingVersionReference:
+ """
+ CatalogOfferingVersionReference.
+
+ :param str crn: The CRN for this version of a
+ [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user)
+ offering.
+ """
+
+ def __init__(
+ self,
+ crn: str,
+ ) -> None:
+ """
+ Initialize a CatalogOfferingVersionReference object.
+
+ :param str crn: The CRN for this version of a
+ [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user)
+ offering.
+ """
+ self.crn = crn
@classmethod
- def from_dict(cls, _dict: Dict) -> 'DedicatedHostCollectionNext':
- """Initialize a DedicatedHostCollectionNext object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'CatalogOfferingVersionReference':
+ """Initialize a CatalogOfferingVersionReference object from a json dictionary."""
args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ if (crn := _dict.get('crn')) is not None:
+ args['crn'] = crn
else:
- raise ValueError('Required property \'href\' not present in DedicatedHostCollectionNext JSON')
+ raise ValueError('Required property \'crn\' not present in CatalogOfferingVersionReference JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a DedicatedHostCollectionNext object from a json dictionary."""
+ """Initialize a CatalogOfferingVersionReference object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'href') and self.href is not None:
- _dict['href'] = self.href
+ if hasattr(self, 'crn') and self.crn is not None:
+ _dict['crn'] = self.crn
return _dict
def _to_dict(self):
@@ -31711,193 +34018,77 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this DedicatedHostCollectionNext object."""
+ """Return a `str` version of this CatalogOfferingVersionReference object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'DedicatedHostCollectionNext') -> bool:
+ def __eq__(self, other: 'CatalogOfferingVersionReference') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'DedicatedHostCollectionNext') -> bool:
+ def __ne__(self, other: 'CatalogOfferingVersionReference') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class DedicatedHostDisk:
+class CertificateInstanceIdentity:
"""
- DedicatedHostDisk.
+ Identifies a certificate instance by a unique property.
- :attr int available: The remaining space left for instance placement in GB
- (gigabytes).
- :attr datetime created_at: The date and time that the disk was created.
- :attr str href: The URL for this disk.
- :attr str id: The unique identifier for this disk.
- :attr List[InstanceDiskReference] instance_disks: Instance disks that are on
- this dedicated host disk.
- :attr str interface_type: The disk interface used for attaching the disk
- The enumerated values for this property are expected to expand in the future.
- When processing this property, check for and log unknown values. Optionally halt
- processing and surface the error, or bypass the resource on which the unexpected
- property value was encountered.
- :attr str lifecycle_state: (optional) The lifecycle state of this dedicated host
- disk.
- :attr str name: The name for this dedicated host disk. The name is unique across
- all disks on the dedicated host.
- :attr bool provisionable: Indicates whether this dedicated host disk is
- available for instance disk creation.
- :attr str resource_type: The resource type.
- :attr int size: The size of the disk in GB (gigabytes).
- :attr List[str] supported_instance_interface_types: The instance disk interfaces
- supported for this dedicated host disk.
"""
def __init__(
self,
- 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.
+ Initialize a CertificateInstanceIdentity object.
- :param int available: The remaining space left for instance placement in GB
- (gigabytes).
- :param datetime created_at: The date and time that the disk was created.
- :param str href: The URL for this disk.
- :param str id: The unique identifier for this disk.
- :param List[InstanceDiskReference] instance_disks: Instance disks that are
- on this dedicated host disk.
- :param str interface_type: The disk interface used for attaching the disk
- The enumerated values for this property are expected to expand in the
- future. When processing this property, check for and log unknown values.
- Optionally halt processing and surface the error, or bypass the resource on
- which the unexpected property value was encountered.
- :param str name: The name for this dedicated host disk. The name is unique
- across all disks on the dedicated host.
- :param bool provisionable: Indicates whether this dedicated host disk is
- available for instance disk creation.
- :param str resource_type: The resource type.
- :param int size: The size of the disk in GB (gigabytes).
- :param List[str] supported_instance_interface_types: The instance disk
- interfaces supported for this dedicated host disk.
- :param str lifecycle_state: (optional) The lifecycle state of this
- dedicated host disk.
"""
- self.available = available
- self.created_at = created_at
- self.href = href
- self.id = id
- self.instance_disks = instance_disks
- self.interface_type = interface_type
- self.lifecycle_state = lifecycle_state
- self.name = name
- self.provisionable = provisionable
- self.resource_type = resource_type
- self.size = size
- self.supported_instance_interface_types = supported_instance_interface_types
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['CertificateInstanceIdentityByCRN'])
+ )
+ raise Exception(msg)
+
+
+class CertificateInstanceReference:
+ """
+ CertificateInstanceReference.
+
+ :param 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) -> 'DedicatedHostDisk':
- """Initialize a DedicatedHostDisk object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'CertificateInstanceReference':
+ """Initialize a CertificateInstanceReference 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')
+ if (crn := _dict.get('crn')) is not None:
+ args['crn'] = crn
else:
- raise ValueError('Required property \'id\' not present in DedicatedHostDisk JSON')
- if 'instance_disks' in _dict:
- args['instance_disks'] = [InstanceDiskReference.from_dict(v) for v in _dict.get('instance_disks')]
- else:
- raise ValueError('Required property \'instance_disks\' not present in DedicatedHostDisk JSON')
- if 'interface_type' in _dict:
- args['interface_type'] = _dict.get('interface_type')
- else:
- raise ValueError('Required property \'interface_type\' not present in DedicatedHostDisk JSON')
- if 'lifecycle_state' in _dict:
- args['lifecycle_state'] = _dict.get('lifecycle_state')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
- else:
- raise ValueError('Required property \'name\' not present in DedicatedHostDisk JSON')
- if 'provisionable' in _dict:
- args['provisionable'] = _dict.get('provisionable')
- else:
- raise ValueError('Required property \'provisionable\' not present in DedicatedHostDisk JSON')
- if 'resource_type' in _dict:
- args['resource_type'] = _dict.get('resource_type')
- else:
- raise ValueError('Required property \'resource_type\' not present in DedicatedHostDisk JSON')
- if 'size' in _dict:
- args['size'] = _dict.get('size')
- else:
- raise ValueError('Required property \'size\' not present in DedicatedHostDisk JSON')
- if 'supported_instance_interface_types' in _dict:
- args['supported_instance_interface_types'] = _dict.get('supported_instance_interface_types')
- else:
- raise ValueError('Required property \'supported_instance_interface_types\' not present in DedicatedHostDisk JSON')
+ raise ValueError('Required property \'crn\' not present in CertificateInstanceReference JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a DedicatedHostDisk object from a json dictionary."""
+ """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, 'available') and self.available is not None:
- _dict['available'] = self.available
- if hasattr(self, 'created_at') and self.created_at is not None:
- _dict['created_at'] = datetime_to_string(self.created_at)
- if hasattr(self, 'href') and self.href is not None:
- _dict['href'] = self.href
- if hasattr(self, 'id') and self.id is not None:
- _dict['id'] = self.id
- if hasattr(self, 'instance_disks') and self.instance_disks is not None:
- instance_disks_list = []
- for v in self.instance_disks:
- if isinstance(v, dict):
- instance_disks_list.append(v)
- else:
- instance_disks_list.append(v.to_dict())
- _dict['instance_disks'] = instance_disks_list
- if hasattr(self, 'interface_type') and self.interface_type is not None:
- _dict['interface_type'] = self.interface_type
- if hasattr(self, 'lifecycle_state') and self.lifecycle_state is not None:
- _dict['lifecycle_state'] = self.lifecycle_state
- if hasattr(self, 'name') and self.name is not None:
- _dict['name'] = self.name
- if hasattr(self, 'provisionable') and self.provisionable is not None:
- _dict['provisionable'] = self.provisionable
- if hasattr(self, 'resource_type') and self.resource_type is not None:
- _dict['resource_type'] = self.resource_type
- if hasattr(self, 'size') and self.size is not None:
- _dict['size'] = self.size
- if hasattr(self, 'supported_instance_interface_types') and self.supported_instance_interface_types is not None:
- _dict['supported_instance_interface_types'] = self.supported_instance_interface_types
+ if hasattr(self, 'crn') and self.crn is not None:
+ _dict['crn'] = self.crn
return _dict
def _to_dict(self):
@@ -31905,112 +34096,88 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this DedicatedHostDisk object."""
+ """Return a `str` version of this CertificateInstanceReference object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'DedicatedHostDisk') -> bool:
+ 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: 'DedicatedHostDisk') -> bool:
+ def __ne__(self, other: 'CertificateInstanceReference') -> 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 CloudObjectStorageBucketIdentity:
+ """
+ Identifies a Cloud Object Storage bucket by a unique property.
+ """
- class ResourceTypeEnum(str, Enum):
- """
- The resource type.
+ def __init__(
+ self,
+ ) -> None:
"""
+ Initialize a CloudObjectStorageBucketIdentity object.
- 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'
-
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['CloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName', 'CloudObjectStorageBucketIdentityByCRN'])
+ )
+ raise Exception(msg)
-class DedicatedHostDiskCollection:
+class CloudObjectStorageBucketReference:
"""
- DedicatedHostDiskCollection.
+ CloudObjectStorageBucketReference.
- :attr List[DedicatedHostDisk] disks: Collection of the dedicated host's disks.
+ :param str crn: The CRN of this Cloud Object Storage bucket.
+ :param str name: The globally unique name of this Cloud Object Storage bucket.
"""
def __init__(
self,
- disks: List['DedicatedHostDisk'],
+ crn: str,
+ name: str,
) -> None:
"""
- Initialize a DedicatedHostDiskCollection object.
+ Initialize a CloudObjectStorageBucketReference object.
- :param List[DedicatedHostDisk] disks: Collection of the dedicated host's
- disks.
+ :param str crn: The CRN of this Cloud Object Storage bucket.
+ :param str name: The globally unique name of this Cloud Object Storage
+ bucket.
"""
- self.disks = disks
+ self.crn = crn
+ self.name = name
@classmethod
- def from_dict(cls, _dict: Dict) -> 'DedicatedHostDiskCollection':
- """Initialize a DedicatedHostDiskCollection object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'CloudObjectStorageBucketReference':
+ """Initialize a CloudObjectStorageBucketReference object from a json dictionary."""
args = {}
- if 'disks' in _dict:
- args['disks'] = [DedicatedHostDisk.from_dict(v) for v in _dict.get('disks')]
+ if (crn := _dict.get('crn')) is not None:
+ args['crn'] = crn
else:
- raise ValueError('Required property \'disks\' not present in DedicatedHostDiskCollection JSON')
+ raise ValueError('Required property \'crn\' not present in CloudObjectStorageBucketReference JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ else:
+ raise ValueError('Required property \'name\' not present in CloudObjectStorageBucketReference JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a DedicatedHostDiskCollection object from a json dictionary."""
+ """Initialize a CloudObjectStorageBucketReference object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'disks') and self.disks is not None:
- disks_list = []
- for v in self.disks:
- if isinstance(v, dict):
- disks_list.append(v)
- else:
- disks_list.append(v.to_dict())
- _dict['disks'] = disks_list
+ if hasattr(self, 'crn') and self.crn is not None:
+ _dict['crn'] = self.crn
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
return _dict
def _to_dict(self):
@@ -32018,52 +34185,53 @@ 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 CloudObjectStorageBucketReference object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'DedicatedHostDiskCollection') -> bool:
+ def __eq__(self, other: 'CloudObjectStorageBucketReference') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'DedicatedHostDiskCollection') -> bool:
+ def __ne__(self, other: 'CloudObjectStorageBucketReference') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class DedicatedHostDiskPatch:
+class CloudObjectStorageObjectReference:
"""
- DedicatedHostDiskPatch.
+ CloudObjectStorageObjectReference.
- :attr str name: (optional) The name for this dedicated host disk. The name must
- not be used by another disk on the dedicated host.
+ :param str name: The name of this Cloud Object Storage object. Names are unique
+ within a Cloud Object Storage bucket.
"""
def __init__(
self,
- *,
- name: str = None,
+ name: str,
) -> None:
"""
- Initialize a DedicatedHostDiskPatch object.
+ Initialize a CloudObjectStorageObjectReference object.
- :param str name: (optional) The name for this dedicated host disk. The name
- must not be used by another disk on the dedicated host.
+ :param str name: The name of this Cloud Object Storage object. Names are
+ unique within a Cloud Object Storage bucket.
"""
self.name = name
@classmethod
- def from_dict(cls, _dict: Dict) -> 'DedicatedHostDiskPatch':
- """Initialize a DedicatedHostDiskPatch object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'CloudObjectStorageObjectReference':
+ """Initialize a CloudObjectStorageObjectReference object from a json dictionary."""
args = {}
- if 'name' in _dict:
- args['name'] = _dict.get('name')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ else:
+ raise ValueError('Required property \'name\' not present in CloudObjectStorageObjectReference JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a DedicatedHostDiskPatch object from a json dictionary."""
+ """Initialize a CloudObjectStorageObjectReference object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -32078,335 +34246,77 @@ 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 CloudObjectStorageObjectReference object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'DedicatedHostDiskPatch') -> bool:
+ def __eq__(self, other: 'CloudObjectStorageObjectReference') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'DedicatedHostDiskPatch') -> bool:
+ def __ne__(self, other: 'CloudObjectStorageObjectReference') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class DedicatedHostGroup:
+class DNSInstanceIdentity:
"""
- DedicatedHostGroup.
+ Identifies a DNS instance by a unique property.
- :attr str class_: The dedicated host profile class for hosts in this group.
- :attr datetime created_at: The date and time that the dedicated host group was
- created.
- :attr str crn: The CRN for this dedicated host group.
- :attr List[DedicatedHostReference] dedicated_hosts: The dedicated hosts that are
- in this dedicated host group.
- :attr str family: The dedicated host profile family for hosts in this group.
- :attr str href: The URL for this dedicated host group.
- :attr str id: The unique identifier for this dedicated host group.
- :attr str name: The name for this dedicated host group. The name is unique
- across all dedicated host groups in the region.
- :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 name for this dedicated host group. The name is unique
- across all dedicated host groups in the region.
- :param ResourceGroupReference resource_group: The resource group for this
- dedicated host group.
- :param str resource_type: The resource type.
- :param List[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(v) for v in _dict.get('dedicated_hosts')]
- else:
- raise ValueError('Required property \'dedicated_hosts\' not present in DedicatedHostGroup JSON')
- if 'family' in _dict:
- args['family'] = _dict.get('family')
- else:
- raise ValueError('Required property \'family\' not present in DedicatedHostGroup JSON')
- if 'href' in _dict:
- args['href'] = _dict.get('href')
- else:
- raise ValueError('Required property \'href\' not present in DedicatedHostGroup JSON')
- if 'id' in _dict:
- args['id'] = _dict.get('id')
- else:
- raise ValueError('Required property \'id\' not present in DedicatedHostGroup JSON')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
- else:
- raise ValueError('Required property \'name\' not present in DedicatedHostGroup JSON')
- if 'resource_group' in _dict:
- args['resource_group'] = ResourceGroupReference.from_dict(_dict.get('resource_group'))
- else:
- raise ValueError('Required property \'resource_group\' not present in DedicatedHostGroup JSON')
- if 'resource_type' in _dict:
- args['resource_type'] = _dict.get('resource_type')
- else:
- raise ValueError('Required property \'resource_type\' not present in DedicatedHostGroup JSON')
- if 'supported_instance_profiles' in _dict:
- args['supported_instance_profiles'] = [InstanceProfileReference.from_dict(v) for v in _dict.get('supported_instance_profiles')]
- else:
- raise ValueError('Required property \'supported_instance_profiles\' not present in DedicatedHostGroup JSON')
- if 'zone' in _dict:
- args['zone'] = ZoneReference.from_dict(_dict.get('zone'))
- else:
- raise ValueError('Required property \'zone\' not present in DedicatedHostGroup JSON')
- return cls(**args)
-
- @classmethod
- def _from_dict(cls, _dict):
- """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:
- dedicated_hosts_list = []
- for v in self.dedicated_hosts:
- if isinstance(v, dict):
- dedicated_hosts_list.append(v)
- else:
- dedicated_hosts_list.append(v.to_dict())
- _dict['dedicated_hosts'] = dedicated_hosts_list
- if hasattr(self, 'family') and self.family is not None:
- _dict['family'] = self.family
- if hasattr(self, 'href') and self.href is not None:
- _dict['href'] = self.href
- if hasattr(self, 'id') and self.id is not None:
- _dict['id'] = self.id
- if hasattr(self, 'name') and self.name is not None:
- _dict['name'] = self.name
- if hasattr(self, 'resource_group') and self.resource_group is not None:
- if isinstance(self.resource_group, dict):
- _dict['resource_group'] = self.resource_group
- else:
- _dict['resource_group'] = self.resource_group.to_dict()
- if hasattr(self, 'resource_type') and self.resource_type is not None:
- _dict['resource_type'] = self.resource_type
- if hasattr(self, 'supported_instance_profiles') and self.supported_instance_profiles is not None:
- supported_instance_profiles_list = []
- for v in self.supported_instance_profiles:
- if isinstance(v, dict):
- supported_instance_profiles_list.append(v)
- else:
- supported_instance_profiles_list.append(v.to_dict())
- _dict['supported_instance_profiles'] = supported_instance_profiles_list
- if hasattr(self, 'zone') and self.zone is not None:
- if isinstance(self.zone, dict):
- _dict['zone'] = self.zone
- else:
- _dict['zone'] = self.zone.to_dict()
- return _dict
-
- def _to_dict(self):
- """Return a json dictionary representing this model."""
- return self.to_dict()
-
- 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'
-
+ Initialize a DNSInstanceIdentity object.
- class ResourceTypeEnum(str, Enum):
"""
- The resource type.
- """
-
- DEDICATED_HOST_GROUP = 'dedicated_host_group'
-
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['DNSInstanceIdentityByCRN'])
+ )
+ raise Exception(msg)
-class DedicatedHostGroupCollection:
+class DNSInstanceReference:
"""
- DedicatedHostGroupCollection.
+ DNSInstanceReference.
- :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.
+ :param str crn: The CRN for this DNS instance.
"""
def __init__(
self,
- first: 'DedicatedHostGroupCollectionFirst',
- groups: List['DedicatedHostGroup'],
- limit: int,
- total_count: int,
- *,
- next: 'DedicatedHostGroupCollectionNext' = None,
+ crn: str,
) -> None:
"""
- Initialize a DedicatedHostGroupCollection object.
+ Initialize a DNSInstanceReference 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 crn: The CRN for this DNS instance.
"""
- self.first = first
- self.groups = groups
- self.limit = limit
- self.next = next
- self.total_count = total_count
+ self.crn = crn
@classmethod
- def from_dict(cls, _dict: Dict) -> 'DedicatedHostGroupCollection':
- """Initialize a DedicatedHostGroupCollection object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'DNSInstanceReference':
+ """Initialize a DNSInstanceReference 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(v) for v 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 (crn := _dict.get('crn')) is not None:
+ args['crn'] = crn
else:
- raise ValueError('Required property \'total_count\' not present in DedicatedHostGroupCollection JSON')
+ raise ValueError('Required property \'crn\' not present in DNSInstanceReference JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a DedicatedHostGroupCollection object from a json dictionary."""
+ """Initialize a DNSInstanceReference object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'first') and self.first is not None:
- if isinstance(self.first, dict):
- _dict['first'] = self.first
- else:
- _dict['first'] = self.first.to_dict()
- if hasattr(self, 'groups') and self.groups is not None:
- groups_list = []
- for v in self.groups:
- if isinstance(v, dict):
- groups_list.append(v)
- else:
- groups_list.append(v.to_dict())
- _dict['groups'] = groups_list
- if hasattr(self, 'limit') and self.limit is not None:
- _dict['limit'] = self.limit
- if hasattr(self, 'next') and self.next is not None:
- if isinstance(self.next, dict):
- _dict['next'] = self.next
- else:
- _dict['next'] = self.next.to_dict()
- if hasattr(self, 'total_count') and self.total_count is not None:
- _dict['total_count'] = self.total_count
+ if hasattr(self, 'crn') and self.crn is not None:
+ _dict['crn'] = self.crn
return _dict
def _to_dict(self):
@@ -32414,58 +34324,81 @@ 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 DNSInstanceReference object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'DedicatedHostGroupCollection') -> bool:
+ def __eq__(self, other: 'DNSInstanceReference') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'DedicatedHostGroupCollection') -> bool:
+ def __ne__(self, other: 'DNSInstanceReference') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class DedicatedHostGroupCollectionFirst:
+class DNSServer:
"""
- A link to the first page of resources.
+ A DNS server.
- :attr str href: The URL for a page of resources.
+ :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 ZoneReference zone_affinity: (optional) If present, DHCP configuration
+ for this zone will have this DNS server listed first.
"""
def __init__(
self,
- href: str,
+ address: str,
+ *,
+ zone_affinity: Optional['ZoneReference'] = None,
) -> None:
"""
- Initialize a DedicatedHostGroupCollectionFirst object.
+ Initialize a DNSServer object.
- :param str href: The URL for a page of resources.
+ :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 ZoneReference zone_affinity: (optional) If present, DHCP
+ configuration for this zone will have this DNS server listed first.
"""
- self.href = href
+ self.address = address
+ self.zone_affinity = zone_affinity
@classmethod
- def from_dict(cls, _dict: Dict) -> 'DedicatedHostGroupCollectionFirst':
- """Initialize a DedicatedHostGroupCollectionFirst object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'DNSServer':
+ """Initialize a DNSServer object from a json dictionary."""
args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ if (address := _dict.get('address')) is not None:
+ args['address'] = address
else:
- raise ValueError('Required property \'href\' not present in DedicatedHostGroupCollectionFirst JSON')
+ raise ValueError('Required property \'address\' not present in DNSServer JSON')
+ if (zone_affinity := _dict.get('zone_affinity')) is not None:
+ args['zone_affinity'] = ZoneReference.from_dict(zone_affinity)
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a DedicatedHostGroupCollectionFirst object from a json dictionary."""
+ """Initialize a DNSServer object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'href') and self.href is not None:
- _dict['href'] = self.href
+ if hasattr(self, 'address') and self.address is not None:
+ _dict['address'] = self.address
+ if hasattr(self, 'zone_affinity') and self.zone_affinity is not None:
+ if isinstance(self.zone_affinity, dict):
+ _dict['zone_affinity'] = self.zone_affinity
+ else:
+ _dict['zone_affinity'] = self.zone_affinity.to_dict()
return _dict
def _to_dict(self):
@@ -32473,59 +34406,81 @@ 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 DNSServer object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'DedicatedHostGroupCollectionFirst') -> bool:
+ def __eq__(self, other: 'DNSServer') -> bool:
"""Return `true` when 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: 'DNSServer') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class DedicatedHostGroupCollectionNext:
+class DNSServerPrototype:
"""
- A link to the next page of resources. This property is present for all pages except
- the last page.
+ DNSServerPrototype.
- :attr str href: The URL for a page of resources.
+ :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 ZoneIdentity zone_affinity: (optional) DHCP configuration for the
+ specified zone will have this DNS server listed first.
"""
def __init__(
self,
- href: str,
+ address: str,
+ *,
+ zone_affinity: Optional['ZoneIdentity'] = None,
) -> None:
"""
- Initialize a DedicatedHostGroupCollectionNext object.
+ Initialize a DNSServerPrototype object.
- :param str href: The URL for a page of resources.
+ :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 ZoneIdentity zone_affinity: (optional) DHCP configuration for the
+ specified zone will have this DNS server listed first.
"""
- self.href = href
+ self.address = address
+ self.zone_affinity = zone_affinity
@classmethod
- def from_dict(cls, _dict: Dict) -> 'DedicatedHostGroupCollectionNext':
- """Initialize a DedicatedHostGroupCollectionNext object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'DNSServerPrototype':
+ """Initialize a DNSServerPrototype object from a json dictionary."""
args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ if (address := _dict.get('address')) is not None:
+ args['address'] = address
else:
- raise ValueError('Required property \'href\' not present in DedicatedHostGroupCollectionNext JSON')
+ raise ValueError('Required property \'address\' not present in DNSServerPrototype JSON')
+ if (zone_affinity := _dict.get('zone_affinity')) is not None:
+ args['zone_affinity'] = zone_affinity
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a DedicatedHostGroupCollectionNext object from a json dictionary."""
+ """Initialize a DNSServerPrototype object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'href') and self.href is not None:
- _dict['href'] = self.href
+ if hasattr(self, 'address') and self.address is not None:
+ _dict['address'] = self.address
+ if hasattr(self, 'zone_affinity') and self.zone_affinity is not None:
+ if isinstance(self.zone_affinity, dict):
+ _dict['zone_affinity'] = self.zone_affinity
+ else:
+ _dict['zone_affinity'] = self.zone_affinity.to_dict()
return _dict
def _to_dict(self):
@@ -32533,23 +34488,23 @@ 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 DNSServerPrototype object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'DedicatedHostGroupCollectionNext') -> bool:
+ def __eq__(self, other: 'DNSServerPrototype') -> bool:
"""Return `true` when 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: 'DNSServerPrototype') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class DedicatedHostGroupIdentity:
+class DNSZoneIdentity:
"""
- Identifies a dedicated host group by a unique property.
+ Identifies a DNS zone by a unique property.
"""
@@ -32557,54 +34512,53 @@ def __init__(
self,
) -> None:
"""
- Initialize a DedicatedHostGroupIdentity object.
+ Initialize a DNSZoneIdentity object.
"""
msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['DedicatedHostGroupIdentityById', 'DedicatedHostGroupIdentityByCRN', 'DedicatedHostGroupIdentityByHref'])
+ ", ".join(['DNSZoneIdentityById'])
)
raise Exception(msg)
-class DedicatedHostGroupPatch:
+class DNSZoneReference:
"""
- DedicatedHostGroupPatch.
+ DNSZoneReference.
- :attr str name: (optional) The name for this dedicated host group. The name must
- not be used by another dedicated host group in the region.
+ :param str id:
"""
def __init__(
self,
- *,
- name: str = None,
+ id: str,
) -> None:
"""
- Initialize a DedicatedHostGroupPatch object.
+ Initialize a DNSZoneReference object.
- :param str name: (optional) The name for this dedicated host group. The
- name must not be used by another dedicated host group in the region.
+ :param str id:
"""
- self.name = name
+ self.id = id
@classmethod
- def from_dict(cls, _dict: Dict) -> 'DedicatedHostGroupPatch':
- """Initialize a DedicatedHostGroupPatch object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'DNSZoneReference':
+ """Initialize a DNSZoneReference object from a json dictionary."""
args = {}
- if 'name' in _dict:
- args['name'] = _dict.get('name')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
+ else:
+ raise ValueError('Required property \'id\' not present in DNSZoneReference JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a DedicatedHostGroupPatch object from a json dictionary."""
+ """Initialize a DNSZoneReference object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'name') and self.name is not None:
- _dict['name'] = self.name
+ if hasattr(self, 'id') and self.id is not None:
+ _dict['id'] = self.id
return _dict
def _to_dict(self):
@@ -32612,74 +34566,348 @@ 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 DNSZoneReference object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'DedicatedHostGroupPatch') -> bool:
+ def __eq__(self, other: 'DNSZoneReference') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'DedicatedHostGroupPatch') -> bool:
+ def __ne__(self, other: 'DNSZoneReference') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class DedicatedHostGroupPrototypeDedicatedHostByZoneContext:
+class DedicatedHost:
"""
- DedicatedHostGroupPrototypeDedicatedHostByZoneContext.
+ DedicatedHost.
- :attr str name: (optional) The name for this dedicated host group. The name must
- not be used by another dedicated host group in the region. If unspecified, the
- name will be a hyphenated list of randomly-selected words.
- :attr ResourceGroupIdentity resource_group: (optional) The resource group to
- use. If unspecified, the host's resource group is used.
+ :param int available_memory: The amount of memory in gibibytes that is currently
+ available for instances.
+ :param VCPU available_vcpu: The available VCPU for the dedicated host.
+ :param datetime created_at: The date and time that the dedicated host was
+ created.
+ :param str crn: The CRN for this dedicated host.
+ :param List[DedicatedHostDisk] disks: Collection of the dedicated host's disks.
+ :param DedicatedHostGroupReference group: The dedicated host group this
+ dedicated host is in.
+ :param str href: The URL for this dedicated host.
+ :param str id: The unique identifier for this dedicated host.
+ :param bool instance_placement_enabled: If set to true, instances can be placed
+ on this dedicated host.
+ :param List[InstanceReference] instances: The instances that are allocated to
+ this dedicated host.
+ :param str lifecycle_state: The lifecycle state of the dedicated host.
+ :param int memory: The total amount of memory in gibibytes for this host.
+ :param str name: The name for this dedicated host. The name is unique across all
+ dedicated hosts in the region.
+ :param DedicatedHostNUMA numa: The dedicated host NUMA configuration.
+ :param DedicatedHostProfileReference profile: The
+ [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-dh-profiles) for this
+ dedicated host.
+ :param bool provisionable: Indicates whether this dedicated host is available
+ for instance creation.
+ :param ResourceGroupReference resource_group: The resource group for this
+ dedicated host.
+ :param str resource_type: The resource type.
+ :param int socket_count: The total number of sockets for this host.
+ :param str state: The administrative state of the dedicated host.
+ The enumerated values for this property are expected to expand in the future.
+ When processing this property, check for and log unknown values. Optionally halt
+ processing and surface the error, or bypass the dedicated host on which the
+ unexpected property value was encountered.
+ :param List[InstanceProfileReference] supported_instance_profiles: The instance
+ profiles usable by instances placed on this dedicated host.
+ :param VCPU vcpu: The total VCPU of the dedicated host.
+ :param ZoneReference zone: The zone this dedicated host resides in.
"""
def __init__(
self,
- *,
- name: str = None,
- resource_group: 'ResourceGroupIdentity' = None,
+ 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,
+ numa: 'DedicatedHostNUMA',
+ 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 DedicatedHostGroupPrototypeDedicatedHostByZoneContext object.
+ Initialize a DedicatedHost object.
- :param str name: (optional) The name for this dedicated host group. The
- name must not be used by another dedicated host group in the region. If
- unspecified, the name will be a hyphenated list of randomly-selected words.
- :param ResourceGroupIdentity resource_group: (optional) The resource group
- to use. If unspecified, the host's resource group is used.
+ :param int available_memory: The amount of memory in gibibytes that is
+ currently available for instances.
+ :param VCPU available_vcpu: The available VCPU for the dedicated host.
+ :param datetime created_at: The date and time that the dedicated host was
+ created.
+ :param str crn: The CRN for this dedicated host.
+ :param List[DedicatedHostDisk] disks: Collection of the dedicated host's
+ disks.
+ :param DedicatedHostGroupReference group: The dedicated host group this
+ dedicated host is in.
+ :param str href: The URL for this dedicated host.
+ :param str id: The unique identifier for this dedicated host.
+ :param bool instance_placement_enabled: If set to true, instances can be
+ placed on this dedicated host.
+ :param List[InstanceReference] instances: The instances that are allocated
+ to this dedicated host.
+ :param str lifecycle_state: The lifecycle state of the dedicated host.
+ :param int memory: The total amount of memory in gibibytes for this host.
+ :param str name: The name for this dedicated host. The name is unique
+ across all dedicated hosts in the region.
+ :param DedicatedHostNUMA numa: The dedicated host NUMA configuration.
+ :param DedicatedHostProfileReference profile: The
+ [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-dh-profiles) for this
+ dedicated host.
+ :param bool provisionable: Indicates whether this dedicated host is
+ available for instance creation.
+ :param ResourceGroupReference resource_group: The resource group for this
+ dedicated host.
+ :param str resource_type: The resource type.
+ :param int socket_count: The total number of sockets for this host.
+ :param str state: The administrative state of the dedicated host.
+ The enumerated values for this property are expected to expand in the
+ future. When processing this property, check for and log unknown values.
+ Optionally halt processing and surface the error, or bypass the dedicated
+ host on which the unexpected property value was encountered.
+ :param List[InstanceProfileReference] supported_instance_profiles: The
+ instance profiles usable by instances placed on this dedicated host.
+ :param VCPU vcpu: The total VCPU of the dedicated host.
+ :param ZoneReference zone: The zone this dedicated host resides in.
"""
+ 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.numa = numa
+ 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) -> 'DedicatedHostGroupPrototypeDedicatedHostByZoneContext':
- """Initialize a DedicatedHostGroupPrototypeDedicatedHostByZoneContext object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'DedicatedHost':
+ """Initialize a DedicatedHost 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)
+ if (available_memory := _dict.get('available_memory')) is not None:
+ args['available_memory'] = available_memory
+ else:
+ raise ValueError('Required property \'available_memory\' not present in DedicatedHost JSON')
+ if (available_vcpu := _dict.get('available_vcpu')) is not None:
+ args['available_vcpu'] = VCPU.from_dict(available_vcpu)
+ else:
+ raise ValueError('Required property \'available_vcpu\' not present in DedicatedHost JSON')
+ if (created_at := _dict.get('created_at')) is not None:
+ args['created_at'] = string_to_datetime(created_at)
+ else:
+ raise ValueError('Required property \'created_at\' not present in DedicatedHost JSON')
+ if (crn := _dict.get('crn')) is not None:
+ args['crn'] = crn
+ else:
+ raise ValueError('Required property \'crn\' not present in DedicatedHost JSON')
+ if (disks := _dict.get('disks')) is not None:
+ args['disks'] = [DedicatedHostDisk.from_dict(v) for v in disks]
+ else:
+ raise ValueError('Required property \'disks\' not present in DedicatedHost JSON')
+ if (group := _dict.get('group')) is not None:
+ args['group'] = DedicatedHostGroupReference.from_dict(group)
+ else:
+ raise ValueError('Required property \'group\' not present in DedicatedHost JSON')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
+ else:
+ raise ValueError('Required property \'href\' not present in DedicatedHost JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
+ else:
+ raise ValueError('Required property \'id\' not present in DedicatedHost JSON')
+ if (instance_placement_enabled := _dict.get('instance_placement_enabled')) is not None:
+ args['instance_placement_enabled'] = instance_placement_enabled
+ else:
+ raise ValueError('Required property \'instance_placement_enabled\' not present in DedicatedHost JSON')
+ if (instances := _dict.get('instances')) is not None:
+ args['instances'] = [InstanceReference.from_dict(v) for v in instances]
+ else:
+ raise ValueError('Required property \'instances\' not present in DedicatedHost JSON')
+ if (lifecycle_state := _dict.get('lifecycle_state')) is not None:
+ args['lifecycle_state'] = lifecycle_state
+ else:
+ raise ValueError('Required property \'lifecycle_state\' not present in DedicatedHost JSON')
+ if (memory := _dict.get('memory')) is not None:
+ args['memory'] = memory
+ else:
+ raise ValueError('Required property \'memory\' not present in DedicatedHost JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ else:
+ raise ValueError('Required property \'name\' not present in DedicatedHost JSON')
+ if (numa := _dict.get('numa')) is not None:
+ args['numa'] = DedicatedHostNUMA.from_dict(numa)
+ else:
+ raise ValueError('Required property \'numa\' not present in DedicatedHost JSON')
+ if (profile := _dict.get('profile')) is not None:
+ args['profile'] = DedicatedHostProfileReference.from_dict(profile)
+ else:
+ raise ValueError('Required property \'profile\' not present in DedicatedHost JSON')
+ if (provisionable := _dict.get('provisionable')) is not None:
+ args['provisionable'] = provisionable
+ else:
+ raise ValueError('Required property \'provisionable\' not present in DedicatedHost JSON')
+ if (resource_group := _dict.get('resource_group')) is not None:
+ args['resource_group'] = ResourceGroupReference.from_dict(resource_group)
+ else:
+ raise ValueError('Required property \'resource_group\' not present in DedicatedHost JSON')
+ if (resource_type := _dict.get('resource_type')) is not None:
+ args['resource_type'] = resource_type
+ else:
+ raise ValueError('Required property \'resource_type\' not present in DedicatedHost JSON')
+ if (socket_count := _dict.get('socket_count')) is not None:
+ args['socket_count'] = socket_count
+ else:
+ raise ValueError('Required property \'socket_count\' not present in DedicatedHost JSON')
+ if (state := _dict.get('state')) is not None:
+ args['state'] = state
+ else:
+ raise ValueError('Required property \'state\' not present in DedicatedHost JSON')
+ if (supported_instance_profiles := _dict.get('supported_instance_profiles')) is not None:
+ args['supported_instance_profiles'] = [InstanceProfileReference.from_dict(v) for v in supported_instance_profiles]
+ else:
+ raise ValueError('Required property \'supported_instance_profiles\' not present in DedicatedHost JSON')
+ if (vcpu := _dict.get('vcpu')) is not None:
+ args['vcpu'] = VCPU.from_dict(vcpu)
+ else:
+ raise ValueError('Required property \'vcpu\' not present in DedicatedHost JSON')
+ if (zone := _dict.get('zone')) is not None:
+ args['zone'] = ZoneReference.from_dict(zone)
+ else:
+ raise ValueError('Required property \'zone\' not present in DedicatedHost JSON')
+ return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a DedicatedHostGroupPrototypeDedicatedHostByZoneContext object from a json dictionary."""
+ """Initialize a DedicatedHost object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
+ if hasattr(self, 'available_memory') and self.available_memory is not None:
+ _dict['available_memory'] = self.available_memory
+ if hasattr(self, 'available_vcpu') and self.available_vcpu is not None:
+ if isinstance(self.available_vcpu, dict):
+ _dict['available_vcpu'] = self.available_vcpu
+ else:
+ _dict['available_vcpu'] = self.available_vcpu.to_dict()
+ if hasattr(self, 'created_at') and self.created_at is not None:
+ _dict['created_at'] = datetime_to_string(self.created_at)
+ if hasattr(self, 'crn') and self.crn is not None:
+ _dict['crn'] = self.crn
+ if hasattr(self, 'disks') and self.disks is not None:
+ disks_list = []
+ for v in self.disks:
+ if isinstance(v, dict):
+ disks_list.append(v)
+ else:
+ disks_list.append(v.to_dict())
+ _dict['disks'] = disks_list
+ if hasattr(self, 'group') and self.group is not None:
+ if isinstance(self.group, dict):
+ _dict['group'] = self.group
+ else:
+ _dict['group'] = self.group.to_dict()
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
+ if hasattr(self, 'id') and self.id is not None:
+ _dict['id'] = self.id
+ if hasattr(self, 'instance_placement_enabled') and self.instance_placement_enabled is not None:
+ _dict['instance_placement_enabled'] = self.instance_placement_enabled
+ if hasattr(self, 'instances') and self.instances is not None:
+ instances_list = []
+ for v in self.instances:
+ if isinstance(v, dict):
+ instances_list.append(v)
+ else:
+ instances_list.append(v.to_dict())
+ _dict['instances'] = instances_list
+ if hasattr(self, 'lifecycle_state') and self.lifecycle_state is not None:
+ _dict['lifecycle_state'] = self.lifecycle_state
+ if hasattr(self, 'memory') and self.memory is not None:
+ _dict['memory'] = self.memory
if hasattr(self, 'name') and self.name is not None:
_dict['name'] = self.name
+ if hasattr(self, 'numa') and self.numa is not None:
+ if isinstance(self.numa, dict):
+ _dict['numa'] = self.numa
+ else:
+ _dict['numa'] = self.numa.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, 'provisionable') and self.provisionable is not None:
+ _dict['provisionable'] = self.provisionable
if hasattr(self, 'resource_group') and self.resource_group is not None:
if isinstance(self.resource_group, dict):
_dict['resource_group'] = self.resource_group
else:
_dict['resource_group'] = self.resource_group.to_dict()
+ if hasattr(self, 'resource_type') and self.resource_type is not None:
+ _dict['resource_type'] = self.resource_type
+ if hasattr(self, 'socket_count') and self.socket_count is not None:
+ _dict['socket_count'] = self.socket_count
+ if hasattr(self, 'state') and self.state is not None:
+ _dict['state'] = self.state
+ if hasattr(self, 'supported_instance_profiles') and self.supported_instance_profiles is not None:
+ supported_instance_profiles_list = []
+ for v in self.supported_instance_profiles:
+ if isinstance(v, dict):
+ supported_instance_profiles_list.append(v)
+ else:
+ supported_instance_profiles_list.append(v.to_dict())
+ _dict['supported_instance_profiles'] = supported_instance_profiles_list
+ if hasattr(self, 'vcpu') and self.vcpu is not None:
+ if isinstance(self.vcpu, dict):
+ _dict['vcpu'] = self.vcpu
+ else:
+ _dict['vcpu'] = self.vcpu.to_dict()
+ if hasattr(self, 'zone') and self.zone is not None:
+ if isinstance(self.zone, dict):
+ _dict['zone'] = self.zone
+ else:
+ _dict['zone'] = self.zone.to_dict()
return _dict
def _to_dict(self):
@@ -32687,117 +34915,154 @@ 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 DedicatedHost object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'DedicatedHostGroupPrototypeDedicatedHostByZoneContext') -> bool:
+ def __eq__(self, other: 'DedicatedHost') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'DedicatedHostGroupPrototypeDedicatedHostByZoneContext') -> bool:
+ 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.
+ """
-class DedicatedHostGroupReference:
+ 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:
"""
- DedicatedHostGroupReference.
+ DedicatedHostCollection.
- :attr str crn: The CRN for this dedicated host group.
- :attr DedicatedHostGroupReferenceDeleted deleted: (optional) If present, this
- property indicates the referenced resource has been deleted, and provides
- some supplementary information.
- :attr str href: The URL for this dedicated host group.
- :attr str id: The unique identifier for this dedicated host group.
- :attr str name: The name for this dedicated host group. The name is unique
- across all dedicated host groups in the region.
- :attr str resource_type: The resource type.
+ :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 DedicatedHostCollectionNext next: (optional) A link to the next page of
+ resources. This property is present for all pages
+ except the last page.
+ :param 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,
+ dedicated_hosts: List['DedicatedHost'],
+ first: 'DedicatedHostCollectionFirst',
+ limit: int,
+ total_count: int,
*,
- deleted: 'DedicatedHostGroupReferenceDeleted' = None,
+ next: Optional['DedicatedHostCollectionNext'] = None,
) -> None:
"""
- Initialize a DedicatedHostGroupReference object.
+ Initialize a DedicatedHostCollection object.
- :param str crn: The CRN for this dedicated host group.
- :param str href: The URL for this dedicated host group.
- :param str id: The unique identifier for this dedicated host group.
- :param str name: The name for this dedicated host group. The name is unique
- across all dedicated host groups in the region.
- :param str resource_type: The resource type.
- :param DedicatedHostGroupReferenceDeleted deleted: (optional) If present,
- this property indicates the referenced resource has been deleted, and
- provides
- some supplementary information.
+ :param 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.crn = crn
- self.deleted = deleted
- self.href = href
- self.id = id
- self.name = name
- self.resource_type = resource_type
+ 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) -> 'DedicatedHostGroupReference':
- """Initialize a DedicatedHostGroupReference object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'DedicatedHostCollection':
+ """Initialize a DedicatedHostCollection 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')
+ if (dedicated_hosts := _dict.get('dedicated_hosts')) is not None:
+ args['dedicated_hosts'] = [DedicatedHost.from_dict(v) for v in dedicated_hosts]
else:
- raise ValueError('Required property \'href\' not present in DedicatedHostGroupReference JSON')
- if 'id' in _dict:
- args['id'] = _dict.get('id')
+ raise ValueError('Required property \'dedicated_hosts\' not present in DedicatedHostCollection JSON')
+ if (first := _dict.get('first')) is not None:
+ args['first'] = DedicatedHostCollectionFirst.from_dict(first)
else:
- raise ValueError('Required property \'id\' not present in DedicatedHostGroupReference JSON')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
+ raise ValueError('Required property \'first\' not present in DedicatedHostCollection JSON')
+ if (limit := _dict.get('limit')) is not None:
+ args['limit'] = limit
else:
- raise ValueError('Required property \'name\' not present in DedicatedHostGroupReference JSON')
- if 'resource_type' in _dict:
- args['resource_type'] = _dict.get('resource_type')
+ raise ValueError('Required property \'limit\' not present in DedicatedHostCollection JSON')
+ if (next := _dict.get('next')) is not None:
+ args['next'] = DedicatedHostCollectionNext.from_dict(next)
+ if (total_count := _dict.get('total_count')) is not None:
+ args['total_count'] = total_count
else:
- raise ValueError('Required property \'resource_type\' not present in DedicatedHostGroupReference JSON')
+ raise ValueError('Required property \'total_count\' not present in DedicatedHostCollection JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a DedicatedHostGroupReference object from a json dictionary."""
+ """Initialize a DedicatedHostCollection object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'crn') and self.crn is not None:
- _dict['crn'] = self.crn
- if hasattr(self, 'deleted') and self.deleted is not None:
- if isinstance(self.deleted, dict):
- _dict['deleted'] = self.deleted
+ if hasattr(self, 'dedicated_hosts') and self.dedicated_hosts is not None:
+ dedicated_hosts_list = []
+ for v in self.dedicated_hosts:
+ if isinstance(v, dict):
+ dedicated_hosts_list.append(v)
+ else:
+ dedicated_hosts_list.append(v.to_dict())
+ _dict['dedicated_hosts'] = dedicated_hosts_list
+ if hasattr(self, 'first') and self.first is not None:
+ if isinstance(self.first, dict):
+ _dict['first'] = self.first
else:
- _dict['deleted'] = self.deleted.to_dict()
- if hasattr(self, 'href') and self.href is not None:
- _dict['href'] = self.href
- if hasattr(self, 'id') and self.id is not None:
- _dict['id'] = self.id
- if hasattr(self, 'name') and self.name is not None:
- _dict['name'] = self.name
- if hasattr(self, 'resource_type') and self.resource_type is not None:
- _dict['resource_type'] = self.resource_type
+ _dict['first'] = self.first.to_dict()
+ if hasattr(self, 'limit') and self.limit is not None:
+ _dict['limit'] = self.limit
+ if hasattr(self, 'next') and self.next is not None:
+ if isinstance(self.next, dict):
+ _dict['next'] = self.next
+ else:
+ _dict['next'] = self.next.to_dict()
+ if hasattr(self, 'total_count') and self.total_count is not None:
+ _dict['total_count'] = self.total_count
return _dict
def _to_dict(self):
@@ -32805,67 +35070,58 @@ 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 DedicatedHostCollection object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'DedicatedHostGroupReference') -> bool:
+ def __eq__(self, other: 'DedicatedHostCollection') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'DedicatedHostGroupReference') -> bool:
+ def __ne__(self, other: 'DedicatedHostCollection') -> 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 DedicatedHostCollectionFirst:
"""
- 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.
+ :param str href: The URL for a page of resources.
"""
def __init__(
self,
- more_info: str,
+ href: str,
) -> None:
"""
- Initialize a DedicatedHostGroupReferenceDeleted object.
+ Initialize a DedicatedHostCollectionFirst 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) -> 'DedicatedHostGroupReferenceDeleted':
- """Initialize a DedicatedHostGroupReferenceDeleted object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'DedicatedHostCollectionFirst':
+ """Initialize a DedicatedHostCollectionFirst object from a json dictionary."""
args = {}
- if 'more_info' in _dict:
- args['more_info'] = _dict.get('more_info')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'more_info\' not present in DedicatedHostGroupReferenceDeleted JSON')
+ raise ValueError('Required property \'href\' not present in DedicatedHostCollectionFirst JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a DedicatedHostGroupReferenceDeleted object from a json dictionary."""
+ """Initialize a DedicatedHostCollectionFirst object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, '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):
@@ -32873,75 +35129,59 @@ 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 DedicatedHostCollectionFirst object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'DedicatedHostGroupReferenceDeleted') -> bool:
+ def __eq__(self, other: 'DedicatedHostCollectionFirst') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'DedicatedHostGroupReferenceDeleted') -> bool:
+ def __ne__(self, other: 'DedicatedHostCollectionFirst') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class DedicatedHostNUMA:
+class DedicatedHostCollectionNext:
"""
- The dedicated host NUMA configuration.
+ A link to the next page of resources. This property is present for all pages except
+ the last page.
- :attr int count: The total number of NUMA nodes for this dedicated host.
- :attr List[DedicatedHostNUMANode] nodes: The NUMA nodes for this dedicated host.
+ :param str href: The URL for a page of resources.
"""
def __init__(
self,
- count: int,
- nodes: List['DedicatedHostNUMANode'],
+ href: str,
) -> None:
"""
- Initialize a DedicatedHostNUMA object.
+ Initialize a DedicatedHostCollectionNext object.
- :param int count: The total number of NUMA nodes for this dedicated host.
- :param List[DedicatedHostNUMANode] nodes: The NUMA nodes for this dedicated
- host.
+ :param str href: The URL for a page of resources.
"""
- self.count = count
- self.nodes = nodes
+ self.href = href
@classmethod
- def from_dict(cls, _dict: Dict) -> 'DedicatedHostNUMA':
- """Initialize a DedicatedHostNUMA object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'DedicatedHostCollectionNext':
+ """Initialize a DedicatedHostCollectionNext object from a json dictionary."""
args = {}
- if 'count' in _dict:
- args['count'] = _dict.get('count')
- else:
- raise ValueError('Required property \'count\' not present in DedicatedHostNUMA JSON')
- if 'nodes' in _dict:
- args['nodes'] = [DedicatedHostNUMANode.from_dict(v) for v in _dict.get('nodes')]
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'nodes\' not present in DedicatedHostNUMA JSON')
+ raise ValueError('Required property \'href\' not present in DedicatedHostCollectionNext JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a DedicatedHostNUMA object from a json dictionary."""
+ """Initialize a DedicatedHostCollectionNext object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'count') and self.count is not None:
- _dict['count'] = self.count
- if hasattr(self, 'nodes') and self.nodes is not None:
- nodes_list = []
- for v in self.nodes:
- if isinstance(v, dict):
- nodes_list.append(v)
- else:
- nodes_list.append(v.to_dict())
- _dict['nodes'] = nodes_list
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
return _dict
def _to_dict(self):
@@ -32949,68 +35189,193 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this DedicatedHostNUMA object."""
+ """Return a `str` version of this DedicatedHostCollectionNext object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'DedicatedHostNUMA') -> bool:
+ def __eq__(self, other: 'DedicatedHostCollectionNext') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'DedicatedHostNUMA') -> bool:
+ def __ne__(self, other: 'DedicatedHostCollectionNext') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class DedicatedHostNUMANode:
+class DedicatedHostDisk:
"""
- The dedicated host NUMA node configuration.
+ DedicatedHostDisk.
- :attr int available_vcpu: The available VCPU for this NUMA node.
- :attr int vcpu: The total VCPU capacity for this NUMA node.
+ :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 lifecycle_state: (optional) The lifecycle state of this dedicated
+ host disk.
+ :param str name: The name for this dedicated host disk. The name is unique
+ across all disks on the dedicated host.
+ :param bool provisionable: Indicates whether this dedicated host disk is
+ available for instance disk creation.
+ :param str resource_type: The resource type.
+ :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.
"""
def __init__(
self,
- available_vcpu: int,
- vcpu: int,
+ 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: Optional[str] = None,
) -> None:
"""
- Initialize a DedicatedHostNUMANode object.
+ Initialize a DedicatedHostDisk object.
- :param int available_vcpu: The available VCPU for this NUMA node.
- :param int vcpu: The total VCPU capacity for this NUMA node.
+ :param int available: The remaining space left for instance placement in GB
+ (gigabytes).
+ :param datetime created_at: The date and time that the disk was created.
+ :param str href: The URL for this disk.
+ :param str id: The unique identifier for this disk.
+ :param List[InstanceDiskReference] instance_disks: Instance disks that are
+ on this dedicated host disk.
+ :param str interface_type: The disk interface used for attaching the disk
+ The enumerated values for this property are expected to expand in the
+ future. When processing this property, check for and log unknown values.
+ Optionally halt processing and surface the error, or bypass the resource on
+ which the unexpected property value was encountered.
+ :param str name: The name for this dedicated host disk. The name is unique
+ across all disks on the dedicated host.
+ :param bool provisionable: Indicates whether this dedicated host disk is
+ available for instance disk creation.
+ :param str resource_type: The resource type.
+ :param int size: The size of the disk in GB (gigabytes).
+ :param List[str] supported_instance_interface_types: The instance disk
+ interfaces supported for this dedicated host disk.
+ :param str lifecycle_state: (optional) The lifecycle state of this
+ dedicated host disk.
"""
- self.available_vcpu = available_vcpu
- self.vcpu = vcpu
+ 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) -> 'DedicatedHostNUMANode':
- """Initialize a DedicatedHostNUMANode object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'DedicatedHostDisk':
+ """Initialize a DedicatedHostDisk object from a json dictionary."""
args = {}
- if 'available_vcpu' in _dict:
- args['available_vcpu'] = _dict.get('available_vcpu')
+ if (available := _dict.get('available')) is not None:
+ args['available'] = available
else:
- raise ValueError('Required property \'available_vcpu\' not present in DedicatedHostNUMANode JSON')
- if 'vcpu' in _dict:
- args['vcpu'] = _dict.get('vcpu')
+ raise ValueError('Required property \'available\' not present in DedicatedHostDisk JSON')
+ if (created_at := _dict.get('created_at')) is not None:
+ args['created_at'] = string_to_datetime(created_at)
else:
- raise ValueError('Required property \'vcpu\' not present in DedicatedHostNUMANode JSON')
+ raise ValueError('Required property \'created_at\' not present in DedicatedHostDisk JSON')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
+ else:
+ raise ValueError('Required property \'href\' not present in DedicatedHostDisk JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
+ else:
+ raise ValueError('Required property \'id\' not present in DedicatedHostDisk JSON')
+ if (instance_disks := _dict.get('instance_disks')) is not None:
+ args['instance_disks'] = [InstanceDiskReference.from_dict(v) for v in instance_disks]
+ else:
+ raise ValueError('Required property \'instance_disks\' not present in DedicatedHostDisk JSON')
+ if (interface_type := _dict.get('interface_type')) is not None:
+ args['interface_type'] = interface_type
+ else:
+ raise ValueError('Required property \'interface_type\' not present in DedicatedHostDisk JSON')
+ if (lifecycle_state := _dict.get('lifecycle_state')) is not None:
+ args['lifecycle_state'] = lifecycle_state
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ else:
+ raise ValueError('Required property \'name\' not present in DedicatedHostDisk JSON')
+ if (provisionable := _dict.get('provisionable')) is not None:
+ args['provisionable'] = provisionable
+ else:
+ raise ValueError('Required property \'provisionable\' not present in DedicatedHostDisk JSON')
+ if (resource_type := _dict.get('resource_type')) is not None:
+ args['resource_type'] = resource_type
+ else:
+ raise ValueError('Required property \'resource_type\' not present in DedicatedHostDisk JSON')
+ if (size := _dict.get('size')) is not None:
+ args['size'] = size
+ else:
+ raise ValueError('Required property \'size\' not present in DedicatedHostDisk JSON')
+ if (supported_instance_interface_types := _dict.get('supported_instance_interface_types')) is not None:
+ args['supported_instance_interface_types'] = 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 DedicatedHostNUMANode object from a json dictionary."""
+ """Initialize a DedicatedHostDisk object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'available_vcpu') and self.available_vcpu is not None:
- _dict['available_vcpu'] = self.available_vcpu
- if hasattr(self, 'vcpu') and self.vcpu is not None:
- _dict['vcpu'] = self.vcpu
+ if hasattr(self, 'available') and self.available is not None:
+ _dict['available'] = self.available
+ if hasattr(self, 'created_at') and self.created_at is not None:
+ _dict['created_at'] = datetime_to_string(self.created_at)
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
+ if hasattr(self, 'id') and self.id is not None:
+ _dict['id'] = self.id
+ if hasattr(self, 'instance_disks') and self.instance_disks is not None:
+ instance_disks_list = []
+ for v in self.instance_disks:
+ if isinstance(v, dict):
+ instance_disks_list.append(v)
+ else:
+ instance_disks_list.append(v.to_dict())
+ _dict['instance_disks'] = instance_disks_list
+ if hasattr(self, 'interface_type') and self.interface_type is not None:
+ _dict['interface_type'] = self.interface_type
+ if hasattr(self, 'lifecycle_state') and self.lifecycle_state is not None:
+ _dict['lifecycle_state'] = self.lifecycle_state
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ if hasattr(self, 'provisionable') and self.provisionable is not None:
+ _dict['provisionable'] = self.provisionable
+ if hasattr(self, 'resource_type') and self.resource_type is not None:
+ _dict['resource_type'] = self.resource_type
+ if hasattr(self, 'size') and self.size is not None:
+ _dict['size'] = self.size
+ if hasattr(self, 'supported_instance_interface_types') and self.supported_instance_interface_types is not None:
+ _dict['supported_instance_interface_types'] = self.supported_instance_interface_types
return _dict
def _to_dict(self):
@@ -33018,67 +35383,170 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this DedicatedHostNUMANode object."""
+ """Return a `str` version of this DedicatedHostDisk object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'DedicatedHostNUMANode') -> bool:
+ def __eq__(self, other: 'DedicatedHostDisk') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'DedicatedHostNUMANode') -> bool:
+ def __ne__(self, other: 'DedicatedHostDisk') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
+ class InterfaceTypeEnum(str, Enum):
+ """
+ The disk interface used for attaching the disk
+ The enumerated values for this property are expected to expand in the future. When
+ processing this property, check for and log unknown values. Optionally halt
+ processing and surface the error, or bypass the resource on which the unexpected
+ property value was encountered.
+ """
-class DedicatedHostPatch:
- """
- DedicatedHostPatch.
+ NVME = 'nvme'
- :attr bool instance_placement_enabled: (optional) If set to true, instances can
- be placed on this dedicated host.
- :attr str name: (optional) The name for this dedicated host. The name must not
- be used by another dedicated host in the region.
- """
- def __init__(
+ 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.
+
+ :param 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 := _dict.get('disks')) is not None:
+ args['disks'] = [DedicatedHostDisk.from_dict(v) for v in 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:
+ disks_list = []
+ for v in self.disks:
+ if isinstance(v, dict):
+ disks_list.append(v)
+ else:
+ disks_list.append(v.to_dict())
+ _dict['disks'] = disks_list
+ return _dict
+
+ def _to_dict(self):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
+
+ 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.
+
+ :param str name: (optional) The name for this dedicated host disk. The name must
+ not be used by another disk on the dedicated host.
+ """
+
+ def __init__(
self,
*,
- instance_placement_enabled: bool = None,
- name: str = None,
+ name: Optional[str] = None,
) -> None:
"""
- Initialize a DedicatedHostPatch object.
+ Initialize a DedicatedHostDiskPatch object.
- :param bool instance_placement_enabled: (optional) If set to true,
- instances can be placed on this dedicated host.
- :param str name: (optional) The name for this dedicated host. The name must
- not be used by another dedicated host in the region.
+ :param str name: (optional) The name for this dedicated host disk. The name
+ must not be used by another disk on the 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."""
+ def from_dict(cls, _dict: Dict) -> 'DedicatedHostDiskPatch':
+ """Initialize a DedicatedHostDiskPatch object from a json dictionary."""
args = {}
- if 'instance_placement_enabled' in _dict:
- args['instance_placement_enabled'] = _dict.get('instance_placement_enabled')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a DedicatedHostPatch object from a json dictionary."""
+ """Initialize a DedicatedHostDiskPatch object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, '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
@@ -33088,179 +35556,151 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this DedicatedHostPatch object."""
+ """Return a `str` version of this DedicatedHostDiskPatch object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'DedicatedHostPatch') -> bool:
+ def __eq__(self, other: 'DedicatedHostDiskPatch') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'DedicatedHostPatch') -> bool:
+ def __ne__(self, other: 'DedicatedHostDiskPatch') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class DedicatedHostProfile:
+class DedicatedHostGroup:
"""
- DedicatedHostProfile.
+ DedicatedHostGroup.
- :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 str status: The status of the dedicated host profile:
- - `previous`: This dedicated host profile is an older revision, but remains
- provisionable
- and usable.
- - `current`: This profile is the latest revision.
- Note that revisions are indicated by the generation of a dedicated host profile.
- Refer to the [profile naming conventions]
- (https://cloud.ibm.com/docs/vpc?topic=vpc-dh-profiles&interface=ui#profiles-naming-rule)
- for information on how generations are defined within a dedicated host 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 profile on which the unexpected
- property value was encountered.
- :attr List[InstanceProfileReference] supported_instance_profiles: The instance
- profiles usable by instances placed on dedicated hosts with this profile.
- :attr DedicatedHostProfileVCPUArchitecture vcpu_architecture:
- :attr DedicatedHostProfileVCPU vcpu_count:
- :attr DedicatedHostProfileVCPUManufacturer vcpu_manufacturer:
+ :param str class_: The dedicated host profile class for hosts in this group.
+ :param datetime created_at: The date and time that the dedicated host group was
+ created.
+ :param str crn: The CRN for this dedicated host group.
+ :param List[DedicatedHostReference] dedicated_hosts: The dedicated hosts that
+ are in this dedicated host group.
+ :param str family: The dedicated host profile family for hosts in this group.
+ :param str href: The URL for this dedicated host group.
+ :param str id: The unique identifier for this dedicated host group.
+ :param str name: The name for this dedicated host group. The name is unique
+ across all dedicated host groups in the region.
+ :param 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.
"""
def __init__(
self,
class_: str,
- disks: List['DedicatedHostProfileDisk'],
+ created_at: datetime,
+ crn: str,
+ dedicated_hosts: List['DedicatedHostReference'],
family: str,
href: str,
- memory: 'DedicatedHostProfileMemory',
+ id: str,
name: str,
- socket_count: 'DedicatedHostProfileSocket',
- status: str,
+ resource_group: 'ResourceGroupReference',
+ resource_type: str,
supported_instance_profiles: List['InstanceProfileReference'],
- vcpu_architecture: 'DedicatedHostProfileVCPUArchitecture',
- vcpu_count: 'DedicatedHostProfileVCPU',
- vcpu_manufacturer: 'DedicatedHostProfileVCPUManufacturer',
+ zone: 'ZoneReference',
) -> None:
"""
- Initialize a DedicatedHostProfile object.
+ Initialize a DedicatedHostGroup 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 str status: The status of the dedicated host profile:
- - `previous`: This dedicated host profile is an older revision, but
- remains provisionable
- and usable.
- - `current`: This profile is the latest revision.
- Note that revisions are indicated by the generation of a dedicated host
- profile. Refer to the [profile naming conventions]
- (https://cloud.ibm.com/docs/vpc?topic=vpc-dh-profiles&interface=ui#profiles-naming-rule)
- for information on how generations are defined within a dedicated host
- 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 profile on
- which the unexpected property value was encountered.
+ :param str class_: The dedicated host profile class for hosts in this
+ group.
+ :param datetime created_at: The date and time that the dedicated host group
+ was created.
+ :param str crn: The CRN for this dedicated host group.
+ :param List[DedicatedHostReference] dedicated_hosts: The dedicated hosts
+ that are in this dedicated host group.
+ :param str family: The dedicated host profile family for hosts in this
+ group.
+ :param str href: The URL for this dedicated host group.
+ :param str id: The unique identifier for this dedicated host group.
+ :param str name: The name for this dedicated host group. The name is unique
+ across all dedicated host groups in the region.
+ :param 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 dedicated hosts with this
- profile.
- :param DedicatedHostProfileVCPUArchitecture vcpu_architecture:
- :param DedicatedHostProfileVCPU vcpu_count:
- :param DedicatedHostProfileVCPUManufacturer vcpu_manufacturer:
+ 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.disks = disks
+ self.created_at = created_at
+ self.crn = crn
+ self.dedicated_hosts = dedicated_hosts
self.family = family
self.href = href
- self.memory = memory
+ self.id = id
self.name = name
- self.socket_count = socket_count
- self.status = status
+ self.resource_group = resource_group
+ self.resource_type = resource_type
self.supported_instance_profiles = supported_instance_profiles
- self.vcpu_architecture = vcpu_architecture
- self.vcpu_count = vcpu_count
- self.vcpu_manufacturer = vcpu_manufacturer
+ self.zone = zone
@classmethod
- def from_dict(cls, _dict: Dict) -> 'DedicatedHostProfile':
- """Initialize a DedicatedHostProfile object from a json dictionary."""
+ 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')
+ if (class_ := _dict.get('class')) is not None:
+ args['class_'] = class_
else:
- raise ValueError('Required property \'class\' not present in DedicatedHostProfile JSON')
- if 'disks' in _dict:
- args['disks'] = [DedicatedHostProfileDisk.from_dict(v) for v in _dict.get('disks')]
+ raise ValueError('Required property \'class\' not present in DedicatedHostGroup JSON')
+ if (created_at := _dict.get('created_at')) is not None:
+ args['created_at'] = string_to_datetime(created_at)
else:
- raise ValueError('Required property \'disks\' not present in DedicatedHostProfile JSON')
- if 'family' in _dict:
- args['family'] = _dict.get('family')
+ raise ValueError('Required property \'created_at\' not present in DedicatedHostGroup JSON')
+ if (crn := _dict.get('crn')) is not None:
+ args['crn'] = crn
else:
- raise ValueError('Required property \'family\' not present in DedicatedHostProfile JSON')
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ raise ValueError('Required property \'crn\' not present in DedicatedHostGroup JSON')
+ if (dedicated_hosts := _dict.get('dedicated_hosts')) is not None:
+ args['dedicated_hosts'] = [DedicatedHostReference.from_dict(v) for v in dedicated_hosts]
else:
- raise ValueError('Required property \'href\' not present in DedicatedHostProfile JSON')
- if 'memory' in _dict:
- args['memory'] = _dict.get('memory')
+ raise ValueError('Required property \'dedicated_hosts\' not present in DedicatedHostGroup JSON')
+ if (family := _dict.get('family')) is not None:
+ args['family'] = family
else:
- raise ValueError('Required property \'memory\' not present in DedicatedHostProfile JSON')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
+ raise ValueError('Required property \'family\' not present in DedicatedHostGroup JSON')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'name\' not present in DedicatedHostProfile JSON')
- if 'socket_count' in _dict:
- args['socket_count'] = _dict.get('socket_count')
+ raise ValueError('Required property \'href\' not present in DedicatedHostGroup JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
else:
- raise ValueError('Required property \'socket_count\' not present in DedicatedHostProfile JSON')
- if 'status' in _dict:
- args['status'] = _dict.get('status')
+ raise ValueError('Required property \'id\' not present in DedicatedHostGroup JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
else:
- raise ValueError('Required property \'status\' not present in DedicatedHostProfile JSON')
- if 'supported_instance_profiles' in _dict:
- args['supported_instance_profiles'] = [InstanceProfileReference.from_dict(v) for v in _dict.get('supported_instance_profiles')]
+ raise ValueError('Required property \'name\' not present in DedicatedHostGroup JSON')
+ if (resource_group := _dict.get('resource_group')) is not None:
+ args['resource_group'] = ResourceGroupReference.from_dict(resource_group)
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 \'resource_group\' not present in DedicatedHostGroup JSON')
+ if (resource_type := _dict.get('resource_type')) is not None:
+ args['resource_type'] = resource_type
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_type\' not present in DedicatedHostGroup JSON')
+ if (supported_instance_profiles := _dict.get('supported_instance_profiles')) is not None:
+ args['supported_instance_profiles'] = [InstanceProfileReference.from_dict(v) for v in supported_instance_profiles]
else:
- raise ValueError('Required property \'vcpu_count\' not present in DedicatedHostProfile JSON')
- if 'vcpu_manufacturer' in _dict:
- args['vcpu_manufacturer'] = DedicatedHostProfileVCPUManufacturer.from_dict(_dict.get('vcpu_manufacturer'))
+ raise ValueError('Required property \'supported_instance_profiles\' not present in DedicatedHostGroup JSON')
+ if (zone := _dict.get('zone')) is not None:
+ args['zone'] = ZoneReference.from_dict(zone)
else:
- raise ValueError('Required property \'vcpu_manufacturer\' not present in DedicatedHostProfile JSON')
+ raise ValueError('Required property \'zone\' not present in DedicatedHostGroup JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a DedicatedHostProfile object from a json dictionary."""
+ """Initialize a DedicatedHostGroup object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -33268,32 +35708,33 @@ def to_dict(self) -> Dict:
_dict = {}
if hasattr(self, 'class_') and self.class_ is not None:
_dict['class'] = self.class_
- if hasattr(self, 'disks') and self.disks is not None:
- disks_list = []
- for v in self.disks:
+ if hasattr(self, 'created_at') and self.created_at is not None:
+ _dict['created_at'] = datetime_to_string(self.created_at)
+ if hasattr(self, 'crn') and self.crn is not None:
+ _dict['crn'] = self.crn
+ if hasattr(self, 'dedicated_hosts') and self.dedicated_hosts is not None:
+ dedicated_hosts_list = []
+ for v in self.dedicated_hosts:
if isinstance(v, dict):
- disks_list.append(v)
+ dedicated_hosts_list.append(v)
else:
- disks_list.append(v.to_dict())
- _dict['disks'] = disks_list
+ dedicated_hosts_list.append(v.to_dict())
+ _dict['dedicated_hosts'] = dedicated_hosts_list
if hasattr(self, '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, '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, 'socket_count') and self.socket_count is not None:
- if isinstance(self.socket_count, dict):
- _dict['socket_count'] = self.socket_count
+ 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['socket_count'] = self.socket_count.to_dict()
- if hasattr(self, 'status') and self.status is not None:
- _dict['status'] = self.status
+ _dict['resource_group'] = self.resource_group.to_dict()
+ if hasattr(self, 'resource_type') and self.resource_type is not None:
+ _dict['resource_type'] = self.resource_type
if hasattr(self, 'supported_instance_profiles') and self.supported_instance_profiles is not None:
supported_instance_profiles_list = []
for v in self.supported_instance_profiles:
@@ -33302,21 +35743,11 @@ def to_dict(self) -> Dict:
else:
supported_instance_profiles_list.append(v.to_dict())
_dict['supported_instance_profiles'] = supported_instance_profiles_list
- if hasattr(self, 'vcpu_architecture') and self.vcpu_architecture is not None:
- if isinstance(self.vcpu_architecture, dict):
- _dict['vcpu_architecture'] = self.vcpu_architecture
- else:
- _dict['vcpu_architecture'] = self.vcpu_architecture.to_dict()
- if hasattr(self, 'vcpu_count') and self.vcpu_count is not None:
- if isinstance(self.vcpu_count, dict):
- _dict['vcpu_count'] = self.vcpu_count
- else:
- _dict['vcpu_count'] = self.vcpu_count.to_dict()
- if hasattr(self, 'vcpu_manufacturer') and self.vcpu_manufacturer is not None:
- if isinstance(self.vcpu_manufacturer, dict):
- _dict['vcpu_manufacturer'] = self.vcpu_manufacturer
+ if hasattr(self, 'zone') and self.zone is not None:
+ if isinstance(self.zone, dict):
+ _dict['zone'] = self.zone
else:
- _dict['vcpu_manufacturer'] = self.vcpu_manufacturer.to_dict()
+ _dict['zone'] = self.zone.to_dict()
return _dict
def _to_dict(self):
@@ -33324,26 +35755,22 @@ 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 DedicatedHostGroup object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'DedicatedHostProfile') -> bool:
+ 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: 'DedicatedHostProfile') -> bool:
+ 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 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 dedicated host profile family for hosts in this group.
"""
BALANCED = 'balanced'
@@ -33351,100 +35778,86 @@ class FamilyEnum(str, Enum):
MEMORY = 'memory'
- class StatusEnum(str, Enum):
+ class ResourceTypeEnum(str, Enum):
"""
- The status of the dedicated host profile:
- - `previous`: This dedicated host profile is an older revision, but remains
- provisionable
- and usable.
- - `current`: This profile is the latest revision.
- Note that revisions are indicated by the generation of a dedicated host profile.
- Refer to the [profile naming conventions]
- (https://cloud.ibm.com/docs/vpc?topic=vpc-dh-profiles&interface=ui#profiles-naming-rule)
- for information on how generations are defined within a dedicated host 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 profile on which the unexpected
- property value was encountered.
+ The resource type.
"""
- CURRENT = 'current'
- PREVIOUS = 'previous'
+ DEDICATED_HOST_GROUP = 'dedicated_host_group'
-class DedicatedHostProfileCollection:
+class DedicatedHostGroupCollection:
"""
- DedicatedHostProfileCollection.
+ DedicatedHostGroupCollection.
- :attr DedicatedHostProfileCollectionFirst first: A link to the first page of
+ :param DedicatedHostGroupCollectionFirst first: A link to the first page of
resources.
- :attr int limit: The maximum number of resources that can be returned by the
+ :param List[DedicatedHostGroup] groups: Collection of dedicated host groups.
+ :param 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
+ :param DedicatedHostGroupCollectionNext 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.
+ :param int total_count: The total number of resources across all pages.
"""
def __init__(
self,
- first: 'DedicatedHostProfileCollectionFirst',
+ first: 'DedicatedHostGroupCollectionFirst',
+ groups: List['DedicatedHostGroup'],
limit: int,
- profiles: List['DedicatedHostProfile'],
total_count: int,
*,
- next: 'DedicatedHostProfileCollectionNext' = None,
+ next: Optional['DedicatedHostGroupCollectionNext'] = None,
) -> None:
"""
- Initialize a DedicatedHostProfileCollection object.
+ Initialize a DedicatedHostGroupCollection object.
- :param DedicatedHostProfileCollectionFirst first: A link to the first page
- of resources.
+ :param DedicatedHostGroupCollectionFirst first: A link to the first page of
+ resources.
+ :param List[DedicatedHostGroup] groups: Collection of dedicated host
+ groups.
:param int limit: The maximum number of resources that can be returned by
the request.
- :param List[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 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.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) -> 'DedicatedHostGroupCollection':
+ """Initialize a DedicatedHostGroupCollection object from a json dictionary."""
args = {}
- if 'first' in _dict:
- args['first'] = DedicatedHostProfileCollectionFirst.from_dict(_dict.get('first'))
+ if (first := _dict.get('first')) is not None:
+ args['first'] = DedicatedHostGroupCollectionFirst.from_dict(first)
else:
- raise ValueError('Required property \'first\' not present in DedicatedHostProfileCollection JSON')
- if 'limit' in _dict:
- args['limit'] = _dict.get('limit')
+ raise ValueError('Required property \'first\' not present in DedicatedHostGroupCollection JSON')
+ if (groups := _dict.get('groups')) is not None:
+ args['groups'] = [DedicatedHostGroup.from_dict(v) for v in groups]
else:
- raise ValueError('Required property \'limit\' not present in DedicatedHostProfileCollection JSON')
- if 'next' in _dict:
- args['next'] = DedicatedHostProfileCollectionNext.from_dict(_dict.get('next'))
- if 'profiles' in _dict:
- args['profiles'] = [DedicatedHostProfile.from_dict(v) for v in _dict.get('profiles')]
+ raise ValueError('Required property \'groups\' not present in DedicatedHostGroupCollection JSON')
+ if (limit := _dict.get('limit')) is not None:
+ args['limit'] = limit
else:
- raise ValueError('Required property \'profiles\' not present in DedicatedHostProfileCollection JSON')
- if 'total_count' in _dict:
- args['total_count'] = _dict.get('total_count')
+ raise ValueError('Required property \'limit\' not present in DedicatedHostGroupCollection JSON')
+ if (next := _dict.get('next')) is not None:
+ args['next'] = DedicatedHostGroupCollectionNext.from_dict(next)
+ if (total_count := _dict.get('total_count')) is not None:
+ args['total_count'] = total_count
else:
- raise ValueError('Required property \'total_count\' not present in DedicatedHostProfileCollection JSON')
+ raise ValueError('Required property \'total_count\' not present in DedicatedHostGroupCollection JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a DedicatedHostProfileCollection object from a json dictionary."""
+ """Initialize a DedicatedHostGroupCollection object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -33455,6 +35868,14 @@ def to_dict(self) -> Dict:
_dict['first'] = self.first
else:
_dict['first'] = self.first.to_dict()
+ if hasattr(self, 'groups') and self.groups is not None:
+ groups_list = []
+ for v in self.groups:
+ if isinstance(v, dict):
+ groups_list.append(v)
+ else:
+ groups_list.append(v.to_dict())
+ _dict['groups'] = groups_list
if hasattr(self, 'limit') and self.limit is not None:
_dict['limit'] = self.limit
if hasattr(self, 'next') and self.next is not None:
@@ -33462,14 +35883,6 @@ def to_dict(self) -> Dict:
_dict['next'] = self.next
else:
_dict['next'] = self.next.to_dict()
- if hasattr(self, 'profiles') and self.profiles is not None:
- profiles_list = []
- for v in self.profiles:
- if isinstance(v, dict):
- profiles_list.append(v)
- else:
- profiles_list.append(v.to_dict())
- _dict['profiles'] = profiles_list
if hasattr(self, 'total_count') and self.total_count is not None:
_dict['total_count'] = self.total_count
return _dict
@@ -33479,25 +35892,25 @@ 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 DedicatedHostGroupCollection object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'DedicatedHostProfileCollection') -> bool:
+ def __eq__(self, other: 'DedicatedHostGroupCollection') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'DedicatedHostProfileCollection') -> bool:
+ def __ne__(self, other: 'DedicatedHostGroupCollection') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class DedicatedHostProfileCollectionFirst:
+class DedicatedHostGroupCollectionFirst:
"""
A link to the first page of resources.
- :attr str href: The URL for a page of resources.
+ :param str href: The URL for a page of resources.
"""
def __init__(
@@ -33505,25 +35918,25 @@ def __init__(
href: str,
) -> None:
"""
- Initialize a DedicatedHostProfileCollectionFirst object.
+ Initialize a DedicatedHostGroupCollectionFirst object.
:param str href: The URL for a page of resources.
"""
self.href = href
@classmethod
- def from_dict(cls, _dict: Dict) -> 'DedicatedHostProfileCollectionFirst':
- """Initialize a DedicatedHostProfileCollectionFirst object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'DedicatedHostGroupCollectionFirst':
+ """Initialize a DedicatedHostGroupCollectionFirst object from a json dictionary."""
args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'href\' not present in DedicatedHostProfileCollectionFirst JSON')
+ raise ValueError('Required property \'href\' not present in DedicatedHostGroupCollectionFirst JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a DedicatedHostProfileCollectionFirst object from a json dictionary."""
+ """Initialize a DedicatedHostGroupCollectionFirst object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -33538,26 +35951,26 @@ 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 DedicatedHostGroupCollectionFirst object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'DedicatedHostProfileCollectionFirst') -> bool:
+ def __eq__(self, other: 'DedicatedHostGroupCollectionFirst') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'DedicatedHostProfileCollectionFirst') -> bool:
+ def __ne__(self, other: 'DedicatedHostGroupCollectionFirst') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class DedicatedHostProfileCollectionNext:
+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.
+ :param str href: The URL for a page of resources.
"""
def __init__(
@@ -33565,25 +35978,25 @@ def __init__(
href: str,
) -> None:
"""
- Initialize a DedicatedHostProfileCollectionNext object.
+ Initialize a DedicatedHostGroupCollectionNext object.
:param str href: The URL for a page of resources.
"""
self.href = href
@classmethod
- def from_dict(cls, _dict: Dict) -> 'DedicatedHostProfileCollectionNext':
- """Initialize a DedicatedHostProfileCollectionNext object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'DedicatedHostGroupCollectionNext':
+ """Initialize a DedicatedHostGroupCollectionNext object from a json dictionary."""
args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'href\' not present in DedicatedHostProfileCollectionNext JSON')
+ raise ValueError('Required property \'href\' not present in DedicatedHostGroupCollectionNext JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a DedicatedHostProfileCollectionNext object from a json dictionary."""
+ """Initialize a DedicatedHostGroupCollectionNext object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -33598,105 +36011,78 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this DedicatedHostProfileCollectionNext object."""
+ """Return a `str` version of this DedicatedHostGroupCollectionNext object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'DedicatedHostProfileCollectionNext') -> bool:
+ def __eq__(self, other: 'DedicatedHostGroupCollectionNext') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'DedicatedHostProfileCollectionNext') -> bool:
+ def __ne__(self, other: 'DedicatedHostGroupCollectionNext') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class DedicatedHostProfileDisk:
+class DedicatedHostGroupIdentity:
"""
- Disks provided by this profile.
+ Identifies a dedicated host group by a unique property.
- :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.
+ Initialize a DedicatedHostGroupIdentity 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
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['DedicatedHostGroupIdentityById', 'DedicatedHostGroupIdentityByCRN', 'DedicatedHostGroupIdentityByHref'])
+ )
+ raise Exception(msg)
+
+
+class DedicatedHostGroupPatch:
+ """
+ DedicatedHostGroupPatch.
+
+ :param str name: (optional) The name for this dedicated host group. The name
+ must not be used by another dedicated host group in the region.
+ """
+
+ def __init__(
+ self,
+ *,
+ name: Optional[str] = None,
+ ) -> None:
+ """
+ Initialize a DedicatedHostGroupPatch object.
+
+ :param str name: (optional) The name for this dedicated host group. The
+ name must not be used by another dedicated host group in the region.
+ """
+ self.name = name
@classmethod
- def from_dict(cls, _dict: Dict) -> 'DedicatedHostProfileDisk':
- """Initialize a DedicatedHostProfileDisk object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'DedicatedHostGroupPatch':
+ """Initialize a DedicatedHostGroupPatch 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')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a DedicatedHostProfileDisk object from a json dictionary."""
+ """Initialize a DedicatedHostGroupPatch object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'interface_type') and self.interface_type is not None:
- if isinstance(self.interface_type, dict):
- _dict['interface_type'] = self.interface_type
- else:
- _dict['interface_type'] = self.interface_type.to_dict()
- if hasattr(self, 'quantity') and self.quantity is not None:
- if isinstance(self.quantity, dict):
- _dict['quantity'] = self.quantity
- else:
- _dict['quantity'] = self.quantity.to_dict()
- if hasattr(self, 'size') and self.size is not None:
- if isinstance(self.size, dict):
- _dict['size'] = self.size
- else:
- _dict['size'] = self.size.to_dict()
- if hasattr(self, 'supported_instance_interface_types') and self.supported_instance_interface_types is not None:
- if isinstance(self.supported_instance_interface_types, dict):
- _dict['supported_instance_interface_types'] = self.supported_instance_interface_types
- else:
- _dict['supported_instance_interface_types'] = self.supported_instance_interface_types.to_dict()
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
return _dict
def _to_dict(self):
@@ -33704,78 +36090,74 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this DedicatedHostProfileDisk object."""
+ """Return a `str` version of this DedicatedHostGroupPatch object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'DedicatedHostProfileDisk') -> bool:
+ def __eq__(self, other: 'DedicatedHostGroupPatch') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'DedicatedHostProfileDisk') -> bool:
+ def __ne__(self, other: 'DedicatedHostGroupPatch') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class DedicatedHostProfileDiskInterface:
+class DedicatedHostGroupPrototypeDedicatedHostByZoneContext:
"""
- DedicatedHostProfileDiskInterface.
+ DedicatedHostGroupPrototypeDedicatedHostByZoneContext.
- :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.
+ :param str name: (optional) The name for this dedicated host group. The name
+ must not be used by another dedicated host group in the region. If unspecified,
+ the name will be a hyphenated list of randomly-selected words.
+ :param ResourceGroupIdentity resource_group: (optional) The resource group to
+ use. If unspecified, the host's resource group is used.
"""
def __init__(
self,
- type: str,
- value: str,
+ *,
+ name: Optional[str] = None,
+ resource_group: Optional['ResourceGroupIdentity'] = None,
) -> None:
"""
- Initialize a DedicatedHostProfileDiskInterface object.
+ Initialize a DedicatedHostGroupPrototypeDedicatedHostByZoneContext 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 name: (optional) The name for this dedicated host group. The
+ name must not be used by another dedicated host group in the region. If
+ unspecified, the name will be a hyphenated list of randomly-selected words.
+ :param ResourceGroupIdentity resource_group: (optional) The resource group
+ to use. If unspecified, the host's resource group is used.
"""
- self.type = type
- self.value = value
+ self.name = name
+ self.resource_group = resource_group
@classmethod
- def from_dict(cls, _dict: Dict) -> 'DedicatedHostProfileDiskInterface':
- """Initialize a DedicatedHostProfileDiskInterface object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'DedicatedHostGroupPrototypeDedicatedHostByZoneContext':
+ """Initialize a DedicatedHostGroupPrototypeDedicatedHostByZoneContext 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 (name := _dict.get('name')) is not None:
+ args['name'] = name
+ if (resource_group := _dict.get('resource_group')) is not None:
+ args['resource_group'] = resource_group
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a DedicatedHostProfileDiskInterface object from a json dictionary."""
+ """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, 'type') and self.type is not None:
- _dict['type'] = self.type
- if hasattr(self, 'value') and self.value is not None:
- _dict['value'] = self.value
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ if hasattr(self, 'resource_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):
@@ -33783,88 +36165,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 DedicatedHostGroupPrototypeDedicatedHostByZoneContext object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'DedicatedHostProfileDiskInterface') -> bool:
+ 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: 'DedicatedHostProfileDiskInterface') -> bool:
+ def __ne__(self, other: 'DedicatedHostGroupPrototypeDedicatedHostByZoneContext') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class TypeEnum(str, Enum):
- """
- The type for this profile field.
- """
-
- FIXED = 'fixed'
-
-
- class ValueEnum(str, Enum):
- """
- The interface of the disk for a dedicated host with this profile
- The enumerated values for this property are expected to expand in the future. When
- processing this property, check for and log unknown values. Optionally halt
- processing and surface the error, or bypass the resource on which the unexpected
- property value was encountered.
- """
-
- NVME = 'nvme'
-
-
-class DedicatedHostProfileDiskQuantity:
+class DedicatedHostGroupReference:
"""
- The number of disks of this type for a dedicated host with this profile.
+ DedicatedHostGroupReference.
- :attr str type: The type for this profile field.
- :attr int value: The value for this profile field.
+ :param str crn: The CRN for this dedicated host group.
+ :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 this dedicated host group.
+ :param str id: The unique identifier for this dedicated host group.
+ :param str name: The name for this dedicated host group. The name is unique
+ across all dedicated host groups in the region.
+ :param str resource_type: The resource type.
"""
def __init__(
self,
- type: str,
- value: int,
+ crn: str,
+ href: str,
+ id: str,
+ name: str,
+ resource_type: str,
+ *,
+ deleted: Optional['DedicatedHostGroupReferenceDeleted'] = None,
) -> None:
"""
- Initialize a DedicatedHostProfileDiskQuantity object.
+ Initialize a DedicatedHostGroupReference object.
- :param str type: The type for this profile field.
- :param int value: The value for this profile field.
+ :param str crn: The CRN for this dedicated host group.
+ :param str href: The URL for this dedicated host group.
+ :param str id: The unique identifier for this dedicated host group.
+ :param str name: The name for this dedicated host group. The name is unique
+ across all dedicated host groups in the region.
+ :param str resource_type: The resource type.
+ :param DedicatedHostGroupReferenceDeleted deleted: (optional) If present,
+ this property indicates the referenced resource has been deleted, and
+ provides
+ some supplementary information.
"""
- self.type = type
- self.value = value
+ self.crn = crn
+ self.deleted = deleted
+ self.href = href
+ self.id = id
+ self.name = name
+ self.resource_type = resource_type
@classmethod
- def from_dict(cls, _dict: Dict) -> 'DedicatedHostProfileDiskQuantity':
- """Initialize a DedicatedHostProfileDiskQuantity object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'DedicatedHostGroupReference':
+ """Initialize a DedicatedHostGroupReference object from a json dictionary."""
args = {}
- if 'type' in _dict:
- args['type'] = _dict.get('type')
+ if (crn := _dict.get('crn')) is not None:
+ args['crn'] = crn
else:
- raise ValueError('Required property \'type\' not present in DedicatedHostProfileDiskQuantity JSON')
- if 'value' in _dict:
- args['value'] = _dict.get('value')
+ raise ValueError('Required property \'crn\' not present in DedicatedHostGroupReference JSON')
+ if (deleted := _dict.get('deleted')) is not None:
+ args['deleted'] = DedicatedHostGroupReferenceDeleted.from_dict(deleted)
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'value\' not present in DedicatedHostProfileDiskQuantity JSON')
+ raise ValueError('Required property \'href\' not present in DedicatedHostGroupReference JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
+ else:
+ raise ValueError('Required property \'id\' not present in DedicatedHostGroupReference JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ else:
+ raise ValueError('Required property \'name\' not present in DedicatedHostGroupReference JSON')
+ if (resource_type := _dict.get('resource_type')) is not None:
+ args['resource_type'] = 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 DedicatedHostProfileDiskQuantity object from a json dictionary."""
+ """Initialize a DedicatedHostGroupReference object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'type') and self.type is not None:
- _dict['type'] = self.type
- if hasattr(self, 'value') and self.value is not None:
- _dict['value'] = self.value
+ if hasattr(self, 'crn') and self.crn is not None:
+ _dict['crn'] = self.crn
+ if hasattr(self, 'deleted') and self.deleted is not None:
+ if isinstance(self.deleted, dict):
+ _dict['deleted'] = self.deleted
+ else:
+ _dict['deleted'] = self.deleted.to_dict()
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
+ if hasattr(self, 'id') and self.id is not None:
+ _dict['id'] = self.id
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ if hasattr(self, 'resource_type') and self.resource_type is not None:
+ _dict['resource_type'] = self.resource_type
return _dict
def _to_dict(self):
@@ -33872,76 +36283,67 @@ 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 DedicatedHostGroupReference object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'DedicatedHostProfileDiskQuantity') -> bool:
+ 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: 'DedicatedHostProfileDiskQuantity') -> bool:
+ def __ne__(self, other: 'DedicatedHostGroupReference') -> 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'
+ DEDICATED_HOST_GROUP = 'dedicated_host_group'
-class DedicatedHostProfileDiskSize:
+class DedicatedHostGroupReferenceDeleted:
"""
- 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).
+ :param str more_info: Link to documentation about deleted resources.
"""
def __init__(
self,
- type: str,
- value: int,
+ more_info: str,
) -> None:
"""
- Initialize a DedicatedHostProfileDiskSize object.
+ Initialize a DedicatedHostGroupReferenceDeleted 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) -> 'DedicatedHostGroupReferenceDeleted':
+ """Initialize a DedicatedHostGroupReferenceDeleted 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 := _dict.get('more_info')) is not None:
+ args['more_info'] = more_info
else:
- raise ValueError('Required property \'value\' not present in DedicatedHostProfileDiskSize JSON')
+ raise ValueError('Required property \'more_info\' not present in DedicatedHostGroupReferenceDeleted JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a DedicatedHostProfileDiskSize object from a json dictionary."""
+ """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, '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):
@@ -33949,78 +36351,76 @@ 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 DedicatedHostGroupReferenceDeleted object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'DedicatedHostProfileDiskSize') -> bool:
+ def __eq__(self, other: 'DedicatedHostGroupReferenceDeleted') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'DedicatedHostProfileDiskSize') -> bool:
+ def __ne__(self, other: 'DedicatedHostGroupReferenceDeleted') -> 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 DedicatedHostNUMA:
"""
- DedicatedHostProfileDiskSupportedInterfaces.
+ The dedicated host NUMA configuration.
- :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.
+ :param int count: The total number of NUMA nodes for this dedicated host.
+ :param List[DedicatedHostNUMANode] nodes: The NUMA nodes for this dedicated
+ host.
"""
def __init__(
self,
- type: str,
- value: List[str],
+ count: int,
+ nodes: List['DedicatedHostNUMANode'],
) -> None:
"""
- Initialize a DedicatedHostProfileDiskSupportedInterfaces object.
+ Initialize a DedicatedHostNUMA 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 int count: The total number of NUMA nodes for this dedicated host.
+ :param List[DedicatedHostNUMANode] nodes: The NUMA nodes for this dedicated
+ host.
"""
- self.type = type
- self.value = value
+ self.count = count
+ self.nodes = nodes
@classmethod
- def from_dict(cls, _dict: Dict) -> 'DedicatedHostProfileDiskSupportedInterfaces':
- """Initialize a DedicatedHostProfileDiskSupportedInterfaces object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'DedicatedHostNUMA':
+ """Initialize a DedicatedHostNUMA object from a json dictionary."""
args = {}
- if 'type' in _dict:
- args['type'] = _dict.get('type')
+ if (count := _dict.get('count')) is not None:
+ args['count'] = count
else:
- raise ValueError('Required property \'type\' not present in DedicatedHostProfileDiskSupportedInterfaces JSON')
- if 'value' in _dict:
- args['value'] = _dict.get('value')
+ raise ValueError('Required property \'count\' not present in DedicatedHostNUMA JSON')
+ if (nodes := _dict.get('nodes')) is not None:
+ args['nodes'] = [DedicatedHostNUMANode.from_dict(v) for v in nodes]
else:
- raise ValueError('Required property \'value\' not present in DedicatedHostProfileDiskSupportedInterfaces JSON')
+ raise ValueError('Required property \'nodes\' not present in DedicatedHostNUMA JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a DedicatedHostProfileDiskSupportedInterfaces object from a json dictionary."""
+ """Initialize a DedicatedHostNUMA object from 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, 'count') and self.count is not None:
+ _dict['count'] = self.count
+ if hasattr(self, 'nodes') and self.nodes is not None:
+ nodes_list = []
+ for v in self.nodes:
+ if isinstance(v, dict):
+ nodes_list.append(v)
+ else:
+ nodes_list.append(v.to_dict())
+ _dict['nodes'] = nodes_list
return _dict
def _to_dict(self):
@@ -34028,127 +36428,68 @@ 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 DedicatedHostNUMA object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'DedicatedHostProfileDiskSupportedInterfaces') -> bool:
+ def __eq__(self, other: 'DedicatedHostNUMA') -> bool:
"""Return `true` when 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: 'DedicatedHostNUMA') -> 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 DedicatedHostNUMANode:
"""
- DedicatedHostProfileReference.
+ The dedicated host NUMA node configuration.
- :attr str href: The URL for this dedicated host.
- :attr str name: The globally unique name for this dedicated host profile.
+ :param int available_vcpu: The available VCPU for this NUMA node.
+ :param int vcpu: The total VCPU capacity for this NUMA node.
"""
def __init__(
self,
- href: str,
- name: str,
+ available_vcpu: int,
+ vcpu: int,
) -> None:
"""
- Initialize a DedicatedHostProfileReference object.
+ Initialize a DedicatedHostNUMANode object.
- :param str href: The URL for this dedicated host.
- :param str name: The globally unique name for this dedicated host profile.
+ :param int available_vcpu: The available VCPU for this NUMA node.
+ :param int vcpu: The total VCPU capacity for this NUMA node.
"""
- self.href = href
- self.name = name
+ self.available_vcpu = available_vcpu
+ self.vcpu = vcpu
@classmethod
- def from_dict(cls, _dict: Dict) -> 'DedicatedHostProfileReference':
- """Initialize a DedicatedHostProfileReference object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'DedicatedHostNUMANode':
+ """Initialize a DedicatedHostNUMANode object from a json dictionary."""
args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ if (available_vcpu := _dict.get('available_vcpu')) is not None:
+ args['available_vcpu'] = available_vcpu
else:
- raise ValueError('Required property \'href\' not present in DedicatedHostProfileReference JSON')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
+ raise ValueError('Required property \'available_vcpu\' not present in DedicatedHostNUMANode JSON')
+ if (vcpu := _dict.get('vcpu')) is not None:
+ args['vcpu'] = vcpu
else:
- raise ValueError('Required property \'name\' not present in DedicatedHostProfileReference JSON')
+ raise ValueError('Required property \'vcpu\' not present in DedicatedHostNUMANode JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a DedicatedHostProfileReference object from a json dictionary."""
+ """Initialize a DedicatedHostNUMANode object from 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, 'available_vcpu') and self.available_vcpu is not None:
+ _dict['available_vcpu'] = self.available_vcpu
+ if hasattr(self, 'vcpu') and self.vcpu is not None:
+ _dict['vcpu'] = self.vcpu
return _dict
def _to_dict(self):
@@ -34156,107 +36497,69 @@ 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 DedicatedHostNUMANode object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'DedicatedHostProfileReference') -> bool:
+ def __eq__(self, other: 'DedicatedHostNUMANode') -> bool:
"""Return `true` when 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: 'DedicatedHostNUMANode') -> 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:
+class DedicatedHostPatch:
"""
- DedicatedHostProfileVCPUArchitecture.
+ DedicatedHostPatch.
- :attr str type: The type for this profile field.
- :attr str value: The VCPU architecture for a dedicated host with this profile.
+ :param bool instance_placement_enabled: (optional) If set to true, instances can
+ be placed on this dedicated host.
+ :param str name: (optional) The name for this dedicated host. The name must not
+ be used by another dedicated host in the region.
"""
def __init__(
self,
- type: str,
- value: str,
+ *,
+ instance_placement_enabled: Optional[bool] = None,
+ name: Optional[str] = None,
) -> None:
"""
- Initialize a DedicatedHostProfileVCPUArchitecture object.
+ Initialize a DedicatedHostPatch object.
- :param str type: The type for this profile field.
- :param str value: The VCPU architecture for a dedicated host with this
- profile.
+ :param bool instance_placement_enabled: (optional) If set to true,
+ instances can be placed on this dedicated host.
+ :param str name: (optional) The name for this dedicated host. The name must
+ not be used by another dedicated host in the region.
"""
- self.type = type
- self.value = value
+ self.instance_placement_enabled = instance_placement_enabled
+ self.name = name
@classmethod
- def from_dict(cls, _dict: Dict) -> 'DedicatedHostProfileVCPUArchitecture':
- """Initialize a DedicatedHostProfileVCPUArchitecture object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'DedicatedHostPatch':
+ """Initialize a DedicatedHostPatch 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')
+ if (instance_placement_enabled := _dict.get('instance_placement_enabled')) is not None:
+ args['instance_placement_enabled'] = instance_placement_enabled
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a DedicatedHostProfileVCPUArchitecture object from a json dictionary."""
+ """Initialize a DedicatedHostPatch object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, '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, '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):
@@ -34264,77 +36567,235 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this DedicatedHostProfileVCPUArchitecture object."""
+ """Return a `str` version of this DedicatedHostPatch object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'DedicatedHostProfileVCPUArchitecture') -> bool:
+ def __eq__(self, other: 'DedicatedHostPatch') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'DedicatedHostProfileVCPUArchitecture') -> bool:
+ def __ne__(self, other: 'DedicatedHostPatch') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class TypeEnum(str, Enum):
- """
- The type for this profile field.
- """
-
- FIXED = 'fixed'
-
-
-class DedicatedHostProfileVCPUManufacturer:
+class DedicatedHostProfile:
"""
- DedicatedHostProfileVCPUManufacturer.
+ DedicatedHostProfile.
- :attr str type: The type for this profile field.
- :attr str value: The VCPU manufacturer for a dedicated host with this profile.
+ :param str class_: The product class this dedicated host profile belongs to.
+ :param List[DedicatedHostProfileDisk] disks: Collection of the dedicated host
+ profile's disks.
+ :param str family: The product family this dedicated host profile belongs to
+ The enumerated values for this property are expected to expand in the future.
+ When processing this property, check for and log unknown values. Optionally halt
+ processing and surface the error, or bypass the resource on which the unexpected
+ property value was encountered.
+ :param str href: The URL for this dedicated host.
+ :param DedicatedHostProfileMemory memory:
+ :param str name: The globally unique name for this dedicated host profile.
+ :param DedicatedHostProfileSocket socket_count:
+ :param str status: The status of the dedicated host profile:
+ - `previous`: This dedicated host profile is an older revision, but remains
+ provisionable
+ and usable.
+ - `current`: This profile is the latest revision.
+ Note that revisions are indicated by the generation of a dedicated host profile.
+ Refer to the [profile naming conventions]
+ (https://cloud.ibm.com/docs/vpc?topic=vpc-dh-profiles&interface=ui#profiles-naming-rule)
+ for information on how generations are defined within a dedicated host 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 profile on which the unexpected
+ property value was encountered.
+ :param List[InstanceProfileReference] supported_instance_profiles: The instance
+ profiles usable by instances placed on dedicated hosts with this profile.
+ :param DedicatedHostProfileVCPUArchitecture vcpu_architecture:
+ :param DedicatedHostProfileVCPU vcpu_count:
+ :param DedicatedHostProfileVCPUManufacturer vcpu_manufacturer:
"""
def __init__(
self,
- type: str,
- value: str,
- ) -> None:
- """
- Initialize a DedicatedHostProfileVCPUManufacturer object.
-
- :param str type: The type for this profile field.
- :param str value: The VCPU manufacturer for a dedicated host with this
- profile.
- """
- self.type = type
- self.value = value
+ class_: str,
+ disks: List['DedicatedHostProfileDisk'],
+ family: str,
+ href: str,
+ memory: 'DedicatedHostProfileMemory',
+ name: str,
+ socket_count: 'DedicatedHostProfileSocket',
+ status: str,
+ supported_instance_profiles: List['InstanceProfileReference'],
+ vcpu_architecture: 'DedicatedHostProfileVCPUArchitecture',
+ vcpu_count: 'DedicatedHostProfileVCPU',
+ vcpu_manufacturer: 'DedicatedHostProfileVCPUManufacturer',
+ ) -> 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 str status: The status of the dedicated host profile:
+ - `previous`: This dedicated host profile is an older revision, but
+ remains provisionable
+ and usable.
+ - `current`: This profile is the latest revision.
+ Note that revisions are indicated by the generation of a dedicated host
+ profile. Refer to the [profile naming conventions]
+ (https://cloud.ibm.com/docs/vpc?topic=vpc-dh-profiles&interface=ui#profiles-naming-rule)
+ for information on how generations are defined within a dedicated host
+ 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 profile on
+ which the unexpected property value was encountered.
+ :param List[InstanceProfileReference] supported_instance_profiles: The
+ instance profiles usable by instances placed on dedicated hosts with this
+ profile.
+ :param DedicatedHostProfileVCPUArchitecture vcpu_architecture:
+ :param DedicatedHostProfileVCPU vcpu_count:
+ :param DedicatedHostProfileVCPUManufacturer vcpu_manufacturer:
+ """
+ self.class_ = class_
+ self.disks = disks
+ self.family = family
+ self.href = href
+ self.memory = memory
+ self.name = name
+ self.socket_count = socket_count
+ self.status = status
+ self.supported_instance_profiles = supported_instance_profiles
+ self.vcpu_architecture = vcpu_architecture
+ self.vcpu_count = vcpu_count
+ self.vcpu_manufacturer = vcpu_manufacturer
@classmethod
- def from_dict(cls, _dict: Dict) -> 'DedicatedHostProfileVCPUManufacturer':
- """Initialize a DedicatedHostProfileVCPUManufacturer object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'DedicatedHostProfile':
+ """Initialize a DedicatedHostProfile object from a json dictionary."""
args = {}
- if 'type' in _dict:
- args['type'] = _dict.get('type')
+ if (class_ := _dict.get('class')) is not None:
+ args['class_'] = class_
else:
- raise ValueError('Required property \'type\' not present in DedicatedHostProfileVCPUManufacturer JSON')
- if 'value' in _dict:
- args['value'] = _dict.get('value')
+ raise ValueError('Required property \'class\' not present in DedicatedHostProfile JSON')
+ if (disks := _dict.get('disks')) is not None:
+ args['disks'] = [DedicatedHostProfileDisk.from_dict(v) for v in disks]
else:
- raise ValueError('Required property \'value\' not present in DedicatedHostProfileVCPUManufacturer JSON')
+ raise ValueError('Required property \'disks\' not present in DedicatedHostProfile JSON')
+ if (family := _dict.get('family')) is not None:
+ args['family'] = family
+ else:
+ raise ValueError('Required property \'family\' not present in DedicatedHostProfile JSON')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
+ else:
+ raise ValueError('Required property \'href\' not present in DedicatedHostProfile JSON')
+ if (memory := _dict.get('memory')) is not None:
+ args['memory'] = memory
+ else:
+ raise ValueError('Required property \'memory\' not present in DedicatedHostProfile JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ else:
+ raise ValueError('Required property \'name\' not present in DedicatedHostProfile JSON')
+ if (socket_count := _dict.get('socket_count')) is not None:
+ args['socket_count'] = socket_count
+ else:
+ raise ValueError('Required property \'socket_count\' not present in DedicatedHostProfile JSON')
+ if (status := _dict.get('status')) is not None:
+ args['status'] = status
+ else:
+ raise ValueError('Required property \'status\' not present in DedicatedHostProfile JSON')
+ if (supported_instance_profiles := _dict.get('supported_instance_profiles')) is not None:
+ args['supported_instance_profiles'] = [InstanceProfileReference.from_dict(v) for v in supported_instance_profiles]
+ else:
+ raise ValueError('Required property \'supported_instance_profiles\' not present in DedicatedHostProfile JSON')
+ if (vcpu_architecture := _dict.get('vcpu_architecture')) is not None:
+ args['vcpu_architecture'] = DedicatedHostProfileVCPUArchitecture.from_dict(vcpu_architecture)
+ else:
+ raise ValueError('Required property \'vcpu_architecture\' not present in DedicatedHostProfile JSON')
+ if (vcpu_count := _dict.get('vcpu_count')) is not None:
+ args['vcpu_count'] = vcpu_count
+ else:
+ raise ValueError('Required property \'vcpu_count\' not present in DedicatedHostProfile JSON')
+ if (vcpu_manufacturer := _dict.get('vcpu_manufacturer')) is not None:
+ args['vcpu_manufacturer'] = DedicatedHostProfileVCPUManufacturer.from_dict(vcpu_manufacturer)
+ else:
+ raise ValueError('Required property \'vcpu_manufacturer\' not present in DedicatedHostProfile JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a DedicatedHostProfileVCPUManufacturer object from a json dictionary."""
+ """Initialize a DedicatedHostProfile object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, '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, 'class_') and self.class_ is not None:
+ _dict['class'] = self.class_
+ if hasattr(self, 'disks') and self.disks is not None:
+ disks_list = []
+ for v in self.disks:
+ if isinstance(v, dict):
+ disks_list.append(v)
+ else:
+ disks_list.append(v.to_dict())
+ _dict['disks'] = disks_list
+ if hasattr(self, 'family') and self.family is not None:
+ _dict['family'] = self.family
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
+ if hasattr(self, 'memory') and self.memory is not None:
+ if isinstance(self.memory, dict):
+ _dict['memory'] = self.memory
+ else:
+ _dict['memory'] = self.memory.to_dict()
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ if hasattr(self, 'socket_count') and self.socket_count is not None:
+ if isinstance(self.socket_count, dict):
+ _dict['socket_count'] = self.socket_count
+ else:
+ _dict['socket_count'] = self.socket_count.to_dict()
+ if hasattr(self, 'status') and self.status is not None:
+ _dict['status'] = self.status
+ if hasattr(self, 'supported_instance_profiles') and self.supported_instance_profiles is not None:
+ supported_instance_profiles_list = []
+ for v in self.supported_instance_profiles:
+ if isinstance(v, dict):
+ supported_instance_profiles_list.append(v)
+ else:
+ supported_instance_profiles_list.append(v.to_dict())
+ _dict['supported_instance_profiles'] = supported_instance_profiles_list
+ if hasattr(self, 'vcpu_architecture') and self.vcpu_architecture is not None:
+ if isinstance(self.vcpu_architecture, dict):
+ _dict['vcpu_architecture'] = self.vcpu_architecture
+ else:
+ _dict['vcpu_architecture'] = self.vcpu_architecture.to_dict()
+ if hasattr(self, 'vcpu_count') and self.vcpu_count is not None:
+ if isinstance(self.vcpu_count, dict):
+ _dict['vcpu_count'] = self.vcpu_count
+ else:
+ _dict['vcpu_count'] = self.vcpu_count.to_dict()
+ if hasattr(self, 'vcpu_manufacturer') and self.vcpu_manufacturer is not None:
+ if isinstance(self.vcpu_manufacturer, dict):
+ _dict['vcpu_manufacturer'] = self.vcpu_manufacturer
+ else:
+ _dict['vcpu_manufacturer'] = self.vcpu_manufacturer.to_dict()
return _dict
def _to_dict(self):
@@ -34342,173 +36803,154 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this DedicatedHostProfileVCPUManufacturer object."""
+ """Return a `str` version of this DedicatedHostProfile object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'DedicatedHostProfileVCPUManufacturer') -> bool:
+ def __eq__(self, other: 'DedicatedHostProfile') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'DedicatedHostProfileVCPUManufacturer') -> bool:
+ def __ne__(self, other: 'DedicatedHostProfile') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class TypeEnum(str, Enum):
+ class FamilyEnum(str, Enum):
"""
- The type for this profile field.
+ 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.
"""
- FIXED = 'fixed'
-
-
-
-class DedicatedHostPrototype:
- """
- DedicatedHostPrototype.
+ BALANCED = 'balanced'
+ COMPUTE = 'compute'
+ MEMORY = 'memory'
- :attr bool instance_placement_enabled: (optional) If set to true, instances can
- be placed on this dedicated host.
- :attr str name: (optional) The name for this dedicated host. The name must not
- be used by another dedicated host in the region. If unspecified, the name will
- be a hyphenated list of randomly-selected words.
- :attr DedicatedHostProfileIdentity profile: The
- [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-dh-profiles) to use for this
- dedicated host.
- :attr ResourceGroupIdentity resource_group: (optional) The resource group to
- use. If unspecified, the account's [default resource
- group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be
- used.
- """
- def __init__(
- self,
- profile: 'DedicatedHostProfileIdentity',
- *,
- instance_placement_enabled: bool = None,
- name: str = None,
- resource_group: 'ResourceGroupIdentity' = None,
- ) -> None:
+ class StatusEnum(str, Enum):
"""
- Initialize a DedicatedHostPrototype object.
-
- :param DedicatedHostProfileIdentity profile: The
- [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-dh-profiles) to use for
- this
- dedicated host.
- :param bool instance_placement_enabled: (optional) If set to true,
- instances can be placed on this dedicated host.
- :param str name: (optional) The name for this dedicated host. The name must
- not be used by another dedicated host in the region. If unspecified, the
- name will be a hyphenated list of randomly-selected words.
- :param ResourceGroupIdentity resource_group: (optional) The resource group
- to use. If unspecified, the account's [default resource
- group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be
- used.
+ The status of the dedicated host profile:
+ - `previous`: This dedicated host profile is an older revision, but remains
+ provisionable
+ and usable.
+ - `current`: This profile is the latest revision.
+ Note that revisions are indicated by the generation of a dedicated host profile.
+ Refer to the [profile naming conventions]
+ (https://cloud.ibm.com/docs/vpc?topic=vpc-dh-profiles&interface=ui#profiles-naming-rule)
+ for information on how generations are defined within a dedicated host 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 profile on which the unexpected
+ property value was encountered.
"""
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['DedicatedHostPrototypeDedicatedHostByGroup', 'DedicatedHostPrototypeDedicatedHostByZone'])
- )
- raise Exception(msg)
+ CURRENT = 'current'
+ PREVIOUS = 'previous'
-class DedicatedHostReference:
+
+
+class DedicatedHostProfileCollection:
"""
- DedicatedHostReference.
+ DedicatedHostProfileCollection.
- :attr str crn: The CRN for this dedicated host.
- :attr DedicatedHostReferenceDeleted deleted: (optional) If present, this
- property indicates the referenced resource has been deleted, and provides
- some supplementary information.
- :attr str href: The URL for this dedicated host.
- :attr str id: The unique identifier for this dedicated host.
- :attr str name: The name for this dedicated host. The name is unique across all
- dedicated hosts in the region.
- :attr str resource_type: The resource type.
+ :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 DedicatedHostProfileCollectionNext next: (optional) A link to the next
+ page of resources. This property is present for all pages
+ except the last page.
+ :param List[DedicatedHostProfile] profiles: Collection of dedicated host
+ profiles.
+ :param 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: 'DedicatedHostProfileCollectionFirst',
+ limit: int,
+ profiles: List['DedicatedHostProfile'],
+ total_count: int,
*,
- deleted: 'DedicatedHostReferenceDeleted' = None,
+ next: Optional['DedicatedHostProfileCollectionNext'] = None,
) -> None:
"""
- Initialize a DedicatedHostReference object.
+ Initialize a DedicatedHostProfileCollection object.
- :param str crn: The CRN for this dedicated host.
- :param str href: The URL for this dedicated host.
- :param str id: The unique identifier for this dedicated host.
- :param str name: The name for this dedicated host. The name is unique
- across all dedicated hosts in the region.
- :param str resource_type: The resource type.
- :param DedicatedHostReferenceDeleted deleted: (optional) If present, this
- property indicates the referenced resource has been deleted, and provides
- some supplementary information.
+ :param 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.crn = crn
- self.deleted = deleted
- self.href = href
- self.id = id
- self.name = name
- self.resource_type = resource_type
+ self.first = first
+ self.limit = limit
+ self.next = next
+ self.profiles = profiles
+ 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) -> 'DedicatedHostProfileCollection':
+ """Initialize a DedicatedHostProfileCollection 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 := _dict.get('first')) is not None:
+ args['first'] = DedicatedHostProfileCollectionFirst.from_dict(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 DedicatedHostProfileCollection JSON')
+ if (limit := _dict.get('limit')) is not None:
+ args['limit'] = limit
else:
- raise ValueError('Required property \'id\' not present in DedicatedHostReference JSON')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
+ raise ValueError('Required property \'limit\' not present in DedicatedHostProfileCollection JSON')
+ if (next := _dict.get('next')) is not None:
+ args['next'] = DedicatedHostProfileCollectionNext.from_dict(next)
+ if (profiles := _dict.get('profiles')) is not None:
+ args['profiles'] = [DedicatedHostProfile.from_dict(v) for v in profiles]
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 \'profiles\' not present in DedicatedHostProfileCollection JSON')
+ if (total_count := _dict.get('total_count')) is not None:
+ args['total_count'] = total_count
else:
- raise ValueError('Required property \'resource_type\' not present in DedicatedHostReference JSON')
+ raise ValueError('Required property \'total_count\' not present in DedicatedHostProfileCollection JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a DedicatedHostReference object from a json dictionary."""
+ """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, 'crn') and self.crn is not None:
- _dict['crn'] = self.crn
- if hasattr(self, 'deleted') and self.deleted is not None:
- if isinstance(self.deleted, dict):
- _dict['deleted'] = self.deleted
+ if hasattr(self, 'first') and self.first is not None:
+ if isinstance(self.first, dict):
+ _dict['first'] = self.first
else:
- _dict['deleted'] = self.deleted.to_dict()
- if hasattr(self, 'href') and self.href is not None:
- _dict['href'] = self.href
- if hasattr(self, 'id') and self.id is not None:
- _dict['id'] = self.id
- if hasattr(self, 'name') and self.name is not None:
- _dict['name'] = self.name
- if hasattr(self, 'resource_type') and self.resource_type is not None:
- _dict['resource_type'] = self.resource_type
+ _dict['first'] = self.first.to_dict()
+ if hasattr(self, 'limit') and self.limit is not None:
+ _dict['limit'] = self.limit
+ if hasattr(self, 'next') and self.next is not None:
+ if isinstance(self.next, dict):
+ _dict['next'] = self.next
+ else:
+ _dict['next'] = self.next.to_dict()
+ if hasattr(self, 'profiles') and self.profiles is not None:
+ profiles_list = []
+ for v in self.profiles:
+ if isinstance(v, dict):
+ profiles_list.append(v)
+ else:
+ profiles_list.append(v.to_dict())
+ _dict['profiles'] = profiles_list
+ if hasattr(self, 'total_count') and self.total_count is not None:
+ _dict['total_count'] = self.total_count
return _dict
def _to_dict(self):
@@ -34516,67 +36958,58 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this DedicatedHostReference object."""
+ """Return a `str` version of this DedicatedHostProfileCollection object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'DedicatedHostReference') -> bool:
+ def __eq__(self, other: 'DedicatedHostProfileCollection') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'DedicatedHostReference') -> bool:
+ def __ne__(self, other: 'DedicatedHostProfileCollection') -> 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 DedicatedHostProfileCollectionFirst:
"""
- 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.
+ :param str href: The URL for a page of resources.
"""
def __init__(
self,
- more_info: str,
+ href: str,
) -> None:
"""
- Initialize a DedicatedHostReferenceDeleted object.
+ Initialize a DedicatedHostProfileCollectionFirst 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) -> 'DedicatedHostProfileCollectionFirst':
+ """Initialize a DedicatedHostProfileCollectionFirst object from a json dictionary."""
args = {}
- if 'more_info' in _dict:
- args['more_info'] = _dict.get('more_info')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'more_info\' not present in DedicatedHostReferenceDeleted JSON')
+ raise ValueError('Required property \'href\' not present in DedicatedHostProfileCollectionFirst JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a DedicatedHostReferenceDeleted object from a json dictionary."""
+ """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, '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):
@@ -34584,173 +37017,59 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this DedicatedHostReferenceDeleted object."""
+ """Return a `str` version of this DedicatedHostProfileCollectionFirst object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'DedicatedHostReferenceDeleted') -> bool:
+ def __eq__(self, other: 'DedicatedHostProfileCollectionFirst') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'DedicatedHostReferenceDeleted') -> bool:
+ def __ne__(self, other: 'DedicatedHostProfileCollectionFirst') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class DefaultNetworkACL:
+class DedicatedHostProfileCollectionNext:
"""
- DefaultNetworkACL.
+ A link to the next page of resources. This property is present for all pages except
+ the last page.
- :attr datetime created_at: The date and time that the network ACL was created.
- :attr str crn: The CRN for this network ACL.
- :attr str href: The URL for this network ACL.
- :attr str id: The unique identifier for this network ACL.
- :attr str name: The name of the default network ACL created for a VPC. The name
- will be a hyphenated list of randomly-selected words at creation, but may be
- changed.
- :attr ResourceGroupReference resource_group: The resource group for the default
- network ACL for a VPC. Set to the VPC's
- resource group at creation.
- :attr List[NetworkACLRuleItem] rules: The ordered rules for the default network
- ACL for a VPC. Defaults to two rules which allow all inbound and outbound
- traffic, respectively. Rules for the default network ACL may be changed, added,
- or removed.
- :attr List[SubnetReference] subnets: The subnets to which this network ACL is
- attached.
- :attr VPCReference vpc: The VPC this network ACL resides in.
+ :param str href: The URL for a page of resources.
"""
def __init__(
self,
- created_at: datetime,
- crn: str,
href: str,
- id: str,
- name: str,
- resource_group: 'ResourceGroupReference',
- rules: List['NetworkACLRuleItem'],
- subnets: List['SubnetReference'],
- vpc: 'VPCReference',
) -> None:
"""
- Initialize a DefaultNetworkACL object.
+ Initialize a DedicatedHostProfileCollectionNext object.
- :param datetime created_at: The date and time that the network ACL was
- created.
- :param str crn: The CRN for this network ACL.
- :param str href: The URL for this network ACL.
- :param str id: The unique identifier for this network ACL.
- :param str name: The name of the default network ACL created for a VPC. The
- name will be a hyphenated list of randomly-selected words at creation, but
- may be changed.
- :param ResourceGroupReference resource_group: The resource group for the
- default network ACL for a VPC. Set to the VPC's
- resource group at creation.
- :param List[NetworkACLRuleItem] rules: The ordered rules for the default
- network ACL for a VPC. Defaults to two rules which allow all inbound and
- outbound traffic, respectively. Rules for the default network ACL may be
- changed, added, or removed.
- :param List[SubnetReference] subnets: The subnets to which this network ACL
- is attached.
- :param VPCReference vpc: The VPC this network ACL resides in.
+ :param str href: The URL for a page of resources.
"""
- self.created_at = created_at
- self.crn = crn
self.href = href
- self.id = id
- self.name = name
- self.resource_group = resource_group
- self.rules = rules
- self.subnets = subnets
- self.vpc = vpc
@classmethod
- def from_dict(cls, _dict: Dict) -> 'DefaultNetworkACL':
- """Initialize a DefaultNetworkACL object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'DedicatedHostProfileCollectionNext':
+ """Initialize a DedicatedHostProfileCollectionNext 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')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'href\' not present in DefaultNetworkACL JSON')
- if 'id' in _dict:
- args['id'] = _dict.get('id')
- else:
- raise ValueError('Required property \'id\' not present in DefaultNetworkACL JSON')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
- else:
- raise ValueError('Required property \'name\' not present in DefaultNetworkACL JSON')
- if 'resource_group' in _dict:
- args['resource_group'] = ResourceGroupReference.from_dict(_dict.get('resource_group'))
- else:
- raise ValueError('Required property \'resource_group\' not present in DefaultNetworkACL JSON')
- if 'rules' in _dict:
- args['rules'] = [NetworkACLRuleItem.from_dict(v) for v in _dict.get('rules')]
- else:
- raise ValueError('Required property \'rules\' not present in DefaultNetworkACL JSON')
- if 'subnets' in _dict:
- args['subnets'] = [SubnetReference.from_dict(v) for v in _dict.get('subnets')]
- else:
- raise ValueError('Required property \'subnets\' not present in DefaultNetworkACL JSON')
- if 'vpc' in _dict:
- args['vpc'] = VPCReference.from_dict(_dict.get('vpc'))
- else:
- raise ValueError('Required property \'vpc\' not present in DefaultNetworkACL JSON')
+ raise ValueError('Required property \'href\' not present in DedicatedHostProfileCollectionNext JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a DefaultNetworkACL object from a json dictionary."""
+ """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, 'created_at') and self.created_at is not None:
- _dict['created_at'] = datetime_to_string(self.created_at)
- if hasattr(self, 'crn') and self.crn is not None:
- _dict['crn'] = self.crn
if hasattr(self, 'href') and self.href is not None:
_dict['href'] = self.href
- if hasattr(self, 'id') and self.id is not None:
- _dict['id'] = self.id
- if hasattr(self, 'name') and self.name is not None:
- _dict['name'] = self.name
- if hasattr(self, 'resource_group') and self.resource_group is not None:
- if isinstance(self.resource_group, dict):
- _dict['resource_group'] = self.resource_group
- else:
- _dict['resource_group'] = self.resource_group.to_dict()
- if hasattr(self, 'rules') and self.rules is not None:
- rules_list = []
- for v in self.rules:
- if isinstance(v, dict):
- rules_list.append(v)
- else:
- rules_list.append(v.to_dict())
- _dict['rules'] = rules_list
- if hasattr(self, 'subnets') and self.subnets is not None:
- subnets_list = []
- for v in self.subnets:
- if isinstance(v, dict):
- subnets_list.append(v)
- else:
- subnets_list.append(v.to_dict())
- _dict['subnets'] = subnets_list
- if hasattr(self, 'vpc') and self.vpc is not None:
- if isinstance(self.vpc, dict):
- _dict['vpc'] = self.vpc
- else:
- _dict['vpc'] = self.vpc.to_dict()
return _dict
def _to_dict(self):
@@ -34758,297 +37077,106 @@ 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 DedicatedHostProfileCollectionNext object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'DefaultNetworkACL') -> bool:
+ def __eq__(self, other: 'DedicatedHostProfileCollectionNext') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'DefaultNetworkACL') -> bool:
+ def __ne__(self, other: 'DedicatedHostProfileCollectionNext') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class DefaultRoutingTable:
+class DedicatedHostProfileDisk:
"""
- DefaultRoutingTable.
+ Disks provided by this profile.
- :attr List[ResourceFilter] accept_routes_from: The filters specifying the
- resources that may create routes in this routing table.
- At present, only the `resource_type` filter is permitted, and only the
- `vpn_server` value is supported, but filter support is expected to expand in the
- future.
- :attr datetime created_at: The date and time that this routing table was
- created.
- :attr str href: The URL for this routing table.
- :attr str id: The unique identifier for this routing table.
- :attr bool is_default: Indicates whether this is the default routing table for
- this VPC.
- :attr str lifecycle_state: The lifecycle state of the routing table.
- :attr str name: The name of the default routing table created for this VPC. The
- name will be a hyphenated list of randomly-selected words at creation, but may
- be changed.
- :attr str resource_type: The resource type.
- :attr bool route_direct_link_ingress: Indicates whether this routing table is
- used to route traffic that originates from
- [Direct Link](https://cloud.ibm.com/docs/dl) to this VPC.
- Incoming traffic will be routed according to the routing table with one
- exception: routes with an `action` of `deliver` are treated as `drop` unless the
- `next_hop` is an IP address in a subnet in the route's `zone` that is able to
- accept traffic. Therefore, if an incoming packet matches a route with a
- `next_hop` of a VPN gateway connection, the packet will be dropped.
- :attr bool route_internet_ingress: Indicates whether this routing table is used
- to route traffic that originates from the internet.
- Incoming traffic will be routed according to the routing table with two
- exceptions:
- - Traffic destined for IP addresses associated with public gateways will not be
- subject to routes in this routing table.
- - Routes with an `action` of `deliver` are treated as `drop` unless the
- `next_hop` is
- an IP address in a subnet in the route's `zone` that is able to accept
- traffic.
- Therefore, if an incoming packet matches a route with a `next_hop` of a VPN
- gateway
- connection, the packet will be dropped.
- :attr bool route_transit_gateway_ingress: Indicates whether this routing table
- is used to route traffic that originates from from [Transit
- Gateway](https://cloud.ibm.com/docs/transit-gateway) to this VPC.
- Incoming traffic will be routed according to the routing table with one
- exception: routes with an `action` of `deliver` are treated as `drop` unless the
- `next_hop` is an IP address in a subnet in the route's `zone` that is able to
- accept traffic. Therefore, if an incoming packet matches a route with a
- `next_hop` of a VPN gateway connection, the packet will be dropped.
- :attr bool route_vpc_zone_ingress: Indicates whether this routing table is used
- to route traffic that originates from subnets in other zones in this VPC.
- Incoming traffic will be routed according to the routing table with one
- exception: routes with an `action` of `deliver` are treated as `drop` unless the
- `next_hop` is an IP address in a subnet in the route's `zone` that is able to
- accept traffic. Therefore, if an incoming packet matches a route with a
- `next_hop` of 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.
+ :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:
"""
def __init__(
self,
- accept_routes_from: List['ResourceFilter'],
- created_at: datetime,
- href: str,
- id: str,
- is_default: bool,
- lifecycle_state: str,
- name: str,
- resource_type: str,
- route_direct_link_ingress: bool,
- route_internet_ingress: bool,
- route_transit_gateway_ingress: bool,
- route_vpc_zone_ingress: bool,
- routes: List['RouteReference'],
- subnets: List['SubnetReference'],
+ interface_type: 'DedicatedHostProfileDiskInterface',
+ quantity: 'DedicatedHostProfileDiskQuantity',
+ size: 'DedicatedHostProfileDiskSize',
+ supported_instance_interface_types: 'DedicatedHostProfileDiskSupportedInterfaces',
) -> None:
"""
- Initialize a DefaultRoutingTable object.
+ Initialize a DedicatedHostProfileDisk object.
- :param List[ResourceFilter] accept_routes_from: The filters specifying the
- resources that may create routes in this routing table.
- At present, only the `resource_type` filter is permitted, and only the
- `vpn_server` value is supported, but filter support is expected to expand
- in the future.
- :param datetime created_at: The date and time that this routing table was
- created.
- :param str href: The URL for this routing table.
- :param str id: The unique identifier for this routing table.
- :param bool is_default: Indicates whether this is the default routing table
- for this VPC.
- :param str lifecycle_state: The lifecycle state of the routing table.
- :param str name: The name of the default routing table created for this
- VPC. The name will be a hyphenated list of randomly-selected words at
- creation, but may be changed.
- :param str resource_type: The resource type.
- :param bool route_direct_link_ingress: Indicates whether this routing table
- is used to route traffic that originates from
- [Direct Link](https://cloud.ibm.com/docs/dl) to this VPC.
- Incoming traffic will be routed according to the routing table with one
- exception: routes with an `action` of `deliver` are treated as `drop`
- unless the `next_hop` is an IP address in a subnet in the route's `zone`
- that is able to accept traffic. Therefore, if an incoming packet matches a
- route with a `next_hop` of a VPN gateway connection, the packet will be
- dropped.
- :param bool route_internet_ingress: Indicates whether this routing table is
- used to route traffic that originates from the internet.
- Incoming traffic will be routed according to the routing table with two
- exceptions:
- - Traffic destined for IP addresses associated with public gateways will
- not be
- subject to routes in this routing table.
- - Routes with an `action` of `deliver` are treated as `drop` unless the
- `next_hop` is
- an IP address in a subnet in the route's `zone` that is able to accept
- traffic.
- Therefore, if an incoming packet matches a route with a `next_hop` of a
- VPN gateway
- connection, the packet will be dropped.
- :param bool route_transit_gateway_ingress: Indicates whether this routing
- table is used to route traffic that originates from from [Transit
- Gateway](https://cloud.ibm.com/docs/transit-gateway) to this VPC.
- Incoming traffic will be routed according to the routing table with one
- exception: routes with an `action` of `deliver` are treated as `drop`
- unless the `next_hop` is an IP address in a subnet in the route's `zone`
- that is able to accept traffic. Therefore, if an incoming packet matches a
- route with a `next_hop` of a VPN gateway connection, the packet will be
- dropped.
- :param bool route_vpc_zone_ingress: Indicates whether this routing table is
- used to route traffic that originates from subnets in other zones in this
- VPC.
- Incoming traffic will be routed according to the routing table with one
- exception: routes with an `action` of `deliver` are treated as `drop`
- unless the `next_hop` is an IP address in a subnet in the route's `zone`
- that is able to accept traffic. Therefore, if an incoming packet matches a
- route with a `next_hop` of 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 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.accept_routes_from = accept_routes_from
- self.created_at = created_at
- self.href = href
- self.id = id
- self.is_default = is_default
- self.lifecycle_state = lifecycle_state
- self.name = name
- self.resource_type = resource_type
- self.route_direct_link_ingress = route_direct_link_ingress
- self.route_internet_ingress = route_internet_ingress
- self.route_transit_gateway_ingress = route_transit_gateway_ingress
- self.route_vpc_zone_ingress = route_vpc_zone_ingress
- self.routes = routes
- self.subnets = subnets
+ 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) -> 'DefaultRoutingTable':
- """Initialize a DefaultRoutingTable object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'DedicatedHostProfileDisk':
+ """Initialize a DedicatedHostProfileDisk object from a json dictionary."""
args = {}
- if 'accept_routes_from' in _dict:
- args['accept_routes_from'] = [ResourceFilter.from_dict(v) for v in _dict.get('accept_routes_from')]
- else:
- raise ValueError('Required property \'accept_routes_from\' not present in DefaultRoutingTable JSON')
- if 'created_at' in _dict:
- args['created_at'] = string_to_datetime(_dict.get('created_at'))
- else:
- raise ValueError('Required property \'created_at\' not present in DefaultRoutingTable JSON')
- if 'href' in _dict:
- args['href'] = _dict.get('href')
- else:
- raise ValueError('Required property \'href\' not present in DefaultRoutingTable JSON')
- if 'id' in _dict:
- args['id'] = _dict.get('id')
- else:
- raise ValueError('Required property \'id\' not present in DefaultRoutingTable JSON')
- if 'is_default' in _dict:
- args['is_default'] = _dict.get('is_default')
- else:
- raise ValueError('Required property \'is_default\' not present in DefaultRoutingTable JSON')
- if 'lifecycle_state' in _dict:
- args['lifecycle_state'] = _dict.get('lifecycle_state')
- else:
- raise ValueError('Required property \'lifecycle_state\' not present in DefaultRoutingTable JSON')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
- else:
- raise ValueError('Required property \'name\' not present in DefaultRoutingTable JSON')
- if 'resource_type' in _dict:
- args['resource_type'] = _dict.get('resource_type')
- else:
- raise ValueError('Required property \'resource_type\' not present in DefaultRoutingTable JSON')
- if 'route_direct_link_ingress' in _dict:
- args['route_direct_link_ingress'] = _dict.get('route_direct_link_ingress')
- else:
- raise ValueError('Required property \'route_direct_link_ingress\' not present in DefaultRoutingTable JSON')
- if 'route_internet_ingress' in _dict:
- args['route_internet_ingress'] = _dict.get('route_internet_ingress')
- else:
- raise ValueError('Required property \'route_internet_ingress\' not present in DefaultRoutingTable JSON')
- if 'route_transit_gateway_ingress' in _dict:
- args['route_transit_gateway_ingress'] = _dict.get('route_transit_gateway_ingress')
+ if (interface_type := _dict.get('interface_type')) is not None:
+ args['interface_type'] = DedicatedHostProfileDiskInterface.from_dict(interface_type)
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')
+ raise ValueError('Required property \'interface_type\' not present in DedicatedHostProfileDisk JSON')
+ if (quantity := _dict.get('quantity')) is not None:
+ args['quantity'] = DedicatedHostProfileDiskQuantity.from_dict(quantity)
else:
- raise ValueError('Required property \'route_vpc_zone_ingress\' not present in DefaultRoutingTable JSON')
- if 'routes' in _dict:
- args['routes'] = [RouteReference.from_dict(v) for v in _dict.get('routes')]
+ raise ValueError('Required property \'quantity\' not present in DedicatedHostProfileDisk JSON')
+ if (size := _dict.get('size')) is not None:
+ args['size'] = DedicatedHostProfileDiskSize.from_dict(size)
else:
- raise ValueError('Required property \'routes\' not present in DefaultRoutingTable JSON')
- if 'subnets' in _dict:
- args['subnets'] = [SubnetReference.from_dict(v) for v in _dict.get('subnets')]
+ raise ValueError('Required property \'size\' not present in DedicatedHostProfileDisk JSON')
+ if (supported_instance_interface_types := _dict.get('supported_instance_interface_types')) is not None:
+ args['supported_instance_interface_types'] = DedicatedHostProfileDiskSupportedInterfaces.from_dict(supported_instance_interface_types)
else:
- raise ValueError('Required property \'subnets\' not present in DefaultRoutingTable JSON')
+ raise ValueError('Required property \'supported_instance_interface_types\' not present in DedicatedHostProfileDisk JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a DefaultRoutingTable object from a json dictionary."""
+ """Initialize a DedicatedHostProfileDisk object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'accept_routes_from') and self.accept_routes_from is not None:
- accept_routes_from_list = []
- for v in self.accept_routes_from:
- if isinstance(v, dict):
- accept_routes_from_list.append(v)
- else:
- accept_routes_from_list.append(v.to_dict())
- _dict['accept_routes_from'] = accept_routes_from_list
- if hasattr(self, 'created_at') and self.created_at is not None:
- _dict['created_at'] = datetime_to_string(self.created_at)
- if hasattr(self, 'href') and self.href is not None:
- _dict['href'] = self.href
- if hasattr(self, 'id') and self.id is not None:
- _dict['id'] = self.id
- if hasattr(self, 'is_default') and self.is_default is not None:
- _dict['is_default'] = self.is_default
- if hasattr(self, 'lifecycle_state') and self.lifecycle_state is not None:
- _dict['lifecycle_state'] = self.lifecycle_state
- if hasattr(self, 'name') and self.name is not None:
- _dict['name'] = self.name
- if hasattr(self, 'resource_type') and self.resource_type is not None:
- _dict['resource_type'] = self.resource_type
- if hasattr(self, 'route_direct_link_ingress') and self.route_direct_link_ingress is not None:
- _dict['route_direct_link_ingress'] = self.route_direct_link_ingress
- if hasattr(self, 'route_internet_ingress') and self.route_internet_ingress is not None:
- _dict['route_internet_ingress'] = self.route_internet_ingress
- if hasattr(self, 'route_transit_gateway_ingress') and self.route_transit_gateway_ingress is not None:
- _dict['route_transit_gateway_ingress'] = self.route_transit_gateway_ingress
- if hasattr(self, 'route_vpc_zone_ingress') and self.route_vpc_zone_ingress is not None:
- _dict['route_vpc_zone_ingress'] = self.route_vpc_zone_ingress
- if hasattr(self, 'routes') and self.routes is not None:
- routes_list = []
- for v in self.routes:
- if isinstance(v, dict):
- routes_list.append(v)
- else:
- routes_list.append(v.to_dict())
- _dict['routes'] = routes_list
- if hasattr(self, 'subnets') and self.subnets is not None:
- subnets_list = []
- for v in self.subnets:
- if isinstance(v, dict):
- subnets_list.append(v)
- else:
- subnets_list.append(v.to_dict())
- _dict['subnets'] = subnets_list
+ if hasattr(self, 'interface_type') and self.interface_type is not None:
+ if isinstance(self.interface_type, dict):
+ _dict['interface_type'] = self.interface_type
+ else:
+ _dict['interface_type'] = self.interface_type.to_dict()
+ if hasattr(self, 'quantity') and self.quantity is not None:
+ if isinstance(self.quantity, dict):
+ _dict['quantity'] = self.quantity
+ else:
+ _dict['quantity'] = self.quantity.to_dict()
+ if hasattr(self, 'size') and self.size is not None:
+ if isinstance(self.size, dict):
+ _dict['size'] = self.size
+ else:
+ _dict['size'] = self.size.to_dict()
+ if hasattr(self, 'supported_instance_interface_types') and self.supported_instance_interface_types is not None:
+ if isinstance(self.supported_instance_interface_types, dict):
+ _dict['supported_instance_interface_types'] = self.supported_instance_interface_types
+ else:
+ _dict['supported_instance_interface_types'] = self.supported_instance_interface_types.to_dict()
return _dict
def _to_dict(self):
@@ -35056,194 +37184,78 @@ 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 DedicatedHostProfileDisk object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'DefaultRoutingTable') -> bool:
+ def __eq__(self, other: 'DedicatedHostProfileDisk') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'DefaultRoutingTable') -> bool:
+ def __ne__(self, other: 'DedicatedHostProfileDisk') -> 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'
-
-
- class ResourceTypeEnum(str, Enum):
- """
- The resource type.
- """
-
- ROUTING_TABLE = 'routing_table'
-
-
-class DefaultSecurityGroup:
+class DedicatedHostProfileDiskInterface:
"""
- DefaultSecurityGroup.
+ DedicatedHostProfileDiskInterface.
- :attr datetime created_at: The date and time that this security group was
- created.
- :attr str crn: The security group's CRN.
- :attr str href: The security group's canonical URL.
- :attr str id: The unique identifier for this security group.
- :attr str name: The name for the default security group for a VPC. The name will
- be a hyphenated list of randomly-selected words at creation, but may changed.
- :attr ResourceGroupReference resource_group: The resource group for this
- security group.
- :attr List[SecurityGroupRule] rules: The rules for the default security group
- for a VPC. Defaults to allowing all outbound traffic, and allowing all inbound
- traffic from other interfaces in the VPC's default security group. Rules for the
- default security group may be changed, added or removed.
- :attr List[SecurityGroupTargetReference] targets: The targets for this security
- group.
- :attr VPCReference vpc: The VPC this security group resides in.
+ :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.
"""
def __init__(
self,
- created_at: datetime,
- crn: str,
- href: str,
- id: str,
- name: str,
- resource_group: 'ResourceGroupReference',
- rules: List['SecurityGroupRule'],
- targets: List['SecurityGroupTargetReference'],
- vpc: 'VPCReference',
+ type: str,
+ value: str,
) -> None:
"""
- Initialize a DefaultSecurityGroup object.
+ Initialize a DedicatedHostProfileDiskInterface object.
- :param datetime created_at: The date and time that this security group was
- created.
- :param str crn: The security group's CRN.
- :param str href: The security group's canonical URL.
- :param str id: The unique identifier for this security group.
- :param str name: The name for the default security group for a VPC. The
- name will be a hyphenated list of randomly-selected words at creation, but
- may changed.
- :param ResourceGroupReference resource_group: The resource group for this
- security group.
- :param List[SecurityGroupRule] rules: The rules for the default security
- group for a VPC. Defaults to allowing all outbound traffic, and allowing
- all inbound traffic from other interfaces in the VPC's default security
- group. Rules for the default security group may be changed, added or
- removed.
- :param List[SecurityGroupTargetReference] targets: The targets for this
- security group.
- :param VPCReference vpc: The VPC this security group resides in.
+ :param str 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.created_at = created_at
- self.crn = crn
- self.href = href
- self.id = id
- self.name = name
- self.resource_group = resource_group
- self.rules = rules
- self.targets = targets
- self.vpc = vpc
+ self.type = type
+ self.value = value
@classmethod
- def from_dict(cls, _dict: Dict) -> 'DefaultSecurityGroup':
- """Initialize a DefaultSecurityGroup object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'DedicatedHostProfileDiskInterface':
+ """Initialize a DedicatedHostProfileDiskInterface 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 'href' in _dict:
- args['href'] = _dict.get('href')
- else:
- raise ValueError('Required property \'href\' not present in DefaultSecurityGroup JSON')
- if 'id' in _dict:
- args['id'] = _dict.get('id')
- else:
- raise ValueError('Required property \'id\' not present in DefaultSecurityGroup JSON')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
- else:
- raise ValueError('Required property \'name\' not present in DefaultSecurityGroup JSON')
- if 'resource_group' in _dict:
- args['resource_group'] = ResourceGroupReference.from_dict(_dict.get('resource_group'))
- else:
- raise ValueError('Required property \'resource_group\' not present in DefaultSecurityGroup JSON')
- if 'rules' in _dict:
- args['rules'] = [SecurityGroupRule.from_dict(v) for v in _dict.get('rules')]
- else:
- raise ValueError('Required property \'rules\' not present in DefaultSecurityGroup JSON')
- if 'targets' in _dict:
- args['targets'] = _dict.get('targets')
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
else:
- raise ValueError('Required property \'targets\' not present in DefaultSecurityGroup JSON')
- if 'vpc' in _dict:
- args['vpc'] = VPCReference.from_dict(_dict.get('vpc'))
+ raise ValueError('Required property \'type\' not present in DedicatedHostProfileDiskInterface JSON')
+ if (value := _dict.get('value')) is not None:
+ args['value'] = value
else:
- raise ValueError('Required property \'vpc\' not present in DefaultSecurityGroup JSON')
+ raise ValueError('Required property \'value\' not present in DedicatedHostProfileDiskInterface JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a DefaultSecurityGroup object from a json dictionary."""
+ """Initialize a DedicatedHostProfileDiskInterface object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'created_at') and self.created_at is not None:
- _dict['created_at'] = datetime_to_string(self.created_at)
- if hasattr(self, 'crn') and self.crn is not None:
- _dict['crn'] = self.crn
- if hasattr(self, 'href') and self.href is not None:
- _dict['href'] = self.href
- if hasattr(self, 'id') and self.id is not None:
- _dict['id'] = self.id
- if hasattr(self, 'name') and self.name is not None:
- _dict['name'] = self.name
- if hasattr(self, 'resource_group') and self.resource_group is not None:
- if isinstance(self.resource_group, dict):
- _dict['resource_group'] = self.resource_group
- else:
- _dict['resource_group'] = self.resource_group.to_dict()
- if hasattr(self, 'rules') and self.rules is not None:
- rules_list = []
- for v in self.rules:
- if isinstance(v, dict):
- rules_list.append(v)
- else:
- rules_list.append(v.to_dict())
- _dict['rules'] = rules_list
- if hasattr(self, 'targets') and self.targets is not None:
- targets_list = []
- for v in self.targets:
- if isinstance(v, dict):
- targets_list.append(v)
- else:
- targets_list.append(v.to_dict())
- _dict['targets'] = targets_list
- if hasattr(self, 'vpc') and self.vpc is not None:
- if isinstance(self.vpc, dict):
- _dict['vpc'] = self.vpc
- else:
- _dict['vpc'] = self.vpc.to_dict()
+ 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):
@@ -35251,85 +37263,88 @@ 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 DedicatedHostProfileDiskInterface object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'DefaultSecurityGroup') -> bool:
+ def __eq__(self, other: 'DedicatedHostProfileDiskInterface') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'DefaultSecurityGroup') -> bool:
+ 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.
+ """
-class EncryptionKeyIdentity:
- """
- Identifies an encryption key by a unique property.
+ FIXED = 'fixed'
- """
- def __init__(
- self,
- ) -> None:
+ class ValueEnum(str, Enum):
"""
- Initialize a EncryptionKeyIdentity object.
-
+ The interface of the disk for a dedicated host with this profile
+ The enumerated values for this property are expected to expand in the future. When
+ processing this property, check for and log unknown values. Optionally halt
+ processing and surface the error, or bypass the resource on which the unexpected
+ property value was encountered.
"""
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['EncryptionKeyIdentityByCRN'])
- )
- raise Exception(msg)
+
+ NVME = 'nvme'
-class EncryptionKeyReference:
+
+class DedicatedHostProfileDiskQuantity:
"""
- EncryptionKeyReference.
+ The number of disks of this type for a dedicated host with this profile.
- :attr str crn: The CRN of the [Key Protect Root
- Key](https://cloud.ibm.com/docs/key-protect?topic=key-protect-getting-started-tutorial)
- or [Hyper Protect Crypto Services Root
- Key](https://cloud.ibm.com/docs/hs-crypto?topic=hs-crypto-get-started) for this
- resource.
+ :param str type: The type for this profile field.
+ :param int value: The value for this profile field.
"""
def __init__(
self,
- crn: str,
+ type: str,
+ value: int,
) -> None:
"""
- Initialize a EncryptionKeyReference object.
+ Initialize a DedicatedHostProfileDiskQuantity object.
- :param str crn: The CRN of the [Key Protect Root
- Key](https://cloud.ibm.com/docs/key-protect?topic=key-protect-getting-started-tutorial)
- or [Hyper Protect Crypto Services Root
- Key](https://cloud.ibm.com/docs/hs-crypto?topic=hs-crypto-get-started) for
- this resource.
+ :param str type: The type for this profile field.
+ :param int value: The value for this profile field.
"""
- self.crn = crn
+ self.type = type
+ self.value = value
@classmethod
- def from_dict(cls, _dict: Dict) -> 'EncryptionKeyReference':
- """Initialize a EncryptionKeyReference object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'DedicatedHostProfileDiskQuantity':
+ """Initialize a DedicatedHostProfileDiskQuantity object from a json dictionary."""
args = {}
- if 'crn' in _dict:
- args['crn'] = _dict.get('crn')
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
else:
- raise ValueError('Required property \'crn\' not present in EncryptionKeyReference JSON')
+ raise ValueError('Required property \'type\' not present in DedicatedHostProfileDiskQuantity JSON')
+ if (value := _dict.get('value')) is not None:
+ args['value'] = value
+ else:
+ raise ValueError('Required property \'value\' not present in DedicatedHostProfileDiskQuantity JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a EncryptionKeyReference object from a json dictionary."""
+ """Initialize a DedicatedHostProfileDiskQuantity object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'crn') and self.crn is not None:
- _dict['crn'] = self.crn
+ if hasattr(self, 'type') and self.type is not None:
+ _dict['type'] = self.type
+ if hasattr(self, 'value') and self.value is not None:
+ _dict['value'] = self.value
return _dict
def _to_dict(self):
@@ -35337,264 +37352,76 @@ 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 DedicatedHostProfileDiskQuantity object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'EncryptionKeyReference') -> bool:
+ def __eq__(self, other: 'DedicatedHostProfileDiskQuantity') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'EncryptionKeyReference') -> bool:
+ 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.
+ """
-class EndpointGateway:
+ FIXED = 'fixed'
+
+
+
+class DedicatedHostProfileDiskSize:
"""
- EndpointGateway.
+ The size of the disk in GB (gigabytes).
- :attr bool allow_dns_resolution_binding: Indicates whether to allow DNS
- resolution for this endpoint gateway when the VPC this endpoint gateway resides
- in has a DNS resolution binding to a VPC with `dns.enable_hub` set to `true`.
- :attr datetime created_at: The date and time that the endpoint gateway was
- created.
- :attr str crn: The CRN for this endpoint gateway.
- :attr str health_state: The health of this resource.
- - `ok`: No abnormal behavior detected
- - `degraded`: Experiencing compromised performance, capacity, or connectivity
- - `faulted`: Completely unreachable, inoperative, or otherwise entirely
- incapacitated
- - `inapplicable`: The health state does not apply because of the current
- lifecycle state. A resource with a lifecycle state of `failed` or `deleting`
- will have a health state of `inapplicable`. A `pending` resource may also have
- this state.
- :attr str href: The URL for this endpoint gateway.
- :attr str id: The unique identifier for this endpoint gateway.
- :attr List[ReservedIPReference] ips: The reserved IPs bound to this endpoint
- gateway.
- :attr str lifecycle_state: The lifecycle state of the endpoint gateway.
- :attr str name: The name for this endpoint gateway. The name is unique across
- all endpoint gateways in the VPC.
- :attr ResourceGroupReference resource_group: The resource group for this
- endpoint gateway.
- :attr str resource_type: The resource type.
- :attr List[SecurityGroupReference] security_groups: The security groups
- targeting this endpoint gateway.
- :attr str service_endpoint: (optional) Deprecated: The fully qualified domain
- name for the target service.
- :attr List[str] service_endpoints: The fully qualified domain names for the
- target service.
- :attr EndpointGatewayTarget target: The target for this endpoint gateway.
- :attr VPCReference vpc: The VPC this endpoint gateway resides in.
+ :param str type: The type for this profile field.
+ :param int value: The size of the disk in GB (gigabytes).
"""
def __init__(
self,
- allow_dns_resolution_binding: bool,
- 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,
+ type: str,
+ value: int,
) -> None:
"""
- Initialize a EndpointGateway object.
+ Initialize a DedicatedHostProfileDiskSize object.
- :param bool allow_dns_resolution_binding: Indicates whether to allow DNS
- resolution for this endpoint gateway when the VPC this endpoint gateway
- resides in has a DNS resolution binding to a VPC with `dns.enable_hub` set
- to `true`.
- :param datetime created_at: The date and time that the endpoint gateway was
- created.
- :param str crn: The CRN for this endpoint gateway.
- :param str health_state: The health of this resource.
- - `ok`: No abnormal behavior detected
- - `degraded`: Experiencing compromised performance, capacity, or
- connectivity
- - `faulted`: Completely unreachable, inoperative, or otherwise entirely
- incapacitated
- - `inapplicable`: The health state does not apply because of the current
- lifecycle state. A resource with a lifecycle state of `failed` or
- `deleting` will have a health state of `inapplicable`. A `pending` resource
- may also have this state.
- :param str href: The URL for this endpoint gateway.
- :param str id: The unique identifier for this endpoint gateway.
- :param List[ReservedIPReference] ips: The reserved IPs bound to this
- endpoint gateway.
- :param str lifecycle_state: The lifecycle state of the endpoint gateway.
- :param str name: The name for this endpoint gateway. The name is unique
- across all endpoint gateways in the VPC.
- :param ResourceGroupReference resource_group: The resource group for this
- endpoint gateway.
- :param str resource_type: The resource type.
- :param List[SecurityGroupReference] security_groups: The security groups
- targeting this endpoint gateway.
- :param List[str] service_endpoints: The fully qualified domain names for
- the target service.
- :param EndpointGatewayTarget target: The target for this endpoint gateway.
- :param VPCReference vpc: The VPC this endpoint gateway resides in.
- :param str service_endpoint: (optional) Deprecated: The fully qualified
- domain name for the target service.
+ :param str type: The type for this profile field.
+ :param int value: The size of the disk in GB (gigabytes).
"""
- self.allow_dns_resolution_binding = allow_dns_resolution_binding
- 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
+ self.type = type
+ self.value = value
@classmethod
- def from_dict(cls, _dict: Dict) -> 'EndpointGateway':
- """Initialize a EndpointGateway object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'DedicatedHostProfileDiskSize':
+ """Initialize a DedicatedHostProfileDiskSize object from a json dictionary."""
args = {}
- if 'allow_dns_resolution_binding' in _dict:
- args['allow_dns_resolution_binding'] = _dict.get('allow_dns_resolution_binding')
- else:
- raise ValueError('Required property \'allow_dns_resolution_binding\' not present in EndpointGateway JSON')
- if 'created_at' in _dict:
- args['created_at'] = string_to_datetime(_dict.get('created_at'))
- else:
- raise ValueError('Required property \'created_at\' not present in EndpointGateway JSON')
- 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')
- 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 EndpointGateway JSON')
- if 'id' in _dict:
- args['id'] = _dict.get('id')
- else:
- raise ValueError('Required property \'id\' not present in EndpointGateway JSON')
- if 'ips' in _dict:
- args['ips'] = [ReservedIPReference.from_dict(v) for v in _dict.get('ips')]
- else:
- raise ValueError('Required property \'ips\' not present in EndpointGateway JSON')
- if 'lifecycle_state' in _dict:
- args['lifecycle_state'] = _dict.get('lifecycle_state')
- else:
- raise ValueError('Required property \'lifecycle_state\' not present in EndpointGateway JSON')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
- else:
- raise ValueError('Required property \'name\' not present in EndpointGateway JSON')
- if 'resource_group' in _dict:
- args['resource_group'] = ResourceGroupReference.from_dict(_dict.get('resource_group'))
- else:
- raise ValueError('Required property \'resource_group\' not present in 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(v) for v in _dict.get('security_groups')]
- else:
- raise ValueError('Required property \'security_groups\' not present in EndpointGateway JSON')
- if 'service_endpoint' in _dict:
- args['service_endpoint'] = _dict.get('service_endpoint')
- if 'service_endpoints' in _dict:
- args['service_endpoints'] = _dict.get('service_endpoints')
- else:
- raise ValueError('Required property \'service_endpoints\' not present in EndpointGateway JSON')
- if 'target' in _dict:
- args['target'] = _dict.get('target')
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
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 \'type\' not present in DedicatedHostProfileDiskSize JSON')
+ if (value := _dict.get('value')) is not None:
+ args['value'] = value
else:
- raise ValueError('Required property \'vpc\' not present in EndpointGateway JSON')
+ raise ValueError('Required property \'value\' not present in DedicatedHostProfileDiskSize JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a EndpointGateway object from a json dictionary."""
+ """Initialize a DedicatedHostProfileDiskSize object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'allow_dns_resolution_binding') and self.allow_dns_resolution_binding is not None:
- _dict['allow_dns_resolution_binding'] = self.allow_dns_resolution_binding
- if hasattr(self, 'created_at') and self.created_at is not None:
- _dict['created_at'] = datetime_to_string(self.created_at)
- if hasattr(self, 'crn') and self.crn is not None:
- _dict['crn'] = self.crn
- if hasattr(self, 'health_state') and self.health_state is not None:
- _dict['health_state'] = self.health_state
- if hasattr(self, 'href') and self.href is not None:
- _dict['href'] = self.href
- if hasattr(self, 'id') and self.id is not None:
- _dict['id'] = self.id
- if hasattr(self, 'ips') and self.ips is not None:
- ips_list = []
- for v in self.ips:
- if isinstance(v, dict):
- ips_list.append(v)
- else:
- ips_list.append(v.to_dict())
- _dict['ips'] = ips_list
- if hasattr(self, 'lifecycle_state') and self.lifecycle_state is not None:
- _dict['lifecycle_state'] = self.lifecycle_state
- if hasattr(self, 'name') and self.name is not None:
- _dict['name'] = self.name
- if hasattr(self, 'resource_group') and self.resource_group is not None:
- if isinstance(self.resource_group, dict):
- _dict['resource_group'] = self.resource_group
- else:
- _dict['resource_group'] = self.resource_group.to_dict()
- if hasattr(self, 'resource_type') and self.resource_type is not None:
- _dict['resource_type'] = self.resource_type
- if hasattr(self, 'security_groups') and self.security_groups is not None:
- security_groups_list = []
- for v in self.security_groups:
- if isinstance(v, dict):
- security_groups_list.append(v)
- else:
- security_groups_list.append(v.to_dict())
- _dict['security_groups'] = security_groups_list
- if hasattr(self, 'service_endpoint') and self.service_endpoint is not None:
- _dict['service_endpoint'] = self.service_endpoint
- if hasattr(self, 'service_endpoints') and self.service_endpoints is not None:
- _dict['service_endpoints'] = self.service_endpoints
- if hasattr(self, 'target') and self.target is not None:
- if isinstance(self.target, dict):
- _dict['target'] = self.target
- else:
- _dict['target'] = self.target.to_dict()
- if hasattr(self, 'vpc') and self.vpc is not None:
- if isinstance(self.vpc, dict):
- _dict['vpc'] = self.vpc
- else:
- _dict['vpc'] = self.vpc.to_dict()
+ 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):
@@ -35602,158 +37429,78 @@ 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 DedicatedHostProfileDiskSize object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'EndpointGateway') -> bool:
+ def __eq__(self, other: 'DedicatedHostProfileDiskSize') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'EndpointGateway') -> bool:
+ def __ne__(self, other: 'DedicatedHostProfileDiskSize') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class HealthStateEnum(str, Enum):
- """
- The health of this resource.
- - `ok`: No abnormal behavior detected
- - `degraded`: Experiencing compromised performance, capacity, or connectivity
- - `faulted`: Completely unreachable, inoperative, or otherwise entirely
- incapacitated
- - `inapplicable`: The health state does not apply because of the current lifecycle
- state. A resource with a lifecycle state of `failed` or `deleting` will have a
- health state of `inapplicable`. A `pending` resource may also have this state.
- """
-
- DEGRADED = 'degraded'
- FAULTED = 'faulted'
- INAPPLICABLE = 'inapplicable'
- OK = 'ok'
-
-
- class LifecycleStateEnum(str, Enum):
- """
- The lifecycle state of the endpoint gateway.
- """
-
- DELETING = 'deleting'
- FAILED = 'failed'
- PENDING = 'pending'
- STABLE = 'stable'
- SUSPENDED = 'suspended'
- UPDATING = 'updating'
- WAITING = 'waiting'
-
-
- class ResourceTypeEnum(str, Enum):
+ class TypeEnum(str, Enum):
"""
- The resource type.
+ The type for this profile field.
"""
- ENDPOINT_GATEWAY = 'endpoint_gateway'
+ FIXED = 'fixed'
-class EndpointGatewayCollection:
+class DedicatedHostProfileDiskSupportedInterfaces:
"""
- EndpointGatewayCollection.
+ DedicatedHostProfileDiskSupportedInterfaces.
- :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 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.
+ :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.
"""
def __init__(
self,
- endpoint_gateways: List['EndpointGateway'],
- first: 'EndpointGatewayCollectionFirst',
- limit: int,
- total_count: int,
- *,
- next: 'EndpointGatewayCollectionNext' = None,
+ type: str,
+ value: List[str],
) -> None:
"""
- Initialize a EndpointGatewayCollection object.
+ Initialize a DedicatedHostProfileDiskSupportedInterfaces object.
- :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 EndpointGatewayCollectionNext 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 List[str] value: The instance disk interfaces supported for a
+ dedicated host with this profile.
"""
- self.endpoint_gateways = endpoint_gateways
- self.first = first
- self.limit = limit
- self.next = next
- self.total_count = total_count
+ self.type = type
+ self.value = value
@classmethod
- def from_dict(cls, _dict: Dict) -> 'EndpointGatewayCollection':
- """Initialize a EndpointGatewayCollection object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'DedicatedHostProfileDiskSupportedInterfaces':
+ """Initialize a DedicatedHostProfileDiskSupportedInterfaces object from a json dictionary."""
args = {}
- if 'endpoint_gateways' in _dict:
- args['endpoint_gateways'] = [EndpointGateway.from_dict(v) for v in _dict.get('endpoint_gateways')]
- else:
- raise ValueError('Required property \'endpoint_gateways\' not present in EndpointGatewayCollection JSON')
- if 'first' in _dict:
- args['first'] = EndpointGatewayCollectionFirst.from_dict(_dict.get('first'))
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
else:
- 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 EndpointGatewayCollection 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')
+ raise ValueError('Required property \'type\' not present in DedicatedHostProfileDiskSupportedInterfaces JSON')
+ if (value := _dict.get('value')) is not None:
+ args['value'] = value
else:
- raise ValueError('Required property \'total_count\' not present in EndpointGatewayCollection JSON')
+ raise ValueError('Required property \'value\' not present in DedicatedHostProfileDiskSupportedInterfaces JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a EndpointGatewayCollection object from a json dictionary."""
+ """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, 'endpoint_gateways') and self.endpoint_gateways is not None:
- endpoint_gateways_list = []
- for v in self.endpoint_gateways:
- if isinstance(v, dict):
- endpoint_gateways_list.append(v)
- else:
- endpoint_gateways_list.append(v.to_dict())
- _dict['endpoint_gateways'] = endpoint_gateways_list
- if hasattr(self, 'first') and self.first is not None:
- if isinstance(self.first, dict):
- _dict['first'] = self.first
- else:
- _dict['first'] = self.first.to_dict()
- if hasattr(self, 'limit') and self.limit is not None:
- _dict['limit'] = self.limit
- if hasattr(self, 'next') and self.next is not None:
- if isinstance(self.next, dict):
- _dict['next'] = self.next
- else:
- _dict['next'] = self.next.to_dict()
- if hasattr(self, 'total_count') and self.total_count is not None:
- _dict['total_count'] = self.total_count
+ if hasattr(self, '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):
@@ -35761,51 +37508,118 @@ 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 DedicatedHostProfileDiskSupportedInterfaces object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'EndpointGatewayCollection') -> bool:
+ def __eq__(self, other: 'DedicatedHostProfileDiskSupportedInterfaces') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'EndpointGatewayCollection') -> bool:
+ 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.
+ """
-class EndpointGatewayCollectionFirst:
+ 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:
"""
- A link to the first page of resources.
+ 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)
+
- :attr str href: The URL for a page of resources.
+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.
+
+ :param str href: The URL for this dedicated host.
+ :param str name: The globally unique name for this dedicated host profile.
"""
def __init__(
self,
href: str,
+ name: str,
) -> None:
"""
- Initialize a EndpointGatewayCollectionFirst object.
+ Initialize a DedicatedHostProfileReference object.
- :param str href: The URL for a page of resources.
+ :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) -> 'EndpointGatewayCollectionFirst':
- """Initialize a EndpointGatewayCollectionFirst object from a json dictionary."""
+ 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')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'href\' not present in EndpointGatewayCollectionFirst JSON')
+ raise ValueError('Required property \'href\' not present in DedicatedHostProfileReference JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ else:
+ raise ValueError('Required property \'name\' not present in DedicatedHostProfileReference JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a EndpointGatewayCollectionFirst object from a json dictionary."""
+ """Initialize a DedicatedHostProfileReference object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -35813,6 +37627,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):
@@ -35820,59 +37636,107 @@ 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 DedicatedHostProfileReference object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'EndpointGatewayCollectionFirst') -> bool:
+ def __eq__(self, other: 'DedicatedHostProfileReference') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'EndpointGatewayCollectionFirst') -> bool:
+ def __ne__(self, other: 'DedicatedHostProfileReference') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class EndpointGatewayCollectionNext:
+class DedicatedHostProfileSocket:
"""
- A link to the next page of resources. This property is present for all pages except
- the last page.
+ DedicatedHostProfileSocket.
- :attr str href: The URL for a page of resources.
"""
def __init__(
self,
- href: str,
) -> None:
"""
- Initialize a EndpointGatewayCollectionNext object.
+ Initialize a DedicatedHostProfileSocket object.
- :param str href: The URL for a page of resources.
"""
- self.href = href
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['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.
+
+ :param str type: The type for this profile field.
+ :param 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) -> 'EndpointGatewayCollectionNext':
- """Initialize a EndpointGatewayCollectionNext object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'DedicatedHostProfileVCPUArchitecture':
+ """Initialize a DedicatedHostProfileVCPUArchitecture object from a json dictionary."""
args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
else:
- raise ValueError('Required property \'href\' not present in EndpointGatewayCollectionNext JSON')
+ raise ValueError('Required property \'type\' not present in DedicatedHostProfileVCPUArchitecture JSON')
+ if (value := _dict.get('value')) is not None:
+ args['value'] = value
+ else:
+ raise ValueError('Required property \'value\' not present in DedicatedHostProfileVCPUArchitecture JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a EndpointGatewayCollectionNext object from a json dictionary."""
+ """Initialize a DedicatedHostProfileVCPUArchitecture object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, '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
+ if hasattr(self, 'value') and self.value is not None:
+ _dict['value'] = self.value
return _dict
def _to_dict(self):
@@ -35880,79 +37744,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 DedicatedHostProfileVCPUArchitecture object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'EndpointGatewayCollectionNext') -> bool:
+ def __eq__(self, other: 'DedicatedHostProfileVCPUArchitecture') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'EndpointGatewayCollectionNext') -> bool:
+ 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 EndpointGatewayPatch:
+
+
+class DedicatedHostProfileVCPUManufacturer:
"""
- EndpointGatewayPatch.
+ DedicatedHostProfileVCPUManufacturer.
- :attr bool allow_dns_resolution_binding: (optional) Indicates whether to allow
- DNS resolution for this endpoint gateway when the VPC this endpoint gateway
- resides in has a DNS resolution binding to a VPC with `dns.enable_hub` set to
- `true`.
- Must be `true` if the VPC this endpoint gateway resides in has `dns.enable_hub`
- set to
- `true`.
- :attr str name: (optional) The name for this endpoint gateway. The name must not
- be used by another endpoint gateway in the VPC.
+ :param str type: The type for this profile field.
+ :param str value: The VCPU manufacturer for a dedicated host with this profile.
"""
def __init__(
self,
- *,
- allow_dns_resolution_binding: bool = None,
- name: str = None,
+ type: str,
+ value: str,
) -> None:
"""
- Initialize a EndpointGatewayPatch object.
+ Initialize a DedicatedHostProfileVCPUManufacturer object.
- :param bool allow_dns_resolution_binding: (optional) Indicates whether to
- allow DNS resolution for this endpoint gateway when the VPC this endpoint
- gateway resides in has a DNS resolution binding to a VPC with
- `dns.enable_hub` set to `true`.
- Must be `true` if the VPC this endpoint gateway resides in has
- `dns.enable_hub` set to
- `true`.
- :param str name: (optional) The name for this endpoint gateway. The name
- must not be used by another endpoint gateway in the VPC.
+ :param str type: The type for this profile field.
+ :param str value: The VCPU manufacturer for a dedicated host with this
+ profile.
"""
- self.allow_dns_resolution_binding = allow_dns_resolution_binding
- self.name = name
+ self.type = type
+ self.value = value
@classmethod
- def from_dict(cls, _dict: Dict) -> 'EndpointGatewayPatch':
- """Initialize a EndpointGatewayPatch object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'DedicatedHostProfileVCPUManufacturer':
+ """Initialize a DedicatedHostProfileVCPUManufacturer object from a json dictionary."""
args = {}
- if 'allow_dns_resolution_binding' in _dict:
- args['allow_dns_resolution_binding'] = _dict.get('allow_dns_resolution_binding')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
+ else:
+ raise ValueError('Required property \'type\' not present in DedicatedHostProfileVCPUManufacturer JSON')
+ if (value := _dict.get('value')) is not None:
+ args['value'] = value
+ else:
+ raise ValueError('Required property \'value\' not present in DedicatedHostProfileVCPUManufacturer JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a EndpointGatewayPatch object from a json dictionary."""
+ """Initialize a DedicatedHostProfileVCPUManufacturer object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'allow_dns_resolution_binding') and self.allow_dns_resolution_binding is not None:
- _dict['allow_dns_resolution_binding'] = self.allow_dns_resolution_binding
- 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):
@@ -35960,93 +37822,90 @@ 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 DedicatedHostProfileVCPUManufacturer object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'EndpointGatewayPatch') -> bool:
+ def __eq__(self, other: 'DedicatedHostProfileVCPUManufacturer') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'EndpointGatewayPatch') -> bool:
+ def __ne__(self, other: 'DedicatedHostProfileVCPUManufacturer') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-
-class EndpointGatewayReferenceDeleted:
+ class TypeEnum(str, Enum):
+ """
+ The type for this profile field.
+ """
+
+ FIXED = 'fixed'
+
+
+
+class DedicatedHostPrototype:
"""
- If present, this property indicates the referenced resource has been deleted, and
- provides some supplementary information.
+ DedicatedHostPrototype.
- :attr str more_info: Link to documentation about deleted resources.
+ :param bool instance_placement_enabled: (optional) If set to true, instances can
+ be placed on this dedicated host.
+ :param str name: (optional) The name for this dedicated host. The name must not
+ be used by another dedicated host in the region. If unspecified, the name will
+ be a hyphenated list of randomly-selected words.
+ :param DedicatedHostProfileIdentity profile: The
+ [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-dh-profiles) to use for this
+ dedicated host.
+ :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) will be
+ used.
"""
def __init__(
self,
- more_info: str,
+ profile: 'DedicatedHostProfileIdentity',
+ *,
+ instance_placement_enabled: Optional[bool] = None,
+ name: Optional[str] = None,
+ resource_group: Optional['ResourceGroupIdentity'] = None,
) -> None:
"""
- Initialize a EndpointGatewayReferenceDeleted object.
+ Initialize a DedicatedHostPrototype object.
- :param str more_info: Link to documentation about deleted resources.
+ :param DedicatedHostProfileIdentity profile: The
+ [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-dh-profiles) to use for
+ this
+ dedicated host.
+ :param bool instance_placement_enabled: (optional) If set to true,
+ instances can be placed on this dedicated host.
+ :param str name: (optional) The name for this dedicated host. The name must
+ not be used by another dedicated host in the region. If unspecified, the
+ name will be a hyphenated list of randomly-selected words.
+ :param ResourceGroupIdentity resource_group: (optional) The resource group
+ to use. If unspecified, the account's [default resource
+ group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be
+ used.
"""
- self.more_info = more_info
-
- @classmethod
- def from_dict(cls, _dict: Dict) -> 'EndpointGatewayReferenceDeleted':
- """Initialize a EndpointGatewayReferenceDeleted 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')
- return cls(**args)
-
- @classmethod
- def _from_dict(cls, _dict):
- """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, '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 EndpointGatewayReferenceDeleted object."""
- return json.dumps(self.to_dict(), indent=2)
-
- 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: 'EndpointGatewayReferenceDeleted') -> 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(['DedicatedHostPrototypeDedicatedHostByGroup', 'DedicatedHostPrototypeDedicatedHostByZone'])
+ )
+ raise Exception(msg)
-class EndpointGatewayReferenceRemote:
+class DedicatedHostReference:
"""
- EndpointGatewayReferenceRemote.
+ DedicatedHostReference.
- :attr str crn: The CRN for this endpoint gateway.
- :attr str href: The URL for this endpoint gateway.
- :attr str id: The unique identifier for this endpoint gateway.
- :attr str name: The name for this endpoint gateway. The name is unique across
- all endpoint gateways in the VPC.
- :attr EndpointGatewayRemote remote: (optional) If present, this property
- indicates that the resource associated with this reference
- is remote and therefore may not be directly retrievable.
- :attr str resource_type: The resource type.
+ :param str crn: The CRN for this dedicated host.
+ :param DedicatedHostReferenceDeleted 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 dedicated host.
+ :param str id: The unique identifier for this dedicated host.
+ :param str name: The name for this dedicated host. The name is unique across all
+ dedicated hosts in the region.
+ :param str resource_type: The resource type.
"""
def __init__(
@@ -36057,59 +37916,59 @@ def __init__(
name: str,
resource_type: str,
*,
- remote: 'EndpointGatewayRemote' = None,
+ deleted: Optional['DedicatedHostReferenceDeleted'] = None,
) -> None:
"""
- Initialize a EndpointGatewayReferenceRemote object.
+ Initialize a DedicatedHostReference object.
- :param str crn: The CRN for this endpoint gateway.
- :param str href: The URL for this endpoint gateway.
- :param str id: The unique identifier for this endpoint gateway.
- :param str name: The name for this endpoint gateway. The name is unique
- across all endpoint gateways in the VPC.
+ :param str crn: The CRN for this dedicated host.
+ :param str href: The URL for this dedicated host.
+ :param str id: The unique identifier for this dedicated host.
+ :param str name: The name for this dedicated host. The name is unique
+ across all dedicated hosts in the region.
:param str resource_type: The resource type.
- :param EndpointGatewayRemote remote: (optional) If present, this property
- indicates that the resource associated with this reference
- is remote and therefore may not be directly retrievable.
+ :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.remote = remote
self.resource_type = resource_type
@classmethod
- def from_dict(cls, _dict: Dict) -> 'EndpointGatewayReferenceRemote':
- """Initialize a EndpointGatewayReferenceRemote object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'DedicatedHostReference':
+ """Initialize a DedicatedHostReference object from a json dictionary."""
args = {}
- if 'crn' in _dict:
- args['crn'] = _dict.get('crn')
+ if (crn := _dict.get('crn')) is not None:
+ args['crn'] = crn
else:
- raise ValueError('Required property \'crn\' not present in EndpointGatewayReferenceRemote JSON')
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ raise ValueError('Required property \'crn\' not present in DedicatedHostReference JSON')
+ if (deleted := _dict.get('deleted')) is not None:
+ args['deleted'] = DedicatedHostReferenceDeleted.from_dict(deleted)
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'href\' not present in EndpointGatewayReferenceRemote JSON')
- if 'id' in _dict:
- args['id'] = _dict.get('id')
+ raise ValueError('Required property \'href\' not present in DedicatedHostReference JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
else:
- raise ValueError('Required property \'id\' not present in EndpointGatewayReferenceRemote JSON')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
+ raise ValueError('Required property \'id\' not present in DedicatedHostReference JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
else:
- raise ValueError('Required property \'name\' not present in EndpointGatewayReferenceRemote JSON')
- if 'remote' in _dict:
- args['remote'] = EndpointGatewayRemote.from_dict(_dict.get('remote'))
- if 'resource_type' in _dict:
- args['resource_type'] = _dict.get('resource_type')
+ raise ValueError('Required property \'name\' not present in DedicatedHostReference JSON')
+ if (resource_type := _dict.get('resource_type')) is not None:
+ args['resource_type'] = resource_type
else:
- raise ValueError('Required property \'resource_type\' not present in EndpointGatewayReferenceRemote JSON')
+ raise ValueError('Required property \'resource_type\' not present in DedicatedHostReference JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a EndpointGatewayReferenceRemote object from a json dictionary."""
+ """Initialize a DedicatedHostReference object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -36117,17 +37976,17 @@ def to_dict(self) -> Dict:
_dict = {}
if hasattr(self, 'crn') and self.crn is not None:
_dict['crn'] = self.crn
+ if hasattr(self, 'deleted') and self.deleted is not None:
+ if isinstance(self.deleted, dict):
+ _dict['deleted'] = self.deleted
+ else:
+ _dict['deleted'] = self.deleted.to_dict()
if hasattr(self, 'href') and self.href is not None:
_dict['href'] = self.href
if hasattr(self, 'id') and self.id is not None:
_dict['id'] = self.id
if hasattr(self, 'name') and self.name is not None:
_dict['name'] = self.name
- if hasattr(self, 'remote') and self.remote is not None:
- if isinstance(self.remote, dict):
- _dict['remote'] = self.remote
- else:
- _dict['remote'] = self.remote.to_dict()
if hasattr(self, 'resource_type') and self.resource_type is not None:
_dict['resource_type'] = self.resource_type
return _dict
@@ -36137,16 +37996,16 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this EndpointGatewayReferenceRemote object."""
+ """Return a `str` version of this DedicatedHostReference object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'EndpointGatewayReferenceRemote') -> bool:
+ def __eq__(self, other: 'DedicatedHostReference') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'EndpointGatewayReferenceRemote') -> bool:
+ def __ne__(self, other: 'DedicatedHostReference') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
@@ -36155,70 +38014,49 @@ class ResourceTypeEnum(str, Enum):
The resource type.
"""
- ENDPOINT_GATEWAY = 'endpoint_gateway'
+ DEDICATED_HOST = 'dedicated_host'
-class EndpointGatewayRemote:
+class DedicatedHostReferenceDeleted:
"""
- If present, this property indicates that the resource associated with this reference
- is remote and therefore may not be directly retrievable.
+ If present, this property indicates the referenced resource has been deleted, and
+ provides some supplementary information.
- :attr AccountReference account: (optional) If present, this property indicates
- that the referenced resource is remote to this
- account, and identifies the owning account.
- :attr RegionReference region: (optional) If present, this property indicates
- that the referenced resource is remote to this
- region, and identifies the native region.
+ :param str more_info: Link to documentation about deleted resources.
"""
def __init__(
self,
- *,
- account: 'AccountReference' = None,
- region: 'RegionReference' = None,
+ more_info: str,
) -> None:
"""
- Initialize a EndpointGatewayRemote object.
+ Initialize a DedicatedHostReferenceDeleted object.
- :param AccountReference account: (optional) If present, this property
- indicates that the referenced resource is remote to this
- account, and identifies the owning account.
- :param RegionReference region: (optional) If present, this property
- indicates that the referenced resource is remote to this
- region, and identifies the native region.
+ :param str more_info: Link to documentation about deleted resources.
"""
- self.account = account
- self.region = region
+ self.more_info = more_info
@classmethod
- def from_dict(cls, _dict: Dict) -> 'EndpointGatewayRemote':
- """Initialize a EndpointGatewayRemote object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'DedicatedHostReferenceDeleted':
+ """Initialize a DedicatedHostReferenceDeleted object from a json dictionary."""
args = {}
- if 'account' in _dict:
- args['account'] = AccountReference.from_dict(_dict.get('account'))
- if 'region' in _dict:
- args['region'] = RegionReference.from_dict(_dict.get('region'))
+ if (more_info := _dict.get('more_info')) is not None:
+ args['more_info'] = 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 EndpointGatewayRemote object from a json dictionary."""
+ """Initialize a DedicatedHostReferenceDeleted object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'account') and self.account is not None:
- if isinstance(self.account, dict):
- _dict['account'] = self.account
- else:
- _dict['account'] = self.account.to_dict()
- if hasattr(self, 'region') and self.region is not None:
- if isinstance(self.region, dict):
- _dict['region'] = self.region
- else:
- _dict['region'] = self.region.to_dict()
+ if hasattr(self, 'more_info') and self.more_info is not None:
+ _dict['more_info'] = self.more_info
return _dict
def _to_dict(self):
@@ -36226,240 +38064,137 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this EndpointGatewayRemote object."""
+ """Return a `str` version of this DedicatedHostReferenceDeleted object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'EndpointGatewayRemote') -> bool:
+ def __eq__(self, other: 'DedicatedHostReferenceDeleted') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'EndpointGatewayRemote') -> bool:
+ def __ne__(self, other: 'DedicatedHostReferenceDeleted') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class EndpointGatewayReservedIP:
- """
- A reserved IP to bind to the endpoint gateway. This can be specified using an existing
- reserved IP, or a prototype object for a new reserved IP. The reserved IP will be
- bound to the endpoint gateway to function as a virtual private endpoint for the
- service.
-
- """
-
- def __init__(
- self,
- ) -> None:
- """
- Initialize a EndpointGatewayReservedIP object.
-
- """
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['EndpointGatewayReservedIPReservedIPIdentity', 'EndpointGatewayReservedIPReservedIPPrototypeTargetContext'])
- )
- raise Exception(msg)
-
-
-class EndpointGatewayTarget:
- """
- The target for this endpoint gateway.
-
- """
-
- def __init__(
- self,
- ) -> None:
- """
- Initialize a EndpointGatewayTarget object.
-
- """
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['EndpointGatewayTargetProviderCloudServiceReference', 'EndpointGatewayTargetProviderInfrastructureServiceReference'])
- )
- raise Exception(msg)
-
-
-class EndpointGatewayTargetPrototype:
- """
- The target to use for this endpoint gateway. Must not already be the target of another
- endpoint gateway in the VPC.
-
- :attr str resource_type: The type of target for this endpoint gateway.
- """
-
- def __init__(
- self,
- resource_type: str,
- ) -> None:
- """
- Initialize a EndpointGatewayTargetPrototype object.
-
- :param str resource_type: The type of target for this endpoint gateway.
- """
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['EndpointGatewayTargetPrototypeProviderCloudServiceIdentity', 'EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentity'])
- )
- raise Exception(msg)
-
- @classmethod
- def from_dict(cls, _dict: Dict) -> 'EndpointGatewayTargetPrototype':
- """Initialize a EndpointGatewayTargetPrototype object from a json dictionary."""
- disc_class = cls._get_class_by_discriminator(_dict)
- if disc_class != cls:
- return disc_class.from_dict(_dict)
- msg = "Cannot convert dictionary into an instance of base class 'EndpointGatewayTargetPrototype'. The discriminator value should map to a valid subclass: {1}".format(
- ", ".join(['EndpointGatewayTargetPrototypeProviderCloudServiceIdentity', 'EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentity'])
- )
- raise Exception(msg)
-
- @classmethod
- def _from_dict(cls, _dict: Dict):
- """Initialize a EndpointGatewayTargetPrototype object from a json dictionary."""
- return cls.from_dict(_dict)
-
- @classmethod
- def _get_class_by_discriminator(cls, _dict: Dict) -> object:
- mapping = {}
- mapping['provider_cloud_service'] = 'EndpointGatewayTargetPrototypeProviderCloudServiceIdentity'
- mapping['provider_infrastructure_service'] = 'EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentity'
- disc_value = _dict.get('resource_type')
- if disc_value is None:
- raise ValueError('Discriminator property \'resource_type\' not found in EndpointGatewayTargetPrototype JSON')
- class_name = mapping.get(disc_value, disc_value)
- try:
- disc_class = getattr(sys.modules[__name__], class_name)
- except AttributeError:
- disc_class = cls
- if isinstance(disc_class, object):
- return disc_class
- raise TypeError('%s is not a discriminator class' % class_name)
-
- class ResourceTypeEnum(str, Enum):
- """
- The type of target for this endpoint gateway.
- """
-
- PROVIDER_CLOUD_SERVICE = 'provider_cloud_service'
- PROVIDER_INFRASTRUCTURE_SERVICE = 'provider_infrastructure_service'
-
-
-
-class FloatingIP:
+class DefaultNetworkACL:
"""
- FloatingIP.
+ DefaultNetworkACL.
- :attr str address: The globally unique IP address.
- :attr datetime created_at: The date and time that the floating IP was created.
- :attr str crn: The CRN for this floating IP.
- :attr str href: The URL for this floating IP.
- :attr str id: The unique identifier for this floating IP.
- :attr str name: The name for this floating IP. The name is unique across all
- floating IPs in the region.
- :attr ResourceGroupReference resource_group: The resource group for this
- floating IP.
- :attr str status: The status of the floating IP.
- :attr FloatingIPTarget target: (optional) The target of this floating IP.
- :attr ZoneReference zone: The zone this floating IP resides in.
+ :param datetime created_at: The date and time that the network ACL was created.
+ :param str crn: The CRN for this network ACL.
+ :param str href: The URL for this network ACL.
+ :param str id: The unique identifier for this network ACL.
+ :param str name: The name of the default network ACL created for a VPC. The name
+ will be a hyphenated list of randomly-selected words at creation, but may be
+ changed.
+ :param ResourceGroupReference resource_group: The resource group for the default
+ network ACL for a VPC. Set to the VPC's
+ resource group at creation.
+ :param List[NetworkACLRuleItem] rules: The ordered rules for the default network
+ ACL for a VPC. Defaults to two rules which allow all inbound and outbound
+ traffic, respectively. Rules for the default network ACL may be changed, added,
+ or removed.
+ :param List[SubnetReference] subnets: The subnets to which this network ACL is
+ attached.
+ :param VPCReference vpc: The VPC this network ACL resides in.
"""
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,
+ rules: List['NetworkACLRuleItem'],
+ subnets: List['SubnetReference'],
+ vpc: 'VPCReference',
) -> None:
"""
- Initialize a FloatingIP object.
+ Initialize a DefaultNetworkACL object.
- :param str address: The globally unique IP address.
- :param datetime created_at: The date and time that the floating IP was
+ :param datetime created_at: The date and time that the network ACL was
created.
- :param str crn: The CRN for this floating IP.
- :param str href: The URL for this floating IP.
- :param str id: The unique identifier for this floating IP.
- :param str name: The name for this floating IP. The name is unique across
- all floating IPs in the region.
- :param ResourceGroupReference resource_group: The resource group for this
- floating IP.
- :param str status: The status of the floating IP.
- :param ZoneReference zone: The zone this floating IP resides in.
- :param FloatingIPTarget target: (optional) The target of this floating IP.
+ :param str crn: The CRN for this network ACL.
+ :param str href: The URL for this network ACL.
+ :param str id: The unique identifier for this network ACL.
+ :param str name: The name of the default network ACL created for a VPC. The
+ name will be a hyphenated list of randomly-selected words at creation, but
+ may be changed.
+ :param ResourceGroupReference resource_group: The resource group for the
+ default network ACL for a VPC. Set to the VPC's
+ resource group at creation.
+ :param List[NetworkACLRuleItem] rules: The ordered rules for the default
+ network ACL for a VPC. Defaults to two rules which allow all inbound and
+ outbound traffic, respectively. Rules for the default network ACL may be
+ changed, added, or removed.
+ :param List[SubnetReference] subnets: The subnets to which this network ACL
+ is attached.
+ :param VPCReference vpc: The VPC this network ACL resides in.
"""
- self.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
+ self.rules = rules
+ self.subnets = subnets
+ self.vpc = vpc
@classmethod
- def from_dict(cls, _dict: Dict) -> 'FloatingIP':
- """Initialize a FloatingIP object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'DefaultNetworkACL':
+ """Initialize a DefaultNetworkACL object from a json dictionary."""
args = {}
- if 'address' in _dict:
- args['address'] = _dict.get('address')
+ if (created_at := _dict.get('created_at')) is not None:
+ args['created_at'] = string_to_datetime(created_at)
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'))
+ raise ValueError('Required property \'created_at\' not present in DefaultNetworkACL JSON')
+ if (crn := _dict.get('crn')) is not None:
+ args['crn'] = crn
else:
- raise ValueError('Required property \'created_at\' not present in FloatingIP JSON')
- if 'crn' in _dict:
- args['crn'] = _dict.get('crn')
+ raise ValueError('Required property \'crn\' not present in DefaultNetworkACL JSON')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'crn\' not present in FloatingIP JSON')
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ raise ValueError('Required property \'href\' not present in DefaultNetworkACL JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
else:
- raise ValueError('Required property \'href\' not present in FloatingIP JSON')
- if 'id' in _dict:
- args['id'] = _dict.get('id')
+ raise ValueError('Required property \'id\' not present in DefaultNetworkACL JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
else:
- raise ValueError('Required property \'id\' not present in FloatingIP JSON')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
+ raise ValueError('Required property \'name\' not present in DefaultNetworkACL JSON')
+ if (resource_group := _dict.get('resource_group')) is not None:
+ args['resource_group'] = ResourceGroupReference.from_dict(resource_group)
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'))
+ raise ValueError('Required property \'resource_group\' not present in DefaultNetworkACL JSON')
+ if (rules := _dict.get('rules')) is not None:
+ args['rules'] = [NetworkACLRuleItem.from_dict(v) for v in rules]
else:
- raise ValueError('Required property \'resource_group\' not present in FloatingIP JSON')
- if 'status' in _dict:
- args['status'] = _dict.get('status')
+ raise ValueError('Required property \'rules\' not present in DefaultNetworkACL JSON')
+ if (subnets := _dict.get('subnets')) is not None:
+ args['subnets'] = [SubnetReference.from_dict(v) for v in subnets]
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'))
+ raise ValueError('Required property \'subnets\' not present in DefaultNetworkACL JSON')
+ if (vpc := _dict.get('vpc')) is not None:
+ args['vpc'] = VPCReference.from_dict(vpc)
else:
- raise ValueError('Required property \'zone\' not present in FloatingIP JSON')
+ raise ValueError('Required property \'vpc\' not present in DefaultNetworkACL JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a FloatingIP object from a json dictionary."""
+ """Initialize a DefaultNetworkACL object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, '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:
@@ -36475,18 +38210,27 @@ def to_dict(self) -> Dict:
_dict['resource_group'] = self.resource_group
else:
_dict['resource_group'] = self.resource_group.to_dict()
- if hasattr(self, 'status') and self.status is not None:
- _dict['status'] = self.status
- if hasattr(self, 'target') and self.target is not None:
- if isinstance(self.target, dict):
- _dict['target'] = self.target
- else:
- _dict['target'] = self.target.to_dict()
- if hasattr(self, 'zone') and self.zone is not None:
- if isinstance(self.zone, dict):
- _dict['zone'] = self.zone
+ if hasattr(self, 'rules') and self.rules is not None:
+ rules_list = []
+ for v in self.rules:
+ if isinstance(v, dict):
+ rules_list.append(v)
+ else:
+ rules_list.append(v.to_dict())
+ _dict['rules'] = rules_list
+ if hasattr(self, 'subnets') and self.subnets is not None:
+ subnets_list = []
+ for v in self.subnets:
+ if isinstance(v, dict):
+ subnets_list.append(v)
+ else:
+ subnets_list.append(v.to_dict())
+ _dict['subnets'] = subnets_list
+ if hasattr(self, 'vpc') and self.vpc is not None:
+ if isinstance(self.vpc, dict):
+ _dict['vpc'] = self.vpc
else:
- _dict['zone'] = self.zone.to_dict()
+ _dict['vpc'] = self.vpc.to_dict()
return _dict
def _to_dict(self):
@@ -36494,127 +38238,319 @@ 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 DefaultNetworkACL object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'FloatingIP') -> bool:
+ def __eq__(self, other: 'DefaultNetworkACL') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'FloatingIP') -> bool:
+ def __ne__(self, other: 'DefaultNetworkACL') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class StatusEnum(str, Enum):
- """
- The status of the floating IP.
- """
-
- AVAILABLE = 'available'
- DELETING = 'deleting'
- FAILED = 'failed'
- PENDING = 'pending'
-
-
-class FloatingIPCollection:
+class DefaultRoutingTable:
"""
- FloatingIPCollection.
+ DefaultRoutingTable.
- :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.
+ :param List[ResourceFilter] accept_routes_from: The filters specifying the
+ resources that may create routes in this routing table.
+ At present, only the `resource_type` filter is permitted, and only the
+ `vpn_server` value is supported, but filter support is expected to expand in the
+ future.
+ :param List[str] advertise_routes_to: The ingress sources to advertise routes
+ to. Routes in the table with `advertise` enabled will be advertised to these
+ sources.
+ The enumerated values for this property are expected to 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 datetime created_at: The date and time that this routing table was
+ created.
+ :param str href: The URL for this routing table.
+ :param str id: The unique identifier for this routing table.
+ :param bool is_default: Indicates whether this is the default routing table for
+ this VPC.
+ :param str lifecycle_state: The lifecycle state of the routing table.
+ :param str name: The name of the default routing table created for this VPC. The
+ name will be a hyphenated list of randomly-selected words at creation, but may
+ be changed.
+ :param str resource_type: The resource type.
+ :param bool route_direct_link_ingress: Indicates whether this routing table is
+ used to route traffic that originates from
+ [Direct Link](https://cloud.ibm.com/docs/dl) to this VPC.
+ Incoming traffic will be routed according to the routing table with one
+ exception: routes with an `action` of `deliver` are treated as `drop` unless the
+ `next_hop` is an IP address in a subnet in the route's `zone` that is able to
+ accept traffic. Therefore, if an incoming packet matches a route with a
+ `next_hop` of a VPN gateway connection, the packet will be dropped.
+ :param bool route_internet_ingress: Indicates whether this routing table is used
+ to route traffic that originates from the internet.
+ Incoming traffic will be routed according to the routing table with two
+ exceptions:
+ - Traffic destined for IP addresses associated with public gateways will not be
+ subject to routes in this routing table.
+ - Routes with an `action` of `deliver` are treated as `drop` unless the
+ `next_hop` is
+ an IP address in a subnet in the route's `zone` that is able to accept
+ traffic.
+ Therefore, if an incoming packet matches a route with a `next_hop` of a VPN
+ gateway
+ connection, the packet will be dropped.
+ :param bool route_transit_gateway_ingress: Indicates whether this routing table
+ is used to route traffic that originates from from [Transit
+ Gateway](https://cloud.ibm.com/docs/transit-gateway) to this VPC.
+ Incoming traffic will be routed according to the routing table with one
+ exception: routes with an `action` of `deliver` are treated as `drop` unless the
+ `next_hop` is an IP address in a subnet in the route's `zone` that is able to
+ accept traffic. Therefore, if an incoming packet matches a route with a
+ `next_hop` of a VPN gateway connection, the packet will be dropped.
+ :param bool route_vpc_zone_ingress: Indicates whether this routing table is used
+ to route traffic that originates from subnets in other zones in this VPC.
+ Incoming traffic will be routed according to the routing table with one
+ exception: routes with an `action` of `deliver` are treated as `drop` unless the
+ `next_hop` is an IP address in a subnet in the route's `zone` that is able to
+ accept traffic. Therefore, if an incoming packet matches a route with a
+ `next_hop` of 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.
"""
def __init__(
self,
- first: 'FloatingIPCollectionFirst',
- floating_ips: List['FloatingIP'],
- limit: int,
- total_count: int,
- *,
- next: 'FloatingIPCollectionNext' = None,
+ accept_routes_from: List['ResourceFilter'],
+ advertise_routes_to: List[str],
+ created_at: datetime,
+ href: str,
+ id: str,
+ is_default: bool,
+ lifecycle_state: str,
+ name: str,
+ resource_type: str,
+ route_direct_link_ingress: bool,
+ route_internet_ingress: bool,
+ route_transit_gateway_ingress: bool,
+ route_vpc_zone_ingress: bool,
+ routes: List['RouteReference'],
+ subnets: List['SubnetReference'],
) -> None:
"""
- Initialize a FloatingIPCollection object.
+ Initialize a DefaultRoutingTable 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 List[ResourceFilter] accept_routes_from: The filters specifying the
+ resources that may create routes in this routing table.
+ At present, only the `resource_type` filter is permitted, and only the
+ `vpn_server` value is supported, but filter support is expected to expand
+ in the future.
+ :param List[str] advertise_routes_to: The ingress sources to advertise
+ routes to. Routes in the table with `advertise` enabled will be advertised
+ to these sources.
+ The enumerated values for this property are expected to 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 datetime created_at: The date and time that this routing table was
+ created.
+ :param str href: The URL for this routing table.
+ :param str id: The unique identifier for this routing table.
+ :param bool is_default: Indicates whether this is the default routing table
+ for this VPC.
+ :param str lifecycle_state: The lifecycle state of the routing table.
+ :param str name: The name of the default routing table created for this
+ VPC. The name will be a hyphenated list of randomly-selected words at
+ creation, but may be changed.
+ :param str resource_type: The resource type.
+ :param bool route_direct_link_ingress: Indicates whether this routing table
+ is used to route traffic that originates from
+ [Direct Link](https://cloud.ibm.com/docs/dl) to this VPC.
+ Incoming traffic will be routed according to the routing table with one
+ exception: routes with an `action` of `deliver` are treated as `drop`
+ unless the `next_hop` is an IP address in a subnet in the route's `zone`
+ that is able to accept traffic. Therefore, if an incoming packet matches a
+ route with a `next_hop` of a VPN gateway connection, the packet will be
+ dropped.
+ :param bool route_internet_ingress: Indicates whether this routing table is
+ used to route traffic that originates from the internet.
+ Incoming traffic will be routed according to the routing table with two
+ exceptions:
+ - Traffic destined for IP addresses associated with public gateways will
+ not be
+ subject to routes in this routing table.
+ - Routes with an `action` of `deliver` are treated as `drop` unless the
+ `next_hop` is
+ an IP address in a subnet in the route's `zone` that is able to accept
+ traffic.
+ Therefore, if an incoming packet matches a route with a `next_hop` of a
+ VPN gateway
+ connection, the packet will be dropped.
+ :param bool route_transit_gateway_ingress: Indicates whether this routing
+ table is used to route traffic that originates from from [Transit
+ Gateway](https://cloud.ibm.com/docs/transit-gateway) to this VPC.
+ Incoming traffic will be routed according to the routing table with one
+ exception: routes with an `action` of `deliver` are treated as `drop`
+ unless the `next_hop` is an IP address in a subnet in the route's `zone`
+ that is able to accept traffic. Therefore, if an incoming packet matches a
+ route with a `next_hop` of a VPN gateway connection, the packet will be
+ dropped.
+ :param bool route_vpc_zone_ingress: Indicates whether this routing table is
+ used to route traffic that originates from subnets in other zones in this
+ VPC.
+ Incoming traffic will be routed according to the routing table with one
+ exception: routes with an `action` of `deliver` are treated as `drop`
+ unless the `next_hop` is an IP address in a subnet in the route's `zone`
+ that is able to accept traffic. Therefore, if an incoming packet matches a
+ route with a `next_hop` of 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.first = first
- self.floating_ips = floating_ips
- self.limit = limit
- self.next = next
- self.total_count = total_count
+ self.accept_routes_from = accept_routes_from
+ self.advertise_routes_to = advertise_routes_to
+ self.created_at = created_at
+ self.href = href
+ self.id = id
+ self.is_default = is_default
+ self.lifecycle_state = lifecycle_state
+ self.name = name
+ self.resource_type = resource_type
+ self.route_direct_link_ingress = route_direct_link_ingress
+ self.route_internet_ingress = route_internet_ingress
+ self.route_transit_gateway_ingress = route_transit_gateway_ingress
+ self.route_vpc_zone_ingress = route_vpc_zone_ingress
+ self.routes = routes
+ self.subnets = subnets
@classmethod
- def from_dict(cls, _dict: Dict) -> 'FloatingIPCollection':
- """Initialize a FloatingIPCollection object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'DefaultRoutingTable':
+ """Initialize a DefaultRoutingTable object from a json dictionary."""
args = {}
- if 'first' in _dict:
- args['first'] = FloatingIPCollectionFirst.from_dict(_dict.get('first'))
+ if (accept_routes_from := _dict.get('accept_routes_from')) is not None:
+ args['accept_routes_from'] = [ResourceFilter.from_dict(v) for v in accept_routes_from]
else:
- raise ValueError('Required property \'first\' not present in FloatingIPCollection JSON')
- if 'floating_ips' in _dict:
- args['floating_ips'] = [FloatingIP.from_dict(v) for v in _dict.get('floating_ips')]
+ raise ValueError('Required property \'accept_routes_from\' not present in DefaultRoutingTable JSON')
+ if (advertise_routes_to := _dict.get('advertise_routes_to')) is not None:
+ args['advertise_routes_to'] = advertise_routes_to
else:
- raise ValueError('Required property \'floating_ips\' not present in FloatingIPCollection JSON')
- if 'limit' in _dict:
- args['limit'] = _dict.get('limit')
+ raise ValueError('Required property \'advertise_routes_to\' not present in DefaultRoutingTable JSON')
+ if (created_at := _dict.get('created_at')) is not None:
+ args['created_at'] = string_to_datetime(created_at)
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')
+ raise ValueError('Required property \'created_at\' not present in DefaultRoutingTable JSON')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'total_count\' not present in FloatingIPCollection JSON')
+ raise ValueError('Required property \'href\' not present in DefaultRoutingTable JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
+ else:
+ raise ValueError('Required property \'id\' not present in DefaultRoutingTable JSON')
+ if (is_default := _dict.get('is_default')) is not None:
+ args['is_default'] = is_default
+ else:
+ raise ValueError('Required property \'is_default\' not present in DefaultRoutingTable JSON')
+ if (lifecycle_state := _dict.get('lifecycle_state')) is not None:
+ args['lifecycle_state'] = lifecycle_state
+ else:
+ raise ValueError('Required property \'lifecycle_state\' not present in DefaultRoutingTable JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ else:
+ raise ValueError('Required property \'name\' not present in DefaultRoutingTable JSON')
+ if (resource_type := _dict.get('resource_type')) is not None:
+ args['resource_type'] = resource_type
+ else:
+ raise ValueError('Required property \'resource_type\' not present in DefaultRoutingTable JSON')
+ if (route_direct_link_ingress := _dict.get('route_direct_link_ingress')) is not None:
+ args['route_direct_link_ingress'] = route_direct_link_ingress
+ else:
+ raise ValueError('Required property \'route_direct_link_ingress\' not present in DefaultRoutingTable JSON')
+ if (route_internet_ingress := _dict.get('route_internet_ingress')) is not None:
+ args['route_internet_ingress'] = route_internet_ingress
+ else:
+ raise ValueError('Required property \'route_internet_ingress\' not present in DefaultRoutingTable JSON')
+ if (route_transit_gateway_ingress := _dict.get('route_transit_gateway_ingress')) is not None:
+ args['route_transit_gateway_ingress'] = route_transit_gateway_ingress
+ else:
+ raise ValueError('Required property \'route_transit_gateway_ingress\' not present in DefaultRoutingTable JSON')
+ if (route_vpc_zone_ingress := _dict.get('route_vpc_zone_ingress')) is not None:
+ args['route_vpc_zone_ingress'] = route_vpc_zone_ingress
+ else:
+ raise ValueError('Required property \'route_vpc_zone_ingress\' not present in DefaultRoutingTable JSON')
+ if (routes := _dict.get('routes')) is not None:
+ args['routes'] = [RouteReference.from_dict(v) for v in routes]
+ else:
+ raise ValueError('Required property \'routes\' not present in DefaultRoutingTable JSON')
+ if (subnets := _dict.get('subnets')) is not None:
+ args['subnets'] = [SubnetReference.from_dict(v) for v in subnets]
+ else:
+ raise ValueError('Required property \'subnets\' not present in DefaultRoutingTable JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a FloatingIPCollection object from a json dictionary."""
+ """Initialize a DefaultRoutingTable object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'first') and self.first is not None:
- if isinstance(self.first, dict):
- _dict['first'] = self.first
- else:
- _dict['first'] = self.first.to_dict()
- if hasattr(self, 'floating_ips') and self.floating_ips is not None:
- floating_ips_list = []
- for v in self.floating_ips:
+ if hasattr(self, 'accept_routes_from') and self.accept_routes_from is not None:
+ accept_routes_from_list = []
+ for v in self.accept_routes_from:
if isinstance(v, dict):
- floating_ips_list.append(v)
+ accept_routes_from_list.append(v)
else:
- floating_ips_list.append(v.to_dict())
- _dict['floating_ips'] = floating_ips_list
- if hasattr(self, 'limit') and self.limit is not None:
- _dict['limit'] = self.limit
- if hasattr(self, 'next') and self.next is not None:
- if isinstance(self.next, dict):
- _dict['next'] = self.next
- else:
- _dict['next'] = self.next.to_dict()
- if hasattr(self, 'total_count') and self.total_count is not None:
- _dict['total_count'] = self.total_count
+ accept_routes_from_list.append(v.to_dict())
+ _dict['accept_routes_from'] = accept_routes_from_list
+ if hasattr(self, 'advertise_routes_to') and self.advertise_routes_to is not None:
+ _dict['advertise_routes_to'] = self.advertise_routes_to
+ if hasattr(self, 'created_at') and self.created_at is not None:
+ _dict['created_at'] = datetime_to_string(self.created_at)
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
+ if hasattr(self, 'id') and self.id is not None:
+ _dict['id'] = self.id
+ if hasattr(self, 'is_default') and self.is_default is not None:
+ _dict['is_default'] = self.is_default
+ if hasattr(self, 'lifecycle_state') and self.lifecycle_state is not None:
+ _dict['lifecycle_state'] = self.lifecycle_state
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ if hasattr(self, 'resource_type') and self.resource_type is not None:
+ _dict['resource_type'] = self.resource_type
+ if hasattr(self, 'route_direct_link_ingress') and self.route_direct_link_ingress is not None:
+ _dict['route_direct_link_ingress'] = self.route_direct_link_ingress
+ if hasattr(self, 'route_internet_ingress') and self.route_internet_ingress is not None:
+ _dict['route_internet_ingress'] = self.route_internet_ingress
+ if hasattr(self, 'route_transit_gateway_ingress') and self.route_transit_gateway_ingress is not None:
+ _dict['route_transit_gateway_ingress'] = self.route_transit_gateway_ingress
+ if hasattr(self, 'route_vpc_zone_ingress') and self.route_vpc_zone_ingress is not None:
+ _dict['route_vpc_zone_ingress'] = self.route_vpc_zone_ingress
+ if hasattr(self, 'routes') and self.routes is not None:
+ routes_list = []
+ for v in self.routes:
+ if isinstance(v, dict):
+ routes_list.append(v)
+ else:
+ routes_list.append(v.to_dict())
+ _dict['routes'] = routes_list
+ if hasattr(self, 'subnets') and self.subnets is not None:
+ subnets_list = []
+ for v in self.subnets:
+ if isinstance(v, dict):
+ subnets_list.append(v)
+ else:
+ subnets_list.append(v.to_dict())
+ _dict['subnets'] = subnets_list
return _dict
def _to_dict(self):
@@ -36622,58 +38558,206 @@ 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 DefaultRoutingTable object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'FloatingIPCollection') -> bool:
+ def __eq__(self, other: 'DefaultRoutingTable') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'FloatingIPCollection') -> bool:
+ def __ne__(self, other: 'DefaultRoutingTable') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
+ class AdvertiseRoutesToEnum(str, Enum):
+ """
+ An ingress source that routes can be advertised to:
+ - `direct_link` (requires `route_direct_link_ingress` be set to `true`)
+ - `transit_gateway` (requires `route_transit_gateway_ingress` be set to `true`).
+ """
-class FloatingIPCollectionFirst:
+ DIRECT_LINK = 'direct_link'
+ TRANSIT_GATEWAY = 'transit_gateway'
+
+
+ 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'
+
+
+ class ResourceTypeEnum(str, Enum):
+ """
+ The resource type.
+ """
+
+ ROUTING_TABLE = 'routing_table'
+
+
+
+class DefaultSecurityGroup:
"""
- A link to the first page of resources.
+ DefaultSecurityGroup.
- :attr str href: The URL for a page of resources.
+ :param datetime created_at: The date and time that this security group was
+ created.
+ :param str crn: The security group's CRN.
+ :param str href: The security group's canonical URL.
+ :param str id: The unique identifier for this security group.
+ :param str name: The name for the default security group for a VPC. The name
+ will be a hyphenated list of randomly-selected words at creation, but may
+ changed.
+ :param ResourceGroupReference resource_group: The resource group for this
+ security group.
+ :param List[SecurityGroupRule] rules: The rules for the default security group
+ for a VPC. Defaults to allowing all outbound traffic, and allowing all inbound
+ traffic from other interfaces in the VPC's default security group. Rules for the
+ default security group may be changed, added or removed.
+ :param List[SecurityGroupTargetReference] targets: The targets for this security
+ group.
+ :param VPCReference vpc: The VPC this security group resides in.
"""
def __init__(
self,
+ created_at: datetime,
+ crn: str,
href: str,
+ id: str,
+ name: str,
+ resource_group: 'ResourceGroupReference',
+ rules: List['SecurityGroupRule'],
+ targets: List['SecurityGroupTargetReference'],
+ vpc: 'VPCReference',
) -> None:
"""
- Initialize a FloatingIPCollectionFirst object.
+ Initialize a DefaultSecurityGroup object.
- :param str href: The URL for a page of resources.
+ :param datetime created_at: The date and time that this security group was
+ created.
+ :param str crn: The security group's CRN.
+ :param str href: The security group's canonical URL.
+ :param str id: The unique identifier for this security group.
+ :param str name: The name for the default security group for a VPC. The
+ name will be a hyphenated list of randomly-selected words at creation, but
+ may changed.
+ :param ResourceGroupReference resource_group: The resource group for this
+ security group.
+ :param List[SecurityGroupRule] rules: The rules for the default security
+ group for a VPC. Defaults to allowing all outbound traffic, and allowing
+ all inbound traffic from other interfaces in the VPC's default security
+ group. Rules for the default security group may be changed, added or
+ removed.
+ :param List[SecurityGroupTargetReference] targets: The targets for this
+ security group.
+ :param VPCReference vpc: The VPC this security group resides in.
"""
+ self.created_at = created_at
+ self.crn = crn
self.href = href
+ self.id = id
+ self.name = name
+ self.resource_group = resource_group
+ self.rules = rules
+ self.targets = targets
+ self.vpc = vpc
@classmethod
- def from_dict(cls, _dict: Dict) -> 'FloatingIPCollectionFirst':
- """Initialize a FloatingIPCollectionFirst object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'DefaultSecurityGroup':
+ """Initialize a DefaultSecurityGroup object from a json dictionary."""
args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ if (created_at := _dict.get('created_at')) is not None:
+ args['created_at'] = string_to_datetime(created_at)
else:
- raise ValueError('Required property \'href\' not present in FloatingIPCollectionFirst JSON')
+ raise ValueError('Required property \'created_at\' not present in DefaultSecurityGroup JSON')
+ if (crn := _dict.get('crn')) is not None:
+ args['crn'] = crn
+ else:
+ raise ValueError('Required property \'crn\' not present in DefaultSecurityGroup JSON')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
+ else:
+ raise ValueError('Required property \'href\' not present in DefaultSecurityGroup JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
+ else:
+ raise ValueError('Required property \'id\' not present in DefaultSecurityGroup JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ else:
+ raise ValueError('Required property \'name\' not present in DefaultSecurityGroup JSON')
+ if (resource_group := _dict.get('resource_group')) is not None:
+ args['resource_group'] = ResourceGroupReference.from_dict(resource_group)
+ else:
+ raise ValueError('Required property \'resource_group\' not present in DefaultSecurityGroup JSON')
+ if (rules := _dict.get('rules')) is not None:
+ args['rules'] = [SecurityGroupRule.from_dict(v) for v in rules]
+ else:
+ raise ValueError('Required property \'rules\' not present in DefaultSecurityGroup JSON')
+ if (targets := _dict.get('targets')) is not None:
+ args['targets'] = targets
+ else:
+ raise ValueError('Required property \'targets\' not present in DefaultSecurityGroup JSON')
+ if (vpc := _dict.get('vpc')) is not None:
+ args['vpc'] = VPCReference.from_dict(vpc)
+ else:
+ raise ValueError('Required property \'vpc\' not present in DefaultSecurityGroup JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a FloatingIPCollectionFirst object from a json dictionary."""
+ """Initialize a DefaultSecurityGroup object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
+ if hasattr(self, 'created_at') and self.created_at is not None:
+ _dict['created_at'] = datetime_to_string(self.created_at)
+ if hasattr(self, 'crn') and self.crn is not None:
+ _dict['crn'] = self.crn
if hasattr(self, 'href') and self.href is not None:
_dict['href'] = self.href
+ if hasattr(self, 'id') and self.id is not None:
+ _dict['id'] = self.id
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ if hasattr(self, 'resource_group') and self.resource_group is not None:
+ if isinstance(self.resource_group, dict):
+ _dict['resource_group'] = self.resource_group
+ else:
+ _dict['resource_group'] = self.resource_group.to_dict()
+ if hasattr(self, 'rules') and self.rules is not None:
+ rules_list = []
+ for v in self.rules:
+ if isinstance(v, dict):
+ rules_list.append(v)
+ else:
+ rules_list.append(v.to_dict())
+ _dict['rules'] = rules_list
+ if hasattr(self, 'targets') and self.targets is not None:
+ targets_list = []
+ for v in self.targets:
+ if isinstance(v, dict):
+ targets_list.append(v)
+ else:
+ targets_list.append(v.to_dict())
+ _dict['targets'] = targets_list
+ if hasattr(self, 'vpc') and self.vpc is not None:
+ if isinstance(self.vpc, dict):
+ _dict['vpc'] = self.vpc
+ else:
+ _dict['vpc'] = self.vpc.to_dict()
return _dict
def _to_dict(self):
@@ -36681,148 +38765,85 @@ 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 DefaultSecurityGroup object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'FloatingIPCollectionFirst') -> bool:
+ def __eq__(self, other: 'DefaultSecurityGroup') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'FloatingIPCollectionFirst') -> bool:
+ def __ne__(self, other: 'DefaultSecurityGroup') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class FloatingIPCollectionNext:
+class EncryptionKeyIdentity:
"""
- A link to the next page of resources. This property is present for all pages except
- the last page.
+ Identifies an encryption key by a unique property.
- :attr str href: The URL for a page of resources.
"""
def __init__(
self,
- href: str,
) -> None:
"""
- Initialize a FloatingIPCollectionNext object.
+ Initialize a EncryptionKeyIdentity object.
- :param str href: The URL for a page of resources.
"""
- self.href = href
-
- @classmethod
- def from_dict(cls, _dict: Dict) -> 'FloatingIPCollectionNext':
- """Initialize a FloatingIPCollectionNext object from a json dictionary."""
- args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
- else:
- raise ValueError('Required property \'href\' not present in FloatingIPCollectionNext JSON')
- return cls(**args)
-
- @classmethod
- def _from_dict(cls, _dict):
- """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, '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 FloatingIPCollectionNext object."""
- return json.dumps(self.to_dict(), indent=2)
-
- 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: 'FloatingIPCollectionNext') -> 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(['EncryptionKeyIdentityByCRN'])
+ )
+ raise Exception(msg)
-class FloatingIPPatch:
+class EncryptionKeyReference:
"""
- FloatingIPPatch.
+ EncryptionKeyReference.
- :attr str name: (optional) The name for this floating IP. The name must not be
- used by another floating IP in the region.
- :attr FloatingIPTargetPatch target: (optional) The target resource to bind this
- floating IP to, replacing any existing binding.
- The floating IP must not be required by another resource, such as a public
- gateway.
- The target resource must not already have a floating IP bound to it if the
- target
- resource is:
- - an instance network interface
- - a bare metal server network interface with `enable_infrastructure_nat` set to
- `true`.
+ :param str crn: The CRN of the [Key Protect Root
+ Key](https://cloud.ibm.com/docs/key-protect?topic=key-protect-getting-started-tutorial)
+ or [Hyper Protect Crypto Services Root
+ Key](https://cloud.ibm.com/docs/hs-crypto?topic=hs-crypto-get-started) for this
+ resource.
"""
def __init__(
self,
- *,
- name: str = None,
- target: 'FloatingIPTargetPatch' = None,
+ crn: str,
) -> None:
"""
- Initialize a FloatingIPPatch object.
+ Initialize a EncryptionKeyReference object.
- :param str name: (optional) The name for this floating IP. The name must
- not be used by another floating IP in the region.
- :param FloatingIPTargetPatch target: (optional) The target resource to bind
- this floating IP to, replacing any existing binding.
- The floating IP must not be required by another resource, such as a public
- gateway.
- The target resource must not already have a floating IP bound to it if the
- target
- resource is:
- - an instance network interface
- - a bare metal server network interface with `enable_infrastructure_nat`
- set to `true`.
+ :param str crn: The CRN of the [Key Protect Root
+ Key](https://cloud.ibm.com/docs/key-protect?topic=key-protect-getting-started-tutorial)
+ or [Hyper Protect Crypto Services Root
+ Key](https://cloud.ibm.com/docs/hs-crypto?topic=hs-crypto-get-started) for
+ this resource.
"""
- self.name = name
- self.target = target
+ self.crn = crn
@classmethod
- def from_dict(cls, _dict: Dict) -> 'FloatingIPPatch':
- """Initialize a FloatingIPPatch object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'EncryptionKeyReference':
+ """Initialize a EncryptionKeyReference 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 (crn := _dict.get('crn')) is not None:
+ args['crn'] = crn
+ else:
+ raise ValueError('Required property \'crn\' not present in EncryptionKeyReference JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a FloatingIPPatch object from a json dictionary."""
+ """Initialize a EncryptionKeyReference object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, '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, 'crn') and self.crn is not None:
+ _dict['crn'] = self.crn
return _dict
def _to_dict(self):
@@ -36830,152 +38851,285 @@ 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 EncryptionKeyReference object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'FloatingIPPatch') -> bool:
+ def __eq__(self, other: 'EncryptionKeyReference') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'FloatingIPPatch') -> bool:
+ def __ne__(self, other: 'EncryptionKeyReference') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class FloatingIPPrototype:
+class EndpointGateway:
"""
- FloatingIPPrototype.
+ EndpointGateway.
- :attr str name: (optional) The name for this floating IP. The name must not be
- used by another floating IP in the region. If unspecified, the name will be a
- hyphenated list of randomly-selected words.
- :attr ResourceGroupIdentity resource_group: (optional) The resource group to
- use. If unspecified, the account's [default resource
- group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be
- used.
+ :param bool allow_dns_resolution_binding: Indicates whether to allow DNS
+ resolution for this endpoint gateway when the VPC this endpoint gateway resides
+ in has a DNS resolution binding to a VPC with `dns.enable_hub` set to `true`.
+ :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 List[EndpointGatewayLifecycleReason] lifecycle_reasons: The reasons for
+ the current `lifecycle_state` (if any):
+ - `dns_resolution_binding_pending`: the DNS resolution binding is being set up.
+ :param str lifecycle_state: The lifecycle state of the endpoint gateway.
+ :param str name: The name for this endpoint gateway. The name is unique across
+ all endpoint gateways in the VPC.
+ :param ResourceGroupReference resource_group: The resource group for this
+ endpoint gateway.
+ :param str resource_type: The resource type.
+ :param List[SecurityGroupReference] security_groups: The security groups
+ targeting this endpoint gateway.
+ :param str service_endpoint: (optional) Deprecated: The fully qualified domain
+ name for the target service.
+ :param List[str] service_endpoints: The fully qualified domain names for the
+ target service.
+ :param EndpointGatewayTarget target: The target for this endpoint gateway.
+ :param VPCReference vpc: The VPC this endpoint gateway resides in.
"""
def __init__(
self,
+ allow_dns_resolution_binding: bool,
+ created_at: datetime,
+ crn: str,
+ health_state: str,
+ href: str,
+ id: str,
+ ips: List['ReservedIPReference'],
+ lifecycle_reasons: List['EndpointGatewayLifecycleReason'],
+ lifecycle_state: str,
+ name: str,
+ resource_group: 'ResourceGroupReference',
+ resource_type: str,
+ security_groups: List['SecurityGroupReference'],
+ service_endpoints: List[str],
+ target: 'EndpointGatewayTarget',
+ vpc: 'VPCReference',
*,
- name: str = None,
- resource_group: 'ResourceGroupIdentity' = None,
+ service_endpoint: Optional[str] = None,
) -> None:
"""
- Initialize a FloatingIPPrototype object.
-
- :param str name: (optional) The name for this floating IP. The name must
- not be used by another floating IP in the region. If unspecified, the name
- will be a hyphenated list of randomly-selected words.
- :param ResourceGroupIdentity resource_group: (optional) The resource group
- to use. If unspecified, the account's [default resource
- group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be
- used.
- """
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['FloatingIPPrototypeFloatingIPByZone', 'FloatingIPPrototypeFloatingIPByTarget'])
- )
- raise Exception(msg)
-
+ Initialize a EndpointGateway object.
-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 name for this floating IP. The name is unique across all
- floating IPs in the region.
- """
-
- def __init__(
- self,
- address: str,
- crn: str,
- href: str,
- id: str,
- name: str,
- *,
- deleted: 'FloatingIPReferenceDeleted' = None,
- ) -> None:
- """
- Initialize a FloatingIPReference object.
-
- :param str address: The globally unique IP address.
- :param str crn: The CRN for this floating IP.
- :param str href: The URL for this floating IP.
- :param str id: The unique identifier for this floating IP.
- :param str name: The name for this floating IP. The name is unique across
- all floating IPs in the region.
- :param FloatingIPReferenceDeleted deleted: (optional) If present, this
- property indicates the referenced resource has been deleted, and provides
- some supplementary information.
+ :param bool allow_dns_resolution_binding: Indicates whether to allow DNS
+ resolution for this endpoint gateway when the VPC this endpoint gateway
+ resides in has a DNS resolution binding to a VPC with `dns.enable_hub` set
+ to `true`.
+ :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 List[EndpointGatewayLifecycleReason] lifecycle_reasons: The reasons
+ for the current `lifecycle_state` (if any):
+ - `dns_resolution_binding_pending`: the DNS resolution binding is being set
+ up.
+ :param str lifecycle_state: The lifecycle state of the endpoint gateway.
+ :param str name: The name for this endpoint gateway. The name is unique
+ across all endpoint gateways in the VPC.
+ :param ResourceGroupReference resource_group: The resource group for this
+ endpoint gateway.
+ :param str resource_type: The resource type.
+ :param List[SecurityGroupReference] security_groups: The security groups
+ targeting this endpoint gateway.
+ :param List[str] service_endpoints: The fully qualified domain names for
+ the target service.
+ :param EndpointGatewayTarget target: The target for this endpoint gateway.
+ :param VPCReference vpc: The VPC this endpoint gateway resides in.
+ :param str service_endpoint: (optional) Deprecated: The fully qualified
+ domain name for the target service.
"""
- self.address = address
+ self.allow_dns_resolution_binding = allow_dns_resolution_binding
+ self.created_at = created_at
self.crn = crn
- self.deleted = deleted
+ self.health_state = health_state
self.href = href
self.id = id
+ self.ips = ips
+ self.lifecycle_reasons = lifecycle_reasons
+ 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) -> 'FloatingIPReference':
- """Initialize a FloatingIPReference object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'EndpointGateway':
+ """Initialize a EndpointGateway object from a json dictionary."""
args = {}
- if 'address' in _dict:
- args['address'] = _dict.get('address')
+ if (allow_dns_resolution_binding := _dict.get('allow_dns_resolution_binding')) is not None:
+ args['allow_dns_resolution_binding'] = allow_dns_resolution_binding
else:
- raise ValueError('Required property \'address\' not present in FloatingIPReference JSON')
- if 'crn' in _dict:
- args['crn'] = _dict.get('crn')
+ raise ValueError('Required property \'allow_dns_resolution_binding\' not present in EndpointGateway JSON')
+ if (created_at := _dict.get('created_at')) is not None:
+ args['created_at'] = string_to_datetime(created_at)
else:
- raise ValueError('Required property \'crn\' not present in FloatingIPReference JSON')
- if 'deleted' in _dict:
- args['deleted'] = FloatingIPReferenceDeleted.from_dict(_dict.get('deleted'))
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ raise ValueError('Required property \'created_at\' not present in EndpointGateway JSON')
+ if (crn := _dict.get('crn')) is not None:
+ args['crn'] = crn
else:
- raise ValueError('Required property \'href\' not present in FloatingIPReference JSON')
- if 'id' in _dict:
- args['id'] = _dict.get('id')
+ raise ValueError('Required property \'crn\' not present in EndpointGateway JSON')
+ if (health_state := _dict.get('health_state')) is not None:
+ args['health_state'] = health_state
else:
- raise ValueError('Required property \'id\' not present in FloatingIPReference JSON')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
+ raise ValueError('Required property \'health_state\' not present in EndpointGateway JSON')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'name\' not present in FloatingIPReference JSON')
+ raise ValueError('Required property \'href\' not present in EndpointGateway JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
+ else:
+ raise ValueError('Required property \'id\' not present in EndpointGateway JSON')
+ if (ips := _dict.get('ips')) is not None:
+ args['ips'] = [ReservedIPReference.from_dict(v) for v in ips]
+ else:
+ raise ValueError('Required property \'ips\' not present in EndpointGateway JSON')
+ if (lifecycle_reasons := _dict.get('lifecycle_reasons')) is not None:
+ args['lifecycle_reasons'] = [EndpointGatewayLifecycleReason.from_dict(v) for v in lifecycle_reasons]
+ else:
+ raise ValueError('Required property \'lifecycle_reasons\' not present in EndpointGateway JSON')
+ if (lifecycle_state := _dict.get('lifecycle_state')) is not None:
+ args['lifecycle_state'] = lifecycle_state
+ else:
+ raise ValueError('Required property \'lifecycle_state\' not present in EndpointGateway JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ else:
+ raise ValueError('Required property \'name\' not present in EndpointGateway JSON')
+ if (resource_group := _dict.get('resource_group')) is not None:
+ args['resource_group'] = ResourceGroupReference.from_dict(resource_group)
+ else:
+ raise ValueError('Required property \'resource_group\' not present in EndpointGateway JSON')
+ if (resource_type := _dict.get('resource_type')) is not None:
+ args['resource_type'] = resource_type
+ else:
+ raise ValueError('Required property \'resource_type\' not present in EndpointGateway JSON')
+ if (security_groups := _dict.get('security_groups')) is not None:
+ args['security_groups'] = [SecurityGroupReference.from_dict(v) for v in security_groups]
+ else:
+ raise ValueError('Required property \'security_groups\' not present in EndpointGateway JSON')
+ if (service_endpoint := _dict.get('service_endpoint')) is not None:
+ args['service_endpoint'] = service_endpoint
+ if (service_endpoints := _dict.get('service_endpoints')) is not None:
+ args['service_endpoints'] = service_endpoints
+ else:
+ raise ValueError('Required property \'service_endpoints\' not present in EndpointGateway JSON')
+ if (target := _dict.get('target')) is not None:
+ args['target'] = target
+ else:
+ raise ValueError('Required property \'target\' not present in EndpointGateway JSON')
+ if (vpc := _dict.get('vpc')) is not None:
+ args['vpc'] = VPCReference.from_dict(vpc)
+ else:
+ raise ValueError('Required property \'vpc\' not present in EndpointGateway JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a FloatingIPReference 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, 'address') and self.address is not None:
- _dict['address'] = self.address
+ if hasattr(self, 'allow_dns_resolution_binding') and self.allow_dns_resolution_binding is not None:
+ _dict['allow_dns_resolution_binding'] = self.allow_dns_resolution_binding
+ if hasattr(self, 'created_at') and self.created_at is not None:
+ _dict['created_at'] = datetime_to_string(self.created_at)
if hasattr(self, 'crn') and self.crn is not None:
_dict['crn'] = self.crn
- if hasattr(self, 'deleted') and self.deleted is not None:
- if isinstance(self.deleted, dict):
- _dict['deleted'] = self.deleted
- else:
- _dict['deleted'] = self.deleted.to_dict()
+ if hasattr(self, '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, 'ips') and self.ips is not None:
+ ips_list = []
+ for v in self.ips:
+ if isinstance(v, dict):
+ ips_list.append(v)
+ else:
+ ips_list.append(v.to_dict())
+ _dict['ips'] = ips_list
+ if hasattr(self, 'lifecycle_reasons') and self.lifecycle_reasons is not None:
+ lifecycle_reasons_list = []
+ for v in self.lifecycle_reasons:
+ if isinstance(v, dict):
+ lifecycle_reasons_list.append(v)
+ else:
+ lifecycle_reasons_list.append(v.to_dict())
+ _dict['lifecycle_reasons'] = lifecycle_reasons_list
+ if hasattr(self, 'lifecycle_state') and self.lifecycle_state is not None:
+ _dict['lifecycle_state'] = self.lifecycle_state
if hasattr(self, 'name') and self.name is not None:
_dict['name'] = self.name
+ if hasattr(self, 'resource_group') and self.resource_group is not None:
+ if isinstance(self.resource_group, dict):
+ _dict['resource_group'] = self.resource_group
+ else:
+ _dict['resource_group'] = self.resource_group.to_dict()
+ if hasattr(self, 'resource_type') and self.resource_type is not None:
+ _dict['resource_type'] = self.resource_type
+ if hasattr(self, 'security_groups') and self.security_groups is not None:
+ security_groups_list = []
+ for v in self.security_groups:
+ if isinstance(v, dict):
+ security_groups_list.append(v)
+ else:
+ security_groups_list.append(v.to_dict())
+ _dict['security_groups'] = security_groups_list
+ if hasattr(self, 'service_endpoint') and self.service_endpoint is not None:
+ _dict['service_endpoint'] = self.service_endpoint
+ if hasattr(self, 'service_endpoints') and self.service_endpoints is not None:
+ _dict['service_endpoints'] = self.service_endpoints
+ if hasattr(self, 'target') and self.target is not None:
+ if isinstance(self.target, dict):
+ _dict['target'] = self.target
+ else:
+ _dict['target'] = self.target.to_dict()
+ if hasattr(self, 'vpc') and self.vpc is not None:
+ if isinstance(self.vpc, dict):
+ _dict['vpc'] = self.vpc
+ else:
+ _dict['vpc'] = self.vpc.to_dict()
return _dict
def _to_dict(self):
@@ -36983,59 +39137,158 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this FloatingIPReference object."""
+ """Return a `str` version of this EndpointGateway object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'FloatingIPReference') -> bool:
+ def __eq__(self, other: 'EndpointGateway') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'FloatingIPReference') -> bool:
+ def __ne__(self, other: 'EndpointGateway') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
+ class HealthStateEnum(str, Enum):
+ """
+ The health of this resource.
+ - `ok`: No abnormal behavior detected
+ - `degraded`: Experiencing compromised performance, capacity, or connectivity
+ - `faulted`: Completely unreachable, inoperative, or otherwise entirely
+ incapacitated
+ - `inapplicable`: The health state does not apply because of the current lifecycle
+ state. A resource with a lifecycle state of `failed` or `deleting` will have a
+ health state of `inapplicable`. A `pending` resource may also have this state.
+ """
+
+ DEGRADED = 'degraded'
+ FAULTED = 'faulted'
+ INAPPLICABLE = 'inapplicable'
+ OK = 'ok'
+
-class FloatingIPReferenceDeleted:
+ 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'
+
+
+ class ResourceTypeEnum(str, Enum):
+ """
+ The resource type.
+ """
+
+ ENDPOINT_GATEWAY = 'endpoint_gateway'
+
+
+
+class EndpointGatewayCollection:
"""
- If present, this property indicates the referenced resource has been deleted, and
- provides some supplementary information.
+ EndpointGatewayCollection.
- :attr str more_info: Link to documentation about deleted resources.
+ :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 EndpointGatewayCollectionNext next: (optional) A link to the next page of
+ resources. This property is present for all pages
+ except the last page.
+ :param int total_count: The total number of resources across all pages.
"""
def __init__(
self,
- more_info: str,
+ endpoint_gateways: List['EndpointGateway'],
+ first: 'EndpointGatewayCollectionFirst',
+ limit: int,
+ total_count: int,
+ *,
+ next: Optional['EndpointGatewayCollectionNext'] = None,
) -> None:
"""
- Initialize a FloatingIPReferenceDeleted object.
+ Initialize a EndpointGatewayCollection object.
- :param str more_info: Link to documentation about deleted resources.
+ :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 EndpointGatewayCollectionNext 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.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) -> 'FloatingIPReferenceDeleted':
- """Initialize a FloatingIPReferenceDeleted object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'EndpointGatewayCollection':
+ """Initialize a EndpointGatewayCollection object from a json dictionary."""
args = {}
- if 'more_info' in _dict:
- args['more_info'] = _dict.get('more_info')
+ if (endpoint_gateways := _dict.get('endpoint_gateways')) is not None:
+ args['endpoint_gateways'] = [EndpointGateway.from_dict(v) for v in endpoint_gateways]
else:
- raise ValueError('Required property \'more_info\' not present in FloatingIPReferenceDeleted JSON')
+ raise ValueError('Required property \'endpoint_gateways\' not present in EndpointGatewayCollection JSON')
+ if (first := _dict.get('first')) is not None:
+ args['first'] = EndpointGatewayCollectionFirst.from_dict(first)
+ else:
+ raise ValueError('Required property \'first\' not present in EndpointGatewayCollection JSON')
+ if (limit := _dict.get('limit')) is not None:
+ args['limit'] = limit
+ else:
+ raise ValueError('Required property \'limit\' not present in EndpointGatewayCollection JSON')
+ if (next := _dict.get('next')) is not None:
+ args['next'] = EndpointGatewayCollectionNext.from_dict(next)
+ if (total_count := _dict.get('total_count')) is not None:
+ args['total_count'] = total_count
+ else:
+ raise ValueError('Required property \'total_count\' not present in EndpointGatewayCollection JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a FloatingIPReferenceDeleted 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, 'more_info') and self.more_info is not None:
- _dict['more_info'] = self.more_info
+ if hasattr(self, 'endpoint_gateways') and self.endpoint_gateways is not None:
+ endpoint_gateways_list = []
+ for v in self.endpoint_gateways:
+ if isinstance(v, dict):
+ endpoint_gateways_list.append(v)
+ else:
+ endpoint_gateways_list.append(v.to_dict())
+ _dict['endpoint_gateways'] = endpoint_gateways_list
+ if hasattr(self, 'first') and self.first is not None:
+ if isinstance(self.first, dict):
+ _dict['first'] = self.first
+ else:
+ _dict['first'] = self.first.to_dict()
+ if hasattr(self, 'limit') and self.limit is not None:
+ _dict['limit'] = self.limit
+ if hasattr(self, 'next') and self.next is not None:
+ if isinstance(self.next, dict):
+ _dict['next'] = self.next
+ else:
+ _dict['next'] = self.next.to_dict()
+ if hasattr(self, 'total_count') and self.total_count is not None:
+ _dict['total_count'] = self.total_count
return _dict
def _to_dict(self):
@@ -37043,132 +39296,200 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this FloatingIPReferenceDeleted object."""
+ """Return a `str` version of this EndpointGatewayCollection object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'FloatingIPReferenceDeleted') -> 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: 'FloatingIPReferenceDeleted') -> bool:
+ def __ne__(self, other: 'EndpointGatewayCollection') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class FloatingIPTarget:
+class EndpointGatewayCollectionFirst:
"""
- The target of this floating IP.
+ A link to the first page of resources.
+ :param str href: The URL for a page of resources.
"""
def __init__(
self,
+ href: str,
) -> None:
"""
- Initialize a FloatingIPTarget object.
+ Initialize a EndpointGatewayCollectionFirst object.
+ :param str href: The URL for a page of resources.
"""
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['FloatingIPTargetNetworkInterfaceReference', 'FloatingIPTargetBareMetalServerNetworkInterfaceReference', 'FloatingIPTargetPublicGatewayReference'])
- )
- raise Exception(msg)
+ self.href = href
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'EndpointGatewayCollectionFirst':
+ """Initialize a EndpointGatewayCollectionFirst object from a json dictionary."""
+ args = {}
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
+ else:
+ raise ValueError('Required property \'href\' not present in EndpointGatewayCollectionFirst JSON')
+ return cls(**args)
-class FloatingIPTargetPatch:
- """
- The target resource to bind this floating IP to, replacing any existing binding. The
- floating IP must not be required by another resource, such as a public gateway.
- The target resource must not already have a floating IP bound to it if the target
- resource is:
- - an instance network interface
- - a bare metal server network interface with `enable_infrastructure_nat` set to
- `true`.
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a EndpointGatewayCollectionFirst object from a json dictionary."""
+ return cls.from_dict(_dict)
- """
+ def to_dict(self) -> Dict:
+ """Return a json dictionary representing this model."""
+ _dict = {}
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
+ return _dict
- def __init__(
- self,
- ) -> None:
- """
- Initialize a FloatingIPTargetPatch 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(['FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentity', 'FloatingIPTargetPatchNetworkInterfaceIdentity'])
- )
- raise Exception(msg)
+ def __str__(self) -> str:
+ """Return a `str` version of this EndpointGatewayCollectionFirst object."""
+ return json.dumps(self.to_dict(), indent=2)
+ 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__
-class FloatingIPTargetPrototype:
+ def __ne__(self, other: 'EndpointGatewayCollectionFirst') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+
+class EndpointGatewayCollectionNext:
"""
- The target resource to bind this floating IP to.
- The target resource must not already have a floating IP bound to it if the target
- resource is:
- - an instance network interface
- - a bare metal server network interface with `enable_infrastructure_nat` set to
- `true`.
+ 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.
"""
def __init__(
self,
+ href: str,
) -> None:
"""
- Initialize a FloatingIPTargetPrototype object.
+ Initialize a EndpointGatewayCollectionNext object.
+ :param str href: The URL for a page of resources.
"""
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentity', 'FloatingIPTargetPrototypeNetworkInterfaceIdentity'])
- )
- raise Exception(msg)
+ self.href = href
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'EndpointGatewayCollectionNext':
+ """Initialize a EndpointGatewayCollectionNext object from a json dictionary."""
+ args = {}
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
+ else:
+ raise ValueError('Required property \'href\' not present in EndpointGatewayCollectionNext JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a EndpointGatewayCollectionNext object from a json dictionary."""
+ return cls.from_dict(_dict)
+ def to_dict(self) -> Dict:
+ """Return a json dictionary representing this model."""
+ _dict = {}
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
+ return _dict
-class FloatingIPUnpaginatedCollection:
+ def _to_dict(self):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
+
+ def __str__(self) -> str:
+ """Return a `str` version of this EndpointGatewayCollectionNext object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ 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: 'EndpointGatewayCollectionNext') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+
+class EndpointGatewayLifecycleReason:
"""
- FloatingIPUnpaginatedCollection.
+ EndpointGatewayLifecycleReason.
- :attr List[FloatingIP] floating_ips: Collection of floating IPs.
+ :param str code: A snake case string succinctly identifying the reason for this
+ lifecycle state.
+ :param str message: An explanation of the reason for this lifecycle state.
+ :param str more_info: (optional) Link to documentation about the reason for this
+ lifecycle state.
"""
def __init__(
self,
- floating_ips: List['FloatingIP'],
+ code: str,
+ message: str,
+ *,
+ more_info: Optional[str] = None,
) -> None:
"""
- Initialize a FloatingIPUnpaginatedCollection object.
+ Initialize a EndpointGatewayLifecycleReason object.
- :param List[FloatingIP] floating_ips: Collection of floating IPs.
+ :param str code: A snake case string succinctly identifying the reason for
+ this lifecycle state.
+ :param str message: An explanation of the reason for this lifecycle state.
+ :param str more_info: (optional) Link to documentation about the reason for
+ this lifecycle state.
"""
- self.floating_ips = floating_ips
+ self.code = code
+ self.message = message
+ self.more_info = more_info
@classmethod
- def from_dict(cls, _dict: Dict) -> 'FloatingIPUnpaginatedCollection':
- """Initialize a FloatingIPUnpaginatedCollection object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'EndpointGatewayLifecycleReason':
+ """Initialize a EndpointGatewayLifecycleReason object from a json dictionary."""
args = {}
- if 'floating_ips' in _dict:
- args['floating_ips'] = [FloatingIP.from_dict(v) for v in _dict.get('floating_ips')]
+ if (code := _dict.get('code')) is not None:
+ args['code'] = code
else:
- raise ValueError('Required property \'floating_ips\' not present in FloatingIPUnpaginatedCollection JSON')
+ raise ValueError('Required property \'code\' not present in EndpointGatewayLifecycleReason JSON')
+ if (message := _dict.get('message')) is not None:
+ args['message'] = message
+ else:
+ raise ValueError('Required property \'message\' not present in EndpointGatewayLifecycleReason JSON')
+ if (more_info := _dict.get('more_info')) is not None:
+ args['more_info'] = more_info
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a FloatingIPUnpaginatedCollection object from a json dictionary."""
+ """Initialize a EndpointGatewayLifecycleReason object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'floating_ips') and self.floating_ips is not None:
- floating_ips_list = []
- for v in self.floating_ips:
- if isinstance(v, dict):
- floating_ips_list.append(v)
- else:
- floating_ips_list.append(v.to_dict())
- _dict['floating_ips'] = floating_ips_list
+ if hasattr(self, 'code') and self.code is not None:
+ _dict['code'] = self.code
+ if hasattr(self, 'message') and self.message is not None:
+ _dict['message'] = self.message
+ if hasattr(self, 'more_info') and self.more_info is not None:
+ _dict['more_info'] = self.more_info
return _dict
def _to_dict(self):
@@ -37176,226 +39497,88 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this FloatingIPUnpaginatedCollection object."""
+ """Return a `str` version of this EndpointGatewayLifecycleReason object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'FloatingIPUnpaginatedCollection') -> bool:
+ def __eq__(self, other: 'EndpointGatewayLifecycleReason') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'FloatingIPUnpaginatedCollection') -> bool:
+ def __ne__(self, other: 'EndpointGatewayLifecycleReason') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
+ class CodeEnum(str, Enum):
+ """
+ A snake case string succinctly identifying the reason for this lifecycle state.
+ """
-class FlowLogCollector:
+ DNS_RESOLUTION_BINDING_PENDING = 'dns_resolution_binding_pending'
+ RESOURCE_SUSPENDED_BY_PROVIDER = 'resource_suspended_by_provider'
+
+
+
+class EndpointGatewayPatch:
"""
- FlowLogCollector.
+ EndpointGatewayPatch.
- :attr bool active: Indicates whether this collector is active.
- :attr bool auto_delete: Indicates whether this flow log collector will be
- automatically deleted when `target` is deleted. At present, this is always
- `true`, but may be modifiable in the future.
- :attr datetime created_at: The date and time that the flow log collector was
- created.
- :attr str crn: The CRN for this flow log collector.
- :attr str href: The URL for this flow log collector.
- :attr str id: The unique identifier for this flow log collector.
- :attr str lifecycle_state: The lifecycle state of the flow log collector.
- :attr str name: The name for this flow log collector. The name is unique across
- all flow log collectors in the VPC.
- :attr ResourceGroupReference resource_group: The resource group for this flow
- log collector.
- :attr LegacyCloudObjectStorageBucketReference storage_bucket: The Cloud Object
- Storage bucket where the collected flows are logged. For more
- information, see [Viewing flow log
- objects](https://cloud.ibm.com/docs/vpc?topic=vpc-fl-analyze).
- :attr FlowLogCollectorTarget target: The target this collector is collecting
- flow logs for.
- - If the target is an instance network interface, flow logs will be collected
- for that instance network interface.
- - If the target is a virtual server instance, flow logs will be collected
- for all network interfaces on that instance.
- - If the target is a subnet, flow logs will be collected
- for all instance network interfaces attached to that subnet.
- - If the target is a VPC, flow logs will be collected for instance network
- interfaces
- attached to all subnets within that VPC.
- If the target is an instance, subnet, or VPC, flow logs will not be collected
- for any instance network interfaces within the target that are themselves the
- target of
- a more specific flow log collector.
- :attr VPCReference vpc: The VPC this flow log collector resides in.
+ :param bool allow_dns_resolution_binding: (optional) Indicates whether to allow
+ DNS resolution for this endpoint gateway when the VPC this endpoint gateway
+ resides in has a DNS resolution binding to a VPC with `dns.enable_hub` set to
+ `true`.
+ Must be `true` if the VPC this endpoint gateway resides in has `dns.enable_hub`
+ set to
+ `true`.
+ :param str name: (optional) The name for this endpoint gateway. The name must
+ not be used by another endpoint gateway in the VPC.
"""
def __init__(
self,
- active: bool,
- auto_delete: bool,
- created_at: datetime,
- crn: str,
- href: str,
- id: str,
- lifecycle_state: str,
- name: str,
- resource_group: 'ResourceGroupReference',
- storage_bucket: 'LegacyCloudObjectStorageBucketReference',
- target: 'FlowLogCollectorTarget',
- vpc: 'VPCReference',
+ *,
+ allow_dns_resolution_binding: Optional[bool] = None,
+ name: Optional[str] = None,
) -> None:
"""
- Initialize a FlowLogCollector object.
+ Initialize a EndpointGatewayPatch object.
- :param bool active: Indicates whether this collector is active.
- :param bool auto_delete: Indicates whether this flow log collector will be
- automatically deleted when `target` is deleted. At present, this is always
- `true`, but may be modifiable in the future.
- :param datetime created_at: The date and time that the flow log collector
- was created.
- :param str crn: The CRN for this flow log collector.
- :param str href: The URL for this flow log collector.
- :param str id: The unique identifier for this flow log collector.
- :param str lifecycle_state: The lifecycle state of the flow log collector.
- :param str name: The name for this flow log collector. The name is unique
- across all flow log collectors in the VPC.
- :param ResourceGroupReference resource_group: The resource group for this
- flow log collector.
- :param LegacyCloudObjectStorageBucketReference storage_bucket: The Cloud
- Object Storage bucket where the collected flows are logged. For more
- information, see [Viewing flow log
- objects](https://cloud.ibm.com/docs/vpc?topic=vpc-fl-analyze).
- :param FlowLogCollectorTarget target: The target this collector is
- collecting flow logs for.
- - If the target is an instance network interface, flow logs will be
- collected
- for that instance network interface.
- - If the target is a virtual server instance, flow logs will be collected
- for all network interfaces on that instance.
- - If the target is a subnet, flow logs will be collected
- for all instance network interfaces attached to that subnet.
- - If the target is a VPC, flow logs will be collected for instance network
- interfaces
- attached to all subnets within that VPC.
- If the target is an instance, subnet, or VPC, flow logs will not be
- collected
- for any instance network interfaces within the target that are themselves
- the target of
- a more specific flow log collector.
- :param VPCReference vpc: The VPC this flow log collector resides in.
+ :param bool allow_dns_resolution_binding: (optional) Indicates whether to
+ allow DNS resolution for this endpoint gateway when the VPC this endpoint
+ gateway resides in has a DNS resolution binding to a VPC with
+ `dns.enable_hub` set to `true`.
+ Must be `true` if the VPC this endpoint gateway resides in has
+ `dns.enable_hub` set to
+ `true`.
+ :param str name: (optional) The name for this endpoint gateway. The name
+ must not be used by another endpoint gateway in the VPC.
"""
- 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.allow_dns_resolution_binding = allow_dns_resolution_binding
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) -> 'FlowLogCollector':
- """Initialize a FlowLogCollector object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'EndpointGatewayPatch':
+ """Initialize a EndpointGatewayPatch 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 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'] = LegacyCloudObjectStorageBucketReference.from_dict(_dict.get('storage_bucket'))
- else:
- raise ValueError('Required property \'storage_bucket\' not present in FlowLogCollector JSON')
- if 'target' in _dict:
- args['target'] = _dict.get('target')
- else:
- raise ValueError('Required property \'target\' not present in FlowLogCollector JSON')
- if 'vpc' in _dict:
- args['vpc'] = VPCReference.from_dict(_dict.get('vpc'))
- else:
- raise ValueError('Required property \'vpc\' not present in FlowLogCollector JSON')
+ if (allow_dns_resolution_binding := _dict.get('allow_dns_resolution_binding')) is not None:
+ args['allow_dns_resolution_binding'] = allow_dns_resolution_binding
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a FlowLogCollector 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, '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, 'allow_dns_resolution_binding') and self.allow_dns_resolution_binding is not None:
+ _dict['allow_dns_resolution_binding'] = self.allow_dns_resolution_binding
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, 'storage_bucket') and self.storage_bucket is not None:
- if isinstance(self.storage_bucket, dict):
- _dict['storage_bucket'] = self.storage_bucket
- else:
- _dict['storage_bucket'] = self.storage_bucket.to_dict()
- if hasattr(self, 'target') and self.target is not None:
- if isinstance(self.target, dict):
- _dict['target'] = self.target
- else:
- _dict['target'] = self.target.to_dict()
- if hasattr(self, 'vpc') and self.vpc is not None:
- if isinstance(self.vpc, dict):
- _dict['vpc'] = self.vpc
- else:
- _dict['vpc'] = self.vpc.to_dict()
return _dict
def _to_dict(self):
@@ -37403,133 +39586,59 @@ 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 EndpointGatewayPatch object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'FlowLogCollector') -> 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: 'FlowLogCollector') -> bool:
+ def __ne__(self, other: 'EndpointGatewayPatch') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class LifecycleStateEnum(str, Enum):
- """
- The lifecycle state of the flow log collector.
- """
-
- DELETING = 'deleting'
- FAILED = 'failed'
- PENDING = 'pending'
- STABLE = 'stable'
- SUSPENDED = 'suspended'
- UPDATING = 'updating'
- WAITING = 'waiting'
-
-
-class FlowLogCollectorCollection:
+class EndpointGatewayReferenceDeleted:
"""
- FlowLogCollectorCollection.
+ If present, this property indicates the referenced resource has been deleted, and
+ provides some supplementary information.
- :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.
+ :param str more_info: Link to documentation about deleted resources.
"""
def __init__(
self,
- first: 'FlowLogCollectorCollectionFirst',
- flow_log_collectors: List['FlowLogCollector'],
- limit: int,
- total_count: int,
- *,
- next: 'FlowLogCollectorCollectionNext' = None,
+ more_info: str,
) -> None:
"""
- Initialize a FlowLogCollectorCollection object.
+ Initialize a EndpointGatewayReferenceDeleted object.
- :param FlowLogCollectorCollectionFirst first: A link to the first page of
- resources.
- :param List[FlowLogCollector] flow_log_collectors: Collection of flow log
- collectors.
- :param int limit: The maximum number of resources that can be returned by
- the request.
- :param int total_count: The total number of resources across all pages.
- :param FlowLogCollectorCollectionNext next: (optional) A link to the next
- page of resources. This property is present for all pages
- except the last page.
+ :param str more_info: Link to documentation about deleted resources.
"""
- self.first = first
- self.flow_log_collectors = flow_log_collectors
- self.limit = limit
- self.next = next
- self.total_count = total_count
+ self.more_info = more_info
@classmethod
- def from_dict(cls, _dict: Dict) -> 'FlowLogCollectorCollection':
- """Initialize a FlowLogCollectorCollection object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'EndpointGatewayReferenceDeleted':
+ """Initialize a EndpointGatewayReferenceDeleted object from a json dictionary."""
args = {}
- if 'first' in _dict:
- args['first'] = FlowLogCollectorCollectionFirst.from_dict(_dict.get('first'))
+ if (more_info := _dict.get('more_info')) is not None:
+ args['more_info'] = more_info
else:
- raise ValueError('Required property \'first\' not present in FlowLogCollectorCollection JSON')
- if 'flow_log_collectors' in _dict:
- args['flow_log_collectors'] = [FlowLogCollector.from_dict(v) for v in _dict.get('flow_log_collectors')]
- else:
- raise ValueError('Required property \'flow_log_collectors\' not present in FlowLogCollectorCollection JSON')
- if 'limit' in _dict:
- args['limit'] = _dict.get('limit')
- else:
- raise ValueError('Required property \'limit\' not present in FlowLogCollectorCollection JSON')
- if 'next' in _dict:
- args['next'] = FlowLogCollectorCollectionNext.from_dict(_dict.get('next'))
- if 'total_count' in _dict:
- args['total_count'] = _dict.get('total_count')
- else:
- raise ValueError('Required property \'total_count\' not present in FlowLogCollectorCollection JSON')
+ raise ValueError('Required property \'more_info\' not present in EndpointGatewayReferenceDeleted JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a FlowLogCollectorCollection 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, 'first') and self.first is not None:
- if isinstance(self.first, dict):
- _dict['first'] = self.first
- else:
- _dict['first'] = self.first.to_dict()
- if hasattr(self, 'flow_log_collectors') and self.flow_log_collectors is not None:
- flow_log_collectors_list = []
- for v in self.flow_log_collectors:
- if isinstance(v, dict):
- flow_log_collectors_list.append(v)
- else:
- flow_log_collectors_list.append(v.to_dict())
- _dict['flow_log_collectors'] = flow_log_collectors_list
- if hasattr(self, 'limit') and self.limit is not None:
- _dict['limit'] = self.limit
- if hasattr(self, 'next') and self.next is not None:
- if isinstance(self.next, dict):
- _dict['next'] = self.next
- else:
- _dict['next'] = self.next.to_dict()
- if hasattr(self, 'total_count') and self.total_count is not None:
- _dict['total_count'] = self.total_count
+ if hasattr(self, 'more_info') and self.more_info is not None:
+ _dict['more_info'] = self.more_info
return _dict
def _to_dict(self):
@@ -37537,58 +39646,116 @@ 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 EndpointGatewayReferenceDeleted object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'FlowLogCollectorCollection') -> 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: 'FlowLogCollectorCollection') -> bool:
+ def __ne__(self, other: 'EndpointGatewayReferenceDeleted') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class FlowLogCollectorCollectionFirst:
+class EndpointGatewayReferenceRemote:
"""
- A link to the first page of resources.
+ EndpointGatewayReferenceRemote.
- :attr str href: The URL for a page of resources.
+ :param str crn: The CRN for this endpoint gateway.
+ :param str href: The URL for this endpoint gateway.
+ :param str id: The unique identifier for this endpoint gateway.
+ :param str name: The name for this endpoint gateway. The name is unique across
+ all endpoint gateways in the VPC.
+ :param EndpointGatewayRemote remote: (optional) If present, this property
+ indicates that the resource associated with this reference
+ is remote and therefore may not be directly retrievable.
+ :param str resource_type: The resource type.
"""
def __init__(
self,
+ crn: str,
href: str,
+ id: str,
+ name: str,
+ resource_type: str,
+ *,
+ remote: Optional['EndpointGatewayRemote'] = None,
) -> None:
"""
- Initialize a FlowLogCollectorCollectionFirst object.
+ Initialize a EndpointGatewayReferenceRemote object.
- :param str href: The URL for a page of resources.
+ :param str crn: The CRN for this endpoint gateway.
+ :param str href: The URL for this endpoint gateway.
+ :param str id: The unique identifier for this endpoint gateway.
+ :param str name: The name for this endpoint gateway. The name is unique
+ across all endpoint gateways in the VPC.
+ :param str resource_type: The resource type.
+ :param EndpointGatewayRemote remote: (optional) If present, this property
+ indicates that the resource associated with this reference
+ is remote and therefore may not be directly retrievable.
"""
+ self.crn = crn
self.href = href
+ self.id = id
+ self.name = name
+ self.remote = remote
+ self.resource_type = resource_type
@classmethod
- def from_dict(cls, _dict: Dict) -> 'FlowLogCollectorCollectionFirst':
- """Initialize a FlowLogCollectorCollectionFirst object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'EndpointGatewayReferenceRemote':
+ """Initialize a EndpointGatewayReferenceRemote object from a json dictionary."""
args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ if (crn := _dict.get('crn')) is not None:
+ args['crn'] = crn
else:
- raise ValueError('Required property \'href\' not present in FlowLogCollectorCollectionFirst JSON')
+ raise ValueError('Required property \'crn\' not present in EndpointGatewayReferenceRemote JSON')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
+ else:
+ raise ValueError('Required property \'href\' not present in EndpointGatewayReferenceRemote JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
+ else:
+ raise ValueError('Required property \'id\' not present in EndpointGatewayReferenceRemote JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ else:
+ raise ValueError('Required property \'name\' not present in EndpointGatewayReferenceRemote JSON')
+ if (remote := _dict.get('remote')) is not None:
+ args['remote'] = EndpointGatewayRemote.from_dict(remote)
+ if (resource_type := _dict.get('resource_type')) is not None:
+ args['resource_type'] = resource_type
+ else:
+ raise ValueError('Required property \'resource_type\' not present in EndpointGatewayReferenceRemote JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a FlowLogCollectorCollectionFirst object from a json dictionary."""
+ """Initialize a EndpointGatewayReferenceRemote object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
+ if hasattr(self, 'crn') and self.crn is not None:
+ _dict['crn'] = self.crn
if hasattr(self, 'href') and self.href is not None:
_dict['href'] = self.href
+ if hasattr(self, 'id') and self.id is not None:
+ _dict['id'] = self.id
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ if hasattr(self, 'remote') and self.remote is not None:
+ if isinstance(self.remote, dict):
+ _dict['remote'] = self.remote
+ else:
+ _dict['remote'] = self.remote.to_dict()
+ if hasattr(self, 'resource_type') and self.resource_type is not None:
+ _dict['resource_type'] = self.resource_type
return _dict
def _to_dict(self):
@@ -37596,131 +39763,88 @@ 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 EndpointGatewayReferenceRemote object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'FlowLogCollectorCollectionFirst') -> bool:
+ def __eq__(self, other: 'EndpointGatewayReferenceRemote') -> bool:
"""Return `true` when 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: 'EndpointGatewayReferenceRemote') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-
-class FlowLogCollectorCollectionNext:
- """
- A link to the next page of resources. This property is present for all pages except
- the last page.
-
- :attr str href: The URL for a page of resources.
- """
-
- def __init__(
- self,
- href: str,
- ) -> None:
+ class ResourceTypeEnum(str, Enum):
"""
- Initialize a FlowLogCollectorCollectionNext object.
-
- :param str href: The URL for a page of resources.
+ The resource type.
"""
- self.href = href
-
- @classmethod
- def from_dict(cls, _dict: Dict) -> 'FlowLogCollectorCollectionNext':
- """Initialize a FlowLogCollectorCollectionNext 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')
- return cls(**args)
-
- @classmethod
- def _from_dict(cls, _dict):
- """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, '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 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__
+ ENDPOINT_GATEWAY = 'endpoint_gateway'
- def __ne__(self, other: 'FlowLogCollectorCollectionNext') -> bool:
- """Return `true` when self and other are not equal, false otherwise."""
- return not self == other
-class FlowLogCollectorPatch:
+class EndpointGatewayRemote:
"""
- FlowLogCollectorPatch.
+ If present, this property indicates that the resource associated with this reference
+ is remote and therefore may not be directly retrievable.
- :attr bool active: (optional) Indicates whether this collector is active.
- Updating to false deactivates the collector and updating to true activates the
- collector.
- :attr str name: (optional) The name for this flow log collector. The name must
- not be used by another flow log collector in the VPC.
+ :param AccountReference account: (optional) If present, this property indicates
+ that the referenced resource is remote to this
+ account, and identifies the owning account.
+ :param RegionReference region: (optional) If present, this property indicates
+ that the referenced resource is remote to this
+ region, and identifies the native region.
"""
def __init__(
self,
*,
- active: bool = None,
- name: str = None,
+ account: Optional['AccountReference'] = None,
+ region: Optional['RegionReference'] = None,
) -> None:
"""
- Initialize a FlowLogCollectorPatch object.
+ Initialize a EndpointGatewayRemote object.
- :param bool active: (optional) Indicates whether this collector is active.
- Updating to false deactivates the collector and updating to true activates
- the collector.
- :param str name: (optional) The name for this flow log collector. The name
- must not be used by another flow log collector in the VPC.
+ :param AccountReference account: (optional) If present, this property
+ indicates that the referenced resource is remote to this
+ account, and identifies the owning account.
+ :param RegionReference region: (optional) If present, this property
+ indicates that the referenced resource is remote to this
+ region, and identifies the native region.
"""
- self.active = active
- self.name = name
+ self.account = account
+ self.region = region
@classmethod
- def from_dict(cls, _dict: Dict) -> 'FlowLogCollectorPatch':
- """Initialize a FlowLogCollectorPatch object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'EndpointGatewayRemote':
+ """Initialize a EndpointGatewayRemote object from a json dictionary."""
args = {}
- if 'active' in _dict:
- args['active'] = _dict.get('active')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
+ if (account := _dict.get('account')) is not None:
+ args['account'] = AccountReference.from_dict(account)
+ if (region := _dict.get('region')) is not None:
+ args['region'] = RegionReference.from_dict(region)
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a FlowLogCollectorPatch object from a json dictionary."""
+ """Initialize a EndpointGatewayRemote object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'active') and self.active is not None:
- _dict['active'] = self.active
- if hasattr(self, 'name') and self.name is not None:
- _dict['name'] = self.name
+ if hasattr(self, 'account') and self.account is not None:
+ if isinstance(self.account, dict):
+ _dict['account'] = self.account
+ else:
+ _dict['account'] = self.account.to_dict()
+ if hasattr(self, 'region') and self.region is not None:
+ if isinstance(self.region, dict):
+ _dict['region'] = self.region
+ else:
+ _dict['region'] = self.region.to_dict()
return _dict
def _to_dict(self):
@@ -37728,33 +39852,26 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this FlowLogCollectorPatch object."""
+ """Return a `str` version of this EndpointGatewayRemote object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'FlowLogCollectorPatch') -> bool:
+ def __eq__(self, other: 'EndpointGatewayRemote') -> bool:
"""Return `true` when 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: 'EndpointGatewayRemote') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class FlowLogCollectorTarget:
+class EndpointGatewayReservedIP:
"""
- The target this collector is collecting flow logs for.
- - If the target is an instance network interface, flow logs will be collected
- for that instance network interface.
- - If the target is a virtual server instance, flow logs will be collected
- for all network interfaces on that instance.
- - If the target is a subnet, flow logs will be collected
- for all instance network interfaces attached to that subnet.
- - If the target is a VPC, flow logs will be collected for instance network interfaces
- attached to all subnets within that VPC. If the target is an instance, subnet, or
- VPC, flow logs will not be collected for any instance network interfaces within the
- target that are themselves the target of a more specific flow log collector.
+ 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.
"""
@@ -37762,21 +39879,18 @@ def __init__(
self,
) -> None:
"""
- Initialize a FlowLogCollectorTarget object.
+ Initialize a EndpointGatewayReservedIP object.
"""
msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['FlowLogCollectorTargetNetworkInterfaceReferenceTargetContext', 'FlowLogCollectorTargetInstanceReference', 'FlowLogCollectorTargetSubnetReference', 'FlowLogCollectorTargetVPCReference'])
+ ", ".join(['EndpointGatewayReservedIPReservedIPIdentity', 'EndpointGatewayReservedIPReservedIPPrototypeTargetContext'])
)
raise Exception(msg)
-class FlowLogCollectorTargetPrototype:
+class EndpointGatewayTarget:
"""
- The target this collector will collect flow logs for. If the target is an instance,
- subnet, or VPC, flow logs will not be collected for any instance network interfaces
- within the target that are themselves the target of a more specific flow log
- collector.
+ The target for this endpoint gateway.
"""
@@ -37784,256 +39898,221 @@ def __init__(
self,
) -> None:
"""
- Initialize a FlowLogCollectorTargetPrototype object.
+ Initialize a EndpointGatewayTarget object.
"""
msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['FlowLogCollectorTargetPrototypeNetworkInterfaceIdentity', 'FlowLogCollectorTargetPrototypeInstanceIdentity', 'FlowLogCollectorTargetPrototypeSubnetIdentity', 'FlowLogCollectorTargetPrototypeVPCIdentity'])
+ ", ".join(['EndpointGatewayTargetProviderCloudServiceReference', 'EndpointGatewayTargetProviderInfrastructureServiceReference'])
)
raise Exception(msg)
-class GenericResourceReferenceDeleted:
+class EndpointGatewayTargetPrototype:
"""
- If present, this property indicates the referenced resource has been deleted, and
- provides some supplementary information.
+ The target to use for this endpoint gateway. Must not already be the target of another
+ endpoint gateway in the VPC.
- :attr str more_info: Link to documentation about deleted resources.
+ :param str resource_type: The type of target for this endpoint gateway.
"""
def __init__(
self,
- more_info: str,
+ resource_type: str,
) -> None:
"""
- Initialize a GenericResourceReferenceDeleted object.
+ Initialize a EndpointGatewayTargetPrototype object.
- :param str more_info: Link to documentation about deleted resources.
+ :param str resource_type: The type of target for this endpoint gateway.
"""
- self.more_info = more_info
+ 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) -> 'GenericResourceReferenceDeleted':
- """Initialize a GenericResourceReferenceDeleted object from a json dictionary."""
- args = {}
- if 'more_info' in _dict:
- args['more_info'] = _dict.get('more_info')
- else:
- raise ValueError('Required property \'more_info\' not present in GenericResourceReferenceDeleted JSON')
- return cls(**args)
+ 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 GenericResourceReferenceDeleted 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, '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()
+ @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 __str__(self) -> str:
- """Return a `str` version of this GenericResourceReferenceDeleted object."""
- return json.dumps(self.to_dict(), indent=2)
+ class ResourceTypeEnum(str, Enum):
+ """
+ The type of target for this endpoint gateway.
+ """
- def __eq__(self, other: 'GenericResourceReferenceDeleted') -> bool:
- """Return `true` when self and other are equal, false otherwise."""
- if not isinstance(other, self.__class__):
- return False
- return self.__dict__ == other.__dict__
+ PROVIDER_CLOUD_SERVICE = 'provider_cloud_service'
+ PROVIDER_INFRASTRUCTURE_SERVICE = 'provider_infrastructure_service'
- def __ne__(self, other: 'GenericResourceReferenceDeleted') -> bool:
- """Return `true` when self and other are not equal, false otherwise."""
- return not self == other
-class IKEPolicy:
+class FloatingIP:
"""
- IKEPolicy.
+ FloatingIP.
- :attr str authentication_algorithm: The authentication algorithm
- The `md5` and `sha1` algorithms have been deprecated.
- :attr List[VPNGatewayConnectionReference] connections: The VPN gateway
- connections that use this IKE policy.
- :attr datetime created_at: The date and time that this IKE policy was created.
- :attr int dh_group: The Diffie-Hellman group
- Groups `2` and `5` have been deprecated.
- :attr str encryption_algorithm: The encryption algorithm
- The `triple_des` algorithm has been deprecated.
- :attr str href: The IKE policy's canonical URL.
- :attr str id: The unique identifier for this IKE policy.
- :attr int ike_version: The IKE protocol version.
- :attr int key_lifetime: The key lifetime in seconds.
- :attr str name: The name for this IKE policy. The name is unique across all IKE
- policies in the region.
- :attr str negotiation_mode: The IKE negotiation mode. Only `main` is supported.
- :attr ResourceGroupReference resource_group: The resource group for this IKE
- policy.
- :attr str resource_type: The resource type.
+ :param str address: The globally unique IP address.
+ :param datetime created_at: The date and time that the floating IP was created.
+ :param str crn: The CRN for this floating IP.
+ :param str href: The URL for this floating IP.
+ :param str id: The unique identifier for this floating IP.
+ :param str name: The name for this floating IP. The name is unique across all
+ floating IPs in the region.
+ :param ResourceGroupReference resource_group: The resource group for this
+ floating IP.
+ :param str status: The status of the floating IP.
+ :param FloatingIPTarget target: (optional) The target of this floating IP.
+ :param ZoneReference zone: The zone this floating IP resides in.
"""
def __init__(
self,
- authentication_algorithm: str,
- connections: List['VPNGatewayConnectionReference'],
+ address: str,
created_at: datetime,
- dh_group: int,
- encryption_algorithm: str,
+ crn: str,
href: str,
id: str,
- ike_version: int,
- key_lifetime: int,
name: str,
- negotiation_mode: str,
resource_group: 'ResourceGroupReference',
- resource_type: str,
+ status: str,
+ zone: 'ZoneReference',
+ *,
+ target: Optional['FloatingIPTarget'] = None,
) -> None:
"""
- Initialize a IKEPolicy object.
+ Initialize a FloatingIP object.
- :param str authentication_algorithm: The authentication algorithm
- The `md5` and `sha1` algorithms have been deprecated.
- :param List[VPNGatewayConnectionReference] connections: The VPN gateway
- connections that use this IKE policy.
- :param datetime created_at: The date and time that this IKE policy was
+ :param str address: The globally unique IP address.
+ :param datetime created_at: The date and time that the floating IP was
created.
- :param int dh_group: The Diffie-Hellman group
- Groups `2` and `5` have been deprecated.
- :param str encryption_algorithm: The encryption algorithm
- The `triple_des` algorithm has been deprecated.
- :param str href: The IKE policy's canonical URL.
- :param str id: The unique identifier for this IKE policy.
- :param int ike_version: The IKE protocol version.
- :param int key_lifetime: The key lifetime in seconds.
- :param str name: The name for this IKE policy. The name is unique across
- all IKE policies in the region.
- :param str negotiation_mode: The IKE negotiation mode. Only `main` is
- supported.
+ :param str crn: The CRN for this floating IP.
+ :param str href: The URL for this floating IP.
+ :param str id: The unique identifier for this floating IP.
+ :param str name: The name for this floating IP. The name is unique across
+ all floating IPs in the region.
:param ResourceGroupReference resource_group: The resource group for this
- IKE policy.
- :param str resource_type: The resource type.
+ 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.authentication_algorithm = authentication_algorithm
- self.connections = connections
+ self.address = address
self.created_at = created_at
- self.dh_group = dh_group
- self.encryption_algorithm = encryption_algorithm
+ self.crn = crn
self.href = href
self.id = id
- self.ike_version = ike_version
- self.key_lifetime = key_lifetime
self.name = name
- self.negotiation_mode = negotiation_mode
self.resource_group = resource_group
- self.resource_type = resource_type
+ self.status = status
+ self.target = target
+ self.zone = zone
@classmethod
- def from_dict(cls, _dict: Dict) -> 'IKEPolicy':
- """Initialize a IKEPolicy object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'FloatingIP':
+ """Initialize a FloatingIP object from a json dictionary."""
args = {}
- if 'authentication_algorithm' in _dict:
- args['authentication_algorithm'] = _dict.get('authentication_algorithm')
- else:
- raise ValueError('Required property \'authentication_algorithm\' not present in IKEPolicy JSON')
- if 'connections' in _dict:
- args['connections'] = [VPNGatewayConnectionReference.from_dict(v) for v in _dict.get('connections')]
- else:
- raise ValueError('Required property \'connections\' not present in IKEPolicy JSON')
- if 'created_at' in _dict:
- args['created_at'] = string_to_datetime(_dict.get('created_at'))
+ if (address := _dict.get('address')) is not None:
+ args['address'] = address
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')
+ raise ValueError('Required property \'address\' not present in FloatingIP JSON')
+ if (created_at := _dict.get('created_at')) is not None:
+ args['created_at'] = string_to_datetime(created_at)
else:
- raise ValueError('Required property \'href\' not present in IKEPolicy JSON')
- if 'id' in _dict:
- args['id'] = _dict.get('id')
+ raise ValueError('Required property \'created_at\' not present in FloatingIP JSON')
+ if (crn := _dict.get('crn')) is not None:
+ args['crn'] = crn
else:
- raise ValueError('Required property \'id\' not present in IKEPolicy JSON')
- if 'ike_version' in _dict:
- args['ike_version'] = _dict.get('ike_version')
+ raise ValueError('Required property \'crn\' not present in FloatingIP JSON')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'ike_version\' not present in IKEPolicy JSON')
- if 'key_lifetime' in _dict:
- args['key_lifetime'] = _dict.get('key_lifetime')
+ raise ValueError('Required property \'href\' not present in FloatingIP JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
else:
- raise ValueError('Required property \'key_lifetime\' not present in IKEPolicy JSON')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
+ raise ValueError('Required property \'id\' not present in FloatingIP JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
else:
- raise ValueError('Required property \'name\' not present in IKEPolicy JSON')
- if 'negotiation_mode' in _dict:
- args['negotiation_mode'] = _dict.get('negotiation_mode')
+ raise ValueError('Required property \'name\' not present in FloatingIP JSON')
+ if (resource_group := _dict.get('resource_group')) is not None:
+ args['resource_group'] = ResourceGroupReference.from_dict(resource_group)
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'))
+ raise ValueError('Required property \'resource_group\' not present in FloatingIP JSON')
+ if (status := _dict.get('status')) is not None:
+ args['status'] = status
else:
- raise ValueError('Required property \'resource_group\' not present in IKEPolicy JSON')
- if 'resource_type' in _dict:
- args['resource_type'] = _dict.get('resource_type')
+ raise ValueError('Required property \'status\' not present in FloatingIP JSON')
+ if (target := _dict.get('target')) is not None:
+ args['target'] = target
+ if (zone := _dict.get('zone')) is not None:
+ args['zone'] = ZoneReference.from_dict(zone)
else:
- raise ValueError('Required property \'resource_type\' not present in IKEPolicy JSON')
+ raise ValueError('Required property \'zone\' not present in FloatingIP JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a IKEPolicy 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, 'authentication_algorithm') and self.authentication_algorithm is not None:
- _dict['authentication_algorithm'] = self.authentication_algorithm
- if hasattr(self, 'connections') and self.connections is not None:
- connections_list = []
- for v in self.connections:
- if isinstance(v, dict):
- connections_list.append(v)
- else:
- connections_list.append(v.to_dict())
- _dict['connections'] = connections_list
+ if hasattr(self, '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, '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, '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, 'ike_version') and self.ike_version is not None:
- _dict['ike_version'] = self.ike_version
- if hasattr(self, 'key_lifetime') and self.key_lifetime is not None:
- _dict['key_lifetime'] = self.key_lifetime
if hasattr(self, 'name') and self.name is not None:
_dict['name'] = self.name
- if hasattr(self, 'negotiation_mode') and self.negotiation_mode is not None:
- _dict['negotiation_mode'] = self.negotiation_mode
if hasattr(self, 'resource_group') and self.resource_group is not None:
if isinstance(self.resource_group, dict):
_dict['resource_group'] = self.resource_group
else:
_dict['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, 'target') and self.target is not None:
+ if isinstance(self.target, dict):
+ _dict['target'] = self.target
+ else:
+ _dict['target'] = self.target.to_dict()
+ if hasattr(self, 'zone') and self.zone is not None:
+ if isinstance(self.zone, dict):
+ _dict['zone'] = self.zone
+ else:
+ _dict['zone'] = self.zone.to_dict()
return _dict
def _to_dict(self):
@@ -38041,130 +40120,100 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this IKEPolicy object."""
+ """Return a `str` version of this FloatingIP object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'IKEPolicy') -> 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: 'IKEPolicy') -> bool:
+ def __ne__(self, other: 'FloatingIP') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class AuthenticationAlgorithmEnum(str, Enum):
- """
- The authentication algorithm
- The `md5` and `sha1` algorithms have been deprecated.
- """
-
- MD5 = 'md5'
- SHA1 = 'sha1'
- SHA256 = 'sha256'
- SHA384 = 'sha384'
- SHA512 = 'sha512'
-
-
- class EncryptionAlgorithmEnum(str, Enum):
- """
- The encryption algorithm
- The `triple_des` algorithm has been deprecated.
- """
-
- AES128 = 'aes128'
- AES192 = 'aes192'
- AES256 = 'aes256'
- TRIPLE_DES = 'triple_des'
-
-
- class NegotiationModeEnum(str, Enum):
- """
- The IKE negotiation mode. Only `main` is supported.
- """
-
- MAIN = 'main'
-
-
- class ResourceTypeEnum(str, Enum):
+ class StatusEnum(str, Enum):
"""
- The resource type.
+ The status of the floating IP.
"""
- IKE_POLICY = 'ike_policy'
+ AVAILABLE = 'available'
+ DELETING = 'deleting'
+ FAILED = 'failed'
+ PENDING = 'pending'
-class IKEPolicyCollection:
+class FloatingIPCollection:
"""
- IKEPolicyCollection.
+ FloatingIPCollection.
- :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
+ :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.
- :attr IKEPolicyCollectionNext next: (optional) A link to the next page of
+ :param 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.
+ :param int total_count: The total number of resources across all pages.
"""
def __init__(
self,
- first: 'IKEPolicyCollectionFirst',
- ike_policies: List['IKEPolicy'],
+ first: 'FloatingIPCollectionFirst',
+ floating_ips: List['FloatingIP'],
limit: int,
total_count: int,
*,
- next: 'IKEPolicyCollectionNext' = None,
+ next: Optional['FloatingIPCollectionNext'] = None,
) -> None:
"""
- Initialize a IKEPolicyCollection object.
+ Initialize a FloatingIPCollection object.
- :param IKEPolicyCollectionFirst first: A link to the first page of
+ :param FloatingIPCollectionFirst first: A link to the first page of
resources.
- :param List[IKEPolicy] ike_policies: Collection of IKE policies.
+ :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 IKEPolicyCollectionNext next: (optional) A link to the next page of
+ :param FloatingIPCollectionNext next: (optional) A link to the next page of
resources. This property is present for all pages
except the last page.
"""
self.first = first
- self.ike_policies = ike_policies
+ self.floating_ips = floating_ips
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) -> 'FloatingIPCollection':
+ """Initialize a FloatingIPCollection object from a json dictionary."""
args = {}
- if 'first' in _dict:
- args['first'] = IKEPolicyCollectionFirst.from_dict(_dict.get('first'))
+ if (first := _dict.get('first')) is not None:
+ args['first'] = FloatingIPCollectionFirst.from_dict(first)
else:
- raise ValueError('Required property \'first\' not present in IKEPolicyCollection JSON')
- if 'ike_policies' in _dict:
- args['ike_policies'] = [IKEPolicy.from_dict(v) for v in _dict.get('ike_policies')]
+ raise ValueError('Required property \'first\' not present in FloatingIPCollection JSON')
+ if (floating_ips := _dict.get('floating_ips')) is not None:
+ args['floating_ips'] = [FloatingIP.from_dict(v) for v in floating_ips]
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 \'floating_ips\' not present in FloatingIPCollection JSON')
+ if (limit := _dict.get('limit')) is not None:
+ args['limit'] = limit
else:
- raise ValueError('Required property \'limit\' not present in IKEPolicyCollection JSON')
- if 'next' in _dict:
- args['next'] = IKEPolicyCollectionNext.from_dict(_dict.get('next'))
- if 'total_count' in _dict:
- args['total_count'] = _dict.get('total_count')
+ raise ValueError('Required property \'limit\' not present in FloatingIPCollection JSON')
+ if (next := _dict.get('next')) is not None:
+ args['next'] = FloatingIPCollectionNext.from_dict(next)
+ if (total_count := _dict.get('total_count')) is not None:
+ args['total_count'] = total_count
else:
- raise ValueError('Required property \'total_count\' not present in IKEPolicyCollection JSON')
+ raise ValueError('Required property \'total_count\' not present in FloatingIPCollection JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a IKEPolicyCollection object from a json dictionary."""
+ """Initialize a FloatingIPCollection object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -38175,14 +40224,14 @@ def to_dict(self) -> Dict:
_dict['first'] = self.first
else:
_dict['first'] = self.first.to_dict()
- if hasattr(self, 'ike_policies') and self.ike_policies is not None:
- ike_policies_list = []
- for v in self.ike_policies:
+ if hasattr(self, 'floating_ips') and self.floating_ips is not None:
+ floating_ips_list = []
+ for v in self.floating_ips:
if isinstance(v, dict):
- ike_policies_list.append(v)
+ floating_ips_list.append(v)
else:
- ike_policies_list.append(v.to_dict())
- _dict['ike_policies'] = ike_policies_list
+ floating_ips_list.append(v.to_dict())
+ _dict['floating_ips'] = floating_ips_list
if hasattr(self, 'limit') and self.limit is not None:
_dict['limit'] = self.limit
if hasattr(self, 'next') and self.next is not None:
@@ -38199,25 +40248,25 @@ 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 FloatingIPCollection object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'IKEPolicyCollection') -> 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: 'IKEPolicyCollection') -> bool:
+ def __ne__(self, other: 'FloatingIPCollection') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class IKEPolicyCollectionFirst:
+class FloatingIPCollectionFirst:
"""
A link to the first page of resources.
- :attr str href: The URL for a page of resources.
+ :param str href: The URL for a page of resources.
"""
def __init__(
@@ -38225,25 +40274,25 @@ def __init__(
href: str,
) -> None:
"""
- Initialize a IKEPolicyCollectionFirst 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) -> 'IKEPolicyCollectionFirst':
- """Initialize a IKEPolicyCollectionFirst 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')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'href\' not present in IKEPolicyCollectionFirst JSON')
+ raise ValueError('Required property \'href\' not present in FloatingIPCollectionFirst JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a IKEPolicyCollectionFirst object from a json dictionary."""
+ """Initialize a FloatingIPCollectionFirst object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -38258,26 +40307,26 @@ 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 FloatingIPCollectionFirst object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'IKEPolicyCollectionFirst') -> 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: 'IKEPolicyCollectionFirst') -> bool:
+ def __ne__(self, other: 'FloatingIPCollectionFirst') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class IKEPolicyCollectionNext:
+class FloatingIPCollectionNext:
"""
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.
+ :param str href: The URL for a page of resources.
"""
def __init__(
@@ -38285,25 +40334,25 @@ def __init__(
href: str,
) -> None:
"""
- Initialize a IKEPolicyCollectionNext 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) -> 'IKEPolicyCollectionNext':
- """Initialize a IKEPolicyCollectionNext object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'FloatingIPCollectionNext':
+ """Initialize a FloatingIPCollectionNext object from a json dictionary."""
args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'href\' not present in IKEPolicyCollectionNext JSON')
+ raise ValueError('Required property \'href\' not present in FloatingIPCollectionNext JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a IKEPolicyCollectionNext object from a json dictionary."""
+ """Initialize a FloatingIPCollectionNext object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -38318,100 +40367,121 @@ 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 FloatingIPCollectionNext object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'IKEPolicyCollectionNext') -> 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: 'IKEPolicyCollectionNext') -> bool:
+ def __ne__(self, other: 'FloatingIPCollectionNext') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class IKEPolicyPatch:
+class FloatingIPCollectionVirtualNetworkInterfaceContext:
"""
- IKEPolicyPatch.
+ FloatingIPCollectionVirtualNetworkInterfaceContext.
- :attr str authentication_algorithm: (optional) The authentication algorithm.
- :attr int dh_group: (optional) The Diffie-Hellman group.
- :attr str encryption_algorithm: (optional) The encryption algorithm.
- :attr int ike_version: (optional) The IKE protocol version.
- :attr int key_lifetime: (optional) The key lifetime in seconds.
- :attr str name: (optional) The name for this IKE policy. The name must not be
- used by another IKE policy in the region.
+ :param FloatingIPCollectionVirtualNetworkInterfaceContextFirst first: A link to
+ the first page of resources.
+ :param List[FloatingIPReference] floating_ips: Collection of floating IPs bound
+ to the virtual network interface specified by the identifier in the URL.
+ :param int limit: The maximum number of resources that can be returned by the
+ request.
+ :param FloatingIPCollectionVirtualNetworkInterfaceContextNext next: (optional) A
+ link to the next page of resources. This property is present for all pages
+ except the last page.
+ :param int total_count: The total number of resources across all pages.
"""
def __init__(
self,
+ first: 'FloatingIPCollectionVirtualNetworkInterfaceContextFirst',
+ floating_ips: List['FloatingIPReference'],
+ limit: int,
+ total_count: int,
*,
- authentication_algorithm: str = None,
- dh_group: int = None,
- encryption_algorithm: str = None,
- ike_version: int = None,
- key_lifetime: int = None,
- name: str = None,
+ next: Optional['FloatingIPCollectionVirtualNetworkInterfaceContextNext'] = None,
) -> None:
"""
- Initialize a IKEPolicyPatch object.
+ Initialize a FloatingIPCollectionVirtualNetworkInterfaceContext object.
- :param str authentication_algorithm: (optional) The authentication
- algorithm.
- :param int dh_group: (optional) The Diffie-Hellman group.
- :param str encryption_algorithm: (optional) The encryption algorithm.
- :param int ike_version: (optional) The IKE protocol version.
- :param int key_lifetime: (optional) The key lifetime in seconds.
- :param str name: (optional) The name for this IKE policy. The name must not
- be used by another IKE policy in the region.
+ :param FloatingIPCollectionVirtualNetworkInterfaceContextFirst first: A
+ link to the first page of resources.
+ :param List[FloatingIPReference] floating_ips: Collection of floating IPs
+ bound to the virtual network interface specified by the identifier in the
+ URL.
+ :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 FloatingIPCollectionVirtualNetworkInterfaceContextNext next:
+ (optional) A link to the next page of resources. This property is present
+ for all pages
+ except the last page.
"""
- self.authentication_algorithm = authentication_algorithm
- self.dh_group = dh_group
- self.encryption_algorithm = encryption_algorithm
- self.ike_version = ike_version
- self.key_lifetime = key_lifetime
- self.name = name
+ self.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) -> 'IKEPolicyPatch':
- """Initialize a IKEPolicyPatch object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'FloatingIPCollectionVirtualNetworkInterfaceContext':
+ """Initialize a FloatingIPCollectionVirtualNetworkInterfaceContext object from a json dictionary."""
args = {}
- if 'authentication_algorithm' in _dict:
- args['authentication_algorithm'] = _dict.get('authentication_algorithm')
- if 'dh_group' in _dict:
- args['dh_group'] = _dict.get('dh_group')
- if 'encryption_algorithm' in _dict:
- args['encryption_algorithm'] = _dict.get('encryption_algorithm')
- if 'ike_version' in _dict:
- args['ike_version'] = _dict.get('ike_version')
- if 'key_lifetime' in _dict:
- args['key_lifetime'] = _dict.get('key_lifetime')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
+ if (first := _dict.get('first')) is not None:
+ args['first'] = FloatingIPCollectionVirtualNetworkInterfaceContextFirst.from_dict(first)
+ else:
+ raise ValueError('Required property \'first\' not present in FloatingIPCollectionVirtualNetworkInterfaceContext JSON')
+ if (floating_ips := _dict.get('floating_ips')) is not None:
+ args['floating_ips'] = [FloatingIPReference.from_dict(v) for v in floating_ips]
+ else:
+ raise ValueError('Required property \'floating_ips\' not present in FloatingIPCollectionVirtualNetworkInterfaceContext JSON')
+ if (limit := _dict.get('limit')) is not None:
+ args['limit'] = limit
+ else:
+ raise ValueError('Required property \'limit\' not present in FloatingIPCollectionVirtualNetworkInterfaceContext JSON')
+ if (next := _dict.get('next')) is not None:
+ args['next'] = FloatingIPCollectionVirtualNetworkInterfaceContextNext.from_dict(next)
+ if (total_count := _dict.get('total_count')) is not None:
+ args['total_count'] = total_count
+ else:
+ raise ValueError('Required property \'total_count\' not present in FloatingIPCollectionVirtualNetworkInterfaceContext JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a IKEPolicyPatch object from a json dictionary."""
+ """Initialize a FloatingIPCollectionVirtualNetworkInterfaceContext object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'authentication_algorithm') and self.authentication_algorithm is not None:
- _dict['authentication_algorithm'] = self.authentication_algorithm
- if hasattr(self, 'dh_group') and self.dh_group is not None:
- _dict['dh_group'] = self.dh_group
- if hasattr(self, 'encryption_algorithm') and self.encryption_algorithm is not None:
- _dict['encryption_algorithm'] = self.encryption_algorithm
- if hasattr(self, 'ike_version') and self.ike_version is not None:
- _dict['ike_version'] = self.ike_version
- if hasattr(self, 'key_lifetime') and self.key_lifetime is not None:
- _dict['key_lifetime'] = self.key_lifetime
- if hasattr(self, 'name') and self.name is not None:
- _dict['name'] = self.name
+ if hasattr(self, 'first') and self.first is not None:
+ if isinstance(self.first, dict):
+ _dict['first'] = self.first
+ else:
+ _dict['first'] = self.first.to_dict()
+ if hasattr(self, 'floating_ips') and self.floating_ips is not None:
+ floating_ips_list = []
+ for v in self.floating_ips:
+ if isinstance(v, dict):
+ floating_ips_list.append(v)
+ else:
+ floating_ips_list.append(v.to_dict())
+ _dict['floating_ips'] = floating_ips_list
+ if hasattr(self, 'limit') and self.limit is not None:
+ _dict['limit'] = self.limit
+ if hasattr(self, 'next') and self.next is not None:
+ if isinstance(self.next, dict):
+ _dict['next'] = self.next
+ else:
+ _dict['next'] = self.next.to_dict()
+ if hasattr(self, 'total_count') and self.total_count is not None:
+ _dict['total_count'] = self.total_count
return _dict
def _to_dict(self):
@@ -38419,126 +40489,58 @@ 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 FloatingIPCollectionVirtualNetworkInterfaceContext object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'IKEPolicyPatch') -> bool:
+ def __eq__(self, other: 'FloatingIPCollectionVirtualNetworkInterfaceContext') -> bool:
"""Return `true` when 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: 'FloatingIPCollectionVirtualNetworkInterfaceContext') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class AuthenticationAlgorithmEnum(str, Enum):
- """
- The authentication algorithm.
- """
-
- SHA256 = 'sha256'
- SHA384 = 'sha384'
- SHA512 = 'sha512'
-
-
- class EncryptionAlgorithmEnum(str, Enum):
- """
- The encryption algorithm.
- """
-
- AES128 = 'aes128'
- AES192 = 'aes192'
- AES256 = 'aes256'
-
-
-class IKEPolicyReference:
+class FloatingIPCollectionVirtualNetworkInterfaceContextFirst:
"""
- IKEPolicyReference.
+ A link to the first page of resources.
- :attr IKEPolicyReferenceDeleted deleted: (optional) If present, this property
- indicates the referenced resource has been deleted, and provides
- some supplementary information.
- :attr str href: The IKE policy's canonical URL.
- :attr str id: The unique identifier for this IKE policy.
- :attr str name: The name for this IKE policy. The name is unique across all IKE
- policies in the region.
- :attr str resource_type: The resource type.
+ :param str href: The URL for a page of resources.
"""
def __init__(
self,
href: str,
- id: str,
- name: str,
- resource_type: str,
- *,
- deleted: 'IKEPolicyReferenceDeleted' = None,
) -> None:
"""
- Initialize a IKEPolicyReference object.
+ Initialize a FloatingIPCollectionVirtualNetworkInterfaceContextFirst object.
- :param str href: The IKE policy's canonical URL.
- :param str id: The unique identifier for this IKE policy.
- :param str name: The name for this IKE policy. The name is unique across
- all IKE policies in the region.
- :param str resource_type: The resource type.
- :param IKEPolicyReferenceDeleted deleted: (optional) If present, this
- property indicates the referenced resource has been deleted, and provides
- some supplementary information.
+ :param str 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) -> 'IKEPolicyReference':
- """Initialize a IKEPolicyReference object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'FloatingIPCollectionVirtualNetworkInterfaceContextFirst':
+ """Initialize a FloatingIPCollectionVirtualNetworkInterfaceContextFirst object from a json dictionary."""
args = {}
- if 'deleted' in _dict:
- args['deleted'] = IKEPolicyReferenceDeleted.from_dict(_dict.get('deleted'))
- if 'href' in _dict:
- args['href'] = _dict.get('href')
- else:
- raise ValueError('Required property \'href\' not present in IKEPolicyReference JSON')
- if 'id' in _dict:
- args['id'] = _dict.get('id')
- else:
- raise ValueError('Required property \'id\' not present in IKEPolicyReference JSON')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
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')
+ raise ValueError('Required property \'href\' not present in FloatingIPCollectionVirtualNetworkInterfaceContextFirst JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a IKEPolicyReference object from a json dictionary."""
+ """Initialize a FloatingIPCollectionVirtualNetworkInterfaceContextFirst object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'deleted') and self.deleted is not None:
- if isinstance(self.deleted, dict):
- _dict['deleted'] = self.deleted
- else:
- _dict['deleted'] = self.deleted.to_dict()
if hasattr(self, 'href') and self.href is not None:
_dict['href'] = self.href
- if hasattr(self, 'id') and self.id is not None:
- _dict['id'] = self.id
- if hasattr(self, 'name') and self.name is not None:
- _dict['name'] = self.name
- if hasattr(self, 'resource_type') and self.resource_type is not None:
- _dict['resource_type'] = self.resource_type
return _dict
def _to_dict(self):
@@ -38546,67 +40548,59 @@ 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 FloatingIPCollectionVirtualNetworkInterfaceContextFirst object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'IKEPolicyReference') -> bool:
+ def __eq__(self, other: 'FloatingIPCollectionVirtualNetworkInterfaceContextFirst') -> bool:
"""Return `true` when 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: 'FloatingIPCollectionVirtualNetworkInterfaceContextFirst') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class ResourceTypeEnum(str, Enum):
- """
- The resource type.
- """
-
- IKE_POLICY = 'ike_policy'
-
-
-class IKEPolicyReferenceDeleted:
+class FloatingIPCollectionVirtualNetworkInterfaceContextNext:
"""
- 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.
+ :param str href: The URL for a page of resources.
"""
def __init__(
self,
- more_info: str,
+ href: str,
) -> None:
"""
- Initialize a IKEPolicyReferenceDeleted object.
+ Initialize a FloatingIPCollectionVirtualNetworkInterfaceContextNext 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) -> 'IKEPolicyReferenceDeleted':
- """Initialize a IKEPolicyReferenceDeleted object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'FloatingIPCollectionVirtualNetworkInterfaceContextNext':
+ """Initialize a FloatingIPCollectionVirtualNetworkInterfaceContextNext object from a json dictionary."""
args = {}
- if 'more_info' in _dict:
- args['more_info'] = _dict.get('more_info')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'more_info\' not present in IKEPolicyReferenceDeleted JSON')
+ raise ValueError('Required property \'href\' not present in FloatingIPCollectionVirtualNetworkInterfaceContextNext JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a IKEPolicyReferenceDeleted object from a json dictionary."""
+ """Initialize a FloatingIPCollectionVirtualNetworkInterfaceContextNext object from 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):
@@ -38614,67 +40608,93 @@ 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 FloatingIPCollectionVirtualNetworkInterfaceContextNext object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'IKEPolicyReferenceDeleted') -> bool:
+ def __eq__(self, other: 'FloatingIPCollectionVirtualNetworkInterfaceContextNext') -> bool:
"""Return `true` when 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: 'FloatingIPCollectionVirtualNetworkInterfaceContextNext') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class IP:
+class FloatingIPPatch:
"""
- IP.
+ FloatingIPPatch.
- :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.
+ :param str name: (optional) The name for this floating IP. The name must not be
+ used by another floating IP in the region.
+ :param FloatingIPTargetPatch target: (optional) The target resource to bind this
+ floating IP to, replacing any existing binding.
+ The floating IP must not be required by another resource, such as a public
+ gateway.
+ The target resource must not already have a floating IP bound to it if the
+ target
+ resource is:
+ - an instance network interface
+ - a bare metal server network interface with `enable_infrastructure_nat` set to
+ `true`
+ - a virtual network interface with `enable_infrastructure_nat` set to `true`
+ Specify `null` to remove an existing binding.
"""
def __init__(
self,
- address: str,
+ *,
+ name: Optional[str] = None,
+ target: Optional['FloatingIPTargetPatch'] = None,
) -> None:
"""
- Initialize a IP object.
+ Initialize a FloatingIPPatch object.
- :param str address: The IP address.
- This property may add support for IPv6 addresses in the future. When
- processing a value in this property, verify that the address is in an
- expected format. If it is not, log an error. Optionally halt processing and
- surface the error, or bypass the resource on which the unexpected IP
- address format was encountered.
+ :param str name: (optional) The name for this floating IP. The name must
+ not be used by another floating IP in the region.
+ :param FloatingIPTargetPatch target: (optional) The target resource to bind
+ this floating IP to, replacing any existing binding.
+ The floating IP must not be required by another resource, such as a public
+ gateway.
+ The target resource must not already have a floating IP bound to it if the
+ target
+ resource is:
+ - an instance network interface
+ - a bare metal server network interface with `enable_infrastructure_nat`
+ set to `true`
+ - a virtual network interface with `enable_infrastructure_nat` set to
+ `true`
+ Specify `null` to remove an existing binding.
"""
- self.address = address
+ self.name = name
+ self.target = target
@classmethod
- def from_dict(cls, _dict: Dict) -> 'IP':
- """Initialize a IP object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'FloatingIPPatch':
+ """Initialize a FloatingIPPatch object from a json dictionary."""
args = {}
- if 'address' in _dict:
- args['address'] = _dict.get('address')
- else:
- raise ValueError('Required property \'address\' not present in IP JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ if (target := _dict.get('target')) is not None:
+ args['target'] = target
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a IP object from a json dictionary."""
+ """Initialize a FloatingIPPatch object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'address') and self.address is not None:
- _dict['address'] = self.address
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ if hasattr(self, '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):
@@ -38682,214 +40702,152 @@ 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 FloatingIPPatch object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'IP') -> 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: 'IP') -> bool:
+ def __ne__(self, other: 'FloatingIPPatch') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class IPsecPolicy:
+class FloatingIPPrototype:
"""
- IPsecPolicy.
+ FloatingIPPrototype.
- :attr str authentication_algorithm: The authentication algorithm
- The `md5` and `sha1` algorithms have been deprecated
- Must be `disabled` if and only if the `encryption_algorithm` is
- `aes128gcm16`, `aes192gcm16`, or `aes256gcm16`.
- :attr List[VPNGatewayConnectionReference] connections: The VPN gateway
- connections that use this IPsec policy.
- :attr datetime created_at: The date and time that this IPsec policy was created.
- :attr str encapsulation_mode: The encapsulation mode used. Only `tunnel` is
- supported.
- :attr str encryption_algorithm: The encryption algorithm
- The `triple_des` algorithm has been deprecated
- The `authentication_algorithm` must be `disabled` if and only if
- `encryption_algorithm` is `aes128gcm16`, `aes192gcm16`, or
- `aes256gcm16`.
- :attr str href: The IPsec policy's canonical URL.
- :attr str id: The unique identifier for this IPsec policy.
- :attr int key_lifetime: The key lifetime in seconds.
- :attr str name: The name for this IPsec policy. The name is unique across all
- IPsec policies in the region.
- :attr str pfs: Perfect Forward Secrecy
- Groups `group_2` and `group_5` have been deprecated.
- :attr ResourceGroupReference resource_group: The resource group for this IPsec
- policy.
- :attr str resource_type: The resource type.
- :attr str transform_protocol: The transform protocol used. Only `esp` is
- supported.
+ :param str name: (optional) The name for this floating IP. The name must not be
+ used by another floating IP in the region. If unspecified, the name will be a
+ hyphenated list of randomly-selected words.
+ :param ResourceGroupIdentity resource_group: (optional) The resource group to
+ use. If unspecified, the account's [default resource
+ group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be
+ used.
"""
def __init__(
self,
- authentication_algorithm: str,
- connections: List['VPNGatewayConnectionReference'],
- created_at: datetime,
- encapsulation_mode: str,
- encryption_algorithm: str,
+ *,
+ name: Optional[str] = None,
+ resource_group: Optional['ResourceGroupIdentity'] = None,
+ ) -> None:
+ """
+ Initialize a FloatingIPPrototype object.
+
+ :param str name: (optional) The name for this floating IP. The name must
+ not be used by another floating IP in the region. If unspecified, the name
+ will be a hyphenated list of randomly-selected words.
+ :param ResourceGroupIdentity resource_group: (optional) The resource group
+ to use. If unspecified, the account's [default resource
+ group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be
+ used.
+ """
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['FloatingIPPrototypeFloatingIPByZone', 'FloatingIPPrototypeFloatingIPByTarget'])
+ )
+ raise Exception(msg)
+
+
+class FloatingIPReference:
+ """
+ FloatingIPReference.
+
+ :param str address: The globally unique IP address.
+ :param str crn: The CRN 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 str href: The URL for this floating IP.
+ :param str id: The unique identifier for this floating IP.
+ :param str name: The name for this floating IP. The name is unique across all
+ floating IPs in the region.
+ """
+
+ def __init__(
+ self,
+ address: str,
+ crn: str,
href: str,
id: str,
- key_lifetime: int,
name: str,
- pfs: str,
- resource_group: 'ResourceGroupReference',
- resource_type: str,
- transform_protocol: str,
+ *,
+ deleted: Optional['FloatingIPReferenceDeleted'] = None,
) -> None:
"""
- Initialize a IPsecPolicy object.
+ Initialize a FloatingIPReference object.
- :param str authentication_algorithm: The authentication algorithm
- The `md5` and `sha1` algorithms have been deprecated
- Must be `disabled` if and only if the `encryption_algorithm` is
- `aes128gcm16`, `aes192gcm16`, or `aes256gcm16`.
- :param List[VPNGatewayConnectionReference] connections: The VPN gateway
- connections that use this IPsec policy.
- :param datetime created_at: The date and time that this IPsec policy was
- created.
- :param str encapsulation_mode: The encapsulation mode used. Only `tunnel`
- is supported.
- :param str encryption_algorithm: The encryption algorithm
- The `triple_des` algorithm has been deprecated
- The `authentication_algorithm` must be `disabled` if and only if
- `encryption_algorithm` is `aes128gcm16`, `aes192gcm16`, or
- `aes256gcm16`.
- :param str href: The IPsec policy's canonical URL.
- :param str id: The unique identifier for this IPsec policy.
- :param int key_lifetime: The key lifetime in seconds.
- :param str name: The name for this IPsec policy. The name is unique across
- all IPsec policies in the region.
- :param str pfs: Perfect Forward Secrecy
- Groups `group_2` and `group_5` have been deprecated.
- :param ResourceGroupReference resource_group: The resource group for this
- IPsec policy.
- :param str resource_type: The resource type.
- :param str transform_protocol: The transform protocol used. Only `esp` is
- supported.
+ :param str address: The globally unique IP address.
+ :param str crn: The CRN for this floating IP.
+ :param str href: The URL for this floating IP.
+ :param str id: The unique identifier for this floating IP.
+ :param str name: The name for this floating IP. The name is unique across
+ all floating IPs in the region.
+ :param FloatingIPReferenceDeleted deleted: (optional) If present, this
+ property indicates the referenced resource has been deleted, and provides
+ some supplementary information.
"""
- self.authentication_algorithm = authentication_algorithm
- self.connections = connections
- self.created_at = created_at
- self.encapsulation_mode = encapsulation_mode
- self.encryption_algorithm = encryption_algorithm
+ self.address = address
+ self.crn = crn
+ self.deleted = deleted
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) -> 'IPsecPolicy':
- """Initialize a IPsecPolicy object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'FloatingIPReference':
+ """Initialize a FloatingIPReference object from a json dictionary."""
args = {}
- if 'authentication_algorithm' in _dict:
- args['authentication_algorithm'] = _dict.get('authentication_algorithm')
- else:
- raise ValueError('Required property \'authentication_algorithm\' not present in IPsecPolicy JSON')
- if 'connections' in _dict:
- args['connections'] = [VPNGatewayConnectionReference.from_dict(v) for v in _dict.get('connections')]
- else:
- raise ValueError('Required property \'connections\' not present in IPsecPolicy JSON')
- if 'created_at' in _dict:
- args['created_at'] = string_to_datetime(_dict.get('created_at'))
- else:
- raise ValueError('Required property \'created_at\' not present in IPsecPolicy JSON')
- if 'encapsulation_mode' in _dict:
- args['encapsulation_mode'] = _dict.get('encapsulation_mode')
- else:
- raise ValueError('Required property \'encapsulation_mode\' not present in IPsecPolicy JSON')
- if 'encryption_algorithm' in _dict:
- args['encryption_algorithm'] = _dict.get('encryption_algorithm')
- else:
- raise ValueError('Required property \'encryption_algorithm\' not present in IPsecPolicy JSON')
- if 'href' in _dict:
- args['href'] = _dict.get('href')
- else:
- raise ValueError('Required property \'href\' not present in IPsecPolicy JSON')
- if 'id' in _dict:
- args['id'] = _dict.get('id')
- else:
- raise ValueError('Required property \'id\' not present in IPsecPolicy JSON')
- if 'key_lifetime' in _dict:
- args['key_lifetime'] = _dict.get('key_lifetime')
- else:
- raise ValueError('Required property \'key_lifetime\' not present in IPsecPolicy JSON')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
+ if (address := _dict.get('address')) is not None:
+ args['address'] = address
else:
- raise ValueError('Required property \'name\' not present in IPsecPolicy JSON')
- if 'pfs' in _dict:
- args['pfs'] = _dict.get('pfs')
+ raise ValueError('Required property \'address\' not present in FloatingIPReference JSON')
+ if (crn := _dict.get('crn')) is not None:
+ args['crn'] = crn
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'))
+ raise ValueError('Required property \'crn\' not present in FloatingIPReference JSON')
+ if (deleted := _dict.get('deleted')) is not None:
+ args['deleted'] = FloatingIPReferenceDeleted.from_dict(deleted)
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
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 \'href\' not present in FloatingIPReference JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
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 \'id\' not present in FloatingIPReference JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
else:
- raise ValueError('Required property \'transform_protocol\' not present in IPsecPolicy JSON')
+ raise ValueError('Required property \'name\' not present in FloatingIPReference JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a IPsecPolicy 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, 'authentication_algorithm') and self.authentication_algorithm is not None:
- _dict['authentication_algorithm'] = self.authentication_algorithm
- if hasattr(self, 'connections') and self.connections is not None:
- connections_list = []
- for v in self.connections:
- if isinstance(v, dict):
- connections_list.append(v)
- else:
- connections_list.append(v.to_dict())
- _dict['connections'] = connections_list
- if hasattr(self, 'created_at') and self.created_at is not None:
- _dict['created_at'] = datetime_to_string(self.created_at)
- if hasattr(self, 'encapsulation_mode') and self.encapsulation_mode is not None:
- _dict['encapsulation_mode'] = self.encapsulation_mode
- if hasattr(self, 'encryption_algorithm') and self.encryption_algorithm is not None:
- _dict['encryption_algorithm'] = self.encryption_algorithm
+ if hasattr(self, 'address') and self.address is not None:
+ _dict['address'] = self.address
+ if hasattr(self, 'crn') and self.crn is not None:
+ _dict['crn'] = self.crn
+ if hasattr(self, 'deleted') and self.deleted is not None:
+ if isinstance(self.deleted, dict):
+ _dict['deleted'] = self.deleted
+ else:
+ _dict['deleted'] = self.deleted.to_dict()
if hasattr(self, 'href') and self.href is not None:
_dict['href'] = self.href
if hasattr(self, 'id') and self.id is not None:
_dict['id'] = self.id
- if hasattr(self, 'key_lifetime') and self.key_lifetime is not None:
- _dict['key_lifetime'] = self.key_lifetime
if hasattr(self, 'name') and self.name is not None:
_dict['name'] = self.name
- if hasattr(self, 'pfs') and self.pfs is not None:
- _dict['pfs'] = self.pfs
- if hasattr(self, 'resource_group') and self.resource_group is not None:
- if isinstance(self.resource_group, dict):
- _dict['resource_group'] = self.resource_group
- else:
- _dict['resource_group'] = self.resource_group.to_dict()
- if hasattr(self, 'resource_type') and self.resource_type is not None:
- _dict['resource_type'] = self.resource_type
- if hasattr(self, 'transform_protocol') and self.transform_protocol is not None:
- _dict['transform_protocol'] = self.transform_protocol
return _dict
def _to_dict(self):
@@ -38897,197 +40855,59 @@ 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 FloatingIPReference object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'IPsecPolicy') -> 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: 'IPsecPolicy') -> bool:
+ def __ne__(self, other: 'FloatingIPReference') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class AuthenticationAlgorithmEnum(str, Enum):
- """
- The authentication algorithm
- The `md5` and `sha1` algorithms have been deprecated
- Must be `disabled` if and only if the `encryption_algorithm` is
- `aes128gcm16`, `aes192gcm16`, or `aes256gcm16`.
- """
-
- DISABLED = 'disabled'
- MD5 = 'md5'
- SHA1 = 'sha1'
- SHA256 = 'sha256'
- SHA384 = 'sha384'
- SHA512 = 'sha512'
-
-
- class EncapsulationModeEnum(str, Enum):
- """
- The encapsulation mode used. Only `tunnel` is supported.
- """
-
- TUNNEL = 'tunnel'
-
- class EncryptionAlgorithmEnum(str, Enum):
- """
- The encryption algorithm
- The `triple_des` algorithm has been deprecated
- The `authentication_algorithm` must be `disabled` if and only if
- `encryption_algorithm` is `aes128gcm16`, `aes192gcm16`, or
- `aes256gcm16`.
- """
-
- AES128 = 'aes128'
- AES128GCM16 = 'aes128gcm16'
- AES192 = 'aes192'
- AES192GCM16 = 'aes192gcm16'
- AES256 = 'aes256'
- AES256GCM16 = 'aes256gcm16'
- TRIPLE_DES = 'triple_des'
-
-
- class PfsEnum(str, Enum):
- """
- Perfect Forward Secrecy
- Groups `group_2` and `group_5` have been deprecated.
- """
-
- DISABLED = 'disabled'
- GROUP_14 = 'group_14'
- GROUP_15 = 'group_15'
- GROUP_16 = 'group_16'
- GROUP_17 = 'group_17'
- GROUP_18 = 'group_18'
- GROUP_19 = 'group_19'
- GROUP_2 = 'group_2'
- GROUP_20 = 'group_20'
- GROUP_21 = 'group_21'
- GROUP_22 = 'group_22'
- GROUP_23 = 'group_23'
- GROUP_24 = 'group_24'
- GROUP_31 = 'group_31'
- GROUP_5 = 'group_5'
-
-
- class ResourceTypeEnum(str, Enum):
- """
- The resource type.
- """
-
- IPSEC_POLICY = 'ipsec_policy'
-
-
- class TransformProtocolEnum(str, Enum):
- """
- The transform protocol used. Only `esp` is supported.
- """
-
- ESP = 'esp'
-
-
-
-class IPsecPolicyCollection:
+class FloatingIPReferenceDeleted:
"""
- IPsecPolicyCollection.
+ If present, this property indicates the referenced resource has been deleted, and
+ provides some supplementary information.
- :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.
+ :param str more_info: Link to documentation about deleted resources.
"""
def __init__(
self,
- first: 'IPsecPolicyCollectionFirst',
- ipsec_policies: List['IPsecPolicy'],
- limit: int,
- total_count: int,
- *,
- next: 'IPsecPolicyCollectionNext' = None,
+ more_info: str,
) -> None:
"""
- Initialize a IPsecPolicyCollection object.
+ Initialize a FloatingIPReferenceDeleted object.
- :param IPsecPolicyCollectionFirst first: A link to the first page of
- resources.
- :param List[IPsecPolicy] ipsec_policies: Collection of IPsec policies.
- :param int limit: The maximum number of resources that can be returned by
- the request.
- :param int total_count: The total number of resources across all pages.
- :param IPsecPolicyCollectionNext next: (optional) A link to the next page
- of resources. This property is present for all pages
- except the last page.
+ :param str more_info: Link to documentation about deleted resources.
"""
- self.first = first
- self.ipsec_policies = ipsec_policies
- self.limit = limit
- self.next = next
- self.total_count = total_count
+ self.more_info = more_info
@classmethod
- def from_dict(cls, _dict: Dict) -> 'IPsecPolicyCollection':
- """Initialize a IPsecPolicyCollection 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'] = IPsecPolicyCollectionFirst.from_dict(_dict.get('first'))
- else:
- raise ValueError('Required property \'first\' not present in IPsecPolicyCollection JSON')
- if 'ipsec_policies' in _dict:
- args['ipsec_policies'] = [IPsecPolicy.from_dict(v) for v in _dict.get('ipsec_policies')]
+ if (more_info := _dict.get('more_info')) is not None:
+ args['more_info'] = more_info
else:
- raise ValueError('Required property \'ipsec_policies\' not present in IPsecPolicyCollection JSON')
- if 'limit' in _dict:
- args['limit'] = _dict.get('limit')
- else:
- raise ValueError('Required property \'limit\' not present in IPsecPolicyCollection JSON')
- if 'next' in _dict:
- args['next'] = IPsecPolicyCollectionNext.from_dict(_dict.get('next'))
- if 'total_count' in _dict:
- args['total_count'] = _dict.get('total_count')
- else:
- raise ValueError('Required property \'total_count\' not present in IPsecPolicyCollection JSON')
+ raise ValueError('Required property \'more_info\' not present in FloatingIPReferenceDeleted JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a IPsecPolicyCollection 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:
- if isinstance(self.first, dict):
- _dict['first'] = self.first
- else:
- _dict['first'] = self.first.to_dict()
- if hasattr(self, 'ipsec_policies') and self.ipsec_policies is not None:
- ipsec_policies_list = []
- for v in self.ipsec_policies:
- if isinstance(v, dict):
- ipsec_policies_list.append(v)
- else:
- ipsec_policies_list.append(v.to_dict())
- _dict['ipsec_policies'] = ipsec_policies_list
- if hasattr(self, 'limit') and self.limit is not None:
- _dict['limit'] = self.limit
- if hasattr(self, 'next') and self.next is not None:
- if isinstance(self.next, dict):
- _dict['next'] = self.next
- else:
- _dict['next'] = self.next.to_dict()
- if hasattr(self, 'total_count') and self.total_count is not None:
- _dict['total_count'] = self.total_count
+ if hasattr(self, 'more_info') and self.more_info is not None:
+ _dict['more_info'] = self.more_info
return _dict
def _to_dict(self):
@@ -39095,118 +40915,133 @@ 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 FloatingIPReferenceDeleted object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'IPsecPolicyCollection') -> 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: 'IPsecPolicyCollection') -> bool:
+ def __ne__(self, other: 'FloatingIPReferenceDeleted') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class IPsecPolicyCollectionFirst:
+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,
- href: str,
) -> None:
"""
- Initialize a IPsecPolicyCollectionFirst object.
+ Initialize a FloatingIPTarget object.
- :param str href: The URL for a page of resources.
"""
- self.href = href
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['FloatingIPTargetNetworkInterfaceReference', 'FloatingIPTargetBareMetalServerNetworkInterfaceReference', 'FloatingIPTargetPublicGatewayReference', 'FloatingIPTargetVirtualNetworkInterfaceReference'])
+ )
+ raise Exception(msg)
- @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)
+class FloatingIPTargetPatch:
+ """
+ The target resource to bind this floating IP to, replacing any existing binding. The
+ floating IP must not be required by another resource, such as a public gateway.
+ The target resource must not already have a floating IP bound to it if the target
+ resource is:
+ - an instance network interface
+ - a bare metal server network interface with `enable_infrastructure_nat` set to `true`
+ - a virtual network interface with `enable_infrastructure_nat` set to `true`
+ Specify `null` to remove an existing binding.
- 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 __init__(
+ self,
+ ) -> None:
+ """
+ Initialize a FloatingIPTargetPatch object.
- def __str__(self) -> str:
- """Return a `str` version of this IPsecPolicyCollectionFirst object."""
- return json.dumps(self.to_dict(), indent=2)
+ """
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentity', 'FloatingIPTargetPatchNetworkInterfaceIdentity', 'FloatingIPTargetPatchVirtualNetworkInterfaceIdentity'])
+ )
+ raise Exception(msg)
- 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: 'IPsecPolicyCollectionFirst') -> bool:
- """Return `true` when self and other are not equal, false otherwise."""
- return not self == other
+class FloatingIPTargetPrototype:
+ """
+ The target resource to bind this floating IP to.
+ The target resource must not already have a floating IP bound to it if the target
+ resource is:
+ - an instance network interface
+ - a bare metal server network interface with `enable_infrastructure_nat` set to `true`
+ - a virtual network interface with `enable_infrastructure_nat` set to `true`.
+ """
-class IPsecPolicyCollectionNext:
+ def __init__(
+ self,
+ ) -> None:
+ """
+ Initialize a FloatingIPTargetPrototype object.
+
+ """
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentity', 'FloatingIPTargetPrototypeNetworkInterfaceIdentity', 'FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentity'])
+ )
+ raise Exception(msg)
+
+
+class FloatingIPUnpaginatedCollection:
"""
- A link to the next page of resources. This property is present for all pages except
- the last page.
+ FloatingIPUnpaginatedCollection.
- :attr str href: The URL for a page of resources.
+ :param List[FloatingIP] floating_ips: Collection of floating IPs.
"""
def __init__(
self,
- href: str,
+ floating_ips: List['FloatingIP'],
) -> None:
"""
- Initialize a IPsecPolicyCollectionNext 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) -> 'IPsecPolicyCollectionNext':
- """Initialize a IPsecPolicyCollectionNext 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 := _dict.get('floating_ips')) is not None:
+ args['floating_ips'] = [FloatingIP.from_dict(v) for v in floating_ips]
else:
- raise ValueError('Required property \'href\' not present in IPsecPolicyCollectionNext JSON')
+ raise ValueError('Required property \'floating_ips\' not present in FloatingIPUnpaginatedCollection JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a IPsecPolicyCollectionNext 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:
+ floating_ips_list = []
+ for v in self.floating_ips:
+ if isinstance(v, dict):
+ floating_ips_list.append(v)
+ else:
+ floating_ips_list.append(v.to_dict())
+ _dict['floating_ips'] = floating_ips_list
return _dict
def _to_dict(self):
@@ -39214,102 +41049,242 @@ 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 FloatingIPUnpaginatedCollection object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'IPsecPolicyCollectionNext') -> 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: 'IPsecPolicyCollectionNext') -> bool:
+ def __ne__(self, other: 'FloatingIPUnpaginatedCollection') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class IPsecPolicyPatch:
+class FlowLogCollector:
"""
- IPsecPolicyPatch.
+ FlowLogCollector.
- :attr str authentication_algorithm: (optional) The authentication algorithm
- Must be `disabled` if and only if the `encryption_algorithm` is
- `aes128gcm16`, `aes192gcm16`, or `aes256gcm16`.
- :attr str encryption_algorithm: (optional) The encryption algorithm
- The `authentication_algorithm` must be `disabled` if and only if
- `encryption_algorithm` is `aes128gcm16`, `aes192gcm16`, or
- `aes256gcm16`.
- :attr int key_lifetime: (optional) The key lifetime in seconds.
- :attr str name: (optional) The name for this IPsec policy. The name must not be
- used by another IPsec policy in the region.
- :attr str pfs: (optional) Perfect Forward Secrecy.
+ :param bool active: Indicates whether this collector is active.
+ :param bool auto_delete: Indicates whether this flow log collector will be
+ automatically deleted when `target` is deleted. At present, this is always
+ `true`, but may be modifiable in the future.
+ :param datetime created_at: The date and time that the flow log collector was
+ created.
+ :param str crn: The CRN for this flow log collector.
+ :param str href: The URL for this flow log collector.
+ :param str id: The unique identifier for this flow log collector.
+ :param str lifecycle_state: The lifecycle state of the flow log collector.
+ :param str name: The name for this flow log collector. The name is unique across
+ all flow log collectors in the VPC.
+ :param ResourceGroupReference resource_group: The resource group for this flow
+ log collector.
+ :param LegacyCloudObjectStorageBucketReference storage_bucket: The Cloud Object
+ Storage bucket where the collected flows are logged. For more
+ information, see [Viewing flow log
+ objects](https://cloud.ibm.com/docs/vpc?topic=vpc-fl-analyze).
+ :param FlowLogCollectorTarget target: The target this collector is collecting
+ flow logs for.
+ - If the target is an instance network attachment, flow logs will be collected
+ for that instance network attachment.
+ - If the target is an instance network interface, flow logs will be collected
+ for that instance network interface.
+ - If the target is a virtual network interface, flow logs will be collected for
+ the
+ the virtual network interface's `target` resource if the resource is:
+ - an instance network attachment
+ - If the target is a virtual server instance, flow logs will be collected
+ for all network attachments or network interfaces on that instance.
+ - If the target is a subnet, flow logs will be collected
+ for all instance network interfaces and virtual network interfaces
+ attached to that subnet.
+ - If the target is a VPC, flow logs will be collected for all instance network
+ interfaces and virtual network interfaces attached to all subnets within that
+ VPC.
+ If the target is an instance, subnet, or VPC, flow logs will not be collected
+ for any instance network attachments or instance network interfaces within the
+ target
+ that are themselves the target of a more specific flow log collector.
+ :param VPCReference vpc: The VPC this flow log collector resides in.
"""
def __init__(
self,
- *,
- authentication_algorithm: str = None,
- encryption_algorithm: str = None,
- key_lifetime: int = None,
- name: str = None,
- pfs: 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: 'LegacyCloudObjectStorageBucketReference',
+ target: 'FlowLogCollectorTarget',
+ vpc: 'VPCReference',
) -> None:
"""
- Initialize a IPsecPolicyPatch object.
-
- :param str authentication_algorithm: (optional) The authentication
- algorithm
- Must be `disabled` if and only if the `encryption_algorithm` is
- `aes128gcm16`, `aes192gcm16`, or `aes256gcm16`.
- :param str encryption_algorithm: (optional) The encryption algorithm
- The `authentication_algorithm` must be `disabled` if and only if
- `encryption_algorithm` is `aes128gcm16`, `aes192gcm16`, or
- `aes256gcm16`.
- :param int key_lifetime: (optional) The key lifetime in seconds.
- :param str name: (optional) The name for this IPsec policy. The name must
- not be used by another IPsec policy in the region.
- :param str pfs: (optional) Perfect Forward Secrecy.
- """
- self.authentication_algorithm = authentication_algorithm
- self.encryption_algorithm = encryption_algorithm
- self.key_lifetime = key_lifetime
- self.name = name
- 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)
+ Initialize a FlowLogCollector object.
- @classmethod
- def _from_dict(cls, _dict):
- """Initialize a IPsecPolicyPatch object from a json dictionary."""
+ :param bool active: Indicates whether this collector is active.
+ :param bool auto_delete: Indicates whether this flow log collector will be
+ automatically deleted when `target` is deleted. At present, this is always
+ `true`, but may be modifiable in the future.
+ :param datetime created_at: The date and time that the flow log collector
+ was created.
+ :param str crn: The CRN for this flow log collector.
+ :param str href: The URL for this flow log collector.
+ :param str id: The unique identifier for this flow log collector.
+ :param str lifecycle_state: The lifecycle state of the flow log collector.
+ :param str name: The name for this flow log collector. The name is unique
+ across all flow log collectors in the VPC.
+ :param ResourceGroupReference resource_group: The resource group for this
+ flow log collector.
+ :param LegacyCloudObjectStorageBucketReference storage_bucket: The Cloud
+ Object Storage bucket where the collected flows are logged. For more
+ information, see [Viewing flow log
+ objects](https://cloud.ibm.com/docs/vpc?topic=vpc-fl-analyze).
+ :param FlowLogCollectorTarget target: The target this collector is
+ collecting flow logs for.
+ - If the target is an instance network attachment, flow logs will be
+ collected
+ for that instance network attachment.
+ - If the target is an instance network interface, flow logs will be
+ collected
+ for that instance network interface.
+ - If the target is a virtual network interface, flow logs will be collected
+ for the
+ the virtual network interface's `target` resource if the resource is:
+ - an instance network attachment
+ - If the target is a virtual server instance, flow logs will be collected
+ for all network attachments or network interfaces on that instance.
+ - If the target is a subnet, flow logs will be collected
+ for all instance network interfaces and virtual network interfaces
+ attached to that subnet.
+ - If the target is a VPC, flow logs will be collected for all instance
+ network
+ interfaces and virtual network interfaces attached to all subnets within
+ that VPC.
+ If the target is an instance, subnet, or VPC, flow logs will not be
+ collected
+ for any instance network attachments or instance network interfaces within
+ the target
+ that are themselves the target of a more specific flow log collector.
+ :param VPCReference vpc: The VPC this flow log collector resides in.
+ """
+ self.active = active
+ self.auto_delete = auto_delete
+ self.created_at = created_at
+ self.crn = crn
+ self.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) -> 'FlowLogCollector':
+ """Initialize a FlowLogCollector object from a json dictionary."""
+ args = {}
+ if (active := _dict.get('active')) is not None:
+ args['active'] = active
+ else:
+ raise ValueError('Required property \'active\' not present in FlowLogCollector JSON')
+ if (auto_delete := _dict.get('auto_delete')) is not None:
+ args['auto_delete'] = auto_delete
+ else:
+ raise ValueError('Required property \'auto_delete\' not present in FlowLogCollector JSON')
+ if (created_at := _dict.get('created_at')) is not None:
+ args['created_at'] = string_to_datetime(created_at)
+ else:
+ raise ValueError('Required property \'created_at\' not present in FlowLogCollector JSON')
+ if (crn := _dict.get('crn')) is not None:
+ args['crn'] = crn
+ else:
+ raise ValueError('Required property \'crn\' not present in FlowLogCollector JSON')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
+ else:
+ raise ValueError('Required property \'href\' not present in FlowLogCollector JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
+ else:
+ raise ValueError('Required property \'id\' not present in FlowLogCollector JSON')
+ if (lifecycle_state := _dict.get('lifecycle_state')) is not None:
+ args['lifecycle_state'] = lifecycle_state
+ else:
+ raise ValueError('Required property \'lifecycle_state\' not present in FlowLogCollector JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ else:
+ raise ValueError('Required property \'name\' not present in FlowLogCollector JSON')
+ if (resource_group := _dict.get('resource_group')) is not None:
+ args['resource_group'] = ResourceGroupReference.from_dict(resource_group)
+ else:
+ raise ValueError('Required property \'resource_group\' not present in FlowLogCollector JSON')
+ if (storage_bucket := _dict.get('storage_bucket')) is not None:
+ args['storage_bucket'] = LegacyCloudObjectStorageBucketReference.from_dict(storage_bucket)
+ else:
+ raise ValueError('Required property \'storage_bucket\' not present in FlowLogCollector JSON')
+ if (target := _dict.get('target')) is not None:
+ args['target'] = target
+ else:
+ raise ValueError('Required property \'target\' not present in FlowLogCollector JSON')
+ if (vpc := _dict.get('vpc')) is not None:
+ args['vpc'] = VPCReference.from_dict(vpc)
+ else:
+ raise ValueError('Required property \'vpc\' not present in FlowLogCollector JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """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, '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, '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, 'pfs') and self.pfs is not None:
- _dict['pfs'] = self.pfs
+ if hasattr(self, 'resource_group') and self.resource_group is not None:
+ if isinstance(self.resource_group, dict):
+ _dict['resource_group'] = self.resource_group
+ else:
+ _dict['resource_group'] = self.resource_group.to_dict()
+ if hasattr(self, 'storage_bucket') and self.storage_bucket is not None:
+ if isinstance(self.storage_bucket, dict):
+ _dict['storage_bucket'] = self.storage_bucket
+ else:
+ _dict['storage_bucket'] = self.storage_bucket.to_dict()
+ if hasattr(self, 'target') and self.target is not None:
+ if isinstance(self.target, dict):
+ _dict['target'] = self.target
+ else:
+ _dict['target'] = self.target.to_dict()
+ if hasattr(self, 'vpc') and self.vpc is not None:
+ if isinstance(self.vpc, dict):
+ _dict['vpc'] = self.vpc
+ else:
+ _dict['vpc'] = self.vpc.to_dict()
return _dict
def _to_dict(self):
@@ -39317,155 +41292,324 @@ 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 FlowLogCollector object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'IPsecPolicyPatch') -> 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: 'IPsecPolicyPatch') -> bool:
+ def __ne__(self, other: 'FlowLogCollector') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class AuthenticationAlgorithmEnum(str, Enum):
+ class LifecycleStateEnum(str, Enum):
"""
- The authentication algorithm
- Must be `disabled` if and only if the `encryption_algorithm` is
- `aes128gcm16`, `aes192gcm16`, or `aes256gcm16`.
+ The lifecycle state of the flow log collector.
"""
- DISABLED = 'disabled'
- SHA256 = 'sha256'
- SHA384 = 'sha384'
- SHA512 = 'sha512'
+ DELETING = 'deleting'
+ FAILED = 'failed'
+ PENDING = 'pending'
+ STABLE = 'stable'
+ SUSPENDED = 'suspended'
+ UPDATING = 'updating'
+ WAITING = 'waiting'
- class EncryptionAlgorithmEnum(str, Enum):
+
+class FlowLogCollectorCollection:
+ """
+ FlowLogCollectorCollection.
+
+ :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 FlowLogCollectorCollectionNext next: (optional) A link to the next page
+ of resources. This property is present for all pages
+ except the last page.
+ :param int total_count: The total number of resources across all pages.
+ """
+
+ def __init__(
+ self,
+ first: 'FlowLogCollectorCollectionFirst',
+ flow_log_collectors: List['FlowLogCollector'],
+ limit: int,
+ total_count: int,
+ *,
+ next: Optional['FlowLogCollectorCollectionNext'] = None,
+ ) -> None:
"""
- The encryption algorithm
- The `authentication_algorithm` must be `disabled` if and only if
- `encryption_algorithm` is `aes128gcm16`, `aes192gcm16`, or
- `aes256gcm16`.
+ Initialize a FlowLogCollectorCollection object.
+
+ :param FlowLogCollectorCollectionFirst first: A link to the first page of
+ resources.
+ :param List[FlowLogCollector] flow_log_collectors: Collection of flow log
+ collectors.
+ :param int limit: The maximum number of resources that can be returned by
+ the request.
+ :param int total_count: The total number of resources across all pages.
+ :param FlowLogCollectorCollectionNext next: (optional) A link to the next
+ page of resources. This property is present for all pages
+ except the last page.
"""
+ self.first = first
+ self.flow_log_collectors = flow_log_collectors
+ self.limit = limit
+ self.next = next
+ self.total_count = total_count
- AES128 = 'aes128'
- AES128GCM16 = 'aes128gcm16'
- AES192 = 'aes192'
- AES192GCM16 = 'aes192gcm16'
- AES256 = 'aes256'
- AES256GCM16 = 'aes256gcm16'
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'FlowLogCollectorCollection':
+ """Initialize a FlowLogCollectorCollection object from a json dictionary."""
+ args = {}
+ if (first := _dict.get('first')) is not None:
+ args['first'] = FlowLogCollectorCollectionFirst.from_dict(first)
+ else:
+ raise ValueError('Required property \'first\' not present in FlowLogCollectorCollection JSON')
+ if (flow_log_collectors := _dict.get('flow_log_collectors')) is not None:
+ args['flow_log_collectors'] = [FlowLogCollector.from_dict(v) for v in flow_log_collectors]
+ else:
+ raise ValueError('Required property \'flow_log_collectors\' not present in FlowLogCollectorCollection JSON')
+ if (limit := _dict.get('limit')) is not None:
+ args['limit'] = limit
+ else:
+ raise ValueError('Required property \'limit\' not present in FlowLogCollectorCollection JSON')
+ if (next := _dict.get('next')) is not None:
+ args['next'] = FlowLogCollectorCollectionNext.from_dict(next)
+ if (total_count := _dict.get('total_count')) is not None:
+ args['total_count'] = total_count
+ else:
+ raise ValueError('Required property \'total_count\' not present in FlowLogCollectorCollection JSON')
+ return cls(**args)
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a FlowLogCollectorCollection object from a json dictionary."""
+ return cls.from_dict(_dict)
- class PfsEnum(str, Enum):
+ def to_dict(self) -> Dict:
+ """Return a json dictionary representing this model."""
+ _dict = {}
+ if hasattr(self, 'first') and self.first is not None:
+ if isinstance(self.first, dict):
+ _dict['first'] = self.first
+ else:
+ _dict['first'] = self.first.to_dict()
+ if hasattr(self, 'flow_log_collectors') and self.flow_log_collectors is not None:
+ flow_log_collectors_list = []
+ for v in self.flow_log_collectors:
+ if isinstance(v, dict):
+ flow_log_collectors_list.append(v)
+ else:
+ flow_log_collectors_list.append(v.to_dict())
+ _dict['flow_log_collectors'] = flow_log_collectors_list
+ if hasattr(self, 'limit') and self.limit is not None:
+ _dict['limit'] = self.limit
+ if hasattr(self, 'next') and self.next is not None:
+ if isinstance(self.next, dict):
+ _dict['next'] = self.next
+ else:
+ _dict['next'] = self.next.to_dict()
+ if hasattr(self, 'total_count') and self.total_count is not None:
+ _dict['total_count'] = self.total_count
+ return _dict
+
+ def _to_dict(self):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
+
+ def __str__(self) -> str:
+ """Return a `str` version of this FlowLogCollectorCollection object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ 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: 'FlowLogCollectorCollection') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+
+class FlowLogCollectorCollectionFirst:
+ """
+ A link to the first page of resources.
+
+ :param str href: The URL for a page of resources.
+ """
+
+ def __init__(
+ self,
+ href: str,
+ ) -> None:
"""
- Perfect Forward Secrecy.
+ Initialize a FlowLogCollectorCollectionFirst object.
+
+ :param str href: The URL for a page of resources.
"""
+ self.href = href
- DISABLED = 'disabled'
- GROUP_14 = 'group_14'
- GROUP_15 = 'group_15'
- GROUP_16 = 'group_16'
- GROUP_17 = 'group_17'
- GROUP_18 = 'group_18'
- GROUP_19 = 'group_19'
- GROUP_20 = 'group_20'
- GROUP_21 = 'group_21'
- GROUP_22 = 'group_22'
- GROUP_23 = 'group_23'
- GROUP_24 = 'group_24'
- GROUP_31 = 'group_31'
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'FlowLogCollectorCollectionFirst':
+ """Initialize a FlowLogCollectorCollectionFirst object from a json dictionary."""
+ args = {}
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
+ else:
+ raise ValueError('Required property \'href\' not present in FlowLogCollectorCollectionFirst JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """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, '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 IPsecPolicyReference:
+ def __str__(self) -> str:
+ """Return a `str` version of this FlowLogCollectorCollectionFirst object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ 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: 'FlowLogCollectorCollectionFirst') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+
+class FlowLogCollectorCollectionNext:
"""
- IPsecPolicyReference.
+ A link to the next page of resources. This property is present for all pages except
+ the last page.
- :attr IPsecPolicyReferenceDeleted deleted: (optional) If present, this property
- indicates the referenced resource has been deleted, and provides
- some supplementary information.
- :attr str href: The IPsec policy's canonical URL.
- :attr str id: The unique identifier for this IPsec policy.
- :attr str name: The name for this IPsec policy. The name is unique across all
- IPsec policies in the region.
- :attr str resource_type: The resource type.
+ :param str href: The URL for a page of resources.
"""
def __init__(
self,
href: str,
- id: str,
- name: str,
- resource_type: str,
- *,
- deleted: 'IPsecPolicyReferenceDeleted' = None,
) -> None:
"""
- Initialize a IPsecPolicyReference object.
+ Initialize a FlowLogCollectorCollectionNext object.
- :param str href: The IPsec policy's canonical URL.
- :param str id: The unique identifier for this IPsec policy.
- :param str name: The name for this IPsec policy. The name is unique across
- all IPsec policies in the region.
- :param str resource_type: The resource type.
- :param IPsecPolicyReferenceDeleted deleted: (optional) If present, this
- property indicates the referenced resource has been deleted, and provides
- some supplementary information.
+ :param 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) -> 'IPsecPolicyReference':
- """Initialize a IPsecPolicyReference object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'FlowLogCollectorCollectionNext':
+ """Initialize a FlowLogCollectorCollectionNext 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 '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')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'resource_type\' not present in IPsecPolicyReference JSON')
+ raise ValueError('Required property \'href\' not present in FlowLogCollectorCollectionNext JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a IPsecPolicyReference 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, 'deleted') and self.deleted is not None:
- if isinstance(self.deleted, dict):
- _dict['deleted'] = self.deleted
- else:
- _dict['deleted'] = self.deleted.to_dict()
if hasattr(self, 'href') and self.href is not None:
_dict['href'] = self.href
- if hasattr(self, 'id') and self.id is not None:
- _dict['id'] = self.id
+ return _dict
+
+ def _to_dict(self):
+ """Return a json dictionary representing this model."""
+ 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.
+
+ :param bool active: (optional) Indicates whether this collector is active.
+ Updating to false deactivates the collector and updating to true activates the
+ collector.
+ :param str name: (optional) The name for this flow log collector. The name must
+ not be used by another flow log collector in the VPC.
+ """
+
+ def __init__(
+ self,
+ *,
+ active: Optional[bool] = None,
+ name: Optional[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 name for this flow log collector. The name
+ must not be used by another flow log collector in the VPC.
+ """
+ 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 := _dict.get('active')) is not None:
+ args['active'] = active
+ if (name := _dict.get('name')) is not None:
+ args['name'] = 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
- if hasattr(self, 'resource_type') and self.resource_type is not None:
- _dict['resource_type'] = self.resource_type
return _dict
def _to_dict(self):
@@ -39473,34 +41617,87 @@ 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 FlowLogCollectorPatch object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'IPsecPolicyReference') -> 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: 'IPsecPolicyReference') -> bool:
+ def __ne__(self, other: 'FlowLogCollectorPatch') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class ResourceTypeEnum(str, Enum):
+
+class FlowLogCollectorTarget:
+ """
+ The target this collector is collecting flow logs for.
+ - If the target is an instance network attachment, flow logs will be collected
+ for that instance network attachment.
+ - If the target is an instance network interface, flow logs will be collected
+ for that instance network interface.
+ - If the target is a virtual network interface, flow logs will be collected for the
+ the virtual network interface's `target` resource if the resource is:
+ - an instance network attachment
+ - If the target is a virtual server instance, flow logs will be collected
+ for all network attachments or network interfaces on that instance.
+ - If the target is a subnet, flow logs will be collected
+ for all instance network interfaces and virtual network interfaces
+ attached to that subnet.
+ - If the target is a VPC, flow logs will be collected for all instance network
+ interfaces and virtual network interfaces attached to all subnets within that VPC.
+ If the target is an instance, subnet, or VPC, flow logs will not be collected for any
+ instance network attachments or instance network interfaces within the target that are
+ themselves the target of a more specific flow log collector.
+
+ """
+
+ def __init__(
+ self,
+ ) -> None:
"""
- The resource type.
+ Initialize a FlowLogCollectorTarget object.
+
"""
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['FlowLogCollectorTargetNetworkInterfaceReferenceTargetContext', 'FlowLogCollectorTargetInstanceReference', 'FlowLogCollectorTargetSubnetReference', 'FlowLogCollectorTargetVPCReference', 'FlowLogCollectorTargetInstanceNetworkAttachmentReference', 'FlowLogCollectorTargetVirtualNetworkInterfaceReferenceAttachmentContext'])
+ )
+ raise Exception(msg)
- IPSEC_POLICY = 'ipsec_policy'
+class FlowLogCollectorTargetPrototype:
+ """
+ The target this collector will collect flow logs for.
+ If the target is an instance, subnet, or VPC, flow logs will not be collected for any
+ instance network attachments, virtual network interfaces or instance network
+ interfaces within the target that are themselves the target of a more specific flow
+ log collector.
+ The target must not be a virtual network interface that is attached to a bare metal
+ server network attachment or to a file share mount target.
+ """
-class IPsecPolicyReferenceDeleted:
+ 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', 'FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentity', 'FlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentity'])
+ )
+ raise Exception(msg)
+
+
+class GenericResourceReferenceDeleted:
"""
If present, this property indicates the referenced resource has been deleted, and
provides some supplementary information.
- :attr str more_info: Link to documentation about deleted resources.
+ :param str more_info: Link to documentation about deleted resources.
"""
def __init__(
@@ -39508,25 +41705,25 @@ def __init__(
more_info: str,
) -> None:
"""
- Initialize a IPsecPolicyReferenceDeleted object.
+ Initialize a GenericResourceReferenceDeleted object.
:param str more_info: Link to documentation about deleted resources.
"""
self.more_info = more_info
@classmethod
- def from_dict(cls, _dict: Dict) -> 'IPsecPolicyReferenceDeleted':
- """Initialize a IPsecPolicyReferenceDeleted object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'GenericResourceReferenceDeleted':
+ """Initialize a GenericResourceReferenceDeleted object from a json dictionary."""
args = {}
- if 'more_info' in _dict:
- args['more_info'] = _dict.get('more_info')
+ if (more_info := _dict.get('more_info')) is not None:
+ args['more_info'] = more_info
else:
- raise ValueError('Required property \'more_info\' not present in IPsecPolicyReferenceDeleted JSON')
+ raise ValueError('Required property \'more_info\' not present in GenericResourceReferenceDeleted JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a IPsecPolicyReferenceDeleted object from a json dictionary."""
+ """Initialize a GenericResourceReferenceDeleted object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -39541,334 +41738,194 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this IPsecPolicyReferenceDeleted object."""
+ """Return a `str` version of this GenericResourceReferenceDeleted object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'IPsecPolicyReferenceDeleted') -> bool:
+ def __eq__(self, other: 'GenericResourceReferenceDeleted') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'IPsecPolicyReferenceDeleted') -> bool:
+ def __ne__(self, other: 'GenericResourceReferenceDeleted') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class Image:
+class IKEPolicy:
"""
- Image.
+ IKEPolicy.
- :attr ImageCatalogOffering catalog_offering:
- :attr datetime created_at: The date and time that the image was created.
- :attr str crn: The CRN for this image.
- :attr datetime deprecation_at: (optional) The deprecation date and time (UTC)
- for this image.
- If absent, no deprecation date and time has been set.
- :attr str encryption: The type of encryption used on the image.
- :attr EncryptionKeyReference encryption_key: (optional) The key that will be
- used to encrypt volumes created from this image (unless an
- alternate `encryption_key` is specified at volume creation).
- This property will be present for images with an `encryption` type of
- `user_managed`.
- :attr ImageFile file: Details for the stored image file.
- :attr str href: The URL for this image.
- :attr str id: The unique identifier for this image.
- :attr int minimum_provisioned_size: (optional) The minimum size (in gigabytes)
- of a volume onto which this image may be provisioned.
- This property may be absent if the image has a `status` of `pending` or
- `failed`.
- :attr str name: The name for this image. The name is unique across all images in
- the region.
- :attr datetime obsolescence_at: (optional) The obsolescence date and time (UTC)
- for this image.
- If absent, no obsolescence date and time has been set.
- :attr OperatingSystem operating_system: (optional) The operating system included
- in this image.
- :attr ResourceGroupReference resource_group: The resource group for this image.
- :attr str resource_type: The resource type.
- :attr VolumeReference source_volume: (optional) The volume used to create this
- image (this may be
- [deleted](https://cloud.ibm.com/apidocs/vpc#deleted-resources)).
- If absent, this image was not created from a volume.
- :attr str status: The status of this image
- - available: image can be used (provisionable)
- - deleting: image is being deleted, and can no longer be used to provision new
- resources
- - deprecated: image is administratively slated to become `obsolete`
- - failed: image is corrupt or did not pass validation
- - obsolete: image administratively set to not be used for new resources
- - pending: image is being imported and is not yet `available`
- - unusable: image cannot be used (see `status_reasons[]` for possible
- remediation)
- The enumerated values for this property are expected to expand in the future.
- When processing this property, check for and log unknown values. Optionally halt
- processing and surface the error, or bypass the image on which the unexpected
- property value was encountered.
- :attr List[ImageStatusReason] status_reasons: The reasons for the current status
- (if any):
- - `encrypted_data_key_invalid`: image cannot be decrypted with the specified
- `encryption_key`
- - `encryption_key_deleted`: image unusable because its `encryption_key` was
- deleted
- - `encryption_key_disabled`: image unusable until its `encryption_key` is
- re-enabled
- - `image_data_corrupted`: image data is corrupt, or is not in the specified
- format
- - `image_provisioned_size_unsupported`: image requires a boot volume size
- greater
- than the maximum supported value
- - `image_request_in_progress`: image operation is in progress (such as an import
- from
- Cloud Object Storage)
- - `image_request_queued`: image request has been accepted but the requested
- operation has not started
- The enumerated reason code values for this property will expand in the future.
- When processing this property, check for and log unknown values. Optionally halt
- processing and surface the error, or bypass the resource on which the unexpected
- reason code was encountered.
- :attr str visibility: The visibility of this image.
- - `private`: Visible only to this account
- - `public`: Visible to all accounts.
+ :param str authentication_algorithm: The authentication algorithm
+ The `md5` and `sha1` algorithms have been deprecated.
+ :param List[VPNGatewayConnectionReference] connections: The VPN gateway
+ connections that use this IKE policy.
+ :param datetime created_at: The date and time that this IKE policy was created.
+ :param int dh_group: The Diffie-Hellman group
+ Groups `2` and `5` have been deprecated.
+ :param str encryption_algorithm: The encryption algorithm
+ The `triple_des` algorithm has been deprecated.
+ :param str href: The IKE policy's canonical URL.
+ :param str id: The unique identifier for this IKE policy.
+ :param int ike_version: The IKE protocol version.
+ :param int key_lifetime: The key lifetime in seconds.
+ :param str name: The name for this IKE policy. The name is unique across all IKE
+ policies in the region.
+ :param str negotiation_mode: The IKE negotiation mode. Only `main` is supported.
+ :param ResourceGroupReference resource_group: The resource group for this IKE
+ policy.
+ :param str resource_type: The resource type.
"""
def __init__(
self,
- catalog_offering: 'ImageCatalogOffering',
+ authentication_algorithm: str,
+ connections: List['VPNGatewayConnectionReference'],
created_at: datetime,
- crn: str,
- encryption: str,
- file: 'ImageFile',
+ 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,
- status: str,
- status_reasons: List['ImageStatusReason'],
- visibility: str,
- *,
- deprecation_at: datetime = None,
- encryption_key: 'EncryptionKeyReference' = None,
- minimum_provisioned_size: int = None,
- obsolescence_at: datetime = None,
- operating_system: 'OperatingSystem' = None,
- source_volume: 'VolumeReference' = None,
) -> None:
"""
- Initialize a Image object.
+ Initialize a IKEPolicy object.
- :param ImageCatalogOffering catalog_offering:
- :param datetime created_at: The date and time that the image was created.
- :param str crn: The CRN for this image.
- :param str encryption: The type of encryption used on the image.
- :param ImageFile file: Details for the stored image file.
- :param str href: The URL for this image.
- :param str id: The unique identifier for this image.
- :param str name: The name for this image. The name is unique across all
- images in the region.
+ :param str authentication_algorithm: The authentication algorithm
+ The `md5` and `sha1` algorithms have been deprecated.
+ :param List[VPNGatewayConnectionReference] connections: The VPN gateway
+ connections that use this IKE policy.
+ :param datetime created_at: The date and time that this IKE policy was
+ created.
+ :param int dh_group: The Diffie-Hellman group
+ Groups `2` and `5` have been deprecated.
+ :param str encryption_algorithm: The encryption algorithm
+ The `triple_des` algorithm has been deprecated.
+ :param str href: The IKE policy's canonical URL.
+ :param str id: The unique identifier for this IKE policy.
+ :param int ike_version: The IKE protocol version.
+ :param int key_lifetime: The key lifetime in seconds.
+ :param str name: The name for this IKE policy. The name is unique across
+ all IKE policies in the region.
+ :param str negotiation_mode: The IKE negotiation mode. Only `main` is
+ supported.
:param ResourceGroupReference resource_group: The resource group for this
- image.
+ IKE policy.
:param str resource_type: The resource type.
- :param str status: The status of this image
- - available: image can be used (provisionable)
- - deleting: image is being deleted, and can no longer be used to provision
- new
- resources
- - deprecated: image is administratively slated to become `obsolete`
- - failed: image is corrupt or did not pass validation
- - obsolete: image administratively set to not be used for new resources
- - pending: image is being imported and is not yet `available`
- - unusable: image cannot be used (see `status_reasons[]` for possible
- remediation)
- The enumerated values for this property are expected to expand in the
- future. When processing this property, check for and log unknown values.
- Optionally halt processing and surface the error, or bypass the image on
- which the unexpected property value was encountered.
- :param List[ImageStatusReason] status_reasons: The reasons for the current
- status (if any):
- - `encrypted_data_key_invalid`: image cannot be decrypted with the
- specified
- `encryption_key`
- - `encryption_key_deleted`: image unusable because its `encryption_key` was
- deleted
- - `encryption_key_disabled`: image unusable until its `encryption_key` is
- re-enabled
- - `image_data_corrupted`: image data is corrupt, or is not in the specified
- format
- - `image_provisioned_size_unsupported`: image requires a boot volume size
- greater
- than the maximum supported value
- - `image_request_in_progress`: image operation is in progress (such as an
- import from
- Cloud Object Storage)
- - `image_request_queued`: image request has been accepted but the requested
- operation has not started
- The enumerated reason code values for this property will expand in the
- future. When processing this property, check for and log unknown values.
- Optionally halt processing and surface the error, or bypass the resource on
- which the unexpected reason code was encountered.
- :param str visibility: The visibility of this image.
- - `private`: Visible only to this account
- - `public`: Visible to all accounts.
- :param datetime deprecation_at: (optional) The deprecation date and time
- (UTC) for this image.
- If absent, no deprecation date and time has been set.
- :param EncryptionKeyReference encryption_key: (optional) The key that will
- be used to encrypt volumes created from this image (unless an
- alternate `encryption_key` is specified at volume creation).
- This property will be present for images with an `encryption` type of
- `user_managed`.
- :param int minimum_provisioned_size: (optional) The minimum size (in
- gigabytes) of a volume onto which this image may be provisioned.
- This property may be absent if the image has a `status` of `pending` or
- `failed`.
- :param datetime obsolescence_at: (optional) The obsolescence date and time
- (UTC) for this image.
- If absent, no obsolescence date and time has been set.
- :param OperatingSystem operating_system: (optional) The operating system
- included in this image.
- :param VolumeReference source_volume: (optional) The volume used to create
- this image (this may be
- [deleted](https://cloud.ibm.com/apidocs/vpc#deleted-resources)).
- If absent, this image was not created from a volume.
"""
- self.catalog_offering = catalog_offering
+ self.authentication_algorithm = authentication_algorithm
+ self.connections = connections
self.created_at = created_at
- self.crn = crn
- self.deprecation_at = deprecation_at
- self.encryption = encryption
- self.encryption_key = encryption_key
- self.file = file
+ self.dh_group = dh_group
+ self.encryption_algorithm = encryption_algorithm
self.href = href
self.id = id
- self.minimum_provisioned_size = minimum_provisioned_size
+ self.ike_version = ike_version
+ self.key_lifetime = key_lifetime
self.name = name
- self.obsolescence_at = obsolescence_at
- self.operating_system = operating_system
+ self.negotiation_mode = negotiation_mode
self.resource_group = resource_group
self.resource_type = resource_type
- self.source_volume = source_volume
- self.status = status
- self.status_reasons = status_reasons
- self.visibility = visibility
@classmethod
- def from_dict(cls, _dict: Dict) -> 'Image':
- """Initialize a Image object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'IKEPolicy':
+ """Initialize a IKEPolicy object from a json dictionary."""
args = {}
- if 'catalog_offering' in _dict:
- args['catalog_offering'] = ImageCatalogOffering.from_dict(_dict.get('catalog_offering'))
+ if (authentication_algorithm := _dict.get('authentication_algorithm')) is not None:
+ args['authentication_algorithm'] = authentication_algorithm
else:
- raise ValueError('Required property \'catalog_offering\' not present in Image JSON')
- if 'created_at' in _dict:
- args['created_at'] = string_to_datetime(_dict.get('created_at'))
+ raise ValueError('Required property \'authentication_algorithm\' not present in IKEPolicy JSON')
+ if (connections := _dict.get('connections')) is not None:
+ args['connections'] = [VPNGatewayConnectionReference.from_dict(v) for v in connections]
else:
- raise ValueError('Required property \'created_at\' not present in Image JSON')
- if 'crn' in _dict:
- args['crn'] = _dict.get('crn')
+ raise ValueError('Required property \'connections\' not present in IKEPolicy JSON')
+ if (created_at := _dict.get('created_at')) is not None:
+ args['created_at'] = string_to_datetime(created_at)
else:
- raise ValueError('Required property \'crn\' not present in Image JSON')
- if 'deprecation_at' in _dict:
- args['deprecation_at'] = string_to_datetime(_dict.get('deprecation_at'))
- if 'encryption' in _dict:
- args['encryption'] = _dict.get('encryption')
+ raise ValueError('Required property \'created_at\' not present in IKEPolicy JSON')
+ if (dh_group := _dict.get('dh_group')) is not None:
+ args['dh_group'] = dh_group
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'))
+ raise ValueError('Required property \'dh_group\' not present in IKEPolicy JSON')
+ if (encryption_algorithm := _dict.get('encryption_algorithm')) is not None:
+ args['encryption_algorithm'] = encryption_algorithm
else:
- raise ValueError('Required property \'file\' not present in Image JSON')
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ raise ValueError('Required property \'encryption_algorithm\' not present in IKEPolicy JSON')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'href\' not present in Image JSON')
- if 'id' in _dict:
- args['id'] = _dict.get('id')
+ raise ValueError('Required property \'href\' not present in IKEPolicy JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
else:
- raise ValueError('Required property \'id\' not present in Image JSON')
- if 'minimum_provisioned_size' in _dict:
- args['minimum_provisioned_size'] = _dict.get('minimum_provisioned_size')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
+ raise ValueError('Required property \'id\' not present in IKEPolicy JSON')
+ if (ike_version := _dict.get('ike_version')) is not None:
+ args['ike_version'] = ike_version
else:
- raise ValueError('Required property \'name\' not present in Image JSON')
- if 'obsolescence_at' in _dict:
- args['obsolescence_at'] = string_to_datetime(_dict.get('obsolescence_at'))
- if 'operating_system' in _dict:
- args['operating_system'] = OperatingSystem.from_dict(_dict.get('operating_system'))
- if 'resource_group' in _dict:
- args['resource_group'] = ResourceGroupReference.from_dict(_dict.get('resource_group'))
+ raise ValueError('Required property \'ike_version\' not present in IKEPolicy JSON')
+ if (key_lifetime := _dict.get('key_lifetime')) is not None:
+ args['key_lifetime'] = key_lifetime
else:
- raise ValueError('Required property \'resource_group\' not present in Image JSON')
- if 'resource_type' in _dict:
- args['resource_type'] = _dict.get('resource_type')
+ raise ValueError('Required property \'key_lifetime\' not present in IKEPolicy JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
else:
- raise ValueError('Required property \'resource_type\' not present in Image JSON')
- if 'source_volume' in _dict:
- args['source_volume'] = VolumeReference.from_dict(_dict.get('source_volume'))
- if 'status' in _dict:
- args['status'] = _dict.get('status')
+ raise ValueError('Required property \'name\' not present in IKEPolicy JSON')
+ if (negotiation_mode := _dict.get('negotiation_mode')) is not None:
+ args['negotiation_mode'] = negotiation_mode
else:
- raise ValueError('Required property \'status\' not present in Image JSON')
- if 'status_reasons' in _dict:
- args['status_reasons'] = [ImageStatusReason.from_dict(v) for v in _dict.get('status_reasons')]
+ raise ValueError('Required property \'negotiation_mode\' not present in IKEPolicy JSON')
+ if (resource_group := _dict.get('resource_group')) is not None:
+ args['resource_group'] = ResourceGroupReference.from_dict(resource_group)
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 \'resource_group\' not present in IKEPolicy JSON')
+ if (resource_type := _dict.get('resource_type')) is not None:
+ args['resource_type'] = resource_type
else:
- raise ValueError('Required property \'visibility\' not present in Image JSON')
+ raise ValueError('Required property \'resource_type\' not present in IKEPolicy JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a Image 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, 'catalog_offering') and self.catalog_offering is not None:
- if isinstance(self.catalog_offering, dict):
- _dict['catalog_offering'] = self.catalog_offering
- else:
- _dict['catalog_offering'] = self.catalog_offering.to_dict()
+ if hasattr(self, 'authentication_algorithm') and self.authentication_algorithm is not None:
+ _dict['authentication_algorithm'] = self.authentication_algorithm
+ if hasattr(self, 'connections') and self.connections is not None:
+ connections_list = []
+ for v in self.connections:
+ if isinstance(v, dict):
+ connections_list.append(v)
+ else:
+ connections_list.append(v.to_dict())
+ _dict['connections'] = connections_list
if hasattr(self, 'created_at') and self.created_at is not None:
_dict['created_at'] = datetime_to_string(self.created_at)
- if hasattr(self, 'crn') and self.crn is not None:
- _dict['crn'] = self.crn
- if hasattr(self, 'deprecation_at') and self.deprecation_at is not None:
- _dict['deprecation_at'] = datetime_to_string(self.deprecation_at)
- if hasattr(self, 'encryption') and self.encryption is not None:
- _dict['encryption'] = self.encryption
- if hasattr(self, 'encryption_key') and self.encryption_key is not None:
- if isinstance(self.encryption_key, dict):
- _dict['encryption_key'] = self.encryption_key
- else:
- _dict['encryption_key'] = self.encryption_key.to_dict()
- if hasattr(self, 'file') and self.file is not None:
- if isinstance(self.file, dict):
- _dict['file'] = self.file
- else:
- _dict['file'] = self.file.to_dict()
+ if hasattr(self, '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, 'minimum_provisioned_size') and self.minimum_provisioned_size is not None:
- _dict['minimum_provisioned_size'] = self.minimum_provisioned_size
+ 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, 'obsolescence_at') and self.obsolescence_at is not None:
- _dict['obsolescence_at'] = datetime_to_string(self.obsolescence_at)
- if hasattr(self, 'operating_system') and self.operating_system is not None:
- if isinstance(self.operating_system, dict):
- _dict['operating_system'] = self.operating_system
- else:
- _dict['operating_system'] = self.operating_system.to_dict()
+ if hasattr(self, 'negotiation_mode') and self.negotiation_mode is not None:
+ _dict['negotiation_mode'] = self.negotiation_mode
if hasattr(self, 'resource_group') and self.resource_group is not None:
if isinstance(self.resource_group, dict):
_dict['resource_group'] = self.resource_group
@@ -39876,23 +41933,6 @@ def to_dict(self) -> Dict:
_dict['resource_group'] = self.resource_group.to_dict()
if hasattr(self, 'resource_type') and self.resource_type is not None:
_dict['resource_type'] = self.resource_type
- if hasattr(self, 'source_volume') and self.source_volume is not None:
- if isinstance(self.source_volume, dict):
- _dict['source_volume'] = self.source_volume
- else:
- _dict['source_volume'] = self.source_volume.to_dict()
- if hasattr(self, 'status') and self.status is not None:
- _dict['status'] = self.status
- if hasattr(self, 'status_reasons') and self.status_reasons is not None:
- status_reasons_list = []
- for v in self.status_reasons:
- if isinstance(v, dict):
- status_reasons_list.append(v)
- else:
- status_reasons_list.append(v.to_dict())
- _dict['status_reasons'] = status_reasons_list
- if hasattr(self, 'visibility') and self.visibility is not None:
- _dict['visibility'] = self.visibility
return _dict
def _to_dict(self):
@@ -39900,229 +41940,130 @@ 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 IKEPolicy object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'Image') -> 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: 'Image') -> bool:
+ def __ne__(self, other: 'IKEPolicy') -> 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 image.
- """
-
- NONE = 'none'
- USER_MANAGED = 'user_managed'
-
-
- class ResourceTypeEnum(str, Enum):
+ class AuthenticationAlgorithmEnum(str, Enum):
"""
- The resource type.
+ The authentication algorithm
+ The `md5` and `sha1` algorithms have been deprecated.
"""
- IMAGE = 'image'
+ MD5 = 'md5'
+ SHA1 = 'sha1'
+ SHA256 = 'sha256'
+ SHA384 = 'sha384'
+ SHA512 = 'sha512'
- class StatusEnum(str, Enum):
+ class EncryptionAlgorithmEnum(str, Enum):
"""
- The status of this image
- - available: image can be used (provisionable)
- - deleting: image is being deleted, and can no longer be used to provision new
- resources
- - deprecated: image is administratively slated to become `obsolete`
- - failed: image is corrupt or did not pass validation
- - obsolete: image administratively set to not be used for new resources
- - pending: image is being imported and is not yet `available`
- - unusable: image cannot be used (see `status_reasons[]` for possible remediation)
- The enumerated values for this property are expected to expand in the future. When
- processing this property, check for and log unknown values. Optionally halt
- processing and surface the error, or bypass the image on which the unexpected
- property value was encountered.
+ The encryption algorithm
+ The `triple_des` algorithm has been deprecated.
"""
- AVAILABLE = 'available'
- DELETING = 'deleting'
- DEPRECATED = 'deprecated'
- FAILED = 'failed'
- OBSOLETE = 'obsolete'
- PENDING = 'pending'
- UNUSABLE = 'unusable'
+ AES128 = 'aes128'
+ AES192 = 'aes192'
+ AES256 = 'aes256'
+ TRIPLE_DES = 'triple_des'
- class VisibilityEnum(str, Enum):
+ class NegotiationModeEnum(str, Enum):
"""
- The visibility of this image.
- - `private`: Visible only to this account
- - `public`: Visible to all accounts.
+ The IKE negotiation mode. Only `main` is supported.
"""
- PRIVATE = 'private'
- PUBLIC = 'public'
-
-
-
-class ImageCatalogOffering:
- """
- ImageCatalogOffering.
+ MAIN = 'main'
- :attr bool managed: Indicates whether this image is managed as part of a
- [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user)
- offering. If an image is managed, accounts in the same
- [enterprise](https://cloud.ibm.com/docs/account?topic=account-what-is-enterprise)
- with access to that catalog can specify the image's catalog offering version CRN
- to provision virtual server instances using the image.
- :attr CatalogOfferingVersionReference version: (optional) The
- [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user)
- offering version associated with this image.
- If absent, this image is not associated with a cloud catalog offering.
- """
- def __init__(
- self,
- managed: bool,
- *,
- version: 'CatalogOfferingVersionReference' = None,
- ) -> None:
+ class ResourceTypeEnum(str, Enum):
"""
- Initialize a ImageCatalogOffering object.
-
- :param bool managed: Indicates whether this image is managed as part of a
- [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user)
- offering. If an image is managed, accounts in the same
- [enterprise](https://cloud.ibm.com/docs/account?topic=account-what-is-enterprise)
- with access to that catalog can specify the image's catalog offering
- version CRN to provision virtual server instances using the image.
- :param CatalogOfferingVersionReference version: (optional) The
- [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user)
- offering version associated with this image.
- If absent, this image is not associated with a cloud catalog offering.
+ The resource type.
"""
- self.managed = managed
- self.version = version
-
- @classmethod
- def from_dict(cls, _dict: Dict) -> 'ImageCatalogOffering':
- """Initialize a ImageCatalogOffering object from a json dictionary."""
- args = {}
- if 'managed' in _dict:
- args['managed'] = _dict.get('managed')
- else:
- raise ValueError('Required property \'managed\' not present in ImageCatalogOffering JSON')
- if 'version' in _dict:
- args['version'] = CatalogOfferingVersionReference.from_dict(_dict.get('version'))
- return cls(**args)
-
- @classmethod
- def _from_dict(cls, _dict):
- """Initialize a ImageCatalogOffering object from a json dictionary."""
- return cls.from_dict(_dict)
-
- def to_dict(self) -> Dict:
- """Return a json dictionary representing this model."""
- _dict = {}
- if hasattr(self, 'managed') and self.managed is not None:
- _dict['managed'] = self.managed
- if hasattr(self, 'version') and self.version is not None:
- if isinstance(self.version, dict):
- _dict['version'] = self.version
- else:
- _dict['version'] = self.version.to_dict()
- return _dict
-
- def _to_dict(self):
- """Return a json dictionary representing this model."""
- return self.to_dict()
-
- def __str__(self) -> str:
- """Return a `str` version of this ImageCatalogOffering object."""
- return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'ImageCatalogOffering') -> bool:
- """Return `true` when self and other are equal, false otherwise."""
- if not isinstance(other, self.__class__):
- return False
- return self.__dict__ == other.__dict__
+ IKE_POLICY = 'ike_policy'
- def __ne__(self, other: 'ImageCatalogOffering') -> bool:
- """Return `true` when self and other are not equal, false otherwise."""
- return not self == other
-class ImageCollection:
+class IKEPolicyCollection:
"""
- ImageCollection.
+ IKEPolicyCollection.
- :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
+ :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.
- :attr ImageCollectionNext 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.
- :attr int total_count: The total number of resources across all pages.
+ :param int total_count: The total number of resources across all pages.
"""
def __init__(
self,
- first: 'ImageCollectionFirst',
- images: List['Image'],
+ first: 'IKEPolicyCollectionFirst',
+ ike_policies: List['IKEPolicy'],
limit: int,
total_count: int,
*,
- next: 'ImageCollectionNext' = None,
+ next: Optional['IKEPolicyCollectionNext'] = None,
) -> None:
"""
- Initialize a ImageCollection object.
+ Initialize a IKEPolicyCollection object.
- :param ImageCollectionFirst first: A link to the first page of resources.
- :param List[Image] images: Collection of images.
+ :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 ImageCollectionNext next: (optional) A link to the next page of
+ :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.images = images
+ self.ike_policies = ike_policies
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) -> 'IKEPolicyCollection':
+ """Initialize a IKEPolicyCollection object from a json dictionary."""
args = {}
- if 'first' in _dict:
- args['first'] = ImageCollectionFirst.from_dict(_dict.get('first'))
+ if (first := _dict.get('first')) is not None:
+ args['first'] = IKEPolicyCollectionFirst.from_dict(first)
else:
- raise ValueError('Required property \'first\' not present in ImageCollection JSON')
- if 'images' in _dict:
- args['images'] = [Image.from_dict(v) for v in _dict.get('images')]
+ raise ValueError('Required property \'first\' not present in IKEPolicyCollection JSON')
+ if (ike_policies := _dict.get('ike_policies')) is not None:
+ args['ike_policies'] = [IKEPolicy.from_dict(v) for v in ike_policies]
else:
- raise ValueError('Required property \'images\' not present in ImageCollection JSON')
- if 'limit' in _dict:
- args['limit'] = _dict.get('limit')
+ raise ValueError('Required property \'ike_policies\' not present in IKEPolicyCollection JSON')
+ if (limit := _dict.get('limit')) is not None:
+ args['limit'] = limit
else:
- raise ValueError('Required property \'limit\' not present in ImageCollection JSON')
- if 'next' in _dict:
- args['next'] = ImageCollectionNext.from_dict(_dict.get('next'))
- if 'total_count' in _dict:
- args['total_count'] = _dict.get('total_count')
+ raise ValueError('Required property \'limit\' not present in IKEPolicyCollection JSON')
+ if (next := _dict.get('next')) is not None:
+ args['next'] = IKEPolicyCollectionNext.from_dict(next)
+ if (total_count := _dict.get('total_count')) is not None:
+ args['total_count'] = total_count
else:
- raise ValueError('Required property \'total_count\' not present in ImageCollection JSON')
+ raise ValueError('Required property \'total_count\' not present in IKEPolicyCollection JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a ImageCollection object from a json dictionary."""
+ """Initialize a IKEPolicyCollection object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -40133,14 +42074,14 @@ def to_dict(self) -> Dict:
_dict['first'] = self.first
else:
_dict['first'] = self.first.to_dict()
- if hasattr(self, 'images') and self.images is not None:
- images_list = []
- for v in self.images:
+ if hasattr(self, 'ike_policies') and self.ike_policies is not None:
+ ike_policies_list = []
+ for v in self.ike_policies:
if isinstance(v, dict):
- images_list.append(v)
+ ike_policies_list.append(v)
else:
- images_list.append(v.to_dict())
- _dict['images'] = images_list
+ ike_policies_list.append(v.to_dict())
+ _dict['ike_policies'] = ike_policies_list
if hasattr(self, 'limit') and self.limit is not None:
_dict['limit'] = self.limit
if hasattr(self, 'next') and self.next is not None:
@@ -40157,25 +42098,25 @@ 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 IKEPolicyCollection object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'ImageCollection') -> 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: 'ImageCollection') -> bool:
+ def __ne__(self, other: 'IKEPolicyCollection') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class ImageCollectionFirst:
+class IKEPolicyCollectionFirst:
"""
A link to the first page of resources.
- :attr str href: The URL for a page of resources.
+ :param str href: The URL for a page of resources.
"""
def __init__(
@@ -40183,25 +42124,25 @@ def __init__(
href: str,
) -> None:
"""
- Initialize a ImageCollectionFirst 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) -> 'ImageCollectionFirst':
- """Initialize a ImageCollectionFirst 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')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'href\' not present in ImageCollectionFirst JSON')
+ raise ValueError('Required property \'href\' not present in IKEPolicyCollectionFirst JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a ImageCollectionFirst object from a json dictionary."""
+ """Initialize a IKEPolicyCollectionFirst object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -40216,26 +42157,26 @@ 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 IKEPolicyCollectionFirst object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'ImageCollectionFirst') -> 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: 'ImageCollectionFirst') -> bool:
+ def __ne__(self, other: 'IKEPolicyCollectionFirst') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class ImageCollectionNext:
+class IKEPolicyCollectionNext:
"""
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.
+ :param str href: The URL for a page of resources.
"""
def __init__(
@@ -40243,25 +42184,25 @@ def __init__(
href: str,
) -> None:
"""
- Initialize a ImageCollectionNext 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) -> 'ImageCollectionNext':
- """Initialize a ImageCollectionNext 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')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'href\' not present in ImageCollectionNext JSON')
+ raise ValueError('Required property \'href\' not present in IKEPolicyCollectionNext JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a ImageCollectionNext object from a json dictionary."""
+ """Initialize a IKEPolicyCollectionNext object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -40276,263 +42217,100 @@ 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 IKEPolicyCollectionNext object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'ImageCollectionNext') -> 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: 'ImageCollectionNext') -> bool:
+ def __ne__(self, other: 'IKEPolicyCollectionNext') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class ImageExportJob:
+class IKEPolicyPatch:
"""
- ImageExportJob.
+ IKEPolicyPatch.
- :attr datetime completed_at: (optional) The date and time that the image export
- job was completed.
- If absent, the export job has not yet completed.
- :attr datetime created_at: The date and time that the image export job was
- created.
- :attr bytes encrypted_data_key: (optional) A base64-encoded, encrypted
- representation of the key that was used to encrypt the data for the exported
- image. This key can be unwrapped with the image's `encryption_key` root key
- using either Key Protect or Hyper Protect Crypto Services.
- If absent, the export job is for an unencrypted image.
- :attr str format: The format of the exported image.
- :attr str href: The URL for this image export job.
- :attr str id: The unique identifier for this image export job.
- :attr str name: The name for this image export job. The name must not be used by
- another export job for the image. Changing the name will not affect the exported
- image name,
- `storage_object.name`, or `storage_href` values.
- :attr str resource_type: The type of resource referenced.
- :attr datetime started_at: (optional) The date and time that the image export
- job started running.
- If absent, the export job has not yet started.
- :attr str status: The status of this image export job:
- - `deleting`: Export job is being deleted
- - `failed`: Export job could not be completed successfully
- - `queued`: Export job is queued
- - `running`: Export job is in progress
- - `succeeded`: Export job was completed successfully
- The exported image object is automatically deleted for `failed` jobs.
- :attr List[ImageExportJobStatusReason] status_reasons: The reasons for the
- current status (if any).
- The enumerated reason code values for this property will expand in the future.
- When processing this property, check for and log unknown values. Optionally halt
- processing and surface the error, or bypass the resource on which the unexpected
- reason code was encountered.
- :attr CloudObjectStorageBucketReference storage_bucket: The Cloud Object Storage
- bucket of the exported image object.
- :attr str storage_href: The Cloud Object Storage location of the exported image
- object. The object at this location will not exist until the job completes
- successfully. The exported image object is not managed by the IBM VPC service,
- and may be removed or replaced with a different object by any user or service
- with IAM authorization to the storage bucket.
- :attr CloudObjectStorageObjectReference storage_object: The Cloud Object Storage
- object for the exported image. This object will not exist until
- the job completes successfully. The exported image object is not managed by the
- IBM VPC
- service, and may be removed or replaced with a different object by any user or
- service
- with IAM authorization to the storage bucket.
+ :param str authentication_algorithm: (optional) The authentication algorithm.
+ :param int dh_group: (optional) The Diffie-Hellman group.
+ :param str encryption_algorithm: (optional) The encryption algorithm.
+ :param int ike_version: (optional) The IKE protocol version.
+ :param int key_lifetime: (optional) The key lifetime in seconds.
+ :param str name: (optional) The name for this IKE policy. The name must not be
+ used by another IKE policy in the region.
"""
def __init__(
self,
- created_at: datetime,
- format: str,
- href: str,
- id: str,
- name: str,
- resource_type: str,
- status: str,
- status_reasons: List['ImageExportJobStatusReason'],
- storage_bucket: 'CloudObjectStorageBucketReference',
- storage_href: str,
- storage_object: 'CloudObjectStorageObjectReference',
*,
- completed_at: datetime = None,
- encrypted_data_key: bytes = None,
- started_at: datetime = None,
+ authentication_algorithm: Optional[str] = None,
+ dh_group: Optional[int] = None,
+ encryption_algorithm: Optional[str] = None,
+ ike_version: Optional[int] = None,
+ key_lifetime: Optional[int] = None,
+ name: Optional[str] = None,
) -> None:
"""
- Initialize a ImageExportJob object.
+ Initialize a IKEPolicyPatch object.
- :param datetime created_at: The date and time that the image export job was
- created.
- :param str format: The format of the exported image.
- :param str href: The URL for this image export job.
- :param str id: The unique identifier for this image export job.
- :param str name: The name for this image export job. The name must not be
- used by another export job for the image. Changing the name will not affect
- the exported image name,
- `storage_object.name`, or `storage_href` values.
- :param str resource_type: The type of resource referenced.
- :param str status: The status of this image export job:
- - `deleting`: Export job is being deleted
- - `failed`: Export job could not be completed successfully
- - `queued`: Export job is queued
- - `running`: Export job is in progress
- - `succeeded`: Export job was completed successfully
- The exported image object is automatically deleted for `failed` jobs.
- :param List[ImageExportJobStatusReason] status_reasons: The reasons for the
- current status (if any).
- The enumerated reason code values for this property will expand in the
- future. When processing this property, check for and log unknown values.
- Optionally halt processing and surface the error, or bypass the resource on
- which the unexpected reason code was encountered.
- :param CloudObjectStorageBucketReference storage_bucket: The Cloud Object
- Storage bucket of the exported image object.
- :param str storage_href: The Cloud Object Storage location of the exported
- image object. The object at this location will not exist until the job
- completes successfully. The exported image object is not managed by the IBM
- VPC service, and may be removed or replaced with a different object by any
- user or service with IAM authorization to the storage bucket.
- :param CloudObjectStorageObjectReference storage_object: The Cloud Object
- Storage object for the exported image. This object will not exist until
- the job completes successfully. The exported image object is not managed by
- the IBM VPC
- service, and may be removed or replaced with a different object by any user
- or service
- with IAM authorization to the storage bucket.
- :param datetime completed_at: (optional) The date and time that the image
- export job was completed.
- If absent, the export job has not yet completed.
- :param bytes encrypted_data_key: (optional) A base64-encoded, encrypted
- representation of the key that was used to encrypt the data for the
- exported image. This key can be unwrapped with the image's `encryption_key`
- root key using either Key Protect or Hyper Protect Crypto Services.
- If absent, the export job is for an unencrypted image.
- :param datetime started_at: (optional) The date and time that the image
- export job started running.
- If absent, the export job has not yet started.
+ :param str authentication_algorithm: (optional) The authentication
+ algorithm.
+ :param int dh_group: (optional) The Diffie-Hellman group.
+ :param str encryption_algorithm: (optional) The encryption algorithm.
+ :param int ike_version: (optional) The IKE protocol version.
+ :param int key_lifetime: (optional) The key lifetime in seconds.
+ :param str name: (optional) The name for this IKE policy. The name must not
+ be used by another IKE policy in the region.
"""
- self.completed_at = completed_at
- self.created_at = created_at
- self.encrypted_data_key = encrypted_data_key
- self.format = format
- self.href = href
- self.id = id
+ self.authentication_algorithm = authentication_algorithm
+ self.dh_group = dh_group
+ self.encryption_algorithm = encryption_algorithm
+ self.ike_version = ike_version
+ self.key_lifetime = key_lifetime
self.name = name
- self.resource_type = resource_type
- self.started_at = started_at
- self.status = status
- self.status_reasons = status_reasons
- self.storage_bucket = storage_bucket
- self.storage_href = storage_href
- self.storage_object = storage_object
@classmethod
- def from_dict(cls, _dict: Dict) -> 'ImageExportJob':
- """Initialize a ImageExportJob object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'IKEPolicyPatch':
+ """Initialize a IKEPolicyPatch object from a json dictionary."""
args = {}
- if 'completed_at' in _dict:
- args['completed_at'] = string_to_datetime(_dict.get('completed_at'))
- if 'created_at' in _dict:
- args['created_at'] = string_to_datetime(_dict.get('created_at'))
- else:
- raise ValueError('Required property \'created_at\' not present in ImageExportJob JSON')
- if 'encrypted_data_key' in _dict:
- args['encrypted_data_key'] = base64.b64decode(_dict.get('encrypted_data_key'))
- if 'format' in _dict:
- args['format'] = _dict.get('format')
- else:
- raise ValueError('Required property \'format\' not present in ImageExportJob JSON')
- if 'href' in _dict:
- args['href'] = _dict.get('href')
- else:
- raise ValueError('Required property \'href\' not present in ImageExportJob JSON')
- if 'id' in _dict:
- args['id'] = _dict.get('id')
- else:
- raise ValueError('Required property \'id\' not present in ImageExportJob JSON')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
- else:
- raise ValueError('Required property \'name\' not present in ImageExportJob JSON')
- if 'resource_type' in _dict:
- args['resource_type'] = _dict.get('resource_type')
- else:
- raise ValueError('Required property \'resource_type\' not present in ImageExportJob JSON')
- if 'started_at' in _dict:
- args['started_at'] = string_to_datetime(_dict.get('started_at'))
- if 'status' in _dict:
- args['status'] = _dict.get('status')
- else:
- raise ValueError('Required property \'status\' not present in ImageExportJob JSON')
- if 'status_reasons' in _dict:
- args['status_reasons'] = [ImageExportJobStatusReason.from_dict(v) for v in _dict.get('status_reasons')]
- else:
- raise ValueError('Required property \'status_reasons\' not present in ImageExportJob JSON')
- if 'storage_bucket' in _dict:
- args['storage_bucket'] = CloudObjectStorageBucketReference.from_dict(_dict.get('storage_bucket'))
- else:
- raise ValueError('Required property \'storage_bucket\' not present in ImageExportJob JSON')
- if 'storage_href' in _dict:
- args['storage_href'] = _dict.get('storage_href')
- else:
- raise ValueError('Required property \'storage_href\' not present in ImageExportJob JSON')
- if 'storage_object' in _dict:
- args['storage_object'] = CloudObjectStorageObjectReference.from_dict(_dict.get('storage_object'))
- else:
- raise ValueError('Required property \'storage_object\' not present in ImageExportJob JSON')
+ if (authentication_algorithm := _dict.get('authentication_algorithm')) is not None:
+ args['authentication_algorithm'] = authentication_algorithm
+ if (dh_group := _dict.get('dh_group')) is not None:
+ args['dh_group'] = dh_group
+ if (encryption_algorithm := _dict.get('encryption_algorithm')) is not None:
+ args['encryption_algorithm'] = encryption_algorithm
+ if (ike_version := _dict.get('ike_version')) is not None:
+ args['ike_version'] = ike_version
+ if (key_lifetime := _dict.get('key_lifetime')) is not None:
+ args['key_lifetime'] = key_lifetime
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a ImageExportJob 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, 'completed_at') and self.completed_at is not None:
- _dict['completed_at'] = datetime_to_string(self.completed_at)
- if hasattr(self, 'created_at') and self.created_at is not None:
- _dict['created_at'] = datetime_to_string(self.created_at)
- if hasattr(self, 'encrypted_data_key') and self.encrypted_data_key is not None:
- _dict['encrypted_data_key'] = str(base64.b64encode(self.encrypted_data_key), 'utf-8')
- if hasattr(self, 'format') and self.format is not None:
- _dict['format'] = self.format
- if hasattr(self, 'href') and self.href is not None:
- _dict['href'] = self.href
- if hasattr(self, 'id') and self.id is not None:
- _dict['id'] = self.id
+ if hasattr(self, 'authentication_algorithm') and self.authentication_algorithm is not None:
+ _dict['authentication_algorithm'] = self.authentication_algorithm
+ if hasattr(self, 'dh_group') and self.dh_group is not None:
+ _dict['dh_group'] = self.dh_group
+ if hasattr(self, 'encryption_algorithm') and self.encryption_algorithm is not None:
+ _dict['encryption_algorithm'] = self.encryption_algorithm
+ if hasattr(self, 'ike_version') and self.ike_version is not None:
+ _dict['ike_version'] = self.ike_version
+ if hasattr(self, 'key_lifetime') and self.key_lifetime is not None:
+ _dict['key_lifetime'] = self.key_lifetime
if hasattr(self, 'name') and self.name is not None:
_dict['name'] = self.name
- if hasattr(self, 'resource_type') and self.resource_type is not None:
- _dict['resource_type'] = self.resource_type
- if hasattr(self, 'started_at') and self.started_at is not None:
- _dict['started_at'] = datetime_to_string(self.started_at)
- if hasattr(self, 'status') and self.status is not None:
- _dict['status'] = self.status
- if hasattr(self, 'status_reasons') and self.status_reasons is not None:
- status_reasons_list = []
- for v in self.status_reasons:
- if isinstance(v, dict):
- status_reasons_list.append(v)
- else:
- status_reasons_list.append(v.to_dict())
- _dict['status_reasons'] = status_reasons_list
- if hasattr(self, 'storage_bucket') and self.storage_bucket is not None:
- if isinstance(self.storage_bucket, dict):
- _dict['storage_bucket'] = self.storage_bucket
- else:
- _dict['storage_bucket'] = self.storage_bucket.to_dict()
- if hasattr(self, 'storage_href') and self.storage_href is not None:
- _dict['storage_href'] = self.storage_href
- if hasattr(self, 'storage_object') and self.storage_object is not None:
- if isinstance(self.storage_object, dict):
- _dict['storage_object'] = self.storage_object
- else:
- _dict['storage_object'] = self.storage_object.to_dict()
return _dict
def _to_dict(self):
@@ -40540,98 +42318,126 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this ImageExportJob object."""
+ """Return a `str` version of this IKEPolicyPatch object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'ImageExportJob') -> 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: 'ImageExportJob') -> bool:
+ def __ne__(self, other: 'IKEPolicyPatch') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class FormatEnum(str, Enum):
- """
- The format of the exported image.
- """
-
- QCOW2 = 'qcow2'
- VHD = 'vhd'
-
-
- class ResourceTypeEnum(str, Enum):
+ class AuthenticationAlgorithmEnum(str, Enum):
"""
- The type of resource referenced.
+ The authentication algorithm.
"""
- IMAGE_EXPORT_JOB = 'image_export_job'
+ SHA256 = 'sha256'
+ SHA384 = 'sha384'
+ SHA512 = 'sha512'
- class StatusEnum(str, Enum):
+ class EncryptionAlgorithmEnum(str, Enum):
"""
- The status of this image export job:
- - `deleting`: Export job is being deleted
- - `failed`: Export job could not be completed successfully
- - `queued`: Export job is queued
- - `running`: Export job is in progress
- - `succeeded`: Export job was completed successfully
- The exported image object is automatically deleted for `failed` jobs.
+ The encryption algorithm.
"""
- DELETING = 'deleting'
- FAILED = 'failed'
- QUEUED = 'queued'
- RUNNING = 'running'
- SUCCEEDED = 'succeeded'
+ AES128 = 'aes128'
+ AES192 = 'aes192'
+ AES256 = 'aes256'
-class ImageExportJobPatch:
+class IKEPolicyReference:
"""
- ImageExportJobPatch.
+ IKEPolicyReference.
- :attr str name: (optional) The name for this image export job. The name must not
- be used by another export job for the image. Changing the name will not affect
- the exported image name,
- `storage_object.name`, or `storage_href` values.
+ :param IKEPolicyReferenceDeleted deleted: (optional) If present, this property
+ indicates the referenced resource has been deleted, and provides
+ some supplementary information.
+ :param str href: The IKE policy's canonical URL.
+ :param str id: The unique identifier for this IKE policy.
+ :param str name: The name for this IKE policy. The name is unique across all IKE
+ policies in the region.
+ :param str resource_type: The resource type.
"""
def __init__(
self,
+ href: str,
+ id: str,
+ name: str,
+ resource_type: str,
*,
- name: str = None,
+ deleted: Optional['IKEPolicyReferenceDeleted'] = None,
) -> None:
"""
- Initialize a ImageExportJobPatch object.
+ Initialize a IKEPolicyReference object.
- :param str name: (optional) The name for this image export job. The name
- must not be used by another export job for the image. Changing the name
- will not affect the exported image name,
- `storage_object.name`, or `storage_href` values.
+ :param str href: The IKE policy's canonical URL.
+ :param str id: The unique identifier for this IKE policy.
+ :param str name: The name for this IKE policy. The name is unique across
+ all IKE policies in the region.
+ :param str resource_type: The resource type.
+ :param IKEPolicyReferenceDeleted deleted: (optional) If present, this
+ property indicates the referenced resource has been deleted, and provides
+ some supplementary information.
"""
+ self.deleted = deleted
+ self.href = href
+ self.id = id
self.name = name
+ self.resource_type = resource_type
@classmethod
- def from_dict(cls, _dict: Dict) -> 'ImageExportJobPatch':
- """Initialize a ImageExportJobPatch object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'IKEPolicyReference':
+ """Initialize a IKEPolicyReference object from a json dictionary."""
args = {}
- if 'name' in _dict:
- args['name'] = _dict.get('name')
+ if (deleted := _dict.get('deleted')) is not None:
+ args['deleted'] = IKEPolicyReferenceDeleted.from_dict(deleted)
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
+ else:
+ raise ValueError('Required property \'href\' not present in IKEPolicyReference JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
+ else:
+ raise ValueError('Required property \'id\' not present in IKEPolicyReference JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ else:
+ raise ValueError('Required property \'name\' not present in IKEPolicyReference JSON')
+ if (resource_type := _dict.get('resource_type')) is not None:
+ args['resource_type'] = 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 ImageExportJobPatch object from a json dictionary."""
+ """Initialize a IKEPolicyReference object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
+ if hasattr(self, 'deleted') and self.deleted is not None:
+ if isinstance(self.deleted, dict):
+ _dict['deleted'] = self.deleted
+ else:
+ _dict['deleted'] = self.deleted.to_dict()
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
+ if hasattr(self, 'id') and self.id is not None:
+ _dict['id'] = self.id
if hasattr(self, 'name') and self.name is not None:
_dict['name'] = self.name
+ if hasattr(self, 'resource_type') and self.resource_type is not None:
+ _dict['resource_type'] = self.resource_type
return _dict
def _to_dict(self):
@@ -40639,77 +42445,65 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this ImageExportJobPatch object."""
+ """Return a `str` version of this IKEPolicyReference object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'ImageExportJobPatch') -> 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: 'ImageExportJobPatch') -> bool:
+ def __ne__(self, other: 'IKEPolicyReference') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
+ class ResourceTypeEnum(str, Enum):
+ """
+ The resource type.
+ """
+
+ IKE_POLICY = 'ike_policy'
-class ImageExportJobStatusReason:
+
+
+class IKEPolicyReferenceDeleted:
"""
- ImageExportJobStatusReason.
+ If present, this property indicates the referenced resource has been deleted, and
+ provides some supplementary information.
- :attr str code: A snake case string succinctly identifying the status reason.
- :attr str message: An explanation of the status reason.
- :attr str more_info: (optional) Link to documentation about this status reason.
+ :param str more_info: Link to documentation about deleted resources.
"""
def __init__(
self,
- code: str,
- message: str,
- *,
- more_info: str = None,
+ more_info: str,
) -> None:
"""
- Initialize a ImageExportJobStatusReason object.
+ Initialize a IKEPolicyReferenceDeleted object.
- :param str code: A snake case string succinctly identifying the status
- reason.
- :param str message: An explanation of the status reason.
- :param str more_info: (optional) Link to documentation about this status
- reason.
+ :param str more_info: Link to documentation about deleted resources.
"""
- self.code = code
- self.message = message
self.more_info = more_info
@classmethod
- def from_dict(cls, _dict: Dict) -> 'ImageExportJobStatusReason':
- """Initialize a ImageExportJobStatusReason object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'IKEPolicyReferenceDeleted':
+ """Initialize a IKEPolicyReferenceDeleted object from a json dictionary."""
args = {}
- if 'code' in _dict:
- args['code'] = _dict.get('code')
+ if (more_info := _dict.get('more_info')) is not None:
+ args['more_info'] = more_info
else:
- raise ValueError('Required property \'code\' not present in ImageExportJobStatusReason JSON')
- if 'message' in _dict:
- args['message'] = _dict.get('message')
- else:
- raise ValueError('Required property \'message\' not present in ImageExportJobStatusReason JSON')
- if 'more_info' in _dict:
- args['more_info'] = _dict.get('more_info')
+ raise ValueError('Required property \'more_info\' not present in IKEPolicyReferenceDeleted JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a ImageExportJobStatusReason 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, '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
@@ -40719,73 +42513,67 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this ImageExportJobStatusReason object."""
+ """Return a `str` version of this IKEPolicyReferenceDeleted object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'ImageExportJobStatusReason') -> 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: 'ImageExportJobStatusReason') -> bool:
+ def __ne__(self, other: 'IKEPolicyReferenceDeleted') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class CodeEnum(str, Enum):
- """
- A snake case string succinctly identifying the status reason.
- """
-
- CANNOT_ACCESS_STORAGE_BUCKET = 'cannot_access_storage_bucket'
- INTERNAL_ERROR = 'internal_error'
-
-
-class ImageExportJobUnpaginatedCollection:
+class IP:
"""
- ImageExportJobUnpaginatedCollection.
+ IP.
- :attr List[ImageExportJob] export_jobs: Collection of image export jobs.
+ :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.
"""
def __init__(
self,
- export_jobs: List['ImageExportJob'],
+ address: str,
) -> None:
"""
- Initialize a ImageExportJobUnpaginatedCollection object.
+ Initialize a IP object.
- :param List[ImageExportJob] export_jobs: Collection of image export jobs.
+ :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.export_jobs = export_jobs
+ self.address = address
@classmethod
- def from_dict(cls, _dict: Dict) -> 'ImageExportJobUnpaginatedCollection':
- """Initialize a ImageExportJobUnpaginatedCollection object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'IP':
+ """Initialize a IP object from a json dictionary."""
args = {}
- if 'export_jobs' in _dict:
- args['export_jobs'] = [ImageExportJob.from_dict(v) for v in _dict.get('export_jobs')]
+ if (address := _dict.get('address')) is not None:
+ args['address'] = address
else:
- raise ValueError('Required property \'export_jobs\' not present in ImageExportJobUnpaginatedCollection JSON')
+ raise ValueError('Required property \'address\' not present in IP JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a ImageExportJobUnpaginatedCollection 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, 'export_jobs') and self.export_jobs is not None:
- export_jobs_list = []
- for v in self.export_jobs:
- if isinstance(v, dict):
- export_jobs_list.append(v)
- else:
- export_jobs_list.append(v.to_dict())
- _dict['export_jobs'] = export_jobs_list
+ if hasattr(self, 'address') and self.address is not None:
+ _dict['address'] = self.address
return _dict
def _to_dict(self):
@@ -40793,83 +42581,215 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this ImageExportJobUnpaginatedCollection object."""
+ """Return a `str` version of this IP object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'ImageExportJobUnpaginatedCollection') -> 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: 'ImageExportJobUnpaginatedCollection') -> bool:
+ def __ne__(self, other: 'IP') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class ImageFile:
+class IPsecPolicy:
"""
- ImageFile.
+ IPsecPolicy.
- :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`.
+ :param str authentication_algorithm: The authentication algorithm
+ The `md5` and `sha1` algorithms have been deprecated
+ Must be `disabled` if and only if the `encryption_algorithm` is
+ `aes128gcm16`, `aes192gcm16`, or `aes256gcm16`.
+ :param List[VPNGatewayConnectionReference] connections: The VPN gateway
+ connections that use this IPsec policy.
+ :param datetime created_at: The date and time that this IPsec policy was
+ created.
+ :param str encapsulation_mode: The encapsulation mode used. Only `tunnel` is
+ supported.
+ :param str encryption_algorithm: The encryption algorithm
+ The `triple_des` algorithm has been deprecated
+ The `authentication_algorithm` must be `disabled` if and only if
+ `encryption_algorithm` is `aes128gcm16`, `aes192gcm16`, or
+ `aes256gcm16`.
+ :param str href: The IPsec policy's canonical URL.
+ :param str id: The unique identifier for this IPsec policy.
+ :param int key_lifetime: The key lifetime in seconds.
+ :param str name: The name for this IPsec policy. The name is unique across all
+ IPsec policies in the region.
+ :param str pfs: Perfect Forward Secrecy
+ Groups `group_2` and `group_5` have been deprecated.
+ :param ResourceGroupReference resource_group: The resource group for this IPsec
+ policy.
+ :param str resource_type: The resource type.
+ :param str transform_protocol: The transform protocol used. Only `esp` is
+ supported.
"""
def __init__(
self,
- *,
- checksums: 'ImageFileChecksums' = None,
- size: int = None,
+ authentication_algorithm: str,
+ connections: List['VPNGatewayConnectionReference'],
+ created_at: datetime,
+ encapsulation_mode: str,
+ encryption_algorithm: str,
+ href: str,
+ id: str,
+ key_lifetime: int,
+ name: str,
+ pfs: str,
+ resource_group: 'ResourceGroupReference',
+ resource_type: str,
+ transform_protocol: str,
) -> None:
"""
- Initialize a ImageFile object.
+ Initialize a IPsecPolicy 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 str authentication_algorithm: The authentication algorithm
+ The `md5` and `sha1` algorithms have been deprecated
+ Must be `disabled` if and only if the `encryption_algorithm` is
+ `aes128gcm16`, `aes192gcm16`, or `aes256gcm16`.
+ :param List[VPNGatewayConnectionReference] connections: The VPN gateway
+ connections that use this IPsec policy.
+ :param datetime created_at: The date and time that this IPsec policy was
+ created.
+ :param str encapsulation_mode: The encapsulation mode used. Only `tunnel`
+ is supported.
+ :param str encryption_algorithm: The encryption algorithm
+ The `triple_des` algorithm has been deprecated
+ The `authentication_algorithm` must be `disabled` if and only if
+ `encryption_algorithm` is `aes128gcm16`, `aes192gcm16`, or
+ `aes256gcm16`.
+ :param str href: The IPsec policy's canonical URL.
+ :param str id: The unique identifier for this IPsec policy.
+ :param int key_lifetime: The key lifetime in seconds.
+ :param str name: The name for this IPsec policy. The name is unique across
+ all IPsec policies in the region.
+ :param str pfs: Perfect Forward Secrecy
+ Groups `group_2` and `group_5` have been deprecated.
+ :param ResourceGroupReference resource_group: The resource group for this
+ IPsec policy.
+ :param str resource_type: The resource type.
+ :param str transform_protocol: The transform protocol used. Only `esp` is
+ supported.
"""
- self.checksums = checksums
- self.size = size
+ 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) -> 'ImageFile':
- """Initialize a ImageFile object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'IPsecPolicy':
+ """Initialize a IPsecPolicy 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 (authentication_algorithm := _dict.get('authentication_algorithm')) is not None:
+ args['authentication_algorithm'] = authentication_algorithm
+ else:
+ raise ValueError('Required property \'authentication_algorithm\' not present in IPsecPolicy JSON')
+ if (connections := _dict.get('connections')) is not None:
+ args['connections'] = [VPNGatewayConnectionReference.from_dict(v) for v in connections]
+ else:
+ raise ValueError('Required property \'connections\' not present in IPsecPolicy JSON')
+ if (created_at := _dict.get('created_at')) is not None:
+ args['created_at'] = string_to_datetime(created_at)
+ else:
+ raise ValueError('Required property \'created_at\' not present in IPsecPolicy JSON')
+ if (encapsulation_mode := _dict.get('encapsulation_mode')) is not None:
+ args['encapsulation_mode'] = encapsulation_mode
+ else:
+ raise ValueError('Required property \'encapsulation_mode\' not present in IPsecPolicy JSON')
+ if (encryption_algorithm := _dict.get('encryption_algorithm')) is not None:
+ args['encryption_algorithm'] = encryption_algorithm
+ else:
+ raise ValueError('Required property \'encryption_algorithm\' not present in IPsecPolicy JSON')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
+ else:
+ raise ValueError('Required property \'href\' not present in IPsecPolicy JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
+ else:
+ raise ValueError('Required property \'id\' not present in IPsecPolicy JSON')
+ if (key_lifetime := _dict.get('key_lifetime')) is not None:
+ args['key_lifetime'] = key_lifetime
+ else:
+ raise ValueError('Required property \'key_lifetime\' not present in IPsecPolicy JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ else:
+ raise ValueError('Required property \'name\' not present in IPsecPolicy JSON')
+ if (pfs := _dict.get('pfs')) is not None:
+ args['pfs'] = pfs
+ else:
+ raise ValueError('Required property \'pfs\' not present in IPsecPolicy JSON')
+ if (resource_group := _dict.get('resource_group')) is not None:
+ args['resource_group'] = ResourceGroupReference.from_dict(resource_group)
+ else:
+ raise ValueError('Required property \'resource_group\' not present in IPsecPolicy JSON')
+ if (resource_type := _dict.get('resource_type')) is not None:
+ args['resource_type'] = resource_type
+ else:
+ raise ValueError('Required property \'resource_type\' not present in IPsecPolicy JSON')
+ if (transform_protocol := _dict.get('transform_protocol')) is not None:
+ args['transform_protocol'] = 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 ImageFile 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, 'checksums') and self.checksums is not None:
- if isinstance(self.checksums, dict):
- _dict['checksums'] = self.checksums
+ if hasattr(self, 'authentication_algorithm') and self.authentication_algorithm is not None:
+ _dict['authentication_algorithm'] = self.authentication_algorithm
+ if hasattr(self, 'connections') and self.connections is not None:
+ connections_list = []
+ for v in self.connections:
+ if isinstance(v, dict):
+ connections_list.append(v)
+ else:
+ connections_list.append(v.to_dict())
+ _dict['connections'] = connections_list
+ if hasattr(self, 'created_at') and self.created_at is not None:
+ _dict['created_at'] = datetime_to_string(self.created_at)
+ if hasattr(self, 'encapsulation_mode') and self.encapsulation_mode is not None:
+ _dict['encapsulation_mode'] = self.encapsulation_mode
+ if hasattr(self, 'encryption_algorithm') and self.encryption_algorithm is not None:
+ _dict['encryption_algorithm'] = self.encryption_algorithm
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
+ if hasattr(self, 'id') and self.id is not None:
+ _dict['id'] = self.id
+ if hasattr(self, 'key_lifetime') and self.key_lifetime is not None:
+ _dict['key_lifetime'] = self.key_lifetime
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ if hasattr(self, 'pfs') and self.pfs is not None:
+ _dict['pfs'] = self.pfs
+ if hasattr(self, 'resource_group') and self.resource_group is not None:
+ if isinstance(self.resource_group, dict):
+ _dict['resource_group'] = self.resource_group
else:
- _dict['checksums'] = self.checksums.to_dict()
- if hasattr(self, 'size') and self.size is not None:
- _dict['size'] = self.size
+ _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):
@@ -40877,57 +42797,197 @@ 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 IPsecPolicy object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'ImageFile') -> 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: 'ImageFile') -> bool:
+ def __ne__(self, other: 'IPsecPolicy') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
+ class AuthenticationAlgorithmEnum(str, Enum):
+ """
+ The authentication algorithm
+ The `md5` and `sha1` algorithms have been deprecated
+ Must be `disabled` if and only if the `encryption_algorithm` is
+ `aes128gcm16`, `aes192gcm16`, or `aes256gcm16`.
+ """
+
+ DISABLED = 'disabled'
+ MD5 = 'md5'
+ SHA1 = 'sha1'
+ SHA256 = 'sha256'
+ SHA384 = 'sha384'
+ SHA512 = 'sha512'
+
-class ImageFileChecksums:
+ class EncapsulationModeEnum(str, Enum):
+ """
+ The encapsulation mode used. Only `tunnel` is supported.
+ """
+
+ TUNNEL = 'tunnel'
+
+
+ class EncryptionAlgorithmEnum(str, Enum):
+ """
+ The encryption algorithm
+ The `triple_des` algorithm has been deprecated
+ The `authentication_algorithm` must be `disabled` if and only if
+ `encryption_algorithm` is `aes128gcm16`, `aes192gcm16`, or
+ `aes256gcm16`.
+ """
+
+ AES128 = 'aes128'
+ AES128GCM16 = 'aes128gcm16'
+ AES192 = 'aes192'
+ AES192GCM16 = 'aes192gcm16'
+ AES256 = 'aes256'
+ AES256GCM16 = 'aes256gcm16'
+ TRIPLE_DES = 'triple_des'
+
+
+ class PfsEnum(str, Enum):
+ """
+ Perfect Forward Secrecy
+ Groups `group_2` and `group_5` have been deprecated.
+ """
+
+ DISABLED = 'disabled'
+ GROUP_14 = 'group_14'
+ GROUP_15 = 'group_15'
+ GROUP_16 = 'group_16'
+ GROUP_17 = 'group_17'
+ GROUP_18 = 'group_18'
+ GROUP_19 = 'group_19'
+ GROUP_2 = 'group_2'
+ GROUP_20 = 'group_20'
+ GROUP_21 = 'group_21'
+ GROUP_22 = 'group_22'
+ GROUP_23 = 'group_23'
+ GROUP_24 = 'group_24'
+ GROUP_31 = 'group_31'
+ GROUP_5 = 'group_5'
+
+
+ class ResourceTypeEnum(str, Enum):
+ """
+ The resource type.
+ """
+
+ IPSEC_POLICY = 'ipsec_policy'
+
+
+ class TransformProtocolEnum(str, Enum):
+ """
+ The transform protocol used. Only `esp` is supported.
+ """
+
+ ESP = 'esp'
+
+
+
+class IPsecPolicyCollection:
"""
- ImageFileChecksums.
+ IPsecPolicyCollection.
- :attr str sha256: (optional) The SHA256 fingerprint of the image file.
+ :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 IPsecPolicyCollectionNext next: (optional) A link to the next page of
+ resources. This property is present for all pages
+ except the last page.
+ :param int total_count: The total number of resources across all pages.
"""
def __init__(
self,
+ first: 'IPsecPolicyCollectionFirst',
+ ipsec_policies: List['IPsecPolicy'],
+ limit: int,
+ total_count: int,
*,
- sha256: str = None,
+ next: Optional['IPsecPolicyCollectionNext'] = None,
) -> None:
"""
- Initialize a ImageFileChecksums object.
+ Initialize a IPsecPolicyCollection object.
- :param str sha256: (optional) The SHA256 fingerprint of the image file.
+ :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.sha256 = sha256
+ 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) -> 'ImageFileChecksums':
- """Initialize a ImageFileChecksums object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'IPsecPolicyCollection':
+ """Initialize a IPsecPolicyCollection object from a json dictionary."""
args = {}
- if 'sha256' in _dict:
- args['sha256'] = _dict.get('sha256')
+ if (first := _dict.get('first')) is not None:
+ args['first'] = IPsecPolicyCollectionFirst.from_dict(first)
+ else:
+ raise ValueError('Required property \'first\' not present in IPsecPolicyCollection JSON')
+ if (ipsec_policies := _dict.get('ipsec_policies')) is not None:
+ args['ipsec_policies'] = [IPsecPolicy.from_dict(v) for v in ipsec_policies]
+ else:
+ raise ValueError('Required property \'ipsec_policies\' not present in IPsecPolicyCollection JSON')
+ if (limit := _dict.get('limit')) is not None:
+ args['limit'] = limit
+ else:
+ raise ValueError('Required property \'limit\' not present in IPsecPolicyCollection JSON')
+ if (next := _dict.get('next')) is not None:
+ args['next'] = IPsecPolicyCollectionNext.from_dict(next)
+ if (total_count := _dict.get('total_count')) is not None:
+ args['total_count'] = total_count
+ else:
+ raise ValueError('Required property \'total_count\' not present in IPsecPolicyCollection JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a ImageFileChecksums 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, 'sha256') and self.sha256 is not None:
- _dict['sha256'] = self.sha256
+ if hasattr(self, 'first') and self.first is not None:
+ if isinstance(self.first, dict):
+ _dict['first'] = self.first
+ else:
+ _dict['first'] = self.first.to_dict()
+ if hasattr(self, 'ipsec_policies') and self.ipsec_policies is not None:
+ ipsec_policies_list = []
+ for v in self.ipsec_policies:
+ if isinstance(v, dict):
+ ipsec_policies_list.append(v)
+ else:
+ ipsec_policies_list.append(v.to_dict())
+ _dict['ipsec_policies'] = ipsec_policies_list
+ if hasattr(self, 'limit') and self.limit is not None:
+ _dict['limit'] = self.limit
+ if hasattr(self, 'next') and self.next is not None:
+ if isinstance(self.next, dict):
+ _dict['next'] = self.next
+ else:
+ _dict['next'] = self.next.to_dict()
+ if hasattr(self, 'total_count') and self.total_count is not None:
+ _dict['total_count'] = self.total_count
return _dict
def _to_dict(self):
@@ -40935,27 +42995,25 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this ImageFileChecksums object."""
+ """Return a `str` version of this IPsecPolicyCollection object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'ImageFileChecksums') -> 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: 'ImageFileChecksums') -> bool:
+ def __ne__(self, other: 'IPsecPolicyCollection') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class ImageFilePrototype:
+class IPsecPolicyCollectionFirst:
"""
- ImageFilePrototype.
+ A link to the first page of resources.
- :attr str href: The Cloud Object Storage location of the image file.
- The image file format is specified by the file's extension, which must be either
- `qcow2` or `vhd`.
+ :param str href: The URL for a page of resources.
"""
def __init__(
@@ -40963,28 +43021,25 @@ def __init__(
href: str,
) -> None:
"""
- Initialize a ImageFilePrototype object.
+ Initialize a IPsecPolicyCollectionFirst object.
- :param str href: The Cloud Object Storage location of the image file.
- The image file format is specified by the file's extension, which must be
- either
- `qcow2` or `vhd`.
+ :param str href: The URL for a page of resources.
"""
self.href = href
@classmethod
- def from_dict(cls, _dict: Dict) -> 'ImageFilePrototype':
- """Initialize a ImageFilePrototype object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'IPsecPolicyCollectionFirst':
+ """Initialize a IPsecPolicyCollectionFirst object from a json dictionary."""
args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'href\' not present in ImageFilePrototype JSON')
+ raise ValueError('Required property \'href\' not present in IPsecPolicyCollectionFirst JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a ImageFilePrototype object from a json dictionary."""
+ """Initialize a IPsecPolicyCollectionFirst object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -40999,151 +43054,162 @@ 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 IPsecPolicyCollectionFirst object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'ImageFilePrototype') -> 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: 'ImageFilePrototype') -> bool:
+ def __ne__(self, other: 'IPsecPolicyCollectionFirst') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class ImageIdentity:
+class IPsecPolicyCollectionNext:
"""
- Identifies an image by a unique property.
+ 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.
"""
def __init__(
self,
+ href: str,
) -> None:
"""
- Initialize a ImageIdentity object.
+ Initialize a IPsecPolicyCollectionNext object.
+ :param str href: The URL for a page of resources.
"""
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['ImageIdentityById', 'ImageIdentityByCRN', 'ImageIdentityByHref'])
- )
- raise Exception(msg)
+ self.href = href
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'IPsecPolicyCollectionNext':
+ """Initialize a IPsecPolicyCollectionNext object from a json dictionary."""
+ args = {}
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
+ else:
+ raise ValueError('Required property \'href\' not present in IPsecPolicyCollectionNext JSON')
+ return cls(**args)
-class ImagePatch:
+ @classmethod
+ def _from_dict(cls, _dict):
+ """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, '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 IPsecPolicyCollectionNext object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ 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: 'IPsecPolicyCollectionNext') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+
+class IPsecPolicyPatch:
"""
- ImagePatch.
+ IPsecPolicyPatch.
- :attr datetime deprecation_at: (optional) The deprecation date and time to set
- for this image.
- This cannot be set if the image has a `status` of `failed` or `deleting`, or if
- `catalog_offering.managed` is `true`.
- The date and time must not be in the past, and must be earlier than
- `obsolescence_at`
- (if `obsolescence_at` is set). Additionally, if the image status is currently
- `deprecated`, the value cannot be changed (but may be removed).
- Specify `null` to remove an existing deprecation date and time. If the image
- status is currently `deprecated`, it will become `available`.
- If the deprecation date and time is reached while the image has a status of
- `pending`, the image's status will transition to `deprecated` upon its
- successful creation (or
- `obsolete` if the obsolescence date and time was also reached).
- :attr str name: (optional) The name for this image. The name must not be used by
- another image in the region. Names starting with `ibm-` are reserved for
- system-provided images, and are not allowed.
- :attr datetime obsolescence_at: (optional) The obsolescence date and time to set
- for this image.
- This cannot be set if the image has a `status` of `failed` or `deleting`, or if
- `catalog_offering.managed` is `true`.
- The date and time must not be in the past, and must be later than
- `deprecation_at` (if
- `deprecation_at` is set). Additionally, if the image status is currently
- `obsolete`, the value cannot be changed (but may be removed).
- Specify `null` to remove an existing obsolescence date and time. If the image
- status is currently `obsolete`, it will become `deprecated` if `deprecation_at`
- is in the past. Otherwise, it will become `available`.
- If the obsolescence date and time is reached while the image has a status of
- `pending`, the image's status will transition to `obsolete` upon its successful
- creation.
+ :param str authentication_algorithm: (optional) The authentication algorithm
+ Must be `disabled` if and only if the `encryption_algorithm` is
+ `aes128gcm16`, `aes192gcm16`, or `aes256gcm16`.
+ :param str encryption_algorithm: (optional) The encryption algorithm
+ The `authentication_algorithm` must be `disabled` if and only if
+ `encryption_algorithm` is `aes128gcm16`, `aes192gcm16`, or
+ `aes256gcm16`.
+ :param int key_lifetime: (optional) The key lifetime in seconds.
+ :param str name: (optional) The name for this IPsec policy. The name must not be
+ used by another IPsec policy in the region.
+ :param str pfs: (optional) Perfect Forward Secrecy.
"""
def __init__(
self,
*,
- deprecation_at: datetime = None,
- name: str = None,
- obsolescence_at: datetime = None,
+ authentication_algorithm: Optional[str] = None,
+ encryption_algorithm: Optional[str] = None,
+ key_lifetime: Optional[int] = None,
+ name: Optional[str] = None,
+ pfs: Optional[str] = None,
) -> None:
"""
- Initialize a ImagePatch object.
+ Initialize a IPsecPolicyPatch object.
- :param datetime deprecation_at: (optional) The deprecation date and time to
- set for this image.
- This cannot be set if the image has a `status` of `failed` or `deleting`,
- or if
- `catalog_offering.managed` is `true`.
- The date and time must not be in the past, and must be earlier than
- `obsolescence_at`
- (if `obsolescence_at` is set). Additionally, if the image status is
- currently
- `deprecated`, the value cannot be changed (but may be removed).
- Specify `null` to remove an existing deprecation date and time. If the
- image status is currently `deprecated`, it will become `available`.
- If the deprecation date and time is reached while the image has a status of
- `pending`, the image's status will transition to `deprecated` upon its
- successful creation (or
- `obsolete` if the obsolescence date and time was also reached).
- :param str name: (optional) The name for this image. The name must not be
- used by another image in the region. Names starting with `ibm-` are
- reserved for system-provided images, and are not allowed.
- :param datetime obsolescence_at: (optional) The obsolescence date and time
- to set for this image.
- This cannot be set if the image has a `status` of `failed` or `deleting`,
- or if
- `catalog_offering.managed` is `true`.
- The date and time must not be in the past, and must be later than
- `deprecation_at` (if
- `deprecation_at` is set). Additionally, if the image status is currently
- `obsolete`, the value cannot be changed (but may be removed).
- Specify `null` to remove an existing obsolescence date and time. If the
- image status is currently `obsolete`, it will become `deprecated` if
- `deprecation_at` is in the past. Otherwise, it will become `available`.
- If the obsolescence date and time is reached while the image has a status
- of `pending`, the image's status will transition to `obsolete` upon its
- successful creation.
+ :param str authentication_algorithm: (optional) The authentication
+ algorithm
+ Must be `disabled` if and only if the `encryption_algorithm` is
+ `aes128gcm16`, `aes192gcm16`, or `aes256gcm16`.
+ :param str encryption_algorithm: (optional) The encryption algorithm
+ The `authentication_algorithm` must be `disabled` if and only if
+ `encryption_algorithm` is `aes128gcm16`, `aes192gcm16`, or
+ `aes256gcm16`.
+ :param int key_lifetime: (optional) The key lifetime in seconds.
+ :param str name: (optional) The name for this IPsec policy. The name must
+ not be used by another IPsec policy in the region.
+ :param str pfs: (optional) Perfect Forward Secrecy.
"""
- self.deprecation_at = deprecation_at
+ self.authentication_algorithm = authentication_algorithm
+ self.encryption_algorithm = encryption_algorithm
+ self.key_lifetime = key_lifetime
self.name = name
- self.obsolescence_at = obsolescence_at
+ self.pfs = pfs
@classmethod
- def from_dict(cls, _dict: Dict) -> 'ImagePatch':
- """Initialize a ImagePatch object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'IPsecPolicyPatch':
+ """Initialize a IPsecPolicyPatch object from a json dictionary."""
args = {}
- if 'deprecation_at' in _dict:
- args['deprecation_at'] = string_to_datetime(_dict.get('deprecation_at'))
- if 'name' in _dict:
- args['name'] = _dict.get('name')
- if 'obsolescence_at' in _dict:
- args['obsolescence_at'] = string_to_datetime(_dict.get('obsolescence_at'))
+ if (authentication_algorithm := _dict.get('authentication_algorithm')) is not None:
+ args['authentication_algorithm'] = authentication_algorithm
+ if (encryption_algorithm := _dict.get('encryption_algorithm')) is not None:
+ args['encryption_algorithm'] = encryption_algorithm
+ if (key_lifetime := _dict.get('key_lifetime')) is not None:
+ args['key_lifetime'] = key_lifetime
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ if (pfs := _dict.get('pfs')) is not None:
+ args['pfs'] = pfs
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a ImagePatch 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, 'deprecation_at') and self.deprecation_at is not None:
- _dict['deprecation_at'] = datetime_to_string(self.deprecation_at)
+ 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, 'obsolescence_at') and self.obsolescence_at is not None:
- _dict['obsolescence_at'] = datetime_to_string(self.obsolescence_at)
+ if hasattr(self, 'pfs') and self.pfs is not None:
+ _dict['pfs'] = self.pfs
return _dict
def _to_dict(self):
@@ -41151,192 +43217,142 @@ 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 IPsecPolicyPatch object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'ImagePatch') -> 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: 'ImagePatch') -> bool:
+ def __ne__(self, other: 'IPsecPolicyPatch') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
+ class AuthenticationAlgorithmEnum(str, Enum):
+ """
+ The authentication algorithm
+ Must be `disabled` if and only if the `encryption_algorithm` is
+ `aes128gcm16`, `aes192gcm16`, or `aes256gcm16`.
+ """
-class ImagePrototype:
- """
- ImagePrototype.
+ DISABLED = 'disabled'
+ SHA256 = 'sha256'
+ SHA384 = 'sha384'
+ SHA512 = 'sha512'
- :attr datetime deprecation_at: (optional) The deprecation date and time to set
- for this image.
- The date and time must not be in the past, and must be earlier than
- `obsolescence_at`
- (if `obsolescence_at` is set).
- If unspecified, no deprecation date and time will be set.
- If the deprecation date and time is reached while the image has a status of
- `pending`, the image's status will transition to `deprecated` upon its
- successful creation (or
- `obsolete` if the obsolescence date and time was also reached).
- :attr str name: (optional) The name for this image. The name must not be used by
- another image in the region. Names starting with `ibm-` are reserved for
- system-provided images, and are not allowed. If unspecified, the name will be a
- hyphenated list of randomly-selected words.
- :attr datetime obsolescence_at: (optional) The obsolescence date and time to set
- for this image.
- The date and time must not be in the past, and must be later than
- `deprecation_at` (if
- `deprecation_at` is set).
- If unspecified, no obsolescence date and time will be set.
- If the obsolescence date and time is reached while the image has a status of
- `pending`, the image's status will transition to `obsolete` upon its successful
- creation.
- :attr ResourceGroupIdentity resource_group: (optional) The resource group to
- use. If unspecified, the account's [default resource
- group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be
- used.
- """
- def __init__(
- self,
- *,
- deprecation_at: datetime = None,
- name: str = None,
- obsolescence_at: datetime = None,
- resource_group: 'ResourceGroupIdentity' = None,
- ) -> None:
+ class EncryptionAlgorithmEnum(str, Enum):
+ """
+ The encryption algorithm
+ The `authentication_algorithm` must be `disabled` if and only if
+ `encryption_algorithm` is `aes128gcm16`, `aes192gcm16`, or
+ `aes256gcm16`.
"""
- Initialize a ImagePrototype object.
- :param datetime deprecation_at: (optional) The deprecation date and time to
- set for this image.
- The date and time must not be in the past, and must be earlier than
- `obsolescence_at`
- (if `obsolescence_at` is set).
- If unspecified, no deprecation date and time will be set.
- If the deprecation date and time is reached while the image has a status of
- `pending`, the image's status will transition to `deprecated` upon its
- successful creation (or
- `obsolete` if the obsolescence date and time was also reached).
- :param str name: (optional) The name for this image. The name must not be
- used by another image in the region. Names starting with `ibm-` are
- reserved for system-provided images, and are not allowed. If unspecified,
- the name will be a hyphenated list of randomly-selected words.
- :param datetime obsolescence_at: (optional) The obsolescence date and time
- to set for this image.
- The date and time must not be in the past, and must be later than
- `deprecation_at` (if
- `deprecation_at` is set).
- If unspecified, no obsolescence date and time will be set.
- If the obsolescence date and time is reached while the image has a status
- of
- `pending`, the image's status will transition to `obsolete` upon its
- successful creation.
- :param ResourceGroupIdentity resource_group: (optional) The resource group
- to use. If unspecified, the account's [default resource
- group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be
- used.
+ AES128 = 'aes128'
+ AES128GCM16 = 'aes128gcm16'
+ AES192 = 'aes192'
+ AES192GCM16 = 'aes192gcm16'
+ AES256 = 'aes256'
+ AES256GCM16 = 'aes256gcm16'
+
+
+ class PfsEnum(str, Enum):
"""
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['ImagePrototypeImageByFile', 'ImagePrototypeImageBySourceVolume'])
- )
- raise Exception(msg)
+ Perfect Forward Secrecy.
+ """
+
+ DISABLED = 'disabled'
+ GROUP_14 = 'group_14'
+ GROUP_15 = 'group_15'
+ GROUP_16 = 'group_16'
+ GROUP_17 = 'group_17'
+ GROUP_18 = 'group_18'
+ GROUP_19 = 'group_19'
+ GROUP_20 = 'group_20'
+ GROUP_21 = 'group_21'
+ GROUP_22 = 'group_22'
+ GROUP_23 = 'group_23'
+ GROUP_24 = 'group_24'
+ GROUP_31 = 'group_31'
-class ImageReference:
+
+class IPsecPolicyReference:
"""
- ImageReference.
+ IPsecPolicyReference.
- :attr str crn: The CRN for this image.
- :attr ImageReferenceDeleted deleted: (optional) If present, this property
+ :param IPsecPolicyReferenceDeleted deleted: (optional) If present, this property
indicates the referenced resource has been deleted, and provides
some supplementary information.
- :attr str href: The URL for this image.
- :attr str id: The unique identifier for this image.
- :attr str name: The name for this image. The name is unique across all images in
- the region.
- :attr ImageRemote remote: (optional) If present, this property indicates that
- the resource associated with this reference
- is remote and therefore may not be directly retrievable.
- :attr str resource_type: The resource type.
+ :param str href: The IPsec policy's canonical URL.
+ :param str id: The unique identifier for this IPsec policy.
+ :param str name: The name for this IPsec policy. The name is unique across all
+ IPsec policies in the region.
+ :param str resource_type: The resource type.
"""
def __init__(
self,
- crn: str,
href: str,
id: str,
name: str,
resource_type: str,
*,
- deleted: 'ImageReferenceDeleted' = None,
- remote: 'ImageRemote' = None,
+ deleted: Optional['IPsecPolicyReferenceDeleted'] = None,
) -> None:
"""
- Initialize a ImageReference object.
+ Initialize a IPsecPolicyReference object.
- :param str crn: The CRN for this image.
- :param str href: The URL for this image.
- :param str id: The unique identifier for this image.
- :param str name: The name for this image. The name is unique across all
- images in the region.
+ :param str href: The IPsec policy's canonical URL.
+ :param str id: The unique identifier for this IPsec policy.
+ :param str name: The name for this IPsec policy. The name is unique across
+ all IPsec policies in the region.
:param str resource_type: The resource type.
- :param ImageReferenceDeleted deleted: (optional) If present, this property
- indicates the referenced resource has been deleted, and provides
+ :param IPsecPolicyReferenceDeleted deleted: (optional) If present, this
+ property indicates the referenced resource has been deleted, and provides
some supplementary information.
- :param ImageRemote remote: (optional) If present, this property indicates
- that the resource associated with this reference
- is remote and therefore may not be directly retrievable.
"""
- self.crn = crn
self.deleted = deleted
self.href = href
self.id = id
self.name = name
- self.remote = remote
self.resource_type = resource_type
@classmethod
- def from_dict(cls, _dict: Dict) -> 'ImageReference':
- """Initialize a ImageReference object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'IPsecPolicyReference':
+ """Initialize a IPsecPolicyReference 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')
+ if (deleted := _dict.get('deleted')) is not None:
+ args['deleted'] = IPsecPolicyReferenceDeleted.from_dict(deleted)
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'href\' not present in ImageReference JSON')
- if 'id' in _dict:
- args['id'] = _dict.get('id')
+ raise ValueError('Required property \'href\' not present in IPsecPolicyReference JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
else:
- raise ValueError('Required property \'id\' not present in ImageReference JSON')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
+ raise ValueError('Required property \'id\' not present in IPsecPolicyReference JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
else:
- raise ValueError('Required property \'name\' not present in ImageReference JSON')
- if 'remote' in _dict:
- args['remote'] = ImageRemote.from_dict(_dict.get('remote'))
- if 'resource_type' in _dict:
- args['resource_type'] = _dict.get('resource_type')
+ raise ValueError('Required property \'name\' not present in IPsecPolicyReference JSON')
+ if (resource_type := _dict.get('resource_type')) is not None:
+ args['resource_type'] = resource_type
else:
- raise ValueError('Required property \'resource_type\' not present in ImageReference JSON')
+ raise ValueError('Required property \'resource_type\' not present in IPsecPolicyReference JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a ImageReference 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, 'crn') and self.crn is not None:
- _dict['crn'] = self.crn
if hasattr(self, 'deleted') and self.deleted is not None:
if isinstance(self.deleted, dict):
_dict['deleted'] = self.deleted
@@ -41348,11 +43364,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, 'remote') and self.remote is not None:
- if isinstance(self.remote, dict):
- _dict['remote'] = self.remote
- else:
- _dict['remote'] = self.remote.to_dict()
if hasattr(self, 'resource_type') and self.resource_type is not None:
_dict['resource_type'] = self.resource_type
return _dict
@@ -41362,16 +43373,16 @@ 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 IPsecPolicyReference object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'ImageReference') -> 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: 'ImageReference') -> bool:
+ def __ne__(self, other: 'IPsecPolicyReference') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
@@ -41380,16 +43391,16 @@ class ResourceTypeEnum(str, Enum):
The resource type.
"""
- IMAGE = 'image'
+ IPSEC_POLICY = 'ipsec_policy'
-class ImageReferenceDeleted:
+class IPsecPolicyReferenceDeleted:
"""
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.
+ :param str more_info: Link to documentation about deleted resources.
"""
def __init__(
@@ -41397,25 +43408,25 @@ def __init__(
more_info: str,
) -> None:
"""
- Initialize a ImageReferenceDeleted object.
+ Initialize a IPsecPolicyReferenceDeleted object.
:param str more_info: Link to documentation about deleted resources.
"""
self.more_info = more_info
@classmethod
- def from_dict(cls, _dict: Dict) -> 'ImageReferenceDeleted':
- """Initialize a ImageReferenceDeleted object from a json dictionary."""
+ 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')
+ if (more_info := _dict.get('more_info')) is not None:
+ args['more_info'] = more_info
else:
- raise ValueError('Required property \'more_info\' not present in ImageReferenceDeleted JSON')
+ raise ValueError('Required property \'more_info\' not present in IPsecPolicyReferenceDeleted JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a ImageReferenceDeleted object from a json dictionary."""
+ """Initialize a IPsecPolicyReferenceDeleted object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -41430,80 +43441,358 @@ 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 IPsecPolicyReferenceDeleted object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'ImageReferenceDeleted') -> 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: 'ImageReferenceDeleted') -> bool:
+ def __ne__(self, other: 'IPsecPolicyReferenceDeleted') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class ImageRemote:
+class Image:
"""
- If present, this property indicates that the resource associated with this reference
- is remote and therefore may not be directly retrievable.
+ Image.
- :attr AccountReference account: (optional) If present, this property indicates
- that the referenced resource is remote to this
- account, and identifies the owning account.
- :attr RegionReference region: (optional) If present, this property indicates
- that the referenced resource is remote to this
- region, and identifies the native region.
+ :param ImageCatalogOffering catalog_offering:
+ :param datetime created_at: The date and time that the image was created.
+ :param str crn: The CRN for this image.
+ :param datetime deprecation_at: (optional) The deprecation date and time (UTC)
+ for this image.
+ If absent, no deprecation date and time has been set.
+ :param str encryption: The type of encryption used on the image.
+ :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 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 int minimum_provisioned_size: (optional) The minimum size (in gigabytes)
+ of a volume onto which this image may be provisioned.
+ This property may be absent if the image has a `status` of `pending` or
+ `failed`.
+ :param str name: The name for this image. The name is unique across all images
+ in the region.
+ :param datetime obsolescence_at: (optional) The obsolescence date and time (UTC)
+ for this image.
+ If absent, no obsolescence date and time has been set.
+ :param OperatingSystem operating_system: (optional) The operating system
+ included in this image.
+ :param ResourceGroupReference resource_group: The resource group for this image.
+ :param str resource_type: The resource type.
+ :param VolumeReference source_volume: (optional) The volume used to create this
+ image (this may be
+ [deleted](https://cloud.ibm.com/apidocs/vpc#deleted-resources)).
+ If absent, this image was not created from a volume.
+ :param str status: The status of this image
+ - available: image can be used (provisionable)
+ - deleting: image is being deleted, and can no longer be used to provision new
+ resources
+ - deprecated: image is administratively slated to become `obsolete`
+ - failed: image is corrupt or did not pass validation
+ - obsolete: image administratively set to not be used for new resources
+ - pending: image is being imported and is not yet `available`
+ - unusable: image cannot be used (see `status_reasons[]` for possible
+ remediation)
+ The enumerated values for this property are expected to expand in the future.
+ When processing this property, check for and log unknown values. Optionally halt
+ processing and surface the error, or bypass the image on which the unexpected
+ property value was encountered.
+ :param List[ImageStatusReason] status_reasons: The reasons for the current
+ status (if any):
+ - `encrypted_data_key_invalid`: image cannot be decrypted with the specified
+ `encryption_key`
+ - `encryption_key_deleted`: image unusable because its `encryption_key` was
+ deleted
+ - `encryption_key_disabled`: image unusable until its `encryption_key` is
+ re-enabled
+ - `image_data_corrupted`: image data is corrupt, or is not in the specified
+ format
+ - `image_provisioned_size_unsupported`: image requires a boot volume size
+ greater
+ than the maximum supported value
+ - `image_request_in_progress`: image operation is in progress (such as an import
+ from
+ Cloud Object Storage)
+ - `image_request_queued`: image request has been accepted but the requested
+ operation has not started
+ The enumerated reason code values for this property will expand in the future.
+ When processing this property, check for and log unknown values. Optionally halt
+ processing and surface the error, or bypass the resource on which the unexpected
+ reason code was encountered.
+ :param str visibility: The visibility of this image.
+ - `private`: Visible only to this account
+ - `public`: Visible to all accounts.
"""
def __init__(
self,
+ catalog_offering: 'ImageCatalogOffering',
+ created_at: datetime,
+ crn: str,
+ encryption: str,
+ file: 'ImageFile',
+ href: str,
+ id: str,
+ name: str,
+ resource_group: 'ResourceGroupReference',
+ resource_type: str,
+ status: str,
+ status_reasons: List['ImageStatusReason'],
+ visibility: str,
*,
- account: 'AccountReference' = None,
- region: 'RegionReference' = None,
+ deprecation_at: Optional[datetime] = None,
+ encryption_key: Optional['EncryptionKeyReference'] = None,
+ minimum_provisioned_size: Optional[int] = None,
+ obsolescence_at: Optional[datetime] = None,
+ operating_system: Optional['OperatingSystem'] = None,
+ source_volume: Optional['VolumeReference'] = None,
) -> None:
"""
- Initialize a ImageRemote object.
+ Initialize a Image object.
- :param AccountReference account: (optional) If present, this property
- indicates that the referenced resource is remote to this
- account, and identifies the owning account.
- :param RegionReference region: (optional) If present, this property
- indicates that the referenced resource is remote to this
- region, and identifies the native region.
+ :param ImageCatalogOffering catalog_offering:
+ :param datetime created_at: The date and time that the image was created.
+ :param str crn: The CRN for this image.
+ :param str encryption: The type of encryption used on the image.
+ :param ImageFile file: Details for the stored image file.
+ :param str href: The URL for this image.
+ :param str id: The unique identifier for this image.
+ :param str name: The name for this image. The name is unique across all
+ images in the region.
+ :param ResourceGroupReference resource_group: The resource group for this
+ image.
+ :param str resource_type: The resource type.
+ :param str status: The status of this image
+ - available: image can be used (provisionable)
+ - deleting: image is being deleted, and can no longer be used to provision
+ new
+ resources
+ - deprecated: image is administratively slated to become `obsolete`
+ - failed: image is corrupt or did not pass validation
+ - obsolete: image administratively set to not be used for new resources
+ - pending: image is being imported and is not yet `available`
+ - unusable: image cannot be used (see `status_reasons[]` for possible
+ remediation)
+ The enumerated values for this property are expected to expand in the
+ future. When processing this property, check for and log unknown values.
+ Optionally halt processing and surface the error, or bypass the image on
+ which the unexpected property value was encountered.
+ :param List[ImageStatusReason] status_reasons: The reasons for the current
+ status (if any):
+ - `encrypted_data_key_invalid`: image cannot be decrypted with the
+ specified
+ `encryption_key`
+ - `encryption_key_deleted`: image unusable because its `encryption_key` was
+ deleted
+ - `encryption_key_disabled`: image unusable until its `encryption_key` is
+ re-enabled
+ - `image_data_corrupted`: image data is corrupt, or is not in the specified
+ format
+ - `image_provisioned_size_unsupported`: image requires a boot volume size
+ greater
+ than the maximum supported value
+ - `image_request_in_progress`: image operation is in progress (such as an
+ import from
+ Cloud Object Storage)
+ - `image_request_queued`: image request has been accepted but the requested
+ operation has not started
+ The enumerated reason code values for this property will expand in the
+ future. When processing this property, check for and log unknown values.
+ Optionally halt processing and surface the error, or bypass the resource on
+ which the unexpected reason code was encountered.
+ :param str visibility: The visibility of this image.
+ - `private`: Visible only to this account
+ - `public`: Visible to all accounts.
+ :param datetime deprecation_at: (optional) The deprecation date and time
+ (UTC) for this image.
+ If absent, no deprecation date and time has been set.
+ :param EncryptionKeyReference encryption_key: (optional) The key that will
+ be used to encrypt volumes created from this image (unless an
+ alternate `encryption_key` is specified at volume creation).
+ This property will be present for images with an `encryption` type of
+ `user_managed`.
+ :param int minimum_provisioned_size: (optional) The minimum size (in
+ gigabytes) of a volume onto which this image may be provisioned.
+ This property may be absent if the image has a `status` of `pending` or
+ `failed`.
+ :param datetime obsolescence_at: (optional) The obsolescence date and time
+ (UTC) for this image.
+ If absent, no obsolescence date and time has been set.
+ :param OperatingSystem operating_system: (optional) The operating system
+ included in this image.
+ :param VolumeReference source_volume: (optional) The volume used to create
+ this image (this may be
+ [deleted](https://cloud.ibm.com/apidocs/vpc#deleted-resources)).
+ If absent, this image was not created from a volume.
"""
- self.account = account
- self.region = region
+ self.catalog_offering = catalog_offering
+ self.created_at = created_at
+ self.crn = crn
+ self.deprecation_at = deprecation_at
+ self.encryption = encryption
+ self.encryption_key = encryption_key
+ self.file = file
+ self.href = href
+ self.id = id
+ self.minimum_provisioned_size = minimum_provisioned_size
+ self.name = name
+ self.obsolescence_at = obsolescence_at
+ self.operating_system = operating_system
+ self.resource_group = resource_group
+ self.resource_type = resource_type
+ self.source_volume = source_volume
+ self.status = status
+ self.status_reasons = status_reasons
+ self.visibility = visibility
@classmethod
- def from_dict(cls, _dict: Dict) -> 'ImageRemote':
- """Initialize a ImageRemote object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'Image':
+ """Initialize a Image object from a json dictionary."""
args = {}
- if 'account' in _dict:
- args['account'] = AccountReference.from_dict(_dict.get('account'))
- if 'region' in _dict:
- args['region'] = RegionReference.from_dict(_dict.get('region'))
+ if (catalog_offering := _dict.get('catalog_offering')) is not None:
+ args['catalog_offering'] = ImageCatalogOffering.from_dict(catalog_offering)
+ else:
+ raise ValueError('Required property \'catalog_offering\' not present in Image JSON')
+ if (created_at := _dict.get('created_at')) is not None:
+ args['created_at'] = string_to_datetime(created_at)
+ else:
+ raise ValueError('Required property \'created_at\' not present in Image JSON')
+ if (crn := _dict.get('crn')) is not None:
+ args['crn'] = crn
+ else:
+ raise ValueError('Required property \'crn\' not present in Image JSON')
+ if (deprecation_at := _dict.get('deprecation_at')) is not None:
+ args['deprecation_at'] = string_to_datetime(deprecation_at)
+ if (encryption := _dict.get('encryption')) is not None:
+ args['encryption'] = encryption
+ else:
+ raise ValueError('Required property \'encryption\' not present in Image JSON')
+ if (encryption_key := _dict.get('encryption_key')) is not None:
+ args['encryption_key'] = EncryptionKeyReference.from_dict(encryption_key)
+ if (file := _dict.get('file')) is not None:
+ args['file'] = ImageFile.from_dict(file)
+ else:
+ raise ValueError('Required property \'file\' not present in Image JSON')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
+ else:
+ raise ValueError('Required property \'href\' not present in Image JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
+ else:
+ raise ValueError('Required property \'id\' not present in Image JSON')
+ if (minimum_provisioned_size := _dict.get('minimum_provisioned_size')) is not None:
+ args['minimum_provisioned_size'] = minimum_provisioned_size
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ else:
+ raise ValueError('Required property \'name\' not present in Image JSON')
+ if (obsolescence_at := _dict.get('obsolescence_at')) is not None:
+ args['obsolescence_at'] = string_to_datetime(obsolescence_at)
+ if (operating_system := _dict.get('operating_system')) is not None:
+ args['operating_system'] = OperatingSystem.from_dict(operating_system)
+ if (resource_group := _dict.get('resource_group')) is not None:
+ args['resource_group'] = ResourceGroupReference.from_dict(resource_group)
+ else:
+ raise ValueError('Required property \'resource_group\' not present in Image JSON')
+ if (resource_type := _dict.get('resource_type')) is not None:
+ args['resource_type'] = resource_type
+ else:
+ raise ValueError('Required property \'resource_type\' not present in Image JSON')
+ if (source_volume := _dict.get('source_volume')) is not None:
+ args['source_volume'] = VolumeReference.from_dict(source_volume)
+ if (status := _dict.get('status')) is not None:
+ args['status'] = status
+ else:
+ raise ValueError('Required property \'status\' not present in Image JSON')
+ if (status_reasons := _dict.get('status_reasons')) is not None:
+ args['status_reasons'] = [ImageStatusReason.from_dict(v) for v in status_reasons]
+ else:
+ raise ValueError('Required property \'status_reasons\' not present in Image JSON')
+ if (visibility := _dict.get('visibility')) is not None:
+ args['visibility'] = visibility
+ else:
+ raise ValueError('Required property \'visibility\' not present in Image JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a ImageRemote object from a json dictionary."""
+ """Initialize a Image object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'account') and self.account is not None:
- if isinstance(self.account, dict):
- _dict['account'] = self.account
+ if hasattr(self, 'catalog_offering') and self.catalog_offering is not None:
+ if isinstance(self.catalog_offering, dict):
+ _dict['catalog_offering'] = self.catalog_offering
else:
- _dict['account'] = self.account.to_dict()
- if hasattr(self, 'region') and self.region is not None:
- if isinstance(self.region, dict):
- _dict['region'] = self.region
+ _dict['catalog_offering'] = self.catalog_offering.to_dict()
+ if hasattr(self, 'created_at') and self.created_at is not None:
+ _dict['created_at'] = datetime_to_string(self.created_at)
+ if hasattr(self, 'crn') and self.crn is not None:
+ _dict['crn'] = self.crn
+ if hasattr(self, 'deprecation_at') and self.deprecation_at is not None:
+ _dict['deprecation_at'] = datetime_to_string(self.deprecation_at)
+ if hasattr(self, 'encryption') and self.encryption is not None:
+ _dict['encryption'] = self.encryption
+ if hasattr(self, 'encryption_key') and self.encryption_key is not None:
+ if isinstance(self.encryption_key, dict):
+ _dict['encryption_key'] = self.encryption_key
else:
- _dict['region'] = self.region.to_dict()
+ _dict['encryption_key'] = self.encryption_key.to_dict()
+ if hasattr(self, 'file') and self.file is not None:
+ if isinstance(self.file, dict):
+ _dict['file'] = self.file
+ else:
+ _dict['file'] = self.file.to_dict()
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
+ if hasattr(self, 'id') and self.id is not None:
+ _dict['id'] = self.id
+ if hasattr(self, 'minimum_provisioned_size') and self.minimum_provisioned_size is not None:
+ _dict['minimum_provisioned_size'] = self.minimum_provisioned_size
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ if hasattr(self, 'obsolescence_at') and self.obsolescence_at is not None:
+ _dict['obsolescence_at'] = datetime_to_string(self.obsolescence_at)
+ if hasattr(self, 'operating_system') and self.operating_system is not None:
+ if isinstance(self.operating_system, dict):
+ _dict['operating_system'] = self.operating_system
+ else:
+ _dict['operating_system'] = self.operating_system.to_dict()
+ if hasattr(self, 'resource_group') and self.resource_group is not None:
+ if isinstance(self.resource_group, dict):
+ _dict['resource_group'] = self.resource_group
+ else:
+ _dict['resource_group'] = self.resource_group.to_dict()
+ if hasattr(self, 'resource_type') and self.resource_type is not None:
+ _dict['resource_type'] = self.resource_type
+ if hasattr(self, 'source_volume') and self.source_volume is not None:
+ if isinstance(self.source_volume, dict):
+ _dict['source_volume'] = self.source_volume
+ else:
+ _dict['source_volume'] = self.source_volume.to_dict()
+ if hasattr(self, 'status') and self.status is not None:
+ _dict['status'] = self.status
+ if hasattr(self, 'status_reasons') and self.status_reasons is not None:
+ status_reasons_list = []
+ for v in self.status_reasons:
+ if isinstance(v, dict):
+ status_reasons_list.append(v)
+ else:
+ status_reasons_list.append(v.to_dict())
+ _dict['status_reasons'] = status_reasons_list
+ if hasattr(self, 'visibility') and self.visibility is not None:
+ _dict['visibility'] = self.visibility
return _dict
def _to_dict(self):
@@ -41511,79 +43800,140 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this ImageRemote object."""
+ """Return a `str` version of this Image object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'ImageRemote') -> 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: 'ImageRemote') -> bool:
+ def __ne__(self, other: 'Image') -> 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 image.
+ """
-class ImageStatusReason:
+ NONE = 'none'
+ USER_MANAGED = 'user_managed'
+
+
+ class ResourceTypeEnum(str, Enum):
+ """
+ The resource type.
+ """
+
+ IMAGE = 'image'
+
+
+ class StatusEnum(str, Enum):
+ """
+ The status of this image
+ - available: image can be used (provisionable)
+ - deleting: image is being deleted, and can no longer be used to provision new
+ resources
+ - deprecated: image is administratively slated to become `obsolete`
+ - failed: image is corrupt or did not pass validation
+ - obsolete: image administratively set to not be used for new resources
+ - pending: image is being imported and is not yet `available`
+ - unusable: image cannot be used (see `status_reasons[]` for possible remediation)
+ The enumerated values for this property are expected to expand in the future. When
+ processing this property, check for and log unknown values. Optionally halt
+ processing and surface the error, or bypass the image on which the unexpected
+ property value was encountered.
+ """
+
+ AVAILABLE = 'available'
+ DELETING = 'deleting'
+ DEPRECATED = 'deprecated'
+ FAILED = 'failed'
+ OBSOLETE = 'obsolete'
+ PENDING = 'pending'
+ UNUSABLE = 'unusable'
+
+
+ class VisibilityEnum(str, Enum):
+ """
+ The visibility of this image.
+ - `private`: Visible only to this account
+ - `public`: Visible to all accounts.
+ """
+
+ PRIVATE = 'private'
+ PUBLIC = 'public'
+
+
+
+class ImageCatalogOffering:
"""
- ImageStatusReason.
+ ImageCatalogOffering.
- :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.
+ :param bool managed: Indicates whether this image is managed as part of a
+ [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user)
+ offering. If an image is managed, accounts in the same
+ [enterprise](https://cloud.ibm.com/docs/account?topic=account-what-is-enterprise)
+ with access to that catalog can specify the image's catalog offering version CRN
+ to provision virtual server instances using the image.
+ :param CatalogOfferingVersionReference version: (optional) The
+ [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user)
+ offering version associated with this image.
+ If absent, this image is not associated with a cloud catalog offering.
"""
def __init__(
self,
- code: str,
- message: str,
+ managed: bool,
*,
- more_info: str = None,
+ version: Optional['CatalogOfferingVersionReference'] = None,
) -> None:
"""
- Initialize a ImageStatusReason object.
+ Initialize a ImageCatalogOffering 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 bool managed: Indicates whether this image is managed as part of a
+ [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user)
+ offering. If an image is managed, accounts in the same
+ [enterprise](https://cloud.ibm.com/docs/account?topic=account-what-is-enterprise)
+ with access to that catalog can specify the image's catalog offering
+ version CRN to provision virtual server instances using the image.
+ :param CatalogOfferingVersionReference version: (optional) The
+ [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user)
+ offering version associated with this image.
+ If absent, this image is not associated with a cloud catalog offering.
"""
- self.code = code
- self.message = message
- self.more_info = more_info
+ self.managed = managed
+ self.version = version
@classmethod
- def from_dict(cls, _dict: Dict) -> 'ImageStatusReason':
- """Initialize a ImageStatusReason object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'ImageCatalogOffering':
+ """Initialize a ImageCatalogOffering 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')
+ if (managed := _dict.get('managed')) is not None:
+ args['managed'] = managed
else:
- raise ValueError('Required property \'message\' not present in ImageStatusReason JSON')
- if 'more_info' in _dict:
- args['more_info'] = _dict.get('more_info')
+ raise ValueError('Required property \'managed\' not present in ImageCatalogOffering JSON')
+ if (version := _dict.get('version')) is not None:
+ args['version'] = CatalogOfferingVersionReference.from_dict(version)
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a ImageStatusReason object from a json dictionary."""
+ """Initialize a ImageCatalogOffering object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, '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, 'managed') and self.managed is not None:
+ _dict['managed'] = self.managed
+ if hasattr(self, 'version') and self.version is not None:
+ if isinstance(self.version, dict):
+ _dict['version'] = self.version
+ else:
+ _dict['version'] = self.version.to_dict()
return _dict
def _to_dict(self):
@@ -41591,539 +43941,115 @@ 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 ImageCatalogOffering object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'ImageStatusReason') -> bool:
+ def __eq__(self, other: 'ImageCatalogOffering') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'ImageStatusReason') -> bool:
+ def __ne__(self, other: 'ImageCatalogOffering') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class CodeEnum(str, Enum):
- """
- A snake case string succinctly identifying the status reason.
- """
- ENCRYPTED_DATA_KEY_INVALID = 'encrypted_data_key_invalid'
- ENCRYPTION_KEY_DELETED = 'encryption_key_deleted'
- ENCRYPTION_KEY_DISABLED = 'encryption_key_disabled'
- IMAGE_DATA_CORRUPTED = 'image_data_corrupted'
- IMAGE_PROVISIONED_SIZE_UNSUPPORTED = 'image_provisioned_size_unsupported'
- IMAGE_REQUEST_IN_PROGRESS = 'image_request_in_progress'
- IMAGE_REQUEST_QUEUED = 'image_request_queued'
+class ImageCollection:
+ """
+ ImageCollection.
+ :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 ImageCollectionNext next: (optional) A link to the next page of
+ resources. This property is present for all pages
+ except the last page.
+ :param int total_count: The total number of resources across all pages.
+ """
+ def __init__(
+ self,
+ first: 'ImageCollectionFirst',
+ images: List['Image'],
+ limit: int,
+ total_count: int,
+ *,
+ next: Optional['ImageCollectionNext'] = None,
+ ) -> None:
+ """
+ Initialize a ImageCollection object.
-class Instance:
- """
- Instance.
-
- :attr InstanceAvailabilityPolicy availability_policy: The availability policy
- for this virtual server instance.
- :attr int bandwidth: The total bandwidth (in megabits per second) shared across
- the instance network interfaces and storage volumes of virtual server instance.
- :attr VolumeAttachmentReferenceInstanceContext boot_volume_attachment: Boot
- volume attachment.
- :attr InstanceCatalogOffering catalog_offering: (optional) If present, this
- virtual server instance was provisioned from a
- [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user).
- :attr datetime created_at: The date and time that the virtual server instance
- was created.
- :attr str crn: The CRN for this virtual server instance.
- :attr DedicatedHostReference dedicated_host: (optional) If present, the
- dedicated host this virtual server instance has been placed on.
- :attr List[InstanceDisk] disks: The instance disks for this virtual server
- instance.
- :attr InstanceGPU gpu: (optional) The virtual server instance GPU configuration.
- :attr str href: The URL for this virtual server instance.
- :attr str id: The unique identifier for this virtual server instance.
- :attr ImageReference image: (optional) The image the virtual server instance was
- provisioned from.
- :attr List[InstanceLifecycleReason] lifecycle_reasons: The reasons for the
- current `lifecycle_state` (if any).
- The enumerated reason code values for this property will expand in the future.
- When processing this property, check for and log unknown values. Optionally halt
- processing and surface the error, or bypass the resource on which the unexpected
- reason code was encountered.
- :attr str lifecycle_state: The lifecycle state of the virtual server instance.
- :attr int memory: The amount of memory, truncated to whole gibibytes.
- :attr InstanceMetadataService metadata_service: The metadata service
- configuration.
- :attr str name: The name for this virtual server instance. The name is unique
- across all virtual server instances in the region.
- :attr List[NetworkInterfaceInstanceContextReference] network_interfaces: The
- network interfaces for this instance, including the primary network interface.
- :attr int numa_count: (optional) The number of NUMA nodes this virtual server
- instance is provisioned on.
- This property will be absent if the instance's `status` is not `running`.
- :attr InstancePlacementTarget placement_target: (optional) The placement
- restrictions for the virtual server instance.
- :attr NetworkInterfaceInstanceContextReference primary_network_interface: The
- primary network interface for this virtual server instance.
- :attr InstanceProfileReference profile: The
- [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) for this virtual
- server instance.
- :attr ResourceGroupReference resource_group: The resource group for this
- instance.
- :attr str resource_type: The resource type.
- :attr bool startable: Indicates whether the state of the virtual server instance
- permits a start request.
- :attr str status: The status of the virtual server instance.
- The enumerated values for this property will expand in the future. When
- processing this property, check for and log unknown values. Optionally halt
- processing and surface the error, or bypass the instance on which the unexpected
- property value was encountered.
- :attr List[InstanceStatusReason] status_reasons: The reasons for the current
- status (if any).
- The enumerated reason code values for this property will expand in the future.
- 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,
- availability_policy: 'InstanceAvailabilityPolicy',
- bandwidth: int,
- boot_volume_attachment: 'VolumeAttachmentReferenceInstanceContext',
- created_at: datetime,
- crn: str,
- disks: List['InstanceDisk'],
- href: str,
- id: str,
- lifecycle_reasons: List['InstanceLifecycleReason'],
- lifecycle_state: str,
- memory: int,
- metadata_service: 'InstanceMetadataService',
- name: str,
- network_interfaces: List['NetworkInterfaceInstanceContextReference'],
- primary_network_interface: 'NetworkInterfaceInstanceContextReference',
- profile: 'InstanceProfileReference',
- resource_group: 'ResourceGroupReference',
- resource_type: str,
- startable: bool,
- status: str,
- status_reasons: List['InstanceStatusReason'],
- total_network_bandwidth: int,
- total_volume_bandwidth: int,
- vcpu: 'InstanceVCPU',
- volume_attachments: List['VolumeAttachmentReferenceInstanceContext'],
- vpc: 'VPCReference',
- zone: 'ZoneReference',
- *,
- catalog_offering: 'InstanceCatalogOffering' = None,
- dedicated_host: 'DedicatedHostReference' = None,
- gpu: 'InstanceGPU' = None,
- image: 'ImageReference' = None,
- numa_count: int = None,
- placement_target: 'InstancePlacementTarget' = None,
- ) -> None:
- """
- Initialize a Instance object.
-
- :param InstanceAvailabilityPolicy availability_policy: The availability
- policy for this virtual server instance.
- :param int bandwidth: The total bandwidth (in megabits per second) shared
- across the instance network interfaces and storage volumes of virtual
- server instance.
- :param VolumeAttachmentReferenceInstanceContext boot_volume_attachment:
- Boot volume attachment.
- :param datetime created_at: The date and time that the virtual server
- instance was created.
- :param str crn: The CRN for this virtual server instance.
- :param List[InstanceDisk] disks: The instance disks for this virtual server
- instance.
- :param str href: The URL for this virtual server instance.
- :param str id: The unique identifier for this virtual server instance.
- :param List[InstanceLifecycleReason] lifecycle_reasons: The reasons for the
- current `lifecycle_state` (if any).
- The enumerated reason code values for this property will expand in the
- future. When processing this property, check for and log unknown values.
- Optionally halt processing and surface the error, or bypass the resource on
- which the unexpected reason code was encountered.
- :param str lifecycle_state: The lifecycle state of the virtual server
- instance.
- :param int memory: The amount of memory, truncated to whole gibibytes.
- :param InstanceMetadataService metadata_service: The metadata service
- configuration.
- :param str name: The name for this virtual server instance. The name is
- unique across all virtual server instances in the region.
- :param List[NetworkInterfaceInstanceContextReference] network_interfaces:
- The network interfaces for this instance, including the primary network
- interface.
- :param NetworkInterfaceInstanceContextReference primary_network_interface:
- The primary network interface for this virtual server instance.
- :param InstanceProfileReference profile: The
- [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) for this
- virtual
- server instance.
- :param ResourceGroupReference resource_group: The resource group for this
- instance.
- :param str resource_type: The resource type.
- :param bool startable: Indicates whether the state of the virtual server
- instance permits a start request.
- :param str status: The status of the virtual server instance.
- The enumerated values for this property will expand in the future. When
- processing this property, check for and log unknown values. Optionally halt
- processing and surface the error, or bypass the instance on which the
- unexpected property value was encountered.
- :param List[InstanceStatusReason] status_reasons: The reasons for the
- current status (if any).
- The enumerated reason code values for this property will expand in the
- future. When processing this property, check for and log unknown values.
- Optionally halt processing and surface the error, or bypass the resource on
- which the unexpected reason code was encountered.
- :param int total_network_bandwidth: The amount of bandwidth (in megabits
- per second) allocated exclusively to instance network interfaces.
- :param int total_volume_bandwidth: The amount of bandwidth (in megabits per
- second) allocated exclusively to instance storage volumes. An increase in
- this value will result in a corresponding decrease to
- `total_network_bandwidth`.
- :param InstanceVCPU vcpu: The virtual server instance VCPU configuration.
- :param List[VolumeAttachmentReferenceInstanceContext] volume_attachments:
- The volume attachments for this virtual server instance, including the boot
- volume attachment.
- :param VPCReference vpc: The VPC this virtual server instance resides in.
- :param ZoneReference zone: The zone this virtual server instance resides
- in.
- :param InstanceCatalogOffering catalog_offering: (optional) If present,
- this virtual server instance was provisioned from a
- [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user).
- :param DedicatedHostReference dedicated_host: (optional) If present, the
- dedicated host this virtual server instance has been placed on.
- :param InstanceGPU gpu: (optional) The virtual server instance GPU
- configuration.
- :param ImageReference image: (optional) The image the virtual server
- instance was provisioned from.
- :param int numa_count: (optional) The number of NUMA nodes this virtual
- server instance is provisioned on.
- This property will be absent if the instance's `status` is not `running`.
- :param InstancePlacementTarget placement_target: (optional) The placement
- restrictions for the virtual server instance.
- """
- self.availability_policy = availability_policy
- self.bandwidth = bandwidth
- self.boot_volume_attachment = boot_volume_attachment
- self.catalog_offering = catalog_offering
- self.created_at = created_at
- self.crn = crn
- self.dedicated_host = dedicated_host
- self.disks = disks
- self.gpu = gpu
- self.href = href
- self.id = id
- self.image = image
- self.lifecycle_reasons = lifecycle_reasons
- self.lifecycle_state = lifecycle_state
- self.memory = memory
- self.metadata_service = metadata_service
- self.name = name
- self.network_interfaces = network_interfaces
- self.numa_count = numa_count
- self.placement_target = placement_target
- self.primary_network_interface = primary_network_interface
- self.profile = profile
- self.resource_group = resource_group
- self.resource_type = resource_type
- self.startable = startable
- self.status = status
- self.status_reasons = status_reasons
- self.total_network_bandwidth = total_network_bandwidth
- self.total_volume_bandwidth = total_volume_bandwidth
- self.vcpu = vcpu
- self.volume_attachments = volume_attachments
- self.vpc = vpc
- self.zone = zone
+ :param ImageCollectionFirst first: A link to the first page of resources.
+ :param List[Image] images: Collection of images.
+ :param int limit: The maximum number of resources that can be returned by
+ the request.
+ :param int total_count: The total number of resources across all pages.
+ :param ImageCollectionNext next: (optional) A link to the next page of
+ resources. This property is present for all pages
+ except the last page.
+ """
+ self.first = first
+ self.images = images
+ self.limit = limit
+ self.next = next
+ self.total_count = total_count
@classmethod
- def from_dict(cls, _dict: Dict) -> 'Instance':
- """Initialize a Instance object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'ImageCollection':
+ """Initialize a ImageCollection object from a json dictionary."""
args = {}
- if 'availability_policy' in _dict:
- args['availability_policy'] = InstanceAvailabilityPolicy.from_dict(_dict.get('availability_policy'))
- else:
- raise ValueError('Required property \'availability_policy\' not present in Instance JSON')
- if 'bandwidth' in _dict:
- args['bandwidth'] = _dict.get('bandwidth')
- else:
- raise ValueError('Required property \'bandwidth\' not present in Instance JSON')
- if 'boot_volume_attachment' in _dict:
- args['boot_volume_attachment'] = VolumeAttachmentReferenceInstanceContext.from_dict(_dict.get('boot_volume_attachment'))
+ if (first := _dict.get('first')) is not None:
+ args['first'] = ImageCollectionFirst.from_dict(first)
else:
- raise ValueError('Required property \'boot_volume_attachment\' not present in Instance JSON')
- if 'catalog_offering' in _dict:
- args['catalog_offering'] = InstanceCatalogOffering.from_dict(_dict.get('catalog_offering'))
- if 'created_at' in _dict:
- args['created_at'] = string_to_datetime(_dict.get('created_at'))
- else:
- raise ValueError('Required property \'created_at\' not present in Instance JSON')
- if 'crn' in _dict:
- args['crn'] = _dict.get('crn')
- else:
- raise ValueError('Required property \'crn\' not present in Instance JSON')
- if 'dedicated_host' in _dict:
- args['dedicated_host'] = DedicatedHostReference.from_dict(_dict.get('dedicated_host'))
- if 'disks' in _dict:
- args['disks'] = [InstanceDisk.from_dict(v) for v in _dict.get('disks')]
- else:
- raise ValueError('Required property \'disks\' not present in Instance JSON')
- if 'gpu' in _dict:
- args['gpu'] = InstanceGPU.from_dict(_dict.get('gpu'))
- if 'href' in _dict:
- args['href'] = _dict.get('href')
- else:
- raise ValueError('Required property \'href\' not present in Instance JSON')
- if 'id' in _dict:
- args['id'] = _dict.get('id')
- else:
- raise ValueError('Required property \'id\' not present in Instance JSON')
- if 'image' in _dict:
- args['image'] = ImageReference.from_dict(_dict.get('image'))
- if 'lifecycle_reasons' in _dict:
- args['lifecycle_reasons'] = [InstanceLifecycleReason.from_dict(v) for v in _dict.get('lifecycle_reasons')]
- else:
- raise ValueError('Required property \'lifecycle_reasons\' not present in Instance JSON')
- if 'lifecycle_state' in _dict:
- args['lifecycle_state'] = _dict.get('lifecycle_state')
- else:
- raise ValueError('Required property \'lifecycle_state\' not present in Instance JSON')
- if 'memory' in _dict:
- args['memory'] = _dict.get('memory')
- else:
- raise ValueError('Required property \'memory\' not present in Instance JSON')
- if 'metadata_service' in _dict:
- args['metadata_service'] = InstanceMetadataService.from_dict(_dict.get('metadata_service'))
- else:
- raise ValueError('Required property \'metadata_service\' not present in Instance JSON')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
- else:
- raise ValueError('Required property \'name\' not present in Instance JSON')
- if 'network_interfaces' in _dict:
- args['network_interfaces'] = [NetworkInterfaceInstanceContextReference.from_dict(v) for v in _dict.get('network_interfaces')]
- else:
- raise ValueError('Required property \'network_interfaces\' not present in Instance JSON')
- if 'numa_count' in _dict:
- args['numa_count'] = _dict.get('numa_count')
- if 'placement_target' in _dict:
- args['placement_target'] = _dict.get('placement_target')
- if 'primary_network_interface' in _dict:
- args['primary_network_interface'] = NetworkInterfaceInstanceContextReference.from_dict(_dict.get('primary_network_interface'))
- else:
- raise ValueError('Required property \'primary_network_interface\' not present in Instance JSON')
- if 'profile' in _dict:
- args['profile'] = InstanceProfileReference.from_dict(_dict.get('profile'))
- else:
- raise ValueError('Required property \'profile\' not present in Instance JSON')
- if 'resource_group' in _dict:
- args['resource_group'] = ResourceGroupReference.from_dict(_dict.get('resource_group'))
- else:
- raise ValueError('Required property \'resource_group\' not present in Instance JSON')
- if 'resource_type' in _dict:
- args['resource_type'] = _dict.get('resource_type')
- else:
- raise ValueError('Required property \'resource_type\' not present in Instance JSON')
- if 'startable' in _dict:
- args['startable'] = _dict.get('startable')
- else:
- raise ValueError('Required property \'startable\' not present in Instance JSON')
- if 'status' in _dict:
- args['status'] = _dict.get('status')
- else:
- raise ValueError('Required property \'status\' not present in Instance JSON')
- if 'status_reasons' in _dict:
- args['status_reasons'] = [InstanceStatusReason.from_dict(v) for v in _dict.get('status_reasons')]
- else:
- raise ValueError('Required property \'status_reasons\' not present in Instance JSON')
- if 'total_network_bandwidth' in _dict:
- args['total_network_bandwidth'] = _dict.get('total_network_bandwidth')
- else:
- raise ValueError('Required property \'total_network_bandwidth\' not present in Instance JSON')
- if 'total_volume_bandwidth' in _dict:
- args['total_volume_bandwidth'] = _dict.get('total_volume_bandwidth')
- else:
- raise ValueError('Required property \'total_volume_bandwidth\' not present in Instance JSON')
- if 'vcpu' in _dict:
- args['vcpu'] = InstanceVCPU.from_dict(_dict.get('vcpu'))
- else:
- raise ValueError('Required property \'vcpu\' not present in Instance JSON')
- if 'volume_attachments' in _dict:
- args['volume_attachments'] = [VolumeAttachmentReferenceInstanceContext.from_dict(v) for v in _dict.get('volume_attachments')]
+ raise ValueError('Required property \'first\' not present in ImageCollection JSON')
+ if (images := _dict.get('images')) is not None:
+ args['images'] = [Image.from_dict(v) for v in images]
else:
- raise ValueError('Required property \'volume_attachments\' not present in Instance JSON')
- if 'vpc' in _dict:
- args['vpc'] = VPCReference.from_dict(_dict.get('vpc'))
+ raise ValueError('Required property \'images\' not present in ImageCollection JSON')
+ if (limit := _dict.get('limit')) is not None:
+ args['limit'] = limit
else:
- raise ValueError('Required property \'vpc\' not present in Instance JSON')
- if 'zone' in _dict:
- args['zone'] = ZoneReference.from_dict(_dict.get('zone'))
+ raise ValueError('Required property \'limit\' not present in ImageCollection JSON')
+ if (next := _dict.get('next')) is not None:
+ args['next'] = ImageCollectionNext.from_dict(next)
+ if (total_count := _dict.get('total_count')) is not None:
+ args['total_count'] = total_count
else:
- raise ValueError('Required property \'zone\' not present in Instance JSON')
+ raise ValueError('Required property \'total_count\' not present in ImageCollection JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a Instance 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, 'availability_policy') and self.availability_policy is not None:
- if isinstance(self.availability_policy, dict):
- _dict['availability_policy'] = self.availability_policy
- else:
- _dict['availability_policy'] = self.availability_policy.to_dict()
- if hasattr(self, 'bandwidth') and self.bandwidth is not None:
- _dict['bandwidth'] = self.bandwidth
- if hasattr(self, 'boot_volume_attachment') and self.boot_volume_attachment is not None:
- if isinstance(self.boot_volume_attachment, dict):
- _dict['boot_volume_attachment'] = self.boot_volume_attachment
- else:
- _dict['boot_volume_attachment'] = self.boot_volume_attachment.to_dict()
- if hasattr(self, 'catalog_offering') and self.catalog_offering is not None:
- if isinstance(self.catalog_offering, dict):
- _dict['catalog_offering'] = self.catalog_offering
- else:
- _dict['catalog_offering'] = self.catalog_offering.to_dict()
- if hasattr(self, 'created_at') and self.created_at is not None:
- _dict['created_at'] = datetime_to_string(self.created_at)
- if hasattr(self, 'crn') and self.crn is not None:
- _dict['crn'] = self.crn
- if hasattr(self, 'dedicated_host') and self.dedicated_host is not None:
- if isinstance(self.dedicated_host, dict):
- _dict['dedicated_host'] = self.dedicated_host
- else:
- _dict['dedicated_host'] = self.dedicated_host.to_dict()
- if hasattr(self, 'disks') and self.disks is not None:
- disks_list = []
- for v in self.disks:
- if isinstance(v, dict):
- disks_list.append(v)
- else:
- disks_list.append(v.to_dict())
- _dict['disks'] = disks_list
- if hasattr(self, 'gpu') and self.gpu is not None:
- if isinstance(self.gpu, dict):
- _dict['gpu'] = self.gpu
- else:
- _dict['gpu'] = self.gpu.to_dict()
- if hasattr(self, 'href') and self.href is not None:
- _dict['href'] = self.href
- if hasattr(self, 'id') and self.id is not None:
- _dict['id'] = self.id
- if hasattr(self, 'image') and self.image is not None:
- if isinstance(self.image, dict):
- _dict['image'] = self.image
- else:
- _dict['image'] = self.image.to_dict()
- if hasattr(self, 'lifecycle_reasons') and self.lifecycle_reasons is not None:
- lifecycle_reasons_list = []
- for v in self.lifecycle_reasons:
- if isinstance(v, dict):
- lifecycle_reasons_list.append(v)
- else:
- lifecycle_reasons_list.append(v.to_dict())
- _dict['lifecycle_reasons'] = lifecycle_reasons_list
- if hasattr(self, 'lifecycle_state') and self.lifecycle_state is not None:
- _dict['lifecycle_state'] = self.lifecycle_state
- if hasattr(self, 'memory') and self.memory is not None:
- _dict['memory'] = self.memory
- if hasattr(self, 'metadata_service') and self.metadata_service is not None:
- if isinstance(self.metadata_service, dict):
- _dict['metadata_service'] = self.metadata_service
- else:
- _dict['metadata_service'] = self.metadata_service.to_dict()
- if hasattr(self, 'name') and self.name is not None:
- _dict['name'] = self.name
- if hasattr(self, 'network_interfaces') and self.network_interfaces is not None:
- network_interfaces_list = []
- for v in self.network_interfaces:
- if isinstance(v, dict):
- network_interfaces_list.append(v)
- else:
- network_interfaces_list.append(v.to_dict())
- _dict['network_interfaces'] = network_interfaces_list
- if hasattr(self, 'numa_count') and self.numa_count is not None:
- _dict['numa_count'] = self.numa_count
- if hasattr(self, 'placement_target') and self.placement_target is not None:
- if isinstance(self.placement_target, dict):
- _dict['placement_target'] = self.placement_target
- else:
- _dict['placement_target'] = self.placement_target.to_dict()
- if hasattr(self, 'primary_network_interface') and self.primary_network_interface is not None:
- if isinstance(self.primary_network_interface, dict):
- _dict['primary_network_interface'] = self.primary_network_interface
- else:
- _dict['primary_network_interface'] = self.primary_network_interface.to_dict()
- if hasattr(self, 'profile') and self.profile is not None:
- if isinstance(self.profile, dict):
- _dict['profile'] = self.profile
- else:
- _dict['profile'] = self.profile.to_dict()
- if hasattr(self, 'resource_group') and self.resource_group is not None:
- if isinstance(self.resource_group, dict):
- _dict['resource_group'] = self.resource_group
- else:
- _dict['resource_group'] = self.resource_group.to_dict()
- if hasattr(self, 'resource_type') and self.resource_type is not None:
- _dict['resource_type'] = self.resource_type
- if hasattr(self, 'startable') and self.startable is not None:
- _dict['startable'] = self.startable
- if hasattr(self, 'status') and self.status is not None:
- _dict['status'] = self.status
- if hasattr(self, 'status_reasons') and self.status_reasons is not None:
- status_reasons_list = []
- for v in self.status_reasons:
- if isinstance(v, dict):
- status_reasons_list.append(v)
- else:
- status_reasons_list.append(v.to_dict())
- _dict['status_reasons'] = status_reasons_list
- if hasattr(self, 'total_network_bandwidth') and self.total_network_bandwidth is not None:
- _dict['total_network_bandwidth'] = self.total_network_bandwidth
- if hasattr(self, 'total_volume_bandwidth') and self.total_volume_bandwidth is not None:
- _dict['total_volume_bandwidth'] = self.total_volume_bandwidth
- if hasattr(self, 'vcpu') and self.vcpu is not None:
- if isinstance(self.vcpu, dict):
- _dict['vcpu'] = self.vcpu
+ if hasattr(self, 'first') and self.first is not None:
+ if isinstance(self.first, dict):
+ _dict['first'] = self.first
else:
- _dict['vcpu'] = self.vcpu.to_dict()
- if hasattr(self, 'volume_attachments') and self.volume_attachments is not None:
- volume_attachments_list = []
- for v in self.volume_attachments:
+ _dict['first'] = self.first.to_dict()
+ if hasattr(self, 'images') and self.images is not None:
+ images_list = []
+ for v in self.images:
if isinstance(v, dict):
- volume_attachments_list.append(v)
+ images_list.append(v)
else:
- volume_attachments_list.append(v.to_dict())
- _dict['volume_attachments'] = volume_attachments_list
- if hasattr(self, 'vpc') and self.vpc is not None:
- if isinstance(self.vpc, dict):
- _dict['vpc'] = self.vpc
- else:
- _dict['vpc'] = self.vpc.to_dict()
- if hasattr(self, 'zone') and self.zone is not None:
- if isinstance(self.zone, dict):
- _dict['zone'] = self.zone
+ images_list.append(v.to_dict())
+ _dict['images'] = images_list
+ if hasattr(self, 'limit') and self.limit is not None:
+ _dict['limit'] = self.limit
+ if hasattr(self, 'next') and self.next is not None:
+ if isinstance(self.next, dict):
+ _dict['next'] = self.next
else:
- _dict['zone'] = self.zone.to_dict()
+ _dict['next'] = self.next.to_dict()
+ if hasattr(self, 'total_count') and self.total_count is not None:
+ _dict['total_count'] = self.total_count
return _dict
def _to_dict(self):
@@ -42131,170 +44057,58 @@ 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 ImageCollection object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'Instance') -> 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: 'Instance') -> bool:
+ def __ne__(self, other: 'ImageCollection') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class LifecycleStateEnum(str, Enum):
- """
- The lifecycle state of the virtual server instance.
- """
-
- DELETING = 'deleting'
- FAILED = 'failed'
- PENDING = 'pending'
- STABLE = 'stable'
- SUSPENDED = 'suspended'
- UPDATING = 'updating'
- WAITING = 'waiting'
-
-
- class ResourceTypeEnum(str, Enum):
- """
- The resource type.
- """
-
- INSTANCE = 'instance'
-
-
- class StatusEnum(str, Enum):
- """
- The status of the virtual server instance.
- The enumerated values for this property will expand in the future. When processing
- this property, check for and log unknown values. Optionally halt processing and
- surface the error, or bypass the instance on which the unexpected property value
- was encountered.
- """
- DELETING = 'deleting'
- FAILED = 'failed'
- PENDING = 'pending'
- RESTARTING = 'restarting'
- RUNNING = 'running'
- STARTING = 'starting'
- STOPPED = 'stopped'
- STOPPING = 'stopping'
-
-
-
-class InstanceAction:
+class ImageCollectionFirst:
"""
- InstanceAction.
+ A link to the first page of resources.
- :attr datetime completed_at: (optional) Deprecated: The date and time that the
- action was completed.
- :attr datetime created_at: The date and time that the action was created.
- :attr bool force: (optional) If set to true, the action will be forced
- immediately, and all queued actions deleted. Ignored for the start action.
- :attr str href: Deprecated: The URL for this instance action.
- :attr str id: Deprecated: The identifier for this instance action.
- :attr datetime started_at: (optional) Deprecated: The date and time that the
- action was started.
- :attr str status: Deprecated: The current status of this action.
- :attr str type: The type of action.
+ :param str href: The URL for a page of 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:
"""
- Initialize a InstanceAction object.
+ Initialize a ImageCollectionFirst object.
- :param datetime created_at: The date and time that the action was created.
- :param str href: Deprecated: The URL for this instance action.
- :param str id: Deprecated: The identifier for this instance action.
- :param str status: Deprecated: The current status of this action.
- :param str type: The type of action.
- :param datetime completed_at: (optional) Deprecated: The date and time that
- the action was completed.
- :param bool force: (optional) If set to true, the action will be forced
- immediately, and all queued actions deleted. Ignored for the start action.
- :param datetime started_at: (optional) Deprecated: The date and time that
- the action was started.
+ :param str href: The URL for a page of 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
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstanceAction':
- """Initialize a InstanceAction object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'ImageCollectionFirst':
+ """Initialize a ImageCollectionFirst 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'))
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
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')
- else:
- raise ValueError('Required property \'type\' not present in InstanceAction JSON')
+ raise ValueError('Required property \'href\' not present in ImageCollectionFirst JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceAction object from a json dictionary."""
+ """Initialize a ImageCollectionFirst object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'completed_at') and self.completed_at is not None:
- _dict['completed_at'] = datetime_to_string(self.completed_at)
- if hasattr(self, 'created_at') and self.created_at is not None:
- _dict['created_at'] = datetime_to_string(self.created_at)
- if hasattr(self, 'force') and self.force is not None:
- _dict['force'] = self.force
if hasattr(self, 'href') and self.href is not None:
_dict['href'] = self.href
- if hasattr(self, 'id') and self.id is not None:
- _dict['id'] = self.id
- if hasattr(self, 'started_at') and self.started_at is not None:
- _dict['started_at'] = datetime_to_string(self.started_at)
- if hasattr(self, 'status') and self.status is not None:
- _dict['status'] = self.status
- if hasattr(self, 'type') and self.type is not None:
- _dict['type'] = self.type
return _dict
def _to_dict(self):
@@ -42302,95 +44116,59 @@ 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 ImageCollectionFirst object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceAction') -> 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: 'InstanceAction') -> bool:
+ def __ne__(self, other: 'ImageCollectionFirst') -> 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 TypeEnum(str, Enum):
- """
- The type of action.
- """
-
- REBOOT = 'reboot'
- START = 'start'
- STOP = 'stop'
-
-
-class InstanceAvailabilityPolicy:
+class ImageCollectionNext:
"""
- InstanceAvailabilityPolicy.
+ A link to the next page of resources. This property is present for all pages except
+ the last page.
- :attr str host_failure: The action to perform if the compute host experiences a
- failure.
- - `restart`: Automatically restart the virtual server instance after host
- failure
- - `stop`: Leave the virtual server instance stopped after host failure
- The enumerated values for this property are expected to expand in the future.
- When processing this property, check for and log unknown values. Optionally halt
- processing and surface the error, or bypass the instance on which the unexpected
- property value was encountered.
+ :param str href: The URL for a page of resources.
"""
def __init__(
self,
- host_failure: str,
+ href: str,
) -> None:
"""
- Initialize a InstanceAvailabilityPolicy object.
+ Initialize a ImageCollectionNext object.
- :param str host_failure: The action to perform if the compute host
- experiences a failure.
- - `restart`: Automatically restart the virtual server instance after host
- failure
- - `stop`: Leave the virtual server instance stopped after host failure
- The enumerated values for this property are expected to expand in the
- future. When processing this property, check for and log unknown values.
- Optionally halt processing and surface the error, or bypass the instance on
- which the unexpected property value was encountered.
+ :param str href: The URL for a page of resources.
"""
- self.host_failure = host_failure
+ self.href = href
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstanceAvailabilityPolicy':
- """Initialize a InstanceAvailabilityPolicy object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'ImageCollectionNext':
+ """Initialize a ImageCollectionNext object from a json dictionary."""
args = {}
- if 'host_failure' in _dict:
- args['host_failure'] = _dict.get('host_failure')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'host_failure\' not present in InstanceAvailabilityPolicy JSON')
+ raise ValueError('Required property \'href\' not present in ImageCollectionNext JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceAvailabilityPolicy object from a json dictionary."""
+ """Initialize a ImageCollectionNext object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'host_failure') and self.host_failure is not None:
- _dict['host_failure'] = self.host_failure
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
return _dict
def _to_dict(self):
@@ -42398,80 +44176,263 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this InstanceAvailabilityPolicy object."""
+ """Return a `str` version of this ImageCollectionNext object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceAvailabilityPolicy') -> 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: 'InstanceAvailabilityPolicy') -> bool:
+ def __ne__(self, other: 'ImageCollectionNext') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class HostFailureEnum(str, Enum):
- """
- The action to perform if the compute host experiences a failure.
- - `restart`: Automatically restart the virtual server instance after host failure
- - `stop`: Leave the virtual server instance stopped after host failure
- The enumerated values for this property are expected to expand in the future. When
- processing this property, check for and log unknown values. Optionally halt
- processing and surface the error, or bypass the instance on which the unexpected
- property value was encountered.
- """
-
- RESTART = 'restart'
- STOP = 'stop'
-
-
-class InstanceAvailabilityPolicyPatch:
+class ImageExportJob:
"""
- InstanceAvailabilityPolicyPatch.
+ ImageExportJob.
- :attr str host_failure: (optional) The action to perform if the compute host
- experiences a failure.
- - `restart`: Automatically restart the virtual server instance after host
- failure
- - `stop`: Leave the virtual server instance stopped after host failure.
+ :param datetime completed_at: (optional) The date and time that the image export
+ job was completed.
+ If absent, the export job has not yet completed.
+ :param datetime created_at: The date and time that the image export job was
+ created.
+ :param bytes encrypted_data_key: (optional) A base64-encoded, encrypted
+ representation of the key that was used to encrypt the data for the exported
+ image. This key can be unwrapped with the image's `encryption_key` root key
+ using either Key Protect or Hyper Protect Crypto Services.
+ If absent, the export job is for an unencrypted image.
+ :param str format: The format of the exported image.
+ :param str href: The URL for this image export job.
+ :param str id: The unique identifier for this image export job.
+ :param str name: The name for this image export job. The name must not be used
+ by another export job for the image. Changing the name will not affect the
+ exported image name,
+ `storage_object.name`, or `storage_href` values.
+ :param str resource_type: The type of resource referenced.
+ :param datetime started_at: (optional) The date and time that the image export
+ job started running.
+ If absent, the export job has not yet started.
+ :param str status: The status of this image export job:
+ - `deleting`: Export job is being deleted
+ - `failed`: Export job could not be completed successfully
+ - `queued`: Export job is queued
+ - `running`: Export job is in progress
+ - `succeeded`: Export job was completed successfully
+ The exported image object is automatically deleted for `failed` jobs.
+ :param List[ImageExportJobStatusReason] status_reasons: The reasons for the
+ current status (if any).
+ The enumerated reason code values for this property will expand in the future.
+ When processing this property, check for and log unknown values. Optionally halt
+ processing and surface the error, or bypass the resource on which the unexpected
+ reason code was encountered.
+ :param CloudObjectStorageBucketReference storage_bucket: The Cloud Object
+ Storage bucket of the exported image object.
+ :param str storage_href: The Cloud Object Storage location of the exported image
+ object. The object at this location will not exist until the job completes
+ successfully. The exported image object is not managed by the IBM VPC service,
+ and may be removed or replaced with a different object by any user or service
+ with IAM authorization to the storage bucket.
+ :param CloudObjectStorageObjectReference storage_object: The Cloud Object
+ Storage object for the exported image. This object will not exist until
+ the job completes successfully. The exported image object is not managed by the
+ IBM VPC
+ service, and may be removed or replaced with a different object by any user or
+ service
+ with IAM authorization to the storage bucket.
"""
def __init__(
self,
+ created_at: datetime,
+ format: str,
+ href: str,
+ id: str,
+ name: str,
+ resource_type: str,
+ status: str,
+ status_reasons: List['ImageExportJobStatusReason'],
+ storage_bucket: 'CloudObjectStorageBucketReference',
+ storage_href: str,
+ storage_object: 'CloudObjectStorageObjectReference',
*,
- host_failure: str = None,
+ completed_at: Optional[datetime] = None,
+ encrypted_data_key: Optional[bytes] = None,
+ started_at: Optional[datetime] = None,
) -> None:
"""
- Initialize a InstanceAvailabilityPolicyPatch object.
+ Initialize a ImageExportJob object.
- :param str host_failure: (optional) The action to perform if the compute
- host experiences a failure.
- - `restart`: Automatically restart the virtual server instance after host
- failure
- - `stop`: Leave the virtual server instance stopped after host failure.
+ :param datetime created_at: The date and time that the image export job was
+ created.
+ :param str format: The format of the exported image.
+ :param str href: The URL for this image export job.
+ :param str id: The unique identifier for this image export job.
+ :param str name: The name for this image export job. The name must not be
+ used by another export job for the image. Changing the name will not affect
+ the exported image name,
+ `storage_object.name`, or `storage_href` values.
+ :param str resource_type: The type of resource referenced.
+ :param str status: The status of this image export job:
+ - `deleting`: Export job is being deleted
+ - `failed`: Export job could not be completed successfully
+ - `queued`: Export job is queued
+ - `running`: Export job is in progress
+ - `succeeded`: Export job was completed successfully
+ The exported image object is automatically deleted for `failed` jobs.
+ :param List[ImageExportJobStatusReason] status_reasons: The reasons for the
+ current status (if any).
+ The enumerated reason code values for this property will expand in the
+ future. When processing this property, check for and log unknown values.
+ Optionally halt processing and surface the error, or bypass the resource on
+ which the unexpected reason code was encountered.
+ :param CloudObjectStorageBucketReference storage_bucket: The Cloud Object
+ Storage bucket of the exported image object.
+ :param str storage_href: The Cloud Object Storage location of the exported
+ image object. The object at this location will not exist until the job
+ completes successfully. The exported image object is not managed by the IBM
+ VPC service, and may be removed or replaced with a different object by any
+ user or service with IAM authorization to the storage bucket.
+ :param CloudObjectStorageObjectReference storage_object: The Cloud Object
+ Storage object for the exported image. This object will not exist until
+ the job completes successfully. The exported image object is not managed by
+ the IBM VPC
+ service, and may be removed or replaced with a different object by any user
+ or service
+ with IAM authorization to the storage bucket.
+ :param datetime completed_at: (optional) The date and time that the image
+ export job was completed.
+ If absent, the export job has not yet completed.
+ :param bytes encrypted_data_key: (optional) A base64-encoded, encrypted
+ representation of the key that was used to encrypt the data for the
+ exported image. This key can be unwrapped with the image's `encryption_key`
+ root key using either Key Protect or Hyper Protect Crypto Services.
+ If absent, the export job is for an unencrypted image.
+ :param datetime started_at: (optional) The date and time that the image
+ export job started running.
+ If absent, the export job has not yet started.
"""
- self.host_failure = host_failure
+ self.completed_at = completed_at
+ self.created_at = created_at
+ self.encrypted_data_key = encrypted_data_key
+ self.format = format
+ self.href = href
+ self.id = id
+ self.name = name
+ self.resource_type = resource_type
+ self.started_at = started_at
+ self.status = status
+ self.status_reasons = status_reasons
+ self.storage_bucket = storage_bucket
+ self.storage_href = storage_href
+ self.storage_object = storage_object
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstanceAvailabilityPolicyPatch':
- """Initialize a InstanceAvailabilityPolicyPatch object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'ImageExportJob':
+ """Initialize a ImageExportJob object from a json dictionary."""
args = {}
- if 'host_failure' in _dict:
- args['host_failure'] = _dict.get('host_failure')
+ if (completed_at := _dict.get('completed_at')) is not None:
+ args['completed_at'] = string_to_datetime(completed_at)
+ if (created_at := _dict.get('created_at')) is not None:
+ args['created_at'] = string_to_datetime(created_at)
+ else:
+ raise ValueError('Required property \'created_at\' not present in ImageExportJob JSON')
+ if (encrypted_data_key := _dict.get('encrypted_data_key')) is not None:
+ args['encrypted_data_key'] = base64.b64decode(encrypted_data_key)
+ if (format := _dict.get('format')) is not None:
+ args['format'] = format
+ else:
+ raise ValueError('Required property \'format\' not present in ImageExportJob JSON')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
+ else:
+ raise ValueError('Required property \'href\' not present in ImageExportJob JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
+ else:
+ raise ValueError('Required property \'id\' not present in ImageExportJob JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ else:
+ raise ValueError('Required property \'name\' not present in ImageExportJob JSON')
+ if (resource_type := _dict.get('resource_type')) is not None:
+ args['resource_type'] = resource_type
+ else:
+ raise ValueError('Required property \'resource_type\' not present in ImageExportJob JSON')
+ if (started_at := _dict.get('started_at')) is not None:
+ args['started_at'] = string_to_datetime(started_at)
+ if (status := _dict.get('status')) is not None:
+ args['status'] = status
+ else:
+ raise ValueError('Required property \'status\' not present in ImageExportJob JSON')
+ if (status_reasons := _dict.get('status_reasons')) is not None:
+ args['status_reasons'] = [ImageExportJobStatusReason.from_dict(v) for v in status_reasons]
+ else:
+ raise ValueError('Required property \'status_reasons\' not present in ImageExportJob JSON')
+ if (storage_bucket := _dict.get('storage_bucket')) is not None:
+ args['storage_bucket'] = CloudObjectStorageBucketReference.from_dict(storage_bucket)
+ else:
+ raise ValueError('Required property \'storage_bucket\' not present in ImageExportJob JSON')
+ if (storage_href := _dict.get('storage_href')) is not None:
+ args['storage_href'] = storage_href
+ else:
+ raise ValueError('Required property \'storage_href\' not present in ImageExportJob JSON')
+ if (storage_object := _dict.get('storage_object')) is not None:
+ args['storage_object'] = CloudObjectStorageObjectReference.from_dict(storage_object)
+ else:
+ raise ValueError('Required property \'storage_object\' not present in ImageExportJob JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceAvailabilityPolicyPatch object from a json dictionary."""
+ """Initialize a ImageExportJob object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'host_failure') and self.host_failure is not None:
- _dict['host_failure'] = self.host_failure
+ if hasattr(self, 'completed_at') and self.completed_at is not None:
+ _dict['completed_at'] = datetime_to_string(self.completed_at)
+ if hasattr(self, 'created_at') and self.created_at is not None:
+ _dict['created_at'] = datetime_to_string(self.created_at)
+ if hasattr(self, 'encrypted_data_key') and self.encrypted_data_key is not None:
+ _dict['encrypted_data_key'] = str(base64.b64encode(self.encrypted_data_key), 'utf-8')
+ if hasattr(self, 'format') and self.format is not None:
+ _dict['format'] = self.format
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
+ if hasattr(self, 'id') and self.id is not None:
+ _dict['id'] = self.id
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ if hasattr(self, 'resource_type') and self.resource_type is not None:
+ _dict['resource_type'] = self.resource_type
+ if hasattr(self, 'started_at') and self.started_at is not None:
+ _dict['started_at'] = datetime_to_string(self.started_at)
+ if hasattr(self, 'status') and self.status is not None:
+ _dict['status'] = self.status
+ if hasattr(self, 'status_reasons') and self.status_reasons is not None:
+ status_reasons_list = []
+ for v in self.status_reasons:
+ if isinstance(v, dict):
+ status_reasons_list.append(v)
+ else:
+ status_reasons_list.append(v.to_dict())
+ _dict['status_reasons'] = status_reasons_list
+ if hasattr(self, 'storage_bucket') and self.storage_bucket is not None:
+ if isinstance(self.storage_bucket, dict):
+ _dict['storage_bucket'] = self.storage_bucket
+ else:
+ _dict['storage_bucket'] = self.storage_bucket.to_dict()
+ if hasattr(self, 'storage_href') and self.storage_href is not None:
+ _dict['storage_href'] = self.storage_href
+ if hasattr(self, 'storage_object') and self.storage_object is not None:
+ if isinstance(self.storage_object, dict):
+ _dict['storage_object'] = self.storage_object
+ else:
+ _dict['storage_object'] = self.storage_object.to_dict()
return _dict
def _to_dict(self):
@@ -42479,76 +44440,98 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this InstanceAvailabilityPolicyPatch object."""
+ """Return a `str` version of this ImageExportJob object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceAvailabilityPolicyPatch') -> bool:
+ def __eq__(self, other: 'ImageExportJob') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'InstanceAvailabilityPolicyPatch') -> bool:
+ def __ne__(self, other: 'ImageExportJob') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class HostFailureEnum(str, Enum):
+ class FormatEnum(str, Enum):
"""
- The action to perform if the compute host experiences a failure.
- - `restart`: Automatically restart the virtual server instance after host failure
- - `stop`: Leave the virtual server instance stopped after host failure.
+ The format of the exported image.
"""
- RESTART = 'restart'
- STOP = 'stop'
+ QCOW2 = 'qcow2'
+ VHD = 'vhd'
+ class ResourceTypeEnum(str, Enum):
+ """
+ The type of resource referenced.
+ """
-class InstanceAvailabilityPolicyPrototype:
+ IMAGE_EXPORT_JOB = 'image_export_job'
+
+
+ class StatusEnum(str, Enum):
+ """
+ The status of this image export job:
+ - `deleting`: Export job is being deleted
+ - `failed`: Export job could not be completed successfully
+ - `queued`: Export job is queued
+ - `running`: Export job is in progress
+ - `succeeded`: Export job was completed successfully
+ The exported image object is automatically deleted for `failed` jobs.
+ """
+
+ DELETING = 'deleting'
+ FAILED = 'failed'
+ QUEUED = 'queued'
+ RUNNING = 'running'
+ SUCCEEDED = 'succeeded'
+
+
+
+class ImageExportJobPatch:
"""
- InstanceAvailabilityPolicyPrototype.
+ ImageExportJobPatch.
- :attr str host_failure: (optional) The action to perform if the compute host
- experiences a failure.
- - `restart`: Automatically restart the virtual server instance after host
- failure
- - `stop`: Leave the virtual server instance stopped after host failure.
+ :param str name: (optional) The name for this image export job. The name must
+ not be used by another export job for the image. Changing the name will not
+ affect the exported image name,
+ `storage_object.name`, or `storage_href` values.
"""
def __init__(
self,
*,
- host_failure: str = None,
+ name: Optional[str] = None,
) -> None:
"""
- Initialize a InstanceAvailabilityPolicyPrototype object.
+ Initialize a ImageExportJobPatch object.
- :param str host_failure: (optional) The action to perform if the compute
- host experiences a failure.
- - `restart`: Automatically restart the virtual server instance after host
- failure
- - `stop`: Leave the virtual server instance stopped after host failure.
+ :param str name: (optional) The name for this image export job. The name
+ must not be used by another export job for the image. Changing the name
+ will not affect the exported image name,
+ `storage_object.name`, or `storage_href` values.
"""
- self.host_failure = host_failure
+ self.name = name
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstanceAvailabilityPolicyPrototype':
- """Initialize a InstanceAvailabilityPolicyPrototype object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'ImageExportJobPatch':
+ """Initialize a ImageExportJobPatch object from a json dictionary."""
args = {}
- if 'host_failure' in _dict:
- args['host_failure'] = _dict.get('host_failure')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceAvailabilityPolicyPrototype object from a json dictionary."""
+ """Initialize a ImageExportJobPatch object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'host_failure') and self.host_failure is not None:
- _dict['host_failure'] = self.host_failure
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
return _dict
def _to_dict(self):
@@ -42556,88 +44539,79 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this InstanceAvailabilityPolicyPrototype object."""
+ """Return a `str` version of this ImageExportJobPatch object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceAvailabilityPolicyPrototype') -> bool:
+ def __eq__(self, other: 'ImageExportJobPatch') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'InstanceAvailabilityPolicyPrototype') -> bool:
+ def __ne__(self, other: 'ImageExportJobPatch') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class HostFailureEnum(str, Enum):
- """
- The action to perform if the compute host experiences a failure.
- - `restart`: Automatically restart the virtual server instance after host failure
- - `stop`: Leave the virtual server instance stopped after host failure.
- """
-
- RESTART = 'restart'
- STOP = 'stop'
-
-
-class InstanceCatalogOffering:
+class ImageExportJobStatusReason:
"""
- InstanceCatalogOffering.
+ ImageExportJobStatusReason.
- :attr CatalogOfferingVersionReference version: The catalog offering version this
- virtual server instance was provisioned from.
- The catalog offering version is not managed by the IBM VPC service, and may no
- longer
- exist, or may refer to a different image CRN than the `image.crn` for this
- virtual
- server instance. However, all images associated with a catalog offering version
- will
- have the same checksum, and therefore will have the same data.
+ :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.
"""
def __init__(
self,
- version: 'CatalogOfferingVersionReference',
+ code: str,
+ message: str,
+ *,
+ more_info: Optional[str] = None,
) -> None:
"""
- Initialize a InstanceCatalogOffering object.
+ Initialize a ImageExportJobStatusReason object.
- :param CatalogOfferingVersionReference version: The catalog offering
- version this virtual server instance was provisioned from.
- The catalog offering version is not managed by the IBM VPC service, and may
- no longer
- exist, or may refer to a different image CRN than the `image.crn` for this
- virtual
- server instance. However, all images associated with a catalog offering
- version will
- have the same checksum, and therefore will have the same data.
+ :param str 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.version = version
+ self.code = code
+ self.message = message
+ self.more_info = more_info
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstanceCatalogOffering':
- """Initialize a InstanceCatalogOffering object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'ImageExportJobStatusReason':
+ """Initialize a ImageExportJobStatusReason object from a json dictionary."""
args = {}
- if 'version' in _dict:
- args['version'] = CatalogOfferingVersionReference.from_dict(_dict.get('version'))
+ if (code := _dict.get('code')) is not None:
+ args['code'] = code
else:
- raise ValueError('Required property \'version\' not present in InstanceCatalogOffering JSON')
+ raise ValueError('Required property \'code\' not present in ImageExportJobStatusReason JSON')
+ if (message := _dict.get('message')) is not None:
+ args['message'] = message
+ else:
+ raise ValueError('Required property \'message\' not present in ImageExportJobStatusReason JSON')
+ if (more_info := _dict.get('more_info')) is not None:
+ args['more_info'] = more_info
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceCatalogOffering object from a json dictionary."""
+ """Initialize a ImageExportJobStatusReason object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'version') and self.version is not None:
- if isinstance(self.version, dict):
- _dict['version'] = self.version
- else:
- _dict['version'] = self.version.to_dict()
+ if hasattr(self, '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):
@@ -42645,140 +44619,73 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this InstanceCatalogOffering object."""
+ """Return a `str` version of this ImageExportJobStatusReason object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceCatalogOffering') -> bool:
+ def __eq__(self, other: 'ImageExportJobStatusReason') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'InstanceCatalogOffering') -> bool:
+ def __ne__(self, other: 'ImageExportJobStatusReason') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-
-class InstanceCatalogOfferingPrototype:
- """
- The [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user)
- offering or offering version to use when provisioning this virtual server instance.
- If an offering is specified, the latest version of that offering will be used.
- The specified offering or offering version may be in a different account in the same
- [enterprise](https://cloud.ibm.com/docs/account?topic=account-what-is-enterprise),
- subject to IAM policies.
-
- """
-
- def __init__(
- self,
- ) -> None:
+ class CodeEnum(str, Enum):
"""
- Initialize a InstanceCatalogOfferingPrototype object.
-
+ A snake case string succinctly identifying the status reason.
"""
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['InstanceCatalogOfferingPrototypeCatalogOfferingByOffering', 'InstanceCatalogOfferingPrototypeCatalogOfferingByVersion'])
- )
- raise Exception(msg)
+ CANNOT_ACCESS_STORAGE_BUCKET = 'cannot_access_storage_bucket'
+ INTERNAL_ERROR = 'internal_error'
-class InstanceCollection:
+
+
+class ImageExportJobUnpaginatedCollection:
"""
- InstanceCollection.
+ ImageExportJobUnpaginatedCollection.
- :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.
+ :param List[ImageExportJob] export_jobs: Collection of image export jobs.
"""
def __init__(
self,
- first: 'InstanceCollectionFirst',
- instances: List['Instance'],
- limit: int,
- total_count: int,
- *,
- next: 'InstanceCollectionNext' = None,
+ export_jobs: List['ImageExportJob'],
) -> None:
"""
- Initialize a InstanceCollection object.
+ Initialize a ImageExportJobUnpaginatedCollection 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 List[ImageExportJob] export_jobs: Collection of image export jobs.
"""
- self.first = first
- self.instances = instances
- self.limit = limit
- self.next = next
- self.total_count = total_count
+ self.export_jobs = export_jobs
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstanceCollection':
- """Initialize a InstanceCollection object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'ImageExportJobUnpaginatedCollection':
+ """Initialize a ImageExportJobUnpaginatedCollection object from a json dictionary."""
args = {}
- if 'first' in _dict:
- args['first'] = InstanceCollectionFirst.from_dict(_dict.get('first'))
- else:
- raise ValueError('Required property \'first\' not present in InstanceCollection JSON')
- if 'instances' in _dict:
- args['instances'] = [Instance.from_dict(v) for v in _dict.get('instances')]
- else:
- raise ValueError('Required property \'instances\' not present in InstanceCollection JSON')
- if 'limit' in _dict:
- args['limit'] = _dict.get('limit')
- else:
- raise ValueError('Required property \'limit\' not present in InstanceCollection JSON')
- if 'next' in _dict:
- args['next'] = InstanceCollectionNext.from_dict(_dict.get('next'))
- if 'total_count' in _dict:
- args['total_count'] = _dict.get('total_count')
+ if (export_jobs := _dict.get('export_jobs')) is not None:
+ args['export_jobs'] = [ImageExportJob.from_dict(v) for v in export_jobs]
else:
- raise ValueError('Required property \'total_count\' not present in InstanceCollection JSON')
+ raise ValueError('Required property \'export_jobs\' not present in ImageExportJobUnpaginatedCollection JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceCollection object from a json dictionary."""
+ """Initialize a ImageExportJobUnpaginatedCollection object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'first') and self.first is not None:
- if isinstance(self.first, dict):
- _dict['first'] = self.first
- else:
- _dict['first'] = self.first.to_dict()
- if hasattr(self, 'instances') and self.instances is not None:
- instances_list = []
- for v in self.instances:
+ if hasattr(self, 'export_jobs') and self.export_jobs is not None:
+ export_jobs_list = []
+ for v in self.export_jobs:
if isinstance(v, dict):
- instances_list.append(v)
+ export_jobs_list.append(v)
else:
- instances_list.append(v.to_dict())
- _dict['instances'] = instances_list
- if hasattr(self, 'limit') and self.limit is not None:
- _dict['limit'] = self.limit
- if hasattr(self, 'next') and self.next is not None:
- if isinstance(self.next, dict):
- _dict['next'] = self.next
- else:
- _dict['next'] = self.next.to_dict()
- if hasattr(self, 'total_count') and self.total_count is not None:
- _dict['total_count'] = self.total_count
+ export_jobs_list.append(v.to_dict())
+ _dict['export_jobs'] = export_jobs_list
return _dict
def _to_dict(self):
@@ -42786,58 +44693,83 @@ 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 ImageExportJobUnpaginatedCollection object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceCollection') -> bool:
+ def __eq__(self, other: 'ImageExportJobUnpaginatedCollection') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'InstanceCollection') -> bool:
+ def __ne__(self, other: 'ImageExportJobUnpaginatedCollection') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class InstanceCollectionFirst:
+class ImageFile:
"""
- A link to the first page of resources.
+ ImageFile.
- :attr str href: The URL for a page of resources.
+ :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`.
"""
def __init__(
self,
- href: str,
+ *,
+ checksums: Optional['ImageFileChecksums'] = None,
+ size: Optional[int] = None,
) -> None:
"""
- Initialize a InstanceCollectionFirst object.
+ Initialize a ImageFile object.
- :param str href: The URL for a page of resources.
+ :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.href = href
+ self.checksums = checksums
+ self.size = size
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstanceCollectionFirst':
- """Initialize a InstanceCollectionFirst object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'ImageFile':
+ """Initialize a ImageFile object from a json dictionary."""
args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
- else:
- raise ValueError('Required property \'href\' not present in InstanceCollectionFirst JSON')
+ if (checksums := _dict.get('checksums')) is not None:
+ args['checksums'] = ImageFileChecksums.from_dict(checksums)
+ if (size := _dict.get('size')) is not None:
+ args['size'] = size
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceCollectionFirst 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, 'href') and self.href is not None:
- _dict['href'] = self.href
+ if hasattr(self, 'checksums') and self.checksums is not None:
+ if isinstance(self.checksums, dict):
+ _dict['checksums'] = self.checksums
+ else:
+ _dict['checksums'] = self.checksums.to_dict()
+ if hasattr(self, 'size') and self.size is not None:
+ _dict['size'] = self.size
return _dict
def _to_dict(self):
@@ -42845,59 +44777,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 ImageFile object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceCollectionFirst') -> 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: 'InstanceCollectionFirst') -> bool:
+ def __ne__(self, other: 'ImageFile') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class InstanceCollectionNext:
+class ImageFileChecksums:
"""
- A link to the next page of resources. This property is present for all pages except
- the last page.
+ ImageFileChecksums.
- :attr str href: The URL for a page of resources.
+ :param str sha256: (optional) The SHA256 fingerprint of the image file.
"""
def __init__(
self,
- href: str,
+ *,
+ sha256: Optional[str] = None,
) -> None:
"""
- Initialize a InstanceCollectionNext object.
+ Initialize a ImageFileChecksums object.
- :param str href: The URL for a page of resources.
+ :param str sha256: (optional) The SHA256 fingerprint of the image file.
"""
- self.href = href
+ self.sha256 = sha256
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstanceCollectionNext':
- """Initialize a InstanceCollectionNext object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'ImageFileChecksums':
+ """Initialize a ImageFileChecksums object from a json dictionary."""
args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
- else:
- raise ValueError('Required property \'href\' not present in InstanceCollectionNext JSON')
+ if (sha256 := _dict.get('sha256')) is not None:
+ args['sha256'] = sha256
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceCollectionNext object from a json dictionary."""
+ """Initialize a ImageFileChecksums object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'href') and self.href is not None:
- _dict['href'] = self.href
+ if hasattr(self, 'sha256') and self.sha256 is not None:
+ _dict['sha256'] = self.sha256
return _dict
def _to_dict(self):
@@ -42905,116 +44835,61 @@ 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 ImageFileChecksums object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceCollectionNext') -> 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: 'InstanceCollectionNext') -> bool:
+ def __ne__(self, other: 'ImageFileChecksums') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class InstanceConsoleAccessToken:
+class ImageFilePrototype:
"""
- The instance console access token information.
+ ImageFilePrototype.
- :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.
+ :param str href: The Cloud Object Storage location of the image file.
+ The image file format is specified by the file's extension, which must be either
+ `qcow2` or `vhd`.
"""
def __init__(
self,
- access_token: str,
- console_type: str,
- created_at: datetime,
- expires_at: datetime,
- force: bool,
href: str,
) -> None:
"""
- Initialize a InstanceConsoleAccessToken object.
+ Initialize a ImageFilePrototype object.
- :param str access_token: A URL safe single-use token used to access the
- console WebSocket.
- :param str console_type: The instance console type for which this token may
- be used.
- :param datetime created_at: The date and time that the access token was
- created.
- :param datetime expires_at: The date and time that the access token will
- expire.
- :param bool force: Indicates whether to disconnect an existing serial
- console session as the serial console cannot be shared. This has no effect
- on VNC consoles.
- :param str href: The URL to access this instance console.
+ :param str href: The Cloud Object Storage location of the image file.
+ The image file format is specified by the file's extension, which must be
+ either
+ `qcow2` or `vhd`.
"""
- self.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) -> 'InstanceConsoleAccessToken':
- """Initialize a InstanceConsoleAccessToken object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'ImageFilePrototype':
+ """Initialize a ImageFilePrototype 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')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
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')
- else:
- raise ValueError('Required property \'href\' not present in InstanceConsoleAccessToken JSON')
+ raise ValueError('Required property \'href\' not present in ImageFilePrototype JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceConsoleAccessToken object from a json dictionary."""
+ """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, '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
@@ -43024,88 +44899,151 @@ 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 ImageFilePrototype object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceConsoleAccessToken') -> 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: 'InstanceConsoleAccessToken') -> bool:
+ def __ne__(self, other: 'ImageFilePrototype') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class ConsoleTypeEnum(str, Enum):
- """
- The instance console type for which this token may be used.
- """
- SERIAL = 'serial'
- VNC = 'vnc'
+class ImageIdentity:
+ """
+ Identifies an image by a unique property.
+ """
+ def __init__(
+ self,
+ ) -> None:
+ """
+ Initialize a ImageIdentity object.
-class InstanceDefaultTrustedProfilePrototype:
+ """
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['ImageIdentityById', 'ImageIdentityByCRN', 'ImageIdentityByHref'])
+ )
+ raise Exception(msg)
+
+
+class ImagePatch:
"""
- InstanceDefaultTrustedProfilePrototype.
+ ImagePatch.
- :attr bool auto_link: (optional) If set to `true`, the system will create a link
- to the specified `target` trusted profile during instance creation. Regardless
- of whether a link is created by the system or manually using the IAM Identity
- service, it will be automatically deleted when the instance is deleted.
- :attr TrustedProfileIdentity target: The default IAM trusted profile to use for
- this virtual server instance.
+ :param datetime deprecation_at: (optional) The deprecation date and time to set
+ for this image.
+ This cannot be set if the image has a `status` of `failed` or `deleting`, or if
+ `catalog_offering.managed` is `true`.
+ The date and time must not be in the past, and must be earlier than
+ `obsolescence_at`
+ (if `obsolescence_at` is set). Additionally, if the image status is currently
+ `deprecated`, the value cannot be changed (but may be removed).
+ Specify `null` to remove an existing deprecation date and time. If the image
+ status is currently `deprecated`, it will become `available`.
+ If the deprecation date and time is reached while the image has a status of
+ `pending`, the image's status will transition to `deprecated` upon its
+ successful creation (or
+ `obsolete` if the obsolescence date and time was also reached).
+ :param str name: (optional) The name for this image. The name must not be used
+ by another image in the region. Names starting with `ibm-` are reserved for
+ system-provided images, and are not allowed.
+ :param datetime obsolescence_at: (optional) The obsolescence date and time to
+ set for this image.
+ This cannot be set if the image has a `status` of `failed` or `deleting`, or if
+ `catalog_offering.managed` is `true`.
+ The date and time must not be in the past, and must be later than
+ `deprecation_at` (if
+ `deprecation_at` is set). Additionally, if the image status is currently
+ `obsolete`, the value cannot be changed (but may be removed).
+ Specify `null` to remove an existing obsolescence date and time. If the image
+ status is currently `obsolete`, it will become `deprecated` if `deprecation_at`
+ is in the past. Otherwise, it will become `available`.
+ If the obsolescence date and time is reached while the image has a status of
+ `pending`, the image's status will transition to `obsolete` upon its successful
+ creation.
"""
def __init__(
self,
- target: 'TrustedProfileIdentity',
*,
- auto_link: bool = None,
+ deprecation_at: Optional[datetime] = None,
+ name: Optional[str] = None,
+ obsolescence_at: Optional[datetime] = None,
) -> None:
"""
- Initialize a InstanceDefaultTrustedProfilePrototype object.
+ Initialize a ImagePatch object.
- :param TrustedProfileIdentity target: The default IAM trusted profile to
- use for this virtual server instance.
- :param bool auto_link: (optional) If set to `true`, the system will create
- a link to the specified `target` trusted profile during instance creation.
- Regardless of whether a link is created by the system or manually using the
- IAM Identity service, it will be automatically deleted when the instance is
- deleted.
+ :param datetime deprecation_at: (optional) The deprecation date and time to
+ set for this image.
+ This cannot be set if the image has a `status` of `failed` or `deleting`,
+ or if
+ `catalog_offering.managed` is `true`.
+ The date and time must not be in the past, and must be earlier than
+ `obsolescence_at`
+ (if `obsolescence_at` is set). Additionally, if the image status is
+ currently
+ `deprecated`, the value cannot be changed (but may be removed).
+ Specify `null` to remove an existing deprecation date and time. If the
+ image status is currently `deprecated`, it will become `available`.
+ If the deprecation date and time is reached while the image has a status of
+ `pending`, the image's status will transition to `deprecated` upon its
+ successful creation (or
+ `obsolete` if the obsolescence date and time was also reached).
+ :param str name: (optional) The name for this image. The name must not be
+ used by another image in the region. Names starting with `ibm-` are
+ reserved for system-provided images, and are not allowed.
+ :param datetime obsolescence_at: (optional) The obsolescence date and time
+ to set for this image.
+ This cannot be set if the image has a `status` of `failed` or `deleting`,
+ or if
+ `catalog_offering.managed` is `true`.
+ The date and time must not be in the past, and must be later than
+ `deprecation_at` (if
+ `deprecation_at` is set). Additionally, if the image status is currently
+ `obsolete`, the value cannot be changed (but may be removed).
+ Specify `null` to remove an existing obsolescence date and time. If the
+ image status is currently `obsolete`, it will become `deprecated` if
+ `deprecation_at` is in the past. Otherwise, it will become `available`.
+ If the obsolescence date and time is reached while the image has a status
+ of `pending`, the image's status will transition to `obsolete` upon its
+ successful creation.
"""
- self.auto_link = auto_link
- self.target = target
+ self.deprecation_at = deprecation_at
+ self.name = name
+ self.obsolescence_at = obsolescence_at
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstanceDefaultTrustedProfilePrototype':
- """Initialize a InstanceDefaultTrustedProfilePrototype object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'ImagePatch':
+ """Initialize a ImagePatch object from a json dictionary."""
args = {}
- if 'auto_link' in _dict:
- args['auto_link'] = _dict.get('auto_link')
- if 'target' in _dict:
- args['target'] = _dict.get('target')
- else:
- raise ValueError('Required property \'target\' not present in InstanceDefaultTrustedProfilePrototype JSON')
+ if (deprecation_at := _dict.get('deprecation_at')) is not None:
+ args['deprecation_at'] = string_to_datetime(deprecation_at)
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ if (obsolescence_at := _dict.get('obsolescence_at')) is not None:
+ args['obsolescence_at'] = string_to_datetime(obsolescence_at)
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceDefaultTrustedProfilePrototype 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, 'auto_link') and self.auto_link is not None:
- _dict['auto_link'] = self.auto_link
- if hasattr(self, 'target') and self.target is not None:
- if isinstance(self.target, dict):
- _dict['target'] = self.target
- else:
- _dict['target'] = self.target.to_dict()
+ if hasattr(self, 'deprecation_at') and self.deprecation_at is not None:
+ _dict['deprecation_at'] = datetime_to_string(self.deprecation_at)
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ if hasattr(self, 'obsolescence_at') and self.obsolescence_at is not None:
+ _dict['obsolescence_at'] = datetime_to_string(self.obsolescence_at)
return _dict
def _to_dict(self):
@@ -43113,128 +45051,210 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this InstanceDefaultTrustedProfilePrototype object."""
+ """Return a `str` version of this ImagePatch object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceDefaultTrustedProfilePrototype') -> 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: 'InstanceDefaultTrustedProfilePrototype') -> bool:
+ def __ne__(self, other: 'ImagePatch') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class InstanceDisk:
+class ImagePrototype:
"""
- InstanceDisk.
+ ImagePrototype.
- :attr datetime created_at: The date and time that the disk was created.
- :attr str href: The URL for this instance disk.
- :attr str id: The unique identifier for this instance disk.
- :attr str interface_type: The disk interface used for attaching the disk.
- The enumerated values for this property are expected to expand in the future.
- When processing this property, check for and log unknown values. Optionally halt
- processing and surface the error, or bypass the resource on which the unexpected
- property value was encountered.
- :attr str name: The name for this instance disk. The name is unique across all
- disks on the instance.
- :attr str resource_type: The resource type.
- :attr int size: The size of the disk in GB (gigabytes).
+ :param datetime deprecation_at: (optional) The deprecation date and time to set
+ for this image.
+ The date and time must not be in the past, and must be earlier than
+ `obsolescence_at`
+ (if `obsolescence_at` is set).
+ If unspecified, no deprecation date and time will be set.
+ If the deprecation date and time is reached while the image has a status of
+ `pending`, the image's status will transition to `deprecated` upon its
+ successful creation (or
+ `obsolete` if the obsolescence date and time was also reached).
+ :param str name: (optional) The name for this image. The name must not be used
+ by another image in the region. Names starting with `ibm-` are reserved for
+ system-provided images, and are not allowed. If unspecified, the name will be a
+ hyphenated list of randomly-selected words.
+ :param datetime obsolescence_at: (optional) The obsolescence date and time to
+ set for this image.
+ The date and time must not be in the past, and must be later than
+ `deprecation_at` (if
+ `deprecation_at` is set).
+ If unspecified, no obsolescence date and time will be set.
+ If the obsolescence date and time is reached while the image has a status of
+ `pending`, the image's status will transition to `obsolete` upon its successful
+ creation.
+ :param ResourceGroupIdentity resource_group: (optional) The resource group to
+ use. If unspecified, the account's [default resource
+ group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be
+ used.
"""
def __init__(
self,
- created_at: datetime,
+ *,
+ deprecation_at: Optional[datetime] = None,
+ name: Optional[str] = None,
+ obsolescence_at: Optional[datetime] = None,
+ resource_group: Optional['ResourceGroupIdentity'] = None,
+ ) -> None:
+ """
+ Initialize a ImagePrototype object.
+
+ :param datetime deprecation_at: (optional) The deprecation date and time to
+ set for this image.
+ The date and time must not be in the past, and must be earlier than
+ `obsolescence_at`
+ (if `obsolescence_at` is set).
+ If unspecified, no deprecation date and time will be set.
+ If the deprecation date and time is reached while the image has a status of
+ `pending`, the image's status will transition to `deprecated` upon its
+ successful creation (or
+ `obsolete` if the obsolescence date and time was also reached).
+ :param str name: (optional) The name for this image. The name must not be
+ used by another image in the region. Names starting with `ibm-` are
+ reserved for system-provided images, and are not allowed. If unspecified,
+ the name will be a hyphenated list of randomly-selected words.
+ :param datetime obsolescence_at: (optional) The obsolescence date and time
+ to set for this image.
+ The date and time must not be in the past, and must be later than
+ `deprecation_at` (if
+ `deprecation_at` is set).
+ If unspecified, no obsolescence date and time will be set.
+ If the obsolescence date and time is reached while the image has a status
+ of
+ `pending`, the image's status will transition to `obsolete` upon its
+ successful creation.
+ :param ResourceGroupIdentity resource_group: (optional) The resource group
+ to use. If unspecified, the account's [default resource
+ group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be
+ used.
+ """
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['ImagePrototypeImageByFile', 'ImagePrototypeImageBySourceVolume'])
+ )
+ raise Exception(msg)
+
+
+class ImageReference:
+ """
+ ImageReference.
+
+ :param str crn: The CRN 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 this image.
+ :param str id: The unique identifier for this image.
+ :param str name: The name for this image. The name is unique across all images
+ in the region.
+ :param ImageRemote remote: (optional) If present, this property indicates that
+ the resource associated with this reference
+ is remote and therefore may not be directly retrievable.
+ :param str resource_type: The resource type.
+ """
+
+ def __init__(
+ self,
+ crn: str,
href: str,
id: str,
- interface_type: str,
name: str,
resource_type: str,
- size: int,
+ *,
+ deleted: Optional['ImageReferenceDeleted'] = None,
+ remote: Optional['ImageRemote'] = None,
) -> None:
"""
- Initialize a InstanceDisk object.
+ Initialize a ImageReference object.
- :param datetime created_at: The date and time that the disk was created.
- :param str href: The URL for this instance disk.
- :param str id: The unique identifier for this instance disk.
- :param str interface_type: The disk interface used for attaching the disk.
- The enumerated values for this property are expected to expand in the
- future. When processing this property, check for and log unknown values.
- Optionally halt processing and surface the error, or bypass the resource on
- which the unexpected property value was encountered.
- :param str name: The name for this instance disk. The name is unique across
- all disks on the instance.
+ :param str crn: The CRN for this image.
+ :param str href: The URL for this image.
+ :param str id: The unique identifier for this image.
+ :param str name: The name for this image. The name is unique across all
+ images in the region.
:param str resource_type: The resource type.
- :param int size: The size of the disk in GB (gigabytes).
+ :param ImageReferenceDeleted deleted: (optional) If present, this property
+ indicates the referenced resource has been deleted, and provides
+ some supplementary information.
+ :param ImageRemote remote: (optional) If present, this property indicates
+ that the resource associated with this reference
+ is remote and therefore may not be directly retrievable.
"""
- self.created_at = created_at
+ self.crn = crn
+ self.deleted = deleted
self.href = href
self.id = id
- self.interface_type = interface_type
self.name = name
+ self.remote = remote
self.resource_type = resource_type
- self.size = size
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstanceDisk':
- """Initialize a InstanceDisk object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'ImageReference':
+ """Initialize a ImageReference object from a json dictionary."""
args = {}
- if 'created_at' in _dict:
- args['created_at'] = string_to_datetime(_dict.get('created_at'))
+ if (crn := _dict.get('crn')) is not None:
+ args['crn'] = crn
else:
- raise ValueError('Required property \'created_at\' not present in InstanceDisk JSON')
- if 'href' in _dict:
- args['href'] = _dict.get('href')
- else:
- raise ValueError('Required property \'href\' not present in InstanceDisk JSON')
- if 'id' in _dict:
- args['id'] = _dict.get('id')
- else:
- raise ValueError('Required property \'id\' not present in InstanceDisk JSON')
- if 'interface_type' in _dict:
- args['interface_type'] = _dict.get('interface_type')
+ raise ValueError('Required property \'crn\' not present in ImageReference JSON')
+ if (deleted := _dict.get('deleted')) is not None:
+ args['deleted'] = ImageReferenceDeleted.from_dict(deleted)
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'interface_type\' not present in InstanceDisk JSON')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
+ raise ValueError('Required property \'href\' not present in ImageReference JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
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 \'id\' not present in ImageReference JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
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 \'name\' not present in ImageReference JSON')
+ if (remote := _dict.get('remote')) is not None:
+ args['remote'] = ImageRemote.from_dict(remote)
+ if (resource_type := _dict.get('resource_type')) is not None:
+ args['resource_type'] = resource_type
else:
- raise ValueError('Required property \'size\' not present in InstanceDisk JSON')
+ raise ValueError('Required property \'resource_type\' not present in ImageReference JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceDisk 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, 'created_at') and self.created_at is not None:
- _dict['created_at'] = datetime_to_string(self.created_at)
+ if hasattr(self, 'crn') and self.crn is not None:
+ _dict['crn'] = self.crn
+ if hasattr(self, 'deleted') and self.deleted is not None:
+ if isinstance(self.deleted, dict):
+ _dict['deleted'] = self.deleted
+ else:
+ _dict['deleted'] = self.deleted.to_dict()
if hasattr(self, 'href') and self.href is not None:
_dict['href'] = self.href
if hasattr(self, 'id') and self.id is not None:
_dict['id'] = self.id
- if hasattr(self, '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, 'remote') and self.remote is not None:
+ if isinstance(self.remote, dict):
+ _dict['remote'] = self.remote
+ else:
+ _dict['remote'] = self.remote.to_dict()
if hasattr(self, 'resource_type') and self.resource_type is not None:
_dict['resource_type'] = self.resource_type
- if hasattr(self, 'size') and self.size is not None:
- _dict['size'] = self.size
return _dict
def _to_dict(self):
@@ -43242,85 +45262,67 @@ 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 ImageReference object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceDisk') -> 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: 'InstanceDisk') -> bool:
+ def __ne__(self, other: 'ImageReference') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class InterfaceTypeEnum(str, Enum):
- """
- The disk interface used for attaching the disk.
- The enumerated values for this property are expected to expand in the future. When
- processing this property, check for and log unknown values. Optionally halt
- processing and surface the error, or bypass the resource on which the unexpected
- property value was encountered.
- """
-
- NVME = 'nvme'
- VIRTIO_BLK = 'virtio_blk'
-
-
class ResourceTypeEnum(str, Enum):
"""
The resource type.
"""
- INSTANCE_DISK = 'instance_disk'
+ IMAGE = 'image'
-class InstanceDiskCollection:
+class ImageReferenceDeleted:
"""
- InstanceDiskCollection.
+ If present, this property indicates the referenced resource has been deleted, and
+ provides some supplementary information.
- :attr List[InstanceDisk] disks: Collection of the instance's disks.
+ :param str more_info: Link to documentation about deleted resources.
"""
def __init__(
self,
- disks: List['InstanceDisk'],
+ more_info: str,
) -> None:
"""
- Initialize a InstanceDiskCollection object.
+ Initialize a ImageReferenceDeleted object.
- :param List[InstanceDisk] disks: Collection of the instance's disks.
+ :param str more_info: Link to documentation about deleted resources.
"""
- self.disks = disks
+ self.more_info = more_info
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstanceDiskCollection':
- """Initialize a InstanceDiskCollection object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'ImageReferenceDeleted':
+ """Initialize a ImageReferenceDeleted object from a json dictionary."""
args = {}
- if 'disks' in _dict:
- args['disks'] = [InstanceDisk.from_dict(v) for v in _dict.get('disks')]
+ if (more_info := _dict.get('more_info')) is not None:
+ args['more_info'] = more_info
else:
- raise ValueError('Required property \'disks\' not present in InstanceDiskCollection JSON')
+ raise ValueError('Required property \'more_info\' not present in ImageReferenceDeleted JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceDiskCollection 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, 'disks') and self.disks is not None:
- disks_list = []
- for v in self.disks:
- if isinstance(v, dict):
- disks_list.append(v)
- else:
- disks_list.append(v.to_dict())
- _dict['disks'] = disks_list
+ if hasattr(self, 'more_info') and self.more_info is not None:
+ _dict['more_info'] = self.more_info
return _dict
def _to_dict(self):
@@ -43328,59 +45330,80 @@ 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 ImageReferenceDeleted object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceDiskCollection') -> 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: 'InstanceDiskCollection') -> bool:
+ def __ne__(self, other: 'ImageReferenceDeleted') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class InstanceDiskPatch:
+class ImageRemote:
"""
- InstanceDiskPatch.
+ If present, this property indicates that the resource associated with this reference
+ is remote and therefore may not be directly retrievable.
- :attr str name: (optional) The name for this instance disk. The name must not be
- used by another disk on the instance.
+ :param AccountReference account: (optional) If present, this property indicates
+ that the referenced resource is remote to this
+ account, and identifies the owning account.
+ :param RegionReference region: (optional) If present, this property indicates
+ that the referenced resource is remote to this
+ region, and identifies the native region.
"""
def __init__(
self,
*,
- name: str = None,
+ account: Optional['AccountReference'] = None,
+ region: Optional['RegionReference'] = None,
) -> None:
"""
- Initialize a InstanceDiskPatch object.
+ Initialize a ImageRemote object.
- :param str name: (optional) The name for this instance disk. The name must
- not be used by another disk on the instance.
+ :param AccountReference account: (optional) If present, this property
+ indicates that the referenced resource is remote to this
+ account, and identifies the owning account.
+ :param RegionReference region: (optional) If present, this property
+ indicates that the referenced resource is remote to this
+ region, and identifies the native region.
"""
- self.name = name
+ self.account = account
+ self.region = region
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstanceDiskPatch':
- """Initialize a InstanceDiskPatch object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'ImageRemote':
+ """Initialize a ImageRemote object from a json dictionary."""
args = {}
- if 'name' in _dict:
- args['name'] = _dict.get('name')
+ if (account := _dict.get('account')) is not None:
+ args['account'] = AccountReference.from_dict(account)
+ if (region := _dict.get('region')) is not None:
+ args['region'] = RegionReference.from_dict(region)
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceDiskPatch object from a json dictionary."""
+ """Initialize a ImageRemote object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'name') and self.name is not None:
- _dict['name'] = self.name
+ if hasattr(self, 'account') and self.account is not None:
+ if isinstance(self.account, dict):
+ _dict['account'] = self.account
+ else:
+ _dict['account'] = self.account.to_dict()
+ if hasattr(self, 'region') and self.region is not None:
+ if isinstance(self.region, dict):
+ _dict['region'] = self.region
+ else:
+ _dict['region'] = self.region.to_dict()
return _dict
def _to_dict(self):
@@ -43388,106 +45411,79 @@ 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 ImageRemote object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceDiskPatch') -> bool:
+ def __eq__(self, other: 'ImageRemote') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'InstanceDiskPatch') -> bool:
+ def __ne__(self, other: 'ImageRemote') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class InstanceDiskReference:
+class ImageStatusReason:
"""
- InstanceDiskReference.
+ ImageStatusReason.
- :attr InstanceDiskReferenceDeleted deleted: (optional) If present, this property
- indicates the referenced resource has been deleted, and provides
- some supplementary information.
- :attr str href: The URL for this instance disk.
- :attr str id: The unique identifier for this instance disk.
- :attr str name: The name for this instance disk. The name is unique across all
- disks on the instance.
- :attr str resource_type: The resource type.
+ :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.
"""
def __init__(
self,
- href: str,
- id: str,
- name: str,
- resource_type: str,
+ code: str,
+ message: str,
*,
- deleted: 'InstanceDiskReferenceDeleted' = None,
+ more_info: Optional[str] = None,
) -> None:
"""
- Initialize a InstanceDiskReference object.
+ Initialize a ImageStatusReason object.
- :param str href: The URL for this instance disk.
- :param str id: The unique identifier for this instance disk.
- :param str name: The name for this instance disk. The name is unique across
- all disks on the instance.
- :param str resource_type: The resource type.
- :param InstanceDiskReferenceDeleted deleted: (optional) If present, this
- property indicates the referenced resource has been deleted, and provides
- some supplementary information.
+ :param 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.deleted = deleted
- self.href = href
- self.id = id
- self.name = name
- self.resource_type = resource_type
+ self.code = code
+ self.message = message
+ self.more_info = more_info
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstanceDiskReference':
- """Initialize a InstanceDiskReference object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'ImageStatusReason':
+ """Initialize a ImageStatusReason 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')
+ if (code := _dict.get('code')) is not None:
+ args['code'] = code
else:
- raise ValueError('Required property \'name\' not present in InstanceDiskReference JSON')
- if 'resource_type' in _dict:
- args['resource_type'] = _dict.get('resource_type')
+ raise ValueError('Required property \'code\' not present in ImageStatusReason JSON')
+ if (message := _dict.get('message')) is not None:
+ args['message'] = message
else:
- raise ValueError('Required property \'resource_type\' not present in InstanceDiskReference JSON')
+ raise ValueError('Required property \'message\' not present in ImageStatusReason JSON')
+ if (more_info := _dict.get('more_info')) is not None:
+ args['more_info'] = more_info
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceDiskReference 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, 'deleted') and self.deleted is not None:
- if isinstance(self.deleted, dict):
- _dict['deleted'] = self.deleted
- else:
- _dict['deleted'] = self.deleted.to_dict()
- if hasattr(self, 'href') and self.href is not None:
- _dict['href'] = self.href
- if hasattr(self, 'id') and self.id is not None:
- _dict['id'] = self.id
- if hasattr(self, 'name') and self.name is not None:
- _dict['name'] = self.name
- if hasattr(self, 'resource_type') and self.resource_type is not None:
- _dict['resource_type'] = self.resource_type
+ if hasattr(self, '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):
@@ -43495,407 +45491,691 @@ 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 ImageStatusReason object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceDiskReference') -> 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: 'InstanceDiskReference') -> bool:
+ def __ne__(self, other: 'ImageStatusReason') -> 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:
- """
- If present, this property indicates the referenced resource has been deleted, and
- provides some supplementary information.
-
- :attr str more_info: Link to documentation about deleted resources.
- """
-
- def __init__(
- self,
- more_info: str,
- ) -> None:
+ class CodeEnum(str, Enum):
"""
- Initialize a InstanceDiskReferenceDeleted object.
-
- :param str more_info: Link to documentation about deleted resources.
+ A snake case string succinctly identifying the status reason.
"""
- self.more_info = more_info
-
- @classmethod
- 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 InstanceDiskReferenceDeleted JSON')
- return cls(**args)
- @classmethod
- def _from_dict(cls, _dict):
- """Initialize a InstanceDiskReferenceDeleted object from a json dictionary."""
- return cls.from_dict(_dict)
-
- def to_dict(self) -> Dict:
- """Return a json dictionary representing this model."""
- _dict = {}
- if hasattr(self, '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 InstanceDiskReferenceDeleted object."""
- return json.dumps(self.to_dict(), indent=2)
-
- 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__
+ ENCRYPTED_DATA_KEY_INVALID = 'encrypted_data_key_invalid'
+ ENCRYPTION_KEY_DELETED = 'encryption_key_deleted'
+ ENCRYPTION_KEY_DISABLED = 'encryption_key_disabled'
+ IMAGE_DATA_CORRUPTED = 'image_data_corrupted'
+ IMAGE_PROVISIONED_SIZE_UNSUPPORTED = 'image_provisioned_size_unsupported'
+ IMAGE_REQUEST_IN_PROGRESS = 'image_request_in_progress'
+ IMAGE_REQUEST_QUEUED = 'image_request_queued'
- def __ne__(self, other: 'InstanceDiskReferenceDeleted') -> bool:
- """Return `true` when self and other are not equal, false otherwise."""
- return not self == other
-class InstanceGPU:
+class Instance:
"""
- The virtual server instance GPU configuration.
+ Instance.
- :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.
+ :param InstanceAvailabilityPolicy availability_policy: The availability policy
+ for this virtual server instance.
+ :param int bandwidth: The total bandwidth (in megabits per second) shared across
+ the instance network attachments or instance network interfaces and storage
+ volumes of the virtual server instance.
+ :param VolumeAttachmentReferenceInstanceContext boot_volume_attachment: Boot
+ volume attachment.
+ :param InstanceCatalogOffering catalog_offering: (optional) If present, this
+ virtual server instance was provisioned from a
+ [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user).
+ :param 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 DedicatedHostReference dedicated_host: (optional) If present, the
+ dedicated host this virtual server instance has been placed on.
+ :param List[InstanceDisk] disks: The instance disks for this virtual server
+ instance.
+ :param InstanceGPU gpu: (optional) The virtual server instance GPU
+ configuration.
+ :param List[InstanceHealthReason] health_reasons: The reasons for the current
+ instance `health_state` (if any):
+ - `reservation_capacity_unavailable`: The reservation affinity pool has no
+ available capacity.
+ - `reservation_deleted`: The reservation affinity pool has a deleted
+ reservation.
+ - `reservation_expired`: The reservation affinity pool has an expired
+ reservation.
+ - `reservation_failed`: The reservation affinity pool has a failed reservation.
+ The enumerated reason code values for this property will expand in the future.
+ When processing this property, check for and log unknown values. Optionally halt
+ processing and surface the error, or bypass the resource on which the unexpected
+ reason code was encountered.
+ :param str health_state: The health of this resource.
+ - `ok`: No abnormal behavior detected
+ - `degraded`: Experiencing compromised performance, capacity, or connectivity
+ - `faulted`: Completely unreachable, inoperative, or otherwise entirely
+ incapacitated
+ - `inapplicable`: The health state does not apply because of the current
+ lifecycle state. A resource with a lifecycle state of `failed` or `deleting`
+ will have a health state of `inapplicable`. A `pending` resource may also have
+ this state.
+ :param str href: The URL for this virtual server instance.
+ :param str id: The unique identifier for this virtual server instance.
+ :param ImageReference image: (optional) The image the virtual server instance
+ was provisioned from.
+ :param List[InstanceLifecycleReason] lifecycle_reasons: The reasons for the
+ current `lifecycle_state` (if any).
+ The enumerated reason code values for this property will expand in the future.
+ When processing this property, check for and log unknown values. Optionally halt
+ processing and surface the error, or bypass the resource on which the unexpected
+ reason code was encountered.
+ :param str lifecycle_state: The lifecycle state of the virtual server instance.
+ :param int memory: The amount of memory, truncated to whole gibibytes.
+ :param InstanceMetadataService metadata_service: The metadata service
+ configuration.
+ :param str name: The name for this virtual server instance. The name is unique
+ across all virtual server instances in the region.
+ :param List[InstanceNetworkAttachmentReference] network_attachments: The network
+ attachments for this virtual server instance, including the primary network
+ attachment.
+ :param List[NetworkInterfaceInstanceContextReference] network_interfaces: The
+ network interfaces for this instance, including the primary network interface.
+ If this instance has network attachments, each network interface is a [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface.
+ :param int numa_count: (optional) The number of NUMA nodes this virtual server
+ instance is provisioned on.
+ This property will be absent if the instance's `status` is not `running`.
+ :param InstancePlacementTarget placement_target: (optional) The placement
+ restrictions for the virtual server instance.
+ :param InstanceNetworkAttachmentReference primary_network_attachment: (optional)
+ The primary network attachment for this virtual server instance.
+ :param NetworkInterfaceInstanceContextReference primary_network_interface: The
+ primary network interface for this virtual server instance.
+ If this instance has network attachments, this primary network interface is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of the primary network attachment and its attached virtual network interface.
+ :param InstanceProfileReference profile: The
+ [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) for this virtual
+ server instance.
+ :param ReservationReference reservation: (optional) The reservation used by this
+ virtual server instance.
+ If absent, no reservation is in use.
+ :param InstanceReservationAffinity reservation_affinity:
+ :param ResourceGroupReference resource_group: The resource group for this
+ instance.
+ :param str resource_type: The resource type.
+ :param bool startable: Indicates whether the state of the virtual server
+ instance permits a start request.
+ :param str status: The status of the virtual server instance.
+ The enumerated values for this property will expand in the future. When
+ processing this property, check for and log unknown values. Optionally halt
+ processing and surface the error, or bypass the instance on which the unexpected
+ property value was encountered.
+ :param List[InstanceStatusReason] status_reasons: The reasons for the current
+ status (if any).
+ The enumerated reason code values for this property will expand in the future.
+ When processing this property, check for and log unknown values. Optionally halt
+ processing and surface the error, or bypass the resource on which the unexpected
+ reason code was encountered.
+ :param int total_network_bandwidth: The amount of bandwidth (in megabits per
+ second) allocated exclusively to instance network attachments or 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.
"""
def __init__(
self,
- count: int,
- manufacturer: str,
+ availability_policy: 'InstanceAvailabilityPolicy',
+ bandwidth: int,
+ boot_volume_attachment: 'VolumeAttachmentReferenceInstanceContext',
+ created_at: datetime,
+ crn: str,
+ disks: List['InstanceDisk'],
+ health_reasons: List['InstanceHealthReason'],
+ health_state: str,
+ href: str,
+ id: str,
+ lifecycle_reasons: List['InstanceLifecycleReason'],
+ lifecycle_state: str,
memory: int,
- model: str,
+ metadata_service: 'InstanceMetadataService',
+ name: str,
+ network_attachments: List['InstanceNetworkAttachmentReference'],
+ network_interfaces: List['NetworkInterfaceInstanceContextReference'],
+ primary_network_interface: 'NetworkInterfaceInstanceContextReference',
+ profile: 'InstanceProfileReference',
+ reservation_affinity: 'InstanceReservationAffinity',
+ resource_group: 'ResourceGroupReference',
+ resource_type: str,
+ startable: bool,
+ status: str,
+ status_reasons: List['InstanceStatusReason'],
+ total_network_bandwidth: int,
+ total_volume_bandwidth: int,
+ vcpu: 'InstanceVCPU',
+ volume_attachments: List['VolumeAttachmentReferenceInstanceContext'],
+ vpc: 'VPCReference',
+ zone: 'ZoneReference',
+ *,
+ catalog_offering: Optional['InstanceCatalogOffering'] = None,
+ dedicated_host: Optional['DedicatedHostReference'] = None,
+ gpu: Optional['InstanceGPU'] = None,
+ image: Optional['ImageReference'] = None,
+ numa_count: Optional[int] = None,
+ placement_target: Optional['InstancePlacementTarget'] = None,
+ primary_network_attachment: Optional['InstanceNetworkAttachmentReference'] = None,
+ reservation: Optional['ReservationReference'] = None,
) -> None:
"""
- Initialize a InstanceGPU object.
+ Initialize a Instance 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 InstanceAvailabilityPolicy availability_policy: The availability
+ policy for this virtual server instance.
+ :param int bandwidth: The total bandwidth (in megabits per second) shared
+ across the instance network attachments or instance network interfaces and
+ storage volumes of the virtual server instance.
+ :param VolumeAttachmentReferenceInstanceContext boot_volume_attachment:
+ Boot volume attachment.
+ :param datetime created_at: The date and time that the virtual server
+ instance was created.
+ :param str crn: The CRN for this virtual server instance.
+ :param List[InstanceDisk] disks: The instance disks for this virtual server
+ instance.
+ :param List[InstanceHealthReason] health_reasons: The reasons for the
+ current instance `health_state` (if any):
+ - `reservation_capacity_unavailable`: The reservation affinity pool has no
+ available capacity.
+ - `reservation_deleted`: The reservation affinity pool has a deleted
+ reservation.
+ - `reservation_expired`: The reservation affinity pool has an expired
+ reservation.
+ - `reservation_failed`: The reservation affinity pool has a failed
+ reservation.
+ The enumerated reason code values for this property will expand in the
+ future. When processing this property, check for and log unknown values.
+ Optionally halt processing and surface the error, or bypass the resource on
+ which the unexpected reason code was encountered.
+ :param str health_state: The health of this resource.
+ - `ok`: No abnormal behavior detected
+ - `degraded`: Experiencing compromised performance, capacity, or
+ connectivity
+ - `faulted`: Completely unreachable, inoperative, or otherwise entirely
+ incapacitated
+ - `inapplicable`: The health state does not apply because of the current
+ lifecycle state. A resource with a lifecycle state of `failed` or
+ `deleting` will have a health state of `inapplicable`. A `pending` resource
+ may also have this state.
+ :param str href: The URL for this virtual server instance.
+ :param str id: The unique identifier for this virtual server instance.
+ :param List[InstanceLifecycleReason] lifecycle_reasons: The reasons for the
+ current `lifecycle_state` (if any).
+ The enumerated reason code values for this property will expand in the
+ future. When processing this property, check for and log unknown values.
+ Optionally halt processing and surface the error, or bypass the resource on
+ which the unexpected reason code was encountered.
+ :param str lifecycle_state: The lifecycle state of the virtual server
+ instance.
+ :param int memory: The amount of memory, truncated to whole gibibytes.
+ :param InstanceMetadataService metadata_service: The metadata service
+ configuration.
+ :param str name: The name for this virtual server instance. The name is
+ unique across all virtual server instances in the region.
+ :param List[InstanceNetworkAttachmentReference] network_attachments: The
+ network attachments for this virtual server instance, including the primary
+ network attachment.
+ :param List[NetworkInterfaceInstanceContextReference] network_interfaces:
+ The network interfaces for this instance, including the primary network
+ interface.
+ If this instance has network attachments, each network interface is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface.
+ :param NetworkInterfaceInstanceContextReference primary_network_interface:
+ The primary network interface for this virtual server instance.
+ If this instance has network attachments, this primary network interface is
+ a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of the primary network attachment and its attached virtual network
+ interface.
+ :param InstanceProfileReference profile: The
+ [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) for this
+ virtual
+ server instance.
+ :param InstanceReservationAffinity reservation_affinity:
+ :param ResourceGroupReference resource_group: The resource group for this
+ instance.
+ :param str resource_type: The resource type.
+ :param bool startable: Indicates whether the state of the virtual server
+ instance permits a start request.
+ :param str status: The status of the virtual server instance.
+ The enumerated values for this property will expand in the future. When
+ processing this property, check for and log unknown values. Optionally halt
+ processing and surface the error, or bypass the instance on which the
+ unexpected property value was encountered.
+ :param List[InstanceStatusReason] status_reasons: The reasons for the
+ current status (if any).
+ The enumerated reason code values for this property will expand in the
+ future. When processing this property, check for and log unknown values.
+ Optionally halt processing and surface the error, or bypass the resource on
+ which the unexpected reason code was encountered.
+ :param int total_network_bandwidth: The amount of bandwidth (in megabits
+ per second) allocated exclusively to instance network attachments or
+ instance network interfaces.
+ :param int total_volume_bandwidth: The amount of bandwidth (in megabits per
+ second) allocated exclusively to instance storage volumes. An increase in
+ this value will result in a corresponding decrease to
+ `total_network_bandwidth`.
+ :param InstanceVCPU vcpu: The virtual server instance VCPU configuration.
+ :param List[VolumeAttachmentReferenceInstanceContext] volume_attachments:
+ The volume attachments for this virtual server instance, including the boot
+ volume attachment.
+ :param VPCReference vpc: The VPC this virtual server instance resides in.
+ :param ZoneReference zone: The zone this virtual server instance resides
+ in.
+ :param InstanceCatalogOffering catalog_offering: (optional) If present,
+ this virtual server instance was provisioned from a
+ [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user).
+ :param DedicatedHostReference dedicated_host: (optional) If present, the
+ dedicated host this virtual server instance has been placed on.
+ :param InstanceGPU gpu: (optional) The virtual server instance GPU
+ configuration.
+ :param ImageReference image: (optional) The image the virtual server
+ instance was provisioned from.
+ :param int numa_count: (optional) The number of NUMA nodes this virtual
+ server instance is provisioned on.
+ This property will be absent if the instance's `status` is not `running`.
+ :param InstancePlacementTarget placement_target: (optional) The placement
+ restrictions for the virtual server instance.
+ :param InstanceNetworkAttachmentReference primary_network_attachment:
+ (optional) The primary network attachment for this virtual server instance.
+ :param ReservationReference reservation: (optional) The reservation used by
+ this virtual server instance.
+ If absent, no reservation is in use.
"""
- self.count = count
- self.manufacturer = manufacturer
+ self.availability_policy = availability_policy
+ self.bandwidth = bandwidth
+ self.boot_volume_attachment = boot_volume_attachment
+ self.catalog_offering = catalog_offering
+ self.created_at = created_at
+ self.crn = crn
+ self.dedicated_host = dedicated_host
+ self.disks = disks
+ self.gpu = gpu
+ self.health_reasons = health_reasons
+ self.health_state = health_state
+ self.href = href
+ self.id = id
+ self.image = image
+ self.lifecycle_reasons = lifecycle_reasons
+ self.lifecycle_state = lifecycle_state
self.memory = memory
- self.model = model
+ self.metadata_service = metadata_service
+ self.name = name
+ self.network_attachments = network_attachments
+ self.network_interfaces = network_interfaces
+ self.numa_count = numa_count
+ self.placement_target = placement_target
+ self.primary_network_attachment = primary_network_attachment
+ self.primary_network_interface = primary_network_interface
+ self.profile = profile
+ self.reservation = reservation
+ self.reservation_affinity = reservation_affinity
+ self.resource_group = resource_group
+ self.resource_type = resource_type
+ self.startable = startable
+ self.status = status
+ self.status_reasons = status_reasons
+ self.total_network_bandwidth = total_network_bandwidth
+ self.total_volume_bandwidth = total_volume_bandwidth
+ self.vcpu = vcpu
+ self.volume_attachments = volume_attachments
+ self.vpc = vpc
+ self.zone = zone
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstanceGPU':
- """Initialize a InstanceGPU object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'Instance':
+ """Initialize a Instance object from a json dictionary."""
args = {}
- if 'count' in _dict:
- args['count'] = _dict.get('count')
+ if (availability_policy := _dict.get('availability_policy')) is not None:
+ args['availability_policy'] = InstanceAvailabilityPolicy.from_dict(availability_policy)
else:
- raise ValueError('Required property \'count\' not present in InstanceGPU JSON')
- if 'manufacturer' in _dict:
- args['manufacturer'] = _dict.get('manufacturer')
+ raise ValueError('Required property \'availability_policy\' not present in Instance JSON')
+ if (bandwidth := _dict.get('bandwidth')) is not None:
+ args['bandwidth'] = bandwidth
else:
- raise ValueError('Required property \'manufacturer\' not present in InstanceGPU JSON')
- if 'memory' in _dict:
- args['memory'] = _dict.get('memory')
+ raise ValueError('Required property \'bandwidth\' not present in Instance JSON')
+ if (boot_volume_attachment := _dict.get('boot_volume_attachment')) is not None:
+ args['boot_volume_attachment'] = VolumeAttachmentReferenceInstanceContext.from_dict(boot_volume_attachment)
else:
- raise ValueError('Required property \'memory\' not present in InstanceGPU JSON')
- if 'model' in _dict:
- args['model'] = _dict.get('model')
+ raise ValueError('Required property \'boot_volume_attachment\' not present in Instance JSON')
+ if (catalog_offering := _dict.get('catalog_offering')) is not None:
+ args['catalog_offering'] = InstanceCatalogOffering.from_dict(catalog_offering)
+ if (created_at := _dict.get('created_at')) is not None:
+ args['created_at'] = string_to_datetime(created_at)
else:
- raise ValueError('Required property \'model\' not present in InstanceGPU JSON')
+ raise ValueError('Required property \'created_at\' not present in Instance JSON')
+ if (crn := _dict.get('crn')) is not None:
+ args['crn'] = crn
+ else:
+ raise ValueError('Required property \'crn\' not present in Instance JSON')
+ if (dedicated_host := _dict.get('dedicated_host')) is not None:
+ args['dedicated_host'] = DedicatedHostReference.from_dict(dedicated_host)
+ if (disks := _dict.get('disks')) is not None:
+ args['disks'] = [InstanceDisk.from_dict(v) for v in disks]
+ else:
+ raise ValueError('Required property \'disks\' not present in Instance JSON')
+ if (gpu := _dict.get('gpu')) is not None:
+ args['gpu'] = InstanceGPU.from_dict(gpu)
+ if (health_reasons := _dict.get('health_reasons')) is not None:
+ args['health_reasons'] = [InstanceHealthReason.from_dict(v) for v in health_reasons]
+ else:
+ raise ValueError('Required property \'health_reasons\' not present in Instance JSON')
+ if (health_state := _dict.get('health_state')) is not None:
+ args['health_state'] = health_state
+ else:
+ raise ValueError('Required property \'health_state\' not present in Instance JSON')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
+ else:
+ raise ValueError('Required property \'href\' not present in Instance JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
+ else:
+ raise ValueError('Required property \'id\' not present in Instance JSON')
+ if (image := _dict.get('image')) is not None:
+ args['image'] = ImageReference.from_dict(image)
+ if (lifecycle_reasons := _dict.get('lifecycle_reasons')) is not None:
+ args['lifecycle_reasons'] = [InstanceLifecycleReason.from_dict(v) for v in lifecycle_reasons]
+ else:
+ raise ValueError('Required property \'lifecycle_reasons\' not present in Instance JSON')
+ if (lifecycle_state := _dict.get('lifecycle_state')) is not None:
+ args['lifecycle_state'] = lifecycle_state
+ else:
+ raise ValueError('Required property \'lifecycle_state\' not present in Instance JSON')
+ if (memory := _dict.get('memory')) is not None:
+ args['memory'] = memory
+ else:
+ raise ValueError('Required property \'memory\' not present in Instance JSON')
+ if (metadata_service := _dict.get('metadata_service')) is not None:
+ args['metadata_service'] = InstanceMetadataService.from_dict(metadata_service)
+ else:
+ raise ValueError('Required property \'metadata_service\' not present in Instance JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ else:
+ raise ValueError('Required property \'name\' not present in Instance JSON')
+ if (network_attachments := _dict.get('network_attachments')) is not None:
+ args['network_attachments'] = [InstanceNetworkAttachmentReference.from_dict(v) for v in network_attachments]
+ else:
+ raise ValueError('Required property \'network_attachments\' not present in Instance JSON')
+ if (network_interfaces := _dict.get('network_interfaces')) is not None:
+ args['network_interfaces'] = [NetworkInterfaceInstanceContextReference.from_dict(v) for v in network_interfaces]
+ else:
+ raise ValueError('Required property \'network_interfaces\' not present in Instance JSON')
+ if (numa_count := _dict.get('numa_count')) is not None:
+ args['numa_count'] = numa_count
+ if (placement_target := _dict.get('placement_target')) is not None:
+ args['placement_target'] = placement_target
+ if (primary_network_attachment := _dict.get('primary_network_attachment')) is not None:
+ args['primary_network_attachment'] = InstanceNetworkAttachmentReference.from_dict(primary_network_attachment)
+ if (primary_network_interface := _dict.get('primary_network_interface')) is not None:
+ args['primary_network_interface'] = NetworkInterfaceInstanceContextReference.from_dict(primary_network_interface)
+ else:
+ raise ValueError('Required property \'primary_network_interface\' not present in Instance JSON')
+ if (profile := _dict.get('profile')) is not None:
+ args['profile'] = InstanceProfileReference.from_dict(profile)
+ else:
+ raise ValueError('Required property \'profile\' not present in Instance JSON')
+ if (reservation := _dict.get('reservation')) is not None:
+ args['reservation'] = ReservationReference.from_dict(reservation)
+ if (reservation_affinity := _dict.get('reservation_affinity')) is not None:
+ args['reservation_affinity'] = InstanceReservationAffinity.from_dict(reservation_affinity)
+ else:
+ raise ValueError('Required property \'reservation_affinity\' not present in Instance JSON')
+ if (resource_group := _dict.get('resource_group')) is not None:
+ args['resource_group'] = ResourceGroupReference.from_dict(resource_group)
+ else:
+ raise ValueError('Required property \'resource_group\' not present in Instance JSON')
+ if (resource_type := _dict.get('resource_type')) is not None:
+ args['resource_type'] = resource_type
+ else:
+ raise ValueError('Required property \'resource_type\' not present in Instance JSON')
+ if (startable := _dict.get('startable')) is not None:
+ args['startable'] = startable
+ else:
+ raise ValueError('Required property \'startable\' not present in Instance JSON')
+ if (status := _dict.get('status')) is not None:
+ args['status'] = status
+ else:
+ raise ValueError('Required property \'status\' not present in Instance JSON')
+ if (status_reasons := _dict.get('status_reasons')) is not None:
+ args['status_reasons'] = [InstanceStatusReason.from_dict(v) for v in status_reasons]
+ else:
+ raise ValueError('Required property \'status_reasons\' not present in Instance JSON')
+ if (total_network_bandwidth := _dict.get('total_network_bandwidth')) is not None:
+ args['total_network_bandwidth'] = total_network_bandwidth
+ else:
+ raise ValueError('Required property \'total_network_bandwidth\' not present in Instance JSON')
+ if (total_volume_bandwidth := _dict.get('total_volume_bandwidth')) is not None:
+ args['total_volume_bandwidth'] = total_volume_bandwidth
+ else:
+ raise ValueError('Required property \'total_volume_bandwidth\' not present in Instance JSON')
+ if (vcpu := _dict.get('vcpu')) is not None:
+ args['vcpu'] = InstanceVCPU.from_dict(vcpu)
+ else:
+ raise ValueError('Required property \'vcpu\' not present in Instance JSON')
+ if (volume_attachments := _dict.get('volume_attachments')) is not None:
+ args['volume_attachments'] = [VolumeAttachmentReferenceInstanceContext.from_dict(v) for v in volume_attachments]
+ else:
+ raise ValueError('Required property \'volume_attachments\' not present in Instance JSON')
+ if (vpc := _dict.get('vpc')) is not None:
+ args['vpc'] = VPCReference.from_dict(vpc)
+ else:
+ raise ValueError('Required property \'vpc\' not present in Instance JSON')
+ if (zone := _dict.get('zone')) is not None:
+ args['zone'] = ZoneReference.from_dict(zone)
+ else:
+ raise ValueError('Required property \'zone\' not present in Instance JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceGPU 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, '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):
- """Return a json dictionary representing this model."""
- return self.to_dict()
-
- def __str__(self) -> str:
- """Return a `str` version of this InstanceGPU object."""
- return json.dumps(self.to_dict(), indent=2)
-
- 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: 'InstanceGPU') -> bool:
- """Return `true` when self and other are not equal, false otherwise."""
- return not self == other
-
-
-class InstanceGroup:
- """
- InstanceGroup.
-
- :attr int application_port: (optional) The port used for new load balancer pool
- members created by this instance group.
- This property will be present if and only if `load_balancer_pool` is present.
- :attr datetime created_at: The date and time that the instance group was
- created.
- :attr str crn: The CRN for this instance group.
- :attr str href: The URL for this instance group.
- :attr str id: The unique identifier for this instance group.
- :attr InstanceTemplateReference instance_template: The template used to create
- new instances for this group.
- :attr LoadBalancerPoolReference load_balancer_pool: (optional) If present, the
- load balancer pool this instance group manages. A pool member will
- be created for each instance created by this group.
- :attr List[InstanceGroupManagerReference] managers: The managers for the
- instance group.
- :attr int membership_count: The number of instances in the instance group.
- :attr str name: The name for this instance group. The name is unique across all
- instance groups in the region.
- :attr ResourceGroupReference resource_group:
- :attr str status: The status of the instance group
- - `deleting`: Group is being deleted
- - `healthy`: Group has `membership_count` instances
- - `scaling`: Instances in the group are being created or deleted to reach
- `membership_count`
- - `unhealthy`: Group is unable to reach `membership_count` instances.
- :attr List[SubnetReference] subnets: The subnets to use when creating new
- instances.
- :attr datetime updated_at: The date and time that the instance group was
- updated.
- :attr VPCReference vpc: The VPC the instance group resides in.
- """
-
- def __init__(
- self,
- created_at: datetime,
- crn: str,
- href: str,
- id: str,
- instance_template: 'InstanceTemplateReference',
- managers: List['InstanceGroupManagerReference'],
- membership_count: int,
- name: str,
- resource_group: 'ResourceGroupReference',
- status: str,
- subnets: List['SubnetReference'],
- updated_at: datetime,
- vpc: 'VPCReference',
- *,
- application_port: int = None,
- load_balancer_pool: 'LoadBalancerPoolReference' = None,
- ) -> None:
- """
- Initialize a InstanceGroup object.
-
- :param datetime created_at: The date and time that the instance group was
- created.
- :param str crn: The CRN for this instance group.
- :param str href: The URL for this instance group.
- :param str id: The unique identifier for this instance group.
- :param InstanceTemplateReference instance_template: The template used to
- create new instances for this group.
- :param List[InstanceGroupManagerReference] managers: The managers for the
- instance group.
- :param int membership_count: The number of instances in the instance group.
- :param str name: The name for this instance group. The name is unique
- across all instance groups in the region.
- :param ResourceGroupReference resource_group:
- :param str status: The status of the instance group
- - `deleting`: Group is being deleted
- - `healthy`: Group has `membership_count` instances
- - `scaling`: Instances in the group are being created or deleted to reach
- `membership_count`
- - `unhealthy`: Group is unable to reach `membership_count` instances.
- :param List[SubnetReference] subnets: The subnets to use when creating new
- instances.
- :param datetime updated_at: The date and time that the instance group was
- updated.
- :param VPCReference vpc: The VPC the instance group resides in.
- :param int application_port: (optional) The port used for new load balancer
- pool members created by this instance group.
- This property will be present if and only if `load_balancer_pool` is
- present.
- :param LoadBalancerPoolReference load_balancer_pool: (optional) If present,
- the load balancer pool this instance group manages. A pool member will
- be created for each instance created by this group.
- """
- self.application_port = application_port
- self.created_at = created_at
- self.crn = crn
- self.href = href
- self.id = id
- self.instance_template = instance_template
- self.load_balancer_pool = load_balancer_pool
- self.managers = managers
- self.membership_count = membership_count
- self.name = name
- self.resource_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."""
- args = {}
- if 'application_port' in _dict:
- args['application_port'] = _dict.get('application_port')
- if 'created_at' in _dict:
- args['created_at'] = string_to_datetime(_dict.get('created_at'))
- else:
- raise ValueError('Required property \'created_at\' not present in InstanceGroup JSON')
- if 'crn' in _dict:
- args['crn'] = _dict.get('crn')
- else:
- raise ValueError('Required property \'crn\' not present in InstanceGroup JSON')
- if 'href' in _dict:
- args['href'] = _dict.get('href')
- else:
- raise ValueError('Required property \'href\' not present in InstanceGroup JSON')
- if 'id' in _dict:
- args['id'] = _dict.get('id')
- else:
- raise ValueError('Required property \'id\' not present in InstanceGroup JSON')
- if 'instance_template' in _dict:
- args['instance_template'] = InstanceTemplateReference.from_dict(_dict.get('instance_template'))
- else:
- raise ValueError('Required property \'instance_template\' not present in InstanceGroup JSON')
- if 'load_balancer_pool' in _dict:
- args['load_balancer_pool'] = LoadBalancerPoolReference.from_dict(_dict.get('load_balancer_pool'))
- if 'managers' in _dict:
- args['managers'] = [InstanceGroupManagerReference.from_dict(v) for v in _dict.get('managers')]
- else:
- raise ValueError('Required property \'managers\' not present in InstanceGroup JSON')
- if 'membership_count' in _dict:
- args['membership_count'] = _dict.get('membership_count')
- else:
- raise ValueError('Required property \'membership_count\' not present in InstanceGroup JSON')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
- else:
- raise ValueError('Required property \'name\' not present in InstanceGroup JSON')
- if 'resource_group' in _dict:
- args['resource_group'] = ResourceGroupReference.from_dict(_dict.get('resource_group'))
- else:
- raise ValueError('Required property \'resource_group\' not present in InstanceGroup JSON')
- if 'status' in _dict:
- args['status'] = _dict.get('status')
- else:
- raise ValueError('Required property \'status\' not present in InstanceGroup JSON')
- if 'subnets' in _dict:
- args['subnets'] = [SubnetReference.from_dict(v) for v in _dict.get('subnets')]
- else:
- raise ValueError('Required property \'subnets\' not present in InstanceGroup JSON')
- if 'updated_at' in _dict:
- args['updated_at'] = string_to_datetime(_dict.get('updated_at'))
- else:
- raise ValueError('Required property \'updated_at\' not present in InstanceGroup JSON')
- if 'vpc' in _dict:
- args['vpc'] = VPCReference.from_dict(_dict.get('vpc'))
- else:
- raise ValueError('Required property \'vpc\' not present in InstanceGroup JSON')
- return cls(**args)
-
- @classmethod
- def _from_dict(cls, _dict):
- """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, 'application_port') and self.application_port is not None:
- _dict['application_port'] = self.application_port
+ if hasattr(self, 'availability_policy') and self.availability_policy is not None:
+ if isinstance(self.availability_policy, dict):
+ _dict['availability_policy'] = self.availability_policy
+ else:
+ _dict['availability_policy'] = self.availability_policy.to_dict()
+ if hasattr(self, 'bandwidth') and self.bandwidth is not None:
+ _dict['bandwidth'] = self.bandwidth
+ if hasattr(self, 'boot_volume_attachment') and self.boot_volume_attachment is not None:
+ if isinstance(self.boot_volume_attachment, dict):
+ _dict['boot_volume_attachment'] = self.boot_volume_attachment
+ else:
+ _dict['boot_volume_attachment'] = self.boot_volume_attachment.to_dict()
+ if hasattr(self, 'catalog_offering') and self.catalog_offering is not None:
+ if isinstance(self.catalog_offering, dict):
+ _dict['catalog_offering'] = self.catalog_offering
+ else:
+ _dict['catalog_offering'] = self.catalog_offering.to_dict()
if hasattr(self, 'created_at') and self.created_at is not None:
_dict['created_at'] = datetime_to_string(self.created_at)
if hasattr(self, 'crn') and self.crn is not None:
_dict['crn'] = self.crn
+ if hasattr(self, 'dedicated_host') and self.dedicated_host is not None:
+ if isinstance(self.dedicated_host, dict):
+ _dict['dedicated_host'] = self.dedicated_host
+ else:
+ _dict['dedicated_host'] = self.dedicated_host.to_dict()
+ if hasattr(self, 'disks') and self.disks is not None:
+ disks_list = []
+ for v in self.disks:
+ if isinstance(v, dict):
+ disks_list.append(v)
+ else:
+ disks_list.append(v.to_dict())
+ _dict['disks'] = disks_list
+ if hasattr(self, 'gpu') and self.gpu is not None:
+ if isinstance(self.gpu, dict):
+ _dict['gpu'] = self.gpu
+ else:
+ _dict['gpu'] = self.gpu.to_dict()
+ if hasattr(self, 'health_reasons') and self.health_reasons is not None:
+ health_reasons_list = []
+ for v in self.health_reasons:
+ if isinstance(v, dict):
+ health_reasons_list.append(v)
+ else:
+ health_reasons_list.append(v.to_dict())
+ _dict['health_reasons'] = health_reasons_list
+ if hasattr(self, 'health_state') and self.health_state is not None:
+ _dict['health_state'] = self.health_state
if hasattr(self, 'href') and self.href is not None:
_dict['href'] = self.href
if hasattr(self, 'id') and self.id is not None:
_dict['id'] = self.id
- if hasattr(self, 'instance_template') and self.instance_template is not None:
- if isinstance(self.instance_template, dict):
- _dict['instance_template'] = self.instance_template
- else:
- _dict['instance_template'] = self.instance_template.to_dict()
- if hasattr(self, 'load_balancer_pool') and self.load_balancer_pool is not None:
- if isinstance(self.load_balancer_pool, dict):
- _dict['load_balancer_pool'] = self.load_balancer_pool
+ if hasattr(self, 'image') and self.image is not None:
+ if isinstance(self.image, dict):
+ _dict['image'] = self.image
else:
- _dict['load_balancer_pool'] = self.load_balancer_pool.to_dict()
- if hasattr(self, 'managers') and self.managers is not None:
- managers_list = []
- for v in self.managers:
+ _dict['image'] = self.image.to_dict()
+ if hasattr(self, 'lifecycle_reasons') and self.lifecycle_reasons is not None:
+ lifecycle_reasons_list = []
+ for v in self.lifecycle_reasons:
if isinstance(v, dict):
- managers_list.append(v)
+ lifecycle_reasons_list.append(v)
else:
- managers_list.append(v.to_dict())
- _dict['managers'] = managers_list
- if hasattr(self, 'membership_count') and self.membership_count is not None:
- _dict['membership_count'] = self.membership_count
+ lifecycle_reasons_list.append(v.to_dict())
+ _dict['lifecycle_reasons'] = lifecycle_reasons_list
+ if hasattr(self, 'lifecycle_state') and self.lifecycle_state is not None:
+ _dict['lifecycle_state'] = self.lifecycle_state
+ if hasattr(self, 'memory') and self.memory is not None:
+ _dict['memory'] = self.memory
+ if hasattr(self, 'metadata_service') and self.metadata_service is not None:
+ if isinstance(self.metadata_service, dict):
+ _dict['metadata_service'] = self.metadata_service
+ else:
+ _dict['metadata_service'] = self.metadata_service.to_dict()
if hasattr(self, 'name') and self.name is not None:
_dict['name'] = self.name
+ if hasattr(self, 'network_attachments') and self.network_attachments is not None:
+ network_attachments_list = []
+ for v in self.network_attachments:
+ if isinstance(v, dict):
+ network_attachments_list.append(v)
+ else:
+ network_attachments_list.append(v.to_dict())
+ _dict['network_attachments'] = network_attachments_list
+ if hasattr(self, 'network_interfaces') and self.network_interfaces is not None:
+ network_interfaces_list = []
+ for v in self.network_interfaces:
+ if isinstance(v, dict):
+ network_interfaces_list.append(v)
+ else:
+ network_interfaces_list.append(v.to_dict())
+ _dict['network_interfaces'] = network_interfaces_list
+ if hasattr(self, 'numa_count') and self.numa_count is not None:
+ _dict['numa_count'] = self.numa_count
+ 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_attachment') and self.primary_network_attachment is not None:
+ if isinstance(self.primary_network_attachment, dict):
+ _dict['primary_network_attachment'] = self.primary_network_attachment
+ else:
+ _dict['primary_network_attachment'] = self.primary_network_attachment.to_dict()
+ if hasattr(self, 'primary_network_interface') and self.primary_network_interface is not None:
+ if isinstance(self.primary_network_interface, dict):
+ _dict['primary_network_interface'] = self.primary_network_interface
+ else:
+ _dict['primary_network_interface'] = self.primary_network_interface.to_dict()
+ if hasattr(self, 'profile') and self.profile is not None:
+ if isinstance(self.profile, dict):
+ _dict['profile'] = self.profile
+ else:
+ _dict['profile'] = self.profile.to_dict()
+ if hasattr(self, 'reservation') and self.reservation is not None:
+ if isinstance(self.reservation, dict):
+ _dict['reservation'] = self.reservation
+ else:
+ _dict['reservation'] = self.reservation.to_dict()
+ if hasattr(self, 'reservation_affinity') and self.reservation_affinity is not None:
+ if isinstance(self.reservation_affinity, dict):
+ _dict['reservation_affinity'] = self.reservation_affinity
+ else:
+ _dict['reservation_affinity'] = self.reservation_affinity.to_dict()
if hasattr(self, 'resource_group') and self.resource_group is not None:
if isinstance(self.resource_group, dict):
_dict['resource_group'] = self.resource_group
else:
_dict['resource_group'] = self.resource_group.to_dict()
+ if hasattr(self, 'resource_type') and self.resource_type is not None:
+ _dict['resource_type'] = self.resource_type
+ if hasattr(self, 'startable') and self.startable is not None:
+ _dict['startable'] = self.startable
if hasattr(self, 'status') and self.status is not None:
_dict['status'] = self.status
- if hasattr(self, 'subnets') and self.subnets is not None:
- subnets_list = []
- for v in self.subnets:
+ if hasattr(self, 'status_reasons') and self.status_reasons is not None:
+ status_reasons_list = []
+ for v in self.status_reasons:
if isinstance(v, dict):
- subnets_list.append(v)
+ status_reasons_list.append(v)
else:
- subnets_list.append(v.to_dict())
- _dict['subnets'] = subnets_list
- if hasattr(self, 'updated_at') and self.updated_at is not None:
- _dict['updated_at'] = datetime_to_string(self.updated_at)
+ status_reasons_list.append(v.to_dict())
+ _dict['status_reasons'] = status_reasons_list
+ if hasattr(self, 'total_network_bandwidth') and self.total_network_bandwidth is not None:
+ _dict['total_network_bandwidth'] = self.total_network_bandwidth
+ if hasattr(self, 'total_volume_bandwidth') and self.total_volume_bandwidth is not None:
+ _dict['total_volume_bandwidth'] = self.total_volume_bandwidth
+ if hasattr(self, 'vcpu') and self.vcpu is not None:
+ if isinstance(self.vcpu, dict):
+ _dict['vcpu'] = self.vcpu
+ else:
+ _dict['vcpu'] = self.vcpu.to_dict()
+ if hasattr(self, 'volume_attachments') and self.volume_attachments is not None:
+ volume_attachments_list = []
+ for v in self.volume_attachments:
+ if isinstance(v, dict):
+ volume_attachments_list.append(v)
+ else:
+ volume_attachments_list.append(v.to_dict())
+ _dict['volume_attachments'] = volume_attachments_list
if hasattr(self, 'vpc') and self.vpc is not None:
if isinstance(self.vpc, dict):
_dict['vpc'] = self.vpc
else:
_dict['vpc'] = self.vpc.to_dict()
+ if hasattr(self, 'zone') and self.zone is not None:
+ if isinstance(self.zone, dict):
+ _dict['zone'] = self.zone
+ else:
+ _dict['zone'] = self.zone.to_dict()
return _dict
def _to_dict(self):
@@ -43903,132 +46183,188 @@ 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 Instance object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceGroup') -> 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: 'InstanceGroup') -> bool:
+ def __ne__(self, other: 'Instance') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
+ class HealthStateEnum(str, Enum):
+ """
+ The health of this resource.
+ - `ok`: No abnormal behavior detected
+ - `degraded`: Experiencing compromised performance, capacity, or connectivity
+ - `faulted`: Completely unreachable, inoperative, or otherwise entirely
+ incapacitated
+ - `inapplicable`: The health state does not apply because of the current lifecycle
+ state. A resource with a lifecycle state of `failed` or `deleting` will have a
+ health state of `inapplicable`. A `pending` resource may also have this state.
+ """
+
+ DEGRADED = 'degraded'
+ FAULTED = 'faulted'
+ INAPPLICABLE = 'inapplicable'
+ OK = 'ok'
+
+
+ class LifecycleStateEnum(str, Enum):
+ """
+ The lifecycle state of the virtual server instance.
+ """
+
+ DELETING = 'deleting'
+ FAILED = 'failed'
+ PENDING = 'pending'
+ STABLE = 'stable'
+ SUSPENDED = 'suspended'
+ UPDATING = 'updating'
+ WAITING = 'waiting'
+
+
+ class ResourceTypeEnum(str, Enum):
+ """
+ The resource type.
+ """
+
+ INSTANCE = 'instance'
+
+
class StatusEnum(str, Enum):
"""
- 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.
+ The status of the virtual server instance.
+ The enumerated values for this property will expand in the future. When processing
+ this property, check for and log unknown values. Optionally halt processing and
+ surface the error, or bypass the instance on which the unexpected property value
+ was encountered.
"""
DELETING = 'deleting'
- HEALTHY = 'healthy'
- SCALING = 'scaling'
- UNHEALTHY = 'unhealthy'
+ FAILED = 'failed'
+ PENDING = 'pending'
+ RESTARTING = 'restarting'
+ RUNNING = 'running'
+ STARTING = 'starting'
+ STOPPED = 'stopped'
+ STOPPING = 'stopping'
-class InstanceGroupCollection:
+class InstanceAction:
"""
- InstanceGroupCollection.
+ InstanceAction.
- :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.
+ :param datetime completed_at: (optional) Deprecated: The date and time that the
+ action was completed.
+ :param datetime created_at: The date and time that the action was created.
+ :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 str href: Deprecated: The URL for this instance action.
+ :param str id: Deprecated: The identifier for this instance action.
+ :param datetime started_at: (optional) Deprecated: The date and time that the
+ action was started.
+ :param str status: Deprecated: The current status of this action.
+ :param str type: The type of action.
"""
def __init__(
self,
- first: 'InstanceGroupCollectionFirst',
- instance_groups: List['InstanceGroup'],
- limit: int,
- total_count: int,
+ created_at: datetime,
+ href: str,
+ id: str,
+ status: str,
+ type: str,
*,
- next: 'InstanceGroupCollectionNext' = None,
+ completed_at: Optional[datetime] = None,
+ force: Optional[bool] = None,
+ started_at: Optional[datetime] = None,
) -> None:
"""
- Initialize a InstanceGroupCollection object.
+ Initialize a InstanceAction 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 datetime created_at: The date and time that the action was created.
+ :param str href: Deprecated: The URL for this instance action.
+ :param str id: Deprecated: The identifier for this instance action.
+ :param str status: Deprecated: The current status of this action.
+ :param str type: The type of action.
+ :param datetime completed_at: (optional) Deprecated: The date and time that
+ the action was completed.
+ :param bool force: (optional) If set to true, the action will be forced
+ immediately, and all queued actions deleted. Ignored for the start action.
+ :param datetime started_at: (optional) Deprecated: The date and time that
+ the action was started.
"""
- self.first = first
- self.instance_groups = instance_groups
- self.limit = limit
- self.next = next
- self.total_count = total_count
+ self.completed_at = completed_at
+ self.created_at = created_at
+ self.force = force
+ self.href = href
+ self.id = id
+ self.started_at = started_at
+ self.status = status
+ self.type = type
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstanceGroupCollection':
- """Initialize a InstanceGroupCollection object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceAction':
+ """Initialize a InstanceAction object from a json dictionary."""
args = {}
- if 'first' in _dict:
- args['first'] = InstanceGroupCollectionFirst.from_dict(_dict.get('first'))
+ if (completed_at := _dict.get('completed_at')) is not None:
+ args['completed_at'] = string_to_datetime(completed_at)
+ if (created_at := _dict.get('created_at')) is not None:
+ args['created_at'] = string_to_datetime(created_at)
else:
- raise ValueError('Required property \'first\' not present in InstanceGroupCollection JSON')
- if 'instance_groups' in _dict:
- args['instance_groups'] = [InstanceGroup.from_dict(v) for v in _dict.get('instance_groups')]
+ raise ValueError('Required property \'created_at\' not present in InstanceAction JSON')
+ if (force := _dict.get('force')) is not None:
+ args['force'] = force
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'instance_groups\' not present in InstanceGroupCollection JSON')
- if 'limit' in _dict:
- args['limit'] = _dict.get('limit')
+ raise ValueError('Required property \'href\' not present in InstanceAction JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
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 \'id\' not present in InstanceAction JSON')
+ if (started_at := _dict.get('started_at')) is not None:
+ args['started_at'] = string_to_datetime(started_at)
+ if (status := _dict.get('status')) is not None:
+ args['status'] = status
else:
- raise ValueError('Required property \'total_count\' not present in InstanceGroupCollection JSON')
+ raise ValueError('Required property \'status\' not present in InstanceAction JSON')
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
+ else:
+ raise ValueError('Required property \'type\' not present in InstanceAction JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceGroupCollection 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, 'first') and self.first is not None:
- if isinstance(self.first, dict):
- _dict['first'] = self.first
- else:
- _dict['first'] = self.first.to_dict()
- if hasattr(self, 'instance_groups') and self.instance_groups is not None:
- instance_groups_list = []
- for v in self.instance_groups:
- if isinstance(v, dict):
- instance_groups_list.append(v)
- else:
- instance_groups_list.append(v.to_dict())
- _dict['instance_groups'] = instance_groups_list
- if hasattr(self, 'limit') and self.limit is not None:
- _dict['limit'] = self.limit
- if hasattr(self, 'next') and self.next is not None:
- if isinstance(self.next, dict):
- _dict['next'] = self.next
- else:
- _dict['next'] = self.next.to_dict()
- if hasattr(self, 'total_count') and self.total_count is not None:
- _dict['total_count'] = self.total_count
+ if hasattr(self, 'completed_at') and self.completed_at is not None:
+ _dict['completed_at'] = datetime_to_string(self.completed_at)
+ if hasattr(self, 'created_at') and self.created_at is not None:
+ _dict['created_at'] = datetime_to_string(self.created_at)
+ if hasattr(self, 'force') and self.force is not None:
+ _dict['force'] = self.force
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
+ if hasattr(self, 'id') and self.id is not None:
+ _dict['id'] = self.id
+ if hasattr(self, 'started_at') and self.started_at is not None:
+ _dict['started_at'] = datetime_to_string(self.started_at)
+ if hasattr(self, 'status') and self.status is not None:
+ _dict['status'] = self.status
+ if hasattr(self, 'type') and self.type is not None:
+ _dict['type'] = self.type
return _dict
def _to_dict(self):
@@ -44036,58 +46372,95 @@ 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 InstanceAction object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceGroupCollection') -> 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: 'InstanceGroupCollection') -> bool:
+ def __ne__(self, other: 'InstanceAction') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
+ class StatusEnum(str, Enum):
+ """
+ The current status of this action.
+ """
+
+ COMPLETED = 'completed'
+ FAILED = 'failed'
+ PENDING = 'pending'
+ RUNNING = 'running'
+
-class InstanceGroupCollectionFirst:
+ class TypeEnum(str, Enum):
+ """
+ The type of action.
+ """
+
+ REBOOT = 'reboot'
+ START = 'start'
+ STOP = 'stop'
+
+
+
+class InstanceAvailabilityPolicy:
"""
- A link to the first page of resources.
+ InstanceAvailabilityPolicy.
- :attr str href: The URL for a page of resources.
+ :param str host_failure: The action to perform if the compute host experiences a
+ failure.
+ - `restart`: Automatically restart the virtual server instance after host
+ failure
+ - `stop`: Leave the virtual server instance stopped after host failure
+ The enumerated values for this property are expected to expand in the future.
+ When processing this property, check for and log unknown values. Optionally halt
+ processing and surface the error, or bypass the instance on which the unexpected
+ property value was encountered.
"""
def __init__(
self,
- href: str,
+ host_failure: str,
) -> None:
"""
- Initialize a InstanceGroupCollectionFirst object.
+ Initialize a InstanceAvailabilityPolicy object.
- :param str href: The URL for a page of resources.
+ :param str host_failure: The action to perform if the compute host
+ experiences a failure.
+ - `restart`: Automatically restart the virtual server instance after host
+ failure
+ - `stop`: Leave the virtual server instance stopped after host failure
+ The enumerated values for this property are expected to expand in the
+ future. When processing this property, check for and log unknown values.
+ Optionally halt processing and surface the error, or bypass the instance on
+ which the unexpected property value was encountered.
"""
- self.href = href
+ self.host_failure = host_failure
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstanceGroupCollectionFirst':
- """Initialize a InstanceGroupCollectionFirst object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceAvailabilityPolicy':
+ """Initialize a InstanceAvailabilityPolicy object from a json dictionary."""
args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ if (host_failure := _dict.get('host_failure')) is not None:
+ args['host_failure'] = host_failure
else:
- raise ValueError('Required property \'href\' not present in InstanceGroupCollectionFirst JSON')
+ raise ValueError('Required property \'host_failure\' not present in InstanceAvailabilityPolicy JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceGroupCollectionFirst object from a json dictionary."""
+ """Initialize a InstanceAvailabilityPolicy object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'href') and self.href is not None:
- _dict['href'] = self.href
+ if hasattr(self, 'host_failure') and self.host_failure is not None:
+ _dict['host_failure'] = self.host_failure
return _dict
def _to_dict(self):
@@ -44095,59 +46468,80 @@ 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 InstanceAvailabilityPolicy object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceGroupCollectionFirst') -> bool:
+ def __eq__(self, other: 'InstanceAvailabilityPolicy') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'InstanceGroupCollectionFirst') -> bool:
+ def __ne__(self, other: 'InstanceAvailabilityPolicy') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
+ class HostFailureEnum(str, Enum):
+ """
+ The action to perform if the compute host experiences a failure.
+ - `restart`: Automatically restart the virtual server instance after host failure
+ - `stop`: Leave the virtual server instance stopped after host failure
+ The enumerated values for this property are expected to expand in the future. When
+ processing this property, check for and log unknown values. Optionally halt
+ processing and surface the error, or bypass the instance on which the unexpected
+ property value was encountered.
+ """
+
+ RESTART = 'restart'
+ STOP = 'stop'
-class InstanceGroupCollectionNext:
+
+
+class InstanceAvailabilityPolicyPatch:
"""
- A link to the next page of resources. This property is present for all pages except
- the last page.
+ InstanceAvailabilityPolicyPatch.
- :attr str href: The URL for a page of resources.
+ :param str host_failure: (optional) The action to perform if the compute host
+ experiences a failure.
+ - `restart`: Automatically restart the virtual server instance after host
+ failure
+ - `stop`: Leave the virtual server instance stopped after host failure.
"""
def __init__(
self,
- href: str,
+ *,
+ host_failure: Optional[str] = None,
) -> None:
"""
- Initialize a InstanceGroupCollectionNext object.
+ Initialize a InstanceAvailabilityPolicyPatch object.
- :param str href: The URL for a page of resources.
+ :param str host_failure: (optional) The action to perform if the compute
+ host experiences a failure.
+ - `restart`: Automatically restart the virtual server instance after host
+ failure
+ - `stop`: Leave the virtual server instance stopped after host failure.
"""
- self.href = href
+ self.host_failure = host_failure
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstanceGroupCollectionNext':
- """Initialize a InstanceGroupCollectionNext object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceAvailabilityPolicyPatch':
+ """Initialize a InstanceAvailabilityPolicyPatch 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')
+ if (host_failure := _dict.get('host_failure')) is not None:
+ args['host_failure'] = host_failure
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceGroupCollectionNext object from a json dictionary."""
+ """Initialize a InstanceAvailabilityPolicyPatch object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'href') and self.href is not None:
- _dict['href'] = self.href
+ if hasattr(self, 'host_failure') and self.host_failure is not None:
+ _dict['host_failure'] = self.host_failure
return _dict
def _to_dict(self):
@@ -44155,206 +46549,76 @@ 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 InstanceAvailabilityPolicyPatch object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceGroupCollectionNext') -> bool:
+ def __eq__(self, other: 'InstanceAvailabilityPolicyPatch') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'InstanceGroupCollectionNext') -> bool:
+ def __ne__(self, other: 'InstanceAvailabilityPolicyPatch') -> 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 name for this instance group manager. The name is unique
- across all managers for the instance group.
- :attr datetime updated_at: The date and time that the instance group manager was
- updated.
- """
-
- def __init__(
- self,
- created_at: datetime,
- href: str,
- id: str,
- management_enabled: bool,
- name: str,
- updated_at: datetime,
- ) -> None:
- """
- Initialize a InstanceGroupManager object.
-
- :param datetime created_at: The date and time that the instance group
- manager was created.
- :param str href: The URL for this instance group manager.
- :param str id: The unique identifier for this instance group manager.
- :param bool management_enabled: Indicates whether this manager will control
- the instance group.
- :param str name: The name for this instance group manager. The name is
- unique across all managers for the instance group.
- :param datetime updated_at: The date and time that the instance group
- manager was updated.
- """
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['InstanceGroupManagerAutoScale', 'InstanceGroupManagerScheduled'])
- )
- raise Exception(msg)
-
-
-class InstanceGroupManagerAction:
- """
- InstanceGroupManagerAction.
-
- :attr bool auto_delete: Indicates whether this scheduled action will be
- automatically deleted after it has completed and `auto_delete_timeout` hours
- have passed. At present, this is always
- `true`, but may be modifiable in the future.
- :attr int auto_delete_timeout: If `auto_delete` is `true`, and this scheduled
- action has finished, the hours after which it will be automatically deleted. If
- the value is `0`, the action will be deleted once it has finished. This value
- may be modifiable in the future.
- :attr datetime created_at: The date and time that the instance group manager
- action was created.
- :attr str href: The URL for this instance group manager action.
- :attr str id: The unique identifier for this instance group manager action.
- :attr str name: The name for this instance group manager action. The name is
- unique across all actions for the instance group manager.
- :attr str resource_type: The resource type.
- :attr str status: The status of the instance group action
- - `active`: Action is ready to be run
- - `completed`: Action was completed successfully
- - `failed`: Action could not be completed successfully
- - `incompatible`: Action parameters are not compatible with the group or manager
- - `omitted`: Action was not applied because this action's manager was disabled.
- :attr datetime updated_at: The date and time that the instance group manager
- action was updated.
- """
-
- def __init__(
- self,
- auto_delete: bool,
- auto_delete_timeout: int,
- created_at: datetime,
- href: str,
- id: str,
- name: str,
- resource_type: str,
- status: str,
- updated_at: datetime,
- ) -> None:
- """
- Initialize a InstanceGroupManagerAction object.
-
- :param bool auto_delete: Indicates whether this scheduled action will be
- automatically deleted after it has completed and `auto_delete_timeout`
- hours have passed. At present, this is always
- `true`, but may be modifiable in the future.
- :param int auto_delete_timeout: If `auto_delete` is `true`, and this
- scheduled action has finished, the hours after which it will be
- automatically deleted. If the value is `0`, the action will be deleted once
- it has finished. This value may be modifiable in the future.
- :param datetime created_at: The date and time that the instance group
- manager action was created.
- :param str href: The URL for this instance group manager action.
- :param str id: The unique identifier for this instance group manager
- action.
- :param str name: The name for this instance group manager action. The name
- is unique across all actions for the instance group manager.
- :param str resource_type: The resource type.
- :param str status: The status of the instance group action
- - `active`: Action is ready to be run
- - `completed`: Action was completed successfully
- - `failed`: Action could not be completed successfully
- - `incompatible`: Action parameters are not compatible with the group or
- manager
- - `omitted`: Action was not applied because this action's manager was
- disabled.
- :param datetime updated_at: The date and time that the instance group
- manager action was updated.
- """
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['InstanceGroupManagerActionScheduledAction'])
- )
- raise Exception(msg)
-
- class ResourceTypeEnum(str, Enum):
- """
- The resource type.
- """
-
- INSTANCE_GROUP_MANAGER_ACTION = 'instance_group_manager_action'
-
-
- class StatusEnum(str, Enum):
+ class HostFailureEnum(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.
+ The action to perform if the compute host experiences a failure.
+ - `restart`: Automatically restart the virtual server instance after host failure
+ - `stop`: Leave the virtual server instance stopped after host failure.
"""
- ACTIVE = 'active'
- COMPLETED = 'completed'
- FAILED = 'failed'
- INCOMPATIBLE = 'incompatible'
- OMITTED = 'omitted'
+ RESTART = 'restart'
+ STOP = 'stop'
-class InstanceGroupManagerActionGroupPatch:
+class InstanceAvailabilityPolicyPrototype:
"""
- InstanceGroupManagerActionGroupPatch.
+ InstanceAvailabilityPolicyPrototype.
- :attr int membership_count: (optional) The desired number of instance group
- members at the scheduled time.
+ :param str host_failure: (optional) The action to perform if the compute host
+ experiences a failure.
+ - `restart`: Automatically restart the virtual server instance after host
+ failure
+ - `stop`: Leave the virtual server instance stopped after host failure.
"""
def __init__(
self,
*,
- membership_count: int = None,
+ host_failure: Optional[str] = None,
) -> None:
"""
- Initialize a InstanceGroupManagerActionGroupPatch object.
+ Initialize a InstanceAvailabilityPolicyPrototype object.
- :param int membership_count: (optional) The desired number of instance
- group members at the scheduled time.
+ :param str host_failure: (optional) The action to perform if the compute
+ host experiences a failure.
+ - `restart`: Automatically restart the virtual server instance after host
+ failure
+ - `stop`: Leave the virtual server instance stopped after host failure.
"""
- self.membership_count = membership_count
+ self.host_failure = host_failure
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerActionGroupPatch':
- """Initialize a InstanceGroupManagerActionGroupPatch object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceAvailabilityPolicyPrototype':
+ """Initialize a InstanceAvailabilityPolicyPrototype object from a json dictionary."""
args = {}
- if 'membership_count' in _dict:
- args['membership_count'] = _dict.get('membership_count')
+ if (host_failure := _dict.get('host_failure')) is not None:
+ args['host_failure'] = host_failure
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceGroupManagerActionGroupPatch object from a json dictionary."""
+ """Initialize a InstanceAvailabilityPolicyPrototype object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'membership_count') and self.membership_count is not None:
- _dict['membership_count'] = self.membership_count
+ if hasattr(self, 'host_failure') and self.host_failure is not None:
+ _dict['host_failure'] = self.host_failure
return _dict
def _to_dict(self):
@@ -44362,69 +46626,88 @@ 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 InstanceAvailabilityPolicyPrototype object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceGroupManagerActionGroupPatch') -> bool:
+ def __eq__(self, other: 'InstanceAvailabilityPolicyPrototype') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'InstanceGroupManagerActionGroupPatch') -> bool:
+ def __ne__(self, other: 'InstanceAvailabilityPolicyPrototype') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
+ class HostFailureEnum(str, Enum):
+ """
+ The action to perform if the compute host experiences a failure.
+ - `restart`: Automatically restart the virtual server instance after host failure
+ - `stop`: Leave the virtual server instance stopped after host failure.
+ """
-class InstanceGroupManagerActionManagerPatch:
+ RESTART = 'restart'
+ STOP = 'stop'
+
+
+
+class InstanceCatalogOffering:
"""
- InstanceGroupManagerActionManagerPatch.
+ InstanceCatalogOffering.
- :attr int max_membership_count: (optional) The desired maximum number of
- instance group members at the scheduled time.
- :attr int min_membership_count: (optional) The desired minimum number of
- instance group members at the scheduled time.
+ :param CatalogOfferingVersionReference version: The catalog offering version
+ this virtual server instance was provisioned from.
+ The catalog offering version is not managed by the IBM VPC service, and may no
+ longer
+ exist, or may refer to a different image CRN than the `image.crn` for this
+ virtual
+ server instance. However, all images associated with a catalog offering version
+ will
+ have the same checksum, and therefore will have the same data.
"""
def __init__(
self,
- *,
- max_membership_count: int = None,
- min_membership_count: int = None,
+ version: 'CatalogOfferingVersionReference',
) -> None:
"""
- Initialize a InstanceGroupManagerActionManagerPatch object.
+ Initialize a InstanceCatalogOffering object.
- :param int max_membership_count: (optional) The desired maximum number of
- instance group members at the scheduled time.
- :param int min_membership_count: (optional) The desired minimum number of
- instance group members at the scheduled time.
+ :param CatalogOfferingVersionReference version: The catalog offering
+ version this virtual server instance was provisioned from.
+ The catalog offering version is not managed by the IBM VPC service, and may
+ no longer
+ exist, or may refer to a different image CRN than the `image.crn` for this
+ virtual
+ server instance. However, all images associated with a catalog offering
+ version will
+ have the same checksum, and therefore will have the same data.
"""
- self.max_membership_count = max_membership_count
- self.min_membership_count = min_membership_count
+ self.version = version
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerActionManagerPatch':
- """Initialize a InstanceGroupManagerActionManagerPatch object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceCatalogOffering':
+ """Initialize a InstanceCatalogOffering 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 (version := _dict.get('version')) is not None:
+ args['version'] = CatalogOfferingVersionReference.from_dict(version)
+ else:
+ raise ValueError('Required property \'version\' not present in InstanceCatalogOffering JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceGroupManagerActionManagerPatch object from a json dictionary."""
+ """Initialize a InstanceCatalogOffering object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, '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, 'version') and self.version is not None:
+ if isinstance(self.version, dict):
+ _dict['version'] = self.version
+ else:
+ _dict['version'] = self.version.to_dict()
return _dict
def _to_dict(self):
@@ -44432,103 +46715,140 @@ 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 InstanceCatalogOffering object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceGroupManagerActionManagerPatch') -> bool:
+ def __eq__(self, other: 'InstanceCatalogOffering') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'InstanceGroupManagerActionManagerPatch') -> bool:
+ def __ne__(self, other: 'InstanceCatalogOffering') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class InstanceGroupManagerActionPatch:
+class InstanceCatalogOfferingPrototype:
"""
- InstanceGroupManagerActionPatch.
+ The [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user)
+ offering or offering version to use when provisioning this virtual server instance.
+ If an offering is specified, the latest version of that offering will be used.
+ The specified offering or offering version may be in a different account in the same
+ [enterprise](https://cloud.ibm.com/docs/account?topic=account-what-is-enterprise),
+ subject to IAM policies.
- :attr str cron_spec: (optional) The cron specification for a recurring scheduled
- action. Actions can be applied a maximum of one time within a 5 min period.
- :attr InstanceGroupManagerActionGroupPatch group: (optional)
- :attr InstanceGroupManagerActionManagerPatch manager: (optional)
- :attr str name: (optional) The name for this instance group manager action. The
- name must not be used by another action for the instance group manager.
- :attr datetime run_at: (optional) The date and time the scheduled action will
- run.
"""
def __init__(
self,
+ ) -> None:
+ """
+ Initialize a InstanceCatalogOfferingPrototype object.
+
+ """
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['InstanceCatalogOfferingPrototypeCatalogOfferingByOffering', 'InstanceCatalogOfferingPrototypeCatalogOfferingByVersion'])
+ )
+ raise Exception(msg)
+
+
+class InstanceCollection:
+ """
+ InstanceCollection.
+
+ :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 InstanceCollectionNext next: (optional) A link to the next page of
+ resources. This property is present for all pages
+ except the last page.
+ :param int total_count: The total number of resources across all pages.
+ """
+
+ def __init__(
+ self,
+ first: 'InstanceCollectionFirst',
+ instances: List['Instance'],
+ limit: int,
+ total_count: int,
*,
- cron_spec: str = None,
- group: 'InstanceGroupManagerActionGroupPatch' = None,
- manager: 'InstanceGroupManagerActionManagerPatch' = None,
- name: str = None,
- run_at: datetime = None,
+ next: Optional['InstanceCollectionNext'] = None,
) -> None:
"""
- Initialize a InstanceGroupManagerActionPatch object.
+ Initialize a InstanceCollection object.
- :param str cron_spec: (optional) The cron specification for a recurring
- scheduled action. Actions can be applied a maximum of one time within a 5
- min period.
- :param InstanceGroupManagerActionGroupPatch group: (optional)
- :param InstanceGroupManagerActionManagerPatch manager: (optional)
- :param str name: (optional) The name for this instance group manager
- action. The name must not be used by another action for the instance group
- manager.
- :param datetime run_at: (optional) The date and time the scheduled action
- will run.
+ :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.
"""
- self.cron_spec = cron_spec
- self.group = group
- self.manager = manager
- self.name = name
- self.run_at = run_at
+ self.first = first
+ self.instances = instances
+ self.limit = limit
+ self.next = next
+ self.total_count = total_count
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerActionPatch':
- """Initialize a InstanceGroupManagerActionPatch object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceCollection':
+ """Initialize a InstanceCollection 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 (first := _dict.get('first')) is not None:
+ args['first'] = InstanceCollectionFirst.from_dict(first)
+ else:
+ raise ValueError('Required property \'first\' not present in InstanceCollection JSON')
+ if (instances := _dict.get('instances')) is not None:
+ args['instances'] = [Instance.from_dict(v) for v in instances]
+ else:
+ raise ValueError('Required property \'instances\' not present in InstanceCollection JSON')
+ if (limit := _dict.get('limit')) is not None:
+ args['limit'] = limit
+ else:
+ raise ValueError('Required property \'limit\' not present in InstanceCollection JSON')
+ if (next := _dict.get('next')) is not None:
+ args['next'] = InstanceCollectionNext.from_dict(next)
+ if (total_count := _dict.get('total_count')) is not None:
+ args['total_count'] = total_count
+ else:
+ raise ValueError('Required property \'total_count\' not present in InstanceCollection JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceGroupManagerActionPatch object from a json dictionary."""
+ """Initialize a InstanceCollection object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'cron_spec') and self.cron_spec is not None:
- _dict['cron_spec'] = self.cron_spec
- if hasattr(self, 'group') and self.group is not None:
- if isinstance(self.group, dict):
- _dict['group'] = self.group
+ if hasattr(self, 'first') and self.first is not None:
+ if isinstance(self.first, dict):
+ _dict['first'] = self.first
else:
- _dict['group'] = self.group.to_dict()
- if hasattr(self, 'manager') and self.manager is not None:
- if isinstance(self.manager, dict):
- _dict['manager'] = self.manager
+ _dict['first'] = self.first.to_dict()
+ if hasattr(self, 'instances') and self.instances is not None:
+ instances_list = []
+ for v in self.instances:
+ if isinstance(v, dict):
+ instances_list.append(v)
+ else:
+ instances_list.append(v.to_dict())
+ _dict['instances'] = instances_list
+ if hasattr(self, 'limit') and self.limit is not None:
+ _dict['limit'] = self.limit
+ if hasattr(self, 'next') and self.next is not None:
+ if isinstance(self.next, dict):
+ _dict['next'] = self.next
else:
- _dict['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)
+ _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):
@@ -44536,136 +46856,58 @@ 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 InstanceCollection object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceGroupManagerActionPatch') -> 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: 'InstanceGroupManagerActionPatch') -> bool:
+ def __ne__(self, other: 'InstanceCollection') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class InstanceGroupManagerActionPrototype:
- """
- InstanceGroupManagerActionPrototype.
-
- :attr str name: (optional) The name for this instance group manager action. The
- name must not be used by another action for the instance group manager. If
- unspecified, the name will be a hyphenated list of randomly-selected words.
- """
-
- def __init__(
- self,
- *,
- name: str = None,
- ) -> None:
- """
- Initialize a InstanceGroupManagerActionPrototype object.
-
- :param str name: (optional) The name for this instance group manager
- action. The name must not be used by another action for the instance group
- manager. If unspecified, the name will be a hyphenated list of
- randomly-selected words.
- """
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['InstanceGroupManagerActionPrototypeScheduledActionPrototype'])
- )
- raise Exception(msg)
-
-
-class InstanceGroupManagerActionReference:
+class InstanceCollectionFirst:
"""
- InstanceGroupManagerActionReference.
+ A link to the first page of resources.
- :attr InstanceGroupManagerActionReferenceDeleted deleted: (optional) If present,
- this property indicates the referenced resource has been deleted, and provides
- some supplementary information.
- :attr str href: The URL for this instance group manager action.
- :attr str id: The unique identifier for this instance group manager action.
- :attr str name: The name for this instance group manager action. The name is
- unique across all actions for the instance group manager.
- :attr str resource_type: The resource type.
+ :param str href: The URL for a page of resources.
"""
def __init__(
self,
href: str,
- id: str,
- name: str,
- resource_type: str,
- *,
- deleted: 'InstanceGroupManagerActionReferenceDeleted' = None,
) -> None:
"""
- Initialize a InstanceGroupManagerActionReference object.
+ Initialize a InstanceCollectionFirst object.
- :param str href: The URL for this instance group manager action.
- :param str id: The unique identifier for this instance group manager
- action.
- :param str name: The name for this instance group manager action. The name
- is unique across all actions for the instance group manager.
- :param str resource_type: The resource type.
- :param InstanceGroupManagerActionReferenceDeleted deleted: (optional) If
- present, this property indicates the referenced resource has been deleted,
- and provides
- some supplementary information.
+ :param str 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) -> 'InstanceGroupManagerActionReference':
- """Initialize a InstanceGroupManagerActionReference object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceCollectionFirst':
+ """Initialize a InstanceCollectionFirst 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')
- else:
- raise ValueError('Required property \'name\' not present in InstanceGroupManagerActionReference JSON')
- if 'resource_type' in _dict:
- args['resource_type'] = _dict.get('resource_type')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'resource_type\' not present in InstanceGroupManagerActionReference JSON')
+ raise ValueError('Required property \'href\' not present in InstanceCollectionFirst JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceGroupManagerActionReference object from a json dictionary."""
+ """Initialize a InstanceCollectionFirst object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'deleted') and self.deleted is not None:
- if isinstance(self.deleted, dict):
- _dict['deleted'] = self.deleted
- else:
- _dict['deleted'] = self.deleted.to_dict()
if hasattr(self, 'href') and self.href is not None:
_dict['href'] = self.href
- if hasattr(self, 'id') and self.id is not None:
- _dict['id'] = self.id
- if hasattr(self, 'name') and self.name is not None:
- _dict['name'] = self.name
- if hasattr(self, 'resource_type') and self.resource_type is not None:
- _dict['resource_type'] = self.resource_type
return _dict
def _to_dict(self):
@@ -44673,67 +46915,59 @@ 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 InstanceCollectionFirst object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceGroupManagerActionReference') -> 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: 'InstanceGroupManagerActionReference') -> bool:
+ def __ne__(self, other: 'InstanceCollectionFirst') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class ResourceTypeEnum(str, Enum):
- """
- The resource type.
- """
-
- INSTANCE_GROUP_MANAGER_ACTION = 'instance_group_manager_action'
-
-
-class InstanceGroupManagerActionReferenceDeleted:
+class InstanceCollectionNext:
"""
- 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.
+ :param str href: The URL for a page of resources.
"""
def __init__(
self,
- more_info: str,
+ href: str,
) -> None:
"""
- Initialize a InstanceGroupManagerActionReferenceDeleted object.
+ Initialize a InstanceCollectionNext 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) -> 'InstanceGroupManagerActionReferenceDeleted':
- """Initialize a InstanceGroupManagerActionReferenceDeleted object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceCollectionNext':
+ """Initialize a InstanceCollectionNext object from a json dictionary."""
args = {}
- if 'more_info' in _dict:
- args['more_info'] = _dict.get('more_info')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'more_info\' not present in InstanceGroupManagerActionReferenceDeleted JSON')
+ raise ValueError('Required property \'href\' not present in InstanceCollectionNext JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceGroupManagerActionReferenceDeleted object from a json dictionary."""
+ """Initialize a InstanceCollectionNext object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, '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):
@@ -44741,119 +46975,118 @@ 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 InstanceCollectionNext object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceGroupManagerActionReferenceDeleted') -> 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: 'InstanceGroupManagerActionReferenceDeleted') -> bool:
+ def __ne__(self, other: 'InstanceCollectionNext') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class InstanceGroupManagerActionsCollection:
+class InstanceConsoleAccessToken:
"""
- InstanceGroupManagerActionsCollection.
+ The instance console access token information.
- :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.
+ :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.
"""
def __init__(
self,
- actions: List['InstanceGroupManagerAction'],
- first: 'InstanceGroupManagerActionsCollectionFirst',
- limit: int,
- total_count: int,
- *,
- next: 'InstanceGroupManagerActionsCollectionNext' = None,
+ access_token: str,
+ console_type: str,
+ created_at: datetime,
+ expires_at: datetime,
+ force: bool,
+ href: str,
) -> None:
"""
- Initialize a InstanceGroupManagerActionsCollection object.
+ Initialize a InstanceConsoleAccessToken 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 access_token: A URL safe single-use token used to access the
+ console WebSocket.
+ :param str console_type: The instance console type for which this token may
+ be used.
+ :param datetime created_at: The date and time that the access token was
+ created.
+ :param datetime expires_at: The date and time that the access token will
+ expire.
+ :param bool force: Indicates whether to disconnect an existing serial
+ console session as the serial console cannot be shared. This has no effect
+ on VNC consoles.
+ :param str href: The URL to access this instance console.
"""
- self.actions = actions
- self.first = first
- self.limit = limit
- self.next = next
- self.total_count = total_count
+ 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) -> 'InstanceGroupManagerActionsCollection':
- """Initialize a InstanceGroupManagerActionsCollection object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceConsoleAccessToken':
+ """Initialize a InstanceConsoleAccessToken object from a json dictionary."""
args = {}
- if 'actions' in _dict:
- args['actions'] = _dict.get('actions')
+ if (access_token := _dict.get('access_token')) is not None:
+ args['access_token'] = access_token
else:
- raise ValueError('Required property \'actions\' not present in InstanceGroupManagerActionsCollection JSON')
- if 'first' in _dict:
- args['first'] = InstanceGroupManagerActionsCollectionFirst.from_dict(_dict.get('first'))
+ raise ValueError('Required property \'access_token\' not present in InstanceConsoleAccessToken JSON')
+ if (console_type := _dict.get('console_type')) is not None:
+ args['console_type'] = console_type
else:
- raise ValueError('Required property \'first\' not present in InstanceGroupManagerActionsCollection JSON')
- if 'limit' in _dict:
- args['limit'] = _dict.get('limit')
+ raise ValueError('Required property \'console_type\' not present in InstanceConsoleAccessToken JSON')
+ if (created_at := _dict.get('created_at')) is not None:
+ args['created_at'] = string_to_datetime(created_at)
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 \'created_at\' not present in InstanceConsoleAccessToken JSON')
+ if (expires_at := _dict.get('expires_at')) is not None:
+ args['expires_at'] = string_to_datetime(expires_at)
else:
- raise ValueError('Required property \'total_count\' not present in InstanceGroupManagerActionsCollection JSON')
+ raise ValueError('Required property \'expires_at\' not present in InstanceConsoleAccessToken JSON')
+ if (force := _dict.get('force')) is not None:
+ args['force'] = force
+ else:
+ raise ValueError('Required property \'force\' not present in InstanceConsoleAccessToken JSON')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
+ else:
+ raise ValueError('Required property \'href\' not present in InstanceConsoleAccessToken JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceGroupManagerActionsCollection 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, 'actions') and self.actions is not None:
- actions_list = []
- for v in self.actions:
- if isinstance(v, dict):
- actions_list.append(v)
- else:
- actions_list.append(v.to_dict())
- _dict['actions'] = actions_list
- if hasattr(self, 'first') and self.first is not None:
- if isinstance(self.first, dict):
- _dict['first'] = self.first
- else:
- _dict['first'] = self.first.to_dict()
- if hasattr(self, 'limit') and self.limit is not None:
- _dict['limit'] = self.limit
- if hasattr(self, 'next') and self.next is not None:
- if isinstance(self.next, dict):
- _dict['next'] = self.next
- else:
- _dict['next'] = self.next.to_dict()
- if hasattr(self, 'total_count') and self.total_count is not None:
- _dict['total_count'] = self.total_count
+ if hasattr(self, '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):
@@ -44861,58 +47094,88 @@ 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 InstanceConsoleAccessToken object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceGroupManagerActionsCollection') -> 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: 'InstanceGroupManagerActionsCollection') -> bool:
+ def __ne__(self, other: 'InstanceConsoleAccessToken') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
+ class ConsoleTypeEnum(str, Enum):
+ """
+ The instance console type for which this token may be used.
+ """
-class InstanceGroupManagerActionsCollectionFirst:
+ SERIAL = 'serial'
+ VNC = 'vnc'
+
+
+
+class InstanceDefaultTrustedProfilePrototype:
"""
- A link to the first page of resources.
+ InstanceDefaultTrustedProfilePrototype.
- :attr str href: The URL for a page of resources.
+ :param bool auto_link: (optional) If set to `true`, the system will create a
+ link to the specified `target` trusted profile during instance creation.
+ Regardless of whether a link is created by the system or manually using the IAM
+ Identity service, it will be automatically deleted when the instance is deleted.
+ :param TrustedProfileIdentity target: The default IAM trusted profile to use for
+ this virtual server instance.
"""
def __init__(
self,
- href: str,
+ target: 'TrustedProfileIdentity',
+ *,
+ auto_link: Optional[bool] = None,
) -> None:
"""
- Initialize a InstanceGroupManagerActionsCollectionFirst object.
+ Initialize a InstanceDefaultTrustedProfilePrototype object.
- :param str href: The URL for a page of resources.
+ :param TrustedProfileIdentity target: The default IAM trusted profile to
+ use for this virtual server instance.
+ :param bool auto_link: (optional) If set to `true`, the system will create
+ a link to the specified `target` trusted profile during instance creation.
+ Regardless of whether a link is created by the system or manually using the
+ IAM Identity service, it will be automatically deleted when the instance is
+ deleted.
"""
- self.href = href
+ self.auto_link = auto_link
+ self.target = target
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerActionsCollectionFirst':
- """Initialize a InstanceGroupManagerActionsCollectionFirst object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceDefaultTrustedProfilePrototype':
+ """Initialize a InstanceDefaultTrustedProfilePrototype object from a json dictionary."""
args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ if (auto_link := _dict.get('auto_link')) is not None:
+ args['auto_link'] = auto_link
+ if (target := _dict.get('target')) is not None:
+ args['target'] = target
else:
- raise ValueError('Required property \'href\' not present in InstanceGroupManagerActionsCollectionFirst JSON')
+ raise ValueError('Required property \'target\' not present in InstanceDefaultTrustedProfilePrototype JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceGroupManagerActionsCollectionFirst object from a json dictionary."""
+ """Initialize a InstanceDefaultTrustedProfilePrototype object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'href') and self.href is not None:
- _dict['href'] = self.href
+ if hasattr(self, 'auto_link') and self.auto_link is not None:
+ _dict['auto_link'] = self.auto_link
+ if hasattr(self, 'target') and self.target is not None:
+ if isinstance(self.target, dict):
+ _dict['target'] = self.target
+ else:
+ _dict['target'] = self.target.to_dict()
return _dict
def _to_dict(self):
@@ -44920,59 +47183,128 @@ 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 InstanceDefaultTrustedProfilePrototype object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceGroupManagerActionsCollectionFirst') -> bool:
+ def __eq__(self, other: 'InstanceDefaultTrustedProfilePrototype') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'InstanceGroupManagerActionsCollectionFirst') -> bool:
+ def __ne__(self, other: 'InstanceDefaultTrustedProfilePrototype') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class InstanceGroupManagerActionsCollectionNext:
+class InstanceDisk:
"""
- A link to the next page of resources. This property is present for all pages except
- the last page.
+ InstanceDisk.
- :attr 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 name for this instance disk. The name is unique across all
+ disks on the instance.
+ :param str resource_type: The resource type.
+ :param int size: The size of the disk in GB (gigabytes).
"""
def __init__(
self,
+ created_at: datetime,
href: str,
+ id: str,
+ interface_type: str,
+ name: str,
+ resource_type: str,
+ size: int,
) -> None:
"""
- Initialize a InstanceGroupManagerActionsCollectionNext 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 name for this instance disk. The name is unique across
+ all disks on the instance.
+ :param str resource_type: The resource type.
+ :param int size: The size of the disk in GB (gigabytes).
"""
+ self.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) -> 'InstanceGroupManagerActionsCollectionNext':
- """Initialize a InstanceGroupManagerActionsCollectionNext object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceDisk':
+ """Initialize a InstanceDisk object from a json dictionary."""
args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ if (created_at := _dict.get('created_at')) is not None:
+ args['created_at'] = string_to_datetime(created_at)
else:
- raise ValueError('Required property \'href\' not present in InstanceGroupManagerActionsCollectionNext JSON')
+ raise ValueError('Required property \'created_at\' not present in InstanceDisk JSON')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
+ else:
+ raise ValueError('Required property \'href\' not present in InstanceDisk JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
+ else:
+ raise ValueError('Required property \'id\' not present in InstanceDisk JSON')
+ if (interface_type := _dict.get('interface_type')) is not None:
+ args['interface_type'] = interface_type
+ else:
+ raise ValueError('Required property \'interface_type\' not present in InstanceDisk JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ else:
+ raise ValueError('Required property \'name\' not present in InstanceDisk JSON')
+ if (resource_type := _dict.get('resource_type')) is not None:
+ args['resource_type'] = resource_type
+ else:
+ raise ValueError('Required property \'resource_type\' not present in InstanceDisk JSON')
+ if (size := _dict.get('size')) is not None:
+ args['size'] = size
+ else:
+ raise ValueError('Required property \'size\' not present in InstanceDisk JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceGroupManagerActionsCollectionNext 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):
@@ -44980,119 +47312,85 @@ 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 InstanceDisk object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceGroupManagerActionsCollectionNext') -> 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: 'InstanceGroupManagerActionsCollectionNext') -> bool:
+ def __ne__(self, other: 'InstanceDisk') -> 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 InstanceGroupManagerCollection:
+ class ResourceTypeEnum(str, Enum):
+ """
+ The resource type.
+ """
+
+ INSTANCE_DISK = 'instance_disk'
+
+
+
+class InstanceDiskCollection:
"""
- InstanceGroupManagerCollection.
+ InstanceDiskCollection.
- :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.
+ :param List[InstanceDisk] disks: Collection of the instance's disks.
"""
def __init__(
self,
- first: 'InstanceGroupManagerCollectionFirst',
- limit: int,
- managers: List['InstanceGroupManager'],
- total_count: int,
- *,
- next: 'InstanceGroupManagerCollectionNext' = None,
+ disks: List['InstanceDisk'],
) -> None:
"""
- Initialize a InstanceGroupManagerCollection object.
+ Initialize a InstanceDiskCollection object.
- :param InstanceGroupManagerCollectionFirst first: A link to the first page
- of resources.
- :param int limit: The maximum number of resources that can be returned by
- the request.
- :param List[InstanceGroupManager] managers: Collection of instance group
- managers.
- :param int total_count: The total number of resources across all pages.
- :param InstanceGroupManagerCollectionNext next: (optional) A link to the
- next page of resources. This property is present for all pages
- except the last page.
+ :param List[InstanceDisk] disks: Collection of the instance's disks.
"""
- self.first = first
- self.limit = limit
- self.managers = managers
- self.next = next
- self.total_count = total_count
+ self.disks = disks
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerCollection':
- """Initialize a InstanceGroupManagerCollection object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceDiskCollection':
+ """Initialize a InstanceDiskCollection 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')
+ if (disks := _dict.get('disks')) is not None:
+ args['disks'] = [InstanceDisk.from_dict(v) for v in disks]
else:
- raise ValueError('Required property \'total_count\' not present in InstanceGroupManagerCollection JSON')
+ raise ValueError('Required property \'disks\' not present in InstanceDiskCollection JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceGroupManagerCollection 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, 'first') and self.first is not None:
- if isinstance(self.first, dict):
- _dict['first'] = self.first
- else:
- _dict['first'] = self.first.to_dict()
- if hasattr(self, 'limit') and self.limit is not None:
- _dict['limit'] = self.limit
- if hasattr(self, 'managers') and self.managers is not None:
- managers_list = []
- for v in self.managers:
+ if hasattr(self, 'disks') and self.disks is not None:
+ disks_list = []
+ for v in self.disks:
if isinstance(v, dict):
- managers_list.append(v)
+ disks_list.append(v)
else:
- managers_list.append(v.to_dict())
- _dict['managers'] = managers_list
- if hasattr(self, 'next') and self.next is not None:
- if isinstance(self.next, dict):
- _dict['next'] = self.next
- else:
- _dict['next'] = self.next.to_dict()
- if hasattr(self, 'total_count') and self.total_count is not None:
- _dict['total_count'] = self.total_count
+ disks_list.append(v.to_dict())
+ _dict['disks'] = disks_list
return _dict
def _to_dict(self):
@@ -45100,58 +47398,59 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this InstanceGroupManagerCollection object."""
+ """Return a `str` version of this InstanceDiskCollection object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceGroupManagerCollection') -> 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: 'InstanceGroupManagerCollection') -> bool:
+ def __ne__(self, other: 'InstanceDiskCollection') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class InstanceGroupManagerCollectionFirst:
+class InstanceDiskPatch:
"""
- A link to the first page of resources.
+ InstanceDiskPatch.
- :attr str href: The URL for a page of resources.
+ :param str name: (optional) The name for this instance disk. The name must not
+ be used by another disk on the instance.
"""
def __init__(
self,
- href: str,
+ *,
+ name: Optional[str] = None,
) -> None:
"""
- Initialize a InstanceGroupManagerCollectionFirst object.
+ Initialize a InstanceDiskPatch object.
- :param str href: The URL for a page of resources.
+ :param str name: (optional) The name for this instance disk. The name must
+ not be used by another disk on the instance.
"""
- self.href = href
+ 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) -> 'InstanceDiskPatch':
+ """Initialize a InstanceDiskPatch 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')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceGroupManagerCollectionFirst 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, '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):
@@ -45159,59 +47458,106 @@ 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 InstanceDiskPatch object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceGroupManagerCollectionFirst') -> 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: 'InstanceGroupManagerCollectionFirst') -> bool:
+ def __ne__(self, other: 'InstanceDiskPatch') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class InstanceGroupManagerCollectionNext:
+class InstanceDiskReference:
"""
- A link to the next page of resources. This property is present for all pages except
- the last page.
+ InstanceDiskReference.
- :attr str href: The URL for a page of resources.
+ :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 this instance disk.
+ :param str id: The unique identifier for this instance disk.
+ :param str name: The name for this instance disk. The name is unique across all
+ disks on the instance.
+ :param str resource_type: The resource type.
"""
def __init__(
self,
href: str,
+ id: str,
+ name: str,
+ resource_type: str,
+ *,
+ deleted: Optional['InstanceDiskReferenceDeleted'] = None,
) -> None:
"""
- Initialize a InstanceGroupManagerCollectionNext object.
+ Initialize a InstanceDiskReference object.
- :param str href: The URL for a page of resources.
+ :param str href: The URL for this instance disk.
+ :param str id: The unique identifier for this instance disk.
+ :param str name: The name for this instance disk. The name is unique across
+ all disks on the instance.
+ :param str resource_type: The resource type.
+ :param InstanceDiskReferenceDeleted deleted: (optional) If present, this
+ property indicates the referenced resource has been deleted, and provides
+ some supplementary information.
"""
+ self.deleted = deleted
self.href = href
+ self.id = id
+ self.name = name
+ self.resource_type = resource_type
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerCollectionNext':
- """Initialize a InstanceGroupManagerCollectionNext object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceDiskReference':
+ """Initialize a InstanceDiskReference object from a json dictionary."""
args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ if (deleted := _dict.get('deleted')) is not None:
+ args['deleted'] = InstanceDiskReferenceDeleted.from_dict(deleted)
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'href\' not present in InstanceGroupManagerCollectionNext JSON')
+ raise ValueError('Required property \'href\' not present in InstanceDiskReference JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
+ else:
+ raise ValueError('Required property \'id\' not present in InstanceDiskReference JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ else:
+ raise ValueError('Required property \'name\' not present in InstanceDiskReference JSON')
+ if (resource_type := _dict.get('resource_type')) is not None:
+ args['resource_type'] = resource_type
+ else:
+ raise ValueError('Required property \'resource_type\' not present in InstanceDiskReference JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceGroupManagerCollectionNext object from a json dictionary."""
+ """Initialize a InstanceDiskReference object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
+ if hasattr(self, 'deleted') and self.deleted is not None:
+ if isinstance(self.deleted, dict):
+ _dict['deleted'] = self.deleted
+ else:
+ _dict['deleted'] = self.deleted.to_dict()
if hasattr(self, 'href') and self.href is not None:
_dict['href'] = self.href
+ if hasattr(self, 'id') and self.id is not None:
+ _dict['id'] = self.id
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ if hasattr(self, 'resource_type') and self.resource_type is not None:
+ _dict['resource_type'] = self.resource_type
return _dict
def _to_dict(self):
@@ -45219,109 +47565,67 @@ 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 InstanceDiskReference object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceGroupManagerCollectionNext') -> 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: 'InstanceGroupManagerCollectionNext') -> bool:
+ def __ne__(self, other: 'InstanceDiskReference') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
+ class ResourceTypeEnum(str, Enum):
+ """
+ The resource type.
+ """
-class InstanceGroupManagerPatch:
+ INSTANCE_DISK = 'instance_disk'
+
+
+
+class InstanceDiskReferenceDeleted:
"""
- InstanceGroupManagerPatch.
+ If present, this property indicates the referenced resource has been deleted, and
+ provides some supplementary information.
- :attr int aggregation_window: (optional) The time window in seconds to aggregate
- metrics prior to evaluation.
- :attr int cooldown: (optional) The duration of time in seconds to pause further
- scale actions after scaling has taken place.
- :attr bool management_enabled: (optional) Indicates whether this manager will
- control the instance group.
- :attr int max_membership_count: (optional) The maximum number of members in a
- managed instance group.
- :attr int min_membership_count: (optional) The minimum number of members in a
- managed instance group.
- :attr str name: (optional) The name for this instance group manager. The name
- must not be used by another manager for the instance group.
+ :param str more_info: Link to documentation about deleted resources.
"""
def __init__(
self,
- *,
- aggregation_window: int = None,
- cooldown: int = None,
- management_enabled: bool = None,
- max_membership_count: int = None,
- min_membership_count: int = None,
- name: str = None,
+ more_info: str,
) -> None:
"""
- Initialize a InstanceGroupManagerPatch object.
+ Initialize a InstanceDiskReferenceDeleted object.
- :param int aggregation_window: (optional) The time window in seconds to
- aggregate metrics prior to evaluation.
- :param int cooldown: (optional) The duration of time in seconds to pause
- further scale actions after scaling has taken place.
- :param bool management_enabled: (optional) Indicates whether this manager
- will control the instance group.
- :param int max_membership_count: (optional) The maximum number of members
- in a managed instance group.
- :param int min_membership_count: (optional) The minimum number of members
- in a managed instance group.
- :param str name: (optional) The name for this instance group manager. The
- name must not be used by another manager for the instance group.
+ :param str more_info: Link to documentation about deleted resources.
"""
- 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.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) -> 'InstanceDiskReferenceDeleted':
+ """Initialize a InstanceDiskReferenceDeleted 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 (more_info := _dict.get('more_info')) is not None:
+ args['more_info'] = more_info
+ else:
+ raise ValueError('Required property \'more_info\' not present in InstanceDiskReferenceDeleted JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceGroupManagerPatch object from a json dictionary."""
+ """Initialize a InstanceDiskReferenceDeleted object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, '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, 'more_info') and self.more_info is not None:
+ _dict['more_info'] = self.more_info
return _dict
def _to_dict(self):
@@ -45329,133 +47633,446 @@ 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 InstanceDiskReferenceDeleted object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceGroupManagerPatch') -> 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: 'InstanceGroupManagerPatch') -> bool:
+ def __ne__(self, other: 'InstanceDiskReferenceDeleted') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class InstanceGroupManagerPolicy:
+class InstanceGPU:
"""
- InstanceGroupManagerPolicy.
+ The virtual server instance GPU configuration.
- :attr datetime created_at: The date and time that the instance group manager
- policy was created.
- :attr str href: The URL for this instance group manager policy.
- :attr str id: The unique identifier for this instance group manager policy.
- :attr str name: The name for this instance group manager policy. The name is
- unique across all policies for the instance group manager.
- :attr datetime updated_at: The date and time that the instance group manager
- policy was updated.
+ :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.
+ """
+
+ def __init__(
+ self,
+ count: int,
+ manufacturer: str,
+ memory: int,
+ model: str,
+ ) -> None:
+ """
+ Initialize a InstanceGPU 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.
+ """
+ self.count = count
+ self.manufacturer = manufacturer
+ self.memory = memory
+ self.model = model
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'InstanceGPU':
+ """Initialize a InstanceGPU object from a json dictionary."""
+ args = {}
+ if (count := _dict.get('count')) is not None:
+ args['count'] = count
+ else:
+ raise ValueError('Required property \'count\' not present in InstanceGPU JSON')
+ if (manufacturer := _dict.get('manufacturer')) is not None:
+ args['manufacturer'] = manufacturer
+ else:
+ raise ValueError('Required property \'manufacturer\' not present in InstanceGPU JSON')
+ if (memory := _dict.get('memory')) is not None:
+ args['memory'] = memory
+ else:
+ raise ValueError('Required property \'memory\' not present in InstanceGPU JSON')
+ if (model := _dict.get('model')) is not None:
+ args['model'] = model
+ else:
+ raise ValueError('Required property \'model\' not present in InstanceGPU JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """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, '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):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
+
+ def __str__(self) -> str:
+ """Return a `str` version of this InstanceGPU object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ 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: 'InstanceGPU') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+
+class InstanceGroup:
+ """
+ InstanceGroup.
+
+ :param int application_port: (optional) The port used for new load balancer pool
+ members created by this instance group.
+ This property will be present if and only if `load_balancer_pool` is present.
+ :param 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 LoadBalancerPoolReference load_balancer_pool: (optional) If present, the
+ load balancer pool this instance group manages. A pool member will
+ be created for each instance created by this group.
+ :param List[InstanceGroupManagerReference] managers: The managers for the
+ instance group.
+ :param int membership_count: The number of instances in the instance group.
+ :param str name: The name for this instance group. The name is unique across all
+ instance groups in the region.
+ :param ResourceGroupReference resource_group:
+ :param str status: The status of the instance group
+ - `deleting`: Group is being deleted
+ - `healthy`: Group has `membership_count` instances
+ - `scaling`: Instances in the group are being created or deleted to reach
+ `membership_count`
+ - `unhealthy`: Group is unable to reach `membership_count` instances.
+ :param List[SubnetReference] subnets: The subnets to use when creating new
+ instances.
+ :param datetime updated_at: The date and time that the instance group was
+ updated.
+ :param VPCReference vpc: The VPC the instance group resides in.
"""
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: Optional[int] = None,
+ load_balancer_pool: Optional['LoadBalancerPoolReference'] = None,
) -> None:
"""
- Initialize a InstanceGroupManagerPolicy object.
+ Initialize a InstanceGroup object.
- :param datetime created_at: The date and time that the instance group
- manager policy was created.
- :param str href: The URL for this instance group manager policy.
- :param str id: The unique identifier for this instance group manager
- policy.
- :param str name: The name for this instance group manager policy. The name
- is unique across all policies for the instance group manager.
- :param datetime updated_at: The date and time that the instance group
- manager policy was updated.
+ :param datetime created_at: The date and time that the instance group was
+ created.
+ :param str crn: The CRN for this instance group.
+ :param str href: The URL for this instance group.
+ :param str id: The unique identifier for this instance group.
+ :param InstanceTemplateReference instance_template: The template used to
+ create new instances for this group.
+ :param List[InstanceGroupManagerReference] managers: The managers for the
+ instance group.
+ :param int membership_count: The number of instances in the instance group.
+ :param str name: The name for this instance group. The name is unique
+ across all instance groups in the region.
+ :param ResourceGroupReference resource_group:
+ :param str status: The status of the instance group
+ - `deleting`: Group is being deleted
+ - `healthy`: Group has `membership_count` instances
+ - `scaling`: Instances in the group are being created or deleted to reach
+ `membership_count`
+ - `unhealthy`: Group is unable to reach `membership_count` instances.
+ :param List[SubnetReference] subnets: The subnets to use when creating new
+ instances.
+ :param datetime updated_at: The date and time that the instance group was
+ updated.
+ :param VPCReference vpc: The VPC the instance group resides in.
+ :param int application_port: (optional) The port used for new load balancer
+ pool members created by this instance group.
+ This property will be present if and only if `load_balancer_pool` is
+ present.
+ :param LoadBalancerPoolReference load_balancer_pool: (optional) If present,
+ the load balancer pool this instance group manages. A pool member will
+ be created for each instance created by this group.
"""
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy'])
- )
- raise Exception(msg)
+ self.application_port = application_port
+ self.created_at = created_at
+ self.crn = crn
+ self.href = href
+ self.id = id
+ self.instance_template = instance_template
+ self.load_balancer_pool = load_balancer_pool
+ self.managers = managers
+ self.membership_count = membership_count
+ self.name = name
+ self.resource_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."""
+ args = {}
+ if (application_port := _dict.get('application_port')) is not None:
+ args['application_port'] = application_port
+ if (created_at := _dict.get('created_at')) is not None:
+ args['created_at'] = string_to_datetime(created_at)
+ else:
+ raise ValueError('Required property \'created_at\' not present in InstanceGroup JSON')
+ if (crn := _dict.get('crn')) is not None:
+ args['crn'] = crn
+ else:
+ raise ValueError('Required property \'crn\' not present in InstanceGroup JSON')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
+ else:
+ raise ValueError('Required property \'href\' not present in InstanceGroup JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
+ else:
+ raise ValueError('Required property \'id\' not present in InstanceGroup JSON')
+ if (instance_template := _dict.get('instance_template')) is not None:
+ args['instance_template'] = InstanceTemplateReference.from_dict(instance_template)
+ else:
+ raise ValueError('Required property \'instance_template\' not present in InstanceGroup JSON')
+ if (load_balancer_pool := _dict.get('load_balancer_pool')) is not None:
+ args['load_balancer_pool'] = LoadBalancerPoolReference.from_dict(load_balancer_pool)
+ if (managers := _dict.get('managers')) is not None:
+ args['managers'] = [InstanceGroupManagerReference.from_dict(v) for v in managers]
+ else:
+ raise ValueError('Required property \'managers\' not present in InstanceGroup JSON')
+ if (membership_count := _dict.get('membership_count')) is not None:
+ args['membership_count'] = membership_count
+ else:
+ raise ValueError('Required property \'membership_count\' not present in InstanceGroup JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ else:
+ raise ValueError('Required property \'name\' not present in InstanceGroup JSON')
+ if (resource_group := _dict.get('resource_group')) is not None:
+ args['resource_group'] = ResourceGroupReference.from_dict(resource_group)
+ else:
+ raise ValueError('Required property \'resource_group\' not present in InstanceGroup JSON')
+ if (status := _dict.get('status')) is not None:
+ args['status'] = status
+ else:
+ raise ValueError('Required property \'status\' not present in InstanceGroup JSON')
+ if (subnets := _dict.get('subnets')) is not None:
+ args['subnets'] = [SubnetReference.from_dict(v) for v in subnets]
+ else:
+ raise ValueError('Required property \'subnets\' not present in InstanceGroup JSON')
+ if (updated_at := _dict.get('updated_at')) is not None:
+ args['updated_at'] = string_to_datetime(updated_at)
+ else:
+ raise ValueError('Required property \'updated_at\' not present in InstanceGroup JSON')
+ if (vpc := _dict.get('vpc')) is not None:
+ args['vpc'] = VPCReference.from_dict(vpc)
+ else:
+ raise ValueError('Required property \'vpc\' not present in InstanceGroup JSON')
+ return cls(**args)
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a InstanceGroup object from a json dictionary."""
+ return cls.from_dict(_dict)
-class InstanceGroupManagerPolicyCollection:
+ def to_dict(self) -> Dict:
+ """Return a json dictionary representing this model."""
+ _dict = {}
+ if hasattr(self, 'application_port') and self.application_port is not None:
+ _dict['application_port'] = self.application_port
+ if hasattr(self, 'created_at') and self.created_at is not None:
+ _dict['created_at'] = datetime_to_string(self.created_at)
+ if hasattr(self, 'crn') and self.crn is not None:
+ _dict['crn'] = self.crn
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
+ if hasattr(self, 'id') and self.id is not None:
+ _dict['id'] = self.id
+ if hasattr(self, 'instance_template') and self.instance_template is not None:
+ if isinstance(self.instance_template, dict):
+ _dict['instance_template'] = self.instance_template
+ else:
+ _dict['instance_template'] = self.instance_template.to_dict()
+ if hasattr(self, 'load_balancer_pool') and self.load_balancer_pool is not None:
+ if isinstance(self.load_balancer_pool, dict):
+ _dict['load_balancer_pool'] = self.load_balancer_pool
+ else:
+ _dict['load_balancer_pool'] = self.load_balancer_pool.to_dict()
+ if hasattr(self, 'managers') and self.managers is not None:
+ managers_list = []
+ for v in self.managers:
+ if isinstance(v, dict):
+ managers_list.append(v)
+ else:
+ managers_list.append(v.to_dict())
+ _dict['managers'] = managers_list
+ if hasattr(self, 'membership_count') and self.membership_count is not None:
+ _dict['membership_count'] = self.membership_count
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ if hasattr(self, 'resource_group') and self.resource_group is not None:
+ if isinstance(self.resource_group, dict):
+ _dict['resource_group'] = self.resource_group
+ else:
+ _dict['resource_group'] = self.resource_group.to_dict()
+ if hasattr(self, 'status') and self.status is not None:
+ _dict['status'] = self.status
+ if hasattr(self, 'subnets') and self.subnets is not None:
+ subnets_list = []
+ for v in self.subnets:
+ if isinstance(v, dict):
+ subnets_list.append(v)
+ else:
+ subnets_list.append(v.to_dict())
+ _dict['subnets'] = subnets_list
+ if hasattr(self, 'updated_at') and self.updated_at is not None:
+ _dict['updated_at'] = datetime_to_string(self.updated_at)
+ if hasattr(self, 'vpc') and self.vpc is not None:
+ if isinstance(self.vpc, dict):
+ _dict['vpc'] = self.vpc
+ else:
+ _dict['vpc'] = self.vpc.to_dict()
+ return _dict
+
+ def _to_dict(self):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
+
+ def __str__(self) -> str:
+ """Return a `str` version of this InstanceGroup object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ 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: 'InstanceGroup') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+ class StatusEnum(str, Enum):
+ """
+ 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.
+ """
+
+ DELETING = 'deleting'
+ HEALTHY = 'healthy'
+ SCALING = 'scaling'
+ UNHEALTHY = 'unhealthy'
+
+
+
+class InstanceGroupCollection:
"""
- InstanceGroupManagerPolicyCollection.
+ InstanceGroupCollection.
- :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
+ :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.
- :attr InstanceGroupManagerPolicyCollectionNext next: (optional) A link to the
- next page of resources. This property is present for 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.
- :attr List[InstanceGroupManagerPolicy] policies: Collection of instance group
- manager policies.
- :attr int total_count: The total number of resources across all pages.
+ :param int total_count: The total number of resources across all pages.
"""
def __init__(
self,
- first: 'InstanceGroupManagerPolicyCollectionFirst',
+ first: 'InstanceGroupCollectionFirst',
+ instance_groups: List['InstanceGroup'],
limit: int,
- policies: List['InstanceGroupManagerPolicy'],
total_count: int,
*,
- next: 'InstanceGroupManagerPolicyCollectionNext' = None,
+ next: Optional['InstanceGroupCollectionNext'] = None,
) -> None:
"""
- Initialize a InstanceGroupManagerPolicyCollection object.
+ Initialize a InstanceGroupCollection object.
- :param InstanceGroupManagerPolicyCollectionFirst first: A link to the first
- page of resources.
+ :param InstanceGroupCollectionFirst first: A link to the first page of
+ resources.
+ :param List[InstanceGroup] instance_groups: Collection of instance groups.
:param int limit: The maximum number of resources that can be returned by
the request.
- :param 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
+ :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.instance_groups = instance_groups
self.limit = limit
self.next = next
- self.policies = policies
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) -> 'InstanceGroupCollection':
+ """Initialize a InstanceGroupCollection object from a json dictionary."""
args = {}
- if 'first' in _dict:
- args['first'] = InstanceGroupManagerPolicyCollectionFirst.from_dict(_dict.get('first'))
+ if (first := _dict.get('first')) is not None:
+ args['first'] = InstanceGroupCollectionFirst.from_dict(first)
else:
- raise ValueError('Required property \'first\' not present in InstanceGroupManagerPolicyCollection JSON')
- if 'limit' in _dict:
- args['limit'] = _dict.get('limit')
+ raise ValueError('Required property \'first\' not present in InstanceGroupCollection JSON')
+ if (instance_groups := _dict.get('instance_groups')) is not None:
+ args['instance_groups'] = [InstanceGroup.from_dict(v) for v in instance_groups]
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')
+ raise ValueError('Required property \'instance_groups\' not present in InstanceGroupCollection JSON')
+ if (limit := _dict.get('limit')) is not None:
+ args['limit'] = limit
else:
- raise ValueError('Required property \'policies\' not present in InstanceGroupManagerPolicyCollection JSON')
- if 'total_count' in _dict:
- args['total_count'] = _dict.get('total_count')
+ raise ValueError('Required property \'limit\' not present in InstanceGroupCollection JSON')
+ if (next := _dict.get('next')) is not None:
+ args['next'] = InstanceGroupCollectionNext.from_dict(next)
+ if (total_count := _dict.get('total_count')) is not None:
+ args['total_count'] = total_count
else:
- raise ValueError('Required property \'total_count\' not present in InstanceGroupManagerPolicyCollection JSON')
+ raise ValueError('Required property \'total_count\' not present in InstanceGroupCollection JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceGroupManagerPolicyCollection object from a json dictionary."""
+ """Initialize a InstanceGroupCollection object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -45466,6 +48083,14 @@ def to_dict(self) -> Dict:
_dict['first'] = self.first
else:
_dict['first'] = self.first.to_dict()
+ if hasattr(self, 'instance_groups') and self.instance_groups is not None:
+ instance_groups_list = []
+ for v in self.instance_groups:
+ if isinstance(v, dict):
+ instance_groups_list.append(v)
+ else:
+ instance_groups_list.append(v.to_dict())
+ _dict['instance_groups'] = instance_groups_list
if hasattr(self, 'limit') and self.limit is not None:
_dict['limit'] = self.limit
if hasattr(self, 'next') and self.next is not None:
@@ -45473,14 +48098,6 @@ def to_dict(self) -> Dict:
_dict['next'] = self.next
else:
_dict['next'] = self.next.to_dict()
- if hasattr(self, 'policies') and self.policies is not None:
- policies_list = []
- for v in self.policies:
- if isinstance(v, dict):
- policies_list.append(v)
- else:
- policies_list.append(v.to_dict())
- _dict['policies'] = policies_list
if hasattr(self, 'total_count') and self.total_count is not None:
_dict['total_count'] = self.total_count
return _dict
@@ -45490,25 +48107,25 @@ 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 InstanceGroupCollection object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceGroupManagerPolicyCollection') -> 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: 'InstanceGroupManagerPolicyCollection') -> bool:
+ def __ne__(self, other: 'InstanceGroupCollection') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class InstanceGroupManagerPolicyCollectionFirst:
+class InstanceGroupCollectionFirst:
"""
A link to the first page of resources.
- :attr str href: The URL for a page of resources.
+ :param str href: The URL for a page of resources.
"""
def __init__(
@@ -45516,25 +48133,25 @@ def __init__(
href: str,
) -> None:
"""
- Initialize a InstanceGroupManagerPolicyCollectionFirst 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) -> 'InstanceGroupManagerPolicyCollectionFirst':
- """Initialize a InstanceGroupManagerPolicyCollectionFirst object from a json dictionary."""
+ 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')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'href\' not present in InstanceGroupManagerPolicyCollectionFirst JSON')
+ raise ValueError('Required property \'href\' not present in InstanceGroupCollectionFirst JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceGroupManagerPolicyCollectionFirst object from a json dictionary."""
+ """Initialize a InstanceGroupCollectionFirst object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -45549,26 +48166,26 @@ 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 InstanceGroupCollectionFirst object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceGroupManagerPolicyCollectionFirst') -> bool:
+ 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: 'InstanceGroupManagerPolicyCollectionFirst') -> bool:
+ def __ne__(self, other: 'InstanceGroupCollectionFirst') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class InstanceGroupManagerPolicyCollectionNext:
+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.
+ :param str href: The URL for a page of resources.
"""
def __init__(
@@ -45576,25 +48193,25 @@ def __init__(
href: str,
) -> None:
"""
- Initialize a InstanceGroupManagerPolicyCollectionNext object.
+ Initialize a InstanceGroupCollectionNext 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) -> 'InstanceGroupCollectionNext':
+ """Initialize a InstanceGroupCollectionNext object from a json dictionary."""
args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'href\' not present in InstanceGroupManagerPolicyCollectionNext JSON')
+ raise ValueError('Required property \'href\' not present in InstanceGroupCollectionNext JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceGroupManagerPolicyCollectionNext object from a json dictionary."""
+ """Initialize a InstanceGroupCollectionNext object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -45609,214 +48226,276 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this InstanceGroupManagerPolicyCollectionNext object."""
+ """Return a `str` version of this InstanceGroupCollectionNext object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceGroupManagerPolicyCollectionNext') -> bool:
+ def __eq__(self, other: 'InstanceGroupCollectionNext') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'InstanceGroupManagerPolicyCollectionNext') -> bool:
+ def __ne__(self, other: 'InstanceGroupCollectionNext') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class InstanceGroupManagerPolicyPatch:
+class InstanceGroupManager:
"""
- InstanceGroupManagerPolicyPatch.
+ InstanceGroupManager.
- :attr str metric_type: (optional) The type of metric to be evaluated.
- :attr int metric_value: (optional) The metric value to be evaluated.
- :attr str name: (optional) The name for this instance group manager policy. The
- name must not be used by another policy for the instance group manager.
+ :param datetime created_at: The date and time that the instance group manager
+ was created.
+ :param str href: The URL for this instance group manager.
+ :param str id: The unique identifier for this instance group manager.
+ :param bool management_enabled: Indicates whether this manager will control the
+ instance group.
+ :param str name: The name for this instance group manager. The name is unique
+ across all managers for the instance group.
+ :param datetime updated_at: The date and time that the instance group manager
+ was updated.
"""
def __init__(
self,
- *,
- metric_type: str = None,
- metric_value: int = None,
- name: str = None,
+ created_at: datetime,
+ href: str,
+ id: str,
+ management_enabled: bool,
+ name: str,
+ updated_at: datetime,
) -> None:
"""
- Initialize a InstanceGroupManagerPolicyPatch object.
+ Initialize a InstanceGroupManager object.
- :param str metric_type: (optional) The type of metric to be evaluated.
- :param int metric_value: (optional) The metric value to be evaluated.
- :param str name: (optional) The name for this instance group manager
- policy. The name must not be used by another policy for the instance group
- manager.
+ :param datetime created_at: The date and time that the instance group
+ manager was created.
+ :param str href: The URL for this instance group manager.
+ :param str id: The unique identifier for this instance group manager.
+ :param bool management_enabled: Indicates whether this manager will control
+ the instance group.
+ :param str name: The name for this instance group manager. The name is
+ unique across all managers for the instance group.
+ :param datetime updated_at: The date and time that the instance group
+ manager was updated.
"""
- 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
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['InstanceGroupManagerAutoScale', 'InstanceGroupManagerScheduled'])
+ )
+ raise Exception(msg)
- def _to_dict(self):
- """Return a json dictionary representing this model."""
- return self.to_dict()
- def __str__(self) -> str:
- """Return a `str` version of this InstanceGroupManagerPolicyPatch object."""
- return json.dumps(self.to_dict(), indent=2)
+class InstanceGroupManagerAction:
+ """
+ InstanceGroupManagerAction.
- 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__
+ :param bool auto_delete: Indicates whether this scheduled action will be
+ automatically deleted after it has completed and `auto_delete_timeout` hours
+ have passed. At present, this is always
+ `true`, but may be modifiable in the future.
+ :param int auto_delete_timeout: If `auto_delete` is `true`, and this scheduled
+ action has finished, the hours after which it will be automatically deleted. If
+ the value is `0`, the action will be deleted once it has finished. This value
+ may be modifiable in the future.
+ :param datetime created_at: The date and time that the instance group manager
+ action was created.
+ :param str href: The URL for this instance group manager action.
+ :param str id: The unique identifier for this instance group manager action.
+ :param str name: The name for this instance group manager action. The name is
+ unique across all actions for the instance group manager.
+ :param str resource_type: The resource type.
+ :param str status: The status of the instance group action
+ - `active`: Action is ready to be run
+ - `completed`: Action was completed successfully
+ - `failed`: Action could not be completed successfully
+ - `incompatible`: Action parameters are not compatible with the group or manager
+ - `omitted`: Action was not applied because this action's manager was disabled.
+ :param datetime updated_at: The date and time that the instance group manager
+ action was updated.
+ """
- def __ne__(self, other: 'InstanceGroupManagerPolicyPatch') -> bool:
- """Return `true` when self and other are not equal, false otherwise."""
- return not self == other
+ 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.
- class MetricTypeEnum(str, Enum):
+ :param bool auto_delete: Indicates whether this scheduled action will be
+ automatically deleted after it has completed and `auto_delete_timeout`
+ hours have passed. At present, this is always
+ `true`, but may be modifiable in the future.
+ :param int auto_delete_timeout: If `auto_delete` is `true`, and this
+ scheduled action has finished, the hours after which it will be
+ automatically deleted. If the value is `0`, the action will be deleted once
+ it has finished. This value may be modifiable in the future.
+ :param datetime created_at: The date and time that the instance group
+ manager action was created.
+ :param str href: The URL for this instance group manager action.
+ :param str id: The unique identifier for this instance group manager
+ action.
+ :param str name: The name for this instance group manager action. The name
+ is unique across all actions for the instance group manager.
+ :param str resource_type: The resource type.
+ :param str status: The status of the instance group action
+ - `active`: Action is ready to be run
+ - `completed`: Action was completed successfully
+ - `failed`: Action could not be completed successfully
+ - `incompatible`: Action parameters are not compatible with the group or
+ manager
+ - `omitted`: Action was not applied because this action's manager was
+ disabled.
+ :param datetime updated_at: The date and time that the instance group
+ manager action was updated.
"""
- The type of metric to be evaluated.
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['InstanceGroupManagerActionScheduledAction'])
+ )
+ raise Exception(msg)
+
+ class ResourceTypeEnum(str, Enum):
+ """
+ The resource type.
"""
- CPU = 'cpu'
- MEMORY = 'memory'
- NETWORK_IN = 'network_in'
- NETWORK_OUT = 'network_out'
+ 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 InstanceGroupManagerPolicyPrototype:
+class InstanceGroupManagerActionGroupPatch:
"""
- InstanceGroupManagerPolicyPrototype.
+ InstanceGroupManagerActionGroupPatch.
- :attr str name: (optional) The name for this instance group manager policy. The
- name must not be used by another policy for the instance group manager. If
- unspecified, the name will be a hyphenated list of randomly-selected words.
+ :param int membership_count: (optional) The desired number of instance group
+ members at the scheduled time.
"""
def __init__(
self,
*,
- name: str = None,
+ membership_count: Optional[int] = None,
) -> None:
"""
- Initialize a InstanceGroupManagerPolicyPrototype object.
+ Initialize a InstanceGroupManagerActionGroupPatch object.
- :param str name: (optional) The name for this instance group manager
- policy. The name must not be used by another policy for the instance group
- manager. If unspecified, the name will be a hyphenated list of
- randomly-selected words.
+ :param int membership_count: (optional) The desired number of instance
+ group members at the scheduled time.
"""
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype'])
- )
- raise Exception(msg)
+ self.membership_count = membership_count
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerActionGroupPatch':
+ """Initialize a InstanceGroupManagerActionGroupPatch object from a json dictionary."""
+ args = {}
+ if (membership_count := _dict.get('membership_count')) is not None:
+ args['membership_count'] = membership_count
+ return cls(**args)
-class InstanceGroupManagerPolicyReference:
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a InstanceGroupManagerActionGroupPatch object from a json dictionary."""
+ return cls.from_dict(_dict)
+
+ def to_dict(self) -> Dict:
+ """Return a json dictionary representing this model."""
+ _dict = {}
+ if hasattr(self, 'membership_count') and self.membership_count is not None:
+ _dict['membership_count'] = self.membership_count
+ return _dict
+
+ def _to_dict(self):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
+
+ def __str__(self) -> str:
+ """Return a `str` version of this InstanceGroupManagerActionGroupPatch object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'InstanceGroupManagerActionGroupPatch') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'InstanceGroupManagerActionGroupPatch') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+
+class InstanceGroupManagerActionManagerPatch:
"""
- InstanceGroupManagerPolicyReference.
+ InstanceGroupManagerActionManagerPatch.
- :attr InstanceGroupManagerPolicyReferenceDeleted deleted: (optional) If present,
- this property indicates the referenced resource has been deleted, and provides
- some supplementary information.
- :attr str href: The URL for this instance group manager policy.
- :attr str id: The unique identifier for this instance group manager policy.
- :attr str name: The name for this instance group manager policy. The name is
- unique across all policies for the instance group manager.
+ :param int max_membership_count: (optional) The desired maximum number of
+ instance group members at the scheduled time.
+ :param int min_membership_count: (optional) The desired minimum number of
+ instance group members at the scheduled time.
"""
def __init__(
self,
- href: str,
- id: str,
- name: str,
*,
- deleted: 'InstanceGroupManagerPolicyReferenceDeleted' = None,
+ max_membership_count: Optional[int] = None,
+ min_membership_count: Optional[int] = None,
) -> None:
"""
- Initialize a InstanceGroupManagerPolicyReference object.
+ Initialize a InstanceGroupManagerActionManagerPatch object.
- :param str href: The URL for this instance group manager policy.
- :param str id: The unique identifier for this instance group manager
- policy.
- :param str name: The name for this instance group manager policy. The name
- is unique across all policies for the instance group manager.
- :param InstanceGroupManagerPolicyReferenceDeleted deleted: (optional) If
- present, this property indicates the referenced resource has been deleted,
- and provides
- some supplementary information.
+ :param int max_membership_count: (optional) The desired maximum number of
+ instance group members at the scheduled time.
+ :param int min_membership_count: (optional) The desired minimum number of
+ instance group members at the scheduled time.
"""
- self.deleted = deleted
- self.href = href
- self.id = id
- self.name = name
+ self.max_membership_count = max_membership_count
+ self.min_membership_count = min_membership_count
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerPolicyReference':
- """Initialize a InstanceGroupManagerPolicyReference object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerActionManagerPatch':
+ """Initialize a InstanceGroupManagerActionManagerPatch 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')
+ if (max_membership_count := _dict.get('max_membership_count')) is not None:
+ args['max_membership_count'] = max_membership_count
+ if (min_membership_count := _dict.get('min_membership_count')) is not None:
+ args['min_membership_count'] = min_membership_count
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceGroupManagerPolicyReference 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, 'deleted') and self.deleted is not None:
- if isinstance(self.deleted, dict):
- _dict['deleted'] = self.deleted
- else:
- _dict['deleted'] = self.deleted.to_dict()
- if hasattr(self, 'href') and self.href is not None:
- _dict['href'] = self.href
- if hasattr(self, 'id') and self.id is not None:
- _dict['id'] = self.id
- if hasattr(self, 'name') and self.name is not None:
- _dict['name'] = self.name
+ if hasattr(self, 'max_membership_count') and self.max_membership_count is not None:
+ _dict['max_membership_count'] = self.max_membership_count
+ if hasattr(self, 'min_membership_count') and self.min_membership_count is not None:
+ _dict['min_membership_count'] = self.min_membership_count
return _dict
def _to_dict(self):
@@ -45824,59 +48503,104 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this InstanceGroupManagerPolicyReference object."""
+ """Return a `str` version of this InstanceGroupManagerActionManagerPatch object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceGroupManagerPolicyReference') -> 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: 'InstanceGroupManagerPolicyReference') -> bool:
+ def __ne__(self, other: 'InstanceGroupManagerActionManagerPatch') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class InstanceGroupManagerPolicyReferenceDeleted:
+class InstanceGroupManagerActionPatch:
"""
- If present, this property indicates the referenced resource has been deleted, and
- provides some supplementary information.
+ InstanceGroupManagerActionPatch.
- :attr str more_info: Link to documentation about deleted resources.
+ :param str cron_spec: (optional) The cron specification for a recurring
+ scheduled action. Actions can be applied a maximum of one time within a 5 min
+ period.
+ :param InstanceGroupManagerActionGroupPatch group: (optional)
+ :param InstanceGroupManagerActionManagerPatch manager: (optional)
+ :param str name: (optional) The name for this instance group manager action. The
+ name must not be used by another action for the instance group manager.
+ :param datetime run_at: (optional) The date and time the scheduled action will
+ run.
"""
def __init__(
self,
- more_info: str,
+ *,
+ cron_spec: Optional[str] = None,
+ group: Optional['InstanceGroupManagerActionGroupPatch'] = None,
+ manager: Optional['InstanceGroupManagerActionManagerPatch'] = None,
+ name: Optional[str] = None,
+ run_at: Optional[datetime] = None,
) -> None:
"""
- Initialize a InstanceGroupManagerPolicyReferenceDeleted object.
+ Initialize a InstanceGroupManagerActionPatch object.
- :param str more_info: Link to documentation about deleted resources.
+ :param str cron_spec: (optional) The cron specification for a recurring
+ scheduled action. Actions can be applied a maximum of one time within a 5
+ min period.
+ :param InstanceGroupManagerActionGroupPatch group: (optional)
+ :param InstanceGroupManagerActionManagerPatch manager: (optional)
+ :param str name: (optional) The name for this instance group manager
+ action. The name must not be used by another action for the instance group
+ manager.
+ :param datetime run_at: (optional) The date and time the scheduled action
+ will run.
"""
- self.more_info = more_info
+ self.cron_spec = cron_spec
+ self.group = group
+ self.manager = manager
+ self.name = name
+ self.run_at = run_at
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerPolicyReferenceDeleted':
- """Initialize a InstanceGroupManagerPolicyReferenceDeleted object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerActionPatch':
+ """Initialize a InstanceGroupManagerActionPatch object from a json dictionary."""
args = {}
- if 'more_info' in _dict:
- args['more_info'] = _dict.get('more_info')
- else:
- raise ValueError('Required property \'more_info\' not present in InstanceGroupManagerPolicyReferenceDeleted JSON')
+ if (cron_spec := _dict.get('cron_spec')) is not None:
+ args['cron_spec'] = cron_spec
+ if (group := _dict.get('group')) is not None:
+ args['group'] = InstanceGroupManagerActionGroupPatch.from_dict(group)
+ if (manager := _dict.get('manager')) is not None:
+ args['manager'] = InstanceGroupManagerActionManagerPatch.from_dict(manager)
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ if (run_at := _dict.get('run_at')) is not None:
+ args['run_at'] = string_to_datetime(run_at)
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceGroupManagerPolicyReferenceDeleted 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, 'more_info') and self.more_info is not None:
- _dict['more_info'] = self.more_info
+ if hasattr(self, 'cron_spec') and self.cron_spec is not None:
+ _dict['cron_spec'] = self.cron_spec
+ if hasattr(self, 'group') and self.group is not None:
+ if isinstance(self.group, dict):
+ _dict['group'] = self.group
+ else:
+ _dict['group'] = self.group.to_dict()
+ if hasattr(self, 'manager') and self.manager is not None:
+ if isinstance(self.manager, dict):
+ _dict['manager'] = self.manager
+ else:
+ _dict['manager'] = self.manager.to_dict()
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ if hasattr(self, 'run_at') and self.run_at is not None:
+ _dict['run_at'] = datetime_to_string(self.run_at)
return _dict
def _to_dict(self):
@@ -45884,63 +48608,61 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this InstanceGroupManagerPolicyReferenceDeleted object."""
+ """Return a `str` version of this InstanceGroupManagerActionPatch object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceGroupManagerPolicyReferenceDeleted') -> 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: 'InstanceGroupManagerPolicyReferenceDeleted') -> bool:
+ def __ne__(self, other: 'InstanceGroupManagerActionPatch') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class InstanceGroupManagerPrototype:
+class InstanceGroupManagerActionPrototype:
"""
- InstanceGroupManagerPrototype.
+ InstanceGroupManagerActionPrototype.
- :attr bool management_enabled: (optional) Indicates whether this manager will
- control the instance group.
- :attr str name: (optional) The name for this instance group manager. The name
- must not be used by another manager for the instance group. If unspecified, the
- name will be a hyphenated list of randomly-selected words.
+ :param str name: (optional) The name for this instance group manager action. The
+ name must not be used by another action for the instance group manager. If
+ unspecified, the name will be a hyphenated list of randomly-selected words.
"""
def __init__(
self,
*,
- management_enabled: bool = None,
- name: str = None,
+ name: Optional[str] = None,
) -> None:
"""
- Initialize a InstanceGroupManagerPrototype object.
+ Initialize a InstanceGroupManagerActionPrototype object.
- :param bool management_enabled: (optional) Indicates whether this manager
- will control the instance group.
- :param str name: (optional) The name for this instance group manager. The
- name must not be used by another manager for the instance group. If
- unspecified, the name will be a hyphenated list of randomly-selected words.
+ :param str name: (optional) The name for this instance group manager
+ action. The name must not be used by another action for the instance group
+ manager. If unspecified, the name will be a hyphenated list of
+ randomly-selected words.
"""
msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype', 'InstanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype'])
+ ", ".join(['InstanceGroupManagerActionPrototypeScheduledActionPrototype'])
)
raise Exception(msg)
-class InstanceGroupManagerReference:
+class InstanceGroupManagerActionReference:
"""
- InstanceGroupManagerReference.
+ InstanceGroupManagerActionReference.
- :attr InstanceGroupManagerReferenceDeleted deleted: (optional) If present, this
- property indicates the referenced resource has been deleted, and provides
+ :param 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.
- :attr str id: The unique identifier for this instance group manager.
- :attr str name: The name for this instance group manager. The name is unique
- across all managers for the instance group.
+ :param str href: The URL for this instance group manager action.
+ :param str id: The unique identifier for this instance group manager action.
+ :param str name: The name for this instance group manager action. The name is
+ unique across all actions for the instance group manager.
+ :param str resource_type: The resource type.
"""
def __init__(
@@ -45948,49 +48670,57 @@ def __init__(
href: str,
id: str,
name: str,
+ resource_type: str,
*,
- deleted: 'InstanceGroupManagerReferenceDeleted' = None,
+ deleted: Optional['InstanceGroupManagerActionReferenceDeleted'] = None,
) -> None:
"""
- Initialize a InstanceGroupManagerReference object.
+ Initialize a InstanceGroupManagerActionReference object.
- :param str href: The URL for this instance group manager.
- :param str id: The unique identifier for this instance group manager.
- :param str name: The name for this instance group manager. The name is
- unique across all managers for the instance group.
- :param InstanceGroupManagerReferenceDeleted deleted: (optional) If present,
- this property indicates the referenced resource has been deleted, and
- provides
+ :param str href: The URL for this instance group manager action.
+ :param str id: The unique identifier for this instance group manager
+ action.
+ :param str name: The name for this instance group manager action. The name
+ is unique across all actions for the instance group manager.
+ :param str resource_type: The resource type.
+ :param InstanceGroupManagerActionReferenceDeleted deleted: (optional) If
+ present, this property indicates the referenced resource has been deleted,
+ and provides
some supplementary information.
"""
self.deleted = deleted
self.href = href
self.id = id
self.name = name
+ self.resource_type = resource_type
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerReference':
- """Initialize a InstanceGroupManagerReference object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerActionReference':
+ """Initialize a InstanceGroupManagerActionReference object from a json dictionary."""
args = {}
- if 'deleted' in _dict:
- args['deleted'] = InstanceGroupManagerReferenceDeleted.from_dict(_dict.get('deleted'))
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ if (deleted := _dict.get('deleted')) is not None:
+ args['deleted'] = InstanceGroupManagerActionReferenceDeleted.from_dict(deleted)
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'href\' not present in InstanceGroupManagerReference JSON')
- if 'id' in _dict:
- args['id'] = _dict.get('id')
+ raise ValueError('Required property \'href\' not present in InstanceGroupManagerActionReference JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
else:
- raise ValueError('Required property \'id\' not present in InstanceGroupManagerReference JSON')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
+ raise ValueError('Required property \'id\' not present in InstanceGroupManagerActionReference JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
else:
- raise ValueError('Required property \'name\' not present in InstanceGroupManagerReference JSON')
+ raise ValueError('Required property \'name\' not present in InstanceGroupManagerActionReference JSON')
+ if (resource_type := _dict.get('resource_type')) is not None:
+ args['resource_type'] = resource_type
+ else:
+ raise ValueError('Required property \'resource_type\' not present in InstanceGroupManagerActionReference JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceGroupManagerReference object from a json dictionary."""
+ """Initialize a InstanceGroupManagerActionReference object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -46007,6 +48737,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):
@@ -46014,26 +48746,34 @@ 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 InstanceGroupManagerActionReference object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceGroupManagerReference') -> 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: 'InstanceGroupManagerReference') -> bool:
+ def __ne__(self, other: 'InstanceGroupManagerActionReference') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
+ class ResourceTypeEnum(str, Enum):
+ """
+ The resource type.
+ """
+
+ INSTANCE_GROUP_MANAGER_ACTION = 'instance_group_manager_action'
+
-class InstanceGroupManagerReferenceDeleted:
+
+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.
+ :param str more_info: Link to documentation about deleted resources.
"""
def __init__(
@@ -46041,25 +48781,25 @@ def __init__(
more_info: str,
) -> None:
"""
- Initialize a InstanceGroupManagerReferenceDeleted object.
+ Initialize a InstanceGroupManagerActionReferenceDeleted 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) -> 'InstanceGroupManagerActionReferenceDeleted':
+ """Initialize a InstanceGroupManagerActionReferenceDeleted object from a json dictionary."""
args = {}
- if 'more_info' in _dict:
- args['more_info'] = _dict.get('more_info')
+ if (more_info := _dict.get('more_info')) is not None:
+ args['more_info'] = more_info
else:
- raise ValueError('Required property \'more_info\' not present in InstanceGroupManagerReferenceDeleted JSON')
+ raise ValueError('Required property \'more_info\' not present in InstanceGroupManagerActionReferenceDeleted JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceGroupManagerReferenceDeleted object from a json dictionary."""
+ """Initialize a InstanceGroupManagerActionReferenceDeleted object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -46074,60 +48814,119 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this InstanceGroupManagerReferenceDeleted object."""
+ """Return a `str` version of this InstanceGroupManagerActionReferenceDeleted object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceGroupManagerReferenceDeleted') -> bool:
+ def __eq__(self, other: 'InstanceGroupManagerActionReferenceDeleted') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'InstanceGroupManagerReferenceDeleted') -> bool:
+ def __ne__(self, other: 'InstanceGroupManagerActionReferenceDeleted') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class InstanceGroupManagerScheduledActionGroup:
+class InstanceGroupManagerActionsCollection:
"""
- InstanceGroupManagerScheduledActionGroup.
+ InstanceGroupManagerActionsCollection.
- :attr int membership_count: The desired number of instance group members at the
- scheduled time.
+ :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 InstanceGroupManagerActionsCollectionNext next: (optional) A link to the
+ next page of resources. This property is present for all pages
+ except the last page.
+ :param int total_count: The total number of resources across all pages.
"""
def __init__(
self,
- membership_count: int,
+ actions: List['InstanceGroupManagerAction'],
+ first: 'InstanceGroupManagerActionsCollectionFirst',
+ limit: int,
+ total_count: int,
+ *,
+ next: Optional['InstanceGroupManagerActionsCollectionNext'] = None,
) -> None:
"""
- Initialize a InstanceGroupManagerScheduledActionGroup object.
+ Initialize a InstanceGroupManagerActionsCollection object.
- :param int membership_count: The desired number of instance group members
- at the scheduled time.
+ :param List[InstanceGroupManagerAction] actions: Collection of instance
+ group manager actions.
+ :param InstanceGroupManagerActionsCollectionFirst first: A link to the
+ first page of resources.
+ :param int limit: The maximum number of resources that can be returned by
+ the request.
+ :param int total_count: The total number of resources across all pages.
+ :param InstanceGroupManagerActionsCollectionNext next: (optional) A link to
+ the next page of resources. This property is present for all pages
+ except the last page.
"""
- self.membership_count = membership_count
+ self.actions = actions
+ self.first = first
+ self.limit = limit
+ self.next = next
+ self.total_count = total_count
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerScheduledActionGroup':
- """Initialize a InstanceGroupManagerScheduledActionGroup object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerActionsCollection':
+ """Initialize a InstanceGroupManagerActionsCollection object from a json dictionary."""
args = {}
- if 'membership_count' in _dict:
- args['membership_count'] = _dict.get('membership_count')
+ if (actions := _dict.get('actions')) is not None:
+ args['actions'] = actions
else:
- raise ValueError('Required property \'membership_count\' not present in InstanceGroupManagerScheduledActionGroup JSON')
+ raise ValueError('Required property \'actions\' not present in InstanceGroupManagerActionsCollection JSON')
+ if (first := _dict.get('first')) is not None:
+ args['first'] = InstanceGroupManagerActionsCollectionFirst.from_dict(first)
+ else:
+ raise ValueError('Required property \'first\' not present in InstanceGroupManagerActionsCollection JSON')
+ if (limit := _dict.get('limit')) is not None:
+ args['limit'] = limit
+ else:
+ raise ValueError('Required property \'limit\' not present in InstanceGroupManagerActionsCollection JSON')
+ if (next := _dict.get('next')) is not None:
+ args['next'] = InstanceGroupManagerActionsCollectionNext.from_dict(next)
+ if (total_count := _dict.get('total_count')) is not None:
+ args['total_count'] = 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 InstanceGroupManagerScheduledActionGroup 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, 'membership_count') and self.membership_count is not None:
- _dict['membership_count'] = self.membership_count
+ if hasattr(self, 'actions') and self.actions is not None:
+ actions_list = []
+ for v in self.actions:
+ if isinstance(v, dict):
+ actions_list.append(v)
+ else:
+ actions_list.append(v.to_dict())
+ _dict['actions'] = actions_list
+ if hasattr(self, 'first') and self.first is not None:
+ if isinstance(self.first, dict):
+ _dict['first'] = self.first
+ else:
+ _dict['first'] = self.first.to_dict()
+ if hasattr(self, 'limit') and self.limit is not None:
+ _dict['limit'] = self.limit
+ if hasattr(self, 'next') and self.next is not None:
+ if isinstance(self.next, dict):
+ _dict['next'] = self.next
+ else:
+ _dict['next'] = self.next.to_dict()
+ if hasattr(self, 'total_count') and self.total_count is not None:
+ _dict['total_count'] = self.total_count
return _dict
def _to_dict(self):
@@ -46135,60 +48934,58 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this InstanceGroupManagerScheduledActionGroup object."""
+ """Return a `str` version of this InstanceGroupManagerActionsCollection object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceGroupManagerScheduledActionGroup') -> 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: 'InstanceGroupManagerScheduledActionGroup') -> bool:
+ def __ne__(self, other: 'InstanceGroupManagerActionsCollection') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class InstanceGroupManagerScheduledActionGroupPrototype:
+class InstanceGroupManagerActionsCollectionFirst:
"""
- InstanceGroupManagerScheduledActionGroupPrototype.
+ A link to the first page of resources.
- :attr int membership_count: The desired number of instance group members at the
- scheduled time.
+ :param str href: The URL for a page of resources.
"""
def __init__(
self,
- membership_count: int,
+ href: str,
) -> None:
"""
- Initialize a InstanceGroupManagerScheduledActionGroupPrototype object.
+ Initialize a InstanceGroupManagerActionsCollectionFirst object.
- :param int membership_count: The desired number of instance group members
- at the scheduled time.
+ :param str href: The URL for a page of resources.
"""
- self.membership_count = membership_count
+ self.href = href
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerScheduledActionGroupPrototype':
- """Initialize a InstanceGroupManagerScheduledActionGroupPrototype object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerActionsCollectionFirst':
+ """Initialize a InstanceGroupManagerActionsCollectionFirst object from a json dictionary."""
args = {}
- if 'membership_count' in _dict:
- args['membership_count'] = _dict.get('membership_count')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'membership_count\' not present in InstanceGroupManagerScheduledActionGroupPrototype JSON')
+ raise ValueError('Required property \'href\' not present in InstanceGroupManagerActionsCollectionFirst JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceGroupManagerScheduledActionGroupPrototype object from a json dictionary."""
+ """Initialize a InstanceGroupManagerActionsCollectionFirst object from 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, 'href') and self.href is not None:
+ _dict['href'] = self.href
return _dict
def _to_dict(self):
@@ -46196,212 +48993,59 @@ 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 InstanceGroupManagerActionsCollectionFirst object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceGroupManagerScheduledActionGroupPrototype') -> 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: 'InstanceGroupManagerScheduledActionGroupPrototype') -> bool:
+ def __ne__(self, other: 'InstanceGroupManagerActionsCollectionFirst') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class InstanceGroupManagerScheduledActionManager:
+class InstanceGroupManagerActionsCollectionNext:
"""
- InstanceGroupManagerScheduledActionManager.
+ 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.
"""
def __init__(
self,
+ href: str,
) -> None:
"""
- Initialize a InstanceGroupManagerScheduledActionManager object.
+ Initialize a InstanceGroupManagerActionsCollectionNext object.
+ :param str href: The URL for a page of resources.
"""
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['InstanceGroupManagerScheduledActionManagerAutoScale'])
- )
- raise Exception(msg)
+ self.href = href
-
-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:
- """
- InstanceGroupMembership.
-
- :attr datetime created_at: The date and time that the instance group manager
- policy was created.
- :attr bool delete_instance_on_membership_delete: If set to true, when deleting
- the membership the instance will also be deleted.
- :attr str href: The URL for this instance group membership.
- :attr str id: The unique identifier for this instance group membership.
- :attr InstanceReference instance:
- :attr InstanceTemplateReference instance_template:
- :attr str name: The name for this instance group membership. The name is unique
- across all memberships for the instance group.
- :attr LoadBalancerPoolMemberReference pool_member: (optional)
- :attr str status: The status of the instance group membership
- - `deleting`: Membership is deleting dependent resources
- - `failed`: Membership was unable to maintain dependent resources
- - `healthy`: Membership is active and serving in the group
- - `pending`: Membership is waiting for dependent resources
- - `unhealthy`: Membership has unhealthy dependent resources.
- :attr datetime updated_at: The date and time that the instance group membership
- was updated.
- """
-
- def __init__(
- self,
- created_at: datetime,
- delete_instance_on_membership_delete: bool,
- href: str,
- id: str,
- instance: 'InstanceReference',
- instance_template: 'InstanceTemplateReference',
- name: str,
- status: str,
- updated_at: datetime,
- *,
- pool_member: 'LoadBalancerPoolMemberReference' = None,
- ) -> None:
- """
- Initialize a InstanceGroupMembership object.
-
- :param datetime created_at: The date and time that the instance group
- manager policy was created.
- :param bool delete_instance_on_membership_delete: If set to true, when
- deleting the membership the instance will also be deleted.
- :param str href: The URL for this instance group membership.
- :param str id: The unique identifier for this instance group membership.
- :param InstanceReference instance:
- :param InstanceTemplateReference instance_template:
- :param str name: The name for this instance group membership. The name is
- unique across all memberships for the instance group.
- :param str status: The status of the instance group membership
- - `deleting`: Membership is deleting dependent resources
- - `failed`: Membership was unable to maintain dependent resources
- - `healthy`: Membership is active and serving in the group
- - `pending`: Membership is waiting for dependent resources
- - `unhealthy`: Membership has unhealthy dependent resources.
- :param datetime updated_at: The date and time that the instance group
- membership was updated.
- :param LoadBalancerPoolMemberReference pool_member: (optional)
- """
- self.created_at = created_at
- self.delete_instance_on_membership_delete = delete_instance_on_membership_delete
- self.href = href
- self.id = id
- self.instance = instance
- self.instance_template = instance_template
- self.name = name
- self.pool_member = pool_member
- self.status = status
- self.updated_at = updated_at
-
- @classmethod
- 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 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 InstanceGroupMembership 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'))
- else:
- raise ValueError('Required property \'instance_template\' not present in InstanceGroupMembership JSON')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
- else:
- raise ValueError('Required property \'name\' not present in InstanceGroupMembership JSON')
- if 'pool_member' in _dict:
- args['pool_member'] = LoadBalancerPoolMemberReference.from_dict(_dict.get('pool_member'))
- if 'status' in _dict:
- args['status'] = _dict.get('status')
- else:
- raise ValueError('Required property \'status\' not present in InstanceGroupMembership 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 InstanceGroupMembership JSON')
- return cls(**args)
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerActionsCollectionNext':
+ """Initialize a InstanceGroupManagerActionsCollectionNext object from a json dictionary."""
+ args = {}
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
+ else:
+ raise ValueError('Required property \'href\' not present in InstanceGroupManagerActionsCollectionNext JSON')
+ return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceGroupMembership object from a json dictionary."""
+ """Initialize a InstanceGroupManagerActionsCollectionNext object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, '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, 'instance') and self.instance is not None:
- if isinstance(self.instance, dict):
- _dict['instance'] = self.instance
- else:
- _dict['instance'] = self.instance.to_dict()
- if hasattr(self, 'instance_template') and self.instance_template is not None:
- if isinstance(self.instance_template, dict):
- _dict['instance_template'] = self.instance_template
- else:
- _dict['instance_template'] = self.instance_template.to_dict()
- if hasattr(self, 'name') and self.name is not None:
- _dict['name'] = self.name
- if hasattr(self, 'pool_member') and self.pool_member is not None:
- if isinstance(self.pool_member, dict):
- _dict['pool_member'] = self.pool_member
- else:
- _dict['pool_member'] = self.pool_member.to_dict()
- if hasattr(self, 'status') and self.status is not None:
- _dict['status'] = self.status
- if hasattr(self, 'updated_at') and self.updated_at is not None:
- _dict['updated_at'] = datetime_to_string(self.updated_at)
return _dict
def _to_dict(self):
@@ -46409,109 +49053,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 InstanceGroupManagerActionsCollectionNext object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceGroupMembership') -> 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: 'InstanceGroupMembership') -> bool:
+ def __ne__(self, other: 'InstanceGroupManagerActionsCollectionNext') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class StatusEnum(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.
- """
-
- DELETING = 'deleting'
- FAILED = 'failed'
- HEALTHY = 'healthy'
- PENDING = 'pending'
- UNHEALTHY = 'unhealthy'
-
-
-class InstanceGroupMembershipCollection:
+class InstanceGroupManagerCollection:
"""
- InstanceGroupMembershipCollection.
+ InstanceGroupManagerCollection.
- :attr InstanceGroupMembershipCollectionFirst first: A link to the first page of
+ :param InstanceGroupManagerCollectionFirst first: A link to the first page of
resources.
- :attr int limit: The maximum number of resources that can be returned by the
+ :param 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
+ :param List[InstanceGroupManager] managers: Collection of instance group
+ managers.
+ :param 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.
+ :param int total_count: The total number of resources across all pages.
"""
def __init__(
self,
- first: 'InstanceGroupMembershipCollectionFirst',
+ first: 'InstanceGroupManagerCollectionFirst',
limit: int,
- memberships: List['InstanceGroupMembership'],
+ managers: List['InstanceGroupManager'],
total_count: int,
*,
- next: 'InstanceGroupMembershipCollectionNext' = None,
+ next: Optional['InstanceGroupManagerCollectionNext'] = None,
) -> None:
"""
- Initialize a InstanceGroupMembershipCollection object.
+ Initialize a InstanceGroupManagerCollection object.
- :param InstanceGroupMembershipCollectionFirst first: A link to the first
- page of resources.
+ :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[InstanceGroupMembership] memberships: Collection of instance
- group memberships.
+ :param List[InstanceGroupManager] managers: Collection of instance group
+ managers.
:param int total_count: The total number of resources across all pages.
- :param InstanceGroupMembershipCollectionNext next: (optional) A link to the
+ :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.memberships = memberships
+ self.managers = managers
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) -> 'InstanceGroupManagerCollection':
+ """Initialize a InstanceGroupManagerCollection object from a json dictionary."""
args = {}
- if 'first' in _dict:
- args['first'] = InstanceGroupMembershipCollectionFirst.from_dict(_dict.get('first'))
+ if (first := _dict.get('first')) is not None:
+ args['first'] = InstanceGroupManagerCollectionFirst.from_dict(first)
else:
- raise ValueError('Required property \'first\' not present in InstanceGroupMembershipCollection JSON')
- if 'limit' in _dict:
- args['limit'] = _dict.get('limit')
+ raise ValueError('Required property \'first\' not present in InstanceGroupManagerCollection JSON')
+ if (limit := _dict.get('limit')) is not None:
+ args['limit'] = limit
else:
- raise ValueError('Required property \'limit\' not present in InstanceGroupMembershipCollection JSON')
- if 'memberships' in _dict:
- args['memberships'] = [InstanceGroupMembership.from_dict(v) for v in _dict.get('memberships')]
+ raise ValueError('Required property \'limit\' not present in InstanceGroupManagerCollection JSON')
+ if (managers := _dict.get('managers')) is not None:
+ args['managers'] = managers
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')
+ raise ValueError('Required property \'managers\' not present in InstanceGroupManagerCollection JSON')
+ if (next := _dict.get('next')) is not None:
+ args['next'] = InstanceGroupManagerCollectionNext.from_dict(next)
+ if (total_count := _dict.get('total_count')) is not None:
+ args['total_count'] = total_count
else:
- raise ValueError('Required property \'total_count\' not present in InstanceGroupMembershipCollection JSON')
+ raise ValueError('Required property \'total_count\' not present in InstanceGroupManagerCollection JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceGroupMembershipCollection object from a json dictionary."""
+ """Initialize a InstanceGroupManagerCollection object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -46524,14 +49151,14 @@ def to_dict(self) -> Dict:
_dict['first'] = self.first.to_dict()
if hasattr(self, 'limit') and self.limit is not None:
_dict['limit'] = self.limit
- if hasattr(self, 'memberships') and self.memberships is not None:
- memberships_list = []
- for v in self.memberships:
+ if hasattr(self, 'managers') and self.managers is not None:
+ managers_list = []
+ for v in self.managers:
if isinstance(v, dict):
- memberships_list.append(v)
+ managers_list.append(v)
else:
- memberships_list.append(v.to_dict())
- _dict['memberships'] = memberships_list
+ managers_list.append(v.to_dict())
+ _dict['managers'] = managers_list
if hasattr(self, 'next') and self.next is not None:
if isinstance(self.next, dict):
_dict['next'] = self.next
@@ -46546,25 +49173,25 @@ 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 InstanceGroupManagerCollection object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceGroupMembershipCollection') -> 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: 'InstanceGroupMembershipCollection') -> bool:
+ def __ne__(self, other: 'InstanceGroupManagerCollection') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class InstanceGroupMembershipCollectionFirst:
+class InstanceGroupManagerCollectionFirst:
"""
A link to the first page of resources.
- :attr str href: The URL for a page of resources.
+ :param str href: The URL for a page of resources.
"""
def __init__(
@@ -46572,25 +49199,25 @@ def __init__(
href: str,
) -> None:
"""
- Initialize a InstanceGroupMembershipCollectionFirst object.
+ Initialize a InstanceGroupManagerCollectionFirst 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) -> 'InstanceGroupManagerCollectionFirst':
+ """Initialize a InstanceGroupManagerCollectionFirst object from a json dictionary."""
args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'href\' not present in InstanceGroupMembershipCollectionFirst JSON')
+ raise ValueError('Required property \'href\' not present in InstanceGroupManagerCollectionFirst JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceGroupMembershipCollectionFirst object from a json dictionary."""
+ """Initialize a InstanceGroupManagerCollectionFirst object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -46605,26 +49232,26 @@ 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 InstanceGroupManagerCollectionFirst object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceGroupMembershipCollectionFirst') -> bool:
+ 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: 'InstanceGroupMembershipCollectionFirst') -> bool:
+ def __ne__(self, other: 'InstanceGroupManagerCollectionFirst') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class InstanceGroupMembershipCollectionNext:
+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.
+ :param str href: The URL for a page of resources.
"""
def __init__(
@@ -46632,25 +49259,25 @@ def __init__(
href: str,
) -> None:
"""
- Initialize a InstanceGroupMembershipCollectionNext object.
+ Initialize a InstanceGroupManagerCollectionNext 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) -> 'InstanceGroupManagerCollectionNext':
+ """Initialize a InstanceGroupManagerCollectionNext object from a json dictionary."""
args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'href\' not present in InstanceGroupMembershipCollectionNext JSON')
+ raise ValueError('Required property \'href\' not present in InstanceGroupManagerCollectionNext JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceGroupMembershipCollectionNext object from a json dictionary."""
+ """Initialize a InstanceGroupManagerCollectionNext object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -46665,58 +49292,107 @@ 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 InstanceGroupManagerCollectionNext object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceGroupMembershipCollectionNext') -> 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: 'InstanceGroupMembershipCollectionNext') -> bool:
+ def __ne__(self, other: 'InstanceGroupManagerCollectionNext') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class InstanceGroupMembershipPatch:
+class InstanceGroupManagerPatch:
"""
- InstanceGroupMembershipPatch.
+ InstanceGroupManagerPatch.
- :attr str name: (optional) The name for this instance group membership. The name
- must not be used by another membership for the instance group manager.
+ :param int aggregation_window: (optional) The time window in seconds to
+ aggregate metrics prior to evaluation.
+ :param int cooldown: (optional) The duration of time in seconds to pause further
+ scale actions after scaling has taken place.
+ :param bool management_enabled: (optional) Indicates whether this manager will
+ control the instance group.
+ :param int max_membership_count: (optional) The maximum number of members in a
+ managed instance group.
+ :param int min_membership_count: (optional) The minimum number of members in a
+ managed instance group.
+ :param str name: (optional) The name for this instance group manager. The name
+ must not be used by another manager for the instance group.
"""
def __init__(
self,
*,
- name: str = None,
+ aggregation_window: Optional[int] = None,
+ cooldown: Optional[int] = None,
+ management_enabled: Optional[bool] = None,
+ max_membership_count: Optional[int] = None,
+ min_membership_count: Optional[int] = None,
+ name: Optional[str] = None,
) -> None:
"""
- Initialize a InstanceGroupMembershipPatch object.
+ Initialize a InstanceGroupManagerPatch object.
- :param str name: (optional) The name for this instance group membership.
- The name must not be used by another membership for the instance group
- manager.
+ :param int aggregation_window: (optional) The time window in seconds to
+ aggregate metrics prior to evaluation.
+ :param int cooldown: (optional) The duration of time in seconds to pause
+ further scale actions after scaling has taken place.
+ :param bool management_enabled: (optional) Indicates whether this manager
+ will control the instance group.
+ :param int max_membership_count: (optional) The maximum number of members
+ in a managed instance group.
+ :param int min_membership_count: (optional) The minimum number of members
+ in a managed instance group.
+ :param str name: (optional) The name for this instance group manager. The
+ name must not be used by another manager for the instance group.
"""
+ self.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) -> 'InstanceGroupMembershipPatch':
- """Initialize a InstanceGroupMembershipPatch object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerPatch':
+ """Initialize a InstanceGroupManagerPatch object from a json dictionary."""
args = {}
- if 'name' in _dict:
- args['name'] = _dict.get('name')
+ if (aggregation_window := _dict.get('aggregation_window')) is not None:
+ args['aggregation_window'] = aggregation_window
+ if (cooldown := _dict.get('cooldown')) is not None:
+ args['cooldown'] = cooldown
+ if (management_enabled := _dict.get('management_enabled')) is not None:
+ args['management_enabled'] = management_enabled
+ if (max_membership_count := _dict.get('max_membership_count')) is not None:
+ args['max_membership_count'] = max_membership_count
+ if (min_membership_count := _dict.get('min_membership_count')) is not None:
+ args['min_membership_count'] = min_membership_count
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceGroupMembershipPatch 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, '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
@@ -46726,155 +49402,160 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this InstanceGroupMembershipPatch object."""
+ """Return a `str` version of this InstanceGroupManagerPatch object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceGroupMembershipPatch') -> 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: 'InstanceGroupMembershipPatch') -> bool:
+ def __ne__(self, other: 'InstanceGroupManagerPatch') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class InstanceGroupPatch:
+class InstanceGroupManagerPolicy:
"""
- To add or update load balancer specification for an instance group the
- `membership_count` must first be set to 0.
+ InstanceGroupManagerPolicy.
- :attr int application_port: (optional) The port to use for new load balancer
- pool members created by this instance group.
- This property must be set if and only if `load_balancer_pool` has been set.
- :attr InstanceTemplateIdentity instance_template: (optional) Instance template
- to use when creating new instances.
- Instance groups are not compatible with instance templates that specify `true`
- for
- `default_trusted_profile.auto_link`.
- :attr LoadBalancerIdentity load_balancer: (optional) The load balancer
- associated with `load_balancer_pool`.
- The load balancer must have `instance_groups_supported` set to `true`.
- This property must be set if and only if `load_balancer_pool` has been set.
- :attr LoadBalancerPoolIdentity load_balancer_pool: (optional) If specified, this
- instance group will manage the load balancer pool. A pool member
- will be created for each instance created by this group. The specified load
- balancer pool must not be used by another instance group in the VPC.
- If set, `load_balancer` and `application_port` must also be set.
- :attr int membership_count: (optional) The number of instances in the instance
- group.
- :attr str name: (optional) The name for this instance group. The name must not
- be used by another instance group in the region.
- :attr List[SubnetIdentity] subnets: (optional) The subnets to use when creating
- new instances.
+ :param datetime created_at: The date and time that the instance group manager
+ policy was created.
+ :param str href: The URL for this instance group manager policy.
+ :param str id: The unique identifier for this instance group manager policy.
+ :param str name: The name for this instance group manager policy. The name is
+ unique across all policies for the instance group manager.
+ :param datetime updated_at: The date and time that the instance group manager
+ policy was updated.
+ """
+
+ def __init__(
+ self,
+ created_at: datetime,
+ href: str,
+ id: str,
+ name: str,
+ updated_at: datetime,
+ ) -> None:
+ """
+ Initialize a InstanceGroupManagerPolicy object.
+
+ :param datetime created_at: The date and time that the instance group
+ manager policy was created.
+ :param str href: The URL for this instance group manager policy.
+ :param str id: The unique identifier for this instance group manager
+ policy.
+ :param str name: The name for this instance group manager policy. The name
+ is unique across all policies for the instance group manager.
+ :param datetime updated_at: The date and time that the instance group
+ manager policy was updated.
+ """
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy'])
+ )
+ raise Exception(msg)
+
+
+class InstanceGroupManagerPolicyCollection:
+ """
+ InstanceGroupManagerPolicyCollection.
+
+ :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 InstanceGroupManagerPolicyCollectionNext next: (optional) A link to the
+ next page of resources. This property is present for all pages
+ except the last page.
+ :param List[InstanceGroupManagerPolicy] policies: Collection of instance group
+ manager policies.
+ :param int total_count: The total number of resources across all pages.
"""
def __init__(
self,
+ first: 'InstanceGroupManagerPolicyCollectionFirst',
+ limit: int,
+ policies: List['InstanceGroupManagerPolicy'],
+ total_count: int,
*,
- 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,
+ next: Optional['InstanceGroupManagerPolicyCollectionNext'] = None,
) -> None:
"""
- Initialize a InstanceGroupPatch object.
+ Initialize a InstanceGroupManagerPolicyCollection object.
- :param int application_port: (optional) The port to use for new load
- balancer pool members created by this instance group.
- This property must be set if and only if `load_balancer_pool` has been set.
- :param InstanceTemplateIdentity instance_template: (optional) Instance
- template to use when creating new instances.
- Instance groups are not compatible with instance templates that specify
- `true` for
- `default_trusted_profile.auto_link`.
- :param LoadBalancerIdentity load_balancer: (optional) The load balancer
- associated with `load_balancer_pool`.
- The load balancer must have `instance_groups_supported` set to `true`.
- This property must be set if and only if `load_balancer_pool` has been set.
- :param LoadBalancerPoolIdentity load_balancer_pool: (optional) If
- specified, this instance group will manage the load balancer pool. A pool
- member
- will be created for each instance created by this group. The specified
- load
- balancer pool must not be used by another instance group in the VPC.
- If set, `load_balancer` and `application_port` must also be set.
- :param int membership_count: (optional) The number of instances in the
- instance group.
- :param str name: (optional) The name for this instance group. The name must
- not be used by another instance group in the region.
- :param List[SubnetIdentity] subnets: (optional) The subnets to use when
- creating new instances.
+ :param 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.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
+ self.first = first
+ self.limit = limit
+ self.next = next
+ self.policies = policies
+ self.total_count = total_count
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstanceGroupPatch':
- """Initialize a InstanceGroupPatch object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerPolicyCollection':
+ """Initialize a InstanceGroupManagerPolicyCollection 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')
+ if (first := _dict.get('first')) is not None:
+ args['first'] = InstanceGroupManagerPolicyCollectionFirst.from_dict(first)
+ else:
+ raise ValueError('Required property \'first\' not present in InstanceGroupManagerPolicyCollection JSON')
+ if (limit := _dict.get('limit')) is not None:
+ args['limit'] = limit
+ else:
+ raise ValueError('Required property \'limit\' not present in InstanceGroupManagerPolicyCollection JSON')
+ if (next := _dict.get('next')) is not None:
+ args['next'] = InstanceGroupManagerPolicyCollectionNext.from_dict(next)
+ if (policies := _dict.get('policies')) is not None:
+ args['policies'] = policies
+ else:
+ raise ValueError('Required property \'policies\' not present in InstanceGroupManagerPolicyCollection JSON')
+ if (total_count := _dict.get('total_count')) is not None:
+ args['total_count'] = 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 InstanceGroupPatch 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, '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
+ if hasattr(self, 'first') and self.first is not None:
+ if isinstance(self.first, dict):
+ _dict['first'] = self.first
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
+ _dict['first'] = self.first.to_dict()
+ if hasattr(self, 'limit') and self.limit is not None:
+ _dict['limit'] = self.limit
+ if hasattr(self, 'next') and self.next is not None:
+ if isinstance(self.next, dict):
+ _dict['next'] = self.next
else:
- _dict['load_balancer_pool'] = self.load_balancer_pool.to_dict()
- if hasattr(self, 'membership_count') and self.membership_count is not None:
- _dict['membership_count'] = self.membership_count
- if hasattr(self, 'name') and self.name is not None:
- _dict['name'] = self.name
- if hasattr(self, 'subnets') and self.subnets is not None:
- subnets_list = []
- for v in self.subnets:
+ _dict['next'] = self.next.to_dict()
+ if hasattr(self, 'policies') and self.policies is not None:
+ policies_list = []
+ for v in self.policies:
if isinstance(v, dict):
- subnets_list.append(v)
+ policies_list.append(v)
else:
- subnets_list.append(v.to_dict())
- _dict['subnets'] = subnets_list
+ policies_list.append(v.to_dict())
+ _dict['policies'] = policies_list
+ if hasattr(self, 'total_count') and self.total_count is not None:
+ _dict['total_count'] = self.total_count
return _dict
def _to_dict(self):
@@ -46882,106 +49563,58 @@ 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 InstanceGroupManagerPolicyCollection object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceGroupPatch') -> 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: 'InstanceGroupPatch') -> bool:
+ def __ne__(self, other: 'InstanceGroupManagerPolicyCollection') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class InstanceGroupReference:
+class InstanceGroupManagerPolicyCollectionFirst:
"""
- InstanceGroupReference.
+ A link to the first page of resources.
- :attr str crn: The CRN for this instance group.
- :attr InstanceGroupReferenceDeleted deleted: (optional) If present, this
- property indicates the referenced resource has been deleted, and provides
- some supplementary information.
- :attr str href: The URL for this instance group.
- :attr str id: The unique identifier for this instance group.
- :attr str name: The name for this instance group. The name is unique across all
- instance groups in the region.
+ :param str href: The URL for a page of resources.
"""
def __init__(
self,
- crn: str,
href: str,
- id: str,
- name: str,
- *,
- deleted: 'InstanceGroupReferenceDeleted' = None,
) -> None:
"""
- Initialize a InstanceGroupReference object.
+ Initialize a InstanceGroupManagerPolicyCollectionFirst object.
- :param str crn: The CRN for this instance group.
- :param str href: The URL for this instance group.
- :param str id: The unique identifier for this instance group.
- :param str name: The name for this instance group. The name is unique
- across all instance groups in the region.
- :param InstanceGroupReferenceDeleted deleted: (optional) If present, this
- property indicates the referenced resource has been deleted, and provides
- 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) -> 'InstanceGroupReference':
- """Initialize a InstanceGroupReference 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 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 InstanceGroupReference JSON')
- if 'id' in _dict:
- args['id'] = _dict.get('id')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'id\' not present in InstanceGroupReference JSON')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
- else:
- raise ValueError('Required property \'name\' not present in InstanceGroupReference JSON')
+ raise ValueError('Required property \'href\' not present in InstanceGroupManagerPolicyCollectionFirst JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceGroupReference 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:
- if isinstance(self.deleted, dict):
- _dict['deleted'] = self.deleted
- else:
- _dict['deleted'] = self.deleted.to_dict()
if hasattr(self, 'href') and self.href is not None:
_dict['href'] = self.href
- if hasattr(self, 'id') and self.id is not None:
- _dict['id'] = self.id
- if hasattr(self, 'name') and self.name is not None:
- _dict['name'] = self.name
return _dict
def _to_dict(self):
@@ -46989,59 +49622,59 @@ 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 InstanceGroupManagerPolicyCollectionFirst object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceGroupReference') -> 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: 'InstanceGroupReference') -> bool:
+ def __ne__(self, other: 'InstanceGroupManagerPolicyCollectionFirst') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class InstanceGroupReferenceDeleted:
+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.
+ :param str href: The URL for a page of resources.
"""
def __init__(
self,
- more_info: str,
+ href: str,
) -> None:
"""
- Initialize a InstanceGroupReferenceDeleted 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) -> 'InstanceGroupReferenceDeleted':
- """Initialize a InstanceGroupReferenceDeleted 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 := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'more_info\' not present in InstanceGroupReferenceDeleted JSON')
+ raise ValueError('Required property \'href\' not present in InstanceGroupManagerPolicyCollectionNext JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceGroupReferenceDeleted 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):
@@ -47049,95 +49682,76 @@ 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 InstanceGroupManagerPolicyCollectionNext object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceGroupReferenceDeleted') -> 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: 'InstanceGroupReferenceDeleted') -> bool:
+ def __ne__(self, other: 'InstanceGroupManagerPolicyCollectionNext') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class InstanceInitialization:
+class InstanceGroupManagerPolicyPatch:
"""
- InstanceInitialization.
+ InstanceGroupManagerPolicyPatch.
- :attr InstanceInitializationDefaultTrustedProfile default_trusted_profile:
- (optional) The default trusted profile configuration specified at virtual server
- instance
- creation. If absent, no default trusted profile was specified.
- :attr List[KeyReference] keys: The public SSH keys used at instance
- initialization.
- :attr InstanceInitializationPassword password: (optional)
+ :param str metric_type: (optional) The type of metric to be evaluated.
+ :param int metric_value: (optional) The metric value to be evaluated.
+ :param str name: (optional) The name for this instance group manager policy. The
+ name must not be used by another policy for the instance group manager.
"""
def __init__(
self,
- keys: List['KeyReference'],
*,
- default_trusted_profile: 'InstanceInitializationDefaultTrustedProfile' = None,
- password: 'InstanceInitializationPassword' = None,
+ metric_type: Optional[str] = None,
+ metric_value: Optional[int] = None,
+ name: Optional[str] = None,
) -> None:
"""
- Initialize a InstanceInitialization object.
+ Initialize a InstanceGroupManagerPolicyPatch object.
- :param List[KeyReference] keys: The public SSH keys used at instance
- initialization.
- :param InstanceInitializationDefaultTrustedProfile default_trusted_profile:
- (optional) The default trusted profile configuration specified at virtual
- server instance
- creation. If absent, no default trusted profile was specified.
- :param InstanceInitializationPassword password: (optional)
+ :param str metric_type: (optional) The type of metric to be evaluated.
+ :param int metric_value: (optional) The metric value to be evaluated.
+ :param str name: (optional) The name for this instance group manager
+ policy. The name must not be used by another policy for the instance group
+ manager.
"""
- self.default_trusted_profile = default_trusted_profile
- self.keys = keys
- self.password = password
+ self.metric_type = metric_type
+ self.metric_value = metric_value
+ self.name = name
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstanceInitialization':
- """Initialize a InstanceInitialization object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerPolicyPatch':
+ """Initialize a InstanceGroupManagerPolicyPatch object from a json dictionary."""
args = {}
- if 'default_trusted_profile' in _dict:
- args['default_trusted_profile'] = InstanceInitializationDefaultTrustedProfile.from_dict(_dict.get('default_trusted_profile'))
- if 'keys' in _dict:
- args['keys'] = [KeyReference.from_dict(v) for v in _dict.get('keys')]
- else:
- raise ValueError('Required property \'keys\' not present in InstanceInitialization JSON')
- if 'password' in _dict:
- args['password'] = InstanceInitializationPassword.from_dict(_dict.get('password'))
+ if (metric_type := _dict.get('metric_type')) is not None:
+ args['metric_type'] = metric_type
+ if (metric_value := _dict.get('metric_value')) is not None:
+ args['metric_value'] = metric_value
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceInitialization 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, 'default_trusted_profile') and self.default_trusted_profile is not None:
- if isinstance(self.default_trusted_profile, dict):
- _dict['default_trusted_profile'] = self.default_trusted_profile
- else:
- _dict['default_trusted_profile'] = self.default_trusted_profile.to_dict()
- if hasattr(self, 'keys') and self.keys is not None:
- keys_list = []
- for v in self.keys:
- if isinstance(v, dict):
- keys_list.append(v)
- else:
- keys_list.append(v.to_dict())
- _dict['keys'] = keys_list
- if hasattr(self, 'password') and self.password is not None:
- if isinstance(self.password, dict):
- _dict['password'] = self.password
- else:
- _dict['password'] = self.password.to_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):
@@ -47145,79 +49759,138 @@ 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 InstanceGroupManagerPolicyPatch object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceInitialization') -> 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: 'InstanceInitialization') -> bool:
+ def __ne__(self, other: 'InstanceGroupManagerPolicyPatch') -> 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.
+ """
-class InstanceInitializationDefaultTrustedProfile:
+ CPU = 'cpu'
+ MEMORY = 'memory'
+ NETWORK_IN = 'network_in'
+ NETWORK_OUT = 'network_out'
+
+
+
+class InstanceGroupManagerPolicyPrototype:
"""
- InstanceInitializationDefaultTrustedProfile.
+ InstanceGroupManagerPolicyPrototype.
- :attr bool auto_link: If set to `true`, the system created a link to the
- specified `target` trusted profile during instance creation. Regardless of
- whether a link was created by the system or manually using the IAM Identity
- service, it will be automatically deleted when the instance is deleted.
- :attr TrustedProfileReference target: The default IAM trusted profile to use for
- this virtual server instance.
+ :param str name: (optional) The name for this instance group manager policy. The
+ name must not be used by another policy for the instance group manager. If
+ unspecified, the name will be a hyphenated list of randomly-selected words.
"""
def __init__(
self,
- auto_link: bool,
- target: 'TrustedProfileReference',
+ *,
+ name: Optional[str] = None,
) -> None:
"""
- Initialize a InstanceInitializationDefaultTrustedProfile object.
+ Initialize a InstanceGroupManagerPolicyPrototype object.
- :param bool auto_link: If set to `true`, the system created a link to the
- specified `target` trusted profile during instance creation. Regardless of
- whether a link was created by the system or manually using the IAM Identity
- service, it will be automatically deleted when the instance is deleted.
- :param TrustedProfileReference target: The default IAM trusted profile to
- use for this virtual server instance.
+ :param str name: (optional) The name for this instance group manager
+ policy. The name must not be used by another policy for the instance group
+ manager. If unspecified, the name will be a hyphenated list of
+ randomly-selected words.
"""
- self.auto_link = auto_link
- self.target = target
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype'])
+ )
+ raise Exception(msg)
+
+
+class InstanceGroupManagerPolicyReference:
+ """
+ InstanceGroupManagerPolicyReference.
+
+ :param InstanceGroupManagerPolicyReferenceDeleted deleted: (optional) If
+ present, this property indicates the referenced resource has been deleted, and
+ provides
+ some supplementary information.
+ :param str href: The URL for this instance group manager policy.
+ :param str id: The unique identifier for this instance group manager policy.
+ :param str name: The name for this instance group manager policy. The name is
+ unique across all policies for the instance group manager.
+ """
+
+ def __init__(
+ self,
+ href: str,
+ id: str,
+ name: str,
+ *,
+ deleted: Optional['InstanceGroupManagerPolicyReferenceDeleted'] = None,
+ ) -> None:
+ """
+ Initialize a InstanceGroupManagerPolicyReference object.
+
+ :param str href: The URL for this instance group manager policy.
+ :param str id: The unique identifier for this instance group manager
+ policy.
+ :param str name: The name for this instance group manager policy. The name
+ is unique across all policies for the instance group manager.
+ :param InstanceGroupManagerPolicyReferenceDeleted deleted: (optional) If
+ present, this property indicates the referenced resource has been deleted,
+ and provides
+ some supplementary information.
+ """
+ self.deleted = deleted
+ self.href = href
+ self.id = id
+ self.name = name
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstanceInitializationDefaultTrustedProfile':
- """Initialize a InstanceInitializationDefaultTrustedProfile object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerPolicyReference':
+ """Initialize a InstanceGroupManagerPolicyReference object from a json dictionary."""
args = {}
- if 'auto_link' in _dict:
- args['auto_link'] = _dict.get('auto_link')
+ if (deleted := _dict.get('deleted')) is not None:
+ args['deleted'] = InstanceGroupManagerPolicyReferenceDeleted.from_dict(deleted)
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'auto_link\' not present in InstanceInitializationDefaultTrustedProfile JSON')
- if 'target' in _dict:
- args['target'] = TrustedProfileReference.from_dict(_dict.get('target'))
+ raise ValueError('Required property \'href\' not present in InstanceGroupManagerPolicyReference JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
else:
- raise ValueError('Required property \'target\' not present in InstanceInitializationDefaultTrustedProfile JSON')
+ raise ValueError('Required property \'id\' not present in InstanceGroupManagerPolicyReference JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ else:
+ raise ValueError('Required property \'name\' not present in InstanceGroupManagerPolicyReference JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceInitializationDefaultTrustedProfile 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, 'auto_link') and self.auto_link is not None:
- _dict['auto_link'] = self.auto_link
- if hasattr(self, 'target') and self.target is not None:
- if isinstance(self.target, dict):
- _dict['target'] = self.target
+ if hasattr(self, 'deleted') and self.deleted is not None:
+ if isinstance(self.deleted, dict):
+ _dict['deleted'] = self.deleted
else:
- _dict['target'] = self.target.to_dict()
+ _dict['deleted'] = self.deleted.to_dict()
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
+ if hasattr(self, 'id') and self.id is not None:
+ _dict['id'] = self.id
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
return _dict
def _to_dict(self):
@@ -47225,76 +49898,59 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this InstanceInitializationDefaultTrustedProfile object."""
+ """Return a `str` version of this InstanceGroupManagerPolicyReference object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceInitializationDefaultTrustedProfile') -> 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: 'InstanceInitializationDefaultTrustedProfile') -> bool:
+ def __ne__(self, other: 'InstanceGroupManagerPolicyReference') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class InstanceInitializationPassword:
+class InstanceGroupManagerPolicyReferenceDeleted:
"""
- InstanceInitializationPassword.
+ If present, this property indicates the referenced resource has been deleted, and
+ provides some supplementary information.
- :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.
+ :param str more_info: Link to documentation about deleted resources.
"""
def __init__(
self,
- encrypted_password: bytes,
- encryption_key: 'KeyIdentityByFingerprint',
+ more_info: str,
) -> None:
"""
- Initialize a InstanceInitializationPassword object.
+ Initialize a InstanceGroupManagerPolicyReferenceDeleted object.
- :param bytes encrypted_password: The administrator password at
- initialization, encrypted using `encryption_key`, and returned
- base64-encoded.
- :param KeyIdentityByFingerprint encryption_key: The public SSH key used to
- encrypt the administrator password.
+ :param str more_info: Link to documentation about deleted resources.
"""
- self.encrypted_password = encrypted_password
- self.encryption_key = encryption_key
+ self.more_info = more_info
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstanceInitializationPassword':
- """Initialize a InstanceInitializationPassword object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerPolicyReferenceDeleted':
+ """Initialize a InstanceGroupManagerPolicyReferenceDeleted object from a json dictionary."""
args = {}
- if 'encrypted_password' in _dict:
- args['encrypted_password'] = base64.b64decode(_dict.get('encrypted_password'))
+ if (more_info := _dict.get('more_info')) is not None:
+ args['more_info'] = more_info
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')
+ raise ValueError('Required property \'more_info\' not present in InstanceGroupManagerPolicyReferenceDeleted JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceInitializationPassword 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, 'encrypted_password') and self.encrypted_password is not None:
- _dict['encrypted_password'] = str(base64.b64encode(self.encrypted_password), 'utf-8')
- if hasattr(self, 'encryption_key') and self.encryption_key is not None:
- if isinstance(self.encryption_key, dict):
- _dict['encryption_key'] = self.encryption_key
- else:
- _dict['encryption_key'] = self.encryption_key.to_dict()
+ if hasattr(self, 'more_info') and self.more_info is not None:
+ _dict['more_info'] = self.more_info
return _dict
def _to_dict(self):
@@ -47302,81 +49958,129 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this InstanceInitializationPassword object."""
+ """Return a `str` version of this InstanceGroupManagerPolicyReferenceDeleted object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceInitializationPassword') -> 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: 'InstanceInitializationPassword') -> bool:
+ def __ne__(self, other: 'InstanceGroupManagerPolicyReferenceDeleted') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class InstanceLifecycleReason:
+class InstanceGroupManagerPrototype:
"""
- InstanceLifecycleReason.
+ InstanceGroupManagerPrototype.
- :attr str code: A snake case string succinctly identifying the reason for this
- lifecycle state.
- :attr str message: An explanation of the reason for this lifecycle state.
- :attr str more_info: (optional) Link to documentation about the reason for this
- lifecycle state.
+ :param bool management_enabled: (optional) Indicates whether this manager will
+ control the instance group.
+ :param str name: (optional) The name for this instance group manager. The name
+ must not be used by another manager for the instance group. If unspecified, the
+ name will be a hyphenated list of randomly-selected words.
"""
def __init__(
self,
- code: str,
- message: str,
*,
- more_info: str = None,
+ management_enabled: Optional[bool] = None,
+ name: Optional[str] = None,
) -> None:
"""
- Initialize a InstanceLifecycleReason object.
+ Initialize a InstanceGroupManagerPrototype object.
- :param str code: A snake case string succinctly identifying the reason for
- this lifecycle state.
- :param str message: An explanation of the reason for this lifecycle state.
- :param str more_info: (optional) Link to documentation about the reason for
- this lifecycle state.
+ :param bool management_enabled: (optional) Indicates whether this manager
+ will control the instance group.
+ :param str name: (optional) The name for this instance group manager. The
+ name must not be used by another manager for the instance group. If
+ unspecified, the name will be a hyphenated list of randomly-selected words.
"""
- self.code = code
- self.message = message
- self.more_info = more_info
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype', 'InstanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype'])
+ )
+ raise Exception(msg)
+
+
+class InstanceGroupManagerReference:
+ """
+ InstanceGroupManagerReference.
+
+ :param InstanceGroupManagerReferenceDeleted 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 instance group manager.
+ :param str id: The unique identifier for this instance group manager.
+ :param str name: The name for this instance group manager. The name is unique
+ across all managers for the instance group.
+ """
+
+ def __init__(
+ self,
+ href: str,
+ id: str,
+ name: str,
+ *,
+ deleted: Optional['InstanceGroupManagerReferenceDeleted'] = None,
+ ) -> None:
+ """
+ Initialize a InstanceGroupManagerReference object.
+
+ :param str href: The URL for this instance group manager.
+ :param str id: The unique identifier for this instance group manager.
+ :param str name: The name for this instance group manager. The name is
+ unique across all managers for the instance group.
+ :param InstanceGroupManagerReferenceDeleted deleted: (optional) If present,
+ this property indicates the referenced resource has been deleted, and
+ provides
+ some supplementary information.
+ """
+ self.deleted = deleted
+ self.href = href
+ self.id = id
+ self.name = name
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstanceLifecycleReason':
- """Initialize a InstanceLifecycleReason object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerReference':
+ """Initialize a InstanceGroupManagerReference object from a json dictionary."""
args = {}
- if 'code' in _dict:
- args['code'] = _dict.get('code')
+ if (deleted := _dict.get('deleted')) is not None:
+ args['deleted'] = InstanceGroupManagerReferenceDeleted.from_dict(deleted)
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'code\' not present in InstanceLifecycleReason JSON')
- if 'message' in _dict:
- args['message'] = _dict.get('message')
+ raise ValueError('Required property \'href\' not present in InstanceGroupManagerReference JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
else:
- raise ValueError('Required property \'message\' not present in InstanceLifecycleReason JSON')
- if 'more_info' in _dict:
- args['more_info'] = _dict.get('more_info')
+ raise ValueError('Required property \'id\' not present in InstanceGroupManagerReference JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ else:
+ raise ValueError('Required property \'name\' not present in InstanceGroupManagerReference JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceLifecycleReason 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, '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, 'deleted') and self.deleted is not None:
+ if isinstance(self.deleted, dict):
+ _dict['deleted'] = self.deleted
+ else:
+ _dict['deleted'] = self.deleted.to_dict()
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
+ if hasattr(self, 'id') and self.id is not None:
+ _dict['id'] = self.id
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
return _dict
def _to_dict(self):
@@ -47384,98 +50088,59 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this InstanceLifecycleReason object."""
+ """Return a `str` version of this InstanceGroupManagerReference object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceLifecycleReason') -> 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: 'InstanceLifecycleReason') -> bool:
+ def __ne__(self, other: 'InstanceGroupManagerReference') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class CodeEnum(str, Enum):
- """
- A snake case string succinctly identifying the reason for this lifecycle state.
- """
-
- RESOURCE_SUSPENDED_BY_PROVIDER = 'resource_suspended_by_provider'
-
-
-class InstanceMetadataService:
+class InstanceGroupManagerReferenceDeleted:
"""
- The metadata service configuration.
+ If present, this property indicates the referenced resource has been deleted, and
+ provides some supplementary information.
- :attr bool enabled: Indicates whether the metadata service endpoint is available
- to the virtual server instance.
- :attr str protocol: The communication protocol to use for the metadata service
- endpoint. Applies only when the metadata service is enabled.
- - `http`: HTTP protocol (unencrypted)
- - `https`: HTTP Secure protocol.
- :attr int response_hop_limit: The hop limit (IP time to live) for IP response
- packets from the metadata service. Applies only when the metadata service is
- enabled.
+ :param str more_info: Link to documentation about deleted resources.
"""
def __init__(
self,
- enabled: bool,
- protocol: str,
- response_hop_limit: int,
+ more_info: str,
) -> None:
"""
- Initialize a InstanceMetadataService object.
+ Initialize a InstanceGroupManagerReferenceDeleted object.
- :param bool enabled: Indicates whether the metadata service endpoint is
- available to the virtual server instance.
- :param str protocol: The communication protocol to use for the metadata
- service endpoint. Applies only when the metadata service is enabled.
- - `http`: HTTP protocol (unencrypted)
- - `https`: HTTP Secure protocol.
- :param int response_hop_limit: The hop limit (IP time to live) for IP
- response packets from the metadata service. Applies only when the metadata
- service is enabled.
+ :param str more_info: Link to documentation about deleted resources.
"""
- self.enabled = enabled
- self.protocol = protocol
- self.response_hop_limit = response_hop_limit
+ self.more_info = more_info
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstanceMetadataService':
- """Initialize a InstanceMetadataService object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerReferenceDeleted':
+ """Initialize a InstanceGroupManagerReferenceDeleted object from a json dictionary."""
args = {}
- if 'enabled' in _dict:
- args['enabled'] = _dict.get('enabled')
- else:
- raise ValueError('Required property \'enabled\' not present in InstanceMetadataService JSON')
- if 'protocol' in _dict:
- args['protocol'] = _dict.get('protocol')
+ if (more_info := _dict.get('more_info')) is not None:
+ args['more_info'] = more_info
else:
- raise ValueError('Required property \'protocol\' not present in InstanceMetadataService JSON')
- if 'response_hop_limit' in _dict:
- args['response_hop_limit'] = _dict.get('response_hop_limit')
- else:
- raise ValueError('Required property \'response_hop_limit\' not present in InstanceMetadataService JSON')
+ raise ValueError('Required property \'more_info\' not present in InstanceGroupManagerReferenceDeleted JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceMetadataService 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, 'enabled') and self.enabled is not None:
- _dict['enabled'] = self.enabled
- if hasattr(self, 'protocol') and self.protocol is not None:
- _dict['protocol'] = self.protocol
- if hasattr(self, 'response_hop_limit') and self.response_hop_limit is not None:
- _dict['response_hop_limit'] = self.response_hop_limit
+ if hasattr(self, 'more_info') and self.more_info is not None:
+ _dict['more_info'] = self.more_info
return _dict
def _to_dict(self):
@@ -47483,98 +50148,60 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this InstanceMetadataService object."""
+ """Return a `str` version of this InstanceGroupManagerReferenceDeleted object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceMetadataService') -> 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: 'InstanceMetadataService') -> bool:
+ def __ne__(self, other: 'InstanceGroupManagerReferenceDeleted') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class ProtocolEnum(str, Enum):
- """
- The communication protocol to use for the metadata service endpoint. Applies only
- when the metadata service is enabled.
- - `http`: HTTP protocol (unencrypted)
- - `https`: HTTP Secure protocol.
- """
-
- HTTP = 'http'
- HTTPS = 'https'
-
-
-class InstanceMetadataServicePatch:
+class InstanceGroupManagerScheduledActionGroup:
"""
- The metadata service configuration.
+ InstanceGroupManagerScheduledActionGroup.
- :attr bool enabled: (optional) Indicates whether the metadata service endpoint
- will be available to the virtual server instance.
- :attr str protocol: (optional) The communication protocol to use for the
- metadata service endpoint. Applies only when the metadata service is enabled.
- - `http`: HTTP protocol (unencrypted)
- - `https`: HTTP Secure protocol.
- :attr int response_hop_limit: (optional) The hop limit (IP time to live) for IP
- response packets from the metadata service. Applies only when the metadata
- service is enabled.
+ :param int membership_count: The desired number of instance group members at the
+ scheduled time.
"""
def __init__(
self,
- *,
- enabled: bool = None,
- protocol: str = None,
- response_hop_limit: int = None,
+ membership_count: int,
) -> None:
"""
- Initialize a InstanceMetadataServicePatch object.
+ Initialize a InstanceGroupManagerScheduledActionGroup object.
- :param bool enabled: (optional) Indicates whether the metadata service
- endpoint will be available to the virtual server instance.
- :param str protocol: (optional) The communication protocol to use for the
- metadata service endpoint. Applies only when the metadata service is
- enabled.
- - `http`: HTTP protocol (unencrypted)
- - `https`: HTTP Secure protocol.
- :param int response_hop_limit: (optional) The hop limit (IP time to live)
- for IP response packets from the metadata service. Applies only when the
- metadata service is enabled.
+ :param int membership_count: The desired number of instance group members
+ at the scheduled time.
"""
- self.enabled = enabled
- self.protocol = protocol
- self.response_hop_limit = response_hop_limit
+ self.membership_count = membership_count
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstanceMetadataServicePatch':
- """Initialize a InstanceMetadataServicePatch object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerScheduledActionGroup':
+ """Initialize a InstanceGroupManagerScheduledActionGroup object from a json dictionary."""
args = {}
- if 'enabled' in _dict:
- args['enabled'] = _dict.get('enabled')
- if 'protocol' in _dict:
- args['protocol'] = _dict.get('protocol')
- if 'response_hop_limit' in _dict:
- args['response_hop_limit'] = _dict.get('response_hop_limit')
+ if (membership_count := _dict.get('membership_count')) is not None:
+ args['membership_count'] = 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 InstanceMetadataServicePatch 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, 'enabled') and self.enabled is not None:
- _dict['enabled'] = self.enabled
- if hasattr(self, 'protocol') and self.protocol is not None:
- _dict['protocol'] = self.protocol
- if hasattr(self, 'response_hop_limit') and self.response_hop_limit is not None:
- _dict['response_hop_limit'] = self.response_hop_limit
+ if hasattr(self, 'membership_count') and self.membership_count is not None:
+ _dict['membership_count'] = self.membership_count
return _dict
def _to_dict(self):
@@ -47582,98 +50209,60 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this InstanceMetadataServicePatch object."""
+ """Return a `str` version of this InstanceGroupManagerScheduledActionGroup object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceMetadataServicePatch') -> 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: 'InstanceMetadataServicePatch') -> bool:
+ def __ne__(self, other: 'InstanceGroupManagerScheduledActionGroup') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class ProtocolEnum(str, Enum):
- """
- The communication protocol to use for the metadata service endpoint. Applies only
- when the metadata service is enabled.
- - `http`: HTTP protocol (unencrypted)
- - `https`: HTTP Secure protocol.
- """
-
- HTTP = 'http'
- HTTPS = 'https'
-
-
-class InstanceMetadataServicePrototype:
+class InstanceGroupManagerScheduledActionGroupPrototype:
"""
- The metadata service configuration.
+ InstanceGroupManagerScheduledActionGroupPrototype.
- :attr bool enabled: (optional) Indicates whether the metadata service endpoint
- will be available to the virtual server instance.
- :attr str protocol: (optional) The communication protocol to use for the
- metadata service endpoint. Applies only when the metadata service is enabled.
- - `http`: HTTP protocol (unencrypted)
- - `https`: HTTP Secure protocol.
- :attr int response_hop_limit: (optional) The hop limit (IP time to live) for IP
- response packets from the metadata service. Applies only when the metadata
- service is enabled.
+ :param int membership_count: The desired number of instance group members at the
+ scheduled time.
"""
def __init__(
self,
- *,
- enabled: bool = None,
- protocol: str = None,
- response_hop_limit: int = None,
+ membership_count: int,
) -> None:
"""
- Initialize a InstanceMetadataServicePrototype object.
+ Initialize a InstanceGroupManagerScheduledActionGroupPrototype object.
- :param bool enabled: (optional) Indicates whether the metadata service
- endpoint will be available to the virtual server instance.
- :param str protocol: (optional) The communication protocol to use for the
- metadata service endpoint. Applies only when the metadata service is
- enabled.
- - `http`: HTTP protocol (unencrypted)
- - `https`: HTTP Secure protocol.
- :param int response_hop_limit: (optional) The hop limit (IP time to live)
- for IP response packets from the metadata service. Applies only when the
- metadata service is enabled.
+ :param int membership_count: The desired number of instance group members
+ at the scheduled time.
"""
- self.enabled = enabled
- self.protocol = protocol
- self.response_hop_limit = response_hop_limit
+ self.membership_count = membership_count
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstanceMetadataServicePrototype':
- """Initialize a InstanceMetadataServicePrototype object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerScheduledActionGroupPrototype':
+ """Initialize a InstanceGroupManagerScheduledActionGroupPrototype object from a json dictionary."""
args = {}
- if 'enabled' in _dict:
- args['enabled'] = _dict.get('enabled')
- if 'protocol' in _dict:
- args['protocol'] = _dict.get('protocol')
- if 'response_hop_limit' in _dict:
- args['response_hop_limit'] = _dict.get('response_hop_limit')
+ if (membership_count := _dict.get('membership_count')) is not None:
+ args['membership_count'] = membership_count
+ else:
+ raise ValueError('Required property \'membership_count\' not present in InstanceGroupManagerScheduledActionGroupPrototype JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceMetadataServicePrototype 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, 'enabled') and self.enabled is not None:
- _dict['enabled'] = self.enabled
- if hasattr(self, 'protocol') and self.protocol is not None:
- _dict['protocol'] = self.protocol
- if hasattr(self, 'response_hop_limit') and self.response_hop_limit is not None:
- _dict['response_hop_limit'] = self.response_hop_limit
+ if hasattr(self, 'membership_count') and self.membership_count is not None:
+ _dict['membership_count'] = self.membership_count
return _dict
def _to_dict(self):
@@ -47681,171 +50270,212 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this InstanceMetadataServicePrototype object."""
+ """Return a `str` version of this InstanceGroupManagerScheduledActionGroupPrototype object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceMetadataServicePrototype') -> 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: 'InstanceMetadataServicePrototype') -> bool:
+ def __ne__(self, other: 'InstanceGroupManagerScheduledActionGroupPrototype') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class ProtocolEnum(str, Enum):
+
+class InstanceGroupManagerScheduledActionManager:
+ """
+ InstanceGroupManagerScheduledActionManager.
+
+ """
+
+ def __init__(
+ self,
+ ) -> None:
"""
- The communication protocol to use for the metadata service endpoint. Applies only
- when the metadata service is enabled.
- - `http`: HTTP protocol (unencrypted)
- - `https`: HTTP Secure protocol.
+ Initialize a InstanceGroupManagerScheduledActionManager object.
+
"""
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['InstanceGroupManagerScheduledActionManagerAutoScale'])
+ )
+ raise Exception(msg)
- HTTP = 'http'
- HTTPS = 'https'
+class InstanceGroupManagerScheduledActionManagerPrototype:
+ """
+ InstanceGroupManagerScheduledActionManagerPrototype.
+
+ """
+ def __init__(
+ self,
+ ) -> None:
+ """
+ Initialize a InstanceGroupManagerScheduledActionManagerPrototype object.
-class InstancePatch:
+ """
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototype'])
+ )
+ raise Exception(msg)
+
+
+class InstanceGroupMembership:
"""
- InstancePatch.
+ InstanceGroupMembership.
- :attr InstanceAvailabilityPolicyPatch availability_policy: (optional) The
- availability policy for this virtual server instance.
- :attr InstanceMetadataServicePatch metadata_service: (optional) The metadata
- service configuration.
- :attr str name: (optional) The name for this virtual server instance. The name
- must not be used by another virtual server instance in the region. Changing the
- name will not affect the system hostname.
- :attr InstancePlacementTargetPatch placement_target: (optional) The placement
- restrictions to use for the virtual server instance. For the placement
- restrictions to be changed, the instance `status` must be `stopping` or
- `stopped`.
- :attr InstancePatchProfile profile: (optional) The profile to use for this
- virtual server instance. For the profile to be changed,
- the instance `status` must be `stopping` or `stopped`. In addition, the
- requested
- profile must:
- - Have matching instance disk support. Any disks associated with the current
- profile
- will be deleted, and any disks associated with the requested profile will be
- created.
- - Be compatible with any `placement_target` constraints. For example, if the
- instance is placed on a dedicated host, the requested profile `family` must be
- the same as the dedicated host `family`.
- - Have the same `vcpu.architecture`.
- - Support the number of network interfaces the instance currently has.
- :attr int total_volume_bandwidth: (optional) The amount of bandwidth (in
- megabits per second) allocated exclusively to instance storage volumes. An
- increase in this value will result in a corresponding decrease to
- `total_network_bandwidth`.
+ :param datetime created_at: The date and time that the instance group manager
+ policy was created.
+ :param bool delete_instance_on_membership_delete: If set to true, when deleting
+ the membership the instance will also be deleted.
+ :param str href: The URL for this instance group membership.
+ :param str id: The unique identifier for this instance group membership.
+ :param InstanceReference instance:
+ :param InstanceTemplateReference instance_template:
+ :param str name: The name for this instance group membership. The name is unique
+ across all memberships for the instance group.
+ :param LoadBalancerPoolMemberReference pool_member: (optional)
+ :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.
"""
def __init__(
self,
+ created_at: datetime,
+ delete_instance_on_membership_delete: bool,
+ href: str,
+ id: str,
+ instance: 'InstanceReference',
+ instance_template: 'InstanceTemplateReference',
+ name: str,
+ status: str,
+ updated_at: datetime,
*,
- availability_policy: 'InstanceAvailabilityPolicyPatch' = None,
- metadata_service: 'InstanceMetadataServicePatch' = None,
- name: str = None,
- placement_target: 'InstancePlacementTargetPatch' = None,
- profile: 'InstancePatchProfile' = None,
- total_volume_bandwidth: int = None,
+ pool_member: Optional['LoadBalancerPoolMemberReference'] = None,
) -> None:
"""
- Initialize a InstancePatch object.
+ Initialize a InstanceGroupMembership object.
- :param InstanceAvailabilityPolicyPatch availability_policy: (optional) The
- availability policy for this virtual server instance.
- :param InstanceMetadataServicePatch metadata_service: (optional) The
- metadata service configuration.
- :param str name: (optional) The name for this virtual server instance. The
- name must not be used by another virtual server instance in the region.
- Changing the name will not affect the system hostname.
- :param InstancePlacementTargetPatch placement_target: (optional) The
- placement restrictions to use for the virtual server instance. For the
- placement
- restrictions to be changed, the instance `status` must be `stopping` or
- `stopped`.
- :param InstancePatchProfile profile: (optional) The profile to use for this
- virtual server instance. For the profile to be changed,
- the instance `status` must be `stopping` or `stopped`. In addition, the
- requested
- profile must:
- - Have matching instance disk support. Any disks associated with the
- current profile
- will be deleted, and any disks associated with the requested profile will
- be
- created.
- - Be compatible with any `placement_target` constraints. For example, if
- the
- instance is placed on a dedicated host, the requested profile `family`
- must be
- the same as the dedicated host `family`.
- - Have the same `vcpu.architecture`.
- - Support the number of network interfaces the instance currently has.
- :param int total_volume_bandwidth: (optional) The amount of bandwidth (in
- megabits per second) allocated exclusively to instance storage volumes. An
- increase in this value will result in a corresponding decrease to
- `total_network_bandwidth`.
+ :param datetime created_at: The date and time that the instance group
+ manager policy was created.
+ :param bool delete_instance_on_membership_delete: If set to true, when
+ deleting the membership the instance will also be deleted.
+ :param str href: The URL for this instance group membership.
+ :param str id: The unique identifier for this instance group membership.
+ :param InstanceReference instance:
+ :param InstanceTemplateReference instance_template:
+ :param str name: The name for this instance group membership. The name is
+ unique across all memberships for the instance group.
+ :param str status: The status of the instance group membership
+ - `deleting`: Membership is deleting dependent resources
+ - `failed`: Membership was unable to maintain dependent resources
+ - `healthy`: Membership is active and serving in the group
+ - `pending`: Membership is waiting for dependent resources
+ - `unhealthy`: Membership has unhealthy dependent resources.
+ :param datetime updated_at: The date and time that the instance group
+ membership was updated.
+ :param LoadBalancerPoolMemberReference pool_member: (optional)
"""
- self.availability_policy = availability_policy
- self.metadata_service = metadata_service
+ self.created_at = created_at
+ self.delete_instance_on_membership_delete = delete_instance_on_membership_delete
+ self.href = href
+ self.id = id
+ self.instance = instance
+ self.instance_template = instance_template
self.name = name
- self.placement_target = placement_target
- self.profile = profile
- self.total_volume_bandwidth = total_volume_bandwidth
+ self.pool_member = pool_member
+ self.status = status
+ self.updated_at = updated_at
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstancePatch':
- """Initialize a InstancePatch object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceGroupMembership':
+ """Initialize a InstanceGroupMembership object from a json dictionary."""
args = {}
- if 'availability_policy' in _dict:
- args['availability_policy'] = InstanceAvailabilityPolicyPatch.from_dict(_dict.get('availability_policy'))
- if 'metadata_service' in _dict:
- args['metadata_service'] = InstanceMetadataServicePatch.from_dict(_dict.get('metadata_service'))
- if 'name' in _dict:
- args['name'] = _dict.get('name')
- if 'placement_target' in _dict:
- args['placement_target'] = _dict.get('placement_target')
- if 'profile' in _dict:
- args['profile'] = _dict.get('profile')
- if 'total_volume_bandwidth' in _dict:
- args['total_volume_bandwidth'] = _dict.get('total_volume_bandwidth')
+ if (created_at := _dict.get('created_at')) is not None:
+ args['created_at'] = string_to_datetime(created_at)
+ else:
+ raise ValueError('Required property \'created_at\' not present in InstanceGroupMembership JSON')
+ if (delete_instance_on_membership_delete := _dict.get('delete_instance_on_membership_delete')) is not None:
+ args['delete_instance_on_membership_delete'] = delete_instance_on_membership_delete
+ else:
+ raise ValueError('Required property \'delete_instance_on_membership_delete\' not present in InstanceGroupMembership JSON')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
+ else:
+ raise ValueError('Required property \'href\' not present in InstanceGroupMembership JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
+ else:
+ raise ValueError('Required property \'id\' not present in InstanceGroupMembership JSON')
+ if (instance := _dict.get('instance')) is not None:
+ args['instance'] = InstanceReference.from_dict(instance)
+ else:
+ raise ValueError('Required property \'instance\' not present in InstanceGroupMembership JSON')
+ if (instance_template := _dict.get('instance_template')) is not None:
+ args['instance_template'] = InstanceTemplateReference.from_dict(instance_template)
+ else:
+ raise ValueError('Required property \'instance_template\' not present in InstanceGroupMembership JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ else:
+ raise ValueError('Required property \'name\' not present in InstanceGroupMembership JSON')
+ if (pool_member := _dict.get('pool_member')) is not None:
+ args['pool_member'] = LoadBalancerPoolMemberReference.from_dict(pool_member)
+ if (status := _dict.get('status')) is not None:
+ args['status'] = status
+ else:
+ raise ValueError('Required property \'status\' not present in InstanceGroupMembership JSON')
+ if (updated_at := _dict.get('updated_at')) is not None:
+ args['updated_at'] = string_to_datetime(updated_at)
+ else:
+ raise ValueError('Required property \'updated_at\' not present in InstanceGroupMembership JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstancePatch object from a json dictionary."""
+ """Initialize a InstanceGroupMembership object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'availability_policy') and self.availability_policy is not None:
- if isinstance(self.availability_policy, dict):
- _dict['availability_policy'] = self.availability_policy
+ 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, 'instance') and self.instance is not None:
+ if isinstance(self.instance, dict):
+ _dict['instance'] = self.instance
else:
- _dict['availability_policy'] = self.availability_policy.to_dict()
- if hasattr(self, 'metadata_service') and self.metadata_service is not None:
- if isinstance(self.metadata_service, dict):
- _dict['metadata_service'] = self.metadata_service
+ _dict['instance'] = self.instance.to_dict()
+ if hasattr(self, 'instance_template') and self.instance_template is not None:
+ if isinstance(self.instance_template, dict):
+ _dict['instance_template'] = self.instance_template
else:
- _dict['metadata_service'] = self.metadata_service.to_dict()
+ _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, '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
+ if hasattr(self, 'pool_member') and self.pool_member is not None:
+ if isinstance(self.pool_member, dict):
+ _dict['pool_member'] = self.pool_member
else:
- _dict['profile'] = self.profile.to_dict()
- if hasattr(self, 'total_volume_bandwidth') and self.total_volume_bandwidth is not None:
- _dict['total_volume_bandwidth'] = self.total_volume_bandwidth
+ _dict['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):
@@ -47853,395 +50483,316 @@ 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 InstanceGroupMembership object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstancePatch') -> 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: 'InstancePatch') -> bool:
+ def __ne__(self, other: 'InstanceGroupMembership') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
+ class StatusEnum(str, Enum):
+ """
+ The 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.
+ """
+
+ DELETING = 'deleting'
+ FAILED = 'failed'
+ HEALTHY = 'healthy'
+ PENDING = 'pending'
+ UNHEALTHY = 'unhealthy'
+
-class InstancePatchProfile:
+
+class InstanceGroupMembershipCollection:
"""
- The profile to use for this virtual server instance. For the profile to be changed,
- the instance `status` must be `stopping` or `stopped`. In addition, the requested
- profile must:
- - Have matching instance disk support. Any disks associated with the current profile
- will be deleted, and any disks associated with the requested profile will be
- created.
- - Be compatible with any `placement_target` constraints. For example, if the
- instance is placed on a dedicated host, the requested profile `family` must be
- the same as the dedicated host `family`.
- - Have the same `vcpu.architecture`.
- - Support the number of network interfaces the instance currently has.
+ InstanceGroupMembershipCollection.
+ :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 InstanceGroupMembershipCollectionNext next: (optional) A link to the next
+ page of resources. This property is present for all pages
+ except the last page.
+ :param int total_count: The total number of resources across all pages.
"""
def __init__(
self,
+ first: 'InstanceGroupMembershipCollectionFirst',
+ limit: int,
+ memberships: List['InstanceGroupMembership'],
+ total_count: int,
+ *,
+ next: Optional['InstanceGroupMembershipCollectionNext'] = None,
) -> None:
"""
- Initialize a InstancePatchProfile object.
+ Initialize a InstanceGroupMembershipCollection object.
+ :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.
"""
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['InstancePatchProfileInstanceProfileIdentityByName', 'InstancePatchProfileInstanceProfileIdentityByHref'])
- )
- raise Exception(msg)
+ self.first = first
+ 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."""
+ args = {}
+ if (first := _dict.get('first')) is not None:
+ args['first'] = InstanceGroupMembershipCollectionFirst.from_dict(first)
+ else:
+ raise ValueError('Required property \'first\' not present in InstanceGroupMembershipCollection JSON')
+ if (limit := _dict.get('limit')) is not None:
+ args['limit'] = limit
+ else:
+ raise ValueError('Required property \'limit\' not present in InstanceGroupMembershipCollection JSON')
+ if (memberships := _dict.get('memberships')) is not None:
+ args['memberships'] = [InstanceGroupMembership.from_dict(v) for v in memberships]
+ else:
+ raise ValueError('Required property \'memberships\' not present in InstanceGroupMembershipCollection JSON')
+ if (next := _dict.get('next')) is not None:
+ args['next'] = InstanceGroupMembershipCollectionNext.from_dict(next)
+ if (total_count := _dict.get('total_count')) is not None:
+ args['total_count'] = total_count
+ else:
+ raise ValueError('Required property \'total_count\' not present in InstanceGroupMembershipCollection JSON')
+ return cls(**args)
-class InstancePlacementTarget:
- """
- InstancePlacementTarget.
+ @classmethod
+ def _from_dict(cls, _dict):
+ """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, 'first') and self.first is not None:
+ if isinstance(self.first, dict):
+ _dict['first'] = self.first
+ else:
+ _dict['first'] = self.first.to_dict()
+ if hasattr(self, 'limit') and self.limit is not None:
+ _dict['limit'] = self.limit
+ if hasattr(self, 'memberships') and self.memberships is not None:
+ memberships_list = []
+ for v in self.memberships:
+ if isinstance(v, dict):
+ memberships_list.append(v)
+ else:
+ memberships_list.append(v.to_dict())
+ _dict['memberships'] = memberships_list
+ if hasattr(self, 'next') and self.next is not None:
+ if isinstance(self.next, dict):
+ _dict['next'] = self.next
+ else:
+ _dict['next'] = self.next.to_dict()
+ if hasattr(self, 'total_count') and self.total_count is not None:
+ _dict['total_count'] = self.total_count
+ return _dict
- def __init__(
- self,
- ) -> None:
- """
- Initialize a InstancePlacementTarget 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(['InstancePlacementTargetDedicatedHostGroupReference', 'InstancePlacementTargetDedicatedHostReference', 'InstancePlacementTargetPlacementGroupReference'])
- )
- raise Exception(msg)
+ def __str__(self) -> str:
+ """Return a `str` version of this InstanceGroupMembershipCollection object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ 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: 'InstanceGroupMembershipCollection') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
-class InstancePlacementTargetPatch:
+class InstanceGroupMembershipCollectionFirst:
"""
- InstancePlacementTargetPatch.
+ A link to the first page of resources.
+ :param str href: The URL for a page of resources.
"""
def __init__(
self,
+ href: str,
) -> None:
"""
- Initialize a InstancePlacementTargetPatch object.
+ Initialize a InstanceGroupMembershipCollectionFirst object.
+ :param str href: The URL for a page of resources.
"""
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['InstancePlacementTargetPatchDedicatedHostIdentity', 'InstancePlacementTargetPatchDedicatedHostGroupIdentity'])
- )
- raise Exception(msg)
+ self.href = href
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'InstanceGroupMembershipCollectionFirst':
+ """Initialize a InstanceGroupMembershipCollectionFirst object from a json dictionary."""
+ args = {}
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
+ else:
+ raise ValueError('Required property \'href\' not present in InstanceGroupMembershipCollectionFirst JSON')
+ return cls(**args)
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a InstanceGroupMembershipCollectionFirst object from a json dictionary."""
+ return cls.from_dict(_dict)
-class InstancePlacementTargetPrototype:
+ 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 InstanceGroupMembershipCollectionFirst object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ 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: 'InstanceGroupMembershipCollectionFirst') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+
+class InstanceGroupMembershipCollectionNext:
"""
- InstancePlacementTargetPrototype.
+ 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.
"""
def __init__(
self,
+ href: str,
) -> None:
"""
- Initialize a InstancePlacementTargetPrototype object.
+ Initialize a InstanceGroupMembershipCollectionNext object.
+ :param str href: The URL for a page of resources.
"""
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['InstancePlacementTargetPrototypeDedicatedHostIdentity', 'InstancePlacementTargetPrototypeDedicatedHostGroupIdentity', 'InstancePlacementTargetPrototypePlacementGroupIdentity'])
- )
- raise Exception(msg)
+ self.href = href
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'InstanceGroupMembershipCollectionNext':
+ """Initialize a InstanceGroupMembershipCollectionNext object from a json dictionary."""
+ args = {}
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
+ else:
+ raise ValueError('Required property \'href\' not present in InstanceGroupMembershipCollectionNext JSON')
+ return cls(**args)
-class InstanceProfile:
- """
- InstanceProfile.
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a InstanceGroupMembershipCollectionNext object from a json dictionary."""
+ return cls.from_dict(_dict)
- :attr InstanceProfileBandwidth bandwidth:
- :attr List[InstanceProfileDisk] disks: Collection of the instance profile's
- disks.
- :attr str family: The product family this virtual server instance profile
- belongs to.
- :attr InstanceProfileGPU gpu_count: (optional)
- :attr InstanceProfileGPUManufacturer gpu_manufacturer: (optional)
- :attr InstanceProfileGPUMemory gpu_memory: (optional)
- :attr InstanceProfileGPUModel gpu_model: (optional)
- :attr str href: The URL for this virtual server instance profile.
- :attr InstanceProfileMemory memory:
- :attr str name: The globally unique name for this virtual server instance
- profile.
- :attr InstanceProfileNetworkInterfaceCount network_interface_count:
- :attr InstanceProfileNUMACount numa_count: (optional)
- :attr InstanceProfileOSArchitecture os_architecture:
- :attr InstanceProfilePortSpeed port_speed:
- :attr str status: The status of the instance profile:
- - `previous`: This instance profile is an older revision, but remains
- provisionable and
- usable.
- - `current`: This profile is the latest revision.
- Note that revisions are indicated by the generation of an instance profile.
- Refer to the
- [profile naming conventions]
- (https://cloud.ibm.com/docs/vpc?topic=vpc-profiles&interface=ui#profiles-naming-rule)
- for information on how generations are defined within an instance 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 profile on which the unexpected
- property value was encountered.
- :attr InstanceProfileVolumeBandwidth total_volume_bandwidth:
- :attr InstanceProfileVCPUArchitecture vcpu_architecture:
- :attr InstanceProfileVCPU vcpu_count:
- :attr InstanceProfileVCPUManufacturer vcpu_manufacturer:
+ 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 InstanceGroupMembershipCollectionNext object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ 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: 'InstanceGroupMembershipCollectionNext') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+
+class InstanceGroupMembershipPatch:
+ """
+ InstanceGroupMembershipPatch.
+
+ :param str name: (optional) The name for this instance group membership. The
+ name must not be used by another membership for the instance group manager.
"""
def __init__(
self,
- bandwidth: 'InstanceProfileBandwidth',
- disks: List['InstanceProfileDisk'],
- family: str,
- href: str,
- memory: 'InstanceProfileMemory',
- name: str,
- network_interface_count: 'InstanceProfileNetworkInterfaceCount',
- os_architecture: 'InstanceProfileOSArchitecture',
- port_speed: 'InstanceProfilePortSpeed',
- status: str,
- total_volume_bandwidth: 'InstanceProfileVolumeBandwidth',
- vcpu_architecture: 'InstanceProfileVCPUArchitecture',
- vcpu_count: 'InstanceProfileVCPU',
- vcpu_manufacturer: 'InstanceProfileVCPUManufacturer',
*,
- gpu_count: 'InstanceProfileGPU' = None,
- gpu_manufacturer: 'InstanceProfileGPUManufacturer' = None,
- gpu_memory: 'InstanceProfileGPUMemory' = None,
- gpu_model: 'InstanceProfileGPUModel' = None,
- numa_count: 'InstanceProfileNUMACount' = None,
+ name: Optional[str] = None,
) -> None:
"""
- Initialize a InstanceProfile object.
+ Initialize a InstanceGroupMembershipPatch object.
- :param InstanceProfileBandwidth bandwidth:
- :param List[InstanceProfileDisk] disks: Collection of the instance
- profile's disks.
- :param str family: The product family this virtual server instance profile
- belongs to.
- :param str href: The URL for this virtual server instance profile.
- :param InstanceProfileMemory memory:
- :param str name: The globally unique name for this virtual server instance
- profile.
- :param InstanceProfileNetworkInterfaceCount network_interface_count:
- :param InstanceProfileOSArchitecture os_architecture:
- :param InstanceProfilePortSpeed port_speed:
- :param str status: The status of the instance profile:
- - `previous`: This instance profile is an older revision, but remains
- provisionable and
- usable.
- - `current`: This profile is the latest revision.
- Note that revisions are indicated by the generation of an instance profile.
- Refer to the
- [profile naming conventions]
- (https://cloud.ibm.com/docs/vpc?topic=vpc-profiles&interface=ui#profiles-naming-rule)
- for information on how generations are defined within an instance 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 profile on
- which the unexpected property value was encountered.
- :param InstanceProfileVolumeBandwidth total_volume_bandwidth:
- :param InstanceProfileVCPUArchitecture vcpu_architecture:
- :param InstanceProfileVCPU vcpu_count:
- :param InstanceProfileVCPUManufacturer vcpu_manufacturer:
- :param InstanceProfileGPU gpu_count: (optional)
- :param InstanceProfileGPUManufacturer gpu_manufacturer: (optional)
- :param InstanceProfileGPUMemory gpu_memory: (optional)
- :param InstanceProfileGPUModel gpu_model: (optional)
- :param InstanceProfileNUMACount numa_count: (optional)
+ :param str name: (optional) The name for this instance group membership.
+ The name must not be used by another membership for the instance group
+ manager.
"""
- self.bandwidth = bandwidth
- self.disks = disks
- self.family = family
- self.gpu_count = gpu_count
- self.gpu_manufacturer = gpu_manufacturer
- self.gpu_memory = gpu_memory
- self.gpu_model = gpu_model
- self.href = href
- self.memory = memory
self.name = name
- self.network_interface_count = network_interface_count
- self.numa_count = numa_count
- self.os_architecture = os_architecture
- self.port_speed = port_speed
- self.status = status
- self.total_volume_bandwidth = total_volume_bandwidth
- self.vcpu_architecture = vcpu_architecture
- self.vcpu_count = vcpu_count
- self.vcpu_manufacturer = vcpu_manufacturer
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstanceProfile':
- """Initialize a InstanceProfile object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceGroupMembershipPatch':
+ """Initialize a InstanceGroupMembershipPatch object from a json dictionary."""
args = {}
- if 'bandwidth' in _dict:
- args['bandwidth'] = _dict.get('bandwidth')
- else:
- raise ValueError('Required property \'bandwidth\' not present in InstanceProfile JSON')
- if 'disks' in _dict:
- args['disks'] = [InstanceProfileDisk.from_dict(v) for v in _dict.get('disks')]
- else:
- raise ValueError('Required property \'disks\' not present in InstanceProfile JSON')
- if 'family' in _dict:
- args['family'] = _dict.get('family')
- else:
- raise ValueError('Required property \'family\' not present in InstanceProfile JSON')
- if 'gpu_count' in _dict:
- args['gpu_count'] = _dict.get('gpu_count')
- if 'gpu_manufacturer' in _dict:
- args['gpu_manufacturer'] = InstanceProfileGPUManufacturer.from_dict(_dict.get('gpu_manufacturer'))
- if 'gpu_memory' in _dict:
- args['gpu_memory'] = _dict.get('gpu_memory')
- if 'gpu_model' in _dict:
- args['gpu_model'] = InstanceProfileGPUModel.from_dict(_dict.get('gpu_model'))
- if 'href' in _dict:
- args['href'] = _dict.get('href')
- else:
- raise ValueError('Required property \'href\' not present in InstanceProfile JSON')
- if 'memory' in _dict:
- args['memory'] = _dict.get('memory')
- else:
- raise ValueError('Required property \'memory\' not present in InstanceProfile JSON')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
- else:
- raise ValueError('Required property \'name\' not present in InstanceProfile JSON')
- if 'network_interface_count' in _dict:
- args['network_interface_count'] = _dict.get('network_interface_count')
- else:
- raise ValueError('Required property \'network_interface_count\' not present in InstanceProfile JSON')
- if 'numa_count' in _dict:
- args['numa_count'] = _dict.get('numa_count')
- 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 'status' in _dict:
- args['status'] = _dict.get('status')
- else:
- raise ValueError('Required property \'status\' not present in InstanceProfile JSON')
- if 'total_volume_bandwidth' in _dict:
- args['total_volume_bandwidth'] = _dict.get('total_volume_bandwidth')
- else:
- raise ValueError('Required property \'total_volume_bandwidth\' not present in InstanceProfile JSON')
- if 'vcpu_architecture' in _dict:
- args['vcpu_architecture'] = InstanceProfileVCPUArchitecture.from_dict(_dict.get('vcpu_architecture'))
- else:
- raise ValueError('Required property \'vcpu_architecture\' not present in InstanceProfile JSON')
- if 'vcpu_count' in _dict:
- args['vcpu_count'] = _dict.get('vcpu_count')
- else:
- raise ValueError('Required property \'vcpu_count\' not present in InstanceProfile JSON')
- if 'vcpu_manufacturer' in _dict:
- args['vcpu_manufacturer'] = InstanceProfileVCPUManufacturer.from_dict(_dict.get('vcpu_manufacturer'))
- else:
- raise ValueError('Required property \'vcpu_manufacturer\' not present in InstanceProfile JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceProfile 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, 'bandwidth') and self.bandwidth is not None:
- if isinstance(self.bandwidth, dict):
- _dict['bandwidth'] = self.bandwidth
- else:
- _dict['bandwidth'] = self.bandwidth.to_dict()
- if hasattr(self, 'disks') and self.disks is not None:
- disks_list = []
- for v in self.disks:
- if isinstance(v, dict):
- disks_list.append(v)
- else:
- disks_list.append(v.to_dict())
- _dict['disks'] = disks_list
- if hasattr(self, 'family') and self.family is not None:
- _dict['family'] = self.family
- if hasattr(self, 'gpu_count') and self.gpu_count is not None:
- if isinstance(self.gpu_count, dict):
- _dict['gpu_count'] = self.gpu_count
- else:
- _dict['gpu_count'] = self.gpu_count.to_dict()
- if hasattr(self, 'gpu_manufacturer') and self.gpu_manufacturer is not None:
- if isinstance(self.gpu_manufacturer, dict):
- _dict['gpu_manufacturer'] = self.gpu_manufacturer
- else:
- _dict['gpu_manufacturer'] = self.gpu_manufacturer.to_dict()
- if hasattr(self, 'gpu_memory') and self.gpu_memory is not None:
- if isinstance(self.gpu_memory, dict):
- _dict['gpu_memory'] = self.gpu_memory
- else:
- _dict['gpu_memory'] = self.gpu_memory.to_dict()
- if hasattr(self, 'gpu_model') and self.gpu_model is not None:
- if isinstance(self.gpu_model, dict):
- _dict['gpu_model'] = self.gpu_model
- else:
- _dict['gpu_model'] = self.gpu_model.to_dict()
- if hasattr(self, 'href') and self.href is not None:
- _dict['href'] = self.href
- if hasattr(self, 'memory') and self.memory is not None:
- if isinstance(self.memory, dict):
- _dict['memory'] = self.memory
- else:
- _dict['memory'] = self.memory.to_dict()
if hasattr(self, 'name') and self.name is not None:
_dict['name'] = self.name
- if hasattr(self, 'network_interface_count') and self.network_interface_count is not None:
- if isinstance(self.network_interface_count, dict):
- _dict['network_interface_count'] = self.network_interface_count
- else:
- _dict['network_interface_count'] = self.network_interface_count.to_dict()
- if hasattr(self, 'numa_count') and self.numa_count is not None:
- if isinstance(self.numa_count, dict):
- _dict['numa_count'] = self.numa_count
- else:
- _dict['numa_count'] = self.numa_count.to_dict()
- if hasattr(self, 'os_architecture') and self.os_architecture is not None:
- if isinstance(self.os_architecture, dict):
- _dict['os_architecture'] = self.os_architecture
- else:
- _dict['os_architecture'] = self.os_architecture.to_dict()
- if hasattr(self, 'port_speed') and self.port_speed is not None:
- if isinstance(self.port_speed, dict):
- _dict['port_speed'] = self.port_speed
- else:
- _dict['port_speed'] = self.port_speed.to_dict()
- if hasattr(self, 'status') and self.status is not None:
- _dict['status'] = self.status
- if hasattr(self, 'total_volume_bandwidth') and self.total_volume_bandwidth is not None:
- if isinstance(self.total_volume_bandwidth, dict):
- _dict['total_volume_bandwidth'] = self.total_volume_bandwidth
- else:
- _dict['total_volume_bandwidth'] = self.total_volume_bandwidth.to_dict()
- if hasattr(self, 'vcpu_architecture') and self.vcpu_architecture is not None:
- if isinstance(self.vcpu_architecture, dict):
- _dict['vcpu_architecture'] = self.vcpu_architecture
- else:
- _dict['vcpu_architecture'] = self.vcpu_architecture.to_dict()
- if hasattr(self, 'vcpu_count') and self.vcpu_count is not None:
- if isinstance(self.vcpu_count, dict):
- _dict['vcpu_count'] = self.vcpu_count
- else:
- _dict['vcpu_count'] = self.vcpu_count.to_dict()
- if hasattr(self, 'vcpu_manufacturer') and self.vcpu_manufacturer is not None:
- if isinstance(self.vcpu_manufacturer, dict):
- _dict['vcpu_manufacturer'] = self.vcpu_manufacturer
- else:
- _dict['vcpu_manufacturer'] = self.vcpu_manufacturer.to_dict()
return _dict
def _to_dict(self):
@@ -48249,107 +50800,262 @@ 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 InstanceGroupMembershipPatch object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceProfile') -> 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: 'InstanceProfile') -> bool:
+ def __ne__(self, other: 'InstanceGroupMembershipPatch') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class StatusEnum(str, Enum):
- """
- The status of the instance profile:
- - `previous`: This instance profile is an older revision, but remains
- provisionable and
- usable.
- - `current`: This profile is the latest revision.
- Note that revisions are indicated by the generation of an instance profile. Refer
- to the
- [profile naming conventions]
- (https://cloud.ibm.com/docs/vpc?topic=vpc-profiles&interface=ui#profiles-naming-rule)
- for information on how generations are defined within an instance 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 profile on which the unexpected
- property value was encountered.
- """
-
- CURRENT = 'current'
- PREVIOUS = 'previous'
-
-
-class InstanceProfileBandwidth:
+class InstanceGroupPatch:
"""
- InstanceProfileBandwidth.
+ To add or update load balancer specification for an instance group the
+ `membership_count` must first be set to 0.
+ :param int application_port: (optional) The port to use for new load balancer
+ pool members created by this instance group.
+ This property must be set if and only if `load_balancer_pool` has been set.
+ :param InstanceTemplateIdentity instance_template: (optional) Instance template
+ to use when creating new instances.
+ Instance groups are not compatible with instance templates that specify `true`
+ for
+ `default_trusted_profile.auto_link`.
+ :param LoadBalancerIdentity load_balancer: (optional) The load balancer
+ associated with `load_balancer_pool`.
+ The load balancer must have `instance_groups_supported` set to `true`.
+ This property must be set if and only if `load_balancer_pool` has been set.
+ :param LoadBalancerPoolIdentity load_balancer_pool: (optional) If specified,
+ this instance group will manage the load balancer pool. A pool member
+ will be created for each instance created by this group. The specified load
+ balancer pool must not be used by another instance group in the VPC.
+ If set, `load_balancer` and `application_port` must also be set.
+ :param int membership_count: (optional) The number of instances in the instance
+ group.
+ :param str name: (optional) The name for this instance group. The name must not
+ be used by another instance group in the region.
+ :param List[SubnetIdentity] subnets: (optional) The subnets to use when creating
+ new instances.
"""
def __init__(
self,
+ *,
+ application_port: Optional[int] = None,
+ instance_template: Optional['InstanceTemplateIdentity'] = None,
+ load_balancer: Optional['LoadBalancerIdentity'] = None,
+ load_balancer_pool: Optional['LoadBalancerPoolIdentity'] = None,
+ membership_count: Optional[int] = None,
+ name: Optional[str] = None,
+ subnets: Optional[List['SubnetIdentity']] = None,
) -> None:
"""
- Initialize a InstanceProfileBandwidth object.
+ Initialize a InstanceGroupPatch object.
+ :param int application_port: (optional) The port to use for new load
+ balancer pool members created by this instance group.
+ This property must be set if and only if `load_balancer_pool` has been set.
+ :param InstanceTemplateIdentity instance_template: (optional) Instance
+ template to use when creating new instances.
+ Instance groups are not compatible with instance templates that specify
+ `true` for
+ `default_trusted_profile.auto_link`.
+ :param LoadBalancerIdentity load_balancer: (optional) The load balancer
+ associated with `load_balancer_pool`.
+ The load balancer must have `instance_groups_supported` set to `true`.
+ This property must be set if and only if `load_balancer_pool` has been set.
+ :param LoadBalancerPoolIdentity load_balancer_pool: (optional) If
+ specified, this instance group will manage the load balancer pool. A pool
+ member
+ will be created for each instance created by this group. The specified
+ load
+ balancer pool must not be used by another instance group in the VPC.
+ If set, `load_balancer` and `application_port` must also be set.
+ :param int membership_count: (optional) The number of instances in the
+ instance group.
+ :param str name: (optional) The name for this instance group. The name must
+ not be used by another instance group in the region.
+ :param List[SubnetIdentity] subnets: (optional) The subnets to use when
+ creating new instances.
"""
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['InstanceProfileBandwidthFixed', 'InstanceProfileBandwidthRange', 'InstanceProfileBandwidthEnum', 'InstanceProfileBandwidthDependent'])
- )
- raise Exception(msg)
+ self.application_port = application_port
+ self.instance_template = instance_template
+ self.load_balancer = load_balancer
+ self.load_balancer_pool = load_balancer_pool
+ self.membership_count = membership_count
+ self.name = name
+ self.subnets = subnets
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'InstanceGroupPatch':
+ """Initialize a InstanceGroupPatch object from a json dictionary."""
+ args = {}
+ if (application_port := _dict.get('application_port')) is not None:
+ args['application_port'] = application_port
+ if (instance_template := _dict.get('instance_template')) is not None:
+ args['instance_template'] = instance_template
+ if (load_balancer := _dict.get('load_balancer')) is not None:
+ args['load_balancer'] = load_balancer
+ if (load_balancer_pool := _dict.get('load_balancer_pool')) is not None:
+ args['load_balancer_pool'] = load_balancer_pool
+ if (membership_count := _dict.get('membership_count')) is not None:
+ args['membership_count'] = membership_count
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ if (subnets := _dict.get('subnets')) is not None:
+ args['subnets'] = subnets
+ return cls(**args)
-class InstanceProfileCollection:
+ @classmethod
+ def _from_dict(cls, _dict):
+ """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, 'application_port') and self.application_port is not None:
+ _dict['application_port'] = self.application_port
+ if hasattr(self, 'instance_template') and self.instance_template is not None:
+ if isinstance(self.instance_template, dict):
+ _dict['instance_template'] = self.instance_template
+ else:
+ _dict['instance_template'] = self.instance_template.to_dict()
+ if hasattr(self, 'load_balancer') and self.load_balancer is not None:
+ if isinstance(self.load_balancer, dict):
+ _dict['load_balancer'] = self.load_balancer
+ else:
+ _dict['load_balancer'] = self.load_balancer.to_dict()
+ if hasattr(self, 'load_balancer_pool') and self.load_balancer_pool is not None:
+ if isinstance(self.load_balancer_pool, dict):
+ _dict['load_balancer_pool'] = self.load_balancer_pool
+ else:
+ _dict['load_balancer_pool'] = self.load_balancer_pool.to_dict()
+ if hasattr(self, 'membership_count') and self.membership_count is not None:
+ _dict['membership_count'] = self.membership_count
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ if hasattr(self, 'subnets') and self.subnets is not None:
+ subnets_list = []
+ for v in self.subnets:
+ if isinstance(v, dict):
+ subnets_list.append(v)
+ else:
+ subnets_list.append(v.to_dict())
+ _dict['subnets'] = subnets_list
+ return _dict
+
+ def _to_dict(self):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
+
+ def __str__(self) -> str:
+ """Return a `str` version of this InstanceGroupPatch object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ 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: 'InstanceGroupPatch') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+
+class InstanceGroupReference:
"""
- InstanceProfileCollection.
+ InstanceGroupReference.
- :attr List[InstanceProfile] profiles: Collection of virtual server instance
- profiles.
+ :param str crn: The CRN for this instance group.
+ :param InstanceGroupReferenceDeleted 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 instance group.
+ :param str id: The unique identifier for this instance group.
+ :param str name: The name for this instance group. The name is unique across all
+ instance groups in the region.
"""
def __init__(
self,
- profiles: List['InstanceProfile'],
+ crn: str,
+ href: str,
+ id: str,
+ name: str,
+ *,
+ deleted: Optional['InstanceGroupReferenceDeleted'] = None,
) -> None:
"""
- Initialize a InstanceProfileCollection object.
+ Initialize a InstanceGroupReference object.
- :param List[InstanceProfile] profiles: Collection of virtual server
- instance profiles.
+ :param str crn: The CRN for this instance group.
+ :param str href: The URL for this instance group.
+ :param str id: The unique identifier for this instance group.
+ :param str name: The name for this instance group. The name is unique
+ across all instance groups in the region.
+ :param InstanceGroupReferenceDeleted deleted: (optional) If present, this
+ property indicates the referenced resource has been deleted, and provides
+ some supplementary information.
"""
- self.profiles = profiles
+ self.crn = crn
+ self.deleted = deleted
+ self.href = href
+ self.id = id
+ self.name = name
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstanceProfileCollection':
- """Initialize a InstanceProfileCollection object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceGroupReference':
+ """Initialize a InstanceGroupReference object from a json dictionary."""
args = {}
- if 'profiles' in _dict:
- args['profiles'] = [InstanceProfile.from_dict(v) for v in _dict.get('profiles')]
+ if (crn := _dict.get('crn')) is not None:
+ args['crn'] = crn
else:
- raise ValueError('Required property \'profiles\' not present in InstanceProfileCollection JSON')
+ raise ValueError('Required property \'crn\' not present in InstanceGroupReference JSON')
+ if (deleted := _dict.get('deleted')) is not None:
+ args['deleted'] = InstanceGroupReferenceDeleted.from_dict(deleted)
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
+ else:
+ raise ValueError('Required property \'href\' not present in InstanceGroupReference JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
+ else:
+ raise ValueError('Required property \'id\' not present in InstanceGroupReference JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ else:
+ raise ValueError('Required property \'name\' not present in InstanceGroupReference JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceProfileCollection object from a json dictionary."""
+ """Initialize a InstanceGroupReference object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'profiles') and self.profiles is not None:
- profiles_list = []
- for v in self.profiles:
- if isinstance(v, dict):
- profiles_list.append(v)
- else:
- profiles_list.append(v.to_dict())
- _dict['profiles'] = profiles_list
+ if hasattr(self, 'crn') and self.crn is not None:
+ _dict['crn'] = self.crn
+ if hasattr(self, 'deleted') and self.deleted is not None:
+ if isinstance(self.deleted, dict):
+ _dict['deleted'] = self.deleted
+ else:
+ _dict['deleted'] = self.deleted.to_dict()
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
+ if hasattr(self, 'id') and self.id is not None:
+ _dict['id'] = self.id
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
return _dict
def _to_dict(self):
@@ -48357,87 +51063,59 @@ 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 InstanceGroupReference object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceProfileCollection') -> bool:
+ def __eq__(self, other: 'InstanceGroupReference') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'InstanceProfileCollection') -> bool:
+ def __ne__(self, other: 'InstanceGroupReference') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class InstanceProfileDisk:
+class InstanceGroupReferenceDeleted:
"""
- Disks provided by this profile.
+ If present, this property indicates the referenced resource has been deleted, and
+ provides some supplementary information.
- :attr InstanceProfileDiskQuantity quantity:
- :attr InstanceProfileDiskSize size:
- :attr InstanceProfileDiskSupportedInterfaces supported_interface_types:
+ :param str more_info: Link to documentation about deleted resources.
"""
def __init__(
self,
- quantity: 'InstanceProfileDiskQuantity',
- size: 'InstanceProfileDiskSize',
- supported_interface_types: 'InstanceProfileDiskSupportedInterfaces',
+ more_info: str,
) -> None:
"""
- Initialize a InstanceProfileDisk object.
+ Initialize a InstanceGroupReferenceDeleted object.
- :param InstanceProfileDiskQuantity quantity:
- :param InstanceProfileDiskSize size:
- :param InstanceProfileDiskSupportedInterfaces supported_interface_types:
+ :param str more_info: Link to documentation about deleted resources.
"""
- self.quantity = quantity
- self.size = size
- self.supported_interface_types = supported_interface_types
+ self.more_info = more_info
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstanceProfileDisk':
- """Initialize a InstanceProfileDisk object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceGroupReferenceDeleted':
+ """Initialize a InstanceGroupReferenceDeleted object from a json dictionary."""
args = {}
- if 'quantity' in _dict:
- args['quantity'] = _dict.get('quantity')
- else:
- raise ValueError('Required property \'quantity\' not present in InstanceProfileDisk JSON')
- if 'size' in _dict:
- args['size'] = _dict.get('size')
+ if (more_info := _dict.get('more_info')) is not None:
+ args['more_info'] = more_info
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')
+ raise ValueError('Required property \'more_info\' not present in InstanceGroupReferenceDeleted JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceProfileDisk 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, 'quantity') and self.quantity is not None:
- if isinstance(self.quantity, dict):
- _dict['quantity'] = self.quantity
- else:
- _dict['quantity'] = self.quantity.to_dict()
- if hasattr(self, 'size') and self.size is not None:
- if isinstance(self.size, dict):
- _dict['size'] = self.size
- else:
- _dict['size'] = self.size.to_dict()
- if hasattr(self, 'supported_interface_types') and self.supported_interface_types is not None:
- if isinstance(self.supported_interface_types, dict):
- _dict['supported_interface_types'] = self.supported_interface_types
- else:
- _dict['supported_interface_types'] = self.supported_interface_types.to_dict()
+ if hasattr(self, 'more_info') and self.more_info is not None:
+ _dict['more_info'] = self.more_info
return _dict
def _to_dict(self):
@@ -48445,126 +51123,81 @@ 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 InstanceGroupReferenceDeleted object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceProfileDisk') -> 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: 'InstanceProfileDisk') -> bool:
+ def __ne__(self, other: 'InstanceGroupReferenceDeleted') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class InstanceProfileDiskQuantity:
+class InstanceHealthReason:
"""
- InstanceProfileDiskQuantity.
+ InstanceHealthReason.
+ :param str code: A snake case string succinctly identifying the reason for this
+ health state.
+ :param str message: An explanation of the reason for this health state.
+ :param str more_info: (optional) Link to documentation about the reason for this
+ health state.
"""
def __init__(
self,
+ code: str,
+ message: str,
+ *,
+ more_info: Optional[str] = None,
) -> None:
"""
- Initialize a InstanceProfileDiskQuantity object.
+ Initialize a InstanceHealthReason object.
+ :param str code: A snake case string succinctly identifying the reason for
+ this health state.
+ :param str message: An explanation of the reason for this health state.
+ :param str more_info: (optional) Link to documentation about the reason for
+ this health state.
"""
- 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,
- default: str,
- type: str,
- values: List[str],
- ) -> None:
- """
- Initialize a InstanceProfileDiskSupportedInterfaces 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
+ self.code = code
+ self.message = message
+ self.more_info = more_info
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstanceProfileDiskSupportedInterfaces':
- """Initialize a InstanceProfileDiskSupportedInterfaces object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceHealthReason':
+ """Initialize a InstanceHealthReason object from a json dictionary."""
args = {}
- if 'default' in _dict:
- args['default'] = _dict.get('default')
+ if (code := _dict.get('code')) is not None:
+ args['code'] = code
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')
+ raise ValueError('Required property \'code\' not present in InstanceHealthReason JSON')
+ if (message := _dict.get('message')) is not None:
+ args['message'] = message
else:
- raise ValueError('Required property \'values\' not present in InstanceProfileDiskSupportedInterfaces JSON')
+ raise ValueError('Required property \'message\' not present in InstanceHealthReason JSON')
+ if (more_info := _dict.get('more_info')) is not None:
+ args['more_info'] = more_info
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceProfileDiskSupportedInterfaces object from a json dictionary."""
+ """Initialize a InstanceHealthReason object from 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, '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):
@@ -48572,123 +51205,106 @@ 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 InstanceHealthReason object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceProfileDiskSupportedInterfaces') -> bool:
+ def __eq__(self, other: 'InstanceHealthReason') -> bool:
"""Return `true` when 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: 'InstanceHealthReason') -> 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):
+ class CodeEnum(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.
+ A snake case string succinctly identifying the reason for this health state.
"""
- NVME = 'nvme'
- VIRTIO_BLK = 'virtio_blk'
-
-
-
-class InstanceProfileGPU:
- """
- InstanceProfileGPU.
-
- """
-
- def __init__(
- self,
- ) -> None:
- """
- Initialize a InstanceProfileGPU object.
+ RESERVATION_CAPACITY_UNAVAILABLE = 'reservation_capacity_unavailable'
+ RESERVATION_DELETED = 'reservation_deleted'
+ RESERVATION_EXPIRED = 'reservation_expired'
+ RESERVATION_FAILED = 'reservation_failed'
- """
- 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 InstanceInitialization:
"""
- InstanceProfileGPUManufacturer.
+ InstanceInitialization.
- :attr str type: The type for this profile field.
- :attr List[str] values: The possible GPU manufacturer(s) for an instance with
- this profile.
+ :param InstanceInitializationDefaultTrustedProfile default_trusted_profile:
+ (optional) The default trusted profile configuration specified at virtual server
+ instance
+ creation. If absent, no default trusted profile was specified.
+ :param List[KeyReference] keys: The public SSH keys used at instance
+ initialization.
+ :param InstanceInitializationPassword password: (optional)
"""
def __init__(
self,
- type: str,
- values: List[str],
+ keys: List['KeyReference'],
+ *,
+ default_trusted_profile: Optional['InstanceInitializationDefaultTrustedProfile'] = None,
+ password: Optional['InstanceInitializationPassword'] = None,
) -> None:
"""
- Initialize a InstanceProfileGPUManufacturer object.
+ Initialize a InstanceInitialization 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 List[KeyReference] keys: The public SSH keys used at instance
+ initialization.
+ :param InstanceInitializationDefaultTrustedProfile default_trusted_profile:
+ (optional) The default trusted profile configuration specified at virtual
+ server instance
+ creation. If absent, no default trusted profile was specified.
+ :param InstanceInitializationPassword password: (optional)
"""
- self.type = type
- self.values = values
+ self.default_trusted_profile = default_trusted_profile
+ self.keys = keys
+ self.password = password
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstanceProfileGPUManufacturer':
- """Initialize a InstanceProfileGPUManufacturer object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceInitialization':
+ """Initialize a InstanceInitialization object from a json dictionary."""
args = {}
- if 'type' in _dict:
- args['type'] = _dict.get('type')
+ if (default_trusted_profile := _dict.get('default_trusted_profile')) is not None:
+ args['default_trusted_profile'] = InstanceInitializationDefaultTrustedProfile.from_dict(default_trusted_profile)
+ if (keys := _dict.get('keys')) is not None:
+ args['keys'] = [KeyReference.from_dict(v) for v in keys]
else:
- raise ValueError('Required property \'type\' not present in InstanceProfileGPUManufacturer JSON')
- if 'values' in _dict:
- args['values'] = _dict.get('values')
- else:
- raise ValueError('Required property \'values\' not present in InstanceProfileGPUManufacturer JSON')
+ raise ValueError('Required property \'keys\' not present in InstanceInitialization JSON')
+ if (password := _dict.get('password')) is not None:
+ args['password'] = InstanceInitializationPassword.from_dict(password)
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceProfileGPUManufacturer object from a json dictionary."""
+ """Initialize a InstanceInitialization object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, '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, 'default_trusted_profile') and self.default_trusted_profile is not None:
+ if isinstance(self.default_trusted_profile, dict):
+ _dict['default_trusted_profile'] = self.default_trusted_profile
+ else:
+ _dict['default_trusted_profile'] = self.default_trusted_profile.to_dict()
+ if hasattr(self, 'keys') and self.keys is not None:
+ keys_list = []
+ for v in self.keys:
+ if isinstance(v, dict):
+ keys_list.append(v)
+ else:
+ keys_list.append(v.to_dict())
+ _dict['keys'] = keys_list
+ if hasattr(self, 'password') and self.password is not None:
+ if isinstance(self.password, dict):
+ _dict['password'] = self.password
+ else:
+ _dict['password'] = self.password.to_dict()
return _dict
def _to_dict(self):
@@ -48696,97 +51312,79 @@ 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 InstanceInitialization object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceProfileGPUManufacturer') -> bool:
+ def __eq__(self, other: 'InstanceInitialization') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'InstanceProfileGPUManufacturer') -> bool:
+ def __ne__(self, other: 'InstanceInitialization') -> 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 InstanceInitializationDefaultTrustedProfile:
"""
- InstanceProfileGPUModel.
+ InstanceInitializationDefaultTrustedProfile.
- :attr str type: The type for this profile field.
- :attr List[str] values: The possible GPU model(s) for an instance with this
- profile.
+ :param bool auto_link: If set to `true`, the system created a link to the
+ specified `target` trusted profile during instance creation. Regardless of
+ whether a link was created by the system or manually using the IAM Identity
+ service, it will be automatically deleted when the instance is deleted.
+ :param TrustedProfileReference target: The default IAM trusted profile to use
+ for this virtual server instance.
"""
def __init__(
self,
- type: str,
- values: List[str],
+ auto_link: bool,
+ target: 'TrustedProfileReference',
) -> None:
"""
- Initialize a InstanceProfileGPUModel object.
+ Initialize a InstanceInitializationDefaultTrustedProfile 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 bool auto_link: If set to `true`, the system created a link to the
+ specified `target` trusted profile during instance creation. Regardless of
+ whether a link was created by the system or manually using the IAM Identity
+ service, it will be automatically deleted when the instance is deleted.
+ :param TrustedProfileReference target: The default IAM trusted profile to
+ use for this virtual server instance.
"""
- self.type = type
- self.values = values
+ self.auto_link = auto_link
+ self.target = target
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstanceProfileGPUModel':
- """Initialize a InstanceProfileGPUModel object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceInitializationDefaultTrustedProfile':
+ """Initialize a InstanceInitializationDefaultTrustedProfile object from a json dictionary."""
args = {}
- if 'type' in _dict:
- args['type'] = _dict.get('type')
+ if (auto_link := _dict.get('auto_link')) is not None:
+ args['auto_link'] = auto_link
else:
- raise ValueError('Required property \'type\' not present in InstanceProfileGPUModel JSON')
- if 'values' in _dict:
- args['values'] = _dict.get('values')
+ raise ValueError('Required property \'auto_link\' not present in InstanceInitializationDefaultTrustedProfile JSON')
+ if (target := _dict.get('target')) is not None:
+ args['target'] = TrustedProfileReference.from_dict(target)
else:
- raise ValueError('Required property \'values\' not present in InstanceProfileGPUModel JSON')
+ raise ValueError('Required property \'target\' not present in InstanceInitializationDefaultTrustedProfile JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceProfileGPUModel object from a json dictionary."""
+ """Initialize a InstanceInitializationDefaultTrustedProfile object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, '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, 'auto_link') and self.auto_link is not None:
+ _dict['auto_link'] = self.auto_link
+ if hasattr(self, 'target') and self.target is not None:
+ if isinstance(self.target, dict):
+ _dict['target'] = self.target
+ else:
+ _dict['target'] = self.target.to_dict()
return _dict
def _to_dict(self):
@@ -48794,166 +51392,76 @@ 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 InstanceInitializationDefaultTrustedProfile object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceProfileGPUModel') -> bool:
+ def __eq__(self, other: 'InstanceInitializationDefaultTrustedProfile') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'InstanceProfileGPUModel') -> bool:
+ def __ne__(self, other: 'InstanceInitializationDefaultTrustedProfile') -> 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 InstanceProfileNUMACount:
- """
- InstanceProfileNUMACount.
-
- """
-
- def __init__(
- self,
- ) -> None:
- """
- Initialize a InstanceProfileNUMACount object.
-
- """
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['InstanceProfileNUMACountFixed', 'InstanceProfileNUMACountDependent'])
- )
- raise Exception(msg)
-
-
-class InstanceProfileNetworkInterfaceCount:
- """
- InstanceProfileNetworkInterfaceCount.
-
- """
-
- def __init__(
- self,
- ) -> None:
- """
- Initialize a InstanceProfileNetworkInterfaceCount object.
-
- """
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['InstanceProfileNetworkInterfaceCountRange', 'InstanceProfileNetworkInterfaceCountDependent'])
- )
- raise Exception(msg)
-
-class InstanceProfileOSArchitecture:
+class InstanceInitializationPassword:
"""
- InstanceProfileOSArchitecture.
+ InstanceInitializationPassword.
- :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.
+ :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.
"""
def __init__(
self,
- default: str,
- type: str,
- values: List[str],
+ encrypted_password: bytes,
+ encryption_key: 'KeyIdentityByFingerprint',
) -> None:
"""
- Initialize a InstanceProfileOSArchitecture object.
+ Initialize a InstanceInitializationPassword 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 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.default = default
- self.type = type
- self.values = values
+ self.encrypted_password = encrypted_password
+ self.encryption_key = encryption_key
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstanceProfileOSArchitecture':
- """Initialize a InstanceProfileOSArchitecture object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceInitializationPassword':
+ """Initialize a InstanceInitializationPassword 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 (encrypted_password := _dict.get('encrypted_password')) is not None:
+ args['encrypted_password'] = base64.b64decode(encrypted_password)
else:
- raise ValueError('Required property \'type\' not present in InstanceProfileOSArchitecture JSON')
- if 'values' in _dict:
- args['values'] = _dict.get('values')
+ raise ValueError('Required property \'encrypted_password\' not present in InstanceInitializationPassword JSON')
+ if (encryption_key := _dict.get('encryption_key')) is not None:
+ args['encryption_key'] = KeyIdentityByFingerprint.from_dict(encryption_key)
else:
- raise ValueError('Required property \'values\' not present in InstanceProfileOSArchitecture JSON')
+ raise ValueError('Required property \'encryption_key\' not present in InstanceInitializationPassword JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceProfileOSArchitecture 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, '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, 'encrypted_password') and self.encrypted_password is not None:
+ _dict['encrypted_password'] = str(base64.b64encode(self.encrypted_password), 'utf-8')
+ if hasattr(self, 'encryption_key') and self.encryption_key is not None:
+ if isinstance(self.encryption_key, dict):
+ _dict['encryption_key'] = self.encryption_key
+ else:
+ _dict['encryption_key'] = self.encryption_key.to_dict()
return _dict
def _to_dict(self):
@@ -48961,97 +51469,81 @@ 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 InstanceInitializationPassword object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceProfileOSArchitecture') -> 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: 'InstanceProfileOSArchitecture') -> bool:
+ def __ne__(self, other: 'InstanceInitializationPassword') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class TypeEnum(str, Enum):
- """
- The type for this profile field.
- """
-
- ENUM = 'enum'
-
-
-
-class InstanceProfilePortSpeed:
- """
- InstanceProfilePortSpeed.
-
- """
-
- def __init__(
- self,
- ) -> None:
- """
- Initialize a InstanceProfilePortSpeed object.
-
- """
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['InstanceProfilePortSpeedFixed', 'InstanceProfilePortSpeedDependent'])
- )
- raise Exception(msg)
-
-class InstanceProfileReference:
+class InstanceLifecycleReason:
"""
- InstanceProfileReference.
+ InstanceLifecycleReason.
- :attr str href: The URL for this virtual server instance profile.
- :attr str name: The globally unique name for this virtual server instance
- profile.
+ :param str code: A snake case string succinctly identifying the reason for this
+ lifecycle state.
+ :param str message: An explanation of the reason for this lifecycle state.
+ :param str more_info: (optional) Link to documentation about the reason for this
+ lifecycle state.
"""
def __init__(
self,
- href: str,
- name: str,
+ code: str,
+ message: str,
+ *,
+ more_info: Optional[str] = None,
) -> None:
"""
- Initialize a InstanceProfileReference object.
+ Initialize a InstanceLifecycleReason object.
- :param str href: The URL for this virtual server instance profile.
- :param str name: The globally unique name for this virtual server instance
- profile.
+ :param str code: A snake case string succinctly identifying the reason for
+ this lifecycle state.
+ :param str message: An explanation of the reason for this lifecycle state.
+ :param str more_info: (optional) Link to documentation about the reason for
+ this lifecycle state.
"""
- self.href = href
- self.name = name
+ self.code = code
+ self.message = message
+ self.more_info = more_info
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstanceProfileReference':
- """Initialize a InstanceProfileReference object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceLifecycleReason':
+ """Initialize a InstanceLifecycleReason object from a json dictionary."""
args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ if (code := _dict.get('code')) is not None:
+ args['code'] = code
else:
- raise ValueError('Required property \'href\' not present in InstanceProfileReference JSON')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
+ raise ValueError('Required property \'code\' not present in InstanceLifecycleReason JSON')
+ if (message := _dict.get('message')) is not None:
+ args['message'] = message
else:
- raise ValueError('Required property \'name\' not present in InstanceProfileReference JSON')
+ raise ValueError('Required property \'message\' not present in InstanceLifecycleReason JSON')
+ if (more_info := _dict.get('more_info')) is not None:
+ args['more_info'] = more_info
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceProfileReference object from a json dictionary."""
+ """Initialize a InstanceLifecycleReason object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, '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, '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):
@@ -49059,98 +51551,98 @@ 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 InstanceLifecycleReason object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceProfileReference') -> bool:
+ def __eq__(self, other: 'InstanceLifecycleReason') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'InstanceProfileReference') -> bool:
+ def __ne__(self, other: 'InstanceLifecycleReason') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-
-class InstanceProfileVCPU:
- """
- InstanceProfileVCPU.
-
- """
-
- def __init__(
- self,
- ) -> None:
+ class CodeEnum(str, Enum):
"""
- Initialize a InstanceProfileVCPU object.
-
+ A snake case string succinctly identifying the reason for this lifecycle state.
"""
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['InstanceProfileVCPUFixed', 'InstanceProfileVCPURange', 'InstanceProfileVCPUEnum', 'InstanceProfileVCPUDependent'])
- )
- raise Exception(msg)
+
+ RESOURCE_SUSPENDED_BY_PROVIDER = 'resource_suspended_by_provider'
-class InstanceProfileVCPUArchitecture:
+
+class InstanceMetadataService:
"""
- InstanceProfileVCPUArchitecture.
+ The metadata service configuration.
- :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.
+ :param bool enabled: Indicates whether the metadata service endpoint is
+ available to the virtual server instance.
+ :param str protocol: The communication protocol to use for the metadata service
+ endpoint. Applies only when the metadata service is enabled.
+ - `http`: HTTP protocol (unencrypted)
+ - `https`: HTTP Secure protocol.
+ :param int response_hop_limit: The hop limit (IP time to live) for IP response
+ packets from the metadata service. Applies only when the metadata service is
+ enabled.
"""
def __init__(
self,
- type: str,
- value: str,
- *,
- default: str = None,
+ enabled: bool,
+ protocol: str,
+ response_hop_limit: int,
) -> None:
"""
- Initialize a InstanceProfileVCPUArchitecture object.
+ Initialize a InstanceMetadataService 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 bool enabled: Indicates whether the metadata service endpoint is
+ available to the virtual server instance.
+ :param str protocol: The communication protocol to use for the metadata
+ service endpoint. Applies only when the metadata service is enabled.
+ - `http`: HTTP protocol (unencrypted)
+ - `https`: HTTP Secure protocol.
+ :param int response_hop_limit: The hop limit (IP time to live) for IP
+ response packets from the metadata service. Applies only when the metadata
+ service is enabled.
"""
- self.default = default
- self.type = type
- self.value = value
+ self.enabled = enabled
+ self.protocol = protocol
+ self.response_hop_limit = response_hop_limit
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstanceProfileVCPUArchitecture':
- """Initialize a InstanceProfileVCPUArchitecture object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceMetadataService':
+ """Initialize a InstanceMetadataService 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 (enabled := _dict.get('enabled')) is not None:
+ args['enabled'] = enabled
else:
- raise ValueError('Required property \'type\' not present in InstanceProfileVCPUArchitecture JSON')
- if 'value' in _dict:
- args['value'] = _dict.get('value')
+ raise ValueError('Required property \'enabled\' not present in InstanceMetadataService JSON')
+ if (protocol := _dict.get('protocol')) is not None:
+ args['protocol'] = protocol
else:
- raise ValueError('Required property \'value\' not present in InstanceProfileVCPUArchitecture JSON')
+ raise ValueError('Required property \'protocol\' not present in InstanceMetadataService JSON')
+ if (response_hop_limit := _dict.get('response_hop_limit')) is not None:
+ args['response_hop_limit'] = response_hop_limit
+ else:
+ raise ValueError('Required property \'response_hop_limit\' not present in InstanceMetadataService JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceProfileVCPUArchitecture object from a json dictionary."""
+ """Initialize a InstanceMetadataService object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, '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, 'enabled') and self.enabled is not None:
+ _dict['enabled'] = self.enabled
+ if hasattr(self, 'protocol') and self.protocol is not None:
+ _dict['protocol'] = self.protocol
+ if hasattr(self, 'response_hop_limit') and self.response_hop_limit is not None:
+ _dict['response_hop_limit'] = self.response_hop_limit
return _dict
def _to_dict(self):
@@ -49158,87 +51650,98 @@ 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 InstanceMetadataService object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceProfileVCPUArchitecture') -> bool:
+ def __eq__(self, other: 'InstanceMetadataService') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'InstanceProfileVCPUArchitecture') -> bool:
+ def __ne__(self, other: 'InstanceMetadataService') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class TypeEnum(str, Enum):
+ class ProtocolEnum(str, Enum):
"""
- The type for this profile field.
+ The communication protocol to use for the metadata service endpoint. Applies only
+ when the metadata service is enabled.
+ - `http`: HTTP protocol (unencrypted)
+ - `https`: HTTP Secure protocol.
"""
- FIXED = 'fixed'
+ HTTP = 'http'
+ HTTPS = 'https'
-class InstanceProfileVCPUManufacturer:
+class InstanceMetadataServicePatch:
"""
- InstanceProfileVCPUManufacturer.
+ The metadata service configuration.
- :attr str default: (optional) The default VCPU manufacturer for an instance with
- this profile.
- :attr str type: The type for this profile field.
- :attr str value: The VCPU manufacturer for an instance with this profile.
+ :param bool enabled: (optional) Indicates whether the metadata service endpoint
+ will be available to the virtual server instance.
+ :param str protocol: (optional) The communication protocol to use for the
+ metadata service endpoint. Applies only when the metadata service is enabled.
+ - `http`: HTTP protocol (unencrypted)
+ - `https`: HTTP Secure protocol.
+ :param int response_hop_limit: (optional) The hop limit (IP time to live) for IP
+ response packets from the metadata service. Applies only when the metadata
+ service is enabled.
"""
def __init__(
self,
- type: str,
- value: str,
*,
- default: str = None,
+ enabled: Optional[bool] = None,
+ protocol: Optional[str] = None,
+ response_hop_limit: Optional[int] = None,
) -> None:
"""
- Initialize a InstanceProfileVCPUManufacturer object.
+ Initialize a InstanceMetadataServicePatch object.
- :param str type: The type for this profile field.
- :param str value: The VCPU manufacturer for an instance with this profile.
- :param str default: (optional) The default VCPU manufacturer for an
- instance with this profile.
+ :param bool enabled: (optional) Indicates whether the metadata service
+ endpoint will be available to the virtual server instance.
+ :param str protocol: (optional) The communication protocol to use for the
+ metadata service endpoint. Applies only when the metadata service is
+ enabled.
+ - `http`: HTTP protocol (unencrypted)
+ - `https`: HTTP Secure protocol.
+ :param int response_hop_limit: (optional) The hop limit (IP time to live)
+ for IP response packets from the metadata service. Applies only when the
+ metadata service is enabled.
"""
- self.default = default
- self.type = type
- self.value = value
+ self.enabled = enabled
+ self.protocol = protocol
+ self.response_hop_limit = response_hop_limit
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstanceProfileVCPUManufacturer':
- """Initialize a InstanceProfileVCPUManufacturer object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceMetadataServicePatch':
+ """Initialize a InstanceMetadataServicePatch 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 InstanceProfileVCPUManufacturer JSON')
- if 'value' in _dict:
- args['value'] = _dict.get('value')
- else:
- raise ValueError('Required property \'value\' not present in InstanceProfileVCPUManufacturer JSON')
+ if (enabled := _dict.get('enabled')) is not None:
+ args['enabled'] = enabled
+ if (protocol := _dict.get('protocol')) is not None:
+ args['protocol'] = protocol
+ if (response_hop_limit := _dict.get('response_hop_limit')) is not None:
+ args['response_hop_limit'] = response_hop_limit
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceProfileVCPUManufacturer object from a json dictionary."""
+ """Initialize a InstanceMetadataServicePatch object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, '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, 'enabled') and self.enabled is not None:
+ _dict['enabled'] = self.enabled
+ if hasattr(self, 'protocol') and self.protocol is not None:
+ _dict['protocol'] = self.protocol
+ if hasattr(self, 'response_hop_limit') and self.response_hop_limit is not None:
+ _dict['response_hop_limit'] = self.response_hop_limit
return _dict
def _to_dict(self):
@@ -49246,278 +51749,296 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this InstanceProfileVCPUManufacturer object."""
+ """Return a `str` version of this InstanceMetadataServicePatch object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceProfileVCPUManufacturer') -> bool:
+ def __eq__(self, other: 'InstanceMetadataServicePatch') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'InstanceProfileVCPUManufacturer') -> bool:
+ def __ne__(self, other: 'InstanceMetadataServicePatch') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class TypeEnum(str, Enum):
+ class ProtocolEnum(str, Enum):
"""
- The type for this profile field.
+ The communication protocol to use for the metadata service endpoint. Applies only
+ when the metadata service is enabled.
+ - `http`: HTTP protocol (unencrypted)
+ - `https`: HTTP Secure protocol.
"""
- FIXED = 'fixed'
+ HTTP = 'http'
+ HTTPS = 'https'
-class InstanceProfileVolumeBandwidth:
+class InstanceMetadataServicePrototype:
"""
- InstanceProfileVolumeBandwidth.
+ The metadata service configuration.
+ :param bool enabled: (optional) Indicates whether the metadata service endpoint
+ will be available to the virtual server instance.
+ :param str protocol: (optional) The communication protocol to use for the
+ metadata service endpoint. Applies only when the metadata service is enabled.
+ - `http`: HTTP protocol (unencrypted)
+ - `https`: HTTP Secure protocol.
+ :param int response_hop_limit: (optional) The hop limit (IP time to live) for IP
+ response packets from the metadata service. Applies only when the metadata
+ service is enabled.
"""
def __init__(
self,
+ *,
+ enabled: Optional[bool] = None,
+ protocol: Optional[str] = None,
+ response_hop_limit: Optional[int] = None,
) -> None:
"""
- Initialize a InstanceProfileVolumeBandwidth object.
+ Initialize a InstanceMetadataServicePrototype object.
+ :param bool enabled: (optional) Indicates whether the metadata service
+ endpoint will be available to the virtual server instance.
+ :param str protocol: (optional) The communication protocol to use for the
+ metadata service endpoint. Applies only when the metadata service is
+ enabled.
+ - `http`: HTTP protocol (unencrypted)
+ - `https`: HTTP Secure protocol.
+ :param int response_hop_limit: (optional) The hop limit (IP time to live)
+ for IP response packets from the metadata service. Applies only when the
+ metadata service is enabled.
"""
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['InstanceProfileVolumeBandwidthFixed', 'InstanceProfileVolumeBandwidthRange', 'InstanceProfileVolumeBandwidthEnum', 'InstanceProfileVolumeBandwidthDependent'])
- )
- raise Exception(msg)
+ self.enabled = enabled
+ self.protocol = protocol
+ self.response_hop_limit = response_hop_limit
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'InstanceMetadataServicePrototype':
+ """Initialize a InstanceMetadataServicePrototype object from a json dictionary."""
+ args = {}
+ if (enabled := _dict.get('enabled')) is not None:
+ args['enabled'] = enabled
+ if (protocol := _dict.get('protocol')) is not None:
+ args['protocol'] = protocol
+ if (response_hop_limit := _dict.get('response_hop_limit')) is not None:
+ args['response_hop_limit'] = response_hop_limit
+ return cls(**args)
-class InstancePrototype:
- """
- InstancePrototype.
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a InstanceMetadataServicePrototype object from a json dictionary."""
+ return cls.from_dict(_dict)
- :attr InstanceAvailabilityPolicyPrototype availability_policy: (optional) The
- availability policy to use for this virtual server instance.
- :attr InstanceDefaultTrustedProfilePrototype default_trusted_profile: (optional)
- The default trusted profile configuration to use for this virtual server
- instance
- This property's value is used when provisioning the virtual server instance, but
- not
- subsequently managed. Accordingly, it is reflected as an [instance
- initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
- property.
- :attr List[KeyIdentity] keys: (optional) The public SSH keys for the
- administrative user of the virtual server instance. Keys will be made available
- to the virtual server instance as cloud-init vendor data. For cloud-init enabled
- images, these keys will also be added as SSH authorized keys for the
- administrative user.
- For Windows images, the keys of type `rsa` must be specified, and one will be
- selected to encrypt [the administrator
- password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys
- are optional for other images, but if no keys are specified, the instance will
- be inaccessible unless the specified image provides another means of access.
- This property's value is used when provisioning the virtual server instance, but
- not subsequently managed. Accordingly, it is reflected as an [instance
- initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
- property.
- :attr InstanceMetadataServicePrototype metadata_service: (optional) The metadata
- service configuration.
- :attr str name: (optional) The name for this virtual server instance. The name
- must not be used by another virtual server instance in the region. If
- unspecified, the name will be a hyphenated list of randomly-selected words.
- The system hostname will be based on this name.
- :attr InstancePlacementTargetPrototype placement_target: (optional) The
- placement restrictions to use for the virtual server instance.
- :attr InstanceProfileIdentity profile: (optional) The
- [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this
- virtual server instance.
- If unspecified, `bx2-2x8` will be used, but this default value is expected to
- change
- in the future.
- :attr ResourceGroupIdentity resource_group: (optional) The resource group to
- use. If unspecified, the account's [default resource
- group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be
- used.
- :attr int total_volume_bandwidth: (optional) The amount of bandwidth (in
- megabits per second) allocated exclusively to instance storage volumes. An
- increase in this value will result in a corresponding decrease to
- `total_network_bandwidth`.
- :attr str user_data: (optional) [User
- data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when
- setting up the virtual server instance.
- :attr List[VolumeAttachmentPrototype] volume_attachments: (optional) The
- additional volume attachments to create for the virtual server instance.
- :attr VPCIdentity vpc: (optional) The VPC this virtual server instance will
- reside in.
- If specified, it must match the VPC for the subnets of the instance network
- interfaces.
- """
+ def to_dict(self) -> Dict:
+ """Return a json dictionary representing this model."""
+ _dict = {}
+ if hasattr(self, 'enabled') and self.enabled is not None:
+ _dict['enabled'] = self.enabled
+ if hasattr(self, 'protocol') and self.protocol is not None:
+ _dict['protocol'] = self.protocol
+ if hasattr(self, 'response_hop_limit') and self.response_hop_limit is not None:
+ _dict['response_hop_limit'] = self.response_hop_limit
+ return _dict
- def __init__(
- self,
- *,
- availability_policy: 'InstanceAvailabilityPolicyPrototype' = None,
- default_trusted_profile: 'InstanceDefaultTrustedProfilePrototype' = None,
- keys: List['KeyIdentity'] = None,
- metadata_service: 'InstanceMetadataServicePrototype' = None,
- name: str = None,
- placement_target: 'InstancePlacementTargetPrototype' = None,
- profile: 'InstanceProfileIdentity' = None,
- resource_group: 'ResourceGroupIdentity' = None,
- total_volume_bandwidth: int = None,
- user_data: str = None,
- volume_attachments: List['VolumeAttachmentPrototype'] = None,
- vpc: 'VPCIdentity' = None,
- ) -> None:
- """
- Initialize a InstancePrototype object.
+ def _to_dict(self):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
- :param InstanceAvailabilityPolicyPrototype availability_policy: (optional)
- The availability policy to use for this virtual server instance.
- :param InstanceDefaultTrustedProfilePrototype default_trusted_profile:
- (optional) The default trusted profile configuration to use for this
- virtual server instance
- This property's value is used when provisioning the virtual server
- instance, but not
- subsequently managed. Accordingly, it is reflected as an [instance
- initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
- property.
- :param List[KeyIdentity] keys: (optional) The public SSH keys for the
- administrative user of the virtual server instance. Keys will be made
- available to the virtual server instance as cloud-init vendor data. For
- cloud-init enabled images, these keys will also be added as SSH authorized
- keys for the administrative user.
- For Windows images, the keys of type `rsa` must be specified, and one will
- be selected to encrypt [the administrator
- password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization).
- Keys are optional for other images, but if no keys are specified, the
- instance will be inaccessible unless the specified image provides another
- means of access.
- This property's value is used when provisioning the virtual server
- instance, but not subsequently managed. Accordingly, it is reflected as an
- [instance
- initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
- property.
- :param InstanceMetadataServicePrototype metadata_service: (optional) The
- metadata service configuration.
- :param str name: (optional) The name for this virtual server instance. The
- name must not be used by another virtual server instance in the region. If
- unspecified, the name will be a hyphenated list of randomly-selected words.
- The system hostname will be based on this name.
- :param InstancePlacementTargetPrototype placement_target: (optional) The
- placement restrictions to use for the virtual server instance.
- :param InstanceProfileIdentity profile: (optional) The
- [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for
- this
- virtual server instance.
- If unspecified, `bx2-2x8` will be used, but this default value is expected
- to change
- in the future.
- :param ResourceGroupIdentity resource_group: (optional) The resource group
- to use. If unspecified, the account's [default resource
- group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be
- used.
- :param int total_volume_bandwidth: (optional) The amount of bandwidth (in
- megabits per second) allocated exclusively to instance storage volumes. An
- increase in this value will result in a corresponding decrease to
- `total_network_bandwidth`.
- :param str user_data: (optional) [User
- data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available
- when setting up the virtual server instance.
- :param List[VolumeAttachmentPrototype] volume_attachments: (optional) The
- additional volume attachments to create for the virtual server instance.
- :param VPCIdentity vpc: (optional) The VPC this virtual server instance
- will reside in.
- If specified, it must match the VPC for the subnets of the instance network
- interfaces.
+ def __str__(self) -> str:
+ """Return a `str` version of this InstanceMetadataServicePrototype object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'InstanceMetadataServicePrototype') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'InstanceMetadataServicePrototype') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+ class ProtocolEnum(str, Enum):
"""
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['InstancePrototypeInstanceByImage', 'InstancePrototypeInstanceByCatalogOffering', 'InstancePrototypeInstanceByVolume', 'InstancePrototypeInstanceBySourceSnapshot', 'InstancePrototypeInstanceBySourceTemplate'])
- )
- raise Exception(msg)
+ The communication protocol to use for the metadata service endpoint. Applies only
+ when the metadata service is enabled.
+ - `http`: HTTP protocol (unencrypted)
+ - `https`: HTTP Secure protocol.
+ """
+
+ HTTP = 'http'
+ HTTPS = 'https'
-class InstanceReference:
+
+class InstanceNetworkAttachment:
"""
- InstanceReference.
+ InstanceNetworkAttachment.
- :attr str crn: The CRN for this virtual server instance.
- :attr InstanceReferenceDeleted deleted: (optional) If present, this property
- indicates the referenced resource has been deleted, and provides
- some supplementary information.
- :attr str href: The URL for this virtual server instance.
- :attr str id: The unique identifier for this virtual server instance.
- :attr str name: The name for this virtual server instance. The name is unique
- across all virtual server instances in the region.
+ :param datetime created_at: The date and time that the instance network
+ attachment was created.
+ :param str href: The URL for this instance network attachment.
+ :param str id: The unique identifier for this instance network attachment.
+ :param str lifecycle_state: The lifecycle state of the instance network
+ attachment.
+ :param str name: The name for this instance network attachment. The name is
+ unique across all network attachments for the instance.
+ :param int port_speed: The port speed for this instance network attachment in
+ Mbps.
+ :param ReservedIPReference primary_ip: The primary IP address of the virtual
+ network interface for the instance network
+ attachment.
+ :param str resource_type: The resource type.
+ :param SubnetReference subnet: The subnet of the virtual network interface for
+ the instance network attachment.
+ :param str type: The instance network attachment type.
+ :param VirtualNetworkInterfaceReferenceAttachmentContext
+ virtual_network_interface: The virtual network interface for this instance
+ network attachment.
"""
def __init__(
self,
- crn: str,
+ created_at: datetime,
href: str,
id: str,
+ lifecycle_state: str,
name: str,
- *,
- deleted: 'InstanceReferenceDeleted' = None,
+ port_speed: int,
+ primary_ip: 'ReservedIPReference',
+ resource_type: str,
+ subnet: 'SubnetReference',
+ type: str,
+ virtual_network_interface: 'VirtualNetworkInterfaceReferenceAttachmentContext',
) -> None:
"""
- Initialize a InstanceReference object.
+ Initialize a InstanceNetworkAttachment object.
- :param str crn: The CRN for this virtual server instance.
- :param str href: The URL for this virtual server instance.
- :param str id: The unique identifier for this virtual server instance.
- :param str name: The name for this virtual server instance. The name is
- unique across all virtual server instances in the region.
- :param InstanceReferenceDeleted deleted: (optional) If present, this
- property indicates the referenced resource has been deleted, and provides
- some supplementary information.
+ :param datetime created_at: The date and time that the instance network
+ attachment was created.
+ :param str href: The URL for this instance network attachment.
+ :param str id: The unique identifier for this instance network attachment.
+ :param str lifecycle_state: The lifecycle state of the instance network
+ attachment.
+ :param str name: The name for this instance network attachment. The name is
+ unique across all network attachments for the instance.
+ :param int port_speed: The port speed for this instance network attachment
+ in Mbps.
+ :param ReservedIPReference primary_ip: The primary IP address of the
+ virtual network interface for the instance network
+ attachment.
+ :param str resource_type: The resource type.
+ :param SubnetReference subnet: The subnet of the virtual network interface
+ for the instance network attachment.
+ :param str type: The instance network attachment type.
+ :param VirtualNetworkInterfaceReferenceAttachmentContext
+ virtual_network_interface: The virtual network interface for this instance
+ network attachment.
"""
- self.crn = crn
- self.deleted = deleted
+ self.created_at = created_at
self.href = href
self.id = id
+ self.lifecycle_state = lifecycle_state
self.name = name
+ self.port_speed = port_speed
+ self.primary_ip = primary_ip
+ self.resource_type = resource_type
+ self.subnet = subnet
+ self.type = type
+ self.virtual_network_interface = virtual_network_interface
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstanceReference':
- """Initialize a InstanceReference object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceNetworkAttachment':
+ """Initialize a InstanceNetworkAttachment object from a json dictionary."""
args = {}
- if 'crn' in _dict:
- args['crn'] = _dict.get('crn')
+ if (created_at := _dict.get('created_at')) is not None:
+ args['created_at'] = string_to_datetime(created_at)
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')
+ raise ValueError('Required property \'created_at\' not present in InstanceNetworkAttachment JSON')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'href\' not present in InstanceReference JSON')
- if 'id' in _dict:
- args['id'] = _dict.get('id')
+ raise ValueError('Required property \'href\' not present in InstanceNetworkAttachment JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
else:
- raise ValueError('Required property \'id\' not present in InstanceReference JSON')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
+ raise ValueError('Required property \'id\' not present in InstanceNetworkAttachment JSON')
+ if (lifecycle_state := _dict.get('lifecycle_state')) is not None:
+ args['lifecycle_state'] = lifecycle_state
else:
- raise ValueError('Required property \'name\' not present in InstanceReference JSON')
+ raise ValueError('Required property \'lifecycle_state\' not present in InstanceNetworkAttachment JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ else:
+ raise ValueError('Required property \'name\' not present in InstanceNetworkAttachment JSON')
+ if (port_speed := _dict.get('port_speed')) is not None:
+ args['port_speed'] = port_speed
+ else:
+ raise ValueError('Required property \'port_speed\' not present in InstanceNetworkAttachment JSON')
+ if (primary_ip := _dict.get('primary_ip')) is not None:
+ args['primary_ip'] = ReservedIPReference.from_dict(primary_ip)
+ else:
+ raise ValueError('Required property \'primary_ip\' not present in InstanceNetworkAttachment JSON')
+ if (resource_type := _dict.get('resource_type')) is not None:
+ args['resource_type'] = resource_type
+ else:
+ raise ValueError('Required property \'resource_type\' not present in InstanceNetworkAttachment JSON')
+ if (subnet := _dict.get('subnet')) is not None:
+ args['subnet'] = SubnetReference.from_dict(subnet)
+ else:
+ raise ValueError('Required property \'subnet\' not present in InstanceNetworkAttachment JSON')
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
+ else:
+ raise ValueError('Required property \'type\' not present in InstanceNetworkAttachment JSON')
+ if (virtual_network_interface := _dict.get('virtual_network_interface')) is not None:
+ args['virtual_network_interface'] = VirtualNetworkInterfaceReferenceAttachmentContext.from_dict(virtual_network_interface)
+ else:
+ raise ValueError('Required property \'virtual_network_interface\' not present in InstanceNetworkAttachment JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceReference object from a json dictionary."""
+ """Initialize a InstanceNetworkAttachment object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'crn') and self.crn is not None:
- _dict['crn'] = self.crn
- if hasattr(self, 'deleted') and self.deleted is not None:
- if isinstance(self.deleted, dict):
- _dict['deleted'] = self.deleted
- else:
- _dict['deleted'] = self.deleted.to_dict()
+ if hasattr(self, 'created_at') and self.created_at is not None:
+ _dict['created_at'] = datetime_to_string(self.created_at)
if hasattr(self, 'href') and self.href is not None:
_dict['href'] = self.href
if hasattr(self, 'id') and self.id is not None:
_dict['id'] = self.id
+ if hasattr(self, 'lifecycle_state') and self.lifecycle_state is not None:
+ _dict['lifecycle_state'] = self.lifecycle_state
if hasattr(self, 'name') and self.name is not None:
_dict['name'] = self.name
+ if hasattr(self, 'port_speed') and self.port_speed is not None:
+ _dict['port_speed'] = self.port_speed
+ if hasattr(self, 'primary_ip') and self.primary_ip is not None:
+ if isinstance(self.primary_ip, dict):
+ _dict['primary_ip'] = self.primary_ip
+ else:
+ _dict['primary_ip'] = self.primary_ip.to_dict()
+ if hasattr(self, 'resource_type') and self.resource_type is not None:
+ _dict['resource_type'] = self.resource_type
+ if hasattr(self, 'subnet') and self.subnet is not None:
+ if isinstance(self.subnet, dict):
+ _dict['subnet'] = self.subnet
+ else:
+ _dict['subnet'] = self.subnet.to_dict()
+ if hasattr(self, 'type') and self.type is not None:
+ _dict['type'] = self.type
+ if hasattr(self, 'virtual_network_interface') and self.virtual_network_interface is not None:
+ if isinstance(self.virtual_network_interface, dict):
+ _dict['virtual_network_interface'] = self.virtual_network_interface
+ else:
+ _dict['virtual_network_interface'] = self.virtual_network_interface.to_dict()
return _dict
def _to_dict(self):
@@ -49525,59 +52046,97 @@ 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 InstanceNetworkAttachment object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceReference') -> bool:
+ def __eq__(self, other: 'InstanceNetworkAttachment') -> bool:
"""Return `true` when 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: 'InstanceNetworkAttachment') -> 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 instance network attachment.
+ """
+
+ DELETING = 'deleting'
+ FAILED = 'failed'
+ PENDING = 'pending'
+ STABLE = 'stable'
+ SUSPENDED = 'suspended'
+ UPDATING = 'updating'
+ WAITING = 'waiting'
+
-class InstanceReferenceDeleted:
+ class ResourceTypeEnum(str, Enum):
+ """
+ The resource type.
+ """
+
+ INSTANCE_NETWORK_ATTACHMENT = 'instance_network_attachment'
+
+
+ class TypeEnum(str, Enum):
+ """
+ The instance network attachment type.
+ """
+
+ PRIMARY = 'primary'
+ SECONDARY = 'secondary'
+
+
+
+class InstanceNetworkAttachmentCollection:
"""
- If present, this property indicates the referenced resource has been deleted, and
- provides some supplementary information.
+ InstanceNetworkAttachmentCollection.
- :attr str more_info: Link to documentation about deleted resources.
+ :param List[InstanceNetworkAttachment] network_attachments: Collection of
+ instance network attachments.
"""
def __init__(
self,
- more_info: str,
+ network_attachments: List['InstanceNetworkAttachment'],
) -> None:
"""
- Initialize a InstanceReferenceDeleted object.
+ Initialize a InstanceNetworkAttachmentCollection object.
- :param str more_info: Link to documentation about deleted resources.
+ :param List[InstanceNetworkAttachment] network_attachments: Collection of
+ instance network attachments.
"""
- self.more_info = more_info
+ self.network_attachments = network_attachments
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstanceReferenceDeleted':
- """Initialize a InstanceReferenceDeleted object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceNetworkAttachmentCollection':
+ """Initialize a InstanceNetworkAttachmentCollection object from a json dictionary."""
args = {}
- if 'more_info' in _dict:
- args['more_info'] = _dict.get('more_info')
+ if (network_attachments := _dict.get('network_attachments')) is not None:
+ args['network_attachments'] = [InstanceNetworkAttachment.from_dict(v) for v in network_attachments]
else:
- raise ValueError('Required property \'more_info\' not present in InstanceReferenceDeleted JSON')
+ raise ValueError('Required property \'network_attachments\' not present in InstanceNetworkAttachmentCollection JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceReferenceDeleted object from a json dictionary."""
+ """Initialize a InstanceNetworkAttachmentCollection object from 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, 'network_attachments') and self.network_attachments is not None:
+ network_attachments_list = []
+ for v in self.network_attachments:
+ if isinstance(v, dict):
+ network_attachments_list.append(v)
+ else:
+ network_attachments_list.append(v.to_dict())
+ _dict['network_attachments'] = network_attachments_list
return _dict
def _to_dict(self):
@@ -49585,79 +52144,59 @@ 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 InstanceNetworkAttachmentCollection object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceReferenceDeleted') -> bool:
+ def __eq__(self, other: 'InstanceNetworkAttachmentCollection') -> bool:
"""Return `true` when 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: 'InstanceNetworkAttachmentCollection') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class InstanceStatusReason:
+class InstanceNetworkAttachmentPatch:
"""
- InstanceStatusReason.
+ InstanceNetworkAttachmentPatch.
- :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.
+ :param str name: (optional) The name for this network attachment. The name must
+ not be used by another network attachment for the instance.
"""
def __init__(
self,
- code: str,
- message: str,
*,
- more_info: str = None,
+ name: Optional[str] = None,
) -> None:
"""
- Initialize a InstanceStatusReason object.
+ Initialize a InstanceNetworkAttachmentPatch 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 name: (optional) The name for this network attachment. The name
+ must not be used by another network attachment for the instance.
"""
- self.code = code
- self.message = message
- self.more_info = more_info
+ self.name = name
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstanceStatusReason':
- """Initialize a InstanceStatusReason object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceNetworkAttachmentPatch':
+ """Initialize a InstanceNetworkAttachmentPatch object from a json dictionary."""
args = {}
- if 'code' in _dict:
- args['code'] = _dict.get('code')
- else:
- raise ValueError('Required property \'code\' not present in InstanceStatusReason JSON')
- if 'message' in _dict:
- args['message'] = _dict.get('message')
- else:
- raise ValueError('Required property \'message\' not present in InstanceStatusReason JSON')
- if 'more_info' in _dict:
- args['more_info'] = _dict.get('more_info')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceStatusReason object from a json dictionary."""
+ """Initialize a InstanceNetworkAttachmentPatch object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'code') and self.code is not None:
- _dict['code'] = self.code
- if hasattr(self, 'message') and self.message is not None:
- _dict['message'] = self.message
- if hasattr(self, 'more_info') and self.more_info is not None:
- _dict['more_info'] = self.more_info
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
return _dict
def _to_dict(self):
@@ -49665,285 +52204,254 @@ 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 InstanceNetworkAttachmentPatch object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceStatusReason') -> bool:
+ def __eq__(self, other: 'InstanceNetworkAttachmentPatch') -> bool:
"""Return `true` when 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: 'InstanceNetworkAttachmentPatch') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class CodeEnum(str, Enum):
+
+class InstanceNetworkAttachmentPrototype:
+ """
+ InstanceNetworkAttachmentPrototype.
+
+ :param str name: (optional) The name for this network attachment. Names must be
+ unique within the instance the network attachment resides in. If unspecified,
+ the name will be a hyphenated list of randomly-selected words.
+ :param InstanceNetworkAttachmentPrototypeVirtualNetworkInterface
+ virtual_network_interface: A virtual network interface for the instance network
+ attachment. This can be specified
+ using an existing virtual network interface, or a prototype object for a new
+ virtual
+ network interface.
+ If an existing virtual network interface is specified,
+ `enable_infrastructure_nat` must be
+ `true`.
+ """
+
+ def __init__(
+ self,
+ virtual_network_interface: 'InstanceNetworkAttachmentPrototypeVirtualNetworkInterface',
+ *,
+ name: Optional[str] = None,
+ ) -> None:
"""
- A snake case string succinctly identifying the status reason.
+ Initialize a InstanceNetworkAttachmentPrototype object.
+
+ :param InstanceNetworkAttachmentPrototypeVirtualNetworkInterface
+ virtual_network_interface: A virtual network interface for the instance
+ network attachment. This can be specified
+ using an existing virtual network interface, or a prototype object for a
+ new virtual
+ network interface.
+ If an existing virtual network interface is specified,
+ `enable_infrastructure_nat` must be
+ `true`.
+ :param str name: (optional) The name for this network attachment. Names
+ must be unique within the instance the network attachment resides in. If
+ unspecified, the name will be a hyphenated list of randomly-selected words.
"""
+ self.name = name
+ self.virtual_network_interface = virtual_network_interface
- CANNOT_START = 'cannot_start'
- CANNOT_START_CAPACITY = 'cannot_start_capacity'
- CANNOT_START_COMPUTE = 'cannot_start_compute'
- CANNOT_START_IP_ADDRESS = 'cannot_start_ip_address'
- CANNOT_START_NETWORK = 'cannot_start_network'
- CANNOT_START_PLACEMENT_GROUP = 'cannot_start_placement_group'
- CANNOT_START_STORAGE = 'cannot_start_storage'
- ENCRYPTION_KEY_DELETED = 'encryption_key_deleted'
- STOPPED_BY_HOST_FAILURE = 'stopped_by_host_failure'
- STOPPED_FOR_IMAGE_CREATION = 'stopped_for_image_creation'
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'InstanceNetworkAttachmentPrototype':
+ """Initialize a InstanceNetworkAttachmentPrototype object from a json dictionary."""
+ args = {}
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ if (virtual_network_interface := _dict.get('virtual_network_interface')) is not None:
+ args['virtual_network_interface'] = virtual_network_interface
+ else:
+ raise ValueError('Required property \'virtual_network_interface\' not present in InstanceNetworkAttachmentPrototype JSON')
+ return cls(**args)
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a InstanceNetworkAttachmentPrototype object from 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, 'virtual_network_interface') and self.virtual_network_interface is not None:
+ if isinstance(self.virtual_network_interface, dict):
+ _dict['virtual_network_interface'] = self.virtual_network_interface
+ else:
+ _dict['virtual_network_interface'] = self.virtual_network_interface.to_dict()
+ return _dict
-class InstanceTemplate:
+ def _to_dict(self):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
+
+ def __str__(self) -> str:
+ """Return a `str` version of this InstanceNetworkAttachmentPrototype object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'InstanceNetworkAttachmentPrototype') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'InstanceNetworkAttachmentPrototype') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+
+class InstanceNetworkAttachmentPrototypeVirtualNetworkInterface:
"""
- InstanceTemplate.
+ A virtual network interface for the instance network attachment. This can be specified
+ using an existing virtual network interface, or a prototype object for a new virtual
+ network interface.
+ If an existing virtual network interface is specified, `enable_infrastructure_nat`
+ must be
+ `true`.
- :attr InstanceAvailabilityPolicyPrototype availability_policy: (optional) The
- availability policy to use for this virtual server instance.
- :attr datetime created_at: The date and time that the instance template was
- created.
- :attr str crn: The CRN for this instance template.
- :attr InstanceDefaultTrustedProfilePrototype default_trusted_profile: (optional)
- The default trusted profile configuration to use for this virtual server
- instance
- This property's value is used when provisioning the virtual server instance, but
- not
- subsequently managed. Accordingly, it is reflected as an [instance
- initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
- property.
- :attr str href: The URL for this instance template.
- :attr str id: The unique identifier for this instance template.
- :attr List[KeyIdentity] keys: (optional) The public SSH keys for the
- administrative user of the virtual server instance. Keys will be made available
- to the virtual server instance as cloud-init vendor data. For cloud-init enabled
- images, these keys will also be added as SSH authorized keys for the
- administrative user.
- For Windows images, the keys of type `rsa` must be specified, and one will be
- selected to encrypt [the administrator
- password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys
- are optional for other images, but if no keys are specified, the instance will
- be inaccessible unless the specified image provides another means of access.
- This property's value is used when provisioning the virtual server instance, but
- not subsequently managed. Accordingly, it is reflected as an [instance
- initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
- property.
- :attr InstanceMetadataServicePrototype metadata_service: (optional) The metadata
- service configuration.
- :attr str name: The name for this instance template. The name is unique across
- all instance templates in the region.
- :attr InstancePlacementTargetPrototype placement_target: (optional) The
- placement restrictions to use for the virtual server instance.
- :attr InstanceProfileIdentity profile: (optional) The
- [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this
- virtual server instance.
- If unspecified, `bx2-2x8` will be used, but this default value is expected to
- change
- in the future.
- :attr ResourceGroupReference resource_group: The resource group for this
- instance template.
- :attr int total_volume_bandwidth: (optional) The amount of bandwidth (in
- megabits per second) allocated exclusively to instance storage volumes. An
- increase in this value will result in a corresponding decrease to
- `total_network_bandwidth`.
- :attr str user_data: (optional) [User
- data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when
- setting up the virtual server instance.
- :attr List[VolumeAttachmentPrototype] volume_attachments: (optional) The
- additional volume attachments to create for the virtual server instance.
- :attr VPCIdentity vpc: (optional) The VPC this virtual server instance will
- reside in.
- If specified, it must match the VPC for the subnets of the instance network
- interfaces.
"""
def __init__(
self,
- created_at: datetime,
- crn: str,
- href: str,
- id: str,
- name: str,
- resource_group: 'ResourceGroupReference',
- *,
- availability_policy: 'InstanceAvailabilityPolicyPrototype' = None,
- default_trusted_profile: 'InstanceDefaultTrustedProfilePrototype' = None,
- keys: List['KeyIdentity'] = None,
- metadata_service: 'InstanceMetadataServicePrototype' = None,
- placement_target: 'InstancePlacementTargetPrototype' = None,
- profile: 'InstanceProfileIdentity' = None,
- total_volume_bandwidth: int = None,
- user_data: str = None,
- volume_attachments: List['VolumeAttachmentPrototype'] = None,
- vpc: 'VPCIdentity' = None,
) -> None:
"""
- Initialize a InstanceTemplate object.
+ Initialize a InstanceNetworkAttachmentPrototypeVirtualNetworkInterface object.
- :param datetime created_at: The date and time that the instance template
- was created.
- :param str crn: The CRN for this instance template.
- :param str href: The URL for this instance template.
- :param str id: The unique identifier for this instance template.
- :param str name: The name for this instance template. The name is unique
- across all instance templates in the region.
- :param ResourceGroupReference resource_group: The resource group for this
- instance template.
- :param InstanceAvailabilityPolicyPrototype availability_policy: (optional)
- The availability policy to use for this virtual server instance.
- :param InstanceDefaultTrustedProfilePrototype default_trusted_profile:
- (optional) The default trusted profile configuration to use for this
- virtual server instance
- This property's value is used when provisioning the virtual server
- instance, but not
- subsequently managed. Accordingly, it is reflected as an [instance
- initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
- property.
- :param List[KeyIdentity] keys: (optional) The public SSH keys for the
- administrative user of the virtual server instance. Keys will be made
- available to the virtual server instance as cloud-init vendor data. For
- cloud-init enabled images, these keys will also be added as SSH authorized
- keys for the administrative user.
- For Windows images, the keys of type `rsa` must be specified, and one will
- be selected to encrypt [the administrator
- password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization).
- Keys are optional for other images, but if no keys are specified, the
- instance will be inaccessible unless the specified image provides another
- means of access.
- This property's value is used when provisioning the virtual server
- instance, but not subsequently managed. Accordingly, it is reflected as an
- [instance
- initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
- property.
- :param InstanceMetadataServicePrototype metadata_service: (optional) The
- metadata service configuration.
- :param InstancePlacementTargetPrototype placement_target: (optional) The
- placement restrictions to use for the virtual server instance.
- :param InstanceProfileIdentity profile: (optional) The
- [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for
- this
- virtual server instance.
- If unspecified, `bx2-2x8` will be used, but this default value is expected
- to change
- in the future.
- :param int total_volume_bandwidth: (optional) The amount of bandwidth (in
- megabits per second) allocated exclusively to instance storage volumes. An
- increase in this value will result in a corresponding decrease to
- `total_network_bandwidth`.
- :param str user_data: (optional) [User
- data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available
- when setting up the virtual server instance.
- :param List[VolumeAttachmentPrototype] volume_attachments: (optional) The
- additional volume attachments to create for the virtual server instance.
- :param VPCIdentity vpc: (optional) The VPC this virtual server instance
- will reside in.
- If specified, it must match the VPC for the subnets of the instance network
- interfaces.
"""
msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['InstanceTemplateInstanceByImageInstanceTemplateContext', 'InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext', 'InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext'])
+ ", ".join(['InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeInstanceNetworkAttachmentContext', 'InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentity'])
)
raise Exception(msg)
-class InstanceTemplateCollection:
+class InstanceNetworkAttachmentReference:
"""
- InstanceTemplateCollection.
+ InstanceNetworkAttachmentReference.
- :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.
+ :param InstanceNetworkAttachmentReferenceDeleted 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 instance network attachment.
+ :param str id: The unique identifier for this instance network attachment.
+ :param str name: The name for this instance network attachment. The name is
+ unique across all network attachments for the instance.
+ :param ReservedIPReference primary_ip: The primary IP address of the virtual
+ network interface for the instance network
+ attachment.
+ :param str resource_type: The resource type.
+ :param SubnetReference subnet: The subnet of the virtual network interface for
+ the instance network attachment.
"""
def __init__(
self,
- first: 'InstanceTemplateCollectionFirst',
- limit: int,
- templates: List['InstanceTemplate'],
- total_count: int,
+ href: str,
+ id: str,
+ name: str,
+ primary_ip: 'ReservedIPReference',
+ resource_type: str,
+ subnet: 'SubnetReference',
*,
- next: 'InstanceTemplateCollectionNext' = None,
+ deleted: Optional['InstanceNetworkAttachmentReferenceDeleted'] = None,
) -> None:
"""
- Initialize a InstanceTemplateCollection object.
+ Initialize a InstanceNetworkAttachmentReference 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 href: The URL for this instance network attachment.
+ :param str id: The unique identifier for this instance network attachment.
+ :param str name: The name for this instance network attachment. The name is
+ unique across all network attachments for the instance.
+ :param ReservedIPReference primary_ip: The primary IP address of the
+ virtual network interface for the instance network
+ attachment.
+ :param str resource_type: The resource type.
+ :param SubnetReference subnet: The subnet of the virtual network interface
+ for the instance network attachment.
+ :param InstanceNetworkAttachmentReferenceDeleted deleted: (optional) If
+ present, this property indicates the referenced resource has been deleted,
+ and provides
+ some supplementary information.
"""
- self.first = first
- self.limit = limit
- self.next = next
- self.templates = templates
- self.total_count = total_count
+ self.deleted = deleted
+ self.href = href
+ self.id = id
+ self.name = name
+ self.primary_ip = primary_ip
+ self.resource_type = resource_type
+ self.subnet = subnet
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstanceTemplateCollection':
- """Initialize a InstanceTemplateCollection object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceNetworkAttachmentReference':
+ """Initialize a InstanceNetworkAttachmentReference object from a json dictionary."""
args = {}
- if 'first' in _dict:
- args['first'] = InstanceTemplateCollectionFirst.from_dict(_dict.get('first'))
+ if (deleted := _dict.get('deleted')) is not None:
+ args['deleted'] = InstanceNetworkAttachmentReferenceDeleted.from_dict(deleted)
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'first\' not present in InstanceTemplateCollection JSON')
- if 'limit' in _dict:
- args['limit'] = _dict.get('limit')
+ raise ValueError('Required property \'href\' not present in InstanceNetworkAttachmentReference JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
else:
- raise ValueError('Required property \'limit\' not present in InstanceTemplateCollection JSON')
- if 'next' in _dict:
- args['next'] = InstanceTemplateCollectionNext.from_dict(_dict.get('next'))
- if 'templates' in _dict:
- args['templates'] = _dict.get('templates')
+ raise ValueError('Required property \'id\' not present in InstanceNetworkAttachmentReference JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
else:
- raise ValueError('Required property \'templates\' not present in InstanceTemplateCollection JSON')
- if 'total_count' in _dict:
- args['total_count'] = _dict.get('total_count')
+ raise ValueError('Required property \'name\' not present in InstanceNetworkAttachmentReference JSON')
+ if (primary_ip := _dict.get('primary_ip')) is not None:
+ args['primary_ip'] = ReservedIPReference.from_dict(primary_ip)
else:
- raise ValueError('Required property \'total_count\' not present in InstanceTemplateCollection JSON')
+ raise ValueError('Required property \'primary_ip\' not present in InstanceNetworkAttachmentReference JSON')
+ if (resource_type := _dict.get('resource_type')) is not None:
+ args['resource_type'] = resource_type
+ else:
+ raise ValueError('Required property \'resource_type\' not present in InstanceNetworkAttachmentReference JSON')
+ if (subnet := _dict.get('subnet')) is not None:
+ args['subnet'] = SubnetReference.from_dict(subnet)
+ else:
+ raise ValueError('Required property \'subnet\' not present in InstanceNetworkAttachmentReference JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceTemplateCollection object from a json dictionary."""
+ """Initialize a InstanceNetworkAttachmentReference object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'first') and self.first is not None:
- if isinstance(self.first, dict):
- _dict['first'] = self.first
+ if hasattr(self, 'deleted') and self.deleted is not None:
+ if isinstance(self.deleted, dict):
+ _dict['deleted'] = self.deleted
else:
- _dict['first'] = self.first.to_dict()
- if hasattr(self, 'limit') and self.limit is not None:
- _dict['limit'] = self.limit
- if hasattr(self, 'next') and self.next is not None:
- if isinstance(self.next, dict):
- _dict['next'] = self.next
+ _dict['deleted'] = self.deleted.to_dict()
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
+ if hasattr(self, 'id') and self.id is not None:
+ _dict['id'] = self.id
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ if hasattr(self, 'primary_ip') and self.primary_ip is not None:
+ if isinstance(self.primary_ip, dict):
+ _dict['primary_ip'] = self.primary_ip
else:
- _dict['next'] = self.next.to_dict()
- if hasattr(self, 'templates') and self.templates is not None:
- templates_list = []
- for v in self.templates:
- if isinstance(v, dict):
- templates_list.append(v)
- else:
- templates_list.append(v.to_dict())
- _dict['templates'] = templates_list
- if hasattr(self, 'total_count') and self.total_count is not None:
- _dict['total_count'] = self.total_count
+ _dict['primary_ip'] = self.primary_ip.to_dict()
+ if hasattr(self, 'resource_type') and self.resource_type is not None:
+ _dict['resource_type'] = self.resource_type
+ if hasattr(self, 'subnet') and self.subnet is not None:
+ if isinstance(self.subnet, dict):
+ _dict['subnet'] = self.subnet
+ else:
+ _dict['subnet'] = self.subnet.to_dict()
return _dict
def _to_dict(self):
@@ -49951,58 +52459,67 @@ 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 InstanceNetworkAttachmentReference object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceTemplateCollection') -> bool:
+ def __eq__(self, other: 'InstanceNetworkAttachmentReference') -> bool:
"""Return `true` when 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: 'InstanceNetworkAttachmentReference') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
+ class ResourceTypeEnum(str, Enum):
+ """
+ The resource type.
+ """
+
+ INSTANCE_NETWORK_ATTACHMENT = 'instance_network_attachment'
-class InstanceTemplateCollectionFirst:
+
+
+class InstanceNetworkAttachmentReferenceDeleted:
"""
- 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.
+ :param str more_info: Link to documentation about deleted resources.
"""
def __init__(
self,
- href: str,
+ more_info: str,
) -> None:
"""
- Initialize a InstanceTemplateCollectionFirst object.
+ Initialize a InstanceNetworkAttachmentReferenceDeleted 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) -> 'InstanceTemplateCollectionFirst':
- """Initialize a InstanceTemplateCollectionFirst object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceNetworkAttachmentReferenceDeleted':
+ """Initialize a InstanceNetworkAttachmentReferenceDeleted object from a json dictionary."""
args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ if (more_info := _dict.get('more_info')) is not None:
+ args['more_info'] = more_info
else:
- raise ValueError('Required property \'href\' not present in InstanceTemplateCollectionFirst JSON')
+ raise ValueError('Required property \'more_info\' not present in InstanceNetworkAttachmentReferenceDeleted JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceTemplateCollectionFirst object from a json dictionary."""
+ """Initialize a InstanceNetworkAttachmentReferenceDeleted object from 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):
@@ -50010,59 +52527,175 @@ 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 InstanceNetworkAttachmentReferenceDeleted object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceTemplateCollectionFirst') -> bool:
+ def __eq__(self, other: 'InstanceNetworkAttachmentReferenceDeleted') -> bool:
"""Return `true` when 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: 'InstanceNetworkAttachmentReferenceDeleted') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class InstanceTemplateCollectionNext:
+class InstancePatch:
"""
- A link to the next page of resources. This property is present for all pages except
- the last page.
+ InstancePatch.
- :attr str href: The URL for a page of resources.
+ :param InstanceAvailabilityPolicyPatch availability_policy: (optional) The
+ availability policy for this virtual server instance.
+ :param InstanceMetadataServicePatch metadata_service: (optional) The metadata
+ service configuration.
+ :param str name: (optional) The name for this virtual server instance. The name
+ must not be used by another virtual server instance in the region. Changing the
+ name will not affect the system hostname.
+ :param InstancePlacementTargetPatch placement_target: (optional) The placement
+ restrictions to use for the virtual server instance. For the placement
+ restrictions to be changed, the instance `status` must be `stopping` or
+ `stopped`.
+ If set, `reservation_affinity.policy` must be `disabled`.
+ :param InstancePatchProfile profile: (optional) The profile to use for this
+ virtual server instance. For the profile to be changed,
+ the instance `status` must be `stopping` or `stopped`. In addition, the
+ requested
+ profile must:
+ - Have matching instance disk support. Any disks associated with the current
+ profile
+ will be deleted, and any disks associated with the requested profile will be
+ created.
+ - Be compatible with any `placement_target` constraints. For example, if the
+ instance is placed on a dedicated host, the requested profile `family` must be
+ the same as the dedicated host `family`.
+ - Have the same `vcpu.architecture`.
+ - Support the number of network attachments or network interfaces the instance
+ currently has.
+ :param InstanceReservationAffinityPatch reservation_affinity: (optional)
+ :param int total_volume_bandwidth: (optional) The amount of bandwidth (in
+ megabits per second) allocated exclusively to instance storage volumes. An
+ increase in this value will result in a corresponding decrease to
+ `total_network_bandwidth`.
"""
def __init__(
self,
- href: str,
+ *,
+ availability_policy: Optional['InstanceAvailabilityPolicyPatch'] = None,
+ metadata_service: Optional['InstanceMetadataServicePatch'] = None,
+ name: Optional[str] = None,
+ placement_target: Optional['InstancePlacementTargetPatch'] = None,
+ profile: Optional['InstancePatchProfile'] = None,
+ reservation_affinity: Optional['InstanceReservationAffinityPatch'] = None,
+ total_volume_bandwidth: Optional[int] = None,
) -> None:
"""
- Initialize a InstanceTemplateCollectionNext object.
+ Initialize a InstancePatch object.
- :param str href: The URL for a page of resources.
+ :param InstanceAvailabilityPolicyPatch availability_policy: (optional) The
+ availability policy for this virtual server instance.
+ :param InstanceMetadataServicePatch metadata_service: (optional) The
+ metadata service configuration.
+ :param str name: (optional) The name for this virtual server instance. The
+ name must not be used by another virtual server instance in the region.
+ Changing the name will not affect the system hostname.
+ :param InstancePlacementTargetPatch placement_target: (optional) The
+ placement restrictions to use for the virtual server instance. For the
+ placement
+ restrictions to be changed, the instance `status` must be `stopping` or
+ `stopped`.
+ If set, `reservation_affinity.policy` must be `disabled`.
+ :param InstancePatchProfile profile: (optional) The profile to use for this
+ virtual server instance. For the profile to be changed,
+ the instance `status` must be `stopping` or `stopped`. In addition, the
+ requested
+ profile must:
+ - Have matching instance disk support. Any disks associated with the
+ current profile
+ will be deleted, and any disks associated with the requested profile will
+ be
+ created.
+ - Be compatible with any `placement_target` constraints. For example, if
+ the
+ instance is placed on a dedicated host, the requested profile `family`
+ must be
+ the same as the dedicated host `family`.
+ - Have the same `vcpu.architecture`.
+ - Support the number of network attachments or network interfaces the
+ instance
+ currently has.
+ :param InstanceReservationAffinityPatch reservation_affinity: (optional)
+ :param int total_volume_bandwidth: (optional) The amount of bandwidth (in
+ megabits per second) allocated exclusively to instance storage volumes. An
+ increase in this value will result in a corresponding decrease to
+ `total_network_bandwidth`.
"""
- self.href = href
+ self.availability_policy = availability_policy
+ self.metadata_service = metadata_service
+ self.name = name
+ self.placement_target = placement_target
+ self.profile = profile
+ self.reservation_affinity = reservation_affinity
+ self.total_volume_bandwidth = total_volume_bandwidth
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstanceTemplateCollectionNext':
- """Initialize a InstanceTemplateCollectionNext 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 InstanceTemplateCollectionNext JSON')
+ if (availability_policy := _dict.get('availability_policy')) is not None:
+ args['availability_policy'] = InstanceAvailabilityPolicyPatch.from_dict(availability_policy)
+ if (metadata_service := _dict.get('metadata_service')) is not None:
+ args['metadata_service'] = InstanceMetadataServicePatch.from_dict(metadata_service)
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ if (placement_target := _dict.get('placement_target')) is not None:
+ args['placement_target'] = placement_target
+ if (profile := _dict.get('profile')) is not None:
+ args['profile'] = profile
+ if (reservation_affinity := _dict.get('reservation_affinity')) is not None:
+ args['reservation_affinity'] = InstanceReservationAffinityPatch.from_dict(reservation_affinity)
+ if (total_volume_bandwidth := _dict.get('total_volume_bandwidth')) is not None:
+ args['total_volume_bandwidth'] = total_volume_bandwidth
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceTemplateCollectionNext 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, 'availability_policy') and self.availability_policy is not None:
+ if isinstance(self.availability_policy, dict):
+ _dict['availability_policy'] = self.availability_policy
+ else:
+ _dict['availability_policy'] = self.availability_policy.to_dict()
+ if hasattr(self, 'metadata_service') and self.metadata_service is not None:
+ if isinstance(self.metadata_service, dict):
+ _dict['metadata_service'] = self.metadata_service
+ else:
+ _dict['metadata_service'] = self.metadata_service.to_dict()
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ if hasattr(self, 'placement_target') and self.placement_target is not None:
+ if isinstance(self.placement_target, dict):
+ _dict['placement_target'] = self.placement_target
+ 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, 'reservation_affinity') and self.reservation_affinity is not None:
+ if isinstance(self.reservation_affinity, dict):
+ _dict['reservation_affinity'] = self.reservation_affinity
+ else:
+ _dict['reservation_affinity'] = self.reservation_affinity.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):
@@ -50070,23 +52703,34 @@ 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 InstancePatch object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceTemplateCollectionNext') -> 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: 'InstanceTemplateCollectionNext') -> bool:
+ def __ne__(self, other: 'InstancePatch') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class InstanceTemplateIdentity:
+class InstancePatchProfile:
"""
- Identifies an instance template by a unique property.
+ The profile to use for this virtual server instance. For the profile to be changed,
+ the instance `status` must be `stopping` or `stopped`. In addition, the requested
+ profile must:
+ - Have matching instance disk support. Any disks associated with the current profile
+ will be deleted, and any disks associated with the requested profile will be
+ created.
+ - Be compatible with any `placement_target` constraints. For example, if the
+ instance is placed on a dedicated host, the requested profile `family` must be
+ the same as the dedicated host `family`.
+ - Have the same `vcpu.architecture`.
+ - Support the number of network attachments or network interfaces the instance
+ currently has.
"""
@@ -50094,305 +52738,397 @@ def __init__(
self,
) -> None:
"""
- Initialize a InstanceTemplateIdentity object.
+ Initialize a InstancePatchProfile object.
"""
msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['InstanceTemplateIdentityById', 'InstanceTemplateIdentityByHref', 'InstanceTemplateIdentityByCRN'])
+ ", ".join(['InstancePatchProfileInstanceProfileIdentityByName', 'InstancePatchProfileInstanceProfileIdentityByHref'])
)
raise Exception(msg)
-class InstanceTemplatePatch:
+class InstancePlacementTarget:
"""
- InstanceTemplatePatch.
+ InstancePlacementTarget.
- :attr str name: (optional) The name for this instance template. The name must
- not be used by another instance template in the region.
"""
def __init__(
self,
- *,
- name: str = None,
) -> None:
"""
- Initialize a InstanceTemplatePatch object.
+ Initialize a InstancePlacementTarget object.
- :param str name: (optional) The name for this instance template. The name
- must not be used by another instance template in the region.
"""
- self.name = name
-
- @classmethod
- def from_dict(cls, _dict: Dict) -> 'InstanceTemplatePatch':
- """Initialize a InstanceTemplatePatch object from a json dictionary."""
- args = {}
- if 'name' in _dict:
- args['name'] = _dict.get('name')
- return cls(**args)
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['InstancePlacementTargetDedicatedHostGroupReference', 'InstancePlacementTargetDedicatedHostReference', 'InstancePlacementTargetPlacementGroupReference'])
+ )
+ raise Exception(msg)
- @classmethod
- def _from_dict(cls, _dict):
- """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, 'name') and self.name is not None:
- _dict['name'] = self.name
- return _dict
+class InstancePlacementTargetPatch:
+ """
+ InstancePlacementTargetPatch.
- def _to_dict(self):
- """Return a json dictionary representing this model."""
- return self.to_dict()
+ """
- def __str__(self) -> str:
- """Return a `str` version of this InstanceTemplatePatch object."""
- return json.dumps(self.to_dict(), indent=2)
+ def __init__(
+ self,
+ ) -> None:
+ """
+ Initialize a InstancePlacementTargetPatch object.
- 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__
+ """
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['InstancePlacementTargetPatchDedicatedHostIdentity', 'InstancePlacementTargetPatchDedicatedHostGroupIdentity'])
+ )
+ raise Exception(msg)
- def __ne__(self, other: 'InstanceTemplatePatch') -> bool:
- """Return `true` when self and other are not equal, false otherwise."""
- return not self == other
+class InstancePlacementTargetPrototype:
+ """
+ InstancePlacementTargetPrototype.
-class InstanceTemplatePrototype:
- """
- InstanceTemplatePrototype.
-
- :attr InstanceAvailabilityPolicyPrototype availability_policy: (optional) The
- availability policy to use for this virtual server instance.
- :attr InstanceDefaultTrustedProfilePrototype default_trusted_profile: (optional)
- The default trusted profile configuration to use for this virtual server
- instance
- This property's value is used when provisioning the virtual server instance, but
- not
- subsequently managed. Accordingly, it is reflected as an [instance
- initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
- property.
- :attr List[KeyIdentity] keys: (optional) The public SSH keys for the
- administrative user of the virtual server instance. Keys will be made available
- to the virtual server instance as cloud-init vendor data. For cloud-init enabled
- images, these keys will also be added as SSH authorized keys for the
- administrative user.
- For Windows images, the keys of type `rsa` must be specified, and one will be
- selected to encrypt [the administrator
- password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys
- are optional for other images, but if no keys are specified, the instance will
- be inaccessible unless the specified image provides another means of access.
- This property's value is used when provisioning the virtual server instance, but
- not subsequently managed. Accordingly, it is reflected as an [instance
- initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
- property.
- :attr InstanceMetadataServicePrototype metadata_service: (optional) The metadata
- service configuration.
- :attr str name: (optional) The name for this instance template. The name must
- not be used by another instance template in the region. If unspecified, the name
- will be a hyphenated list of randomly-selected words.
- :attr InstancePlacementTargetPrototype placement_target: (optional) The
- placement restrictions to use for the virtual server instance.
- :attr InstanceProfileIdentity profile: (optional) The
- [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this
- virtual server instance.
- If unspecified, `bx2-2x8` will be used, but this default value is expected to
- change
- in the future.
- :attr ResourceGroupIdentity resource_group: (optional) The resource group to
- use. If unspecified, the account's [default resource
- group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be
- used.
- :attr int total_volume_bandwidth: (optional) The amount of bandwidth (in
- megabits per second) allocated exclusively to instance storage volumes. An
- increase in this value will result in a corresponding decrease to
- `total_network_bandwidth`.
- :attr str user_data: (optional) [User
- data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when
- setting up the virtual server instance.
- :attr List[VolumeAttachmentPrototype] volume_attachments: (optional) The
- additional volume attachments to create for the virtual server instance.
- :attr VPCIdentity vpc: (optional) The VPC this virtual server instance will
- reside in.
- If specified, it must match the VPC for the subnets of the instance network
- interfaces.
"""
def __init__(
self,
- *,
- availability_policy: 'InstanceAvailabilityPolicyPrototype' = None,
- default_trusted_profile: 'InstanceDefaultTrustedProfilePrototype' = None,
- keys: List['KeyIdentity'] = None,
- metadata_service: 'InstanceMetadataServicePrototype' = None,
- name: str = None,
- placement_target: 'InstancePlacementTargetPrototype' = None,
- profile: 'InstanceProfileIdentity' = None,
- resource_group: 'ResourceGroupIdentity' = None,
- total_volume_bandwidth: int = None,
- user_data: str = None,
- volume_attachments: List['VolumeAttachmentPrototype'] = None,
- vpc: 'VPCIdentity' = None,
) -> None:
"""
- Initialize a InstanceTemplatePrototype object.
+ Initialize a InstancePlacementTargetPrototype object.
- :param InstanceAvailabilityPolicyPrototype availability_policy: (optional)
- The availability policy to use for this virtual server instance.
- :param InstanceDefaultTrustedProfilePrototype default_trusted_profile:
- (optional) The default trusted profile configuration to use for this
- virtual server instance
- This property's value is used when provisioning the virtual server
- instance, but not
- subsequently managed. Accordingly, it is reflected as an [instance
- initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
- property.
- :param List[KeyIdentity] keys: (optional) The public SSH keys for the
- administrative user of the virtual server instance. Keys will be made
- available to the virtual server instance as cloud-init vendor data. For
- cloud-init enabled images, these keys will also be added as SSH authorized
- keys for the administrative user.
- For Windows images, the keys of type `rsa` must be specified, and one will
- be selected to encrypt [the administrator
- password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization).
- Keys are optional for other images, but if no keys are specified, the
- instance will be inaccessible unless the specified image provides another
- means of access.
- This property's value is used when provisioning the virtual server
- instance, but not subsequently managed. Accordingly, it is reflected as an
- [instance
- initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
- property.
- :param InstanceMetadataServicePrototype metadata_service: (optional) The
- metadata service configuration.
- :param str name: (optional) The name for this instance template. The name
- must not be used by another instance template in the region. If
- unspecified, the name will be a hyphenated list of randomly-selected words.
- :param InstancePlacementTargetPrototype placement_target: (optional) The
- placement restrictions to use for the virtual server instance.
- :param InstanceProfileIdentity profile: (optional) The
- [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for
- this
- virtual server instance.
- If unspecified, `bx2-2x8` will be used, but this default value is expected
- to change
- in the future.
- :param ResourceGroupIdentity resource_group: (optional) The resource group
- to use. If unspecified, the account's [default resource
- group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be
- used.
- :param int total_volume_bandwidth: (optional) The amount of bandwidth (in
- megabits per second) allocated exclusively to instance storage volumes. An
- increase in this value will result in a corresponding decrease to
- `total_network_bandwidth`.
- :param str user_data: (optional) [User
- data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available
- when setting up the virtual server instance.
- :param List[VolumeAttachmentPrototype] volume_attachments: (optional) The
- additional volume attachments to create for the virtual server instance.
- :param VPCIdentity vpc: (optional) The VPC this virtual server instance
- will reside in.
- If specified, it must match the VPC for the subnets of the instance network
- interfaces.
"""
msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['InstanceTemplatePrototypeInstanceTemplateByImage', 'InstanceTemplatePrototypeInstanceTemplateBySourceTemplate', 'InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot', 'InstanceTemplatePrototypeInstanceTemplateByCatalogOffering'])
+ ", ".join(['InstancePlacementTargetPrototypeDedicatedHostIdentity', 'InstancePlacementTargetPrototypeDedicatedHostGroupIdentity', 'InstancePlacementTargetPrototypePlacementGroupIdentity'])
)
raise Exception(msg)
-class InstanceTemplateReference:
+class InstanceProfile:
"""
- InstanceTemplateReference.
+ InstanceProfile.
- :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 template.
- :attr str id: The unique identifier for this instance template.
- :attr str name: The name for this instance template. The name is unique across
- all instance templates in the region.
+ :param InstanceProfileBandwidth bandwidth:
+ :param List[InstanceProfileDisk] disks: Collection of the instance profile's
+ disks.
+ :param str family: The product family this virtual server instance profile
+ belongs to.
+ :param 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 this virtual server instance profile.
+ :param InstanceProfileMemory memory:
+ :param str name: The globally unique name for this virtual server instance
+ profile.
+ :param InstanceProfileNetworkAttachmentCount network_attachment_count:
+ :param InstanceProfileNetworkInterfaceCount network_interface_count:
+ :param InstanceProfileNUMACount numa_count: (optional)
+ :param InstanceProfileOSArchitecture os_architecture:
+ :param InstanceProfilePortSpeed port_speed:
+ :param InstanceProfileReservationTerms reservation_terms:
+ :param str resource_type: The resource type.
+ :param str status: The status of the instance profile:
+ - `previous`: This instance profile is an older revision, but remains
+ provisionable and
+ usable.
+ - `current`: This profile is the latest revision.
+ Note that revisions are indicated by the generation of an instance profile.
+ Refer to the
+ [profile naming conventions]
+ (https://cloud.ibm.com/docs/vpc?topic=vpc-profiles&interface=ui#profiles-naming-rule)
+ for information on how generations are defined within an instance 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 profile on which the unexpected
+ property value was encountered.
+ :param InstanceProfileVolumeBandwidth total_volume_bandwidth:
+ :param InstanceProfileVCPUArchitecture vcpu_architecture:
+ :param InstanceProfileVCPU vcpu_count:
+ :param InstanceProfileVCPUManufacturer vcpu_manufacturer:
"""
def __init__(
self,
- crn: str,
+ bandwidth: 'InstanceProfileBandwidth',
+ disks: List['InstanceProfileDisk'],
+ family: str,
href: str,
- id: str,
+ memory: 'InstanceProfileMemory',
name: str,
+ network_attachment_count: 'InstanceProfileNetworkAttachmentCount',
+ network_interface_count: 'InstanceProfileNetworkInterfaceCount',
+ os_architecture: 'InstanceProfileOSArchitecture',
+ port_speed: 'InstanceProfilePortSpeed',
+ reservation_terms: 'InstanceProfileReservationTerms',
+ resource_type: str,
+ status: str,
+ total_volume_bandwidth: 'InstanceProfileVolumeBandwidth',
+ vcpu_architecture: 'InstanceProfileVCPUArchitecture',
+ vcpu_count: 'InstanceProfileVCPU',
+ vcpu_manufacturer: 'InstanceProfileVCPUManufacturer',
*,
- deleted: 'InstanceTemplateReferenceDeleted' = None,
+ gpu_count: Optional['InstanceProfileGPU'] = None,
+ gpu_manufacturer: Optional['InstanceProfileGPUManufacturer'] = None,
+ gpu_memory: Optional['InstanceProfileGPUMemory'] = None,
+ gpu_model: Optional['InstanceProfileGPUModel'] = None,
+ numa_count: Optional['InstanceProfileNUMACount'] = None,
) -> None:
"""
- Initialize a InstanceTemplateReference object.
+ Initialize a InstanceProfile object.
- :param str crn: The CRN for this instance template.
- :param str href: The URL for this instance template.
- :param str id: The unique identifier for this instance template.
- :param str name: The name for this instance template. The name is unique
- across all instance templates in the region.
- :param InstanceTemplateReferenceDeleted deleted: (optional) If present,
- this property indicates the referenced resource has been deleted, and
- provides
- some supplementary information.
+ :param InstanceProfileBandwidth bandwidth:
+ :param List[InstanceProfileDisk] disks: Collection of the instance
+ profile's disks.
+ :param str family: The product family this virtual server instance profile
+ belongs to.
+ :param str href: The URL for this virtual server instance profile.
+ :param InstanceProfileMemory memory:
+ :param str name: The globally unique name for this virtual server instance
+ profile.
+ :param InstanceProfileNetworkAttachmentCount network_attachment_count:
+ :param InstanceProfileNetworkInterfaceCount network_interface_count:
+ :param InstanceProfileOSArchitecture os_architecture:
+ :param InstanceProfilePortSpeed port_speed:
+ :param InstanceProfileReservationTerms reservation_terms:
+ :param str resource_type: The resource type.
+ :param str status: The status of the instance profile:
+ - `previous`: This instance profile is an older revision, but remains
+ provisionable and
+ usable.
+ - `current`: This profile is the latest revision.
+ Note that revisions are indicated by the generation of an instance profile.
+ Refer to the
+ [profile naming conventions]
+ (https://cloud.ibm.com/docs/vpc?topic=vpc-profiles&interface=ui#profiles-naming-rule)
+ for information on how generations are defined within an instance 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 profile on
+ which the unexpected property value was encountered.
+ :param InstanceProfileVolumeBandwidth total_volume_bandwidth:
+ :param InstanceProfileVCPUArchitecture vcpu_architecture:
+ :param InstanceProfileVCPU vcpu_count:
+ :param InstanceProfileVCPUManufacturer vcpu_manufacturer:
+ :param InstanceProfileGPU gpu_count: (optional)
+ :param InstanceProfileGPUManufacturer gpu_manufacturer: (optional)
+ :param InstanceProfileGPUMemory gpu_memory: (optional)
+ :param InstanceProfileGPUModel gpu_model: (optional)
+ :param InstanceProfileNUMACount numa_count: (optional)
"""
- self.crn = crn
- self.deleted = deleted
+ 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.id = id
+ self.memory = memory
self.name = name
+ self.network_attachment_count = network_attachment_count
+ self.network_interface_count = network_interface_count
+ self.numa_count = numa_count
+ self.os_architecture = os_architecture
+ self.port_speed = port_speed
+ self.reservation_terms = reservation_terms
+ self.resource_type = resource_type
+ self.status = status
+ self.total_volume_bandwidth = total_volume_bandwidth
+ self.vcpu_architecture = vcpu_architecture
+ self.vcpu_count = vcpu_count
+ self.vcpu_manufacturer = vcpu_manufacturer
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstanceTemplateReference':
- """Initialize a InstanceTemplateReference object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceProfile':
+ """Initialize a InstanceProfile object from a json dictionary."""
args = {}
- if 'crn' in _dict:
- args['crn'] = _dict.get('crn')
+ if (bandwidth := _dict.get('bandwidth')) is not None:
+ args['bandwidth'] = bandwidth
else:
- raise ValueError('Required property \'crn\' not present in InstanceTemplateReference JSON')
- if 'deleted' in _dict:
- args['deleted'] = InstanceTemplateReferenceDeleted.from_dict(_dict.get('deleted'))
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ raise ValueError('Required property \'bandwidth\' not present in InstanceProfile JSON')
+ if (disks := _dict.get('disks')) is not None:
+ args['disks'] = [InstanceProfileDisk.from_dict(v) for v in disks]
else:
- raise ValueError('Required property \'href\' not present in InstanceTemplateReference JSON')
- if 'id' in _dict:
- args['id'] = _dict.get('id')
+ raise ValueError('Required property \'disks\' not present in InstanceProfile JSON')
+ if (family := _dict.get('family')) is not None:
+ args['family'] = family
else:
- raise ValueError('Required property \'id\' not present in InstanceTemplateReference JSON')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
+ raise ValueError('Required property \'family\' not present in InstanceProfile JSON')
+ if (gpu_count := _dict.get('gpu_count')) is not None:
+ args['gpu_count'] = gpu_count
+ if (gpu_manufacturer := _dict.get('gpu_manufacturer')) is not None:
+ args['gpu_manufacturer'] = InstanceProfileGPUManufacturer.from_dict(gpu_manufacturer)
+ if (gpu_memory := _dict.get('gpu_memory')) is not None:
+ args['gpu_memory'] = gpu_memory
+ if (gpu_model := _dict.get('gpu_model')) is not None:
+ args['gpu_model'] = InstanceProfileGPUModel.from_dict(gpu_model)
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'name\' not present in InstanceTemplateReference JSON')
+ raise ValueError('Required property \'href\' not present in InstanceProfile JSON')
+ if (memory := _dict.get('memory')) is not None:
+ args['memory'] = memory
+ else:
+ raise ValueError('Required property \'memory\' not present in InstanceProfile JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ else:
+ raise ValueError('Required property \'name\' not present in InstanceProfile JSON')
+ if (network_attachment_count := _dict.get('network_attachment_count')) is not None:
+ args['network_attachment_count'] = network_attachment_count
+ else:
+ raise ValueError('Required property \'network_attachment_count\' not present in InstanceProfile JSON')
+ if (network_interface_count := _dict.get('network_interface_count')) is not None:
+ args['network_interface_count'] = network_interface_count
+ else:
+ raise ValueError('Required property \'network_interface_count\' not present in InstanceProfile JSON')
+ if (numa_count := _dict.get('numa_count')) is not None:
+ args['numa_count'] = numa_count
+ if (os_architecture := _dict.get('os_architecture')) is not None:
+ args['os_architecture'] = InstanceProfileOSArchitecture.from_dict(os_architecture)
+ else:
+ raise ValueError('Required property \'os_architecture\' not present in InstanceProfile JSON')
+ if (port_speed := _dict.get('port_speed')) is not None:
+ args['port_speed'] = port_speed
+ else:
+ raise ValueError('Required property \'port_speed\' not present in InstanceProfile JSON')
+ if (reservation_terms := _dict.get('reservation_terms')) is not None:
+ args['reservation_terms'] = InstanceProfileReservationTerms.from_dict(reservation_terms)
+ else:
+ raise ValueError('Required property \'reservation_terms\' not present in InstanceProfile JSON')
+ if (resource_type := _dict.get('resource_type')) is not None:
+ args['resource_type'] = resource_type
+ else:
+ raise ValueError('Required property \'resource_type\' not present in InstanceProfile JSON')
+ if (status := _dict.get('status')) is not None:
+ args['status'] = status
+ else:
+ raise ValueError('Required property \'status\' not present in InstanceProfile JSON')
+ if (total_volume_bandwidth := _dict.get('total_volume_bandwidth')) is not None:
+ args['total_volume_bandwidth'] = total_volume_bandwidth
+ else:
+ raise ValueError('Required property \'total_volume_bandwidth\' not present in InstanceProfile JSON')
+ if (vcpu_architecture := _dict.get('vcpu_architecture')) is not None:
+ args['vcpu_architecture'] = InstanceProfileVCPUArchitecture.from_dict(vcpu_architecture)
+ else:
+ raise ValueError('Required property \'vcpu_architecture\' not present in InstanceProfile JSON')
+ if (vcpu_count := _dict.get('vcpu_count')) is not None:
+ args['vcpu_count'] = vcpu_count
+ else:
+ raise ValueError('Required property \'vcpu_count\' not present in InstanceProfile JSON')
+ if (vcpu_manufacturer := _dict.get('vcpu_manufacturer')) is not None:
+ args['vcpu_manufacturer'] = InstanceProfileVCPUManufacturer.from_dict(vcpu_manufacturer)
+ else:
+ raise ValueError('Required property \'vcpu_manufacturer\' not present in InstanceProfile JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceTemplateReference 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, 'crn') and self.crn is not None:
- _dict['crn'] = self.crn
- if hasattr(self, 'deleted') and self.deleted is not None:
- if isinstance(self.deleted, dict):
- _dict['deleted'] = self.deleted
+ if hasattr(self, 'bandwidth') and self.bandwidth is not None:
+ if isinstance(self.bandwidth, dict):
+ _dict['bandwidth'] = self.bandwidth
else:
- _dict['deleted'] = self.deleted.to_dict()
+ _dict['bandwidth'] = self.bandwidth.to_dict()
+ if hasattr(self, 'disks') and self.disks is not None:
+ disks_list = []
+ for v in self.disks:
+ if isinstance(v, dict):
+ disks_list.append(v)
+ else:
+ disks_list.append(v.to_dict())
+ _dict['disks'] = disks_list
+ if hasattr(self, 'family') and self.family is not None:
+ _dict['family'] = self.family
+ if hasattr(self, 'gpu_count') and self.gpu_count is not None:
+ if isinstance(self.gpu_count, dict):
+ _dict['gpu_count'] = self.gpu_count
+ else:
+ _dict['gpu_count'] = self.gpu_count.to_dict()
+ if hasattr(self, 'gpu_manufacturer') and self.gpu_manufacturer is not None:
+ if isinstance(self.gpu_manufacturer, dict):
+ _dict['gpu_manufacturer'] = self.gpu_manufacturer
+ else:
+ _dict['gpu_manufacturer'] = self.gpu_manufacturer.to_dict()
+ if hasattr(self, 'gpu_memory') and self.gpu_memory is not None:
+ if isinstance(self.gpu_memory, dict):
+ _dict['gpu_memory'] = self.gpu_memory
+ else:
+ _dict['gpu_memory'] = self.gpu_memory.to_dict()
+ if hasattr(self, 'gpu_model') and self.gpu_model is not None:
+ if isinstance(self.gpu_model, dict):
+ _dict['gpu_model'] = self.gpu_model
+ else:
+ _dict['gpu_model'] = self.gpu_model.to_dict()
if hasattr(self, 'href') and self.href is not None:
_dict['href'] = self.href
- if hasattr(self, 'id') and self.id is not None:
- _dict['id'] = self.id
+ if hasattr(self, 'memory') and self.memory is not None:
+ if isinstance(self.memory, dict):
+ _dict['memory'] = self.memory
+ else:
+ _dict['memory'] = self.memory.to_dict()
if hasattr(self, 'name') and self.name is not None:
_dict['name'] = self.name
+ if hasattr(self, 'network_attachment_count') and self.network_attachment_count is not None:
+ if isinstance(self.network_attachment_count, dict):
+ _dict['network_attachment_count'] = self.network_attachment_count
+ else:
+ _dict['network_attachment_count'] = self.network_attachment_count.to_dict()
+ if hasattr(self, 'network_interface_count') and self.network_interface_count is not None:
+ if isinstance(self.network_interface_count, dict):
+ _dict['network_interface_count'] = self.network_interface_count
+ else:
+ _dict['network_interface_count'] = self.network_interface_count.to_dict()
+ if hasattr(self, 'numa_count') and self.numa_count is not None:
+ if isinstance(self.numa_count, dict):
+ _dict['numa_count'] = self.numa_count
+ else:
+ _dict['numa_count'] = self.numa_count.to_dict()
+ if hasattr(self, 'os_architecture') and self.os_architecture is not None:
+ if isinstance(self.os_architecture, dict):
+ _dict['os_architecture'] = self.os_architecture
+ else:
+ _dict['os_architecture'] = self.os_architecture.to_dict()
+ if hasattr(self, 'port_speed') and self.port_speed is not None:
+ if isinstance(self.port_speed, dict):
+ _dict['port_speed'] = self.port_speed
+ else:
+ _dict['port_speed'] = self.port_speed.to_dict()
+ if hasattr(self, 'reservation_terms') and self.reservation_terms is not None:
+ if isinstance(self.reservation_terms, dict):
+ _dict['reservation_terms'] = self.reservation_terms
+ else:
+ _dict['reservation_terms'] = self.reservation_terms.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, 'total_volume_bandwidth') and self.total_volume_bandwidth is not None:
+ if isinstance(self.total_volume_bandwidth, dict):
+ _dict['total_volume_bandwidth'] = self.total_volume_bandwidth
+ else:
+ _dict['total_volume_bandwidth'] = self.total_volume_bandwidth.to_dict()
+ if hasattr(self, 'vcpu_architecture') and self.vcpu_architecture is not None:
+ if isinstance(self.vcpu_architecture, dict):
+ _dict['vcpu_architecture'] = self.vcpu_architecture
+ else:
+ _dict['vcpu_architecture'] = self.vcpu_architecture.to_dict()
+ if hasattr(self, 'vcpu_count') and self.vcpu_count is not None:
+ if isinstance(self.vcpu_count, dict):
+ _dict['vcpu_count'] = self.vcpu_count
+ else:
+ _dict['vcpu_count'] = self.vcpu_count.to_dict()
+ if hasattr(self, 'vcpu_manufacturer') and self.vcpu_manufacturer is not None:
+ if isinstance(self.vcpu_manufacturer, dict):
+ _dict['vcpu_manufacturer'] = self.vcpu_manufacturer
+ else:
+ _dict['vcpu_manufacturer'] = self.vcpu_manufacturer.to_dict()
return _dict
def _to_dict(self):
@@ -50400,59 +53136,115 @@ 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 InstanceProfile object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceTemplateReference') -> 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: 'InstanceTemplateReference') -> bool:
+ def __ne__(self, other: 'InstanceProfile') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
+ class ResourceTypeEnum(str, Enum):
+ """
+ The resource type.
+ """
+
+ INSTANCE_PROFILE = 'instance_profile'
-class InstanceTemplateReferenceDeleted:
+
+ class StatusEnum(str, Enum):
+ """
+ The status of the instance profile:
+ - `previous`: This instance profile is an older revision, but remains
+ provisionable and
+ usable.
+ - `current`: This profile is the latest revision.
+ Note that revisions are indicated by the generation of an instance profile. Refer
+ to the
+ [profile naming conventions]
+ (https://cloud.ibm.com/docs/vpc?topic=vpc-profiles&interface=ui#profiles-naming-rule)
+ for information on how generations are defined within an instance 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 profile on which the unexpected
+ property value was encountered.
+ """
+
+ CURRENT = 'current'
+ PREVIOUS = 'previous'
+
+
+
+class InstanceProfileBandwidth:
"""
- If present, this property indicates the referenced resource has been deleted, and
- provides some supplementary information.
+ InstanceProfileBandwidth.
- :attr str more_info: Link to documentation about deleted resources.
"""
def __init__(
self,
- more_info: str,
) -> None:
"""
- Initialize a InstanceTemplateReferenceDeleted object.
+ Initialize a InstanceProfileBandwidth 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(['InstanceProfileBandwidthFixed', 'InstanceProfileBandwidthRange', 'InstanceProfileBandwidthEnum', 'InstanceProfileBandwidthDependent'])
+ )
+ raise Exception(msg)
+
+
+class InstanceProfileCollection:
+ """
+ InstanceProfileCollection.
+
+ :param List[InstanceProfile] profiles: Collection of virtual server instance
+ profiles.
+ """
+
+ def __init__(
+ self,
+ profiles: List['InstanceProfile'],
+ ) -> None:
+ """
+ Initialize a InstanceProfileCollection object.
+
+ :param List[InstanceProfile] profiles: Collection of virtual server
+ instance profiles.
+ """
+ self.profiles = profiles
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstanceTemplateReferenceDeleted':
- """Initialize a InstanceTemplateReferenceDeleted object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceProfileCollection':
+ """Initialize a InstanceProfileCollection object from a json dictionary."""
args = {}
- if 'more_info' in _dict:
- args['more_info'] = _dict.get('more_info')
+ if (profiles := _dict.get('profiles')) is not None:
+ args['profiles'] = [InstanceProfile.from_dict(v) for v in profiles]
else:
- raise ValueError('Required property \'more_info\' not present in InstanceTemplateReferenceDeleted JSON')
+ raise ValueError('Required property \'profiles\' not present in InstanceProfileCollection JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceTemplateReferenceDeleted 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, 'more_info') and self.more_info is not None:
- _dict['more_info'] = self.more_info
+ if hasattr(self, 'profiles') and self.profiles is not None:
+ profiles_list = []
+ for v in self.profiles:
+ if isinstance(v, dict):
+ profiles_list.append(v)
+ else:
+ profiles_list.append(v.to_dict())
+ _dict['profiles'] = profiles_list
return _dict
def _to_dict(self):
@@ -50460,78 +53252,87 @@ 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 InstanceProfileCollection object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceTemplateReferenceDeleted') -> 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: 'InstanceTemplateReferenceDeleted') -> bool:
+ def __ne__(self, other: 'InstanceProfileCollection') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class InstanceVCPU:
+class InstanceProfileDisk:
"""
- The virtual server instance VCPU configuration.
+ Disks provided by this profile.
- :attr str architecture: The VCPU architecture.
- :attr int count: The number of VCPUs assigned.
- :attr str manufacturer: The VCPU manufacturer.
+ :param InstanceProfileDiskQuantity quantity:
+ :param InstanceProfileDiskSize size:
+ :param InstanceProfileDiskSupportedInterfaces supported_interface_types:
"""
def __init__(
self,
- architecture: str,
- count: int,
- manufacturer: str,
+ quantity: 'InstanceProfileDiskQuantity',
+ size: 'InstanceProfileDiskSize',
+ supported_interface_types: 'InstanceProfileDiskSupportedInterfaces',
) -> None:
"""
- Initialize a InstanceVCPU object.
+ Initialize a InstanceProfileDisk object.
- :param str architecture: The VCPU architecture.
- :param int count: The number of VCPUs assigned.
- :param str manufacturer: The VCPU manufacturer.
+ :param InstanceProfileDiskQuantity quantity:
+ :param InstanceProfileDiskSize size:
+ :param InstanceProfileDiskSupportedInterfaces supported_interface_types:
"""
- self.architecture = architecture
- self.count = count
- self.manufacturer = manufacturer
+ self.quantity = quantity
+ self.size = size
+ self.supported_interface_types = supported_interface_types
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstanceVCPU':
- """Initialize a InstanceVCPU object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceProfileDisk':
+ """Initialize a InstanceProfileDisk object from a json dictionary."""
args = {}
- if 'architecture' in _dict:
- args['architecture'] = _dict.get('architecture')
+ if (quantity := _dict.get('quantity')) is not None:
+ args['quantity'] = quantity
else:
- raise ValueError('Required property \'architecture\' not present in InstanceVCPU JSON')
- if 'count' in _dict:
- args['count'] = _dict.get('count')
+ raise ValueError('Required property \'quantity\' not present in InstanceProfileDisk JSON')
+ if (size := _dict.get('size')) is not None:
+ args['size'] = size
else:
- raise ValueError('Required property \'count\' not present in InstanceVCPU JSON')
- if 'manufacturer' in _dict:
- args['manufacturer'] = _dict.get('manufacturer')
+ raise ValueError('Required property \'size\' not present in InstanceProfileDisk JSON')
+ if (supported_interface_types := _dict.get('supported_interface_types')) is not None:
+ args['supported_interface_types'] = InstanceProfileDiskSupportedInterfaces.from_dict(supported_interface_types)
else:
- raise ValueError('Required property \'manufacturer\' not present in InstanceVCPU JSON')
+ raise ValueError('Required property \'supported_interface_types\' not present in InstanceProfileDisk JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceVCPU 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, 'architecture') and self.architecture is not None:
- _dict['architecture'] = self.architecture
- if hasattr(self, 'count') and self.count is not None:
- _dict['count'] = self.count
- if hasattr(self, 'manufacturer') and self.manufacturer is not None:
- _dict['manufacturer'] = self.manufacturer
+ if hasattr(self, 'quantity') and self.quantity is not None:
+ if isinstance(self.quantity, dict):
+ _dict['quantity'] = self.quantity
+ else:
+ _dict['quantity'] = self.quantity.to_dict()
+ if hasattr(self, 'size') and self.size is not None:
+ if isinstance(self.size, dict):
+ _dict['size'] = self.size
+ else:
+ _dict['size'] = self.size.to_dict()
+ if hasattr(self, 'supported_interface_types') and self.supported_interface_types is not None:
+ if isinstance(self.supported_interface_types, dict):
+ _dict['supported_interface_types'] = self.supported_interface_types
+ else:
+ _dict['supported_interface_types'] = self.supported_interface_types.to_dict()
return _dict
def _to_dict(self):
@@ -50539,161 +53340,126 @@ 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 InstanceProfileDisk object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceVCPU') -> 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: 'InstanceVCPU') -> bool:
+ def __ne__(self, other: 'InstanceProfileDisk') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class Key:
+class InstanceProfileDiskQuantity:
"""
- Key.
+ InstanceProfileDiskQuantity.
- :attr datetime created_at: The date and time that the key was created.
- :attr str crn: The CRN for this key.
- :attr str fingerprint: The fingerprint for this key. The value is returned
- base64-encoded and prefixed with the hash algorithm (always `SHA256`).
- :attr str href: The URL for this key.
- :attr str id: The unique identifier for this key.
- :attr int length: The length of this key (in bits).
- :attr str name: The name for this key. The name must not be used by another key
- in the region. If unspecified, the name will be a hyphenated list of
- randomly-selected words.
- :attr str public_key: The public SSH key, consisting of two space-separated
- fields: the algorithm name, and the base64-encoded key.
- :attr ResourceGroupReference resource_group: The resource group for this key.
- :attr str type: The crypto-system used by this key.
"""
def __init__(
self,
- created_at: datetime,
- crn: str,
- fingerprint: str,
- href: str,
- id: str,
- length: int,
- name: str,
- public_key: str,
- resource_group: 'ResourceGroupReference',
- type: str,
) -> None:
"""
- Initialize a Key object.
+ Initialize a InstanceProfileDiskQuantity object.
- :param datetime created_at: The date and time that the key was created.
- :param str crn: The CRN for this key.
- :param str fingerprint: The fingerprint for this key. The value is
- returned base64-encoded and prefixed with the hash algorithm (always
- `SHA256`).
- :param str href: The URL for this key.
- :param str id: The unique identifier for this key.
- :param int length: The length of this key (in bits).
- :param str name: The name for this key. The name must not be used by
- another key in the region. If unspecified, the name will be a hyphenated
- list of randomly-selected words.
- :param str public_key: The public SSH key, consisting of two
- space-separated fields: the algorithm name, and the base64-encoded key.
- :param ResourceGroupReference resource_group: The resource group for this
- key.
- :param str type: The crypto-system used by this key.
"""
- self.created_at = created_at
- self.crn = crn
- self.fingerprint = fingerprint
- self.href = href
- self.id = id
- self.length = length
- self.name = name
- self.public_key = public_key
- self.resource_group = resource_group
+ 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.
+
+ :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.
+ """
+
+ def __init__(
+ self,
+ default: str,
+ type: str,
+ values: List[str],
+ ) -> None:
+ """
+ Initialize a InstanceProfileDiskSupportedInterfaces 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) -> 'Key':
- """Initialize a Key object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceProfileDiskSupportedInterfaces':
+ """Initialize a InstanceProfileDiskSupportedInterfaces object from a json dictionary."""
args = {}
- if 'created_at' in _dict:
- args['created_at'] = string_to_datetime(_dict.get('created_at'))
- else:
- raise ValueError('Required property \'created_at\' not present in Key JSON')
- if 'crn' in _dict:
- args['crn'] = _dict.get('crn')
- else:
- raise ValueError('Required property \'crn\' not present in Key JSON')
- if 'fingerprint' in _dict:
- args['fingerprint'] = _dict.get('fingerprint')
- else:
- raise ValueError('Required property \'fingerprint\' not present in Key JSON')
- if 'href' in _dict:
- args['href'] = _dict.get('href')
- else:
- raise ValueError('Required property \'href\' not present in Key JSON')
- if 'id' in _dict:
- args['id'] = _dict.get('id')
- else:
- raise ValueError('Required property \'id\' not present in Key JSON')
- if 'length' in _dict:
- args['length'] = _dict.get('length')
- else:
- raise ValueError('Required property \'length\' not present in Key JSON')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
- else:
- raise ValueError('Required property \'name\' not present in Key JSON')
- if 'public_key' in _dict:
- args['public_key'] = _dict.get('public_key')
+ if (default := _dict.get('default')) is not None:
+ args['default'] = default
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'))
+ raise ValueError('Required property \'default\' not present in InstanceProfileDiskSupportedInterfaces JSON')
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
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 \'type\' not present in InstanceProfileDiskSupportedInterfaces JSON')
+ if (values := _dict.get('values')) is not None:
+ args['values'] = values
else:
- raise ValueError('Required property \'type\' not present in Key JSON')
+ raise ValueError('Required property \'values\' not present in InstanceProfileDiskSupportedInterfaces JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a Key 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, 'created_at') and self.created_at is not None:
- _dict['created_at'] = datetime_to_string(self.created_at)
- if hasattr(self, 'crn') and self.crn is not None:
- _dict['crn'] = self.crn
- if hasattr(self, 'fingerprint') and self.fingerprint is not None:
- _dict['fingerprint'] = self.fingerprint
- if hasattr(self, 'href') and self.href is not None:
- _dict['href'] = self.href
- if hasattr(self, 'id') and self.id is not None:
- _dict['id'] = self.id
- if hasattr(self, 'length') and self.length is not None:
- _dict['length'] = self.length
- if hasattr(self, 'name') and self.name is not None:
- _dict['name'] = self.name
- if hasattr(self, 'public_key') and self.public_key is not None:
- _dict['public_key'] = self.public_key
- if hasattr(self, 'resource_group') and self.resource_group is not None:
- if isinstance(self.resource_group, dict):
- _dict['resource_group'] = self.resource_group
- else:
- _dict['resource_group'] = self.resource_group.to_dict()
+ if hasattr(self, '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):
@@ -50701,124 +53467,123 @@ 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 InstanceProfileDiskSupportedInterfaces object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'Key') -> 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: 'Key') -> bool:
+ def __ne__(self, other: 'InstanceProfileDiskSupportedInterfaces') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
+ class DefaultEnum(str, Enum):
+ """
+ The disk interface used for attaching the disk.
+ The enumerated values for this property are expected to expand in the future. When
+ processing this property, check for and log unknown values. Optionally halt
+ processing and surface the error, or bypass the resource on which the unexpected
+ property value was encountered.
+ """
+
+ NVME = 'nvme'
+ VIRTIO_BLK = 'virtio_blk'
+
+
class TypeEnum(str, Enum):
"""
- The crypto-system used by this key.
+ The type for this profile field.
"""
- ED25519 = 'ed25519'
- RSA = 'rsa'
+ 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 KeyCollection:
+class InstanceProfileGPU:
"""
- KeyCollection.
+ InstanceProfileGPU.
- :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.
"""
def __init__(
self,
- first: 'KeyCollectionFirst',
- keys: List['Key'],
- limit: int,
- total_count: int,
- *,
- next: 'KeyCollectionNext' = None,
) -> None:
"""
- Initialize a KeyCollection object.
+ Initialize a InstanceProfileGPU 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.
"""
- self.first = first
- self.keys = keys
- self.limit = limit
- self.next = next
- self.total_count = total_count
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['InstanceProfileGPUFixed', 'InstanceProfileGPURange', 'InstanceProfileGPUEnum', 'InstanceProfileGPUDependent'])
+ )
+ raise Exception(msg)
+
+
+class InstanceProfileGPUManufacturer:
+ """
+ InstanceProfileGPUManufacturer.
+
+ :param str type: The type for this profile field.
+ :param List[str] values: The possible GPU manufacturer(s) for an instance with
+ this profile.
+ """
+
+ def __init__(
+ self,
+ type: str,
+ values: List[str],
+ ) -> None:
+ """
+ Initialize a InstanceProfileGPUManufacturer object.
+
+ :param str type: The type for this profile field.
+ :param List[str] values: The possible GPU manufacturer(s) for an instance
+ with this profile.
+ """
+ self.type = type
+ self.values = values
@classmethod
- def from_dict(cls, _dict: Dict) -> 'KeyCollection':
- """Initialize a KeyCollection object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceProfileGPUManufacturer':
+ """Initialize a InstanceProfileGPUManufacturer object from a json dictionary."""
args = {}
- if 'first' in _dict:
- args['first'] = KeyCollectionFirst.from_dict(_dict.get('first'))
- else:
- raise ValueError('Required property \'first\' not present in KeyCollection JSON')
- if 'keys' in _dict:
- args['keys'] = [Key.from_dict(v) for v in _dict.get('keys')]
- else:
- raise ValueError('Required property \'keys\' not present in KeyCollection JSON')
- if 'limit' in _dict:
- args['limit'] = _dict.get('limit')
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
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')
+ raise ValueError('Required property \'type\' not present in InstanceProfileGPUManufacturer JSON')
+ if (values := _dict.get('values')) is not None:
+ args['values'] = values
else:
- raise ValueError('Required property \'total_count\' not present in KeyCollection JSON')
+ raise ValueError('Required property \'values\' not present in InstanceProfileGPUManufacturer JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a KeyCollection 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, 'first') and self.first is not None:
- if isinstance(self.first, dict):
- _dict['first'] = self.first
- else:
- _dict['first'] = self.first.to_dict()
- if hasattr(self, 'keys') and self.keys is not None:
- keys_list = []
- for v in self.keys:
- if isinstance(v, dict):
- keys_list.append(v)
- else:
- keys_list.append(v.to_dict())
- _dict['keys'] = keys_list
- if hasattr(self, 'limit') and self.limit is not None:
- _dict['limit'] = self.limit
- if hasattr(self, 'next') and self.next is not None:
- if isinstance(self.next, dict):
- _dict['next'] = self.next
- else:
- _dict['next'] = self.next.to_dict()
- if hasattr(self, 'total_count') and self.total_count is not None:
- _dict['total_count'] = self.total_count
+ if hasattr(self, '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):
@@ -50826,58 +53591,97 @@ 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 InstanceProfileGPUManufacturer object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'KeyCollection') -> 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: 'KeyCollection') -> bool:
+ def __ne__(self, other: 'InstanceProfileGPUManufacturer') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
+ class TypeEnum(str, Enum):
+ """
+ The type for this profile field.
+ """
+
+ ENUM = 'enum'
-class KeyCollectionFirst:
+
+
+class InstanceProfileGPUMemory:
"""
- A link to the first page of resources.
+ InstanceProfileGPUMemory.
- :attr str href: The URL for a page of resources.
"""
def __init__(
self,
- href: str,
) -> None:
"""
- Initialize a KeyCollectionFirst object.
+ Initialize a InstanceProfileGPUMemory object.
- :param str href: The URL for a page of resources.
"""
- self.href = href
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['InstanceProfileGPUMemoryFixed', 'InstanceProfileGPUMemoryRange', 'InstanceProfileGPUMemoryEnum', 'InstanceProfileGPUMemoryDependent'])
+ )
+ raise Exception(msg)
+
+
+class InstanceProfileGPUModel:
+ """
+ InstanceProfileGPUModel.
+
+ :param str type: The type for this profile field.
+ :param List[str] values: The possible GPU model(s) for an instance with this
+ profile.
+ """
+
+ def __init__(
+ self,
+ type: str,
+ values: List[str],
+ ) -> None:
+ """
+ Initialize a InstanceProfileGPUModel 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.
+ """
+ self.type = type
+ self.values = values
@classmethod
- def from_dict(cls, _dict: Dict) -> 'KeyCollectionFirst':
- """Initialize a KeyCollectionFirst object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceProfileGPUModel':
+ """Initialize a InstanceProfileGPUModel object from a json dictionary."""
args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
else:
- raise ValueError('Required property \'href\' not present in KeyCollectionFirst JSON')
+ raise ValueError('Required property \'type\' not present in InstanceProfileGPUModel JSON')
+ if (values := _dict.get('values')) is not None:
+ args['values'] = values
+ else:
+ raise ValueError('Required property \'values\' not present in InstanceProfileGPUModel JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a KeyCollectionFirst 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, '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
+ if hasattr(self, 'values') and self.values is not None:
+ _dict['values'] = self.values
return _dict
def _to_dict(self):
@@ -50885,83 +53689,88 @@ 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 InstanceProfileGPUModel object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'KeyCollectionFirst') -> 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: 'KeyCollectionFirst') -> bool:
+ def __ne__(self, other: 'InstanceProfileGPUModel') -> 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 KeyCollectionNext:
+
+
+class InstanceProfileIdentity:
"""
- A link to the next page of resources. This property is present for all pages except
- the last page.
+ Identifies an instance profile by a unique property.
- :attr str href: The URL for a page of resources.
"""
def __init__(
self,
- href: str,
) -> None:
"""
- Initialize a KeyCollectionNext object.
+ Initialize a InstanceProfileIdentity object.
- :param str href: The URL for a page of resources.
"""
- self.href = href
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['InstanceProfileIdentityByName', 'InstanceProfileIdentityByHref'])
+ )
+ raise Exception(msg)
- @classmethod
- 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 KeyCollectionNext JSON')
- return cls(**args)
- @classmethod
- def _from_dict(cls, _dict):
- """Initialize a KeyCollectionNext object from a json dictionary."""
- return cls.from_dict(_dict)
+class InstanceProfileMemory:
+ """
+ InstanceProfileMemory.
- def to_dict(self) -> Dict:
- """Return a json dictionary representing this model."""
- _dict = {}
- if hasattr(self, '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 __init__(
+ self,
+ ) -> None:
+ """
+ Initialize a InstanceProfileMemory object.
- def __str__(self) -> str:
- """Return a `str` version of this KeyCollectionNext object."""
- return json.dumps(self.to_dict(), indent=2)
+ """
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['InstanceProfileMemoryFixed', 'InstanceProfileMemoryRange', 'InstanceProfileMemoryEnum', 'InstanceProfileMemoryDependent'])
+ )
+ raise Exception(msg)
- def __eq__(self, other: '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: 'KeyCollectionNext') -> bool:
- """Return `true` when self and other are not equal, false otherwise."""
- return not self == other
+class InstanceProfileNUMACount:
+ """
+ InstanceProfileNUMACount.
+ """
-class KeyIdentity:
+ def __init__(
+ self,
+ ) -> None:
+ """
+ Initialize a InstanceProfileNUMACount object.
+
+ """
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['InstanceProfileNUMACountFixed', 'InstanceProfileNUMACountDependent'])
+ )
+ raise Exception(msg)
+
+
+class InstanceProfileNetworkAttachmentCount:
"""
- Identifies a key by a unique property.
+ InstanceProfileNetworkAttachmentCount.
"""
@@ -50969,54 +53778,96 @@ def __init__(
self,
) -> None:
"""
- Initialize a KeyIdentity object.
+ Initialize a InstanceProfileNetworkAttachmentCount object.
"""
msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['KeyIdentityById', 'KeyIdentityByCRN', 'KeyIdentityByHref', 'KeyIdentityByFingerprint'])
+ ", ".join(['InstanceProfileNetworkAttachmentCountRange', 'InstanceProfileNetworkAttachmentCountDependent'])
)
raise Exception(msg)
-class KeyPatch:
+class InstanceProfileNetworkInterfaceCount:
"""
- KeyPatch.
+ InstanceProfileNetworkInterfaceCount.
- :attr str name: (optional) The name for this key. The name must not be used by
- another key in the region.
"""
def __init__(
self,
- *,
- name: str = None,
) -> None:
"""
- Initialize a KeyPatch object.
+ Initialize a InstanceProfileNetworkInterfaceCount object.
- :param str name: (optional) The name for this key. The name must not be
- used by another key in the region.
"""
- self.name = name
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['InstanceProfileNetworkInterfaceCountRange', 'InstanceProfileNetworkInterfaceCountDependent'])
+ )
+ raise Exception(msg)
+
+
+class InstanceProfileOSArchitecture:
+ """
+ InstanceProfileOSArchitecture.
+
+ :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.
+ """
+
+ def __init__(
+ self,
+ default: str,
+ type: str,
+ values: List[str],
+ ) -> None:
+ """
+ Initialize a InstanceProfileOSArchitecture 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.
+ """
+ self.default = default
+ self.type = type
+ self.values = values
@classmethod
- def from_dict(cls, _dict: Dict) -> 'KeyPatch':
- """Initialize a KeyPatch object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceProfileOSArchitecture':
+ """Initialize a InstanceProfileOSArchitecture object from a json dictionary."""
args = {}
- if 'name' in _dict:
- args['name'] = _dict.get('name')
+ if (default := _dict.get('default')) is not None:
+ args['default'] = default
+ else:
+ raise ValueError('Required property \'default\' not present in InstanceProfileOSArchitecture JSON')
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
+ else:
+ raise ValueError('Required property \'type\' not present in InstanceProfileOSArchitecture JSON')
+ if (values := _dict.get('values')) is not None:
+ args['values'] = values
+ else:
+ raise ValueError('Required property \'values\' not present in InstanceProfileOSArchitecture JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a KeyPatch 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, '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):
@@ -51024,119 +53875,107 @@ 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 InstanceProfileOSArchitecture object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'KeyPatch') -> 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: 'KeyPatch') -> bool:
+ def __ne__(self, other: 'InstanceProfileOSArchitecture') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
+ class TypeEnum(str, Enum):
+ """
+ The type for this profile field.
+ """
+
+ ENUM = 'enum'
-class KeyReference:
+
+
+class InstanceProfilePortSpeed:
"""
- KeyReference.
+ InstanceProfilePortSpeed.
- :attr str crn: The CRN for this key.
- :attr KeyReferenceDeleted deleted: (optional) If present, this property
- indicates the referenced resource has been deleted, and provides
- some supplementary information.
- :attr str fingerprint: The fingerprint for this key. The value is returned
- base64-encoded and prefixed with the hash algorithm (always `SHA256`).
- :attr str href: The URL for this key.
- :attr str id: The unique identifier for this key.
- :attr str name: The name for this key. The name is unique across all keys in the
- region.
"""
def __init__(
self,
- crn: str,
- fingerprint: str,
- href: str,
- id: str,
+ ) -> 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.
+
+ :param str href: The URL for this virtual server instance profile.
+ :param str name: The globally unique name for this virtual server instance
+ profile.
+ :param str resource_type: The resource type.
+ """
+
+ def __init__(
+ self,
+ href: str,
name: str,
- *,
- deleted: 'KeyReferenceDeleted' = None,
+ resource_type: str,
) -> None:
"""
- Initialize a KeyReference object.
+ Initialize a InstanceProfileReference object.
- :param str crn: The CRN for this key.
- :param str fingerprint: The fingerprint for this key. The value is
- returned base64-encoded and prefixed with the hash algorithm (always
- `SHA256`).
- :param str href: The URL for this key.
- :param str id: The unique identifier for this key.
- :param str name: The name for this key. The name is unique across all keys
- in the region.
- :param KeyReferenceDeleted deleted: (optional) If present, this property
- indicates the referenced resource has been deleted, and provides
- some supplementary information.
+ :param str href: The URL for this virtual server instance profile.
+ :param str name: The globally unique name for this virtual server instance
+ profile.
+ :param str resource_type: The resource type.
"""
- self.crn = crn
- self.deleted = deleted
- self.fingerprint = fingerprint
self.href = href
- self.id = id
self.name = name
+ self.resource_type = resource_type
@classmethod
- def from_dict(cls, _dict: Dict) -> 'KeyReference':
- """Initialize a KeyReference object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceProfileReference':
+ """Initialize a InstanceProfileReference 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 (href := _dict.get('href')) is not None:
+ args['href'] = href
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 KeyReference JSON')
- if 'id' in _dict:
- args['id'] = _dict.get('id')
+ raise ValueError('Required property \'href\' not present in InstanceProfileReference JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
else:
- raise ValueError('Required property \'id\' not present in KeyReference JSON')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
+ raise ValueError('Required property \'name\' not present in InstanceProfileReference JSON')
+ if (resource_type := _dict.get('resource_type')) is not None:
+ args['resource_type'] = resource_type
else:
- raise ValueError('Required property \'name\' not present in KeyReference JSON')
+ raise ValueError('Required property \'resource_type\' not present in InstanceProfileReference JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a KeyReference object from a json dictionary."""
+ """Initialize a InstanceProfileReference object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'crn') and self.crn is not None:
- _dict['crn'] = self.crn
- if hasattr(self, 'deleted') and self.deleted is not None:
- if isinstance(self.deleted, dict):
- _dict['deleted'] = self.deleted
- else:
- _dict['deleted'] = self.deleted.to_dict()
- if hasattr(self, '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, 'resource_type') and self.resource_type is not None:
+ _dict['resource_type'] = self.resource_type
return _dict
def _to_dict(self):
@@ -51144,59 +53983,78 @@ 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 InstanceProfileReference object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'KeyReference') -> 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: 'KeyReference') -> bool:
+ def __ne__(self, other: 'InstanceProfileReference') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
+ class ResourceTypeEnum(str, Enum):
+ """
+ The resource type.
+ """
-class KeyReferenceDeleted:
+ INSTANCE_PROFILE = 'instance_profile'
+
+
+
+class InstanceProfileReservationTerms:
"""
- If present, this property indicates the referenced resource has been deleted, and
- provides some supplementary information.
+ InstanceProfileReservationTerms.
- :attr str more_info: Link to documentation about deleted resources.
+ :param str type: The type for this profile field.
+ :param List[str] values: The supported committed use terms for a reservation
+ using this profile.
"""
def __init__(
self,
- more_info: str,
+ type: str,
+ values: List[str],
) -> None:
"""
- Initialize a KeyReferenceDeleted object.
+ Initialize a InstanceProfileReservationTerms object.
- :param str more_info: Link to documentation about deleted resources.
+ :param str type: The type for this profile field.
+ :param List[str] values: The supported committed use terms for a
+ reservation using this profile.
"""
- self.more_info = more_info
+ self.type = type
+ self.values = values
@classmethod
- def from_dict(cls, _dict: Dict) -> 'KeyReferenceDeleted':
- """Initialize a KeyReferenceDeleted object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceProfileReservationTerms':
+ """Initialize a InstanceProfileReservationTerms object from a json dictionary."""
args = {}
- if 'more_info' in _dict:
- args['more_info'] = _dict.get('more_info')
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
else:
- raise ValueError('Required property \'more_info\' not present in KeyReferenceDeleted JSON')
+ raise ValueError('Required property \'type\' not present in InstanceProfileReservationTerms JSON')
+ if (values := _dict.get('values')) is not None:
+ args['values'] = values
+ else:
+ raise ValueError('Required property \'values\' not present in InstanceProfileReservationTerms JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a KeyReferenceDeleted object from a json dictionary."""
+ """Initialize a InstanceProfileReservationTerms object from 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):
@@ -51204,23 +54062,40 @@ 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 InstanceProfileReservationTerms object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'KeyReferenceDeleted') -> bool:
+ def __eq__(self, other: 'InstanceProfileReservationTerms') -> bool:
"""Return `true` when 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: 'InstanceProfileReservationTerms') -> 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 LegacyCloudObjectStorageBucketIdentity:
+
+ class ValuesEnum(str, Enum):
+ """
+ values.
+ """
+
+ ONE_YEAR = 'one_year'
+ THREE_YEAR = 'three_year'
+
+
+
+class InstanceProfileVCPU:
"""
- Identifies a Cloud Object Storage bucket by a unique property.
+ InstanceProfileVCPU.
"""
@@ -51228,54 +54103,74 @@ def __init__(
self,
) -> None:
"""
- Initialize a LegacyCloudObjectStorageBucketIdentity object.
+ Initialize a InstanceProfileVCPU object.
"""
msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName'])
+ ", ".join(['InstanceProfileVCPUFixed', 'InstanceProfileVCPURange', 'InstanceProfileVCPUEnum', 'InstanceProfileVCPUDependent'])
)
raise Exception(msg)
-class LegacyCloudObjectStorageBucketReference:
+class InstanceProfileVCPUArchitecture:
"""
- LegacyCloudObjectStorageBucketReference.
+ InstanceProfileVCPUArchitecture.
- :attr str name: The globally unique name of this Cloud Object Storage bucket.
+ :param str default: (optional) The default VCPU architecture for an instance
+ with this profile.
+ :param str type: The type for this profile field.
+ :param str value: The VCPU architecture for an instance with this profile.
"""
def __init__(
self,
- name: str,
+ type: str,
+ value: str,
+ *,
+ default: Optional[str] = None,
) -> None:
"""
- Initialize a LegacyCloudObjectStorageBucketReference object.
+ Initialize a InstanceProfileVCPUArchitecture object.
- :param str name: The globally unique name of this Cloud Object Storage
- bucket.
+ :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.name = name
+ self.default = default
+ self.type = type
+ self.value = value
@classmethod
- def from_dict(cls, _dict: Dict) -> 'LegacyCloudObjectStorageBucketReference':
- """Initialize a LegacyCloudObjectStorageBucketReference object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceProfileVCPUArchitecture':
+ """Initialize a InstanceProfileVCPUArchitecture object from a json dictionary."""
args = {}
- if 'name' in _dict:
- args['name'] = _dict.get('name')
+ if (default := _dict.get('default')) is not None:
+ args['default'] = default
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
else:
- raise ValueError('Required property \'name\' not present in LegacyCloudObjectStorageBucketReference JSON')
+ raise ValueError('Required property \'type\' not present in InstanceProfileVCPUArchitecture JSON')
+ if (value := _dict.get('value')) is not None:
+ args['value'] = value
+ else:
+ raise ValueError('Required property \'value\' not present in InstanceProfileVCPUArchitecture JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a LegacyCloudObjectStorageBucketReference 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, '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, 'value') and self.value is not None:
+ _dict['value'] = self.value
return _dict
def _to_dict(self):
@@ -51283,581 +54178,372 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this LegacyCloudObjectStorageBucketReference object."""
+ """Return a `str` version of this InstanceProfileVCPUArchitecture object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'LegacyCloudObjectStorageBucketReference') -> 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: 'LegacyCloudObjectStorageBucketReference') -> bool:
+ def __ne__(self, other: 'InstanceProfileVCPUArchitecture') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
+ class TypeEnum(str, Enum):
+ """
+ The type for this profile field.
+ """
+
+ FIXED = 'fixed'
-class LoadBalancer:
+
+
+class InstanceProfileVCPUManufacturer:
"""
- LoadBalancer.
+ InstanceProfileVCPUManufacturer.
- :attr datetime created_at: The date and time that this load balancer was
- created.
- :attr str crn: The load balancer's CRN.
- :attr LoadBalancerDNS dns: (optional) The DNS configuration for this load
- balancer.
- If absent, DNS `A` records for this load balancer's `hostname` property will be
- added to
- the public DNS zone `lb.appdomain.cloud`.
- :attr str hostname: Fully qualified domain name assigned to this load balancer.
- :attr str href: The load balancer's canonical URL.
- :attr str id: The unique identifier for this load balancer.
- :attr bool instance_groups_supported: Indicates whether this load balancer
- supports instance groups.
- :attr bool is_public: The type of this load balancer, public or private.
- :attr List[LoadBalancerListenerReference] listeners: The listeners of this load
- balancer.
- :attr LoadBalancerLogging logging: The logging configuration for this load
- balancer.
- :attr str name: The name for this load balancer. The name is unique across all
- load balancers in the VPC.
- :attr str operating_status: The operating status of this load balancer.
- :attr List[LoadBalancerPoolReference] pools: The pools of this load balancer.
- :attr List[LoadBalancerPrivateIpsItem] private_ips: The private IP addresses
- assigned to this load balancer.
- :attr LoadBalancerProfileReference profile: The profile for this load balancer.
- :attr str provisioning_status: The provisioning status of this load balancer:
- - `active`: The load balancer is running.
- - `create_pending`: The load balancer is being created.
- - `delete_pending`: The load balancer is being deleted.
- - `maintenance_pending`: The load balancer is unavailable due to an internal
- error (contact IBM support).
- - `migrate_pending`: The load balancer is migrating to the requested
- configuration.
- Performance may be degraded.
- - `update_pending`: The load balancer is being updated
- to the requested configuration.
- The enumerated values for this property are expected to expand in the future.
- When
- processing this property, check for and log unknown values. Optionally halt
- processing and surface the error, or bypass the load balancer on which the
- unexpected property value was encountered.
- :attr List[IP] public_ips: The public IP addresses assigned to this load
- balancer.
- Applicable only for public load balancers.
- :attr ResourceGroupReference resource_group: The resource group for this load
- balancer.
- :attr str resource_type: The resource type.
- :attr bool route_mode: Indicates whether route mode is enabled for this load
- balancer.
- At present, public load balancers are not supported with route mode enabled.
- :attr List[SecurityGroupReference] security_groups: The security groups
- targeting this load balancer.
- If empty, all inbound and outbound traffic is allowed.
- Applicable only for load balancers that support security groups.
- :attr bool security_groups_supported: Indicates whether this load balancer
- supports security groups.
- :attr List[SubnetReference] subnets: The subnets this load balancer is
- provisioned in. The load balancer's availability depends on the availability of
- the zones that the subnets reside in.
- All subnets will be in the same VPC.
- :attr bool udp_supported: Indicates whether this load balancer supports UDP.
+ :param str default: (optional) The default VCPU manufacturer for an instance
+ with this profile.
+ :param str type: The type for this profile field.
+ :param str value: The VCPU manufacturer for an instance with this profile.
"""
def __init__(
self,
- created_at: datetime,
- crn: str,
- hostname: str,
- href: str,
- id: str,
- instance_groups_supported: bool,
- is_public: bool,
- listeners: List['LoadBalancerListenerReference'],
- logging: 'LoadBalancerLogging',
- name: str,
- operating_status: str,
- pools: List['LoadBalancerPoolReference'],
- private_ips: List['LoadBalancerPrivateIpsItem'],
- profile: 'LoadBalancerProfileReference',
- provisioning_status: str,
- public_ips: List['IP'],
- resource_group: 'ResourceGroupReference',
- resource_type: str,
- route_mode: bool,
- security_groups: List['SecurityGroupReference'],
- security_groups_supported: bool,
- subnets: List['SubnetReference'],
- udp_supported: bool,
+ type: str,
+ value: str,
*,
- dns: 'LoadBalancerDNS' = None,
+ default: Optional[str] = None,
) -> None:
"""
- Initialize a LoadBalancer object.
+ Initialize a InstanceProfileVCPUManufacturer object.
- :param datetime created_at: The date and time that this load balancer was
- created.
- :param str crn: The load balancer's CRN.
- :param str hostname: Fully qualified domain name assigned to this load
- balancer.
- :param str href: The load balancer's canonical URL.
- :param str id: The unique identifier for this load balancer.
- :param bool instance_groups_supported: Indicates whether this load balancer
- supports instance groups.
- :param bool is_public: The type of this load balancer, public or private.
- :param List[LoadBalancerListenerReference] listeners: The listeners of this
- load balancer.
- :param LoadBalancerLogging logging: The logging configuration for this load
- balancer.
- :param str name: The name for this load balancer. The name is unique across
- all load balancers in the VPC.
- :param str operating_status: The operating status of this load balancer.
- :param List[LoadBalancerPoolReference] pools: The pools of this load
- balancer.
- :param List[LoadBalancerPrivateIpsItem] private_ips: The private IP
- addresses assigned to this load balancer.
- :param LoadBalancerProfileReference profile: The profile for this load
- balancer.
- :param str provisioning_status: The provisioning status of this load
- balancer:
- - `active`: The load balancer is running.
- - `create_pending`: The load balancer is being created.
- - `delete_pending`: The load balancer is being deleted.
- - `maintenance_pending`: The load balancer is unavailable due to an
- internal
- error (contact IBM support).
- - `migrate_pending`: The load balancer is migrating to the requested
- configuration.
- Performance may be degraded.
- - `update_pending`: The load balancer is being updated
- to the requested configuration.
- The enumerated values for this property are expected to expand in the
- future. When
- processing this property, check for and log unknown values. Optionally
- halt
- processing and surface the error, or bypass the load balancer on which
- the
- unexpected property value was encountered.
- :param List[IP] public_ips: The public IP addresses assigned to this load
- balancer.
- Applicable only for public load balancers.
- :param ResourceGroupReference resource_group: The resource group for this
- load balancer.
- :param str resource_type: The resource type.
- :param bool route_mode: Indicates whether route mode is enabled for this
- load balancer.
- At present, public load balancers are not supported with route mode
- enabled.
- :param List[SecurityGroupReference] security_groups: The security groups
- targeting this load balancer.
- If empty, all inbound and outbound traffic is allowed.
- Applicable only for load balancers that support security groups.
- :param bool security_groups_supported: Indicates whether this load balancer
- supports security groups.
- :param List[SubnetReference] subnets: The subnets this load balancer is
- provisioned in. The load balancer's availability depends on the
- availability of the zones that the subnets reside in.
- All subnets will be in the same VPC.
- :param bool udp_supported: Indicates whether this load balancer supports
- UDP.
- :param LoadBalancerDNS dns: (optional) The DNS configuration for this load
- balancer.
- If absent, DNS `A` records for this load balancer's `hostname` property
- will be added to
- the public DNS zone `lb.appdomain.cloud`.
+ :param str type: The type for this profile field.
+ :param str value: The VCPU manufacturer for an instance with this profile.
+ :param str default: (optional) The default VCPU manufacturer for an
+ instance with this profile.
"""
- self.created_at = created_at
- self.crn = crn
- self.dns = dns
- self.hostname = hostname
- self.href = href
- self.id = id
- self.instance_groups_supported = instance_groups_supported
- self.is_public = is_public
- self.listeners = listeners
- self.logging = logging
- self.name = name
- self.operating_status = operating_status
- self.pools = pools
- self.private_ips = private_ips
- self.profile = profile
- self.provisioning_status = provisioning_status
- self.public_ips = public_ips
- self.resource_group = resource_group
- self.resource_type = resource_type
- self.route_mode = route_mode
- self.security_groups = security_groups
- self.security_groups_supported = security_groups_supported
- self.subnets = subnets
- self.udp_supported = udp_supported
+ self.default = default
+ self.type = type
+ self.value = value
@classmethod
- def from_dict(cls, _dict: Dict) -> 'LoadBalancer':
- """Initialize a LoadBalancer object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceProfileVCPUManufacturer':
+ """Initialize a InstanceProfileVCPUManufacturer object from a json dictionary."""
args = {}
- if 'created_at' in _dict:
- args['created_at'] = string_to_datetime(_dict.get('created_at'))
- else:
- raise ValueError('Required property \'created_at\' not present in LoadBalancer JSON')
- if 'crn' in _dict:
- args['crn'] = _dict.get('crn')
- else:
- raise ValueError('Required property \'crn\' not present in LoadBalancer JSON')
- if 'dns' in _dict:
- args['dns'] = LoadBalancerDNS.from_dict(_dict.get('dns'))
- if 'hostname' in _dict:
- args['hostname'] = _dict.get('hostname')
- else:
- raise ValueError('Required property \'hostname\' not present in LoadBalancer JSON')
- if 'href' in _dict:
- args['href'] = _dict.get('href')
- else:
- raise ValueError('Required property \'href\' not present in LoadBalancer JSON')
- if 'id' in _dict:
- args['id'] = _dict.get('id')
- else:
- raise ValueError('Required property \'id\' not present in LoadBalancer JSON')
- if 'instance_groups_supported' in _dict:
- args['instance_groups_supported'] = _dict.get('instance_groups_supported')
- else:
- raise ValueError('Required property \'instance_groups_supported\' not present in LoadBalancer JSON')
- if 'is_public' in _dict:
- args['is_public'] = _dict.get('is_public')
- else:
- raise ValueError('Required property \'is_public\' not present in LoadBalancer JSON')
- if 'listeners' in _dict:
- args['listeners'] = [LoadBalancerListenerReference.from_dict(v) for v in _dict.get('listeners')]
- else:
- raise ValueError('Required property \'listeners\' not present in LoadBalancer JSON')
- if 'logging' in _dict:
- args['logging'] = LoadBalancerLogging.from_dict(_dict.get('logging'))
- else:
- raise ValueError('Required property \'logging\' not present in LoadBalancer JSON')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
- else:
- raise ValueError('Required property \'name\' not present in LoadBalancer JSON')
- if 'operating_status' in _dict:
- args['operating_status'] = _dict.get('operating_status')
- else:
- raise ValueError('Required property \'operating_status\' not present in LoadBalancer JSON')
- if 'pools' in _dict:
- args['pools'] = [LoadBalancerPoolReference.from_dict(v) for v in _dict.get('pools')]
- else:
- raise ValueError('Required property \'pools\' not present in LoadBalancer JSON')
- if 'private_ips' in _dict:
- args['private_ips'] = [LoadBalancerPrivateIpsItem.from_dict(v) for v in _dict.get('private_ips')]
- else:
- raise ValueError('Required property \'private_ips\' not present in LoadBalancer JSON')
- if 'profile' in _dict:
- args['profile'] = LoadBalancerProfileReference.from_dict(_dict.get('profile'))
- else:
- raise ValueError('Required property \'profile\' not present in LoadBalancer JSON')
- if 'provisioning_status' in _dict:
- args['provisioning_status'] = _dict.get('provisioning_status')
- else:
- raise ValueError('Required property \'provisioning_status\' not present in LoadBalancer JSON')
- if 'public_ips' in _dict:
- args['public_ips'] = [IP.from_dict(v) for v in _dict.get('public_ips')]
- else:
- raise ValueError('Required property \'public_ips\' not present in LoadBalancer JSON')
- if 'resource_group' in _dict:
- args['resource_group'] = ResourceGroupReference.from_dict(_dict.get('resource_group'))
- else:
- raise ValueError('Required property \'resource_group\' not present in LoadBalancer JSON')
- if 'resource_type' in _dict:
- args['resource_type'] = _dict.get('resource_type')
- else:
- raise ValueError('Required property \'resource_type\' not present in LoadBalancer JSON')
- if 'route_mode' in _dict:
- args['route_mode'] = _dict.get('route_mode')
- else:
- raise ValueError('Required property \'route_mode\' not present in LoadBalancer JSON')
- if 'security_groups' in _dict:
- args['security_groups'] = [SecurityGroupReference.from_dict(v) for v in _dict.get('security_groups')]
- else:
- raise ValueError('Required property \'security_groups\' not present in LoadBalancer JSON')
- if 'security_groups_supported' in _dict:
- args['security_groups_supported'] = _dict.get('security_groups_supported')
- else:
- raise ValueError('Required property \'security_groups_supported\' not present in LoadBalancer JSON')
- if 'subnets' in _dict:
- args['subnets'] = [SubnetReference.from_dict(v) for v in _dict.get('subnets')]
+ if (default := _dict.get('default')) is not None:
+ args['default'] = default
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
else:
- raise ValueError('Required property \'subnets\' not present in LoadBalancer JSON')
- if 'udp_supported' in _dict:
- args['udp_supported'] = _dict.get('udp_supported')
+ raise ValueError('Required property \'type\' not present in InstanceProfileVCPUManufacturer JSON')
+ if (value := _dict.get('value')) is not None:
+ args['value'] = value
else:
- raise ValueError('Required property \'udp_supported\' not present in LoadBalancer JSON')
+ raise ValueError('Required property \'value\' not present in InstanceProfileVCPUManufacturer JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a LoadBalancer object from a json dictionary."""
+ """Initialize a InstanceProfileVCPUManufacturer object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'created_at') and self.created_at is not None:
- _dict['created_at'] = datetime_to_string(self.created_at)
- if hasattr(self, 'crn') and self.crn is not None:
- _dict['crn'] = self.crn
- if hasattr(self, 'dns') and self.dns is not None:
- if isinstance(self.dns, dict):
- _dict['dns'] = self.dns
- else:
- _dict['dns'] = self.dns.to_dict()
- if hasattr(self, 'hostname') and self.hostname is not None:
- _dict['hostname'] = self.hostname
- if hasattr(self, 'href') and self.href is not None:
- _dict['href'] = self.href
- if hasattr(self, 'id') and self.id is not None:
- _dict['id'] = self.id
- if hasattr(self, 'instance_groups_supported') and self.instance_groups_supported is not None:
- _dict['instance_groups_supported'] = self.instance_groups_supported
- if hasattr(self, 'is_public') and self.is_public is not None:
- _dict['is_public'] = self.is_public
- if hasattr(self, 'listeners') and self.listeners is not None:
- listeners_list = []
- for v in self.listeners:
- if isinstance(v, dict):
- listeners_list.append(v)
- else:
- listeners_list.append(v.to_dict())
- _dict['listeners'] = listeners_list
- if hasattr(self, 'logging') and self.logging is not None:
- if isinstance(self.logging, dict):
- _dict['logging'] = self.logging
- else:
- _dict['logging'] = self.logging.to_dict()
- if hasattr(self, 'name') and self.name is not None:
- _dict['name'] = self.name
- if hasattr(self, 'operating_status') and self.operating_status is not None:
- _dict['operating_status'] = self.operating_status
- if hasattr(self, 'pools') and self.pools is not None:
- pools_list = []
- for v in self.pools:
- if isinstance(v, dict):
- pools_list.append(v)
- else:
- pools_list.append(v.to_dict())
- _dict['pools'] = pools_list
- if hasattr(self, 'private_ips') and self.private_ips is not None:
- private_ips_list = []
- for v in self.private_ips:
- if isinstance(v, dict):
- private_ips_list.append(v)
- else:
- private_ips_list.append(v.to_dict())
- _dict['private_ips'] = private_ips_list
- if hasattr(self, 'profile') and self.profile is not None:
- if isinstance(self.profile, dict):
- _dict['profile'] = self.profile
- else:
- _dict['profile'] = self.profile.to_dict()
- if hasattr(self, 'provisioning_status') and self.provisioning_status is not None:
- _dict['provisioning_status'] = self.provisioning_status
- if hasattr(self, 'public_ips') and self.public_ips is not None:
- public_ips_list = []
- for v in self.public_ips:
- if isinstance(v, dict):
- public_ips_list.append(v)
- else:
- public_ips_list.append(v.to_dict())
- _dict['public_ips'] = public_ips_list
- if hasattr(self, 'resource_group') and self.resource_group is not None:
- if isinstance(self.resource_group, dict):
- _dict['resource_group'] = self.resource_group
- else:
- _dict['resource_group'] = self.resource_group.to_dict()
- if hasattr(self, 'resource_type') and self.resource_type is not None:
- _dict['resource_type'] = self.resource_type
- if hasattr(self, 'route_mode') and self.route_mode is not None:
- _dict['route_mode'] = self.route_mode
- if hasattr(self, 'security_groups') and self.security_groups is not None:
- security_groups_list = []
- for v in self.security_groups:
- if isinstance(v, dict):
- security_groups_list.append(v)
- else:
- security_groups_list.append(v.to_dict())
- _dict['security_groups'] = security_groups_list
- if hasattr(self, 'security_groups_supported') and self.security_groups_supported is not None:
- _dict['security_groups_supported'] = self.security_groups_supported
- if hasattr(self, 'subnets') and self.subnets is not None:
- subnets_list = []
- for v in self.subnets:
- if isinstance(v, dict):
- subnets_list.append(v)
- else:
- subnets_list.append(v.to_dict())
- _dict['subnets'] = subnets_list
- if hasattr(self, 'udp_supported') and self.udp_supported is not None:
- _dict['udp_supported'] = self.udp_supported
- return _dict
-
- def _to_dict(self):
- """Return a json dictionary representing this model."""
- return self.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, '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 LoadBalancer object."""
+ """Return a `str` version of this InstanceProfileVCPUManufacturer object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'LoadBalancer') -> bool:
+ def __eq__(self, other: 'InstanceProfileVCPUManufacturer') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'LoadBalancer') -> bool:
+ def __ne__(self, other: 'InstanceProfileVCPUManufacturer') -> 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 type for this profile field.
"""
- OFFLINE = 'offline'
- ONLINE = 'online'
+ FIXED = 'fixed'
- class ProvisioningStatusEnum(str, Enum):
- """
- The provisioning status of this load balancer:
- - `active`: The load balancer is running.
- - `create_pending`: The load balancer is being created.
- - `delete_pending`: The load balancer is being deleted.
- - `maintenance_pending`: The load balancer is unavailable due to an internal
- error (contact IBM support).
- - `migrate_pending`: The load balancer is migrating to the requested
- configuration.
- Performance may be degraded.
- - `update_pending`: The load balancer is being updated
- to the requested configuration.
- The enumerated values for this property are expected to expand in the future.
- When
- processing this property, check for and log unknown values. Optionally halt
- processing and surface the error, or bypass the load balancer on which the
- unexpected property value was encountered.
- """
- ACTIVE = 'active'
- CREATE_PENDING = 'create_pending'
- DELETE_PENDING = 'delete_pending'
- FAILED = 'failed'
- MAINTENANCE_PENDING = 'maintenance_pending'
- MIGRATE_PENDING = 'migrate_pending'
- UPDATE_PENDING = 'update_pending'
+class InstanceProfileVolumeBandwidth:
+ """
+ InstanceProfileVolumeBandwidth.
+ """
- class ResourceTypeEnum(str, Enum):
+ def __init__(
+ self,
+ ) -> None:
"""
- The resource type.
+ Initialize a InstanceProfileVolumeBandwidth object.
+
"""
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['InstanceProfileVolumeBandwidthFixed', 'InstanceProfileVolumeBandwidthRange', 'InstanceProfileVolumeBandwidthEnum', 'InstanceProfileVolumeBandwidthDependent'])
+ )
+ raise Exception(msg)
- LOAD_BALANCER = 'load_balancer'
+class InstancePrototype:
+ """
+ InstancePrototype.
+
+ :param InstanceAvailabilityPolicyPrototype availability_policy: (optional) The
+ availability policy to use for this virtual server instance.
+ :param InstanceDefaultTrustedProfilePrototype default_trusted_profile:
+ (optional) The default trusted profile configuration to use for this virtual
+ server instance
+ This property's value is used when provisioning the virtual server instance, but
+ not
+ subsequently managed. Accordingly, it is reflected as an [instance
+ initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
+ property.
+ :param List[KeyIdentity] keys: (optional) The public SSH keys for the
+ administrative user of the virtual server instance. Keys will be made available
+ to the virtual server instance as cloud-init vendor data. For cloud-init enabled
+ images, these keys will also be added as SSH authorized keys for the
+ administrative user.
+ For Windows images, the keys of type `rsa` must be specified, and one will be
+ selected to encrypt [the administrator
+ password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys
+ are optional for other images, but if no keys are specified, the instance will
+ be inaccessible unless the specified image provides another means of access.
+ This property's value is used when provisioning the virtual server instance, but
+ not subsequently managed. Accordingly, it is reflected as an [instance
+ initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
+ property.
+ :param InstanceMetadataServicePrototype metadata_service: (optional) The
+ metadata service configuration.
+ :param str name: (optional) The name for this virtual server instance. The name
+ must not be used by another virtual server instance in the region. If
+ unspecified, the name will be a hyphenated list of randomly-selected words.
+ The system hostname will be based on this name.
+ :param InstancePlacementTargetPrototype placement_target: (optional) The
+ placement restrictions to use for the virtual server instance.
+ If specified, `reservation_affinity.policy` must be `disabled`.
+ :param InstanceProfileIdentity profile: (optional) The
+ [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this
+ virtual server instance.
+ If unspecified, `bx2-2x8` will be used, but this default value is expected to
+ change
+ in the future.
+ :param InstanceReservationAffinityPrototype reservation_affinity: (optional)
+ :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) will be
+ used.
+ :param int total_volume_bandwidth: (optional) The amount of bandwidth (in
+ megabits per second) allocated exclusively to instance storage volumes. An
+ increase in this value will result in a corresponding decrease to
+ `total_network_bandwidth`.
+ :param str user_data: (optional) [User
+ data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when
+ setting up the virtual server instance.
+ :param List[VolumeAttachmentPrototype] volume_attachments: (optional) The
+ additional volume attachments to create for the virtual server instance.
+ :param VPCIdentity vpc: (optional) The VPC this virtual server instance will
+ reside in.
+ If specified, it must match the VPC for the subnets of the instance network
+ attachments or instance network interfaces.
+ """
+ def __init__(
+ self,
+ *,
+ availability_policy: Optional['InstanceAvailabilityPolicyPrototype'] = None,
+ default_trusted_profile: Optional['InstanceDefaultTrustedProfilePrototype'] = None,
+ keys: Optional[List['KeyIdentity']] = None,
+ metadata_service: Optional['InstanceMetadataServicePrototype'] = None,
+ name: Optional[str] = None,
+ placement_target: Optional['InstancePlacementTargetPrototype'] = None,
+ profile: Optional['InstanceProfileIdentity'] = None,
+ reservation_affinity: Optional['InstanceReservationAffinityPrototype'] = None,
+ resource_group: Optional['ResourceGroupIdentity'] = None,
+ total_volume_bandwidth: Optional[int] = None,
+ user_data: Optional[str] = None,
+ volume_attachments: Optional[List['VolumeAttachmentPrototype']] = None,
+ vpc: Optional['VPCIdentity'] = None,
+ ) -> None:
+ """
+ Initialize a InstancePrototype object.
-class LoadBalancerCollection:
+ :param InstanceAvailabilityPolicyPrototype availability_policy: (optional)
+ The availability policy to use for this virtual server instance.
+ :param InstanceDefaultTrustedProfilePrototype default_trusted_profile:
+ (optional) The default trusted profile configuration to use for this
+ virtual server instance
+ This property's value is used when provisioning the virtual server
+ instance, but not
+ subsequently managed. Accordingly, it is reflected as an [instance
+ initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
+ property.
+ :param List[KeyIdentity] keys: (optional) The public SSH keys for the
+ administrative user of the virtual server instance. Keys will be made
+ available to the virtual server instance as cloud-init vendor data. For
+ cloud-init enabled images, these keys will also be added as SSH authorized
+ keys for the administrative user.
+ For Windows images, the keys of type `rsa` must be specified, and one will
+ be selected to encrypt [the administrator
+ password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization).
+ Keys are optional for other images, but if no keys are specified, the
+ instance will be inaccessible unless the specified image provides another
+ means of access.
+ This property's value is used when provisioning the virtual server
+ instance, but not subsequently managed. Accordingly, it is reflected as an
+ [instance
+ initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
+ property.
+ :param InstanceMetadataServicePrototype metadata_service: (optional) The
+ metadata service configuration.
+ :param str name: (optional) The name for this virtual server instance. The
+ name must not be used by another virtual server instance in the region. If
+ unspecified, the name will be a hyphenated list of randomly-selected words.
+ The system hostname will be based on this name.
+ :param InstancePlacementTargetPrototype placement_target: (optional) The
+ placement restrictions to use for the virtual server instance.
+ If specified, `reservation_affinity.policy` must be `disabled`.
+ :param InstanceProfileIdentity profile: (optional) The
+ [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for
+ this
+ virtual server instance.
+ If unspecified, `bx2-2x8` will be used, but this default value is expected
+ to change
+ in the future.
+ :param InstanceReservationAffinityPrototype reservation_affinity:
+ (optional)
+ :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) will be
+ used.
+ :param int total_volume_bandwidth: (optional) The amount of bandwidth (in
+ megabits per second) allocated exclusively to instance storage volumes. An
+ increase in this value will result in a corresponding decrease to
+ `total_network_bandwidth`.
+ :param str user_data: (optional) [User
+ data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available
+ when setting up the virtual server instance.
+ :param List[VolumeAttachmentPrototype] volume_attachments: (optional) The
+ additional volume attachments to create for the virtual server instance.
+ :param VPCIdentity vpc: (optional) The VPC this virtual server instance
+ will reside in.
+ If specified, it must match the VPC for the subnets of the instance network
+ attachments or instance network interfaces.
+ """
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['InstancePrototypeInstanceByImage', 'InstancePrototypeInstanceByCatalogOffering', 'InstancePrototypeInstanceByVolume', 'InstancePrototypeInstanceBySourceSnapshot', 'InstancePrototypeInstanceBySourceTemplate'])
+ )
+ raise Exception(msg)
+
+
+class InstanceReference:
"""
- LoadBalancerCollection.
+ InstanceReference.
- :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.
+ :param str crn: The CRN for this virtual server instance.
+ :param InstanceReferenceDeleted 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 virtual server instance.
+ :param str id: The unique identifier for this virtual server instance.
+ :param str name: The name for this virtual server instance. The name is unique
+ across all virtual server instances in the region.
"""
def __init__(
self,
- first: 'LoadBalancerCollectionFirst',
- limit: int,
- load_balancers: List['LoadBalancer'],
- total_count: int,
+ crn: str,
+ href: str,
+ id: str,
+ name: str,
*,
- next: 'LoadBalancerCollectionNext' = None,
+ deleted: Optional['InstanceReferenceDeleted'] = None,
) -> None:
"""
- Initialize a LoadBalancerCollection object.
+ Initialize a InstanceReference 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 crn: The CRN for this virtual server instance.
+ :param str href: The URL for this virtual server instance.
+ :param str id: The unique identifier for this virtual server instance.
+ :param str name: The name for this virtual server instance. The name is
+ unique across all virtual server instances in the region.
+ :param InstanceReferenceDeleted deleted: (optional) If present, this
+ property indicates the referenced resource has been deleted, and provides
+ some supplementary information.
"""
- self.first = first
- self.limit = limit
- self.load_balancers = load_balancers
- self.next = next
- self.total_count = total_count
+ self.crn = crn
+ self.deleted = deleted
+ self.href = href
+ self.id = id
+ 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) -> 'InstanceReference':
+ """Initialize a InstanceReference object from a json dictionary."""
args = {}
- if 'first' in _dict:
- args['first'] = LoadBalancerCollectionFirst.from_dict(_dict.get('first'))
+ if (crn := _dict.get('crn')) is not None:
+ args['crn'] = crn
else:
- raise ValueError('Required property \'first\' not present in LoadBalancerCollection JSON')
- if 'limit' in _dict:
- args['limit'] = _dict.get('limit')
+ raise ValueError('Required property \'crn\' not present in InstanceReference JSON')
+ if (deleted := _dict.get('deleted')) is not None:
+ args['deleted'] = InstanceReferenceDeleted.from_dict(deleted)
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'limit\' not present in LoadBalancerCollection JSON')
- if 'load_balancers' in _dict:
- args['load_balancers'] = [LoadBalancer.from_dict(v) for v in _dict.get('load_balancers')]
+ raise ValueError('Required property \'href\' not present in InstanceReference JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
else:
- raise ValueError('Required property \'load_balancers\' not present in LoadBalancerCollection JSON')
- if 'next' in _dict:
- args['next'] = LoadBalancerCollectionNext.from_dict(_dict.get('next'))
- if 'total_count' in _dict:
- args['total_count'] = _dict.get('total_count')
+ raise ValueError('Required property \'id\' not present in InstanceReference JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
else:
- raise ValueError('Required property \'total_count\' not present in LoadBalancerCollection JSON')
+ raise ValueError('Required property \'name\' not present in InstanceReference JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a LoadBalancerCollection 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, 'first') and self.first is not None:
- if isinstance(self.first, dict):
- _dict['first'] = self.first
- else:
- _dict['first'] = self.first.to_dict()
- if hasattr(self, 'limit') and self.limit is not None:
- _dict['limit'] = self.limit
- if hasattr(self, 'load_balancers') and self.load_balancers is not None:
- load_balancers_list = []
- for v in self.load_balancers:
- if isinstance(v, dict):
- load_balancers_list.append(v)
- else:
- load_balancers_list.append(v.to_dict())
- _dict['load_balancers'] = load_balancers_list
- if hasattr(self, 'next') and self.next is not None:
- if isinstance(self.next, dict):
- _dict['next'] = self.next
+ if hasattr(self, 'crn') and self.crn is not None:
+ _dict['crn'] = self.crn
+ if hasattr(self, 'deleted') and self.deleted is not None:
+ if isinstance(self.deleted, dict):
+ _dict['deleted'] = self.deleted
else:
- _dict['next'] = self.next.to_dict()
- if hasattr(self, 'total_count') and self.total_count is not None:
- _dict['total_count'] = self.total_count
+ _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):
@@ -51865,58 +54551,59 @@ 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 InstanceReference object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'LoadBalancerCollection') -> 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: 'LoadBalancerCollection') -> bool:
+ def __ne__(self, other: 'InstanceReference') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class LoadBalancerCollectionFirst:
+class InstanceReferenceDeleted:
"""
- 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.
+ :param str more_info: Link to documentation about deleted resources.
"""
def __init__(
self,
- href: str,
+ more_info: str,
) -> None:
"""
- Initialize a LoadBalancerCollectionFirst 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) -> 'LoadBalancerCollectionFirst':
- """Initialize a LoadBalancerCollectionFirst 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 := _dict.get('more_info')) is not None:
+ args['more_info'] = more_info
else:
- raise ValueError('Required property \'href\' not present in LoadBalancerCollectionFirst JSON')
+ raise ValueError('Required property \'more_info\' not present in InstanceReferenceDeleted JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a LoadBalancerCollectionFirst 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):
@@ -51924,59 +54611,82 @@ 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 InstanceReferenceDeleted object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'LoadBalancerCollectionFirst') -> 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: 'LoadBalancerCollectionFirst') -> bool:
+ def __ne__(self, other: 'InstanceReferenceDeleted') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class LoadBalancerCollectionNext:
+class InstanceReservationAffinity:
"""
- A link to the next page of resources. This property is present for all pages except
- the last page.
+ InstanceReservationAffinity.
- :attr str href: The URL for a page of resources.
+ :param str policy: The reservation affinity policy to use for this virtual
+ server instance:
+ - `disabled`: Reservations will not be used
+ - `manual`: Reservations in `pool` are available for use.
+ :param List[ReservationReference] pool: The pool of reservations available for
+ use by this virtual server instance.
"""
def __init__(
self,
- href: str,
+ policy: str,
+ pool: List['ReservationReference'],
) -> None:
"""
- Initialize a LoadBalancerCollectionNext object.
+ Initialize a InstanceReservationAffinity object.
- :param str href: The URL for a page of resources.
+ :param str policy: The reservation affinity policy to use for this virtual
+ server instance:
+ - `disabled`: Reservations will not be used
+ - `manual`: Reservations in `pool` are available for use.
+ :param List[ReservationReference] pool: The pool of reservations available
+ for use by this virtual server instance.
"""
- self.href = href
+ self.policy = policy
+ self.pool = pool
@classmethod
- def from_dict(cls, _dict: Dict) -> 'LoadBalancerCollectionNext':
- """Initialize a LoadBalancerCollectionNext object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceReservationAffinity':
+ """Initialize a InstanceReservationAffinity object from a json dictionary."""
args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ if (policy := _dict.get('policy')) is not None:
+ args['policy'] = policy
else:
- raise ValueError('Required property \'href\' not present in LoadBalancerCollectionNext JSON')
+ raise ValueError('Required property \'policy\' not present in InstanceReservationAffinity JSON')
+ if (pool := _dict.get('pool')) is not None:
+ args['pool'] = [ReservationReference.from_dict(v) for v in pool]
+ else:
+ raise ValueError('Required property \'pool\' not present in InstanceReservationAffinity JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a LoadBalancerCollectionNext object from a json dictionary."""
+ """Initialize a InstanceReservationAffinity object from 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, 'policy') and self.policy is not None:
+ _dict['policy'] = self.policy
+ if hasattr(self, 'pool') and self.pool is not None:
+ pool_list = []
+ for v in self.pool:
+ if isinstance(v, dict):
+ pool_list.append(v)
+ else:
+ pool_list.append(v.to_dict())
+ _dict['pool'] = pool_list
return _dict
def _to_dict(self):
@@ -51984,79 +54694,104 @@ 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 InstanceReservationAffinity object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'LoadBalancerCollectionNext') -> bool:
+ def __eq__(self, other: 'InstanceReservationAffinity') -> bool:
"""Return `true` when 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: 'InstanceReservationAffinity') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
+ class PolicyEnum(str, Enum):
+ """
+ The reservation affinity policy to use for this virtual server instance:
+ - `disabled`: Reservations will not be used
+ - `manual`: Reservations in `pool` are available for use.
+ """
-class LoadBalancerDNS:
+ DISABLED = 'disabled'
+ MANUAL = 'manual'
+
+
+
+class InstanceReservationAffinityPatch:
"""
- The DNS configuration for this load balancer.
- If absent, DNS `A` records for this load balancer's `hostname` property will be added
- to the public DNS zone `lb.appdomain.cloud`.
+ InstanceReservationAffinityPatch.
- :attr DNSInstanceReference instance: The DNS instance associated with this load
- balancer.
- :attr DNSZoneReference zone: The DNS zone associated with this load balancer.
+ :param str policy: (optional) The reservation affinity policy to use for this
+ virtual server instance:
+ - `disabled`: Reservations will not be used
+ - `manual`: Reservations in `pool` are available for use.
+ :param List[ReservationIdentity] pool: (optional) The pool of reservations
+ available for use by this virtual server instance, replacing the existing pool
+ of reservations.
+ Specified reservations must have a `status` of `active`, and have the same
+ `profile` and
+ `zone` as this virtual server instance.
+ If `policy` is `manual`, a pool must be specified with at least one reservation.
+ If
+ `policy` is `disabled` and a pool is specified, it must be empty.
"""
def __init__(
self,
- instance: 'DNSInstanceReference',
- zone: 'DNSZoneReference',
+ *,
+ policy: Optional[str] = None,
+ pool: Optional[List['ReservationIdentity']] = None,
) -> None:
"""
- Initialize a LoadBalancerDNS object.
+ Initialize a InstanceReservationAffinityPatch object.
- :param DNSInstanceReference instance: The DNS instance associated with this
- load balancer.
- :param DNSZoneReference zone: The DNS zone associated with this load
- balancer.
+ :param str policy: (optional) The reservation affinity policy to use for
+ this virtual server instance:
+ - `disabled`: Reservations will not be used
+ - `manual`: Reservations in `pool` are available for use.
+ :param List[ReservationIdentity] pool: (optional) The pool of reservations
+ available for use by this virtual server instance, replacing the existing
+ pool of reservations.
+ Specified reservations must have a `status` of `active`, and have the same
+ `profile` and
+ `zone` as this virtual server instance.
+ If `policy` is `manual`, a pool must be specified with at least one
+ reservation. If
+ `policy` is `disabled` and a pool is specified, it must be empty.
"""
- self.instance = instance
- self.zone = zone
+ self.policy = policy
+ self.pool = pool
@classmethod
- def from_dict(cls, _dict: Dict) -> 'LoadBalancerDNS':
- """Initialize a LoadBalancerDNS object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceReservationAffinityPatch':
+ """Initialize a InstanceReservationAffinityPatch object from a json dictionary."""
args = {}
- if 'instance' in _dict:
- args['instance'] = DNSInstanceReference.from_dict(_dict.get('instance'))
- else:
- raise ValueError('Required property \'instance\' not present in LoadBalancerDNS JSON')
- if 'zone' in _dict:
- args['zone'] = DNSZoneReference.from_dict(_dict.get('zone'))
- else:
- raise ValueError('Required property \'zone\' not present in LoadBalancerDNS JSON')
+ if (policy := _dict.get('policy')) is not None:
+ args['policy'] = policy
+ if (pool := _dict.get('pool')) is not None:
+ args['pool'] = pool
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a LoadBalancerDNS object from a json dictionary."""
+ """Initialize a InstanceReservationAffinityPatch object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'instance') and self.instance is not None:
- if isinstance(self.instance, dict):
- _dict['instance'] = self.instance
- else:
- _dict['instance'] = self.instance.to_dict()
- if hasattr(self, 'zone') and self.zone is not None:
- if isinstance(self.zone, dict):
- _dict['zone'] = self.zone
- else:
- _dict['zone'] = self.zone.to_dict()
+ if hasattr(self, 'policy') and self.policy is not None:
+ _dict['policy'] = self.policy
+ if hasattr(self, 'pool') and self.pool is not None:
+ pool_list = []
+ for v in self.pool:
+ if isinstance(v, dict):
+ pool_list.append(v)
+ else:
+ pool_list.append(v.to_dict())
+ _dict['pool'] = pool_list
return _dict
def _to_dict(self):
@@ -52064,87 +54799,106 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this LoadBalancerDNS object."""
+ """Return a `str` version of this InstanceReservationAffinityPatch object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'LoadBalancerDNS') -> bool:
+ def __eq__(self, other: 'InstanceReservationAffinityPatch') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'LoadBalancerDNS') -> bool:
+ def __ne__(self, other: 'InstanceReservationAffinityPatch') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
+ class PolicyEnum(str, Enum):
+ """
+ The reservation affinity policy to use for this virtual server instance:
+ - `disabled`: Reservations will not be used
+ - `manual`: Reservations in `pool` are available for use.
+ """
+
+ DISABLED = 'disabled'
+ MANUAL = 'manual'
+
-class LoadBalancerDNSPatch:
+
+class InstanceReservationAffinityPrototype:
"""
- The DNS configuration for this load balancer.
- Specify `null` to remove the existing DNS configuration, which will remove all DNS `A`
- records for this load balancer that had been added to `zone`, and add equivalent `A`
- records to the public DNS zone `lb.appdomain.cloud`.
+ InstanceReservationAffinityPrototype.
- :attr DNSInstanceIdentity instance: (optional) The DNS instance to associate
- with this load balancer.
- The specified instance may be in a different region or account, subject to IAM
- policies.
- :attr DNSZoneIdentity zone: (optional) The DNS zone to associate with this load
- balancer.
- The specified zone may be in a different region or account, subject to IAM
- policies.
+ :param str policy: (optional) The reservation affinity policy to use for this
+ virtual server instance:
+ - `disabled`: Reservations will not be used
+ - `manual`: Reservations in `pool` will be available for use
+ The policy will default to `manual` if `pool` is not empty, and `disabled`
+ otherwise.
+ :param List[ReservationIdentity] pool: (optional) The pool of reservations
+ available for use by this virtual server instance.
+ Specified reservations must have a `status` of `active`, and have the same
+ `profile` and
+ `zone` as this virtual server instance.
+ If `policy` is `manual`, a pool must be specified with at least one reservation.
+ If
+ `policy` is `disabled` and a pool is specified, it must be empty.
"""
def __init__(
self,
*,
- instance: 'DNSInstanceIdentity' = None,
- zone: 'DNSZoneIdentity' = None,
+ policy: Optional[str] = None,
+ pool: Optional[List['ReservationIdentity']] = None,
) -> None:
"""
- Initialize a LoadBalancerDNSPatch object.
+ Initialize a InstanceReservationAffinityPrototype object.
- :param DNSInstanceIdentity instance: (optional) The DNS instance to
- associate with this load balancer.
- The specified instance may be in a different region or account, subject to
- IAM
- policies.
- :param DNSZoneIdentity zone: (optional) The DNS zone to associate with this
- load balancer.
- The specified zone may be in a different region or account, subject to IAM
- policies.
+ :param str policy: (optional) The reservation affinity policy to use for
+ this virtual server instance:
+ - `disabled`: Reservations will not be used
+ - `manual`: Reservations in `pool` will be available for use
+ The policy will default to `manual` if `pool` is not empty, and `disabled`
+ otherwise.
+ :param List[ReservationIdentity] pool: (optional) The pool of reservations
+ available for use by this virtual server instance.
+ Specified reservations must have a `status` of `active`, and have the same
+ `profile` and
+ `zone` as this virtual server instance.
+ If `policy` is `manual`, a pool must be specified with at least one
+ reservation. If
+ `policy` is `disabled` and a pool is specified, it must be empty.
"""
- self.instance = instance
- self.zone = zone
+ self.policy = policy
+ self.pool = pool
@classmethod
- def from_dict(cls, _dict: Dict) -> 'LoadBalancerDNSPatch':
- """Initialize a LoadBalancerDNSPatch object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceReservationAffinityPrototype':
+ """Initialize a InstanceReservationAffinityPrototype object from a json dictionary."""
args = {}
- if 'instance' in _dict:
- args['instance'] = _dict.get('instance')
- if 'zone' in _dict:
- args['zone'] = _dict.get('zone')
+ if (policy := _dict.get('policy')) is not None:
+ args['policy'] = policy
+ if (pool := _dict.get('pool')) is not None:
+ args['pool'] = pool
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a LoadBalancerDNSPatch object from a json dictionary."""
+ """Initialize a InstanceReservationAffinityPrototype object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'instance') and self.instance is not None:
- if isinstance(self.instance, dict):
- _dict['instance'] = self.instance
- else:
- _dict['instance'] = self.instance.to_dict()
- if hasattr(self, 'zone') and self.zone is not None:
- if isinstance(self.zone, dict):
- _dict['zone'] = self.zone
- else:
- _dict['zone'] = self.zone.to_dict()
+ if hasattr(self, 'policy') and self.policy is not None:
+ _dict['policy'] = self.policy
+ if hasattr(self, 'pool') and self.pool is not None:
+ pool_list = []
+ for v in self.pool:
+ if isinstance(v, dict):
+ pool_list.append(v)
+ else:
+ pool_list.append(v.to_dict())
+ _dict['pool'] = pool_list
return _dict
def _to_dict(self):
@@ -52152,89 +54906,92 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this LoadBalancerDNSPatch object."""
+ """Return a `str` version of this InstanceReservationAffinityPrototype object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'LoadBalancerDNSPatch') -> bool:
+ def __eq__(self, other: 'InstanceReservationAffinityPrototype') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'LoadBalancerDNSPatch') -> bool:
+ def __ne__(self, other: 'InstanceReservationAffinityPrototype') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
+ class PolicyEnum(str, Enum):
+ """
+ The reservation affinity policy to use for this virtual server instance:
+ - `disabled`: Reservations will not be used
+ - `manual`: Reservations in `pool` will be available for use
+ The policy will default to `manual` if `pool` is not empty, and `disabled`
+ otherwise.
+ """
+
+ DISABLED = 'disabled'
+ MANUAL = 'manual'
+
-class LoadBalancerDNSPrototype:
+
+class InstanceStatusReason:
"""
- The DNS configuration for this load balancer.
- If unspecified, DNS `A` records for this load balancer's `hostname` property will be
- added to the public DNS zone `lb.appdomain.cloud`. Otherwise, those DNS `A` records
- will be added to the specified `zone`.
+ InstanceStatusReason.
- :attr DNSInstanceIdentity instance: The DNS instance to associate with this load
- balancer.
- The specified instance may be in a different region or account, subject to IAM
- policies.
- :attr DNSZoneIdentity zone: The DNS zone to associate with this load balancer.
- The specified zone may be in a different region or account, subject to IAM
- policies.
+ :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.
"""
def __init__(
self,
- instance: 'DNSInstanceIdentity',
- zone: 'DNSZoneIdentity',
+ code: str,
+ message: str,
+ *,
+ more_info: Optional[str] = None,
) -> None:
"""
- Initialize a LoadBalancerDNSPrototype object.
+ Initialize a InstanceStatusReason object.
- :param DNSInstanceIdentity instance: The DNS instance to associate with
- this load balancer.
- The specified instance may be in a different region or account, subject to
- IAM
- policies.
- :param DNSZoneIdentity zone: The DNS zone to associate with this load
- balancer.
- The specified zone may be in a different region or account, subject to IAM
- policies.
+ :param str 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.instance = instance
- self.zone = zone
+ self.code = code
+ self.message = message
+ self.more_info = more_info
@classmethod
- def from_dict(cls, _dict: Dict) -> 'LoadBalancerDNSPrototype':
- """Initialize a LoadBalancerDNSPrototype object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceStatusReason':
+ """Initialize a InstanceStatusReason object from a json dictionary."""
args = {}
- if 'instance' in _dict:
- args['instance'] = _dict.get('instance')
+ if (code := _dict.get('code')) is not None:
+ args['code'] = code
else:
- raise ValueError('Required property \'instance\' not present in LoadBalancerDNSPrototype JSON')
- if 'zone' in _dict:
- args['zone'] = _dict.get('zone')
+ raise ValueError('Required property \'code\' not present in InstanceStatusReason JSON')
+ if (message := _dict.get('message')) is not None:
+ args['message'] = message
else:
- raise ValueError('Required property \'zone\' not present in LoadBalancerDNSPrototype JSON')
+ raise ValueError('Required property \'message\' not present in InstanceStatusReason JSON')
+ if (more_info := _dict.get('more_info')) is not None:
+ args['more_info'] = more_info
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a LoadBalancerDNSPrototype 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, 'instance') and self.instance is not None:
- if isinstance(self.instance, dict):
- _dict['instance'] = self.instance
- else:
- _dict['instance'] = self.instance.to_dict()
- if hasattr(self, 'zone') and self.zone is not None:
- if isinstance(self.zone, dict):
- _dict['zone'] = self.zone
- else:
- _dict['zone'] = self.zone.to_dict()
+ if hasattr(self, '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):
@@ -52242,285 +54999,293 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this LoadBalancerDNSPrototype object."""
+ """Return a `str` version of this InstanceStatusReason object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'LoadBalancerDNSPrototype') -> 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: 'LoadBalancerDNSPrototype') -> bool:
+ def __ne__(self, other: 'InstanceStatusReason') -> 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:
+ class CodeEnum(str, Enum):
"""
- Initialize a LoadBalancerIdentity object.
+ 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_RESERVATION_CAPACITY = 'cannot_start_reservation_capacity'
+ CANNOT_START_RESERVATION_EXPIRED = 'cannot_start_reservation_expired'
+ CANNOT_START_STORAGE = 'cannot_start_storage'
+ ENCRYPTION_KEY_DELETED = 'encryption_key_deleted'
+ STOPPED_BY_HOST_FAILURE = 'stopped_by_host_failure'
+ STOPPED_FOR_IMAGE_CREATION = 'stopped_for_image_creation'
+
+
+
+class InstanceTemplate:
+ """
+ InstanceTemplate.
+
+ :param InstanceAvailabilityPolicyPrototype availability_policy: (optional) The
+ availability policy to use for this virtual server instance.
+ :param datetime created_at: The date and time that the instance template was
+ created.
+ :param str crn: The CRN for this instance template.
+ :param InstanceDefaultTrustedProfilePrototype default_trusted_profile:
+ (optional) The default trusted profile configuration to use for this virtual
+ server instance
+ This property's value is used when provisioning the virtual server instance, but
+ not
+ subsequently managed. Accordingly, it is reflected as an [instance
+ initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
+ property.
+ :param str href: The URL for this instance template.
+ :param str id: The unique identifier 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, the keys of type `rsa` must be specified, and one will be
+ selected to encrypt [the administrator
+ password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys
+ are optional for other images, but if no keys are specified, the instance will
+ be inaccessible unless the specified image provides another means of access.
+ This property's value is used when provisioning the virtual server instance, but
+ not subsequently managed. Accordingly, it is reflected as an [instance
+ initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
+ property.
+ :param InstanceMetadataServicePrototype metadata_service: (optional) The
+ metadata service configuration.
+ :param str name: The name for this instance template. The name is unique across
+ all instance templates in the region.
+ :param InstancePlacementTargetPrototype placement_target: (optional) The
+ placement restrictions to use for the virtual server instance.
+ If specified, `reservation_affinity.policy` must be `disabled`.
+ :param InstanceProfileIdentity profile: (optional) The
+ [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this
+ virtual server instance.
+ If unspecified, `bx2-2x8` will be used, but this default value is expected to
+ change
+ in the future.
+ :param InstanceReservationAffinityPrototype reservation_affinity: (optional)
+ :param ResourceGroupReference resource_group: The resource group for this
+ instance template.
+ :param int total_volume_bandwidth: (optional) The amount of bandwidth (in
+ megabits per second) allocated exclusively to instance storage volumes. An
+ increase in this value will result in a corresponding decrease to
+ `total_network_bandwidth`.
+ :param str user_data: (optional) [User
+ data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when
+ setting up the virtual server instance.
+ :param List[VolumeAttachmentPrototype] volume_attachments: (optional) The
+ additional volume attachments to create for the virtual server instance.
+ :param VPCIdentity vpc: (optional) The VPC this virtual server instance will
+ reside in.
+ If specified, it must match the VPC for the subnets of the instance network
+ attachments or instance network interfaces.
+ """
+
+ def __init__(
+ self,
+ created_at: datetime,
+ crn: str,
+ href: str,
+ id: str,
+ name: str,
+ resource_group: 'ResourceGroupReference',
+ *,
+ availability_policy: Optional['InstanceAvailabilityPolicyPrototype'] = None,
+ default_trusted_profile: Optional['InstanceDefaultTrustedProfilePrototype'] = None,
+ keys: Optional[List['KeyIdentity']] = None,
+ metadata_service: Optional['InstanceMetadataServicePrototype'] = None,
+ placement_target: Optional['InstancePlacementTargetPrototype'] = None,
+ profile: Optional['InstanceProfileIdentity'] = None,
+ reservation_affinity: Optional['InstanceReservationAffinityPrototype'] = None,
+ total_volume_bandwidth: Optional[int] = None,
+ user_data: Optional[str] = None,
+ volume_attachments: Optional[List['VolumeAttachmentPrototype']] = None,
+ vpc: Optional['VPCIdentity'] = None,
+ ) -> None:
+ """
+ Initialize a InstanceTemplate object.
+ :param datetime created_at: The date and time that the instance template
+ was created.
+ :param str crn: The CRN for this instance template.
+ :param str href: The URL for this instance template.
+ :param str id: The unique identifier for this instance template.
+ :param str name: The name for this instance template. The name is unique
+ across all instance templates in the region.
+ :param ResourceGroupReference resource_group: The resource group for this
+ instance template.
+ :param InstanceAvailabilityPolicyPrototype availability_policy: (optional)
+ The availability policy to use for this virtual server instance.
+ :param InstanceDefaultTrustedProfilePrototype default_trusted_profile:
+ (optional) The default trusted profile configuration to use for this
+ virtual server instance
+ This property's value is used when provisioning the virtual server
+ instance, but not
+ subsequently managed. Accordingly, it is reflected as an [instance
+ initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
+ property.
+ :param List[KeyIdentity] keys: (optional) The public SSH keys for the
+ administrative user of the virtual server instance. Keys will be made
+ available to the virtual server instance as cloud-init vendor data. For
+ cloud-init enabled images, these keys will also be added as SSH authorized
+ keys for the administrative user.
+ For Windows images, the keys of type `rsa` must be specified, and one will
+ be selected to encrypt [the administrator
+ password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization).
+ Keys are optional for other images, but if no keys are specified, the
+ instance will be inaccessible unless the specified image provides another
+ means of access.
+ This property's value is used when provisioning the virtual server
+ instance, but not subsequently managed. Accordingly, it is reflected as an
+ [instance
+ initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
+ property.
+ :param InstanceMetadataServicePrototype metadata_service: (optional) The
+ metadata service configuration.
+ :param InstancePlacementTargetPrototype placement_target: (optional) The
+ placement restrictions to use for the virtual server instance.
+ If specified, `reservation_affinity.policy` must be `disabled`.
+ :param InstanceProfileIdentity profile: (optional) The
+ [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for
+ this
+ virtual server instance.
+ If unspecified, `bx2-2x8` will be used, but this default value is expected
+ to change
+ in the future.
+ :param InstanceReservationAffinityPrototype reservation_affinity:
+ (optional)
+ :param int total_volume_bandwidth: (optional) The amount of bandwidth (in
+ megabits per second) allocated exclusively to instance storage volumes. An
+ increase in this value will result in a corresponding decrease to
+ `total_network_bandwidth`.
+ :param str user_data: (optional) [User
+ data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available
+ when setting up the virtual server instance.
+ :param List[VolumeAttachmentPrototype] volume_attachments: (optional) The
+ additional volume attachments to create for the virtual server instance.
+ :param VPCIdentity vpc: (optional) The VPC this virtual server instance
+ will reside in.
+ If specified, it must match the VPC for the subnets of the instance network
+ attachments or instance network interfaces.
"""
msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['LoadBalancerIdentityById', 'LoadBalancerIdentityByCRN', 'LoadBalancerIdentityByHref'])
+ ", ".join(['InstanceTemplateInstanceByImageInstanceTemplateContext', 'InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext', 'InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext'])
)
raise Exception(msg)
-class LoadBalancerListener:
+class InstanceTemplateCollection:
"""
- LoadBalancerListener.
+ InstanceTemplateCollection.
- :attr bool accept_proxy_protocol: If set to `true`, this listener will accept
- and forward PROXY protocol information. Supported by load balancers in the
- `application` family (otherwise always `false`). Additional restrictions:
- - If this listener has `https_redirect` specified, its `accept_proxy_protocol`
- value must
- match the `accept_proxy_protocol` value of the `https_redirect` listener.
- - If this listener is the target of another listener's `https_redirect`, its
- `accept_proxy_protocol` value must match that listener's
- `accept_proxy_protocol` value.
- :attr CertificateInstanceReference certificate_instance: (optional) The
- certificate instance used for SSL termination.
- If absent, this listener is not using a certificate instance.
- :attr int connection_limit: (optional) The connection limit of the listener.
- :attr datetime created_at: The date and time that this listener was created.
- :attr LoadBalancerPoolReference default_pool: (optional) The default pool for
- this listener. If absent, this listener has no default pool.
- :attr str href: The listener's canonical URL.
- :attr LoadBalancerListenerHTTPSRedirect https_redirect: (optional) If present,
- the target listener that requests are redirected to.
- :attr str id: The unique identifier for this load balancer listener.
- :attr int idle_connection_timeout: (optional) The idle connection timeout of the
- listener in seconds. This property will be present for load balancers in the
- `application` family.
- :attr List[LoadBalancerListenerPolicyReference] policies: (optional) The
- policies for this listener.
- :attr int port: The listener port number, or the inclusive lower bound of the
- port range.
- :attr int port_max: The inclusive upper bound of the range of ports used by this
- listener.
- At present, only load balancers in the `network` family support more than one
- port per listener.
- :attr int port_min: The inclusive lower bound of the range of ports used by this
- listener.
- At present, only load balancers in the `network` family support more than one
- port per listener.
- :attr str protocol: The listener protocol.
- The enumerated values for this property are expected to expand in the future.
- When processing this property, check for and log unknown values. Optionally halt
- processing and surface the error, or bypass the listener on which the unexpected
- property value was encountered.
- :attr str provisioning_status: The provisioning status of this listener
- The enumerated values for this property are expected to expand in the future.
- When processing this property, check for and log unknown values. Optionally halt
- processing and surface the error, or bypass the listener on which the unexpected
- property value was encountered.
+ :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 InstanceTemplateCollectionNext next: (optional) A link to the next page
+ of resources. This property is present for all pages
+ except the last page.
+ :param List[InstanceTemplate] templates: Collection of instance templates.
+ :param int total_count: The total number of resources across all pages.
"""
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,
+ first: 'InstanceTemplateCollectionFirst',
+ limit: int,
+ templates: List['InstanceTemplate'],
+ total_count: int,
*,
- certificate_instance: 'CertificateInstanceReference' = None,
- connection_limit: int = None,
- default_pool: 'LoadBalancerPoolReference' = None,
- https_redirect: 'LoadBalancerListenerHTTPSRedirect' = None,
- idle_connection_timeout: int = None,
- policies: List['LoadBalancerListenerPolicyReference'] = None,
+ next: Optional['InstanceTemplateCollectionNext'] = None,
) -> None:
"""
- Initialize a LoadBalancerListener object.
+ Initialize a InstanceTemplateCollection object.
- :param bool accept_proxy_protocol: If set to `true`, this listener will
- accept and forward PROXY protocol information. Supported by load balancers
- in the `application` family (otherwise always `false`). Additional
- restrictions:
- - If this listener has `https_redirect` specified, its
- `accept_proxy_protocol` value must
- match the `accept_proxy_protocol` value of the `https_redirect` listener.
- - If this listener is the target of another listener's `https_redirect`,
- its
- `accept_proxy_protocol` value must match that listener's
- `accept_proxy_protocol` value.
- :param datetime created_at: The date and time that this listener was
- created.
- :param str href: The listener's canonical URL.
- :param str id: The unique identifier for this load balancer listener.
- :param int port: The listener port number, or the inclusive lower bound of
- the port range.
- :param int port_max: The inclusive upper bound of the range of ports used
- by this listener.
- At present, only load balancers in the `network` family support more than
- one port per listener.
- :param int port_min: The inclusive lower bound of the range of ports used
- by this listener.
- At present, only load balancers in the `network` family support more than
- one port per listener.
- :param str protocol: The listener protocol.
- The enumerated values for this property are expected to expand in the
- future. When processing this property, check for and log unknown values.
- Optionally halt processing and surface the error, or bypass the listener on
- which the unexpected property value was encountered.
- :param str provisioning_status: The provisioning status of this listener
- The enumerated values for this property are expected to expand in the
- future. When processing this property, check for and log unknown values.
- Optionally halt processing and surface the error, or bypass the listener on
- which the unexpected property value was encountered.
- :param CertificateInstanceReference certificate_instance: (optional) The
- certificate instance used for SSL termination.
- If absent, this listener is not using a certificate instance.
- :param int connection_limit: (optional) The connection limit of the
- listener.
- :param LoadBalancerPoolReference default_pool: (optional) The default pool
- for this listener. If absent, this listener has no default pool.
- :param LoadBalancerListenerHTTPSRedirect https_redirect: (optional) If
- present, the target listener that requests are redirected to.
- :param int idle_connection_timeout: (optional) The idle connection timeout
- of the listener in seconds. This property will be present for load
- balancers in the `application` family.
- :param List[LoadBalancerListenerPolicyReference] policies: (optional) The
- policies for this listener.
+ :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.
"""
- self.accept_proxy_protocol = accept_proxy_protocol
- self.certificate_instance = certificate_instance
- self.connection_limit = connection_limit
- self.created_at = created_at
- self.default_pool = default_pool
- self.href = href
- self.https_redirect = https_redirect
- self.id = id
- self.idle_connection_timeout = idle_connection_timeout
- self.policies = policies
- self.port = port
- self.port_max = port_max
- self.port_min = port_min
- self.protocol = protocol
- self.provisioning_status = provisioning_status
+ self.first = first
+ self.limit = limit
+ self.next = next
+ self.templates = templates
+ self.total_count = total_count
@classmethod
- def from_dict(cls, _dict: Dict) -> 'LoadBalancerListener':
- """Initialize a LoadBalancerListener object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceTemplateCollection':
+ """Initialize a InstanceTemplateCollection object from a json dictionary."""
args = {}
- if 'accept_proxy_protocol' in _dict:
- args['accept_proxy_protocol'] = _dict.get('accept_proxy_protocol')
- else:
- raise ValueError('Required property \'accept_proxy_protocol\' not present in LoadBalancerListener JSON')
- if 'certificate_instance' in _dict:
- args['certificate_instance'] = CertificateInstanceReference.from_dict(_dict.get('certificate_instance'))
- if 'connection_limit' in _dict:
- args['connection_limit'] = _dict.get('connection_limit')
- if 'created_at' in _dict:
- args['created_at'] = string_to_datetime(_dict.get('created_at'))
- else:
- raise ValueError('Required property \'created_at\' not present in LoadBalancerListener JSON')
- if 'default_pool' in _dict:
- args['default_pool'] = LoadBalancerPoolReference.from_dict(_dict.get('default_pool'))
- if 'href' in _dict:
- args['href'] = _dict.get('href')
- else:
- raise ValueError('Required property \'href\' not present in LoadBalancerListener JSON')
- if 'https_redirect' in _dict:
- args['https_redirect'] = LoadBalancerListenerHTTPSRedirect.from_dict(_dict.get('https_redirect'))
- if 'id' in _dict:
- args['id'] = _dict.get('id')
- else:
- raise ValueError('Required property \'id\' not present in LoadBalancerListener JSON')
- if 'idle_connection_timeout' in _dict:
- args['idle_connection_timeout'] = _dict.get('idle_connection_timeout')
- if 'policies' in _dict:
- args['policies'] = [LoadBalancerListenerPolicyReference.from_dict(v) for v in _dict.get('policies')]
- if 'port' in _dict:
- args['port'] = _dict.get('port')
- else:
- raise ValueError('Required property \'port\' not present in LoadBalancerListener JSON')
- if 'port_max' in _dict:
- args['port_max'] = _dict.get('port_max')
+ if (first := _dict.get('first')) is not None:
+ args['first'] = InstanceTemplateCollectionFirst.from_dict(first)
else:
- raise ValueError('Required property \'port_max\' not present in LoadBalancerListener JSON')
- if 'port_min' in _dict:
- args['port_min'] = _dict.get('port_min')
+ raise ValueError('Required property \'first\' not present in InstanceTemplateCollection JSON')
+ if (limit := _dict.get('limit')) is not None:
+ args['limit'] = limit
else:
- raise ValueError('Required property \'port_min\' not present in LoadBalancerListener JSON')
- if 'protocol' in _dict:
- args['protocol'] = _dict.get('protocol')
+ raise ValueError('Required property \'limit\' not present in InstanceTemplateCollection JSON')
+ if (next := _dict.get('next')) is not None:
+ args['next'] = InstanceTemplateCollectionNext.from_dict(next)
+ if (templates := _dict.get('templates')) is not None:
+ args['templates'] = templates
else:
- raise ValueError('Required property \'protocol\' not present in LoadBalancerListener JSON')
- if 'provisioning_status' in _dict:
- args['provisioning_status'] = _dict.get('provisioning_status')
+ raise ValueError('Required property \'templates\' not present in InstanceTemplateCollection JSON')
+ if (total_count := _dict.get('total_count')) is not None:
+ args['total_count'] = total_count
else:
- raise ValueError('Required property \'provisioning_status\' not present in LoadBalancerListener JSON')
+ raise ValueError('Required property \'total_count\' not present in InstanceTemplateCollection JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a LoadBalancerListener object from a json dictionary."""
+ """Initialize a InstanceTemplateCollection object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'accept_proxy_protocol') and self.accept_proxy_protocol is not None:
- _dict['accept_proxy_protocol'] = self.accept_proxy_protocol
- if hasattr(self, 'certificate_instance') and self.certificate_instance is not None:
- if isinstance(self.certificate_instance, dict):
- _dict['certificate_instance'] = self.certificate_instance
- else:
- _dict['certificate_instance'] = self.certificate_instance.to_dict()
- if hasattr(self, 'connection_limit') and self.connection_limit is not None:
- _dict['connection_limit'] = self.connection_limit
- if hasattr(self, 'created_at') and self.created_at is not None:
- _dict['created_at'] = datetime_to_string(self.created_at)
- if hasattr(self, 'default_pool') and self.default_pool is not None:
- if isinstance(self.default_pool, dict):
- _dict['default_pool'] = self.default_pool
+ if hasattr(self, 'first') and self.first is not None:
+ if isinstance(self.first, dict):
+ _dict['first'] = self.first
else:
- _dict['default_pool'] = self.default_pool.to_dict()
- if hasattr(self, 'href') and self.href is not None:
- _dict['href'] = self.href
- if hasattr(self, 'https_redirect') and self.https_redirect is not None:
- if isinstance(self.https_redirect, dict):
- _dict['https_redirect'] = self.https_redirect
+ _dict['first'] = self.first.to_dict()
+ if hasattr(self, 'limit') and self.limit is not None:
+ _dict['limit'] = self.limit
+ if hasattr(self, 'next') and self.next is not None:
+ if isinstance(self.next, dict):
+ _dict['next'] = self.next
else:
- _dict['https_redirect'] = self.https_redirect.to_dict()
- if hasattr(self, 'id') and self.id is not None:
- _dict['id'] = self.id
- if hasattr(self, 'idle_connection_timeout') and self.idle_connection_timeout is not None:
- _dict['idle_connection_timeout'] = self.idle_connection_timeout
- if hasattr(self, 'policies') and self.policies is not None:
- policies_list = []
- for v in self.policies:
+ _dict['next'] = self.next.to_dict()
+ if hasattr(self, 'templates') and self.templates is not None:
+ templates_list = []
+ for v in self.templates:
if isinstance(v, dict):
- policies_list.append(v)
+ templates_list.append(v)
else:
- policies_list.append(v.to_dict())
- _dict['policies'] = policies_list
- if hasattr(self, 'port') and self.port is not None:
- _dict['port'] = self.port
- if hasattr(self, 'port_max') and self.port_max is not None:
- _dict['port_max'] = self.port_max
- if hasattr(self, 'port_min') and self.port_min is not None:
- _dict['port_min'] = self.port_min
- if hasattr(self, 'protocol') and self.protocol is not None:
- _dict['protocol'] = self.protocol
- if hasattr(self, 'provisioning_status') and self.provisioning_status is not None:
- _dict['provisioning_status'] = self.provisioning_status
+ templates_list.append(v.to_dict())
+ _dict['templates'] = templates_list
+ if hasattr(self, 'total_count') and self.total_count is not None:
+ _dict['total_count'] = self.total_count
return _dict
def _to_dict(self):
@@ -52528,95 +55293,58 @@ 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 InstanceTemplateCollection object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'LoadBalancerListener') -> 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: 'LoadBalancerListener') -> bool:
+ def __ne__(self, other: 'InstanceTemplateCollection') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class ProtocolEnum(str, Enum):
- """
- The listener protocol.
- The enumerated values for this property are expected to expand in the future. When
- processing this property, check for and log unknown values. Optionally halt
- processing and surface the error, or bypass the listener on which the unexpected
- property value was encountered.
- """
-
- HTTP = 'http'
- HTTPS = 'https'
- TCP = 'tcp'
- UDP = 'udp'
-
-
- class ProvisioningStatusEnum(str, Enum):
- """
- The provisioning status of this listener
- The enumerated values for this property are expected to expand in the future. When
- processing this property, check for and log unknown values. Optionally halt
- processing and surface the error, or bypass the listener on which the unexpected
- property value was encountered.
- """
-
- ACTIVE = 'active'
- CREATE_PENDING = 'create_pending'
- DELETE_PENDING = 'delete_pending'
- FAILED = 'failed'
- UPDATE_PENDING = 'update_pending'
-
-
-class LoadBalancerListenerCollection:
+class InstanceTemplateCollectionFirst:
"""
- LoadBalancerListenerCollection.
+ A link to the first page of resources.
- :attr List[LoadBalancerListener] listeners: Collection of listeners.
+ :param str href: The URL for a page of resources.
"""
def __init__(
self,
- listeners: List['LoadBalancerListener'],
+ href: str,
) -> None:
"""
- Initialize a LoadBalancerListenerCollection object.
+ Initialize a InstanceTemplateCollectionFirst object.
- :param List[LoadBalancerListener] listeners: Collection of listeners.
+ :param str href: The URL for a page of resources.
"""
- self.listeners = listeners
+ self.href = href
@classmethod
- def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerCollection':
- """Initialize a LoadBalancerListenerCollection object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceTemplateCollectionFirst':
+ """Initialize a InstanceTemplateCollectionFirst object from a json dictionary."""
args = {}
- if 'listeners' in _dict:
- args['listeners'] = [LoadBalancerListener.from_dict(v) for v in _dict.get('listeners')]
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'listeners\' not present in LoadBalancerListenerCollection JSON')
+ raise ValueError('Required property \'href\' not present in InstanceTemplateCollectionFirst JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a LoadBalancerListenerCollection object from a json dictionary."""
+ """Initialize a InstanceTemplateCollectionFirst object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'listeners') and self.listeners is not None:
- listeners_list = []
- for v in self.listeners:
- if isinstance(v, dict):
- listeners_list.append(v)
- else:
- listeners_list.append(v.to_dict())
- _dict['listeners'] = listeners_list
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
return _dict
def _to_dict(self):
@@ -52624,80 +55352,59 @@ 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 InstanceTemplateCollectionFirst object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'LoadBalancerListenerCollection') -> 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: 'LoadBalancerListenerCollection') -> bool:
+ def __ne__(self, other: 'InstanceTemplateCollectionFirst') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class LoadBalancerListenerHTTPSRedirect:
+class InstanceTemplateCollectionNext:
"""
- LoadBalancerListenerHTTPSRedirect.
+ A link to the next page of resources. This property is present for all pages except
+ the last page.
- :attr int http_status_code: The HTTP status code for this redirect.
- :attr LoadBalancerListenerReference listener:
- :attr str uri: (optional) The redirect relative target URI.
+ :param str href: The URL for a page of resources.
"""
def __init__(
self,
- http_status_code: int,
- listener: 'LoadBalancerListenerReference',
- *,
- uri: str = None,
+ href: str,
) -> None:
"""
- Initialize a LoadBalancerListenerHTTPSRedirect object.
+ Initialize a InstanceTemplateCollectionNext 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 URL for a page of resources.
"""
- self.http_status_code = http_status_code
- self.listener = listener
- self.uri = uri
+ self.href = href
@classmethod
- def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerHTTPSRedirect':
- """Initialize a LoadBalancerListenerHTTPSRedirect object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceTemplateCollectionNext':
+ """Initialize a InstanceTemplateCollectionNext 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 LoadBalancerListenerHTTPSRedirect JSON')
- if 'listener' in _dict:
- args['listener'] = LoadBalancerListenerReference.from_dict(_dict.get('listener'))
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'listener\' not present in LoadBalancerListenerHTTPSRedirect JSON')
- if 'uri' in _dict:
- args['uri'] = _dict.get('uri')
+ raise ValueError('Required property \'href\' not present in InstanceTemplateCollectionNext JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a LoadBalancerListenerHTTPSRedirect object from a json dictionary."""
+ """Initialize a InstanceTemplateCollectionNext object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, '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, 'href') and self.href is not None:
+ _dict['href'] = self.href
return _dict
def _to_dict(self):
@@ -52705,79 +55412,78 @@ 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 InstanceTemplateCollectionNext object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'LoadBalancerListenerHTTPSRedirect') -> 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: 'LoadBalancerListenerHTTPSRedirect') -> bool:
+ def __ne__(self, other: 'InstanceTemplateCollectionNext') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class LoadBalancerListenerHTTPSRedirectPatch:
+class InstanceTemplateIdentity:
"""
- LoadBalancerListenerHTTPSRedirectPatch.
+ Identifies an instance template by a unique property.
- :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,
+ ) -> 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:
+ """
+ InstanceTemplatePatch.
+
+ :param str name: (optional) The name for this instance template. The name must
+ not be used by another instance template in the region.
"""
def __init__(
self,
*,
- http_status_code: int = None,
- listener: 'LoadBalancerListenerIdentity' = None,
- uri: str = None,
+ name: Optional[str] = None,
) -> None:
"""
- Initialize a LoadBalancerListenerHTTPSRedirectPatch object.
+ Initialize a InstanceTemplatePatch 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 name: (optional) The name for this instance template. The name
+ must not be used by another instance template in the region.
"""
- self.http_status_code = http_status_code
- self.listener = listener
- self.uri = uri
+ self.name = name
@classmethod
- def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerHTTPSRedirectPatch':
- """Initialize a LoadBalancerListenerHTTPSRedirectPatch object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceTemplatePatch':
+ """Initialize a InstanceTemplatePatch 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 (name := _dict.get('name')) is not None:
+ args['name'] = name
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a LoadBalancerListenerHTTPSRedirectPatch 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, '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, 'name') and self.name is not None:
+ _dict['name'] = self.name
return _dict
def _to_dict(self):
@@ -52785,82 +55491,256 @@ 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 InstanceTemplatePatch object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'LoadBalancerListenerHTTPSRedirectPatch') -> 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: 'LoadBalancerListenerHTTPSRedirectPatch') -> bool:
+ def __ne__(self, other: 'InstanceTemplatePatch') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class LoadBalancerListenerHTTPSRedirectPrototype:
+class InstanceTemplatePrototype:
"""
- LoadBalancerListenerHTTPSRedirectPrototype.
+ InstanceTemplatePrototype.
- :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.
+ :param InstanceAvailabilityPolicyPrototype availability_policy: (optional) The
+ availability policy to use for this virtual server instance.
+ :param InstanceDefaultTrustedProfilePrototype default_trusted_profile:
+ (optional) The default trusted profile configuration to use for this virtual
+ server instance
+ This property's value is used when provisioning the virtual server instance, but
+ not
+ subsequently managed. Accordingly, it is reflected as an [instance
+ initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
+ property.
+ :param List[KeyIdentity] keys: (optional) The public SSH keys for the
+ administrative user of the virtual server instance. Keys will be made available
+ to the virtual server instance as cloud-init vendor data. For cloud-init enabled
+ images, these keys will also be added as SSH authorized keys for the
+ administrative user.
+ For Windows images, the keys of type `rsa` must be specified, and one will be
+ selected to encrypt [the administrator
+ password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys
+ are optional for other images, but if no keys are specified, the instance will
+ be inaccessible unless the specified image provides another means of access.
+ This property's value is used when provisioning the virtual server instance, but
+ not subsequently managed. Accordingly, it is reflected as an [instance
+ initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
+ property.
+ :param InstanceMetadataServicePrototype metadata_service: (optional) The
+ metadata service configuration.
+ :param str name: (optional) The name for this instance template. The name must
+ not be used by another instance template in the region. If unspecified, the name
+ will be a hyphenated list of randomly-selected words.
+ :param InstancePlacementTargetPrototype placement_target: (optional) The
+ placement restrictions to use for the virtual server instance.
+ If specified, `reservation_affinity.policy` must be `disabled`.
+ :param InstanceProfileIdentity profile: (optional) The
+ [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this
+ virtual server instance.
+ If unspecified, `bx2-2x8` will be used, but this default value is expected to
+ change
+ in the future.
+ :param InstanceReservationAffinityPrototype reservation_affinity: (optional)
+ :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) will be
+ used.
+ :param int total_volume_bandwidth: (optional) The amount of bandwidth (in
+ megabits per second) allocated exclusively to instance storage volumes. An
+ increase in this value will result in a corresponding decrease to
+ `total_network_bandwidth`.
+ :param str user_data: (optional) [User
+ data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when
+ setting up the virtual server instance.
+ :param List[VolumeAttachmentPrototype] volume_attachments: (optional) The
+ additional volume attachments to create for the virtual server instance.
+ :param VPCIdentity vpc: (optional) The VPC this virtual server instance will
+ reside in.
+ If specified, it must match the VPC for the subnets of the instance network
+ attachments or instance network interfaces.
"""
def __init__(
self,
- http_status_code: int,
- listener: 'LoadBalancerListenerIdentity',
*,
- uri: str = None,
+ availability_policy: Optional['InstanceAvailabilityPolicyPrototype'] = None,
+ default_trusted_profile: Optional['InstanceDefaultTrustedProfilePrototype'] = None,
+ keys: Optional[List['KeyIdentity']] = None,
+ metadata_service: Optional['InstanceMetadataServicePrototype'] = None,
+ name: Optional[str] = None,
+ placement_target: Optional['InstancePlacementTargetPrototype'] = None,
+ profile: Optional['InstanceProfileIdentity'] = None,
+ reservation_affinity: Optional['InstanceReservationAffinityPrototype'] = None,
+ resource_group: Optional['ResourceGroupIdentity'] = None,
+ total_volume_bandwidth: Optional[int] = None,
+ user_data: Optional[str] = None,
+ volume_attachments: Optional[List['VolumeAttachmentPrototype']] = None,
+ vpc: Optional['VPCIdentity'] = None,
) -> None:
"""
- Initialize a LoadBalancerListenerHTTPSRedirectPrototype object.
+ Initialize a InstanceTemplatePrototype 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 InstanceAvailabilityPolicyPrototype availability_policy: (optional)
+ The availability policy to use for this virtual server instance.
+ :param InstanceDefaultTrustedProfilePrototype default_trusted_profile:
+ (optional) The default trusted profile configuration to use for this
+ virtual server instance
+ This property's value is used when provisioning the virtual server
+ instance, but not
+ subsequently managed. Accordingly, it is reflected as an [instance
+ initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
+ property.
+ :param List[KeyIdentity] keys: (optional) The public SSH keys for the
+ administrative user of the virtual server instance. Keys will be made
+ available to the virtual server instance as cloud-init vendor data. For
+ cloud-init enabled images, these keys will also be added as SSH authorized
+ keys for the administrative user.
+ For Windows images, the keys of type `rsa` must be specified, and one will
+ be selected to encrypt [the administrator
+ password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization).
+ Keys are optional for other images, but if no keys are specified, the
+ instance will be inaccessible unless the specified image provides another
+ means of access.
+ This property's value is used when provisioning the virtual server
+ instance, but not subsequently managed. Accordingly, it is reflected as an
+ [instance
+ initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
+ property.
+ :param InstanceMetadataServicePrototype metadata_service: (optional) The
+ metadata service configuration.
+ :param str name: (optional) The name for this instance template. The name
+ must not be used by another instance template in the region. If
+ unspecified, the name will be a hyphenated list of randomly-selected words.
+ :param InstancePlacementTargetPrototype placement_target: (optional) The
+ placement restrictions to use for the virtual server instance.
+ If specified, `reservation_affinity.policy` must be `disabled`.
+ :param InstanceProfileIdentity profile: (optional) The
+ [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for
+ this
+ virtual server instance.
+ If unspecified, `bx2-2x8` will be used, but this default value is expected
+ to change
+ in the future.
+ :param InstanceReservationAffinityPrototype reservation_affinity:
+ (optional)
+ :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) will be
+ used.
+ :param int total_volume_bandwidth: (optional) The amount of bandwidth (in
+ megabits per second) allocated exclusively to instance storage volumes. An
+ increase in this value will result in a corresponding decrease to
+ `total_network_bandwidth`.
+ :param str user_data: (optional) [User
+ data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available
+ when setting up the virtual server instance.
+ :param List[VolumeAttachmentPrototype] volume_attachments: (optional) The
+ additional volume attachments to create for the virtual server instance.
+ :param VPCIdentity vpc: (optional) The VPC this virtual server instance
+ will reside in.
+ If specified, it must match the VPC for the subnets of the instance network
+ attachments or instance network interfaces.
"""
- self.http_status_code = http_status_code
- self.listener = listener
- self.uri = uri
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['InstanceTemplatePrototypeInstanceTemplateByImage', 'InstanceTemplatePrototypeInstanceTemplateBySourceTemplate', 'InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot', 'InstanceTemplatePrototypeInstanceTemplateByCatalogOffering'])
+ )
+ raise Exception(msg)
+
+
+class InstanceTemplateReference:
+ """
+ InstanceTemplateReference.
+
+ :param str crn: The CRN for this instance template.
+ :param InstanceTemplateReferenceDeleted 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 instance template.
+ :param str id: The unique identifier for this instance template.
+ :param str name: The name for this instance template. The name is unique across
+ all instance templates in the region.
+ """
+
+ def __init__(
+ self,
+ crn: str,
+ href: str,
+ id: str,
+ name: str,
+ *,
+ deleted: Optional['InstanceTemplateReferenceDeleted'] = None,
+ ) -> None:
+ """
+ Initialize a InstanceTemplateReference object.
+
+ :param str crn: The CRN for this instance template.
+ :param str href: The URL for this instance template.
+ :param str id: The unique identifier for this instance template.
+ :param str name: The name for this instance template. The name is unique
+ across all instance templates in the region.
+ :param InstanceTemplateReferenceDeleted deleted: (optional) If present,
+ 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) -> 'LoadBalancerListenerHTTPSRedirectPrototype':
- """Initialize a LoadBalancerListenerHTTPSRedirectPrototype object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceTemplateReference':
+ """Initialize a InstanceTemplateReference object from a json dictionary."""
args = {}
- if 'http_status_code' in _dict:
- args['http_status_code'] = _dict.get('http_status_code')
+ if (crn := _dict.get('crn')) is not None:
+ args['crn'] = crn
else:
- raise ValueError('Required property \'http_status_code\' not present in LoadBalancerListenerHTTPSRedirectPrototype JSON')
- if 'listener' in _dict:
- args['listener'] = _dict.get('listener')
+ raise ValueError('Required property \'crn\' not present in InstanceTemplateReference JSON')
+ if (deleted := _dict.get('deleted')) is not None:
+ args['deleted'] = InstanceTemplateReferenceDeleted.from_dict(deleted)
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'listener\' not present in LoadBalancerListenerHTTPSRedirectPrototype JSON')
- if 'uri' in _dict:
- args['uri'] = _dict.get('uri')
+ raise ValueError('Required property \'href\' not present in InstanceTemplateReference JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
+ else:
+ raise ValueError('Required property \'id\' not present in InstanceTemplateReference JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ else:
+ raise ValueError('Required property \'name\' not present in InstanceTemplateReference JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a LoadBalancerListenerHTTPSRedirectPrototype 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, 'http_status_code') and self.http_status_code is not None:
- _dict['http_status_code'] = self.http_status_code
- if hasattr(self, 'listener') and self.listener is not None:
- if isinstance(self.listener, dict):
- _dict['listener'] = self.listener
+ if hasattr(self, 'crn') and self.crn is not None:
+ _dict['crn'] = self.crn
+ if hasattr(self, 'deleted') and self.deleted is not None:
+ if isinstance(self.deleted, dict):
+ _dict['deleted'] = self.deleted
else:
- _dict['listener'] = self.listener.to_dict()
- if hasattr(self, 'uri') and self.uri is not None:
- _dict['uri'] = self.uri
+ _dict['deleted'] = self.deleted.to_dict()
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
+ if hasattr(self, 'id') and self.id is not None:
+ _dict['id'] = self.id
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
return _dict
def _to_dict(self):
@@ -52868,260 +55748,138 @@ 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 InstanceTemplateReference object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'LoadBalancerListenerHTTPSRedirectPrototype') -> 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: 'LoadBalancerListenerHTTPSRedirectPrototype') -> bool:
+ def __ne__(self, other: 'InstanceTemplateReference') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class LoadBalancerListenerIdentity:
+class InstanceTemplateReferenceDeleted:
"""
- Identifies a load balancer listener by a unique property.
+ If present, this property indicates the referenced resource has been deleted, and
+ provides some supplementary information.
+ :param str more_info: Link to documentation about deleted resources.
"""
def __init__(
self,
+ more_info: str,
) -> None:
"""
- Initialize a LoadBalancerListenerIdentity object.
+ Initialize a InstanceTemplateReferenceDeleted object.
+ :param str more_info: Link to documentation about deleted resources.
"""
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['LoadBalancerListenerIdentityById', 'LoadBalancerListenerIdentityByHref'])
- )
- raise Exception(msg)
+ self.more_info = more_info
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'InstanceTemplateReferenceDeleted':
+ """Initialize a InstanceTemplateReferenceDeleted object from a json dictionary."""
+ args = {}
+ if (more_info := _dict.get('more_info')) is not None:
+ args['more_info'] = more_info
+ else:
+ raise ValueError('Required property \'more_info\' not present in InstanceTemplateReferenceDeleted JSON')
+ return cls(**args)
-class LoadBalancerListenerPatch:
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a InstanceTemplateReferenceDeleted object from 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 InstanceTemplateReferenceDeleted object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ 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: 'InstanceTemplateReferenceDeleted') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+
+class InstanceVCPU:
"""
- LoadBalancerListenerPatch.
+ The virtual server instance VCPU configuration.
- :attr bool accept_proxy_protocol: (optional) If set to `true`, this listener
- will accept and forward PROXY protocol information. Supported by load balancers
- in the `application` family (otherwise always `false`). Additional restrictions:
- - If this listener has `https_redirect` specified, its `accept_proxy_protocol`
- value must
- match the `accept_proxy_protocol` value of the `https_redirect` listener.
- - If this listener is the target of another listener's `https_redirect`, its
- `accept_proxy_protocol` value must match that listener's
- `accept_proxy_protocol` value.
- :attr CertificateInstanceIdentity certificate_instance: (optional) The
- certificate instance to use for SSL termination. The listener must have a
- `protocol` of `https`.
- :attr int connection_limit: (optional) The connection limit of the listener.
- :attr LoadBalancerPoolIdentity default_pool: (optional) The default pool for
- this listener. The specified pool must:
- - Belong to this load balancer
- - Have the same `protocol` as this listener, or have a compatible protocol.
- At present, the compatible protocols are `http` and `https`.
- - Not already be the `default_pool` for another listener
- Specify `null` to remove an existing default pool.
- :attr LoadBalancerListenerHTTPSRedirectPatch https_redirect: (optional) The
- target listener that requests will be redirected to. This listener must have a
- `protocol` of `http`, and the target listener must have a `protocol` of `https`.
- Specify `null` to remove any existing https redirect.
- :attr int idle_connection_timeout: (optional) The idle connection timeout of the
- listener in seconds. Supported for load balancers in the `application` family.
- :attr int port: (optional) The listener port number, or the inclusive lower
- bound of the port range. Each listener in the load balancer must have a unique
- `port` and `protocol` combination.
- Not supported for load balancers operating with route mode enabled.
- :attr int port_max: (optional) The inclusive upper bound of the range of ports
- used by this listener. Must not be less than `port_min`.
- At present, only load balancers operating with route mode enabled, and public
- load balancers in the `network` family support different values for `port_min`
- and
- `port_max`. When route mode is enabled, the value `65535` must be specified.
- The specified port range must not overlap with port ranges used by other
- listeners for this load balancer using the same protocol.
- :attr int port_min: (optional) The inclusive lower bound of the range of ports
- used by this listener. Must not be greater than `port_max`.
- At present, only load balancers operating with route mode enabled, and public
- load balancers in the `network` family support different values for `port_min`
- and
- `port_max`. When route mode is enabled, the value `1` must be specified.
- The specified port range must not overlap with port ranges used by other
- listeners for this load balancer using the same protocol.
- :attr str protocol: (optional) The listener protocol. Each listener in the load
- balancer must have a unique `port` and `protocol` combination.
- Load balancers in the `network` family support `tcp` and `udp` (if
- `udp_supported` is `true`). Load balancers in the `application` family support
- `tcp`, `http` and
- `https`.
- Additional restrictions:
- - If `default_pool` is set, the protocol cannot be changed.
- - If `https_redirect` is set, the protocol must be `http`.
- - If another listener's `https_redirect` targets this listener, the protocol
- must be
- `https`.
+ :param str architecture: The VCPU architecture.
+ :param int count: The number of VCPUs assigned.
+ :param str manufacturer: The VCPU manufacturer.
"""
def __init__(
self,
- *,
- accept_proxy_protocol: bool = None,
- certificate_instance: 'CertificateInstanceIdentity' = None,
- connection_limit: int = None,
- default_pool: 'LoadBalancerPoolIdentity' = None,
- https_redirect: 'LoadBalancerListenerHTTPSRedirectPatch' = None,
- idle_connection_timeout: int = None,
- port: int = None,
- port_max: int = None,
- port_min: int = None,
- protocol: str = None,
+ architecture: str,
+ count: int,
+ manufacturer: str,
) -> None:
"""
- Initialize a LoadBalancerListenerPatch object.
+ Initialize a InstanceVCPU object.
- :param bool accept_proxy_protocol: (optional) If set to `true`, this
- listener will accept and forward PROXY protocol information. Supported by
- load balancers in the `application` family (otherwise always `false`).
- Additional restrictions:
- - If this listener has `https_redirect` specified, its
- `accept_proxy_protocol` value must
- match the `accept_proxy_protocol` value of the `https_redirect` listener.
- - If this listener is the target of another listener's `https_redirect`,
- its
- `accept_proxy_protocol` value must match that listener's
- `accept_proxy_protocol` value.
- :param CertificateInstanceIdentity certificate_instance: (optional) The
- certificate instance to use for SSL termination. The listener must have a
- `protocol` of `https`.
- :param int connection_limit: (optional) The connection limit of the
- listener.
- :param LoadBalancerPoolIdentity default_pool: (optional) The default pool
- for this listener. The specified pool must:
- - Belong to this load balancer
- - Have the same `protocol` as this listener, or have a compatible protocol.
- At present, the compatible protocols are `http` and `https`.
- - Not already be the `default_pool` for another listener
- Specify `null` to remove an existing default pool.
- :param LoadBalancerListenerHTTPSRedirectPatch https_redirect: (optional)
- The target listener that requests will be redirected to. This listener must
- have a
- `protocol` of `http`, and the target listener must have a `protocol` of
- `https`.
- Specify `null` to remove any existing https redirect.
- :param int idle_connection_timeout: (optional) The idle connection timeout
- of the listener in seconds. Supported for load balancers in the
- `application` family.
- :param int port: (optional) The listener port number, or the inclusive
- lower bound of the port range. Each listener in the load balancer must have
- a unique `port` and `protocol` combination.
- Not supported for load balancers operating with route mode enabled.
- :param int port_max: (optional) The inclusive upper bound of the range of
- ports used by this listener. Must not be less than `port_min`.
- At present, only load balancers operating with route mode enabled, and
- public load balancers in the `network` family support different values for
- `port_min` and
- `port_max`. When route mode is enabled, the value `65535` must be
- specified.
- The specified port range must not overlap with port ranges used by other
- listeners for this load balancer using the same protocol.
- :param int port_min: (optional) The inclusive lower bound of the range of
- ports used by this listener. Must not be greater than `port_max`.
- At present, only load balancers operating with route mode enabled, and
- public load balancers in the `network` family support different values for
- `port_min` and
- `port_max`. When route mode is enabled, the value `1` must be specified.
- The specified port range must not overlap with port ranges used by other
- listeners for this load balancer using the same protocol.
- :param str protocol: (optional) The listener protocol. Each listener in the
- load balancer must have a unique `port` and `protocol` combination.
- Load balancers in the `network` family support `tcp` and `udp` (if
- `udp_supported` is `true`). Load balancers in the `application` family
- support `tcp`, `http` and
- `https`.
- Additional restrictions:
- - If `default_pool` is set, the protocol cannot be changed.
- - If `https_redirect` is set, the protocol must be `http`.
- - If another listener's `https_redirect` targets this listener, the
- protocol must be
- `https`.
+ :param str architecture: The VCPU architecture.
+ :param int count: The number of VCPUs assigned.
+ :param str manufacturer: The VCPU manufacturer.
"""
- self.accept_proxy_protocol = accept_proxy_protocol
- self.certificate_instance = certificate_instance
- self.connection_limit = connection_limit
- self.default_pool = default_pool
- self.https_redirect = https_redirect
- self.idle_connection_timeout = idle_connection_timeout
- self.port = port
- self.port_max = port_max
- self.port_min = port_min
- self.protocol = protocol
+ self.architecture = architecture
+ self.count = count
+ self.manufacturer = manufacturer
@classmethod
- def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerPatch':
- """Initialize a LoadBalancerListenerPatch object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceVCPU':
+ """Initialize a InstanceVCPU object from a json dictionary."""
args = {}
- if 'accept_proxy_protocol' in _dict:
- args['accept_proxy_protocol'] = _dict.get('accept_proxy_protocol')
- if 'certificate_instance' in _dict:
- args['certificate_instance'] = _dict.get('certificate_instance')
- if 'connection_limit' in _dict:
- args['connection_limit'] = _dict.get('connection_limit')
- if 'default_pool' in _dict:
- args['default_pool'] = _dict.get('default_pool')
- if 'https_redirect' in _dict:
- args['https_redirect'] = LoadBalancerListenerHTTPSRedirectPatch.from_dict(_dict.get('https_redirect'))
- if 'idle_connection_timeout' in _dict:
- args['idle_connection_timeout'] = _dict.get('idle_connection_timeout')
- if 'port' in _dict:
- args['port'] = _dict.get('port')
- if 'port_max' in _dict:
- args['port_max'] = _dict.get('port_max')
- if 'port_min' in _dict:
- args['port_min'] = _dict.get('port_min')
- if 'protocol' in _dict:
- args['protocol'] = _dict.get('protocol')
+ if (architecture := _dict.get('architecture')) is not None:
+ args['architecture'] = architecture
+ else:
+ raise ValueError('Required property \'architecture\' not present in InstanceVCPU JSON')
+ if (count := _dict.get('count')) is not None:
+ args['count'] = count
+ else:
+ raise ValueError('Required property \'count\' not present in InstanceVCPU JSON')
+ if (manufacturer := _dict.get('manufacturer')) is not None:
+ args['manufacturer'] = manufacturer
+ else:
+ raise ValueError('Required property \'manufacturer\' not present in InstanceVCPU JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a LoadBalancerListenerPatch 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, 'accept_proxy_protocol') and self.accept_proxy_protocol is not None:
- _dict['accept_proxy_protocol'] = self.accept_proxy_protocol
- if hasattr(self, 'certificate_instance') and self.certificate_instance is not None:
- if isinstance(self.certificate_instance, dict):
- _dict['certificate_instance'] = self.certificate_instance
- else:
- _dict['certificate_instance'] = self.certificate_instance.to_dict()
- if hasattr(self, 'connection_limit') and self.connection_limit is not None:
- _dict['connection_limit'] = self.connection_limit
- if hasattr(self, 'default_pool') and self.default_pool is not None:
- if isinstance(self.default_pool, dict):
- _dict['default_pool'] = self.default_pool
- else:
- _dict['default_pool'] = self.default_pool.to_dict()
- if hasattr(self, 'https_redirect') and self.https_redirect is not None:
- if isinstance(self.https_redirect, dict):
- _dict['https_redirect'] = self.https_redirect
- else:
- _dict['https_redirect'] = self.https_redirect.to_dict()
- if hasattr(self, 'idle_connection_timeout') and self.idle_connection_timeout is not None:
- _dict['idle_connection_timeout'] = self.idle_connection_timeout
- if hasattr(self, 'port') and self.port is not None:
- _dict['port'] = self.port
- if hasattr(self, 'port_max') and self.port_max is not None:
- _dict['port_max'] = self.port_max
- if hasattr(self, 'port_min') and self.port_min is not None:
- _dict['port_min'] = self.port_min
- if hasattr(self, 'protocol') and self.protocol is not None:
- _dict['protocol'] = self.protocol
+ if hasattr(self, 'architecture') and self.architecture is not None:
+ _dict['architecture'] = self.architecture
+ if hasattr(self, 'count') and self.count is not None:
+ _dict['count'] = self.count
+ if hasattr(self, 'manufacturer') and self.manufacturer is not None:
+ _dict['manufacturer'] = self.manufacturer
return _dict
def _to_dict(self):
@@ -53129,199 +55887,161 @@ 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 InstanceVCPU object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'LoadBalancerListenerPatch') -> 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: 'LoadBalancerListenerPatch') -> bool:
+ def __ne__(self, other: 'InstanceVCPU') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class ProtocolEnum(str, Enum):
- """
- The listener protocol. Each listener in the load balancer must have a unique
- `port` and `protocol` combination.
- Load balancers in the `network` family support `tcp` and `udp` (if `udp_supported`
- is `true`). Load balancers in the `application` family support `tcp`, `http` and
- `https`.
- Additional restrictions:
- - If `default_pool` is set, the protocol cannot be changed.
- - If `https_redirect` is set, the protocol must be `http`.
- - If another listener's `https_redirect` targets this listener, the protocol must
- be
- `https`.
- """
-
- HTTP = 'http'
- HTTPS = 'https'
- TCP = 'tcp'
- UDP = 'udp'
-
-
-class LoadBalancerListenerPolicy:
+class Key:
"""
- LoadBalancerListenerPolicy.
+ Key.
- :attr str action: The policy action.
- The enumerated values for this property are expected to expand in the future.
- When processing this property, check for and log unknown values. Optionally halt
- processing and surface the error, or bypass the policy on which the unexpected
- property value was encountered.
- :attr datetime created_at: The date and time that this policy was created.
- :attr str href: The listener policy's canonical URL.
- :attr str id: The policy's unique identifier.
- :attr str name: The name for this load balancer listener policy. The name is
- unique across all policies for the load balancer listener.
- :attr int priority: Priority of the policy. Lower value indicates higher
- priority.
- :attr str provisioning_status: The provisioning status of this policy
- The enumerated values for this property are expected to expand in the future.
- When processing this property, check for and log unknown values. Optionally halt
- processing and surface the error, or bypass the policy on which the unexpected
- property value was encountered.
- :attr List[LoadBalancerListenerPolicyRuleReference] rules: The rules for this
- policy.
- :attr LoadBalancerListenerPolicyTarget target: (optional) - If `action` is
- `forward`, the response is a `LoadBalancerPoolReference`
- - If `action` is `redirect`, the response is a
- `LoadBalancerListenerPolicyRedirectURL`
- - If `action` is `https_redirect`, the response is a
- `LoadBalancerListenerHTTPSRedirect`.
+ :param datetime created_at: The date and time that the key was created.
+ :param str crn: The CRN for this key.
+ :param str fingerprint: The fingerprint for this key. The value is returned
+ base64-encoded and prefixed with the hash algorithm (always `SHA256`).
+ :param str href: The URL for this key.
+ :param str id: The unique identifier for this key.
+ :param int length: The length of this key (in bits).
+ :param str name: The name for this key. The name must not be used by another key
+ in the region. If unspecified, the name will be a hyphenated list of
+ randomly-selected words.
+ :param str public_key: The public SSH key, consisting of two space-separated
+ fields: the algorithm name, and the base64-encoded key.
+ :param ResourceGroupReference resource_group: The resource group for this key.
+ :param str type: The crypto-system used by this key.
"""
def __init__(
self,
- action: str,
created_at: datetime,
+ crn: str,
+ fingerprint: str,
href: str,
id: str,
+ length: int,
name: str,
- priority: int,
- provisioning_status: str,
- rules: List['LoadBalancerListenerPolicyRuleReference'],
- *,
- target: 'LoadBalancerListenerPolicyTarget' = None,
+ public_key: str,
+ resource_group: 'ResourceGroupReference',
+ type: str,
) -> None:
"""
- Initialize a LoadBalancerListenerPolicy object.
+ Initialize a Key object.
- :param str action: The policy action.
- The enumerated values for this property are expected to expand in the
- future. When processing this property, check for and log unknown values.
- Optionally halt processing and surface the error, or bypass the policy on
- which the unexpected property value was encountered.
- :param datetime created_at: The date and time that this policy was created.
- :param str href: The listener policy's canonical URL.
- :param str id: The policy's unique identifier.
- :param str name: The name for this load balancer listener policy. The name
- is unique across all policies for the load balancer listener.
- :param int priority: Priority of the policy. Lower value indicates higher
- priority.
- :param str provisioning_status: The provisioning status of this policy
- The enumerated values for this property are expected to expand in the
- future. When processing this property, check for and log unknown values.
- Optionally halt processing and surface the error, or bypass the policy on
- which the unexpected property value was encountered.
- :param List[LoadBalancerListenerPolicyRuleReference] rules: The rules for
- this policy.
- :param LoadBalancerListenerPolicyTarget target: (optional) - If `action` is
- `forward`, the response is a `LoadBalancerPoolReference`
- - If `action` is `redirect`, the response is a
- `LoadBalancerListenerPolicyRedirectURL`
- - If `action` is `https_redirect`, the response is a
- `LoadBalancerListenerHTTPSRedirect`.
+ :param datetime created_at: The date and time that the key was created.
+ :param str crn: The CRN for this key.
+ :param str fingerprint: The fingerprint for this key. The value is
+ returned base64-encoded and prefixed with the hash algorithm (always
+ `SHA256`).
+ :param str href: The URL for this key.
+ :param str id: The unique identifier for this key.
+ :param int length: The length of this key (in bits).
+ :param str name: The name for this key. The name must not be used by
+ another key in the region. If unspecified, the name will be a hyphenated
+ list of randomly-selected words.
+ :param str public_key: The public SSH key, consisting of two
+ space-separated fields: the algorithm name, and the base64-encoded key.
+ :param ResourceGroupReference resource_group: The resource group for this
+ key.
+ :param str type: The crypto-system used by this key.
"""
- self.action = action
self.created_at = created_at
+ self.crn = crn
+ self.fingerprint = fingerprint
self.href = href
self.id = id
+ self.length = length
self.name = name
- self.priority = priority
- self.provisioning_status = provisioning_status
- self.rules = rules
- self.target = target
+ self.public_key = public_key
+ self.resource_group = resource_group
+ self.type = type
@classmethod
- def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerPolicy':
- """Initialize a LoadBalancerListenerPolicy object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'Key':
+ """Initialize a Key object from a json dictionary."""
args = {}
- if 'action' in _dict:
- args['action'] = _dict.get('action')
+ if (created_at := _dict.get('created_at')) is not None:
+ args['created_at'] = string_to_datetime(created_at)
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'))
+ raise ValueError('Required property \'created_at\' not present in Key JSON')
+ if (crn := _dict.get('crn')) is not None:
+ args['crn'] = crn
else:
- raise ValueError('Required property \'created_at\' not present in LoadBalancerListenerPolicy JSON')
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ raise ValueError('Required property \'crn\' not present in Key JSON')
+ if (fingerprint := _dict.get('fingerprint')) is not None:
+ args['fingerprint'] = fingerprint
else:
- raise ValueError('Required property \'href\' not present in LoadBalancerListenerPolicy JSON')
- if 'id' in _dict:
- args['id'] = _dict.get('id')
+ raise ValueError('Required property \'fingerprint\' not present in Key JSON')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'id\' not present in LoadBalancerListenerPolicy JSON')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
+ raise ValueError('Required property \'href\' not present in Key JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
else:
- raise ValueError('Required property \'name\' not present in LoadBalancerListenerPolicy JSON')
- if 'priority' in _dict:
- args['priority'] = _dict.get('priority')
+ raise ValueError('Required property \'id\' not present in Key JSON')
+ if (length := _dict.get('length')) is not None:
+ args['length'] = length
else:
- raise ValueError('Required property \'priority\' not present in LoadBalancerListenerPolicy JSON')
- if 'provisioning_status' in _dict:
- args['provisioning_status'] = _dict.get('provisioning_status')
+ raise ValueError('Required property \'length\' not present in Key JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
else:
- raise ValueError('Required property \'provisioning_status\' not present in LoadBalancerListenerPolicy JSON')
- if 'rules' in _dict:
- args['rules'] = [LoadBalancerListenerPolicyRuleReference.from_dict(v) for v in _dict.get('rules')]
+ raise ValueError('Required property \'name\' not present in Key JSON')
+ if (public_key := _dict.get('public_key')) is not None:
+ args['public_key'] = public_key
else:
- raise ValueError('Required property \'rules\' not present in LoadBalancerListenerPolicy JSON')
- if 'target' in _dict:
- args['target'] = _dict.get('target')
+ raise ValueError('Required property \'public_key\' not present in Key JSON')
+ if (resource_group := _dict.get('resource_group')) is not None:
+ args['resource_group'] = ResourceGroupReference.from_dict(resource_group)
+ else:
+ raise ValueError('Required property \'resource_group\' not present in Key JSON')
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
+ else:
+ raise ValueError('Required property \'type\' not present in Key JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a LoadBalancerListenerPolicy object from a json dictionary."""
+ """Initialize a Key object from 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, '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, 'priority') and self.priority is not None:
- _dict['priority'] = self.priority
- if hasattr(self, 'provisioning_status') and self.provisioning_status is not None:
- _dict['provisioning_status'] = self.provisioning_status
- if hasattr(self, 'rules') and self.rules is not None:
- rules_list = []
- for v in self.rules:
- if isinstance(v, dict):
- rules_list.append(v)
- else:
- rules_list.append(v.to_dict())
- _dict['rules'] = rules_list
- if hasattr(self, 'target') and self.target is not None:
- if isinstance(self.target, dict):
- _dict['target'] = self.target
+ if hasattr(self, 'public_key') and self.public_key is not None:
+ _dict['public_key'] = self.public_key
+ if hasattr(self, 'resource_group') and self.resource_group is not None:
+ if isinstance(self.resource_group, dict):
+ _dict['resource_group'] = self.resource_group
else:
- _dict['target'] = self.target.to_dict()
+ _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):
@@ -53329,95 +56049,183 @@ 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 Key object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'LoadBalancerListenerPolicy') -> 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: 'LoadBalancerListenerPolicy') -> bool:
+ def __ne__(self, other: 'Key') -> 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 crypto-system used by this key.
"""
- FORWARD = 'forward'
- HTTPS_REDIRECT = 'https_redirect'
- REDIRECT = 'redirect'
- REJECT = 'reject'
+ ED25519 = 'ed25519'
+ RSA = 'rsa'
- class ProvisioningStatusEnum(str, Enum):
+
+class KeyCollection:
+ """
+ KeyCollection.
+
+ :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 KeyCollectionNext next: (optional) A link to the next page of resources.
+ This property is present for all pages
+ except the last page.
+ :param int total_count: The total number of resources across all pages.
+ """
+
+ def __init__(
+ self,
+ first: 'KeyCollectionFirst',
+ keys: List['Key'],
+ limit: int,
+ total_count: int,
+ *,
+ next: Optional['KeyCollectionNext'] = None,
+ ) -> None:
"""
- The provisioning status of this policy
- The enumerated values for this property are expected to expand in the future. When
- processing this property, check for and log unknown values. Optionally halt
- processing and surface the error, or bypass the policy on which the unexpected
- property value was encountered.
+ Initialize a KeyCollection 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.
"""
+ self.first = first
+ self.keys = keys
+ self.limit = limit
+ self.next = next
+ self.total_count = total_count
- ACTIVE = 'active'
- CREATE_PENDING = 'create_pending'
- DELETE_PENDING = 'delete_pending'
- FAILED = 'failed'
- UPDATE_PENDING = 'update_pending'
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'KeyCollection':
+ """Initialize a KeyCollection object from a json dictionary."""
+ args = {}
+ if (first := _dict.get('first')) is not None:
+ args['first'] = KeyCollectionFirst.from_dict(first)
+ else:
+ raise ValueError('Required property \'first\' not present in KeyCollection JSON')
+ if (keys := _dict.get('keys')) is not None:
+ args['keys'] = [Key.from_dict(v) for v in keys]
+ else:
+ raise ValueError('Required property \'keys\' not present in KeyCollection JSON')
+ if (limit := _dict.get('limit')) is not None:
+ args['limit'] = limit
+ else:
+ raise ValueError('Required property \'limit\' not present in KeyCollection JSON')
+ if (next := _dict.get('next')) is not None:
+ args['next'] = KeyCollectionNext.from_dict(next)
+ if (total_count := _dict.get('total_count')) is not None:
+ args['total_count'] = total_count
+ else:
+ raise ValueError('Required property \'total_count\' not present in KeyCollection JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a KeyCollection object from a json dictionary."""
+ return cls.from_dict(_dict)
+
+ def to_dict(self) -> Dict:
+ """Return a json dictionary representing this model."""
+ _dict = {}
+ if hasattr(self, 'first') and self.first is not None:
+ if isinstance(self.first, dict):
+ _dict['first'] = self.first
+ else:
+ _dict['first'] = self.first.to_dict()
+ if hasattr(self, 'keys') and self.keys is not None:
+ keys_list = []
+ for v in self.keys:
+ if isinstance(v, dict):
+ keys_list.append(v)
+ else:
+ keys_list.append(v.to_dict())
+ _dict['keys'] = keys_list
+ if hasattr(self, 'limit') and self.limit is not None:
+ _dict['limit'] = self.limit
+ if hasattr(self, 'next') and self.next is not None:
+ if isinstance(self.next, dict):
+ _dict['next'] = self.next
+ else:
+ _dict['next'] = self.next.to_dict()
+ if hasattr(self, 'total_count') and self.total_count is not None:
+ _dict['total_count'] = self.total_count
+ return _dict
+ def _to_dict(self):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
+ def __str__(self) -> str:
+ """Return a `str` version of this KeyCollection object."""
+ return json.dumps(self.to_dict(), indent=2)
-class LoadBalancerListenerPolicyCollection:
+ 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: 'KeyCollection') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+
+class KeyCollectionFirst:
"""
- LoadBalancerListenerPolicyCollection.
+ A link to the first page of resources.
- :attr List[LoadBalancerListenerPolicy] policies: Collection of policies.
+ :param str href: The URL for a page of resources.
"""
def __init__(
self,
- policies: List['LoadBalancerListenerPolicy'],
+ href: str,
) -> None:
"""
- Initialize a LoadBalancerListenerPolicyCollection object.
+ Initialize a KeyCollectionFirst object.
- :param List[LoadBalancerListenerPolicy] policies: Collection of policies.
+ :param str href: The URL for a page of resources.
"""
- self.policies = policies
+ self.href = href
@classmethod
- def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerPolicyCollection':
- """Initialize a LoadBalancerListenerPolicyCollection object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'KeyCollectionFirst':
+ """Initialize a KeyCollectionFirst object from a json dictionary."""
args = {}
- if 'policies' in _dict:
- args['policies'] = [LoadBalancerListenerPolicy.from_dict(v) for v in _dict.get('policies')]
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'policies\' not present in LoadBalancerListenerPolicyCollection JSON')
+ raise ValueError('Required property \'href\' not present in KeyCollectionFirst JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a LoadBalancerListenerPolicyCollection object from a json dictionary."""
+ """Initialize a KeyCollectionFirst object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'policies') and self.policies is not None:
- policies_list = []
- for v in self.policies:
- if isinstance(v, dict):
- policies_list.append(v)
- else:
- policies_list.append(v.to_dict())
- _dict['policies'] = policies_list
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
return _dict
def _to_dict(self):
@@ -53425,90 +56233,59 @@ 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 KeyCollectionFirst object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'LoadBalancerListenerPolicyCollection') -> 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: 'LoadBalancerListenerPolicyCollection') -> bool:
+ def __ne__(self, other: 'KeyCollectionFirst') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class LoadBalancerListenerPolicyPatch:
+class KeyCollectionNext:
"""
- LoadBalancerListenerPolicyPatch.
+ A link to the next page of resources. This property is present for all pages except
+ the last page.
- :attr str name: (optional) The name for this policy. The name must not be used
- by another policy for the load balancer listener.
- :attr int priority: (optional) Priority of the policy. Lower value indicates
- higher priority.
- :attr LoadBalancerListenerPolicyTargetPatch target: (optional) - If `action` is
- `forward`, specify a `LoadBalancerPoolIdentity`.
- - If `action` is `redirect`, specify a
- `LoadBalancerListenerPolicyRedirectURLPatch`.
- - If `action` is `https_redirect`, specify a
- `LoadBalancerListenerPolicyHTTPSRedirectPatch`.
+ :param str href: The URL for a page of resources.
"""
def __init__(
self,
- *,
- name: str = None,
- priority: int = None,
- target: 'LoadBalancerListenerPolicyTargetPatch' = None,
+ href: str,
) -> None:
"""
- Initialize a LoadBalancerListenerPolicyPatch object.
+ Initialize a KeyCollectionNext object.
- :param str name: (optional) The name for this policy. The name must not be
- used by another policy for the load balancer listener.
- :param int priority: (optional) Priority of the policy. Lower value
- indicates higher priority.
- :param LoadBalancerListenerPolicyTargetPatch target: (optional) - If
- `action` is `forward`, specify a `LoadBalancerPoolIdentity`.
- - If `action` is `redirect`, specify a
- `LoadBalancerListenerPolicyRedirectURLPatch`.
- - If `action` is `https_redirect`, specify a
- `LoadBalancerListenerPolicyHTTPSRedirectPatch`.
+ :param str href: The URL for a page of resources.
"""
- self.name = name
- self.priority = priority
- self.target = target
+ self.href = href
@classmethod
- def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerPolicyPatch':
- """Initialize a LoadBalancerListenerPolicyPatch object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'KeyCollectionNext':
+ """Initialize a KeyCollectionNext 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 (href := _dict.get('href')) is not None:
+ args['href'] = href
+ else:
+ raise ValueError('Required property \'href\' not present in KeyCollectionNext JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a LoadBalancerListenerPolicyPatch object from a json dictionary."""
+ """Initialize a KeyCollectionNext object from 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, 'href') and self.href is not None:
+ _dict['href'] = self.href
return _dict
def _to_dict(self):
@@ -53516,128 +56293,78 @@ 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 KeyCollectionNext object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'LoadBalancerListenerPolicyPatch') -> 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: 'LoadBalancerListenerPolicyPatch') -> bool:
+ def __ne__(self, other: 'KeyCollectionNext') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class LoadBalancerListenerPolicyPrototype:
+class KeyIdentity:
"""
- LoadBalancerListenerPolicyPrototype.
+ Identifies a key by a unique property.
- :attr str action: The policy action.
- The enumerated values for this property are expected to expand in the future.
- When processing this property, check for and log unknown values. Optionally halt
- processing and surface the error, or bypass the policy on which the unexpected
- property value was encountered.
- :attr str name: (optional) The name for this policy. The name must not be used
- by another policy for the load balancer listener. If unspecified, the name will
- be a hyphenated list of randomly-selected words.
- :attr int priority: Priority of the policy. Lower value indicates higher
- priority.
- :attr List[LoadBalancerListenerPolicyRulePrototype] rules: (optional) The rule
- prototype objects for this policy.
- :attr LoadBalancerListenerPolicyTargetPrototype target: (optional) - If `action`
- is `forward`, specify a `LoadBalancerPoolIdentity`.
- - If `action` is `redirect`, specify a
- `LoadBalancerListenerPolicyRedirectURLPrototype`.
- - If `action` is `https_redirect`, specify a
- `LoadBalancerListenerPolicyHTTPSRedirectPrototype`.
"""
def __init__(
self,
- action: str,
- priority: int,
+ ) -> None:
+ """
+ Initialize a KeyIdentity object.
+
+ """
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['KeyIdentityById', 'KeyIdentityByCRN', 'KeyIdentityByHref', 'KeyIdentityByFingerprint'])
+ )
+ raise Exception(msg)
+
+
+class KeyPatch:
+ """
+ KeyPatch.
+
+ :param str name: (optional) The name for this key. The name must not be used by
+ another key in the region.
+ """
+
+ def __init__(
+ self,
*,
- name: str = None,
- rules: List['LoadBalancerListenerPolicyRulePrototype'] = None,
- target: 'LoadBalancerListenerPolicyTargetPrototype' = None,
+ name: Optional[str] = None,
) -> None:
"""
- Initialize a LoadBalancerListenerPolicyPrototype object.
+ Initialize a KeyPatch object.
- :param str action: The policy action.
- The enumerated values for this property are expected to expand in the
- future. When processing this property, check for and log unknown values.
- Optionally halt processing and surface the error, or bypass the policy on
- which the unexpected property value was encountered.
- :param int priority: Priority of the policy. Lower value indicates higher
- priority.
- :param str name: (optional) The name for this policy. The name must not be
- used by another policy for the load balancer listener. If unspecified, the
- name will be a hyphenated list of randomly-selected words.
- :param List[LoadBalancerListenerPolicyRulePrototype] rules: (optional) The
- rule prototype objects for this policy.
- :param LoadBalancerListenerPolicyTargetPrototype target: (optional) - If
- `action` is `forward`, specify a `LoadBalancerPoolIdentity`.
- - If `action` is `redirect`, specify a
- `LoadBalancerListenerPolicyRedirectURLPrototype`.
- - If `action` is `https_redirect`, specify a
- `LoadBalancerListenerPolicyHTTPSRedirectPrototype`.
+ :param str name: (optional) The name for this key. The name must not be
+ used by another key in the region.
"""
- self.action = action
self.name = name
- self.priority = priority
- self.rules = rules
- self.target = target
@classmethod
- def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerPolicyPrototype':
- """Initialize a LoadBalancerListenerPolicyPrototype object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'KeyPatch':
+ """Initialize a KeyPatch 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')
- else:
- raise ValueError('Required property \'priority\' not present in LoadBalancerListenerPolicyPrototype JSON')
- if 'rules' in _dict:
- args['rules'] = [LoadBalancerListenerPolicyRulePrototype.from_dict(v) for v in _dict.get('rules')]
- if 'target' in _dict:
- args['target'] = _dict.get('target')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a LoadBalancerListenerPolicyPrototype 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, 'action') and self.action is not None:
- _dict['action'] = self.action
if hasattr(self, 'name') and self.name is not None:
_dict['name'] = self.name
- if hasattr(self, 'priority') and self.priority is not None:
- _dict['priority'] = self.priority
- if hasattr(self, 'rules') and self.rules is not None:
- rules_list = []
- for v in self.rules:
- if isinstance(v, dict):
- rules_list.append(v)
- else:
- rules_list.append(v.to_dict())
- _dict['rules'] = rules_list
- if hasattr(self, 'target') and self.target is not None:
- if isinstance(self.target, dict):
- _dict['target'] = self.target
- else:
- _dict['target'] = self.target.to_dict()
return _dict
def _to_dict(self):
@@ -53645,104 +56372,113 @@ 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 KeyPatch object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'LoadBalancerListenerPolicyPrototype') -> 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: 'LoadBalancerListenerPolicyPrototype') -> bool:
+ def __ne__(self, other: 'KeyPatch') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class ActionEnum(str, Enum):
- """
- The policy action.
- The enumerated values for this property are expected to expand in the future. When
- processing this property, check for and log unknown values. Optionally halt
- processing and surface the error, or bypass the policy on which the unexpected
- property value was encountered.
- """
-
- FORWARD = 'forward'
- HTTPS_REDIRECT = 'https_redirect'
- REDIRECT = 'redirect'
- REJECT = 'reject'
-
-
-class LoadBalancerListenerPolicyReference:
+class KeyReference:
"""
- LoadBalancerListenerPolicyReference.
+ KeyReference.
- :attr LoadBalancerListenerPolicyReferenceDeleted deleted: (optional) If present,
- this property indicates the referenced resource has been deleted, and provides
+ :param str crn: The CRN for this key.
+ :param KeyReferenceDeleted deleted: (optional) If present, this property
+ indicates the referenced resource has been deleted, and provides
some supplementary information.
- :attr str href: The listener policy's canonical URL.
- :attr str id: The policy's unique identifier.
- :attr object name:
+ :param str fingerprint: The fingerprint for this key. The value is returned
+ base64-encoded and prefixed with the hash algorithm (always `SHA256`).
+ :param str href: The URL for this key.
+ :param str id: The unique identifier for this key.
+ :param str name: The name for this key. The name is unique across all keys in
+ the region.
"""
def __init__(
self,
+ crn: str,
+ fingerprint: str,
href: str,
id: str,
- name: object,
+ name: str,
*,
- deleted: 'LoadBalancerListenerPolicyReferenceDeleted' = None,
+ deleted: Optional['KeyReferenceDeleted'] = None,
) -> None:
"""
- Initialize a LoadBalancerListenerPolicyReference object.
+ Initialize a KeyReference object.
- :param str href: The listener policy's canonical URL.
- :param str id: The policy's unique identifier.
- :param object name:
- :param LoadBalancerListenerPolicyReferenceDeleted deleted: (optional) If
- present, this property indicates the referenced resource has been deleted,
- and provides
+ :param str crn: The CRN for this key.
+ :param str fingerprint: The fingerprint for this key. The value is
+ returned base64-encoded and prefixed with the hash algorithm (always
+ `SHA256`).
+ :param str href: The URL for this key.
+ :param str id: The unique identifier for this key.
+ :param str name: The name for this key. The name is unique across all keys
+ in the region.
+ :param KeyReferenceDeleted deleted: (optional) If present, this property
+ indicates the referenced resource has been deleted, and provides
some supplementary information.
"""
+ self.crn = crn
self.deleted = deleted
+ self.fingerprint = fingerprint
self.href = href
self.id = id
self.name = name
@classmethod
- def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerPolicyReference':
- """Initialize a LoadBalancerListenerPolicyReference object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'KeyReference':
+ """Initialize a KeyReference 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')
+ if (crn := _dict.get('crn')) is not None:
+ args['crn'] = crn
else:
- raise ValueError('Required property \'href\' not present in LoadBalancerListenerPolicyReference JSON')
- if 'id' in _dict:
- args['id'] = _dict.get('id')
+ raise ValueError('Required property \'crn\' not present in KeyReference JSON')
+ if (deleted := _dict.get('deleted')) is not None:
+ args['deleted'] = KeyReferenceDeleted.from_dict(deleted)
+ if (fingerprint := _dict.get('fingerprint')) is not None:
+ args['fingerprint'] = fingerprint
else:
- raise ValueError('Required property \'id\' not present in LoadBalancerListenerPolicyReference JSON')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
+ raise ValueError('Required property \'fingerprint\' not present in KeyReference JSON')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'name\' not present in LoadBalancerListenerPolicyReference JSON')
+ raise ValueError('Required property \'href\' not present in KeyReference JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
+ else:
+ raise ValueError('Required property \'id\' not present in KeyReference JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ else:
+ raise ValueError('Required property \'name\' not present in KeyReference JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a LoadBalancerListenerPolicyReference object from a json dictionary."""
+ """Initialize a KeyReference object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
+ if hasattr(self, 'crn') and self.crn is not None:
+ _dict['crn'] = self.crn
if hasattr(self, 'deleted') and self.deleted is not None:
if isinstance(self.deleted, dict):
_dict['deleted'] = self.deleted
else:
_dict['deleted'] = self.deleted.to_dict()
+ if hasattr(self, '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:
@@ -53756,26 +56492,26 @@ 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 KeyReference object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'LoadBalancerListenerPolicyReference') -> 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: 'LoadBalancerListenerPolicyReference') -> bool:
+ def __ne__(self, other: 'KeyReference') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class LoadBalancerListenerPolicyReferenceDeleted:
+class KeyReferenceDeleted:
"""
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.
+ :param str more_info: Link to documentation about deleted resources.
"""
def __init__(
@@ -53783,25 +56519,25 @@ def __init__(
more_info: str,
) -> None:
"""
- Initialize a LoadBalancerListenerPolicyReferenceDeleted 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) -> 'LoadBalancerListenerPolicyReferenceDeleted':
- """Initialize a LoadBalancerListenerPolicyReferenceDeleted 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')
+ if (more_info := _dict.get('more_info')) is not None:
+ args['more_info'] = more_info
else:
- raise ValueError('Required property \'more_info\' not present in LoadBalancerListenerPolicyReferenceDeleted JSON')
+ raise ValueError('Required property \'more_info\' not present in KeyReferenceDeleted JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a LoadBalancerListenerPolicyReferenceDeleted object from a json dictionary."""
+ """Initialize a KeyReferenceDeleted object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -53816,155 +56552,497 @@ 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 KeyReferenceDeleted object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'LoadBalancerListenerPolicyReferenceDeleted') -> 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: 'LoadBalancerListenerPolicyReferenceDeleted') -> bool:
+ def __ne__(self, other: 'KeyReferenceDeleted') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class LoadBalancerListenerPolicyRule:
+class LegacyCloudObjectStorageBucketIdentity:
"""
- LoadBalancerListenerPolicyRule.
+ Identifies a Cloud Object Storage bucket by a unique property.
- :attr str condition: The condition of the rule.
- :attr datetime created_at: The date and time that this rule was created.
- :attr str field: (optional) The field. This is applicable to `header`, `query`,
- and `body` rule types.
- If the rule type is `header`, this property is required.
- If the rule type is `query`, this is optional. If specified and the rule
- condition is not
- `matches_regex`, the value must be percent-encoded.
- If the rule type is `body`, this is optional.
- :attr str href: The rule's canonical URL.
- :attr str id: The rule's unique identifier.
- :attr str provisioning_status: The provisioning status of this rule
- The enumerated values for this property are expected to expand in the future.
- When processing this property, check for and log unknown values. Optionally halt
- processing and surface the error, or bypass the rule on which the unexpected
- property value was encountered.
- :attr str type: The type of the rule.
- Body rules are applied to form-encoded request bodies using the `UTF-8`
- character set.
- :attr str value: Value to be matched for rule condition.
- If the rule type is `query` and the rule condition is not `matches_regex`, the
- value must be percent-encoded.
"""
def __init__(
self,
- condition: str,
+ ) -> None:
+ """
+ Initialize a LegacyCloudObjectStorageBucketIdentity object.
+
+ """
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName'])
+ )
+ raise Exception(msg)
+
+
+class LegacyCloudObjectStorageBucketReference:
+ """
+ LegacyCloudObjectStorageBucketReference.
+
+ :param str name: The globally unique name of this Cloud Object Storage bucket.
+ """
+
+ def __init__(
+ self,
+ name: str,
+ ) -> None:
+ """
+ Initialize a LegacyCloudObjectStorageBucketReference object.
+
+ :param str name: The globally unique name of this Cloud Object Storage
+ bucket.
+ """
+ self.name = name
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'LegacyCloudObjectStorageBucketReference':
+ """Initialize a LegacyCloudObjectStorageBucketReference object from a json dictionary."""
+ args = {}
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ else:
+ raise ValueError('Required property \'name\' not present in LegacyCloudObjectStorageBucketReference JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a LegacyCloudObjectStorageBucketReference object from a json dictionary."""
+ return cls.from_dict(_dict)
+
+ def to_dict(self) -> Dict:
+ """Return a json dictionary representing this model."""
+ _dict = {}
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ return _dict
+
+ def _to_dict(self):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
+
+ def __str__(self) -> str:
+ """Return a `str` version of this LegacyCloudObjectStorageBucketReference object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'LegacyCloudObjectStorageBucketReference') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'LegacyCloudObjectStorageBucketReference') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+
+class LoadBalancer:
+ """
+ LoadBalancer.
+
+ :param datetime created_at: The date and time that this load balancer was
+ created.
+ :param str crn: The load balancer's CRN.
+ :param LoadBalancerDNS dns: (optional) The DNS configuration for this load
+ balancer.
+ If absent, DNS `A` records for this load balancer's `hostname` property will be
+ added to
+ the public DNS zone `lb.appdomain.cloud`.
+ :param str hostname: Fully qualified domain name assigned to this load balancer.
+ :param str href: The load balancer's canonical URL.
+ :param str id: The unique identifier for this load balancer.
+ :param bool instance_groups_supported: Indicates whether this load balancer
+ supports instance groups.
+ :param bool is_public: The type of this load balancer, public or private.
+ :param List[LoadBalancerListenerReference] listeners: The listeners of this load
+ balancer.
+ :param LoadBalancerLogging logging: The logging configuration for this load
+ balancer.
+ :param str name: The name for this load balancer. The name is unique across all
+ load balancers in the VPC.
+ :param str operating_status: The operating status of this load balancer.
+ :param List[LoadBalancerPoolReference] pools: The pools of this load balancer.
+ :param List[LoadBalancerPrivateIpsItem] private_ips: The private IP addresses
+ assigned to this load balancer.
+ :param LoadBalancerProfileReference profile: The profile for this load balancer.
+ :param str provisioning_status: The provisioning status of this load balancer:
+ - `active`: The load balancer is running.
+ - `create_pending`: The load balancer is being created.
+ - `delete_pending`: The load balancer is being deleted.
+ - `maintenance_pending`: The load balancer is unavailable due to an internal
+ error (contact IBM support).
+ - `migrate_pending`: The load balancer is migrating to the requested
+ configuration.
+ Performance may be degraded.
+ - `update_pending`: The load balancer is being updated
+ to the requested configuration.
+ The enumerated values for this property are expected to expand in the future.
+ When
+ processing this property, check for and log unknown values. Optionally halt
+ processing and surface the error, or bypass the load balancer on which the
+ unexpected property value was encountered.
+ :param List[IP] public_ips: The public IP addresses assigned to this load
+ balancer.
+ Applicable only for public load balancers.
+ :param ResourceGroupReference resource_group: The resource group for this load
+ balancer.
+ :param str resource_type: The resource type.
+ :param bool route_mode: Indicates whether route mode is enabled for this load
+ balancer.
+ At present, public load balancers are not supported with route mode enabled.
+ :param List[SecurityGroupReference] security_groups: The security groups
+ targeting this load balancer.
+ If empty, all inbound and outbound traffic is allowed.
+ Applicable only for load balancers that support security groups.
+ :param bool security_groups_supported: Indicates whether this load balancer
+ supports security groups.
+ :param List[SubnetReference] subnets: The subnets this load balancer is
+ provisioned in. The load balancer's availability depends on the availability of
+ the zones that the subnets reside in.
+ All subnets will be in the same VPC.
+ :param bool udp_supported: Indicates whether this load balancer supports UDP.
+ """
+
+ def __init__(
+ self,
created_at: datetime,
+ crn: str,
+ hostname: str,
href: str,
id: str,
+ instance_groups_supported: bool,
+ is_public: bool,
+ listeners: List['LoadBalancerListenerReference'],
+ logging: 'LoadBalancerLogging',
+ name: str,
+ operating_status: str,
+ pools: List['LoadBalancerPoolReference'],
+ private_ips: List['LoadBalancerPrivateIpsItem'],
+ profile: 'LoadBalancerProfileReference',
provisioning_status: str,
- type: str,
- value: str,
+ public_ips: List['IP'],
+ resource_group: 'ResourceGroupReference',
+ resource_type: str,
+ route_mode: bool,
+ security_groups: List['SecurityGroupReference'],
+ security_groups_supported: bool,
+ subnets: List['SubnetReference'],
+ udp_supported: bool,
*,
- field: str = None,
+ dns: Optional['LoadBalancerDNS'] = None,
) -> None:
"""
- Initialize a LoadBalancerListenerPolicyRule object.
+ Initialize a LoadBalancer object.
- :param str condition: The condition of the rule.
- :param datetime created_at: The date and time that this rule was created.
- :param str href: The rule's canonical URL.
- :param str id: The rule's unique identifier.
- :param str provisioning_status: The provisioning status of this rule
- The enumerated values for this property are expected to expand in the
- future. When processing this property, check for and log unknown values.
- Optionally halt processing and surface the error, or bypass the rule on
- which the unexpected property value was encountered.
- :param str type: The type of the rule.
- Body rules are applied to form-encoded request bodies using the `UTF-8`
- character set.
- :param str value: Value to be matched for rule condition.
- If the rule type is `query` and the rule condition is not `matches_regex`,
- the value must be percent-encoded.
- :param str field: (optional) The field. This is applicable to `header`,
- `query`, and `body` rule types.
- If the rule type is `header`, this property is required.
- If the rule type is `query`, this is optional. If specified and the rule
- condition is not
- `matches_regex`, the value must be percent-encoded.
- If the rule type is `body`, this is optional.
+ :param datetime created_at: The date and time that this load balancer was
+ created.
+ :param str crn: The load balancer's CRN.
+ :param str hostname: Fully qualified domain name assigned to this load
+ balancer.
+ :param str href: The load balancer's canonical URL.
+ :param str id: The unique identifier for this load balancer.
+ :param bool instance_groups_supported: Indicates whether this load balancer
+ supports instance groups.
+ :param bool is_public: The type of this load balancer, public or private.
+ :param List[LoadBalancerListenerReference] listeners: The listeners of this
+ load balancer.
+ :param LoadBalancerLogging logging: The logging configuration for this load
+ balancer.
+ :param str name: The name for this load balancer. The name is unique across
+ all load balancers in the VPC.
+ :param str operating_status: The operating status of this load balancer.
+ :param List[LoadBalancerPoolReference] pools: The pools of this load
+ balancer.
+ :param List[LoadBalancerPrivateIpsItem] private_ips: The private IP
+ addresses assigned to this load balancer.
+ :param LoadBalancerProfileReference profile: The profile for this load
+ balancer.
+ :param str provisioning_status: The provisioning status of this load
+ balancer:
+ - `active`: The load balancer is running.
+ - `create_pending`: The load balancer is being created.
+ - `delete_pending`: The load balancer is being deleted.
+ - `maintenance_pending`: The load balancer is unavailable due to an
+ internal
+ error (contact IBM support).
+ - `migrate_pending`: The load balancer is migrating to the requested
+ configuration.
+ Performance may be degraded.
+ - `update_pending`: The load balancer is being updated
+ to the requested configuration.
+ The enumerated values for this property are expected to expand in the
+ future. When
+ processing this property, check for and log unknown values. Optionally
+ halt
+ processing and surface the error, or bypass the load balancer on which
+ the
+ unexpected property value was encountered.
+ :param List[IP] public_ips: The public IP addresses assigned to this load
+ balancer.
+ Applicable only for public load balancers.
+ :param ResourceGroupReference resource_group: The resource group for this
+ load balancer.
+ :param str resource_type: The resource type.
+ :param bool route_mode: Indicates whether route mode is enabled for this
+ load balancer.
+ At present, public load balancers are not supported with route mode
+ enabled.
+ :param List[SecurityGroupReference] security_groups: The security groups
+ targeting this load balancer.
+ If empty, all inbound and outbound traffic is allowed.
+ Applicable only for load balancers that support security groups.
+ :param bool security_groups_supported: Indicates whether this load balancer
+ supports security groups.
+ :param List[SubnetReference] subnets: The subnets this load balancer is
+ provisioned in. The load balancer's availability depends on the
+ availability of the zones that the subnets reside in.
+ All subnets will be in the same VPC.
+ :param bool udp_supported: Indicates whether this load balancer supports
+ UDP.
+ :param LoadBalancerDNS dns: (optional) The DNS configuration for this load
+ balancer.
+ If absent, DNS `A` records for this load balancer's `hostname` property
+ will be added to
+ the public DNS zone `lb.appdomain.cloud`.
"""
- self.condition = condition
self.created_at = created_at
- self.field = field
+ self.crn = crn
+ self.dns = dns
+ self.hostname = hostname
self.href = href
self.id = id
+ self.instance_groups_supported = instance_groups_supported
+ self.is_public = is_public
+ self.listeners = listeners
+ self.logging = logging
+ self.name = name
+ self.operating_status = operating_status
+ self.pools = pools
+ self.private_ips = private_ips
+ self.profile = profile
self.provisioning_status = provisioning_status
- self.type = type
- self.value = value
+ self.public_ips = public_ips
+ self.resource_group = resource_group
+ self.resource_type = resource_type
+ self.route_mode = route_mode
+ self.security_groups = security_groups
+ self.security_groups_supported = security_groups_supported
+ self.subnets = subnets
+ self.udp_supported = udp_supported
@classmethod
- def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerPolicyRule':
- """Initialize a LoadBalancerListenerPolicyRule object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'LoadBalancer':
+ """Initialize a LoadBalancer object from a json dictionary."""
args = {}
- if 'condition' in _dict:
- args['condition'] = _dict.get('condition')
+ if (created_at := _dict.get('created_at')) is not None:
+ args['created_at'] = string_to_datetime(created_at)
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'))
+ raise ValueError('Required property \'created_at\' not present in LoadBalancer JSON')
+ if (crn := _dict.get('crn')) is not None:
+ args['crn'] = crn
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')
+ raise ValueError('Required property \'crn\' not present in LoadBalancer JSON')
+ if (dns := _dict.get('dns')) is not None:
+ args['dns'] = LoadBalancerDNS.from_dict(dns)
+ if (hostname := _dict.get('hostname')) is not None:
+ args['hostname'] = hostname
else:
- raise ValueError('Required property \'href\' not present in LoadBalancerListenerPolicyRule JSON')
- if 'id' in _dict:
- args['id'] = _dict.get('id')
+ raise ValueError('Required property \'hostname\' not present in LoadBalancer JSON')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'id\' not present in LoadBalancerListenerPolicyRule JSON')
- if 'provisioning_status' in _dict:
- args['provisioning_status'] = _dict.get('provisioning_status')
+ raise ValueError('Required property \'href\' not present in LoadBalancer JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
else:
- raise ValueError('Required property \'provisioning_status\' not present in LoadBalancerListenerPolicyRule JSON')
- if 'type' in _dict:
- args['type'] = _dict.get('type')
+ raise ValueError('Required property \'id\' not present in LoadBalancer JSON')
+ if (instance_groups_supported := _dict.get('instance_groups_supported')) is not None:
+ args['instance_groups_supported'] = instance_groups_supported
else:
- raise ValueError('Required property \'type\' not present in LoadBalancerListenerPolicyRule JSON')
- if 'value' in _dict:
- args['value'] = _dict.get('value')
+ raise ValueError('Required property \'instance_groups_supported\' not present in LoadBalancer JSON')
+ if (is_public := _dict.get('is_public')) is not None:
+ args['is_public'] = is_public
else:
- raise ValueError('Required property \'value\' not present in LoadBalancerListenerPolicyRule JSON')
+ raise ValueError('Required property \'is_public\' not present in LoadBalancer JSON')
+ if (listeners := _dict.get('listeners')) is not None:
+ args['listeners'] = [LoadBalancerListenerReference.from_dict(v) for v in listeners]
+ else:
+ raise ValueError('Required property \'listeners\' not present in LoadBalancer JSON')
+ if (logging := _dict.get('logging')) is not None:
+ args['logging'] = LoadBalancerLogging.from_dict(logging)
+ else:
+ raise ValueError('Required property \'logging\' not present in LoadBalancer JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ else:
+ raise ValueError('Required property \'name\' not present in LoadBalancer JSON')
+ if (operating_status := _dict.get('operating_status')) is not None:
+ args['operating_status'] = operating_status
+ else:
+ raise ValueError('Required property \'operating_status\' not present in LoadBalancer JSON')
+ if (pools := _dict.get('pools')) is not None:
+ args['pools'] = [LoadBalancerPoolReference.from_dict(v) for v in pools]
+ else:
+ raise ValueError('Required property \'pools\' not present in LoadBalancer JSON')
+ if (private_ips := _dict.get('private_ips')) is not None:
+ args['private_ips'] = [LoadBalancerPrivateIpsItem.from_dict(v) for v in private_ips]
+ else:
+ raise ValueError('Required property \'private_ips\' not present in LoadBalancer JSON')
+ if (profile := _dict.get('profile')) is not None:
+ args['profile'] = LoadBalancerProfileReference.from_dict(profile)
+ else:
+ raise ValueError('Required property \'profile\' not present in LoadBalancer JSON')
+ if (provisioning_status := _dict.get('provisioning_status')) is not None:
+ args['provisioning_status'] = provisioning_status
+ else:
+ raise ValueError('Required property \'provisioning_status\' not present in LoadBalancer JSON')
+ if (public_ips := _dict.get('public_ips')) is not None:
+ args['public_ips'] = [IP.from_dict(v) for v in public_ips]
+ else:
+ raise ValueError('Required property \'public_ips\' not present in LoadBalancer JSON')
+ if (resource_group := _dict.get('resource_group')) is not None:
+ args['resource_group'] = ResourceGroupReference.from_dict(resource_group)
+ else:
+ raise ValueError('Required property \'resource_group\' not present in LoadBalancer JSON')
+ if (resource_type := _dict.get('resource_type')) is not None:
+ args['resource_type'] = resource_type
+ else:
+ raise ValueError('Required property \'resource_type\' not present in LoadBalancer JSON')
+ if (route_mode := _dict.get('route_mode')) is not None:
+ args['route_mode'] = route_mode
+ else:
+ raise ValueError('Required property \'route_mode\' not present in LoadBalancer JSON')
+ if (security_groups := _dict.get('security_groups')) is not None:
+ args['security_groups'] = [SecurityGroupReference.from_dict(v) for v in security_groups]
+ else:
+ raise ValueError('Required property \'security_groups\' not present in LoadBalancer JSON')
+ if (security_groups_supported := _dict.get('security_groups_supported')) is not None:
+ args['security_groups_supported'] = security_groups_supported
+ else:
+ raise ValueError('Required property \'security_groups_supported\' not present in LoadBalancer JSON')
+ if (subnets := _dict.get('subnets')) is not None:
+ args['subnets'] = [SubnetReference.from_dict(v) for v in subnets]
+ else:
+ raise ValueError('Required property \'subnets\' not present in LoadBalancer JSON')
+ if (udp_supported := _dict.get('udp_supported')) is not None:
+ args['udp_supported'] = udp_supported
+ else:
+ raise ValueError('Required property \'udp_supported\' not present in LoadBalancer JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a LoadBalancerListenerPolicyRule 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, '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, 'crn') and self.crn is not None:
+ _dict['crn'] = self.crn
+ if hasattr(self, 'dns') and self.dns is not None:
+ if isinstance(self.dns, dict):
+ _dict['dns'] = self.dns
+ else:
+ _dict['dns'] = self.dns.to_dict()
+ if hasattr(self, 'hostname') and self.hostname is not None:
+ _dict['hostname'] = self.hostname
if hasattr(self, 'href') and self.href is not None:
_dict['href'] = self.href
if hasattr(self, 'id') and self.id is not None:
_dict['id'] = self.id
+ if hasattr(self, 'instance_groups_supported') and self.instance_groups_supported is not None:
+ _dict['instance_groups_supported'] = self.instance_groups_supported
+ if hasattr(self, 'is_public') and self.is_public is not None:
+ _dict['is_public'] = self.is_public
+ if hasattr(self, 'listeners') and self.listeners is not None:
+ listeners_list = []
+ for v in self.listeners:
+ if isinstance(v, dict):
+ listeners_list.append(v)
+ else:
+ listeners_list.append(v.to_dict())
+ _dict['listeners'] = listeners_list
+ if hasattr(self, 'logging') and self.logging is not None:
+ if isinstance(self.logging, dict):
+ _dict['logging'] = self.logging
+ else:
+ _dict['logging'] = self.logging.to_dict()
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ if hasattr(self, 'operating_status') and self.operating_status is not None:
+ _dict['operating_status'] = self.operating_status
+ if hasattr(self, 'pools') and self.pools is not None:
+ pools_list = []
+ for v in self.pools:
+ if isinstance(v, dict):
+ pools_list.append(v)
+ else:
+ pools_list.append(v.to_dict())
+ _dict['pools'] = pools_list
+ if hasattr(self, 'private_ips') and self.private_ips is not None:
+ private_ips_list = []
+ for v in self.private_ips:
+ if isinstance(v, dict):
+ private_ips_list.append(v)
+ else:
+ private_ips_list.append(v.to_dict())
+ _dict['private_ips'] = private_ips_list
+ if hasattr(self, 'profile') and self.profile is not None:
+ if isinstance(self.profile, dict):
+ _dict['profile'] = self.profile
+ else:
+ _dict['profile'] = self.profile.to_dict()
if hasattr(self, 'provisioning_status') and self.provisioning_status is not None:
_dict['provisioning_status'] = self.provisioning_status
- if hasattr(self, '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, 'public_ips') and self.public_ips is not None:
+ public_ips_list = []
+ for v in self.public_ips:
+ if isinstance(v, dict):
+ public_ips_list.append(v)
+ else:
+ public_ips_list.append(v.to_dict())
+ _dict['public_ips'] = public_ips_list
+ if hasattr(self, 'resource_group') and self.resource_group is not None:
+ if isinstance(self.resource_group, dict):
+ _dict['resource_group'] = self.resource_group
+ else:
+ _dict['resource_group'] = self.resource_group.to_dict()
+ if hasattr(self, 'resource_type') and self.resource_type is not None:
+ _dict['resource_type'] = self.resource_type
+ if hasattr(self, 'route_mode') and self.route_mode is not None:
+ _dict['route_mode'] = self.route_mode
+ if hasattr(self, 'security_groups') and self.security_groups is not None:
+ security_groups_list = []
+ for v in self.security_groups:
+ if isinstance(v, dict):
+ security_groups_list.append(v)
+ else:
+ security_groups_list.append(v.to_dict())
+ _dict['security_groups'] = security_groups_list
+ if hasattr(self, 'security_groups_supported') and self.security_groups_supported is not None:
+ _dict['security_groups_supported'] = self.security_groups_supported
+ if hasattr(self, 'subnets') and self.subnets is not None:
+ subnets_list = []
+ for v in self.subnets:
+ if isinstance(v, dict):
+ subnets_list.append(v)
+ else:
+ subnets_list.append(v.to_dict())
+ _dict['subnets'] = subnets_list
+ if hasattr(self, 'udp_supported') and self.udp_supported is not None:
+ _dict['udp_supported'] = self.udp_supported
return _dict
def _to_dict(self):
@@ -53972,104 +57050,162 @@ 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 LoadBalancer object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'LoadBalancerListenerPolicyRule') -> 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: 'LoadBalancerListenerPolicyRule') -> bool:
+ def __ne__(self, other: 'LoadBalancer') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class ConditionEnum(str, Enum):
+ class OperatingStatusEnum(str, Enum):
"""
- The condition of the rule.
+ The operating status of this load balancer.
"""
- CONTAINS = 'contains'
- EQUALS = 'equals'
- MATCHES_REGEX = 'matches_regex'
+ OFFLINE = 'offline'
+ ONLINE = 'online'
class ProvisioningStatusEnum(str, Enum):
"""
- The provisioning status of this rule
- The enumerated values for this property are expected to expand in the future. When
- processing this property, check for and log unknown values. Optionally halt
- processing and surface the error, or bypass the rule on which the unexpected
- property value was encountered.
+ The provisioning status of this load balancer:
+ - `active`: The load balancer is running.
+ - `create_pending`: The load balancer is being created.
+ - `delete_pending`: The load balancer is being deleted.
+ - `maintenance_pending`: The load balancer is unavailable due to an internal
+ error (contact IBM support).
+ - `migrate_pending`: The load balancer is migrating to the requested
+ configuration.
+ Performance may be degraded.
+ - `update_pending`: The load balancer is being updated
+ to the requested configuration.
+ The enumerated values for this property are expected to expand in the future.
+ When
+ processing this property, check for and log unknown values. Optionally halt
+ processing and surface the error, or bypass the load balancer on which the
+ unexpected property value was encountered.
"""
ACTIVE = 'active'
CREATE_PENDING = 'create_pending'
DELETE_PENDING = 'delete_pending'
FAILED = 'failed'
+ MAINTENANCE_PENDING = 'maintenance_pending'
+ MIGRATE_PENDING = 'migrate_pending'
UPDATE_PENDING = 'update_pending'
- class TypeEnum(str, Enum):
+ class ResourceTypeEnum(str, Enum):
"""
- The type of the rule.
- Body rules are applied to form-encoded request bodies using the `UTF-8` character
- set.
+ The resource type.
"""
- BODY = 'body'
- HEADER = 'header'
- HOSTNAME = 'hostname'
- PATH = 'path'
- QUERY = 'query'
+ LOAD_BALANCER = 'load_balancer'
-class LoadBalancerListenerPolicyRuleCollection:
+class LoadBalancerCollection:
"""
- LoadBalancerListenerPolicyRuleCollection.
+ LoadBalancerCollection.
- :attr List[LoadBalancerListenerPolicyRule] rules: Collection of rules.
+ :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 LoadBalancerCollectionNext next: (optional) A link to the next page of
+ resources. This property is present for all pages
+ except the last page.
+ :param int total_count: The total number of resources across all pages.
"""
def __init__(
self,
- rules: List['LoadBalancerListenerPolicyRule'],
+ first: 'LoadBalancerCollectionFirst',
+ limit: int,
+ load_balancers: List['LoadBalancer'],
+ total_count: int,
+ *,
+ next: Optional['LoadBalancerCollectionNext'] = None,
) -> None:
"""
- Initialize a LoadBalancerListenerPolicyRuleCollection object.
+ Initialize a LoadBalancerCollection object.
- :param List[LoadBalancerListenerPolicyRule] rules: Collection of rules.
+ :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.rules = rules
+ 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) -> 'LoadBalancerListenerPolicyRuleCollection':
- """Initialize a LoadBalancerListenerPolicyRuleCollection object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'LoadBalancerCollection':
+ """Initialize a LoadBalancerCollection object from a json dictionary."""
args = {}
- if 'rules' in _dict:
- args['rules'] = [LoadBalancerListenerPolicyRule.from_dict(v) for v in _dict.get('rules')]
+ if (first := _dict.get('first')) is not None:
+ args['first'] = LoadBalancerCollectionFirst.from_dict(first)
else:
- raise ValueError('Required property \'rules\' not present in LoadBalancerListenerPolicyRuleCollection JSON')
+ raise ValueError('Required property \'first\' not present in LoadBalancerCollection JSON')
+ if (limit := _dict.get('limit')) is not None:
+ args['limit'] = limit
+ else:
+ raise ValueError('Required property \'limit\' not present in LoadBalancerCollection JSON')
+ if (load_balancers := _dict.get('load_balancers')) is not None:
+ args['load_balancers'] = [LoadBalancer.from_dict(v) for v in load_balancers]
+ else:
+ raise ValueError('Required property \'load_balancers\' not present in LoadBalancerCollection JSON')
+ if (next := _dict.get('next')) is not None:
+ args['next'] = LoadBalancerCollectionNext.from_dict(next)
+ if (total_count := _dict.get('total_count')) is not None:
+ args['total_count'] = 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 LoadBalancerListenerPolicyRuleCollection 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, 'rules') and self.rules is not None:
- rules_list = []
- for v in self.rules:
- if isinstance(v, dict):
- rules_list.append(v)
+ if hasattr(self, 'first') and self.first is not None:
+ if isinstance(self.first, dict):
+ _dict['first'] = self.first
+ else:
+ _dict['first'] = self.first.to_dict()
+ if hasattr(self, 'limit') and self.limit is not None:
+ _dict['limit'] = self.limit
+ if hasattr(self, 'load_balancers') and self.load_balancers is not None:
+ load_balancers_list = []
+ for v in self.load_balancers:
+ if isinstance(v, dict):
+ load_balancers_list.append(v)
else:
- rules_list.append(v.to_dict())
- _dict['rules'] = rules_list
+ load_balancers_list.append(v.to_dict())
+ _dict['load_balancers'] = load_balancers_list
+ if hasattr(self, 'next') and self.next is not None:
+ if isinstance(self.next, dict):
+ _dict['next'] = self.next
+ else:
+ _dict['next'] = self.next.to_dict()
+ if hasattr(self, 'total_count') and self.total_count is not None:
+ _dict['total_count'] = self.total_count
return _dict
def _to_dict(self):
@@ -54077,101 +57213,58 @@ 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 LoadBalancerCollection object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'LoadBalancerListenerPolicyRuleCollection') -> 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: 'LoadBalancerListenerPolicyRuleCollection') -> bool:
+ def __ne__(self, other: 'LoadBalancerCollection') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class LoadBalancerListenerPolicyRulePatch:
+class LoadBalancerCollectionFirst:
"""
- LoadBalancerListenerPolicyRulePatch.
+ A link to the first page of resources.
- :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.
+ :param str href: The URL for a page of resources.
"""
def __init__(
self,
- *,
- condition: str = None,
- field: str = None,
- type: str = None,
- value: str = None,
+ href: str,
) -> None:
"""
- Initialize a LoadBalancerListenerPolicyRulePatch object.
+ Initialize a LoadBalancerCollectionFirst 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 href: The URL for a page of resources.
"""
- self.condition = condition
- self.field = field
- self.type = type
- self.value = value
+ self.href = href
@classmethod
- def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerPolicyRulePatch':
- """Initialize a LoadBalancerListenerPolicyRulePatch object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'LoadBalancerCollectionFirst':
+ """Initialize a LoadBalancerCollectionFirst object from a json dictionary."""
args = {}
- if 'condition' in _dict:
- args['condition'] = _dict.get('condition')
- if 'field' in _dict:
- args['field'] = _dict.get('field')
- if 'type' in _dict:
- args['type'] = _dict.get('type')
- if 'value' in _dict:
- args['value'] = _dict.get('value')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
+ else:
+ raise ValueError('Required property \'href\' not present in LoadBalancerCollectionFirst JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a LoadBalancerListenerPolicyRulePatch 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, '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, 'href') and self.href is not None:
+ _dict['href'] = self.href
return _dict
def _to_dict(self):
@@ -54179,131 +57272,59 @@ 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 LoadBalancerCollectionFirst object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'LoadBalancerListenerPolicyRulePatch') -> 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: 'LoadBalancerListenerPolicyRulePatch') -> bool:
+ def __ne__(self, other: 'LoadBalancerCollectionFirst') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class ConditionEnum(str, Enum):
- """
- The condition of the rule.
- """
-
- CONTAINS = 'contains'
- EQUALS = 'equals'
- MATCHES_REGEX = 'matches_regex'
-
-
- class TypeEnum(str, Enum):
- """
- The type of the rule.
- Body rules are applied to form-encoded request bodies using the `UTF-8` character
- set.
- """
-
- BODY = 'body'
- HEADER = 'header'
- HOSTNAME = 'hostname'
- PATH = 'path'
- QUERY = 'query'
-
-
-class LoadBalancerListenerPolicyRulePrototype:
+class LoadBalancerCollectionNext:
"""
- LoadBalancerListenerPolicyRulePrototype.
+ A link to the next page of resources. This property is present for all pages except
+ the last page.
- :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.
+ :param str href: The URL for a page of resources.
"""
def __init__(
self,
- condition: str,
- type: str,
- value: str,
- *,
- field: str = None,
+ href: str,
) -> None:
"""
- Initialize a LoadBalancerListenerPolicyRulePrototype object.
+ Initialize a LoadBalancerCollectionNext 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 href: The URL for a page of resources.
"""
- self.condition = condition
- self.field = field
- self.type = type
- self.value = value
+ self.href = href
@classmethod
- def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerPolicyRulePrototype':
- """Initialize a LoadBalancerListenerPolicyRulePrototype object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'LoadBalancerCollectionNext':
+ """Initialize a LoadBalancerCollectionNext 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')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
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')
+ raise ValueError('Required property \'href\' not present in LoadBalancerCollectionNext JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a LoadBalancerListenerPolicyRulePrototype 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, '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, 'href') and self.href is not None:
+ _dict['href'] = self.href
return _dict
def _to_dict(self):
@@ -54311,110 +57332,79 @@ 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 LoadBalancerCollectionNext object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'LoadBalancerListenerPolicyRulePrototype') -> 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: 'LoadBalancerListenerPolicyRulePrototype') -> bool:
+ def __ne__(self, other: 'LoadBalancerCollectionNext') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class ConditionEnum(str, Enum):
- """
- The condition of the rule.
- """
-
- CONTAINS = 'contains'
- EQUALS = 'equals'
- MATCHES_REGEX = 'matches_regex'
-
-
- class TypeEnum(str, Enum):
- """
- The type of the rule.
- Body rules are applied to form-encoded request bodies using the `UTF-8` character
- set.
- """
-
- BODY = 'body'
- HEADER = 'header'
- HOSTNAME = 'hostname'
- PATH = 'path'
- QUERY = 'query'
-
-
-class LoadBalancerListenerPolicyRuleReference:
+class LoadBalancerDNS:
"""
- LoadBalancerListenerPolicyRuleReference.
+ The DNS configuration for this load balancer.
+ If absent, DNS `A` records for this load balancer's `hostname` property will be added
+ to the public DNS zone `lb.appdomain.cloud`.
- :attr 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.
+ :param DNSInstanceReference instance: The DNS instance associated with this load
+ balancer.
+ :param DNSZoneReference zone: The DNS zone associated with this load balancer.
"""
def __init__(
self,
- href: str,
- id: str,
- *,
- deleted: 'LoadBalancerListenerPolicyRuleReferenceDeleted' = None,
+ instance: 'DNSInstanceReference',
+ zone: 'DNSZoneReference',
) -> None:
"""
- Initialize a LoadBalancerListenerPolicyRuleReference object.
+ Initialize a LoadBalancerDNS 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 DNSInstanceReference instance: The DNS instance associated with this
+ load balancer.
+ :param DNSZoneReference zone: The DNS zone associated with this load
+ balancer.
"""
- self.deleted = deleted
- self.href = href
- self.id = id
+ self.instance = instance
+ self.zone = zone
@classmethod
- def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerPolicyRuleReference':
- """Initialize a LoadBalancerListenerPolicyRuleReference object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'LoadBalancerDNS':
+ """Initialize a LoadBalancerDNS 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 (instance := _dict.get('instance')) is not None:
+ args['instance'] = DNSInstanceReference.from_dict(instance)
else:
- raise ValueError('Required property \'href\' not present in LoadBalancerListenerPolicyRuleReference JSON')
- if 'id' in _dict:
- args['id'] = _dict.get('id')
+ raise ValueError('Required property \'instance\' not present in LoadBalancerDNS JSON')
+ if (zone := _dict.get('zone')) is not None:
+ args['zone'] = DNSZoneReference.from_dict(zone)
else:
- raise ValueError('Required property \'id\' not present in LoadBalancerListenerPolicyRuleReference JSON')
+ raise ValueError('Required property \'zone\' not present in LoadBalancerDNS JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a LoadBalancerListenerPolicyRuleReference object from a json dictionary."""
+ """Initialize a LoadBalancerDNS object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'deleted') and self.deleted is not None:
- if isinstance(self.deleted, dict):
- _dict['deleted'] = self.deleted
+ if hasattr(self, 'instance') and self.instance is not None:
+ if isinstance(self.instance, dict):
+ _dict['instance'] = self.instance
else:
- _dict['deleted'] = self.deleted.to_dict()
- if hasattr(self, 'href') and self.href is not None:
- _dict['href'] = self.href
- if hasattr(self, 'id') and self.id is not None:
- _dict['id'] = self.id
+ _dict['instance'] = self.instance.to_dict()
+ if hasattr(self, 'zone') and self.zone is not None:
+ if isinstance(self.zone, dict):
+ _dict['zone'] = self.zone
+ else:
+ _dict['zone'] = self.zone.to_dict()
return _dict
def _to_dict(self):
@@ -54422,59 +57412,87 @@ 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 LoadBalancerDNS object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'LoadBalancerListenerPolicyRuleReference') -> bool:
+ def __eq__(self, other: 'LoadBalancerDNS') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'LoadBalancerListenerPolicyRuleReference') -> bool:
+ def __ne__(self, other: 'LoadBalancerDNS') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class LoadBalancerListenerPolicyRuleReferenceDeleted:
+class LoadBalancerDNSPatch:
"""
- If present, this property indicates the referenced resource has been deleted, and
- provides some supplementary information.
+ The DNS configuration for this load balancer.
+ Specify `null` to remove the existing DNS configuration, which will remove all DNS `A`
+ records for this load balancer that had been added to `zone`, and add equivalent `A`
+ records to the public DNS zone `lb.appdomain.cloud`.
- :attr str more_info: Link to documentation about deleted resources.
+ :param DNSInstanceIdentity instance: (optional) The DNS instance to associate
+ with this load balancer.
+ The specified instance may be in a different region or account, subject to IAM
+ policies.
+ :param DNSZoneIdentity zone: (optional) The DNS zone to associate with this load
+ balancer.
+ The specified zone may be in a different region or account, subject to IAM
+ policies.
"""
def __init__(
self,
- more_info: str,
+ *,
+ instance: Optional['DNSInstanceIdentity'] = None,
+ zone: Optional['DNSZoneIdentity'] = None,
) -> None:
"""
- Initialize a LoadBalancerListenerPolicyRuleReferenceDeleted object.
+ Initialize a LoadBalancerDNSPatch object.
- :param str more_info: Link to documentation about deleted resources.
+ :param DNSInstanceIdentity instance: (optional) The DNS instance to
+ associate with this load balancer.
+ The specified instance may be in a different region or account, subject to
+ IAM
+ policies.
+ :param DNSZoneIdentity zone: (optional) The DNS zone to associate with this
+ load balancer.
+ The specified zone may be in a different region or account, subject to IAM
+ policies.
"""
- self.more_info = more_info
+ self.instance = instance
+ self.zone = zone
@classmethod
- def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerPolicyRuleReferenceDeleted':
- """Initialize a LoadBalancerListenerPolicyRuleReferenceDeleted object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'LoadBalancerDNSPatch':
+ """Initialize a LoadBalancerDNSPatch 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 LoadBalancerListenerPolicyRuleReferenceDeleted JSON')
+ if (instance := _dict.get('instance')) is not None:
+ args['instance'] = instance
+ if (zone := _dict.get('zone')) is not None:
+ args['zone'] = zone
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a LoadBalancerListenerPolicyRuleReferenceDeleted object from a json dictionary."""
+ """Initialize a LoadBalancerDNSPatch object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'more_info') and self.more_info is not None:
- _dict['more_info'] = self.more_info
+ if hasattr(self, 'instance') and self.instance is not None:
+ if isinstance(self.instance, dict):
+ _dict['instance'] = self.instance
+ else:
+ _dict['instance'] = self.instance.to_dict()
+ if hasattr(self, 'zone') and self.zone is not None:
+ if isinstance(self.zone, dict):
+ _dict['zone'] = self.zone
+ else:
+ _dict['zone'] = self.zone.to_dict()
return _dict
def _to_dict(self):
@@ -54482,71 +57500,113 @@ 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 LoadBalancerDNSPatch object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'LoadBalancerListenerPolicyRuleReferenceDeleted') -> bool:
+ def __eq__(self, other: 'LoadBalancerDNSPatch') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'LoadBalancerListenerPolicyRuleReferenceDeleted') -> bool:
+ def __ne__(self, other: 'LoadBalancerDNSPatch') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class LoadBalancerListenerPolicyTarget:
+class LoadBalancerDNSPrototype:
"""
- - 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`.
+ The DNS configuration for this load balancer.
+ If unspecified, DNS `A` records for this load balancer's `hostname` property will be
+ added to the public DNS zone `lb.appdomain.cloud`. Otherwise, those DNS `A` records
+ will be added to the specified `zone`.
+ :param DNSInstanceIdentity instance: The DNS instance to associate with this
+ load balancer.
+ The specified instance may be in a different region or account, subject to IAM
+ policies.
+ :param DNSZoneIdentity zone: The DNS zone to associate with this load balancer.
+ The specified zone may be in a different region or account, subject to IAM
+ policies.
"""
def __init__(
self,
+ instance: 'DNSInstanceIdentity',
+ zone: 'DNSZoneIdentity',
) -> None:
"""
- Initialize a LoadBalancerListenerPolicyTarget object.
+ Initialize a LoadBalancerDNSPrototype object.
+ :param DNSInstanceIdentity instance: The DNS instance to associate with
+ this load balancer.
+ The specified instance may be in a different region or account, subject to
+ IAM
+ policies.
+ :param DNSZoneIdentity zone: The DNS zone to associate with this load
+ balancer.
+ The specified zone may be in a different region or account, subject to IAM
+ policies.
"""
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['LoadBalancerListenerPolicyTargetLoadBalancerPoolReference', 'LoadBalancerListenerPolicyTargetLoadBalancerListenerPolicyRedirectURL', 'LoadBalancerListenerPolicyTargetLoadBalancerListenerHTTPSRedirect'])
- )
- raise Exception(msg)
+ self.instance = instance
+ self.zone = zone
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'LoadBalancerDNSPrototype':
+ """Initialize a LoadBalancerDNSPrototype object from a json dictionary."""
+ args = {}
+ if (instance := _dict.get('instance')) is not None:
+ args['instance'] = instance
+ else:
+ raise ValueError('Required property \'instance\' not present in LoadBalancerDNSPrototype JSON')
+ if (zone := _dict.get('zone')) is not None:
+ args['zone'] = zone
+ else:
+ raise ValueError('Required property \'zone\' not present in LoadBalancerDNSPrototype JSON')
+ return cls(**args)
-class LoadBalancerListenerPolicyTargetPatch:
- """
- - If `action` is `forward`, specify a `LoadBalancerPoolIdentity`.
- - If `action` is `redirect`, specify a `LoadBalancerListenerPolicyRedirectURLPatch`.
- - If `action` is `https_redirect`, specify a
- `LoadBalancerListenerPolicyHTTPSRedirectPatch`.
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a LoadBalancerDNSPrototype object from a json dictionary."""
+ return cls.from_dict(_dict)
- """
+ def to_dict(self) -> Dict:
+ """Return a json dictionary representing this model."""
+ _dict = {}
+ if hasattr(self, 'instance') and self.instance is not None:
+ if isinstance(self.instance, dict):
+ _dict['instance'] = self.instance
+ else:
+ _dict['instance'] = self.instance.to_dict()
+ if hasattr(self, 'zone') and self.zone is not None:
+ if isinstance(self.zone, dict):
+ _dict['zone'] = self.zone
+ else:
+ _dict['zone'] = self.zone.to_dict()
+ return _dict
- def __init__(
- self,
- ) -> None:
- """
- Initialize a LoadBalancerListenerPolicyTargetPatch object.
+ def _to_dict(self):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
- """
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentity', 'LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerPolicyRedirectURLPatch', 'LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerHTTPSRedirectPatch'])
- )
- raise Exception(msg)
+ def __str__(self) -> str:
+ """Return a `str` version of this LoadBalancerDNSPrototype object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'LoadBalancerDNSPrototype') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'LoadBalancerDNSPrototype') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
-class LoadBalancerListenerPolicyTargetPrototype:
+class LoadBalancerIdentity:
"""
- - If `action` is `forward`, specify a `LoadBalancerPoolIdentity`.
- - If `action` is `redirect`, specify a
- `LoadBalancerListenerPolicyRedirectURLPrototype`.
- - If `action` is `https_redirect`, specify a
- `LoadBalancerListenerPolicyHTTPSRedirectPrototype`.
+ Identifies a load balancer by a unique property.
"""
@@ -54554,114 +57614,92 @@ def __init__(
self,
) -> None:
"""
- Initialize a LoadBalancerListenerPolicyTargetPrototype object.
+ Initialize a LoadBalancerIdentity object.
"""
msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentity', 'LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyRedirectURLPrototype', 'LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerHTTPSRedirectPrototype'])
+ ", ".join(['LoadBalancerIdentityById', 'LoadBalancerIdentityByCRN', 'LoadBalancerIdentityByHref'])
)
raise Exception(msg)
-class LoadBalancerListenerPrototypeLoadBalancerContext:
+class LoadBalancerListener:
"""
- LoadBalancerListenerPrototypeLoadBalancerContext.
+ LoadBalancerListener.
- :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:
+ :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.
- :attr CertificateInstanceIdentity certificate_instance: (optional) The
- certificate instance to use for SSL termination. The listener must have a
- `protocol` of `https`.
- :attr int connection_limit: (optional) The connection limit of the listener.
- :attr LoadBalancerPoolIdentityByName default_pool: (optional) The default pool
- for this listener. If specified, the pool must:
- - Belong to this load balancer.
- - Have the same `protocol` as this listener, or have a compatible protocol.
- At present, the compatible protocols are `http` and `https`.
- - Not already be the `default_pool` for another listener.
- If unspecified, this listener will be created with no default pool, but one may
- be
- subsequently set.
- :attr LoadBalancerListenerHTTPSRedirectPrototype https_redirect: (optional) The
- target listener that requests will be redirected to. This listener must have a
- `protocol` of `http`, and the target listener must have a `protocol` of `https`.
- :attr int idle_connection_timeout: (optional) The idle connection timeout of the
- listener in seconds. Supported for load balancers in the `application` family.
- :attr int port: (optional) The listener port number, or the inclusive lower
- bound of the port range. Each listener in the load balancer must have a unique
- `port` and `protocol` combination.
- Not supported for load balancers operating with route mode enabled.
- :attr int port_max: (optional) The inclusive upper bound of the range of ports
- used by this listener. Must not be less than `port_min`.
- At present, only load balancers operating with route mode enabled, and public
- load balancers in the `network` family support different values for `port_min`
- and
- `port_max`. When route mode is enabled, the value `65535` must be specified.
- The specified port range must not overlap with port ranges used by other
- listeners for this load balancer using the same protocol.
- :attr int port_min: (optional) The inclusive lower bound of the range of ports
- used by this listener. Must not be greater than `port_max`.
- At present, only load balancers operating with route mode enabled, and public
- load balancers in the `network` family support different values for `port_min`
- and
- `port_max`. When route mode is enabled, the value `1` must be specified.
- The specified port range must not overlap with port ranges used by other
- listeners for this load balancer using the same protocol.
- :attr str protocol: The listener protocol. Each listener in the load balancer
- must have a unique `port` and `protocol` combination.
- Load balancers in the `network` family support `tcp` and `udp` (if
- `udp_supported` is `true`). Load balancers in the `application` family support
- `tcp`, `http` and
- `https`.
- Additional restrictions:
- - If `default_pool` is set, the pool's protocol must match, or be compatible
- with
- the listener's protocol. At present, the compatible protocols are `http` and
- `https`.
- - If `https_redirect` is set, the protocol must be `http`.
+ :param CertificateInstanceReference certificate_instance: (optional) The
+ certificate instance used for SSL termination.
+ If absent, this listener is not using a certificate instance.
+ :param int connection_limit: The connection limit of the listener.
+ :param datetime created_at: The date and time that this listener was created.
+ :param LoadBalancerPoolReference default_pool: (optional) The default pool for
+ this listener. If absent, this listener has no default pool.
+ :param str href: The listener's canonical URL.
+ :param LoadBalancerListenerHTTPSRedirect https_redirect: (optional) If present,
+ the target listener that requests are redirected to.
+ :param str id: The unique identifier for this load balancer listener.
+ :param int idle_connection_timeout: (optional) The idle connection timeout of
+ the listener in seconds. This property will be present for load balancers in the
+ `application` family.
+ :param List[LoadBalancerListenerPolicyReference] policies: (optional) The
+ policies for this listener.
+ :param int port: The listener port number, or the inclusive lower bound of the
+ port range.
+ :param int port_max: The inclusive upper bound of the range of ports used by
+ this listener.
+ At present, only load balancers in the `network` family support more than one
+ port per listener.
+ :param int port_min: The inclusive lower bound of the range of ports used by
+ this listener.
+ At present, only load balancers in the `network` family support more than one
+ port per listener.
+ :param str protocol: The listener protocol.
+ The enumerated values for this property are expected to expand in the future.
+ When processing this property, check for and log unknown values. Optionally halt
+ processing and surface the error, or bypass the listener on which the unexpected
+ property value was encountered.
+ :param str provisioning_status: The provisioning status of this listener
+ The enumerated values for this property are expected to expand in the future.
+ When processing this property, check for and log unknown values. Optionally halt
+ processing and surface the error, or bypass the listener on which the unexpected
+ property value was encountered.
"""
def __init__(
self,
+ accept_proxy_protocol: bool,
+ connection_limit: int,
+ created_at: datetime,
+ href: str,
+ id: str,
+ port: int,
+ port_max: int,
+ port_min: int,
protocol: str,
+ provisioning_status: str,
*,
- accept_proxy_protocol: bool = None,
- certificate_instance: 'CertificateInstanceIdentity' = None,
- connection_limit: int = None,
- default_pool: 'LoadBalancerPoolIdentityByName' = None,
- https_redirect: 'LoadBalancerListenerHTTPSRedirectPrototype' = None,
- idle_connection_timeout: int = None,
- port: int = None,
- port_max: int = None,
- port_min: int = None,
+ certificate_instance: Optional['CertificateInstanceReference'] = None,
+ default_pool: Optional['LoadBalancerPoolReference'] = None,
+ https_redirect: Optional['LoadBalancerListenerHTTPSRedirect'] = None,
+ idle_connection_timeout: Optional[int] = None,
+ policies: Optional[List['LoadBalancerListenerPolicyReference']] = None,
) -> None:
"""
- Initialize a LoadBalancerListenerPrototypeLoadBalancerContext object.
+ Initialize a LoadBalancerListener object.
- :param str protocol: The listener protocol. Each listener in the load
- balancer must have a unique `port` and `protocol` combination.
- Load balancers in the `network` family support `tcp` and `udp` (if
- `udp_supported` is `true`). Load balancers in the `application` family
- support `tcp`, `http` and
- `https`.
- Additional restrictions:
- - If `default_pool` is set, the pool's protocol must match, or be
- compatible with
- the listener's protocol. At present, the compatible protocols are `http`
- and
- `https`.
- - If `https_redirect` is set, the protocol must be `http`.
- :param bool accept_proxy_protocol: (optional) If set to `true`, this
- listener will accept and forward PROXY protocol information. Supported by
- load balancers in the `application` family (otherwise always `false`).
- Additional restrictions:
+ :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.
@@ -54669,93 +57707,119 @@ def __init__(
its
`accept_proxy_protocol` value must match that listener's
`accept_proxy_protocol` value.
- :param CertificateInstanceIdentity certificate_instance: (optional) The
- certificate instance to use for SSL termination. The listener must have a
- `protocol` of `https`.
- :param int connection_limit: (optional) The connection limit of the
- listener.
- :param LoadBalancerPoolIdentityByName default_pool: (optional) The default
- pool for this listener. If specified, the pool must:
- - Belong to this load balancer.
- - Have the same `protocol` as this listener, or have a compatible
- protocol.
- At present, the compatible protocols are `http` and `https`.
- - Not already be the `default_pool` for another listener.
- If unspecified, this listener will be created with no default pool, but one
- may be
- subsequently set.
- :param LoadBalancerListenerHTTPSRedirectPrototype https_redirect:
- (optional) The target listener that requests will be redirected to. This
- listener must have a
- `protocol` of `http`, and the target listener must have a `protocol` of
- `https`.
+ :param int connection_limit: The connection limit of the listener.
+ :param datetime created_at: The date and time that this listener was
+ created.
+ :param str href: The listener's canonical URL.
+ :param str id: The unique identifier for this load balancer listener.
+ :param int port: The listener port number, or the inclusive lower bound of
+ the port range.
+ :param int port_max: The inclusive upper bound of the range of ports used
+ by this listener.
+ At present, only load balancers in the `network` family support more than
+ one port per listener.
+ :param int port_min: The inclusive lower bound of the range of ports used
+ by this listener.
+ At present, only load balancers in the `network` family support more than
+ one port per listener.
+ :param str protocol: The listener protocol.
+ The enumerated values for this property are expected to expand in the
+ future. When processing this property, check for and log unknown values.
+ Optionally halt processing and surface the error, or bypass the listener on
+ which the unexpected property value was encountered.
+ :param str provisioning_status: The provisioning status of this listener
+ The enumerated values for this property are expected to expand in the
+ future. When processing this property, check for and log unknown values.
+ Optionally halt processing and surface the error, or bypass the listener on
+ which the unexpected property value was encountered.
+ :param CertificateInstanceReference certificate_instance: (optional) The
+ certificate instance used for SSL termination.
+ If absent, this listener is not using a certificate instance.
+ :param LoadBalancerPoolReference default_pool: (optional) The default pool
+ for this listener. If absent, this listener has no default pool.
+ :param LoadBalancerListenerHTTPSRedirect https_redirect: (optional) If
+ present, the target listener that requests are redirected to.
:param int idle_connection_timeout: (optional) The idle connection timeout
- of the listener in seconds. Supported for load balancers in the
- `application` family.
- :param int port: (optional) The listener port number, or the inclusive
- lower bound of the port range. Each listener in the load balancer must have
- a unique `port` and `protocol` combination.
- Not supported for load balancers operating with route mode enabled.
- :param int port_max: (optional) The inclusive upper bound of the range of
- ports used by this listener. Must not be less than `port_min`.
- At present, only load balancers operating with route mode enabled, and
- public load balancers in the `network` family support different values for
- `port_min` and
- `port_max`. When route mode is enabled, the value `65535` must be
- specified.
- The specified port range must not overlap with port ranges used by other
- listeners for this load balancer using the same protocol.
- :param int port_min: (optional) The inclusive lower bound of the range of
- ports used by this listener. Must not be greater than `port_max`.
- At present, only load balancers operating with route mode enabled, and
- public load balancers in the `network` family support different values for
- `port_min` and
- `port_max`. When route mode is enabled, the value `1` must be specified.
- The specified port range must not overlap with port ranges used by other
- listeners for this load balancer using the same protocol.
+ of the listener in seconds. This property will be present for load
+ balancers in the `application` family.
+ :param List[LoadBalancerListenerPolicyReference] policies: (optional) The
+ policies for this listener.
"""
self.accept_proxy_protocol = accept_proxy_protocol
self.certificate_instance = certificate_instance
self.connection_limit = connection_limit
+ self.created_at = created_at
self.default_pool = default_pool
+ self.href = href
self.https_redirect = https_redirect
+ self.id = id
self.idle_connection_timeout = idle_connection_timeout
+ self.policies = policies
self.port = port
self.port_max = port_max
self.port_min = port_min
self.protocol = protocol
+ self.provisioning_status = provisioning_status
@classmethod
- def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerPrototypeLoadBalancerContext':
- """Initialize a LoadBalancerListenerPrototypeLoadBalancerContext object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'LoadBalancerListener':
+ """Initialize a LoadBalancerListener object from a json dictionary."""
args = {}
- if 'accept_proxy_protocol' in _dict:
- args['accept_proxy_protocol'] = _dict.get('accept_proxy_protocol')
- if 'certificate_instance' in _dict:
- args['certificate_instance'] = _dict.get('certificate_instance')
- if 'connection_limit' in _dict:
- args['connection_limit'] = _dict.get('connection_limit')
- if 'default_pool' in _dict:
- args['default_pool'] = LoadBalancerPoolIdentityByName.from_dict(_dict.get('default_pool'))
- if 'https_redirect' in _dict:
- args['https_redirect'] = LoadBalancerListenerHTTPSRedirectPrototype.from_dict(_dict.get('https_redirect'))
- if 'idle_connection_timeout' in _dict:
- args['idle_connection_timeout'] = _dict.get('idle_connection_timeout')
- if 'port' in _dict:
- args['port'] = _dict.get('port')
- if 'port_max' in _dict:
- args['port_max'] = _dict.get('port_max')
- if 'port_min' in _dict:
- args['port_min'] = _dict.get('port_min')
- if 'protocol' in _dict:
- args['protocol'] = _dict.get('protocol')
+ if (accept_proxy_protocol := _dict.get('accept_proxy_protocol')) is not None:
+ args['accept_proxy_protocol'] = accept_proxy_protocol
else:
- raise ValueError('Required property \'protocol\' not present in LoadBalancerListenerPrototypeLoadBalancerContext JSON')
+ raise ValueError('Required property \'accept_proxy_protocol\' not present in LoadBalancerListener JSON')
+ if (certificate_instance := _dict.get('certificate_instance')) is not None:
+ args['certificate_instance'] = CertificateInstanceReference.from_dict(certificate_instance)
+ if (connection_limit := _dict.get('connection_limit')) is not None:
+ args['connection_limit'] = connection_limit
+ else:
+ raise ValueError('Required property \'connection_limit\' not present in LoadBalancerListener JSON')
+ if (created_at := _dict.get('created_at')) is not None:
+ args['created_at'] = string_to_datetime(created_at)
+ else:
+ raise ValueError('Required property \'created_at\' not present in LoadBalancerListener JSON')
+ if (default_pool := _dict.get('default_pool')) is not None:
+ args['default_pool'] = LoadBalancerPoolReference.from_dict(default_pool)
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
+ else:
+ raise ValueError('Required property \'href\' not present in LoadBalancerListener JSON')
+ if (https_redirect := _dict.get('https_redirect')) is not None:
+ args['https_redirect'] = LoadBalancerListenerHTTPSRedirect.from_dict(https_redirect)
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
+ else:
+ raise ValueError('Required property \'id\' not present in LoadBalancerListener JSON')
+ if (idle_connection_timeout := _dict.get('idle_connection_timeout')) is not None:
+ args['idle_connection_timeout'] = idle_connection_timeout
+ if (policies := _dict.get('policies')) is not None:
+ args['policies'] = [LoadBalancerListenerPolicyReference.from_dict(v) for v in policies]
+ if (port := _dict.get('port')) is not None:
+ args['port'] = port
+ else:
+ raise ValueError('Required property \'port\' not present in LoadBalancerListener JSON')
+ if (port_max := _dict.get('port_max')) is not None:
+ args['port_max'] = port_max
+ else:
+ raise ValueError('Required property \'port_max\' not present in LoadBalancerListener JSON')
+ if (port_min := _dict.get('port_min')) is not None:
+ args['port_min'] = port_min
+ else:
+ raise ValueError('Required property \'port_min\' not present in LoadBalancerListener JSON')
+ if (protocol := _dict.get('protocol')) is not None:
+ args['protocol'] = protocol
+ else:
+ raise ValueError('Required property \'protocol\' not present in LoadBalancerListener JSON')
+ if (provisioning_status := _dict.get('provisioning_status')) is not None:
+ args['provisioning_status'] = 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 LoadBalancerListenerPrototypeLoadBalancerContext object from a json dictionary."""
+ """Initialize a LoadBalancerListener object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -54770,18 +57834,32 @@ def to_dict(self) -> Dict:
_dict['certificate_instance'] = self.certificate_instance.to_dict()
if hasattr(self, 'connection_limit') and self.connection_limit is not None:
_dict['connection_limit'] = self.connection_limit
+ if hasattr(self, 'created_at') and self.created_at is not None:
+ _dict['created_at'] = datetime_to_string(self.created_at)
if hasattr(self, 'default_pool') and self.default_pool is not None:
if isinstance(self.default_pool, dict):
_dict['default_pool'] = self.default_pool
else:
_dict['default_pool'] = self.default_pool.to_dict()
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
if hasattr(self, 'https_redirect') and self.https_redirect is not None:
if isinstance(self.https_redirect, dict):
_dict['https_redirect'] = self.https_redirect
else:
_dict['https_redirect'] = self.https_redirect.to_dict()
+ if hasattr(self, 'id') and self.id is not None:
+ _dict['id'] = self.id
if hasattr(self, 'idle_connection_timeout') and self.idle_connection_timeout is not None:
_dict['idle_connection_timeout'] = self.idle_connection_timeout
+ if hasattr(self, 'policies') and self.policies is not None:
+ policies_list = []
+ for v in self.policies:
+ if isinstance(v, dict):
+ policies_list.append(v)
+ else:
+ policies_list.append(v.to_dict())
+ _dict['policies'] = policies_list
if hasattr(self, 'port') and self.port is not None:
_dict['port'] = self.port
if hasattr(self, 'port_max') and self.port_max is not None:
@@ -54790,6 +57868,8 @@ def to_dict(self) -> Dict:
_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):
@@ -54797,31 +57877,26 @@ 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 LoadBalancerListener object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'LoadBalancerListenerPrototypeLoadBalancerContext') -> 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: 'LoadBalancerListenerPrototypeLoadBalancerContext') -> bool:
+ def __ne__(self, other: 'LoadBalancerListener') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
class ProtocolEnum(str, Enum):
"""
- The listener protocol. Each listener in the load balancer must have a unique
- `port` and `protocol` combination.
- Load balancers in the `network` family support `tcp` and `udp` (if `udp_supported`
- is `true`). Load balancers in the `application` family support `tcp`, `http` and
- `https`.
- Additional restrictions:
- - If `default_pool` is set, the pool's protocol must match, or be compatible with
- the listener's protocol. At present, the compatible protocols are `http` and
- `https`.
- - If `https_redirect` is set, the protocol must be `http`.
+ The listener protocol.
+ The enumerated values for this property are expected to expand in the future. When
+ processing this property, check for and log unknown values. Optionally halt
+ processing and surface the error, or bypass the listener on which the unexpected
+ property value was encountered.
"""
HTTP = 'http'
@@ -54830,72 +57905,67 @@ class ProtocolEnum(str, Enum):
UDP = 'udp'
+ class ProvisioningStatusEnum(str, Enum):
+ """
+ The provisioning status of this listener
+ The enumerated values for this property are expected to expand in the future. When
+ processing this property, check for and log unknown values. Optionally halt
+ processing and surface the error, or bypass the listener on which the unexpected
+ property value was encountered.
+ """
+
+ ACTIVE = 'active'
+ CREATE_PENDING = 'create_pending'
+ DELETE_PENDING = 'delete_pending'
+ FAILED = 'failed'
+ UPDATE_PENDING = 'update_pending'
+
-class LoadBalancerListenerReference:
+
+class LoadBalancerListenerCollection:
"""
- LoadBalancerListenerReference.
+ LoadBalancerListenerCollection.
- :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.
+ :param List[LoadBalancerListener] listeners: Collection of listeners.
"""
def __init__(
self,
- href: str,
- id: str,
- *,
- deleted: 'LoadBalancerListenerReferenceDeleted' = None,
+ listeners: List['LoadBalancerListener'],
) -> None:
"""
- Initialize a LoadBalancerListenerReference object.
+ Initialize a LoadBalancerListenerCollection 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 List[LoadBalancerListener] listeners: Collection of listeners.
"""
- self.deleted = deleted
- self.href = href
- self.id = id
+ self.listeners = listeners
@classmethod
- def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerReference':
- """Initialize a LoadBalancerListenerReference object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerCollection':
+ """Initialize a LoadBalancerListenerCollection 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')
+ if (listeners := _dict.get('listeners')) is not None:
+ args['listeners'] = [LoadBalancerListener.from_dict(v) for v in listeners]
else:
- raise ValueError('Required property \'id\' not present in LoadBalancerListenerReference JSON')
+ raise ValueError('Required property \'listeners\' not present in LoadBalancerListenerCollection JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a LoadBalancerListenerReference 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, 'deleted') and self.deleted is not None:
- if isinstance(self.deleted, dict):
- _dict['deleted'] = self.deleted
- else:
- _dict['deleted'] = self.deleted.to_dict()
- if hasattr(self, 'href') and self.href is not None:
- _dict['href'] = self.href
- if hasattr(self, 'id') and self.id is not None:
- _dict['id'] = self.id
+ if hasattr(self, 'listeners') and self.listeners is not None:
+ listeners_list = []
+ for v in self.listeners:
+ if isinstance(v, dict):
+ listeners_list.append(v)
+ else:
+ listeners_list.append(v.to_dict())
+ _dict['listeners'] = listeners_list
return _dict
def _to_dict(self):
@@ -54903,59 +57973,80 @@ 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 LoadBalancerListenerCollection object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'LoadBalancerListenerReference') -> 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: 'LoadBalancerListenerReference') -> bool:
+ def __ne__(self, other: 'LoadBalancerListenerCollection') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class LoadBalancerListenerReferenceDeleted:
+class LoadBalancerListenerHTTPSRedirect:
"""
- If present, this property indicates the referenced resource has been deleted, and
- provides some supplementary information.
+ LoadBalancerListenerHTTPSRedirect.
- :attr str more_info: Link to documentation about deleted resources.
+ :param int http_status_code: The HTTP status code for this redirect.
+ :param LoadBalancerListenerReference listener:
+ :param str uri: (optional) The redirect relative target URI.
"""
def __init__(
self,
- more_info: str,
+ http_status_code: int,
+ listener: 'LoadBalancerListenerReference',
+ *,
+ uri: Optional[str] = None,
) -> None:
"""
- Initialize a LoadBalancerListenerReferenceDeleted object.
+ Initialize a LoadBalancerListenerHTTPSRedirect object.
- :param str more_info: Link to documentation about deleted resources.
+ :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.more_info = more_info
+ self.http_status_code = http_status_code
+ self.listener = listener
+ self.uri = uri
@classmethod
- def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerReferenceDeleted':
- """Initialize a LoadBalancerListenerReferenceDeleted object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerHTTPSRedirect':
+ """Initialize a LoadBalancerListenerHTTPSRedirect object from a json dictionary."""
args = {}
- if 'more_info' in _dict:
- args['more_info'] = _dict.get('more_info')
+ if (http_status_code := _dict.get('http_status_code')) is not None:
+ args['http_status_code'] = http_status_code
else:
- raise ValueError('Required property \'more_info\' not present in LoadBalancerListenerReferenceDeleted JSON')
+ raise ValueError('Required property \'http_status_code\' not present in LoadBalancerListenerHTTPSRedirect JSON')
+ if (listener := _dict.get('listener')) is not None:
+ args['listener'] = LoadBalancerListenerReference.from_dict(listener)
+ else:
+ raise ValueError('Required property \'listener\' not present in LoadBalancerListenerHTTPSRedirect JSON')
+ if (uri := _dict.get('uri')) is not None:
+ args['uri'] = uri
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a LoadBalancerListenerReferenceDeleted 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, 'more_info') and self.more_info is not None:
- _dict['more_info'] = self.more_info
+ 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):
@@ -54963,63 +58054,79 @@ 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 LoadBalancerListenerHTTPSRedirect object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'LoadBalancerListenerReferenceDeleted') -> 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: 'LoadBalancerListenerReferenceDeleted') -> bool:
+ def __ne__(self, other: 'LoadBalancerListenerHTTPSRedirect') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class LoadBalancerLogging:
+class LoadBalancerListenerHTTPSRedirectPatch:
"""
- LoadBalancerLogging.
+ LoadBalancerListenerHTTPSRedirectPatch.
- :attr LoadBalancerLoggingDatapath datapath: The datapath logging configuration
- for this load balancer.
+ :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.
"""
def __init__(
self,
- datapath: 'LoadBalancerLoggingDatapath',
+ *,
+ http_status_code: Optional[int] = None,
+ listener: Optional['LoadBalancerListenerIdentity'] = None,
+ uri: Optional[str] = None,
) -> None:
"""
- Initialize a LoadBalancerLogging object.
+ Initialize a LoadBalancerListenerHTTPSRedirectPatch object.
- :param LoadBalancerLoggingDatapath datapath: The datapath logging
- configuration for this load balancer.
+ :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.datapath = datapath
+ self.http_status_code = http_status_code
+ self.listener = listener
+ self.uri = uri
@classmethod
- def from_dict(cls, _dict: Dict) -> 'LoadBalancerLogging':
- """Initialize a LoadBalancerLogging object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerHTTPSRedirectPatch':
+ """Initialize a LoadBalancerListenerHTTPSRedirectPatch object from a json dictionary."""
args = {}
- if 'datapath' in _dict:
- args['datapath'] = LoadBalancerLoggingDatapath.from_dict(_dict.get('datapath'))
- else:
- raise ValueError('Required property \'datapath\' not present in LoadBalancerLogging JSON')
+ if (http_status_code := _dict.get('http_status_code')) is not None:
+ args['http_status_code'] = http_status_code
+ if (listener := _dict.get('listener')) is not None:
+ args['listener'] = listener
+ if (uri := _dict.get('uri')) is not None:
+ args['uri'] = uri
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a LoadBalancerLogging 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, 'datapath') and self.datapath is not None:
- if isinstance(self.datapath, dict):
- _dict['datapath'] = self.datapath
+ 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['datapath'] = self.datapath.to_dict()
+ _dict['listener'] = self.listener.to_dict()
+ if hasattr(self, 'uri') and self.uri is not None:
+ _dict['uri'] = self.uri
return _dict
def _to_dict(self):
@@ -55027,60 +58134,82 @@ 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 LoadBalancerListenerHTTPSRedirectPatch object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'LoadBalancerLogging') -> 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: 'LoadBalancerLogging') -> bool:
+ def __ne__(self, other: 'LoadBalancerListenerHTTPSRedirectPatch') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class LoadBalancerLoggingDatapath:
+class LoadBalancerListenerHTTPSRedirectPrototype:
"""
- The datapath logging configuration for this load balancer.
+ LoadBalancerListenerHTTPSRedirectPrototype.
- :attr bool active: Indicates whether datapath logging is active for this load
- balancer.
+ :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.
"""
def __init__(
self,
- active: bool,
+ http_status_code: int,
+ listener: 'LoadBalancerListenerIdentity',
+ *,
+ uri: Optional[str] = None,
) -> None:
"""
- Initialize a LoadBalancerLoggingDatapath object.
+ Initialize a LoadBalancerListenerHTTPSRedirectPrototype object.
- :param bool active: Indicates whether datapath logging is active for this
- load balancer.
+ :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.active = active
+ self.http_status_code = http_status_code
+ self.listener = listener
+ self.uri = uri
@classmethod
- def from_dict(cls, _dict: Dict) -> 'LoadBalancerLoggingDatapath':
- """Initialize a LoadBalancerLoggingDatapath object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerHTTPSRedirectPrototype':
+ """Initialize a LoadBalancerListenerHTTPSRedirectPrototype object from a json dictionary."""
args = {}
- if 'active' in _dict:
- args['active'] = _dict.get('active')
+ if (http_status_code := _dict.get('http_status_code')) is not None:
+ args['http_status_code'] = http_status_code
else:
- raise ValueError('Required property \'active\' not present in LoadBalancerLoggingDatapath JSON')
+ raise ValueError('Required property \'http_status_code\' not present in LoadBalancerListenerHTTPSRedirectPrototype JSON')
+ if (listener := _dict.get('listener')) is not None:
+ args['listener'] = listener
+ else:
+ raise ValueError('Required property \'listener\' not present in LoadBalancerListenerHTTPSRedirectPrototype JSON')
+ if (uri := _dict.get('uri')) is not None:
+ args['uri'] = uri
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a LoadBalancerLoggingDatapath 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, 'active') and self.active is not None:
- _dict['active'] = self.active
+ 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):
@@ -55088,182 +58217,461 @@ 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 LoadBalancerListenerHTTPSRedirectPrototype object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'LoadBalancerLoggingDatapath') -> 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: 'LoadBalancerLoggingDatapath') -> bool:
+ def __ne__(self, other: 'LoadBalancerListenerHTTPSRedirectPrototype') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class LoadBalancerLoggingDatapathPatch:
+class LoadBalancerListenerIdentity:
"""
- The datapath logging configuration for this load balancer.
+ Identifies a load balancer listener by a unique property.
- :attr bool active: (optional) Indicates whether datapath logging will be active
- for this load balancer.
"""
def __init__(
self,
- *,
- active: bool = None,
) -> None:
"""
- Initialize a LoadBalancerLoggingDatapathPatch object.
+ Initialize a LoadBalancerListenerIdentity object.
- :param bool active: (optional) Indicates whether datapath logging will be
- active for this load balancer.
"""
- self.active = active
-
- @classmethod
- def from_dict(cls, _dict: Dict) -> 'LoadBalancerLoggingDatapathPatch':
- """Initialize a LoadBalancerLoggingDatapathPatch object from a json dictionary."""
- args = {}
- if 'active' in _dict:
- args['active'] = _dict.get('active')
- return cls(**args)
-
- @classmethod
- def _from_dict(cls, _dict):
- """Initialize a LoadBalancerLoggingDatapathPatch object from a json dictionary."""
- return cls.from_dict(_dict)
-
- def to_dict(self) -> Dict:
- """Return a json dictionary representing this model."""
- _dict = {}
- if hasattr(self, 'active') and self.active is not None:
- _dict['active'] = self.active
- return _dict
-
- def _to_dict(self):
- """Return a json dictionary representing this model."""
- return self.to_dict()
-
- def __str__(self) -> str:
- """Return a `str` version of this LoadBalancerLoggingDatapathPatch object."""
- return json.dumps(self.to_dict(), indent=2)
-
- def __eq__(self, other: 'LoadBalancerLoggingDatapathPatch') -> bool:
- """Return `true` when self and other are equal, false otherwise."""
- if not isinstance(other, self.__class__):
- return False
- return self.__dict__ == other.__dict__
-
- def __ne__(self, other: 'LoadBalancerLoggingDatapathPatch') -> 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(['LoadBalancerListenerIdentityById', 'LoadBalancerListenerIdentityByHref'])
+ )
+ raise Exception(msg)
-class LoadBalancerLoggingDatapathPrototype:
+class LoadBalancerListenerPatch:
"""
- The datapath logging configuration for this load balancer.
+ LoadBalancerListenerPatch.
- :attr bool active: (optional) Indicates whether datapath logging will be active
- for this load balancer.
+ :param bool accept_proxy_protocol: (optional) If set to `true`, this listener
+ will accept and forward PROXY protocol information. Supported by load balancers
+ in the `application` family (otherwise always `false`). Additional restrictions:
+ - If this listener has `https_redirect` specified, its `accept_proxy_protocol`
+ value must
+ match the `accept_proxy_protocol` value of the `https_redirect` listener.
+ - If this listener is the target of another listener's `https_redirect`, its
+ `accept_proxy_protocol` value must match that listener's
+ `accept_proxy_protocol` value.
+ :param CertificateInstanceIdentity certificate_instance: (optional) The
+ certificate instance to use for SSL termination. The listener must have a
+ `protocol` of `https`.
+ :param int connection_limit: (optional) The connection limit of the listener.
+ :param LoadBalancerPoolIdentity default_pool: (optional) The default pool for
+ this listener. The specified pool must:
+ - Belong to this load balancer
+ - Have the same `protocol` as this listener, or have a compatible protocol.
+ At present, the compatible protocols are `http` and `https`.
+ - Not already be the `default_pool` for another listener
+ Specify `null` to remove an existing default pool.
+ :param LoadBalancerListenerHTTPSRedirectPatch https_redirect: (optional) The
+ target listener that requests will be redirected to. This listener must have a
+ `protocol` of `http`, and the target listener must have a `protocol` of `https`.
+ Specify `null` to remove any existing https redirect.
+ :param int idle_connection_timeout: (optional) The idle connection timeout of
+ the listener in seconds. Supported for load balancers in the `application`
+ family.
+ :param int port: (optional) The listener port number, or the inclusive lower
+ bound of the port range. Each listener in the load balancer must have a unique
+ `port` and `protocol` combination.
+ Not supported for load balancers operating with route mode enabled.
+ :param int port_max: (optional) The inclusive upper bound of the range of ports
+ used by this listener. Must not be less than `port_min`.
+ At present, only load balancers operating with route mode enabled, and public
+ load balancers in the `network` family support different values for `port_min`
+ and
+ `port_max`. When route mode is enabled, the value `65535` must be specified.
+ The specified port range must not overlap with port ranges used by other
+ listeners for this load balancer using the same protocol.
+ :param int port_min: (optional) The inclusive lower bound of the range of ports
+ used by this listener. Must not be greater than `port_max`.
+ At present, only load balancers operating with route mode enabled, and public
+ load balancers in the `network` family support different values for `port_min`
+ and
+ `port_max`. When route mode is enabled, the value `1` must be specified.
+ The specified port range must not overlap with port ranges used by other
+ listeners for this load balancer using the same protocol.
+ :param str protocol: (optional) The listener protocol. Each listener in the load
+ balancer must have a unique `port` and `protocol` combination.
+ Load balancers in the `network` family support `tcp` and `udp` (if
+ `udp_supported` is `true`). Load balancers in the `application` family support
+ `tcp`, `http` and
+ `https`.
+ Additional restrictions:
+ - If `default_pool` is set, the protocol cannot be changed.
+ - If `https_redirect` is set, the protocol must be `http`.
+ - If another listener's `https_redirect` targets this listener, the protocol
+ must be
+ `https`.
"""
def __init__(
self,
*,
- active: bool = None,
+ accept_proxy_protocol: Optional[bool] = None,
+ certificate_instance: Optional['CertificateInstanceIdentity'] = None,
+ connection_limit: Optional[int] = None,
+ default_pool: Optional['LoadBalancerPoolIdentity'] = None,
+ https_redirect: Optional['LoadBalancerListenerHTTPSRedirectPatch'] = None,
+ idle_connection_timeout: Optional[int] = None,
+ port: Optional[int] = None,
+ port_max: Optional[int] = None,
+ port_min: Optional[int] = None,
+ protocol: Optional[str] = None,
) -> None:
"""
- Initialize a LoadBalancerLoggingDatapathPrototype object.
-
- :param bool active: (optional) Indicates whether datapath logging will be
- active for this load balancer.
- """
- self.active = active
-
- @classmethod
- def from_dict(cls, _dict: Dict) -> 'LoadBalancerLoggingDatapathPrototype':
- """Initialize a LoadBalancerLoggingDatapathPrototype object from a json dictionary."""
- args = {}
- if 'active' in _dict:
- args['active'] = _dict.get('active')
- return cls(**args)
-
- @classmethod
- def _from_dict(cls, _dict):
- """Initialize a LoadBalancerLoggingDatapathPrototype object from a json dictionary."""
- return cls.from_dict(_dict)
-
- def to_dict(self) -> Dict:
- """Return a json dictionary representing this model."""
- _dict = {}
- if hasattr(self, 'active') and self.active is not None:
- _dict['active'] = self.active
- return _dict
+ Initialize a LoadBalancerListenerPatch object.
- def _to_dict(self):
- """Return a json dictionary representing this model."""
- return self.to_dict()
+ :param bool accept_proxy_protocol: (optional) If set to `true`, this
+ listener will accept and forward PROXY protocol information. Supported by
+ load balancers in the `application` family (otherwise always `false`).
+ Additional restrictions:
+ - If this listener has `https_redirect` specified, its
+ `accept_proxy_protocol` value must
+ match the `accept_proxy_protocol` value of the `https_redirect` listener.
+ - If this listener is the target of another listener's `https_redirect`,
+ its
+ `accept_proxy_protocol` value must match that listener's
+ `accept_proxy_protocol` value.
+ :param CertificateInstanceIdentity certificate_instance: (optional) The
+ certificate instance to use for SSL termination. The listener must have a
+ `protocol` of `https`.
+ :param int connection_limit: (optional) The connection limit of the
+ listener.
+ :param LoadBalancerPoolIdentity default_pool: (optional) The default pool
+ for this listener. The specified pool must:
+ - Belong to this load balancer
+ - Have the same `protocol` as this listener, or have a compatible protocol.
+ At present, the compatible protocols are `http` and `https`.
+ - Not already be the `default_pool` for another listener
+ Specify `null` to remove an existing default pool.
+ :param LoadBalancerListenerHTTPSRedirectPatch https_redirect: (optional)
+ The target listener that requests will be redirected to. This listener must
+ have a
+ `protocol` of `http`, and the target listener must have a `protocol` of
+ `https`.
+ Specify `null` to remove any existing https redirect.
+ :param int idle_connection_timeout: (optional) The idle connection timeout
+ of the listener in seconds. Supported for load balancers in the
+ `application` family.
+ :param int port: (optional) The listener port number, or the inclusive
+ lower bound of the port range. Each listener in the load balancer must have
+ a unique `port` and `protocol` combination.
+ Not supported for load balancers operating with route mode enabled.
+ :param int port_max: (optional) The inclusive upper bound of the range of
+ ports used by this listener. Must not be less than `port_min`.
+ At present, only load balancers operating with route mode enabled, and
+ public load balancers in the `network` family support different values for
+ `port_min` and
+ `port_max`. When route mode is enabled, the value `65535` must be
+ specified.
+ The specified port range must not overlap with port ranges used by other
+ listeners for this load balancer using the same protocol.
+ :param int port_min: (optional) The inclusive lower bound of the range of
+ ports used by this listener. Must not be greater than `port_max`.
+ At present, only load balancers operating with route mode enabled, and
+ public load balancers in the `network` family support different values for
+ `port_min` and
+ `port_max`. When route mode is enabled, the value `1` must be specified.
+ The specified port range must not overlap with port ranges used by other
+ listeners for this load balancer using the same protocol.
+ :param str protocol: (optional) The listener protocol. Each listener in the
+ load balancer must have a unique `port` and `protocol` combination.
+ Load balancers in the `network` family support `tcp` and `udp` (if
+ `udp_supported` is `true`). Load balancers in the `application` family
+ support `tcp`, `http` and
+ `https`.
+ Additional restrictions:
+ - If `default_pool` is set, the protocol cannot be changed.
+ - If `https_redirect` is set, the protocol must be `http`.
+ - If another listener's `https_redirect` targets this listener, the
+ protocol must be
+ `https`.
+ """
+ self.accept_proxy_protocol = accept_proxy_protocol
+ self.certificate_instance = certificate_instance
+ self.connection_limit = connection_limit
+ self.default_pool = default_pool
+ self.https_redirect = https_redirect
+ self.idle_connection_timeout = idle_connection_timeout
+ self.port = port
+ self.port_max = port_max
+ self.port_min = port_min
+ self.protocol = protocol
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerPatch':
+ """Initialize a LoadBalancerListenerPatch object from a json dictionary."""
+ args = {}
+ if (accept_proxy_protocol := _dict.get('accept_proxy_protocol')) is not None:
+ args['accept_proxy_protocol'] = accept_proxy_protocol
+ if (certificate_instance := _dict.get('certificate_instance')) is not None:
+ args['certificate_instance'] = certificate_instance
+ if (connection_limit := _dict.get('connection_limit')) is not None:
+ args['connection_limit'] = connection_limit
+ if (default_pool := _dict.get('default_pool')) is not None:
+ args['default_pool'] = default_pool
+ if (https_redirect := _dict.get('https_redirect')) is not None:
+ args['https_redirect'] = LoadBalancerListenerHTTPSRedirectPatch.from_dict(https_redirect)
+ if (idle_connection_timeout := _dict.get('idle_connection_timeout')) is not None:
+ args['idle_connection_timeout'] = idle_connection_timeout
+ if (port := _dict.get('port')) is not None:
+ args['port'] = port
+ if (port_max := _dict.get('port_max')) is not None:
+ args['port_max'] = port_max
+ if (port_min := _dict.get('port_min')) is not None:
+ args['port_min'] = port_min
+ if (protocol := _dict.get('protocol')) is not None:
+ args['protocol'] = protocol
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """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, 'accept_proxy_protocol') and self.accept_proxy_protocol is not None:
+ _dict['accept_proxy_protocol'] = self.accept_proxy_protocol
+ if hasattr(self, 'certificate_instance') and self.certificate_instance is not None:
+ if isinstance(self.certificate_instance, dict):
+ _dict['certificate_instance'] = self.certificate_instance
+ else:
+ _dict['certificate_instance'] = self.certificate_instance.to_dict()
+ if hasattr(self, 'connection_limit') and self.connection_limit is not None:
+ _dict['connection_limit'] = self.connection_limit
+ if hasattr(self, 'default_pool') and self.default_pool is not None:
+ if isinstance(self.default_pool, dict):
+ _dict['default_pool'] = self.default_pool
+ else:
+ _dict['default_pool'] = self.default_pool.to_dict()
+ if hasattr(self, 'https_redirect') and self.https_redirect is not None:
+ if isinstance(self.https_redirect, dict):
+ _dict['https_redirect'] = self.https_redirect
+ else:
+ _dict['https_redirect'] = self.https_redirect.to_dict()
+ if hasattr(self, 'idle_connection_timeout') and self.idle_connection_timeout is not None:
+ _dict['idle_connection_timeout'] = self.idle_connection_timeout
+ if hasattr(self, 'port') and self.port is not None:
+ _dict['port'] = self.port
+ if hasattr(self, 'port_max') and self.port_max is not None:
+ _dict['port_max'] = self.port_max
+ if hasattr(self, 'port_min') and self.port_min is not None:
+ _dict['port_min'] = self.port_min
+ if hasattr(self, 'protocol') and self.protocol is not None:
+ _dict['protocol'] = self.protocol
+ return _dict
+
+ def _to_dict(self):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this LoadBalancerLoggingDatapathPrototype object."""
+ """Return a `str` version of this LoadBalancerListenerPatch object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'LoadBalancerLoggingDatapathPrototype') -> 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: 'LoadBalancerLoggingDatapathPrototype') -> bool:
+ def __ne__(self, other: 'LoadBalancerListenerPatch') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
+ class ProtocolEnum(str, Enum):
+ """
+ The listener protocol. Each listener in the load balancer must have a unique
+ `port` and `protocol` combination.
+ Load balancers in the `network` family support `tcp` and `udp` (if `udp_supported`
+ is `true`). Load balancers in the `application` family support `tcp`, `http` and
+ `https`.
+ Additional restrictions:
+ - If `default_pool` is set, the protocol cannot be changed.
+ - If `https_redirect` is set, the protocol must be `http`.
+ - If another listener's `https_redirect` targets this listener, the protocol must
+ be
+ `https`.
+ """
+
+ HTTP = 'http'
+ HTTPS = 'https'
+ TCP = 'tcp'
+ UDP = 'udp'
+
-class LoadBalancerLoggingPatch:
+
+class LoadBalancerListenerPolicy:
"""
- LoadBalancerLoggingPatch.
+ LoadBalancerListenerPolicy.
- :attr LoadBalancerLoggingDatapathPatch datapath: (optional) The datapath logging
- configuration for this load balancer.
+ :param str action: The policy action.
+ The enumerated values for this property are expected to expand in the future.
+ When processing this property, check for and log unknown values. Optionally halt
+ processing and surface the error, or bypass the policy on which the unexpected
+ property value was encountered.
+ :param datetime created_at: The date and time that this policy was created.
+ :param str href: The listener policy's canonical URL.
+ :param str id: The policy's unique identifier.
+ :param str name: The name for this load balancer listener policy. The name is
+ unique across all policies for the load balancer listener.
+ :param int priority: Priority of the policy. Lower value indicates higher
+ priority.
+ :param str provisioning_status: The provisioning status of this policy
+ The enumerated values for this property are expected to expand in the future.
+ When processing this property, check for and log unknown values. Optionally halt
+ processing and surface the error, or bypass the policy on which the unexpected
+ property value was encountered.
+ :param List[LoadBalancerListenerPolicyRuleReference] rules: The rules for this
+ policy.
+ :param LoadBalancerListenerPolicyTarget target: (optional) - If `action` is
+ `forward`, the response is a `LoadBalancerPoolReference`
+ - If `action` is `redirect`, the response is a
+ `LoadBalancerListenerPolicyRedirectURL`
+ - If `action` is `https_redirect`, the response is a
+ `LoadBalancerListenerHTTPSRedirect`.
"""
def __init__(
self,
+ action: str,
+ created_at: datetime,
+ href: str,
+ id: str,
+ name: str,
+ priority: int,
+ provisioning_status: str,
+ rules: List['LoadBalancerListenerPolicyRuleReference'],
*,
- datapath: 'LoadBalancerLoggingDatapathPatch' = None,
+ target: Optional['LoadBalancerListenerPolicyTarget'] = None,
) -> None:
"""
- Initialize a LoadBalancerLoggingPatch object.
+ Initialize a LoadBalancerListenerPolicy object.
- :param LoadBalancerLoggingDatapathPatch datapath: (optional) The datapath
- logging configuration for this load balancer.
+ :param str action: The policy action.
+ The enumerated values for this property are expected to expand in the
+ future. When processing this property, check for and log unknown values.
+ Optionally halt processing and surface the error, or bypass the policy on
+ which the unexpected property value was encountered.
+ :param datetime created_at: The date and time that this policy was created.
+ :param str href: The listener policy's canonical URL.
+ :param str id: The policy's unique identifier.
+ :param str name: The name for this load balancer listener policy. The name
+ is unique across all policies for the load balancer listener.
+ :param int priority: Priority of the policy. Lower value indicates higher
+ priority.
+ :param str provisioning_status: The provisioning status of this policy
+ The enumerated values for this property are expected to expand in the
+ future. When processing this property, check for and log unknown values.
+ Optionally halt processing and surface the error, or bypass the policy on
+ which the unexpected property value was encountered.
+ :param List[LoadBalancerListenerPolicyRuleReference] rules: The rules for
+ this policy.
+ :param LoadBalancerListenerPolicyTarget target: (optional) - If `action` is
+ `forward`, the response is a `LoadBalancerPoolReference`
+ - If `action` is `redirect`, the response is a
+ `LoadBalancerListenerPolicyRedirectURL`
+ - If `action` is `https_redirect`, the response is a
+ `LoadBalancerListenerHTTPSRedirect`.
"""
- self.datapath = datapath
+ 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) -> 'LoadBalancerLoggingPatch':
- """Initialize a LoadBalancerLoggingPatch object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerPolicy':
+ """Initialize a LoadBalancerListenerPolicy object from a json dictionary."""
args = {}
- if 'datapath' in _dict:
- args['datapath'] = LoadBalancerLoggingDatapathPatch.from_dict(_dict.get('datapath'))
+ if (action := _dict.get('action')) is not None:
+ args['action'] = action
+ else:
+ raise ValueError('Required property \'action\' not present in LoadBalancerListenerPolicy JSON')
+ if (created_at := _dict.get('created_at')) is not None:
+ args['created_at'] = string_to_datetime(created_at)
+ else:
+ raise ValueError('Required property \'created_at\' not present in LoadBalancerListenerPolicy JSON')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
+ else:
+ raise ValueError('Required property \'href\' not present in LoadBalancerListenerPolicy JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
+ else:
+ raise ValueError('Required property \'id\' not present in LoadBalancerListenerPolicy JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ else:
+ raise ValueError('Required property \'name\' not present in LoadBalancerListenerPolicy JSON')
+ if (priority := _dict.get('priority')) is not None:
+ args['priority'] = priority
+ else:
+ raise ValueError('Required property \'priority\' not present in LoadBalancerListenerPolicy JSON')
+ if (provisioning_status := _dict.get('provisioning_status')) is not None:
+ args['provisioning_status'] = provisioning_status
+ else:
+ raise ValueError('Required property \'provisioning_status\' not present in LoadBalancerListenerPolicy JSON')
+ if (rules := _dict.get('rules')) is not None:
+ args['rules'] = [LoadBalancerListenerPolicyRuleReference.from_dict(v) for v in rules]
+ else:
+ raise ValueError('Required property \'rules\' not present in LoadBalancerListenerPolicy JSON')
+ if (target := _dict.get('target')) is not None:
+ args['target'] = target
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a LoadBalancerLoggingPatch 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, 'datapath') and self.datapath is not None:
- if isinstance(self.datapath, dict):
- _dict['datapath'] = self.datapath
+ if hasattr(self, 'action') and self.action is not None:
+ _dict['action'] = self.action
+ if hasattr(self, 'created_at') and self.created_at is not None:
+ _dict['created_at'] = datetime_to_string(self.created_at)
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
+ if hasattr(self, 'id') and self.id is not None:
+ _dict['id'] = self.id
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ if hasattr(self, 'priority') and self.priority is not None:
+ _dict['priority'] = self.priority
+ if hasattr(self, 'provisioning_status') and self.provisioning_status is not None:
+ _dict['provisioning_status'] = self.provisioning_status
+ if hasattr(self, 'rules') and self.rules is not None:
+ rules_list = []
+ for v in self.rules:
+ if isinstance(v, dict):
+ rules_list.append(v)
+ else:
+ rules_list.append(v.to_dict())
+ _dict['rules'] = rules_list
+ if hasattr(self, 'target') and self.target is not None:
+ if isinstance(self.target, dict):
+ _dict['target'] = self.target
else:
- _dict['datapath'] = self.datapath.to_dict()
+ _dict['target'] = self.target.to_dict()
return _dict
def _to_dict(self):
@@ -55271,62 +58679,95 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this LoadBalancerLoggingPatch object."""
+ """Return a `str` version of this LoadBalancerListenerPolicy object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'LoadBalancerLoggingPatch') -> 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: 'LoadBalancerLoggingPatch') -> bool:
+ def __ne__(self, other: 'LoadBalancerListenerPolicy') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
+ class ActionEnum(str, Enum):
+ """
+ The policy action.
+ The enumerated values for this property are expected to expand in the future. When
+ processing this property, check for and log unknown values. Optionally halt
+ processing and surface the error, or bypass the policy on which the unexpected
+ property value was encountered.
+ """
-class LoadBalancerLoggingPrototype:
+ FORWARD = 'forward'
+ HTTPS_REDIRECT = 'https_redirect'
+ REDIRECT = 'redirect'
+ REJECT = 'reject'
+
+
+ class ProvisioningStatusEnum(str, Enum):
+ """
+ The provisioning status of this policy
+ The enumerated values for this property are expected to expand in the future. When
+ processing this property, check for and log unknown values. Optionally halt
+ processing and surface the error, or bypass the policy on which the unexpected
+ property value was encountered.
+ """
+
+ ACTIVE = 'active'
+ CREATE_PENDING = 'create_pending'
+ DELETE_PENDING = 'delete_pending'
+ FAILED = 'failed'
+ UPDATE_PENDING = 'update_pending'
+
+
+
+class LoadBalancerListenerPolicyCollection:
"""
- LoadBalancerLoggingPrototype.
+ LoadBalancerListenerPolicyCollection.
- :attr LoadBalancerLoggingDatapathPrototype datapath: (optional) The datapath
- logging configuration for this load balancer.
+ :param List[LoadBalancerListenerPolicy] policies: Collection of policies.
"""
def __init__(
self,
- *,
- datapath: 'LoadBalancerLoggingDatapathPrototype' = None,
+ policies: List['LoadBalancerListenerPolicy'],
) -> None:
"""
- Initialize a LoadBalancerLoggingPrototype object.
+ Initialize a LoadBalancerListenerPolicyCollection object.
- :param LoadBalancerLoggingDatapathPrototype datapath: (optional) The
- datapath logging configuration for this load balancer.
+ :param List[LoadBalancerListenerPolicy] policies: Collection of policies.
"""
- self.datapath = datapath
+ self.policies = policies
@classmethod
- def from_dict(cls, _dict: Dict) -> 'LoadBalancerLoggingPrototype':
- """Initialize a LoadBalancerLoggingPrototype object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerPolicyCollection':
+ """Initialize a LoadBalancerListenerPolicyCollection object from a json dictionary."""
args = {}
- if 'datapath' in _dict:
- args['datapath'] = LoadBalancerLoggingDatapathPrototype.from_dict(_dict.get('datapath'))
+ if (policies := _dict.get('policies')) is not None:
+ args['policies'] = [LoadBalancerListenerPolicy.from_dict(v) for v in policies]
+ else:
+ raise ValueError('Required property \'policies\' not present in LoadBalancerListenerPolicyCollection JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a LoadBalancerLoggingPrototype 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, 'datapath') and self.datapath is not None:
- if isinstance(self.datapath, dict):
- _dict['datapath'] = self.datapath
- else:
- _dict['datapath'] = self.datapath.to_dict()
+ if hasattr(self, 'policies') and self.policies is not None:
+ policies_list = []
+ for v in self.policies:
+ if isinstance(v, dict):
+ policies_list.append(v)
+ else:
+ policies_list.append(v.to_dict())
+ _dict['policies'] = policies_list
return _dict
def _to_dict(self):
@@ -55334,123 +58775,90 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this LoadBalancerLoggingPrototype object."""
+ """Return a `str` version of this LoadBalancerListenerPolicyCollection object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'LoadBalancerLoggingPrototype') -> 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: 'LoadBalancerLoggingPrototype') -> bool:
+ def __ne__(self, other: 'LoadBalancerListenerPolicyCollection') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class LoadBalancerPatch:
+class LoadBalancerListenerPolicyPatch:
"""
- LoadBalancerPatch.
+ LoadBalancerListenerPolicyPatch.
- :attr LoadBalancerDNSPatch dns: (optional) The DNS configuration for this load
- balancer.
- Specify `null` to remove the existing DNS configuration, which will remove all
- DNS `A`
- records for this load balancer that had been added to `zone`, and add equivalent
- `A`
- records to the public DNS zone `lb.appdomain.cloud`.
- :attr LoadBalancerLoggingPatch logging: (optional) The logging configuration to
- use for this load balancer.
- To activate logging, the load balancer profile must support the specified
- logging type.
- :attr str name: (optional) The name for this load balancer. The name must not be
- used by another load balancer in the VPC.
- :attr List[SubnetIdentity] subnets: (optional) The subnets to provision this
- load balancer in. The load balancer's availability will depend on the
- availability of the zones that the subnets reside in.
- The specified subnets must be in the same VPC as the existing subnets, and will
- completely replace the existing subnets.
- The load balancer must be in the `application` family.
+ :param str name: (optional) The name for this policy. The name must not be used
+ by another policy for the load balancer listener.
+ :param int priority: (optional) Priority of the policy. Lower value indicates
+ higher priority.
+ :param LoadBalancerListenerPolicyTargetPatch target: (optional) - If `action` is
+ `forward`, specify a `LoadBalancerPoolIdentity`.
+ - If `action` is `redirect`, specify a
+ `LoadBalancerListenerPolicyRedirectURLPatch`.
+ - If `action` is `https_redirect`, specify a
+ `LoadBalancerListenerPolicyHTTPSRedirectPatch`.
"""
def __init__(
self,
*,
- dns: 'LoadBalancerDNSPatch' = None,
- logging: 'LoadBalancerLoggingPatch' = None,
- name: str = None,
- subnets: List['SubnetIdentity'] = None,
+ name: Optional[str] = None,
+ priority: Optional[int] = None,
+ target: Optional['LoadBalancerListenerPolicyTargetPatch'] = None,
) -> None:
"""
- Initialize a LoadBalancerPatch object.
+ Initialize a LoadBalancerListenerPolicyPatch object.
- :param LoadBalancerDNSPatch dns: (optional) The DNS configuration for this
- load balancer.
- Specify `null` to remove the existing DNS configuration, which will remove
- all DNS `A`
- records for this load balancer that had been added to `zone`, and add
- equivalent `A`
- records to the public DNS zone `lb.appdomain.cloud`.
- :param LoadBalancerLoggingPatch logging: (optional) The logging
- configuration to use for this load balancer.
- To activate logging, the load balancer profile must support the specified
- logging type.
- :param str name: (optional) The name for this load balancer. The name must
- not be used by another load balancer in the VPC.
- :param List[SubnetIdentity] subnets: (optional) The subnets to provision
- this load balancer in. The load balancer's availability will depend on the
- availability of the zones that the subnets reside in.
- The specified subnets must be in the same VPC as the existing subnets, and
- will completely replace the existing subnets.
- The load balancer must be in the `application` family.
+ :param str name: (optional) The name for this policy. The name must not be
+ used by another policy for the load balancer listener.
+ :param int priority: (optional) Priority of the policy. Lower value
+ indicates higher priority.
+ :param LoadBalancerListenerPolicyTargetPatch target: (optional) - If
+ `action` is `forward`, specify a `LoadBalancerPoolIdentity`.
+ - If `action` is `redirect`, specify a
+ `LoadBalancerListenerPolicyRedirectURLPatch`.
+ - If `action` is `https_redirect`, specify a
+ `LoadBalancerListenerPolicyHTTPSRedirectPatch`.
"""
- self.dns = dns
- self.logging = logging
self.name = name
- self.subnets = subnets
+ self.priority = priority
+ self.target = target
@classmethod
- def from_dict(cls, _dict: Dict) -> 'LoadBalancerPatch':
- """Initialize a LoadBalancerPatch object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerPolicyPatch':
+ """Initialize a LoadBalancerListenerPolicyPatch object from a json dictionary."""
args = {}
- if 'dns' in _dict:
- args['dns'] = LoadBalancerDNSPatch.from_dict(_dict.get('dns'))
- if 'logging' in _dict:
- args['logging'] = LoadBalancerLoggingPatch.from_dict(_dict.get('logging'))
- if 'name' in _dict:
- args['name'] = _dict.get('name')
- if 'subnets' in _dict:
- args['subnets'] = _dict.get('subnets')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ if (priority := _dict.get('priority')) is not None:
+ args['priority'] = priority
+ if (target := _dict.get('target')) is not None:
+ args['target'] = target
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a LoadBalancerPatch 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, 'dns') and self.dns is not None:
- if isinstance(self.dns, dict):
- _dict['dns'] = self.dns
- else:
- _dict['dns'] = self.dns.to_dict()
- if hasattr(self, 'logging') and self.logging is not None:
- if isinstance(self.logging, dict):
- _dict['logging'] = self.logging
- else:
- _dict['logging'] = self.logging.to_dict()
if hasattr(self, 'name') and self.name is not None:
_dict['name'] = self.name
- if hasattr(self, 'subnets') and self.subnets is not None:
- subnets_list = []
- for v in self.subnets:
- if isinstance(v, dict):
- subnets_list.append(v)
- else:
- subnets_list.append(v.to_dict())
- _dict['subnets'] = subnets_list
+ 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):
@@ -55458,225 +58866,128 @@ 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 LoadBalancerListenerPolicyPatch object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'LoadBalancerPatch') -> 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: 'LoadBalancerPatch') -> bool:
+ def __ne__(self, other: 'LoadBalancerListenerPolicyPatch') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class LoadBalancerPool:
+class LoadBalancerListenerPolicyPrototype:
"""
- LoadBalancerPool.
+ LoadBalancerListenerPolicyPrototype.
- :attr str algorithm: The load balancing algorithm.
- :attr datetime created_at: The date and time that this pool was created.
- :attr LoadBalancerPoolHealthMonitor health_monitor: The health monitor of this
- pool.
- :attr str href: The pool's canonical URL.
- :attr str id: The unique identifier for this load balancer pool.
- :attr InstanceGroupReference instance_group: (optional) The instance group that
- is managing this pool.
- :attr List[LoadBalancerPoolMemberReference] members: (optional) The backend
- server members of the pool.
- :attr str name: The name for this load balancer pool. The name is unique across
- all pools for the load balancer.
- :attr str protocol: The protocol for this load balancer pool.
+ :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 pool on which the unexpected
- property value was encountered.
- :attr str provisioning_status: The provisioning status of this pool
- The enumerated values for this property are expected to expand in the future.
- When processing this property, check for and log unknown values. Optionally halt
- processing and surface the error, or bypass the pool on which the unexpected
- property value was encountered.
- :attr str proxy_protocol: The PROXY protocol setting for this pool:
- - `v1`: Enabled with version 1 (human-readable header format)
- - `v2`: Enabled with version 2 (binary header format)
- - `disabled`: Disabled
- Supported by load balancers in the `application` family (otherwise always
- `disabled`).
- :attr LoadBalancerPoolSessionPersistence session_persistence: (optional) The
- session persistence of this pool.
- The enumerated values for this property are expected to expand in the future.
- When
- processing this property, check for and log unknown values. Optionally halt
- processing and surface the error, or bypass the pool on which the unexpected
+ processing and surface the error, or bypass the policy on which the unexpected
property value was encountered.
+ :param str name: (optional) The name for this policy. The name must not be used
+ by another policy for the load balancer listener. If unspecified, the name will
+ be a hyphenated list of randomly-selected words.
+ :param int priority: Priority of the policy. Lower value indicates higher
+ priority.
+ :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`.
"""
def __init__(
self,
- algorithm: str,
- created_at: datetime,
- health_monitor: 'LoadBalancerPoolHealthMonitor',
- href: str,
- id: str,
- name: str,
- protocol: str,
- provisioning_status: str,
- proxy_protocol: str,
+ action: str,
+ priority: int,
*,
- instance_group: 'InstanceGroupReference' = None,
- members: List['LoadBalancerPoolMemberReference'] = None,
- session_persistence: 'LoadBalancerPoolSessionPersistence' = None,
+ name: Optional[str] = None,
+ rules: Optional[List['LoadBalancerListenerPolicyRulePrototype']] = None,
+ target: Optional['LoadBalancerListenerPolicyTargetPrototype'] = None,
) -> None:
"""
- Initialize a LoadBalancerPool object.
+ Initialize a LoadBalancerListenerPolicyPrototype object.
- :param str algorithm: The load balancing algorithm.
- :param datetime created_at: The date and time that this pool was created.
- :param LoadBalancerPoolHealthMonitor health_monitor: The health monitor of
- this pool.
- :param str href: The pool's canonical URL.
- :param str id: The unique identifier for this load balancer pool.
- :param str name: The name for this load balancer pool. The name is unique
- across all pools for the load balancer.
- :param str protocol: The protocol for this load balancer pool.
- The enumerated values for this property are expected to expand in the
- future. When processing this property, check for and log unknown values.
- Optionally halt processing and surface the error, or bypass the pool on
- which the unexpected property value was encountered.
- :param str provisioning_status: The provisioning status of this pool
+ :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 pool on
+ Optionally halt processing and surface the error, or bypass the policy on
which the unexpected property value was encountered.
- :param str proxy_protocol: The PROXY protocol setting for this pool:
- - `v1`: Enabled with version 1 (human-readable header format)
- - `v2`: Enabled with version 2 (binary header format)
- - `disabled`: Disabled
- Supported by load balancers in the `application` family (otherwise always
- `disabled`).
- :param InstanceGroupReference instance_group: (optional) The instance group
- that is managing this pool.
- :param List[LoadBalancerPoolMemberReference] members: (optional) The
- backend server members of the pool.
- :param LoadBalancerPoolSessionPersistence session_persistence: (optional)
- The session persistence of this pool.
- The enumerated values for this property are expected to expand in the
- future. When
- processing this property, check for and log unknown values. Optionally halt
- processing and surface the error, or bypass the pool on which the
- unexpected
- property value was encountered.
+ :param int priority: Priority of the policy. Lower value indicates higher
+ priority.
+ :param str name: (optional) The name for this policy. The name must not be
+ used by another policy for the load balancer listener. If unspecified, the
+ name will be a hyphenated list of randomly-selected words.
+ :param List[LoadBalancerListenerPolicyRulePrototype] rules: (optional) The
+ rule prototype objects for this policy.
+ :param LoadBalancerListenerPolicyTargetPrototype target: (optional) - If
+ `action` is `forward`, specify a `LoadBalancerPoolIdentity`.
+ - If `action` is `redirect`, specify a
+ `LoadBalancerListenerPolicyRedirectURLPrototype`.
+ - If `action` is `https_redirect`, specify a
+ `LoadBalancerListenerPolicyHTTPSRedirectPrototype`.
"""
- self.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.action = action
self.name = name
- self.protocol = protocol
- self.provisioning_status = provisioning_status
- self.proxy_protocol = proxy_protocol
- self.session_persistence = session_persistence
+ self.priority = priority
+ self.rules = rules
+ self.target = target
@classmethod
- def from_dict(cls, _dict: Dict) -> 'LoadBalancerPool':
- """Initialize a LoadBalancerPool object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerPolicyPrototype':
+ """Initialize a LoadBalancerListenerPolicyPrototype object from a json dictionary."""
args = {}
- if 'algorithm' in _dict:
- args['algorithm'] = _dict.get('algorithm')
- else:
- raise ValueError('Required property \'algorithm\' not present in LoadBalancerPool JSON')
- if 'created_at' in _dict:
- args['created_at'] = string_to_datetime(_dict.get('created_at'))
- else:
- raise ValueError('Required property \'created_at\' not present in LoadBalancerPool JSON')
- if 'health_monitor' in _dict:
- args['health_monitor'] = LoadBalancerPoolHealthMonitor.from_dict(_dict.get('health_monitor'))
- else:
- raise ValueError('Required property \'health_monitor\' not present in LoadBalancerPool JSON')
- if 'href' in _dict:
- args['href'] = _dict.get('href')
- else:
- raise ValueError('Required property \'href\' not present in LoadBalancerPool JSON')
- if 'id' in _dict:
- args['id'] = _dict.get('id')
- else:
- raise ValueError('Required property \'id\' not present in LoadBalancerPool JSON')
- if 'instance_group' in _dict:
- args['instance_group'] = InstanceGroupReference.from_dict(_dict.get('instance_group'))
- if 'members' in _dict:
- args['members'] = [LoadBalancerPoolMemberReference.from_dict(v) for v in _dict.get('members')]
- if 'name' in _dict:
- args['name'] = _dict.get('name')
- else:
- raise ValueError('Required property \'name\' not present in LoadBalancerPool JSON')
- if 'protocol' in _dict:
- args['protocol'] = _dict.get('protocol')
- else:
- raise ValueError('Required property \'protocol\' not present in LoadBalancerPool JSON')
- if 'provisioning_status' in _dict:
- args['provisioning_status'] = _dict.get('provisioning_status')
+ if (action := _dict.get('action')) is not None:
+ args['action'] = action
else:
- raise ValueError('Required property \'provisioning_status\' not present in LoadBalancerPool JSON')
- if 'proxy_protocol' in _dict:
- args['proxy_protocol'] = _dict.get('proxy_protocol')
+ raise ValueError('Required property \'action\' not present in LoadBalancerListenerPolicyPrototype JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ if (priority := _dict.get('priority')) is not None:
+ args['priority'] = priority
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'))
+ raise ValueError('Required property \'priority\' not present in LoadBalancerListenerPolicyPrototype JSON')
+ if (rules := _dict.get('rules')) is not None:
+ args['rules'] = [LoadBalancerListenerPolicyRulePrototype.from_dict(v) for v in rules]
+ if (target := _dict.get('target')) is not None:
+ args['target'] = target
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a LoadBalancerPool 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, 'algorithm') and self.algorithm is not None:
- _dict['algorithm'] = self.algorithm
- if hasattr(self, 'created_at') and self.created_at is not None:
- _dict['created_at'] = datetime_to_string(self.created_at)
- if hasattr(self, 'health_monitor') and self.health_monitor is not None:
- if isinstance(self.health_monitor, dict):
- _dict['health_monitor'] = self.health_monitor
- else:
- _dict['health_monitor'] = self.health_monitor.to_dict()
- if hasattr(self, 'href') and self.href is not None:
- _dict['href'] = self.href
- if hasattr(self, 'id') and self.id is not None:
- _dict['id'] = self.id
- if hasattr(self, 'instance_group') and self.instance_group is not None:
- if isinstance(self.instance_group, dict):
- _dict['instance_group'] = self.instance_group
- else:
- _dict['instance_group'] = self.instance_group.to_dict()
- if hasattr(self, 'members') and self.members is not None:
- members_list = []
- for v in self.members:
- if isinstance(v, dict):
- members_list.append(v)
- else:
- members_list.append(v.to_dict())
- _dict['members'] = members_list
+ if hasattr(self, '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, 'protocol') and self.protocol is not None:
- _dict['protocol'] = self.protocol
- if hasattr(self, 'provisioning_status') and self.provisioning_status is not None:
- _dict['provisioning_status'] = self.provisioning_status
- if hasattr(self, 'proxy_protocol') and self.proxy_protocol is not None:
- _dict['proxy_protocol'] = self.proxy_protocol
- if hasattr(self, 'session_persistence') and self.session_persistence is not None:
- if isinstance(self.session_persistence, dict):
- _dict['session_persistence'] = self.session_persistence
+ if hasattr(self, 'priority') and self.priority is not None:
+ _dict['priority'] = self.priority
+ if hasattr(self, 'rules') and self.rules is not None:
+ rules_list = []
+ for v in self.rules:
+ if isinstance(v, dict):
+ rules_list.append(v)
+ else:
+ rules_list.append(v.to_dict())
+ _dict['rules'] = rules_list
+ if hasattr(self, 'target') and self.target is not None:
+ if isinstance(self.target, dict):
+ _dict['target'] = self.target
else:
- _dict['session_persistence'] = self.session_persistence.to_dict()
+ _dict['target'] = self.target.to_dict()
return _dict
def _to_dict(self):
@@ -55684,120 +58995,113 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this LoadBalancerPool object."""
+ """Return a `str` version of this LoadBalancerListenerPolicyPrototype object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'LoadBalancerPool') -> 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: 'LoadBalancerPool') -> bool:
+ def __ne__(self, other: 'LoadBalancerListenerPolicyPrototype') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class AlgorithmEnum(str, Enum):
- """
- The load balancing algorithm.
- """
-
- LEAST_CONNECTIONS = 'least_connections'
- ROUND_ROBIN = 'round_robin'
- WEIGHTED_ROUND_ROBIN = 'weighted_round_robin'
-
-
- class ProtocolEnum(str, Enum):
- """
- The protocol for this load balancer pool.
- The enumerated values for this property are expected to expand in the future. When
- processing this property, check for and log unknown values. Optionally halt
- processing and surface the error, or bypass the pool on which the unexpected
- property value was encountered.
- """
-
- HTTP = 'http'
- HTTPS = 'https'
- TCP = 'tcp'
- UDP = 'udp'
-
-
- class ProvisioningStatusEnum(str, Enum):
+ class ActionEnum(str, Enum):
"""
- The provisioning status of this pool
+ 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 pool on which the unexpected
+ processing and surface the error, or bypass the policy on which the unexpected
property value was encountered.
"""
- ACTIVE = 'active'
- CREATE_PENDING = 'create_pending'
- DELETE_PENDING = 'delete_pending'
- FAILED = 'failed'
- UPDATE_PENDING = 'update_pending'
-
-
- class ProxyProtocolEnum(str, Enum):
- """
- The PROXY protocol setting for this pool:
- - `v1`: Enabled with version 1 (human-readable header format)
- - `v2`: Enabled with version 2 (binary header format)
- - `disabled`: Disabled
- Supported by load balancers in the `application` family (otherwise always
- `disabled`).
- """
-
- DISABLED = 'disabled'
- V1 = 'v1'
- V2 = 'v2'
+ FORWARD = 'forward'
+ HTTPS_REDIRECT = 'https_redirect'
+ REDIRECT = 'redirect'
+ REJECT = 'reject'
-class LoadBalancerPoolCollection:
+class LoadBalancerListenerPolicyReference:
"""
- LoadBalancerPoolCollection.
+ LoadBalancerListenerPolicyReference.
- :attr List[LoadBalancerPool] pools: Collection of pools.
+ :param LoadBalancerListenerPolicyReferenceDeleted deleted: (optional) If
+ present, this property indicates the referenced resource has been deleted, and
+ provides
+ some supplementary information.
+ :param str href: The listener policy's canonical URL.
+ :param str id: The policy's unique identifier.
+ :param str name: The name for this load balancer listener policy. The name is
+ unique across all policies for the load balancer listener.
"""
def __init__(
self,
- pools: List['LoadBalancerPool'],
+ href: str,
+ id: str,
+ name: str,
+ *,
+ deleted: Optional['LoadBalancerListenerPolicyReferenceDeleted'] = None,
) -> None:
"""
- Initialize a LoadBalancerPoolCollection object.
+ Initialize a LoadBalancerListenerPolicyReference object.
- :param List[LoadBalancerPool] pools: Collection of pools.
+ :param str href: The listener policy's canonical URL.
+ :param str id: The policy's unique identifier.
+ :param str name: The name for this load balancer listener policy. The name
+ is unique across all policies for the load balancer listener.
+ :param LoadBalancerListenerPolicyReferenceDeleted deleted: (optional) If
+ present, this property indicates the referenced resource has been deleted,
+ and provides
+ some supplementary information.
"""
- self.pools = pools
+ self.deleted = deleted
+ self.href = href
+ self.id = id
+ self.name = name
@classmethod
- def from_dict(cls, _dict: Dict) -> 'LoadBalancerPoolCollection':
- """Initialize a LoadBalancerPoolCollection object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerPolicyReference':
+ """Initialize a LoadBalancerListenerPolicyReference object from a json dictionary."""
args = {}
- if 'pools' in _dict:
- args['pools'] = [LoadBalancerPool.from_dict(v) for v in _dict.get('pools')]
+ if (deleted := _dict.get('deleted')) is not None:
+ args['deleted'] = LoadBalancerListenerPolicyReferenceDeleted.from_dict(deleted)
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'pools\' not present in LoadBalancerPoolCollection JSON')
+ raise ValueError('Required property \'href\' not present in LoadBalancerListenerPolicyReference JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
+ else:
+ raise ValueError('Required property \'id\' not present in LoadBalancerListenerPolicyReference JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ else:
+ raise ValueError('Required property \'name\' not present in LoadBalancerListenerPolicyReference JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a LoadBalancerPoolCollection object from a json dictionary."""
+ """Initialize a LoadBalancerListenerPolicyReference object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'pools') and self.pools is not None:
- pools_list = []
- for v in self.pools:
- if isinstance(v, dict):
- pools_list.append(v)
- else:
- pools_list.append(v.to_dict())
- _dict['pools'] = pools_list
+ if hasattr(self, 'deleted') and self.deleted is not None:
+ if isinstance(self.deleted, dict):
+ _dict['deleted'] = self.deleted
+ else:
+ _dict['deleted'] = self.deleted.to_dict()
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
+ if hasattr(self, 'id') and self.id is not None:
+ _dict['id'] = self.id
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
return _dict
def _to_dict(self):
@@ -55805,121 +59109,59 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this LoadBalancerPoolCollection object."""
+ """Return a `str` version of this LoadBalancerListenerPolicyReference object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'LoadBalancerPoolCollection') -> bool:
+ def __eq__(self, other: 'LoadBalancerListenerPolicyReference') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'LoadBalancerPoolCollection') -> bool:
+ def __ne__(self, other: 'LoadBalancerListenerPolicyReference') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class LoadBalancerPoolHealthMonitor:
+class LoadBalancerListenerPolicyReferenceDeleted:
"""
- LoadBalancerPoolHealthMonitor.
+ If present, this property indicates the referenced resource has been deleted, and
+ provides some supplementary information.
- :attr int delay: The seconds to wait between health checks.
- :attr int max_retries: The health check max retries.
- :attr int port: (optional) The health check port.
- If present, this overrides the pool member port values.
- :attr int timeout: The seconds to wait for a response to a health check.
- :attr str type: The protocol type to use for health checks.
- The enumerated values for this property are expected to expand in the future.
- When processing this property, check for and log unknown values. Optionally halt
- processing and surface the error, or bypass the health monitor on which the
- unexpected property value was encountered.
- :attr str url_path: (optional) The health check URL path. Applicable when `type`
- is `http` or `https`.
- Must be in the format of an [origin-form request
- target](https://tools.ietf.org/html/rfc7230#section-5.3.1).
+ :param str more_info: Link to documentation about deleted resources.
"""
def __init__(
self,
- delay: int,
- max_retries: int,
- timeout: int,
- type: str,
- *,
- port: int = None,
- url_path: str = None,
+ more_info: str,
) -> None:
"""
- Initialize a LoadBalancerPoolHealthMonitor object.
+ Initialize a LoadBalancerListenerPolicyReferenceDeleted object.
- :param int delay: The seconds to wait between health checks.
- :param int max_retries: The health check max retries.
- :param int timeout: The seconds to wait for a response to a health check.
- :param str type: The protocol type to use for health checks.
- The enumerated values for this property are expected to expand in the
- future. When processing this property, check for and log unknown values.
- Optionally halt processing and surface the error, or bypass the health
- monitor on which the unexpected property value was encountered.
- :param int port: (optional) The health check port.
- If present, this overrides the pool member port values.
- :param str url_path: (optional) The health check URL path. Applicable when
- `type` is `http` or `https`.
- Must be in the format of an [origin-form request
- target](https://tools.ietf.org/html/rfc7230#section-5.3.1).
+ :param str more_info: Link to documentation about deleted resources.
"""
- self.delay = delay
- self.max_retries = max_retries
- self.port = port
- self.timeout = timeout
- self.type = type
- self.url_path = url_path
+ self.more_info = more_info
@classmethod
- def from_dict(cls, _dict: Dict) -> 'LoadBalancerPoolHealthMonitor':
- """Initialize a LoadBalancerPoolHealthMonitor object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerPolicyReferenceDeleted':
+ """Initialize a LoadBalancerListenerPolicyReferenceDeleted 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')
+ if (more_info := _dict.get('more_info')) is not None:
+ args['more_info'] = more_info
else:
- raise ValueError('Required property \'max_retries\' not present in LoadBalancerPoolHealthMonitor JSON')
- if 'port' in _dict:
- args['port'] = _dict.get('port')
- if 'timeout' in _dict:
- args['timeout'] = _dict.get('timeout')
- else:
- raise ValueError('Required property \'timeout\' not present in LoadBalancerPoolHealthMonitor JSON')
- if 'type' in _dict:
- args['type'] = _dict.get('type')
- else:
- raise ValueError('Required property \'type\' not present in LoadBalancerPoolHealthMonitor JSON')
- if 'url_path' in _dict:
- args['url_path'] = _dict.get('url_path')
+ raise ValueError('Required property \'more_info\' not present in LoadBalancerListenerPolicyReferenceDeleted JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a LoadBalancerPoolHealthMonitor 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, 'delay') and self.delay is not None:
- _dict['delay'] = self.delay
- if hasattr(self, 'max_retries') and self.max_retries is not None:
- _dict['max_retries'] = self.max_retries
- if hasattr(self, 'port') and self.port is not None:
- _dict['port'] = self.port
- if hasattr(self, 'timeout') and self.timeout is not None:
- _dict['timeout'] = self.timeout
- if hasattr(self, 'type') and self.type is not None:
- _dict['type'] = self.type
- if hasattr(self, 'url_path') and self.url_path is not None:
- _dict['url_path'] = self.url_path
+ if hasattr(self, 'more_info') and self.more_info is not None:
+ _dict['more_info'] = self.more_info
return _dict
def _to_dict(self):
@@ -55927,133 +59169,155 @@ 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 LoadBalancerListenerPolicyReferenceDeleted object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'LoadBalancerPoolHealthMonitor') -> 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: 'LoadBalancerPoolHealthMonitor') -> bool:
+ def __ne__(self, other: 'LoadBalancerListenerPolicyReferenceDeleted') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class TypeEnum(str, Enum):
- """
- The protocol type to use for health checks.
- The enumerated values for this property are expected to expand in the future. When
- processing this property, check for and log unknown values. Optionally halt
- processing and surface the error, or bypass the health monitor on which the
- unexpected property value was encountered.
- """
-
- HTTP = 'http'
- HTTPS = 'https'
- TCP = 'tcp'
-
-
-class LoadBalancerPoolHealthMonitorPatch:
+class LoadBalancerListenerPolicyRule:
"""
- LoadBalancerPoolHealthMonitorPatch.
+ LoadBalancerListenerPolicyRule.
- :attr int delay: The seconds to wait between health checks. Must be greater
- than `timeout`.
- :attr int max_retries: The health check max retries.
- :attr int port: (optional) The health check port.
- If set, this overrides the pool member port values.
- Specify `null` to remove an existing health check port.
- :attr int timeout: The seconds to wait for a response to a health check. Must
- be less than `delay`.
- :attr str type: The protocol type to use for health checks.
- :attr str url_path: (optional) The health check URL path. Applicable when `type`
- is `http` or `https`.
- Must be in the format of an [origin-form request
- target](https://tools.ietf.org/html/rfc7230#section-5.3.1).
+ :param str condition: The condition of the rule.
+ :param datetime created_at: The date and time that this rule was created.
+ :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 rule's canonical URL.
+ :param str id: The rule's unique identifier.
+ :param str provisioning_status: The provisioning status of this rule
+ The enumerated values for this property are expected to expand in the future.
+ When processing this property, check for and log unknown values. Optionally halt
+ processing and surface the error, or bypass the rule on which the unexpected
+ property value was encountered.
+ :param str type: The type of the rule.
+ Body rules are applied to form-encoded request bodies using the `UTF-8`
+ character set.
+ :param str value: Value to be matched for rule condition.
+ If the rule type is `query` and the rule condition is not `matches_regex`, the
+ value must be percent-encoded.
"""
def __init__(
self,
- delay: int,
- max_retries: int,
- timeout: int,
+ condition: str,
+ created_at: datetime,
+ href: str,
+ id: str,
+ provisioning_status: str,
type: str,
+ value: str,
*,
- port: int = None,
- url_path: str = None,
+ field: Optional[str] = None,
) -> None:
"""
- Initialize a LoadBalancerPoolHealthMonitorPatch object.
+ Initialize a LoadBalancerListenerPolicyRule object.
- :param int delay: The seconds to wait between health checks. Must be
- greater than `timeout`.
- :param int max_retries: The health check max retries.
- :param int timeout: The seconds to wait for a response to a health check.
- Must be less than `delay`.
- :param str type: The protocol type to use for health checks.
- :param int port: (optional) The health check port.
- If set, this overrides the pool member port values.
- Specify `null` to remove an existing health check port.
- :param str url_path: (optional) The health check URL path. Applicable when
- `type` is `http` or `https`.
- Must be in the format of an [origin-form request
- target](https://tools.ietf.org/html/rfc7230#section-5.3.1).
+ :param str condition: The condition of the rule.
+ :param datetime created_at: The date and time that this rule was created.
+ :param str href: The rule's canonical URL.
+ :param str id: The rule's unique identifier.
+ :param str provisioning_status: The provisioning status of this rule
+ The enumerated values for this property are expected to expand in the
+ future. When processing this property, check for and log unknown values.
+ Optionally halt processing and surface the error, or bypass the rule on
+ which the unexpected property value was encountered.
+ :param str type: The type of the rule.
+ Body rules are applied to form-encoded request bodies using the `UTF-8`
+ character set.
+ :param str value: Value to be matched for rule condition.
+ If the rule type is `query` and the rule condition is not `matches_regex`,
+ the value must be percent-encoded.
+ :param str field: (optional) The field. This is applicable to `header`,
+ `query`, and `body` rule types.
+ If the rule type is `header`, this property is required.
+ If the rule type is `query`, this is optional. If specified and the rule
+ condition is not
+ `matches_regex`, the value must be percent-encoded.
+ If the rule type is `body`, this is optional.
"""
- self.delay = delay
- self.max_retries = max_retries
- self.port = port
- self.timeout = timeout
+ 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.url_path = url_path
+ self.value = value
@classmethod
- def from_dict(cls, _dict: Dict) -> 'LoadBalancerPoolHealthMonitorPatch':
- """Initialize a LoadBalancerPoolHealthMonitorPatch object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerPolicyRule':
+ """Initialize a LoadBalancerListenerPolicyRule object from a json dictionary."""
args = {}
- if 'delay' in _dict:
- args['delay'] = _dict.get('delay')
+ if (condition := _dict.get('condition')) is not None:
+ args['condition'] = condition
else:
- raise ValueError('Required property \'delay\' not present in LoadBalancerPoolHealthMonitorPatch JSON')
- if 'max_retries' in _dict:
- args['max_retries'] = _dict.get('max_retries')
+ raise ValueError('Required property \'condition\' not present in LoadBalancerListenerPolicyRule JSON')
+ if (created_at := _dict.get('created_at')) is not None:
+ args['created_at'] = string_to_datetime(created_at)
else:
- raise ValueError('Required property \'max_retries\' not present in LoadBalancerPoolHealthMonitorPatch JSON')
- if 'port' in _dict:
- args['port'] = _dict.get('port')
- if 'timeout' in _dict:
- args['timeout'] = _dict.get('timeout')
+ raise ValueError('Required property \'created_at\' not present in LoadBalancerListenerPolicyRule JSON')
+ if (field := _dict.get('field')) is not None:
+ args['field'] = field
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'timeout\' not present in LoadBalancerPoolHealthMonitorPatch JSON')
- if 'type' in _dict:
- args['type'] = _dict.get('type')
+ raise ValueError('Required property \'href\' not present in LoadBalancerListenerPolicyRule JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
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 \'id\' not present in LoadBalancerListenerPolicyRule JSON')
+ if (provisioning_status := _dict.get('provisioning_status')) is not None:
+ args['provisioning_status'] = provisioning_status
+ else:
+ raise ValueError('Required property \'provisioning_status\' not present in LoadBalancerListenerPolicyRule JSON')
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
+ else:
+ raise ValueError('Required property \'type\' not present in LoadBalancerListenerPolicyRule JSON')
+ if (value := _dict.get('value')) is not None:
+ args['value'] = value
+ else:
+ raise ValueError('Required property \'value\' not present in LoadBalancerListenerPolicyRule JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a LoadBalancerPoolHealthMonitorPatch 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, '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, '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, 'url_path') and self.url_path is not None:
- _dict['url_path'] = self.url_path
+ if hasattr(self, 'value') and self.value is not None:
+ _dict['value'] = self.value
return _dict
def _to_dict(self):
@@ -56061,127 +59325,104 @@ 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 LoadBalancerListenerPolicyRule object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'LoadBalancerPoolHealthMonitorPatch') -> 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: 'LoadBalancerPoolHealthMonitorPatch') -> bool:
+ def __ne__(self, other: 'LoadBalancerListenerPolicyRule') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class TypeEnum(str, Enum):
+ class ConditionEnum(str, Enum):
"""
- The protocol type to use for health checks.
+ The condition of the rule.
"""
- HTTP = 'http'
- HTTPS = 'https'
- TCP = 'tcp'
+ CONTAINS = 'contains'
+ EQUALS = 'equals'
+ MATCHES_REGEX = 'matches_regex'
+ class ProvisioningStatusEnum(str, Enum):
+ """
+ The provisioning status of this rule
+ The enumerated values for this property are expected to expand in the future. When
+ processing this property, check for and log unknown values. Optionally halt
+ processing and surface the error, or bypass the rule on which the unexpected
+ property value was encountered.
+ """
-class LoadBalancerPoolHealthMonitorPrototype:
- """
- LoadBalancerPoolHealthMonitorPrototype.
+ ACTIVE = 'active'
+ CREATE_PENDING = 'create_pending'
+ DELETE_PENDING = 'delete_pending'
+ FAILED = 'failed'
+ UPDATE_PENDING = 'update_pending'
- :attr int delay: The seconds to wait between health checks. Must be greater
- than `timeout`.
- :attr int max_retries: The health check max retries.
- :attr int port: (optional) The health check port.
- If specified, this overrides the pool member port values.
- :attr int timeout: The seconds to wait for a response to a health check. Must
- be less than `delay`.
- :attr str type: The protocol type to use for health checks.
- :attr str url_path: (optional) The health check URL path. Applicable when `type`
- is `http` or `https`.
- Must be in the format of an [origin-form request
- target](https://tools.ietf.org/html/rfc7230#section-5.3.1).
- """
- def __init__(
- self,
- delay: int,
- max_retries: int,
- timeout: int,
- type: str,
- *,
- port: int = None,
- url_path: str = None,
- ) -> None:
+ class TypeEnum(str, Enum):
+ """
+ The type of the rule.
+ Body rules are applied to form-encoded request bodies using the `UTF-8` character
+ set.
"""
- Initialize a LoadBalancerPoolHealthMonitorPrototype object.
- :param int delay: The seconds to wait between health checks. Must be
- greater than `timeout`.
- :param int max_retries: The health check max retries.
- :param int timeout: The seconds to wait for a response to a health check.
- Must be less than `delay`.
- :param str type: The protocol type to use for health checks.
- :param int port: (optional) The health check port.
- If specified, this overrides the pool member port values.
- :param str url_path: (optional) The health check URL path. Applicable when
- `type` is `http` or `https`.
- Must be in the format of an [origin-form request
- target](https://tools.ietf.org/html/rfc7230#section-5.3.1).
+ BODY = 'body'
+ HEADER = 'header'
+ HOSTNAME = 'hostname'
+ PATH = 'path'
+ QUERY = 'query'
+
+
+
+class LoadBalancerListenerPolicyRuleCollection:
+ """
+ LoadBalancerListenerPolicyRuleCollection.
+
+ :param List[LoadBalancerListenerPolicyRule] rules: Collection of rules.
+ """
+
+ def __init__(
+ self,
+ rules: List['LoadBalancerListenerPolicyRule'],
+ ) -> None:
"""
- self.delay = delay
- self.max_retries = max_retries
- self.port = port
- self.timeout = timeout
- self.type = type
- self.url_path = url_path
+ Initialize a LoadBalancerListenerPolicyRuleCollection object.
+
+ :param List[LoadBalancerListenerPolicyRule] rules: Collection of rules.
+ """
+ self.rules = rules
@classmethod
- def from_dict(cls, _dict: Dict) -> 'LoadBalancerPoolHealthMonitorPrototype':
- """Initialize a LoadBalancerPoolHealthMonitorPrototype object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerPolicyRuleCollection':
+ """Initialize a LoadBalancerListenerPolicyRuleCollection object from a json dictionary."""
args = {}
- if 'delay' in _dict:
- args['delay'] = _dict.get('delay')
- else:
- raise ValueError('Required property \'delay\' not present in LoadBalancerPoolHealthMonitorPrototype JSON')
- if 'max_retries' in _dict:
- args['max_retries'] = _dict.get('max_retries')
- else:
- raise ValueError('Required property \'max_retries\' not present in LoadBalancerPoolHealthMonitorPrototype JSON')
- if 'port' in _dict:
- args['port'] = _dict.get('port')
- if 'timeout' in _dict:
- args['timeout'] = _dict.get('timeout')
- else:
- raise ValueError('Required property \'timeout\' not present in LoadBalancerPoolHealthMonitorPrototype JSON')
- if 'type' in _dict:
- args['type'] = _dict.get('type')
+ if (rules := _dict.get('rules')) is not None:
+ args['rules'] = [LoadBalancerListenerPolicyRule.from_dict(v) for v in rules]
else:
- raise ValueError('Required property \'type\' not present in LoadBalancerPoolHealthMonitorPrototype JSON')
- if 'url_path' in _dict:
- args['url_path'] = _dict.get('url_path')
+ raise ValueError('Required property \'rules\' not present in LoadBalancerListenerPolicyRuleCollection JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a LoadBalancerPoolHealthMonitorPrototype 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, '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, 'rules') and self.rules is not None:
+ rules_list = []
+ for v in self.rules:
+ if isinstance(v, dict):
+ rules_list.append(v)
+ else:
+ rules_list.append(v.to_dict())
+ _dict['rules'] = rules_list
return _dict
def _to_dict(self):
@@ -56189,89 +59430,101 @@ 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 LoadBalancerListenerPolicyRuleCollection object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'LoadBalancerPoolHealthMonitorPrototype') -> 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: 'LoadBalancerPoolHealthMonitorPrototype') -> bool:
+ def __ne__(self, other: 'LoadBalancerListenerPolicyRuleCollection') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class TypeEnum(str, Enum):
- """
- The protocol type to use for health checks.
- """
-
- HTTP = 'http'
- HTTPS = 'https'
- TCP = 'tcp'
-
-
-
-class LoadBalancerPoolIdentity:
- """
- Identifies a load balancer pool by a unique property.
-
- """
-
- def __init__(
- self,
- ) -> None:
- """
- 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 LoadBalancerPoolIdentityByName:
+class LoadBalancerListenerPolicyRulePatch:
"""
- LoadBalancerPoolIdentityByName.
+ LoadBalancerListenerPolicyRulePatch.
- :attr str name: The name for this load balancer pool. The name is unique across
- all pools for the load balancer.
+ :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.
"""
def __init__(
self,
- name: str,
+ *,
+ condition: Optional[str] = None,
+ field: Optional[str] = None,
+ type: Optional[str] = None,
+ value: Optional[str] = None,
) -> None:
"""
- Initialize a LoadBalancerPoolIdentityByName object.
+ Initialize a LoadBalancerListenerPolicyRulePatch object.
- :param str name: The name for this load balancer pool. The name is unique
- across all pools for the load balancer.
+ :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) -> 'LoadBalancerPoolIdentityByName':
- """Initialize a LoadBalancerPoolIdentityByName 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')
- else:
- raise ValueError('Required property \'name\' not present in LoadBalancerPoolIdentityByName JSON')
+ if (condition := _dict.get('condition')) is not None:
+ args['condition'] = condition
+ if (field := _dict.get('field')) is not None:
+ args['field'] = field
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
+ if (value := _dict.get('value')) is not None:
+ args['value'] = value
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a LoadBalancerPoolIdentityByName 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):
@@ -56279,165 +59532,131 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this LoadBalancerPoolIdentityByName object."""
+ """Return a `str` version of this LoadBalancerListenerPolicyRulePatch object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'LoadBalancerPoolIdentityByName') -> 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: 'LoadBalancerPoolIdentityByName') -> bool:
+ def __ne__(self, other: 'LoadBalancerListenerPolicyRulePatch') -> 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.
+ """
-class LoadBalancerPoolMember:
+ 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:
"""
- LoadBalancerPoolMember.
+ LoadBalancerListenerPolicyRulePrototype.
- :attr datetime created_at: The date and time that this member was created.
- :attr str health: Health of the server member in the pool.
- :attr str href: The member's canonical URL.
- :attr str id: The unique identifier for this load balancer pool member.
- :attr int port: The port the member will receive load balancer traffic on.
- Applies only to load balancer traffic received on a listener with a single port.
- (If the traffic is received on a listener with a port range, the member will
- receive the traffic on the same port the listener received it on.)
- This port will also be used for health checks unless the `port` property of
- `health_monitor` property is specified.
- :attr str provisioning_status: The provisioning status of this member
- The enumerated values for this property are expected to expand in the future.
- When processing this property, check for and log unknown values. Optionally halt
- processing and surface the error, or bypass the pool member on which the
- unexpected property value was encountered.
- :attr LoadBalancerPoolMemberTarget target: The pool member target. Load
- balancers in the `network` family support virtual server
- instances. Load balancers in the `application` family support IP addresses. If
- the load
- balancer has route mode enabled, the member must be in a zone the load balancer
- has a
- subnet in.
- :attr int weight: (optional) Weight of the server member. Applicable only if the
- pool algorithm is
- `weighted_round_robin`.
+ :param str condition: 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: 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.
"""
def __init__(
self,
- created_at: datetime,
- health: str,
- href: str,
- id: str,
- port: int,
- provisioning_status: str,
- target: 'LoadBalancerPoolMemberTarget',
+ condition: str,
+ type: str,
+ value: str,
*,
- weight: int = None,
+ field: Optional[str] = None,
) -> None:
"""
- Initialize a LoadBalancerPoolMember object.
+ Initialize a LoadBalancerListenerPolicyRulePrototype object.
- :param datetime created_at: The date and time that this member was created.
- :param str health: Health of the server member in the pool.
- :param str href: The member's canonical URL.
- :param str id: The unique identifier for this load balancer pool member.
- :param int port: The port the member will receive load balancer traffic on.
- Applies only to load balancer traffic received on a listener with a single
- port. (If the traffic is received on a listener with a port range, the
- member will receive the traffic on the same port the listener received it
- on.)
- This port will also be used for health checks unless the `port` property of
- `health_monitor` property is specified.
- :param str provisioning_status: The provisioning status of this member
- The enumerated values for this property are expected to expand in the
- future. When processing this property, check for and log unknown values.
- Optionally halt processing and surface the error, or bypass the pool member
- on which the unexpected property value was encountered.
- :param LoadBalancerPoolMemberTarget target: The pool member target. Load
- balancers in the `network` family support virtual server
- instances. Load balancers in the `application` family support IP addresses.
- If the load
- balancer has route mode enabled, the member must be in a zone the load
- balancer has a
- subnet in.
- :param int weight: (optional) Weight of the server member. Applicable only
- if the pool algorithm is
- `weighted_round_robin`.
+ :param str 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.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
+ self.condition = condition
+ self.field = field
+ self.type = type
+ self.value = value
@classmethod
- def from_dict(cls, _dict: Dict) -> 'LoadBalancerPoolMember':
- """Initialize a LoadBalancerPoolMember object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerPolicyRulePrototype':
+ """Initialize a LoadBalancerListenerPolicyRulePrototype 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')
+ if (condition := _dict.get('condition')) is not None:
+ args['condition'] = condition
else:
- 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')
+ raise ValueError('Required property \'condition\' not present in LoadBalancerListenerPolicyRulePrototype JSON')
+ if (field := _dict.get('field')) is not None:
+ args['field'] = field
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
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 \'type\' not present in LoadBalancerListenerPolicyRulePrototype JSON')
+ if (value := _dict.get('value')) is not None:
+ args['value'] = value
else:
- raise ValueError('Required property \'target\' not present in LoadBalancerPoolMember JSON')
- if 'weight' in _dict:
- args['weight'] = _dict.get('weight')
+ raise ValueError('Required property \'value\' not present in LoadBalancerListenerPolicyRulePrototype JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a LoadBalancerPoolMember object from a json dictionary."""
+ """Initialize a LoadBalancerListenerPolicyRulePrototype object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, '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
+ 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):
@@ -56445,90 +59664,110 @@ 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 LoadBalancerListenerPolicyRulePrototype object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'LoadBalancerPoolMember') -> bool:
+ def __eq__(self, other: 'LoadBalancerListenerPolicyRulePrototype') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'LoadBalancerPoolMember') -> bool:
+ def __ne__(self, other: 'LoadBalancerListenerPolicyRulePrototype') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class HealthEnum(str, Enum):
+ class ConditionEnum(str, Enum):
"""
- Health of the server member in the pool.
+ The condition of the rule.
"""
- FAULTED = 'faulted'
- OK = 'ok'
- UNKNOWN = 'unknown'
+ CONTAINS = 'contains'
+ EQUALS = 'equals'
+ MATCHES_REGEX = 'matches_regex'
- class ProvisioningStatusEnum(str, Enum):
+ class TypeEnum(str, Enum):
"""
- The provisioning status of this member
- The enumerated values for this property are expected to expand in the future. When
- processing this property, check for and log unknown values. Optionally halt
- processing and surface the error, or bypass the pool member on which the
- unexpected property value was encountered.
+ The type of the rule.
+ Body rules are applied to form-encoded request bodies using the `UTF-8` character
+ set.
"""
- ACTIVE = 'active'
- CREATE_PENDING = 'create_pending'
- DELETE_PENDING = 'delete_pending'
- FAILED = 'failed'
- UPDATE_PENDING = 'update_pending'
+ BODY = 'body'
+ HEADER = 'header'
+ HOSTNAME = 'hostname'
+ PATH = 'path'
+ QUERY = 'query'
-class LoadBalancerPoolMemberCollection:
+class LoadBalancerListenerPolicyRuleReference:
"""
- LoadBalancerPoolMemberCollection.
+ LoadBalancerListenerPolicyRuleReference.
- :attr List[LoadBalancerPoolMember] members: Collection of members.
+ :param LoadBalancerListenerPolicyRuleReferenceDeleted deleted: (optional) If
+ present, this property indicates the referenced resource has been deleted, and
+ provides
+ some supplementary information.
+ :param str href: The rule's canonical URL.
+ :param str id: The rule's unique identifier.
"""
def __init__(
self,
- members: List['LoadBalancerPoolMember'],
+ href: str,
+ id: str,
+ *,
+ deleted: Optional['LoadBalancerListenerPolicyRuleReferenceDeleted'] = None,
) -> None:
"""
- Initialize a LoadBalancerPoolMemberCollection object.
+ Initialize a LoadBalancerListenerPolicyRuleReference object.
- :param List[LoadBalancerPoolMember] members: Collection of members.
+ :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.members = members
+ self.deleted = deleted
+ self.href = href
+ self.id = id
@classmethod
- def from_dict(cls, _dict: Dict) -> 'LoadBalancerPoolMemberCollection':
- """Initialize a LoadBalancerPoolMemberCollection object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerPolicyRuleReference':
+ """Initialize a LoadBalancerListenerPolicyRuleReference object from a json dictionary."""
args = {}
- if 'members' in _dict:
- args['members'] = [LoadBalancerPoolMember.from_dict(v) for v in _dict.get('members')]
+ if (deleted := _dict.get('deleted')) is not None:
+ args['deleted'] = LoadBalancerListenerPolicyRuleReferenceDeleted.from_dict(deleted)
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'members\' not present in LoadBalancerPoolMemberCollection JSON')
+ raise ValueError('Required property \'href\' not present in LoadBalancerListenerPolicyRuleReference JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
+ else:
+ raise ValueError('Required property \'id\' not present in LoadBalancerListenerPolicyRuleReference JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a LoadBalancerPoolMemberCollection 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, 'members') and self.members is not None:
- members_list = []
- for v in self.members:
- if isinstance(v, dict):
- members_list.append(v)
- else:
- members_list.append(v.to_dict())
- _dict['members'] = members_list
+ if hasattr(self, 'deleted') and self.deleted is not None:
+ if isinstance(self.deleted, dict):
+ _dict['deleted'] = self.deleted
+ else:
+ _dict['deleted'] = self.deleted.to_dict()
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
+ if hasattr(self, 'id') and self.id is not None:
+ _dict['id'] = self.id
return _dict
def _to_dict(self):
@@ -56536,108 +59775,59 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this LoadBalancerPoolMemberCollection object."""
+ """Return a `str` version of this LoadBalancerListenerPolicyRuleReference object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'LoadBalancerPoolMemberCollection') -> 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: 'LoadBalancerPoolMemberCollection') -> bool:
+ def __ne__(self, other: 'LoadBalancerListenerPolicyRuleReference') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class LoadBalancerPoolMemberPatch:
+class LoadBalancerListenerPolicyRuleReferenceDeleted:
"""
- LoadBalancerPoolMemberPatch.
+ If present, this property indicates the referenced resource has been deleted, and
+ provides some supplementary information.
- :attr int port: (optional) The port the member will receive load balancer
- traffic on. Applies only to load balancer traffic received on a listener with a
- single port. (If the traffic is received on a listener with a port range, the
- member will receive the traffic on the same port the listener received it on.)
- This port will also be used for health checks unless the `port` property of
- `health_monitor` property is specified.
- The port must be unique across all members for all pools associated with this
- pool's listener.
- :attr LoadBalancerPoolMemberTargetPrototype target: (optional) The pool member
- target. Load balancers in the `network` family support virtual server
- instances. Load balancers in the `application` family support IP addresses. If
- the load
- balancer has route mode enabled, the member must be in a zone the load balancer
- has a
- subnet in.
- :attr int weight: (optional) Weight of the server member. Applicable only if the
- pool algorithm is
- `weighted_round_robin`.
+ :param str more_info: Link to documentation about deleted resources.
"""
def __init__(
self,
- *,
- port: int = None,
- target: 'LoadBalancerPoolMemberTargetPrototype' = None,
- weight: int = None,
+ more_info: str,
) -> None:
"""
- Initialize a LoadBalancerPoolMemberPatch object.
+ Initialize a LoadBalancerListenerPolicyRuleReferenceDeleted object.
- :param int port: (optional) The port the member will receive load balancer
- traffic on. Applies only to load balancer traffic received on a listener
- with a single port. (If the traffic is received on a listener with a port
- range, the member will receive the traffic on the same port the listener
- received it on.)
- This port will also be used for health checks unless the `port` property of
- `health_monitor` property is specified.
- The port must be unique across all members for all pools associated with
- this pool's listener.
- :param LoadBalancerPoolMemberTargetPrototype target: (optional) The pool
- member target. Load balancers in the `network` family support virtual
- server
- instances. Load balancers in the `application` family support IP addresses.
- If the load
- balancer has route mode enabled, the member must be in a zone the load
- balancer has a
- subnet in.
- :param int weight: (optional) Weight of the server member. Applicable only
- if the pool algorithm is
- `weighted_round_robin`.
+ :param str more_info: Link to documentation about deleted resources.
"""
- self.port = port
- self.target = target
- self.weight = weight
+ self.more_info = more_info
@classmethod
- def from_dict(cls, _dict: Dict) -> 'LoadBalancerPoolMemberPatch':
- """Initialize a LoadBalancerPoolMemberPatch object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerPolicyRuleReferenceDeleted':
+ """Initialize a LoadBalancerListenerPolicyRuleReferenceDeleted object from a json dictionary."""
args = {}
- if 'port' in _dict:
- args['port'] = _dict.get('port')
- if 'target' in _dict:
- args['target'] = _dict.get('target')
- if 'weight' in _dict:
- args['weight'] = _dict.get('weight')
+ if (more_info := _dict.get('more_info')) is not None:
+ args['more_info'] = more_info
+ else:
+ raise ValueError('Required property \'more_info\' not present in LoadBalancerListenerPolicyRuleReferenceDeleted JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a LoadBalancerPoolMemberPatch object from a json dictionary."""
+ """Initialize a LoadBalancerListenerPolicyRuleReferenceDeleted object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, '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):
@@ -56645,111 +59835,315 @@ 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 LoadBalancerListenerPolicyRuleReferenceDeleted object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'LoadBalancerPoolMemberPatch') -> 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: 'LoadBalancerPoolMemberPatch') -> bool:
+ def __ne__(self, other: 'LoadBalancerListenerPolicyRuleReferenceDeleted') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class LoadBalancerPoolMemberPrototype:
+class LoadBalancerListenerPolicyTarget:
"""
- LoadBalancerPoolMemberPrototype.
+ - 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 int port: The port the member will receive load balancer traffic on.
- Applies only to load balancer traffic received on a listener with a single port.
- (If the traffic is received on a listener with a port range, the member will
- receive the traffic on the same port the listener received it on.)
- This port will also be used for health checks unless the `port` property of
- `health_monitor` property is specified.
- The port must be unique across all members for all pools associated with this
- pool's listener.
- :attr LoadBalancerPoolMemberTargetPrototype target: The pool member target. Load
- balancers in the `network` family support virtual server
- instances. Load balancers in the `application` family support IP addresses. If
- the load
- balancer has route mode enabled, the member must be in a zone the load balancer
- has a
- subnet in.
- :attr int weight: (optional) Weight of the server member. Applicable only if the
- pool algorithm is
- `weighted_round_robin`.
"""
def __init__(
self,
- port: int,
- target: 'LoadBalancerPoolMemberTargetPrototype',
+ ) -> 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.
+
+ :param bool accept_proxy_protocol: (optional) If set to `true`, this listener
+ will accept and forward PROXY protocol information. Supported by load balancers
+ in the `application` family (otherwise always `false`). Additional restrictions:
+ - If this listener has `https_redirect` specified, its `accept_proxy_protocol`
+ value must
+ match the `accept_proxy_protocol` value of the `https_redirect` listener.
+ - If this listener is the target of another listener's `https_redirect`, its
+ `accept_proxy_protocol` value must match that listener's
+ `accept_proxy_protocol` value.
+ :param CertificateInstanceIdentity certificate_instance: (optional) The
+ certificate instance to use for SSL termination. The listener must have a
+ `protocol` of `https`.
+ :param int connection_limit: (optional) The connection limit of the listener.
+ :param LoadBalancerPoolIdentityByName default_pool: (optional) The default pool
+ for this listener. If specified, the pool must:
+ - Belong to this load balancer.
+ - Have the same `protocol` as this listener, or have a compatible protocol.
+ At present, the compatible protocols are `http` and `https`.
+ - Not already be the `default_pool` for another listener.
+ If unspecified, this listener will be created with no default pool, but one may
+ be
+ subsequently set.
+ :param LoadBalancerListenerHTTPSRedirectPrototype https_redirect: (optional) The
+ target listener that requests will be redirected to. This listener must have a
+ `protocol` of `http`, and the target listener must have a `protocol` of `https`.
+ :param int idle_connection_timeout: (optional) The idle connection timeout of
+ the listener in seconds. Supported for load balancers in the `application`
+ family.
+ :param int port: (optional) The listener port number, or the inclusive lower
+ bound of the port range. Each listener in the load balancer must have a unique
+ `port` and `protocol` combination.
+ Not supported for load balancers operating with route mode enabled.
+ :param int port_max: (optional) The inclusive upper bound of the range of ports
+ used by this listener. Must not be less than `port_min`.
+ At present, only load balancers operating with route mode enabled, and public
+ load balancers in the `network` family support different values for `port_min`
+ and
+ `port_max`. When route mode is enabled, the value `65535` must be specified.
+ The specified port range must not overlap with port ranges used by other
+ listeners for this load balancer using the same protocol.
+ :param int port_min: (optional) The inclusive lower bound of the range of ports
+ used by this listener. Must not be greater than `port_max`.
+ At present, only load balancers operating with route mode enabled, and public
+ load balancers in the `network` family support different values for `port_min`
+ and
+ `port_max`. When route mode is enabled, the value `1` must be specified.
+ The specified port range must not overlap with port ranges used by other
+ listeners for this load balancer using the same protocol.
+ :param str protocol: The listener protocol. Each listener in the load balancer
+ must have a unique `port` and `protocol` combination.
+ Load balancers in the `network` family support `tcp` and `udp` (if
+ `udp_supported` is `true`). Load balancers in the `application` family support
+ `tcp`, `http` and
+ `https`.
+ Additional restrictions:
+ - If `default_pool` is set, the pool's protocol must match, or be compatible
+ with
+ the listener's protocol. At present, the compatible protocols are `http` and
+ `https`.
+ - If `https_redirect` is set, the protocol must be `http`.
+ """
+
+ def __init__(
+ self,
+ protocol: str,
*,
- weight: int = None,
+ accept_proxy_protocol: Optional[bool] = None,
+ certificate_instance: Optional['CertificateInstanceIdentity'] = None,
+ connection_limit: Optional[int] = None,
+ default_pool: Optional['LoadBalancerPoolIdentityByName'] = None,
+ https_redirect: Optional['LoadBalancerListenerHTTPSRedirectPrototype'] = None,
+ idle_connection_timeout: Optional[int] = None,
+ port: Optional[int] = None,
+ port_max: Optional[int] = None,
+ port_min: Optional[int] = None,
) -> None:
"""
- Initialize a LoadBalancerPoolMemberPrototype object.
+ Initialize a LoadBalancerListenerPrototypeLoadBalancerContext object.
- :param int port: The port the member will receive load balancer traffic on.
- Applies only to load balancer traffic received on a listener with a single
- port. (If the traffic is received on a listener with a port range, the
- member will receive the traffic on the same port the listener received it
- on.)
- This port will also be used for health checks unless the `port` property of
- `health_monitor` property is specified.
- The port must be unique across all members for all pools associated with
- this pool's listener.
- :param LoadBalancerPoolMemberTargetPrototype target: The pool member
- target. Load balancers in the `network` family support virtual server
- instances. Load balancers in the `application` family support IP addresses.
- If the load
- balancer has route mode enabled, the member must be in a zone the load
- balancer has a
- subnet in.
- :param int weight: (optional) Weight of the server member. Applicable only
- if the pool algorithm is
- `weighted_round_robin`.
+ :param str protocol: The listener protocol. Each listener in the load
+ balancer must have a unique `port` and `protocol` combination.
+ Load balancers in the `network` family support `tcp` and `udp` (if
+ `udp_supported` is `true`). Load balancers in the `application` family
+ support `tcp`, `http` and
+ `https`.
+ Additional restrictions:
+ - If `default_pool` is set, the pool's protocol must match, or be
+ compatible with
+ the listener's protocol. At present, the compatible protocols are `http`
+ and
+ `https`.
+ - If `https_redirect` is set, the protocol must be `http`.
+ :param bool accept_proxy_protocol: (optional) If set to `true`, this
+ listener will accept and forward PROXY protocol information. Supported by
+ load balancers in the `application` family (otherwise always `false`).
+ Additional restrictions:
+ - If this listener has `https_redirect` specified, its
+ `accept_proxy_protocol` value must
+ match the `accept_proxy_protocol` value of the `https_redirect` listener.
+ - If this listener is the target of another listener's `https_redirect`,
+ its
+ `accept_proxy_protocol` value must match that listener's
+ `accept_proxy_protocol` value.
+ :param CertificateInstanceIdentity certificate_instance: (optional) The
+ certificate instance to use for SSL termination. The listener must have a
+ `protocol` of `https`.
+ :param int connection_limit: (optional) The connection limit of the
+ listener.
+ :param LoadBalancerPoolIdentityByName default_pool: (optional) The default
+ pool for this listener. If specified, the pool must:
+ - Belong to this load balancer.
+ - Have the same `protocol` as this listener, or have a compatible
+ protocol.
+ At present, the compatible protocols are `http` and `https`.
+ - Not already be the `default_pool` for another listener.
+ If unspecified, this listener will be created with no default pool, but one
+ may be
+ subsequently set.
+ :param LoadBalancerListenerHTTPSRedirectPrototype https_redirect:
+ (optional) The target listener that requests will be redirected to. This
+ listener must have a
+ `protocol` of `http`, and the target listener must have a `protocol` of
+ `https`.
+ :param int idle_connection_timeout: (optional) The idle connection timeout
+ of the listener in seconds. Supported for load balancers in the
+ `application` family.
+ :param int port: (optional) The listener port number, or the inclusive
+ lower bound of the port range. Each listener in the load balancer must have
+ a unique `port` and `protocol` combination.
+ Not supported for load balancers operating with route mode enabled.
+ :param int port_max: (optional) The inclusive upper bound of the range of
+ ports used by this listener. Must not be less than `port_min`.
+ At present, only load balancers operating with route mode enabled, and
+ public load balancers in the `network` family support different values for
+ `port_min` and
+ `port_max`. When route mode is enabled, the value `65535` must be
+ specified.
+ The specified port range must not overlap with port ranges used by other
+ listeners for this load balancer using the same protocol.
+ :param int port_min: (optional) The inclusive lower bound of the range of
+ ports used by this listener. Must not be greater than `port_max`.
+ At present, only load balancers operating with route mode enabled, and
+ public load balancers in the `network` family support different values for
+ `port_min` and
+ `port_max`. When route mode is enabled, the value `1` must be specified.
+ The specified port range must not overlap with port ranges used by other
+ listeners for this load balancer using the same protocol.
"""
+ self.accept_proxy_protocol = accept_proxy_protocol
+ self.certificate_instance = certificate_instance
+ self.connection_limit = connection_limit
+ self.default_pool = default_pool
+ self.https_redirect = https_redirect
+ self.idle_connection_timeout = idle_connection_timeout
self.port = port
- self.target = target
- self.weight = weight
+ self.port_max = port_max
+ self.port_min = port_min
+ self.protocol = protocol
@classmethod
- def from_dict(cls, _dict: Dict) -> 'LoadBalancerPoolMemberPrototype':
- """Initialize a LoadBalancerPoolMemberPrototype object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerPrototypeLoadBalancerContext':
+ """Initialize a LoadBalancerListenerPrototypeLoadBalancerContext object from a json dictionary."""
args = {}
- if 'port' in _dict:
- args['port'] = _dict.get('port')
- else:
- raise ValueError('Required property \'port\' not present in LoadBalancerPoolMemberPrototype JSON')
- if 'target' in _dict:
- args['target'] = _dict.get('target')
+ if (accept_proxy_protocol := _dict.get('accept_proxy_protocol')) is not None:
+ args['accept_proxy_protocol'] = accept_proxy_protocol
+ if (certificate_instance := _dict.get('certificate_instance')) is not None:
+ args['certificate_instance'] = certificate_instance
+ if (connection_limit := _dict.get('connection_limit')) is not None:
+ args['connection_limit'] = connection_limit
+ if (default_pool := _dict.get('default_pool')) is not None:
+ args['default_pool'] = LoadBalancerPoolIdentityByName.from_dict(default_pool)
+ if (https_redirect := _dict.get('https_redirect')) is not None:
+ args['https_redirect'] = LoadBalancerListenerHTTPSRedirectPrototype.from_dict(https_redirect)
+ if (idle_connection_timeout := _dict.get('idle_connection_timeout')) is not None:
+ args['idle_connection_timeout'] = idle_connection_timeout
+ if (port := _dict.get('port')) is not None:
+ args['port'] = port
+ if (port_max := _dict.get('port_max')) is not None:
+ args['port_max'] = port_max
+ if (port_min := _dict.get('port_min')) is not None:
+ args['port_min'] = port_min
+ if (protocol := _dict.get('protocol')) is not None:
+ args['protocol'] = protocol
else:
- raise ValueError('Required property \'target\' not present in LoadBalancerPoolMemberPrototype JSON')
- if 'weight' in _dict:
- args['weight'] = _dict.get('weight')
+ raise ValueError('Required property \'protocol\' not present in LoadBalancerListenerPrototypeLoadBalancerContext JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a LoadBalancerPoolMemberPrototype 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, 'accept_proxy_protocol') and self.accept_proxy_protocol is not None:
+ _dict['accept_proxy_protocol'] = self.accept_proxy_protocol
+ if hasattr(self, 'certificate_instance') and self.certificate_instance is not None:
+ if isinstance(self.certificate_instance, dict):
+ _dict['certificate_instance'] = self.certificate_instance
+ else:
+ _dict['certificate_instance'] = self.certificate_instance.to_dict()
+ if hasattr(self, 'connection_limit') and self.connection_limit is not None:
+ _dict['connection_limit'] = self.connection_limit
+ if hasattr(self, 'default_pool') and self.default_pool is not None:
+ if isinstance(self.default_pool, dict):
+ _dict['default_pool'] = self.default_pool
+ else:
+ _dict['default_pool'] = self.default_pool.to_dict()
+ if hasattr(self, 'https_redirect') and self.https_redirect is not None:
+ if isinstance(self.https_redirect, dict):
+ _dict['https_redirect'] = self.https_redirect
+ else:
+ _dict['https_redirect'] = self.https_redirect.to_dict()
+ if hasattr(self, 'idle_connection_timeout') and self.idle_connection_timeout is not None:
+ _dict['idle_connection_timeout'] = self.idle_connection_timeout
if hasattr(self, 'port') and self.port is not None:
_dict['port'] = self.port
- if hasattr(self, '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, '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):
@@ -56757,29 +60151,49 @@ 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 LoadBalancerListenerPrototypeLoadBalancerContext object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'LoadBalancerPoolMemberPrototype') -> 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: 'LoadBalancerPoolMemberPrototype') -> bool:
+ def __ne__(self, other: 'LoadBalancerListenerPrototypeLoadBalancerContext') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
+ class ProtocolEnum(str, Enum):
+ """
+ The listener protocol. Each listener in the load balancer must have a unique
+ `port` and `protocol` combination.
+ Load balancers in the `network` family support `tcp` and `udp` (if `udp_supported`
+ is `true`). Load balancers in the `application` family support `tcp`, `http` and
+ `https`.
+ Additional restrictions:
+ - If `default_pool` is set, the pool's protocol must match, or be compatible with
+ the listener's protocol. At present, the compatible protocols are `http` and
+ `https`.
+ - If `https_redirect` is set, the protocol must be `http`.
+ """
+
+ HTTP = 'http'
+ HTTPS = 'https'
+ TCP = 'tcp'
+ UDP = 'udp'
+
-class LoadBalancerPoolMemberReference:
+
+class LoadBalancerListenerReference:
"""
- LoadBalancerPoolMemberReference.
+ LoadBalancerListenerReference.
- :attr LoadBalancerPoolMemberReferenceDeleted deleted: (optional) If present,
- this property indicates the referenced resource has been deleted, and provides
+ :param LoadBalancerListenerReferenceDeleted 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.
+ :param str href: The listener's canonical URL.
+ :param str id: The unique identifier for this load balancer listener.
"""
def __init__(
@@ -56787,16 +60201,16 @@ def __init__(
href: str,
id: str,
*,
- deleted: 'LoadBalancerPoolMemberReferenceDeleted' = None,
+ deleted: Optional['LoadBalancerListenerReferenceDeleted'] = None,
) -> None:
"""
- Initialize a LoadBalancerPoolMemberReference object.
+ Initialize a LoadBalancerListenerReference 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 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.deleted = deleted
@@ -56804,24 +60218,24 @@ def __init__(
self.id = id
@classmethod
- def from_dict(cls, _dict: Dict) -> 'LoadBalancerPoolMemberReference':
- """Initialize a LoadBalancerPoolMemberReference object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerReference':
+ """Initialize a LoadBalancerListenerReference object from a json dictionary."""
args = {}
- if 'deleted' in _dict:
- args['deleted'] = LoadBalancerPoolMemberReferenceDeleted.from_dict(_dict.get('deleted'))
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ if (deleted := _dict.get('deleted')) is not None:
+ args['deleted'] = LoadBalancerListenerReferenceDeleted.from_dict(deleted)
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'href\' not present in LoadBalancerPoolMemberReference JSON')
- if 'id' in _dict:
- args['id'] = _dict.get('id')
+ raise ValueError('Required property \'href\' not present in LoadBalancerListenerReference JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
else:
- raise ValueError('Required property \'id\' not present in LoadBalancerPoolMemberReference JSON')
+ raise ValueError('Required property \'id\' not present in LoadBalancerListenerReference JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a LoadBalancerPoolMemberReference object from a json dictionary."""
+ """Initialize a LoadBalancerListenerReference object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -56843,26 +60257,26 @@ 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 LoadBalancerListenerReference object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'LoadBalancerPoolMemberReference') -> bool:
+ def __eq__(self, other: 'LoadBalancerListenerReference') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'LoadBalancerPoolMemberReference') -> bool:
+ def __ne__(self, other: 'LoadBalancerListenerReference') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class LoadBalancerPoolMemberReferenceDeleted:
+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.
+ :param str more_info: Link to documentation about deleted resources.
"""
def __init__(
@@ -56870,25 +60284,25 @@ def __init__(
more_info: str,
) -> None:
"""
- Initialize a LoadBalancerPoolMemberReferenceDeleted object.
+ Initialize a LoadBalancerListenerReferenceDeleted object.
:param str more_info: Link to documentation about deleted resources.
"""
self.more_info = more_info
@classmethod
- def from_dict(cls, _dict: Dict) -> 'LoadBalancerPoolMemberReferenceDeleted':
- """Initialize a LoadBalancerPoolMemberReferenceDeleted object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerReferenceDeleted':
+ """Initialize a LoadBalancerListenerReferenceDeleted object from a json dictionary."""
args = {}
- if 'more_info' in _dict:
- args['more_info'] = _dict.get('more_info')
+ if (more_info := _dict.get('more_info')) is not None:
+ args['more_info'] = more_info
else:
- raise ValueError('Required property \'more_info\' not present in LoadBalancerPoolMemberReferenceDeleted JSON')
+ raise ValueError('Required property \'more_info\' not present in LoadBalancerListenerReferenceDeleted JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a LoadBalancerPoolMemberReferenceDeleted object from a json dictionary."""
+ """Initialize a LoadBalancerListenerReferenceDeleted object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -56903,178 +60317,124 @@ 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 LoadBalancerListenerReferenceDeleted object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'LoadBalancerPoolMemberReferenceDeleted') -> bool:
+ def __eq__(self, other: 'LoadBalancerListenerReferenceDeleted') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'LoadBalancerPoolMemberReferenceDeleted') -> bool:
+ def __ne__(self, other: 'LoadBalancerListenerReferenceDeleted') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class LoadBalancerPoolMemberTarget:
+class LoadBalancerLogging:
"""
- The pool member target. Load balancers in the `network` family support virtual server
- instances. Load balancers in the `application` family support IP addresses. If the
- load balancer has route mode enabled, the member must be in a zone the load balancer
- has a subnet in.
+ LoadBalancerLogging.
+ :param LoadBalancerLoggingDatapath datapath: The datapath logging configuration
+ for this load balancer.
"""
def __init__(
self,
+ datapath: 'LoadBalancerLoggingDatapath',
) -> None:
"""
- Initialize a LoadBalancerPoolMemberTarget object.
+ Initialize a LoadBalancerLogging object.
+ :param LoadBalancerLoggingDatapath datapath: The datapath logging
+ configuration for this load balancer.
"""
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['LoadBalancerPoolMemberTargetInstanceReference', 'LoadBalancerPoolMemberTargetIP'])
- )
- raise Exception(msg)
+ self.datapath = datapath
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'LoadBalancerLogging':
+ """Initialize a LoadBalancerLogging object from a json dictionary."""
+ args = {}
+ if (datapath := _dict.get('datapath')) is not None:
+ args['datapath'] = LoadBalancerLoggingDatapath.from_dict(datapath)
+ else:
+ raise ValueError('Required property \'datapath\' not present in LoadBalancerLogging JSON')
+ return cls(**args)
-class LoadBalancerPoolMemberTargetPrototype:
- """
- The pool member target. Load balancers in the `network` family support virtual server
- instances. Load balancers in the `application` family support IP addresses. If the
- load balancer has route mode enabled, the member must be in a zone the load balancer
- has a subnet in.
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a 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, 'datapath') and self.datapath is not None:
+ if isinstance(self.datapath, dict):
+ _dict['datapath'] = self.datapath
+ else:
+ _dict['datapath'] = self.datapath.to_dict()
+ return _dict
- def __init__(
- self,
- ) -> None:
- """
- Initialize a LoadBalancerPoolMemberTargetPrototype object.
+ def _to_dict(self):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
- """
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['LoadBalancerPoolMemberTargetPrototypeInstanceIdentity', 'LoadBalancerPoolMemberTargetPrototypeIP'])
- )
- raise Exception(msg)
+ def __str__(self) -> str:
+ """Return a `str` version of this LoadBalancerLogging object."""
+ return json.dumps(self.to_dict(), indent=2)
+ 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__
-class LoadBalancerPoolPatch:
+ def __ne__(self, other: 'LoadBalancerLogging') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+
+class LoadBalancerLoggingDatapath:
"""
- LoadBalancerPoolPatch.
+ The datapath logging configuration for this load balancer.
- :attr str algorithm: (optional) The load balancing algorithm.
- :attr LoadBalancerPoolHealthMonitorPatch health_monitor: (optional) The health
- monitor of this pool.
- :attr str name: (optional) The name for this load balancer pool. The name must
- not be used by another pool for the load balancer.
- :attr str protocol: (optional) The protocol for this load balancer pool.
- Load balancers in the `network` family support `tcp` and `udp` (if
- `udp_supported` is `true`). Load balancers in the `application` family support
- `tcp`, `http` and
- `https`.
- If this pool is associated with a load balancer listener, the specified protocol
- must match, or be compatible with the listener's protocol. At present, the
- compatible protocols are `http` and `https`.
- :attr str proxy_protocol: (optional) The PROXY protocol setting for this pool:
- - `v1`: Enabled with version 1 (human-readable header format)
- - `v2`: Enabled with version 2 (binary header format)
- - `disabled`: Disabled
- Supported by load balancers in the `application` family (otherwise always
- `disabled`).
- :attr LoadBalancerPoolSessionPersistencePatch session_persistence: (optional)
- The session persistence of this pool.
+ :param bool active: Indicates whether datapath logging is active for this load
+ balancer.
"""
def __init__(
self,
- *,
- algorithm: str = None,
- health_monitor: 'LoadBalancerPoolHealthMonitorPatch' = None,
- name: str = None,
- protocol: str = None,
- proxy_protocol: str = None,
- session_persistence: 'LoadBalancerPoolSessionPersistencePatch' = None,
+ active: bool,
) -> None:
"""
- Initialize a LoadBalancerPoolPatch object.
+ Initialize a LoadBalancerLoggingDatapath object.
- :param str algorithm: (optional) The load balancing algorithm.
- :param LoadBalancerPoolHealthMonitorPatch health_monitor: (optional) The
- health monitor of this pool.
- :param str name: (optional) The name for this load balancer pool. The name
- must not be used by another pool for the load balancer.
- :param str protocol: (optional) The protocol for this load balancer pool.
- Load balancers in the `network` family support `tcp` and `udp` (if
- `udp_supported` is `true`). Load balancers in the `application` family
- support `tcp`, `http` and
- `https`.
- If this pool is associated with a load balancer listener, the specified
- protocol must match, or be compatible with the listener's protocol. At
- present, the compatible protocols are `http` and `https`.
- :param str proxy_protocol: (optional) The PROXY protocol setting for this
- pool:
- - `v1`: Enabled with version 1 (human-readable header format)
- - `v2`: Enabled with version 2 (binary header format)
- - `disabled`: Disabled
- Supported by load balancers in the `application` family (otherwise always
- `disabled`).
- :param LoadBalancerPoolSessionPersistencePatch session_persistence:
- (optional) The session persistence of this pool.
+ :param bool active: Indicates whether datapath logging is active for this
+ load balancer.
"""
- 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.active = active
@classmethod
- def from_dict(cls, _dict: Dict) -> 'LoadBalancerPoolPatch':
- """Initialize a LoadBalancerPoolPatch object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'LoadBalancerLoggingDatapath':
+ """Initialize a LoadBalancerLoggingDatapath 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 (active := _dict.get('active')) is not None:
+ args['active'] = active
+ else:
+ raise ValueError('Required property \'active\' not present in LoadBalancerLoggingDatapath JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a LoadBalancerPoolPatch 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, 'algorithm') and self.algorithm is not None:
- _dict['algorithm'] = self.algorithm
- if hasattr(self, 'health_monitor') and self.health_monitor is not None:
- if isinstance(self.health_monitor, dict):
- _dict['health_monitor'] = self.health_monitor
- else:
- _dict['health_monitor'] = self.health_monitor.to_dict()
- if hasattr(self, 'name') and self.name is not None:
- _dict['name'] = self.name
- if hasattr(self, 'protocol') and self.protocol is not None:
- _dict['protocol'] = self.protocol
- if hasattr(self, 'proxy_protocol') and self.proxy_protocol is not None:
- _dict['proxy_protocol'] = self.proxy_protocol
- if hasattr(self, 'session_persistence') and self.session_persistence is not None:
- if isinstance(self.session_persistence, dict):
- _dict['session_persistence'] = self.session_persistence
- else:
- _dict['session_persistence'] = self.session_persistence.to_dict()
+ if hasattr(self, 'active') and self.active is not None:
+ _dict['active'] = self.active
return _dict
def _to_dict(self):
@@ -57082,196 +60442,59 @@ 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 LoadBalancerLoggingDatapath object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'LoadBalancerPoolPatch') -> 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: 'LoadBalancerPoolPatch') -> bool:
+ def __ne__(self, other: 'LoadBalancerLoggingDatapath') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class AlgorithmEnum(str, Enum):
- """
- The load balancing algorithm.
- """
-
- LEAST_CONNECTIONS = 'least_connections'
- ROUND_ROBIN = 'round_robin'
- WEIGHTED_ROUND_ROBIN = 'weighted_round_robin'
-
-
- class ProtocolEnum(str, Enum):
- """
- The protocol for this load balancer pool.
- Load balancers in the `network` family support `tcp` and `udp` (if `udp_supported`
- is `true`). Load balancers in the `application` family support `tcp`, `http` and
- `https`.
- If this pool is associated with a load balancer listener, the specified protocol
- must match, or be compatible with the listener's protocol. At present, the
- compatible protocols are `http` and `https`.
- """
-
- HTTP = 'http'
- HTTPS = 'https'
- TCP = 'tcp'
- UDP = 'udp'
-
-
- class ProxyProtocolEnum(str, Enum):
- """
- The PROXY protocol setting for this pool:
- - `v1`: Enabled with version 1 (human-readable header format)
- - `v2`: Enabled with version 2 (binary header format)
- - `disabled`: Disabled
- Supported by load balancers in the `application` family (otherwise always
- `disabled`).
- """
-
- DISABLED = 'disabled'
- V1 = 'v1'
- V2 = 'v2'
-
-
-class LoadBalancerPoolPrototype:
+class LoadBalancerLoggingDatapathPatch:
"""
- LoadBalancerPoolPrototype.
+ The datapath logging configuration for this load balancer.
- :attr str algorithm: The load balancing algorithm.
- :attr LoadBalancerPoolHealthMonitorPrototype health_monitor: The health monitor
- of this pool.
- :attr List[LoadBalancerPoolMemberPrototype] members: (optional) The members for
- this load balancer pool. For load balancers in the `network` family, the same
- `port` and `target` tuple cannot be shared by a pool member of any other load
- balancer in the same VPC.
- :attr str name: (optional) The name for this load balancer pool. The name must
- not be used by another pool for the load balancer. If unspecified, the name will
- be a hyphenated list of randomly-selected words.
- :attr str protocol: The protocol used for this load balancer pool. Load
- balancers in the `network` family support `tcp` and `udp` (if `udp_supported` is
- `true`). Load balancers in the
- `application` family support `tcp`, `http`, and `https`.
- :attr str proxy_protocol: (optional) The PROXY protocol setting for this pool:
- - `v1`: Enabled with version 1 (human-readable header format)
- - `v2`: Enabled with version 2 (binary header format)
- - `disabled`: Disabled
- Supported by load balancers in the `application` family (otherwise always
- `disabled`).
- :attr LoadBalancerPoolSessionPersistencePrototype session_persistence:
- (optional) The session persistence of this pool.
+ :param bool active: (optional) Indicates whether datapath logging will be active
+ for this load balancer.
"""
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,
+ active: Optional[bool] = None,
) -> None:
"""
- Initialize a LoadBalancerPoolPrototype object.
+ Initialize a LoadBalancerLoggingDatapathPatch object.
- :param str algorithm: The load balancing algorithm.
- :param LoadBalancerPoolHealthMonitorPrototype health_monitor: The health
- monitor of this pool.
- :param str protocol: The protocol used for this load balancer pool. Load
- balancers in the `network` family support `tcp` and `udp` (if
- `udp_supported` is `true`). Load balancers in the
- `application` family support `tcp`, `http`, and `https`.
- :param List[LoadBalancerPoolMemberPrototype] members: (optional) The
- members for this load balancer pool. For load balancers in the `network`
- family, the same `port` and `target` tuple cannot be shared by a pool
- member of any other load balancer in the same VPC.
- :param str name: (optional) The name for this load balancer pool. The name
- must not be used by another pool for the load balancer. If unspecified, the
- name will be a hyphenated list of randomly-selected words.
- :param str proxy_protocol: (optional) The PROXY protocol setting for this
- pool:
- - `v1`: Enabled with version 1 (human-readable header format)
- - `v2`: Enabled with version 2 (binary header format)
- - `disabled`: Disabled
- Supported by load balancers in the `application` family (otherwise always
- `disabled`).
- :param LoadBalancerPoolSessionPersistencePrototype session_persistence:
- (optional) The session persistence of this pool.
+ :param bool active: (optional) Indicates whether datapath logging will be
+ active for this load balancer.
"""
- 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.active = active
@classmethod
- def from_dict(cls, _dict: Dict) -> 'LoadBalancerPoolPrototype':
- """Initialize a LoadBalancerPoolPrototype object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'LoadBalancerLoggingDatapathPatch':
+ """Initialize a LoadBalancerLoggingDatapathPatch 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(v) for v in _dict.get('members')]
- if 'name' in _dict:
- args['name'] = _dict.get('name')
- if 'protocol' in _dict:
- args['protocol'] = _dict.get('protocol')
- else:
- raise ValueError('Required property \'protocol\' not present in LoadBalancerPoolPrototype JSON')
- if 'proxy_protocol' in _dict:
- args['proxy_protocol'] = _dict.get('proxy_protocol')
- if 'session_persistence' in _dict:
- args['session_persistence'] = LoadBalancerPoolSessionPersistencePrototype.from_dict(_dict.get('session_persistence'))
+ if (active := _dict.get('active')) is not None:
+ args['active'] = active
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a LoadBalancerPoolPrototype object from a json dictionary."""
+ """Initialize a LoadBalancerLoggingDatapathPatch object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'algorithm') and self.algorithm is not None:
- _dict['algorithm'] = self.algorithm
- if hasattr(self, 'health_monitor') and self.health_monitor is not None:
- if isinstance(self.health_monitor, dict):
- _dict['health_monitor'] = self.health_monitor
- else:
- _dict['health_monitor'] = self.health_monitor.to_dict()
- if hasattr(self, 'members') and self.members is not None:
- members_list = []
- for v in self.members:
- if isinstance(v, dict):
- members_list.append(v)
- else:
- members_list.append(v.to_dict())
- _dict['members'] = members_list
- if hasattr(self, 'name') and self.name is not None:
- _dict['name'] = self.name
- if hasattr(self, 'protocol') and self.protocol is not None:
- _dict['protocol'] = self.protocol
- if hasattr(self, 'proxy_protocol') and self.proxy_protocol is not None:
- _dict['proxy_protocol'] = self.proxy_protocol
- if hasattr(self, 'session_persistence') and self.session_persistence is not None:
- if isinstance(self.session_persistence, dict):
- _dict['session_persistence'] = self.session_persistence
- else:
- _dict['session_persistence'] = self.session_persistence.to_dict()
+ if hasattr(self, 'active') and self.active is not None:
+ _dict['active'] = self.active
return _dict
def _to_dict(self):
@@ -57279,136 +60502,59 @@ 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 LoadBalancerLoggingDatapathPatch object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'LoadBalancerPoolPrototype') -> bool:
+ def __eq__(self, other: 'LoadBalancerLoggingDatapathPatch') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'LoadBalancerPoolPrototype') -> bool:
+ def __ne__(self, other: 'LoadBalancerLoggingDatapathPatch') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class AlgorithmEnum(str, Enum):
- """
- The load balancing algorithm.
- """
-
- LEAST_CONNECTIONS = 'least_connections'
- ROUND_ROBIN = 'round_robin'
- WEIGHTED_ROUND_ROBIN = 'weighted_round_robin'
-
- class ProtocolEnum(str, Enum):
- """
- The protocol used for this load balancer pool. Load balancers in the `network`
- family support `tcp` and `udp` (if `udp_supported` is `true`). Load balancers in
- the
- `application` family support `tcp`, `http`, and `https`.
- """
-
- HTTP = 'http'
- HTTPS = 'https'
- TCP = 'tcp'
- UDP = 'udp'
-
-
- class ProxyProtocolEnum(str, Enum):
- """
- The PROXY protocol setting for this pool:
- - `v1`: Enabled with version 1 (human-readable header format)
- - `v2`: Enabled with version 2 (binary header format)
- - `disabled`: Disabled
- Supported by load balancers in the `application` family (otherwise always
- `disabled`).
- """
-
- DISABLED = 'disabled'
- V1 = 'v1'
- V2 = 'v2'
-
-
-
-class LoadBalancerPoolReference:
+class LoadBalancerLoggingDatapathPrototype:
"""
- LoadBalancerPoolReference.
+ The datapath logging configuration for this load balancer.
- :attr LoadBalancerPoolReferenceDeleted deleted: (optional) If present, this
- property indicates the referenced resource has been deleted, and provides
- some supplementary information.
- :attr str href: The pool's canonical URL.
- :attr str id: The unique identifier for this load balancer pool.
- :attr str name: The name for this load balancer pool. The name is unique across
- all pools for the load balancer.
+ :param bool active: (optional) Indicates whether datapath logging will be active
+ for this load balancer.
"""
def __init__(
self,
- href: str,
- id: str,
- name: str,
*,
- deleted: 'LoadBalancerPoolReferenceDeleted' = None,
+ active: Optional[bool] = None,
) -> None:
"""
- Initialize a LoadBalancerPoolReference object.
+ Initialize a LoadBalancerLoggingDatapathPrototype object.
- :param str href: The pool's canonical URL.
- :param str id: The unique identifier for this load balancer pool.
- :param str name: The name for this load balancer pool. The name is unique
- across all pools for the load balancer.
- :param LoadBalancerPoolReferenceDeleted deleted: (optional) If present,
- this property indicates the referenced resource has been deleted, and
- provides
- some supplementary information.
+ :param bool active: (optional) Indicates whether datapath logging will be
+ active for this load balancer.
"""
- self.deleted = deleted
- self.href = href
- self.id = id
- self.name = name
+ self.active = active
@classmethod
- def from_dict(cls, _dict: Dict) -> 'LoadBalancerPoolReference':
- """Initialize a LoadBalancerPoolReference object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'LoadBalancerLoggingDatapathPrototype':
+ """Initialize a LoadBalancerLoggingDatapathPrototype object from a json dictionary."""
args = {}
- if 'deleted' in _dict:
- args['deleted'] = LoadBalancerPoolReferenceDeleted.from_dict(_dict.get('deleted'))
- if 'href' in _dict:
- args['href'] = _dict.get('href')
- else:
- raise ValueError('Required property \'href\' not present in LoadBalancerPoolReference JSON')
- if 'id' in _dict:
- args['id'] = _dict.get('id')
- else:
- raise ValueError('Required property \'id\' not present in LoadBalancerPoolReference JSON')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
- else:
- raise ValueError('Required property \'name\' not present in LoadBalancerPoolReference JSON')
+ if (active := _dict.get('active')) is not None:
+ args['active'] = active
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a LoadBalancerPoolReference object from a json dictionary."""
+ """Initialize a LoadBalancerLoggingDatapathPrototype object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'deleted') and self.deleted is not None:
- if isinstance(self.deleted, dict):
- _dict['deleted'] = self.deleted
- else:
- _dict['deleted'] = self.deleted.to_dict()
- if hasattr(self, 'href') and self.href is not None:
- _dict['href'] = self.href
- if hasattr(self, 'id') and self.id is not None:
- _dict['id'] = self.id
- if hasattr(self, 'name') and self.name is not None:
- _dict['name'] = self.name
+ if hasattr(self, 'active') and self.active is not None:
+ _dict['active'] = self.active
return _dict
def _to_dict(self):
@@ -57416,59 +60562,62 @@ 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 LoadBalancerLoggingDatapathPrototype object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'LoadBalancerPoolReference') -> bool:
+ def __eq__(self, other: 'LoadBalancerLoggingDatapathPrototype') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'LoadBalancerPoolReference') -> bool:
+ def __ne__(self, other: 'LoadBalancerLoggingDatapathPrototype') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class LoadBalancerPoolReferenceDeleted:
+class LoadBalancerLoggingPatch:
"""
- If present, this property indicates the referenced resource has been deleted, and
- provides some supplementary information.
+ LoadBalancerLoggingPatch.
- :attr str more_info: Link to documentation about deleted resources.
+ :param LoadBalancerLoggingDatapathPatch datapath: (optional) The datapath
+ logging configuration for this load balancer.
"""
def __init__(
self,
- more_info: str,
+ *,
+ datapath: Optional['LoadBalancerLoggingDatapathPatch'] = None,
) -> None:
"""
- Initialize a LoadBalancerPoolReferenceDeleted object.
+ Initialize a LoadBalancerLoggingPatch object.
- :param str more_info: Link to documentation about deleted resources.
+ :param LoadBalancerLoggingDatapathPatch datapath: (optional) The datapath
+ logging configuration for this load balancer.
"""
- self.more_info = more_info
+ self.datapath = datapath
@classmethod
- def from_dict(cls, _dict: Dict) -> 'LoadBalancerPoolReferenceDeleted':
- """Initialize a LoadBalancerPoolReferenceDeleted object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'LoadBalancerLoggingPatch':
+ """Initialize a LoadBalancerLoggingPatch 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')
+ if (datapath := _dict.get('datapath')) is not None:
+ args['datapath'] = LoadBalancerLoggingDatapathPatch.from_dict(datapath)
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a LoadBalancerPoolReferenceDeleted object from a json dictionary."""
+ """Initialize a LoadBalancerLoggingPatch object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'more_info') and self.more_info is not None:
- _dict['more_info'] = self.more_info
+ if hasattr(self, 'datapath') and self.datapath is not None:
+ if isinstance(self.datapath, dict):
+ _dict['datapath'] = self.datapath
+ else:
+ _dict['datapath'] = self.datapath.to_dict()
return _dict
def _to_dict(self):
@@ -57476,73 +60625,62 @@ 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 LoadBalancerLoggingPatch object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'LoadBalancerPoolReferenceDeleted') -> bool:
+ def __eq__(self, other: 'LoadBalancerLoggingPatch') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'LoadBalancerPoolReferenceDeleted') -> bool:
+ def __ne__(self, other: 'LoadBalancerLoggingPatch') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class LoadBalancerPoolSessionPersistence:
+class LoadBalancerLoggingPrototype:
"""
- LoadBalancerPoolSessionPersistence.
+ LoadBalancerLoggingPrototype.
- :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.
+ :param LoadBalancerLoggingDatapathPrototype datapath: (optional) The datapath
+ logging configuration for this load balancer.
"""
def __init__(
self,
- type: str,
*,
- cookie_name: str = None,
+ datapath: Optional['LoadBalancerLoggingDatapathPrototype'] = None,
) -> None:
"""
- Initialize a LoadBalancerPoolSessionPersistence object.
+ Initialize a LoadBalancerLoggingPrototype 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 LoadBalancerLoggingDatapathPrototype datapath: (optional) The
+ datapath logging configuration for this load balancer.
"""
- self.cookie_name = cookie_name
- self.type = type
+ self.datapath = datapath
@classmethod
- def from_dict(cls, _dict: Dict) -> 'LoadBalancerPoolSessionPersistence':
- """Initialize a LoadBalancerPoolSessionPersistence object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'LoadBalancerLoggingPrototype':
+ """Initialize a LoadBalancerLoggingPrototype 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 (datapath := _dict.get('datapath')) is not None:
+ args['datapath'] = LoadBalancerLoggingDatapathPrototype.from_dict(datapath)
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a LoadBalancerPoolSessionPersistence object from a json dictionary."""
+ """Initialize a LoadBalancerLoggingPrototype object from 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, 'datapath') and self.datapath is not None:
+ if isinstance(self.datapath, dict):
+ _dict['datapath'] = self.datapath
+ else:
+ _dict['datapath'] = self.datapath.to_dict()
return _dict
def _to_dict(self):
@@ -57550,84 +60688,123 @@ 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 LoadBalancerLoggingPrototype object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'LoadBalancerPoolSessionPersistence') -> bool:
+ def __eq__(self, other: 'LoadBalancerLoggingPrototype') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'LoadBalancerPoolSessionPersistence') -> bool:
+ def __ne__(self, other: 'LoadBalancerLoggingPrototype') -> 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 LoadBalancerPatch:
"""
- The session persistence configuration. Specify `null` to remove any existing session
- persistence configuration.
+ LoadBalancerPatch.
- :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.
+ :param LoadBalancerDNSPatch dns: (optional) The DNS configuration for this load
+ balancer.
+ Specify `null` to remove the existing DNS configuration, which will remove all
+ DNS `A`
+ records for this load balancer that had been added to `zone`, and add equivalent
+ `A`
+ records to the public DNS zone `lb.appdomain.cloud`.
+ :param LoadBalancerLoggingPatch logging: (optional) The logging configuration to
+ use for this load balancer.
+ To activate logging, the load balancer profile must support the specified
+ logging type.
+ :param str name: (optional) The name for this load balancer. The name must not
+ be used by another load balancer in the VPC.
+ :param List[SubnetIdentity] subnets: (optional) The subnets to provision this
+ load balancer in. The load balancer's availability will depend on the
+ availability of the zones that the subnets reside in.
+ The specified subnets must be in the same VPC as the existing subnets, and will
+ completely replace the existing subnets.
+ The load balancer must be in the `application` family.
"""
def __init__(
self,
*,
- cookie_name: str = None,
- type: str = None,
+ dns: Optional['LoadBalancerDNSPatch'] = None,
+ logging: Optional['LoadBalancerLoggingPatch'] = None,
+ name: Optional[str] = None,
+ subnets: Optional[List['SubnetIdentity']] = None,
) -> None:
"""
- Initialize a LoadBalancerPoolSessionPersistencePatch object.
+ Initialize a LoadBalancerPatch 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 LoadBalancerDNSPatch dns: (optional) The DNS configuration for this
+ load balancer.
+ Specify `null` to remove the existing DNS configuration, which will remove
+ all DNS `A`
+ records for this load balancer that had been added to `zone`, and add
+ equivalent `A`
+ records to the public DNS zone `lb.appdomain.cloud`.
+ :param LoadBalancerLoggingPatch logging: (optional) The logging
+ configuration to use for this load balancer.
+ To activate logging, the load balancer profile must support the specified
+ logging type.
+ :param str name: (optional) The name for this load balancer. The name must
+ not be used by another load balancer in the VPC.
+ :param List[SubnetIdentity] subnets: (optional) The subnets to provision
+ this load balancer in. The load balancer's availability will depend on the
+ availability of the zones that the subnets reside in.
+ The specified subnets must be in the same VPC as the existing subnets, and
+ will completely replace the existing subnets.
+ The load balancer must be in the `application` family.
"""
- self.cookie_name = cookie_name
- self.type = type
+ self.dns = dns
+ self.logging = logging
+ self.name = name
+ self.subnets = subnets
@classmethod
- def from_dict(cls, _dict: Dict) -> 'LoadBalancerPoolSessionPersistencePatch':
- """Initialize a LoadBalancerPoolSessionPersistencePatch object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'LoadBalancerPatch':
+ """Initialize a LoadBalancerPatch 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 (dns := _dict.get('dns')) is not None:
+ args['dns'] = LoadBalancerDNSPatch.from_dict(dns)
+ if (logging := _dict.get('logging')) is not None:
+ args['logging'] = LoadBalancerLoggingPatch.from_dict(logging)
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ if (subnets := _dict.get('subnets')) is not None:
+ args['subnets'] = subnets
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a LoadBalancerPoolSessionPersistencePatch 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, '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, 'dns') and self.dns is not None:
+ if isinstance(self.dns, dict):
+ _dict['dns'] = self.dns
+ else:
+ _dict['dns'] = self.dns.to_dict()
+ if hasattr(self, 'logging') and self.logging is not None:
+ if isinstance(self.logging, dict):
+ _dict['logging'] = self.logging
+ else:
+ _dict['logging'] = self.logging.to_dict()
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ if hasattr(self, 'subnets') and self.subnets is not None:
+ subnets_list = []
+ for v in self.subnets:
+ if isinstance(v, dict):
+ subnets_list.append(v)
+ else:
+ subnets_list.append(v.to_dict())
+ _dict['subnets'] = subnets_list
return _dict
def _to_dict(self):
@@ -57635,223 +60812,225 @@ 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 LoadBalancerPatch object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'LoadBalancerPoolSessionPersistencePatch') -> 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: 'LoadBalancerPoolSessionPersistencePatch') -> bool:
+ def __ne__(self, other: 'LoadBalancerPatch') -> 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 LoadBalancerPool:
"""
- LoadBalancerPoolSessionPersistencePrototype.
+ LoadBalancerPool.
- :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.
+ :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 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 str name: The name for this load balancer pool. The name is unique across
+ all pools for the load balancer.
+ :param str protocol: The protocol for this load balancer pool.
+ The enumerated values for this property are expected to expand in the future.
+ When processing this property, check for and log unknown values. Optionally halt
+ processing and surface the error, or bypass the pool on which the unexpected
+ property value was encountered.
+ :param str provisioning_status: The provisioning status of this pool
+ The enumerated values for this property are expected to expand in the future.
+ When processing this property, check for and log unknown values. Optionally halt
+ processing and surface the error, or bypass the pool on which the unexpected
+ property value was encountered.
+ :param str proxy_protocol: The PROXY protocol setting for this pool:
+ - `v1`: Enabled with version 1 (human-readable header format)
+ - `v2`: Enabled with version 2 (binary header format)
+ - `disabled`: Disabled
+ Supported by load balancers in the `application` family (otherwise always
+ `disabled`).
+ :param 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,
- type: str,
+ algorithm: str,
+ created_at: datetime,
+ health_monitor: 'LoadBalancerPoolHealthMonitor',
+ href: str,
+ id: str,
+ name: str,
+ protocol: str,
+ provisioning_status: str,
+ proxy_protocol: str,
*,
- cookie_name: str = None,
+ instance_group: Optional['InstanceGroupReference'] = None,
+ members: Optional[List['LoadBalancerPoolMemberReference']] = None,
+ session_persistence: Optional['LoadBalancerPoolSessionPersistence'] = None,
) -> None:
"""
- Initialize a LoadBalancerPoolSessionPersistencePrototype object.
-
- :param str type: The session persistence type. The `http_cookie` and
- `app_cookie` types are applicable only to the `http` and `https` protocols.
- :param str cookie_name: (optional) The session persistence cookie name.
- Applicable only for type `app_cookie`. Names starting with `IBM` are not
- allowed.
- """
- self.cookie_name = cookie_name
- self.type = type
-
- @classmethod
- def from_dict(cls, _dict: Dict) -> 'LoadBalancerPoolSessionPersistencePrototype':
- """Initialize a LoadBalancerPoolSessionPersistencePrototype 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 LoadBalancerPoolSessionPersistencePrototype JSON')
- return cls(**args)
-
- @classmethod
- def _from_dict(cls, _dict):
- """Initialize a LoadBalancerPoolSessionPersistencePrototype object from a json dictionary."""
- return cls.from_dict(_dict)
+ Initialize a LoadBalancerPool object.
- def to_dict(self) -> Dict:
- """Return a json dictionary representing this model."""
- _dict = {}
- if hasattr(self, 'cookie_name') and self.cookie_name is not None:
- _dict['cookie_name'] = self.cookie_name
- if hasattr(self, 'type') and self.type is not None:
- _dict['type'] = self.type
- return _dict
-
- def _to_dict(self):
- """Return a json dictionary representing this model."""
- return self.to_dict()
-
- def __str__(self) -> str:
- """Return a `str` version of this LoadBalancerPoolSessionPersistencePrototype object."""
- return json.dumps(self.to_dict(), indent=2)
-
- def __eq__(self, other: 'LoadBalancerPoolSessionPersistencePrototype') -> bool:
- """Return `true` when self and other are equal, false otherwise."""
- if not isinstance(other, self.__class__):
- return False
- return self.__dict__ == other.__dict__
-
- def __ne__(self, other: 'LoadBalancerPoolSessionPersistencePrototype') -> bool:
- """Return `true` when self and other are not equal, false otherwise."""
- return not self == other
-
- class TypeEnum(str, Enum):
- """
- The session persistence type. The `http_cookie` and `app_cookie` types are
- applicable only to the `http` and `https` protocols.
- """
-
- APP_COOKIE = 'app_cookie'
- HTTP_COOKIE = 'http_cookie'
- SOURCE_IP = 'source_ip'
-
-
-
-class LoadBalancerPrivateIpsItem:
- """
- LoadBalancerPrivateIpsItem.
-
- :attr str address: The IP address.
- If the address has not yet been selected, the value will be `0.0.0.0`.
- This property may add support for IPv6 addresses in the future. When processing
- a value in this property, verify that the address is in an expected format. If
- it is not, log an error. Optionally halt processing and surface the error, or
- bypass the resource on which the unexpected IP address format was encountered.
- :attr ReservedIPReferenceDeleted deleted: (optional) If present, this property
- indicates the referenced resource has been deleted, and provides
- some supplementary information.
- :attr str href: The URL for this reserved IP.
- :attr str id: The unique identifier for this reserved IP.
- :attr str name: The name for this reserved IP. The name is unique across all
- reserved IPs in a subnet.
- :attr str resource_type: The resource type.
- """
-
- def __init__(
- self,
- address: str,
- href: str,
- id: str,
- name: str,
- resource_type: str,
- *,
- deleted: 'ReservedIPReferenceDeleted' = None,
- ) -> None:
- """
- Initialize a LoadBalancerPrivateIpsItem object.
-
- :param str address: The IP address.
- If the address has not yet been selected, the value will be `0.0.0.0`.
- This property may add support for IPv6 addresses in the future. When
- processing a value in this property, verify that the address is in an
- expected format. If it is not, log an error. Optionally halt processing and
- surface the error, or bypass the resource on which the unexpected IP
- address format was encountered.
- :param str href: The URL for this reserved IP.
- :param str id: The unique identifier for this reserved IP.
- :param str name: The name for this reserved IP. The name is unique across
- all reserved IPs in a subnet.
- :param str resource_type: The resource type.
- :param ReservedIPReferenceDeleted deleted: (optional) If present, this
- property indicates the referenced resource has been deleted, and provides
- some supplementary information.
+ :param str algorithm: The load balancing algorithm.
+ :param datetime created_at: The date and time that this pool was created.
+ :param LoadBalancerPoolHealthMonitor health_monitor: The health monitor of
+ this pool.
+ :param str href: The pool's canonical URL.
+ :param str id: The unique identifier for this load balancer pool.
+ :param str name: The name for this load balancer pool. The name is unique
+ across all pools for the load balancer.
+ :param str protocol: The protocol for this load balancer pool.
+ The enumerated values for this property are expected to expand in the
+ future. When processing this property, check for and log unknown values.
+ Optionally halt processing and surface the error, or bypass the pool on
+ which the unexpected property value was encountered.
+ :param str provisioning_status: The provisioning status of this pool
+ The enumerated values for this property are expected to expand in the
+ future. When processing this property, check for and log unknown values.
+ Optionally halt processing and surface the error, or bypass the pool on
+ which the unexpected property value was encountered.
+ :param str proxy_protocol: The PROXY protocol setting for this pool:
+ - `v1`: Enabled with version 1 (human-readable header format)
+ - `v2`: Enabled with version 2 (binary header format)
+ - `disabled`: Disabled
+ Supported by load balancers in the `application` family (otherwise always
+ `disabled`).
+ :param InstanceGroupReference instance_group: (optional) The instance group
+ that is managing this pool.
+ :param List[LoadBalancerPoolMemberReference] members: (optional) The
+ backend server members of the pool.
+ :param LoadBalancerPoolSessionPersistence session_persistence: (optional)
+ The session persistence of this pool.
+ The enumerated values for this property are expected to expand in the
+ future. When
+ processing this property, check for and log unknown values. Optionally halt
+ processing and surface the error, or bypass the pool on which the
+ unexpected
+ property value was encountered.
"""
- self.address = address
- self.deleted = deleted
+ 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.resource_type = resource_type
+ 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) -> 'LoadBalancerPrivateIpsItem':
- """Initialize a LoadBalancerPrivateIpsItem object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'LoadBalancerPool':
+ """Initialize a LoadBalancerPool object from a json dictionary."""
args = {}
- if 'address' in _dict:
- args['address'] = _dict.get('address')
+ if (algorithm := _dict.get('algorithm')) is not None:
+ args['algorithm'] = algorithm
else:
- raise ValueError('Required property \'address\' not present in LoadBalancerPrivateIpsItem JSON')
- if 'deleted' in _dict:
- args['deleted'] = ReservedIPReferenceDeleted.from_dict(_dict.get('deleted'))
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ raise ValueError('Required property \'algorithm\' not present in LoadBalancerPool JSON')
+ if (created_at := _dict.get('created_at')) is not None:
+ args['created_at'] = string_to_datetime(created_at)
else:
- raise ValueError('Required property \'href\' not present in LoadBalancerPrivateIpsItem JSON')
- if 'id' in _dict:
- args['id'] = _dict.get('id')
+ raise ValueError('Required property \'created_at\' not present in LoadBalancerPool JSON')
+ if (health_monitor := _dict.get('health_monitor')) is not None:
+ args['health_monitor'] = LoadBalancerPoolHealthMonitor.from_dict(health_monitor)
else:
- raise ValueError('Required property \'id\' not present in LoadBalancerPrivateIpsItem JSON')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
+ raise ValueError('Required property \'health_monitor\' not present in LoadBalancerPool JSON')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'name\' not present in LoadBalancerPrivateIpsItem JSON')
- if 'resource_type' in _dict:
- args['resource_type'] = _dict.get('resource_type')
+ raise ValueError('Required property \'href\' not present in LoadBalancerPool JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
else:
- raise ValueError('Required property \'resource_type\' not present in LoadBalancerPrivateIpsItem JSON')
+ raise ValueError('Required property \'id\' not present in LoadBalancerPool JSON')
+ if (instance_group := _dict.get('instance_group')) is not None:
+ args['instance_group'] = InstanceGroupReference.from_dict(instance_group)
+ if (members := _dict.get('members')) is not None:
+ args['members'] = [LoadBalancerPoolMemberReference.from_dict(v) for v in members]
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ else:
+ raise ValueError('Required property \'name\' not present in LoadBalancerPool JSON')
+ if (protocol := _dict.get('protocol')) is not None:
+ args['protocol'] = protocol
+ else:
+ raise ValueError('Required property \'protocol\' not present in LoadBalancerPool JSON')
+ if (provisioning_status := _dict.get('provisioning_status')) is not None:
+ args['provisioning_status'] = provisioning_status
+ else:
+ raise ValueError('Required property \'provisioning_status\' not present in LoadBalancerPool JSON')
+ if (proxy_protocol := _dict.get('proxy_protocol')) is not None:
+ args['proxy_protocol'] = proxy_protocol
+ else:
+ raise ValueError('Required property \'proxy_protocol\' not present in LoadBalancerPool JSON')
+ if (session_persistence := _dict.get('session_persistence')) is not None:
+ args['session_persistence'] = LoadBalancerPoolSessionPersistence.from_dict(session_persistence)
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a LoadBalancerPrivateIpsItem 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, 'address') and self.address is not None:
- _dict['address'] = self.address
- if hasattr(self, 'deleted') and self.deleted is not None:
- if isinstance(self.deleted, dict):
- _dict['deleted'] = self.deleted
+ if hasattr(self, 'algorithm') and self.algorithm is not None:
+ _dict['algorithm'] = self.algorithm
+ if hasattr(self, 'created_at') and self.created_at is not None:
+ _dict['created_at'] = datetime_to_string(self.created_at)
+ if hasattr(self, 'health_monitor') and self.health_monitor is not None:
+ if isinstance(self.health_monitor, dict):
+ _dict['health_monitor'] = self.health_monitor
else:
- _dict['deleted'] = self.deleted.to_dict()
+ _dict['health_monitor'] = self.health_monitor.to_dict()
if hasattr(self, 'href') and self.href is not None:
_dict['href'] = self.href
if hasattr(self, 'id') and self.id is not None:
_dict['id'] = self.id
+ if hasattr(self, 'instance_group') and self.instance_group is not None:
+ if isinstance(self.instance_group, dict):
+ _dict['instance_group'] = self.instance_group
+ else:
+ _dict['instance_group'] = self.instance_group.to_dict()
+ if hasattr(self, 'members') and self.members is not None:
+ members_list = []
+ for v in self.members:
+ if isinstance(v, dict):
+ members_list.append(v)
+ else:
+ members_list.append(v.to_dict())
+ _dict['members'] = members_list
if hasattr(self, 'name') and self.name is not None:
_dict['name'] = self.name
- if hasattr(self, 'resource_type') and self.resource_type is not None:
- _dict['resource_type'] = self.resource_type
+ if hasattr(self, 'protocol') and self.protocol is not None:
+ _dict['protocol'] = self.protocol
+ if hasattr(self, 'provisioning_status') and self.provisioning_status is not None:
+ _dict['provisioning_status'] = self.provisioning_status
+ if hasattr(self, 'proxy_protocol') and self.proxy_protocol is not None:
+ _dict['proxy_protocol'] = self.proxy_protocol
+ if hasattr(self, 'session_persistence') and self.session_persistence is not None:
+ if isinstance(self.session_persistence, dict):
+ _dict['session_persistence'] = self.session_persistence
+ else:
+ _dict['session_persistence'] = self.session_persistence.to_dict()
return _dict
def _to_dict(self):
@@ -57859,156 +61038,120 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this LoadBalancerPrivateIpsItem object."""
+ """Return a `str` version of this LoadBalancerPool object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'LoadBalancerPrivateIpsItem') -> 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: 'LoadBalancerPrivateIpsItem') -> bool:
+ def __ne__(self, other: 'LoadBalancerPool') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class ResourceTypeEnum(str, Enum):
+ class AlgorithmEnum(str, Enum):
"""
- The resource type.
+ The load balancing algorithm.
"""
- SUBNET_RESERVED_IP = 'subnet_reserved_ip'
+ LEAST_CONNECTIONS = 'least_connections'
+ ROUND_ROBIN = 'round_robin'
+ WEIGHTED_ROUND_ROBIN = 'weighted_round_robin'
+ class ProtocolEnum(str, Enum):
+ """
+ The protocol for this load balancer pool.
+ The enumerated values for this property are expected to 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.
+ """
-class LoadBalancerProfile:
+ HTTP = 'http'
+ HTTPS = 'https'
+ TCP = 'tcp'
+ UDP = 'udp'
+
+
+ class ProvisioningStatusEnum(str, Enum):
+ """
+ The provisioning status of this pool
+ The enumerated values for this property are expected to expand in the future. When
+ processing this property, check for and log unknown values. Optionally halt
+ processing and surface the error, or bypass the pool on which the unexpected
+ property value was encountered.
+ """
+
+ ACTIVE = 'active'
+ CREATE_PENDING = 'create_pending'
+ DELETE_PENDING = 'delete_pending'
+ FAILED = 'failed'
+ UPDATE_PENDING = 'update_pending'
+
+
+ class ProxyProtocolEnum(str, Enum):
+ """
+ The PROXY protocol setting for this pool:
+ - `v1`: Enabled with version 1 (human-readable header format)
+ - `v2`: Enabled with version 2 (binary header format)
+ - `disabled`: Disabled
+ Supported by load balancers in the `application` family (otherwise always
+ `disabled`).
+ """
+
+ DISABLED = 'disabled'
+ V1 = 'v1'
+ V2 = 'v2'
+
+
+
+class LoadBalancerPoolCollection:
"""
- LoadBalancerProfile.
+ LoadBalancerPoolCollection.
- :attr str family: The product family this load balancer profile belongs to.
- :attr str href: The URL for this load balancer profile.
- :attr LoadBalancerProfileInstanceGroupsSupported instance_groups_supported:
- :attr LoadBalancerProfileLoggingSupported logging_supported: Indicates which
- logging type(s) are supported for a load balancer with this profile.
- :attr str name: The globally unique name for this load balancer profile.
- :attr LoadBalancerProfileRouteModeSupported route_mode_supported:
- :attr LoadBalancerProfileSecurityGroupsSupported security_groups_supported:
- :attr LoadBalancerProfileUDPSupported udp_supported:
+ :param List[LoadBalancerPool] pools: Collection of pools.
"""
def __init__(
self,
- family: str,
- href: str,
- instance_groups_supported: 'LoadBalancerProfileInstanceGroupsSupported',
- logging_supported: 'LoadBalancerProfileLoggingSupported',
- name: str,
- route_mode_supported: 'LoadBalancerProfileRouteModeSupported',
- security_groups_supported: 'LoadBalancerProfileSecurityGroupsSupported',
- udp_supported: 'LoadBalancerProfileUDPSupported',
+ pools: List['LoadBalancerPool'],
) -> None:
"""
- Initialize a LoadBalancerProfile object.
+ Initialize a LoadBalancerPoolCollection object.
- :param str family: The product family this load balancer profile belongs
- to.
- :param str href: The URL for this load balancer profile.
- :param LoadBalancerProfileInstanceGroupsSupported
- instance_groups_supported:
- :param LoadBalancerProfileLoggingSupported logging_supported: Indicates
- which logging type(s) are supported for a load balancer with this profile.
- :param str name: The globally unique name for this load balancer profile.
- :param LoadBalancerProfileRouteModeSupported route_mode_supported:
- :param LoadBalancerProfileSecurityGroupsSupported
- security_groups_supported:
- :param LoadBalancerProfileUDPSupported udp_supported:
+ :param List[LoadBalancerPool] pools: Collection of pools.
"""
- self.family = family
- self.href = href
- self.instance_groups_supported = instance_groups_supported
- self.logging_supported = logging_supported
- self.name = name
- self.route_mode_supported = route_mode_supported
- self.security_groups_supported = security_groups_supported
- self.udp_supported = udp_supported
+ self.pools = pools
@classmethod
- def from_dict(cls, _dict: Dict) -> 'LoadBalancerProfile':
- """Initialize a LoadBalancerProfile object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'LoadBalancerPoolCollection':
+ """Initialize a LoadBalancerPoolCollection 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')
+ if (pools := _dict.get('pools')) is not None:
+ args['pools'] = [LoadBalancerPool.from_dict(v) for v in pools]
else:
- raise ValueError('Required property \'href\' not present in LoadBalancerProfile JSON')
- if 'instance_groups_supported' in _dict:
- args['instance_groups_supported'] = _dict.get('instance_groups_supported')
- else:
- raise ValueError('Required property \'instance_groups_supported\' not present in LoadBalancerProfile JSON')
- if 'logging_supported' in _dict:
- args['logging_supported'] = LoadBalancerProfileLoggingSupported.from_dict(_dict.get('logging_supported'))
- else:
- raise ValueError('Required property \'logging_supported\' not present in LoadBalancerProfile JSON')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
- else:
- raise ValueError('Required property \'name\' not present in LoadBalancerProfile JSON')
- if 'route_mode_supported' in _dict:
- args['route_mode_supported'] = _dict.get('route_mode_supported')
- else:
- raise ValueError('Required property \'route_mode_supported\' not present in LoadBalancerProfile JSON')
- if 'security_groups_supported' in _dict:
- args['security_groups_supported'] = _dict.get('security_groups_supported')
- else:
- raise ValueError('Required property \'security_groups_supported\' not present in LoadBalancerProfile JSON')
- if 'udp_supported' in _dict:
- args['udp_supported'] = _dict.get('udp_supported')
- else:
- raise ValueError('Required property \'udp_supported\' not present in LoadBalancerProfile JSON')
+ raise ValueError('Required property \'pools\' not present in LoadBalancerPoolCollection JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a LoadBalancerProfile 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, 'family') and self.family is not None:
- _dict['family'] = self.family
- if hasattr(self, 'href') and self.href is not None:
- _dict['href'] = self.href
- if hasattr(self, 'instance_groups_supported') and self.instance_groups_supported is not None:
- if isinstance(self.instance_groups_supported, dict):
- _dict['instance_groups_supported'] = self.instance_groups_supported
- else:
- _dict['instance_groups_supported'] = self.instance_groups_supported.to_dict()
- if hasattr(self, 'logging_supported') and self.logging_supported is not None:
- if isinstance(self.logging_supported, dict):
- _dict['logging_supported'] = self.logging_supported
- else:
- _dict['logging_supported'] = self.logging_supported.to_dict()
- if hasattr(self, 'name') and self.name is not None:
- _dict['name'] = self.name
- if hasattr(self, 'route_mode_supported') and self.route_mode_supported is not None:
- if isinstance(self.route_mode_supported, dict):
- _dict['route_mode_supported'] = self.route_mode_supported
- else:
- _dict['route_mode_supported'] = self.route_mode_supported.to_dict()
- if hasattr(self, 'security_groups_supported') and self.security_groups_supported is not None:
- if isinstance(self.security_groups_supported, dict):
- _dict['security_groups_supported'] = self.security_groups_supported
- else:
- _dict['security_groups_supported'] = self.security_groups_supported.to_dict()
- if hasattr(self, 'udp_supported') and self.udp_supported is not None:
- if isinstance(self.udp_supported, dict):
- _dict['udp_supported'] = self.udp_supported
- else:
- _dict['udp_supported'] = self.udp_supported.to_dict()
+ if hasattr(self, 'pools') and self.pools is not None:
+ pools_list = []
+ for v in self.pools:
+ if isinstance(v, dict):
+ pools_list.append(v)
+ else:
+ pools_list.append(v.to_dict())
+ _dict['pools'] = pools_list
return _dict
def _to_dict(self):
@@ -58016,118 +61159,121 @@ 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 LoadBalancerPoolCollection object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'LoadBalancerProfile') -> 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: 'LoadBalancerProfile') -> bool:
+ def __ne__(self, other: 'LoadBalancerPoolCollection') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class LoadBalancerProfileCollection:
+class LoadBalancerPoolHealthMonitor:
"""
- LoadBalancerProfileCollection.
+ LoadBalancerPoolHealthMonitor.
- :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.
+ :param int delay: The seconds to wait between health checks.
+ :param int max_retries: The health check max retries.
+ :param int port: (optional) The health check port.
+ If present, this overrides the pool member port values.
+ :param int timeout: The seconds to wait for a response to a health check.
+ :param str type: The protocol type to use for health checks.
+ The enumerated values for this property are expected to expand in the future.
+ When processing this property, check for and log unknown values. Optionally halt
+ processing and surface the error, or bypass the health monitor on which the
+ unexpected property value was encountered.
+ :param str url_path: (optional) The health check URL path. Applicable when
+ `type` is `http` or `https`.
+ Must be in the format of an [origin-form request
+ target](https://tools.ietf.org/html/rfc7230#section-5.3.1).
"""
def __init__(
self,
- first: 'LoadBalancerProfileCollectionFirst',
- limit: int,
- profiles: List['LoadBalancerProfile'],
- total_count: int,
+ delay: int,
+ max_retries: int,
+ timeout: int,
+ type: str,
*,
- next: 'LoadBalancerProfileCollectionNext' = None,
+ port: Optional[int] = None,
+ url_path: Optional[str] = None,
) -> None:
"""
- Initialize a LoadBalancerProfileCollection object.
+ Initialize a LoadBalancerPoolHealthMonitor 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 int delay: The seconds to wait between health checks.
+ :param int max_retries: The health check max retries.
+ :param int timeout: The seconds to wait for a response to a health check.
+ :param str type: The protocol type to use for health checks.
+ The enumerated values for this property are expected to expand in the
+ future. When processing this property, check for and log unknown values.
+ Optionally halt processing and surface the error, or bypass the health
+ monitor on which the unexpected property value was encountered.
+ :param int port: (optional) The health check port.
+ If present, this overrides the pool member port values.
+ :param str url_path: (optional) The health check URL path. Applicable when
+ `type` is `http` or `https`.
+ Must be in the format of an [origin-form request
+ target](https://tools.ietf.org/html/rfc7230#section-5.3.1).
"""
- self.first = first
- self.limit = limit
- self.next = next
- self.profiles = profiles
- self.total_count = total_count
+ 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) -> 'LoadBalancerProfileCollection':
- """Initialize a LoadBalancerProfileCollection object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'LoadBalancerPoolHealthMonitor':
+ """Initialize a LoadBalancerPoolHealthMonitor object from a json dictionary."""
args = {}
- if 'first' in _dict:
- args['first'] = LoadBalancerProfileCollectionFirst.from_dict(_dict.get('first'))
+ if (delay := _dict.get('delay')) is not None:
+ args['delay'] = delay
else:
- raise ValueError('Required property \'first\' not present in LoadBalancerProfileCollection JSON')
- if 'limit' in _dict:
- args['limit'] = _dict.get('limit')
+ raise ValueError('Required property \'delay\' not present in LoadBalancerPoolHealthMonitor JSON')
+ if (max_retries := _dict.get('max_retries')) is not None:
+ args['max_retries'] = max_retries
else:
- raise ValueError('Required property \'limit\' not present in LoadBalancerProfileCollection JSON')
- if 'next' in _dict:
- args['next'] = LoadBalancerProfileCollectionNext.from_dict(_dict.get('next'))
- if 'profiles' in _dict:
- args['profiles'] = [LoadBalancerProfile.from_dict(v) for v in _dict.get('profiles')]
+ raise ValueError('Required property \'max_retries\' not present in LoadBalancerPoolHealthMonitor JSON')
+ if (port := _dict.get('port')) is not None:
+ args['port'] = port
+ if (timeout := _dict.get('timeout')) is not None:
+ args['timeout'] = timeout
else:
- raise ValueError('Required property \'profiles\' not present in LoadBalancerProfileCollection JSON')
- if 'total_count' in _dict:
- args['total_count'] = _dict.get('total_count')
+ raise ValueError('Required property \'timeout\' not present in LoadBalancerPoolHealthMonitor JSON')
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
else:
- raise ValueError('Required property \'total_count\' not present in LoadBalancerProfileCollection JSON')
+ raise ValueError('Required property \'type\' not present in LoadBalancerPoolHealthMonitor JSON')
+ if (url_path := _dict.get('url_path')) is not None:
+ args['url_path'] = url_path
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a LoadBalancerProfileCollection 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, 'first') and self.first is not None:
- if isinstance(self.first, dict):
- _dict['first'] = self.first
- else:
- _dict['first'] = self.first.to_dict()
- if hasattr(self, 'limit') and self.limit is not None:
- _dict['limit'] = self.limit
- if hasattr(self, 'next') and self.next is not None:
- if isinstance(self.next, dict):
- _dict['next'] = self.next
- else:
- _dict['next'] = self.next.to_dict()
- if hasattr(self, 'profiles') and self.profiles is not None:
- profiles_list = []
- for v in self.profiles:
- if isinstance(v, dict):
- profiles_list.append(v)
- else:
- profiles_list.append(v.to_dict())
- _dict['profiles'] = profiles_list
- if hasattr(self, 'total_count') and self.total_count is not None:
- _dict['total_count'] = self.total_count
+ if hasattr(self, '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):
@@ -58135,58 +61281,133 @@ 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 LoadBalancerPoolHealthMonitor object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'LoadBalancerProfileCollection') -> 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: 'LoadBalancerProfileCollection') -> bool:
+ def __ne__(self, other: 'LoadBalancerPoolHealthMonitor') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
+ class TypeEnum(str, Enum):
+ """
+ The protocol type to use for health checks.
+ The enumerated values for this property are expected to expand in the future. When
+ processing this property, check for and log unknown values. Optionally halt
+ processing and surface the error, or bypass the health monitor on which the
+ unexpected property value was encountered.
+ """
+
+ HTTP = 'http'
+ HTTPS = 'https'
+ TCP = 'tcp'
-class LoadBalancerProfileCollectionFirst:
+
+
+class LoadBalancerPoolHealthMonitorPatch:
"""
- A link to the first page of resources.
+ LoadBalancerPoolHealthMonitorPatch.
- :attr str href: The URL for a page of resources.
+ :param int delay: The seconds to wait between health checks. Must be greater
+ than `timeout`.
+ :param int max_retries: The health check max retries.
+ :param int port: (optional) The health check port.
+ If set, this overrides the pool member port values.
+ Specify `null` to remove an existing health check port.
+ :param int timeout: The seconds to wait for a response to a health check. Must
+ be less than `delay`.
+ :param str type: The protocol type to use for health checks.
+ :param str url_path: (optional) The health check URL path. Applicable when
+ `type` is `http` or `https`.
+ Must be in the format of an [origin-form request
+ target](https://tools.ietf.org/html/rfc7230#section-5.3.1).
"""
def __init__(
self,
- href: str,
+ delay: int,
+ max_retries: int,
+ timeout: int,
+ type: str,
+ *,
+ port: Optional[int] = None,
+ url_path: Optional[str] = None,
) -> None:
"""
- Initialize a LoadBalancerProfileCollectionFirst object.
+ Initialize a LoadBalancerPoolHealthMonitorPatch object.
- :param str href: The URL for a page of resources.
+ :param int delay: The seconds to wait between health checks. Must be
+ greater than `timeout`.
+ :param int max_retries: The health check max retries.
+ :param int timeout: The seconds to wait for a response to a health check.
+ Must be less than `delay`.
+ :param str type: The protocol type to use for health checks.
+ :param int port: (optional) The health check port.
+ If set, this overrides the pool member port values.
+ Specify `null` to remove an existing health check port.
+ :param str url_path: (optional) The health check URL path. Applicable when
+ `type` is `http` or `https`.
+ Must be in the format of an [origin-form request
+ target](https://tools.ietf.org/html/rfc7230#section-5.3.1).
"""
- self.href = href
-
- @classmethod
- def from_dict(cls, _dict: Dict) -> 'LoadBalancerProfileCollectionFirst':
- """Initialize a LoadBalancerProfileCollectionFirst object from a json dictionary."""
+ 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) -> 'LoadBalancerPoolHealthMonitorPatch':
+ """Initialize a LoadBalancerPoolHealthMonitorPatch object from a json dictionary."""
args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ if (delay := _dict.get('delay')) is not None:
+ args['delay'] = delay
else:
- raise ValueError('Required property \'href\' not present in LoadBalancerProfileCollectionFirst JSON')
+ raise ValueError('Required property \'delay\' not present in LoadBalancerPoolHealthMonitorPatch JSON')
+ if (max_retries := _dict.get('max_retries')) is not None:
+ args['max_retries'] = max_retries
+ else:
+ raise ValueError('Required property \'max_retries\' not present in LoadBalancerPoolHealthMonitorPatch JSON')
+ if (port := _dict.get('port')) is not None:
+ args['port'] = port
+ if (timeout := _dict.get('timeout')) is not None:
+ args['timeout'] = timeout
+ else:
+ raise ValueError('Required property \'timeout\' not present in LoadBalancerPoolHealthMonitorPatch JSON')
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
+ else:
+ raise ValueError('Required property \'type\' not present in LoadBalancerPoolHealthMonitorPatch JSON')
+ if (url_path := _dict.get('url_path')) is not None:
+ args['url_path'] = url_path
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a LoadBalancerProfileCollectionFirst 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, 'href') and self.href is not None:
- _dict['href'] = self.href
+ 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):
@@ -58194,59 +61415,127 @@ 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 LoadBalancerPoolHealthMonitorPatch object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'LoadBalancerProfileCollectionFirst') -> 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: 'LoadBalancerProfileCollectionFirst') -> bool:
+ def __ne__(self, other: 'LoadBalancerPoolHealthMonitorPatch') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
+ class TypeEnum(str, Enum):
+ """
+ The protocol type to use for health checks.
+ """
-class LoadBalancerProfileCollectionNext:
+ HTTP = 'http'
+ HTTPS = 'https'
+ TCP = 'tcp'
+
+
+
+class LoadBalancerPoolHealthMonitorPrototype:
"""
- A link to the next page of resources. This property is present for all pages except
- the last page.
+ LoadBalancerPoolHealthMonitorPrototype.
- :attr str href: The URL for a page of resources.
+ :param int delay: The seconds to wait between health checks. Must be greater
+ than `timeout`.
+ :param int max_retries: The health check max retries.
+ :param int port: (optional) The health check port.
+ If specified, this overrides the pool member port values.
+ :param int timeout: The seconds to wait for a response to a health check. Must
+ be less than `delay`.
+ :param str type: The protocol type to use for health checks.
+ :param str url_path: (optional) The health check URL path. Applicable when
+ `type` is `http` or `https`.
+ Must be in the format of an [origin-form request
+ target](https://tools.ietf.org/html/rfc7230#section-5.3.1).
"""
def __init__(
self,
- href: str,
+ delay: int,
+ max_retries: int,
+ timeout: int,
+ type: str,
+ *,
+ port: Optional[int] = None,
+ url_path: Optional[str] = None,
) -> None:
"""
- Initialize a LoadBalancerProfileCollectionNext object.
+ Initialize a LoadBalancerPoolHealthMonitorPrototype object.
- :param str href: The URL for a page of resources.
+ :param int delay: The seconds to wait between health checks. Must be
+ greater than `timeout`.
+ :param int max_retries: The health check max retries.
+ :param int timeout: The seconds to wait for a response to a health check.
+ Must be less than `delay`.
+ :param str type: The protocol type to use for health checks.
+ :param int port: (optional) The health check port.
+ If specified, this overrides the pool member port values.
+ :param str url_path: (optional) The health check URL path. Applicable when
+ `type` is `http` or `https`.
+ Must be in the format of an [origin-form request
+ target](https://tools.ietf.org/html/rfc7230#section-5.3.1).
"""
- self.href = href
+ 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) -> 'LoadBalancerProfileCollectionNext':
- """Initialize a LoadBalancerProfileCollectionNext object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'LoadBalancerPoolHealthMonitorPrototype':
+ """Initialize a LoadBalancerPoolHealthMonitorPrototype object from a json dictionary."""
args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ if (delay := _dict.get('delay')) is not None:
+ args['delay'] = delay
else:
- raise ValueError('Required property \'href\' not present in LoadBalancerProfileCollectionNext JSON')
+ raise ValueError('Required property \'delay\' not present in LoadBalancerPoolHealthMonitorPrototype JSON')
+ if (max_retries := _dict.get('max_retries')) is not None:
+ args['max_retries'] = max_retries
+ else:
+ raise ValueError('Required property \'max_retries\' not present in LoadBalancerPoolHealthMonitorPrototype JSON')
+ if (port := _dict.get('port')) is not None:
+ args['port'] = port
+ if (timeout := _dict.get('timeout')) is not None:
+ args['timeout'] = timeout
+ else:
+ raise ValueError('Required property \'timeout\' not present in LoadBalancerPoolHealthMonitorPrototype JSON')
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
+ else:
+ raise ValueError('Required property \'type\' not present in LoadBalancerPoolHealthMonitorPrototype JSON')
+ if (url_path := _dict.get('url_path')) is not None:
+ args['url_path'] = url_path
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a LoadBalancerProfileCollectionNext object from a json dictionary."""
+ """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, 'href') and self.href is not None:
- _dict['href'] = self.href
+ 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):
@@ -58254,42 +61543,33 @@ 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 LoadBalancerPoolHealthMonitorPrototype object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'LoadBalancerProfileCollectionNext') -> 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: 'LoadBalancerProfileCollectionNext') -> bool:
+ def __ne__(self, other: 'LoadBalancerPoolHealthMonitorPrototype') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-
-class LoadBalancerProfileIdentity:
- """
- Identifies a load balancer profile by a unique property.
-
- """
-
- def __init__(
- self,
- ) -> None:
+ class TypeEnum(str, Enum):
"""
- Initialize a LoadBalancerProfileIdentity object.
-
+ The protocol type to use for health checks.
"""
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['LoadBalancerProfileIdentityByName', 'LoadBalancerProfileIdentityByHref'])
- )
- raise Exception(msg)
+
+ HTTP = 'http'
+ HTTPS = 'https'
+ TCP = 'tcp'
-class LoadBalancerProfileInstanceGroupsSupported:
+
+class LoadBalancerPoolIdentity:
"""
- LoadBalancerProfileInstanceGroupsSupported.
+ Identifies a load balancer pool by a unique property.
"""
@@ -58297,65 +61577,55 @@ def __init__(
self,
) -> None:
"""
- Initialize a LoadBalancerProfileInstanceGroupsSupported object.
+ Initialize a LoadBalancerPoolIdentity object.
"""
msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['LoadBalancerProfileInstanceGroupsSupportedFixed', 'LoadBalancerProfileInstanceGroupsSupportedDependent'])
+ ", ".join(['LoadBalancerPoolIdentityById', 'LoadBalancerPoolIdentityByHref'])
)
raise Exception(msg)
-class LoadBalancerProfileLoggingSupported:
+class LoadBalancerPoolIdentityByName:
"""
- Indicates which logging type(s) are supported for a load balancer with this profile.
+ LoadBalancerPoolIdentityByName.
- :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.
+ :param str name: The name for this load balancer pool. The name is unique across
+ all pools for the load balancer.
"""
def __init__(
self,
- type: str,
- value: List[str],
+ name: str,
) -> None:
"""
- Initialize a LoadBalancerProfileLoggingSupported object.
+ Initialize a LoadBalancerPoolIdentityByName 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 str name: The name for this load balancer pool. The name is unique
+ across all pools for the load balancer.
"""
- self.type = type
- self.value = value
+ self.name = name
@classmethod
- def from_dict(cls, _dict: Dict) -> 'LoadBalancerProfileLoggingSupported':
- """Initialize a LoadBalancerProfileLoggingSupported object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'LoadBalancerPoolIdentityByName':
+ """Initialize a LoadBalancerPoolIdentityByName object from a json dictionary."""
args = {}
- 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')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
else:
- raise ValueError('Required property \'value\' not present in LoadBalancerProfileLoggingSupported JSON')
+ raise ValueError('Required property \'name\' not present in LoadBalancerPoolIdentityByName JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a LoadBalancerProfileLoggingSupported 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, 'type') and self.type is not None:
- _dict['type'] = self.type
- if hasattr(self, 'value') and self.value is not None:
- _dict['value'] = self.value
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
return _dict
def _to_dict(self):
@@ -58363,87 +61633,165 @@ 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 LoadBalancerPoolIdentityByName object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'LoadBalancerProfileLoggingSupported') -> 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: 'LoadBalancerProfileLoggingSupported') -> bool:
+ def __ne__(self, other: 'LoadBalancerPoolIdentityByName') -> 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 LoadBalancerPoolMember:
"""
- LoadBalancerProfileReference.
+ LoadBalancerPoolMember.
- :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.
+ :param datetime created_at: The date and time that this member was created.
+ :param str health: Health of the server member in the pool.
+ :param str href: The member's canonical URL.
+ :param str id: The unique identifier for this load balancer pool member.
+ :param int port: The port the member will receive load balancer traffic on.
+ Applies only to load balancer traffic received on a listener with a single port.
+ (If the traffic is received on a listener with a port range, the member will
+ receive the traffic on the same port the listener received it on.)
+ This port will also be used for health checks unless the `port` property of
+ `health_monitor` property is specified.
+ :param str provisioning_status: The provisioning status of this member
+ The enumerated values for this property are expected to expand in the future.
+ When processing this property, check for and log unknown values. Optionally halt
+ processing and surface the error, or bypass the pool member on which the
+ unexpected property value was encountered.
+ :param LoadBalancerPoolMemberTarget target: The pool member target. Load
+ balancers in the `network` family support virtual server
+ instances. Load balancers in the `application` family support IP addresses. If
+ the load
+ balancer has route mode enabled, the member must be in a zone the load balancer
+ has a
+ subnet in.
+ :param int weight: (optional) Weight of the server member. Applicable only if
+ the pool algorithm is
+ `weighted_round_robin`.
"""
def __init__(
self,
- family: str,
+ created_at: datetime,
+ health: str,
href: str,
- name: str,
+ id: str,
+ port: int,
+ provisioning_status: str,
+ target: 'LoadBalancerPoolMemberTarget',
+ *,
+ weight: Optional[int] = None,
) -> None:
"""
- Initialize a LoadBalancerProfileReference object.
+ Initialize a LoadBalancerPoolMember object.
- :param str family: The product family this load balancer profile belongs
- to.
- :param str href: The URL for this load balancer profile.
- :param str name: The globally unique name for this load balancer profile.
+ :param datetime created_at: The date and time that this member was created.
+ :param str health: Health of the server member in the pool.
+ :param str href: The member's canonical URL.
+ :param str id: The unique identifier for this load balancer pool member.
+ :param int port: The port the member will receive load balancer traffic on.
+ Applies only to load balancer traffic received on a listener with a single
+ port. (If the traffic is received on a listener with a port range, the
+ member will receive the traffic on the same port the listener received it
+ on.)
+ This port will also be used for health checks unless the `port` property of
+ `health_monitor` property is specified.
+ :param str provisioning_status: The provisioning status of this member
+ The enumerated values for this property are expected to expand in the
+ future. When processing this property, check for and log unknown values.
+ Optionally halt processing and surface the error, or bypass the pool member
+ on which the unexpected property value was encountered.
+ :param LoadBalancerPoolMemberTarget target: The pool member target. Load
+ balancers in the `network` family support virtual server
+ instances. Load balancers in the `application` family support IP addresses.
+ If the load
+ balancer has route mode enabled, the member must be in a zone the load
+ balancer has a
+ subnet in.
+ :param int weight: (optional) Weight of the server member. Applicable only
+ if the pool algorithm is
+ `weighted_round_robin`.
"""
- self.family = family
+ self.created_at = created_at
+ self.health = health
self.href = href
- self.name = name
+ self.id = id
+ self.port = port
+ self.provisioning_status = provisioning_status
+ self.target = target
+ self.weight = weight
@classmethod
- def from_dict(cls, _dict: Dict) -> 'LoadBalancerProfileReference':
- """Initialize a LoadBalancerProfileReference object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'LoadBalancerPoolMember':
+ """Initialize a LoadBalancerPoolMember object from a json dictionary."""
args = {}
- if 'family' in _dict:
- args['family'] = _dict.get('family')
+ if (created_at := _dict.get('created_at')) is not None:
+ args['created_at'] = string_to_datetime(created_at)
else:
- raise ValueError('Required property \'family\' not present in LoadBalancerProfileReference JSON')
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ raise ValueError('Required property \'created_at\' not present in LoadBalancerPoolMember JSON')
+ if (health := _dict.get('health')) is not None:
+ args['health'] = health
else:
- raise ValueError('Required property \'href\' not present in LoadBalancerProfileReference JSON')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
+ raise ValueError('Required property \'health\' not present in LoadBalancerPoolMember JSON')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'name\' not present in LoadBalancerProfileReference JSON')
+ raise ValueError('Required property \'href\' not present in LoadBalancerPoolMember JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
+ else:
+ raise ValueError('Required property \'id\' not present in LoadBalancerPoolMember JSON')
+ if (port := _dict.get('port')) is not None:
+ args['port'] = port
+ else:
+ raise ValueError('Required property \'port\' not present in LoadBalancerPoolMember JSON')
+ if (provisioning_status := _dict.get('provisioning_status')) is not None:
+ args['provisioning_status'] = provisioning_status
+ else:
+ raise ValueError('Required property \'provisioning_status\' not present in LoadBalancerPoolMember JSON')
+ if (target := _dict.get('target')) is not None:
+ args['target'] = target
+ else:
+ raise ValueError('Required property \'target\' not present in LoadBalancerPoolMember JSON')
+ if (weight := _dict.get('weight')) is not None:
+ args['weight'] = weight
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a LoadBalancerProfileReference 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, 'family') and self.family is not None:
- _dict['family'] = self.family
+ 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, 'name') and self.name is not None:
- _dict['name'] = self.name
+ 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):
@@ -58451,116 +61799,90 @@ 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 LoadBalancerPoolMember object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'LoadBalancerProfileReference') -> 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: 'LoadBalancerProfileReference') -> bool:
+ def __ne__(self, other: 'LoadBalancerPoolMember') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-
-class LoadBalancerProfileRouteModeSupported:
- """
- LoadBalancerProfileRouteModeSupported.
-
- """
-
- def __init__(
- self,
- ) -> None:
+ class HealthEnum(str, Enum):
"""
- Initialize a LoadBalancerProfileRouteModeSupported object.
-
+ Health of the server member in the pool.
"""
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['LoadBalancerProfileRouteModeSupportedFixed', 'LoadBalancerProfileRouteModeSupportedDependent'])
- )
- raise Exception(msg)
-
-class LoadBalancerProfileSecurityGroupsSupported:
- """
- LoadBalancerProfileSecurityGroupsSupported.
+ FAULTED = 'faulted'
+ OK = 'ok'
+ UNKNOWN = 'unknown'
- """
- def __init__(
- self,
- ) -> None:
+ class ProvisioningStatusEnum(str, Enum):
"""
- Initialize a LoadBalancerProfileSecurityGroupsSupported object.
-
+ The provisioning status of this member
+ The enumerated values for this property are expected to expand in the future. When
+ processing this property, check for and log unknown values. Optionally halt
+ processing and surface the error, or bypass the pool member on which the
+ unexpected property value was encountered.
"""
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['LoadBalancerProfileSecurityGroupsSupportedFixed', 'LoadBalancerProfileSecurityGroupsSupportedDependent'])
- )
- raise Exception(msg)
-
-
-class LoadBalancerProfileUDPSupported:
- """
- LoadBalancerProfileUDPSupported.
-
- """
- def __init__(
- self,
- ) -> None:
- """
- Initialize a LoadBalancerProfileUDPSupported object.
+ ACTIVE = 'active'
+ CREATE_PENDING = 'create_pending'
+ DELETE_PENDING = 'delete_pending'
+ FAILED = 'failed'
+ UPDATE_PENDING = 'update_pending'
- """
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['LoadBalancerProfileUDPSupportedFixed', 'LoadBalancerProfileUDPSupportedDependent'])
- )
- raise Exception(msg)
-class LoadBalancerReferenceDeleted:
+class LoadBalancerPoolMemberCollection:
"""
- If present, this property indicates the referenced resource has been deleted, and
- provides some supplementary information.
+ LoadBalancerPoolMemberCollection.
- :attr str more_info: Link to documentation about deleted resources.
+ :param List[LoadBalancerPoolMember] members: Collection of members.
"""
def __init__(
self,
- more_info: str,
+ members: List['LoadBalancerPoolMember'],
) -> None:
"""
- Initialize a LoadBalancerReferenceDeleted object.
+ Initialize a LoadBalancerPoolMemberCollection object.
- :param str more_info: Link to documentation about deleted resources.
+ :param List[LoadBalancerPoolMember] members: Collection of members.
"""
- self.more_info = more_info
+ self.members = members
@classmethod
- def from_dict(cls, _dict: Dict) -> 'LoadBalancerReferenceDeleted':
- """Initialize a LoadBalancerReferenceDeleted object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'LoadBalancerPoolMemberCollection':
+ """Initialize a LoadBalancerPoolMemberCollection object from a json dictionary."""
args = {}
- if 'more_info' in _dict:
- args['more_info'] = _dict.get('more_info')
+ if (members := _dict.get('members')) is not None:
+ args['members'] = [LoadBalancerPoolMember.from_dict(v) for v in members]
else:
- raise ValueError('Required property \'more_info\' not present in LoadBalancerReferenceDeleted JSON')
+ raise ValueError('Required property \'members\' not present in LoadBalancerPoolMemberCollection JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a LoadBalancerReferenceDeleted 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, 'more_info') and self.more_info is not None:
- _dict['more_info'] = self.more_info
+ if hasattr(self, 'members') and self.members is not None:
+ members_list = []
+ for v in self.members:
+ if isinstance(v, dict):
+ members_list.append(v)
+ else:
+ members_list.append(v.to_dict())
+ _dict['members'] = members_list
return _dict
def _to_dict(self):
@@ -58568,260 +61890,220 @@ 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 LoadBalancerPoolMemberCollection object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'LoadBalancerReferenceDeleted') -> 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: 'LoadBalancerReferenceDeleted') -> bool:
+ def __ne__(self, other: 'LoadBalancerPoolMemberCollection') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class LoadBalancerStatistics:
+class LoadBalancerPoolMemberPatch:
"""
- LoadBalancerStatistics.
+ LoadBalancerPoolMemberPatch.
- :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.
+ :param int port: (optional) The port the member will receive load balancer
+ traffic on. Applies only to load balancer traffic received on a listener with a
+ single port. (If the traffic is received on a listener with a port range, the
+ member will receive the traffic on the same port the listener received it on.)
+ This port will also be used for health checks unless the `port` property of
+ `health_monitor` property is specified.
+ The port must be unique across all members for all pools associated with this
+ pool's listener.
+ :param LoadBalancerPoolMemberTargetPrototype target: (optional) The pool member
+ target. Load balancers in the `network` family support virtual server
+ instances. Load balancers in the `application` family support IP addresses. If
+ the load
+ balancer has route mode enabled, the member must be in a zone the load balancer
+ has a
+ subnet in.
+ :param int weight: (optional) Weight of the server member. Applicable only if
+ the pool algorithm is
+ `weighted_round_robin`.
"""
def __init__(
self,
- active_connections: int,
- connection_rate: float,
- data_processed_this_month: int,
- throughput: float,
+ *,
+ port: Optional[int] = None,
+ target: Optional['LoadBalancerPoolMemberTargetPrototype'] = None,
+ weight: Optional[int] = None,
) -> None:
"""
- Initialize a LoadBalancerStatistics object.
+ Initialize a LoadBalancerPoolMemberPatch 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 int port: (optional) The port the member will receive load balancer
+ traffic on. Applies only to load balancer traffic received on a listener
+ with a single port. (If the traffic is received on a listener with a port
+ range, the member will receive the traffic on the same port the listener
+ received it on.)
+ This port will also be used for health checks unless the `port` property of
+ `health_monitor` property is specified.
+ The port must be unique across all members for all pools associated with
+ this pool's listener.
+ :param LoadBalancerPoolMemberTargetPrototype target: (optional) The pool
+ member target. Load balancers in the `network` family support virtual
+ server
+ instances. Load balancers in the `application` family support IP addresses.
+ If the load
+ balancer has route mode enabled, the member must be in a zone the load
+ balancer has a
+ subnet in.
+ :param int weight: (optional) Weight of the server member. Applicable only
+ if the pool algorithm is
+ `weighted_round_robin`.
"""
- self.active_connections = active_connections
- self.connection_rate = connection_rate
- self.data_processed_this_month = data_processed_this_month
- self.throughput = throughput
+ self.port = port
+ self.target = target
+ self.weight = weight
@classmethod
- def from_dict(cls, _dict: Dict) -> 'LoadBalancerStatistics':
- """Initialize a LoadBalancerStatistics object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'LoadBalancerPoolMemberPatch':
+ """Initialize a LoadBalancerPoolMemberPatch object from a json dictionary."""
args = {}
- if 'active_connections' in _dict:
- args['active_connections'] = _dict.get('active_connections')
- else:
- raise ValueError('Required property \'active_connections\' not present in LoadBalancerStatistics JSON')
- if 'connection_rate' in _dict:
- args['connection_rate'] = _dict.get('connection_rate')
- else:
- raise ValueError('Required property \'connection_rate\' not present in LoadBalancerStatistics JSON')
- if 'data_processed_this_month' in _dict:
- args['data_processed_this_month'] = _dict.get('data_processed_this_month')
- else:
- raise ValueError('Required property \'data_processed_this_month\' not present in LoadBalancerStatistics JSON')
- if 'throughput' in _dict:
- args['throughput'] = _dict.get('throughput')
- else:
- raise ValueError('Required property \'throughput\' not present in LoadBalancerStatistics JSON')
+ if (port := _dict.get('port')) is not None:
+ args['port'] = port
+ if (target := _dict.get('target')) is not None:
+ args['target'] = target
+ if (weight := _dict.get('weight')) is not None:
+ args['weight'] = weight
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a LoadBalancerStatistics 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, '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):
- """Return a json dictionary representing this model."""
- return self.to_dict()
-
- def __str__(self) -> str:
- """Return a `str` version of this LoadBalancerStatistics object."""
+ 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):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
+
+ def __str__(self) -> str:
+ """Return a `str` version of this LoadBalancerPoolMemberPatch object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'LoadBalancerStatistics') -> 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: 'LoadBalancerStatistics') -> bool:
+ def __ne__(self, other: 'LoadBalancerPoolMemberPatch') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class NetworkACL:
+class LoadBalancerPoolMemberPrototype:
"""
- NetworkACL.
+ LoadBalancerPoolMemberPrototype.
- :attr datetime created_at: The date and time that the network ACL was created.
- :attr str crn: The CRN for this network ACL.
- :attr str href: The URL for this network ACL.
- :attr str id: The unique identifier for this network ACL.
- :attr str name: The name for this network ACL. The name is unique across all
- network ACLs for the VPC.
- :attr ResourceGroupReference resource_group: The resource group for this network
- ACL.
- :attr List[NetworkACLRuleItem] rules: The ordered rules for this network ACL. If
- no rules exist, all traffic will be denied.
- :attr List[SubnetReference] subnets: The subnets to which this network ACL is
- attached.
- :attr VPCReference vpc: The VPC this network ACL resides in.
+ :param int port: The port the member will receive load balancer traffic on.
+ Applies only to load balancer traffic received on a listener with a single port.
+ (If the traffic is received on a listener with a port range, the member will
+ receive the traffic on the same port the listener received it on.)
+ This port will also be used for health checks unless the `port` property of
+ `health_monitor` property is specified.
+ The port must be unique across all members for all pools associated with this
+ pool's listener.
+ :param LoadBalancerPoolMemberTargetPrototype target: The pool member target.
+ Load balancers in the `network` family support virtual server
+ instances. Load balancers in the `application` family support IP addresses. If
+ the load
+ balancer has route mode enabled, the member must be in a zone the load balancer
+ has a
+ subnet in.
+ :param int weight: (optional) Weight of the server member. Applicable only if
+ the pool algorithm is
+ `weighted_round_robin`.
"""
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',
+ port: int,
+ target: 'LoadBalancerPoolMemberTargetPrototype',
+ *,
+ weight: Optional[int] = None,
) -> None:
"""
- Initialize a NetworkACL object.
+ Initialize a LoadBalancerPoolMemberPrototype object.
- :param datetime created_at: The date and time that the network ACL was
- created.
- :param str crn: The CRN for this network ACL.
- :param str href: The URL for this network ACL.
- :param str id: The unique identifier for this network ACL.
- :param str name: The name for this network ACL. The name is unique across
- all network ACLs for the VPC.
- :param ResourceGroupReference resource_group: The resource group for this
- network ACL.
- :param List[NetworkACLRuleItem] rules: The ordered rules for this network
- ACL. If no rules exist, all traffic will be denied.
- :param List[SubnetReference] subnets: The subnets to which this network ACL
- is attached.
- :param VPCReference vpc: The VPC this network ACL resides in.
+ :param int port: The port the member will receive load balancer traffic on.
+ Applies only to load balancer traffic received on a listener with a single
+ port. (If the traffic is received on a listener with a port range, the
+ member will receive the traffic on the same port the listener received it
+ on.)
+ This port will also be used for health checks unless the `port` property of
+ `health_monitor` property is specified.
+ The port must be unique across all members for all pools associated with
+ this pool's listener.
+ :param LoadBalancerPoolMemberTargetPrototype target: The pool member
+ target. Load balancers in the `network` family support virtual server
+ instances. Load balancers in the `application` family support IP addresses.
+ If the load
+ balancer has route mode enabled, the member must be in a zone the load
+ balancer has a
+ subnet in.
+ :param int weight: (optional) Weight of the server member. Applicable only
+ if the pool algorithm is
+ `weighted_round_robin`.
"""
- self.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
+ self.port = port
+ self.target = target
+ self.weight = weight
@classmethod
- def from_dict(cls, _dict: Dict) -> 'NetworkACL':
- """Initialize a NetworkACL object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'LoadBalancerPoolMemberPrototype':
+ """Initialize a LoadBalancerPoolMemberPrototype object from a json dictionary."""
args = {}
- if 'created_at' in _dict:
- args['created_at'] = string_to_datetime(_dict.get('created_at'))
- else:
- raise ValueError('Required property \'created_at\' not present in NetworkACL JSON')
- if 'crn' in _dict:
- args['crn'] = _dict.get('crn')
- else:
- raise ValueError('Required property \'crn\' not present in NetworkACL JSON')
- 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 \'name\' not present in NetworkACL JSON')
- if 'resource_group' in _dict:
- args['resource_group'] = ResourceGroupReference.from_dict(_dict.get('resource_group'))
- else:
- raise ValueError('Required property \'resource_group\' not present in NetworkACL JSON')
- if 'rules' in _dict:
- args['rules'] = [NetworkACLRuleItem.from_dict(v) for v in _dict.get('rules')]
- else:
- raise ValueError('Required property \'rules\' not present in NetworkACL JSON')
- if 'subnets' in _dict:
- args['subnets'] = [SubnetReference.from_dict(v) for v in _dict.get('subnets')]
+ if (port := _dict.get('port')) is not None:
+ args['port'] = port
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 \'port\' not present in LoadBalancerPoolMemberPrototype JSON')
+ if (target := _dict.get('target')) is not None:
+ args['target'] = target
else:
- raise ValueError('Required property \'vpc\' not present in NetworkACL JSON')
+ raise ValueError('Required property \'target\' not present in LoadBalancerPoolMemberPrototype JSON')
+ if (weight := _dict.get('weight')) is not None:
+ args['weight'] = weight
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a NetworkACL 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, 'created_at') and self.created_at is not None:
- _dict['created_at'] = datetime_to_string(self.created_at)
- if hasattr(self, 'crn') and self.crn is not None:
- _dict['crn'] = self.crn
- if hasattr(self, 'href') and self.href is not None:
- _dict['href'] = self.href
- if hasattr(self, 'id') and self.id is not None:
- _dict['id'] = self.id
- if hasattr(self, 'name') and self.name is not None:
- _dict['name'] = self.name
- if hasattr(self, 'resource_group') and self.resource_group is not None:
- if isinstance(self.resource_group, dict):
- _dict['resource_group'] = self.resource_group
- else:
- _dict['resource_group'] = self.resource_group.to_dict()
- if hasattr(self, 'rules') and self.rules is not None:
- rules_list = []
- for v in self.rules:
- if isinstance(v, dict):
- rules_list.append(v)
- else:
- rules_list.append(v.to_dict())
- _dict['rules'] = rules_list
- if hasattr(self, 'subnets') and self.subnets is not None:
- subnets_list = []
- for v in self.subnets:
- if isinstance(v, dict):
- subnets_list.append(v)
- else:
- subnets_list.append(v.to_dict())
- _dict['subnets'] = subnets_list
- if hasattr(self, 'vpc') and self.vpc is not None:
- if isinstance(self.vpc, dict):
- _dict['vpc'] = self.vpc
+ 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['vpc'] = self.vpc.to_dict()
+ _dict['target'] = self.target.to_dict()
+ if hasattr(self, 'weight') and self.weight is not None:
+ _dict['weight'] = self.weight
return _dict
def _to_dict(self):
@@ -58829,116 +62111,85 @@ 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 LoadBalancerPoolMemberPrototype object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'NetworkACL') -> 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: 'NetworkACL') -> bool:
+ def __ne__(self, other: 'LoadBalancerPoolMemberPrototype') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class NetworkACLCollection:
+class LoadBalancerPoolMemberReference:
"""
- NetworkACLCollection.
+ LoadBalancerPoolMemberReference.
- :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.
+ :param LoadBalancerPoolMemberReferenceDeleted deleted: (optional) If present,
+ this property indicates the referenced resource has been deleted, and provides
+ some supplementary information.
+ :param str href: The member's canonical URL.
+ :param str id: The unique identifier for this load balancer pool member.
"""
def __init__(
self,
- first: 'NetworkACLCollectionFirst',
- limit: int,
- network_acls: List['NetworkACL'],
- total_count: int,
+ href: str,
+ id: str,
*,
- next: 'NetworkACLCollectionNext' = None,
+ deleted: Optional['LoadBalancerPoolMemberReferenceDeleted'] = None,
) -> None:
"""
- Initialize a NetworkACLCollection object.
+ Initialize a LoadBalancerPoolMemberReference object.
- :param NetworkACLCollectionFirst first: A link to the first page of
- resources.
- :param int limit: The maximum number of resources that can be returned by
- the request.
- :param List[NetworkACL] network_acls: Collection of network ACLs.
- :param int total_count: The total number of resources across all pages.
- :param NetworkACLCollectionNext next: (optional) A link to the next page of
- resources. This property is present for all pages
- except the last page.
+ :param str 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.first = first
- self.limit = limit
- self.network_acls = network_acls
- self.next = next
- self.total_count = total_count
+ self.deleted = deleted
+ self.href = href
+ self.id = id
@classmethod
- def from_dict(cls, _dict: Dict) -> 'NetworkACLCollection':
- """Initialize a NetworkACLCollection object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'LoadBalancerPoolMemberReference':
+ """Initialize a LoadBalancerPoolMemberReference object from a json dictionary."""
args = {}
- if 'first' in _dict:
- args['first'] = NetworkACLCollectionFirst.from_dict(_dict.get('first'))
+ if (deleted := _dict.get('deleted')) is not None:
+ args['deleted'] = LoadBalancerPoolMemberReferenceDeleted.from_dict(deleted)
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'first\' not present in NetworkACLCollection JSON')
- if 'limit' in _dict:
- args['limit'] = _dict.get('limit')
- else:
- raise ValueError('Required property \'limit\' not present in NetworkACLCollection JSON')
- if 'network_acls' in _dict:
- args['network_acls'] = [NetworkACL.from_dict(v) for v in _dict.get('network_acls')]
- else:
- raise ValueError('Required property \'network_acls\' not present in NetworkACLCollection JSON')
- if 'next' in _dict:
- args['next'] = NetworkACLCollectionNext.from_dict(_dict.get('next'))
- if 'total_count' in _dict:
- args['total_count'] = _dict.get('total_count')
+ raise ValueError('Required property \'href\' not present in LoadBalancerPoolMemberReference JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
else:
- raise ValueError('Required property \'total_count\' not present in NetworkACLCollection JSON')
+ raise ValueError('Required property \'id\' not present in LoadBalancerPoolMemberReference JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a NetworkACLCollection 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, 'first') and self.first is not None:
- if isinstance(self.first, dict):
- _dict['first'] = self.first
- else:
- _dict['first'] = self.first.to_dict()
- if hasattr(self, 'limit') and self.limit is not None:
- _dict['limit'] = self.limit
- if hasattr(self, 'network_acls') and self.network_acls is not None:
- network_acls_list = []
- for v in self.network_acls:
- if isinstance(v, dict):
- network_acls_list.append(v)
- else:
- network_acls_list.append(v.to_dict())
- _dict['network_acls'] = network_acls_list
- if hasattr(self, 'next') and self.next is not None:
- if isinstance(self.next, dict):
- _dict['next'] = self.next
+ if hasattr(self, 'deleted') and self.deleted is not None:
+ if isinstance(self.deleted, dict):
+ _dict['deleted'] = self.deleted
else:
- _dict['next'] = self.next.to_dict()
- if hasattr(self, 'total_count') and self.total_count is not None:
- _dict['total_count'] = self.total_count
+ _dict['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):
@@ -58946,58 +62197,59 @@ 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 LoadBalancerPoolMemberReference object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'NetworkACLCollection') -> 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: 'NetworkACLCollection') -> bool:
+ def __ne__(self, other: 'LoadBalancerPoolMemberReference') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class NetworkACLCollectionFirst:
+class LoadBalancerPoolMemberReferenceDeleted:
"""
- 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.
+ :param str more_info: Link to documentation about deleted resources.
"""
def __init__(
self,
- href: str,
+ more_info: str,
) -> None:
"""
- Initialize a NetworkACLCollectionFirst object.
+ Initialize a LoadBalancerPoolMemberReferenceDeleted 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) -> 'NetworkACLCollectionFirst':
- """Initialize a NetworkACLCollectionFirst object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'LoadBalancerPoolMemberReferenceDeleted':
+ """Initialize a LoadBalancerPoolMemberReferenceDeleted object from a json dictionary."""
args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ if (more_info := _dict.get('more_info')) is not None:
+ args['more_info'] = more_info
else:
- raise ValueError('Required property \'href\' not present in NetworkACLCollectionFirst JSON')
+ raise ValueError('Required property \'more_info\' not present in LoadBalancerPoolMemberReferenceDeleted JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a NetworkACLCollectionFirst 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, '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):
@@ -59005,83 +62257,48 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this NetworkACLCollectionFirst object."""
+ """Return a `str` version of this LoadBalancerPoolMemberReferenceDeleted object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'NetworkACLCollectionFirst') -> 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: 'NetworkACLCollectionFirst') -> bool:
+ def __ne__(self, other: 'LoadBalancerPoolMemberReferenceDeleted') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class NetworkACLCollectionNext:
+class LoadBalancerPoolMemberTarget:
"""
- A link to the next page of resources. This property is present for all pages except
- the last page.
+ The pool member target. Load balancers in the `network` family support virtual server
+ instances. Load balancers in the `application` family support IP addresses. If the
+ load balancer has route mode enabled, the member must be in a zone the load balancer
+ has a subnet in.
- :attr str href: The URL for a page of resources.
"""
def __init__(
self,
- href: str,
) -> None:
"""
- Initialize a NetworkACLCollectionNext object.
+ Initialize a LoadBalancerPoolMemberTarget 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."""
- args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
- else:
- raise ValueError('Required property \'href\' not present in NetworkACLCollectionNext JSON')
- return cls(**args)
-
- @classmethod
- def _from_dict(cls, _dict):
- """Initialize a NetworkACLCollectionNext object from a json dictionary."""
- return cls.from_dict(_dict)
-
- def to_dict(self) -> Dict:
- """Return a json dictionary representing this model."""
- _dict = {}
- if hasattr(self, 'href') and self.href is not None:
- _dict['href'] = self.href
- return _dict
-
- def _to_dict(self):
- """Return a json dictionary representing this model."""
- return self.to_dict()
-
- def __str__(self) -> str:
- """Return a `str` version of this NetworkACLCollectionNext object."""
- return json.dumps(self.to_dict(), indent=2)
-
- def __eq__(self, other: 'NetworkACLCollectionNext') -> bool:
- """Return `true` when self and other are equal, false otherwise."""
- if not isinstance(other, self.__class__):
- return False
- return self.__dict__ == other.__dict__
-
- def __ne__(self, other: 'NetworkACLCollectionNext') -> bool:
- """Return `true` when self and other are not equal, false otherwise."""
- return not self == other
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['LoadBalancerPoolMemberTargetInstanceReference', 'LoadBalancerPoolMemberTargetIP'])
+ )
+ raise Exception(msg)
-class NetworkACLIdentity:
+class LoadBalancerPoolMemberTargetPrototype:
"""
- Identifies a network ACL by a unique property.
+ The pool member target. Load balancers in the `network` family support virtual server
+ instances. Load balancers in the `application` family support IP addresses. If the
+ load balancer has route mode enabled, the member must be in a zone the load balancer
+ has a subnet in.
"""
@@ -59089,54 +62306,129 @@ def __init__(
self,
) -> None:
"""
- Initialize a NetworkACLIdentity object.
+ Initialize a LoadBalancerPoolMemberTargetPrototype object.
"""
msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['NetworkACLIdentityById', 'NetworkACLIdentityByCRN', 'NetworkACLIdentityByHref'])
+ ", ".join(['LoadBalancerPoolMemberTargetPrototypeInstanceIdentity', 'LoadBalancerPoolMemberTargetPrototypeIP'])
)
raise Exception(msg)
-class NetworkACLPatch:
+class LoadBalancerPoolPatch:
"""
- NetworkACLPatch.
+ LoadBalancerPoolPatch.
- :attr str name: (optional) The name for this network ACL. The name must not be
- used by another network ACL for the VPC.
+ :param str algorithm: (optional) The load balancing algorithm.
+ :param LoadBalancerPoolHealthMonitorPatch health_monitor: (optional) The health
+ monitor of this pool.
+ :param str name: (optional) The name for this load balancer pool. The name must
+ not be used by another pool for the load balancer.
+ :param str protocol: (optional) The protocol for this load balancer pool.
+ Load balancers in the `network` family support `tcp` and `udp` (if
+ `udp_supported` is `true`). Load balancers in the `application` family support
+ `tcp`, `http` and
+ `https`.
+ If this pool is associated with a load balancer listener, the specified protocol
+ must match, or be compatible with the listener's protocol. At present, the
+ compatible protocols are `http` and `https`.
+ :param str proxy_protocol: (optional) The PROXY protocol setting for this pool:
+ - `v1`: Enabled with version 1 (human-readable header format)
+ - `v2`: Enabled with version 2 (binary header format)
+ - `disabled`: Disabled
+ Supported by load balancers in the `application` family (otherwise always
+ `disabled`).
+ :param LoadBalancerPoolSessionPersistencePatch session_persistence: (optional)
+ The session persistence of this pool.
"""
def __init__(
self,
*,
- name: str = None,
+ algorithm: Optional[str] = None,
+ health_monitor: Optional['LoadBalancerPoolHealthMonitorPatch'] = None,
+ name: Optional[str] = None,
+ protocol: Optional[str] = None,
+ proxy_protocol: Optional[str] = None,
+ session_persistence: Optional['LoadBalancerPoolSessionPersistencePatch'] = None,
) -> None:
"""
- Initialize a NetworkACLPatch object.
+ Initialize a LoadBalancerPoolPatch object.
- :param str name: (optional) The name for this network ACL. The name must
- not be used by another network ACL for the VPC.
+ :param str algorithm: (optional) The load balancing algorithm.
+ :param LoadBalancerPoolHealthMonitorPatch health_monitor: (optional) The
+ health monitor of this pool.
+ :param str name: (optional) The name for this load balancer pool. The name
+ must not be used by another pool for the load balancer.
+ :param str protocol: (optional) The protocol for this load balancer pool.
+ Load balancers in the `network` family support `tcp` and `udp` (if
+ `udp_supported` is `true`). Load balancers in the `application` family
+ support `tcp`, `http` and
+ `https`.
+ If this pool is associated with a load balancer listener, the specified
+ protocol must match, or be compatible with the listener's protocol. At
+ present, the compatible protocols are `http` and `https`.
+ :param str proxy_protocol: (optional) The PROXY protocol setting for this
+ pool:
+ - `v1`: Enabled with version 1 (human-readable header format)
+ - `v2`: Enabled with version 2 (binary header format)
+ - `disabled`: Disabled
+ Supported by load balancers in the `application` family (otherwise always
+ `disabled`).
+ :param LoadBalancerPoolSessionPersistencePatch session_persistence:
+ (optional) The session persistence of this pool.
"""
+ self.algorithm = algorithm
+ self.health_monitor = health_monitor
self.name = name
+ self.protocol = protocol
+ self.proxy_protocol = proxy_protocol
+ self.session_persistence = session_persistence
@classmethod
- def from_dict(cls, _dict: Dict) -> 'NetworkACLPatch':
- """Initialize a NetworkACLPatch object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'LoadBalancerPoolPatch':
+ """Initialize a LoadBalancerPoolPatch object from a json dictionary."""
args = {}
- if 'name' in _dict:
- args['name'] = _dict.get('name')
+ if (algorithm := _dict.get('algorithm')) is not None:
+ args['algorithm'] = algorithm
+ if (health_monitor := _dict.get('health_monitor')) is not None:
+ args['health_monitor'] = LoadBalancerPoolHealthMonitorPatch.from_dict(health_monitor)
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ if (protocol := _dict.get('protocol')) is not None:
+ args['protocol'] = protocol
+ if (proxy_protocol := _dict.get('proxy_protocol')) is not None:
+ args['proxy_protocol'] = proxy_protocol
+ if (session_persistence := _dict.get('session_persistence')) is not None:
+ args['session_persistence'] = LoadBalancerPoolSessionPersistencePatch.from_dict(session_persistence)
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a NetworkACLPatch 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, 'algorithm') and self.algorithm is not None:
+ _dict['algorithm'] = self.algorithm
+ if hasattr(self, 'health_monitor') and self.health_monitor is not None:
+ if isinstance(self.health_monitor, dict):
+ _dict['health_monitor'] = self.health_monitor
+ else:
+ _dict['health_monitor'] = self.health_monitor.to_dict()
if hasattr(self, 'name') and self.name is not None:
_dict['name'] = self.name
+ if hasattr(self, 'protocol') and self.protocol is not None:
+ _dict['protocol'] = self.protocol
+ if hasattr(self, 'proxy_protocol') and self.proxy_protocol is not None:
+ _dict['proxy_protocol'] = self.proxy_protocol
+ if hasattr(self, 'session_persistence') and self.session_persistence is not None:
+ if isinstance(self.session_persistence, dict):
+ _dict['session_persistence'] = self.session_persistence
+ else:
+ _dict['session_persistence'] = self.session_persistence.to_dict()
return _dict
def _to_dict(self):
@@ -59144,145 +62436,196 @@ 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 LoadBalancerPoolPatch object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'NetworkACLPatch') -> 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: 'NetworkACLPatch') -> bool:
+ def __ne__(self, other: 'LoadBalancerPoolPatch') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
+ class AlgorithmEnum(str, Enum):
+ """
+ The load balancing algorithm.
+ """
-class NetworkACLPrototype:
- """
- NetworkACLPrototype.
+ LEAST_CONNECTIONS = 'least_connections'
+ ROUND_ROBIN = 'round_robin'
+ WEIGHTED_ROUND_ROBIN = 'weighted_round_robin'
- :attr str name: (optional) The name for this network ACL. The name must not be
- used by another network ACL for the VPC. If unspecified, the name will be a
- hyphenated list of randomly-selected words.
- :attr ResourceGroupIdentity resource_group: (optional) The resource group to
- use. If unspecified, the account's [default resource
- group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be
- used.
- :attr VPCIdentity vpc: The VPC this network ACL will reside in.
- """
- def __init__(
- self,
- vpc: 'VPCIdentity',
- *,
- name: str = None,
- resource_group: 'ResourceGroupIdentity' = None,
- ) -> None:
+ class ProtocolEnum(str, Enum):
+ """
+ The protocol for this load balancer pool.
+ Load balancers in the `network` family support `tcp` and `udp` (if `udp_supported`
+ is `true`). Load balancers in the `application` family support `tcp`, `http` and
+ `https`.
+ If this pool is associated with a load balancer listener, the specified protocol
+ must match, or be compatible with the listener's protocol. At present, the
+ compatible protocols are `http` and `https`.
"""
- Initialize a NetworkACLPrototype object.
- :param VPCIdentity vpc: The VPC this network ACL will reside in.
- :param str name: (optional) The name for this network ACL. The name must
- not be used by another network ACL for the VPC. If unspecified, the name
- will be a hyphenated list of randomly-selected words.
- :param ResourceGroupIdentity resource_group: (optional) The resource group
- to use. If unspecified, the account's [default resource
- group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be
- used.
+ HTTP = 'http'
+ HTTPS = 'https'
+ TCP = 'tcp'
+ UDP = 'udp'
+
+
+ class ProxyProtocolEnum(str, Enum):
+ """
+ The PROXY protocol setting for this pool:
+ - `v1`: Enabled with version 1 (human-readable header format)
+ - `v2`: Enabled with version 2 (binary header format)
+ - `disabled`: Disabled
+ Supported by load balancers in the `application` family (otherwise always
+ `disabled`).
"""
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['NetworkACLPrototypeNetworkACLByRules', 'NetworkACLPrototypeNetworkACLBySourceNetworkACL'])
- )
- raise Exception(msg)
+ DISABLED = 'disabled'
+ V1 = 'v1'
+ V2 = 'v2'
-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 name for this network ACL. The name is unique across all
- network ACLs for the VPC.
+
+class LoadBalancerPoolPrototype:
"""
+ LoadBalancerPoolPrototype.
- def __init__(
- self,
- crn: str,
- href: str,
- id: str,
- name: str,
+ :param str algorithm: The load balancing algorithm.
+ :param LoadBalancerPoolHealthMonitorPrototype health_monitor: The health monitor
+ of this pool.
+ :param List[LoadBalancerPoolMemberPrototype] members: (optional) The members for
+ this load balancer pool. For load balancers in the `network` family, the same
+ `port` and `target` tuple cannot be shared by a pool member of any other load
+ balancer in the same VPC.
+ :param str name: (optional) The name for this load balancer pool. The name must
+ not be used by another pool for the load balancer. If unspecified, the name will
+ be a hyphenated list of randomly-selected words.
+ :param str protocol: The protocol used for this load balancer pool. Load
+ balancers in the `network` family support `tcp` and `udp` (if `udp_supported` is
+ `true`). Load balancers in the
+ `application` family support `tcp`, `http`, and `https`.
+ :param 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.
+ """
+
+ def __init__(
+ self,
+ algorithm: str,
+ health_monitor: 'LoadBalancerPoolHealthMonitorPrototype',
+ protocol: str,
*,
- deleted: 'NetworkACLReferenceDeleted' = None,
+ members: Optional[List['LoadBalancerPoolMemberPrototype']] = None,
+ name: Optional[str] = None,
+ proxy_protocol: Optional[str] = None,
+ session_persistence: Optional['LoadBalancerPoolSessionPersistencePrototype'] = None,
) -> None:
"""
- Initialize a NetworkACLReference object.
+ Initialize a LoadBalancerPoolPrototype object.
- :param str crn: The CRN for this network ACL.
- :param str href: The URL for this network ACL.
- :param str id: The unique identifier for this network ACL.
- :param str name: The name for this network ACL. The name is unique across
- all network ACLs for the VPC.
- :param NetworkACLReferenceDeleted deleted: (optional) If present, this
- property indicates the referenced resource has been deleted, and provides
- some supplementary information.
+ :param str algorithm: The load balancing algorithm.
+ :param LoadBalancerPoolHealthMonitorPrototype health_monitor: The health
+ monitor of this pool.
+ :param str protocol: The protocol used for this load balancer pool. Load
+ balancers in the `network` family support `tcp` and `udp` (if
+ `udp_supported` is `true`). Load balancers in the
+ `application` family support `tcp`, `http`, and `https`.
+ :param List[LoadBalancerPoolMemberPrototype] members: (optional) The
+ members for this load balancer pool. For load balancers in the `network`
+ family, the same `port` and `target` tuple cannot be shared by a pool
+ member of any other load balancer in the same VPC.
+ :param str name: (optional) The name for this load balancer pool. The name
+ must not be used by another pool for the load balancer. If unspecified, the
+ name will be a hyphenated list of randomly-selected words.
+ :param str proxy_protocol: (optional) The PROXY protocol setting for this
+ pool:
+ - `v1`: Enabled with version 1 (human-readable header format)
+ - `v2`: Enabled with version 2 (binary header format)
+ - `disabled`: Disabled
+ Supported by load balancers in the `application` family (otherwise always
+ `disabled`).
+ :param LoadBalancerPoolSessionPersistencePrototype session_persistence:
+ (optional) The session persistence of this pool.
"""
- self.crn = crn
- self.deleted = deleted
- self.href = href
- self.id = id
+ 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) -> 'NetworkACLReference':
- """Initialize a NetworkACLReference object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'LoadBalancerPoolPrototype':
+ """Initialize a LoadBalancerPoolPrototype 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')
+ if (algorithm := _dict.get('algorithm')) is not None:
+ args['algorithm'] = algorithm
else:
- raise ValueError('Required property \'href\' not present in NetworkACLReference JSON')
- if 'id' in _dict:
- args['id'] = _dict.get('id')
+ raise ValueError('Required property \'algorithm\' not present in LoadBalancerPoolPrototype JSON')
+ if (health_monitor := _dict.get('health_monitor')) is not None:
+ args['health_monitor'] = LoadBalancerPoolHealthMonitorPrototype.from_dict(health_monitor)
else:
- raise ValueError('Required property \'id\' not present in NetworkACLReference JSON')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
+ raise ValueError('Required property \'health_monitor\' not present in LoadBalancerPoolPrototype JSON')
+ if (members := _dict.get('members')) is not None:
+ args['members'] = [LoadBalancerPoolMemberPrototype.from_dict(v) for v in members]
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ if (protocol := _dict.get('protocol')) is not None:
+ args['protocol'] = protocol
else:
- raise ValueError('Required property \'name\' not present in NetworkACLReference JSON')
+ raise ValueError('Required property \'protocol\' not present in LoadBalancerPoolPrototype JSON')
+ if (proxy_protocol := _dict.get('proxy_protocol')) is not None:
+ args['proxy_protocol'] = proxy_protocol
+ if (session_persistence := _dict.get('session_persistence')) is not None:
+ args['session_persistence'] = LoadBalancerPoolSessionPersistencePrototype.from_dict(session_persistence)
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a NetworkACLReference 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, 'crn') and self.crn is not None:
- _dict['crn'] = self.crn
- if hasattr(self, 'deleted') and self.deleted is not None:
- if isinstance(self.deleted, dict):
- _dict['deleted'] = self.deleted
+ if hasattr(self, 'algorithm') and self.algorithm is not None:
+ _dict['algorithm'] = self.algorithm
+ if hasattr(self, 'health_monitor') and self.health_monitor is not None:
+ if isinstance(self.health_monitor, dict):
+ _dict['health_monitor'] = self.health_monitor
else:
- _dict['deleted'] = self.deleted.to_dict()
- if hasattr(self, 'href') and self.href is not None:
- _dict['href'] = self.href
- if hasattr(self, 'id') and self.id is not None:
- _dict['id'] = self.id
+ _dict['health_monitor'] = self.health_monitor.to_dict()
+ if hasattr(self, 'members') and self.members is not None:
+ members_list = []
+ for v in self.members:
+ if isinstance(v, dict):
+ members_list.append(v)
+ else:
+ members_list.append(v.to_dict())
+ _dict['members'] = members_list
if hasattr(self, 'name') and self.name is not None:
_dict['name'] = self.name
+ if hasattr(self, 'protocol') and self.protocol is not None:
+ _dict['protocol'] = self.protocol
+ if hasattr(self, 'proxy_protocol') and self.proxy_protocol is not None:
+ _dict['proxy_protocol'] = self.proxy_protocol
+ if hasattr(self, 'session_persistence') and self.session_persistence is not None:
+ if isinstance(self.session_persistence, dict):
+ _dict['session_persistence'] = self.session_persistence
+ else:
+ _dict['session_persistence'] = self.session_persistence.to_dict()
return _dict
def _to_dict(self):
@@ -59290,351 +62633,136 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this NetworkACLReference object."""
- return json.dumps(self.to_dict(), indent=2)
-
- 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: 'NetworkACLReference') -> bool:
- """Return `true` when self and other are not equal, false otherwise."""
- return not self == other
-
-
-class NetworkACLReferenceDeleted:
- """
- 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 NetworkACLReferenceDeleted 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."""
- 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')
- return cls(**args)
-
- @classmethod
- def _from_dict(cls, _dict):
- """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, '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 NetworkACLReferenceDeleted object."""
+ """Return a `str` version of this LoadBalancerPoolPrototype object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'NetworkACLReferenceDeleted') -> 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: 'NetworkACLReferenceDeleted') -> bool:
+ def __ne__(self, other: 'LoadBalancerPoolPrototype') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-
-class NetworkACLRule:
- """
- NetworkACLRule.
-
- :attr str action: The action to perform for a packet matching the rule.
- :attr NetworkACLRuleReference before: (optional) The rule that this rule is
- immediately before. If absent, this is the last rule.
- :attr datetime created_at: The date and time that the rule was created.
- :attr str destination: The destination IP address or CIDR block to match. The
- CIDR block `0.0.0.0/0` matches all destination addresses.
- :attr str direction: The direction of traffic to match.
- :attr str href: The URL for this network ACL rule.
- :attr str id: The unique identifier for this network ACL rule.
- :attr str ip_version: The IP version for this rule.
- :attr str name: The name for this network ACL rule. The name is unique across
- all rules for the network ACL.
- :attr str protocol: The protocol to enforce.
- :attr str source: The source IP address or CIDR block to match. The CIDR block
- `0.0.0.0/0` matches all source addresses.
- """
-
- def __init__(
- self,
- action: str,
- created_at: datetime,
- destination: str,
- direction: str,
- href: str,
- id: str,
- ip_version: str,
- name: str,
- protocol: str,
- source: str,
- *,
- before: 'NetworkACLRuleReference' = None,
- ) -> None:
- """
- Initialize a NetworkACLRule object.
-
- :param str action: The action to perform for a packet matching the rule.
- :param datetime created_at: The date and time that the rule was created.
- :param str destination: The destination IP address or CIDR block to match.
- The CIDR block `0.0.0.0/0` matches all destination addresses.
- :param str direction: The direction of traffic to match.
- :param str href: The URL for this network ACL rule.
- :param str id: The unique identifier for this network ACL rule.
- :param str ip_version: The IP version for this rule.
- :param str name: The name for this network ACL rule. The name is unique
- across all rules for the network ACL.
- :param str protocol: The protocol to enforce.
- :param str source: The source IP address or CIDR block to match. The CIDR
- block `0.0.0.0/0` matches all source addresses.
- :param NetworkACLRuleReference before: (optional) The rule that this rule
- is immediately before. If absent, this is the last rule.
- """
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['NetworkACLRuleNetworkACLRuleProtocolTCPUDP', 'NetworkACLRuleNetworkACLRuleProtocolICMP', 'NetworkACLRuleNetworkACLRuleProtocolAll'])
- )
- raise Exception(msg)
-
- @classmethod
- def from_dict(cls, _dict: Dict) -> 'NetworkACLRule':
- """Initialize a NetworkACLRule object from a json dictionary."""
- disc_class = cls._get_class_by_discriminator(_dict)
- if disc_class != cls:
- return disc_class.from_dict(_dict)
- msg = "Cannot convert dictionary into an instance of base class 'NetworkACLRule'. The discriminator value should map to a valid subclass: {1}".format(
- ", ".join(['NetworkACLRuleNetworkACLRuleProtocolTCPUDP', 'NetworkACLRuleNetworkACLRuleProtocolICMP', 'NetworkACLRuleNetworkACLRuleProtocolAll'])
- )
- raise Exception(msg)
-
- @classmethod
- def _from_dict(cls, _dict: Dict):
- """Initialize a NetworkACLRule object from a json dictionary."""
- return cls.from_dict(_dict)
-
- @classmethod
- def _get_class_by_discriminator(cls, _dict: Dict) -> object:
- mapping = {}
- mapping['all'] = 'NetworkACLRuleNetworkACLRuleProtocolAll'
- mapping['icmp'] = 'NetworkACLRuleNetworkACLRuleProtocolICMP'
- mapping['tcp'] = 'NetworkACLRuleNetworkACLRuleProtocolTCPUDP'
- mapping['udp'] = 'NetworkACLRuleNetworkACLRuleProtocolTCPUDP'
- disc_value = _dict.get('protocol')
- if disc_value is None:
- raise ValueError('Discriminator property \'protocol\' not found in NetworkACLRule JSON')
- class_name = mapping.get(disc_value, disc_value)
- try:
- disc_class = getattr(sys.modules[__name__], class_name)
- except AttributeError:
- disc_class = cls
- if isinstance(disc_class, object):
- return disc_class
- raise TypeError('%s is not a discriminator class' % class_name)
-
- class ActionEnum(str, Enum):
- """
- The action to perform for a packet matching the rule.
- """
-
- ALLOW = 'allow'
- DENY = 'deny'
-
-
- class DirectionEnum(str, Enum):
- """
- The direction of traffic to match.
- """
-
- INBOUND = 'inbound'
- OUTBOUND = 'outbound'
-
-
- class IpVersionEnum(str, Enum):
+ class AlgorithmEnum(str, Enum):
"""
- The IP version for this rule.
+ The load balancing algorithm.
"""
- IPV4 = 'ipv4'
+ LEAST_CONNECTIONS = 'least_connections'
+ ROUND_ROBIN = 'round_robin'
+ WEIGHTED_ROUND_ROBIN = 'weighted_round_robin'
class ProtocolEnum(str, Enum):
"""
- The protocol to enforce.
+ The protocol used for this load balancer pool. Load balancers in the `network`
+ family support `tcp` and `udp` (if `udp_supported` is `true`). Load balancers in
+ the
+ `application` family support `tcp`, `http`, and `https`.
"""
- ALL = 'all'
- ICMP = 'icmp'
+ HTTP = 'http'
+ HTTPS = 'https'
TCP = 'tcp'
UDP = 'udp'
-
-class NetworkACLRuleBeforePatch:
- """
- The rule to move this rule immediately before.
- Specify `null` to move this rule after all existing rules.
-
- """
-
- def __init__(
- self,
- ) -> None:
+ class ProxyProtocolEnum(str, Enum):
"""
- Initialize a NetworkACLRuleBeforePatch object.
-
+ 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`).
"""
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['NetworkACLRuleBeforePatchNetworkACLRuleIdentityById', 'NetworkACLRuleBeforePatchNetworkACLRuleIdentityByHref'])
- )
- raise Exception(msg)
+ DISABLED = 'disabled'
+ V1 = 'v1'
+ V2 = 'v2'
-class NetworkACLRuleBeforePrototype:
- """
- The rule to insert this rule immediately before.
- If unspecified, this rule will be inserted after all existing rules.
-
- """
-
- def __init__(
- self,
- ) -> None:
- """
- Initialize a NetworkACLRuleBeforePrototype object.
-
- """
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityById', 'NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByHref'])
- )
- raise Exception(msg)
-class NetworkACLRuleCollection:
+class LoadBalancerPoolReference:
"""
- NetworkACLRuleCollection.
+ LoadBalancerPoolReference.
- :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.
+ :param LoadBalancerPoolReferenceDeleted deleted: (optional) If present, this
+ property indicates the referenced resource has been deleted, and provides
+ some supplementary information.
+ :param str href: The pool's canonical URL.
+ :param str id: The unique identifier for this load balancer pool.
+ :param str name: The name for this load balancer pool. The name is unique across
+ all pools for the load balancer.
"""
def __init__(
self,
- first: 'NetworkACLRuleCollectionFirst',
- limit: int,
- rules: List['NetworkACLRuleItem'],
- total_count: int,
+ href: str,
+ id: str,
+ name: str,
*,
- next: 'NetworkACLRuleCollectionNext' = None,
+ deleted: Optional['LoadBalancerPoolReferenceDeleted'] = None,
) -> None:
"""
- Initialize a NetworkACLRuleCollection object.
+ Initialize a LoadBalancerPoolReference object.
- :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.
+ :param str href: The pool's canonical URL.
+ :param str id: The unique identifier for this load balancer pool.
+ :param str name: The name for this load balancer pool. The name is unique
+ across all pools for the load balancer.
+ :param LoadBalancerPoolReferenceDeleted deleted: (optional) If present,
+ this property indicates the referenced resource has been deleted, and
+ provides
+ some supplementary information.
"""
- self.first = first
- self.limit = limit
- self.next = next
- self.rules = rules
- self.total_count = total_count
+ self.deleted = deleted
+ self.href = href
+ self.id = id
+ self.name = name
@classmethod
- def from_dict(cls, _dict: Dict) -> 'NetworkACLRuleCollection':
- """Initialize a NetworkACLRuleCollection object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'LoadBalancerPoolReference':
+ """Initialize a LoadBalancerPoolReference object from a json dictionary."""
args = {}
- if 'first' in _dict:
- args['first'] = NetworkACLRuleCollectionFirst.from_dict(_dict.get('first'))
+ if (deleted := _dict.get('deleted')) is not None:
+ args['deleted'] = LoadBalancerPoolReferenceDeleted.from_dict(deleted)
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'first\' not present in NetworkACLRuleCollection JSON')
- if 'limit' in _dict:
- args['limit'] = _dict.get('limit')
- else:
- raise ValueError('Required property \'limit\' not present in NetworkACLRuleCollection JSON')
- if 'next' in _dict:
- args['next'] = NetworkACLRuleCollectionNext.from_dict(_dict.get('next'))
- if 'rules' in _dict:
- args['rules'] = [NetworkACLRuleItem.from_dict(v) for v in _dict.get('rules')]
+ raise ValueError('Required property \'href\' not present in LoadBalancerPoolReference JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
else:
- raise ValueError('Required property \'rules\' not present in NetworkACLRuleCollection JSON')
- if 'total_count' in _dict:
- args['total_count'] = _dict.get('total_count')
+ raise ValueError('Required property \'id\' not present in LoadBalancerPoolReference JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
else:
- raise ValueError('Required property \'total_count\' not present in NetworkACLRuleCollection JSON')
+ raise ValueError('Required property \'name\' not present in LoadBalancerPoolReference JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a NetworkACLRuleCollection 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, 'first') and self.first is not None:
- if isinstance(self.first, dict):
- _dict['first'] = self.first
- else:
- _dict['first'] = self.first.to_dict()
- if hasattr(self, 'limit') and self.limit is not None:
- _dict['limit'] = self.limit
- if hasattr(self, 'next') and self.next is not None:
- if isinstance(self.next, dict):
- _dict['next'] = self.next
+ if hasattr(self, 'deleted') and self.deleted is not None:
+ if isinstance(self.deleted, dict):
+ _dict['deleted'] = self.deleted
else:
- _dict['next'] = self.next.to_dict()
- if hasattr(self, 'rules') and self.rules is not None:
- rules_list = []
- for v in self.rules:
- if isinstance(v, dict):
- rules_list.append(v)
- else:
- rules_list.append(v.to_dict())
- _dict['rules'] = rules_list
- if hasattr(self, 'total_count') and self.total_count is not None:
- _dict['total_count'] = self.total_count
+ _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):
@@ -59642,58 +62770,59 @@ 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 LoadBalancerPoolReference object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'NetworkACLRuleCollection') -> 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: 'NetworkACLRuleCollection') -> bool:
+ def __ne__(self, other: 'LoadBalancerPoolReference') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class NetworkACLRuleCollectionFirst:
+class LoadBalancerPoolReferenceDeleted:
"""
- 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.
+ :param str more_info: Link to documentation about deleted resources.
"""
def __init__(
self,
- href: str,
+ more_info: str,
) -> None:
"""
- Initialize a NetworkACLRuleCollectionFirst object.
+ Initialize a LoadBalancerPoolReferenceDeleted 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) -> 'NetworkACLRuleCollectionFirst':
- """Initialize a NetworkACLRuleCollectionFirst object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'LoadBalancerPoolReferenceDeleted':
+ """Initialize a LoadBalancerPoolReferenceDeleted object from a json dictionary."""
args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ if (more_info := _dict.get('more_info')) is not None:
+ args['more_info'] = more_info
else:
- raise ValueError('Required property \'href\' not present in NetworkACLRuleCollectionFirst JSON')
+ raise ValueError('Required property \'more_info\' not present in LoadBalancerPoolReferenceDeleted JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a NetworkACLRuleCollectionFirst object from a json dictionary."""
+ """Initialize a LoadBalancerPoolReferenceDeleted object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, '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):
@@ -59701,59 +62830,73 @@ 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 LoadBalancerPoolReferenceDeleted object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'NetworkACLRuleCollectionFirst') -> bool:
+ def __eq__(self, other: 'LoadBalancerPoolReferenceDeleted') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'NetworkACLRuleCollectionFirst') -> bool:
+ def __ne__(self, other: 'LoadBalancerPoolReferenceDeleted') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class NetworkACLRuleCollectionNext:
+class LoadBalancerPoolSessionPersistence:
"""
- A link to the next page of resources. This property is present for all pages except
- the last page.
+ LoadBalancerPoolSessionPersistence.
- :attr str href: The URL for a page of resources.
+ :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: The session persistence type. The `http_cookie` and
+ `app_cookie` types are applicable only to the `http` and `https` protocols.
"""
def __init__(
self,
- href: str,
+ type: str,
+ *,
+ cookie_name: Optional[str] = None,
) -> None:
"""
- Initialize a NetworkACLRuleCollectionNext object.
+ Initialize a LoadBalancerPoolSessionPersistence object.
- :param str href: The URL for a page of resources.
+ :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.href = href
+ self.cookie_name = cookie_name
+ self.type = type
@classmethod
- def from_dict(cls, _dict: Dict) -> 'NetworkACLRuleCollectionNext':
- """Initialize a NetworkACLRuleCollectionNext object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'LoadBalancerPoolSessionPersistence':
+ """Initialize a LoadBalancerPoolSessionPersistence object from a json dictionary."""
args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ if (cookie_name := _dict.get('cookie_name')) is not None:
+ args['cookie_name'] = cookie_name
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
else:
- raise ValueError('Required property \'href\' not present in NetworkACLRuleCollectionNext JSON')
+ raise ValueError('Required property \'type\' not present in LoadBalancerPoolSessionPersistence JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a NetworkACLRuleCollectionNext 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, 'href') and self.href is not None:
- _dict['href'] = self.href
+ 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):
@@ -59761,316 +62904,167 @@ 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 LoadBalancerPoolSessionPersistence object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'NetworkACLRuleCollectionNext') -> 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: 'NetworkACLRuleCollectionNext') -> bool:
+ def __ne__(self, other: 'LoadBalancerPoolSessionPersistence') -> 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.
+ """
-class NetworkACLRuleItem:
+ APP_COOKIE = 'app_cookie'
+ HTTP_COOKIE = 'http_cookie'
+ SOURCE_IP = 'source_ip'
+
+
+
+class LoadBalancerPoolSessionPersistencePatch:
"""
- NetworkACLRuleItem.
+ The session persistence configuration. Specify `null` to remove any existing session
+ persistence configuration.
- :attr str action: The action to perform for a packet matching the rule.
- :attr NetworkACLRuleReference before: (optional) The rule that this rule is
- immediately before. In a rule collection, this always
- refers to the next item in the collection. If absent, this is the last rule.
- :attr datetime created_at: The date and time that the rule was created.
- :attr str destination: The destination IP address or CIDR block to match. The
- CIDR block `0.0.0.0/0` matches all destination addresses.
- :attr str direction: The direction of traffic to match.
- :attr str href: The URL for this network ACL rule.
- :attr str id: The unique identifier for this network ACL rule.
- :attr str ip_version: The IP version for this rule.
- :attr str name: The name for this network ACL rule. The name is unique across
- all rules for the network ACL.
- :attr str protocol: The protocol to enforce.
- :attr str source: The source IP address or CIDR block to match. The CIDR block
- `0.0.0.0/0` matches all source addresses.
+ :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.
"""
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,
+ cookie_name: Optional[str] = None,
+ type: Optional[str] = None,
) -> None:
"""
- Initialize a NetworkACLRuleItem object.
+ Initialize a LoadBalancerPoolSessionPersistencePatch object.
- :param str action: The action to perform for a packet matching the rule.
- :param datetime created_at: The date and time that the rule was created.
- :param str destination: The destination IP address or CIDR block to match.
- The CIDR block `0.0.0.0/0` matches all destination addresses.
- :param str direction: The direction of traffic to match.
- :param str href: The URL for this network ACL rule.
- :param str id: The unique identifier for this network ACL rule.
- :param str ip_version: The IP version for this rule.
- :param str name: The name for this network ACL rule. The name is unique
- across all rules for the network ACL.
- :param str protocol: The protocol to enforce.
- :param str source: The source IP address or CIDR block to match. The CIDR
- block `0.0.0.0/0` matches all source addresses.
- :param NetworkACLRuleReference before: (optional) The rule that this rule
- is immediately before. In a rule collection, this always
- refers to the next item in the collection. If absent, this is the last
- rule.
+ :param str 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.
"""
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP', 'NetworkACLRuleItemNetworkACLRuleProtocolICMP', 'NetworkACLRuleItemNetworkACLRuleProtocolAll'])
- )
- raise Exception(msg)
+ self.cookie_name = cookie_name
+ self.type = type
@classmethod
- def from_dict(cls, _dict: Dict) -> 'NetworkACLRuleItem':
- """Initialize a NetworkACLRuleItem object from a json dictionary."""
- disc_class = cls._get_class_by_discriminator(_dict)
- if disc_class != cls:
- return disc_class.from_dict(_dict)
- msg = "Cannot convert dictionary into an instance of base class 'NetworkACLRuleItem'. The discriminator value should map to a valid subclass: {1}".format(
- ", ".join(['NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP', 'NetworkACLRuleItemNetworkACLRuleProtocolICMP', 'NetworkACLRuleItemNetworkACLRuleProtocolAll'])
- )
- raise Exception(msg)
+ def from_dict(cls, _dict: Dict) -> 'LoadBalancerPoolSessionPersistencePatch':
+ """Initialize a LoadBalancerPoolSessionPersistencePatch object from a json dictionary."""
+ args = {}
+ if (cookie_name := _dict.get('cookie_name')) is not None:
+ args['cookie_name'] = cookie_name
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
+ return cls(**args)
@classmethod
- def _from_dict(cls, _dict: Dict):
- """Initialize a NetworkACLRuleItem object from a json dictionary."""
+ def _from_dict(cls, _dict):
+ """Initialize a LoadBalancerPoolSessionPersistencePatch object from a json dictionary."""
return cls.from_dict(_dict)
- @classmethod
- def _get_class_by_discriminator(cls, _dict: Dict) -> object:
- mapping = {}
- mapping['all'] = 'NetworkACLRuleItemNetworkACLRuleProtocolAll'
- mapping['icmp'] = 'NetworkACLRuleItemNetworkACLRuleProtocolICMP'
- mapping['tcp'] = 'NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP'
- mapping['udp'] = 'NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP'
- disc_value = _dict.get('protocol')
- if disc_value is None:
- raise ValueError('Discriminator property \'protocol\' not found in NetworkACLRuleItem JSON')
- class_name = mapping.get(disc_value, disc_value)
- try:
- disc_class = getattr(sys.modules[__name__], class_name)
- except AttributeError:
- disc_class = cls
- if isinstance(disc_class, object):
- return disc_class
- raise TypeError('%s is not a discriminator class' % class_name)
-
- class ActionEnum(str, Enum):
- """
- The action to perform for a packet matching the rule.
- """
-
- ALLOW = 'allow'
- DENY = 'deny'
-
-
- class DirectionEnum(str, Enum):
- """
- The direction of traffic to match.
- """
-
- INBOUND = 'inbound'
- OUTBOUND = 'outbound'
+ def to_dict(self) -> Dict:
+ """Return a json dictionary representing this model."""
+ _dict = {}
+ if hasattr(self, 'cookie_name') and self.cookie_name is not None:
+ _dict['cookie_name'] = self.cookie_name
+ if hasattr(self, 'type') and self.type is not None:
+ _dict['type'] = self.type
+ return _dict
+ def _to_dict(self):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
- class IpVersionEnum(str, Enum):
- """
- The IP version for this rule.
- """
+ def __str__(self) -> str:
+ """Return a `str` version of this LoadBalancerPoolSessionPersistencePatch object."""
+ return json.dumps(self.to_dict(), indent=2)
- IPV4 = 'ipv4'
+ 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: 'LoadBalancerPoolSessionPersistencePatch') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
- class ProtocolEnum(str, Enum):
+ class TypeEnum(str, Enum):
"""
- The protocol to enforce.
+ The session persistence type. The `http_cookie` and `app_cookie` types are
+ applicable only to the `http` and `https` protocols.
"""
- ALL = 'all'
- ICMP = 'icmp'
- TCP = 'tcp'
- UDP = 'udp'
+ APP_COOKIE = 'app_cookie'
+ HTTP_COOKIE = 'http_cookie'
+ SOURCE_IP = 'source_ip'
-class NetworkACLRulePatch:
+class LoadBalancerPoolSessionPersistencePrototype:
"""
- NetworkACLRulePatch.
+ LoadBalancerPoolSessionPersistencePrototype.
- :attr str action: (optional) The action to perform for a packet matching the
- rule.
- :attr NetworkACLRuleBeforePatch before: (optional) The rule to move this rule
- immediately before.
- Specify `null` to move this rule after all existing rules.
- :attr int code: (optional) The ICMP traffic code to match. If set, `type` must
- also be set.
- Specify `null` to remove an existing ICMP traffic code.
- :attr str destination: (optional) The destination IP address or CIDR block to
- match. The CIDR block `0.0.0.0/0` matches all destination addresses.
- :attr int destination_port_max: (optional) The inclusive upper bound of TCP/UDP
- destination port range.
- :attr int destination_port_min: (optional) The inclusive lower bound of TCP/UDP
- destination port range.
- :attr str direction: (optional) The direction of traffic to match.
- :attr str name: (optional) The name for this network ACL rule. The name must not
- be used by another rule for the network ACL.
- :attr str protocol: (optional) The protocol to enforce.
- :attr str source: (optional) The source IP address or CIDR block to match. The
- CIDR block `0.0.0.0/0` matches all source addresses.
- :attr int source_port_max: (optional) The inclusive upper bound of TCP/UDP
- source port range.
- :attr int source_port_min: (optional) The inclusive lower bound of TCP/UDP
- source port range.
- :attr int type: (optional) The ICMP traffic type to match.
- Specify `null` to remove an existing ICMP traffic type value.
+ :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: The session persistence type. The `http_cookie` and
+ `app_cookie` types are applicable only to the `http` and `https` protocols.
"""
def __init__(
self,
+ type: str,
*,
- action: str = None,
- before: 'NetworkACLRuleBeforePatch' = None,
- code: int = None,
- destination: str = None,
- destination_port_max: int = None,
- destination_port_min: int = None,
- direction: str = None,
- name: str = None,
- protocol: str = None,
- source: str = None,
- source_port_max: int = None,
- source_port_min: int = None,
- type: int = None,
+ cookie_name: Optional[str] = None,
) -> None:
"""
- Initialize a NetworkACLRulePatch object.
+ Initialize a LoadBalancerPoolSessionPersistencePrototype object.
- :param str action: (optional) The action to perform for a packet matching
- the rule.
- :param NetworkACLRuleBeforePatch before: (optional) The rule to move this
- rule immediately before.
- Specify `null` to move this rule after all existing rules.
- :param int code: (optional) The ICMP traffic code to match. If set, `type`
- must also be set.
- Specify `null` to remove an existing ICMP traffic code.
- :param str destination: (optional) The destination IP address or CIDR block
- to match. The CIDR block `0.0.0.0/0` matches all destination addresses.
- :param int destination_port_max: (optional) The inclusive upper bound of
- TCP/UDP destination port range.
- :param int destination_port_min: (optional) The inclusive lower bound of
- TCP/UDP destination port range.
- :param str direction: (optional) The direction of traffic to match.
- :param str name: (optional) The name for this network ACL rule. The name
- must not be used by another rule for the network ACL.
- :param str protocol: (optional) The protocol to enforce.
- :param str source: (optional) The source IP address or CIDR block to match.
- The CIDR block `0.0.0.0/0` matches all source addresses.
- :param int source_port_max: (optional) The inclusive upper bound of TCP/UDP
- source port range.
- :param int source_port_min: (optional) The inclusive lower bound of TCP/UDP
- source port range.
- :param int type: (optional) The ICMP traffic type to match.
- Specify `null` to remove an existing ICMP traffic type value.
+ :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.before = before
- self.code = code
- self.destination = destination
- self.destination_port_max = destination_port_max
- self.destination_port_min = destination_port_min
- self.direction = direction
- self.name = name
- self.protocol = protocol
- self.source = source
- self.source_port_max = source_port_max
- self.source_port_min = source_port_min
+ self.cookie_name = cookie_name
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) -> 'LoadBalancerPoolSessionPersistencePrototype':
+ """Initialize a LoadBalancerPoolSessionPersistencePrototype object from a json dictionary."""
args = {}
- if 'action' in _dict:
- args['action'] = _dict.get('action')
- if 'before' in _dict:
- args['before'] = _dict.get('before')
- if 'code' in _dict:
- args['code'] = _dict.get('code')
- if 'destination' in _dict:
- args['destination'] = _dict.get('destination')
- if 'destination_port_max' in _dict:
- args['destination_port_max'] = _dict.get('destination_port_max')
- if 'destination_port_min' in _dict:
- args['destination_port_min'] = _dict.get('destination_port_min')
- if 'direction' in _dict:
- args['direction'] = _dict.get('direction')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
- if 'protocol' in _dict:
- args['protocol'] = _dict.get('protocol')
- if 'source' in _dict:
- args['source'] = _dict.get('source')
- if 'source_port_max' in _dict:
- args['source_port_max'] = _dict.get('source_port_max')
- if 'source_port_min' in _dict:
- args['source_port_min'] = _dict.get('source_port_min')
- if 'type' in _dict:
- args['type'] = _dict.get('type')
+ if (cookie_name := _dict.get('cookie_name')) is not None:
+ args['cookie_name'] = cookie_name
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
+ else:
+ raise ValueError('Required property \'type\' not present in LoadBalancerPoolSessionPersistencePrototype JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a NetworkACLRulePatch 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, '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, 'protocol') and self.protocol is not None:
- _dict['protocol'] = self.protocol
- if hasattr(self, 'source') and self.source is not None:
- _dict['source'] = self.source
- if hasattr(self, 'source_port_max') and self.source_port_max is not None:
- _dict['source_port_max'] = self.source_port_max
- if hasattr(self, 'source_port_min') and self.source_port_min is not None:
- _dict['source_port_min'] = self.source_port_min
+ if hasattr(self, '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
@@ -60080,374 +63074,295 @@ 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 LoadBalancerPoolSessionPersistencePrototype object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'NetworkACLRulePatch') -> 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: 'NetworkACLRulePatch') -> 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):
- """
- The action to perform for a packet matching the rule.
- """
-
- ALLOW = 'allow'
- DENY = 'deny'
-
-
- class DirectionEnum(str, Enum):
- """
- The direction of traffic to match.
- """
-
- INBOUND = 'inbound'
- OUTBOUND = 'outbound'
-
-
- class ProtocolEnum(str, Enum):
+ class TypeEnum(str, Enum):
"""
- The protocol to enforce.
+ The session persistence type. The `http_cookie` and `app_cookie` types are
+ applicable only to the `http` and `https` protocols.
"""
- ALL = 'all'
- ICMP = 'icmp'
- TCP = 'tcp'
- UDP = 'udp'
+ APP_COOKIE = 'app_cookie'
+ HTTP_COOKIE = 'http_cookie'
+ SOURCE_IP = 'source_ip'
-class NetworkACLRulePrototype:
+class LoadBalancerPrivateIpsItem:
"""
- NetworkACLRulePrototype.
+ LoadBalancerPrivateIpsItem.
- :attr str action: The action to perform for a packet matching the rule.
- :attr NetworkACLRuleBeforePrototype before: (optional) The rule to insert this
- rule immediately before.
- If unspecified, this rule will be inserted after all existing rules.
- :attr str destination: The destination IP address or CIDR block to match. The
- CIDR block `0.0.0.0/0` matches all destination addresses.
- :attr str direction: The direction of traffic to match.
- :attr str ip_version: (optional) The IP version for this rule.
- :attr str name: (optional) The name for this network ACL rule. The name must not
- be used by another rule for the network ACL. If unspecified, the name will be a
- hyphenated list of randomly-selected words.
- :attr str protocol: The protocol to enforce.
- :attr str source: The source IP address or CIDR block to match. The CIDR block
- `0.0.0.0/0` matches all source addresses.
+ :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 ReservedIPReferenceDeleted deleted: (optional) If present, this property
+ indicates the referenced resource has been deleted, and provides
+ some supplementary information.
+ :param str href: The URL for this reserved IP.
+ :param str id: The unique identifier for this reserved IP.
+ :param str name: The name for this reserved IP. The name is unique across all
+ reserved IPs in a subnet.
+ :param str resource_type: The resource type.
"""
def __init__(
self,
- action: str,
- destination: str,
- direction: str,
- protocol: str,
- source: str,
+ address: str,
+ href: str,
+ id: str,
+ name: str,
+ resource_type: str,
*,
- before: 'NetworkACLRuleBeforePrototype' = None,
- ip_version: str = None,
- name: str = None,
+ deleted: Optional['ReservedIPReferenceDeleted'] = None,
) -> None:
"""
- Initialize a NetworkACLRulePrototype object.
+ Initialize a LoadBalancerPrivateIpsItem object.
- :param str action: The action to perform for a packet matching the rule.
- :param str destination: The destination IP address or CIDR block to match.
- The CIDR block `0.0.0.0/0` matches all destination addresses.
- :param str direction: The direction of traffic to match.
- :param str protocol: The protocol to enforce.
- :param str source: The source IP address or CIDR block to match. The CIDR
- block `0.0.0.0/0` matches all source addresses.
- :param NetworkACLRuleBeforePrototype before: (optional) The rule to insert
- this rule immediately before.
- If unspecified, this rule will be inserted after all existing rules.
- :param str ip_version: (optional) The IP version for this rule.
- :param str name: (optional) The name for this network ACL rule. The name
- must not be used by another rule for the network ACL. If unspecified, the
- name will be a hyphenated list of randomly-selected words.
+ :param str address: The IP address.
+ If the address has not yet been selected, the value will be `0.0.0.0`.
+ This property may add support for IPv6 addresses in the future. When
+ processing a value in this property, verify that the address is in an
+ expected format. If it is not, log an error. Optionally halt processing and
+ surface the error, or bypass the resource on which the unexpected IP
+ address format was encountered.
+ :param str href: The URL for this reserved IP.
+ :param str id: The unique identifier for this reserved IP.
+ :param str name: The name for this reserved IP. The name is unique across
+ all reserved IPs in a subnet.
+ :param str resource_type: The resource type.
+ :param ReservedIPReferenceDeleted deleted: (optional) If present, this
+ property indicates the referenced resource has been deleted, and provides
+ some supplementary information.
"""
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype', 'NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype', 'NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype'])
- )
- raise Exception(msg)
+ self.address = address
+ self.deleted = deleted
+ self.href = href
+ self.id = id
+ self.name = name
+ self.resource_type = resource_type
@classmethod
- def from_dict(cls, _dict: Dict) -> 'NetworkACLRulePrototype':
- """Initialize a NetworkACLRulePrototype object from a json dictionary."""
- disc_class = cls._get_class_by_discriminator(_dict)
- if disc_class != cls:
- return disc_class.from_dict(_dict)
- msg = "Cannot convert dictionary into an instance of base class 'NetworkACLRulePrototype'. The discriminator value should map to a valid subclass: {1}".format(
- ", ".join(['NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype', 'NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype', 'NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype'])
- )
- raise Exception(msg)
+ def from_dict(cls, _dict: Dict) -> 'LoadBalancerPrivateIpsItem':
+ """Initialize a LoadBalancerPrivateIpsItem object from a json dictionary."""
+ args = {}
+ if (address := _dict.get('address')) is not None:
+ args['address'] = address
+ else:
+ raise ValueError('Required property \'address\' not present in LoadBalancerPrivateIpsItem JSON')
+ if (deleted := _dict.get('deleted')) is not None:
+ args['deleted'] = ReservedIPReferenceDeleted.from_dict(deleted)
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
+ else:
+ raise ValueError('Required property \'href\' not present in LoadBalancerPrivateIpsItem JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
+ else:
+ raise ValueError('Required property \'id\' not present in LoadBalancerPrivateIpsItem JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ else:
+ raise ValueError('Required property \'name\' not present in LoadBalancerPrivateIpsItem JSON')
+ if (resource_type := _dict.get('resource_type')) is not None:
+ args['resource_type'] = resource_type
+ else:
+ raise ValueError('Required property \'resource_type\' not present in LoadBalancerPrivateIpsItem JSON')
+ return cls(**args)
@classmethod
- def _from_dict(cls, _dict: Dict):
- """Initialize a NetworkACLRulePrototype object from a json dictionary."""
+ def _from_dict(cls, _dict):
+ """Initialize a LoadBalancerPrivateIpsItem object from a json dictionary."""
return cls.from_dict(_dict)
- @classmethod
- def _get_class_by_discriminator(cls, _dict: Dict) -> object:
- mapping = {}
- mapping['all'] = 'NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype'
- mapping['icmp'] = 'NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype'
- mapping['tcp'] = 'NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype'
- mapping['udp'] = 'NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype'
- disc_value = _dict.get('protocol')
- if disc_value is None:
- raise ValueError('Discriminator property \'protocol\' not found in NetworkACLRulePrototype JSON')
- class_name = mapping.get(disc_value, disc_value)
- try:
- disc_class = getattr(sys.modules[__name__], class_name)
- except AttributeError:
- disc_class = cls
- if isinstance(disc_class, object):
- return disc_class
- raise TypeError('%s is not a discriminator class' % class_name)
-
- class ActionEnum(str, Enum):
- """
- The action to perform for a packet matching the rule.
- """
-
- ALLOW = 'allow'
- DENY = 'deny'
-
-
- class DirectionEnum(str, Enum):
- """
- The direction of traffic to match.
- """
-
- INBOUND = 'inbound'
- OUTBOUND = 'outbound'
+ def to_dict(self) -> Dict:
+ """Return a json dictionary representing this model."""
+ _dict = {}
+ if hasattr(self, 'address') and self.address is not None:
+ _dict['address'] = self.address
+ if hasattr(self, 'deleted') and self.deleted is not None:
+ if isinstance(self.deleted, dict):
+ _dict['deleted'] = self.deleted
+ else:
+ _dict['deleted'] = self.deleted.to_dict()
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
+ if hasattr(self, 'id') and self.id is not None:
+ _dict['id'] = self.id
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ if hasattr(self, 'resource_type') and self.resource_type is not None:
+ _dict['resource_type'] = self.resource_type
+ return _dict
+ def _to_dict(self):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
- class IpVersionEnum(str, Enum):
- """
- The IP version for this rule.
- """
+ def __str__(self) -> str:
+ """Return a `str` version of this LoadBalancerPrivateIpsItem object."""
+ return json.dumps(self.to_dict(), indent=2)
- IPV4 = 'ipv4'
+ def __eq__(self, other: 'LoadBalancerPrivateIpsItem') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+ def __ne__(self, other: 'LoadBalancerPrivateIpsItem') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
- class ProtocolEnum(str, Enum):
+ class ResourceTypeEnum(str, Enum):
"""
- The protocol to enforce.
+ The resource type.
"""
- ALL = 'all'
- ICMP = 'icmp'
- TCP = 'tcp'
- UDP = 'udp'
+ SUBNET_RESERVED_IP = 'subnet_reserved_ip'
-class NetworkACLRulePrototypeNetworkACLContext:
+class LoadBalancerProfile:
"""
- NetworkACLRulePrototypeNetworkACLContext.
+ LoadBalancerProfile.
- :attr str action: The action to perform for a packet matching the rule.
- :attr str destination: The destination IP address or CIDR block to match. The
- CIDR block `0.0.0.0/0` matches all destination addresses.
- :attr str direction: The direction of traffic to match.
- :attr str ip_version: (optional) The IP version for this rule.
- :attr str name: (optional) The name for this network ACL rule. The name must not
- be used by another rule for the network ACL. If unspecified, the name will be a
- hyphenated list of randomly-selected words.
- :attr str protocol: The protocol to enforce.
- :attr str source: The source IP address or CIDR block to match. The CIDR block
- `0.0.0.0/0` matches all source addresses.
+ :param str family: The product family this load balancer profile belongs to.
+ :param str href: The URL for this load balancer profile.
+ :param LoadBalancerProfileInstanceGroupsSupported instance_groups_supported:
+ :param LoadBalancerProfileLoggingSupported logging_supported: Indicates which
+ logging type(s) are supported for a load balancer with this profile.
+ :param str name: The globally unique name for this load balancer profile.
+ :param LoadBalancerProfileRouteModeSupported route_mode_supported:
+ :param LoadBalancerProfileSecurityGroupsSupported security_groups_supported:
+ :param LoadBalancerProfileUDPSupported udp_supported:
"""
def __init__(
self,
- action: str,
- destination: str,
- direction: str,
- protocol: str,
- source: str,
- *,
- ip_version: str = None,
- name: str = None,
+ family: str,
+ href: str,
+ instance_groups_supported: 'LoadBalancerProfileInstanceGroupsSupported',
+ logging_supported: 'LoadBalancerProfileLoggingSupported',
+ name: str,
+ route_mode_supported: 'LoadBalancerProfileRouteModeSupported',
+ security_groups_supported: 'LoadBalancerProfileSecurityGroupsSupported',
+ udp_supported: 'LoadBalancerProfileUDPSupported',
) -> None:
"""
- Initialize a NetworkACLRulePrototypeNetworkACLContext object.
+ Initialize a LoadBalancerProfile object.
- :param str action: The action to perform for a packet matching the rule.
- :param str destination: The destination IP address or CIDR block to match.
- The CIDR block `0.0.0.0/0` matches all destination addresses.
- :param str direction: The direction of traffic to match.
- :param str protocol: The protocol to enforce.
- :param str source: The source IP address or CIDR block to match. The CIDR
- block `0.0.0.0/0` matches all source addresses.
- :param str ip_version: (optional) The IP version for this rule.
- :param str name: (optional) The name for this network ACL rule. The name
- must not be used by another rule for the network ACL. If unspecified, the
- name will be a hyphenated list of randomly-selected words.
- """
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype', 'NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype', 'NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype'])
- )
- raise Exception(msg)
-
- @classmethod
- def from_dict(cls, _dict: Dict) -> 'NetworkACLRulePrototypeNetworkACLContext':
- """Initialize a NetworkACLRulePrototypeNetworkACLContext object from a json dictionary."""
- disc_class = cls._get_class_by_discriminator(_dict)
- if disc_class != cls:
- return disc_class.from_dict(_dict)
- msg = "Cannot convert dictionary into an instance of base class 'NetworkACLRulePrototypeNetworkACLContext'. The discriminator value should map to a valid subclass: {1}".format(
- ", ".join(['NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype', 'NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype', 'NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype'])
- )
- raise Exception(msg)
-
- @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'] = 'NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype'
- mapping['icmp'] = 'NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype'
- mapping['tcp'] = 'NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype'
- mapping['udp'] = 'NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype'
- disc_value = _dict.get('protocol')
- if disc_value is None:
- raise ValueError('Discriminator property \'protocol\' not found in NetworkACLRulePrototypeNetworkACLContext JSON')
- class_name = mapping.get(disc_value, disc_value)
- try:
- disc_class = getattr(sys.modules[__name__], class_name)
- except AttributeError:
- disc_class = cls
- if isinstance(disc_class, object):
- return disc_class
- raise TypeError('%s is not a discriminator class' % class_name)
-
- class ActionEnum(str, Enum):
- """
- The action to perform for a packet matching the rule.
- """
-
- ALLOW = 'allow'
- DENY = 'deny'
-
-
- class DirectionEnum(str, Enum):
- """
- The direction of traffic to match.
- """
-
- INBOUND = 'inbound'
- OUTBOUND = 'outbound'
-
-
- class IpVersionEnum(str, Enum):
- """
- The IP version for this rule.
- """
-
- IPV4 = 'ipv4'
-
-
- class ProtocolEnum(str, Enum):
- """
- The protocol to enforce.
- """
-
- ALL = 'all'
- ICMP = 'icmp'
- TCP = 'tcp'
- UDP = 'udp'
-
-
-
-class NetworkACLRuleReference:
- """
- NetworkACLRuleReference.
-
- :attr NetworkACLRuleReferenceDeleted deleted: (optional) If present, this
- property indicates the referenced resource has been deleted, and provides
- some supplementary information.
- :attr str href: The URL for this network ACL rule.
- :attr str id: The unique identifier for this network ACL rule.
- :attr str name: The name for this network ACL rule. The name is unique across
- all rules for the network ACL.
- """
-
- def __init__(
- self,
- href: str,
- id: str,
- name: str,
- *,
- deleted: 'NetworkACLRuleReferenceDeleted' = None,
- ) -> None:
- """
- Initialize a NetworkACLRuleReference object.
-
- :param str href: The URL for this network ACL rule.
- :param str id: The unique identifier for this network ACL rule.
- :param str name: The name for this network ACL rule. The name is unique
- across all rules for the network ACL.
- :param NetworkACLRuleReferenceDeleted deleted: (optional) If present, this
- 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 LoadBalancerProfileInstanceGroupsSupported
+ instance_groups_supported:
+ :param LoadBalancerProfileLoggingSupported logging_supported: Indicates
+ which logging type(s) are supported for a load balancer with this profile.
+ :param str name: The globally unique name for this load balancer profile.
+ :param LoadBalancerProfileRouteModeSupported route_mode_supported:
+ :param LoadBalancerProfileSecurityGroupsSupported
+ security_groups_supported:
+ :param LoadBalancerProfileUDPSupported udp_supported:
"""
- self.deleted = deleted
+ self.family = family
self.href = href
- self.id = id
+ self.instance_groups_supported = instance_groups_supported
+ self.logging_supported = logging_supported
self.name = name
+ self.route_mode_supported = route_mode_supported
+ self.security_groups_supported = security_groups_supported
+ self.udp_supported = udp_supported
@classmethod
- def from_dict(cls, _dict: Dict) -> 'NetworkACLRuleReference':
- """Initialize a NetworkACLRuleReference 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'] = NetworkACLRuleReferenceDeleted.from_dict(_dict.get('deleted'))
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ if (family := _dict.get('family')) is not None:
+ args['family'] = family
else:
- raise ValueError('Required property \'href\' not present in NetworkACLRuleReference JSON')
- if 'id' in _dict:
- args['id'] = _dict.get('id')
+ raise ValueError('Required property \'family\' not present in LoadBalancerProfile JSON')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'id\' not present in NetworkACLRuleReference JSON')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
+ raise ValueError('Required property \'href\' not present in LoadBalancerProfile JSON')
+ if (instance_groups_supported := _dict.get('instance_groups_supported')) is not None:
+ args['instance_groups_supported'] = instance_groups_supported
else:
- raise ValueError('Required property \'name\' not present in NetworkACLRuleReference JSON')
+ raise ValueError('Required property \'instance_groups_supported\' not present in LoadBalancerProfile JSON')
+ if (logging_supported := _dict.get('logging_supported')) is not None:
+ args['logging_supported'] = LoadBalancerProfileLoggingSupported.from_dict(logging_supported)
+ else:
+ raise ValueError('Required property \'logging_supported\' not present in LoadBalancerProfile JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ else:
+ raise ValueError('Required property \'name\' not present in LoadBalancerProfile JSON')
+ if (route_mode_supported := _dict.get('route_mode_supported')) is not None:
+ args['route_mode_supported'] = route_mode_supported
+ else:
+ raise ValueError('Required property \'route_mode_supported\' not present in LoadBalancerProfile JSON')
+ if (security_groups_supported := _dict.get('security_groups_supported')) is not None:
+ args['security_groups_supported'] = security_groups_supported
+ else:
+ raise ValueError('Required property \'security_groups_supported\' not present in LoadBalancerProfile JSON')
+ if (udp_supported := _dict.get('udp_supported')) is not None:
+ args['udp_supported'] = udp_supported
+ else:
+ raise ValueError('Required property \'udp_supported\' not present in LoadBalancerProfile JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a NetworkACLRuleReference 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:
- if isinstance(self.deleted, dict):
- _dict['deleted'] = self.deleted
- else:
- _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, 'instance_groups_supported') and self.instance_groups_supported is not None:
+ if isinstance(self.instance_groups_supported, dict):
+ _dict['instance_groups_supported'] = self.instance_groups_supported
+ else:
+ _dict['instance_groups_supported'] = self.instance_groups_supported.to_dict()
+ if hasattr(self, 'logging_supported') and self.logging_supported is not None:
+ if isinstance(self.logging_supported, dict):
+ _dict['logging_supported'] = self.logging_supported
+ else:
+ _dict['logging_supported'] = self.logging_supported.to_dict()
if hasattr(self, 'name') and self.name is not None:
_dict['name'] = self.name
+ if hasattr(self, 'route_mode_supported') and self.route_mode_supported is not None:
+ if isinstance(self.route_mode_supported, dict):
+ _dict['route_mode_supported'] = self.route_mode_supported
+ else:
+ _dict['route_mode_supported'] = self.route_mode_supported.to_dict()
+ if hasattr(self, 'security_groups_supported') and self.security_groups_supported is not None:
+ if isinstance(self.security_groups_supported, dict):
+ _dict['security_groups_supported'] = self.security_groups_supported
+ else:
+ _dict['security_groups_supported'] = self.security_groups_supported.to_dict()
+ if hasattr(self, 'udp_supported') and self.udp_supported is not None:
+ if isinstance(self.udp_supported, dict):
+ _dict['udp_supported'] = self.udp_supported
+ else:
+ _dict['udp_supported'] = self.udp_supported.to_dict()
return _dict
def _to_dict(self):
@@ -60455,59 +63370,118 @@ 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 LoadBalancerProfile object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'NetworkACLRuleReference') -> 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: 'NetworkACLRuleReference') -> bool:
+ def __ne__(self, other: 'LoadBalancerProfile') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class NetworkACLRuleReferenceDeleted:
+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.
+ :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 LoadBalancerProfileCollectionNext next: (optional) A link to the next
+ page of resources. This property is present for all pages
+ except the last page.
+ :param List[LoadBalancerProfile] profiles: Collection of load balancer profiles.
+ :param int total_count: The total number of resources across all pages.
"""
def __init__(
self,
- more_info: str,
+ first: 'LoadBalancerProfileCollectionFirst',
+ limit: int,
+ profiles: List['LoadBalancerProfile'],
+ total_count: int,
+ *,
+ next: Optional['LoadBalancerProfileCollectionNext'] = None,
) -> None:
"""
- Initialize a NetworkACLRuleReferenceDeleted 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) -> 'NetworkACLRuleReferenceDeleted':
- """Initialize a NetworkACLRuleReferenceDeleted 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 := _dict.get('first')) is not None:
+ args['first'] = LoadBalancerProfileCollectionFirst.from_dict(first)
else:
- raise ValueError('Required property \'more_info\' not present in NetworkACLRuleReferenceDeleted JSON')
+ raise ValueError('Required property \'first\' not present in LoadBalancerProfileCollection JSON')
+ if (limit := _dict.get('limit')) is not None:
+ args['limit'] = limit
+ else:
+ raise ValueError('Required property \'limit\' not present in LoadBalancerProfileCollection JSON')
+ if (next := _dict.get('next')) is not None:
+ args['next'] = LoadBalancerProfileCollectionNext.from_dict(next)
+ if (profiles := _dict.get('profiles')) is not None:
+ args['profiles'] = [LoadBalancerProfile.from_dict(v) for v in profiles]
+ else:
+ raise ValueError('Required property \'profiles\' not present in LoadBalancerProfileCollection JSON')
+ if (total_count := _dict.get('total_count')) is not None:
+ args['total_count'] = 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 NetworkACLRuleReferenceDeleted 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:
+ if isinstance(self.first, dict):
+ _dict['first'] = self.first
+ else:
+ _dict['first'] = self.first.to_dict()
+ if hasattr(self, 'limit') and self.limit is not None:
+ _dict['limit'] = self.limit
+ if hasattr(self, 'next') and self.next is not None:
+ if isinstance(self.next, dict):
+ _dict['next'] = self.next
+ else:
+ _dict['next'] = self.next.to_dict()
+ if hasattr(self, 'profiles') and self.profiles is not None:
+ profiles_list = []
+ for v in self.profiles:
+ if isinstance(v, dict):
+ profiles_list.append(v)
+ else:
+ profiles_list.append(v.to_dict())
+ _dict['profiles'] = profiles_list
+ if hasattr(self, 'total_count') and self.total_count is not None:
+ _dict['total_count'] = self.total_count
return _dict
def _to_dict(self):
@@ -60515,204 +63489,58 @@ 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 LoadBalancerProfileCollection object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'NetworkACLRuleReferenceDeleted') -> 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: 'NetworkACLRuleReferenceDeleted') -> bool:
+ def __ne__(self, other: 'LoadBalancerProfileCollection') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class NetworkInterface:
+class LoadBalancerProfileCollectionFirst:
"""
- NetworkInterface.
+ A link to the first page of resources.
- :attr bool allow_ip_spoofing: Indicates whether source IP spoofing is allowed on
- this instance network interface.
- :attr datetime created_at: The date and time that the instance network interface
- was created.
- :attr List[FloatingIPReference] floating_ips: The floating IPs associated with
- this instance network interface.
- :attr str href: The URL for this instance network interface.
- :attr str id: The unique identifier for this instance network interface.
- :attr str name: The name for this instance network interface.
- :attr int port_speed: The instance network interface port speed in Mbps.
- :attr ReservedIPReference primary_ip:
- :attr str resource_type: The resource type.
- :attr List[SecurityGroupReference] security_groups: The security groups
- targeting this instance network interface.
- :attr str status: The status of the instance network interface.
- :attr SubnetReference subnet: The associated subnet.
- :attr str type: The instance network interface type.
+ :param str href: The URL for a page of resources.
"""
def __init__(
self,
- allow_ip_spoofing: bool,
- created_at: datetime,
- floating_ips: List['FloatingIPReference'],
href: str,
- id: str,
- name: str,
- port_speed: int,
- primary_ip: 'ReservedIPReference',
- resource_type: str,
- security_groups: List['SecurityGroupReference'],
- status: str,
- subnet: 'SubnetReference',
- type: str,
) -> None:
"""
- Initialize a NetworkInterface object.
+ Initialize a LoadBalancerProfileCollectionFirst object.
- :param bool allow_ip_spoofing: Indicates whether source IP spoofing is
- allowed on this instance network interface.
- :param datetime created_at: The date and time that the instance network
- interface was created.
- :param List[FloatingIPReference] floating_ips: The floating IPs associated
- with this instance network interface.
- :param str href: The URL for this instance network interface.
- :param str id: The unique identifier for this instance network interface.
- :param str name: The name for this instance network interface.
- :param int port_speed: The instance network interface port speed in Mbps.
- :param ReservedIPReference primary_ip:
- :param str resource_type: The resource type.
- :param List[SecurityGroupReference] security_groups: The security groups
- targeting this instance network interface.
- :param str status: The status of the instance network interface.
- :param SubnetReference subnet: The associated subnet.
- :param str type: The instance network interface type.
+ :param str href: The URL for a page of resources.
"""
- self.allow_ip_spoofing = allow_ip_spoofing
- self.created_at = created_at
- self.floating_ips = floating_ips
self.href = href
- self.id = id
- self.name = name
- self.port_speed = port_speed
- self.primary_ip = primary_ip
- self.resource_type = resource_type
- self.security_groups = security_groups
- self.status = status
- self.subnet = subnet
- self.type = type
@classmethod
- def from_dict(cls, _dict: Dict) -> 'NetworkInterface':
- """Initialize a NetworkInterface object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'LoadBalancerProfileCollectionFirst':
+ """Initialize a LoadBalancerProfileCollectionFirst object from a json dictionary."""
args = {}
- if 'allow_ip_spoofing' in _dict:
- args['allow_ip_spoofing'] = _dict.get('allow_ip_spoofing')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'allow_ip_spoofing\' not present in NetworkInterface JSON')
- if 'created_at' in _dict:
- args['created_at'] = string_to_datetime(_dict.get('created_at'))
- else:
- raise ValueError('Required property \'created_at\' not present in NetworkInterface JSON')
- if 'floating_ips' in _dict:
- args['floating_ips'] = [FloatingIPReference.from_dict(v) for v in _dict.get('floating_ips')]
- else:
- raise ValueError('Required property \'floating_ips\' not present in NetworkInterface JSON')
- if 'href' in _dict:
- args['href'] = _dict.get('href')
- else:
- raise ValueError('Required property \'href\' not present in NetworkInterface JSON')
- if 'id' in _dict:
- args['id'] = _dict.get('id')
- else:
- raise ValueError('Required property \'id\' not present in NetworkInterface JSON')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
- else:
- raise ValueError('Required property \'name\' not present in NetworkInterface JSON')
- if 'port_speed' in _dict:
- args['port_speed'] = _dict.get('port_speed')
- else:
- raise ValueError('Required property \'port_speed\' not present in NetworkInterface JSON')
- if 'primary_ip' in _dict:
- args['primary_ip'] = ReservedIPReference.from_dict(_dict.get('primary_ip'))
- else:
- raise ValueError('Required property \'primary_ip\' not present in NetworkInterface JSON')
- if 'resource_type' in _dict:
- args['resource_type'] = _dict.get('resource_type')
- else:
- raise ValueError('Required property \'resource_type\' not present in NetworkInterface JSON')
- if 'security_groups' in _dict:
- args['security_groups'] = [SecurityGroupReference.from_dict(v) for v in _dict.get('security_groups')]
- else:
- raise ValueError('Required property \'security_groups\' not present in NetworkInterface JSON')
- if 'status' in _dict:
- args['status'] = _dict.get('status')
- else:
- raise ValueError('Required property \'status\' not present in NetworkInterface JSON')
- if 'subnet' in _dict:
- args['subnet'] = SubnetReference.from_dict(_dict.get('subnet'))
- else:
- raise ValueError('Required property \'subnet\' not present in NetworkInterface JSON')
- if 'type' in _dict:
- args['type'] = _dict.get('type')
- else:
- raise ValueError('Required property \'type\' not present in NetworkInterface JSON')
+ raise ValueError('Required property \'href\' not present in LoadBalancerProfileCollectionFirst JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a NetworkInterface 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, 'allow_ip_spoofing') and self.allow_ip_spoofing is not None:
- _dict['allow_ip_spoofing'] = self.allow_ip_spoofing
- if hasattr(self, 'created_at') and self.created_at is not None:
- _dict['created_at'] = datetime_to_string(self.created_at)
- if hasattr(self, 'floating_ips') and self.floating_ips is not None:
- floating_ips_list = []
- for v in self.floating_ips:
- if isinstance(v, dict):
- floating_ips_list.append(v)
- else:
- floating_ips_list.append(v.to_dict())
- _dict['floating_ips'] = floating_ips_list
if hasattr(self, 'href') and self.href is not None:
_dict['href'] = self.href
- if hasattr(self, 'id') and self.id is not None:
- _dict['id'] = self.id
- if hasattr(self, 'name') and self.name is not None:
- _dict['name'] = self.name
- if hasattr(self, 'port_speed') and self.port_speed is not None:
- _dict['port_speed'] = self.port_speed
- if hasattr(self, 'primary_ip') and self.primary_ip is not None:
- if isinstance(self.primary_ip, dict):
- _dict['primary_ip'] = self.primary_ip
- else:
- _dict['primary_ip'] = self.primary_ip.to_dict()
- if hasattr(self, 'resource_type') and self.resource_type is not None:
- _dict['resource_type'] = self.resource_type
- if hasattr(self, 'security_groups') and self.security_groups is not None:
- security_groups_list = []
- for v in self.security_groups:
- if isinstance(v, dict):
- security_groups_list.append(v)
- else:
- security_groups_list.append(v.to_dict())
- _dict['security_groups'] = security_groups_list
- if hasattr(self, 'status') and self.status is not None:
- _dict['status'] = self.status
- if hasattr(self, 'subnet') and self.subnet is not None:
- if isinstance(self.subnet, dict):
- _dict['subnet'] = self.subnet
- else:
- _dict['subnet'] = self.subnet.to_dict()
- if hasattr(self, 'type') and self.type is not None:
- _dict['type'] = self.type
return _dict
def _to_dict(self):
@@ -60720,162 +63548,59 @@ 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 LoadBalancerProfileCollectionFirst object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'NetworkInterface') -> 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: 'NetworkInterface') -> bool:
+ def __ne__(self, other: 'LoadBalancerProfileCollectionFirst') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class ResourceTypeEnum(str, Enum):
- """
- The resource type.
- """
-
- NETWORK_INTERFACE = 'network_interface'
-
-
- class StatusEnum(str, Enum):
- """
- The status of the instance network interface.
- """
-
- AVAILABLE = 'available'
- DELETING = 'deleting'
- FAILED = 'failed'
- PENDING = 'pending'
-
-
- class TypeEnum(str, Enum):
- """
- The instance network interface type.
- """
-
- PRIMARY = 'primary'
- SECONDARY = 'secondary'
-
-
-class NetworkInterfaceBareMetalServerContextReference:
+class LoadBalancerProfileCollectionNext:
"""
- NetworkInterfaceBareMetalServerContextReference.
+ A link to the next page of resources. This property is present for all pages except
+ the last page.
- :attr NetworkInterfaceBareMetalServerContextReferenceDeleted deleted: (optional)
- If present, this property indicates the referenced resource has been deleted,
- and provides
- some supplementary information.
- :attr str href: The URL for this bare metal server network interface.
- :attr str id: The unique identifier for this bare metal server network
- interface.
- :attr str name: The name for this bare metal server network interface.
- :attr ReservedIPReference primary_ip:
- :attr str resource_type: The resource type.
- :attr SubnetReference subnet: The associated subnet.
+ :param str href: The URL for a page of resources.
"""
def __init__(
self,
href: str,
- id: str,
- name: str,
- primary_ip: 'ReservedIPReference',
- resource_type: str,
- subnet: 'SubnetReference',
- *,
- deleted: 'NetworkInterfaceBareMetalServerContextReferenceDeleted' = None,
) -> None:
"""
- Initialize a NetworkInterfaceBareMetalServerContextReference object.
+ Initialize a LoadBalancerProfileCollectionNext object.
- :param str href: The URL for this bare metal server network interface.
- :param str id: The unique identifier for this bare metal server network
- interface.
- :param str name: The name for this bare metal server network interface.
- :param ReservedIPReference primary_ip:
- :param str resource_type: The resource type.
- :param SubnetReference subnet: The associated subnet.
- :param NetworkInterfaceBareMetalServerContextReferenceDeleted deleted:
- (optional) If present, this property indicates the referenced resource has
- been deleted, and provides
- some supplementary information.
+ :param str href: The URL for a page of resources.
"""
- self.deleted = deleted
self.href = href
- self.id = id
- self.name = name
- self.primary_ip = primary_ip
- self.resource_type = resource_type
- self.subnet = subnet
@classmethod
- def from_dict(cls, _dict: Dict) -> 'NetworkInterfaceBareMetalServerContextReference':
- """Initialize a NetworkInterfaceBareMetalServerContextReference object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'LoadBalancerProfileCollectionNext':
+ """Initialize a LoadBalancerProfileCollectionNext object from a json dictionary."""
args = {}
- if 'deleted' in _dict:
- args['deleted'] = NetworkInterfaceBareMetalServerContextReferenceDeleted.from_dict(_dict.get('deleted'))
- if 'href' in _dict:
- args['href'] = _dict.get('href')
- else:
- raise ValueError('Required property \'href\' not present in NetworkInterfaceBareMetalServerContextReference JSON')
- if 'id' in _dict:
- args['id'] = _dict.get('id')
- else:
- 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_ip' in _dict:
- args['primary_ip'] = ReservedIPReference.from_dict(_dict.get('primary_ip'))
- else:
- raise ValueError('Required property \'primary_ip\' not present in NetworkInterfaceBareMetalServerContextReference JSON')
- if 'resource_type' in _dict:
- args['resource_type'] = _dict.get('resource_type')
- else:
- raise ValueError('Required property \'resource_type\' not present in NetworkInterfaceBareMetalServerContextReference JSON')
- if 'subnet' in _dict:
- args['subnet'] = SubnetReference.from_dict(_dict.get('subnet'))
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'subnet\' not present in NetworkInterfaceBareMetalServerContextReference JSON')
+ raise ValueError('Required property \'href\' not present in LoadBalancerProfileCollectionNext JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a NetworkInterfaceBareMetalServerContextReference 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, 'deleted') and self.deleted is not None:
- if isinstance(self.deleted, dict):
- _dict['deleted'] = self.deleted
- else:
- _dict['deleted'] = self.deleted.to_dict()
if hasattr(self, 'href') and self.href is not None:
_dict['href'] = self.href
- if hasattr(self, 'id') and self.id is not None:
- _dict['id'] = self.id
- if hasattr(self, 'name') and self.name is not None:
- _dict['name'] = self.name
- if hasattr(self, 'primary_ip') and self.primary_ip is not None:
- if isinstance(self.primary_ip, dict):
- _dict['primary_ip'] = self.primary_ip
- else:
- _dict['primary_ip'] = self.primary_ip.to_dict()
- if hasattr(self, 'resource_type') and self.resource_type is not None:
- _dict['resource_type'] = self.resource_type
- if hasattr(self, 'subnet') and self.subnet is not None:
- if isinstance(self.subnet, dict):
- _dict['subnet'] = self.subnet
- else:
- _dict['subnet'] = self.subnet.to_dict()
return _dict
def _to_dict(self):
@@ -60883,67 +63608,108 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this NetworkInterfaceBareMetalServerContextReference object."""
+ """Return a `str` version of this LoadBalancerProfileCollectionNext object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'NetworkInterfaceBareMetalServerContextReference') -> 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: 'NetworkInterfaceBareMetalServerContextReference') -> bool:
+ def __ne__(self, other: 'LoadBalancerProfileCollectionNext') -> 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 LoadBalancerProfileIdentity:
+ """
+ Identifies a load balancer profile by a unique property.
+ """
-class NetworkInterfaceBareMetalServerContextReferenceDeleted:
+ 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 LoadBalancerProfileInstanceGroupsSupported:
"""
- If present, this property indicates the referenced resource has been deleted, and
- provides some supplementary information.
+ LoadBalancerProfileInstanceGroupsSupported.
- :attr str more_info: Link to documentation about deleted resources.
"""
def __init__(
self,
- more_info: str,
) -> None:
"""
- Initialize a NetworkInterfaceBareMetalServerContextReferenceDeleted object.
+ Initialize a LoadBalancerProfileInstanceGroupsSupported 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(['LoadBalancerProfileInstanceGroupsSupportedFixed', 'LoadBalancerProfileInstanceGroupsSupportedDependent'])
+ )
+ raise Exception(msg)
+
+
+class LoadBalancerProfileLoggingSupported:
+ """
+ Indicates which logging type(s) are supported for a load balancer with this profile.
+
+ :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.
+ """
+
+ def __init__(
+ self,
+ type: str,
+ value: List[str],
+ ) -> None:
+ """
+ Initialize a LoadBalancerProfileLoggingSupported 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.
+ """
+ self.type = type
+ self.value = value
@classmethod
- def from_dict(cls, _dict: Dict) -> 'NetworkInterfaceBareMetalServerContextReferenceDeleted':
- """Initialize a NetworkInterfaceBareMetalServerContextReferenceDeleted object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'LoadBalancerProfileLoggingSupported':
+ """Initialize a LoadBalancerProfileLoggingSupported object from a json dictionary."""
args = {}
- if 'more_info' in _dict:
- args['more_info'] = _dict.get('more_info')
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
else:
- raise ValueError('Required property \'more_info\' not present in NetworkInterfaceBareMetalServerContextReferenceDeleted JSON')
+ raise ValueError('Required property \'type\' not present in LoadBalancerProfileLoggingSupported JSON')
+ if (value := _dict.get('value')) is not None:
+ args['value'] = value
+ else:
+ raise ValueError('Required property \'value\' not present in LoadBalancerProfileLoggingSupported JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a NetworkInterfaceBareMetalServerContextReferenceDeleted 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, '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):
@@ -60951,151 +63717,87 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this NetworkInterfaceBareMetalServerContextReferenceDeleted object."""
+ """Return a `str` version of this LoadBalancerProfileLoggingSupported object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'NetworkInterfaceBareMetalServerContextReferenceDeleted') -> 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: 'NetworkInterfaceBareMetalServerContextReferenceDeleted') -> bool:
+ def __ne__(self, other: 'LoadBalancerProfileLoggingSupported') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-
-class NetworkInterfaceIPPrototype:
- """
- NetworkInterfaceIPPrototype.
-
- """
-
- def __init__(
- self,
- ) -> None:
+ class TypeEnum(str, Enum):
"""
- Initialize a NetworkInterfaceIPPrototype object.
-
+ The type for this profile field.
"""
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['NetworkInterfaceIPPrototypeReservedIPIdentity', 'NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext'])
- )
- raise Exception(msg)
+ FIXED = 'fixed'
-class NetworkInterfaceInstanceContextReference:
+
+
+class LoadBalancerProfileReference:
"""
- NetworkInterfaceInstanceContextReference.
+ LoadBalancerProfileReference.
- :attr NetworkInterfaceInstanceContextReferenceDeleted deleted: (optional) If
- present, this property indicates the referenced resource has been deleted, and
- provides
- some supplementary information.
- :attr str href: The URL for this instance network interface.
- :attr str id: The unique identifier for this instance network interface.
- :attr str name: The name for this instance network interface.
- :attr ReservedIPReference primary_ip:
- :attr str resource_type: The resource type.
- :attr SubnetReference subnet: The associated subnet.
+ :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.
"""
def __init__(
self,
+ family: str,
href: str,
- id: str,
name: str,
- primary_ip: 'ReservedIPReference',
- resource_type: str,
- subnet: 'SubnetReference',
- *,
- deleted: 'NetworkInterfaceInstanceContextReferenceDeleted' = None,
) -> None:
"""
- Initialize a NetworkInterfaceInstanceContextReference object.
+ Initialize a LoadBalancerProfileReference object.
- :param str href: The URL for this instance network interface.
- :param str id: The unique identifier for this instance network interface.
- :param str name: The name for this instance network interface.
- :param ReservedIPReference primary_ip:
- :param str resource_type: The resource type.
- :param SubnetReference subnet: The associated subnet.
- :param NetworkInterfaceInstanceContextReferenceDeleted deleted: (optional)
- If present, this property indicates the referenced resource has been
- deleted, and provides
- some supplementary information.
+ :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.deleted = deleted
+ self.family = family
self.href = href
- self.id = id
self.name = name
- self.primary_ip = primary_ip
- self.resource_type = resource_type
- self.subnet = subnet
@classmethod
- def from_dict(cls, _dict: Dict) -> 'NetworkInterfaceInstanceContextReference':
- """Initialize a NetworkInterfaceInstanceContextReference object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'LoadBalancerProfileReference':
+ """Initialize a LoadBalancerProfileReference object from a json dictionary."""
args = {}
- if 'deleted' in _dict:
- args['deleted'] = NetworkInterfaceInstanceContextReferenceDeleted.from_dict(_dict.get('deleted'))
- if 'href' in _dict:
- args['href'] = _dict.get('href')
- else:
- raise ValueError('Required property \'href\' not present in NetworkInterfaceInstanceContextReference JSON')
- if 'id' in _dict:
- args['id'] = _dict.get('id')
- else:
- raise ValueError('Required property \'id\' not present in NetworkInterfaceInstanceContextReference JSON')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
+ if (family := _dict.get('family')) is not None:
+ args['family'] = family
else:
- raise ValueError('Required property \'name\' not present in NetworkInterfaceInstanceContextReference JSON')
- if 'primary_ip' in _dict:
- args['primary_ip'] = ReservedIPReference.from_dict(_dict.get('primary_ip'))
- else:
- raise ValueError('Required property \'primary_ip\' not present in NetworkInterfaceInstanceContextReference JSON')
- if 'resource_type' in _dict:
- args['resource_type'] = _dict.get('resource_type')
+ raise ValueError('Required property \'family\' not present in LoadBalancerProfileReference JSON')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'resource_type\' not present in NetworkInterfaceInstanceContextReference JSON')
- if 'subnet' in _dict:
- args['subnet'] = SubnetReference.from_dict(_dict.get('subnet'))
+ raise ValueError('Required property \'href\' not present in LoadBalancerProfileReference JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
else:
- raise ValueError('Required property \'subnet\' not present in NetworkInterfaceInstanceContextReference JSON')
+ raise ValueError('Required property \'name\' not present in LoadBalancerProfileReference JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a NetworkInterfaceInstanceContextReference 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, 'deleted') and self.deleted is not None:
- if isinstance(self.deleted, dict):
- _dict['deleted'] = self.deleted
- else:
- _dict['deleted'] = self.deleted.to_dict()
+ if hasattr(self, '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, 'primary_ip') and self.primary_ip is not None:
- if isinstance(self.primary_ip, dict):
- _dict['primary_ip'] = self.primary_ip
- else:
- _dict['primary_ip'] = self.primary_ip.to_dict()
- if hasattr(self, 'resource_type') and self.resource_type is not None:
- _dict['resource_type'] = self.resource_type
- if hasattr(self, 'subnet') and self.subnet is not None:
- if isinstance(self.subnet, dict):
- _dict['subnet'] = self.subnet
- else:
- _dict['subnet'] = self.subnet.to_dict()
return _dict
def _to_dict(self):
@@ -61103,34 +63805,83 @@ 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 LoadBalancerProfileReference object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'NetworkInterfaceInstanceContextReference') -> 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: 'NetworkInterfaceInstanceContextReference') -> bool:
+ def __ne__(self, other: 'LoadBalancerProfileReference') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class ResourceTypeEnum(str, Enum):
+
+class LoadBalancerProfileRouteModeSupported:
+ """
+ LoadBalancerProfileRouteModeSupported.
+
+ """
+
+ def __init__(
+ self,
+ ) -> None:
"""
- The resource type.
+ Initialize a LoadBalancerProfileRouteModeSupported object.
+
"""
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['LoadBalancerProfileRouteModeSupportedFixed', 'LoadBalancerProfileRouteModeSupportedDependent'])
+ )
+ raise Exception(msg)
- NETWORK_INTERFACE = 'network_interface'
+class LoadBalancerProfileSecurityGroupsSupported:
+ """
+ LoadBalancerProfileSecurityGroupsSupported.
+ """
-class NetworkInterfaceInstanceContextReferenceDeleted:
+ def __init__(
+ self,
+ ) -> None:
+ """
+ Initialize a LoadBalancerProfileSecurityGroupsSupported object.
+
+ """
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['LoadBalancerProfileSecurityGroupsSupportedFixed', 'LoadBalancerProfileSecurityGroupsSupportedDependent'])
+ )
+ raise Exception(msg)
+
+
+class LoadBalancerProfileUDPSupported:
+ """
+ LoadBalancerProfileUDPSupported.
+
+ """
+
+ def __init__(
+ self,
+ ) -> None:
+ """
+ Initialize a LoadBalancerProfileUDPSupported object.
+
+ """
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['LoadBalancerProfileUDPSupportedFixed', 'LoadBalancerProfileUDPSupportedDependent'])
+ )
+ raise Exception(msg)
+
+
+class LoadBalancerReferenceDeleted:
"""
If present, this property indicates the referenced resource has been deleted, and
provides some supplementary information.
- :attr str more_info: Link to documentation about deleted resources.
+ :param str more_info: Link to documentation about deleted resources.
"""
def __init__(
@@ -61138,25 +63889,25 @@ def __init__(
more_info: str,
) -> None:
"""
- Initialize a NetworkInterfaceInstanceContextReferenceDeleted object.
+ 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) -> 'NetworkInterfaceInstanceContextReferenceDeleted':
- """Initialize a NetworkInterfaceInstanceContextReferenceDeleted object from a json dictionary."""
+ 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')
+ if (more_info := _dict.get('more_info')) is not None:
+ args['more_info'] = more_info
else:
- raise ValueError('Required property \'more_info\' not present in NetworkInterfaceInstanceContextReferenceDeleted JSON')
+ raise ValueError('Required property \'more_info\' not present in LoadBalancerReferenceDeleted JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a NetworkInterfaceInstanceContextReferenceDeleted object from a json dictionary."""
+ """Initialize a LoadBalancerReferenceDeleted object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -61171,70 +63922,94 @@ 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 LoadBalancerReferenceDeleted object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'NetworkInterfaceInstanceContextReferenceDeleted') -> bool:
+ def __eq__(self, other: 'LoadBalancerReferenceDeleted') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'NetworkInterfaceInstanceContextReferenceDeleted') -> bool:
+ def __ne__(self, other: 'LoadBalancerReferenceDeleted') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class NetworkInterfacePatch:
+class LoadBalancerStatistics:
"""
- NetworkInterfacePatch.
+ LoadBalancerStatistics.
- :attr bool allow_ip_spoofing: (optional) Indicates whether source IP spoofing is
- allowed on this instance network interface.
- :attr str name: (optional) The name for the instance network interface. The name
- must not be used by another network interface on the virtual server instance.
+ :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.
"""
def __init__(
self,
- *,
- allow_ip_spoofing: bool = None,
- name: str = None,
+ active_connections: int,
+ connection_rate: float,
+ data_processed_this_month: int,
+ throughput: float,
) -> None:
"""
- Initialize a NetworkInterfacePatch object.
+ Initialize a LoadBalancerStatistics object.
- :param bool allow_ip_spoofing: (optional) Indicates whether source IP
- spoofing is allowed on this instance network interface.
- :param str name: (optional) The name for the instance network interface.
- The name must not be used by another network interface on the virtual
- server instance.
+ :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.allow_ip_spoofing = allow_ip_spoofing
- self.name = name
+ 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) -> 'NetworkInterfacePatch':
- """Initialize a NetworkInterfacePatch object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'LoadBalancerStatistics':
+ """Initialize a LoadBalancerStatistics 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 (active_connections := _dict.get('active_connections')) is not None:
+ args['active_connections'] = active_connections
+ else:
+ raise ValueError('Required property \'active_connections\' not present in LoadBalancerStatistics JSON')
+ if (connection_rate := _dict.get('connection_rate')) is not None:
+ args['connection_rate'] = connection_rate
+ else:
+ raise ValueError('Required property \'connection_rate\' not present in LoadBalancerStatistics JSON')
+ if (data_processed_this_month := _dict.get('data_processed_this_month')) is not None:
+ args['data_processed_this_month'] = data_processed_this_month
+ else:
+ raise ValueError('Required property \'data_processed_this_month\' not present in LoadBalancerStatistics JSON')
+ if (throughput := _dict.get('throughput')) is not None:
+ args['throughput'] = throughput
+ else:
+ raise ValueError('Required property \'throughput\' not present in LoadBalancerStatistics JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a NetworkInterfacePatch 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, '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, '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):
@@ -61242,129 +64017,165 @@ 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 LoadBalancerStatistics object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'NetworkInterfacePatch') -> 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: 'NetworkInterfacePatch') -> bool:
+ def __ne__(self, other: 'LoadBalancerStatistics') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class NetworkInterfacePrototype:
+class NetworkACL:
"""
- NetworkInterfacePrototype.
+ NetworkACL.
- :attr bool allow_ip_spoofing: (optional) Indicates whether source IP spoofing is
- allowed on this instance network interface.
- :attr str name: (optional) The name for the instance network interface. The name
- must not be used by another network interface on the virtual server instance. If
- unspecified, the name will be a hyphenated list of randomly-selected words.
- :attr NetworkInterfaceIPPrototype primary_ip: (optional) The primary IP address
- to bind to the instance network interface. This can be
- specified using an existing reserved IP, or a prototype object for a new
- reserved IP.
- If an existing reserved IP or a prototype object with an address is specified,
- it must
- be available on the instance network interface's subnet. Otherwise, an
- available address on the subnet will be automatically selected and reserved.
- :attr List[SecurityGroupIdentity] security_groups: (optional) The security
- groups to use for this instance network interface. If unspecified, the VPC's
- default security group is used.
- :attr SubnetIdentity subnet: The associated subnet.
+ :param datetime created_at: The date and time that the network ACL was created.
+ :param str crn: The CRN for this network ACL.
+ :param str href: The URL for this network ACL.
+ :param str id: The unique identifier for this network ACL.
+ :param str name: The name for this network ACL. The name is unique across all
+ network ACLs for the VPC.
+ :param ResourceGroupReference resource_group: The resource group for this
+ network ACL.
+ :param List[NetworkACLRuleItem] rules: The ordered rules for this network ACL.
+ If no rules exist, all traffic will be denied.
+ :param List[SubnetReference] subnets: The subnets to which this network ACL is
+ attached.
+ :param VPCReference vpc: The VPC this network ACL resides in.
"""
def __init__(
self,
- subnet: 'SubnetIdentity',
- *,
- allow_ip_spoofing: bool = None,
- name: str = None,
- primary_ip: 'NetworkInterfaceIPPrototype' = None,
- security_groups: List['SecurityGroupIdentity'] = 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 NetworkInterfacePrototype object.
+ Initialize a NetworkACL object.
- :param SubnetIdentity subnet: The associated subnet.
- :param bool allow_ip_spoofing: (optional) Indicates whether source IP
- spoofing is allowed on this instance network interface.
- :param str name: (optional) The name for the instance network interface.
- The name must not be used by another network interface on the virtual
- server instance. If unspecified, the name will be a hyphenated list of
- randomly-selected words.
- :param NetworkInterfaceIPPrototype primary_ip: (optional) The primary IP
- address to bind to the instance network interface. This can be
- specified using an existing reserved IP, or a prototype object for a new
- reserved IP.
- If an existing reserved IP or a prototype object with an address is
- specified, it must
- be available on the instance network interface's subnet. Otherwise, an
- available address on the subnet will be automatically selected and
- reserved.
- :param List[SecurityGroupIdentity] security_groups: (optional) The security
- groups to use for this instance network interface. If unspecified, the
- VPC's default security group is used.
+ :param datetime created_at: The date and time that the network ACL was
+ created.
+ :param str crn: The CRN for this network ACL.
+ :param str href: The URL for this network ACL.
+ :param str id: The unique identifier for this network ACL.
+ :param str name: The name for this network ACL. The name is unique across
+ all network ACLs for the VPC.
+ :param ResourceGroupReference resource_group: The resource group for this
+ network ACL.
+ :param List[NetworkACLRuleItem] rules: The ordered rules for this network
+ ACL. If no rules exist, all traffic will be denied.
+ :param List[SubnetReference] subnets: The subnets to which this network ACL
+ is attached.
+ :param VPCReference vpc: The VPC this network ACL resides in.
"""
- self.allow_ip_spoofing = allow_ip_spoofing
+ self.created_at = created_at
+ self.crn = crn
+ self.href = href
+ self.id = id
self.name = name
- self.primary_ip = primary_ip
- self.security_groups = security_groups
- self.subnet = subnet
+ self.resource_group = resource_group
+ self.rules = rules
+ self.subnets = subnets
+ self.vpc = vpc
@classmethod
- def from_dict(cls, _dict: Dict) -> 'NetworkInterfacePrototype':
- """Initialize a NetworkInterfacePrototype object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'NetworkACL':
+ """Initialize a NetworkACL object from a json dictionary."""
args = {}
- if 'allow_ip_spoofing' in _dict:
- args['allow_ip_spoofing'] = _dict.get('allow_ip_spoofing')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
- if 'primary_ip' in _dict:
- args['primary_ip'] = _dict.get('primary_ip')
- if 'security_groups' in _dict:
- args['security_groups'] = _dict.get('security_groups')
- if 'subnet' in _dict:
- args['subnet'] = _dict.get('subnet')
+ if (created_at := _dict.get('created_at')) is not None:
+ args['created_at'] = string_to_datetime(created_at)
else:
- raise ValueError('Required property \'subnet\' not present in NetworkInterfacePrototype JSON')
+ raise ValueError('Required property \'created_at\' not present in NetworkACL JSON')
+ if (crn := _dict.get('crn')) is not None:
+ args['crn'] = crn
+ else:
+ raise ValueError('Required property \'crn\' not present in NetworkACL JSON')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
+ else:
+ raise ValueError('Required property \'href\' not present in NetworkACL JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
+ else:
+ raise ValueError('Required property \'id\' not present in NetworkACL JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ else:
+ raise ValueError('Required property \'name\' not present in NetworkACL JSON')
+ if (resource_group := _dict.get('resource_group')) is not None:
+ args['resource_group'] = ResourceGroupReference.from_dict(resource_group)
+ else:
+ raise ValueError('Required property \'resource_group\' not present in NetworkACL JSON')
+ if (rules := _dict.get('rules')) is not None:
+ args['rules'] = [NetworkACLRuleItem.from_dict(v) for v in rules]
+ else:
+ raise ValueError('Required property \'rules\' not present in NetworkACL JSON')
+ if (subnets := _dict.get('subnets')) is not None:
+ args['subnets'] = [SubnetReference.from_dict(v) for v in subnets]
+ else:
+ raise ValueError('Required property \'subnets\' not present in NetworkACL JSON')
+ if (vpc := _dict.get('vpc')) is not None:
+ args['vpc'] = VPCReference.from_dict(vpc)
+ else:
+ raise ValueError('Required property \'vpc\' not present in NetworkACL JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a NetworkInterfacePrototype 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, '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, 'href') and self.href is not None:
+ _dict['href'] = self.href
+ if hasattr(self, 'id') and self.id is not None:
+ _dict['id'] = self.id
if hasattr(self, 'name') and self.name is not None:
_dict['name'] = self.name
- if hasattr(self, 'primary_ip') and self.primary_ip is not None:
- if isinstance(self.primary_ip, dict):
- _dict['primary_ip'] = self.primary_ip
+ if hasattr(self, 'resource_group') and self.resource_group is not None:
+ if isinstance(self.resource_group, dict):
+ _dict['resource_group'] = self.resource_group
else:
- _dict['primary_ip'] = self.primary_ip.to_dict()
- if hasattr(self, 'security_groups') and self.security_groups is not None:
- security_groups_list = []
- for v in self.security_groups:
+ _dict['resource_group'] = self.resource_group.to_dict()
+ if hasattr(self, 'rules') and self.rules is not None:
+ rules_list = []
+ for v in self.rules:
if isinstance(v, dict):
- security_groups_list.append(v)
+ rules_list.append(v)
else:
- security_groups_list.append(v.to_dict())
- _dict['security_groups'] = security_groups_list
- if hasattr(self, 'subnet') and self.subnet is not None:
- if isinstance(self.subnet, dict):
- _dict['subnet'] = self.subnet
+ rules_list.append(v.to_dict())
+ _dict['rules'] = rules_list
+ if hasattr(self, 'subnets') and self.subnets is not None:
+ subnets_list = []
+ for v in self.subnets:
+ if isinstance(v, dict):
+ subnets_list.append(v)
+ else:
+ subnets_list.append(v.to_dict())
+ _dict['subnets'] = subnets_list
+ if hasattr(self, 'vpc') and self.vpc is not None:
+ if isinstance(self.vpc, dict):
+ _dict['vpc'] = self.vpc
else:
- _dict['subnet'] = self.subnet.to_dict()
+ _dict['vpc'] = self.vpc.to_dict()
return _dict
def _to_dict(self):
@@ -61372,119 +64183,175 @@ 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 NetworkACL object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'NetworkInterfacePrototype') -> 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: 'NetworkInterfacePrototype') -> bool:
+ def __ne__(self, other: 'NetworkACL') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class NetworkInterfaceReferenceDeleted:
+class NetworkACLCollection:
"""
- If present, this property indicates the referenced resource has been deleted, and
- provides some supplementary information.
+ NetworkACLCollection.
- :attr str more_info: Link to documentation about deleted resources.
+ :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 NetworkACLCollectionNext next: (optional) A link to the next page of
+ resources. This property is present for all pages
+ except the last page.
+ :param int total_count: The total number of resources across all pages.
"""
def __init__(
self,
- more_info: str,
+ first: 'NetworkACLCollectionFirst',
+ limit: int,
+ network_acls: List['NetworkACL'],
+ total_count: int,
+ *,
+ next: Optional['NetworkACLCollectionNext'] = None,
) -> None:
"""
- Initialize a NetworkInterfaceReferenceDeleted object.
+ Initialize a NetworkACLCollection object.
- :param str more_info: Link to documentation about deleted resources.
+ :param NetworkACLCollectionFirst first: A link to the first page of
+ resources.
+ :param int limit: The maximum number of resources that can be returned by
+ the request.
+ :param List[NetworkACL] network_acls: Collection of network ACLs.
+ :param int total_count: The total number of resources across all pages.
+ :param NetworkACLCollectionNext next: (optional) A link to the next page of
+ resources. This property is present for all pages
+ except the last page.
"""
- self.more_info = more_info
+ self.first = first
+ self.limit = limit
+ self.network_acls = network_acls
+ self.next = next
+ self.total_count = total_count
@classmethod
- def from_dict(cls, _dict: Dict) -> 'NetworkInterfaceReferenceDeleted':
- """Initialize a NetworkInterfaceReferenceDeleted object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'NetworkACLCollection':
+ """Initialize a NetworkACLCollection object from a json dictionary."""
args = {}
- if 'more_info' in _dict:
- args['more_info'] = _dict.get('more_info')
+ if (first := _dict.get('first')) is not None:
+ args['first'] = NetworkACLCollectionFirst.from_dict(first)
else:
- raise ValueError('Required property \'more_info\' not present in NetworkInterfaceReferenceDeleted JSON')
+ raise ValueError('Required property \'first\' not present in NetworkACLCollection JSON')
+ if (limit := _dict.get('limit')) is not None:
+ args['limit'] = limit
+ else:
+ raise ValueError('Required property \'limit\' not present in NetworkACLCollection JSON')
+ if (network_acls := _dict.get('network_acls')) is not None:
+ args['network_acls'] = [NetworkACL.from_dict(v) for v in network_acls]
+ else:
+ raise ValueError('Required property \'network_acls\' not present in NetworkACLCollection JSON')
+ if (next := _dict.get('next')) is not None:
+ args['next'] = NetworkACLCollectionNext.from_dict(next)
+ if (total_count := _dict.get('total_count')) is not None:
+ args['total_count'] = 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 NetworkInterfaceReferenceDeleted object from a json dictionary."""
+ """Initialize a NetworkACLCollection object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'more_info') and self.more_info is not None:
- _dict['more_info'] = self.more_info
- return _dict
-
- def _to_dict(self):
+ if hasattr(self, 'first') and self.first is not None:
+ if isinstance(self.first, dict):
+ _dict['first'] = self.first
+ else:
+ _dict['first'] = self.first.to_dict()
+ if hasattr(self, 'limit') and self.limit is not None:
+ _dict['limit'] = self.limit
+ if hasattr(self, 'network_acls') and self.network_acls is not None:
+ network_acls_list = []
+ for v in self.network_acls:
+ if isinstance(v, dict):
+ network_acls_list.append(v)
+ else:
+ network_acls_list.append(v.to_dict())
+ _dict['network_acls'] = network_acls_list
+ if hasattr(self, 'next') and self.next is not None:
+ if isinstance(self.next, dict):
+ _dict['next'] = self.next
+ else:
+ _dict['next'] = self.next.to_dict()
+ if hasattr(self, 'total_count') and self.total_count is not None:
+ _dict['total_count'] = self.total_count
+ return _dict
+
+ def _to_dict(self):
"""Return a json dictionary representing this model."""
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this NetworkInterfaceReferenceDeleted object."""
+ """Return a `str` version of this NetworkACLCollection object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'NetworkInterfaceReferenceDeleted') -> 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: 'NetworkInterfaceReferenceDeleted') -> bool:
+ def __ne__(self, other: 'NetworkACLCollection') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class NetworkInterfaceReferenceTargetContextDeleted:
+class NetworkACLCollectionFirst:
"""
- 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.
+ :param str href: The URL for a page of resources.
"""
def __init__(
self,
- more_info: str,
+ href: str,
) -> None:
"""
- Initialize a NetworkInterfaceReferenceTargetContextDeleted object.
+ Initialize a NetworkACLCollectionFirst object.
- :param str more_info: Link to documentation about deleted resources.
+ :param str href: The URL for a page of resources.
"""
- self.more_info = more_info
+ self.href = href
@classmethod
- def from_dict(cls, _dict: Dict) -> 'NetworkInterfaceReferenceTargetContextDeleted':
- """Initialize a NetworkInterfaceReferenceTargetContextDeleted object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'NetworkACLCollectionFirst':
+ """Initialize a NetworkACLCollectionFirst object from a json dictionary."""
args = {}
- if 'more_info' in _dict:
- args['more_info'] = _dict.get('more_info')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'more_info\' not present in NetworkInterfaceReferenceTargetContextDeleted JSON')
+ raise ValueError('Required property \'href\' not present in NetworkACLCollectionFirst JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a NetworkInterfaceReferenceTargetContextDeleted 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, '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):
@@ -61492,66 +64359,59 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this NetworkInterfaceReferenceTargetContextDeleted object."""
+ """Return a `str` version of this NetworkACLCollectionFirst object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'NetworkInterfaceReferenceTargetContextDeleted') -> 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: 'NetworkInterfaceReferenceTargetContextDeleted') -> bool:
+ def __ne__(self, other: 'NetworkACLCollectionFirst') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class NetworkInterfaceUnpaginatedCollection:
+class NetworkACLCollectionNext:
"""
- NetworkInterfaceUnpaginatedCollection.
+ A link to the next page of resources. This property is present for all pages except
+ the last page.
- :attr List[NetworkInterface] network_interfaces: Collection of instance network
- interfaces.
+ :param str href: The URL for a page of resources.
"""
def __init__(
self,
- network_interfaces: List['NetworkInterface'],
+ href: str,
) -> None:
"""
- Initialize a NetworkInterfaceUnpaginatedCollection object.
+ Initialize a NetworkACLCollectionNext object.
- :param List[NetworkInterface] network_interfaces: Collection of instance
- network interfaces.
+ :param str href: The URL for a page of resources.
"""
- self.network_interfaces = network_interfaces
+ self.href = href
@classmethod
- def from_dict(cls, _dict: Dict) -> 'NetworkInterfaceUnpaginatedCollection':
- """Initialize a NetworkInterfaceUnpaginatedCollection object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'NetworkACLCollectionNext':
+ """Initialize a NetworkACLCollectionNext object from a json dictionary."""
args = {}
- if 'network_interfaces' in _dict:
- args['network_interfaces'] = [NetworkInterface.from_dict(v) for v in _dict.get('network_interfaces')]
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'network_interfaces\' not present in NetworkInterfaceUnpaginatedCollection JSON')
+ raise ValueError('Required property \'href\' not present in NetworkACLCollectionNext JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a NetworkInterfaceUnpaginatedCollection 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, 'network_interfaces') and self.network_interfaces is not None:
- network_interfaces_list = []
- for v in self.network_interfaces:
- if isinstance(v, dict):
- network_interfaces_list.append(v)
- else:
- network_interfaces_list.append(v.to_dict())
- _dict['network_interfaces'] = network_interfaces_list
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
return _dict
def _to_dict(self):
@@ -61559,132 +64419,78 @@ 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 NetworkACLCollectionNext object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'NetworkInterfaceUnpaginatedCollection') -> 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: 'NetworkInterfaceUnpaginatedCollection') -> bool:
+ def __ne__(self, other: 'NetworkACLCollectionNext') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class OperatingSystem:
+class NetworkACLIdentity:
"""
- OperatingSystem.
+ Identifies a network ACL by a unique property.
- :attr str architecture: The operating system architecture.
- :attr bool dedicated_host_only: Images with this operating system can only be
- used on dedicated hosts or dedicated host groups.
- :attr str display_name: A unique, display-friendly name for the operating
- system.
- :attr str family: The software family for this operating system.
- :attr str href: The URL for this operating system.
- :attr str name: The globally unique name for this operating system.
- :attr str vendor: The vendor of the operating system.
- :attr str version: The major release version of this operating system.
"""
def __init__(
self,
- architecture: str,
- dedicated_host_only: bool,
- display_name: str,
- family: str,
- href: str,
- name: str,
- vendor: str,
- version: str,
) -> None:
"""
- Initialize a OperatingSystem object.
+ Initialize a NetworkACLIdentity object.
- :param str architecture: The operating system architecture.
- :param bool dedicated_host_only: Images with this operating system can only
- be used on dedicated hosts or dedicated host groups.
- :param str display_name: A unique, display-friendly name for the operating
- system.
- :param str family: The software family for this operating system.
- :param str href: The URL for this operating system.
- :param str name: The globally unique name for this operating system.
- :param str vendor: The vendor of the operating system.
- :param str version: The major release version of this operating system.
"""
- self.architecture = architecture
- self.dedicated_host_only = dedicated_host_only
- self.display_name = display_name
- self.family = family
- self.href = href
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['NetworkACLIdentityById', 'NetworkACLIdentityByCRN', 'NetworkACLIdentityByHref'])
+ )
+ raise Exception(msg)
+
+
+class NetworkACLPatch:
+ """
+ NetworkACLPatch.
+
+ :param str name: (optional) The name for this network ACL. The name must not be
+ used by another network ACL for the VPC.
+ """
+
+ def __init__(
+ self,
+ *,
+ name: Optional[str] = None,
+ ) -> None:
+ """
+ Initialize a NetworkACLPatch object.
+
+ :param str name: (optional) The name for this network ACL. The name must
+ not be used by another network ACL for the VPC.
+ """
self.name = name
- self.vendor = vendor
- self.version = version
@classmethod
- def from_dict(cls, _dict: Dict) -> 'OperatingSystem':
- """Initialize a OperatingSystem object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'NetworkACLPatch':
+ """Initialize a NetworkACLPatch object from a json dictionary."""
args = {}
- if 'architecture' in _dict:
- args['architecture'] = _dict.get('architecture')
- else:
- raise ValueError('Required property \'architecture\' not present in OperatingSystem JSON')
- if 'dedicated_host_only' in _dict:
- args['dedicated_host_only'] = _dict.get('dedicated_host_only')
- else:
- raise ValueError('Required property \'dedicated_host_only\' not present in OperatingSystem JSON')
- if 'display_name' in _dict:
- args['display_name'] = _dict.get('display_name')
- else:
- raise ValueError('Required property \'display_name\' not present in OperatingSystem JSON')
- if 'family' in _dict:
- args['family'] = _dict.get('family')
- else:
- raise ValueError('Required property \'family\' not present in OperatingSystem JSON')
- if 'href' in _dict:
- args['href'] = _dict.get('href')
- else:
- raise ValueError('Required property \'href\' not present in OperatingSystem JSON')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
- else:
- raise ValueError('Required property \'name\' not present in OperatingSystem JSON')
- if 'vendor' in _dict:
- args['vendor'] = _dict.get('vendor')
- else:
- raise ValueError('Required property \'vendor\' not present in OperatingSystem JSON')
- if 'version' in _dict:
- args['version'] = _dict.get('version')
- else:
- raise ValueError('Required property \'version\' not present in OperatingSystem JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a OperatingSystem 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, '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):
@@ -61692,118 +64498,145 @@ 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 NetworkACLPatch object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'OperatingSystem') -> 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: 'OperatingSystem') -> bool:
+ def __ne__(self, other: 'NetworkACLPatch') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class OperatingSystemCollection:
+class NetworkACLPrototype:
"""
- OperatingSystemCollection.
+ NetworkACLPrototype.
- :attr OperatingSystemCollectionFirst first: A link to the first page of
- resources.
- :attr int limit: The maximum number of resources that can be returned by the
- request.
- :attr OperatingSystemCollectionNext next: (optional) A link to the next page of
- resources. This property is present for all pages
- except the last page.
- :attr List[OperatingSystem] operating_systems: Collection of operating systems.
- :attr int total_count: The total number of resources across all pages.
+ :param str name: (optional) The name for this network ACL. The name must not be
+ used by another network ACL for the VPC. If unspecified, the name will be a
+ hyphenated list of randomly-selected words.
+ :param ResourceGroupIdentity resource_group: (optional) The resource group to
+ use. If unspecified, the account's [default resource
+ group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be
+ used.
+ :param VPCIdentity vpc: The VPC this network ACL will reside in.
"""
def __init__(
self,
- first: 'OperatingSystemCollectionFirst',
- limit: int,
- operating_systems: List['OperatingSystem'],
- total_count: int,
+ vpc: 'VPCIdentity',
*,
- next: 'OperatingSystemCollectionNext' = None,
+ name: Optional[str] = None,
+ resource_group: Optional['ResourceGroupIdentity'] = None,
) -> None:
"""
- Initialize a OperatingSystemCollection object.
+ Initialize a NetworkACLPrototype object.
- :param OperatingSystemCollectionFirst first: A link to the first page of
- resources.
- :param int limit: The maximum number of resources that can be returned by
- the request.
- :param List[OperatingSystem] operating_systems: Collection of operating
- systems.
- :param int total_count: The total number of resources across all pages.
- :param OperatingSystemCollectionNext next: (optional) A link to the next
- page of resources. This property is present for all pages
- except the last page.
+ :param VPCIdentity vpc: The VPC this network ACL will reside in.
+ :param str name: (optional) The name for this network ACL. The name must
+ not be used by another network ACL for the VPC. If unspecified, the name
+ will be a hyphenated list of randomly-selected words.
+ :param ResourceGroupIdentity resource_group: (optional) The resource group
+ to use. If unspecified, the account's [default resource
+ group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be
+ used.
"""
- self.first = first
- self.limit = limit
- self.next = next
- self.operating_systems = operating_systems
- self.total_count = total_count
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['NetworkACLPrototypeNetworkACLByRules', 'NetworkACLPrototypeNetworkACLBySourceNetworkACL'])
+ )
+ raise Exception(msg)
+
+
+class NetworkACLReference:
+ """
+ NetworkACLReference.
+
+ :param str crn: The CRN 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 href: The URL for this network ACL.
+ :param str id: The unique identifier for this network ACL.
+ :param str name: The name for this network ACL. The name is unique across all
+ network ACLs for the VPC.
+ """
+
+ def __init__(
+ self,
+ crn: str,
+ href: str,
+ id: str,
+ name: str,
+ *,
+ deleted: Optional['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 name for this network ACL. The name is unique across
+ all network ACLs for the VPC.
+ :param NetworkACLReferenceDeleted deleted: (optional) If present, this
+ property indicates the referenced resource has been deleted, and provides
+ some supplementary information.
+ """
+ self.crn = crn
+ self.deleted = deleted
+ self.href = href
+ self.id = id
+ self.name = name
@classmethod
- def from_dict(cls, _dict: Dict) -> 'OperatingSystemCollection':
- """Initialize a OperatingSystemCollection object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'NetworkACLReference':
+ """Initialize a NetworkACLReference object from a json dictionary."""
args = {}
- if 'first' in _dict:
- args['first'] = OperatingSystemCollectionFirst.from_dict(_dict.get('first'))
+ if (crn := _dict.get('crn')) is not None:
+ args['crn'] = crn
else:
- raise ValueError('Required property \'first\' not present in OperatingSystemCollection JSON')
- if 'limit' in _dict:
- args['limit'] = _dict.get('limit')
+ raise ValueError('Required property \'crn\' not present in NetworkACLReference JSON')
+ if (deleted := _dict.get('deleted')) is not None:
+ args['deleted'] = NetworkACLReferenceDeleted.from_dict(deleted)
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'limit\' not present in OperatingSystemCollection JSON')
- if 'next' in _dict:
- args['next'] = OperatingSystemCollectionNext.from_dict(_dict.get('next'))
- if 'operating_systems' in _dict:
- args['operating_systems'] = [OperatingSystem.from_dict(v) for v in _dict.get('operating_systems')]
+ raise ValueError('Required property \'href\' not present in NetworkACLReference JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
else:
- raise ValueError('Required property \'operating_systems\' not present in OperatingSystemCollection JSON')
- if 'total_count' in _dict:
- args['total_count'] = _dict.get('total_count')
+ raise ValueError('Required property \'id\' not present in NetworkACLReference JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
else:
- raise ValueError('Required property \'total_count\' not present in OperatingSystemCollection JSON')
+ raise ValueError('Required property \'name\' not present in NetworkACLReference JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a OperatingSystemCollection 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, 'first') and self.first is not None:
- if isinstance(self.first, dict):
- _dict['first'] = self.first
- else:
- _dict['first'] = self.first.to_dict()
- if hasattr(self, 'limit') and self.limit is not None:
- _dict['limit'] = self.limit
- if hasattr(self, 'next') and self.next is not None:
- if isinstance(self.next, dict):
- _dict['next'] = self.next
+ if hasattr(self, 'crn') and self.crn is not None:
+ _dict['crn'] = self.crn
+ if hasattr(self, 'deleted') and self.deleted is not None:
+ if isinstance(self.deleted, dict):
+ _dict['deleted'] = self.deleted
else:
- _dict['next'] = self.next.to_dict()
- if hasattr(self, 'operating_systems') and self.operating_systems is not None:
- operating_systems_list = []
- for v in self.operating_systems:
- if isinstance(v, dict):
- operating_systems_list.append(v)
- else:
- operating_systems_list.append(v.to_dict())
- _dict['operating_systems'] = operating_systems_list
- if hasattr(self, 'total_count') and self.total_count is not None:
- _dict['total_count'] = self.total_count
+ _dict['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):
@@ -61811,58 +64644,59 @@ 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 NetworkACLReference object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'OperatingSystemCollection') -> 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: 'OperatingSystemCollection') -> bool:
+ def __ne__(self, other: 'NetworkACLReference') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class OperatingSystemCollectionFirst:
+class NetworkACLReferenceDeleted:
"""
- 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.
+ :param str more_info: Link to documentation about deleted resources.
"""
def __init__(
self,
- href: str,
+ more_info: str,
) -> None:
"""
- Initialize a OperatingSystemCollectionFirst object.
+ Initialize a NetworkACLReferenceDeleted 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) -> 'OperatingSystemCollectionFirst':
- """Initialize a OperatingSystemCollectionFirst object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'NetworkACLReferenceDeleted':
+ """Initialize a NetworkACLReferenceDeleted object from a json dictionary."""
args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ if (more_info := _dict.get('more_info')) is not None:
+ args['more_info'] = more_info
else:
- raise ValueError('Required property \'href\' not present in OperatingSystemCollectionFirst JSON')
+ raise ValueError('Required property \'more_info\' not present in NetworkACLReferenceDeleted JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a OperatingSystemCollectionFirst 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, '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):
@@ -61870,83 +64704,157 @@ 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 NetworkACLReferenceDeleted object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'OperatingSystemCollectionFirst') -> 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: 'OperatingSystemCollectionFirst') -> bool:
+ def __ne__(self, other: 'NetworkACLReferenceDeleted') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class OperatingSystemCollectionNext:
+class NetworkACLRule:
"""
- A link to the next page of resources. This property is present for all pages except
- the last page.
+ NetworkACLRule.
- :attr str href: The URL for a page of resources.
+ :param str action: The action to perform for a packet matching the rule.
+ :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 rule was created.
+ :param str destination: The destination IP address or CIDR block to match. The
+ CIDR block `0.0.0.0/0` matches all destination addresses.
+ :param str direction: The direction of traffic to match.
+ :param str href: The URL for this network ACL rule.
+ :param str id: The unique identifier for this network ACL rule.
+ :param str ip_version: The IP version for this rule.
+ :param str name: The name for this network ACL rule. The name is unique across
+ all rules for the network ACL.
+ :param str protocol: The protocol to enforce.
+ :param str source: The source IP address or CIDR block to match. The CIDR block
+ `0.0.0.0/0` matches all source addresses.
"""
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: Optional['NetworkACLRuleReference'] = None,
) -> None:
"""
- Initialize a OperatingSystemCollectionNext object.
+ Initialize a NetworkACLRule object.
- :param str href: The URL for a page of resources.
+ :param str action: The action to perform for a packet matching the rule.
+ :param datetime created_at: The date and time that the rule was created.
+ :param str destination: The destination IP address or CIDR block to match.
+ The CIDR block `0.0.0.0/0` matches all destination addresses.
+ :param str direction: The direction of traffic to match.
+ :param str href: The URL for this network ACL rule.
+ :param str id: The unique identifier for this network ACL rule.
+ :param str ip_version: The IP version for this rule.
+ :param str name: The name for this network ACL rule. The name is unique
+ across all rules for the network ACL.
+ :param str protocol: The protocol to enforce.
+ :param str source: The source IP address or CIDR block to match. The CIDR
+ block `0.0.0.0/0` matches all source addresses.
+ :param NetworkACLRuleReference before: (optional) The rule that this rule
+ is immediately before. If absent, this is the last rule.
"""
- self.href = href
+ 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) -> 'OperatingSystemCollectionNext':
- """Initialize a OperatingSystemCollectionNext 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')
- 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 OperatingSystemCollectionNext 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, 'href') and self.href is not None:
- _dict['href'] = self.href
- return _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):
- """Return a json dictionary representing this model."""
- return self.to_dict()
+ class ActionEnum(str, Enum):
+ """
+ The action to perform for a packet matching the rule.
+ """
- def __str__(self) -> str:
- """Return a `str` version of this OperatingSystemCollectionNext object."""
- return json.dumps(self.to_dict(), indent=2)
+ ALLOW = 'allow'
+ DENY = 'deny'
- 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: 'OperatingSystemCollectionNext') -> bool:
- """Return `true` when self and other are not equal, false otherwise."""
- return not self == other
+ class DirectionEnum(str, Enum):
+ """
+ The direction of traffic to match.
+ """
+
+ INBOUND = 'inbound'
+ OUTBOUND = 'outbound'
-class OperatingSystemIdentity:
+ class IpVersionEnum(str, Enum):
+ """
+ The IP version for this rule.
+ """
+
+ IPV4 = 'ipv4'
+
+
+ class ProtocolEnum(str, Enum):
+ """
+ The protocol to enforce.
+ """
+
+ ALL = 'all'
+ ICMP = 'icmp'
+ TCP = 'tcp'
+ UDP = 'udp'
+
+
+
+class NetworkACLRuleBeforePatch:
"""
- Identifies an operating system by a unique property.
+ The rule to move this rule immediately before.
+ Specify `null` to move this rule after all existing rules.
"""
@@ -61954,283 +64862,106 @@ def __init__(
self,
) -> None:
"""
- Initialize a OperatingSystemIdentity object.
+ Initialize a NetworkACLRuleBeforePatch object.
"""
msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['OperatingSystemIdentityByName', 'OperatingSystemIdentityByHref'])
+ ", ".join(['NetworkACLRuleBeforePatchNetworkACLRuleIdentityById', 'NetworkACLRuleBeforePatchNetworkACLRuleIdentityByHref'])
)
raise Exception(msg)
-class PlacementGroup:
+class NetworkACLRuleBeforePrototype:
"""
- PlacementGroup.
+ The rule to insert this rule immediately before.
+ If unspecified, this rule will be inserted after all existing rules.
- :attr datetime created_at: The date and time that the placement group was
- created.
- :attr str crn: The CRN for this placement group.
- :attr str href: The URL for this placement group.
- :attr str id: The unique identifier for this placement group.
- :attr str lifecycle_state: The lifecycle state of the placement group.
- :attr str name: The name for this placement group. The name is unique across all
- placement groups in the region.
- :attr ResourceGroupReference resource_group: The resource group for this
- placement group.
- :attr str resource_type: The resource type.
- :attr str strategy: The strategy for this placement group
- - `host_spread`: place on different compute hosts
- - `power_spread`: place on compute hosts that use different power sources
- The enumerated values for this property may expand in the future. When
- processing this property, check for and log unknown values. Optionally halt
- processing and surface the error, or bypass the placement group on which the
- unexpected strategy was encountered.
"""
def __init__(
self,
- created_at: datetime,
- crn: str,
- href: str,
- id: str,
- lifecycle_state: str,
- name: str,
- resource_group: 'ResourceGroupReference',
- resource_type: str,
- strategy: str,
) -> None:
"""
- Initialize a PlacementGroup object.
-
- :param datetime created_at: The date and time that the placement group was
- created.
- :param str crn: The CRN for this placement group.
- :param str href: The URL for this placement group.
- :param str id: The unique identifier for this placement group.
- :param str lifecycle_state: The lifecycle state of the placement group.
- :param str name: The name for this placement group. The name is unique
- across all placement groups in the region.
- :param ResourceGroupReference resource_group: The resource group for this
- placement group.
- :param str resource_type: The resource type.
- :param str strategy: The strategy for this placement group
- - `host_spread`: place on different compute hosts
- - `power_spread`: place on compute hosts that use different power sources
- The enumerated values for this property may expand in the future. When
- processing this property, check for and log unknown values. Optionally halt
- processing and surface the error, or bypass the placement group on which
- the unexpected strategy was encountered.
- """
- self.created_at = created_at
- self.crn = crn
- self.href = href
- self.id = id
- self.lifecycle_state = lifecycle_state
- self.name = name
- self.resource_group = resource_group
- self.resource_type = resource_type
- self.strategy = strategy
-
- @classmethod
- def from_dict(cls, _dict: Dict) -> '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 PlacementGroup JSON')
- if 'crn' in _dict:
- args['crn'] = _dict.get('crn')
- else:
- raise ValueError('Required property \'crn\' not present in PlacementGroup JSON')
- if 'href' in _dict:
- args['href'] = _dict.get('href')
- else:
- raise ValueError('Required property \'href\' not present in PlacementGroup JSON')
- if 'id' in _dict:
- args['id'] = _dict.get('id')
- else:
- raise ValueError('Required property \'id\' not present in PlacementGroup JSON')
- if 'lifecycle_state' in _dict:
- args['lifecycle_state'] = _dict.get('lifecycle_state')
- else:
- raise ValueError('Required property \'lifecycle_state\' not present in PlacementGroup JSON')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
- else:
- raise ValueError('Required property \'name\' not present in PlacementGroup JSON')
- if 'resource_group' in _dict:
- args['resource_group'] = ResourceGroupReference.from_dict(_dict.get('resource_group'))
- else:
- raise ValueError('Required property \'resource_group\' not present in PlacementGroup JSON')
- if 'resource_type' in _dict:
- args['resource_type'] = _dict.get('resource_type')
- else:
- raise ValueError('Required property \'resource_type\' not present in PlacementGroup JSON')
- if 'strategy' in _dict:
- args['strategy'] = _dict.get('strategy')
- else:
- raise ValueError('Required property \'strategy\' not present in PlacementGroup JSON')
- return cls(**args)
-
- @classmethod
- def _from_dict(cls, _dict):
- """Initialize a PlacementGroup object from a json dictionary."""
- return cls.from_dict(_dict)
-
- def to_dict(self) -> Dict:
- """Return a json dictionary representing this model."""
- _dict = {}
- if hasattr(self, 'created_at') and self.created_at is not None:
- _dict['created_at'] = datetime_to_string(self.created_at)
- if hasattr(self, 'crn') and self.crn is not None:
- _dict['crn'] = self.crn
- if hasattr(self, 'href') and self.href is not None:
- _dict['href'] = self.href
- if hasattr(self, 'id') and self.id is not None:
- _dict['id'] = self.id
- if hasattr(self, 'lifecycle_state') and self.lifecycle_state is not None:
- _dict['lifecycle_state'] = self.lifecycle_state
- if hasattr(self, 'name') and self.name is not None:
- _dict['name'] = self.name
- if hasattr(self, 'resource_group') and self.resource_group is not None:
- if isinstance(self.resource_group, dict):
- _dict['resource_group'] = self.resource_group
- else:
- _dict['resource_group'] = self.resource_group.to_dict()
- if hasattr(self, 'resource_type') and self.resource_type is not None:
- _dict['resource_type'] = self.resource_type
- if hasattr(self, 'strategy') and self.strategy is not None:
- _dict['strategy'] = self.strategy
- return _dict
-
- def _to_dict(self):
- """Return a json dictionary representing this model."""
- return self.to_dict()
-
- def __str__(self) -> str:
- """Return a `str` version of this PlacementGroup object."""
- return json.dumps(self.to_dict(), indent=2)
-
- 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: 'PlacementGroup') -> 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.
- """
-
- 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'
-
+ Initialize a NetworkACLRuleBeforePrototype object.
- 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'
-
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityById', 'NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByHref'])
+ )
+ raise Exception(msg)
-class PlacementGroupCollection:
+class NetworkACLRuleCollection:
"""
- PlacementGroupCollection.
+ NetworkACLRuleCollection.
- :attr PlacementGroupCollectionFirst first: A link to the first page of
+ :param NetworkACLRuleCollectionFirst first: A link to the first page of
resources.
- :attr int limit: The maximum number of resources that can be returned by the
+ :param 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
+ :param NetworkACLRuleCollectionNext 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.
+ :param List[NetworkACLRuleItem] rules: Ordered collection of network ACL rules.
+ :param int total_count: The total number of resources across all pages.
"""
def __init__(
self,
- first: 'PlacementGroupCollectionFirst',
+ first: 'NetworkACLRuleCollectionFirst',
limit: int,
- placement_groups: List['PlacementGroup'],
+ rules: List['NetworkACLRuleItem'],
total_count: int,
*,
- next: 'PlacementGroupCollectionNext' = None,
+ next: Optional['NetworkACLRuleCollectionNext'] = None,
) -> None:
"""
- Initialize a PlacementGroupCollection object.
+ Initialize a NetworkACLRuleCollection object.
- :param PlacementGroupCollectionFirst first: A link to the first page of
+ :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[PlacementGroup] placement_groups: Collection of placement
- groups.
+ :param List[NetworkACLRuleItem] rules: Ordered collection of network ACL
+ rules.
:param int total_count: The total number of resources across all pages.
- :param PlacementGroupCollectionNext next: (optional) A link to the next
+ :param NetworkACLRuleCollectionNext 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.rules = rules
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) -> 'NetworkACLRuleCollection':
+ """Initialize a NetworkACLRuleCollection object from a json dictionary."""
args = {}
- if 'first' in _dict:
- args['first'] = PlacementGroupCollectionFirst.from_dict(_dict.get('first'))
+ if (first := _dict.get('first')) is not None:
+ args['first'] = NetworkACLRuleCollectionFirst.from_dict(first)
else:
- raise ValueError('Required property \'first\' not present in PlacementGroupCollection JSON')
- if 'limit' in _dict:
- args['limit'] = _dict.get('limit')
+ raise ValueError('Required property \'first\' not present in NetworkACLRuleCollection JSON')
+ if (limit := _dict.get('limit')) is not None:
+ args['limit'] = limit
else:
- raise ValueError('Required property \'limit\' not present in PlacementGroupCollection JSON')
- if 'next' in _dict:
- args['next'] = PlacementGroupCollectionNext.from_dict(_dict.get('next'))
- if 'placement_groups' in _dict:
- args['placement_groups'] = [PlacementGroup.from_dict(v) for v in _dict.get('placement_groups')]
+ raise ValueError('Required property \'limit\' not present in NetworkACLRuleCollection JSON')
+ if (next := _dict.get('next')) is not None:
+ args['next'] = NetworkACLRuleCollectionNext.from_dict(next)
+ if (rules := _dict.get('rules')) is not None:
+ args['rules'] = [NetworkACLRuleItem.from_dict(v) for v in rules]
else:
- raise ValueError('Required property \'placement_groups\' not present in PlacementGroupCollection JSON')
- if 'total_count' in _dict:
- args['total_count'] = _dict.get('total_count')
+ raise ValueError('Required property \'rules\' not present in NetworkACLRuleCollection JSON')
+ if (total_count := _dict.get('total_count')) is not None:
+ args['total_count'] = total_count
else:
- raise ValueError('Required property \'total_count\' not present in PlacementGroupCollection JSON')
+ raise ValueError('Required property \'total_count\' not present in NetworkACLRuleCollection JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a PlacementGroupCollection object from a json dictionary."""
+ """Initialize a NetworkACLRuleCollection object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -62248,14 +64979,14 @@ def to_dict(self) -> Dict:
_dict['next'] = self.next
else:
_dict['next'] = self.next.to_dict()
- if hasattr(self, 'placement_groups') and self.placement_groups is not None:
- placement_groups_list = []
- for v in self.placement_groups:
+ if hasattr(self, 'rules') and self.rules is not None:
+ rules_list = []
+ for v in self.rules:
if isinstance(v, dict):
- placement_groups_list.append(v)
+ rules_list.append(v)
else:
- placement_groups_list.append(v.to_dict())
- _dict['placement_groups'] = placement_groups_list
+ rules_list.append(v.to_dict())
+ _dict['rules'] = rules_list
if hasattr(self, 'total_count') and self.total_count is not None:
_dict['total_count'] = self.total_count
return _dict
@@ -62265,25 +64996,25 @@ 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 NetworkACLRuleCollection object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'PlacementGroupCollection') -> 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: 'PlacementGroupCollection') -> bool:
+ def __ne__(self, other: 'NetworkACLRuleCollection') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class PlacementGroupCollectionFirst:
+class NetworkACLRuleCollectionFirst:
"""
A link to the first page of resources.
- :attr str href: The URL for a page of resources.
+ :param str href: The URL for a page of resources.
"""
def __init__(
@@ -62291,25 +65022,25 @@ def __init__(
href: str,
) -> None:
"""
- Initialize a PlacementGroupCollectionFirst object.
+ Initialize a NetworkACLRuleCollectionFirst 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) -> 'NetworkACLRuleCollectionFirst':
+ """Initialize a NetworkACLRuleCollectionFirst object from a json dictionary."""
args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'href\' not present in PlacementGroupCollectionFirst JSON')
+ raise ValueError('Required property \'href\' not present in NetworkACLRuleCollectionFirst JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a PlacementGroupCollectionFirst object from a json dictionary."""
+ """Initialize a NetworkACLRuleCollectionFirst object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -62324,26 +65055,26 @@ 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 NetworkACLRuleCollectionFirst object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'PlacementGroupCollectionFirst') -> 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: 'PlacementGroupCollectionFirst') -> bool:
+ def __ne__(self, other: 'NetworkACLRuleCollectionFirst') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class PlacementGroupCollectionNext:
+class NetworkACLRuleCollectionNext:
"""
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.
+ :param str href: The URL for a page of resources.
"""
def __init__(
@@ -62351,25 +65082,25 @@ def __init__(
href: str,
) -> None:
"""
- Initialize a PlacementGroupCollectionNext object.
+ Initialize a NetworkACLRuleCollectionNext 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) -> 'NetworkACLRuleCollectionNext':
+ """Initialize a NetworkACLRuleCollectionNext object from a json dictionary."""
args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'href\' not present in PlacementGroupCollectionNext JSON')
+ raise ValueError('Required property \'href\' not present in NetworkACLRuleCollectionNext JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a PlacementGroupCollectionNext object from a json dictionary."""
+ """Initialize a NetworkACLRuleCollectionNext object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -62384,119 +65115,318 @@ 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 NetworkACLRuleCollectionNext object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'PlacementGroupCollectionNext') -> 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: 'PlacementGroupCollectionNext') -> bool:
+ def __ne__(self, other: 'NetworkACLRuleCollectionNext') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class PlacementGroupPatch:
+class NetworkACLRuleItem:
"""
- PlacementGroupPatch.
+ NetworkACLRuleItem.
- :attr str name: (optional) The name for this placement group. The name must not
- be used by another placement group in the region.
+ :param str action: The action to perform for a packet matching the rule.
+ :param NetworkACLRuleReference before: (optional) The rule that this rule is
+ immediately before. In a rule collection, this always
+ refers to the next item in the collection. If absent, this is the last rule.
+ :param datetime created_at: The date and time that the rule was created.
+ :param str destination: The destination IP address or CIDR block to match. The
+ CIDR block `0.0.0.0/0` matches all destination addresses.
+ :param str direction: The direction of traffic to match.
+ :param str href: The URL for this network ACL rule.
+ :param str id: The unique identifier for this network ACL rule.
+ :param str ip_version: The IP version for this rule.
+ :param str name: The name for this network ACL rule. The name is unique across
+ all rules for the network ACL.
+ :param str protocol: The protocol to enforce.
+ :param str source: The source IP address or CIDR block to match. The CIDR block
+ `0.0.0.0/0` matches all source addresses.
"""
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,
*,
- name: str = None,
+ before: Optional['NetworkACLRuleReference'] = None,
) -> None:
"""
- Initialize a PlacementGroupPatch object.
+ Initialize a NetworkACLRuleItem object.
- :param str name: (optional) The name for this placement group. The name
- must not be used by another placement group in the region.
+ :param str action: The action to perform for a packet matching the rule.
+ :param datetime created_at: The date and time that the rule was created.
+ :param str destination: The destination IP address or CIDR block to match.
+ The CIDR block `0.0.0.0/0` matches all destination addresses.
+ :param str direction: The direction of traffic to match.
+ :param str href: The URL for this network ACL rule.
+ :param str id: The unique identifier for this network ACL rule.
+ :param str ip_version: The IP version for this rule.
+ :param str name: The name for this network ACL rule. The name is unique
+ across all rules for the network ACL.
+ :param str protocol: The protocol to enforce.
+ :param str source: The source IP address or CIDR block to match. The CIDR
+ block `0.0.0.0/0` matches all source addresses.
+ :param NetworkACLRuleReference before: (optional) The rule that this rule
+ is immediately before. In a rule collection, this always
+ refers to the next item in the collection. If absent, this is the last
+ rule.
"""
- self.name = name
+ 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) -> 'PlacementGroupPatch':
- """Initialize a PlacementGroupPatch object from a json dictionary."""
- args = {}
- if 'name' in _dict:
- args['name'] = _dict.get('name')
- return cls(**args)
+ def from_dict(cls, _dict: Dict) -> 'NetworkACLRuleItem':
+ """Initialize a NetworkACLRuleItem object from a json dictionary."""
+ disc_class = cls._get_class_by_discriminator(_dict)
+ if disc_class != cls:
+ return disc_class.from_dict(_dict)
+ msg = "Cannot convert dictionary into an instance of base class 'NetworkACLRuleItem'. The discriminator value should map to a valid subclass: {1}".format(
+ ", ".join(['NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP', 'NetworkACLRuleItemNetworkACLRuleProtocolICMP', 'NetworkACLRuleItemNetworkACLRuleProtocolAll'])
+ )
+ raise Exception(msg)
@classmethod
- def _from_dict(cls, _dict):
- """Initialize a PlacementGroupPatch object from a json dictionary."""
+ def _from_dict(cls, _dict: Dict):
+ """Initialize a NetworkACLRuleItem object from a json dictionary."""
return cls.from_dict(_dict)
- def to_dict(self) -> Dict:
- """Return a json dictionary representing this model."""
- _dict = {}
- if hasattr(self, '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'] = 'NetworkACLRuleItemNetworkACLRuleProtocolAll'
+ mapping['icmp'] = 'NetworkACLRuleItemNetworkACLRuleProtocolICMP'
+ mapping['tcp'] = 'NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP'
+ mapping['udp'] = 'NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP'
+ disc_value = _dict.get('protocol')
+ if disc_value is None:
+ raise ValueError('Discriminator property \'protocol\' not found in NetworkACLRuleItem JSON')
+ class_name = mapping.get(disc_value, disc_value)
+ try:
+ disc_class = getattr(sys.modules[__name__], class_name)
+ except AttributeError:
+ disc_class = cls
+ if isinstance(disc_class, object):
+ return disc_class
+ raise TypeError('%s is not a discriminator class' % class_name)
- def _to_dict(self):
- """Return a json dictionary representing this model."""
- return self.to_dict()
+ class ActionEnum(str, Enum):
+ """
+ The action to perform for a packet matching the rule.
+ """
- def __str__(self) -> str:
- """Return a `str` version of this PlacementGroupPatch object."""
- return json.dumps(self.to_dict(), indent=2)
+ ALLOW = 'allow'
+ DENY = 'deny'
- 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: 'PlacementGroupPatch') -> bool:
- """Return `true` when self and other are not equal, false otherwise."""
- return not self == other
+ class DirectionEnum(str, Enum):
+ """
+ The direction of traffic to match.
+ """
+ INBOUND = 'inbound'
+ OUTBOUND = 'outbound'
-class PlacementGroupReferenceDeleted:
+
+ class IpVersionEnum(str, Enum):
+ """
+ The IP version for this rule.
+ """
+
+ IPV4 = 'ipv4'
+
+
+ class ProtocolEnum(str, Enum):
+ """
+ The protocol to enforce.
+ """
+
+ ALL = 'all'
+ ICMP = 'icmp'
+ TCP = 'tcp'
+ UDP = 'udp'
+
+
+
+class NetworkACLRulePatch:
"""
- If present, this property indicates the referenced resource has been deleted, and
- provides some supplementary information.
+ NetworkACLRulePatch.
- :attr str more_info: Link to documentation about deleted resources.
+ :param str action: (optional) The action to perform for a packet matching the
+ rule.
+ :param NetworkACLRuleBeforePatch before: (optional) The rule to move this rule
+ immediately before.
+ Specify `null` to move this rule after all existing rules.
+ :param int code: (optional) The ICMP traffic code to match. If set, `type` must
+ also be set.
+ Specify `null` to remove an existing ICMP traffic code.
+ :param str destination: (optional) The destination IP address or CIDR block to
+ match. The CIDR block `0.0.0.0/0` matches all destination addresses.
+ :param int destination_port_max: (optional) The inclusive upper bound of TCP/UDP
+ destination port range.
+ :param int destination_port_min: (optional) The inclusive lower bound of TCP/UDP
+ destination port range.
+ :param str direction: (optional) The direction of traffic to match.
+ :param str name: (optional) The name for this network ACL rule. The name must
+ not be used by another rule for the network ACL.
+ :param str protocol: (optional) The protocol to enforce.
+ :param str source: (optional) The source IP address or CIDR block to match. The
+ CIDR block `0.0.0.0/0` matches all source addresses.
+ :param int source_port_max: (optional) The inclusive upper bound of TCP/UDP
+ source port range.
+ :param int source_port_min: (optional) The inclusive lower bound of TCP/UDP
+ source port range.
+ :param int type: (optional) The ICMP traffic type to match.
+ Specify `null` to remove an existing ICMP traffic type value.
"""
def __init__(
self,
- more_info: str,
+ *,
+ action: Optional[str] = None,
+ before: Optional['NetworkACLRuleBeforePatch'] = None,
+ code: Optional[int] = None,
+ destination: Optional[str] = None,
+ destination_port_max: Optional[int] = None,
+ destination_port_min: Optional[int] = None,
+ direction: Optional[str] = None,
+ name: Optional[str] = None,
+ protocol: Optional[str] = None,
+ source: Optional[str] = None,
+ source_port_max: Optional[int] = None,
+ source_port_min: Optional[int] = None,
+ type: Optional[int] = None,
) -> None:
"""
- Initialize a PlacementGroupReferenceDeleted object.
+ Initialize a NetworkACLRulePatch object.
- :param str more_info: Link to documentation about deleted resources.
+ :param str action: (optional) The action to perform for a packet matching
+ the rule.
+ :param NetworkACLRuleBeforePatch before: (optional) The rule to move this
+ rule immediately before.
+ Specify `null` to move this rule after all existing rules.
+ :param int code: (optional) The ICMP traffic code to match. If set, `type`
+ must also be set.
+ Specify `null` to remove an existing ICMP traffic code.
+ :param str destination: (optional) The destination IP address or CIDR block
+ to match. The CIDR block `0.0.0.0/0` matches all destination addresses.
+ :param int destination_port_max: (optional) The inclusive upper bound of
+ TCP/UDP destination port range.
+ :param int destination_port_min: (optional) The inclusive lower bound of
+ TCP/UDP destination port range.
+ :param str direction: (optional) The direction of traffic to match.
+ :param str name: (optional) The name for this network ACL rule. The name
+ must not be used by another rule for the network ACL.
+ :param str protocol: (optional) The protocol to enforce.
+ :param str source: (optional) The source IP address or CIDR block to match.
+ The CIDR block `0.0.0.0/0` matches all source addresses.
+ :param int source_port_max: (optional) The inclusive upper bound of TCP/UDP
+ source port range.
+ :param int source_port_min: (optional) The inclusive lower bound of TCP/UDP
+ source port range.
+ :param int type: (optional) The ICMP traffic type to match.
+ Specify `null` to remove an existing ICMP traffic type value.
"""
- self.more_info = more_info
+ self.action = action
+ self.before = before
+ self.code = code
+ self.destination = destination
+ self.destination_port_max = destination_port_max
+ self.destination_port_min = destination_port_min
+ self.direction = direction
+ self.name = name
+ self.protocol = protocol
+ self.source = source
+ self.source_port_max = source_port_max
+ self.source_port_min = source_port_min
+ self.type = type
@classmethod
- def from_dict(cls, _dict: Dict) -> 'PlacementGroupReferenceDeleted':
- """Initialize a PlacementGroupReferenceDeleted object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'NetworkACLRulePatch':
+ """Initialize a NetworkACLRulePatch 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')
+ if (action := _dict.get('action')) is not None:
+ args['action'] = action
+ if (before := _dict.get('before')) is not None:
+ args['before'] = before
+ if (code := _dict.get('code')) is not None:
+ args['code'] = code
+ if (destination := _dict.get('destination')) is not None:
+ args['destination'] = destination
+ if (destination_port_max := _dict.get('destination_port_max')) is not None:
+ args['destination_port_max'] = destination_port_max
+ if (destination_port_min := _dict.get('destination_port_min')) is not None:
+ args['destination_port_min'] = destination_port_min
+ if (direction := _dict.get('direction')) is not None:
+ args['direction'] = direction
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ if (protocol := _dict.get('protocol')) is not None:
+ args['protocol'] = protocol
+ if (source := _dict.get('source')) is not None:
+ args['source'] = source
+ if (source_port_max := _dict.get('source_port_max')) is not None:
+ args['source_port_max'] = source_port_max
+ if (source_port_min := _dict.get('source_port_min')) is not None:
+ args['source_port_min'] = source_port_min
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a PlacementGroupReferenceDeleted 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, '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, '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, 'protocol') and self.protocol is not None:
+ _dict['protocol'] = self.protocol
+ if hasattr(self, 'source') and self.source is not None:
+ _dict['source'] = self.source
+ if hasattr(self, 'source_port_max') and self.source_port_max is not None:
+ _dict['source_port_max'] = self.source_port_max
+ if hasattr(self, 'source_port_min') and self.source_port_min is not None:
+ _dict['source_port_min'] = self.source_port_min
+ if hasattr(self, 'type') and self.type is not None:
+ _dict['type'] = self.type
return _dict
def _to_dict(self):
@@ -62504,373 +65434,374 @@ 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 NetworkACLRulePatch object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'PlacementGroupReferenceDeleted') -> 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: 'PlacementGroupReferenceDeleted') -> bool:
+ def __ne__(self, other: 'NetworkACLRulePatch') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
+ class ActionEnum(str, Enum):
+ """
+ The action to perform for a packet matching the rule.
+ """
-class PublicGateway:
- """
- PublicGateway.
+ ALLOW = 'allow'
+ DENY = 'deny'
- :attr datetime created_at: The date and time that the public gateway was
- created.
- :attr str crn: The CRN for this public gateway.
- :attr PublicGatewayFloatingIp floating_ip: The floating IP bound to this public
- gateway.
- :attr str href: The URL for this public gateway.
- :attr str id: The unique identifier for this public gateway.
- :attr str name: The name for this public gateway. The name is unique across all
- public gateways in the VPC.
- :attr ResourceGroupReference resource_group: The resource group for this public
- gateway.
- :attr str resource_type: The resource type.
- :attr str status: The status of this public gateway.
- :attr VPCReference vpc: The VPC this public gateway resides in.
- :attr ZoneReference zone: The zone this public gateway resides in.
- """
- def __init__(
- self,
- created_at: datetime,
- crn: str,
- floating_ip: 'PublicGatewayFloatingIp',
- href: str,
- id: str,
- name: str,
- resource_group: 'ResourceGroupReference',
- resource_type: str,
- status: str,
- vpc: 'VPCReference',
- zone: 'ZoneReference',
+ class DirectionEnum(str, Enum):
+ """
+ The direction of traffic to match.
+ """
+
+ INBOUND = 'inbound'
+ OUTBOUND = 'outbound'
+
+
+ class ProtocolEnum(str, Enum):
+ """
+ The protocol to enforce.
+ """
+
+ ALL = 'all'
+ ICMP = 'icmp'
+ TCP = 'tcp'
+ UDP = 'udp'
+
+
+
+class NetworkACLRulePrototype:
+ """
+ NetworkACLRulePrototype.
+
+ :param str action: The action to perform for a packet matching the rule.
+ :param NetworkACLRuleBeforePrototype before: (optional) The rule to insert this
+ rule immediately before.
+ If unspecified, this rule will be inserted after all existing rules.
+ :param str destination: The destination IP address or CIDR block to match. The
+ CIDR block `0.0.0.0/0` matches all destination addresses.
+ :param str direction: The direction of traffic to match.
+ :param str ip_version: (optional) The IP version for this rule.
+ :param str name: (optional) The name for this network ACL rule. The name must
+ not be used by another rule for the network ACL. If unspecified, the name will
+ be a hyphenated list of randomly-selected words.
+ :param str protocol: The protocol to enforce.
+ :param str source: The source IP address or CIDR block to match. The CIDR block
+ `0.0.0.0/0` matches all source addresses.
+ """
+
+ def __init__(
+ self,
+ action: str,
+ destination: str,
+ direction: str,
+ protocol: str,
+ source: str,
+ *,
+ before: Optional['NetworkACLRuleBeforePrototype'] = None,
+ ip_version: Optional[str] = None,
+ name: Optional[str] = None,
) -> None:
"""
- Initialize a PublicGateway object.
+ Initialize a NetworkACLRulePrototype 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 name for this public gateway. The name is unique
- across all public gateways in the VPC.
- :param ResourceGroupReference resource_group: The resource group for this
- public gateway.
- :param str resource_type: The resource type.
- :param str status: The status of this public gateway.
- :param VPCReference vpc: The VPC this public gateway resides in.
- :param ZoneReference zone: The zone this public gateway resides in.
+ :param str action: The action to perform for a packet matching the rule.
+ :param str destination: The destination IP address or CIDR block to match.
+ The CIDR block `0.0.0.0/0` matches all destination addresses.
+ :param str direction: The direction of traffic to match.
+ :param str protocol: The protocol to enforce.
+ :param str source: The source IP address or CIDR block to match. The CIDR
+ block `0.0.0.0/0` matches all source addresses.
+ :param NetworkACLRuleBeforePrototype before: (optional) The rule to insert
+ this rule immediately before.
+ If unspecified, this rule will be inserted after all existing rules.
+ :param str ip_version: (optional) The IP version for this rule.
+ :param str name: (optional) The name for this network ACL rule. The name
+ must not be used by another rule for the network ACL. If unspecified, the
+ name will be a hyphenated list of randomly-selected words.
"""
- self.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
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype', 'NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype', 'NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype'])
+ )
+ raise Exception(msg)
@classmethod
- def from_dict(cls, _dict: Dict) -> '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)
+ def from_dict(cls, _dict: Dict) -> 'NetworkACLRulePrototype':
+ """Initialize a NetworkACLRulePrototype object from a json dictionary."""
+ disc_class = cls._get_class_by_discriminator(_dict)
+ if disc_class != cls:
+ return disc_class.from_dict(_dict)
+ msg = "Cannot convert dictionary into an instance of base class 'NetworkACLRulePrototype'. The discriminator value should map to a valid subclass: {1}".format(
+ ", ".join(['NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype', 'NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype', 'NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype'])
+ )
+ raise Exception(msg)
@classmethod
- def _from_dict(cls, _dict):
- """Initialize a PublicGateway object from a json dictionary."""
+ def _from_dict(cls, _dict: Dict):
+ """Initialize a NetworkACLRulePrototype object from a json dictionary."""
return cls.from_dict(_dict)
- def to_dict(self) -> Dict:
- """Return a json dictionary representing this model."""
- _dict = {}
- if hasattr(self, 'created_at') and self.created_at is not None:
- _dict['created_at'] = datetime_to_string(self.created_at)
- if hasattr(self, 'crn') and self.crn is not None:
- _dict['crn'] = self.crn
- if hasattr(self, 'floating_ip') and self.floating_ip is not None:
- if isinstance(self.floating_ip, dict):
- _dict['floating_ip'] = self.floating_ip
- else:
- _dict['floating_ip'] = self.floating_ip.to_dict()
- if hasattr(self, 'href') and self.href is not None:
- _dict['href'] = self.href
- if hasattr(self, 'id') and self.id is not None:
- _dict['id'] = self.id
- if hasattr(self, 'name') and self.name is not None:
- _dict['name'] = self.name
- if hasattr(self, 'resource_group') and self.resource_group is not None:
- if isinstance(self.resource_group, dict):
- _dict['resource_group'] = self.resource_group
- else:
- _dict['resource_group'] = self.resource_group.to_dict()
- if hasattr(self, 'resource_type') and self.resource_type is not None:
- _dict['resource_type'] = self.resource_type
- if hasattr(self, 'status') and self.status is not None:
- _dict['status'] = self.status
- if hasattr(self, 'vpc') and self.vpc is not None:
- if isinstance(self.vpc, dict):
- _dict['vpc'] = self.vpc
- else:
- _dict['vpc'] = self.vpc.to_dict()
- if hasattr(self, 'zone') and self.zone is not None:
- if isinstance(self.zone, dict):
- _dict['zone'] = self.zone
- else:
- _dict['zone'] = self.zone.to_dict()
- return _dict
+ @classmethod
+ def _get_class_by_discriminator(cls, _dict: Dict) -> object:
+ mapping = {}
+ mapping['all'] = 'NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype'
+ mapping['icmp'] = 'NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype'
+ mapping['tcp'] = 'NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype'
+ mapping['udp'] = 'NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype'
+ disc_value = _dict.get('protocol')
+ if disc_value is None:
+ raise ValueError('Discriminator property \'protocol\' not found in NetworkACLRulePrototype JSON')
+ class_name = mapping.get(disc_value, disc_value)
+ try:
+ disc_class = getattr(sys.modules[__name__], class_name)
+ except AttributeError:
+ disc_class = cls
+ if isinstance(disc_class, object):
+ return disc_class
+ raise TypeError('%s is not a discriminator class' % class_name)
- def _to_dict(self):
- """Return a json dictionary representing this model."""
- return self.to_dict()
+ class ActionEnum(str, Enum):
+ """
+ The action to perform for a packet matching the rule.
+ """
- def __str__(self) -> str:
- """Return a `str` version of this PublicGateway object."""
- return json.dumps(self.to_dict(), indent=2)
+ ALLOW = 'allow'
+ DENY = 'deny'
- 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 DirectionEnum(str, Enum):
+ """
+ The direction of traffic to match.
+ """
- class ResourceTypeEnum(str, Enum):
+ INBOUND = 'inbound'
+ OUTBOUND = 'outbound'
+
+
+ class IpVersionEnum(str, Enum):
"""
- The resource type.
+ The IP version for this rule.
"""
- PUBLIC_GATEWAY = 'public_gateway'
+ IPV4 = 'ipv4'
- class StatusEnum(str, Enum):
+ class ProtocolEnum(str, Enum):
"""
- The status of this public gateway.
+ The protocol to enforce.
"""
- AVAILABLE = 'available'
- DELETING = 'deleting'
- FAILED = 'failed'
- PENDING = 'pending'
+ ALL = 'all'
+ ICMP = 'icmp'
+ TCP = 'tcp'
+ UDP = 'udp'
-class PublicGatewayCollection:
+class NetworkACLRulePrototypeNetworkACLContext:
"""
- PublicGatewayCollection.
+ NetworkACLRulePrototypeNetworkACLContext.
- :attr PublicGatewayCollectionFirst first: A link to the first page of resources.
- :attr int limit: The maximum number of resources that can be returned by the
- request.
- :attr PublicGatewayCollectionNext next: (optional) A link to the next page of
- resources. This property is present for all pages
- except the last page.
- :attr List[PublicGateway] public_gateways: Collection of public gateways.
- :attr int total_count: The total number of resources across all pages.
+ :param str action: The action to perform for a packet matching the rule.
+ :param str destination: The destination IP address or CIDR block to match. The
+ CIDR block `0.0.0.0/0` matches all destination addresses.
+ :param str direction: The direction of traffic to match.
+ :param str ip_version: (optional) The IP version for this rule.
+ :param str name: (optional) The name for this network ACL rule. The name must
+ not be used by another rule for the network ACL. If unspecified, the name will
+ be a hyphenated list of randomly-selected words.
+ :param str protocol: The protocol to enforce.
+ :param str source: The source IP address or CIDR block to match. The CIDR block
+ `0.0.0.0/0` matches all source addresses.
"""
def __init__(
self,
- first: 'PublicGatewayCollectionFirst',
- limit: int,
- public_gateways: List['PublicGateway'],
- total_count: int,
+ action: str,
+ destination: str,
+ direction: str,
+ protocol: str,
+ source: str,
*,
- next: 'PublicGatewayCollectionNext' = None,
+ ip_version: Optional[str] = None,
+ name: Optional[str] = None,
) -> None:
"""
- Initialize a PublicGatewayCollection object.
+ Initialize a NetworkACLRulePrototypeNetworkACLContext object.
- :param PublicGatewayCollectionFirst first: A link to the first page of
- resources.
- :param int limit: The maximum number of resources that can be returned by
- the request.
- :param List[PublicGateway] public_gateways: Collection of public gateways.
- :param int total_count: The total number of resources across all pages.
- :param PublicGatewayCollectionNext next: (optional) A link to the next page
- of resources. This property is present for all pages
- except the last page.
+ :param str action: The action to perform for a packet matching the rule.
+ :param str destination: The destination IP address or CIDR block to match.
+ The CIDR block `0.0.0.0/0` matches all destination addresses.
+ :param str direction: The direction of traffic to match.
+ :param str protocol: The protocol to enforce.
+ :param str source: The source IP address or CIDR block to match. The CIDR
+ block `0.0.0.0/0` matches all source addresses.
+ :param str ip_version: (optional) The IP version for this rule.
+ :param str name: (optional) The name for this network ACL rule. The name
+ must not be used by another rule for the network ACL. If unspecified, the
+ name will be a hyphenated list of randomly-selected words.
"""
- self.first = first
- self.limit = limit
- self.next = next
- self.public_gateways = public_gateways
- self.total_count = total_count
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype', 'NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype', 'NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype'])
+ )
+ raise Exception(msg)
@classmethod
- def from_dict(cls, _dict: Dict) -> 'PublicGatewayCollection':
- """Initialize a PublicGatewayCollection object from a json dictionary."""
- args = {}
- if 'first' in _dict:
- args['first'] = PublicGatewayCollectionFirst.from_dict(_dict.get('first'))
- else:
- 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 PublicGatewayCollection JSON')
- if 'next' in _dict:
- args['next'] = PublicGatewayCollectionNext.from_dict(_dict.get('next'))
- if 'public_gateways' in _dict:
- args['public_gateways'] = [PublicGateway.from_dict(v) for v in _dict.get('public_gateways')]
- else:
- raise ValueError('Required property \'public_gateways\' not present in PublicGatewayCollection JSON')
- if 'total_count' in _dict:
- args['total_count'] = _dict.get('total_count')
- else:
- raise ValueError('Required property \'total_count\' not present in PublicGatewayCollection JSON')
- return cls(**args)
+ def from_dict(cls, _dict: Dict) -> 'NetworkACLRulePrototypeNetworkACLContext':
+ """Initialize a NetworkACLRulePrototypeNetworkACLContext object from a json dictionary."""
+ disc_class = cls._get_class_by_discriminator(_dict)
+ if disc_class != cls:
+ return disc_class.from_dict(_dict)
+ msg = "Cannot convert dictionary into an instance of base class 'NetworkACLRulePrototypeNetworkACLContext'. The discriminator value should map to a valid subclass: {1}".format(
+ ", ".join(['NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype', 'NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype', 'NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype'])
+ )
+ raise Exception(msg)
@classmethod
- def _from_dict(cls, _dict):
- """Initialize a PublicGatewayCollection 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, 'first') and self.first is not None:
- if isinstance(self.first, dict):
- _dict['first'] = self.first
- else:
- _dict['first'] = self.first.to_dict()
- if hasattr(self, 'limit') and self.limit is not None:
- _dict['limit'] = self.limit
- if hasattr(self, 'next') and self.next is not None:
- if isinstance(self.next, dict):
- _dict['next'] = self.next
- else:
- _dict['next'] = self.next.to_dict()
- if hasattr(self, 'public_gateways') and self.public_gateways is not None:
- public_gateways_list = []
- for v in self.public_gateways:
- if isinstance(v, dict):
- public_gateways_list.append(v)
- else:
- public_gateways_list.append(v.to_dict())
- _dict['public_gateways'] = public_gateways_list
- if hasattr(self, 'total_count') and self.total_count is not None:
- _dict['total_count'] = self.total_count
- return _dict
+ @classmethod
+ def _get_class_by_discriminator(cls, _dict: Dict) -> object:
+ mapping = {}
+ mapping['all'] = 'NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype'
+ mapping['icmp'] = 'NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype'
+ mapping['tcp'] = 'NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype'
+ mapping['udp'] = 'NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype'
+ disc_value = _dict.get('protocol')
+ if disc_value is None:
+ raise ValueError('Discriminator property \'protocol\' not found in NetworkACLRulePrototypeNetworkACLContext JSON')
+ class_name = mapping.get(disc_value, disc_value)
+ try:
+ disc_class = getattr(sys.modules[__name__], class_name)
+ except AttributeError:
+ disc_class = cls
+ if isinstance(disc_class, object):
+ return disc_class
+ raise TypeError('%s is not a discriminator class' % class_name)
- def _to_dict(self):
- """Return a json dictionary representing this model."""
- return self.to_dict()
+ class ActionEnum(str, Enum):
+ """
+ The action to perform for a packet matching the rule.
+ """
- def __str__(self) -> str:
- """Return a `str` version of this PublicGatewayCollection object."""
- return json.dumps(self.to_dict(), indent=2)
+ ALLOW = 'allow'
+ DENY = 'deny'
- 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: 'PublicGatewayCollection') -> bool:
- """Return `true` when self and other are not equal, false otherwise."""
- return not self == other
+ class DirectionEnum(str, Enum):
+ """
+ The direction of traffic to match.
+ """
+
+ INBOUND = 'inbound'
+ OUTBOUND = 'outbound'
-class PublicGatewayCollectionFirst:
+ class IpVersionEnum(str, Enum):
+ """
+ The IP version for this rule.
+ """
+
+ IPV4 = 'ipv4'
+
+
+ class ProtocolEnum(str, Enum):
+ """
+ The protocol to enforce.
+ """
+
+ ALL = 'all'
+ ICMP = 'icmp'
+ TCP = 'tcp'
+ UDP = 'udp'
+
+
+
+class NetworkACLRuleReference:
"""
- A link to the first page of resources.
+ NetworkACLRuleReference.
- :attr str href: The URL for a page of resources.
+ :param NetworkACLRuleReferenceDeleted 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 network ACL rule.
+ :param str id: The unique identifier for this network ACL rule.
+ :param str name: The name for this network ACL rule. The name is unique across
+ all rules for the network ACL.
"""
def __init__(
self,
href: str,
+ id: str,
+ name: str,
+ *,
+ deleted: Optional['NetworkACLRuleReferenceDeleted'] = None,
) -> None:
"""
- Initialize a PublicGatewayCollectionFirst object.
+ Initialize a NetworkACLRuleReference object.
- :param str href: The URL for a page of resources.
+ :param str href: The URL for this network ACL rule.
+ :param str id: The unique identifier for this network ACL rule.
+ :param str name: The name for this network ACL rule. The name is unique
+ across all rules for the network ACL.
+ :param NetworkACLRuleReferenceDeleted deleted: (optional) If present, this
+ property indicates the referenced resource has been deleted, and provides
+ some supplementary information.
"""
+ self.deleted = deleted
self.href = href
+ self.id = id
+ self.name = name
@classmethod
- def from_dict(cls, _dict: Dict) -> 'PublicGatewayCollectionFirst':
- """Initialize a PublicGatewayCollectionFirst object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'NetworkACLRuleReference':
+ """Initialize a NetworkACLRuleReference object from a json dictionary."""
args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ if (deleted := _dict.get('deleted')) is not None:
+ args['deleted'] = NetworkACLRuleReferenceDeleted.from_dict(deleted)
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'href\' not present in PublicGatewayCollectionFirst JSON')
+ raise ValueError('Required property \'href\' not present in NetworkACLRuleReference JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
+ else:
+ raise ValueError('Required property \'id\' not present in NetworkACLRuleReference JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ else:
+ raise ValueError('Required property \'name\' not present in NetworkACLRuleReference JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a PublicGatewayCollectionFirst 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, 'deleted') and self.deleted is not None:
+ if isinstance(self.deleted, dict):
+ _dict['deleted'] = self.deleted
+ else:
+ _dict['deleted'] = self.deleted.to_dict()
if hasattr(self, 'href') and self.href is not None:
_dict['href'] = self.href
+ if hasattr(self, 'id') and self.id is not None:
+ _dict['id'] = self.id
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
return _dict
def _to_dict(self):
@@ -62878,59 +65809,59 @@ 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 NetworkACLRuleReference object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'PublicGatewayCollectionFirst') -> 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: 'PublicGatewayCollectionFirst') -> bool:
+ def __ne__(self, other: 'NetworkACLRuleReference') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class PublicGatewayCollectionNext:
+class NetworkACLRuleReferenceDeleted:
"""
- 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.
+ :param str more_info: Link to documentation about deleted resources.
"""
def __init__(
self,
- href: str,
+ more_info: str,
) -> None:
"""
- Initialize a PublicGatewayCollectionNext object.
+ Initialize a NetworkACLRuleReferenceDeleted 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) -> 'PublicGatewayCollectionNext':
- """Initialize a PublicGatewayCollectionNext object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'NetworkACLRuleReferenceDeleted':
+ """Initialize a NetworkACLRuleReferenceDeleted object from a json dictionary."""
args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ if (more_info := _dict.get('more_info')) is not None:
+ args['more_info'] = more_info
else:
- raise ValueError('Required property \'href\' not present in PublicGatewayCollectionNext JSON')
+ raise ValueError('Required property \'more_info\' not present in NetworkACLRuleReferenceDeleted JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a PublicGatewayCollectionNext 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, '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):
@@ -62938,135 +65869,306 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this PublicGatewayCollectionNext object."""
+ """Return a `str` version of this NetworkACLRuleReferenceDeleted object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'PublicGatewayCollectionNext') -> 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: 'PublicGatewayCollectionNext') -> bool:
+ def __ne__(self, other: 'NetworkACLRuleReferenceDeleted') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class PublicGatewayFloatingIPPrototype:
+class NetworkInterface:
"""
- PublicGatewayFloatingIPPrototype.
+ NetworkInterface.
+ :param bool allow_ip_spoofing: Indicates whether source IP spoofing is allowed
+ on this instance network interface.
+ If this instance has network attachments, this network interface is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and source IP spoofing is managed on the attached virtual network
+ interface.
+ :param datetime created_at: The date and time that the instance network
+ interface was created.
+ If this instance has network attachments, this network interface was created as
+ a [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ when its corresponding network attachment was created.
+ :param List[FloatingIPReference] floating_ips: The floating IPs associated with
+ this instance network interface.
+ If this instance has network attachments, this network interface is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and the floating IPs are associated with the attached virtual network
+ interface.
+ :param str href: The URL for this instance network interface.
+ If this instance has network attachments, this network interface is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment.
+ :param str id: The unique identifier for this instance network interface.
+ If this instance has network attachments, this network interface is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and the identifier is that of the corresponding network attachment.
+ :param str name: The name for this instance network interface.
+ If this instance has network attachments, this network interface is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and the name matches its corresponding network attachment.
+ :param int port_speed: The instance network interface port speed in Mbps.
+ If this instance has network attachments, this network interface is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and the port speed is that of its corresponding network attachment.
+ :param ReservedIPReference primary_ip:
+ :param str resource_type: The resource type.
+ :param List[SecurityGroupReference] security_groups: The security groups
+ targeting this instance network interface.
+ If this instance has network attachments, this network interface is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and the security groups are associated with the attached virtual
+ network interface.
+ :param str status: The status of the instance network interface.
+ If this instance has network attachments, this network interface is a read-only
+ representation of its corresponding network attachment and its attached virtual
+ network interface, and the status is [computed from
+ them](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients).
+ :param SubnetReference subnet: The associated subnet.
+ :param str type: The instance network interface type.
+ If this instance has network attachments, this network interface is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and the type is that of its corresponding network attachment.
"""
def __init__(
self,
+ allow_ip_spoofing: bool,
+ created_at: datetime,
+ floating_ips: List['FloatingIPReference'],
+ href: str,
+ id: str,
+ name: str,
+ port_speed: int,
+ primary_ip: 'ReservedIPReference',
+ resource_type: str,
+ security_groups: List['SecurityGroupReference'],
+ status: str,
+ subnet: 'SubnetReference',
+ type: str,
) -> 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)
-
+ Initialize a NetworkInterface object.
-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 name for this floating IP. The name is unique across all
- floating IPs in the region.
- """
-
- def __init__(
- self,
- address: str,
- crn: str,
- href: str,
- id: str,
- name: str,
- *,
- 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 name for this floating IP. The name is unique across
- all floating IPs in the region.
- :param FloatingIPReferenceDeleted deleted: (optional) If present, this
- property indicates the referenced resource has been deleted, and provides
- some supplementary information.
+ :param bool allow_ip_spoofing: Indicates whether source IP spoofing is
+ allowed on this instance network interface.
+ If this instance has network attachments, this network interface is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and source IP spoofing is managed on the attached virtual
+ network interface.
+ :param datetime created_at: The date and time that the instance network
+ interface was created.
+ If this instance has network attachments, this network interface was
+ created as a [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ when its corresponding network attachment was created.
+ :param List[FloatingIPReference] floating_ips: The floating IPs associated
+ with this instance network interface.
+ If this instance has network attachments, this network interface is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and the floating IPs are associated with the attached virtual
+ network interface.
+ :param str href: The URL for this instance network interface.
+ If this instance has network attachments, this network interface is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment.
+ :param str id: The unique identifier for this instance network interface.
+ If this instance has network attachments, this network interface is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and the identifier is that of the corresponding network
+ attachment.
+ :param str name: The name for this instance network interface.
+ If this instance has network attachments, this network interface is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and the name matches its corresponding network attachment.
+ :param int port_speed: The instance network interface port speed in Mbps.
+ If this instance has network attachments, this network interface is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and the port speed is that of its corresponding network
+ attachment.
+ :param ReservedIPReference primary_ip:
+ :param str resource_type: The resource type.
+ :param List[SecurityGroupReference] security_groups: The security groups
+ targeting this instance network interface.
+ If this instance has network attachments, this network interface is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and the security groups are associated with the attached virtual
+ network interface.
+ :param str status: The status of the instance network interface.
+ If this instance has network attachments, this network interface is a
+ read-only representation of its corresponding network attachment and its
+ attached virtual network interface, and the status is [computed from
+ them](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients).
+ :param SubnetReference subnet: The associated subnet.
+ :param str type: The instance network interface type.
+ If this instance has network attachments, this network interface is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and the type is that of its corresponding network attachment.
"""
- self.address = address
- self.crn = crn
- self.deleted = deleted
+ self.allow_ip_spoofing = allow_ip_spoofing
+ self.created_at = created_at
+ self.floating_ips = floating_ips
self.href = href
self.id = id
self.name = name
+ self.port_speed = port_speed
+ self.primary_ip = primary_ip
+ self.resource_type = resource_type
+ self.security_groups = security_groups
+ self.status = status
+ self.subnet = subnet
+ self.type = type
@classmethod
- def from_dict(cls, _dict: Dict) -> 'PublicGatewayFloatingIp':
- """Initialize a PublicGatewayFloatingIp object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'NetworkInterface':
+ """Initialize a NetworkInterface object from a json dictionary."""
args = {}
- if 'address' in _dict:
- args['address'] = _dict.get('address')
+ if (allow_ip_spoofing := _dict.get('allow_ip_spoofing')) is not None:
+ args['allow_ip_spoofing'] = allow_ip_spoofing
else:
- raise ValueError('Required property \'address\' not present in PublicGatewayFloatingIp JSON')
- if 'crn' in _dict:
- args['crn'] = _dict.get('crn')
+ raise ValueError('Required property \'allow_ip_spoofing\' not present in NetworkInterface JSON')
+ if (created_at := _dict.get('created_at')) is not None:
+ args['created_at'] = string_to_datetime(created_at)
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')
+ raise ValueError('Required property \'created_at\' not present in NetworkInterface JSON')
+ if (floating_ips := _dict.get('floating_ips')) is not None:
+ args['floating_ips'] = [FloatingIPReference.from_dict(v) for v in floating_ips]
else:
- raise ValueError('Required property \'href\' not present in PublicGatewayFloatingIp JSON')
- if 'id' in _dict:
- args['id'] = _dict.get('id')
+ raise ValueError('Required property \'floating_ips\' not present in NetworkInterface JSON')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'id\' not present in PublicGatewayFloatingIp JSON')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
+ raise ValueError('Required property \'href\' not present in NetworkInterface JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
else:
- raise ValueError('Required property \'name\' not present in PublicGatewayFloatingIp JSON')
+ raise ValueError('Required property \'id\' not present in NetworkInterface JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ else:
+ raise ValueError('Required property \'name\' not present in NetworkInterface JSON')
+ if (port_speed := _dict.get('port_speed')) is not None:
+ args['port_speed'] = port_speed
+ else:
+ raise ValueError('Required property \'port_speed\' not present in NetworkInterface JSON')
+ if (primary_ip := _dict.get('primary_ip')) is not None:
+ args['primary_ip'] = ReservedIPReference.from_dict(primary_ip)
+ else:
+ raise ValueError('Required property \'primary_ip\' not present in NetworkInterface JSON')
+ if (resource_type := _dict.get('resource_type')) is not None:
+ args['resource_type'] = resource_type
+ else:
+ raise ValueError('Required property \'resource_type\' not present in NetworkInterface JSON')
+ if (security_groups := _dict.get('security_groups')) is not None:
+ args['security_groups'] = [SecurityGroupReference.from_dict(v) for v in security_groups]
+ else:
+ raise ValueError('Required property \'security_groups\' not present in NetworkInterface JSON')
+ if (status := _dict.get('status')) is not None:
+ args['status'] = status
+ else:
+ raise ValueError('Required property \'status\' not present in NetworkInterface JSON')
+ if (subnet := _dict.get('subnet')) is not None:
+ args['subnet'] = SubnetReference.from_dict(subnet)
+ else:
+ raise ValueError('Required property \'subnet\' not present in NetworkInterface JSON')
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
+ else:
+ raise ValueError('Required property \'type\' not present in NetworkInterface JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a PublicGatewayFloatingIp 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, 'address') and self.address is not None:
- _dict['address'] = self.address
- if hasattr(self, 'crn') and self.crn is not None:
- _dict['crn'] = self.crn
- if hasattr(self, 'deleted') and self.deleted is not None:
- if isinstance(self.deleted, dict):
- _dict['deleted'] = self.deleted
- else:
- _dict['deleted'] = self.deleted.to_dict()
+ if hasattr(self, 'allow_ip_spoofing') and self.allow_ip_spoofing is not None:
+ _dict['allow_ip_spoofing'] = self.allow_ip_spoofing
+ if hasattr(self, 'created_at') and self.created_at is not None:
+ _dict['created_at'] = datetime_to_string(self.created_at)
+ if hasattr(self, 'floating_ips') and self.floating_ips is not None:
+ floating_ips_list = []
+ for v in self.floating_ips:
+ if isinstance(v, dict):
+ floating_ips_list.append(v)
+ else:
+ floating_ips_list.append(v.to_dict())
+ _dict['floating_ips'] = floating_ips_list
if hasattr(self, 'href') and self.href is not None:
_dict['href'] = self.href
if hasattr(self, 'id') and self.id is not None:
_dict['id'] = self.id
if hasattr(self, 'name') and self.name is not None:
_dict['name'] = self.name
+ if hasattr(self, 'port_speed') and self.port_speed is not None:
+ _dict['port_speed'] = self.port_speed
+ if hasattr(self, 'primary_ip') and self.primary_ip is not None:
+ if isinstance(self.primary_ip, dict):
+ _dict['primary_ip'] = self.primary_ip
+ else:
+ _dict['primary_ip'] = self.primary_ip.to_dict()
+ if hasattr(self, 'resource_type') and self.resource_type is not None:
+ _dict['resource_type'] = self.resource_type
+ if hasattr(self, 'security_groups') and self.security_groups is not None:
+ security_groups_list = []
+ for v in self.security_groups:
+ if isinstance(v, dict):
+ security_groups_list.append(v)
+ else:
+ security_groups_list.append(v.to_dict())
+ _dict['security_groups'] = security_groups_list
+ if hasattr(self, 'status') and self.status is not None:
+ _dict['status'] = self.status
+ if hasattr(self, 'subnet') and self.subnet is not None:
+ if isinstance(self.subnet, dict):
+ _dict['subnet'] = self.subnet
+ else:
+ _dict['subnet'] = self.subnet.to_dict()
+ if hasattr(self, 'type') and self.type is not None:
+ _dict['type'] = self.type
return _dict
def _to_dict(self):
@@ -63074,182 +66176,169 @@ 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 NetworkInterface object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'PublicGatewayFloatingIp') -> 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: 'PublicGatewayFloatingIp') -> bool:
+ def __ne__(self, other: 'NetworkInterface') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-
-class PublicGatewayIdentity:
- """
- Identifies a public gateway by a unique property.
-
- """
-
- def __init__(
- self,
- ) -> None:
+ class ResourceTypeEnum(str, Enum):
"""
- Initialize a PublicGatewayIdentity object.
-
+ The resource type.
"""
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['PublicGatewayIdentityPublicGatewayIdentityById', 'PublicGatewayIdentityPublicGatewayIdentityByCRN', 'PublicGatewayIdentityPublicGatewayIdentityByHref'])
- )
- raise Exception(msg)
+ NETWORK_INTERFACE = 'network_interface'
-class PublicGatewayPatch:
- """
- PublicGatewayPatch.
-
- :attr str name: (optional) The name for this public gateway. The name must not
- be used by another public gateway in the VPC.
- """
- def __init__(
- self,
- *,
- name: str = None,
- ) -> None:
+ class StatusEnum(str, Enum):
"""
- Initialize a PublicGatewayPatch object.
-
- :param str name: (optional) The name for this public gateway. The name must
- not be used by another public gateway in the VPC.
+ The status of the instance network interface.
+ If this instance has network attachments, this network interface is a read-only
+ representation of its corresponding network attachment and its attached virtual
+ network interface, and the status is [computed from
+ them](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients).
"""
- 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)
-
- @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
+ AVAILABLE = 'available'
+ DELETING = 'deleting'
+ FAILED = 'failed'
+ PENDING = 'pending'
- def _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)
+ class TypeEnum(str, Enum):
+ """
+ The instance network interface type.
+ If this instance has network attachments, this network interface is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and the type is that of its corresponding network attachment.
+ """
- 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__
+ PRIMARY = 'primary'
+ SECONDARY = 'secondary'
- def __ne__(self, other: 'PublicGatewayPatch') -> bool:
- """Return `true` when self and other are not equal, false otherwise."""
- return not self == other
-class PublicGatewayReference:
+class NetworkInterfaceBareMetalServerContextReference:
"""
- PublicGatewayReference.
+ NetworkInterfaceBareMetalServerContextReference.
- :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
+ :param NetworkInterfaceBareMetalServerContextReferenceDeleted deleted:
+ (optional) If present, this property indicates the referenced resource has been
+ deleted, and provides
some supplementary information.
- :attr str href: The URL for this public gateway.
- :attr str id: The unique identifier for this public gateway.
- :attr str name: The name for this public gateway. The name is unique across all
- public gateways in the VPC.
- :attr str resource_type: The resource type.
+ :param str href: The URL for this bare metal server network interface.
+ If this bare metal server has network attachments, this network interface is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment.
+ :param str id: The unique identifier for this bare metal server network
+ interface.
+ If this bare metal server has network attachments, this network interface is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and the identifier is that of the corresponding network attachment.
+ :param str name: The name for this bare metal server network interface.
+ :param ReservedIPReference primary_ip:
+ :param str resource_type: The resource type.
+ :param SubnetReference subnet: The associated subnet.
"""
def __init__(
self,
- crn: str,
href: str,
id: str,
name: str,
+ primary_ip: 'ReservedIPReference',
resource_type: str,
+ subnet: 'SubnetReference',
*,
- deleted: 'PublicGatewayReferenceDeleted' = None,
+ deleted: Optional['NetworkInterfaceBareMetalServerContextReferenceDeleted'] = None,
) -> None:
"""
- Initialize a PublicGatewayReference object.
+ Initialize a NetworkInterfaceBareMetalServerContextReference object.
- :param str crn: The CRN for this public gateway.
- :param str href: The URL for this public gateway.
- :param str id: The unique identifier for this public gateway.
- :param str name: The name for this public gateway. The name is unique
- across all public gateways in the VPC.
+ :param str href: The URL for this bare metal server network interface.
+ If this bare metal server has network attachments, this network interface
+ is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment.
+ :param str id: The unique identifier for this bare metal server network
+ interface.
+ If this bare metal server has network attachments, this network interface
+ is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and the identifier is that of the corresponding network
+ attachment.
+ :param str name: The name for this bare metal server network interface.
+ :param ReservedIPReference primary_ip:
:param str resource_type: The resource type.
- :param PublicGatewayReferenceDeleted deleted: (optional) If present, this
- property indicates the referenced resource has been deleted, and provides
+ :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.crn = crn
self.deleted = deleted
self.href = href
self.id = id
self.name = name
+ self.primary_ip = primary_ip
self.resource_type = resource_type
+ self.subnet = subnet
@classmethod
- def from_dict(cls, _dict: Dict) -> 'PublicGatewayReference':
- """Initialize a PublicGatewayReference object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'NetworkInterfaceBareMetalServerContextReference':
+ """Initialize a NetworkInterfaceBareMetalServerContextReference object from a json dictionary."""
args = {}
- if 'crn' in _dict:
- args['crn'] = _dict.get('crn')
+ if (deleted := _dict.get('deleted')) is not None:
+ args['deleted'] = NetworkInterfaceBareMetalServerContextReferenceDeleted.from_dict(deleted)
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'crn\' not present in PublicGatewayReference JSON')
- if 'deleted' in _dict:
- args['deleted'] = PublicGatewayReferenceDeleted.from_dict(_dict.get('deleted'))
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ raise ValueError('Required property \'href\' not present in NetworkInterfaceBareMetalServerContextReference JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
else:
- raise ValueError('Required property \'href\' not present in PublicGatewayReference JSON')
- if 'id' in _dict:
- args['id'] = _dict.get('id')
+ raise ValueError('Required property \'id\' not present in NetworkInterfaceBareMetalServerContextReference JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
else:
- raise ValueError('Required property \'id\' not present in PublicGatewayReference JSON')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
+ raise ValueError('Required property \'name\' not present in NetworkInterfaceBareMetalServerContextReference JSON')
+ if (primary_ip := _dict.get('primary_ip')) is not None:
+ args['primary_ip'] = ReservedIPReference.from_dict(primary_ip)
else:
- raise ValueError('Required property \'name\' not present in PublicGatewayReference JSON')
- if 'resource_type' in _dict:
- args['resource_type'] = _dict.get('resource_type')
+ raise ValueError('Required property \'primary_ip\' not present in NetworkInterfaceBareMetalServerContextReference JSON')
+ if (resource_type := _dict.get('resource_type')) is not None:
+ args['resource_type'] = resource_type
else:
- raise ValueError('Required property \'resource_type\' not present in PublicGatewayReference JSON')
+ raise ValueError('Required property \'resource_type\' not present in NetworkInterfaceBareMetalServerContextReference JSON')
+ if (subnet := _dict.get('subnet')) is not None:
+ args['subnet'] = SubnetReference.from_dict(subnet)
+ else:
+ raise ValueError('Required property \'subnet\' not present in NetworkInterfaceBareMetalServerContextReference JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a PublicGatewayReference object from a json dictionary."""
+ """Initialize a NetworkInterfaceBareMetalServerContextReference object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'crn') and self.crn is not None:
- _dict['crn'] = self.crn
if hasattr(self, 'deleted') and self.deleted is not None:
if isinstance(self.deleted, dict):
_dict['deleted'] = self.deleted
@@ -63261,8 +66350,18 @@ 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_ip') and self.primary_ip is not None:
+ if isinstance(self.primary_ip, dict):
+ _dict['primary_ip'] = self.primary_ip
+ else:
+ _dict['primary_ip'] = self.primary_ip.to_dict()
if hasattr(self, 'resource_type') and self.resource_type is not None:
_dict['resource_type'] = self.resource_type
+ if hasattr(self, 'subnet') and self.subnet is not None:
+ if isinstance(self.subnet, dict):
+ _dict['subnet'] = self.subnet
+ else:
+ _dict['subnet'] = self.subnet.to_dict()
return _dict
def _to_dict(self):
@@ -63270,16 +66369,16 @@ 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 NetworkInterfaceBareMetalServerContextReference object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'PublicGatewayReference') -> 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: 'PublicGatewayReference') -> bool:
+ def __ne__(self, other: 'NetworkInterfaceBareMetalServerContextReference') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
@@ -63288,16 +66387,16 @@ class ResourceTypeEnum(str, Enum):
The resource type.
"""
- PUBLIC_GATEWAY = 'public_gateway'
+ NETWORK_INTERFACE = 'network_interface'
-class PublicGatewayReferenceDeleted:
+class NetworkInterfaceBareMetalServerContextReferenceDeleted:
"""
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.
+ :param str more_info: Link to documentation about deleted resources.
"""
def __init__(
@@ -63305,25 +66404,25 @@ def __init__(
more_info: str,
) -> None:
"""
- Initialize a PublicGatewayReferenceDeleted 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) -> 'PublicGatewayReferenceDeleted':
- """Initialize a PublicGatewayReferenceDeleted 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')
+ if (more_info := _dict.get('more_info')) is not None:
+ args['more_info'] = more_info
else:
- raise ValueError('Required property \'more_info\' not present in PublicGatewayReferenceDeleted JSON')
+ raise ValueError('Required property \'more_info\' not present in NetworkInterfaceBareMetalServerContextReferenceDeleted JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a PublicGatewayReferenceDeleted object from a json dictionary."""
+ """Initialize a NetworkInterfaceBareMetalServerContextReferenceDeleted object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -63338,88 +66437,170 @@ 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 NetworkInterfaceBareMetalServerContextReferenceDeleted object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'PublicGatewayReferenceDeleted') -> 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: 'PublicGatewayReferenceDeleted') -> bool:
+ def __ne__(self, other: 'NetworkInterfaceBareMetalServerContextReferenceDeleted') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class Region:
+class NetworkInterfaceIPPrototype:
"""
- Region.
+ NetworkInterfaceIPPrototype.
- :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,
+ ) -> None:
+ """
+ Initialize a NetworkInterfaceIPPrototype object.
+
+ """
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['NetworkInterfaceIPPrototypeReservedIPIdentity', 'NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext'])
+ )
+ raise Exception(msg)
+
+
+class NetworkInterfaceInstanceContextReference:
+ """
+ NetworkInterfaceInstanceContextReference.
+
+ :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 this instance network interface.
+ If this instance has network attachments, this network interface is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment.
+ :param str id: The unique identifier for this instance network interface.
+ If this instance has network attachments, this network interface is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and the identifier is that of the corresponding network attachment.
+ :param str name: The name for this instance network interface.
+ :param ReservedIPReference primary_ip:
+ :param str resource_type: The resource type.
+ :param SubnetReference subnet: The associated subnet.
+ """
+
+ def __init__(
+ self,
href: str,
+ id: str,
name: str,
- status: str,
+ primary_ip: 'ReservedIPReference',
+ resource_type: str,
+ subnet: 'SubnetReference',
+ *,
+ deleted: Optional['NetworkInterfaceInstanceContextReferenceDeleted'] = None,
) -> None:
"""
- Initialize a Region object.
+ Initialize a NetworkInterfaceInstanceContextReference object.
- :param str endpoint: The API endpoint for this region.
- :param str href: The URL for this region.
- :param str name: The globally unique name for this region.
- :param str status: The availability status of this region.
+ :param str href: The URL for this instance network interface.
+ If this instance has network attachments, this network interface is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment.
+ :param str id: The unique identifier for this instance network interface.
+ If this instance has network attachments, this network interface is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and the identifier is that of the corresponding network
+ attachment.
+ :param str name: The name for this instance network interface.
+ :param ReservedIPReference primary_ip:
+ :param str resource_type: The resource type.
+ :param SubnetReference subnet: The associated subnet.
+ :param NetworkInterfaceInstanceContextReferenceDeleted deleted: (optional)
+ If present, this property indicates the referenced resource has been
+ deleted, and provides
+ some supplementary information.
"""
- self.endpoint = endpoint
+ self.deleted = deleted
self.href = href
+ self.id = id
self.name = name
- self.status = status
+ self.primary_ip = primary_ip
+ self.resource_type = resource_type
+ self.subnet = subnet
@classmethod
- def from_dict(cls, _dict: Dict) -> 'Region':
- """Initialize a Region object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'NetworkInterfaceInstanceContextReference':
+ """Initialize a NetworkInterfaceInstanceContextReference object from a json dictionary."""
args = {}
- if 'endpoint' in _dict:
- args['endpoint'] = _dict.get('endpoint')
+ if (deleted := _dict.get('deleted')) is not None:
+ args['deleted'] = NetworkInterfaceInstanceContextReferenceDeleted.from_dict(deleted)
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'endpoint\' not present in Region JSON')
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ raise ValueError('Required property \'href\' not present in NetworkInterfaceInstanceContextReference JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
else:
- raise ValueError('Required property \'href\' not present in Region JSON')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
+ raise ValueError('Required property \'id\' not present in NetworkInterfaceInstanceContextReference JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
else:
- raise ValueError('Required property \'name\' not present in Region JSON')
- if 'status' in _dict:
- args['status'] = _dict.get('status')
+ raise ValueError('Required property \'name\' not present in NetworkInterfaceInstanceContextReference JSON')
+ if (primary_ip := _dict.get('primary_ip')) is not None:
+ args['primary_ip'] = ReservedIPReference.from_dict(primary_ip)
else:
- raise ValueError('Required property \'status\' not present in Region JSON')
+ raise ValueError('Required property \'primary_ip\' not present in NetworkInterfaceInstanceContextReference JSON')
+ if (resource_type := _dict.get('resource_type')) is not None:
+ args['resource_type'] = resource_type
+ else:
+ raise ValueError('Required property \'resource_type\' not present in NetworkInterfaceInstanceContextReference JSON')
+ if (subnet := _dict.get('subnet')) is not None:
+ args['subnet'] = SubnetReference.from_dict(subnet)
+ else:
+ raise ValueError('Required property \'subnet\' not present in NetworkInterfaceInstanceContextReference JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a Region object from a json dictionary."""
+ """Initialize a NetworkInterfaceInstanceContextReference object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'endpoint') and self.endpoint is not None:
- _dict['endpoint'] = self.endpoint
+ if hasattr(self, 'deleted') and self.deleted is not None:
+ if isinstance(self.deleted, dict):
+ _dict['deleted'] = self.deleted
+ else:
+ _dict['deleted'] = self.deleted.to_dict()
if hasattr(self, 'href') and self.href is not None:
_dict['href'] = self.href
+ if hasattr(self, 'id') and self.id is not None:
+ _dict['id'] = self.id
if hasattr(self, 'name') and self.name is not None:
_dict['name'] = self.name
- if hasattr(self, 'status') and self.status is not None:
- _dict['status'] = self.status
+ if hasattr(self, 'primary_ip') and self.primary_ip is not None:
+ if isinstance(self.primary_ip, dict):
+ _dict['primary_ip'] = self.primary_ip
+ else:
+ _dict['primary_ip'] = self.primary_ip.to_dict()
+ if hasattr(self, 'resource_type') and self.resource_type is not None:
+ _dict['resource_type'] = self.resource_type
+ if hasattr(self, 'subnet') and self.subnet is not None:
+ if isinstance(self.subnet, dict):
+ _dict['subnet'] = self.subnet
+ else:
+ _dict['subnet'] = self.subnet.to_dict()
return _dict
def _to_dict(self):
@@ -63427,73 +66608,67 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this Region object."""
+ """Return a `str` version of this NetworkInterfaceInstanceContextReference object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'Region') -> 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: 'Region') -> bool:
+ def __ne__(self, other: 'NetworkInterfaceInstanceContextReference') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class StatusEnum(str, Enum):
+ class ResourceTypeEnum(str, Enum):
"""
- The availability status of this region.
+ The resource type.
"""
- AVAILABLE = 'available'
- UNAVAILABLE = 'unavailable'
+ NETWORK_INTERFACE = 'network_interface'
-class RegionCollection:
+class NetworkInterfaceInstanceContextReferenceDeleted:
"""
- RegionCollection.
+ If present, this property indicates the referenced resource has been deleted, and
+ provides some supplementary information.
- :attr List[Region] regions: Collection of regions.
+ :param str more_info: Link to documentation about deleted resources.
"""
def __init__(
self,
- regions: List['Region'],
+ more_info: str,
) -> None:
"""
- Initialize a RegionCollection object.
+ Initialize a NetworkInterfaceInstanceContextReferenceDeleted object.
- :param List[Region] regions: Collection of regions.
+ :param str more_info: Link to documentation about deleted resources.
"""
- self.regions = regions
+ self.more_info = more_info
@classmethod
- def from_dict(cls, _dict: Dict) -> 'RegionCollection':
- """Initialize a RegionCollection object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'NetworkInterfaceInstanceContextReferenceDeleted':
+ """Initialize a NetworkInterfaceInstanceContextReferenceDeleted object from a json dictionary."""
args = {}
- if 'regions' in _dict:
- args['regions'] = [Region.from_dict(v) for v in _dict.get('regions')]
+ if (more_info := _dict.get('more_info')) is not None:
+ args['more_info'] = more_info
else:
- raise ValueError('Required property \'regions\' not present in RegionCollection JSON')
+ raise ValueError('Required property \'more_info\' not present in NetworkInterfaceInstanceContextReferenceDeleted JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a RegionCollection object from a json dictionary."""
+ """Initialize a NetworkInterfaceInstanceContextReferenceDeleted object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'regions') and self.regions is not None:
- regions_list = []
- for v in self.regions:
- if isinstance(v, dict):
- regions_list.append(v)
- else:
- regions_list.append(v.to_dict())
- _dict['regions'] = regions_list
+ if hasattr(self, 'more_info') and self.more_info is not None:
+ _dict['more_info'] = self.more_info
return _dict
def _to_dict(self):
@@ -63501,85 +66676,81 @@ 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 NetworkInterfaceInstanceContextReferenceDeleted object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'RegionCollection') -> 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: 'RegionCollection') -> bool:
+ def __ne__(self, other: 'NetworkInterfaceInstanceContextReferenceDeleted') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class RegionIdentity:
- """
- Identifies a region by a unique property.
-
- """
-
- def __init__(
- self,
- ) -> None:
- """
- Initialize a RegionIdentity object.
-
- """
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['RegionIdentityByName', 'RegionIdentityByHref'])
- )
- raise Exception(msg)
-
-
-class RegionReference:
+class NetworkInterfacePatch:
"""
- RegionReference.
+ NetworkInterfacePatch.
- :attr str href: The URL for this region.
- :attr str name: The globally unique name for this region.
+ :param bool allow_ip_spoofing: (optional) Indicates whether source IP spoofing
+ is allowed on this instance network interface.
+ If this instance has network attachments, this network interface is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and source IP spoofing is managed on the attached virtual network
+ interface.
+ :param str name: (optional) The name for the instance network interface. The
+ name must not be used by another network interface on the virtual server
+ instance.
"""
def __init__(
self,
- href: str,
- name: str,
+ *,
+ allow_ip_spoofing: Optional[bool] = None,
+ name: Optional[str] = None,
) -> None:
"""
- Initialize a RegionReference object.
+ Initialize a NetworkInterfacePatch object.
- :param str href: The URL for this region.
- :param str name: The globally unique name for this region.
+ :param bool allow_ip_spoofing: (optional) Indicates whether source IP
+ spoofing is allowed on this instance network interface.
+ If this instance has network attachments, this network interface is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and source IP spoofing is managed on the attached virtual
+ network interface.
+ :param str name: (optional) The name for the instance network interface.
+ The name must not be used by another network interface on the virtual
+ server instance.
"""
- self.href = href
+ self.allow_ip_spoofing = allow_ip_spoofing
self.name = name
@classmethod
- def from_dict(cls, _dict: Dict) -> 'RegionReference':
- """Initialize a RegionReference object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'NetworkInterfacePatch':
+ """Initialize a NetworkInterfacePatch 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 (allow_ip_spoofing := _dict.get('allow_ip_spoofing')) is not None:
+ args['allow_ip_spoofing'] = allow_ip_spoofing
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a RegionReference 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, 'href') and self.href is not None:
- _dict['href'] = self.href
+ 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
@@ -63589,172 +66760,142 @@ 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 NetworkInterfacePatch object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'RegionReference') -> 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: 'RegionReference') -> bool:
+ def __ne__(self, other: 'NetworkInterfacePatch') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class ReservedIP:
+class NetworkInterfacePrototype:
"""
- ReservedIP.
+ NetworkInterfacePrototype.
- :attr str address: The IP address.
- If the address has not yet been selected, the value will be `0.0.0.0`.
- This property may add support for IPv6 addresses in the future. When processing
- a value in this property, verify that the address is in an expected format. If
- it is not, log an error. Optionally halt processing and surface the error, or
- bypass the resource on which the unexpected IP address format was encountered.
- :attr bool auto_delete: Indicates whether this reserved IP member will be
- automatically deleted when either
- `target` is deleted, or the reserved IP is unbound.
- :attr datetime created_at: The date and time that the reserved IP was created.
- :attr str href: The URL for this reserved IP.
- :attr str id: The unique identifier for this reserved IP.
- :attr str lifecycle_state: The lifecycle state of the reserved IP.
- :attr str name: The name for this reserved IP. The name is unique across all
- reserved IPs in a subnet.
- :attr str owner: The owner of the reserved IP.
- :attr str resource_type: The resource type.
- :attr ReservedIPTarget target: (optional) The target this reserved IP is bound
- to.
- If absent, this reserved IP is provider-owned or unbound.
+ :param bool allow_ip_spoofing: (optional) Indicates whether source IP spoofing
+ is allowed on this instance network interface.
+ If this instance has network attachments, this network interface is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and source IP spoofing is managed on the attached virtual network
+ interface.
+ :param str name: (optional) The name for the instance network interface. The
+ name must not be used by another network interface on the virtual server
+ instance. If unspecified, the name will be a hyphenated list of
+ randomly-selected words.
+ :param NetworkInterfaceIPPrototype primary_ip: (optional) The primary IP address
+ to bind to the instance network interface. This can be
+ specified using an existing reserved IP, or a prototype object for a new
+ reserved IP.
+ If an existing reserved IP or a prototype object with an address is specified,
+ it must
+ be available on the instance network interface's subnet. Otherwise, an
+ available address on the subnet will be automatically selected and reserved.
+ :param List[SecurityGroupIdentity] security_groups: (optional) The security
+ groups to use for this instance network interface. If unspecified, the VPC's
+ default security group is used.
+ :param SubnetIdentity subnet: The associated subnet.
"""
def __init__(
self,
- address: str,
- auto_delete: bool,
- created_at: datetime,
- href: str,
- id: str,
- lifecycle_state: str,
- name: str,
- owner: str,
- resource_type: str,
+ subnet: 'SubnetIdentity',
*,
- target: 'ReservedIPTarget' = None,
+ allow_ip_spoofing: Optional[bool] = None,
+ name: Optional[str] = None,
+ primary_ip: Optional['NetworkInterfaceIPPrototype'] = None,
+ security_groups: Optional[List['SecurityGroupIdentity']] = None,
) -> None:
"""
- Initialize a ReservedIP object.
+ Initialize a NetworkInterfacePrototype 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 lifecycle_state: The lifecycle state of the reserved IP.
- :param str name: The name for this reserved IP. The name is unique across
- all reserved IPs in a subnet.
- :param str owner: The owner of the reserved IP.
- :param str resource_type: The resource type.
- :param ReservedIPTarget target: (optional) The target this reserved IP is
- bound to.
- If absent, this reserved IP is provider-owned or unbound.
+ :param SubnetIdentity subnet: The associated subnet.
+ :param bool allow_ip_spoofing: (optional) Indicates whether source IP
+ spoofing is allowed on this instance network interface.
+ If this instance has network attachments, this network interface is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and source IP spoofing is managed on the attached virtual
+ network interface.
+ :param str name: (optional) The name for the instance network interface.
+ The name must not be used by another network interface on the virtual
+ server instance. If unspecified, the name will be a hyphenated list of
+ randomly-selected words.
+ :param NetworkInterfaceIPPrototype primary_ip: (optional) The primary IP
+ address to bind to the instance network interface. This can be
+ specified using an existing reserved IP, or a prototype object for a new
+ reserved IP.
+ If an existing reserved IP or a prototype object with an address is
+ specified, it must
+ be available on the instance network interface's subnet. Otherwise, an
+ available address on the subnet will be automatically selected and
+ reserved.
+ :param List[SecurityGroupIdentity] security_groups: (optional) The security
+ groups to use for this instance network interface. If unspecified, the
+ VPC's default security group is used.
"""
- self.address = address
- self.auto_delete = auto_delete
- self.created_at = created_at
- self.href = href
- self.id = id
- self.lifecycle_state = lifecycle_state
+ self.allow_ip_spoofing = allow_ip_spoofing
self.name = name
- self.owner = owner
- self.resource_type = resource_type
- self.target = target
+ self.primary_ip = primary_ip
+ self.security_groups = security_groups
+ self.subnet = subnet
@classmethod
- def from_dict(cls, _dict: Dict) -> 'ReservedIP':
- """Initialize a ReservedIP object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'NetworkInterfacePrototype':
+ """Initialize a NetworkInterfacePrototype 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')
+ if (allow_ip_spoofing := _dict.get('allow_ip_spoofing')) is not None:
+ args['allow_ip_spoofing'] = allow_ip_spoofing
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ if (primary_ip := _dict.get('primary_ip')) is not None:
+ args['primary_ip'] = primary_ip
+ if (security_groups := _dict.get('security_groups')) is not None:
+ args['security_groups'] = security_groups
+ if (subnet := _dict.get('subnet')) is not None:
+ args['subnet'] = subnet
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 'lifecycle_state' in _dict:
- args['lifecycle_state'] = _dict.get('lifecycle_state')
- else:
- raise ValueError('Required property \'lifecycle_state\' not present in ReservedIP JSON')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
- else:
- raise ValueError('Required property \'name\' not present in 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')
+ raise ValueError('Required property \'subnet\' not present in NetworkInterfacePrototype JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a ReservedIP 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, 'address') and self.address is not None:
- _dict['address'] = self.address
- if hasattr(self, 'auto_delete') and self.auto_delete is not None:
- _dict['auto_delete'] = self.auto_delete
- if hasattr(self, 'created_at') and self.created_at is not None:
- _dict['created_at'] = datetime_to_string(self.created_at)
- if hasattr(self, 'href') and self.href is not None:
- _dict['href'] = self.href
- if hasattr(self, 'id') and self.id is not None:
- _dict['id'] = self.id
- if hasattr(self, 'lifecycle_state') and self.lifecycle_state is not None:
- _dict['lifecycle_state'] = self.lifecycle_state
+ if hasattr(self, '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, '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
+ if hasattr(self, 'primary_ip') and self.primary_ip is not None:
+ if isinstance(self.primary_ip, dict):
+ _dict['primary_ip'] = self.primary_ip
else:
- _dict['target'] = self.target.to_dict()
+ _dict['primary_ip'] = self.primary_ip.to_dict()
+ if hasattr(self, 'security_groups') and self.security_groups is not None:
+ security_groups_list = []
+ for v in self.security_groups:
+ if isinstance(v, dict):
+ security_groups_list.append(v)
+ else:
+ security_groups_list.append(v.to_dict())
+ _dict['security_groups'] = security_groups_list
+ if hasattr(self, 'subnet') and self.subnet is not None:
+ if isinstance(self.subnet, dict):
+ _dict['subnet'] = self.subnet
+ else:
+ _dict['subnet'] = self.subnet.to_dict()
return _dict
def _to_dict(self):
@@ -63762,148 +66903,59 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this ReservedIP object."""
+ """Return a `str` version of this NetworkInterfacePrototype object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'ReservedIP') -> 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: 'ReservedIP') -> bool:
+ def __ne__(self, other: 'NetworkInterfacePrototype') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class LifecycleStateEnum(str, Enum):
- """
- The lifecycle state of the reserved IP.
- """
-
- DELETING = 'deleting'
- FAILED = 'failed'
- PENDING = 'pending'
- STABLE = 'stable'
- SUSPENDED = 'suspended'
- UPDATING = 'updating'
- WAITING = 'waiting'
-
-
- class OwnerEnum(str, Enum):
- """
- The owner of the reserved IP.
- """
-
- PROVIDER = 'provider'
- USER = 'user'
-
-
- class ResourceTypeEnum(str, Enum):
- """
- The resource type.
- """
-
- SUBNET_RESERVED_IP = 'subnet_reserved_ip'
-
-
-class ReservedIPCollection:
+class NetworkInterfaceReferenceDeleted:
"""
- ReservedIPCollection.
+ If present, this property indicates the referenced resource has been deleted, and
+ provides some supplementary information.
- :attr ReservedIPCollectionFirst first: A link to the first page of resources.
- :attr int limit: The maximum number of resources that can be returned by the
- request.
- :attr ReservedIPCollectionNext next: (optional) A link to the next page of
- resources. This property is present for all pages
- except the last page.
- :attr List[ReservedIP] reserved_ips: Collection of reserved IPs in this subnet.
- :attr int total_count: The total number of resources across all pages.
+ :param str more_info: Link to documentation about deleted resources.
"""
def __init__(
self,
- first: 'ReservedIPCollectionFirst',
- limit: int,
- reserved_ips: List['ReservedIP'],
- total_count: int,
- *,
- next: 'ReservedIPCollectionNext' = None,
+ more_info: str,
) -> None:
"""
- Initialize a ReservedIPCollection object.
+ Initialize a NetworkInterfaceReferenceDeleted object.
- :param ReservedIPCollectionFirst first: A link to the first page of
- resources.
- :param int limit: The maximum number of resources that can be returned by
- the request.
- :param List[ReservedIP] reserved_ips: Collection of reserved IPs in this
- subnet.
- :param int total_count: The total number of resources across all pages.
- :param ReservedIPCollectionNext next: (optional) A link to the next page of
- resources. This property is present for all pages
- except the last page.
+ :param str more_info: Link to documentation about deleted resources.
"""
- self.first = first
- self.limit = limit
- self.next = next
- self.reserved_ips = reserved_ips
- self.total_count = total_count
+ self.more_info = more_info
@classmethod
- def from_dict(cls, _dict: Dict) -> 'ReservedIPCollection':
- """Initialize a ReservedIPCollection object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'NetworkInterfaceReferenceDeleted':
+ """Initialize a NetworkInterfaceReferenceDeleted object from a json dictionary."""
args = {}
- if 'first' in _dict:
- args['first'] = ReservedIPCollectionFirst.from_dict(_dict.get('first'))
- else:
- raise ValueError('Required property \'first\' not present in ReservedIPCollection JSON')
- if 'limit' in _dict:
- args['limit'] = _dict.get('limit')
- else:
- raise ValueError('Required property \'limit\' not present in ReservedIPCollection JSON')
- if 'next' in _dict:
- args['next'] = ReservedIPCollectionNext.from_dict(_dict.get('next'))
- if 'reserved_ips' in _dict:
- args['reserved_ips'] = [ReservedIP.from_dict(v) for v in _dict.get('reserved_ips')]
- else:
- raise ValueError('Required property \'reserved_ips\' not present in ReservedIPCollection JSON')
- if 'total_count' in _dict:
- args['total_count'] = _dict.get('total_count')
+ if (more_info := _dict.get('more_info')) is not None:
+ args['more_info'] = more_info
else:
- raise ValueError('Required property \'total_count\' not present in ReservedIPCollection JSON')
+ raise ValueError('Required property \'more_info\' not present in NetworkInterfaceReferenceDeleted JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a ReservedIPCollection 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, 'first') and self.first is not None:
- if isinstance(self.first, dict):
- _dict['first'] = self.first
- else:
- _dict['first'] = self.first.to_dict()
- if hasattr(self, 'limit') and self.limit is not None:
- _dict['limit'] = self.limit
- if hasattr(self, 'next') and self.next is not None:
- if isinstance(self.next, dict):
- _dict['next'] = self.next
- else:
- _dict['next'] = self.next.to_dict()
- if hasattr(self, 'reserved_ips') and self.reserved_ips is not None:
- reserved_ips_list = []
- for v in self.reserved_ips:
- if isinstance(v, dict):
- reserved_ips_list.append(v)
- else:
- reserved_ips_list.append(v.to_dict())
- _dict['reserved_ips'] = reserved_ips_list
- if hasattr(self, 'total_count') and self.total_count is not None:
- _dict['total_count'] = self.total_count
+ if hasattr(self, 'more_info') and self.more_info is not None:
+ _dict['more_info'] = self.more_info
return _dict
def _to_dict(self):
@@ -63911,121 +66963,59 @@ 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 NetworkInterfaceReferenceDeleted object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'ReservedIPCollection') -> 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: 'ReservedIPCollection') -> bool:
+ def __ne__(self, other: 'NetworkInterfaceReferenceDeleted') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class ReservedIPCollectionBareMetalServerNetworkInterfaceContext:
+class NetworkInterfaceReferenceTargetContextDeleted:
"""
- ReservedIPCollectionBareMetalServerNetworkInterfaceContext.
+ If present, this property indicates the referenced resource has been deleted, and
+ provides some supplementary information.
- :attr ReservedIPCollectionBareMetalServerNetworkInterfaceContextFirst first: A
- link to the first page of resources.
- :attr List[ReservedIP] ips: Collection of reserved IPs bound to a bare metal
- server network interface.
- :attr int limit: The maximum number of resources that can be returned by the
- request.
- :attr ReservedIPCollectionBareMetalServerNetworkInterfaceContextNext next:
- (optional) A link to the next page of resources. This property is present for
- all pages
- except the last page.
- :attr int total_count: The total number of resources across all pages.
+ :param str more_info: Link to documentation about deleted resources.
"""
def __init__(
self,
- first: 'ReservedIPCollectionBareMetalServerNetworkInterfaceContextFirst',
- ips: List['ReservedIP'],
- limit: int,
- total_count: int,
- *,
- next: 'ReservedIPCollectionBareMetalServerNetworkInterfaceContextNext' = None,
+ more_info: str,
) -> None:
"""
- Initialize a ReservedIPCollectionBareMetalServerNetworkInterfaceContext object.
+ Initialize a NetworkInterfaceReferenceTargetContextDeleted object.
- :param ReservedIPCollectionBareMetalServerNetworkInterfaceContextFirst
- first: A link to the first page of resources.
- :param List[ReservedIP] ips: Collection of reserved IPs bound to a bare
- metal server network interface.
- :param int limit: The maximum number of resources that can be returned by
- the request.
- :param int total_count: The total number of resources across all pages.
- :param ReservedIPCollectionBareMetalServerNetworkInterfaceContextNext next:
- (optional) A link to the next page of resources. This property is present
- for all pages
- except the last page.
+ :param str more_info: Link to documentation about deleted resources.
"""
- self.first = first
- self.ips = ips
- self.limit = limit
- self.next = next
- self.total_count = total_count
+ self.more_info = more_info
@classmethod
- def from_dict(cls, _dict: Dict) -> 'ReservedIPCollectionBareMetalServerNetworkInterfaceContext':
- """Initialize a ReservedIPCollectionBareMetalServerNetworkInterfaceContext 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'] = ReservedIPCollectionBareMetalServerNetworkInterfaceContextFirst.from_dict(_dict.get('first'))
+ if (more_info := _dict.get('more_info')) is not None:
+ args['more_info'] = more_info
else:
- raise ValueError('Required property \'first\' not present in ReservedIPCollectionBareMetalServerNetworkInterfaceContext JSON')
- if 'ips' in _dict:
- args['ips'] = [ReservedIP.from_dict(v) for v in _dict.get('ips')]
- else:
- raise ValueError('Required property \'ips\' not present in ReservedIPCollectionBareMetalServerNetworkInterfaceContext JSON')
- if 'limit' in _dict:
- args['limit'] = _dict.get('limit')
- else:
- raise ValueError('Required property \'limit\' not present in ReservedIPCollectionBareMetalServerNetworkInterfaceContext JSON')
- if 'next' in _dict:
- args['next'] = ReservedIPCollectionBareMetalServerNetworkInterfaceContextNext.from_dict(_dict.get('next'))
- if 'total_count' in _dict:
- args['total_count'] = _dict.get('total_count')
- else:
- raise ValueError('Required property \'total_count\' not present in ReservedIPCollectionBareMetalServerNetworkInterfaceContext JSON')
+ raise ValueError('Required property \'more_info\' not present in NetworkInterfaceReferenceTargetContextDeleted JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a ReservedIPCollectionBareMetalServerNetworkInterfaceContext 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:
- if isinstance(self.first, dict):
- _dict['first'] = self.first
- else:
- _dict['first'] = self.first.to_dict()
- if hasattr(self, 'ips') and self.ips is not None:
- ips_list = []
- for v in self.ips:
- if isinstance(v, dict):
- ips_list.append(v)
- else:
- ips_list.append(v.to_dict())
- _dict['ips'] = ips_list
- if hasattr(self, 'limit') and self.limit is not None:
- _dict['limit'] = self.limit
- if hasattr(self, 'next') and self.next is not None:
- if isinstance(self.next, dict):
- _dict['next'] = self.next
- else:
- _dict['next'] = self.next.to_dict()
- if hasattr(self, 'total_count') and self.total_count is not None:
- _dict['total_count'] = self.total_count
+ if hasattr(self, 'more_info') and self.more_info is not None:
+ _dict['more_info'] = self.more_info
return _dict
def _to_dict(self):
@@ -64033,58 +67023,66 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this ReservedIPCollectionBareMetalServerNetworkInterfaceContext object."""
+ """Return a `str` version of this NetworkInterfaceReferenceTargetContextDeleted object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'ReservedIPCollectionBareMetalServerNetworkInterfaceContext') -> 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: 'ReservedIPCollectionBareMetalServerNetworkInterfaceContext') -> bool:
+ def __ne__(self, other: 'NetworkInterfaceReferenceTargetContextDeleted') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class ReservedIPCollectionBareMetalServerNetworkInterfaceContextFirst:
+class NetworkInterfaceUnpaginatedCollection:
"""
- A link to the first page of resources.
+ NetworkInterfaceUnpaginatedCollection.
- :attr str href: The URL for a page of resources.
+ :param List[NetworkInterface] network_interfaces: Collection of instance network
+ interfaces.
"""
def __init__(
self,
- href: str,
+ network_interfaces: List['NetworkInterface'],
) -> None:
"""
- Initialize a ReservedIPCollectionBareMetalServerNetworkInterfaceContextFirst object.
+ Initialize a NetworkInterfaceUnpaginatedCollection object.
- :param str href: The URL for a page of resources.
+ :param List[NetworkInterface] network_interfaces: Collection of instance
+ network interfaces.
"""
- self.href = href
+ self.network_interfaces = network_interfaces
@classmethod
- def from_dict(cls, _dict: Dict) -> 'ReservedIPCollectionBareMetalServerNetworkInterfaceContextFirst':
- """Initialize a ReservedIPCollectionBareMetalServerNetworkInterfaceContextFirst 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 := _dict.get('network_interfaces')) is not None:
+ args['network_interfaces'] = [NetworkInterface.from_dict(v) for v in network_interfaces]
else:
- raise ValueError('Required property \'href\' not present in ReservedIPCollectionBareMetalServerNetworkInterfaceContextFirst JSON')
+ raise ValueError('Required property \'network_interfaces\' not present in NetworkInterfaceUnpaginatedCollection JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a ReservedIPCollectionBareMetalServerNetworkInterfaceContextFirst 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:
+ network_interfaces_list = []
+ for v in self.network_interfaces:
+ if isinstance(v, dict):
+ network_interfaces_list.append(v)
+ else:
+ network_interfaces_list.append(v.to_dict())
+ _dict['network_interfaces'] = network_interfaces_list
return _dict
def _to_dict(self):
@@ -64092,59 +67090,132 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this ReservedIPCollectionBareMetalServerNetworkInterfaceContextFirst object."""
+ """Return a `str` version of this NetworkInterfaceUnpaginatedCollection object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'ReservedIPCollectionBareMetalServerNetworkInterfaceContextFirst') -> 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: 'ReservedIPCollectionBareMetalServerNetworkInterfaceContextFirst') -> bool:
+ def __ne__(self, other: 'NetworkInterfaceUnpaginatedCollection') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class ReservedIPCollectionBareMetalServerNetworkInterfaceContextNext:
+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.
+ :param str architecture: The operating system architecture.
+ :param bool dedicated_host_only: Images with this operating system can only be
+ used on dedicated hosts or dedicated host groups.
+ :param str display_name: A unique, display-friendly name for the operating
+ system.
+ :param str family: The software family for this operating system.
+ :param str href: The URL for this operating system.
+ :param str name: The globally unique name for this operating system.
+ :param str vendor: The vendor of the operating system.
+ :param str version: The major release version of this operating system.
"""
def __init__(
self,
+ architecture: str,
+ dedicated_host_only: bool,
+ display_name: str,
+ family: str,
href: str,
+ name: str,
+ vendor: str,
+ version: str,
) -> None:
"""
- Initialize a ReservedIPCollectionBareMetalServerNetworkInterfaceContextNext 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 software family for this operating system.
+ :param str href: The URL for this operating system.
+ :param str name: The globally unique name for this operating system.
+ :param str vendor: The vendor of the operating system.
+ :param str version: The major release version of this operating system.
"""
+ self.architecture = architecture
+ self.dedicated_host_only = dedicated_host_only
+ self.display_name = display_name
+ self.family = family
self.href = href
+ self.name = name
+ self.vendor = vendor
+ self.version = version
@classmethod
- def from_dict(cls, _dict: Dict) -> 'ReservedIPCollectionBareMetalServerNetworkInterfaceContextNext':
- """Initialize a ReservedIPCollectionBareMetalServerNetworkInterfaceContextNext object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'OperatingSystem':
+ """Initialize a OperatingSystem object from a json dictionary."""
args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ if (architecture := _dict.get('architecture')) is not None:
+ args['architecture'] = architecture
else:
- raise ValueError('Required property \'href\' not present in ReservedIPCollectionBareMetalServerNetworkInterfaceContextNext JSON')
+ raise ValueError('Required property \'architecture\' not present in OperatingSystem JSON')
+ if (dedicated_host_only := _dict.get('dedicated_host_only')) is not None:
+ args['dedicated_host_only'] = dedicated_host_only
+ else:
+ raise ValueError('Required property \'dedicated_host_only\' not present in OperatingSystem JSON')
+ if (display_name := _dict.get('display_name')) is not None:
+ args['display_name'] = display_name
+ else:
+ raise ValueError('Required property \'display_name\' not present in OperatingSystem JSON')
+ if (family := _dict.get('family')) is not None:
+ args['family'] = family
+ else:
+ raise ValueError('Required property \'family\' not present in OperatingSystem JSON')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
+ else:
+ raise ValueError('Required property \'href\' not present in OperatingSystem JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ else:
+ raise ValueError('Required property \'name\' not present in OperatingSystem JSON')
+ if (vendor := _dict.get('vendor')) is not None:
+ args['vendor'] = vendor
+ else:
+ raise ValueError('Required property \'vendor\' not present in OperatingSystem JSON')
+ if (version := _dict.get('version')) is not None:
+ args['version'] = version
+ else:
+ raise ValueError('Required property \'version\' not present in OperatingSystem JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a ReservedIPCollectionBareMetalServerNetworkInterfaceContextNext 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):
@@ -64152,92 +67223,91 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this ReservedIPCollectionBareMetalServerNetworkInterfaceContextNext object."""
+ """Return a `str` version of this OperatingSystem object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'ReservedIPCollectionBareMetalServerNetworkInterfaceContextNext') -> 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: 'ReservedIPCollectionBareMetalServerNetworkInterfaceContextNext') -> bool:
+ def __ne__(self, other: 'OperatingSystem') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class ReservedIPCollectionEndpointGatewayContext:
+class OperatingSystemCollection:
"""
- ReservedIPCollectionEndpointGatewayContext.
+ OperatingSystemCollection.
- :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
+ :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.
- :attr ReservedIPCollectionEndpointGatewayContextNext next: (optional) A link to
- the next page of resources. This property is present for all pages
+ :param OperatingSystemCollectionNext next: (optional) A link to the next page of
+ resources. This property is present for all pages
except the last page.
- :attr int total_count: The total number of resources across all pages.
+ :param List[OperatingSystem] operating_systems: Collection of operating systems.
+ :param int total_count: The total number of resources across all pages.
"""
def __init__(
self,
- first: 'ReservedIPCollectionEndpointGatewayContextFirst',
- ips: List['ReservedIP'],
+ first: 'OperatingSystemCollectionFirst',
limit: int,
+ operating_systems: List['OperatingSystem'],
total_count: int,
*,
- next: 'ReservedIPCollectionEndpointGatewayContextNext' = None,
+ next: Optional['OperatingSystemCollectionNext'] = None,
) -> None:
"""
- Initialize a ReservedIPCollectionEndpointGatewayContext object.
+ Initialize a OperatingSystemCollection 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 OperatingSystemCollectionFirst first: A link to the first page of
+ resources.
:param int limit: The maximum number of resources that can be returned by
the request.
+ :param List[OperatingSystem] operating_systems: Collection of operating
+ systems.
:param int total_count: The total number of resources across all pages.
- :param ReservedIPCollectionEndpointGatewayContextNext next: (optional) A
- link to the next page of resources. This property is present for all pages
+ :param OperatingSystemCollectionNext next: (optional) A link to the next
+ page of resources. This property is present for all pages
except the last page.
"""
self.first = first
- self.ips = ips
self.limit = limit
self.next = next
+ self.operating_systems = operating_systems
self.total_count = total_count
@classmethod
- def from_dict(cls, _dict: Dict) -> 'ReservedIPCollectionEndpointGatewayContext':
- """Initialize a ReservedIPCollectionEndpointGatewayContext object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'OperatingSystemCollection':
+ """Initialize a OperatingSystemCollection object from a json dictionary."""
args = {}
- if 'first' in _dict:
- args['first'] = ReservedIPCollectionEndpointGatewayContextFirst.from_dict(_dict.get('first'))
+ if (first := _dict.get('first')) is not None:
+ args['first'] = OperatingSystemCollectionFirst.from_dict(first)
else:
- raise ValueError('Required property \'first\' not present in ReservedIPCollectionEndpointGatewayContext JSON')
- if 'ips' in _dict:
- args['ips'] = [ReservedIP.from_dict(v) for v in _dict.get('ips')]
+ raise ValueError('Required property \'first\' not present in OperatingSystemCollection JSON')
+ if (limit := _dict.get('limit')) is not None:
+ args['limit'] = limit
else:
- raise ValueError('Required property \'ips\' not present in ReservedIPCollectionEndpointGatewayContext JSON')
- if 'limit' in _dict:
- args['limit'] = _dict.get('limit')
+ raise ValueError('Required property \'limit\' not present in OperatingSystemCollection JSON')
+ if (next := _dict.get('next')) is not None:
+ args['next'] = OperatingSystemCollectionNext.from_dict(next)
+ if (operating_systems := _dict.get('operating_systems')) is not None:
+ args['operating_systems'] = [OperatingSystem.from_dict(v) for v in operating_systems]
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')
+ raise ValueError('Required property \'operating_systems\' not present in OperatingSystemCollection JSON')
+ if (total_count := _dict.get('total_count')) is not None:
+ args['total_count'] = total_count
else:
- raise ValueError('Required property \'total_count\' not present in ReservedIPCollectionEndpointGatewayContext JSON')
+ raise ValueError('Required property \'total_count\' not present in OperatingSystemCollection JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a ReservedIPCollectionEndpointGatewayContext object from a json dictionary."""
+ """Initialize a OperatingSystemCollection object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -64248,14 +67318,6 @@ def to_dict(self) -> Dict:
_dict['first'] = self.first
else:
_dict['first'] = self.first.to_dict()
- if hasattr(self, 'ips') and self.ips is not None:
- ips_list = []
- for v in self.ips:
- if isinstance(v, dict):
- ips_list.append(v)
- else:
- ips_list.append(v.to_dict())
- _dict['ips'] = ips_list
if hasattr(self, 'limit') and self.limit is not None:
_dict['limit'] = self.limit
if hasattr(self, 'next') and self.next is not None:
@@ -64263,6 +67325,14 @@ def to_dict(self) -> Dict:
_dict['next'] = self.next
else:
_dict['next'] = self.next.to_dict()
+ if hasattr(self, 'operating_systems') and self.operating_systems is not None:
+ operating_systems_list = []
+ for v in self.operating_systems:
+ if isinstance(v, dict):
+ operating_systems_list.append(v)
+ else:
+ operating_systems_list.append(v.to_dict())
+ _dict['operating_systems'] = operating_systems_list
if hasattr(self, 'total_count') and self.total_count is not None:
_dict['total_count'] = self.total_count
return _dict
@@ -64272,25 +67342,25 @@ 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 OperatingSystemCollection object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'ReservedIPCollectionEndpointGatewayContext') -> 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: 'ReservedIPCollectionEndpointGatewayContext') -> bool:
+ def __ne__(self, other: 'OperatingSystemCollection') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class ReservedIPCollectionEndpointGatewayContextFirst:
+class OperatingSystemCollectionFirst:
"""
A link to the first page of resources.
- :attr str href: The URL for a page of resources.
+ :param str href: The URL for a page of resources.
"""
def __init__(
@@ -64298,25 +67368,25 @@ def __init__(
href: str,
) -> None:
"""
- Initialize a ReservedIPCollectionEndpointGatewayContextFirst object.
+ Initialize a OperatingSystemCollectionFirst 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) -> 'OperatingSystemCollectionFirst':
+ """Initialize a OperatingSystemCollectionFirst object from a json dictionary."""
args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'href\' not present in ReservedIPCollectionEndpointGatewayContextFirst JSON')
+ raise ValueError('Required property \'href\' not present in OperatingSystemCollectionFirst JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a ReservedIPCollectionEndpointGatewayContextFirst object from a json dictionary."""
+ """Initialize a OperatingSystemCollectionFirst object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -64331,26 +67401,26 @@ 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 OperatingSystemCollectionFirst object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'ReservedIPCollectionEndpointGatewayContextFirst') -> 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: 'ReservedIPCollectionEndpointGatewayContextFirst') -> bool:
+ def __ne__(self, other: 'OperatingSystemCollectionFirst') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class ReservedIPCollectionEndpointGatewayContextNext:
+class OperatingSystemCollectionNext:
"""
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.
+ :param str href: The URL for a page of resources.
"""
def __init__(
@@ -64358,25 +67428,25 @@ def __init__(
href: str,
) -> None:
"""
- Initialize a ReservedIPCollectionEndpointGatewayContextNext object.
+ Initialize a OperatingSystemCollectionNext object.
:param str href: The URL for a page of resources.
"""
self.href = href
@classmethod
- def from_dict(cls, _dict: Dict) -> 'ReservedIPCollectionEndpointGatewayContextNext':
- """Initialize a ReservedIPCollectionEndpointGatewayContextNext object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'OperatingSystemCollectionNext':
+ """Initialize a OperatingSystemCollectionNext object from a json dictionary."""
args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'href\' not present in ReservedIPCollectionEndpointGatewayContextNext JSON')
+ raise ValueError('Required property \'href\' not present in OperatingSystemCollectionNext JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a ReservedIPCollectionEndpointGatewayContextNext object from a json dictionary."""
+ """Initialize a OperatingSystemCollectionNext object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -64391,58 +67461,178 @@ 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 OperatingSystemCollectionNext object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'ReservedIPCollectionEndpointGatewayContextNext') -> 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: 'ReservedIPCollectionEndpointGatewayContextNext') -> bool:
+ def __ne__(self, other: 'OperatingSystemCollectionNext') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class ReservedIPCollectionFirst:
+class OperatingSystemIdentity:
"""
- A link to the first page of resources.
+ Identifies an operating system by a unique property.
+
+ """
+
+ def __init__(
+ self,
+ ) -> None:
+ """
+ Initialize a OperatingSystemIdentity object.
+
+ """
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['OperatingSystemIdentityByName', 'OperatingSystemIdentityByHref'])
+ )
+ raise Exception(msg)
+
+
+class PlacementGroup:
+ """
+ PlacementGroup.
- :attr str href: The URL for a page of resources.
+ :param datetime created_at: The date and time that the placement group was
+ created.
+ :param str crn: The CRN for this placement group.
+ :param str href: The URL for this placement group.
+ :param str id: The unique identifier for this placement group.
+ :param str lifecycle_state: The lifecycle state of the placement group.
+ :param str name: The name for this placement group. The name is unique across
+ all placement groups in the region.
+ :param ResourceGroupReference resource_group: The resource group for this
+ placement group.
+ :param str resource_type: The resource type.
+ :param str strategy: The strategy for this placement group
+ - `host_spread`: place on different compute hosts
+ - `power_spread`: place on compute hosts that use different power sources
+ The enumerated values for this property may expand in the future. When
+ processing this property, check for and log unknown values. Optionally halt
+ processing and surface the error, or bypass the placement group on which the
+ unexpected strategy was encountered.
"""
def __init__(
self,
+ created_at: datetime,
+ crn: str,
href: str,
+ id: str,
+ lifecycle_state: str,
+ name: str,
+ resource_group: 'ResourceGroupReference',
+ resource_type: str,
+ strategy: str,
) -> None:
"""
- Initialize a ReservedIPCollectionFirst object.
+ Initialize a PlacementGroup object.
- :param str href: The URL for a page of resources.
+ :param datetime created_at: The date and time that the placement group was
+ created.
+ :param str crn: The CRN for this placement group.
+ :param str href: The URL for this placement group.
+ :param str id: The unique identifier for this placement group.
+ :param str lifecycle_state: The lifecycle state of the placement group.
+ :param str name: The name for this placement group. The name is unique
+ across all placement groups in the region.
+ :param ResourceGroupReference resource_group: The resource group for this
+ placement group.
+ :param str resource_type: The resource type.
+ :param str strategy: The strategy for this placement group
+ - `host_spread`: place on different compute hosts
+ - `power_spread`: place on compute hosts that use different power sources
+ The enumerated values for this property may expand in the future. When
+ processing this property, check for and log unknown values. Optionally halt
+ processing and surface the error, or bypass the placement group on which
+ the unexpected strategy was encountered.
"""
+ self.created_at = created_at
+ self.crn = crn
self.href = href
+ self.id = id
+ self.lifecycle_state = lifecycle_state
+ self.name = name
+ self.resource_group = resource_group
+ self.resource_type = resource_type
+ self.strategy = strategy
@classmethod
- def from_dict(cls, _dict: Dict) -> 'ReservedIPCollectionFirst':
- """Initialize a ReservedIPCollectionFirst object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'PlacementGroup':
+ """Initialize a PlacementGroup object from a json dictionary."""
args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ if (created_at := _dict.get('created_at')) is not None:
+ args['created_at'] = string_to_datetime(created_at)
else:
- raise ValueError('Required property \'href\' not present in ReservedIPCollectionFirst JSON')
+ raise ValueError('Required property \'created_at\' not present in PlacementGroup JSON')
+ if (crn := _dict.get('crn')) is not None:
+ args['crn'] = crn
+ else:
+ raise ValueError('Required property \'crn\' not present in PlacementGroup JSON')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
+ else:
+ raise ValueError('Required property \'href\' not present in PlacementGroup JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
+ else:
+ raise ValueError('Required property \'id\' not present in PlacementGroup JSON')
+ if (lifecycle_state := _dict.get('lifecycle_state')) is not None:
+ args['lifecycle_state'] = lifecycle_state
+ else:
+ raise ValueError('Required property \'lifecycle_state\' not present in PlacementGroup JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ else:
+ raise ValueError('Required property \'name\' not present in PlacementGroup JSON')
+ if (resource_group := _dict.get('resource_group')) is not None:
+ args['resource_group'] = ResourceGroupReference.from_dict(resource_group)
+ else:
+ raise ValueError('Required property \'resource_group\' not present in PlacementGroup JSON')
+ if (resource_type := _dict.get('resource_type')) is not None:
+ args['resource_type'] = resource_type
+ else:
+ raise ValueError('Required property \'resource_type\' not present in PlacementGroup JSON')
+ if (strategy := _dict.get('strategy')) is not None:
+ args['strategy'] = strategy
+ else:
+ raise ValueError('Required property \'strategy\' not present in PlacementGroup JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a ReservedIPCollectionFirst object from a json dictionary."""
+ """Initialize a PlacementGroup object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
+ if hasattr(self, 'created_at') and self.created_at is not None:
+ _dict['created_at'] = datetime_to_string(self.created_at)
+ if hasattr(self, 'crn') and self.crn is not None:
+ _dict['crn'] = self.crn
if hasattr(self, 'href') and self.href is not None:
_dict['href'] = self.href
+ if hasattr(self, 'id') and self.id is not None:
+ _dict['id'] = self.id
+ if hasattr(self, 'lifecycle_state') and self.lifecycle_state is not None:
+ _dict['lifecycle_state'] = self.lifecycle_state
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ if hasattr(self, 'resource_group') and self.resource_group is not None:
+ if isinstance(self.resource_group, dict):
+ _dict['resource_group'] = self.resource_group
+ else:
+ _dict['resource_group'] = self.resource_group.to_dict()
+ if hasattr(self, 'resource_type') and self.resource_type is not None:
+ _dict['resource_type'] = self.resource_type
+ if hasattr(self, 'strategy') and self.strategy is not None:
+ _dict['strategy'] = self.strategy
return _dict
def _to_dict(self):
@@ -64450,93 +67640,128 @@ 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 PlacementGroup object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'ReservedIPCollectionFirst') -> 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: 'ReservedIPCollectionFirst') -> bool:
+ def __ne__(self, other: 'PlacementGroup') -> 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.
+ """
-class ReservedIPCollectionInstanceNetworkInterfaceContext:
+ 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:
"""
- ReservedIPCollectionInstanceNetworkInterfaceContext.
+ PlacementGroupCollection.
- :attr ReservedIPCollectionInstanceNetworkInterfaceContextFirst first: A link to
- the first page of resources.
- :attr List[ReservedIP] ips: Collection of reserved IPs bound to an instance
- network interface.
- :attr int limit: The maximum number of resources that can be returned by the
+ :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.
- :attr ReservedIPCollectionInstanceNetworkInterfaceContextNext 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.
- :attr int total_count: The total number of resources across all pages.
+ :param List[PlacementGroup] placement_groups: Collection of placement groups.
+ :param int total_count: The total number of resources across all pages.
"""
def __init__(
self,
- first: 'ReservedIPCollectionInstanceNetworkInterfaceContextFirst',
- ips: List['ReservedIP'],
+ first: 'PlacementGroupCollectionFirst',
limit: int,
+ placement_groups: List['PlacementGroup'],
total_count: int,
*,
- next: 'ReservedIPCollectionInstanceNetworkInterfaceContextNext' = None,
+ next: Optional['PlacementGroupCollectionNext'] = None,
) -> None:
"""
- Initialize a ReservedIPCollectionInstanceNetworkInterfaceContext object.
+ Initialize a PlacementGroupCollection object.
- :param ReservedIPCollectionInstanceNetworkInterfaceContextFirst first: A
- link to the first page of resources.
- :param List[ReservedIP] ips: Collection of reserved IPs bound to an
- instance network interface.
+ :param PlacementGroupCollectionFirst first: A link to the first page of
+ resources.
:param int limit: The maximum number of resources that can be returned by
the request.
+ :param List[PlacementGroup] placement_groups: Collection of placement
+ groups.
:param int total_count: The total number of resources across all pages.
- :param ReservedIPCollectionInstanceNetworkInterfaceContextNext 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.ips = ips
self.limit = limit
self.next = next
+ self.placement_groups = placement_groups
self.total_count = total_count
@classmethod
- def from_dict(cls, _dict: Dict) -> 'ReservedIPCollectionInstanceNetworkInterfaceContext':
- """Initialize a ReservedIPCollectionInstanceNetworkInterfaceContext 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'] = ReservedIPCollectionInstanceNetworkInterfaceContextFirst.from_dict(_dict.get('first'))
+ if (first := _dict.get('first')) is not None:
+ args['first'] = PlacementGroupCollectionFirst.from_dict(first)
else:
- raise ValueError('Required property \'first\' not present in ReservedIPCollectionInstanceNetworkInterfaceContext JSON')
- if 'ips' in _dict:
- args['ips'] = [ReservedIP.from_dict(v) for v in _dict.get('ips')]
+ raise ValueError('Required property \'first\' not present in PlacementGroupCollection JSON')
+ if (limit := _dict.get('limit')) is not None:
+ args['limit'] = limit
else:
- raise ValueError('Required property \'ips\' not present in ReservedIPCollectionInstanceNetworkInterfaceContext JSON')
- if 'limit' in _dict:
- args['limit'] = _dict.get('limit')
+ raise ValueError('Required property \'limit\' not present in PlacementGroupCollection JSON')
+ if (next := _dict.get('next')) is not None:
+ args['next'] = PlacementGroupCollectionNext.from_dict(next)
+ if (placement_groups := _dict.get('placement_groups')) is not None:
+ args['placement_groups'] = [PlacementGroup.from_dict(v) for v in placement_groups]
else:
- raise ValueError('Required property \'limit\' not present in ReservedIPCollectionInstanceNetworkInterfaceContext JSON')
- if 'next' in _dict:
- args['next'] = ReservedIPCollectionInstanceNetworkInterfaceContextNext.from_dict(_dict.get('next'))
- if 'total_count' in _dict:
- args['total_count'] = _dict.get('total_count')
+ raise ValueError('Required property \'placement_groups\' not present in PlacementGroupCollection JSON')
+ if (total_count := _dict.get('total_count')) is not None:
+ args['total_count'] = total_count
else:
- raise ValueError('Required property \'total_count\' not present in ReservedIPCollectionInstanceNetworkInterfaceContext JSON')
+ raise ValueError('Required property \'total_count\' not present in PlacementGroupCollection JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a ReservedIPCollectionInstanceNetworkInterfaceContext object from a json dictionary."""
+ """Initialize a PlacementGroupCollection object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -64547,14 +67772,6 @@ def to_dict(self) -> Dict:
_dict['first'] = self.first
else:
_dict['first'] = self.first.to_dict()
- if hasattr(self, 'ips') and self.ips is not None:
- ips_list = []
- for v in self.ips:
- if isinstance(v, dict):
- ips_list.append(v)
- else:
- ips_list.append(v.to_dict())
- _dict['ips'] = ips_list
if hasattr(self, 'limit') and self.limit is not None:
_dict['limit'] = self.limit
if hasattr(self, 'next') and self.next is not None:
@@ -64562,6 +67779,14 @@ def to_dict(self) -> Dict:
_dict['next'] = self.next
else:
_dict['next'] = self.next.to_dict()
+ if hasattr(self, 'placement_groups') and self.placement_groups is not None:
+ placement_groups_list = []
+ for v in self.placement_groups:
+ if isinstance(v, dict):
+ placement_groups_list.append(v)
+ else:
+ placement_groups_list.append(v.to_dict())
+ _dict['placement_groups'] = placement_groups_list
if hasattr(self, 'total_count') and self.total_count is not None:
_dict['total_count'] = self.total_count
return _dict
@@ -64571,25 +67796,25 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this ReservedIPCollectionInstanceNetworkInterfaceContext object."""
+ """Return a `str` version of this PlacementGroupCollection object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'ReservedIPCollectionInstanceNetworkInterfaceContext') -> 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: 'ReservedIPCollectionInstanceNetworkInterfaceContext') -> bool:
+ def __ne__(self, other: 'PlacementGroupCollection') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class ReservedIPCollectionInstanceNetworkInterfaceContextFirst:
+class PlacementGroupCollectionFirst:
"""
A link to the first page of resources.
- :attr str href: The URL for a page of resources.
+ :param str href: The URL for a page of resources.
"""
def __init__(
@@ -64597,25 +67822,25 @@ def __init__(
href: str,
) -> None:
"""
- Initialize a ReservedIPCollectionInstanceNetworkInterfaceContextFirst 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) -> 'ReservedIPCollectionInstanceNetworkInterfaceContextFirst':
- """Initialize a ReservedIPCollectionInstanceNetworkInterfaceContextFirst 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')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'href\' not present in ReservedIPCollectionInstanceNetworkInterfaceContextFirst JSON')
+ raise ValueError('Required property \'href\' not present in PlacementGroupCollectionFirst JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a ReservedIPCollectionInstanceNetworkInterfaceContextFirst object from a json dictionary."""
+ """Initialize a PlacementGroupCollectionFirst object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -64630,26 +67855,26 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this ReservedIPCollectionInstanceNetworkInterfaceContextFirst object."""
+ """Return a `str` version of this PlacementGroupCollectionFirst object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'ReservedIPCollectionInstanceNetworkInterfaceContextFirst') -> 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: 'ReservedIPCollectionInstanceNetworkInterfaceContextFirst') -> bool:
+ def __ne__(self, other: 'PlacementGroupCollectionFirst') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class ReservedIPCollectionInstanceNetworkInterfaceContextNext:
+class PlacementGroupCollectionNext:
"""
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.
+ :param str href: The URL for a page of resources.
"""
def __init__(
@@ -64657,25 +67882,25 @@ def __init__(
href: str,
) -> None:
"""
- Initialize a ReservedIPCollectionInstanceNetworkInterfaceContextNext object.
+ Initialize a PlacementGroupCollectionNext object.
:param str href: The URL for a page of resources.
"""
self.href = href
@classmethod
- def from_dict(cls, _dict: Dict) -> 'ReservedIPCollectionInstanceNetworkInterfaceContextNext':
- """Initialize a ReservedIPCollectionInstanceNetworkInterfaceContextNext object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'PlacementGroupCollectionNext':
+ """Initialize a PlacementGroupCollectionNext object from a json dictionary."""
args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'href\' not present in ReservedIPCollectionInstanceNetworkInterfaceContextNext JSON')
+ raise ValueError('Required property \'href\' not present in PlacementGroupCollectionNext JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a ReservedIPCollectionInstanceNetworkInterfaceContextNext object from a json dictionary."""
+ """Initialize a PlacementGroupCollectionNext object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -64690,59 +67915,59 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this ReservedIPCollectionInstanceNetworkInterfaceContextNext object."""
+ """Return a `str` version of this PlacementGroupCollectionNext object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'ReservedIPCollectionInstanceNetworkInterfaceContextNext') -> 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: 'ReservedIPCollectionInstanceNetworkInterfaceContextNext') -> bool:
+ def __ne__(self, other: 'PlacementGroupCollectionNext') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class ReservedIPCollectionNext:
+class PlacementGroupPatch:
"""
- A link to the next page of resources. This property is present for all pages except
- the last page.
+ PlacementGroupPatch.
- :attr str href: The URL for a page of resources.
+ :param str name: (optional) The name for this placement group. The name must not
+ be used by another placement group in the region.
"""
def __init__(
self,
- href: str,
+ *,
+ name: Optional[str] = None,
) -> None:
"""
- Initialize a ReservedIPCollectionNext object.
+ Initialize a PlacementGroupPatch object.
- :param str href: The URL for a page of resources.
+ :param str name: (optional) The name for this placement group. The name
+ must not be used by another placement group in the region.
"""
- self.href = href
+ self.name = name
@classmethod
- def from_dict(cls, _dict: Dict) -> 'ReservedIPCollectionNext':
- """Initialize a ReservedIPCollectionNext object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'PlacementGroupPatch':
+ """Initialize a PlacementGroupPatch object from a json dictionary."""
args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
- else:
- raise ValueError('Required property \'href\' not present in ReservedIPCollectionNext JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a ReservedIPCollectionNext 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, '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):
@@ -64750,75 +67975,59 @@ 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 PlacementGroupPatch object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'ReservedIPCollectionNext') -> 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: 'ReservedIPCollectionNext') -> bool:
+ def __ne__(self, other: 'PlacementGroupPatch') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class ReservedIPPatch:
+class PlacementGroupReferenceDeleted:
"""
- ReservedIPPatch.
+ If present, this property indicates the referenced resource has been deleted, and
+ provides some supplementary information.
- :attr bool auto_delete: (optional) Indicates whether this reserved IP member
- will be automatically deleted when either
- `target` is deleted, or the reserved IP is unbound. Must be `false` if the
- reserved IP is unbound.
- :attr str name: (optional) The name for this reserved IP. The name must not be
- used by another reserved IP in the subnet. Names starting with `ibm-` are
- reserved for provider-owned resources, and are not allowed.
+ :param str more_info: Link to documentation about deleted resources.
"""
def __init__(
self,
- *,
- auto_delete: bool = None,
- name: str = None,
+ more_info: str,
) -> None:
"""
- Initialize a ReservedIPPatch object.
+ Initialize a PlacementGroupReferenceDeleted object.
- :param bool auto_delete: (optional) Indicates whether this reserved IP
- member will be automatically deleted when either
- `target` is deleted, or the reserved IP is unbound. Must be `false` if the
- reserved IP is unbound.
- :param str name: (optional) The name for this reserved IP. The name must
- not be used by another reserved IP in the subnet. Names starting with
- `ibm-` are reserved for provider-owned resources, and are not allowed.
+ :param str more_info: Link to documentation about deleted resources.
"""
- self.auto_delete = auto_delete
- self.name = name
+ self.more_info = more_info
@classmethod
- def from_dict(cls, _dict: Dict) -> 'ReservedIPPatch':
- """Initialize a ReservedIPPatch object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'PlacementGroupReferenceDeleted':
+ """Initialize a PlacementGroupReferenceDeleted 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')
+ if (more_info := _dict.get('more_info')) is not None:
+ args['more_info'] = more_info
+ else:
+ raise ValueError('Required property \'more_info\' not present in PlacementGroupReferenceDeleted JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a ReservedIPPatch object from a json dictionary."""
+ """Initialize a PlacementGroupReferenceDeleted object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'auto_delete') and self.auto_delete is not None:
- _dict['auto_delete'] = self.auto_delete
- if hasattr(self, 'name') and self.name is not None:
- _dict['name'] = self.name
+ if hasattr(self, 'more_info') and self.more_info is not None:
+ _dict['more_info'] = self.more_info
return _dict
def _to_dict(self):
@@ -64826,144 +68035,195 @@ 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 PlacementGroupReferenceDeleted object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'ReservedIPPatch') -> 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: 'ReservedIPPatch') -> bool:
+ def __ne__(self, other: 'PlacementGroupReferenceDeleted') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class ReservedIPReference:
+class PublicGateway:
"""
- ReservedIPReference.
+ PublicGateway.
- :attr str address: The IP address.
- If the address has not yet been selected, the value will be `0.0.0.0`.
- This property may add support for IPv6 addresses in the future. When processing
- a value in this property, verify that the address is in an expected format. If
- it is not, log an error. Optionally halt processing and surface the error, or
- bypass the resource on which the unexpected IP address format was encountered.
- :attr ReservedIPReferenceDeleted deleted: (optional) If present, this property
- indicates the referenced resource has been deleted, and provides
- some supplementary information.
- :attr str href: The URL for this reserved IP.
- :attr str id: The unique identifier for this reserved IP.
- :attr str name: The name for this reserved IP. The name is unique across all
- reserved IPs in a subnet.
- :attr str resource_type: The resource type.
+ :param datetime created_at: The date and time that the public gateway was
+ created.
+ :param str crn: The CRN for this public gateway.
+ :param PublicGatewayFloatingIp floating_ip: The floating IP bound to this public
+ gateway.
+ :param str href: The URL for this public gateway.
+ :param str id: The unique identifier for this public gateway.
+ :param str name: The name for this public gateway. The name is unique across all
+ public gateways in the VPC.
+ :param ResourceGroupReference resource_group: The resource group for this public
+ gateway.
+ :param str resource_type: The resource type.
+ :param str status: The status of this public gateway.
+ :param VPCReference vpc: The VPC this public gateway resides in.
+ :param ZoneReference zone: The zone this public gateway resides in.
"""
def __init__(
self,
- address: str,
+ created_at: datetime,
+ crn: str,
+ floating_ip: 'PublicGatewayFloatingIp',
href: str,
id: str,
name: str,
+ resource_group: 'ResourceGroupReference',
resource_type: str,
- *,
- deleted: 'ReservedIPReferenceDeleted' = None,
+ status: str,
+ vpc: 'VPCReference',
+ zone: 'ZoneReference',
) -> None:
"""
- Initialize a ReservedIPReference object.
+ Initialize a PublicGateway object.
- :param str address: The IP address.
- If the address has not yet been selected, the value will be `0.0.0.0`.
- This property may add support for IPv6 addresses in the future. When
- processing a value in this property, verify that the address is in an
- expected format. If it is not, log an error. Optionally halt processing and
- surface the error, or bypass the resource on which the unexpected IP
- address format was encountered.
- :param str href: The URL for this reserved IP.
- :param str id: The unique identifier for this reserved IP.
- :param str name: The name for this reserved IP. The name is unique across
- all reserved IPs in a subnet.
+ :param datetime created_at: The date and time that the public gateway was
+ created.
+ :param str crn: The CRN for this public gateway.
+ :param PublicGatewayFloatingIp floating_ip: The floating IP bound to this
+ public gateway.
+ :param str href: The URL for this public gateway.
+ :param str id: The unique identifier for this public gateway.
+ :param str name: The name for this public gateway. The name is unique
+ across all public gateways in the VPC.
+ :param ResourceGroupReference resource_group: The resource group for this
+ public gateway.
:param str resource_type: The resource type.
- :param ReservedIPReferenceDeleted deleted: (optional) If present, this
- property indicates the referenced resource has been deleted, and provides
- some supplementary information.
+ :param str status: The status of this public gateway.
+ :param VPCReference vpc: The VPC this public gateway resides in.
+ :param ZoneReference zone: The zone this public gateway resides in.
"""
- self.address = address
- self.deleted = deleted
+ 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) -> 'ReservedIPReference':
- """Initialize a ReservedIPReference object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'PublicGateway':
+ """Initialize a PublicGateway object from a json dictionary."""
args = {}
- if 'address' in _dict:
- args['address'] = _dict.get('address')
+ if (created_at := _dict.get('created_at')) is not None:
+ args['created_at'] = string_to_datetime(created_at)
else:
- raise ValueError('Required property \'address\' not present in ReservedIPReference JSON')
- if 'deleted' in _dict:
- args['deleted'] = ReservedIPReferenceDeleted.from_dict(_dict.get('deleted'))
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ raise ValueError('Required property \'created_at\' not present in PublicGateway JSON')
+ if (crn := _dict.get('crn')) is not None:
+ args['crn'] = crn
else:
- raise ValueError('Required property \'href\' not present in ReservedIPReference JSON')
- if 'id' in _dict:
- args['id'] = _dict.get('id')
+ raise ValueError('Required property \'crn\' not present in PublicGateway JSON')
+ if (floating_ip := _dict.get('floating_ip')) is not None:
+ args['floating_ip'] = PublicGatewayFloatingIp.from_dict(floating_ip)
else:
- raise ValueError('Required property \'id\' not present in ReservedIPReference JSON')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
+ raise ValueError('Required property \'floating_ip\' not present in PublicGateway JSON')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'name\' not present in ReservedIPReference JSON')
- if 'resource_type' in _dict:
- args['resource_type'] = _dict.get('resource_type')
+ raise ValueError('Required property \'href\' not present in PublicGateway JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
else:
- raise ValueError('Required property \'resource_type\' not present in ReservedIPReference JSON')
+ raise ValueError('Required property \'id\' not present in PublicGateway JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ else:
+ raise ValueError('Required property \'name\' not present in PublicGateway JSON')
+ if (resource_group := _dict.get('resource_group')) is not None:
+ args['resource_group'] = ResourceGroupReference.from_dict(resource_group)
+ else:
+ raise ValueError('Required property \'resource_group\' not present in PublicGateway JSON')
+ if (resource_type := _dict.get('resource_type')) is not None:
+ args['resource_type'] = resource_type
+ else:
+ raise ValueError('Required property \'resource_type\' not present in PublicGateway JSON')
+ if (status := _dict.get('status')) is not None:
+ args['status'] = status
+ else:
+ raise ValueError('Required property \'status\' not present in PublicGateway JSON')
+ if (vpc := _dict.get('vpc')) is not None:
+ args['vpc'] = VPCReference.from_dict(vpc)
+ else:
+ raise ValueError('Required property \'vpc\' not present in PublicGateway JSON')
+ if (zone := _dict.get('zone')) is not None:
+ args['zone'] = ZoneReference.from_dict(zone)
+ else:
+ raise ValueError('Required property \'zone\' not present in PublicGateway JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a ReservedIPReference object from a json dictionary."""
+ """Initialize a PublicGateway object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'address') and self.address is not None:
- _dict['address'] = self.address
- if hasattr(self, 'deleted') and self.deleted is not None:
- if isinstance(self.deleted, dict):
- _dict['deleted'] = self.deleted
+ if hasattr(self, 'created_at') and self.created_at is not None:
+ _dict['created_at'] = datetime_to_string(self.created_at)
+ if hasattr(self, 'crn') and self.crn is not None:
+ _dict['crn'] = self.crn
+ if hasattr(self, 'floating_ip') and self.floating_ip is not None:
+ if isinstance(self.floating_ip, dict):
+ _dict['floating_ip'] = self.floating_ip
else:
- _dict['deleted'] = self.deleted.to_dict()
+ _dict['floating_ip'] = self.floating_ip.to_dict()
if hasattr(self, 'href') and self.href is not None:
_dict['href'] = self.href
if hasattr(self, 'id') and self.id is not None:
_dict['id'] = self.id
if hasattr(self, 'name') and self.name is not None:
_dict['name'] = self.name
+ if hasattr(self, 'resource_group') and self.resource_group is not None:
+ if isinstance(self.resource_group, dict):
+ _dict['resource_group'] = self.resource_group
+ else:
+ _dict['resource_group'] = self.resource_group.to_dict()
if hasattr(self, 'resource_type') and self.resource_type is not None:
_dict['resource_type'] = self.resource_type
- return _dict
-
- def _to_dict(self):
+ if hasattr(self, 'status') and self.status is not None:
+ _dict['status'] = self.status
+ if hasattr(self, 'vpc') and self.vpc is not None:
+ if isinstance(self.vpc, dict):
+ _dict['vpc'] = self.vpc
+ else:
+ _dict['vpc'] = self.vpc.to_dict()
+ if hasattr(self, 'zone') and self.zone is not None:
+ if isinstance(self.zone, dict):
+ _dict['zone'] = self.zone
+ else:
+ _dict['zone'] = self.zone.to_dict()
+ return _dict
+
+ def _to_dict(self):
"""Return a json dictionary representing this model."""
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this ReservedIPReference object."""
+ """Return a `str` version of this PublicGateway object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'ReservedIPReference') -> bool:
+ def __eq__(self, other: 'PublicGateway') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'ReservedIPReference') -> bool:
+ def __ne__(self, other: 'PublicGateway') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
@@ -64972,49 +68232,118 @@ class ResourceTypeEnum(str, Enum):
The resource type.
"""
- SUBNET_RESERVED_IP = 'subnet_reserved_ip'
+ PUBLIC_GATEWAY = 'public_gateway'
+ class StatusEnum(str, Enum):
+ """
+ The status of this public gateway.
+ """
-class ReservedIPReferenceDeleted:
+ AVAILABLE = 'available'
+ DELETING = 'deleting'
+ FAILED = 'failed'
+ PENDING = 'pending'
+
+
+
+class PublicGatewayCollection:
"""
- If present, this property indicates the referenced resource has been deleted, and
- provides some supplementary information.
+ PublicGatewayCollection.
- :attr str more_info: Link to documentation about deleted resources.
+ :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 PublicGatewayCollectionNext next: (optional) A link to the next page of
+ resources. This property is present for all pages
+ except the last page.
+ :param List[PublicGateway] public_gateways: Collection of public gateways.
+ :param int total_count: The total number of resources across all pages.
"""
def __init__(
self,
- more_info: str,
+ first: 'PublicGatewayCollectionFirst',
+ limit: int,
+ public_gateways: List['PublicGateway'],
+ total_count: int,
+ *,
+ next: Optional['PublicGatewayCollectionNext'] = None,
) -> None:
"""
- Initialize a ReservedIPReferenceDeleted object.
+ Initialize a PublicGatewayCollection object.
- :param str more_info: Link to documentation about deleted resources.
+ :param PublicGatewayCollectionFirst first: A link to the first page of
+ resources.
+ :param int limit: The maximum number of resources that can be returned by
+ the request.
+ :param List[PublicGateway] public_gateways: Collection of public gateways.
+ :param int total_count: The total number of resources across all pages.
+ :param PublicGatewayCollectionNext next: (optional) A link to the next page
+ of resources. This property is present for all pages
+ except the last page.
"""
- self.more_info = more_info
+ self.first = first
+ self.limit = limit
+ self.next = next
+ self.public_gateways = public_gateways
+ self.total_count = total_count
@classmethod
- def from_dict(cls, _dict: Dict) -> 'ReservedIPReferenceDeleted':
- """Initialize a ReservedIPReferenceDeleted object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'PublicGatewayCollection':
+ """Initialize a PublicGatewayCollection object from a json dictionary."""
args = {}
- if 'more_info' in _dict:
- args['more_info'] = _dict.get('more_info')
+ if (first := _dict.get('first')) is not None:
+ args['first'] = PublicGatewayCollectionFirst.from_dict(first)
else:
- raise ValueError('Required property \'more_info\' not present in ReservedIPReferenceDeleted JSON')
+ raise ValueError('Required property \'first\' not present in PublicGatewayCollection JSON')
+ if (limit := _dict.get('limit')) is not None:
+ args['limit'] = limit
+ else:
+ raise ValueError('Required property \'limit\' not present in PublicGatewayCollection JSON')
+ if (next := _dict.get('next')) is not None:
+ args['next'] = PublicGatewayCollectionNext.from_dict(next)
+ if (public_gateways := _dict.get('public_gateways')) is not None:
+ args['public_gateways'] = [PublicGateway.from_dict(v) for v in public_gateways]
+ else:
+ raise ValueError('Required property \'public_gateways\' not present in PublicGatewayCollection JSON')
+ if (total_count := _dict.get('total_count')) is not None:
+ args['total_count'] = total_count
+ else:
+ raise ValueError('Required property \'total_count\' not present in PublicGatewayCollection JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a ReservedIPReferenceDeleted object from a json dictionary."""
+ """Initialize a PublicGatewayCollection object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'more_info') and self.more_info is not None:
- _dict['more_info'] = self.more_info
+ if hasattr(self, 'first') and self.first is not None:
+ if isinstance(self.first, dict):
+ _dict['first'] = self.first
+ else:
+ _dict['first'] = self.first.to_dict()
+ if hasattr(self, 'limit') and self.limit is not None:
+ _dict['limit'] = self.limit
+ if hasattr(self, 'next') and self.next is not None:
+ if isinstance(self.next, dict):
+ _dict['next'] = self.next
+ else:
+ _dict['next'] = self.next.to_dict()
+ if hasattr(self, 'public_gateways') and self.public_gateways is not None:
+ public_gateways_list = []
+ for v in self.public_gateways:
+ if isinstance(v, dict):
+ public_gateways_list.append(v)
+ else:
+ public_gateways_list.append(v.to_dict())
+ _dict['public_gateways'] = public_gateways_list
+ if hasattr(self, 'total_count') and self.total_count is not None:
+ _dict['total_count'] = self.total_count
return _dict
def _to_dict(self):
@@ -65022,99 +68351,118 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this ReservedIPReferenceDeleted object."""
+ """Return a `str` version of this PublicGatewayCollection object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'ReservedIPReferenceDeleted') -> 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: 'ReservedIPReferenceDeleted') -> bool:
+ def __ne__(self, other: 'PublicGatewayCollection') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class ReservedIPTarget:
+class PublicGatewayCollectionFirst:
"""
- The target this reserved IP is bound to.
- If absent, this reserved IP is provider-owned or unbound.
+ A link to the first page of resources.
+ :param str href: The URL for a page of resources.
"""
def __init__(
self,
+ href: str,
) -> None:
"""
- Initialize a ReservedIPTarget object.
+ Initialize a PublicGatewayCollectionFirst object.
+ :param str href: The URL for a page of resources.
"""
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['ReservedIPTargetEndpointGatewayReference', 'ReservedIPTargetVirtualNetworkInterfaceReferenceReservedIPTargetContext', 'ReservedIPTargetNetworkInterfaceReferenceTargetContext', 'ReservedIPTargetBareMetalServerNetworkInterfaceReferenceTargetContext', 'ReservedIPTargetLoadBalancerReference', 'ReservedIPTargetVPNGatewayReference', 'ReservedIPTargetVPNServerReference', 'ReservedIPTargetGenericResourceReference'])
- )
- raise Exception(msg)
+ self.href = href
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'PublicGatewayCollectionFirst':
+ """Initialize a PublicGatewayCollectionFirst object from a json dictionary."""
+ args = {}
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
+ else:
+ raise ValueError('Required property \'href\' not present in PublicGatewayCollectionFirst JSON')
+ return cls(**args)
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a PublicGatewayCollectionFirst object from a json dictionary."""
+ return cls.from_dict(_dict)
-class ReservedIPTargetPrototype:
- """
- The target to bind this reserved IP to. The target must be in the same VPC.
- At present, only endpoint gateway targets are supported. The endpoint gateway must
- not be already bound to a reserved IP in the subnet's zone.
- If unspecified, the reserved IP will be created unbound.
+ def 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 __init__(
- self,
- ) -> None:
- """
- Initialize a ReservedIPTargetPrototype object.
+ def __str__(self) -> str:
+ """Return a `str` version of this PublicGatewayCollectionFirst object."""
+ return json.dumps(self.to_dict(), indent=2)
- """
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['ReservedIPTargetPrototypeEndpointGatewayIdentity'])
- )
- raise Exception(msg)
+ 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: 'PublicGatewayCollectionFirst') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
-class ResourceFilter:
+
+class PublicGatewayCollectionNext:
"""
- Identifies one or more resources according to the specified filter property.
+ A link to the next page of resources. This property is present for all pages except
+ the last page.
- :attr str resource_type: (optional) The resource type.
+ :param str href: The URL for a page of resources.
"""
def __init__(
self,
- *,
- resource_type: str = None,
+ href: str,
) -> None:
"""
- Initialize a ResourceFilter object.
+ Initialize a PublicGatewayCollectionNext object.
- :param str resource_type: (optional) The resource type.
+ :param str href: The URL for a page of resources.
"""
- self.resource_type = resource_type
+ self.href = href
@classmethod
- def from_dict(cls, _dict: Dict) -> 'ResourceFilter':
- """Initialize a ResourceFilter object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'PublicGatewayCollectionNext':
+ """Initialize a PublicGatewayCollectionNext object from a json dictionary."""
args = {}
- if 'resource_type' in _dict:
- args['resource_type'] = _dict.get('resource_type')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
+ else:
+ raise ValueError('Required property \'href\' not present in PublicGatewayCollectionNext JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a ResourceFilter object from a json dictionary."""
+ """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, 'resource_type') and self.resource_type is not None:
- _dict['resource_type'] = self.resource_type
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
return _dict
def _to_dict(self):
@@ -65122,24 +68470,23 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this ResourceFilter object."""
+ """Return a `str` version of this PublicGatewayCollectionNext object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'ResourceFilter') -> 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: 'ResourceFilter') -> bool:
+ def __ne__(self, other: 'PublicGatewayCollectionNext') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class ResourceGroupIdentity:
+class PublicGatewayFloatingIPPrototype:
"""
- The resource group to use. If unspecified, the account's [default resource
- group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be used.
+ PublicGatewayFloatingIPPrototype.
"""
@@ -65147,67 +68494,105 @@ def __init__(
self,
) -> None:
"""
- Initialize a ResourceGroupIdentity object.
+ Initialize a PublicGatewayFloatingIPPrototype object.
"""
msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['ResourceGroupIdentityById'])
+ ", ".join(['PublicGatewayFloatingIPPrototypeFloatingIPIdentity', 'PublicGatewayFloatingIPPrototypeFloatingIPPrototypeTargetContext'])
)
raise Exception(msg)
-class ResourceGroupReference:
+class PublicGatewayFloatingIp:
"""
- ResourceGroupReference.
+ The floating IP bound to this public gateway.
- :attr str href: The URL for this resource group.
- :attr str id: The unique identifier for this resource group.
- :attr str name: The name for this resource group.
+ :param str address: The globally unique IP address.
+ :param str crn: The CRN 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 str href: The URL for this floating IP.
+ :param str id: The unique identifier for this floating IP.
+ :param str name: The name for this floating IP. The name is unique across all
+ floating IPs in the region.
"""
def __init__(
self,
+ address: str,
+ crn: str,
href: str,
id: str,
name: str,
+ *,
+ deleted: Optional['FloatingIPReferenceDeleted'] = None,
) -> None:
"""
- Initialize a ResourceGroupReference object.
+ Initialize a PublicGatewayFloatingIp object.
- :param str href: The URL for this resource group.
- :param str id: The unique identifier for this resource group.
- :param str name: The name for this resource group.
+ :param str address: The globally unique IP address.
+ :param str crn: The CRN for this floating IP.
+ :param str href: The URL for this floating IP.
+ :param str id: The unique identifier for this floating IP.
+ :param str name: The name for this floating IP. The name is unique across
+ all floating IPs in the region.
+ :param FloatingIPReferenceDeleted deleted: (optional) If present, this
+ property indicates the referenced resource has been deleted, and provides
+ some supplementary information.
"""
+ self.address = address
+ self.crn = crn
+ self.deleted = deleted
self.href = href
self.id = id
self.name = name
@classmethod
- def from_dict(cls, _dict: Dict) -> 'ResourceGroupReference':
- """Initialize a ResourceGroupReference object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'PublicGatewayFloatingIp':
+ """Initialize a PublicGatewayFloatingIp object from a json dictionary."""
args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ if (address := _dict.get('address')) is not None:
+ args['address'] = address
else:
- raise ValueError('Required property \'href\' not present in ResourceGroupReference JSON')
- if 'id' in _dict:
- args['id'] = _dict.get('id')
+ raise ValueError('Required property \'address\' not present in PublicGatewayFloatingIp JSON')
+ if (crn := _dict.get('crn')) is not None:
+ args['crn'] = crn
else:
- raise ValueError('Required property \'id\' not present in ResourceGroupReference JSON')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
+ raise ValueError('Required property \'crn\' not present in PublicGatewayFloatingIp JSON')
+ if (deleted := _dict.get('deleted')) is not None:
+ args['deleted'] = FloatingIPReferenceDeleted.from_dict(deleted)
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'name\' not present in ResourceGroupReference JSON')
+ raise ValueError('Required property \'href\' not present in PublicGatewayFloatingIp JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
+ else:
+ raise ValueError('Required property \'id\' not present in PublicGatewayFloatingIp JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ else:
+ raise ValueError('Required property \'name\' not present in PublicGatewayFloatingIp JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a ResourceGroupReference 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, 'address') and self.address is not None:
+ _dict['address'] = self.address
+ if hasattr(self, 'crn') and self.crn is not None:
+ _dict['crn'] = self.crn
+ if hasattr(self, 'deleted') and self.deleted is not None:
+ if isinstance(self.deleted, dict):
+ _dict['deleted'] = self.deleted
+ else:
+ _dict['deleted'] = self.deleted.to_dict()
if hasattr(self, 'href') and self.href is not None:
_dict['href'] = self.href
if hasattr(self, 'id') and self.id is not None:
@@ -65221,212 +68606,195 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this ResourceGroupReference object."""
+ """Return a `str` version of this PublicGatewayFloatingIp object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'ResourceGroupReference') -> 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: 'ResourceGroupReference') -> bool:
+ def __ne__(self, other: 'PublicGatewayFloatingIp') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class Route:
+class PublicGatewayIdentity:
"""
- Route.
+ Identifies a public gateway by a unique property.
- :attr str action: The action to perform with a packet matching the route:
- - `delegate`: delegate to system-provided routes
- - `delegate_vpc`: delegate to system-provided routes, ignoring Internet-bound
- routes
- - `deliver`: deliver the packet to the specified `next_hop`
- - `drop`: drop the packet.
- :attr datetime created_at: The date and time that the route was created.
- :attr RouteCreator creator: (optional) If present, the resource that created the
- route. Routes with this property present cannot
- be directly deleted. All routes with an `origin` of `service` will have this
- property set,
- and future `origin` values may also have this property set.
- :attr str destination: The destination CIDR of the route.
- :attr str href: The URL for this route.
- :attr str id: The unique identifier for this route.
- :attr str lifecycle_state: The lifecycle state of the route.
- :attr str name: The name for this route. The name is unique across all routes in
- the routing table.
- :attr RouteNextHop next_hop: If `action` is `deliver`, the next hop that packets
- will be delivered to. For
- other `action` values, its `address` will be `0.0.0.0`.
- :attr str origin: (optional) The origin of this route:
- - `service`: route was directly created by a service
- - `user`: route was directly created by a user
- The enumerated values for this property are expected to expand in the future.
- When processing this property, check for and log unknown values. Optionally halt
- processing and surface the error, or bypass the route on which the unexpected
- property value was encountered.
- :attr int priority: The priority of this route. Smaller values have higher
- priority.
- If a routing table contains multiple routes with the same `zone` and
- `destination`, the route with the highest priority (smallest value) is selected.
- If two routes have the same `destination` and `priority`, traffic is distributed
- between them.
- :attr ZoneReference zone: The zone the route applies to. (Traffic from subnets
- in this zone will be
- subject to this route.).
"""
def __init__(
self,
- action: str,
- created_at: datetime,
- destination: str,
+ ) -> None:
+ """
+ Initialize a PublicGatewayIdentity object.
+
+ """
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['PublicGatewayIdentityPublicGatewayIdentityById', 'PublicGatewayIdentityPublicGatewayIdentityByCRN', 'PublicGatewayIdentityPublicGatewayIdentityByHref'])
+ )
+ raise Exception(msg)
+
+
+class PublicGatewayPatch:
+ """
+ PublicGatewayPatch.
+
+ :param str name: (optional) The name for this public gateway. The name must not
+ be used by another public gateway in the VPC.
+ """
+
+ def __init__(
+ self,
+ *,
+ name: Optional[str] = None,
+ ) -> None:
+ """
+ Initialize a PublicGatewayPatch object.
+
+ :param str name: (optional) The name for this public gateway. The name must
+ not be used by another public gateway in the VPC.
+ """
+ self.name = name
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'PublicGatewayPatch':
+ """Initialize a PublicGatewayPatch object from a json dictionary."""
+ args = {}
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ return cls(**args)
+
+ @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
+
+ def _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:
+ """
+ PublicGatewayReference.
+
+ :param str crn: The CRN for this public gateway.
+ :param PublicGatewayReferenceDeleted 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 public gateway.
+ :param str id: The unique identifier for this public gateway.
+ :param str name: The name for this public gateway. The name is unique across all
+ public gateways in the VPC.
+ :param str resource_type: The resource type.
+ """
+
+ def __init__(
+ self,
+ crn: str,
href: str,
id: str,
- lifecycle_state: str,
name: str,
- next_hop: 'RouteNextHop',
- priority: int,
- zone: 'ZoneReference',
+ resource_type: str,
*,
- creator: 'RouteCreator' = None,
- origin: str = None,
+ deleted: Optional['PublicGatewayReferenceDeleted'] = None,
) -> None:
"""
- Initialize a Route object.
+ Initialize a PublicGatewayReference object.
- :param str action: The action to perform with a packet matching the route:
- - `delegate`: delegate to system-provided routes
- - `delegate_vpc`: delegate to system-provided routes, ignoring
- Internet-bound routes
- - `deliver`: deliver the packet to the specified `next_hop`
- - `drop`: drop the packet.
- :param datetime created_at: The date and time that the route was created.
- :param str destination: The destination CIDR of the route.
- :param str href: The URL for this route.
- :param str id: The unique identifier for this route.
- :param str lifecycle_state: The lifecycle state of the route.
- :param str name: The name for this route. The name is unique across all
- routes in the routing table.
- :param RouteNextHop next_hop: If `action` is `deliver`, the next hop that
- packets will be delivered to. For
- other `action` values, its `address` will be `0.0.0.0`.
- :param int priority: The priority of this route. Smaller values have higher
- priority.
- If a routing table contains multiple routes with the same `zone` and
- `destination`, the route with the highest priority (smallest value) is
- selected. If two routes have the same `destination` and `priority`, traffic
- is distributed between them.
- :param ZoneReference zone: The zone the route applies to. (Traffic from
- subnets in this zone will be
- subject to this route.).
+ :param str crn: The CRN for this public gateway.
+ :param str href: The URL for this public gateway.
+ :param str id: The unique identifier for this public gateway.
+ :param str name: The name for this public gateway. The name is unique
+ across all public gateways in the VPC.
+ :param str resource_type: The resource type.
+ :param PublicGatewayReferenceDeleted deleted: (optional) If present, this
+ property indicates the referenced resource has been deleted, and provides
+ some supplementary information.
"""
- self.action = action
- self.created_at = created_at
- self.creator = creator
- self.destination = destination
+ self.crn = crn
+ self.deleted = deleted
self.href = href
self.id = id
- self.lifecycle_state = lifecycle_state
self.name = name
- self.next_hop = next_hop
- self.origin = origin
- self.priority = priority
- self.zone = zone
+ self.resource_type = resource_type
@classmethod
- def from_dict(cls, _dict: Dict) -> 'Route':
- """Initialize a Route object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'PublicGatewayReference':
+ """Initialize a PublicGatewayReference object from a json dictionary."""
args = {}
- if 'action' in _dict:
- args['action'] = _dict.get('action')
- else:
- raise ValueError('Required property \'action\' not present in Route JSON')
- if 'created_at' in _dict:
- args['created_at'] = string_to_datetime(_dict.get('created_at'))
+ if (crn := _dict.get('crn')) is not None:
+ args['crn'] = crn
else:
- raise ValueError('Required property \'created_at\' not present in Route JSON')
- if 'creator' in _dict:
- args['creator'] = _dict.get('creator')
- if 'destination' in _dict:
- args['destination'] = _dict.get('destination')
- else:
- raise ValueError('Required property \'destination\' not present in Route JSON')
- if 'href' in _dict:
- args['href'] = _dict.get('href')
- else:
- raise ValueError('Required property \'href\' not present in 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')
+ raise ValueError('Required property \'crn\' not present in PublicGatewayReference JSON')
+ if (deleted := _dict.get('deleted')) is not None:
+ args['deleted'] = PublicGatewayReferenceDeleted.from_dict(deleted)
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
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 \'href\' not present in PublicGatewayReference JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
else:
- raise ValueError('Required property \'next_hop\' not present in Route JSON')
- if 'origin' in _dict:
- args['origin'] = _dict.get('origin')
- if 'priority' in _dict:
- args['priority'] = _dict.get('priority')
+ raise ValueError('Required property \'id\' not present in PublicGatewayReference JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
else:
- raise ValueError('Required property \'priority\' not present in Route JSON')
- if 'zone' in _dict:
- args['zone'] = ZoneReference.from_dict(_dict.get('zone'))
+ raise ValueError('Required property \'name\' not present in PublicGatewayReference JSON')
+ if (resource_type := _dict.get('resource_type')) is not None:
+ args['resource_type'] = resource_type
else:
- raise ValueError('Required property \'zone\' not present in Route JSON')
+ raise ValueError('Required property \'resource_type\' not present in PublicGatewayReference JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a Route 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, 'action') and self.action is not None:
- _dict['action'] = self.action
- if hasattr(self, 'created_at') and self.created_at is not None:
- _dict['created_at'] = datetime_to_string(self.created_at)
- if hasattr(self, 'creator') and getattr(self, 'creator') is not None:
- if isinstance(getattr(self, 'creator'), dict):
- _dict['creator'] = getattr(self, 'creator')
+ if hasattr(self, 'crn') and self.crn is not None:
+ _dict['crn'] = self.crn
+ if hasattr(self, 'deleted') and self.deleted is not None:
+ if isinstance(self.deleted, dict):
+ _dict['deleted'] = self.deleted
else:
- _dict['creator'] = getattr(self, 'creator').to_dict()
- if hasattr(self, 'destination') and self.destination is not None:
- _dict['destination'] = self.destination
+ _dict['deleted'] = self.deleted.to_dict()
if hasattr(self, 'href') and self.href is not None:
_dict['href'] = self.href
if hasattr(self, 'id') and self.id is not None:
_dict['id'] = self.id
- if hasattr(self, 'lifecycle_state') and self.lifecycle_state is not None:
- _dict['lifecycle_state'] = self.lifecycle_state
if hasattr(self, 'name') and self.name is not None:
_dict['name'] = self.name
- if hasattr(self, 'next_hop') and self.next_hop is not None:
- if isinstance(self.next_hop, dict):
- _dict['next_hop'] = self.next_hop
- else:
- _dict['next_hop'] = self.next_hop.to_dict()
- if hasattr(self, 'origin') and getattr(self, 'origin') is not None:
- _dict['origin'] = getattr(self, 'origin')
- if hasattr(self, 'priority') and self.priority is not None:
- _dict['priority'] = self.priority
- if hasattr(self, 'zone') and self.zone is not None:
- if isinstance(self.zone, dict):
- _dict['zone'] = self.zone
- else:
- _dict['zone'] = self.zone.to_dict()
+ if hasattr(self, 'resource_type') and self.resource_type is not None:
+ _dict['resource_type'] = self.resource_type
return _dict
def _to_dict(self):
@@ -65434,160 +68802,67 @@ 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 PublicGatewayReference object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'Route') -> 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: 'Route') -> bool:
+ def __ne__(self, other: 'PublicGatewayReference') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class ActionEnum(str, Enum):
+ class ResourceTypeEnum(str, Enum):
"""
- The action to perform with a packet matching the route:
- - `delegate`: delegate to system-provided routes
- - `delegate_vpc`: delegate to system-provided routes, ignoring Internet-bound
- routes
- - `deliver`: deliver the packet to the specified `next_hop`
- - `drop`: drop the packet.
+ The resource type.
"""
- DELEGATE = 'delegate'
- DELEGATE_VPC = 'delegate_vpc'
- DELIVER = 'deliver'
- DROP = 'drop'
+ PUBLIC_GATEWAY = 'public_gateway'
- class LifecycleStateEnum(str, Enum):
- """
- The lifecycle state of the route.
- """
- DELETING = 'deleting'
- FAILED = 'failed'
- PENDING = 'pending'
- STABLE = 'stable'
- SUSPENDED = 'suspended'
- UPDATING = 'updating'
- WAITING = 'waiting'
-
-
- class OriginEnum(str, Enum):
- """
- The origin of this route:
- - `service`: route was directly created by a service
- - `user`: route was directly created by a user
- The enumerated values for this property are expected to expand in the future. When
- processing this property, check for and log unknown values. Optionally halt
- processing and surface the error, or bypass the route on which the unexpected
- property value was encountered.
- """
-
- SERVICE = 'service'
- USER = 'user'
-
-
-
-class RouteCollection:
+class PublicGatewayReferenceDeleted:
"""
- RouteCollection.
+ If present, this property indicates the referenced resource has been deleted, and
+ provides some supplementary information.
- :attr RouteCollectionFirst first: A link to the first page of resources.
- :attr int limit: The maximum number of resources that can be returned by the
- request.
- :attr RouteCollectionNext next: (optional) A link to the next page of resources.
- This property is present for all pages
- except the last page.
- :attr List[Route] routes: Collection of routes.
- :attr int total_count: The total number of resources across all pages.
+ :param str more_info: Link to documentation about deleted resources.
"""
def __init__(
self,
- first: 'RouteCollectionFirst',
- limit: int,
- routes: List['Route'],
- total_count: int,
- *,
- next: 'RouteCollectionNext' = None,
+ more_info: str,
) -> None:
"""
- Initialize a RouteCollection object.
+ Initialize a PublicGatewayReferenceDeleted object.
- :param RouteCollectionFirst first: A link to the first page of resources.
- :param int limit: The maximum number of resources that can be returned by
- the request.
- :param List[Route] routes: Collection of routes.
- :param int total_count: The total number of resources across all pages.
- :param RouteCollectionNext next: (optional) A link to the next page of
- resources. This property is present for all pages
- except the last page.
+ :param str more_info: Link to documentation about deleted resources.
"""
- self.first = first
- self.limit = limit
- self.next = next
- self.routes = routes
- self.total_count = total_count
+ self.more_info = more_info
@classmethod
- def from_dict(cls, _dict: Dict) -> 'RouteCollection':
- """Initialize a RouteCollection object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'PublicGatewayReferenceDeleted':
+ """Initialize a PublicGatewayReferenceDeleted object from a json dictionary."""
args = {}
- if 'first' in _dict:
- args['first'] = RouteCollectionFirst.from_dict(_dict.get('first'))
- else:
- 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 RouteCollection JSON')
- if 'next' in _dict:
- args['next'] = RouteCollectionNext.from_dict(_dict.get('next'))
- if 'routes' in _dict:
- args['routes'] = [Route.from_dict(v) for v in _dict.get('routes')]
- else:
- raise ValueError('Required property \'routes\' not present in RouteCollection JSON')
- if 'total_count' in _dict:
- args['total_count'] = _dict.get('total_count')
+ if (more_info := _dict.get('more_info')) is not None:
+ args['more_info'] = more_info
else:
- raise ValueError('Required property \'total_count\' not present in RouteCollection JSON')
+ raise ValueError('Required property \'more_info\' not present in PublicGatewayReferenceDeleted JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a RouteCollection object from a json dictionary."""
+ """Initialize a PublicGatewayReferenceDeleted object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'first') and self.first is not None:
- if isinstance(self.first, dict):
- _dict['first'] = self.first
- else:
- _dict['first'] = self.first.to_dict()
- if hasattr(self, 'limit') and self.limit is not None:
- _dict['limit'] = self.limit
- if hasattr(self, 'next') and self.next is not None:
- if isinstance(self.next, dict):
- _dict['next'] = self.next
- else:
- _dict['next'] = self.next.to_dict()
- if hasattr(self, 'routes') and self.routes is not None:
- routes_list = []
- for v in self.routes:
- if isinstance(v, dict):
- routes_list.append(v)
- else:
- routes_list.append(v.to_dict())
- _dict['routes'] = routes_list
- if hasattr(self, 'total_count') and self.total_count is not None:
- _dict['total_count'] = self.total_count
+ if hasattr(self, 'more_info') and self.more_info is not None:
+ _dict['more_info'] = self.more_info
return _dict
def _to_dict(self):
@@ -65595,58 +68870,88 @@ 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 PublicGatewayReferenceDeleted object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'RouteCollection') -> 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: 'RouteCollection') -> bool:
+ def __ne__(self, other: 'PublicGatewayReferenceDeleted') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class RouteCollectionFirst:
+class Region:
"""
- A link to the first page of resources.
+ Region.
- :attr str href: The URL for a page of resources.
+ :param str endpoint: The API endpoint for this region.
+ :param str href: The URL for this region.
+ :param str name: The globally unique name for this region.
+ :param str status: The availability status of this region.
"""
def __init__(
self,
+ endpoint: str,
href: str,
+ name: str,
+ status: str,
) -> None:
"""
- Initialize a RouteCollectionFirst object.
+ Initialize a Region object.
- :param str href: The URL for a page of resources.
+ :param str endpoint: The API endpoint for this region.
+ :param str href: The URL for this region.
+ :param str name: The globally unique name for this region.
+ :param str status: The availability status of this region.
"""
+ self.endpoint = endpoint
self.href = href
+ self.name = name
+ self.status = status
@classmethod
- def from_dict(cls, _dict: Dict) -> 'RouteCollectionFirst':
- """Initialize a RouteCollectionFirst object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'Region':
+ """Initialize a Region object from a json dictionary."""
args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ if (endpoint := _dict.get('endpoint')) is not None:
+ args['endpoint'] = endpoint
else:
- raise ValueError('Required property \'href\' not present in RouteCollectionFirst JSON')
+ raise ValueError('Required property \'endpoint\' not present in Region JSON')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
+ else:
+ raise ValueError('Required property \'href\' not present in Region JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ else:
+ raise ValueError('Required property \'name\' not present in Region JSON')
+ if (status := _dict.get('status')) is not None:
+ args['status'] = status
+ else:
+ raise ValueError('Required property \'status\' not present in Region JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a RouteCollectionFirst object from a json dictionary."""
+ """Initialize a Region object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
+ if hasattr(self, 'endpoint') and self.endpoint is not None:
+ _dict['endpoint'] = self.endpoint
if hasattr(self, 'href') and self.href is not None:
_dict['href'] = self.href
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ if hasattr(self, 'status') and self.status is not None:
+ _dict['status'] = self.status
return _dict
def _to_dict(self):
@@ -65654,59 +68959,73 @@ 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 Region object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'RouteCollectionFirst') -> bool:
+ def __eq__(self, other: 'Region') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'RouteCollectionFirst') -> bool:
+ def __ne__(self, other: 'Region') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
+ class StatusEnum(str, Enum):
+ """
+ The availability status of this region.
+ """
+
+ AVAILABLE = 'available'
+ UNAVAILABLE = 'unavailable'
+
-class RouteCollectionNext:
+
+class RegionCollection:
"""
- A link to the next page of resources. This property is present for all pages except
- the last page.
+ RegionCollection.
- :attr str href: The URL for a page of resources.
+ :param List[Region] regions: Collection of regions.
"""
def __init__(
self,
- href: str,
+ regions: List['Region'],
) -> None:
"""
- Initialize a RouteCollectionNext object.
+ Initialize a RegionCollection object.
- :param str href: The URL for a page of resources.
+ :param List[Region] regions: Collection of regions.
"""
- self.href = href
+ self.regions = regions
@classmethod
- def from_dict(cls, _dict: Dict) -> 'RouteCollectionNext':
- """Initialize a RouteCollectionNext object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'RegionCollection':
+ """Initialize a RegionCollection object from a json dictionary."""
args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ if (regions := _dict.get('regions')) is not None:
+ args['regions'] = [Region.from_dict(v) for v in regions]
else:
- raise ValueError('Required property \'href\' not present in RouteCollectionNext JSON')
+ raise ValueError('Required property \'regions\' not present in RegionCollection JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a RouteCollectionNext object from a json dictionary."""
+ """Initialize a RegionCollection object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'href') and self.href is not None:
- _dict['href'] = self.href
+ if hasattr(self, 'regions') and self.regions is not None:
+ regions_list = []
+ for v in self.regions:
+ if isinstance(v, dict):
+ regions_list.append(v)
+ else:
+ regions_list.append(v.to_dict())
+ _dict['regions'] = regions_list
return _dict
def _to_dict(self):
@@ -65714,118 +69033,87 @@ 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 RegionCollection object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'RouteCollectionNext') -> bool:
+ def __eq__(self, other: 'RegionCollection') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'RouteCollectionNext') -> bool:
+ def __ne__(self, other: 'RegionCollection') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class RouteCollectionVPCContext:
+class RegionIdentity:
"""
- RouteCollectionVPCContext.
+ Identifies a region by a unique property.
- :attr RouteCollectionVPCContextFirst first: A link to the first page of
- resources.
- :attr int limit: The maximum number of resources that can be returned by the
- request.
- :attr RouteCollectionVPCContextNext next: (optional) A link to the next page of
- resources. This property is present for all pages
- except the last page.
- :attr List[RouteCollectionVPCContextRoutesItem] routes: Collection of routes.
- :attr int total_count: The total number of resources across all pages.
"""
def __init__(
self,
- first: 'RouteCollectionVPCContextFirst',
- limit: int,
- routes: List['RouteCollectionVPCContextRoutesItem'],
- total_count: int,
- *,
- next: 'RouteCollectionVPCContextNext' = None,
) -> None:
"""
- Initialize a RouteCollectionVPCContext object.
+ Initialize a RegionIdentity object.
- :param RouteCollectionVPCContextFirst first: A link to the first page of
- resources.
- :param int limit: The maximum number of resources that can be returned by
- the request.
- :param List[RouteCollectionVPCContextRoutesItem] routes: Collection of
- routes.
- :param int total_count: The total number of resources across all pages.
- :param RouteCollectionVPCContextNext next: (optional) A link to the next
- page of resources. This property is present for all pages
- except the last page.
"""
- self.first = first
- self.limit = limit
- self.next = next
- self.routes = routes
- self.total_count = total_count
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['RegionIdentityByName', 'RegionIdentityByHref'])
+ )
+ raise Exception(msg)
+
+
+class RegionReference:
+ """
+ RegionReference.
+
+ :param str href: The URL for this region.
+ :param 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) -> 'RouteCollectionVPCContext':
- """Initialize a RouteCollectionVPCContext object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'RegionReference':
+ """Initialize a RegionReference object from a json dictionary."""
args = {}
- if 'first' in _dict:
- args['first'] = RouteCollectionVPCContextFirst.from_dict(_dict.get('first'))
- else:
- raise ValueError('Required property \'first\' not present in RouteCollectionVPCContext JSON')
- if 'limit' in _dict:
- args['limit'] = _dict.get('limit')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'limit\' not present in RouteCollectionVPCContext JSON')
- if 'next' in _dict:
- args['next'] = RouteCollectionVPCContextNext.from_dict(_dict.get('next'))
- if 'routes' in _dict:
- args['routes'] = [RouteCollectionVPCContextRoutesItem.from_dict(v) for v in _dict.get('routes')]
- else:
- raise ValueError('Required property \'routes\' not present in RouteCollectionVPCContext JSON')
- if 'total_count' in _dict:
- args['total_count'] = _dict.get('total_count')
+ raise ValueError('Required property \'href\' not present in RegionReference JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
else:
- raise ValueError('Required property \'total_count\' not present in RouteCollectionVPCContext JSON')
+ raise ValueError('Required property \'name\' not present in RegionReference JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a RouteCollectionVPCContext object from a json dictionary."""
+ """Initialize a RegionReference object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'first') and self.first is not None:
- if isinstance(self.first, dict):
- _dict['first'] = self.first
- else:
- _dict['first'] = self.first.to_dict()
- if hasattr(self, 'limit') and self.limit is not None:
- _dict['limit'] = self.limit
- if hasattr(self, 'next') and self.next is not None:
- if isinstance(self.next, dict):
- _dict['next'] = self.next
- else:
- _dict['next'] = self.next.to_dict()
- if hasattr(self, 'routes') and self.routes is not None:
- routes_list = []
- for v in self.routes:
- if isinstance(v, dict):
- routes_list.append(v)
- else:
- routes_list.append(v.to_dict())
- _dict['routes'] = routes_list
- if hasattr(self, 'total_count') and self.total_count is not None:
- _dict['total_count'] = self.total_count
+ 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):
@@ -65833,58 +69121,262 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this RouteCollectionVPCContext object."""
+ """Return a `str` version of this RegionReference object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'RouteCollectionVPCContext') -> bool:
+ def __eq__(self, other: 'RegionReference') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'RouteCollectionVPCContext') -> bool:
+ def __ne__(self, other: 'RegionReference') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class RouteCollectionVPCContextFirst:
+class Reservation:
"""
- A link to the first page of resources.
+ Reservation.
- :attr str href: The URL for a page of resources.
+ :param str affinity_policy: The affinity policy to use for this reservation:
+ - `restricted`: The reservation must be manually requested
+ 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 resource on which the unexpected
+ property value was encountered.
+ :param ReservationCapacity capacity: (optional) The capacity configuration for
+ this reservation
+ If absent, this reservation has no assigned capacity.
+ :param ReservationCommittedUse committed_use: (optional) The committed use
+ configuration for this reservation.
+ If absent, this reservation has no commitment for use.
+ :param datetime created_at: The date and time that the reservation was created.
+ :param str crn: The CRN for this reservation.
+ :param str href: The URL for this reservation.
+ :param str id: The unique identifier for this reservation.
+ :param str lifecycle_state: The lifecycle state of this reservation.
+ :param str name: The name for this reservation. The name is unique across all
+ reservations in the region.
+ :param ReservationProfile profile: The
+ [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) for this
+ reservation.
+ :param ResourceGroupReference resource_group: The resource group for this
+ reservation.
+ :param str resource_type: The resource type.
+ :param str status: The status of the reservation.
+ 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 resource on which the unexpected
+ property value was encountered.
+ :param List[ReservationStatusReason] 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 ZoneReference zone: The zone for this reservation.
"""
def __init__(
self,
+ affinity_policy: str,
+ created_at: datetime,
+ crn: str,
href: str,
+ id: str,
+ lifecycle_state: str,
+ name: str,
+ profile: 'ReservationProfile',
+ resource_group: 'ResourceGroupReference',
+ resource_type: str,
+ status: str,
+ status_reasons: List['ReservationStatusReason'],
+ zone: 'ZoneReference',
+ *,
+ capacity: Optional['ReservationCapacity'] = None,
+ committed_use: Optional['ReservationCommittedUse'] = None,
) -> None:
"""
- Initialize a RouteCollectionVPCContextFirst object.
+ Initialize a Reservation object.
- :param str href: The URL for a page of resources.
- """
+ :param str affinity_policy: The affinity policy to use for this
+ reservation:
+ - `restricted`: The reservation must be manually requested
+ 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 resource on which the
+ unexpected property value was encountered.
+ :param datetime created_at: The date and time that the reservation was
+ created.
+ :param str crn: The CRN for this reservation.
+ :param str href: The URL for this reservation.
+ :param str id: The unique identifier for this reservation.
+ :param str lifecycle_state: The lifecycle state of this reservation.
+ :param str name: The name for this reservation. The name is unique across
+ all reservations in the region.
+ :param ReservationProfile profile: The
+ [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) for this
+ reservation.
+ :param ResourceGroupReference resource_group: The resource group for this
+ reservation.
+ :param str resource_type: The resource type.
+ :param str status: The status of the reservation.
+ 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 resource on which the
+ unexpected property value was encountered.
+ :param List[ReservationStatusReason] 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 ZoneReference zone: The zone for this reservation.
+ :param ReservationCapacity capacity: (optional) The capacity configuration
+ for this reservation
+ If absent, this reservation has no assigned capacity.
+ :param ReservationCommittedUse committed_use: (optional) The committed use
+ configuration for this reservation.
+ If absent, this reservation has no commitment for use.
+ """
+ self.affinity_policy = affinity_policy
+ self.capacity = capacity
+ self.committed_use = committed_use
+ self.created_at = created_at
+ self.crn = crn
self.href = href
+ self.id = id
+ self.lifecycle_state = lifecycle_state
+ self.name = name
+ self.profile = profile
+ self.resource_group = resource_group
+ self.resource_type = resource_type
+ self.status = status
+ self.status_reasons = status_reasons
+ self.zone = zone
@classmethod
- def from_dict(cls, _dict: Dict) -> 'RouteCollectionVPCContextFirst':
- """Initialize a RouteCollectionVPCContextFirst object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'Reservation':
+ """Initialize a Reservation object from a json dictionary."""
args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ if (affinity_policy := _dict.get('affinity_policy')) is not None:
+ args['affinity_policy'] = affinity_policy
else:
- raise ValueError('Required property \'href\' not present in RouteCollectionVPCContextFirst JSON')
+ raise ValueError('Required property \'affinity_policy\' not present in Reservation JSON')
+ if (capacity := _dict.get('capacity')) is not None:
+ args['capacity'] = ReservationCapacity.from_dict(capacity)
+ if (committed_use := _dict.get('committed_use')) is not None:
+ args['committed_use'] = ReservationCommittedUse.from_dict(committed_use)
+ if (created_at := _dict.get('created_at')) is not None:
+ args['created_at'] = string_to_datetime(created_at)
+ else:
+ raise ValueError('Required property \'created_at\' not present in Reservation JSON')
+ if (crn := _dict.get('crn')) is not None:
+ args['crn'] = crn
+ else:
+ raise ValueError('Required property \'crn\' not present in Reservation JSON')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
+ else:
+ raise ValueError('Required property \'href\' not present in Reservation JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
+ else:
+ raise ValueError('Required property \'id\' not present in Reservation JSON')
+ if (lifecycle_state := _dict.get('lifecycle_state')) is not None:
+ args['lifecycle_state'] = lifecycle_state
+ else:
+ raise ValueError('Required property \'lifecycle_state\' not present in Reservation JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ else:
+ raise ValueError('Required property \'name\' not present in Reservation JSON')
+ if (profile := _dict.get('profile')) is not None:
+ args['profile'] = ReservationProfile.from_dict(profile)
+ else:
+ raise ValueError('Required property \'profile\' not present in Reservation JSON')
+ if (resource_group := _dict.get('resource_group')) is not None:
+ args['resource_group'] = ResourceGroupReference.from_dict(resource_group)
+ else:
+ raise ValueError('Required property \'resource_group\' not present in Reservation JSON')
+ if (resource_type := _dict.get('resource_type')) is not None:
+ args['resource_type'] = resource_type
+ else:
+ raise ValueError('Required property \'resource_type\' not present in Reservation JSON')
+ if (status := _dict.get('status')) is not None:
+ args['status'] = status
+ else:
+ raise ValueError('Required property \'status\' not present in Reservation JSON')
+ if (status_reasons := _dict.get('status_reasons')) is not None:
+ args['status_reasons'] = [ReservationStatusReason.from_dict(v) for v in status_reasons]
+ else:
+ raise ValueError('Required property \'status_reasons\' not present in Reservation JSON')
+ if (zone := _dict.get('zone')) is not None:
+ args['zone'] = ZoneReference.from_dict(zone)
+ else:
+ raise ValueError('Required property \'zone\' not present in Reservation JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a RouteCollectionVPCContextFirst object from a json dictionary."""
+ """Initialize a Reservation object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
+ if hasattr(self, 'affinity_policy') and self.affinity_policy is not None:
+ _dict['affinity_policy'] = self.affinity_policy
+ if hasattr(self, 'capacity') and self.capacity is not None:
+ if isinstance(self.capacity, dict):
+ _dict['capacity'] = self.capacity
+ else:
+ _dict['capacity'] = self.capacity.to_dict()
+ if hasattr(self, 'committed_use') and self.committed_use is not None:
+ if isinstance(self.committed_use, dict):
+ _dict['committed_use'] = self.committed_use
+ else:
+ _dict['committed_use'] = self.committed_use.to_dict()
+ if hasattr(self, 'created_at') and self.created_at is not None:
+ _dict['created_at'] = datetime_to_string(self.created_at)
+ if hasattr(self, 'crn') and self.crn is not None:
+ _dict['crn'] = self.crn
if hasattr(self, 'href') and self.href is not None:
_dict['href'] = self.href
+ if hasattr(self, 'id') and self.id is not None:
+ _dict['id'] = self.id
+ if hasattr(self, '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, 'profile') and self.profile is not None:
+ if isinstance(self.profile, dict):
+ _dict['profile'] = self.profile
+ else:
+ _dict['profile'] = self.profile.to_dict()
+ if hasattr(self, 'resource_group') and self.resource_group is not None:
+ if isinstance(self.resource_group, dict):
+ _dict['resource_group'] = self.resource_group
+ else:
+ _dict['resource_group'] = self.resource_group.to_dict()
+ if hasattr(self, 'resource_type') and self.resource_type is not None:
+ _dict['resource_type'] = self.resource_type
+ if hasattr(self, 'status') and self.status is not None:
+ _dict['status'] = self.status
+ if hasattr(self, 'status_reasons') and self.status_reasons is not None:
+ status_reasons_list = []
+ for v in self.status_reasons:
+ if isinstance(v, dict):
+ status_reasons_list.append(v)
+ else:
+ status_reasons_list.append(v.to_dict())
+ _dict['status_reasons'] = status_reasons_list
+ if hasattr(self, '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):
@@ -65892,59 +69384,180 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this RouteCollectionVPCContextFirst object."""
+ """Return a `str` version of this Reservation object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'RouteCollectionVPCContextFirst') -> bool:
+ def __eq__(self, other: 'Reservation') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'RouteCollectionVPCContextFirst') -> bool:
+ def __ne__(self, other: 'Reservation') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
+ class AffinityPolicyEnum(str, Enum):
+ """
+ The affinity policy to use for this reservation:
+ - `restricted`: The reservation must be manually requested
+ 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 resource on which the unexpected property value
+ was encountered.
+ """
+
+ RESTRICTED = 'restricted'
-class RouteCollectionVPCContextNext:
+
+ class LifecycleStateEnum(str, Enum):
+ """
+ The lifecycle state of this reservation.
+ """
+
+ DELETING = 'deleting'
+ FAILED = 'failed'
+ PENDING = 'pending'
+ STABLE = 'stable'
+ SUSPENDED = 'suspended'
+ UPDATING = 'updating'
+ WAITING = 'waiting'
+
+
+ class ResourceTypeEnum(str, Enum):
+ """
+ The resource type.
+ """
+
+ RESERVATION = 'reservation'
+
+
+ class StatusEnum(str, Enum):
+ """
+ The status of the reservation.
+ 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 resource on which the unexpected property value
+ was encountered.
+ """
+
+ ACTIVATING = 'activating'
+ ACTIVE = 'active'
+ DEACTIVATING = 'deactivating'
+ EXPIRED = 'expired'
+ FAILED = 'failed'
+ INACTIVE = 'inactive'
+
+
+
+class ReservationCapacity:
"""
- A link to the next page of resources. This property is present for all pages except
- the last page.
+ The capacity configuration for this reservation
+ If absent, this reservation has no assigned capacity.
- :attr str href: The URL for a page of resources.
+ :param int allocated: The amount allocated to this capacity reservation.
+ :param int available: The amount of this capacity reservation available for new
+ attachments.
+ :param str status: The status of the capacity reservation:
+ - `allocating`: The capacity reservation is being allocated for use
+ - `allocated`: The total capacity of the reservation has been allocated for use
+ - `degraded`: The capacity reservation has been allocated for use, but some of
+ the
+ capacity is not available.
+ See https://cloud.ibm.com/docs/vpc?topic=vpc-capacity-status for more
+ information.
+ - `unallocated`: The capacity reservation is not allocated for use
+ 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 resource on which the unexpected
+ property value was encountered.
+ :param int total: The total amount of this capacity reservation.
+ :param int used: The amount of this capacity reservation used by existing
+ attachments.
"""
def __init__(
self,
- href: str,
- ) -> None:
- """
- Initialize a RouteCollectionVPCContextNext object.
-
- :param str href: The URL for a page of resources.
+ allocated: int,
+ available: int,
+ status: str,
+ total: int,
+ used: int,
+ ) -> None:
+ """
+ Initialize a ReservationCapacity object.
+
+ :param int allocated: The amount allocated to this capacity reservation.
+ :param int available: The amount of this capacity reservation available for
+ new attachments.
+ :param str status: The status of the capacity reservation:
+ - `allocating`: The capacity reservation is being allocated for use
+ - `allocated`: The total capacity of the reservation has been allocated for
+ use
+ - `degraded`: The capacity reservation has been allocated for use, but some
+ of the
+ capacity is not available.
+ See https://cloud.ibm.com/docs/vpc?topic=vpc-capacity-status for more
+ information.
+ - `unallocated`: The capacity reservation is not allocated for use
+ 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 resource on which the
+ unexpected property value was encountered.
+ :param int total: The total amount of this capacity reservation.
+ :param int used: The amount of this capacity reservation used by existing
+ attachments.
"""
- self.href = href
+ self.allocated = allocated
+ self.available = available
+ self.status = status
+ self.total = total
+ self.used = used
@classmethod
- def from_dict(cls, _dict: Dict) -> 'RouteCollectionVPCContextNext':
- """Initialize a RouteCollectionVPCContextNext object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'ReservationCapacity':
+ """Initialize a ReservationCapacity object from a json dictionary."""
args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ if (allocated := _dict.get('allocated')) is not None:
+ args['allocated'] = allocated
else:
- raise ValueError('Required property \'href\' not present in RouteCollectionVPCContextNext JSON')
+ raise ValueError('Required property \'allocated\' not present in ReservationCapacity JSON')
+ if (available := _dict.get('available')) is not None:
+ args['available'] = available
+ else:
+ raise ValueError('Required property \'available\' not present in ReservationCapacity JSON')
+ if (status := _dict.get('status')) is not None:
+ args['status'] = status
+ else:
+ raise ValueError('Required property \'status\' not present in ReservationCapacity JSON')
+ if (total := _dict.get('total')) is not None:
+ args['total'] = total
+ else:
+ raise ValueError('Required property \'total\' not present in ReservationCapacity JSON')
+ if (used := _dict.get('used')) is not None:
+ args['used'] = used
+ else:
+ raise ValueError('Required property \'used\' not present in ReservationCapacity JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a RouteCollectionVPCContextNext object from a json dictionary."""
+ """Initialize a ReservationCapacity object from 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, 'allocated') and self.allocated is not None:
+ _dict['allocated'] = self.allocated
+ if hasattr(self, 'available') and self.available is not None:
+ _dict['available'] = self.available
+ if hasattr(self, 'status') and self.status is not None:
+ _dict['status'] = self.status
+ if hasattr(self, 'total') and self.total is not None:
+ _dict['total'] = self.total
+ if hasattr(self, 'used') and self.used is not None:
+ _dict['used'] = self.used
return _dict
def _to_dict(self):
@@ -65952,212 +69565,82 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this RouteCollectionVPCContextNext object."""
+ """Return a `str` version of this ReservationCapacity object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'RouteCollectionVPCContextNext') -> bool:
+ def __eq__(self, other: 'ReservationCapacity') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'RouteCollectionVPCContextNext') -> bool:
+ def __ne__(self, other: 'ReservationCapacity') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
+ class StatusEnum(str, Enum):
+ """
+ The status of the capacity reservation:
+ - `allocating`: The capacity reservation is being allocated for use
+ - `allocated`: The total capacity of the reservation has been allocated for use
+ - `degraded`: The capacity reservation has been allocated for use, but some of the
+ capacity is not available.
+ See https://cloud.ibm.com/docs/vpc?topic=vpc-capacity-status for more
+ information.
+ - `unallocated`: The capacity reservation is not allocated for use
+ 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 resource on which the unexpected property value
+ was encountered.
+ """
+
+ ALLOCATED = 'allocated'
+ ALLOCATING = 'allocating'
+ DEGRADED = 'degraded'
+ UNALLOCATED = 'unallocated'
+
-class RouteCollectionVPCContextRoutesItem:
+
+class ReservationCapacityPatch:
"""
- RouteCollectionVPCContextRoutesItem.
+ The capacity reservation configuration to use.
+ The configuration can only be changed for reservations with a `status` of `inactive`.
- :attr str action: The action to perform with a packet matching the route:
- - `delegate`: delegate to system-provided routes
- - `delegate_vpc`: delegate to system-provided routes, ignoring Internet-bound
- routes
- - `deliver`: deliver the packet to the specified `next_hop`
- - `drop`: drop the packet.
- :attr datetime created_at: The date and time that the route was created.
- :attr RouteCreator creator: (optional) If present, the resource that created the
- route. Routes with this property present cannot
- be directly deleted. All routes with an `origin` of `service` will have this
- property set,
- and future `origin` values may also have this property set.
- :attr str destination: The destination CIDR of the route.
- :attr str href: The URL for this route.
- :attr str id: The unique identifier for this route.
- :attr str lifecycle_state: The lifecycle state of the route.
- :attr str name: The name for this route. The name is unique across all routes in
- the routing table.
- :attr RouteNextHop next_hop: If `action` is `deliver`, the next hop that packets
- will be delivered to. For
- other `action` values, its `address` will be `0.0.0.0`.
- :attr str origin: (optional) The origin of this route:
- - `service`: route was directly created by a service
- - `user`: route was directly created by a user
- The enumerated values for this property are expected to expand in the future.
- When processing this property, check for and log unknown values. Optionally halt
- processing and surface the error, or bypass the route on which the unexpected
- property value was encountered.
- :attr int priority: The priority of this route. Smaller values have higher
- priority.
- If a routing table contains multiple routes with the same `zone` and
- `destination`, the route with the highest priority (smallest value) is selected.
- If two routes have the same `destination` and `priority`, traffic is distributed
- between them.
- :attr ZoneReference zone: The zone the route applies to. (Traffic from subnets
- in this zone will be
- subject to this route.).
+ :param int total: (optional) The total amount to use for this capacity
+ reservation.
"""
def __init__(
self,
- action: str,
- created_at: datetime,
- destination: str,
- href: str,
- id: str,
- lifecycle_state: str,
- name: str,
- next_hop: 'RouteNextHop',
- priority: int,
- zone: 'ZoneReference',
*,
- creator: 'RouteCreator' = None,
- origin: str = None,
+ total: Optional[int] = None,
) -> None:
"""
- Initialize a RouteCollectionVPCContextRoutesItem object.
+ Initialize a ReservationCapacityPatch object.
- :param str action: The action to perform with a packet matching the route:
- - `delegate`: delegate to system-provided routes
- - `delegate_vpc`: delegate to system-provided routes, ignoring
- Internet-bound routes
- - `deliver`: deliver the packet to the specified `next_hop`
- - `drop`: drop the packet.
- :param datetime created_at: The date and time that the route was created.
- :param str destination: The destination CIDR of the route.
- :param str href: The URL for this route.
- :param str id: The unique identifier for this route.
- :param str lifecycle_state: The lifecycle state of the route.
- :param str name: The name for this route. The name is unique across all
- routes in the routing table.
- :param RouteNextHop next_hop: If `action` is `deliver`, the next hop that
- packets will be delivered to. For
- other `action` values, its `address` will be `0.0.0.0`.
- :param int priority: The priority of this route. Smaller values have higher
- priority.
- If a routing table contains multiple routes with the same `zone` and
- `destination`, the route with the highest priority (smallest value) is
- selected. If two routes have the same `destination` and `priority`, traffic
- is distributed between them.
- :param ZoneReference zone: The zone the route applies to. (Traffic from
- subnets in this zone will be
- subject to this route.).
+ :param int total: (optional) The total amount to use for this capacity
+ reservation.
"""
- self.action = action
- self.created_at = created_at
- self.creator = creator
- self.destination = destination
- self.href = href
- self.id = id
- self.lifecycle_state = lifecycle_state
- self.name = name
- self.next_hop = next_hop
- self.origin = origin
- self.priority = priority
- self.zone = zone
+ self.total = total
@classmethod
- def from_dict(cls, _dict: Dict) -> 'RouteCollectionVPCContextRoutesItem':
- """Initialize a RouteCollectionVPCContextRoutesItem object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'ReservationCapacityPatch':
+ """Initialize a ReservationCapacityPatch object from a json dictionary."""
args = {}
- if 'action' in _dict:
- args['action'] = _dict.get('action')
- else:
- raise ValueError('Required property \'action\' not present in RouteCollectionVPCContextRoutesItem JSON')
- if 'created_at' in _dict:
- args['created_at'] = string_to_datetime(_dict.get('created_at'))
- else:
- raise ValueError('Required property \'created_at\' not present in RouteCollectionVPCContextRoutesItem JSON')
- if 'creator' in _dict:
- args['creator'] = _dict.get('creator')
- if 'destination' in _dict:
- args['destination'] = _dict.get('destination')
- else:
- raise ValueError('Required property \'destination\' not present in RouteCollectionVPCContextRoutesItem JSON')
- if 'href' in _dict:
- args['href'] = _dict.get('href')
- else:
- raise ValueError('Required property \'href\' not present in RouteCollectionVPCContextRoutesItem JSON')
- if 'id' in _dict:
- args['id'] = _dict.get('id')
- else:
- raise ValueError('Required property \'id\' not present in RouteCollectionVPCContextRoutesItem JSON')
- if 'lifecycle_state' in _dict:
- args['lifecycle_state'] = _dict.get('lifecycle_state')
- else:
- raise ValueError('Required property \'lifecycle_state\' not present in RouteCollectionVPCContextRoutesItem JSON')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
- else:
- raise ValueError('Required property \'name\' not present in RouteCollectionVPCContextRoutesItem JSON')
- if 'next_hop' in _dict:
- args['next_hop'] = _dict.get('next_hop')
- else:
- raise ValueError('Required property \'next_hop\' not present in RouteCollectionVPCContextRoutesItem JSON')
- if 'origin' in _dict:
- args['origin'] = _dict.get('origin')
- if 'priority' in _dict:
- args['priority'] = _dict.get('priority')
- else:
- raise ValueError('Required property \'priority\' not present in RouteCollectionVPCContextRoutesItem JSON')
- if 'zone' in _dict:
- args['zone'] = ZoneReference.from_dict(_dict.get('zone'))
- else:
- raise ValueError('Required property \'zone\' not present in RouteCollectionVPCContextRoutesItem JSON')
+ if (total := _dict.get('total')) is not None:
+ args['total'] = total
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a RouteCollectionVPCContextRoutesItem object from a json dictionary."""
+ """Initialize a ReservationCapacityPatch object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'action') and self.action is not None:
- _dict['action'] = self.action
- if hasattr(self, 'created_at') and self.created_at is not None:
- _dict['created_at'] = datetime_to_string(self.created_at)
- if hasattr(self, 'creator') and getattr(self, 'creator') is not None:
- if isinstance(getattr(self, 'creator'), dict):
- _dict['creator'] = getattr(self, 'creator')
- else:
- _dict['creator'] = getattr(self, 'creator').to_dict()
- if hasattr(self, 'destination') and self.destination is not None:
- _dict['destination'] = self.destination
- if hasattr(self, 'href') and self.href is not None:
- _dict['href'] = self.href
- if hasattr(self, 'id') and self.id is not None:
- _dict['id'] = self.id
- if hasattr(self, 'lifecycle_state') and self.lifecycle_state is not None:
- _dict['lifecycle_state'] = self.lifecycle_state
- if hasattr(self, 'name') and self.name is not None:
- _dict['name'] = self.name
- if hasattr(self, 'next_hop') and self.next_hop is not None:
- if isinstance(self.next_hop, dict):
- _dict['next_hop'] = self.next_hop
- else:
- _dict['next_hop'] = self.next_hop.to_dict()
- if hasattr(self, 'origin') and getattr(self, 'origin') is not None:
- _dict['origin'] = getattr(self, 'origin')
- if hasattr(self, 'priority') and self.priority is not None:
- _dict['priority'] = self.priority
- if hasattr(self, 'zone') and self.zone is not None:
- if isinstance(self.zone, dict):
- _dict['zone'] = self.zone
- else:
- _dict['zone'] = self.zone.to_dict()
+ if hasattr(self, 'total') and self.total is not None:
+ _dict['total'] = self.total
return _dict
def _to_dict(self):
@@ -66165,210 +69648,58 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this RouteCollectionVPCContextRoutesItem object."""
+ """Return a `str` version of this ReservationCapacityPatch object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'RouteCollectionVPCContextRoutesItem') -> bool:
+ def __eq__(self, other: 'ReservationCapacityPatch') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'RouteCollectionVPCContextRoutesItem') -> bool:
+ def __ne__(self, other: 'ReservationCapacityPatch') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class ActionEnum(str, Enum):
- """
- The action to perform with a packet matching the route:
- - `delegate`: delegate to system-provided routes
- - `delegate_vpc`: delegate to system-provided routes, ignoring Internet-bound
- routes
- - `deliver`: deliver the packet to the specified `next_hop`
- - `drop`: drop the packet.
- """
-
- DELEGATE = 'delegate'
- DELEGATE_VPC = 'delegate_vpc'
- DELIVER = 'deliver'
- DROP = 'drop'
-
-
- class LifecycleStateEnum(str, Enum):
- """
- The lifecycle state of the route.
- """
-
- DELETING = 'deleting'
- FAILED = 'failed'
- PENDING = 'pending'
- STABLE = 'stable'
- SUSPENDED = 'suspended'
- UPDATING = 'updating'
- WAITING = 'waiting'
-
-
- class OriginEnum(str, Enum):
- """
- The origin of this route:
- - `service`: route was directly created by a service
- - `user`: route was directly created by a user
- The enumerated values for this property are expected to expand in the future. When
- processing this property, check for and log unknown values. Optionally halt
- processing and surface the error, or bypass the route on which the unexpected
- property value was encountered.
- """
-
- SERVICE = 'service'
- USER = 'user'
-
-
-
-class RouteCreator:
- """
- If present, the resource that created the route. Routes with this property present
- cannot be directly deleted. All routes with an `origin` of `service` will have this
- property set, and future `origin` values may also have this property set.
-
- """
-
- def __init__(
- self,
- ) -> None:
- """
- Initialize a RouteCreator object.
-
- """
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['RouteCreatorVPNGatewayReference', 'RouteCreatorVPNServerReference'])
- )
- raise Exception(msg)
-
-
-class RouteNextHop:
- """
- RouteNextHop.
-
- """
-
- def __init__(
- self,
- ) -> None:
- """
- Initialize a RouteNextHop object.
-
- """
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['RouteNextHopIP', 'RouteNextHopVPNGatewayConnectionReference'])
- )
- raise Exception(msg)
-
-
-class RouteNextHopPatch:
- """
- If `action` is `deliver`, the next hop that packets will be delivered to. For other
- `action` values, specify `0.0.0.0` or remove it by specifying `null`.
- At most two routes per `zone` in a table can have the same `destination` and
- `priority`, and only when each route has an `action` of `deliver` and `next_hop` is an
- IP address.
-
- """
-
- def __init__(
- self,
- ) -> None:
- """
- Initialize a RouteNextHopPatch object.
-
- """
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['RouteNextHopPatchRouteNextHopIP', 'RouteNextHopPatchVPNGatewayConnectionIdentity'])
- )
- raise Exception(msg)
-
-class RoutePatch:
+class ReservationCapacityPrototype:
"""
- RoutePatch.
+ The capacity reservation configuration to use.
- :attr str name: (optional) The name for this route. The name must not be used by
- another route in the routing table. Names starting with `ibm-` are reserved for
- system-provided routes, and are not allowed.
- :attr RouteNextHopPatch next_hop: (optional) If `action` is `deliver`, the next
- hop that packets will be delivered to. For other
- `action` values, specify `0.0.0.0` or remove it by specifying `null`.
- At most two routes per `zone` in a table can have the same `destination` and
- `priority`,
- and only when each route has an `action` of `deliver` and `next_hop` is an IP
- address.
- :attr int priority: (optional) The priority of this route. Smaller values have
- higher priority.
- If a routing table contains multiple routes with the same `zone` and
- `destination`, the route with the highest priority (smallest value) is selected.
- If two routes have the same `destination` and `priority`, traffic is distributed
- between them.
+ :param int total: The total amount to use for this capacity reservation.
"""
def __init__(
self,
- *,
- name: str = None,
- next_hop: 'RouteNextHopPatch' = None,
- priority: int = None,
+ total: int,
) -> None:
"""
- Initialize a RoutePatch object.
+ Initialize a ReservationCapacityPrototype object.
- :param str name: (optional) The name for this route. The name must not be
- used by another route in the routing table. Names starting with `ibm-` are
- reserved for system-provided routes, and are not allowed.
- :param RouteNextHopPatch next_hop: (optional) If `action` is `deliver`, the
- next hop that packets will be delivered to. For other
- `action` values, specify `0.0.0.0` or remove it by specifying `null`.
- At most two routes per `zone` in a table can have the same `destination`
- and `priority`,
- and only when each route has an `action` of `deliver` and `next_hop` is an
- IP address.
- :param int priority: (optional) The priority of this route. Smaller values
- have higher priority.
- If a routing table contains multiple routes with the same `zone` and
- `destination`, the route with the highest priority (smallest value) is
- selected. If two routes have the same `destination` and `priority`, traffic
- is distributed between them.
+ :param int total: The total amount to use for this capacity reservation.
"""
- self.name = name
- self.next_hop = next_hop
- self.priority = priority
+ self.total = total
@classmethod
- def from_dict(cls, _dict: Dict) -> 'RoutePatch':
- """Initialize a RoutePatch object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'ReservationCapacityPrototype':
+ """Initialize a ReservationCapacityPrototype object from a json dictionary."""
args = {}
- if 'name' in _dict:
- args['name'] = _dict.get('name')
- if 'next_hop' in _dict:
- args['next_hop'] = _dict.get('next_hop')
- if 'priority' in _dict:
- args['priority'] = _dict.get('priority')
+ if (total := _dict.get('total')) is not None:
+ args['total'] = total
+ else:
+ raise ValueError('Required property \'total\' not present in ReservationCapacityPrototype JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a RoutePatch object from a json dictionary."""
+ """Initialize a ReservationCapacityPrototype object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'name') and self.name is not None:
- _dict['name'] = self.name
- if hasattr(self, 'next_hop') and self.next_hop is not None:
- if isinstance(self.next_hop, dict):
- _dict['next_hop'] = self.next_hop
- else:
- _dict['next_hop'] = self.next_hop.to_dict()
- if hasattr(self, 'priority') and self.priority is not None:
- _dict['priority'] = self.priority
+ if hasattr(self, 'total') and self.total is not None:
+ _dict['total'] = self.total
return _dict
def _to_dict(self):
@@ -66376,160 +69707,116 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this RoutePatch object."""
+ """Return a `str` version of this ReservationCapacityPrototype object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'RoutePatch') -> bool:
+ def __eq__(self, other: 'ReservationCapacityPrototype') -> bool:
"""Return `true` when 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: 'ReservationCapacityPrototype') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class RoutePrototype:
+class ReservationCollection:
"""
- RoutePrototype.
+ ReservationCollection.
- :attr str action: (optional) The action to perform with a packet matching the
- route:
- - `delegate`: delegate to system-provided routes
- - `delegate_vpc`: delegate to system-provided routes, ignoring Internet-bound
- routes
- - `deliver`: deliver the packet to the specified `next_hop`
- - `drop`: drop the packet.
- :attr str destination: The destination CIDR of the route. The host identifier in
- the CIDR must be zero.
- At most two routes per `zone` in a table can have the same `destination` and
- `priority`, and only if both routes have an `action` of `deliver` and the
- `next_hop` is an IP address.
- :attr str name: (optional) The name for this route. The name must not be used by
- another route in the routing table. Names starting with `ibm-` are reserved for
- system-provided routes, and are not allowed. If unspecified, the name will be a
- hyphenated list of randomly-selected words.
- :attr RoutePrototypeNextHop next_hop: (optional) If `action` is `deliver`, the
- next hop that packets will be delivered to. For other
- `action` values, it must be omitted or specified as `0.0.0.0`.
- At most two routes per `zone` in a table can have the same `destination` and
- `priority`,
- and only when each route has an `action` of `deliver` and `next_hop` is an IP
- address.
- :attr int priority: (optional) The priority of this route. Smaller values have
- higher priority.
- If a routing table contains multiple routes with the same `zone` and
- `destination`, the route with the highest priority (smallest value) is selected.
- If two routes have the same `destination` and `priority`, traffic is distributed
- between them.
- :attr ZoneIdentity zone: The zone to apply the route to. (Traffic from subnets
- in this zone will be
- subject to this route.).
+ :param ReservationCollectionFirst 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 ReservationCollectionNext next: (optional) A link to the next page of
+ resources. This property is present for all pages
+ except the last page.
+ :param List[Reservation] reservations: Collection of reservations.
+ :param int total_count: The total number of resources across all pages.
"""
def __init__(
self,
- destination: str,
- zone: 'ZoneIdentity',
+ first: 'ReservationCollectionFirst',
+ limit: int,
+ reservations: List['Reservation'],
+ total_count: int,
*,
- action: str = None,
- name: str = None,
- next_hop: 'RoutePrototypeNextHop' = None,
- priority: int = None,
+ next: Optional['ReservationCollectionNext'] = None,
) -> None:
"""
- Initialize a RoutePrototype object.
+ Initialize a ReservationCollection object.
- :param str destination: The destination CIDR of the route. The host
- identifier in the CIDR must be zero.
- At most two routes per `zone` in a table can have the same `destination`
- and
- `priority`, and only if both routes have an `action` of `deliver` and the
- `next_hop` is an IP address.
- :param ZoneIdentity zone: The zone to apply the route to. (Traffic from
- subnets in this zone will be
- subject to this route.).
- :param str action: (optional) The action to perform with a packet matching
- the route:
- - `delegate`: delegate to system-provided routes
- - `delegate_vpc`: delegate to system-provided routes, ignoring
- Internet-bound routes
- - `deliver`: deliver the packet to the specified `next_hop`
- - `drop`: drop the packet.
- :param str name: (optional) The name for this route. The name must not be
- used by another route in the routing table. Names starting with `ibm-` are
- reserved for system-provided routes, and are not allowed. If unspecified,
- the name will be a hyphenated list of randomly-selected words.
- :param RoutePrototypeNextHop next_hop: (optional) If `action` is `deliver`,
- the next hop that packets will be delivered to. For other
- `action` values, it must be omitted or specified as `0.0.0.0`.
- At most two routes per `zone` in a table can have the same `destination`
- and `priority`,
- and only when each route has an `action` of `deliver` and `next_hop` is an
- IP address.
- :param int priority: (optional) The priority of this route. Smaller values
- have higher priority.
- If a routing table contains multiple routes with the same `zone` and
- `destination`, the route with the highest priority (smallest value) is
- selected. If two routes have the same `destination` and `priority`, traffic
- is distributed between them.
+ :param ReservationCollectionFirst 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[Reservation] reservations: Collection of reservations.
+ :param int total_count: The total number of resources across all pages.
+ :param ReservationCollectionNext next: (optional) A link to the next page
+ of resources. This property is present for all pages
+ except the last page.
"""
- self.action = action
- self.destination = destination
- self.name = name
- self.next_hop = next_hop
- self.priority = priority
- self.zone = zone
+ self.first = first
+ self.limit = limit
+ self.next = next
+ self.reservations = reservations
+ self.total_count = total_count
@classmethod
- def from_dict(cls, _dict: Dict) -> 'RoutePrototype':
- """Initialize a RoutePrototype object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'ReservationCollection':
+ """Initialize a ReservationCollection object from a json dictionary."""
args = {}
- if 'action' in _dict:
- args['action'] = _dict.get('action')
- if 'destination' in _dict:
- args['destination'] = _dict.get('destination')
+ if (first := _dict.get('first')) is not None:
+ args['first'] = ReservationCollectionFirst.from_dict(first)
else:
- raise ValueError('Required property \'destination\' not present in RoutePrototype JSON')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
- if 'next_hop' in _dict:
- args['next_hop'] = _dict.get('next_hop')
- if 'priority' in _dict:
- args['priority'] = _dict.get('priority')
- if 'zone' in _dict:
- args['zone'] = _dict.get('zone')
+ raise ValueError('Required property \'first\' not present in ReservationCollection JSON')
+ if (limit := _dict.get('limit')) is not None:
+ args['limit'] = limit
else:
- raise ValueError('Required property \'zone\' not present in RoutePrototype JSON')
+ raise ValueError('Required property \'limit\' not present in ReservationCollection JSON')
+ if (next := _dict.get('next')) is not None:
+ args['next'] = ReservationCollectionNext.from_dict(next)
+ if (reservations := _dict.get('reservations')) is not None:
+ args['reservations'] = [Reservation.from_dict(v) for v in reservations]
+ else:
+ raise ValueError('Required property \'reservations\' not present in ReservationCollection JSON')
+ if (total_count := _dict.get('total_count')) is not None:
+ args['total_count'] = total_count
+ else:
+ raise ValueError('Required property \'total_count\' not present in ReservationCollection JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a RoutePrototype object from a json dictionary."""
+ """Initialize a ReservationCollection object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'action') and self.action is not None:
- _dict['action'] = self.action
- if hasattr(self, 'destination') and self.destination is not None:
- _dict['destination'] = self.destination
- if hasattr(self, 'name') and self.name is not None:
- _dict['name'] = self.name
- if hasattr(self, 'next_hop') and self.next_hop is not None:
- if isinstance(self.next_hop, dict):
- _dict['next_hop'] = self.next_hop
+ if hasattr(self, 'first') and self.first is not None:
+ if isinstance(self.first, dict):
+ _dict['first'] = self.first
else:
- _dict['next_hop'] = self.next_hop.to_dict()
- if hasattr(self, 'priority') and self.priority is not None:
- _dict['priority'] = self.priority
- if hasattr(self, 'zone') and self.zone is not None:
- if isinstance(self.zone, dict):
- _dict['zone'] = self.zone
+ _dict['first'] = self.first.to_dict()
+ if hasattr(self, 'limit') and self.limit is not None:
+ _dict['limit'] = self.limit
+ if hasattr(self, 'next') and self.next is not None:
+ if isinstance(self.next, dict):
+ _dict['next'] = self.next
else:
- _dict['zone'] = self.zone.to_dict()
+ _dict['next'] = self.next.to_dict()
+ if hasattr(self, 'reservations') and self.reservations is not None:
+ reservations_list = []
+ for v in self.reservations:
+ if isinstance(v, dict):
+ reservations_list.append(v)
+ else:
+ reservations_list.append(v.to_dict())
+ _dict['reservations'] = reservations_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):
@@ -66537,135 +69824,58 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this RoutePrototype object."""
+ """Return a `str` version of this ReservationCollection object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'RoutePrototype') -> bool:
+ def __eq__(self, other: 'ReservationCollection') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'RoutePrototype') -> bool:
+ def __ne__(self, other: 'ReservationCollection') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class ActionEnum(str, Enum):
- """
- The action to perform with a packet matching the route:
- - `delegate`: delegate to system-provided routes
- - `delegate_vpc`: delegate to system-provided routes, ignoring Internet-bound
- routes
- - `deliver`: deliver the packet to the specified `next_hop`
- - `drop`: drop the packet.
- """
-
- DELEGATE = 'delegate'
- DELEGATE_VPC = 'delegate_vpc'
- DELIVER = 'deliver'
- DROP = 'drop'
-
-
-
-class RoutePrototypeNextHop:
- """
- If `action` is `deliver`, the next hop that packets will be delivered to. For other
- `action` values, it must be omitted or specified as `0.0.0.0`.
- At most two routes per `zone` in a table can have the same `destination` and
- `priority`, and only when each route has an `action` of `deliver` and `next_hop` is an
- IP address.
-
- """
-
- def __init__(
- self,
- ) -> None:
- """
- Initialize a RoutePrototypeNextHop object.
-
- """
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['RoutePrototypeNextHopRouteNextHopPrototypeRouteNextHopIP', 'RoutePrototypeNextHopRouteNextHopPrototypeVPNGatewayConnectionIdentity'])
- )
- raise Exception(msg)
-
-class RouteReference:
+class ReservationCollectionFirst:
"""
- RouteReference.
+ A link to the first page of resources.
- :attr RouteReferenceDeleted deleted: (optional) If present, this property
- indicates the referenced resource has been deleted, and provides
- some supplementary information.
- :attr str href: The URL for this route.
- :attr str id: The unique identifier for this route.
- :attr str name: The name for this route. The name is unique across all routes in
- the routing table.
+ :param str href: The URL for a page of resources.
"""
def __init__(
self,
href: str,
- id: str,
- name: str,
- *,
- deleted: 'RouteReferenceDeleted' = None,
) -> None:
"""
- Initialize a RouteReference object.
+ Initialize a ReservationCollectionFirst object.
- :param str href: The URL for this route.
- :param str id: The unique identifier for this route.
- :param str name: The name for this route. The name is unique across all
- routes in the routing table.
- :param RouteReferenceDeleted deleted: (optional) If present, this property
- indicates the referenced resource has been deleted, and provides
- some supplementary information.
+ :param str href: The URL for a page of resources.
"""
- self.deleted = deleted
self.href = href
- self.id = id
- self.name = name
@classmethod
- def from_dict(cls, _dict: Dict) -> 'RouteReference':
- """Initialize a RouteReference object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'ReservationCollectionFirst':
+ """Initialize a ReservationCollectionFirst object from a json dictionary."""
args = {}
- if 'deleted' in _dict:
- args['deleted'] = RouteReferenceDeleted.from_dict(_dict.get('deleted'))
- if 'href' in _dict:
- args['href'] = _dict.get('href')
- else:
- raise ValueError('Required property \'href\' not present in RouteReference JSON')
- if 'id' in _dict:
- args['id'] = _dict.get('id')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'id\' not present in RouteReference JSON')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
- else:
- raise ValueError('Required property \'name\' not present in RouteReference JSON')
+ raise ValueError('Required property \'href\' not present in ReservationCollectionFirst JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a RouteReference object from a json dictionary."""
+ """Initialize a ReservationCollectionFirst object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'deleted') and self.deleted is not None:
- if isinstance(self.deleted, dict):
- _dict['deleted'] = self.deleted
- else:
- _dict['deleted'] = self.deleted.to_dict()
if hasattr(self, 'href') and self.href is not None:
_dict['href'] = self.href
- if hasattr(self, 'id') and self.id is not None:
- _dict['id'] = self.id
- if hasattr(self, 'name') and self.name is not None:
- _dict['name'] = self.name
return _dict
def _to_dict(self):
@@ -66673,59 +69883,59 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this RouteReference object."""
+ """Return a `str` version of this ReservationCollectionFirst object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'RouteReference') -> bool:
+ def __eq__(self, other: 'ReservationCollectionFirst') -> bool:
"""Return `true` when 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: 'ReservationCollectionFirst') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class RouteReferenceDeleted:
+class ReservationCollectionNext:
"""
- 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.
+ :param str href: The URL for a page of resources.
"""
def __init__(
self,
- more_info: str,
+ href: str,
) -> None:
"""
- Initialize a RouteReferenceDeleted object.
+ Initialize a ReservationCollectionNext object.
- :param str more_info: Link to documentation about deleted resources.
+ :param str href: The URL for a page of resources.
"""
- self.more_info = more_info
+ self.href = href
@classmethod
- def from_dict(cls, _dict: Dict) -> 'RouteReferenceDeleted':
- """Initialize a RouteReferenceDeleted object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'ReservationCollectionNext':
+ """Initialize a ReservationCollectionNext object from a json dictionary."""
args = {}
- if 'more_info' in _dict:
- args['more_info'] = _dict.get('more_info')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'more_info\' not present in RouteReferenceDeleted JSON')
+ raise ValueError('Required property \'href\' not present in ReservationCollectionNext JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a RouteReferenceDeleted object from a json dictionary."""
+ """Initialize a ReservationCollectionNext object from 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):
@@ -66733,291 +69943,109 @@ 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 ReservationCollectionNext object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'RouteReferenceDeleted') -> bool:
+ def __eq__(self, other: 'ReservationCollectionNext') -> bool:
"""Return `true` when 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: 'ReservationCollectionNext') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class RoutingTable:
+class ReservationCommittedUse:
"""
- RoutingTable.
+ The committed use reservation configuration.
- :attr List[ResourceFilter] accept_routes_from: The filters specifying the
- resources that may create routes in this routing table.
- At present, only the `resource_type` filter is permitted, and only the
- `vpn_server` value is supported, but filter support is expected to expand in the
- future.
- :attr datetime created_at: The date and time that this routing table was
- created.
- :attr str href: The URL for this routing table.
- :attr str id: The unique identifier for this routing table.
- :attr bool is_default: Indicates whether this is the default routing table for
- this VPC.
- :attr str lifecycle_state: The lifecycle state of the routing table.
- :attr str name: The name for this routing table. The name is unique across all
- routing tables for the VPC.
- :attr str resource_type: The resource type.
- :attr bool route_direct_link_ingress: Indicates whether this routing table is
- used to route traffic that originates from
- [Direct Link](https://cloud.ibm.com/docs/dl) to this VPC.
- Incoming traffic will be routed according to the routing table with one
- exception: routes with an `action` of `deliver` are treated as `drop` unless the
- `next_hop` is an IP address in a subnet in the route's `zone` that is able to
- accept traffic. Therefore, if an incoming packet matches a route with a
- `next_hop` of a VPN gateway connection, the packet will be dropped.
- :attr bool route_internet_ingress: Indicates whether this routing table is used
- to route traffic that originates from the internet.
- Incoming traffic will be routed according to the routing table with two
- exceptions:
- - Traffic destined for IP addresses associated with public gateways will not be
- subject to routes in this routing table.
- - Routes with an `action` of `deliver` are treated as `drop` unless the
- `next_hop` is
- an IP address in a subnet in the route's `zone` that is able to accept
- traffic.
- Therefore, if an incoming packet matches a route with a `next_hop` of a VPN
- gateway
- connection, the packet will be dropped.
- :attr bool route_transit_gateway_ingress: Indicates whether this routing table
- is used to route traffic that originates from from [Transit
- Gateway](https://cloud.ibm.com/docs/transit-gateway) to this VPC.
- Incoming traffic will be routed according to the routing table with one
- exception: routes with an `action` of `deliver` are treated as `drop` unless the
- `next_hop` is an IP address in a subnet in the route's `zone` that is able to
- accept traffic. Therefore, if an incoming packet matches a route with a
- `next_hop` of a VPN gateway connection, the packet will be dropped.
- :attr bool route_vpc_zone_ingress: Indicates whether this routing table is used
- to route traffic that originates from subnets in other zones in this VPC.
- Incoming traffic will be routed according to the routing table with one
- exception: routes with an `action` of `deliver` are treated as `drop` unless the
- `next_hop` is an IP address in a subnet in the route's `zone` that is able to
- accept traffic. Therefore, if an incoming packet matches a route with a
- `next_hop` of 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.
+ :param datetime expiration_at: The expiration date and time for this committed
+ use reservation.
+ :param str expiration_policy: The policy to apply when the committed use term
+ expires:
+ - `release`: Release any available capacity and let the reservation expire.
+ - `renew`: Renew for another term, provided the term remains listed in the
+ `reservation_terms` for the profile. Otherwise, let the reservation expire.
+ 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 resource on which the unexpected
+ property value was encountered.
+ :param str term: The term for this committed use reservation:
+ - `one_year`: 1 year
+ - `three_year`: 3 years
+ 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 resource on which the unexpected
+ property value was encountered.
"""
def __init__(
self,
- accept_routes_from: List['ResourceFilter'],
- created_at: datetime,
- href: str,
- id: str,
- is_default: bool,
- lifecycle_state: str,
- name: str,
- resource_type: str,
- route_direct_link_ingress: bool,
- route_internet_ingress: bool,
- route_transit_gateway_ingress: bool,
- route_vpc_zone_ingress: bool,
- routes: List['RouteReference'],
- subnets: List['SubnetReference'],
+ expiration_at: datetime,
+ expiration_policy: str,
+ term: str,
) -> None:
"""
- Initialize a RoutingTable object.
+ Initialize a ReservationCommittedUse object.
- :param List[ResourceFilter] accept_routes_from: The filters specifying the
- resources that may create routes in this routing table.
- At present, only the `resource_type` filter is permitted, and only the
- `vpn_server` value is supported, but filter support is expected to expand
- in the future.
- :param datetime created_at: The date and time that this routing table was
- created.
- :param str href: The URL for this routing table.
- :param str id: The unique identifier for this routing table.
- :param bool is_default: Indicates whether this is the default routing table
- for this VPC.
- :param str lifecycle_state: The lifecycle state of the routing table.
- :param str name: The name for this routing table. The name is unique across
- all routing tables for the VPC.
- :param str resource_type: The resource type.
- :param bool route_direct_link_ingress: Indicates whether this routing table
- is used to route traffic that originates from
- [Direct Link](https://cloud.ibm.com/docs/dl) to this VPC.
- Incoming traffic will be routed according to the routing table with one
- exception: routes with an `action` of `deliver` are treated as `drop`
- unless the `next_hop` is an IP address in a subnet in the route's `zone`
- that is able to accept traffic. Therefore, if an incoming packet matches a
- route with a `next_hop` of a VPN gateway connection, the packet will be
- dropped.
- :param bool route_internet_ingress: Indicates whether this routing table is
- used to route traffic that originates from the internet.
- Incoming traffic will be routed according to the routing table with two
- exceptions:
- - Traffic destined for IP addresses associated with public gateways will
- not be
- subject to routes in this routing table.
- - Routes with an `action` of `deliver` are treated as `drop` unless the
- `next_hop` is
- an IP address in a subnet in the route's `zone` that is able to accept
- traffic.
- Therefore, if an incoming packet matches a route with a `next_hop` of a
- VPN gateway
- connection, the packet will be dropped.
- :param bool route_transit_gateway_ingress: Indicates whether this routing
- table is used to route traffic that originates from from [Transit
- Gateway](https://cloud.ibm.com/docs/transit-gateway) to this VPC.
- Incoming traffic will be routed according to the routing table with one
- exception: routes with an `action` of `deliver` are treated as `drop`
- unless the `next_hop` is an IP address in a subnet in the route's `zone`
- that is able to accept traffic. Therefore, if an incoming packet matches a
- route with a `next_hop` of a VPN gateway connection, the packet will be
- dropped.
- :param bool route_vpc_zone_ingress: Indicates whether this routing table is
- used to route traffic that originates from subnets in other zones in this
- VPC.
- Incoming traffic will be routed according to the routing table with one
- exception: routes with an `action` of `deliver` are treated as `drop`
- unless the `next_hop` is an IP address in a subnet in the route's `zone`
- that is able to accept traffic. Therefore, if an incoming packet matches a
- route with a `next_hop` of 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 datetime expiration_at: The expiration date and time for this
+ committed use reservation.
+ :param str expiration_policy: The policy to apply when the committed use
+ term expires:
+ - `release`: Release any available capacity and let the reservation expire.
+ - `renew`: Renew for another term, provided the term remains listed in the
+ `reservation_terms` for the profile. Otherwise, let the reservation
+ expire.
+ 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 resource on which the
+ unexpected property value was encountered.
+ :param str term: The term for this committed use reservation:
+ - `one_year`: 1 year
+ - `three_year`: 3 years
+ 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 resource on which the
+ unexpected property value was encountered.
"""
- self.accept_routes_from = accept_routes_from
- self.created_at = created_at
- self.href = href
- self.id = id
- self.is_default = is_default
- self.lifecycle_state = lifecycle_state
- self.name = name
- self.resource_type = resource_type
- self.route_direct_link_ingress = route_direct_link_ingress
- self.route_internet_ingress = route_internet_ingress
- self.route_transit_gateway_ingress = route_transit_gateway_ingress
- self.route_vpc_zone_ingress = route_vpc_zone_ingress
- self.routes = routes
- self.subnets = subnets
+ self.expiration_at = expiration_at
+ self.expiration_policy = expiration_policy
+ self.term = term
@classmethod
- def from_dict(cls, _dict: Dict) -> 'RoutingTable':
- """Initialize a RoutingTable object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'ReservationCommittedUse':
+ """Initialize a ReservationCommittedUse object from a json dictionary."""
args = {}
- if 'accept_routes_from' in _dict:
- args['accept_routes_from'] = [ResourceFilter.from_dict(v) for v in _dict.get('accept_routes_from')]
- else:
- raise ValueError('Required property \'accept_routes_from\' not present in RoutingTable JSON')
- if 'created_at' in _dict:
- args['created_at'] = string_to_datetime(_dict.get('created_at'))
- else:
- raise ValueError('Required property \'created_at\' not present in RoutingTable JSON')
- if 'href' in _dict:
- args['href'] = _dict.get('href')
- else:
- 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 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')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
+ if (expiration_at := _dict.get('expiration_at')) is not None:
+ args['expiration_at'] = string_to_datetime(expiration_at)
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_internet_ingress' in _dict:
- args['route_internet_ingress'] = _dict.get('route_internet_ingress')
- else:
- raise ValueError('Required property \'route_internet_ingress\' not present in RoutingTable JSON')
- if 'route_transit_gateway_ingress' in _dict:
- args['route_transit_gateway_ingress'] = _dict.get('route_transit_gateway_ingress')
- else:
- raise ValueError('Required property \'route_transit_gateway_ingress\' not present in RoutingTable JSON')
- if 'route_vpc_zone_ingress' in _dict:
- args['route_vpc_zone_ingress'] = _dict.get('route_vpc_zone_ingress')
- else:
- raise ValueError('Required property \'route_vpc_zone_ingress\' not present in RoutingTable JSON')
- if 'routes' in _dict:
- args['routes'] = [RouteReference.from_dict(v) for v in _dict.get('routes')]
+ raise ValueError('Required property \'expiration_at\' not present in ReservationCommittedUse JSON')
+ if (expiration_policy := _dict.get('expiration_policy')) is not None:
+ args['expiration_policy'] = expiration_policy
else:
- raise ValueError('Required property \'routes\' not present in RoutingTable JSON')
- if 'subnets' in _dict:
- args['subnets'] = [SubnetReference.from_dict(v) for v in _dict.get('subnets')]
+ raise ValueError('Required property \'expiration_policy\' not present in ReservationCommittedUse JSON')
+ if (term := _dict.get('term')) is not None:
+ args['term'] = term
else:
- raise ValueError('Required property \'subnets\' not present in RoutingTable JSON')
+ raise ValueError('Required property \'term\' not present in ReservationCommittedUse JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a RoutingTable object from a json dictionary."""
+ """Initialize a ReservationCommittedUse object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'accept_routes_from') and self.accept_routes_from is not None:
- accept_routes_from_list = []
- for v in self.accept_routes_from:
- if isinstance(v, dict):
- accept_routes_from_list.append(v)
- else:
- accept_routes_from_list.append(v.to_dict())
- _dict['accept_routes_from'] = accept_routes_from_list
- if hasattr(self, 'created_at') and self.created_at is not None:
- _dict['created_at'] = datetime_to_string(self.created_at)
- if hasattr(self, 'href') and self.href is not None:
- _dict['href'] = self.href
- if hasattr(self, 'id') and self.id is not None:
- _dict['id'] = self.id
- if hasattr(self, 'is_default') and self.is_default is not None:
- _dict['is_default'] = self.is_default
- if hasattr(self, 'lifecycle_state') and self.lifecycle_state is not None:
- _dict['lifecycle_state'] = self.lifecycle_state
- if hasattr(self, 'name') and self.name is not None:
- _dict['name'] = self.name
- if hasattr(self, 'resource_type') and self.resource_type is not None:
- _dict['resource_type'] = self.resource_type
- if hasattr(self, 'route_direct_link_ingress') and self.route_direct_link_ingress is not None:
- _dict['route_direct_link_ingress'] = self.route_direct_link_ingress
- if hasattr(self, 'route_internet_ingress') and self.route_internet_ingress is not None:
- _dict['route_internet_ingress'] = self.route_internet_ingress
- if hasattr(self, 'route_transit_gateway_ingress') and self.route_transit_gateway_ingress is not None:
- _dict['route_transit_gateway_ingress'] = self.route_transit_gateway_ingress
- if hasattr(self, 'route_vpc_zone_ingress') and self.route_vpc_zone_ingress is not None:
- _dict['route_vpc_zone_ingress'] = self.route_vpc_zone_ingress
- if hasattr(self, 'routes') and self.routes is not None:
- routes_list = []
- for v in self.routes:
- if isinstance(v, dict):
- routes_list.append(v)
- else:
- routes_list.append(v.to_dict())
- _dict['routes'] = routes_list
- if hasattr(self, 'subnets') and self.subnets is not None:
- subnets_list = []
- for v in self.subnets:
- if isinstance(v, dict):
- subnets_list.append(v)
- else:
- subnets_list.append(v.to_dict())
- _dict['subnets'] = subnets_list
+ if hasattr(self, 'expiration_at') and self.expiration_at is not None:
+ _dict['expiration_at'] = datetime_to_string(self.expiration_at)
+ if hasattr(self, 'expiration_policy') and self.expiration_policy is not None:
+ _dict['expiration_policy'] = self.expiration_policy
+ if hasattr(self, 'term') and self.term is not None:
+ _dict['term'] = self.term
return _dict
def _to_dict(self):
@@ -67025,138 +70053,363 @@ 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 ReservationCommittedUse object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'RoutingTable') -> bool:
+ def __eq__(self, other: 'ReservationCommittedUse') -> bool:
"""Return `true` when 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: 'ReservationCommittedUse') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class LifecycleStateEnum(str, Enum):
+ class ExpirationPolicyEnum(str, Enum):
"""
- The lifecycle state of the routing table.
+ The policy to apply when the committed use term expires:
+ - `release`: Release any available capacity and let the reservation expire.
+ - `renew`: Renew for another term, provided the term remains listed in the
+ `reservation_terms` for the profile. Otherwise, let the reservation expire.
+ 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 resource on which the unexpected property value
+ was encountered.
"""
- DELETING = 'deleting'
- FAILED = 'failed'
- PENDING = 'pending'
- STABLE = 'stable'
- SUSPENDED = 'suspended'
- UPDATING = 'updating'
- WAITING = 'waiting'
+ RELEASE = 'release'
+ RENEW = 'renew'
- class ResourceTypeEnum(str, Enum):
+
+class ReservationCommittedUsePatch:
+ """
+ ReservationCommittedUsePatch.
+
+ :param str expiration_policy: (optional) The policy to apply when the committed
+ use term expires:
+ - `release`: Release any available capacity and let the reservation expire.
+ - `renew`: Renew for another term, provided the term remains listed in the
+ `reservation_terms` for the profile. Otherwise, let the reservation expire.
+ 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 resource on which the unexpected
+ property value was encountered.
+ :param str term: (optional) The term for this committed use reservation:
+ - `one_year`: 1 year
+ - `three_year`: 3 years
+ The specified value must be listed in the `reservation_terms` in the profile for
+ this reservation. The term can only be changed for a reservation with a `status`
+ of
+ `inactive`.
+ """
+
+ def __init__(
+ self,
+ *,
+ expiration_policy: Optional[str] = None,
+ term: Optional[str] = None,
+ ) -> None:
"""
- The resource type.
+ Initialize a ReservationCommittedUsePatch object.
+
+ :param str expiration_policy: (optional) The policy to apply when the
+ committed use term expires:
+ - `release`: Release any available capacity and let the reservation expire.
+ - `renew`: Renew for another term, provided the term remains listed in the
+ `reservation_terms` for the profile. Otherwise, let the reservation
+ expire.
+ 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 resource on which the
+ unexpected property value was encountered.
+ :param str term: (optional) The term for this committed use reservation:
+ - `one_year`: 1 year
+ - `three_year`: 3 years
+ The specified value must be listed in the `reservation_terms` in the
+ profile for this reservation. The term can only be changed for a
+ reservation with a `status` of
+ `inactive`.
"""
+ self.expiration_policy = expiration_policy
+ self.term = term
- ROUTING_TABLE = 'routing_table'
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'ReservationCommittedUsePatch':
+ """Initialize a ReservationCommittedUsePatch object from a json dictionary."""
+ args = {}
+ if (expiration_policy := _dict.get('expiration_policy')) is not None:
+ args['expiration_policy'] = expiration_policy
+ if (term := _dict.get('term')) is not None:
+ args['term'] = term
+ return cls(**args)
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a ReservationCommittedUsePatch object from a json dictionary."""
+ return cls.from_dict(_dict)
+ def to_dict(self) -> Dict:
+ """Return a json dictionary representing this model."""
+ _dict = {}
+ if hasattr(self, 'expiration_policy') and self.expiration_policy is not None:
+ _dict['expiration_policy'] = self.expiration_policy
+ if hasattr(self, 'term') and self.term is not None:
+ _dict['term'] = self.term
+ return _dict
-class RoutingTableCollection:
+ def _to_dict(self):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
+
+ def __str__(self) -> str:
+ """Return a `str` version of this ReservationCommittedUsePatch object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'ReservationCommittedUsePatch') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'ReservationCommittedUsePatch') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+ class ExpirationPolicyEnum(str, Enum):
+ """
+ The policy to apply when the committed use term expires:
+ - `release`: Release any available capacity and let the reservation expire.
+ - `renew`: Renew for another term, provided the term remains listed in the
+ `reservation_terms` for the profile. Otherwise, let the reservation expire.
+ 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 resource on which the unexpected property value
+ was encountered.
+ """
+
+ RELEASE = 'release'
+ RENEW = 'renew'
+
+
+
+class ReservationCommittedUsePrototype:
"""
- RoutingTableCollection.
+ ReservationCommittedUsePrototype.
- :attr RoutingTableCollectionFirst first: A link to the first page of resources.
- :attr int limit: The maximum number of resources that can be returned by the
- request.
- :attr RoutingTableCollectionNext next: (optional) A link to the next page of
- resources. This property is present for all pages
- except the last page.
- :attr List[RoutingTable] routing_tables: Collection of routing tables.
- :attr int total_count: The total number of resources across all pages.
+ :param str expiration_policy: (optional) The policy to apply when the committed
+ use term expires:
+ - `release`: Release any available capacity and let the reservation expire.
+ - `renew`: Renew for another term, provided the term remains listed in the
+ `reservation_terms` for the profile. Otherwise, let the reservation expire.
+ 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 resource on which the unexpected
+ property value was encountered.
+ :param str term: The term for this committed use reservation:
+ - `one_year`: 1 year
+ - `three_year`: 3 years
+ The specified value must be listed in the `reservation_terms` in the profile for
+ this reservation.
"""
def __init__(
self,
- first: 'RoutingTableCollectionFirst',
- limit: int,
- routing_tables: List['RoutingTable'],
- total_count: int,
+ term: str,
*,
- next: 'RoutingTableCollectionNext' = None,
+ expiration_policy: Optional[str] = None,
) -> None:
"""
- Initialize a RoutingTableCollection object.
+ Initialize a ReservationCommittedUsePrototype object.
- :param RoutingTableCollectionFirst first: A link to the first page of
- resources.
- :param int limit: The maximum number of resources that can be returned by
- the request.
- :param List[RoutingTable] routing_tables: Collection of routing tables.
- :param int total_count: The total number of resources across all pages.
- :param RoutingTableCollectionNext next: (optional) A link to the next page
- of resources. This property is present for all pages
- except the last page.
+ :param str term: The term for this committed use reservation:
+ - `one_year`: 1 year
+ - `three_year`: 3 years
+ The specified value must be listed in the `reservation_terms` in the
+ profile for this reservation.
+ :param str expiration_policy: (optional) The policy to apply when the
+ committed use term expires:
+ - `release`: Release any available capacity and let the reservation expire.
+ - `renew`: Renew for another term, provided the term remains listed in the
+ `reservation_terms` for the profile. Otherwise, let the reservation
+ expire.
+ 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 resource on which the
+ unexpected property value was encountered.
"""
- self.first = first
- self.limit = limit
- self.next = next
- self.routing_tables = routing_tables
- self.total_count = total_count
+ self.expiration_policy = expiration_policy
+ self.term = term
@classmethod
- def from_dict(cls, _dict: Dict) -> 'RoutingTableCollection':
- """Initialize a RoutingTableCollection object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'ReservationCommittedUsePrototype':
+ """Initialize a ReservationCommittedUsePrototype object from a json dictionary."""
args = {}
- if 'first' in _dict:
- args['first'] = RoutingTableCollectionFirst.from_dict(_dict.get('first'))
- else:
- raise ValueError('Required property \'first\' not present in RoutingTableCollection JSON')
- if 'limit' in _dict:
- args['limit'] = _dict.get('limit')
- else:
- raise ValueError('Required property \'limit\' not present in RoutingTableCollection JSON')
- if 'next' in _dict:
- args['next'] = RoutingTableCollectionNext.from_dict(_dict.get('next'))
- if 'routing_tables' in _dict:
- args['routing_tables'] = [RoutingTable.from_dict(v) for v in _dict.get('routing_tables')]
- else:
- raise ValueError('Required property \'routing_tables\' not present in RoutingTableCollection JSON')
- if 'total_count' in _dict:
- args['total_count'] = _dict.get('total_count')
+ if (expiration_policy := _dict.get('expiration_policy')) is not None:
+ args['expiration_policy'] = expiration_policy
+ if (term := _dict.get('term')) is not None:
+ args['term'] = term
else:
- raise ValueError('Required property \'total_count\' not present in RoutingTableCollection JSON')
+ raise ValueError('Required property \'term\' not present in ReservationCommittedUsePrototype JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a RoutingTableCollection object from a json dictionary."""
+ """Initialize a ReservationCommittedUsePrototype object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'first') and self.first is not None:
- if isinstance(self.first, dict):
- _dict['first'] = self.first
+ if hasattr(self, 'expiration_policy') and self.expiration_policy is not None:
+ _dict['expiration_policy'] = self.expiration_policy
+ if hasattr(self, 'term') and self.term is not None:
+ _dict['term'] = self.term
+ return _dict
+
+ def _to_dict(self):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
+
+ def __str__(self) -> str:
+ """Return a `str` version of this ReservationCommittedUsePrototype object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'ReservationCommittedUsePrototype') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'ReservationCommittedUsePrototype') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+ class ExpirationPolicyEnum(str, Enum):
+ """
+ The policy to apply when the committed use term expires:
+ - `release`: Release any available capacity and let the reservation expire.
+ - `renew`: Renew for another term, provided the term remains listed in the
+ `reservation_terms` for the profile. Otherwise, let the reservation expire.
+ 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 resource on which the unexpected property value
+ was encountered.
+ """
+
+ RELEASE = 'release'
+ RENEW = 'renew'
+
+
+
+class ReservationIdentity:
+ """
+ Identifies a reservation by a unique property.
+
+ """
+
+ def __init__(
+ self,
+ ) -> None:
+ """
+ Initialize a ReservationIdentity object.
+
+ """
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['ReservationIdentityById', 'ReservationIdentityByCRN', 'ReservationIdentityByHref'])
+ )
+ raise Exception(msg)
+
+
+class ReservationPatch:
+ """
+ ReservationPatch.
+
+ :param ReservationCapacityPatch capacity: (optional) The capacity reservation
+ configuration to use.
+ The configuration can only be changed for reservations with a `status` of
+ `inactive`.
+ :param ReservationCommittedUsePatch committed_use: (optional) The committed use
+ configuration to use for this reservation.
+ :param str name: (optional) The name for this reservation. The name must not be
+ used by another reservation in the region.
+ :param ReservationProfilePatch profile: (optional) The
+ [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this
+ reservation.
+ The profile can only be changed for a reservation with a `status` of `inactive`.
+ """
+
+ def __init__(
+ self,
+ *,
+ capacity: Optional['ReservationCapacityPatch'] = None,
+ committed_use: Optional['ReservationCommittedUsePatch'] = None,
+ name: Optional[str] = None,
+ profile: Optional['ReservationProfilePatch'] = None,
+ ) -> None:
+ """
+ Initialize a ReservationPatch object.
+
+ :param ReservationCapacityPatch capacity: (optional) The capacity
+ reservation configuration to use.
+ The configuration can only be changed for reservations with a `status` of
+ `inactive`.
+ :param ReservationCommittedUsePatch committed_use: (optional) The committed
+ use configuration to use for this reservation.
+ :param str name: (optional) The name for this reservation. The name must
+ not be used by another reservation in the region.
+ :param ReservationProfilePatch profile: (optional) The
+ [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for
+ this
+ reservation.
+ The profile can only be changed for a reservation with a `status` of
+ `inactive`.
+ """
+ self.capacity = capacity
+ self.committed_use = committed_use
+ self.name = name
+ self.profile = profile
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'ReservationPatch':
+ """Initialize a ReservationPatch object from a json dictionary."""
+ args = {}
+ if (capacity := _dict.get('capacity')) is not None:
+ args['capacity'] = ReservationCapacityPatch.from_dict(capacity)
+ if (committed_use := _dict.get('committed_use')) is not None:
+ args['committed_use'] = ReservationCommittedUsePatch.from_dict(committed_use)
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ if (profile := _dict.get('profile')) is not None:
+ args['profile'] = ReservationProfilePatch.from_dict(profile)
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a ReservationPatch object from 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:
+ if isinstance(self.capacity, dict):
+ _dict['capacity'] = self.capacity
else:
- _dict['first'] = self.first.to_dict()
- if hasattr(self, 'limit') and self.limit is not None:
- _dict['limit'] = self.limit
- if hasattr(self, 'next') and self.next is not None:
- if isinstance(self.next, dict):
- _dict['next'] = self.next
+ _dict['capacity'] = self.capacity.to_dict()
+ if hasattr(self, 'committed_use') and self.committed_use is not None:
+ if isinstance(self.committed_use, dict):
+ _dict['committed_use'] = self.committed_use
else:
- _dict['next'] = self.next.to_dict()
- if hasattr(self, 'routing_tables') and self.routing_tables is not None:
- routing_tables_list = []
- for v in self.routing_tables:
- if isinstance(v, dict):
- routing_tables_list.append(v)
- else:
- routing_tables_list.append(v.to_dict())
- _dict['routing_tables'] = routing_tables_list
- if hasattr(self, 'total_count') and self.total_count is not None:
- _dict['total_count'] = self.total_count
+ _dict['committed_use'] = self.committed_use.to_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()
return _dict
def _to_dict(self):
@@ -67164,51 +70417,69 @@ 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 ReservationPatch object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'RoutingTableCollection') -> bool:
+ def __eq__(self, other: 'ReservationPatch') -> bool:
"""Return `true` when 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: 'ReservationPatch') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class RoutingTableCollectionFirst:
+class ReservationProfile:
"""
- A link to the first page of resources.
+ The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) for this reservation.
- :attr 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.
+ :param str resource_type: The resource type.
"""
def __init__(
self,
href: str,
+ name: str,
+ resource_type: str,
) -> None:
"""
- Initialize a RoutingTableCollectionFirst object.
+ Initialize a ReservationProfile 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.
+ :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) -> 'RoutingTableCollectionFirst':
- """Initialize a RoutingTableCollectionFirst object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'ReservationProfile':
+ """Initialize a ReservationProfile object from a json dictionary."""
args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'href\' not present in RoutingTableCollectionFirst JSON')
+ raise ValueError('Required property \'href\' not present in ReservationProfile JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ else:
+ raise ValueError('Required property \'name\' not present in ReservationProfile JSON')
+ if (resource_type := _dict.get('resource_type')) is not None:
+ args['resource_type'] = resource_type
+ else:
+ raise ValueError('Required property \'resource_type\' not present in ReservationProfile JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a RoutingTableCollectionFirst object from a json dictionary."""
+ """Initialize a ReservationProfile object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -67216,6 +70487,10 @@ 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
+ if hasattr(self, 'resource_type') and self.resource_type is not None:
+ _dict['resource_type'] = self.resource_type
return _dict
def _to_dict(self):
@@ -67223,59 +70498,75 @@ 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 ReservationProfile object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'RoutingTableCollectionFirst') -> bool:
+ def __eq__(self, other: 'ReservationProfile') -> bool:
"""Return `true` when 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: 'ReservationProfile') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
+ class ResourceTypeEnum(str, Enum):
+ """
+ The resource type.
+ """
+
+ INSTANCE_PROFILE = 'instance_profile'
-class RoutingTableCollectionNext:
+
+
+class ReservationProfilePatch:
"""
- A link to the next page of resources. This property is present for all pages except
- the last page.
+ The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this
+ reservation.
+ The profile can only be changed for a reservation with a `status` of `inactive`.
- :attr str href: The URL for a page of resources.
+ :param str name: (optional) The globally unique name of the profile.
+ :param str resource_type: (optional) The resource type of the profile.
"""
def __init__(
self,
- href: str,
+ *,
+ name: Optional[str] = None,
+ resource_type: Optional[str] = None,
) -> None:
"""
- Initialize a RoutingTableCollectionNext object.
+ Initialize a ReservationProfilePatch object.
- :param str href: The URL for a page of resources.
+ :param str name: (optional) The globally unique name of the profile.
+ :param str resource_type: (optional) The resource type of the profile.
"""
- self.href = href
+ self.name = name
+ self.resource_type = resource_type
@classmethod
- def from_dict(cls, _dict: Dict) -> 'RoutingTableCollectionNext':
- """Initialize a RoutingTableCollectionNext object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'ReservationProfilePatch':
+ """Initialize a ReservationProfilePatch 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')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ if (resource_type := _dict.get('resource_type')) is not None:
+ args['resource_type'] = resource_type
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a RoutingTableCollectionNext object from a json dictionary."""
+ """Initialize a ReservationProfilePatch object from 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):
@@ -67283,246 +70574,77 @@ 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 ReservationProfilePatch object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'RoutingTableCollectionNext') -> bool:
+ def __eq__(self, other: 'ReservationProfilePatch') -> bool:
"""Return `true` when 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: 'ReservationProfilePatch') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
+ class ResourceTypeEnum(str, Enum):
+ """
+ The resource type of the profile.
+ """
+
+ INSTANCE_PROFILE = 'instance_profile'
-class RoutingTableIdentity:
+
+
+class ReservationProfilePrototype:
"""
- Identifies a routing table by a unique property.
+ The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this
+ reservation.
+ :param str name: The globally unique name of the profile.
+ :param str resource_type: The resource type of the profile.
"""
def __init__(
self,
+ name: str,
+ resource_type: str,
) -> None:
"""
- Initialize a RoutingTableIdentity object.
+ Initialize a ReservationProfilePrototype object.
+ :param str name: The globally unique name of the profile.
+ :param str resource_type: The resource type of the profile.
"""
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['RoutingTableIdentityById', 'RoutingTableIdentityByHref'])
- )
- raise Exception(msg)
+ self.name = name
+ self.resource_type = resource_type
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'ReservationProfilePrototype':
+ """Initialize a ReservationProfilePrototype object from a json dictionary."""
+ args = {}
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ else:
+ raise ValueError('Required property \'name\' not present in ReservationProfilePrototype JSON')
+ if (resource_type := _dict.get('resource_type')) is not None:
+ args['resource_type'] = resource_type
+ else:
+ raise ValueError('Required property \'resource_type\' not present in ReservationProfilePrototype JSON')
+ return cls(**args)
-class RoutingTablePatch:
- """
- RoutingTablePatch.
-
- :attr List[ResourceFilter] accept_routes_from: (optional) The filters specifying
- the resources that may create routes in this routing table
- (replacing any existing filters). All routes created by resources that match a
- given filter will be removed when an existing filter is removed. Therefore, if
- an empty array is specified, all filters will be removed, resulting in all
- routes not directly created by the user being removed.
- At present, only the `resource_type` filter is permitted, and only the
- `vpn_server` value is supported, but filter support is expected to expand in the
- future.
- :attr str name: (optional) The name for this routing table. The name must not be
- used by another routing table in the VPC.
- :attr bool route_direct_link_ingress: (optional) Indicates whether this routing
- table is used to route traffic that originates from
- [Direct Link](https://cloud.ibm.com/docs/dl/) to this VPC. Updating to `true`
- selects this routing table, provided no other routing table in the VPC already
- has this property set to `true`, and no subnets are attached to this routing
- table. Updating to
- `false` deselects this routing table.
- Incoming traffic will be routed according to the routing table with one
- exception: routes with an `action` of `deliver` are treated as `drop` unless the
- `next_hop` is an IP address in a subnet in the route's `zone` that is able to
- accept traffic. Therefore, if an incoming packet matches a route with a
- `next_hop` of a VPN gateway connection, the packet will be dropped.
- :attr bool route_internet_ingress: (optional) Indicates whether this routing
- table is used to route traffic that originates from the internet. Updating to
- `true` selects this routing table, provided no other routing table in the VPC
- already has this property set to `true`. Updating to `false` deselects this
- routing table.
- Incoming traffic will be routed according to the routing table with two
- exceptions:
- - Traffic destined for IP addresses associated with public gateways will not be
- subject
- to routes in this routing table.
- - Routes with an `action` of `deliver` are treated as `drop` unless the
- `next_hop` is an
- IP address in a subnet in the route's `zone` that is able to accept traffic.
- Therefore, if an incoming packet matches a route with a `next_hop` of a VPN
- gateway
- connection, the packet will be dropped.
- :attr bool route_transit_gateway_ingress: (optional) Indicates whether this
- routing table is used to route traffic that originates from
- [Transit Gateway](https://cloud.ibm.com/docs/transit-gateway) to this VPC.
- Updating to
- `true` selects this routing table, provided no other routing table in the VPC
- already has this property set to `true`, and no subnets are attached to this
- routing table. Updating to `false` deselects this routing table.
- Incoming traffic will be routed according to the routing table with one
- exception: routes with an `action` of `deliver` are treated as `drop` unless the
- `next_hop` is an IP address in a subnet in the route's `zone` that is able to
- accept traffic. Therefore, if an incoming packet matches a route with a
- `next_hop` of a VPN gateway connection, the packet will be dropped.
- If [Classic
- Access](https://cloud.ibm.com/docs/vpc?topic=vpc-setting-up-access-to-classic-infrastructure)
- is enabled for this VPC, and this property is set to `true`, its incoming
- traffic will also be routed according to this routing table.
- :attr bool route_vpc_zone_ingress: (optional) Indicates whether this routing
- table is used to route traffic that originates from subnets in other zones in
- this VPC. Updating to `true` selects this routing table, provided no other
- routing table in the VPC already has this property set to `true`, and no subnets
- are attached to this routing table. Updating to `false` deselects this routing
- table.
- Incoming traffic will be routed according to the routing table with one
- exception: routes with an `action` of `deliver` are treated as `drop` unless the
- `next_hop` is an IP address in a subnet in the route's `zone` that is able to
- accept traffic. Therefore, if an incoming packet matches a route with a
- `next_hop` of a VPN gateway connection, the packet will be dropped.
- """
-
- def __init__(
- self,
- *,
- accept_routes_from: List['ResourceFilter'] = None,
- name: str = None,
- route_direct_link_ingress: bool = None,
- route_internet_ingress: bool = None,
- route_transit_gateway_ingress: bool = None,
- route_vpc_zone_ingress: bool = None,
- ) -> None:
- """
- Initialize a RoutingTablePatch object.
-
- :param List[ResourceFilter] accept_routes_from: (optional) The filters
- specifying the resources that may create routes in this routing table
- (replacing any existing filters). All routes created by resources that
- match a given filter will be removed when an existing filter is removed.
- Therefore, if an empty array is specified, all filters will be removed,
- resulting in all routes not directly created by the user being removed.
- At present, only the `resource_type` filter is permitted, and only the
- `vpn_server` value is supported, but filter support is expected to expand
- in the future.
- :param str name: (optional) The name for this routing table. The name must
- not be used by another routing table in the VPC.
- :param bool route_direct_link_ingress: (optional) Indicates whether this
- routing table is used to route traffic that originates from
- [Direct Link](https://cloud.ibm.com/docs/dl/) to this VPC. Updating to
- `true` selects this routing table, provided no other routing table in the
- VPC already has this property set to `true`, and no subnets are attached to
- this routing table. Updating to
- `false` deselects this routing table.
- Incoming traffic will be routed according to the routing table with one
- exception: routes with an `action` of `deliver` are treated as `drop`
- unless the `next_hop` is an IP address in a subnet in the route's `zone`
- that is able to accept traffic. Therefore, if an incoming packet matches a
- route with a `next_hop` of a VPN gateway connection, the packet will be
- dropped.
- :param bool route_internet_ingress: (optional) Indicates whether this
- routing table is used to route traffic that originates from the internet.
- Updating to `true` selects this routing table, provided no other routing
- table in the VPC already has this property set to `true`. Updating to
- `false` deselects this routing table.
- Incoming traffic will be routed according to the routing table with two
- exceptions:
- - Traffic destined for IP addresses associated with public gateways will
- not be subject
- to routes in this routing table.
- - Routes with an `action` of `deliver` are treated as `drop` unless the
- `next_hop` is an
- IP address in a subnet in the route's `zone` that is able to accept
- traffic.
- Therefore, if an incoming packet matches a route with a `next_hop` of a
- VPN gateway
- connection, the packet will be dropped.
- :param bool route_transit_gateway_ingress: (optional) Indicates whether
- this routing table is used to route traffic that originates from
- [Transit Gateway](https://cloud.ibm.com/docs/transit-gateway) to this VPC.
- Updating to
- `true` selects this routing table, provided no other routing table in the
- VPC already has this property set to `true`, and no subnets are attached to
- this routing table. Updating to `false` deselects this routing table.
- Incoming traffic will be routed according to the routing table with one
- exception: routes with an `action` of `deliver` are treated as `drop`
- unless the `next_hop` is an IP address in a subnet in the route's `zone`
- that is able to accept traffic. Therefore, if an incoming packet matches a
- route with a `next_hop` of a VPN gateway connection, the packet will be
- dropped.
- If [Classic
- Access](https://cloud.ibm.com/docs/vpc?topic=vpc-setting-up-access-to-classic-infrastructure)
- is enabled for this VPC, and this property is set to `true`, its incoming
- traffic will also be routed according to this routing table.
- :param bool route_vpc_zone_ingress: (optional) Indicates whether this
- routing table is used to route traffic that originates from subnets in
- other zones in this VPC. Updating to `true` selects this routing table,
- provided no other routing table in the VPC already has this property set to
- `true`, and no subnets are attached to this routing table. Updating to
- `false` deselects this routing table.
- Incoming traffic will be routed according to the routing table with one
- exception: routes with an `action` of `deliver` are treated as `drop`
- unless the `next_hop` is an IP address in a subnet in the route's `zone`
- that is able to accept traffic. Therefore, if an incoming packet matches a
- route with a `next_hop` of a VPN gateway connection, the packet will be
- dropped.
- """
- self.accept_routes_from = accept_routes_from
- self.name = name
- self.route_direct_link_ingress = route_direct_link_ingress
- self.route_internet_ingress = route_internet_ingress
- self.route_transit_gateway_ingress = route_transit_gateway_ingress
- self.route_vpc_zone_ingress = route_vpc_zone_ingress
-
- @classmethod
- def from_dict(cls, _dict: Dict) -> 'RoutingTablePatch':
- """Initialize a RoutingTablePatch object from a json dictionary."""
- args = {}
- if 'accept_routes_from' in _dict:
- args['accept_routes_from'] = [ResourceFilter.from_dict(v) for v in _dict.get('accept_routes_from')]
- if 'name' in _dict:
- args['name'] = _dict.get('name')
- if 'route_direct_link_ingress' in _dict:
- args['route_direct_link_ingress'] = _dict.get('route_direct_link_ingress')
- if 'route_internet_ingress' in _dict:
- args['route_internet_ingress'] = _dict.get('route_internet_ingress')
- if 'route_transit_gateway_ingress' in _dict:
- args['route_transit_gateway_ingress'] = _dict.get('route_transit_gateway_ingress')
- if 'route_vpc_zone_ingress' in _dict:
- args['route_vpc_zone_ingress'] = _dict.get('route_vpc_zone_ingress')
- return cls(**args)
-
- @classmethod
- def _from_dict(cls, _dict):
- """Initialize a RoutingTablePatch object from a json dictionary."""
- return cls.from_dict(_dict)
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a ReservationProfilePrototype object from a json dictionary."""
+ return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'accept_routes_from') and self.accept_routes_from is not None:
- accept_routes_from_list = []
- for v in self.accept_routes_from:
- if isinstance(v, dict):
- accept_routes_from_list.append(v)
- else:
- accept_routes_from_list.append(v.to_dict())
- _dict['accept_routes_from'] = accept_routes_from_list
if hasattr(self, 'name') and self.name is not None:
_dict['name'] = self.name
- if hasattr(self, 'route_direct_link_ingress') and self.route_direct_link_ingress is not None:
- _dict['route_direct_link_ingress'] = self.route_direct_link_ingress
- if hasattr(self, 'route_internet_ingress') and self.route_internet_ingress is not None:
- _dict['route_internet_ingress'] = self.route_internet_ingress
- if hasattr(self, 'route_transit_gateway_ingress') and self.route_transit_gateway_ingress is not None:
- _dict['route_transit_gateway_ingress'] = self.route_transit_gateway_ingress
- if hasattr(self, 'route_vpc_zone_ingress') and self.route_vpc_zone_ingress is not None:
- _dict['route_vpc_zone_ingress'] = self.route_vpc_zone_ingress
+ if hasattr(self, 'resource_type') and self.resource_type is not None:
+ _dict['resource_type'] = self.resource_type
return _dict
def _to_dict(self):
@@ -67530,55 +70652,67 @@ 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 ReservationProfilePrototype object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'RoutingTablePatch') -> bool:
+ def __eq__(self, other: 'ReservationProfilePrototype') -> bool:
"""Return `true` when 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: 'ReservationProfilePrototype') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
+ class ResourceTypeEnum(str, Enum):
+ """
+ The resource type of the profile.
+ """
+
+ INSTANCE_PROFILE = 'instance_profile'
-class RoutingTableReference:
+
+
+class ReservationReference:
"""
- RoutingTableReference.
+ ReservationReference.
- :attr RoutingTableReferenceDeleted deleted: (optional) If present, this property
+ :param str crn: The CRN for this reservation.
+ :param ReservationReferenceDeleted deleted: (optional) If present, this property
indicates the referenced resource has been deleted, and provides
some supplementary information.
- :attr str href: The URL for this routing table.
- :attr str id: The unique identifier for this routing table.
- :attr str name: The name for this routing table. The name is unique across all
- routing tables for the VPC.
- :attr str resource_type: The resource type.
+ :param str href: The URL for this reservation.
+ :param str id: The unique identifier for this reservation.
+ :param str name: The name for this reservation. The name is unique across all
+ reservations in the region.
+ :param str resource_type: The resource type.
"""
def __init__(
self,
+ crn: str,
href: str,
id: str,
name: str,
resource_type: str,
*,
- deleted: 'RoutingTableReferenceDeleted' = None,
+ deleted: Optional['ReservationReferenceDeleted'] = None,
) -> None:
"""
- Initialize a RoutingTableReference object.
+ Initialize a ReservationReference object.
- :param str href: The URL for this routing table.
- :param str id: The unique identifier for this routing table.
- :param str name: The name for this routing table. The name is unique across
- all routing tables for the VPC.
+ :param str crn: The CRN for this reservation.
+ :param str href: The URL for this reservation.
+ :param str id: The unique identifier for this reservation.
+ :param str name: The name for this reservation. The name is unique across
+ all reservations in the region.
:param str resource_type: The resource type.
- :param RoutingTableReferenceDeleted deleted: (optional) If present, this
+ :param ReservationReferenceDeleted 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
@@ -67586,37 +70720,43 @@ def __init__(
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) -> 'ReservationReference':
+ """Initialize a ReservationReference 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')
+ if (crn := _dict.get('crn')) is not None:
+ args['crn'] = crn
else:
- raise ValueError('Required property \'href\' not present in RoutingTableReference JSON')
- if 'id' in _dict:
- args['id'] = _dict.get('id')
+ raise ValueError('Required property \'crn\' not present in ReservationReference JSON')
+ if (deleted := _dict.get('deleted')) is not None:
+ args['deleted'] = ReservationReferenceDeleted.from_dict(deleted)
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'id\' not present in RoutingTableReference JSON')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
+ raise ValueError('Required property \'href\' not present in ReservationReference JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
else:
- raise ValueError('Required property \'name\' not present in RoutingTableReference JSON')
- if 'resource_type' in _dict:
- args['resource_type'] = _dict.get('resource_type')
+ raise ValueError('Required property \'id\' not present in ReservationReference JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
else:
- raise ValueError('Required property \'resource_type\' not present in RoutingTableReference JSON')
+ raise ValueError('Required property \'name\' not present in ReservationReference JSON')
+ if (resource_type := _dict.get('resource_type')) is not None:
+ args['resource_type'] = resource_type
+ else:
+ raise ValueError('Required property \'resource_type\' not present in ReservationReference JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a RoutingTableReference object from a json dictionary."""
+ """Initialize a ReservationReference object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
+ if hasattr(self, 'crn') and self.crn is not None:
+ _dict['crn'] = self.crn
if hasattr(self, 'deleted') and self.deleted is not None:
if isinstance(self.deleted, dict):
_dict['deleted'] = self.deleted
@@ -67637,16 +70777,16 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this RoutingTableReference object."""
+ """Return a `str` version of this ReservationReference object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'RoutingTableReference') -> bool:
+ def __eq__(self, other: 'ReservationReference') -> bool:
"""Return `true` when 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: 'ReservationReference') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
@@ -67655,16 +70795,16 @@ class ResourceTypeEnum(str, Enum):
The resource type.
"""
- ROUTING_TABLE = 'routing_table'
+ RESERVATION = 'reservation'
-class RoutingTableReferenceDeleted:
+class ReservationReferenceDeleted:
"""
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.
+ :param str more_info: Link to documentation about deleted resources.
"""
def __init__(
@@ -67672,25 +70812,25 @@ def __init__(
more_info: str,
) -> None:
"""
- Initialize a RoutingTableReferenceDeleted object.
+ Initialize a ReservationReferenceDeleted 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) -> 'ReservationReferenceDeleted':
+ """Initialize a ReservationReferenceDeleted object from a json dictionary."""
args = {}
- if 'more_info' in _dict:
- args['more_info'] = _dict.get('more_info')
+ if (more_info := _dict.get('more_info')) is not None:
+ args['more_info'] = more_info
else:
- raise ValueError('Required property \'more_info\' not present in RoutingTableReferenceDeleted JSON')
+ raise ValueError('Required property \'more_info\' not present in ReservationReferenceDeleted JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a RoutingTableReferenceDeleted object from a json dictionary."""
+ """Initialize a ReservationReferenceDeleted object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -67705,166 +70845,261 @@ 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 ReservationReferenceDeleted object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'RoutingTableReferenceDeleted') -> bool:
+ def __eq__(self, other: 'ReservationReferenceDeleted') -> bool:
"""Return `true` when 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: 'ReservationReferenceDeleted') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class SecurityGroup:
+class ReservationStatusReason:
"""
- SecurityGroup.
+ ReservationStatusReason.
- :attr datetime created_at: The date and time that this security group was
- created.
- :attr str crn: The security group's CRN.
- :attr str href: The security group's canonical URL.
- :attr str id: The unique identifier for this security group.
- :attr str name: The name for this security group. The name is unique across all
- security groups for the VPC.
- :attr ResourceGroupReference resource_group: The resource group for this
- security group.
- :attr List[SecurityGroupRule] rules: The rules for this security group. If no
- rules exist, all traffic will be denied.
- :attr List[SecurityGroupTargetReference] targets: The targets for this security
- group.
- :attr VPCReference vpc: The VPC this security group resides in.
+ :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.
+ """
+
+ def __init__(
+ self,
+ code: str,
+ message: str,
+ *,
+ more_info: Optional[str] = None,
+ ) -> None:
+ """
+ Initialize a ReservationStatusReason object.
+
+ :param str code: A snake case string succinctly identifying the status
+ reason.
+ :param str message: An explanation of the status reason.
+ :param str more_info: (optional) Link to documentation about this status
+ reason.
+ """
+ self.code = code
+ self.message = message
+ self.more_info = more_info
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'ReservationStatusReason':
+ """Initialize a ReservationStatusReason object from a json dictionary."""
+ args = {}
+ if (code := _dict.get('code')) is not None:
+ args['code'] = code
+ else:
+ raise ValueError('Required property \'code\' not present in ReservationStatusReason JSON')
+ if (message := _dict.get('message')) is not None:
+ args['message'] = message
+ else:
+ raise ValueError('Required property \'message\' not present in ReservationStatusReason JSON')
+ if (more_info := _dict.get('more_info')) is not None:
+ args['more_info'] = more_info
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a ReservationStatusReason object from 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 ReservationStatusReason object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'ReservationStatusReason') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'ReservationStatusReason') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+ class CodeEnum(str, Enum):
+ """
+ A snake case string succinctly identifying the status reason.
+ """
+
+ CANNOT_ACTIVATE_NO_CAPACITY_AVAILABLE = 'cannot_activate_no_capacity_available'
+ CANNOT_RENEW_UNSUPPORTED_PROFILE_TERM = 'cannot_renew_unsupported_profile_term'
+
+
+
+class ReservedIP:
+ """
+ ReservedIP.
+
+ :param str address: The IP address.
+ If the address has not yet been selected, the value will be `0.0.0.0`.
+ This property may add support for IPv6 addresses in the future. When processing
+ a value in this property, verify that the address is in an expected format. If
+ it is not, log an error. Optionally halt processing and surface the error, or
+ bypass the resource on which the unexpected IP address format was encountered.
+ :param bool auto_delete: Indicates whether this reserved IP member will be
+ automatically deleted when either
+ `target` is deleted, or the reserved IP is unbound.
+ :param datetime created_at: The date and time that the reserved IP was created.
+ :param str href: The URL for this reserved IP.
+ :param str id: The unique identifier for this reserved IP.
+ :param str lifecycle_state: The lifecycle state of the reserved IP.
+ :param str name: The name for this reserved IP. The name is unique across all
+ reserved IPs in a subnet.
+ :param str owner: The owner of the reserved IP.
+ :param str resource_type: The resource type.
+ :param ReservedIPTarget target: (optional) The target this reserved IP is bound
+ to.
+ If absent, this reserved IP is provider-owned or unbound.
"""
def __init__(
self,
+ address: str,
+ auto_delete: bool,
created_at: datetime,
- crn: str,
href: str,
id: str,
+ lifecycle_state: str,
name: str,
- resource_group: 'ResourceGroupReference',
- rules: List['SecurityGroupRule'],
- targets: List['SecurityGroupTargetReference'],
- vpc: 'VPCReference',
+ owner: str,
+ resource_type: str,
+ *,
+ target: Optional['ReservedIPTarget'] = None,
) -> None:
"""
- Initialize a SecurityGroup object.
+ Initialize a ReservedIP object.
- :param datetime created_at: The date and time that this security group was
+ :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 crn: The security group's CRN.
- :param str href: The security group's canonical URL.
- :param str id: The unique identifier for this security group.
- :param str name: The name for this security group. The name is unique
- across all security groups for the VPC.
- :param ResourceGroupReference resource_group: The resource group for this
- security group.
- :param List[SecurityGroupRule] rules: The rules for this security group. If
- no rules exist, all traffic will be denied.
- :param List[SecurityGroupTargetReference] targets: The targets for this
- security group.
- :param VPCReference vpc: The VPC this security group resides in.
+ :param str href: The URL for this reserved IP.
+ :param str id: The unique identifier for this reserved IP.
+ :param str lifecycle_state: The lifecycle state of the reserved IP.
+ :param str name: The name for this reserved IP. The name is unique across
+ all reserved IPs in a subnet.
+ :param str owner: The owner of the reserved IP.
+ :param str resource_type: The resource type.
+ :param ReservedIPTarget target: (optional) The target this reserved IP is
+ bound to.
+ If absent, this reserved IP is provider-owned or unbound.
"""
+ self.address = address
+ 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.rules = rules
- self.targets = targets
- self.vpc = vpc
+ self.owner = owner
+ self.resource_type = resource_type
+ self.target = target
@classmethod
- def from_dict(cls, _dict: Dict) -> 'SecurityGroup':
- """Initialize a SecurityGroup object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'ReservedIP':
+ """Initialize a ReservedIP object from a json dictionary."""
args = {}
- if 'created_at' in _dict:
- args['created_at'] = string_to_datetime(_dict.get('created_at'))
+ if (address := _dict.get('address')) is not None:
+ args['address'] = address
else:
- raise ValueError('Required property \'created_at\' not present in SecurityGroup JSON')
- if 'crn' in _dict:
- args['crn'] = _dict.get('crn')
+ raise ValueError('Required property \'address\' not present in ReservedIP JSON')
+ if (auto_delete := _dict.get('auto_delete')) is not None:
+ args['auto_delete'] = auto_delete
else:
- raise ValueError('Required property \'crn\' not present in SecurityGroup JSON')
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ raise ValueError('Required property \'auto_delete\' not present in ReservedIP JSON')
+ if (created_at := _dict.get('created_at')) is not None:
+ args['created_at'] = string_to_datetime(created_at)
else:
- raise ValueError('Required property \'href\' not present in SecurityGroup JSON')
- if 'id' in _dict:
- args['id'] = _dict.get('id')
+ raise ValueError('Required property \'created_at\' not present in ReservedIP JSON')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'id\' not present in SecurityGroup JSON')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
+ raise ValueError('Required property \'href\' not present in ReservedIP JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
else:
- raise ValueError('Required property \'name\' not present in SecurityGroup JSON')
- if 'resource_group' in _dict:
- args['resource_group'] = ResourceGroupReference.from_dict(_dict.get('resource_group'))
+ raise ValueError('Required property \'id\' not present in ReservedIP JSON')
+ if (lifecycle_state := _dict.get('lifecycle_state')) is not None:
+ args['lifecycle_state'] = lifecycle_state
else:
- raise ValueError('Required property \'resource_group\' not present in SecurityGroup JSON')
- if 'rules' in _dict:
- args['rules'] = [SecurityGroupRule.from_dict(v) for v in _dict.get('rules')]
+ raise ValueError('Required property \'lifecycle_state\' not present in ReservedIP JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
else:
- raise ValueError('Required property \'rules\' not present in SecurityGroup JSON')
- if 'targets' in _dict:
- args['targets'] = _dict.get('targets')
+ raise ValueError('Required property \'name\' not present in ReservedIP JSON')
+ if (owner := _dict.get('owner')) is not None:
+ args['owner'] = owner
else:
- raise ValueError('Required property \'targets\' not present in SecurityGroup JSON')
- if 'vpc' in _dict:
- args['vpc'] = VPCReference.from_dict(_dict.get('vpc'))
+ raise ValueError('Required property \'owner\' not present in ReservedIP JSON')
+ if (resource_type := _dict.get('resource_type')) is not None:
+ args['resource_type'] = resource_type
else:
- raise ValueError('Required property \'vpc\' not present in SecurityGroup JSON')
+ raise ValueError('Required property \'resource_type\' not present in ReservedIP JSON')
+ if (target := _dict.get('target')) is not None:
+ args['target'] = target
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a SecurityGroup 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, '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, 'crn') and self.crn is not None:
- _dict['crn'] = self.crn
if hasattr(self, 'href') and self.href is not None:
_dict['href'] = self.href
if hasattr(self, 'id') and self.id is not None:
_dict['id'] = self.id
+ if hasattr(self, 'lifecycle_state') and self.lifecycle_state is not None:
+ _dict['lifecycle_state'] = self.lifecycle_state
if hasattr(self, 'name') and self.name is not None:
_dict['name'] = self.name
- if hasattr(self, 'resource_group') and self.resource_group is not None:
- if isinstance(self.resource_group, dict):
- _dict['resource_group'] = self.resource_group
- else:
- _dict['resource_group'] = self.resource_group.to_dict()
- if hasattr(self, 'rules') and self.rules is not None:
- rules_list = []
- for v in self.rules:
- if isinstance(v, dict):
- rules_list.append(v)
- else:
- rules_list.append(v.to_dict())
- _dict['rules'] = rules_list
- if hasattr(self, 'targets') and self.targets is not None:
- targets_list = []
- for v in self.targets:
- if isinstance(v, dict):
- targets_list.append(v)
- else:
- targets_list.append(v.to_dict())
- _dict['targets'] = targets_list
- if hasattr(self, 'vpc') and self.vpc is not None:
- if isinstance(self.vpc, dict):
- _dict['vpc'] = self.vpc
+ 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['vpc'] = self.vpc.to_dict()
+ _dict['target'] = self.target.to_dict()
return _dict
def _to_dict(self):
@@ -67872,89 +71107,121 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this SecurityGroup object."""
+ """Return a `str` version of this ReservedIP object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'SecurityGroup') -> 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: 'SecurityGroup') -> bool:
+ def __ne__(self, other: 'ReservedIP') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
+ class LifecycleStateEnum(str, Enum):
+ """
+ The lifecycle state of the reserved IP.
+ """
+
+ DELETING = 'deleting'
+ FAILED = 'failed'
+ PENDING = 'pending'
+ STABLE = 'stable'
+ SUSPENDED = 'suspended'
+ UPDATING = 'updating'
+ WAITING = 'waiting'
+
-class SecurityGroupCollection:
+ class OwnerEnum(str, Enum):
+ """
+ The owner of the reserved IP.
+ """
+
+ PROVIDER = 'provider'
+ USER = 'user'
+
+
+ class ResourceTypeEnum(str, Enum):
+ """
+ The resource type.
+ """
+
+ SUBNET_RESERVED_IP = 'subnet_reserved_ip'
+
+
+
+class ReservedIPCollection:
"""
- SecurityGroupCollection.
+ ReservedIPCollection.
- :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
+ :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.
- :attr SecurityGroupCollectionNext next: (optional) A link to the next page of
+ :param ReservedIPCollectionNext 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.
+ :param List[ReservedIP] reserved_ips: Collection of reserved IPs in this subnet.
+ :param int total_count: The total number of resources across all pages.
"""
def __init__(
self,
- first: 'SecurityGroupCollectionFirst',
+ first: 'ReservedIPCollectionFirst',
limit: int,
- security_groups: List['SecurityGroup'],
+ reserved_ips: List['ReservedIP'],
total_count: int,
*,
- next: 'SecurityGroupCollectionNext' = None,
+ next: Optional['ReservedIPCollectionNext'] = None,
) -> None:
"""
- Initialize a SecurityGroupCollection object.
+ Initialize a ReservedIPCollection object.
- :param SecurityGroupCollectionFirst 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[SecurityGroup] security_groups: Collection of security groups.
+ :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 SecurityGroupCollectionNext 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.next = next
- self.security_groups = security_groups
+ self.reserved_ips = reserved_ips
self.total_count = total_count
@classmethod
- def from_dict(cls, _dict: Dict) -> 'SecurityGroupCollection':
- """Initialize a SecurityGroupCollection object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'ReservedIPCollection':
+ """Initialize a ReservedIPCollection object from a json dictionary."""
args = {}
- if 'first' in _dict:
- args['first'] = SecurityGroupCollectionFirst.from_dict(_dict.get('first'))
+ if (first := _dict.get('first')) is not None:
+ args['first'] = ReservedIPCollectionFirst.from_dict(first)
else:
- raise ValueError('Required property \'first\' not present in SecurityGroupCollection JSON')
- if 'limit' in _dict:
- args['limit'] = _dict.get('limit')
+ raise ValueError('Required property \'first\' not present in ReservedIPCollection JSON')
+ if (limit := _dict.get('limit')) is not None:
+ args['limit'] = limit
else:
- raise ValueError('Required property \'limit\' not present in SecurityGroupCollection JSON')
- if 'next' in _dict:
- args['next'] = SecurityGroupCollectionNext.from_dict(_dict.get('next'))
- if 'security_groups' in _dict:
- args['security_groups'] = [SecurityGroup.from_dict(v) for v in _dict.get('security_groups')]
+ raise ValueError('Required property \'limit\' not present in ReservedIPCollection JSON')
+ if (next := _dict.get('next')) is not None:
+ args['next'] = ReservedIPCollectionNext.from_dict(next)
+ if (reserved_ips := _dict.get('reserved_ips')) is not None:
+ args['reserved_ips'] = [ReservedIP.from_dict(v) for v in reserved_ips]
else:
- raise ValueError('Required property \'security_groups\' not present in SecurityGroupCollection JSON')
- if 'total_count' in _dict:
- args['total_count'] = _dict.get('total_count')
+ raise ValueError('Required property \'reserved_ips\' not present in ReservedIPCollection JSON')
+ if (total_count := _dict.get('total_count')) is not None:
+ args['total_count'] = total_count
else:
- raise ValueError('Required property \'total_count\' not present in SecurityGroupCollection JSON')
+ raise ValueError('Required property \'total_count\' not present in ReservedIPCollection JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a SecurityGroupCollection object from a json dictionary."""
+ """Initialize a ReservedIPCollection object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -67972,14 +71239,14 @@ def to_dict(self) -> Dict:
_dict['next'] = self.next
else:
_dict['next'] = self.next.to_dict()
- if hasattr(self, 'security_groups') and self.security_groups is not None:
- security_groups_list = []
- for v in self.security_groups:
+ if hasattr(self, 'reserved_ips') and self.reserved_ips is not None:
+ reserved_ips_list = []
+ for v in self.reserved_ips:
if isinstance(v, dict):
- security_groups_list.append(v)
+ reserved_ips_list.append(v)
else:
- security_groups_list.append(v.to_dict())
- _dict['security_groups'] = security_groups_list
+ reserved_ips_list.append(v.to_dict())
+ _dict['reserved_ips'] = reserved_ips_list
if hasattr(self, 'total_count') and self.total_count is not None:
_dict['total_count'] = self.total_count
return _dict
@@ -67989,58 +71256,121 @@ 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 ReservedIPCollection object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'SecurityGroupCollection') -> 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: 'SecurityGroupCollection') -> bool:
+ def __ne__(self, other: 'ReservedIPCollection') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class SecurityGroupCollectionFirst:
+class ReservedIPCollectionBareMetalServerNetworkInterfaceContext:
"""
- A link to the first page of resources.
+ ReservedIPCollectionBareMetalServerNetworkInterfaceContext.
- :attr str href: The URL for a page of resources.
+ :param ReservedIPCollectionBareMetalServerNetworkInterfaceContextFirst first: A
+ link to the first page of resources.
+ :param List[ReservedIP] ips: Collection of reserved IPs bound to a bare metal
+ server network interface.
+ :param int limit: The maximum number of resources that can be returned by the
+ request.
+ :param ReservedIPCollectionBareMetalServerNetworkInterfaceContextNext next:
+ (optional) A link to the next page of resources. This property is present for
+ all pages
+ except the last page.
+ :param int total_count: The total number of resources across all pages.
"""
def __init__(
self,
- href: str,
+ first: 'ReservedIPCollectionBareMetalServerNetworkInterfaceContextFirst',
+ ips: List['ReservedIP'],
+ limit: int,
+ total_count: int,
+ *,
+ next: Optional['ReservedIPCollectionBareMetalServerNetworkInterfaceContextNext'] = None,
) -> None:
"""
- Initialize a SecurityGroupCollectionFirst object.
+ Initialize a ReservedIPCollectionBareMetalServerNetworkInterfaceContext object.
- :param str href: The URL for a page of resources.
+ :param ReservedIPCollectionBareMetalServerNetworkInterfaceContextFirst
+ first: A link to the first page of resources.
+ :param List[ReservedIP] ips: Collection of reserved IPs bound to a bare
+ metal server network interface.
+ :param int limit: The maximum number of resources that can be returned by
+ the request.
+ :param int total_count: The total number of resources across all pages.
+ :param ReservedIPCollectionBareMetalServerNetworkInterfaceContextNext next:
+ (optional) A link to the next page of resources. This property is present
+ for all pages
+ except the last page.
"""
- 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) -> 'SecurityGroupCollectionFirst':
- """Initialize a SecurityGroupCollectionFirst object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'ReservedIPCollectionBareMetalServerNetworkInterfaceContext':
+ """Initialize a ReservedIPCollectionBareMetalServerNetworkInterfaceContext object from a json dictionary."""
args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ if (first := _dict.get('first')) is not None:
+ args['first'] = ReservedIPCollectionBareMetalServerNetworkInterfaceContextFirst.from_dict(first)
else:
- raise ValueError('Required property \'href\' not present in SecurityGroupCollectionFirst JSON')
+ raise ValueError('Required property \'first\' not present in ReservedIPCollectionBareMetalServerNetworkInterfaceContext JSON')
+ if (ips := _dict.get('ips')) is not None:
+ args['ips'] = [ReservedIP.from_dict(v) for v in ips]
+ else:
+ raise ValueError('Required property \'ips\' not present in ReservedIPCollectionBareMetalServerNetworkInterfaceContext JSON')
+ if (limit := _dict.get('limit')) is not None:
+ args['limit'] = limit
+ else:
+ raise ValueError('Required property \'limit\' not present in ReservedIPCollectionBareMetalServerNetworkInterfaceContext JSON')
+ if (next := _dict.get('next')) is not None:
+ args['next'] = ReservedIPCollectionBareMetalServerNetworkInterfaceContextNext.from_dict(next)
+ if (total_count := _dict.get('total_count')) is not None:
+ args['total_count'] = total_count
+ else:
+ raise ValueError('Required property \'total_count\' not present in ReservedIPCollectionBareMetalServerNetworkInterfaceContext JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a SecurityGroupCollectionFirst object from a json dictionary."""
+ """Initialize a ReservedIPCollectionBareMetalServerNetworkInterfaceContext object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'href') and self.href is not None:
- _dict['href'] = self.href
+ if hasattr(self, 'first') and self.first is not None:
+ if isinstance(self.first, dict):
+ _dict['first'] = self.first
+ else:
+ _dict['first'] = self.first.to_dict()
+ if hasattr(self, 'ips') and self.ips is not None:
+ ips_list = []
+ for v in self.ips:
+ if isinstance(v, dict):
+ ips_list.append(v)
+ else:
+ ips_list.append(v.to_dict())
+ _dict['ips'] = ips_list
+ if hasattr(self, 'limit') and self.limit is not None:
+ _dict['limit'] = self.limit
+ if hasattr(self, 'next') and self.next is not None:
+ if isinstance(self.next, dict):
+ _dict['next'] = self.next
+ else:
+ _dict['next'] = self.next.to_dict()
+ if hasattr(self, 'total_count') and self.total_count is not None:
+ _dict['total_count'] = self.total_count
return _dict
def _to_dict(self):
@@ -68048,26 +71378,25 @@ 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 ReservedIPCollectionBareMetalServerNetworkInterfaceContext object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'SecurityGroupCollectionFirst') -> bool:
+ def __eq__(self, other: 'ReservedIPCollectionBareMetalServerNetworkInterfaceContext') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'SecurityGroupCollectionFirst') -> bool:
+ def __ne__(self, other: 'ReservedIPCollectionBareMetalServerNetworkInterfaceContext') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class SecurityGroupCollectionNext:
+class ReservedIPCollectionBareMetalServerNetworkInterfaceContextFirst:
"""
- 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.
+ :param str href: The URL for a page of resources.
"""
def __init__(
@@ -68075,25 +71404,25 @@ def __init__(
href: str,
) -> None:
"""
- Initialize a SecurityGroupCollectionNext object.
+ Initialize a ReservedIPCollectionBareMetalServerNetworkInterfaceContextFirst 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) -> 'ReservedIPCollectionBareMetalServerNetworkInterfaceContextFirst':
+ """Initialize a ReservedIPCollectionBareMetalServerNetworkInterfaceContextFirst object from a json dictionary."""
args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'href\' not present in SecurityGroupCollectionNext JSON')
+ raise ValueError('Required property \'href\' not present in ReservedIPCollectionBareMetalServerNetworkInterfaceContextFirst JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a SecurityGroupCollectionNext object from a json dictionary."""
+ """Initialize a ReservedIPCollectionBareMetalServerNetworkInterfaceContextFirst object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -68108,78 +71437,59 @@ 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 ReservedIPCollectionBareMetalServerNetworkInterfaceContextFirst object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'SecurityGroupCollectionNext') -> bool:
+ def __eq__(self, other: 'ReservedIPCollectionBareMetalServerNetworkInterfaceContextFirst') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'SecurityGroupCollectionNext') -> bool:
+ def __ne__(self, other: 'ReservedIPCollectionBareMetalServerNetworkInterfaceContextFirst') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class SecurityGroupIdentity:
- """
- Identifies a security group by a unique property.
-
- """
-
- def __init__(
- self,
- ) -> None:
- """
- Initialize a SecurityGroupIdentity object.
-
- """
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['SecurityGroupIdentityById', 'SecurityGroupIdentityByCRN', 'SecurityGroupIdentityByHref'])
- )
- raise Exception(msg)
-
-
-class SecurityGroupPatch:
+class ReservedIPCollectionBareMetalServerNetworkInterfaceContextNext:
"""
- SecurityGroupPatch.
+ A link to the next page of resources. This property is present for all pages except
+ the last page.
- :attr str name: (optional) The name for this security group. The name must not
- be used by another security group for the VPC.
+ :param str href: The URL for a page of resources.
"""
def __init__(
self,
- *,
- name: str = None,
+ href: str,
) -> None:
"""
- Initialize a SecurityGroupPatch object.
+ Initialize a ReservedIPCollectionBareMetalServerNetworkInterfaceContextNext object.
- :param str name: (optional) The name for this security group. The name must
- not be used by another security group for the VPC.
+ :param str href: The URL for a page of resources.
"""
- self.name = name
+ self.href = href
@classmethod
- def from_dict(cls, _dict: Dict) -> 'SecurityGroupPatch':
- """Initialize a SecurityGroupPatch object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'ReservedIPCollectionBareMetalServerNetworkInterfaceContextNext':
+ """Initialize a ReservedIPCollectionBareMetalServerNetworkInterfaceContextNext object from a json dictionary."""
args = {}
- if 'name' in _dict:
- args['name'] = _dict.get('name')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
+ else:
+ raise ValueError('Required property \'href\' not present in ReservedIPCollectionBareMetalServerNetworkInterfaceContextNext JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a SecurityGroupPatch object from a json dictionary."""
+ """Initialize a ReservedIPCollectionBareMetalServerNetworkInterfaceContextNext object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, '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):
@@ -68187,106 +71497,119 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this SecurityGroupPatch object."""
+ """Return a `str` version of this ReservedIPCollectionBareMetalServerNetworkInterfaceContextNext object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'SecurityGroupPatch') -> bool:
+ def __eq__(self, other: 'ReservedIPCollectionBareMetalServerNetworkInterfaceContextNext') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'SecurityGroupPatch') -> bool:
+ def __ne__(self, other: 'ReservedIPCollectionBareMetalServerNetworkInterfaceContextNext') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class SecurityGroupReference:
+class ReservedIPCollectionEndpointGatewayContext:
"""
- SecurityGroupReference.
+ ReservedIPCollectionEndpointGatewayContext.
- :attr str crn: The security group's CRN.
- :attr SecurityGroupReferenceDeleted deleted: (optional) If present, this
- property indicates the referenced resource has been deleted, and provides
- some supplementary information.
- :attr str href: The security group's canonical URL.
- :attr str id: The unique identifier for this security group.
- :attr str name: The name for this security group. The name is unique across all
- security groups for the VPC.
+ :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 ReservedIPCollectionEndpointGatewayContextNext next: (optional) A link to
+ the next page of resources. This property is present for all pages
+ except the last page.
+ :param int total_count: The total number of resources across all pages.
"""
def __init__(
self,
- crn: str,
- href: str,
- id: str,
- name: str,
+ first: 'ReservedIPCollectionEndpointGatewayContextFirst',
+ ips: List['ReservedIP'],
+ limit: int,
+ total_count: int,
*,
- deleted: 'SecurityGroupReferenceDeleted' = None,
+ next: Optional['ReservedIPCollectionEndpointGatewayContextNext'] = None,
) -> None:
"""
- Initialize a SecurityGroupReference object.
+ Initialize a ReservedIPCollectionEndpointGatewayContext object.
- :param str crn: The security group's CRN.
- :param str href: The security group's canonical URL.
- :param str id: The unique identifier for this security group.
- :param str name: The name for this security group. The name is unique
- across all security groups for the VPC.
- :param SecurityGroupReferenceDeleted deleted: (optional) If present, this
- property indicates the referenced resource has been deleted, and provides
- some supplementary information.
+ :param 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.crn = crn
- self.deleted = deleted
- self.href = href
- self.id = id
- self.name = name
+ self.first = first
+ self.ips = ips
+ self.limit = limit
+ self.next = next
+ self.total_count = total_count
@classmethod
- def from_dict(cls, _dict: Dict) -> 'SecurityGroupReference':
- """Initialize a SecurityGroupReference object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'ReservedIPCollectionEndpointGatewayContext':
+ """Initialize a ReservedIPCollectionEndpointGatewayContext object from a json dictionary."""
args = {}
- if 'crn' in _dict:
- args['crn'] = _dict.get('crn')
+ if (first := _dict.get('first')) is not None:
+ args['first'] = ReservedIPCollectionEndpointGatewayContextFirst.from_dict(first)
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')
+ raise ValueError('Required property \'first\' not present in ReservedIPCollectionEndpointGatewayContext JSON')
+ if (ips := _dict.get('ips')) is not None:
+ args['ips'] = [ReservedIP.from_dict(v) for v in ips]
else:
- raise ValueError('Required property \'href\' not present in SecurityGroupReference JSON')
- if 'id' in _dict:
- args['id'] = _dict.get('id')
+ raise ValueError('Required property \'ips\' not present in ReservedIPCollectionEndpointGatewayContext JSON')
+ if (limit := _dict.get('limit')) is not None:
+ args['limit'] = limit
else:
- raise ValueError('Required property \'id\' not present in SecurityGroupReference JSON')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
+ raise ValueError('Required property \'limit\' not present in ReservedIPCollectionEndpointGatewayContext JSON')
+ if (next := _dict.get('next')) is not None:
+ args['next'] = ReservedIPCollectionEndpointGatewayContextNext.from_dict(next)
+ if (total_count := _dict.get('total_count')) is not None:
+ args['total_count'] = total_count
else:
- raise ValueError('Required property \'name\' not present in SecurityGroupReference JSON')
+ raise ValueError('Required property \'total_count\' not present in ReservedIPCollectionEndpointGatewayContext JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a SecurityGroupReference 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, 'crn') and self.crn is not None:
- _dict['crn'] = self.crn
- if hasattr(self, 'deleted') and self.deleted is not None:
- if isinstance(self.deleted, dict):
- _dict['deleted'] = self.deleted
+ if hasattr(self, 'first') and self.first is not None:
+ if isinstance(self.first, dict):
+ _dict['first'] = self.first
else:
- _dict['deleted'] = self.deleted.to_dict()
- if hasattr(self, 'href') and self.href is not None:
- _dict['href'] = self.href
- if hasattr(self, 'id') and self.id is not None:
- _dict['id'] = self.id
- if hasattr(self, 'name') and self.name is not None:
- _dict['name'] = self.name
+ _dict['first'] = self.first.to_dict()
+ if hasattr(self, 'ips') and self.ips is not None:
+ ips_list = []
+ for v in self.ips:
+ if isinstance(v, dict):
+ ips_list.append(v)
+ else:
+ ips_list.append(v.to_dict())
+ _dict['ips'] = ips_list
+ if hasattr(self, 'limit') and self.limit is not None:
+ _dict['limit'] = self.limit
+ if hasattr(self, 'next') and self.next is not None:
+ if isinstance(self.next, dict):
+ _dict['next'] = self.next
+ else:
+ _dict['next'] = self.next.to_dict()
+ if hasattr(self, 'total_count') and self.total_count is not None:
+ _dict['total_count'] = self.total_count
return _dict
def _to_dict(self):
@@ -68294,59 +71617,58 @@ 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 ReservedIPCollectionEndpointGatewayContext object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'SecurityGroupReference') -> 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: 'SecurityGroupReference') -> bool:
+ def __ne__(self, other: 'ReservedIPCollectionEndpointGatewayContext') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class SecurityGroupReferenceDeleted:
+class ReservedIPCollectionEndpointGatewayContextFirst:
"""
- 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.
+ :param str href: The URL for a page of resources.
"""
def __init__(
self,
- more_info: str,
+ href: str,
) -> None:
"""
- Initialize a SecurityGroupReferenceDeleted object.
+ Initialize a ReservedIPCollectionEndpointGatewayContextFirst 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) -> 'SecurityGroupReferenceDeleted':
- """Initialize a SecurityGroupReferenceDeleted object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'ReservedIPCollectionEndpointGatewayContextFirst':
+ """Initialize a ReservedIPCollectionEndpointGatewayContextFirst object from a json dictionary."""
args = {}
- if 'more_info' in _dict:
- args['more_info'] = _dict.get('more_info')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'more_info\' not present in SecurityGroupReferenceDeleted JSON')
+ raise ValueError('Required property \'href\' not present in ReservedIPCollectionEndpointGatewayContextFirst JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a SecurityGroupReferenceDeleted object from a json dictionary."""
+ """Initialize a ReservedIPCollectionEndpointGatewayContextFirst object from 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):
@@ -68354,183 +71676,118 @@ 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 ReservedIPCollectionEndpointGatewayContextFirst object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'SecurityGroupReferenceDeleted') -> 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: 'SecurityGroupReferenceDeleted') -> bool:
+ def __ne__(self, other: 'ReservedIPCollectionEndpointGatewayContextFirst') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class SecurityGroupRule:
+class ReservedIPCollectionEndpointGatewayContextNext:
"""
- SecurityGroupRule.
+ A link to the next page of resources. This property is present for all pages except
+ the last page.
- :attr str direction: The direction of traffic to enforce.
- :attr str href: The URL for this security group rule.
- :attr str id: The unique identifier for this security group rule.
- :attr str ip_version: The IP version to enforce. The format of `remote.address`
- or `remote.cidr_block` must match this property, if they are used.
- Alternatively, if `remote` references a security group, then this rule only
- applies to IP addresses (network interfaces) in that group matching this IP
- version.
- :attr str protocol: The protocol to enforce.
- :attr SecurityGroupRuleRemote remote: The remote IP addresses or security groups
- from which this rule allows traffic (or to
- which, for outbound rules). A CIDR block of `0.0.0.0/0` allows traffic from any
- source
- (or to any destination, for outbound rules).
+ :param str href: The URL for a page of resources.
"""
def __init__(
self,
- direction: str,
href: str,
- id: str,
- ip_version: str,
- protocol: str,
- remote: 'SecurityGroupRuleRemote',
) -> None:
"""
- Initialize a SecurityGroupRule object.
+ Initialize a ReservedIPCollectionEndpointGatewayContextNext object.
- :param str direction: The direction of traffic to enforce.
- :param str href: The URL for this security group rule.
- :param str id: The unique identifier for this security group rule.
- :param str ip_version: The IP version to enforce. The format of
- `remote.address` or `remote.cidr_block` must match this property, if they
- are used. Alternatively, if `remote` references a security group, then this
- rule only applies to IP addresses (network interfaces) in that group
- matching this IP version.
- :param str protocol: The protocol to enforce.
- :param SecurityGroupRuleRemote remote: The remote IP addresses or security
- groups from which this rule allows traffic (or to
- which, for outbound rules). A CIDR block of `0.0.0.0/0` allows traffic from
- any source
- (or to any destination, for outbound rules).
+ :param str href: The URL for a page of resources.
"""
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['SecurityGroupRuleSecurityGroupRuleProtocolAll', 'SecurityGroupRuleSecurityGroupRuleProtocolICMP', 'SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP'])
- )
- raise Exception(msg)
+ self.href = href
@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)
+ def from_dict(cls, _dict: Dict) -> 'ReservedIPCollectionEndpointGatewayContextNext':
+ """Initialize a ReservedIPCollectionEndpointGatewayContextNext object from a json dictionary."""
+ args = {}
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
+ else:
+ raise ValueError('Required property \'href\' not present in ReservedIPCollectionEndpointGatewayContextNext JSON')
+ return cls(**args)
@classmethod
- def _from_dict(cls, _dict: Dict):
- """Initialize a SecurityGroupRule object from a json dictionary."""
+ def _from_dict(cls, _dict):
+ """Initialize a ReservedIPCollectionEndpointGatewayContextNext object from a json dictionary."""
return cls.from_dict(_dict)
- @classmethod
- def _get_class_by_discriminator(cls, _dict: Dict) -> object:
- mapping = {}
- mapping['all'] = 'SecurityGroupRuleSecurityGroupRuleProtocolAll'
- mapping['icmp'] = 'SecurityGroupRuleSecurityGroupRuleProtocolICMP'
- mapping['tcp'] = 'SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP'
- mapping['udp'] = 'SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP'
- disc_value = _dict.get('protocol')
- if disc_value is None:
- raise ValueError('Discriminator property \'protocol\' not found in SecurityGroupRule JSON')
- class_name = mapping.get(disc_value, disc_value)
- try:
- disc_class = getattr(sys.modules[__name__], class_name)
- except AttributeError:
- disc_class = cls
- if isinstance(disc_class, object):
- return disc_class
- raise TypeError('%s is not a discriminator class' % class_name)
-
- class DirectionEnum(str, Enum):
- """
- The direction of traffic to enforce.
- """
-
- INBOUND = 'inbound'
- OUTBOUND = 'outbound'
-
-
- class IpVersionEnum(str, Enum):
- """
- The IP version to enforce. The format of `remote.address` or `remote.cidr_block`
- must match this property, if they are used. Alternatively, if `remote` references
- a security group, then this rule only applies to IP addresses (network interfaces)
- in that group matching this IP version.
- """
-
- IPV4 = 'ipv4'
+ def to_dict(self) -> Dict:
+ """Return a json dictionary representing this model."""
+ _dict = {}
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
+ return _dict
+ def _to_dict(self):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
- class ProtocolEnum(str, Enum):
- """
- The protocol to enforce.
- """
+ def __str__(self) -> str:
+ """Return a `str` version of this ReservedIPCollectionEndpointGatewayContextNext object."""
+ return json.dumps(self.to_dict(), indent=2)
- ALL = 'all'
- ICMP = 'icmp'
- TCP = 'tcp'
- UDP = 'udp'
+ 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: 'ReservedIPCollectionEndpointGatewayContextNext') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
-class SecurityGroupRuleCollection:
+class ReservedIPCollectionFirst:
"""
- Collection of rules in a security group.
+ A link to the first page of resources.
- :attr List[SecurityGroupRule] rules: Array of rules.
+ :param str href: The URL for a page of resources.
"""
def __init__(
self,
- rules: List['SecurityGroupRule'],
+ href: str,
) -> None:
"""
- Initialize a SecurityGroupRuleCollection object.
+ Initialize a ReservedIPCollectionFirst object.
- :param List[SecurityGroupRule] rules: Array 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) -> 'SecurityGroupRuleCollection':
- """Initialize a SecurityGroupRuleCollection object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'ReservedIPCollectionFirst':
+ """Initialize a ReservedIPCollectionFirst object from a json dictionary."""
args = {}
- if 'rules' in _dict:
- args['rules'] = [SecurityGroupRule.from_dict(v) for v in _dict.get('rules')]
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'rules\' not present in SecurityGroupRuleCollection JSON')
+ raise ValueError('Required property \'href\' not present in ReservedIPCollectionFirst JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a SecurityGroupRuleCollection 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, 'rules') and self.rules is not None:
- rules_list = []
- for v in self.rules:
- if isinstance(v, dict):
- rules_list.append(v)
- else:
- rules_list.append(v.to_dict())
- _dict['rules'] = rules_list
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
return _dict
def _to_dict(self):
@@ -68538,146 +71795,120 @@ 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 ReservedIPCollectionFirst object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'SecurityGroupRuleCollection') -> 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: 'SecurityGroupRuleCollection') -> bool:
+ def __ne__(self, other: 'ReservedIPCollectionFirst') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class SecurityGroupRulePatch:
+class ReservedIPCollectionInstanceNetworkInterfaceContext:
"""
- SecurityGroupRulePatch.
+ ReservedIPCollectionInstanceNetworkInterfaceContext.
- :attr int code: (optional) The ICMP traffic code to allow. If set, `type` must
- also be set.
- Specify `null` to remove an existing ICMP traffic code.
- :attr str direction: (optional) The direction of traffic to enforce.
- :attr str ip_version: (optional) The IP version to enforce. The format of
- `remote.address` or `remote.cidr_block` must match this property, if they are
- used. Alternatively, if `remote` references a security group, then this rule
- only applies to IP addresses (network interfaces) in that group matching this IP
- version.
- :attr int port_max: (optional) The inclusive upper bound of the protocol
- destination port range. If set, `port_min` must also be set, and must not be
- larger.
- Specify `null` to remove an existing upper bound.
- :attr int port_min: (optional) The inclusive lower bound of the protocol
- destination port range. If set, `port_max` must also be set, and must not be
- smaller.
- Specify `null` to remove an existing lower bound.
- :attr SecurityGroupRuleRemotePatch remote: (optional) The remote IP addresses or
- security groups from which this rule will allow traffic (or to
- which, for outbound rules). Can be specified as an IP address, a CIDR block, or
- a
- security group. A CIDR block of `0.0.0.0/0` will allow traffic from any source
- (or to
- any destination, for outbound rules).
- :attr int type: (optional) The ICMP traffic type to allow.
- Specify `null` to remove an existing ICMP traffic type value.
+ :param ReservedIPCollectionInstanceNetworkInterfaceContextFirst first: A link to
+ the first page of resources.
+ :param List[ReservedIP] ips: Collection of reserved IPs bound to an instance
+ network interface.
+ :param int limit: The maximum number of resources that can be returned by the
+ request.
+ :param ReservedIPCollectionInstanceNetworkInterfaceContextNext next: (optional)
+ A link to the next page of resources. This property is present for all pages
+ except the last page.
+ :param int total_count: The total number of resources across all pages.
"""
def __init__(
self,
+ first: 'ReservedIPCollectionInstanceNetworkInterfaceContextFirst',
+ ips: List['ReservedIP'],
+ limit: int,
+ total_count: int,
*,
- code: int = None,
- direction: str = None,
- ip_version: str = None,
- port_max: int = None,
- port_min: int = None,
- remote: 'SecurityGroupRuleRemotePatch' = None,
- type: int = None,
+ next: Optional['ReservedIPCollectionInstanceNetworkInterfaceContextNext'] = None,
) -> None:
"""
- Initialize a SecurityGroupRulePatch object.
+ Initialize a ReservedIPCollectionInstanceNetworkInterfaceContext object.
- :param int code: (optional) The ICMP traffic code to allow. If set, `type`
- must also be set.
- Specify `null` to remove an existing ICMP traffic code.
- :param str direction: (optional) The direction of traffic to enforce.
- :param str ip_version: (optional) The IP version to enforce. The format of
- `remote.address` or `remote.cidr_block` must match this property, if they
- are used. Alternatively, if `remote` references a security group, then this
- rule only applies to IP addresses (network interfaces) in that group
- matching this IP version.
- :param int port_max: (optional) The inclusive upper bound of the protocol
- destination port range. If set, `port_min` must also be set, and must not
- be larger.
- Specify `null` to remove an existing upper bound.
- :param int port_min: (optional) The inclusive lower bound of the protocol
- destination port range. If set, `port_max` must also be set, and must not
- be smaller.
- Specify `null` to remove an existing lower bound.
- :param SecurityGroupRuleRemotePatch remote: (optional) The remote IP
- addresses or security groups from which this rule will allow traffic (or to
- which, for outbound rules). Can be specified as an IP address, a CIDR
- block, or a
- security group. A CIDR block of `0.0.0.0/0` will allow traffic from any
- source (or to
- any destination, for outbound rules).
- :param int type: (optional) The ICMP traffic type to allow.
- Specify `null` to remove an existing ICMP traffic type value.
- """
- self.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
+ :param ReservedIPCollectionInstanceNetworkInterfaceContextFirst first: A
+ link to the first page of resources.
+ :param List[ReservedIP] ips: Collection of reserved IPs bound to an
+ instance network interface.
+ :param int limit: The maximum number of resources that can be returned by
+ the request.
+ :param int total_count: The total number of resources across all pages.
+ :param ReservedIPCollectionInstanceNetworkInterfaceContextNext next:
+ (optional) A link to the next page of resources. This property is present
+ for all pages
+ except the last page.
+ """
+ self.first = first
+ self.ips = ips
+ self.limit = limit
+ self.next = next
+ self.total_count = total_count
@classmethod
- def from_dict(cls, _dict: Dict) -> 'SecurityGroupRulePatch':
- """Initialize a SecurityGroupRulePatch object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'ReservedIPCollectionInstanceNetworkInterfaceContext':
+ """Initialize a ReservedIPCollectionInstanceNetworkInterfaceContext 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 (first := _dict.get('first')) is not None:
+ args['first'] = ReservedIPCollectionInstanceNetworkInterfaceContextFirst.from_dict(first)
+ else:
+ raise ValueError('Required property \'first\' not present in ReservedIPCollectionInstanceNetworkInterfaceContext JSON')
+ if (ips := _dict.get('ips')) is not None:
+ args['ips'] = [ReservedIP.from_dict(v) for v in ips]
+ else:
+ raise ValueError('Required property \'ips\' not present in ReservedIPCollectionInstanceNetworkInterfaceContext JSON')
+ if (limit := _dict.get('limit')) is not None:
+ args['limit'] = limit
+ else:
+ raise ValueError('Required property \'limit\' not present in ReservedIPCollectionInstanceNetworkInterfaceContext JSON')
+ if (next := _dict.get('next')) is not None:
+ args['next'] = ReservedIPCollectionInstanceNetworkInterfaceContextNext.from_dict(next)
+ if (total_count := _dict.get('total_count')) is not None:
+ args['total_count'] = total_count
+ else:
+ raise ValueError('Required property \'total_count\' not present in ReservedIPCollectionInstanceNetworkInterfaceContext JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a SecurityGroupRulePatch object from a json dictionary."""
+ """Initialize a ReservedIPCollectionInstanceNetworkInterfaceContext object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'code') and self.code is not None:
- _dict['code'] = self.code
- if hasattr(self, 'direction') and self.direction is not None:
- _dict['direction'] = self.direction
- if hasattr(self, 'ip_version') and self.ip_version is not None:
- _dict['ip_version'] = self.ip_version
- if hasattr(self, 'port_max') and self.port_max is not None:
- _dict['port_max'] = self.port_max
- if hasattr(self, 'port_min') and self.port_min is not None:
- _dict['port_min'] = self.port_min
- if hasattr(self, 'remote') and self.remote is not None:
- if isinstance(self.remote, dict):
- _dict['remote'] = self.remote
+ if hasattr(self, 'first') and self.first is not None:
+ if isinstance(self.first, dict):
+ _dict['first'] = self.first
else:
- _dict['remote'] = self.remote.to_dict()
- if hasattr(self, 'type') and self.type is not None:
- _dict['type'] = self.type
+ _dict['first'] = self.first.to_dict()
+ if hasattr(self, 'ips') and self.ips is not None:
+ ips_list = []
+ for v in self.ips:
+ if isinstance(v, dict):
+ ips_list.append(v)
+ else:
+ ips_list.append(v.to_dict())
+ _dict['ips'] = ips_list
+ if hasattr(self, 'limit') and self.limit is not None:
+ _dict['limit'] = self.limit
+ if hasattr(self, 'next') and self.next is not None:
+ if isinstance(self.next, dict):
+ _dict['next'] = self.next
+ else:
+ _dict['next'] = self.next.to_dict()
+ if hasattr(self, 'total_count') and self.total_count is not None:
+ _dict['total_count'] = self.total_count
return _dict
def _to_dict(self):
@@ -68685,299 +71916,272 @@ 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 ReservedIPCollectionInstanceNetworkInterfaceContext object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'SecurityGroupRulePatch') -> bool:
+ def __eq__(self, other: 'ReservedIPCollectionInstanceNetworkInterfaceContext') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'SecurityGroupRulePatch') -> bool:
+ def __ne__(self, other: 'ReservedIPCollectionInstanceNetworkInterfaceContext') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class DirectionEnum(str, Enum):
- """
- The direction of traffic to enforce.
- """
-
- INBOUND = 'inbound'
- OUTBOUND = 'outbound'
-
-
- class IpVersionEnum(str, Enum):
- """
- The IP version to enforce. The format of `remote.address` or `remote.cidr_block`
- must match this property, if they are used. Alternatively, if `remote` references
- a security group, then this rule only applies to IP addresses (network interfaces)
- in that group matching this IP version.
- """
-
- IPV4 = 'ipv4'
-
-
-class SecurityGroupRulePrototype:
+class ReservedIPCollectionInstanceNetworkInterfaceContextFirst:
"""
- SecurityGroupRulePrototype.
+ A link to the first page of resources.
- :attr str direction: The direction of traffic to enforce.
- :attr str ip_version: (optional) The IP version to enforce. The format of
- `remote.address` or `remote.cidr_block` must match this property, if they are
- used. Alternatively, if `remote` references a security group, then this rule
- only applies to IP addresses (network interfaces) in that group matching this IP
- version.
- :attr str protocol: The protocol to enforce.
- :attr SecurityGroupRuleRemotePrototype remote: (optional) The remote IP
- addresses or security groups from which this rule will allow traffic (or to
- which, for outbound rules). Can be specified as an IP address, a CIDR block, or
- a
- security group within the VPC.
- If unspecified, a CIDR block of `0.0.0.0/0` will be used to allow traffic from
- any source
- (or to any destination, for outbound rules).
+ :param str href: The URL for a page of resources.
"""
def __init__(
self,
- direction: str,
- protocol: str,
- *,
- ip_version: str = None,
- remote: 'SecurityGroupRuleRemotePrototype' = None,
+ href: str,
) -> None:
"""
- Initialize a SecurityGroupRulePrototype object.
+ Initialize a ReservedIPCollectionInstanceNetworkInterfaceContextFirst object.
- :param str direction: The direction of traffic to enforce.
- :param str protocol: The protocol to enforce.
- :param str ip_version: (optional) The IP version to enforce. The format of
- `remote.address` or `remote.cidr_block` must match this property, if they
- are used. Alternatively, if `remote` references a security group, then this
- rule only applies to IP addresses (network interfaces) in that group
- matching this IP version.
- :param SecurityGroupRuleRemotePrototype remote: (optional) The remote IP
- addresses or security groups from which this rule will allow traffic (or to
- which, for outbound rules). Can be specified as an IP address, a CIDR
- block, or a
- security group within the VPC.
- If unspecified, a CIDR block of `0.0.0.0/0` will be used to allow traffic
- from any source
- (or to any destination, for outbound rules).
+ :param str href: The URL for a page of resources.
"""
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll', 'SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP', 'SecurityGroupRulePrototypeSecurityGroupRuleProtocolTCPUDP'])
- )
- raise Exception(msg)
+ self.href = href
@classmethod
- def from_dict(cls, _dict: Dict) -> 'SecurityGroupRulePrototype':
- """Initialize a SecurityGroupRulePrototype object from a json dictionary."""
- disc_class = cls._get_class_by_discriminator(_dict)
- if disc_class != cls:
- return disc_class.from_dict(_dict)
- msg = "Cannot convert dictionary into an instance of base class 'SecurityGroupRulePrototype'. The discriminator value should map to a valid subclass: {1}".format(
- ", ".join(['SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll', 'SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP', 'SecurityGroupRulePrototypeSecurityGroupRuleProtocolTCPUDP'])
- )
- raise Exception(msg)
+ def from_dict(cls, _dict: Dict) -> 'ReservedIPCollectionInstanceNetworkInterfaceContextFirst':
+ """Initialize a ReservedIPCollectionInstanceNetworkInterfaceContextFirst object from a json dictionary."""
+ args = {}
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
+ else:
+ raise ValueError('Required property \'href\' not present in ReservedIPCollectionInstanceNetworkInterfaceContextFirst JSON')
+ return cls(**args)
@classmethod
- def _from_dict(cls, _dict: Dict):
- """Initialize a SecurityGroupRulePrototype object from a json dictionary."""
+ def _from_dict(cls, _dict):
+ """Initialize a ReservedIPCollectionInstanceNetworkInterfaceContextFirst object from a json dictionary."""
return cls.from_dict(_dict)
- @classmethod
- def _get_class_by_discriminator(cls, _dict: Dict) -> object:
- mapping = {}
- mapping['all'] = 'SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll'
- mapping['icmp'] = 'SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP'
- mapping['tcp'] = 'SecurityGroupRulePrototypeSecurityGroupRuleProtocolTCPUDP'
- mapping['udp'] = 'SecurityGroupRulePrototypeSecurityGroupRuleProtocolTCPUDP'
- disc_value = _dict.get('protocol')
- if disc_value is None:
- raise ValueError('Discriminator property \'protocol\' not found in SecurityGroupRulePrototype JSON')
- class_name = mapping.get(disc_value, disc_value)
- try:
- disc_class = getattr(sys.modules[__name__], class_name)
- except AttributeError:
- disc_class = cls
- if isinstance(disc_class, object):
- return disc_class
- raise TypeError('%s is not a discriminator class' % class_name)
-
- class DirectionEnum(str, Enum):
- """
- The direction of traffic to enforce.
- """
-
- INBOUND = 'inbound'
- OUTBOUND = 'outbound'
-
-
- class IpVersionEnum(str, Enum):
- """
- The IP version to enforce. The format of `remote.address` or `remote.cidr_block`
- must match this property, if they are used. Alternatively, if `remote` references
- a security group, then this rule only applies to IP addresses (network interfaces)
- in that group matching this IP version.
- """
-
- IPV4 = 'ipv4'
+ def to_dict(self) -> Dict:
+ """Return a json dictionary representing this model."""
+ _dict = {}
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
+ return _dict
+ def _to_dict(self):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
- class ProtocolEnum(str, Enum):
- """
- The protocol to enforce.
- """
+ def __str__(self) -> str:
+ """Return a `str` version of this ReservedIPCollectionInstanceNetworkInterfaceContextFirst object."""
+ return json.dumps(self.to_dict(), indent=2)
- ALL = 'all'
- ICMP = 'icmp'
- TCP = 'tcp'
- UDP = 'udp'
+ def __eq__(self, other: 'ReservedIPCollectionInstanceNetworkInterfaceContextFirst') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+ def __ne__(self, other: 'ReservedIPCollectionInstanceNetworkInterfaceContextFirst') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
-class SecurityGroupRuleRemote:
+class ReservedIPCollectionInstanceNetworkInterfaceContextNext:
"""
- The remote IP addresses or security groups from which this rule allows traffic (or to
- which, for outbound rules). A CIDR block of `0.0.0.0/0` allows traffic from any source
- (or to any destination, for outbound rules).
+ 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.
"""
def __init__(
self,
+ href: str,
) -> None:
"""
- Initialize a SecurityGroupRuleRemote object.
+ Initialize a ReservedIPCollectionInstanceNetworkInterfaceContextNext object.
+ :param str href: The URL for a page of resources.
"""
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['SecurityGroupRuleRemoteIP', 'SecurityGroupRuleRemoteCIDR', 'SecurityGroupRuleRemoteSecurityGroupReference'])
- )
- raise Exception(msg)
+ self.href = href
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'ReservedIPCollectionInstanceNetworkInterfaceContextNext':
+ """Initialize a ReservedIPCollectionInstanceNetworkInterfaceContextNext object from a json dictionary."""
+ args = {}
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
+ else:
+ raise ValueError('Required property \'href\' not present in ReservedIPCollectionInstanceNetworkInterfaceContextNext JSON')
+ return cls(**args)
-class SecurityGroupRuleRemotePatch:
- """
- The remote IP addresses or security groups from which this rule will allow traffic (or
- to which, for outbound rules). Can be specified as an IP address, a CIDR block, or a
- security group. A CIDR block of `0.0.0.0/0` will allow traffic from any source (or to
- any destination, for outbound rules).
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a ReservedIPCollectionInstanceNetworkInterfaceContextNext object from a json dictionary."""
+ return cls.from_dict(_dict)
- """
+ def to_dict(self) -> Dict:
+ """Return a json dictionary representing this model."""
+ _dict = {}
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
+ return _dict
- def __init__(
- self,
- ) -> None:
- """
- Initialize a SecurityGroupRuleRemotePatch 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(['SecurityGroupRuleRemotePatchIP', 'SecurityGroupRuleRemotePatchCIDR', 'SecurityGroupRuleRemotePatchSecurityGroupIdentity'])
- )
- raise Exception(msg)
+ def __str__(self) -> str:
+ """Return a `str` version of this ReservedIPCollectionInstanceNetworkInterfaceContextNext object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'ReservedIPCollectionInstanceNetworkInterfaceContextNext') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'ReservedIPCollectionInstanceNetworkInterfaceContextNext') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
-class SecurityGroupRuleRemotePrototype:
+class ReservedIPCollectionNext:
"""
- The remote IP addresses or security groups from which this rule will allow traffic (or
- to which, for outbound rules). Can be specified as an IP address, a CIDR block, or a
- security group within the VPC.
- If unspecified, a CIDR block of `0.0.0.0/0` will be used to allow traffic from any
- source
- (or to any destination, for outbound rules).
+ 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.
"""
def __init__(
self,
+ href: str,
) -> None:
"""
- Initialize a SecurityGroupRuleRemotePrototype object.
+ Initialize a ReservedIPCollectionNext object.
+ :param str href: The URL for a page of resources.
"""
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['SecurityGroupRuleRemotePrototypeIP', 'SecurityGroupRuleRemotePrototypeCIDR', 'SecurityGroupRuleRemotePrototypeSecurityGroupIdentity'])
- )
- raise Exception(msg)
+ self.href = href
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'ReservedIPCollectionNext':
+ """Initialize a ReservedIPCollectionNext object from a json dictionary."""
+ args = {}
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
+ else:
+ raise ValueError('Required property \'href\' not present in ReservedIPCollectionNext JSON')
+ return cls(**args)
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a ReservedIPCollectionNext object from a json dictionary."""
+ return cls.from_dict(_dict)
-class SecurityGroupTargetCollection:
+ 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 ReservedIPCollectionNext object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'ReservedIPCollectionNext') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'ReservedIPCollectionNext') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+
+class ReservedIPCollectionVirtualNetworkInterfaceContext:
"""
- SecurityGroupTargetCollection.
+ ReservedIPCollectionVirtualNetworkInterfaceContext.
- :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
+ :param ReservedIPCollectionVirtualNetworkInterfaceContextFirst first: A link to
+ the first page of resources.
+ :param List[ReservedIPReference] ips: Collection of reserved IPs bound to the
+ virtual network interface specified by the identifier in the URL.
+ :param 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
+ :param ReservedIPCollectionVirtualNetworkInterfaceContextNext 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.
+ :param int total_count: The total number of resources across all pages.
"""
def __init__(
self,
- first: 'SecurityGroupTargetCollectionFirst',
+ first: 'ReservedIPCollectionVirtualNetworkInterfaceContextFirst',
+ ips: List['ReservedIPReference'],
limit: int,
- targets: List['SecurityGroupTargetReference'],
total_count: int,
*,
- next: 'SecurityGroupTargetCollectionNext' = None,
+ next: Optional['ReservedIPCollectionVirtualNetworkInterfaceContextNext'] = None,
) -> None:
"""
- Initialize a SecurityGroupTargetCollection object.
+ Initialize a ReservedIPCollectionVirtualNetworkInterfaceContext object.
- :param SecurityGroupTargetCollectionFirst first: A link to the first page
- of resources.
+ :param ReservedIPCollectionVirtualNetworkInterfaceContextFirst first: A
+ link to the first page of resources.
+ :param List[ReservedIPReference] ips: Collection of reserved IPs bound to
+ the virtual network interface specified by the identifier in the URL.
:param int limit: The maximum number of resources that can be returned by
the request.
- :param List[SecurityGroupTargetReference] targets: Collection of targets
- for this security group.
:param int total_count: The total number of resources across all pages.
- :param SecurityGroupTargetCollectionNext next: (optional) A link to the
- next page of resources. This property is present for all pages
+ :param ReservedIPCollectionVirtualNetworkInterfaceContextNext next:
+ (optional) A link to the next page of resources. This property is present
+ for all pages
except the last page.
"""
self.first = first
+ self.ips = ips
self.limit = limit
self.next = next
- self.targets = targets
self.total_count = total_count
@classmethod
- def from_dict(cls, _dict: Dict) -> 'SecurityGroupTargetCollection':
- """Initialize a SecurityGroupTargetCollection object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'ReservedIPCollectionVirtualNetworkInterfaceContext':
+ """Initialize a ReservedIPCollectionVirtualNetworkInterfaceContext object from a json dictionary."""
args = {}
- if 'first' in _dict:
- args['first'] = SecurityGroupTargetCollectionFirst.from_dict(_dict.get('first'))
+ if (first := _dict.get('first')) is not None:
+ args['first'] = ReservedIPCollectionVirtualNetworkInterfaceContextFirst.from_dict(first)
else:
- raise ValueError('Required property \'first\' not present in SecurityGroupTargetCollection JSON')
- if 'limit' in _dict:
- args['limit'] = _dict.get('limit')
+ raise ValueError('Required property \'first\' not present in ReservedIPCollectionVirtualNetworkInterfaceContext JSON')
+ if (ips := _dict.get('ips')) is not None:
+ args['ips'] = [ReservedIPReference.from_dict(v) for v in ips]
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')
+ raise ValueError('Required property \'ips\' not present in ReservedIPCollectionVirtualNetworkInterfaceContext JSON')
+ if (limit := _dict.get('limit')) is not None:
+ args['limit'] = limit
else:
- raise ValueError('Required property \'targets\' not present in SecurityGroupTargetCollection JSON')
- if 'total_count' in _dict:
- args['total_count'] = _dict.get('total_count')
+ raise ValueError('Required property \'limit\' not present in ReservedIPCollectionVirtualNetworkInterfaceContext JSON')
+ if (next := _dict.get('next')) is not None:
+ args['next'] = ReservedIPCollectionVirtualNetworkInterfaceContextNext.from_dict(next)
+ if (total_count := _dict.get('total_count')) is not None:
+ args['total_count'] = total_count
else:
- raise ValueError('Required property \'total_count\' not present in SecurityGroupTargetCollection JSON')
+ raise ValueError('Required property \'total_count\' not present in ReservedIPCollectionVirtualNetworkInterfaceContext JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a SecurityGroupTargetCollection object from a json dictionary."""
+ """Initialize a ReservedIPCollectionVirtualNetworkInterfaceContext object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -68988,6 +72192,14 @@ def to_dict(self) -> Dict:
_dict['first'] = self.first
else:
_dict['first'] = self.first.to_dict()
+ if hasattr(self, 'ips') and self.ips is not None:
+ ips_list = []
+ for v in self.ips:
+ if isinstance(v, dict):
+ ips_list.append(v)
+ else:
+ ips_list.append(v.to_dict())
+ _dict['ips'] = ips_list
if hasattr(self, 'limit') and self.limit is not None:
_dict['limit'] = self.limit
if hasattr(self, 'next') and self.next is not None:
@@ -68995,14 +72207,6 @@ def to_dict(self) -> Dict:
_dict['next'] = self.next
else:
_dict['next'] = self.next.to_dict()
- if hasattr(self, 'targets') and self.targets is not None:
- targets_list = []
- for v in self.targets:
- if isinstance(v, dict):
- targets_list.append(v)
- else:
- targets_list.append(v.to_dict())
- _dict['targets'] = targets_list
if hasattr(self, 'total_count') and self.total_count is not None:
_dict['total_count'] = self.total_count
return _dict
@@ -69012,25 +72216,25 @@ 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 ReservedIPCollectionVirtualNetworkInterfaceContext object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'SecurityGroupTargetCollection') -> bool:
+ def __eq__(self, other: 'ReservedIPCollectionVirtualNetworkInterfaceContext') -> bool:
"""Return `true` when 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: 'ReservedIPCollectionVirtualNetworkInterfaceContext') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class SecurityGroupTargetCollectionFirst:
+class ReservedIPCollectionVirtualNetworkInterfaceContextFirst:
"""
A link to the first page of resources.
- :attr str href: The URL for a page of resources.
+ :param str href: The URL for a page of resources.
"""
def __init__(
@@ -69038,25 +72242,25 @@ def __init__(
href: str,
) -> None:
"""
- Initialize a SecurityGroupTargetCollectionFirst object.
+ Initialize a ReservedIPCollectionVirtualNetworkInterfaceContextFirst object.
:param str href: The URL for a page of resources.
"""
self.href = href
@classmethod
- def from_dict(cls, _dict: Dict) -> 'SecurityGroupTargetCollectionFirst':
- """Initialize a SecurityGroupTargetCollectionFirst object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'ReservedIPCollectionVirtualNetworkInterfaceContextFirst':
+ """Initialize a ReservedIPCollectionVirtualNetworkInterfaceContextFirst object from a json dictionary."""
args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'href\' not present in SecurityGroupTargetCollectionFirst JSON')
+ raise ValueError('Required property \'href\' not present in ReservedIPCollectionVirtualNetworkInterfaceContextFirst JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a SecurityGroupTargetCollectionFirst object from a json dictionary."""
+ """Initialize a ReservedIPCollectionVirtualNetworkInterfaceContextFirst object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -69071,26 +72275,26 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this SecurityGroupTargetCollectionFirst object."""
+ """Return a `str` version of this ReservedIPCollectionVirtualNetworkInterfaceContextFirst object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'SecurityGroupTargetCollectionFirst') -> bool:
+ def __eq__(self, other: 'ReservedIPCollectionVirtualNetworkInterfaceContextFirst') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'SecurityGroupTargetCollectionFirst') -> bool:
+ def __ne__(self, other: 'ReservedIPCollectionVirtualNetworkInterfaceContextFirst') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class SecurityGroupTargetCollectionNext:
+class ReservedIPCollectionVirtualNetworkInterfaceContextNext:
"""
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.
+ :param str href: The URL for a page of resources.
"""
def __init__(
@@ -69098,25 +72302,25 @@ def __init__(
href: str,
) -> None:
"""
- Initialize a SecurityGroupTargetCollectionNext object.
+ Initialize a ReservedIPCollectionVirtualNetworkInterfaceContextNext object.
:param str href: The URL for a page of resources.
"""
self.href = href
@classmethod
- def from_dict(cls, _dict: Dict) -> 'SecurityGroupTargetCollectionNext':
- """Initialize a SecurityGroupTargetCollectionNext object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'ReservedIPCollectionVirtualNetworkInterfaceContextNext':
+ """Initialize a ReservedIPCollectionVirtualNetworkInterfaceContextNext object from a json dictionary."""
args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'href\' not present in SecurityGroupTargetCollectionNext JSON')
+ raise ValueError('Required property \'href\' not present in ReservedIPCollectionVirtualNetworkInterfaceContextNext JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a SecurityGroupTargetCollectionNext object from a json dictionary."""
+ """Initialize a ReservedIPCollectionVirtualNetworkInterfaceContextNext object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -69131,422 +72335,203 @@ 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 ReservedIPCollectionVirtualNetworkInterfaceContextNext object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'SecurityGroupTargetCollectionNext') -> bool:
+ def __eq__(self, other: 'ReservedIPCollectionVirtualNetworkInterfaceContextNext') -> bool:
"""Return `true` when 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: 'ReservedIPCollectionVirtualNetworkInterfaceContextNext') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class SecurityGroupTargetReference:
+class ReservedIPPatch:
"""
- 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.
+ ReservedIPPatch.
+ :param bool auto_delete: (optional) Indicates whether this reserved IP member
+ will be automatically deleted when either
+ `target` is deleted, or the reserved IP is unbound. Must be `false` if the
+ reserved IP is unbound.
+ :param str name: (optional) The name for this reserved IP. The name must not be
+ used by another reserved IP in the subnet. Names starting with `ibm-` are
+ reserved for provider-owned resources, and are not allowed.
"""
def __init__(
self,
+ *,
+ auto_delete: Optional[bool] = None,
+ name: Optional[str] = None,
) -> None:
"""
- Initialize a SecurityGroupTargetReference object.
+ Initialize a ReservedIPPatch object.
+ :param bool auto_delete: (optional) Indicates whether this reserved IP
+ member will be automatically deleted when either
+ `target` is deleted, or the reserved IP is unbound. Must be `false` if the
+ reserved IP is unbound.
+ :param str name: (optional) The name for this reserved IP. The name must
+ not be used by another reserved IP in the subnet. Names starting with
+ `ibm-` are reserved for provider-owned resources, and are not allowed.
"""
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext', 'SecurityGroupTargetReferenceBareMetalServerNetworkInterfaceReferenceTargetContext', 'SecurityGroupTargetReferenceLoadBalancerReference', 'SecurityGroupTargetReferenceEndpointGatewayReference', 'SecurityGroupTargetReferenceVPNServerReference', 'SecurityGroupTargetReferenceVirtualNetworkInterfaceReference'])
- )
- raise Exception(msg)
+ self.auto_delete = auto_delete
+ self.name = name
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'ReservedIPPatch':
+ """Initialize a ReservedIPPatch object from a json dictionary."""
+ args = {}
+ if (auto_delete := _dict.get('auto_delete')) is not None:
+ args['auto_delete'] = auto_delete
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ return cls(**args)
-class Share:
- """
- Share.
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a ReservedIPPatch object from a json dictionary."""
+ return cls.from_dict(_dict)
- :attr str access_control_mode: The access control mode for the share:
- - `security_group`: The security groups on the virtual network interface for a
- mount
- target control access to the mount target.
- - `vpc`: All clients in the VPC for a mount target have access to the mount
- target.
- The enumerated access control mode values for this property may expand in the
- future. When processing this property, check for and log unknown values.
- Optionally halt processing and surface the error, or bypass the resource on
- which the unexpected access control mode was encountered.
- :attr datetime created_at: The date and time that the file share is created.
- :attr str crn: The CRN for this file share.
- :attr str encryption: The type of encryption used for this file share.
- :attr EncryptionKeyReference encryption_key: (optional) The key used to encrypt
- this file share.
- This property will be present if `encryption_type` is `user_managed`.
- :attr str href: The URL for this file share.
- :attr str id: The unique identifier for this file share.
- :attr int iops: The maximum input/output operations per second (IOPS) for the
- file share. In addition, each client accessing the share will be restricted to
- 48,000 IOPS.
- The maximum IOPS for a share may increase in the future.
- :attr ShareJob latest_job: (optional) The latest job associated with this file
- share.
- This property will be absent if no jobs have been created for this file share.
- :attr str lifecycle_state: The lifecycle state of the file share.
- :attr List[ShareMountTargetReference] mount_targets: The mount targets for the
- file share.
- :attr str name: The name for this share. The name is unique across all shares in
- the region.
- :attr ShareProfileReference profile: The
- [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-profiles) for
- this file share.
- :attr ShareReference replica_share: (optional) The replica file share for this
- source file share.
- This property will be present when the `replication_role` is `source`.
- :attr str replication_cron_spec: (optional) The cron specification for the file
- share replication schedule.
- This property will be present when the `replication_role` is `replica`.
- :attr str replication_role: The replication role of the file share.
- * `none`: This share is not participating in replication.
- * `replica`: This share is a replication target.
- * `source`: This share is a replication source.
- :attr str replication_status: The replication status of the file share.
- * `active`: This share is actively participating in replication, and the
- replica's data is up-to-date with the replication schedule.
- * `failover_pending`: This share is performing a replication failover.
- * `initializing`: This share is initializing replication.
- * `none`: This share is not participating in replication.
- * `split_pending`: This share is performing a replication split.
- :attr List[ShareReplicationStatusReason] replication_status_reasons: The reasons
- for the current replication status (if any).
- The enumerated reason code values for this property will expand in the future.
- When processing this property, check for and log unknown values. Optionally halt
- processing and surface the error, or bypass the resource on which the unexpected
- reason code was encountered.
- :attr ResourceGroupReference resource_group: The resource group for this file
- share.
- :attr str resource_type: The resource type.
- :attr int size: The size of the file share rounded up to the next gigabyte.
- The maximum size for a share may increase in the future.
- :attr ShareReference source_share: (optional) The source file share for this
- replica file share.
- This property will be present when the `replication_role` is `replica`.
- :attr List[str] user_tags: Tags for this resource.
- :attr ZoneReference zone: The zone this file share will reside in.
- """
+ def 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 __init__(
- self,
- access_control_mode: str,
- created_at: datetime,
- crn: str,
- encryption: str,
- href: str,
- id: str,
- iops: int,
- lifecycle_state: str,
- mount_targets: List['ShareMountTargetReference'],
- name: str,
- profile: 'ShareProfileReference',
- replication_role: str,
- replication_status: str,
- replication_status_reasons: List['ShareReplicationStatusReason'],
- resource_group: 'ResourceGroupReference',
+ def _to_dict(self):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
+
+ def __str__(self) -> str:
+ """Return a `str` version of this ReservedIPPatch object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'ReservedIPPatch') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'ReservedIPPatch') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+
+class ReservedIPReference:
+ """
+ ReservedIPReference.
+
+ :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 ReservedIPReferenceDeleted deleted: (optional) If present, this property
+ indicates the referenced resource has been deleted, and provides
+ some supplementary information.
+ :param str href: The URL for this reserved IP.
+ :param str id: The unique identifier for this reserved IP.
+ :param str name: The name for this reserved IP. The name is unique across all
+ reserved IPs in a subnet.
+ :param str resource_type: The resource type.
+ """
+
+ def __init__(
+ self,
+ address: str,
+ href: str,
+ id: str,
+ name: str,
resource_type: str,
- size: int,
- user_tags: List[str],
- zone: 'ZoneReference',
*,
- encryption_key: 'EncryptionKeyReference' = None,
- latest_job: 'ShareJob' = None,
- replica_share: 'ShareReference' = None,
- replication_cron_spec: str = None,
- source_share: 'ShareReference' = None,
+ deleted: Optional['ReservedIPReferenceDeleted'] = None,
) -> None:
"""
- Initialize a Share object.
+ Initialize a ReservedIPReference object.
- :param str access_control_mode: The access control mode for the share:
- - `security_group`: The security groups on the virtual network interface
- for a mount
- target control access to the mount target.
- - `vpc`: All clients in the VPC for a mount target have access to the mount
- target.
- The enumerated access control mode values for this property may expand in
- the future. When processing this property, check for and log unknown
- values. Optionally halt processing and surface the error, or bypass the
- resource on which the unexpected access control mode was encountered.
- :param datetime created_at: The date and time that the file share is
- created.
- :param str crn: The CRN for this file share.
- :param str encryption: The type of encryption used for this file share.
- :param str href: The URL for this file share.
- :param str id: The unique identifier for this file share.
- :param int iops: The maximum input/output operations per second (IOPS) for
- the file share. In addition, each client accessing the share will be
- restricted to 48,000 IOPS.
- The maximum IOPS for a share may increase in the future.
- :param str lifecycle_state: The lifecycle state of the file share.
- :param List[ShareMountTargetReference] mount_targets: The mount targets for
- the file share.
- :param str name: The name for this share. The name is unique across all
- shares in the region.
- :param ShareProfileReference profile: The
- [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-profiles)
- for
- this file share.
- :param str replication_role: The replication role of the file share.
- * `none`: This share is not participating in replication.
- * `replica`: This share is a replication target.
- * `source`: This share is a replication source.
- :param str replication_status: The replication status of the file share.
- * `active`: This share is actively participating in replication, and the
- replica's data is up-to-date with the replication schedule.
- * `failover_pending`: This share is performing a replication failover.
- * `initializing`: This share is initializing replication.
- * `none`: This share is not participating in replication.
- * `split_pending`: This share is performing a replication split.
- :param List[ShareReplicationStatusReason] replication_status_reasons: The
- reasons for the current replication status (if any).
- The enumerated reason code values for this property will expand in the
- future. When processing this property, check for and log unknown values.
- Optionally halt processing and surface the error, or bypass the resource on
- which the unexpected reason code was encountered.
- :param ResourceGroupReference resource_group: The resource group for this
- file share.
+ :param str address: The IP address.
+ If the address has not yet been selected, the value will be `0.0.0.0`.
+ This property may add support for IPv6 addresses in the future. When
+ processing a value in this property, verify that the address is in an
+ expected format. If it is not, log an error. Optionally halt processing and
+ surface the error, or bypass the resource on which the unexpected IP
+ address format was encountered.
+ :param str href: The URL for this reserved IP.
+ :param str id: The unique identifier for this reserved IP.
+ :param str name: The name for this reserved IP. The name is unique across
+ all reserved IPs in a subnet.
:param str resource_type: The resource type.
- :param int size: The size of the file share rounded up to the next
- gigabyte.
- The maximum size for a share may increase in the future.
- :param List[str] user_tags: Tags for this resource.
- :param ZoneReference zone: The zone this file share will reside in.
- :param EncryptionKeyReference encryption_key: (optional) The key used to
- encrypt this file share.
- This property will be present if `encryption_type` is `user_managed`.
- :param ShareJob latest_job: (optional) The latest job associated with this
- file share.
- This property will be absent if no jobs have been created for this file
- share.
- :param ShareReference replica_share: (optional) The replica file share for
- this source file share.
- This property will be present when the `replication_role` is `source`.
- :param str replication_cron_spec: (optional) The cron specification for the
- file share replication schedule.
- This property will be present when the `replication_role` is `replica`.
- :param ShareReference source_share: (optional) The source file share for
- this replica file share.
- This property will be present when the `replication_role` is `replica`.
+ :param ReservedIPReferenceDeleted deleted: (optional) If present, this
+ property indicates the referenced resource has been deleted, and provides
+ some supplementary information.
"""
- self.access_control_mode = access_control_mode
- self.created_at = created_at
- self.crn = crn
- self.encryption = encryption
- self.encryption_key = encryption_key
+ self.address = address
+ self.deleted = deleted
self.href = href
self.id = id
- self.iops = iops
- self.latest_job = latest_job
- self.lifecycle_state = lifecycle_state
- self.mount_targets = mount_targets
self.name = name
- self.profile = profile
- self.replica_share = replica_share
- self.replication_cron_spec = replication_cron_spec
- self.replication_role = replication_role
- self.replication_status = replication_status
- self.replication_status_reasons = replication_status_reasons
- self.resource_group = resource_group
self.resource_type = resource_type
- self.size = size
- self.source_share = source_share
- self.user_tags = user_tags
- self.zone = zone
@classmethod
- def from_dict(cls, _dict: Dict) -> 'Share':
- """Initialize a Share object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'ReservedIPReference':
+ """Initialize a ReservedIPReference object from a json dictionary."""
args = {}
- if 'access_control_mode' in _dict:
- args['access_control_mode'] = _dict.get('access_control_mode')
- else:
- raise ValueError('Required property \'access_control_mode\' not present in Share JSON')
- if 'created_at' in _dict:
- args['created_at'] = string_to_datetime(_dict.get('created_at'))
+ if (address := _dict.get('address')) is not None:
+ args['address'] = address
else:
- raise ValueError('Required property \'created_at\' not present in Share JSON')
- if 'crn' in _dict:
- args['crn'] = _dict.get('crn')
- else:
- raise ValueError('Required property \'crn\' not present in Share JSON')
- if 'encryption' in _dict:
- args['encryption'] = _dict.get('encryption')
- else:
- raise ValueError('Required property \'encryption\' not present in Share JSON')
- if 'encryption_key' in _dict:
- args['encryption_key'] = EncryptionKeyReference.from_dict(_dict.get('encryption_key'))
- if 'href' in _dict:
- args['href'] = _dict.get('href')
- else:
- raise ValueError('Required property \'href\' not present in Share JSON')
- if 'id' in _dict:
- args['id'] = _dict.get('id')
- else:
- raise ValueError('Required property \'id\' not present in Share JSON')
- if 'iops' in _dict:
- args['iops'] = _dict.get('iops')
- else:
- raise ValueError('Required property \'iops\' not present in Share JSON')
- if 'latest_job' in _dict:
- args['latest_job'] = ShareJob.from_dict(_dict.get('latest_job'))
- if 'lifecycle_state' in _dict:
- args['lifecycle_state'] = _dict.get('lifecycle_state')
- else:
- raise ValueError('Required property \'lifecycle_state\' not present in Share JSON')
- if 'mount_targets' in _dict:
- args['mount_targets'] = [ShareMountTargetReference.from_dict(v) for v in _dict.get('mount_targets')]
- else:
- raise ValueError('Required property \'mount_targets\' not present in Share JSON')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
- else:
- raise ValueError('Required property \'name\' not present in Share JSON')
- if 'profile' in _dict:
- args['profile'] = ShareProfileReference.from_dict(_dict.get('profile'))
- else:
- raise ValueError('Required property \'profile\' not present in Share JSON')
- if 'replica_share' in _dict:
- args['replica_share'] = ShareReference.from_dict(_dict.get('replica_share'))
- if 'replication_cron_spec' in _dict:
- args['replication_cron_spec'] = _dict.get('replication_cron_spec')
- if 'replication_role' in _dict:
- args['replication_role'] = _dict.get('replication_role')
- else:
- raise ValueError('Required property \'replication_role\' not present in Share JSON')
- if 'replication_status' in _dict:
- args['replication_status'] = _dict.get('replication_status')
- else:
- raise ValueError('Required property \'replication_status\' not present in Share JSON')
- if 'replication_status_reasons' in _dict:
- args['replication_status_reasons'] = [ShareReplicationStatusReason.from_dict(v) for v in _dict.get('replication_status_reasons')]
- else:
- raise ValueError('Required property \'replication_status_reasons\' not present in Share JSON')
- if 'resource_group' in _dict:
- args['resource_group'] = ResourceGroupReference.from_dict(_dict.get('resource_group'))
- else:
- raise ValueError('Required property \'resource_group\' not present in Share JSON')
- if 'resource_type' in _dict:
- args['resource_type'] = _dict.get('resource_type')
+ raise ValueError('Required property \'address\' not present in ReservedIPReference JSON')
+ if (deleted := _dict.get('deleted')) is not None:
+ args['deleted'] = ReservedIPReferenceDeleted.from_dict(deleted)
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'resource_type\' not present in Share JSON')
- if 'size' in _dict:
- args['size'] = _dict.get('size')
+ raise ValueError('Required property \'href\' not present in ReservedIPReference JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
else:
- raise ValueError('Required property \'size\' not present in Share JSON')
- if 'source_share' in _dict:
- args['source_share'] = ShareReference.from_dict(_dict.get('source_share'))
- if 'user_tags' in _dict:
- args['user_tags'] = _dict.get('user_tags')
+ raise ValueError('Required property \'id\' not present in ReservedIPReference JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
else:
- raise ValueError('Required property \'user_tags\' not present in Share JSON')
- if 'zone' in _dict:
- args['zone'] = ZoneReference.from_dict(_dict.get('zone'))
+ raise ValueError('Required property \'name\' not present in ReservedIPReference JSON')
+ if (resource_type := _dict.get('resource_type')) is not None:
+ args['resource_type'] = resource_type
else:
- raise ValueError('Required property \'zone\' not present in Share JSON')
+ raise ValueError('Required property \'resource_type\' not present in ReservedIPReference JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a Share 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, 'access_control_mode') and self.access_control_mode is not None:
- _dict['access_control_mode'] = self.access_control_mode
- if hasattr(self, 'created_at') and self.created_at is not None:
- _dict['created_at'] = datetime_to_string(self.created_at)
- if hasattr(self, 'crn') and self.crn is not None:
- _dict['crn'] = self.crn
- if hasattr(self, 'encryption') and self.encryption is not None:
- _dict['encryption'] = self.encryption
- if hasattr(self, 'encryption_key') and self.encryption_key is not None:
- if isinstance(self.encryption_key, dict):
- _dict['encryption_key'] = self.encryption_key
+ if hasattr(self, 'address') and self.address is not None:
+ _dict['address'] = self.address
+ if hasattr(self, 'deleted') and self.deleted is not None:
+ if isinstance(self.deleted, dict):
+ _dict['deleted'] = self.deleted
else:
- _dict['encryption_key'] = self.encryption_key.to_dict()
+ _dict['deleted'] = self.deleted.to_dict()
if hasattr(self, 'href') and self.href is not None:
_dict['href'] = self.href
if hasattr(self, 'id') and self.id is not None:
_dict['id'] = self.id
- if hasattr(self, 'iops') and self.iops is not None:
- _dict['iops'] = self.iops
- if hasattr(self, 'latest_job') and self.latest_job is not None:
- if isinstance(self.latest_job, dict):
- _dict['latest_job'] = self.latest_job
- else:
- _dict['latest_job'] = self.latest_job.to_dict()
- if hasattr(self, 'lifecycle_state') and self.lifecycle_state is not None:
- _dict['lifecycle_state'] = self.lifecycle_state
- if hasattr(self, 'mount_targets') and self.mount_targets is not None:
- mount_targets_list = []
- for v in self.mount_targets:
- if isinstance(v, dict):
- mount_targets_list.append(v)
- else:
- mount_targets_list.append(v.to_dict())
- _dict['mount_targets'] = mount_targets_list
if hasattr(self, 'name') and self.name is not None:
_dict['name'] = self.name
- if hasattr(self, 'profile') and self.profile is not None:
- if isinstance(self.profile, dict):
- _dict['profile'] = self.profile
- else:
- _dict['profile'] = self.profile.to_dict()
- if hasattr(self, 'replica_share') and self.replica_share is not None:
- if isinstance(self.replica_share, dict):
- _dict['replica_share'] = self.replica_share
- else:
- _dict['replica_share'] = self.replica_share.to_dict()
- if hasattr(self, 'replication_cron_spec') and self.replication_cron_spec is not None:
- _dict['replication_cron_spec'] = self.replication_cron_spec
- if hasattr(self, 'replication_role') and self.replication_role is not None:
- _dict['replication_role'] = self.replication_role
- if hasattr(self, 'replication_status') and self.replication_status is not None:
- _dict['replication_status'] = self.replication_status
- if hasattr(self, 'replication_status_reasons') and self.replication_status_reasons is not None:
- replication_status_reasons_list = []
- for v in self.replication_status_reasons:
- if isinstance(v, dict):
- replication_status_reasons_list.append(v)
- else:
- replication_status_reasons_list.append(v.to_dict())
- _dict['replication_status_reasons'] = replication_status_reasons_list
- if hasattr(self, 'resource_group') and self.resource_group is not None:
- if isinstance(self.resource_group, dict):
- _dict['resource_group'] = self.resource_group
- else:
- _dict['resource_group'] = self.resource_group.to_dict()
if hasattr(self, 'resource_type') and self.resource_type is not None:
_dict['resource_type'] = self.resource_type
- if hasattr(self, 'size') and self.size is not None:
- _dict['size'] = self.size
- if hasattr(self, 'source_share') and self.source_share is not None:
- if isinstance(self.source_share, dict):
- _dict['source_share'] = self.source_share
- else:
- _dict['source_share'] = self.source_share.to_dict()
- if hasattr(self, 'user_tags') and self.user_tags is not None:
- _dict['user_tags'] = self.user_tags
- if hasattr(self, 'zone') and self.zone is not None:
- if isinstance(self.zone, dict):
- _dict['zone'] = self.zone
- else:
- _dict['zone'] = self.zone.to_dict()
return _dict
def _to_dict(self):
@@ -69554,195 +72539,67 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this Share object."""
+ """Return a `str` version of this ReservedIPReference object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'Share') -> 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: 'Share') -> bool:
+ def __ne__(self, other: 'ReservedIPReference') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class AccessControlModeEnum(str, Enum):
- """
- The access control mode for the share:
- - `security_group`: The security groups on the virtual network interface for a
- mount
- target control access to the mount target.
- - `vpc`: All clients in the VPC for a mount target have access to the mount
- target.
- The enumerated access control mode values for this property may expand in the
- future. When processing this property, check for and log unknown values.
- Optionally halt processing and surface the error, or bypass the resource on which
- the unexpected access control mode was encountered.
- """
-
- SECURITY_GROUP = 'security_group'
- VPC = 'vpc'
-
-
- class EncryptionEnum(str, Enum):
- """
- The type of encryption used for this file share.
- """
-
- PROVIDER_MANAGED = 'provider_managed'
- USER_MANAGED = 'user_managed'
-
-
- class LifecycleStateEnum(str, Enum):
- """
- The lifecycle state of the file share.
- """
-
- DELETING = 'deleting'
- FAILED = 'failed'
- PENDING = 'pending'
- STABLE = 'stable'
- SUSPENDED = 'suspended'
- UPDATING = 'updating'
- WAITING = 'waiting'
-
-
- class ReplicationRoleEnum(str, Enum):
- """
- The replication role of the file share.
- * `none`: This share is not participating in replication.
- * `replica`: This share is a replication target.
- * `source`: This share is a replication source.
- """
-
- NONE = 'none'
- REPLICA = 'replica'
- SOURCE = 'source'
-
-
- class ReplicationStatusEnum(str, Enum):
- """
- The replication status of the file share.
- * `active`: This share is actively participating in replication, and the replica's
- data is up-to-date with the replication schedule.
- * `failover_pending`: This share is performing a replication failover.
- * `initializing`: This share is initializing replication.
- * `none`: This share is not participating in replication.
- * `split_pending`: This share is performing a replication split.
- """
-
- ACTIVE = 'active'
- FAILOVER_PENDING = 'failover_pending'
- INITIALIZING = 'initializing'
- NONE = 'none'
- SPLIT_PENDING = 'split_pending'
-
-
class ResourceTypeEnum(str, Enum):
"""
The resource type.
"""
- SHARE = 'share'
+ SUBNET_RESERVED_IP = 'subnet_reserved_ip'
-class ShareCollection:
+class ReservedIPReferenceDeleted:
"""
- ShareCollection.
+ If present, this property indicates the referenced resource has been deleted, and
+ provides some supplementary information.
- :attr ShareCollectionFirst first: A link to the first page of resources.
- :attr int limit: The maximum number of resources that can be returned by the
- request.
- :attr ShareCollectionNext next: (optional) A link to the next page of resources.
- This property is present for all pages
- except the last page.
- :attr List[Share] shares: Collection of file shares.
- :attr int total_count: The total number of resources across all pages.
+ :param str more_info: Link to documentation about deleted resources.
"""
def __init__(
self,
- first: 'ShareCollectionFirst',
- limit: int,
- shares: List['Share'],
- total_count: int,
- *,
- next: 'ShareCollectionNext' = None,
+ more_info: str,
) -> None:
"""
- Initialize a ShareCollection object.
+ Initialize a ReservedIPReferenceDeleted object.
- :param ShareCollectionFirst first: A link to the first page of resources.
- :param int limit: The maximum number of resources that can be returned by
- the request.
- :param List[Share] shares: Collection of file shares.
- :param int total_count: The total number of resources across all pages.
- :param ShareCollectionNext 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.shares = shares
- self.total_count = total_count
+ self.more_info = more_info
@classmethod
- def from_dict(cls, _dict: Dict) -> 'ShareCollection':
- """Initialize a ShareCollection object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'ReservedIPReferenceDeleted':
+ """Initialize a ReservedIPReferenceDeleted object from a json dictionary."""
args = {}
- if 'first' in _dict:
- args['first'] = ShareCollectionFirst.from_dict(_dict.get('first'))
- else:
- raise ValueError('Required property \'first\' not present in ShareCollection JSON')
- if 'limit' in _dict:
- args['limit'] = _dict.get('limit')
- else:
- raise ValueError('Required property \'limit\' not present in ShareCollection JSON')
- if 'next' in _dict:
- args['next'] = ShareCollectionNext.from_dict(_dict.get('next'))
- if 'shares' in _dict:
- args['shares'] = [Share.from_dict(v) for v in _dict.get('shares')]
- else:
- raise ValueError('Required property \'shares\' not present in ShareCollection JSON')
- if 'total_count' in _dict:
- args['total_count'] = _dict.get('total_count')
+ if (more_info := _dict.get('more_info')) is not None:
+ args['more_info'] = more_info
else:
- raise ValueError('Required property \'total_count\' not present in ShareCollection JSON')
+ raise ValueError('Required property \'more_info\' not present in ReservedIPReferenceDeleted JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a ShareCollection object from a json dictionary."""
+ """Initialize a ReservedIPReferenceDeleted object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'first') and self.first is not None:
- if isinstance(self.first, dict):
- _dict['first'] = self.first
- else:
- _dict['first'] = self.first.to_dict()
- if hasattr(self, 'limit') and self.limit is not None:
- _dict['limit'] = self.limit
- if hasattr(self, 'next') and self.next is not None:
- if isinstance(self.next, dict):
- _dict['next'] = self.next
- else:
- _dict['next'] = self.next.to_dict()
- if hasattr(self, 'shares') and self.shares is not None:
- shares_list = []
- for v in self.shares:
- if isinstance(v, dict):
- shares_list.append(v)
- else:
- shares_list.append(v.to_dict())
- _dict['shares'] = shares_list
- if hasattr(self, 'total_count') and self.total_count is not None:
- _dict['total_count'] = self.total_count
+ if hasattr(self, 'more_info') and self.more_info is not None:
+ _dict['more_info'] = self.more_info
return _dict
def _to_dict(self):
@@ -69750,58 +72607,100 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this ShareCollection object."""
+ """Return a `str` version of this ReservedIPReferenceDeleted object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'ShareCollection') -> 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: 'ShareCollection') -> bool:
+ def __ne__(self, other: 'ReservedIPReferenceDeleted') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class ShareCollectionFirst:
+class ReservedIPTarget:
"""
- A link to the first page of resources.
+ The target this reserved IP is bound to.
+ If absent, this reserved IP is provider-owned or unbound.
- :attr str href: The URL for a page of resources.
"""
def __init__(
self,
- href: str,
) -> None:
"""
- Initialize a ShareCollectionFirst object.
+ Initialize a ReservedIPTarget object.
- :param str href: The URL for a page of resources.
"""
- self.href = href
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['ReservedIPTargetEndpointGatewayReference', 'ReservedIPTargetVirtualNetworkInterfaceReferenceReservedIPTargetContext', 'ReservedIPTargetNetworkInterfaceReferenceTargetContext', 'ReservedIPTargetBareMetalServerNetworkInterfaceReferenceTargetContext', 'ReservedIPTargetLoadBalancerReference', 'ReservedIPTargetVPNGatewayReference', 'ReservedIPTargetVPNServerReference', 'ReservedIPTargetGenericResourceReference'])
+ )
+ raise Exception(msg)
+
+
+class ReservedIPTargetPrototype:
+ """
+ The target to bind this reserved IP to. The target must be in the same VPC.
+ The following targets are supported:
+ - An endpoint gateway not already bound to a reserved IP in the subnet's zone.
+ - A virtual network interface.
+ If unspecified, the reserved IP will be created unbound.
+
+ """
+
+ def __init__(
+ self,
+ ) -> None:
+ """
+ Initialize a ReservedIPTargetPrototype object.
+
+ """
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['ReservedIPTargetPrototypeEndpointGatewayIdentity', 'ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentity'])
+ )
+ raise Exception(msg)
+
+
+class ResourceFilter:
+ """
+ Identifies one or more resources according to the specified filter property.
+
+ :param str resource_type: (optional) The resource type.
+ """
+
+ def __init__(
+ self,
+ *,
+ resource_type: Optional[str] = None,
+ ) -> None:
+ """
+ Initialize a ResourceFilter object.
+
+ :param str resource_type: (optional) The resource type.
+ """
+ self.resource_type = resource_type
@classmethod
- def from_dict(cls, _dict: Dict) -> 'ShareCollectionFirst':
- """Initialize a ShareCollectionFirst object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'ResourceFilter':
+ """Initialize a ResourceFilter object from a json dictionary."""
args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
- else:
- raise ValueError('Required property \'href\' not present in ShareCollectionFirst JSON')
+ if (resource_type := _dict.get('resource_type')) is not None:
+ args['resource_type'] = resource_type
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a ShareCollectionFirst object from a json dictionary."""
+ """Initialize a ResourceFilter object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'href') and self.href is not None:
- _dict['href'] = self.href
+ if hasattr(self, 'resource_type') and self.resource_type is not None:
+ _dict['resource_type'] = self.resource_type
return _dict
def _to_dict(self):
@@ -69809,52 +72708,87 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this ShareCollectionFirst object."""
+ """Return a `str` version of this ResourceFilter object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'ShareCollectionFirst') -> bool:
+ def __eq__(self, other: 'ResourceFilter') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'ShareCollectionFirst') -> bool:
+ def __ne__(self, other: 'ResourceFilter') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class ShareCollectionNext:
+class ResourceGroupIdentity:
"""
- A link to the next page of resources. This property is present for all pages except
- the last page.
+ The resource group to use. If unspecified, the account's [default resource
+ group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be used.
- :attr str href: The URL for a page of resources.
"""
def __init__(
self,
- href: str,
) -> None:
"""
- Initialize a ShareCollectionNext object.
+ Initialize a ResourceGroupIdentity object.
- :param str href: The URL for a page of resources.
"""
- self.href = href
-
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['ResourceGroupIdentityById'])
+ )
+ raise Exception(msg)
+
+
+class ResourceGroupReference:
+ """
+ ResourceGroupReference.
+
+ :param str href: The URL for this resource group.
+ :param str id: The unique identifier for this resource group.
+ :param str name: The name for this resource group.
+ """
+
+ 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 name for this resource group.
+ """
+ self.href = href
+ self.id = id
+ self.name = name
+
@classmethod
- def from_dict(cls, _dict: Dict) -> 'ShareCollectionNext':
- """Initialize a ShareCollectionNext object from a json dictionary."""
+ 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')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'href\' not present in ShareCollectionNext JSON')
+ raise ValueError('Required property \'href\' not present in ResourceGroupReference JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
+ else:
+ raise ValueError('Required property \'id\' not present in ResourceGroupReference JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ else:
+ raise ValueError('Required property \'name\' not present in ResourceGroupReference JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a ShareCollectionNext object from a json dictionary."""
+ """Initialize a ResourceGroupReference object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -69862,6 +72796,10 @@ def to_dict(self) -> Dict:
_dict = {}
if hasattr(self, 'href') and self.href 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):
@@ -69869,84 +72807,237 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this ShareCollectionNext object."""
+ """Return a `str` version of this ResourceGroupReference object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'ShareCollectionNext') -> 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: 'ShareCollectionNext') -> bool:
+ def __ne__(self, other: 'ResourceGroupReference') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class ShareIdentity:
- """
- Identifies a file share by a unique property.
-
- """
-
- def __init__(
- self,
- ) -> None:
- """
- Initialize a ShareIdentity object.
-
- """
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['ShareIdentityById', 'ShareIdentityByCRN', 'ShareIdentityByHref'])
- )
- raise Exception(msg)
-
-
-class ShareInitialOwner:
+class Route:
"""
- ShareInitialOwner.
+ Route.
- :attr int gid: (optional) The initial group identifier for the file share.
- :attr int uid: (optional) The initial user identifier for the file share.
+ :param str action: The action to perform with a packet matching the route:
+ - `delegate`: delegate to system-provided routes
+ - `delegate_vpc`: delegate to system-provided routes, ignoring Internet-bound
+ routes
+ - `deliver`: deliver the packet to the specified `next_hop`
+ - `drop`: drop the packet.
+ :param bool advertise: Indicates whether this route will be advertised to the
+ ingress sources specified by the `advertise_routes_to` routing table property.
+ :param datetime created_at: The date and time that the route was created.
+ :param RouteCreator creator: (optional) If present, the resource that created
+ the route. Routes with this property present cannot
+ be directly deleted. All routes with an `origin` of `service` will have this
+ property set,
+ and future `origin` values may also have this property set.
+ :param str destination: The destination CIDR of the route.
+ :param str href: The URL for this route.
+ :param str id: The unique identifier for this route.
+ :param str lifecycle_state: The lifecycle state of the route.
+ :param str name: The name for this route. The name is unique across all routes
+ in the routing table.
+ :param RouteNextHop next_hop: If `action` is `deliver`, the next hop that
+ packets will be delivered to. For
+ other `action` values, its `address` will be `0.0.0.0`.
+ :param str origin: (optional) The origin of this route:
+ - `service`: route was directly created by a service
+ - `user`: route was directly created by a user
+ The enumerated values for this property are expected to expand in the future.
+ When processing this property, check for and log unknown values. Optionally halt
+ processing and surface the error, or bypass the route on which the unexpected
+ property value was encountered.
+ :param int priority: The priority of this route. Smaller values have higher
+ priority.
+ If a routing table contains multiple routes with the same `zone` and
+ `destination`, the route with the highest priority (smallest value) is selected.
+ If two routes have the same `destination` and `priority`, traffic is distributed
+ between them.
+ :param ZoneReference zone: The zone the route applies to.
+ If subnets are attached to the route's routing table, egress traffic from those
+ subnets in this zone will be subject to this route. If this route's routing
+ table
+ has any of `route_direct_link_ingress`, `route_internet_ingress`,
+ `route_transit_gateway_ingress` or `route_vpc_zone_ingress` set to`true`,
+ traffic
+ from those ingress sources arriving in this zone will be subject to this route.
"""
def __init__(
self,
+ action: str,
+ advertise: bool,
+ created_at: datetime,
+ destination: str,
+ href: str,
+ id: str,
+ lifecycle_state: str,
+ name: str,
+ next_hop: 'RouteNextHop',
+ priority: int,
+ zone: 'ZoneReference',
*,
- gid: int = None,
- uid: int = None,
+ creator: Optional['RouteCreator'] = None,
+ origin: Optional[str] = None,
) -> None:
"""
- Initialize a ShareInitialOwner object.
+ Initialize a Route object.
- :param int gid: (optional) The initial group identifier for the file share.
- :param int uid: (optional) The initial user identifier for the file share.
+ :param str action: The action to perform with a packet matching the route:
+ - `delegate`: delegate to system-provided routes
+ - `delegate_vpc`: delegate to system-provided routes, ignoring
+ Internet-bound routes
+ - `deliver`: deliver the packet to the specified `next_hop`
+ - `drop`: drop the packet.
+ :param bool advertise: Indicates whether this route will be advertised to
+ the ingress sources specified by the `advertise_routes_to` routing table
+ property.
+ :param datetime created_at: The date and time that the route was created.
+ :param str destination: The destination CIDR of the route.
+ :param str href: The URL for this route.
+ :param str id: The unique identifier for this route.
+ :param str lifecycle_state: The lifecycle state of the route.
+ :param str name: The name for this route. The name is unique across all
+ routes in the routing table.
+ :param RouteNextHop next_hop: If `action` is `deliver`, the next hop that
+ packets will be delivered to. For
+ other `action` values, its `address` will be `0.0.0.0`.
+ :param int priority: The priority of this route. Smaller values have higher
+ priority.
+ If a routing table contains multiple routes with the same `zone` and
+ `destination`, the route with the highest priority (smallest value) is
+ selected. If two routes have the same `destination` and `priority`, traffic
+ is distributed between them.
+ :param ZoneReference zone: The zone the route applies to.
+ If subnets are attached to the route's routing table, egress traffic from
+ those
+ subnets in this zone will be subject to this route. If this route's routing
+ table
+ has any of `route_direct_link_ingress`, `route_internet_ingress`,
+ `route_transit_gateway_ingress` or `route_vpc_zone_ingress` set to`true`,
+ traffic
+ from those ingress sources arriving in this zone will be subject to this
+ route.
"""
- self.gid = gid
- self.uid = uid
+ self.action = action
+ self.advertise = advertise
+ self.created_at = created_at
+ self.creator = creator
+ self.destination = destination
+ self.href = href
+ self.id = id
+ self.lifecycle_state = lifecycle_state
+ self.name = name
+ self.next_hop = next_hop
+ self.origin = origin
+ self.priority = priority
+ self.zone = zone
@classmethod
- def from_dict(cls, _dict: Dict) -> 'ShareInitialOwner':
- """Initialize a ShareInitialOwner object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'Route':
+ """Initialize a Route object from a json dictionary."""
args = {}
- if 'gid' in _dict:
- args['gid'] = _dict.get('gid')
- if 'uid' in _dict:
- args['uid'] = _dict.get('uid')
+ if (action := _dict.get('action')) is not None:
+ args['action'] = action
+ else:
+ raise ValueError('Required property \'action\' not present in Route JSON')
+ if (advertise := _dict.get('advertise')) is not None:
+ args['advertise'] = advertise
+ else:
+ raise ValueError('Required property \'advertise\' not present in Route JSON')
+ if (created_at := _dict.get('created_at')) is not None:
+ args['created_at'] = string_to_datetime(created_at)
+ else:
+ raise ValueError('Required property \'created_at\' not present in Route JSON')
+ if (creator := _dict.get('creator')) is not None:
+ args['creator'] = creator
+ if (destination := _dict.get('destination')) is not None:
+ args['destination'] = destination
+ else:
+ raise ValueError('Required property \'destination\' not present in Route JSON')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
+ else:
+ raise ValueError('Required property \'href\' not present in Route JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
+ else:
+ raise ValueError('Required property \'id\' not present in Route JSON')
+ if (lifecycle_state := _dict.get('lifecycle_state')) is not None:
+ args['lifecycle_state'] = lifecycle_state
+ else:
+ raise ValueError('Required property \'lifecycle_state\' not present in Route JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ else:
+ raise ValueError('Required property \'name\' not present in Route JSON')
+ if (next_hop := _dict.get('next_hop')) is not None:
+ args['next_hop'] = next_hop
+ else:
+ raise ValueError('Required property \'next_hop\' not present in Route JSON')
+ if (origin := _dict.get('origin')) is not None:
+ args['origin'] = origin
+ if (priority := _dict.get('priority')) is not None:
+ args['priority'] = priority
+ else:
+ raise ValueError('Required property \'priority\' not present in Route JSON')
+ if (zone := _dict.get('zone')) is not None:
+ args['zone'] = ZoneReference.from_dict(zone)
+ else:
+ raise ValueError('Required property \'zone\' not present in Route JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a ShareInitialOwner 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, 'gid') and self.gid is not None:
- _dict['gid'] = self.gid
- if hasattr(self, 'uid') and self.uid is not None:
- _dict['uid'] = self.uid
+ if hasattr(self, 'action') and self.action is not None:
+ _dict['action'] = self.action
+ if hasattr(self, 'advertise') and self.advertise is not None:
+ _dict['advertise'] = self.advertise
+ if hasattr(self, 'created_at') and self.created_at is not None:
+ _dict['created_at'] = datetime_to_string(self.created_at)
+ if hasattr(self, 'creator') and getattr(self, 'creator') is not None:
+ if isinstance(getattr(self, 'creator'), dict):
+ _dict['creator'] = getattr(self, 'creator')
+ else:
+ _dict['creator'] = getattr(self, 'creator').to_dict()
+ if hasattr(self, 'destination') and self.destination is not None:
+ _dict['destination'] = self.destination
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
+ if hasattr(self, 'id') and self.id is not None:
+ _dict['id'] = self.id
+ if hasattr(self, 'lifecycle_state') and self.lifecycle_state is not None:
+ _dict['lifecycle_state'] = self.lifecycle_state
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ if hasattr(self, 'next_hop') and self.next_hop is not None:
+ if isinstance(self.next_hop, dict):
+ _dict['next_hop'] = self.next_hop
+ else:
+ _dict['next_hop'] = self.next_hop.to_dict()
+ if hasattr(self, 'origin') and getattr(self, 'origin') is not None:
+ _dict['origin'] = getattr(self, 'origin')
+ if hasattr(self, 'priority') and self.priority is not None:
+ _dict['priority'] = self.priority
+ if hasattr(self, 'zone') and self.zone is not None:
+ if isinstance(self.zone, dict):
+ _dict['zone'] = self.zone
+ else:
+ _dict['zone'] = self.zone.to_dict()
return _dict
def _to_dict(self):
@@ -69954,126 +73045,160 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this ShareInitialOwner object."""
+ """Return a `str` version of this Route object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'ShareInitialOwner') -> 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: 'ShareInitialOwner') -> bool:
+ def __ne__(self, other: 'Route') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
+ class ActionEnum(str, Enum):
+ """
+ The action to perform with a packet matching the route:
+ - `delegate`: delegate to system-provided routes
+ - `delegate_vpc`: delegate to system-provided routes, ignoring Internet-bound
+ routes
+ - `deliver`: deliver the packet to the specified `next_hop`
+ - `drop`: drop the packet.
+ """
+
+ DELEGATE = 'delegate'
+ DELEGATE_VPC = 'delegate_vpc'
+ DELIVER = 'deliver'
+ DROP = 'drop'
+
-class ShareJob:
+ class LifecycleStateEnum(str, Enum):
+ """
+ The lifecycle state of the route.
+ """
+
+ DELETING = 'deleting'
+ FAILED = 'failed'
+ PENDING = 'pending'
+ STABLE = 'stable'
+ SUSPENDED = 'suspended'
+ UPDATING = 'updating'
+ WAITING = 'waiting'
+
+
+ class OriginEnum(str, Enum):
+ """
+ The origin of this route:
+ - `service`: route was directly created by a service
+ - `user`: route was directly created by a user
+ The enumerated values for this property are expected to expand in the future. When
+ processing this property, check for and log unknown values. Optionally halt
+ processing and surface the error, or bypass the route on which the unexpected
+ property value was encountered.
+ """
+
+ SERVICE = 'service'
+ USER = 'user'
+
+
+
+class RouteCollection:
"""
- ShareJob.
+ RouteCollection.
- :attr str status: The status of the file share job.
- The enumerated values for this property will expand in the future. When
- processing this property, check for and log unknown values. Optionally halt
- processing and surface the error, or bypass the file share job on which the
- unexpected property value was encountered.
- * `cancelled`: This job has been cancelled.
- * `failed`: This job has failed.
- * `queued`: This job is queued.
- * `running`: This job is running.
- * `succeeded`: This job completed successfully.
- :attr List[ShareJobStatusReason] status_reasons: The reasons for the file share
- job status (if any).
- The enumerated reason code values for this property will expand in the future.
- When processing this property, check for and log unknown values. Optionally halt
- processing and surface the error, or bypass the resource on which the unexpected
- reason code was encountered.
- :attr str type: The type of the file share job.
- The enumerated values for this property will expand in the future. When
- processing this property, check for and log unknown values. Optionally halt
- processing and surface the error, or bypass the file share job on which the
- unexpected property value was encountered.
- * `replication_failover`: This is a share replication failover job.
- * `replication_init`: This is a share replication is initialization job.
- * `replication_split`: This is a share replication split job.
+ :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 RouteCollectionNext next: (optional) A link to the next page of
+ resources. This property is present for all pages
+ except the last page.
+ :param List[Route] routes: Collection of routes.
+ :param int total_count: The total number of resources across all pages.
"""
def __init__(
self,
- status: str,
- status_reasons: List['ShareJobStatusReason'],
- type: str,
+ first: 'RouteCollectionFirst',
+ limit: int,
+ routes: List['Route'],
+ total_count: int,
+ *,
+ next: Optional['RouteCollectionNext'] = None,
) -> None:
"""
- Initialize a ShareJob object.
+ Initialize a RouteCollection object.
- :param str status: The status of the file share job.
- The enumerated values for this property will expand in the future. When
- processing this property, check for and log unknown values. Optionally halt
- processing and surface the error, or bypass the file share job on which the
- unexpected property value was encountered.
- * `cancelled`: This job has been cancelled.
- * `failed`: This job has failed.
- * `queued`: This job is queued.
- * `running`: This job is running.
- * `succeeded`: This job completed successfully.
- :param List[ShareJobStatusReason] status_reasons: The reasons for the file
- share job status (if any).
- The enumerated reason code values for this property will expand in the
- future. When processing this property, check for and log unknown values.
- Optionally halt processing and surface the error, or bypass the resource on
- which the unexpected reason code was encountered.
- :param str type: The type of the file share job.
- The enumerated values for this property will expand in the future. When
- processing this property, check for and log unknown values. Optionally halt
- processing and surface the error, or bypass the file share job on which the
- unexpected property value was encountered.
- * `replication_failover`: This is a share replication failover job.
- * `replication_init`: This is a share replication is initialization job.
- * `replication_split`: This is a share replication split job.
+ :param RouteCollectionFirst first: A link to the first page of resources.
+ :param int limit: The maximum number of resources that can be returned by
+ the request.
+ :param List[Route] routes: Collection of routes.
+ :param int total_count: The total number of resources across all pages.
+ :param RouteCollectionNext next: (optional) A link to the next page of
+ resources. This property is present for all pages
+ except the last page.
"""
- self.status = status
- self.status_reasons = status_reasons
- self.type = type
+ self.first = first
+ self.limit = limit
+ self.next = next
+ self.routes = routes
+ self.total_count = total_count
@classmethod
- def from_dict(cls, _dict: Dict) -> 'ShareJob':
- """Initialize a ShareJob object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'RouteCollection':
+ """Initialize a RouteCollection object from a json dictionary."""
args = {}
- if 'status' in _dict:
- args['status'] = _dict.get('status')
+ if (first := _dict.get('first')) is not None:
+ args['first'] = RouteCollectionFirst.from_dict(first)
else:
- raise ValueError('Required property \'status\' not present in ShareJob JSON')
- if 'status_reasons' in _dict:
- args['status_reasons'] = [ShareJobStatusReason.from_dict(v) for v in _dict.get('status_reasons')]
+ raise ValueError('Required property \'first\' not present in RouteCollection JSON')
+ if (limit := _dict.get('limit')) is not None:
+ args['limit'] = limit
else:
- raise ValueError('Required property \'status_reasons\' not present in ShareJob JSON')
- if 'type' in _dict:
- args['type'] = _dict.get('type')
+ raise ValueError('Required property \'limit\' not present in RouteCollection JSON')
+ if (next := _dict.get('next')) is not None:
+ args['next'] = RouteCollectionNext.from_dict(next)
+ if (routes := _dict.get('routes')) is not None:
+ args['routes'] = [Route.from_dict(v) for v in routes]
else:
- raise ValueError('Required property \'type\' not present in ShareJob JSON')
+ raise ValueError('Required property \'routes\' not present in RouteCollection JSON')
+ if (total_count := _dict.get('total_count')) is not None:
+ args['total_count'] = 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 ShareJob object from a json dictionary."""
+ """Initialize a RouteCollection object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'status') and self.status is not None:
- _dict['status'] = self.status
- if hasattr(self, 'status_reasons') and self.status_reasons is not None:
- status_reasons_list = []
- for v in self.status_reasons:
+ if hasattr(self, 'first') and self.first is not None:
+ if isinstance(self.first, dict):
+ _dict['first'] = self.first
+ else:
+ _dict['first'] = self.first.to_dict()
+ if hasattr(self, 'limit') and self.limit is not None:
+ _dict['limit'] = self.limit
+ if hasattr(self, 'next') and self.next is not None:
+ if isinstance(self.next, dict):
+ _dict['next'] = self.next
+ else:
+ _dict['next'] = self.next.to_dict()
+ if hasattr(self, 'routes') and self.routes is not None:
+ routes_list = []
+ for v in self.routes:
if isinstance(v, dict):
- status_reasons_list.append(v)
+ routes_list.append(v)
else:
- status_reasons_list.append(v.to_dict())
- _dict['status_reasons'] = status_reasons_list
- if hasattr(self, 'type') and self.type is not None:
- _dict['type'] = self.type
+ routes_list.append(v.to_dict())
+ _dict['routes'] = routes_list
+ if hasattr(self, 'total_count') and self.total_count is not None:
+ _dict['total_count'] = self.total_count
return _dict
def _to_dict(self):
@@ -70081,117 +73206,118 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this ShareJob object."""
+ """Return a `str` version of this RouteCollection object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'ShareJob') -> 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: 'ShareJob') -> bool:
+ def __ne__(self, other: 'RouteCollection') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class StatusEnum(str, Enum):
- """
- The status of the file share job.
- The enumerated values for this property will expand in the future. When processing
- this property, check for and log unknown values. Optionally halt processing and
- surface the error, or bypass the file share job on which the unexpected property
- value was encountered.
- * `cancelled`: This job has been cancelled.
- * `failed`: This job has failed.
- * `queued`: This job is queued.
- * `running`: This job is running.
- * `succeeded`: This job completed successfully.
- """
- CANCELLED = 'cancelled'
- FAILED = 'failed'
- QUEUED = 'queued'
- RUNNING = 'running'
- SUCCEEDED = 'succeeded'
+class RouteCollectionFirst:
+ """
+ A link to the first page of resources.
+ :param str href: The URL for a page of resources.
+ """
- class TypeEnum(str, Enum):
+ def __init__(
+ self,
+ href: str,
+ ) -> None:
"""
- The type of the file share job.
- The enumerated values for this property will expand in the future. When processing
- this property, check for and log unknown values. Optionally halt processing and
- surface the error, or bypass the file share job on which the unexpected property
- value was encountered.
- * `replication_failover`: This is a share replication failover job.
- * `replication_init`: This is a share replication is initialization job.
- * `replication_split`: This is a share replication split job.
+ Initialize a RouteCollectionFirst object.
+
+ :param str href: The URL for a page of resources.
"""
+ self.href = href
- REPLICATION_FAILOVER = 'replication_failover'
- REPLICATION_INIT = 'replication_init'
- REPLICATION_SPLIT = 'replication_split'
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'RouteCollectionFirst':
+ """Initialize a RouteCollectionFirst object from a json dictionary."""
+ args = {}
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
+ else:
+ raise ValueError('Required property \'href\' not present in RouteCollectionFirst JSON')
+ return cls(**args)
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a RouteCollectionFirst object from a json dictionary."""
+ return cls.from_dict(_dict)
+ def to_dict(self) -> Dict:
+ """Return a json dictionary representing this model."""
+ _dict = {}
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
+ return _dict
-class ShareJobStatusReason:
+ def _to_dict(self):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
+
+ def __str__(self) -> str:
+ """Return a `str` version of this RouteCollectionFirst object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ 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: 'RouteCollectionFirst') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+
+class RouteCollectionNext:
"""
- ShareJobStatusReason.
+ A link to the next page of resources. This property is present for all pages except
+ the last page.
- :attr str code: A snake case string succinctly identifying the status reason.
- :attr str message: An explanation of the status reason.
- :attr str more_info: (optional) Link to documentation about this status reason.
+ :param str href: The URL for a page of resources.
"""
def __init__(
self,
- code: str,
- message: str,
- *,
- more_info: str = None,
+ href: str,
) -> None:
"""
- Initialize a ShareJobStatusReason object.
+ Initialize a RouteCollectionNext 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 href: The URL for a page of resources.
"""
- self.code = code
- self.message = message
- self.more_info = more_info
+ self.href = href
@classmethod
- def from_dict(cls, _dict: Dict) -> 'ShareJobStatusReason':
- """Initialize a ShareJobStatusReason object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'RouteCollectionNext':
+ """Initialize a RouteCollectionNext object from a json dictionary."""
args = {}
- if 'code' in _dict:
- args['code'] = _dict.get('code')
- else:
- raise ValueError('Required property \'code\' not present in ShareJobStatusReason JSON')
- if 'message' in _dict:
- args['message'] = _dict.get('message')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'message\' not present in ShareJobStatusReason JSON')
- if 'more_info' in _dict:
- args['more_info'] = _dict.get('more_info')
+ raise ValueError('Required property \'href\' not present in RouteCollectionNext JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a ShareJobStatusReason object from a json dictionary."""
+ """Initialize a RouteCollectionNext object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'code') and self.code is not None:
- _dict['code'] = self.code
- if hasattr(self, 'message') and self.message is not None:
- _dict['message'] = self.message
- if hasattr(self, 'more_info') and self.more_info is not None:
- _dict['more_info'] = self.more_info
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
return _dict
def _to_dict(self):
@@ -70199,425 +73325,91 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this ShareJobStatusReason object."""
+ """Return a `str` version of this RouteCollectionNext object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'ShareJobStatusReason') -> 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: 'ShareJobStatusReason') -> bool:
+ def __ne__(self, other: 'RouteCollectionNext') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class CodeEnum(str, Enum):
- """
- A snake case string succinctly identifying the status reason.
- """
-
- CANNOT_INITIALIZE_REPLICATION = 'cannot_initialize_replication'
- CANNOT_REACH_REPLICA_SHARE = 'cannot_reach_replica_share'
- CANNOT_REACH_SOURCE_SHARE = 'cannot_reach_source_share'
-
-
-
-class ShareMountTarget:
- """
- ShareMountTarget.
-
- :attr str access_control_mode: The access control mode for the share:
- - `security_group`: The security groups on the virtual network interface for a
- mount
- target control access to the mount target.
- - `vpc`: All clients in the VPC for a mount target have access to the mount
- target.
- The enumerated access control mode values for this property may expand in the
- future. When processing this property, check for and log unknown values.
- Optionally halt processing and surface the error, or bypass the resource on
- which the unexpected access control mode was encountered.
- :attr datetime created_at: The date and time that the share mount target was
- created.
- :attr str href: The URL for this share mount target.
- :attr str id: The unique identifier for this share mount target.
- :attr str lifecycle_state: The lifecycle state of the mount target.
- :attr str mount_path: (optional) The mount path for the share. The server
- component of the mount path may be either an IP address or a fully qualified
- domain name.
- This property will be absent if the `lifecycle_state` of the mount target is
- 'pending', `failed`, or `deleting`.
- If the share's `access_control_mode` is:
- - `security_group`: The IP address used in the mount path is the `primary_ip`
- address of the virtual network interface for this share mount target.
- - `vpc`: The fully-qualified domain name used in the mount path is an address
- that
- resolves to the share mount target.
- :attr str name: The name for this share mount target. The name is unique across
- all mount targets for the file share.
- :attr ReservedIPReference primary_ip: (optional) The primary IP address of the
- virtual network interface for the share mount target.
- Absent if `access_control_mode` is `vpc`.
- :attr str resource_type: The resource type.
- :attr SubnetReference subnet: (optional) The subnet of the virtual network
- interface for the share mount target.
- Absent if `access_control_mode` is `vpc`.
- :attr str transit_encryption: The transit encryption mode for this share mount
- target:
- - `none`: Not encrypted in transit
- - `user_managed`: Encrypted in transit using an instance identity certificate
- The enumerated values for this property will expand in the future. When
- processing this property, check for and log unknown values. Optionally halt
- processing and surface the error, or bypass the resource on which the unexpected
- property value was encountered.
- :attr VirtualNetworkInterfaceReferenceAttachmentContext
- virtual_network_interface: (optional) The virtual network interface for this
- file share mount target.
- This property will be present when the `access_control_mode` is
- `security_group`.
- :attr VPCReference vpc: If `access_control_mode` is:
- - `security_group`: The VPC for the virtual network interface for this share
- mount
- target
- - `vpc`: The VPC in which clients can mount the file share using this share
- mount target.
- """
-
- def __init__(
- self,
- access_control_mode: str,
- created_at: datetime,
- href: str,
- id: str,
- lifecycle_state: str,
- name: str,
- resource_type: str,
- transit_encryption: str,
- vpc: 'VPCReference',
- *,
- mount_path: str = None,
- primary_ip: 'ReservedIPReference' = None,
- subnet: 'SubnetReference' = None,
- virtual_network_interface: 'VirtualNetworkInterfaceReferenceAttachmentContext' = None,
- ) -> None:
- """
- Initialize a ShareMountTarget object.
-
- :param str access_control_mode: The access control mode for the share:
- - `security_group`: The security groups on the virtual network interface
- for a mount
- target control access to the mount target.
- - `vpc`: All clients in the VPC for a mount target have access to the mount
- target.
- The enumerated access control mode values for this property may expand in
- the future. When processing this property, check for and log unknown
- values. Optionally halt processing and surface the error, or bypass the
- resource on which the unexpected access control mode was encountered.
- :param datetime created_at: The date and time that the share mount target
- was created.
- :param str href: The URL for this share mount target.
- :param str id: The unique identifier for this share mount target.
- :param str lifecycle_state: The lifecycle state of the mount target.
- :param str name: The name for this share mount target. The name is unique
- across all mount targets for the file share.
- :param str resource_type: The resource type.
- :param str transit_encryption: The transit encryption mode for this share
- mount target:
- - `none`: Not encrypted in transit
- - `user_managed`: Encrypted in transit using an instance identity
- certificate
- The enumerated values for this property will expand in the future. When
- processing this property, check for and log unknown values. Optionally halt
- processing and surface the error, or bypass the resource on which the
- unexpected property value was encountered.
- :param VPCReference vpc: If `access_control_mode` is:
- - `security_group`: The VPC for the virtual network interface for this
- share mount
- target
- - `vpc`: The VPC in which clients can mount the file share using this share
- mount target.
- :param str mount_path: (optional) The mount path for the share. The server
- component of the mount path may be either an IP address or a fully
- qualified domain name.
- This property will be absent if the `lifecycle_state` of the mount target
- is
- 'pending', `failed`, or `deleting`.
- If the share's `access_control_mode` is:
- - `security_group`: The IP address used in the mount path is the
- `primary_ip`
- address of the virtual network interface for this share mount target.
- - `vpc`: The fully-qualified domain name used in the mount path is an
- address that
- resolves to the share mount target.
- :param ReservedIPReference primary_ip: (optional) The primary IP address of
- the virtual network interface for the share mount target.
- Absent if `access_control_mode` is `vpc`.
- :param SubnetReference subnet: (optional) The subnet of the virtual network
- interface for the share mount target.
- Absent if `access_control_mode` is `vpc`.
- :param VirtualNetworkInterfaceReferenceAttachmentContext
- virtual_network_interface: (optional) The virtual network interface for
- this file share mount target.
- This property will be present when the `access_control_mode` is
- `security_group`.
- """
- self.access_control_mode = access_control_mode
- self.created_at = created_at
- self.href = href
- self.id = id
- self.lifecycle_state = lifecycle_state
- self.mount_path = mount_path
- self.name = name
- self.primary_ip = primary_ip
- self.resource_type = resource_type
- self.subnet = subnet
- self.transit_encryption = transit_encryption
- self.virtual_network_interface = virtual_network_interface
- self.vpc = vpc
-
- @classmethod
- def from_dict(cls, _dict: Dict) -> 'ShareMountTarget':
- """Initialize a ShareMountTarget object from a json dictionary."""
- args = {}
- if 'access_control_mode' in _dict:
- args['access_control_mode'] = _dict.get('access_control_mode')
- else:
- raise ValueError('Required property \'access_control_mode\' not present in ShareMountTarget JSON')
- if 'created_at' in _dict:
- args['created_at'] = string_to_datetime(_dict.get('created_at'))
- else:
- raise ValueError('Required property \'created_at\' not present in ShareMountTarget JSON')
- if 'href' in _dict:
- args['href'] = _dict.get('href')
- else:
- raise ValueError('Required property \'href\' not present in ShareMountTarget JSON')
- if 'id' in _dict:
- args['id'] = _dict.get('id')
- else:
- raise ValueError('Required property \'id\' not present in ShareMountTarget JSON')
- if 'lifecycle_state' in _dict:
- args['lifecycle_state'] = _dict.get('lifecycle_state')
- else:
- raise ValueError('Required property \'lifecycle_state\' not present in ShareMountTarget JSON')
- if 'mount_path' in _dict:
- args['mount_path'] = _dict.get('mount_path')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
- else:
- raise ValueError('Required property \'name\' not present in ShareMountTarget JSON')
- if 'primary_ip' in _dict:
- args['primary_ip'] = ReservedIPReference.from_dict(_dict.get('primary_ip'))
- if 'resource_type' in _dict:
- args['resource_type'] = _dict.get('resource_type')
- else:
- raise ValueError('Required property \'resource_type\' not present in ShareMountTarget JSON')
- if 'subnet' in _dict:
- args['subnet'] = SubnetReference.from_dict(_dict.get('subnet'))
- if 'transit_encryption' in _dict:
- args['transit_encryption'] = _dict.get('transit_encryption')
- else:
- raise ValueError('Required property \'transit_encryption\' not present in ShareMountTarget JSON')
- if 'virtual_network_interface' in _dict:
- args['virtual_network_interface'] = VirtualNetworkInterfaceReferenceAttachmentContext.from_dict(_dict.get('virtual_network_interface'))
- if 'vpc' in _dict:
- args['vpc'] = VPCReference.from_dict(_dict.get('vpc'))
- else:
- raise ValueError('Required property \'vpc\' not present in ShareMountTarget JSON')
- return cls(**args)
-
- @classmethod
- def _from_dict(cls, _dict):
- """Initialize a ShareMountTarget object from a json dictionary."""
- return cls.from_dict(_dict)
-
- def to_dict(self) -> Dict:
- """Return a json dictionary representing this model."""
- _dict = {}
- if hasattr(self, 'access_control_mode') and self.access_control_mode is not None:
- _dict['access_control_mode'] = self.access_control_mode
- if hasattr(self, 'created_at') and self.created_at is not None:
- _dict['created_at'] = datetime_to_string(self.created_at)
- if hasattr(self, 'href') and self.href is not None:
- _dict['href'] = self.href
- if hasattr(self, 'id') and self.id is not None:
- _dict['id'] = self.id
- if hasattr(self, 'lifecycle_state') and self.lifecycle_state is not None:
- _dict['lifecycle_state'] = self.lifecycle_state
- if hasattr(self, 'mount_path') and self.mount_path is not None:
- _dict['mount_path'] = self.mount_path
- if hasattr(self, 'name') and self.name is not None:
- _dict['name'] = self.name
- if hasattr(self, 'primary_ip') and self.primary_ip is not None:
- if isinstance(self.primary_ip, dict):
- _dict['primary_ip'] = self.primary_ip
- else:
- _dict['primary_ip'] = self.primary_ip.to_dict()
- if hasattr(self, 'resource_type') and self.resource_type is not None:
- _dict['resource_type'] = self.resource_type
- if hasattr(self, 'subnet') and self.subnet is not None:
- if isinstance(self.subnet, dict):
- _dict['subnet'] = self.subnet
- else:
- _dict['subnet'] = self.subnet.to_dict()
- if hasattr(self, 'transit_encryption') and self.transit_encryption is not None:
- _dict['transit_encryption'] = self.transit_encryption
- if hasattr(self, 'virtual_network_interface') and self.virtual_network_interface is not None:
- if isinstance(self.virtual_network_interface, dict):
- _dict['virtual_network_interface'] = self.virtual_network_interface
- else:
- _dict['virtual_network_interface'] = self.virtual_network_interface.to_dict()
- if hasattr(self, 'vpc') and self.vpc is not None:
- if isinstance(self.vpc, dict):
- _dict['vpc'] = self.vpc
- else:
- _dict['vpc'] = self.vpc.to_dict()
- return _dict
-
- def _to_dict(self):
- """Return a json dictionary representing this model."""
- return self.to_dict()
-
- def __str__(self) -> str:
- """Return a `str` version of this ShareMountTarget object."""
- return json.dumps(self.to_dict(), indent=2)
-
- def __eq__(self, other: 'ShareMountTarget') -> bool:
- """Return `true` when self and other are equal, false otherwise."""
- if not isinstance(other, self.__class__):
- return False
- return self.__dict__ == other.__dict__
-
- def __ne__(self, other: 'ShareMountTarget') -> bool:
- """Return `true` when self and other are not equal, false otherwise."""
- return not self == other
-
- class AccessControlModeEnum(str, Enum):
- """
- The access control mode for the share:
- - `security_group`: The security groups on the virtual network interface for a
- mount
- target control access to the mount target.
- - `vpc`: All clients in the VPC for a mount target have access to the mount
- target.
- The enumerated access control mode values for this property may expand in the
- future. When processing this property, check for and log unknown values.
- Optionally halt processing and surface the error, or bypass the resource on which
- the unexpected access control mode was encountered.
- """
-
- SECURITY_GROUP = 'security_group'
- VPC = 'vpc'
-
-
- class LifecycleStateEnum(str, Enum):
- """
- The lifecycle state of the mount target.
- """
-
- DELETING = 'deleting'
- FAILED = 'failed'
- PENDING = 'pending'
- STABLE = 'stable'
- SUSPENDED = 'suspended'
- UPDATING = 'updating'
- WAITING = 'waiting'
-
-
- class ResourceTypeEnum(str, Enum):
- """
- The resource type.
- """
-
- SHARE_MOUNT_TARGET = 'share_mount_target'
-
-
- class TransitEncryptionEnum(str, Enum):
- """
- The transit encryption mode for this share mount target:
- - `none`: Not encrypted in transit
- - `user_managed`: Encrypted in transit using an instance identity certificate
- The enumerated values for this property will expand in the future. When processing
- this property, check for and log unknown values. Optionally halt processing and
- surface the error, or bypass the resource on which the unexpected property value
- was encountered.
- """
-
- NONE = 'none'
- USER_MANAGED = 'user_managed'
-
-
-class ShareMountTargetCollection:
+class RouteCollectionVPCContext:
"""
- ShareMountTargetCollection.
+ RouteCollectionVPCContext.
- :attr ShareMountTargetCollectionFirst first: A link to the first page of
+ :param RouteCollectionVPCContextFirst first: A link to the first page of
resources.
- :attr int limit: The maximum number of resources that can be returned by the
+ :param int limit: The maximum number of resources that can be returned by the
request.
- :attr List[ShareMountTarget] mount_targets: Collection of share mount targets.
- :attr ShareMountTargetCollectionNext next: (optional) A link to the next page of
+ :param RouteCollectionVPCContextNext 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.
+ :param List[RouteCollectionVPCContextRoutesItem] routes: Collection of routes.
+ :param int total_count: The total number of resources across all pages.
"""
def __init__(
self,
- first: 'ShareMountTargetCollectionFirst',
+ first: 'RouteCollectionVPCContextFirst',
limit: int,
- mount_targets: List['ShareMountTarget'],
+ routes: List['RouteCollectionVPCContextRoutesItem'],
total_count: int,
*,
- next: 'ShareMountTargetCollectionNext' = None,
+ next: Optional['RouteCollectionVPCContextNext'] = None,
) -> None:
"""
- Initialize a ShareMountTargetCollection object.
+ Initialize a RouteCollectionVPCContext object.
- :param ShareMountTargetCollectionFirst first: A link to the first page of
+ :param RouteCollectionVPCContextFirst first: A link to the first page of
resources.
:param int limit: The maximum number of resources that can be returned by
the request.
- :param List[ShareMountTarget] mount_targets: Collection of share mount
- targets.
+ :param List[RouteCollectionVPCContextRoutesItem] routes: Collection of
+ routes.
:param int total_count: The total number of resources across all pages.
- :param ShareMountTargetCollectionNext next: (optional) A link to the next
+ :param RouteCollectionVPCContextNext next: (optional) A link to the next
page of resources. This property is present for all pages
except the last page.
"""
self.first = first
self.limit = limit
- self.mount_targets = mount_targets
self.next = next
+ self.routes = routes
self.total_count = total_count
@classmethod
- def from_dict(cls, _dict: Dict) -> 'ShareMountTargetCollection':
- """Initialize a ShareMountTargetCollection object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'RouteCollectionVPCContext':
+ """Initialize a RouteCollectionVPCContext object from a json dictionary."""
args = {}
- if 'first' in _dict:
- args['first'] = ShareMountTargetCollectionFirst.from_dict(_dict.get('first'))
+ if (first := _dict.get('first')) is not None:
+ args['first'] = RouteCollectionVPCContextFirst.from_dict(first)
else:
- raise ValueError('Required property \'first\' not present in ShareMountTargetCollection JSON')
- if 'limit' in _dict:
- args['limit'] = _dict.get('limit')
+ raise ValueError('Required property \'first\' not present in RouteCollectionVPCContext JSON')
+ if (limit := _dict.get('limit')) is not None:
+ args['limit'] = limit
else:
- raise ValueError('Required property \'limit\' not present in ShareMountTargetCollection JSON')
- if 'mount_targets' in _dict:
- args['mount_targets'] = [ShareMountTarget.from_dict(v) for v in _dict.get('mount_targets')]
+ raise ValueError('Required property \'limit\' not present in RouteCollectionVPCContext JSON')
+ if (next := _dict.get('next')) is not None:
+ args['next'] = RouteCollectionVPCContextNext.from_dict(next)
+ if (routes := _dict.get('routes')) is not None:
+ args['routes'] = [RouteCollectionVPCContextRoutesItem.from_dict(v) for v in routes]
else:
- raise ValueError('Required property \'mount_targets\' not present in ShareMountTargetCollection JSON')
- if 'next' in _dict:
- args['next'] = ShareMountTargetCollectionNext.from_dict(_dict.get('next'))
- if 'total_count' in _dict:
- args['total_count'] = _dict.get('total_count')
+ raise ValueError('Required property \'routes\' not present in RouteCollectionVPCContext JSON')
+ if (total_count := _dict.get('total_count')) is not None:
+ args['total_count'] = total_count
else:
- raise ValueError('Required property \'total_count\' not present in ShareMountTargetCollection JSON')
+ raise ValueError('Required property \'total_count\' not present in RouteCollectionVPCContext JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a ShareMountTargetCollection object from a json dictionary."""
+ """Initialize a RouteCollectionVPCContext object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -70630,19 +73422,19 @@ 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, 'mount_targets') and self.mount_targets is not None:
- mount_targets_list = []
- for v in self.mount_targets:
- if isinstance(v, dict):
- mount_targets_list.append(v)
- else:
- mount_targets_list.append(v.to_dict())
- _dict['mount_targets'] = mount_targets_list
if hasattr(self, 'next') and self.next is not None:
if isinstance(self.next, dict):
_dict['next'] = self.next
else:
_dict['next'] = self.next.to_dict()
+ if hasattr(self, 'routes') and self.routes is not None:
+ routes_list = []
+ for v in self.routes:
+ if isinstance(v, dict):
+ routes_list.append(v)
+ else:
+ routes_list.append(v.to_dict())
+ _dict['routes'] = routes_list
if hasattr(self, 'total_count') and self.total_count is not None:
_dict['total_count'] = self.total_count
return _dict
@@ -70652,25 +73444,25 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this ShareMountTargetCollection object."""
+ """Return a `str` version of this RouteCollectionVPCContext object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'ShareMountTargetCollection') -> bool:
+ def __eq__(self, other: 'RouteCollectionVPCContext') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'ShareMountTargetCollection') -> bool:
+ def __ne__(self, other: 'RouteCollectionVPCContext') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class ShareMountTargetCollectionFirst:
+class RouteCollectionVPCContextFirst:
"""
A link to the first page of resources.
- :attr str href: The URL for a page of resources.
+ :param str href: The URL for a page of resources.
"""
def __init__(
@@ -70678,25 +73470,25 @@ def __init__(
href: str,
) -> None:
"""
- Initialize a ShareMountTargetCollectionFirst object.
+ Initialize a RouteCollectionVPCContextFirst object.
:param str href: The URL for a page of resources.
"""
self.href = href
@classmethod
- def from_dict(cls, _dict: Dict) -> 'ShareMountTargetCollectionFirst':
- """Initialize a ShareMountTargetCollectionFirst object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'RouteCollectionVPCContextFirst':
+ """Initialize a RouteCollectionVPCContextFirst object from a json dictionary."""
args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'href\' not present in ShareMountTargetCollectionFirst JSON')
+ raise ValueError('Required property \'href\' not present in RouteCollectionVPCContextFirst JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a ShareMountTargetCollectionFirst object from a json dictionary."""
+ """Initialize a RouteCollectionVPCContextFirst object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -70711,26 +73503,26 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this ShareMountTargetCollectionFirst object."""
+ """Return a `str` version of this RouteCollectionVPCContextFirst object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'ShareMountTargetCollectionFirst') -> bool:
+ def __eq__(self, other: 'RouteCollectionVPCContextFirst') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'ShareMountTargetCollectionFirst') -> bool:
+ def __ne__(self, other: 'RouteCollectionVPCContextFirst') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class ShareMountTargetCollectionNext:
+class RouteCollectionVPCContextNext:
"""
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.
+ :param str href: The URL for a page of resources.
"""
def __init__(
@@ -70738,25 +73530,25 @@ def __init__(
href: str,
) -> None:
"""
- Initialize a ShareMountTargetCollectionNext object.
+ Initialize a RouteCollectionVPCContextNext object.
:param str href: The URL for a page of resources.
"""
self.href = href
@classmethod
- def from_dict(cls, _dict: Dict) -> 'ShareMountTargetCollectionNext':
- """Initialize a ShareMountTargetCollectionNext object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'RouteCollectionVPCContextNext':
+ """Initialize a RouteCollectionVPCContextNext object from a json dictionary."""
args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'href\' not present in ShareMountTargetCollectionNext JSON')
+ raise ValueError('Required property \'href\' not present in RouteCollectionVPCContextNext JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a ShareMountTargetCollectionNext object from a json dictionary."""
+ """Initialize a RouteCollectionVPCContextNext object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -70771,219 +73563,472 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this ShareMountTargetCollectionNext object."""
+ """Return a `str` version of this RouteCollectionVPCContextNext object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'ShareMountTargetCollectionNext') -> bool:
+ def __eq__(self, other: 'RouteCollectionVPCContextNext') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'ShareMountTargetCollectionNext') -> bool:
+ def __ne__(self, other: 'RouteCollectionVPCContextNext') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class ShareMountTargetPatch:
+class RouteCollectionVPCContextRoutesItem:
"""
- ShareMountTargetPatch.
+ RouteCollectionVPCContextRoutesItem.
- :attr str name: (optional) The name for this share mount target. The name must
- not be used by another mount target for the file share.
+ :param str action: The action to perform with a packet matching the route:
+ - `delegate`: delegate to system-provided routes
+ - `delegate_vpc`: delegate to system-provided routes, ignoring Internet-bound
+ routes
+ - `deliver`: deliver the packet to the specified `next_hop`
+ - `drop`: drop the packet.
+ :param bool advertise: Indicates whether this route will be advertised to the
+ ingress sources specified by the `advertise_routes_to` routing table property.
+ :param datetime created_at: The date and time that the route was created.
+ :param RouteCreator creator: (optional) If present, the resource that created
+ the route. Routes with this property present cannot
+ be directly deleted. All routes with an `origin` of `service` will have this
+ property set,
+ and future `origin` values may also have this property set.
+ :param str destination: The destination CIDR of the route.
+ :param str href: The URL for this route.
+ :param str id: The unique identifier for this route.
+ :param str lifecycle_state: The lifecycle state of the route.
+ :param str name: The name for this route. The name is unique across all routes
+ in the routing table.
+ :param RouteNextHop next_hop: If `action` is `deliver`, the next hop that
+ packets will be delivered to. For
+ other `action` values, its `address` will be `0.0.0.0`.
+ :param str origin: (optional) The origin of this route:
+ - `service`: route was directly created by a service
+ - `user`: route was directly created by a user
+ The enumerated values for this property are expected to expand in the future.
+ When processing this property, check for and log unknown values. Optionally halt
+ processing and surface the error, or bypass the route on which the unexpected
+ property value was encountered.
+ :param int priority: The priority of this route. Smaller values have higher
+ priority.
+ If a routing table contains multiple routes with the same `zone` and
+ `destination`, the route with the highest priority (smallest value) is selected.
+ If two routes have the same `destination` and `priority`, traffic is distributed
+ between them.
+ :param ZoneReference zone: The zone the route applies to.
+ If subnets are attached to the route's routing table, egress traffic from those
+ subnets in this zone will be subject to this route. If this route's routing
+ table
+ has any of `route_direct_link_ingress`, `route_internet_ingress`,
+ `route_transit_gateway_ingress` or `route_vpc_zone_ingress` set to`true`,
+ traffic
+ from those ingress sources arriving in this zone will be subject to this route.
"""
def __init__(
self,
+ action: str,
+ advertise: bool,
+ created_at: datetime,
+ destination: str,
+ href: str,
+ id: str,
+ lifecycle_state: str,
+ name: str,
+ next_hop: 'RouteNextHop',
+ priority: int,
+ zone: 'ZoneReference',
*,
- name: str = None,
+ creator: Optional['RouteCreator'] = None,
+ origin: Optional[str] = None,
) -> None:
"""
- Initialize a ShareMountTargetPatch object.
+ Initialize a RouteCollectionVPCContextRoutesItem object.
- :param str name: (optional) The name for this share mount target. The name
- must not be used by another mount target for the file share.
+ :param str action: The action to perform with a packet matching the route:
+ - `delegate`: delegate to system-provided routes
+ - `delegate_vpc`: delegate to system-provided routes, ignoring
+ Internet-bound routes
+ - `deliver`: deliver the packet to the specified `next_hop`
+ - `drop`: drop the packet.
+ :param bool advertise: Indicates whether this route will be advertised to
+ the ingress sources specified by the `advertise_routes_to` routing table
+ property.
+ :param datetime created_at: The date and time that the route was created.
+ :param str destination: The destination CIDR of the route.
+ :param str href: The URL for this route.
+ :param str id: The unique identifier for this route.
+ :param str lifecycle_state: The lifecycle state of the route.
+ :param str name: The name for this route. The name is unique across all
+ routes in the routing table.
+ :param RouteNextHop next_hop: If `action` is `deliver`, the next hop that
+ packets will be delivered to. For
+ other `action` values, its `address` will be `0.0.0.0`.
+ :param int priority: The priority of this route. Smaller values have higher
+ priority.
+ If a routing table contains multiple routes with the same `zone` and
+ `destination`, the route with the highest priority (smallest value) is
+ selected. If two routes have the same `destination` and `priority`, traffic
+ is distributed between them.
+ :param ZoneReference zone: The zone the route applies to.
+ If subnets are attached to the route's routing table, egress traffic from
+ those
+ subnets in this zone will be subject to this route. If this route's routing
+ table
+ has any of `route_direct_link_ingress`, `route_internet_ingress`,
+ `route_transit_gateway_ingress` or `route_vpc_zone_ingress` set to`true`,
+ traffic
+ from those ingress sources arriving in this zone will be subject to this
+ route.
"""
+ self.action = action
+ self.advertise = advertise
+ self.created_at = created_at
+ self.creator = creator
+ self.destination = destination
+ self.href = href
+ self.id = id
+ self.lifecycle_state = lifecycle_state
self.name = name
+ self.next_hop = next_hop
+ self.origin = origin
+ self.priority = priority
+ self.zone = zone
@classmethod
- def from_dict(cls, _dict: Dict) -> 'ShareMountTargetPatch':
- """Initialize a ShareMountTargetPatch object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'RouteCollectionVPCContextRoutesItem':
+ """Initialize a RouteCollectionVPCContextRoutesItem object from a json dictionary."""
args = {}
- if 'name' in _dict:
- args['name'] = _dict.get('name')
+ if (action := _dict.get('action')) is not None:
+ args['action'] = action
+ else:
+ raise ValueError('Required property \'action\' not present in RouteCollectionVPCContextRoutesItem JSON')
+ if (advertise := _dict.get('advertise')) is not None:
+ args['advertise'] = advertise
+ else:
+ raise ValueError('Required property \'advertise\' not present in RouteCollectionVPCContextRoutesItem JSON')
+ if (created_at := _dict.get('created_at')) is not None:
+ args['created_at'] = string_to_datetime(created_at)
+ else:
+ raise ValueError('Required property \'created_at\' not present in RouteCollectionVPCContextRoutesItem JSON')
+ if (creator := _dict.get('creator')) is not None:
+ args['creator'] = creator
+ if (destination := _dict.get('destination')) is not None:
+ args['destination'] = destination
+ else:
+ raise ValueError('Required property \'destination\' not present in RouteCollectionVPCContextRoutesItem JSON')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
+ else:
+ raise ValueError('Required property \'href\' not present in RouteCollectionVPCContextRoutesItem JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
+ else:
+ raise ValueError('Required property \'id\' not present in RouteCollectionVPCContextRoutesItem JSON')
+ if (lifecycle_state := _dict.get('lifecycle_state')) is not None:
+ args['lifecycle_state'] = lifecycle_state
+ else:
+ raise ValueError('Required property \'lifecycle_state\' not present in RouteCollectionVPCContextRoutesItem JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ else:
+ raise ValueError('Required property \'name\' not present in RouteCollectionVPCContextRoutesItem JSON')
+ if (next_hop := _dict.get('next_hop')) is not None:
+ args['next_hop'] = next_hop
+ else:
+ raise ValueError('Required property \'next_hop\' not present in RouteCollectionVPCContextRoutesItem JSON')
+ if (origin := _dict.get('origin')) is not None:
+ args['origin'] = origin
+ if (priority := _dict.get('priority')) is not None:
+ args['priority'] = priority
+ else:
+ raise ValueError('Required property \'priority\' not present in RouteCollectionVPCContextRoutesItem JSON')
+ if (zone := _dict.get('zone')) is not None:
+ args['zone'] = ZoneReference.from_dict(zone)
+ else:
+ raise ValueError('Required property \'zone\' not present in RouteCollectionVPCContextRoutesItem JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a ShareMountTargetPatch object from a json dictionary."""
+ """Initialize a RouteCollectionVPCContextRoutesItem object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
+ if hasattr(self, 'action') and self.action is not None:
+ _dict['action'] = self.action
+ if hasattr(self, 'advertise') and self.advertise is not None:
+ _dict['advertise'] = self.advertise
+ if hasattr(self, 'created_at') and self.created_at is not None:
+ _dict['created_at'] = datetime_to_string(self.created_at)
+ if hasattr(self, 'creator') and getattr(self, 'creator') is not None:
+ if isinstance(getattr(self, 'creator'), dict):
+ _dict['creator'] = getattr(self, 'creator')
+ else:
+ _dict['creator'] = getattr(self, 'creator').to_dict()
+ if hasattr(self, 'destination') and self.destination is not None:
+ _dict['destination'] = self.destination
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
+ if hasattr(self, 'id') and self.id is not None:
+ _dict['id'] = self.id
+ if hasattr(self, 'lifecycle_state') and self.lifecycle_state is not None:
+ _dict['lifecycle_state'] = self.lifecycle_state
if hasattr(self, 'name') and self.name is not None:
_dict['name'] = self.name
- return _dict
-
- def _to_dict(self):
- """Return a json dictionary representing this model."""
- return self.to_dict()
-
- def __str__(self) -> str:
- """Return a `str` version of this ShareMountTargetPatch object."""
- return json.dumps(self.to_dict(), indent=2)
-
- def __eq__(self, other: 'ShareMountTargetPatch') -> bool:
- """Return `true` when self and other are equal, false otherwise."""
+ if hasattr(self, 'next_hop') and self.next_hop is not None:
+ if isinstance(self.next_hop, dict):
+ _dict['next_hop'] = self.next_hop
+ else:
+ _dict['next_hop'] = self.next_hop.to_dict()
+ if hasattr(self, 'origin') and getattr(self, 'origin') is not None:
+ _dict['origin'] = getattr(self, 'origin')
+ if hasattr(self, 'priority') and self.priority is not None:
+ _dict['priority'] = self.priority
+ if hasattr(self, 'zone') and self.zone is not None:
+ if isinstance(self.zone, dict):
+ _dict['zone'] = self.zone
+ else:
+ _dict['zone'] = self.zone.to_dict()
+ return _dict
+
+ def _to_dict(self):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
+
+ def __str__(self) -> str:
+ """Return a `str` version of this RouteCollectionVPCContextRoutesItem object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'RouteCollectionVPCContextRoutesItem') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'ShareMountTargetPatch') -> bool:
+ def __ne__(self, other: 'RouteCollectionVPCContextRoutesItem') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
+ class ActionEnum(str, Enum):
+ """
+ The action to perform with a packet matching the route:
+ - `delegate`: delegate to system-provided routes
+ - `delegate_vpc`: delegate to system-provided routes, ignoring Internet-bound
+ routes
+ - `deliver`: deliver the packet to the specified `next_hop`
+ - `drop`: drop the packet.
+ """
+
+ DELEGATE = 'delegate'
+ DELEGATE_VPC = 'delegate_vpc'
+ DELIVER = 'deliver'
+ DROP = 'drop'
+
-class ShareMountTargetPrototype:
+ class LifecycleStateEnum(str, Enum):
+ """
+ The lifecycle state of the route.
+ """
+
+ DELETING = 'deleting'
+ FAILED = 'failed'
+ PENDING = 'pending'
+ STABLE = 'stable'
+ SUSPENDED = 'suspended'
+ UPDATING = 'updating'
+ WAITING = 'waiting'
+
+
+ class OriginEnum(str, Enum):
+ """
+ The origin of this route:
+ - `service`: route was directly created by a service
+ - `user`: route was directly created by a user
+ The enumerated values for this property are expected to expand in the future. When
+ processing this property, check for and log unknown values. Optionally halt
+ processing and surface the error, or bypass the route on which the unexpected
+ property value was encountered.
+ """
+
+ SERVICE = 'service'
+ USER = 'user'
+
+
+
+class RouteCreator:
"""
- ShareMountTargetPrototype.
+ If present, the resource that created the route. Routes with this property present
+ cannot be directly deleted. All routes with an `origin` of `service` will have this
+ property set, and future `origin` values may also have this property set.
- :attr str name: (optional) The name for this share mount target. The name must
- not be used by another mount target for the file share.
- :attr str transit_encryption: (optional) The transit encryption mode to use for
- this share mount target:
- - `none`: Not encrypted in transit.
- - `user_managed`: Encrypted in transit using an instance identity certificate.
- The
- `access_control_mode` for the share must be `security_group`.
"""
def __init__(
self,
- *,
- name: str = None,
- transit_encryption: str = None,
) -> None:
"""
- Initialize a ShareMountTargetPrototype object.
+ Initialize a RouteCreator object.
- :param str name: (optional) The name for this share mount target. The name
- must not be used by another mount target for the file share.
- :param str transit_encryption: (optional) The transit encryption mode to
- use for this share mount target:
- - `none`: Not encrypted in transit.
- - `user_managed`: Encrypted in transit using an instance identity
- certificate. The
- `access_control_mode` for the share must be
- `security_group`.
"""
msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup', 'ShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC'])
+ ", ".join(['RouteCreatorVPNGatewayReference', 'RouteCreatorVPNServerReference'])
)
raise Exception(msg)
- class TransitEncryptionEnum(str, Enum):
+
+class RouteNextHop:
+ """
+ RouteNextHop.
+
+ """
+
+ def __init__(
+ self,
+ ) -> None:
"""
- The transit encryption mode to use for this share mount target:
- - `none`: Not encrypted in transit.
- - `user_managed`: Encrypted in transit using an instance identity certificate.
- The
- `access_control_mode` for the share must be `security_group`.
+ Initialize a RouteNextHop object.
+
"""
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['RouteNextHopIP', 'RouteNextHopVPNGatewayConnectionReference'])
+ )
+ raise Exception(msg)
- NONE = 'none'
- USER_MANAGED = 'user_managed'
+class RouteNextHopPatch:
+ """
+ If `action` is `deliver`, the next hop that packets will be delivered to. For other
+ `action` values, specify `0.0.0.0` or remove it by specifying `null`.
+ At most two routes per `zone` in a table can have the same `destination` and
+ `priority`, and only when each route has an `action` of `deliver` and `next_hop` is an
+ IP address.
+
+ """
+ def __init__(
+ self,
+ ) -> None:
+ """
+ Initialize a RouteNextHopPatch object.
-class ShareMountTargetReference:
+ """
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['RouteNextHopPatchRouteNextHopIP', 'RouteNextHopPatchVPNGatewayConnectionIdentity'])
+ )
+ raise Exception(msg)
+
+
+class RoutePatch:
"""
- ShareMountTargetReference.
+ RoutePatch.
- :attr ShareMountTargetReferenceDeleted deleted: (optional) If present, this
- property indicates the referenced resource has been deleted, and provides
- some supplementary information.
- :attr str href: The URL for this share mount target.
- :attr str id: The unique identifier for this share mount target.
- :attr str name: The name for this share mount target. The name is unique across
- all mount targets for the file share.
- :attr str resource_type: The resource type.
+ :param bool advertise: (optional) Indicates whether this route will be
+ advertised to the ingress sources specified by the `advertise_routes_to` routing
+ table property.
+ Since all routes in a routing table with the same `destination` and `zone` must
+ have the same `advertise` value, this property can only be changed for routes
+ with a unique
+ `destination` and `zone` in the routing table. For more information, see
+ [Advertising
+ routes](https://cloud.ibm.com/docs/vpc?topic=vpc-about-custom-routes#rt-advertising-routes).
+ :param str name: (optional) The name for this route. The name must not be used
+ by another route in the routing table. Names starting with `ibm-` are reserved
+ for system-provided routes, and are not allowed.
+ :param RouteNextHopPatch next_hop: (optional) If `action` is `deliver`, the next
+ hop that packets will be delivered to. For other
+ `action` values, specify `0.0.0.0` or remove it by specifying `null`.
+ At most two routes per `zone` in a table can have the same `destination` and
+ `priority`,
+ and only when each route has an `action` of `deliver` and `next_hop` is an IP
+ address.
+ :param int priority: (optional) The priority of this route. Smaller values have
+ higher priority.
+ If a routing table contains multiple routes with the same `zone` and
+ `destination`, the route with the highest priority (smallest value) is selected.
+ If two routes have the same `destination` and `priority`, traffic is distributed
+ between them.
"""
def __init__(
self,
- href: str,
- id: str,
- name: str,
- resource_type: str,
*,
- deleted: 'ShareMountTargetReferenceDeleted' = None,
+ advertise: Optional[bool] = None,
+ name: Optional[str] = None,
+ next_hop: Optional['RouteNextHopPatch'] = None,
+ priority: Optional[int] = None,
) -> None:
"""
- Initialize a ShareMountTargetReference object.
+ Initialize a RoutePatch object.
- :param str href: The URL for this share mount target.
- :param str id: The unique identifier for this share mount target.
- :param str name: The name for this share mount target. The name is unique
- across all mount targets for the file share.
- :param str resource_type: The resource type.
- :param ShareMountTargetReferenceDeleted deleted: (optional) If present,
- this property indicates the referenced resource has been deleted, and
- provides
- some supplementary information.
+ :param bool advertise: (optional) Indicates whether this route will be
+ advertised to the ingress sources specified by the `advertise_routes_to`
+ routing table property.
+ Since all routes in a routing table with the same `destination` and `zone`
+ must have the same `advertise` value, this property can only be changed for
+ routes with a unique
+ `destination` and `zone` in the routing table. For more information, see
+ [Advertising
+ routes](https://cloud.ibm.com/docs/vpc?topic=vpc-about-custom-routes#rt-advertising-routes).
+ :param str name: (optional) The name for this route. The name must not be
+ used by another route in the routing table. Names starting with `ibm-` are
+ reserved for system-provided routes, and are not allowed.
+ :param RouteNextHopPatch next_hop: (optional) If `action` is `deliver`, the
+ next hop that packets will be delivered to. For other
+ `action` values, specify `0.0.0.0` or remove it by specifying `null`.
+ At most two routes per `zone` in a table can have the same `destination`
+ and `priority`,
+ and only when each route has an `action` of `deliver` and `next_hop` is an
+ IP address.
+ :param int priority: (optional) The priority of this route. Smaller values
+ have higher priority.
+ If a routing table contains multiple routes with the same `zone` and
+ `destination`, the route with the highest priority (smallest value) is
+ selected. If two routes have the same `destination` and `priority`, traffic
+ is distributed between them.
"""
- self.deleted = deleted
- self.href = href
- self.id = id
+ self.advertise = advertise
self.name = name
- self.resource_type = resource_type
+ self.next_hop = next_hop
+ self.priority = priority
@classmethod
- def from_dict(cls, _dict: Dict) -> 'ShareMountTargetReference':
- """Initialize a ShareMountTargetReference object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'RoutePatch':
+ """Initialize a RoutePatch object from a json dictionary."""
args = {}
- if 'deleted' in _dict:
- args['deleted'] = ShareMountTargetReferenceDeleted.from_dict(_dict.get('deleted'))
- if 'href' in _dict:
- args['href'] = _dict.get('href')
- else:
- raise ValueError('Required property \'href\' not present in ShareMountTargetReference JSON')
- if 'id' in _dict:
- args['id'] = _dict.get('id')
- else:
- raise ValueError('Required property \'id\' not present in ShareMountTargetReference JSON')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
- else:
- raise ValueError('Required property \'name\' not present in ShareMountTargetReference JSON')
- if 'resource_type' in _dict:
- args['resource_type'] = _dict.get('resource_type')
- else:
- raise ValueError('Required property \'resource_type\' not present in ShareMountTargetReference JSON')
+ if (advertise := _dict.get('advertise')) is not None:
+ args['advertise'] = advertise
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ if (next_hop := _dict.get('next_hop')) is not None:
+ args['next_hop'] = next_hop
+ if (priority := _dict.get('priority')) is not None:
+ args['priority'] = priority
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a ShareMountTargetReference object from a json dictionary."""
+ """Initialize a RoutePatch object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'deleted') and self.deleted is not None:
- if isinstance(self.deleted, dict):
- _dict['deleted'] = self.deleted
- else:
- _dict['deleted'] = self.deleted.to_dict()
- if hasattr(self, 'href') and self.href is not None:
- _dict['href'] = self.href
- if hasattr(self, 'id') and self.id is not None:
- _dict['id'] = self.id
+ if hasattr(self, 'advertise') and self.advertise is not None:
+ _dict['advertise'] = self.advertise
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, 'next_hop') and self.next_hop is not None:
+ if isinstance(self.next_hop, dict):
+ _dict['next_hop'] = self.next_hop
+ else:
+ _dict['next_hop'] = self.next_hop.to_dict()
+ if hasattr(self, 'priority') and self.priority is not None:
+ _dict['priority'] = self.priority
return _dict
def _to_dict(self):
@@ -70991,67 +74036,190 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this ShareMountTargetReference object."""
+ """Return a `str` version of this RoutePatch object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'ShareMountTargetReference') -> bool:
+ def __eq__(self, other: 'RoutePatch') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'ShareMountTargetReference') -> bool:
+ def __ne__(self, other: 'RoutePatch') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class ResourceTypeEnum(str, Enum):
- """
- The resource type.
- """
-
- SHARE_MOUNT_TARGET = 'share_mount_target'
-
-
-class ShareMountTargetReferenceDeleted:
+class RoutePrototype:
"""
- If present, this property indicates the referenced resource has been deleted, and
- provides some supplementary information.
+ RoutePrototype.
- :attr str more_info: Link to documentation about deleted resources.
+ :param str action: (optional) The action to perform with a packet matching the
+ route:
+ - `delegate`: delegate to system-provided routes
+ - `delegate_vpc`: delegate to system-provided routes, ignoring Internet-bound
+ routes
+ - `deliver`: deliver the packet to the specified `next_hop`
+ - `drop`: drop the packet.
+ :param bool advertise: (optional) Indicates whether this route will be
+ advertised to the ingress sources specified by the `advertise_routes_to` routing
+ table property.
+ All routes in a routing table with the same `destination` and `zone` must have
+ the same
+ `advertise` value.
+ :param str destination: The destination CIDR of the route. The host identifier
+ in the CIDR must be zero.
+ At most two routes per `zone` in a table can have the same `destination` and
+ `priority`, and only if both routes have an `action` of `deliver` and the
+ `next_hop` is an IP address.
+ :param str name: (optional) The name for this route. The name must not be used
+ by another route in the routing table. Names starting with `ibm-` are reserved
+ for system-provided routes, and are not allowed. If unspecified, the name will
+ be a hyphenated list of randomly-selected words.
+ :param RoutePrototypeNextHop next_hop: (optional) If `action` is `deliver`, the
+ next hop that packets will be delivered to. For other
+ `action` values, it must be omitted or specified as `0.0.0.0`.
+ At most two routes per `zone` in a table can have the same `destination` and
+ `priority`,
+ and only when each route has an `action` of `deliver` and `next_hop` is an IP
+ address.
+ :param int priority: (optional) The priority of this route. Smaller values have
+ higher priority.
+ If a routing table contains multiple routes with the same `zone` and
+ `destination`, the route with the highest priority (smallest value) is selected.
+ If two routes have the same `destination` and `priority`, traffic is distributed
+ between them.
+ :param ZoneIdentity zone: The zone to apply the route to.
+ If subnets are attached to the route's routing table, egress traffic from those
+ subnets in this zone will be subject to this route. If this route's routing
+ table
+ has any of `route_direct_link_ingress`, `route_internet_ingress`,
+ `route_transit_gateway_ingress` or `route_vpc_zone_ingress` set to`true`,
+ traffic
+ from those ingress sources arriving in this zone will be subject to this route.
"""
def __init__(
self,
- more_info: str,
+ destination: str,
+ zone: 'ZoneIdentity',
+ *,
+ action: Optional[str] = None,
+ advertise: Optional[bool] = None,
+ name: Optional[str] = None,
+ next_hop: Optional['RoutePrototypeNextHop'] = None,
+ priority: Optional[int] = None,
) -> None:
"""
- Initialize a ShareMountTargetReferenceDeleted object.
+ Initialize a RoutePrototype object.
- :param str more_info: Link to documentation about deleted resources.
+ :param str destination: The destination CIDR of the route. The host
+ identifier in the CIDR must be zero.
+ At most two routes per `zone` in a table can have the same `destination`
+ and
+ `priority`, and only if both routes have an `action` of `deliver` and the
+ `next_hop` is an IP address.
+ :param ZoneIdentity zone: The zone to apply the route to.
+ If subnets are attached to the route's routing table, egress traffic from
+ those
+ subnets in this zone will be subject to this route. If this route's routing
+ table
+ has any of `route_direct_link_ingress`, `route_internet_ingress`,
+ `route_transit_gateway_ingress` or `route_vpc_zone_ingress` set to`true`,
+ traffic
+ from those ingress sources arriving in this zone will be subject to this
+ route.
+ :param str action: (optional) The action to perform with a packet matching
+ the route:
+ - `delegate`: delegate to system-provided routes
+ - `delegate_vpc`: delegate to system-provided routes, ignoring
+ Internet-bound routes
+ - `deliver`: deliver the packet to the specified `next_hop`
+ - `drop`: drop the packet.
+ :param bool advertise: (optional) Indicates whether this route will be
+ advertised to the ingress sources specified by the `advertise_routes_to`
+ routing table property.
+ All routes in a routing table with the same `destination` and `zone` must
+ have the same
+ `advertise` value.
+ :param str name: (optional) The name for this route. The name must not be
+ used by another route in the routing table. Names starting with `ibm-` are
+ reserved for system-provided routes, and are not allowed. If unspecified,
+ the name will be a hyphenated list of randomly-selected words.
+ :param RoutePrototypeNextHop next_hop: (optional) If `action` is `deliver`,
+ the next hop that packets will be delivered to. For other
+ `action` values, it must be omitted or specified as `0.0.0.0`.
+ At most two routes per `zone` in a table can have the same `destination`
+ and `priority`,
+ and only when each route has an `action` of `deliver` and `next_hop` is an
+ IP address.
+ :param int priority: (optional) The priority of this route. Smaller values
+ have higher priority.
+ If a routing table contains multiple routes with the same `zone` and
+ `destination`, the route with the highest priority (smallest value) is
+ selected. If two routes have the same `destination` and `priority`, traffic
+ is distributed between them.
"""
- self.more_info = more_info
+ self.action = action
+ self.advertise = advertise
+ self.destination = destination
+ self.name = name
+ self.next_hop = next_hop
+ self.priority = priority
+ self.zone = zone
@classmethod
- def from_dict(cls, _dict: Dict) -> 'ShareMountTargetReferenceDeleted':
- """Initialize a ShareMountTargetReferenceDeleted object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'RoutePrototype':
+ """Initialize a RoutePrototype object from a json dictionary."""
args = {}
- if 'more_info' in _dict:
- args['more_info'] = _dict.get('more_info')
+ if (action := _dict.get('action')) is not None:
+ args['action'] = action
+ if (advertise := _dict.get('advertise')) is not None:
+ args['advertise'] = advertise
+ if (destination := _dict.get('destination')) is not None:
+ args['destination'] = destination
else:
- raise ValueError('Required property \'more_info\' not present in ShareMountTargetReferenceDeleted JSON')
+ raise ValueError('Required property \'destination\' not present in RoutePrototype JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ if (next_hop := _dict.get('next_hop')) is not None:
+ args['next_hop'] = next_hop
+ if (priority := _dict.get('priority')) is not None:
+ args['priority'] = priority
+ if (zone := _dict.get('zone')) is not None:
+ args['zone'] = zone
+ else:
+ raise ValueError('Required property \'zone\' not present in RoutePrototype JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a ShareMountTargetReferenceDeleted object from a json dictionary."""
+ """Initialize a RoutePrototype object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, '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, 'advertise') and self.advertise is not None:
+ _dict['advertise'] = self.advertise
+ 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, 'priority') and self.priority is not None:
+ _dict['priority'] = self.priority
+ if hasattr(self, 'zone') and self.zone is not None:
+ if isinstance(self.zone, dict):
+ _dict['zone'] = self.zone
+ else:
+ _dict['zone'] = self.zone.to_dict()
return _dict
def _to_dict(self):
@@ -71059,23 +74227,43 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this ShareMountTargetReferenceDeleted object."""
+ """Return a `str` version of this RoutePrototype object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'ShareMountTargetReferenceDeleted') -> bool:
+ def __eq__(self, other: 'RoutePrototype') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'ShareMountTargetReferenceDeleted') -> bool:
+ def __ne__(self, other: 'RoutePrototype') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
+ class ActionEnum(str, Enum):
+ """
+ The action to perform with a packet matching the route:
+ - `delegate`: delegate to system-provided routes
+ - `delegate_vpc`: delegate to system-provided routes, ignoring Internet-bound
+ routes
+ - `deliver`: deliver the packet to the specified `next_hop`
+ - `drop`: drop the packet.
+ """
-class ShareMountTargetVirtualNetworkInterfacePrototype:
+ DELEGATE = 'delegate'
+ DELEGATE_VPC = 'delegate_vpc'
+ DELIVER = 'deliver'
+ DROP = 'drop'
+
+
+
+class RoutePrototypeNextHop:
"""
- ShareMountTargetVirtualNetworkInterfacePrototype.
+ If `action` is `deliver`, the next hop that packets will be delivered to. For other
+ `action` values, it must be omitted or specified as `0.0.0.0`.
+ At most two routes per `zone` in a table can have the same `destination` and
+ `priority`, and only when each route has an `action` of `deliver` and `next_hop` is an
+ IP address.
"""
@@ -71083,144 +74271,91 @@ def __init__(
self,
) -> None:
"""
- Initialize a ShareMountTargetVirtualNetworkInterfacePrototype object.
+ Initialize a RoutePrototypeNextHop object.
"""
msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfacePrototypeShareMountTargetContext'])
+ ", ".join(['RoutePrototypeNextHopRouteNextHopPrototypeRouteNextHopIP', 'RoutePrototypeNextHopRouteNextHopPrototypeVPNGatewayConnectionIdentity'])
)
raise Exception(msg)
-class SharePatch:
+class RouteReference:
"""
- SharePatch.
+ RouteReference.
- :attr str access_control_mode: (optional) The access control mode for the share:
- - `security_group`: The security groups on the virtual network interface for a
- mount target control access to the mount target.
- - `vpc`: All clients in the VPC for a mount target have access to the mount
- target.
- For this property to be changed, the share must have no mount targets and
- `replication_role` must be `none`.
- :attr int iops: (optional) The maximum input/output operations per second (IOPS)
- for the file share. The value must be in the range supported by the share's
- size.
- For this property to be changed, the share `lifecycle_state` must be `stable`.
- :attr str name: (optional) The name for this share. The name must not be used by
- another share in the region.
- :attr ShareProfileIdentity profile: (optional) The profile to use for this file
- share.
- The requested profile must be in the same `family`.
- :attr str replication_cron_spec: (optional) The cron specification for the file
- share replication schedule.
- Replication of a share can be scheduled to occur at most once per hour.
- For this property to be changed, the share `replication_role` must be `replica`.
- :attr int size: (optional) The size of the file share rounded up to the next
- gigabyte. The value must not be less than the share's current size, and must not
- exceed the maximum supported by the share's profile and IOPS.
- For this property to be changed, the share `lifecycle_state` must be `stable`.
- :attr List[str] user_tags: (optional) Tags for this resource.
+ :param RouteReferenceDeleted deleted: (optional) If present, this property
+ indicates the referenced resource has been deleted, and provides
+ some supplementary information.
+ :param str href: The URL for this route.
+ :param str id: The unique identifier for this route.
+ :param str name: The name for this route. The name is unique across all routes
+ in the routing table.
"""
def __init__(
self,
+ href: str,
+ id: str,
+ name: str,
*,
- access_control_mode: str = None,
- iops: int = None,
- name: str = None,
- profile: 'ShareProfileIdentity' = None,
- replication_cron_spec: str = None,
- size: int = None,
- user_tags: List[str] = None,
+ deleted: Optional['RouteReferenceDeleted'] = None,
) -> None:
"""
- Initialize a SharePatch object.
+ Initialize a RouteReference object.
- :param str access_control_mode: (optional) The access control mode for the
- share:
- - `security_group`: The security groups on the virtual network interface
- for a
- mount target control access to the mount target.
- - `vpc`: All clients in the VPC for a mount target have access to the mount
- target.
- For this property to be changed, the share must have no mount targets and
- `replication_role` must be `none`.
- :param int iops: (optional) The maximum input/output operations per second
- (IOPS) for the file share. The value must be in the range supported by the
- share's size.
- For this property to be changed, the share `lifecycle_state` must be
- `stable`.
- :param str name: (optional) The name for this share. The name must not be
- used by another share in the region.
- :param ShareProfileIdentity profile: (optional) The profile to use for this
- file share.
- The requested profile must be in the same `family`.
- :param str replication_cron_spec: (optional) The cron specification for the
- file share replication schedule.
- Replication of a share can be scheduled to occur at most once per hour.
- For this property to be changed, the share `replication_role` must be
- `replica`.
- :param int size: (optional) The size of the file share rounded up to the
- next gigabyte. The value must not be less than the share's current size,
- and must not exceed the maximum supported by the share's profile and IOPS.
- For this property to be changed, the share `lifecycle_state` must be
- `stable`.
- :param List[str] user_tags: (optional) Tags for this resource.
+ :param str href: The URL for this route.
+ :param str id: The unique identifier for this route.
+ :param str name: The name for this route. The name is unique across all
+ routes in the routing table.
+ :param RouteReferenceDeleted deleted: (optional) If present, this property
+ indicates the referenced resource has been deleted, and provides
+ some supplementary information.
"""
- self.access_control_mode = access_control_mode
- self.iops = iops
+ self.deleted = deleted
+ self.href = href
+ self.id = id
self.name = name
- self.profile = profile
- self.replication_cron_spec = replication_cron_spec
- self.size = size
- self.user_tags = user_tags
@classmethod
- def from_dict(cls, _dict: Dict) -> 'SharePatch':
- """Initialize a SharePatch object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'RouteReference':
+ """Initialize a RouteReference object from a json dictionary."""
args = {}
- if 'access_control_mode' in _dict:
- args['access_control_mode'] = _dict.get('access_control_mode')
- if 'iops' in _dict:
- args['iops'] = _dict.get('iops')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
- if 'profile' in _dict:
- args['profile'] = _dict.get('profile')
- if 'replication_cron_spec' in _dict:
- args['replication_cron_spec'] = _dict.get('replication_cron_spec')
- if 'size' in _dict:
- args['size'] = _dict.get('size')
- if 'user_tags' in _dict:
- args['user_tags'] = _dict.get('user_tags')
+ if (deleted := _dict.get('deleted')) is not None:
+ args['deleted'] = RouteReferenceDeleted.from_dict(deleted)
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
+ else:
+ raise ValueError('Required property \'href\' not present in RouteReference JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
+ else:
+ raise ValueError('Required property \'id\' not present in RouteReference JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ else:
+ raise ValueError('Required property \'name\' not present in RouteReference JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a SharePatch 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, 'access_control_mode') and self.access_control_mode is not None:
- _dict['access_control_mode'] = self.access_control_mode
- if hasattr(self, 'iops') and self.iops is not None:
- _dict['iops'] = self.iops
+ if hasattr(self, 'deleted') and self.deleted is not None:
+ if isinstance(self.deleted, dict):
+ _dict['deleted'] = self.deleted
+ else:
+ _dict['deleted'] = self.deleted.to_dict()
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
+ if hasattr(self, 'id') and self.id is not None:
+ _dict['id'] = self.id
if hasattr(self, 'name') and self.name is not None:
_dict['name'] = self.name
- if hasattr(self, 'profile') and self.profile is not None:
- if isinstance(self.profile, dict):
- _dict['profile'] = self.profile
- else:
- _dict['profile'] = self.profile.to_dict()
- if hasattr(self, 'replication_cron_spec') and self.replication_cron_spec is not None:
- _dict['replication_cron_spec'] = self.replication_cron_spec
- if hasattr(self, 'size') and self.size is not None:
- _dict['size'] = self.size
- if hasattr(self, 'user_tags') and self.user_tags is not None:
- _dict['user_tags'] = self.user_tags
return _dict
def _to_dict(self):
@@ -71228,133 +74363,373 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this SharePatch object."""
+ """Return a `str` version of this RouteReference object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'SharePatch') -> 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: 'SharePatch') -> bool:
+ def __ne__(self, other: 'RouteReference') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class AccessControlModeEnum(str, Enum):
- """
- The access control mode for the share:
- - `security_group`: The security groups on the virtual network interface for a
- mount target control access to the mount target.
- - `vpc`: All clients in the VPC for a mount target have access to the mount
- target.
- For this property to be changed, the share must have no mount targets and
- `replication_role` must be `none`.
- """
- SECURITY_GROUP = 'security_group'
- VPC = 'vpc'
+class RouteReferenceDeleted:
+ """
+ If present, this property indicates the referenced resource has been deleted, and
+ provides some supplementary information.
+ :param str more_info: Link to documentation about deleted resources.
+ """
+ def __init__(
+ self,
+ more_info: str,
+ ) -> None:
+ """
+ Initialize a RouteReferenceDeleted object.
-class ShareProfile:
+ :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 := _dict.get('more_info')) is not None:
+ args['more_info'] = 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:
"""
- ShareProfile.
+ RoutingTable.
- :attr ShareProfileCapacity capacity: The permitted capacity range (in gigabytes)
- for a share with this profile.
- :attr str family: The product family this share profile belongs to.
- :attr str href: The URL for this share profile.
- :attr ShareProfileIOPS iops: The permitted IOPS range for a share with this
- profile.
- :attr str name: The globally unique name for this share profile.
- :attr str resource_type: The resource type.
+ :param List[ResourceFilter] accept_routes_from: The filters specifying the
+ resources that may create routes in this routing table.
+ At present, only the `resource_type` filter is permitted, and only the
+ `vpn_server` value is supported, but filter support is expected to expand in the
+ future.
+ :param List[str] advertise_routes_to: The ingress sources to advertise routes
+ to. Routes in the table with `advertise` enabled will be advertised to these
+ sources.
+ The enumerated values for this property are expected to 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 datetime created_at: The date and time that this routing table was
+ created.
+ :param str href: The URL for this routing table.
+ :param str id: The unique identifier for this routing table.
+ :param bool is_default: Indicates whether this is the default routing table for
+ this VPC.
+ :param str lifecycle_state: The lifecycle state of the routing table.
+ :param str name: The name for this routing table. The name is unique across all
+ routing tables for the VPC.
+ :param str resource_type: The resource type.
+ :param bool route_direct_link_ingress: Indicates whether this routing table is
+ used to route traffic that originates from
+ [Direct Link](https://cloud.ibm.com/docs/dl) to this VPC.
+ Incoming traffic will be routed according to the routing table with one
+ exception: routes with an `action` of `deliver` are treated as `drop` unless the
+ `next_hop` is an IP address in a subnet in the route's `zone` that is able to
+ accept traffic. Therefore, if an incoming packet matches a route with a
+ `next_hop` of a VPN gateway connection, the packet will be dropped.
+ :param bool route_internet_ingress: Indicates whether this routing table is used
+ to route traffic that originates from the internet.
+ Incoming traffic will be routed according to the routing table with two
+ exceptions:
+ - Traffic destined for IP addresses associated with public gateways will not be
+ subject to routes in this routing table.
+ - Routes with an `action` of `deliver` are treated as `drop` unless the
+ `next_hop` is
+ an IP address in a subnet in the route's `zone` that is able to accept
+ traffic.
+ Therefore, if an incoming packet matches a route with a `next_hop` of a VPN
+ gateway
+ connection, the packet will be dropped.
+ :param bool route_transit_gateway_ingress: Indicates whether this routing table
+ is used to route traffic that originates from from [Transit
+ Gateway](https://cloud.ibm.com/docs/transit-gateway) to this VPC.
+ Incoming traffic will be routed according to the routing table with one
+ exception: routes with an `action` of `deliver` are treated as `drop` unless the
+ `next_hop` is an IP address in a subnet in the route's `zone` that is able to
+ accept traffic. Therefore, if an incoming packet matches a route with a
+ `next_hop` of a VPN gateway connection, the packet will be dropped.
+ :param bool route_vpc_zone_ingress: Indicates whether this routing table is used
+ to route traffic that originates from subnets in other zones in this VPC.
+ Incoming traffic will be routed according to the routing table with one
+ exception: routes with an `action` of `deliver` are treated as `drop` unless the
+ `next_hop` is an IP address in a subnet in the route's `zone` that is able to
+ accept traffic. Therefore, if an incoming packet matches a route with a
+ `next_hop` of 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.
"""
def __init__(
self,
- capacity: 'ShareProfileCapacity',
- family: str,
+ accept_routes_from: List['ResourceFilter'],
+ advertise_routes_to: List[str],
+ created_at: datetime,
href: str,
- iops: 'ShareProfileIOPS',
+ id: str,
+ is_default: bool,
+ lifecycle_state: str,
name: str,
resource_type: str,
+ route_direct_link_ingress: bool,
+ route_internet_ingress: bool,
+ route_transit_gateway_ingress: bool,
+ route_vpc_zone_ingress: bool,
+ routes: List['RouteReference'],
+ subnets: List['SubnetReference'],
) -> None:
"""
- Initialize a ShareProfile object.
+ Initialize a RoutingTable object.
- :param ShareProfileCapacity capacity: The permitted capacity range (in
- gigabytes) for a share with this profile.
- :param str family: The product family this share profile belongs to.
- :param str href: The URL for this share profile.
- :param ShareProfileIOPS iops: The permitted IOPS range for a share with
- this profile.
- :param str name: The globally unique name for this share profile.
+ :param List[ResourceFilter] accept_routes_from: The filters specifying the
+ resources that may create routes in this routing table.
+ At present, only the `resource_type` filter is permitted, and only the
+ `vpn_server` value is supported, but filter support is expected to expand
+ in the future.
+ :param List[str] advertise_routes_to: The ingress sources to advertise
+ routes to. Routes in the table with `advertise` enabled will be advertised
+ to these sources.
+ The enumerated values for this property are expected to 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 datetime created_at: The date and time that this routing table was
+ created.
+ :param str href: The URL for this routing table.
+ :param str id: The unique identifier for this routing table.
+ :param bool is_default: Indicates whether this is the default routing table
+ for this VPC.
+ :param str lifecycle_state: The lifecycle state of the routing table.
+ :param str name: The name for this routing table. The name is unique across
+ all routing tables for the VPC.
:param str resource_type: The resource type.
+ :param bool route_direct_link_ingress: Indicates whether this routing table
+ is used to route traffic that originates from
+ [Direct Link](https://cloud.ibm.com/docs/dl) to this VPC.
+ Incoming traffic will be routed according to the routing table with one
+ exception: routes with an `action` of `deliver` are treated as `drop`
+ unless the `next_hop` is an IP address in a subnet in the route's `zone`
+ that is able to accept traffic. Therefore, if an incoming packet matches a
+ route with a `next_hop` of a VPN gateway connection, the packet will be
+ dropped.
+ :param bool route_internet_ingress: Indicates whether this routing table is
+ used to route traffic that originates from the internet.
+ Incoming traffic will be routed according to the routing table with two
+ exceptions:
+ - Traffic destined for IP addresses associated with public gateways will
+ not be
+ subject to routes in this routing table.
+ - Routes with an `action` of `deliver` are treated as `drop` unless the
+ `next_hop` is
+ an IP address in a subnet in the route's `zone` that is able to accept
+ traffic.
+ Therefore, if an incoming packet matches a route with a `next_hop` of a
+ VPN gateway
+ connection, the packet will be dropped.
+ :param bool route_transit_gateway_ingress: Indicates whether this routing
+ table is used to route traffic that originates from from [Transit
+ Gateway](https://cloud.ibm.com/docs/transit-gateway) to this VPC.
+ Incoming traffic will be routed according to the routing table with one
+ exception: routes with an `action` of `deliver` are treated as `drop`
+ unless the `next_hop` is an IP address in a subnet in the route's `zone`
+ that is able to accept traffic. Therefore, if an incoming packet matches a
+ route with a `next_hop` of a VPN gateway connection, the packet will be
+ dropped.
+ :param bool route_vpc_zone_ingress: Indicates whether this routing table is
+ used to route traffic that originates from subnets in other zones in this
+ VPC.
+ Incoming traffic will be routed according to the routing table with one
+ exception: routes with an `action` of `deliver` are treated as `drop`
+ unless the `next_hop` is an IP address in a subnet in the route's `zone`
+ that is able to accept traffic. Therefore, if an incoming packet matches a
+ route with a `next_hop` of 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.capacity = capacity
- self.family = family
+ self.accept_routes_from = accept_routes_from
+ self.advertise_routes_to = advertise_routes_to
+ self.created_at = created_at
self.href = href
- self.iops = iops
+ self.id = id
+ self.is_default = is_default
+ self.lifecycle_state = lifecycle_state
self.name = name
self.resource_type = resource_type
+ self.route_direct_link_ingress = route_direct_link_ingress
+ self.route_internet_ingress = route_internet_ingress
+ self.route_transit_gateway_ingress = route_transit_gateway_ingress
+ self.route_vpc_zone_ingress = route_vpc_zone_ingress
+ self.routes = routes
+ self.subnets = subnets
@classmethod
- def from_dict(cls, _dict: Dict) -> 'ShareProfile':
- """Initialize a ShareProfile object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'RoutingTable':
+ """Initialize a RoutingTable object from a json dictionary."""
args = {}
- if 'capacity' in _dict:
- args['capacity'] = _dict.get('capacity')
+ if (accept_routes_from := _dict.get('accept_routes_from')) is not None:
+ args['accept_routes_from'] = [ResourceFilter.from_dict(v) for v in accept_routes_from]
else:
- raise ValueError('Required property \'capacity\' not present in ShareProfile JSON')
- if 'family' in _dict:
- args['family'] = _dict.get('family')
+ raise ValueError('Required property \'accept_routes_from\' not present in RoutingTable JSON')
+ if (advertise_routes_to := _dict.get('advertise_routes_to')) is not None:
+ args['advertise_routes_to'] = advertise_routes_to
else:
- raise ValueError('Required property \'family\' not present in ShareProfile JSON')
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ raise ValueError('Required property \'advertise_routes_to\' not present in RoutingTable JSON')
+ if (created_at := _dict.get('created_at')) is not None:
+ args['created_at'] = string_to_datetime(created_at)
else:
- raise ValueError('Required property \'href\' not present in ShareProfile JSON')
- if 'iops' in _dict:
- args['iops'] = _dict.get('iops')
+ raise ValueError('Required property \'created_at\' not present in RoutingTable JSON')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'iops\' not present in ShareProfile JSON')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
+ raise ValueError('Required property \'href\' not present in RoutingTable JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
else:
- raise ValueError('Required property \'name\' not present in ShareProfile JSON')
- if 'resource_type' in _dict:
- args['resource_type'] = _dict.get('resource_type')
+ raise ValueError('Required property \'id\' not present in RoutingTable JSON')
+ if (is_default := _dict.get('is_default')) is not None:
+ args['is_default'] = is_default
else:
- raise ValueError('Required property \'resource_type\' not present in ShareProfile JSON')
+ raise ValueError('Required property \'is_default\' not present in RoutingTable JSON')
+ if (lifecycle_state := _dict.get('lifecycle_state')) is not None:
+ args['lifecycle_state'] = lifecycle_state
+ else:
+ raise ValueError('Required property \'lifecycle_state\' not present in RoutingTable JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ else:
+ raise ValueError('Required property \'name\' not present in RoutingTable JSON')
+ if (resource_type := _dict.get('resource_type')) is not None:
+ args['resource_type'] = resource_type
+ else:
+ raise ValueError('Required property \'resource_type\' not present in RoutingTable JSON')
+ if (route_direct_link_ingress := _dict.get('route_direct_link_ingress')) is not None:
+ args['route_direct_link_ingress'] = route_direct_link_ingress
+ else:
+ raise ValueError('Required property \'route_direct_link_ingress\' not present in RoutingTable JSON')
+ if (route_internet_ingress := _dict.get('route_internet_ingress')) is not None:
+ args['route_internet_ingress'] = route_internet_ingress
+ else:
+ raise ValueError('Required property \'route_internet_ingress\' not present in RoutingTable JSON')
+ if (route_transit_gateway_ingress := _dict.get('route_transit_gateway_ingress')) is not None:
+ args['route_transit_gateway_ingress'] = route_transit_gateway_ingress
+ else:
+ raise ValueError('Required property \'route_transit_gateway_ingress\' not present in RoutingTable JSON')
+ if (route_vpc_zone_ingress := _dict.get('route_vpc_zone_ingress')) is not None:
+ args['route_vpc_zone_ingress'] = route_vpc_zone_ingress
+ else:
+ raise ValueError('Required property \'route_vpc_zone_ingress\' not present in RoutingTable JSON')
+ if (routes := _dict.get('routes')) is not None:
+ args['routes'] = [RouteReference.from_dict(v) for v in routes]
+ else:
+ raise ValueError('Required property \'routes\' not present in RoutingTable JSON')
+ if (subnets := _dict.get('subnets')) is not None:
+ args['subnets'] = [SubnetReference.from_dict(v) for v in subnets]
+ else:
+ raise ValueError('Required property \'subnets\' not present in RoutingTable JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a ShareProfile object from a json dictionary."""
+ """Initialize a RoutingTable object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'capacity') and self.capacity is not None:
- if isinstance(self.capacity, dict):
- _dict['capacity'] = self.capacity
- else:
- _dict['capacity'] = self.capacity.to_dict()
- if hasattr(self, 'family') and self.family is not None:
- _dict['family'] = self.family
+ if hasattr(self, 'accept_routes_from') and self.accept_routes_from is not None:
+ accept_routes_from_list = []
+ for v in self.accept_routes_from:
+ if isinstance(v, dict):
+ accept_routes_from_list.append(v)
+ else:
+ accept_routes_from_list.append(v.to_dict())
+ _dict['accept_routes_from'] = accept_routes_from_list
+ if hasattr(self, 'advertise_routes_to') and self.advertise_routes_to is not None:
+ _dict['advertise_routes_to'] = self.advertise_routes_to
+ 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, 'iops') and self.iops is not None:
- if isinstance(self.iops, dict):
- _dict['iops'] = self.iops
- else:
- _dict['iops'] = self.iops.to_dict()
+ if hasattr(self, 'id') and self.id is not None:
+ _dict['id'] = self.id
+ if hasattr(self, 'is_default') and self.is_default is not None:
+ _dict['is_default'] = self.is_default
+ if hasattr(self, 'lifecycle_state') and self.lifecycle_state is not None:
+ _dict['lifecycle_state'] = self.lifecycle_state
if hasattr(self, 'name') and self.name is not None:
_dict['name'] = self.name
if hasattr(self, 'resource_type') and self.resource_type is not None:
_dict['resource_type'] = self.resource_type
+ if hasattr(self, 'route_direct_link_ingress') and self.route_direct_link_ingress is not None:
+ _dict['route_direct_link_ingress'] = self.route_direct_link_ingress
+ if hasattr(self, 'route_internet_ingress') and self.route_internet_ingress is not None:
+ _dict['route_internet_ingress'] = self.route_internet_ingress
+ if hasattr(self, 'route_transit_gateway_ingress') and self.route_transit_gateway_ingress is not None:
+ _dict['route_transit_gateway_ingress'] = self.route_transit_gateway_ingress
+ if hasattr(self, 'route_vpc_zone_ingress') and self.route_vpc_zone_ingress is not None:
+ _dict['route_vpc_zone_ingress'] = self.route_vpc_zone_ingress
+ if hasattr(self, 'routes') and self.routes is not None:
+ routes_list = []
+ for v in self.routes:
+ if isinstance(v, dict):
+ routes_list.append(v)
+ else:
+ routes_list.append(v.to_dict())
+ _dict['routes'] = routes_list
+ if hasattr(self, 'subnets') and self.subnets is not None:
+ subnets_list = []
+ for v in self.subnets:
+ if isinstance(v, dict):
+ subnets_list.append(v)
+ else:
+ subnets_list.append(v.to_dict())
+ _dict['subnets'] = subnets_list
return _dict
def _to_dict(self):
@@ -71362,124 +74737,122 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this ShareProfile object."""
+ """Return a `str` version of this RoutingTable object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'ShareProfile') -> 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: 'ShareProfile') -> bool:
+ def __ne__(self, other: 'RoutingTable') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class FamilyEnum(str, Enum):
+ class AdvertiseRoutesToEnum(str, Enum):
"""
- The product family this share profile belongs to.
+ An ingress source that routes can be advertised to:
+ - `direct_link` (requires `route_direct_link_ingress` be set to `true`)
+ - `transit_gateway` (requires `route_transit_gateway_ingress` be set to `true`).
"""
- DEFINED_PERFORMANCE = 'defined_performance'
+ DIRECT_LINK = 'direct_link'
+ TRANSIT_GATEWAY = 'transit_gateway'
- class ResourceTypeEnum(str, Enum):
+ class LifecycleStateEnum(str, Enum):
"""
- The resource type.
+ The lifecycle state of the routing table.
"""
- SHARE_PROFILE = 'share_profile'
-
-
-
-class ShareProfileCapacity:
- """
- ShareProfileCapacity.
+ DELETING = 'deleting'
+ FAILED = 'failed'
+ PENDING = 'pending'
+ STABLE = 'stable'
+ SUSPENDED = 'suspended'
+ UPDATING = 'updating'
+ WAITING = 'waiting'
- """
- def __init__(
- self,
- ) -> None:
+ class ResourceTypeEnum(str, Enum):
"""
- Initialize a ShareProfileCapacity object.
-
+ The resource type.
"""
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['ShareProfileCapacityFixed', 'ShareProfileCapacityRange', 'ShareProfileCapacityEnum', 'ShareProfileCapacityDependentRange'])
- )
- raise Exception(msg)
+
+ ROUTING_TABLE = 'routing_table'
-class ShareProfileCollection:
+
+class RoutingTableCollection:
"""
- ShareProfileCollection.
+ RoutingTableCollection.
- :attr ShareProfileCollectionFirst first: A link to the first page of resources.
- :attr int limit: The maximum number of resources that can be returned by the
+ :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.
- :attr ShareProfileCollectionNext next: (optional) A link to the next page of
+ :param RoutingTableCollectionNext next: (optional) A link to the next page of
resources. This property is present for all pages
except the last page.
- :attr List[ShareProfile] profiles: Collection of share profiles.
- :attr int total_count: The total number of resources across all pages.
+ :param List[RoutingTable] routing_tables: Collection of routing tables.
+ :param int total_count: The total number of resources across all pages.
"""
def __init__(
self,
- first: 'ShareProfileCollectionFirst',
+ first: 'RoutingTableCollectionFirst',
limit: int,
- profiles: List['ShareProfile'],
+ routing_tables: List['RoutingTable'],
total_count: int,
*,
- next: 'ShareProfileCollectionNext' = None,
+ next: Optional['RoutingTableCollectionNext'] = None,
) -> None:
"""
- Initialize a ShareProfileCollection object.
+ Initialize a RoutingTableCollection object.
- :param ShareProfileCollectionFirst 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[ShareProfile] profiles: Collection of share profiles.
+ :param List[RoutingTable] routing_tables: Collection of routing tables.
:param int total_count: The total number of resources across all pages.
- :param ShareProfileCollectionNext next: (optional) A link to the next page
+ :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.profiles = profiles
+ self.routing_tables = routing_tables
self.total_count = total_count
@classmethod
- def from_dict(cls, _dict: Dict) -> 'ShareProfileCollection':
- """Initialize a ShareProfileCollection 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'] = ShareProfileCollectionFirst.from_dict(_dict.get('first'))
+ if (first := _dict.get('first')) is not None:
+ args['first'] = RoutingTableCollectionFirst.from_dict(first)
else:
- raise ValueError('Required property \'first\' not present in ShareProfileCollection JSON')
- if 'limit' in _dict:
- args['limit'] = _dict.get('limit')
+ raise ValueError('Required property \'first\' not present in RoutingTableCollection JSON')
+ if (limit := _dict.get('limit')) is not None:
+ args['limit'] = limit
else:
- raise ValueError('Required property \'limit\' not present in ShareProfileCollection JSON')
- if 'next' in _dict:
- args['next'] = ShareProfileCollectionNext.from_dict(_dict.get('next'))
- if 'profiles' in _dict:
- args['profiles'] = [ShareProfile.from_dict(v) for v in _dict.get('profiles')]
+ raise ValueError('Required property \'limit\' not present in RoutingTableCollection JSON')
+ if (next := _dict.get('next')) is not None:
+ args['next'] = RoutingTableCollectionNext.from_dict(next)
+ if (routing_tables := _dict.get('routing_tables')) is not None:
+ args['routing_tables'] = [RoutingTable.from_dict(v) for v in routing_tables]
else:
- raise ValueError('Required property \'profiles\' not present in ShareProfileCollection JSON')
- if 'total_count' in _dict:
- args['total_count'] = _dict.get('total_count')
+ raise ValueError('Required property \'routing_tables\' not present in RoutingTableCollection JSON')
+ if (total_count := _dict.get('total_count')) is not None:
+ args['total_count'] = total_count
else:
- raise ValueError('Required property \'total_count\' not present in ShareProfileCollection JSON')
+ raise ValueError('Required property \'total_count\' not present in RoutingTableCollection JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a ShareProfileCollection object from a json dictionary."""
+ """Initialize a RoutingTableCollection object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -71497,14 +74870,14 @@ def to_dict(self) -> Dict:
_dict['next'] = self.next
else:
_dict['next'] = self.next.to_dict()
- if hasattr(self, 'profiles') and self.profiles is not None:
- profiles_list = []
- for v in self.profiles:
+ if hasattr(self, 'routing_tables') and self.routing_tables is not None:
+ routing_tables_list = []
+ for v in self.routing_tables:
if isinstance(v, dict):
- profiles_list.append(v)
+ routing_tables_list.append(v)
else:
- profiles_list.append(v.to_dict())
- _dict['profiles'] = profiles_list
+ routing_tables_list.append(v.to_dict())
+ _dict['routing_tables'] = routing_tables_list
if hasattr(self, 'total_count') and self.total_count is not None:
_dict['total_count'] = self.total_count
return _dict
@@ -71514,25 +74887,25 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this ShareProfileCollection object."""
+ """Return a `str` version of this RoutingTableCollection object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'ShareProfileCollection') -> 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: 'ShareProfileCollection') -> bool:
+ def __ne__(self, other: 'RoutingTableCollection') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class ShareProfileCollectionFirst:
+class RoutingTableCollectionFirst:
"""
A link to the first page of resources.
- :attr str href: The URL for a page of resources.
+ :param str href: The URL for a page of resources.
"""
def __init__(
@@ -71540,25 +74913,25 @@ def __init__(
href: str,
) -> None:
"""
- Initialize a ShareProfileCollectionFirst 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) -> 'ShareProfileCollectionFirst':
- """Initialize a ShareProfileCollectionFirst 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')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'href\' not present in ShareProfileCollectionFirst JSON')
+ raise ValueError('Required property \'href\' not present in RoutingTableCollectionFirst JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a ShareProfileCollectionFirst object from a json dictionary."""
+ """Initialize a RoutingTableCollectionFirst object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -71573,26 +74946,26 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this ShareProfileCollectionFirst object."""
+ """Return a `str` version of this RoutingTableCollectionFirst object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'ShareProfileCollectionFirst') -> 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: 'ShareProfileCollectionFirst') -> bool:
+ def __ne__(self, other: 'RoutingTableCollectionFirst') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class ShareProfileCollectionNext:
+class RoutingTableCollectionNext:
"""
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.
+ :param str href: The URL for a page of resources.
"""
def __init__(
@@ -71600,25 +74973,25 @@ def __init__(
href: str,
) -> None:
"""
- Initialize a ShareProfileCollectionNext 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) -> 'ShareProfileCollectionNext':
- """Initialize a ShareProfileCollectionNext 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')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'href\' not present in ShareProfileCollectionNext JSON')
+ raise ValueError('Required property \'href\' not present in RoutingTableCollectionNext JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a ShareProfileCollectionNext object from a json dictionary."""
+ """Initialize a RoutingTableCollectionNext object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -71633,42 +75006,23 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this ShareProfileCollectionNext object."""
+ """Return a `str` version of this RoutingTableCollectionNext object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'ShareProfileCollectionNext') -> 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: 'ShareProfileCollectionNext') -> bool:
+ def __ne__(self, other: 'RoutingTableCollectionNext') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class ShareProfileIOPS:
- """
- ShareProfileIOPS.
-
- """
-
- def __init__(
- self,
- ) -> None:
- """
- Initialize a ShareProfileIOPS object.
-
- """
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['ShareProfileIOPSFixed', 'ShareProfileIOPSRange', 'ShareProfileIOPSEnum', 'ShareProfileIOPSDependentRange'])
- )
- raise Exception(msg)
-
-
-class ShareProfileIdentity:
+class RoutingTableIdentity:
"""
- Identifies a share profile by a unique property.
+ Identifies a routing table by a unique property.
"""
@@ -71676,73 +75030,238 @@ def __init__(
self,
) -> None:
"""
- Initialize a ShareProfileIdentity object.
+ Initialize a RoutingTableIdentity object.
"""
msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['ShareProfileIdentityByName', 'ShareProfileIdentityByHref'])
+ ", ".join(['RoutingTableIdentityById', 'RoutingTableIdentityByHref'])
)
raise Exception(msg)
-class ShareProfileReference:
+class RoutingTablePatch:
"""
- ShareProfileReference.
+ RoutingTablePatch.
- :attr str href: The URL for this share profile.
- :attr str name: The globally unique name for this share profile.
- :attr str resource_type: The resource type.
+ :param List[ResourceFilter] accept_routes_from: (optional) The filters
+ specifying the resources that may create routes in this routing table
+ (replacing any existing filters). All routes created by resources that match a
+ given filter will be removed when an existing filter is removed. Therefore, if
+ an empty array is specified, all filters will be removed, resulting in all
+ routes not directly created by the user being removed.
+ At present, only the `resource_type` filter is permitted, and only the
+ `vpn_server` value is supported, but filter support is expected to expand in the
+ future.
+ :param List[str] advertise_routes_to: (optional) The ingress sources to
+ advertise routes to, replacing any existing sources to advertise to. Routes in
+ the table with `advertise` enabled will be advertised to these sources.
+ :param str name: (optional) The name for this routing table. The name must not
+ be used by another routing table in the VPC.
+ :param bool route_direct_link_ingress: (optional) Indicates whether this routing
+ table is used to route traffic that originates from
+ [Direct Link](https://cloud.ibm.com/docs/dl/) to this VPC. Updating to `true`
+ selects this routing table, provided no other routing table in the VPC already
+ has this property set to `true`, and no subnets are attached to this routing
+ table. Updating to
+ `false` deselects this routing table, provided `direct_link` is absent from
+ `advertise_routes_to`.
+ Incoming traffic will be routed according to the routing table with one
+ exception: routes with an `action` of `deliver` are treated as `drop` unless the
+ `next_hop` is an IP address in a subnet in the route's `zone` that is able to
+ accept traffic. Therefore, if an incoming packet matches a route with a
+ `next_hop` of a VPN gateway connection, the packet will be dropped.
+ :param bool route_internet_ingress: (optional) Indicates whether this routing
+ table is used to route traffic that originates from the internet. Updating to
+ `true` selects this routing table, provided no other routing table in the VPC
+ already has this property set to `true`. Updating to `false` deselects this
+ routing table.
+ Incoming traffic will be routed according to the routing table with two
+ exceptions:
+ - Traffic destined for IP addresses associated with public gateways will not be
+ subject
+ to routes in this routing table.
+ - Routes with an `action` of `deliver` are treated as `drop` unless the
+ `next_hop` is an
+ IP address in a subnet in the route's `zone` that is able to accept traffic.
+ Therefore, if an incoming packet matches a route with a `next_hop` of a VPN
+ gateway
+ connection, the packet will be dropped.
+ :param bool route_transit_gateway_ingress: (optional) Indicates whether this
+ routing table is used to route traffic that originates from
+ [Transit Gateway](https://cloud.ibm.com/docs/transit-gateway) to this VPC.
+ Updating to
+ `true` selects this routing table, provided no other routing table in the VPC
+ already has this property set to `true`, and no subnets are attached to this
+ routing table. Updating to `false` deselects this routing table, provided
+ `transit_gateway` is absent from `advertise_routes_to`.
+ Incoming traffic will be routed according to the routing table with one
+ exception: routes with an `action` of `deliver` are treated as `drop` unless the
+ `next_hop` is an IP address in a subnet in the route's `zone` that is able to
+ accept traffic. Therefore, if an incoming packet matches a route with a
+ `next_hop` of a VPN gateway connection, the packet will be dropped.
+ If [Classic
+ Access](https://cloud.ibm.com/docs/vpc?topic=vpc-setting-up-access-to-classic-infrastructure)
+ is enabled for this VPC, and this property is set to `true`, its incoming
+ traffic will also be routed according to this routing table.
+ :param bool route_vpc_zone_ingress: (optional) Indicates whether this routing
+ table is used to route traffic that originates from subnets in other zones in
+ this VPC. Updating to `true` selects this routing table, provided no other
+ routing table in the VPC already has this property set to `true`, and no subnets
+ are attached to this routing table. Updating to `false` deselects this routing
+ table.
+ Incoming traffic will be routed according to the routing table with one
+ exception: routes with an `action` of `deliver` are treated as `drop` unless the
+ `next_hop` is an IP address in a subnet in the route's `zone` that is able to
+ accept traffic. Therefore, if an incoming packet matches a route with a
+ `next_hop` of a VPN gateway connection, the packet will be dropped.
"""
def __init__(
self,
- href: str,
- name: str,
- resource_type: str,
+ *,
+ accept_routes_from: Optional[List['ResourceFilter']] = None,
+ advertise_routes_to: Optional[List[str]] = None,
+ name: Optional[str] = None,
+ route_direct_link_ingress: Optional[bool] = None,
+ route_internet_ingress: Optional[bool] = None,
+ route_transit_gateway_ingress: Optional[bool] = None,
+ route_vpc_zone_ingress: Optional[bool] = None,
) -> None:
"""
- Initialize a ShareProfileReference object.
+ Initialize a RoutingTablePatch object.
- :param str href: The URL for this share profile.
- :param str name: The globally unique name for this share profile.
- :param str resource_type: The resource type.
- """
- self.href = href
- self.name = name
- self.resource_type = resource_type
+ :param List[ResourceFilter] accept_routes_from: (optional) The filters
+ specifying the resources that may create routes in this routing table
+ (replacing any existing filters). All routes created by resources that
+ match a given filter will be removed when an existing filter is removed.
+ Therefore, if an empty array is specified, all filters will be removed,
+ resulting in all routes not directly created by the user being removed.
+ At present, only the `resource_type` filter is permitted, and only the
+ `vpn_server` value is supported, but filter support is expected to expand
+ in the future.
+ :param List[str] advertise_routes_to: (optional) The ingress sources to
+ advertise routes to, replacing any existing sources to advertise to. Routes
+ in the table with `advertise` enabled will be advertised to these sources.
+ :param str name: (optional) The name for this routing table. The name must
+ not be used by another routing table in the VPC.
+ :param bool route_direct_link_ingress: (optional) Indicates whether this
+ routing table is used to route traffic that originates from
+ [Direct Link](https://cloud.ibm.com/docs/dl/) to this VPC. Updating to
+ `true` selects this routing table, provided no other routing table in the
+ VPC already has this property set to `true`, and no subnets are attached to
+ this routing table. Updating to
+ `false` deselects this routing table, provided `direct_link` is absent from
+ `advertise_routes_to`.
+ Incoming traffic will be routed according to the routing table with one
+ exception: routes with an `action` of `deliver` are treated as `drop`
+ unless the `next_hop` is an IP address in a subnet in the route's `zone`
+ that is able to accept traffic. Therefore, if an incoming packet matches a
+ route with a `next_hop` of a VPN gateway connection, the packet will be
+ dropped.
+ :param bool route_internet_ingress: (optional) Indicates whether this
+ routing table is used to route traffic that originates from the internet.
+ Updating to `true` selects this routing table, provided no other routing
+ table in the VPC already has this property set to `true`. Updating to
+ `false` deselects this routing table.
+ Incoming traffic will be routed according to the routing table with two
+ exceptions:
+ - Traffic destined for IP addresses associated with public gateways will
+ not be subject
+ to routes in this routing table.
+ - Routes with an `action` of `deliver` are treated as `drop` unless the
+ `next_hop` is an
+ IP address in a subnet in the route's `zone` that is able to accept
+ traffic.
+ Therefore, if an incoming packet matches a route with a `next_hop` of a
+ VPN gateway
+ connection, the packet will be dropped.
+ :param bool route_transit_gateway_ingress: (optional) Indicates whether
+ this routing table is used to route traffic that originates from
+ [Transit Gateway](https://cloud.ibm.com/docs/transit-gateway) to this VPC.
+ Updating to
+ `true` selects this routing table, provided no other routing table in the
+ VPC already has this property set to `true`, and no subnets are attached to
+ this routing table. Updating to `false` deselects this routing table,
+ provided `transit_gateway` is absent from `advertise_routes_to`.
+ Incoming traffic will be routed according to the routing table with one
+ exception: routes with an `action` of `deliver` are treated as `drop`
+ unless the `next_hop` is an IP address in a subnet in the route's `zone`
+ that is able to accept traffic. Therefore, if an incoming packet matches a
+ route with a `next_hop` of a VPN gateway connection, the packet will be
+ dropped.
+ If [Classic
+ Access](https://cloud.ibm.com/docs/vpc?topic=vpc-setting-up-access-to-classic-infrastructure)
+ is enabled for this VPC, and this property is set to `true`, its incoming
+ traffic will also be routed according to this routing table.
+ :param bool route_vpc_zone_ingress: (optional) Indicates whether this
+ routing table is used to route traffic that originates from subnets in
+ other zones in this VPC. Updating to `true` selects this routing table,
+ provided no other routing table in the VPC already has this property set to
+ `true`, and no subnets are attached to this routing table. Updating to
+ `false` deselects this routing table.
+ Incoming traffic will be routed according to the routing table with one
+ exception: routes with an `action` of `deliver` are treated as `drop`
+ unless the `next_hop` is an IP address in a subnet in the route's `zone`
+ that is able to accept traffic. Therefore, if an incoming packet matches a
+ route with a `next_hop` of a VPN gateway connection, the packet will be
+ dropped.
+ """
+ self.accept_routes_from = accept_routes_from
+ self.advertise_routes_to = advertise_routes_to
+ self.name = name
+ self.route_direct_link_ingress = route_direct_link_ingress
+ self.route_internet_ingress = route_internet_ingress
+ self.route_transit_gateway_ingress = route_transit_gateway_ingress
+ self.route_vpc_zone_ingress = route_vpc_zone_ingress
@classmethod
- def from_dict(cls, _dict: Dict) -> 'ShareProfileReference':
- """Initialize a ShareProfileReference object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'RoutingTablePatch':
+ """Initialize a RoutingTablePatch object from a json dictionary."""
args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
- else:
- raise ValueError('Required property \'href\' not present in ShareProfileReference JSON')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
- else:
- raise ValueError('Required property \'name\' not present in ShareProfileReference JSON')
- if 'resource_type' in _dict:
- args['resource_type'] = _dict.get('resource_type')
- else:
- raise ValueError('Required property \'resource_type\' not present in ShareProfileReference JSON')
+ if (accept_routes_from := _dict.get('accept_routes_from')) is not None:
+ args['accept_routes_from'] = [ResourceFilter.from_dict(v) for v in accept_routes_from]
+ if (advertise_routes_to := _dict.get('advertise_routes_to')) is not None:
+ args['advertise_routes_to'] = advertise_routes_to
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ if (route_direct_link_ingress := _dict.get('route_direct_link_ingress')) is not None:
+ args['route_direct_link_ingress'] = route_direct_link_ingress
+ if (route_internet_ingress := _dict.get('route_internet_ingress')) is not None:
+ args['route_internet_ingress'] = route_internet_ingress
+ if (route_transit_gateway_ingress := _dict.get('route_transit_gateway_ingress')) is not None:
+ args['route_transit_gateway_ingress'] = route_transit_gateway_ingress
+ if (route_vpc_zone_ingress := _dict.get('route_vpc_zone_ingress')) is not None:
+ args['route_vpc_zone_ingress'] = route_vpc_zone_ingress
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a ShareProfileReference object from a json dictionary."""
+ """Initialize a RoutingTablePatch object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'href') and self.href is not None:
- _dict['href'] = self.href
+ if hasattr(self, 'accept_routes_from') and self.accept_routes_from is not None:
+ accept_routes_from_list = []
+ for v in self.accept_routes_from:
+ if isinstance(v, dict):
+ accept_routes_from_list.append(v)
+ else:
+ accept_routes_from_list.append(v.to_dict())
+ _dict['accept_routes_from'] = accept_routes_from_list
+ if hasattr(self, 'advertise_routes_to') and self.advertise_routes_to is not None:
+ _dict['advertise_routes_to'] = self.advertise_routes_to
if hasattr(self, 'name') and self.name is not None:
_dict['name'] = self.name
- if hasattr(self, 'resource_type') and self.resource_type is not None:
- _dict['resource_type'] = self.resource_type
+ if hasattr(self, 'route_direct_link_ingress') and self.route_direct_link_ingress is not None:
+ _dict['route_direct_link_ingress'] = self.route_direct_link_ingress
+ if hasattr(self, 'route_internet_ingress') and self.route_internet_ingress is not None:
+ _dict['route_internet_ingress'] = self.route_internet_ingress
+ if hasattr(self, 'route_transit_gateway_ingress') and self.route_transit_gateway_ingress is not None:
+ _dict['route_transit_gateway_ingress'] = self.route_transit_gateway_ingress
+ if hasattr(self, 'route_vpc_zone_ingress') and self.route_vpc_zone_ingress is not None:
+ _dict['route_vpc_zone_ingress'] = self.route_vpc_zone_ingress
return _dict
def _to_dict(self):
@@ -71750,316 +75269,66 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this ShareProfileReference object."""
+ """Return a `str` version of this RoutingTablePatch object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'ShareProfileReference') -> 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: 'ShareProfileReference') -> bool:
+ def __ne__(self, other: 'RoutingTablePatch') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class ResourceTypeEnum(str, Enum):
- """
- The resource type.
- """
-
- SHARE_PROFILE = 'share_profile'
-
-
-
-class SharePrototype:
- """
- SharePrototype.
-
- :attr int iops: (optional) The maximum input/output operations per second (IOPS)
- for the file share. The share must be in the `defined_performance` profile
- family, and the value must be in the range supported by the share's specified
- size.
- In addition, each client accessing the share will be restricted to 48,000 IOPS.
- :attr List[ShareMountTargetPrototype] mount_targets: (optional) The mount
- targets for the file share. Each mount target must be in a unique VPC.
- :attr str name: (optional) The name for this share. The name must not be used by
- another share in the region. If unspecified, the name will be a hyphenated list
- of randomly-selected words.
- :attr ShareProfileIdentity profile: The
- [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-profiles) to use
- for this file share. The profile must support the share's specified IOPS and
- size.
- :attr SharePrototypeShareContext replica_share: (optional) Configuration for a
- replica file share to create and associate with this file share. If
- unspecified, a replica may be subsequently added by creating a new file share
- with a
- `source_share` referencing this file share.
- :attr List[str] user_tags: (optional) Tags for this resource.
- :attr ZoneIdentity zone: The zone this file share will reside in.
- For a replica share, this must be a different zone in the same region as the
- source share.
- """
-
- def __init__(
- self,
- profile: 'ShareProfileIdentity',
- zone: 'ZoneIdentity',
- *,
- iops: int = None,
- mount_targets: List['ShareMountTargetPrototype'] = None,
- name: str = None,
- replica_share: 'SharePrototypeShareContext' = None,
- user_tags: List[str] = None,
- ) -> None:
- """
- Initialize a SharePrototype object.
-
- :param ShareProfileIdentity profile: The
- [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-profiles)
- to use
- for this file share. The profile must support the share's specified IOPS
- and size.
- :param ZoneIdentity zone: The zone this file share will reside in.
- For a replica share, this must be a different zone in the same region as
- the
- source share.
- :param int iops: (optional) The maximum input/output operations per second
- (IOPS) for the file share. The share must be in the `defined_performance`
- profile family, and the value must be in the range supported by the share's
- specified size.
- In addition, each client accessing the share will be restricted to 48,000
- IOPS.
- :param List[ShareMountTargetPrototype] mount_targets: (optional) The mount
- targets for the file share. Each mount target must be in a unique VPC.
- :param str name: (optional) The name for this share. The name must not be
- used by another share in the region. If unspecified, the name will be a
- hyphenated list of randomly-selected words.
- :param SharePrototypeShareContext replica_share: (optional) Configuration
- for a replica file share to create and associate with this file share. If
- unspecified, a replica may be subsequently added by creating a new file
- share with a
- `source_share` referencing this file share.
- :param List[str] user_tags: (optional) Tags for this resource.
- """
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['SharePrototypeShareBySize', 'SharePrototypeShareBySourceShare'])
- )
- raise Exception(msg)
-
-
-class SharePrototypeShareContext:
- """
- Configuration for a replica file share to create and associate with this file share.
- If unspecified, a replica may be subsequently added by creating a new file share with
- a
- `source_share` referencing this file share.
-
- :attr int iops: (optional) The maximum input/output operations per second (IOPS)
- for the file share. The share must be in the `defined_performance` profile
- family, and the value must be in the range supported by the share's specified
- size.
- In addition, each client accessing the share will be restricted to 48,000 IOPS.
- :attr List[ShareMountTargetPrototype] mount_targets: (optional) The mount
- targets for this replica file share. Each mount target must be in a unique VPC.
- A replica's mount targets must be mounted read-only.
- :attr str name: (optional) The name for this share. The name must not be used by
- another share in the region. If unspecified, the name will be a hyphenated list
- of randomly-selected words.
- :attr ShareProfileIdentity profile: The
- [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-profiles) to use
- for this file share. The profile must support the share's specified IOPS and
- size.
- :attr str replication_cron_spec: The cron specification for the file share
- replication schedule.
- Replication of a share can be scheduled to occur at most once per hour.
- :attr ResourceGroupIdentity resource_group: (optional) The resource group to
- use. If unspecified, the resource group from
- the source share will be used.
- :attr List[str] user_tags: (optional) Tags for this resource.
- :attr ZoneIdentity zone: The zone this replica file share will reside in.
- Must be a different zone in the same region as the source share.
- """
-
- def __init__(
- self,
- profile: 'ShareProfileIdentity',
- replication_cron_spec: str,
- zone: 'ZoneIdentity',
- *,
- iops: int = None,
- mount_targets: List['ShareMountTargetPrototype'] = None,
- name: str = None,
- resource_group: 'ResourceGroupIdentity' = None,
- user_tags: List[str] = None,
- ) -> None:
+ class AdvertiseRoutesToEnum(str, Enum):
"""
- Initialize a SharePrototypeShareContext object.
-
- :param ShareProfileIdentity profile: The
- [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-profiles)
- to use
- for this file share. The profile must support the share's specified IOPS
- and size.
- :param str replication_cron_spec: The cron specification for the file share
- replication schedule.
- Replication of a share can be scheduled to occur at most once per hour.
- :param ZoneIdentity zone: The zone this replica file share will reside in.
- Must be a different zone in the same region as the source share.
- :param int iops: (optional) The maximum input/output operations per second
- (IOPS) for the file share. The share must be in the `defined_performance`
- profile family, and the value must be in the range supported by the share's
- specified size.
- In addition, each client accessing the share will be restricted to 48,000
- IOPS.
- :param List[ShareMountTargetPrototype] mount_targets: (optional) The mount
- targets for this replica file share. Each mount target must be in a unique
- VPC.
- A replica's mount targets must be mounted read-only.
- :param str name: (optional) The name for this share. The name must not be
- used by another share in the region. If unspecified, the name will be a
- hyphenated list of randomly-selected words.
- :param ResourceGroupIdentity resource_group: (optional) The resource group
- to use. If unspecified, the resource group from
- the source share will be used.
- :param List[str] user_tags: (optional) Tags for this resource.
+ An ingress source that routes can be advertised to:
+ - `direct_link` (requires `route_direct_link_ingress` be set to `true`)
+ - `transit_gateway` (requires `route_transit_gateway_ingress` be set to `true`).
"""
- self.iops = iops
- self.mount_targets = mount_targets
- self.name = name
- self.profile = profile
- self.replication_cron_spec = replication_cron_spec
- self.resource_group = resource_group
- self.user_tags = user_tags
- self.zone = zone
-
- @classmethod
- def from_dict(cls, _dict: Dict) -> 'SharePrototypeShareContext':
- """Initialize a SharePrototypeShareContext object from a json dictionary."""
- args = {}
- if 'iops' in _dict:
- args['iops'] = _dict.get('iops')
- if 'mount_targets' in _dict:
- args['mount_targets'] = _dict.get('mount_targets')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
- if 'profile' in _dict:
- args['profile'] = _dict.get('profile')
- else:
- raise ValueError('Required property \'profile\' not present in SharePrototypeShareContext JSON')
- if 'replication_cron_spec' in _dict:
- args['replication_cron_spec'] = _dict.get('replication_cron_spec')
- else:
- raise ValueError('Required property \'replication_cron_spec\' not present in SharePrototypeShareContext JSON')
- if 'resource_group' in _dict:
- args['resource_group'] = _dict.get('resource_group')
- if 'user_tags' in _dict:
- args['user_tags'] = _dict.get('user_tags')
- if 'zone' in _dict:
- args['zone'] = _dict.get('zone')
- else:
- raise ValueError('Required property \'zone\' not present in SharePrototypeShareContext JSON')
- return cls(**args)
-
- @classmethod
- def _from_dict(cls, _dict):
- """Initialize a SharePrototypeShareContext object from a json dictionary."""
- return cls.from_dict(_dict)
-
- def to_dict(self) -> Dict:
- """Return a json dictionary representing this model."""
- _dict = {}
- if hasattr(self, 'iops') and self.iops is not None:
- _dict['iops'] = self.iops
- if hasattr(self, 'mount_targets') and self.mount_targets is not None:
- mount_targets_list = []
- for v in self.mount_targets:
- if isinstance(v, dict):
- mount_targets_list.append(v)
- else:
- mount_targets_list.append(v.to_dict())
- _dict['mount_targets'] = mount_targets_list
- if hasattr(self, 'name') and self.name is not None:
- _dict['name'] = self.name
- if hasattr(self, 'profile') and self.profile is not None:
- if isinstance(self.profile, dict):
- _dict['profile'] = self.profile
- else:
- _dict['profile'] = self.profile.to_dict()
- if hasattr(self, 'replication_cron_spec') and self.replication_cron_spec is not None:
- _dict['replication_cron_spec'] = self.replication_cron_spec
- if hasattr(self, 'resource_group') and self.resource_group is not None:
- if isinstance(self.resource_group, dict):
- _dict['resource_group'] = self.resource_group
- else:
- _dict['resource_group'] = self.resource_group.to_dict()
- if hasattr(self, 'user_tags') and self.user_tags is not None:
- _dict['user_tags'] = self.user_tags
- if hasattr(self, 'zone') and self.zone is not None:
- if isinstance(self.zone, dict):
- _dict['zone'] = self.zone
- else:
- _dict['zone'] = self.zone.to_dict()
- return _dict
- def _to_dict(self):
- """Return a json dictionary representing this model."""
- return self.to_dict()
-
- def __str__(self) -> str:
- """Return a `str` version of this SharePrototypeShareContext object."""
- return json.dumps(self.to_dict(), indent=2)
-
- def __eq__(self, other: 'SharePrototypeShareContext') -> bool:
- """Return `true` when self and other are equal, false otherwise."""
- if not isinstance(other, self.__class__):
- return False
- return self.__dict__ == other.__dict__
+ DIRECT_LINK = 'direct_link'
+ TRANSIT_GATEWAY = 'transit_gateway'
- def __ne__(self, other: 'SharePrototypeShareContext') -> bool:
- """Return `true` when self and other are not equal, false otherwise."""
- return not self == other
-class ShareReference:
+class RoutingTableReference:
"""
- ShareReference.
+ RoutingTableReference.
- :attr str crn: The CRN for this file share.
- :attr ShareReferenceDeleted deleted: (optional) If present, this property
- indicates the referenced resource has been deleted, and provides
+ :param 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 file share.
- :attr str id: The unique identifier for this file share.
- :attr str name: The name for this share. The name is unique across all shares in
- the region.
- :attr str resource_type: The resource type.
+ :param str href: The URL for this routing table.
+ :param str id: The unique identifier for this routing table.
+ :param str name: The name for this routing table. The name is unique across all
+ routing tables for the VPC.
+ :param str resource_type: The resource type.
"""
def __init__(
self,
- crn: str,
href: str,
id: str,
name: str,
resource_type: str,
*,
- deleted: 'ShareReferenceDeleted' = None,
+ deleted: Optional['RoutingTableReferenceDeleted'] = None,
) -> None:
"""
- Initialize a ShareReference object.
+ Initialize a RoutingTableReference object.
- :param str crn: The CRN for this file share.
- :param str href: The URL for this file share.
- :param str id: The unique identifier for this file share.
- :param str name: The name for this share. The name is unique across all
- shares in the region.
+ :param str href: The URL for this routing table.
+ :param str id: The unique identifier for this routing table.
+ :param str name: The name for this routing table. The name is unique across
+ all routing tables for the VPC.
:param str resource_type: The resource type.
- :param ShareReferenceDeleted deleted: (optional) If present, this property
- indicates the referenced resource has been deleted, and provides
+ :param RoutingTableReferenceDeleted 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
@@ -72067,43 +75336,37 @@ def __init__(
self.resource_type = resource_type
@classmethod
- def from_dict(cls, _dict: Dict) -> 'ShareReference':
- """Initialize a ShareReference object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'RoutingTableReference':
+ """Initialize a RoutingTableReference object from a json dictionary."""
args = {}
- if 'crn' in _dict:
- args['crn'] = _dict.get('crn')
- else:
- raise ValueError('Required property \'crn\' not present in ShareReference JSON')
- if 'deleted' in _dict:
- args['deleted'] = ShareReferenceDeleted.from_dict(_dict.get('deleted'))
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ if (deleted := _dict.get('deleted')) is not None:
+ args['deleted'] = RoutingTableReferenceDeleted.from_dict(deleted)
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'href\' not present in ShareReference JSON')
- if 'id' in _dict:
- args['id'] = _dict.get('id')
+ raise ValueError('Required property \'href\' not present in RoutingTableReference JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
else:
- raise ValueError('Required property \'id\' not present in ShareReference JSON')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
+ raise ValueError('Required property \'id\' not present in RoutingTableReference JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
else:
- raise ValueError('Required property \'name\' not present in ShareReference JSON')
- if 'resource_type' in _dict:
- args['resource_type'] = _dict.get('resource_type')
+ raise ValueError('Required property \'name\' not present in RoutingTableReference JSON')
+ if (resource_type := _dict.get('resource_type')) is not None:
+ args['resource_type'] = resource_type
else:
- raise ValueError('Required property \'resource_type\' not present in ShareReference JSON')
+ raise ValueError('Required property \'resource_type\' not present in RoutingTableReference JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a ShareReference object from a json dictionary."""
+ """Initialize a RoutingTableReference object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'crn') and self.crn is not None:
- _dict['crn'] = self.crn
if hasattr(self, 'deleted') and self.deleted is not None:
if isinstance(self.deleted, dict):
_dict['deleted'] = self.deleted
@@ -72124,16 +75387,16 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this ShareReference object."""
+ """Return a `str` version of this RoutingTableReference object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'ShareReference') -> bool:
+ def __eq__(self, other: 'RoutingTableReference') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'ShareReference') -> bool:
+ def __ne__(self, other: 'RoutingTableReference') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
@@ -72142,16 +75405,16 @@ class ResourceTypeEnum(str, Enum):
The resource type.
"""
- SHARE = 'share'
+ ROUTING_TABLE = 'routing_table'
-class ShareReferenceDeleted:
+class RoutingTableReferenceDeleted:
"""
If present, this property indicates the referenced resource has been deleted, and
provides some supplementary information.
- :attr str more_info: Link to documentation about deleted resources.
+ :param str more_info: Link to documentation about deleted resources.
"""
def __init__(
@@ -72159,25 +75422,25 @@ def __init__(
more_info: str,
) -> None:
"""
- Initialize a ShareReferenceDeleted 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) -> 'ShareReferenceDeleted':
- """Initialize a ShareReferenceDeleted 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')
+ if (more_info := _dict.get('more_info')) is not None:
+ args['more_info'] = more_info
else:
- raise ValueError('Required property \'more_info\' not present in ShareReferenceDeleted JSON')
+ raise ValueError('Required property \'more_info\' not present in RoutingTableReferenceDeleted JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a ShareReferenceDeleted object from a json dictionary."""
+ """Initialize a RoutingTableReferenceDeleted object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -72192,79 +75455,166 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this ShareReferenceDeleted object."""
+ """Return a `str` version of this RoutingTableReferenceDeleted object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'ShareReferenceDeleted') -> 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: 'ShareReferenceDeleted') -> bool:
+ def __ne__(self, other: 'RoutingTableReferenceDeleted') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class ShareReplicationStatusReason:
+class SecurityGroup:
"""
- ShareReplicationStatusReason.
+ SecurityGroup.
- :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.
+ :param datetime created_at: The date and time that this security group was
+ created.
+ :param str crn: The security group's CRN.
+ :param str href: The security group's canonical URL.
+ :param str id: The unique identifier for this security group.
+ :param str name: The name for this security group. The name is unique across all
+ security groups for the VPC.
+ :param ResourceGroupReference resource_group: The resource group for this
+ security group.
+ :param List[SecurityGroupRule] rules: The rules for this security group. If no
+ rules exist, all traffic will be denied.
+ :param List[SecurityGroupTargetReference] targets: The targets for this security
+ group.
+ :param VPCReference vpc: The VPC this security group resides in.
"""
def __init__(
self,
- code: str,
- message: str,
- *,
- more_info: str = None,
+ created_at: datetime,
+ crn: str,
+ href: str,
+ id: str,
+ name: str,
+ resource_group: 'ResourceGroupReference',
+ rules: List['SecurityGroupRule'],
+ targets: List['SecurityGroupTargetReference'],
+ vpc: 'VPCReference',
) -> None:
"""
- Initialize a ShareReplicationStatusReason object.
+ Initialize a SecurityGroup 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 datetime created_at: The date and time that this security group was
+ created.
+ :param str crn: The security group's CRN.
+ :param str href: The security group's canonical URL.
+ :param str id: The unique identifier for this security group.
+ :param str name: The name for this security group. The name is unique
+ across all security groups for the VPC.
+ :param ResourceGroupReference resource_group: The resource group for this
+ security group.
+ :param List[SecurityGroupRule] rules: The rules for this security group. If
+ no rules exist, all traffic will be denied.
+ :param List[SecurityGroupTargetReference] targets: The targets for this
+ security group.
+ :param VPCReference vpc: The VPC this security group resides in.
"""
- self.code = code
- self.message = message
- 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.targets = targets
+ self.vpc = vpc
@classmethod
- def from_dict(cls, _dict: Dict) -> 'ShareReplicationStatusReason':
- """Initialize a ShareReplicationStatusReason object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'SecurityGroup':
+ """Initialize a SecurityGroup object from a json dictionary."""
args = {}
- if 'code' in _dict:
- args['code'] = _dict.get('code')
+ if (created_at := _dict.get('created_at')) is not None:
+ args['created_at'] = string_to_datetime(created_at)
else:
- raise ValueError('Required property \'code\' not present in ShareReplicationStatusReason JSON')
- if 'message' in _dict:
- args['message'] = _dict.get('message')
+ raise ValueError('Required property \'created_at\' not present in SecurityGroup JSON')
+ if (crn := _dict.get('crn')) is not None:
+ args['crn'] = crn
else:
- raise ValueError('Required property \'message\' not present in ShareReplicationStatusReason JSON')
- if 'more_info' in _dict:
- args['more_info'] = _dict.get('more_info')
+ raise ValueError('Required property \'crn\' not present in SecurityGroup JSON')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
+ else:
+ raise ValueError('Required property \'href\' not present in SecurityGroup JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
+ else:
+ raise ValueError('Required property \'id\' not present in SecurityGroup JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ else:
+ raise ValueError('Required property \'name\' not present in SecurityGroup JSON')
+ if (resource_group := _dict.get('resource_group')) is not None:
+ args['resource_group'] = ResourceGroupReference.from_dict(resource_group)
+ else:
+ raise ValueError('Required property \'resource_group\' not present in SecurityGroup JSON')
+ if (rules := _dict.get('rules')) is not None:
+ args['rules'] = [SecurityGroupRule.from_dict(v) for v in rules]
+ else:
+ raise ValueError('Required property \'rules\' not present in SecurityGroup JSON')
+ if (targets := _dict.get('targets')) is not None:
+ args['targets'] = targets
+ else:
+ raise ValueError('Required property \'targets\' not present in SecurityGroup JSON')
+ if (vpc := _dict.get('vpc')) is not None:
+ args['vpc'] = VPCReference.from_dict(vpc)
+ else:
+ raise ValueError('Required property \'vpc\' not present in SecurityGroup JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a ShareReplicationStatusReason object from a json dictionary."""
+ """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, '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, 'created_at') and self.created_at is not None:
+ _dict['created_at'] = datetime_to_string(self.created_at)
+ if hasattr(self, 'crn') and self.crn is not None:
+ _dict['crn'] = self.crn
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
+ if hasattr(self, 'id') and self.id is not None:
+ _dict['id'] = self.id
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ if hasattr(self, 'resource_group') and self.resource_group is not None:
+ if isinstance(self.resource_group, dict):
+ _dict['resource_group'] = self.resource_group
+ else:
+ _dict['resource_group'] = self.resource_group.to_dict()
+ if hasattr(self, 'rules') and self.rules is not None:
+ rules_list = []
+ for v in self.rules:
+ if isinstance(v, dict):
+ rules_list.append(v)
+ else:
+ rules_list.append(v.to_dict())
+ _dict['rules'] = rules_list
+ if hasattr(self, 'targets') and self.targets is not None:
+ targets_list = []
+ for v in self.targets:
+ if isinstance(v, dict):
+ targets_list.append(v)
+ else:
+ targets_list.append(v.to_dict())
+ _dict['targets'] = targets_list
+ if hasattr(self, 'vpc') and self.vpc is not None:
+ if isinstance(self.vpc, dict):
+ _dict['vpc'] = self.vpc
+ else:
+ _dict['vpc'] = self.vpc.to_dict()
return _dict
def _to_dict(self):
@@ -72272,367 +75622,117 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this ShareReplicationStatusReason object."""
+ """Return a `str` version of this SecurityGroup object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'ShareReplicationStatusReason') -> 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: 'ShareReplicationStatusReason') -> bool:
+ def __ne__(self, other: 'SecurityGroup') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class CodeEnum(str, Enum):
- """
- A snake case string succinctly identifying the status reason.
- """
-
- CANNOT_INITIALIZE_REPLICATION = 'cannot_initialize_replication'
- CANNOT_REACH_REPLICA_SHARE = 'cannot_reach_replica_share'
- CANNOT_REACH_SOURCE_SHARE = 'cannot_reach_source_share'
-
-
-class Snapshot:
+class SecurityGroupCollection:
"""
- Snapshot.
+ SecurityGroupCollection.
- :attr BackupPolicyPlanReference backup_policy_plan: (optional) If present, the
- backup policy plan which created this snapshot.
- :attr bool bootable: Indicates if a boot volume attachment can be created with a
- volume created from this snapshot.
- :attr datetime captured_at: (optional) The date and time the data capture for
- this snapshot was completed.
- If absent, this snapshot's data has not yet been captured. Additionally, this
- property may be absent for snapshots created before 1 January 2022.
- :attr List[SnapshotClone] clones: Clones for this snapshot.
- :attr List[SnapshotCopiesItem] copies: The copies of this snapshot.
- :attr datetime created_at: The date and time that this snapshot was created.
- :attr str crn: The CRN of this snapshot.
- :attr bool deletable: Deprecated: Indicates whether this snapshot can be
- deleted. This value will always be `true`.
- :attr str encryption: The type of encryption used on the source volume.
- :attr EncryptionKeyReference encryption_key: (optional) The root key used to
- wrap the data encryption key for the source volume.
- This property will be present for volumes with an `encryption` type of
- `user_managed`.
- :attr str href: The URL for this snapshot.
- :attr str id: The unique identifier for this snapshot.
- :attr str lifecycle_state: The lifecycle state of this snapshot.
- :attr int minimum_capacity: The minimum capacity of a volume created from this
- snapshot. When a snapshot is created, this will be set to the capacity of the
- `source_volume`.
- :attr str name: The name for this snapshot. The name is unique across all
- snapshots in the region.
- :attr OperatingSystem operating_system: (optional) The operating system included
- in this snapshot.
- :attr ResourceGroupReference resource_group: The resource group for this
- snapshot.
- :attr str resource_type: The resource type.
- :attr List[str] service_tags: The [service
- tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) prefixed with
- `is.snapshot:` associated with this snapshot.
- :attr int size: The size of this snapshot rounded up to the next gigabyte.
- :attr ImageReference source_image: (optional) If present, the image from which
- the data on this snapshot was most directly
- provisioned.
- :attr SnapshotSourceSnapshot source_snapshot: (optional) If present, the source
- snapshot this snapshot was created from.
- :attr VolumeReference source_volume: The source volume this snapshot was created
- from (may be
- [deleted](https://cloud.ibm.com/apidocs/vpc#deleted-resources)).
- :attr List[str] user_tags: The [user
- tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with this
- snapshot.
+ :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 SecurityGroupCollectionNext next: (optional) A link to the next page of
+ resources. This property is present for all pages
+ except the last page.
+ :param List[SecurityGroup] security_groups: Collection of security groups.
+ :param int total_count: The total number of resources across all pages.
"""
def __init__(
self,
- bootable: bool,
- clones: List['SnapshotClone'],
- copies: List['SnapshotCopiesItem'],
- created_at: datetime,
- crn: str,
- deletable: bool,
- encryption: str,
- href: str,
- id: str,
- lifecycle_state: str,
- minimum_capacity: int,
- name: str,
- resource_group: 'ResourceGroupReference',
- resource_type: str,
- service_tags: List[str],
- size: int,
- source_volume: 'VolumeReference',
- user_tags: List[str],
+ first: 'SecurityGroupCollectionFirst',
+ limit: int,
+ security_groups: List['SecurityGroup'],
+ total_count: int,
*,
- backup_policy_plan: 'BackupPolicyPlanReference' = None,
- captured_at: datetime = None,
- encryption_key: 'EncryptionKeyReference' = None,
- operating_system: 'OperatingSystem' = None,
- source_image: 'ImageReference' = None,
- source_snapshot: 'SnapshotSourceSnapshot' = None,
+ next: Optional['SecurityGroupCollectionNext'] = None,
) -> None:
"""
- Initialize a Snapshot object.
+ Initialize a SecurityGroupCollection object.
- :param bool bootable: Indicates if a boot volume attachment can be created
- with a volume created from this snapshot.
- :param List[SnapshotClone] clones: Clones for this snapshot.
- :param List[SnapshotCopiesItem] copies: The copies of this snapshot.
- :param datetime created_at: The date and time that this snapshot was
- created.
- :param str crn: The CRN of this snapshot.
- :param bool deletable: Deprecated: Indicates whether this snapshot can be
- deleted. This value will always be `true`.
- :param str encryption: The type of encryption used on the source volume.
- :param str href: The URL for this snapshot.
- :param str id: The unique identifier for this snapshot.
- :param str lifecycle_state: The lifecycle state of this snapshot.
- :param int minimum_capacity: The minimum capacity of a volume created from
- this snapshot. When a snapshot is created, this will be set to the capacity
- of the `source_volume`.
- :param str name: The name for this snapshot. The name is unique across all
- snapshots in the region.
- :param ResourceGroupReference resource_group: The resource group for this
- snapshot.
- :param str resource_type: The resource type.
- :param List[str] service_tags: The [service
- tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) prefixed with
- `is.snapshot:` associated with this snapshot.
- :param int size: The size of this snapshot rounded up to the next gigabyte.
- :param VolumeReference source_volume: The source volume this snapshot was
- created from (may be
- [deleted](https://cloud.ibm.com/apidocs/vpc#deleted-resources)).
- :param List[str] user_tags: The [user
- tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with
- this snapshot.
- :param BackupPolicyPlanReference backup_policy_plan: (optional) If present,
- the backup policy plan which created this snapshot.
- :param datetime captured_at: (optional) The date and time the data capture
- for this snapshot was completed.
- If absent, this snapshot's data has not yet been captured. Additionally,
- this property may be absent for snapshots created before 1 January 2022.
- :param EncryptionKeyReference encryption_key: (optional) The root key used
- to wrap the data encryption key for the source volume.
- This property will be present for volumes with an `encryption` type of
- `user_managed`.
- :param OperatingSystem operating_system: (optional) The operating system
- included in this snapshot.
- :param ImageReference source_image: (optional) If present, the image from
- which the data on this snapshot was most directly
- provisioned.
- :param SnapshotSourceSnapshot source_snapshot: (optional) If present, the
- source snapshot this snapshot was created from.
+ :param 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[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
+ except the last page.
"""
- self.backup_policy_plan = backup_policy_plan
- self.bootable = bootable
- self.captured_at = captured_at
- self.clones = clones
- self.copies = copies
- self.created_at = created_at
- self.crn = crn
- self.deletable = deletable
- self.encryption = encryption
- self.encryption_key = encryption_key
- self.href = href
- self.id = id
- self.lifecycle_state = lifecycle_state
- self.minimum_capacity = minimum_capacity
- self.name = name
- self.operating_system = operating_system
- self.resource_group = resource_group
- self.resource_type = resource_type
- self.service_tags = service_tags
- self.size = size
- self.source_image = source_image
- self.source_snapshot = source_snapshot
- self.source_volume = source_volume
- self.user_tags = user_tags
+ self.first = first
+ self.limit = limit
+ self.next = next
+ self.security_groups = security_groups
+ self.total_count = total_count
@classmethod
- def from_dict(cls, _dict: Dict) -> 'Snapshot':
- """Initialize a Snapshot object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'SecurityGroupCollection':
+ """Initialize a SecurityGroupCollection object from a json dictionary."""
args = {}
- if 'backup_policy_plan' in _dict:
- args['backup_policy_plan'] = BackupPolicyPlanReference.from_dict(_dict.get('backup_policy_plan'))
- if 'bootable' in _dict:
- args['bootable'] = _dict.get('bootable')
- else:
- raise ValueError('Required property \'bootable\' not present in Snapshot JSON')
- if 'captured_at' in _dict:
- args['captured_at'] = string_to_datetime(_dict.get('captured_at'))
- if 'clones' in _dict:
- args['clones'] = [SnapshotClone.from_dict(v) for v in _dict.get('clones')]
- else:
- raise ValueError('Required property \'clones\' not present in Snapshot JSON')
- if 'copies' in _dict:
- args['copies'] = [SnapshotCopiesItem.from_dict(v) for v in _dict.get('copies')]
- else:
- raise ValueError('Required property \'copies\' not present in Snapshot JSON')
- if 'created_at' in _dict:
- args['created_at'] = string_to_datetime(_dict.get('created_at'))
- else:
- raise ValueError('Required property \'created_at\' not present in Snapshot JSON')
- if 'crn' in _dict:
- args['crn'] = _dict.get('crn')
- else:
- raise ValueError('Required property \'crn\' not present in Snapshot JSON')
- if 'deletable' in _dict:
- args['deletable'] = _dict.get('deletable')
- else:
- raise ValueError('Required property \'deletable\' not present in Snapshot JSON')
- if 'encryption' in _dict:
- args['encryption'] = _dict.get('encryption')
- else:
- raise ValueError('Required property \'encryption\' not present in Snapshot JSON')
- if 'encryption_key' in _dict:
- args['encryption_key'] = EncryptionKeyReference.from_dict(_dict.get('encryption_key'))
- 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 'service_tags' in _dict:
- args['service_tags'] = _dict.get('service_tags')
+ if (first := _dict.get('first')) is not None:
+ args['first'] = SecurityGroupCollectionFirst.from_dict(first)
else:
- raise ValueError('Required property \'service_tags\' not present in Snapshot JSON')
- if 'size' in _dict:
- args['size'] = _dict.get('size')
+ raise ValueError('Required property \'first\' not present in SecurityGroupCollection JSON')
+ if (limit := _dict.get('limit')) is not None:
+ args['limit'] = limit
else:
- raise ValueError('Required property \'size\' not present in Snapshot JSON')
- if 'source_image' in _dict:
- args['source_image'] = ImageReference.from_dict(_dict.get('source_image'))
- if 'source_snapshot' in _dict:
- args['source_snapshot'] = SnapshotSourceSnapshot.from_dict(_dict.get('source_snapshot'))
- if 'source_volume' in _dict:
- args['source_volume'] = VolumeReference.from_dict(_dict.get('source_volume'))
+ raise ValueError('Required property \'limit\' not present in SecurityGroupCollection JSON')
+ if (next := _dict.get('next')) is not None:
+ args['next'] = SecurityGroupCollectionNext.from_dict(next)
+ if (security_groups := _dict.get('security_groups')) is not None:
+ args['security_groups'] = [SecurityGroup.from_dict(v) for v in security_groups]
else:
- raise ValueError('Required property \'source_volume\' not present in Snapshot JSON')
- if 'user_tags' in _dict:
- args['user_tags'] = _dict.get('user_tags')
+ raise ValueError('Required property \'security_groups\' not present in SecurityGroupCollection JSON')
+ if (total_count := _dict.get('total_count')) is not None:
+ args['total_count'] = total_count
else:
- raise ValueError('Required property \'user_tags\' not present in Snapshot JSON')
+ raise ValueError('Required property \'total_count\' not present in SecurityGroupCollection JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a Snapshot object from a json dictionary."""
+ """Initialize a SecurityGroupCollection object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'backup_policy_plan') and self.backup_policy_plan is not None:
- if isinstance(self.backup_policy_plan, dict):
- _dict['backup_policy_plan'] = self.backup_policy_plan
+ if hasattr(self, 'first') and self.first is not None:
+ if isinstance(self.first, dict):
+ _dict['first'] = self.first
else:
- _dict['backup_policy_plan'] = self.backup_policy_plan.to_dict()
- if hasattr(self, 'bootable') and self.bootable is not None:
- _dict['bootable'] = self.bootable
- if hasattr(self, 'captured_at') and self.captured_at is not None:
- _dict['captured_at'] = datetime_to_string(self.captured_at)
- if hasattr(self, 'clones') and self.clones is not None:
- clones_list = []
- for v in self.clones:
- if isinstance(v, dict):
- clones_list.append(v)
- else:
- clones_list.append(v.to_dict())
- _dict['clones'] = clones_list
- if hasattr(self, 'copies') and self.copies is not None:
- copies_list = []
- for v in self.copies:
+ _dict['first'] = self.first.to_dict()
+ if hasattr(self, 'limit') and self.limit is not None:
+ _dict['limit'] = self.limit
+ if hasattr(self, 'next') and self.next is not None:
+ if isinstance(self.next, dict):
+ _dict['next'] = self.next
+ else:
+ _dict['next'] = self.next.to_dict()
+ if hasattr(self, 'security_groups') and self.security_groups is not None:
+ security_groups_list = []
+ for v in self.security_groups:
if isinstance(v, dict):
- copies_list.append(v)
+ security_groups_list.append(v)
else:
- copies_list.append(v.to_dict())
- _dict['copies'] = copies_list
- if hasattr(self, 'created_at') and self.created_at is not None:
- _dict['created_at'] = datetime_to_string(self.created_at)
- if hasattr(self, 'crn') and self.crn is not None:
- _dict['crn'] = self.crn
- if hasattr(self, 'deletable') and self.deletable is not None:
- _dict['deletable'] = self.deletable
- if hasattr(self, 'encryption') and self.encryption is not None:
- _dict['encryption'] = self.encryption
- if hasattr(self, 'encryption_key') and self.encryption_key is not None:
- if isinstance(self.encryption_key, dict):
- _dict['encryption_key'] = self.encryption_key
- else:
- _dict['encryption_key'] = self.encryption_key.to_dict()
- if hasattr(self, 'href') and self.href is not None:
- _dict['href'] = self.href
- if hasattr(self, 'id') and self.id is not None:
- _dict['id'] = self.id
- if hasattr(self, 'lifecycle_state') and self.lifecycle_state is not None:
- _dict['lifecycle_state'] = self.lifecycle_state
- if hasattr(self, 'minimum_capacity') and self.minimum_capacity is not None:
- _dict['minimum_capacity'] = self.minimum_capacity
- if hasattr(self, 'name') and self.name is not None:
- _dict['name'] = self.name
- if hasattr(self, 'operating_system') and self.operating_system is not None:
- if isinstance(self.operating_system, dict):
- _dict['operating_system'] = self.operating_system
- else:
- _dict['operating_system'] = self.operating_system.to_dict()
- if hasattr(self, 'resource_group') and self.resource_group is not None:
- if isinstance(self.resource_group, dict):
- _dict['resource_group'] = self.resource_group
- else:
- _dict['resource_group'] = self.resource_group.to_dict()
- if hasattr(self, 'resource_type') and self.resource_type is not None:
- _dict['resource_type'] = self.resource_type
- if hasattr(self, 'service_tags') and self.service_tags is not None:
- _dict['service_tags'] = self.service_tags
- if hasattr(self, 'size') and self.size is not None:
- _dict['size'] = self.size
- if hasattr(self, 'source_image') and self.source_image is not None:
- if isinstance(self.source_image, dict):
- _dict['source_image'] = self.source_image
- else:
- _dict['source_image'] = self.source_image.to_dict()
- if hasattr(self, 'source_snapshot') and self.source_snapshot is not None:
- if isinstance(self.source_snapshot, dict):
- _dict['source_snapshot'] = self.source_snapshot
- else:
- _dict['source_snapshot'] = self.source_snapshot.to_dict()
- if hasattr(self, 'source_volume') and self.source_volume is not None:
- if isinstance(self.source_volume, dict):
- _dict['source_volume'] = self.source_volume
- else:
- _dict['source_volume'] = self.source_volume.to_dict()
- if hasattr(self, 'user_tags') and self.user_tags is not None:
- _dict['user_tags'] = self.user_tags
+ security_groups_list.append(v.to_dict())
+ _dict['security_groups'] = security_groups_list
+ if hasattr(self, 'total_count') and self.total_count is not None:
+ _dict['total_count'] = self.total_count
return _dict
def _to_dict(self):
@@ -72640,116 +75740,58 @@ 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 SecurityGroupCollection object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'Snapshot') -> 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: 'Snapshot') -> bool:
+ def __ne__(self, other: 'SecurityGroupCollection') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class EncryptionEnum(str, Enum):
- """
- The type of encryption used on the source volume.
- """
-
- PROVIDER_MANAGED = 'provider_managed'
- USER_MANAGED = 'user_managed'
-
-
- class LifecycleStateEnum(str, Enum):
- """
- The lifecycle state of this snapshot.
- """
-
- DELETING = 'deleting'
- FAILED = 'failed'
- PENDING = 'pending'
- STABLE = 'stable'
- SUSPENDED = 'suspended'
- UPDATING = 'updating'
- WAITING = 'waiting'
-
-
- class ResourceTypeEnum(str, Enum):
- """
- The resource type.
- """
-
- SNAPSHOT = 'snapshot'
-
-
-class SnapshotClone:
+class SecurityGroupCollectionFirst:
"""
- SnapshotClone.
+ A link to the first page of resources.
- :attr bool available: Indicates whether this snapshot clone is available for
- use.
- :attr datetime created_at: The date and time that this snapshot clone was
- created.
- :attr ZoneReference zone: The zone this snapshot clone resides in.
+ :param str href: The URL for a page of resources.
"""
def __init__(
self,
- available: bool,
- created_at: datetime,
- zone: 'ZoneReference',
+ href: str,
) -> None:
"""
- Initialize a SnapshotClone object.
+ Initialize a SecurityGroupCollectionFirst object.
- :param bool available: Indicates whether this snapshot clone is available
- for use.
- :param datetime created_at: The date and time that this snapshot clone was
- created.
- :param ZoneReference zone: The zone this snapshot clone resides in.
+ :param str href: The URL for a page of resources.
"""
- self.available = available
- self.created_at = created_at
- self.zone = zone
+ self.href = href
@classmethod
- def from_dict(cls, _dict: Dict) -> 'SnapshotClone':
- """Initialize a SnapshotClone object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'SecurityGroupCollectionFirst':
+ """Initialize a SecurityGroupCollectionFirst object from a json dictionary."""
args = {}
- if 'available' in _dict:
- args['available'] = _dict.get('available')
- else:
- raise ValueError('Required property \'available\' not present in SnapshotClone JSON')
- if 'created_at' in _dict:
- args['created_at'] = string_to_datetime(_dict.get('created_at'))
- else:
- raise ValueError('Required property \'created_at\' not present in SnapshotClone JSON')
- if 'zone' in _dict:
- args['zone'] = ZoneReference.from_dict(_dict.get('zone'))
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'zone\' not present in SnapshotClone JSON')
+ raise ValueError('Required property \'href\' not present in SecurityGroupCollectionFirst JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a SnapshotClone object from a json dictionary."""
+ """Initialize a SecurityGroupCollectionFirst object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'available') and self.available is not None:
- _dict['available'] = self.available
- if hasattr(self, 'created_at') and self.created_at is not None:
- _dict['created_at'] = datetime_to_string(self.created_at)
- if hasattr(self, 'zone') and self.zone is not None:
- if isinstance(self.zone, dict):
- _dict['zone'] = self.zone
- else:
- _dict['zone'] = self.zone.to_dict()
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
return _dict
def _to_dict(self):
@@ -72757,64 +75799,59 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this SnapshotClone object."""
+ """Return a `str` version of this SecurityGroupCollectionFirst object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'SnapshotClone') -> 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: 'SnapshotClone') -> bool:
+ def __ne__(self, other: 'SecurityGroupCollectionFirst') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class SnapshotCloneCollection:
+class SecurityGroupCollectionNext:
"""
- SnapshotCloneCollection.
+ A link to the next page of resources. This property is present for all pages except
+ the last page.
- :attr List[SnapshotClone] clones: Collection of snapshot clones.
+ :param str href: The URL for a page of resources.
"""
def __init__(
self,
- clones: List['SnapshotClone'],
+ href: str,
) -> None:
"""
- Initialize a SnapshotCloneCollection object.
+ Initialize a SecurityGroupCollectionNext object.
- :param List[SnapshotClone] clones: Collection of snapshot clones.
+ :param str href: The URL for a page of resources.
"""
- self.clones = clones
+ self.href = href
@classmethod
- def from_dict(cls, _dict: Dict) -> 'SnapshotCloneCollection':
- """Initialize a SnapshotCloneCollection object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'SecurityGroupCollectionNext':
+ """Initialize a SecurityGroupCollectionNext object from a json dictionary."""
args = {}
- if 'clones' in _dict:
- args['clones'] = [SnapshotClone.from_dict(v) for v in _dict.get('clones')]
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'clones\' not present in SnapshotCloneCollection JSON')
+ raise ValueError('Required property \'href\' not present in SecurityGroupCollectionNext JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a SnapshotCloneCollection 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, 'clones') and self.clones is not None:
- clones_list = []
- for v in self.clones:
- if isinstance(v, dict):
- clones_list.append(v)
- else:
- clones_list.append(v.to_dict())
- _dict['clones'] = clones_list
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
return _dict
def _to_dict(self):
@@ -72822,65 +75859,78 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this SnapshotCloneCollection object."""
+ """Return a `str` version of this SecurityGroupCollectionNext object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'SnapshotCloneCollection') -> 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: 'SnapshotCloneCollection') -> bool:
+ def __ne__(self, other: 'SecurityGroupCollectionNext') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class SnapshotClonePrototype:
+class SecurityGroupIdentity:
"""
- SnapshotClonePrototype.
+ Identifies a security group by a unique property.
- :attr ZoneIdentity zone: The zone this snapshot clone will reside in. Must be in
- the same region as the
- snapshot.
"""
def __init__(
self,
- zone: 'ZoneIdentity',
) -> None:
"""
- Initialize a SnapshotClonePrototype object.
+ Initialize a SecurityGroupIdentity object.
- :param ZoneIdentity zone: The zone this snapshot clone will reside in. Must
- be in the same region as the
- snapshot.
"""
- self.zone = zone
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['SecurityGroupIdentityById', 'SecurityGroupIdentityByCRN', 'SecurityGroupIdentityByHref'])
+ )
+ raise Exception(msg)
+
+
+class SecurityGroupPatch:
+ """
+ SecurityGroupPatch.
+
+ :param str name: (optional) The name for this security group. The name must not
+ be used by another security group for the VPC.
+ """
+
+ def __init__(
+ self,
+ *,
+ name: Optional[str] = None,
+ ) -> None:
+ """
+ Initialize a SecurityGroupPatch object.
+
+ :param str name: (optional) The name for this security group. The name must
+ not be used by another security group for the VPC.
+ """
+ self.name = name
@classmethod
- def from_dict(cls, _dict: Dict) -> 'SnapshotClonePrototype':
- """Initialize a SnapshotClonePrototype object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'SecurityGroupPatch':
+ """Initialize a SecurityGroupPatch object from a json dictionary."""
args = {}
- if 'zone' in _dict:
- args['zone'] = _dict.get('zone')
- else:
- raise ValueError('Required property \'zone\' not present in SnapshotClonePrototype JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a SnapshotClonePrototype object from a json dictionary."""
+ """Initialize a SecurityGroupPatch object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'zone') and self.zone is not None:
- if isinstance(self.zone, dict):
- _dict['zone'] = self.zone
- else:
- _dict['zone'] = self.zone.to_dict()
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
return _dict
def _to_dict(self):
@@ -72888,116 +75938,106 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this SnapshotClonePrototype object."""
+ """Return a `str` version of this SecurityGroupPatch object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'SnapshotClonePrototype') -> 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: 'SnapshotClonePrototype') -> bool:
+ def __ne__(self, other: 'SecurityGroupPatch') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class SnapshotCollection:
+class SecurityGroupReference:
"""
- SnapshotCollection.
+ SecurityGroupReference.
- :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.
+ :param str crn: The security group's CRN.
+ :param SecurityGroupReferenceDeleted deleted: (optional) If present, this
+ property indicates the referenced resource has been deleted, and provides
+ some supplementary information.
+ :param str href: The security group's canonical URL.
+ :param str id: The unique identifier for this security group.
+ :param str name: The name for this security group. The name is unique across all
+ security groups for the VPC.
"""
def __init__(
self,
- first: 'SnapshotCollectionFirst',
- limit: int,
- snapshots: List['Snapshot'],
- total_count: int,
+ crn: str,
+ href: str,
+ id: str,
+ name: str,
*,
- next: 'SnapshotCollectionNext' = None,
+ deleted: Optional['SecurityGroupReferenceDeleted'] = None,
) -> None:
"""
- Initialize a SnapshotCollection object.
+ Initialize a SecurityGroupReference 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 str crn: The security group's CRN.
+ :param str href: The security group's canonical URL.
+ :param str id: The unique identifier for this security group.
+ :param str name: The name for this security group. The name is unique
+ across all security groups for the VPC.
+ :param SecurityGroupReferenceDeleted deleted: (optional) If present, this
+ property indicates the referenced resource has been deleted, and provides
+ some supplementary information.
"""
- self.first = first
- self.limit = limit
- self.next = next
- self.snapshots = snapshots
- self.total_count = total_count
+ self.crn = crn
+ self.deleted = deleted
+ self.href = href
+ self.id = id
+ self.name = name
@classmethod
- def from_dict(cls, _dict: Dict) -> 'SnapshotCollection':
- """Initialize a SnapshotCollection object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'SecurityGroupReference':
+ """Initialize a SecurityGroupReference object from a json dictionary."""
args = {}
- if 'first' in _dict:
- args['first'] = SnapshotCollectionFirst.from_dict(_dict.get('first'))
+ if (crn := _dict.get('crn')) is not None:
+ args['crn'] = crn
else:
- raise ValueError('Required property \'first\' not present in SnapshotCollection JSON')
- if 'limit' in _dict:
- args['limit'] = _dict.get('limit')
+ raise ValueError('Required property \'crn\' not present in SecurityGroupReference JSON')
+ if (deleted := _dict.get('deleted')) is not None:
+ args['deleted'] = SecurityGroupReferenceDeleted.from_dict(deleted)
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'limit\' not present in SnapshotCollection JSON')
- if 'next' in _dict:
- args['next'] = SnapshotCollectionNext.from_dict(_dict.get('next'))
- if 'snapshots' in _dict:
- args['snapshots'] = [Snapshot.from_dict(v) for v in _dict.get('snapshots')]
+ raise ValueError('Required property \'href\' not present in SecurityGroupReference JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
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 \'id\' not present in SecurityGroupReference JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
else:
- raise ValueError('Required property \'total_count\' not present in SnapshotCollection JSON')
+ raise ValueError('Required property \'name\' not present in SecurityGroupReference JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a SnapshotCollection object from a json dictionary."""
+ """Initialize a SecurityGroupReference object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'first') and self.first is not None:
- if isinstance(self.first, dict):
- _dict['first'] = self.first
- else:
- _dict['first'] = self.first.to_dict()
- if hasattr(self, 'limit') and self.limit is not None:
- _dict['limit'] = self.limit
- if hasattr(self, 'next') and self.next is not None:
- if isinstance(self.next, dict):
- _dict['next'] = self.next
+ if hasattr(self, 'crn') and self.crn is not None:
+ _dict['crn'] = self.crn
+ if hasattr(self, 'deleted') and self.deleted is not None:
+ if isinstance(self.deleted, dict):
+ _dict['deleted'] = self.deleted
else:
- _dict['next'] = self.next.to_dict()
- if hasattr(self, 'snapshots') and self.snapshots is not None:
- snapshots_list = []
- for v in self.snapshots:
- if isinstance(v, dict):
- snapshots_list.append(v)
- else:
- snapshots_list.append(v.to_dict())
- _dict['snapshots'] = snapshots_list
- if hasattr(self, 'total_count') and self.total_count is not None:
- _dict['total_count'] = self.total_count
+ _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):
@@ -73005,58 +76045,59 @@ 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 SecurityGroupReference object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'SnapshotCollection') -> 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: 'SnapshotCollection') -> bool:
+ def __ne__(self, other: 'SecurityGroupReference') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class SnapshotCollectionFirst:
+class SecurityGroupReferenceDeleted:
"""
- 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.
+ :param str more_info: Link to documentation about deleted resources.
"""
def __init__(
self,
- href: str,
+ more_info: str,
) -> None:
"""
- Initialize a SnapshotCollectionFirst object.
+ Initialize a SecurityGroupReferenceDeleted 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) -> 'SnapshotCollectionFirst':
- """Initialize a SnapshotCollectionFirst object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'SecurityGroupReferenceDeleted':
+ """Initialize a SecurityGroupReferenceDeleted object from a json dictionary."""
args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ if (more_info := _dict.get('more_info')) is not None:
+ args['more_info'] = more_info
else:
- raise ValueError('Required property \'href\' not present in SnapshotCollectionFirst JSON')
+ raise ValueError('Required property \'more_info\' not present in SecurityGroupReferenceDeleted JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a SnapshotCollectionFirst object from a json dictionary."""
+ """Initialize a SecurityGroupReferenceDeleted object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, '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):
@@ -73064,189 +76105,183 @@ 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 SecurityGroupReferenceDeleted object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'SnapshotCollectionFirst') -> 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: 'SnapshotCollectionFirst') -> bool:
+ def __ne__(self, other: 'SecurityGroupReferenceDeleted') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class SnapshotCollectionNext:
+class SecurityGroupRule:
"""
- A link to the next page of resources. This property is present for all pages except
- the last page.
+ SecurityGroupRule.
- :attr str href: The URL for a page of resources.
+ :param str direction: The direction of traffic to enforce.
+ :param str href: The URL for this security group rule.
+ :param str id: The unique identifier for this security group rule.
+ :param str ip_version: The IP version to enforce. The format of `remote.address`
+ or `remote.cidr_block` must match this property, if they are used.
+ Alternatively, if `remote` references a security group, then this rule only
+ applies to IP addresses (network interfaces) in that group matching this IP
+ version.
+ :param str protocol: The protocol to enforce.
+ :param SecurityGroupRuleRemote remote: The remote IP addresses or security
+ groups from which this rule allows traffic (or to
+ which, for outbound rules). A CIDR block of `0.0.0.0/0` allows traffic from any
+ source
+ (or to any destination, for outbound rules).
"""
def __init__(
self,
+ direction: str,
href: str,
+ id: str,
+ ip_version: str,
+ protocol: str,
+ remote: 'SecurityGroupRuleRemote',
) -> None:
"""
- Initialize a SnapshotCollectionNext object.
+ Initialize a SecurityGroupRule object.
- :param str href: The URL for a page of resources.
+ :param str direction: The direction of traffic to enforce.
+ :param str href: The URL for this security group rule.
+ :param str id: The unique identifier for this security group rule.
+ :param str ip_version: The IP version to enforce. The format of
+ `remote.address` or `remote.cidr_block` must match this property, if they
+ are used. Alternatively, if `remote` references a security group, then this
+ rule only applies to IP addresses (network interfaces) in that group
+ matching this IP version.
+ :param str protocol: The protocol to enforce.
+ :param SecurityGroupRuleRemote remote: The remote IP addresses or security
+ groups from which this rule allows traffic (or to
+ which, for outbound rules). A CIDR block of `0.0.0.0/0` allows traffic from
+ any source
+ (or to any destination, for outbound rules).
"""
- self.href = href
+ 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) -> '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 SnapshotCollectionNext 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 SnapshotCollectionNext 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, 'href') and self.href is not None:
- _dict['href'] = self.href
- return _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)
- 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.
+ """
- def __str__(self) -> str:
- """Return a `str` version of this SnapshotCollectionNext object."""
- return json.dumps(self.to_dict(), indent=2)
+ INBOUND = 'inbound'
+ OUTBOUND = 'outbound'
- 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: 'SnapshotCollectionNext') -> bool:
- """Return `true` when self and other are not equal, false otherwise."""
- return not self == other
+ 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 SnapshotCopiesItem:
+
+ class ProtocolEnum(str, Enum):
+ """
+ The protocol to enforce.
+ """
+
+ ALL = 'all'
+ ICMP = 'icmp'
+ TCP = 'tcp'
+ UDP = 'udp'
+
+
+
+class SecurityGroupRuleCollection:
"""
- SnapshotCopiesItem.
+ Collection of rules in a security group.
- :attr str crn: The CRN for the copied snapshot.
- :attr SnapshotReferenceDeleted deleted: (optional) If present, this property
- indicates the referenced resource has been deleted, and provides
- some supplementary information.
- :attr str href: The URL for the copied snapshot.
- :attr str id: The unique identifier for the copied snapshot.
- :attr str name: The name for the copied snapshot.
- :attr SnapshotRemote remote: (optional) If present, this property indicates that
- the resource associated with this reference
- is remote and therefore may not be directly retrievable.
- :attr str resource_type: The resource type.
+ :param List[SecurityGroupRule] rules: Array of rules.
"""
def __init__(
self,
- crn: str,
- href: str,
- id: str,
- name: str,
- resource_type: str,
- *,
- deleted: 'SnapshotReferenceDeleted' = None,
- remote: 'SnapshotRemote' = None,
+ rules: List['SecurityGroupRule'],
) -> None:
"""
- Initialize a SnapshotCopiesItem object.
+ Initialize a SecurityGroupRuleCollection object.
- :param str crn: The CRN for the copied snapshot.
- :param str href: The URL for the copied snapshot.
- :param str id: The unique identifier for the copied snapshot.
- :param str name: The name for the copied snapshot.
- :param str resource_type: The resource type.
- :param SnapshotReferenceDeleted deleted: (optional) If present, this
- property indicates the referenced resource has been deleted, and provides
- some supplementary information.
- :param SnapshotRemote remote: (optional) If present, this property
- indicates that the resource associated with this reference
- is remote and therefore may not be directly retrievable.
+ :param List[SecurityGroupRule] rules: Array of rules.
"""
- self.crn = crn
- self.deleted = deleted
- self.href = href
- self.id = id
- self.name = name
- self.remote = remote
- self.resource_type = resource_type
+ self.rules = rules
@classmethod
- def from_dict(cls, _dict: Dict) -> 'SnapshotCopiesItem':
- """Initialize a SnapshotCopiesItem object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'SecurityGroupRuleCollection':
+ """Initialize a SecurityGroupRuleCollection object from a json dictionary."""
args = {}
- if 'crn' in _dict:
- args['crn'] = _dict.get('crn')
- else:
- raise ValueError('Required property \'crn\' not present in SnapshotCopiesItem JSON')
- if 'deleted' in _dict:
- args['deleted'] = SnapshotReferenceDeleted.from_dict(_dict.get('deleted'))
- if 'href' in _dict:
- args['href'] = _dict.get('href')
- else:
- raise ValueError('Required property \'href\' not present in SnapshotCopiesItem JSON')
- if 'id' in _dict:
- args['id'] = _dict.get('id')
- else:
- raise ValueError('Required property \'id\' not present in SnapshotCopiesItem JSON')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
- else:
- raise ValueError('Required property \'name\' not present in SnapshotCopiesItem JSON')
- if 'remote' in _dict:
- args['remote'] = SnapshotRemote.from_dict(_dict.get('remote'))
- if 'resource_type' in _dict:
- args['resource_type'] = _dict.get('resource_type')
+ if (rules := _dict.get('rules')) is not None:
+ args['rules'] = [SecurityGroupRule.from_dict(v) for v in rules]
else:
- raise ValueError('Required property \'resource_type\' not present in SnapshotCopiesItem JSON')
+ raise ValueError('Required property \'rules\' not present in SecurityGroupRuleCollection JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a SnapshotCopiesItem 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, 'crn') and self.crn is not None:
- _dict['crn'] = self.crn
- if hasattr(self, 'deleted') and self.deleted is not None:
- if isinstance(self.deleted, dict):
- _dict['deleted'] = self.deleted
- else:
- _dict['deleted'] = self.deleted.to_dict()
- if hasattr(self, 'href') and self.href is not None:
- _dict['href'] = self.href
- if hasattr(self, 'id') and self.id is not None:
- _dict['id'] = self.id
- if hasattr(self, 'name') and self.name is not None:
- _dict['name'] = self.name
- if hasattr(self, 'remote') and self.remote is not None:
- if isinstance(self.remote, dict):
- _dict['remote'] = self.remote
- else:
- _dict['remote'] = self.remote.to_dict()
- if hasattr(self, 'resource_type') and self.resource_type is not None:
- _dict['resource_type'] = self.resource_type
+ if hasattr(self, 'rules') and self.rules is not None:
+ rules_list = []
+ for v in self.rules:
+ if isinstance(v, dict):
+ rules_list.append(v)
+ else:
+ rules_list.append(v.to_dict())
+ _dict['rules'] = rules_list
return _dict
def _to_dict(self):
@@ -73254,98 +76289,146 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this SnapshotCopiesItem object."""
+ """Return a `str` version of this SecurityGroupRuleCollection object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'SnapshotCopiesItem') -> 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: 'SnapshotCopiesItem') -> bool:
+ def __ne__(self, other: 'SecurityGroupRuleCollection') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class ResourceTypeEnum(str, Enum):
- """
- The resource type.
- """
-
- SNAPSHOT = 'snapshot'
-
-
-
-class SnapshotIdentity:
- """
- Identifies a snapshot by a unique property.
-
- """
-
- def __init__(
- self,
- ) -> None:
- """
- Initialize a SnapshotIdentity object.
-
- """
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['SnapshotIdentityById', 'SnapshotIdentityByCRN', 'SnapshotIdentityByHref'])
- )
- raise Exception(msg)
-
-class SnapshotPatch:
+class SecurityGroupRulePatch:
"""
- SnapshotPatch.
+ SecurityGroupRulePatch.
- :attr str name: (optional) The name for this snapshot. The name must not be used
- by another snapshot in the region.
- :attr List[str] user_tags: (optional) The [user
- tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with this
- snapshot.
+ :param int code: (optional) The ICMP traffic code to allow. If set, `type` must
+ also be set.
+ Specify `null` to remove an existing ICMP traffic code.
+ :param str direction: (optional) The direction of traffic to enforce.
+ :param str ip_version: (optional) The IP version to enforce. The format of
+ `remote.address` or `remote.cidr_block` must match this property, if they are
+ used. Alternatively, if `remote` references a security group, then this rule
+ only applies to IP addresses (network interfaces) in that group matching this IP
+ version.
+ :param int port_max: (optional) The inclusive upper bound of the protocol
+ destination port range. If set, `port_min` must also be set, and must not be
+ larger.
+ Specify `null` to remove an existing upper bound.
+ :param int port_min: (optional) The inclusive lower bound of the protocol
+ destination port range. If set, `port_max` must also be set, and must not be
+ smaller.
+ Specify `null` to remove an existing lower bound.
+ :param SecurityGroupRuleRemotePatch remote: (optional) The remote IP addresses
+ or security groups from which this rule will allow traffic (or to
+ which, for outbound rules). Can be specified as an IP address, a CIDR block, or
+ a
+ security group. A CIDR block of `0.0.0.0/0` will allow traffic from any source
+ (or to
+ any destination, for outbound rules).
+ :param int type: (optional) The ICMP traffic type to allow.
+ Specify `null` to remove an existing ICMP traffic type value.
"""
def __init__(
self,
*,
- name: str = None,
- user_tags: List[str] = None,
+ code: Optional[int] = None,
+ direction: Optional[str] = None,
+ ip_version: Optional[str] = None,
+ port_max: Optional[int] = None,
+ port_min: Optional[int] = None,
+ remote: Optional['SecurityGroupRuleRemotePatch'] = None,
+ type: Optional[int] = None,
) -> None:
"""
- Initialize a SnapshotPatch object.
+ Initialize a SecurityGroupRulePatch object.
- :param str name: (optional) The name for this snapshot. The name must not
- be used by another snapshot in the region.
- :param List[str] user_tags: (optional) The [user
- tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with
- this snapshot.
+ :param int code: (optional) The ICMP traffic code to allow. If set, `type`
+ must also be set.
+ Specify `null` to remove an existing ICMP traffic code.
+ :param str direction: (optional) The direction of traffic to enforce.
+ :param str ip_version: (optional) The IP version to enforce. The format of
+ `remote.address` or `remote.cidr_block` must match this property, if they
+ are used. Alternatively, if `remote` references a security group, then this
+ rule only applies to IP addresses (network interfaces) in that group
+ matching this IP version.
+ :param int port_max: (optional) The inclusive upper bound of the protocol
+ destination port range. If set, `port_min` must also be set, and must not
+ be larger.
+ Specify `null` to remove an existing upper bound.
+ :param int port_min: (optional) The inclusive lower bound of the protocol
+ destination port range. If set, `port_max` must also be set, and must not
+ be smaller.
+ Specify `null` to remove an existing lower bound.
+ :param SecurityGroupRuleRemotePatch remote: (optional) The remote IP
+ addresses or security groups from which this rule will allow traffic (or to
+ which, for outbound rules). Can be specified as an IP address, a CIDR
+ block, or a
+ security group. A CIDR block of `0.0.0.0/0` will allow traffic from any
+ source (or to
+ any destination, for outbound rules).
+ :param int type: (optional) The ICMP traffic type to allow.
+ Specify `null` to remove an existing ICMP traffic type value.
"""
- self.name = name
- self.user_tags = user_tags
+ 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) -> 'SnapshotPatch':
- """Initialize a SnapshotPatch object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'SecurityGroupRulePatch':
+ """Initialize a SecurityGroupRulePatch object from a json dictionary."""
args = {}
- if 'name' in _dict:
- args['name'] = _dict.get('name')
- if 'user_tags' in _dict:
- args['user_tags'] = _dict.get('user_tags')
+ if (code := _dict.get('code')) is not None:
+ args['code'] = code
+ if (direction := _dict.get('direction')) is not None:
+ args['direction'] = direction
+ if (ip_version := _dict.get('ip_version')) is not None:
+ args['ip_version'] = ip_version
+ if (port_max := _dict.get('port_max')) is not None:
+ args['port_max'] = port_max
+ if (port_min := _dict.get('port_min')) is not None:
+ args['port_min'] = port_min
+ if (remote := _dict.get('remote')) is not None:
+ args['remote'] = remote
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a SnapshotPatch 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, 'name') and self.name is not None:
- _dict['name'] = self.name
- if hasattr(self, 'user_tags') and self.user_tags is not None:
- _dict['user_tags'] = self.user_tags
+ if hasattr(self, '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):
@@ -73353,247 +76436,326 @@ 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 SecurityGroupRulePatch object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'SnapshotPatch') -> 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: 'SnapshotPatch') -> bool:
+ def __ne__(self, other: 'SecurityGroupRulePatch') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
+ class DirectionEnum(str, Enum):
+ """
+ The direction of traffic to enforce.
+ """
-class SnapshotPrototype:
- """
- SnapshotPrototype.
+ INBOUND = 'inbound'
+ OUTBOUND = 'outbound'
- :attr List[SnapshotClonePrototype] clones: (optional) Clones to create for this
- snapshot.
- :attr str name: (optional) The name for this snapshot. The name must not be used
- by another snapshot in the region. If unspecified, the name will be a hyphenated
- list of randomly-selected words.
- :attr ResourceGroupIdentity resource_group: (optional) The resource group to
- use. If unspecified, the account's [default resource
- group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be
- used.
- :attr List[str] user_tags: (optional) The [user
- tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with this
- snapshot.
- """
- def __init__(
- self,
- *,
- clones: List['SnapshotClonePrototype'] = None,
- name: str = None,
- resource_group: 'ResourceGroupIdentity' = None,
- user_tags: List[str] = None,
- ) -> None:
+ class IpVersionEnum(str, Enum):
"""
- Initialize a SnapshotPrototype object.
-
- :param List[SnapshotClonePrototype] clones: (optional) Clones to create for
- this snapshot.
- :param str name: (optional) The name for this snapshot. The name must not
- be used by another snapshot in the region. If unspecified, the name will be
- a hyphenated list of randomly-selected words.
- :param ResourceGroupIdentity resource_group: (optional) The resource group
- to use. If unspecified, the account's [default resource
- group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be
- used.
- :param List[str] user_tags: (optional) The [user
- tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with
- this snapshot.
+ 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.
"""
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['SnapshotPrototypeSnapshotBySourceVolume', 'SnapshotPrototypeSnapshotBySourceSnapshot'])
- )
- raise Exception(msg)
+
+ IPV4 = 'ipv4'
-class SnapshotReference:
+
+class SecurityGroupRulePrototype:
"""
- SnapshotReference.
+ SecurityGroupRulePrototype.
- :attr str crn: The CRN of this snapshot.
- :attr SnapshotReferenceDeleted deleted: (optional) If present, this property
- indicates the referenced resource has been deleted, and provides
- some supplementary information.
- :attr str href: The URL for this snapshot.
- :attr str id: The unique identifier for this snapshot.
- :attr str name: The name for this snapshot. The name is unique across all
- snapshots in the region.
- :attr SnapshotRemote remote: (optional) If present, this property indicates that
- the resource associated with this reference
- is remote and therefore may not be directly retrievable.
- :attr str resource_type: The resource type.
+ :param str direction: The direction of traffic to enforce.
+ :param str ip_version: (optional) The IP version to enforce. The format of
+ `remote.address` or `remote.cidr_block` must match this property, if they are
+ used. Alternatively, if `remote` references a security group, then this rule
+ only applies to IP addresses (network interfaces) in that group matching this IP
+ version.
+ :param str protocol: The protocol to enforce.
+ :param SecurityGroupRuleRemotePrototype remote: (optional) The remote IP
+ addresses or security groups from which this rule will allow traffic (or to
+ which, for outbound rules). Can be specified as an IP address, a CIDR block, or
+ a
+ security group within the VPC.
+ If unspecified, a CIDR block of `0.0.0.0/0` will be used to allow traffic from
+ any source
+ (or to any destination, for outbound rules).
"""
def __init__(
self,
- crn: str,
- href: str,
- id: str,
- name: str,
- resource_type: str,
+ direction: str,
+ protocol: str,
*,
- deleted: 'SnapshotReferenceDeleted' = None,
- remote: 'SnapshotRemote' = None,
+ ip_version: Optional[str] = None,
+ remote: Optional['SecurityGroupRuleRemotePrototype'] = None,
) -> None:
"""
- Initialize a SnapshotReference object.
+ Initialize a SecurityGroupRulePrototype object.
- :param str crn: The CRN of this snapshot.
- :param str href: The URL for this snapshot.
- :param str id: The unique identifier for this snapshot.
- :param str name: The name for this snapshot. The name is unique across all
- snapshots in the region.
- :param str resource_type: The resource type.
- :param SnapshotReferenceDeleted deleted: (optional) If present, this
- property indicates the referenced resource has been deleted, and provides
- some supplementary information.
- :param SnapshotRemote remote: (optional) If present, this property
- indicates that the resource associated with this reference
- is remote and therefore may not be directly retrievable.
+ :param str direction: The direction of traffic to enforce.
+ :param str protocol: The protocol to enforce.
+ :param str ip_version: (optional) The IP version to enforce. The format of
+ `remote.address` or `remote.cidr_block` must match this property, if they
+ are used. Alternatively, if `remote` references a security group, then this
+ rule only applies to IP addresses (network interfaces) in that group
+ matching this IP version.
+ :param SecurityGroupRuleRemotePrototype remote: (optional) The remote IP
+ addresses or security groups from which this rule will allow traffic (or to
+ which, for outbound rules). Can be specified as an IP address, a CIDR
+ block, or a
+ security group within the VPC.
+ If unspecified, a CIDR block of `0.0.0.0/0` will be used to allow traffic
+ from any source
+ (or to any destination, for outbound rules).
"""
- self.crn = crn
- self.deleted = deleted
- self.href = href
- self.id = id
- self.name = name
- self.remote = remote
- self.resource_type = resource_type
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll', 'SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP', 'SecurityGroupRulePrototypeSecurityGroupRuleProtocolTCPUDP'])
+ )
+ raise Exception(msg)
@classmethod
- def from_dict(cls, _dict: Dict) -> 'SnapshotReference':
- """Initialize a SnapshotReference object from a json dictionary."""
- args = {}
- if 'crn' in _dict:
- args['crn'] = _dict.get('crn')
- else:
- raise ValueError('Required property \'crn\' not present in SnapshotReference JSON')
- if 'deleted' in _dict:
- args['deleted'] = SnapshotReferenceDeleted.from_dict(_dict.get('deleted'))
- if 'href' in _dict:
- args['href'] = _dict.get('href')
- else:
- raise ValueError('Required property \'href\' not present in SnapshotReference JSON')
- if 'id' in _dict:
- args['id'] = _dict.get('id')
- else:
- raise ValueError('Required property \'id\' not present in SnapshotReference JSON')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
- else:
- raise ValueError('Required property \'name\' not present in SnapshotReference JSON')
- if 'remote' in _dict:
- args['remote'] = SnapshotRemote.from_dict(_dict.get('remote'))
- if 'resource_type' in _dict:
- args['resource_type'] = _dict.get('resource_type')
- else:
- raise ValueError('Required property \'resource_type\' not present in SnapshotReference JSON')
- return cls(**args)
+ 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 SnapshotReference 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, 'crn') and self.crn is not None:
- _dict['crn'] = self.crn
- if hasattr(self, 'deleted') and self.deleted is not None:
- if isinstance(self.deleted, dict):
- _dict['deleted'] = self.deleted
- else:
- _dict['deleted'] = self.deleted.to_dict()
- if hasattr(self, 'href') and self.href is not None:
- _dict['href'] = self.href
- if hasattr(self, 'id') and self.id is not None:
- _dict['id'] = self.id
- if hasattr(self, 'name') and self.name is not None:
- _dict['name'] = self.name
- if hasattr(self, 'remote') and self.remote is not None:
- if isinstance(self.remote, dict):
- _dict['remote'] = self.remote
- else:
- _dict['remote'] = self.remote.to_dict()
- if hasattr(self, 'resource_type') and self.resource_type is not None:
- _dict['resource_type'] = self.resource_type
- return _dict
+ @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.
+ """
- def __str__(self) -> str:
- """Return a `str` version of this SnapshotReference object."""
- return json.dumps(self.to_dict(), indent=2)
+ INBOUND = 'inbound'
+ OUTBOUND = 'outbound'
- def __eq__(self, other: 'SnapshotReference') -> bool:
- """Return `true` when self and other are equal, false otherwise."""
- if not isinstance(other, self.__class__):
- return False
- return self.__dict__ == other.__dict__
- def __ne__(self, other: 'SnapshotReference') -> bool:
- """Return `true` when self and other are not equal, false otherwise."""
- return not self == other
+ class 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.
+ """
- class ResourceTypeEnum(str, Enum):
+ IPV4 = 'ipv4'
+
+
+ class ProtocolEnum(str, Enum):
"""
- The resource type.
+ The protocol to enforce.
"""
- SNAPSHOT = 'snapshot'
+ ALL = 'all'
+ ICMP = 'icmp'
+ TCP = 'tcp'
+ UDP = 'udp'
-class SnapshotReferenceDeleted:
+class SecurityGroupRuleRemote:
"""
- If present, this property indicates the referenced resource has been deleted, and
- provides some supplementary information.
+ The remote IP addresses or security groups from which this rule allows traffic (or to
+ which, for outbound rules). A CIDR block of `0.0.0.0/0` allows traffic from any source
+ (or to any destination, for outbound rules).
- :attr str more_info: Link to documentation about deleted resources.
"""
def __init__(
self,
- more_info: str,
) -> None:
"""
- Initialize a SnapshotReferenceDeleted object.
+ Initialize a SecurityGroupRuleRemote object.
- :param str more_info: Link to documentation about deleted resources.
"""
- self.more_info = more_info
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['SecurityGroupRuleRemoteIP', 'SecurityGroupRuleRemoteCIDR', 'SecurityGroupRuleRemoteSecurityGroupReference'])
+ )
+ raise Exception(msg)
+
+
+class SecurityGroupRuleRemotePatch:
+ """
+ The remote IP addresses or security groups from which this rule will allow traffic (or
+ to which, for outbound rules). Can be specified as an IP address, a CIDR block, or a
+ security group. A CIDR block of `0.0.0.0/0` will allow traffic from any source (or to
+ any destination, for outbound rules).
+
+ """
+
+ def __init__(
+ self,
+ ) -> None:
+ """
+ Initialize a SecurityGroupRuleRemotePatch object.
+
+ """
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['SecurityGroupRuleRemotePatchIP', 'SecurityGroupRuleRemotePatchCIDR', 'SecurityGroupRuleRemotePatchSecurityGroupIdentity'])
+ )
+ raise Exception(msg)
+
+
+class SecurityGroupRuleRemotePrototype:
+ """
+ The remote IP addresses or security groups from which this rule will allow traffic (or
+ to which, for outbound rules). Can be specified as an IP address, a CIDR block, or a
+ security group within the VPC.
+ If unspecified, a CIDR block of `0.0.0.0/0` will be used to allow traffic from any
+ source
+ (or to any destination, for outbound rules).
+
+ """
+
+ def __init__(
+ self,
+ ) -> None:
+ """
+ Initialize a SecurityGroupRuleRemotePrototype object.
+
+ """
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['SecurityGroupRuleRemotePrototypeIP', 'SecurityGroupRuleRemotePrototypeCIDR', 'SecurityGroupRuleRemotePrototypeSecurityGroupIdentity'])
+ )
+ raise Exception(msg)
+
+
+class SecurityGroupTargetCollection:
+ """
+ SecurityGroupTargetCollection.
+
+ :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 SecurityGroupTargetCollectionNext next: (optional) A link to the next
+ page of resources. This property is present for all pages
+ except the last page.
+ :param List[SecurityGroupTargetReference] targets: Collection of targets for
+ this security group.
+ :param int total_count: The total number of resources across all pages.
+ """
+
+ def __init__(
+ self,
+ first: 'SecurityGroupTargetCollectionFirst',
+ limit: int,
+ targets: List['SecurityGroupTargetReference'],
+ total_count: int,
+ *,
+ next: Optional['SecurityGroupTargetCollectionNext'] = None,
+ ) -> None:
+ """
+ Initialize a SecurityGroupTargetCollection 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.
+ """
+ self.first = first
+ self.limit = limit
+ self.next = next
+ self.targets = targets
+ self.total_count = total_count
@classmethod
- def from_dict(cls, _dict: Dict) -> 'SnapshotReferenceDeleted':
- """Initialize a SnapshotReferenceDeleted object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'SecurityGroupTargetCollection':
+ """Initialize a SecurityGroupTargetCollection object from a json dictionary."""
args = {}
- if 'more_info' in _dict:
- args['more_info'] = _dict.get('more_info')
+ if (first := _dict.get('first')) is not None:
+ args['first'] = SecurityGroupTargetCollectionFirst.from_dict(first)
else:
- raise ValueError('Required property \'more_info\' not present in SnapshotReferenceDeleted JSON')
+ raise ValueError('Required property \'first\' not present in SecurityGroupTargetCollection JSON')
+ if (limit := _dict.get('limit')) is not None:
+ args['limit'] = limit
+ else:
+ raise ValueError('Required property \'limit\' not present in SecurityGroupTargetCollection JSON')
+ if (next := _dict.get('next')) is not None:
+ args['next'] = SecurityGroupTargetCollectionNext.from_dict(next)
+ if (targets := _dict.get('targets')) is not None:
+ args['targets'] = targets
+ else:
+ raise ValueError('Required property \'targets\' not present in SecurityGroupTargetCollection JSON')
+ if (total_count := _dict.get('total_count')) is not None:
+ args['total_count'] = total_count
+ else:
+ raise ValueError('Required property \'total_count\' not present in SecurityGroupTargetCollection JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a SnapshotReferenceDeleted object from a json dictionary."""
+ """Initialize a SecurityGroupTargetCollection object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'more_info') and self.more_info is not None:
- _dict['more_info'] = self.more_info
+ if hasattr(self, 'first') and self.first is not None:
+ if isinstance(self.first, dict):
+ _dict['first'] = self.first
+ else:
+ _dict['first'] = self.first.to_dict()
+ if hasattr(self, 'limit') and self.limit is not None:
+ _dict['limit'] = self.limit
+ if hasattr(self, 'next') and self.next is not None:
+ if isinstance(self.next, dict):
+ _dict['next'] = self.next
+ else:
+ _dict['next'] = self.next.to_dict()
+ if hasattr(self, 'targets') and self.targets is not None:
+ targets_list = []
+ for v in self.targets:
+ if isinstance(v, dict):
+ targets_list.append(v)
+ else:
+ targets_list.append(v.to_dict())
+ _dict['targets'] = targets_list
+ if hasattr(self, 'total_count') and self.total_count is not None:
+ _dict['total_count'] = self.total_count
return _dict
def _to_dict(self):
@@ -73601,65 +76763,58 @@ 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 SecurityGroupTargetCollection object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'SnapshotReferenceDeleted') -> 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: 'SnapshotReferenceDeleted') -> bool:
+ def __ne__(self, other: 'SecurityGroupTargetCollection') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class SnapshotRemote:
+class SecurityGroupTargetCollectionFirst:
"""
- If present, this property indicates that the resource associated with this reference
- is remote and therefore may not be directly retrievable.
+ A link to the first page of resources.
- :attr RegionReference region: (optional) If present, this property indicates
- that the referenced resource is remote to this
- region, and identifies the native region.
+ :param str href: The URL for a page of resources.
"""
def __init__(
self,
- *,
- region: 'RegionReference' = None,
+ href: str,
) -> None:
"""
- Initialize a SnapshotRemote object.
+ Initialize a SecurityGroupTargetCollectionFirst object.
- :param RegionReference region: (optional) If present, this property
- indicates that the referenced resource is remote to this
- region, and identifies the native region.
+ :param str href: The URL for a page of resources.
"""
- self.region = region
+ self.href = href
@classmethod
- def from_dict(cls, _dict: Dict) -> 'SnapshotRemote':
- """Initialize a SnapshotRemote object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'SecurityGroupTargetCollectionFirst':
+ """Initialize a SecurityGroupTargetCollectionFirst object from a json dictionary."""
args = {}
- if 'region' in _dict:
- args['region'] = RegionReference.from_dict(_dict.get('region'))
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
+ else:
+ raise ValueError('Required property \'href\' not present in SecurityGroupTargetCollectionFirst JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a SnapshotRemote 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, 'region') and self.region is not None:
- if isinstance(self.region, dict):
- _dict['region'] = self.region
- else:
- _dict['region'] = self.region.to_dict()
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
return _dict
def _to_dict(self):
@@ -73667,131 +76822,59 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this SnapshotRemote object."""
+ """Return a `str` version of this SecurityGroupTargetCollectionFirst object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'SnapshotRemote') -> 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: 'SnapshotRemote') -> bool:
+ def __ne__(self, other: 'SecurityGroupTargetCollectionFirst') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class SnapshotSourceSnapshot:
+class SecurityGroupTargetCollectionNext:
"""
- If present, the source snapshot this snapshot was created from.
+ A link to the next page of resources. This property is present for all pages except
+ the last page.
- :attr str crn: The CRN of the source snapshot.
- :attr SnapshotReferenceDeleted deleted: (optional) If present, this property
- indicates the referenced resource has been deleted, and provides
- some supplementary information.
- :attr str href: The URL for the source snapshot.
- :attr str id: The unique identifier for the source snapshot.
- :attr str name: The name for the source snapshot. The name is unique across all
- snapshots in the source snapshot's native region.
- :attr SnapshotRemote remote: (optional) If present, this property indicates that
- the resource associated with this reference
- is remote and therefore may not be directly retrievable.
- :attr str resource_type: The resource type.
+ :param str href: The URL for a page of resources.
"""
def __init__(
self,
- crn: str,
href: str,
- id: str,
- name: str,
- resource_type: str,
- *,
- deleted: 'SnapshotReferenceDeleted' = None,
- remote: 'SnapshotRemote' = None,
) -> None:
"""
- Initialize a SnapshotSourceSnapshot object.
+ Initialize a SecurityGroupTargetCollectionNext object.
- :param str crn: The CRN of the source snapshot.
- :param str href: The URL for the source snapshot.
- :param str id: The unique identifier for the source snapshot.
- :param str name: The name for the source snapshot. The name is unique
- across all snapshots in the source snapshot's native region.
- :param str resource_type: The resource type.
- :param SnapshotReferenceDeleted deleted: (optional) If present, this
- property indicates the referenced resource has been deleted, and provides
- some supplementary information.
- :param SnapshotRemote remote: (optional) If present, this property
- indicates that the resource associated with this reference
- is remote and therefore may not be directly retrievable.
+ :param 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.remote = remote
- self.resource_type = resource_type
@classmethod
- def from_dict(cls, _dict: Dict) -> 'SnapshotSourceSnapshot':
- """Initialize a SnapshotSourceSnapshot object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'SecurityGroupTargetCollectionNext':
+ """Initialize a SecurityGroupTargetCollectionNext object from a json dictionary."""
args = {}
- if 'crn' in _dict:
- args['crn'] = _dict.get('crn')
- else:
- raise ValueError('Required property \'crn\' not present in SnapshotSourceSnapshot JSON')
- if 'deleted' in _dict:
- args['deleted'] = SnapshotReferenceDeleted.from_dict(_dict.get('deleted'))
- if 'href' in _dict:
- args['href'] = _dict.get('href')
- else:
- raise ValueError('Required property \'href\' not present in SnapshotSourceSnapshot JSON')
- if 'id' in _dict:
- args['id'] = _dict.get('id')
- else:
- raise ValueError('Required property \'id\' not present in SnapshotSourceSnapshot JSON')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'name\' not present in SnapshotSourceSnapshot JSON')
- if 'remote' in _dict:
- args['remote'] = SnapshotRemote.from_dict(_dict.get('remote'))
- if 'resource_type' in _dict:
- args['resource_type'] = _dict.get('resource_type')
- else:
- raise ValueError('Required property \'resource_type\' not present in SnapshotSourceSnapshot JSON')
+ raise ValueError('Required property \'href\' not present in SecurityGroupTargetCollectionNext JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a SnapshotSourceSnapshot object from a json dictionary."""
+ """Initialize a SecurityGroupTargetCollectionNext object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'crn') and self.crn is not None:
- _dict['crn'] = self.crn
- if hasattr(self, 'deleted') and self.deleted is not None:
- if isinstance(self.deleted, dict):
- _dict['deleted'] = self.deleted
- else:
- _dict['deleted'] = self.deleted.to_dict()
if hasattr(self, 'href') and self.href is not None:
_dict['href'] = self.href
- if hasattr(self, 'id') and self.id is not None:
- _dict['id'] = self.id
- if hasattr(self, 'name') and self.name is not None:
- _dict['name'] = self.name
- if hasattr(self, 'remote') and self.remote is not None:
- if isinstance(self.remote, dict):
- _dict['remote'] = self.remote
- else:
- _dict['remote'] = self.remote.to_dict()
- if hasattr(self, 'resource_type') and self.resource_type is not None:
- _dict['resource_type'] = self.resource_type
return _dict
def _to_dict(self):
@@ -73799,237 +76882,424 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this SnapshotSourceSnapshot object."""
+ """Return a `str` version of this SecurityGroupTargetCollectionNext object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'SnapshotSourceSnapshot') -> 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: 'SnapshotSourceSnapshot') -> bool:
+ def __ne__(self, other: 'SecurityGroupTargetCollectionNext') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class ResourceTypeEnum(str, Enum):
- """
- The resource type.
- """
- SNAPSHOT = 'snapshot'
+class 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.
-class Subnet:
+ """
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext', 'SecurityGroupTargetReferenceBareMetalServerNetworkInterfaceReferenceTargetContext', 'SecurityGroupTargetReferenceLoadBalancerReference', 'SecurityGroupTargetReferenceEndpointGatewayReference', 'SecurityGroupTargetReferenceVPNServerReference', 'SecurityGroupTargetReferenceVirtualNetworkInterfaceReference'])
+ )
+ raise Exception(msg)
+
+
+class Share:
"""
- Subnet.
+ Share.
- :attr int available_ipv4_address_count: The number of IPv4 addresses in this
- subnet that are not in-use, and have not been reserved by the user or the
- provider.
- :attr datetime created_at: The date and time that the subnet was created.
- :attr str crn: The CRN for this subnet.
- :attr str href: The URL for this subnet.
- :attr str id: The unique identifier for this subnet.
- :attr str ip_version: The IP version(s) supported by this subnet.
- :attr str ipv4_cidr_block: The IPv4 range of the subnet, expressed in CIDR
- format.
- :attr str name: The name for this subnet. The name is unique across all subnets
- in the VPC.
- :attr NetworkACLReference network_acl: The network ACL for this subnet.
- :attr PublicGatewayReference public_gateway: (optional) The public gateway to
- use for internet-bound traffic for this subnet.
- :attr ResourceGroupReference resource_group: The resource group for this subnet.
- :attr str resource_type: The resource type.
- :attr RoutingTableReference routing_table: The routing table for this subnet.
- :attr str status: The status of the subnet.
- :attr int total_ipv4_address_count: The total number of IPv4 addresses in this
- subnet.
- Note: This is calculated as 2(32 - prefix length). For example, the
- prefix length `/24` gives:
2(32 - 24) = 28 = 256
- addresses.
- :attr VPCReference vpc: The VPC this subnet resides in.
- :attr ZoneReference zone: The zone this subnet resides in.
+ :param str access_control_mode: The access control mode for the share:
+ - `security_group`: The security groups on the virtual network interface for a
+ mount
+ target control access to the mount target.
+ - `vpc`: All clients in the VPC for a mount target have access to the mount
+ target.
+ The enumerated access control mode values for this property may expand in the
+ future. When processing this property, check for and log unknown values.
+ Optionally halt processing and surface the error, or bypass the resource on
+ which the unexpected access control mode was encountered.
+ :param datetime created_at: The date and time that the file share is created.
+ :param str crn: The CRN for this file share.
+ :param str encryption: The type of encryption used for this file share.
+ :param EncryptionKeyReference encryption_key: (optional) The key used to encrypt
+ this file share.
+ This property will be present if `encryption_type` is `user_managed`.
+ :param str href: The URL for this file share.
+ :param str id: The unique identifier for this file share.
+ :param int iops: The maximum input/output operations per second (IOPS) for the
+ file share. In addition, each client accessing the share will be restricted to
+ 48,000 IOPS.
+ The maximum IOPS for a share may increase in the future.
+ :param ShareJob latest_job: (optional) The latest job associated with this file
+ share.
+ This property will be absent if no jobs have been created for this file share.
+ :param ShareLatestSync latest_sync: (optional) Information about the latest
+ synchronization for this file share.
+ This property will be present when the `replication_role` is `replica` and at
+ least
+ one replication sync has been completed.
+ :param str lifecycle_state: The lifecycle state of the file share.
+ :param List[ShareMountTargetReference] mount_targets: The mount targets for the
+ file share.
+ :param str name: The name for this share. The name is unique across all shares
+ in the region.
+ :param ShareProfileReference profile: The
+ [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-profiles) for
+ this file share.
+ :param ShareReference replica_share: (optional) The replica file share for this
+ source file share.
+ This property will be present when the `replication_role` is `source`.
+ :param str replication_cron_spec: (optional) The cron specification for the file
+ share replication schedule.
+ This property will be present when the `replication_role` is `replica`.
+ :param str replication_role: The replication role of the file share.
+ * `none`: This share is not participating in replication.
+ * `replica`: This share is a replication target.
+ * `source`: This share is a replication source.
+ :param str replication_status: The replication status of the file share.
+ * `active`: This share is actively participating in replication, and the
+ replica's data is up-to-date with the replication schedule.
+ * `degraded`: This is share is participating in replication, but the replica's
+ data has fallen behind the replication schedule.
+ * `failover_pending`: This share is performing a replication failover.
+ * `initializing`: This share is initializing replication.
+ * `none`: This share is not participating in replication.
+ * `split_pending`: This share is performing a replication split.
+ :param List[ShareReplicationStatusReason] replication_status_reasons: The
+ reasons for the current replication status (if any).
+ The enumerated reason code values for this property will expand in the future.
+ When processing this property, check for and log unknown values. Optionally halt
+ processing and surface the error, or bypass the resource on which the unexpected
+ reason code was encountered.
+ :param ResourceGroupReference resource_group: The resource group for this file
+ share.
+ :param str resource_type: The resource type.
+ :param int size: The size of the file share rounded up to the next gigabyte.
+ The maximum size for a share may increase in the future.
+ :param ShareReference source_share: (optional) The source file share for this
+ replica file share.
+ This property will be present when the `replication_role` is `replica`.
+ :param List[str] user_tags: Tags for this resource.
+ :param ZoneReference zone: The zone this file share will reside in.
"""
def __init__(
self,
- available_ipv4_address_count: int,
+ access_control_mode: str,
created_at: datetime,
crn: str,
+ encryption: str,
href: str,
id: str,
- ip_version: str,
- ipv4_cidr_block: str,
+ iops: int,
+ lifecycle_state: str,
+ mount_targets: List['ShareMountTargetReference'],
name: str,
- network_acl: 'NetworkACLReference',
+ profile: 'ShareProfileReference',
+ replication_role: str,
+ replication_status: str,
+ replication_status_reasons: List['ShareReplicationStatusReason'],
resource_group: 'ResourceGroupReference',
resource_type: str,
- routing_table: 'RoutingTableReference',
- status: str,
- total_ipv4_address_count: int,
- vpc: 'VPCReference',
+ size: int,
+ user_tags: List[str],
zone: 'ZoneReference',
*,
- public_gateway: 'PublicGatewayReference' = None,
+ encryption_key: Optional['EncryptionKeyReference'] = None,
+ latest_job: Optional['ShareJob'] = None,
+ latest_sync: Optional['ShareLatestSync'] = None,
+ replica_share: Optional['ShareReference'] = None,
+ replication_cron_spec: Optional[str] = None,
+ source_share: Optional['ShareReference'] = None,
) -> None:
"""
- Initialize a Subnet object.
+ Initialize a Share object.
- :param int available_ipv4_address_count: The number of IPv4 addresses in
- this subnet that are not in-use, and have not been reserved by the user or
- the provider.
- :param datetime created_at: The date and time that the subnet was created.
- :param str crn: The CRN for this subnet.
- :param str href: The URL for this subnet.
- :param str id: The unique identifier for this subnet.
- :param str ip_version: The IP version(s) supported by this subnet.
- :param str ipv4_cidr_block: The IPv4 range of the subnet, expressed in CIDR
- format.
- :param str name: The name for this subnet. The name is unique across all
- subnets in the VPC.
- :param NetworkACLReference network_acl: The network ACL for this subnet.
- :param ResourceGroupReference resource_group: The resource group for this
- subnet.
+ :param str access_control_mode: The access control mode for the share:
+ - `security_group`: The security groups on the virtual network interface
+ for a mount
+ target control access to the mount target.
+ - `vpc`: All clients in the VPC for a mount target have access to the mount
+ target.
+ The enumerated access control mode values for this property may expand in
+ the future. When processing this property, check for and log unknown
+ values. Optionally halt processing and surface the error, or bypass the
+ resource on which the unexpected access control mode was encountered.
+ :param datetime created_at: The date and time that the file share is
+ created.
+ :param str crn: The CRN for this file share.
+ :param str encryption: The type of encryption used for this file share.
+ :param str href: The URL for this file share.
+ :param str id: The unique identifier for this file share.
+ :param int iops: The maximum input/output operations per second (IOPS) for
+ the file share. In addition, each client accessing the share will be
+ restricted to 48,000 IOPS.
+ The maximum IOPS for a share may increase in the future.
+ :param str lifecycle_state: The lifecycle state of the file share.
+ :param List[ShareMountTargetReference] mount_targets: The mount targets for
+ the file share.
+ :param str name: The name for this share. The name is unique across all
+ shares in the region.
+ :param ShareProfileReference profile: The
+ [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-profiles)
+ for
+ this file share.
+ :param str replication_role: The replication role of the file share.
+ * `none`: This share is not participating in replication.
+ * `replica`: This share is a replication target.
+ * `source`: This share is a replication source.
+ :param str replication_status: The replication status of the file share.
+ * `active`: This share is actively participating in replication, and the
+ replica's data is up-to-date with the replication schedule.
+ * `degraded`: This is share is participating in replication, but the
+ replica's data has fallen behind the replication schedule.
+ * `failover_pending`: This share is performing a replication failover.
+ * `initializing`: This share is initializing replication.
+ * `none`: This share is not participating in replication.
+ * `split_pending`: This share is performing a replication split.
+ :param List[ShareReplicationStatusReason] replication_status_reasons: The
+ reasons for the current replication status (if any).
+ The enumerated reason code values for this property will expand in the
+ future. When processing this property, check for and log unknown values.
+ Optionally halt processing and surface the error, or bypass the resource on
+ which the unexpected reason code was encountered.
+ :param ResourceGroupReference resource_group: The resource group for this
+ file share.
:param str resource_type: The resource type.
- :param RoutingTableReference routing_table: The routing table for this
- subnet.
- :param str status: The status of the subnet.
- :param int total_ipv4_address_count: The total number of IPv4 addresses in
- this subnet.
- Note: This is calculated as 2(32 - prefix length). For example,
- the prefix length `/24` gives:
2(32 - 24) = 28 =
- 256 addresses.
- :param VPCReference vpc: The VPC this subnet resides in.
- :param ZoneReference zone: The zone this subnet resides in.
- :param PublicGatewayReference public_gateway: (optional) The public gateway
- to use for internet-bound traffic for this subnet.
+ :param int size: The size of the file share rounded up to the next
+ gigabyte.
+ The maximum size for a share may increase in the future.
+ :param List[str] user_tags: Tags for this resource.
+ :param ZoneReference zone: The zone this file share will reside in.
+ :param EncryptionKeyReference encryption_key: (optional) The key used to
+ encrypt this file share.
+ This property will be present if `encryption_type` is `user_managed`.
+ :param ShareJob latest_job: (optional) The latest job associated with this
+ file share.
+ This property will be absent if no jobs have been created for this file
+ share.
+ :param ShareLatestSync latest_sync: (optional) Information about the latest
+ synchronization for this file share.
+ This property will be present when the `replication_role` is `replica` and
+ at least
+ one replication sync has been completed.
+ :param ShareReference replica_share: (optional) The replica file share for
+ this source file share.
+ This property will be present when the `replication_role` is `source`.
+ :param str replication_cron_spec: (optional) The cron specification for the
+ file share replication schedule.
+ This property will be present when the `replication_role` is `replica`.
+ :param ShareReference source_share: (optional) The source file share for
+ this replica file share.
+ This property will be present when the `replication_role` is `replica`.
"""
- self.available_ipv4_address_count = available_ipv4_address_count
+ self.access_control_mode = access_control_mode
self.created_at = created_at
self.crn = crn
+ self.encryption = encryption
+ self.encryption_key = encryption_key
self.href = href
self.id = id
- self.ip_version = ip_version
- self.ipv4_cidr_block = ipv4_cidr_block
+ self.iops = iops
+ self.latest_job = latest_job
+ self.latest_sync = latest_sync
+ self.lifecycle_state = lifecycle_state
+ self.mount_targets = mount_targets
self.name = name
- self.network_acl = network_acl
- self.public_gateway = public_gateway
+ self.profile = profile
+ self.replica_share = replica_share
+ self.replication_cron_spec = replication_cron_spec
+ self.replication_role = replication_role
+ self.replication_status = replication_status
+ self.replication_status_reasons = replication_status_reasons
self.resource_group = resource_group
self.resource_type = resource_type
- self.routing_table = routing_table
- self.status = status
- self.total_ipv4_address_count = total_ipv4_address_count
- self.vpc = vpc
+ self.size = size
+ self.source_share = source_share
+ self.user_tags = user_tags
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) -> 'Share':
+ """Initialize a Share object from a json dictionary."""
args = {}
- if 'available_ipv4_address_count' in _dict:
- args['available_ipv4_address_count'] = _dict.get('available_ipv4_address_count')
+ if (access_control_mode := _dict.get('access_control_mode')) is not None:
+ args['access_control_mode'] = access_control_mode
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'))
+ raise ValueError('Required property \'access_control_mode\' not present in Share JSON')
+ if (created_at := _dict.get('created_at')) is not None:
+ args['created_at'] = string_to_datetime(created_at)
else:
- raise ValueError('Required property \'created_at\' not present in Subnet JSON')
- if 'crn' in _dict:
- args['crn'] = _dict.get('crn')
+ raise ValueError('Required property \'created_at\' not present in Share JSON')
+ if (crn := _dict.get('crn')) is not None:
+ args['crn'] = crn
else:
- raise ValueError('Required property \'crn\' not present in Subnet JSON')
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ raise ValueError('Required property \'crn\' not present in Share JSON')
+ if (encryption := _dict.get('encryption')) is not None:
+ args['encryption'] = encryption
else:
- raise ValueError('Required property \'href\' not present in Subnet JSON')
- if 'id' in _dict:
- args['id'] = _dict.get('id')
+ raise ValueError('Required property \'encryption\' not present in Share JSON')
+ if (encryption_key := _dict.get('encryption_key')) is not None:
+ args['encryption_key'] = EncryptionKeyReference.from_dict(encryption_key)
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'id\' not present in Subnet JSON')
- if 'ip_version' in _dict:
- args['ip_version'] = _dict.get('ip_version')
+ raise ValueError('Required property \'href\' not present in Share JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
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')
+ raise ValueError('Required property \'id\' not present in Share JSON')
+ if (iops := _dict.get('iops')) is not None:
+ args['iops'] = iops
else:
- raise ValueError('Required property \'ipv4_cidr_block\' not present in Subnet JSON')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
+ raise ValueError('Required property \'iops\' not present in Share JSON')
+ if (latest_job := _dict.get('latest_job')) is not None:
+ args['latest_job'] = ShareJob.from_dict(latest_job)
+ if (latest_sync := _dict.get('latest_sync')) is not None:
+ args['latest_sync'] = ShareLatestSync.from_dict(latest_sync)
+ if (lifecycle_state := _dict.get('lifecycle_state')) is not None:
+ args['lifecycle_state'] = lifecycle_state
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'))
+ raise ValueError('Required property \'lifecycle_state\' not present in Share JSON')
+ if (mount_targets := _dict.get('mount_targets')) is not None:
+ args['mount_targets'] = [ShareMountTargetReference.from_dict(v) for v in mount_targets]
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'))
+ raise ValueError('Required property \'mount_targets\' not present in Share JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
else:
- raise ValueError('Required property \'resource_group\' not present in Subnet JSON')
- if 'resource_type' in _dict:
- args['resource_type'] = _dict.get('resource_type')
+ raise ValueError('Required property \'name\' not present in Share JSON')
+ if (profile := _dict.get('profile')) is not None:
+ args['profile'] = ShareProfileReference.from_dict(profile)
else:
- raise ValueError('Required property \'resource_type\' not present in Subnet JSON')
- if 'routing_table' in _dict:
- args['routing_table'] = RoutingTableReference.from_dict(_dict.get('routing_table'))
+ raise ValueError('Required property \'profile\' not present in Share JSON')
+ if (replica_share := _dict.get('replica_share')) is not None:
+ args['replica_share'] = ShareReference.from_dict(replica_share)
+ if (replication_cron_spec := _dict.get('replication_cron_spec')) is not None:
+ args['replication_cron_spec'] = replication_cron_spec
+ if (replication_role := _dict.get('replication_role')) is not None:
+ args['replication_role'] = replication_role
else:
- raise ValueError('Required property \'routing_table\' not present in Subnet JSON')
- if 'status' in _dict:
- args['status'] = _dict.get('status')
+ raise ValueError('Required property \'replication_role\' not present in Share JSON')
+ if (replication_status := _dict.get('replication_status')) is not None:
+ args['replication_status'] = replication_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')
+ raise ValueError('Required property \'replication_status\' not present in Share JSON')
+ if (replication_status_reasons := _dict.get('replication_status_reasons')) is not None:
+ args['replication_status_reasons'] = [ShareReplicationStatusReason.from_dict(v) for v in replication_status_reasons]
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'))
+ raise ValueError('Required property \'replication_status_reasons\' not present in Share JSON')
+ if (resource_group := _dict.get('resource_group')) is not None:
+ args['resource_group'] = ResourceGroupReference.from_dict(resource_group)
else:
- raise ValueError('Required property \'vpc\' not present in Subnet JSON')
- if 'zone' in _dict:
- args['zone'] = ZoneReference.from_dict(_dict.get('zone'))
+ raise ValueError('Required property \'resource_group\' not present in Share JSON')
+ if (resource_type := _dict.get('resource_type')) is not None:
+ args['resource_type'] = resource_type
else:
- raise ValueError('Required property \'zone\' not present in Subnet JSON')
+ raise ValueError('Required property \'resource_type\' not present in Share JSON')
+ if (size := _dict.get('size')) is not None:
+ args['size'] = size
+ else:
+ raise ValueError('Required property \'size\' not present in Share JSON')
+ if (source_share := _dict.get('source_share')) is not None:
+ args['source_share'] = ShareReference.from_dict(source_share)
+ if (user_tags := _dict.get('user_tags')) is not None:
+ args['user_tags'] = user_tags
+ else:
+ raise ValueError('Required property \'user_tags\' not present in Share JSON')
+ if (zone := _dict.get('zone')) is not None:
+ args['zone'] = ZoneReference.from_dict(zone)
+ else:
+ raise ValueError('Required property \'zone\' not present in Share JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a Subnet object from a json dictionary."""
+ """Initialize a Share object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, '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, 'access_control_mode') and self.access_control_mode is not None:
+ _dict['access_control_mode'] = self.access_control_mode
if hasattr(self, 'created_at') and self.created_at is not None:
_dict['created_at'] = datetime_to_string(self.created_at)
if hasattr(self, 'crn') and self.crn is not None:
_dict['crn'] = self.crn
+ if hasattr(self, 'encryption') and self.encryption is not None:
+ _dict['encryption'] = self.encryption
+ if hasattr(self, 'encryption_key') and self.encryption_key is not None:
+ if isinstance(self.encryption_key, dict):
+ _dict['encryption_key'] = self.encryption_key
+ else:
+ _dict['encryption_key'] = self.encryption_key.to_dict()
if hasattr(self, 'href') and self.href is not None:
_dict['href'] = self.href
if hasattr(self, 'id') and self.id is not None:
_dict['id'] = self.id
- if hasattr(self, '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, 'iops') and self.iops is not None:
+ _dict['iops'] = self.iops
+ if hasattr(self, 'latest_job') and self.latest_job is not None:
+ if isinstance(self.latest_job, dict):
+ _dict['latest_job'] = self.latest_job
+ else:
+ _dict['latest_job'] = self.latest_job.to_dict()
+ if hasattr(self, 'latest_sync') and self.latest_sync is not None:
+ if isinstance(self.latest_sync, dict):
+ _dict['latest_sync'] = self.latest_sync
+ else:
+ _dict['latest_sync'] = self.latest_sync.to_dict()
+ if hasattr(self, 'lifecycle_state') and self.lifecycle_state is not None:
+ _dict['lifecycle_state'] = self.lifecycle_state
+ if hasattr(self, 'mount_targets') and self.mount_targets is not None:
+ mount_targets_list = []
+ for v in self.mount_targets:
+ if isinstance(v, dict):
+ mount_targets_list.append(v)
+ else:
+ mount_targets_list.append(v.to_dict())
+ _dict['mount_targets'] = mount_targets_list
if hasattr(self, 'name') and self.name is not None:
_dict['name'] = self.name
- if hasattr(self, 'network_acl') and self.network_acl is not None:
- if isinstance(self.network_acl, dict):
- _dict['network_acl'] = self.network_acl
+ if hasattr(self, 'profile') and self.profile is not None:
+ if isinstance(self.profile, dict):
+ _dict['profile'] = self.profile
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
+ _dict['profile'] = self.profile.to_dict()
+ if hasattr(self, 'replica_share') and self.replica_share is not None:
+ if isinstance(self.replica_share, dict):
+ _dict['replica_share'] = self.replica_share
else:
- _dict['public_gateway'] = self.public_gateway.to_dict()
+ _dict['replica_share'] = self.replica_share.to_dict()
+ if hasattr(self, 'replication_cron_spec') and self.replication_cron_spec is not None:
+ _dict['replication_cron_spec'] = self.replication_cron_spec
+ if hasattr(self, 'replication_role') and self.replication_role is not None:
+ _dict['replication_role'] = self.replication_role
+ if hasattr(self, 'replication_status') and self.replication_status is not None:
+ _dict['replication_status'] = self.replication_status
+ if hasattr(self, 'replication_status_reasons') and self.replication_status_reasons is not None:
+ replication_status_reasons_list = []
+ for v in self.replication_status_reasons:
+ if isinstance(v, dict):
+ replication_status_reasons_list.append(v)
+ else:
+ replication_status_reasons_list.append(v.to_dict())
+ _dict['replication_status_reasons'] = replication_status_reasons_list
if hasattr(self, 'resource_group') and self.resource_group is not None:
if isinstance(self.resource_group, dict):
_dict['resource_group'] = self.resource_group
@@ -74037,20 +77307,15 @@ def to_dict(self) -> Dict:
_dict['resource_group'] = self.resource_group.to_dict()
if hasattr(self, 'resource_type') and self.resource_type is not None:
_dict['resource_type'] = self.resource_type
- if hasattr(self, 'routing_table') and self.routing_table is not None:
- if isinstance(self.routing_table, dict):
- _dict['routing_table'] = self.routing_table
- else:
- _dict['routing_table'] = self.routing_table.to_dict()
- if hasattr(self, 'status') and self.status is not None:
- _dict['status'] = self.status
- if hasattr(self, 'total_ipv4_address_count') and self.total_ipv4_address_count is not None:
- _dict['total_ipv4_address_count'] = self.total_ipv4_address_count
- if hasattr(self, 'vpc') and self.vpc is not None:
- if isinstance(self.vpc, dict):
- _dict['vpc'] = self.vpc
+ if hasattr(self, 'size') and self.size is not None:
+ _dict['size'] = self.size
+ if hasattr(self, 'source_share') and self.source_share is not None:
+ if isinstance(self.source_share, dict):
+ _dict['source_share'] = self.source_share
else:
- _dict['vpc'] = self.vpc.to_dict()
+ _dict['source_share'] = self.source_share.to_dict()
+ if hasattr(self, 'user_tags') and self.user_tags is not None:
+ _dict['user_tags'] = self.user_tags
if hasattr(self, 'zone') and self.zone is not None:
if isinstance(self.zone, dict):
_dict['zone'] = self.zone
@@ -74063,115 +77328,171 @@ 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 Share object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'Subnet') -> bool:
+ def __eq__(self, other: 'Share') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'Subnet') -> bool:
+ def __ne__(self, other: 'Share') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class IpVersionEnum(str, Enum):
+ class AccessControlModeEnum(str, Enum):
"""
- The IP version(s) supported by this subnet.
+ The access control mode for the share:
+ - `security_group`: The security groups on the virtual network interface for a
+ mount
+ target control access to the mount target.
+ - `vpc`: All clients in the VPC for a mount target have access to the mount
+ target.
+ The enumerated access control mode values for this property may expand in the
+ future. When processing this property, check for and log unknown values.
+ Optionally halt processing and surface the error, or bypass the resource on which
+ the unexpected access control mode was encountered.
"""
- IPV4 = 'ipv4'
+ SECURITY_GROUP = 'security_group'
+ VPC = 'vpc'
- class ResourceTypeEnum(str, Enum):
+ class EncryptionEnum(str, Enum):
"""
- The resource type.
+ The type of encryption used for this file share.
"""
- SUBNET = 'subnet'
+ PROVIDER_MANAGED = 'provider_managed'
+ USER_MANAGED = 'user_managed'
- class StatusEnum(str, Enum):
+ class LifecycleStateEnum(str, Enum):
"""
- The status of the subnet.
+ The lifecycle state of the file share.
"""
- AVAILABLE = 'available'
DELETING = 'deleting'
FAILED = 'failed'
PENDING = 'pending'
+ STABLE = 'stable'
+ SUSPENDED = 'suspended'
+ UPDATING = 'updating'
+ WAITING = 'waiting'
+ class ReplicationRoleEnum(str, Enum):
+ """
+ The replication role of the file share.
+ * `none`: This share is not participating in replication.
+ * `replica`: This share is a replication target.
+ * `source`: This share is a replication source.
+ """
-class SubnetCollection:
+ NONE = 'none'
+ REPLICA = 'replica'
+ SOURCE = 'source'
+
+
+ class ReplicationStatusEnum(str, Enum):
+ """
+ The replication status of the file share.
+ * `active`: This share is actively participating in replication, and the replica's
+ data is up-to-date with the replication schedule.
+ * `degraded`: This is share is participating in replication, but the replica's
+ data has fallen behind the replication schedule.
+ * `failover_pending`: This share is performing a replication failover.
+ * `initializing`: This share is initializing replication.
+ * `none`: This share is not participating in replication.
+ * `split_pending`: This share is performing a replication split.
+ """
+
+ ACTIVE = 'active'
+ DEGRADED = 'degraded'
+ FAILOVER_PENDING = 'failover_pending'
+ INITIALIZING = 'initializing'
+ NONE = 'none'
+ SPLIT_PENDING = 'split_pending'
+
+
+ class ResourceTypeEnum(str, Enum):
+ """
+ The resource type.
+ """
+
+ SHARE = 'share'
+
+
+
+class ShareCollection:
"""
- SubnetCollection.
+ ShareCollection.
- :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
+ :param ShareCollectionFirst first: A link to the first page of resources.
+ :param int limit: The maximum number of resources that can be returned by the
request.
- :attr SubnetCollectionNext next: (optional) A link to the next page of
+ :param ShareCollectionNext next: (optional) A link to the next page of
resources. This property is present for all pages
except the last page.
- :attr List[Subnet] subnets: Collection of subnets.
- :attr int total_count: The total number of resources across all pages.
+ :param List[Share] shares: Collection of file shares.
+ :param int total_count: The total number of resources across all pages.
"""
def __init__(
self,
- first: 'SubnetCollectionFirst',
+ first: 'ShareCollectionFirst',
limit: int,
- subnets: List['Subnet'],
+ shares: List['Share'],
total_count: int,
*,
- next: 'SubnetCollectionNext' = None,
+ next: Optional['ShareCollectionNext'] = None,
) -> None:
"""
- Initialize a SubnetCollection object.
+ Initialize a ShareCollection object.
- :param SubnetCollectionFirst first: A link to the first page of resources.
+ :param ShareCollectionFirst first: A link to the first page of resources.
:param int limit: The maximum number of resources that can be returned by
the request.
- :param List[Subnet] subnets: Collection of subnets.
+ :param List[Share] shares: Collection of file shares.
:param int total_count: The total number of resources across all pages.
- :param SubnetCollectionNext next: (optional) A link to the next page of
+ :param ShareCollectionNext next: (optional) A link to the next page of
resources. This property is present for all pages
except the last page.
"""
self.first = first
self.limit = limit
self.next = next
- self.subnets = subnets
+ self.shares = shares
self.total_count = total_count
@classmethod
- def from_dict(cls, _dict: Dict) -> 'SubnetCollection':
- """Initialize a SubnetCollection object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'ShareCollection':
+ """Initialize a ShareCollection object from a json dictionary."""
args = {}
- if 'first' in _dict:
- args['first'] = SubnetCollectionFirst.from_dict(_dict.get('first'))
+ if (first := _dict.get('first')) is not None:
+ args['first'] = ShareCollectionFirst.from_dict(first)
else:
- raise ValueError('Required property \'first\' not present in SubnetCollection JSON')
- if 'limit' in _dict:
- args['limit'] = _dict.get('limit')
+ raise ValueError('Required property \'first\' not present in ShareCollection JSON')
+ if (limit := _dict.get('limit')) is not None:
+ args['limit'] = limit
else:
- raise ValueError('Required property \'limit\' not present in SubnetCollection JSON')
- if 'next' in _dict:
- args['next'] = SubnetCollectionNext.from_dict(_dict.get('next'))
- if 'subnets' in _dict:
- args['subnets'] = [Subnet.from_dict(v) for v in _dict.get('subnets')]
+ raise ValueError('Required property \'limit\' not present in ShareCollection JSON')
+ if (next := _dict.get('next')) is not None:
+ args['next'] = ShareCollectionNext.from_dict(next)
+ if (shares := _dict.get('shares')) is not None:
+ args['shares'] = [Share.from_dict(v) for v in shares]
else:
- raise ValueError('Required property \'subnets\' not present in SubnetCollection JSON')
- if 'total_count' in _dict:
- args['total_count'] = _dict.get('total_count')
+ raise ValueError('Required property \'shares\' not present in ShareCollection JSON')
+ if (total_count := _dict.get('total_count')) is not None:
+ args['total_count'] = total_count
else:
- raise ValueError('Required property \'total_count\' not present in SubnetCollection JSON')
+ raise ValueError('Required property \'total_count\' not present in ShareCollection JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a SubnetCollection object from a json dictionary."""
+ """Initialize a ShareCollection object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -74189,14 +77510,14 @@ def to_dict(self) -> Dict:
_dict['next'] = self.next
else:
_dict['next'] = self.next.to_dict()
- if hasattr(self, 'subnets') and self.subnets is not None:
- subnets_list = []
- for v in self.subnets:
+ if hasattr(self, 'shares') and self.shares is not None:
+ shares_list = []
+ for v in self.shares:
if isinstance(v, dict):
- subnets_list.append(v)
+ shares_list.append(v)
else:
- subnets_list.append(v.to_dict())
- _dict['subnets'] = subnets_list
+ shares_list.append(v.to_dict())
+ _dict['shares'] = shares_list
if hasattr(self, 'total_count') and self.total_count is not None:
_dict['total_count'] = self.total_count
return _dict
@@ -74206,25 +77527,25 @@ 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 ShareCollection object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'SubnetCollection') -> bool:
+ def __eq__(self, other: 'ShareCollection') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'SubnetCollection') -> bool:
+ def __ne__(self, other: 'ShareCollection') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class SubnetCollectionFirst:
+class ShareCollectionFirst:
"""
A link to the first page of resources.
- :attr str href: The URL for a page of resources.
+ :param str href: The URL for a page of resources.
"""
def __init__(
@@ -74232,25 +77553,25 @@ def __init__(
href: str,
) -> None:
"""
- Initialize a SubnetCollectionFirst object.
+ Initialize a ShareCollectionFirst object.
:param str href: The URL for a page of resources.
"""
self.href = href
@classmethod
- def from_dict(cls, _dict: Dict) -> 'SubnetCollectionFirst':
- """Initialize a SubnetCollectionFirst object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'ShareCollectionFirst':
+ """Initialize a ShareCollectionFirst object from a json dictionary."""
args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'href\' not present in SubnetCollectionFirst JSON')
+ raise ValueError('Required property \'href\' not present in ShareCollectionFirst JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a SubnetCollectionFirst object from a json dictionary."""
+ """Initialize a ShareCollectionFirst object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -74265,26 +77586,26 @@ 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 ShareCollectionFirst object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'SubnetCollectionFirst') -> bool:
+ def __eq__(self, other: 'ShareCollectionFirst') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'SubnetCollectionFirst') -> bool:
+ def __ne__(self, other: 'ShareCollectionFirst') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class SubnetCollectionNext:
+class ShareCollectionNext:
"""
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.
+ :param str href: The URL for a page of resources.
"""
def __init__(
@@ -74292,25 +77613,25 @@ def __init__(
href: str,
) -> None:
"""
- Initialize a SubnetCollectionNext object.
+ Initialize a ShareCollectionNext object.
:param str href: The URL for a page of resources.
"""
self.href = href
@classmethod
- def from_dict(cls, _dict: Dict) -> 'SubnetCollectionNext':
- """Initialize a SubnetCollectionNext object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'ShareCollectionNext':
+ """Initialize a ShareCollectionNext object from a json dictionary."""
args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'href\' not present in SubnetCollectionNext JSON')
+ raise ValueError('Required property \'href\' not present in ShareCollectionNext JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a SubnetCollectionNext object from a json dictionary."""
+ """Initialize a ShareCollectionNext object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -74325,23 +77646,23 @@ 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 ShareCollectionNext object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'SubnetCollectionNext') -> bool:
+ def __eq__(self, other: 'ShareCollectionNext') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'SubnetCollectionNext') -> bool:
+ def __ne__(self, other: 'ShareCollectionNext') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class SubnetIdentity:
+class ShareIdentity:
"""
- Identifies a subnet by a unique property.
+ Identifies a file share by a unique property.
"""
@@ -74349,98 +77670,60 @@ def __init__(
self,
) -> None:
"""
- Initialize a SubnetIdentity object.
+ Initialize a ShareIdentity object.
"""
msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['SubnetIdentityById', 'SubnetIdentityByCRN', 'SubnetIdentityByHref'])
+ ", ".join(['ShareIdentityById', 'ShareIdentityByCRN', 'ShareIdentityByHref'])
)
raise Exception(msg)
-class SubnetPatch:
+class ShareInitialOwner:
"""
- SubnetPatch.
+ ShareInitialOwner.
- :attr str name: (optional) The name for this subnet. The name must not be used
- by another subnet in the VPC.
- :attr NetworkACLIdentity network_acl: (optional) The network ACL to use for this
- subnet.
- :attr SubnetPublicGatewayPatch public_gateway: (optional) The public gateway to
- use for internet-bound traffic for this subnet.
- :attr RoutingTableIdentity routing_table: (optional) The routing table to use
- for this subnet. The routing table properties
- `route_direct_link_ingress`, `route_internet_ingress`,
- `route_transit_gateway_ingress`, and `route_vpc_zone_ingress` must be `false`.
+ :param int gid: (optional) The initial group identifier for the file share.
+ :param int uid: (optional) The initial user identifier for the file share.
"""
def __init__(
self,
*,
- name: str = None,
- network_acl: 'NetworkACLIdentity' = None,
- public_gateway: 'SubnetPublicGatewayPatch' = None,
- routing_table: 'RoutingTableIdentity' = None,
+ gid: Optional[int] = None,
+ uid: Optional[int] = None,
) -> None:
"""
- Initialize a SubnetPatch object.
+ Initialize a ShareInitialOwner object.
- :param str name: (optional) The name for this subnet. The name must not be
- used by another subnet in the VPC.
- :param NetworkACLIdentity network_acl: (optional) The network ACL to use
- for this subnet.
- :param SubnetPublicGatewayPatch public_gateway: (optional) The public
- gateway to use for internet-bound traffic for this subnet.
- :param RoutingTableIdentity routing_table: (optional) The routing table to
- use for this subnet. The routing table properties
- `route_direct_link_ingress`, `route_internet_ingress`,
- `route_transit_gateway_ingress`, and `route_vpc_zone_ingress` must be
- `false`.
+ :param int gid: (optional) The initial group identifier for the file share.
+ :param int uid: (optional) The initial user identifier for the file share.
"""
- self.name = name
- self.network_acl = network_acl
- self.public_gateway = public_gateway
- self.routing_table = routing_table
+ self.gid = gid
+ self.uid = uid
@classmethod
- def from_dict(cls, _dict: Dict) -> 'SubnetPatch':
- """Initialize a SubnetPatch object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'ShareInitialOwner':
+ """Initialize a ShareInitialOwner 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')
+ if (gid := _dict.get('gid')) is not None:
+ args['gid'] = gid
+ if (uid := _dict.get('uid')) is not None:
+ args['uid'] = uid
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a SubnetPatch object from a json dictionary."""
+ """Initialize a ShareInitialOwner object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, '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()
+ if hasattr(self, 'gid') and self.gid is not None:
+ _dict['gid'] = self.gid
+ if hasattr(self, 'uid') and self.uid is not None:
+ _dict['uid'] = self.uid
return _dict
def _to_dict(self):
@@ -74448,210 +77731,244 @@ 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 ShareInitialOwner object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'SubnetPatch') -> bool:
+ def __eq__(self, other: 'ShareInitialOwner') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'SubnetPatch') -> bool:
+ def __ne__(self, other: 'ShareInitialOwner') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class SubnetPrototype:
+class ShareJob:
"""
- SubnetPrototype.
+ ShareJob.
- :attr str ip_version: (optional) The IP version(s) to support for this subnet.
- :attr str name: (optional) The name for this subnet. The name must not be used
- by another subnet in the VPC. If unspecified, the name will be a hyphenated list
- of randomly-selected words.
- :attr NetworkACLIdentity network_acl: (optional) The network ACL to use for this
- subnet.
- :attr PublicGatewayIdentity public_gateway: (optional) The public gateway to use
- for internet-bound traffic for this subnet. If
- unspecified, the subnet will not be attached to a public gateway.
- :attr ResourceGroupIdentity resource_group: (optional) The resource group to
- use. If unspecified, the account's [default resource
- group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be
- used.
- :attr RoutingTableIdentity routing_table: (optional) The routing table to use
- for this subnet. If unspecified, the default routing table
- for the VPC is used. The routing table properties `route_direct_link_ingress`,
- `route_internet_ingress`, `route_transit_gateway_ingress`, and
- `route_vpc_zone_ingress` must be `false`.
- :attr VPCIdentity vpc: The VPC the subnet will reside in.
+ :param str status: The status of the file share job.
+ The enumerated values for this property will expand in the future. When
+ processing this property, check for and log unknown values. Optionally halt
+ processing and surface the error, or bypass the file share job on which the
+ unexpected property value was encountered.
+ * `cancelled`: This job has been cancelled.
+ * `failed`: This job has failed.
+ * `queued`: This job is queued.
+ * `running`: This job is running.
+ * `succeeded`: This job completed successfully.
+ :param List[ShareJobStatusReason] status_reasons: The reasons for the file share
+ job status (if any).
+ The enumerated reason code values for this property will expand in the future.
+ When processing this property, check for and log unknown values. Optionally halt
+ processing and surface the error, or bypass the resource on which the unexpected
+ reason code was encountered.
+ :param str type: The type of the file share job.
+ The enumerated values for this property will expand in the future. When
+ processing this property, check for and log unknown values. Optionally halt
+ processing and surface the error, or bypass the file share job on which the
+ unexpected property value was encountered.
+ * `replication_failover`: This is a share replication failover job.
+ * `replication_init`: This is a share replication is initialization job.
+ * `replication_split`: This is a share replication split job.
"""
def __init__(
self,
- vpc: 'VPCIdentity',
- *,
- ip_version: str = None,
- name: str = None,
- network_acl: 'NetworkACLIdentity' = None,
- public_gateway: 'PublicGatewayIdentity' = None,
- resource_group: 'ResourceGroupIdentity' = None,
- routing_table: 'RoutingTableIdentity' = None,
- ) -> None:
- """
- Initialize a SubnetPrototype object.
-
- :param VPCIdentity vpc: The VPC the subnet will reside in.
- :param str ip_version: (optional) The IP version(s) to support for this
- subnet.
- :param str name: (optional) The name for this subnet. The name must not be
- used by another subnet in the VPC. If unspecified, the name will be a
- hyphenated list of randomly-selected words.
- :param NetworkACLIdentity network_acl: (optional) The network ACL to use
- for this subnet.
- :param PublicGatewayIdentity public_gateway: (optional) The public gateway
- to use for internet-bound traffic for this subnet. If
- unspecified, the subnet will not be attached to a public gateway.
- :param ResourceGroupIdentity resource_group: (optional) The resource group
- to use. If unspecified, the account's [default resource
- group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be
- used.
- :param RoutingTableIdentity routing_table: (optional) The routing table to
- use for this subnet. If unspecified, the default routing table
- for the VPC is used. The routing table properties
- `route_direct_link_ingress`,
- `route_internet_ingress`, `route_transit_gateway_ingress`, and
- `route_vpc_zone_ingress` must be `false`.
+ status: str,
+ status_reasons: List['ShareJobStatusReason'],
+ type: str,
+ ) -> None:
"""
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['SubnetPrototypeSubnetByTotalCount', 'SubnetPrototypeSubnetByCIDR'])
- )
- raise Exception(msg)
+ Initialize a ShareJob object.
- class IpVersionEnum(str, Enum):
- """
- The IP version(s) to support for this subnet.
+ :param str status: The status of the file share job.
+ The enumerated values for this property will expand in the future. When
+ processing this property, check for and log unknown values. Optionally halt
+ processing and surface the error, or bypass the file share job on which the
+ unexpected property value was encountered.
+ * `cancelled`: This job has been cancelled.
+ * `failed`: This job has failed.
+ * `queued`: This job is queued.
+ * `running`: This job is running.
+ * `succeeded`: This job completed successfully.
+ :param List[ShareJobStatusReason] status_reasons: The reasons for the file
+ share job status (if any).
+ The enumerated reason code values for this property will expand in the
+ future. When processing this property, check for and log unknown values.
+ Optionally halt processing and surface the error, or bypass the resource on
+ which the unexpected reason code was encountered.
+ :param str type: The type of the file share job.
+ The enumerated values for this property will expand in the future. When
+ processing this property, check for and log unknown values. Optionally halt
+ processing and surface the error, or bypass the file share job on which the
+ unexpected property value was encountered.
+ * `replication_failover`: This is a share replication failover job.
+ * `replication_init`: This is a share replication is initialization job.
+ * `replication_split`: This is a share replication split job.
"""
+ self.status = status
+ self.status_reasons = status_reasons
+ self.type = type
- IPV4 = 'ipv4'
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'ShareJob':
+ """Initialize a ShareJob object from a json dictionary."""
+ args = {}
+ if (status := _dict.get('status')) is not None:
+ args['status'] = status
+ else:
+ raise ValueError('Required property \'status\' not present in ShareJob JSON')
+ if (status_reasons := _dict.get('status_reasons')) is not None:
+ args['status_reasons'] = [ShareJobStatusReason.from_dict(v) for v in status_reasons]
+ else:
+ raise ValueError('Required property \'status_reasons\' not present in ShareJob JSON')
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
+ else:
+ raise ValueError('Required property \'type\' not present in ShareJob JSON')
+ return cls(**args)
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a ShareJob object from a json dictionary."""
+ return cls.from_dict(_dict)
+ def to_dict(self) -> Dict:
+ """Return a json dictionary representing this model."""
+ _dict = {}
+ if hasattr(self, 'status') and self.status is not None:
+ _dict['status'] = self.status
+ if hasattr(self, 'status_reasons') and self.status_reasons is not None:
+ status_reasons_list = []
+ for v in self.status_reasons:
+ if isinstance(v, dict):
+ status_reasons_list.append(v)
+ else:
+ status_reasons_list.append(v.to_dict())
+ _dict['status_reasons'] = status_reasons_list
+ if hasattr(self, 'type') and self.type is not None:
+ _dict['type'] = self.type
+ return _dict
-class SubnetPublicGatewayPatch:
- """
- The public gateway to use for internet-bound traffic for this subnet.
+ def _to_dict(self):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
- """
+ def __str__(self) -> str:
+ """Return a `str` version of this ShareJob object."""
+ return json.dumps(self.to_dict(), indent=2)
- def __init__(
- self,
- ) -> None:
+ def __eq__(self, other: 'ShareJob') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'ShareJob') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+ class StatusEnum(str, Enum):
"""
- Initialize a SubnetPublicGatewayPatch object.
+ The status of the file share job.
+ The enumerated values for this property will expand in the future. When processing
+ this property, check for and log unknown values. Optionally halt processing and
+ surface the error, or bypass the file share job on which the unexpected property
+ value was encountered.
+ * `cancelled`: This job has been cancelled.
+ * `failed`: This job has failed.
+ * `queued`: This job is queued.
+ * `running`: This job is running.
+ * `succeeded`: This job completed successfully.
+ """
+
+ CANCELLED = 'cancelled'
+ FAILED = 'failed'
+ QUEUED = 'queued'
+ RUNNING = 'running'
+ SUCCEEDED = 'succeeded'
+
+ class TypeEnum(str, Enum):
"""
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['SubnetPublicGatewayPatchPublicGatewayIdentityById', 'SubnetPublicGatewayPatchPublicGatewayIdentityByCRN', 'SubnetPublicGatewayPatchPublicGatewayIdentityByHref'])
- )
- raise Exception(msg)
+ The type of the file share job.
+ The enumerated values for this property will expand in the future. When processing
+ this property, check for and log unknown values. Optionally halt processing and
+ surface the error, or bypass the file share job on which the unexpected property
+ value was encountered.
+ * `replication_failover`: This is a share replication failover job.
+ * `replication_init`: This is a share replication is initialization job.
+ * `replication_split`: This is a share replication split job.
+ """
+
+ REPLICATION_FAILOVER = 'replication_failover'
+ REPLICATION_INIT = 'replication_init'
+ REPLICATION_SPLIT = 'replication_split'
-class SubnetReference:
+
+class ShareJobStatusReason:
"""
- SubnetReference.
+ ShareJobStatusReason.
- :attr str crn: The CRN for this subnet.
- :attr SubnetReferenceDeleted deleted: (optional) If present, this property
- indicates the referenced resource has been deleted, and provides
- some supplementary information.
- :attr str href: The URL for this subnet.
- :attr str id: The unique identifier for this subnet.
- :attr str name: The name for this subnet. The name is unique across all subnets
- in the VPC.
- :attr str resource_type: The resource type.
+ :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.
"""
def __init__(
self,
- crn: str,
- href: str,
- id: str,
- name: str,
- resource_type: str,
+ code: str,
+ message: str,
*,
- deleted: 'SubnetReferenceDeleted' = None,
+ more_info: Optional[str] = None,
) -> None:
"""
- Initialize a SubnetReference object.
+ Initialize a ShareJobStatusReason object.
- :param str crn: The CRN for this subnet.
- :param str href: The URL for this subnet.
- :param str id: The unique identifier for this subnet.
- :param str name: The name for this subnet. The name is unique across all
- subnets in the VPC.
- :param str resource_type: The resource type.
- :param SubnetReferenceDeleted deleted: (optional) If present, this property
- indicates the referenced resource has been deleted, and provides
- some supplementary information.
+ :param 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.crn = crn
- self.deleted = deleted
- self.href = href
- self.id = id
- self.name = name
- self.resource_type = resource_type
+ self.code = code
+ self.message = message
+ self.more_info = more_info
@classmethod
- def from_dict(cls, _dict: Dict) -> 'SubnetReference':
- """Initialize a SubnetReference object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'ShareJobStatusReason':
+ """Initialize a ShareJobStatusReason 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'))
- if 'href' in _dict:
- args['href'] = _dict.get('href')
- else:
- 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 SubnetReference JSON')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
+ if (code := _dict.get('code')) is not None:
+ args['code'] = code
else:
- raise ValueError('Required property \'name\' not present in SubnetReference JSON')
- if 'resource_type' in _dict:
- args['resource_type'] = _dict.get('resource_type')
+ raise ValueError('Required property \'code\' not present in ShareJobStatusReason JSON')
+ if (message := _dict.get('message')) is not None:
+ args['message'] = message
else:
- raise ValueError('Required property \'resource_type\' not present in SubnetReference JSON')
+ raise ValueError('Required property \'message\' not present in ShareJobStatusReason JSON')
+ if (more_info := _dict.get('more_info')) is not None:
+ args['more_info'] = more_info
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a SubnetReference object from a json dictionary."""
+ """Initialize a ShareJobStatusReason object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'crn') and self.crn is not None:
- _dict['crn'] = self.crn
- if hasattr(self, 'deleted') and self.deleted is not None:
- if isinstance(self.deleted, dict):
- _dict['deleted'] = self.deleted
- else:
- _dict['deleted'] = self.deleted.to_dict()
- if hasattr(self, 'href') and self.href is not None:
- _dict['href'] = self.href
- if hasattr(self, 'id') and self.id is not None:
- _dict['id'] = self.id
- if hasattr(self, 'name') and self.name is not None:
- _dict['name'] = self.name
- if hasattr(self, 'resource_type') and self.resource_type is not None:
- _dict['resource_type'] = self.resource_type
+ if hasattr(self, '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):
@@ -74659,67 +77976,96 @@ 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 ShareJobStatusReason object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'SubnetReference') -> bool:
+ def __eq__(self, other: 'ShareJobStatusReason') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'SubnetReference') -> bool:
+ def __ne__(self, other: 'ShareJobStatusReason') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class ResourceTypeEnum(str, Enum):
+ class CodeEnum(str, Enum):
"""
- The resource type.
+ A snake case string succinctly identifying the status reason.
"""
- SUBNET = 'subnet'
+ CANNOT_INITIALIZE_REPLICATION = 'cannot_initialize_replication'
+ CANNOT_REACH_REPLICA_SHARE = 'cannot_reach_replica_share'
+ CANNOT_REACH_SOURCE_SHARE = 'cannot_reach_source_share'
-class SubnetReferenceDeleted:
+class ShareLatestSync:
"""
- If present, this property indicates the referenced resource has been deleted, and
- provides some supplementary information.
+ Information about the latest synchronization for this file share.
+ This property will be present when the `replication_role` is `replica` and at least
+ one replication sync has been completed.
- :attr str more_info: Link to documentation about deleted resources.
+ :param datetime completed_at: The completed date and time of last
+ synchronization between the replica share and its source.
+ :param int data_transferred: The data transferred (in bytes) in the last
+ synchronization between the replica and its source.
+ :param datetime started_at: The start date and time of last synchronization
+ between the replica share and its source.
"""
def __init__(
self,
- more_info: str,
+ completed_at: datetime,
+ data_transferred: int,
+ started_at: datetime,
) -> None:
"""
- Initialize a SubnetReferenceDeleted object.
+ Initialize a ShareLatestSync object.
- :param str more_info: Link to documentation about deleted resources.
+ :param datetime completed_at: The completed date and time of last
+ synchronization between the replica share and its source.
+ :param int data_transferred: The data transferred (in bytes) in the last
+ synchronization between the replica and its source.
+ :param datetime started_at: The start date and time of last synchronization
+ between the replica share and its source.
"""
- self.more_info = more_info
+ self.completed_at = completed_at
+ self.data_transferred = data_transferred
+ self.started_at = started_at
@classmethod
- def from_dict(cls, _dict: Dict) -> 'SubnetReferenceDeleted':
- """Initialize a SubnetReferenceDeleted object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'ShareLatestSync':
+ """Initialize a ShareLatestSync object from a json dictionary."""
args = {}
- if 'more_info' in _dict:
- args['more_info'] = _dict.get('more_info')
+ if (completed_at := _dict.get('completed_at')) is not None:
+ args['completed_at'] = string_to_datetime(completed_at)
else:
- raise ValueError('Required property \'more_info\' not present in SubnetReferenceDeleted JSON')
+ raise ValueError('Required property \'completed_at\' not present in ShareLatestSync JSON')
+ if (data_transferred := _dict.get('data_transferred')) is not None:
+ args['data_transferred'] = data_transferred
+ else:
+ raise ValueError('Required property \'data_transferred\' not present in ShareLatestSync JSON')
+ if (started_at := _dict.get('started_at')) is not None:
+ args['started_at'] = string_to_datetime(started_at)
+ else:
+ raise ValueError('Required property \'started_at\' not present in ShareLatestSync JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a SubnetReferenceDeleted object from a json dictionary."""
+ """Initialize a ShareLatestSync object from 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, 'completed_at') and self.completed_at is not None:
+ _dict['completed_at'] = datetime_to_string(self.completed_at)
+ if hasattr(self, 'data_transferred') and self.data_transferred is not None:
+ _dict['data_transferred'] = self.data_transferred
+ if hasattr(self, 'started_at') and self.started_at is not None:
+ _dict['started_at'] = datetime_to_string(self.started_at)
return _dict
def _to_dict(self):
@@ -74727,97 +78073,268 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this SubnetReferenceDeleted object."""
+ """Return a `str` version of this ShareLatestSync object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'SubnetReferenceDeleted') -> bool:
+ def __eq__(self, other: 'ShareLatestSync') -> bool:
"""Return `true` when 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:
+ def __ne__(self, other: 'ShareLatestSync') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class TrustedProfileIdentity:
- """
- Identifies a trusted profile by a unique property.
-
- """
-
- def __init__(
- self,
- ) -> None:
- """
- Initialize a TrustedProfileIdentity object.
-
- """
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['TrustedProfileIdentityTrustedProfileById', 'TrustedProfileIdentityTrustedProfileByCRN'])
- )
- raise Exception(msg)
-
-
-class TrustedProfileReference:
+class ShareMountTarget:
"""
- TrustedProfileReference.
+ ShareMountTarget.
- :attr str crn: The CRN for this trusted profile.
- :attr str id: The unique identifier for this trusted profile.
- :attr str resource_type: The resource type.
+ :param str access_control_mode: The access control mode for the share:
+ - `security_group`: The security groups on the virtual network interface for a
+ mount
+ target control access to the mount target.
+ - `vpc`: All clients in the VPC for a mount target have access to the mount
+ target.
+ The enumerated access control mode values for this property may expand in the
+ future. When processing this property, check for and log unknown values.
+ Optionally halt processing and surface the error, or bypass the resource on
+ which the unexpected access control mode was encountered.
+ :param datetime created_at: The date and time that the share mount target was
+ created.
+ :param str href: The URL for this share mount target.
+ :param str id: The unique identifier for this share mount target.
+ :param str lifecycle_state: The lifecycle state of the mount target.
+ :param str mount_path: (optional) The mount path for the share. The server
+ component of the mount path may be either an IP address or a fully qualified
+ domain name.
+ This property will be absent if the `lifecycle_state` of the mount target is
+ 'pending', `failed`, or `deleting`.
+ If the share's `access_control_mode` is:
+ - `security_group`: The IP address used in the mount path is the `primary_ip`
+ address of the virtual network interface for this share mount target.
+ - `vpc`: The fully-qualified domain name used in the mount path is an address
+ that
+ resolves to the share mount target.
+ :param str name: The name for this share mount target. The name is unique across
+ all mount targets for the file share.
+ :param ReservedIPReference primary_ip: (optional) The primary IP address of the
+ virtual network interface for the share mount target.
+ Absent if `access_control_mode` is `vpc`.
+ :param str resource_type: The resource type.
+ :param SubnetReference subnet: (optional) The subnet of the virtual network
+ interface for the share mount target.
+ Absent if `access_control_mode` is `vpc`.
+ :param str transit_encryption: The transit encryption mode for this share mount
+ target:
+ - `none`: Not encrypted in transit
+ - `user_managed`: Encrypted in transit using an instance identity certificate
+ The enumerated values for this property will expand in the future. When
+ processing this property, check for and log unknown values. Optionally halt
+ processing and surface the error, or bypass the resource on which the unexpected
+ property value was encountered.
+ :param VirtualNetworkInterfaceReferenceAttachmentContext
+ virtual_network_interface: (optional) The virtual network interface for this
+ file share mount target.
+ This property will be present when the `access_control_mode` is
+ `security_group`.
+ :param VPCReference vpc: If `access_control_mode` is:
+ - `security_group`: The VPC for the virtual network interface for this share
+ mount
+ target
+ - `vpc`: The VPC in which clients can mount the file share using this share
+ mount target.
"""
def __init__(
self,
- crn: str,
+ access_control_mode: str,
+ created_at: datetime,
+ href: str,
id: str,
+ lifecycle_state: str,
+ name: str,
resource_type: str,
+ transit_encryption: str,
+ vpc: 'VPCReference',
+ *,
+ mount_path: Optional[str] = None,
+ primary_ip: Optional['ReservedIPReference'] = None,
+ subnet: Optional['SubnetReference'] = None,
+ virtual_network_interface: Optional['VirtualNetworkInterfaceReferenceAttachmentContext'] = None,
) -> None:
"""
- Initialize a TrustedProfileReference object.
+ Initialize a ShareMountTarget object.
- :param str crn: The CRN for this trusted profile.
- :param str id: The unique identifier for this trusted profile.
+ :param str access_control_mode: The access control mode for the share:
+ - `security_group`: The security groups on the virtual network interface
+ for a mount
+ target control access to the mount target.
+ - `vpc`: All clients in the VPC for a mount target have access to the mount
+ target.
+ The enumerated access control mode values for this property may expand in
+ the future. When processing this property, check for and log unknown
+ values. Optionally halt processing and surface the error, or bypass the
+ resource on which the unexpected access control mode was encountered.
+ :param datetime created_at: The date and time that the share mount target
+ was created.
+ :param str href: The URL for this share mount target.
+ :param str id: The unique identifier for this share mount target.
+ :param str lifecycle_state: The lifecycle state of the mount target.
+ :param str name: The name for this share mount target. The name is unique
+ across all mount targets for the file share.
:param str resource_type: The resource type.
+ :param str transit_encryption: The transit encryption mode for this share
+ mount target:
+ - `none`: Not encrypted in transit
+ - `user_managed`: Encrypted in transit using an instance identity
+ certificate
+ The enumerated values for this property will expand in the future. When
+ processing this property, check for and log unknown values. Optionally halt
+ processing and surface the error, or bypass the resource on which the
+ unexpected property value was encountered.
+ :param VPCReference vpc: If `access_control_mode` is:
+ - `security_group`: The VPC for the virtual network interface for this
+ share mount
+ target
+ - `vpc`: The VPC in which clients can mount the file share using this share
+ mount target.
+ :param str mount_path: (optional) The mount path for the share. The server
+ component of the mount path may be either an IP address or a fully
+ qualified domain name.
+ This property will be absent if the `lifecycle_state` of the mount target
+ is
+ 'pending', `failed`, or `deleting`.
+ If the share's `access_control_mode` is:
+ - `security_group`: The IP address used in the mount path is the
+ `primary_ip`
+ address of the virtual network interface for this share mount target.
+ - `vpc`: The fully-qualified domain name used in the mount path is an
+ address that
+ resolves to the share mount target.
+ :param ReservedIPReference primary_ip: (optional) The primary IP address of
+ the virtual network interface for the share mount target.
+ Absent if `access_control_mode` is `vpc`.
+ :param SubnetReference subnet: (optional) The subnet of the virtual network
+ interface for the share mount target.
+ Absent if `access_control_mode` is `vpc`.
+ :param VirtualNetworkInterfaceReferenceAttachmentContext
+ virtual_network_interface: (optional) The virtual network interface for
+ this file share mount target.
+ This property will be present when the `access_control_mode` is
+ `security_group`.
"""
- self.crn = crn
+ self.access_control_mode = access_control_mode
+ self.created_at = created_at
+ self.href = href
self.id = id
+ self.lifecycle_state = lifecycle_state
+ self.mount_path = mount_path
+ self.name = name
+ self.primary_ip = primary_ip
self.resource_type = resource_type
+ self.subnet = subnet
+ self.transit_encryption = transit_encryption
+ self.virtual_network_interface = virtual_network_interface
+ self.vpc = vpc
@classmethod
- def from_dict(cls, _dict: Dict) -> 'TrustedProfileReference':
- """Initialize a TrustedProfileReference object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'ShareMountTarget':
+ """Initialize a ShareMountTarget object from a json dictionary."""
args = {}
- if 'crn' in _dict:
- args['crn'] = _dict.get('crn')
+ if (access_control_mode := _dict.get('access_control_mode')) is not None:
+ args['access_control_mode'] = access_control_mode
else:
- raise ValueError('Required property \'crn\' not present in TrustedProfileReference JSON')
- if 'id' in _dict:
- args['id'] = _dict.get('id')
+ raise ValueError('Required property \'access_control_mode\' not present in ShareMountTarget JSON')
+ if (created_at := _dict.get('created_at')) is not None:
+ args['created_at'] = string_to_datetime(created_at)
else:
- raise ValueError('Required property \'id\' not present in TrustedProfileReference JSON')
- if 'resource_type' in _dict:
- args['resource_type'] = _dict.get('resource_type')
+ raise ValueError('Required property \'created_at\' not present in ShareMountTarget JSON')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'resource_type\' not present in TrustedProfileReference JSON')
+ raise ValueError('Required property \'href\' not present in ShareMountTarget JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
+ else:
+ raise ValueError('Required property \'id\' not present in ShareMountTarget JSON')
+ if (lifecycle_state := _dict.get('lifecycle_state')) is not None:
+ args['lifecycle_state'] = lifecycle_state
+ else:
+ raise ValueError('Required property \'lifecycle_state\' not present in ShareMountTarget JSON')
+ if (mount_path := _dict.get('mount_path')) is not None:
+ args['mount_path'] = mount_path
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ else:
+ raise ValueError('Required property \'name\' not present in ShareMountTarget JSON')
+ if (primary_ip := _dict.get('primary_ip')) is not None:
+ args['primary_ip'] = ReservedIPReference.from_dict(primary_ip)
+ if (resource_type := _dict.get('resource_type')) is not None:
+ args['resource_type'] = resource_type
+ else:
+ raise ValueError('Required property \'resource_type\' not present in ShareMountTarget JSON')
+ if (subnet := _dict.get('subnet')) is not None:
+ args['subnet'] = SubnetReference.from_dict(subnet)
+ if (transit_encryption := _dict.get('transit_encryption')) is not None:
+ args['transit_encryption'] = transit_encryption
+ else:
+ raise ValueError('Required property \'transit_encryption\' not present in ShareMountTarget JSON')
+ if (virtual_network_interface := _dict.get('virtual_network_interface')) is not None:
+ args['virtual_network_interface'] = VirtualNetworkInterfaceReferenceAttachmentContext.from_dict(virtual_network_interface)
+ if (vpc := _dict.get('vpc')) is not None:
+ args['vpc'] = VPCReference.from_dict(vpc)
+ else:
+ raise ValueError('Required property \'vpc\' not present in ShareMountTarget JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a TrustedProfileReference object from a json dictionary."""
+ """Initialize a ShareMountTarget object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'crn') and self.crn is not None:
- _dict['crn'] = self.crn
+ if hasattr(self, 'access_control_mode') and self.access_control_mode is not None:
+ _dict['access_control_mode'] = self.access_control_mode
+ if hasattr(self, 'created_at') and self.created_at is not None:
+ _dict['created_at'] = datetime_to_string(self.created_at)
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
if hasattr(self, 'id') and self.id is not None:
_dict['id'] = self.id
+ if hasattr(self, 'lifecycle_state') and self.lifecycle_state is not None:
+ _dict['lifecycle_state'] = self.lifecycle_state
+ if hasattr(self, 'mount_path') and self.mount_path is not None:
+ _dict['mount_path'] = self.mount_path
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ if hasattr(self, 'primary_ip') and self.primary_ip is not None:
+ if isinstance(self.primary_ip, dict):
+ _dict['primary_ip'] = self.primary_ip
+ else:
+ _dict['primary_ip'] = self.primary_ip.to_dict()
if hasattr(self, 'resource_type') and self.resource_type is not None:
_dict['resource_type'] = self.resource_type
+ if hasattr(self, 'subnet') and self.subnet is not None:
+ if isinstance(self.subnet, dict):
+ _dict['subnet'] = self.subnet
+ else:
+ _dict['subnet'] = self.subnet.to_dict()
+ if hasattr(self, 'transit_encryption') and self.transit_encryption is not None:
+ _dict['transit_encryption'] = self.transit_encryption
+ if hasattr(self, 'virtual_network_interface') and self.virtual_network_interface is not None:
+ if isinstance(self.virtual_network_interface, dict):
+ _dict['virtual_network_interface'] = self.virtual_network_interface
+ else:
+ _dict['virtual_network_interface'] = self.virtual_network_interface.to_dict()
+ if hasattr(self, 'vpc') and self.vpc is not None:
+ if isinstance(self.vpc, dict):
+ _dict['vpc'] = self.vpc
+ else:
+ _dict['vpc'] = self.vpc.to_dict()
return _dict
def _to_dict(self):
@@ -74825,412 +78342,49 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this TrustedProfileReference object."""
+ """Return a `str` version of this ShareMountTarget object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'TrustedProfileReference') -> bool:
+ def __eq__(self, other: 'ShareMountTarget') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'TrustedProfileReference') -> bool:
+ def __ne__(self, other: 'ShareMountTarget') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class ResourceTypeEnum(str, Enum):
+ class AccessControlModeEnum(str, Enum):
"""
- The resource type.
+ The access control mode for the share:
+ - `security_group`: The security groups on the virtual network interface for a
+ mount
+ target control access to the mount target.
+ - `vpc`: All clients in the VPC for a mount target have access to the mount
+ target.
+ The enumerated access control mode values for this property may expand in the
+ future. When processing this property, check for and log unknown values.
+ Optionally halt processing and surface the error, or bypass the resource on which
+ the unexpected access control mode was encountered.
"""
- TRUSTED_PROFILE = 'trusted_profile'
+ SECURITY_GROUP = 'security_group'
+ VPC = 'vpc'
+ class LifecycleStateEnum(str, Enum):
+ """
+ The lifecycle state of the mount target.
+ """
-class VCPU:
- """
- The VCPU configuration.
-
- :attr str architecture: The VCPU architecture.
- :attr int count: The number of VCPUs assigned.
- :attr str manufacturer: The VCPU manufacturer.
- """
-
- def __init__(
- self,
- architecture: str,
- count: int,
- manufacturer: str,
- ) -> None:
- """
- Initialize a VCPU object.
-
- :param str architecture: The VCPU architecture.
- :param int count: The number of VCPUs assigned.
- :param str manufacturer: The VCPU manufacturer.
- """
- self.architecture = architecture
- self.count = count
- self.manufacturer = manufacturer
-
- @classmethod
- def from_dict(cls, _dict: Dict) -> 'VCPU':
- """Initialize a VCPU object from a json dictionary."""
- args = {}
- if 'architecture' in _dict:
- args['architecture'] = _dict.get('architecture')
- else:
- raise ValueError('Required property \'architecture\' not present in VCPU JSON')
- if 'count' in _dict:
- args['count'] = _dict.get('count')
- else:
- raise ValueError('Required property \'count\' not present in VCPU JSON')
- if 'manufacturer' in _dict:
- args['manufacturer'] = _dict.get('manufacturer')
- else:
- raise ValueError('Required property \'manufacturer\' not present in VCPU JSON')
- return cls(**args)
-
- @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
- if hasattr(self, 'manufacturer') and self.manufacturer is not None:
- _dict['manufacturer'] = self.manufacturer
- return _dict
-
- def _to_dict(self):
- """Return a json dictionary representing this model."""
- return self.to_dict()
-
- 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
- for this VPC. Resources created in this VPC that allow
- a security group to be optionally specified will use this security group by
- default.
- :attr VPCDNS dns: The DNS configuration for this VPC.
- :attr List[VPCHealthReason] health_reasons: The reasons for the current
- `health_state` (if any).
- The enumerated reason code values for this property will expand in the future.
- When processing this property, check for and log unknown values. Optionally halt
- processing and surface the error, or bypass the resource on which the unexpected
- reason code was encountered.
- :attr str health_state: The health of this resource.
- - `ok`: No abnormal behavior detected
- - `degraded`: Experiencing compromised performance, capacity, or connectivity
- - `faulted`: Completely unreachable, inoperative, or otherwise entirely
- incapacitated
- - `inapplicable`: The health state does not apply because of the current
- lifecycle state. A resource with a lifecycle state of `failed` or `deleting`
- will have a health state of `inapplicable`. A `pending` resource may also have
- this state.
- :attr str href: The URL for this VPC.
- :attr str id: The unique identifier for this VPC.
- :attr str name: The name for this VPC. The name is unique across all VPCs in the
- region.
- :attr ResourceGroupReference resource_group: The resource group for this VPC.
- :attr str resource_type: The resource type.
- :attr str status: The status of this VPC.
- """
-
- def __init__(
- self,
- classic_access: bool,
- created_at: datetime,
- crn: str,
- default_network_acl: 'NetworkACLReference',
- default_routing_table: 'RoutingTableReference',
- default_security_group: 'SecurityGroupReference',
- dns: 'VPCDNS',
- health_reasons: List['VPCHealthReason'],
- health_state: str,
- href: str,
- id: str,
- name: str,
- resource_group: 'ResourceGroupReference',
- resource_type: str,
- status: str,
- *,
- cse_source_ips: List['VPCCSESourceIP'] = None,
- ) -> None:
- """
- Initialize a VPC object.
-
- :param bool classic_access: Indicates whether this VPC is connected to
- Classic Infrastructure. If true, this VPC's resources have private network
- connectivity to the account's Classic Infrastructure resources. Only one
- VPC, per region, may be connected in this way. This value is set at
- creation and subsequently immutable.
- :param datetime created_at: The date and time that the VPC was created.
- :param str crn: The CRN for this VPC.
- :param NetworkACLReference default_network_acl: The default network ACL to
- use for subnets created in this VPC.
- :param RoutingTableReference default_routing_table: The default routing
- table to use for subnets created in this VPC.
- :param SecurityGroupReference default_security_group: The default security
- group for this VPC. Resources created in this VPC that allow
- a security group to be optionally specified will use this security group by
- default.
- :param VPCDNS dns: The DNS configuration for this VPC.
- :param List[VPCHealthReason] health_reasons: The reasons for the current
- `health_state` (if any).
- The enumerated reason code values for this property will expand in the
- future. When processing this property, check for and log unknown values.
- Optionally halt processing and surface the error, or bypass the resource on
- which the unexpected reason code was encountered.
- :param str health_state: The health of this resource.
- - `ok`: No abnormal behavior detected
- - `degraded`: Experiencing compromised performance, capacity, or
- connectivity
- - `faulted`: Completely unreachable, inoperative, or otherwise entirely
- incapacitated
- - `inapplicable`: The health state does not apply because of the current
- lifecycle state. A resource with a lifecycle state of `failed` or
- `deleting` will have a health state of `inapplicable`. A `pending` resource
- may also have this state.
- :param str href: The URL for this VPC.
- :param str id: The unique identifier for this VPC.
- :param str name: The name for this VPC. The name is unique across all VPCs
- in the region.
- :param ResourceGroupReference resource_group: The resource group for this
- VPC.
- :param str resource_type: The resource type.
- :param str status: The status of this VPC.
- :param List[VPCCSESourceIP] cse_source_ips: (optional) The CSE ([Cloud
- Service
- Endpoint](https://cloud.ibm.com/docs/resources?topic=resources-service-endpoints))
- source IP addresses for the VPC. The VPC will have one CSE source IP
- address per zone.
- """
- self.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.dns = dns
- self.health_reasons = health_reasons
- self.health_state = health_state
- self.href = href
- self.id = id
- self.name = name
- self.resource_group = resource_group
- self.resource_type = resource_type
- self.status = status
-
- @classmethod
- def from_dict(cls, _dict: Dict) -> '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 VPC JSON')
- if 'crn' in _dict:
- args['crn'] = _dict.get('crn')
- else:
- raise ValueError('Required property \'crn\' not present in VPC JSON')
- if 'cse_source_ips' in _dict:
- args['cse_source_ips'] = [VPCCSESourceIP.from_dict(v) for v in _dict.get('cse_source_ips')]
- if 'default_network_acl' in _dict:
- args['default_network_acl'] = NetworkACLReference.from_dict(_dict.get('default_network_acl'))
- else:
- raise ValueError('Required property \'default_network_acl\' not present in VPC JSON')
- if 'default_routing_table' in _dict:
- args['default_routing_table'] = RoutingTableReference.from_dict(_dict.get('default_routing_table'))
- else:
- raise ValueError('Required property \'default_routing_table\' not present in VPC JSON')
- if 'default_security_group' in _dict:
- args['default_security_group'] = SecurityGroupReference.from_dict(_dict.get('default_security_group'))
- else:
- raise ValueError('Required property \'default_security_group\' not present in VPC JSON')
- if 'dns' in _dict:
- args['dns'] = VPCDNS.from_dict(_dict.get('dns'))
- else:
- raise ValueError('Required property \'dns\' not present in VPC JSON')
- if 'health_reasons' in _dict:
- args['health_reasons'] = [VPCHealthReason.from_dict(v) for v in _dict.get('health_reasons')]
- else:
- raise ValueError('Required property \'health_reasons\' not present in VPC JSON')
- if 'health_state' in _dict:
- args['health_state'] = _dict.get('health_state')
- else:
- raise ValueError('Required property \'health_state\' not present in VPC JSON')
- if 'href' in _dict:
- args['href'] = _dict.get('href')
- else:
- raise ValueError('Required property \'href\' not present in VPC JSON')
- if 'id' in _dict:
- args['id'] = _dict.get('id')
- else:
- raise ValueError('Required property \'id\' not present in VPC JSON')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
- else:
- raise ValueError('Required property \'name\' not present in VPC JSON')
- if 'resource_group' in _dict:
- args['resource_group'] = ResourceGroupReference.from_dict(_dict.get('resource_group'))
- else:
- raise ValueError('Required property \'resource_group\' not present in VPC JSON')
- if 'resource_type' in _dict:
- args['resource_type'] = _dict.get('resource_type')
- else:
- raise ValueError('Required property \'resource_type\' not present in VPC JSON')
- if 'status' in _dict:
- args['status'] = _dict.get('status')
- else:
- raise ValueError('Required property \'status\' not present in VPC JSON')
- return cls(**args)
-
- @classmethod
- def _from_dict(cls, _dict):
- """Initialize a 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:
- cse_source_ips_list = []
- for v in self.cse_source_ips:
- if isinstance(v, dict):
- cse_source_ips_list.append(v)
- else:
- cse_source_ips_list.append(v.to_dict())
- _dict['cse_source_ips'] = cse_source_ips_list
- if hasattr(self, 'default_network_acl') and self.default_network_acl is not None:
- if isinstance(self.default_network_acl, dict):
- _dict['default_network_acl'] = self.default_network_acl
- else:
- _dict['default_network_acl'] = self.default_network_acl.to_dict()
- if hasattr(self, 'default_routing_table') and self.default_routing_table is not None:
- if isinstance(self.default_routing_table, dict):
- _dict['default_routing_table'] = self.default_routing_table
- else:
- _dict['default_routing_table'] = self.default_routing_table.to_dict()
- if hasattr(self, 'default_security_group') and self.default_security_group is not None:
- if isinstance(self.default_security_group, dict):
- _dict['default_security_group'] = self.default_security_group
- else:
- _dict['default_security_group'] = self.default_security_group.to_dict()
- if hasattr(self, 'dns') and self.dns is not None:
- if isinstance(self.dns, dict):
- _dict['dns'] = self.dns
- else:
- _dict['dns'] = self.dns.to_dict()
- if hasattr(self, 'health_reasons') and self.health_reasons is not None:
- health_reasons_list = []
- for v in self.health_reasons:
- if isinstance(v, dict):
- health_reasons_list.append(v)
- else:
- health_reasons_list.append(v.to_dict())
- _dict['health_reasons'] = health_reasons_list
- if hasattr(self, 'health_state') and self.health_state is not None:
- _dict['health_state'] = self.health_state
- if hasattr(self, 'href') and self.href is not None:
- _dict['href'] = self.href
- if hasattr(self, 'id') and self.id is not None:
- _dict['id'] = self.id
- if hasattr(self, 'name') and self.name is not None:
- _dict['name'] = self.name
- if hasattr(self, 'resource_group') and self.resource_group is not None:
- if isinstance(self.resource_group, dict):
- _dict['resource_group'] = self.resource_group
- else:
- _dict['resource_group'] = self.resource_group.to_dict()
- if hasattr(self, 'resource_type') and self.resource_type is not None:
- _dict['resource_type'] = self.resource_type
- if hasattr(self, 'status') and self.status is not None:
- _dict['status'] = self.status
- return _dict
-
- def _to_dict(self):
- """Return a json dictionary representing this model."""
- return self.to_dict()
-
- def __str__(self) -> str:
- """Return a `str` version of this VPC object."""
- return json.dumps(self.to_dict(), indent=2)
-
- 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: 'VPC') -> 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'
+ DELETING = 'deleting'
+ FAILED = 'failed'
+ PENDING = 'pending'
+ STABLE = 'stable'
+ SUSPENDED = 'suspended'
+ UPDATING = 'updating'
+ WAITING = 'waiting'
class ResourceTypeEnum(str, Enum):
@@ -75238,166 +78392,96 @@ class ResourceTypeEnum(str, Enum):
The resource type.
"""
- VPC = 'vpc'
-
-
- class StatusEnum(str, Enum):
- """
- The status of this VPC.
- """
-
- AVAILABLE = 'available'
- DELETING = 'deleting'
- FAILED = 'failed'
- PENDING = 'pending'
-
-
-
-class VPCCSESourceIP:
- """
- VPCCSESourceIP.
+ SHARE_MOUNT_TARGET = 'share_mount_target'
- :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:
+ class TransitEncryptionEnum(str, Enum):
"""
- Initialize a VPCCSESourceIP object.
-
- :param IP ip: The cloud service endpoint source IP address for this zone.
- :param ZoneReference zone: The zone this cloud service endpoint source IP
- resides in.
+ The transit encryption mode for this share mount target:
+ - `none`: Not encrypted in transit
+ - `user_managed`: Encrypted in transit using an instance identity certificate
+ The enumerated values for this property will expand in the future. When processing
+ this property, check for and log unknown values. Optionally halt processing and
+ surface the error, or bypass the resource on which the unexpected property value
+ was encountered.
"""
- self.ip = ip
- self.zone = zone
-
- @classmethod
- def from_dict(cls, _dict: Dict) -> 'VPCCSESourceIP':
- """Initialize a VPCCSESourceIP object from a json dictionary."""
- args = {}
- if 'ip' in _dict:
- args['ip'] = IP.from_dict(_dict.get('ip'))
- else:
- raise ValueError('Required property \'ip\' not present in VPCCSESourceIP JSON')
- if 'zone' in _dict:
- args['zone'] = ZoneReference.from_dict(_dict.get('zone'))
- else:
- raise ValueError('Required property \'zone\' not present in VPCCSESourceIP JSON')
- return cls(**args)
-
- @classmethod
- def _from_dict(cls, _dict):
- """Initialize a VPCCSESourceIP object from a json dictionary."""
- return cls.from_dict(_dict)
-
- def to_dict(self) -> Dict:
- """Return a json dictionary representing this model."""
- _dict = {}
- if hasattr(self, 'ip') and self.ip is not None:
- if isinstance(self.ip, dict):
- _dict['ip'] = self.ip
- else:
- _dict['ip'] = self.ip.to_dict()
- if hasattr(self, 'zone') and self.zone is not None:
- if isinstance(self.zone, dict):
- _dict['zone'] = self.zone
- else:
- _dict['zone'] = self.zone.to_dict()
- return _dict
-
- def _to_dict(self):
- """Return a json dictionary representing this model."""
- return self.to_dict()
-
- def __str__(self) -> str:
- """Return a `str` version of this VPCCSESourceIP object."""
- return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VPCCSESourceIP') -> bool:
- """Return `true` when self and other are equal, false otherwise."""
- if not isinstance(other, self.__class__):
- return False
- return self.__dict__ == other.__dict__
+ NONE = 'none'
+ USER_MANAGED = 'user_managed'
- def __ne__(self, other: 'VPCCSESourceIP') -> bool:
- """Return `true` when self and other are not equal, false otherwise."""
- return not self == other
-class VPCCollection:
+class ShareMountTargetCollection:
"""
- VPCCollection.
+ ShareMountTargetCollection.
- :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
+ :param ShareMountTargetCollectionFirst first: A link to the first page of
+ resources.
+ :param int limit: The maximum number of resources that can be returned by the
request.
- :attr VPCCollectionNext next: (optional) A link to the next page of resources.
- This property is present for all pages
+ :param List[ShareMountTarget] mount_targets: Collection of share mount targets.
+ :param ShareMountTargetCollectionNext next: (optional) A link to the next page
+ of resources. This property is present for all pages
except the last page.
- :attr int total_count: The total number of resources across all pages.
- :attr List[VPC] vpcs: Collection of VPCs.
+ :param int total_count: The total number of resources across all pages.
"""
def __init__(
self,
- first: 'VPCCollectionFirst',
+ first: 'ShareMountTargetCollectionFirst',
limit: int,
+ mount_targets: List['ShareMountTarget'],
total_count: int,
- vpcs: List['VPC'],
*,
- next: 'VPCCollectionNext' = None,
+ next: Optional['ShareMountTargetCollectionNext'] = None,
) -> None:
"""
- Initialize a VPCCollection object.
+ Initialize a ShareMountTargetCollection object.
- :param VPCCollectionFirst first: A link to the first page of resources.
+ :param ShareMountTargetCollectionFirst first: A link to the first page of
+ resources.
:param int limit: The maximum number of resources that can be returned by
the request.
+ :param List[ShareMountTarget] mount_targets: Collection of share mount
+ targets.
:param int total_count: The total number of resources across all pages.
- :param List[VPC] vpcs: Collection of VPCs.
- :param VPCCollectionNext next: (optional) A link to the next page of
- resources. This property is present for all pages
+ :param ShareMountTargetCollectionNext next: (optional) A link to the next
+ page of resources. This property is present for all pages
except the last page.
"""
self.first = first
self.limit = limit
+ self.mount_targets = mount_targets
self.next = next
self.total_count = total_count
- self.vpcs = vpcs
@classmethod
- def from_dict(cls, _dict: Dict) -> 'VPCCollection':
- """Initialize a VPCCollection object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'ShareMountTargetCollection':
+ """Initialize a ShareMountTargetCollection object from a json dictionary."""
args = {}
- if 'first' in _dict:
- args['first'] = VPCCollectionFirst.from_dict(_dict.get('first'))
+ if (first := _dict.get('first')) is not None:
+ args['first'] = ShareMountTargetCollectionFirst.from_dict(first)
else:
- raise ValueError('Required property \'first\' not present in VPCCollection JSON')
- if 'limit' in _dict:
- args['limit'] = _dict.get('limit')
+ raise ValueError('Required property \'first\' not present in ShareMountTargetCollection JSON')
+ if (limit := _dict.get('limit')) is not None:
+ args['limit'] = limit
else:
- raise ValueError('Required property \'limit\' not present in VPCCollection 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')
+ raise ValueError('Required property \'limit\' not present in ShareMountTargetCollection JSON')
+ if (mount_targets := _dict.get('mount_targets')) is not None:
+ args['mount_targets'] = [ShareMountTarget.from_dict(v) for v in mount_targets]
else:
- raise ValueError('Required property \'total_count\' not present in VPCCollection JSON')
- if 'vpcs' in _dict:
- args['vpcs'] = [VPC.from_dict(v) for v in _dict.get('vpcs')]
+ raise ValueError('Required property \'mount_targets\' not present in ShareMountTargetCollection JSON')
+ if (next := _dict.get('next')) is not None:
+ args['next'] = ShareMountTargetCollectionNext.from_dict(next)
+ if (total_count := _dict.get('total_count')) is not None:
+ args['total_count'] = total_count
else:
- raise ValueError('Required property \'vpcs\' not present in VPCCollection JSON')
+ raise ValueError('Required property \'total_count\' not present in ShareMountTargetCollection JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VPCCollection object from a json dictionary."""
+ """Initialize a ShareMountTargetCollection object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -75410,6 +78494,14 @@ def to_dict(self) -> Dict:
_dict['first'] = self.first.to_dict()
if hasattr(self, 'limit') and self.limit is not None:
_dict['limit'] = self.limit
+ if hasattr(self, 'mount_targets') and self.mount_targets is not None:
+ mount_targets_list = []
+ for v in self.mount_targets:
+ if isinstance(v, dict):
+ mount_targets_list.append(v)
+ else:
+ mount_targets_list.append(v.to_dict())
+ _dict['mount_targets'] = mount_targets_list
if hasattr(self, 'next') and self.next is not None:
if isinstance(self.next, dict):
_dict['next'] = self.next
@@ -75417,14 +78509,6 @@ def to_dict(self) -> Dict:
_dict['next'] = self.next.to_dict()
if hasattr(self, 'total_count') and self.total_count is not None:
_dict['total_count'] = self.total_count
- if hasattr(self, 'vpcs') and self.vpcs is not None:
- vpcs_list = []
- for v in self.vpcs:
- if isinstance(v, dict):
- vpcs_list.append(v)
- else:
- vpcs_list.append(v.to_dict())
- _dict['vpcs'] = vpcs_list
return _dict
def _to_dict(self):
@@ -75432,25 +78516,25 @@ 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 ShareMountTargetCollection object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VPCCollection') -> bool:
+ def __eq__(self, other: 'ShareMountTargetCollection') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'VPCCollection') -> bool:
+ def __ne__(self, other: 'ShareMountTargetCollection') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class VPCCollectionFirst:
+class ShareMountTargetCollectionFirst:
"""
A link to the first page of resources.
- :attr str href: The URL for a page of resources.
+ :param str href: The URL for a page of resources.
"""
def __init__(
@@ -75458,25 +78542,25 @@ def __init__(
href: str,
) -> None:
"""
- Initialize a VPCCollectionFirst object.
+ Initialize a ShareMountTargetCollectionFirst object.
:param str href: The URL for a page of resources.
"""
self.href = href
@classmethod
- def from_dict(cls, _dict: Dict) -> 'VPCCollectionFirst':
- """Initialize a VPCCollectionFirst object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'ShareMountTargetCollectionFirst':
+ """Initialize a ShareMountTargetCollectionFirst object from a json dictionary."""
args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'href\' not present in VPCCollectionFirst JSON')
+ raise ValueError('Required property \'href\' not present in ShareMountTargetCollectionFirst JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VPCCollectionFirst object from a json dictionary."""
+ """Initialize a ShareMountTargetCollectionFirst object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -75491,26 +78575,26 @@ 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 ShareMountTargetCollectionFirst object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VPCCollectionFirst') -> bool:
+ def __eq__(self, other: 'ShareMountTargetCollectionFirst') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'VPCCollectionFirst') -> bool:
+ def __ne__(self, other: 'ShareMountTargetCollectionFirst') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class VPCCollectionNext:
+class ShareMountTargetCollectionNext:
"""
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.
+ :param str href: The URL for a page of resources.
"""
def __init__(
@@ -75518,25 +78602,25 @@ def __init__(
href: str,
) -> None:
"""
- Initialize a VPCCollectionNext object.
+ Initialize a ShareMountTargetCollectionNext object.
:param str href: The URL for a page of resources.
"""
self.href = href
@classmethod
- def from_dict(cls, _dict: Dict) -> 'VPCCollectionNext':
- """Initialize a VPCCollectionNext object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'ShareMountTargetCollectionNext':
+ """Initialize a ShareMountTargetCollectionNext object from a json dictionary."""
args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'href\' not present in VPCCollectionNext JSON')
+ raise ValueError('Required property \'href\' not present in ShareMountTargetCollectionNext JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VPCCollectionNext object from a json dictionary."""
+ """Initialize a ShareMountTargetCollectionNext object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -75551,85 +78635,59 @@ 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 ShareMountTargetCollectionNext object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VPCCollectionNext') -> bool:
+ def __eq__(self, other: 'ShareMountTargetCollectionNext') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'VPCCollectionNext') -> bool:
+ def __ne__(self, other: 'ShareMountTargetCollectionNext') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class VPCDNS:
+class ShareMountTargetPatch:
"""
- The DNS configuration for this VPC.
+ ShareMountTargetPatch.
- :attr bool enable_hub: Indicates whether this VPC is enabled as a DNS name
- resolution hub.
- :attr int resolution_binding_count: The number of DNS resolution bindings for
- this VPC.
- :attr VPCDNSResolver resolver: The DNS resolver configuration for the VPC.
+ :param str name: (optional) The name for this share mount target. The name must
+ not be used by another mount target for the file share.
"""
def __init__(
self,
- enable_hub: bool,
- resolution_binding_count: int,
- resolver: 'VPCDNSResolver',
+ *,
+ name: Optional[str] = None,
) -> None:
"""
- Initialize a VPCDNS object.
+ Initialize a ShareMountTargetPatch object.
- :param bool enable_hub: Indicates whether this VPC is enabled as a DNS name
- resolution hub.
- :param int resolution_binding_count: The number of DNS resolution bindings
- for this VPC.
- :param VPCDNSResolver resolver: The DNS resolver configuration for the VPC.
+ :param str name: (optional) The name for this share mount target. The name
+ must not be used by another mount target for the file share.
"""
- self.enable_hub = enable_hub
- self.resolution_binding_count = resolution_binding_count
- self.resolver = resolver
+ self.name = name
@classmethod
- def from_dict(cls, _dict: Dict) -> 'VPCDNS':
- """Initialize a VPCDNS object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'ShareMountTargetPatch':
+ """Initialize a ShareMountTargetPatch object from a json dictionary."""
args = {}
- if 'enable_hub' in _dict:
- args['enable_hub'] = _dict.get('enable_hub')
- else:
- raise ValueError('Required property \'enable_hub\' not present in VPCDNS JSON')
- if 'resolution_binding_count' in _dict:
- args['resolution_binding_count'] = _dict.get('resolution_binding_count')
- else:
- raise ValueError('Required property \'resolution_binding_count\' not present in VPCDNS JSON')
- if 'resolver' in _dict:
- args['resolver'] = _dict.get('resolver')
- else:
- raise ValueError('Required property \'resolver\' not present in VPCDNS JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VPCDNS object from a json dictionary."""
+ """Initialize a ShareMountTargetPatch object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'enable_hub') and self.enable_hub is not None:
- _dict['enable_hub'] = self.enable_hub
- if hasattr(self, 'resolution_binding_count') and self.resolution_binding_count is not None:
- _dict['resolution_binding_count'] = self.resolution_binding_count
- if hasattr(self, 'resolver') and self.resolver is not None:
- if isinstance(self.resolver, dict):
- _dict['resolver'] = self.resolver
- else:
- _dict['resolver'] = self.resolver.to_dict()
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
return _dict
def _to_dict(self):
@@ -75637,302 +78695,159 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this VPCDNS object."""
+ """Return a `str` version of this ShareMountTargetPatch object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VPCDNS') -> bool:
+ def __eq__(self, other: 'ShareMountTargetPatch') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'VPCDNS') -> bool:
+ def __ne__(self, other: 'ShareMountTargetPatch') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class VPCDNSPatch:
+class ShareMountTargetPrototype:
"""
- The DNS configuration for this VPC.
+ ShareMountTargetPrototype.
- :attr bool enable_hub: (optional) Indicates whether this VPC is enabled as a DNS
- name resolution hub.
- Updating the value to `true` requires `allow_dns_resolution_binding` to be
- `true` for all endpoint gateways residing in this VPC.
- Changing the value requires `dns.resolution_binding_count` to be zero.
- :attr VPCDNSResolverPatch resolver: (optional)
+ :param str name: (optional) The name for this share mount target. The name must
+ not be used by another mount target for the file share.
+ :param str transit_encryption: (optional) The transit encryption mode to use for
+ this share mount target:
+ - `none`: Not encrypted in transit.
+ - `user_managed`: Encrypted in transit using an instance identity certificate.
+ The
+ `access_control_mode` for the share must be `security_group`.
"""
def __init__(
self,
*,
- enable_hub: bool = None,
- resolver: 'VPCDNSResolverPatch' = None,
+ name: Optional[str] = None,
+ transit_encryption: Optional[str] = None,
) -> None:
"""
- Initialize a VPCDNSPatch object.
+ Initialize a ShareMountTargetPrototype object.
- :param bool enable_hub: (optional) Indicates whether this VPC is enabled as
- a DNS name resolution hub.
- Updating the value to `true` requires `allow_dns_resolution_binding` to be
- `true` for all endpoint gateways residing in this VPC.
- Changing the value requires `dns.resolution_binding_count` to be zero.
- :param VPCDNSResolverPatch resolver: (optional)
+ :param str name: (optional) The name for this share mount target. The name
+ must not be used by another mount target for the file share.
+ :param str transit_encryption: (optional) The transit encryption mode to
+ use for this share mount target:
+ - `none`: Not encrypted in transit.
+ - `user_managed`: Encrypted in transit using an instance identity
+ certificate. The
+ `access_control_mode` for the share must be
+ `security_group`.
"""
- self.enable_hub = enable_hub
- self.resolver = resolver
-
- @classmethod
- def from_dict(cls, _dict: Dict) -> 'VPCDNSPatch':
- """Initialize a VPCDNSPatch object from a json dictionary."""
- args = {}
- if 'enable_hub' in _dict:
- args['enable_hub'] = _dict.get('enable_hub')
- if 'resolver' in _dict:
- args['resolver'] = VPCDNSResolverPatch.from_dict(_dict.get('resolver'))
- return cls(**args)
-
- @classmethod
- def _from_dict(cls, _dict):
- """Initialize a VPCDNSPatch object from a json dictionary."""
- return cls.from_dict(_dict)
-
- def to_dict(self) -> Dict:
- """Return a json dictionary representing this model."""
- _dict = {}
- if hasattr(self, 'enable_hub') and self.enable_hub is not None:
- _dict['enable_hub'] = self.enable_hub
- if hasattr(self, 'resolver') and self.resolver is not None:
- if isinstance(self.resolver, dict):
- _dict['resolver'] = self.resolver
- else:
- _dict['resolver'] = self.resolver.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 VPCDNSPatch object."""
- return json.dumps(self.to_dict(), indent=2)
-
- def __eq__(self, other: 'VPCDNSPatch') -> bool:
- """Return `true` when self and other are equal, false otherwise."""
- if not isinstance(other, self.__class__):
- return False
- return self.__dict__ == other.__dict__
-
- def __ne__(self, other: 'VPCDNSPatch') -> bool:
- """Return `true` when self and other are not equal, false otherwise."""
- return not self == other
-
-
-class VPCDNSPrototype:
- """
- The DNS configuration for this VPC.
- If unspecified, the system will assign DNS servers capable of resolving hosts and
- endpoint gateways within this VPC, and hosts on the internet.
-
- :attr bool enable_hub: (optional) Indicates whether this VPC is enabled as a DNS
- name resolution hub.
- :attr VPCDNSResolverPrototype resolver: (optional)
- """
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup', 'ShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC'])
+ )
+ raise Exception(msg)
- def __init__(
- self,
- *,
- enable_hub: bool = None,
- resolver: 'VPCDNSResolverPrototype' = None,
- ) -> None:
+ class TransitEncryptionEnum(str, Enum):
"""
- Initialize a VPCDNSPrototype object.
-
- :param bool enable_hub: (optional) Indicates whether this VPC is enabled as
- a DNS name resolution hub.
- :param VPCDNSResolverPrototype resolver: (optional)
+ The transit encryption mode to use for this share mount target:
+ - `none`: Not encrypted in transit.
+ - `user_managed`: Encrypted in transit using an instance identity certificate.
+ The
+ `access_control_mode` for the share must be `security_group`.
"""
- self.enable_hub = enable_hub
- self.resolver = resolver
-
- @classmethod
- def from_dict(cls, _dict: Dict) -> 'VPCDNSPrototype':
- """Initialize a VPCDNSPrototype object from a json dictionary."""
- args = {}
- if 'enable_hub' in _dict:
- args['enable_hub'] = _dict.get('enable_hub')
- if 'resolver' in _dict:
- args['resolver'] = _dict.get('resolver')
- return cls(**args)
-
- @classmethod
- def _from_dict(cls, _dict):
- """Initialize a VPCDNSPrototype object from a json dictionary."""
- return cls.from_dict(_dict)
- def to_dict(self) -> Dict:
- """Return a json dictionary representing this model."""
- _dict = {}
- if hasattr(self, 'enable_hub') and self.enable_hub is not None:
- _dict['enable_hub'] = self.enable_hub
- if hasattr(self, 'resolver') and self.resolver is not None:
- if isinstance(self.resolver, dict):
- _dict['resolver'] = self.resolver
- else:
- _dict['resolver'] = self.resolver.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 VPCDNSPrototype object."""
- return json.dumps(self.to_dict(), indent=2)
-
- def __eq__(self, other: 'VPCDNSPrototype') -> bool:
- """Return `true` when self and other are equal, false otherwise."""
- if not isinstance(other, self.__class__):
- return False
- return self.__dict__ == other.__dict__
+ NONE = 'none'
+ USER_MANAGED = 'user_managed'
- def __ne__(self, other: 'VPCDNSPrototype') -> bool:
- """Return `true` when self and other are not equal, false otherwise."""
- return not self == other
-class VPCDNSResolutionBinding:
+class ShareMountTargetReference:
"""
- VPCDNSResolutionBinding.
+ ShareMountTargetReference.
- :attr datetime created_at: The date and time that the DNS resolution binding was
- created.
- :attr List[EndpointGatewayReferenceRemote] endpoint_gateways: The endpoint
- gateways that have `allow_dns_resolution_binding` set to `true` and reside in
- the VPC that has `dns.enable_hub` set to `false`.
- The endpoint gateways may be remote and therefore may not be directly
- retrievable.
- :attr str href: The URL for this DNS resolution binding.
- :attr str id: The unique identifier for this DNS resolution binding.
- :attr str lifecycle_state: The lifecycle state of the DNS resolution binding.
- :attr str name: The name for this DNS resolution binding. The name is unique
- across all DNS resolution bindings for the VPC.
- :attr str resource_type: The resource type.
- :attr VPCReferenceRemote vpc: The VPC bound to for DNS resolution.
- The VPC may be remote and therefore may not be directly retrievable.
+ :param ShareMountTargetReferenceDeleted deleted: (optional) If present, this
+ property indicates the referenced resource has been deleted, and provides
+ some supplementary information.
+ :param str href: The URL for this share mount target.
+ :param str id: The unique identifier for this share mount target.
+ :param str name: The name for this share mount target. The name is unique across
+ all mount targets for the file share.
+ :param str resource_type: The resource type.
"""
def __init__(
self,
- created_at: datetime,
- endpoint_gateways: List['EndpointGatewayReferenceRemote'],
href: str,
id: str,
- lifecycle_state: str,
name: str,
resource_type: str,
- vpc: 'VPCReferenceRemote',
+ *,
+ deleted: Optional['ShareMountTargetReferenceDeleted'] = None,
) -> None:
"""
- Initialize a VPCDNSResolutionBinding object.
+ Initialize a ShareMountTargetReference object.
- :param datetime created_at: The date and time that the DNS resolution
- binding was created.
- :param List[EndpointGatewayReferenceRemote] endpoint_gateways: The endpoint
- gateways that have `allow_dns_resolution_binding` set to `true` and reside
- in the VPC that has `dns.enable_hub` set to `false`.
- The endpoint gateways may be remote and therefore may not be directly
- retrievable.
- :param str href: The URL for this DNS resolution binding.
- :param str id: The unique identifier for this DNS resolution binding.
- :param str lifecycle_state: The lifecycle state of the DNS resolution
- binding.
- :param str name: The name for this DNS resolution binding. The name is
- unique across all DNS resolution bindings for the VPC.
+ :param str href: The URL for this share mount target.
+ :param str id: The unique identifier for this share mount target.
+ :param str name: The name for this share mount target. The name is unique
+ across all mount targets for the file share.
:param str resource_type: The resource type.
- :param VPCReferenceRemote vpc: The VPC bound to for DNS resolution.
- The VPC may be remote and therefore may not be directly retrievable.
+ :param ShareMountTargetReferenceDeleted deleted: (optional) If present,
+ this property indicates the referenced resource has been deleted, and
+ provides
+ some supplementary information.
"""
- self.created_at = created_at
- self.endpoint_gateways = endpoint_gateways
+ self.deleted = deleted
self.href = href
self.id = id
- self.lifecycle_state = lifecycle_state
self.name = name
self.resource_type = resource_type
- self.vpc = vpc
@classmethod
- def from_dict(cls, _dict: Dict) -> 'VPCDNSResolutionBinding':
- """Initialize a VPCDNSResolutionBinding object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'ShareMountTargetReference':
+ """Initialize a ShareMountTargetReference 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 VPCDNSResolutionBinding JSON')
- if 'endpoint_gateways' in _dict:
- args['endpoint_gateways'] = [EndpointGatewayReferenceRemote.from_dict(v) for v in _dict.get('endpoint_gateways')]
- else:
- raise ValueError('Required property \'endpoint_gateways\' not present in VPCDNSResolutionBinding JSON')
- if 'href' in _dict:
- args['href'] = _dict.get('href')
- else:
- raise ValueError('Required property \'href\' not present in VPCDNSResolutionBinding JSON')
- if 'id' in _dict:
- args['id'] = _dict.get('id')
- else:
- raise ValueError('Required property \'id\' not present in VPCDNSResolutionBinding JSON')
- if 'lifecycle_state' in _dict:
- args['lifecycle_state'] = _dict.get('lifecycle_state')
+ if (deleted := _dict.get('deleted')) is not None:
+ args['deleted'] = ShareMountTargetReferenceDeleted.from_dict(deleted)
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'lifecycle_state\' not present in VPCDNSResolutionBinding JSON')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
+ raise ValueError('Required property \'href\' not present in ShareMountTargetReference JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
else:
- raise ValueError('Required property \'name\' not present in VPCDNSResolutionBinding JSON')
- if 'resource_type' in _dict:
- args['resource_type'] = _dict.get('resource_type')
+ raise ValueError('Required property \'id\' not present in ShareMountTargetReference JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
else:
- raise ValueError('Required property \'resource_type\' not present in VPCDNSResolutionBinding JSON')
- if 'vpc' in _dict:
- args['vpc'] = VPCReferenceRemote.from_dict(_dict.get('vpc'))
+ raise ValueError('Required property \'name\' not present in ShareMountTargetReference JSON')
+ if (resource_type := _dict.get('resource_type')) is not None:
+ args['resource_type'] = resource_type
else:
- raise ValueError('Required property \'vpc\' not present in VPCDNSResolutionBinding JSON')
+ raise ValueError('Required property \'resource_type\' not present in ShareMountTargetReference JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VPCDNSResolutionBinding object from a json dictionary."""
+ """Initialize a ShareMountTargetReference object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'created_at') and self.created_at is not None:
- _dict['created_at'] = datetime_to_string(self.created_at)
- if hasattr(self, 'endpoint_gateways') and self.endpoint_gateways is not None:
- endpoint_gateways_list = []
- for v in self.endpoint_gateways:
- if isinstance(v, dict):
- endpoint_gateways_list.append(v)
- else:
- endpoint_gateways_list.append(v.to_dict())
- _dict['endpoint_gateways'] = endpoint_gateways_list
+ if hasattr(self, 'deleted') and self.deleted is not None:
+ if isinstance(self.deleted, dict):
+ _dict['deleted'] = self.deleted
+ else:
+ _dict['deleted'] = self.deleted.to_dict()
if hasattr(self, 'href') and self.href is not None:
_dict['href'] = self.href
if hasattr(self, 'id') and self.id is not None:
_dict['id'] = self.id
- if hasattr(self, 'lifecycle_state') and self.lifecycle_state is not None:
- _dict['lifecycle_state'] = self.lifecycle_state
if hasattr(self, 'name') and self.name is not None:
_dict['name'] = self.name
if hasattr(self, 'resource_type') and self.resource_type is not None:
_dict['resource_type'] = self.resource_type
- if hasattr(self, 'vpc') and self.vpc is not None:
- if isinstance(self.vpc, dict):
- _dict['vpc'] = self.vpc
- else:
- _dict['vpc'] = self.vpc.to_dict()
return _dict
def _to_dict(self):
@@ -75940,141 +78855,67 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this VPCDNSResolutionBinding object."""
+ """Return a `str` version of this ShareMountTargetReference object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VPCDNSResolutionBinding') -> bool:
+ def __eq__(self, other: 'ShareMountTargetReference') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'VPCDNSResolutionBinding') -> bool:
+ def __ne__(self, other: 'ShareMountTargetReference') -> 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 DNS resolution binding.
- """
-
- DELETING = 'deleting'
- FAILED = 'failed'
- PENDING = 'pending'
- STABLE = 'stable'
- SUSPENDED = 'suspended'
- UPDATING = 'updating'
- WAITING = 'waiting'
-
-
class ResourceTypeEnum(str, Enum):
"""
The resource type.
"""
- VPC_DNS_RESOLUTION_BINDING = 'vpc_dns_resolution_binding'
+ SHARE_MOUNT_TARGET = 'share_mount_target'
-class VPCDNSResolutionBindingCollection:
+class ShareMountTargetReferenceDeleted:
"""
- VPCDNSResolutionBindingCollection.
+ If present, this property indicates the referenced resource has been deleted, and
+ provides some supplementary information.
- :attr List[VPCDNSResolutionBinding] dns_resolution_bindings: Collection of DNS
- resolution bindings for this VPC.
- :attr VPCDNSResolutionBindingCollectionFirst 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 VPCDNSResolutionBindingCollectionNext 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.
+ :param str more_info: Link to documentation about deleted resources.
"""
def __init__(
self,
- dns_resolution_bindings: List['VPCDNSResolutionBinding'],
- first: 'VPCDNSResolutionBindingCollectionFirst',
- limit: int,
- total_count: int,
- *,
- next: 'VPCDNSResolutionBindingCollectionNext' = None,
+ more_info: str,
) -> None:
"""
- Initialize a VPCDNSResolutionBindingCollection object.
+ Initialize a ShareMountTargetReferenceDeleted object.
- :param List[VPCDNSResolutionBinding] dns_resolution_bindings: Collection of
- DNS resolution bindings for this VPC.
- :param VPCDNSResolutionBindingCollectionFirst 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 VPCDNSResolutionBindingCollectionNext 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.dns_resolution_bindings = dns_resolution_bindings
- self.first = first
- self.limit = limit
- self.next = next
- self.total_count = total_count
+ self.more_info = more_info
@classmethod
- def from_dict(cls, _dict: Dict) -> 'VPCDNSResolutionBindingCollection':
- """Initialize a VPCDNSResolutionBindingCollection object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'ShareMountTargetReferenceDeleted':
+ """Initialize a ShareMountTargetReferenceDeleted object from a json dictionary."""
args = {}
- if 'dns_resolution_bindings' in _dict:
- args['dns_resolution_bindings'] = [VPCDNSResolutionBinding.from_dict(v) for v in _dict.get('dns_resolution_bindings')]
+ if (more_info := _dict.get('more_info')) is not None:
+ args['more_info'] = more_info
else:
- raise ValueError('Required property \'dns_resolution_bindings\' not present in VPCDNSResolutionBindingCollection JSON')
- if 'first' in _dict:
- args['first'] = VPCDNSResolutionBindingCollectionFirst.from_dict(_dict.get('first'))
- else:
- raise ValueError('Required property \'first\' not present in VPCDNSResolutionBindingCollection JSON')
- if 'limit' in _dict:
- args['limit'] = _dict.get('limit')
- else:
- raise ValueError('Required property \'limit\' not present in VPCDNSResolutionBindingCollection JSON')
- if 'next' in _dict:
- args['next'] = VPCDNSResolutionBindingCollectionNext.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 VPCDNSResolutionBindingCollection JSON')
+ raise ValueError('Required property \'more_info\' not present in ShareMountTargetReferenceDeleted JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VPCDNSResolutionBindingCollection object from a json dictionary."""
+ """Initialize a ShareMountTargetReferenceDeleted object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'dns_resolution_bindings') and self.dns_resolution_bindings is not None:
- dns_resolution_bindings_list = []
- for v in self.dns_resolution_bindings:
- if isinstance(v, dict):
- dns_resolution_bindings_list.append(v)
- else:
- dns_resolution_bindings_list.append(v.to_dict())
- _dict['dns_resolution_bindings'] = dns_resolution_bindings_list
- if hasattr(self, 'first') and self.first is not None:
- if isinstance(self.first, dict):
- _dict['first'] = self.first
- else:
- _dict['first'] = self.first.to_dict()
- if hasattr(self, 'limit') and self.limit is not None:
- _dict['limit'] = self.limit
- if hasattr(self, 'next') and self.next is not None:
- if isinstance(self.next, dict):
- _dict['next'] = self.next
- else:
- _dict['next'] = self.next.to_dict()
- if hasattr(self, 'total_count') and self.total_count is not None:
- _dict['total_count'] = self.total_count
+ if hasattr(self, 'more_info') and self.more_info is not None:
+ _dict['more_info'] = self.more_info
return _dict
def _to_dict(self):
@@ -76082,58 +78923,169 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this VPCDNSResolutionBindingCollection object."""
+ """Return a `str` version of this ShareMountTargetReferenceDeleted object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VPCDNSResolutionBindingCollection') -> bool:
+ def __eq__(self, other: 'ShareMountTargetReferenceDeleted') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'VPCDNSResolutionBindingCollection') -> bool:
+ def __ne__(self, other: 'ShareMountTargetReferenceDeleted') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class VPCDNSResolutionBindingCollectionFirst:
+class ShareMountTargetVirtualNetworkInterfacePrototype:
"""
- A link to the first page of resources.
+ ShareMountTargetVirtualNetworkInterfacePrototype.
- :attr str href: The URL for a page of resources.
"""
def __init__(
self,
- href: str,
) -> None:
"""
- Initialize a VPCDNSResolutionBindingCollectionFirst object.
+ Initialize a ShareMountTargetVirtualNetworkInterfacePrototype object.
- :param str href: The URL for a page of resources.
"""
- self.href = href
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfacePrototypeShareMountTargetContext', 'ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentity'])
+ )
+ raise Exception(msg)
+
+
+class SharePatch:
+ """
+ SharePatch.
+
+ :param str access_control_mode: (optional) The access control mode for the
+ share:
+ - `security_group`: The security groups on the virtual network interface for a
+ mount target control access to the mount target.
+ - `vpc`: All clients in the VPC for a mount target have access to the mount
+ target.
+ For this property to be changed, the share must have no mount targets and
+ `replication_role` must be `none`.
+ :param int iops: (optional) The maximum input/output operations per second
+ (IOPS) for the file share. The value must be in the range supported by the
+ share's size.
+ For this property to be changed, the share `lifecycle_state` must be `stable`.
+ :param str name: (optional) The name for this share. The name must not be used
+ by another share in the region.
+ :param ShareProfileIdentity profile: (optional) The profile to use for this file
+ share.
+ The requested profile must be in the same `family`.
+ :param str replication_cron_spec: (optional) The cron specification for the file
+ share replication schedule.
+ Replication of a share can be scheduled to occur at most once per hour.
+ For this property to be changed, the share `replication_role` must be `replica`.
+ :param int size: (optional) The size of the file share rounded up to the next
+ gigabyte. The value must not be less than the share's current size, and must not
+ exceed the maximum supported by the share's profile and IOPS.
+ For this property to be changed, the share `lifecycle_state` must be `stable`.
+ :param List[str] user_tags: (optional) Tags for this resource.
+ """
+
+ def __init__(
+ self,
+ *,
+ access_control_mode: Optional[str] = None,
+ iops: Optional[int] = None,
+ name: Optional[str] = None,
+ profile: Optional['ShareProfileIdentity'] = None,
+ replication_cron_spec: Optional[str] = None,
+ size: Optional[int] = None,
+ user_tags: Optional[List[str]] = None,
+ ) -> None:
+ """
+ Initialize a SharePatch object.
+
+ :param str access_control_mode: (optional) The access control mode for the
+ share:
+ - `security_group`: The security groups on the virtual network interface
+ for a
+ mount target control access to the mount target.
+ - `vpc`: All clients in the VPC for a mount target have access to the mount
+ target.
+ For this property to be changed, the share must have no mount targets and
+ `replication_role` must be `none`.
+ :param int iops: (optional) The maximum input/output operations per second
+ (IOPS) for the file share. The value must be in the range supported by the
+ share's size.
+ For this property to be changed, the share `lifecycle_state` must be
+ `stable`.
+ :param str name: (optional) The name for this share. The name must not be
+ used by another share in the region.
+ :param ShareProfileIdentity profile: (optional) The profile to use for this
+ file share.
+ The requested profile must be in the same `family`.
+ :param str replication_cron_spec: (optional) The cron specification for the
+ file share replication schedule.
+ Replication of a share can be scheduled to occur at most once per hour.
+ For this property to be changed, the share `replication_role` must be
+ `replica`.
+ :param int size: (optional) The size of the file share rounded up to the
+ next gigabyte. The value must not be less than the share's current size,
+ and must not exceed the maximum supported by the share's profile and IOPS.
+ For this property to be changed, the share `lifecycle_state` must be
+ `stable`.
+ :param List[str] user_tags: (optional) Tags for this resource.
+ """
+ self.access_control_mode = access_control_mode
+ self.iops = iops
+ self.name = name
+ self.profile = profile
+ self.replication_cron_spec = replication_cron_spec
+ self.size = size
+ self.user_tags = user_tags
@classmethod
- def from_dict(cls, _dict: Dict) -> 'VPCDNSResolutionBindingCollectionFirst':
- """Initialize a VPCDNSResolutionBindingCollectionFirst object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'SharePatch':
+ """Initialize a SharePatch object from a json dictionary."""
args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
- else:
- raise ValueError('Required property \'href\' not present in VPCDNSResolutionBindingCollectionFirst JSON')
+ if (access_control_mode := _dict.get('access_control_mode')) is not None:
+ args['access_control_mode'] = access_control_mode
+ if (iops := _dict.get('iops')) is not None:
+ args['iops'] = iops
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ if (profile := _dict.get('profile')) is not None:
+ args['profile'] = profile
+ if (replication_cron_spec := _dict.get('replication_cron_spec')) is not None:
+ args['replication_cron_spec'] = replication_cron_spec
+ if (size := _dict.get('size')) is not None:
+ args['size'] = size
+ if (user_tags := _dict.get('user_tags')) is not None:
+ args['user_tags'] = user_tags
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VPCDNSResolutionBindingCollectionFirst object from a json dictionary."""
+ """Initialize a SharePatch object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'href') and self.href is not None:
- _dict['href'] = self.href
+ if hasattr(self, 'access_control_mode') and self.access_control_mode is not None:
+ _dict['access_control_mode'] = self.access_control_mode
+ if hasattr(self, 'iops') and self.iops is not None:
+ _dict['iops'] = self.iops
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ if hasattr(self, 'profile') and self.profile is not None:
+ if isinstance(self.profile, dict):
+ _dict['profile'] = self.profile
+ else:
+ _dict['profile'] = self.profile.to_dict()
+ if hasattr(self, 'replication_cron_spec') and self.replication_cron_spec is not None:
+ _dict['replication_cron_spec'] = self.replication_cron_spec
+ if hasattr(self, 'size') and self.size is not None:
+ _dict['size'] = self.size
+ if hasattr(self, 'user_tags') and self.user_tags is not None:
+ _dict['user_tags'] = self.user_tags
return _dict
def _to_dict(self):
@@ -76141,59 +79093,133 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this VPCDNSResolutionBindingCollectionFirst object."""
+ """Return a `str` version of this SharePatch object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VPCDNSResolutionBindingCollectionFirst') -> bool:
+ def __eq__(self, other: 'SharePatch') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'VPCDNSResolutionBindingCollectionFirst') -> bool:
+ def __ne__(self, other: 'SharePatch') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-
-class VPCDNSResolutionBindingCollectionNext:
- """
- A link to the next page of resources. This property is present for all pages except
- the last page.
-
- :attr str href: The URL for a page of resources.
- """
-
- def __init__(
- self,
- href: str,
- ) -> None:
+ class AccessControlModeEnum(str, Enum):
"""
- Initialize a VPCDNSResolutionBindingCollectionNext object.
-
- :param str href: The URL for a page of resources.
+ The access control mode for the share:
+ - `security_group`: The security groups on the virtual network interface for a
+ mount target control access to the mount target.
+ - `vpc`: All clients in the VPC for a mount target have access to the mount
+ target.
+ For this property to be changed, the share must have no mount targets and
+ `replication_role` must be `none`.
+ """
+
+ SECURITY_GROUP = 'security_group'
+ VPC = 'vpc'
+
+
+
+class ShareProfile:
+ """
+ ShareProfile.
+
+ :param ShareProfileCapacity capacity: The permitted capacity range (in
+ gigabytes) for a share with this profile.
+ :param str family: The product family this share profile belongs to.
+ :param str href: The URL for this share profile.
+ :param ShareProfileIOPS iops: The permitted IOPS range for a share with this
+ profile.
+ :param str name: The globally unique name for this share profile.
+ :param str resource_type: The resource type.
+ """
+
+ def __init__(
+ self,
+ capacity: 'ShareProfileCapacity',
+ family: str,
+ href: str,
+ iops: 'ShareProfileIOPS',
+ name: str,
+ resource_type: str,
+ ) -> None:
+ """
+ Initialize a ShareProfile object.
+
+ :param ShareProfileCapacity capacity: The permitted capacity range (in
+ gigabytes) for a share with this profile.
+ :param str family: The product family this share profile belongs to.
+ :param str href: The URL for this share profile.
+ :param ShareProfileIOPS iops: The permitted IOPS range for a share with
+ this profile.
+ :param str name: The globally unique name for this share profile.
+ :param str resource_type: The resource type.
"""
+ self.capacity = capacity
+ self.family = family
self.href = href
+ self.iops = iops
+ self.name = name
+ self.resource_type = resource_type
@classmethod
- def from_dict(cls, _dict: Dict) -> 'VPCDNSResolutionBindingCollectionNext':
- """Initialize a VPCDNSResolutionBindingCollectionNext object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'ShareProfile':
+ """Initialize a ShareProfile object from a json dictionary."""
args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ if (capacity := _dict.get('capacity')) is not None:
+ args['capacity'] = capacity
else:
- raise ValueError('Required property \'href\' not present in VPCDNSResolutionBindingCollectionNext JSON')
+ raise ValueError('Required property \'capacity\' not present in ShareProfile JSON')
+ if (family := _dict.get('family')) is not None:
+ args['family'] = family
+ else:
+ raise ValueError('Required property \'family\' not present in ShareProfile JSON')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
+ else:
+ raise ValueError('Required property \'href\' not present in ShareProfile JSON')
+ if (iops := _dict.get('iops')) is not None:
+ args['iops'] = iops
+ else:
+ raise ValueError('Required property \'iops\' not present in ShareProfile JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ else:
+ raise ValueError('Required property \'name\' not present in ShareProfile JSON')
+ if (resource_type := _dict.get('resource_type')) is not None:
+ args['resource_type'] = resource_type
+ else:
+ raise ValueError('Required property \'resource_type\' not present in ShareProfile JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VPCDNSResolutionBindingCollectionNext object from a json dictionary."""
+ """Initialize a ShareProfile object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
+ if hasattr(self, 'capacity') and self.capacity is not None:
+ if isinstance(self.capacity, dict):
+ _dict['capacity'] = self.capacity
+ else:
+ _dict['capacity'] = self.capacity.to_dict()
+ if hasattr(self, 'family') and self.family is not None:
+ _dict['family'] = self.family
if hasattr(self, 'href') and self.href is not None:
_dict['href'] = self.href
+ if hasattr(self, 'iops') and self.iops is not None:
+ if isinstance(self.iops, dict):
+ _dict['iops'] = self.iops
+ else:
+ _dict['iops'] = self.iops.to_dict()
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ if hasattr(self, 'resource_type') and self.resource_type is not None:
+ _dict['resource_type'] = self.resource_type
return _dict
def _to_dict(self):
@@ -76201,59 +79227,151 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this VPCDNSResolutionBindingCollectionNext object."""
+ """Return a `str` version of this ShareProfile object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VPCDNSResolutionBindingCollectionNext') -> bool:
+ def __eq__(self, other: 'ShareProfile') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'VPCDNSResolutionBindingCollectionNext') -> bool:
+ def __ne__(self, other: 'ShareProfile') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
+ class FamilyEnum(str, Enum):
+ """
+ The product family this share profile belongs to.
+ """
+
+ DEFINED_PERFORMANCE = 'defined_performance'
-class VPCDNSResolutionBindingPatch:
+
+ class ResourceTypeEnum(str, Enum):
+ """
+ The resource type.
+ """
+
+ SHARE_PROFILE = 'share_profile'
+
+
+
+class ShareProfileCapacity:
"""
- VPCDNSResolutionBindingPatch.
+ ShareProfileCapacity.
- :attr str name: (optional) The name for this DNS resolution binding. The name
- must not be used by another DNS resolution binding for the VPC.
"""
def __init__(
self,
+ ) -> None:
+ """
+ Initialize a ShareProfileCapacity object.
+
+ """
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['ShareProfileCapacityFixed', 'ShareProfileCapacityRange', 'ShareProfileCapacityEnum', 'ShareProfileCapacityDependentRange'])
+ )
+ raise Exception(msg)
+
+
+class ShareProfileCollection:
+ """
+ ShareProfileCollection.
+
+ :param ShareProfileCollectionFirst first: A link to the first page of resources.
+ :param int limit: The maximum number of resources that can be returned by the
+ request.
+ :param ShareProfileCollectionNext next: (optional) A link to the next page of
+ resources. This property is present for all pages
+ except the last page.
+ :param List[ShareProfile] profiles: Collection of share profiles.
+ :param int total_count: The total number of resources across all pages.
+ """
+
+ def __init__(
+ self,
+ first: 'ShareProfileCollectionFirst',
+ limit: int,
+ profiles: List['ShareProfile'],
+ total_count: int,
*,
- name: str = None,
+ next: Optional['ShareProfileCollectionNext'] = None,
) -> None:
"""
- Initialize a VPCDNSResolutionBindingPatch object.
+ Initialize a ShareProfileCollection object.
- :param str name: (optional) The name for this DNS resolution binding. The
- name must not be used by another DNS resolution binding for the VPC.
+ :param ShareProfileCollectionFirst first: A link to the first page of
+ resources.
+ :param int limit: The maximum number of resources that can be returned by
+ the request.
+ :param List[ShareProfile] profiles: Collection of share profiles.
+ :param int total_count: The total number of resources across all pages.
+ :param ShareProfileCollectionNext next: (optional) A link to the next page
+ of resources. This property is present for all pages
+ except the last page.
"""
- self.name = name
+ self.first = first
+ self.limit = limit
+ self.next = next
+ self.profiles = profiles
+ self.total_count = total_count
@classmethod
- def from_dict(cls, _dict: Dict) -> 'VPCDNSResolutionBindingPatch':
- """Initialize a VPCDNSResolutionBindingPatch object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'ShareProfileCollection':
+ """Initialize a ShareProfileCollection object from a json dictionary."""
args = {}
- if 'name' in _dict:
- args['name'] = _dict.get('name')
+ if (first := _dict.get('first')) is not None:
+ args['first'] = ShareProfileCollectionFirst.from_dict(first)
+ else:
+ raise ValueError('Required property \'first\' not present in ShareProfileCollection JSON')
+ if (limit := _dict.get('limit')) is not None:
+ args['limit'] = limit
+ else:
+ raise ValueError('Required property \'limit\' not present in ShareProfileCollection JSON')
+ if (next := _dict.get('next')) is not None:
+ args['next'] = ShareProfileCollectionNext.from_dict(next)
+ if (profiles := _dict.get('profiles')) is not None:
+ args['profiles'] = [ShareProfile.from_dict(v) for v in profiles]
+ else:
+ raise ValueError('Required property \'profiles\' not present in ShareProfileCollection JSON')
+ if (total_count := _dict.get('total_count')) is not None:
+ args['total_count'] = total_count
+ else:
+ raise ValueError('Required property \'total_count\' not present in ShareProfileCollection JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VPCDNSResolutionBindingPatch object from a json dictionary."""
+ """Initialize a ShareProfileCollection object from 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:
+ if isinstance(self.first, dict):
+ _dict['first'] = self.first
+ else:
+ _dict['first'] = self.first.to_dict()
+ if hasattr(self, 'limit') and self.limit is not None:
+ _dict['limit'] = self.limit
+ if hasattr(self, 'next') and self.next is not None:
+ if isinstance(self.next, dict):
+ _dict['next'] = self.next
+ else:
+ _dict['next'] = self.next.to_dict()
+ if hasattr(self, 'profiles') and self.profiles is not None:
+ profiles_list = []
+ for v in self.profiles:
+ if isinstance(v, dict):
+ profiles_list.append(v)
+ else:
+ profiles_list.append(v.to_dict())
+ _dict['profiles'] = profiles_list
+ if hasattr(self, 'total_count') and self.total_count is not None:
+ _dict['total_count'] = self.total_count
return _dict
def _to_dict(self):
@@ -76261,195 +79379,118 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this VPCDNSResolutionBindingPatch object."""
+ """Return a `str` version of this ShareProfileCollection object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VPCDNSResolutionBindingPatch') -> bool:
+ def __eq__(self, other: 'ShareProfileCollection') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'VPCDNSResolutionBindingPatch') -> bool:
+ def __ne__(self, other: 'ShareProfileCollection') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class VPCDNSResolver:
+class ShareProfileCollectionFirst:
"""
- VPCDNSResolver.
+ A link to the first page of resources.
- :attr List[DNSServer] servers: The DNS servers for this VPC. The servers are
- populated:
- - by the system when `dns.resolver.type` is `system`
- - using the DNS servers in `dns.resolver.vpc` when `dns.resolver.type` is
- `delegated`
- - using `dns.resolver.manual_servers` when the `dns.resolver.type` is `manual`.
- :attr str type: The type of the DNS resolver used for the VPC.
- - `delegated`: DNS server addresses are provided by the DNS resolver of the VPC
- specified in `dns.resolver.vpc`.
- - `manual`: DNS server addresses are specified in `dns.resolver.manual_servers`.
- - `system`: DNS server addresses are provided by the system.
+ :param str href: The URL for a page of resources.
"""
def __init__(
self,
- servers: List['DNSServer'],
- type: str,
+ href: str,
) -> None:
"""
- Initialize a VPCDNSResolver object.
+ Initialize a ShareProfileCollectionFirst object.
- :param List[DNSServer] servers: The DNS servers for this VPC. The servers
- are populated:
- - by the system when `dns.resolver.type` is `system`
- - using the DNS servers in `dns.resolver.vpc` when `dns.resolver.type` is
- `delegated`
- - using `dns.resolver.manual_servers` when the `dns.resolver.type` is
- `manual`.
- :param str type: The type of the DNS resolver used for the VPC.
- - `delegated`: DNS server addresses are provided by the DNS resolver of the
- VPC
- specified in `dns.resolver.vpc`.
- - `manual`: DNS server addresses are specified in
- `dns.resolver.manual_servers`.
- - `system`: DNS server addresses are provided by the system.
+ :param str href: The URL for a page of resources.
"""
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['VPCDNSResolverTypeDelegated', 'VPCDNSResolverTypeManual', 'VPCDNSResolverTypeSystem'])
- )
- raise Exception(msg)
+ self.href = href
- class TypeEnum(str, Enum):
- """
- The type of the DNS resolver used for the VPC.
- - `delegated`: DNS server addresses are provided by the DNS resolver of the VPC
- specified in `dns.resolver.vpc`.
- - `manual`: DNS server addresses are specified in `dns.resolver.manual_servers`.
- - `system`: DNS server addresses are provided by the system.
- """
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'ShareProfileCollectionFirst':
+ """Initialize a ShareProfileCollectionFirst object from a json dictionary."""
+ args = {}
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
+ else:
+ raise ValueError('Required property \'href\' not present in ShareProfileCollectionFirst JSON')
+ return cls(**args)
- DELEGATED = 'delegated'
- MANUAL = 'manual'
- SYSTEM = 'system'
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a ShareProfileCollectionFirst object from 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 ShareProfileCollectionFirst object."""
+ return json.dumps(self.to_dict(), indent=2)
-class VPCDNSResolverPatch:
+ def __eq__(self, other: 'ShareProfileCollectionFirst') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'ShareProfileCollectionFirst') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+
+class ShareProfileCollectionNext:
"""
- VPCDNSResolverPatch.
+ A link to the next page of resources. This property is present for all pages except
+ the last page.
- :attr List[DNSServerPrototype] manual_servers: (optional) The DNS servers to use
- for this VPC, replacing any existing servers. All the DNS servers must either:
- - have a unique `zone_affinity`, or
- - not have a `zone_affinity`.
- `dns.resolver.manual_servers` must be set if and only if `dns.resolver.type` is
- `manual`.
- :attr str type: (optional) The type of the DNS resolver to use.
- - `delegated`: DNS server addresses will be provided by the resolver for the VPC
- specified in `dns.resolver.vpc`. Requires `dns.enable_hub` to be
- `false`.
- - `manual`: DNS server addresses are specified in `dns.resolver.manual_servers`.
- - `system`: DNS server addresses will be provided by the system and depend on
- the
- configuration.
- Updating from `manual` requires `dns.resolver.manual_servers` to be specified as
- `null`.
- Updating to `manual` requires `dns.resolver.manual_servers` to be specified and
- not empty.
- Updating from `delegated` requires `dns.resolver.vpc` to be specified as `null`.
- :attr VPCDNSResolverVPCPatch vpc: (optional) The VPC to provide DNS server
- addresses for this VPC. The specified VPC must be configured
- with a [DNS Services](https://cloud.ibm.com/docs/dns-svcs) custom resolver and
- must be in
- one of this VPC's DNS resolution bindings.
- Specify `null` to remove an existing VPC.
- This property must be set if and only if `dns.resolver.type` is `delegated`.
+ :param str href: The URL for a page of resources.
"""
def __init__(
self,
- *,
- manual_servers: List['DNSServerPrototype'] = None,
- type: str = None,
- vpc: 'VPCDNSResolverVPCPatch' = None,
+ href: str,
) -> None:
"""
- Initialize a VPCDNSResolverPatch object.
+ Initialize a ShareProfileCollectionNext object.
- :param List[DNSServerPrototype] manual_servers: (optional) The DNS servers
- to use for this VPC, replacing any existing servers. All the DNS servers
- must either:
- - have a unique `zone_affinity`, or
- - not have a `zone_affinity`.
- `dns.resolver.manual_servers` must be set if and only if
- `dns.resolver.type` is `manual`.
- :param str type: (optional) The type of the DNS resolver to use.
- - `delegated`: DNS server addresses will be provided by the resolver for
- the VPC
- specified in `dns.resolver.vpc`. Requires `dns.enable_hub`
- to be
- `false`.
- - `manual`: DNS server addresses are specified in
- `dns.resolver.manual_servers`.
- - `system`: DNS server addresses will be provided by the system and depend
- on the
- configuration.
- Updating from `manual` requires `dns.resolver.manual_servers` to be
- specified as
- `null`.
- Updating to `manual` requires `dns.resolver.manual_servers` to be specified
- and not empty.
- Updating from `delegated` requires `dns.resolver.vpc` to be specified as
- `null`.
- :param VPCDNSResolverVPCPatch vpc: (optional) The VPC to provide DNS server
- addresses for this VPC. The specified VPC must be configured
- with a [DNS Services](https://cloud.ibm.com/docs/dns-svcs) custom resolver
- and must be in
- one of this VPC's DNS resolution bindings.
- Specify `null` to remove an existing VPC.
- This property must be set if and only if `dns.resolver.type` is
- `delegated`.
+ :param str href: The URL for a page of resources.
"""
- self.manual_servers = manual_servers
- self.type = type
- self.vpc = vpc
+ self.href = href
@classmethod
- def from_dict(cls, _dict: Dict) -> 'VPCDNSResolverPatch':
- """Initialize a VPCDNSResolverPatch object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'ShareProfileCollectionNext':
+ """Initialize a ShareProfileCollectionNext object from a json dictionary."""
args = {}
- if 'manual_servers' in _dict:
- args['manual_servers'] = [DNSServerPrototype.from_dict(v) for v in _dict.get('manual_servers')]
- if 'type' in _dict:
- args['type'] = _dict.get('type')
- if 'vpc' in _dict:
- args['vpc'] = _dict.get('vpc')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
+ else:
+ raise ValueError('Required property \'href\' not present in ShareProfileCollectionNext JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VPCDNSResolverPatch object from a json dictionary."""
+ """Initialize a ShareProfileCollectionNext object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'manual_servers') and self.manual_servers is not None:
- manual_servers_list = []
- for v in self.manual_servers:
- if isinstance(v, dict):
- manual_servers_list.append(v)
- else:
- manual_servers_list.append(v.to_dict())
- _dict['manual_servers'] = manual_servers_list
- if hasattr(self, 'type') and self.type is not None:
- _dict['type'] = self.type
- if hasattr(self, 'vpc') and self.vpc is not None:
- if isinstance(self.vpc, dict):
- _dict['vpc'] = self.vpc
- else:
- _dict['vpc'] = self.vpc.to_dict()
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
return _dict
def _to_dict(self):
@@ -76457,92 +79498,42 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this VPCDNSResolverPatch object."""
+ """Return a `str` version of this ShareProfileCollectionNext object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VPCDNSResolverPatch') -> bool:
+ def __eq__(self, other: 'ShareProfileCollectionNext') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'VPCDNSResolverPatch') -> bool:
+ def __ne__(self, other: 'ShareProfileCollectionNext') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class TypeEnum(str, Enum):
- """
- The type of the DNS resolver to use.
- - `delegated`: DNS server addresses will be provided by the resolver for the VPC
- specified in `dns.resolver.vpc`. Requires `dns.enable_hub` to be
- `false`.
- - `manual`: DNS server addresses are specified in `dns.resolver.manual_servers`.
- - `system`: DNS server addresses will be provided by the system and depend on the
- configuration.
- Updating from `manual` requires `dns.resolver.manual_servers` to be specified as
- `null`.
- Updating to `manual` requires `dns.resolver.manual_servers` to be specified and
- not empty.
- Updating from `delegated` requires `dns.resolver.vpc` to be specified as `null`.
- """
-
- DELEGATED = 'delegated'
- MANUAL = 'manual'
- SYSTEM = 'system'
-
-
-class VPCDNSResolverPrototype:
+class ShareProfileIOPS:
"""
- VPCDNSResolverPrototype.
+ ShareProfileIOPS.
- :attr str type: (optional) The type of the DNS resolver to use.
- - `manual`: DNS server addresses are specified in `dns.resolver.manual_servers`.
- - `system`: DNS server addresses will be provided by the system and depend on
- the
- configuration.
"""
def __init__(
self,
- *,
- type: str = None,
) -> None:
"""
- Initialize a VPCDNSResolverPrototype object.
+ Initialize a ShareProfileIOPS object.
- :param str type: (optional) The type of the DNS resolver to use.
- - `manual`: DNS server addresses are specified in
- `dns.resolver.manual_servers`.
- - `system`: DNS server addresses will be provided by the system and depend
- on the
- configuration.
"""
msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['VPCDNSResolverPrototypeVPCDNSResolverTypeManualPrototype', 'VPCDNSResolverPrototypeVPCDNSResolverTypeSystemPrototype'])
+ ", ".join(['ShareProfileIOPSFixed', 'ShareProfileIOPSRange', 'ShareProfileIOPSEnum', 'ShareProfileIOPSDependentRange'])
)
raise Exception(msg)
- class TypeEnum(str, Enum):
- """
- The type of the DNS resolver to use.
- - `manual`: DNS server addresses are specified in `dns.resolver.manual_servers`.
- - `system`: DNS server addresses will be provided by the system and depend on the
- configuration.
- """
-
- MANUAL = 'manual'
- SYSTEM = 'system'
-
-
-class VPCDNSResolverVPCPatch:
+class ShareProfileIdentity:
"""
- The VPC to provide DNS server addresses for this VPC. The specified VPC must be
- configured with a [DNS Services](https://cloud.ibm.com/docs/dns-svcs) custom resolver
- and must be in one of this VPC's DNS resolution bindings.
- Specify `null` to remove an existing VPC.
- This property must be set if and only if `dns.resolver.type` is `delegated`.
+ Identifies a share profile by a unique property.
"""
@@ -76550,76 +79541,73 @@ def __init__(
self,
) -> None:
"""
- Initialize a VPCDNSResolverVPCPatch object.
+ Initialize a ShareProfileIdentity object.
"""
msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['VPCDNSResolverVPCPatchVPCIdentityById', 'VPCDNSResolverVPCPatchVPCIdentityByCRN', 'VPCDNSResolverVPCPatchVPCIdentityByHref'])
+ ", ".join(['ShareProfileIdentityByName', 'ShareProfileIdentityByHref'])
)
raise Exception(msg)
-class VPCHealthReason:
+class ShareProfileReference:
"""
- VPCHealthReason.
+ ShareProfileReference.
- :attr str code: A snake case string succinctly identifying the reason for this
- health state.
- :attr str message: An explanation of the reason for this health state.
- :attr str more_info: (optional) Link to documentation about the reason for this
- health state.
+ :param str href: The URL for this share profile.
+ :param str name: The globally unique name for this share profile.
+ :param str resource_type: The resource type.
"""
def __init__(
self,
- code: str,
- message: str,
- *,
- more_info: str = None,
+ href: str,
+ name: str,
+ resource_type: str,
) -> None:
"""
- Initialize a VPCHealthReason object.
+ Initialize a ShareProfileReference object.
- :param str code: A snake case string succinctly identifying the reason for
- this health state.
- :param str message: An explanation of the reason for this health state.
- :param str more_info: (optional) Link to documentation about the reason for
- this health state.
+ :param str href: The URL for this share profile.
+ :param str name: The globally unique name for this share profile.
+ :param str resource_type: The resource type.
"""
- self.code = code
- self.message = message
- self.more_info = more_info
+ self.href = href
+ self.name = name
+ self.resource_type = resource_type
@classmethod
- def from_dict(cls, _dict: Dict) -> 'VPCHealthReason':
- """Initialize a VPCHealthReason object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'ShareProfileReference':
+ """Initialize a ShareProfileReference object from a json dictionary."""
args = {}
- if 'code' in _dict:
- args['code'] = _dict.get('code')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'code\' not present in VPCHealthReason JSON')
- if 'message' in _dict:
- args['message'] = _dict.get('message')
+ raise ValueError('Required property \'href\' not present in ShareProfileReference JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
else:
- raise ValueError('Required property \'message\' not present in VPCHealthReason JSON')
- if 'more_info' in _dict:
- args['more_info'] = _dict.get('more_info')
+ raise ValueError('Required property \'name\' not present in ShareProfileReference JSON')
+ if (resource_type := _dict.get('resource_type')) is not None:
+ args['resource_type'] = resource_type
+ else:
+ raise ValueError('Required property \'resource_type\' not present in ShareProfileReference JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VPCHealthReason object from a json dictionary."""
+ """Initialize a ShareProfileReference object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'code') and self.code is not None:
- _dict['code'] = self.code
- if hasattr(self, 'message') and self.message is not None:
- _dict['message'] = self.message
- if hasattr(self, 'more_info') and self.more_info is not None:
- _dict['more_info'] = self.more_info
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ if hasattr(self, 'resource_type') and self.resource_type is not None:
+ _dict['resource_type'] = self.resource_type
return _dict
def _to_dict(self):
@@ -76627,214 +79615,256 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this VPCHealthReason object."""
+ """Return a `str` version of this ShareProfileReference object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VPCHealthReason') -> bool:
+ def __eq__(self, other: 'ShareProfileReference') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'VPCHealthReason') -> bool:
+ def __ne__(self, other: 'ShareProfileReference') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class CodeEnum(str, Enum):
+ class ResourceTypeEnum(str, Enum):
"""
- A snake case string succinctly identifying the reason for this health state.
+ The resource type.
"""
- INTERNAL_ERROR = 'internal_error'
+ SHARE_PROFILE = 'share_profile'
-class VPCIdentity:
+class SharePrototype:
"""
- Identifies a VPC by a unique property.
+ SharePrototype.
+ :param int iops: (optional) The maximum input/output operations per second
+ (IOPS) for the file share. The share must be in the `defined_performance`
+ profile family, and the value must be in the range supported by the share's
+ specified size.
+ In addition, each client accessing the share will be restricted to 48,000 IOPS.
+ :param List[ShareMountTargetPrototype] mount_targets: (optional) The mount
+ targets for the file share. Each mount target must be in a unique VPC.
+ :param str name: (optional) The name for this share. The name must not be used
+ by another share in the region. If unspecified, the name will be a hyphenated
+ list of randomly-selected words.
+ :param ShareProfileIdentity profile: The
+ [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-profiles) to use
+ for this file share. The profile must support the share's specified IOPS and
+ size.
+ :param SharePrototypeShareContext replica_share: (optional) Configuration for a
+ replica file share to create and associate with this file share. If
+ unspecified, a replica may be subsequently added by creating a new file share
+ with a
+ `source_share` referencing this file share.
+ :param List[str] user_tags: (optional) Tags for this resource.
+ :param ZoneIdentity zone: The zone this file share will reside in.
+ For a replica share, this must be a different zone in the same region as the
+ source share.
"""
def __init__(
self,
+ profile: 'ShareProfileIdentity',
+ zone: 'ZoneIdentity',
+ *,
+ iops: Optional[int] = None,
+ mount_targets: Optional[List['ShareMountTargetPrototype']] = None,
+ name: Optional[str] = None,
+ replica_share: Optional['SharePrototypeShareContext'] = None,
+ user_tags: Optional[List[str]] = None,
) -> None:
"""
- Initialize a VPCIdentity object.
+ Initialize a SharePrototype object.
+ :param ShareProfileIdentity profile: The
+ [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-profiles)
+ to use
+ for this file share. The profile must support the share's specified IOPS
+ and size.
+ :param ZoneIdentity zone: The zone this file share will reside in.
+ For a replica share, this must be a different zone in the same region as
+ the
+ source share.
+ :param int iops: (optional) The maximum input/output operations per second
+ (IOPS) for the file share. The share must be in the `defined_performance`
+ profile family, and the value must be in the range supported by the share's
+ specified size.
+ In addition, each client accessing the share will be restricted to 48,000
+ IOPS.
+ :param List[ShareMountTargetPrototype] mount_targets: (optional) The mount
+ targets for the file share. Each mount target must be in a unique VPC.
+ :param str name: (optional) The name for this share. The name must not be
+ used by another share in the region. If unspecified, the name will be a
+ hyphenated list of randomly-selected words.
+ :param SharePrototypeShareContext replica_share: (optional) Configuration
+ for a replica file share to create and associate with this file share. If
+ unspecified, a replica may be subsequently added by creating a new file
+ share with a
+ `source_share` referencing this file share.
+ :param List[str] user_tags: (optional) Tags for this resource.
"""
msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['VPCIdentityById', 'VPCIdentityByCRN', 'VPCIdentityByHref'])
+ ", ".join(['SharePrototypeShareBySize', 'SharePrototypeShareBySourceShare'])
)
raise Exception(msg)
-class VPCPatch:
- """
- VPCPatch.
-
- :attr VPCDNSPatch dns: (optional) The DNS configuration for this VPC.
- :attr str name: (optional) The name for this VPC. The name must not be used by
- another VPC in the region.
- """
-
- def __init__(
- self,
- *,
- dns: 'VPCDNSPatch' = None,
- name: str = None,
- ) -> None:
- """
- Initialize a VPCPatch object.
-
- :param VPCDNSPatch dns: (optional) The DNS configuration for this VPC.
- :param str name: (optional) The name for this VPC. The name must not be
- used by another VPC in the region.
- """
- self.dns = dns
- self.name = name
-
- @classmethod
- def from_dict(cls, _dict: Dict) -> 'VPCPatch':
- """Initialize a VPCPatch object from a json dictionary."""
- args = {}
- if 'dns' in _dict:
- args['dns'] = VPCDNSPatch.from_dict(_dict.get('dns'))
- if 'name' in _dict:
- args['name'] = _dict.get('name')
- return cls(**args)
-
- @classmethod
- def _from_dict(cls, _dict):
- """Initialize a VPCPatch object from a json dictionary."""
- return cls.from_dict(_dict)
-
- def to_dict(self) -> Dict:
- """Return a json dictionary representing this model."""
- _dict = {}
- if hasattr(self, 'dns') and self.dns is not None:
- if isinstance(self.dns, dict):
- _dict['dns'] = self.dns
- else:
- _dict['dns'] = self.dns.to_dict()
- if hasattr(self, 'name') and self.name is not None:
- _dict['name'] = self.name
- return _dict
-
- def _to_dict(self):
- """Return a json dictionary representing this model."""
- return self.to_dict()
-
- def __str__(self) -> str:
- """Return a `str` version of this VPCPatch object."""
- return json.dumps(self.to_dict(), indent=2)
-
- def __eq__(self, other: 'VPCPatch') -> bool:
- """Return `true` when self and other are equal, false otherwise."""
- if not isinstance(other, self.__class__):
- return False
- return self.__dict__ == other.__dict__
-
- def __ne__(self, other: 'VPCPatch') -> bool:
- """Return `true` when self and other are not equal, false otherwise."""
- return not self == other
-
-
-class VPCReference:
+class SharePrototypeShareContext:
"""
- VPCReference.
+ Configuration for a replica file share to create and associate with this file share.
+ If unspecified, a replica may be subsequently added by creating a new file share with
+ a
+ `source_share` referencing this file share.
- :attr str crn: The CRN for this VPC.
- :attr VPCReferenceDeleted deleted: (optional) If present, this property
- indicates the referenced resource has been deleted, and provides
- some supplementary information.
- :attr str href: The URL for this VPC.
- :attr str id: The unique identifier for this VPC.
- :attr str name: The name for this VPC. The name is unique across all VPCs in the
- region.
- :attr str resource_type: The resource type.
+ :param int iops: (optional) The maximum input/output operations per second
+ (IOPS) for the file share. The share must be in the `defined_performance`
+ profile family, and the value must be in the range supported by the share's
+ specified size.
+ In addition, each client accessing the share will be restricted to 48,000 IOPS.
+ :param List[ShareMountTargetPrototype] mount_targets: (optional) The mount
+ targets for this replica file share. Each mount target must be in a unique VPC.
+ A replica's mount targets must be mounted read-only.
+ :param str name: (optional) The name for this share. The name must not be used
+ by another share in the region. If unspecified, the name will be a hyphenated
+ list of randomly-selected words.
+ :param ShareProfileIdentity profile: The
+ [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-profiles) to use
+ for this file share. The profile must support the share's specified IOPS and
+ size.
+ :param str replication_cron_spec: The cron specification for the file share
+ replication schedule.
+ Replication of a share can be scheduled to occur at most once per hour.
+ :param ResourceGroupIdentity resource_group: (optional) The resource group to
+ use. If unspecified, the resource group from
+ the source share will be used.
+ :param List[str] user_tags: (optional) Tags for this resource.
+ :param ZoneIdentity zone: The zone this replica file share will reside in.
+ Must be a different zone in the same region as the source share.
"""
def __init__(
self,
- crn: str,
- href: str,
- id: str,
- name: str,
- resource_type: str,
+ profile: 'ShareProfileIdentity',
+ replication_cron_spec: str,
+ zone: 'ZoneIdentity',
*,
- deleted: 'VPCReferenceDeleted' = None,
+ iops: Optional[int] = None,
+ mount_targets: Optional[List['ShareMountTargetPrototype']] = None,
+ name: Optional[str] = None,
+ resource_group: Optional['ResourceGroupIdentity'] = None,
+ user_tags: Optional[List[str]] = None,
) -> None:
"""
- Initialize a VPCReference object.
+ Initialize a SharePrototypeShareContext object.
- :param str crn: The CRN for this VPC.
- :param str href: The URL for this VPC.
- :param str id: The unique identifier for this VPC.
- :param str name: The name for this VPC. The name is unique across all VPCs
- in the region.
- :param str resource_type: The resource type.
- :param VPCReferenceDeleted deleted: (optional) If present, this property
- indicates the referenced resource has been deleted, and provides
- some supplementary information.
+ :param ShareProfileIdentity profile: The
+ [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-profiles)
+ to use
+ for this file share. The profile must support the share's specified IOPS
+ and size.
+ :param str replication_cron_spec: The cron specification for the file share
+ replication schedule.
+ Replication of a share can be scheduled to occur at most once per hour.
+ :param ZoneIdentity zone: The zone this replica file share will reside in.
+ Must be a different zone in the same region as the source share.
+ :param int iops: (optional) The maximum input/output operations per second
+ (IOPS) for the file share. The share must be in the `defined_performance`
+ profile family, and the value must be in the range supported by the share's
+ specified size.
+ In addition, each client accessing the share will be restricted to 48,000
+ IOPS.
+ :param List[ShareMountTargetPrototype] mount_targets: (optional) The mount
+ targets for this replica file share. Each mount target must be in a unique
+ VPC.
+ A replica's mount targets must be mounted read-only.
+ :param str name: (optional) The name for this share. The name must not be
+ used by another share in the region. If unspecified, the name will be a
+ hyphenated list of randomly-selected words.
+ :param ResourceGroupIdentity resource_group: (optional) The resource group
+ to use. If unspecified, the resource group from
+ the source share will be used.
+ :param List[str] user_tags: (optional) Tags for this resource.
"""
- self.crn = crn
- self.deleted = deleted
- self.href = href
- self.id = id
+ self.iops = iops
+ self.mount_targets = mount_targets
self.name = name
- self.resource_type = resource_type
+ self.profile = profile
+ self.replication_cron_spec = replication_cron_spec
+ self.resource_group = resource_group
+ self.user_tags = user_tags
+ self.zone = zone
@classmethod
- def from_dict(cls, _dict: Dict) -> 'VPCReference':
- """Initialize a VPCReference object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'SharePrototypeShareContext':
+ """Initialize a SharePrototypeShareContext object from a json dictionary."""
args = {}
- if 'crn' in _dict:
- args['crn'] = _dict.get('crn')
- else:
- raise ValueError('Required property \'crn\' not present in VPCReference JSON')
- if 'deleted' in _dict:
- args['deleted'] = VPCReferenceDeleted.from_dict(_dict.get('deleted'))
- if 'href' in _dict:
- args['href'] = _dict.get('href')
- else:
- raise ValueError('Required property \'href\' not present in VPCReference JSON')
- if 'id' in _dict:
- args['id'] = _dict.get('id')
+ if (iops := _dict.get('iops')) is not None:
+ args['iops'] = iops
+ if (mount_targets := _dict.get('mount_targets')) is not None:
+ args['mount_targets'] = mount_targets
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ if (profile := _dict.get('profile')) is not None:
+ args['profile'] = profile
else:
- raise ValueError('Required property \'id\' not present in VPCReference JSON')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
+ raise ValueError('Required property \'profile\' not present in SharePrototypeShareContext JSON')
+ if (replication_cron_spec := _dict.get('replication_cron_spec')) is not None:
+ args['replication_cron_spec'] = replication_cron_spec
else:
- raise ValueError('Required property \'name\' not present in VPCReference JSON')
- if 'resource_type' in _dict:
- args['resource_type'] = _dict.get('resource_type')
+ raise ValueError('Required property \'replication_cron_spec\' not present in SharePrototypeShareContext JSON')
+ if (resource_group := _dict.get('resource_group')) is not None:
+ args['resource_group'] = resource_group
+ if (user_tags := _dict.get('user_tags')) is not None:
+ args['user_tags'] = user_tags
+ if (zone := _dict.get('zone')) is not None:
+ args['zone'] = zone
else:
- raise ValueError('Required property \'resource_type\' not present in VPCReference JSON')
+ raise ValueError('Required property \'zone\' not present in SharePrototypeShareContext JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VPCReference object from a json dictionary."""
+ """Initialize a SharePrototypeShareContext object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'crn') and self.crn is not None:
- _dict['crn'] = self.crn
- if hasattr(self, 'deleted') and self.deleted is not None:
- if isinstance(self.deleted, dict):
- _dict['deleted'] = self.deleted
- else:
- _dict['deleted'] = self.deleted.to_dict()
- if hasattr(self, 'href') and self.href is not None:
- _dict['href'] = self.href
- if hasattr(self, 'id') and self.id is not None:
- _dict['id'] = self.id
+ if hasattr(self, 'iops') and self.iops is not None:
+ _dict['iops'] = self.iops
+ if hasattr(self, 'mount_targets') and self.mount_targets is not None:
+ mount_targets_list = []
+ for v in self.mount_targets:
+ if isinstance(v, dict):
+ mount_targets_list.append(v)
+ else:
+ mount_targets_list.append(v.to_dict())
+ _dict['mount_targets'] = mount_targets_list
if hasattr(self, 'name') and self.name is not None:
_dict['name'] = self.name
- if hasattr(self, 'resource_type') and self.resource_type is not None:
- _dict['resource_type'] = self.resource_type
+ if hasattr(self, 'profile') and self.profile is not None:
+ if isinstance(self.profile, dict):
+ _dict['profile'] = self.profile
+ else:
+ _dict['profile'] = self.profile.to_dict()
+ if hasattr(self, 'replication_cron_spec') and self.replication_cron_spec is not None:
+ _dict['replication_cron_spec'] = self.replication_cron_spec
+ if hasattr(self, 'resource_group') and self.resource_group is not None:
+ if isinstance(self.resource_group, dict):
+ _dict['resource_group'] = self.resource_group
+ else:
+ _dict['resource_group'] = self.resource_group.to_dict()
+ if hasattr(self, 'user_tags') and self.user_tags is not None:
+ _dict['user_tags'] = self.user_tags
+ if hasattr(self, 'zone') and self.zone is not None:
+ if isinstance(self.zone, dict):
+ _dict['zone'] = self.zone
+ else:
+ _dict['zone'] = self.zone.to_dict()
return _dict
def _to_dict(self):
@@ -76842,45 +79872,36 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this VPCReference object."""
+ """Return a `str` version of this SharePrototypeShareContext object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VPCReference') -> bool:
+ def __eq__(self, other: 'SharePrototypeShareContext') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'VPCReference') -> bool:
+ def __ne__(self, other: 'SharePrototypeShareContext') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class ResourceTypeEnum(str, Enum):
- """
- The resource type.
- """
-
- VPC = 'vpc'
-
-
-class VPCReferenceDNSResolverContext:
+class ShareReference:
"""
- A VPC whose DNS resolver is delegated to provide DNS servers for this VPC.
- The VPC may be remote and therefore may not be directly retrievable.
+ ShareReference.
- :attr str crn: The CRN for this VPC.
- :attr VPCReferenceDNSResolverContextDeleted deleted: (optional) If present, this
- property indicates the referenced resource has been deleted, and provides
+ :param str crn: The CRN for this file share.
+ :param ShareReferenceDeleted deleted: (optional) If present, this property
+ indicates the referenced resource has been deleted, and provides
some supplementary information.
- :attr str href: The URL for this VPC.
- :attr str id: The unique identifier for this VPC.
- :attr str name: The name for this VPC. The name is unique across all VPCs in the
- region.
- :attr VPCRemote remote: (optional) If present, this property indicates that the
- resource associated with this reference
+ :param str href: The URL for this file share.
+ :param str id: The unique identifier for this file share.
+ :param str name: The name for this share. The name is unique across all shares
+ in the region.
+ :param ShareRemote remote: (optional) If present, this property indicates that
+ the resource associated with this reference
is remote and therefore may not be directly retrievable.
- :attr str resource_type: The resource type.
+ :param str resource_type: The resource type.
"""
def __init__(
@@ -76891,23 +79912,22 @@ def __init__(
name: str,
resource_type: str,
*,
- deleted: 'VPCReferenceDNSResolverContextDeleted' = None,
- remote: 'VPCRemote' = None,
+ deleted: Optional['ShareReferenceDeleted'] = None,
+ remote: Optional['ShareRemote'] = None,
) -> None:
"""
- Initialize a VPCReferenceDNSResolverContext object.
+ Initialize a ShareReference object.
- :param str crn: The CRN for this VPC.
- :param str href: The URL for this VPC.
- :param str id: The unique identifier for this VPC.
- :param str name: The name for this VPC. The name is unique across all VPCs
- in the region.
+ :param str crn: The CRN for this file share.
+ :param str href: The URL for this file share.
+ :param str id: The unique identifier for this file share.
+ :param str name: The name for this share. The name is unique across all
+ shares in the region.
:param str resource_type: The resource type.
- :param VPCReferenceDNSResolverContextDeleted deleted: (optional) If
- present, this property indicates the referenced resource has been deleted,
- and provides
+ :param ShareReferenceDeleted deleted: (optional) If present, this property
+ indicates the referenced resource has been deleted, and provides
some supplementary information.
- :param VPCRemote remote: (optional) If present, this property indicates
+ :param ShareRemote remote: (optional) If present, this property indicates
that the resource associated with this reference
is remote and therefore may not be directly retrievable.
"""
@@ -76920,38 +79940,38 @@ def __init__(
self.resource_type = resource_type
@classmethod
- def from_dict(cls, _dict: Dict) -> 'VPCReferenceDNSResolverContext':
- """Initialize a VPCReferenceDNSResolverContext object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'ShareReference':
+ """Initialize a ShareReference object from a json dictionary."""
args = {}
- if 'crn' in _dict:
- args['crn'] = _dict.get('crn')
+ if (crn := _dict.get('crn')) is not None:
+ args['crn'] = crn
else:
- raise ValueError('Required property \'crn\' not present in VPCReferenceDNSResolverContext JSON')
- if 'deleted' in _dict:
- args['deleted'] = VPCReferenceDNSResolverContextDeleted.from_dict(_dict.get('deleted'))
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ raise ValueError('Required property \'crn\' not present in ShareReference JSON')
+ if (deleted := _dict.get('deleted')) is not None:
+ args['deleted'] = ShareReferenceDeleted.from_dict(deleted)
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'href\' not present in VPCReferenceDNSResolverContext JSON')
- if 'id' in _dict:
- args['id'] = _dict.get('id')
+ raise ValueError('Required property \'href\' not present in ShareReference JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
else:
- raise ValueError('Required property \'id\' not present in VPCReferenceDNSResolverContext JSON')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
+ raise ValueError('Required property \'id\' not present in ShareReference JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
else:
- raise ValueError('Required property \'name\' not present in VPCReferenceDNSResolverContext JSON')
- if 'remote' in _dict:
- args['remote'] = VPCRemote.from_dict(_dict.get('remote'))
- if 'resource_type' in _dict:
- args['resource_type'] = _dict.get('resource_type')
+ raise ValueError('Required property \'name\' not present in ShareReference JSON')
+ if (remote := _dict.get('remote')) is not None:
+ args['remote'] = ShareRemote.from_dict(remote)
+ if (resource_type := _dict.get('resource_type')) is not None:
+ args['resource_type'] = resource_type
else:
- raise ValueError('Required property \'resource_type\' not present in VPCReferenceDNSResolverContext JSON')
+ raise ValueError('Required property \'resource_type\' not present in ShareReference JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VPCReferenceDNSResolverContext object from a json dictionary."""
+ """Initialize a ShareReference object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -76984,16 +80004,16 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this VPCReferenceDNSResolverContext object."""
+ """Return a `str` version of this ShareReference object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VPCReferenceDNSResolverContext') -> bool:
+ def __eq__(self, other: 'ShareReference') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'VPCReferenceDNSResolverContext') -> bool:
+ def __ne__(self, other: 'ShareReference') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
@@ -77002,16 +80022,16 @@ class ResourceTypeEnum(str, Enum):
The resource type.
"""
- VPC = 'vpc'
+ SHARE = 'share'
-class VPCReferenceDNSResolverContextDeleted:
+class ShareReferenceDeleted:
"""
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.
+ :param str more_info: Link to documentation about deleted resources.
"""
def __init__(
@@ -77019,25 +80039,25 @@ def __init__(
more_info: str,
) -> None:
"""
- Initialize a VPCReferenceDNSResolverContextDeleted object.
+ Initialize a ShareReferenceDeleted object.
:param str more_info: Link to documentation about deleted resources.
"""
self.more_info = more_info
@classmethod
- def from_dict(cls, _dict: Dict) -> 'VPCReferenceDNSResolverContextDeleted':
- """Initialize a VPCReferenceDNSResolverContextDeleted object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'ShareReferenceDeleted':
+ """Initialize a ShareReferenceDeleted object from a json dictionary."""
args = {}
- if 'more_info' in _dict:
- args['more_info'] = _dict.get('more_info')
+ if (more_info := _dict.get('more_info')) is not None:
+ args['more_info'] = more_info
else:
- raise ValueError('Required property \'more_info\' not present in VPCReferenceDNSResolverContextDeleted JSON')
+ raise ValueError('Required property \'more_info\' not present in ShareReferenceDeleted JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VPCReferenceDNSResolverContextDeleted object from a json dictionary."""
+ """Initialize a ShareReferenceDeleted object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -77052,59 +80072,65 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this VPCReferenceDNSResolverContextDeleted object."""
+ """Return a `str` version of this ShareReferenceDeleted object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VPCReferenceDNSResolverContextDeleted') -> bool:
+ def __eq__(self, other: 'ShareReferenceDeleted') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'VPCReferenceDNSResolverContextDeleted') -> bool:
+ def __ne__(self, other: 'ShareReferenceDeleted') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class VPCReferenceDeleted:
+class ShareRemote:
"""
- If present, this property indicates the referenced resource has been deleted, and
- provides some supplementary information.
+ If present, this property indicates that the resource associated with this reference
+ is remote and therefore may not be directly retrievable.
- :attr str more_info: Link to documentation about deleted resources.
+ :param RegionReference region: (optional) If present, this property indicates
+ that the referenced resource is remote to this
+ region, and identifies the native region.
"""
def __init__(
self,
- more_info: str,
+ *,
+ region: Optional['RegionReference'] = None,
) -> None:
"""
- Initialize a VPCReferenceDeleted object.
+ Initialize a ShareRemote object.
- :param str more_info: Link to documentation about deleted resources.
+ :param RegionReference region: (optional) If present, this property
+ indicates that the referenced resource is remote to this
+ region, and identifies the native region.
"""
- self.more_info = more_info
+ self.region = region
@classmethod
- def from_dict(cls, _dict: Dict) -> 'VPCReferenceDeleted':
- """Initialize a VPCReferenceDeleted object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'ShareRemote':
+ """Initialize a ShareRemote 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')
+ if (region := _dict.get('region')) is not None:
+ args['region'] = RegionReference.from_dict(region)
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VPCReferenceDeleted object from a json dictionary."""
+ """Initialize a ShareRemote object from 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, 'region') and self.region is not None:
+ if isinstance(self.region, dict):
+ _dict['region'] = self.region
+ else:
+ _dict['region'] = self.region.to_dict()
return _dict
def _to_dict(self):
@@ -77112,116 +80138,79 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this VPCReferenceDeleted object."""
+ """Return a `str` version of this ShareRemote object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VPCReferenceDeleted') -> bool:
+ def __eq__(self, other: 'ShareRemote') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'VPCReferenceDeleted') -> bool:
+ def __ne__(self, other: 'ShareRemote') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class VPCReferenceRemote:
+class ShareReplicationStatusReason:
"""
- VPCReferenceRemote.
+ ShareReplicationStatusReason.
- :attr str crn: The CRN for this VPC.
- :attr str href: The URL for this VPC.
- :attr str id: The unique identifier for this VPC.
- :attr str name: The name for this VPC. The name is unique across all VPCs in the
- region.
- :attr VPCRemote remote: (optional) If present, this property indicates that the
- resource associated with this reference
- is remote and therefore may not be directly retrievable.
- :attr str resource_type: The resource type.
+ :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.
"""
def __init__(
self,
- crn: str,
- href: str,
- id: str,
- name: str,
- resource_type: str,
+ code: str,
+ message: str,
*,
- remote: 'VPCRemote' = None,
+ more_info: Optional[str] = None,
) -> None:
"""
- Initialize a VPCReferenceRemote object.
+ Initialize a ShareReplicationStatusReason object.
- :param str crn: The CRN for this VPC.
- :param str href: The URL for this VPC.
- :param str id: The unique identifier for this VPC.
- :param str name: The name for this VPC. The name is unique across all VPCs
- in the region.
- :param str resource_type: The resource type.
- :param VPCRemote remote: (optional) If present, this property indicates
- that the resource associated with this reference
- is remote and therefore may not be directly retrievable.
+ :param str 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.crn = crn
- self.href = href
- self.id = id
- self.name = name
- self.remote = remote
- self.resource_type = resource_type
+ self.code = code
+ self.message = message
+ self.more_info = more_info
@classmethod
- def from_dict(cls, _dict: Dict) -> 'VPCReferenceRemote':
- """Initialize a VPCReferenceRemote object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'ShareReplicationStatusReason':
+ """Initialize a ShareReplicationStatusReason object from a json dictionary."""
args = {}
- if 'crn' in _dict:
- args['crn'] = _dict.get('crn')
+ if (code := _dict.get('code')) is not None:
+ args['code'] = code
else:
- raise ValueError('Required property \'crn\' not present in VPCReferenceRemote JSON')
- if 'href' in _dict:
- args['href'] = _dict.get('href')
- else:
- raise ValueError('Required property \'href\' not present in VPCReferenceRemote JSON')
- if 'id' in _dict:
- args['id'] = _dict.get('id')
- else:
- raise ValueError('Required property \'id\' not present in VPCReferenceRemote JSON')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
- else:
- raise ValueError('Required property \'name\' not present in VPCReferenceRemote JSON')
- if 'remote' in _dict:
- args['remote'] = VPCRemote.from_dict(_dict.get('remote'))
- if 'resource_type' in _dict:
- args['resource_type'] = _dict.get('resource_type')
+ raise ValueError('Required property \'code\' not present in ShareReplicationStatusReason JSON')
+ if (message := _dict.get('message')) is not None:
+ args['message'] = message
else:
- raise ValueError('Required property \'resource_type\' not present in VPCReferenceRemote JSON')
+ raise ValueError('Required property \'message\' not present in ShareReplicationStatusReason JSON')
+ if (more_info := _dict.get('more_info')) is not None:
+ args['more_info'] = more_info
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VPCReferenceRemote object from a json dictionary."""
+ """Initialize a ShareReplicationStatusReason object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, '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, 'remote') and self.remote is not None:
- if isinstance(self.remote, dict):
- _dict['remote'] = self.remote
- else:
- _dict['remote'] = self.remote.to_dict()
- if hasattr(self, 'resource_type') and self.resource_type is not None:
- _dict['resource_type'] = self.resource_type
+ if hasattr(self, '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):
@@ -77229,88 +80218,381 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this VPCReferenceRemote object."""
+ """Return a `str` version of this ShareReplicationStatusReason object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VPCReferenceRemote') -> bool:
+ def __eq__(self, other: 'ShareReplicationStatusReason') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'VPCReferenceRemote') -> bool:
+ def __ne__(self, other: 'ShareReplicationStatusReason') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class ResourceTypeEnum(str, Enum):
+ class CodeEnum(str, Enum):
"""
- The resource type.
+ A snake case string succinctly identifying the status reason.
"""
- VPC = 'vpc'
+ CANNOT_INITIALIZE_REPLICATION = 'cannot_initialize_replication'
+ CANNOT_REACH_REPLICA_SHARE = 'cannot_reach_replica_share'
+ CANNOT_REACH_SOURCE_SHARE = 'cannot_reach_source_share'
-class VPCRemote:
+class Snapshot:
"""
- If present, this property indicates that the resource associated with this reference
- is remote and therefore may not be directly retrievable.
+ Snapshot.
- :attr AccountReference account: (optional) If present, this property indicates
- that the referenced resource is remote to this
- account, and identifies the owning account.
- :attr RegionReference region: (optional) If present, this property indicates
- that the referenced resource is remote to this
- region, and identifies the native region.
+ :param BackupPolicyPlanReference backup_policy_plan: (optional) If present, the
+ backup policy plan which created this snapshot.
+ :param bool bootable: Indicates if a boot volume attachment can be created with
+ a volume created from this snapshot.
+ :param datetime captured_at: (optional) The date and time the data capture for
+ this snapshot was completed.
+ If absent, this snapshot's data has not yet been captured. Additionally, this
+ property may be absent for snapshots created before 1 January 2022.
+ :param List[SnapshotClone] clones: Clones for this snapshot.
+ :param List[SnapshotCopiesItem] copies: The copies of this snapshot.
+ :param datetime created_at: The date and time that this snapshot was created.
+ :param str crn: The CRN of this snapshot.
+ :param bool deletable: Deprecated: Indicates whether this snapshot can be
+ deleted. This value will always be `true`.
+ :param str encryption: The type of encryption used on the source volume.
+ :param 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 str href: The URL for this snapshot.
+ :param str id: The unique identifier for this snapshot.
+ :param str lifecycle_state: The lifecycle state of this snapshot.
+ :param int minimum_capacity: The minimum capacity of a volume created from this
+ snapshot. When a snapshot is created, this will be set to the capacity of the
+ `source_volume`.
+ :param str name: The name for this snapshot. The name is unique across all
+ snapshots in the region.
+ :param OperatingSystem operating_system: (optional) The operating system
+ included in this snapshot.
+ :param ResourceGroupReference resource_group: The resource group for this
+ snapshot.
+ :param str resource_type: The resource type.
+ :param List[str] service_tags: The [service
+ tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) prefixed with
+ `is.snapshot:` associated with this snapshot.
+ :param int size: The size of this snapshot rounded up to the next gigabyte.
+ :param SnapshotConsistencyGroupReference snapshot_consistency_group: (optional)
+ If present, the snapshot consistency group which created this snapshot.
+ :param ImageReference source_image: (optional) If present, the image from which
+ the data on this snapshot was most directly
+ provisioned.
+ :param SnapshotSourceSnapshot source_snapshot: (optional) If present, the source
+ snapshot this snapshot was created from.
+ :param VolumeReference source_volume: The source volume this snapshot was
+ created from (may be
+ [deleted](https://cloud.ibm.com/apidocs/vpc#deleted-resources)).
+ :param List[str] user_tags: The [user
+ tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with this
+ snapshot.
"""
def __init__(
self,
+ bootable: bool,
+ clones: List['SnapshotClone'],
+ copies: List['SnapshotCopiesItem'],
+ created_at: datetime,
+ crn: str,
+ deletable: bool,
+ encryption: str,
+ href: str,
+ id: str,
+ lifecycle_state: str,
+ minimum_capacity: int,
+ name: str,
+ resource_group: 'ResourceGroupReference',
+ resource_type: str,
+ service_tags: List[str],
+ size: int,
+ source_volume: 'VolumeReference',
+ user_tags: List[str],
*,
- account: 'AccountReference' = None,
- region: 'RegionReference' = None,
+ backup_policy_plan: Optional['BackupPolicyPlanReference'] = None,
+ captured_at: Optional[datetime] = None,
+ encryption_key: Optional['EncryptionKeyReference'] = None,
+ operating_system: Optional['OperatingSystem'] = None,
+ snapshot_consistency_group: Optional['SnapshotConsistencyGroupReference'] = None,
+ source_image: Optional['ImageReference'] = None,
+ source_snapshot: Optional['SnapshotSourceSnapshot'] = None,
) -> None:
"""
- Initialize a VPCRemote object.
+ Initialize a Snapshot object.
- :param AccountReference account: (optional) If present, this property
- indicates that the referenced resource is remote to this
- account, and identifies the owning account.
- :param RegionReference region: (optional) If present, this property
- indicates that the referenced resource is remote to this
- region, and identifies the native region.
- """
- self.account = account
- self.region = region
+ :param bool bootable: Indicates if a boot volume attachment can be created
+ with a volume created from this snapshot.
+ :param List[SnapshotClone] clones: Clones for this snapshot.
+ :param List[SnapshotCopiesItem] copies: The copies of this snapshot.
+ :param datetime created_at: The date and time that this snapshot was
+ created.
+ :param str crn: The CRN of this snapshot.
+ :param bool deletable: Deprecated: Indicates whether this snapshot can be
+ deleted. This value will always be `true`.
+ :param str encryption: The type of encryption used on the source volume.
+ :param str href: The URL for this snapshot.
+ :param str id: The unique identifier for this snapshot.
+ :param str lifecycle_state: The lifecycle state of this snapshot.
+ :param int minimum_capacity: The minimum capacity of a volume created from
+ this snapshot. When a snapshot is created, this will be set to the capacity
+ of the `source_volume`.
+ :param str name: The name for this snapshot. The name is unique across all
+ snapshots in the region.
+ :param ResourceGroupReference resource_group: The resource group for this
+ snapshot.
+ :param str resource_type: The resource type.
+ :param List[str] service_tags: The [service
+ tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) prefixed with
+ `is.snapshot:` associated with this snapshot.
+ :param int size: The size of this snapshot rounded up to the next gigabyte.
+ :param VolumeReference source_volume: The source volume this snapshot was
+ created from (may be
+ [deleted](https://cloud.ibm.com/apidocs/vpc#deleted-resources)).
+ :param List[str] user_tags: The [user
+ tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with
+ this snapshot.
+ :param BackupPolicyPlanReference backup_policy_plan: (optional) If present,
+ the backup policy plan which created this snapshot.
+ :param datetime captured_at: (optional) The date and time the data capture
+ for this snapshot was completed.
+ If absent, this snapshot's data has not yet been captured. Additionally,
+ this property may be absent for snapshots created before 1 January 2022.
+ :param EncryptionKeyReference encryption_key: (optional) The root key used
+ to wrap the data encryption key for the source volume.
+ This property will be present for volumes with an `encryption` type of
+ `user_managed`.
+ :param OperatingSystem operating_system: (optional) The operating system
+ included in this snapshot.
+ :param SnapshotConsistencyGroupReference snapshot_consistency_group:
+ (optional) If present, the snapshot consistency group which created this
+ snapshot.
+ :param ImageReference source_image: (optional) If present, the image from
+ which the data on this snapshot was most directly
+ provisioned.
+ :param SnapshotSourceSnapshot source_snapshot: (optional) If present, the
+ source snapshot this snapshot was created from.
+ """
+ self.backup_policy_plan = backup_policy_plan
+ self.bootable = bootable
+ self.captured_at = captured_at
+ self.clones = clones
+ self.copies = copies
+ self.created_at = created_at
+ self.crn = crn
+ self.deletable = deletable
+ self.encryption = encryption
+ self.encryption_key = encryption_key
+ self.href = href
+ self.id = id
+ self.lifecycle_state = lifecycle_state
+ self.minimum_capacity = minimum_capacity
+ self.name = name
+ self.operating_system = operating_system
+ self.resource_group = resource_group
+ self.resource_type = resource_type
+ self.service_tags = service_tags
+ self.size = size
+ self.snapshot_consistency_group = snapshot_consistency_group
+ self.source_image = source_image
+ self.source_snapshot = source_snapshot
+ self.source_volume = source_volume
+ self.user_tags = user_tags
@classmethod
- def from_dict(cls, _dict: Dict) -> 'VPCRemote':
- """Initialize a VPCRemote object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'Snapshot':
+ """Initialize a Snapshot object from a json dictionary."""
args = {}
- if 'account' in _dict:
- args['account'] = AccountReference.from_dict(_dict.get('account'))
- if 'region' in _dict:
- args['region'] = RegionReference.from_dict(_dict.get('region'))
+ if (backup_policy_plan := _dict.get('backup_policy_plan')) is not None:
+ args['backup_policy_plan'] = BackupPolicyPlanReference.from_dict(backup_policy_plan)
+ if (bootable := _dict.get('bootable')) is not None:
+ args['bootable'] = bootable
+ else:
+ raise ValueError('Required property \'bootable\' not present in Snapshot JSON')
+ if (captured_at := _dict.get('captured_at')) is not None:
+ args['captured_at'] = string_to_datetime(captured_at)
+ if (clones := _dict.get('clones')) is not None:
+ args['clones'] = [SnapshotClone.from_dict(v) for v in clones]
+ else:
+ raise ValueError('Required property \'clones\' not present in Snapshot JSON')
+ if (copies := _dict.get('copies')) is not None:
+ args['copies'] = [SnapshotCopiesItem.from_dict(v) for v in copies]
+ else:
+ raise ValueError('Required property \'copies\' not present in Snapshot JSON')
+ if (created_at := _dict.get('created_at')) is not None:
+ args['created_at'] = string_to_datetime(created_at)
+ else:
+ raise ValueError('Required property \'created_at\' not present in Snapshot JSON')
+ if (crn := _dict.get('crn')) is not None:
+ args['crn'] = crn
+ else:
+ raise ValueError('Required property \'crn\' not present in Snapshot JSON')
+ if (deletable := _dict.get('deletable')) is not None:
+ args['deletable'] = deletable
+ else:
+ raise ValueError('Required property \'deletable\' not present in Snapshot JSON')
+ if (encryption := _dict.get('encryption')) is not None:
+ args['encryption'] = encryption
+ else:
+ raise ValueError('Required property \'encryption\' not present in Snapshot JSON')
+ if (encryption_key := _dict.get('encryption_key')) is not None:
+ args['encryption_key'] = EncryptionKeyReference.from_dict(encryption_key)
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
+ else:
+ raise ValueError('Required property \'href\' not present in Snapshot JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
+ else:
+ raise ValueError('Required property \'id\' not present in Snapshot JSON')
+ if (lifecycle_state := _dict.get('lifecycle_state')) is not None:
+ args['lifecycle_state'] = lifecycle_state
+ else:
+ raise ValueError('Required property \'lifecycle_state\' not present in Snapshot JSON')
+ if (minimum_capacity := _dict.get('minimum_capacity')) is not None:
+ args['minimum_capacity'] = minimum_capacity
+ else:
+ raise ValueError('Required property \'minimum_capacity\' not present in Snapshot JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ else:
+ raise ValueError('Required property \'name\' not present in Snapshot JSON')
+ if (operating_system := _dict.get('operating_system')) is not None:
+ args['operating_system'] = OperatingSystem.from_dict(operating_system)
+ if (resource_group := _dict.get('resource_group')) is not None:
+ args['resource_group'] = ResourceGroupReference.from_dict(resource_group)
+ else:
+ raise ValueError('Required property \'resource_group\' not present in Snapshot JSON')
+ if (resource_type := _dict.get('resource_type')) is not None:
+ args['resource_type'] = resource_type
+ else:
+ raise ValueError('Required property \'resource_type\' not present in Snapshot JSON')
+ if (service_tags := _dict.get('service_tags')) is not None:
+ args['service_tags'] = service_tags
+ else:
+ raise ValueError('Required property \'service_tags\' not present in Snapshot JSON')
+ if (size := _dict.get('size')) is not None:
+ args['size'] = size
+ else:
+ raise ValueError('Required property \'size\' not present in Snapshot JSON')
+ if (snapshot_consistency_group := _dict.get('snapshot_consistency_group')) is not None:
+ args['snapshot_consistency_group'] = SnapshotConsistencyGroupReference.from_dict(snapshot_consistency_group)
+ if (source_image := _dict.get('source_image')) is not None:
+ args['source_image'] = ImageReference.from_dict(source_image)
+ if (source_snapshot := _dict.get('source_snapshot')) is not None:
+ args['source_snapshot'] = SnapshotSourceSnapshot.from_dict(source_snapshot)
+ if (source_volume := _dict.get('source_volume')) is not None:
+ args['source_volume'] = VolumeReference.from_dict(source_volume)
+ else:
+ raise ValueError('Required property \'source_volume\' not present in Snapshot JSON')
+ if (user_tags := _dict.get('user_tags')) is not None:
+ args['user_tags'] = user_tags
+ else:
+ raise ValueError('Required property \'user_tags\' not present in Snapshot JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VPCRemote object from a json dictionary."""
+ """Initialize a Snapshot object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'account') and self.account is not None:
- if isinstance(self.account, dict):
- _dict['account'] = self.account
+ if hasattr(self, 'backup_policy_plan') and self.backup_policy_plan is not None:
+ if isinstance(self.backup_policy_plan, dict):
+ _dict['backup_policy_plan'] = self.backup_policy_plan
else:
- _dict['account'] = self.account.to_dict()
- if hasattr(self, 'region') and self.region is not None:
- if isinstance(self.region, dict):
- _dict['region'] = self.region
+ _dict['backup_policy_plan'] = self.backup_policy_plan.to_dict()
+ if hasattr(self, 'bootable') and self.bootable is not None:
+ _dict['bootable'] = self.bootable
+ if hasattr(self, 'captured_at') and self.captured_at is not None:
+ _dict['captured_at'] = datetime_to_string(self.captured_at)
+ if hasattr(self, 'clones') and self.clones is not None:
+ clones_list = []
+ for v in self.clones:
+ if isinstance(v, dict):
+ clones_list.append(v)
+ else:
+ clones_list.append(v.to_dict())
+ _dict['clones'] = clones_list
+ if hasattr(self, 'copies') and self.copies is not None:
+ copies_list = []
+ for v in self.copies:
+ if isinstance(v, dict):
+ copies_list.append(v)
+ else:
+ copies_list.append(v.to_dict())
+ _dict['copies'] = copies_list
+ if hasattr(self, 'created_at') and self.created_at is not None:
+ _dict['created_at'] = datetime_to_string(self.created_at)
+ if hasattr(self, 'crn') and self.crn is not None:
+ _dict['crn'] = self.crn
+ if hasattr(self, 'deletable') and self.deletable is not None:
+ _dict['deletable'] = self.deletable
+ if hasattr(self, 'encryption') and self.encryption is not None:
+ _dict['encryption'] = self.encryption
+ if hasattr(self, 'encryption_key') and self.encryption_key is not None:
+ if isinstance(self.encryption_key, dict):
+ _dict['encryption_key'] = self.encryption_key
else:
- _dict['region'] = self.region.to_dict()
+ _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:
+ if isinstance(self.operating_system, dict):
+ _dict['operating_system'] = self.operating_system
+ else:
+ _dict['operating_system'] = self.operating_system.to_dict()
+ if hasattr(self, 'resource_group') and self.resource_group is not None:
+ if isinstance(self.resource_group, dict):
+ _dict['resource_group'] = self.resource_group
+ else:
+ _dict['resource_group'] = self.resource_group.to_dict()
+ if hasattr(self, 'resource_type') and self.resource_type is not None:
+ _dict['resource_type'] = self.resource_type
+ if hasattr(self, 'service_tags') and self.service_tags is not None:
+ _dict['service_tags'] = self.service_tags
+ if hasattr(self, 'size') and self.size is not None:
+ _dict['size'] = self.size
+ if hasattr(self, 'snapshot_consistency_group') and self.snapshot_consistency_group is not None:
+ if isinstance(self.snapshot_consistency_group, dict):
+ _dict['snapshot_consistency_group'] = self.snapshot_consistency_group
+ else:
+ _dict['snapshot_consistency_group'] = self.snapshot_consistency_group.to_dict()
+ if hasattr(self, 'source_image') and self.source_image is not None:
+ if isinstance(self.source_image, dict):
+ _dict['source_image'] = self.source_image
+ else:
+ _dict['source_image'] = self.source_image.to_dict()
+ if hasattr(self, 'source_snapshot') and self.source_snapshot is not None:
+ if isinstance(self.source_snapshot, dict):
+ _dict['source_snapshot'] = self.source_snapshot
+ else:
+ _dict['source_snapshot'] = self.source_snapshot.to_dict()
+ if hasattr(self, 'source_volume') and self.source_volume is not None:
+ if isinstance(self.source_volume, dict):
+ _dict['source_volume'] = self.source_volume
+ else:
+ _dict['source_volume'] = self.source_volume.to_dict()
+ if hasattr(self, 'user_tags') and self.user_tags is not None:
+ _dict['user_tags'] = self.user_tags
return _dict
def _to_dict(self):
@@ -77318,163 +80600,31 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this VPCRemote object."""
+ """Return a `str` version of this Snapshot object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VPCRemote') -> bool:
+ 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: 'VPCRemote') -> bool:
+ def __ne__(self, other: 'Snapshot') -> 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 List[VPNGatewayHealthReason] health_reasons: The reasons for the current
- VPN gateway health_state (if any):
- - `cannot_create_vpc_route`: VPN cannot create route (check for conflict)
- - `cannot_reserve_ip_address`: IP address exhaustion (release addresses on the
- VPN's
- subnet)
- - `internal_error`: Internal error (contact IBM support)
- The enumerated reason code values for this property will expand in the future.
- When processing this property, check for and log unknown values. Optionally halt
- processing and surface the error, or bypass the resource on which the unexpected
- reason code was encountered.
- :attr str health_state: The health of this resource.
- - `ok`: No abnormal behavior detected
- - `degraded`: Experiencing compromised performance, capacity, or connectivity
- - `faulted`: Completely unreachable, inoperative, or otherwise entirely
- incapacitated
- - `inapplicable`: The health state does not apply because of the current
- lifecycle state. A resource with a lifecycle state of `failed` or `deleting`
- will have a health state of `inapplicable`. A `pending` resource may also have
- this state.
- :attr str href: The VPN gateway's canonical URL.
- :attr str id: The unique identifier for this VPN gateway.
- :attr List[VPNGatewayLifecycleReason] lifecycle_reasons: The reasons for the
- current VPN gateway lifecycle_state (if any):
- - `resource_suspended_by_provider`: The resource has been suspended (contact IBM
- support)
- The enumerated reason code values for this property will expand in the future.
- When processing this property, check for and log unknown values. Optionally halt
- processing and surface the error, or bypass the resource on which the unexpected
- reason code was encountered.
- :attr str lifecycle_state: The lifecycle state of the VPN gateway.
- :attr List[VPNGatewayMember] members: Collection of VPN gateway members.
- :attr str name: The name for this VPN gateway. The name is unique across all VPN
- gateways in the VPC.
- :attr ResourceGroupReference resource_group: The resource group for this VPN
- gateway.
- :attr str resource_type: The resource type.
- :attr SubnetReference subnet:
- :attr VPCReference vpc: The VPC this VPN gateway resides in.
- """
-
- def __init__(
- self,
- connections: List['VPNGatewayConnectionReference'],
- created_at: datetime,
- crn: str,
- health_reasons: List['VPNGatewayHealthReason'],
- health_state: str,
- href: str,
- id: str,
- lifecycle_reasons: List['VPNGatewayLifecycleReason'],
- lifecycle_state: str,
- members: List['VPNGatewayMember'],
- name: str,
- resource_group: 'ResourceGroupReference',
- resource_type: str,
- subnet: 'SubnetReference',
- vpc: 'VPCReference',
- ) -> None:
- """
- Initialize a VPNGateway object.
-
- :param List[VPNGatewayConnectionReference] connections: Connections for
- this VPN gateway.
- :param datetime created_at: The date and time that this VPN gateway was
- created.
- :param str crn: The VPN gateway's CRN.
- :param List[VPNGatewayHealthReason] health_reasons: The reasons for the
- current VPN gateway health_state (if any):
- - `cannot_create_vpc_route`: VPN cannot create route (check for conflict)
- - `cannot_reserve_ip_address`: IP address exhaustion (release addresses on
- the VPN's
- subnet)
- - `internal_error`: Internal error (contact IBM support)
- The enumerated reason code values for this property will expand in the
- future. When processing this property, check for and log unknown values.
- Optionally halt processing and surface the error, or bypass the resource on
- which the unexpected reason code was encountered.
- :param str health_state: The health of this resource.
- - `ok`: No abnormal behavior detected
- - `degraded`: Experiencing compromised performance, capacity, or
- connectivity
- - `faulted`: Completely unreachable, inoperative, or otherwise entirely
- incapacitated
- - `inapplicable`: The health state does not apply because of the current
- lifecycle state. A resource with a lifecycle state of `failed` or
- `deleting` will have a health state of `inapplicable`. A `pending` resource
- may also have this state.
- :param str href: The VPN gateway's canonical URL.
- :param str id: The unique identifier for this VPN gateway.
- :param List[VPNGatewayLifecycleReason] lifecycle_reasons: The reasons for
- the current VPN gateway lifecycle_state (if any):
- - `resource_suspended_by_provider`: The resource has been suspended
- (contact IBM
- support)
- The enumerated reason code values for this property will expand in the
- future. When processing this property, check for and log unknown values.
- Optionally halt processing and surface the error, or bypass the resource on
- which the unexpected reason code was encountered.
- :param str lifecycle_state: The lifecycle state of the VPN gateway.
- :param List[VPNGatewayMember] members: Collection of VPN gateway members.
- :param str name: The name for this VPN gateway. The name is unique across
- all VPN gateways in the VPC.
- :param ResourceGroupReference resource_group: The resource group for this
- VPN gateway.
- :param str resource_type: The resource type.
- :param SubnetReference subnet:
- :param VPCReference vpc: The VPC this VPN gateway resides in.
- """
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['VPNGatewayRouteMode', 'VPNGatewayPolicyMode'])
- )
- raise Exception(msg)
-
- class HealthStateEnum(str, Enum):
+ class EncryptionEnum(str, Enum):
"""
- The health of this resource.
- - `ok`: No abnormal behavior detected
- - `degraded`: Experiencing compromised performance, capacity, or connectivity
- - `faulted`: Completely unreachable, inoperative, or otherwise entirely
- incapacitated
- - `inapplicable`: The health state does not apply because of the current lifecycle
- state. A resource with a lifecycle state of `failed` or `deleting` will have a
- health state of `inapplicable`. A `pending` resource may also have this state.
+ The type of encryption used on the source volume.
"""
- DEGRADED = 'degraded'
- FAULTED = 'faulted'
- INAPPLICABLE = 'inapplicable'
- OK = 'ok'
+ PROVIDER_MANAGED = 'provider_managed'
+ USER_MANAGED = 'user_managed'
class LifecycleStateEnum(str, Enum):
"""
- The lifecycle state of the VPN gateway.
+ The lifecycle state of this snapshot.
"""
DELETING = 'deleting'
@@ -77491,106 +80641,75 @@ class ResourceTypeEnum(str, Enum):
The resource type.
"""
- VPN_GATEWAY = 'vpn_gateway'
+ SNAPSHOT = 'snapshot'
-class VPNGatewayCollection:
+class SnapshotClone:
"""
- VPNGatewayCollection.
+ SnapshotClone.
- :attr VPNGatewayCollectionFirst first: A link to the first page of resources.
- :attr int limit: The maximum number of resources that can be returned by the
- request.
- :attr VPNGatewayCollectionNext next: (optional) A link to the next page of
- resources. This property is present for all pages
- except the last page.
- :attr int total_count: The total number of resources across all pages.
- :attr List[VPNGateway] vpn_gateways: Collection of VPN gateways.
+ :param bool available: Indicates whether this snapshot clone is available for
+ use.
+ :param datetime created_at: The date and time that this snapshot clone was
+ created.
+ :param ZoneReference zone: The zone this snapshot clone resides in.
"""
def __init__(
self,
- first: 'VPNGatewayCollectionFirst',
- limit: int,
- total_count: int,
- vpn_gateways: List['VPNGateway'],
- *,
- next: 'VPNGatewayCollectionNext' = None,
+ available: bool,
+ created_at: datetime,
+ zone: 'ZoneReference',
) -> None:
"""
- Initialize a VPNGatewayCollection object.
+ Initialize a SnapshotClone object.
- :param VPNGatewayCollectionFirst first: A link to the first page of
- resources.
- :param int limit: The maximum number of resources that can be returned by
- the request.
- :param int total_count: The total number of resources across all pages.
- :param List[VPNGateway] vpn_gateways: Collection of VPN gateways.
- :param VPNGatewayCollectionNext next: (optional) A link to the next page of
- resources. This property is present for all pages
- except the last page.
+ :param bool available: Indicates whether this snapshot clone is available
+ for use.
+ :param datetime created_at: The date and time that this snapshot clone was
+ created.
+ :param ZoneReference zone: The zone this snapshot clone resides in.
"""
- self.first = first
- self.limit = limit
- self.next = next
- self.total_count = total_count
- self.vpn_gateways = vpn_gateways
+ self.available = available
+ self.created_at = created_at
+ self.zone = zone
@classmethod
- def from_dict(cls, _dict: Dict) -> 'VPNGatewayCollection':
- """Initialize a VPNGatewayCollection object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'SnapshotClone':
+ """Initialize a SnapshotClone object from a json dictionary."""
args = {}
- if 'first' in _dict:
- args['first'] = VPNGatewayCollectionFirst.from_dict(_dict.get('first'))
+ if (available := _dict.get('available')) is not None:
+ args['available'] = available
else:
- 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 VPNGatewayCollection JSON')
- if 'next' in _dict:
- args['next'] = VPNGatewayCollectionNext.from_dict(_dict.get('next'))
- if 'total_count' in _dict:
- args['total_count'] = _dict.get('total_count')
+ raise ValueError('Required property \'available\' not present in SnapshotClone JSON')
+ if (created_at := _dict.get('created_at')) is not None:
+ args['created_at'] = string_to_datetime(created_at)
else:
- raise ValueError('Required property \'total_count\' not present in VPNGatewayCollection JSON')
- if 'vpn_gateways' in _dict:
- args['vpn_gateways'] = _dict.get('vpn_gateways')
+ raise ValueError('Required property \'created_at\' not present in SnapshotClone JSON')
+ if (zone := _dict.get('zone')) is not None:
+ args['zone'] = ZoneReference.from_dict(zone)
else:
- raise ValueError('Required property \'vpn_gateways\' not present in VPNGatewayCollection JSON')
+ raise ValueError('Required property \'zone\' not present in SnapshotClone JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VPNGatewayCollection object from a json dictionary."""
+ """Initialize a SnapshotClone object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'first') and self.first is not None:
- if isinstance(self.first, dict):
- _dict['first'] = self.first
- else:
- _dict['first'] = self.first.to_dict()
- if hasattr(self, 'limit') and self.limit is not None:
- _dict['limit'] = self.limit
- if hasattr(self, 'next') and self.next is not None:
- if isinstance(self.next, dict):
- _dict['next'] = self.next
+ if hasattr(self, 'available') and self.available is not None:
+ _dict['available'] = self.available
+ if hasattr(self, 'created_at') and self.created_at is not None:
+ _dict['created_at'] = datetime_to_string(self.created_at)
+ if hasattr(self, 'zone') and self.zone is not None:
+ if isinstance(self.zone, dict):
+ _dict['zone'] = self.zone
else:
- _dict['next'] = self.next.to_dict()
- if hasattr(self, 'total_count') and self.total_count is not None:
- _dict['total_count'] = self.total_count
- if hasattr(self, 'vpn_gateways') and self.vpn_gateways is not None:
- vpn_gateways_list = []
- for v in self.vpn_gateways:
- if isinstance(v, dict):
- vpn_gateways_list.append(v)
- else:
- vpn_gateways_list.append(v.to_dict())
- _dict['vpn_gateways'] = vpn_gateways_list
+ _dict['zone'] = self.zone.to_dict()
return _dict
def _to_dict(self):
@@ -77598,58 +80717,64 @@ 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 SnapshotClone object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VPNGatewayCollection') -> bool:
+ def __eq__(self, other: 'SnapshotClone') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'VPNGatewayCollection') -> bool:
+ def __ne__(self, other: 'SnapshotClone') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class VPNGatewayCollectionFirst:
+class SnapshotCloneCollection:
"""
- A link to the first page of resources.
+ SnapshotCloneCollection.
- :attr str href: The URL for a page of resources.
+ :param List[SnapshotClone] clones: Collection of snapshot clones.
"""
def __init__(
self,
- href: str,
+ clones: List['SnapshotClone'],
) -> None:
"""
- Initialize a VPNGatewayCollectionFirst object.
+ Initialize a SnapshotCloneCollection object.
- :param str href: The URL for a page of resources.
+ :param List[SnapshotClone] clones: Collection of snapshot clones.
"""
- self.href = href
+ self.clones = clones
@classmethod
- def from_dict(cls, _dict: Dict) -> 'VPNGatewayCollectionFirst':
- """Initialize a VPNGatewayCollectionFirst object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'SnapshotCloneCollection':
+ """Initialize a SnapshotCloneCollection object from a json dictionary."""
args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ if (clones := _dict.get('clones')) is not None:
+ args['clones'] = [SnapshotClone.from_dict(v) for v in clones]
else:
- raise ValueError('Required property \'href\' not present in VPNGatewayCollectionFirst JSON')
+ raise ValueError('Required property \'clones\' not present in SnapshotCloneCollection JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VPNGatewayCollectionFirst object from a json dictionary."""
+ """Initialize a SnapshotCloneCollection object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'href') and self.href is not None:
- _dict['href'] = self.href
+ if hasattr(self, 'clones') and self.clones is not None:
+ clones_list = []
+ for v in self.clones:
+ if isinstance(v, dict):
+ clones_list.append(v)
+ else:
+ clones_list.append(v.to_dict())
+ _dict['clones'] = clones_list
return _dict
def _to_dict(self):
@@ -77657,59 +80782,65 @@ 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 SnapshotCloneCollection object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VPNGatewayCollectionFirst') -> bool:
+ def __eq__(self, other: 'SnapshotCloneCollection') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'VPNGatewayCollectionFirst') -> bool:
+ def __ne__(self, other: 'SnapshotCloneCollection') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class VPNGatewayCollectionNext:
+class SnapshotClonePrototype:
"""
- A link to the next page of resources. This property is present for all pages except
- the last page.
+ SnapshotClonePrototype.
- :attr str href: The URL for a page of resources.
+ :param ZoneIdentity zone: The zone this snapshot clone will reside in. Must be
+ in the same region as the
+ snapshot.
"""
def __init__(
self,
- href: str,
+ zone: 'ZoneIdentity',
) -> None:
"""
- Initialize a VPNGatewayCollectionNext object.
+ Initialize a SnapshotClonePrototype object.
- :param str href: The URL for a page of resources.
+ :param ZoneIdentity zone: The zone this snapshot clone will reside in. Must
+ be in the same region as the
+ snapshot.
"""
- self.href = href
+ self.zone = zone
@classmethod
- def from_dict(cls, _dict: Dict) -> 'VPNGatewayCollectionNext':
- """Initialize a VPNGatewayCollectionNext object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'SnapshotClonePrototype':
+ """Initialize a SnapshotClonePrototype object from a json dictionary."""
args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ if (zone := _dict.get('zone')) is not None:
+ args['zone'] = zone
else:
- raise ValueError('Required property \'href\' not present in VPNGatewayCollectionNext JSON')
+ raise ValueError('Required property \'zone\' not present in SnapshotClonePrototype JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VPNGatewayCollectionNext object from a json dictionary."""
+ """Initialize a SnapshotClonePrototype object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'href') and self.href is not None:
- _dict['href'] = self.href
+ 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):
@@ -77717,235 +80848,175 @@ 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 SnapshotClonePrototype object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VPNGatewayCollectionNext') -> bool:
+ def __eq__(self, other: 'SnapshotClonePrototype') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'VPNGatewayCollectionNext') -> bool:
+ def __ne__(self, other: 'SnapshotClonePrototype') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class VPNGatewayConnection:
+class SnapshotCollection:
"""
- VPNGatewayConnection.
+ SnapshotCollection.
- :attr bool admin_state_up: If set to false, the VPN gateway connection is shut
- down.
- :attr str authentication_mode: The authentication mode. Only `psk` is currently
- supported.
- :attr datetime created_at: The date and time that this VPN gateway connection
- was created.
- :attr VPNGatewayConnectionDPD dead_peer_detection: The Dead Peer Detection
- settings.
- :attr str href: The VPN connection's canonical URL.
- :attr str id: The unique identifier for this VPN gateway connection.
- :attr IKEPolicyReference ike_policy: (optional) The IKE policy. If absent,
- [auto-negotiation is
- used](https://cloud.ibm.com/docs/vpc?topic=vpc-using-vpn&interface=ui#ike-auto-negotiation-phase-1).
- :attr IPsecPolicyReference ipsec_policy: (optional) The IPsec policy. If absent,
- [auto-negotiation is
- used](https://cloud.ibm.com/docs/vpc?topic=vpc-using-vpn&interface=ui#ipsec-auto-negotiation-phase-2).
- :attr str mode: The mode of the VPN gateway.
- :attr str name: The name for this VPN gateway connection. The name is unique
- across all connections for the VPN gateway.
- :attr str peer_address: The IP address of the peer VPN gateway.
- :attr str psk: The pre-shared key.
- :attr str resource_type: The resource type.
- :attr str status: The status of a VPN gateway connection.
- :attr List[VPNGatewayConnectionStatusReason] status_reasons: The reasons for the
- current VPN gateway connection status (if any):
- - `cannot_authenticate_connection`: Failed to authenticate a connection because
- of
- mismatched IKE ID and PSK (check IKE ID and PSK in peer VPN configuration)
- - `internal_error`: Internal error (contact IBM support)
- - `ike_policy_mismatch`: None of the proposed IKE crypto suites was acceptable
- (check
- the IKE policies on both sides of the VPN)
- - `ike_v1_id_local_remote_cidr_mismatch`: Invalid IKE ID or mismatched local
- CIDRs and
- remote CIDRs in IKE V1 (check the IKE ID or the local CIDRs and remote CIDRs
- in IKE
- V1 configuration)
- - `ike_v2_local_remote_cidr_mismatch`: Mismatched local CIDRs and remote CIDRs
- in IKE
- V2 (check the local CIDRs and remote CIDRs in IKE V2 configuration)
- - `ipsec_policy_mismatch`: None of the proposed IPsec crypto suites was
- acceptable
- (check the IPsec policies on both sides of the VPN)
- - `peer_not_responding`: No response from peer (check network ACL configuration,
- peer
- availability, and on-premise firewall configuration)
- 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 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 SnapshotCollectionNext next: (optional) A link to the next page of
+ resources. This property is present for all pages
+ except the last page.
+ :param List[Snapshot] snapshots: Collection of snapshots.
+ :param int total_count: The total number of resources across all pages.
"""
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,
- status_reasons: List['VPNGatewayConnectionStatusReason'],
+ first: 'SnapshotCollectionFirst',
+ limit: int,
+ snapshots: List['Snapshot'],
+ total_count: int,
*,
- ike_policy: 'IKEPolicyReference' = None,
- ipsec_policy: 'IPsecPolicyReference' = None,
+ next: Optional['SnapshotCollectionNext'] = None,
) -> None:
"""
- Initialize a VPNGatewayConnection object.
-
- :param bool admin_state_up: If set to false, the VPN gateway connection is
- shut down.
- :param str authentication_mode: The authentication mode. Only `psk` is
- currently supported.
- :param datetime created_at: The date and time that this VPN gateway
- connection was created.
- :param VPNGatewayConnectionDPD dead_peer_detection: The Dead Peer Detection
- settings.
- :param str href: The VPN connection's canonical URL.
- :param str id: The unique identifier for this VPN gateway connection.
- :param str mode: The mode of the VPN gateway.
- :param str name: The name for this VPN gateway connection. The name is
- unique across all connections for the VPN gateway.
- :param str peer_address: The IP address of the peer VPN gateway.
- :param str psk: The pre-shared key.
- :param str resource_type: The resource type.
- :param str status: The status of a VPN gateway connection.
- :param List[VPNGatewayConnectionStatusReason] status_reasons: The reasons
- for the current VPN gateway connection status (if any):
- - `cannot_authenticate_connection`: Failed to authenticate a connection
- because of
- mismatched IKE ID and PSK (check IKE ID and PSK in peer VPN
- configuration)
- - `internal_error`: Internal error (contact IBM support)
- - `ike_policy_mismatch`: None of the proposed IKE crypto suites was
- acceptable (check
- the IKE policies on both sides of the VPN)
- - `ike_v1_id_local_remote_cidr_mismatch`: Invalid IKE ID or mismatched
- local CIDRs and
- remote CIDRs in IKE V1 (check the IKE ID or the local CIDRs and remote
- CIDRs in IKE
- V1 configuration)
- - `ike_v2_local_remote_cidr_mismatch`: Mismatched local CIDRs and remote
- CIDRs in IKE
- V2 (check the local CIDRs and remote CIDRs in IKE V2 configuration)
- - `ipsec_policy_mismatch`: None of the proposed IPsec crypto suites was
- acceptable
- (check the IPsec policies on both sides of the VPN)
- - `peer_not_responding`: No response from peer (check network ACL
- configuration, peer
- availability, and on-premise firewall configuration)
- 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 IKEPolicyReference ike_policy: (optional) The IKE policy. If absent,
- [auto-negotiation is
- used](https://cloud.ibm.com/docs/vpc?topic=vpc-using-vpn&interface=ui#ike-auto-negotiation-phase-1).
- :param IPsecPolicyReference ipsec_policy: (optional) The IPsec policy. If
- absent, [auto-negotiation is
- used](https://cloud.ibm.com/docs/vpc?topic=vpc-using-vpn&interface=ui#ipsec-auto-negotiation-phase-2).
- """
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['VPNGatewayConnectionStaticRouteMode', 'VPNGatewayConnectionPolicyMode'])
- )
- raise Exception(msg)
-
- class AuthenticationModeEnum(str, Enum):
- """
- The authentication mode. Only `psk` is currently supported.
- """
-
- PSK = 'psk'
-
+ Initialize a SnapshotCollection object.
- class ModeEnum(str, Enum):
- """
- The mode of the VPN gateway.
+ :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.first = first
+ self.limit = limit
+ self.next = next
+ self.snapshots = snapshots
+ self.total_count = total_count
- POLICY = 'policy'
- ROUTE = 'route'
-
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'SnapshotCollection':
+ """Initialize a SnapshotCollection object from a json dictionary."""
+ args = {}
+ if (first := _dict.get('first')) is not None:
+ args['first'] = SnapshotCollectionFirst.from_dict(first)
+ else:
+ raise ValueError('Required property \'first\' not present in SnapshotCollection JSON')
+ if (limit := _dict.get('limit')) is not None:
+ args['limit'] = limit
+ else:
+ raise ValueError('Required property \'limit\' not present in SnapshotCollection JSON')
+ if (next := _dict.get('next')) is not None:
+ args['next'] = SnapshotCollectionNext.from_dict(next)
+ if (snapshots := _dict.get('snapshots')) is not None:
+ args['snapshots'] = [Snapshot.from_dict(v) for v in snapshots]
+ else:
+ raise ValueError('Required property \'snapshots\' not present in SnapshotCollection JSON')
+ if (total_count := _dict.get('total_count')) is not None:
+ args['total_count'] = total_count
+ else:
+ raise ValueError('Required property \'total_count\' not present in SnapshotCollection JSON')
+ return cls(**args)
- class ResourceTypeEnum(str, Enum):
- """
- The resource type.
- """
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a SnapshotCollection object from a json dictionary."""
+ return cls.from_dict(_dict)
- VPN_GATEWAY_CONNECTION = 'vpn_gateway_connection'
+ def to_dict(self) -> Dict:
+ """Return a json dictionary representing this model."""
+ _dict = {}
+ if hasattr(self, 'first') and self.first is not None:
+ if isinstance(self.first, dict):
+ _dict['first'] = self.first
+ else:
+ _dict['first'] = self.first.to_dict()
+ if hasattr(self, 'limit') and self.limit is not None:
+ _dict['limit'] = self.limit
+ if hasattr(self, 'next') and self.next is not None:
+ if isinstance(self.next, dict):
+ _dict['next'] = self.next
+ else:
+ _dict['next'] = self.next.to_dict()
+ if hasattr(self, 'snapshots') and self.snapshots is not None:
+ snapshots_list = []
+ for v in self.snapshots:
+ if isinstance(v, dict):
+ snapshots_list.append(v)
+ else:
+ snapshots_list.append(v.to_dict())
+ _dict['snapshots'] = snapshots_list
+ if hasattr(self, 'total_count') and self.total_count is not None:
+ _dict['total_count'] = self.total_count
+ return _dict
+ def _to_dict(self):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
- class StatusEnum(str, Enum):
- """
- The status of a VPN gateway connection.
- """
+ def __str__(self) -> str:
+ """Return a `str` version of this SnapshotCollection object."""
+ return json.dumps(self.to_dict(), indent=2)
- DOWN = 'down'
- UP = 'up'
+ def __eq__(self, other: 'SnapshotCollection') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+ def __ne__(self, other: 'SnapshotCollection') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
-class VPNGatewayConnectionCollection:
+class SnapshotCollectionFirst:
"""
- Collection of VPN gateway connections in a VPN gateway.
+ A link to the first page of resources.
- :attr List[VPNGatewayConnection] connections: Array of VPN gateway connections.
+ :param str href: The URL for a page of resources.
"""
def __init__(
self,
- connections: List['VPNGatewayConnection'],
+ href: str,
) -> None:
"""
- Initialize a VPNGatewayConnectionCollection object.
+ Initialize a SnapshotCollectionFirst object.
- :param List[VPNGatewayConnection] connections: Array of VPN gateway
- connections.
+ :param str href: The URL for a page of resources.
"""
- self.connections = connections
+ self.href = href
@classmethod
- def from_dict(cls, _dict: Dict) -> 'VPNGatewayConnectionCollection':
- """Initialize a VPNGatewayConnectionCollection object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'SnapshotCollectionFirst':
+ """Initialize a SnapshotCollectionFirst object from a json dictionary."""
args = {}
- if 'connections' in _dict:
- args['connections'] = _dict.get('connections')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'connections\' not present in VPNGatewayConnectionCollection JSON')
+ raise ValueError('Required property \'href\' not present in SnapshotCollectionFirst JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VPNGatewayConnectionCollection object from a json dictionary."""
+ """Initialize a SnapshotCollectionFirst object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'connections') and self.connections is not None:
- connections_list = []
- for v in self.connections:
- if isinstance(v, dict):
- connections_list.append(v)
- else:
- connections_list.append(v.to_dict())
- _dict['connections'] = connections_list
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
return _dict
def _to_dict(self):
@@ -77953,80 +81024,59 @@ 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 SnapshotCollectionFirst object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VPNGatewayConnectionCollection') -> 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: 'VPNGatewayConnectionCollection') -> bool:
+ def __ne__(self, other: 'SnapshotCollectionFirst') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class VPNGatewayConnectionDPD:
+class SnapshotCollectionNext:
"""
- The Dead Peer Detection settings.
+ A link to the next page of resources. This property is present for all pages except
+ the last page.
- :attr str action: 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.
+ :param str href: The URL for a page of resources.
"""
def __init__(
self,
- action: str,
- interval: int,
- timeout: int,
+ href: str,
) -> None:
"""
- Initialize a VPNGatewayConnectionDPD object.
+ Initialize a SnapshotCollectionNext object.
- :param str action: Dead Peer Detection actions.
- :param int interval: Dead Peer Detection interval in seconds.
- :param int timeout: Dead Peer Detection timeout in seconds. Must be at
- least the interval.
+ :param str href: The URL for a page of resources.
"""
- self.action = action
- self.interval = interval
- self.timeout = timeout
+ self.href = href
@classmethod
- def from_dict(cls, _dict: Dict) -> 'VPNGatewayConnectionDPD':
- """Initialize a VPNGatewayConnectionDPD object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'SnapshotCollectionNext':
+ """Initialize a SnapshotCollectionNext 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')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'timeout\' not present in VPNGatewayConnectionDPD JSON')
+ raise ValueError('Required property \'href\' not present in SnapshotCollectionNext JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VPNGatewayConnectionDPD object from a json dictionary."""
+ """Initialize a SnapshotCollectionNext object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'action') and self.action is not None:
- _dict['action'] = self.action
- if hasattr(self, 'interval') and self.interval is not None:
- _dict['interval'] = self.interval
- if hasattr(self, 'timeout') and self.timeout is not None:
- _dict['timeout'] = self.timeout
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
return _dict
def _to_dict(self):
@@ -78034,86 +81084,201 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this VPNGatewayConnectionDPD object."""
+ """Return a `str` version of this SnapshotCollectionNext object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VPNGatewayConnectionDPD') -> 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: 'VPNGatewayConnectionDPD') -> bool:
+ def __ne__(self, other: 'SnapshotCollectionNext') -> 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 VPNGatewayConnectionDPDPatch:
+class SnapshotConsistencyGroup:
"""
- The Dead Peer Detection settings.
+ SnapshotConsistencyGroup.
- :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.
+ :param BackupPolicyPlanReference backup_policy_plan: (optional) If present, the
+ backup policy plan which created this snapshot consistency group.
+ :param datetime created_at: The date and time that this snapshot consistency
+ group was created.
+ :param str crn: The CRN of this snapshot consistency group.
+ :param bool delete_snapshots_on_delete: Indicates whether deleting the snapshot
+ consistency group will also delete the snapshots in the group.
+ :param str href: The URL for this snapshot consistency group.
+ :param str id: The unique identifier for this snapshot consistency group.
+ :param str lifecycle_state: The lifecycle state of this snapshot consistency
+ group.
+ :param str name: The name for this snapshot consistency group. The name is
+ unique across all snapshot consistency groups in the region.
+ :param ResourceGroupReference resource_group: The resource group for this
+ snapshot consistency group.
+ :param str resource_type: The resource type.
+ :param List[str] service_tags: The [service
+ tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with this
+ snapshot consistency group. Each tag is prefixed with
+ [is.instance:](https://cloud.ibm.com/docs/vpc?topic=vpc-snapshots-vpc-faqs).
+ :param List[SnapshotConsistencyGroupSnapshotsItem] snapshots: The member
+ snapshots that are data-consistent with respect to captured time. (may be
+ [deleted](https://cloud.ibm.com/apidocs/vpc#deleted-resources)).
"""
def __init__(
self,
+ created_at: datetime,
+ crn: str,
+ delete_snapshots_on_delete: bool,
+ href: str,
+ id: str,
+ lifecycle_state: str,
+ name: str,
+ resource_group: 'ResourceGroupReference',
+ resource_type: str,
+ service_tags: List[str],
+ snapshots: List['SnapshotConsistencyGroupSnapshotsItem'],
*,
- action: str = None,
- interval: int = None,
- timeout: int = None,
+ backup_policy_plan: Optional['BackupPolicyPlanReference'] = None,
) -> None:
"""
- Initialize a VPNGatewayConnectionDPDPatch object.
+ Initialize a SnapshotConsistencyGroup 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 datetime created_at: The date and time that this snapshot
+ consistency group was created.
+ :param str crn: The CRN of this snapshot consistency group.
+ :param bool delete_snapshots_on_delete: Indicates whether deleting the
+ snapshot consistency group will also delete the snapshots in the group.
+ :param str href: The URL for this snapshot consistency group.
+ :param str id: The unique identifier for this snapshot consistency group.
+ :param str lifecycle_state: The lifecycle state of this snapshot
+ consistency group.
+ :param str name: The name for this snapshot consistency group. The name is
+ unique across all snapshot consistency groups in the region.
+ :param ResourceGroupReference resource_group: The resource group for this
+ snapshot consistency group.
+ :param str resource_type: The resource type.
+ :param List[str] service_tags: The [service
+ tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with
+ this snapshot consistency group. Each tag is prefixed with
+ [is.instance:](https://cloud.ibm.com/docs/vpc?topic=vpc-snapshots-vpc-faqs).
+ :param List[SnapshotConsistencyGroupSnapshotsItem] snapshots: The member
+ snapshots that are data-consistent with respect to captured time. (may be
+ [deleted](https://cloud.ibm.com/apidocs/vpc#deleted-resources)).
+ :param BackupPolicyPlanReference backup_policy_plan: (optional) If present,
+ the backup policy plan which created this snapshot consistency group.
"""
- self.action = action
- self.interval = interval
- self.timeout = timeout
+ self.backup_policy_plan = backup_policy_plan
+ self.created_at = created_at
+ self.crn = crn
+ self.delete_snapshots_on_delete = delete_snapshots_on_delete
+ self.href = href
+ self.id = id
+ self.lifecycle_state = lifecycle_state
+ self.name = name
+ self.resource_group = resource_group
+ self.resource_type = resource_type
+ self.service_tags = service_tags
+ self.snapshots = snapshots
@classmethod
- def from_dict(cls, _dict: Dict) -> 'VPNGatewayConnectionDPDPatch':
- """Initialize a VPNGatewayConnectionDPDPatch object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'SnapshotConsistencyGroup':
+ """Initialize a SnapshotConsistencyGroup 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 (backup_policy_plan := _dict.get('backup_policy_plan')) is not None:
+ args['backup_policy_plan'] = BackupPolicyPlanReference.from_dict(backup_policy_plan)
+ if (created_at := _dict.get('created_at')) is not None:
+ args['created_at'] = string_to_datetime(created_at)
+ else:
+ raise ValueError('Required property \'created_at\' not present in SnapshotConsistencyGroup JSON')
+ if (crn := _dict.get('crn')) is not None:
+ args['crn'] = crn
+ else:
+ raise ValueError('Required property \'crn\' not present in SnapshotConsistencyGroup JSON')
+ if (delete_snapshots_on_delete := _dict.get('delete_snapshots_on_delete')) is not None:
+ args['delete_snapshots_on_delete'] = delete_snapshots_on_delete
+ else:
+ raise ValueError('Required property \'delete_snapshots_on_delete\' not present in SnapshotConsistencyGroup JSON')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
+ else:
+ raise ValueError('Required property \'href\' not present in SnapshotConsistencyGroup JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
+ else:
+ raise ValueError('Required property \'id\' not present in SnapshotConsistencyGroup JSON')
+ if (lifecycle_state := _dict.get('lifecycle_state')) is not None:
+ args['lifecycle_state'] = lifecycle_state
+ else:
+ raise ValueError('Required property \'lifecycle_state\' not present in SnapshotConsistencyGroup JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ else:
+ raise ValueError('Required property \'name\' not present in SnapshotConsistencyGroup JSON')
+ if (resource_group := _dict.get('resource_group')) is not None:
+ args['resource_group'] = ResourceGroupReference.from_dict(resource_group)
+ else:
+ raise ValueError('Required property \'resource_group\' not present in SnapshotConsistencyGroup JSON')
+ if (resource_type := _dict.get('resource_type')) is not None:
+ args['resource_type'] = resource_type
+ else:
+ raise ValueError('Required property \'resource_type\' not present in SnapshotConsistencyGroup JSON')
+ if (service_tags := _dict.get('service_tags')) is not None:
+ args['service_tags'] = service_tags
+ else:
+ raise ValueError('Required property \'service_tags\' not present in SnapshotConsistencyGroup JSON')
+ if (snapshots := _dict.get('snapshots')) is not None:
+ args['snapshots'] = [SnapshotConsistencyGroupSnapshotsItem.from_dict(v) for v in snapshots]
+ else:
+ raise ValueError('Required property \'snapshots\' not present in SnapshotConsistencyGroup JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VPNGatewayConnectionDPDPatch object from a json dictionary."""
+ """Initialize a SnapshotConsistencyGroup object from 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, 'backup_policy_plan') and self.backup_policy_plan is not None:
+ if isinstance(self.backup_policy_plan, dict):
+ _dict['backup_policy_plan'] = self.backup_policy_plan
+ else:
+ _dict['backup_policy_plan'] = self.backup_policy_plan.to_dict()
+ if hasattr(self, '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, 'delete_snapshots_on_delete') and self.delete_snapshots_on_delete is not None:
+ _dict['delete_snapshots_on_delete'] = self.delete_snapshots_on_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, 'lifecycle_state') and self.lifecycle_state is not None:
+ _dict['lifecycle_state'] = self.lifecycle_state
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ if hasattr(self, 'resource_group') and self.resource_group is not None:
+ if isinstance(self.resource_group, dict):
+ _dict['resource_group'] = self.resource_group
+ else:
+ _dict['resource_group'] = self.resource_group.to_dict()
+ if hasattr(self, 'resource_type') and self.resource_type is not None:
+ _dict['resource_type'] = self.resource_type
+ if hasattr(self, 'service_tags') and self.service_tags is not None:
+ _dict['service_tags'] = self.service_tags
+ if hasattr(self, 'snapshots') and self.snapshots is not None:
+ snapshots_list = []
+ for v in self.snapshots:
+ if isinstance(v, dict):
+ snapshots_list.append(v)
+ else:
+ snapshots_list.append(v.to_dict())
+ _dict['snapshots'] = snapshots_list
return _dict
def _to_dict(self):
@@ -78121,86 +81286,141 @@ 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 SnapshotConsistencyGroup object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VPNGatewayConnectionDPDPatch') -> bool:
+ def __eq__(self, other: 'SnapshotConsistencyGroup') -> bool:
"""Return `true` when 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: 'SnapshotConsistencyGroup') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class ActionEnum(str, Enum):
+ class LifecycleStateEnum(str, Enum):
"""
- Dead Peer Detection actions.
+ The lifecycle state of this snapshot consistency group.
"""
- CLEAR = 'clear'
- HOLD = 'hold'
- NONE = 'none'
- RESTART = 'restart'
+ DELETING = 'deleting'
+ FAILED = 'failed'
+ PENDING = 'pending'
+ STABLE = 'stable'
+ SUSPENDED = 'suspended'
+ UPDATING = 'updating'
+ WAITING = 'waiting'
+ class ResourceTypeEnum(str, Enum):
+ """
+ The resource type.
+ """
-class VPNGatewayConnectionDPDPrototype:
+ SNAPSHOT_CONSISTENCY_GROUP = 'snapshot_consistency_group'
+
+
+
+class SnapshotConsistencyGroupCollection:
"""
- The Dead Peer Detection settings.
+ SnapshotConsistencyGroupCollection.
- :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.
+ :param SnapshotConsistencyGroupCollectionFirst 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 SnapshotConsistencyGroupCollectionNext next: (optional) A link to the
+ next page of resources. This property is present for all pages
+ except the last page.
+ :param List[SnapshotConsistencyGroup] snapshot_consistency_groups: Collection of
+ snapshot consistency groups.
+ :param int total_count: The total number of resources across all pages.
"""
def __init__(
self,
+ first: 'SnapshotConsistencyGroupCollectionFirst',
+ limit: int,
+ snapshot_consistency_groups: List['SnapshotConsistencyGroup'],
+ total_count: int,
*,
- action: str = None,
- interval: int = None,
- timeout: int = None,
+ next: Optional['SnapshotConsistencyGroupCollectionNext'] = None,
) -> None:
"""
- Initialize a VPNGatewayConnectionDPDPrototype object.
+ Initialize a SnapshotConsistencyGroupCollection 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 SnapshotConsistencyGroupCollectionFirst 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[SnapshotConsistencyGroup] snapshot_consistency_groups:
+ Collection of snapshot consistency groups.
+ :param int total_count: The total number of resources across all pages.
+ :param SnapshotConsistencyGroupCollectionNext next: (optional) A link to
+ the next page of resources. This property is present for all pages
+ except the last page.
"""
- self.action = action
- self.interval = interval
- self.timeout = timeout
+ self.first = first
+ self.limit = limit
+ self.next = next
+ self.snapshot_consistency_groups = snapshot_consistency_groups
+ self.total_count = total_count
@classmethod
- def from_dict(cls, _dict: Dict) -> 'VPNGatewayConnectionDPDPrototype':
- """Initialize a VPNGatewayConnectionDPDPrototype object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'SnapshotConsistencyGroupCollection':
+ """Initialize a SnapshotConsistencyGroupCollection object from a json dictionary."""
args = {}
- if 'action' in _dict:
- args['action'] = _dict.get('action')
- if 'interval' in _dict:
- args['interval'] = _dict.get('interval')
- if 'timeout' in _dict:
- args['timeout'] = _dict.get('timeout')
+ if (first := _dict.get('first')) is not None:
+ args['first'] = SnapshotConsistencyGroupCollectionFirst.from_dict(first)
+ else:
+ raise ValueError('Required property \'first\' not present in SnapshotConsistencyGroupCollection JSON')
+ if (limit := _dict.get('limit')) is not None:
+ args['limit'] = limit
+ else:
+ raise ValueError('Required property \'limit\' not present in SnapshotConsistencyGroupCollection JSON')
+ if (next := _dict.get('next')) is not None:
+ args['next'] = SnapshotConsistencyGroupCollectionNext.from_dict(next)
+ if (snapshot_consistency_groups := _dict.get('snapshot_consistency_groups')) is not None:
+ args['snapshot_consistency_groups'] = [SnapshotConsistencyGroup.from_dict(v) for v in snapshot_consistency_groups]
+ else:
+ raise ValueError('Required property \'snapshot_consistency_groups\' not present in SnapshotConsistencyGroupCollection JSON')
+ if (total_count := _dict.get('total_count')) is not None:
+ args['total_count'] = total_count
+ else:
+ raise ValueError('Required property \'total_count\' not present in SnapshotConsistencyGroupCollection JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VPNGatewayConnectionDPDPrototype object from a json dictionary."""
+ """Initialize a SnapshotConsistencyGroupCollection object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'action') and self.action is not None:
- _dict['action'] = self.action
- if hasattr(self, 'interval') and self.interval is not None:
- _dict['interval'] = self.interval
- if hasattr(self, 'timeout') and self.timeout is not None:
- _dict['timeout'] = self.timeout
+ if hasattr(self, 'first') and self.first is not None:
+ if isinstance(self.first, dict):
+ _dict['first'] = self.first
+ else:
+ _dict['first'] = self.first.to_dict()
+ if hasattr(self, 'limit') and self.limit is not None:
+ _dict['limit'] = self.limit
+ if hasattr(self, 'next') and self.next is not None:
+ if isinstance(self.next, dict):
+ _dict['next'] = self.next
+ else:
+ _dict['next'] = self.next.to_dict()
+ if hasattr(self, 'snapshot_consistency_groups') and self.snapshot_consistency_groups is not None:
+ snapshot_consistency_groups_list = []
+ for v in self.snapshot_consistency_groups:
+ if isinstance(v, dict):
+ snapshot_consistency_groups_list.append(v)
+ else:
+ snapshot_consistency_groups_list.append(v.to_dict())
+ _dict['snapshot_consistency_groups'] = snapshot_consistency_groups_list
+ if hasattr(self, 'total_count') and self.total_count is not None:
+ _dict['total_count'] = self.total_count
return _dict
def _to_dict(self):
@@ -78208,148 +81428,118 @@ 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 SnapshotConsistencyGroupCollection object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VPNGatewayConnectionDPDPrototype') -> bool:
+ def __eq__(self, other: 'SnapshotConsistencyGroupCollection') -> bool:
"""Return `true` when 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: 'SnapshotConsistencyGroupCollection') -> 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:
+class SnapshotConsistencyGroupCollectionFirst:
"""
- 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).
+ A link to the first page of resources.
+ :param str href: The URL for a page of resources.
"""
def __init__(
self,
+ href: str,
) -> None:
"""
- Initialize a VPNGatewayConnectionIKEPolicyPatch object.
+ Initialize a SnapshotConsistencyGroupCollectionFirst object.
+ :param str href: The URL for a page of resources.
"""
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['VPNGatewayConnectionIKEPolicyPatchIKEPolicyIdentityById', 'VPNGatewayConnectionIKEPolicyPatchIKEPolicyIdentityByHref'])
- )
- raise Exception(msg)
-
+ self.href = href
-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).
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'SnapshotConsistencyGroupCollectionFirst':
+ """Initialize a SnapshotConsistencyGroupCollectionFirst object from a json dictionary."""
+ args = {}
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
+ else:
+ raise ValueError('Required property \'href\' not present in SnapshotConsistencyGroupCollectionFirst JSON')
+ return cls(**args)
- """
-
- 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)
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a SnapshotConsistencyGroupCollectionFirst object from a json dictionary."""
+ return cls.from_dict(_dict)
+ def to_dict(self) -> Dict:
+ """Return a json dictionary representing this model."""
+ _dict = {}
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
+ return _dict
-class VPNGatewayConnectionIPsecPolicyPrototype:
- """
- The IPsec policy to use. If unspecified, [auto-negotiation will be
- used](https://cloud.ibm.com/docs/vpc?topic=vpc-using-vpn&interface=ui#ipsec-auto-negotiation-phase-2).
+ def _to_dict(self):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
- """
+ def __str__(self) -> str:
+ """Return a `str` version of this SnapshotConsistencyGroupCollectionFirst object."""
+ return json.dumps(self.to_dict(), indent=2)
- def __init__(
- self,
- ) -> None:
- """
- Initialize a VPNGatewayConnectionIPsecPolicyPrototype object.
+ def __eq__(self, other: 'SnapshotConsistencyGroupCollectionFirst') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
- """
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityById', 'VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByHref'])
- )
- raise Exception(msg)
+ def __ne__(self, other: 'SnapshotConsistencyGroupCollectionFirst') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
-class VPNGatewayConnectionLocalCIDRs:
+class SnapshotConsistencyGroupCollectionNext:
"""
- VPNGatewayConnectionLocalCIDRs.
+ A link to the next page of resources. This property is present for all pages except
+ the last page.
- :attr List[str] local_cidrs: (optional) The local CIDRs for this resource.
+ :param str href: The URL for a page of resources.
"""
def __init__(
self,
- *,
- local_cidrs: List[str] = None,
+ href: str,
) -> None:
"""
- Initialize a VPNGatewayConnectionLocalCIDRs object.
+ Initialize a SnapshotConsistencyGroupCollectionNext object.
- :param List[str] local_cidrs: (optional) The local CIDRs for this resource.
+ :param str href: The URL for a page of resources.
"""
- self.local_cidrs = local_cidrs
+ self.href = href
@classmethod
- def from_dict(cls, _dict: Dict) -> 'VPNGatewayConnectionLocalCIDRs':
- """Initialize a VPNGatewayConnectionLocalCIDRs object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'SnapshotConsistencyGroupCollectionNext':
+ """Initialize a SnapshotConsistencyGroupCollectionNext object from a json dictionary."""
args = {}
- if 'local_cidrs' in _dict:
- args['local_cidrs'] = _dict.get('local_cidrs')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
+ else:
+ raise ValueError('Required property \'href\' not present in SnapshotConsistencyGroupCollectionNext JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VPNGatewayConnectionLocalCIDRs object from a json dictionary."""
+ """Initialize a SnapshotConsistencyGroupCollectionNext object from 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, 'href') and self.href is not None:
+ _dict['href'] = self.href
return _dict
def _to_dict(self):
@@ -78357,113 +81547,71 @@ 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 SnapshotConsistencyGroupCollectionNext object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VPNGatewayConnectionLocalCIDRs') -> bool:
+ def __eq__(self, other: 'SnapshotConsistencyGroupCollectionNext') -> bool:
"""Return `true` when 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: 'SnapshotConsistencyGroupCollectionNext') -> 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 name for this VPN gateway connection. The name
- must not be used by another connection for the VPN gateway.
- :attr str peer_address: (optional) The IP address of the peer VPN gateway.
- :attr str psk: (optional) The pre-shared key.
- """
-
- def __init__(
- self,
- *,
- 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 name for this VPN gateway connection. The
- name must not be used by another connection for the VPN gateway.
- :param str peer_address: (optional) The IP address of the peer VPN gateway.
- :param str psk: (optional) The pre-shared key.
- """
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['VPNGatewayConnectionPatchVPNGatewayConnectionStaticRouteModePatch'])
- )
- raise Exception(msg)
-
-
-class VPNGatewayConnectionPeerCIDRs:
+class SnapshotConsistencyGroupPatch:
"""
- VPNGatewayConnectionPeerCIDRs.
+ SnapshotConsistencyGroupPatch.
- :attr List[str] peer_cidrs: (optional) The peer CIDRs for this resource.
+ :param bool delete_snapshots_on_delete: (optional) Indicates whether deleting
+ the snapshot consistency group will also delete the snapshots in the group.
+ :param str name: (optional) The name for this snapshot consistency group. The
+ name must not be used by another snapshot consistency groups in the region.
"""
def __init__(
self,
*,
- peer_cidrs: List[str] = None,
+ delete_snapshots_on_delete: Optional[bool] = None,
+ name: Optional[str] = None,
) -> None:
"""
- Initialize a VPNGatewayConnectionPeerCIDRs object.
+ Initialize a SnapshotConsistencyGroupPatch object.
- :param List[str] peer_cidrs: (optional) The peer CIDRs for this resource.
+ :param bool delete_snapshots_on_delete: (optional) Indicates whether
+ deleting the snapshot consistency group will also delete the snapshots in
+ the group.
+ :param str name: (optional) The name for this snapshot consistency group.
+ The name must not be used by another snapshot consistency groups in the
+ region.
"""
- self.peer_cidrs = peer_cidrs
+ self.delete_snapshots_on_delete = delete_snapshots_on_delete
+ self.name = name
@classmethod
- def from_dict(cls, _dict: Dict) -> 'VPNGatewayConnectionPeerCIDRs':
- """Initialize a VPNGatewayConnectionPeerCIDRs object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'SnapshotConsistencyGroupPatch':
+ """Initialize a SnapshotConsistencyGroupPatch object from a json dictionary."""
args = {}
- if 'peer_cidrs' in _dict:
- args['peer_cidrs'] = _dict.get('peer_cidrs')
+ if (delete_snapshots_on_delete := _dict.get('delete_snapshots_on_delete')) is not None:
+ args['delete_snapshots_on_delete'] = delete_snapshots_on_delete
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VPNGatewayConnectionPeerCIDRs object from a json dictionary."""
+ """Initialize a SnapshotConsistencyGroupPatch object from 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, 'delete_snapshots_on_delete') and self.delete_snapshots_on_delete is not None:
+ _dict['delete_snapshots_on_delete'] = self.delete_snapshots_on_delete
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
return _dict
def _to_dict(self):
@@ -78471,113 +81619,104 @@ 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 SnapshotConsistencyGroupPatch object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VPNGatewayConnectionPeerCIDRs') -> bool:
+ def __eq__(self, other: 'SnapshotConsistencyGroupPatch') -> bool:
"""Return `true` when 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: 'SnapshotConsistencyGroupPatch') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class VPNGatewayConnectionPrototype:
+class SnapshotConsistencyGroupPrototype:
"""
- VPNGatewayConnectionPrototype.
+ SnapshotConsistencyGroupPrototype.
- :attr bool admin_state_up: (optional) If set to false, the VPN gateway
- connection is shut down.
- :attr VPNGatewayConnectionDPDPrototype dead_peer_detection: (optional) The Dead
- Peer Detection settings.
- :attr VPNGatewayConnectionIKEPolicyPrototype ike_policy: (optional) The IKE
- policy to use. If unspecified, [auto-negotiation will be
- used](https://cloud.ibm.com/docs/vpc?topic=vpc-using-vpn&interface=ui#ike-auto-negotiation-phase-1).
- :attr VPNGatewayConnectionIPsecPolicyPrototype ipsec_policy: (optional) The
- IPsec policy to use. If unspecified, [auto-negotiation will be
- used](https://cloud.ibm.com/docs/vpc?topic=vpc-using-vpn&interface=ui#ipsec-auto-negotiation-phase-2).
- :attr str name: (optional) The name for this VPN gateway connection. The name
- must not be used by another connection for the VPN gateway. If unspecified, the
- name will be a hyphenated list of randomly-selected words.
- :attr str peer_address: The IP address of the peer VPN gateway.
- :attr str psk: The pre-shared key.
+ :param bool delete_snapshots_on_delete: (optional) Indicates whether deleting
+ the snapshot consistency group will also delete the snapshots in the group.
+ :param str name: (optional) The name for this snapshot consistency group. The
+ name must be unique across all snapshot consistency groups in the region.
+ If unspecified, the name will be a hyphenated list of randomly-selected words.
+ :param ResourceGroupIdentity resource_group: (optional) The resource group to
+ use. If unspecified, the account's [default resource
+ group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be
+ used.
"""
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,
+ delete_snapshots_on_delete: Optional[bool] = None,
+ name: Optional[str] = None,
+ resource_group: Optional['ResourceGroupIdentity'] = None,
) -> None:
"""
- Initialize a VPNGatewayConnectionPrototype object.
+ Initialize a SnapshotConsistencyGroupPrototype object.
- :param str peer_address: The IP address of the peer VPN gateway.
- :param str psk: The pre-shared key.
- :param bool admin_state_up: (optional) If set to false, the VPN gateway
- connection is shut down.
- :param VPNGatewayConnectionDPDPrototype dead_peer_detection: (optional) The
- Dead Peer Detection settings.
- :param VPNGatewayConnectionIKEPolicyPrototype ike_policy: (optional) The
- IKE policy to use. If unspecified, [auto-negotiation will be
- used](https://cloud.ibm.com/docs/vpc?topic=vpc-using-vpn&interface=ui#ike-auto-negotiation-phase-1).
- :param VPNGatewayConnectionIPsecPolicyPrototype ipsec_policy: (optional)
- The IPsec policy to use. If unspecified, [auto-negotiation will be
- used](https://cloud.ibm.com/docs/vpc?topic=vpc-using-vpn&interface=ui#ipsec-auto-negotiation-phase-2).
- :param str name: (optional) The name for this VPN gateway connection. The
- name must not be used by another connection for the VPN gateway. If
- unspecified, the name will be a hyphenated list of randomly-selected words.
+ :param bool delete_snapshots_on_delete: (optional) Indicates whether
+ deleting the snapshot consistency group will also delete the snapshots in
+ the group.
+ :param str name: (optional) The name for this snapshot consistency group.
+ The name must be unique across all snapshot consistency groups in the
+ region.
+ If unspecified, the name will be a hyphenated list of randomly-selected
+ words.
+ :param ResourceGroupIdentity resource_group: (optional) The resource group
+ to use. If unspecified, the account's [default resource
+ group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be
+ used.
"""
msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype', 'VPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype'])
+ ", ".join(['SnapshotConsistencyGroupPrototypeSnapshotConsistencyGroupBySnapshots'])
)
raise Exception(msg)
-class VPNGatewayConnectionReference:
+class SnapshotConsistencyGroupReference:
"""
- VPNGatewayConnectionReference.
+ SnapshotConsistencyGroupReference.
- :attr VPNGatewayConnectionReferenceDeleted deleted: (optional) If present, this
- property indicates the referenced resource has been deleted, and provides
+ :param str crn: The CRN of this snapshot consistency group.
+ :param SnapshotConsistencyGroupReferenceDeleted deleted: (optional) If present,
+ this property indicates the referenced resource has been deleted, and provides
some supplementary information.
- :attr str href: The VPN connection's canonical URL.
- :attr str id: The unique identifier for this VPN gateway connection.
- :attr str name: The name for this VPN gateway connection. The name is unique
- across all connections for the VPN gateway.
- :attr str resource_type: The resource type.
+ :param str href: The URL for this snapshot consistency group.
+ :param str id: The unique identifier for this snapshot consistency group.
+ :param str name: The name for this snapshot consistency group. The name is
+ unique across all snapshot consistency groups in the region.
+ :param str resource_type: The resource type.
"""
def __init__(
self,
+ crn: str,
href: str,
id: str,
name: str,
resource_type: str,
*,
- deleted: 'VPNGatewayConnectionReferenceDeleted' = None,
+ deleted: Optional['SnapshotConsistencyGroupReferenceDeleted'] = None,
) -> None:
"""
- Initialize a VPNGatewayConnectionReference object.
+ Initialize a SnapshotConsistencyGroupReference object.
- :param str href: The VPN connection's canonical URL.
- :param str id: The unique identifier for this VPN gateway connection.
- :param str name: The name for this VPN gateway connection. The name is
- unique across all connections for the VPN gateway.
+ :param str crn: The CRN of this snapshot consistency group.
+ :param str href: The URL for this snapshot consistency group.
+ :param str id: The unique identifier for this snapshot consistency group.
+ :param str name: The name for this snapshot consistency group. The name is
+ unique across all snapshot consistency groups in the region.
:param str resource_type: The resource type.
- :param VPNGatewayConnectionReferenceDeleted deleted: (optional) If present,
- this property indicates the referenced resource has been deleted, and
- provides
+ :param SnapshotConsistencyGroupReferenceDeleted 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
@@ -78585,37 +81724,43 @@ def __init__(
self.resource_type = resource_type
@classmethod
- def from_dict(cls, _dict: Dict) -> 'VPNGatewayConnectionReference':
- """Initialize a VPNGatewayConnectionReference object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'SnapshotConsistencyGroupReference':
+ """Initialize a SnapshotConsistencyGroupReference 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')
+ if (crn := _dict.get('crn')) is not None:
+ args['crn'] = crn
else:
- raise ValueError('Required property \'href\' not present in VPNGatewayConnectionReference JSON')
- if 'id' in _dict:
- args['id'] = _dict.get('id')
+ raise ValueError('Required property \'crn\' not present in SnapshotConsistencyGroupReference JSON')
+ if (deleted := _dict.get('deleted')) is not None:
+ args['deleted'] = SnapshotConsistencyGroupReferenceDeleted.from_dict(deleted)
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'id\' not present in VPNGatewayConnectionReference JSON')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
+ raise ValueError('Required property \'href\' not present in SnapshotConsistencyGroupReference JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
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 \'id\' not present in SnapshotConsistencyGroupReference JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
else:
- raise ValueError('Required property \'resource_type\' not present in VPNGatewayConnectionReference JSON')
+ raise ValueError('Required property \'name\' not present in SnapshotConsistencyGroupReference JSON')
+ if (resource_type := _dict.get('resource_type')) is not None:
+ args['resource_type'] = resource_type
+ else:
+ raise ValueError('Required property \'resource_type\' not present in SnapshotConsistencyGroupReference JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VPNGatewayConnectionReference object from a json dictionary."""
+ """Initialize a SnapshotConsistencyGroupReference object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
+ if hasattr(self, 'crn') and self.crn is not None:
+ _dict['crn'] = self.crn
if hasattr(self, 'deleted') and self.deleted is not None:
if isinstance(self.deleted, dict):
_dict['deleted'] = self.deleted
@@ -78636,16 +81781,16 @@ 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 SnapshotConsistencyGroupReference object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VPNGatewayConnectionReference') -> bool:
+ def __eq__(self, other: 'SnapshotConsistencyGroupReference') -> bool:
"""Return `true` when 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: 'SnapshotConsistencyGroupReference') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
@@ -78654,16 +81799,16 @@ class ResourceTypeEnum(str, Enum):
The resource type.
"""
- VPN_GATEWAY_CONNECTION = 'vpn_gateway_connection'
+ SNAPSHOT_CONSISTENCY_GROUP = 'snapshot_consistency_group'
-class VPNGatewayConnectionReferenceDeleted:
+class SnapshotConsistencyGroupReferenceDeleted:
"""
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.
+ :param str more_info: Link to documentation about deleted resources.
"""
def __init__(
@@ -78671,25 +81816,25 @@ def __init__(
more_info: str,
) -> None:
"""
- Initialize a VPNGatewayConnectionReferenceDeleted object.
+ Initialize a SnapshotConsistencyGroupReferenceDeleted object.
:param str more_info: Link to documentation about deleted resources.
"""
self.more_info = more_info
@classmethod
- def from_dict(cls, _dict: Dict) -> 'VPNGatewayConnectionReferenceDeleted':
- """Initialize a VPNGatewayConnectionReferenceDeleted object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'SnapshotConsistencyGroupReferenceDeleted':
+ """Initialize a SnapshotConsistencyGroupReferenceDeleted object from a json dictionary."""
args = {}
- if 'more_info' in _dict:
- args['more_info'] = _dict.get('more_info')
+ if (more_info := _dict.get('more_info')) is not None:
+ args['more_info'] = more_info
else:
- raise ValueError('Required property \'more_info\' not present in VPNGatewayConnectionReferenceDeleted JSON')
+ raise ValueError('Required property \'more_info\' not present in SnapshotConsistencyGroupReferenceDeleted JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VPNGatewayConnectionReferenceDeleted object from a json dictionary."""
+ """Initialize a SnapshotConsistencyGroupReferenceDeleted object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -78704,142 +81849,131 @@ 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 SnapshotConsistencyGroupReferenceDeleted object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VPNGatewayConnectionReferenceDeleted') -> bool:
+ def __eq__(self, other: 'SnapshotConsistencyGroupReferenceDeleted') -> bool:
"""Return `true` when 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: 'SnapshotConsistencyGroupReferenceDeleted') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class VPNGatewayConnectionStaticRouteModeTunnel:
+class SnapshotConsistencyGroupSnapshotsItem:
"""
- VPNGatewayConnectionStaticRouteModeTunnel.
+ SnapshotConsistencyGroupSnapshotsItem.
- :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 List[VPNGatewayConnectionTunnelStatusReason] status_reasons: The reasons
- for the current VPN gateway connection tunnels status (if any):
- - `cannot_authenticate_connection`: Failed to authenticate a connection because
- of
- mismatched IKE ID and PSK (check IKE ID and PSK in peer VPN configuration)
- - `internal_error`: Internal error (contact IBM support)
- - `ike_policy_mismatch`: None of the proposed IKE crypto suites was acceptable
- (check
- the IKE policies on both sides of the VPN)
- - `ike_v1_id_local_remote_cidr_mismatch`: Invalid IKE ID or mismatched local
- CIDRs and
- remote CIDRs in IKE V1 (check the IKE ID or the local CIDRs and remote CIDRs
- in IKE
- V1 configuration)
- - `ike_v2_local_remote_cidr_mismatch`: Mismatched local CIDRs and remote CIDRs
- in IKE
- V2 (check the local CIDRs and remote CIDRs in IKE V2 configuration)
- - `ipsec_policy_mismatch`: None of the proposed IPsec crypto suites was
- acceptable
- (check the IPsec policies on both sides of the VPN)
- - `peer_not_responding`: No response from peer (check network ACL configuration,
- peer
- availability, and on-premise firewall configuration)
- 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 crn: The CRN of this snapshot.
+ :param SnapshotReferenceDeleted 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 snapshot.
+ :param str id: The unique identifier for this snapshot.
+ :param str name: The name for this snapshot. The name is unique across all
+ snapshots in the region.
+ :param SnapshotRemote remote: (optional) If present, this property indicates
+ that the resource associated with this reference
+ is remote and therefore may not be directly retrievable.
+ :param str resource_type: The resource type.
"""
def __init__(
self,
- public_ip: 'IP',
- status: str,
- status_reasons: List['VPNGatewayConnectionTunnelStatusReason'],
+ crn: str,
+ href: str,
+ id: str,
+ name: str,
+ resource_type: str,
+ *,
+ deleted: Optional['SnapshotReferenceDeleted'] = None,
+ remote: Optional['SnapshotRemote'] = None,
) -> None:
"""
- Initialize a VPNGatewayConnectionStaticRouteModeTunnel object.
+ Initialize a SnapshotConsistencyGroupSnapshotsItem 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 List[VPNGatewayConnectionTunnelStatusReason] status_reasons: The
- reasons for the current VPN gateway connection tunnels status (if any):
- - `cannot_authenticate_connection`: Failed to authenticate a connection
- because of
- mismatched IKE ID and PSK (check IKE ID and PSK in peer VPN
- configuration)
- - `internal_error`: Internal error (contact IBM support)
- - `ike_policy_mismatch`: None of the proposed IKE crypto suites was
- acceptable (check
- the IKE policies on both sides of the VPN)
- - `ike_v1_id_local_remote_cidr_mismatch`: Invalid IKE ID or mismatched
- local CIDRs and
- remote CIDRs in IKE V1 (check the IKE ID or the local CIDRs and remote
- CIDRs in IKE
- V1 configuration)
- - `ike_v2_local_remote_cidr_mismatch`: Mismatched local CIDRs and remote
- CIDRs in IKE
- V2 (check the local CIDRs and remote CIDRs in IKE V2 configuration)
- - `ipsec_policy_mismatch`: None of the proposed IPsec crypto suites was
- acceptable
- (check the IPsec policies on both sides of the VPN)
- - `peer_not_responding`: No response from peer (check network ACL
- configuration, peer
- availability, and on-premise firewall configuration)
- 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 crn: The CRN of this snapshot.
+ :param str href: The URL for this snapshot.
+ :param str id: The unique identifier for this snapshot.
+ :param str name: The name for this snapshot. The name is unique across all
+ snapshots in the region.
+ :param str resource_type: The resource type.
+ :param SnapshotReferenceDeleted deleted: (optional) If present, this
+ property indicates the referenced resource has been deleted, and provides
+ some supplementary information.
+ :param SnapshotRemote remote: (optional) If present, this property
+ indicates that the resource associated with this reference
+ is remote and therefore may not be directly retrievable.
"""
- self.public_ip = public_ip
- self.status = status
- self.status_reasons = status_reasons
+ self.crn = crn
+ self.deleted = deleted
+ self.href = href
+ self.id = id
+ self.name = name
+ self.remote = remote
+ self.resource_type = resource_type
@classmethod
- def from_dict(cls, _dict: Dict) -> 'VPNGatewayConnectionStaticRouteModeTunnel':
- """Initialize a VPNGatewayConnectionStaticRouteModeTunnel object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'SnapshotConsistencyGroupSnapshotsItem':
+ """Initialize a SnapshotConsistencyGroupSnapshotsItem object from a json dictionary."""
args = {}
- if 'public_ip' in _dict:
- args['public_ip'] = IP.from_dict(_dict.get('public_ip'))
+ if (crn := _dict.get('crn')) is not None:
+ args['crn'] = crn
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 \'crn\' not present in SnapshotConsistencyGroupSnapshotsItem JSON')
+ if (deleted := _dict.get('deleted')) is not None:
+ args['deleted'] = SnapshotReferenceDeleted.from_dict(deleted)
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'status\' not present in VPNGatewayConnectionStaticRouteModeTunnel JSON')
- if 'status_reasons' in _dict:
- args['status_reasons'] = [VPNGatewayConnectionTunnelStatusReason.from_dict(v) for v in _dict.get('status_reasons')]
+ raise ValueError('Required property \'href\' not present in SnapshotConsistencyGroupSnapshotsItem JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
else:
- raise ValueError('Required property \'status_reasons\' not present in VPNGatewayConnectionStaticRouteModeTunnel JSON')
+ raise ValueError('Required property \'id\' not present in SnapshotConsistencyGroupSnapshotsItem JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ else:
+ raise ValueError('Required property \'name\' not present in SnapshotConsistencyGroupSnapshotsItem JSON')
+ if (remote := _dict.get('remote')) is not None:
+ args['remote'] = SnapshotRemote.from_dict(remote)
+ if (resource_type := _dict.get('resource_type')) is not None:
+ args['resource_type'] = resource_type
+ else:
+ raise ValueError('Required property \'resource_type\' not present in SnapshotConsistencyGroupSnapshotsItem JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VPNGatewayConnectionStaticRouteModeTunnel object from a json dictionary."""
+ """Initialize a SnapshotConsistencyGroupSnapshotsItem object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'public_ip') and self.public_ip is not None:
- if isinstance(self.public_ip, dict):
- _dict['public_ip'] = self.public_ip
+ if hasattr(self, 'crn') and self.crn is not None:
+ _dict['crn'] = self.crn
+ if hasattr(self, 'deleted') and self.deleted is not None:
+ if isinstance(self.deleted, dict):
+ _dict['deleted'] = self.deleted
else:
- _dict['public_ip'] = self.public_ip.to_dict()
- if hasattr(self, 'status') and self.status is not None:
- _dict['status'] = self.status
- if hasattr(self, 'status_reasons') and self.status_reasons is not None:
- status_reasons_list = []
- for v in self.status_reasons:
- if isinstance(v, dict):
- status_reasons_list.append(v)
- else:
- status_reasons_list.append(v.to_dict())
- _dict['status_reasons'] = status_reasons_list
+ _dict['deleted'] = self.deleted.to_dict()
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
+ if hasattr(self, 'id') and self.id is not None:
+ _dict['id'] = self.id
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ if hasattr(self, 'remote') and self.remote is not None:
+ if isinstance(self.remote, dict):
+ _dict['remote'] = self.remote
+ else:
+ _dict['remote'] = self.remote.to_dict()
+ if hasattr(self, 'resource_type') and self.resource_type is not None:
+ _dict['resource_type'] = self.resource_type
return _dict
def _to_dict(self):
@@ -78847,90 +81981,137 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this VPNGatewayConnectionStaticRouteModeTunnel object."""
+ """Return a `str` version of this SnapshotConsistencyGroupSnapshotsItem object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VPNGatewayConnectionStaticRouteModeTunnel') -> bool:
+ def __eq__(self, other: 'SnapshotConsistencyGroupSnapshotsItem') -> bool:
"""Return `true` when 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: 'SnapshotConsistencyGroupSnapshotsItem') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class StatusEnum(str, Enum):
+ class ResourceTypeEnum(str, Enum):
"""
- The status of the VPN Tunnel.
+ The resource type.
"""
- DOWN = 'down'
- UP = 'up'
+ SNAPSHOT = 'snapshot'
-class VPNGatewayConnectionStatusReason:
+class SnapshotCopiesItem:
"""
- VPNGatewayConnectionStatusReason.
+ SnapshotCopiesItem.
- :attr str code: A snake case string succinctly identifying the status reason.
- :attr str message: An explanation of the reason for this VPN gateway
- connection's status.
- :attr str more_info: (optional) Link to documentation about this status reason.
+ :param str crn: The CRN for the copied snapshot.
+ :param SnapshotReferenceDeleted deleted: (optional) If present, this property
+ indicates the referenced resource has been deleted, and provides
+ some supplementary information.
+ :param str href: The URL for the copied snapshot.
+ :param str id: The unique identifier for the copied snapshot.
+ :param str name: The name for the copied snapshot.
+ :param SnapshotRemote remote: (optional) If present, this property indicates
+ that the resource associated with this reference
+ is remote and therefore may not be directly retrievable.
+ :param str resource_type: The resource type.
"""
def __init__(
self,
- code: str,
- message: str,
+ crn: str,
+ href: str,
+ id: str,
+ name: str,
+ resource_type: str,
*,
- more_info: str = None,
+ deleted: Optional['SnapshotReferenceDeleted'] = None,
+ remote: Optional['SnapshotRemote'] = None,
) -> None:
"""
- Initialize a VPNGatewayConnectionStatusReason object.
+ Initialize a SnapshotCopiesItem object.
- :param str code: A snake case string succinctly identifying the status
- reason.
- :param str message: An explanation of the reason for this VPN gateway
- connection's status.
- :param str more_info: (optional) Link to documentation about this status
- reason.
+ :param str crn: The CRN for the copied snapshot.
+ :param str href: The URL for the copied snapshot.
+ :param str id: The unique identifier for the copied snapshot.
+ :param str name: The name for the copied snapshot.
+ :param str resource_type: The resource type.
+ :param SnapshotReferenceDeleted deleted: (optional) If present, this
+ property indicates the referenced resource has been deleted, and provides
+ some supplementary information.
+ :param SnapshotRemote remote: (optional) If present, this property
+ indicates that the resource associated with this reference
+ is remote and therefore may not be directly retrievable.
"""
- self.code = code
- self.message = message
- self.more_info = more_info
+ self.crn = crn
+ self.deleted = deleted
+ self.href = href
+ self.id = id
+ self.name = name
+ self.remote = remote
+ self.resource_type = resource_type
@classmethod
- def from_dict(cls, _dict: Dict) -> 'VPNGatewayConnectionStatusReason':
- """Initialize a VPNGatewayConnectionStatusReason object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'SnapshotCopiesItem':
+ """Initialize a SnapshotCopiesItem object from a json dictionary."""
args = {}
- if 'code' in _dict:
- args['code'] = _dict.get('code')
+ if (crn := _dict.get('crn')) is not None:
+ args['crn'] = crn
else:
- raise ValueError('Required property \'code\' not present in VPNGatewayConnectionStatusReason JSON')
- if 'message' in _dict:
- args['message'] = _dict.get('message')
+ raise ValueError('Required property \'crn\' not present in SnapshotCopiesItem JSON')
+ if (deleted := _dict.get('deleted')) is not None:
+ args['deleted'] = SnapshotReferenceDeleted.from_dict(deleted)
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'message\' not present in VPNGatewayConnectionStatusReason JSON')
- if 'more_info' in _dict:
- args['more_info'] = _dict.get('more_info')
+ raise ValueError('Required property \'href\' not present in SnapshotCopiesItem JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
+ else:
+ raise ValueError('Required property \'id\' not present in SnapshotCopiesItem JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ else:
+ raise ValueError('Required property \'name\' not present in SnapshotCopiesItem JSON')
+ if (remote := _dict.get('remote')) is not None:
+ args['remote'] = SnapshotRemote.from_dict(remote)
+ if (resource_type := _dict.get('resource_type')) is not None:
+ args['resource_type'] = resource_type
+ else:
+ raise ValueError('Required property \'resource_type\' not present in SnapshotCopiesItem JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VPNGatewayConnectionStatusReason object from a json dictionary."""
+ """Initialize a SnapshotCopiesItem object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, '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, 'crn') and self.crn is not None:
+ _dict['crn'] = self.crn
+ if hasattr(self, 'deleted') and self.deleted is not None:
+ if isinstance(self.deleted, dict):
+ _dict['deleted'] = self.deleted
+ else:
+ _dict['deleted'] = self.deleted.to_dict()
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
+ if hasattr(self, 'id') and self.id is not None:
+ _dict['id'] = self.id
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ if hasattr(self, 'remote') and self.remote is not None:
+ if isinstance(self.remote, dict):
+ _dict['remote'] = self.remote
+ else:
+ _dict['remote'] = self.remote.to_dict()
+ if hasattr(self, 'resource_type') and self.resource_type is not None:
+ _dict['resource_type'] = self.resource_type
return _dict
def _to_dict(self):
@@ -78938,191 +82119,98 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this VPNGatewayConnectionStatusReason object."""
+ """Return a `str` version of this SnapshotCopiesItem object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VPNGatewayConnectionStatusReason') -> bool:
+ def __eq__(self, other: 'SnapshotCopiesItem') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'VPNGatewayConnectionStatusReason') -> bool:
+ def __ne__(self, other: 'SnapshotCopiesItem') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class CodeEnum(str, Enum):
+ class ResourceTypeEnum(str, Enum):
"""
- A snake case string succinctly identifying the status reason.
+ The resource type.
"""
- CANNOT_AUTHENTICATE_CONNECTION = 'cannot_authenticate_connection'
- IKE_POLICY_MISMATCH = 'ike_policy_mismatch'
- IKE_V1_ID_LOCAL_REMOTE_CIDR_MISMATCH = 'ike_v1_id_local_remote_cidr_mismatch'
- IKE_V2_LOCAL_REMOTE_CIDR_MISMATCH = 'ike_v2_local_remote_cidr_mismatch'
- INTERNAL_ERROR = 'internal_error'
- IPSEC_POLICY_MISMATCH = 'ipsec_policy_mismatch'
- PEER_NOT_RESPONDING = 'peer_not_responding'
+ SNAPSHOT = 'snapshot'
-class VPNGatewayConnectionTunnelStatusReason:
+class SnapshotIdentity:
"""
- VPNGatewayConnectionTunnelStatusReason.
+ Identifies a snapshot by a unique property.
- :attr str code: A snake case string succinctly identifying the status reason.
- :attr str message: An explanation of the reason for this VPN gateway connection
- tunnel's status.
- :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 VPNGatewayConnectionTunnelStatusReason object.
+ Initialize a SnapshotIdentity object.
- :param str code: A snake case string succinctly identifying the status
- reason.
- :param str message: An explanation of the reason for this VPN gateway
- connection tunnel's status.
- :param str more_info: (optional) Link to documentation about this status
- reason.
"""
- self.code = code
- self.message = message
- self.more_info = more_info
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['SnapshotIdentityById', 'SnapshotIdentityByCRN', 'SnapshotIdentityByHref'])
+ )
+ raise Exception(msg)
- @classmethod
- def from_dict(cls, _dict: Dict) -> 'VPNGatewayConnectionTunnelStatusReason':
- """Initialize a VPNGatewayConnectionTunnelStatusReason object from a json dictionary."""
- args = {}
- if 'code' in _dict:
- args['code'] = _dict.get('code')
- else:
- raise ValueError('Required property \'code\' not present in VPNGatewayConnectionTunnelStatusReason JSON')
- if 'message' in _dict:
- args['message'] = _dict.get('message')
- else:
- raise ValueError('Required property \'message\' not present in VPNGatewayConnectionTunnelStatusReason JSON')
- if 'more_info' in _dict:
- args['more_info'] = _dict.get('more_info')
- return cls(**args)
- @classmethod
- def _from_dict(cls, _dict):
- """Initialize a VPNGatewayConnectionTunnelStatusReason object from a json dictionary."""
- return cls.from_dict(_dict)
+class SnapshotPatch:
+ """
+ SnapshotPatch.
- 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 VPNGatewayConnectionTunnelStatusReason object."""
- return json.dumps(self.to_dict(), indent=2)
-
- def __eq__(self, other: 'VPNGatewayConnectionTunnelStatusReason') -> bool:
- """Return `true` when self and other are equal, false otherwise."""
- if not isinstance(other, self.__class__):
- return False
- return self.__dict__ == other.__dict__
-
- def __ne__(self, other: 'VPNGatewayConnectionTunnelStatusReason') -> bool:
- """Return `true` when self and other are not equal, false otherwise."""
- return not self == other
-
- class CodeEnum(str, Enum):
- """
- A snake case string succinctly identifying the status reason.
- """
-
- CANNOT_AUTHENTICATE_CONNECTION = 'cannot_authenticate_connection'
- IKE_POLICY_MISMATCH = 'ike_policy_mismatch'
- IKE_V1_ID_LOCAL_REMOTE_CIDR_MISMATCH = 'ike_v1_id_local_remote_cidr_mismatch'
- IKE_V2_LOCAL_REMOTE_CIDR_MISMATCH = 'ike_v2_local_remote_cidr_mismatch'
- INTERNAL_ERROR = 'internal_error'
- IPSEC_POLICY_MISMATCH = 'ipsec_policy_mismatch'
- PEER_NOT_RESPONDING = 'peer_not_responding'
-
-
-
-class VPNGatewayHealthReason:
- """
- VPNGatewayHealthReason.
-
- :attr str code: A snake case string succinctly identifying the reason for this
- health state.
- :attr str message: An explanation of the reason for this health state.
- :attr str more_info: (optional) Link to documentation about the reason for this
- health state.
+ :param str name: (optional) The name for this snapshot. The name must not be
+ used by another snapshot in the region.
+ :param List[str] user_tags: (optional) The [user
+ tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with this
+ snapshot.
"""
def __init__(
self,
- code: str,
- message: str,
*,
- more_info: str = None,
+ name: Optional[str] = None,
+ user_tags: Optional[List[str]] = None,
) -> None:
"""
- Initialize a VPNGatewayHealthReason object.
+ Initialize a SnapshotPatch object.
- :param str code: A snake case string succinctly identifying the reason for
- this health state.
- :param str message: An explanation of the reason for this health state.
- :param str more_info: (optional) Link to documentation about the reason for
- this health state.
+ :param str name: (optional) The name for this snapshot. The name must not
+ be used by another snapshot in the region.
+ :param List[str] user_tags: (optional) The [user
+ tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with
+ this snapshot.
"""
- self.code = code
- self.message = message
- self.more_info = more_info
+ self.name = name
+ self.user_tags = user_tags
@classmethod
- def from_dict(cls, _dict: Dict) -> 'VPNGatewayHealthReason':
- """Initialize a VPNGatewayHealthReason object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'SnapshotPatch':
+ """Initialize a SnapshotPatch object from a json dictionary."""
args = {}
- if 'code' in _dict:
- args['code'] = _dict.get('code')
- else:
- raise ValueError('Required property \'code\' not present in VPNGatewayHealthReason JSON')
- if 'message' in _dict:
- args['message'] = _dict.get('message')
- else:
- raise ValueError('Required property \'message\' not present in VPNGatewayHealthReason JSON')
- if 'more_info' in _dict:
- args['more_info'] = _dict.get('more_info')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ if (user_tags := _dict.get('user_tags')) is not None:
+ args['user_tags'] = user_tags
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VPNGatewayHealthReason 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, 'code') and self.code is not None:
- _dict['code'] = self.code
- if hasattr(self, 'message') and self.message is not None:
- _dict['message'] = self.message
- if hasattr(self, 'more_info') and self.more_info is not None:
- _dict['more_info'] = self.more_info
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ if hasattr(self, 'user_tags') and self.user_tags is not None:
+ _dict['user_tags'] = self.user_tags
return _dict
def _to_dict(self):
@@ -79130,91 +82218,135 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this VPNGatewayHealthReason object."""
+ """Return a `str` version of this SnapshotPatch object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VPNGatewayHealthReason') -> 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: 'VPNGatewayHealthReason') -> bool:
+ def __ne__(self, other: 'SnapshotPatch') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class CodeEnum(str, Enum):
- """
- A snake case string succinctly identifying the reason for this health state.
- """
- CANNOT_CREATE_VPC_ROUTE = 'cannot_create_vpc_route'
- CANNOT_RESERVE_IP_ADDRESS = 'cannot_reserve_ip_address'
- INTERNAL_ERROR = 'internal_error'
+class SnapshotPrototype:
+ """
+ SnapshotPrototype.
+ :param List[SnapshotClonePrototype] clones: (optional) Clones to create for this
+ snapshot.
+ :param str name: (optional) The name for this snapshot. The name must not be
+ used by another snapshot in the region. If unspecified, the name will be a
+ hyphenated list of randomly-selected words.
+ :param ResourceGroupIdentity resource_group: (optional) The resource group to
+ use. If unspecified, the account's [default resource
+ group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be
+ used.
+ :param List[str] user_tags: (optional) The [user
+ tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with this
+ snapshot.
+ """
+ def __init__(
+ self,
+ *,
+ clones: Optional[List['SnapshotClonePrototype']] = None,
+ name: Optional[str] = None,
+ resource_group: Optional['ResourceGroupIdentity'] = None,
+ user_tags: Optional[List[str]] = None,
+ ) -> None:
+ """
+ Initialize a SnapshotPrototype object.
-class VPNGatewayLifecycleReason:
+ :param List[SnapshotClonePrototype] clones: (optional) Clones to create for
+ this snapshot.
+ :param str name: (optional) The name for this snapshot. The name must not
+ be used by another snapshot in the region. If unspecified, the name will be
+ a hyphenated list of randomly-selected words.
+ :param ResourceGroupIdentity resource_group: (optional) The resource group
+ to use. If unspecified, the account's [default resource
+ group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be
+ used.
+ :param List[str] user_tags: (optional) The [user
+ tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with
+ this snapshot.
+ """
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['SnapshotPrototypeSnapshotBySourceVolume', 'SnapshotPrototypeSnapshotBySourceSnapshot'])
+ )
+ raise Exception(msg)
+
+
+class SnapshotPrototypeSnapshotConsistencyGroupContext:
"""
- VPNGatewayLifecycleReason.
+ SnapshotPrototypeSnapshotConsistencyGroupContext.
- :attr str code: A snake case string succinctly identifying the reason for this
- lifecycle state.
- :attr str message: An explanation of the reason for this lifecycle state.
- :attr str more_info: (optional) Link to documentation about the reason for this
- lifecycle state.
+ :param str name: (optional) The name for this snapshot. The name must not be
+ used by another snapshot in the region. If unspecified, the name will be a
+ hyphenated list of randomly-selected words.
+ :param VolumeIdentity source_volume: The volume to create this snapshot from.
+ :param List[str] user_tags: (optional) The [user
+ tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with this
+ snapshot.
"""
def __init__(
self,
- code: str,
- message: str,
+ source_volume: 'VolumeIdentity',
*,
- more_info: str = None,
+ name: Optional[str] = None,
+ user_tags: Optional[List[str]] = None,
) -> None:
"""
- Initialize a VPNGatewayLifecycleReason object.
+ Initialize a SnapshotPrototypeSnapshotConsistencyGroupContext object.
- :param str code: A snake case string succinctly identifying the reason for
- this lifecycle state.
- :param str message: An explanation of the reason for this lifecycle state.
- :param str more_info: (optional) Link to documentation about the reason for
- this lifecycle state.
+ :param VolumeIdentity source_volume: The volume to create this snapshot
+ from.
+ :param str name: (optional) The name for this snapshot. The name must not
+ be used by another snapshot in the region. If unspecified, the name will be
+ a hyphenated list of randomly-selected words.
+ :param List[str] user_tags: (optional) The [user
+ tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with
+ this snapshot.
"""
- self.code = code
- self.message = message
- self.more_info = more_info
+ self.name = name
+ self.source_volume = source_volume
+ self.user_tags = user_tags
@classmethod
- def from_dict(cls, _dict: Dict) -> 'VPNGatewayLifecycleReason':
- """Initialize a VPNGatewayLifecycleReason object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'SnapshotPrototypeSnapshotConsistencyGroupContext':
+ """Initialize a SnapshotPrototypeSnapshotConsistencyGroupContext object from a json dictionary."""
args = {}
- if 'code' in _dict:
- args['code'] = _dict.get('code')
- else:
- raise ValueError('Required property \'code\' not present in VPNGatewayLifecycleReason JSON')
- if 'message' in _dict:
- args['message'] = _dict.get('message')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ if (source_volume := _dict.get('source_volume')) is not None:
+ args['source_volume'] = source_volume
else:
- raise ValueError('Required property \'message\' not present in VPNGatewayLifecycleReason JSON')
- if 'more_info' in _dict:
- args['more_info'] = _dict.get('more_info')
+ raise ValueError('Required property \'source_volume\' not present in SnapshotPrototypeSnapshotConsistencyGroupContext JSON')
+ if (user_tags := _dict.get('user_tags')) is not None:
+ args['user_tags'] = user_tags
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VPNGatewayLifecycleReason object from a json dictionary."""
+ """Initialize a SnapshotPrototypeSnapshotConsistencyGroupContext object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'code') and self.code is not None:
- _dict['code'] = self.code
- if hasattr(self, 'message') and self.message is not None:
- _dict['message'] = self.message
- if hasattr(self, 'more_info') and self.more_info is not None:
- _dict['more_info'] = self.more_info
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ if hasattr(self, 'source_volume') and self.source_volume is not None:
+ if isinstance(self.source_volume, dict):
+ _dict['source_volume'] = self.source_volume
+ else:
+ _dict['source_volume'] = self.source_volume.to_dict()
+ if hasattr(self, 'user_tags') and self.user_tags is not None:
+ _dict['user_tags'] = self.user_tags
return _dict
def _to_dict(self):
@@ -79222,201 +82354,131 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this VPNGatewayLifecycleReason object."""
+ """Return a `str` version of this SnapshotPrototypeSnapshotConsistencyGroupContext object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VPNGatewayLifecycleReason') -> bool:
+ def __eq__(self, other: 'SnapshotPrototypeSnapshotConsistencyGroupContext') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'VPNGatewayLifecycleReason') -> bool:
+ def __ne__(self, other: 'SnapshotPrototypeSnapshotConsistencyGroupContext') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class CodeEnum(str, Enum):
- """
- A snake case string succinctly identifying the reason for this lifecycle state.
- """
-
- RESOURCE_SUSPENDED_BY_PROVIDER = 'resource_suspended_by_provider'
-
-
-class VPNGatewayMember:
+class SnapshotReference:
"""
- VPNGatewayMember.
+ SnapshotReference.
- :attr List[VPNGatewayMemberHealthReason] health_reasons: The reasons for the
- current VPN gateway member health_state (if any):
- - `cannot_reserve_ip_address`: IP address exhaustion (release addresses on the
- VPN's
- subnet)
- - `internal_error`: Internal error (contact IBM support)
- The enumerated reason code values for this property will expand in the future.
- When processing this property, check for and log unknown values. Optionally halt
- processing and surface the error, or bypass the resource on which the unexpected
- reason code was encountered.
- :attr str health_state: The health of this resource.
- - `ok`: No abnormal behavior detected
- - `degraded`: Experiencing compromised performance, capacity, or connectivity
- - `faulted`: Completely unreachable, inoperative, or otherwise entirely
- incapacitated
- - `inapplicable`: The health state does not apply because of the current
- lifecycle state. A resource with a lifecycle state of `failed` or `deleting`
- will have a health state of `inapplicable`. A `pending` resource may also have
- this state.
- :attr List[VPNGatewayMemberLifecycleReason] lifecycle_reasons: The reasons for
- the current VPN gateway member lifecycle_state (if any):
- - `resource_suspended_by_provider`: The resource has been suspended (contact IBM
- support)
- The enumerated reason code values for this property will expand in the future.
- When processing this property, check for and log unknown values. Optionally halt
- processing and surface the error, or bypass the resource on which the unexpected
- reason code was encountered.
- :attr str lifecycle_state: The lifecycle state of the VPN gateway member.
- :attr ReservedIPReference private_ip: The reserved IP address assigned to the
- VPN gateway member.
- This property will be present only when the VPN gateway status is `available`.
- :attr IP public_ip: The public IP address assigned to the VPN gateway member.
- :attr str role: The high availability role assigned to the VPN gateway member.
+ :param str crn: The CRN of this snapshot.
+ :param SnapshotReferenceDeleted 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 snapshot.
+ :param str id: The unique identifier for this snapshot.
+ :param str name: The name for this snapshot. The name is unique across all
+ snapshots in the region.
+ :param SnapshotRemote remote: (optional) If present, this property indicates
+ that the resource associated with this reference
+ is remote and therefore may not be directly retrievable.
+ :param str resource_type: The resource type.
"""
def __init__(
self,
- health_reasons: List['VPNGatewayMemberHealthReason'],
- health_state: str,
- lifecycle_reasons: List['VPNGatewayMemberLifecycleReason'],
- lifecycle_state: str,
- private_ip: 'ReservedIPReference',
- public_ip: 'IP',
- role: str,
+ crn: str,
+ href: str,
+ id: str,
+ name: str,
+ resource_type: str,
+ *,
+ deleted: Optional['SnapshotReferenceDeleted'] = None,
+ remote: Optional['SnapshotRemote'] = None,
) -> None:
"""
- Initialize a VPNGatewayMember object.
+ Initialize a SnapshotReference object.
- :param List[VPNGatewayMemberHealthReason] health_reasons: The reasons for
- the current VPN gateway member health_state (if any):
- - `cannot_reserve_ip_address`: IP address exhaustion (release addresses on
- the VPN's
- subnet)
- - `internal_error`: Internal error (contact IBM support)
- The enumerated reason code values for this property will expand in the
- future. When processing this property, check for and log unknown values.
- Optionally halt processing and surface the error, or bypass the resource on
- which the unexpected reason code was encountered.
- :param str health_state: The health of this resource.
- - `ok`: No abnormal behavior detected
- - `degraded`: Experiencing compromised performance, capacity, or
- connectivity
- - `faulted`: Completely unreachable, inoperative, or otherwise entirely
- incapacitated
- - `inapplicable`: The health state does not apply because of the current
- lifecycle state. A resource with a lifecycle state of `failed` or
- `deleting` will have a health state of `inapplicable`. A `pending` resource
- may also have this state.
- :param List[VPNGatewayMemberLifecycleReason] lifecycle_reasons: The reasons
- for the current VPN gateway member lifecycle_state (if any):
- - `resource_suspended_by_provider`: The resource has been suspended
- (contact IBM
- support)
- The enumerated reason code values for this property will expand in the
- future. When processing this property, check for and log unknown values.
- Optionally halt processing and surface the error, or bypass the resource on
- which the unexpected reason code was encountered.
- :param str lifecycle_state: The lifecycle state of the VPN gateway member.
- :param ReservedIPReference private_ip: The reserved IP address assigned to
- the VPN gateway member.
- This property will be present only when the VPN gateway status is
- `available`.
- :param IP public_ip: The public IP address assigned to the VPN gateway
- member.
- :param str role: The high availability role assigned to the VPN gateway
- member.
+ :param str crn: The CRN of this snapshot.
+ :param str href: The URL for this snapshot.
+ :param str id: The unique identifier for this snapshot.
+ :param str name: The name for this snapshot. The name is unique across all
+ snapshots in the region.
+ :param str resource_type: The resource type.
+ :param SnapshotReferenceDeleted deleted: (optional) If present, this
+ property indicates the referenced resource has been deleted, and provides
+ some supplementary information.
+ :param SnapshotRemote remote: (optional) If present, this property
+ indicates that the resource associated with this reference
+ is remote and therefore may not be directly retrievable.
"""
- self.health_reasons = health_reasons
- self.health_state = health_state
- self.lifecycle_reasons = lifecycle_reasons
- self.lifecycle_state = lifecycle_state
- self.private_ip = private_ip
- self.public_ip = public_ip
- self.role = role
+ self.crn = crn
+ self.deleted = deleted
+ self.href = href
+ self.id = id
+ self.name = name
+ self.remote = remote
+ self.resource_type = resource_type
@classmethod
- def from_dict(cls, _dict: Dict) -> 'VPNGatewayMember':
- """Initialize a VPNGatewayMember object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'SnapshotReference':
+ """Initialize a SnapshotReference object from a json dictionary."""
args = {}
- if 'health_reasons' in _dict:
- args['health_reasons'] = [VPNGatewayMemberHealthReason.from_dict(v) for v in _dict.get('health_reasons')]
- else:
- raise ValueError('Required property \'health_reasons\' not present in VPNGatewayMember JSON')
- if 'health_state' in _dict:
- args['health_state'] = _dict.get('health_state')
- else:
- raise ValueError('Required property \'health_state\' not present in VPNGatewayMember JSON')
- if 'lifecycle_reasons' in _dict:
- args['lifecycle_reasons'] = [VPNGatewayMemberLifecycleReason.from_dict(v) for v in _dict.get('lifecycle_reasons')]
+ if (crn := _dict.get('crn')) is not None:
+ args['crn'] = crn
else:
- raise ValueError('Required property \'lifecycle_reasons\' not present in VPNGatewayMember JSON')
- if 'lifecycle_state' in _dict:
- args['lifecycle_state'] = _dict.get('lifecycle_state')
+ raise ValueError('Required property \'crn\' not present in SnapshotReference JSON')
+ if (deleted := _dict.get('deleted')) is not None:
+ args['deleted'] = SnapshotReferenceDeleted.from_dict(deleted)
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'lifecycle_state\' not present in VPNGatewayMember JSON')
- if 'private_ip' in _dict:
- args['private_ip'] = ReservedIPReference.from_dict(_dict.get('private_ip'))
+ raise ValueError('Required property \'href\' not present in SnapshotReference JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
else:
- raise ValueError('Required property \'private_ip\' not present in VPNGatewayMember JSON')
- if 'public_ip' in _dict:
- args['public_ip'] = IP.from_dict(_dict.get('public_ip'))
+ raise ValueError('Required property \'id\' not present in SnapshotReference JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
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 \'name\' not present in SnapshotReference JSON')
+ if (remote := _dict.get('remote')) is not None:
+ args['remote'] = SnapshotRemote.from_dict(remote)
+ if (resource_type := _dict.get('resource_type')) is not None:
+ args['resource_type'] = resource_type
else:
- raise ValueError('Required property \'role\' not present in VPNGatewayMember JSON')
+ raise ValueError('Required property \'resource_type\' not present in SnapshotReference JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VPNGatewayMember 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, 'health_reasons') and self.health_reasons is not None:
- health_reasons_list = []
- for v in self.health_reasons:
- if isinstance(v, dict):
- health_reasons_list.append(v)
- else:
- health_reasons_list.append(v.to_dict())
- _dict['health_reasons'] = health_reasons_list
- if hasattr(self, 'health_state') and self.health_state is not None:
- _dict['health_state'] = self.health_state
- if hasattr(self, 'lifecycle_reasons') and self.lifecycle_reasons is not None:
- lifecycle_reasons_list = []
- for v in self.lifecycle_reasons:
- if isinstance(v, dict):
- lifecycle_reasons_list.append(v)
- else:
- lifecycle_reasons_list.append(v.to_dict())
- _dict['lifecycle_reasons'] = lifecycle_reasons_list
- if hasattr(self, 'lifecycle_state') and self.lifecycle_state is not None:
- _dict['lifecycle_state'] = self.lifecycle_state
- if hasattr(self, 'private_ip') and self.private_ip is not None:
- if isinstance(self.private_ip, dict):
- _dict['private_ip'] = self.private_ip
+ if hasattr(self, 'crn') and self.crn is not None:
+ _dict['crn'] = self.crn
+ if hasattr(self, 'deleted') and self.deleted is not None:
+ if isinstance(self.deleted, dict):
+ _dict['deleted'] = self.deleted
else:
- _dict['private_ip'] = self.private_ip.to_dict()
- if hasattr(self, 'public_ip') and self.public_ip is not None:
- if isinstance(self.public_ip, dict):
- _dict['public_ip'] = self.public_ip
+ _dict['deleted'] = self.deleted.to_dict()
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
+ if hasattr(self, 'id') and self.id is not None:
+ _dict['id'] = self.id
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ if hasattr(self, 'remote') and self.remote is not None:
+ if isinstance(self.remote, dict):
+ _dict['remote'] = self.remote
else:
- _dict['public_ip'] = self.public_ip.to_dict()
- if hasattr(self, 'role') and self.role is not None:
- _dict['role'] = self.role
+ _dict['remote'] = self.remote.to_dict()
+ if hasattr(self, 'resource_type') and self.resource_type is not None:
+ _dict['resource_type'] = self.resource_type
return _dict
def _to_dict(self):
@@ -79424,120 +82486,65 @@ 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 SnapshotReference object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VPNGatewayMember') -> 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: 'VPNGatewayMember') -> bool:
+ def __ne__(self, other: 'SnapshotReference') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class HealthStateEnum(str, Enum):
- """
- The health of this resource.
- - `ok`: No abnormal behavior detected
- - `degraded`: Experiencing compromised performance, capacity, or connectivity
- - `faulted`: Completely unreachable, inoperative, or otherwise entirely
- incapacitated
- - `inapplicable`: The health state does not apply because of the current lifecycle
- state. A resource with a lifecycle state of `failed` or `deleting` will have a
- health state of `inapplicable`. A `pending` resource may also have this state.
- """
-
- DEGRADED = 'degraded'
- FAULTED = 'faulted'
- INAPPLICABLE = 'inapplicable'
- OK = 'ok'
-
-
- class LifecycleStateEnum(str, Enum):
- """
- The lifecycle state of the VPN gateway member.
- """
-
- DELETING = 'deleting'
- FAILED = 'failed'
- PENDING = 'pending'
- STABLE = 'stable'
- SUSPENDED = 'suspended'
- UPDATING = 'updating'
- WAITING = 'waiting'
-
-
- class RoleEnum(str, Enum):
+ class ResourceTypeEnum(str, Enum):
"""
- The high availability role assigned to the VPN gateway member.
+ The resource type.
"""
- ACTIVE = 'active'
- STANDBY = 'standby'
+ SNAPSHOT = 'snapshot'
-class VPNGatewayMemberHealthReason:
+class SnapshotReferenceDeleted:
"""
- VPNGatewayMemberHealthReason.
+ If present, this property indicates the referenced resource has been deleted, and
+ provides some supplementary information.
- :attr str code: A snake case string succinctly identifying the reason for this
- health state.
- :attr str message: An explanation of the reason for this health state.
- :attr str more_info: (optional) Link to documentation about the reason for this
- health state.
+ :param str more_info: Link to documentation about deleted resources.
"""
def __init__(
self,
- code: str,
- message: str,
- *,
- more_info: str = None,
+ more_info: str,
) -> None:
"""
- Initialize a VPNGatewayMemberHealthReason object.
+ Initialize a SnapshotReferenceDeleted object.
- :param str code: A snake case string succinctly identifying the reason for
- this health state.
- :param str message: An explanation of the reason for this health state.
- :param str more_info: (optional) Link to documentation about the reason for
- this health state.
+ :param str more_info: Link to documentation about deleted resources.
"""
- self.code = code
- self.message = message
self.more_info = more_info
@classmethod
- def from_dict(cls, _dict: Dict) -> 'VPNGatewayMemberHealthReason':
- """Initialize a VPNGatewayMemberHealthReason object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'SnapshotReferenceDeleted':
+ """Initialize a SnapshotReferenceDeleted object from a json dictionary."""
args = {}
- if 'code' in _dict:
- args['code'] = _dict.get('code')
- else:
- raise ValueError('Required property \'code\' not present in VPNGatewayMemberHealthReason JSON')
- if 'message' in _dict:
- args['message'] = _dict.get('message')
+ if (more_info := _dict.get('more_info')) is not None:
+ args['more_info'] = more_info
else:
- raise ValueError('Required property \'message\' not present in VPNGatewayMemberHealthReason JSON')
- if 'more_info' in _dict:
- args['more_info'] = _dict.get('more_info')
+ raise ValueError('Required property \'more_info\' not present in SnapshotReferenceDeleted JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VPNGatewayMemberHealthReason object from a json dictionary."""
+ """Initialize a SnapshotReferenceDeleted object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, '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
@@ -79547,90 +82554,65 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this VPNGatewayMemberHealthReason object."""
+ """Return a `str` version of this SnapshotReferenceDeleted object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VPNGatewayMemberHealthReason') -> 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: 'VPNGatewayMemberHealthReason') -> bool:
+ def __ne__(self, other: 'SnapshotReferenceDeleted') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class CodeEnum(str, Enum):
- """
- A snake case string succinctly identifying the reason for this health state.
- """
-
- CANNOT_RESERVE_IP_ADDRESS = 'cannot_reserve_ip_address'
- INTERNAL_ERROR = 'internal_error'
-
-
-class VPNGatewayMemberLifecycleReason:
+class SnapshotRemote:
"""
- VPNGatewayMemberLifecycleReason.
+ If present, this property indicates that the resource associated with this reference
+ is remote and therefore may not be directly retrievable.
- :attr str code: A snake case string succinctly identifying the reason for this
- lifecycle state.
- :attr str message: An explanation of the reason for this lifecycle state.
- :attr str more_info: (optional) Link to documentation about the reason for this
- lifecycle state.
+ :param RegionReference region: (optional) If present, this property indicates
+ that the referenced resource is remote to this
+ region, and identifies the native region.
"""
def __init__(
self,
- code: str,
- message: str,
*,
- more_info: str = None,
+ region: Optional['RegionReference'] = None,
) -> None:
"""
- Initialize a VPNGatewayMemberLifecycleReason object.
+ Initialize a SnapshotRemote object.
- :param str code: A snake case string succinctly identifying the reason for
- this lifecycle state.
- :param str message: An explanation of the reason for this lifecycle state.
- :param str more_info: (optional) Link to documentation about the reason for
- this lifecycle state.
+ :param RegionReference region: (optional) If present, this property
+ indicates that the referenced resource is remote to this
+ region, and identifies the native region.
"""
- self.code = code
- self.message = message
- self.more_info = more_info
+ self.region = region
@classmethod
- def from_dict(cls, _dict: Dict) -> 'VPNGatewayMemberLifecycleReason':
- """Initialize a VPNGatewayMemberLifecycleReason object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'SnapshotRemote':
+ """Initialize a SnapshotRemote object from a json dictionary."""
args = {}
- if 'code' in _dict:
- args['code'] = _dict.get('code')
- else:
- raise ValueError('Required property \'code\' not present in VPNGatewayMemberLifecycleReason JSON')
- if 'message' in _dict:
- args['message'] = _dict.get('message')
- else:
- raise ValueError('Required property \'message\' not present in VPNGatewayMemberLifecycleReason JSON')
- if 'more_info' in _dict:
- args['more_info'] = _dict.get('more_info')
+ if (region := _dict.get('region')) is not None:
+ args['region'] = RegionReference.from_dict(region)
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VPNGatewayMemberLifecycleReason object from a json dictionary."""
+ """Initialize a SnapshotRemote object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, '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, 'region') and self.region is not None:
+ if isinstance(self.region, dict):
+ _dict['region'] = self.region
+ else:
+ _dict['region'] = self.region.to_dict()
return _dict
def _to_dict(self):
@@ -79638,67 +82620,131 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this VPNGatewayMemberLifecycleReason object."""
+ """Return a `str` version of this SnapshotRemote object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VPNGatewayMemberLifecycleReason') -> bool:
+ def __eq__(self, other: 'SnapshotRemote') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'VPNGatewayMemberLifecycleReason') -> bool:
+ def __ne__(self, other: 'SnapshotRemote') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class CodeEnum(str, Enum):
- """
- A snake case string succinctly identifying the reason for this lifecycle state.
- """
-
- RESOURCE_SUSPENDED_BY_PROVIDER = 'resource_suspended_by_provider'
-
-
-class VPNGatewayPatch:
+class SnapshotSourceSnapshot:
"""
- VPNGatewayPatch.
+ If present, the source snapshot this snapshot was created from.
- :attr str name: (optional) The name for this VPN gateway. The name must not be
- used by another VPN gateway in the VPC.
+ :param str crn: The CRN of the source snapshot.
+ :param SnapshotReferenceDeleted deleted: (optional) If present, this property
+ indicates the referenced resource has been deleted, and provides
+ some supplementary information.
+ :param str href: The URL for the source snapshot.
+ :param str id: The unique identifier for the source snapshot.
+ :param str name: The name for the source snapshot. The name is unique across all
+ snapshots in the source snapshot's native region.
+ :param SnapshotRemote remote: (optional) If present, this property indicates
+ that the resource associated with this reference
+ is remote and therefore may not be directly retrievable.
+ :param str resource_type: The resource type.
"""
def __init__(
self,
+ crn: str,
+ href: str,
+ id: str,
+ name: str,
+ resource_type: str,
*,
- name: str = None,
+ deleted: Optional['SnapshotReferenceDeleted'] = None,
+ remote: Optional['SnapshotRemote'] = None,
) -> None:
"""
- Initialize a VPNGatewayPatch object.
+ Initialize a SnapshotSourceSnapshot object.
- :param str name: (optional) The name for this VPN gateway. The name must
- not be used by another VPN gateway in the VPC.
+ :param str crn: The CRN of the source snapshot.
+ :param str href: The URL for the source snapshot.
+ :param str id: The unique identifier for the source snapshot.
+ :param str name: The name for the source snapshot. The name is unique
+ across all snapshots in the source snapshot's native region.
+ :param str resource_type: The resource type.
+ :param SnapshotReferenceDeleted deleted: (optional) If present, this
+ property indicates the referenced resource has been deleted, and provides
+ some supplementary information.
+ :param SnapshotRemote remote: (optional) If present, this property
+ indicates that the resource associated with this reference
+ is remote and therefore may not be directly retrievable.
"""
+ self.crn = crn
+ self.deleted = deleted
+ self.href = href
+ self.id = id
self.name = name
+ self.remote = remote
+ self.resource_type = resource_type
@classmethod
- def from_dict(cls, _dict: Dict) -> 'VPNGatewayPatch':
- """Initialize a VPNGatewayPatch object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'SnapshotSourceSnapshot':
+ """Initialize a SnapshotSourceSnapshot object from a json dictionary."""
args = {}
- if 'name' in _dict:
- args['name'] = _dict.get('name')
+ if (crn := _dict.get('crn')) is not None:
+ args['crn'] = crn
+ else:
+ raise ValueError('Required property \'crn\' not present in SnapshotSourceSnapshot JSON')
+ if (deleted := _dict.get('deleted')) is not None:
+ args['deleted'] = SnapshotReferenceDeleted.from_dict(deleted)
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
+ else:
+ raise ValueError('Required property \'href\' not present in SnapshotSourceSnapshot JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
+ else:
+ raise ValueError('Required property \'id\' not present in SnapshotSourceSnapshot JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ else:
+ raise ValueError('Required property \'name\' not present in SnapshotSourceSnapshot JSON')
+ if (remote := _dict.get('remote')) is not None:
+ args['remote'] = SnapshotRemote.from_dict(remote)
+ if (resource_type := _dict.get('resource_type')) is not None:
+ args['resource_type'] = resource_type
+ else:
+ raise ValueError('Required property \'resource_type\' not present in SnapshotSourceSnapshot JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VPNGatewayPatch object from a json dictionary."""
+ """Initialize a SnapshotSourceSnapshot object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
+ if hasattr(self, 'crn') and self.crn is not None:
+ _dict['crn'] = self.crn
+ if hasattr(self, 'deleted') and self.deleted is not None:
+ if isinstance(self.deleted, dict):
+ _dict['deleted'] = self.deleted
+ else:
+ _dict['deleted'] = self.deleted.to_dict()
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
+ if hasattr(self, 'id') and self.id is not None:
+ _dict['id'] = self.id
if hasattr(self, 'name') and self.name is not None:
_dict['name'] = self.name
+ if hasattr(self, 'remote') and self.remote is not None:
+ if isinstance(self.remote, dict):
+ _dict['remote'] = self.remote
+ else:
+ _dict['remote'] = self.remote.to_dict()
+ if hasattr(self, 'resource_type') and self.resource_type is not None:
+ _dict['resource_type'] = self.resource_type
return _dict
def _to_dict(self):
@@ -79706,542 +82752,238 @@ 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 SnapshotSourceSnapshot object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VPNGatewayPatch') -> bool:
+ def __eq__(self, other: 'SnapshotSourceSnapshot') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'VPNGatewayPatch') -> bool:
+ def __ne__(self, other: 'SnapshotSourceSnapshot') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-
-class VPNGatewayPrototype:
- """
- VPNGatewayPrototype.
-
- :attr str name: (optional) The name for this VPN gateway. The name must not be
- used by another VPN gateway in the VPC. If unspecified, the name will be a
- hyphenated list of randomly-selected words.
- :attr ResourceGroupIdentity resource_group: (optional) The resource group to
- use. If unspecified, the account's [default resource
- group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be
- used.
- :attr SubnetIdentity subnet: Identifies a subnet by a unique property.
- """
-
- def __init__(
- self,
- subnet: 'SubnetIdentity',
- *,
- name: str = None,
- resource_group: 'ResourceGroupIdentity' = None,
- ) -> None:
- """
- Initialize a VPNGatewayPrototype object.
-
- :param SubnetIdentity subnet: Identifies a subnet by a unique property.
- :param str name: (optional) The name for this VPN gateway. The name must
- not be used by another VPN gateway in the VPC. If unspecified, the name
- will be a hyphenated list of randomly-selected words.
- :param ResourceGroupIdentity resource_group: (optional) The resource group
- to use. If unspecified, the account's [default resource
- group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be
- used.
- """
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['VPNGatewayPrototypeVPNGatewayRouteModePrototype', 'VPNGatewayPrototypeVPNGatewayPolicyModePrototype'])
- )
- raise Exception(msg)
-
-
-class VPNGatewayReferenceDeleted:
- """
- If present, this property indicates the referenced resource has been deleted, and
- provides some supplementary information.
-
- :attr str more_info: Link to documentation about deleted resources.
- """
-
- def __init__(
- self,
- more_info: str,
- ) -> None:
+ class ResourceTypeEnum(str, Enum):
"""
- Initialize a VPNGatewayReferenceDeleted object.
-
- :param str more_info: Link to documentation about deleted resources.
+ The resource type.
"""
- self.more_info = more_info
-
- @classmethod
- def from_dict(cls, _dict: Dict) -> 'VPNGatewayReferenceDeleted':
- """Initialize a VPNGatewayReferenceDeleted object from a json dictionary."""
- args = {}
- if 'more_info' in _dict:
- args['more_info'] = _dict.get('more_info')
- else:
- raise ValueError('Required property \'more_info\' not present in VPNGatewayReferenceDeleted JSON')
- return cls(**args)
-
- @classmethod
- def _from_dict(cls, _dict):
- """Initialize a VPNGatewayReferenceDeleted object from a json dictionary."""
- return cls.from_dict(_dict)
-
- def to_dict(self) -> Dict:
- """Return a json dictionary representing this model."""
- _dict = {}
- if hasattr(self, 'more_info') and self.more_info is not None:
- _dict['more_info'] = self.more_info
- return _dict
-
- def _to_dict(self):
- """Return a json dictionary representing this model."""
- return self.to_dict()
-
- def __str__(self) -> str:
- """Return a `str` version of this VPNGatewayReferenceDeleted object."""
- return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VPNGatewayReferenceDeleted') -> bool:
- """Return `true` when self and other are equal, false otherwise."""
- if not isinstance(other, self.__class__):
- return False
- return self.__dict__ == other.__dict__
+ SNAPSHOT = 'snapshot'
- def __ne__(self, other: 'VPNGatewayReferenceDeleted') -> bool:
- """Return `true` when self and other are not equal, false otherwise."""
- return not self == other
-class VPNServer:
+class Subnet:
"""
- VPNServer.
+ Subnet.
- :attr CertificateInstanceReference certificate: The certificate instance for
- this VPN server.
- :attr List[VPNServerAuthentication] client_authentication: The methods used to
- authenticate VPN clients to this VPN server. VPN clients must authenticate
- against all specified methods.
- :attr bool client_auto_delete: Indicates whether disconnected VPN clients will
- be automatically deleted after
- `client_auto_delete_timeout` hours have passed. At present, this is always
- `true`, but may be modifiable in the future.
- :attr int client_auto_delete_timeout: If `client_auto_delete` is `true`, the
- hours after which disconnected VPN clients will be automatically deleted. If the
- value is `0`, disconnected VPN clients will be deleted immediately. This value
- may be modifiable in the future.
- :attr List[IP] client_dns_server_ips: The DNS server addresses that will be
- provided to VPN clients that are connected to this VPN server.
- :attr int client_idle_timeout: The seconds a VPN client can be idle before this
- VPN server will disconnect it. If `0`, the server will not disconnect idle
- clients.
- :attr str client_ip_pool: The VPN client IPv4 address pool, expressed in CIDR
+ :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.
- :attr datetime created_at: The date and time that the VPN server was created.
- :attr str crn: The CRN for this VPN server.
- :attr bool enable_split_tunneling: Indicates whether the split tunneling is
- enabled on this VPN server.
- :attr List[VPNServerHealthReason] health_reasons: The reasons for the current
- VPN server health_state (if any):
- - `cannot_access_client_certificate`: VPN server's client certificate is
- inaccessible
- (verify certificate exists and that IAM policies grant `VPN server for VPC`
- access to
- `Secrets Manager`)
- - `cannot_access_server_certificate`: VPN server's server certificate is
- inaccessible
- (verify certificate exists and that IAM policies grant `VPN server for VPC`
- access to
- `Secrets Manager`)
- - `cannot_create_vpc_route`: VPN cannot create route (check for conflict)
- - `cannot_reserve_ip_address`: IP address exhaustion (release addresses on the
- VPN's
- subnet)
- - `internal_error`: Internal error (contact IBM support)
- The enumerated reason code values for this property will expand in the future.
- When processing this property, check for and log unknown values. Optionally halt
- processing and surface the error, or bypass the resource on which the unexpected
- reason code was encountered.
- :attr str health_state: The health of this resource.
- - `ok`: No abnormal behavior detected
- - `degraded`: Experiencing compromised performance, capacity, or connectivity
- - `faulted`: Completely unreachable, inoperative, or otherwise entirely
- incapacitated
- - `inapplicable`: The health state does not apply because of the current
- lifecycle state. A resource with a lifecycle state of `failed` or `deleting`
- will have a health state of `inapplicable`. A `pending` resource may also have
- this state.
- :attr str hostname: Fully qualified domain name assigned to this VPN server.
- :attr str href: The URL for this VPN server.
- :attr str id: The unique identifier for this VPN server.
- :attr List[VPNServerLifecycleReason] lifecycle_reasons: The reasons for the
- current VPN server lifecycle_state (if any):
- - `resource_suspended_by_provider`: The resource has been suspended (contact IBM
- support)
- The enumerated reason code values for this property will expand in the future.
- When processing this property, check for and log unknown values. Optionally halt
- processing and surface the error, or bypass the resource on which the unexpected
- reason code was encountered.
- :attr str lifecycle_state: The lifecycle state of the VPN server.
- :attr str name: The name for this VPN server. The name is unique across all VPN
- servers in the VPC.
- :attr int port: The port number used by this VPN server.
- :attr List[ReservedIPReference] private_ips: The reserved IPs bound to this VPN
- server.
- :attr str protocol: The transport protocol used by this VPN server.
- :attr ResourceGroupReference resource_group: The resource group for this VPN
- server.
- :attr str resource_type: The resource type.
- :attr List[SecurityGroupReference] security_groups: The security groups
- targeting this VPN server.
- :attr List[SubnetReference] subnets: The subnets this VPN server is provisioned
- in.
- :attr VPCReference vpc: The VPC this VPN server resides in.
+ :param str name: The name for this subnet. The name is unique across all subnets
+ in the VPC.
+ :param NetworkACLReference network_acl: The network ACL for this subnet.
+ :param PublicGatewayReference public_gateway: (optional) The public gateway to
+ use for internet-bound traffic for this subnet.
+ :param ResourceGroupReference resource_group: The resource group for this
+ subnet.
+ :param str resource_type: The resource type.
+ :param RoutingTableReference routing_table: The routing table for this subnet.
+ :param str status: The status of the subnet.
+ :param int total_ipv4_address_count: The total number of IPv4 addresses in this
+ subnet.
+ Note: This is calculated as 2(32 - prefix length). For example, the
+ prefix length `/24` gives:
2(32 - 24) = 28 = 256
+ addresses.
+ :param VPCReference vpc: The VPC this subnet resides in.
+ :param ZoneReference zone: The zone this subnet resides in.
"""
def __init__(
self,
- certificate: 'CertificateInstanceReference',
- client_authentication: List['VPNServerAuthentication'],
- client_auto_delete: bool,
- client_auto_delete_timeout: int,
- client_dns_server_ips: List['IP'],
- client_idle_timeout: int,
- client_ip_pool: str,
+ available_ipv4_address_count: int,
created_at: datetime,
crn: str,
- enable_split_tunneling: bool,
- health_reasons: List['VPNServerHealthReason'],
- health_state: str,
- hostname: str,
href: str,
id: str,
- lifecycle_reasons: List['VPNServerLifecycleReason'],
- lifecycle_state: str,
+ ip_version: str,
+ ipv4_cidr_block: str,
name: str,
- port: int,
- private_ips: List['ReservedIPReference'],
- protocol: str,
+ network_acl: 'NetworkACLReference',
resource_group: 'ResourceGroupReference',
resource_type: str,
- security_groups: List['SecurityGroupReference'],
- subnets: List['SubnetReference'],
+ routing_table: 'RoutingTableReference',
+ status: str,
+ total_ipv4_address_count: int,
vpc: 'VPCReference',
+ zone: 'ZoneReference',
+ *,
+ public_gateway: Optional['PublicGatewayReference'] = None,
) -> None:
"""
- Initialize a VPNServer object.
+ Initialize a Subnet object.
- :param CertificateInstanceReference certificate: The certificate instance
- for this VPN server.
- :param List[VPNServerAuthentication] client_authentication: The methods
- used to authenticate VPN clients to this VPN server. VPN clients must
- authenticate against all specified methods.
- :param bool client_auto_delete: Indicates whether disconnected VPN clients
- will be automatically deleted after
- `client_auto_delete_timeout` hours have passed. At present, this is always
- `true`, but may be modifiable in the future.
- :param int client_auto_delete_timeout: If `client_auto_delete` is `true`,
- the hours after which disconnected VPN clients will be automatically
- deleted. If the value is `0`, disconnected VPN clients will be deleted
- immediately. This value may be modifiable in the future.
- :param List[IP] client_dns_server_ips: The DNS server addresses that will
- be provided to VPN clients that are connected to this VPN server.
- :param int client_idle_timeout: The seconds a VPN client can be idle before
- this VPN server will disconnect it. If `0`, the server will not disconnect
- idle clients.
- :param str client_ip_pool: The VPN client IPv4 address pool, expressed in
- CIDR format.
- :param datetime created_at: The date and time that the VPN server was
- created.
- :param str crn: The CRN for this VPN server.
- :param bool enable_split_tunneling: Indicates whether the split tunneling
- is enabled on this VPN server.
- :param List[VPNServerHealthReason] health_reasons: The reasons for the
- current VPN server health_state (if any):
- - `cannot_access_client_certificate`: VPN server's client certificate is
- inaccessible
- (verify certificate exists and that IAM policies grant `VPN server for
- VPC` access to
- `Secrets Manager`)
- - `cannot_access_server_certificate`: VPN server's server certificate is
- inaccessible
- (verify certificate exists and that IAM policies grant `VPN server for
- VPC` access to
- `Secrets Manager`)
- - `cannot_create_vpc_route`: VPN cannot create route (check for conflict)
- - `cannot_reserve_ip_address`: IP address exhaustion (release addresses on
- the VPN's
- subnet)
- - `internal_error`: Internal error (contact IBM support)
- The enumerated reason code values for this property will expand in the
- future. When processing this property, check for and log unknown values.
- Optionally halt processing and surface the error, or bypass the resource on
- which the unexpected reason code was encountered.
- :param str health_state: The health of this resource.
- - `ok`: No abnormal behavior detected
- - `degraded`: Experiencing compromised performance, capacity, or
- connectivity
- - `faulted`: Completely unreachable, inoperative, or otherwise entirely
- incapacitated
- - `inapplicable`: The health state does not apply because of the current
- lifecycle state. A resource with a lifecycle state of `failed` or
- `deleting` will have a health state of `inapplicable`. A `pending` resource
- may also have this state.
- :param str hostname: Fully qualified domain name assigned to this VPN
- server.
- :param str href: The URL for this VPN server.
- :param str id: The unique identifier for this VPN server.
- :param List[VPNServerLifecycleReason] lifecycle_reasons: The reasons for
- the current VPN server lifecycle_state (if any):
- - `resource_suspended_by_provider`: The resource has been suspended
- (contact IBM
- support)
- The enumerated reason code values for this property will expand in the
- future. When processing this property, check for and log unknown values.
- Optionally halt processing and surface the error, or bypass the resource on
- which the unexpected reason code was encountered.
- :param str lifecycle_state: The lifecycle state of the VPN server.
- :param str name: The name for this VPN server. The name is unique across
- all VPN servers in the VPC.
- :param int port: The port number used by this VPN server.
- :param List[ReservedIPReference] private_ips: The reserved IPs bound to
- this VPN server.
- :param str protocol: The transport protocol used by this VPN server.
+ :param int available_ipv4_address_count: The number of IPv4 addresses in
+ this subnet that are not in-use, and have not been reserved by the user or
+ the provider.
+ :param datetime created_at: The date and time that the subnet was created.
+ :param str crn: The CRN for this subnet.
+ :param str href: The URL for this subnet.
+ :param str id: The unique identifier for this subnet.
+ :param str ip_version: The IP version(s) supported by this subnet.
+ :param str ipv4_cidr_block: The IPv4 range of the subnet, expressed in CIDR
+ format.
+ :param str name: The name for this subnet. The name is unique across all
+ subnets in the VPC.
+ :param NetworkACLReference network_acl: The network ACL for this subnet.
:param ResourceGroupReference resource_group: The resource group for this
- VPN server.
+ subnet.
:param str resource_type: The resource type.
- :param List[SecurityGroupReference] security_groups: The security groups
- targeting this VPN server.
- :param List[SubnetReference] subnets: The subnets this VPN server is
- provisioned in.
- :param VPCReference vpc: The VPC this VPN server resides in.
+ :param RoutingTableReference routing_table: The routing table for this
+ subnet.
+ :param str status: The status of the subnet.
+ :param int total_ipv4_address_count: The total number of IPv4 addresses in
+ this subnet.
+ Note: This is calculated as 2(32 - prefix length). For example,
+ the prefix length `/24` gives:
2(32 - 24) = 28 =
+ 256 addresses.
+ :param VPCReference vpc: The VPC this subnet resides in.
+ :param ZoneReference zone: The zone this subnet resides in.
+ :param PublicGatewayReference public_gateway: (optional) The public gateway
+ to use for internet-bound traffic for this subnet.
"""
- self.certificate = certificate
- self.client_authentication = client_authentication
- self.client_auto_delete = client_auto_delete
- self.client_auto_delete_timeout = client_auto_delete_timeout
- self.client_dns_server_ips = client_dns_server_ips
- self.client_idle_timeout = client_idle_timeout
- self.client_ip_pool = client_ip_pool
+ self.available_ipv4_address_count = available_ipv4_address_count
self.created_at = created_at
self.crn = crn
- self.enable_split_tunneling = enable_split_tunneling
- self.health_reasons = health_reasons
- self.health_state = health_state
- self.hostname = hostname
self.href = href
self.id = id
- self.lifecycle_reasons = lifecycle_reasons
- self.lifecycle_state = lifecycle_state
+ self.ip_version = ip_version
+ self.ipv4_cidr_block = ipv4_cidr_block
self.name = name
- self.port = port
- self.private_ips = private_ips
- self.protocol = protocol
+ self.network_acl = network_acl
+ self.public_gateway = public_gateway
self.resource_group = resource_group
self.resource_type = resource_type
- self.security_groups = security_groups
- self.subnets = subnets
+ 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) -> 'VPNServer':
- """Initialize a VPNServer object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'Subnet':
+ """Initialize a Subnet object from a json dictionary."""
args = {}
- if 'certificate' in _dict:
- args['certificate'] = CertificateInstanceReference.from_dict(_dict.get('certificate'))
+ if (available_ipv4_address_count := _dict.get('available_ipv4_address_count')) is not None:
+ args['available_ipv4_address_count'] = available_ipv4_address_count
else:
- raise ValueError('Required property \'certificate\' not present in VPNServer JSON')
- if 'client_authentication' in _dict:
- args['client_authentication'] = _dict.get('client_authentication')
- else:
- raise ValueError('Required property \'client_authentication\' not present in VPNServer JSON')
- if 'client_auto_delete' in _dict:
- args['client_auto_delete'] = _dict.get('client_auto_delete')
- else:
- raise ValueError('Required property \'client_auto_delete\' not present in VPNServer JSON')
- if 'client_auto_delete_timeout' in _dict:
- args['client_auto_delete_timeout'] = _dict.get('client_auto_delete_timeout')
- else:
- raise ValueError('Required property \'client_auto_delete_timeout\' not present in VPNServer JSON')
- if 'client_dns_server_ips' in _dict:
- args['client_dns_server_ips'] = [IP.from_dict(v) for v in _dict.get('client_dns_server_ips')]
- else:
- raise ValueError('Required property \'client_dns_server_ips\' not present in VPNServer JSON')
- if 'client_idle_timeout' in _dict:
- args['client_idle_timeout'] = _dict.get('client_idle_timeout')
- else:
- raise ValueError('Required property \'client_idle_timeout\' not present in VPNServer JSON')
- if 'client_ip_pool' in _dict:
- args['client_ip_pool'] = _dict.get('client_ip_pool')
- else:
- raise ValueError('Required property \'client_ip_pool\' not present in VPNServer JSON')
- if 'created_at' in _dict:
- args['created_at'] = string_to_datetime(_dict.get('created_at'))
- else:
- raise ValueError('Required property \'created_at\' not present in VPNServer JSON')
- if 'crn' in _dict:
- args['crn'] = _dict.get('crn')
- else:
- raise ValueError('Required property \'crn\' not present in VPNServer JSON')
- if 'enable_split_tunneling' in _dict:
- args['enable_split_tunneling'] = _dict.get('enable_split_tunneling')
- else:
- raise ValueError('Required property \'enable_split_tunneling\' not present in VPNServer JSON')
- if 'health_reasons' in _dict:
- args['health_reasons'] = [VPNServerHealthReason.from_dict(v) for v in _dict.get('health_reasons')]
- else:
- raise ValueError('Required property \'health_reasons\' not present in VPNServer JSON')
- if 'health_state' in _dict:
- args['health_state'] = _dict.get('health_state')
+ raise ValueError('Required property \'available_ipv4_address_count\' not present in Subnet JSON')
+ if (created_at := _dict.get('created_at')) is not None:
+ args['created_at'] = string_to_datetime(created_at)
else:
- raise ValueError('Required property \'health_state\' not present in VPNServer JSON')
- if 'hostname' in _dict:
- args['hostname'] = _dict.get('hostname')
+ raise ValueError('Required property \'created_at\' not present in Subnet JSON')
+ if (crn := _dict.get('crn')) is not None:
+ args['crn'] = crn
else:
- raise ValueError('Required property \'hostname\' not present in VPNServer JSON')
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ raise ValueError('Required property \'crn\' not present in Subnet JSON')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'href\' not present in VPNServer JSON')
- if 'id' in _dict:
- args['id'] = _dict.get('id')
+ raise ValueError('Required property \'href\' not present in Subnet JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
else:
- raise ValueError('Required property \'id\' not present in VPNServer JSON')
- if 'lifecycle_reasons' in _dict:
- args['lifecycle_reasons'] = [VPNServerLifecycleReason.from_dict(v) for v in _dict.get('lifecycle_reasons')]
+ raise ValueError('Required property \'id\' not present in Subnet JSON')
+ if (ip_version := _dict.get('ip_version')) is not None:
+ args['ip_version'] = ip_version
else:
- raise ValueError('Required property \'lifecycle_reasons\' not present in VPNServer JSON')
- if 'lifecycle_state' in _dict:
- args['lifecycle_state'] = _dict.get('lifecycle_state')
+ raise ValueError('Required property \'ip_version\' not present in Subnet JSON')
+ if (ipv4_cidr_block := _dict.get('ipv4_cidr_block')) is not None:
+ args['ipv4_cidr_block'] = ipv4_cidr_block
else:
- raise ValueError('Required property \'lifecycle_state\' not present in VPNServer JSON')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
+ raise ValueError('Required property \'ipv4_cidr_block\' not present in Subnet JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
else:
- raise ValueError('Required property \'name\' not present in VPNServer JSON')
- if 'port' in _dict:
- args['port'] = _dict.get('port')
+ raise ValueError('Required property \'name\' not present in Subnet JSON')
+ if (network_acl := _dict.get('network_acl')) is not None:
+ args['network_acl'] = NetworkACLReference.from_dict(network_acl)
else:
- raise ValueError('Required property \'port\' not present in VPNServer JSON')
- if 'private_ips' in _dict:
- args['private_ips'] = [ReservedIPReference.from_dict(v) for v in _dict.get('private_ips')]
+ raise ValueError('Required property \'network_acl\' not present in Subnet JSON')
+ if (public_gateway := _dict.get('public_gateway')) is not None:
+ args['public_gateway'] = PublicGatewayReference.from_dict(public_gateway)
+ if (resource_group := _dict.get('resource_group')) is not None:
+ args['resource_group'] = ResourceGroupReference.from_dict(resource_group)
else:
- raise ValueError('Required property \'private_ips\' not present in VPNServer JSON')
- if 'protocol' in _dict:
- args['protocol'] = _dict.get('protocol')
+ raise ValueError('Required property \'resource_group\' not present in Subnet JSON')
+ if (resource_type := _dict.get('resource_type')) is not None:
+ args['resource_type'] = resource_type
else:
- raise ValueError('Required property \'protocol\' not present in VPNServer JSON')
- if 'resource_group' in _dict:
- args['resource_group'] = ResourceGroupReference.from_dict(_dict.get('resource_group'))
+ raise ValueError('Required property \'resource_type\' not present in Subnet JSON')
+ if (routing_table := _dict.get('routing_table')) is not None:
+ args['routing_table'] = RoutingTableReference.from_dict(routing_table)
else:
- raise ValueError('Required property \'resource_group\' not present in VPNServer JSON')
- if 'resource_type' in _dict:
- args['resource_type'] = _dict.get('resource_type')
+ raise ValueError('Required property \'routing_table\' not present in Subnet JSON')
+ if (status := _dict.get('status')) is not None:
+ args['status'] = status
else:
- raise ValueError('Required property \'resource_type\' not present in VPNServer JSON')
- if 'security_groups' in _dict:
- args['security_groups'] = [SecurityGroupReference.from_dict(v) for v in _dict.get('security_groups')]
+ raise ValueError('Required property \'status\' not present in Subnet JSON')
+ if (total_ipv4_address_count := _dict.get('total_ipv4_address_count')) is not None:
+ args['total_ipv4_address_count'] = total_ipv4_address_count
else:
- raise ValueError('Required property \'security_groups\' not present in VPNServer JSON')
- if 'subnets' in _dict:
- args['subnets'] = [SubnetReference.from_dict(v) for v in _dict.get('subnets')]
+ raise ValueError('Required property \'total_ipv4_address_count\' not present in Subnet JSON')
+ if (vpc := _dict.get('vpc')) is not None:
+ args['vpc'] = VPCReference.from_dict(vpc)
else:
- raise ValueError('Required property \'subnets\' not present in VPNServer JSON')
- if 'vpc' in _dict:
- args['vpc'] = VPCReference.from_dict(_dict.get('vpc'))
+ raise ValueError('Required property \'vpc\' not present in Subnet JSON')
+ if (zone := _dict.get('zone')) is not None:
+ args['zone'] = ZoneReference.from_dict(zone)
else:
- raise ValueError('Required property \'vpc\' not present in VPNServer JSON')
+ raise ValueError('Required property \'zone\' not present in Subnet JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VPNServer 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, 'certificate') and self.certificate is not None:
- if isinstance(self.certificate, dict):
- _dict['certificate'] = self.certificate
- else:
- _dict['certificate'] = self.certificate.to_dict()
- if hasattr(self, 'client_authentication') and self.client_authentication is not None:
- client_authentication_list = []
- for v in self.client_authentication:
- if isinstance(v, dict):
- client_authentication_list.append(v)
- else:
- client_authentication_list.append(v.to_dict())
- _dict['client_authentication'] = client_authentication_list
- if hasattr(self, 'client_auto_delete') and self.client_auto_delete is not None:
- _dict['client_auto_delete'] = self.client_auto_delete
- if hasattr(self, 'client_auto_delete_timeout') and self.client_auto_delete_timeout is not None:
- _dict['client_auto_delete_timeout'] = self.client_auto_delete_timeout
- if hasattr(self, 'client_dns_server_ips') and self.client_dns_server_ips is not None:
- client_dns_server_ips_list = []
- for v in self.client_dns_server_ips:
- if isinstance(v, dict):
- client_dns_server_ips_list.append(v)
- else:
- client_dns_server_ips_list.append(v.to_dict())
- _dict['client_dns_server_ips'] = client_dns_server_ips_list
- if hasattr(self, 'client_idle_timeout') and self.client_idle_timeout is not None:
- _dict['client_idle_timeout'] = self.client_idle_timeout
- if hasattr(self, 'client_ip_pool') and self.client_ip_pool is not None:
- _dict['client_ip_pool'] = self.client_ip_pool
+ if hasattr(self, '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, 'enable_split_tunneling') and self.enable_split_tunneling is not None:
- _dict['enable_split_tunneling'] = self.enable_split_tunneling
- if hasattr(self, 'health_reasons') and self.health_reasons is not None:
- health_reasons_list = []
- for v in self.health_reasons:
- if isinstance(v, dict):
- health_reasons_list.append(v)
- else:
- health_reasons_list.append(v.to_dict())
- _dict['health_reasons'] = health_reasons_list
- if hasattr(self, 'health_state') and self.health_state is not None:
- _dict['health_state'] = self.health_state
- if hasattr(self, 'hostname') and self.hostname is not None:
- _dict['hostname'] = self.hostname
if hasattr(self, 'href') and self.href is not None:
_dict['href'] = self.href
if hasattr(self, 'id') and self.id is not None:
_dict['id'] = self.id
- if hasattr(self, 'lifecycle_reasons') and self.lifecycle_reasons is not None:
- lifecycle_reasons_list = []
- for v in self.lifecycle_reasons:
- if isinstance(v, dict):
- lifecycle_reasons_list.append(v)
- else:
- lifecycle_reasons_list.append(v.to_dict())
- _dict['lifecycle_reasons'] = lifecycle_reasons_list
- if hasattr(self, 'lifecycle_state') and self.lifecycle_state is not None:
- _dict['lifecycle_state'] = self.lifecycle_state
+ if hasattr(self, '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, 'port') and self.port is not None:
- _dict['port'] = self.port
- if hasattr(self, 'private_ips') and self.private_ips is not None:
- private_ips_list = []
- for v in self.private_ips:
- if isinstance(v, dict):
- private_ips_list.append(v)
- else:
- private_ips_list.append(v.to_dict())
- _dict['private_ips'] = private_ips_list
- if hasattr(self, 'protocol') and self.protocol is not None:
- _dict['protocol'] = self.protocol
+ if hasattr(self, 'network_acl') and self.network_acl is not None:
+ if isinstance(self.network_acl, dict):
+ _dict['network_acl'] = self.network_acl
+ else:
+ _dict['network_acl'] = self.network_acl.to_dict()
+ if hasattr(self, 'public_gateway') and self.public_gateway is not None:
+ if isinstance(self.public_gateway, dict):
+ _dict['public_gateway'] = self.public_gateway
+ else:
+ _dict['public_gateway'] = self.public_gateway.to_dict()
if hasattr(self, 'resource_group') and self.resource_group is not None:
if isinstance(self.resource_group, dict):
_dict['resource_group'] = self.resource_group
@@ -80249,27 +82991,25 @@ def to_dict(self) -> Dict:
_dict['resource_group'] = self.resource_group.to_dict()
if hasattr(self, 'resource_type') and self.resource_type is not None:
_dict['resource_type'] = self.resource_type
- if hasattr(self, 'security_groups') and self.security_groups is not None:
- security_groups_list = []
- for v in self.security_groups:
- if isinstance(v, dict):
- security_groups_list.append(v)
- else:
- security_groups_list.append(v.to_dict())
- _dict['security_groups'] = security_groups_list
- if hasattr(self, 'subnets') and self.subnets is not None:
- subnets_list = []
- for v in self.subnets:
- if isinstance(v, dict):
- subnets_list.append(v)
- else:
- subnets_list.append(v.to_dict())
- _dict['subnets'] = subnets_list
+ if hasattr(self, 'routing_table') and self.routing_table is not None:
+ if isinstance(self.routing_table, dict):
+ _dict['routing_table'] = self.routing_table
+ else:
+ _dict['routing_table'] = self.routing_table.to_dict()
+ if hasattr(self, 'status') and self.status is not None:
+ _dict['status'] = self.status
+ if hasattr(self, 'total_ipv4_address_count') and self.total_ipv4_address_count is not None:
+ _dict['total_ipv4_address_count'] = self.total_ipv4_address_count
if hasattr(self, 'vpc') and self.vpc is not None:
if isinstance(self.vpc, dict):
_dict['vpc'] = self.vpc
else:
_dict['vpc'] = self.vpc.to_dict()
+ if hasattr(self, 'zone') and self.zone is not None:
+ if isinstance(self.zone, dict):
+ _dict['zone'] = self.zone
+ else:
+ _dict['zone'] = self.zone.to_dict()
return _dict
def _to_dict(self):
@@ -80277,481 +83017,120 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this VPNServer object."""
+ """Return a `str` version of this Subnet object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VPNServer') -> 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: 'VPNServer') -> bool:
+ def __ne__(self, other: 'Subnet') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class HealthStateEnum(str, Enum):
- """
- The health of this resource.
- - `ok`: No abnormal behavior detected
- - `degraded`: Experiencing compromised performance, capacity, or connectivity
- - `faulted`: Completely unreachable, inoperative, or otherwise entirely
- incapacitated
- - `inapplicable`: The health state does not apply because of the current lifecycle
- state. A resource with a lifecycle state of `failed` or `deleting` will have a
- health state of `inapplicable`. A `pending` resource may also have this state.
- """
-
- DEGRADED = 'degraded'
- FAULTED = 'faulted'
- INAPPLICABLE = 'inapplicable'
- OK = 'ok'
-
-
- class LifecycleStateEnum(str, Enum):
- """
- The lifecycle state of the VPN server.
- """
-
- DELETING = 'deleting'
- FAILED = 'failed'
- PENDING = 'pending'
- STABLE = 'stable'
- SUSPENDED = 'suspended'
- UPDATING = 'updating'
- WAITING = 'waiting'
-
-
- class ProtocolEnum(str, Enum):
- """
- The transport protocol used by this VPN server.
- """
-
- TCP = 'tcp'
- UDP = 'udp'
-
-
- class ResourceTypeEnum(str, Enum):
- """
- The resource type.
- """
-
- VPN_SERVER = 'vpn_server'
-
-
-
-class VPNServerAuthentication:
- """
- An authentication method for this VPN server.
-
- :attr str method: The type of authentication.
- """
-
- def __init__(
- self,
- method: str,
- ) -> None:
- """
- Initialize a VPNServerAuthentication object.
-
- :param str method: The type of authentication.
- """
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['VPNServerAuthenticationByUsername', 'VPNServerAuthenticationByCertificate'])
- )
- raise Exception(msg)
-
- class MethodEnum(str, Enum):
- """
- The type of authentication.
- """
-
- CERTIFICATE = 'certificate'
- USERNAME = 'username'
-
-
-
-class VPNServerAuthenticationByUsernameIdProvider:
- """
- The type of identity provider to be used by VPN client.
-
- """
-
- def __init__(
- self,
- ) -> None:
- """
- Initialize a VPNServerAuthenticationByUsernameIdProvider object.
-
- """
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['VPNServerAuthenticationByUsernameIdProviderByIAM'])
- )
- raise Exception(msg)
-
-
-class VPNServerAuthenticationPrototype:
- """
- An authentication method for this VPN server.
-
- :attr str method: The type of authentication.
- """
-
- def __init__(
- self,
- method: str,
- ) -> None:
- """
- Initialize a VPNServerAuthenticationPrototype object.
-
- :param str method: The type of authentication.
- """
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype', 'VPNServerAuthenticationPrototypeVPNServerAuthenticationByCertificatePrototype'])
- )
- raise Exception(msg)
-
- @classmethod
- def from_dict(cls, _dict: Dict) -> 'VPNServerAuthenticationPrototype':
- """Initialize a VPNServerAuthenticationPrototype object from a json dictionary."""
- disc_class = cls._get_class_by_discriminator(_dict)
- if disc_class != cls:
- return disc_class.from_dict(_dict)
- msg = "Cannot convert dictionary into an instance of base class 'VPNServerAuthenticationPrototype'. The discriminator value should map to a valid subclass: {1}".format(
- ", ".join(['VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype', 'VPNServerAuthenticationPrototypeVPNServerAuthenticationByCertificatePrototype'])
- )
- raise Exception(msg)
-
- @classmethod
- def _from_dict(cls, _dict: Dict):
- """Initialize a VPNServerAuthenticationPrototype object from a json dictionary."""
- return cls.from_dict(_dict)
-
- @classmethod
- def _get_class_by_discriminator(cls, _dict: Dict) -> object:
- mapping = {}
- mapping['certificate'] = 'VPNServerAuthenticationPrototypeVPNServerAuthenticationByCertificatePrototype'
- mapping['username'] = 'VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype'
- disc_value = _dict.get('method')
- if disc_value is None:
- raise ValueError('Discriminator property \'method\' not found in VPNServerAuthenticationPrototype JSON')
- class_name = mapping.get(disc_value, disc_value)
- try:
- disc_class = getattr(sys.modules[__name__], class_name)
- except AttributeError:
- disc_class = cls
- if isinstance(disc_class, object):
- return disc_class
- raise TypeError('%s is not a discriminator class' % class_name)
-
- class MethodEnum(str, Enum):
- """
- The type of authentication.
- """
-
- CERTIFICATE = 'certificate'
- USERNAME = 'username'
-
-
-
-class VPNServerClient:
- """
- VPNServerClient.
-
- :attr IP client_ip: The IP address assigned to this VPN client from
- `client_ip_pool`.
- :attr str common_name: (optional) The common name of client certificate that the
- VPN client provided when connecting to the server.
- This property will be present only when the `certificate` client authentication
- method is enabled on the VPN server.
- :attr datetime created_at: The date and time that the VPN client was created.
- :attr datetime disconnected_at: (optional) The date and time that the VPN client
- was disconnected.
- This property will be present only when the client `status` is `disconnected`.
- :attr str href: The URL for this VPN client.
- :attr str id: The unique identifier for this VPN client.
- :attr IP remote_ip: The remote IP address of this VPN client.
- :attr int remote_port: The remote port of this VPN client.
- :attr str resource_type: The resource type.
- :attr str status: The status of the VPN client:
- - `connected`: the VPN client is `connected` to this VPN server.
- - `disconnected`: the VPN client is `disconnected` from this VPN server.
- The enumerated values for this property are expected to expand in the future.
- When processing this property, check for and log unknown values. Optionally halt
- processing and surface the error, or bypass the VPN client on which the
- unexpected property value was encountered.
- :attr str username: (optional) The username that this VPN client provided when
- connecting to the VPN server.
- This property will be present only when the `username` client authentication
- method is enabled on the VPN server.
- """
-
- def __init__(
- self,
- client_ip: 'IP',
- created_at: datetime,
- href: str,
- id: str,
- remote_ip: 'IP',
- remote_port: int,
- resource_type: str,
- status: str,
- *,
- common_name: str = None,
- disconnected_at: datetime = None,
- username: str = None,
- ) -> None:
+ class IpVersionEnum(str, Enum):
"""
- Initialize a VPNServerClient object.
-
- :param IP client_ip: The IP address assigned to this VPN client from
- `client_ip_pool`.
- :param datetime created_at: The date and time that the VPN client was
- created.
- :param str href: The URL for this VPN client.
- :param str id: The unique identifier for this VPN client.
- :param IP remote_ip: The remote IP address of this VPN client.
- :param int remote_port: The remote port of this VPN client.
- :param str resource_type: The resource type.
- :param str status: The status of the VPN client:
- - `connected`: the VPN client is `connected` to this VPN server.
- - `disconnected`: the VPN client is `disconnected` from this VPN server.
- The enumerated values for this property are expected to expand in the
- future. When processing this property, check for and log unknown values.
- Optionally halt processing and surface the error, or bypass the VPN client
- on which the unexpected property value was encountered.
- :param str common_name: (optional) The common name of client certificate
- that the VPN client provided when connecting to the server.
- This property will be present only when the `certificate` client
- authentication method is enabled on the VPN server.
- :param datetime disconnected_at: (optional) The date and time that the VPN
- client was disconnected.
- This property will be present only when the client `status` is
- `disconnected`.
- :param str username: (optional) The username that this VPN client provided
- when connecting to the VPN server.
- This property will be present only when the `username` client
- authentication method is enabled on the VPN server.
+ The IP version(s) supported by this subnet.
"""
- self.client_ip = client_ip
- self.common_name = common_name
- self.created_at = created_at
- self.disconnected_at = disconnected_at
- self.href = href
- self.id = id
- self.remote_ip = remote_ip
- self.remote_port = remote_port
- self.resource_type = resource_type
- self.status = status
- self.username = username
-
- @classmethod
- def from_dict(cls, _dict: Dict) -> 'VPNServerClient':
- """Initialize a VPNServerClient object from a json dictionary."""
- args = {}
- if 'client_ip' in _dict:
- args['client_ip'] = IP.from_dict(_dict.get('client_ip'))
- else:
- raise ValueError('Required property \'client_ip\' not present in VPNServerClient JSON')
- if 'common_name' in _dict:
- args['common_name'] = _dict.get('common_name')
- if 'created_at' in _dict:
- args['created_at'] = string_to_datetime(_dict.get('created_at'))
- else:
- raise ValueError('Required property \'created_at\' not present in VPNServerClient JSON')
- if 'disconnected_at' in _dict:
- args['disconnected_at'] = string_to_datetime(_dict.get('disconnected_at'))
- if 'href' in _dict:
- args['href'] = _dict.get('href')
- else:
- raise ValueError('Required property \'href\' not present in VPNServerClient JSON')
- if 'id' in _dict:
- args['id'] = _dict.get('id')
- else:
- raise ValueError('Required property \'id\' not present in VPNServerClient JSON')
- if 'remote_ip' in _dict:
- args['remote_ip'] = IP.from_dict(_dict.get('remote_ip'))
- else:
- raise ValueError('Required property \'remote_ip\' not present in VPNServerClient JSON')
- if 'remote_port' in _dict:
- args['remote_port'] = _dict.get('remote_port')
- else:
- raise ValueError('Required property \'remote_port\' not present in VPNServerClient JSON')
- if 'resource_type' in _dict:
- args['resource_type'] = _dict.get('resource_type')
- else:
- raise ValueError('Required property \'resource_type\' not present in VPNServerClient JSON')
- if 'status' in _dict:
- args['status'] = _dict.get('status')
- else:
- raise ValueError('Required property \'status\' not present in VPNServerClient JSON')
- if 'username' in _dict:
- args['username'] = _dict.get('username')
- return cls(**args)
-
- @classmethod
- def _from_dict(cls, _dict):
- """Initialize a VPNServerClient object from a json dictionary."""
- return cls.from_dict(_dict)
-
- def to_dict(self) -> Dict:
- """Return a json dictionary representing this model."""
- _dict = {}
- if hasattr(self, 'client_ip') and self.client_ip is not None:
- if isinstance(self.client_ip, dict):
- _dict['client_ip'] = self.client_ip
- else:
- _dict['client_ip'] = self.client_ip.to_dict()
- if hasattr(self, 'common_name') and self.common_name is not None:
- _dict['common_name'] = self.common_name
- if hasattr(self, 'created_at') and self.created_at is not None:
- _dict['created_at'] = datetime_to_string(self.created_at)
- if hasattr(self, 'disconnected_at') and self.disconnected_at is not None:
- _dict['disconnected_at'] = datetime_to_string(self.disconnected_at)
- if hasattr(self, 'href') and self.href is not None:
- _dict['href'] = self.href
- if hasattr(self, 'id') and self.id is not None:
- _dict['id'] = self.id
- if hasattr(self, 'remote_ip') and self.remote_ip is not None:
- if isinstance(self.remote_ip, dict):
- _dict['remote_ip'] = self.remote_ip
- else:
- _dict['remote_ip'] = self.remote_ip.to_dict()
- if hasattr(self, 'remote_port') and self.remote_port is not None:
- _dict['remote_port'] = self.remote_port
- if hasattr(self, 'resource_type') and self.resource_type is not None:
- _dict['resource_type'] = self.resource_type
- if hasattr(self, 'status') and self.status is not None:
- _dict['status'] = self.status
- if hasattr(self, 'username') and self.username is not None:
- _dict['username'] = self.username
- return _dict
-
- def _to_dict(self):
- """Return a json dictionary representing this model."""
- return self.to_dict()
-
- def __str__(self) -> str:
- """Return a `str` version of this VPNServerClient object."""
- return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VPNServerClient') -> bool:
- """Return `true` when self and other are equal, false otherwise."""
- if not isinstance(other, self.__class__):
- return False
- return self.__dict__ == other.__dict__
+ IPV4 = 'ipv4'
- def __ne__(self, other: 'VPNServerClient') -> bool:
- """Return `true` when self and other are not equal, false otherwise."""
- return not self == other
class ResourceTypeEnum(str, Enum):
"""
The resource type.
"""
- VPN_SERVER_CLIENT = 'vpn_server_client'
+ SUBNET = 'subnet'
class StatusEnum(str, Enum):
"""
- The status of the VPN client:
- - `connected`: the VPN client is `connected` to this VPN server.
- - `disconnected`: the VPN client is `disconnected` from this VPN server.
- The enumerated values for this property are expected to expand in the future. When
- processing this property, check for and log unknown values. Optionally halt
- processing and surface the error, or bypass the VPN client on which the unexpected
- property value was encountered.
+ The status of the subnet.
"""
- CONNECTED = 'connected'
- DISCONNECTED = 'disconnected'
+ AVAILABLE = 'available'
+ DELETING = 'deleting'
+ FAILED = 'failed'
+ PENDING = 'pending'
-class VPNServerClientCollection:
+class SubnetCollection:
"""
- VPNServerClientCollection.
+ SubnetCollection.
- :attr List[VPNServerClient] clients: Collection of VPN clients.
- :attr VPNServerClientCollectionFirst first: A link to the first page of
- resources.
- :attr int limit: The maximum number of resources that can be returned by the
+ :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.
- :attr VPNServerClientCollectionNext 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.
- :attr int total_count: The total number of resources across all pages.
+ :param List[Subnet] subnets: Collection of subnets.
+ :param int total_count: The total number of resources across all pages.
"""
def __init__(
self,
- clients: List['VPNServerClient'],
- first: 'VPNServerClientCollectionFirst',
+ first: 'SubnetCollectionFirst',
limit: int,
+ subnets: List['Subnet'],
total_count: int,
*,
- next: 'VPNServerClientCollectionNext' = None,
+ next: Optional['SubnetCollectionNext'] = None,
) -> None:
"""
- Initialize a VPNServerClientCollection object.
+ Initialize a SubnetCollection object.
- :param List[VPNServerClient] clients: Collection of VPN clients.
- :param VPNServerClientCollectionFirst 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[Subnet] subnets: Collection of subnets.
:param int total_count: The total number of resources across all pages.
- :param VPNServerClientCollectionNext next: (optional) A link to the next
- page of resources. This property is present for all pages
+ :param SubnetCollectionNext next: (optional) A link to the next page of
+ resources. This property is present for all pages
except the last page.
"""
- self.clients = clients
self.first = first
self.limit = limit
self.next = next
+ self.subnets = subnets
self.total_count = total_count
@classmethod
- def from_dict(cls, _dict: Dict) -> 'VPNServerClientCollection':
- """Initialize a VPNServerClientCollection object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'SubnetCollection':
+ """Initialize a SubnetCollection object from a json dictionary."""
args = {}
- if 'clients' in _dict:
- args['clients'] = [VPNServerClient.from_dict(v) for v in _dict.get('clients')]
+ if (first := _dict.get('first')) is not None:
+ args['first'] = SubnetCollectionFirst.from_dict(first)
else:
- raise ValueError('Required property \'clients\' not present in VPNServerClientCollection JSON')
- if 'first' in _dict:
- args['first'] = VPNServerClientCollectionFirst.from_dict(_dict.get('first'))
+ raise ValueError('Required property \'first\' not present in SubnetCollection JSON')
+ if (limit := _dict.get('limit')) is not None:
+ args['limit'] = limit
else:
- raise ValueError('Required property \'first\' not present in VPNServerClientCollection JSON')
- if 'limit' in _dict:
- args['limit'] = _dict.get('limit')
+ raise ValueError('Required property \'limit\' not present in SubnetCollection JSON')
+ if (next := _dict.get('next')) is not None:
+ args['next'] = SubnetCollectionNext.from_dict(next)
+ if (subnets := _dict.get('subnets')) is not None:
+ args['subnets'] = [Subnet.from_dict(v) for v in subnets]
else:
- raise ValueError('Required property \'limit\' not present in VPNServerClientCollection JSON')
- if 'next' in _dict:
- args['next'] = VPNServerClientCollectionNext.from_dict(_dict.get('next'))
- if 'total_count' in _dict:
- args['total_count'] = _dict.get('total_count')
+ raise ValueError('Required property \'subnets\' not present in SubnetCollection JSON')
+ if (total_count := _dict.get('total_count')) is not None:
+ args['total_count'] = total_count
else:
- raise ValueError('Required property \'total_count\' not present in VPNServerClientCollection JSON')
+ raise ValueError('Required property \'total_count\' not present in SubnetCollection JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VPNServerClientCollection object from a json dictionary."""
+ """Initialize a SubnetCollection object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'clients') and self.clients is not None:
- clients_list = []
- for v in self.clients:
- if isinstance(v, dict):
- clients_list.append(v)
- else:
- clients_list.append(v.to_dict())
- _dict['clients'] = clients_list
if hasattr(self, 'first') and self.first is not None:
if isinstance(self.first, dict):
_dict['first'] = self.first
@@ -80764,6 +83143,14 @@ def to_dict(self) -> Dict:
_dict['next'] = self.next
else:
_dict['next'] = self.next.to_dict()
+ if hasattr(self, 'subnets') and self.subnets is not None:
+ subnets_list = []
+ for v in self.subnets:
+ if isinstance(v, dict):
+ subnets_list.append(v)
+ else:
+ subnets_list.append(v.to_dict())
+ _dict['subnets'] = subnets_list
if hasattr(self, 'total_count') and self.total_count is not None:
_dict['total_count'] = self.total_count
return _dict
@@ -80773,25 +83160,25 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this VPNServerClientCollection object."""
+ """Return a `str` version of this SubnetCollection object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VPNServerClientCollection') -> 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: 'VPNServerClientCollection') -> bool:
+ def __ne__(self, other: 'SubnetCollection') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class VPNServerClientCollectionFirst:
+class SubnetCollectionFirst:
"""
A link to the first page of resources.
- :attr str href: The URL for a page of resources.
+ :param str href: The URL for a page of resources.
"""
def __init__(
@@ -80799,25 +83186,25 @@ def __init__(
href: str,
) -> None:
"""
- Initialize a VPNServerClientCollectionFirst 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) -> 'VPNServerClientCollectionFirst':
- """Initialize a VPNServerClientCollectionFirst 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')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'href\' not present in VPNServerClientCollectionFirst JSON')
+ raise ValueError('Required property \'href\' not present in SubnetCollectionFirst JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VPNServerClientCollectionFirst object from a json dictionary."""
+ """Initialize a SubnetCollectionFirst object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -80832,26 +83219,26 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this VPNServerClientCollectionFirst object."""
+ """Return a `str` version of this SubnetCollectionFirst object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VPNServerClientCollectionFirst') -> 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: 'VPNServerClientCollectionFirst') -> bool:
+ def __ne__(self, other: 'SubnetCollectionFirst') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class VPNServerClientCollectionNext:
+class SubnetCollectionNext:
"""
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.
+ :param str href: The URL for a page of resources.
"""
def __init__(
@@ -80859,25 +83246,25 @@ def __init__(
href: str,
) -> None:
"""
- Initialize a VPNServerClientCollectionNext 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) -> 'VPNServerClientCollectionNext':
- """Initialize a VPNServerClientCollectionNext 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')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'href\' not present in VPNServerClientCollectionNext JSON')
+ raise ValueError('Required property \'href\' not present in SubnetCollectionNext JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VPNServerClientCollectionNext object from a json dictionary."""
+ """Initialize a SubnetCollectionNext object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -80892,116 +83279,122 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this VPNServerClientCollectionNext object."""
+ """Return a `str` version of this SubnetCollectionNext object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VPNServerClientCollectionNext') -> 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: 'VPNServerClientCollectionNext') -> bool:
+ def __ne__(self, other: 'SubnetCollectionNext') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class VPNServerCollection:
+class SubnetIdentity:
"""
- VPNServerCollection.
+ Identifies a subnet by a unique property.
- :attr VPNServerCollectionFirst first: A link to the first page of resources.
- :attr int limit: The maximum number of resources that can be returned by the
- request.
- :attr VPNServerCollectionNext next: (optional) A link to the next page of
- resources. This property is present for all pages
- except the last page.
- :attr int total_count: The total number of resources across all pages.
- :attr List[VPNServer] vpn_servers: Collection of VPN servers.
"""
def __init__(
self,
- first: 'VPNServerCollectionFirst',
- limit: int,
- total_count: int,
- vpn_servers: List['VPNServer'],
- *,
- next: 'VPNServerCollectionNext' = None,
) -> None:
"""
- Initialize a VPNServerCollection object.
+ Initialize a SubnetIdentity object.
- :param VPNServerCollectionFirst first: A link to the first page of
- resources.
- :param int limit: The maximum number of resources that can be returned by
- the request.
- :param int total_count: The total number of resources across all pages.
- :param List[VPNServer] vpn_servers: Collection of VPN servers.
- :param VPNServerCollectionNext next: (optional) A link to the next page of
- resources. This property is present for all pages
- except the last page.
"""
- self.first = first
- self.limit = limit
- self.next = next
- self.total_count = total_count
- self.vpn_servers = vpn_servers
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['SubnetIdentityById', 'SubnetIdentityByCRN', 'SubnetIdentityByHref'])
+ )
+ raise Exception(msg)
+
+
+class SubnetPatch:
+ """
+ SubnetPatch.
+
+ :param str name: (optional) The name for this subnet. The name must not be used
+ by another subnet in the VPC.
+ :param NetworkACLIdentity network_acl: (optional) The network ACL to use for
+ this subnet.
+ :param SubnetPublicGatewayPatch public_gateway: (optional) The public gateway to
+ use for internet-bound traffic for this subnet.
+ :param RoutingTableIdentity routing_table: (optional) The routing table to use
+ for this subnet. The routing table properties
+ `route_direct_link_ingress`, `route_internet_ingress`,
+ `route_transit_gateway_ingress`, and `route_vpc_zone_ingress` must be `false`.
+ """
+
+ def __init__(
+ self,
+ *,
+ name: Optional[str] = None,
+ network_acl: Optional['NetworkACLIdentity'] = None,
+ public_gateway: Optional['SubnetPublicGatewayPatch'] = None,
+ routing_table: Optional['RoutingTableIdentity'] = None,
+ ) -> None:
+ """
+ Initialize a SubnetPatch object.
+
+ :param str name: (optional) The name for this subnet. The name must not be
+ used by another subnet in the VPC.
+ :param NetworkACLIdentity network_acl: (optional) The network ACL to use
+ for this subnet.
+ :param SubnetPublicGatewayPatch public_gateway: (optional) The public
+ gateway to use for internet-bound traffic for this subnet.
+ :param RoutingTableIdentity routing_table: (optional) The routing table to
+ use for this subnet. The routing table properties
+ `route_direct_link_ingress`, `route_internet_ingress`,
+ `route_transit_gateway_ingress`, and `route_vpc_zone_ingress` must be
+ `false`.
+ """
+ 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) -> 'VPNServerCollection':
- """Initialize a VPNServerCollection object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'SubnetPatch':
+ """Initialize a SubnetPatch object from a json dictionary."""
args = {}
- if 'first' in _dict:
- args['first'] = VPNServerCollectionFirst.from_dict(_dict.get('first'))
- else:
- raise ValueError('Required property \'first\' not present in VPNServerCollection JSON')
- if 'limit' in _dict:
- args['limit'] = _dict.get('limit')
- else:
- raise ValueError('Required property \'limit\' not present in VPNServerCollection JSON')
- if 'next' in _dict:
- args['next'] = VPNServerCollectionNext.from_dict(_dict.get('next'))
- if 'total_count' in _dict:
- args['total_count'] = _dict.get('total_count')
- else:
- raise ValueError('Required property \'total_count\' not present in VPNServerCollection JSON')
- if 'vpn_servers' in _dict:
- args['vpn_servers'] = [VPNServer.from_dict(v) for v in _dict.get('vpn_servers')]
- else:
- raise ValueError('Required property \'vpn_servers\' not present in VPNServerCollection JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ if (network_acl := _dict.get('network_acl')) is not None:
+ args['network_acl'] = network_acl
+ if (public_gateway := _dict.get('public_gateway')) is not None:
+ args['public_gateway'] = public_gateway
+ if (routing_table := _dict.get('routing_table')) is not None:
+ args['routing_table'] = routing_table
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VPNServerCollection object from a json dictionary."""
+ """Initialize a SubnetPatch object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'first') and self.first is not None:
- if isinstance(self.first, dict):
- _dict['first'] = self.first
+ if hasattr(self, '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['first'] = self.first.to_dict()
- if hasattr(self, 'limit') and self.limit is not None:
- _dict['limit'] = self.limit
- if hasattr(self, 'next') and self.next is not None:
- if isinstance(self.next, dict):
- _dict['next'] = self.next
+ _dict['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['next'] = self.next.to_dict()
- if hasattr(self, 'total_count') and self.total_count is not None:
- _dict['total_count'] = self.total_count
- if hasattr(self, 'vpn_servers') and self.vpn_servers is not None:
- vpn_servers_list = []
- for v in self.vpn_servers:
- if isinstance(v, dict):
- vpn_servers_list.append(v)
- else:
- vpn_servers_list.append(v.to_dict())
- _dict['vpn_servers'] = vpn_servers_list
+ _dict['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):
@@ -81009,58 +83402,210 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this VPNServerCollection object."""
+ """Return a `str` version of this SubnetPatch object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VPNServerCollection') -> 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: 'VPNServerCollection') -> bool:
+ def __ne__(self, other: 'SubnetPatch') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class VPNServerCollectionFirst:
+class SubnetPrototype:
"""
- A link to the first page of resources.
+ SubnetPrototype.
+
+ :param str ip_version: (optional) The IP version(s) to support for this subnet.
+ :param str name: (optional) The name for this subnet. The name must not be used
+ by another subnet in the VPC. If unspecified, the name will be a hyphenated list
+ of randomly-selected words.
+ :param NetworkACLIdentity network_acl: (optional) The network ACL to use for
+ this subnet.
+ :param PublicGatewayIdentity public_gateway: (optional) The public gateway to
+ use for internet-bound traffic for this subnet. If
+ unspecified, the subnet will not be attached to a public gateway.
+ :param ResourceGroupIdentity resource_group: (optional) The resource group to
+ use. If unspecified, the account's [default resource
+ group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be
+ used.
+ :param RoutingTableIdentity routing_table: (optional) The routing table to use
+ for this subnet. If unspecified, the default routing table
+ for the VPC is used. The routing table properties `route_direct_link_ingress`,
+ `route_internet_ingress`, `route_transit_gateway_ingress`, and
+ `route_vpc_zone_ingress` must be `false`.
+ :param VPCIdentity vpc: The VPC the subnet will reside in.
+ """
+
+ def __init__(
+ self,
+ vpc: 'VPCIdentity',
+ *,
+ ip_version: Optional[str] = None,
+ name: Optional[str] = None,
+ network_acl: Optional['NetworkACLIdentity'] = None,
+ public_gateway: Optional['PublicGatewayIdentity'] = None,
+ resource_group: Optional['ResourceGroupIdentity'] = None,
+ routing_table: Optional['RoutingTableIdentity'] = None,
+ ) -> None:
+ """
+ Initialize a SubnetPrototype object.
+
+ :param VPCIdentity vpc: The VPC the subnet will reside in.
+ :param str ip_version: (optional) The IP version(s) to support for this
+ subnet.
+ :param str name: (optional) The name for this subnet. The name must not be
+ used by another subnet in the VPC. If unspecified, the name will be a
+ hyphenated list of randomly-selected words.
+ :param NetworkACLIdentity network_acl: (optional) The network ACL to use
+ for this subnet.
+ :param PublicGatewayIdentity public_gateway: (optional) The public gateway
+ to use for internet-bound traffic for this subnet. If
+ unspecified, the subnet will not be attached to a public gateway.
+ :param ResourceGroupIdentity resource_group: (optional) The resource group
+ to use. If unspecified, the account's [default resource
+ group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be
+ used.
+ :param RoutingTableIdentity routing_table: (optional) The routing table to
+ use for this subnet. If unspecified, the default routing table
+ for the VPC is used. The routing table properties
+ `route_direct_link_ingress`,
+ `route_internet_ingress`, `route_transit_gateway_ingress`, and
+ `route_vpc_zone_ingress` must be `false`.
+ """
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['SubnetPrototypeSubnetByTotalCount', 'SubnetPrototypeSubnetByCIDR'])
+ )
+ raise Exception(msg)
+
+ class IpVersionEnum(str, Enum):
+ """
+ The IP version(s) to support for this subnet.
+ """
+
+ IPV4 = 'ipv4'
+
+
+
+class SubnetPublicGatewayPatch:
+ """
+ The public gateway to use for internet-bound traffic for this subnet.
+
+ """
+
+ def __init__(
+ self,
+ ) -> None:
+ """
+ Initialize a SubnetPublicGatewayPatch object.
+
+ """
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['SubnetPublicGatewayPatchPublicGatewayIdentityById', 'SubnetPublicGatewayPatchPublicGatewayIdentityByCRN', 'SubnetPublicGatewayPatchPublicGatewayIdentityByHref'])
+ )
+ raise Exception(msg)
+
+
+class SubnetReference:
+ """
+ SubnetReference.
- :attr str href: The URL for a page of resources.
+ :param str crn: The CRN for this subnet.
+ :param SubnetReferenceDeleted 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 subnet.
+ :param str id: The unique identifier for this subnet.
+ :param str name: The name for this subnet. The name is unique across all subnets
+ in the VPC.
+ :param str resource_type: The resource type.
"""
def __init__(
self,
+ crn: str,
href: str,
+ id: str,
+ name: str,
+ resource_type: str,
+ *,
+ deleted: Optional['SubnetReferenceDeleted'] = None,
) -> None:
"""
- Initialize a VPNServerCollectionFirst object.
+ Initialize a SubnetReference object.
- :param str href: The URL for a page of resources.
+ :param str crn: The CRN for this subnet.
+ :param str href: The URL for this subnet.
+ :param str id: The unique identifier for this subnet.
+ :param str name: The name for this subnet. The name is unique across all
+ subnets in the VPC.
+ :param str resource_type: The resource type.
+ :param SubnetReferenceDeleted deleted: (optional) If present, this property
+ indicates the referenced resource has been deleted, and provides
+ some supplementary information.
"""
+ self.crn = crn
+ self.deleted = deleted
self.href = href
+ self.id = id
+ self.name = name
+ self.resource_type = resource_type
@classmethod
- def from_dict(cls, _dict: Dict) -> 'VPNServerCollectionFirst':
- """Initialize a VPNServerCollectionFirst object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'SubnetReference':
+ """Initialize a SubnetReference object from a json dictionary."""
args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ if (crn := _dict.get('crn')) is not None:
+ args['crn'] = crn
else:
- raise ValueError('Required property \'href\' not present in VPNServerCollectionFirst JSON')
+ raise ValueError('Required property \'crn\' not present in SubnetReference JSON')
+ if (deleted := _dict.get('deleted')) is not None:
+ args['deleted'] = SubnetReferenceDeleted.from_dict(deleted)
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
+ else:
+ raise ValueError('Required property \'href\' not present in SubnetReference JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
+ else:
+ raise ValueError('Required property \'id\' not present in SubnetReference JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ else:
+ raise ValueError('Required property \'name\' not present in SubnetReference JSON')
+ if (resource_type := _dict.get('resource_type')) is not None:
+ args['resource_type'] = resource_type
+ else:
+ raise ValueError('Required property \'resource_type\' not present in SubnetReference JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VPNServerCollectionFirst 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:
+ if isinstance(self.deleted, dict):
+ _dict['deleted'] = self.deleted
+ else:
+ _dict['deleted'] = self.deleted.to_dict()
if hasattr(self, 'href') and self.href is not None:
_dict['href'] = self.href
+ if hasattr(self, 'id') and self.id is not None:
+ _dict['id'] = self.id
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ if hasattr(self, 'resource_type') and self.resource_type is not None:
+ _dict['resource_type'] = self.resource_type
return _dict
def _to_dict(self):
@@ -81068,59 +83613,67 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this VPNServerCollectionFirst object."""
+ """Return a `str` version of this SubnetReference object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VPNServerCollectionFirst') -> 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: 'VPNServerCollectionFirst') -> bool:
+ def __ne__(self, other: 'SubnetReference') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
+ class ResourceTypeEnum(str, Enum):
+ """
+ The resource type.
+ """
+
+ SUBNET = 'subnet'
+
-class VPNServerCollectionNext:
+
+class SubnetReferenceDeleted:
"""
- 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.
+ :param str more_info: Link to documentation about deleted resources.
"""
def __init__(
self,
- href: str,
+ more_info: str,
) -> None:
"""
- Initialize a VPNServerCollectionNext object.
+ Initialize a SubnetReferenceDeleted 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) -> 'VPNServerCollectionNext':
- """Initialize a VPNServerCollectionNext object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'SubnetReferenceDeleted':
+ """Initialize a SubnetReferenceDeleted object from a json dictionary."""
args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ if (more_info := _dict.get('more_info')) is not None:
+ args['more_info'] = more_info
else:
- raise ValueError('Required property \'href\' not present in VPNServerCollectionNext JSON')
+ raise ValueError('Required property \'more_info\' not present in SubnetReferenceDeleted JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VPNServerCollectionNext object from a json dictionary."""
+ """Initialize a SubnetReferenceDeleted object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, '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):
@@ -81128,81 +83681,97 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this VPNServerCollectionNext object."""
+ """Return a `str` version of this SubnetReferenceDeleted object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VPNServerCollectionNext') -> 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: 'VPNServerCollectionNext') -> bool:
+ def __ne__(self, other: 'SubnetReferenceDeleted') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class VPNServerHealthReason:
+class TrustedProfileIdentity:
"""
- VPNServerHealthReason.
+ Identifies a trusted profile by a unique property.
- :attr str code: A snake case string succinctly identifying the reason for this
- health state.
- :attr str message: An explanation of the reason for this health state.
- :attr str more_info: (optional) Link to documentation about the reason for this
- health state.
"""
def __init__(
self,
- code: str,
- message: str,
- *,
- more_info: str = None,
) -> None:
"""
- Initialize a VPNServerHealthReason object.
+ Initialize a TrustedProfileIdentity object.
- :param str code: A snake case string succinctly identifying the reason for
- this health state.
- :param str message: An explanation of the reason for this health state.
- :param str more_info: (optional) Link to documentation about the reason for
- this health state.
"""
- self.code = code
- self.message = message
- self.more_info = more_info
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['TrustedProfileIdentityTrustedProfileById', 'TrustedProfileIdentityTrustedProfileByCRN'])
+ )
+ raise Exception(msg)
+
+
+class TrustedProfileReference:
+ """
+ TrustedProfileReference.
+
+ :param str crn: The CRN for this trusted profile.
+ :param str id: The unique identifier for this trusted profile.
+ :param str resource_type: The resource type.
+ """
+
+ def __init__(
+ self,
+ crn: str,
+ id: str,
+ resource_type: str,
+ ) -> None:
+ """
+ Initialize a TrustedProfileReference object.
+
+ :param str crn: The CRN for this trusted profile.
+ :param str id: The unique identifier for this trusted profile.
+ :param str resource_type: The resource type.
+ """
+ self.crn = crn
+ self.id = id
+ self.resource_type = resource_type
@classmethod
- def from_dict(cls, _dict: Dict) -> 'VPNServerHealthReason':
- """Initialize a VPNServerHealthReason object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'TrustedProfileReference':
+ """Initialize a TrustedProfileReference object from a json dictionary."""
args = {}
- if 'code' in _dict:
- args['code'] = _dict.get('code')
+ if (crn := _dict.get('crn')) is not None:
+ args['crn'] = crn
else:
- raise ValueError('Required property \'code\' not present in VPNServerHealthReason JSON')
- if 'message' in _dict:
- args['message'] = _dict.get('message')
+ raise ValueError('Required property \'crn\' not present in TrustedProfileReference JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
else:
- raise ValueError('Required property \'message\' not present in VPNServerHealthReason JSON')
- if 'more_info' in _dict:
- args['more_info'] = _dict.get('more_info')
+ raise ValueError('Required property \'id\' not present in TrustedProfileReference JSON')
+ if (resource_type := _dict.get('resource_type')) is not None:
+ args['resource_type'] = resource_type
+ else:
+ raise ValueError('Required property \'resource_type\' not present in TrustedProfileReference JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VPNServerHealthReason object from a json dictionary."""
+ """Initialize a TrustedProfileReference object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, '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, 'crn') and self.crn is not None:
+ _dict['crn'] = self.crn
+ if hasattr(self, 'id') and self.id is not None:
+ _dict['id'] = self.id
+ if hasattr(self, 'resource_type') and self.resource_type is not None:
+ _dict['resource_type'] = self.resource_type
return _dict
def _to_dict(self):
@@ -81210,93 +83779,86 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this VPNServerHealthReason object."""
+ """Return a `str` version of this TrustedProfileReference object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VPNServerHealthReason') -> bool:
+ def __eq__(self, other: 'TrustedProfileReference') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'VPNServerHealthReason') -> bool:
+ def __ne__(self, other: 'TrustedProfileReference') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class CodeEnum(str, Enum):
+ class ResourceTypeEnum(str, Enum):
"""
- A snake case string succinctly identifying the reason for this health state.
+ The resource type.
"""
- CANNOT_ACCESS_CLIENT_CERTIFICATE = 'cannot_access_client_certificate'
- CANNOT_ACCESS_SERVER_CERTIFICATE = 'cannot_access_server_certificate'
- CANNOT_CREATE_VPC_ROUTE = 'cannot_create_vpc_route'
- CANNOT_RESERVE_IP_ADDRESS = 'cannot_reserve_ip_address'
- INTERNAL_ERROR = 'internal_error'
+ TRUSTED_PROFILE = 'trusted_profile'
-class VPNServerLifecycleReason:
+class VCPU:
"""
- VPNServerLifecycleReason.
+ The VCPU configuration.
- :attr str code: A snake case string succinctly identifying the reason for this
- lifecycle state.
- :attr str message: An explanation of the reason for this lifecycle state.
- :attr str more_info: (optional) Link to documentation about the reason for this
- lifecycle state.
+ :param str architecture: The VCPU architecture.
+ :param int count: The number of VCPUs assigned.
+ :param str manufacturer: The VCPU manufacturer.
"""
def __init__(
self,
- code: str,
- message: str,
- *,
- more_info: str = None,
+ architecture: str,
+ count: int,
+ manufacturer: str,
) -> None:
"""
- Initialize a VPNServerLifecycleReason object.
+ Initialize a VCPU object.
- :param str code: A snake case string succinctly identifying the reason for
- this lifecycle state.
- :param str message: An explanation of the reason for this lifecycle state.
- :param str more_info: (optional) Link to documentation about the reason for
- this lifecycle state.
+ :param str architecture: The VCPU architecture.
+ :param int count: The number of VCPUs assigned.
+ :param str manufacturer: The VCPU manufacturer.
"""
- self.code = code
- self.message = message
- self.more_info = more_info
+ self.architecture = architecture
+ self.count = count
+ self.manufacturer = manufacturer
@classmethod
- def from_dict(cls, _dict: Dict) -> 'VPNServerLifecycleReason':
- """Initialize a VPNServerLifecycleReason object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VCPU':
+ """Initialize a VCPU object from a json dictionary."""
args = {}
- if 'code' in _dict:
- args['code'] = _dict.get('code')
+ if (architecture := _dict.get('architecture')) is not None:
+ args['architecture'] = architecture
else:
- raise ValueError('Required property \'code\' not present in VPNServerLifecycleReason JSON')
- if 'message' in _dict:
- args['message'] = _dict.get('message')
+ raise ValueError('Required property \'architecture\' not present in VCPU JSON')
+ if (count := _dict.get('count')) is not None:
+ args['count'] = count
else:
- raise ValueError('Required property \'message\' not present in VPNServerLifecycleReason JSON')
- if 'more_info' in _dict:
- args['more_info'] = _dict.get('more_info')
+ raise ValueError('Required property \'count\' not present in VCPU JSON')
+ if (manufacturer := _dict.get('manufacturer')) is not None:
+ args['manufacturer'] = manufacturer
+ else:
+ raise ValueError('Required property \'manufacturer\' not present in VCPU JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VPNServerLifecycleReason object from a json dictionary."""
+ """Initialize a VCPU object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, '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, 'architecture') and self.architecture is not None:
+ _dict['architecture'] = self.architecture
+ if hasattr(self, 'count') and self.count is not None:
+ _dict['count'] = self.count
+ if hasattr(self, 'manufacturer') and self.manufacturer is not None:
+ _dict['manufacturer'] = self.manufacturer
return _dict
def _to_dict(self):
@@ -81304,380 +83866,107 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this VPNServerLifecycleReason object."""
+ """Return a `str` version of this VCPU object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VPNServerLifecycleReason') -> bool:
+ def __eq__(self, other: 'VCPU') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'VPNServerLifecycleReason') -> bool:
+ def __ne__(self, other: 'VCPU') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class CodeEnum(str, Enum):
- """
- A snake case string succinctly identifying the reason for this lifecycle state.
- """
-
- RESOURCE_SUSPENDED_BY_PROVIDER = 'resource_suspended_by_provider'
-
-
-class VPNServerPatch:
+class VPC:
"""
- VPNServerPatch.
+ VPC.
- :attr CertificateInstanceIdentity certificate: (optional) The certificate
- instance for this VPN server.
- :attr List[VPNServerAuthenticationPrototype] client_authentication: (optional)
- The authentication methods to use to authenticate VPN client on this VPN server
- (replacing any existing methods).
- :attr List[IP] client_dns_server_ips: (optional) The DNS server addresses that
- will be provided to VPN clients connected to this VPN server (replacing any
- existing addresses).
- :attr int client_idle_timeout: (optional) The seconds a VPN client can be idle
- before this VPN server will disconnect it. If `0`, the server will not
- disconnect idle clients.
- :attr str client_ip_pool: (optional) The VPN client IPv4 address pool, expressed
- in CIDR format. The request must not overlap with any existing address prefixes
- in the VPC or any of the following reserved address ranges:
- - `127.0.0.0/8` (IPv4 loopback addresses)
- - `161.26.0.0/16` (IBM services)
- - `166.8.0.0/14` (Cloud Service Endpoints)
- - `169.254.0.0/16` (IPv4 link-local addresses)
- - `224.0.0.0/4` (IPv4 multicast addresses)
- The prefix length of the client IP address pool's CIDR must be between
- `/9` (8,388,608 addresses) and `/22` (1024 addresses). A CIDR block that
- contains twice the number of IP addresses that are required to enable the
- maximum number of concurrent connections is recommended.
- :attr bool enable_split_tunneling: (optional) Indicates whether the split
- tunneling is enabled on this VPN server.
- :attr str name: (optional) The name for this VPN server. The name must not be
- used by another VPN server in the VPC.
- :attr int port: (optional) The port number used by this VPN server.
- :attr str protocol: (optional) The transport protocol used by this VPN server.
- :attr List[SubnetIdentity] subnets: (optional) The subnets to provision this VPN
- server in (replacing the existing subnets).
+ :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 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 NetworkACLReference default_network_acl: The default network ACL to use
+ for subnets created in this VPC.
+ :param RoutingTableReference default_routing_table: The default routing table to
+ use for subnets created in this VPC.
+ :param SecurityGroupReference default_security_group: The default security group
+ for this VPC. Resources created in this VPC that allow
+ a security group to be optionally specified will use this security group by
+ default.
+ :param VPCDNS dns: The DNS configuration for this VPC.
+ :param List[VPCHealthReason] health_reasons: (optional) The reasons for the
+ current `health_state` (if any).
+ The enumerated reason code values for this property will expand in the future.
+ When processing this property, check for and log unknown values. Optionally halt
+ processing and surface the error, or bypass the resource on which the unexpected
+ reason code was encountered.
+ :param str health_state: The health of this resource.
+ - `ok`: No abnormal behavior detected
+ - `degraded`: Experiencing compromised performance, capacity, or connectivity
+ - `faulted`: Completely unreachable, inoperative, or otherwise entirely
+ incapacitated
+ - `inapplicable`: The health state does not apply because of the current
+ lifecycle state. A resource with a lifecycle state of `failed` or `deleting`
+ will have a health state of `inapplicable`. A `pending` resource may also have
+ this state.
+ :param str href: The URL for this VPC.
+ :param str id: The unique identifier for this VPC.
+ :param str name: The name for this VPC. The name is unique across all VPCs in
+ the region.
+ :param ResourceGroupReference resource_group: The resource group for this VPC.
+ :param str resource_type: The resource type.
+ :param str status: The status of this VPC.
"""
def __init__(
self,
+ classic_access: bool,
+ created_at: datetime,
+ crn: str,
+ default_network_acl: 'NetworkACLReference',
+ default_routing_table: 'RoutingTableReference',
+ default_security_group: 'SecurityGroupReference',
+ dns: 'VPCDNS',
+ health_state: str,
+ href: str,
+ id: str,
+ name: str,
+ resource_group: 'ResourceGroupReference',
+ resource_type: str,
+ status: str,
*,
- certificate: 'CertificateInstanceIdentity' = None,
- client_authentication: List['VPNServerAuthenticationPrototype'] = None,
- client_dns_server_ips: List['IP'] = None,
- client_idle_timeout: int = None,
- client_ip_pool: str = None,
- enable_split_tunneling: bool = None,
- name: str = None,
- port: int = None,
- protocol: str = None,
- subnets: List['SubnetIdentity'] = None,
+ cse_source_ips: Optional[List['VPCCSESourceIP']] = None,
+ health_reasons: Optional[List['VPCHealthReason']] = None,
) -> None:
"""
- Initialize a VPNServerPatch object.
+ Initialize a VPC object.
- :param CertificateInstanceIdentity certificate: (optional) The certificate
- instance for this VPN server.
- :param List[VPNServerAuthenticationPrototype] client_authentication:
- (optional) The authentication methods to use to authenticate VPN client on
- this VPN server
- (replacing any existing methods).
- :param List[IP] client_dns_server_ips: (optional) The DNS server addresses
- that will be provided to VPN clients connected to this VPN server
- (replacing any existing addresses).
- :param int client_idle_timeout: (optional) The seconds a VPN client can be
- idle before this VPN server will disconnect it. If `0`, the server will
- not disconnect idle clients.
- :param str client_ip_pool: (optional) The VPN client IPv4 address pool,
- expressed in CIDR format. The request must not overlap with any existing
- address prefixes in the VPC or any of the following reserved address
- ranges:
- - `127.0.0.0/8` (IPv4 loopback addresses)
- - `161.26.0.0/16` (IBM services)
- - `166.8.0.0/14` (Cloud Service Endpoints)
- - `169.254.0.0/16` (IPv4 link-local addresses)
- - `224.0.0.0/4` (IPv4 multicast addresses)
- The prefix length of the client IP address pool's CIDR must be between
- `/9` (8,388,608 addresses) and `/22` (1024 addresses). A CIDR block that
- contains twice the number of IP addresses that are required to enable the
- maximum number of concurrent connections is recommended.
- :param bool enable_split_tunneling: (optional) Indicates whether the split
- tunneling is enabled on this VPN server.
- :param str name: (optional) The name for this VPN server. The name must not
- be used by another VPN server in the VPC.
- :param int port: (optional) The port number used by this VPN server.
- :param str protocol: (optional) The transport protocol used by this VPN
- server.
- :param List[SubnetIdentity] subnets: (optional) The subnets to provision
- this VPN server in (replacing the existing subnets).
- """
- self.certificate = certificate
- self.client_authentication = client_authentication
- self.client_dns_server_ips = client_dns_server_ips
- self.client_idle_timeout = client_idle_timeout
- self.client_ip_pool = client_ip_pool
- self.enable_split_tunneling = enable_split_tunneling
- self.name = name
- self.port = port
- self.protocol = protocol
- self.subnets = subnets
-
- @classmethod
- def from_dict(cls, _dict: Dict) -> 'VPNServerPatch':
- """Initialize a VPNServerPatch object from a json dictionary."""
- args = {}
- if 'certificate' in _dict:
- args['certificate'] = _dict.get('certificate')
- if 'client_authentication' in _dict:
- args['client_authentication'] = [VPNServerAuthenticationPrototype.from_dict(v) for v in _dict.get('client_authentication')]
- if 'client_dns_server_ips' in _dict:
- args['client_dns_server_ips'] = [IP.from_dict(v) for v in _dict.get('client_dns_server_ips')]
- if 'client_idle_timeout' in _dict:
- args['client_idle_timeout'] = _dict.get('client_idle_timeout')
- if 'client_ip_pool' in _dict:
- args['client_ip_pool'] = _dict.get('client_ip_pool')
- if 'enable_split_tunneling' in _dict:
- args['enable_split_tunneling'] = _dict.get('enable_split_tunneling')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
- if 'port' in _dict:
- args['port'] = _dict.get('port')
- if 'protocol' in _dict:
- args['protocol'] = _dict.get('protocol')
- if 'subnets' in _dict:
- args['subnets'] = _dict.get('subnets')
- return cls(**args)
-
- @classmethod
- def _from_dict(cls, _dict):
- """Initialize a VPNServerPatch object from a json dictionary."""
- return cls.from_dict(_dict)
-
- def to_dict(self) -> Dict:
- """Return a json dictionary representing this model."""
- _dict = {}
- if hasattr(self, 'certificate') and self.certificate is not None:
- if isinstance(self.certificate, dict):
- _dict['certificate'] = self.certificate
- else:
- _dict['certificate'] = self.certificate.to_dict()
- if hasattr(self, 'client_authentication') and self.client_authentication is not None:
- client_authentication_list = []
- for v in self.client_authentication:
- if isinstance(v, dict):
- client_authentication_list.append(v)
- else:
- client_authentication_list.append(v.to_dict())
- _dict['client_authentication'] = client_authentication_list
- if hasattr(self, 'client_dns_server_ips') and self.client_dns_server_ips is not None:
- client_dns_server_ips_list = []
- for v in self.client_dns_server_ips:
- if isinstance(v, dict):
- client_dns_server_ips_list.append(v)
- else:
- client_dns_server_ips_list.append(v.to_dict())
- _dict['client_dns_server_ips'] = client_dns_server_ips_list
- if hasattr(self, 'client_idle_timeout') and self.client_idle_timeout is not None:
- _dict['client_idle_timeout'] = self.client_idle_timeout
- if hasattr(self, 'client_ip_pool') and self.client_ip_pool is not None:
- _dict['client_ip_pool'] = self.client_ip_pool
- if hasattr(self, 'enable_split_tunneling') and self.enable_split_tunneling is not None:
- _dict['enable_split_tunneling'] = self.enable_split_tunneling
- if hasattr(self, 'name') and self.name is not None:
- _dict['name'] = self.name
- if hasattr(self, 'port') and self.port is not None:
- _dict['port'] = self.port
- if hasattr(self, 'protocol') and self.protocol is not None:
- _dict['protocol'] = self.protocol
- if hasattr(self, 'subnets') and self.subnets is not None:
- subnets_list = []
- for v in self.subnets:
- if isinstance(v, dict):
- subnets_list.append(v)
- else:
- subnets_list.append(v.to_dict())
- _dict['subnets'] = subnets_list
- return _dict
-
- def _to_dict(self):
- """Return a json dictionary representing this model."""
- return self.to_dict()
-
- def __str__(self) -> str:
- """Return a `str` version of this VPNServerPatch object."""
- return json.dumps(self.to_dict(), indent=2)
-
- def __eq__(self, other: 'VPNServerPatch') -> bool:
- """Return `true` when self and other are equal, false otherwise."""
- if not isinstance(other, self.__class__):
- return False
- return self.__dict__ == other.__dict__
-
- def __ne__(self, other: 'VPNServerPatch') -> bool:
- """Return `true` when self and other are not equal, false otherwise."""
- return not self == other
-
- class ProtocolEnum(str, Enum):
- """
- The transport protocol used by this VPN server.
- """
-
- TCP = 'tcp'
- UDP = 'udp'
-
-
-
-class VPNServerReferenceDeleted:
- """
- 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 VPNServerReferenceDeleted object.
-
- :param str more_info: Link to documentation about deleted resources.
- """
- self.more_info = more_info
-
- @classmethod
- def from_dict(cls, _dict: Dict) -> 'VPNServerReferenceDeleted':
- """Initialize a VPNServerReferenceDeleted object from a json dictionary."""
- args = {}
- if 'more_info' in _dict:
- args['more_info'] = _dict.get('more_info')
- else:
- raise ValueError('Required property \'more_info\' not present in VPNServerReferenceDeleted JSON')
- return cls(**args)
-
- @classmethod
- def _from_dict(cls, _dict):
- """Initialize a VPNServerReferenceDeleted object from a json dictionary."""
- return cls.from_dict(_dict)
-
- def to_dict(self) -> Dict:
- """Return a json dictionary representing this model."""
- _dict = {}
- if hasattr(self, '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 VPNServerReferenceDeleted object."""
- return json.dumps(self.to_dict(), indent=2)
-
- def __eq__(self, other: 'VPNServerReferenceDeleted') -> bool:
- """Return `true` when self and other are equal, false otherwise."""
- if not isinstance(other, self.__class__):
- return False
- return self.__dict__ == other.__dict__
-
- def __ne__(self, other: 'VPNServerReferenceDeleted') -> bool:
- """Return `true` when self and other are not equal, false otherwise."""
- return not self == other
-
-
-class VPNServerRoute:
- """
- VPNServerRoute.
-
- :attr str action: The action to perform with a packet matching the VPN route:
- - `translate`: translate the source IP address to one of the private IP
- addresses of the VPN server.
- - `deliver`: deliver the packet into the VPC.
- - `drop`: drop the packet
- The enumerated values for this property are expected to expand in the future.
- When processing this property, check for and log unknown values. Optionally halt
- processing and surface the error, or bypass the VPN route on which the
- unexpected property value was encountered.
- :attr datetime created_at: The date and time that the VPN route was created.
- :attr str destination: The destination for this VPN route in the VPN server. If
- an incoming packet does not match any destination, it will be dropped.
- :attr List[VPNServerRouteHealthReason] health_reasons: The reasons for the
- current VPN server route health_state (if any):
- - `internal_error`: Internal error (contact IBM support)
- The enumerated reason code values for this property will expand in the future.
- When processing this property, check for and log unknown values. Optionally halt
- processing and surface the error, or bypass the resource on which the unexpected
- reason code was encountered.
- :attr str health_state: The health of this resource.
- - `ok`: No abnormal behavior detected
- - `degraded`: Experiencing compromised performance, capacity, or connectivity
- - `faulted`: Completely unreachable, inoperative, or otherwise entirely
- incapacitated
- - `inapplicable`: The health state does not apply because of the current
- lifecycle state. A resource with a lifecycle state of `failed` or `deleting`
- will have a health state of `inapplicable`. A `pending` resource may also have
- this state.
- :attr str href: The URL for this VPN route.
- :attr str id: The unique identifier for this VPN route.
- :attr List[VPNServerRouteLifecycleReason] lifecycle_reasons: The reasons for the
- current VPN server route lifecycle_state (if any):
- - `resource_suspended_by_provider`: The resource has been suspended (contact IBM
- support)
- The enumerated reason code values for this property will expand in the future.
- When processing this property, check for and log unknown values. Optionally halt
- processing and surface the error, or bypass the resource on which the unexpected
- reason code was encountered.
- :attr str lifecycle_state: The lifecycle state of the VPN route.
- :attr str name: The name for this VPN route. The name is unique across all
- routes for a VPN server.
- :attr str resource_type: The resource type.
- """
-
- def __init__(
- self,
- action: str,
- created_at: datetime,
- destination: str,
- health_reasons: List['VPNServerRouteHealthReason'],
- health_state: str,
- href: str,
- id: str,
- lifecycle_reasons: List['VPNServerRouteLifecycleReason'],
- lifecycle_state: str,
- name: str,
- resource_type: str,
- ) -> None:
- """
- Initialize a VPNServerRoute object.
-
- :param str action: The action to perform with a packet matching the VPN
- route:
- - `translate`: translate the source IP address to one of the private IP
- addresses of the VPN server.
- - `deliver`: deliver the packet into the VPC.
- - `drop`: drop the packet
- The enumerated values for this property are expected to expand in the
- future. When processing this property, check for and log unknown values.
- Optionally halt processing and surface the error, or bypass the VPN route
- on which the unexpected property value was encountered.
- :param datetime created_at: The date and time that the VPN route was
- created.
- :param str destination: The destination for this VPN route in the VPN
- server. If an incoming packet does not match any destination, it will be
- dropped.
- :param List[VPNServerRouteHealthReason] health_reasons: The reasons for the
- current VPN server route health_state (if any):
- - `internal_error`: Internal error (contact IBM support)
- 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 bool classic_access: Indicates whether this VPC is connected to
+ Classic Infrastructure. If true, this VPC's resources have private network
+ connectivity to the account's Classic Infrastructure resources. Only one
+ VPC, per region, may be connected in this way. This value is set at
+ creation and subsequently immutable.
+ :param datetime created_at: The date and time that the VPC was created.
+ :param str crn: The CRN for this VPC.
+ :param NetworkACLReference default_network_acl: The default network ACL to
+ use for subnets created in this VPC.
+ :param RoutingTableReference default_routing_table: The default routing
+ table to use for subnets created in this VPC.
+ :param SecurityGroupReference default_security_group: The default security
+ group for this VPC. Resources created in this VPC that allow
+ a security group to be optionally specified will use this security group by
+ default.
+ :param VPCDNS dns: The DNS configuration for this VPC.
:param str health_state: The health of this resource.
- `ok`: No abnormal behavior detected
- `degraded`: Experiencing compromised performance, capacity, or
@@ -81688,98 +83977,151 @@ def __init__(
lifecycle state. A resource with a lifecycle state of `failed` or
`deleting` will have a health state of `inapplicable`. A `pending` resource
may also have this state.
- :param str href: The URL for this VPN route.
- :param str id: The unique identifier for this VPN route.
- :param List[VPNServerRouteLifecycleReason] lifecycle_reasons: The reasons
- for the current VPN server route lifecycle_state (if any):
- - `resource_suspended_by_provider`: The resource has been suspended
- (contact IBM
- support)
+ :param str href: The URL for this VPC.
+ :param str id: The unique identifier for this VPC.
+ :param str name: The name for this VPC. The name is unique across all VPCs
+ in the region.
+ :param ResourceGroupReference resource_group: The resource group for this
+ VPC.
+ :param str resource_type: The resource type.
+ :param str status: The status of this VPC.
+ :param List[VPCCSESourceIP] cse_source_ips: (optional) The CSE ([Cloud
+ Service
+ Endpoint](https://cloud.ibm.com/docs/resources?topic=resources-service-endpoints))
+ source IP addresses for the VPC. The VPC will have one CSE source IP
+ address per zone.
+ :param List[VPCHealthReason] health_reasons: (optional) The reasons for the
+ current `health_state` (if any).
The enumerated reason code values for this property will expand in the
future. When processing this property, check for and log unknown values.
Optionally halt processing and surface the error, or bypass the resource on
which the unexpected reason code was encountered.
- :param str lifecycle_state: The lifecycle state of the VPN route.
- :param str name: The name for this VPN route. The name is unique across all
- routes for a VPN server.
- :param str resource_type: The resource type.
"""
- self.action = action
+ self.classic_access = classic_access
self.created_at = created_at
- self.destination = destination
+ 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.dns = dns
self.health_reasons = health_reasons
self.health_state = health_state
self.href = href
self.id = id
- self.lifecycle_reasons = lifecycle_reasons
- self.lifecycle_state = lifecycle_state
self.name = name
+ self.resource_group = resource_group
self.resource_type = resource_type
+ self.status = status
@classmethod
- def from_dict(cls, _dict: Dict) -> 'VPNServerRoute':
- """Initialize a VPNServerRoute object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VPC':
+ """Initialize a VPC object from a json dictionary."""
args = {}
- if 'action' in _dict:
- args['action'] = _dict.get('action')
+ if (classic_access := _dict.get('classic_access')) is not None:
+ args['classic_access'] = classic_access
else:
- raise ValueError('Required property \'action\' not present in VPNServerRoute JSON')
- if 'created_at' in _dict:
- args['created_at'] = string_to_datetime(_dict.get('created_at'))
+ raise ValueError('Required property \'classic_access\' not present in VPC JSON')
+ if (created_at := _dict.get('created_at')) is not None:
+ args['created_at'] = string_to_datetime(created_at)
else:
- raise ValueError('Required property \'created_at\' not present in VPNServerRoute JSON')
- if 'destination' in _dict:
- args['destination'] = _dict.get('destination')
+ raise ValueError('Required property \'created_at\' not present in VPC JSON')
+ if (crn := _dict.get('crn')) is not None:
+ args['crn'] = crn
else:
- raise ValueError('Required property \'destination\' not present in VPNServerRoute JSON')
- if 'health_reasons' in _dict:
- args['health_reasons'] = [VPNServerRouteHealthReason.from_dict(v) for v in _dict.get('health_reasons')]
+ raise ValueError('Required property \'crn\' not present in VPC JSON')
+ if (cse_source_ips := _dict.get('cse_source_ips')) is not None:
+ args['cse_source_ips'] = [VPCCSESourceIP.from_dict(v) for v in cse_source_ips]
+ if (default_network_acl := _dict.get('default_network_acl')) is not None:
+ args['default_network_acl'] = NetworkACLReference.from_dict(default_network_acl)
else:
- raise ValueError('Required property \'health_reasons\' not present in VPNServerRoute JSON')
- if 'health_state' in _dict:
- args['health_state'] = _dict.get('health_state')
+ raise ValueError('Required property \'default_network_acl\' not present in VPC JSON')
+ if (default_routing_table := _dict.get('default_routing_table')) is not None:
+ args['default_routing_table'] = RoutingTableReference.from_dict(default_routing_table)
else:
- raise ValueError('Required property \'health_state\' not present in VPNServerRoute JSON')
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ raise ValueError('Required property \'default_routing_table\' not present in VPC JSON')
+ if (default_security_group := _dict.get('default_security_group')) is not None:
+ args['default_security_group'] = SecurityGroupReference.from_dict(default_security_group)
else:
- raise ValueError('Required property \'href\' not present in VPNServerRoute JSON')
- if 'id' in _dict:
- args['id'] = _dict.get('id')
+ raise ValueError('Required property \'default_security_group\' not present in VPC JSON')
+ if (dns := _dict.get('dns')) is not None:
+ args['dns'] = VPCDNS.from_dict(dns)
else:
- raise ValueError('Required property \'id\' not present in VPNServerRoute JSON')
- if 'lifecycle_reasons' in _dict:
- args['lifecycle_reasons'] = [VPNServerRouteLifecycleReason.from_dict(v) for v in _dict.get('lifecycle_reasons')]
+ raise ValueError('Required property \'dns\' not present in VPC JSON')
+ if (health_reasons := _dict.get('health_reasons')) is not None:
+ args['health_reasons'] = [VPCHealthReason.from_dict(v) for v in health_reasons]
+ if (health_state := _dict.get('health_state')) is not None:
+ args['health_state'] = health_state
else:
- raise ValueError('Required property \'lifecycle_reasons\' not present in VPNServerRoute JSON')
- if 'lifecycle_state' in _dict:
- args['lifecycle_state'] = _dict.get('lifecycle_state')
+ raise ValueError('Required property \'health_state\' not present in VPC JSON')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'lifecycle_state\' not present in VPNServerRoute JSON')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
+ raise ValueError('Required property \'href\' not present in VPC JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
else:
- raise ValueError('Required property \'name\' not present in VPNServerRoute JSON')
- if 'resource_type' in _dict:
- args['resource_type'] = _dict.get('resource_type')
+ raise ValueError('Required property \'id\' not present in VPC JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
else:
- raise ValueError('Required property \'resource_type\' not present in VPNServerRoute JSON')
+ raise ValueError('Required property \'name\' not present in VPC JSON')
+ if (resource_group := _dict.get('resource_group')) is not None:
+ args['resource_group'] = ResourceGroupReference.from_dict(resource_group)
+ else:
+ raise ValueError('Required property \'resource_group\' not present in VPC JSON')
+ if (resource_type := _dict.get('resource_type')) is not None:
+ args['resource_type'] = resource_type
+ else:
+ raise ValueError('Required property \'resource_type\' not present in VPC JSON')
+ if (status := _dict.get('status')) is not None:
+ args['status'] = status
+ else:
+ raise ValueError('Required property \'status\' not present in VPC JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VPNServerRoute 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, 'action') and self.action is not None:
- _dict['action'] = self.action
+ 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, '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, 'cse_source_ips') and self.cse_source_ips is not None:
+ cse_source_ips_list = []
+ for v in self.cse_source_ips:
+ if isinstance(v, dict):
+ cse_source_ips_list.append(v)
+ else:
+ cse_source_ips_list.append(v.to_dict())
+ _dict['cse_source_ips'] = cse_source_ips_list
+ if hasattr(self, 'default_network_acl') and self.default_network_acl is not None:
+ if isinstance(self.default_network_acl, dict):
+ _dict['default_network_acl'] = self.default_network_acl
+ else:
+ _dict['default_network_acl'] = self.default_network_acl.to_dict()
+ if hasattr(self, 'default_routing_table') and self.default_routing_table is not None:
+ if isinstance(self.default_routing_table, dict):
+ _dict['default_routing_table'] = self.default_routing_table
+ else:
+ _dict['default_routing_table'] = self.default_routing_table.to_dict()
+ if hasattr(self, 'default_security_group') and self.default_security_group is not None:
+ if isinstance(self.default_security_group, dict):
+ _dict['default_security_group'] = self.default_security_group
+ else:
+ _dict['default_security_group'] = self.default_security_group.to_dict()
+ if hasattr(self, 'dns') and self.dns is not None:
+ if isinstance(self.dns, dict):
+ _dict['dns'] = self.dns
+ else:
+ _dict['dns'] = self.dns.to_dict()
if hasattr(self, 'health_reasons') and self.health_reasons is not None:
health_reasons_list = []
for v in self.health_reasons:
@@ -81794,20 +84136,17 @@ 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_reasons') and self.lifecycle_reasons is not None:
- lifecycle_reasons_list = []
- for v in self.lifecycle_reasons:
- if isinstance(v, dict):
- lifecycle_reasons_list.append(v)
- else:
- lifecycle_reasons_list.append(v.to_dict())
- _dict['lifecycle_reasons'] = lifecycle_reasons_list
- if hasattr(self, 'lifecycle_state') and self.lifecycle_state is not None:
- _dict['lifecycle_state'] = self.lifecycle_state
if hasattr(self, 'name') and self.name is not None:
_dict['name'] = self.name
+ if hasattr(self, 'resource_group') and self.resource_group is not None:
+ if isinstance(self.resource_group, dict):
+ _dict['resource_group'] = self.resource_group
+ else:
+ _dict['resource_group'] = self.resource_group.to_dict()
if hasattr(self, 'resource_type') and self.resource_type is not None:
_dict['resource_type'] = self.resource_type
+ if hasattr(self, 'status') and self.status is not None:
+ _dict['status'] = self.status
return _dict
def _to_dict(self):
@@ -81815,37 +84154,19 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this VPNServerRoute object."""
+ """Return a `str` version of this VPC object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VPNServerRoute') -> 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: 'VPNServerRoute') -> bool:
+ def __ne__(self, other: 'VPC') -> 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 VPN route:
- - `translate`: translate the source IP address to one of the private IP addresses
- of the VPN server.
- - `deliver`: deliver the packet into the VPC.
- - `drop`: drop the packet
- The enumerated values for this property are expected to expand in the future. When
- processing this property, check for and log unknown values. Optionally halt
- processing and surface the error, or bypass the VPN route on which the unexpected
- property value was encountered.
- """
-
- DELIVER = 'deliver'
- DROP = 'drop'
- TRANSLATE = 'translate'
-
-
class HealthStateEnum(str, Enum):
"""
The health of this resource.
@@ -81864,126 +84185,198 @@ class HealthStateEnum(str, Enum):
OK = 'ok'
- class LifecycleStateEnum(str, Enum):
+ class ResourceTypeEnum(str, Enum):
"""
- The lifecycle state of the VPN route.
+ The resource type.
"""
- DELETING = 'deleting'
- FAILED = 'failed'
- PENDING = 'pending'
- STABLE = 'stable'
- SUSPENDED = 'suspended'
- UPDATING = 'updating'
- WAITING = 'waiting'
+ VPC = 'vpc'
- class ResourceTypeEnum(str, Enum):
+ class StatusEnum(str, Enum):
"""
- The resource type.
+ The status of this VPC.
"""
- VPN_SERVER_ROUTE = 'vpn_server_route'
+ AVAILABLE = 'available'
+ DELETING = 'deleting'
+ FAILED = 'failed'
+ PENDING = 'pending'
-class VPNServerRouteCollection:
+class VPCCSESourceIP:
"""
- VPNServerRouteCollection.
+ VPCCSESourceIP.
- :attr VPNServerRouteCollectionFirst first: A link to the first page of
- resources.
- :attr int limit: The maximum number of resources that can be returned by the
- request.
- :attr VPNServerRouteCollectionNext next: (optional) A link to the next page of
- resources. This property is present for all pages
- except the last page.
- :attr List[VPNServerRoute] routes: Collection of VPN routes.
- :attr int total_count: The total number of resources across all pages.
+ :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.
"""
def __init__(
self,
- first: 'VPNServerRouteCollectionFirst',
- limit: int,
- routes: List['VPNServerRoute'],
- total_count: int,
- *,
- next: 'VPNServerRouteCollectionNext' = None,
+ ip: 'IP',
+ zone: 'ZoneReference',
) -> None:
"""
- Initialize a VPNServerRouteCollection object.
+ Initialize a VPCCSESourceIP object.
- :param VPNServerRouteCollectionFirst first: A link to the first page of
- resources.
- :param int limit: The maximum number of resources that can be returned by
- the request.
- :param List[VPNServerRoute] routes: Collection of VPN routes.
- :param int total_count: The total number of resources across all pages.
- :param VPNServerRouteCollectionNext next: (optional) A link to the next
- page of resources. This property is present for all pages
- except the last page.
+ :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.
"""
- self.first = first
- self.limit = limit
- self.next = next
- self.routes = routes
- self.total_count = total_count
+ self.ip = ip
+ self.zone = zone
@classmethod
- def from_dict(cls, _dict: Dict) -> 'VPNServerRouteCollection':
- """Initialize a VPNServerRouteCollection object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VPCCSESourceIP':
+ """Initialize a VPCCSESourceIP object from a json dictionary."""
args = {}
- if 'first' in _dict:
- args['first'] = VPNServerRouteCollectionFirst.from_dict(_dict.get('first'))
- else:
- raise ValueError('Required property \'first\' not present in VPNServerRouteCollection JSON')
- if 'limit' in _dict:
- args['limit'] = _dict.get('limit')
+ if (ip := _dict.get('ip')) is not None:
+ args['ip'] = IP.from_dict(ip)
else:
- raise ValueError('Required property \'limit\' not present in VPNServerRouteCollection JSON')
- if 'next' in _dict:
- args['next'] = VPNServerRouteCollectionNext.from_dict(_dict.get('next'))
- if 'routes' in _dict:
- args['routes'] = [VPNServerRoute.from_dict(v) for v in _dict.get('routes')]
- else:
- raise ValueError('Required property \'routes\' not present in VPNServerRouteCollection JSON')
- if 'total_count' in _dict:
- args['total_count'] = _dict.get('total_count')
+ raise ValueError('Required property \'ip\' not present in VPCCSESourceIP JSON')
+ if (zone := _dict.get('zone')) is not None:
+ args['zone'] = ZoneReference.from_dict(zone)
else:
- raise ValueError('Required property \'total_count\' not present in VPNServerRouteCollection JSON')
+ raise ValueError('Required property \'zone\' not present in VPCCSESourceIP JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VPNServerRouteCollection object from a json dictionary."""
+ """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, 'first') and self.first is not None:
- if isinstance(self.first, dict):
- _dict['first'] = self.first
+ if hasattr(self, 'ip') and self.ip is not None:
+ if isinstance(self.ip, dict):
+ _dict['ip'] = self.ip
else:
- _dict['first'] = self.first.to_dict()
- if hasattr(self, 'limit') and self.limit is not None:
- _dict['limit'] = self.limit
- if hasattr(self, 'next') and self.next is not None:
- if isinstance(self.next, dict):
- _dict['next'] = self.next
+ _dict['ip'] = self.ip.to_dict()
+ if hasattr(self, 'zone') and self.zone is not None:
+ if isinstance(self.zone, dict):
+ _dict['zone'] = self.zone
+ else:
+ _dict['zone'] = self.zone.to_dict()
+ return _dict
+
+ def _to_dict(self):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
+
+ def __str__(self) -> str:
+ """Return a `str` version of this VPCCSESourceIP object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'VPCCSESourceIP') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'VPCCSESourceIP') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+
+class VPCCollection:
+ """
+ VPCCollection.
+
+ :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 VPCCollectionNext next: (optional) A link to the next page of resources.
+ This property is present for all pages
+ except the last page.
+ :param int total_count: The total number of resources across all pages.
+ :param List[VPC] vpcs: Collection of VPCs.
+ """
+
+ def __init__(
+ self,
+ first: 'VPCCollectionFirst',
+ limit: int,
+ total_count: int,
+ vpcs: List['VPC'],
+ *,
+ next: Optional['VPCCollectionNext'] = None,
+ ) -> None:
+ """
+ Initialize a VPCCollection object.
+
+ :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 int total_count: The total number of resources across all pages.
+ :param List[VPC] vpcs: Collection of VPCs.
+ :param VPCCollectionNext next: (optional) A link to the next page of
+ resources. This property is present for all pages
+ except the last page.
+ """
+ self.first = first
+ self.limit = limit
+ self.next = next
+ self.total_count = total_count
+ self.vpcs = vpcs
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'VPCCollection':
+ """Initialize a VPCCollection object from a json dictionary."""
+ args = {}
+ if (first := _dict.get('first')) is not None:
+ args['first'] = VPCCollectionFirst.from_dict(first)
+ else:
+ raise ValueError('Required property \'first\' not present in VPCCollection JSON')
+ if (limit := _dict.get('limit')) is not None:
+ args['limit'] = limit
+ else:
+ raise ValueError('Required property \'limit\' not present in VPCCollection JSON')
+ if (next := _dict.get('next')) is not None:
+ args['next'] = VPCCollectionNext.from_dict(next)
+ if (total_count := _dict.get('total_count')) is not None:
+ args['total_count'] = total_count
+ else:
+ raise ValueError('Required property \'total_count\' not present in VPCCollection JSON')
+ if (vpcs := _dict.get('vpcs')) is not None:
+ args['vpcs'] = [VPC.from_dict(v) for v in vpcs]
+ else:
+ raise ValueError('Required property \'vpcs\' not present in VPCCollection JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a VPCCollection object from a json dictionary."""
+ return cls.from_dict(_dict)
+
+ def to_dict(self) -> Dict:
+ """Return a json dictionary representing this model."""
+ _dict = {}
+ if hasattr(self, 'first') and self.first is not None:
+ if isinstance(self.first, dict):
+ _dict['first'] = self.first
+ else:
+ _dict['first'] = self.first.to_dict()
+ if hasattr(self, 'limit') and self.limit is not None:
+ _dict['limit'] = self.limit
+ if hasattr(self, 'next') and self.next is not None:
+ if isinstance(self.next, dict):
+ _dict['next'] = self.next
else:
_dict['next'] = self.next.to_dict()
- if hasattr(self, 'routes') and self.routes is not None:
- routes_list = []
- for v in self.routes:
- if isinstance(v, dict):
- routes_list.append(v)
- else:
- routes_list.append(v.to_dict())
- _dict['routes'] = routes_list
if hasattr(self, 'total_count') and self.total_count is not None:
_dict['total_count'] = self.total_count
+ if hasattr(self, 'vpcs') and self.vpcs is not None:
+ vpcs_list = []
+ for v in self.vpcs:
+ if isinstance(v, dict):
+ vpcs_list.append(v)
+ else:
+ vpcs_list.append(v.to_dict())
+ _dict['vpcs'] = vpcs_list
return _dict
def _to_dict(self):
@@ -81991,25 +84384,25 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this VPNServerRouteCollection object."""
+ """Return a `str` version of this VPCCollection object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VPNServerRouteCollection') -> 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: 'VPNServerRouteCollection') -> bool:
+ def __ne__(self, other: 'VPCCollection') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class VPNServerRouteCollectionFirst:
+class VPCCollectionFirst:
"""
A link to the first page of resources.
- :attr str href: The URL for a page of resources.
+ :param str href: The URL for a page of resources.
"""
def __init__(
@@ -82017,25 +84410,25 @@ def __init__(
href: str,
) -> None:
"""
- Initialize a VPNServerRouteCollectionFirst 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) -> 'VPNServerRouteCollectionFirst':
- """Initialize a VPNServerRouteCollectionFirst 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')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'href\' not present in VPNServerRouteCollectionFirst JSON')
+ raise ValueError('Required property \'href\' not present in VPCCollectionFirst JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VPNServerRouteCollectionFirst object from a json dictionary."""
+ """Initialize a VPCCollectionFirst object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -82050,26 +84443,26 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this VPNServerRouteCollectionFirst object."""
+ """Return a `str` version of this VPCCollectionFirst object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VPNServerRouteCollectionFirst') -> 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: 'VPNServerRouteCollectionFirst') -> bool:
+ def __ne__(self, other: 'VPCCollectionFirst') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class VPNServerRouteCollectionNext:
+class VPCCollectionNext:
"""
A link to the next page of resources. This property is present for all pages except
the last page.
- :attr str href: The URL for a page of resources.
+ :param str href: The URL for a page of resources.
"""
def __init__(
@@ -82077,25 +84470,25 @@ def __init__(
href: str,
) -> None:
"""
- Initialize a VPNServerRouteCollectionNext 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) -> 'VPNServerRouteCollectionNext':
- """Initialize a VPNServerRouteCollectionNext 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')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'href\' not present in VPNServerRouteCollectionNext JSON')
+ raise ValueError('Required property \'href\' not present in VPCCollectionNext JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VPNServerRouteCollectionNext object from a json dictionary."""
+ """Initialize a VPCCollectionNext object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -82110,81 +84503,85 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this VPNServerRouteCollectionNext object."""
+ """Return a `str` version of this VPCCollectionNext object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VPNServerRouteCollectionNext') -> 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: 'VPNServerRouteCollectionNext') -> bool:
+ def __ne__(self, other: 'VPCCollectionNext') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class VPNServerRouteHealthReason:
+class VPCDNS:
"""
- VPNServerRouteHealthReason.
+ The DNS configuration for this VPC.
- :attr str code: A snake case string succinctly identifying the reason for this
- health state.
- :attr str message: An explanation of the reason for this health state.
- :attr str more_info: (optional) Link to documentation about the reason for this
- health state.
+ :param bool enable_hub: Indicates whether this VPC is enabled as a DNS name
+ resolution hub.
+ :param int resolution_binding_count: The number of DNS resolution bindings for
+ this VPC.
+ :param VPCDNSResolver resolver: The DNS resolver configuration for the VPC.
"""
def __init__(
self,
- code: str,
- message: str,
- *,
- more_info: str = None,
+ enable_hub: bool,
+ resolution_binding_count: int,
+ resolver: 'VPCDNSResolver',
) -> None:
"""
- Initialize a VPNServerRouteHealthReason object.
+ Initialize a VPCDNS object.
- :param str code: A snake case string succinctly identifying the reason for
- this health state.
- :param str message: An explanation of the reason for this health state.
- :param str more_info: (optional) Link to documentation about the reason for
- this health state.
+ :param bool enable_hub: Indicates whether this VPC is enabled as a DNS name
+ resolution hub.
+ :param int resolution_binding_count: The number of DNS resolution bindings
+ for this VPC.
+ :param VPCDNSResolver resolver: The DNS resolver configuration for the VPC.
"""
- self.code = code
- self.message = message
- self.more_info = more_info
+ self.enable_hub = enable_hub
+ self.resolution_binding_count = resolution_binding_count
+ self.resolver = resolver
@classmethod
- def from_dict(cls, _dict: Dict) -> 'VPNServerRouteHealthReason':
- """Initialize a VPNServerRouteHealthReason object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VPCDNS':
+ """Initialize a VPCDNS object from a json dictionary."""
args = {}
- if 'code' in _dict:
- args['code'] = _dict.get('code')
+ if (enable_hub := _dict.get('enable_hub')) is not None:
+ args['enable_hub'] = enable_hub
else:
- raise ValueError('Required property \'code\' not present in VPNServerRouteHealthReason JSON')
- if 'message' in _dict:
- args['message'] = _dict.get('message')
+ raise ValueError('Required property \'enable_hub\' not present in VPCDNS JSON')
+ if (resolution_binding_count := _dict.get('resolution_binding_count')) is not None:
+ args['resolution_binding_count'] = resolution_binding_count
else:
- raise ValueError('Required property \'message\' not present in VPNServerRouteHealthReason JSON')
- if 'more_info' in _dict:
- args['more_info'] = _dict.get('more_info')
+ raise ValueError('Required property \'resolution_binding_count\' not present in VPCDNS JSON')
+ if (resolver := _dict.get('resolver')) is not None:
+ args['resolver'] = resolver
+ else:
+ raise ValueError('Required property \'resolver\' not present in VPCDNS JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VPNServerRouteHealthReason object from a json dictionary."""
+ """Initialize a VPCDNS object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'code') and self.code is not None:
- _dict['code'] = self.code
- if hasattr(self, 'message') and self.message is not None:
- _dict['message'] = self.message
- if hasattr(self, 'more_info') and self.more_info is not None:
- _dict['more_info'] = self.more_info
+ if hasattr(self, 'enable_hub') and self.enable_hub is not None:
+ _dict['enable_hub'] = self.enable_hub
+ if hasattr(self, 'resolution_binding_count') and self.resolution_binding_count is not None:
+ _dict['resolution_binding_count'] = self.resolution_binding_count
+ if hasattr(self, 'resolver') and self.resolver is not None:
+ if isinstance(self.resolver, dict):
+ _dict['resolver'] = self.resolver
+ else:
+ _dict['resolver'] = self.resolver.to_dict()
return _dict
def _to_dict(self):
@@ -82192,89 +84589,76 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this VPNServerRouteHealthReason object."""
+ """Return a `str` version of this VPCDNS object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VPNServerRouteHealthReason') -> bool:
+ def __eq__(self, other: 'VPCDNS') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'VPNServerRouteHealthReason') -> bool:
+ def __ne__(self, other: 'VPCDNS') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class CodeEnum(str, Enum):
- """
- A snake case string succinctly identifying the reason for this health state.
- """
-
- INTERNAL_ERROR = 'internal_error'
-
-
-class VPNServerRouteLifecycleReason:
+class VPCDNSPatch:
"""
- VPNServerRouteLifecycleReason.
+ The DNS configuration for this VPC.
- :attr str code: A snake case string succinctly identifying the reason for this
- lifecycle state.
- :attr str message: An explanation of the reason for this lifecycle state.
- :attr str more_info: (optional) Link to documentation about the reason for this
- lifecycle state.
+ :param bool enable_hub: (optional) Indicates whether this VPC is enabled as a
+ DNS name resolution hub.
+ Updating the value to `true` requires `allow_dns_resolution_binding` to be
+ `true` for all endpoint gateways residing in this VPC.
+ Changing the value requires `dns.resolution_binding_count` to be zero.
+ :param VPCDNSResolverPatch resolver: (optional)
"""
def __init__(
self,
- code: str,
- message: str,
*,
- more_info: str = None,
+ enable_hub: Optional[bool] = None,
+ resolver: Optional['VPCDNSResolverPatch'] = None,
) -> None:
"""
- Initialize a VPNServerRouteLifecycleReason object.
+ Initialize a VPCDNSPatch object.
- :param str code: A snake case string succinctly identifying the reason for
- this lifecycle state.
- :param str message: An explanation of the reason for this lifecycle state.
- :param str more_info: (optional) Link to documentation about the reason for
- this lifecycle state.
+ :param bool enable_hub: (optional) Indicates whether this VPC is enabled as
+ a DNS name resolution hub.
+ Updating the value to `true` requires `allow_dns_resolution_binding` to be
+ `true` for all endpoint gateways residing in this VPC.
+ Changing the value requires `dns.resolution_binding_count` to be zero.
+ :param VPCDNSResolverPatch resolver: (optional)
"""
- self.code = code
- self.message = message
- self.more_info = more_info
+ self.enable_hub = enable_hub
+ self.resolver = resolver
@classmethod
- def from_dict(cls, _dict: Dict) -> 'VPNServerRouteLifecycleReason':
- """Initialize a VPNServerRouteLifecycleReason object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VPCDNSPatch':
+ """Initialize a VPCDNSPatch object from a json dictionary."""
args = {}
- if 'code' in _dict:
- args['code'] = _dict.get('code')
- else:
- raise ValueError('Required property \'code\' not present in VPNServerRouteLifecycleReason JSON')
- if 'message' in _dict:
- args['message'] = _dict.get('message')
- else:
- raise ValueError('Required property \'message\' not present in VPNServerRouteLifecycleReason JSON')
- if 'more_info' in _dict:
- args['more_info'] = _dict.get('more_info')
+ if (enable_hub := _dict.get('enable_hub')) is not None:
+ args['enable_hub'] = enable_hub
+ if (resolver := _dict.get('resolver')) is not None:
+ args['resolver'] = VPCDNSResolverPatch.from_dict(resolver)
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VPNServerRouteLifecycleReason object from a json dictionary."""
+ """Initialize a VPCDNSPatch object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'code') and self.code is not None:
- _dict['code'] = self.code
- if hasattr(self, 'message') and self.message is not None:
- _dict['message'] = self.message
- if hasattr(self, 'more_info') and self.more_info is not None:
- _dict['more_info'] = self.more_info
+ if hasattr(self, 'enable_hub') and self.enable_hub is not None:
+ _dict['enable_hub'] = self.enable_hub
+ if hasattr(self, 'resolver') and self.resolver is not None:
+ if isinstance(self.resolver, dict):
+ _dict['resolver'] = self.resolver
+ else:
+ _dict['resolver'] = self.resolver.to_dict()
return _dict
def _to_dict(self):
@@ -82282,67 +84666,72 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this VPNServerRouteLifecycleReason object."""
+ """Return a `str` version of this VPCDNSPatch object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VPNServerRouteLifecycleReason') -> bool:
+ def __eq__(self, other: 'VPCDNSPatch') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'VPNServerRouteLifecycleReason') -> bool:
+ def __ne__(self, other: 'VPCDNSPatch') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class CodeEnum(str, Enum):
- """
- A snake case string succinctly identifying the reason for this lifecycle state.
- """
-
- RESOURCE_SUSPENDED_BY_PROVIDER = 'resource_suspended_by_provider'
-
-
-class VPNServerRoutePatch:
+class VPCDNSPrototype:
"""
- VPNServerRoutePatch.
+ The DNS configuration for this VPC.
+ If unspecified, the system will assign DNS servers capable of resolving hosts and
+ endpoint gateways within this VPC, and hosts on the internet.
- :attr str name: (optional) The name for this VPN server route. The name must not
- be used by another route for the VPN server.
+ :param bool enable_hub: (optional) Indicates whether this VPC is enabled as a
+ DNS name resolution hub.
+ :param VPCDNSResolverPrototype resolver: (optional)
"""
def __init__(
self,
*,
- name: str = None,
+ enable_hub: Optional[bool] = None,
+ resolver: Optional['VPCDNSResolverPrototype'] = None,
) -> None:
"""
- Initialize a VPNServerRoutePatch object.
+ Initialize a VPCDNSPrototype object.
- :param str name: (optional) The name for this VPN server route. The name
- must not be used by another route for the VPN server.
+ :param bool enable_hub: (optional) Indicates whether this VPC is enabled as
+ a DNS name resolution hub.
+ :param VPCDNSResolverPrototype resolver: (optional)
"""
- self.name = name
+ self.enable_hub = enable_hub
+ self.resolver = resolver
@classmethod
- def from_dict(cls, _dict: Dict) -> 'VPNServerRoutePatch':
- """Initialize a VPNServerRoutePatch object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VPCDNSPrototype':
+ """Initialize a VPCDNSPrototype object from a json dictionary."""
args = {}
- if 'name' in _dict:
- args['name'] = _dict.get('name')
+ if (enable_hub := _dict.get('enable_hub')) is not None:
+ args['enable_hub'] = enable_hub
+ if (resolver := _dict.get('resolver')) is not None:
+ args['resolver'] = resolver
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VPNServerRoutePatch object from a json dictionary."""
+ """Initialize a VPCDNSPrototype object from 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, 'enable_hub') and self.enable_hub is not None:
+ _dict['enable_hub'] = self.enable_hub
+ if hasattr(self, 'resolver') and self.resolver is not None:
+ if isinstance(self.resolver, dict):
+ _dict['resolver'] = self.resolver
+ else:
+ _dict['resolver'] = self.resolver.to_dict()
return _dict
def _to_dict(self):
@@ -82350,193 +84739,137 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this VPNServerRoutePatch object."""
+ """Return a `str` version of this VPCDNSPrototype object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VPNServerRoutePatch') -> bool:
+ def __eq__(self, other: 'VPCDNSPrototype') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'VPNServerRoutePatch') -> bool:
+ def __ne__(self, other: 'VPCDNSPrototype') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class VirtualNetworkInterface:
+class VPCDNSResolutionBinding:
"""
- VirtualNetworkInterface.
+ VPCDNSResolutionBinding.
- :attr bool auto_delete: Indicates whether this virtual network interface will be
- automatically deleted when
- `target` is deleted.
- :attr datetime created_at: The date and time that the virtual network interface
+ :param datetime created_at: The date and time that the DNS resolution binding
was created.
- :attr str crn: The CRN for this virtual network interface.
- :attr str href: The URL for this virtual network interface.
- :attr str id: The unique identifier for this virtual network interface.
- :attr str lifecycle_state: The lifecycle state of the virtual network interface.
- :attr str name: The name for this virtual network interface. The name is unique
- across all virtual network interfaces in the VPC.
- :attr ReservedIPReference primary_ip: The reserved IP for this virtual network
- interface.
- :attr ResourceGroupReference resource_group: The resource group for this virtual
- network interface.
- :attr str resource_type: The resource type.
- :attr List[SecurityGroupReference] security_groups: The security groups for this
- virtual network interface.
- :attr SubnetReference subnet: The associated subnet.
- :attr VirtualNetworkInterfaceTarget target: (optional) The target of this
- virtual network interface.
- If absent, this virtual network interface is not attached to a target.
- :attr VPCReference vpc: The VPC this virtual network interface resides in.
- :attr ZoneReference zone: The zone this virtual network interface resides in.
+ :param List[EndpointGatewayReferenceRemote] endpoint_gateways: The endpoint
+ gateways that have `allow_dns_resolution_binding` set to `true` and reside in
+ the VPC that has `dns.enable_hub` set to `false`.
+ The endpoint gateways may be remote and therefore may not be directly
+ retrievable.
+ :param str href: The URL for this DNS resolution binding.
+ :param str id: The unique identifier for this DNS resolution binding.
+ :param str lifecycle_state: The lifecycle state of the DNS resolution binding.
+ :param str name: The name for this DNS resolution binding. The name is unique
+ across all DNS resolution bindings for the VPC.
+ :param str resource_type: The resource type.
+ :param VPCReferenceRemote vpc: The VPC bound to for DNS resolution.
+ The VPC may be remote and therefore may not be directly retrievable.
"""
def __init__(
self,
- auto_delete: bool,
created_at: datetime,
- crn: str,
+ endpoint_gateways: List['EndpointGatewayReferenceRemote'],
href: str,
id: str,
lifecycle_state: str,
name: str,
- primary_ip: 'ReservedIPReference',
- resource_group: 'ResourceGroupReference',
resource_type: str,
- security_groups: List['SecurityGroupReference'],
- subnet: 'SubnetReference',
- vpc: 'VPCReference',
- zone: 'ZoneReference',
- *,
- target: 'VirtualNetworkInterfaceTarget' = None,
+ vpc: 'VPCReferenceRemote',
) -> None:
"""
- Initialize a VirtualNetworkInterface object.
+ Initialize a VPCDNSResolutionBinding object.
- :param bool auto_delete: Indicates whether this virtual network interface
- will be automatically deleted when
- `target` is deleted.
- :param datetime created_at: The date and time that the virtual network
- interface was created.
- :param str crn: The CRN for this virtual network interface.
- :param str href: The URL for this virtual network interface.
- :param str id: The unique identifier for this virtual network interface.
- :param str lifecycle_state: The lifecycle state of the virtual network
- interface.
- :param str name: The name for this virtual network interface. The name is
- unique across all virtual network interfaces in the VPC.
- :param ReservedIPReference primary_ip: The reserved IP for this virtual
- network interface.
- :param ResourceGroupReference resource_group: The resource group for this
- virtual network interface.
+ :param datetime created_at: The date and time that the DNS resolution
+ binding was created.
+ :param List[EndpointGatewayReferenceRemote] endpoint_gateways: The endpoint
+ gateways that have `allow_dns_resolution_binding` set to `true` and reside
+ in the VPC that has `dns.enable_hub` set to `false`.
+ The endpoint gateways may be remote and therefore may not be directly
+ retrievable.
+ :param str href: The URL for this DNS resolution binding.
+ :param str id: The unique identifier for this DNS resolution binding.
+ :param str lifecycle_state: The lifecycle state of the DNS resolution
+ binding.
+ :param str name: The name for this DNS resolution binding. The name is
+ unique across all DNS resolution bindings for the VPC.
:param str resource_type: The resource type.
- :param List[SecurityGroupReference] security_groups: The security groups
- for this virtual network interface.
- :param SubnetReference subnet: The associated subnet.
- :param VPCReference vpc: The VPC this virtual network interface resides in.
- :param ZoneReference zone: The zone this virtual network interface resides
- in.
- :param VirtualNetworkInterfaceTarget target: (optional) The target of this
- virtual network interface.
- If absent, this virtual network interface is not attached to a target.
+ :param VPCReferenceRemote vpc: The VPC bound to for DNS resolution.
+ The VPC may be remote and therefore may not be directly retrievable.
"""
- self.auto_delete = auto_delete
self.created_at = created_at
- self.crn = crn
+ self.endpoint_gateways = endpoint_gateways
self.href = href
self.id = id
self.lifecycle_state = lifecycle_state
self.name = name
- self.primary_ip = primary_ip
- self.resource_group = resource_group
self.resource_type = resource_type
- self.security_groups = security_groups
- self.subnet = subnet
- self.target = target
self.vpc = vpc
- self.zone = zone
@classmethod
- def from_dict(cls, _dict: Dict) -> 'VirtualNetworkInterface':
- """Initialize a VirtualNetworkInterface object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VPCDNSResolutionBinding':
+ """Initialize a VPCDNSResolutionBinding object from a json dictionary."""
args = {}
- if 'auto_delete' in _dict:
- args['auto_delete'] = _dict.get('auto_delete')
- else:
- raise ValueError('Required property \'auto_delete\' not present in VirtualNetworkInterface JSON')
- if 'created_at' in _dict:
- args['created_at'] = string_to_datetime(_dict.get('created_at'))
- else:
- raise ValueError('Required property \'created_at\' not present in VirtualNetworkInterface JSON')
- if 'crn' in _dict:
- args['crn'] = _dict.get('crn')
- else:
- raise ValueError('Required property \'crn\' not present in VirtualNetworkInterface JSON')
- if 'href' in _dict:
- args['href'] = _dict.get('href')
- else:
- raise ValueError('Required property \'href\' not present in VirtualNetworkInterface JSON')
- if 'id' in _dict:
- args['id'] = _dict.get('id')
+ if (created_at := _dict.get('created_at')) is not None:
+ args['created_at'] = string_to_datetime(created_at)
else:
- raise ValueError('Required property \'id\' not present in VirtualNetworkInterface JSON')
- if 'lifecycle_state' in _dict:
- args['lifecycle_state'] = _dict.get('lifecycle_state')
- else:
- raise ValueError('Required property \'lifecycle_state\' not present in VirtualNetworkInterface JSON')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
- else:
- raise ValueError('Required property \'name\' not present in VirtualNetworkInterface JSON')
- if 'primary_ip' in _dict:
- args['primary_ip'] = ReservedIPReference.from_dict(_dict.get('primary_ip'))
+ raise ValueError('Required property \'created_at\' not present in VPCDNSResolutionBinding JSON')
+ if (endpoint_gateways := _dict.get('endpoint_gateways')) is not None:
+ args['endpoint_gateways'] = [EndpointGatewayReferenceRemote.from_dict(v) for v in endpoint_gateways]
else:
- raise ValueError('Required property \'primary_ip\' not present in VirtualNetworkInterface JSON')
- if 'resource_group' in _dict:
- args['resource_group'] = ResourceGroupReference.from_dict(_dict.get('resource_group'))
+ raise ValueError('Required property \'endpoint_gateways\' not present in VPCDNSResolutionBinding JSON')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'resource_group\' not present in VirtualNetworkInterface JSON')
- if 'resource_type' in _dict:
- args['resource_type'] = _dict.get('resource_type')
+ raise ValueError('Required property \'href\' not present in VPCDNSResolutionBinding JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
else:
- raise ValueError('Required property \'resource_type\' not present in VirtualNetworkInterface JSON')
- if 'security_groups' in _dict:
- args['security_groups'] = [SecurityGroupReference.from_dict(v) for v in _dict.get('security_groups')]
+ raise ValueError('Required property \'id\' not present in VPCDNSResolutionBinding JSON')
+ if (lifecycle_state := _dict.get('lifecycle_state')) is not None:
+ args['lifecycle_state'] = lifecycle_state
else:
- raise ValueError('Required property \'security_groups\' not present in VirtualNetworkInterface JSON')
- if 'subnet' in _dict:
- args['subnet'] = SubnetReference.from_dict(_dict.get('subnet'))
+ raise ValueError('Required property \'lifecycle_state\' not present in VPCDNSResolutionBinding JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
else:
- raise ValueError('Required property \'subnet\' not present in VirtualNetworkInterface JSON')
- if 'target' in _dict:
- args['target'] = _dict.get('target')
- if 'vpc' in _dict:
- args['vpc'] = VPCReference.from_dict(_dict.get('vpc'))
+ raise ValueError('Required property \'name\' not present in VPCDNSResolutionBinding JSON')
+ if (resource_type := _dict.get('resource_type')) is not None:
+ args['resource_type'] = resource_type
else:
- raise ValueError('Required property \'vpc\' not present in VirtualNetworkInterface JSON')
- if 'zone' in _dict:
- args['zone'] = ZoneReference.from_dict(_dict.get('zone'))
+ raise ValueError('Required property \'resource_type\' not present in VPCDNSResolutionBinding JSON')
+ if (vpc := _dict.get('vpc')) is not None:
+ args['vpc'] = VPCReferenceRemote.from_dict(vpc)
else:
- raise ValueError('Required property \'zone\' not present in VirtualNetworkInterface JSON')
+ raise ValueError('Required property \'vpc\' not present in VPCDNSResolutionBinding JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VirtualNetworkInterface object from a json dictionary."""
+ """Initialize a VPCDNSResolutionBinding object from 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, '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, 'endpoint_gateways') and self.endpoint_gateways is not None:
+ endpoint_gateways_list = []
+ for v in self.endpoint_gateways:
+ if isinstance(v, dict):
+ endpoint_gateways_list.append(v)
+ else:
+ endpoint_gateways_list.append(v.to_dict())
+ _dict['endpoint_gateways'] = endpoint_gateways_list
if hasattr(self, 'href') and self.href is not None:
_dict['href'] = self.href
if hasattr(self, 'id') and self.id is not None:
@@ -82545,46 +84878,13 @@ def to_dict(self) -> Dict:
_dict['lifecycle_state'] = self.lifecycle_state
if hasattr(self, 'name') and self.name is not None:
_dict['name'] = self.name
- if hasattr(self, 'primary_ip') and self.primary_ip is not None:
- if isinstance(self.primary_ip, dict):
- _dict['primary_ip'] = self.primary_ip
- else:
- _dict['primary_ip'] = self.primary_ip.to_dict()
- if hasattr(self, 'resource_group') and self.resource_group is not None:
- if isinstance(self.resource_group, dict):
- _dict['resource_group'] = self.resource_group
- else:
- _dict['resource_group'] = self.resource_group.to_dict()
if hasattr(self, 'resource_type') and self.resource_type is not None:
_dict['resource_type'] = self.resource_type
- if hasattr(self, 'security_groups') and self.security_groups is not None:
- security_groups_list = []
- for v in self.security_groups:
- if isinstance(v, dict):
- security_groups_list.append(v)
- else:
- security_groups_list.append(v.to_dict())
- _dict['security_groups'] = security_groups_list
- if hasattr(self, 'subnet') and self.subnet is not None:
- if isinstance(self.subnet, dict):
- _dict['subnet'] = self.subnet
- else:
- _dict['subnet'] = self.subnet.to_dict()
- if hasattr(self, 'target') and self.target is not None:
- if isinstance(self.target, dict):
- _dict['target'] = self.target
- else:
- _dict['target'] = self.target.to_dict()
if hasattr(self, 'vpc') and self.vpc is not None:
if isinstance(self.vpc, dict):
_dict['vpc'] = self.vpc
else:
_dict['vpc'] = self.vpc.to_dict()
- if hasattr(self, 'zone') and self.zone is not None:
- if isinstance(self.zone, dict):
- _dict['zone'] = self.zone
- else:
- _dict['zone'] = self.zone.to_dict()
return _dict
def _to_dict(self):
@@ -82592,22 +84892,22 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this VirtualNetworkInterface object."""
+ """Return a `str` version of this VPCDNSResolutionBinding object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VirtualNetworkInterface') -> bool:
+ def __eq__(self, other: 'VPCDNSResolutionBinding') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'VirtualNetworkInterface') -> bool:
+ def __ne__(self, other: 'VPCDNSResolutionBinding') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
class LifecycleStateEnum(str, Enum):
"""
- The lifecycle state of the virtual network interface.
+ The lifecycle state of the DNS resolution binding.
"""
DELETING = 'deleting'
@@ -82624,87 +84924,95 @@ class ResourceTypeEnum(str, Enum):
The resource type.
"""
- VIRTUAL_NETWORK_INTERFACE = 'virtual_network_interface'
+ VPC_DNS_RESOLUTION_BINDING = 'vpc_dns_resolution_binding'
-class VirtualNetworkInterfaceCollection:
+class VPCDNSResolutionBindingCollection:
"""
- VirtualNetworkInterfaceCollection.
+ VPCDNSResolutionBindingCollection.
- :attr VirtualNetworkInterfaceCollectionFirst first: A link to the first page of
+ :param List[VPCDNSResolutionBinding] dns_resolution_bindings: Collection of DNS
+ resolution bindings for this VPC.
+ :param VPCDNSResolutionBindingCollectionFirst first: A link to the first page of
resources.
- :attr int limit: The maximum number of resources that can be returned by the
+ :param int limit: The maximum number of resources that can be returned by the
request.
- :attr VirtualNetworkInterfaceCollectionNext next: (optional) A link to the next
+ :param VPCDNSResolutionBindingCollectionNext next: (optional) A link to the next
page of resources. This property is present for all pages
except the last page.
- :attr int total_count: The total number of resources across all pages.
- :attr List[VirtualNetworkInterface] virtual_network_interfaces: Collection of
- virtual network interfaces.
+ :param int total_count: The total number of resources across all pages.
"""
def __init__(
self,
- first: 'VirtualNetworkInterfaceCollectionFirst',
+ dns_resolution_bindings: List['VPCDNSResolutionBinding'],
+ first: 'VPCDNSResolutionBindingCollectionFirst',
limit: int,
total_count: int,
- virtual_network_interfaces: List['VirtualNetworkInterface'],
*,
- next: 'VirtualNetworkInterfaceCollectionNext' = None,
+ next: Optional['VPCDNSResolutionBindingCollectionNext'] = None,
) -> None:
"""
- Initialize a VirtualNetworkInterfaceCollection object.
+ Initialize a VPCDNSResolutionBindingCollection object.
- :param VirtualNetworkInterfaceCollectionFirst first: A link to the first
+ :param List[VPCDNSResolutionBinding] dns_resolution_bindings: Collection of
+ DNS resolution bindings for this VPC.
+ :param VPCDNSResolutionBindingCollectionFirst first: A link to the first
page of resources.
:param int limit: The maximum number of resources that can be returned by
the request.
:param int total_count: The total number of resources across all pages.
- :param List[VirtualNetworkInterface] virtual_network_interfaces: Collection
- of virtual network interfaces.
- :param VirtualNetworkInterfaceCollectionNext next: (optional) A link to the
+ :param VPCDNSResolutionBindingCollectionNext next: (optional) A link to the
next page of resources. This property is present for all pages
except the last page.
"""
+ self.dns_resolution_bindings = dns_resolution_bindings
self.first = first
self.limit = limit
self.next = next
self.total_count = total_count
- self.virtual_network_interfaces = virtual_network_interfaces
@classmethod
- def from_dict(cls, _dict: Dict) -> 'VirtualNetworkInterfaceCollection':
- """Initialize a VirtualNetworkInterfaceCollection object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VPCDNSResolutionBindingCollection':
+ """Initialize a VPCDNSResolutionBindingCollection object from a json dictionary."""
args = {}
- if 'first' in _dict:
- args['first'] = VirtualNetworkInterfaceCollectionFirst.from_dict(_dict.get('first'))
+ if (dns_resolution_bindings := _dict.get('dns_resolution_bindings')) is not None:
+ args['dns_resolution_bindings'] = [VPCDNSResolutionBinding.from_dict(v) for v in dns_resolution_bindings]
else:
- raise ValueError('Required property \'first\' not present in VirtualNetworkInterfaceCollection JSON')
- if 'limit' in _dict:
- args['limit'] = _dict.get('limit')
+ raise ValueError('Required property \'dns_resolution_bindings\' not present in VPCDNSResolutionBindingCollection JSON')
+ if (first := _dict.get('first')) is not None:
+ args['first'] = VPCDNSResolutionBindingCollectionFirst.from_dict(first)
else:
- raise ValueError('Required property \'limit\' not present in VirtualNetworkInterfaceCollection JSON')
- if 'next' in _dict:
- args['next'] = VirtualNetworkInterfaceCollectionNext.from_dict(_dict.get('next'))
- if 'total_count' in _dict:
- args['total_count'] = _dict.get('total_count')
+ raise ValueError('Required property \'first\' not present in VPCDNSResolutionBindingCollection JSON')
+ if (limit := _dict.get('limit')) is not None:
+ args['limit'] = limit
else:
- raise ValueError('Required property \'total_count\' not present in VirtualNetworkInterfaceCollection JSON')
- if 'virtual_network_interfaces' in _dict:
- args['virtual_network_interfaces'] = [VirtualNetworkInterface.from_dict(v) for v in _dict.get('virtual_network_interfaces')]
+ raise ValueError('Required property \'limit\' not present in VPCDNSResolutionBindingCollection JSON')
+ if (next := _dict.get('next')) is not None:
+ args['next'] = VPCDNSResolutionBindingCollectionNext.from_dict(next)
+ if (total_count := _dict.get('total_count')) is not None:
+ args['total_count'] = total_count
else:
- raise ValueError('Required property \'virtual_network_interfaces\' not present in VirtualNetworkInterfaceCollection JSON')
+ raise ValueError('Required property \'total_count\' not present in VPCDNSResolutionBindingCollection JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VirtualNetworkInterfaceCollection object from a json dictionary."""
+ """Initialize a VPCDNSResolutionBindingCollection object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
+ if hasattr(self, 'dns_resolution_bindings') and self.dns_resolution_bindings is not None:
+ dns_resolution_bindings_list = []
+ for v in self.dns_resolution_bindings:
+ if isinstance(v, dict):
+ dns_resolution_bindings_list.append(v)
+ else:
+ dns_resolution_bindings_list.append(v.to_dict())
+ _dict['dns_resolution_bindings'] = dns_resolution_bindings_list
if hasattr(self, 'first') and self.first is not None:
if isinstance(self.first, dict):
_dict['first'] = self.first
@@ -82719,14 +85027,6 @@ def to_dict(self) -> Dict:
_dict['next'] = self.next.to_dict()
if hasattr(self, 'total_count') and self.total_count is not None:
_dict['total_count'] = self.total_count
- if hasattr(self, 'virtual_network_interfaces') and self.virtual_network_interfaces is not None:
- virtual_network_interfaces_list = []
- for v in self.virtual_network_interfaces:
- if isinstance(v, dict):
- virtual_network_interfaces_list.append(v)
- else:
- virtual_network_interfaces_list.append(v.to_dict())
- _dict['virtual_network_interfaces'] = virtual_network_interfaces_list
return _dict
def _to_dict(self):
@@ -82734,25 +85034,25 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this VirtualNetworkInterfaceCollection object."""
+ """Return a `str` version of this VPCDNSResolutionBindingCollection object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VirtualNetworkInterfaceCollection') -> bool:
+ def __eq__(self, other: 'VPCDNSResolutionBindingCollection') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'VirtualNetworkInterfaceCollection') -> bool:
+ def __ne__(self, other: 'VPCDNSResolutionBindingCollection') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class VirtualNetworkInterfaceCollectionFirst:
+class VPCDNSResolutionBindingCollectionFirst:
"""
A link to the first page of resources.
- :attr str href: The URL for a page of resources.
+ :param str href: The URL for a page of resources.
"""
def __init__(
@@ -82760,25 +85060,25 @@ def __init__(
href: str,
) -> None:
"""
- Initialize a VirtualNetworkInterfaceCollectionFirst object.
+ Initialize a VPCDNSResolutionBindingCollectionFirst object.
:param str href: The URL for a page of resources.
"""
self.href = href
@classmethod
- def from_dict(cls, _dict: Dict) -> 'VirtualNetworkInterfaceCollectionFirst':
- """Initialize a VirtualNetworkInterfaceCollectionFirst object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VPCDNSResolutionBindingCollectionFirst':
+ """Initialize a VPCDNSResolutionBindingCollectionFirst object from a json dictionary."""
args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'href\' not present in VirtualNetworkInterfaceCollectionFirst JSON')
+ raise ValueError('Required property \'href\' not present in VPCDNSResolutionBindingCollectionFirst JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VirtualNetworkInterfaceCollectionFirst object from a json dictionary."""
+ """Initialize a VPCDNSResolutionBindingCollectionFirst object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -82793,26 +85093,26 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this VirtualNetworkInterfaceCollectionFirst object."""
+ """Return a `str` version of this VPCDNSResolutionBindingCollectionFirst object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VirtualNetworkInterfaceCollectionFirst') -> bool:
+ def __eq__(self, other: 'VPCDNSResolutionBindingCollectionFirst') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'VirtualNetworkInterfaceCollectionFirst') -> bool:
+ def __ne__(self, other: 'VPCDNSResolutionBindingCollectionFirst') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class VirtualNetworkInterfaceCollectionNext:
+class VPCDNSResolutionBindingCollectionNext:
"""
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.
+ :param str href: The URL for a page of resources.
"""
def __init__(
@@ -82820,25 +85120,25 @@ def __init__(
href: str,
) -> None:
"""
- Initialize a VirtualNetworkInterfaceCollectionNext object.
+ Initialize a VPCDNSResolutionBindingCollectionNext object.
:param str href: The URL for a page of resources.
"""
self.href = href
@classmethod
- def from_dict(cls, _dict: Dict) -> 'VirtualNetworkInterfaceCollectionNext':
- """Initialize a VirtualNetworkInterfaceCollectionNext object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VPCDNSResolutionBindingCollectionNext':
+ """Initialize a VPCDNSResolutionBindingCollectionNext object from a json dictionary."""
args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'href\' not present in VirtualNetworkInterfaceCollectionNext JSON')
+ raise ValueError('Required property \'href\' not present in VPCDNSResolutionBindingCollectionNext JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VirtualNetworkInterfaceCollectionNext object from a json dictionary."""
+ """Initialize a VPCDNSResolutionBindingCollectionNext object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -82853,52 +85153,52 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this VirtualNetworkInterfaceCollectionNext object."""
+ """Return a `str` version of this VPCDNSResolutionBindingCollectionNext object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VirtualNetworkInterfaceCollectionNext') -> bool:
+ def __eq__(self, other: 'VPCDNSResolutionBindingCollectionNext') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'VirtualNetworkInterfaceCollectionNext') -> bool:
+ def __ne__(self, other: 'VPCDNSResolutionBindingCollectionNext') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class VirtualNetworkInterfacePatch:
+class VPCDNSResolutionBindingPatch:
"""
- VirtualNetworkInterfacePatch.
+ VPCDNSResolutionBindingPatch.
- :attr str name: (optional) The name for this virtual network interface. The name
- is unique across all virtual network interfaces in the VPC.
+ :param str name: (optional) The name for this DNS resolution binding. The name
+ must not be used by another DNS resolution binding for the VPC.
"""
def __init__(
self,
*,
- name: str = None,
+ name: Optional[str] = None,
) -> None:
"""
- Initialize a VirtualNetworkInterfacePatch object.
+ Initialize a VPCDNSResolutionBindingPatch object.
- :param str name: (optional) The name for this virtual network interface.
- The name is unique across all virtual network interfaces in the VPC.
+ :param str name: (optional) The name for this DNS resolution binding. The
+ name must not be used by another DNS resolution binding for the VPC.
"""
self.name = name
@classmethod
- def from_dict(cls, _dict: Dict) -> 'VirtualNetworkInterfacePatch':
- """Initialize a VirtualNetworkInterfacePatch object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VPCDNSResolutionBindingPatch':
+ """Initialize a VPCDNSResolutionBindingPatch object from a json dictionary."""
args = {}
- if 'name' in _dict:
- args['name'] = _dict.get('name')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VirtualNetworkInterfacePatch object from a json dictionary."""
+ """Initialize a VPCDNSResolutionBindingPatch object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -82913,119 +85213,212 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this VirtualNetworkInterfacePatch object."""
+ """Return a `str` version of this VPCDNSResolutionBindingPatch object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VirtualNetworkInterfacePatch') -> bool:
+ def __eq__(self, other: 'VPCDNSResolutionBindingPatch') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'VirtualNetworkInterfacePatch') -> bool:
+ def __ne__(self, other: 'VPCDNSResolutionBindingPatch') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class VirtualNetworkInterfacePrimaryIPPrototype:
+class VPCDNSResolver:
"""
- VirtualNetworkInterfacePrimaryIPPrototype.
+ VPCDNSResolver.
+ :param List[DNSServer] servers: The DNS servers for this VPC. The servers are
+ populated:
+ - by the system when `dns.resolver.type` is `system`
+ - using the DNS servers in `dns.resolver.vpc` when `dns.resolver.type` is
+ `delegated`
+ - using `dns.resolver.manual_servers` when the `dns.resolver.type` is `manual`.
+ :param str type: The type of the DNS resolver used for the VPC.
+ - `delegated`: DNS server addresses are provided by the DNS resolver of the VPC
+ specified in `dns.resolver.vpc`.
+ - `manual`: DNS server addresses are specified in `dns.resolver.manual_servers`.
+ - `system`: DNS server addresses are provided by the system.
"""
def __init__(
self,
+ servers: List['DNSServer'],
+ type: str,
) -> None:
"""
- Initialize a VirtualNetworkInterfacePrimaryIPPrototype object.
+ Initialize a VPCDNSResolver object.
+ :param List[DNSServer] servers: The DNS servers for this VPC. The servers
+ are populated:
+ - by the system when `dns.resolver.type` is `system`
+ - using the DNS servers in `dns.resolver.vpc` when `dns.resolver.type` is
+ `delegated`
+ - using `dns.resolver.manual_servers` when the `dns.resolver.type` is
+ `manual`.
+ :param str type: The type of the DNS resolver used for the VPC.
+ - `delegated`: DNS server addresses are provided by the DNS resolver of the
+ VPC
+ specified in `dns.resolver.vpc`.
+ - `manual`: DNS server addresses are specified in
+ `dns.resolver.manual_servers`.
+ - `system`: DNS server addresses are provided by the system.
"""
msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContext', 'VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext'])
+ ", ".join(['VPCDNSResolverTypeDelegated', 'VPCDNSResolverTypeManual', 'VPCDNSResolverTypeSystem'])
)
raise Exception(msg)
+ class TypeEnum(str, Enum):
+ """
+ The type of the DNS resolver used for the VPC.
+ - `delegated`: DNS server addresses are provided by the DNS resolver of the VPC
+ specified in `dns.resolver.vpc`.
+ - `manual`: DNS server addresses are specified in `dns.resolver.manual_servers`.
+ - `system`: DNS server addresses are provided by the system.
+ """
+
+ DELEGATED = 'delegated'
+ MANUAL = 'manual'
+ SYSTEM = 'system'
-class VirtualNetworkInterfaceReferenceAttachmentContext:
+
+
+class VPCDNSResolverPatch:
"""
- VirtualNetworkInterfaceReferenceAttachmentContext.
+ VPCDNSResolverPatch.
- :attr str crn: The CRN for this virtual network interface.
- :attr str href: The URL for this virtual network interface.
- :attr str id: The unique identifier for this virtual network interface.
- :attr str name: The name for this virtual network interface. The name is unique
- across all virtual network interfaces in the VPC.
- :attr str resource_type: The resource type.
+ :param List[DNSServerPrototype] manual_servers: (optional) The DNS servers to
+ use for this VPC, replacing any existing servers. All the DNS servers must
+ either:
+ - have a unique `zone_affinity`, or
+ - not have a `zone_affinity`.
+ If `zone_affinity` is specified, exactly one DNS server must be specified for
+ each zone in the region. The DHCP [Domain Name Server
+ Option](https://datatracker.ietf.org/doc/html/rfc2132#section-3.8) for a zone
+ will list this DNS server first, followed by unique DNS servers from other zones
+ if available.
+ If `zone_affinity` is not specified, the DHCP [Domain Name Server
+ Option](https://datatracker.ietf.org/doc/html/rfc2132#section-3.8) for each zone
+ will list all the manual DNS servers in the order specified.
+ `dns.resolver.manual_servers` must be set if and only if `dns.resolver.type` is
+ `manual`.
+ :param str type: (optional) The type of the DNS resolver to use.
+ - `delegated`: DNS server addresses will be provided by the resolver for the VPC
+ specified in `dns.resolver.vpc`. Requires `dns.enable_hub` to be
+ `false`.
+ - `manual`: DNS server addresses are specified in `dns.resolver.manual_servers`.
+ - `system`: DNS server addresses will be provided by the system and depend on
+ the
+ configuration.
+ Updating from `manual` requires `dns.resolver.manual_servers` to be specified as
+ `null`.
+ Updating to `manual` requires `dns.resolver.manual_servers` to be specified and
+ not empty.
+ Updating from `delegated` requires `dns.resolver.vpc` to be specified as `null`.
+ :param VPCDNSResolverVPCPatch vpc: (optional) The VPC to provide DNS server
+ addresses for this VPC. The specified VPC must be configured
+ with a [DNS Services](https://cloud.ibm.com/docs/dns-svcs) custom resolver and
+ must be in
+ one of this VPC's DNS resolution bindings.
+ Specify `null` to remove an existing VPC.
+ This property must be set if and only if `dns.resolver.type` is `delegated`.
"""
def __init__(
self,
- crn: str,
- href: str,
- id: str,
- name: str,
- resource_type: str,
+ *,
+ manual_servers: Optional[List['DNSServerPrototype']] = None,
+ type: Optional[str] = None,
+ vpc: Optional['VPCDNSResolverVPCPatch'] = None,
) -> None:
"""
- Initialize a VirtualNetworkInterfaceReferenceAttachmentContext object.
+ Initialize a VPCDNSResolverPatch object.
- :param str crn: The CRN for this virtual network interface.
- :param str href: The URL for this virtual network interface.
- :param str id: The unique identifier for this virtual network interface.
- :param str name: The name for this virtual network interface. The name is
- unique across all virtual network interfaces in the VPC.
- :param str resource_type: The resource type.
+ :param List[DNSServerPrototype] manual_servers: (optional) The DNS servers
+ to use for this VPC, replacing any existing servers. All the DNS servers
+ must either:
+ - have a unique `zone_affinity`, or
+ - not have a `zone_affinity`.
+ If `zone_affinity` is specified, exactly one DNS server must be specified
+ for each zone in the region. The DHCP [Domain Name Server
+ Option](https://datatracker.ietf.org/doc/html/rfc2132#section-3.8) for a
+ zone will list this DNS server first, followed by unique DNS servers from
+ other zones if available.
+ If `zone_affinity` is not specified, the DHCP [Domain Name Server
+ Option](https://datatracker.ietf.org/doc/html/rfc2132#section-3.8) for each
+ zone will list all the manual DNS servers in the order specified.
+ `dns.resolver.manual_servers` must be set if and only if
+ `dns.resolver.type` is `manual`.
+ :param str type: (optional) The type of the DNS resolver to use.
+ - `delegated`: DNS server addresses will be provided by the resolver for
+ the VPC
+ specified in `dns.resolver.vpc`. Requires `dns.enable_hub`
+ to be
+ `false`.
+ - `manual`: DNS server addresses are specified in
+ `dns.resolver.manual_servers`.
+ - `system`: DNS server addresses will be provided by the system and depend
+ on the
+ configuration.
+ Updating from `manual` requires `dns.resolver.manual_servers` to be
+ specified as
+ `null`.
+ Updating to `manual` requires `dns.resolver.manual_servers` to be specified
+ and not empty.
+ Updating from `delegated` requires `dns.resolver.vpc` to be specified as
+ `null`.
+ :param VPCDNSResolverVPCPatch vpc: (optional) The VPC to provide DNS server
+ addresses for this VPC. The specified VPC must be configured
+ with a [DNS Services](https://cloud.ibm.com/docs/dns-svcs) custom resolver
+ and must be in
+ one of this VPC's DNS resolution bindings.
+ Specify `null` to remove an existing VPC.
+ This property must be set if and only if `dns.resolver.type` is
+ `delegated`.
"""
- self.crn = crn
- self.href = href
- self.id = id
- self.name = name
- self.resource_type = resource_type
+ self.manual_servers = manual_servers
+ self.type = type
+ self.vpc = vpc
@classmethod
- def from_dict(cls, _dict: Dict) -> 'VirtualNetworkInterfaceReferenceAttachmentContext':
- """Initialize a VirtualNetworkInterfaceReferenceAttachmentContext object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VPCDNSResolverPatch':
+ """Initialize a VPCDNSResolverPatch object from a json dictionary."""
args = {}
- if 'crn' in _dict:
- args['crn'] = _dict.get('crn')
- else:
- raise ValueError('Required property \'crn\' not present in VirtualNetworkInterfaceReferenceAttachmentContext JSON')
- if 'href' in _dict:
- args['href'] = _dict.get('href')
- else:
- raise ValueError('Required property \'href\' not present in VirtualNetworkInterfaceReferenceAttachmentContext JSON')
- if 'id' in _dict:
- args['id'] = _dict.get('id')
- else:
- raise ValueError('Required property \'id\' not present in VirtualNetworkInterfaceReferenceAttachmentContext JSON')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
- else:
- raise ValueError('Required property \'name\' not present in VirtualNetworkInterfaceReferenceAttachmentContext JSON')
- if 'resource_type' in _dict:
- args['resource_type'] = _dict.get('resource_type')
- else:
- raise ValueError('Required property \'resource_type\' not present in VirtualNetworkInterfaceReferenceAttachmentContext JSON')
+ if (manual_servers := _dict.get('manual_servers')) is not None:
+ args['manual_servers'] = [DNSServerPrototype.from_dict(v) for v in manual_servers]
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
+ if (vpc := _dict.get('vpc')) is not None:
+ args['vpc'] = vpc
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VirtualNetworkInterfaceReferenceAttachmentContext object from a json dictionary."""
+ """Initialize a VPCDNSResolverPatch object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'crn') and self.crn is not None:
- _dict['crn'] = self.crn
- if hasattr(self, 'href') and self.href is not None:
- _dict['href'] = self.href
- 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, 'manual_servers') and self.manual_servers is not None:
+ manual_servers_list = []
+ for v in self.manual_servers:
+ if isinstance(v, dict):
+ manual_servers_list.append(v)
+ else:
+ manual_servers_list.append(v.to_dict())
+ _dict['manual_servers'] = manual_servers_list
+ if hasattr(self, 'type') and self.type is not None:
+ _dict['type'] = self.type
+ if hasattr(self, 'vpc') and self.vpc is not None:
+ if isinstance(self.vpc, dict):
+ _dict['vpc'] = self.vpc
+ else:
+ _dict['vpc'] = self.vpc.to_dict()
return _dict
def _to_dict(self):
@@ -83033,65 +85426,167 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this VirtualNetworkInterfaceReferenceAttachmentContext object."""
+ """Return a `str` version of this VPCDNSResolverPatch object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VirtualNetworkInterfaceReferenceAttachmentContext') -> bool:
+ def __eq__(self, other: 'VPCDNSResolverPatch') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'VirtualNetworkInterfaceReferenceAttachmentContext') -> bool:
+ def __ne__(self, other: 'VPCDNSResolverPatch') -> 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 of the DNS resolver to use.
+ - `delegated`: DNS server addresses will be provided by the resolver for the VPC
+ specified in `dns.resolver.vpc`. Requires `dns.enable_hub` to be
+ `false`.
+ - `manual`: DNS server addresses are specified in `dns.resolver.manual_servers`.
+ - `system`: DNS server addresses will be provided by the system and depend on the
+ configuration.
+ Updating from `manual` requires `dns.resolver.manual_servers` to be specified as
+ `null`.
+ Updating to `manual` requires `dns.resolver.manual_servers` to be specified and
+ not empty.
+ Updating from `delegated` requires `dns.resolver.vpc` to be specified as `null`.
"""
- VIRTUAL_NETWORK_INTERFACE = 'virtual_network_interface'
+ DELEGATED = 'delegated'
+ MANUAL = 'manual'
+ SYSTEM = 'system'
-class VirtualNetworkInterfaceReferenceDeleted:
+class VPCDNSResolverPrototype:
"""
- If present, this property indicates the referenced resource has been deleted, and
- provides some supplementary information.
+ VPCDNSResolverPrototype.
- :attr str more_info: Link to documentation about deleted resources.
+ :param str type: (optional) The type of the DNS resolver to use.
+ - `manual`: DNS server addresses are specified in `dns.resolver.manual_servers`.
+ - `system`: DNS server addresses will be provided by the system and depend on
+ the
+ configuration.
"""
def __init__(
self,
- more_info: str,
+ *,
+ type: Optional[str] = None,
) -> None:
"""
- Initialize a VirtualNetworkInterfaceReferenceDeleted object.
+ Initialize a VPCDNSResolverPrototype object.
- :param str more_info: Link to documentation about deleted resources.
+ :param str type: (optional) The type of the DNS resolver to use.
+ - `manual`: DNS server addresses are specified in
+ `dns.resolver.manual_servers`.
+ - `system`: DNS server addresses will be provided by the system and depend
+ on the
+ configuration.
+ """
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['VPCDNSResolverPrototypeVPCDNSResolverTypeManualPrototype', 'VPCDNSResolverPrototypeVPCDNSResolverTypeSystemPrototype'])
+ )
+ raise Exception(msg)
+
+ class TypeEnum(str, Enum):
"""
+ The type of the DNS resolver to use.
+ - `manual`: DNS server addresses are specified in `dns.resolver.manual_servers`.
+ - `system`: DNS server addresses will be provided by the system and depend on the
+ configuration.
+ """
+
+ MANUAL = 'manual'
+ SYSTEM = 'system'
+
+
+
+class VPCDNSResolverVPCPatch:
+ """
+ The VPC to provide DNS server addresses for this VPC. The specified VPC must be
+ configured with a [DNS Services](https://cloud.ibm.com/docs/dns-svcs) custom resolver
+ and must be in one of this VPC's DNS resolution bindings.
+ Specify `null` to remove an existing VPC.
+ This property must be set if and only if `dns.resolver.type` is `delegated`.
+
+ """
+
+ def __init__(
+ self,
+ ) -> None:
+ """
+ Initialize a VPCDNSResolverVPCPatch object.
+
+ """
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['VPCDNSResolverVPCPatchVPCIdentityById', 'VPCDNSResolverVPCPatchVPCIdentityByCRN', 'VPCDNSResolverVPCPatchVPCIdentityByHref'])
+ )
+ raise Exception(msg)
+
+
+class VPCHealthReason:
+ """
+ VPCHealthReason.
+
+ :param str code: A snake case string succinctly identifying the reason for this
+ health state.
+ :param str message: An explanation of the reason for this health state.
+ :param str more_info: (optional) Link to documentation about the reason for this
+ health state.
+ """
+
+ def __init__(
+ self,
+ code: str,
+ message: str,
+ *,
+ more_info: Optional[str] = None,
+ ) -> None:
+ """
+ Initialize a VPCHealthReason object.
+
+ :param str code: A snake case string succinctly identifying the reason for
+ this health state.
+ :param str message: An explanation of the reason for this health state.
+ :param str more_info: (optional) Link to documentation about the reason for
+ this health state.
+ """
+ self.code = code
+ self.message = message
self.more_info = more_info
@classmethod
- def from_dict(cls, _dict: Dict) -> 'VirtualNetworkInterfaceReferenceDeleted':
- """Initialize a VirtualNetworkInterfaceReferenceDeleted object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VPCHealthReason':
+ """Initialize a VPCHealthReason object from a json dictionary."""
args = {}
- if 'more_info' in _dict:
- args['more_info'] = _dict.get('more_info')
+ if (code := _dict.get('code')) is not None:
+ args['code'] = code
else:
- raise ValueError('Required property \'more_info\' not present in VirtualNetworkInterfaceReferenceDeleted JSON')
+ raise ValueError('Required property \'code\' not present in VPCHealthReason JSON')
+ if (message := _dict.get('message')) is not None:
+ args['message'] = message
+ else:
+ raise ValueError('Required property \'message\' not present in VPCHealthReason JSON')
+ if (more_info := _dict.get('more_info')) is not None:
+ args['more_info'] = more_info
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VirtualNetworkInterfaceReferenceDeleted object from a json dictionary."""
+ """Initialize a VPCHealthReason object from 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
@@ -83101,28 +85596,32 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this VirtualNetworkInterfaceReferenceDeleted object."""
+ """Return a `str` version of this VPCHealthReason object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VirtualNetworkInterfaceReferenceDeleted') -> bool:
+ def __eq__(self, other: 'VPCHealthReason') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'VirtualNetworkInterfaceReferenceDeleted') -> bool:
+ def __ne__(self, other: 'VPCHealthReason') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
+ class CodeEnum(str, Enum):
+ """
+ A snake case string succinctly identifying the reason for this health state.
+ """
+
+ DNS_RESOLUTION_BINDING_FAILED = 'dns_resolution_binding_failed'
+ INTERNAL_ERROR = 'internal_error'
-class VirtualNetworkInterfaceTarget:
+
+
+class VPCIdentity:
"""
- A virtual network interface target.
- The resource types that can be virtual network interface targets are expected to
- expand in the future. When iterating over virtual network interface targets, do not
- assume that every target resource will be from a known set of resource types.
- Optionally halt processing and surface an error, or bypass resources of unrecognized
- types.
+ Identifies a VPC by a unique property.
"""
@@ -83130,433 +85629,182 @@ def __init__(
self,
) -> None:
"""
- Initialize a VirtualNetworkInterfaceTarget object.
+ Initialize a VPCIdentity object.
"""
msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['VirtualNetworkInterfaceTargetShareMountTargetReference'])
+ ", ".join(['VPCIdentityById', 'VPCIdentityByCRN', 'VPCIdentityByHref'])
)
raise Exception(msg)
-class Volume:
+class VPCPatch:
"""
- Volume.
+ VPCPatch.
- :attr bool active: Indicates whether a running virtual server instance has an
- attachment to this volume.
- :attr str attachment_state: The attachment state of the volume
- - `unattached`: Not attached to any virtual server instances
- - `attached`: Attached to a virtual server instance (even if the instance is
- stopped)
- - `unusable`: Not able to be attached to any virtual server instances.
- :attr int bandwidth: The maximum bandwidth (in megabits per second) for the
- volume.
- :attr bool busy: Indicates whether this volume is performing an operation that
- must be serialized. This must be `false` to perform an operation that is
- specified to require serialization.
- :attr int capacity: The capacity to use for the volume (in gigabytes). The
- specified minimum and maximum capacity values for creating or updating volumes
- may expand in the future.
- :attr datetime created_at: The date and time that the volume was created.
- :attr str crn: The CRN for this volume.
- :attr str encryption: The type of encryption used on the volume.
- :attr EncryptionKeyReference encryption_key: (optional) The root key used to
- wrap the data encryption key for the volume.
- This property will be present for volumes with an `encryption` type of
- `user_managed`.
- :attr List[VolumeHealthReason] health_reasons: The reasons for the current
- `health_state` (if any).
- The enumerated reason code values for this property will expand in the future.
- When processing this property, check for and log unknown values. Optionally halt
- processing and surface the error, or bypass the resource on which the unexpected
- reason code was encountered.
- :attr str health_state: The health of this resource.
- - `ok`: No abnormal behavior detected
- - `degraded`: Experiencing compromised performance, capacity, or connectivity
- - `faulted`: Completely unreachable, inoperative, or otherwise entirely
- incapacitated
- - `inapplicable`: The health state does not apply because of the current
- lifecycle state. A resource with a lifecycle state of `failed` or `deleting`
- will have a health state of `inapplicable`. A `pending` resource may also have
- this state.
- :attr str href: The URL for this volume.
- :attr str id: The unique identifier for this volume.
- :attr int iops: The maximum I/O operations per second (IOPS) for this volume.
- :attr str name: The name for this volume. The name is unique across all volumes
- in the region.
- :attr OperatingSystem operating_system: (optional) The operating system
- associated with this volume. If absent, this volume was not
- created from an image, or the image did not include an operating system.
- :attr VolumeProfileReference profile: The
- [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-block-storage-profiles) for
- this volume.
- :attr ResourceGroupReference resource_group: The resource group for this volume.
- :attr str resource_type: The resource type.
- :attr ImageReference source_image: (optional) The image from which this volume
- was created (this may be
- [deleted](https://cloud.ibm.com/apidocs/vpc#deleted-resources)).
- If absent, this volume was not created from an image.
- :attr SnapshotReference source_snapshot: (optional) The snapshot from which this
- volume was cloned.
- :attr str status: The status of the volume.
- The enumerated values for this property will expand in the future. When
- processing this property, check for and log unknown values. Optionally halt
- processing and surface the error, or bypass the volume on which the unexpected
- property value was encountered.
- :attr List[VolumeStatusReason] status_reasons: The reasons for the current
- status (if any).
- The enumerated reason code values for this property will expand in the future.
- When processing this property, check for and log unknown values. Optionally halt
- processing and surface the error, or bypass the resource on which the unexpected
- reason code was encountered.
- :attr List[str] user_tags: The [user
- tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with this
- volume.
- :attr List[VolumeAttachmentReferenceVolumeContext] volume_attachments: The
- volume attachments for this volume.
- :attr ZoneReference zone: The zone this volume resides in.
+ :param VPCDNSPatch dns: (optional) The DNS configuration for this VPC.
+ :param str name: (optional) The name for this VPC. The name must not be used by
+ another VPC in the region.
"""
def __init__(
self,
- active: bool,
- attachment_state: str,
- bandwidth: int,
- busy: bool,
- capacity: int,
- created_at: datetime,
- crn: str,
- encryption: str,
- health_reasons: List['VolumeHealthReason'],
- health_state: str,
- href: str,
- id: str,
- iops: int,
- name: str,
- profile: 'VolumeProfileReference',
- resource_group: 'ResourceGroupReference',
- resource_type: str,
- status: str,
- status_reasons: List['VolumeStatusReason'],
- user_tags: List[str],
- volume_attachments: List['VolumeAttachmentReferenceVolumeContext'],
- zone: 'ZoneReference',
*,
- encryption_key: 'EncryptionKeyReference' = None,
- operating_system: 'OperatingSystem' = None,
- source_image: 'ImageReference' = None,
- source_snapshot: 'SnapshotReference' = None,
+ dns: Optional['VPCDNSPatch'] = None,
+ name: Optional[str] = None,
) -> None:
"""
- Initialize a Volume object.
+ Initialize a VPCPatch object.
- :param bool active: Indicates whether a running virtual server instance has
- an attachment to this volume.
- :param str attachment_state: The attachment state of the volume
- - `unattached`: Not attached to any virtual server instances
- - `attached`: Attached to a virtual server instance (even if the instance
- is stopped)
- - `unusable`: Not able to be attached to any virtual server instances.
- :param int bandwidth: The maximum bandwidth (in megabits per second) for
- the volume.
- :param bool busy: Indicates whether this volume is performing an operation
- that must be serialized. This must be `false` to perform an operation that
- is specified to require serialization.
- :param int capacity: The capacity to use for the volume (in gigabytes). The
- specified minimum and maximum capacity values for creating or updating
- volumes may expand in the future.
- :param datetime created_at: The date and time that the volume was created.
- :param str crn: The CRN for this volume.
- :param str encryption: The type of encryption used on the volume.
- :param List[VolumeHealthReason] health_reasons: The reasons for the current
- `health_state` (if any).
- The enumerated reason code values for this property will expand in the
- future. When processing this property, check for and log unknown values.
- Optionally halt processing and surface the error, or bypass the resource on
- which the unexpected reason code was encountered.
- :param str health_state: The health of this resource.
- - `ok`: No abnormal behavior detected
- - `degraded`: Experiencing compromised performance, capacity, or
- connectivity
- - `faulted`: Completely unreachable, inoperative, or otherwise entirely
- incapacitated
- - `inapplicable`: The health state does not apply because of the current
- lifecycle state. A resource with a lifecycle state of `failed` or
- `deleting` will have a health state of `inapplicable`. A `pending` resource
- may also have this state.
- :param str href: The URL for this volume.
- :param str id: The unique identifier for this volume.
- :param int iops: The maximum I/O operations per second (IOPS) for this
- volume.
- :param str name: The name for this volume. The name is unique across all
- volumes in the region.
- :param VolumeProfileReference profile: The
- [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-block-storage-profiles)
- for
- this volume.
- :param ResourceGroupReference resource_group: The resource group for this
- volume.
+ :param VPCDNSPatch dns: (optional) The DNS configuration for this VPC.
+ :param str name: (optional) The name for this VPC. The name must not be
+ used by another VPC in the region.
+ """
+ self.dns = dns
+ self.name = name
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'VPCPatch':
+ """Initialize a VPCPatch object from a json dictionary."""
+ args = {}
+ if (dns := _dict.get('dns')) is not None:
+ args['dns'] = VPCDNSPatch.from_dict(dns)
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a VPCPatch object from a json dictionary."""
+ return cls.from_dict(_dict)
+
+ def to_dict(self) -> Dict:
+ """Return a json dictionary representing this model."""
+ _dict = {}
+ if hasattr(self, 'dns') and self.dns is not None:
+ if isinstance(self.dns, dict):
+ _dict['dns'] = self.dns
+ else:
+ _dict['dns'] = self.dns.to_dict()
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ return _dict
+
+ def _to_dict(self):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
+
+ def __str__(self) -> str:
+ """Return a `str` version of this VPCPatch object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'VPCPatch') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'VPCPatch') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+
+class VPCReference:
+ """
+ VPCReference.
+
+ :param str crn: The CRN 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 href: The URL for this VPC.
+ :param str id: The unique identifier for this VPC.
+ :param str name: The name for this VPC. The name is unique across all VPCs in
+ the region.
+ :param str resource_type: The resource type.
+ """
+
+ def __init__(
+ self,
+ crn: str,
+ href: str,
+ id: str,
+ name: str,
+ resource_type: str,
+ *,
+ deleted: Optional['VPCReferenceDeleted'] = None,
+ ) -> None:
+ """
+ Initialize a VPCReference object.
+
+ :param str crn: The CRN for this VPC.
+ :param str href: The URL for this VPC.
+ :param str id: The unique identifier for this VPC.
+ :param str name: The name for this VPC. The name is unique across all VPCs
+ in the region.
:param str resource_type: The resource type.
- :param str status: The status of the volume.
- The enumerated values for this property will expand in the future. When
- processing this property, check for and log unknown values. Optionally halt
- processing and surface the error, or bypass the volume on which the
- unexpected property value was encountered.
- :param List[VolumeStatusReason] status_reasons: The reasons for the current
- status (if any).
- The enumerated reason code values for this property will expand in the
- future. When processing this property, check for and log unknown values.
- Optionally halt processing and surface the error, or bypass the resource on
- which the unexpected reason code was encountered.
- :param List[str] user_tags: The [user
- tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with
- this volume.
- :param List[VolumeAttachmentReferenceVolumeContext] volume_attachments: The
- volume attachments for this volume.
- :param ZoneReference zone: The zone this volume resides in.
- :param EncryptionKeyReference encryption_key: (optional) The root key used
- to wrap the data encryption key for the volume.
- This property will be present for volumes with an `encryption` type of
- `user_managed`.
- :param OperatingSystem operating_system: (optional) The operating system
- associated with this volume. If absent, this volume was not
- created from an image, or the image did not include an operating system.
- :param ImageReference source_image: (optional) The image from which this
- volume was created (this may be
- [deleted](https://cloud.ibm.com/apidocs/vpc#deleted-resources)).
- If absent, this volume was not created from an image.
- :param SnapshotReference source_snapshot: (optional) The snapshot from
- which this volume was cloned.
+ :param VPCReferenceDeleted deleted: (optional) If present, this property
+ indicates the referenced resource has been deleted, and provides
+ some supplementary information.
"""
- self.active = active
- self.attachment_state = attachment_state
- self.bandwidth = bandwidth
- self.busy = busy
- self.capacity = capacity
- self.created_at = created_at
self.crn = crn
- self.encryption = encryption
- self.encryption_key = encryption_key
- self.health_reasons = health_reasons
- self.health_state = health_state
+ self.deleted = deleted
self.href = href
self.id = id
- self.iops = iops
self.name = name
- self.operating_system = operating_system
- self.profile = profile
- self.resource_group = resource_group
self.resource_type = resource_type
- self.source_image = source_image
- self.source_snapshot = source_snapshot
- self.status = status
- self.status_reasons = status_reasons
- self.user_tags = user_tags
- self.volume_attachments = volume_attachments
- self.zone = zone
@classmethod
- def from_dict(cls, _dict: Dict) -> 'Volume':
- """Initialize a Volume object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VPCReference':
+ """Initialize a VPCReference object from a json dictionary."""
args = {}
- if 'active' in _dict:
- args['active'] = _dict.get('active')
- else:
- raise ValueError('Required property \'active\' not present in Volume JSON')
- if 'attachment_state' in _dict:
- args['attachment_state'] = _dict.get('attachment_state')
- else:
- raise ValueError('Required property \'attachment_state\' not present in Volume JSON')
- if 'bandwidth' in _dict:
- args['bandwidth'] = _dict.get('bandwidth')
- else:
- raise ValueError('Required property \'bandwidth\' not present in Volume JSON')
- if 'busy' in _dict:
- args['busy'] = _dict.get('busy')
- else:
- raise ValueError('Required property \'busy\' not present in Volume JSON')
- if 'capacity' in _dict:
- args['capacity'] = _dict.get('capacity')
- else:
- raise ValueError('Required property \'capacity\' not present in Volume JSON')
- if 'created_at' in _dict:
- args['created_at'] = string_to_datetime(_dict.get('created_at'))
- else:
- raise ValueError('Required property \'created_at\' not present in Volume JSON')
- if 'crn' in _dict:
- args['crn'] = _dict.get('crn')
- else:
- raise ValueError('Required property \'crn\' not present in Volume JSON')
- if 'encryption' in _dict:
- args['encryption'] = _dict.get('encryption')
- else:
- raise ValueError('Required property \'encryption\' not present in Volume JSON')
- if 'encryption_key' in _dict:
- args['encryption_key'] = EncryptionKeyReference.from_dict(_dict.get('encryption_key'))
- if 'health_reasons' in _dict:
- args['health_reasons'] = [VolumeHealthReason.from_dict(v) for v in _dict.get('health_reasons')]
- else:
- raise ValueError('Required property \'health_reasons\' not present in Volume JSON')
- if 'health_state' in _dict:
- args['health_state'] = _dict.get('health_state')
- else:
- raise ValueError('Required property \'health_state\' not present in Volume JSON')
- if 'href' in _dict:
- args['href'] = _dict.get('href')
- else:
- raise ValueError('Required property \'href\' not present in Volume JSON')
- if 'id' in _dict:
- args['id'] = _dict.get('id')
- else:
- raise ValueError('Required property \'id\' not present in Volume JSON')
- if 'iops' in _dict:
- args['iops'] = _dict.get('iops')
- else:
- raise ValueError('Required property \'iops\' not present in Volume JSON')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
- else:
- raise ValueError('Required property \'name\' not present in Volume JSON')
- if 'operating_system' in _dict:
- args['operating_system'] = OperatingSystem.from_dict(_dict.get('operating_system'))
- if 'profile' in _dict:
- args['profile'] = VolumeProfileReference.from_dict(_dict.get('profile'))
- else:
- raise ValueError('Required property \'profile\' not present in Volume JSON')
- if 'resource_group' in _dict:
- args['resource_group'] = ResourceGroupReference.from_dict(_dict.get('resource_group'))
+ if (crn := _dict.get('crn')) is not None:
+ args['crn'] = crn
else:
- raise ValueError('Required property \'resource_group\' not present in Volume JSON')
- if 'resource_type' in _dict:
- args['resource_type'] = _dict.get('resource_type')
- else:
- raise ValueError('Required property \'resource_type\' not present in Volume JSON')
- if 'source_image' in _dict:
- args['source_image'] = ImageReference.from_dict(_dict.get('source_image'))
- if 'source_snapshot' in _dict:
- args['source_snapshot'] = SnapshotReference.from_dict(_dict.get('source_snapshot'))
- if 'status' in _dict:
- args['status'] = _dict.get('status')
- else:
- raise ValueError('Required property \'status\' not present in Volume JSON')
- if 'status_reasons' in _dict:
- args['status_reasons'] = [VolumeStatusReason.from_dict(v) for v in _dict.get('status_reasons')]
+ raise ValueError('Required property \'crn\' not present in VPCReference JSON')
+ if (deleted := _dict.get('deleted')) is not None:
+ args['deleted'] = VPCReferenceDeleted.from_dict(deleted)
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'status_reasons\' not present in Volume JSON')
- if 'user_tags' in _dict:
- args['user_tags'] = _dict.get('user_tags')
+ raise ValueError('Required property \'href\' not present in VPCReference JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
else:
- raise ValueError('Required property \'user_tags\' not present in Volume JSON')
- if 'volume_attachments' in _dict:
- args['volume_attachments'] = [VolumeAttachmentReferenceVolumeContext.from_dict(v) for v in _dict.get('volume_attachments')]
+ raise ValueError('Required property \'id\' not present in VPCReference JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
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 \'name\' not present in VPCReference JSON')
+ if (resource_type := _dict.get('resource_type')) is not None:
+ args['resource_type'] = resource_type
else:
- raise ValueError('Required property \'zone\' not present in Volume JSON')
+ raise ValueError('Required property \'resource_type\' not present in VPCReference JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a Volume 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, 'active') and self.active is not None:
- _dict['active'] = self.active
- if hasattr(self, 'attachment_state') and self.attachment_state is not None:
- _dict['attachment_state'] = self.attachment_state
- if hasattr(self, 'bandwidth') and self.bandwidth is not None:
- _dict['bandwidth'] = self.bandwidth
- if hasattr(self, 'busy') and self.busy is not None:
- _dict['busy'] = self.busy
- if hasattr(self, 'capacity') and self.capacity is not None:
- _dict['capacity'] = self.capacity
- if hasattr(self, 'created_at') and self.created_at is not None:
- _dict['created_at'] = datetime_to_string(self.created_at)
if hasattr(self, 'crn') and self.crn is not None:
_dict['crn'] = self.crn
- if hasattr(self, 'encryption') and self.encryption is not None:
- _dict['encryption'] = self.encryption
- if hasattr(self, 'encryption_key') and self.encryption_key is not None:
- if isinstance(self.encryption_key, dict):
- _dict['encryption_key'] = self.encryption_key
+ if hasattr(self, 'deleted') and self.deleted is not None:
+ if isinstance(self.deleted, dict):
+ _dict['deleted'] = self.deleted
else:
- _dict['encryption_key'] = self.encryption_key.to_dict()
- if hasattr(self, 'health_reasons') and self.health_reasons is not None:
- health_reasons_list = []
- for v in self.health_reasons:
- if isinstance(v, dict):
- health_reasons_list.append(v)
- else:
- health_reasons_list.append(v.to_dict())
- _dict['health_reasons'] = health_reasons_list
- if hasattr(self, 'health_state') and self.health_state is not None:
- _dict['health_state'] = self.health_state
+ _dict['deleted'] = self.deleted.to_dict()
if hasattr(self, 'href') and self.href is not None:
_dict['href'] = self.href
if hasattr(self, 'id') and self.id is not None:
_dict['id'] = self.id
- if hasattr(self, 'iops') and self.iops is not None:
- _dict['iops'] = self.iops
if hasattr(self, 'name') and self.name is not None:
_dict['name'] = self.name
- if hasattr(self, 'operating_system') and self.operating_system is not None:
- if isinstance(self.operating_system, dict):
- _dict['operating_system'] = self.operating_system
- else:
- _dict['operating_system'] = self.operating_system.to_dict()
- if hasattr(self, 'profile') and self.profile is not None:
- if isinstance(self.profile, dict):
- _dict['profile'] = self.profile
- else:
- _dict['profile'] = self.profile.to_dict()
- if hasattr(self, 'resource_group') and self.resource_group is not None:
- if isinstance(self.resource_group, dict):
- _dict['resource_group'] = self.resource_group
- else:
- _dict['resource_group'] = self.resource_group.to_dict()
if hasattr(self, 'resource_type') and self.resource_type is not None:
_dict['resource_type'] = self.resource_type
- if hasattr(self, 'source_image') and self.source_image is not None:
- if isinstance(self.source_image, dict):
- _dict['source_image'] = self.source_image
- else:
- _dict['source_image'] = self.source_image.to_dict()
- if hasattr(self, 'source_snapshot') and self.source_snapshot is not None:
- if isinstance(self.source_snapshot, dict):
- _dict['source_snapshot'] = self.source_snapshot
- else:
- _dict['source_snapshot'] = self.source_snapshot.to_dict()
- if hasattr(self, 'status') and self.status is not None:
- _dict['status'] = self.status
- if hasattr(self, 'status_reasons') and self.status_reasons is not None:
- status_reasons_list = []
- for v in self.status_reasons:
- if isinstance(v, dict):
- status_reasons_list.append(v)
- else:
- status_reasons_list.append(v.to_dict())
- _dict['status_reasons'] = status_reasons_list
- if hasattr(self, 'user_tags') and self.user_tags is not None:
- _dict['user_tags'] = self.user_tags
- if hasattr(self, 'volume_attachments') and self.volume_attachments is not None:
- volume_attachments_list = []
- for v in self.volume_attachments:
- if isinstance(v, dict):
- volume_attachments_list.append(v)
- else:
- volume_attachments_list.append(v.to_dict())
- _dict['volume_attachments'] = volume_attachments_list
- if hasattr(self, 'zone') and self.zone is not None:
- if isinstance(self.zone, dict):
- _dict['zone'] = self.zone
- else:
- _dict['zone'] = self.zone.to_dict()
return _dict
def _to_dict(self):
@@ -83564,235 +85812,141 @@ 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 VPCReference object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'Volume') -> 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: 'Volume') -> bool:
+ def __ne__(self, other: 'VPCReference') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class AttachmentStateEnum(str, Enum):
- """
- The attachment state of the volume
- - `unattached`: Not attached to any virtual server instances
- - `attached`: Attached to a virtual server instance (even if the instance is
- stopped)
- - `unusable`: Not able to be attached to any virtual server instances.
- """
-
- ATTACHED = 'attached'
- UNATTACHED = 'unattached'
- UNUSABLE = 'unusable'
-
-
- class EncryptionEnum(str, Enum):
- """
- The type of encryption used on the volume.
- """
-
- PROVIDER_MANAGED = 'provider_managed'
- USER_MANAGED = 'user_managed'
-
-
- class HealthStateEnum(str, Enum):
- """
- The health of this resource.
- - `ok`: No abnormal behavior detected
- - `degraded`: Experiencing compromised performance, capacity, or connectivity
- - `faulted`: Completely unreachable, inoperative, or otherwise entirely
- incapacitated
- - `inapplicable`: The health state does not apply because of the current lifecycle
- state. A resource with a lifecycle state of `failed` or `deleting` will have a
- health state of `inapplicable`. A `pending` resource may also have this state.
- """
-
- DEGRADED = 'degraded'
- FAULTED = 'faulted'
- INAPPLICABLE = 'inapplicable'
- OK = 'ok'
-
-
class ResourceTypeEnum(str, Enum):
"""
The resource type.
"""
- VOLUME = 'volume'
-
-
- class StatusEnum(str, Enum):
- """
- The status of the volume.
- The enumerated values for this property will expand in the future. When processing
- this property, check for and log unknown values. Optionally halt processing and
- surface the error, or bypass the volume on which the unexpected property value was
- encountered.
- """
-
- AVAILABLE = 'available'
- FAILED = 'failed'
- PENDING = 'pending'
- PENDING_DELETION = 'pending_deletion'
- UNUSABLE = 'unusable'
- UPDATING = 'updating'
+ VPC = 'vpc'
-class VolumeAttachment:
+class VPCReferenceDNSResolverContext:
"""
- VolumeAttachment.
+ A VPC whose DNS resolver is delegated to provide DNS servers for this VPC.
+ The VPC may be remote and therefore may not be directly retrievable.
- :attr int bandwidth: The maximum bandwidth (in megabits per second) for the
- volume when attached to this instance. This may be lower than the volume
- bandwidth depending on the configuration of the instance.
- :attr datetime created_at: The date and time that the volume was attached.
- :attr bool delete_volume_on_instance_delete: Indicates whether deleting the
- instance will also delete the attached volume.
- :attr VolumeAttachmentDevice device: (optional) Information about how the volume
- is exposed to the instance operating system.
- This property may be absent if the volume attachment's `status` is not
- `attached`.
- :attr str href: The URL for this volume attachment.
- :attr str id: The unique identifier for this volume attachment.
- :attr str name: The name for this volume attachment. The name is unique across
- all volume attachments on the instance.
- :attr str status: The status of this volume attachment.
- :attr str type: The type of volume attachment.
- :attr VolumeReferenceVolumeAttachmentContext volume: (optional) The attached
- volume.
- This property will be absent if the volume has not yet been provisioned.
+ :param str crn: The CRN for this VPC.
+ :param VPCReferenceDNSResolverContextDeleted 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 VPC.
+ :param str id: The unique identifier for this VPC.
+ :param str name: The name for this VPC. The name is unique across all VPCs in
+ the region.
+ :param VPCRemote remote: (optional) If present, this property indicates that the
+ resource associated with this reference
+ is remote and therefore may not be directly retrievable.
+ :param str resource_type: The resource type.
"""
def __init__(
self,
- bandwidth: int,
- created_at: datetime,
- delete_volume_on_instance_delete: bool,
+ crn: str,
href: str,
id: str,
name: str,
- status: str,
- type: str,
+ resource_type: str,
*,
- device: 'VolumeAttachmentDevice' = None,
- volume: 'VolumeReferenceVolumeAttachmentContext' = None,
+ deleted: Optional['VPCReferenceDNSResolverContextDeleted'] = None,
+ remote: Optional['VPCRemote'] = None,
) -> None:
"""
- Initialize a VolumeAttachment object.
+ Initialize a VPCReferenceDNSResolverContext object.
- :param int bandwidth: The maximum bandwidth (in megabits per second) for
- the volume when attached to this instance. This may be lower than the
- volume bandwidth depending on the configuration of the instance.
- :param datetime created_at: The date and time that the volume was attached.
- :param bool delete_volume_on_instance_delete: Indicates whether deleting
- the instance will also delete the attached volume.
- :param str href: The URL for this volume attachment.
- :param str id: The unique identifier for this volume attachment.
- :param str name: The name for this volume attachment. The name is unique
- across all volume attachments on the instance.
- :param str status: The status of this volume attachment.
- :param str type: The type of volume attachment.
- :param VolumeAttachmentDevice device: (optional) Information about how the
- volume is exposed to the instance operating system.
- This property may be absent if the volume attachment's `status` is not
- `attached`.
- :param VolumeReferenceVolumeAttachmentContext volume: (optional) The
- attached volume.
- This property will be absent if the volume has not yet been provisioned.
+ :param str crn: The CRN for this VPC.
+ :param str href: The URL for this VPC.
+ :param str id: The unique identifier for this VPC.
+ :param str name: The name for this VPC. The name is unique across all VPCs
+ in the region.
+ :param str resource_type: The resource type.
+ :param VPCReferenceDNSResolverContextDeleted deleted: (optional) If
+ present, this property indicates the referenced resource has been deleted,
+ and provides
+ some supplementary information.
+ :param VPCRemote remote: (optional) If present, this property indicates
+ that the resource associated with this reference
+ is remote and therefore may not be directly retrievable.
"""
- self.bandwidth = bandwidth
- self.created_at = created_at
- self.delete_volume_on_instance_delete = delete_volume_on_instance_delete
- self.device = device
+ self.crn = crn
+ self.deleted = deleted
self.href = href
self.id = id
self.name = name
- self.status = status
- self.type = type
- self.volume = volume
+ self.remote = remote
+ self.resource_type = resource_type
@classmethod
- def from_dict(cls, _dict: Dict) -> 'VolumeAttachment':
- """Initialize a VolumeAttachment object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VPCReferenceDNSResolverContext':
+ """Initialize a VPCReferenceDNSResolverContext object from a json dictionary."""
args = {}
- if 'bandwidth' in _dict:
- args['bandwidth'] = _dict.get('bandwidth')
+ if (crn := _dict.get('crn')) is not None:
+ args['crn'] = crn
else:
- raise ValueError('Required property \'bandwidth\' not present in VolumeAttachment JSON')
- if 'created_at' in _dict:
- args['created_at'] = string_to_datetime(_dict.get('created_at'))
- else:
- raise ValueError('Required property \'created_at\' not present in VolumeAttachment JSON')
- if 'delete_volume_on_instance_delete' in _dict:
- args['delete_volume_on_instance_delete'] = _dict.get('delete_volume_on_instance_delete')
- else:
- raise ValueError('Required property \'delete_volume_on_instance_delete\' not present in VolumeAttachment JSON')
- if 'device' in _dict:
- args['device'] = VolumeAttachmentDevice.from_dict(_dict.get('device'))
- if 'href' in _dict:
- args['href'] = _dict.get('href')
- else:
- raise ValueError('Required property \'href\' not present in VolumeAttachment JSON')
- if 'id' in _dict:
- args['id'] = _dict.get('id')
+ raise ValueError('Required property \'crn\' not present in VPCReferenceDNSResolverContext JSON')
+ if (deleted := _dict.get('deleted')) is not None:
+ args['deleted'] = VPCReferenceDNSResolverContextDeleted.from_dict(deleted)
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'id\' not present in VolumeAttachment JSON')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
+ raise ValueError('Required property \'href\' not present in VPCReferenceDNSResolverContext JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
else:
- raise ValueError('Required property \'name\' not present in VolumeAttachment JSON')
- if 'status' in _dict:
- args['status'] = _dict.get('status')
+ raise ValueError('Required property \'id\' not present in VPCReferenceDNSResolverContext JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
else:
- raise ValueError('Required property \'status\' not present in VolumeAttachment JSON')
- if 'type' in _dict:
- args['type'] = _dict.get('type')
+ raise ValueError('Required property \'name\' not present in VPCReferenceDNSResolverContext JSON')
+ if (remote := _dict.get('remote')) is not None:
+ args['remote'] = VPCRemote.from_dict(remote)
+ if (resource_type := _dict.get('resource_type')) is not None:
+ args['resource_type'] = resource_type
else:
- raise ValueError('Required property \'type\' not present in VolumeAttachment JSON')
- if 'volume' in _dict:
- args['volume'] = VolumeReferenceVolumeAttachmentContext.from_dict(_dict.get('volume'))
+ raise ValueError('Required property \'resource_type\' not present in VPCReferenceDNSResolverContext JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VolumeAttachment object from a json dictionary."""
+ """Initialize a VPCReferenceDNSResolverContext object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'bandwidth') and self.bandwidth is not None:
- _dict['bandwidth'] = self.bandwidth
- if hasattr(self, 'created_at') and self.created_at is not None:
- _dict['created_at'] = datetime_to_string(self.created_at)
- if hasattr(self, 'delete_volume_on_instance_delete') and self.delete_volume_on_instance_delete is not None:
- _dict['delete_volume_on_instance_delete'] = self.delete_volume_on_instance_delete
- if hasattr(self, 'device') and self.device is not None:
- if isinstance(self.device, dict):
- _dict['device'] = self.device
+ if hasattr(self, 'crn') and self.crn is not None:
+ _dict['crn'] = self.crn
+ if hasattr(self, 'deleted') and self.deleted is not None:
+ if isinstance(self.deleted, dict):
+ _dict['deleted'] = self.deleted
else:
- _dict['device'] = self.device.to_dict()
+ _dict['deleted'] = self.deleted.to_dict()
if hasattr(self, 'href') and self.href is not None:
_dict['href'] = self.href
if hasattr(self, 'id') and self.id is not None:
_dict['id'] = self.id
if hasattr(self, 'name') and self.name is not None:
_dict['name'] = self.name
- if hasattr(self, 'status') and self.status is not None:
- _dict['status'] = self.status
- if hasattr(self, 'type') and self.type is not None:
- _dict['type'] = self.type
- if hasattr(self, 'volume') and self.volume is not None:
- if isinstance(self.volume, dict):
- _dict['volume'] = self.volume
+ if hasattr(self, 'remote') and self.remote is not None:
+ if isinstance(self.remote, dict):
+ _dict['remote'] = self.remote
else:
- _dict['volume'] = self.volume.to_dict()
+ _dict['remote'] = self.remote.to_dict()
+ if hasattr(self, 'resource_type') and self.resource_type is not None:
+ _dict['resource_type'] = self.resource_type
return _dict
def _to_dict(self):
@@ -83800,86 +85954,67 @@ 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 VPCReferenceDNSResolverContext object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VolumeAttachment') -> bool:
+ def __eq__(self, other: 'VPCReferenceDNSResolverContext') -> bool:
"""Return `true` when 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: 'VPCReferenceDNSResolverContext') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class StatusEnum(str, Enum):
- """
- The status of this volume attachment.
- """
-
- ATTACHED = 'attached'
- ATTACHING = 'attaching'
- DELETING = 'deleting'
- DETACHING = 'detaching'
-
-
- class TypeEnum(str, Enum):
+ class ResourceTypeEnum(str, Enum):
"""
- The type of volume attachment.
+ The resource type.
"""
- BOOT = 'boot'
- DATA = 'data'
+ VPC = 'vpc'
-class VolumeAttachmentCollection:
+class VPCReferenceDNSResolverContextDeleted:
"""
- VolumeAttachmentCollection.
+ If present, this property indicates the referenced resource has been deleted, and
+ provides some supplementary information.
- :attr List[VolumeAttachment] volume_attachments: Collection of volume
- attachments.
+ :param str more_info: Link to documentation about deleted resources.
"""
def __init__(
self,
- volume_attachments: List['VolumeAttachment'],
+ more_info: str,
) -> None:
"""
- Initialize a VolumeAttachmentCollection object.
+ Initialize a VPCReferenceDNSResolverContextDeleted object.
- :param List[VolumeAttachment] volume_attachments: Collection of volume
- attachments.
+ :param str more_info: Link to documentation about deleted resources.
"""
- self.volume_attachments = volume_attachments
+ self.more_info = more_info
@classmethod
- def from_dict(cls, _dict: Dict) -> 'VolumeAttachmentCollection':
- """Initialize a VolumeAttachmentCollection object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VPCReferenceDNSResolverContextDeleted':
+ """Initialize a VPCReferenceDNSResolverContextDeleted object from a json dictionary."""
args = {}
- if 'volume_attachments' in _dict:
- args['volume_attachments'] = [VolumeAttachment.from_dict(v) for v in _dict.get('volume_attachments')]
+ if (more_info := _dict.get('more_info')) is not None:
+ args['more_info'] = more_info
else:
- raise ValueError('Required property \'volume_attachments\' not present in VolumeAttachmentCollection JSON')
+ raise ValueError('Required property \'more_info\' not present in VPCReferenceDNSResolverContextDeleted JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VolumeAttachmentCollection object from a json dictionary."""
+ """Initialize a VPCReferenceDNSResolverContextDeleted object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'volume_attachments') and self.volume_attachments is not None:
- volume_attachments_list = []
- for v in self.volume_attachments:
- if isinstance(v, dict):
- volume_attachments_list.append(v)
- else:
- volume_attachments_list.append(v.to_dict())
- _dict['volume_attachments'] = volume_attachments_list
+ if hasattr(self, 'more_info') and self.more_info is not None:
+ _dict['more_info'] = self.more_info
return _dict
def _to_dict(self):
@@ -83887,59 +86022,59 @@ 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 VPCReferenceDNSResolverContextDeleted object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VolumeAttachmentCollection') -> bool:
+ def __eq__(self, other: 'VPCReferenceDNSResolverContextDeleted') -> bool:
"""Return `true` when 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: 'VPCReferenceDNSResolverContextDeleted') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class VolumeAttachmentDevice:
+class VPCReferenceDeleted:
"""
- VolumeAttachmentDevice.
+ If present, this property indicates the referenced resource has been deleted, and
+ provides some supplementary information.
- :attr str id: (optional) A unique identifier for the device which is exposed to
- the instance operating system.
+ :param str more_info: Link to documentation about deleted resources.
"""
def __init__(
self,
- *,
- id: str = None,
+ more_info: str,
) -> None:
"""
- Initialize a VolumeAttachmentDevice object.
+ Initialize a VPCReferenceDeleted object.
- :param str id: (optional) A unique identifier for the device which is
- exposed to the instance operating system.
+ :param str more_info: Link to documentation about deleted resources.
"""
- self.id = id
+ self.more_info = more_info
@classmethod
- def from_dict(cls, _dict: Dict) -> 'VolumeAttachmentDevice':
- """Initialize a VolumeAttachmentDevice object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VPCReferenceDeleted':
+ """Initialize a VPCReferenceDeleted object from a json dictionary."""
args = {}
- if 'id' in _dict:
- args['id'] = _dict.get('id')
+ if (more_info := _dict.get('more_info')) is not None:
+ args['more_info'] = 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 VolumeAttachmentDevice object from a json dictionary."""
+ """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, 'id') and self.id is not None:
- _dict['id'] = self.id
+ if hasattr(self, 'more_info') and self.more_info is not None:
+ _dict['more_info'] = self.more_info
return _dict
def _to_dict(self):
@@ -83947,69 +86082,116 @@ 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 VPCReferenceDeleted object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VolumeAttachmentDevice') -> 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: 'VolumeAttachmentDevice') -> bool:
+ def __ne__(self, other: 'VPCReferenceDeleted') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class VolumeAttachmentPatch:
+class VPCReferenceRemote:
"""
- VolumeAttachmentPatch.
+ VPCReferenceRemote.
- :attr bool delete_volume_on_instance_delete: (optional) Indicates whether
- deleting the instance will also delete the attached volume.
- :attr str name: (optional) The name for this volume attachment. The name must
- not be used by another volume attachment on the instance.
+ :param str crn: The CRN for this VPC.
+ :param str href: The URL for this VPC.
+ :param str id: The unique identifier for this VPC.
+ :param str name: The name for this VPC. The name is unique across all VPCs in
+ the region.
+ :param VPCRemote remote: (optional) If present, this property indicates that the
+ resource associated with this reference
+ is remote and therefore may not be directly retrievable.
+ :param str resource_type: The resource type.
"""
def __init__(
self,
+ crn: str,
+ href: str,
+ id: str,
+ name: str,
+ resource_type: str,
*,
- delete_volume_on_instance_delete: bool = None,
- name: str = None,
+ remote: Optional['VPCRemote'] = None,
) -> None:
"""
- Initialize a VolumeAttachmentPatch object.
+ Initialize a VPCReferenceRemote object.
- :param bool delete_volume_on_instance_delete: (optional) Indicates whether
- deleting the instance will also delete the attached volume.
- :param str name: (optional) The name for this volume attachment. The name
- must not be used by another volume attachment on the instance.
+ :param str crn: The CRN for this VPC.
+ :param str href: The URL for this VPC.
+ :param str id: The unique identifier for this VPC.
+ :param str name: The name for this VPC. The name is unique across all VPCs
+ in the region.
+ :param str resource_type: The resource type.
+ :param VPCRemote remote: (optional) If present, this property indicates
+ that the resource associated with this reference
+ is remote and therefore may not be directly retrievable.
"""
- self.delete_volume_on_instance_delete = delete_volume_on_instance_delete
+ self.crn = crn
+ self.href = href
+ self.id = id
self.name = name
+ self.remote = remote
+ self.resource_type = resource_type
@classmethod
- def from_dict(cls, _dict: Dict) -> 'VolumeAttachmentPatch':
- """Initialize a VolumeAttachmentPatch object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VPCReferenceRemote':
+ """Initialize a VPCReferenceRemote 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 (crn := _dict.get('crn')) is not None:
+ args['crn'] = crn
+ else:
+ raise ValueError('Required property \'crn\' not present in VPCReferenceRemote JSON')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
+ else:
+ raise ValueError('Required property \'href\' not present in VPCReferenceRemote JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
+ else:
+ raise ValueError('Required property \'id\' not present in VPCReferenceRemote JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ else:
+ raise ValueError('Required property \'name\' not present in VPCReferenceRemote JSON')
+ if (remote := _dict.get('remote')) is not None:
+ args['remote'] = VPCRemote.from_dict(remote)
+ if (resource_type := _dict.get('resource_type')) is not None:
+ args['resource_type'] = resource_type
+ else:
+ raise ValueError('Required property \'resource_type\' not present in VPCReferenceRemote JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VolumeAttachmentPatch object from a json dictionary."""
+ """Initialize a VPCReferenceRemote object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'delete_volume_on_instance_delete') and self.delete_volume_on_instance_delete is not None:
- _dict['delete_volume_on_instance_delete'] = self.delete_volume_on_instance_delete
+ if hasattr(self, 'crn') and self.crn is not None:
+ _dict['crn'] = self.crn
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
+ if hasattr(self, 'id') and self.id is not None:
+ _dict['id'] = self.id
if hasattr(self, 'name') and self.name is not None:
_dict['name'] = self.name
+ if hasattr(self, 'remote') and self.remote is not None:
+ if isinstance(self.remote, dict):
+ _dict['remote'] = self.remote
+ else:
+ _dict['remote'] = self.remote.to_dict()
+ if hasattr(self, 'resource_type') and self.resource_type is not None:
+ _dict['resource_type'] = self.resource_type
return _dict
def _to_dict(self):
@@ -84017,86 +86199,88 @@ 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 VPCReferenceRemote object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VolumeAttachmentPatch') -> bool:
+ def __eq__(self, other: 'VPCReferenceRemote') -> bool:
"""Return `true` when 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: 'VPCReferenceRemote') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
+ class ResourceTypeEnum(str, Enum):
+ """
+ The resource type.
+ """
+
+ VPC = 'vpc'
-class VolumeAttachmentPrototype:
+
+
+class VPCRemote:
"""
- VolumeAttachmentPrototype.
+ If present, this property indicates that the resource associated with this reference
+ is remote and therefore may not be directly retrievable.
- :attr bool delete_volume_on_instance_delete: (optional) Indicates whether
- deleting the instance will also delete the attached volume.
- :attr str name: (optional) The name for this volume attachment. The name must
- not be used by another volume attachment on the instance. If unspecified, the
- name will be a hyphenated list of randomly-selected words.
- :attr VolumeAttachmentPrototypeVolume volume: An existing volume to attach to
- the instance, or a prototype object for a new volume.
+ :param AccountReference account: (optional) If present, this property indicates
+ that the referenced resource is remote to this
+ account, and identifies the owning account.
+ :param RegionReference region: (optional) If present, this property indicates
+ that the referenced resource is remote to this
+ region, and identifies the native region.
"""
def __init__(
self,
- volume: 'VolumeAttachmentPrototypeVolume',
*,
- delete_volume_on_instance_delete: bool = None,
- name: str = None,
+ account: Optional['AccountReference'] = None,
+ region: Optional['RegionReference'] = None,
) -> None:
"""
- Initialize a VolumeAttachmentPrototype object.
+ Initialize a VPCRemote object.
- :param VolumeAttachmentPrototypeVolume volume: An existing volume to attach
- to the instance, or a prototype object for a new volume.
- :param bool delete_volume_on_instance_delete: (optional) Indicates whether
- deleting the instance will also delete the attached volume.
- :param str name: (optional) The name for this volume attachment. The name
- must not be used by another volume attachment on the instance. If
- unspecified, the name will be a hyphenated list of randomly-selected words.
+ :param AccountReference account: (optional) If present, this property
+ indicates that the referenced resource is remote to this
+ account, and identifies the owning account.
+ :param RegionReference region: (optional) If present, this property
+ indicates that the referenced resource is remote to this
+ region, and identifies the native region.
"""
- self.delete_volume_on_instance_delete = delete_volume_on_instance_delete
- self.name = name
- self.volume = volume
+ self.account = account
+ self.region = region
@classmethod
- def from_dict(cls, _dict: Dict) -> 'VolumeAttachmentPrototype':
- """Initialize a VolumeAttachmentPrototype object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VPCRemote':
+ """Initialize a VPCRemote object from a json dictionary."""
args = {}
- if 'delete_volume_on_instance_delete' in _dict:
- args['delete_volume_on_instance_delete'] = _dict.get('delete_volume_on_instance_delete')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
- if 'volume' in _dict:
- args['volume'] = _dict.get('volume')
- else:
- raise ValueError('Required property \'volume\' not present in VolumeAttachmentPrototype JSON')
+ if (account := _dict.get('account')) is not None:
+ args['account'] = AccountReference.from_dict(account)
+ if (region := _dict.get('region')) is not None:
+ args['region'] = RegionReference.from_dict(region)
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VolumeAttachmentPrototype object from a json dictionary."""
+ """Initialize a VPCRemote object from 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
+ if hasattr(self, 'account') and self.account is not None:
+ if isinstance(self.account, dict):
+ _dict['account'] = self.account
else:
- _dict['volume'] = self.volume.to_dict()
+ _dict['account'] = self.account.to_dict()
+ if hasattr(self, 'region') and self.region is not None:
+ if isinstance(self.region, dict):
+ _dict['region'] = self.region
+ else:
+ _dict['region'] = self.region.to_dict()
return _dict
def _to_dict(self):
@@ -84104,86 +86288,279 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this VolumeAttachmentPrototype object."""
+ """Return a `str` version of this VPCRemote object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VolumeAttachmentPrototype') -> bool:
+ def __eq__(self, other: 'VPCRemote') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'VolumeAttachmentPrototype') -> bool:
+ def __ne__(self, other: 'VPCRemote') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class VolumeAttachmentPrototypeInstanceByImageContext:
+class VPNGateway:
"""
- VolumeAttachmentPrototypeInstanceByImageContext.
+ VPNGateway.
- :attr bool delete_volume_on_instance_delete: (optional) Indicates whether
- deleting the instance will also delete the attached volume.
- :attr str name: (optional) The name for this volume attachment. The name must
- not be used by another volume attachment on the instance. If unspecified, the
- name will be a hyphenated list of randomly-selected words.
- :attr VolumePrototypeInstanceByImageContext volume: A prototype object for a new
- volume.
+ :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 List[VPNGatewayHealthReason] health_reasons: The reasons for the current
+ VPN gateway health_state (if any):
+ - `cannot_create_vpc_route`: VPN cannot create route (check for conflict)
+ - `cannot_reserve_ip_address`: IP address exhaustion (release addresses on the
+ VPN's
+ subnet)
+ - `internal_error`: Internal error (contact IBM support)
+ The enumerated reason code values for this property will expand in the future.
+ When processing this property, check for and log unknown values. Optionally halt
+ processing and surface the error, or bypass the resource on which the unexpected
+ reason code was encountered.
+ :param str health_state: The health of this resource.
+ - `ok`: No abnormal behavior detected
+ - `degraded`: Experiencing compromised performance, capacity, or connectivity
+ - `faulted`: Completely unreachable, inoperative, or otherwise entirely
+ incapacitated
+ - `inapplicable`: The health state does not apply because of the current
+ lifecycle state. A resource with a lifecycle state of `failed` or `deleting`
+ will have a health state of `inapplicable`. A `pending` resource may also have
+ this state.
+ :param str href: The VPN gateway's canonical URL.
+ :param str id: The unique identifier for this VPN gateway.
+ :param List[VPNGatewayLifecycleReason] lifecycle_reasons: The reasons for the
+ current VPN gateway lifecycle_state (if any):
+ - `resource_suspended_by_provider`: The resource has been suspended (contact IBM
+ support)
+ The enumerated reason code values for this property will expand in the future.
+ When processing this property, check for and log unknown values. Optionally halt
+ processing and surface the error, or bypass the resource on which the unexpected
+ reason code was encountered.
+ :param str lifecycle_state: The lifecycle state of the VPN gateway.
+ :param List[VPNGatewayMember] members: Collection of VPN gateway members.
+ :param str name: The name for this VPN gateway. The name is unique across all
+ VPN gateways in the VPC.
+ :param ResourceGroupReference resource_group: The resource group for this VPN
+ gateway.
+ :param str resource_type: The resource type.
+ :param SubnetReference subnet:
+ :param VPCReference vpc: The VPC this VPN gateway resides in.
"""
def __init__(
self,
- volume: 'VolumePrototypeInstanceByImageContext',
+ connections: List['VPNGatewayConnectionReference'],
+ created_at: datetime,
+ crn: str,
+ health_reasons: List['VPNGatewayHealthReason'],
+ health_state: str,
+ href: str,
+ id: str,
+ lifecycle_reasons: List['VPNGatewayLifecycleReason'],
+ lifecycle_state: str,
+ members: List['VPNGatewayMember'],
+ name: str,
+ resource_group: 'ResourceGroupReference',
+ resource_type: str,
+ subnet: 'SubnetReference',
+ vpc: 'VPCReference',
+ ) -> None:
+ """
+ Initialize a VPNGateway object.
+
+ :param List[VPNGatewayConnectionReference] connections: Connections for
+ this VPN gateway.
+ :param datetime created_at: The date and time that this VPN gateway was
+ created.
+ :param str crn: The VPN gateway's CRN.
+ :param List[VPNGatewayHealthReason] health_reasons: The reasons for the
+ current VPN gateway health_state (if any):
+ - `cannot_create_vpc_route`: VPN cannot create route (check for conflict)
+ - `cannot_reserve_ip_address`: IP address exhaustion (release addresses on
+ the VPN's
+ subnet)
+ - `internal_error`: Internal error (contact IBM support)
+ The enumerated reason code values for this property will expand in the
+ future. When processing this property, check for and log unknown values.
+ Optionally halt processing and surface the error, or bypass the resource on
+ which the unexpected reason code was encountered.
+ :param str health_state: The health of this resource.
+ - `ok`: No abnormal behavior detected
+ - `degraded`: Experiencing compromised performance, capacity, or
+ connectivity
+ - `faulted`: Completely unreachable, inoperative, or otherwise entirely
+ incapacitated
+ - `inapplicable`: The health state does not apply because of the current
+ lifecycle state. A resource with a lifecycle state of `failed` or
+ `deleting` will have a health state of `inapplicable`. A `pending` resource
+ may also have this state.
+ :param str href: The VPN gateway's canonical URL.
+ :param str id: The unique identifier for this VPN gateway.
+ :param List[VPNGatewayLifecycleReason] lifecycle_reasons: The reasons for
+ the current VPN gateway lifecycle_state (if any):
+ - `resource_suspended_by_provider`: The resource has been suspended
+ (contact IBM
+ support)
+ The enumerated reason code values for this property will expand in the
+ future. When processing this property, check for and log unknown values.
+ Optionally halt processing and surface the error, or bypass the resource on
+ which the unexpected reason code was encountered.
+ :param str lifecycle_state: The lifecycle state of the VPN gateway.
+ :param List[VPNGatewayMember] members: Collection of VPN gateway members.
+ :param str name: The name for this VPN gateway. The name is unique across
+ all VPN gateways in the VPC.
+ :param ResourceGroupReference resource_group: The resource group for this
+ VPN gateway.
+ :param str resource_type: The resource type.
+ :param SubnetReference subnet:
+ :param VPCReference vpc: The VPC this VPN gateway resides in.
+ """
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['VPNGatewayRouteMode', 'VPNGatewayPolicyMode'])
+ )
+ raise Exception(msg)
+
+ class HealthStateEnum(str, Enum):
+ """
+ The health of this resource.
+ - `ok`: No abnormal behavior detected
+ - `degraded`: Experiencing compromised performance, capacity, or connectivity
+ - `faulted`: Completely unreachable, inoperative, or otherwise entirely
+ incapacitated
+ - `inapplicable`: The health state does not apply because of the current lifecycle
+ state. A resource with a lifecycle state of `failed` or `deleting` will have a
+ health state of `inapplicable`. A `pending` resource may also have this state.
+ """
+
+ DEGRADED = 'degraded'
+ FAULTED = 'faulted'
+ INAPPLICABLE = 'inapplicable'
+ OK = 'ok'
+
+
+ class LifecycleStateEnum(str, Enum):
+ """
+ The lifecycle state of the VPN gateway.
+ """
+
+ DELETING = 'deleting'
+ FAILED = 'failed'
+ PENDING = 'pending'
+ STABLE = 'stable'
+ SUSPENDED = 'suspended'
+ UPDATING = 'updating'
+ WAITING = 'waiting'
+
+
+ class ResourceTypeEnum(str, Enum):
+ """
+ The resource type.
+ """
+
+ VPN_GATEWAY = 'vpn_gateway'
+
+
+
+class VPNGatewayCollection:
+ """
+ VPNGatewayCollection.
+
+ :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 VPNGatewayCollectionNext next: (optional) A link to the next page of
+ resources. This property is present for all pages
+ except the last page.
+ :param int total_count: The total number of resources across all pages.
+ :param List[VPNGateway] vpn_gateways: Collection of VPN gateways.
+ """
+
+ def __init__(
+ self,
+ first: 'VPNGatewayCollectionFirst',
+ limit: int,
+ total_count: int,
+ vpn_gateways: List['VPNGateway'],
*,
- delete_volume_on_instance_delete: bool = None,
- name: str = None,
+ next: Optional['VPNGatewayCollectionNext'] = None,
) -> None:
"""
- Initialize a VolumeAttachmentPrototypeInstanceByImageContext object.
+ Initialize a VPNGatewayCollection object.
- :param VolumePrototypeInstanceByImageContext volume: A prototype object for
- a new volume.
- :param bool delete_volume_on_instance_delete: (optional) Indicates whether
- deleting the instance will also delete the attached volume.
- :param str name: (optional) The name for this volume attachment. The name
- must not be used by another volume attachment on the instance. If
- unspecified, the name will be a hyphenated list of randomly-selected words.
+ :param VPNGatewayCollectionFirst first: A link to the first page of
+ resources.
+ :param int limit: The maximum number of resources that can be returned by
+ the request.
+ :param int total_count: The total number of resources across all pages.
+ :param List[VPNGateway] vpn_gateways: Collection of VPN gateways.
+ :param VPNGatewayCollectionNext next: (optional) A link to the next page of
+ resources. This property is present for all pages
+ except the last page.
"""
- self.delete_volume_on_instance_delete = delete_volume_on_instance_delete
- self.name = name
- self.volume = volume
+ self.first = first
+ self.limit = limit
+ self.next = next
+ self.total_count = total_count
+ self.vpn_gateways = vpn_gateways
@classmethod
- def from_dict(cls, _dict: Dict) -> 'VolumeAttachmentPrototypeInstanceByImageContext':
- """Initialize a VolumeAttachmentPrototypeInstanceByImageContext object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VPNGatewayCollection':
+ """Initialize a VPNGatewayCollection 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 (first := _dict.get('first')) is not None:
+ args['first'] = VPNGatewayCollectionFirst.from_dict(first)
else:
- raise ValueError('Required property \'volume\' not present in VolumeAttachmentPrototypeInstanceByImageContext JSON')
+ raise ValueError('Required property \'first\' not present in VPNGatewayCollection JSON')
+ if (limit := _dict.get('limit')) is not None:
+ args['limit'] = limit
+ else:
+ raise ValueError('Required property \'limit\' not present in VPNGatewayCollection JSON')
+ if (next := _dict.get('next')) is not None:
+ args['next'] = VPNGatewayCollectionNext.from_dict(next)
+ if (total_count := _dict.get('total_count')) is not None:
+ args['total_count'] = total_count
+ else:
+ raise ValueError('Required property \'total_count\' not present in VPNGatewayCollection JSON')
+ if (vpn_gateways := _dict.get('vpn_gateways')) is not None:
+ args['vpn_gateways'] = 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 VolumeAttachmentPrototypeInstanceByImageContext object from a json dictionary."""
+ """Initialize a VPNGatewayCollection object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, '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
+ if hasattr(self, 'first') and self.first is not None:
+ if isinstance(self.first, dict):
+ _dict['first'] = self.first
else:
- _dict['volume'] = self.volume.to_dict()
+ _dict['first'] = self.first.to_dict()
+ if hasattr(self, 'limit') and self.limit is not None:
+ _dict['limit'] = self.limit
+ if hasattr(self, 'next') and self.next is not None:
+ if isinstance(self.next, dict):
+ _dict['next'] = self.next
+ else:
+ _dict['next'] = self.next.to_dict()
+ if hasattr(self, 'total_count') and self.total_count is not None:
+ _dict['total_count'] = self.total_count
+ if hasattr(self, 'vpn_gateways') and self.vpn_gateways is not None:
+ vpn_gateways_list = []
+ for v in self.vpn_gateways:
+ if isinstance(v, dict):
+ vpn_gateways_list.append(v)
+ else:
+ vpn_gateways_list.append(v.to_dict())
+ _dict['vpn_gateways'] = vpn_gateways_list
return _dict
def _to_dict(self):
@@ -84191,86 +86568,58 @@ 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 VPNGatewayCollection object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VolumeAttachmentPrototypeInstanceByImageContext') -> 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: 'VolumeAttachmentPrototypeInstanceByImageContext') -> bool:
+ def __ne__(self, other: 'VPNGatewayCollection') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class VolumeAttachmentPrototypeInstanceBySourceSnapshotContext:
+class VPNGatewayCollectionFirst:
"""
- VolumeAttachmentPrototypeInstanceBySourceSnapshotContext.
+ A link to the first page of resources.
- :attr bool delete_volume_on_instance_delete: (optional) Indicates whether
- deleting the instance will also delete the attached volume.
- :attr str name: (optional) The name for this volume attachment. The name must
- not be used by another volume attachment on the instance. If unspecified, the
- name will be a hyphenated list of randomly-selected words.
- :attr VolumePrototypeInstanceBySourceSnapshotContext volume: A prototype object
- for a new volume from a snapshot.
+ :param str href: The URL for a page of resources.
"""
def __init__(
self,
- volume: 'VolumePrototypeInstanceBySourceSnapshotContext',
- *,
- delete_volume_on_instance_delete: bool = None,
- name: str = None,
+ href: str,
) -> None:
"""
- Initialize a VolumeAttachmentPrototypeInstanceBySourceSnapshotContext object.
+ Initialize a VPNGatewayCollectionFirst object.
- :param VolumePrototypeInstanceBySourceSnapshotContext volume: A prototype
- object for a new volume from a snapshot.
- :param bool delete_volume_on_instance_delete: (optional) Indicates whether
- deleting the instance will also delete the attached volume.
- :param str name: (optional) The name for this volume attachment. The name
- must not be used by another volume attachment on the instance. If
- unspecified, the name will be a hyphenated list of randomly-selected words.
+ :param str href: The URL for a page of resources.
"""
- self.delete_volume_on_instance_delete = delete_volume_on_instance_delete
- self.name = name
- self.volume = volume
+ self.href = href
@classmethod
- def from_dict(cls, _dict: Dict) -> 'VolumeAttachmentPrototypeInstanceBySourceSnapshotContext':
- """Initialize a VolumeAttachmentPrototypeInstanceBySourceSnapshotContext object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VPNGatewayCollectionFirst':
+ """Initialize a VPNGatewayCollectionFirst object from a json dictionary."""
args = {}
- if 'delete_volume_on_instance_delete' in _dict:
- args['delete_volume_on_instance_delete'] = _dict.get('delete_volume_on_instance_delete')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
- if 'volume' in _dict:
- args['volume'] = VolumePrototypeInstanceBySourceSnapshotContext.from_dict(_dict.get('volume'))
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'volume\' not present in VolumeAttachmentPrototypeInstanceBySourceSnapshotContext JSON')
+ raise ValueError('Required property \'href\' not present in VPNGatewayCollectionFirst JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VolumeAttachmentPrototypeInstanceBySourceSnapshotContext object from a json dictionary."""
+ """Initialize a VPNGatewayCollectionFirst object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, '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, 'href') and self.href is not None:
+ _dict['href'] = self.href
return _dict
def _to_dict(self):
@@ -84278,84 +86627,59 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this VolumeAttachmentPrototypeInstanceBySourceSnapshotContext object."""
+ """Return a `str` version of this VPNGatewayCollectionFirst object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VolumeAttachmentPrototypeInstanceBySourceSnapshotContext') -> 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: 'VolumeAttachmentPrototypeInstanceBySourceSnapshotContext') -> bool:
+ def __ne__(self, other: 'VPNGatewayCollectionFirst') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class VolumeAttachmentPrototypeInstanceByVolumeContext:
+class VPNGatewayCollectionNext:
"""
- VolumeAttachmentPrototypeInstanceByVolumeContext.
+ A link to the next page of resources. This property is present for all pages except
+ the last page.
- :attr bool delete_volume_on_instance_delete: (optional) Indicates whether
- deleting the instance will also delete the attached volume.
- :attr str name: (optional) The name for this volume attachment. The name must
- not be used by another volume attachment on the instance. If unspecified, the
- name will be a hyphenated list of randomly-selected words.
- :attr VolumeIdentity volume: An existing volume to attach.
+ :param str href: The URL for a page of resources.
"""
def __init__(
self,
- volume: 'VolumeIdentity',
- *,
- delete_volume_on_instance_delete: bool = None,
- name: str = None,
+ href: str,
) -> None:
"""
- Initialize a VolumeAttachmentPrototypeInstanceByVolumeContext object.
+ Initialize a VPNGatewayCollectionNext object.
- :param VolumeIdentity volume: An existing volume to attach.
- :param bool delete_volume_on_instance_delete: (optional) Indicates whether
- deleting the instance will also delete the attached volume.
- :param str name: (optional) The name for this volume attachment. The name
- must not be used by another volume attachment on the instance. If
- unspecified, the name will be a hyphenated list of randomly-selected words.
+ :param str href: The URL for a page of resources.
"""
- self.delete_volume_on_instance_delete = delete_volume_on_instance_delete
- self.name = name
- self.volume = volume
+ self.href = href
@classmethod
- def from_dict(cls, _dict: Dict) -> 'VolumeAttachmentPrototypeInstanceByVolumeContext':
- """Initialize a VolumeAttachmentPrototypeInstanceByVolumeContext object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VPNGatewayCollectionNext':
+ """Initialize a VPNGatewayCollectionNext object from a json dictionary."""
args = {}
- if 'delete_volume_on_instance_delete' in _dict:
- args['delete_volume_on_instance_delete'] = _dict.get('delete_volume_on_instance_delete')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
- if 'volume' in _dict:
- args['volume'] = _dict.get('volume')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'volume\' not present in VolumeAttachmentPrototypeInstanceByVolumeContext JSON')
+ raise ValueError('Required property \'href\' not present in VPNGatewayCollectionNext JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VolumeAttachmentPrototypeInstanceByVolumeContext object from a json dictionary."""
+ """Initialize a VPNGatewayCollectionNext object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, '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, 'href') and self.href is not None:
+ _dict['href'] = self.href
return _dict
def _to_dict(self):
@@ -84363,149 +86687,235 @@ 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 VPNGatewayCollectionNext object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VolumeAttachmentPrototypeInstanceByVolumeContext') -> 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: 'VolumeAttachmentPrototypeInstanceByVolumeContext') -> bool:
+ def __ne__(self, other: 'VPNGatewayCollectionNext') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class VolumeAttachmentPrototypeVolume:
+class VPNGatewayConnection:
"""
- An existing volume to attach to the instance, or a prototype object for a new volume.
+ VPNGatewayConnection.
+ :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 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).
+ :param str mode: The mode of the VPN gateway.
+ :param str name: The name for this VPN gateway connection. The name is unique
+ across all connections for the VPN gateway.
+ :param str peer_address: The IP address of the peer VPN gateway.
+ :param str psk: The pre-shared key.
+ :param str resource_type: The resource type.
+ :param str status: The status of a VPN gateway connection.
+ :param List[VPNGatewayConnectionStatusReason] status_reasons: The reasons for
+ the current VPN gateway connection status (if any):
+ - `cannot_authenticate_connection`: Failed to authenticate a connection because
+ of
+ mismatched IKE ID and PSK (check IKE ID and PSK in peer VPN configuration)
+ - `internal_error`: Internal error (contact IBM support)
+ - `ike_policy_mismatch`: None of the proposed IKE crypto suites was acceptable
+ (check
+ the IKE policies on both sides of the VPN)
+ - `ike_v1_id_local_remote_cidr_mismatch`: Invalid IKE ID or mismatched local
+ CIDRs and
+ remote CIDRs in IKE V1 (check the IKE ID or the local CIDRs and remote CIDRs
+ in IKE
+ V1 configuration)
+ - `ike_v2_local_remote_cidr_mismatch`: Mismatched local CIDRs and remote CIDRs
+ in IKE
+ V2 (check the local CIDRs and remote CIDRs in IKE V2 configuration)
+ - `ipsec_policy_mismatch`: None of the proposed IPsec crypto suites was
+ acceptable
+ (check the IPsec policies on both sides of the VPN)
+ - `peer_not_responding`: No response from peer (check network ACL configuration,
+ peer
+ availability, and on-premise firewall configuration)
+ 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.
"""
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,
+ status_reasons: List['VPNGatewayConnectionStatusReason'],
+ *,
+ ike_policy: Optional['IKEPolicyReference'] = None,
+ ipsec_policy: Optional['IPsecPolicyReference'] = None,
) -> None:
"""
- Initialize a VolumeAttachmentPrototypeVolume 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 name for this VPN gateway connection. The name is
+ unique across all connections for the VPN gateway.
+ :param str peer_address: The IP address of the peer VPN gateway.
+ :param str psk: The pre-shared key.
+ :param str resource_type: The resource type.
+ :param str status: The status of a VPN gateway connection.
+ :param List[VPNGatewayConnectionStatusReason] status_reasons: The reasons
+ for the current VPN gateway connection status (if any):
+ - `cannot_authenticate_connection`: Failed to authenticate a connection
+ because of
+ mismatched IKE ID and PSK (check IKE ID and PSK in peer VPN
+ configuration)
+ - `internal_error`: Internal error (contact IBM support)
+ - `ike_policy_mismatch`: None of the proposed IKE crypto suites was
+ acceptable (check
+ the IKE policies on both sides of the VPN)
+ - `ike_v1_id_local_remote_cidr_mismatch`: Invalid IKE ID or mismatched
+ local CIDRs and
+ remote CIDRs in IKE V1 (check the IKE ID or the local CIDRs and remote
+ CIDRs in IKE
+ V1 configuration)
+ - `ike_v2_local_remote_cidr_mismatch`: Mismatched local CIDRs and remote
+ CIDRs in IKE
+ V2 (check the local CIDRs and remote CIDRs in IKE V2 configuration)
+ - `ipsec_policy_mismatch`: None of the proposed IPsec crypto suites was
+ acceptable
+ (check the IPsec policies on both sides of the VPN)
+ - `peer_not_responding`: No response from peer (check network ACL
+ configuration, peer
+ availability, and on-premise firewall configuration)
+ 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 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(['VolumeAttachmentPrototypeVolumeVolumeIdentity', 'VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContext'])
+ ", ".join(['VPNGatewayConnectionStaticRouteMode', 'VPNGatewayConnectionPolicyMode'])
)
raise Exception(msg)
+ class AuthenticationModeEnum(str, Enum):
+ """
+ The authentication mode. Only `psk` is currently supported.
+ """
+
+ PSK = 'psk'
-class VolumeAttachmentReferenceInstanceContext:
+
+ 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:
"""
- VolumeAttachmentReferenceInstanceContext.
+ Collection of VPN gateway connections in a VPN gateway.
- :attr VolumeAttachmentReferenceInstanceContextDeleted deleted: (optional) If
- present, this property indicates the referenced resource has been deleted, and
- provides
- some supplementary information.
- :attr VolumeAttachmentDevice device: (optional) Information about how the volume
- is exposed to the instance operating system.
- This property may be absent if the volume attachment's `status` is not
- `attached`.
- :attr str href: The URL for this volume attachment.
- :attr str id: The unique identifier for this volume attachment.
- :attr str name: The name for this volume attachment. The name is unique across
- all volume attachments on the instance.
- :attr VolumeReferenceVolumeAttachmentContext volume: (optional) The attached
- volume.
- This property will be absent if the volume has not yet been provisioned.
+ :param List[VPNGatewayConnection] connections: Array of VPN gateway connections.
"""
def __init__(
self,
- href: str,
- id: str,
- name: str,
- *,
- deleted: 'VolumeAttachmentReferenceInstanceContextDeleted' = None,
- device: 'VolumeAttachmentDevice' = None,
- volume: 'VolumeReferenceVolumeAttachmentContext' = None,
+ connections: List['VPNGatewayConnection'],
) -> None:
"""
- Initialize a VolumeAttachmentReferenceInstanceContext object.
+ Initialize a VPNGatewayConnectionCollection object.
- :param str href: The URL for this volume attachment.
- :param str id: The unique identifier for this volume attachment.
- :param str name: The name for this volume attachment. The name is unique
- across all volume attachments on the instance.
- :param VolumeAttachmentReferenceInstanceContextDeleted deleted: (optional)
- If present, this property indicates the referenced resource has been
- deleted, and provides
- some supplementary information.
- :param VolumeAttachmentDevice device: (optional) Information about how the
- volume is exposed to the instance operating system.
- This property may be absent if the volume attachment's `status` is not
- `attached`.
- :param VolumeReferenceVolumeAttachmentContext volume: (optional) The
- attached volume.
- This property will be absent if the volume has not yet been provisioned.
+ :param List[VPNGatewayConnection] connections: Array of VPN gateway
+ connections.
"""
- self.deleted = deleted
- self.device = device
- self.href = href
- self.id = id
- self.name = name
- self.volume = volume
+ self.connections = connections
@classmethod
- def from_dict(cls, _dict: Dict) -> 'VolumeAttachmentReferenceInstanceContext':
- """Initialize a VolumeAttachmentReferenceInstanceContext object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VPNGatewayConnectionCollection':
+ """Initialize a VPNGatewayConnectionCollection 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 (connections := _dict.get('connections')) is not None:
+ args['connections'] = connections
else:
- 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 VolumeAttachmentReferenceInstanceContext JSON')
- if 'volume' in _dict:
- args['volume'] = VolumeReferenceVolumeAttachmentContext.from_dict(_dict.get('volume'))
+ raise ValueError('Required property \'connections\' not present in VPNGatewayConnectionCollection JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VolumeAttachmentReferenceInstanceContext 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, 'deleted') and self.deleted is not None:
- if isinstance(self.deleted, dict):
- _dict['deleted'] = self.deleted
- else:
- _dict['deleted'] = self.deleted.to_dict()
- if hasattr(self, 'device') and self.device is not None:
- if isinstance(self.device, dict):
- _dict['device'] = self.device
- else:
- _dict['device'] = self.device.to_dict()
- if hasattr(self, 'href') and self.href is not None:
- _dict['href'] = self.href
- if hasattr(self, 'id') and self.id is not None:
- _dict['id'] = self.id
- if hasattr(self, 'name') and self.name is not None:
- _dict['name'] = self.name
- if hasattr(self, 'volume') and self.volume is not None:
- if isinstance(self.volume, dict):
- _dict['volume'] = self.volume
- else:
- _dict['volume'] = self.volume.to_dict()
+ if hasattr(self, 'connections') and self.connections is not None:
+ connections_list = []
+ for v in self.connections:
+ if isinstance(v, dict):
+ connections_list.append(v)
+ else:
+ connections_list.append(v.to_dict())
+ _dict['connections'] = connections_list
return _dict
def _to_dict(self):
@@ -84513,59 +86923,80 @@ 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 VPNGatewayConnectionCollection object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VolumeAttachmentReferenceInstanceContext') -> 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: 'VolumeAttachmentReferenceInstanceContext') -> bool:
+ def __ne__(self, other: 'VPNGatewayConnectionCollection') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class VolumeAttachmentReferenceInstanceContextDeleted:
+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.
+ :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.
"""
def __init__(
self,
- more_info: str,
+ action: str,
+ interval: int,
+ timeout: int,
) -> None:
"""
- Initialize a VolumeAttachmentReferenceInstanceContextDeleted 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) -> 'VolumeAttachmentReferenceInstanceContextDeleted':
- """Initialize a VolumeAttachmentReferenceInstanceContextDeleted 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 := _dict.get('action')) is not None:
+ args['action'] = action
else:
- raise ValueError('Required property \'more_info\' not present in VolumeAttachmentReferenceInstanceContextDeleted JSON')
+ raise ValueError('Required property \'action\' not present in VPNGatewayConnectionDPD JSON')
+ if (interval := _dict.get('interval')) is not None:
+ args['interval'] = interval
+ else:
+ raise ValueError('Required property \'interval\' not present in VPNGatewayConnectionDPD JSON')
+ if (timeout := _dict.get('timeout')) is not None:
+ args['timeout'] = timeout
+ else:
+ raise ValueError('Required property \'timeout\' not present in VPNGatewayConnectionDPD JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VolumeAttachmentReferenceInstanceContextDeleted 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):
@@ -84573,150 +87004,86 @@ 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 VPNGatewayConnectionDPD object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VolumeAttachmentReferenceInstanceContextDeleted') -> 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: 'VolumeAttachmentReferenceInstanceContextDeleted') -> bool:
+ def __ne__(self, other: 'VPNGatewayConnectionDPD') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
+ class ActionEnum(str, Enum):
+ """
+ Dead Peer Detection actions.
+ """
+
+ CLEAR = 'clear'
+ HOLD = 'hold'
+ NONE = 'none'
+ RESTART = 'restart'
+
-class VolumeAttachmentReferenceVolumeContext:
+
+class VPNGatewayConnectionDPDPatch:
"""
- VolumeAttachmentReferenceVolumeContext.
+ The Dead Peer Detection settings.
- :attr bool delete_volume_on_instance_delete: Indicates whether deleting the
- instance will also delete the attached volume.
- :attr VolumeAttachmentReferenceVolumeContextDeleted deleted: (optional) If
- present, this property indicates the referenced resource has been deleted, and
- provides
- some supplementary information.
- :attr VolumeAttachmentDevice device: (optional) Information about how the volume
- is exposed to the instance operating system.
- This property may be absent if the volume attachment's `status` is not
- `attached`.
- :attr str href: The URL for this volume attachment.
- :attr str id: The unique identifier for this volume attachment.
- :attr InstanceReference instance: The attached instance.
- :attr str name: The name for this volume attachment. The name is unique across
- all volume attachments on the instance.
- :attr str type: The type of volume attachment.
+ :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.
"""
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,
+ action: Optional[str] = None,
+ interval: Optional[int] = None,
+ timeout: Optional[int] = None,
) -> None:
"""
- Initialize a VolumeAttachmentReferenceVolumeContext object.
+ Initialize a VPNGatewayConnectionDPDPatch object.
- :param bool delete_volume_on_instance_delete: Indicates whether deleting
- the instance will also delete the attached volume.
- :param str href: The URL for this volume attachment.
- :param str id: The unique identifier for this volume attachment.
- :param InstanceReference instance: The attached instance.
- :param str name: The name for this volume attachment. The name is unique
- across all volume attachments on the instance.
- :param str type: The type of volume attachment.
- :param VolumeAttachmentReferenceVolumeContextDeleted deleted: (optional) If
- 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 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.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.type = type
+ self.action = action
+ self.interval = interval
+ self.timeout = timeout
@classmethod
- def from_dict(cls, _dict: Dict) -> 'VolumeAttachmentReferenceVolumeContext':
- """Initialize a VolumeAttachmentReferenceVolumeContext object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VPNGatewayConnectionDPDPatch':
+ """Initialize a VPNGatewayConnectionDPDPatch 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')
- else:
- 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 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 VolumeAttachmentReferenceVolumeContext JSON')
- if 'type' in _dict:
- args['type'] = _dict.get('type')
- else:
- raise ValueError('Required property \'type\' not present in VolumeAttachmentReferenceVolumeContext JSON')
+ if (action := _dict.get('action')) is not None:
+ args['action'] = action
+ if (interval := _dict.get('interval')) is not None:
+ args['interval'] = interval
+ if (timeout := _dict.get('timeout')) is not None:
+ args['timeout'] = timeout
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VolumeAttachmentReferenceVolumeContext 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, 'delete_volume_on_instance_delete') and self.delete_volume_on_instance_delete is not None:
- _dict['delete_volume_on_instance_delete'] = self.delete_volume_on_instance_delete
- if hasattr(self, 'deleted') and self.deleted is not None:
- if isinstance(self.deleted, dict):
- _dict['deleted'] = self.deleted
- else:
- _dict['deleted'] = self.deleted.to_dict()
- if hasattr(self, 'device') and self.device is not None:
- if isinstance(self.device, dict):
- _dict['device'] = self.device
- else:
- _dict['device'] = self.device.to_dict()
- if hasattr(self, 'href') and self.href is not None:
- _dict['href'] = self.href
- if hasattr(self, 'id') and self.id is not None:
- _dict['id'] = self.id
- if hasattr(self, 'instance') and self.instance is not None:
- if isinstance(self.instance, dict):
- _dict['instance'] = self.instance
- else:
- _dict['instance'] = self.instance.to_dict()
- if hasattr(self, 'name') and self.name is not None:
- _dict['name'] = self.name
- if hasattr(self, 'type') and self.type is not None:
- _dict['type'] = self.type
+ if hasattr(self, '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):
@@ -84724,68 +87091,86 @@ 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 VPNGatewayConnectionDPDPatch object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VolumeAttachmentReferenceVolumeContext') -> 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: 'VolumeAttachmentReferenceVolumeContext') -> bool:
+ def __ne__(self, other: 'VPNGatewayConnectionDPDPatch') -> 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 of volume attachment.
+ Dead Peer Detection actions.
"""
- BOOT = 'boot'
- DATA = 'data'
+ CLEAR = 'clear'
+ HOLD = 'hold'
+ NONE = 'none'
+ RESTART = 'restart'
-class VolumeAttachmentReferenceVolumeContextDeleted:
+class VPNGatewayConnectionDPDPrototype:
"""
- 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.
+ :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.
"""
def __init__(
self,
- more_info: str,
+ *,
+ action: Optional[str] = None,
+ interval: Optional[int] = None,
+ timeout: Optional[int] = None,
) -> None:
"""
- Initialize a VolumeAttachmentReferenceVolumeContextDeleted object.
+ Initialize a VPNGatewayConnectionDPDPrototype object.
- :param str more_info: Link to documentation about deleted resources.
+ :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.more_info = more_info
+ self.action = action
+ self.interval = interval
+ self.timeout = timeout
@classmethod
- def from_dict(cls, _dict: Dict) -> 'VolumeAttachmentReferenceVolumeContextDeleted':
- """Initialize a VolumeAttachmentReferenceVolumeContextDeleted object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VPNGatewayConnectionDPDPrototype':
+ """Initialize a VPNGatewayConnectionDPDPrototype object from a json dictionary."""
args = {}
- if 'more_info' in _dict:
- args['more_info'] = _dict.get('more_info')
- else:
- raise ValueError('Required property \'more_info\' not present in VolumeAttachmentReferenceVolumeContextDeleted JSON')
+ if (action := _dict.get('action')) is not None:
+ args['action'] = action
+ if (interval := _dict.get('interval')) is not None:
+ args['interval'] = interval
+ if (timeout := _dict.get('timeout')) is not None:
+ args['timeout'] = timeout
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VolumeAttachmentReferenceVolumeContextDeleted 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, '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):
@@ -84793,174 +87178,148 @@ 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 VPNGatewayConnectionDPDPrototype object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VolumeAttachmentReferenceVolumeContextDeleted') -> 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: 'VolumeAttachmentReferenceVolumeContextDeleted') -> bool:
+ def __ne__(self, other: 'VPNGatewayConnectionDPDPrototype') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
+ class ActionEnum(str, Enum):
+ """
+ Dead Peer Detection actions.
+ """
-class VolumeCollection:
+ CLEAR = 'clear'
+ HOLD = 'hold'
+ NONE = 'none'
+ RESTART = 'restart'
+
+
+
+class VPNGatewayConnectionIKEPolicyPatch:
"""
- VolumeCollection.
+ 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 VolumeCollectionFirst first: A link to the first page of resources.
- :attr int limit: The maximum number of resources that can be returned by the
- request.
- :attr VolumeCollectionNext next: (optional) A link to the next page of
- resources. This property is present for all pages
- except the last page.
- :attr int total_count: The total number of resources across all pages.
- :attr List[Volume] volumes: Collection of volumes.
"""
def __init__(
self,
- first: 'VolumeCollectionFirst',
- limit: int,
- total_count: int,
- volumes: List['Volume'],
- *,
- next: 'VolumeCollectionNext' = None,
) -> None:
"""
- Initialize a VolumeCollection object.
+ Initialize a VPNGatewayConnectionIKEPolicyPatch object.
- :param VolumeCollectionFirst first: A link to the first page of resources.
- :param int limit: The maximum number of resources that can be returned by
- the request.
- :param int total_count: The total number of resources across all pages.
- :param List[Volume] volumes: Collection of volumes.
- :param VolumeCollectionNext next: (optional) A link to the next page of
- resources. This property is present for all pages
- except the last page.
"""
- self.first = first
- self.limit = limit
- self.next = next
- self.total_count = total_count
- self.volumes = volumes
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['VPNGatewayConnectionIKEPolicyPatchIKEPolicyIdentityById', 'VPNGatewayConnectionIKEPolicyPatchIKEPolicyIdentityByHref'])
+ )
+ raise Exception(msg)
- @classmethod
- def from_dict(cls, _dict: Dict) -> 'VolumeCollection':
- """Initialize a VolumeCollection object from a json dictionary."""
- args = {}
- if 'first' in _dict:
- args['first'] = VolumeCollectionFirst.from_dict(_dict.get('first'))
- else:
- raise ValueError('Required property \'first\' not present in VolumeCollection JSON')
- if 'limit' in _dict:
- args['limit'] = _dict.get('limit')
- else:
- raise ValueError('Required property \'limit\' not present in VolumeCollection JSON')
- if 'next' in _dict:
- args['next'] = VolumeCollectionNext.from_dict(_dict.get('next'))
- if 'total_count' in _dict:
- args['total_count'] = _dict.get('total_count')
- else:
- raise ValueError('Required property \'total_count\' not present in VolumeCollection JSON')
- if 'volumes' in _dict:
- args['volumes'] = [Volume.from_dict(v) for v in _dict.get('volumes')]
- else:
- raise ValueError('Required property \'volumes\' not present in VolumeCollection JSON')
- return cls(**args)
- @classmethod
- def _from_dict(cls, _dict):
- """Initialize a VolumeCollection object from a json dictionary."""
- return cls.from_dict(_dict)
+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 to_dict(self) -> Dict:
- """Return a json dictionary representing this model."""
- _dict = {}
- if hasattr(self, 'first') and self.first is not None:
- if isinstance(self.first, dict):
- _dict['first'] = self.first
- else:
- _dict['first'] = self.first.to_dict()
- if hasattr(self, 'limit') and self.limit is not None:
- _dict['limit'] = self.limit
- if hasattr(self, 'next') and self.next is not None:
- if isinstance(self.next, dict):
- _dict['next'] = self.next
- else:
- _dict['next'] = self.next.to_dict()
- if hasattr(self, 'total_count') and self.total_count is not None:
- _dict['total_count'] = self.total_count
- if hasattr(self, 'volumes') and self.volumes is not None:
- volumes_list = []
- for v in self.volumes:
- if isinstance(v, dict):
- volumes_list.append(v)
- else:
- volumes_list.append(v.to_dict())
- _dict['volumes'] = volumes_list
- return _dict
+ """
- def _to_dict(self):
- """Return a json dictionary representing this model."""
- return self.to_dict()
+ def __init__(
+ self,
+ ) -> None:
+ """
+ Initialize a VPNGatewayConnectionIKEPolicyPrototype object.
- def __str__(self) -> str:
- """Return a `str` version of this VolumeCollection object."""
- return json.dumps(self.to_dict(), indent=2)
+ """
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['VPNGatewayConnectionIKEPolicyPrototypeIKEPolicyIdentityById', 'VPNGatewayConnectionIKEPolicyPrototypeIKEPolicyIdentityByHref'])
+ )
+ raise Exception(msg)
- 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: 'VolumeCollection') -> bool:
- """Return `true` when self and other are not equal, false otherwise."""
- return not self == other
+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).
+ """
-class VolumeCollectionFirst:
+ 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:
"""
- A link to the first page of resources.
+ 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 href: The URL for a page of resources.
"""
def __init__(
self,
- href: str,
) -> None:
"""
- Initialize a VolumeCollectionFirst object.
+ Initialize a VPNGatewayConnectionIPsecPolicyPrototype object.
- :param str href: The URL for a page of resources.
"""
- self.href = href
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityById', 'VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByHref'])
+ )
+ raise Exception(msg)
+
+
+class VPNGatewayConnectionLocalCIDRs:
+ """
+ VPNGatewayConnectionLocalCIDRs.
+
+ :param List[str] local_cidrs: (optional) The local CIDRs for this resource.
+ """
+
+ def __init__(
+ self,
+ *,
+ local_cidrs: Optional[List[str]] = None,
+ ) -> None:
+ """
+ Initialize a VPNGatewayConnectionLocalCIDRs object.
+
+ :param List[str] local_cidrs: (optional) The local CIDRs for this resource.
+ """
+ self.local_cidrs = local_cidrs
@classmethod
- def from_dict(cls, _dict: Dict) -> 'VolumeCollectionFirst':
- """Initialize a VolumeCollectionFirst object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VPNGatewayConnectionLocalCIDRs':
+ """Initialize a VPNGatewayConnectionLocalCIDRs object from a json dictionary."""
args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
- else:
- raise ValueError('Required property \'href\' not present in VolumeCollectionFirst JSON')
+ if (local_cidrs := _dict.get('local_cidrs')) is not None:
+ args['local_cidrs'] = local_cidrs
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VolumeCollectionFirst 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, 'href') and self.href is not None:
- _dict['href'] = self.href
+ if hasattr(self, 'local_cidrs') and self.local_cidrs is not None:
+ _dict['local_cidrs'] = self.local_cidrs
return _dict
def _to_dict(self):
@@ -84968,59 +87327,139 @@ 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 VPNGatewayConnectionLocalCIDRs object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VolumeCollectionFirst') -> 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: 'VolumeCollectionFirst') -> bool:
+ def __ne__(self, other: 'VPNGatewayConnectionLocalCIDRs') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class VolumeCollectionNext:
+class VPNGatewayConnectionPatch:
"""
- A link to the next page of resources. This property is present for all pages except
- the last page.
+ VPNGatewayConnectionPatch.
- :attr 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 name for this VPN gateway connection. The name
+ must not be used by another connection for the VPN gateway.
+ :param str peer_address: (optional) The IP address of the peer VPN gateway.
+ :param str psk: (optional) The pre-shared key.
+ :param str routing_protocol: (optional) Routing protocols are disabled for this
+ VPN gateway connection.
"""
def __init__(
self,
- href: str,
+ *,
+ admin_state_up: Optional[bool] = None,
+ dead_peer_detection: Optional['VPNGatewayConnectionDPDPatch'] = None,
+ ike_policy: Optional['VPNGatewayConnectionIKEPolicyPatch'] = None,
+ ipsec_policy: Optional['VPNGatewayConnectionIPsecPolicyPatch'] = None,
+ name: Optional[str] = None,
+ peer_address: Optional[str] = None,
+ psk: Optional[str] = None,
+ routing_protocol: Optional[str] = None,
) -> None:
"""
- Initialize a VolumeCollectionNext 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 name for this VPN gateway connection. The
+ name must not be used by another connection for the VPN gateway.
+ :param str peer_address: (optional) The IP address of the peer VPN gateway.
+ :param str psk: (optional) The pre-shared key.
+ :param str routing_protocol: (optional) Routing protocols are disabled for
+ this VPN gateway connection.
"""
- self.href = href
+ self.admin_state_up = admin_state_up
+ self.dead_peer_detection = dead_peer_detection
+ self.ike_policy = ike_policy
+ self.ipsec_policy = ipsec_policy
+ self.name = name
+ self.peer_address = peer_address
+ self.psk = psk
+ self.routing_protocol = routing_protocol
@classmethod
- def from_dict(cls, _dict: Dict) -> 'VolumeCollectionNext':
- """Initialize a VolumeCollectionNext object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VPNGatewayConnectionPatch':
+ """Initialize a VPNGatewayConnectionPatch object from a json dictionary."""
args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
- else:
- raise ValueError('Required property \'href\' not present in VolumeCollectionNext JSON')
+ if (admin_state_up := _dict.get('admin_state_up')) is not None:
+ args['admin_state_up'] = admin_state_up
+ if (dead_peer_detection := _dict.get('dead_peer_detection')) is not None:
+ args['dead_peer_detection'] = VPNGatewayConnectionDPDPatch.from_dict(dead_peer_detection)
+ if (ike_policy := _dict.get('ike_policy')) is not None:
+ args['ike_policy'] = ike_policy
+ if (ipsec_policy := _dict.get('ipsec_policy')) is not None:
+ args['ipsec_policy'] = ipsec_policy
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ if (peer_address := _dict.get('peer_address')) is not None:
+ args['peer_address'] = peer_address
+ if (psk := _dict.get('psk')) is not None:
+ args['psk'] = psk
+ if (routing_protocol := _dict.get('routing_protocol')) is not None:
+ args['routing_protocol'] = routing_protocol
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VolumeCollectionNext object from a json dictionary."""
+ """Initialize a VPNGatewayConnectionPatch object from 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, 'admin_state_up') and self.admin_state_up is not None:
+ _dict['admin_state_up'] = self.admin_state_up
+ if hasattr(self, 'dead_peer_detection') and self.dead_peer_detection is not None:
+ if isinstance(self.dead_peer_detection, dict):
+ _dict['dead_peer_detection'] = self.dead_peer_detection
+ else:
+ _dict['dead_peer_detection'] = self.dead_peer_detection.to_dict()
+ if hasattr(self, 'ike_policy') and self.ike_policy is not None:
+ if isinstance(self.ike_policy, dict):
+ _dict['ike_policy'] = self.ike_policy
+ else:
+ _dict['ike_policy'] = self.ike_policy.to_dict()
+ if hasattr(self, 'ipsec_policy') and self.ipsec_policy is not None:
+ if isinstance(self.ipsec_policy, dict):
+ _dict['ipsec_policy'] = self.ipsec_policy
+ else:
+ _dict['ipsec_policy'] = self.ipsec_policy.to_dict()
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ if hasattr(self, 'peer_address') and self.peer_address is not None:
+ _dict['peer_address'] = self.peer_address
+ if hasattr(self, 'psk') and self.psk is not None:
+ _dict['psk'] = self.psk
+ if hasattr(self, 'routing_protocol') and self.routing_protocol is not None:
+ _dict['routing_protocol'] = self.routing_protocol
return _dict
def _to_dict(self):
@@ -85028,81 +87467,65 @@ 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 VPNGatewayConnectionPatch object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VolumeCollectionNext') -> bool:
+ def __eq__(self, other: 'VPNGatewayConnectionPatch') -> bool:
"""Return `true` when 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: 'VPNGatewayConnectionPatch') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
+ class RoutingProtocolEnum(str, Enum):
+ """
+ Routing protocols are disabled for this VPN gateway connection.
+ """
-class VolumeHealthReason:
+ NONE = 'none'
+
+
+
+class VPNGatewayConnectionPeerCIDRs:
"""
- VolumeHealthReason.
+ VPNGatewayConnectionPeerCIDRs.
- :attr str code: A snake case string succinctly identifying the reason for this
- health state.
- :attr str message: An explanation of the reason for this health state.
- :attr str more_info: (optional) Link to documentation about the reason for this
- health state.
+ :param List[str] peer_cidrs: (optional) The peer CIDRs for this resource.
"""
def __init__(
self,
- code: str,
- message: str,
*,
- more_info: str = None,
+ peer_cidrs: Optional[List[str]] = None,
) -> None:
"""
- Initialize a VolumeHealthReason object.
+ Initialize a VPNGatewayConnectionPeerCIDRs object.
- :param str code: A snake case string succinctly identifying the reason for
- this health state.
- :param str message: An explanation of the reason for this health state.
- :param str more_info: (optional) Link to documentation about the reason for
- this health state.
+ :param List[str] peer_cidrs: (optional) The peer CIDRs for this resource.
"""
- self.code = code
- self.message = message
- self.more_info = more_info
+ self.peer_cidrs = peer_cidrs
@classmethod
- def from_dict(cls, _dict: Dict) -> 'VolumeHealthReason':
- """Initialize a VolumeHealthReason object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VPNGatewayConnectionPeerCIDRs':
+ """Initialize a VPNGatewayConnectionPeerCIDRs object from a json dictionary."""
args = {}
- if 'code' in _dict:
- args['code'] = _dict.get('code')
- else:
- raise ValueError('Required property \'code\' not present in VolumeHealthReason JSON')
- if 'message' in _dict:
- args['message'] = _dict.get('message')
- else:
- raise ValueError('Required property \'message\' not present in VolumeHealthReason JSON')
- if 'more_info' in _dict:
- args['more_info'] = _dict.get('more_info')
+ if (peer_cidrs := _dict.get('peer_cidrs')) is not None:
+ args['peer_cidrs'] = peer_cidrs
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VolumeHealthReason 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, '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, 'peer_cidrs') and self.peer_cidrs is not None:
+ _dict['peer_cidrs'] = self.peer_cidrs
return _dict
def _to_dict(self):
@@ -85110,153 +87533,164 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this VolumeHealthReason object."""
+ """Return a `str` version of this VPNGatewayConnectionPeerCIDRs object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VolumeHealthReason') -> 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: 'VolumeHealthReason') -> bool:
+ def __ne__(self, other: 'VPNGatewayConnectionPeerCIDRs') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class CodeEnum(str, Enum):
- """
- A snake case string succinctly identifying the reason for this health state.
- """
-
- INITIALIZING_FROM_SNAPSHOT = 'initializing_from_snapshot'
-
-
-class VolumeIdentity:
+class VPNGatewayConnectionPrototype:
"""
- Identifies a volume by a unique property.
+ VPNGatewayConnectionPrototype.
+ :param bool admin_state_up: (optional) If set to false, the VPN gateway
+ connection is shut down.
+ :param VPNGatewayConnectionDPDPrototype dead_peer_detection: (optional) The Dead
+ Peer Detection settings.
+ :param VPNGatewayConnectionIKEPolicyPrototype ike_policy: (optional) The IKE
+ policy to use. If unspecified, [auto-negotiation will be
+ used](https://cloud.ibm.com/docs/vpc?topic=vpc-using-vpn&interface=ui#ike-auto-negotiation-phase-1).
+ :param VPNGatewayConnectionIPsecPolicyPrototype ipsec_policy: (optional) The
+ IPsec policy to use. If unspecified, [auto-negotiation will be
+ used](https://cloud.ibm.com/docs/vpc?topic=vpc-using-vpn&interface=ui#ipsec-auto-negotiation-phase-2).
+ :param str name: (optional) The name for this VPN gateway connection. The name
+ must not be used by another connection for the VPN gateway. If unspecified, the
+ name will be a hyphenated list of randomly-selected words.
+ :param str peer_address: The IP address of the peer VPN gateway.
+ :param str psk: The pre-shared key.
"""
def __init__(
self,
+ peer_address: str,
+ psk: str,
+ *,
+ admin_state_up: Optional[bool] = None,
+ dead_peer_detection: Optional['VPNGatewayConnectionDPDPrototype'] = None,
+ ike_policy: Optional['VPNGatewayConnectionIKEPolicyPrototype'] = None,
+ ipsec_policy: Optional['VPNGatewayConnectionIPsecPolicyPrototype'] = None,
+ name: Optional[str] = None,
) -> None:
"""
- Initialize a VolumeIdentity object.
+ Initialize a VPNGatewayConnectionPrototype object.
+ :param str peer_address: The IP address of the peer VPN gateway.
+ :param str psk: The pre-shared key.
+ :param bool admin_state_up: (optional) If set to false, the VPN gateway
+ connection is shut down.
+ :param VPNGatewayConnectionDPDPrototype dead_peer_detection: (optional) The
+ Dead Peer Detection settings.
+ :param VPNGatewayConnectionIKEPolicyPrototype ike_policy: (optional) The
+ IKE policy to use. If unspecified, [auto-negotiation will be
+ used](https://cloud.ibm.com/docs/vpc?topic=vpc-using-vpn&interface=ui#ike-auto-negotiation-phase-1).
+ :param VPNGatewayConnectionIPsecPolicyPrototype ipsec_policy: (optional)
+ The IPsec policy to use. If unspecified, [auto-negotiation will be
+ used](https://cloud.ibm.com/docs/vpc?topic=vpc-using-vpn&interface=ui#ipsec-auto-negotiation-phase-2).
+ :param str name: (optional) The name for this VPN gateway connection. The
+ name must not be used by another connection for the VPN gateway. If
+ unspecified, the name will be a hyphenated list of randomly-selected words.
"""
msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['VolumeIdentityById', 'VolumeIdentityByCRN', 'VolumeIdentityByHref'])
+ ", ".join(['VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype', 'VPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype'])
)
raise Exception(msg)
-class VolumePatch:
+class VPNGatewayConnectionReference:
"""
- VolumePatch.
+ VPNGatewayConnectionReference.
- :attr int capacity: (optional) The capacity to use for the volume (in
- gigabytes). The volume must be attached to a running virtual server instance,
- and the specified value must not be less than the current capacity.
- Additionally, if the volume is attached as a boot volume, the maximum value is
- 250 gigabytes.
- The minimum and maximum capacity limits for creating or updating volumes may
- expand in the future.
- :attr int iops: (optional) The maximum I/O operations per second (IOPS) to use
- for this volume. Applicable only to volumes using a profile `family` of
- `custom`. The volume must be attached as a data volume to a running virtual
- server instance.
- :attr str name: (optional) The name for this volume. The name must not be used
- by another volume in the region.
- :attr VolumeProfileIdentity profile: (optional) The profile to use for this
- volume. The requested profile must be in the same
- `family` as the current profile. The volume must be attached as a data volume to
- a running virtual server instance, and must have a `capacity` within the range
- supported by the specified profile.
- :attr List[str] user_tags: (optional) The [user
- tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with this
- volume.
+ :param VPNGatewayConnectionReferenceDeleted deleted: (optional) If present, this
+ property indicates the referenced resource has been deleted, and provides
+ some supplementary information.
+ :param str href: The VPN connection's canonical URL.
+ :param str id: The unique identifier for this VPN gateway connection.
+ :param str name: The name for this VPN gateway connection. The name is unique
+ across all connections for the VPN gateway.
+ :param str resource_type: The resource type.
"""
def __init__(
self,
+ href: str,
+ id: str,
+ name: str,
+ resource_type: str,
*,
- capacity: int = None,
- iops: int = None,
- name: str = None,
- profile: 'VolumeProfileIdentity' = None,
- user_tags: List[str] = None,
+ deleted: Optional['VPNGatewayConnectionReferenceDeleted'] = None,
) -> None:
"""
- Initialize a VolumePatch object.
+ Initialize a VPNGatewayConnectionReference object.
- :param int capacity: (optional) The capacity to use for the volume (in
- gigabytes). The volume must be attached to a running virtual server
- instance, and the specified value must not be less than the current
- capacity. Additionally, if the volume is attached as a boot volume, the
- maximum value is 250 gigabytes.
- The minimum and maximum capacity limits for creating or updating volumes
- may expand in the future.
- :param int iops: (optional) The maximum I/O operations per second (IOPS) to
- use for this volume. Applicable only to volumes using a profile `family` of
- `custom`. The volume must be attached as a data volume to a running virtual
- server instance.
- :param str name: (optional) The name for this volume. The name must not be
- used by another volume in the region.
- :param VolumeProfileIdentity profile: (optional) The profile to use for
- this volume. The requested profile must be in the same
- `family` as the current profile. The volume must be attached as a data
- volume to
- a running virtual server instance, and must have a `capacity` within the
- range
- supported by the specified profile.
- :param List[str] user_tags: (optional) The [user
- tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with
- this volume.
+ :param str href: The VPN connection's canonical URL.
+ :param str id: The unique identifier for this VPN gateway connection.
+ :param str name: The name for this VPN gateway connection. The name is
+ unique across all connections for the VPN gateway.
+ :param str resource_type: The resource type.
+ :param VPNGatewayConnectionReferenceDeleted deleted: (optional) If present,
+ this property indicates the referenced resource has been deleted, and
+ provides
+ some supplementary information.
"""
- self.capacity = capacity
- self.iops = iops
+ self.deleted = deleted
+ self.href = href
+ self.id = id
self.name = name
- self.profile = profile
- self.user_tags = user_tags
+ self.resource_type = resource_type
@classmethod
- def from_dict(cls, _dict: Dict) -> 'VolumePatch':
- """Initialize a VolumePatch object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VPNGatewayConnectionReference':
+ """Initialize a VPNGatewayConnectionReference object from a json dictionary."""
args = {}
- if 'capacity' in _dict:
- args['capacity'] = _dict.get('capacity')
- if 'iops' in _dict:
- args['iops'] = _dict.get('iops')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
- if 'profile' in _dict:
- args['profile'] = _dict.get('profile')
- if 'user_tags' in _dict:
- args['user_tags'] = _dict.get('user_tags')
+ if (deleted := _dict.get('deleted')) is not None:
+ args['deleted'] = VPNGatewayConnectionReferenceDeleted.from_dict(deleted)
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
+ else:
+ raise ValueError('Required property \'href\' not present in VPNGatewayConnectionReference JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
+ else:
+ raise ValueError('Required property \'id\' not present in VPNGatewayConnectionReference JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ else:
+ raise ValueError('Required property \'name\' not present in VPNGatewayConnectionReference JSON')
+ if (resource_type := _dict.get('resource_type')) is not None:
+ args['resource_type'] = resource_type
+ else:
+ raise ValueError('Required property \'resource_type\' not present in VPNGatewayConnectionReference JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VolumePatch 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, '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, 'deleted') and self.deleted is not None:
+ if isinstance(self.deleted, dict):
+ _dict['deleted'] = self.deleted
+ else:
+ _dict['deleted'] = self.deleted.to_dict()
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
+ if hasattr(self, 'id') and self.id is not None:
+ _dict['id'] = self.id
if hasattr(self, 'name') and self.name is not None:
_dict['name'] = self.name
- if hasattr(self, 'profile') and self.profile is not None:
- if isinstance(self.profile, dict):
- _dict['profile'] = self.profile
- else:
- _dict['profile'] = self.profile.to_dict()
- if hasattr(self, 'user_tags') and self.user_tags is not None:
- _dict['user_tags'] = self.user_tags
+ if hasattr(self, 'resource_type') and self.resource_type is not None:
+ _dict['resource_type'] = self.resource_type
return _dict
def _to_dict(self):
@@ -85264,86 +87698,67 @@ 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 VPNGatewayConnectionReference object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VolumePatch') -> 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: 'VolumePatch') -> bool:
+ def __ne__(self, other: 'VPNGatewayConnectionReference') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
+ class ResourceTypeEnum(str, Enum):
+ """
+ The resource type.
+ """
+
+ VPN_GATEWAY_CONNECTION = 'vpn_gateway_connection'
+
-class VolumeProfile:
+
+class VPNGatewayConnectionReferenceDeleted:
"""
- VolumeProfile.
+ If present, this property indicates the referenced resource has been deleted, and
+ provides some supplementary information.
- :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.
+ :param str more_info: Link to documentation about deleted resources.
"""
def __init__(
self,
- family: str,
- href: str,
- name: str,
+ more_info: str,
) -> None:
"""
- Initialize a VolumeProfile object.
+ Initialize a VPNGatewayConnectionReferenceDeleted 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 more_info: Link to documentation about deleted resources.
"""
- self.family = family
- self.href = href
- self.name = name
+ self.more_info = more_info
@classmethod
- def from_dict(cls, _dict: Dict) -> 'VolumeProfile':
- """Initialize a VolumeProfile object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VPNGatewayConnectionReferenceDeleted':
+ """Initialize a VPNGatewayConnectionReferenceDeleted object from a json dictionary."""
args = {}
- if 'family' in _dict:
- args['family'] = _dict.get('family')
- else:
- raise ValueError('Required property \'family\' not present in VolumeProfile JSON')
- if 'href' in _dict:
- args['href'] = _dict.get('href')
- else:
- raise ValueError('Required property \'href\' not present in VolumeProfile JSON')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
+ if (more_info := _dict.get('more_info')) is not None:
+ args['more_info'] = more_info
else:
- raise ValueError('Required property \'name\' not present in VolumeProfile JSON')
+ raise ValueError('Required property \'more_info\' not present in VPNGatewayConnectionReferenceDeleted JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VolumeProfile object from a json dictionary."""
+ """Initialize a VPNGatewayConnectionReferenceDeleted object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, '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, 'more_info') and self.more_info is not None:
+ _dict['more_info'] = self.more_info
return _dict
def _to_dict(self):
@@ -85351,129 +87766,142 @@ 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 VPNGatewayConnectionReferenceDeleted object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VolumeProfile') -> bool:
+ def __eq__(self, other: 'VPNGatewayConnectionReferenceDeleted') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'VolumeProfile') -> bool:
+ def __ne__(self, other: 'VPNGatewayConnectionReferenceDeleted') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class FamilyEnum(str, Enum):
- """
- The product family this volume profile belongs to.
- The enumerated values for this property will expand in the future. When processing
- this property, check for and log unknown values. Optionally halt processing and
- surface the error, or bypass the volume profile on which the unexpected property
- value was encountered.
- """
- CUSTOM = 'custom'
- TIERED = 'tiered'
+class VPNGatewayConnectionStaticRouteModeTunnel:
+ """
+ VPNGatewayConnectionStaticRouteModeTunnel.
-
-
-class VolumeProfileCollection:
- """
- VolumeProfileCollection.
-
- :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.
+ :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 List[VPNGatewayConnectionTunnelStatusReason] status_reasons: The reasons
+ for the current VPN gateway connection tunnels status (if any):
+ - `cannot_authenticate_connection`: Failed to authenticate a connection because
+ of
+ mismatched IKE ID and PSK (check IKE ID and PSK in peer VPN configuration)
+ - `internal_error`: Internal error (contact IBM support)
+ - `ike_policy_mismatch`: None of the proposed IKE crypto suites was acceptable
+ (check
+ the IKE policies on both sides of the VPN)
+ - `ike_v1_id_local_remote_cidr_mismatch`: Invalid IKE ID or mismatched local
+ CIDRs and
+ remote CIDRs in IKE V1 (check the IKE ID or the local CIDRs and remote CIDRs
+ in IKE
+ V1 configuration)
+ - `ike_v2_local_remote_cidr_mismatch`: Mismatched local CIDRs and remote CIDRs
+ in IKE
+ V2 (check the local CIDRs and remote CIDRs in IKE V2 configuration)
+ - `ipsec_policy_mismatch`: None of the proposed IPsec crypto suites was
+ acceptable
+ (check the IPsec policies on both sides of the VPN)
+ - `peer_not_responding`: No response from peer (check network ACL configuration,
+ peer
+ availability, and on-premise firewall configuration)
+ 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.
"""
def __init__(
self,
- first: 'VolumeProfileCollectionFirst',
- limit: int,
- profiles: List['VolumeProfile'],
- total_count: int,
- *,
- next: 'VolumeProfileCollectionNext' = None,
+ public_ip: 'IP',
+ status: str,
+ status_reasons: List['VPNGatewayConnectionTunnelStatusReason'],
) -> None:
"""
- Initialize a VolumeProfileCollection object.
+ Initialize a VPNGatewayConnectionStaticRouteModeTunnel 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 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 List[VPNGatewayConnectionTunnelStatusReason] status_reasons: The
+ reasons for the current VPN gateway connection tunnels status (if any):
+ - `cannot_authenticate_connection`: Failed to authenticate a connection
+ because of
+ mismatched IKE ID and PSK (check IKE ID and PSK in peer VPN
+ configuration)
+ - `internal_error`: Internal error (contact IBM support)
+ - `ike_policy_mismatch`: None of the proposed IKE crypto suites was
+ acceptable (check
+ the IKE policies on both sides of the VPN)
+ - `ike_v1_id_local_remote_cidr_mismatch`: Invalid IKE ID or mismatched
+ local CIDRs and
+ remote CIDRs in IKE V1 (check the IKE ID or the local CIDRs and remote
+ CIDRs in IKE
+ V1 configuration)
+ - `ike_v2_local_remote_cidr_mismatch`: Mismatched local CIDRs and remote
+ CIDRs in IKE
+ V2 (check the local CIDRs and remote CIDRs in IKE V2 configuration)
+ - `ipsec_policy_mismatch`: None of the proposed IPsec crypto suites was
+ acceptable
+ (check the IPsec policies on both sides of the VPN)
+ - `peer_not_responding`: No response from peer (check network ACL
+ configuration, peer
+ availability, and on-premise firewall configuration)
+ 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.
"""
- self.first = first
- self.limit = limit
- self.next = next
- self.profiles = profiles
- self.total_count = total_count
+ self.public_ip = public_ip
+ self.status = status
+ self.status_reasons = status_reasons
@classmethod
- def from_dict(cls, _dict: Dict) -> 'VolumeProfileCollection':
- """Initialize a VolumeProfileCollection 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'] = VolumeProfileCollectionFirst.from_dict(_dict.get('first'))
- else:
- raise ValueError('Required property \'first\' not present in VolumeProfileCollection JSON')
- if 'limit' in _dict:
- args['limit'] = _dict.get('limit')
+ if (public_ip := _dict.get('public_ip')) is not None:
+ args['public_ip'] = IP.from_dict(public_ip)
else:
- raise ValueError('Required property \'limit\' not present in VolumeProfileCollection JSON')
- if 'next' in _dict:
- args['next'] = VolumeProfileCollectionNext.from_dict(_dict.get('next'))
- if 'profiles' in _dict:
- args['profiles'] = [VolumeProfile.from_dict(v) for v in _dict.get('profiles')]
+ raise ValueError('Required property \'public_ip\' not present in VPNGatewayConnectionStaticRouteModeTunnel JSON')
+ if (status := _dict.get('status')) is not None:
+ args['status'] = status
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 \'status\' not present in VPNGatewayConnectionStaticRouteModeTunnel JSON')
+ if (status_reasons := _dict.get('status_reasons')) is not None:
+ args['status_reasons'] = [VPNGatewayConnectionTunnelStatusReason.from_dict(v) for v in status_reasons]
else:
- raise ValueError('Required property \'total_count\' not present in VolumeProfileCollection JSON')
+ raise ValueError('Required property \'status_reasons\' not present in VPNGatewayConnectionStaticRouteModeTunnel JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VolumeProfileCollection 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:
- if isinstance(self.first, dict):
- _dict['first'] = self.first
- else:
- _dict['first'] = self.first.to_dict()
- if hasattr(self, 'limit') and self.limit is not None:
- _dict['limit'] = self.limit
- if hasattr(self, 'next') and self.next is not None:
- if isinstance(self.next, dict):
- _dict['next'] = self.next
+ if hasattr(self, 'public_ip') and self.public_ip is not None:
+ if isinstance(self.public_ip, dict):
+ _dict['public_ip'] = self.public_ip
else:
- _dict['next'] = self.next.to_dict()
- if hasattr(self, 'profiles') and self.profiles is not None:
- profiles_list = []
- for v in self.profiles:
+ _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, 'status_reasons') and self.status_reasons is not None:
+ status_reasons_list = []
+ for v in self.status_reasons:
if isinstance(v, dict):
- profiles_list.append(v)
+ status_reasons_list.append(v)
else:
- profiles_list.append(v.to_dict())
- _dict['profiles'] = profiles_list
- if hasattr(self, 'total_count') and self.total_count is not None:
- _dict['total_count'] = self.total_count
+ status_reasons_list.append(v.to_dict())
+ _dict['status_reasons'] = status_reasons_list
return _dict
def _to_dict(self):
@@ -85481,58 +87909,90 @@ 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 VPNGatewayConnectionStaticRouteModeTunnel object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VolumeProfileCollection') -> 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: 'VolumeProfileCollection') -> bool:
+ def __ne__(self, other: 'VPNGatewayConnectionStaticRouteModeTunnel') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
+ class StatusEnum(str, Enum):
+ """
+ The status of the VPN Tunnel.
+ """
-class VolumeProfileCollectionFirst:
+ DOWN = 'down'
+ UP = 'up'
+
+
+
+class VPNGatewayConnectionStatusReason:
"""
- A link to the first page of resources.
+ VPNGatewayConnectionStatusReason.
- :attr str href: The URL for a page of resources.
+ :param str code: A snake case string succinctly identifying the status reason.
+ :param str message: An explanation of the reason for this VPN gateway
+ connection's status.
+ :param str more_info: (optional) Link to documentation about this status reason.
"""
def __init__(
self,
- href: str,
+ code: str,
+ message: str,
+ *,
+ more_info: Optional[str] = None,
) -> None:
"""
- Initialize a VolumeProfileCollectionFirst object.
+ Initialize a VPNGatewayConnectionStatusReason object.
- :param str href: The URL for a page of resources.
+ :param str code: A snake case string succinctly identifying the status
+ reason.
+ :param str message: An explanation of the reason for this VPN gateway
+ connection's status.
+ :param str more_info: (optional) Link to documentation about this status
+ reason.
"""
- self.href = href
+ self.code = code
+ self.message = message
+ self.more_info = more_info
@classmethod
- def from_dict(cls, _dict: Dict) -> 'VolumeProfileCollectionFirst':
- """Initialize a VolumeProfileCollectionFirst object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VPNGatewayConnectionStatusReason':
+ """Initialize a VPNGatewayConnectionStatusReason object from a json dictionary."""
args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ if (code := _dict.get('code')) is not None:
+ args['code'] = code
else:
- raise ValueError('Required property \'href\' not present in VolumeProfileCollectionFirst JSON')
+ raise ValueError('Required property \'code\' not present in VPNGatewayConnectionStatusReason JSON')
+ if (message := _dict.get('message')) is not None:
+ args['message'] = message
+ else:
+ raise ValueError('Required property \'message\' not present in VPNGatewayConnectionStatusReason JSON')
+ if (more_info := _dict.get('more_info')) is not None:
+ args['more_info'] = more_info
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VolumeProfileCollectionFirst object from a json dictionary."""
+ """Initialize a VPNGatewayConnectionStatusReason object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'href') and self.href is not None:
- _dict['href'] = self.href
+ if hasattr(self, 'code') and self.code is not None:
+ _dict['code'] = self.code
+ if hasattr(self, 'message') and self.message is not None:
+ _dict['message'] = self.message
+ if hasattr(self, 'more_info') and self.more_info is not None:
+ _dict['more_info'] = self.more_info
return _dict
def _to_dict(self):
@@ -85540,59 +88000,95 @@ 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 VPNGatewayConnectionStatusReason object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VolumeProfileCollectionFirst') -> bool:
+ def __eq__(self, other: 'VPNGatewayConnectionStatusReason') -> bool:
"""Return `true` when 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: 'VPNGatewayConnectionStatusReason') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
+ class CodeEnum(str, Enum):
+ """
+ A snake case string succinctly identifying the status reason.
+ """
-class VolumeProfileCollectionNext:
+ CANNOT_AUTHENTICATE_CONNECTION = 'cannot_authenticate_connection'
+ IKE_POLICY_MISMATCH = 'ike_policy_mismatch'
+ IKE_V1_ID_LOCAL_REMOTE_CIDR_MISMATCH = 'ike_v1_id_local_remote_cidr_mismatch'
+ IKE_V2_LOCAL_REMOTE_CIDR_MISMATCH = 'ike_v2_local_remote_cidr_mismatch'
+ INTERNAL_ERROR = 'internal_error'
+ IPSEC_POLICY_MISMATCH = 'ipsec_policy_mismatch'
+ PEER_NOT_RESPONDING = 'peer_not_responding'
+
+
+
+class VPNGatewayConnectionTunnelStatusReason:
"""
- A link to the next page of resources. This property is present for all pages except
- the last page.
+ VPNGatewayConnectionTunnelStatusReason.
- :attr str href: The URL for a page of resources.
+ :param str code: A snake case string succinctly identifying the status reason.
+ :param str message: An explanation of the reason for this VPN gateway connection
+ tunnel's status.
+ :param str more_info: (optional) Link to documentation about this status reason.
"""
def __init__(
self,
- href: str,
+ code: str,
+ message: str,
+ *,
+ more_info: Optional[str] = None,
) -> None:
"""
- Initialize a VolumeProfileCollectionNext object.
+ Initialize a VPNGatewayConnectionTunnelStatusReason object.
- :param str href: The URL for a page of resources.
+ :param str code: A snake case string succinctly identifying the status
+ reason.
+ :param str message: An explanation of the reason for this VPN gateway
+ connection tunnel's status.
+ :param str more_info: (optional) Link to documentation about this status
+ reason.
"""
- self.href = href
+ self.code = code
+ self.message = message
+ self.more_info = more_info
@classmethod
- def from_dict(cls, _dict: Dict) -> 'VolumeProfileCollectionNext':
- """Initialize a VolumeProfileCollectionNext object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VPNGatewayConnectionTunnelStatusReason':
+ """Initialize a VPNGatewayConnectionTunnelStatusReason object from a json dictionary."""
args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ if (code := _dict.get('code')) is not None:
+ args['code'] = code
else:
- raise ValueError('Required property \'href\' not present in VolumeProfileCollectionNext JSON')
+ raise ValueError('Required property \'code\' not present in VPNGatewayConnectionTunnelStatusReason JSON')
+ if (message := _dict.get('message')) is not None:
+ args['message'] = message
+ else:
+ raise ValueError('Required property \'message\' not present in VPNGatewayConnectionTunnelStatusReason JSON')
+ if (more_info := _dict.get('more_info')) is not None:
+ args['more_info'] = more_info
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VolumeProfileCollectionNext object from a json dictionary."""
+ """Initialize a VPNGatewayConnectionTunnelStatusReason object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'href') and self.href is not None:
- _dict['href'] = self.href
+ if hasattr(self, 'code') and self.code is not None:
+ _dict['code'] = self.code
+ if hasattr(self, 'message') and self.message is not None:
+ _dict['message'] = self.message
+ if hasattr(self, 'more_info') and self.more_info is not None:
+ _dict['more_info'] = self.more_info
return _dict
def _to_dict(self):
@@ -85600,87 +88096,95 @@ 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 VPNGatewayConnectionTunnelStatusReason object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VolumeProfileCollectionNext') -> bool:
+ def __eq__(self, other: 'VPNGatewayConnectionTunnelStatusReason') -> bool:
"""Return `true` when 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: 'VPNGatewayConnectionTunnelStatusReason') -> 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 CodeEnum(str, Enum):
"""
- Initialize a VolumeProfileIdentity object.
-
+ A snake case string succinctly identifying the status reason.
"""
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['VolumeProfileIdentityByName', 'VolumeProfileIdentityByHref'])
- )
- raise Exception(msg)
+
+ CANNOT_AUTHENTICATE_CONNECTION = 'cannot_authenticate_connection'
+ IKE_POLICY_MISMATCH = 'ike_policy_mismatch'
+ IKE_V1_ID_LOCAL_REMOTE_CIDR_MISMATCH = 'ike_v1_id_local_remote_cidr_mismatch'
+ IKE_V2_LOCAL_REMOTE_CIDR_MISMATCH = 'ike_v2_local_remote_cidr_mismatch'
+ INTERNAL_ERROR = 'internal_error'
+ IPSEC_POLICY_MISMATCH = 'ipsec_policy_mismatch'
+ PEER_NOT_RESPONDING = 'peer_not_responding'
-class VolumeProfileReference:
+
+class VPNGatewayHealthReason:
"""
- VolumeProfileReference.
+ VPNGatewayHealthReason.
- :attr str href: The URL for this volume profile.
- :attr str name: The globally unique name for this volume profile.
+ :param str code: A snake case string succinctly identifying the reason for this
+ health state.
+ :param str message: An explanation of the reason for this health state.
+ :param str more_info: (optional) Link to documentation about the reason for this
+ health state.
"""
def __init__(
self,
- href: str,
- name: str,
+ code: str,
+ message: str,
+ *,
+ more_info: Optional[str] = None,
) -> None:
"""
- Initialize a VolumeProfileReference object.
+ Initialize a VPNGatewayHealthReason object.
- :param str href: The URL for this volume profile.
- :param str name: The globally unique name for this volume profile.
+ :param str code: A snake case string succinctly identifying the reason for
+ this health state.
+ :param str message: An explanation of the reason for this health state.
+ :param str more_info: (optional) Link to documentation about the reason for
+ this health state.
"""
- self.href = href
- self.name = name
+ self.code = code
+ self.message = message
+ self.more_info = more_info
@classmethod
- def from_dict(cls, _dict: Dict) -> 'VolumeProfileReference':
- """Initialize a VolumeProfileReference object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VPNGatewayHealthReason':
+ """Initialize a VPNGatewayHealthReason object from a json dictionary."""
args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ if (code := _dict.get('code')) is not None:
+ args['code'] = code
else:
- raise ValueError('Required property \'href\' not present in VolumeProfileReference JSON')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
+ raise ValueError('Required property \'code\' not present in VPNGatewayHealthReason JSON')
+ if (message := _dict.get('message')) is not None:
+ args['message'] = message
else:
- raise ValueError('Required property \'name\' not present in VolumeProfileReference JSON')
+ raise ValueError('Required property \'message\' not present in VPNGatewayHealthReason JSON')
+ if (more_info := _dict.get('more_info')) is not None:
+ args['more_info'] = more_info
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VolumeProfileReference object from a json dictionary."""
+ """Initialize a VPNGatewayHealthReason object from 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, '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):
@@ -85688,210 +88192,91 @@ 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 VPNGatewayHealthReason object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VolumeProfileReference') -> bool:
+ def __eq__(self, other: 'VPNGatewayHealthReason') -> bool:
"""Return `true` when 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: 'VPNGatewayHealthReason') -> 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 this volume. Applicable only to volumes using a profile `family` of
- `custom`.
- :attr str name: (optional) The name for this volume. The name must not be used
- by another volume in the region. If unspecified, the name will be a hyphenated
- list of randomly-selected words.
- :attr VolumeProfileIdentity profile: The
- [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-block-storage-profiles) to
- use for this volume.
- :attr ResourceGroupIdentity resource_group: (optional) The resource group to
- use. If unspecified, the account's [default resource
- group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be
- used.
- :attr List[str] user_tags: (optional) The [user
- tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with this
- volume.
- :attr ZoneIdentity zone: The zone this volume will reside in.
- """
-
- def __init__(
- self,
- profile: 'VolumeProfileIdentity',
- zone: 'ZoneIdentity',
- *,
- iops: int = None,
- name: str = None,
- resource_group: 'ResourceGroupIdentity' = None,
- user_tags: List[str] = None,
- ) -> None:
+ class CodeEnum(str, Enum):
"""
- Initialize a VolumePrototype object.
-
- :param VolumeProfileIdentity profile: The
- [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-block-storage-profiles)
- to
- use for this volume.
- :param ZoneIdentity zone: The zone this volume will reside in.
- :param int iops: (optional) The maximum I/O operations per second (IOPS) to
- use for this volume. Applicable only to volumes using a profile `family` of
- `custom`.
- :param str name: (optional) The name for this volume. The name must not be
- used by another volume in the region. If unspecified, the name will be a
- hyphenated list of randomly-selected words.
- :param ResourceGroupIdentity resource_group: (optional) The resource group
- to use. If unspecified, the account's [default resource
- group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be
- used.
- :param List[str] user_tags: (optional) The [user
- tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with
- this volume.
+ A snake case string succinctly identifying the reason for this health state.
"""
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['VolumePrototypeVolumeByCapacity', 'VolumePrototypeVolumeBySourceSnapshot'])
- )
- raise Exception(msg)
+
+ CANNOT_CREATE_VPC_ROUTE = 'cannot_create_vpc_route'
+ CANNOT_RESERVE_IP_ADDRESS = 'cannot_reserve_ip_address'
+ INTERNAL_ERROR = 'internal_error'
-class VolumePrototypeInstanceByImageContext:
+
+class VPNGatewayLifecycleReason:
"""
- VolumePrototypeInstanceByImageContext.
+ VPNGatewayLifecycleReason.
- :attr int capacity: (optional) The capacity to use for the volume (in
- gigabytes). Must be at least the image's
- `minimum_provisioned_size`. The maximum value may increase in the future.
- If unspecified, the capacity will be the image's `minimum_provisioned_size`.
- :attr EncryptionKeyIdentity encryption_key: (optional) The root key to use to
- wrap the data encryption key for the volume.
- If unspecified, the `encryption` type for the volume will be `provider_managed`.
- :attr int iops: (optional) The maximum I/O operations per second (IOPS) to use
- for this volume. Applicable only to volumes using a profile `family` of
- `custom`.
- :attr str name: (optional) The name for this volume. The name must not be used
- by another volume in the region. If unspecified, the name will be a hyphenated
- list of randomly-selected words.
- :attr VolumeProfileIdentity profile: The
- [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-block-storage-profiles) to
- use for this volume.
- :attr ResourceGroupIdentity resource_group: (optional) The resource group to use
- for this volume. If unspecified, the instance's resource
- group will be used.
- :attr List[str] user_tags: (optional) The [user
- tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with this
- volume.
+ :param str code: A snake case string succinctly identifying the reason for this
+ lifecycle state.
+ :param str message: An explanation of the reason for this lifecycle state.
+ :param str more_info: (optional) Link to documentation about the reason for this
+ lifecycle state.
"""
def __init__(
self,
- profile: 'VolumeProfileIdentity',
+ code: str,
+ message: str,
*,
- capacity: int = None,
- encryption_key: 'EncryptionKeyIdentity' = None,
- iops: int = None,
- name: str = None,
- resource_group: 'ResourceGroupIdentity' = None,
- user_tags: List[str] = None,
+ more_info: Optional[str] = None,
) -> None:
"""
- Initialize a VolumePrototypeInstanceByImageContext object.
+ Initialize a VPNGatewayLifecycleReason object.
- :param VolumeProfileIdentity profile: The
- [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-block-storage-profiles)
- to
- use for this volume.
- :param int capacity: (optional) The capacity to use for the volume (in
- gigabytes). Must be at least the image's
- `minimum_provisioned_size`. The maximum value may increase in the future.
- If unspecified, the capacity will be the image's
- `minimum_provisioned_size`.
- :param EncryptionKeyIdentity encryption_key: (optional) The root key to use
- to wrap the data encryption key for the volume.
- If unspecified, the `encryption` type for the volume will be
- `provider_managed`.
- :param int iops: (optional) The maximum I/O operations per second (IOPS) to
- use for this volume. Applicable only to volumes using a profile `family` of
- `custom`.
- :param str name: (optional) The name for this volume. The name must not be
- used by another volume in the region. If unspecified, the name will be a
- hyphenated list of randomly-selected words.
- :param ResourceGroupIdentity resource_group: (optional) The resource group
- to use for this volume. If unspecified, the instance's resource
- group will be used.
- :param List[str] user_tags: (optional) The [user
- tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with
- this volume.
+ :param str code: A snake case string succinctly identifying the reason for
+ this lifecycle state.
+ :param str message: An explanation of the reason for this lifecycle state.
+ :param str more_info: (optional) Link to documentation about the reason for
+ this lifecycle state.
"""
- self.capacity = capacity
- self.encryption_key = encryption_key
- self.iops = iops
- self.name = name
- self.profile = profile
- self.resource_group = resource_group
- self.user_tags = user_tags
+ self.code = code
+ self.message = message
+ self.more_info = more_info
@classmethod
- def from_dict(cls, _dict: Dict) -> 'VolumePrototypeInstanceByImageContext':
- """Initialize a VolumePrototypeInstanceByImageContext object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VPNGatewayLifecycleReason':
+ """Initialize a VPNGatewayLifecycleReason 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 (code := _dict.get('code')) is not None:
+ args['code'] = code
else:
- raise ValueError('Required property \'profile\' not present in VolumePrototypeInstanceByImageContext JSON')
- if 'resource_group' in _dict:
- args['resource_group'] = _dict.get('resource_group')
- if 'user_tags' in _dict:
- args['user_tags'] = _dict.get('user_tags')
+ raise ValueError('Required property \'code\' not present in VPNGatewayLifecycleReason JSON')
+ if (message := _dict.get('message')) is not None:
+ args['message'] = message
+ else:
+ raise ValueError('Required property \'message\' not present in VPNGatewayLifecycleReason JSON')
+ if (more_info := _dict.get('more_info')) is not None:
+ args['more_info'] = more_info
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VolumePrototypeInstanceByImageContext object from a json dictionary."""
+ """Initialize a VPNGatewayLifecycleReason object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'capacity') and self.capacity is not None:
- _dict['capacity'] = self.capacity
- if hasattr(self, 'encryption_key') and self.encryption_key is not None:
- if isinstance(self.encryption_key, dict):
- _dict['encryption_key'] = self.encryption_key
- else:
- _dict['encryption_key'] = self.encryption_key.to_dict()
- if hasattr(self, 'iops') and self.iops is not None:
- _dict['iops'] = self.iops
- if hasattr(self, 'name') and self.name is not None:
- _dict['name'] = self.name
- if hasattr(self, 'profile') and self.profile is not None:
- if isinstance(self.profile, dict):
- _dict['profile'] = self.profile
- else:
- _dict['profile'] = self.profile.to_dict()
- if hasattr(self, 'resource_group') and self.resource_group is not None:
- if isinstance(self.resource_group, dict):
- _dict['resource_group'] = self.resource_group
- else:
- _dict['resource_group'] = self.resource_group.to_dict()
- if hasattr(self, 'user_tags') and self.user_tags is not None:
- _dict['user_tags'] = self.user_tags
+ 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):
@@ -85899,164 +88284,201 @@ 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 VPNGatewayLifecycleReason object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VolumePrototypeInstanceByImageContext') -> bool:
+ def __eq__(self, other: 'VPNGatewayLifecycleReason') -> bool:
"""Return `true` when 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: 'VPNGatewayLifecycleReason') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
+ class CodeEnum(str, Enum):
+ """
+ A snake case string succinctly identifying the reason for this lifecycle state.
+ """
-class VolumePrototypeInstanceBySourceSnapshotContext:
- """
- VolumePrototypeInstanceBySourceSnapshotContext.
+ RESOURCE_SUSPENDED_BY_PROVIDER = 'resource_suspended_by_provider'
- :attr int capacity: (optional) The capacity to use for the volume (in
- gigabytes). Must be at least the snapshot's
- `minimum_capacity`. The maximum value may increase in the future.
- If unspecified, the capacity will be the source snapshot's `minimum_capacity`.
- :attr EncryptionKeyIdentity encryption_key: (optional) The root key to use to
- wrap the data encryption key for the volume.
- If unspecified, the `encryption` type for the volume will be `provider_managed`.
- :attr int iops: (optional) The maximum I/O operations per second (IOPS) to use
- for this volume. Applicable only to volumes using a profile `family` of
- `custom`.
- :attr str name: (optional) The name for this volume. The name must not be used
- by another volume in the region. If unspecified, the name will be a hyphenated
- list of randomly-selected words.
- :attr VolumeProfileIdentity profile: The
- [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-block-storage-profiles) to
- use for this volume.
- :attr ResourceGroupIdentity resource_group: (optional) The resource group to use
- for this volume. If unspecified, the instance's resource
- group will be used.
- :attr SnapshotIdentity source_snapshot: The snapshot from which to clone the
- volume.
- :attr List[str] user_tags: (optional) The [user
- tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with this
- volume.
+
+
+class VPNGatewayMember:
+ """
+ VPNGatewayMember.
+
+ :param List[VPNGatewayMemberHealthReason] health_reasons: The reasons for the
+ current VPN gateway member health_state (if any):
+ - `cannot_reserve_ip_address`: IP address exhaustion (release addresses on the
+ VPN's
+ subnet)
+ - `internal_error`: Internal error (contact IBM support)
+ The enumerated reason code values for this property will expand in the future.
+ When processing this property, check for and log unknown values. Optionally halt
+ processing and surface the error, or bypass the resource on which the unexpected
+ reason code was encountered.
+ :param str health_state: The health of this resource.
+ - `ok`: No abnormal behavior detected
+ - `degraded`: Experiencing compromised performance, capacity, or connectivity
+ - `faulted`: Completely unreachable, inoperative, or otherwise entirely
+ incapacitated
+ - `inapplicable`: The health state does not apply because of the current
+ lifecycle state. A resource with a lifecycle state of `failed` or `deleting`
+ will have a health state of `inapplicable`. A `pending` resource may also have
+ this state.
+ :param List[VPNGatewayMemberLifecycleReason] lifecycle_reasons: The reasons for
+ the current VPN gateway member lifecycle_state (if any):
+ - `resource_suspended_by_provider`: The resource has been suspended (contact IBM
+ support)
+ The enumerated reason code values for this property will expand in the future.
+ When processing this property, check for and log unknown values. Optionally halt
+ processing and surface the error, or bypass the resource on which the unexpected
+ reason code was encountered.
+ :param str lifecycle_state: The lifecycle state of the VPN gateway member.
+ :param ReservedIPReference private_ip: The reserved IP address assigned to the
+ VPN gateway member.
+ This property will be present only when the VPN gateway status is `available`.
+ :param IP public_ip: The public IP address assigned to the VPN gateway member.
+ :param str role: The high availability role assigned to the VPN gateway member.
"""
def __init__(
self,
- profile: 'VolumeProfileIdentity',
- source_snapshot: 'SnapshotIdentity',
- *,
- capacity: int = None,
- encryption_key: 'EncryptionKeyIdentity' = None,
- iops: int = None,
- name: str = None,
- resource_group: 'ResourceGroupIdentity' = None,
- user_tags: List[str] = None,
+ health_reasons: List['VPNGatewayMemberHealthReason'],
+ health_state: str,
+ lifecycle_reasons: List['VPNGatewayMemberLifecycleReason'],
+ lifecycle_state: str,
+ private_ip: 'ReservedIPReference',
+ public_ip: 'IP',
+ role: str,
) -> None:
"""
- Initialize a VolumePrototypeInstanceBySourceSnapshotContext object.
+ Initialize a VPNGatewayMember object.
- :param VolumeProfileIdentity profile: The
- [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-block-storage-profiles)
- to
- use for this volume.
- :param SnapshotIdentity source_snapshot: The snapshot from which to clone
- the volume.
- :param int capacity: (optional) The capacity to use for the volume (in
- gigabytes). Must be at least the snapshot's
- `minimum_capacity`. The maximum value may increase in the future.
- If unspecified, the capacity will be the source snapshot's
- `minimum_capacity`.
- :param EncryptionKeyIdentity encryption_key: (optional) The root key to use
- to wrap the data encryption key for the volume.
- If unspecified, the `encryption` type for the volume will be
- `provider_managed`.
- :param int iops: (optional) The maximum I/O operations per second (IOPS) to
- use for this volume. Applicable only to volumes using a profile `family` of
- `custom`.
- :param str name: (optional) The name for this volume. The name must not be
- used by another volume in the region. If unspecified, the name will be a
- hyphenated list of randomly-selected words.
- :param ResourceGroupIdentity resource_group: (optional) The resource group
- to use for this volume. If unspecified, the instance's resource
- group will be used.
- :param List[str] user_tags: (optional) The [user
- tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with
- this volume.
+ :param List[VPNGatewayMemberHealthReason] health_reasons: The reasons for
+ the current VPN gateway member health_state (if any):
+ - `cannot_reserve_ip_address`: IP address exhaustion (release addresses on
+ the VPN's
+ subnet)
+ - `internal_error`: Internal error (contact IBM support)
+ The enumerated reason code values for this property will expand in the
+ future. When processing this property, check for and log unknown values.
+ Optionally halt processing and surface the error, or bypass the resource on
+ which the unexpected reason code was encountered.
+ :param str health_state: The health of this resource.
+ - `ok`: No abnormal behavior detected
+ - `degraded`: Experiencing compromised performance, capacity, or
+ connectivity
+ - `faulted`: Completely unreachable, inoperative, or otherwise entirely
+ incapacitated
+ - `inapplicable`: The health state does not apply because of the current
+ lifecycle state. A resource with a lifecycle state of `failed` or
+ `deleting` will have a health state of `inapplicable`. A `pending` resource
+ may also have this state.
+ :param List[VPNGatewayMemberLifecycleReason] lifecycle_reasons: The reasons
+ for the current VPN gateway member lifecycle_state (if any):
+ - `resource_suspended_by_provider`: The resource has been suspended
+ (contact IBM
+ support)
+ The enumerated reason code values for this property will expand in the
+ future. When processing this property, check for and log unknown values.
+ Optionally halt processing and surface the error, or bypass the resource on
+ which the unexpected reason code was encountered.
+ :param str lifecycle_state: The lifecycle state of the VPN gateway member.
+ :param ReservedIPReference private_ip: The reserved IP address assigned to
+ the VPN gateway member.
+ This property will be present only when the VPN gateway status is
+ `available`.
+ :param IP public_ip: The public IP address assigned to the VPN gateway
+ member.
+ :param str role: The high availability role assigned to the VPN gateway
+ member.
"""
- self.capacity = capacity
- self.encryption_key = encryption_key
- self.iops = iops
- self.name = name
- self.profile = profile
- self.resource_group = resource_group
- self.source_snapshot = source_snapshot
- self.user_tags = user_tags
+ self.health_reasons = health_reasons
+ self.health_state = health_state
+ self.lifecycle_reasons = lifecycle_reasons
+ self.lifecycle_state = lifecycle_state
+ self.private_ip = private_ip
+ self.public_ip = public_ip
+ self.role = role
@classmethod
- def from_dict(cls, _dict: Dict) -> 'VolumePrototypeInstanceBySourceSnapshotContext':
- """Initialize a VolumePrototypeInstanceBySourceSnapshotContext object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VPNGatewayMember':
+ """Initialize a VPNGatewayMember 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 (health_reasons := _dict.get('health_reasons')) is not None:
+ args['health_reasons'] = [VPNGatewayMemberHealthReason.from_dict(v) for v in health_reasons]
else:
- raise ValueError('Required property \'profile\' not present in VolumePrototypeInstanceBySourceSnapshotContext JSON')
- if 'resource_group' in _dict:
- args['resource_group'] = _dict.get('resource_group')
- if 'source_snapshot' in _dict:
- args['source_snapshot'] = _dict.get('source_snapshot')
+ raise ValueError('Required property \'health_reasons\' not present in VPNGatewayMember JSON')
+ if (health_state := _dict.get('health_state')) is not None:
+ args['health_state'] = health_state
else:
- raise ValueError('Required property \'source_snapshot\' not present in VolumePrototypeInstanceBySourceSnapshotContext JSON')
- if 'user_tags' in _dict:
- args['user_tags'] = _dict.get('user_tags')
+ raise ValueError('Required property \'health_state\' not present in VPNGatewayMember JSON')
+ if (lifecycle_reasons := _dict.get('lifecycle_reasons')) is not None:
+ args['lifecycle_reasons'] = [VPNGatewayMemberLifecycleReason.from_dict(v) for v in lifecycle_reasons]
+ else:
+ raise ValueError('Required property \'lifecycle_reasons\' not present in VPNGatewayMember JSON')
+ if (lifecycle_state := _dict.get('lifecycle_state')) is not None:
+ args['lifecycle_state'] = lifecycle_state
+ else:
+ raise ValueError('Required property \'lifecycle_state\' not present in VPNGatewayMember JSON')
+ if (private_ip := _dict.get('private_ip')) is not None:
+ args['private_ip'] = ReservedIPReference.from_dict(private_ip)
+ else:
+ raise ValueError('Required property \'private_ip\' not present in VPNGatewayMember JSON')
+ if (public_ip := _dict.get('public_ip')) is not None:
+ args['public_ip'] = IP.from_dict(public_ip)
+ else:
+ raise ValueError('Required property \'public_ip\' not present in VPNGatewayMember JSON')
+ if (role := _dict.get('role')) is not None:
+ args['role'] = role
+ else:
+ raise ValueError('Required property \'role\' not present in VPNGatewayMember JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VolumePrototypeInstanceBySourceSnapshotContext 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, 'capacity') and self.capacity is not None:
- _dict['capacity'] = self.capacity
- if hasattr(self, 'encryption_key') and self.encryption_key is not None:
- if isinstance(self.encryption_key, dict):
- _dict['encryption_key'] = self.encryption_key
- else:
- _dict['encryption_key'] = self.encryption_key.to_dict()
- if hasattr(self, 'iops') and self.iops is not None:
- _dict['iops'] = self.iops
- if hasattr(self, 'name') and self.name is not None:
- _dict['name'] = self.name
- if hasattr(self, 'profile') and self.profile is not None:
- if isinstance(self.profile, dict):
- _dict['profile'] = self.profile
- else:
- _dict['profile'] = self.profile.to_dict()
- if hasattr(self, 'resource_group') and self.resource_group is not None:
- if isinstance(self.resource_group, dict):
- _dict['resource_group'] = self.resource_group
+ if hasattr(self, 'health_reasons') and self.health_reasons is not None:
+ health_reasons_list = []
+ for v in self.health_reasons:
+ if isinstance(v, dict):
+ health_reasons_list.append(v)
+ else:
+ health_reasons_list.append(v.to_dict())
+ _dict['health_reasons'] = health_reasons_list
+ if hasattr(self, 'health_state') and self.health_state is not None:
+ _dict['health_state'] = self.health_state
+ if hasattr(self, 'lifecycle_reasons') and self.lifecycle_reasons is not None:
+ lifecycle_reasons_list = []
+ for v in self.lifecycle_reasons:
+ if isinstance(v, dict):
+ lifecycle_reasons_list.append(v)
+ else:
+ lifecycle_reasons_list.append(v.to_dict())
+ _dict['lifecycle_reasons'] = lifecycle_reasons_list
+ if hasattr(self, 'lifecycle_state') and self.lifecycle_state is not None:
+ _dict['lifecycle_state'] = self.lifecycle_state
+ if hasattr(self, 'private_ip') and self.private_ip is not None:
+ if isinstance(self.private_ip, dict):
+ _dict['private_ip'] = self.private_ip
else:
- _dict['resource_group'] = self.resource_group.to_dict()
- if hasattr(self, 'source_snapshot') and self.source_snapshot is not None:
- if isinstance(self.source_snapshot, dict):
- _dict['source_snapshot'] = self.source_snapshot
+ _dict['private_ip'] = self.private_ip.to_dict()
+ if hasattr(self, 'public_ip') and self.public_ip is not None:
+ if isinstance(self.public_ip, dict):
+ _dict['public_ip'] = self.public_ip
else:
- _dict['source_snapshot'] = self.source_snapshot.to_dict()
- if hasattr(self, 'user_tags') and self.user_tags is not None:
- _dict['user_tags'] = self.user_tags
+ _dict['public_ip'] = self.public_ip.to_dict()
+ if hasattr(self, 'role') and self.role is not None:
+ _dict['role'] = self.role
return _dict
def _to_dict(self):
@@ -86064,131 +88486,122 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this VolumePrototypeInstanceBySourceSnapshotContext object."""
+ """Return a `str` version of this VPNGatewayMember object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VolumePrototypeInstanceBySourceSnapshotContext') -> 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: 'VolumePrototypeInstanceBySourceSnapshotContext') -> bool:
+ def __ne__(self, other: 'VPNGatewayMember') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
+ class HealthStateEnum(str, Enum):
+ """
+ The health of this resource.
+ - `ok`: No abnormal behavior detected
+ - `degraded`: Experiencing compromised performance, capacity, or connectivity
+ - `faulted`: Completely unreachable, inoperative, or otherwise entirely
+ incapacitated
+ - `inapplicable`: The health state does not apply because of the current lifecycle
+ state. A resource with a lifecycle state of `failed` or `deleting` will have a
+ health state of `inapplicable`. A `pending` resource may also have this state.
+ """
+
+ DEGRADED = 'degraded'
+ FAULTED = 'faulted'
+ INAPPLICABLE = 'inapplicable'
+ OK = 'ok'
-class VolumeReference:
+
+ class LifecycleStateEnum(str, Enum):
+ """
+ The lifecycle state of the VPN gateway member.
+ """
+
+ DELETING = 'deleting'
+ FAILED = 'failed'
+ PENDING = 'pending'
+ STABLE = 'stable'
+ SUSPENDED = 'suspended'
+ UPDATING = 'updating'
+ WAITING = 'waiting'
+
+
+ class RoleEnum(str, Enum):
+ """
+ The high availability role assigned to the VPN gateway member.
+ """
+
+ ACTIVE = 'active'
+ STANDBY = 'standby'
+
+
+
+class VPNGatewayMemberHealthReason:
"""
- VolumeReference.
+ VPNGatewayMemberHealthReason.
- :attr str crn: The CRN for this volume.
- :attr VolumeReferenceDeleted deleted: (optional) If present, this property
- indicates the referenced resource has been deleted, and provides
- some supplementary information.
- :attr str href: The URL for this volume.
- :attr str id: The unique identifier for this volume.
- :attr str name: The name for this volume. The name is unique across all volumes
- in the region.
- :attr VolumeRemote remote: (optional) If present, this property indicates that
- the resource associated with this reference
- is remote and therefore may not be directly retrievable.
- :attr str resource_type: The resource type.
+ :param str code: A snake case string succinctly identifying the reason for this
+ health state.
+ :param str message: An explanation of the reason for this health state.
+ :param str more_info: (optional) Link to documentation about the reason for this
+ health state.
"""
def __init__(
self,
- crn: str,
- href: str,
- id: str,
- name: str,
- resource_type: str,
+ code: str,
+ message: str,
*,
- deleted: 'VolumeReferenceDeleted' = None,
- remote: 'VolumeRemote' = None,
+ more_info: Optional[str] = None,
) -> None:
"""
- Initialize a VolumeReference object.
+ Initialize a VPNGatewayMemberHealthReason object.
- :param str crn: The CRN for this volume.
- :param str href: The URL for this volume.
- :param str id: The unique identifier for this volume.
- :param str name: The name for this volume. The name is unique across all
- volumes in the region.
- :param str resource_type: The resource type.
- :param VolumeReferenceDeleted deleted: (optional) If present, this property
- indicates the referenced resource has been deleted, and provides
- some supplementary information.
- :param VolumeRemote remote: (optional) If present, this property indicates
- that the resource associated with this reference
- is remote and therefore may not be directly retrievable.
+ :param str code: A snake case string succinctly identifying the reason for
+ this health state.
+ :param str message: An explanation of the reason for this health state.
+ :param str more_info: (optional) Link to documentation about the reason for
+ this health state.
"""
- self.crn = crn
- self.deleted = deleted
- self.href = href
- self.id = id
- self.name = name
- self.remote = remote
- self.resource_type = resource_type
+ self.code = code
+ self.message = message
+ self.more_info = more_info
@classmethod
- def from_dict(cls, _dict: Dict) -> 'VolumeReference':
- """Initialize a VolumeReference object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VPNGatewayMemberHealthReason':
+ """Initialize a VPNGatewayMemberHealthReason 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')
+ if (code := _dict.get('code')) is not None:
+ args['code'] = code
else:
- raise ValueError('Required property \'name\' not present in VolumeReference JSON')
- if 'remote' in _dict:
- args['remote'] = VolumeRemote.from_dict(_dict.get('remote'))
- if 'resource_type' in _dict:
- args['resource_type'] = _dict.get('resource_type')
+ raise ValueError('Required property \'code\' not present in VPNGatewayMemberHealthReason JSON')
+ if (message := _dict.get('message')) is not None:
+ args['message'] = message
else:
- raise ValueError('Required property \'resource_type\' not present in VolumeReference JSON')
+ raise ValueError('Required property \'message\' not present in VPNGatewayMemberHealthReason JSON')
+ if (more_info := _dict.get('more_info')) is not None:
+ args['more_info'] = more_info
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VolumeReference object from a json dictionary."""
+ """Initialize a VPNGatewayMemberHealthReason object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'crn') and self.crn is not None:
- _dict['crn'] = self.crn
- if hasattr(self, 'deleted') and self.deleted is not None:
- if isinstance(self.deleted, dict):
- _dict['deleted'] = self.deleted
- else:
- _dict['deleted'] = self.deleted.to_dict()
- if hasattr(self, 'href') and self.href is not None:
- _dict['href'] = self.href
- if hasattr(self, 'id') and self.id is not None:
- _dict['id'] = self.id
- if hasattr(self, 'name') and self.name is not None:
- _dict['name'] = self.name
- if hasattr(self, 'remote') and self.remote is not None:
- if isinstance(self.remote, dict):
- _dict['remote'] = self.remote
- else:
- _dict['remote'] = self.remote.to_dict()
- if hasattr(self, 'resource_type') and self.resource_type is not None:
- _dict['resource_type'] = self.resource_type
+ if hasattr(self, '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):
@@ -86196,65 +88609,88 @@ 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 VPNGatewayMemberHealthReason object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VolumeReference') -> bool:
+ def __eq__(self, other: 'VPNGatewayMemberHealthReason') -> bool:
"""Return `true` when 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: 'VPNGatewayMemberHealthReason') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class ResourceTypeEnum(str, Enum):
+ class CodeEnum(str, Enum):
"""
- The resource type.
+ A snake case string succinctly identifying the reason for this health state.
"""
- VOLUME = 'volume'
+ CANNOT_RESERVE_IP_ADDRESS = 'cannot_reserve_ip_address'
+ INTERNAL_ERROR = 'internal_error'
-class VolumeReferenceDeleted:
+class VPNGatewayMemberLifecycleReason:
"""
- If present, this property indicates the referenced resource has been deleted, and
- provides some supplementary information.
+ VPNGatewayMemberLifecycleReason.
- :attr str more_info: Link to documentation about deleted resources.
+ :param str code: A snake case string succinctly identifying the reason for this
+ lifecycle state.
+ :param str message: An explanation of the reason for this lifecycle state.
+ :param str more_info: (optional) Link to documentation about the reason for this
+ lifecycle state.
"""
def __init__(
self,
- more_info: str,
+ code: str,
+ message: str,
+ *,
+ more_info: Optional[str] = None,
) -> None:
"""
- Initialize a VolumeReferenceDeleted object.
+ Initialize a VPNGatewayMemberLifecycleReason object.
- :param str more_info: Link to documentation about deleted resources.
+ :param str code: A snake case string succinctly identifying the reason for
+ this lifecycle state.
+ :param str message: An explanation of the reason for this lifecycle state.
+ :param str more_info: (optional) Link to documentation about the reason for
+ this lifecycle state.
"""
+ self.code = code
+ self.message = message
self.more_info = more_info
@classmethod
- def from_dict(cls, _dict: Dict) -> 'VolumeReferenceDeleted':
- """Initialize a VolumeReferenceDeleted object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VPNGatewayMemberLifecycleReason':
+ """Initialize a VPNGatewayMemberLifecycleReason object from a json dictionary."""
args = {}
- if 'more_info' in _dict:
- args['more_info'] = _dict.get('more_info')
+ if (code := _dict.get('code')) is not None:
+ args['code'] = code
else:
- raise ValueError('Required property \'more_info\' not present in VolumeReferenceDeleted JSON')
+ raise ValueError('Required property \'code\' not present in VPNGatewayMemberLifecycleReason JSON')
+ if (message := _dict.get('message')) is not None:
+ args['message'] = message
+ else:
+ raise ValueError('Required property \'message\' not present in VPNGatewayMemberLifecycleReason JSON')
+ if (more_info := _dict.get('more_info')) is not None:
+ args['more_info'] = more_info
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VolumeReferenceDeleted object from a json dictionary."""
+ """Initialize a VPNGatewayMemberLifecycleReason object from 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
@@ -86264,118 +88700,67 @@ 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 VPNGatewayMemberLifecycleReason object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VolumeReferenceDeleted') -> bool:
+ def __eq__(self, other: 'VPNGatewayMemberLifecycleReason') -> bool:
"""Return `true` when 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: 'VPNGatewayMemberLifecycleReason') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
+ class CodeEnum(str, Enum):
+ """
+ A snake case string succinctly identifying the reason for this lifecycle state.
+ """
+
+ RESOURCE_SUSPENDED_BY_PROVIDER = 'resource_suspended_by_provider'
-class VolumeReferenceVolumeAttachmentContext:
+
+
+class VPNGatewayPatch:
"""
- VolumeReferenceVolumeAttachmentContext.
+ VPNGatewayPatch.
- :attr str crn: The CRN for this volume.
- :attr VolumeReferenceVolumeAttachmentContextDeleted deleted: (optional) If
- present, this property indicates the referenced resource has been deleted, and
- provides
- some supplementary information.
- :attr str href: The URL for this volume.
- :attr str id: The unique identifier for this volume.
- :attr str name: The name for this volume. The name is unique across all volumes
- in the region.
- :attr str resource_type: The resource type.
+ :param str name: (optional) The name for this VPN gateway. The name must not be
+ used by another VPN gateway in the VPC.
"""
def __init__(
self,
- crn: str,
- href: str,
- id: str,
- name: str,
- resource_type: str,
*,
- deleted: 'VolumeReferenceVolumeAttachmentContextDeleted' = None,
+ name: Optional[str] = None,
) -> None:
"""
- Initialize a VolumeReferenceVolumeAttachmentContext object.
+ Initialize a VPNGatewayPatch object.
- :param str crn: The CRN for this volume.
- :param str href: The URL for this volume.
- :param str id: The unique identifier for this volume.
- :param str name: The name for this volume. The name is unique across all
- volumes in the region.
- :param str resource_type: The resource type.
- :param VolumeReferenceVolumeAttachmentContextDeleted deleted: (optional) If
- present, this property indicates the referenced resource has been deleted,
- and provides
- some supplementary information.
+ :param str name: (optional) The name for this VPN gateway. The name must
+ not be used by another VPN gateway in the VPC.
"""
- 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) -> 'VolumeReferenceVolumeAttachmentContext':
- """Initialize a VolumeReferenceVolumeAttachmentContext object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VPNGatewayPatch':
+ """Initialize a VPNGatewayPatch object from a json dictionary."""
args = {}
- if 'crn' in _dict:
- args['crn'] = _dict.get('crn')
- else:
- raise ValueError('Required property \'crn\' not present in VolumeReferenceVolumeAttachmentContext JSON')
- if 'deleted' in _dict:
- args['deleted'] = VolumeReferenceVolumeAttachmentContextDeleted.from_dict(_dict.get('deleted'))
- if 'href' in _dict:
- args['href'] = _dict.get('href')
- else:
- raise ValueError('Required property \'href\' not present in VolumeReferenceVolumeAttachmentContext JSON')
- if 'id' in _dict:
- args['id'] = _dict.get('id')
- else:
- raise ValueError('Required property \'id\' not present in VolumeReferenceVolumeAttachmentContext JSON')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
- else:
- raise ValueError('Required property \'name\' not present in VolumeReferenceVolumeAttachmentContext JSON')
- if 'resource_type' in _dict:
- args['resource_type'] = _dict.get('resource_type')
- else:
- raise ValueError('Required property \'resource_type\' not present in VolumeReferenceVolumeAttachmentContext JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VolumeReferenceVolumeAttachmentContext 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, 'crn') and self.crn is not None:
- _dict['crn'] = self.crn
- if hasattr(self, 'deleted') and self.deleted is not None:
- if isinstance(self.deleted, dict):
- _dict['deleted'] = self.deleted
- else:
- _dict['deleted'] = self.deleted.to_dict()
- if hasattr(self, 'href') and self.href is not None:
- _dict['href'] = self.href
- if hasattr(self, 'id') and self.id is not None:
- _dict['id'] = self.id
if hasattr(self, 'name') and self.name is not None:
_dict['name'] = self.name
- if hasattr(self, 'resource_type') and self.resource_type is not None:
- _dict['resource_type'] = self.resource_type
return _dict
def _to_dict(self):
@@ -86383,133 +88768,98 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this VolumeReferenceVolumeAttachmentContext object."""
+ """Return a `str` version of this VPNGatewayPatch object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VolumeReferenceVolumeAttachmentContext') -> 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: 'VolumeReferenceVolumeAttachmentContext') -> bool:
+ def __ne__(self, other: 'VPNGatewayPatch') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class ResourceTypeEnum(str, Enum):
- """
- The resource type.
- """
-
- VOLUME = 'volume'
-
-
-class VolumeReferenceVolumeAttachmentContextDeleted:
+class VPNGatewayPrototype:
"""
- If present, this property indicates the referenced resource has been deleted, and
- provides some supplementary information.
+ VPNGatewayPrototype.
- :attr str more_info: Link to documentation about deleted resources.
+ :param str name: (optional) The name for this VPN gateway. The name must not be
+ used by another VPN gateway in the VPC. If unspecified, the name will be a
+ hyphenated list of randomly-selected words.
+ :param ResourceGroupIdentity resource_group: (optional) The resource group to
+ use. If unspecified, the account's [default resource
+ group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be
+ used.
+ :param SubnetIdentity subnet: Identifies a subnet by a unique property.
"""
def __init__(
self,
- more_info: str,
+ subnet: 'SubnetIdentity',
+ *,
+ name: Optional[str] = None,
+ resource_group: Optional['ResourceGroupIdentity'] = None,
) -> None:
"""
- Initialize a VolumeReferenceVolumeAttachmentContextDeleted object.
-
- :param str more_info: Link to documentation about deleted resources.
- """
- self.more_info = more_info
+ Initialize a VPNGatewayPrototype object.
- @classmethod
- def from_dict(cls, _dict: Dict) -> 'VolumeReferenceVolumeAttachmentContextDeleted':
- """Initialize a VolumeReferenceVolumeAttachmentContextDeleted object from a json dictionary."""
- args = {}
- if 'more_info' in _dict:
- args['more_info'] = _dict.get('more_info')
- else:
- raise ValueError('Required property \'more_info\' not present in VolumeReferenceVolumeAttachmentContextDeleted JSON')
- return cls(**args)
-
- @classmethod
- def _from_dict(cls, _dict):
- """Initialize a VolumeReferenceVolumeAttachmentContextDeleted object from 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 VolumeReferenceVolumeAttachmentContextDeleted object."""
- return json.dumps(self.to_dict(), indent=2)
-
- def __eq__(self, other: 'VolumeReferenceVolumeAttachmentContextDeleted') -> bool:
- """Return `true` when self and other are equal, false otherwise."""
- if not isinstance(other, self.__class__):
- return False
- return self.__dict__ == other.__dict__
-
- def __ne__(self, other: 'VolumeReferenceVolumeAttachmentContextDeleted') -> bool:
- """Return `true` when self and other are not equal, false otherwise."""
- return not self == other
+ :param SubnetIdentity subnet: Identifies a subnet by a unique property.
+ :param str name: (optional) The name for this VPN gateway. The name must
+ not be used by another VPN gateway in the VPC. If unspecified, the name
+ will be a hyphenated list of randomly-selected words.
+ :param ResourceGroupIdentity resource_group: (optional) The resource group
+ to use. If unspecified, the account's [default resource
+ group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be
+ used.
+ """
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['VPNGatewayPrototypeVPNGatewayRouteModePrototype', 'VPNGatewayPrototypeVPNGatewayPolicyModePrototype'])
+ )
+ raise Exception(msg)
-class VolumeRemote:
+class VPNGatewayReferenceDeleted:
"""
- If present, this property indicates that the resource associated with this reference
- is remote and therefore may not be directly retrievable.
+ If present, this property indicates the referenced resource has been deleted, and
+ provides some supplementary information.
- :attr RegionReference region: (optional) If present, this property indicates
- that the referenced resource is remote to this
- region, and identifies the native region.
+ :param str more_info: Link to documentation about deleted resources.
"""
def __init__(
self,
- *,
- region: 'RegionReference' = None,
+ more_info: str,
) -> None:
"""
- Initialize a VolumeRemote object.
+ Initialize a VPNGatewayReferenceDeleted object.
- :param RegionReference region: (optional) If present, this property
- indicates that the referenced resource is remote to this
- region, and identifies the native region.
+ :param str more_info: Link to documentation about deleted resources.
"""
- self.region = region
+ self.more_info = more_info
@classmethod
- def from_dict(cls, _dict: Dict) -> 'VolumeRemote':
- """Initialize a VolumeRemote object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VPNGatewayReferenceDeleted':
+ """Initialize a VPNGatewayReferenceDeleted object from a json dictionary."""
args = {}
- if 'region' in _dict:
- args['region'] = RegionReference.from_dict(_dict.get('region'))
+ if (more_info := _dict.get('more_info')) is not None:
+ args['more_info'] = more_info
+ else:
+ raise ValueError('Required property \'more_info\' not present in VPNGatewayReferenceDeleted JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VolumeRemote object from a json dictionary."""
+ """Initialize a VPNGatewayReferenceDeleted object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'region') and self.region is not None:
- if isinstance(self.region, dict):
- _dict['region'] = self.region
- else:
- _dict['region'] = self.region.to_dict()
+ if hasattr(self, 'more_info') and self.more_info is not None:
+ _dict['more_info'] = self.more_info
return _dict
def _to_dict(self):
@@ -86517,79 +88867,471 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this VolumeRemote object."""
+ """Return a `str` version of this VPNGatewayReferenceDeleted object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VolumeRemote') -> bool:
+ def __eq__(self, other: 'VPNGatewayReferenceDeleted') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'VolumeRemote') -> bool:
+ def __ne__(self, other: 'VPNGatewayReferenceDeleted') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class VolumeStatusReason:
+class VPNServer:
"""
- VolumeStatusReason.
+ VPNServer.
- :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.
+ :param CertificateInstanceReference certificate: The certificate instance for
+ this VPN server.
+ :param List[VPNServerAuthentication] client_authentication: The methods used to
+ authenticate VPN clients to this VPN server. VPN clients must authenticate
+ against all specified methods.
+ :param bool client_auto_delete: Indicates whether disconnected VPN clients will
+ be automatically deleted after
+ `client_auto_delete_timeout` hours have passed. At present, this is always
+ `true`, but may be modifiable in the future.
+ :param int client_auto_delete_timeout: If `client_auto_delete` is `true`, the
+ hours after which disconnected VPN clients will be automatically deleted. If the
+ value is `0`, disconnected VPN clients will be deleted immediately. This value
+ may be modifiable in the future.
+ :param List[IP] client_dns_server_ips: The DNS server addresses that will be
+ provided to VPN clients that are connected to this VPN server.
+ :param int client_idle_timeout: The seconds a VPN client can be idle before this
+ VPN server will disconnect it. If `0`, the server will not disconnect idle
+ clients.
+ :param str client_ip_pool: The VPN client IPv4 address pool, expressed in CIDR
+ format.
+ :param datetime created_at: The date and time that the VPN server was created.
+ :param str crn: The CRN for this VPN server.
+ :param bool enable_split_tunneling: Indicates whether the split tunneling is
+ enabled on this VPN server.
+ :param List[VPNServerHealthReason] health_reasons: The reasons for the current
+ VPN server health_state (if any):
+ - `cannot_access_client_certificate`: VPN server's client certificate is
+ inaccessible
+ (verify certificate exists and that IAM policies grant `VPN server for VPC`
+ access
+ to `Secrets Manager`)
+ - `cannot_access_server_certificate`: VPN server's server certificate is
+ inaccessible
+ (verify certificate exists and that IAM policies grant `VPN server for VPC`
+ access
+ to `Secrets Manager`)
+ - `cannot_create_vpc_route`: VPN cannot create route (check for conflict)
+ - `cannot_reserve_ip_address`: IP address exhaustion (release addresses on the
+ VPN's
+ subnet)
+ - `internal_error`: Internal error (contact IBM support)
+ The enumerated reason code values for this property will expand in the future.
+ When processing this property, check for and log unknown values. Optionally halt
+ processing and surface the error, or bypass the resource on which the unexpected
+ reason code was encountered.
+ :param str health_state: The health of this resource.
+ - `ok`: No abnormal behavior detected
+ - `degraded`: Experiencing compromised performance, capacity, or connectivity
+ - `faulted`: Completely unreachable, inoperative, or otherwise entirely
+ incapacitated
+ - `inapplicable`: The health state does not apply because of the current
+ lifecycle state. A resource with a lifecycle state of `failed` or `deleting`
+ will have a health state of `inapplicable`. A `pending` resource may also have
+ this state.
+ :param str hostname: Fully qualified domain name assigned to this VPN server.
+ :param str href: The URL for this VPN server.
+ :param str id: The unique identifier for this VPN server.
+ :param List[VPNServerLifecycleReason] lifecycle_reasons: The reasons for the
+ current VPN server lifecycle_state (if any):
+ - `resource_suspended_by_provider`: The resource has been suspended (contact IBM
+ support)
+ The enumerated reason code values for this property will expand in the future.
+ When processing this property, check for and log unknown values. Optionally halt
+ processing and surface the error, or bypass the resource on which the unexpected
+ reason code was encountered.
+ :param str lifecycle_state: The lifecycle state of the VPN server.
+ :param str name: The name for this VPN server. The name is unique across all VPN
+ servers in the VPC.
+ :param int port: The port number used by this VPN server.
+ :param List[ReservedIPReference] private_ips: The reserved IPs bound to this VPN
+ server.
+ :param str protocol: The transport protocol used by this VPN server.
+ :param ResourceGroupReference resource_group: The resource group for this VPN
+ server.
+ :param str resource_type: The resource type.
+ :param List[SecurityGroupReference] security_groups: The security groups
+ targeting this VPN server.
+ :param List[SubnetReference] subnets: The subnets this VPN server is provisioned
+ in.
+ :param VPCReference vpc: The VPC this VPN server resides in.
"""
def __init__(
self,
- code: str,
- message: str,
- *,
- more_info: str = None,
+ certificate: 'CertificateInstanceReference',
+ client_authentication: List['VPNServerAuthentication'],
+ client_auto_delete: bool,
+ client_auto_delete_timeout: int,
+ client_dns_server_ips: List['IP'],
+ client_idle_timeout: int,
+ client_ip_pool: str,
+ created_at: datetime,
+ crn: str,
+ enable_split_tunneling: bool,
+ health_reasons: List['VPNServerHealthReason'],
+ health_state: str,
+ hostname: str,
+ href: str,
+ id: str,
+ lifecycle_reasons: List['VPNServerLifecycleReason'],
+ lifecycle_state: str,
+ name: str,
+ port: int,
+ private_ips: List['ReservedIPReference'],
+ protocol: str,
+ resource_group: 'ResourceGroupReference',
+ resource_type: str,
+ security_groups: List['SecurityGroupReference'],
+ subnets: List['SubnetReference'],
+ vpc: 'VPCReference',
) -> None:
"""
- Initialize a VolumeStatusReason object.
+ Initialize a VPNServer 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 CertificateInstanceReference certificate: The certificate instance
+ for this VPN server.
+ :param List[VPNServerAuthentication] client_authentication: The methods
+ used to authenticate VPN clients to this VPN server. VPN clients must
+ authenticate against all specified methods.
+ :param bool client_auto_delete: Indicates whether disconnected VPN clients
+ will be automatically deleted after
+ `client_auto_delete_timeout` hours have passed. At present, this is always
+ `true`, but may be modifiable in the future.
+ :param int client_auto_delete_timeout: If `client_auto_delete` is `true`,
+ the hours after which disconnected VPN clients will be automatically
+ deleted. If the value is `0`, disconnected VPN clients will be deleted
+ immediately. This value may be modifiable in the future.
+ :param List[IP] client_dns_server_ips: The DNS server addresses that will
+ be provided to VPN clients that are connected to this VPN server.
+ :param int client_idle_timeout: The seconds a VPN client can be idle before
+ this VPN server will disconnect it. If `0`, the server will not disconnect
+ idle clients.
+ :param str client_ip_pool: The VPN client IPv4 address pool, expressed in
+ CIDR format.
+ :param datetime created_at: The date and time that the VPN server was
+ created.
+ :param str crn: The CRN for this VPN server.
+ :param bool enable_split_tunneling: Indicates whether the split tunneling
+ is enabled on this VPN server.
+ :param List[VPNServerHealthReason] health_reasons: The reasons for the
+ current VPN server health_state (if any):
+ - `cannot_access_client_certificate`: VPN server's client certificate is
+ inaccessible
+ (verify certificate exists and that IAM policies grant `VPN server for
+ VPC` access
+ to `Secrets Manager`)
+ - `cannot_access_server_certificate`: VPN server's server certificate is
+ inaccessible
+ (verify certificate exists and that IAM policies grant `VPN server for
+ VPC` access
+ to `Secrets Manager`)
+ - `cannot_create_vpc_route`: VPN cannot create route (check for conflict)
+ - `cannot_reserve_ip_address`: IP address exhaustion (release addresses on
+ the VPN's
+ subnet)
+ - `internal_error`: Internal error (contact IBM support)
+ The enumerated reason code values for this property will expand in the
+ future. When processing this property, check for and log unknown values.
+ Optionally halt processing and surface the error, or bypass the resource on
+ which the unexpected reason code was encountered.
+ :param str health_state: The health of this resource.
+ - `ok`: No abnormal behavior detected
+ - `degraded`: Experiencing compromised performance, capacity, or
+ connectivity
+ - `faulted`: Completely unreachable, inoperative, or otherwise entirely
+ incapacitated
+ - `inapplicable`: The health state does not apply because of the current
+ lifecycle state. A resource with a lifecycle state of `failed` or
+ `deleting` will have a health state of `inapplicable`. A `pending` resource
+ may also have this state.
+ :param str hostname: Fully qualified domain name assigned to this VPN
+ server.
+ :param str href: The URL for this VPN server.
+ :param str id: The unique identifier for this VPN server.
+ :param List[VPNServerLifecycleReason] lifecycle_reasons: The reasons for
+ the current VPN server lifecycle_state (if any):
+ - `resource_suspended_by_provider`: The resource has been suspended
+ (contact IBM
+ support)
+ The enumerated reason code values for this property will expand in the
+ future. When processing this property, check for and log unknown values.
+ Optionally halt processing and surface the error, or bypass the resource on
+ which the unexpected reason code was encountered.
+ :param str lifecycle_state: The lifecycle state of the VPN server.
+ :param str name: The name for this VPN server. The name is unique across
+ all VPN servers in the VPC.
+ :param int port: The port number used by this VPN server.
+ :param List[ReservedIPReference] private_ips: The reserved IPs bound to
+ this VPN server.
+ :param str protocol: The transport protocol used by this VPN server.
+ :param ResourceGroupReference resource_group: The resource group for this
+ VPN server.
+ :param str resource_type: The resource type.
+ :param List[SecurityGroupReference] security_groups: The security groups
+ targeting this VPN server.
+ :param List[SubnetReference] subnets: The subnets this VPN server is
+ provisioned in.
+ :param VPCReference vpc: The VPC this VPN server resides in.
"""
- self.code = code
- self.message = message
- self.more_info = more_info
+ self.certificate = certificate
+ self.client_authentication = client_authentication
+ self.client_auto_delete = client_auto_delete
+ self.client_auto_delete_timeout = client_auto_delete_timeout
+ self.client_dns_server_ips = client_dns_server_ips
+ self.client_idle_timeout = client_idle_timeout
+ self.client_ip_pool = client_ip_pool
+ self.created_at = created_at
+ self.crn = crn
+ self.enable_split_tunneling = enable_split_tunneling
+ self.health_reasons = health_reasons
+ self.health_state = health_state
+ self.hostname = hostname
+ self.href = href
+ self.id = id
+ self.lifecycle_reasons = lifecycle_reasons
+ self.lifecycle_state = lifecycle_state
+ self.name = name
+ self.port = port
+ self.private_ips = private_ips
+ self.protocol = protocol
+ self.resource_group = resource_group
+ self.resource_type = resource_type
+ self.security_groups = security_groups
+ self.subnets = subnets
+ self.vpc = vpc
@classmethod
- def from_dict(cls, _dict: Dict) -> 'VolumeStatusReason':
- """Initialize a VolumeStatusReason object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VPNServer':
+ """Initialize a VPNServer object from a json dictionary."""
args = {}
- if 'code' in _dict:
- args['code'] = _dict.get('code')
+ if (certificate := _dict.get('certificate')) is not None:
+ args['certificate'] = CertificateInstanceReference.from_dict(certificate)
else:
- raise ValueError('Required property \'code\' not present in VolumeStatusReason JSON')
- if 'message' in _dict:
- args['message'] = _dict.get('message')
+ raise ValueError('Required property \'certificate\' not present in VPNServer JSON')
+ if (client_authentication := _dict.get('client_authentication')) is not None:
+ args['client_authentication'] = client_authentication
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 \'client_authentication\' not present in VPNServer JSON')
+ if (client_auto_delete := _dict.get('client_auto_delete')) is not None:
+ args['client_auto_delete'] = client_auto_delete
+ else:
+ raise ValueError('Required property \'client_auto_delete\' not present in VPNServer JSON')
+ if (client_auto_delete_timeout := _dict.get('client_auto_delete_timeout')) is not None:
+ args['client_auto_delete_timeout'] = client_auto_delete_timeout
+ else:
+ raise ValueError('Required property \'client_auto_delete_timeout\' not present in VPNServer JSON')
+ if (client_dns_server_ips := _dict.get('client_dns_server_ips')) is not None:
+ args['client_dns_server_ips'] = [IP.from_dict(v) for v in client_dns_server_ips]
+ else:
+ raise ValueError('Required property \'client_dns_server_ips\' not present in VPNServer JSON')
+ if (client_idle_timeout := _dict.get('client_idle_timeout')) is not None:
+ args['client_idle_timeout'] = client_idle_timeout
+ else:
+ raise ValueError('Required property \'client_idle_timeout\' not present in VPNServer JSON')
+ if (client_ip_pool := _dict.get('client_ip_pool')) is not None:
+ args['client_ip_pool'] = client_ip_pool
+ else:
+ raise ValueError('Required property \'client_ip_pool\' not present in VPNServer JSON')
+ if (created_at := _dict.get('created_at')) is not None:
+ args['created_at'] = string_to_datetime(created_at)
+ else:
+ raise ValueError('Required property \'created_at\' not present in VPNServer JSON')
+ if (crn := _dict.get('crn')) is not None:
+ args['crn'] = crn
+ else:
+ raise ValueError('Required property \'crn\' not present in VPNServer JSON')
+ if (enable_split_tunneling := _dict.get('enable_split_tunneling')) is not None:
+ args['enable_split_tunneling'] = enable_split_tunneling
+ else:
+ raise ValueError('Required property \'enable_split_tunneling\' not present in VPNServer JSON')
+ if (health_reasons := _dict.get('health_reasons')) is not None:
+ args['health_reasons'] = [VPNServerHealthReason.from_dict(v) for v in health_reasons]
+ else:
+ raise ValueError('Required property \'health_reasons\' not present in VPNServer JSON')
+ if (health_state := _dict.get('health_state')) is not None:
+ args['health_state'] = health_state
+ else:
+ raise ValueError('Required property \'health_state\' not present in VPNServer JSON')
+ if (hostname := _dict.get('hostname')) is not None:
+ args['hostname'] = hostname
+ else:
+ raise ValueError('Required property \'hostname\' not present in VPNServer JSON')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
+ else:
+ raise ValueError('Required property \'href\' not present in VPNServer JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
+ else:
+ raise ValueError('Required property \'id\' not present in VPNServer JSON')
+ if (lifecycle_reasons := _dict.get('lifecycle_reasons')) is not None:
+ args['lifecycle_reasons'] = [VPNServerLifecycleReason.from_dict(v) for v in lifecycle_reasons]
+ else:
+ raise ValueError('Required property \'lifecycle_reasons\' not present in VPNServer JSON')
+ if (lifecycle_state := _dict.get('lifecycle_state')) is not None:
+ args['lifecycle_state'] = lifecycle_state
+ else:
+ raise ValueError('Required property \'lifecycle_state\' not present in VPNServer JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ else:
+ raise ValueError('Required property \'name\' not present in VPNServer JSON')
+ if (port := _dict.get('port')) is not None:
+ args['port'] = port
+ else:
+ raise ValueError('Required property \'port\' not present in VPNServer JSON')
+ if (private_ips := _dict.get('private_ips')) is not None:
+ args['private_ips'] = [ReservedIPReference.from_dict(v) for v in private_ips]
+ else:
+ raise ValueError('Required property \'private_ips\' not present in VPNServer JSON')
+ if (protocol := _dict.get('protocol')) is not None:
+ args['protocol'] = protocol
+ else:
+ raise ValueError('Required property \'protocol\' not present in VPNServer JSON')
+ if (resource_group := _dict.get('resource_group')) is not None:
+ args['resource_group'] = ResourceGroupReference.from_dict(resource_group)
+ else:
+ raise ValueError('Required property \'resource_group\' not present in VPNServer JSON')
+ if (resource_type := _dict.get('resource_type')) is not None:
+ args['resource_type'] = resource_type
+ else:
+ raise ValueError('Required property \'resource_type\' not present in VPNServer JSON')
+ if (security_groups := _dict.get('security_groups')) is not None:
+ args['security_groups'] = [SecurityGroupReference.from_dict(v) for v in security_groups]
+ else:
+ raise ValueError('Required property \'security_groups\' not present in VPNServer JSON')
+ if (subnets := _dict.get('subnets')) is not None:
+ args['subnets'] = [SubnetReference.from_dict(v) for v in subnets]
+ else:
+ raise ValueError('Required property \'subnets\' not present in VPNServer JSON')
+ if (vpc := _dict.get('vpc')) is not None:
+ args['vpc'] = VPCReference.from_dict(vpc)
+ else:
+ raise ValueError('Required property \'vpc\' not present in VPNServer JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VolumeStatusReason object from a json dictionary."""
+ """Initialize a VPNServer object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, '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, 'certificate') and self.certificate is not None:
+ if isinstance(self.certificate, dict):
+ _dict['certificate'] = self.certificate
+ else:
+ _dict['certificate'] = self.certificate.to_dict()
+ if hasattr(self, 'client_authentication') and self.client_authentication is not None:
+ client_authentication_list = []
+ for v in self.client_authentication:
+ if isinstance(v, dict):
+ client_authentication_list.append(v)
+ else:
+ client_authentication_list.append(v.to_dict())
+ _dict['client_authentication'] = client_authentication_list
+ if hasattr(self, 'client_auto_delete') and self.client_auto_delete is not None:
+ _dict['client_auto_delete'] = self.client_auto_delete
+ if hasattr(self, 'client_auto_delete_timeout') and self.client_auto_delete_timeout is not None:
+ _dict['client_auto_delete_timeout'] = self.client_auto_delete_timeout
+ if hasattr(self, 'client_dns_server_ips') and self.client_dns_server_ips is not None:
+ client_dns_server_ips_list = []
+ for v in self.client_dns_server_ips:
+ if isinstance(v, dict):
+ client_dns_server_ips_list.append(v)
+ else:
+ client_dns_server_ips_list.append(v.to_dict())
+ _dict['client_dns_server_ips'] = client_dns_server_ips_list
+ if hasattr(self, 'client_idle_timeout') and self.client_idle_timeout is not None:
+ _dict['client_idle_timeout'] = self.client_idle_timeout
+ if hasattr(self, 'client_ip_pool') and self.client_ip_pool is not None:
+ _dict['client_ip_pool'] = self.client_ip_pool
+ if hasattr(self, 'created_at') and self.created_at is not None:
+ _dict['created_at'] = datetime_to_string(self.created_at)
+ if hasattr(self, 'crn') and self.crn is not None:
+ _dict['crn'] = self.crn
+ if hasattr(self, 'enable_split_tunneling') and self.enable_split_tunneling is not None:
+ _dict['enable_split_tunneling'] = self.enable_split_tunneling
+ if hasattr(self, 'health_reasons') and self.health_reasons is not None:
+ health_reasons_list = []
+ for v in self.health_reasons:
+ if isinstance(v, dict):
+ health_reasons_list.append(v)
+ else:
+ health_reasons_list.append(v.to_dict())
+ _dict['health_reasons'] = health_reasons_list
+ if hasattr(self, 'health_state') and self.health_state is not None:
+ _dict['health_state'] = self.health_state
+ if hasattr(self, 'hostname') and self.hostname is not None:
+ _dict['hostname'] = self.hostname
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
+ if hasattr(self, 'id') and self.id is not None:
+ _dict['id'] = self.id
+ if hasattr(self, 'lifecycle_reasons') and self.lifecycle_reasons is not None:
+ lifecycle_reasons_list = []
+ for v in self.lifecycle_reasons:
+ if isinstance(v, dict):
+ lifecycle_reasons_list.append(v)
+ else:
+ lifecycle_reasons_list.append(v.to_dict())
+ _dict['lifecycle_reasons'] = lifecycle_reasons_list
+ if hasattr(self, 'lifecycle_state') and self.lifecycle_state is not None:
+ _dict['lifecycle_state'] = self.lifecycle_state
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ if hasattr(self, 'port') and self.port is not None:
+ _dict['port'] = self.port
+ if hasattr(self, 'private_ips') and self.private_ips is not None:
+ private_ips_list = []
+ for v in self.private_ips:
+ if isinstance(v, dict):
+ private_ips_list.append(v)
+ else:
+ private_ips_list.append(v.to_dict())
+ _dict['private_ips'] = private_ips_list
+ if hasattr(self, 'protocol') and self.protocol is not None:
+ _dict['protocol'] = self.protocol
+ if hasattr(self, 'resource_group') and self.resource_group is not None:
+ if isinstance(self.resource_group, dict):
+ _dict['resource_group'] = self.resource_group
+ else:
+ _dict['resource_group'] = self.resource_group.to_dict()
+ if hasattr(self, 'resource_type') and self.resource_type is not None:
+ _dict['resource_type'] = self.resource_type
+ if hasattr(self, 'security_groups') and self.security_groups is not None:
+ security_groups_list = []
+ for v in self.security_groups:
+ if isinstance(v, dict):
+ security_groups_list.append(v)
+ else:
+ security_groups_list.append(v.to_dict())
+ _dict['security_groups'] = security_groups_list
+ if hasattr(self, 'subnets') and self.subnets is not None:
+ subnets_list = []
+ for v in self.subnets:
+ if isinstance(v, dict):
+ subnets_list.append(v)
+ else:
+ subnets_list.append(v.to_dict())
+ _dict['subnets'] = subnets_list
+ if hasattr(self, 'vpc') and self.vpc is not None:
+ if isinstance(self.vpc, dict):
+ _dict['vpc'] = self.vpc
+ else:
+ _dict['vpc'] = self.vpc.to_dict()
return _dict
def _to_dict(self):
@@ -86597,99 +89339,354 @@ 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 VPNServer object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VolumeStatusReason') -> bool:
+ def __eq__(self, other: 'VPNServer') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'VolumeStatusReason') -> bool:
+ def __ne__(self, other: 'VPNServer') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class CodeEnum(str, Enum):
+ class HealthStateEnum(str, Enum):
"""
- A snake case string succinctly identifying the status reason.
+ 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.
"""
- ENCRYPTION_KEY_DELETED = 'encryption_key_deleted'
+ DEGRADED = 'degraded'
+ FAULTED = 'faulted'
+ INAPPLICABLE = 'inapplicable'
+ OK = 'ok'
+ class LifecycleStateEnum(str, Enum):
+ """
+ The lifecycle state of the VPN server.
+ """
-class Zone:
+ DELETING = 'deleting'
+ FAILED = 'failed'
+ PENDING = 'pending'
+ STABLE = 'stable'
+ SUSPENDED = 'suspended'
+ UPDATING = 'updating'
+ WAITING = 'waiting'
+
+
+ class ProtocolEnum(str, Enum):
+ """
+ The transport protocol used by this VPN server.
+ """
+
+ TCP = 'tcp'
+ UDP = 'udp'
+
+
+ class ResourceTypeEnum(str, Enum):
+ """
+ The resource type.
+ """
+
+ VPN_SERVER = 'vpn_server'
+
+
+
+class VPNServerAuthentication:
"""
- Zone.
+ An authentication method for this VPN server.
- :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.
+ :param str method: The type of authentication.
"""
def __init__(
self,
- href: str,
- name: str,
- region: 'RegionReference',
+ method: str,
+ ) -> None:
+ """
+ Initialize a VPNServerAuthentication object.
+
+ :param str method: The type of authentication.
+ """
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['VPNServerAuthenticationByUsername', 'VPNServerAuthenticationByCertificate'])
+ )
+ raise Exception(msg)
+
+ class MethodEnum(str, Enum):
+ """
+ The type of authentication.
+ """
+
+ CERTIFICATE = 'certificate'
+ USERNAME = 'username'
+
+
+
+class VPNServerAuthenticationByUsernameIdProvider:
+ """
+ The type of identity provider to be used by VPN client.
+
+ """
+
+ def __init__(
+ self,
+ ) -> None:
+ """
+ Initialize a VPNServerAuthenticationByUsernameIdProvider object.
+
+ """
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['VPNServerAuthenticationByUsernameIdProviderByIAM'])
+ )
+ raise Exception(msg)
+
+
+class VPNServerAuthenticationPrototype:
+ """
+ An authentication method for this VPN server.
+
+ :param str method: The type of authentication.
+ """
+
+ def __init__(
+ self,
+ method: str,
+ ) -> None:
+ """
+ Initialize a VPNServerAuthenticationPrototype object.
+
+ :param str method: The type of authentication.
+ """
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype', 'VPNServerAuthenticationPrototypeVPNServerAuthenticationByCertificatePrototype'])
+ )
+ raise Exception(msg)
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'VPNServerAuthenticationPrototype':
+ """Initialize a VPNServerAuthenticationPrototype object from a json dictionary."""
+ disc_class = cls._get_class_by_discriminator(_dict)
+ if disc_class != cls:
+ return disc_class.from_dict(_dict)
+ msg = "Cannot convert dictionary into an instance of base class 'VPNServerAuthenticationPrototype'. The discriminator value should map to a valid subclass: {1}".format(
+ ", ".join(['VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype', 'VPNServerAuthenticationPrototypeVPNServerAuthenticationByCertificatePrototype'])
+ )
+ raise Exception(msg)
+
+ @classmethod
+ def _from_dict(cls, _dict: Dict):
+ """Initialize a VPNServerAuthenticationPrototype object from a json dictionary."""
+ return cls.from_dict(_dict)
+
+ @classmethod
+ def _get_class_by_discriminator(cls, _dict: Dict) -> object:
+ mapping = {}
+ mapping['certificate'] = 'VPNServerAuthenticationPrototypeVPNServerAuthenticationByCertificatePrototype'
+ mapping['username'] = 'VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype'
+ disc_value = _dict.get('method')
+ if disc_value is None:
+ raise ValueError('Discriminator property \'method\' not found in VPNServerAuthenticationPrototype JSON')
+ class_name = mapping.get(disc_value, disc_value)
+ try:
+ disc_class = getattr(sys.modules[__name__], class_name)
+ except AttributeError:
+ disc_class = cls
+ if isinstance(disc_class, object):
+ return disc_class
+ raise TypeError('%s is not a discriminator class' % class_name)
+
+ class MethodEnum(str, Enum):
+ """
+ The type of authentication.
+ """
+
+ CERTIFICATE = 'certificate'
+ USERNAME = 'username'
+
+
+
+class VPNServerClient:
+ """
+ VPNServerClient.
+
+ :param IP client_ip: The IP address assigned to this VPN client from
+ `client_ip_pool`.
+ :param str common_name: (optional) The common name of client certificate that
+ the VPN client provided when connecting to the server.
+ This property will be present only when the `certificate` client authentication
+ method is enabled on the VPN server.
+ :param datetime created_at: The date and time that the VPN client was created.
+ :param datetime disconnected_at: (optional) The date and time that the VPN
+ client was disconnected.
+ This property will be present only when the client `status` is `disconnected`.
+ :param str href: The URL for this VPN client.
+ :param str id: The unique identifier for this VPN client.
+ :param IP remote_ip: The remote IP address of this VPN client.
+ :param int remote_port: The remote port of this VPN client.
+ :param str resource_type: The resource type.
+ :param str status: The status of the VPN client:
+ - `connected`: the VPN client is `connected` to this VPN server.
+ - `disconnected`: the VPN client is `disconnected` from this VPN server.
+ The enumerated values for this property are expected to expand in the future.
+ When processing this property, check for and log unknown values. Optionally halt
+ processing and surface the error, or bypass the VPN client on which the
+ unexpected property value was encountered.
+ :param str username: (optional) The username that this VPN client provided when
+ connecting to the VPN server.
+ This property will be present only when the `username` client authentication
+ method is enabled on the VPN server.
+ """
+
+ def __init__(
+ self,
+ client_ip: 'IP',
+ created_at: datetime,
+ href: str,
+ id: str,
+ remote_ip: 'IP',
+ remote_port: int,
+ resource_type: str,
status: str,
+ *,
+ common_name: Optional[str] = None,
+ disconnected_at: Optional[datetime] = None,
+ username: Optional[str] = None,
) -> None:
"""
- Initialize a Zone object.
+ Initialize a VPNServerClient 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 IP client_ip: The IP address assigned to this VPN client from
+ `client_ip_pool`.
+ :param datetime created_at: The date and time that the VPN client was
+ created.
+ :param str href: The URL for this VPN client.
+ :param str id: The unique identifier for this VPN client.
+ :param IP remote_ip: The remote IP address of this VPN client.
+ :param int remote_port: The remote port of this VPN client.
+ :param str resource_type: The resource type.
+ :param str status: The status of the VPN client:
+ - `connected`: the VPN client is `connected` to this VPN server.
+ - `disconnected`: the VPN client is `disconnected` from this VPN server.
+ The enumerated values for this property are expected to expand in the
+ future. When processing this property, check for and log unknown values.
+ Optionally halt processing and surface the error, or bypass the VPN client
+ on which the unexpected property value was encountered.
+ :param str common_name: (optional) The common name of client certificate
+ that the VPN client provided when connecting to the server.
+ This property will be present only when the `certificate` client
+ authentication method is enabled on the VPN server.
+ :param datetime disconnected_at: (optional) The date and time that the VPN
+ client was disconnected.
+ This property will be present only when the client `status` is
+ `disconnected`.
+ :param str username: (optional) The username that this VPN client provided
+ when connecting to the VPN server.
+ This property will be present only when the `username` client
+ authentication method is enabled on the VPN server.
"""
+ self.client_ip = client_ip
+ self.common_name = common_name
+ self.created_at = created_at
+ self.disconnected_at = disconnected_at
self.href = href
- self.name = name
- self.region = region
+ self.id = id
+ self.remote_ip = remote_ip
+ self.remote_port = remote_port
+ self.resource_type = resource_type
self.status = status
+ self.username = username
@classmethod
- def from_dict(cls, _dict: Dict) -> 'Zone':
- """Initialize a Zone object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VPNServerClient':
+ """Initialize a VPNServerClient object from a json dictionary."""
args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ if (client_ip := _dict.get('client_ip')) is not None:
+ args['client_ip'] = IP.from_dict(client_ip)
else:
- raise ValueError('Required property \'href\' not present in Zone JSON')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
+ raise ValueError('Required property \'client_ip\' not present in VPNServerClient JSON')
+ if (common_name := _dict.get('common_name')) is not None:
+ args['common_name'] = common_name
+ if (created_at := _dict.get('created_at')) is not None:
+ args['created_at'] = string_to_datetime(created_at)
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 \'created_at\' not present in VPNServerClient JSON')
+ if (disconnected_at := _dict.get('disconnected_at')) is not None:
+ args['disconnected_at'] = string_to_datetime(disconnected_at)
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'region\' not present in Zone JSON')
- if 'status' in _dict:
- args['status'] = _dict.get('status')
+ raise ValueError('Required property \'href\' not present in VPNServerClient JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
else:
- raise ValueError('Required property \'status\' not present in Zone JSON')
+ raise ValueError('Required property \'id\' not present in VPNServerClient JSON')
+ if (remote_ip := _dict.get('remote_ip')) is not None:
+ args['remote_ip'] = IP.from_dict(remote_ip)
+ else:
+ raise ValueError('Required property \'remote_ip\' not present in VPNServerClient JSON')
+ if (remote_port := _dict.get('remote_port')) is not None:
+ args['remote_port'] = remote_port
+ else:
+ raise ValueError('Required property \'remote_port\' not present in VPNServerClient JSON')
+ if (resource_type := _dict.get('resource_type')) is not None:
+ args['resource_type'] = resource_type
+ else:
+ raise ValueError('Required property \'resource_type\' not present in VPNServerClient JSON')
+ if (status := _dict.get('status')) is not None:
+ args['status'] = status
+ else:
+ raise ValueError('Required property \'status\' not present in VPNServerClient JSON')
+ if (username := _dict.get('username')) is not None:
+ args['username'] = username
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a Zone object from a json dictionary."""
+ """Initialize a VPNServerClient object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
+ if hasattr(self, 'client_ip') and self.client_ip is not None:
+ if isinstance(self.client_ip, dict):
+ _dict['client_ip'] = self.client_ip
+ else:
+ _dict['client_ip'] = self.client_ip.to_dict()
+ if hasattr(self, 'common_name') and self.common_name is not None:
+ _dict['common_name'] = self.common_name
+ if hasattr(self, 'created_at') and self.created_at is not None:
+ _dict['created_at'] = datetime_to_string(self.created_at)
+ if hasattr(self, 'disconnected_at') and self.disconnected_at is not None:
+ _dict['disconnected_at'] = datetime_to_string(self.disconnected_at)
if hasattr(self, 'href') and self.href is not None:
_dict['href'] = self.href
- if hasattr(self, 'name') and self.name is not None:
- _dict['name'] = self.name
- if hasattr(self, 'region') and self.region is not None:
- if isinstance(self.region, dict):
- _dict['region'] = self.region
+ if hasattr(self, 'id') and self.id is not None:
+ _dict['id'] = self.id
+ if hasattr(self, 'remote_ip') and self.remote_ip is not None:
+ if isinstance(self.remote_ip, dict):
+ _dict['remote_ip'] = self.remote_ip
else:
- _dict['region'] = self.region.to_dict()
+ _dict['remote_ip'] = self.remote_ip.to_dict()
+ if hasattr(self, 'remote_port') and self.remote_port is not None:
+ _dict['remote_port'] = self.remote_port
+ if hasattr(self, 'resource_type') and self.resource_type is not None:
+ _dict['resource_type'] = self.resource_type
if hasattr(self, 'status') and self.status is not None:
_dict['status'] = self.status
+ if hasattr(self, 'username') and self.username is not None:
+ _dict['username'] = self.username
return _dict
def _to_dict(self):
@@ -86697,74 +89694,140 @@ 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 VPNServerClient object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'Zone') -> bool:
+ def __eq__(self, other: 'VPNServerClient') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'Zone') -> bool:
+ def __ne__(self, other: 'VPNServerClient') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
+ class ResourceTypeEnum(str, Enum):
+ """
+ The resource type.
+ """
+
+ VPN_SERVER_CLIENT = 'vpn_server_client'
+
+
class StatusEnum(str, Enum):
"""
- The availability status of this zone.
+ The status of the VPN client:
+ - `connected`: the VPN client is `connected` to this VPN server.
+ - `disconnected`: the VPN client is `disconnected` from this VPN server.
+ The enumerated values for this property are expected to expand in the future. When
+ processing this property, check for and log unknown values. Optionally halt
+ processing and surface the error, or bypass the VPN client on which the unexpected
+ property value was encountered.
"""
- AVAILABLE = 'available'
- IMPAIRED = 'impaired'
- UNAVAILABLE = 'unavailable'
+ CONNECTED = 'connected'
+ DISCONNECTED = 'disconnected'
-class ZoneCollection:
+class VPNServerClientCollection:
"""
- ZoneCollection.
+ VPNServerClientCollection.
- :attr List[Zone] zones: Collection of zones.
+ :param List[VPNServerClient] clients: Collection of VPN clients.
+ :param VPNServerClientCollectionFirst first: A link to the first page of
+ resources.
+ :param int limit: The maximum number of resources that can be returned by the
+ request.
+ :param VPNServerClientCollectionNext next: (optional) A link to the next page of
+ resources. This property is present for all pages
+ except the last page.
+ :param int total_count: The total number of resources across all pages.
"""
def __init__(
self,
- zones: List['Zone'],
+ clients: List['VPNServerClient'],
+ first: 'VPNServerClientCollectionFirst',
+ limit: int,
+ total_count: int,
+ *,
+ next: Optional['VPNServerClientCollectionNext'] = None,
) -> None:
"""
- Initialize a ZoneCollection object.
+ Initialize a VPNServerClientCollection object.
- :param List[Zone] zones: Collection of zones.
+ :param List[VPNServerClient] clients: Collection of VPN clients.
+ :param VPNServerClientCollectionFirst first: A link to the first page of
+ resources.
+ :param int limit: The maximum number of resources that can be returned by
+ the request.
+ :param int total_count: The total number of resources across all pages.
+ :param VPNServerClientCollectionNext next: (optional) A link to the next
+ page of resources. This property is present for all pages
+ except the last page.
"""
- self.zones = zones
+ self.clients = clients
+ self.first = first
+ self.limit = limit
+ self.next = next
+ self.total_count = total_count
@classmethod
- def from_dict(cls, _dict: Dict) -> 'ZoneCollection':
- """Initialize a ZoneCollection object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VPNServerClientCollection':
+ """Initialize a VPNServerClientCollection object from a json dictionary."""
args = {}
- if 'zones' in _dict:
- args['zones'] = [Zone.from_dict(v) for v in _dict.get('zones')]
+ if (clients := _dict.get('clients')) is not None:
+ args['clients'] = [VPNServerClient.from_dict(v) for v in clients]
else:
- raise ValueError('Required property \'zones\' not present in ZoneCollection JSON')
+ raise ValueError('Required property \'clients\' not present in VPNServerClientCollection JSON')
+ if (first := _dict.get('first')) is not None:
+ args['first'] = VPNServerClientCollectionFirst.from_dict(first)
+ else:
+ raise ValueError('Required property \'first\' not present in VPNServerClientCollection JSON')
+ if (limit := _dict.get('limit')) is not None:
+ args['limit'] = limit
+ else:
+ raise ValueError('Required property \'limit\' not present in VPNServerClientCollection JSON')
+ if (next := _dict.get('next')) is not None:
+ args['next'] = VPNServerClientCollectionNext.from_dict(next)
+ if (total_count := _dict.get('total_count')) is not None:
+ args['total_count'] = total_count
+ else:
+ raise ValueError('Required property \'total_count\' not present in VPNServerClientCollection JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a ZoneCollection object from a json dictionary."""
+ """Initialize a VPNServerClientCollection object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'zones') and self.zones is not None:
- zones_list = []
- for v in self.zones:
+ if hasattr(self, 'clients') and self.clients is not None:
+ clients_list = []
+ for v in self.clients:
if isinstance(v, dict):
- zones_list.append(v)
+ clients_list.append(v)
else:
- zones_list.append(v.to_dict())
- _dict['zones'] = zones_list
+ clients_list.append(v.to_dict())
+ _dict['clients'] = clients_list
+ if hasattr(self, 'first') and self.first is not None:
+ if isinstance(self.first, dict):
+ _dict['first'] = self.first
+ else:
+ _dict['first'] = self.first.to_dict()
+ if hasattr(self, 'limit') and self.limit is not None:
+ _dict['limit'] = self.limit
+ if hasattr(self, 'next') and self.next is not None:
+ if isinstance(self.next, dict):
+ _dict['next'] = self.next
+ else:
+ _dict['next'] = self.next.to_dict()
+ if hasattr(self, 'total_count') and self.total_count is not None:
+ _dict['total_count'] = self.total_count
return _dict
def _to_dict(self):
@@ -86772,78 +89835,51 @@ 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 VPNServerClientCollection object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'ZoneCollection') -> bool:
+ def __eq__(self, other: 'VPNServerClientCollection') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'ZoneCollection') -> bool:
+ def __ne__(self, other: 'VPNServerClientCollection') -> 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:
- """
- 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:
+class VPNServerClientCollectionFirst:
"""
- ZoneReference.
+ A link to the first page of resources.
- :attr str href: The URL for this zone.
- :attr str name: The globally unique name for this zone.
+ :param str href: The URL for a page of resources.
"""
def __init__(
self,
href: str,
- name: str,
) -> None:
"""
- Initialize a ZoneReference object.
+ Initialize a VPNServerClientCollectionFirst object.
- :param str href: The URL for this zone.
- :param str name: The globally unique name for this zone.
+ :param str href: The URL for a page of resources.
"""
self.href = href
- self.name = name
@classmethod
- def from_dict(cls, _dict: Dict) -> 'ZoneReference':
- """Initialize a ZoneReference object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VPNServerClientCollectionFirst':
+ """Initialize a VPNServerClientCollectionFirst object from a json dictionary."""
args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
- else:
- raise ValueError('Required property \'href\' not present in ZoneReference JSON')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'name\' not present in ZoneReference JSON')
+ raise ValueError('Required property \'href\' not present in VPNServerClientCollectionFirst JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a ZoneReference object from a json dictionary."""
+ """Initialize a VPNServerClientCollectionFirst object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -86851,8 +89887,6 @@ def to_dict(self) -> Dict:
_dict = {}
if hasattr(self, 'href') and self.href is not None:
_dict['href'] = self.href
- if hasattr(self, 'name') and self.name is not None:
- _dict['name'] = self.name
return _dict
def _to_dict(self):
@@ -86860,132 +89894,59 @@ 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 VPNServerClientCollectionFirst object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'ZoneReference') -> bool:
+ def __eq__(self, other: 'VPNServerClientCollectionFirst') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'ZoneReference') -> bool:
+ def __ne__(self, other: 'VPNServerClientCollectionFirst') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class BackupPolicyJobSourceVolumeReference(BackupPolicyJobSource):
+class VPNServerClientCollectionNext:
"""
- BackupPolicyJobSourceVolumeReference.
+ 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 volume.
- :attr VolumeReferenceDeleted deleted: (optional) If present, this property
- indicates the referenced resource has been deleted, and provides
- some supplementary information.
- :attr str href: The URL for this volume.
- :attr str id: The unique identifier for this volume.
- :attr str name: The name for this volume. The name is unique across all volumes
- in the region.
- :attr VolumeRemote remote: (optional) If present, this property indicates that
- the resource associated with this reference
- is remote and therefore may not be directly retrievable.
- :attr str resource_type: The resource type.
+ :param str href: The URL for a page of resources.
"""
def __init__(
self,
- crn: str,
href: str,
- id: str,
- name: str,
- resource_type: str,
- *,
- deleted: 'VolumeReferenceDeleted' = None,
- remote: 'VolumeRemote' = None,
) -> None:
"""
- Initialize a BackupPolicyJobSourceVolumeReference object.
+ Initialize a VPNServerClientCollectionNext object.
- :param str crn: The CRN for this volume.
- :param str href: The URL for this volume.
- :param str id: The unique identifier for this volume.
- :param str name: The name for this volume. The name is unique across all
- volumes in the region.
- :param str resource_type: The resource type.
- :param VolumeReferenceDeleted deleted: (optional) If present, this property
- indicates the referenced resource has been deleted, and provides
- some supplementary information.
- :param VolumeRemote remote: (optional) If present, this property indicates
- that the resource associated with this reference
- is remote and therefore may not be directly retrievable.
+ :param str href: The URL for a page of resources.
"""
- # pylint: disable=super-init-not-called
- self.crn = crn
- self.deleted = deleted
self.href = href
- self.id = id
- self.name = name
- self.remote = remote
- self.resource_type = resource_type
@classmethod
- def from_dict(cls, _dict: Dict) -> 'BackupPolicyJobSourceVolumeReference':
- """Initialize a BackupPolicyJobSourceVolumeReference object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VPNServerClientCollectionNext':
+ """Initialize a VPNServerClientCollectionNext object from a json dictionary."""
args = {}
- if 'crn' in _dict:
- args['crn'] = _dict.get('crn')
- else:
- raise ValueError('Required property \'crn\' not present in BackupPolicyJobSourceVolumeReference JSON')
- if 'deleted' in _dict:
- args['deleted'] = VolumeReferenceDeleted.from_dict(_dict.get('deleted'))
- if 'href' in _dict:
- args['href'] = _dict.get('href')
- else:
- raise ValueError('Required property \'href\' not present in BackupPolicyJobSourceVolumeReference JSON')
- if 'id' in _dict:
- args['id'] = _dict.get('id')
- else:
- raise ValueError('Required property \'id\' not present in BackupPolicyJobSourceVolumeReference JSON')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
- else:
- raise ValueError('Required property \'name\' not present in BackupPolicyJobSourceVolumeReference JSON')
- if 'remote' in _dict:
- args['remote'] = VolumeRemote.from_dict(_dict.get('remote'))
- if 'resource_type' in _dict:
- args['resource_type'] = _dict.get('resource_type')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'resource_type\' not present in BackupPolicyJobSourceVolumeReference JSON')
+ raise ValueError('Required property \'href\' not present in VPNServerClientCollectionNext JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a BackupPolicyJobSourceVolumeReference object from a json dictionary."""
+ """Initialize a VPNServerClientCollectionNext object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'crn') and self.crn is not None:
- _dict['crn'] = self.crn
- if hasattr(self, 'deleted') and self.deleted is not None:
- if isinstance(self.deleted, dict):
- _dict['deleted'] = self.deleted
- else:
- _dict['deleted'] = self.deleted.to_dict()
if hasattr(self, 'href') and self.href is not None:
_dict['href'] = self.href
- if hasattr(self, 'id') and self.id is not None:
- _dict['id'] = self.id
- if hasattr(self, 'name') and self.name is not None:
- _dict['name'] = self.name
- if hasattr(self, 'remote') and self.remote is not None:
- if isinstance(self.remote, dict):
- _dict['remote'] = self.remote
- else:
- _dict['remote'] = self.remote.to_dict()
- if hasattr(self, 'resource_type') and self.resource_type is not None:
- _dict['resource_type'] = self.resource_type
return _dict
def _to_dict(self):
@@ -86993,97 +89954,116 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this BackupPolicyJobSourceVolumeReference object."""
+ """Return a `str` version of this VPNServerClientCollectionNext object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'BackupPolicyJobSourceVolumeReference') -> bool:
+ def __eq__(self, other: 'VPNServerClientCollectionNext') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'BackupPolicyJobSourceVolumeReference') -> bool:
+ def __ne__(self, other: 'VPNServerClientCollectionNext') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class ResourceTypeEnum(str, Enum):
- """
- The resource type.
- """
-
- VOLUME = 'volume'
-
-
-class BackupPolicyScopePrototypeEnterpriseIdentity(BackupPolicyScopePrototype):
+class VPNServerCollection:
"""
- Identifies an enterprise by a unique property.
+ VPNServerCollection.
+ :param VPNServerCollectionFirst first: A link to the first page of resources.
+ :param int limit: The maximum number of resources that can be returned by the
+ request.
+ :param VPNServerCollectionNext next: (optional) A link to the next page of
+ resources. This property is present for all pages
+ except the last page.
+ :param int total_count: The total number of resources across all pages.
+ :param List[VPNServer] vpn_servers: Collection of VPN servers.
"""
def __init__(
self,
+ first: 'VPNServerCollectionFirst',
+ limit: int,
+ total_count: int,
+ vpn_servers: List['VPNServer'],
+ *,
+ next: Optional['VPNServerCollectionNext'] = None,
) -> None:
"""
- Initialize a BackupPolicyScopePrototypeEnterpriseIdentity object.
+ Initialize a VPNServerCollection object.
+ :param VPNServerCollectionFirst first: A link to the first page of
+ resources.
+ :param int limit: The maximum number of resources that can be returned by
+ the request.
+ :param int total_count: The total number of resources across all pages.
+ :param List[VPNServer] vpn_servers: Collection of VPN servers.
+ :param VPNServerCollectionNext next: (optional) A link to the next page of
+ resources. This property is present for all pages
+ except the last page.
"""
- # pylint: disable=super-init-not-called
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['BackupPolicyScopePrototypeEnterpriseIdentityEnterpriseIdentityByCRN'])
- )
- raise Exception(msg)
-
-
-class BackupPolicyScopeAccountReference(BackupPolicyScope):
- """
- BackupPolicyScopeAccountReference.
-
- :attr str id: The unique identifier for this account.
- :attr str resource_type: The resource type.
- """
-
- def __init__(
- self,
- id: str,
- resource_type: str,
- ) -> None:
- """
- Initialize a BackupPolicyScopeAccountReference object.
-
- :param str id: The unique identifier for this account.
- :param str resource_type: The resource type.
- """
- # pylint: disable=super-init-not-called
- self.id = id
- self.resource_type = resource_type
+ self.first = first
+ self.limit = limit
+ self.next = next
+ self.total_count = total_count
+ self.vpn_servers = vpn_servers
@classmethod
- def from_dict(cls, _dict: Dict) -> 'BackupPolicyScopeAccountReference':
- """Initialize a BackupPolicyScopeAccountReference object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VPNServerCollection':
+ """Initialize a VPNServerCollection object from a json dictionary."""
args = {}
- if 'id' in _dict:
- args['id'] = _dict.get('id')
+ if (first := _dict.get('first')) is not None:
+ args['first'] = VPNServerCollectionFirst.from_dict(first)
else:
- raise ValueError('Required property \'id\' not present in BackupPolicyScopeAccountReference JSON')
- if 'resource_type' in _dict:
- args['resource_type'] = _dict.get('resource_type')
+ raise ValueError('Required property \'first\' not present in VPNServerCollection JSON')
+ if (limit := _dict.get('limit')) is not None:
+ args['limit'] = limit
else:
- raise ValueError('Required property \'resource_type\' not present in BackupPolicyScopeAccountReference JSON')
+ raise ValueError('Required property \'limit\' not present in VPNServerCollection JSON')
+ if (next := _dict.get('next')) is not None:
+ args['next'] = VPNServerCollectionNext.from_dict(next)
+ if (total_count := _dict.get('total_count')) is not None:
+ args['total_count'] = total_count
+ else:
+ raise ValueError('Required property \'total_count\' not present in VPNServerCollection JSON')
+ if (vpn_servers := _dict.get('vpn_servers')) is not None:
+ args['vpn_servers'] = [VPNServer.from_dict(v) for v in vpn_servers]
+ else:
+ raise ValueError('Required property \'vpn_servers\' not present in VPNServerCollection JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a BackupPolicyScopeAccountReference object from a json dictionary."""
+ """Initialize a VPNServerCollection object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'id') and self.id is not None:
- _dict['id'] = self.id
- if hasattr(self, 'resource_type') and self.resource_type is not None:
- _dict['resource_type'] = self.resource_type
+ if hasattr(self, 'first') and self.first is not None:
+ if isinstance(self.first, dict):
+ _dict['first'] = self.first
+ else:
+ _dict['first'] = self.first.to_dict()
+ if hasattr(self, 'limit') and self.limit is not None:
+ _dict['limit'] = self.limit
+ if hasattr(self, 'next') and self.next is not None:
+ if isinstance(self.next, dict):
+ _dict['next'] = self.next
+ else:
+ _dict['next'] = self.next.to_dict()
+ if hasattr(self, 'total_count') and self.total_count is not None:
+ _dict['total_count'] = self.total_count
+ if hasattr(self, 'vpn_servers') and self.vpn_servers is not None:
+ vpn_servers_list = []
+ for v in self.vpn_servers:
+ if isinstance(v, dict):
+ vpn_servers_list.append(v)
+ else:
+ vpn_servers_list.append(v.to_dict())
+ _dict['vpn_servers'] = vpn_servers_list
return _dict
def _to_dict(self):
@@ -87091,87 +90071,58 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this BackupPolicyScopeAccountReference object."""
+ """Return a `str` version of this VPNServerCollection object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'BackupPolicyScopeAccountReference') -> bool:
+ def __eq__(self, other: 'VPNServerCollection') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'BackupPolicyScopeAccountReference') -> bool:
+ def __ne__(self, other: 'VPNServerCollection') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class ResourceTypeEnum(str, Enum):
- """
- The resource type.
- """
-
- ACCOUNT = 'account'
-
-
-class BackupPolicyScopeEnterpriseReference(BackupPolicyScope):
+class VPNServerCollectionFirst:
"""
- BackupPolicyScopeEnterpriseReference.
+ A link to the first page of resources.
- :attr str crn: The CRN for this enterprise.
- :attr str id: The unique identifier for this enterprise.
- :attr str resource_type: The resource type.
+ :param str href: The URL for a page of resources.
"""
def __init__(
self,
- crn: str,
- id: str,
- resource_type: str,
+ href: str,
) -> None:
"""
- Initialize a BackupPolicyScopeEnterpriseReference object.
+ Initialize a VPNServerCollectionFirst object.
- :param str crn: The CRN for this enterprise.
- :param str id: The unique identifier for this enterprise.
- :param str resource_type: The resource type.
+ :param str href: The URL for a page of resources.
"""
- # pylint: disable=super-init-not-called
- self.crn = crn
- self.id = id
- self.resource_type = resource_type
+ self.href = href
@classmethod
- def from_dict(cls, _dict: Dict) -> 'BackupPolicyScopeEnterpriseReference':
- """Initialize a BackupPolicyScopeEnterpriseReference object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VPNServerCollectionFirst':
+ """Initialize a VPNServerCollectionFirst object from a json dictionary."""
args = {}
- if 'crn' in _dict:
- args['crn'] = _dict.get('crn')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'crn\' not present in BackupPolicyScopeEnterpriseReference JSON')
- if 'id' in _dict:
- args['id'] = _dict.get('id')
- else:
- raise ValueError('Required property \'id\' not present in BackupPolicyScopeEnterpriseReference JSON')
- if 'resource_type' in _dict:
- args['resource_type'] = _dict.get('resource_type')
- else:
- raise ValueError('Required property \'resource_type\' not present in BackupPolicyScopeEnterpriseReference JSON')
+ raise ValueError('Required property \'href\' not present in VPNServerCollectionFirst JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a BackupPolicyScopeEnterpriseReference object from a json dictionary."""
+ """Initialize a VPNServerCollectionFirst object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'crn') and self.crn is not None:
- _dict['crn'] = self.crn
- if hasattr(self, 'id') and self.id is not None:
- _dict['id'] = self.id
- if hasattr(self, 'resource_type') and self.resource_type is not None:
- _dict['resource_type'] = self.resource_type
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
return _dict
def _to_dict(self):
@@ -87179,116 +90130,59 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this BackupPolicyScopeEnterpriseReference object."""
+ """Return a `str` version of this VPNServerCollectionFirst object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'BackupPolicyScopeEnterpriseReference') -> bool:
+ def __eq__(self, other: 'VPNServerCollectionFirst') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'BackupPolicyScopeEnterpriseReference') -> bool:
+ def __ne__(self, other: 'VPNServerCollectionFirst') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class ResourceTypeEnum(str, Enum):
- """
- The resource type.
- """
-
- ENTERPRISE = 'enterprise'
-
-
-class BareMetalServerBootTargetBareMetalServerDiskReference(BareMetalServerBootTarget):
+class VPNServerCollectionNext:
"""
- BareMetalServerBootTargetBareMetalServerDiskReference.
+ A link to the next page of resources. This property is present for all pages except
+ the last page.
- :attr BareMetalServerDiskReferenceDeleted deleted: (optional) If present, this
- property indicates the referenced resource has been deleted, and provides
- some supplementary information.
- :attr str href: The URL for this bare metal server disk.
- :attr str id: The unique identifier for this bare metal server disk.
- :attr str name: The name for this bare metal server disk. The name is unique
- across all disks on the bare metal server.
- :attr str resource_type: The resource type.
+ :param str href: The URL for a page of resources.
"""
def __init__(
self,
href: str,
- id: str,
- name: str,
- resource_type: str,
- *,
- deleted: 'BareMetalServerDiskReferenceDeleted' = None,
) -> None:
"""
- Initialize a BareMetalServerBootTargetBareMetalServerDiskReference object.
+ Initialize a VPNServerCollectionNext object.
- :param str href: The URL for this bare metal server disk.
- :param str id: The unique identifier for this bare metal server disk.
- :param str name: The name for this bare metal server disk. The name is
- unique across all disks on the bare metal server.
- :param str resource_type: The resource type.
- :param BareMetalServerDiskReferenceDeleted deleted: (optional) If present,
- this property indicates the referenced resource has been deleted, and
- provides
- some supplementary information.
+ :param str href: The URL for a page of resources.
"""
- # 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) -> 'BareMetalServerBootTargetBareMetalServerDiskReference':
- """Initialize a BareMetalServerBootTargetBareMetalServerDiskReference object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VPNServerCollectionNext':
+ """Initialize a VPNServerCollectionNext object from a json dictionary."""
args = {}
- if 'deleted' in _dict:
- args['deleted'] = BareMetalServerDiskReferenceDeleted.from_dict(_dict.get('deleted'))
- if 'href' in _dict:
- args['href'] = _dict.get('href')
- else:
- raise ValueError('Required property \'href\' not present in BareMetalServerBootTargetBareMetalServerDiskReference JSON')
- if 'id' in _dict:
- args['id'] = _dict.get('id')
- else:
- raise ValueError('Required property \'id\' not present in BareMetalServerBootTargetBareMetalServerDiskReference JSON')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
- else:
- raise ValueError('Required property \'name\' not present in BareMetalServerBootTargetBareMetalServerDiskReference JSON')
- if 'resource_type' in _dict:
- args['resource_type'] = _dict.get('resource_type')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'resource_type\' not present in BareMetalServerBootTargetBareMetalServerDiskReference JSON')
+ raise ValueError('Required property \'href\' not present in VPNServerCollectionNext JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a BareMetalServerBootTargetBareMetalServerDiskReference object from a json dictionary."""
+ """Initialize a VPNServerCollectionNext object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'deleted') and self.deleted is not None:
- if isinstance(self.deleted, dict):
- _dict['deleted'] = self.deleted
- else:
- _dict['deleted'] = self.deleted.to_dict()
if hasattr(self, 'href') and self.href is not None:
_dict['href'] = self.href
- if hasattr(self, 'id') and self.id is not None:
- _dict['id'] = self.id
- if hasattr(self, 'name') and self.name is not None:
- _dict['name'] = self.name
- if hasattr(self, 'resource_type') and self.resource_type is not None:
- _dict['resource_type'] = self.resource_type
return _dict
def _to_dict(self):
@@ -87296,105 +90190,81 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this BareMetalServerBootTargetBareMetalServerDiskReference object."""
+ """Return a `str` version of this VPNServerCollectionNext object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'BareMetalServerBootTargetBareMetalServerDiskReference') -> bool:
+ def __eq__(self, other: 'VPNServerCollectionNext') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'BareMetalServerBootTargetBareMetalServerDiskReference') -> bool:
+ def __ne__(self, other: 'VPNServerCollectionNext') -> 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_DISK = 'bare_metal_server_disk'
-
-
-class BareMetalServerInitializationUserAccountBareMetalServerInitializationHostUserAccount(BareMetalServerInitializationUserAccount):
+class VPNServerHealthReason:
"""
- BareMetalServerInitializationUserAccountBareMetalServerInitializationHostUserAccount.
+ VPNServerHealthReason.
- :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.
+ :param str code: A snake case string succinctly identifying the reason for this
+ health state.
+ :param str message: An explanation of the reason for this health state.
+ :param str more_info: (optional) Link to documentation about the reason for this
+ health state.
"""
def __init__(
self,
- encrypted_password: bytes,
- encryption_key: 'KeyReference',
- resource_type: str,
- username: str,
+ code: str,
+ message: str,
+ *,
+ more_info: Optional[str] = None,
) -> None:
"""
- Initialize a BareMetalServerInitializationUserAccountBareMetalServerInitializationHostUserAccount object.
+ Initialize a VPNServerHealthReason object.
- :param bytes encrypted_password: The password at initialization, encrypted
- using `encryption_key`, and returned base64-encoded.
- :param KeyReference encryption_key: The public SSH key used to encrypt the
- password.
- :param str resource_type: The resource type.
- :param str username: The username for the account created at
- initialization.
+ :param str code: A snake case string succinctly identifying the reason for
+ this health state.
+ :param str message: An explanation of the reason for this health state.
+ :param str more_info: (optional) Link to documentation about the reason for
+ this health state.
"""
- # pylint: disable=super-init-not-called
- self.encrypted_password = encrypted_password
- self.encryption_key = encryption_key
- self.resource_type = resource_type
- self.username = username
+ self.code = code
+ self.message = message
+ self.more_info = more_info
@classmethod
- def from_dict(cls, _dict: Dict) -> 'BareMetalServerInitializationUserAccountBareMetalServerInitializationHostUserAccount':
- """Initialize a BareMetalServerInitializationUserAccountBareMetalServerInitializationHostUserAccount object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VPNServerHealthReason':
+ """Initialize a VPNServerHealthReason 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 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')
+ if (code := _dict.get('code')) is not None:
+ args['code'] = code
else:
- raise ValueError('Required property \'resource_type\' not present in BareMetalServerInitializationUserAccountBareMetalServerInitializationHostUserAccount JSON')
- if 'username' in _dict:
- args['username'] = _dict.get('username')
+ raise ValueError('Required property \'code\' not present in VPNServerHealthReason JSON')
+ if (message := _dict.get('message')) is not None:
+ args['message'] = message
else:
- raise ValueError('Required property \'username\' not present in BareMetalServerInitializationUserAccountBareMetalServerInitializationHostUserAccount JSON')
+ raise ValueError('Required property \'message\' not present in VPNServerHealthReason JSON')
+ if (more_info := _dict.get('more_info')) is not None:
+ args['more_info'] = more_info
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a BareMetalServerInitializationUserAccountBareMetalServerInitializationHostUserAccount object from a json dictionary."""
+ """Initialize a VPNServerHealthReason object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'encrypted_password') and self.encrypted_password is not None:
- _dict['encrypted_password'] = str(base64.b64encode(self.encrypted_password), 'utf-8')
- if hasattr(self, 'encryption_key') and self.encryption_key is not None:
- if isinstance(self.encryption_key, dict):
- _dict['encryption_key'] = self.encryption_key
- else:
- _dict['encryption_key'] = self.encryption_key.to_dict()
- if hasattr(self, 'resource_type') and self.resource_type is not None:
- _dict['resource_type'] = self.resource_type
- if hasattr(self, 'username') and self.username is not None:
- _dict['username'] = self.username
+ if hasattr(self, '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):
@@ -87402,270 +90272,93 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this BareMetalServerInitializationUserAccountBareMetalServerInitializationHostUserAccount object."""
+ """Return a `str` version of this VPNServerHealthReason object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'BareMetalServerInitializationUserAccountBareMetalServerInitializationHostUserAccount') -> bool:
+ def __eq__(self, other: 'VPNServerHealthReason') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'BareMetalServerInitializationUserAccountBareMetalServerInitializationHostUserAccount') -> bool:
+ def __ne__(self, other: 'VPNServerHealthReason') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class ResourceTypeEnum(str, Enum):
+ class CodeEnum(str, Enum):
"""
- The resource type.
+ A snake case string succinctly identifying the reason for this health state.
"""
- HOST_USER_ACCOUNT = 'host_user_account'
+ CANNOT_ACCESS_CLIENT_CERTIFICATE = 'cannot_access_client_certificate'
+ CANNOT_ACCESS_SERVER_CERTIFICATE = 'cannot_access_server_certificate'
+ CANNOT_CREATE_VPC_ROUTE = 'cannot_create_vpc_route'
+ CANNOT_RESERVE_IP_ADDRESS = 'cannot_reserve_ip_address'
+ INTERNAL_ERROR = 'internal_error'
-class BareMetalServerNetworkInterfaceByHiperSocket(BareMetalServerNetworkInterface):
+class VPNServerLifecycleReason:
"""
- BareMetalServerNetworkInterfaceByHiperSocket.
+ VPNServerLifecycleReason.
- :attr bool allow_ip_spoofing: Indicates whether source IP spoofing is allowed on
- this bare metal server network interface.
- :attr datetime created_at: The date and time that the bare metal server network
- interface was created.
- :attr bool enable_infrastructure_nat: If `true`:
- - The VPC infrastructure performs any needed NAT operations.
- - `floating_ips` must not have more than one floating IP.
- If `false`:
- - Packets are passed unchanged to/from the bare metal server network interface,
- allowing the workload to perform any needed NAT operations.
- - `allow_ip_spoofing` must be `false`.
- - `interface_type` must not be `hipersocket`.
- :attr List[FloatingIPReference] floating_ips: The floating IPs associated with
- this bare metal server network interface.
- :attr str href: The URL for this bare metal server network interface.
- :attr str id: The unique identifier for this bare metal server network
- interface.
- :attr str mac_address: The MAC address of this bare metal server network
- interface. If the MAC address has not yet been selected, the value will be an
- empty string.
- :attr str name: The name for this bare metal server network interface.
- :attr int port_speed: The bare metal server network interface port speed in
- Mbps.
- :attr ReservedIPReference primary_ip:
- :attr str resource_type: The resource type.
- :attr List[SecurityGroupReference] security_groups: The security groups
- targeting this bare metal server network interface.
- :attr str status: The status of the bare metal server network interface.
- :attr SubnetReference subnet: The associated subnet.
- :attr str type: The bare metal server network interface type.
- :attr str interface_type: - `hipersocket`: a virtual network device that
- provides high-speed TCP/IP connectivity
- within a `s390x` based system.
+ :param str code: A snake case string succinctly identifying the reason for this
+ lifecycle state.
+ :param str message: An explanation of the reason for this lifecycle state.
+ :param str more_info: (optional) Link to documentation about the reason for this
+ lifecycle state.
"""
def __init__(
self,
- allow_ip_spoofing: bool,
- created_at: datetime,
- enable_infrastructure_nat: bool,
- floating_ips: List['FloatingIPReference'],
- href: str,
- id: str,
- mac_address: str,
- name: str,
- port_speed: int,
- primary_ip: 'ReservedIPReference',
- resource_type: str,
- security_groups: List['SecurityGroupReference'],
- status: str,
- subnet: 'SubnetReference',
- type: str,
- interface_type: str,
+ code: str,
+ message: str,
+ *,
+ more_info: Optional[str] = None,
) -> None:
"""
- Initialize a BareMetalServerNetworkInterfaceByHiperSocket object.
+ Initialize a VPNServerLifecycleReason object.
- :param bool allow_ip_spoofing: Indicates whether source IP spoofing is
- allowed on this bare metal server network interface.
- :param datetime created_at: The date and time that the bare metal server
- network interface was created.
- :param bool enable_infrastructure_nat: If `true`:
- - The VPC infrastructure performs any needed NAT operations.
- - `floating_ips` must not have more than one floating IP.
- If `false`:
- - Packets are passed unchanged to/from the bare metal server network
- interface,
- allowing the workload to perform any needed NAT operations.
- - `allow_ip_spoofing` must be `false`.
- - `interface_type` must not be `hipersocket`.
- :param List[FloatingIPReference] floating_ips: The floating IPs associated
- with this bare metal server network interface.
- :param str href: The URL for this bare metal server network interface.
- :param str id: The unique identifier for this bare metal server network
- interface.
- :param str mac_address: The MAC address of this bare metal server network
- interface. If the MAC address has not yet been selected, the value will be
- an empty string.
- :param str name: The name for this bare metal server network interface.
- :param int port_speed: The bare metal server network interface port speed
- in Mbps.
- :param ReservedIPReference primary_ip:
- :param str resource_type: The resource type.
- :param List[SecurityGroupReference] security_groups: The security groups
- targeting this bare metal server network interface.
- :param str status: The status of the bare metal server network interface.
- :param SubnetReference subnet: The associated subnet.
- :param str type: The bare metal server network interface type.
- :param str interface_type: - `hipersocket`: a virtual network device that
- provides high-speed TCP/IP connectivity
- within a `s390x` based system.
+ :param str code: A snake case string succinctly identifying the reason for
+ this lifecycle state.
+ :param str message: An explanation of the reason for this lifecycle state.
+ :param str more_info: (optional) Link to documentation about the reason for
+ this lifecycle state.
"""
- # pylint: disable=super-init-not-called
- self.allow_ip_spoofing = allow_ip_spoofing
- self.created_at = created_at
- self.enable_infrastructure_nat = enable_infrastructure_nat
- self.floating_ips = floating_ips
- self.href = href
- self.id = id
- self.mac_address = mac_address
- self.name = name
- self.port_speed = port_speed
- self.primary_ip = primary_ip
- self.resource_type = resource_type
- self.security_groups = security_groups
- self.status = status
- self.subnet = subnet
- self.type = type
- self.interface_type = interface_type
+ self.code = code
+ self.message = message
+ self.more_info = more_info
@classmethod
- def from_dict(cls, _dict: Dict) -> 'BareMetalServerNetworkInterfaceByHiperSocket':
- """Initialize a BareMetalServerNetworkInterfaceByHiperSocket object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VPNServerLifecycleReason':
+ """Initialize a VPNServerLifecycleReason object from a json dictionary."""
args = {}
- if 'allow_ip_spoofing' in _dict:
- args['allow_ip_spoofing'] = _dict.get('allow_ip_spoofing')
- else:
- raise ValueError('Required property \'allow_ip_spoofing\' not present in BareMetalServerNetworkInterfaceByHiperSocket JSON')
- if 'created_at' in _dict:
- args['created_at'] = string_to_datetime(_dict.get('created_at'))
- else:
- raise ValueError('Required property \'created_at\' not present in BareMetalServerNetworkInterfaceByHiperSocket JSON')
- if 'enable_infrastructure_nat' in _dict:
- args['enable_infrastructure_nat'] = _dict.get('enable_infrastructure_nat')
- else:
- raise ValueError('Required property \'enable_infrastructure_nat\' not present in BareMetalServerNetworkInterfaceByHiperSocket JSON')
- if 'floating_ips' in _dict:
- args['floating_ips'] = [FloatingIPReference.from_dict(v) for v in _dict.get('floating_ips')]
- else:
- raise ValueError('Required property \'floating_ips\' not present in BareMetalServerNetworkInterfaceByHiperSocket JSON')
- if 'href' in _dict:
- args['href'] = _dict.get('href')
- else:
- raise ValueError('Required property \'href\' not present in BareMetalServerNetworkInterfaceByHiperSocket JSON')
- if 'id' in _dict:
- args['id'] = _dict.get('id')
- else:
- raise ValueError('Required property \'id\' not present in BareMetalServerNetworkInterfaceByHiperSocket JSON')
- if 'mac_address' in _dict:
- args['mac_address'] = _dict.get('mac_address')
- else:
- raise ValueError('Required property \'mac_address\' not present in BareMetalServerNetworkInterfaceByHiperSocket JSON')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
- else:
- raise ValueError('Required property \'name\' not present in BareMetalServerNetworkInterfaceByHiperSocket JSON')
- if 'port_speed' in _dict:
- args['port_speed'] = _dict.get('port_speed')
- else:
- raise ValueError('Required property \'port_speed\' not present in BareMetalServerNetworkInterfaceByHiperSocket JSON')
- if 'primary_ip' in _dict:
- args['primary_ip'] = ReservedIPReference.from_dict(_dict.get('primary_ip'))
- else:
- raise ValueError('Required property \'primary_ip\' not present in BareMetalServerNetworkInterfaceByHiperSocket JSON')
- if 'resource_type' in _dict:
- args['resource_type'] = _dict.get('resource_type')
- else:
- raise ValueError('Required property \'resource_type\' not present in BareMetalServerNetworkInterfaceByHiperSocket JSON')
- if 'security_groups' in _dict:
- args['security_groups'] = [SecurityGroupReference.from_dict(v) for v in _dict.get('security_groups')]
- else:
- raise ValueError('Required property \'security_groups\' not present in BareMetalServerNetworkInterfaceByHiperSocket JSON')
- if 'status' in _dict:
- args['status'] = _dict.get('status')
- else:
- raise ValueError('Required property \'status\' not present in BareMetalServerNetworkInterfaceByHiperSocket JSON')
- if 'subnet' in _dict:
- args['subnet'] = SubnetReference.from_dict(_dict.get('subnet'))
- else:
- raise ValueError('Required property \'subnet\' not present in BareMetalServerNetworkInterfaceByHiperSocket JSON')
- if 'type' in _dict:
- args['type'] = _dict.get('type')
+ if (code := _dict.get('code')) is not None:
+ args['code'] = code
else:
- raise ValueError('Required property \'type\' not present in BareMetalServerNetworkInterfaceByHiperSocket JSON')
- if 'interface_type' in _dict:
- args['interface_type'] = _dict.get('interface_type')
+ raise ValueError('Required property \'code\' not present in VPNServerLifecycleReason JSON')
+ if (message := _dict.get('message')) is not None:
+ args['message'] = message
else:
- raise ValueError('Required property \'interface_type\' not present in BareMetalServerNetworkInterfaceByHiperSocket JSON')
+ raise ValueError('Required property \'message\' not present in VPNServerLifecycleReason JSON')
+ if (more_info := _dict.get('more_info')) is not None:
+ args['more_info'] = more_info
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a BareMetalServerNetworkInterfaceByHiperSocket object from a json dictionary."""
+ """Initialize a VPNServerLifecycleReason object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'allow_ip_spoofing') and self.allow_ip_spoofing is not None:
- _dict['allow_ip_spoofing'] = self.allow_ip_spoofing
- if hasattr(self, 'created_at') and self.created_at is not None:
- _dict['created_at'] = datetime_to_string(self.created_at)
- if hasattr(self, 'enable_infrastructure_nat') and self.enable_infrastructure_nat is not None:
- _dict['enable_infrastructure_nat'] = self.enable_infrastructure_nat
- if hasattr(self, 'floating_ips') and self.floating_ips is not None:
- floating_ips_list = []
- for v in self.floating_ips:
- if isinstance(v, dict):
- floating_ips_list.append(v)
- else:
- floating_ips_list.append(v.to_dict())
- _dict['floating_ips'] = floating_ips_list
- if hasattr(self, 'href') and self.href is not None:
- _dict['href'] = self.href
- if hasattr(self, 'id') and self.id is not None:
- _dict['id'] = self.id
- if hasattr(self, 'mac_address') and self.mac_address is not None:
- _dict['mac_address'] = self.mac_address
- if hasattr(self, 'name') and self.name is not None:
- _dict['name'] = self.name
- if hasattr(self, 'port_speed') and self.port_speed is not None:
- _dict['port_speed'] = self.port_speed
- if hasattr(self, 'primary_ip') and self.primary_ip is not None:
- if isinstance(self.primary_ip, dict):
- _dict['primary_ip'] = self.primary_ip
- else:
- _dict['primary_ip'] = self.primary_ip.to_dict()
- if hasattr(self, 'resource_type') and self.resource_type is not None:
- _dict['resource_type'] = self.resource_type
- if hasattr(self, 'security_groups') and self.security_groups is not None:
- security_groups_list = []
- for v in self.security_groups:
- if isinstance(v, dict):
- security_groups_list.append(v)
- else:
- security_groups_list.append(v.to_dict())
- _dict['security_groups'] = security_groups_list
- if hasattr(self, 'status') and self.status is not None:
- _dict['status'] = self.status
- if hasattr(self, 'subnet') and self.subnet is not None:
- if isinstance(self.subnet, dict):
- _dict['subnet'] = self.subnet
- else:
- _dict['subnet'] = self.subnet.to_dict()
- if hasattr(self, 'type') and self.type is not None:
- _dict['type'] = self.type
- if hasattr(self, 'interface_type') and self.interface_type is not None:
- _dict['interface_type'] = self.interface_type
+ 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):
@@ -87673,320 +90366,510 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this BareMetalServerNetworkInterfaceByHiperSocket object."""
+ """Return a `str` version of this VPNServerLifecycleReason object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'BareMetalServerNetworkInterfaceByHiperSocket') -> bool:
+ def __eq__(self, other: 'VPNServerLifecycleReason') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'BareMetalServerNetworkInterfaceByHiperSocket') -> bool:
+ def __ne__(self, other: 'VPNServerLifecycleReason') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class ResourceTypeEnum(str, Enum):
+ class CodeEnum(str, Enum):
"""
- The resource type.
+ A snake case string succinctly identifying the reason for this lifecycle state.
"""
- NETWORK_INTERFACE = 'network_interface'
+ RESOURCE_SUSPENDED_BY_PROVIDER = 'resource_suspended_by_provider'
- class StatusEnum(str, Enum):
- """
- The status of the bare metal server network interface.
- """
- AVAILABLE = 'available'
- DELETING = 'deleting'
- FAILED = 'failed'
- PENDING = 'pending'
+class VPNServerPatch:
+ """
+ VPNServerPatch.
+ :param CertificateInstanceIdentity certificate: (optional) The certificate
+ instance for this VPN server.
+ :param List[VPNServerAuthenticationPrototype] client_authentication: (optional)
+ The authentication methods to use to authenticate VPN client on this VPN server
+ (replacing any existing methods).
+ :param List[IP] client_dns_server_ips: (optional) The DNS server addresses that
+ will be provided to VPN clients connected to this VPN server (replacing any
+ existing addresses).
+ :param int client_idle_timeout: (optional) The seconds a VPN client can be idle
+ before this VPN server will disconnect it. If `0`, the server will not
+ disconnect idle clients.
+ :param str client_ip_pool: (optional) The VPN client IPv4 address pool,
+ expressed in CIDR format. The request must not overlap with any existing address
+ prefixes in the VPC or any of the following reserved address ranges:
+ - `127.0.0.0/8` (IPv4 loopback addresses)
+ - `161.26.0.0/16` (IBM services)
+ - `166.8.0.0/14` (Cloud Service Endpoints)
+ - `169.254.0.0/16` (IPv4 link-local addresses)
+ - `224.0.0.0/4` (IPv4 multicast addresses)
+ The prefix length of the client IP address pool's CIDR must be between
+ `/9` (8,388,608 addresses) and `/22` (1024 addresses). A CIDR block that
+ contains twice the number of IP addresses that are required to enable the
+ maximum number of concurrent connections is recommended.
+ :param bool enable_split_tunneling: (optional) Indicates whether the split
+ tunneling is enabled on this VPN server.
+ :param str name: (optional) The name for this VPN server. The name must not be
+ used by another VPN server in the VPC.
+ :param int port: (optional) The port number used by this VPN server.
+ :param str protocol: (optional) The transport protocol used by this VPN server.
+ :param List[SubnetIdentity] subnets: (optional) The subnets to provision this
+ VPN server in (replacing the existing subnets).
+ """
- class TypeEnum(str, Enum):
- """
- The bare metal server network interface type.
+ def __init__(
+ self,
+ *,
+ certificate: Optional['CertificateInstanceIdentity'] = None,
+ client_authentication: Optional[List['VPNServerAuthenticationPrototype']] = None,
+ client_dns_server_ips: Optional[List['IP']] = None,
+ client_idle_timeout: Optional[int] = None,
+ client_ip_pool: Optional[str] = None,
+ enable_split_tunneling: Optional[bool] = None,
+ name: Optional[str] = None,
+ port: Optional[int] = None,
+ protocol: Optional[str] = None,
+ subnets: Optional[List['SubnetIdentity']] = None,
+ ) -> None:
"""
+ Initialize a VPNServerPatch object.
- PRIMARY = 'primary'
- SECONDARY = 'secondary'
+ :param CertificateInstanceIdentity certificate: (optional) The certificate
+ instance for this VPN server.
+ :param List[VPNServerAuthenticationPrototype] client_authentication:
+ (optional) The authentication methods to use to authenticate VPN client on
+ this VPN server
+ (replacing any existing methods).
+ :param List[IP] client_dns_server_ips: (optional) The DNS server addresses
+ that will be provided to VPN clients connected to this VPN server
+ (replacing any existing addresses).
+ :param int client_idle_timeout: (optional) The seconds a VPN client can be
+ idle before this VPN server will disconnect it. If `0`, the server will
+ not disconnect idle clients.
+ :param str client_ip_pool: (optional) The VPN client IPv4 address pool,
+ expressed in CIDR format. The request must not overlap with any existing
+ address prefixes in the VPC or any of the following reserved address
+ ranges:
+ - `127.0.0.0/8` (IPv4 loopback addresses)
+ - `161.26.0.0/16` (IBM services)
+ - `166.8.0.0/14` (Cloud Service Endpoints)
+ - `169.254.0.0/16` (IPv4 link-local addresses)
+ - `224.0.0.0/4` (IPv4 multicast addresses)
+ The prefix length of the client IP address pool's CIDR must be between
+ `/9` (8,388,608 addresses) and `/22` (1024 addresses). A CIDR block that
+ contains twice the number of IP addresses that are required to enable the
+ maximum number of concurrent connections is recommended.
+ :param bool enable_split_tunneling: (optional) Indicates whether the split
+ tunneling is enabled on this VPN server.
+ :param str name: (optional) The name for this VPN server. The name must not
+ be used by another VPN server in the VPC.
+ :param int port: (optional) The port number used by this VPN server.
+ :param str protocol: (optional) The transport protocol used by this VPN
+ server.
+ :param List[SubnetIdentity] subnets: (optional) The subnets to provision
+ this VPN server in (replacing the existing subnets).
+ """
+ self.certificate = certificate
+ self.client_authentication = client_authentication
+ self.client_dns_server_ips = client_dns_server_ips
+ self.client_idle_timeout = client_idle_timeout
+ self.client_ip_pool = client_ip_pool
+ self.enable_split_tunneling = enable_split_tunneling
+ self.name = name
+ self.port = port
+ self.protocol = protocol
+ self.subnets = subnets
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'VPNServerPatch':
+ """Initialize a VPNServerPatch object from a json dictionary."""
+ args = {}
+ if (certificate := _dict.get('certificate')) is not None:
+ args['certificate'] = certificate
+ if (client_authentication := _dict.get('client_authentication')) is not None:
+ args['client_authentication'] = [VPNServerAuthenticationPrototype.from_dict(v) for v in client_authentication]
+ if (client_dns_server_ips := _dict.get('client_dns_server_ips')) is not None:
+ args['client_dns_server_ips'] = [IP.from_dict(v) for v in client_dns_server_ips]
+ if (client_idle_timeout := _dict.get('client_idle_timeout')) is not None:
+ args['client_idle_timeout'] = client_idle_timeout
+ if (client_ip_pool := _dict.get('client_ip_pool')) is not None:
+ args['client_ip_pool'] = client_ip_pool
+ if (enable_split_tunneling := _dict.get('enable_split_tunneling')) is not None:
+ args['enable_split_tunneling'] = enable_split_tunneling
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ if (port := _dict.get('port')) is not None:
+ args['port'] = port
+ if (protocol := _dict.get('protocol')) is not None:
+ args['protocol'] = protocol
+ if (subnets := _dict.get('subnets')) is not None:
+ args['subnets'] = subnets
+ return cls(**args)
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a VPNServerPatch object from a json dictionary."""
+ return cls.from_dict(_dict)
- class InterfaceTypeEnum(str, Enum):
+ def to_dict(self) -> Dict:
+ """Return a json dictionary representing this model."""
+ _dict = {}
+ if hasattr(self, 'certificate') and self.certificate is not None:
+ if isinstance(self.certificate, dict):
+ _dict['certificate'] = self.certificate
+ else:
+ _dict['certificate'] = self.certificate.to_dict()
+ if hasattr(self, 'client_authentication') and self.client_authentication is not None:
+ client_authentication_list = []
+ for v in self.client_authentication:
+ if isinstance(v, dict):
+ client_authentication_list.append(v)
+ else:
+ client_authentication_list.append(v.to_dict())
+ _dict['client_authentication'] = client_authentication_list
+ if hasattr(self, 'client_dns_server_ips') and self.client_dns_server_ips is not None:
+ client_dns_server_ips_list = []
+ for v in self.client_dns_server_ips:
+ if isinstance(v, dict):
+ client_dns_server_ips_list.append(v)
+ else:
+ client_dns_server_ips_list.append(v.to_dict())
+ _dict['client_dns_server_ips'] = client_dns_server_ips_list
+ if hasattr(self, 'client_idle_timeout') and self.client_idle_timeout is not None:
+ _dict['client_idle_timeout'] = self.client_idle_timeout
+ if hasattr(self, 'client_ip_pool') and self.client_ip_pool is not None:
+ _dict['client_ip_pool'] = self.client_ip_pool
+ if hasattr(self, 'enable_split_tunneling') and self.enable_split_tunneling is not None:
+ _dict['enable_split_tunneling'] = self.enable_split_tunneling
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ if hasattr(self, 'port') and self.port is not None:
+ _dict['port'] = self.port
+ if hasattr(self, 'protocol') and self.protocol is not None:
+ _dict['protocol'] = self.protocol
+ if hasattr(self, 'subnets') and self.subnets is not None:
+ subnets_list = []
+ for v in self.subnets:
+ if isinstance(v, dict):
+ subnets_list.append(v)
+ else:
+ subnets_list.append(v.to_dict())
+ _dict['subnets'] = subnets_list
+ return _dict
+
+ def _to_dict(self):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
+
+ def __str__(self) -> str:
+ """Return a `str` version of this VPNServerPatch object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'VPNServerPatch') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'VPNServerPatch') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+ class ProtocolEnum(str, Enum):
"""
- - `hipersocket`: a virtual network device that provides high-speed TCP/IP
- connectivity
- within a `s390x` based system.
+ The transport protocol used by this VPN server.
"""
- HIPERSOCKET = 'hipersocket'
+ TCP = 'tcp'
+ UDP = 'udp'
-class BareMetalServerNetworkInterfaceByPCI(BareMetalServerNetworkInterface):
+class VPNServerReferenceDeleted:
"""
- BareMetalServerNetworkInterfaceByPCI.
+ If present, this property indicates the referenced resource has been deleted, and
+ provides some supplementary information.
- :attr bool allow_ip_spoofing: Indicates whether source IP spoofing is allowed on
- this bare metal server network interface.
- :attr datetime created_at: The date and time that the bare metal server network
- interface was created.
- :attr bool enable_infrastructure_nat: If `true`:
- - The VPC infrastructure performs any needed NAT operations.
- - `floating_ips` must not have more than one floating IP.
- If `false`:
- - Packets are passed unchanged to/from the bare metal server network interface,
- allowing the workload to perform any needed NAT operations.
- - `allow_ip_spoofing` must be `false`.
- - `interface_type` must not be `hipersocket`.
- :attr List[FloatingIPReference] floating_ips: The floating IPs associated with
- this bare metal server network interface.
- :attr str href: The URL for this bare metal server network interface.
- :attr str id: The unique identifier for this bare metal server network
- interface.
- :attr str mac_address: The MAC address of this bare metal server network
- interface. If the MAC address has not yet been selected, the value will be an
- empty string.
- :attr str name: The name for this bare metal server network interface.
- :attr int port_speed: The bare metal server network interface port speed in
- Mbps.
- :attr ReservedIPReference primary_ip:
- :attr str resource_type: The resource type.
- :attr List[SecurityGroupReference] security_groups: The security groups
- targeting this bare metal server network interface.
- :attr str status: The status of the bare metal server network interface.
- :attr SubnetReference subnet: The associated subnet.
- :attr str type: The bare metal server network interface type.
- :attr List[int] allowed_vlans: The VLAN IDs allowed for `vlan` interfaces using
- this PCI interface.
- :attr str interface_type: - `pci`: a physical PCI device which can only be
- created or deleted when the bare metal
- server is stopped
- - Has an `allowed_vlans` property which controls the VLANs that will be
- permitted
- to use the PCI interface
- - Cannot directly use an IEEE 802.1Q tag.
+ :param str more_info: Link to documentation about deleted resources.
"""
def __init__(
self,
- allow_ip_spoofing: bool,
+ more_info: str,
+ ) -> None:
+ """
+ Initialize a VPNServerReferenceDeleted object.
+
+ :param str more_info: Link to documentation about deleted resources.
+ """
+ self.more_info = more_info
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'VPNServerReferenceDeleted':
+ """Initialize a VPNServerReferenceDeleted object from a json dictionary."""
+ args = {}
+ if (more_info := _dict.get('more_info')) is not None:
+ args['more_info'] = more_info
+ else:
+ raise ValueError('Required property \'more_info\' not present in VPNServerReferenceDeleted JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a VPNServerReferenceDeleted object from a json dictionary."""
+ return cls.from_dict(_dict)
+
+ def to_dict(self) -> Dict:
+ """Return a json dictionary representing this model."""
+ _dict = {}
+ if hasattr(self, '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 VPNServerReferenceDeleted object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'VPNServerReferenceDeleted') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'VPNServerReferenceDeleted') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+
+class VPNServerRoute:
+ """
+ VPNServerRoute.
+
+ :param str action: The action to perform with a packet matching the VPN route:
+ - `translate`: translate the source IP address to one of the private IP
+ addresses of the VPN server.
+ - `deliver`: deliver the packet into the VPC.
+ - `drop`: drop the packet
+ The enumerated values for this property are expected to expand in the future.
+ When processing this property, check for and log unknown values. Optionally halt
+ processing and surface the error, or bypass the VPN route on which the
+ unexpected property value was encountered.
+ :param datetime created_at: The date and time that the VPN route was created.
+ :param str destination: The destination for this VPN route in the VPN server. If
+ an incoming packet does not match any destination, it will be dropped.
+ :param List[VPNServerRouteHealthReason] health_reasons: The reasons for the
+ current VPN server route health_state (if any):
+ - `internal_error`: Internal error (contact IBM support)
+ The enumerated reason code values for this property will expand in the future.
+ When processing this property, check for and log unknown values. Optionally halt
+ processing and surface the error, or bypass the resource on which the unexpected
+ reason code was encountered.
+ :param str health_state: The health of this resource.
+ - `ok`: No abnormal behavior detected
+ - `degraded`: Experiencing compromised performance, capacity, or connectivity
+ - `faulted`: Completely unreachable, inoperative, or otherwise entirely
+ incapacitated
+ - `inapplicable`: The health state does not apply because of the current
+ lifecycle state. A resource with a lifecycle state of `failed` or `deleting`
+ will have a health state of `inapplicable`. A `pending` resource may also have
+ this state.
+ :param str href: The URL for this VPN route.
+ :param str id: The unique identifier for this VPN route.
+ :param List[VPNServerRouteLifecycleReason] lifecycle_reasons: The reasons for
+ the current VPN server route lifecycle_state (if any):
+ - `resource_suspended_by_provider`: The resource has been suspended (contact IBM
+ support)
+ The enumerated reason code values for this property will expand in the future.
+ When processing this property, check for and log unknown values. Optionally halt
+ processing and surface the error, or bypass the resource on which the unexpected
+ reason code was encountered.
+ :param str lifecycle_state: The lifecycle state of the VPN route.
+ :param str name: The name for this VPN route. The name is unique across all
+ routes for a VPN server.
+ :param str resource_type: The resource type.
+ """
+
+ def __init__(
+ self,
+ action: str,
created_at: datetime,
- enable_infrastructure_nat: bool,
- floating_ips: List['FloatingIPReference'],
+ destination: str,
+ health_reasons: List['VPNServerRouteHealthReason'],
+ health_state: str,
href: str,
id: str,
- mac_address: str,
+ lifecycle_reasons: List['VPNServerRouteLifecycleReason'],
+ lifecycle_state: str,
name: str,
- port_speed: int,
- primary_ip: 'ReservedIPReference',
resource_type: str,
- security_groups: List['SecurityGroupReference'],
- status: str,
- subnet: 'SubnetReference',
- type: str,
- allowed_vlans: List[int],
- interface_type: str,
) -> None:
"""
- Initialize a BareMetalServerNetworkInterfaceByPCI object.
+ Initialize a VPNServerRoute object.
- :param bool allow_ip_spoofing: Indicates whether source IP spoofing is
- allowed on this bare metal server network interface.
- :param datetime created_at: The date and time that the bare metal server
- network interface was created.
- :param bool enable_infrastructure_nat: If `true`:
- - The VPC infrastructure performs any needed NAT operations.
- - `floating_ips` must not have more than one floating IP.
- If `false`:
- - Packets are passed unchanged to/from the bare metal server network
- interface,
- allowing the workload to perform any needed NAT operations.
- - `allow_ip_spoofing` must be `false`.
- - `interface_type` must not be `hipersocket`.
- :param List[FloatingIPReference] floating_ips: The floating IPs associated
- with this bare metal server network interface.
- :param str href: The URL for this bare metal server network interface.
- :param str id: The unique identifier for this bare metal server network
- interface.
- :param str mac_address: The MAC address of this bare metal server network
- interface. If the MAC address has not yet been selected, the value will be
- an empty string.
- :param str name: The name for this bare metal server network interface.
- :param int port_speed: The bare metal server network interface port speed
- in Mbps.
- :param ReservedIPReference primary_ip:
+ :param str action: The action to perform with a packet matching the VPN
+ route:
+ - `translate`: translate the source IP address to one of the private IP
+ addresses of the VPN server.
+ - `deliver`: deliver the packet into the VPC.
+ - `drop`: drop the packet
+ The enumerated values for this property are expected to expand in the
+ future. When processing this property, check for and log unknown values.
+ Optionally halt processing and surface the error, or bypass the VPN route
+ on which the unexpected property value was encountered.
+ :param datetime created_at: The date and time that the VPN route was
+ created.
+ :param str destination: The destination for this VPN route in the VPN
+ server. If an incoming packet does not match any destination, it will be
+ dropped.
+ :param List[VPNServerRouteHealthReason] health_reasons: The reasons for the
+ current VPN server route health_state (if any):
+ - `internal_error`: Internal error (contact IBM support)
+ The enumerated reason code values for this property will expand in the
+ future. When processing this property, check for and log unknown values.
+ Optionally halt processing and surface the error, or bypass the resource on
+ which the unexpected reason code was encountered.
+ :param str health_state: The health of this resource.
+ - `ok`: No abnormal behavior detected
+ - `degraded`: Experiencing compromised performance, capacity, or
+ connectivity
+ - `faulted`: Completely unreachable, inoperative, or otherwise entirely
+ incapacitated
+ - `inapplicable`: The health state does not apply because of the current
+ lifecycle state. A resource with a lifecycle state of `failed` or
+ `deleting` will have a health state of `inapplicable`. A `pending` resource
+ may also have this state.
+ :param str href: The URL for this VPN route.
+ :param str id: The unique identifier for this VPN route.
+ :param List[VPNServerRouteLifecycleReason] lifecycle_reasons: The reasons
+ for the current VPN server route lifecycle_state (if any):
+ - `resource_suspended_by_provider`: The resource has been suspended
+ (contact IBM
+ support)
+ The enumerated reason code values for this property will expand in the
+ future. When processing this property, check for and log unknown values.
+ Optionally halt processing and surface the error, or bypass the resource on
+ which the unexpected reason code was encountered.
+ :param str lifecycle_state: The lifecycle state of the VPN route.
+ :param str name: The name for this VPN route. The name is unique across all
+ routes for a VPN server.
:param str resource_type: The resource type.
- :param List[SecurityGroupReference] security_groups: The security groups
- targeting this bare metal server network interface.
- :param str status: The status of the bare metal server network interface.
- :param SubnetReference subnet: The associated subnet.
- :param str type: The bare metal server network interface type.
- :param List[int] allowed_vlans: The VLAN IDs allowed for `vlan` interfaces
- using this PCI interface.
- :param str interface_type: - `pci`: a physical PCI device which can only be
- created or deleted when the bare metal
- server is stopped
- - Has an `allowed_vlans` property which controls the VLANs that will be
- permitted
- to use the PCI interface
- - Cannot directly use an IEEE 802.1Q tag.
"""
- # pylint: disable=super-init-not-called
- self.allow_ip_spoofing = allow_ip_spoofing
+ self.action = action
self.created_at = created_at
- self.enable_infrastructure_nat = enable_infrastructure_nat
- self.floating_ips = floating_ips
+ self.destination = destination
+ self.health_reasons = health_reasons
+ self.health_state = health_state
self.href = href
self.id = id
- self.mac_address = mac_address
+ self.lifecycle_reasons = lifecycle_reasons
+ self.lifecycle_state = lifecycle_state
self.name = name
- self.port_speed = port_speed
- self.primary_ip = primary_ip
self.resource_type = resource_type
- self.security_groups = security_groups
- self.status = status
- self.subnet = subnet
- self.type = type
- self.allowed_vlans = allowed_vlans
- self.interface_type = interface_type
@classmethod
- def from_dict(cls, _dict: Dict) -> 'BareMetalServerNetworkInterfaceByPCI':
- """Initialize a BareMetalServerNetworkInterfaceByPCI object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VPNServerRoute':
+ """Initialize a VPNServerRoute object from a json dictionary."""
args = {}
- if 'allow_ip_spoofing' in _dict:
- args['allow_ip_spoofing'] = _dict.get('allow_ip_spoofing')
- else:
- raise ValueError('Required property \'allow_ip_spoofing\' not present in BareMetalServerNetworkInterfaceByPCI JSON')
- if 'created_at' in _dict:
- args['created_at'] = string_to_datetime(_dict.get('created_at'))
- else:
- raise ValueError('Required property \'created_at\' not present in BareMetalServerNetworkInterfaceByPCI JSON')
- if 'enable_infrastructure_nat' in _dict:
- args['enable_infrastructure_nat'] = _dict.get('enable_infrastructure_nat')
- else:
- raise ValueError('Required property \'enable_infrastructure_nat\' not present in BareMetalServerNetworkInterfaceByPCI JSON')
- if 'floating_ips' in _dict:
- args['floating_ips'] = [FloatingIPReference.from_dict(v) for v in _dict.get('floating_ips')]
- else:
- raise ValueError('Required property \'floating_ips\' not present in BareMetalServerNetworkInterfaceByPCI JSON')
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ if (action := _dict.get('action')) is not None:
+ args['action'] = action
else:
- raise ValueError('Required property \'href\' not present in BareMetalServerNetworkInterfaceByPCI JSON')
- if 'id' in _dict:
- args['id'] = _dict.get('id')
- else:
- raise ValueError('Required property \'id\' not present in BareMetalServerNetworkInterfaceByPCI JSON')
- if 'mac_address' in _dict:
- args['mac_address'] = _dict.get('mac_address')
- else:
- raise ValueError('Required property \'mac_address\' not present in BareMetalServerNetworkInterfaceByPCI JSON')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
+ raise ValueError('Required property \'action\' not present in VPNServerRoute JSON')
+ if (created_at := _dict.get('created_at')) is not None:
+ args['created_at'] = string_to_datetime(created_at)
else:
- raise ValueError('Required property \'name\' not present in BareMetalServerNetworkInterfaceByPCI JSON')
- if 'port_speed' in _dict:
- args['port_speed'] = _dict.get('port_speed')
+ raise ValueError('Required property \'created_at\' not present in VPNServerRoute JSON')
+ if (destination := _dict.get('destination')) is not None:
+ args['destination'] = destination
else:
- raise ValueError('Required property \'port_speed\' not present in BareMetalServerNetworkInterfaceByPCI JSON')
- if 'primary_ip' in _dict:
- args['primary_ip'] = ReservedIPReference.from_dict(_dict.get('primary_ip'))
+ raise ValueError('Required property \'destination\' not present in VPNServerRoute JSON')
+ if (health_reasons := _dict.get('health_reasons')) is not None:
+ args['health_reasons'] = [VPNServerRouteHealthReason.from_dict(v) for v in health_reasons]
else:
- raise ValueError('Required property \'primary_ip\' not present in BareMetalServerNetworkInterfaceByPCI JSON')
- if 'resource_type' in _dict:
- args['resource_type'] = _dict.get('resource_type')
+ raise ValueError('Required property \'health_reasons\' not present in VPNServerRoute JSON')
+ if (health_state := _dict.get('health_state')) is not None:
+ args['health_state'] = health_state
else:
- raise ValueError('Required property \'resource_type\' not present in BareMetalServerNetworkInterfaceByPCI JSON')
- if 'security_groups' in _dict:
- args['security_groups'] = [SecurityGroupReference.from_dict(v) for v in _dict.get('security_groups')]
+ raise ValueError('Required property \'health_state\' not present in VPNServerRoute JSON')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'security_groups\' not present in BareMetalServerNetworkInterfaceByPCI JSON')
- if 'status' in _dict:
- args['status'] = _dict.get('status')
+ raise ValueError('Required property \'href\' not present in VPNServerRoute JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
else:
- raise ValueError('Required property \'status\' not present in BareMetalServerNetworkInterfaceByPCI JSON')
- if 'subnet' in _dict:
- args['subnet'] = SubnetReference.from_dict(_dict.get('subnet'))
+ raise ValueError('Required property \'id\' not present in VPNServerRoute JSON')
+ if (lifecycle_reasons := _dict.get('lifecycle_reasons')) is not None:
+ args['lifecycle_reasons'] = [VPNServerRouteLifecycleReason.from_dict(v) for v in lifecycle_reasons]
else:
- raise ValueError('Required property \'subnet\' not present in BareMetalServerNetworkInterfaceByPCI JSON')
- if 'type' in _dict:
- args['type'] = _dict.get('type')
+ raise ValueError('Required property \'lifecycle_reasons\' not present in VPNServerRoute JSON')
+ if (lifecycle_state := _dict.get('lifecycle_state')) is not None:
+ args['lifecycle_state'] = lifecycle_state
else:
- raise ValueError('Required property \'type\' not present in BareMetalServerNetworkInterfaceByPCI JSON')
- if 'allowed_vlans' in _dict:
- args['allowed_vlans'] = _dict.get('allowed_vlans')
+ raise ValueError('Required property \'lifecycle_state\' not present in VPNServerRoute JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
else:
- raise ValueError('Required property \'allowed_vlans\' not present in BareMetalServerNetworkInterfaceByPCI JSON')
- if 'interface_type' in _dict:
- args['interface_type'] = _dict.get('interface_type')
+ raise ValueError('Required property \'name\' not present in VPNServerRoute JSON')
+ if (resource_type := _dict.get('resource_type')) is not None:
+ args['resource_type'] = resource_type
else:
- raise ValueError('Required property \'interface_type\' not present in BareMetalServerNetworkInterfaceByPCI JSON')
+ raise ValueError('Required property \'resource_type\' not present in VPNServerRoute JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a BareMetalServerNetworkInterfaceByPCI object from a json dictionary."""
+ """Initialize a VPNServerRoute object from 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, '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, 'enable_infrastructure_nat') and self.enable_infrastructure_nat is not None:
- _dict['enable_infrastructure_nat'] = self.enable_infrastructure_nat
- if hasattr(self, 'floating_ips') and self.floating_ips is not None:
- floating_ips_list = []
- for v in self.floating_ips:
+ if hasattr(self, 'destination') and self.destination is not None:
+ _dict['destination'] = self.destination
+ if hasattr(self, 'health_reasons') and self.health_reasons is not None:
+ health_reasons_list = []
+ for v in self.health_reasons:
if isinstance(v, dict):
- floating_ips_list.append(v)
+ health_reasons_list.append(v)
else:
- floating_ips_list.append(v.to_dict())
- _dict['floating_ips'] = floating_ips_list
+ health_reasons_list.append(v.to_dict())
+ _dict['health_reasons'] = health_reasons_list
+ if hasattr(self, 'health_state') and self.health_state is not None:
+ _dict['health_state'] = self.health_state
if hasattr(self, 'href') and self.href is not None:
_dict['href'] = self.href
if hasattr(self, 'id') and self.id is not None:
_dict['id'] = self.id
- if hasattr(self, 'mac_address') and self.mac_address is not None:
- _dict['mac_address'] = self.mac_address
+ if hasattr(self, 'lifecycle_reasons') and self.lifecycle_reasons is not None:
+ lifecycle_reasons_list = []
+ for v in self.lifecycle_reasons:
+ if isinstance(v, dict):
+ lifecycle_reasons_list.append(v)
+ else:
+ lifecycle_reasons_list.append(v.to_dict())
+ _dict['lifecycle_reasons'] = lifecycle_reasons_list
+ if hasattr(self, 'lifecycle_state') and self.lifecycle_state is not None:
+ _dict['lifecycle_state'] = self.lifecycle_state
if hasattr(self, 'name') and self.name is not None:
_dict['name'] = self.name
- if hasattr(self, 'port_speed') and self.port_speed is not None:
- _dict['port_speed'] = self.port_speed
- if hasattr(self, 'primary_ip') and self.primary_ip is not None:
- if isinstance(self.primary_ip, dict):
- _dict['primary_ip'] = self.primary_ip
- else:
- _dict['primary_ip'] = self.primary_ip.to_dict()
if hasattr(self, 'resource_type') and self.resource_type is not None:
_dict['resource_type'] = self.resource_type
- if hasattr(self, 'security_groups') and self.security_groups is not None:
- security_groups_list = []
- for v in self.security_groups:
- if isinstance(v, dict):
- security_groups_list.append(v)
- else:
- security_groups_list.append(v.to_dict())
- _dict['security_groups'] = security_groups_list
- if hasattr(self, 'status') and self.status is not None:
- _dict['status'] = self.status
- if hasattr(self, 'subnet') and self.subnet is not None:
- if isinstance(self.subnet, dict):
- _dict['subnet'] = self.subnet
- else:
- _dict['subnet'] = self.subnet.to_dict()
- if hasattr(self, 'type') and self.type is not None:
- _dict['type'] = self.type
- if hasattr(self, 'allowed_vlans') and self.allowed_vlans is not None:
- _dict['allowed_vlans'] = self.allowed_vlans
- if hasattr(self, 'interface_type') and self.interface_type is not None:
- _dict['interface_type'] = self.interface_type
return _dict
def _to_dict(self):
@@ -87994,353 +90877,175 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this BareMetalServerNetworkInterfaceByPCI object."""
+ """Return a `str` version of this VPNServerRoute object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'BareMetalServerNetworkInterfaceByPCI') -> bool:
+ def __eq__(self, other: 'VPNServerRoute') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'BareMetalServerNetworkInterfaceByPCI') -> bool:
+ def __ne__(self, other: 'VPNServerRoute') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class ResourceTypeEnum(str, Enum):
+ class ActionEnum(str, Enum):
"""
- The resource type.
+ The action to perform with a packet matching the VPN route:
+ - `translate`: translate the source IP address to one of the private IP addresses
+ of the VPN server.
+ - `deliver`: deliver the packet into the VPC.
+ - `drop`: drop the packet
+ The enumerated values for this property are expected to expand in the future. When
+ processing this property, check for and log unknown values. Optionally halt
+ processing and surface the error, or bypass the VPN route on which the unexpected
+ property value was encountered.
"""
- NETWORK_INTERFACE = 'network_interface'
+ DELIVER = 'deliver'
+ DROP = 'drop'
+ TRANSLATE = 'translate'
- class StatusEnum(str, Enum):
+ class HealthStateEnum(str, Enum):
"""
- The status of the bare metal server network interface.
+ 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.
"""
- AVAILABLE = 'available'
- DELETING = 'deleting'
- FAILED = 'failed'
- PENDING = 'pending'
-
+ DEGRADED = 'degraded'
+ FAULTED = 'faulted'
+ INAPPLICABLE = 'inapplicable'
+ OK = 'ok'
- class TypeEnum(str, Enum):
+
+ class LifecycleStateEnum(str, Enum):
"""
- The bare metal server network interface type.
+ The lifecycle state of the VPN route.
"""
- PRIMARY = 'primary'
- SECONDARY = 'secondary'
+ DELETING = 'deleting'
+ FAILED = 'failed'
+ PENDING = 'pending'
+ STABLE = 'stable'
+ SUSPENDED = 'suspended'
+ UPDATING = 'updating'
+ WAITING = 'waiting'
- class InterfaceTypeEnum(str, Enum):
+ class ResourceTypeEnum(str, Enum):
"""
- - `pci`: a physical PCI device which can only be created or deleted when the bare
- metal
- server is stopped
- - Has an `allowed_vlans` property which controls the VLANs that will be
- permitted
- to use the PCI interface
- - Cannot directly use an IEEE 802.1Q tag.
+ The resource type.
"""
- PCI = 'pci'
+ VPN_SERVER_ROUTE = 'vpn_server_route'
-class BareMetalServerNetworkInterfaceByVLAN(BareMetalServerNetworkInterface):
+class VPNServerRouteCollection:
"""
- BareMetalServerNetworkInterfaceByVLAN.
+ VPNServerRouteCollection.
- :attr bool allow_ip_spoofing: Indicates whether source IP spoofing is allowed on
- this bare metal server network interface.
- :attr datetime created_at: The date and time that the bare metal server network
- interface was created.
- :attr bool enable_infrastructure_nat: If `true`:
- - The VPC infrastructure performs any needed NAT operations.
- - `floating_ips` must not have more than one floating IP.
- If `false`:
- - Packets are passed unchanged to/from the bare metal server network interface,
- allowing the workload to perform any needed NAT operations.
- - `allow_ip_spoofing` must be `false`.
- - `interface_type` must not be `hipersocket`.
- :attr List[FloatingIPReference] floating_ips: The floating IPs associated with
- this bare metal server network interface.
- :attr str href: The URL for this bare metal server network interface.
- :attr str id: The unique identifier for this bare metal server network
- interface.
- :attr str mac_address: The MAC address of this bare metal server network
- interface. If the MAC address has not yet been selected, the value will be an
- empty string.
- :attr str name: The name for this bare metal server network interface.
- :attr int port_speed: The bare metal server network interface port speed in
- Mbps.
- :attr ReservedIPReference primary_ip:
- :attr str resource_type: The resource type.
- :attr List[SecurityGroupReference] security_groups: The security groups
- targeting this bare metal server network interface.
- :attr str status: The status of the bare metal server network interface.
- :attr SubnetReference subnet: The associated subnet.
- :attr str type: The bare metal server network interface type.
- :attr bool allow_interface_to_float: Indicates if the data path for the network
- interface can float to another bare metal server. Can only be `true` for network
- interfaces with an `interface_type` of `vlan`.
- If `true`, and the network detects traffic for this data path on another bare
- metal server in the resource group, the network interface will be automatically
- deleted from this bare metal server and a new network interface with the same
- `id`, `name` and `vlan` will be created on the other bare metal server.
- For the data path to float, the other bare metal server must be in the same
- `resource_group`, and must have a network interface with `interface_type` of
- `pci` with `allowed_vlans` including this network interface's `vlan`.
- :attr str interface_type: - `vlan`: a virtual device, used through a `pci`
- device that has the `vlan` in its array
- of `allowed_vlans`.
- - Must use an IEEE 802.1Q tag.
- - Has its own security groups and does not inherit those of the PCI device
- through
- which traffic flows.
- :attr int vlan: The VLAN ID used in the IEEE 802.1Q tag present in all traffic
- on this interface.
+ :param VPNServerRouteCollectionFirst first: A link to the first page of
+ resources.
+ :param int limit: The maximum number of resources that can be returned by the
+ request.
+ :param VPNServerRouteCollectionNext next: (optional) A link to the next page of
+ resources. This property is present for all pages
+ except the last page.
+ :param List[VPNServerRoute] routes: Collection of VPN routes.
+ :param int total_count: The total number of resources across all pages.
"""
def __init__(
self,
- allow_ip_spoofing: bool,
- created_at: datetime,
- enable_infrastructure_nat: bool,
- floating_ips: List['FloatingIPReference'],
- href: str,
- id: str,
- mac_address: str,
- name: str,
- port_speed: int,
- primary_ip: 'ReservedIPReference',
- resource_type: str,
- security_groups: List['SecurityGroupReference'],
- status: str,
- subnet: 'SubnetReference',
- type: str,
- allow_interface_to_float: bool,
- interface_type: str,
- vlan: int,
+ first: 'VPNServerRouteCollectionFirst',
+ limit: int,
+ routes: List['VPNServerRoute'],
+ total_count: int,
+ *,
+ next: Optional['VPNServerRouteCollectionNext'] = None,
) -> None:
"""
- Initialize a BareMetalServerNetworkInterfaceByVLAN object.
+ Initialize a VPNServerRouteCollection object.
- :param bool allow_ip_spoofing: Indicates whether source IP spoofing is
- allowed on this bare metal server network interface.
- :param datetime created_at: The date and time that the bare metal server
- network interface was created.
- :param bool enable_infrastructure_nat: If `true`:
- - The VPC infrastructure performs any needed NAT operations.
- - `floating_ips` must not have more than one floating IP.
- If `false`:
- - Packets are passed unchanged to/from the bare metal server network
- interface,
- allowing the workload to perform any needed NAT operations.
- - `allow_ip_spoofing` must be `false`.
- - `interface_type` must not be `hipersocket`.
- :param List[FloatingIPReference] floating_ips: The floating IPs associated
- with this bare metal server network interface.
- :param str href: The URL for this bare metal server network interface.
- :param str id: The unique identifier for this bare metal server network
- interface.
- :param str mac_address: The MAC address of this bare metal server network
- interface. If the MAC address has not yet been selected, the value will be
- an empty string.
- :param str name: The name for this bare metal server network interface.
- :param int port_speed: The bare metal server network interface port speed
- in Mbps.
- :param ReservedIPReference primary_ip:
- :param str resource_type: The resource type.
- :param List[SecurityGroupReference] security_groups: The security groups
- targeting this bare metal server network interface.
- :param str status: The status of the bare metal server network interface.
- :param SubnetReference subnet: The associated subnet.
- :param str type: The bare metal server network interface type.
- :param bool allow_interface_to_float: Indicates if the data path for the
- network interface can float to another bare metal server. Can only be
- `true` for network interfaces with an `interface_type` of `vlan`.
- If `true`, and the network detects traffic for this data path on another
- bare metal server in the resource group, the network interface will be
- automatically deleted from this bare metal server and a new network
- interface with the same `id`, `name` and `vlan` will be created on the
- other bare metal server.
- For the data path to float, the other bare metal server must be in the same
- `resource_group`, and must have a network interface with `interface_type`
- of `pci` with `allowed_vlans` including this network interface's `vlan`.
- :param str interface_type: - `vlan`: a virtual device, used through a `pci`
- device that has the `vlan` in its array
- of `allowed_vlans`.
- - Must use an IEEE 802.1Q tag.
- - Has its own security groups and does not inherit those of the PCI
- device through
- which traffic flows.
- :param int vlan: The VLAN ID used in the IEEE 802.1Q tag present in all
- traffic on this interface.
+ :param VPNServerRouteCollectionFirst first: A link to the first page of
+ resources.
+ :param int limit: The maximum number of resources that can be returned by
+ the request.
+ :param List[VPNServerRoute] routes: Collection of VPN routes.
+ :param int total_count: The total number of resources across all pages.
+ :param VPNServerRouteCollectionNext next: (optional) A link to the next
+ page of resources. This property is present for all pages
+ except the last page.
"""
- # pylint: disable=super-init-not-called
- self.allow_ip_spoofing = allow_ip_spoofing
- self.created_at = created_at
- self.enable_infrastructure_nat = enable_infrastructure_nat
- self.floating_ips = floating_ips
- self.href = href
- self.id = id
- self.mac_address = mac_address
- self.name = name
- self.port_speed = port_speed
- self.primary_ip = primary_ip
- self.resource_type = resource_type
- self.security_groups = security_groups
- self.status = status
- self.subnet = subnet
- self.type = type
- self.allow_interface_to_float = allow_interface_to_float
- self.interface_type = interface_type
- self.vlan = vlan
+ self.first = first
+ self.limit = limit
+ self.next = next
+ self.routes = routes
+ self.total_count = total_count
@classmethod
- def from_dict(cls, _dict: Dict) -> 'BareMetalServerNetworkInterfaceByVLAN':
- """Initialize a BareMetalServerNetworkInterfaceByVLAN object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VPNServerRouteCollection':
+ """Initialize a VPNServerRouteCollection object from a json dictionary."""
args = {}
- if 'allow_ip_spoofing' in _dict:
- args['allow_ip_spoofing'] = _dict.get('allow_ip_spoofing')
- else:
- raise ValueError('Required property \'allow_ip_spoofing\' not present in BareMetalServerNetworkInterfaceByVLAN JSON')
- if 'created_at' in _dict:
- args['created_at'] = string_to_datetime(_dict.get('created_at'))
- else:
- raise ValueError('Required property \'created_at\' not present in BareMetalServerNetworkInterfaceByVLAN JSON')
- if 'enable_infrastructure_nat' in _dict:
- args['enable_infrastructure_nat'] = _dict.get('enable_infrastructure_nat')
- else:
- raise ValueError('Required property \'enable_infrastructure_nat\' not present in BareMetalServerNetworkInterfaceByVLAN JSON')
- if 'floating_ips' in _dict:
- args['floating_ips'] = [FloatingIPReference.from_dict(v) for v in _dict.get('floating_ips')]
- else:
- raise ValueError('Required property \'floating_ips\' not present in BareMetalServerNetworkInterfaceByVLAN JSON')
- if 'href' in _dict:
- args['href'] = _dict.get('href')
- else:
- raise ValueError('Required property \'href\' not present in BareMetalServerNetworkInterfaceByVLAN JSON')
- if 'id' in _dict:
- args['id'] = _dict.get('id')
+ if (first := _dict.get('first')) is not None:
+ args['first'] = VPNServerRouteCollectionFirst.from_dict(first)
else:
- raise ValueError('Required property \'id\' not present in BareMetalServerNetworkInterfaceByVLAN JSON')
- if 'mac_address' in _dict:
- args['mac_address'] = _dict.get('mac_address')
- else:
- raise ValueError('Required property \'mac_address\' not present in BareMetalServerNetworkInterfaceByVLAN JSON')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
- else:
- raise ValueError('Required property \'name\' not present in BareMetalServerNetworkInterfaceByVLAN JSON')
- if 'port_speed' in _dict:
- args['port_speed'] = _dict.get('port_speed')
- else:
- raise ValueError('Required property \'port_speed\' not present in BareMetalServerNetworkInterfaceByVLAN JSON')
- if 'primary_ip' in _dict:
- args['primary_ip'] = ReservedIPReference.from_dict(_dict.get('primary_ip'))
- else:
- raise ValueError('Required property \'primary_ip\' not present in BareMetalServerNetworkInterfaceByVLAN JSON')
- if 'resource_type' in _dict:
- args['resource_type'] = _dict.get('resource_type')
- else:
- raise ValueError('Required property \'resource_type\' not present in BareMetalServerNetworkInterfaceByVLAN JSON')
- if 'security_groups' in _dict:
- args['security_groups'] = [SecurityGroupReference.from_dict(v) for v in _dict.get('security_groups')]
- else:
- raise ValueError('Required property \'security_groups\' not present in BareMetalServerNetworkInterfaceByVLAN JSON')
- if 'status' in _dict:
- args['status'] = _dict.get('status')
- else:
- raise ValueError('Required property \'status\' not present in BareMetalServerNetworkInterfaceByVLAN JSON')
- if 'subnet' in _dict:
- args['subnet'] = SubnetReference.from_dict(_dict.get('subnet'))
- else:
- raise ValueError('Required property \'subnet\' not present in BareMetalServerNetworkInterfaceByVLAN JSON')
- if 'type' in _dict:
- args['type'] = _dict.get('type')
- else:
- raise ValueError('Required property \'type\' not present in BareMetalServerNetworkInterfaceByVLAN JSON')
- if 'allow_interface_to_float' in _dict:
- args['allow_interface_to_float'] = _dict.get('allow_interface_to_float')
+ raise ValueError('Required property \'first\' not present in VPNServerRouteCollection JSON')
+ if (limit := _dict.get('limit')) is not None:
+ args['limit'] = limit
else:
- raise ValueError('Required property \'allow_interface_to_float\' not present in BareMetalServerNetworkInterfaceByVLAN JSON')
- if 'interface_type' in _dict:
- args['interface_type'] = _dict.get('interface_type')
+ raise ValueError('Required property \'limit\' not present in VPNServerRouteCollection JSON')
+ if (next := _dict.get('next')) is not None:
+ args['next'] = VPNServerRouteCollectionNext.from_dict(next)
+ if (routes := _dict.get('routes')) is not None:
+ args['routes'] = [VPNServerRoute.from_dict(v) for v in routes]
else:
- raise ValueError('Required property \'interface_type\' not present in BareMetalServerNetworkInterfaceByVLAN JSON')
- if 'vlan' in _dict:
- args['vlan'] = _dict.get('vlan')
+ raise ValueError('Required property \'routes\' not present in VPNServerRouteCollection JSON')
+ if (total_count := _dict.get('total_count')) is not None:
+ args['total_count'] = total_count
else:
- raise ValueError('Required property \'vlan\' not present in BareMetalServerNetworkInterfaceByVLAN JSON')
+ raise ValueError('Required property \'total_count\' not present in VPNServerRouteCollection JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a BareMetalServerNetworkInterfaceByVLAN object from a json dictionary."""
+ """Initialize a VPNServerRouteCollection object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'allow_ip_spoofing') and self.allow_ip_spoofing is not None:
- _dict['allow_ip_spoofing'] = self.allow_ip_spoofing
- if hasattr(self, 'created_at') and self.created_at is not None:
- _dict['created_at'] = datetime_to_string(self.created_at)
- if hasattr(self, 'enable_infrastructure_nat') and self.enable_infrastructure_nat is not None:
- _dict['enable_infrastructure_nat'] = self.enable_infrastructure_nat
- if hasattr(self, 'floating_ips') and self.floating_ips is not None:
- floating_ips_list = []
- for v in self.floating_ips:
- if isinstance(v, dict):
- floating_ips_list.append(v)
- else:
- floating_ips_list.append(v.to_dict())
- _dict['floating_ips'] = floating_ips_list
- if hasattr(self, 'href') and self.href is not None:
- _dict['href'] = self.href
- if hasattr(self, 'id') and self.id is not None:
- _dict['id'] = self.id
- if hasattr(self, 'mac_address') and self.mac_address is not None:
- _dict['mac_address'] = self.mac_address
- if hasattr(self, 'name') and self.name is not None:
- _dict['name'] = self.name
- if hasattr(self, 'port_speed') and self.port_speed is not None:
- _dict['port_speed'] = self.port_speed
- if hasattr(self, 'primary_ip') and self.primary_ip is not None:
- if isinstance(self.primary_ip, dict):
- _dict['primary_ip'] = self.primary_ip
+ if hasattr(self, 'first') and self.first is not None:
+ if isinstance(self.first, dict):
+ _dict['first'] = self.first
else:
- _dict['primary_ip'] = self.primary_ip.to_dict()
- if hasattr(self, 'resource_type') and self.resource_type is not None:
- _dict['resource_type'] = self.resource_type
- if hasattr(self, 'security_groups') and self.security_groups is not None:
- security_groups_list = []
- for v in self.security_groups:
+ _dict['first'] = self.first.to_dict()
+ if hasattr(self, 'limit') and self.limit is not None:
+ _dict['limit'] = self.limit
+ if hasattr(self, 'next') and self.next is not None:
+ if isinstance(self.next, dict):
+ _dict['next'] = self.next
+ else:
+ _dict['next'] = self.next.to_dict()
+ if hasattr(self, 'routes') and self.routes is not None:
+ routes_list = []
+ for v in self.routes:
if isinstance(v, dict):
- security_groups_list.append(v)
+ routes_list.append(v)
else:
- security_groups_list.append(v.to_dict())
- _dict['security_groups'] = security_groups_list
- if hasattr(self, 'status') and self.status is not None:
- _dict['status'] = self.status
- if hasattr(self, 'subnet') and self.subnet is not None:
- if isinstance(self.subnet, dict):
- _dict['subnet'] = self.subnet
- else:
- _dict['subnet'] = self.subnet.to_dict()
- if hasattr(self, 'type') and self.type is not None:
- _dict['type'] = self.type
- if hasattr(self, 'allow_interface_to_float') and self.allow_interface_to_float is not None:
- _dict['allow_interface_to_float'] = self.allow_interface_to_float
- if hasattr(self, 'interface_type') and self.interface_type is not None:
- _dict['interface_type'] = self.interface_type
- if hasattr(self, 'vlan') and self.vlan is not None:
- _dict['vlan'] = self.vlan
+ routes_list.append(v.to_dict())
+ _dict['routes'] = routes_list
+ if hasattr(self, 'total_count') and self.total_count is not None:
+ _dict['total_count'] = self.total_count
return _dict
def _to_dict(self):
@@ -88348,211 +91053,118 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this BareMetalServerNetworkInterfaceByVLAN object."""
+ """Return a `str` version of this VPNServerRouteCollection object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'BareMetalServerNetworkInterfaceByVLAN') -> bool:
+ def __eq__(self, other: 'VPNServerRouteCollection') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'BareMetalServerNetworkInterfaceByVLAN') -> bool:
+ def __ne__(self, other: 'VPNServerRouteCollection') -> 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 VPNServerRouteCollectionFirst:
+ """
+ A link to the first page of resources.
+ :param str href: The URL for a page of resources.
+ """
- class StatusEnum(str, Enum):
- """
- The status of the bare metal server network interface.
+ def __init__(
+ self,
+ href: str,
+ ) -> None:
"""
+ Initialize a VPNServerRouteCollectionFirst object.
- AVAILABLE = 'available'
- DELETING = 'deleting'
- FAILED = 'failed'
- PENDING = 'pending'
+ :param str href: The URL for a page of resources.
+ """
+ self.href = href
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'VPNServerRouteCollectionFirst':
+ """Initialize a VPNServerRouteCollectionFirst object from a json dictionary."""
+ args = {}
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
+ else:
+ raise ValueError('Required property \'href\' not present in VPNServerRouteCollectionFirst JSON')
+ return cls(**args)
- class TypeEnum(str, Enum):
- """
- The bare metal server network interface type.
- """
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a VPNServerRouteCollectionFirst object from a json dictionary."""
+ return cls.from_dict(_dict)
- PRIMARY = 'primary'
- SECONDARY = 'secondary'
+ 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 InterfaceTypeEnum(str, Enum):
- """
- - `vlan`: a virtual device, used through a `pci` device that has the `vlan` in its
- array
- of `allowed_vlans`.
- - Must use an IEEE 802.1Q tag.
- - Has its own security groups and does not inherit those of the PCI device
- through
- which traffic flows.
- """
+ def __str__(self) -> str:
+ """Return a `str` version of this VPNServerRouteCollectionFirst object."""
+ return json.dumps(self.to_dict(), indent=2)
- VLAN = 'vlan'
+ def __eq__(self, other: 'VPNServerRouteCollectionFirst') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+ def __ne__(self, other: 'VPNServerRouteCollectionFirst') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
-class BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype(BareMetalServerNetworkInterfacePrototype):
+class VPNServerRouteCollectionNext:
"""
- BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype.
+ 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 bare metal server network interface.
- :attr bool enable_infrastructure_nat: (optional) If `true`:
- - The VPC infrastructure performs any needed NAT operations.
- - `floating_ips` must not have more than one floating IP.
- If `false`:
- - Packets are passed unchanged to/from the bare metal server network interface,
- allowing the workload to perform any needed NAT operations.
- - `allow_ip_spoofing` must be `false`.
- - `interface_type` must not be `hipersocket`.
- :attr str name: (optional) The name for this bare metal server network
- interface. The name must not be used by another network interface on the bare
- metal server. If unspecified, the name will be a hyphenated list of
- randomly-selected words.
- :attr NetworkInterfaceIPPrototype primary_ip: (optional) The primary IP address
- to bind to the bare metal server network interface. This can be specified using
- an existing reserved IP, or a prototype object for a new reserved IP.
- If an existing reserved IP or a prototype object with an address is specified,
- it must be available on the bare metal server network interface's subnet.
- Otherwise, an available address on the subnet will be automatically selected and
- reserved.
- :attr List[SecurityGroupIdentity] security_groups: (optional) The security
- groups to use for this bare metal server network interface. If unspecified, the
- VPC's default security group is used.
- :attr SubnetIdentity subnet: The associated subnet.
- :attr str interface_type: - `hipersocket`: a virtual network device that
- provides high-speed TCP/IP connectivity
- within a `s390x` based system.
- - Not supported on bare metal servers with a `cpu.architecture` of `amd64`.
+ :param str href: The URL for a page of resources.
"""
def __init__(
self,
- subnet: 'SubnetIdentity',
- interface_type: str,
- *,
- allow_ip_spoofing: bool = None,
- enable_infrastructure_nat: bool = None,
- name: str = None,
- primary_ip: 'NetworkInterfaceIPPrototype' = None,
- security_groups: List['SecurityGroupIdentity'] = None,
+ href: str,
) -> None:
"""
- Initialize a BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype object.
+ Initialize a VPNServerRouteCollectionNext object.
- :param SubnetIdentity subnet: The associated subnet.
- :param str interface_type: - `hipersocket`: a virtual network device that
- provides high-speed TCP/IP connectivity
- within a `s390x` based system.
- - Not supported on bare metal servers with a `cpu.architecture` of
- `amd64`.
- :param bool allow_ip_spoofing: (optional) Indicates whether source IP
- spoofing is allowed on this bare metal server network interface.
- :param bool enable_infrastructure_nat: (optional) If `true`:
- - The VPC infrastructure performs any needed NAT operations.
- - `floating_ips` must not have more than one floating IP.
- If `false`:
- - Packets are passed unchanged to/from the bare metal server network
- interface,
- allowing the workload to perform any needed NAT operations.
- - `allow_ip_spoofing` must be `false`.
- - `interface_type` must not be `hipersocket`.
- :param str name: (optional) The name for this bare metal server network
- interface. The name must not be used by another network interface on the
- bare metal server. If unspecified, the name will be a hyphenated list of
- randomly-selected words.
- :param NetworkInterfaceIPPrototype primary_ip: (optional) The primary IP
- address to bind to the bare metal server network interface. This can be
- specified using an existing reserved IP, or a prototype object for a new
- reserved IP.
- If an existing reserved IP or a prototype object with an address is
- specified, it must be available on the bare metal server network
- interface's subnet. Otherwise, an available address on the subnet will be
- automatically selected and reserved.
- :param List[SecurityGroupIdentity] security_groups: (optional) The security
- groups to use for this bare metal server network interface. If unspecified,
- the VPC's default security group is used.
+ :param str href: The URL for a page of resources.
"""
- # pylint: disable=super-init-not-called
- self.allow_ip_spoofing = allow_ip_spoofing
- self.enable_infrastructure_nat = enable_infrastructure_nat
- self.name = name
- self.primary_ip = primary_ip
- self.security_groups = security_groups
- self.subnet = subnet
- self.interface_type = interface_type
+ self.href = href
@classmethod
- def from_dict(cls, _dict: Dict) -> 'BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype':
- """Initialize a BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VPNServerRouteCollectionNext':
+ """Initialize a VPNServerRouteCollectionNext object from a json dictionary."""
args = {}
- if 'allow_ip_spoofing' in _dict:
- args['allow_ip_spoofing'] = _dict.get('allow_ip_spoofing')
- if 'enable_infrastructure_nat' in _dict:
- args['enable_infrastructure_nat'] = _dict.get('enable_infrastructure_nat')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
- if 'primary_ip' in _dict:
- args['primary_ip'] = _dict.get('primary_ip')
- if 'security_groups' in _dict:
- args['security_groups'] = _dict.get('security_groups')
- if 'subnet' in _dict:
- args['subnet'] = _dict.get('subnet')
- else:
- raise ValueError('Required property \'subnet\' not present in BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype JSON')
- if 'interface_type' in _dict:
- args['interface_type'] = _dict.get('interface_type')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'interface_type\' not present in BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype JSON')
+ raise ValueError('Required property \'href\' not present in VPNServerRouteCollectionNext JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype object from a json dictionary."""
+ """Initialize a VPNServerRouteCollectionNext object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'allow_ip_spoofing') and self.allow_ip_spoofing is not None:
- _dict['allow_ip_spoofing'] = self.allow_ip_spoofing
- if hasattr(self, 'enable_infrastructure_nat') and self.enable_infrastructure_nat is not None:
- _dict['enable_infrastructure_nat'] = self.enable_infrastructure_nat
- if hasattr(self, 'name') and self.name is not None:
- _dict['name'] = self.name
- if hasattr(self, 'primary_ip') and self.primary_ip is not None:
- if isinstance(self.primary_ip, dict):
- _dict['primary_ip'] = self.primary_ip
- else:
- _dict['primary_ip'] = self.primary_ip.to_dict()
- if hasattr(self, 'security_groups') and self.security_groups is not None:
- security_groups_list = []
- for v in self.security_groups:
- if isinstance(v, dict):
- security_groups_list.append(v)
- else:
- security_groups_list.append(v.to_dict())
- _dict['security_groups'] = security_groups_list
- if hasattr(self, 'subnet') and self.subnet is not None:
- if isinstance(self.subnet, dict):
- _dict['subnet'] = self.subnet
- else:
- _dict['subnet'] = self.subnet.to_dict()
- if hasattr(self, 'interface_type') and self.interface_type is not None:
- _dict['interface_type'] = self.interface_type
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
return _dict
def _to_dict(self):
@@ -88560,198 +91172,81 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype object."""
+ """Return a `str` version of this VPNServerRouteCollectionNext object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype') -> bool:
+ def __eq__(self, other: 'VPNServerRouteCollectionNext') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype') -> bool:
+ def __ne__(self, other: 'VPNServerRouteCollectionNext') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class InterfaceTypeEnum(str, Enum):
- """
- - `hipersocket`: a virtual network device that provides high-speed TCP/IP
- connectivity
- within a `s390x` based system.
- - Not supported on bare metal servers with a `cpu.architecture` of `amd64`.
- """
-
- HIPERSOCKET = 'hipersocket'
-
+class VPNServerRouteHealthReason:
+ """
+ VPNServerRouteHealthReason.
-class BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPCIPrototype(BareMetalServerNetworkInterfacePrototype):
- """
- BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPCIPrototype.
-
- :attr bool allow_ip_spoofing: (optional) Indicates whether source IP spoofing is
- allowed on this bare metal server network interface.
- :attr bool enable_infrastructure_nat: (optional) If `true`:
- - The VPC infrastructure performs any needed NAT operations.
- - `floating_ips` must not have more than one floating IP.
- If `false`:
- - Packets are passed unchanged to/from the bare metal server network interface,
- allowing the workload to perform any needed NAT operations.
- - `allow_ip_spoofing` must be `false`.
- - `interface_type` must not be `hipersocket`.
- :attr str name: (optional) The name for this bare metal server network
- interface. The name must not be used by another network interface on the bare
- metal server. If unspecified, the name will be a hyphenated list of
- randomly-selected words.
- :attr NetworkInterfaceIPPrototype primary_ip: (optional) The primary IP address
- to bind to the bare metal server network interface. This can be specified using
- an existing reserved IP, or a prototype object for a new reserved IP.
- If an existing reserved IP or a prototype object with an address is specified,
- it must be available on the bare metal server network interface's subnet.
- Otherwise, an available address on the subnet will be automatically selected and
- reserved.
- :attr List[SecurityGroupIdentity] security_groups: (optional) The security
- groups to use for this bare metal server network interface. If unspecified, the
- VPC's default security group is used.
- :attr SubnetIdentity subnet: The associated subnet.
- :attr List[int] allowed_vlans: (optional) The VLAN IDs to allow for `vlan`
- interfaces using this PCI interface.
- :attr str interface_type: - `pci`: a physical PCI device which can only be
- created or deleted when the bare metal
- server is stopped
- - Has an `allowed_vlans` property which controls the VLANs that will be
- permitted
- to use the PCI interface
- - Cannot directly use an IEEE 802.1Q tag.
- - Not supported on bare metal servers with a `cpu.architecture` of `s390x`.
+ :param str code: A snake case string succinctly identifying the reason for this
+ health state.
+ :param str message: An explanation of the reason for this health state.
+ :param str more_info: (optional) Link to documentation about the reason for this
+ health state.
"""
def __init__(
self,
- subnet: 'SubnetIdentity',
- interface_type: str,
+ code: str,
+ message: str,
*,
- allow_ip_spoofing: bool = None,
- enable_infrastructure_nat: bool = None,
- name: str = None,
- primary_ip: 'NetworkInterfaceIPPrototype' = None,
- security_groups: List['SecurityGroupIdentity'] = None,
- allowed_vlans: List[int] = None,
+ more_info: Optional[str] = None,
) -> None:
"""
- Initialize a BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPCIPrototype object.
+ Initialize a VPNServerRouteHealthReason object.
- :param SubnetIdentity subnet: The associated subnet.
- :param str interface_type: - `pci`: a physical PCI device which can only be
- created or deleted when the bare metal
- server is stopped
- - Has an `allowed_vlans` property which controls the VLANs that will be
- permitted
- to use the PCI interface
- - Cannot directly use an IEEE 802.1Q tag.
- - Not supported on bare metal servers with a `cpu.architecture` of
- `s390x`.
- :param bool allow_ip_spoofing: (optional) Indicates whether source IP
- spoofing is allowed on this bare metal server network interface.
- :param bool enable_infrastructure_nat: (optional) If `true`:
- - The VPC infrastructure performs any needed NAT operations.
- - `floating_ips` must not have more than one floating IP.
- If `false`:
- - Packets are passed unchanged to/from the bare metal server network
- interface,
- allowing the workload to perform any needed NAT operations.
- - `allow_ip_spoofing` must be `false`.
- - `interface_type` must not be `hipersocket`.
- :param str name: (optional) The name for this bare metal server network
- interface. The name must not be used by another network interface on the
- bare metal server. If unspecified, the name will be a hyphenated list of
- randomly-selected words.
- :param NetworkInterfaceIPPrototype primary_ip: (optional) The primary IP
- address to bind to the bare metal server network interface. This can be
- specified using an existing reserved IP, or a prototype object for a new
- reserved IP.
- If an existing reserved IP or a prototype object with an address is
- specified, it must be available on the bare metal server network
- interface's subnet. Otherwise, an available address on the subnet will be
- automatically selected and reserved.
- :param List[SecurityGroupIdentity] security_groups: (optional) The security
- groups to use for this bare metal server network interface. If unspecified,
- the VPC's default security group is used.
- :param List[int] allowed_vlans: (optional) The VLAN IDs to allow for `vlan`
- interfaces using this PCI interface.
+ :param str code: A snake case string succinctly identifying the reason for
+ this health state.
+ :param str message: An explanation of the reason for this health state.
+ :param str more_info: (optional) Link to documentation about the reason for
+ this health state.
"""
- # pylint: disable=super-init-not-called
- self.allow_ip_spoofing = allow_ip_spoofing
- self.enable_infrastructure_nat = enable_infrastructure_nat
- self.name = name
- self.primary_ip = primary_ip
- self.security_groups = security_groups
- self.subnet = subnet
- self.allowed_vlans = allowed_vlans
- self.interface_type = interface_type
+ self.code = code
+ self.message = message
+ self.more_info = more_info
@classmethod
- def from_dict(cls, _dict: Dict) -> 'BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPCIPrototype':
- """Initialize a BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPCIPrototype object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VPNServerRouteHealthReason':
+ """Initialize a VPNServerRouteHealthReason object from a json dictionary."""
args = {}
- if 'allow_ip_spoofing' in _dict:
- args['allow_ip_spoofing'] = _dict.get('allow_ip_spoofing')
- if 'enable_infrastructure_nat' in _dict:
- args['enable_infrastructure_nat'] = _dict.get('enable_infrastructure_nat')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
- if 'primary_ip' in _dict:
- args['primary_ip'] = _dict.get('primary_ip')
- if 'security_groups' in _dict:
- args['security_groups'] = _dict.get('security_groups')
- if 'subnet' in _dict:
- args['subnet'] = _dict.get('subnet')
+ if (code := _dict.get('code')) is not None:
+ args['code'] = code
else:
- raise ValueError('Required property \'subnet\' not present in BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPCIPrototype JSON')
- if 'allowed_vlans' in _dict:
- args['allowed_vlans'] = _dict.get('allowed_vlans')
- if 'interface_type' in _dict:
- args['interface_type'] = _dict.get('interface_type')
+ raise ValueError('Required property \'code\' not present in VPNServerRouteHealthReason JSON')
+ if (message := _dict.get('message')) is not None:
+ args['message'] = message
else:
- raise ValueError('Required property \'interface_type\' not present in BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPCIPrototype JSON')
+ raise ValueError('Required property \'message\' not present in VPNServerRouteHealthReason JSON')
+ if (more_info := _dict.get('more_info')) is not None:
+ args['more_info'] = more_info
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPCIPrototype object from a json dictionary."""
+ """Initialize a VPNServerRouteHealthReason object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'allow_ip_spoofing') and self.allow_ip_spoofing is not None:
- _dict['allow_ip_spoofing'] = self.allow_ip_spoofing
- if hasattr(self, 'enable_infrastructure_nat') and self.enable_infrastructure_nat is not None:
- _dict['enable_infrastructure_nat'] = self.enable_infrastructure_nat
- if hasattr(self, 'name') and self.name is not None:
- _dict['name'] = self.name
- if hasattr(self, 'primary_ip') and self.primary_ip is not None:
- if isinstance(self.primary_ip, dict):
- _dict['primary_ip'] = self.primary_ip
- else:
- _dict['primary_ip'] = self.primary_ip.to_dict()
- if hasattr(self, 'security_groups') and self.security_groups is not None:
- security_groups_list = []
- for v in self.security_groups:
- if isinstance(v, dict):
- security_groups_list.append(v)
- else:
- security_groups_list.append(v.to_dict())
- _dict['security_groups'] = security_groups_list
- if hasattr(self, 'subnet') and self.subnet is not None:
- if isinstance(self.subnet, dict):
- _dict['subnet'] = self.subnet
- else:
- _dict['subnet'] = self.subnet.to_dict()
- if hasattr(self, 'allowed_vlans') and self.allowed_vlans is not None:
- _dict['allowed_vlans'] = self.allowed_vlans
- if hasattr(self, 'interface_type') and self.interface_type is not None:
- _dict['interface_type'] = self.interface_type
+ if hasattr(self, '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):
@@ -88759,231 +91254,89 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPCIPrototype object."""
+ """Return a `str` version of this VPNServerRouteHealthReason object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPCIPrototype') -> bool:
+ def __eq__(self, other: 'VPNServerRouteHealthReason') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPCIPrototype') -> bool:
+ def __ne__(self, other: 'VPNServerRouteHealthReason') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class InterfaceTypeEnum(str, Enum):
+ class CodeEnum(str, Enum):
"""
- - `pci`: a physical PCI device which can only be created or deleted when the bare
- metal
- server is stopped
- - Has an `allowed_vlans` property which controls the VLANs that will be
- permitted
- to use the PCI interface
- - Cannot directly use an IEEE 802.1Q tag.
- - Not supported on bare metal servers with a `cpu.architecture` of `s390x`.
+ A snake case string succinctly identifying the reason for this health state.
"""
- PCI = 'pci'
+ INTERNAL_ERROR = 'internal_error'
-class BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVLANPrototype(BareMetalServerNetworkInterfacePrototype):
+class VPNServerRouteLifecycleReason:
"""
- BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVLANPrototype.
+ VPNServerRouteLifecycleReason.
- :attr bool allow_ip_spoofing: (optional) Indicates whether source IP spoofing is
- allowed on this bare metal server network interface.
- :attr bool enable_infrastructure_nat: (optional) If `true`:
- - The VPC infrastructure performs any needed NAT operations.
- - `floating_ips` must not have more than one floating IP.
- If `false`:
- - Packets are passed unchanged to/from the bare metal server network interface,
- allowing the workload to perform any needed NAT operations.
- - `allow_ip_spoofing` must be `false`.
- - `interface_type` must not be `hipersocket`.
- :attr str name: (optional) The name for this bare metal server network
- interface. The name must not be used by another network interface on the bare
- metal server. If unspecified, the name will be a hyphenated list of
- randomly-selected words.
- :attr NetworkInterfaceIPPrototype primary_ip: (optional) The primary IP address
- to bind to the bare metal server network interface. This can be specified using
- an existing reserved IP, or a prototype object for a new reserved IP.
- If an existing reserved IP or a prototype object with an address is specified,
- it must be available on the bare metal server network interface's subnet.
- Otherwise, an available address on the subnet will be automatically selected and
- reserved.
- :attr List[SecurityGroupIdentity] security_groups: (optional) The security
- groups to use for this bare metal server network interface. If unspecified, the
- VPC's default security group is used.
- :attr SubnetIdentity subnet: The associated subnet.
- :attr bool allow_interface_to_float: (optional) Indicates if the data path for
- the network interface can float to another bare metal server. Can only be `true`
- for network interfaces with an `interface_type` of `vlan`.
- If `true`, and the network detects traffic for this data path on another bare
- metal server in the resource group, the network interface will be automatically
- deleted from this bare metal server and a new network interface with the same
- `id`, `name` and `vlan` will be created on the other bare metal server.
- For the data path to float, the other bare metal server must be in the same
- `resource_group`, and must have a network interface with `interface_type` of
- `pci` with `allowed_vlans` including this network interface's `vlan`.
- :attr str interface_type: - `vlan`: a virtual device, used through a `pci`
- device that has the `vlan` in its array
- of `allowed_vlans`.
- - Must use an IEEE 802.1Q tag.
- - Has its own security groups and does not inherit those of the PCI device
- through
- which traffic flows.
- - Not supported on bare metal servers with a `cpu.architecture` of `s390x`.
- :attr int vlan: The VLAN ID used in the IEEE 802.1Q tag present in all traffic
- on this interface.
+ :param str code: A snake case string succinctly identifying the reason for this
+ lifecycle state.
+ :param str message: An explanation of the reason for this lifecycle state.
+ :param str more_info: (optional) Link to documentation about the reason for this
+ lifecycle state.
"""
def __init__(
self,
- subnet: 'SubnetIdentity',
- interface_type: str,
- vlan: int,
+ code: str,
+ message: str,
*,
- allow_ip_spoofing: bool = None,
- enable_infrastructure_nat: bool = None,
- name: str = None,
- primary_ip: 'NetworkInterfaceIPPrototype' = None,
- security_groups: List['SecurityGroupIdentity'] = None,
- allow_interface_to_float: bool = None,
+ more_info: Optional[str] = None,
) -> None:
"""
- Initialize a BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVLANPrototype object.
+ Initialize a VPNServerRouteLifecycleReason object.
- :param SubnetIdentity subnet: The associated subnet.
- :param str interface_type: - `vlan`: a virtual device, used through a `pci`
- device that has the `vlan` in its array
- of `allowed_vlans`.
- - Must use an IEEE 802.1Q tag.
- - Has its own security groups and does not inherit those of the PCI
- device through
- which traffic flows.
- - Not supported on bare metal servers with a `cpu.architecture` of
- `s390x`.
- :param int vlan: The VLAN ID used in the IEEE 802.1Q tag present in all
- traffic on this interface.
- :param bool allow_ip_spoofing: (optional) Indicates whether source IP
- spoofing is allowed on this bare metal server network interface.
- :param bool enable_infrastructure_nat: (optional) If `true`:
- - The VPC infrastructure performs any needed NAT operations.
- - `floating_ips` must not have more than one floating IP.
- If `false`:
- - Packets are passed unchanged to/from the bare metal server network
- interface,
- allowing the workload to perform any needed NAT operations.
- - `allow_ip_spoofing` must be `false`.
- - `interface_type` must not be `hipersocket`.
- :param str name: (optional) The name for this bare metal server network
- interface. The name must not be used by another network interface on the
- bare metal server. If unspecified, the name will be a hyphenated list of
- randomly-selected words.
- :param NetworkInterfaceIPPrototype primary_ip: (optional) The primary IP
- address to bind to the bare metal server network interface. This can be
- specified using an existing reserved IP, or a prototype object for a new
- reserved IP.
- If an existing reserved IP or a prototype object with an address is
- specified, it must be available on the bare metal server network
- interface's subnet. Otherwise, an available address on the subnet will be
- automatically selected and reserved.
- :param List[SecurityGroupIdentity] security_groups: (optional) The security
- groups to use for this bare metal server network interface. If unspecified,
- the VPC's default security group is used.
- :param bool allow_interface_to_float: (optional) Indicates if the data path
- for the network interface can float to another bare metal server. Can only
- be `true` for network interfaces with an `interface_type` of `vlan`.
- If `true`, and the network detects traffic for this data path on another
- bare metal server in the resource group, the network interface will be
- automatically deleted from this bare metal server and a new network
- interface with the same `id`, `name` and `vlan` will be created on the
- other bare metal server.
- For the data path to float, the other bare metal server must be in the same
- `resource_group`, and must have a network interface with `interface_type`
- of `pci` with `allowed_vlans` including this network interface's `vlan`.
+ :param str code: A snake case string succinctly identifying the reason for
+ this lifecycle state.
+ :param str message: An explanation of the reason for this lifecycle state.
+ :param str more_info: (optional) Link to documentation about the reason for
+ this lifecycle state.
"""
- # pylint: disable=super-init-not-called
- self.allow_ip_spoofing = allow_ip_spoofing
- self.enable_infrastructure_nat = enable_infrastructure_nat
- self.name = name
- self.primary_ip = primary_ip
- self.security_groups = security_groups
- self.subnet = subnet
- self.allow_interface_to_float = allow_interface_to_float
- self.interface_type = interface_type
- self.vlan = vlan
+ self.code = code
+ self.message = message
+ self.more_info = more_info
@classmethod
- def from_dict(cls, _dict: Dict) -> 'BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVLANPrototype':
- """Initialize a BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVLANPrototype object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VPNServerRouteLifecycleReason':
+ """Initialize a VPNServerRouteLifecycleReason object from a json dictionary."""
args = {}
- if 'allow_ip_spoofing' in _dict:
- args['allow_ip_spoofing'] = _dict.get('allow_ip_spoofing')
- if 'enable_infrastructure_nat' in _dict:
- args['enable_infrastructure_nat'] = _dict.get('enable_infrastructure_nat')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
- if 'primary_ip' in _dict:
- args['primary_ip'] = _dict.get('primary_ip')
- if 'security_groups' in _dict:
- args['security_groups'] = _dict.get('security_groups')
- if 'subnet' in _dict:
- args['subnet'] = _dict.get('subnet')
- else:
- raise ValueError('Required property \'subnet\' not present in BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVLANPrototype JSON')
- if 'allow_interface_to_float' in _dict:
- args['allow_interface_to_float'] = _dict.get('allow_interface_to_float')
- if 'interface_type' in _dict:
- args['interface_type'] = _dict.get('interface_type')
+ if (code := _dict.get('code')) is not None:
+ args['code'] = code
else:
- raise ValueError('Required property \'interface_type\' not present in BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVLANPrototype JSON')
- if 'vlan' in _dict:
- args['vlan'] = _dict.get('vlan')
+ raise ValueError('Required property \'code\' not present in VPNServerRouteLifecycleReason JSON')
+ if (message := _dict.get('message')) is not None:
+ args['message'] = message
else:
- raise ValueError('Required property \'vlan\' not present in BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVLANPrototype JSON')
+ raise ValueError('Required property \'message\' not present in VPNServerRouteLifecycleReason JSON')
+ if (more_info := _dict.get('more_info')) is not None:
+ args['more_info'] = more_info
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVLANPrototype object from a json dictionary."""
+ """Initialize a VPNServerRouteLifecycleReason object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'allow_ip_spoofing') and self.allow_ip_spoofing is not None:
- _dict['allow_ip_spoofing'] = self.allow_ip_spoofing
- if hasattr(self, 'enable_infrastructure_nat') and self.enable_infrastructure_nat is not None:
- _dict['enable_infrastructure_nat'] = self.enable_infrastructure_nat
- if hasattr(self, 'name') and self.name is not None:
- _dict['name'] = self.name
- if hasattr(self, 'primary_ip') and self.primary_ip is not None:
- if isinstance(self.primary_ip, dict):
- _dict['primary_ip'] = self.primary_ip
- else:
- _dict['primary_ip'] = self.primary_ip.to_dict()
- if hasattr(self, 'security_groups') and self.security_groups is not None:
- security_groups_list = []
- for v in self.security_groups:
- if isinstance(v, dict):
- security_groups_list.append(v)
- else:
- security_groups_list.append(v.to_dict())
- _dict['security_groups'] = security_groups_list
- if hasattr(self, 'subnet') and self.subnet is not None:
- if isinstance(self.subnet, dict):
- _dict['subnet'] = self.subnet
- else:
- _dict['subnet'] = self.subnet.to_dict()
- if hasattr(self, 'allow_interface_to_float') and self.allow_interface_to_float is not None:
- _dict['allow_interface_to_float'] = self.allow_interface_to_float
- if hasattr(self, 'interface_type') and self.interface_type is not None:
- _dict['interface_type'] = self.interface_type
- if hasattr(self, 'vlan') and self.vlan is not None:
- _dict['vlan'] = self.vlan
+ if hasattr(self, '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):
@@ -88991,75 +91344,67 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVLANPrototype object."""
+ """Return a `str` version of this VPNServerRouteLifecycleReason object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVLANPrototype') -> bool:
+ def __eq__(self, other: 'VPNServerRouteLifecycleReason') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVLANPrototype') -> bool:
+ def __ne__(self, other: 'VPNServerRouteLifecycleReason') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class InterfaceTypeEnum(str, Enum):
+ class CodeEnum(str, Enum):
"""
- - `vlan`: a virtual device, used through a `pci` device that has the `vlan` in its
- array
- of `allowed_vlans`.
- - Must use an IEEE 802.1Q tag.
- - Has its own security groups and does not inherit those of the PCI device
- through
- which traffic flows.
- - Not supported on bare metal servers with a `cpu.architecture` of `s390x`.
+ A snake case string succinctly identifying the reason for this lifecycle state.
"""
- VLAN = 'vlan'
+ RESOURCE_SUSPENDED_BY_PROVIDER = 'resource_suspended_by_provider'
-class BareMetalServerProfileBandwidthDependent(BareMetalServerProfileBandwidth):
+class VPNServerRoutePatch:
"""
- The total bandwidth shared across the bare metal server network interfaces of a bare
- metal server with this profile depends on its configuration.
+ VPNServerRoutePatch.
- :attr str type: The type for this profile field.
+ :param str name: (optional) The name for this VPN server route. The name must
+ not be used by another route for the VPN server.
"""
def __init__(
self,
- type: str,
+ *,
+ name: Optional[str] = None,
) -> None:
"""
- Initialize a BareMetalServerProfileBandwidthDependent object.
+ Initialize a VPNServerRoutePatch object.
- :param str type: The type for this profile field.
+ :param str name: (optional) The name for this VPN server route. The name
+ must not be used by another route for the VPN server.
"""
- # pylint: disable=super-init-not-called
- self.type = type
+ self.name = name
@classmethod
- def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileBandwidthDependent':
- """Initialize a BareMetalServerProfileBandwidthDependent object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VPNServerRoutePatch':
+ """Initialize a VPNServerRoutePatch object from a json dictionary."""
args = {}
- if 'type' in _dict:
- args['type'] = _dict.get('type')
- else:
- raise ValueError('Required property \'type\' not present in BareMetalServerProfileBandwidthDependent JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a BareMetalServerProfileBandwidthDependent object from a json dictionary."""
+ """Initialize a VPNServerRoutePatch object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'type') and self.type is not None:
- _dict['type'] = self.type
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
return _dict
def _to_dict(self):
@@ -89067,88 +91412,312 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this BareMetalServerProfileBandwidthDependent object."""
+ """Return a `str` version of this VPNServerRoutePatch object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'BareMetalServerProfileBandwidthDependent') -> bool:
+ def __eq__(self, other: 'VPNServerRoutePatch') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'BareMetalServerProfileBandwidthDependent') -> bool:
+ def __ne__(self, other: 'VPNServerRoutePatch') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class TypeEnum(str, Enum):
- """
- The type for this profile field.
- """
-
- DEPENDENT = 'dependent'
-
-
-class BareMetalServerProfileBandwidthEnum(BareMetalServerProfileBandwidth):
+class VirtualNetworkInterface:
"""
- The permitted total bandwidth values (in megabits per second) shared across the bare
- metal server network interfaces of a bare metal server with this profile.
+ VirtualNetworkInterface.
- :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.
+ :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 bool auto_delete: Indicates whether this virtual network interface will
+ be automatically deleted when
+ `target` is deleted.
+ :param datetime created_at: The date and time that the virtual network interface
+ was created.
+ :param str crn: The CRN for this virtual network interface.
+ :param bool enable_infrastructure_nat: If `true`:
+ - The VPC infrastructure performs any needed NAT operations.
+ - `floating_ips` must not have more than one floating IP.
+ If `false`:
+ - Packets are passed unchanged to/from the virtual network interface,
+ allowing the workload to perform any needed NAT operations.
+ - `allow_ip_spoofing` must be `false`.
+ - Can only be attached to a `target` with a `resource_type` of
+ `bare_metal_server_network_attachment`.
+ :param str href: The URL for this virtual network interface.
+ :param str id: The unique identifier for this virtual network interface.
+ :param List[ReservedIPReference] ips: The reserved IPs bound to this virtual
+ network interface.
+ May be empty when `lifecycle_state` is `pending`.
+ :param str lifecycle_state: The lifecycle state of the virtual network
+ interface.
+ :param str mac_address: (optional) The MAC address of the virtual network
+ interface. May be absent if `lifecycle_state` is `pending`.
+ :param str name: The name for this virtual network interface. The name is unique
+ across all virtual network interfaces in the VPC.
+ :param ReservedIPReference primary_ip: The reserved IP for this virtual network
+ interface.
+ :param ResourceGroupReference resource_group: The resource group for this
+ virtual network interface.
+ :param str resource_type: The resource type.
+ :param List[SecurityGroupReference] security_groups: The security groups for
+ this virtual network interface.
+ :param SubnetReference subnet: The associated subnet.
+ :param VirtualNetworkInterfaceTarget target: (optional) The target of this
+ virtual network interface.
+ If absent, this virtual network interface is not attached to a target.
+ :param VPCReference vpc: The VPC this virtual network interface resides in.
+ :param ZoneReference zone: The zone this virtual network interface resides in.
"""
def __init__(
self,
- default: int,
- type: str,
- values: List[int],
+ allow_ip_spoofing: bool,
+ auto_delete: bool,
+ created_at: datetime,
+ crn: str,
+ enable_infrastructure_nat: bool,
+ href: str,
+ id: str,
+ ips: List['ReservedIPReference'],
+ lifecycle_state: str,
+ name: str,
+ primary_ip: 'ReservedIPReference',
+ resource_group: 'ResourceGroupReference',
+ resource_type: str,
+ security_groups: List['SecurityGroupReference'],
+ subnet: 'SubnetReference',
+ vpc: 'VPCReference',
+ zone: 'ZoneReference',
+ *,
+ mac_address: Optional[str] = None,
+ target: Optional['VirtualNetworkInterfaceTarget'] = None,
) -> None:
"""
- Initialize a BareMetalServerProfileBandwidthEnum object.
+ Initialize a VirtualNetworkInterface object.
- :param int default: The default value for this profile field.
- :param str type: The type for this profile field.
- :param List[int] values: The permitted values for this profile field.
+ :param 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 bool auto_delete: Indicates whether this virtual network interface
+ will be automatically deleted when
+ `target` is deleted.
+ :param datetime created_at: The date and time that the virtual network
+ interface was created.
+ :param str crn: The CRN for this virtual network interface.
+ :param bool enable_infrastructure_nat: If `true`:
+ - The VPC infrastructure performs any needed NAT operations.
+ - `floating_ips` must not have more than one floating IP.
+ If `false`:
+ - Packets are passed unchanged to/from the virtual network interface,
+ allowing the workload to perform any needed NAT operations.
+ - `allow_ip_spoofing` must be `false`.
+ - Can only be attached to a `target` with a `resource_type` of
+ `bare_metal_server_network_attachment`.
+ :param str href: The URL for this virtual network interface.
+ :param str id: The unique identifier for this virtual network interface.
+ :param List[ReservedIPReference] ips: The reserved IPs bound to this
+ virtual network interface.
+ May be empty when `lifecycle_state` is `pending`.
+ :param str lifecycle_state: The lifecycle state of the virtual network
+ interface.
+ :param str name: The name for this virtual network interface. The name is
+ unique across all virtual network interfaces in the VPC.
+ :param ReservedIPReference primary_ip: The reserved IP for this virtual
+ network interface.
+ :param ResourceGroupReference resource_group: The resource group for this
+ virtual network interface.
+ :param str resource_type: The resource type.
+ :param List[SecurityGroupReference] security_groups: The security groups
+ for this virtual network interface.
+ :param SubnetReference subnet: The associated subnet.
+ :param VPCReference vpc: The VPC this virtual network interface resides in.
+ :param ZoneReference zone: The zone this virtual network interface resides
+ in.
+ :param str mac_address: (optional) The MAC address of the virtual network
+ interface. May be absent if `lifecycle_state` is `pending`.
+ :param VirtualNetworkInterfaceTarget target: (optional) The target of this
+ virtual network interface.
+ If absent, this virtual network interface is not attached to a target.
"""
- # pylint: disable=super-init-not-called
- self.default = default
- self.type = type
- self.values = values
+ self.allow_ip_spoofing = allow_ip_spoofing
+ self.auto_delete = auto_delete
+ self.created_at = created_at
+ self.crn = crn
+ self.enable_infrastructure_nat = enable_infrastructure_nat
+ self.href = href
+ self.id = id
+ self.ips = ips
+ self.lifecycle_state = lifecycle_state
+ self.mac_address = mac_address
+ self.name = name
+ self.primary_ip = primary_ip
+ self.resource_group = resource_group
+ self.resource_type = resource_type
+ self.security_groups = security_groups
+ self.subnet = subnet
+ self.target = target
+ self.vpc = vpc
+ self.zone = zone
@classmethod
- def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileBandwidthEnum':
- """Initialize a BareMetalServerProfileBandwidthEnum object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VirtualNetworkInterface':
+ """Initialize a VirtualNetworkInterface object from a json dictionary."""
args = {}
- if 'default' in _dict:
- args['default'] = _dict.get('default')
+ if (allow_ip_spoofing := _dict.get('allow_ip_spoofing')) is not None:
+ args['allow_ip_spoofing'] = allow_ip_spoofing
else:
- raise ValueError('Required property \'default\' not present in BareMetalServerProfileBandwidthEnum JSON')
- if 'type' in _dict:
- args['type'] = _dict.get('type')
+ raise ValueError('Required property \'allow_ip_spoofing\' not present in VirtualNetworkInterface JSON')
+ if (auto_delete := _dict.get('auto_delete')) is not None:
+ args['auto_delete'] = auto_delete
else:
- raise ValueError('Required property \'type\' not present in BareMetalServerProfileBandwidthEnum JSON')
- if 'values' in _dict:
- args['values'] = _dict.get('values')
+ raise ValueError('Required property \'auto_delete\' not present in VirtualNetworkInterface JSON')
+ if (created_at := _dict.get('created_at')) is not None:
+ args['created_at'] = string_to_datetime(created_at)
else:
- raise ValueError('Required property \'values\' not present in BareMetalServerProfileBandwidthEnum JSON')
+ raise ValueError('Required property \'created_at\' not present in VirtualNetworkInterface JSON')
+ if (crn := _dict.get('crn')) is not None:
+ args['crn'] = crn
+ else:
+ raise ValueError('Required property \'crn\' not present in VirtualNetworkInterface JSON')
+ if (enable_infrastructure_nat := _dict.get('enable_infrastructure_nat')) is not None:
+ args['enable_infrastructure_nat'] = enable_infrastructure_nat
+ else:
+ raise ValueError('Required property \'enable_infrastructure_nat\' not present in VirtualNetworkInterface JSON')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
+ else:
+ raise ValueError('Required property \'href\' not present in VirtualNetworkInterface JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
+ else:
+ raise ValueError('Required property \'id\' not present in VirtualNetworkInterface JSON')
+ if (ips := _dict.get('ips')) is not None:
+ args['ips'] = [ReservedIPReference.from_dict(v) for v in ips]
+ else:
+ raise ValueError('Required property \'ips\' not present in VirtualNetworkInterface JSON')
+ if (lifecycle_state := _dict.get('lifecycle_state')) is not None:
+ args['lifecycle_state'] = lifecycle_state
+ else:
+ raise ValueError('Required property \'lifecycle_state\' not present in VirtualNetworkInterface JSON')
+ if (mac_address := _dict.get('mac_address')) is not None:
+ args['mac_address'] = mac_address
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ else:
+ raise ValueError('Required property \'name\' not present in VirtualNetworkInterface JSON')
+ if (primary_ip := _dict.get('primary_ip')) is not None:
+ args['primary_ip'] = ReservedIPReference.from_dict(primary_ip)
+ else:
+ raise ValueError('Required property \'primary_ip\' not present in VirtualNetworkInterface JSON')
+ if (resource_group := _dict.get('resource_group')) is not None:
+ args['resource_group'] = ResourceGroupReference.from_dict(resource_group)
+ else:
+ raise ValueError('Required property \'resource_group\' not present in VirtualNetworkInterface JSON')
+ if (resource_type := _dict.get('resource_type')) is not None:
+ args['resource_type'] = resource_type
+ else:
+ raise ValueError('Required property \'resource_type\' not present in VirtualNetworkInterface JSON')
+ if (security_groups := _dict.get('security_groups')) is not None:
+ args['security_groups'] = [SecurityGroupReference.from_dict(v) for v in security_groups]
+ else:
+ raise ValueError('Required property \'security_groups\' not present in VirtualNetworkInterface JSON')
+ if (subnet := _dict.get('subnet')) is not None:
+ args['subnet'] = SubnetReference.from_dict(subnet)
+ else:
+ raise ValueError('Required property \'subnet\' not present in VirtualNetworkInterface JSON')
+ if (target := _dict.get('target')) is not None:
+ args['target'] = target
+ if (vpc := _dict.get('vpc')) is not None:
+ args['vpc'] = VPCReference.from_dict(vpc)
+ else:
+ raise ValueError('Required property \'vpc\' not present in VirtualNetworkInterface JSON')
+ if (zone := _dict.get('zone')) is not None:
+ args['zone'] = ZoneReference.from_dict(zone)
+ else:
+ raise ValueError('Required property \'zone\' not present in VirtualNetworkInterface JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a BareMetalServerProfileBandwidthEnum object from a json dictionary."""
+ """Initialize a VirtualNetworkInterface object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, '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, 'allow_ip_spoofing') and self.allow_ip_spoofing is not None:
+ _dict['allow_ip_spoofing'] = self.allow_ip_spoofing
+ 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, 'enable_infrastructure_nat') and self.enable_infrastructure_nat is not None:
+ _dict['enable_infrastructure_nat'] = self.enable_infrastructure_nat
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
+ if hasattr(self, 'id') and self.id is not None:
+ _dict['id'] = self.id
+ if hasattr(self, 'ips') and self.ips is not None:
+ ips_list = []
+ for v in self.ips:
+ if isinstance(v, dict):
+ ips_list.append(v)
+ else:
+ ips_list.append(v.to_dict())
+ _dict['ips'] = ips_list
+ if hasattr(self, 'lifecycle_state') and self.lifecycle_state is not None:
+ _dict['lifecycle_state'] = self.lifecycle_state
+ if hasattr(self, '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, 'primary_ip') and self.primary_ip is not None:
+ if isinstance(self.primary_ip, dict):
+ _dict['primary_ip'] = self.primary_ip
+ else:
+ _dict['primary_ip'] = self.primary_ip.to_dict()
+ if hasattr(self, 'resource_group') and self.resource_group is not None:
+ if isinstance(self.resource_group, dict):
+ _dict['resource_group'] = self.resource_group
+ else:
+ _dict['resource_group'] = self.resource_group.to_dict()
+ if hasattr(self, 'resource_type') and self.resource_type is not None:
+ _dict['resource_type'] = self.resource_type
+ if hasattr(self, 'security_groups') and self.security_groups is not None:
+ security_groups_list = []
+ for v in self.security_groups:
+ if isinstance(v, dict):
+ security_groups_list.append(v)
+ else:
+ security_groups_list.append(v.to_dict())
+ _dict['security_groups'] = security_groups_list
+ if hasattr(self, 'subnet') and self.subnet is not None:
+ if isinstance(self.subnet, dict):
+ _dict['subnet'] = self.subnet
+ else:
+ _dict['subnet'] = self.subnet.to_dict()
+ if hasattr(self, 'target') and self.target is not None:
+ if isinstance(self.target, dict):
+ _dict['target'] = self.target
+ else:
+ _dict['target'] = self.target.to_dict()
+ if hasattr(self, 'vpc') and self.vpc is not None:
+ if isinstance(self.vpc, dict):
+ _dict['vpc'] = self.vpc
+ else:
+ _dict['vpc'] = self.vpc.to_dict()
+ if hasattr(self, 'zone') and self.zone is not None:
+ if isinstance(self.zone, dict):
+ _dict['zone'] = self.zone
+ else:
+ _dict['zone'] = self.zone.to_dict()
return _dict
def _to_dict(self):
@@ -89156,78 +91725,141 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this BareMetalServerProfileBandwidthEnum object."""
+ """Return a `str` version of this VirtualNetworkInterface object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'BareMetalServerProfileBandwidthEnum') -> bool:
+ def __eq__(self, other: 'VirtualNetworkInterface') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'BareMetalServerProfileBandwidthEnum') -> bool:
+ def __ne__(self, other: 'VirtualNetworkInterface') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class TypeEnum(str, Enum):
+ class LifecycleStateEnum(str, Enum):
"""
- The type for this profile field.
+ The lifecycle state of the virtual network interface.
"""
- ENUM = 'enum'
+ DELETING = 'deleting'
+ FAILED = 'failed'
+ PENDING = 'pending'
+ STABLE = 'stable'
+ SUSPENDED = 'suspended'
+ UPDATING = 'updating'
+ WAITING = 'waiting'
+
+
+ class ResourceTypeEnum(str, Enum):
+ """
+ The resource type.
+ """
+ VIRTUAL_NETWORK_INTERFACE = 'virtual_network_interface'
-class BareMetalServerProfileBandwidthFixed(BareMetalServerProfileBandwidth):
+
+class VirtualNetworkInterfaceCollection:
"""
- The total bandwidth (in megabits per second) shared across the bare metal server
- network interfaces of a bare metal server with this profile.
+ VirtualNetworkInterfaceCollection.
- :attr str type: The type for this profile field.
- :attr int value: The value for this profile field.
+ :param VirtualNetworkInterfaceCollectionFirst first: A link to the first page of
+ resources.
+ :param int limit: The maximum number of resources that can be returned by the
+ request.
+ :param VirtualNetworkInterfaceCollectionNext next: (optional) A link to the next
+ page of resources. This property is present for all pages
+ except the last page.
+ :param int total_count: The total number of resources across all pages.
+ :param List[VirtualNetworkInterface] virtual_network_interfaces: Collection of
+ virtual network interfaces.
"""
def __init__(
self,
- type: str,
- value: int,
+ first: 'VirtualNetworkInterfaceCollectionFirst',
+ limit: int,
+ total_count: int,
+ virtual_network_interfaces: List['VirtualNetworkInterface'],
+ *,
+ next: Optional['VirtualNetworkInterfaceCollectionNext'] = None,
) -> None:
"""
- Initialize a BareMetalServerProfileBandwidthFixed object.
+ Initialize a VirtualNetworkInterfaceCollection object.
- :param str type: The type for this profile field.
- :param int value: The value for this profile field.
+ :param VirtualNetworkInterfaceCollectionFirst first: A link to the first
+ page of resources.
+ :param int limit: The maximum number of resources that can be returned by
+ the request.
+ :param int total_count: The total number of resources across all pages.
+ :param List[VirtualNetworkInterface] virtual_network_interfaces: Collection
+ of virtual network interfaces.
+ :param VirtualNetworkInterfaceCollectionNext next: (optional) A link to the
+ next page of resources. This property is present for all pages
+ except the last page.
"""
- # pylint: disable=super-init-not-called
- self.type = type
- self.value = value
+ self.first = first
+ self.limit = limit
+ self.next = next
+ self.total_count = total_count
+ self.virtual_network_interfaces = virtual_network_interfaces
@classmethod
- def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileBandwidthFixed':
- """Initialize a BareMetalServerProfileBandwidthFixed object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VirtualNetworkInterfaceCollection':
+ """Initialize a VirtualNetworkInterfaceCollection object from a json dictionary."""
args = {}
- if 'type' in _dict:
- args['type'] = _dict.get('type')
+ if (first := _dict.get('first')) is not None:
+ args['first'] = VirtualNetworkInterfaceCollectionFirst.from_dict(first)
else:
- raise ValueError('Required property \'type\' not present in BareMetalServerProfileBandwidthFixed JSON')
- if 'value' in _dict:
- args['value'] = _dict.get('value')
+ raise ValueError('Required property \'first\' not present in VirtualNetworkInterfaceCollection JSON')
+ if (limit := _dict.get('limit')) is not None:
+ args['limit'] = limit
else:
- raise ValueError('Required property \'value\' not present in BareMetalServerProfileBandwidthFixed JSON')
+ raise ValueError('Required property \'limit\' not present in VirtualNetworkInterfaceCollection JSON')
+ if (next := _dict.get('next')) is not None:
+ args['next'] = VirtualNetworkInterfaceCollectionNext.from_dict(next)
+ if (total_count := _dict.get('total_count')) is not None:
+ args['total_count'] = total_count
+ else:
+ raise ValueError('Required property \'total_count\' not present in VirtualNetworkInterfaceCollection JSON')
+ if (virtual_network_interfaces := _dict.get('virtual_network_interfaces')) is not None:
+ args['virtual_network_interfaces'] = [VirtualNetworkInterface.from_dict(v) for v in virtual_network_interfaces]
+ else:
+ raise ValueError('Required property \'virtual_network_interfaces\' not present in VirtualNetworkInterfaceCollection JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a BareMetalServerProfileBandwidthFixed object from a json dictionary."""
+ """Initialize a VirtualNetworkInterfaceCollection object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'type') and self.type is not None:
- _dict['type'] = self.type
- if hasattr(self, 'value') and self.value is not None:
- _dict['value'] = self.value
+ if hasattr(self, 'first') and self.first is not None:
+ if isinstance(self.first, dict):
+ _dict['first'] = self.first
+ else:
+ _dict['first'] = self.first.to_dict()
+ if hasattr(self, 'limit') and self.limit is not None:
+ _dict['limit'] = self.limit
+ if hasattr(self, 'next') and self.next is not None:
+ if isinstance(self.next, dict):
+ _dict['next'] = self.next
+ else:
+ _dict['next'] = self.next.to_dict()
+ if hasattr(self, 'total_count') and self.total_count is not None:
+ _dict['total_count'] = self.total_count
+ if hasattr(self, 'virtual_network_interfaces') and self.virtual_network_interfaces is not None:
+ virtual_network_interfaces_list = []
+ for v in self.virtual_network_interfaces:
+ if isinstance(v, dict):
+ virtual_network_interfaces_list.append(v)
+ else:
+ virtual_network_interfaces_list.append(v.to_dict())
+ _dict['virtual_network_interfaces'] = virtual_network_interfaces_list
return _dict
def _to_dict(self):
@@ -89235,108 +91867,58 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this BareMetalServerProfileBandwidthFixed object."""
+ """Return a `str` version of this VirtualNetworkInterfaceCollection object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'BareMetalServerProfileBandwidthFixed') -> bool:
+ def __eq__(self, other: 'VirtualNetworkInterfaceCollection') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'BareMetalServerProfileBandwidthFixed') -> bool:
+ def __ne__(self, other: 'VirtualNetworkInterfaceCollection') -> 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 BareMetalServerProfileBandwidthRange(BareMetalServerProfileBandwidth):
+class VirtualNetworkInterfaceCollectionFirst:
"""
- The permitted total bandwidth range (in megabits per second) shared across the bare
- metal server network interfaces of a bare metal server with this profile.
+ A link to the first 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.
+ :param str href: The URL for a page of resources.
"""
def __init__(
self,
- default: int,
- max: int,
- min: int,
- step: int,
- type: str,
+ href: str,
) -> None:
"""
- Initialize a BareMetalServerProfileBandwidthRange object.
+ Initialize a VirtualNetworkInterfaceCollectionFirst object.
- :param int default: The default value for this profile field.
- :param int max: The maximum value for this profile field.
- :param int min: The minimum value for this profile field.
- :param int step: The increment step value for this profile field.
- :param str type: The type for this profile field.
+ :param str href: The URL for a page of resources.
"""
- # pylint: disable=super-init-not-called
- self.default = default
- self.max = max
- self.min = min
- self.step = step
- self.type = type
+ self.href = href
@classmethod
- def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileBandwidthRange':
- """Initialize a BareMetalServerProfileBandwidthRange object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VirtualNetworkInterfaceCollectionFirst':
+ """Initialize a VirtualNetworkInterfaceCollectionFirst object from a json dictionary."""
args = {}
- if 'default' in _dict:
- args['default'] = _dict.get('default')
- else:
- raise ValueError('Required property \'default\' not present in BareMetalServerProfileBandwidthRange JSON')
- if 'max' in _dict:
- args['max'] = _dict.get('max')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
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')
+ raise ValueError('Required property \'href\' not present in VirtualNetworkInterfaceCollectionFirst JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a BareMetalServerProfileBandwidthRange object from a json dictionary."""
+ """Initialize a VirtualNetworkInterfaceCollectionFirst object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'default') and self.default is not None:
- _dict['default'] = self.default
- if hasattr(self, 'max') and self.max is not None:
- _dict['max'] = self.max
- if hasattr(self, 'min') and self.min is not None:
- _dict['min'] = self.min
- if hasattr(self, 'step') and self.step is not None:
- _dict['step'] = self.step
- if hasattr(self, 'type') and self.type is not None:
- _dict['type'] = self.type
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
return _dict
def _to_dict(self):
@@ -89344,68 +91926,59 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this BareMetalServerProfileBandwidthRange object."""
+ """Return a `str` version of this VirtualNetworkInterfaceCollectionFirst object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'BareMetalServerProfileBandwidthRange') -> bool:
+ def __eq__(self, other: 'VirtualNetworkInterfaceCollectionFirst') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'BareMetalServerProfileBandwidthRange') -> bool:
+ def __ne__(self, other: 'VirtualNetworkInterfaceCollectionFirst') -> 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 BareMetalServerProfileCPUCoreCountDependent(BareMetalServerProfileCPUCoreCount):
+class VirtualNetworkInterfaceCollectionNext:
"""
- The CPU core count for a bare metal server with this profile depends on its
- configuration.
+ A link to the next page of resources. This property is present for all pages except
+ the last page.
- :attr str type: The type for this profile field.
+ :param str href: The URL for a page of resources.
"""
def __init__(
self,
- type: str,
+ href: str,
) -> None:
"""
- Initialize a BareMetalServerProfileCPUCoreCountDependent object.
+ Initialize a VirtualNetworkInterfaceCollectionNext object.
- :param str type: The type for this profile field.
+ :param str href: The URL for a page of resources.
"""
- # pylint: disable=super-init-not-called
- self.type = type
+ self.href = href
@classmethod
- def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileCPUCoreCountDependent':
- """Initialize a BareMetalServerProfileCPUCoreCountDependent object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VirtualNetworkInterfaceCollectionNext':
+ """Initialize a VirtualNetworkInterfaceCollectionNext object from a json dictionary."""
args = {}
- if 'type' in _dict:
- args['type'] = _dict.get('type')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'type\' not present in BareMetalServerProfileCPUCoreCountDependent JSON')
+ raise ValueError('Required property \'href\' not present in VirtualNetworkInterfaceCollectionNext JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a BareMetalServerProfileCPUCoreCountDependent object from a json dictionary."""
+ """Initialize a VirtualNetworkInterfaceCollectionNext object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'type') and self.type is not None:
- _dict['type'] = self.type
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
return _dict
def _to_dict(self):
@@ -89413,87 +91986,132 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this BareMetalServerProfileCPUCoreCountDependent object."""
+ """Return a `str` version of this VirtualNetworkInterfaceCollectionNext object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'BareMetalServerProfileCPUCoreCountDependent') -> bool:
+ def __eq__(self, other: 'VirtualNetworkInterfaceCollectionNext') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'BareMetalServerProfileCPUCoreCountDependent') -> bool:
+ def __ne__(self, other: 'VirtualNetworkInterfaceCollectionNext') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class TypeEnum(str, Enum):
- """
- The type for this profile field.
- """
- DEPENDENT = 'dependent'
+class VirtualNetworkInterfaceIPPrototype:
+ """
+ VirtualNetworkInterfaceIPPrototype.
+
+ """
+
+ def __init__(
+ self,
+ ) -> None:
+ """
+ Initialize a VirtualNetworkInterfaceIPPrototype object.
+ """
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContext', 'VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext'])
+ )
+ raise Exception(msg)
-class BareMetalServerProfileCPUCoreCountEnum(BareMetalServerProfileCPUCoreCount):
+class VirtualNetworkInterfacePatch:
"""
- The permitted values for CPU cores for a bare metal server with this profile.
+ VirtualNetworkInterfacePatch.
- :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.
+ :param bool allow_ip_spoofing: (optional) Indicates whether source IP spoofing
+ is allowed on this interface.
+ Must be `false` if `target` is a file share mount target.
+ :param bool auto_delete: (optional) Indicates whether this virtual network
+ interface will be automatically deleted when
+ `target` is deleted. Must be `false` if the virtual network interface is
+ unbound.
+ :param bool enable_infrastructure_nat: (optional) If `true`:
+ - The VPC infrastructure performs any needed NAT operations.
+ - `floating_ips` must not have more than one floating IP.
+ If `false`:
+ - Packets are passed unchanged to/from the virtual network interface,
+ allowing the workload to perform any needed NAT operations.
+ - `allow_ip_spoofing` must be `false`.
+ - Can only be attached to a `target` with a `resource_type` of
+ `bare_metal_server_network_attachment`.
+ :param str name: (optional) The name for this virtual network interface. The
+ name must not be used by another virtual network interface in the region. Names
+ beginning with `ibm-` are reserved for provider-owned resources, and are not
+ allowed.
"""
def __init__(
self,
- default: int,
- type: str,
- values: List[int],
+ *,
+ allow_ip_spoofing: Optional[bool] = None,
+ auto_delete: Optional[bool] = None,
+ enable_infrastructure_nat: Optional[bool] = None,
+ name: Optional[str] = None,
) -> None:
"""
- Initialize a BareMetalServerProfileCPUCoreCountEnum object.
+ Initialize a VirtualNetworkInterfacePatch object.
- :param int default: The default value for this profile field.
- :param str type: The type for this profile field.
- :param List[int] values: The permitted values for this profile field.
+ :param bool allow_ip_spoofing: (optional) Indicates whether source IP
+ spoofing is allowed on this interface.
+ Must be `false` if `target` is a file share mount target.
+ :param bool auto_delete: (optional) Indicates whether this virtual network
+ interface will be automatically deleted when
+ `target` is deleted. Must be `false` if the virtual network interface is
+ unbound.
+ :param bool enable_infrastructure_nat: (optional) If `true`:
+ - The VPC infrastructure performs any needed NAT operations.
+ - `floating_ips` must not have more than one floating IP.
+ If `false`:
+ - Packets are passed unchanged to/from the virtual network interface,
+ allowing the workload to perform any needed NAT operations.
+ - `allow_ip_spoofing` must be `false`.
+ - Can only be attached to a `target` with a `resource_type` of
+ `bare_metal_server_network_attachment`.
+ :param str name: (optional) The name for this virtual network interface.
+ The name must not be used by another virtual network interface in the
+ region. Names beginning with `ibm-` are reserved for provider-owned
+ resources, and are not allowed.
"""
- # pylint: disable=super-init-not-called
- self.default = default
- self.type = type
- self.values = values
+ self.allow_ip_spoofing = allow_ip_spoofing
+ self.auto_delete = auto_delete
+ self.enable_infrastructure_nat = enable_infrastructure_nat
+ self.name = name
@classmethod
- def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileCPUCoreCountEnum':
- """Initialize a BareMetalServerProfileCPUCoreCountEnum object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VirtualNetworkInterfacePatch':
+ """Initialize a VirtualNetworkInterfacePatch object from a json dictionary."""
args = {}
- if 'default' in _dict:
- args['default'] = _dict.get('default')
- else:
- raise ValueError('Required property \'default\' not present in BareMetalServerProfileCPUCoreCountEnum JSON')
- if 'type' in _dict:
- args['type'] = _dict.get('type')
- else:
- raise ValueError('Required property \'type\' not present in BareMetalServerProfileCPUCoreCountEnum JSON')
- if 'values' in _dict:
- args['values'] = _dict.get('values')
- else:
- raise ValueError('Required property \'values\' not present in BareMetalServerProfileCPUCoreCountEnum JSON')
+ if (allow_ip_spoofing := _dict.get('allow_ip_spoofing')) is not None:
+ args['allow_ip_spoofing'] = allow_ip_spoofing
+ if (auto_delete := _dict.get('auto_delete')) is not None:
+ args['auto_delete'] = auto_delete
+ if (enable_infrastructure_nat := _dict.get('enable_infrastructure_nat')) is not None:
+ args['enable_infrastructure_nat'] = enable_infrastructure_nat
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a BareMetalServerProfileCPUCoreCountEnum object from a json dictionary."""
+ """Initialize a VirtualNetworkInterfacePatch object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, '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, 'allow_ip_spoofing') and self.allow_ip_spoofing is not None:
+ _dict['allow_ip_spoofing'] = self.allow_ip_spoofing
+ if hasattr(self, 'auto_delete') and self.auto_delete is not None:
+ _dict['auto_delete'] = self.auto_delete
+ 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):
@@ -89501,77 +92119,119 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this BareMetalServerProfileCPUCoreCountEnum object."""
+ """Return a `str` version of this VirtualNetworkInterfacePatch object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'BareMetalServerProfileCPUCoreCountEnum') -> bool:
+ def __eq__(self, other: 'VirtualNetworkInterfacePatch') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'BareMetalServerProfileCPUCoreCountEnum') -> bool:
+ def __ne__(self, other: 'VirtualNetworkInterfacePatch') -> 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 VirtualNetworkInterfacePrimaryIPPrototype:
+ """
+ VirtualNetworkInterfacePrimaryIPPrototype.
+
+ """
+
+ def __init__(
+ self,
+ ) -> None:
+ """
+ Initialize a VirtualNetworkInterfacePrimaryIPPrototype object.
+ """
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContext', 'VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext'])
+ )
+ raise Exception(msg)
-class BareMetalServerProfileCPUCoreCountFixed(BareMetalServerProfileCPUCoreCount):
+class VirtualNetworkInterfaceReferenceAttachmentContext:
"""
- The CPU core count for a bare metal server with this profile.
+ VirtualNetworkInterfaceReferenceAttachmentContext.
- :attr str type: The type for this profile field.
- :attr int value: The value for this profile field.
+ :param str crn: The CRN for this virtual network interface.
+ :param str href: The URL for this virtual network interface.
+ :param str id: The unique identifier for this virtual network interface.
+ :param str name: The name for this virtual network interface. The name is unique
+ across all virtual network interfaces in the VPC.
+ :param str resource_type: The resource type.
"""
def __init__(
self,
- type: str,
- value: int,
+ crn: str,
+ href: str,
+ id: str,
+ name: str,
+ resource_type: str,
) -> None:
"""
- Initialize a BareMetalServerProfileCPUCoreCountFixed object.
+ Initialize a VirtualNetworkInterfaceReferenceAttachmentContext object.
- :param str type: The type for this profile field.
- :param int value: The value for this profile field.
+ :param str crn: The CRN for this virtual network interface.
+ :param str href: The URL for this virtual network interface.
+ :param str id: The unique identifier for this virtual network interface.
+ :param str name: The name for this virtual network interface. The name is
+ unique across all virtual network interfaces in the VPC.
+ :param str resource_type: The resource type.
"""
- # pylint: disable=super-init-not-called
- self.type = type
- self.value = value
+ self.crn = crn
+ self.href = href
+ self.id = id
+ self.name = name
+ self.resource_type = resource_type
@classmethod
- def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileCPUCoreCountFixed':
- """Initialize a BareMetalServerProfileCPUCoreCountFixed object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VirtualNetworkInterfaceReferenceAttachmentContext':
+ """Initialize a VirtualNetworkInterfaceReferenceAttachmentContext object from a json dictionary."""
args = {}
- if 'type' in _dict:
- args['type'] = _dict.get('type')
+ if (crn := _dict.get('crn')) is not None:
+ args['crn'] = crn
else:
- raise ValueError('Required property \'type\' not present in BareMetalServerProfileCPUCoreCountFixed JSON')
- if 'value' in _dict:
- args['value'] = _dict.get('value')
+ raise ValueError('Required property \'crn\' not present in VirtualNetworkInterfaceReferenceAttachmentContext JSON')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'value\' not present in BareMetalServerProfileCPUCoreCountFixed JSON')
+ raise ValueError('Required property \'href\' not present in VirtualNetworkInterfaceReferenceAttachmentContext JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
+ else:
+ raise ValueError('Required property \'id\' not present in VirtualNetworkInterfaceReferenceAttachmentContext JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ else:
+ raise ValueError('Required property \'name\' not present in VirtualNetworkInterfaceReferenceAttachmentContext JSON')
+ if (resource_type := _dict.get('resource_type')) is not None:
+ args['resource_type'] = resource_type
+ else:
+ raise ValueError('Required property \'resource_type\' not present in VirtualNetworkInterfaceReferenceAttachmentContext JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a BareMetalServerProfileCPUCoreCountFixed object from a json dictionary."""
+ """Initialize a VirtualNetworkInterfaceReferenceAttachmentContext object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'type') and self.type is not None:
- _dict['type'] = self.type
- if hasattr(self, 'value') and self.value is not None:
- _dict['value'] = self.value
+ if hasattr(self, 'crn') and self.crn is not None:
+ _dict['crn'] = self.crn
+ if hasattr(self, 'href') and self.href 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):
@@ -89579,108 +92239,67 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this BareMetalServerProfileCPUCoreCountFixed object."""
+ """Return a `str` version of this VirtualNetworkInterfaceReferenceAttachmentContext object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'BareMetalServerProfileCPUCoreCountFixed') -> bool:
+ def __eq__(self, other: 'VirtualNetworkInterfaceReferenceAttachmentContext') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'BareMetalServerProfileCPUCoreCountFixed') -> bool:
+ def __ne__(self, other: 'VirtualNetworkInterfaceReferenceAttachmentContext') -> 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'
+ VIRTUAL_NETWORK_INTERFACE = 'virtual_network_interface'
-class BareMetalServerProfileCPUCoreCountRange(BareMetalServerProfileCPUCoreCount):
+class VirtualNetworkInterfaceReferenceDeleted:
"""
- The permitted range for the number of CPU cores for a bare metal server with this
- profile.
+ If present, this property indicates the referenced resource has been deleted, and
+ provides some supplementary information.
- :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.
+ :param str more_info: Link to documentation about deleted resources.
"""
def __init__(
self,
- default: int,
- max: int,
- min: int,
- step: int,
- type: str,
+ more_info: str,
) -> None:
"""
- Initialize a BareMetalServerProfileCPUCoreCountRange object.
+ Initialize a VirtualNetworkInterfaceReferenceDeleted object.
- :param int default: The default value for this profile field.
- :param int max: The maximum value for this profile field.
- :param int min: The minimum value for this profile field.
- :param int step: The increment step value for this profile field.
- :param str type: The type for this profile field.
+ :param str more_info: Link to documentation about deleted resources.
"""
- # pylint: disable=super-init-not-called
- self.default = default
- self.max = max
- self.min = min
- self.step = step
- self.type = type
+ self.more_info = more_info
@classmethod
- def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileCPUCoreCountRange':
- """Initialize a BareMetalServerProfileCPUCoreCountRange object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VirtualNetworkInterfaceReferenceDeleted':
+ """Initialize a VirtualNetworkInterfaceReferenceDeleted object from a json dictionary."""
args = {}
- if 'default' in _dict:
- args['default'] = _dict.get('default')
+ if (more_info := _dict.get('more_info')) is not None:
+ args['more_info'] = more_info
else:
- raise ValueError('Required property \'default\' not present in BareMetalServerProfileCPUCoreCountRange JSON')
- if 'max' in _dict:
- args['max'] = _dict.get('max')
- else:
- raise ValueError('Required property \'max\' not present in BareMetalServerProfileCPUCoreCountRange JSON')
- if 'min' in _dict:
- args['min'] = _dict.get('min')
- else:
- raise ValueError('Required property \'min\' not present in BareMetalServerProfileCPUCoreCountRange JSON')
- if 'step' in _dict:
- args['step'] = _dict.get('step')
- else:
- raise ValueError('Required property \'step\' not present in BareMetalServerProfileCPUCoreCountRange JSON')
- if 'type' in _dict:
- args['type'] = _dict.get('type')
- else:
- raise ValueError('Required property \'type\' not present in BareMetalServerProfileCPUCoreCountRange JSON')
+ raise ValueError('Required property \'more_info\' not present in VirtualNetworkInterfaceReferenceDeleted JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a BareMetalServerProfileCPUCoreCountRange object from a json dictionary."""
+ """Initialize a VirtualNetworkInterfaceReferenceDeleted object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'default') and self.default is not None:
- _dict['default'] = self.default
- if hasattr(self, 'max') and self.max is not None:
- _dict['max'] = self.max
- if hasattr(self, 'min') and self.min is not None:
- _dict['min'] = self.min
- if hasattr(self, 'step') and self.step is not None:
- _dict['step'] = self.step
- if hasattr(self, 'type') and self.type is not None:
- _dict['type'] = self.type
+ if hasattr(self, 'more_info') and self.more_info is not None:
+ _dict['more_info'] = self.more_info
return _dict
def _to_dict(self):
@@ -89688,68 +92307,463 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this BareMetalServerProfileCPUCoreCountRange object."""
+ """Return a `str` version of this VirtualNetworkInterfaceReferenceDeleted object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'BareMetalServerProfileCPUCoreCountRange') -> bool:
+ def __eq__(self, other: 'VirtualNetworkInterfaceReferenceDeleted') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'BareMetalServerProfileCPUCoreCountRange') -> bool:
+ def __ne__(self, other: 'VirtualNetworkInterfaceReferenceDeleted') -> 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 VirtualNetworkInterfaceTarget:
+ """
+ A virtual network interface target.
+ The resource types that can be virtual network interface targets are expected to
+ expand in the future. When iterating over virtual network interface targets, do not
+ assume that every target resource will be from a known set of resource types.
+ Optionally halt processing and surface an error, or bypass resources of unrecognized
+ types.
+
+ """
+
+ def __init__(
+ self,
+ ) -> None:
+ """
+ Initialize a VirtualNetworkInterfaceTarget object.
+ """
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['VirtualNetworkInterfaceTargetShareMountTargetReference', 'VirtualNetworkInterfaceTargetInstanceNetworkAttachmentReferenceVirtualNetworkInterfaceContext', 'VirtualNetworkInterfaceTargetBareMetalServerNetworkAttachmentReferenceVirtualNetworkInterfaceContext'])
+ )
+ raise Exception(msg)
-class BareMetalServerProfileCPUSocketCountDependent(BareMetalServerProfileCPUSocketCount):
+class Volume:
"""
- The CPU socket count for a bare metal server with this profile depends on its
- configuration.
+ Volume.
- :attr str type: The type for this profile field.
+ :param bool active: Indicates whether a running virtual server instance has an
+ attachment to this volume.
+ :param str attachment_state: The attachment state of the volume
+ - `unattached`: Not attached to any virtual server instances
+ - `attached`: Attached to a virtual server instance (even if the instance is
+ stopped)
+ - `unusable`: Not able to be attached to any virtual server instances.
+ :param int bandwidth: The maximum bandwidth (in megabits per second) for the
+ volume.
+ :param bool busy: Indicates whether this volume is performing an operation that
+ must be serialized. This must be `false` to perform an operation that is
+ specified to require serialization.
+ :param int capacity: The capacity to use for the volume (in gigabytes). The
+ specified minimum and maximum capacity values for creating or updating volumes
+ may expand in the future.
+ :param datetime created_at: The date and time that the volume was created.
+ :param str crn: The CRN for this volume.
+ :param str encryption: The type of encryption used on the volume.
+ :param 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 List[VolumeHealthReason] health_reasons: The reasons for the current
+ `health_state` (if any).
+ The enumerated reason code values for this property will expand in the future.
+ When processing this property, check for and log unknown values. Optionally halt
+ processing and surface the error, or bypass the resource on which the unexpected
+ reason code was encountered.
+ :param str health_state: The health of this resource.
+ - `ok`: No abnormal behavior detected
+ - `degraded`: Experiencing compromised performance, capacity, or connectivity
+ - `faulted`: Completely unreachable, inoperative, or otherwise entirely
+ incapacitated
+ - `inapplicable`: The health state does not apply because of the current
+ lifecycle state. A resource with a lifecycle state of `failed` or `deleting`
+ will have a health state of `inapplicable`. A `pending` resource may also have
+ this state.
+ :param str href: The URL for this volume.
+ :param str id: The unique identifier for this volume.
+ :param int iops: The maximum I/O operations per second (IOPS) for this volume.
+ :param str name: The name for this volume. The name is unique across all volumes
+ in the region.
+ :param OperatingSystem operating_system: (optional) The operating system
+ associated with this volume. If absent, this volume was not
+ created from an image, or the image did not include an operating system.
+ :param VolumeProfileReference profile: The
+ [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-block-storage-profiles) for
+ this volume.
+ :param ResourceGroupReference resource_group: The resource group for this
+ volume.
+ :param str resource_type: The resource type.
+ :param ImageReference source_image: (optional) The image from which this volume
+ was created (this may be
+ [deleted](https://cloud.ibm.com/apidocs/vpc#deleted-resources)).
+ If absent, this volume was not created from an image.
+ :param SnapshotReference source_snapshot: (optional) The snapshot from which
+ this volume was cloned.
+ :param str status: The status of the volume.
+ The enumerated values for this property will expand in the future. When
+ processing this property, check for and log unknown values. Optionally halt
+ processing and surface the error, or bypass the volume on which the unexpected
+ property value was encountered.
+ :param List[VolumeStatusReason] status_reasons: The reasons for the current
+ status (if any).
+ The enumerated reason code values for this property will expand in the future.
+ When processing this property, check for and log unknown values. Optionally halt
+ processing and surface the error, or bypass the resource on which the unexpected
+ reason code was encountered.
+ :param List[str] user_tags: The [user
+ tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with this
+ volume.
+ :param List[VolumeAttachmentReferenceVolumeContext] volume_attachments: The
+ volume attachments for this volume.
+ :param ZoneReference zone: The zone this volume resides in.
"""
def __init__(
self,
- type: str,
+ active: bool,
+ attachment_state: str,
+ bandwidth: int,
+ busy: bool,
+ capacity: int,
+ created_at: datetime,
+ crn: str,
+ encryption: str,
+ health_reasons: List['VolumeHealthReason'],
+ health_state: str,
+ href: str,
+ id: str,
+ iops: int,
+ name: str,
+ profile: 'VolumeProfileReference',
+ resource_group: 'ResourceGroupReference',
+ resource_type: str,
+ status: str,
+ status_reasons: List['VolumeStatusReason'],
+ user_tags: List[str],
+ volume_attachments: List['VolumeAttachmentReferenceVolumeContext'],
+ zone: 'ZoneReference',
+ *,
+ encryption_key: Optional['EncryptionKeyReference'] = None,
+ operating_system: Optional['OperatingSystem'] = None,
+ source_image: Optional['ImageReference'] = None,
+ source_snapshot: Optional['SnapshotReference'] = None,
) -> None:
"""
- Initialize a BareMetalServerProfileCPUSocketCountDependent object.
+ Initialize a Volume object.
- :param str type: The type for this profile field.
+ :param bool active: Indicates whether a running virtual server instance has
+ an attachment to this volume.
+ :param str attachment_state: The attachment state of the volume
+ - `unattached`: Not attached to any virtual server instances
+ - `attached`: Attached to a virtual server instance (even if the instance
+ is stopped)
+ - `unusable`: Not able to be attached to any virtual server instances.
+ :param int bandwidth: The maximum bandwidth (in megabits per second) for
+ the volume.
+ :param bool busy: Indicates whether this volume is performing an operation
+ that must be serialized. This must be `false` to perform an operation that
+ is specified to require serialization.
+ :param int capacity: The capacity to use for the volume (in gigabytes). The
+ specified minimum and maximum capacity values for creating or updating
+ volumes may expand in the future.
+ :param datetime created_at: The date and time that the volume was created.
+ :param str crn: The CRN for this volume.
+ :param str encryption: The type of encryption used on the volume.
+ :param List[VolumeHealthReason] health_reasons: The reasons for the current
+ `health_state` (if any).
+ The enumerated reason code values for this property will expand in the
+ future. When processing this property, check for and log unknown values.
+ Optionally halt processing and surface the error, or bypass the resource on
+ which the unexpected reason code was encountered.
+ :param str health_state: The health of this resource.
+ - `ok`: No abnormal behavior detected
+ - `degraded`: Experiencing compromised performance, capacity, or
+ connectivity
+ - `faulted`: Completely unreachable, inoperative, or otherwise entirely
+ incapacitated
+ - `inapplicable`: The health state does not apply because of the current
+ lifecycle state. A resource with a lifecycle state of `failed` or
+ `deleting` will have a health state of `inapplicable`. A `pending` resource
+ may also have this state.
+ :param str href: The URL for this volume.
+ :param str id: The unique identifier for this volume.
+ :param int iops: The maximum I/O operations per second (IOPS) for this
+ volume.
+ :param str name: The name for this volume. The name is unique across all
+ volumes in the region.
+ :param VolumeProfileReference profile: The
+ [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-block-storage-profiles)
+ for
+ this volume.
+ :param ResourceGroupReference resource_group: The resource group for this
+ volume.
+ :param str resource_type: The resource type.
+ :param str status: The status of the volume.
+ The enumerated values for this property will expand in the future. When
+ processing this property, check for and log unknown values. Optionally halt
+ processing and surface the error, or bypass the volume on which the
+ unexpected property value was encountered.
+ :param List[VolumeStatusReason] status_reasons: The reasons for the current
+ status (if any).
+ The enumerated reason code values for this property will expand in the
+ future. When processing this property, check for and log unknown values.
+ Optionally halt processing and surface the error, or bypass the resource on
+ which the unexpected reason code was encountered.
+ :param List[str] user_tags: The [user
+ tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with
+ this volume.
+ :param List[VolumeAttachmentReferenceVolumeContext] volume_attachments: The
+ volume attachments for this volume.
+ :param ZoneReference zone: The zone this volume resides in.
+ :param EncryptionKeyReference encryption_key: (optional) The root key used
+ to wrap the data encryption key for the volume.
+ This property will be present for volumes with an `encryption` type of
+ `user_managed`.
+ :param OperatingSystem operating_system: (optional) The operating system
+ associated with this volume. If absent, this volume was not
+ created from an image, or the image did not include an operating system.
+ :param ImageReference source_image: (optional) The image from which this
+ volume was created (this may be
+ [deleted](https://cloud.ibm.com/apidocs/vpc#deleted-resources)).
+ If absent, this volume was not created from an image.
+ :param SnapshotReference source_snapshot: (optional) The snapshot from
+ which this volume was cloned.
"""
- # pylint: disable=super-init-not-called
- self.type = type
+ self.active = active
+ self.attachment_state = attachment_state
+ self.bandwidth = bandwidth
+ self.busy = busy
+ self.capacity = capacity
+ self.created_at = created_at
+ self.crn = crn
+ self.encryption = encryption
+ self.encryption_key = encryption_key
+ self.health_reasons = health_reasons
+ self.health_state = health_state
+ self.href = href
+ self.id = id
+ self.iops = iops
+ self.name = name
+ self.operating_system = operating_system
+ self.profile = profile
+ self.resource_group = resource_group
+ self.resource_type = resource_type
+ self.source_image = source_image
+ self.source_snapshot = source_snapshot
+ self.status = status
+ self.status_reasons = status_reasons
+ self.user_tags = user_tags
+ self.volume_attachments = volume_attachments
+ self.zone = zone
@classmethod
- def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileCPUSocketCountDependent':
- """Initialize a BareMetalServerProfileCPUSocketCountDependent object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'Volume':
+ """Initialize a Volume object from a json dictionary."""
args = {}
- if 'type' in _dict:
- args['type'] = _dict.get('type')
+ if (active := _dict.get('active')) is not None:
+ args['active'] = active
else:
- raise ValueError('Required property \'type\' not present in BareMetalServerProfileCPUSocketCountDependent JSON')
+ raise ValueError('Required property \'active\' not present in Volume JSON')
+ if (attachment_state := _dict.get('attachment_state')) is not None:
+ args['attachment_state'] = attachment_state
+ else:
+ raise ValueError('Required property \'attachment_state\' not present in Volume JSON')
+ if (bandwidth := _dict.get('bandwidth')) is not None:
+ args['bandwidth'] = bandwidth
+ else:
+ raise ValueError('Required property \'bandwidth\' not present in Volume JSON')
+ if (busy := _dict.get('busy')) is not None:
+ args['busy'] = busy
+ else:
+ raise ValueError('Required property \'busy\' not present in Volume JSON')
+ if (capacity := _dict.get('capacity')) is not None:
+ args['capacity'] = capacity
+ else:
+ raise ValueError('Required property \'capacity\' not present in Volume JSON')
+ if (created_at := _dict.get('created_at')) is not None:
+ args['created_at'] = string_to_datetime(created_at)
+ else:
+ raise ValueError('Required property \'created_at\' not present in Volume JSON')
+ if (crn := _dict.get('crn')) is not None:
+ args['crn'] = crn
+ else:
+ raise ValueError('Required property \'crn\' not present in Volume JSON')
+ if (encryption := _dict.get('encryption')) is not None:
+ args['encryption'] = encryption
+ else:
+ raise ValueError('Required property \'encryption\' not present in Volume JSON')
+ if (encryption_key := _dict.get('encryption_key')) is not None:
+ args['encryption_key'] = EncryptionKeyReference.from_dict(encryption_key)
+ if (health_reasons := _dict.get('health_reasons')) is not None:
+ args['health_reasons'] = [VolumeHealthReason.from_dict(v) for v in health_reasons]
+ else:
+ raise ValueError('Required property \'health_reasons\' not present in Volume JSON')
+ if (health_state := _dict.get('health_state')) is not None:
+ args['health_state'] = health_state
+ else:
+ raise ValueError('Required property \'health_state\' not present in Volume JSON')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
+ else:
+ raise ValueError('Required property \'href\' not present in Volume JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
+ else:
+ raise ValueError('Required property \'id\' not present in Volume JSON')
+ if (iops := _dict.get('iops')) is not None:
+ args['iops'] = iops
+ else:
+ raise ValueError('Required property \'iops\' not present in Volume JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ else:
+ raise ValueError('Required property \'name\' not present in Volume JSON')
+ if (operating_system := _dict.get('operating_system')) is not None:
+ args['operating_system'] = OperatingSystem.from_dict(operating_system)
+ if (profile := _dict.get('profile')) is not None:
+ args['profile'] = VolumeProfileReference.from_dict(profile)
+ else:
+ raise ValueError('Required property \'profile\' not present in Volume JSON')
+ if (resource_group := _dict.get('resource_group')) is not None:
+ args['resource_group'] = ResourceGroupReference.from_dict(resource_group)
+ else:
+ raise ValueError('Required property \'resource_group\' not present in Volume JSON')
+ if (resource_type := _dict.get('resource_type')) is not None:
+ args['resource_type'] = resource_type
+ else:
+ raise ValueError('Required property \'resource_type\' not present in Volume JSON')
+ if (source_image := _dict.get('source_image')) is not None:
+ args['source_image'] = ImageReference.from_dict(source_image)
+ if (source_snapshot := _dict.get('source_snapshot')) is not None:
+ args['source_snapshot'] = SnapshotReference.from_dict(source_snapshot)
+ if (status := _dict.get('status')) is not None:
+ args['status'] = status
+ else:
+ raise ValueError('Required property \'status\' not present in Volume JSON')
+ if (status_reasons := _dict.get('status_reasons')) is not None:
+ args['status_reasons'] = [VolumeStatusReason.from_dict(v) for v in status_reasons]
+ else:
+ raise ValueError('Required property \'status_reasons\' not present in Volume JSON')
+ if (user_tags := _dict.get('user_tags')) is not None:
+ args['user_tags'] = user_tags
+ else:
+ raise ValueError('Required property \'user_tags\' not present in Volume JSON')
+ if (volume_attachments := _dict.get('volume_attachments')) is not None:
+ args['volume_attachments'] = [VolumeAttachmentReferenceVolumeContext.from_dict(v) for v in volume_attachments]
+ else:
+ raise ValueError('Required property \'volume_attachments\' not present in Volume JSON')
+ if (zone := _dict.get('zone')) is not None:
+ args['zone'] = ZoneReference.from_dict(zone)
+ else:
+ raise ValueError('Required property \'zone\' not present in Volume JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a BareMetalServerProfileCPUSocketCountDependent 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, 'type') and self.type is not None:
- _dict['type'] = self.type
+ if hasattr(self, 'active') and self.active is not None:
+ _dict['active'] = self.active
+ if hasattr(self, 'attachment_state') and self.attachment_state is not None:
+ _dict['attachment_state'] = self.attachment_state
+ if hasattr(self, 'bandwidth') and self.bandwidth is not None:
+ _dict['bandwidth'] = self.bandwidth
+ if hasattr(self, 'busy') and self.busy is not None:
+ _dict['busy'] = self.busy
+ if hasattr(self, 'capacity') and self.capacity is not None:
+ _dict['capacity'] = self.capacity
+ if hasattr(self, 'created_at') and self.created_at is not None:
+ _dict['created_at'] = datetime_to_string(self.created_at)
+ if hasattr(self, 'crn') and self.crn is not None:
+ _dict['crn'] = self.crn
+ if hasattr(self, 'encryption') and self.encryption is not None:
+ _dict['encryption'] = self.encryption
+ if hasattr(self, 'encryption_key') and self.encryption_key is not None:
+ if isinstance(self.encryption_key, dict):
+ _dict['encryption_key'] = self.encryption_key
+ else:
+ _dict['encryption_key'] = self.encryption_key.to_dict()
+ if hasattr(self, 'health_reasons') and self.health_reasons is not None:
+ health_reasons_list = []
+ for v in self.health_reasons:
+ if isinstance(v, dict):
+ health_reasons_list.append(v)
+ else:
+ health_reasons_list.append(v.to_dict())
+ _dict['health_reasons'] = health_reasons_list
+ if hasattr(self, 'health_state') and self.health_state is not None:
+ _dict['health_state'] = self.health_state
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
+ if hasattr(self, 'id') and self.id is not None:
+ _dict['id'] = self.id
+ if hasattr(self, 'iops') and self.iops is not None:
+ _dict['iops'] = self.iops
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ if hasattr(self, 'operating_system') and self.operating_system is not None:
+ if isinstance(self.operating_system, dict):
+ _dict['operating_system'] = self.operating_system
+ else:
+ _dict['operating_system'] = self.operating_system.to_dict()
+ if hasattr(self, 'profile') and self.profile is not None:
+ if isinstance(self.profile, dict):
+ _dict['profile'] = self.profile
+ else:
+ _dict['profile'] = self.profile.to_dict()
+ if hasattr(self, 'resource_group') and self.resource_group is not None:
+ if isinstance(self.resource_group, dict):
+ _dict['resource_group'] = self.resource_group
+ else:
+ _dict['resource_group'] = self.resource_group.to_dict()
+ if hasattr(self, 'resource_type') and self.resource_type is not None:
+ _dict['resource_type'] = self.resource_type
+ if hasattr(self, 'source_image') and self.source_image is not None:
+ if isinstance(self.source_image, dict):
+ _dict['source_image'] = self.source_image
+ else:
+ _dict['source_image'] = self.source_image.to_dict()
+ if hasattr(self, 'source_snapshot') and self.source_snapshot is not None:
+ if isinstance(self.source_snapshot, dict):
+ _dict['source_snapshot'] = self.source_snapshot
+ else:
+ _dict['source_snapshot'] = self.source_snapshot.to_dict()
+ if hasattr(self, 'status') and self.status is not None:
+ _dict['status'] = self.status
+ if hasattr(self, 'status_reasons') and self.status_reasons is not None:
+ status_reasons_list = []
+ for v in self.status_reasons:
+ if isinstance(v, dict):
+ status_reasons_list.append(v)
+ else:
+ status_reasons_list.append(v.to_dict())
+ _dict['status_reasons'] = status_reasons_list
+ if hasattr(self, 'user_tags') and self.user_tags is not None:
+ _dict['user_tags'] = self.user_tags
+ if hasattr(self, 'volume_attachments') and self.volume_attachments is not None:
+ volume_attachments_list = []
+ for v in self.volume_attachments:
+ if isinstance(v, dict):
+ volume_attachments_list.append(v)
+ else:
+ volume_attachments_list.append(v.to_dict())
+ _dict['volume_attachments'] = volume_attachments_list
+ if hasattr(self, 'zone') and self.zone is not None:
+ if isinstance(self.zone, dict):
+ _dict['zone'] = self.zone
+ else:
+ _dict['zone'] = self.zone.to_dict()
return _dict
def _to_dict(self):
@@ -89757,165 +92771,235 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this BareMetalServerProfileCPUSocketCountDependent object."""
+ """Return a `str` version of this Volume object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'BareMetalServerProfileCPUSocketCountDependent') -> 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: 'BareMetalServerProfileCPUSocketCountDependent') -> bool:
+ def __ne__(self, other: 'Volume') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class TypeEnum(str, Enum):
+ class AttachmentStateEnum(str, Enum):
"""
- The type for this profile field.
+ The attachment state of the volume
+ - `unattached`: Not attached to any virtual server instances
+ - `attached`: Attached to a virtual server instance (even if the instance is
+ stopped)
+ - `unusable`: Not able to be attached to any virtual server instances.
"""
- DEPENDENT = 'dependent'
+ ATTACHED = 'attached'
+ UNATTACHED = 'unattached'
+ UNUSABLE = 'unusable'
+ class EncryptionEnum(str, Enum):
+ """
+ The type of encryption used on the volume.
+ """
-class BareMetalServerProfileCPUSocketCountEnum(BareMetalServerProfileCPUSocketCount):
- """
- The permitted values for CPU sockets for a bare metal server with this profile.
+ PROVIDER_MANAGED = 'provider_managed'
+ USER_MANAGED = 'user_managed'
- :attr int default: The default value for this profile field.
- :attr str type: The type for this profile field.
- :attr List[int] values: The permitted values for this profile field.
- """
- def __init__(
- self,
- default: int,
- type: str,
- values: List[int],
- ) -> None:
+ class HealthStateEnum(str, Enum):
"""
- 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.
+ 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.
"""
- # pylint: disable=super-init-not-called
- self.default = default
- self.type = type
- self.values = values
-
- @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 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
+ DEGRADED = 'degraded'
+ FAULTED = 'faulted'
+ INAPPLICABLE = 'inapplicable'
+ OK = 'ok'
- def _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)
+ class ResourceTypeEnum(str, Enum):
+ """
+ The resource type.
+ """
- 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__
+ VOLUME = 'volume'
- 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):
+ class StatusEnum(str, Enum):
"""
- The type for this profile field.
+ 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.
"""
- ENUM = 'enum'
+ AVAILABLE = 'available'
+ FAILED = 'failed'
+ PENDING = 'pending'
+ PENDING_DELETION = 'pending_deletion'
+ UNUSABLE = 'unusable'
+ UPDATING = 'updating'
-class BareMetalServerProfileCPUSocketCountFixed(BareMetalServerProfileCPUSocketCount):
+class VolumeAttachment:
"""
- The number of CPU sockets for a bare metal server with this profile.
+ VolumeAttachment.
- :attr str type: The type for this profile field.
- :attr int value: The value for this profile field.
+ :param int bandwidth: The maximum bandwidth (in megabits per second) for the
+ volume when attached to this instance. This may be lower than the volume
+ bandwidth depending on the configuration of the instance.
+ :param datetime created_at: The date and time that the volume was attached.
+ :param bool delete_volume_on_instance_delete: Indicates whether deleting the
+ instance will also delete the attached volume.
+ :param 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 str href: The URL for this volume attachment.
+ :param str id: The unique identifier for this volume attachment.
+ :param str name: The name for this volume attachment. The name is unique across
+ all volume attachments on the instance.
+ :param str status: The status of this volume attachment.
+ :param str type: The type of volume attachment.
+ :param VolumeReferenceVolumeAttachmentContext volume: (optional) The attached
+ volume.
+ This property will be absent if the volume has not yet been provisioned.
"""
def __init__(
self,
+ bandwidth: int,
+ created_at: datetime,
+ delete_volume_on_instance_delete: bool,
+ href: str,
+ id: str,
+ name: str,
+ status: str,
type: str,
- value: int,
+ *,
+ device: Optional['VolumeAttachmentDevice'] = None,
+ volume: Optional['VolumeReferenceVolumeAttachmentContext'] = None,
) -> None:
"""
- Initialize a BareMetalServerProfileCPUSocketCountFixed object.
+ Initialize a VolumeAttachment object.
- :param str type: The type for this profile field.
- :param int value: The value for this profile field.
- """
- # pylint: disable=super-init-not-called
- self.type = type
- self.value = value
+ :param int bandwidth: The maximum bandwidth (in megabits per second) for
+ the volume when attached to this instance. This may be lower than the
+ volume bandwidth depending on the configuration of the instance.
+ :param datetime created_at: The date and time that the volume was attached.
+ :param bool delete_volume_on_instance_delete: Indicates whether deleting
+ the instance will also delete the attached volume.
+ :param str href: The URL for this volume attachment.
+ :param str id: The unique identifier for this volume attachment.
+ :param str name: The name for this volume attachment. The name is unique
+ across all volume attachments on the instance.
+ :param str status: The status of this volume attachment.
+ :param str type: The type of volume attachment.
+ :param VolumeAttachmentDevice device: (optional) Information about how the
+ volume is exposed to the instance operating system.
+ This property may be absent if the volume attachment's `status` is not
+ `attached`.
+ :param VolumeReferenceVolumeAttachmentContext volume: (optional) The
+ attached volume.
+ This property will be absent if the volume has not yet been provisioned.
+ """
+ self.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.status = status
+ self.type = type
+ self.volume = volume
@classmethod
- def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileCPUSocketCountFixed':
- """Initialize a BareMetalServerProfileCPUSocketCountFixed object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VolumeAttachment':
+ """Initialize a VolumeAttachment object from a json dictionary."""
args = {}
- if 'type' in _dict:
- args['type'] = _dict.get('type')
+ if (bandwidth := _dict.get('bandwidth')) is not None:
+ args['bandwidth'] = bandwidth
else:
- raise ValueError('Required property \'type\' not present in BareMetalServerProfileCPUSocketCountFixed JSON')
- if 'value' in _dict:
- args['value'] = _dict.get('value')
+ raise ValueError('Required property \'bandwidth\' not present in VolumeAttachment JSON')
+ if (created_at := _dict.get('created_at')) is not None:
+ args['created_at'] = string_to_datetime(created_at)
else:
- raise ValueError('Required property \'value\' not present in BareMetalServerProfileCPUSocketCountFixed JSON')
+ raise ValueError('Required property \'created_at\' not present in VolumeAttachment JSON')
+ if (delete_volume_on_instance_delete := _dict.get('delete_volume_on_instance_delete')) is not None:
+ args['delete_volume_on_instance_delete'] = delete_volume_on_instance_delete
+ else:
+ raise ValueError('Required property \'delete_volume_on_instance_delete\' not present in VolumeAttachment JSON')
+ if (device := _dict.get('device')) is not None:
+ args['device'] = VolumeAttachmentDevice.from_dict(device)
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
+ else:
+ raise ValueError('Required property \'href\' not present in VolumeAttachment JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
+ else:
+ raise ValueError('Required property \'id\' not present in VolumeAttachment JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ else:
+ raise ValueError('Required property \'name\' not present in VolumeAttachment JSON')
+ if (status := _dict.get('status')) is not None:
+ args['status'] = status
+ else:
+ raise ValueError('Required property \'status\' not present in VolumeAttachment JSON')
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
+ else:
+ raise ValueError('Required property \'type\' not present in VolumeAttachment JSON')
+ if (volume := _dict.get('volume')) is not None:
+ args['volume'] = VolumeReferenceVolumeAttachmentContext.from_dict(volume)
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a BareMetalServerProfileCPUSocketCountFixed 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, 'bandwidth') and self.bandwidth is not None:
+ _dict['bandwidth'] = self.bandwidth
+ if hasattr(self, 'created_at') and self.created_at is not None:
+ _dict['created_at'] = datetime_to_string(self.created_at)
+ if hasattr(self, 'delete_volume_on_instance_delete') and self.delete_volume_on_instance_delete is not None:
+ _dict['delete_volume_on_instance_delete'] = self.delete_volume_on_instance_delete
+ if hasattr(self, 'device') and self.device is not None:
+ if isinstance(self.device, dict):
+ _dict['device'] = self.device
+ else:
+ _dict['device'] = self.device.to_dict()
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
+ if hasattr(self, 'id') and self.id is not None:
+ _dict['id'] = self.id
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ if hasattr(self, 'status') and self.status is not None:
+ _dict['status'] = self.status
if hasattr(self, 'type') and self.type is not None:
_dict['type'] = self.type
- if hasattr(self, 'value') and self.value is not None:
- _dict['value'] = self.value
+ 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):
@@ -89923,108 +93007,86 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this BareMetalServerProfileCPUSocketCountFixed object."""
+ """Return a `str` version of this VolumeAttachment object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'BareMetalServerProfileCPUSocketCountFixed') -> 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: 'BareMetalServerProfileCPUSocketCountFixed') -> bool:
+ def __ne__(self, other: 'VolumeAttachment') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
+ class StatusEnum(str, Enum):
+ """
+ The status of this volume attachment.
+ """
+
+ ATTACHED = 'attached'
+ ATTACHING = 'attaching'
+ DELETING = 'deleting'
+ DETACHING = 'detaching'
+
+
class TypeEnum(str, Enum):
"""
- The type for this profile field.
+ The type of volume attachment.
"""
- FIXED = 'fixed'
+ BOOT = 'boot'
+ DATA = 'data'
-class BareMetalServerProfileCPUSocketCountRange(BareMetalServerProfileCPUSocketCount):
+class VolumeAttachmentCollection:
"""
- The permitted range for the number of CPU sockets for a bare metal server with this
- profile.
+ VolumeAttachmentCollection.
- :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.
+ :param List[VolumeAttachment] volume_attachments: Collection of volume
+ attachments.
"""
def __init__(
self,
- default: int,
- max: int,
- min: int,
- step: int,
- type: str,
+ volume_attachments: List['VolumeAttachment'],
) -> None:
"""
- Initialize a BareMetalServerProfileCPUSocketCountRange object.
+ Initialize a VolumeAttachmentCollection object.
- :param int default: The default value for this profile field.
- :param int max: The maximum value for this profile field.
- :param int min: The minimum value for this profile field.
- :param int step: The increment step value for this profile field.
- :param str type: The type for this profile field.
+ :param List[VolumeAttachment] volume_attachments: Collection of volume
+ attachments.
"""
- # pylint: disable=super-init-not-called
- self.default = default
- self.max = max
- self.min = min
- self.step = step
- self.type = type
+ self.volume_attachments = volume_attachments
@classmethod
- def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileCPUSocketCountRange':
- """Initialize a BareMetalServerProfileCPUSocketCountRange object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VolumeAttachmentCollection':
+ """Initialize a VolumeAttachmentCollection object from a json dictionary."""
args = {}
- if 'default' in _dict:
- args['default'] = _dict.get('default')
- else:
- raise ValueError('Required property \'default\' not present in BareMetalServerProfileCPUSocketCountRange JSON')
- if 'max' in _dict:
- args['max'] = _dict.get('max')
- else:
- raise ValueError('Required property \'max\' not present in BareMetalServerProfileCPUSocketCountRange JSON')
- if 'min' in _dict:
- args['min'] = _dict.get('min')
+ if (volume_attachments := _dict.get('volume_attachments')) is not None:
+ args['volume_attachments'] = [VolumeAttachment.from_dict(v) for v in volume_attachments]
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')
+ raise ValueError('Required property \'volume_attachments\' not present in VolumeAttachmentCollection JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a BareMetalServerProfileCPUSocketCountRange 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, 'default') and self.default is not None:
- _dict['default'] = self.default
- if hasattr(self, 'max') and self.max is not None:
- _dict['max'] = self.max
- if hasattr(self, 'min') and self.min is not None:
- _dict['min'] = self.min
- if hasattr(self, 'step') and self.step is not None:
- _dict['step'] = self.step
- if hasattr(self, 'type') and self.type is not None:
- _dict['type'] = self.type
+ if hasattr(self, 'volume_attachments') and self.volume_attachments is not None:
+ volume_attachments_list = []
+ for v in self.volume_attachments:
+ if isinstance(v, dict):
+ volume_attachments_list.append(v)
+ else:
+ volume_attachments_list.append(v.to_dict())
+ _dict['volume_attachments'] = volume_attachments_list
return _dict
def _to_dict(self):
@@ -90032,68 +93094,59 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this BareMetalServerProfileCPUSocketCountRange object."""
+ """Return a `str` version of this VolumeAttachmentCollection object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'BareMetalServerProfileCPUSocketCountRange') -> 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: 'BareMetalServerProfileCPUSocketCountRange') -> bool:
+ def __ne__(self, other: 'VolumeAttachmentCollection') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class TypeEnum(str, Enum):
- """
- The type for this profile field.
- """
-
- RANGE = 'range'
-
-
-class BareMetalServerProfileDiskQuantityDependent(BareMetalServerProfileDiskQuantity):
+class VolumeAttachmentDevice:
"""
- The number of disks of this configuration for a bare metal server with this profile
- depends on its bare metal server configuration.
+ VolumeAttachmentDevice.
- :attr str type: The type for this profile field.
+ :param str id: (optional) A unique identifier for the device which is exposed to
+ the instance operating system.
"""
def __init__(
self,
- type: str,
+ *,
+ id: Optional[str] = None,
) -> None:
"""
- Initialize a BareMetalServerProfileDiskQuantityDependent object.
+ Initialize a VolumeAttachmentDevice object.
- :param str type: The type for this profile field.
+ :param str id: (optional) A unique identifier for the device which is
+ exposed to the instance operating system.
"""
- # pylint: disable=super-init-not-called
- self.type = type
+ self.id = id
@classmethod
- def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileDiskQuantityDependent':
- """Initialize a BareMetalServerProfileDiskQuantityDependent object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VolumeAttachmentDevice':
+ """Initialize a VolumeAttachmentDevice object from a json dictionary."""
args = {}
- if 'type' in _dict:
- args['type'] = _dict.get('type')
- else:
- raise ValueError('Required property \'type\' not present in BareMetalServerProfileDiskQuantityDependent JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a BareMetalServerProfileDiskQuantityDependent 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, 'type') and self.type is not None:
- _dict['type'] = self.type
+ if hasattr(self, 'id') and self.id is not None:
+ _dict['id'] = self.id
return _dict
def _to_dict(self):
@@ -90101,88 +93154,69 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this BareMetalServerProfileDiskQuantityDependent object."""
+ """Return a `str` version of this VolumeAttachmentDevice object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'BareMetalServerProfileDiskQuantityDependent') -> 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: 'BareMetalServerProfileDiskQuantityDependent') -> bool:
+ def __ne__(self, other: 'VolumeAttachmentDevice') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class TypeEnum(str, Enum):
- """
- The type for this profile field.
- """
-
- DEPENDENT = 'dependent'
-
-
-class BareMetalServerProfileDiskQuantityEnum(BareMetalServerProfileDiskQuantity):
+class VolumeAttachmentPatch:
"""
- The permitted the number of disks of this configuration for a bare metal server with
- this profile.
+ VolumeAttachmentPatch.
- :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.
+ :param bool delete_volume_on_instance_delete: (optional) Indicates whether
+ deleting the instance will also delete the attached volume.
+ :param str name: (optional) The name for this volume attachment. The name must
+ not be used by another volume attachment on the instance.
"""
def __init__(
self,
- default: int,
- type: str,
- values: List[int],
+ *,
+ delete_volume_on_instance_delete: Optional[bool] = None,
+ name: Optional[str] = None,
) -> None:
"""
- Initialize a BareMetalServerProfileDiskQuantityEnum object.
+ Initialize a VolumeAttachmentPatch object.
- :param int default: The default value for this profile field.
- :param str type: The type for this profile field.
- :param List[int] values: The permitted values for this profile field.
+ :param bool delete_volume_on_instance_delete: (optional) Indicates whether
+ deleting the instance will also delete the attached volume.
+ :param str name: (optional) The name for this volume attachment. The name
+ must not be used by another volume attachment on the instance.
"""
- # pylint: disable=super-init-not-called
- self.default = default
- self.type = type
- self.values = values
+ self.delete_volume_on_instance_delete = delete_volume_on_instance_delete
+ self.name = name
@classmethod
- def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileDiskQuantityEnum':
- """Initialize a BareMetalServerProfileDiskQuantityEnum object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VolumeAttachmentPatch':
+ """Initialize a VolumeAttachmentPatch object from a json dictionary."""
args = {}
- if 'default' in _dict:
- args['default'] = _dict.get('default')
- else:
- raise ValueError('Required property \'default\' not present in BareMetalServerProfileDiskQuantityEnum JSON')
- if 'type' in _dict:
- args['type'] = _dict.get('type')
- else:
- raise ValueError('Required property \'type\' not present in BareMetalServerProfileDiskQuantityEnum JSON')
- if 'values' in _dict:
- args['values'] = _dict.get('values')
- else:
- raise ValueError('Required property \'values\' not present in BareMetalServerProfileDiskQuantityEnum JSON')
+ if (delete_volume_on_instance_delete := _dict.get('delete_volume_on_instance_delete')) is not None:
+ args['delete_volume_on_instance_delete'] = delete_volume_on_instance_delete
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a BareMetalServerProfileDiskQuantityEnum 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, '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, '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):
@@ -90190,77 +93224,86 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this BareMetalServerProfileDiskQuantityEnum object."""
+ """Return a `str` version of this VolumeAttachmentPatch object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'BareMetalServerProfileDiskQuantityEnum') -> 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: 'BareMetalServerProfileDiskQuantityEnum') -> bool:
+ def __ne__(self, other: 'VolumeAttachmentPatch') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class TypeEnum(str, Enum):
- """
- The type for this profile field.
- """
-
- ENUM = 'enum'
-
-
-class BareMetalServerProfileDiskQuantityFixed(BareMetalServerProfileDiskQuantity):
+class VolumeAttachmentPrototype:
"""
- The number of disks of this configuration for a bare metal server with this profile.
+ VolumeAttachmentPrototype.
- :attr str type: The type for this profile field.
- :attr int value: The value for this profile field.
+ :param bool delete_volume_on_instance_delete: (optional) Indicates whether
+ deleting the instance will also delete the attached volume.
+ :param str name: (optional) The name for this volume attachment. The name must
+ not be used by another volume attachment on the instance. If unspecified, the
+ name will be a hyphenated list of randomly-selected words.
+ :param VolumeAttachmentPrototypeVolume volume: An existing volume to attach to
+ the instance, or a prototype object for a new volume.
"""
def __init__(
self,
- type: str,
- value: int,
+ volume: 'VolumeAttachmentPrototypeVolume',
+ *,
+ delete_volume_on_instance_delete: Optional[bool] = None,
+ name: Optional[str] = None,
) -> None:
"""
- Initialize a BareMetalServerProfileDiskQuantityFixed object.
+ Initialize a VolumeAttachmentPrototype object.
- :param str type: The type for this profile field.
- :param int value: The value for this profile field.
+ :param VolumeAttachmentPrototypeVolume volume: An existing volume to attach
+ to the instance, or a prototype object for a new volume.
+ :param bool delete_volume_on_instance_delete: (optional) Indicates whether
+ deleting the instance will also delete the attached volume.
+ :param str name: (optional) The name for this volume attachment. The name
+ must not be used by another volume attachment on the instance. If
+ unspecified, the name will be a hyphenated list of randomly-selected words.
"""
- # pylint: disable=super-init-not-called
- self.type = type
- self.value = value
+ self.delete_volume_on_instance_delete = delete_volume_on_instance_delete
+ self.name = name
+ self.volume = volume
@classmethod
- def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileDiskQuantityFixed':
- """Initialize a BareMetalServerProfileDiskQuantityFixed object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VolumeAttachmentPrototype':
+ """Initialize a VolumeAttachmentPrototype object from a json dictionary."""
args = {}
- if 'type' in _dict:
- args['type'] = _dict.get('type')
- else:
- raise ValueError('Required property \'type\' not present in BareMetalServerProfileDiskQuantityFixed JSON')
- if 'value' in _dict:
- args['value'] = _dict.get('value')
+ if (delete_volume_on_instance_delete := _dict.get('delete_volume_on_instance_delete')) is not None:
+ args['delete_volume_on_instance_delete'] = delete_volume_on_instance_delete
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ if (volume := _dict.get('volume')) is not None:
+ args['volume'] = volume
else:
- raise ValueError('Required property \'value\' not present in BareMetalServerProfileDiskQuantityFixed JSON')
+ raise ValueError('Required property \'volume\' not present in VolumeAttachmentPrototype JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a BareMetalServerProfileDiskQuantityFixed object from a json dictionary."""
+ """Initialize a VolumeAttachmentPrototype object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, '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, '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):
@@ -90268,108 +93311,86 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this BareMetalServerProfileDiskQuantityFixed object."""
+ """Return a `str` version of this VolumeAttachmentPrototype object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'BareMetalServerProfileDiskQuantityFixed') -> bool:
+ def __eq__(self, other: 'VolumeAttachmentPrototype') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'BareMetalServerProfileDiskQuantityFixed') -> bool:
+ def __ne__(self, other: 'VolumeAttachmentPrototype') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class TypeEnum(str, Enum):
- """
- The type for this profile field.
- """
-
- FIXED = 'fixed'
-
-
-class BareMetalServerProfileDiskQuantityRange(BareMetalServerProfileDiskQuantity):
+class VolumeAttachmentPrototypeInstanceByImageContext:
"""
- The permitted range for the number of disks of this configuration for a bare metal
- server with this profile.
+ VolumeAttachmentPrototypeInstanceByImageContext.
- :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.
+ :param bool delete_volume_on_instance_delete: (optional) Indicates whether
+ deleting the instance will also delete the attached volume.
+ :param str name: (optional) The name for this volume attachment. The name must
+ not be used by another volume attachment on the instance. If unspecified, the
+ name will be a hyphenated list of randomly-selected words.
+ :param VolumePrototypeInstanceByImageContext volume: A prototype object for a
+ new volume.
"""
def __init__(
self,
- default: int,
- max: int,
- min: int,
- step: int,
- type: str,
+ volume: 'VolumePrototypeInstanceByImageContext',
+ *,
+ delete_volume_on_instance_delete: Optional[bool] = None,
+ name: Optional[str] = None,
) -> None:
"""
- Initialize a BareMetalServerProfileDiskQuantityRange object.
+ Initialize a VolumeAttachmentPrototypeInstanceByImageContext object.
- :param int default: The default value for this profile field.
- :param int max: The maximum value for this profile field.
- :param int min: The minimum value for this profile field.
- :param int step: The increment step value for this profile field.
- :param str type: The type for this profile field.
+ :param VolumePrototypeInstanceByImageContext volume: A prototype object for
+ a new volume.
+ :param bool delete_volume_on_instance_delete: (optional) Indicates whether
+ deleting the instance will also delete the attached volume.
+ :param str name: (optional) The name for this volume attachment. The name
+ must not be used by another volume attachment on the instance. If
+ unspecified, the name will be a hyphenated list of randomly-selected words.
"""
- # pylint: disable=super-init-not-called
- self.default = default
- self.max = max
- self.min = min
- self.step = step
- self.type = type
+ self.delete_volume_on_instance_delete = delete_volume_on_instance_delete
+ self.name = name
+ self.volume = volume
@classmethod
- def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileDiskQuantityRange':
- """Initialize a BareMetalServerProfileDiskQuantityRange object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VolumeAttachmentPrototypeInstanceByImageContext':
+ """Initialize a VolumeAttachmentPrototypeInstanceByImageContext object from a json dictionary."""
args = {}
- if 'default' in _dict:
- args['default'] = _dict.get('default')
- else:
- raise ValueError('Required property \'default\' not present in BareMetalServerProfileDiskQuantityRange JSON')
- if 'max' in _dict:
- args['max'] = _dict.get('max')
- else:
- raise ValueError('Required property \'max\' not present in BareMetalServerProfileDiskQuantityRange JSON')
- if 'min' in _dict:
- args['min'] = _dict.get('min')
+ if (delete_volume_on_instance_delete := _dict.get('delete_volume_on_instance_delete')) is not None:
+ args['delete_volume_on_instance_delete'] = delete_volume_on_instance_delete
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ if (volume := _dict.get('volume')) is not None:
+ args['volume'] = VolumePrototypeInstanceByImageContext.from_dict(volume)
else:
- raise ValueError('Required property \'min\' not present in BareMetalServerProfileDiskQuantityRange JSON')
- if 'step' in _dict:
- args['step'] = _dict.get('step')
- else:
- raise ValueError('Required property \'step\' not present in BareMetalServerProfileDiskQuantityRange JSON')
- if 'type' in _dict:
- args['type'] = _dict.get('type')
- else:
- raise ValueError('Required property \'type\' not present in BareMetalServerProfileDiskQuantityRange JSON')
+ raise ValueError('Required property \'volume\' not present in VolumeAttachmentPrototypeInstanceByImageContext JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a BareMetalServerProfileDiskQuantityRange 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, 'default') and self.default is not None:
- _dict['default'] = self.default
- if hasattr(self, 'max') and self.max is not None:
- _dict['max'] = self.max
- if hasattr(self, 'min') and self.min is not None:
- _dict['min'] = self.min
- if hasattr(self, 'step') and self.step is not None:
- _dict['step'] = self.step
- if hasattr(self, 'type') and self.type is not None:
- _dict['type'] = self.type
+ if hasattr(self, '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):
@@ -90377,68 +93398,86 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this BareMetalServerProfileDiskQuantityRange object."""
+ """Return a `str` version of this VolumeAttachmentPrototypeInstanceByImageContext object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'BareMetalServerProfileDiskQuantityRange') -> 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: 'BareMetalServerProfileDiskQuantityRange') -> bool:
+ def __ne__(self, other: 'VolumeAttachmentPrototypeInstanceByImageContext') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class TypeEnum(str, Enum):
- """
- The type for this profile field.
- """
-
- RANGE = 'range'
-
-
-class BareMetalServerProfileDiskSizeDependent(BareMetalServerProfileDiskSize):
+class VolumeAttachmentPrototypeInstanceBySourceSnapshotContext:
"""
- The disk size in GB (gigabytes) of this configuration for a bare metal server with
- this profile depends on its bare metal server configuration.
+ VolumeAttachmentPrototypeInstanceBySourceSnapshotContext.
- :attr str type: The type for this profile field.
+ :param bool delete_volume_on_instance_delete: (optional) Indicates whether
+ deleting the instance will also delete the attached volume.
+ :param str name: (optional) The name for this volume attachment. The name must
+ not be used by another volume attachment on the instance. If unspecified, the
+ name will be a hyphenated list of randomly-selected words.
+ :param VolumePrototypeInstanceBySourceSnapshotContext volume: A prototype object
+ for a new volume from a snapshot.
"""
def __init__(
self,
- type: str,
+ volume: 'VolumePrototypeInstanceBySourceSnapshotContext',
+ *,
+ delete_volume_on_instance_delete: Optional[bool] = None,
+ name: Optional[str] = None,
) -> None:
"""
- Initialize a BareMetalServerProfileDiskSizeDependent object.
+ Initialize a VolumeAttachmentPrototypeInstanceBySourceSnapshotContext object.
- :param str type: The type for this profile field.
+ :param VolumePrototypeInstanceBySourceSnapshotContext volume: A prototype
+ object for a new volume from a snapshot.
+ :param bool delete_volume_on_instance_delete: (optional) Indicates whether
+ deleting the instance will also delete the attached volume.
+ :param str name: (optional) The name for this volume attachment. The name
+ must not be used by another volume attachment on the instance. If
+ unspecified, the name will be a hyphenated list of randomly-selected words.
"""
- # pylint: disable=super-init-not-called
- self.type = type
+ self.delete_volume_on_instance_delete = delete_volume_on_instance_delete
+ self.name = name
+ self.volume = volume
@classmethod
- def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileDiskSizeDependent':
- """Initialize a BareMetalServerProfileDiskSizeDependent object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VolumeAttachmentPrototypeInstanceBySourceSnapshotContext':
+ """Initialize a VolumeAttachmentPrototypeInstanceBySourceSnapshotContext object from a json dictionary."""
args = {}
- if 'type' in _dict:
- args['type'] = _dict.get('type')
+ if (delete_volume_on_instance_delete := _dict.get('delete_volume_on_instance_delete')) is not None:
+ args['delete_volume_on_instance_delete'] = delete_volume_on_instance_delete
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ if (volume := _dict.get('volume')) is not None:
+ args['volume'] = VolumePrototypeInstanceBySourceSnapshotContext.from_dict(volume)
else:
- raise ValueError('Required property \'type\' not present in BareMetalServerProfileDiskSizeDependent JSON')
+ raise ValueError('Required property \'volume\' not present in VolumeAttachmentPrototypeInstanceBySourceSnapshotContext JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a BareMetalServerProfileDiskSizeDependent object from a json dictionary."""
+ """Initialize a VolumeAttachmentPrototypeInstanceBySourceSnapshotContext object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'type') and self.type is not None:
- _dict['type'] = self.type
+ 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):
@@ -90446,88 +93485,84 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this BareMetalServerProfileDiskSizeDependent object."""
+ """Return a `str` version of this VolumeAttachmentPrototypeInstanceBySourceSnapshotContext object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'BareMetalServerProfileDiskSizeDependent') -> bool:
+ def __eq__(self, other: 'VolumeAttachmentPrototypeInstanceBySourceSnapshotContext') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'BareMetalServerProfileDiskSizeDependent') -> bool:
+ def __ne__(self, other: 'VolumeAttachmentPrototypeInstanceBySourceSnapshotContext') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class TypeEnum(str, Enum):
- """
- The type for this profile field.
- """
-
- DEPENDENT = 'dependent'
-
-
-class BareMetalServerProfileDiskSizeEnum(BareMetalServerProfileDiskSize):
+class VolumeAttachmentPrototypeInstanceByVolumeContext:
"""
- The permitted disk size in GB (gigabytes) of this configuration for a bare metal
- server with this profile.
+ VolumeAttachmentPrototypeInstanceByVolumeContext.
- :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.
+ :param bool delete_volume_on_instance_delete: (optional) Indicates whether
+ deleting the instance will also delete the attached volume.
+ :param str name: (optional) The name for this volume attachment. The name must
+ not be used by another volume attachment on the instance. If unspecified, the
+ name will be a hyphenated list of randomly-selected words.
+ :param VolumeIdentity volume: An existing volume to attach.
"""
def __init__(
self,
- default: int,
- type: str,
- values: List[int],
+ volume: 'VolumeIdentity',
+ *,
+ delete_volume_on_instance_delete: Optional[bool] = None,
+ name: Optional[str] = None,
) -> None:
"""
- Initialize a BareMetalServerProfileDiskSizeEnum object.
+ Initialize a VolumeAttachmentPrototypeInstanceByVolumeContext object.
- :param int default: The default value for this profile field.
- :param str type: The type for this profile field.
- :param List[int] values: The permitted values for this profile field.
- """
- # pylint: disable=super-init-not-called
- self.default = default
- self.type = type
- self.values = values
+ :param VolumeIdentity volume: An existing volume to attach.
+ :param bool delete_volume_on_instance_delete: (optional) Indicates whether
+ deleting the instance will also delete the attached volume.
+ :param str name: (optional) The name for this volume attachment. The name
+ must not be used by another volume attachment on the instance. If
+ unspecified, the name will be a hyphenated list of randomly-selected words.
+ """
+ self.delete_volume_on_instance_delete = delete_volume_on_instance_delete
+ self.name = name
+ self.volume = volume
@classmethod
- def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileDiskSizeEnum':
- """Initialize a BareMetalServerProfileDiskSizeEnum object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VolumeAttachmentPrototypeInstanceByVolumeContext':
+ """Initialize a VolumeAttachmentPrototypeInstanceByVolumeContext object from a json dictionary."""
args = {}
- if 'default' in _dict:
- args['default'] = _dict.get('default')
- else:
- raise ValueError('Required property \'default\' not present in BareMetalServerProfileDiskSizeEnum JSON')
- if 'type' in _dict:
- args['type'] = _dict.get('type')
+ if (delete_volume_on_instance_delete := _dict.get('delete_volume_on_instance_delete')) is not None:
+ args['delete_volume_on_instance_delete'] = delete_volume_on_instance_delete
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ if (volume := _dict.get('volume')) is not None:
+ args['volume'] = volume
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')
+ raise ValueError('Required property \'volume\' not present in VolumeAttachmentPrototypeInstanceByVolumeContext JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a BareMetalServerProfileDiskSizeEnum 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, '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, '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):
@@ -90535,77 +93570,149 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this BareMetalServerProfileDiskSizeEnum object."""
+ """Return a `str` version of this VolumeAttachmentPrototypeInstanceByVolumeContext object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'BareMetalServerProfileDiskSizeEnum') -> 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: 'BareMetalServerProfileDiskSizeEnum') -> bool:
+ def __ne__(self, other: 'VolumeAttachmentPrototypeInstanceByVolumeContext') -> 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 VolumeAttachmentPrototypeVolume:
+ """
+ An existing volume to attach to the instance, or a prototype object for a new volume.
+ """
+ def __init__(
+ self,
+ ) -> None:
+ """
+ Initialize a VolumeAttachmentPrototypeVolume object.
-class BareMetalServerProfileDiskSizeFixed(BareMetalServerProfileDiskSize):
+ """
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['VolumeAttachmentPrototypeVolumeVolumeIdentity', 'VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContext'])
+ )
+ raise Exception(msg)
+
+
+class VolumeAttachmentReferenceInstanceContext:
"""
- The size of the disk in GB (gigabytes).
+ VolumeAttachmentReferenceInstanceContext.
- :attr str type: The type for this profile field.
- :attr int value: The value for this profile field.
+ :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 str href: The URL for this volume attachment.
+ :param str id: The unique identifier for this volume attachment.
+ :param str name: The name for this volume attachment. The name is unique across
+ all volume attachments on the instance.
+ :param VolumeReferenceVolumeAttachmentContext volume: (optional) The attached
+ volume.
+ This property will be absent if the volume has not yet been provisioned.
"""
def __init__(
self,
- type: str,
- value: int,
+ href: str,
+ id: str,
+ name: str,
+ *,
+ deleted: Optional['VolumeAttachmentReferenceInstanceContextDeleted'] = None,
+ device: Optional['VolumeAttachmentDevice'] = None,
+ volume: Optional['VolumeReferenceVolumeAttachmentContext'] = None,
) -> None:
"""
- Initialize a BareMetalServerProfileDiskSizeFixed object.
+ Initialize a VolumeAttachmentReferenceInstanceContext object.
- :param str type: The type for this profile field.
- :param int value: The value for this profile field.
+ :param str href: The URL for this volume attachment.
+ :param str id: The unique identifier for this volume attachment.
+ :param str name: The name for this volume attachment. The name is unique
+ across all volume attachments on the instance.
+ :param VolumeAttachmentReferenceInstanceContextDeleted deleted: (optional)
+ If present, this property indicates the referenced resource has been
+ deleted, and provides
+ some supplementary information.
+ :param VolumeAttachmentDevice device: (optional) Information about how the
+ volume is exposed to the instance operating system.
+ This property may be absent if the volume attachment's `status` is not
+ `attached`.
+ :param VolumeReferenceVolumeAttachmentContext volume: (optional) The
+ attached volume.
+ This property will be absent if the volume has not yet been provisioned.
"""
- # pylint: disable=super-init-not-called
- self.type = type
- self.value = value
+ 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) -> 'BareMetalServerProfileDiskSizeFixed':
- """Initialize a BareMetalServerProfileDiskSizeFixed object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VolumeAttachmentReferenceInstanceContext':
+ """Initialize a VolumeAttachmentReferenceInstanceContext object from a json dictionary."""
args = {}
- if 'type' in _dict:
- args['type'] = _dict.get('type')
+ if (deleted := _dict.get('deleted')) is not None:
+ args['deleted'] = VolumeAttachmentReferenceInstanceContextDeleted.from_dict(deleted)
+ if (device := _dict.get('device')) is not None:
+ args['device'] = VolumeAttachmentDevice.from_dict(device)
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'type\' not present in BareMetalServerProfileDiskSizeFixed JSON')
- if 'value' in _dict:
- args['value'] = _dict.get('value')
+ raise ValueError('Required property \'href\' not present in VolumeAttachmentReferenceInstanceContext JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
else:
- raise ValueError('Required property \'value\' not present in BareMetalServerProfileDiskSizeFixed JSON')
+ raise ValueError('Required property \'id\' not present in VolumeAttachmentReferenceInstanceContext JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ else:
+ raise ValueError('Required property \'name\' not present in VolumeAttachmentReferenceInstanceContext JSON')
+ if (volume := _dict.get('volume')) is not None:
+ args['volume'] = VolumeReferenceVolumeAttachmentContext.from_dict(volume)
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a BareMetalServerProfileDiskSizeFixed 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, 'type') and self.type is not None:
- _dict['type'] = self.type
- if hasattr(self, 'value') and self.value is not None:
- _dict['value'] = self.value
+ if hasattr(self, 'deleted') and self.deleted is not None:
+ if isinstance(self.deleted, dict):
+ _dict['deleted'] = self.deleted
+ else:
+ _dict['deleted'] = self.deleted.to_dict()
+ if hasattr(self, 'device') and self.device is not None:
+ if isinstance(self.device, dict):
+ _dict['device'] = self.device
+ else:
+ _dict['device'] = self.device.to_dict()
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
+ if hasattr(self, 'id') and self.id is not None:
+ _dict['id'] = self.id
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ if hasattr(self, 'volume') and self.volume is not None:
+ if isinstance(self.volume, dict):
+ _dict['volume'] = self.volume
+ else:
+ _dict['volume'] = self.volume.to_dict()
return _dict
def _to_dict(self):
@@ -90613,108 +93720,59 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this BareMetalServerProfileDiskSizeFixed object."""
+ """Return a `str` version of this VolumeAttachmentReferenceInstanceContext object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'BareMetalServerProfileDiskSizeFixed') -> 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: 'BareMetalServerProfileDiskSizeFixed') -> bool:
+ def __ne__(self, other: 'VolumeAttachmentReferenceInstanceContext') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class TypeEnum(str, Enum):
- """
- The type for this profile field.
- """
-
- FIXED = 'fixed'
-
-
-class BareMetalServerProfileDiskSizeRange(BareMetalServerProfileDiskSize):
+class VolumeAttachmentReferenceInstanceContextDeleted:
"""
- The permitted range for the disk size of this configuration in GB (gigabytes) for a
- bare metal server with this profile.
+ If present, this property indicates the referenced resource has been deleted, and
+ provides some supplementary information.
- :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.
+ :param str more_info: Link to documentation about deleted resources.
"""
def __init__(
self,
- default: int,
- max: int,
- min: int,
- step: int,
- type: str,
+ more_info: str,
) -> None:
"""
- Initialize a BareMetalServerProfileDiskSizeRange object.
+ Initialize a VolumeAttachmentReferenceInstanceContextDeleted object.
- :param int default: The default value for this profile field.
- :param int max: The maximum value for this profile field.
- :param int min: The minimum value for this profile field.
- :param int step: The increment step value for this profile field.
- :param str type: The type for this profile field.
+ :param str more_info: Link to documentation about deleted resources.
"""
- # pylint: disable=super-init-not-called
- self.default = default
- self.max = max
- self.min = min
- self.step = step
- self.type = type
+ self.more_info = more_info
@classmethod
- def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileDiskSizeRange':
- """Initialize a BareMetalServerProfileDiskSizeRange object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VolumeAttachmentReferenceInstanceContextDeleted':
+ """Initialize a VolumeAttachmentReferenceInstanceContextDeleted object from a json dictionary."""
args = {}
- if 'default' in _dict:
- args['default'] = _dict.get('default')
- else:
- raise ValueError('Required property \'default\' not present in BareMetalServerProfileDiskSizeRange JSON')
- if 'max' in _dict:
- args['max'] = _dict.get('max')
- else:
- raise ValueError('Required property \'max\' not present in BareMetalServerProfileDiskSizeRange JSON')
- if 'min' in _dict:
- args['min'] = _dict.get('min')
+ if (more_info := _dict.get('more_info')) is not None:
+ args['more_info'] = more_info
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')
+ raise ValueError('Required property \'more_info\' not present in VolumeAttachmentReferenceInstanceContextDeleted JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a BareMetalServerProfileDiskSizeRange object from a json dictionary."""
+ """Initialize a VolumeAttachmentReferenceInstanceContextDeleted object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'default') and self.default is not None:
- _dict['default'] = self.default
- if hasattr(self, 'max') and self.max is not None:
- _dict['max'] = self.max
- if hasattr(self, 'min') and self.min is not None:
- _dict['min'] = self.min
- if hasattr(self, 'step') and self.step is not None:
- _dict['step'] = self.step
- if hasattr(self, 'type') and self.type is not None:
- _dict['type'] = self.type
+ if hasattr(self, 'more_info') and self.more_info is not None:
+ _dict['more_info'] = self.more_info
return _dict
def _to_dict(self):
@@ -90722,67 +93780,150 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this BareMetalServerProfileDiskSizeRange object."""
+ """Return a `str` version of this VolumeAttachmentReferenceInstanceContextDeleted object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'BareMetalServerProfileDiskSizeRange') -> 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: 'BareMetalServerProfileDiskSizeRange') -> bool:
+ def __ne__(self, other: 'VolumeAttachmentReferenceInstanceContextDeleted') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class TypeEnum(str, Enum):
- """
- The type for this profile field.
- """
-
- RANGE = 'range'
-
-
-class BareMetalServerProfileIdentityByHref(BareMetalServerProfileIdentity):
+class VolumeAttachmentReferenceVolumeContext:
"""
- BareMetalServerProfileIdentityByHref.
+ VolumeAttachmentReferenceVolumeContext.
- :attr str href: The URL for this bare metal server profile.
+ :param bool delete_volume_on_instance_delete: Indicates whether deleting the
+ instance will also delete the attached volume.
+ :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`.
+ :param str href: The URL for this volume attachment.
+ :param str id: The unique identifier for this volume attachment.
+ :param InstanceReference instance: The attached instance.
+ :param str name: The name for this volume attachment. The name is unique across
+ all volume attachments on the instance.
+ :param str type: The type of volume attachment.
"""
def __init__(
self,
+ delete_volume_on_instance_delete: bool,
href: str,
+ id: str,
+ instance: 'InstanceReference',
+ name: str,
+ type: str,
+ *,
+ deleted: Optional['VolumeAttachmentReferenceVolumeContextDeleted'] = None,
+ device: Optional['VolumeAttachmentDevice'] = None,
) -> None:
"""
- Initialize a BareMetalServerProfileIdentityByHref object.
+ Initialize a VolumeAttachmentReferenceVolumeContext object.
- :param str href: The URL for this bare metal server profile.
+ :param bool delete_volume_on_instance_delete: Indicates whether deleting
+ the instance will also delete the attached volume.
+ :param str href: The URL for this volume attachment.
+ :param str id: The unique identifier for this volume attachment.
+ :param InstanceReference instance: The attached instance.
+ :param str name: The name for this volume attachment. The name is unique
+ across all volume attachments on the instance.
+ :param str type: The type of volume attachment.
+ :param VolumeAttachmentReferenceVolumeContextDeleted deleted: (optional) If
+ present, this property indicates the referenced resource has been deleted,
+ and provides
+ some supplementary information.
+ :param VolumeAttachmentDevice device: (optional) Information about how the
+ volume is exposed to the instance operating system.
+ This property may be absent if the volume attachment's `status` is not
+ `attached`.
"""
- # pylint: disable=super-init-not-called
+ 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.type = type
@classmethod
- def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileIdentityByHref':
- """Initialize a BareMetalServerProfileIdentityByHref object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VolumeAttachmentReferenceVolumeContext':
+ """Initialize a VolumeAttachmentReferenceVolumeContext object from a json dictionary."""
args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ if (delete_volume_on_instance_delete := _dict.get('delete_volume_on_instance_delete')) is not None:
+ args['delete_volume_on_instance_delete'] = delete_volume_on_instance_delete
else:
- raise ValueError('Required property \'href\' not present in BareMetalServerProfileIdentityByHref JSON')
+ raise ValueError('Required property \'delete_volume_on_instance_delete\' not present in VolumeAttachmentReferenceVolumeContext JSON')
+ if (deleted := _dict.get('deleted')) is not None:
+ args['deleted'] = VolumeAttachmentReferenceVolumeContextDeleted.from_dict(deleted)
+ if (device := _dict.get('device')) is not None:
+ args['device'] = VolumeAttachmentDevice.from_dict(device)
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
+ else:
+ raise ValueError('Required property \'href\' not present in VolumeAttachmentReferenceVolumeContext JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
+ else:
+ raise ValueError('Required property \'id\' not present in VolumeAttachmentReferenceVolumeContext JSON')
+ if (instance := _dict.get('instance')) is not None:
+ args['instance'] = InstanceReference.from_dict(instance)
+ else:
+ raise ValueError('Required property \'instance\' not present in VolumeAttachmentReferenceVolumeContext JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ else:
+ raise ValueError('Required property \'name\' not present in VolumeAttachmentReferenceVolumeContext JSON')
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
+ else:
+ raise ValueError('Required property \'type\' not present in VolumeAttachmentReferenceVolumeContext JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a BareMetalServerProfileIdentityByHref object from a json dictionary."""
+ """Initialize a VolumeAttachmentReferenceVolumeContext object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
+ if hasattr(self, 'delete_volume_on_instance_delete') and self.delete_volume_on_instance_delete is not None:
+ _dict['delete_volume_on_instance_delete'] = self.delete_volume_on_instance_delete
+ if hasattr(self, 'deleted') and self.deleted is not None:
+ if isinstance(self.deleted, dict):
+ _dict['deleted'] = self.deleted
+ else:
+ _dict['deleted'] = self.deleted.to_dict()
+ if hasattr(self, 'device') and self.device is not None:
+ if isinstance(self.device, dict):
+ _dict['device'] = self.device
+ else:
+ _dict['device'] = self.device.to_dict()
if hasattr(self, 'href') and self.href is not None:
_dict['href'] = self.href
+ if hasattr(self, 'id') and self.id is not None:
+ _dict['id'] = self.id
+ if hasattr(self, 'instance') and self.instance is not None:
+ if isinstance(self.instance, dict):
+ _dict['instance'] = self.instance
+ else:
+ _dict['instance'] = self.instance.to_dict()
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ if hasattr(self, 'type') and self.type is not None:
+ _dict['type'] = self.type
return _dict
def _to_dict(self):
@@ -90790,59 +93931,68 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this BareMetalServerProfileIdentityByHref object."""
+ """Return a `str` version of this VolumeAttachmentReferenceVolumeContext object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'BareMetalServerProfileIdentityByHref') -> 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: 'BareMetalServerProfileIdentityByHref') -> bool:
+ def __ne__(self, other: 'VolumeAttachmentReferenceVolumeContext') -> 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.
+ """
+
+ BOOT = 'boot'
+ DATA = 'data'
+
-class BareMetalServerProfileIdentityByName(BareMetalServerProfileIdentity):
+
+class VolumeAttachmentReferenceVolumeContextDeleted:
"""
- BareMetalServerProfileIdentityByName.
+ If present, this property indicates the referenced resource has been deleted, and
+ provides some supplementary information.
- :attr str name: The name for this bare metal server profile.
+ :param str more_info: Link to documentation about deleted resources.
"""
def __init__(
self,
- name: str,
+ more_info: str,
) -> None:
"""
- Initialize a BareMetalServerProfileIdentityByName object.
+ Initialize a VolumeAttachmentReferenceVolumeContextDeleted object.
- :param str name: The name for this bare metal server profile.
+ :param str more_info: Link to documentation about deleted resources.
"""
- # pylint: disable=super-init-not-called
- self.name = name
+ self.more_info = more_info
@classmethod
- def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileIdentityByName':
- """Initialize a BareMetalServerProfileIdentityByName object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VolumeAttachmentReferenceVolumeContextDeleted':
+ """Initialize a VolumeAttachmentReferenceVolumeContextDeleted object from a json dictionary."""
args = {}
- if 'name' in _dict:
- args['name'] = _dict.get('name')
+ if (more_info := _dict.get('more_info')) is not None:
+ args['more_info'] = more_info
else:
- raise ValueError('Required property \'name\' not present in BareMetalServerProfileIdentityByName JSON')
+ raise ValueError('Required property \'more_info\' not present in VolumeAttachmentReferenceVolumeContextDeleted JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a BareMetalServerProfileIdentityByName 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, '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):
@@ -90850,60 +94000,115 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this BareMetalServerProfileIdentityByName object."""
+ """Return a `str` version of this VolumeAttachmentReferenceVolumeContextDeleted object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'BareMetalServerProfileIdentityByName') -> 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: 'BareMetalServerProfileIdentityByName') -> bool:
+ def __ne__(self, other: 'VolumeAttachmentReferenceVolumeContextDeleted') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class BareMetalServerProfileMemoryDependent(BareMetalServerProfileMemory):
+class VolumeCollection:
"""
- The memory value for a bare metal server with this profile depends on its
- configuration.
+ VolumeCollection.
- :attr str type: The type for this profile field.
+ :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 VolumeCollectionNext next: (optional) A link to the next page of
+ resources. This property is present for all pages
+ except the last page.
+ :param int total_count: The total number of resources across all pages.
+ :param List[Volume] volumes: Collection of volumes.
"""
def __init__(
self,
- type: str,
+ first: 'VolumeCollectionFirst',
+ limit: int,
+ total_count: int,
+ volumes: List['Volume'],
+ *,
+ next: Optional['VolumeCollectionNext'] = None,
) -> None:
"""
- Initialize a BareMetalServerProfileMemoryDependent object.
+ Initialize a VolumeCollection object.
- :param str type: The type for this profile field.
+ :param VolumeCollectionFirst first: A link to the first page of resources.
+ :param int limit: The maximum number of resources that can be returned by
+ the request.
+ :param int total_count: The total number of resources across all pages.
+ :param List[Volume] volumes: Collection of volumes.
+ :param VolumeCollectionNext next: (optional) A link to the next page of
+ resources. This property is present for all pages
+ except the last page.
"""
- # pylint: disable=super-init-not-called
- self.type = type
+ self.first = first
+ self.limit = limit
+ self.next = next
+ self.total_count = total_count
+ self.volumes = volumes
@classmethod
- def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileMemoryDependent':
- """Initialize a BareMetalServerProfileMemoryDependent object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VolumeCollection':
+ """Initialize a VolumeCollection object from a json dictionary."""
args = {}
- if 'type' in _dict:
- args['type'] = _dict.get('type')
+ if (first := _dict.get('first')) is not None:
+ args['first'] = VolumeCollectionFirst.from_dict(first)
else:
- raise ValueError('Required property \'type\' not present in BareMetalServerProfileMemoryDependent JSON')
+ raise ValueError('Required property \'first\' not present in VolumeCollection JSON')
+ if (limit := _dict.get('limit')) is not None:
+ args['limit'] = limit
+ else:
+ raise ValueError('Required property \'limit\' not present in VolumeCollection JSON')
+ if (next := _dict.get('next')) is not None:
+ args['next'] = VolumeCollectionNext.from_dict(next)
+ if (total_count := _dict.get('total_count')) is not None:
+ args['total_count'] = total_count
+ else:
+ raise ValueError('Required property \'total_count\' not present in VolumeCollection JSON')
+ if (volumes := _dict.get('volumes')) is not None:
+ args['volumes'] = [Volume.from_dict(v) for v in volumes]
+ else:
+ raise ValueError('Required property \'volumes\' not present in VolumeCollection JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a BareMetalServerProfileMemoryDependent object from a json dictionary."""
+ """Initialize a VolumeCollection object from 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, 'first') and self.first is not None:
+ if isinstance(self.first, dict):
+ _dict['first'] = self.first
+ else:
+ _dict['first'] = self.first.to_dict()
+ if hasattr(self, 'limit') and self.limit is not None:
+ _dict['limit'] = self.limit
+ if hasattr(self, 'next') and self.next is not None:
+ if isinstance(self.next, dict):
+ _dict['next'] = self.next
+ else:
+ _dict['next'] = self.next.to_dict()
+ if hasattr(self, 'total_count') and self.total_count is not None:
+ _dict['total_count'] = self.total_count
+ if hasattr(self, 'volumes') and self.volumes is not None:
+ volumes_list = []
+ for v in self.volumes:
+ if isinstance(v, dict):
+ volumes_list.append(v)
+ else:
+ volumes_list.append(v.to_dict())
+ _dict['volumes'] = volumes_list
return _dict
def _to_dict(self):
@@ -90911,87 +94116,58 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this BareMetalServerProfileMemoryDependent object."""
+ """Return a `str` version of this VolumeCollection object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'BareMetalServerProfileMemoryDependent') -> 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: 'BareMetalServerProfileMemoryDependent') -> bool:
+ def __ne__(self, other: 'VolumeCollection') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class TypeEnum(str, Enum):
- """
- The type for this profile field.
- """
-
- DEPENDENT = 'dependent'
-
-
-class BareMetalServerProfileMemoryEnum(BareMetalServerProfileMemory):
+class VolumeCollectionFirst:
"""
- The permitted memory values (in gibibytes) for a bare metal server with this profile.
+ A link to the first 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.
+ :param str href: The URL for a page of resources.
"""
def __init__(
self,
- default: int,
- type: str,
- values: List[int],
+ href: str,
) -> None:
"""
- Initialize a BareMetalServerProfileMemoryEnum object.
+ Initialize a VolumeCollectionFirst object.
- :param int default: The default value for this profile field.
- :param str type: The type for this profile field.
- :param List[int] values: The permitted values for this profile field.
+ :param str href: The URL for a page of resources.
"""
- # pylint: disable=super-init-not-called
- self.default = default
- self.type = type
- self.values = values
+ self.href = href
@classmethod
- def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileMemoryEnum':
- """Initialize a BareMetalServerProfileMemoryEnum object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VolumeCollectionFirst':
+ """Initialize a VolumeCollectionFirst object from a json dictionary."""
args = {}
- if 'default' in _dict:
- args['default'] = _dict.get('default')
- else:
- raise ValueError('Required property \'default\' not present in BareMetalServerProfileMemoryEnum JSON')
- if 'type' in _dict:
- args['type'] = _dict.get('type')
- else:
- raise ValueError('Required property \'type\' not present in BareMetalServerProfileMemoryEnum JSON')
- if 'values' in _dict:
- args['values'] = _dict.get('values')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'values\' not present in BareMetalServerProfileMemoryEnum JSON')
+ raise ValueError('Required property \'href\' not present in VolumeCollectionFirst JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a BareMetalServerProfileMemoryEnum object from a json dictionary."""
+ """Initialize a VolumeCollectionFirst object from 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, 'href') and self.href is not None:
+ _dict['href'] = self.href
return _dict
def _to_dict(self):
@@ -90999,77 +94175,59 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this BareMetalServerProfileMemoryEnum object."""
+ """Return a `str` version of this VolumeCollectionFirst object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'BareMetalServerProfileMemoryEnum') -> 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: 'BareMetalServerProfileMemoryEnum') -> bool:
+ def __ne__(self, other: 'VolumeCollectionFirst') -> 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 BareMetalServerProfileMemoryFixed(BareMetalServerProfileMemory):
+class VolumeCollectionNext:
"""
- The memory (in gibibytes) for a bare metal server with this profile.
+ A link to the next page of resources. This property is present for all pages except
+ the last page.
- :attr str type: The type for this profile field.
- :attr int value: The value for this profile field.
+ :param str href: The URL for a page of resources.
"""
def __init__(
self,
- type: str,
- value: int,
+ href: str,
) -> None:
"""
- Initialize a BareMetalServerProfileMemoryFixed object.
+ Initialize a VolumeCollectionNext object.
- :param str type: The type for this profile field.
- :param int value: The value for this profile field.
+ :param str href: The URL for a page of resources.
"""
- # pylint: disable=super-init-not-called
- self.type = type
- self.value = value
+ self.href = href
@classmethod
- def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileMemoryFixed':
- """Initialize a BareMetalServerProfileMemoryFixed object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VolumeCollectionNext':
+ """Initialize a VolumeCollectionNext object from a json dictionary."""
args = {}
- if 'type' in _dict:
- args['type'] = _dict.get('type')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- 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')
+ raise ValueError('Required property \'href\' not present in VolumeCollectionNext JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a BareMetalServerProfileMemoryFixed object from a json dictionary."""
+ """Initialize a VolumeCollectionNext object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'type') and self.type is not None:
- _dict['type'] = self.type
- if hasattr(self, 'value') and self.value is not None:
- _dict['value'] = self.value
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
return _dict
def _to_dict(self):
@@ -91077,107 +94235,81 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this BareMetalServerProfileMemoryFixed object."""
+ """Return a `str` version of this VolumeCollectionNext object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'BareMetalServerProfileMemoryFixed') -> 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: 'BareMetalServerProfileMemoryFixed') -> bool:
+ def __ne__(self, other: 'VolumeCollectionNext') -> 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 BareMetalServerProfileMemoryRange(BareMetalServerProfileMemory):
+class VolumeHealthReason:
"""
- The permitted memory range (in gibibytes) for a bare metal server with this profile.
+ VolumeHealthReason.
- :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.
+ :param str code: A snake case string succinctly identifying the reason for this
+ health state.
+ :param str message: An explanation of the reason for this health state.
+ :param str more_info: (optional) Link to documentation about the reason for this
+ health state.
"""
def __init__(
self,
- default: int,
- max: int,
- min: int,
- step: int,
- type: str,
+ code: str,
+ message: str,
+ *,
+ more_info: Optional[str] = None,
) -> None:
"""
- Initialize a BareMetalServerProfileMemoryRange object.
+ Initialize a VolumeHealthReason object.
- :param int default: The default value for this profile field.
- :param int max: The maximum value for this profile field.
- :param int min: The minimum value for this profile field.
- :param int step: The increment step value for this profile field.
- :param str type: The type for this profile field.
+ :param str code: A snake case string succinctly identifying the reason for
+ this health state.
+ :param str message: An explanation of the reason for this health state.
+ :param str more_info: (optional) Link to documentation about the reason for
+ this health state.
"""
- # pylint: disable=super-init-not-called
- self.default = default
- self.max = max
- self.min = min
- self.step = step
- self.type = type
+ self.code = code
+ self.message = message
+ self.more_info = more_info
@classmethod
- def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileMemoryRange':
- """Initialize a BareMetalServerProfileMemoryRange object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VolumeHealthReason':
+ """Initialize a VolumeHealthReason object from a json dictionary."""
args = {}
- if 'default' in _dict:
- args['default'] = _dict.get('default')
- else:
- raise ValueError('Required property \'default\' not present in BareMetalServerProfileMemoryRange JSON')
- if 'max' in _dict:
- args['max'] = _dict.get('max')
- else:
- 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')
+ if (code := _dict.get('code')) is not None:
+ args['code'] = code
else:
- raise ValueError('Required property \'step\' not present in BareMetalServerProfileMemoryRange JSON')
- if 'type' in _dict:
- args['type'] = _dict.get('type')
+ raise ValueError('Required property \'code\' not present in VolumeHealthReason JSON')
+ if (message := _dict.get('message')) is not None:
+ args['message'] = message
else:
- raise ValueError('Required property \'type\' not present in BareMetalServerProfileMemoryRange JSON')
+ raise ValueError('Required property \'message\' not present in VolumeHealthReason JSON')
+ if (more_info := _dict.get('more_info')) is not None:
+ args['more_info'] = more_info
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a BareMetalServerProfileMemoryRange object from a json dictionary."""
+ """Initialize a VolumeHealthReason object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'default') and self.default is not None:
- _dict['default'] = self.default
- if hasattr(self, 'max') and self.max is not None:
- _dict['max'] = self.max
- if hasattr(self, 'min') and self.min is not None:
- _dict['min'] = self.min
- if hasattr(self, 'step') and self.step is not None:
- _dict['step'] = self.step
- if hasattr(self, 'type') and self.type is not None:
- _dict['type'] = self.type
+ if hasattr(self, '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):
@@ -91185,68 +94317,153 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this BareMetalServerProfileMemoryRange object."""
+ """Return a `str` version of this VolumeHealthReason object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'BareMetalServerProfileMemoryRange') -> bool:
+ def __eq__(self, other: 'VolumeHealthReason') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'BareMetalServerProfileMemoryRange') -> bool:
+ def __ne__(self, other: 'VolumeHealthReason') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class TypeEnum(str, Enum):
+ class CodeEnum(str, Enum):
"""
- The type for this profile field.
+ A snake case string succinctly identifying the reason for this health state.
"""
- RANGE = 'range'
+ INITIALIZING_FROM_SNAPSHOT = 'initializing_from_snapshot'
-class BareMetalServerProfileNetworkInterfaceCountDependent(BareMetalServerProfileNetworkInterfaceCount):
+class VolumeIdentity:
"""
- The number of bare metal server network interfaces supported on a bare metal server
- with this profile is dependent on its configuration.
+ Identifies a volume by a unique property.
- :attr str type: The type for this profile field.
"""
def __init__(
self,
- type: str,
) -> None:
"""
- Initialize a BareMetalServerProfileNetworkInterfaceCountDependent object.
+ Initialize a VolumeIdentity object.
- :param str type: The type for this profile field.
"""
- # pylint: disable=super-init-not-called
- self.type = type
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['VolumeIdentityById', 'VolumeIdentityByCRN', 'VolumeIdentityByHref'])
+ )
+ raise Exception(msg)
+
+
+class VolumePatch:
+ """
+ VolumePatch.
+
+ :param int capacity: (optional) The capacity to use for the volume (in
+ gigabytes). The volume must be attached to a running virtual server instance,
+ and the specified value must not be less than the current capacity.
+ Additionally, if the volume is attached as a boot volume, the maximum value is
+ 250 gigabytes.
+ The minimum and maximum capacity limits for creating or updating volumes may
+ expand in the future.
+ :param int iops: (optional) The maximum I/O operations per second (IOPS) to use
+ for this volume. Applicable only to volumes using a profile `family` of
+ `custom`. The volume must be attached as a data volume to a running virtual
+ server instance.
+ :param str name: (optional) The name for this volume. The name must not be used
+ by another volume in the region.
+ :param VolumeProfileIdentity profile: (optional) The profile to use for this
+ volume. The requested profile must be in the same
+ `family` as the current profile. The volume must be attached as a data volume to
+ a running virtual server instance, and must have a `capacity` within the range
+ supported by the specified profile.
+ :param List[str] user_tags: (optional) The [user
+ tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with this
+ volume.
+ """
+
+ def __init__(
+ self,
+ *,
+ capacity: Optional[int] = None,
+ iops: Optional[int] = None,
+ name: Optional[str] = None,
+ profile: Optional['VolumeProfileIdentity'] = None,
+ user_tags: Optional[List[str]] = None,
+ ) -> None:
+ """
+ Initialize a VolumePatch object.
+
+ :param int capacity: (optional) The capacity to use for the volume (in
+ gigabytes). The volume must be attached to a running virtual server
+ instance, and the specified value must not be less than the current
+ capacity. Additionally, if the volume is attached as a boot volume, the
+ maximum value is 250 gigabytes.
+ The minimum and maximum capacity limits for creating or updating volumes
+ may expand in the future.
+ :param int iops: (optional) The maximum I/O operations per second (IOPS) to
+ use for this volume. Applicable only to volumes using a profile `family` of
+ `custom`. The volume must be attached as a data volume to a running virtual
+ server instance.
+ :param str name: (optional) The name for this volume. The name must not be
+ used by another volume in the region.
+ :param VolumeProfileIdentity profile: (optional) The profile to use for
+ this volume. The requested profile must be in the same
+ `family` as the current profile. The volume must be attached as a data
+ volume to
+ a running virtual server instance, and must have a `capacity` within the
+ range
+ supported by the specified profile.
+ :param List[str] user_tags: (optional) The [user
+ tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with
+ this volume.
+ """
+ self.capacity = capacity
+ self.iops = iops
+ self.name = name
+ self.profile = profile
+ self.user_tags = user_tags
@classmethod
- def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileNetworkInterfaceCountDependent':
- """Initialize a BareMetalServerProfileNetworkInterfaceCountDependent object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VolumePatch':
+ """Initialize a VolumePatch object from a json dictionary."""
args = {}
- if 'type' in _dict:
- args['type'] = _dict.get('type')
- else:
- raise ValueError('Required property \'type\' not present in BareMetalServerProfileNetworkInterfaceCountDependent JSON')
+ if (capacity := _dict.get('capacity')) is not None:
+ args['capacity'] = capacity
+ if (iops := _dict.get('iops')) is not None:
+ args['iops'] = iops
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ if (profile := _dict.get('profile')) is not None:
+ args['profile'] = profile
+ if (user_tags := _dict.get('user_tags')) is not None:
+ args['user_tags'] = user_tags
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a BareMetalServerProfileNetworkInterfaceCountDependent 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, 'type') and self.type is not None:
- _dict['type'] = self.type
+ if hasattr(self, 'capacity') and self.capacity is not None:
+ _dict['capacity'] = self.capacity
+ if hasattr(self, 'iops') and self.iops is not None:
+ _dict['iops'] = self.iops
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ if hasattr(self, 'profile') and self.profile is not None:
+ if isinstance(self.profile, dict):
+ _dict['profile'] = self.profile
+ else:
+ _dict['profile'] = self.profile.to_dict()
+ if hasattr(self, 'user_tags') and self.user_tags is not None:
+ _dict['user_tags'] = self.user_tags
return _dict
def _to_dict(self):
@@ -91254,85 +94471,86 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this BareMetalServerProfileNetworkInterfaceCountDependent object."""
+ """Return a `str` version of this VolumePatch object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'BareMetalServerProfileNetworkInterfaceCountDependent') -> 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: 'BareMetalServerProfileNetworkInterfaceCountDependent') -> bool:
+ def __ne__(self, other: 'VolumePatch') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class TypeEnum(str, Enum):
- """
- The type for this profile field.
- """
-
- DEPENDENT = 'dependent'
-
-
-class BareMetalServerProfileNetworkInterfaceCountRange(BareMetalServerProfileNetworkInterfaceCount):
+class VolumeProfile:
"""
- The number of bare metal server network interfaces supported on a bare metal server
- with this profile.
+ VolumeProfile.
- :attr int max: (optional) The maximum value for this profile field.
- :attr int min: (optional) The minimum value for this profile field.
- :attr str type: The type for this profile field.
+ :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.
"""
def __init__(
self,
- type: str,
- *,
- max: int = None,
- min: int = None,
+ family: str,
+ href: str,
+ name: str,
) -> None:
"""
- Initialize a BareMetalServerProfileNetworkInterfaceCountRange object.
+ Initialize a VolumeProfile object.
- :param str type: The type for this profile field.
- :param int max: (optional) The maximum value for this profile field.
- :param int min: (optional) The minimum value for this profile field.
+ :param 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.
"""
- # pylint: disable=super-init-not-called
- self.max = max
- self.min = min
- self.type = type
+ self.family = family
+ self.href = href
+ self.name = name
@classmethod
- def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileNetworkInterfaceCountRange':
- """Initialize a BareMetalServerProfileNetworkInterfaceCountRange object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VolumeProfile':
+ """Initialize a VolumeProfile object from a json dictionary."""
args = {}
- if 'max' in _dict:
- args['max'] = _dict.get('max')
- if 'min' in _dict:
- args['min'] = _dict.get('min')
- if 'type' in _dict:
- args['type'] = _dict.get('type')
+ if (family := _dict.get('family')) is not None:
+ args['family'] = family
else:
- raise ValueError('Required property \'type\' not present in BareMetalServerProfileNetworkInterfaceCountRange JSON')
+ raise ValueError('Required property \'family\' not present in VolumeProfile JSON')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
+ else:
+ raise ValueError('Required property \'href\' not present in VolumeProfile JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ else:
+ raise ValueError('Required property \'name\' not present in VolumeProfile JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a BareMetalServerProfileNetworkInterfaceCountRange 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, 'max') and self.max is not None:
- _dict['max'] = self.max
- if hasattr(self, 'min') and self.min is not None:
- _dict['min'] = self.min
- if hasattr(self, 'type') and self.type is not None:
- _dict['type'] = self.type
+ if hasattr(self, '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):
@@ -91340,71 +94558,130 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this BareMetalServerProfileNetworkInterfaceCountRange object."""
+ """Return a `str` version of this VolumeProfile object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'BareMetalServerProfileNetworkInterfaceCountRange') -> bool:
+ def __eq__(self, other: 'VolumeProfile') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'BareMetalServerProfileNetworkInterfaceCountRange') -> bool:
+ def __ne__(self, other: 'VolumeProfile') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class TypeEnum(str, Enum):
+ class FamilyEnum(str, Enum):
"""
- The type for this profile field.
+ 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.
"""
- RANGE = 'range'
+ CUSTOM = 'custom'
+ TIERED = 'tiered'
-class CatalogOfferingIdentityCatalogOfferingByCRN(CatalogOfferingIdentity):
+class VolumeProfileCollection:
"""
- CatalogOfferingIdentityCatalogOfferingByCRN.
+ VolumeProfileCollection.
- :attr str crn: The CRN for this
- [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user)
- offering.
+ :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 VolumeProfileCollectionNext next: (optional) A link to the next page of
+ resources. This property is present for all pages
+ except the last page.
+ :param List[VolumeProfile] profiles: Collection of volume profiles.
+ :param int total_count: The total number of resources across all pages.
"""
def __init__(
self,
- crn: str,
+ first: 'VolumeProfileCollectionFirst',
+ limit: int,
+ profiles: List['VolumeProfile'],
+ total_count: int,
+ *,
+ next: Optional['VolumeProfileCollectionNext'] = None,
) -> None:
"""
- Initialize a CatalogOfferingIdentityCatalogOfferingByCRN object.
+ Initialize a VolumeProfileCollection object.
- :param str crn: The CRN for this
- [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user)
- offering.
+ :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.
"""
- # pylint: disable=super-init-not-called
- self.crn = crn
+ self.first = first
+ self.limit = limit
+ self.next = next
+ self.profiles = profiles
+ self.total_count = total_count
@classmethod
- def from_dict(cls, _dict: Dict) -> 'CatalogOfferingIdentityCatalogOfferingByCRN':
- """Initialize a CatalogOfferingIdentityCatalogOfferingByCRN object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VolumeProfileCollection':
+ """Initialize a VolumeProfileCollection object from a json dictionary."""
args = {}
- if 'crn' in _dict:
- args['crn'] = _dict.get('crn')
+ if (first := _dict.get('first')) is not None:
+ args['first'] = VolumeProfileCollectionFirst.from_dict(first)
else:
- raise ValueError('Required property \'crn\' not present in CatalogOfferingIdentityCatalogOfferingByCRN JSON')
+ raise ValueError('Required property \'first\' not present in VolumeProfileCollection JSON')
+ if (limit := _dict.get('limit')) is not None:
+ args['limit'] = limit
+ else:
+ raise ValueError('Required property \'limit\' not present in VolumeProfileCollection JSON')
+ if (next := _dict.get('next')) is not None:
+ args['next'] = VolumeProfileCollectionNext.from_dict(next)
+ if (profiles := _dict.get('profiles')) is not None:
+ args['profiles'] = [VolumeProfile.from_dict(v) for v in profiles]
+ else:
+ raise ValueError('Required property \'profiles\' not present in VolumeProfileCollection JSON')
+ if (total_count := _dict.get('total_count')) is not None:
+ args['total_count'] = total_count
+ else:
+ raise ValueError('Required property \'total_count\' not present in VolumeProfileCollection JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a CatalogOfferingIdentityCatalogOfferingByCRN object from a json dictionary."""
+ """Initialize a VolumeProfileCollection object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'crn') and self.crn is not None:
- _dict['crn'] = self.crn
+ if hasattr(self, 'first') and self.first is not None:
+ if isinstance(self.first, dict):
+ _dict['first'] = self.first
+ else:
+ _dict['first'] = self.first.to_dict()
+ if hasattr(self, 'limit') and self.limit is not None:
+ _dict['limit'] = self.limit
+ if hasattr(self, 'next') and self.next is not None:
+ if isinstance(self.next, dict):
+ _dict['next'] = self.next
+ else:
+ _dict['next'] = self.next.to_dict()
+ if hasattr(self, 'profiles') and self.profiles is not None:
+ profiles_list = []
+ for v in self.profiles:
+ if isinstance(v, dict):
+ profiles_list.append(v)
+ else:
+ profiles_list.append(v.to_dict())
+ _dict['profiles'] = profiles_list
+ if hasattr(self, 'total_count') and self.total_count is not None:
+ _dict['total_count'] = self.total_count
return _dict
def _to_dict(self):
@@ -91412,63 +94689,58 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this CatalogOfferingIdentityCatalogOfferingByCRN object."""
+ """Return a `str` version of this VolumeProfileCollection object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'CatalogOfferingIdentityCatalogOfferingByCRN') -> 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: 'CatalogOfferingIdentityCatalogOfferingByCRN') -> bool:
+ def __ne__(self, other: 'VolumeProfileCollection') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class CatalogOfferingVersionIdentityCatalogOfferingVersionByCRN(CatalogOfferingVersionIdentity):
+class VolumeProfileCollectionFirst:
"""
- CatalogOfferingVersionIdentityCatalogOfferingVersionByCRN.
+ A link to the first page of resources.
- :attr str crn: The CRN for this version of a
- [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user)
- offering.
+ :param str href: The URL for a page of resources.
"""
def __init__(
self,
- crn: str,
+ href: str,
) -> None:
"""
- Initialize a CatalogOfferingVersionIdentityCatalogOfferingVersionByCRN object.
+ Initialize a VolumeProfileCollectionFirst object.
- :param str crn: The CRN for this version of a
- [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user)
- offering.
+ :param str href: The URL for a page of resources.
"""
- # pylint: disable=super-init-not-called
- self.crn = crn
+ self.href = href
@classmethod
- def from_dict(cls, _dict: Dict) -> 'CatalogOfferingVersionIdentityCatalogOfferingVersionByCRN':
- """Initialize a CatalogOfferingVersionIdentityCatalogOfferingVersionByCRN object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VolumeProfileCollectionFirst':
+ """Initialize a VolumeProfileCollectionFirst object from a json dictionary."""
args = {}
- if 'crn' in _dict:
- args['crn'] = _dict.get('crn')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'crn\' not present in CatalogOfferingVersionIdentityCatalogOfferingVersionByCRN JSON')
+ raise ValueError('Required property \'href\' not present in VolumeProfileCollectionFirst JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a CatalogOfferingVersionIdentityCatalogOfferingVersionByCRN object from a json dictionary."""
+ """Initialize a VolumeProfileCollectionFirst object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'crn') and self.crn is not None:
- _dict['crn'] = self.crn
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
return _dict
def _to_dict(self):
@@ -91476,59 +94748,59 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this CatalogOfferingVersionIdentityCatalogOfferingVersionByCRN object."""
+ """Return a `str` version of this VolumeProfileCollectionFirst object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'CatalogOfferingVersionIdentityCatalogOfferingVersionByCRN') -> 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: 'CatalogOfferingVersionIdentityCatalogOfferingVersionByCRN') -> bool:
+ def __ne__(self, other: 'VolumeProfileCollectionFirst') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class CertificateInstanceIdentityByCRN(CertificateInstanceIdentity):
+class VolumeProfileCollectionNext:
"""
- CertificateInstanceIdentityByCRN.
+ 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 certificate instance.
+ :param str href: The URL for a page of resources.
"""
def __init__(
self,
- crn: str,
+ href: str,
) -> None:
"""
- Initialize a CertificateInstanceIdentityByCRN object.
+ Initialize a VolumeProfileCollectionNext object.
- :param str crn: The CRN for this certificate instance.
+ :param str href: The URL for a page of resources.
"""
- # pylint: disable=super-init-not-called
- self.crn = crn
+ self.href = href
@classmethod
- def from_dict(cls, _dict: Dict) -> 'CertificateInstanceIdentityByCRN':
- """Initialize a CertificateInstanceIdentityByCRN object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VolumeProfileCollectionNext':
+ """Initialize a VolumeProfileCollectionNext object from a json dictionary."""
args = {}
- if 'crn' in _dict:
- args['crn'] = _dict.get('crn')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'crn\' not present in CertificateInstanceIdentityByCRN JSON')
+ raise ValueError('Required property \'href\' not present in VolumeProfileCollectionNext JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a CertificateInstanceIdentityByCRN object from a json dictionary."""
+ """Initialize a VolumeProfileCollectionNext object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'crn') and self.crn is not None:
- _dict['crn'] = self.crn
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
return _dict
def _to_dict(self):
@@ -91536,59 +94808,87 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this CertificateInstanceIdentityByCRN object."""
+ """Return a `str` version of this VolumeProfileCollectionNext object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'CertificateInstanceIdentityByCRN') -> 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: 'CertificateInstanceIdentityByCRN') -> bool:
+ def __ne__(self, other: 'VolumeProfileCollectionNext') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class CloudObjectStorageBucketIdentityByCRN(CloudObjectStorageBucketIdentity):
+class VolumeProfileIdentity:
"""
- CloudObjectStorageBucketIdentityByCRN.
+ Identifies a volume profile by a unique property.
- :attr str crn: The CRN of this Cloud Object Storage bucket.
"""
def __init__(
self,
- crn: str,
) -> None:
"""
- Initialize a CloudObjectStorageBucketIdentityByCRN object.
+ Initialize a VolumeProfileIdentity object.
- :param str crn: The CRN of this Cloud Object Storage bucket.
"""
- # pylint: disable=super-init-not-called
- self.crn = crn
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['VolumeProfileIdentityByName', 'VolumeProfileIdentityByHref'])
+ )
+ raise Exception(msg)
+
+
+class VolumeProfileReference:
+ """
+ VolumeProfileReference.
+
+ :param str href: The URL for this volume profile.
+ :param str name: The globally unique name for this volume profile.
+ """
+
+ def __init__(
+ self,
+ href: str,
+ name: str,
+ ) -> None:
+ """
+ Initialize a VolumeProfileReference object.
+
+ :param str href: The URL for this volume profile.
+ :param str name: The globally unique name for this volume profile.
+ """
+ self.href = href
+ self.name = name
@classmethod
- def from_dict(cls, _dict: Dict) -> 'CloudObjectStorageBucketIdentityByCRN':
- """Initialize a CloudObjectStorageBucketIdentityByCRN object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VolumeProfileReference':
+ """Initialize a VolumeProfileReference object from a json dictionary."""
args = {}
- if 'crn' in _dict:
- args['crn'] = _dict.get('crn')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'crn\' not present in CloudObjectStorageBucketIdentityByCRN JSON')
+ raise ValueError('Required property \'href\' not present in VolumeProfileReference JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ else:
+ raise ValueError('Required property \'name\' not present in VolumeProfileReference JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a CloudObjectStorageBucketIdentityByCRN 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, '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, 'name') and self.name is not None:
+ _dict['name'] = self.name
return _dict
def _to_dict(self):
@@ -91596,60 +94896,210 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this CloudObjectStorageBucketIdentityByCRN object."""
+ """Return a `str` version of this VolumeProfileReference object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'CloudObjectStorageBucketIdentityByCRN') -> 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: 'CloudObjectStorageBucketIdentityByCRN') -> bool:
+ def __ne__(self, other: 'VolumeProfileReference') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class CloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName(CloudObjectStorageBucketIdentity):
+class VolumePrototype:
"""
- CloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName.
+ VolumePrototype.
- :attr str name: The globally unique name of this Cloud Object Storage bucket.
+ :param int iops: (optional) The maximum I/O operations per second (IOPS) to use
+ for this volume. Applicable only to volumes using a profile `family` of
+ `custom`.
+ :param str name: (optional) The name for this volume. The name must not be used
+ by another volume in the region. If unspecified, the name will be a hyphenated
+ list of randomly-selected words.
+ :param VolumeProfileIdentity profile: The
+ [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-block-storage-profiles) to
+ use 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) will be
+ used.
+ :param List[str] user_tags: (optional) The [user
+ tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with this
+ volume.
+ :param ZoneIdentity zone: The zone this volume will reside in.
"""
def __init__(
self,
- name: str,
+ profile: 'VolumeProfileIdentity',
+ zone: 'ZoneIdentity',
+ *,
+ iops: Optional[int] = None,
+ name: Optional[str] = None,
+ resource_group: Optional['ResourceGroupIdentity'] = None,
+ user_tags: Optional[List[str]] = None,
) -> None:
"""
- Initialize a CloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName object.
+ Initialize a VolumePrototype object.
- :param str name: The globally unique name of this Cloud Object Storage
- bucket.
+ :param VolumeProfileIdentity profile: The
+ [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-block-storage-profiles)
+ to
+ use for this volume.
+ :param ZoneIdentity zone: The zone this volume will reside in.
+ :param int iops: (optional) The maximum I/O operations per second (IOPS) to
+ use for this volume. Applicable only to volumes using a profile `family` of
+ `custom`.
+ :param str name: (optional) The name for this volume. The name must not be
+ used by another volume in the region. If unspecified, the name will be a
+ hyphenated list of randomly-selected words.
+ :param ResourceGroupIdentity resource_group: (optional) The resource group
+ to use. If unspecified, the account's [default resource
+ group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be
+ used.
+ :param List[str] user_tags: (optional) The [user
+ tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with
+ this volume.
"""
- # pylint: disable=super-init-not-called
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['VolumePrototypeVolumeByCapacity', 'VolumePrototypeVolumeBySourceSnapshot'])
+ )
+ raise Exception(msg)
+
+
+class VolumePrototypeInstanceByImageContext:
+ """
+ VolumePrototypeInstanceByImageContext.
+
+ :param int capacity: (optional) The capacity to use for the volume (in
+ gigabytes). Must be at least the image's
+ `minimum_provisioned_size`. The maximum value may increase in the future.
+ If unspecified, the capacity will be the image's `minimum_provisioned_size`.
+ :param EncryptionKeyIdentity encryption_key: (optional) The root key to use to
+ wrap the data encryption key for the volume.
+ If unspecified, the `encryption` type for the volume will be `provider_managed`.
+ :param int iops: (optional) The maximum I/O operations per second (IOPS) to use
+ for this volume. Applicable only to volumes using a profile `family` of
+ `custom`.
+ :param str name: (optional) The name for this volume. The name must not be used
+ by another volume in the region. If unspecified, the name will be a hyphenated
+ list of randomly-selected words.
+ :param VolumeProfileIdentity profile: The
+ [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-block-storage-profiles) to
+ use for this volume.
+ :param ResourceGroupIdentity resource_group: (optional) The resource group to
+ use for this volume. If unspecified, the instance's resource
+ group will be used.
+ :param List[str] user_tags: (optional) The [user
+ tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with this
+ volume.
+ """
+
+ def __init__(
+ self,
+ profile: 'VolumeProfileIdentity',
+ *,
+ capacity: Optional[int] = None,
+ encryption_key: Optional['EncryptionKeyIdentity'] = None,
+ iops: Optional[int] = None,
+ name: Optional[str] = None,
+ resource_group: Optional['ResourceGroupIdentity'] = None,
+ user_tags: Optional[List[str]] = None,
+ ) -> None:
+ """
+ Initialize a VolumePrototypeInstanceByImageContext object.
+
+ :param VolumeProfileIdentity profile: The
+ [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-block-storage-profiles)
+ to
+ use for this volume.
+ :param int capacity: (optional) The capacity to use for the volume (in
+ gigabytes). Must be at least the image's
+ `minimum_provisioned_size`. The maximum value may increase in the future.
+ If unspecified, the capacity will be the image's
+ `minimum_provisioned_size`.
+ :param EncryptionKeyIdentity encryption_key: (optional) The root key to use
+ to wrap the data encryption key for the volume.
+ If unspecified, the `encryption` type for the volume will be
+ `provider_managed`.
+ :param int iops: (optional) The maximum I/O operations per second (IOPS) to
+ use for this volume. Applicable only to volumes using a profile `family` of
+ `custom`.
+ :param str name: (optional) The name for this volume. The name must not be
+ used by another volume in the region. If unspecified, the name will be a
+ hyphenated list of randomly-selected words.
+ :param ResourceGroupIdentity resource_group: (optional) The resource group
+ to use for this volume. If unspecified, the instance's resource
+ group will be used.
+ :param List[str] user_tags: (optional) The [user
+ tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with
+ this volume.
+ """
+ self.capacity = capacity
+ self.encryption_key = encryption_key
+ self.iops = iops
self.name = name
+ self.profile = profile
+ self.resource_group = resource_group
+ self.user_tags = user_tags
@classmethod
- def from_dict(cls, _dict: Dict) -> 'CloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName':
- """Initialize a CloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VolumePrototypeInstanceByImageContext':
+ """Initialize a VolumePrototypeInstanceByImageContext object from a json dictionary."""
args = {}
- if 'name' in _dict:
- args['name'] = _dict.get('name')
+ if (capacity := _dict.get('capacity')) is not None:
+ args['capacity'] = capacity
+ if (encryption_key := _dict.get('encryption_key')) is not None:
+ args['encryption_key'] = encryption_key
+ if (iops := _dict.get('iops')) is not None:
+ args['iops'] = iops
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ if (profile := _dict.get('profile')) is not None:
+ args['profile'] = profile
else:
- raise ValueError('Required property \'name\' not present in CloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName JSON')
+ raise ValueError('Required property \'profile\' not present in VolumePrototypeInstanceByImageContext JSON')
+ if (resource_group := _dict.get('resource_group')) is not None:
+ args['resource_group'] = resource_group
+ if (user_tags := _dict.get('user_tags')) is not None:
+ args['user_tags'] = user_tags
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a CloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName 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, 'capacity') and self.capacity is not None:
+ _dict['capacity'] = self.capacity
+ if hasattr(self, 'encryption_key') and self.encryption_key is not None:
+ if isinstance(self.encryption_key, dict):
+ _dict['encryption_key'] = self.encryption_key
+ else:
+ _dict['encryption_key'] = self.encryption_key.to_dict()
+ if hasattr(self, 'iops') and self.iops is not None:
+ _dict['iops'] = self.iops
if hasattr(self, 'name') and self.name is not None:
_dict['name'] = self.name
+ if hasattr(self, 'profile') and self.profile is not None:
+ if isinstance(self.profile, dict):
+ _dict['profile'] = self.profile
+ else:
+ _dict['profile'] = self.profile.to_dict()
+ if hasattr(self, 'resource_group') and self.resource_group is not None:
+ if isinstance(self.resource_group, dict):
+ _dict['resource_group'] = self.resource_group
+ else:
+ _dict['resource_group'] = self.resource_group.to_dict()
+ if hasattr(self, 'user_tags') and self.user_tags is not None:
+ _dict['user_tags'] = self.user_tags
return _dict
def _to_dict(self):
@@ -91657,59 +95107,164 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this CloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName object."""
+ """Return a `str` version of this VolumePrototypeInstanceByImageContext object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'CloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName') -> 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: 'CloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName') -> bool:
+ def __ne__(self, other: 'VolumePrototypeInstanceByImageContext') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class DNSInstanceIdentityByCRN(DNSInstanceIdentity):
+class VolumePrototypeInstanceBySourceSnapshotContext:
"""
- DNSInstanceIdentityByCRN.
+ VolumePrototypeInstanceBySourceSnapshotContext.
- :attr str crn: The CRN for this DNS instance.
+ :param int capacity: (optional) The capacity to use for the volume (in
+ gigabytes). Must be at least the snapshot's
+ `minimum_capacity`. The maximum value may increase in the future.
+ If unspecified, the capacity will be the source snapshot's `minimum_capacity`.
+ :param EncryptionKeyIdentity encryption_key: (optional) The root key to use to
+ wrap the data encryption key for the volume.
+ If unspecified, the `encryption` type for the volume will be `provider_managed`.
+ :param int iops: (optional) The maximum I/O operations per second (IOPS) to use
+ for this volume. Applicable only to volumes using a profile `family` of
+ `custom`.
+ :param str name: (optional) The name for this volume. The name must not be used
+ by another volume in the region. If unspecified, the name will be a hyphenated
+ list of randomly-selected words.
+ :param VolumeProfileIdentity profile: The
+ [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-block-storage-profiles) to
+ use for this volume.
+ :param ResourceGroupIdentity resource_group: (optional) The resource group to
+ use for this volume. If unspecified, the instance's resource
+ group will be used.
+ :param SnapshotIdentity source_snapshot: The snapshot from which to clone the
+ volume.
+ :param List[str] user_tags: (optional) The [user
+ tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with this
+ volume.
"""
def __init__(
self,
- crn: str,
+ profile: 'VolumeProfileIdentity',
+ source_snapshot: 'SnapshotIdentity',
+ *,
+ capacity: Optional[int] = None,
+ encryption_key: Optional['EncryptionKeyIdentity'] = None,
+ iops: Optional[int] = None,
+ name: Optional[str] = None,
+ resource_group: Optional['ResourceGroupIdentity'] = None,
+ user_tags: Optional[List[str]] = None,
) -> None:
"""
- Initialize a DNSInstanceIdentityByCRN object.
+ Initialize a VolumePrototypeInstanceBySourceSnapshotContext object.
- :param str crn: The CRN for this DNS instance.
+ :param VolumeProfileIdentity profile: The
+ [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-block-storage-profiles)
+ to
+ use for this volume.
+ :param SnapshotIdentity source_snapshot: The snapshot from which to clone
+ the volume.
+ :param int capacity: (optional) The capacity to use for the volume (in
+ gigabytes). Must be at least the snapshot's
+ `minimum_capacity`. The maximum value may increase in the future.
+ If unspecified, the capacity will be the source snapshot's
+ `minimum_capacity`.
+ :param EncryptionKeyIdentity encryption_key: (optional) The root key to use
+ to wrap the data encryption key for the volume.
+ If unspecified, the `encryption` type for the volume will be
+ `provider_managed`.
+ :param int iops: (optional) The maximum I/O operations per second (IOPS) to
+ use for this volume. Applicable only to volumes using a profile `family` of
+ `custom`.
+ :param str name: (optional) The name for this volume. The name must not be
+ used by another volume in the region. If unspecified, the name will be a
+ hyphenated list of randomly-selected words.
+ :param ResourceGroupIdentity resource_group: (optional) The resource group
+ to use for this volume. If unspecified, the instance's resource
+ group will be used.
+ :param List[str] user_tags: (optional) The [user
+ tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with
+ this volume.
"""
- # pylint: disable=super-init-not-called
- self.crn = crn
+ self.capacity = capacity
+ self.encryption_key = encryption_key
+ self.iops = iops
+ self.name = name
+ self.profile = profile
+ self.resource_group = resource_group
+ self.source_snapshot = source_snapshot
+ self.user_tags = user_tags
@classmethod
- def from_dict(cls, _dict: Dict) -> 'DNSInstanceIdentityByCRN':
- """Initialize a DNSInstanceIdentityByCRN object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VolumePrototypeInstanceBySourceSnapshotContext':
+ """Initialize a VolumePrototypeInstanceBySourceSnapshotContext object from a json dictionary."""
args = {}
- if 'crn' in _dict:
- args['crn'] = _dict.get('crn')
+ if (capacity := _dict.get('capacity')) is not None:
+ args['capacity'] = capacity
+ if (encryption_key := _dict.get('encryption_key')) is not None:
+ args['encryption_key'] = encryption_key
+ if (iops := _dict.get('iops')) is not None:
+ args['iops'] = iops
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ if (profile := _dict.get('profile')) is not None:
+ args['profile'] = profile
else:
- raise ValueError('Required property \'crn\' not present in DNSInstanceIdentityByCRN JSON')
+ raise ValueError('Required property \'profile\' not present in VolumePrototypeInstanceBySourceSnapshotContext JSON')
+ if (resource_group := _dict.get('resource_group')) is not None:
+ args['resource_group'] = resource_group
+ if (source_snapshot := _dict.get('source_snapshot')) is not None:
+ args['source_snapshot'] = source_snapshot
+ else:
+ raise ValueError('Required property \'source_snapshot\' not present in VolumePrototypeInstanceBySourceSnapshotContext JSON')
+ if (user_tags := _dict.get('user_tags')) is not None:
+ args['user_tags'] = user_tags
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a DNSInstanceIdentityByCRN object from a json dictionary."""
+ """Initialize a VolumePrototypeInstanceBySourceSnapshotContext object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'crn') and self.crn is not None:
- _dict['crn'] = self.crn
+ if hasattr(self, 'capacity') and self.capacity is not None:
+ _dict['capacity'] = self.capacity
+ if hasattr(self, 'encryption_key') and self.encryption_key is not None:
+ if isinstance(self.encryption_key, dict):
+ _dict['encryption_key'] = self.encryption_key
+ else:
+ _dict['encryption_key'] = self.encryption_key.to_dict()
+ if hasattr(self, 'iops') and self.iops is not None:
+ _dict['iops'] = self.iops
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ if hasattr(self, 'profile') and self.profile is not None:
+ if isinstance(self.profile, dict):
+ _dict['profile'] = self.profile
+ else:
+ _dict['profile'] = self.profile.to_dict()
+ if hasattr(self, 'resource_group') and self.resource_group is not None:
+ if isinstance(self.resource_group, dict):
+ _dict['resource_group'] = self.resource_group
+ else:
+ _dict['resource_group'] = self.resource_group.to_dict()
+ if hasattr(self, 'source_snapshot') and self.source_snapshot is not None:
+ if isinstance(self.source_snapshot, dict):
+ _dict['source_snapshot'] = self.source_snapshot
+ else:
+ _dict['source_snapshot'] = self.source_snapshot.to_dict()
+ if hasattr(self, 'user_tags') and self.user_tags is not None:
+ _dict['user_tags'] = self.user_tags
return _dict
def _to_dict(self):
@@ -91717,59 +95272,131 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this DNSInstanceIdentityByCRN object."""
+ """Return a `str` version of this VolumePrototypeInstanceBySourceSnapshotContext object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'DNSInstanceIdentityByCRN') -> bool:
+ def __eq__(self, other: 'VolumePrototypeInstanceBySourceSnapshotContext') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'DNSInstanceIdentityByCRN') -> bool:
+ def __ne__(self, other: 'VolumePrototypeInstanceBySourceSnapshotContext') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class DNSZoneIdentityById(DNSZoneIdentity):
+class VolumeReference:
"""
- DNSZoneIdentityById.
+ VolumeReference.
- :attr str id:
+ :param str crn: The CRN 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 volume.
+ :param str id: The unique identifier for this volume.
+ :param str name: The name for this volume. The name is unique across all volumes
+ in the region.
+ :param VolumeRemote remote: (optional) If present, this property indicates that
+ the resource associated with this reference
+ is remote and therefore may not be directly retrievable.
+ :param str resource_type: The resource type.
"""
def __init__(
self,
+ crn: str,
+ href: str,
id: str,
+ name: str,
+ resource_type: str,
+ *,
+ deleted: Optional['VolumeReferenceDeleted'] = None,
+ remote: Optional['VolumeRemote'] = None,
) -> None:
"""
- Initialize a DNSZoneIdentityById object.
+ Initialize a VolumeReference object.
- :param str id:
+ :param str crn: The CRN for this volume.
+ :param str href: The URL for this volume.
+ :param str id: The unique identifier for this volume.
+ :param str name: The name for this volume. The name is unique across all
+ volumes in the region.
+ :param str resource_type: The resource type.
+ :param VolumeReferenceDeleted deleted: (optional) If present, this property
+ indicates the referenced resource has been deleted, and provides
+ some supplementary information.
+ :param VolumeRemote remote: (optional) If present, this property indicates
+ that the resource associated with this reference
+ is remote and therefore may not be directly retrievable.
"""
- # pylint: disable=super-init-not-called
+ self.crn = crn
+ self.deleted = deleted
+ self.href = href
self.id = id
+ self.name = name
+ self.remote = remote
+ self.resource_type = resource_type
@classmethod
- def from_dict(cls, _dict: Dict) -> 'DNSZoneIdentityById':
- """Initialize a DNSZoneIdentityById object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VolumeReference':
+ """Initialize a VolumeReference object from a json dictionary."""
args = {}
- if 'id' in _dict:
- args['id'] = _dict.get('id')
+ if (crn := _dict.get('crn')) is not None:
+ args['crn'] = crn
else:
- raise ValueError('Required property \'id\' not present in DNSZoneIdentityById JSON')
+ raise ValueError('Required property \'crn\' not present in VolumeReference JSON')
+ if (deleted := _dict.get('deleted')) is not None:
+ args['deleted'] = VolumeReferenceDeleted.from_dict(deleted)
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
+ else:
+ raise ValueError('Required property \'href\' not present in VolumeReference JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
+ else:
+ raise ValueError('Required property \'id\' not present in VolumeReference JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ else:
+ raise ValueError('Required property \'name\' not present in VolumeReference JSON')
+ if (remote := _dict.get('remote')) is not None:
+ args['remote'] = VolumeRemote.from_dict(remote)
+ if (resource_type := _dict.get('resource_type')) is not None:
+ args['resource_type'] = resource_type
+ else:
+ raise ValueError('Required property \'resource_type\' not present in VolumeReference JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a DNSZoneIdentityById object from a json dictionary."""
+ """Initialize a VolumeReference object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
+ if hasattr(self, 'crn') and self.crn is not None:
+ _dict['crn'] = self.crn
+ if hasattr(self, 'deleted') and self.deleted is not None:
+ if isinstance(self.deleted, dict):
+ _dict['deleted'] = self.deleted
+ else:
+ _dict['deleted'] = self.deleted.to_dict()
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
if hasattr(self, 'id') and self.id is not None:
_dict['id'] = self.id
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ if hasattr(self, 'remote') and self.remote is not None:
+ if isinstance(self.remote, dict):
+ _dict['remote'] = self.remote
+ else:
+ _dict['remote'] = self.remote.to_dict()
+ if hasattr(self, 'resource_type') and self.resource_type is not None:
+ _dict['resource_type'] = self.resource_type
return _dict
def _to_dict(self):
@@ -91777,59 +95404,67 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this DNSZoneIdentityById object."""
+ """Return a `str` version of this VolumeReference object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'DNSZoneIdentityById') -> 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: 'DNSZoneIdentityById') -> bool:
+ def __ne__(self, other: 'VolumeReference') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
+ class ResourceTypeEnum(str, Enum):
+ """
+ The resource type.
+ """
+
+ VOLUME = 'volume'
+
-class DedicatedHostGroupIdentityByCRN(DedicatedHostGroupIdentity):
+
+class VolumeReferenceDeleted:
"""
- DedicatedHostGroupIdentityByCRN.
+ If present, this property indicates the referenced resource has been deleted, and
+ provides some supplementary information.
- :attr str crn: The CRN for this dedicated host group.
+ :param str more_info: Link to documentation about deleted resources.
"""
def __init__(
self,
- crn: str,
+ more_info: str,
) -> None:
"""
- Initialize a DedicatedHostGroupIdentityByCRN object.
+ Initialize a VolumeReferenceDeleted object.
- :param str crn: The CRN for this dedicated host group.
+ :param str more_info: Link to documentation about deleted resources.
"""
- # pylint: disable=super-init-not-called
- self.crn = crn
+ self.more_info = more_info
@classmethod
- def from_dict(cls, _dict: Dict) -> 'DedicatedHostGroupIdentityByCRN':
- """Initialize a DedicatedHostGroupIdentityByCRN object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VolumeReferenceDeleted':
+ """Initialize a VolumeReferenceDeleted object from a json dictionary."""
args = {}
- if 'crn' in _dict:
- args['crn'] = _dict.get('crn')
+ if (more_info := _dict.get('more_info')) is not None:
+ args['more_info'] = more_info
else:
- raise ValueError('Required property \'crn\' not present in DedicatedHostGroupIdentityByCRN JSON')
+ raise ValueError('Required property \'more_info\' not present in VolumeReferenceDeleted JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a DedicatedHostGroupIdentityByCRN 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, '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):
@@ -91837,59 +95472,118 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this DedicatedHostGroupIdentityByCRN object."""
+ """Return a `str` version of this VolumeReferenceDeleted object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'DedicatedHostGroupIdentityByCRN') -> 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: 'DedicatedHostGroupIdentityByCRN') -> bool:
+ def __ne__(self, other: 'VolumeReferenceDeleted') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class DedicatedHostGroupIdentityByHref(DedicatedHostGroupIdentity):
+class VolumeReferenceVolumeAttachmentContext:
"""
- DedicatedHostGroupIdentityByHref.
+ VolumeReferenceVolumeAttachmentContext.
- :attr str href: The URL for this dedicated host group.
+ :param str crn: The CRN for this volume.
+ :param VolumeReferenceVolumeAttachmentContextDeleted 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 volume.
+ :param str id: The unique identifier for this volume.
+ :param str name: The name for this volume. The name is unique across all volumes
+ in the region.
+ :param str resource_type: The resource type.
"""
def __init__(
self,
+ crn: str,
href: str,
+ id: str,
+ name: str,
+ resource_type: str,
+ *,
+ deleted: Optional['VolumeReferenceVolumeAttachmentContextDeleted'] = None,
) -> None:
"""
- Initialize a DedicatedHostGroupIdentityByHref object.
+ Initialize a VolumeReferenceVolumeAttachmentContext object.
- :param str href: The URL for this dedicated host group.
+ :param str crn: The CRN for this volume.
+ :param str href: The URL for this volume.
+ :param str id: The unique identifier for this volume.
+ :param str name: The name for this volume. The name is unique across all
+ volumes in the region.
+ :param str resource_type: The resource type.
+ :param VolumeReferenceVolumeAttachmentContextDeleted deleted: (optional) If
+ present, this property indicates the referenced resource has been deleted,
+ and provides
+ some supplementary information.
"""
- # 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) -> 'DedicatedHostGroupIdentityByHref':
- """Initialize a DedicatedHostGroupIdentityByHref object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VolumeReferenceVolumeAttachmentContext':
+ """Initialize a VolumeReferenceVolumeAttachmentContext object from a json dictionary."""
args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ if (crn := _dict.get('crn')) is not None:
+ args['crn'] = crn
else:
- raise ValueError('Required property \'href\' not present in DedicatedHostGroupIdentityByHref JSON')
+ raise ValueError('Required property \'crn\' not present in VolumeReferenceVolumeAttachmentContext JSON')
+ if (deleted := _dict.get('deleted')) is not None:
+ args['deleted'] = VolumeReferenceVolumeAttachmentContextDeleted.from_dict(deleted)
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
+ else:
+ raise ValueError('Required property \'href\' not present in VolumeReferenceVolumeAttachmentContext JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
+ else:
+ raise ValueError('Required property \'id\' not present in VolumeReferenceVolumeAttachmentContext JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ else:
+ raise ValueError('Required property \'name\' not present in VolumeReferenceVolumeAttachmentContext JSON')
+ if (resource_type := _dict.get('resource_type')) is not None:
+ args['resource_type'] = resource_type
+ else:
+ raise ValueError('Required property \'resource_type\' not present in VolumeReferenceVolumeAttachmentContext JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a DedicatedHostGroupIdentityByHref object from a json dictionary."""
+ """Initialize a VolumeReferenceVolumeAttachmentContext object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
+ if hasattr(self, 'crn') and self.crn is not None:
+ _dict['crn'] = self.crn
+ if hasattr(self, 'deleted') and self.deleted is not None:
+ if isinstance(self.deleted, dict):
+ _dict['deleted'] = self.deleted
+ else:
+ _dict['deleted'] = self.deleted.to_dict()
if hasattr(self, 'href') and self.href is not None:
_dict['href'] = self.href
+ if hasattr(self, 'id') and self.id is not None:
+ _dict['id'] = self.id
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ if hasattr(self, 'resource_type') and self.resource_type is not None:
+ _dict['resource_type'] = self.resource_type
return _dict
def _to_dict(self):
@@ -91897,59 +95591,67 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this DedicatedHostGroupIdentityByHref object."""
+ """Return a `str` version of this VolumeReferenceVolumeAttachmentContext object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'DedicatedHostGroupIdentityByHref') -> bool:
+ def __eq__(self, other: 'VolumeReferenceVolumeAttachmentContext') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'DedicatedHostGroupIdentityByHref') -> bool:
+ def __ne__(self, other: 'VolumeReferenceVolumeAttachmentContext') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
+ class ResourceTypeEnum(str, Enum):
+ """
+ The resource type.
+ """
+
+ VOLUME = 'volume'
-class DedicatedHostGroupIdentityById(DedicatedHostGroupIdentity):
+
+
+class VolumeReferenceVolumeAttachmentContextDeleted:
"""
- DedicatedHostGroupIdentityById.
+ If present, this property indicates the referenced resource has been deleted, and
+ provides some supplementary information.
- :attr str id: The unique identifier for this dedicated host group.
+ :param str more_info: Link to documentation about deleted resources.
"""
def __init__(
self,
- id: str,
+ more_info: str,
) -> None:
"""
- Initialize a DedicatedHostGroupIdentityById object.
+ Initialize a VolumeReferenceVolumeAttachmentContextDeleted object.
- :param str id: The unique identifier for this dedicated host group.
+ :param str more_info: Link to documentation about deleted resources.
"""
- # pylint: disable=super-init-not-called
- self.id = id
+ self.more_info = more_info
@classmethod
- def from_dict(cls, _dict: Dict) -> 'DedicatedHostGroupIdentityById':
- """Initialize a DedicatedHostGroupIdentityById object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VolumeReferenceVolumeAttachmentContextDeleted':
+ """Initialize a VolumeReferenceVolumeAttachmentContextDeleted object from a json dictionary."""
args = {}
- if 'id' in _dict:
- args['id'] = _dict.get('id')
+ if (more_info := _dict.get('more_info')) is not None:
+ args['more_info'] = more_info
else:
- raise ValueError('Required property \'id\' not present in DedicatedHostGroupIdentityById JSON')
+ raise ValueError('Required property \'more_info\' not present in VolumeReferenceVolumeAttachmentContextDeleted JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a DedicatedHostGroupIdentityById object from a json dictionary."""
+ """Initialize a VolumeReferenceVolumeAttachmentContextDeleted object from 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, 'more_info') and self.more_info is not None:
+ _dict['more_info'] = self.more_info
return _dict
def _to_dict(self):
@@ -91957,59 +95659,65 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this DedicatedHostGroupIdentityById object."""
+ """Return a `str` version of this VolumeReferenceVolumeAttachmentContextDeleted object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'DedicatedHostGroupIdentityById') -> bool:
+ def __eq__(self, other: 'VolumeReferenceVolumeAttachmentContextDeleted') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'DedicatedHostGroupIdentityById') -> bool:
+ def __ne__(self, other: 'VolumeReferenceVolumeAttachmentContextDeleted') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class DedicatedHostProfileIdentityByHref(DedicatedHostProfileIdentity):
+class VolumeRemote:
"""
- DedicatedHostProfileIdentityByHref.
+ If present, this property indicates that the resource associated with this reference
+ is remote and therefore may not be directly retrievable.
- :attr str href: The URL for this dedicated host profile.
+ :param RegionReference region: (optional) If present, this property indicates
+ that the referenced resource is remote to this
+ region, and identifies the native region.
"""
def __init__(
self,
- href: str,
+ *,
+ region: Optional['RegionReference'] = None,
) -> None:
"""
- Initialize a DedicatedHostProfileIdentityByHref object.
+ Initialize a VolumeRemote object.
- :param str href: The URL for this dedicated host profile.
+ :param RegionReference region: (optional) If present, this property
+ indicates that the referenced resource is remote to this
+ region, and identifies the native region.
"""
- # pylint: disable=super-init-not-called
- self.href = href
+ self.region = region
@classmethod
- def from_dict(cls, _dict: Dict) -> 'DedicatedHostProfileIdentityByHref':
- """Initialize a DedicatedHostProfileIdentityByHref object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VolumeRemote':
+ """Initialize a VolumeRemote object from a json dictionary."""
args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
- else:
- raise ValueError('Required property \'href\' not present in DedicatedHostProfileIdentityByHref JSON')
+ if (region := _dict.get('region')) is not None:
+ args['region'] = RegionReference.from_dict(region)
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a DedicatedHostProfileIdentityByHref object from a json dictionary."""
+ """Initialize a VolumeRemote object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'href') and self.href is not None:
- _dict['href'] = self.href
+ if hasattr(self, 'region') and self.region is not None:
+ if isinstance(self.region, dict):
+ _dict['region'] = self.region
+ else:
+ _dict['region'] = self.region.to_dict()
return _dict
def _to_dict(self):
@@ -92017,59 +95725,79 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this DedicatedHostProfileIdentityByHref object."""
+ """Return a `str` version of this VolumeRemote object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'DedicatedHostProfileIdentityByHref') -> bool:
+ def __eq__(self, other: 'VolumeRemote') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'DedicatedHostProfileIdentityByHref') -> bool:
+ def __ne__(self, other: 'VolumeRemote') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class DedicatedHostProfileIdentityByName(DedicatedHostProfileIdentity):
+class VolumeStatusReason:
"""
- DedicatedHostProfileIdentityByName.
+ VolumeStatusReason.
- :attr str name: The globally unique name for this dedicated host profile.
+ :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.
"""
def __init__(
self,
- name: str,
+ code: str,
+ message: str,
+ *,
+ more_info: Optional[str] = None,
) -> None:
"""
- Initialize a DedicatedHostProfileIdentityByName object.
+ Initialize a VolumeStatusReason object.
- :param str name: The globally unique name for this dedicated host profile.
+ :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.
"""
- # pylint: disable=super-init-not-called
- self.name = name
+ self.code = code
+ self.message = message
+ self.more_info = more_info
@classmethod
- def from_dict(cls, _dict: Dict) -> 'DedicatedHostProfileIdentityByName':
- """Initialize a DedicatedHostProfileIdentityByName object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VolumeStatusReason':
+ """Initialize a VolumeStatusReason object from a json dictionary."""
args = {}
- if 'name' in _dict:
- args['name'] = _dict.get('name')
+ if (code := _dict.get('code')) is not None:
+ args['code'] = code
else:
- raise ValueError('Required property \'name\' not present in DedicatedHostProfileIdentityByName JSON')
+ raise ValueError('Required property \'code\' not present in VolumeStatusReason JSON')
+ if (message := _dict.get('message')) is not None:
+ args['message'] = message
+ else:
+ raise ValueError('Required property \'message\' not present in VolumeStatusReason JSON')
+ if (more_info := _dict.get('more_info')) is not None:
+ args['more_info'] = more_info
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a DedicatedHostProfileIdentityByName 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, '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):
@@ -92077,59 +95805,99 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this DedicatedHostProfileIdentityByName object."""
+ """Return a `str` version of this VolumeStatusReason object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'DedicatedHostProfileIdentityByName') -> 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: 'DedicatedHostProfileIdentityByName') -> bool:
+ def __ne__(self, other: 'VolumeStatusReason') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
+ class CodeEnum(str, Enum):
+ """
+ A snake case string succinctly identifying the status reason.
+ """
-class DedicatedHostProfileMemoryDependent(DedicatedHostProfileMemory):
+ ENCRYPTION_KEY_DELETED = 'encryption_key_deleted'
+
+
+
+class Zone:
"""
- The memory value for a dedicated host with this profile depends on its configuration.
+ Zone.
- :attr str type: The type for this profile field.
+ :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.
"""
def __init__(
self,
- type: str,
+ href: str,
+ name: str,
+ region: 'RegionReference',
+ status: str,
) -> None:
"""
- Initialize a DedicatedHostProfileMemoryDependent object.
+ Initialize a Zone object.
- :param str type: The type for this profile field.
+ :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.
"""
- # pylint: disable=super-init-not-called
- self.type = type
+ self.href = href
+ self.name = name
+ self.region = region
+ self.status = status
@classmethod
- def from_dict(cls, _dict: Dict) -> 'DedicatedHostProfileMemoryDependent':
- """Initialize a DedicatedHostProfileMemoryDependent object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'Zone':
+ """Initialize a Zone object from a json dictionary."""
args = {}
- if 'type' in _dict:
- args['type'] = _dict.get('type')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'type\' not present in DedicatedHostProfileMemoryDependent JSON')
+ raise ValueError('Required property \'href\' not present in Zone JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ else:
+ raise ValueError('Required property \'name\' not present in Zone JSON')
+ if (region := _dict.get('region')) is not None:
+ args['region'] = RegionReference.from_dict(region)
+ else:
+ raise ValueError('Required property \'region\' not present in Zone JSON')
+ if (status := _dict.get('status')) is not None:
+ args['status'] = status
+ else:
+ raise ValueError('Required property \'status\' not present in Zone JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a DedicatedHostProfileMemoryDependent 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, 'type') and self.type is not None:
- _dict['type'] = self.type
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ if hasattr(self, 'region') and self.region is not None:
+ if isinstance(self.region, dict):
+ _dict['region'] = self.region
+ else:
+ _dict['region'] = self.region.to_dict()
+ if hasattr(self, 'status') and self.status is not None:
+ _dict['status'] = self.status
return _dict
def _to_dict(self):
@@ -92137,87 +95905,74 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this DedicatedHostProfileMemoryDependent object."""
+ """Return a `str` version of this Zone object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'DedicatedHostProfileMemoryDependent') -> 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: 'DedicatedHostProfileMemoryDependent') -> bool:
+ def __ne__(self, other: 'Zone') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class TypeEnum(str, Enum):
+ class StatusEnum(str, Enum):
"""
- The type for this profile field.
+ The availability status of this zone.
"""
- DEPENDENT = 'dependent'
+ AVAILABLE = 'available'
+ IMPAIRED = 'impaired'
+ UNAVAILABLE = 'unavailable'
-class DedicatedHostProfileMemoryEnum(DedicatedHostProfileMemory):
+class ZoneCollection:
"""
- The permitted memory values (in gibibytes) for a dedicated host with this profile.
+ ZoneCollection.
- :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.
+ :param List[Zone] zones: Collection of zones.
"""
def __init__(
self,
- default: int,
- type: str,
- values: List[int],
+ zones: List['Zone'],
) -> None:
"""
- Initialize a DedicatedHostProfileMemoryEnum object.
+ Initialize a ZoneCollection object.
- :param int default: The default value for this profile field.
- :param str type: The type for this profile field.
- :param List[int] values: The permitted values for this profile field.
+ :param List[Zone] zones: Collection of zones.
"""
- # pylint: disable=super-init-not-called
- self.default = default
- self.type = type
- self.values = values
+ self.zones = zones
@classmethod
- def from_dict(cls, _dict: Dict) -> 'DedicatedHostProfileMemoryEnum':
- """Initialize a DedicatedHostProfileMemoryEnum object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'ZoneCollection':
+ """Initialize a ZoneCollection object from a json dictionary."""
args = {}
- if 'default' in _dict:
- args['default'] = _dict.get('default')
- else:
- raise ValueError('Required property \'default\' not present in DedicatedHostProfileMemoryEnum JSON')
- if 'type' in _dict:
- args['type'] = _dict.get('type')
- else:
- raise ValueError('Required property \'type\' not present in DedicatedHostProfileMemoryEnum JSON')
- if 'values' in _dict:
- args['values'] = _dict.get('values')
+ if (zones := _dict.get('zones')) is not None:
+ args['zones'] = [Zone.from_dict(v) for v in zones]
else:
- raise ValueError('Required property \'values\' not present in DedicatedHostProfileMemoryEnum JSON')
+ raise ValueError('Required property \'zones\' not present in ZoneCollection JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a DedicatedHostProfileMemoryEnum 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, '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, 'zones') and self.zones is not None:
+ zones_list = []
+ for v in self.zones:
+ if isinstance(v, dict):
+ zones_list.append(v)
+ else:
+ zones_list.append(v.to_dict())
+ _dict['zones'] = zones_list
return _dict
def _to_dict(self):
@@ -92225,185 +95980,87 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this DedicatedHostProfileMemoryEnum object."""
+ """Return a `str` version of this ZoneCollection object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'DedicatedHostProfileMemoryEnum') -> 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: 'DedicatedHostProfileMemoryEnum') -> bool:
+ def __ne__(self, other: 'ZoneCollection') -> 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 DedicatedHostProfileMemoryFixed(DedicatedHostProfileMemory):
+class ZoneIdentity:
"""
- The memory (in gibibytes) for a dedicated host with this profile.
+ Identifies a zone by a unique property.
- :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 DedicatedHostProfileMemoryFixed object.
-
- :param str type: The type for this profile field.
- :param int value: The value for this profile field.
- """
- # pylint: disable=super-init-not-called
- self.type = type
- self.value = value
-
- @classmethod
- def from_dict(cls, _dict: Dict) -> 'DedicatedHostProfileMemoryFixed':
- """Initialize a DedicatedHostProfileMemoryFixed object from a json dictionary."""
- args = {}
- if 'type' in _dict:
- args['type'] = _dict.get('type')
- else:
- raise ValueError('Required property \'type\' not present in DedicatedHostProfileMemoryFixed JSON')
- if 'value' in _dict:
- args['value'] = _dict.get('value')
- else:
- raise ValueError('Required property \'value\' not present in DedicatedHostProfileMemoryFixed JSON')
- return cls(**args)
-
- @classmethod
- def _from_dict(cls, _dict):
- """Initialize a DedicatedHostProfileMemoryFixed object from 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 DedicatedHostProfileMemoryFixed object."""
- return json.dumps(self.to_dict(), indent=2)
-
- def __eq__(self, other: 'DedicatedHostProfileMemoryFixed') -> bool:
- """Return `true` when self and other are equal, false otherwise."""
- if not isinstance(other, self.__class__):
- return False
- return self.__dict__ == other.__dict__
-
- def __ne__(self, other: 'DedicatedHostProfileMemoryFixed') -> bool:
- """Return `true` when self and other are not equal, false otherwise."""
- return not self == other
+ Initialize a ZoneIdentity object.
- class TypeEnum(str, Enum):
- """
- The type for this profile field.
"""
-
- FIXED = 'fixed'
-
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['ZoneIdentityByName', 'ZoneIdentityByHref'])
+ )
+ raise Exception(msg)
-class DedicatedHostProfileMemoryRange(DedicatedHostProfileMemory):
+class ZoneReference:
"""
- The permitted memory range (in gibibytes) for a dedicated host with this profile.
+ ZoneReference.
- :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.
+ :param str href: The URL for this zone.
+ :param str name: The globally unique name for this zone.
"""
def __init__(
self,
- default: int,
- max: int,
- min: int,
- step: int,
- type: str,
+ href: str,
+ name: str,
) -> None:
"""
- Initialize a DedicatedHostProfileMemoryRange object.
+ Initialize a ZoneReference object.
- :param int default: The default value for this profile field.
- :param int max: The maximum value for this profile field.
- :param int min: The minimum value for this profile field.
- :param int step: The increment step value for this profile field.
- :param str type: The type for this profile field.
+ :param str href: The URL for this zone.
+ :param str name: The globally unique name for this zone.
"""
- # pylint: disable=super-init-not-called
- self.default = default
- self.max = max
- self.min = min
- self.step = step
- self.type = type
+ self.href = href
+ self.name = name
@classmethod
- def from_dict(cls, _dict: Dict) -> 'DedicatedHostProfileMemoryRange':
- """Initialize a DedicatedHostProfileMemoryRange object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'ZoneReference':
+ """Initialize a ZoneReference object from a json dictionary."""
args = {}
- if 'default' in _dict:
- args['default'] = _dict.get('default')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'default\' not present in DedicatedHostProfileMemoryRange JSON')
- if 'max' in _dict:
- args['max'] = _dict.get('max')
- else:
- raise ValueError('Required property \'max\' not present in DedicatedHostProfileMemoryRange JSON')
- if 'min' in _dict:
- args['min'] = _dict.get('min')
- else:
- raise ValueError('Required property \'min\' not present in DedicatedHostProfileMemoryRange JSON')
- if 'step' in _dict:
- args['step'] = _dict.get('step')
- else:
- raise ValueError('Required property \'step\' not present in DedicatedHostProfileMemoryRange JSON')
- if 'type' in _dict:
- args['type'] = _dict.get('type')
+ raise ValueError('Required property \'href\' not present in ZoneReference JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
else:
- raise ValueError('Required property \'type\' not present in DedicatedHostProfileMemoryRange JSON')
+ raise ValueError('Required property \'name\' not present in ZoneReference JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a DedicatedHostProfileMemoryRange 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, 'default') and self.default is not None:
- _dict['default'] = self.default
- if hasattr(self, 'max') and self.max is not None:
- _dict['max'] = self.max
- if hasattr(self, 'min') and self.min is not None:
- _dict['min'] = self.min
- if hasattr(self, 'step') and self.step is not None:
- _dict['step'] = self.step
- if hasattr(self, 'type') and self.type is not None:
- _dict['type'] = self.type
+ if hasattr(self, '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):
@@ -92411,68 +96068,107 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this DedicatedHostProfileMemoryRange object."""
+ """Return a `str` version of this ZoneReference object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'DedicatedHostProfileMemoryRange') -> 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: 'DedicatedHostProfileMemoryRange') -> bool:
+ def __ne__(self, other: 'ZoneReference') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class TypeEnum(str, Enum):
- """
- The type for this profile field.
- """
-
- RANGE = 'range'
-
-
-class DedicatedHostProfileSocketDependent(DedicatedHostProfileSocket):
+class BackupPolicyJobSourceInstanceReference(BackupPolicyJobSource):
"""
- The CPU socket count for a dedicated host with this profile depends on its
- configuration.
+ BackupPolicyJobSourceInstanceReference.
- :attr str type: The type for this profile field.
+ :param str crn: The CRN for this virtual server instance.
+ :param InstanceReferenceDeleted 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 virtual server instance.
+ :param str id: The unique identifier for this virtual server instance.
+ :param str name: The name for this virtual server instance. The name is unique
+ across all virtual server instances in the region.
"""
def __init__(
self,
- type: str,
+ crn: str,
+ href: str,
+ id: str,
+ name: str,
+ *,
+ deleted: Optional['InstanceReferenceDeleted'] = None,
) -> None:
"""
- Initialize a DedicatedHostProfileSocketDependent object.
+ Initialize a BackupPolicyJobSourceInstanceReference object.
- :param str type: The type for this profile field.
+ :param str crn: The CRN for this virtual server instance.
+ :param str href: The URL for this virtual server instance.
+ :param str id: The unique identifier for this virtual server instance.
+ :param str name: The name for this virtual server instance. The name is
+ unique across all virtual server instances in the region.
+ :param InstanceReferenceDeleted deleted: (optional) If present, this
+ property indicates the referenced resource has been deleted, and provides
+ some supplementary information.
"""
# pylint: disable=super-init-not-called
- self.type = type
+ self.crn = crn
+ self.deleted = deleted
+ self.href = href
+ self.id = id
+ self.name = name
@classmethod
- def from_dict(cls, _dict: Dict) -> 'DedicatedHostProfileSocketDependent':
- """Initialize a DedicatedHostProfileSocketDependent object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'BackupPolicyJobSourceInstanceReference':
+ """Initialize a BackupPolicyJobSourceInstanceReference object from a json dictionary."""
args = {}
- if 'type' in _dict:
- args['type'] = _dict.get('type')
+ if (crn := _dict.get('crn')) is not None:
+ args['crn'] = crn
else:
- raise ValueError('Required property \'type\' not present in DedicatedHostProfileSocketDependent JSON')
+ raise ValueError('Required property \'crn\' not present in BackupPolicyJobSourceInstanceReference JSON')
+ if (deleted := _dict.get('deleted')) is not None:
+ args['deleted'] = InstanceReferenceDeleted.from_dict(deleted)
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
+ else:
+ raise ValueError('Required property \'href\' not present in BackupPolicyJobSourceInstanceReference JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
+ else:
+ raise ValueError('Required property \'id\' not present in BackupPolicyJobSourceInstanceReference JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ else:
+ raise ValueError('Required property \'name\' not present in BackupPolicyJobSourceInstanceReference JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a DedicatedHostProfileSocketDependent object from a json dictionary."""
+ """Initialize a BackupPolicyJobSourceInstanceReference object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'type') and self.type is not None:
- _dict['type'] = self.type
+ if hasattr(self, 'crn') and self.crn is not None:
+ _dict['crn'] = self.crn
+ if hasattr(self, 'deleted') and self.deleted is not None:
+ if isinstance(self.deleted, dict):
+ _dict['deleted'] = self.deleted
+ else:
+ _dict['deleted'] = self.deleted.to_dict()
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
+ if hasattr(self, 'id') and self.id is not None:
+ _dict['id'] = self.id
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
return _dict
def _to_dict(self):
@@ -92480,87 +96176,132 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this DedicatedHostProfileSocketDependent object."""
+ """Return a `str` version of this BackupPolicyJobSourceInstanceReference object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'DedicatedHostProfileSocketDependent') -> bool:
+ def __eq__(self, other: 'BackupPolicyJobSourceInstanceReference') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'DedicatedHostProfileSocketDependent') -> bool:
+ def __ne__(self, other: 'BackupPolicyJobSourceInstanceReference') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class TypeEnum(str, Enum):
- """
- The type for this profile field.
- """
-
- DEPENDENT = 'dependent'
-
-
-class DedicatedHostProfileSocketEnum(DedicatedHostProfileSocket):
+class BackupPolicyJobSourceVolumeReference(BackupPolicyJobSource):
"""
- The permitted values for CPU socket count for a dedicated host with this profile.
+ BackupPolicyJobSourceVolumeReference.
- :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.
+ :param str crn: The CRN 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 volume.
+ :param str id: The unique identifier for this volume.
+ :param str name: The name for this volume. The name is unique across all volumes
+ in the region.
+ :param VolumeRemote remote: (optional) If present, this property indicates that
+ the resource associated with this reference
+ is remote and therefore may not be directly retrievable.
+ :param str resource_type: The resource type.
"""
def __init__(
self,
- default: int,
- type: str,
- values: List[int],
+ crn: str,
+ href: str,
+ id: str,
+ name: str,
+ resource_type: str,
+ *,
+ deleted: Optional['VolumeReferenceDeleted'] = None,
+ remote: Optional['VolumeRemote'] = None,
) -> None:
"""
- Initialize a DedicatedHostProfileSocketEnum object.
+ Initialize a BackupPolicyJobSourceVolumeReference object.
- :param int default: The default value for this profile field.
- :param str type: The type for this profile field.
- :param List[int] values: The permitted values for this profile field.
+ :param str crn: The CRN for this volume.
+ :param str href: The URL for this volume.
+ :param str id: The unique identifier for this volume.
+ :param str name: The name for this volume. The name is unique across all
+ volumes in the region.
+ :param str resource_type: The resource type.
+ :param VolumeReferenceDeleted deleted: (optional) If present, this property
+ indicates the referenced resource has been deleted, and provides
+ some supplementary information.
+ :param VolumeRemote remote: (optional) If present, this property indicates
+ that the resource associated with this reference
+ is remote and therefore may not be directly retrievable.
"""
# pylint: disable=super-init-not-called
- self.default = default
- self.type = type
- self.values = values
+ self.crn = crn
+ self.deleted = deleted
+ self.href = href
+ self.id = id
+ self.name = name
+ self.remote = remote
+ self.resource_type = resource_type
@classmethod
- def from_dict(cls, _dict: Dict) -> 'DedicatedHostProfileSocketEnum':
- """Initialize a DedicatedHostProfileSocketEnum object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'BackupPolicyJobSourceVolumeReference':
+ """Initialize a BackupPolicyJobSourceVolumeReference object from a json dictionary."""
args = {}
- if 'default' in _dict:
- args['default'] = _dict.get('default')
+ if (crn := _dict.get('crn')) is not None:
+ args['crn'] = crn
else:
- raise ValueError('Required property \'default\' not present in DedicatedHostProfileSocketEnum JSON')
- if 'type' in _dict:
- args['type'] = _dict.get('type')
+ raise ValueError('Required property \'crn\' not present in BackupPolicyJobSourceVolumeReference JSON')
+ if (deleted := _dict.get('deleted')) is not None:
+ args['deleted'] = VolumeReferenceDeleted.from_dict(deleted)
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'type\' not present in DedicatedHostProfileSocketEnum JSON')
- if 'values' in _dict:
- args['values'] = _dict.get('values')
+ raise ValueError('Required property \'href\' not present in BackupPolicyJobSourceVolumeReference JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
else:
- raise ValueError('Required property \'values\' not present in DedicatedHostProfileSocketEnum JSON')
+ raise ValueError('Required property \'id\' not present in BackupPolicyJobSourceVolumeReference JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ else:
+ raise ValueError('Required property \'name\' not present in BackupPolicyJobSourceVolumeReference JSON')
+ if (remote := _dict.get('remote')) is not None:
+ args['remote'] = VolumeRemote.from_dict(remote)
+ if (resource_type := _dict.get('resource_type')) is not None:
+ args['resource_type'] = resource_type
+ else:
+ raise ValueError('Required property \'resource_type\' not present in BackupPolicyJobSourceVolumeReference JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a DedicatedHostProfileSocketEnum object from a json dictionary."""
+ """Initialize a BackupPolicyJobSourceVolumeReference object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'default') and self.default is not None:
- _dict['default'] = self.default
- if hasattr(self, 'type') and self.type is not None:
- _dict['type'] = self.type
- if hasattr(self, 'values') and self.values is not None:
- _dict['values'] = self.values
+ if hasattr(self, 'crn') and self.crn is not None:
+ _dict['crn'] = self.crn
+ if hasattr(self, 'deleted') and self.deleted is not None:
+ if isinstance(self.deleted, dict):
+ _dict['deleted'] = self.deleted
+ else:
+ _dict['deleted'] = self.deleted.to_dict()
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
+ if hasattr(self, 'id') and self.id is not None:
+ _dict['id'] = self.id
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ if hasattr(self, 'remote') and self.remote is not None:
+ if isinstance(self.remote, dict):
+ _dict['remote'] = self.remote
+ else:
+ _dict['remote'] = self.remote.to_dict()
+ if hasattr(self, 'resource_type') and self.resource_type is not None:
+ _dict['resource_type'] = self.resource_type
return _dict
def _to_dict(self):
@@ -92568,77 +96309,302 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this DedicatedHostProfileSocketEnum object."""
+ """Return a `str` version of this BackupPolicyJobSourceVolumeReference object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'DedicatedHostProfileSocketEnum') -> bool:
+ def __eq__(self, other: 'BackupPolicyJobSourceVolumeReference') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'DedicatedHostProfileSocketEnum') -> bool:
+ def __ne__(self, other: 'BackupPolicyJobSourceVolumeReference') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class TypeEnum(str, Enum):
+ class ResourceTypeEnum(str, Enum):
"""
- The type for this profile field.
+ The resource type.
"""
- ENUM = 'enum'
+ VOLUME = 'volume'
-class DedicatedHostProfileSocketFixed(DedicatedHostProfileSocket):
+class BackupPolicyMatchResourceTypeInstance(BackupPolicy):
"""
- The CPU socket count for a dedicated host with this profile.
+ BackupPolicyMatchResourceTypeInstance.
- :attr str type: The type for this profile field.
- :attr int value: The value for this profile field.
+ :param datetime created_at: The date and time that the backup policy was
+ created.
+ :param str crn: The CRN for this backup policy.
+ :param List[BackupPolicyHealthReason] health_reasons: The reasons for the
+ current `health_state` (if any).
+ The enumerated reason code values for this property will expand in the future.
+ When processing this property, check for and log unknown values. Optionally halt
+ processing and surface the error, or bypass the resource on which the unexpected
+ reason code was encountered.
+ :param str health_state: The health of this resource.
+ - `ok`: No abnormal behavior detected
+ - `degraded`: Experiencing compromised performance, capacity, or connectivity
+ - `faulted`: Completely unreachable, inoperative, or otherwise entirely
+ incapacitated
+ - `inapplicable`: The health state does not apply because of the current
+ lifecycle state. A resource with a lifecycle state of `failed` or `deleting`
+ will have a health state of `inapplicable`. A `pending` resource may also have
+ this state.
+ :param str href: The URL for this backup policy.
+ :param str id: The unique identifier for this backup policy.
+ :param datetime last_job_completed_at: (optional) The date and time that the
+ most recent job for this backup policy completed.
+ If absent, no job has yet completed for this backup policy.
+ :param str lifecycle_state: The lifecycle state of the backup policy.
+ :param List[str] match_user_tags: The user tags this backup policy applies to.
+ Resources that have both a matching user tag and a matching type will be subject
+ to the backup policy.
+ :param str name: The name for this backup policy. The name is unique across all
+ backup policies in the region.
+ :param List[BackupPolicyPlanReference] plans: The plans for the backup policy.
+ :param ResourceGroupReference resource_group: The resource group for this backup
+ policy.
+ :param str resource_type: The resource type.
+ :param BackupPolicyScope scope:
+ :param List[str] included_content: The included content for backups created
+ using this policy:
+ - `boot_volume`: Include the instance's boot volume.
+ - `data_volumes`: Include the instance's data volumes.
+ 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 backup policy on which the
+ unexpected property value was encountered.
+ :param str match_resource_type: The resource type this backup policy applies to.
+ Resources that have both a matching type and a matching user tag will be subject
+ to the backup policy.
+ The enumerated values for this property 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 backup policy on which the
+ unexpected property value was encountered.
"""
def __init__(
self,
- type: str,
- value: int,
- ) -> None:
- """
- Initialize a DedicatedHostProfileSocketFixed object.
-
- :param str type: The type for this profile field.
- :param int value: The value for this profile field.
- """
- # pylint: disable=super-init-not-called
- self.type = type
- self.value = value
+ created_at: datetime,
+ crn: str,
+ health_reasons: List['BackupPolicyHealthReason'],
+ health_state: str,
+ href: str,
+ id: str,
+ lifecycle_state: str,
+ match_user_tags: List[str],
+ name: str,
+ plans: List['BackupPolicyPlanReference'],
+ resource_group: 'ResourceGroupReference',
+ resource_type: str,
+ scope: 'BackupPolicyScope',
+ included_content: List[str],
+ match_resource_type: str,
+ *,
+ last_job_completed_at: Optional[datetime] = None,
+ ) -> None:
+ """
+ Initialize a BackupPolicyMatchResourceTypeInstance object.
+
+ :param datetime created_at: The date and time that the backup policy was
+ created.
+ :param str crn: The CRN for this backup policy.
+ :param List[BackupPolicyHealthReason] health_reasons: The reasons for the
+ current `health_state` (if any).
+ The enumerated reason code values for this property will expand in the
+ future. When processing this property, check for and log unknown values.
+ Optionally halt processing and surface the error, or bypass the resource on
+ which the unexpected reason code was encountered.
+ :param str health_state: The health of this resource.
+ - `ok`: No abnormal behavior detected
+ - `degraded`: Experiencing compromised performance, capacity, or
+ connectivity
+ - `faulted`: Completely unreachable, inoperative, or otherwise entirely
+ incapacitated
+ - `inapplicable`: The health state does not apply because of the current
+ lifecycle state. A resource with a lifecycle state of `failed` or
+ `deleting` will have a health state of `inapplicable`. A `pending` resource
+ may also have this state.
+ :param str href: The URL for this backup policy.
+ :param str id: The unique identifier for this backup policy.
+ :param str lifecycle_state: The lifecycle state of the backup policy.
+ :param List[str] match_user_tags: The user tags this backup policy applies
+ to. Resources that have both a matching user tag and a matching type will
+ be subject to the backup policy.
+ :param str name: The name for this backup policy. The name is unique across
+ all backup policies in the region.
+ :param List[BackupPolicyPlanReference] plans: The plans for the backup
+ policy.
+ :param ResourceGroupReference resource_group: The resource group for this
+ backup policy.
+ :param str resource_type: The resource type.
+ :param BackupPolicyScope scope:
+ :param List[str] included_content: The included content for backups created
+ using this policy:
+ - `boot_volume`: Include the instance's boot volume.
+ - `data_volumes`: Include the instance's data volumes.
+ 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 backup policy on which the
+ unexpected property value was encountered.
+ :param str match_resource_type: The resource type this backup policy
+ applies to. Resources that have both a matching type and a matching user
+ tag will be subject to the backup policy.
+ The enumerated values for this property 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 backup policy on which the
+ unexpected property value was encountered.
+ :param datetime last_job_completed_at: (optional) The date and time that
+ the most recent job for this backup policy completed.
+ If absent, no job has yet completed for this backup policy.
+ """
+ # pylint: disable=super-init-not-called
+ self.created_at = created_at
+ self.crn = crn
+ self.health_reasons = health_reasons
+ self.health_state = health_state
+ self.href = href
+ self.id = id
+ self.last_job_completed_at = last_job_completed_at
+ self.lifecycle_state = lifecycle_state
+ self.match_user_tags = match_user_tags
+ self.name = name
+ self.plans = plans
+ self.resource_group = resource_group
+ self.resource_type = resource_type
+ self.scope = scope
+ self.included_content = included_content
+ self.match_resource_type = match_resource_type
@classmethod
- def from_dict(cls, _dict: Dict) -> 'DedicatedHostProfileSocketFixed':
- """Initialize a DedicatedHostProfileSocketFixed object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'BackupPolicyMatchResourceTypeInstance':
+ """Initialize a BackupPolicyMatchResourceTypeInstance object from a json dictionary."""
args = {}
- if 'type' in _dict:
- args['type'] = _dict.get('type')
+ if (created_at := _dict.get('created_at')) is not None:
+ args['created_at'] = string_to_datetime(created_at)
else:
- raise ValueError('Required property \'type\' not present in DedicatedHostProfileSocketFixed JSON')
- if 'value' in _dict:
- args['value'] = _dict.get('value')
+ raise ValueError('Required property \'created_at\' not present in BackupPolicyMatchResourceTypeInstance JSON')
+ if (crn := _dict.get('crn')) is not None:
+ args['crn'] = crn
else:
- raise ValueError('Required property \'value\' not present in DedicatedHostProfileSocketFixed JSON')
+ raise ValueError('Required property \'crn\' not present in BackupPolicyMatchResourceTypeInstance JSON')
+ if (health_reasons := _dict.get('health_reasons')) is not None:
+ args['health_reasons'] = [BackupPolicyHealthReason.from_dict(v) for v in health_reasons]
+ else:
+ raise ValueError('Required property \'health_reasons\' not present in BackupPolicyMatchResourceTypeInstance JSON')
+ if (health_state := _dict.get('health_state')) is not None:
+ args['health_state'] = health_state
+ else:
+ raise ValueError('Required property \'health_state\' not present in BackupPolicyMatchResourceTypeInstance JSON')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
+ else:
+ raise ValueError('Required property \'href\' not present in BackupPolicyMatchResourceTypeInstance JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
+ else:
+ raise ValueError('Required property \'id\' not present in BackupPolicyMatchResourceTypeInstance JSON')
+ if (last_job_completed_at := _dict.get('last_job_completed_at')) is not None:
+ args['last_job_completed_at'] = string_to_datetime(last_job_completed_at)
+ if (lifecycle_state := _dict.get('lifecycle_state')) is not None:
+ args['lifecycle_state'] = lifecycle_state
+ else:
+ raise ValueError('Required property \'lifecycle_state\' not present in BackupPolicyMatchResourceTypeInstance JSON')
+ if (match_user_tags := _dict.get('match_user_tags')) is not None:
+ args['match_user_tags'] = match_user_tags
+ else:
+ raise ValueError('Required property \'match_user_tags\' not present in BackupPolicyMatchResourceTypeInstance JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ else:
+ raise ValueError('Required property \'name\' not present in BackupPolicyMatchResourceTypeInstance JSON')
+ if (plans := _dict.get('plans')) is not None:
+ args['plans'] = [BackupPolicyPlanReference.from_dict(v) for v in plans]
+ else:
+ raise ValueError('Required property \'plans\' not present in BackupPolicyMatchResourceTypeInstance JSON')
+ if (resource_group := _dict.get('resource_group')) is not None:
+ args['resource_group'] = ResourceGroupReference.from_dict(resource_group)
+ else:
+ raise ValueError('Required property \'resource_group\' not present in BackupPolicyMatchResourceTypeInstance JSON')
+ if (resource_type := _dict.get('resource_type')) is not None:
+ args['resource_type'] = resource_type
+ else:
+ raise ValueError('Required property \'resource_type\' not present in BackupPolicyMatchResourceTypeInstance JSON')
+ if (scope := _dict.get('scope')) is not None:
+ args['scope'] = scope
+ else:
+ raise ValueError('Required property \'scope\' not present in BackupPolicyMatchResourceTypeInstance JSON')
+ if (included_content := _dict.get('included_content')) is not None:
+ args['included_content'] = included_content
+ else:
+ raise ValueError('Required property \'included_content\' not present in BackupPolicyMatchResourceTypeInstance JSON')
+ if (match_resource_type := _dict.get('match_resource_type')) is not None:
+ args['match_resource_type'] = match_resource_type
+ else:
+ raise ValueError('Required property \'match_resource_type\' not present in BackupPolicyMatchResourceTypeInstance JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a DedicatedHostProfileSocketFixed object from a json dictionary."""
+ """Initialize a BackupPolicyMatchResourceTypeInstance object from 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, 'created_at') and self.created_at is not None:
+ _dict['created_at'] = datetime_to_string(self.created_at)
+ if hasattr(self, 'crn') and self.crn is not None:
+ _dict['crn'] = self.crn
+ if hasattr(self, 'health_reasons') and self.health_reasons is not None:
+ health_reasons_list = []
+ for v in self.health_reasons:
+ if isinstance(v, dict):
+ health_reasons_list.append(v)
+ else:
+ health_reasons_list.append(v.to_dict())
+ _dict['health_reasons'] = health_reasons_list
+ if hasattr(self, 'health_state') and self.health_state is not None:
+ _dict['health_state'] = self.health_state
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
+ if hasattr(self, 'id') and self.id is not None:
+ _dict['id'] = self.id
+ if hasattr(self, 'last_job_completed_at') and self.last_job_completed_at is not None:
+ _dict['last_job_completed_at'] = datetime_to_string(self.last_job_completed_at)
+ if hasattr(self, 'lifecycle_state') and self.lifecycle_state is not None:
+ _dict['lifecycle_state'] = self.lifecycle_state
+ if hasattr(self, 'match_user_tags') and self.match_user_tags is not None:
+ _dict['match_user_tags'] = self.match_user_tags
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ if hasattr(self, 'plans') and self.plans is not None:
+ plans_list = []
+ for v in self.plans:
+ if isinstance(v, dict):
+ plans_list.append(v)
+ else:
+ plans_list.append(v.to_dict())
+ _dict['plans'] = plans_list
+ if hasattr(self, 'resource_group') and self.resource_group is not None:
+ if isinstance(self.resource_group, dict):
+ _dict['resource_group'] = self.resource_group
+ else:
+ _dict['resource_group'] = self.resource_group.to_dict()
+ if hasattr(self, 'resource_type') and self.resource_type is not None:
+ _dict['resource_type'] = self.resource_type
+ if hasattr(self, 'scope') and self.scope is not None:
+ if isinstance(self.scope, dict):
+ _dict['scope'] = self.scope
+ else:
+ _dict['scope'] = self.scope.to_dict()
+ if hasattr(self, 'included_content') and self.included_content is not None:
+ _dict['included_content'] = self.included_content
+ if hasattr(self, 'match_resource_type') and self.match_resource_type is not None:
+ _dict['match_resource_type'] = self.match_resource_type
return _dict
def _to_dict(self):
@@ -92646,107 +96612,332 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this DedicatedHostProfileSocketFixed object."""
+ """Return a `str` version of this BackupPolicyMatchResourceTypeInstance object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'DedicatedHostProfileSocketFixed') -> bool:
+ def __eq__(self, other: 'BackupPolicyMatchResourceTypeInstance') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'DedicatedHostProfileSocketFixed') -> bool:
+ def __ne__(self, other: 'BackupPolicyMatchResourceTypeInstance') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class TypeEnum(str, Enum):
+ class HealthStateEnum(str, Enum):
"""
- The type for this profile field.
+ 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.
"""
- FIXED = 'fixed'
+ DEGRADED = 'degraded'
+ FAULTED = 'faulted'
+ INAPPLICABLE = 'inapplicable'
+ OK = 'ok'
+ class LifecycleStateEnum(str, Enum):
+ """
+ The lifecycle state of the backup policy.
+ """
-class DedicatedHostProfileSocketRange(DedicatedHostProfileSocket):
+ DELETING = 'deleting'
+ FAILED = 'failed'
+ PENDING = 'pending'
+ STABLE = 'stable'
+ SUSPENDED = 'suspended'
+ UPDATING = 'updating'
+ WAITING = 'waiting'
+
+
+ class ResourceTypeEnum(str, Enum):
+ """
+ The resource type.
+ """
+
+ BACKUP_POLICY = 'backup_policy'
+
+
+ class IncludedContentEnum(str, Enum):
+ """
+ An item to include.
+ """
+
+ BOOT_VOLUME = 'boot_volume'
+ DATA_VOLUMES = 'data_volumes'
+
+
+ class MatchResourceTypeEnum(str, Enum):
+ """
+ The resource type this backup policy applies to. Resources that have both a
+ matching type and a matching user tag will be subject to the backup policy.
+ The enumerated values for this property 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 backup policy on which the unexpected property
+ value was encountered.
+ """
+
+ INSTANCE = 'instance'
+
+
+
+class BackupPolicyMatchResourceTypeVolume(BackupPolicy):
"""
- The permitted range for CPU socket count for a dedicated host with this profile.
+ BackupPolicyMatchResourceTypeVolume.
- :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.
+ :param datetime created_at: The date and time that the backup policy was
+ created.
+ :param str crn: The CRN for this backup policy.
+ :param List[BackupPolicyHealthReason] health_reasons: The reasons for the
+ current `health_state` (if any).
+ The enumerated reason code values for this property will expand in the future.
+ When processing this property, check for and log unknown values. Optionally halt
+ processing and surface the error, or bypass the resource on which the unexpected
+ reason code was encountered.
+ :param str health_state: The health of this resource.
+ - `ok`: No abnormal behavior detected
+ - `degraded`: Experiencing compromised performance, capacity, or connectivity
+ - `faulted`: Completely unreachable, inoperative, or otherwise entirely
+ incapacitated
+ - `inapplicable`: The health state does not apply because of the current
+ lifecycle state. A resource with a lifecycle state of `failed` or `deleting`
+ will have a health state of `inapplicable`. A `pending` resource may also have
+ this state.
+ :param str href: The URL for this backup policy.
+ :param str id: The unique identifier for this backup policy.
+ :param datetime last_job_completed_at: (optional) The date and time that the
+ most recent job for this backup policy completed.
+ If absent, no job has yet completed for this backup policy.
+ :param str lifecycle_state: The lifecycle state of the backup policy.
+ :param List[str] match_user_tags: The user tags this backup policy applies to.
+ Resources that have both a matching user tag and a matching type will be subject
+ to the backup policy.
+ :param str name: The name for this backup policy. The name is unique across all
+ backup policies in the region.
+ :param List[BackupPolicyPlanReference] plans: The plans for the backup policy.
+ :param ResourceGroupReference resource_group: The resource group for this backup
+ policy.
+ :param str resource_type: The resource type.
+ :param BackupPolicyScope scope:
+ :param str match_resource_type: The resource type this backup policy applies to.
+ Resources that have both a matching type and a matching user tag will be subject
+ to the backup policy.
+ The enumerated values for this property 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 backup policy on which the
+ unexpected property value was encountered.
"""
def __init__(
self,
- default: int,
- max: int,
- min: int,
- step: int,
- type: str,
+ created_at: datetime,
+ crn: str,
+ health_reasons: List['BackupPolicyHealthReason'],
+ health_state: str,
+ href: str,
+ id: str,
+ lifecycle_state: str,
+ match_user_tags: List[str],
+ name: str,
+ plans: List['BackupPolicyPlanReference'],
+ resource_group: 'ResourceGroupReference',
+ resource_type: str,
+ scope: 'BackupPolicyScope',
+ match_resource_type: str,
+ *,
+ last_job_completed_at: Optional[datetime] = None,
) -> None:
"""
- Initialize a DedicatedHostProfileSocketRange object.
+ Initialize a BackupPolicyMatchResourceTypeVolume object.
- :param int default: The default value for this profile field.
- :param int max: The maximum value for this profile field.
- :param int min: The minimum value for this profile field.
- :param int step: The increment step value for this profile field.
- :param str type: The type for this profile field.
+ :param datetime created_at: The date and time that the backup policy was
+ created.
+ :param str crn: The CRN for this backup policy.
+ :param List[BackupPolicyHealthReason] health_reasons: The reasons for the
+ current `health_state` (if any).
+ The enumerated reason code values for this property will expand in the
+ future. When processing this property, check for and log unknown values.
+ Optionally halt processing and surface the error, or bypass the resource on
+ which the unexpected reason code was encountered.
+ :param str health_state: The health of this resource.
+ - `ok`: No abnormal behavior detected
+ - `degraded`: Experiencing compromised performance, capacity, or
+ connectivity
+ - `faulted`: Completely unreachable, inoperative, or otherwise entirely
+ incapacitated
+ - `inapplicable`: The health state does not apply because of the current
+ lifecycle state. A resource with a lifecycle state of `failed` or
+ `deleting` will have a health state of `inapplicable`. A `pending` resource
+ may also have this state.
+ :param str href: The URL for this backup policy.
+ :param str id: The unique identifier for this backup policy.
+ :param str lifecycle_state: The lifecycle state of the backup policy.
+ :param List[str] match_user_tags: The user tags this backup policy applies
+ to. Resources that have both a matching user tag and a matching type will
+ be subject to the backup policy.
+ :param str name: The name for this backup policy. The name is unique across
+ all backup policies in the region.
+ :param List[BackupPolicyPlanReference] plans: The plans for the backup
+ policy.
+ :param ResourceGroupReference resource_group: The resource group for this
+ backup policy.
+ :param str resource_type: The resource type.
+ :param BackupPolicyScope scope:
+ :param str match_resource_type: The resource type this backup policy
+ applies to. Resources that have both a matching type and a matching user
+ tag will be subject to the backup policy.
+ The enumerated values for this property 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 backup policy on which the
+ unexpected property value was encountered.
+ :param datetime last_job_completed_at: (optional) The date and time that
+ the most recent job for this backup policy completed.
+ If absent, no job has yet completed for this backup policy.
"""
# pylint: disable=super-init-not-called
- self.default = default
- self.max = max
- self.min = min
- self.step = step
- self.type = type
+ self.created_at = created_at
+ self.crn = crn
+ self.health_reasons = health_reasons
+ self.health_state = health_state
+ self.href = href
+ self.id = id
+ self.last_job_completed_at = last_job_completed_at
+ self.lifecycle_state = lifecycle_state
+ self.match_user_tags = match_user_tags
+ self.name = name
+ self.plans = plans
+ self.resource_group = resource_group
+ self.resource_type = resource_type
+ self.scope = scope
+ self.match_resource_type = match_resource_type
@classmethod
- def from_dict(cls, _dict: Dict) -> 'DedicatedHostProfileSocketRange':
- """Initialize a DedicatedHostProfileSocketRange object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'BackupPolicyMatchResourceTypeVolume':
+ """Initialize a BackupPolicyMatchResourceTypeVolume object from a json dictionary."""
args = {}
- if 'default' in _dict:
- args['default'] = _dict.get('default')
+ if (created_at := _dict.get('created_at')) is not None:
+ args['created_at'] = string_to_datetime(created_at)
else:
- raise ValueError('Required property \'default\' not present in DedicatedHostProfileSocketRange JSON')
- if 'max' in _dict:
- args['max'] = _dict.get('max')
+ raise ValueError('Required property \'created_at\' not present in BackupPolicyMatchResourceTypeVolume JSON')
+ if (crn := _dict.get('crn')) is not None:
+ args['crn'] = crn
else:
- raise ValueError('Required property \'max\' not present in DedicatedHostProfileSocketRange JSON')
- if 'min' in _dict:
- args['min'] = _dict.get('min')
+ raise ValueError('Required property \'crn\' not present in BackupPolicyMatchResourceTypeVolume JSON')
+ if (health_reasons := _dict.get('health_reasons')) is not None:
+ args['health_reasons'] = [BackupPolicyHealthReason.from_dict(v) for v in health_reasons]
else:
- raise ValueError('Required property \'min\' not present in DedicatedHostProfileSocketRange JSON')
- if 'step' in _dict:
- args['step'] = _dict.get('step')
+ raise ValueError('Required property \'health_reasons\' not present in BackupPolicyMatchResourceTypeVolume JSON')
+ if (health_state := _dict.get('health_state')) is not None:
+ args['health_state'] = health_state
else:
- raise ValueError('Required property \'step\' not present in DedicatedHostProfileSocketRange JSON')
- if 'type' in _dict:
- args['type'] = _dict.get('type')
+ raise ValueError('Required property \'health_state\' not present in BackupPolicyMatchResourceTypeVolume JSON')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'type\' not present in DedicatedHostProfileSocketRange JSON')
+ raise ValueError('Required property \'href\' not present in BackupPolicyMatchResourceTypeVolume JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
+ else:
+ raise ValueError('Required property \'id\' not present in BackupPolicyMatchResourceTypeVolume JSON')
+ if (last_job_completed_at := _dict.get('last_job_completed_at')) is not None:
+ args['last_job_completed_at'] = string_to_datetime(last_job_completed_at)
+ if (lifecycle_state := _dict.get('lifecycle_state')) is not None:
+ args['lifecycle_state'] = lifecycle_state
+ else:
+ raise ValueError('Required property \'lifecycle_state\' not present in BackupPolicyMatchResourceTypeVolume JSON')
+ if (match_user_tags := _dict.get('match_user_tags')) is not None:
+ args['match_user_tags'] = match_user_tags
+ else:
+ raise ValueError('Required property \'match_user_tags\' not present in BackupPolicyMatchResourceTypeVolume JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ else:
+ raise ValueError('Required property \'name\' not present in BackupPolicyMatchResourceTypeVolume JSON')
+ if (plans := _dict.get('plans')) is not None:
+ args['plans'] = [BackupPolicyPlanReference.from_dict(v) for v in plans]
+ else:
+ raise ValueError('Required property \'plans\' not present in BackupPolicyMatchResourceTypeVolume JSON')
+ if (resource_group := _dict.get('resource_group')) is not None:
+ args['resource_group'] = ResourceGroupReference.from_dict(resource_group)
+ else:
+ raise ValueError('Required property \'resource_group\' not present in BackupPolicyMatchResourceTypeVolume JSON')
+ if (resource_type := _dict.get('resource_type')) is not None:
+ args['resource_type'] = resource_type
+ else:
+ raise ValueError('Required property \'resource_type\' not present in BackupPolicyMatchResourceTypeVolume JSON')
+ if (scope := _dict.get('scope')) is not None:
+ args['scope'] = scope
+ else:
+ raise ValueError('Required property \'scope\' not present in BackupPolicyMatchResourceTypeVolume JSON')
+ if (match_resource_type := _dict.get('match_resource_type')) is not None:
+ args['match_resource_type'] = match_resource_type
+ else:
+ raise ValueError('Required property \'match_resource_type\' not present in BackupPolicyMatchResourceTypeVolume JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a DedicatedHostProfileSocketRange object from a json dictionary."""
+ """Initialize a BackupPolicyMatchResourceTypeVolume object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'default') and self.default is not None:
- _dict['default'] = self.default
- if hasattr(self, 'max') and self.max is not None:
- _dict['max'] = self.max
- if hasattr(self, 'min') and self.min is not None:
- _dict['min'] = self.min
- if hasattr(self, 'step') and self.step is not None:
- _dict['step'] = self.step
- if hasattr(self, 'type') and self.type is not None:
- _dict['type'] = self.type
+ if hasattr(self, 'created_at') and self.created_at is not None:
+ _dict['created_at'] = datetime_to_string(self.created_at)
+ if hasattr(self, 'crn') and self.crn is not None:
+ _dict['crn'] = self.crn
+ if hasattr(self, 'health_reasons') and self.health_reasons is not None:
+ health_reasons_list = []
+ for v in self.health_reasons:
+ if isinstance(v, dict):
+ health_reasons_list.append(v)
+ else:
+ health_reasons_list.append(v.to_dict())
+ _dict['health_reasons'] = health_reasons_list
+ if hasattr(self, 'health_state') and self.health_state is not None:
+ _dict['health_state'] = self.health_state
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
+ if hasattr(self, 'id') and self.id is not None:
+ _dict['id'] = self.id
+ if hasattr(self, 'last_job_completed_at') and self.last_job_completed_at is not None:
+ _dict['last_job_completed_at'] = datetime_to_string(self.last_job_completed_at)
+ if hasattr(self, 'lifecycle_state') and self.lifecycle_state is not None:
+ _dict['lifecycle_state'] = self.lifecycle_state
+ if hasattr(self, 'match_user_tags') and self.match_user_tags is not None:
+ _dict['match_user_tags'] = self.match_user_tags
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ if hasattr(self, 'plans') and self.plans is not None:
+ plans_list = []
+ for v in self.plans:
+ if isinstance(v, dict):
+ plans_list.append(v)
+ else:
+ plans_list.append(v.to_dict())
+ _dict['plans'] = plans_list
+ if hasattr(self, 'resource_group') and self.resource_group is not None:
+ if isinstance(self.resource_group, dict):
+ _dict['resource_group'] = self.resource_group
+ else:
+ _dict['resource_group'] = self.resource_group.to_dict()
+ if hasattr(self, 'resource_type') and self.resource_type is not None:
+ _dict['resource_type'] = self.resource_type
+ if hasattr(self, 'scope') and self.scope is not None:
+ if isinstance(self.scope, dict):
+ _dict['scope'] = self.scope
+ else:
+ _dict['scope'] = self.scope.to_dict()
+ if hasattr(self, 'match_resource_type') and self.match_resource_type is not None:
+ _dict['match_resource_type'] = self.match_resource_type
return _dict
def _to_dict(self):
@@ -92754,67 +96945,195 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this DedicatedHostProfileSocketRange object."""
+ """Return a `str` version of this BackupPolicyMatchResourceTypeVolume object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'DedicatedHostProfileSocketRange') -> bool:
+ def __eq__(self, other: 'BackupPolicyMatchResourceTypeVolume') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'DedicatedHostProfileSocketRange') -> bool:
+ def __ne__(self, other: 'BackupPolicyMatchResourceTypeVolume') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class TypeEnum(str, Enum):
+ class HealthStateEnum(str, Enum):
"""
- The type for this profile field.
+ 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.
"""
- RANGE = 'range'
+ DEGRADED = 'degraded'
+ FAULTED = 'faulted'
+ INAPPLICABLE = 'inapplicable'
+ OK = 'ok'
+ class LifecycleStateEnum(str, Enum):
+ """
+ The lifecycle state of the backup policy.
+ """
-class DedicatedHostProfileVCPUDependent(DedicatedHostProfileVCPU):
+ DELETING = 'deleting'
+ FAILED = 'failed'
+ PENDING = 'pending'
+ STABLE = 'stable'
+ SUSPENDED = 'suspended'
+ UPDATING = 'updating'
+ WAITING = 'waiting'
+
+
+ class ResourceTypeEnum(str, Enum):
+ """
+ The resource type.
+ """
+
+ BACKUP_POLICY = 'backup_policy'
+
+
+ class MatchResourceTypeEnum(str, Enum):
+ """
+ The resource type this backup policy applies to. Resources that have both a
+ matching type and a matching user tag will be subject to the backup policy.
+ The enumerated values for this property 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 backup policy on which the unexpected property
+ value was encountered.
+ """
+
+ VOLUME = 'volume'
+
+
+
+class BackupPolicyPrototypeBackupPolicyMatchResourceTypeInstancePrototype(BackupPolicyPrototype):
"""
- The VCPU count for a dedicated host with this profile depends on its configuration.
+ BackupPolicyPrototypeBackupPolicyMatchResourceTypeInstancePrototype.
- :attr str type: The type for this profile field.
+ :param List[str] match_user_tags: The user tags this backup policy will apply
+ to. Resources that have both a matching user tag and a matching type will be
+ subject to the backup policy.
+ :param str name: (optional) The name for this backup policy. The name must not
+ be used by another backup policy in the region. If unspecified, the name will be
+ a hyphenated list of randomly-selected words.
+ :param List[BackupPolicyPlanPrototype] plans: (optional) The prototype objects
+ for backup plans to be created for this backup policy.
+ :param ResourceGroupIdentity resource_group: (optional)
+ :param BackupPolicyScopePrototype scope: (optional)
+ :param List[str] included_content: (optional) The included content for backups
+ created using this policy:
+ - `boot_volume`: Include the instance's boot volume.
+ - `data_volumes`: Include the instance's data volumes.
+ :param str match_resource_type: The resource type this backup policy will apply
+ to. Resources that have both a matching type and a matching user tag will be
+ subject to the backup policy.
"""
def __init__(
self,
- type: str,
+ match_user_tags: List[str],
+ match_resource_type: str,
+ *,
+ name: Optional[str] = None,
+ plans: Optional[List['BackupPolicyPlanPrototype']] = None,
+ resource_group: Optional['ResourceGroupIdentity'] = None,
+ scope: Optional['BackupPolicyScopePrototype'] = None,
+ included_content: Optional[List[str]] = None,
) -> None:
"""
- Initialize a DedicatedHostProfileVCPUDependent object.
+ Initialize a BackupPolicyPrototypeBackupPolicyMatchResourceTypeInstancePrototype object.
- :param str type: The type for this profile field.
+ :param List[str] match_user_tags: The user tags this backup policy will
+ apply to. Resources that have both a matching user tag and a matching type
+ will be subject to the backup policy.
+ :param str match_resource_type: The resource type this backup policy will
+ apply to. Resources that have both a matching type and a matching user tag
+ will be subject to the backup policy.
+ :param str name: (optional) The name for this backup policy. The name must
+ not be used by another backup policy in the region. If unspecified, the
+ name will be a hyphenated list of randomly-selected words.
+ :param List[BackupPolicyPlanPrototype] plans: (optional) The prototype
+ objects for backup plans to be created for this backup policy.
+ :param ResourceGroupIdentity resource_group: (optional)
+ :param BackupPolicyScopePrototype scope: (optional)
+ :param List[str] included_content: (optional) The included content for
+ backups created using this policy:
+ - `boot_volume`: Include the instance's boot volume.
+ - `data_volumes`: Include the instance's data volumes.
"""
# pylint: disable=super-init-not-called
- self.type = type
+ self.match_user_tags = match_user_tags
+ self.name = name
+ self.plans = plans
+ self.resource_group = resource_group
+ self.scope = scope
+ self.included_content = included_content
+ self.match_resource_type = match_resource_type
@classmethod
- def from_dict(cls, _dict: Dict) -> 'DedicatedHostProfileVCPUDependent':
- """Initialize a DedicatedHostProfileVCPUDependent object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'BackupPolicyPrototypeBackupPolicyMatchResourceTypeInstancePrototype':
+ """Initialize a BackupPolicyPrototypeBackupPolicyMatchResourceTypeInstancePrototype object from a json dictionary."""
args = {}
- if 'type' in _dict:
- args['type'] = _dict.get('type')
+ if (match_user_tags := _dict.get('match_user_tags')) is not None:
+ args['match_user_tags'] = match_user_tags
else:
- raise ValueError('Required property \'type\' not present in DedicatedHostProfileVCPUDependent JSON')
+ raise ValueError('Required property \'match_user_tags\' not present in BackupPolicyPrototypeBackupPolicyMatchResourceTypeInstancePrototype JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ if (plans := _dict.get('plans')) is not None:
+ args['plans'] = [BackupPolicyPlanPrototype.from_dict(v) for v in plans]
+ if (resource_group := _dict.get('resource_group')) is not None:
+ args['resource_group'] = resource_group
+ if (scope := _dict.get('scope')) is not None:
+ args['scope'] = scope
+ if (included_content := _dict.get('included_content')) is not None:
+ args['included_content'] = included_content
+ if (match_resource_type := _dict.get('match_resource_type')) is not None:
+ args['match_resource_type'] = match_resource_type
+ else:
+ raise ValueError('Required property \'match_resource_type\' not present in BackupPolicyPrototypeBackupPolicyMatchResourceTypeInstancePrototype JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a DedicatedHostProfileVCPUDependent object from a json dictionary."""
+ """Initialize a BackupPolicyPrototypeBackupPolicyMatchResourceTypeInstancePrototype object from 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, 'match_user_tags') and self.match_user_tags is not None:
+ _dict['match_user_tags'] = self.match_user_tags
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ if hasattr(self, 'plans') and self.plans is not None:
+ plans_list = []
+ for v in self.plans:
+ if isinstance(v, dict):
+ plans_list.append(v)
+ else:
+ plans_list.append(v.to_dict())
+ _dict['plans'] = plans_list
+ if hasattr(self, 'resource_group') and self.resource_group is not None:
+ if isinstance(self.resource_group, dict):
+ _dict['resource_group'] = self.resource_group
+ else:
+ _dict['resource_group'] = self.resource_group.to_dict()
+ if hasattr(self, 'scope') and self.scope is not None:
+ if isinstance(self.scope, dict):
+ _dict['scope'] = self.scope
+ else:
+ _dict['scope'] = self.scope.to_dict()
+ if hasattr(self, 'included_content') and self.included_content is not None:
+ _dict['included_content'] = self.included_content
+ if hasattr(self, 'match_resource_type') and self.match_resource_type is not None:
+ _dict['match_resource_type'] = self.match_resource_type
return _dict
def _to_dict(self):
@@ -92822,87 +97141,146 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this DedicatedHostProfileVCPUDependent object."""
+ """Return a `str` version of this BackupPolicyPrototypeBackupPolicyMatchResourceTypeInstancePrototype object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'DedicatedHostProfileVCPUDependent') -> bool:
+ def __eq__(self, other: 'BackupPolicyPrototypeBackupPolicyMatchResourceTypeInstancePrototype') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'DedicatedHostProfileVCPUDependent') -> bool:
+ def __ne__(self, other: 'BackupPolicyPrototypeBackupPolicyMatchResourceTypeInstancePrototype') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class TypeEnum(str, Enum):
+ class IncludedContentEnum(str, Enum):
"""
- The type for this profile field.
+ An item to include.
"""
- DEPENDENT = 'dependent'
+ BOOT_VOLUME = 'boot_volume'
+ DATA_VOLUMES = 'data_volumes'
+ class MatchResourceTypeEnum(str, Enum):
+ """
+ The resource type this backup policy will apply to. Resources that have both a
+ matching type and a matching user tag will be subject to the backup policy.
+ """
-class DedicatedHostProfileVCPUEnum(DedicatedHostProfileVCPU):
+ INSTANCE = 'instance'
+
+
+
+class BackupPolicyPrototypeBackupPolicyMatchResourceTypeVolumePrototype(BackupPolicyPrototype):
"""
- The permitted values for VCPU count for a dedicated host with this profile.
+ BackupPolicyPrototypeBackupPolicyMatchResourceTypeVolumePrototype.
- :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.
+ :param List[str] match_user_tags: The user tags this backup policy will apply
+ to. Resources that have both a matching user tag and a matching type will be
+ subject to the backup policy.
+ :param str name: (optional) The name for this backup policy. The name must not
+ be used by another backup policy in the region. If unspecified, the name will be
+ a hyphenated list of randomly-selected words.
+ :param List[BackupPolicyPlanPrototype] plans: (optional) The prototype objects
+ for backup plans to be created for this backup policy.
+ :param ResourceGroupIdentity resource_group: (optional)
+ :param BackupPolicyScopePrototype scope: (optional)
+ :param str match_resource_type: The resource type this backup policy will apply
+ to. Resources that have both a matching type and a matching user tag will be
+ subject to the backup policy.
"""
def __init__(
self,
- default: int,
- type: str,
- values: List[int],
+ match_user_tags: List[str],
+ match_resource_type: str,
+ *,
+ name: Optional[str] = None,
+ plans: Optional[List['BackupPolicyPlanPrototype']] = None,
+ resource_group: Optional['ResourceGroupIdentity'] = None,
+ scope: Optional['BackupPolicyScopePrototype'] = None,
) -> None:
"""
- Initialize a DedicatedHostProfileVCPUEnum object.
-
- :param int default: The default value for this profile field.
- :param str type: The type for this profile field.
- :param List[int] values: The permitted values for this profile field.
- """
- # pylint: disable=super-init-not-called
- self.default = default
- self.type = type
- self.values = values
+ Initialize a BackupPolicyPrototypeBackupPolicyMatchResourceTypeVolumePrototype object.
+
+ :param List[str] match_user_tags: The user tags this backup policy will
+ apply to. Resources that have both a matching user tag and a matching type
+ will be subject to the backup policy.
+ :param str match_resource_type: The resource type this backup policy will
+ apply to. Resources that have both a matching type and a matching user tag
+ will be subject to the backup policy.
+ :param str name: (optional) The name for this backup policy. The name must
+ not be used by another backup policy in the region. If unspecified, the
+ name will be a hyphenated list of randomly-selected words.
+ :param List[BackupPolicyPlanPrototype] plans: (optional) The prototype
+ objects for backup plans to be created for this backup policy.
+ :param ResourceGroupIdentity resource_group: (optional)
+ :param BackupPolicyScopePrototype scope: (optional)
+ """
+ # pylint: disable=super-init-not-called
+ self.match_user_tags = match_user_tags
+ self.name = name
+ self.plans = plans
+ self.resource_group = resource_group
+ self.scope = scope
+ self.match_resource_type = match_resource_type
@classmethod
- def from_dict(cls, _dict: Dict) -> 'DedicatedHostProfileVCPUEnum':
- """Initialize a DedicatedHostProfileVCPUEnum object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'BackupPolicyPrototypeBackupPolicyMatchResourceTypeVolumePrototype':
+ """Initialize a BackupPolicyPrototypeBackupPolicyMatchResourceTypeVolumePrototype object from a json dictionary."""
args = {}
- if 'default' in _dict:
- args['default'] = _dict.get('default')
+ if (match_user_tags := _dict.get('match_user_tags')) is not None:
+ args['match_user_tags'] = match_user_tags
else:
- raise ValueError('Required property \'default\' not present in DedicatedHostProfileVCPUEnum JSON')
- if 'type' in _dict:
- args['type'] = _dict.get('type')
- else:
- raise ValueError('Required property \'type\' not present in DedicatedHostProfileVCPUEnum JSON')
- if 'values' in _dict:
- args['values'] = _dict.get('values')
+ raise ValueError('Required property \'match_user_tags\' not present in BackupPolicyPrototypeBackupPolicyMatchResourceTypeVolumePrototype JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ if (plans := _dict.get('plans')) is not None:
+ args['plans'] = [BackupPolicyPlanPrototype.from_dict(v) for v in plans]
+ if (resource_group := _dict.get('resource_group')) is not None:
+ args['resource_group'] = resource_group
+ if (scope := _dict.get('scope')) is not None:
+ args['scope'] = scope
+ if (match_resource_type := _dict.get('match_resource_type')) is not None:
+ args['match_resource_type'] = match_resource_type
else:
- raise ValueError('Required property \'values\' not present in DedicatedHostProfileVCPUEnum JSON')
+ raise ValueError('Required property \'match_resource_type\' not present in BackupPolicyPrototypeBackupPolicyMatchResourceTypeVolumePrototype JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a DedicatedHostProfileVCPUEnum object from a json dictionary."""
+ """Initialize a BackupPolicyPrototypeBackupPolicyMatchResourceTypeVolumePrototype object from 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, 'match_user_tags') and self.match_user_tags is not None:
+ _dict['match_user_tags'] = self.match_user_tags
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ if hasattr(self, 'plans') and self.plans is not None:
+ plans_list = []
+ for v in self.plans:
+ if isinstance(v, dict):
+ plans_list.append(v)
+ else:
+ plans_list.append(v.to_dict())
+ _dict['plans'] = plans_list
+ if hasattr(self, 'resource_group') and self.resource_group is not None:
+ if isinstance(self.resource_group, dict):
+ _dict['resource_group'] = self.resource_group
+ else:
+ _dict['resource_group'] = self.resource_group.to_dict()
+ if hasattr(self, 'scope') and self.scope is not None:
+ if isinstance(self.scope, dict):
+ _dict['scope'] = self.scope
+ else:
+ _dict['scope'] = self.scope.to_dict()
+ if hasattr(self, 'match_resource_type') and self.match_resource_type is not None:
+ _dict['match_resource_type'] = self.match_resource_type
return _dict
def _to_dict(self):
@@ -92910,77 +97288,98 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this DedicatedHostProfileVCPUEnum object."""
+ """Return a `str` version of this BackupPolicyPrototypeBackupPolicyMatchResourceTypeVolumePrototype object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'DedicatedHostProfileVCPUEnum') -> bool:
+ def __eq__(self, other: 'BackupPolicyPrototypeBackupPolicyMatchResourceTypeVolumePrototype') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'DedicatedHostProfileVCPUEnum') -> bool:
+ def __ne__(self, other: 'BackupPolicyPrototypeBackupPolicyMatchResourceTypeVolumePrototype') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class TypeEnum(str, Enum):
+ class MatchResourceTypeEnum(str, Enum):
"""
- The type for this profile field.
+ The resource type this backup policy will apply to. Resources that have both a
+ matching type and a matching user tag will be subject to the backup policy.
"""
- ENUM = 'enum'
+ VOLUME = 'volume'
-class DedicatedHostProfileVCPUFixed(DedicatedHostProfileVCPU):
+class BackupPolicyScopePrototypeEnterpriseIdentity(BackupPolicyScopePrototype):
"""
- The VCPU count for a dedicated host with this profile.
+ Identifies an enterprise by a unique property.
- :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 DedicatedHostProfileVCPUFixed object.
+ Initialize a BackupPolicyScopePrototypeEnterpriseIdentity object.
- :param str type: The type for this profile field.
- :param int value: The value for this profile field.
"""
# pylint: disable=super-init-not-called
- self.type = type
- self.value = value
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['BackupPolicyScopePrototypeEnterpriseIdentityEnterpriseIdentityByCRN'])
+ )
+ raise Exception(msg)
+
+
+class BackupPolicyScopeAccountReference(BackupPolicyScope):
+ """
+ BackupPolicyScopeAccountReference.
+
+ :param str id: The unique identifier for this account.
+ :param str resource_type: The resource type.
+ """
+
+ def __init__(
+ self,
+ id: str,
+ resource_type: str,
+ ) -> None:
+ """
+ Initialize a BackupPolicyScopeAccountReference object.
+
+ :param str id: The unique identifier for this account.
+ :param str resource_type: The resource type.
+ """
+ # pylint: disable=super-init-not-called
+ self.id = id
+ self.resource_type = resource_type
@classmethod
- def from_dict(cls, _dict: Dict) -> 'DedicatedHostProfileVCPUFixed':
- """Initialize a DedicatedHostProfileVCPUFixed object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'BackupPolicyScopeAccountReference':
+ """Initialize a BackupPolicyScopeAccountReference object from a json dictionary."""
args = {}
- if 'type' in _dict:
- args['type'] = _dict.get('type')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
else:
- raise ValueError('Required property \'type\' not present in DedicatedHostProfileVCPUFixed JSON')
- if 'value' in _dict:
- args['value'] = _dict.get('value')
+ raise ValueError('Required property \'id\' not present in BackupPolicyScopeAccountReference JSON')
+ if (resource_type := _dict.get('resource_type')) is not None:
+ args['resource_type'] = resource_type
else:
- raise ValueError('Required property \'value\' not present in DedicatedHostProfileVCPUFixed JSON')
+ raise ValueError('Required property \'resource_type\' not present in BackupPolicyScopeAccountReference JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a DedicatedHostProfileVCPUFixed object from a json dictionary."""
+ """Initialize a BackupPolicyScopeAccountReference object from 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, 'id') and self.id is not None:
+ _dict['id'] = self.id
+ if hasattr(self, 'resource_type') and self.resource_type is not None:
+ _dict['resource_type'] = self.resource_type
return _dict
def _to_dict(self):
@@ -92988,107 +97387,87 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this DedicatedHostProfileVCPUFixed object."""
+ """Return a `str` version of this BackupPolicyScopeAccountReference object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'DedicatedHostProfileVCPUFixed') -> bool:
+ def __eq__(self, other: 'BackupPolicyScopeAccountReference') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'DedicatedHostProfileVCPUFixed') -> bool:
+ def __ne__(self, other: 'BackupPolicyScopeAccountReference') -> 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'
+ ACCOUNT = 'account'
-class DedicatedHostProfileVCPURange(DedicatedHostProfileVCPU):
+class BackupPolicyScopeEnterpriseReference(BackupPolicyScope):
"""
- The permitted range for VCPU count for a dedicated host with this profile.
+ BackupPolicyScopeEnterpriseReference.
- :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.
+ :param str crn: The CRN for this enterprise.
+ :param str id: The unique identifier for this enterprise.
+ :param str resource_type: The resource type.
"""
def __init__(
self,
- default: int,
- max: int,
- min: int,
- step: int,
- type: str,
+ crn: str,
+ id: str,
+ resource_type: str,
) -> None:
"""
- Initialize a DedicatedHostProfileVCPURange object.
+ Initialize a BackupPolicyScopeEnterpriseReference object.
- :param int default: The default value for this profile field.
- :param int max: The maximum value for this profile field.
- :param int min: The minimum value for this profile field.
- :param int step: The increment step value for this profile field.
- :param str type: The type for this profile field.
+ :param str crn: The CRN for this enterprise.
+ :param str id: The unique identifier for this enterprise.
+ :param str resource_type: The resource type.
"""
# pylint: disable=super-init-not-called
- self.default = default
- self.max = max
- self.min = min
- self.step = step
- self.type = type
+ self.crn = crn
+ self.id = id
+ self.resource_type = resource_type
@classmethod
- def from_dict(cls, _dict: Dict) -> 'DedicatedHostProfileVCPURange':
- """Initialize a DedicatedHostProfileVCPURange object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'BackupPolicyScopeEnterpriseReference':
+ """Initialize a BackupPolicyScopeEnterpriseReference object from a json dictionary."""
args = {}
- if 'default' in _dict:
- args['default'] = _dict.get('default')
- else:
- raise ValueError('Required property \'default\' not present in DedicatedHostProfileVCPURange JSON')
- if 'max' in _dict:
- args['max'] = _dict.get('max')
+ if (crn := _dict.get('crn')) is not None:
+ args['crn'] = crn
else:
- raise ValueError('Required property \'max\' not present in DedicatedHostProfileVCPURange JSON')
- if 'min' in _dict:
- args['min'] = _dict.get('min')
- else:
- raise ValueError('Required property \'min\' not present in DedicatedHostProfileVCPURange JSON')
- if 'step' in _dict:
- args['step'] = _dict.get('step')
+ raise ValueError('Required property \'crn\' not present in BackupPolicyScopeEnterpriseReference JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
else:
- raise ValueError('Required property \'step\' not present in DedicatedHostProfileVCPURange JSON')
- if 'type' in _dict:
- args['type'] = _dict.get('type')
+ raise ValueError('Required property \'id\' not present in BackupPolicyScopeEnterpriseReference JSON')
+ if (resource_type := _dict.get('resource_type')) is not None:
+ args['resource_type'] = resource_type
else:
- raise ValueError('Required property \'type\' not present in DedicatedHostProfileVCPURange JSON')
+ raise ValueError('Required property \'resource_type\' not present in BackupPolicyScopeEnterpriseReference JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a DedicatedHostProfileVCPURange object from a json dictionary."""
+ """Initialize a BackupPolicyScopeEnterpriseReference object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'default') and self.default is not None:
- _dict['default'] = self.default
- if hasattr(self, 'max') and self.max is not None:
- _dict['max'] = self.max
- if hasattr(self, 'min') and self.min is not None:
- _dict['min'] = self.min
- if hasattr(self, 'step') and self.step is not None:
- _dict['step'] = self.step
- if hasattr(self, 'type') and self.type is not None:
- _dict['type'] = self.type
+ if hasattr(self, 'crn') and self.crn is not None:
+ _dict['crn'] = self.crn
+ if hasattr(self, 'id') and self.id is not None:
+ _dict['id'] = self.id
+ if hasattr(self, 'resource_type') and self.resource_type is not None:
+ _dict['resource_type'] = self.resource_type
return _dict
def _to_dict(self):
@@ -93096,123 +97475,116 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this DedicatedHostProfileVCPURange object."""
+ """Return a `str` version of this BackupPolicyScopeEnterpriseReference object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'DedicatedHostProfileVCPURange') -> bool:
+ def __eq__(self, other: 'BackupPolicyScopeEnterpriseReference') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'DedicatedHostProfileVCPURange') -> bool:
+ def __ne__(self, other: 'BackupPolicyScopeEnterpriseReference') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class TypeEnum(str, Enum):
+ class ResourceTypeEnum(str, Enum):
"""
- The type for this profile field.
+ The resource type.
"""
- RANGE = 'range'
+ ENTERPRISE = 'enterprise'
-class DedicatedHostPrototypeDedicatedHostByGroup(DedicatedHostPrototype):
+class BareMetalServerBootTargetBareMetalServerDiskReference(BareMetalServerBootTarget):
"""
- DedicatedHostPrototypeDedicatedHostByGroup.
+ BareMetalServerBootTargetBareMetalServerDiskReference.
- :attr bool instance_placement_enabled: (optional) If set to true, instances can
- be placed on this dedicated host.
- :attr str name: (optional) The name for this dedicated host. The name must not
- be used by another dedicated host in the region. If unspecified, the name will
- be a hyphenated list of randomly-selected words.
- :attr DedicatedHostProfileIdentity profile: The
- [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-dh-profiles) to use for this
- dedicated host.
- :attr ResourceGroupIdentity resource_group: (optional)
- :attr DedicatedHostGroupIdentity group: The dedicated host group for this
- dedicated host.
+ :param BareMetalServerDiskReferenceDeleted 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 disk.
+ :param str id: The unique identifier for this bare metal server disk.
+ :param str name: The name for this bare metal server disk. The name is unique
+ across all disks on the bare metal server.
+ :param str resource_type: The resource type.
"""
def __init__(
self,
- profile: 'DedicatedHostProfileIdentity',
- group: 'DedicatedHostGroupIdentity',
+ href: str,
+ id: str,
+ name: str,
+ resource_type: str,
*,
- instance_placement_enabled: bool = None,
- name: str = None,
- resource_group: 'ResourceGroupIdentity' = None,
+ deleted: Optional['BareMetalServerDiskReferenceDeleted'] = None,
) -> None:
"""
- Initialize a DedicatedHostPrototypeDedicatedHostByGroup object.
+ Initialize a BareMetalServerBootTargetBareMetalServerDiskReference object.
- :param DedicatedHostProfileIdentity profile: The
- [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-dh-profiles) to use for
- this dedicated host.
- :param DedicatedHostGroupIdentity group: The dedicated host group for this
- dedicated host.
- :param bool instance_placement_enabled: (optional) If set to true,
- instances can be placed on this dedicated host.
- :param str name: (optional) The name for this dedicated host. The name must
- not be used by another dedicated host in the region. If unspecified, the
- name will be a hyphenated list of randomly-selected words.
- :param ResourceGroupIdentity resource_group: (optional)
+ :param str href: The URL for this bare metal server disk.
+ :param str id: The unique identifier for this bare metal server disk.
+ :param str name: The name for this bare metal server disk. The name is
+ unique across all disks on the bare metal server.
+ :param str resource_type: The resource type.
+ :param BareMetalServerDiskReferenceDeleted deleted: (optional) If present,
+ this property indicates the referenced resource has been deleted, and
+ provides
+ some supplementary information.
"""
# pylint: disable=super-init-not-called
- self.instance_placement_enabled = instance_placement_enabled
+ self.deleted = deleted
+ self.href = href
+ self.id = id
self.name = name
- self.profile = profile
- self.resource_group = resource_group
- self.group = group
+ self.resource_type = resource_type
@classmethod
- def from_dict(cls, _dict: Dict) -> 'DedicatedHostPrototypeDedicatedHostByGroup':
- """Initialize a DedicatedHostPrototypeDedicatedHostByGroup object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'BareMetalServerBootTargetBareMetalServerDiskReference':
+ """Initialize a BareMetalServerBootTargetBareMetalServerDiskReference object from a json dictionary."""
args = {}
- if 'instance_placement_enabled' in _dict:
- args['instance_placement_enabled'] = _dict.get('instance_placement_enabled')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
- if 'profile' in _dict:
- args['profile'] = _dict.get('profile')
+ if (deleted := _dict.get('deleted')) is not None:
+ args['deleted'] = BareMetalServerDiskReferenceDeleted.from_dict(deleted)
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'profile\' not present in DedicatedHostPrototypeDedicatedHostByGroup JSON')
- if 'resource_group' in _dict:
- args['resource_group'] = _dict.get('resource_group')
- if 'group' in _dict:
- args['group'] = _dict.get('group')
+ raise ValueError('Required property \'href\' not present in BareMetalServerBootTargetBareMetalServerDiskReference JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
else:
- raise ValueError('Required property \'group\' not present in DedicatedHostPrototypeDedicatedHostByGroup JSON')
+ raise ValueError('Required property \'id\' not present in BareMetalServerBootTargetBareMetalServerDiskReference JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ else:
+ raise ValueError('Required property \'name\' not present in BareMetalServerBootTargetBareMetalServerDiskReference JSON')
+ if (resource_type := _dict.get('resource_type')) is not None:
+ args['resource_type'] = 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 DedicatedHostPrototypeDedicatedHostByGroup 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, 'instance_placement_enabled') and self.instance_placement_enabled is not None:
- _dict['instance_placement_enabled'] = self.instance_placement_enabled
+ if hasattr(self, 'deleted') and self.deleted is not None:
+ if isinstance(self.deleted, dict):
+ _dict['deleted'] = self.deleted
+ else:
+ _dict['deleted'] = self.deleted.to_dict()
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
+ if hasattr(self, 'id') and self.id is not None:
+ _dict['id'] = self.id
if hasattr(self, 'name') and self.name is not None:
_dict['name'] = self.name
- if hasattr(self, 'profile') and self.profile is not None:
- if isinstance(self.profile, dict):
- _dict['profile'] = self.profile
- else:
- _dict['profile'] = self.profile.to_dict()
- if hasattr(self, 'resource_group') and self.resource_group is not None:
- if isinstance(self.resource_group, dict):
- _dict['resource_group'] = self.resource_group
- else:
- _dict['resource_group'] = self.resource_group.to_dict()
- if hasattr(self, 'group') and self.group is not None:
- if isinstance(self.group, dict):
- _dict['group'] = self.group
- else:
- _dict['group'] = self.group.to_dict()
+ if hasattr(self, 'resource_type') and self.resource_type is not None:
+ _dict['resource_type'] = self.resource_type
return _dict
def _to_dict(self):
@@ -93220,125 +97592,105 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this DedicatedHostPrototypeDedicatedHostByGroup object."""
+ """Return a `str` version of this BareMetalServerBootTargetBareMetalServerDiskReference object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'DedicatedHostPrototypeDedicatedHostByGroup') -> 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: 'DedicatedHostPrototypeDedicatedHostByGroup') -> bool:
+ def __ne__(self, other: 'BareMetalServerBootTargetBareMetalServerDiskReference') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
+ class ResourceTypeEnum(str, Enum):
+ """
+ The resource type.
+ """
+
+ BARE_METAL_SERVER_DISK = 'bare_metal_server_disk'
+
-class DedicatedHostPrototypeDedicatedHostByZone(DedicatedHostPrototype):
+
+class BareMetalServerInitializationUserAccountBareMetalServerInitializationHostUserAccount(BareMetalServerInitializationUserAccount):
"""
- DedicatedHostPrototypeDedicatedHostByZone.
+ BareMetalServerInitializationUserAccountBareMetalServerInitializationHostUserAccount.
- :attr bool instance_placement_enabled: (optional) If set to true, instances can
- be placed on this dedicated host.
- :attr str name: (optional) The name for this dedicated host. The name must not
- be used by another dedicated host in the region. If unspecified, the name will
- be a hyphenated list of randomly-selected words.
- :attr DedicatedHostProfileIdentity profile: The
- [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-dh-profiles) to use for this
- dedicated host.
- :attr ResourceGroupIdentity resource_group: (optional)
- :attr DedicatedHostGroupPrototypeDedicatedHostByZoneContext group: (optional)
- :attr ZoneIdentity zone: The zone this dedicated host will reside in.
+ :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.
"""
def __init__(
self,
- profile: 'DedicatedHostProfileIdentity',
- zone: 'ZoneIdentity',
- *,
- instance_placement_enabled: bool = None,
- name: str = None,
- resource_group: 'ResourceGroupIdentity' = None,
- group: 'DedicatedHostGroupPrototypeDedicatedHostByZoneContext' = None,
+ encrypted_password: bytes,
+ encryption_key: 'KeyReference',
+ resource_type: str,
+ username: str,
) -> None:
"""
- Initialize a DedicatedHostPrototypeDedicatedHostByZone object.
+ Initialize a BareMetalServerInitializationUserAccountBareMetalServerInitializationHostUserAccount object.
- :param DedicatedHostProfileIdentity profile: The
- [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-dh-profiles) to use for
- this dedicated host.
- :param ZoneIdentity zone: The zone this dedicated host will reside in.
- :param bool instance_placement_enabled: (optional) If set to true,
- instances can be placed on this dedicated host.
- :param str name: (optional) The name for this dedicated host. The name must
- not be used by another dedicated host in the region. If unspecified, the
- name will be a hyphenated list of randomly-selected words.
- :param ResourceGroupIdentity resource_group: (optional)
- :param DedicatedHostGroupPrototypeDedicatedHostByZoneContext group:
- (optional)
+ :param 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.
"""
# pylint: disable=super-init-not-called
- self.instance_placement_enabled = instance_placement_enabled
- self.name = name
- self.profile = profile
- self.resource_group = resource_group
- self.group = group
- self.zone = zone
+ self.encrypted_password = encrypted_password
+ self.encryption_key = encryption_key
+ self.resource_type = resource_type
+ self.username = username
@classmethod
- def from_dict(cls, _dict: Dict) -> 'DedicatedHostPrototypeDedicatedHostByZone':
- """Initialize a DedicatedHostPrototypeDedicatedHostByZone object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'BareMetalServerInitializationUserAccountBareMetalServerInitializationHostUserAccount':
+ """Initialize a BareMetalServerInitializationUserAccountBareMetalServerInitializationHostUserAccount object from a json dictionary."""
args = {}
- if 'instance_placement_enabled' in _dict:
- args['instance_placement_enabled'] = _dict.get('instance_placement_enabled')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
- if 'profile' in _dict:
- args['profile'] = _dict.get('profile')
+ if (encrypted_password := _dict.get('encrypted_password')) is not None:
+ args['encrypted_password'] = base64.b64decode(encrypted_password)
else:
- raise ValueError('Required property \'profile\' not present in DedicatedHostPrototypeDedicatedHostByZone JSON')
- if 'resource_group' in _dict:
- args['resource_group'] = _dict.get('resource_group')
- if 'group' in _dict:
- args['group'] = DedicatedHostGroupPrototypeDedicatedHostByZoneContext.from_dict(_dict.get('group'))
- if 'zone' in _dict:
- args['zone'] = _dict.get('zone')
+ raise ValueError('Required property \'encrypted_password\' not present in BareMetalServerInitializationUserAccountBareMetalServerInitializationHostUserAccount JSON')
+ if (encryption_key := _dict.get('encryption_key')) is not None:
+ args['encryption_key'] = KeyReference.from_dict(encryption_key)
else:
- raise ValueError('Required property \'zone\' not present in DedicatedHostPrototypeDedicatedHostByZone JSON')
+ raise ValueError('Required property \'encryption_key\' not present in BareMetalServerInitializationUserAccountBareMetalServerInitializationHostUserAccount JSON')
+ if (resource_type := _dict.get('resource_type')) is not None:
+ args['resource_type'] = resource_type
+ else:
+ raise ValueError('Required property \'resource_type\' not present in BareMetalServerInitializationUserAccountBareMetalServerInitializationHostUserAccount JSON')
+ if (username := _dict.get('username')) is not None:
+ args['username'] = username
+ else:
+ raise ValueError('Required property \'username\' not present in BareMetalServerInitializationUserAccountBareMetalServerInitializationHostUserAccount JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a DedicatedHostPrototypeDedicatedHostByZone 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, 'instance_placement_enabled') and self.instance_placement_enabled is not None:
- _dict['instance_placement_enabled'] = self.instance_placement_enabled
- if hasattr(self, 'name') and self.name is not None:
- _dict['name'] = self.name
- if hasattr(self, 'profile') and self.profile is not None:
- if isinstance(self.profile, dict):
- _dict['profile'] = self.profile
- else:
- _dict['profile'] = self.profile.to_dict()
- if hasattr(self, 'resource_group') and self.resource_group is not None:
- if isinstance(self.resource_group, dict):
- _dict['resource_group'] = self.resource_group
- else:
- _dict['resource_group'] = self.resource_group.to_dict()
- if hasattr(self, 'group') and self.group is not None:
- if isinstance(self.group, dict):
- _dict['group'] = self.group
- else:
- _dict['group'] = self.group.to_dict()
- if hasattr(self, 'zone') and self.zone is not None:
- if isinstance(self.zone, dict):
- _dict['zone'] = self.zone
+ if hasattr(self, 'encrypted_password') and self.encrypted_password is not None:
+ _dict['encrypted_password'] = str(base64.b64encode(self.encrypted_password), 'utf-8')
+ if hasattr(self, 'encryption_key') and self.encryption_key is not None:
+ if isinstance(self.encryption_key, dict):
+ _dict['encryption_key'] = self.encryption_key
else:
- _dict['zone'] = self.zone.to_dict()
+ _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):
@@ -93346,192 +97698,522 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this DedicatedHostPrototypeDedicatedHostByZone object."""
+ """Return a `str` version of this BareMetalServerInitializationUserAccountBareMetalServerInitializationHostUserAccount object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'DedicatedHostPrototypeDedicatedHostByZone') -> 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: 'DedicatedHostPrototypeDedicatedHostByZone') -> bool:
+ def __ne__(self, other: 'BareMetalServerInitializationUserAccountBareMetalServerInitializationHostUserAccount') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
+ class ResourceTypeEnum(str, Enum):
+ """
+ The resource type.
+ """
-class EncryptionKeyIdentityByCRN(EncryptionKeyIdentity):
+ HOST_USER_ACCOUNT = 'host_user_account'
+
+
+
+class BareMetalServerNetworkAttachmentByPCI(BareMetalServerNetworkAttachment):
"""
- EncryptionKeyIdentityByCRN.
+ BareMetalServerNetworkAttachmentByPCI.
- :attr str crn: The CRN of the [Key Protect Root
- Key](https://cloud.ibm.com/docs/key-protect?topic=key-protect-getting-started-tutorial)
- or [Hyper Protect Crypto Services Root
- Key](https://cloud.ibm.com/docs/hs-crypto?topic=hs-crypto-get-started) for this
- resource.
+ :param datetime created_at: The date and time that the bare metal server network
+ attachment was created.
+ :param str href: The URL for this bare metal server network attachment.
+ :param str id: The unique identifier for this bare metal server network
+ attachment.
+ :param str lifecycle_state: The lifecycle state of the bare metal server network
+ attachment.
+ :param str name: The name for this bare metal server network attachment. The
+ name is unique across all network attachments for the bare metal server.
+ :param int port_speed: The port speed for this bare metal server network
+ attachment in Mbps.
+ :param ReservedIPReference primary_ip: The primary IP address of the virtual
+ network interface for the bare metal server network attachment.
+ :param str resource_type: The resource type.
+ :param SubnetReference subnet: The subnet of the virtual network interface for
+ the bare metal server network attachment.
+ :param str type: The bare metal server network attachment type.
+ :param VirtualNetworkInterfaceReferenceAttachmentContext
+ virtual_network_interface: The virtual network interface for this bare metal
+ server network attachment.
+ :param List[int] allowed_vlans: The VLAN IDs allowed for `vlan` attachments
+ using this PCI attachment.
+ :param str interface_type: - `pci`: a physical PCI device which can only be
+ created or deleted when the bare metal
+ server is stopped
+ - Has an `allowed_vlans` property which controls the VLANs that will be
+ permitted
+ to use the PCI attachment
+ - Cannot directly use an IEEE 802.1Q tag.
"""
def __init__(
self,
- crn: str,
+ created_at: datetime,
+ href: str,
+ id: str,
+ lifecycle_state: str,
+ name: str,
+ port_speed: int,
+ primary_ip: 'ReservedIPReference',
+ resource_type: str,
+ subnet: 'SubnetReference',
+ type: str,
+ virtual_network_interface: 'VirtualNetworkInterfaceReferenceAttachmentContext',
+ allowed_vlans: List[int],
+ interface_type: str,
) -> None:
"""
- Initialize a EncryptionKeyIdentityByCRN object.
+ Initialize a BareMetalServerNetworkAttachmentByPCI object.
- :param str crn: The CRN of the [Key Protect Root
- Key](https://cloud.ibm.com/docs/key-protect?topic=key-protect-getting-started-tutorial)
- or [Hyper Protect Crypto Services Root
- Key](https://cloud.ibm.com/docs/hs-crypto?topic=hs-crypto-get-started) for
- this resource.
+ :param datetime created_at: The date and time that the bare metal server
+ network attachment was created.
+ :param str href: The URL for this bare metal server network attachment.
+ :param str id: The unique identifier for this bare metal server network
+ attachment.
+ :param str lifecycle_state: The lifecycle state of the bare metal server
+ network attachment.
+ :param str name: The name for this bare metal server network attachment.
+ The name is unique across all network attachments for the bare metal
+ server.
+ :param int port_speed: The port speed for this bare metal server network
+ attachment in Mbps.
+ :param ReservedIPReference primary_ip: The primary IP address of the
+ virtual network interface for the bare metal server network attachment.
+ :param str resource_type: The resource type.
+ :param SubnetReference subnet: The subnet of the virtual network interface
+ for the bare metal server network attachment.
+ :param str type: The bare metal server network attachment type.
+ :param VirtualNetworkInterfaceReferenceAttachmentContext
+ virtual_network_interface: The virtual network interface for this bare
+ metal server network attachment.
+ :param List[int] allowed_vlans: The VLAN IDs allowed for `vlan` attachments
+ using this PCI attachment.
+ :param str interface_type: - `pci`: a physical PCI device which can only be
+ created or deleted when the bare metal
+ server is stopped
+ - Has an `allowed_vlans` property which controls the VLANs that will be
+ permitted
+ to use the PCI attachment
+ - Cannot directly use an IEEE 802.1Q tag.
"""
# pylint: disable=super-init-not-called
- self.crn = crn
+ self.created_at = created_at
+ self.href = href
+ self.id = id
+ self.lifecycle_state = lifecycle_state
+ self.name = name
+ self.port_speed = port_speed
+ self.primary_ip = primary_ip
+ self.resource_type = resource_type
+ self.subnet = subnet
+ self.type = type
+ self.virtual_network_interface = virtual_network_interface
+ self.allowed_vlans = allowed_vlans
+ self.interface_type = interface_type
@classmethod
- def from_dict(cls, _dict: Dict) -> 'EncryptionKeyIdentityByCRN':
- """Initialize a EncryptionKeyIdentityByCRN object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'BareMetalServerNetworkAttachmentByPCI':
+ """Initialize a BareMetalServerNetworkAttachmentByPCI object from a json dictionary."""
args = {}
- if 'crn' in _dict:
- args['crn'] = _dict.get('crn')
+ if (created_at := _dict.get('created_at')) is not None:
+ args['created_at'] = string_to_datetime(created_at)
else:
- raise ValueError('Required property \'crn\' not present in EncryptionKeyIdentityByCRN JSON')
+ raise ValueError('Required property \'created_at\' not present in BareMetalServerNetworkAttachmentByPCI JSON')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
+ else:
+ raise ValueError('Required property \'href\' not present in BareMetalServerNetworkAttachmentByPCI JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
+ else:
+ raise ValueError('Required property \'id\' not present in BareMetalServerNetworkAttachmentByPCI JSON')
+ if (lifecycle_state := _dict.get('lifecycle_state')) is not None:
+ args['lifecycle_state'] = lifecycle_state
+ else:
+ raise ValueError('Required property \'lifecycle_state\' not present in BareMetalServerNetworkAttachmentByPCI JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ else:
+ raise ValueError('Required property \'name\' not present in BareMetalServerNetworkAttachmentByPCI JSON')
+ if (port_speed := _dict.get('port_speed')) is not None:
+ args['port_speed'] = port_speed
+ else:
+ raise ValueError('Required property \'port_speed\' not present in BareMetalServerNetworkAttachmentByPCI JSON')
+ if (primary_ip := _dict.get('primary_ip')) is not None:
+ args['primary_ip'] = ReservedIPReference.from_dict(primary_ip)
+ else:
+ raise ValueError('Required property \'primary_ip\' not present in BareMetalServerNetworkAttachmentByPCI JSON')
+ if (resource_type := _dict.get('resource_type')) is not None:
+ args['resource_type'] = resource_type
+ else:
+ raise ValueError('Required property \'resource_type\' not present in BareMetalServerNetworkAttachmentByPCI JSON')
+ if (subnet := _dict.get('subnet')) is not None:
+ args['subnet'] = SubnetReference.from_dict(subnet)
+ else:
+ raise ValueError('Required property \'subnet\' not present in BareMetalServerNetworkAttachmentByPCI JSON')
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
+ else:
+ raise ValueError('Required property \'type\' not present in BareMetalServerNetworkAttachmentByPCI JSON')
+ if (virtual_network_interface := _dict.get('virtual_network_interface')) is not None:
+ args['virtual_network_interface'] = VirtualNetworkInterfaceReferenceAttachmentContext.from_dict(virtual_network_interface)
+ else:
+ raise ValueError('Required property \'virtual_network_interface\' not present in BareMetalServerNetworkAttachmentByPCI JSON')
+ if (allowed_vlans := _dict.get('allowed_vlans')) is not None:
+ args['allowed_vlans'] = allowed_vlans
+ else:
+ raise ValueError('Required property \'allowed_vlans\' not present in BareMetalServerNetworkAttachmentByPCI JSON')
+ if (interface_type := _dict.get('interface_type')) is not None:
+ args['interface_type'] = interface_type
+ else:
+ raise ValueError('Required property \'interface_type\' not present in BareMetalServerNetworkAttachmentByPCI JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a EncryptionKeyIdentityByCRN object from a json dictionary."""
+ """Initialize a BareMetalServerNetworkAttachmentByPCI object from 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 EncryptionKeyIdentityByCRN object."""
- return json.dumps(self.to_dict(), indent=2)
-
- def __eq__(self, other: 'EncryptionKeyIdentityByCRN') -> bool:
- """Return `true` when self and other are equal, false otherwise."""
- if not isinstance(other, self.__class__):
- return False
- return self.__dict__ == other.__dict__
-
- def __ne__(self, other: 'EncryptionKeyIdentityByCRN') -> bool:
- """Return `true` when self and other are not equal, false otherwise."""
+ if hasattr(self, 'created_at') and self.created_at is not None:
+ _dict['created_at'] = datetime_to_string(self.created_at)
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
+ if hasattr(self, 'id') and self.id is not None:
+ _dict['id'] = self.id
+ if hasattr(self, 'lifecycle_state') and self.lifecycle_state is not None:
+ _dict['lifecycle_state'] = self.lifecycle_state
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ if hasattr(self, 'port_speed') and self.port_speed is not None:
+ _dict['port_speed'] = self.port_speed
+ if hasattr(self, 'primary_ip') and self.primary_ip is not None:
+ if isinstance(self.primary_ip, dict):
+ _dict['primary_ip'] = self.primary_ip
+ else:
+ _dict['primary_ip'] = self.primary_ip.to_dict()
+ if hasattr(self, 'resource_type') and self.resource_type is not None:
+ _dict['resource_type'] = self.resource_type
+ if hasattr(self, 'subnet') and self.subnet is not None:
+ if isinstance(self.subnet, dict):
+ _dict['subnet'] = self.subnet
+ else:
+ _dict['subnet'] = self.subnet.to_dict()
+ if hasattr(self, 'type') and self.type is not None:
+ _dict['type'] = self.type
+ if hasattr(self, 'virtual_network_interface') and self.virtual_network_interface is not None:
+ if isinstance(self.virtual_network_interface, dict):
+ _dict['virtual_network_interface'] = self.virtual_network_interface
+ else:
+ _dict['virtual_network_interface'] = self.virtual_network_interface.to_dict()
+ if hasattr(self, 'allowed_vlans') and self.allowed_vlans is not None:
+ _dict['allowed_vlans'] = self.allowed_vlans
+ if hasattr(self, 'interface_type') and self.interface_type is not None:
+ _dict['interface_type'] = self.interface_type
+ return _dict
+
+ def _to_dict(self):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
+
+ def __str__(self) -> str:
+ """Return a `str` version of this BareMetalServerNetworkAttachmentByPCI object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'BareMetalServerNetworkAttachmentByPCI') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'BareMetalServerNetworkAttachmentByPCI') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
return not self == other
+ class LifecycleStateEnum(str, Enum):
+ """
+ The lifecycle state of the bare metal server network attachment.
+ """
-class EndpointGatewayReservedIPReservedIPIdentity(EndpointGatewayReservedIP):
- """
- Identifies a reserved IP by a unique property.
+ DELETING = 'deleting'
+ FAILED = 'failed'
+ PENDING = 'pending'
+ STABLE = 'stable'
+ SUSPENDED = 'suspended'
+ UPDATING = 'updating'
+ WAITING = 'waiting'
- """
- def __init__(
- self,
- ) -> None:
+ class ResourceTypeEnum(str, Enum):
"""
- Initialize a EndpointGatewayReservedIPReservedIPIdentity object.
+ The resource type.
+ """
+
+ BARE_METAL_SERVER_NETWORK_ATTACHMENT = 'bare_metal_server_network_attachment'
+
+ class TypeEnum(str, Enum):
+ """
+ The bare metal server network attachment type.
"""
- # pylint: disable=super-init-not-called
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['EndpointGatewayReservedIPReservedIPIdentityById', 'EndpointGatewayReservedIPReservedIPIdentityByHref'])
- )
- raise Exception(msg)
+ PRIMARY = 'primary'
+ SECONDARY = 'secondary'
-class EndpointGatewayReservedIPReservedIPPrototypeTargetContext(EndpointGatewayReservedIP):
+
+ class InterfaceTypeEnum(str, Enum):
+ """
+ - `pci`: a physical PCI device which can only be created or deleted when the bare
+ metal
+ server is stopped
+ - Has an `allowed_vlans` property which controls the VLANs that will be
+ permitted
+ to use the PCI attachment
+ - Cannot directly use an IEEE 802.1Q tag.
+ """
+
+ PCI = 'pci'
+
+
+
+class BareMetalServerNetworkAttachmentByVLAN(BareMetalServerNetworkAttachment):
"""
- EndpointGatewayReservedIPReservedIPPrototypeTargetContext.
+ BareMetalServerNetworkAttachmentByVLAN.
- :attr str address: (optional) The IP address to reserve, which must not already
- be reserved on the subnet.
- If unspecified, an available address on the subnet will automatically be
- selected.
- :attr bool auto_delete: (optional) Indicates whether this reserved IP member
- will be automatically deleted when either
- `target` is deleted, or the reserved IP is unbound.
- :attr str name: (optional) The name for this reserved IP. The name must not be
- used by another reserved IP in the subnet. Names starting with `ibm-` are
- reserved for provider-owned resources, and are not allowed. If unspecified, the
- name will be a hyphenated list of randomly-selected words.
- :attr SubnetIdentity subnet: The subnet in which to create this reserved IP.
+ :param datetime created_at: The date and time that the bare metal server network
+ attachment was created.
+ :param str href: The URL for this bare metal server network attachment.
+ :param str id: The unique identifier for this bare metal server network
+ attachment.
+ :param str lifecycle_state: The lifecycle state of the bare metal server network
+ attachment.
+ :param str name: The name for this bare metal server network attachment. The
+ name is unique across all network attachments for the bare metal server.
+ :param int port_speed: The port speed for this bare metal server network
+ attachment in Mbps.
+ :param ReservedIPReference primary_ip: The primary IP address of the virtual
+ network interface for the bare metal server network attachment.
+ :param str resource_type: The resource type.
+ :param SubnetReference subnet: The subnet of the virtual network interface for
+ the bare metal server network attachment.
+ :param str type: The bare metal server network attachment type.
+ :param VirtualNetworkInterfaceReferenceAttachmentContext
+ virtual_network_interface: The virtual network interface for this bare metal
+ server network attachment.
+ :param bool allow_to_float: Indicates if the data path for the network
+ attachment can float to another bare metal server. Can only be `true` for
+ network attachments with an `interface_type` of `vlan`.
+ If `true`, and the network detects traffic for this data path on another bare
+ metal server in the resource group, the network attachment will be automatically
+ deleted from this bare metal server and a new network attachment with the same
+ `id`, `name` and `vlan` will be created on the other bare metal server. The
+ virtual network interface for this network attachment will be automatically be
+ attached to the new network attachment.
+ For the data path to float, the other bare metal server must be in the same
+ `resource_group`, and must have a network attachment with `interface_type` of
+ `pci` with `allowed_vlans` including this network attachment's `vlan`.
+ :param str interface_type: - `vlan`: a virtual device, used through a `pci`
+ device that has the `vlan` in its array
+ of `allowed_vlans`.
+ - Must use an IEEE 802.1Q tag.
+ :param int vlan: The IEEE 802.1Q VLAN ID that must be used for all traffic on
+ this attachment.
"""
def __init__(
self,
- subnet: 'SubnetIdentity',
- *,
- address: str = None,
- auto_delete: bool = None,
- name: str = None,
+ created_at: datetime,
+ href: str,
+ id: str,
+ lifecycle_state: str,
+ name: str,
+ port_speed: int,
+ primary_ip: 'ReservedIPReference',
+ resource_type: str,
+ subnet: 'SubnetReference',
+ type: str,
+ virtual_network_interface: 'VirtualNetworkInterfaceReferenceAttachmentContext',
+ allow_to_float: bool,
+ interface_type: str,
+ vlan: int,
) -> None:
"""
- Initialize a EndpointGatewayReservedIPReservedIPPrototypeTargetContext object.
+ Initialize a BareMetalServerNetworkAttachmentByVLAN object.
- :param SubnetIdentity subnet: The subnet in which to create this reserved
- IP.
- :param str address: (optional) The IP address to reserve, which must not
- already be reserved on the subnet.
- If unspecified, an available address on the subnet will automatically be
- selected.
- :param bool auto_delete: (optional) Indicates whether this reserved IP
- member will be automatically deleted when either
- `target` is deleted, or the reserved IP is unbound.
- :param str name: (optional) The name for this reserved IP. The name must
- not be used by another reserved IP in the subnet. Names starting with
- `ibm-` are reserved for provider-owned resources, and are not allowed. If
- unspecified, the name will be a hyphenated list of randomly-selected words.
+ :param datetime created_at: The date and time that the bare metal server
+ network attachment was created.
+ :param str href: The URL for this bare metal server network attachment.
+ :param str id: The unique identifier for this bare metal server network
+ attachment.
+ :param str lifecycle_state: The lifecycle state of the bare metal server
+ network attachment.
+ :param str name: The name for this bare metal server network attachment.
+ The name is unique across all network attachments for the bare metal
+ server.
+ :param int port_speed: The port speed for this bare metal server network
+ attachment in Mbps.
+ :param ReservedIPReference primary_ip: The primary IP address of the
+ virtual network interface for the bare metal server network attachment.
+ :param str resource_type: The resource type.
+ :param SubnetReference subnet: The subnet of the virtual network interface
+ for the bare metal server network attachment.
+ :param str type: The bare metal server network attachment type.
+ :param VirtualNetworkInterfaceReferenceAttachmentContext
+ virtual_network_interface: The virtual network interface for this bare
+ metal server network attachment.
+ :param bool allow_to_float: Indicates if the data path for the network
+ attachment can float to another bare metal server. Can only be `true` for
+ network attachments with an `interface_type` of `vlan`.
+ If `true`, and the network detects traffic for this data path on another
+ bare metal server in the resource group, the network attachment will be
+ automatically deleted from this bare metal server and a new network
+ attachment with the same `id`, `name` and `vlan` will be created on the
+ other bare metal server. The virtual network interface for this network
+ attachment will be automatically be attached to the new network attachment.
+ For the data path to float, the other bare metal server must be in the same
+ `resource_group`, and must have a network attachment with `interface_type`
+ of `pci` with `allowed_vlans` including this network attachment's `vlan`.
+ :param str interface_type: - `vlan`: a virtual device, used through a `pci`
+ device that has the `vlan` in its array
+ of `allowed_vlans`.
+ - Must use an IEEE 802.1Q tag.
+ :param int vlan: The IEEE 802.1Q VLAN ID that must be used for all traffic
+ on this attachment.
"""
# pylint: disable=super-init-not-called
- self.address = address
- self.auto_delete = auto_delete
+ self.created_at = created_at
+ self.href = href
+ self.id = id
+ self.lifecycle_state = lifecycle_state
self.name = name
+ self.port_speed = port_speed
+ self.primary_ip = primary_ip
+ self.resource_type = resource_type
self.subnet = subnet
+ self.type = type
+ self.virtual_network_interface = virtual_network_interface
+ self.allow_to_float = allow_to_float
+ self.interface_type = interface_type
+ self.vlan = vlan
@classmethod
- def from_dict(cls, _dict: Dict) -> 'EndpointGatewayReservedIPReservedIPPrototypeTargetContext':
- """Initialize a EndpointGatewayReservedIPReservedIPPrototypeTargetContext object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'BareMetalServerNetworkAttachmentByVLAN':
+ """Initialize a BareMetalServerNetworkAttachmentByVLAN object from a json dictionary."""
args = {}
- if 'address' in _dict:
- args['address'] = _dict.get('address')
- if 'auto_delete' in _dict:
- args['auto_delete'] = _dict.get('auto_delete')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
- if 'subnet' in _dict:
- args['subnet'] = _dict.get('subnet')
+ if (created_at := _dict.get('created_at')) is not None:
+ args['created_at'] = string_to_datetime(created_at)
else:
- raise ValueError('Required property \'subnet\' not present in EndpointGatewayReservedIPReservedIPPrototypeTargetContext JSON')
+ raise ValueError('Required property \'created_at\' not present in BareMetalServerNetworkAttachmentByVLAN JSON')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
+ else:
+ raise ValueError('Required property \'href\' not present in BareMetalServerNetworkAttachmentByVLAN JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
+ else:
+ raise ValueError('Required property \'id\' not present in BareMetalServerNetworkAttachmentByVLAN JSON')
+ if (lifecycle_state := _dict.get('lifecycle_state')) is not None:
+ args['lifecycle_state'] = lifecycle_state
+ else:
+ raise ValueError('Required property \'lifecycle_state\' not present in BareMetalServerNetworkAttachmentByVLAN JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ else:
+ raise ValueError('Required property \'name\' not present in BareMetalServerNetworkAttachmentByVLAN JSON')
+ if (port_speed := _dict.get('port_speed')) is not None:
+ args['port_speed'] = port_speed
+ else:
+ raise ValueError('Required property \'port_speed\' not present in BareMetalServerNetworkAttachmentByVLAN JSON')
+ if (primary_ip := _dict.get('primary_ip')) is not None:
+ args['primary_ip'] = ReservedIPReference.from_dict(primary_ip)
+ else:
+ raise ValueError('Required property \'primary_ip\' not present in BareMetalServerNetworkAttachmentByVLAN JSON')
+ if (resource_type := _dict.get('resource_type')) is not None:
+ args['resource_type'] = resource_type
+ else:
+ raise ValueError('Required property \'resource_type\' not present in BareMetalServerNetworkAttachmentByVLAN JSON')
+ if (subnet := _dict.get('subnet')) is not None:
+ args['subnet'] = SubnetReference.from_dict(subnet)
+ else:
+ raise ValueError('Required property \'subnet\' not present in BareMetalServerNetworkAttachmentByVLAN JSON')
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
+ else:
+ raise ValueError('Required property \'type\' not present in BareMetalServerNetworkAttachmentByVLAN JSON')
+ if (virtual_network_interface := _dict.get('virtual_network_interface')) is not None:
+ args['virtual_network_interface'] = VirtualNetworkInterfaceReferenceAttachmentContext.from_dict(virtual_network_interface)
+ else:
+ raise ValueError('Required property \'virtual_network_interface\' not present in BareMetalServerNetworkAttachmentByVLAN JSON')
+ if (allow_to_float := _dict.get('allow_to_float')) is not None:
+ args['allow_to_float'] = allow_to_float
+ else:
+ raise ValueError('Required property \'allow_to_float\' not present in BareMetalServerNetworkAttachmentByVLAN JSON')
+ if (interface_type := _dict.get('interface_type')) is not None:
+ args['interface_type'] = interface_type
+ else:
+ raise ValueError('Required property \'interface_type\' not present in BareMetalServerNetworkAttachmentByVLAN JSON')
+ if (vlan := _dict.get('vlan')) is not None:
+ args['vlan'] = vlan
+ else:
+ raise ValueError('Required property \'vlan\' not present in BareMetalServerNetworkAttachmentByVLAN JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a EndpointGatewayReservedIPReservedIPPrototypeTargetContext object from a json dictionary."""
+ """Initialize a BareMetalServerNetworkAttachmentByVLAN object from 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, 'lifecycle_state') and self.lifecycle_state is not None:
+ _dict['lifecycle_state'] = self.lifecycle_state
if hasattr(self, 'name') and self.name is not None:
_dict['name'] = self.name
+ if hasattr(self, 'port_speed') and self.port_speed is not None:
+ _dict['port_speed'] = self.port_speed
+ if hasattr(self, 'primary_ip') and self.primary_ip is not None:
+ if isinstance(self.primary_ip, dict):
+ _dict['primary_ip'] = self.primary_ip
+ else:
+ _dict['primary_ip'] = self.primary_ip.to_dict()
+ if hasattr(self, 'resource_type') and self.resource_type is not None:
+ _dict['resource_type'] = self.resource_type
if hasattr(self, 'subnet') and self.subnet is not None:
if isinstance(self.subnet, dict):
_dict['subnet'] = self.subnet
else:
_dict['subnet'] = self.subnet.to_dict()
+ if hasattr(self, 'type') and self.type is not None:
+ _dict['type'] = self.type
+ if hasattr(self, 'virtual_network_interface') and self.virtual_network_interface is not None:
+ if isinstance(self.virtual_network_interface, dict):
+ _dict['virtual_network_interface'] = self.virtual_network_interface
+ else:
+ _dict['virtual_network_interface'] = self.virtual_network_interface.to_dict()
+ if hasattr(self, 'allow_to_float') and self.allow_to_float is not None:
+ _dict['allow_to_float'] = self.allow_to_float
+ if hasattr(self, 'interface_type') and self.interface_type is not None:
+ _dict['interface_type'] = self.interface_type
+ if hasattr(self, 'vlan') and self.vlan is not None:
+ _dict['vlan'] = self.vlan
return _dict
def _to_dict(self):
@@ -93539,135 +98221,292 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this EndpointGatewayReservedIPReservedIPPrototypeTargetContext object."""
+ """Return a `str` version of this BareMetalServerNetworkAttachmentByVLAN object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'EndpointGatewayReservedIPReservedIPPrototypeTargetContext') -> bool:
+ def __eq__(self, other: 'BareMetalServerNetworkAttachmentByVLAN') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'EndpointGatewayReservedIPReservedIPPrototypeTargetContext') -> bool:
+ def __ne__(self, other: 'BareMetalServerNetworkAttachmentByVLAN') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
+ class LifecycleStateEnum(str, Enum):
+ """
+ The lifecycle state of the bare metal server network attachment.
+ """
-class EndpointGatewayTargetPrototypeProviderCloudServiceIdentity(EndpointGatewayTargetPrototype):
- """
- EndpointGatewayTargetPrototypeProviderCloudServiceIdentity.
+ DELETING = 'deleting'
+ FAILED = 'failed'
+ PENDING = 'pending'
+ STABLE = 'stable'
+ SUSPENDED = 'suspended'
+ UPDATING = 'updating'
+ WAITING = 'waiting'
- :attr str resource_type: The type of target for this endpoint gateway.
- """
- def __init__(
- self,
- resource_type: str,
- ) -> None:
+ class ResourceTypeEnum(str, Enum):
+ """
+ The resource type.
"""
- Initialize a EndpointGatewayTargetPrototypeProviderCloudServiceIdentity object.
- :param str resource_type: The type of target for this endpoint gateway.
+ BARE_METAL_SERVER_NETWORK_ATTACHMENT = 'bare_metal_server_network_attachment'
+
+
+ class TypeEnum(str, Enum):
+ """
+ The bare metal server network attachment type.
"""
- # pylint: disable=super-init-not-called
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['EndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRN'])
- )
- raise Exception(msg)
- class ResourceTypeEnum(str, Enum):
+ PRIMARY = 'primary'
+ SECONDARY = 'secondary'
+
+
+ class InterfaceTypeEnum(str, Enum):
"""
- The type of target for this endpoint gateway.
+ - `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.
"""
- PROVIDER_CLOUD_SERVICE = 'provider_cloud_service'
- PROVIDER_INFRASTRUCTURE_SERVICE = 'provider_infrastructure_service'
+ VLAN = 'vlan'
-class EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentity(EndpointGatewayTargetPrototype):
+class BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentity(BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterface):
"""
- EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentity.
+ Identifies a virtual network interface by a unique property.
- :attr str resource_type: The type of target for this endpoint gateway.
"""
def __init__(
self,
- resource_type: str,
) -> None:
"""
- Initialize a EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentity object.
+ Initialize a BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentity object.
- :param str resource_type: The type of target for this endpoint gateway.
"""
# pylint: disable=super-init-not-called
msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityProviderInfrastructureServiceIdentityByName'])
+ ", ".join(['BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById', 'BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref', 'BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN'])
)
raise Exception(msg)
- class ResourceTypeEnum(str, Enum):
- """
- The type of target for this endpoint gateway.
- """
-
- PROVIDER_CLOUD_SERVICE = 'provider_cloud_service'
- PROVIDER_INFRASTRUCTURE_SERVICE = 'provider_infrastructure_service'
-
-
-class EndpointGatewayTargetProviderCloudServiceReference(EndpointGatewayTarget):
+class BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeBareMetalServerNetworkAttachmentContext(BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterface):
"""
- EndpointGatewayTargetProviderCloudServiceReference.
+ The virtual network interface for this target.
- :attr str crn: The CRN for this provider cloud service, or the CRN for the
- user's instance of a provider cloud service.
- :attr str resource_type: The type of target.
+ :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 auto_delete: (optional) Indicates whether this virtual network
+ interface will be automatically deleted when
+ `target` is deleted.
+ :param bool enable_infrastructure_nat: (optional) If `true`:
+ - The VPC infrastructure performs any needed NAT operations.
+ - `floating_ips` must not have more than one floating IP.
+ If `false`:
+ - Packets are passed unchanged to/from the virtual network interface,
+ allowing the workload to perform any needed NAT operations.
+ - `allow_ip_spoofing` must be `false`.
+ - Can only be attached to a `target` with a `resource_type` of
+ `bare_metal_server_network_attachment`.
+ :param List[VirtualNetworkInterfaceIPPrototype] ips: (optional) Additional IP
+ addresses to bind to the virtual network interface. Each item may be either a
+ reserved IP identity, or a reserved IP prototype object which will be used to
+ create a new reserved IP. All IP addresses must be in the primary IP's subnet.
+ If reserved IP identities are provided, the specified reserved IPs must be
+ unbound.
+ If reserved IP prototype objects with addresses are provided, the addresses must
+ be available on the virtual network interface's subnet. For any prototype
+ objects that do not specify an address, an available address on the subnet will
+ be automatically selected and reserved.
+ :param str name: (optional) The name for this virtual network interface. The
+ name must not be used by another virtual network interface in the VPC. If
+ unspecified, the name will be a hyphenated list of randomly-selected words.
+ Names beginning with `ibm-` are reserved for provider-owned resources, and are
+ not allowed.
+ :param VirtualNetworkInterfacePrimaryIPPrototype primary_ip: (optional) The
+ primary IP address to bind to the virtual network interface. May be either a
+ reserved IP identity, or a reserved IP prototype object which will be used to
+ create a
+ new reserved IP.
+ If a reserved IP identity is provided, the specified reserved IP must be
+ unbound.
+ If a reserved IP prototype object with an address is provided, the address must
+ be
+ available on the virtual network interface's subnet. If no address is specified,
+ an available address on the subnet will be automatically selected and reserved.
+ :param ResourceGroupIdentity resource_group: (optional) The resource group to
+ use for this virtual network interface. If unspecified, the
+ bare metal server's resource group will be used.
+ :param List[SecurityGroupIdentity] security_groups: (optional) The security
+ groups to use for this virtual network interface. If unspecified, the default
+ security group of the VPC for the subnet is used.
+ :param SubnetIdentity subnet: (optional) The associated subnet. Required if
+ `primary_ip` does not specify a reserved IP
+ identity.
"""
def __init__(
self,
- crn: str,
- resource_type: str,
+ *,
+ allow_ip_spoofing: Optional[bool] = None,
+ auto_delete: Optional[bool] = None,
+ enable_infrastructure_nat: Optional[bool] = None,
+ ips: Optional[List['VirtualNetworkInterfaceIPPrototype']] = None,
+ name: Optional[str] = None,
+ primary_ip: Optional['VirtualNetworkInterfacePrimaryIPPrototype'] = None,
+ resource_group: Optional['ResourceGroupIdentity'] = None,
+ security_groups: Optional[List['SecurityGroupIdentity']] = None,
+ subnet: Optional['SubnetIdentity'] = None,
) -> None:
"""
- Initialize a EndpointGatewayTargetProviderCloudServiceReference object.
+ Initialize a BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeBareMetalServerNetworkAttachmentContext object.
- :param str crn: The CRN for this provider cloud service, or the CRN for the
- user's instance of a provider cloud service.
- :param str resource_type: The type of target.
+ :param 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 auto_delete: (optional) Indicates whether this virtual network
+ interface will be automatically deleted when
+ `target` is deleted.
+ :param bool enable_infrastructure_nat: (optional) If `true`:
+ - The VPC infrastructure performs any needed NAT operations.
+ - `floating_ips` must not have more than one floating IP.
+ If `false`:
+ - Packets are passed unchanged to/from the virtual network interface,
+ allowing the workload to perform any needed NAT operations.
+ - `allow_ip_spoofing` must be `false`.
+ - Can only be attached to a `target` with a `resource_type` of
+ `bare_metal_server_network_attachment`.
+ :param List[VirtualNetworkInterfaceIPPrototype] ips: (optional) Additional
+ IP addresses to bind to the virtual network interface. Each item may be
+ either a reserved IP identity, or a reserved IP prototype object which will
+ be used to create a new reserved IP. All IP addresses must be in the
+ primary IP's subnet.
+ If reserved IP identities are provided, the specified reserved IPs must be
+ unbound.
+ If reserved IP prototype objects with addresses are provided, the addresses
+ must be available on the virtual network interface's subnet. For any
+ prototype objects that do not specify an address, an available address on
+ the subnet will be automatically selected and reserved.
+ :param str name: (optional) The name for this virtual network interface.
+ The name must not be used by another virtual network interface in the VPC.
+ If unspecified, the name will be a hyphenated list of randomly-selected
+ words. Names beginning with `ibm-` are reserved for provider-owned
+ resources, and are not allowed.
+ :param VirtualNetworkInterfacePrimaryIPPrototype primary_ip: (optional) The
+ primary IP address to bind to the virtual network interface. May be either
+ a
+ reserved IP identity, or a reserved IP prototype object which will be used
+ to create a
+ new reserved IP.
+ If a reserved IP identity is provided, the specified reserved IP must be
+ unbound.
+ If a reserved IP prototype object with an address is provided, the address
+ must be
+ available on the virtual network interface's subnet. If no address is
+ specified,
+ an available address on the subnet will be automatically selected and
+ reserved.
+ :param ResourceGroupIdentity resource_group: (optional) The resource group
+ to use for this virtual network interface. If unspecified, the
+ bare metal server's resource group will be used.
+ :param List[SecurityGroupIdentity] security_groups: (optional) The security
+ groups to use for this virtual network interface. If unspecified, the
+ default security group of the VPC for the subnet is used.
+ :param SubnetIdentity subnet: (optional) The associated subnet. Required if
+ `primary_ip` does not specify a reserved IP
+ identity.
"""
# pylint: disable=super-init-not-called
- self.crn = crn
- self.resource_type = resource_type
+ self.allow_ip_spoofing = allow_ip_spoofing
+ self.auto_delete = auto_delete
+ self.enable_infrastructure_nat = enable_infrastructure_nat
+ self.ips = ips
+ self.name = name
+ self.primary_ip = primary_ip
+ self.resource_group = resource_group
+ self.security_groups = security_groups
+ self.subnet = subnet
@classmethod
- def from_dict(cls, _dict: Dict) -> 'EndpointGatewayTargetProviderCloudServiceReference':
- """Initialize a EndpointGatewayTargetProviderCloudServiceReference object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeBareMetalServerNetworkAttachmentContext':
+ """Initialize a BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeBareMetalServerNetworkAttachmentContext object from a json dictionary."""
args = {}
- if 'crn' in _dict:
- args['crn'] = _dict.get('crn')
- else:
- raise ValueError('Required property \'crn\' not present in EndpointGatewayTargetProviderCloudServiceReference JSON')
- if 'resource_type' in _dict:
- args['resource_type'] = _dict.get('resource_type')
- else:
- raise ValueError('Required property \'resource_type\' not present in EndpointGatewayTargetProviderCloudServiceReference JSON')
+ if (allow_ip_spoofing := _dict.get('allow_ip_spoofing')) is not None:
+ args['allow_ip_spoofing'] = allow_ip_spoofing
+ if (auto_delete := _dict.get('auto_delete')) is not None:
+ args['auto_delete'] = auto_delete
+ if (enable_infrastructure_nat := _dict.get('enable_infrastructure_nat')) is not None:
+ args['enable_infrastructure_nat'] = enable_infrastructure_nat
+ if (ips := _dict.get('ips')) is not None:
+ args['ips'] = ips
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ if (primary_ip := _dict.get('primary_ip')) is not None:
+ args['primary_ip'] = primary_ip
+ if (resource_group := _dict.get('resource_group')) is not None:
+ args['resource_group'] = resource_group
+ if (security_groups := _dict.get('security_groups')) is not None:
+ args['security_groups'] = security_groups
+ if (subnet := _dict.get('subnet')) is not None:
+ args['subnet'] = subnet
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a EndpointGatewayTargetProviderCloudServiceReference object from a json dictionary."""
+ """Initialize a BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeBareMetalServerNetworkAttachmentContext object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'crn') and self.crn is not None:
- _dict['crn'] = self.crn
- if hasattr(self, 'resource_type') and self.resource_type is not None:
- _dict['resource_type'] = self.resource_type
+ if hasattr(self, 'allow_ip_spoofing') and self.allow_ip_spoofing is not None:
+ _dict['allow_ip_spoofing'] = self.allow_ip_spoofing
+ if hasattr(self, 'auto_delete') and self.auto_delete is not None:
+ _dict['auto_delete'] = self.auto_delete
+ 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, 'ips') and self.ips is not None:
+ ips_list = []
+ for v in self.ips:
+ if isinstance(v, dict):
+ ips_list.append(v)
+ else:
+ ips_list.append(v.to_dict())
+ _dict['ips'] = ips_list
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ if hasattr(self, 'primary_ip') and self.primary_ip is not None:
+ if isinstance(self.primary_ip, dict):
+ _dict['primary_ip'] = self.primary_ip
+ else:
+ _dict['primary_ip'] = self.primary_ip.to_dict()
+ if hasattr(self, 'resource_group') and self.resource_group is not None:
+ if isinstance(self.resource_group, dict):
+ _dict['resource_group'] = self.resource_group
+ else:
+ _dict['resource_group'] = self.resource_group.to_dict()
+ if hasattr(self, 'security_groups') and self.security_groups is not None:
+ security_groups_list = []
+ for v in self.security_groups:
+ if isinstance(v, dict):
+ security_groups_list.append(v)
+ else:
+ security_groups_list.append(v.to_dict())
+ _dict['security_groups'] = security_groups_list
+ if hasattr(self, 'subnet') and self.subnet is not None:
+ if isinstance(self.subnet, dict):
+ _dict['subnet'] = self.subnet
+ else:
+ _dict['subnet'] = self.subnet.to_dict()
return _dict
def _to_dict(self):
@@ -93675,70 +98514,98 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this EndpointGatewayTargetProviderCloudServiceReference object."""
+ """Return a `str` version of this BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeBareMetalServerNetworkAttachmentContext object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'EndpointGatewayTargetProviderCloudServiceReference') -> bool:
+ def __eq__(self, other: 'BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeBareMetalServerNetworkAttachmentContext') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'EndpointGatewayTargetProviderCloudServiceReference') -> bool:
+ def __ne__(self, other: 'BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeBareMetalServerNetworkAttachmentContext') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class ResourceTypeEnum(str, Enum):
- """
- The type of target.
- """
-
- PROVIDER_CLOUD_SERVICE = 'provider_cloud_service'
-
-
-class EndpointGatewayTargetProviderInfrastructureServiceReference(EndpointGatewayTarget):
+class BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByPCIPrototype(BareMetalServerNetworkAttachmentPrototype):
"""
- The name of this provider infrastructure service.
+ BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByPCIPrototype.
- :attr str name: The name of a provider infrastructure service. Must be:
- - `ibm-ntp-server`: An NTP (Network Time Protocol) server provided by IBM.
- :attr str resource_type: The type of target.
+ :param str name: (optional) The name for this bare metal server network
+ attachment. Names must be unique within the bare metal server the network
+ attachment resides in. If unspecified, the name will be a hyphenated list of
+ randomly-selected words.
+ :param BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterface
+ virtual_network_interface:
+ :param List[int] allowed_vlans: (optional) The VLAN IDs to allow for `vlan`
+ attachments using this PCI attachment.
+ :param str interface_type: - `pci`: a physical PCI device which can only be
+ created or deleted when the bare metal
+ server is stopped
+ - Has an `allowed_vlans` property which controls the VLANs that will be
+ permitted
+ to use the PCI attachment
+ - Cannot directly use an IEEE 802.1Q tag.
+ - Not supported on bare metal servers with a `cpu.architecture` of `s390x`.
"""
def __init__(
self,
- name: str,
- resource_type: str,
+ virtual_network_interface: 'BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterface',
+ interface_type: str,
+ *,
+ name: Optional[str] = None,
+ allowed_vlans: Optional[List[int]] = None,
) -> None:
"""
- Initialize a EndpointGatewayTargetProviderInfrastructureServiceReference object.
+ Initialize a BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByPCIPrototype object.
- :param str name: The name of a provider infrastructure service. Must be:
- - `ibm-ntp-server`: An NTP (Network Time Protocol) server provided by IBM.
- :param str resource_type: The type of target.
+ :param BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterface
+ virtual_network_interface:
+ :param str interface_type: - `pci`: a physical PCI device which can only be
+ created or deleted when the bare metal
+ server is stopped
+ - Has an `allowed_vlans` property which controls the VLANs that will be
+ permitted
+ to use the PCI attachment
+ - Cannot directly use an IEEE 802.1Q tag.
+ - Not supported on bare metal servers with a `cpu.architecture` of
+ `s390x`.
+ :param str name: (optional) The name for this bare metal server network
+ attachment. Names must be unique within the bare metal server the network
+ attachment resides in. If unspecified, the name will be a hyphenated list
+ of randomly-selected words.
+ :param List[int] allowed_vlans: (optional) The VLAN IDs to allow for `vlan`
+ attachments using this PCI attachment.
"""
# pylint: disable=super-init-not-called
self.name = name
- self.resource_type = resource_type
+ self.virtual_network_interface = virtual_network_interface
+ self.allowed_vlans = allowed_vlans
+ self.interface_type = interface_type
@classmethod
- def from_dict(cls, _dict: Dict) -> 'EndpointGatewayTargetProviderInfrastructureServiceReference':
- """Initialize a EndpointGatewayTargetProviderInfrastructureServiceReference object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByPCIPrototype':
+ """Initialize a BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByPCIPrototype object from a json dictionary."""
args = {}
- if 'name' in _dict:
- args['name'] = _dict.get('name')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ if (virtual_network_interface := _dict.get('virtual_network_interface')) is not None:
+ args['virtual_network_interface'] = virtual_network_interface
else:
- raise ValueError('Required property \'name\' not present in EndpointGatewayTargetProviderInfrastructureServiceReference JSON')
- if 'resource_type' in _dict:
- args['resource_type'] = _dict.get('resource_type')
+ raise ValueError('Required property \'virtual_network_interface\' not present in BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByPCIPrototype JSON')
+ if (allowed_vlans := _dict.get('allowed_vlans')) is not None:
+ args['allowed_vlans'] = allowed_vlans
+ if (interface_type := _dict.get('interface_type')) is not None:
+ args['interface_type'] = interface_type
else:
- raise ValueError('Required property \'resource_type\' not present in EndpointGatewayTargetProviderInfrastructureServiceReference JSON')
+ raise ValueError('Required property \'interface_type\' not present in BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByPCIPrototype JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a EndpointGatewayTargetProviderInfrastructureServiceReference object from a json dictionary."""
+ """Initialize a BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByPCIPrototype object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -93746,8 +98613,15 @@ def to_dict(self) -> Dict:
_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, 'virtual_network_interface') and self.virtual_network_interface is not None:
+ if isinstance(self.virtual_network_interface, dict):
+ _dict['virtual_network_interface'] = self.virtual_network_interface
+ else:
+ _dict['virtual_network_interface'] = self.virtual_network_interface.to_dict()
+ if hasattr(self, 'allowed_vlans') and self.allowed_vlans is not None:
+ _dict['allowed_vlans'] = self.allowed_vlans
+ if hasattr(self, 'interface_type') and self.interface_type is not None:
+ _dict['interface_type'] = self.interface_type
return _dict
def _to_dict(self):
@@ -93755,91 +98629,134 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this EndpointGatewayTargetProviderInfrastructureServiceReference object."""
+ """Return a `str` version of this BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByPCIPrototype object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'EndpointGatewayTargetProviderInfrastructureServiceReference') -> bool:
+ def __eq__(self, other: 'BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByPCIPrototype') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'EndpointGatewayTargetProviderInfrastructureServiceReference') -> bool:
+ def __ne__(self, other: 'BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByPCIPrototype') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class ResourceTypeEnum(str, Enum):
+ class InterfaceTypeEnum(str, Enum):
"""
- The type of target.
+ - `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 attachment
+ - Cannot directly use an IEEE 802.1Q tag.
+ - Not supported on bare metal servers with a `cpu.architecture` of `s390x`.
"""
- PROVIDER_INFRASTRUCTURE_SERVICE = 'provider_infrastructure_service'
+ PCI = 'pci'
-class FloatingIPPrototypeFloatingIPByTarget(FloatingIPPrototype):
+class BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByVLANPrototype(BareMetalServerNetworkAttachmentPrototype):
"""
- FloatingIPPrototypeFloatingIPByTarget.
+ BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByVLANPrototype.
- :attr str name: (optional) The name for this floating IP. The name must not be
- used by another floating IP in the region. If unspecified, the name will be a
- hyphenated list of randomly-selected words.
- :attr ResourceGroupIdentity resource_group: (optional)
- :attr FloatingIPTargetPrototype target: The target resource to bind this
- floating IP to.
- The target resource must not already have a floating IP bound to it if the
- target
- resource is:
- - an instance network interface
- - a bare metal server network interface with `enable_infrastructure_nat` set to
- `true`.
+ :param str name: (optional) The name for this bare metal server network
+ attachment. Names must be unique within the bare metal server the network
+ attachment resides in. If unspecified, the name will be a hyphenated list of
+ randomly-selected words.
+ :param BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterface
+ virtual_network_interface:
+ :param bool allow_to_float: (optional) Indicates if the data path for the
+ network attachment can float to another bare metal server. Can only be `true`
+ for network attachments with an `interface_type` of `vlan`.
+ If `true`, and the network detects traffic for this data path on another bare
+ metal server in the resource group, the network attachment will be automatically
+ deleted from this bare metal server and a new network attachment with the same
+ `id`, `name` and `vlan` will be created on the other bare metal server. The
+ virtual network interface for this network attachment will be automatically be
+ attached to the new network attachment.
+ For the data path to float, the other bare metal server must be in the same
+ `resource_group`, and must have a network attachment with `interface_type` of
+ `pci` with `allowed_vlans` including this network attachment's `vlan`.
+ :param str interface_type: - `vlan`: a virtual device, used through a `pci`
+ device that has the `vlan` in its array
+ of `allowed_vlans`.
+ - Must use an IEEE 802.1Q tag.
+ :param int vlan: The IEEE 802.1Q VLAN ID that must be used for all traffic on
+ this attachment.
"""
def __init__(
self,
- target: 'FloatingIPTargetPrototype',
+ virtual_network_interface: 'BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterface',
+ interface_type: str,
+ vlan: int,
*,
- name: str = None,
- resource_group: 'ResourceGroupIdentity' = None,
+ name: Optional[str] = None,
+ allow_to_float: Optional[bool] = None,
) -> None:
"""
- Initialize a FloatingIPPrototypeFloatingIPByTarget object.
+ Initialize a BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByVLANPrototype object.
- :param FloatingIPTargetPrototype target: The target resource to bind this
- floating IP to.
- The target resource must not already have a floating IP bound to it if the
- target
- resource is:
- - an instance network interface
- - a bare metal server network interface with `enable_infrastructure_nat`
- set to `true`.
- :param str name: (optional) The name for this floating IP. The name must
- not be used by another floating IP in the region. If unspecified, the name
- will be a hyphenated list of randomly-selected words.
- :param ResourceGroupIdentity resource_group: (optional)
+ :param BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterface
+ virtual_network_interface:
+ :param str interface_type: - `vlan`: a virtual device, used through a `pci`
+ device that has the `vlan` in its array
+ of `allowed_vlans`.
+ - Must use an IEEE 802.1Q tag.
+ :param int vlan: The IEEE 802.1Q VLAN ID that must be used for all traffic
+ on this attachment.
+ :param str name: (optional) The name for this bare metal server network
+ attachment. Names must be unique within the bare metal server the network
+ attachment resides in. If unspecified, the name will be a hyphenated list
+ of randomly-selected words.
+ :param bool allow_to_float: (optional) Indicates if the data path for the
+ network attachment can float to another bare metal server. Can only be
+ `true` for network attachments with an `interface_type` of `vlan`.
+ If `true`, and the network detects traffic for this data path on another
+ bare metal server in the resource group, the network attachment will be
+ automatically deleted from this bare metal server and a new network
+ attachment with the same `id`, `name` and `vlan` will be created on the
+ other bare metal server. The virtual network interface for this network
+ attachment will be automatically be attached to the new network attachment.
+ For the data path to float, the other bare metal server must be in the same
+ `resource_group`, and must have a network attachment with `interface_type`
+ of `pci` with `allowed_vlans` including this network attachment's `vlan`.
"""
# pylint: disable=super-init-not-called
self.name = name
- self.resource_group = resource_group
- self.target = target
+ self.virtual_network_interface = virtual_network_interface
+ self.allow_to_float = allow_to_float
+ self.interface_type = interface_type
+ self.vlan = vlan
@classmethod
- def from_dict(cls, _dict: Dict) -> 'FloatingIPPrototypeFloatingIPByTarget':
- """Initialize a FloatingIPPrototypeFloatingIPByTarget object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByVLANPrototype':
+ """Initialize a BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByVLANPrototype object from a json dictionary."""
args = {}
- if 'name' in _dict:
- args['name'] = _dict.get('name')
- if 'resource_group' in _dict:
- args['resource_group'] = _dict.get('resource_group')
- if 'target' in _dict:
- args['target'] = _dict.get('target')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ if (virtual_network_interface := _dict.get('virtual_network_interface')) is not None:
+ args['virtual_network_interface'] = virtual_network_interface
else:
- raise ValueError('Required property \'target\' not present in FloatingIPPrototypeFloatingIPByTarget JSON')
+ raise ValueError('Required property \'virtual_network_interface\' not present in BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByVLANPrototype JSON')
+ if (allow_to_float := _dict.get('allow_to_float')) is not None:
+ args['allow_to_float'] = allow_to_float
+ if (interface_type := _dict.get('interface_type')) is not None:
+ args['interface_type'] = interface_type
+ else:
+ raise ValueError('Required property \'interface_type\' not present in BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByVLANPrototype JSON')
+ if (vlan := _dict.get('vlan')) is not None:
+ args['vlan'] = vlan
+ else:
+ raise ValueError('Required property \'vlan\' not present in BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByVLANPrototype JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a FloatingIPPrototypeFloatingIPByTarget object from a json dictionary."""
+ """Initialize a BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByVLANPrototype object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -93847,16 +98764,17 @@ def to_dict(self) -> Dict:
_dict = {}
if hasattr(self, 'name') and self.name is not None:
_dict['name'] = self.name
- if hasattr(self, 'resource_group') and self.resource_group is not None:
- if isinstance(self.resource_group, dict):
- _dict['resource_group'] = self.resource_group
- else:
- _dict['resource_group'] = self.resource_group.to_dict()
- if hasattr(self, 'target') and self.target is not None:
- if isinstance(self.target, dict):
- _dict['target'] = self.target
+ if hasattr(self, 'virtual_network_interface') and self.virtual_network_interface is not None:
+ if isinstance(self.virtual_network_interface, dict):
+ _dict['virtual_network_interface'] = self.virtual_network_interface
else:
- _dict['target'] = self.target.to_dict()
+ _dict['virtual_network_interface'] = self.virtual_network_interface.to_dict()
+ if hasattr(self, 'allow_to_float') and self.allow_to_float is not None:
+ _dict['allow_to_float'] = self.allow_to_float
+ if hasattr(self, 'interface_type') and self.interface_type is not None:
+ _dict['interface_type'] = self.interface_type
+ if hasattr(self, 'vlan') and self.vlan is not None:
+ _dict['vlan'] = self.vlan
return _dict
def _to_dict(self):
@@ -93864,86 +98782,409 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this FloatingIPPrototypeFloatingIPByTarget object."""
+ """Return a `str` version of this BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByVLANPrototype object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'FloatingIPPrototypeFloatingIPByTarget') -> bool:
+ def __eq__(self, other: 'BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByVLANPrototype') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'FloatingIPPrototypeFloatingIPByTarget') -> bool:
+ def __ne__(self, other: 'BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByVLANPrototype') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
+ class InterfaceTypeEnum(str, Enum):
+ """
+ - `vlan`: a virtual device, used through a `pci` device that has the `vlan` in its
+ array
+ of `allowed_vlans`.
+ - Must use an IEEE 802.1Q tag.
+ """
+
+ VLAN = 'vlan'
-class FloatingIPPrototypeFloatingIPByZone(FloatingIPPrototype):
+
+
+class BareMetalServerNetworkInterfaceByHiperSocket(BareMetalServerNetworkInterface):
"""
- FloatingIPPrototypeFloatingIPByZone.
+ BareMetalServerNetworkInterfaceByHiperSocket.
- :attr str name: (optional) The name for this floating IP. The name must not be
- used by another floating IP in the region. If unspecified, the name will be a
- hyphenated list of randomly-selected words.
- :attr ResourceGroupIdentity resource_group: (optional)
- :attr ZoneIdentity zone: The zone this floating IP will reside in.
+ :param bool allow_ip_spoofing: Indicates whether source IP spoofing is allowed
+ on this bare metal server network interface.
+ If this bare metal server has network attachments, this network interface is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and source IP spoofing is managed on the attached virtual network
+ interface.
+ :param datetime created_at: The date and time that the bare metal server network
+ interface was created.
+ If this bare metal server has network attachments, this network interface was
+ created as a [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ when its corresponding network attachment was created.
+ :param bool enable_infrastructure_nat: If `true`:
+ - The VPC infrastructure performs any needed NAT operations.
+ - `floating_ips` must not have more than one floating IP.
+ If `false`:
+ - Packets are passed unchanged to/from the bare metal server network interface,
+ allowing the workload to perform any needed NAT operations.
+ - `allow_ip_spoofing` must be `false`.
+ - `interface_type` must not be `hipersocket`.
+ If this bare metal server has network attachments, this network interface is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and infrastructure NAT is managed on the attached virtual network
+ interface.
+ :param List[FloatingIPReference] floating_ips: The floating IPs associated with
+ this bare metal server network interface.
+ If this bare metal server has network attachments, this network interface is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and the floating IPs are associated with the attached virtual network
+ interface.
+ :param str href: The URL for this bare metal server network interface.
+ If this bare metal server has network attachments, this network interface is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment.
+ :param str id: The unique identifier for this bare metal server network
+ interface.
+ If this bare metal server has network attachments, this network interface is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and the identifier is that of the corresponding network attachment.
+ :param str mac_address: The MAC address of this bare metal server network
+ interface. If the MAC address has not yet been selected, the value will be an
+ empty string.
+ If this bare metal server has network attachments, this network interface is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and the MAC address is that of the attached virtual network
+ interface.
+ :param str name: The name for this bare metal server network interface.
+ If this bare metal server has network attachments, this network interface is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and the name matches its corresponding network attachment.
+ :param int port_speed: The bare metal server network interface port speed in
+ Mbps.
+ If this bare metal server has network attachments, this network interface is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and the port speed is that of its corresponding network attachment.
+ :param ReservedIPReference primary_ip:
+ :param str resource_type: The resource type.
+ :param List[SecurityGroupReference] security_groups: The security groups
+ targeting this bare metal server network interface.
+ If this bare metal server has network attachments, this network interface is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and the security groups are associated with the attached virtual
+ network interface.
+ :param str status: The status of the bare metal server network interface.
+ If this bare metal server has network attachments, this network interface is a
+ read-only representation of its corresponding network attachment and its
+ attached virtual network interface, and the status is [computed from
+ them](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients).
+ :param SubnetReference subnet: The associated subnet.
+ :param str type: The bare metal server network interface type.
+ If this bare metal server has network attachments, this network interface is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and the type is that of its corresponding network attachment.
+ :param str interface_type: - `hipersocket`: a virtual network device that
+ provides high-speed TCP/IP connectivity
+ within a `s390x` based system.
"""
def __init__(
self,
- zone: 'ZoneIdentity',
- *,
- name: str = None,
- resource_group: 'ResourceGroupIdentity' = None,
+ allow_ip_spoofing: bool,
+ created_at: datetime,
+ enable_infrastructure_nat: bool,
+ floating_ips: List['FloatingIPReference'],
+ href: str,
+ id: str,
+ mac_address: str,
+ name: str,
+ port_speed: int,
+ primary_ip: 'ReservedIPReference',
+ resource_type: str,
+ security_groups: List['SecurityGroupReference'],
+ status: str,
+ subnet: 'SubnetReference',
+ type: str,
+ interface_type: str,
) -> None:
"""
- Initialize a FloatingIPPrototypeFloatingIPByZone object.
+ Initialize a BareMetalServerNetworkInterfaceByHiperSocket object.
- :param ZoneIdentity zone: The zone this floating IP will reside in.
- :param str name: (optional) The name for this floating IP. The name must
- not be used by another floating IP in the region. If unspecified, the name
- will be a hyphenated list of randomly-selected words.
- :param ResourceGroupIdentity resource_group: (optional)
+ :param bool allow_ip_spoofing: Indicates whether source IP spoofing is
+ allowed on this bare metal server network interface.
+ If this bare metal server has network attachments, this network interface
+ is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and source IP spoofing is managed on the attached virtual
+ network interface.
+ :param datetime created_at: The date and time that the bare metal server
+ network interface was created.
+ If this bare metal server has network attachments, this network interface
+ was created as a [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ when its corresponding network attachment was created.
+ :param bool enable_infrastructure_nat: If `true`:
+ - The VPC infrastructure performs any needed NAT operations.
+ - `floating_ips` must not have more than one floating IP.
+ If `false`:
+ - Packets are passed unchanged to/from the bare metal server network
+ interface,
+ allowing the workload to perform any needed NAT operations.
+ - `allow_ip_spoofing` must be `false`.
+ - `interface_type` must not be `hipersocket`.
+ If this bare metal server has network attachments, this network interface
+ is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and infrastructure NAT is managed on the attached virtual
+ network interface.
+ :param List[FloatingIPReference] floating_ips: The floating IPs associated
+ with this bare metal server network interface.
+ If this bare metal server has network attachments, this network interface
+ is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and the floating IPs are associated with the attached virtual
+ network interface.
+ :param str href: The URL for this bare metal server network interface.
+ If this bare metal server has network attachments, this network interface
+ is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment.
+ :param str id: The unique identifier for this bare metal server network
+ interface.
+ If this bare metal server has network attachments, this network interface
+ is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and the identifier is that of the corresponding network
+ attachment.
+ :param str mac_address: The MAC address of this bare metal server network
+ interface. If the MAC address has not yet been selected, the value will be
+ an empty string.
+ If this bare metal server has network attachments, this network interface
+ is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and the MAC address is that of the attached virtual network
+ interface.
+ :param str name: The name for this bare metal server network interface.
+ If this bare metal server has network attachments, this network interface
+ is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and the name matches its corresponding network attachment.
+ :param int port_speed: The bare metal server network interface port speed
+ in Mbps.
+ If this bare metal server has network attachments, this network interface
+ is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and the port speed is that of its corresponding network
+ attachment.
+ :param ReservedIPReference primary_ip:
+ :param str resource_type: The resource type.
+ :param List[SecurityGroupReference] security_groups: The security groups
+ targeting this bare metal server network interface.
+ If this bare metal server has network attachments, this network interface
+ is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and the security groups are associated with the attached virtual
+ network interface.
+ :param str status: The status of the bare metal server network interface.
+ If this bare metal server has network attachments, this network interface
+ is a read-only representation of its corresponding network attachment and
+ its attached virtual network interface, and the status is [computed from
+ them](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients).
+ :param SubnetReference subnet: The associated subnet.
+ :param str type: The bare metal server network interface type.
+ If this bare metal server has network attachments, this network interface
+ is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and the type is that of its corresponding network attachment.
+ :param str interface_type: - `hipersocket`: a virtual network device that
+ provides high-speed TCP/IP connectivity
+ within a `s390x` based system.
"""
# pylint: disable=super-init-not-called
+ self.allow_ip_spoofing = allow_ip_spoofing
+ self.created_at = created_at
+ self.enable_infrastructure_nat = enable_infrastructure_nat
+ self.floating_ips = floating_ips
+ self.href = href
+ self.id = id
+ self.mac_address = mac_address
self.name = name
- self.resource_group = resource_group
- self.zone = zone
+ self.port_speed = port_speed
+ self.primary_ip = primary_ip
+ self.resource_type = resource_type
+ self.security_groups = security_groups
+ self.status = status
+ self.subnet = subnet
+ self.type = type
+ self.interface_type = interface_type
@classmethod
- def from_dict(cls, _dict: Dict) -> 'FloatingIPPrototypeFloatingIPByZone':
- """Initialize a FloatingIPPrototypeFloatingIPByZone object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'BareMetalServerNetworkInterfaceByHiperSocket':
+ """Initialize a BareMetalServerNetworkInterfaceByHiperSocket 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 'zone' in _dict:
- args['zone'] = _dict.get('zone')
+ if (allow_ip_spoofing := _dict.get('allow_ip_spoofing')) is not None:
+ args['allow_ip_spoofing'] = allow_ip_spoofing
else:
- raise ValueError('Required property \'zone\' not present in FloatingIPPrototypeFloatingIPByZone JSON')
+ raise ValueError('Required property \'allow_ip_spoofing\' not present in BareMetalServerNetworkInterfaceByHiperSocket JSON')
+ if (created_at := _dict.get('created_at')) is not None:
+ args['created_at'] = string_to_datetime(created_at)
+ else:
+ raise ValueError('Required property \'created_at\' not present in BareMetalServerNetworkInterfaceByHiperSocket JSON')
+ if (enable_infrastructure_nat := _dict.get('enable_infrastructure_nat')) is not None:
+ args['enable_infrastructure_nat'] = enable_infrastructure_nat
+ else:
+ raise ValueError('Required property \'enable_infrastructure_nat\' not present in BareMetalServerNetworkInterfaceByHiperSocket JSON')
+ if (floating_ips := _dict.get('floating_ips')) is not None:
+ args['floating_ips'] = [FloatingIPReference.from_dict(v) for v in floating_ips]
+ else:
+ raise ValueError('Required property \'floating_ips\' not present in BareMetalServerNetworkInterfaceByHiperSocket JSON')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
+ else:
+ raise ValueError('Required property \'href\' not present in BareMetalServerNetworkInterfaceByHiperSocket JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
+ else:
+ raise ValueError('Required property \'id\' not present in BareMetalServerNetworkInterfaceByHiperSocket JSON')
+ if (mac_address := _dict.get('mac_address')) is not None:
+ args['mac_address'] = mac_address
+ else:
+ raise ValueError('Required property \'mac_address\' not present in BareMetalServerNetworkInterfaceByHiperSocket JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ else:
+ raise ValueError('Required property \'name\' not present in BareMetalServerNetworkInterfaceByHiperSocket JSON')
+ if (port_speed := _dict.get('port_speed')) is not None:
+ args['port_speed'] = port_speed
+ else:
+ raise ValueError('Required property \'port_speed\' not present in BareMetalServerNetworkInterfaceByHiperSocket JSON')
+ if (primary_ip := _dict.get('primary_ip')) is not None:
+ args['primary_ip'] = ReservedIPReference.from_dict(primary_ip)
+ else:
+ raise ValueError('Required property \'primary_ip\' not present in BareMetalServerNetworkInterfaceByHiperSocket JSON')
+ if (resource_type := _dict.get('resource_type')) is not None:
+ args['resource_type'] = resource_type
+ else:
+ raise ValueError('Required property \'resource_type\' not present in BareMetalServerNetworkInterfaceByHiperSocket JSON')
+ if (security_groups := _dict.get('security_groups')) is not None:
+ args['security_groups'] = [SecurityGroupReference.from_dict(v) for v in security_groups]
+ else:
+ raise ValueError('Required property \'security_groups\' not present in BareMetalServerNetworkInterfaceByHiperSocket JSON')
+ if (status := _dict.get('status')) is not None:
+ args['status'] = status
+ else:
+ raise ValueError('Required property \'status\' not present in BareMetalServerNetworkInterfaceByHiperSocket JSON')
+ if (subnet := _dict.get('subnet')) is not None:
+ args['subnet'] = SubnetReference.from_dict(subnet)
+ else:
+ raise ValueError('Required property \'subnet\' not present in BareMetalServerNetworkInterfaceByHiperSocket JSON')
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
+ else:
+ raise ValueError('Required property \'type\' not present in BareMetalServerNetworkInterfaceByHiperSocket JSON')
+ if (interface_type := _dict.get('interface_type')) is not None:
+ args['interface_type'] = interface_type
+ else:
+ raise ValueError('Required property \'interface_type\' not present in BareMetalServerNetworkInterfaceByHiperSocket JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a FloatingIPPrototypeFloatingIPByZone object from a json dictionary."""
+ """Initialize a BareMetalServerNetworkInterfaceByHiperSocket object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
+ if hasattr(self, 'allow_ip_spoofing') and self.allow_ip_spoofing is not None:
+ _dict['allow_ip_spoofing'] = self.allow_ip_spoofing
+ if hasattr(self, 'created_at') and self.created_at is not None:
+ _dict['created_at'] = datetime_to_string(self.created_at)
+ if hasattr(self, 'enable_infrastructure_nat') and self.enable_infrastructure_nat is not None:
+ _dict['enable_infrastructure_nat'] = self.enable_infrastructure_nat
+ if hasattr(self, 'floating_ips') and self.floating_ips is not None:
+ floating_ips_list = []
+ for v in self.floating_ips:
+ if isinstance(v, dict):
+ floating_ips_list.append(v)
+ else:
+ floating_ips_list.append(v.to_dict())
+ _dict['floating_ips'] = floating_ips_list
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
+ if hasattr(self, 'id') and self.id is not None:
+ _dict['id'] = self.id
+ if hasattr(self, 'mac_address') and self.mac_address is not None:
+ _dict['mac_address'] = self.mac_address
if hasattr(self, 'name') and self.name is not None:
_dict['name'] = self.name
- if hasattr(self, 'resource_group') and self.resource_group is not None:
- if isinstance(self.resource_group, dict):
- _dict['resource_group'] = self.resource_group
+ if hasattr(self, 'port_speed') and self.port_speed is not None:
+ _dict['port_speed'] = self.port_speed
+ if hasattr(self, 'primary_ip') and self.primary_ip is not None:
+ if isinstance(self.primary_ip, dict):
+ _dict['primary_ip'] = self.primary_ip
else:
- _dict['resource_group'] = self.resource_group.to_dict()
- if hasattr(self, 'zone') and self.zone is not None:
- if isinstance(self.zone, dict):
- _dict['zone'] = self.zone
+ _dict['primary_ip'] = self.primary_ip.to_dict()
+ if hasattr(self, 'resource_type') and self.resource_type is not None:
+ _dict['resource_type'] = self.resource_type
+ if hasattr(self, 'security_groups') and self.security_groups is not None:
+ security_groups_list = []
+ for v in self.security_groups:
+ if isinstance(v, dict):
+ security_groups_list.append(v)
+ else:
+ security_groups_list.append(v.to_dict())
+ _dict['security_groups'] = security_groups_list
+ if hasattr(self, 'status') and self.status is not None:
+ _dict['status'] = self.status
+ if hasattr(self, 'subnet') and self.subnet is not None:
+ if isinstance(self.subnet, dict):
+ _dict['subnet'] = self.subnet
else:
- _dict['zone'] = self.zone.to_dict()
+ _dict['subnet'] = self.subnet.to_dict()
+ if hasattr(self, 'type') and self.type is not None:
+ _dict['type'] = self.type
+ if hasattr(self, 'interface_type') and self.interface_type is not None:
+ _dict['interface_type'] = self.interface_type
return _dict
def _to_dict(self):
@@ -93951,202 +99192,478 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this FloatingIPPrototypeFloatingIPByZone object."""
+ """Return a `str` version of this BareMetalServerNetworkInterfaceByHiperSocket object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'FloatingIPPrototypeFloatingIPByZone') -> bool:
+ def __eq__(self, other: 'BareMetalServerNetworkInterfaceByHiperSocket') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'FloatingIPPrototypeFloatingIPByZone') -> bool:
+ def __ne__(self, other: 'BareMetalServerNetworkInterfaceByHiperSocket') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-
-class FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentity(FloatingIPTargetPatch):
- """
- Identifies a bare metal server network interface by a unique property.
-
- """
-
- def __init__(
- self,
- ) -> None:
+ class ResourceTypeEnum(str, Enum):
"""
- Initialize a FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentity object.
-
+ The resource type.
"""
- # pylint: disable=super-init-not-called
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityById', 'FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref'])
- )
- raise Exception(msg)
-
-class FloatingIPTargetPatchNetworkInterfaceIdentity(FloatingIPTargetPatch):
- """
- Identifies an instance network interface by a unique property.
+ NETWORK_INTERFACE = 'network_interface'
- """
- def __init__(
- self,
- ) -> None:
+ class StatusEnum(str, Enum):
"""
- Initialize a FloatingIPTargetPatchNetworkInterfaceIdentity object.
-
+ The status of the bare metal server network interface.
+ If this bare metal server has network attachments, this network interface is a
+ read-only representation of its corresponding network attachment and its attached
+ virtual network interface, and the status is [computed from
+ them](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients).
"""
- # pylint: disable=super-init-not-called
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityById', 'FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByHref'])
- )
- raise Exception(msg)
-
-class FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentity(FloatingIPTargetPrototype):
- """
- Identifies a bare metal server network interface by a unique property.
+ AVAILABLE = 'available'
+ DELETING = 'deleting'
+ FAILED = 'failed'
+ PENDING = 'pending'
- """
- def __init__(
- self,
- ) -> None:
+ class TypeEnum(str, Enum):
"""
- Initialize a FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentity object.
-
+ The bare metal server network interface type.
+ If this bare metal server has network attachments, this network interface is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and the type is that of its corresponding network attachment.
"""
- # pylint: disable=super-init-not-called
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityById', 'FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref'])
- )
- raise Exception(msg)
+ PRIMARY = 'primary'
+ SECONDARY = 'secondary'
-class FloatingIPTargetPrototypeNetworkInterfaceIdentity(FloatingIPTargetPrototype):
- """
- Identifies an instance network interface by a unique property.
-
- """
- def __init__(
- self,
- ) -> None:
+ class InterfaceTypeEnum(str, Enum):
"""
- Initialize a FloatingIPTargetPrototypeNetworkInterfaceIdentity object.
-
+ - `hipersocket`: a virtual network device that provides high-speed TCP/IP
+ connectivity
+ within a `s390x` based system.
"""
- # pylint: disable=super-init-not-called
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityById', 'FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref'])
- )
- raise Exception(msg)
+
+ HIPERSOCKET = 'hipersocket'
-class FloatingIPTargetBareMetalServerNetworkInterfaceReference(FloatingIPTarget):
+
+class BareMetalServerNetworkInterfaceByPCI(BareMetalServerNetworkInterface):
"""
- FloatingIPTargetBareMetalServerNetworkInterfaceReference.
+ BareMetalServerNetworkInterfaceByPCI.
- :attr BareMetalServerNetworkInterfaceReferenceDeleted deleted: (optional) If
- present, this property indicates the referenced resource has been deleted, and
- provides
- some supplementary information.
- :attr str href: The URL for this bare metal server network interface.
- :attr str id: The unique identifier for this bare metal server network
+ :param bool allow_ip_spoofing: Indicates whether source IP spoofing is allowed
+ on this bare metal server network interface.
+ If this bare metal server has network attachments, this network interface is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and source IP spoofing is managed on the attached virtual network
+ interface.
+ :param datetime created_at: The date and time that the bare metal server network
+ interface was created.
+ If this bare metal server has network attachments, this network interface was
+ created as a [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ when its corresponding network attachment was created.
+ :param bool enable_infrastructure_nat: If `true`:
+ - The VPC infrastructure performs any needed NAT operations.
+ - `floating_ips` must not have more than one floating IP.
+ If `false`:
+ - Packets are passed unchanged to/from the bare metal server network interface,
+ allowing the workload to perform any needed NAT operations.
+ - `allow_ip_spoofing` must be `false`.
+ - `interface_type` must not be `hipersocket`.
+ If this bare metal server has network attachments, this network interface is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and infrastructure NAT is managed on the attached virtual network
interface.
- :attr str name: The name for this bare metal server network interface.
- :attr ReservedIPReference primary_ip:
- :attr str resource_type: The resource type.
+ :param List[FloatingIPReference] floating_ips: The floating IPs associated with
+ this bare metal server network interface.
+ If this bare metal server has network attachments, this network interface is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and the floating IPs are associated with the attached virtual network
+ interface.
+ :param str href: The URL for this bare metal server network interface.
+ If this bare metal server has network attachments, this network interface is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment.
+ :param str id: The unique identifier for this bare metal server network
+ interface.
+ If this bare metal server has network attachments, this network interface is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and the identifier is that of the corresponding network attachment.
+ :param str mac_address: The MAC address of this bare metal server network
+ interface. If the MAC address has not yet been selected, the value will be an
+ empty string.
+ If this bare metal server has network attachments, this network interface is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and the MAC address is that of the attached virtual network
+ interface.
+ :param str name: The name for this bare metal server network interface.
+ If this bare metal server has network attachments, this network interface is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and the name matches its corresponding network attachment.
+ :param int port_speed: The bare metal server network interface port speed in
+ Mbps.
+ If this bare metal server has network attachments, this network interface is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and the port speed is that of its corresponding network attachment.
+ :param ReservedIPReference primary_ip:
+ :param str resource_type: The resource type.
+ :param List[SecurityGroupReference] security_groups: The security groups
+ targeting this bare metal server network interface.
+ If this bare metal server has network attachments, this network interface is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and the security groups are associated with the attached virtual
+ network interface.
+ :param str status: The status of the bare metal server network interface.
+ If this bare metal server has network attachments, this network interface is a
+ read-only representation of its corresponding network attachment and its
+ attached virtual network interface, and the status is [computed from
+ them](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients).
+ :param SubnetReference subnet: The associated subnet.
+ :param str type: The bare metal server network interface type.
+ If this bare metal server has network attachments, this network interface is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and the type is that of its corresponding network attachment.
+ :param List[int] allowed_vlans: The VLAN IDs allowed for `vlan` interfaces using
+ this PCI interface.
+ If this bare metal server has network attachments, this network interface is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and the VLAN IDs match the `allow_vlans` of the corresponding network
+ attachment.
+ :param str interface_type: - `pci`: a physical PCI device which can only be
+ created or deleted when the bare metal
+ server is stopped
+ - Has an `allowed_vlans` property which controls the VLANs that will be
+ permitted
+ to use the PCI interface
+ - Cannot directly use an IEEE 802.1Q tag.
"""
def __init__(
self,
+ allow_ip_spoofing: bool,
+ created_at: datetime,
+ enable_infrastructure_nat: bool,
+ floating_ips: List['FloatingIPReference'],
href: str,
id: str,
+ mac_address: str,
name: str,
+ port_speed: int,
primary_ip: 'ReservedIPReference',
resource_type: str,
- *,
- deleted: 'BareMetalServerNetworkInterfaceReferenceDeleted' = None,
+ security_groups: List['SecurityGroupReference'],
+ status: str,
+ subnet: 'SubnetReference',
+ type: str,
+ allowed_vlans: List[int],
+ interface_type: str,
) -> None:
"""
- Initialize a FloatingIPTargetBareMetalServerNetworkInterfaceReference object.
+ Initialize a BareMetalServerNetworkInterfaceByPCI object.
+ :param bool allow_ip_spoofing: Indicates whether source IP spoofing is
+ allowed on this bare metal server network interface.
+ If this bare metal server has network attachments, this network interface
+ is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and source IP spoofing is managed on the attached virtual
+ network interface.
+ :param datetime created_at: The date and time that the bare metal server
+ network interface was created.
+ If this bare metal server has network attachments, this network interface
+ was created as a [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ when its corresponding network attachment was created.
+ :param bool enable_infrastructure_nat: If `true`:
+ - The VPC infrastructure performs any needed NAT operations.
+ - `floating_ips` must not have more than one floating IP.
+ If `false`:
+ - Packets are passed unchanged to/from the bare metal server network
+ interface,
+ allowing the workload to perform any needed NAT operations.
+ - `allow_ip_spoofing` must be `false`.
+ - `interface_type` must not be `hipersocket`.
+ If this bare metal server has network attachments, this network interface
+ is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and infrastructure NAT is managed on the attached virtual
+ network interface.
+ :param List[FloatingIPReference] floating_ips: The floating IPs associated
+ with this bare metal server network interface.
+ If this bare metal server has network attachments, this network interface
+ is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and the floating IPs are associated with the attached virtual
+ network interface.
:param str href: The URL for this bare metal server network interface.
+ If this bare metal server has network attachments, this network interface
+ is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment.
:param str id: The unique identifier for this bare metal server network
interface.
+ If this bare metal server has network attachments, this network interface
+ is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and the identifier is that of the corresponding network
+ attachment.
+ :param str mac_address: The MAC address of this bare metal server network
+ interface. If the MAC address has not yet been selected, the value will be
+ an empty string.
+ If this bare metal server has network attachments, this network interface
+ is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and the MAC address is that of the attached virtual network
+ interface.
:param str name: The name for this bare metal server network interface.
+ If this bare metal server has network attachments, this network interface
+ is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and the name matches its corresponding network attachment.
+ :param int port_speed: The bare metal server network interface port speed
+ in Mbps.
+ If this bare metal server has network attachments, this network interface
+ is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and the port speed is that of its corresponding network
+ attachment.
:param ReservedIPReference primary_ip:
:param str resource_type: The resource type.
- :param BareMetalServerNetworkInterfaceReferenceDeleted deleted: (optional)
- If present, this property indicates the referenced resource has been
- deleted, and provides
- some supplementary information.
+ :param List[SecurityGroupReference] security_groups: The security groups
+ targeting this bare metal server network interface.
+ If this bare metal server has network attachments, this network interface
+ is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and the security groups are associated with the attached virtual
+ network interface.
+ :param str status: The status of the bare metal server network interface.
+ If this bare metal server has network attachments, this network interface
+ is a read-only representation of its corresponding network attachment and
+ its attached virtual network interface, and the status is [computed from
+ them](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients).
+ :param SubnetReference subnet: The associated subnet.
+ :param str type: The bare metal server network interface type.
+ If this bare metal server has network attachments, this network interface
+ is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and the type is that of its corresponding network attachment.
+ :param List[int] allowed_vlans: The VLAN IDs allowed for `vlan` interfaces
+ using this PCI interface.
+ If this bare metal server has network attachments, this network interface
+ is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and the VLAN IDs match the `allow_vlans` of the corresponding
+ network attachment.
+ :param str interface_type: - `pci`: a physical PCI device which can only be
+ created or deleted when the bare metal
+ server is stopped
+ - Has an `allowed_vlans` property which controls the VLANs that will be
+ permitted
+ to use the PCI interface
+ - Cannot directly use an IEEE 802.1Q tag.
"""
# pylint: disable=super-init-not-called
- self.deleted = deleted
+ self.allow_ip_spoofing = allow_ip_spoofing
+ self.created_at = created_at
+ self.enable_infrastructure_nat = enable_infrastructure_nat
+ self.floating_ips = floating_ips
self.href = href
self.id = id
+ self.mac_address = mac_address
self.name = name
+ self.port_speed = port_speed
self.primary_ip = primary_ip
self.resource_type = resource_type
+ self.security_groups = security_groups
+ self.status = status
+ self.subnet = subnet
+ self.type = type
+ self.allowed_vlans = allowed_vlans
+ self.interface_type = interface_type
@classmethod
- def from_dict(cls, _dict: Dict) -> 'FloatingIPTargetBareMetalServerNetworkInterfaceReference':
- """Initialize a FloatingIPTargetBareMetalServerNetworkInterfaceReference object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'BareMetalServerNetworkInterfaceByPCI':
+ """Initialize a BareMetalServerNetworkInterfaceByPCI object from a json dictionary."""
args = {}
- if 'deleted' in _dict:
- args['deleted'] = BareMetalServerNetworkInterfaceReferenceDeleted.from_dict(_dict.get('deleted'))
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ if (allow_ip_spoofing := _dict.get('allow_ip_spoofing')) is not None:
+ args['allow_ip_spoofing'] = allow_ip_spoofing
else:
- raise ValueError('Required property \'href\' not present in FloatingIPTargetBareMetalServerNetworkInterfaceReference JSON')
- if 'id' in _dict:
- args['id'] = _dict.get('id')
+ raise ValueError('Required property \'allow_ip_spoofing\' not present in BareMetalServerNetworkInterfaceByPCI JSON')
+ if (created_at := _dict.get('created_at')) is not None:
+ args['created_at'] = string_to_datetime(created_at)
else:
- raise ValueError('Required property \'id\' not present in FloatingIPTargetBareMetalServerNetworkInterfaceReference JSON')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
+ raise ValueError('Required property \'created_at\' not present in BareMetalServerNetworkInterfaceByPCI JSON')
+ if (enable_infrastructure_nat := _dict.get('enable_infrastructure_nat')) is not None:
+ args['enable_infrastructure_nat'] = enable_infrastructure_nat
else:
- raise ValueError('Required property \'name\' not present in FloatingIPTargetBareMetalServerNetworkInterfaceReference JSON')
- if 'primary_ip' in _dict:
- args['primary_ip'] = ReservedIPReference.from_dict(_dict.get('primary_ip'))
+ raise ValueError('Required property \'enable_infrastructure_nat\' not present in BareMetalServerNetworkInterfaceByPCI JSON')
+ if (floating_ips := _dict.get('floating_ips')) is not None:
+ args['floating_ips'] = [FloatingIPReference.from_dict(v) for v in floating_ips]
else:
- raise ValueError('Required property \'primary_ip\' not present in FloatingIPTargetBareMetalServerNetworkInterfaceReference JSON')
- if 'resource_type' in _dict:
- args['resource_type'] = _dict.get('resource_type')
+ raise ValueError('Required property \'floating_ips\' not present in BareMetalServerNetworkInterfaceByPCI JSON')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'resource_type\' not present in FloatingIPTargetBareMetalServerNetworkInterfaceReference JSON')
+ raise ValueError('Required property \'href\' not present in BareMetalServerNetworkInterfaceByPCI JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
+ else:
+ raise ValueError('Required property \'id\' not present in BareMetalServerNetworkInterfaceByPCI JSON')
+ if (mac_address := _dict.get('mac_address')) is not None:
+ args['mac_address'] = mac_address
+ else:
+ raise ValueError('Required property \'mac_address\' not present in BareMetalServerNetworkInterfaceByPCI JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ else:
+ raise ValueError('Required property \'name\' not present in BareMetalServerNetworkInterfaceByPCI JSON')
+ if (port_speed := _dict.get('port_speed')) is not None:
+ args['port_speed'] = port_speed
+ else:
+ raise ValueError('Required property \'port_speed\' not present in BareMetalServerNetworkInterfaceByPCI JSON')
+ if (primary_ip := _dict.get('primary_ip')) is not None:
+ args['primary_ip'] = ReservedIPReference.from_dict(primary_ip)
+ else:
+ raise ValueError('Required property \'primary_ip\' not present in BareMetalServerNetworkInterfaceByPCI JSON')
+ if (resource_type := _dict.get('resource_type')) is not None:
+ args['resource_type'] = resource_type
+ else:
+ raise ValueError('Required property \'resource_type\' not present in BareMetalServerNetworkInterfaceByPCI JSON')
+ if (security_groups := _dict.get('security_groups')) is not None:
+ args['security_groups'] = [SecurityGroupReference.from_dict(v) for v in security_groups]
+ else:
+ raise ValueError('Required property \'security_groups\' not present in BareMetalServerNetworkInterfaceByPCI JSON')
+ if (status := _dict.get('status')) is not None:
+ args['status'] = status
+ else:
+ raise ValueError('Required property \'status\' not present in BareMetalServerNetworkInterfaceByPCI JSON')
+ if (subnet := _dict.get('subnet')) is not None:
+ args['subnet'] = SubnetReference.from_dict(subnet)
+ else:
+ raise ValueError('Required property \'subnet\' not present in BareMetalServerNetworkInterfaceByPCI JSON')
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
+ else:
+ raise ValueError('Required property \'type\' not present in BareMetalServerNetworkInterfaceByPCI JSON')
+ if (allowed_vlans := _dict.get('allowed_vlans')) is not None:
+ args['allowed_vlans'] = allowed_vlans
+ else:
+ raise ValueError('Required property \'allowed_vlans\' not present in BareMetalServerNetworkInterfaceByPCI JSON')
+ if (interface_type := _dict.get('interface_type')) is not None:
+ args['interface_type'] = interface_type
+ else:
+ raise ValueError('Required property \'interface_type\' not present in BareMetalServerNetworkInterfaceByPCI JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a FloatingIPTargetBareMetalServerNetworkInterfaceReference 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, 'deleted') and self.deleted is not None:
- if isinstance(self.deleted, dict):
- _dict['deleted'] = self.deleted
- else:
- _dict['deleted'] = self.deleted.to_dict()
- if hasattr(self, 'href') and self.href is not None:
- _dict['href'] = self.href
- if hasattr(self, 'id') and self.id is not None:
- _dict['id'] = self.id
- if hasattr(self, 'name') and self.name is not None:
- _dict['name'] = self.name
- if hasattr(self, 'primary_ip') and self.primary_ip is not None:
- if isinstance(self.primary_ip, dict):
- _dict['primary_ip'] = self.primary_ip
- else:
- _dict['primary_ip'] = self.primary_ip.to_dict()
+ if hasattr(self, 'allow_ip_spoofing') and self.allow_ip_spoofing is not None:
+ _dict['allow_ip_spoofing'] = self.allow_ip_spoofing
+ if hasattr(self, 'created_at') and self.created_at is not None:
+ _dict['created_at'] = datetime_to_string(self.created_at)
+ if hasattr(self, 'enable_infrastructure_nat') and self.enable_infrastructure_nat is not None:
+ _dict['enable_infrastructure_nat'] = self.enable_infrastructure_nat
+ if hasattr(self, 'floating_ips') and self.floating_ips is not None:
+ floating_ips_list = []
+ for v in self.floating_ips:
+ if isinstance(v, dict):
+ floating_ips_list.append(v)
+ else:
+ floating_ips_list.append(v.to_dict())
+ _dict['floating_ips'] = floating_ips_list
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
+ if hasattr(self, 'id') and self.id is not None:
+ _dict['id'] = self.id
+ if hasattr(self, 'mac_address') and self.mac_address is not None:
+ _dict['mac_address'] = self.mac_address
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ if hasattr(self, 'port_speed') and self.port_speed is not None:
+ _dict['port_speed'] = self.port_speed
+ if hasattr(self, 'primary_ip') and self.primary_ip is not None:
+ if isinstance(self.primary_ip, dict):
+ _dict['primary_ip'] = self.primary_ip
+ else:
+ _dict['primary_ip'] = self.primary_ip.to_dict()
if hasattr(self, 'resource_type') and self.resource_type is not None:
_dict['resource_type'] = self.resource_type
+ if hasattr(self, 'security_groups') and self.security_groups is not None:
+ security_groups_list = []
+ for v in self.security_groups:
+ if isinstance(v, dict):
+ security_groups_list.append(v)
+ else:
+ security_groups_list.append(v.to_dict())
+ _dict['security_groups'] = security_groups_list
+ if hasattr(self, 'status') and self.status is not None:
+ _dict['status'] = self.status
+ if hasattr(self, 'subnet') and self.subnet is not None:
+ if isinstance(self.subnet, dict):
+ _dict['subnet'] = self.subnet
+ else:
+ _dict['subnet'] = self.subnet.to_dict()
+ if hasattr(self, 'type') and self.type is not None:
+ _dict['type'] = self.type
+ if hasattr(self, 'allowed_vlans') and self.allowed_vlans is not None:
+ _dict['allowed_vlans'] = self.allowed_vlans
+ if hasattr(self, 'interface_type') and self.interface_type is not None:
+ _dict['interface_type'] = self.interface_type
return _dict
def _to_dict(self):
@@ -94154,16 +99671,16 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this FloatingIPTargetBareMetalServerNetworkInterfaceReference object."""
+ """Return a `str` version of this BareMetalServerNetworkInterfaceByPCI object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'FloatingIPTargetBareMetalServerNetworkInterfaceReference') -> 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: 'FloatingIPTargetBareMetalServerNetworkInterfaceReference') -> bool:
+ def __ne__(self, other: 'BareMetalServerNetworkInterfaceByPCI') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
@@ -94175,99 +99692,473 @@ class ResourceTypeEnum(str, Enum):
NETWORK_INTERFACE = 'network_interface'
+ class StatusEnum(str, Enum):
+ """
+ The status of the bare metal server network interface.
+ If this bare metal server has network attachments, this network interface is a
+ read-only representation of its corresponding network attachment and its attached
+ virtual network interface, and the status is [computed from
+ them](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients).
+ """
-class FloatingIPTargetNetworkInterfaceReference(FloatingIPTarget):
+ AVAILABLE = 'available'
+ DELETING = 'deleting'
+ FAILED = 'failed'
+ PENDING = 'pending'
+
+
+ class TypeEnum(str, Enum):
+ """
+ The bare metal server network interface type.
+ If this bare metal server has network attachments, this network interface is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and the type is that of its corresponding network attachment.
+ """
+
+ PRIMARY = 'primary'
+ SECONDARY = 'secondary'
+
+
+ class InterfaceTypeEnum(str, Enum):
+ """
+ - `pci`: a physical PCI device which can only be created or deleted when the bare
+ metal
+ server is stopped
+ - Has an `allowed_vlans` property which controls the VLANs that will be
+ permitted
+ to use the PCI interface
+ - Cannot directly use an IEEE 802.1Q tag.
+ """
+
+ PCI = 'pci'
+
+
+
+class BareMetalServerNetworkInterfaceByVLAN(BareMetalServerNetworkInterface):
"""
- FloatingIPTargetNetworkInterfaceReference.
+ BareMetalServerNetworkInterfaceByVLAN.
- :attr NetworkInterfaceReferenceDeleted deleted: (optional) If present, this
- property indicates the referenced resource has been deleted, and provides
- some supplementary information.
- :attr str href: The URL for this instance network interface.
- :attr str id: The unique identifier for this instance network interface.
- :attr str name: The name for this instance network interface.
- :attr ReservedIPReference primary_ip:
- :attr str resource_type: The resource type.
+ :param bool allow_ip_spoofing: Indicates whether source IP spoofing is allowed
+ on this bare metal server network interface.
+ If this bare metal server has network attachments, this network interface is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and source IP spoofing is managed on the attached virtual network
+ interface.
+ :param datetime created_at: The date and time that the bare metal server network
+ interface was created.
+ If this bare metal server has network attachments, this network interface was
+ created as a [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ when its corresponding network attachment was created.
+ :param bool enable_infrastructure_nat: If `true`:
+ - The VPC infrastructure performs any needed NAT operations.
+ - `floating_ips` must not have more than one floating IP.
+ If `false`:
+ - Packets are passed unchanged to/from the bare metal server network interface,
+ allowing the workload to perform any needed NAT operations.
+ - `allow_ip_spoofing` must be `false`.
+ - `interface_type` must not be `hipersocket`.
+ If this bare metal server has network attachments, this network interface is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and infrastructure NAT is managed on the attached virtual network
+ interface.
+ :param List[FloatingIPReference] floating_ips: The floating IPs associated with
+ this bare metal server network interface.
+ If this bare metal server has network attachments, this network interface is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and the floating IPs are associated with the attached virtual network
+ interface.
+ :param str href: The URL for this bare metal server network interface.
+ If this bare metal server has network attachments, this network interface is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment.
+ :param str id: The unique identifier for this bare metal server network
+ interface.
+ If this bare metal server has network attachments, this network interface is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and the identifier is that of the corresponding network attachment.
+ :param str mac_address: The MAC address of this bare metal server network
+ interface. If the MAC address has not yet been selected, the value will be an
+ empty string.
+ If this bare metal server has network attachments, this network interface is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and the MAC address is that of the attached virtual network
+ interface.
+ :param str name: The name for this bare metal server network interface.
+ If this bare metal server has network attachments, this network interface is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and the name matches its corresponding network attachment.
+ :param int port_speed: The bare metal server network interface port speed in
+ Mbps.
+ If this bare metal server has network attachments, this network interface is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and the port speed is that of its corresponding network attachment.
+ :param ReservedIPReference primary_ip:
+ :param str resource_type: The resource type.
+ :param List[SecurityGroupReference] security_groups: The security groups
+ targeting this bare metal server network interface.
+ If this bare metal server has network attachments, this network interface is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and the security groups are associated with the attached virtual
+ network interface.
+ :param str status: The status of the bare metal server network interface.
+ If this bare metal server has network attachments, this network interface is a
+ read-only representation of its corresponding network attachment and its
+ attached virtual network interface, and the status is [computed from
+ them](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients).
+ :param SubnetReference subnet: The associated subnet.
+ :param str type: The bare metal server network interface type.
+ If this bare metal server has network attachments, this network interface is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and the type is that of its corresponding network attachment.
+ :param bool allow_interface_to_float: Indicates if the data path for the network
+ interface can float to another bare metal server. Can only be `true` for network
+ interfaces with an `interface_type` of `vlan`.
+ If `true`, and the network detects traffic for this data path on another bare
+ metal server in the resource group, the network interface will be automatically
+ deleted from this bare metal server and a new network interface with the same
+ `id`, `name` and `vlan` will be created on the other bare metal server.
+ For the data path to float, the other bare metal server must be in the same
+ `resource_group`, and must have a network interface with `interface_type` of
+ `pci` with `allowed_vlans` including this network interface's `vlan`.
+ If this bare metal server has network attachments, this network interface is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and the value of this property matches that of the `allow_to_float`
+ property of the corresponding network attachment.
+ :param str interface_type: - `vlan`: a virtual device, used through a `pci`
+ device that has the `vlan` in its array
+ of `allowed_vlans`.
+ - Must use an IEEE 802.1Q tag.
+ - Has its own security groups and does not inherit those of the PCI device
+ through
+ which traffic flows.
+ :param int vlan: The VLAN ID used in the IEEE 802.1Q tag present in all traffic
+ on this interface.
+ If this bare metal server has network attachments, this network interface is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and the VLAN ID matches the `vlan` of the corresponding network
+ attachment.
"""
def __init__(
self,
+ allow_ip_spoofing: bool,
+ created_at: datetime,
+ enable_infrastructure_nat: bool,
+ floating_ips: List['FloatingIPReference'],
href: str,
id: str,
+ mac_address: str,
name: str,
+ port_speed: int,
primary_ip: 'ReservedIPReference',
resource_type: str,
- *,
- deleted: 'NetworkInterfaceReferenceDeleted' = None,
+ security_groups: List['SecurityGroupReference'],
+ status: str,
+ subnet: 'SubnetReference',
+ type: str,
+ allow_interface_to_float: bool,
+ interface_type: str,
+ vlan: int,
) -> None:
"""
- Initialize a FloatingIPTargetNetworkInterfaceReference object.
+ Initialize a BareMetalServerNetworkInterfaceByVLAN object.
- :param str href: The URL for this instance network interface.
- :param str id: The unique identifier for this instance network interface.
- :param str name: The name for this instance network interface.
+ :param bool allow_ip_spoofing: Indicates whether source IP spoofing is
+ allowed on this bare metal server network interface.
+ If this bare metal server has network attachments, this network interface
+ is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and source IP spoofing is managed on the attached virtual
+ network interface.
+ :param datetime created_at: The date and time that the bare metal server
+ network interface was created.
+ If this bare metal server has network attachments, this network interface
+ was created as a [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ when its corresponding network attachment was created.
+ :param bool enable_infrastructure_nat: If `true`:
+ - The VPC infrastructure performs any needed NAT operations.
+ - `floating_ips` must not have more than one floating IP.
+ If `false`:
+ - Packets are passed unchanged to/from the bare metal server network
+ interface,
+ allowing the workload to perform any needed NAT operations.
+ - `allow_ip_spoofing` must be `false`.
+ - `interface_type` must not be `hipersocket`.
+ If this bare metal server has network attachments, this network interface
+ is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and infrastructure NAT is managed on the attached virtual
+ network interface.
+ :param List[FloatingIPReference] floating_ips: The floating IPs associated
+ with this bare metal server network interface.
+ If this bare metal server has network attachments, this network interface
+ is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and the floating IPs are associated with the attached virtual
+ network interface.
+ :param str href: The URL for this bare metal server network interface.
+ If this bare metal server has network attachments, this network interface
+ is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment.
+ :param str id: The unique identifier for this bare metal server network
+ interface.
+ If this bare metal server has network attachments, this network interface
+ is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and the identifier is that of the corresponding network
+ attachment.
+ :param str mac_address: The MAC address of this bare metal server network
+ interface. If the MAC address has not yet been selected, the value will be
+ an empty string.
+ If this bare metal server has network attachments, this network interface
+ is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and the MAC address is that of the attached virtual network
+ interface.
+ :param str name: The name for this bare metal server network interface.
+ If this bare metal server has network attachments, this network interface
+ is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and the name matches its corresponding network attachment.
+ :param int port_speed: The bare metal server network interface port speed
+ in Mbps.
+ If this bare metal server has network attachments, this network interface
+ is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and the port speed is that of its corresponding network
+ attachment.
:param ReservedIPReference primary_ip:
:param str resource_type: The resource type.
- :param NetworkInterfaceReferenceDeleted deleted: (optional) If present,
- this property indicates the referenced resource has been deleted, and
- provides
- some supplementary information.
+ :param List[SecurityGroupReference] security_groups: The security groups
+ targeting this bare metal server network interface.
+ If this bare metal server has network attachments, this network interface
+ is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and the security groups are associated with the attached virtual
+ network interface.
+ :param str status: The status of the bare metal server network interface.
+ If this bare metal server has network attachments, this network interface
+ is a read-only representation of its corresponding network attachment and
+ its attached virtual network interface, and the status is [computed from
+ them](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients).
+ :param SubnetReference subnet: The associated subnet.
+ :param str type: The bare metal server network interface type.
+ If this bare metal server has network attachments, this network interface
+ is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and the type is that of its corresponding network attachment.
+ :param bool allow_interface_to_float: Indicates if the data path for the
+ network interface can float to another bare metal server. Can only be
+ `true` for network interfaces with an `interface_type` of `vlan`.
+ If `true`, and the network detects traffic for this data path on another
+ bare metal server in the resource group, the network interface will be
+ automatically deleted from this bare metal server and a new network
+ interface with the same `id`, `name` and `vlan` will be created on the
+ other bare metal server.
+ For the data path to float, the other bare metal server must be in the same
+ `resource_group`, and must have a network interface with `interface_type`
+ of `pci` with `allowed_vlans` including this network interface's `vlan`.
+ If this bare metal server has network attachments, this network interface
+ is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and the value of this property matches that of the
+ `allow_to_float` property of the corresponding network attachment.
+ :param str interface_type: - `vlan`: a virtual device, used through a `pci`
+ device that has the `vlan` in its array
+ of `allowed_vlans`.
+ - Must use an IEEE 802.1Q tag.
+ - Has its own security groups and does not inherit those of the PCI
+ device through
+ which traffic flows.
+ :param int vlan: The VLAN ID used in the IEEE 802.1Q tag present in all
+ traffic on this interface.
+ If this bare metal server has network attachments, this network interface
+ is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and the VLAN ID matches the `vlan` of the corresponding network
+ attachment.
"""
# pylint: disable=super-init-not-called
- self.deleted = deleted
+ self.allow_ip_spoofing = allow_ip_spoofing
+ self.created_at = created_at
+ self.enable_infrastructure_nat = enable_infrastructure_nat
+ self.floating_ips = floating_ips
self.href = href
self.id = id
+ self.mac_address = mac_address
self.name = name
+ self.port_speed = port_speed
self.primary_ip = primary_ip
self.resource_type = resource_type
+ self.security_groups = security_groups
+ self.status = status
+ self.subnet = subnet
+ self.type = type
+ self.allow_interface_to_float = allow_interface_to_float
+ self.interface_type = interface_type
+ self.vlan = vlan
@classmethod
- def from_dict(cls, _dict: Dict) -> 'FloatingIPTargetNetworkInterfaceReference':
- """Initialize a FloatingIPTargetNetworkInterfaceReference object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'BareMetalServerNetworkInterfaceByVLAN':
+ """Initialize a BareMetalServerNetworkInterfaceByVLAN object from a json dictionary."""
args = {}
- if 'deleted' in _dict:
- args['deleted'] = NetworkInterfaceReferenceDeleted.from_dict(_dict.get('deleted'))
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ if (allow_ip_spoofing := _dict.get('allow_ip_spoofing')) is not None:
+ args['allow_ip_spoofing'] = allow_ip_spoofing
else:
- raise ValueError('Required property \'href\' not present in FloatingIPTargetNetworkInterfaceReference JSON')
- if 'id' in _dict:
- args['id'] = _dict.get('id')
+ raise ValueError('Required property \'allow_ip_spoofing\' not present in BareMetalServerNetworkInterfaceByVLAN JSON')
+ if (created_at := _dict.get('created_at')) is not None:
+ args['created_at'] = string_to_datetime(created_at)
else:
- raise ValueError('Required property \'id\' not present in FloatingIPTargetNetworkInterfaceReference JSON')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
+ raise ValueError('Required property \'created_at\' not present in BareMetalServerNetworkInterfaceByVLAN JSON')
+ if (enable_infrastructure_nat := _dict.get('enable_infrastructure_nat')) is not None:
+ args['enable_infrastructure_nat'] = enable_infrastructure_nat
else:
- raise ValueError('Required property \'name\' not present in FloatingIPTargetNetworkInterfaceReference JSON')
- if 'primary_ip' in _dict:
- args['primary_ip'] = ReservedIPReference.from_dict(_dict.get('primary_ip'))
+ raise ValueError('Required property \'enable_infrastructure_nat\' not present in BareMetalServerNetworkInterfaceByVLAN JSON')
+ if (floating_ips := _dict.get('floating_ips')) is not None:
+ args['floating_ips'] = [FloatingIPReference.from_dict(v) for v in floating_ips]
else:
- raise ValueError('Required property \'primary_ip\' not present in FloatingIPTargetNetworkInterfaceReference JSON')
- if 'resource_type' in _dict:
- args['resource_type'] = _dict.get('resource_type')
+ raise ValueError('Required property \'floating_ips\' not present in BareMetalServerNetworkInterfaceByVLAN JSON')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'resource_type\' not present in FloatingIPTargetNetworkInterfaceReference JSON')
+ raise ValueError('Required property \'href\' not present in BareMetalServerNetworkInterfaceByVLAN JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
+ else:
+ raise ValueError('Required property \'id\' not present in BareMetalServerNetworkInterfaceByVLAN JSON')
+ if (mac_address := _dict.get('mac_address')) is not None:
+ args['mac_address'] = mac_address
+ else:
+ raise ValueError('Required property \'mac_address\' not present in BareMetalServerNetworkInterfaceByVLAN JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ else:
+ raise ValueError('Required property \'name\' not present in BareMetalServerNetworkInterfaceByVLAN JSON')
+ if (port_speed := _dict.get('port_speed')) is not None:
+ args['port_speed'] = port_speed
+ else:
+ raise ValueError('Required property \'port_speed\' not present in BareMetalServerNetworkInterfaceByVLAN JSON')
+ if (primary_ip := _dict.get('primary_ip')) is not None:
+ args['primary_ip'] = ReservedIPReference.from_dict(primary_ip)
+ else:
+ raise ValueError('Required property \'primary_ip\' not present in BareMetalServerNetworkInterfaceByVLAN JSON')
+ if (resource_type := _dict.get('resource_type')) is not None:
+ args['resource_type'] = resource_type
+ else:
+ raise ValueError('Required property \'resource_type\' not present in BareMetalServerNetworkInterfaceByVLAN JSON')
+ if (security_groups := _dict.get('security_groups')) is not None:
+ args['security_groups'] = [SecurityGroupReference.from_dict(v) for v in security_groups]
+ else:
+ raise ValueError('Required property \'security_groups\' not present in BareMetalServerNetworkInterfaceByVLAN JSON')
+ if (status := _dict.get('status')) is not None:
+ args['status'] = status
+ else:
+ raise ValueError('Required property \'status\' not present in BareMetalServerNetworkInterfaceByVLAN JSON')
+ if (subnet := _dict.get('subnet')) is not None:
+ args['subnet'] = SubnetReference.from_dict(subnet)
+ else:
+ raise ValueError('Required property \'subnet\' not present in BareMetalServerNetworkInterfaceByVLAN JSON')
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
+ else:
+ raise ValueError('Required property \'type\' not present in BareMetalServerNetworkInterfaceByVLAN JSON')
+ if (allow_interface_to_float := _dict.get('allow_interface_to_float')) is not None:
+ args['allow_interface_to_float'] = allow_interface_to_float
+ else:
+ raise ValueError('Required property \'allow_interface_to_float\' not present in BareMetalServerNetworkInterfaceByVLAN JSON')
+ if (interface_type := _dict.get('interface_type')) is not None:
+ args['interface_type'] = interface_type
+ else:
+ raise ValueError('Required property \'interface_type\' not present in BareMetalServerNetworkInterfaceByVLAN JSON')
+ if (vlan := _dict.get('vlan')) is not None:
+ args['vlan'] = vlan
+ else:
+ raise ValueError('Required property \'vlan\' not present in BareMetalServerNetworkInterfaceByVLAN JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a FloatingIPTargetNetworkInterfaceReference 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, 'deleted') and self.deleted is not None:
- if isinstance(self.deleted, dict):
- _dict['deleted'] = self.deleted
- else:
- _dict['deleted'] = self.deleted.to_dict()
+ if hasattr(self, 'allow_ip_spoofing') and self.allow_ip_spoofing is not None:
+ _dict['allow_ip_spoofing'] = self.allow_ip_spoofing
+ if hasattr(self, 'created_at') and self.created_at is not None:
+ _dict['created_at'] = datetime_to_string(self.created_at)
+ if hasattr(self, 'enable_infrastructure_nat') and self.enable_infrastructure_nat is not None:
+ _dict['enable_infrastructure_nat'] = self.enable_infrastructure_nat
+ if hasattr(self, 'floating_ips') and self.floating_ips is not None:
+ floating_ips_list = []
+ for v in self.floating_ips:
+ if isinstance(v, dict):
+ floating_ips_list.append(v)
+ else:
+ floating_ips_list.append(v.to_dict())
+ _dict['floating_ips'] = floating_ips_list
if hasattr(self, 'href') and self.href is not None:
_dict['href'] = self.href
if hasattr(self, 'id') and self.id is not None:
_dict['id'] = self.id
+ if hasattr(self, 'mac_address') and self.mac_address is not None:
+ _dict['mac_address'] = self.mac_address
if hasattr(self, 'name') and self.name is not None:
_dict['name'] = self.name
+ if hasattr(self, 'port_speed') and self.port_speed is not None:
+ _dict['port_speed'] = self.port_speed
if hasattr(self, 'primary_ip') and self.primary_ip is not None:
if isinstance(self.primary_ip, dict):
_dict['primary_ip'] = self.primary_ip
@@ -94275,6 +100166,29 @@ def to_dict(self) -> Dict:
_dict['primary_ip'] = self.primary_ip.to_dict()
if hasattr(self, 'resource_type') and self.resource_type is not None:
_dict['resource_type'] = self.resource_type
+ if hasattr(self, 'security_groups') and self.security_groups is not None:
+ security_groups_list = []
+ for v in self.security_groups:
+ if isinstance(v, dict):
+ security_groups_list.append(v)
+ else:
+ security_groups_list.append(v.to_dict())
+ _dict['security_groups'] = security_groups_list
+ if hasattr(self, 'status') and self.status is not None:
+ _dict['status'] = self.status
+ if hasattr(self, 'subnet') and self.subnet is not None:
+ if isinstance(self.subnet, dict):
+ _dict['subnet'] = self.subnet
+ else:
+ _dict['subnet'] = self.subnet.to_dict()
+ if hasattr(self, 'type') and self.type is not None:
+ _dict['type'] = self.type
+ if hasattr(self, 'allow_interface_to_float') and self.allow_interface_to_float is not None:
+ _dict['allow_interface_to_float'] = self.allow_interface_to_float
+ if hasattr(self, 'interface_type') and self.interface_type is not None:
+ _dict['interface_type'] = self.interface_type
+ if hasattr(self, 'vlan') and self.vlan is not None:
+ _dict['vlan'] = self.vlan
return _dict
def _to_dict(self):
@@ -94282,16 +100196,16 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this FloatingIPTargetNetworkInterfaceReference object."""
+ """Return a `str` version of this BareMetalServerNetworkInterfaceByVLAN object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'FloatingIPTargetNetworkInterfaceReference') -> 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: 'FloatingIPTargetNetworkInterfaceReference') -> bool:
+ def __ne__(self, other: 'BareMetalServerNetworkInterfaceByVLAN') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
@@ -94303,104 +100217,225 @@ class ResourceTypeEnum(str, Enum):
NETWORK_INTERFACE = 'network_interface'
+ class StatusEnum(str, Enum):
+ """
+ The status of the bare metal server network interface.
+ If this bare metal server has network attachments, this network interface is a
+ read-only representation of its corresponding network attachment and its attached
+ virtual network interface, and the status is [computed from
+ them](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients).
+ """
+
+ AVAILABLE = 'available'
+ DELETING = 'deleting'
+ FAILED = 'failed'
+ PENDING = 'pending'
+
-class FloatingIPTargetPublicGatewayReference(FloatingIPTarget):
+ class TypeEnum(str, Enum):
+ """
+ The bare metal server network interface type.
+ If this bare metal server has network attachments, this network interface is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and the type is that of its corresponding network attachment.
+ """
+
+ PRIMARY = 'primary'
+ SECONDARY = 'secondary'
+
+
+ class InterfaceTypeEnum(str, Enum):
+ """
+ - `vlan`: a virtual device, used through a `pci` device that has the `vlan` in its
+ array
+ of `allowed_vlans`.
+ - Must use an IEEE 802.1Q tag.
+ - Has its own security groups and does not inherit those of the PCI device
+ through
+ which traffic flows.
+ """
+
+ VLAN = 'vlan'
+
+
+
+class BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype(BareMetalServerNetworkInterfacePrototype):
"""
- FloatingIPTargetPublicGatewayReference.
+ BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype.
- :attr str crn: The CRN for this public gateway.
- :attr PublicGatewayReferenceDeleted deleted: (optional) If present, this
- property indicates the referenced resource has been deleted, and provides
- some supplementary information.
- :attr str href: The URL for this public gateway.
- :attr str id: The unique identifier for this public gateway.
- :attr str name: The name for this public gateway. The name is unique across all
- public gateways in the VPC.
- :attr str resource_type: The resource type.
+ :param bool allow_ip_spoofing: (optional) Indicates whether source IP spoofing
+ is allowed on this bare metal server network interface.
+ If this bare metal server has network attachments, this network interface is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and source IP spoofing is managed on the attached virtual network
+ interface.
+ :param bool enable_infrastructure_nat: (optional) If `true`:
+ - The VPC infrastructure performs any needed NAT operations.
+ - `floating_ips` must not have more than one floating IP.
+ If `false`:
+ - Packets are passed unchanged to/from the bare metal server network interface,
+ allowing the workload to perform any needed NAT operations.
+ - `allow_ip_spoofing` must be `false`.
+ - `interface_type` must not be `hipersocket`.
+ If this bare metal server has network attachments, this network interface is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and infrastructure NAT is managed on the attached virtual network
+ interface.
+ :param str name: (optional) The name for this bare metal server network
+ interface. The name must not be used by another network interface on the bare
+ metal server. If unspecified, the name will be a hyphenated list of
+ randomly-selected words.
+ :param NetworkInterfaceIPPrototype primary_ip: (optional) The primary IP address
+ to bind to the bare metal server network interface. This can be specified using
+ an existing reserved IP, or a prototype object for a new reserved IP.
+ If an existing reserved IP or a prototype object with an address is specified,
+ it must be available on the bare metal server network interface's subnet.
+ Otherwise, an available address on the subnet will be automatically selected and
+ reserved.
+ :param List[SecurityGroupIdentity] security_groups: (optional) The security
+ groups to use for this bare metal server network interface. If unspecified, the
+ VPC's default security group is used.
+ :param SubnetIdentity subnet: The associated subnet.
+ :param str interface_type: - `hipersocket`: a virtual network device that
+ provides high-speed TCP/IP connectivity
+ within a `s390x` based system.
+ - Not supported on bare metal servers with a `cpu.architecture` of `amd64`.
"""
def __init__(
self,
- crn: str,
- href: str,
- id: str,
- name: str,
- resource_type: str,
+ subnet: 'SubnetIdentity',
+ interface_type: str,
*,
- deleted: 'PublicGatewayReferenceDeleted' = None,
+ allow_ip_spoofing: Optional[bool] = None,
+ enable_infrastructure_nat: Optional[bool] = None,
+ name: Optional[str] = None,
+ primary_ip: Optional['NetworkInterfaceIPPrototype'] = None,
+ security_groups: Optional[List['SecurityGroupIdentity']] = None,
) -> None:
"""
- Initialize a FloatingIPTargetPublicGatewayReference object.
+ Initialize a BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype object.
- :param str crn: The CRN for this public gateway.
- :param str href: The URL for this public gateway.
- :param str id: The unique identifier for this public gateway.
- :param str name: The name for this public gateway. The name is unique
- across all public gateways in the VPC.
- :param str resource_type: The resource type.
- :param PublicGatewayReferenceDeleted deleted: (optional) If present, this
- property indicates the referenced resource has been deleted, and provides
- some supplementary information.
+ :param SubnetIdentity subnet: The associated subnet.
+ :param str interface_type: - `hipersocket`: a virtual network device that
+ provides high-speed TCP/IP connectivity
+ within a `s390x` based system.
+ - Not supported on bare metal servers with a `cpu.architecture` of
+ `amd64`.
+ :param bool allow_ip_spoofing: (optional) Indicates whether source IP
+ spoofing is allowed on this bare metal server network interface.
+ If this bare metal server has network attachments, this network interface
+ is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and source IP spoofing is managed on the attached virtual
+ network interface.
+ :param bool enable_infrastructure_nat: (optional) If `true`:
+ - The VPC infrastructure performs any needed NAT operations.
+ - `floating_ips` must not have more than one floating IP.
+ If `false`:
+ - Packets are passed unchanged to/from the bare metal server network
+ interface,
+ allowing the workload to perform any needed NAT operations.
+ - `allow_ip_spoofing` must be `false`.
+ - `interface_type` must not be `hipersocket`.
+ If this bare metal server has network attachments, this network interface
+ is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and infrastructure NAT is managed on the attached virtual
+ network interface.
+ :param str name: (optional) The name for this bare metal server network
+ interface. The name must not be used by another network interface on the
+ bare metal server. If unspecified, the name will be a hyphenated list of
+ randomly-selected words.
+ :param NetworkInterfaceIPPrototype primary_ip: (optional) The primary IP
+ address to bind to the bare metal server network interface. This can be
+ specified using an existing reserved IP, or a prototype object for a new
+ reserved IP.
+ If an existing reserved IP or a prototype object with an address is
+ specified, it must be available on the bare metal server network
+ interface's subnet. Otherwise, an available address on the subnet will be
+ automatically selected and reserved.
+ :param List[SecurityGroupIdentity] security_groups: (optional) The security
+ groups to use for this bare metal server network interface. If unspecified,
+ the VPC's default security group is used.
"""
# pylint: disable=super-init-not-called
- self.crn = crn
- self.deleted = deleted
- self.href = href
- self.id = id
+ self.allow_ip_spoofing = allow_ip_spoofing
+ self.enable_infrastructure_nat = enable_infrastructure_nat
self.name = name
- self.resource_type = resource_type
+ self.primary_ip = primary_ip
+ self.security_groups = security_groups
+ self.subnet = subnet
+ self.interface_type = interface_type
@classmethod
- def from_dict(cls, _dict: Dict) -> 'FloatingIPTargetPublicGatewayReference':
- """Initialize a FloatingIPTargetPublicGatewayReference object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype':
+ """Initialize a BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype object from a json dictionary."""
args = {}
- if 'crn' in _dict:
- args['crn'] = _dict.get('crn')
+ if (allow_ip_spoofing := _dict.get('allow_ip_spoofing')) is not None:
+ args['allow_ip_spoofing'] = allow_ip_spoofing
+ if (enable_infrastructure_nat := _dict.get('enable_infrastructure_nat')) is not None:
+ args['enable_infrastructure_nat'] = enable_infrastructure_nat
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ if (primary_ip := _dict.get('primary_ip')) is not None:
+ args['primary_ip'] = primary_ip
+ if (security_groups := _dict.get('security_groups')) is not None:
+ args['security_groups'] = security_groups
+ if (subnet := _dict.get('subnet')) is not None:
+ args['subnet'] = subnet
else:
- raise ValueError('Required property \'crn\' not present in FloatingIPTargetPublicGatewayReference JSON')
- if 'deleted' in _dict:
- args['deleted'] = PublicGatewayReferenceDeleted.from_dict(_dict.get('deleted'))
- if 'href' in _dict:
- args['href'] = _dict.get('href')
- else:
- raise ValueError('Required property \'href\' not present in FloatingIPTargetPublicGatewayReference JSON')
- if 'id' in _dict:
- args['id'] = _dict.get('id')
- else:
- raise ValueError('Required property \'id\' not present in FloatingIPTargetPublicGatewayReference JSON')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
- else:
- raise ValueError('Required property \'name\' not present in FloatingIPTargetPublicGatewayReference JSON')
- if 'resource_type' in _dict:
- args['resource_type'] = _dict.get('resource_type')
+ raise ValueError('Required property \'subnet\' not present in BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype JSON')
+ if (interface_type := _dict.get('interface_type')) is not None:
+ args['interface_type'] = interface_type
else:
- raise ValueError('Required property \'resource_type\' not present in FloatingIPTargetPublicGatewayReference JSON')
+ raise ValueError('Required property \'interface_type\' not present in BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a FloatingIPTargetPublicGatewayReference object from a json dictionary."""
+ """Initialize a BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'crn') and self.crn is not None:
- _dict['crn'] = self.crn
- if hasattr(self, 'deleted') and self.deleted is not None:
- if isinstance(self.deleted, dict):
- _dict['deleted'] = self.deleted
- else:
- _dict['deleted'] = self.deleted.to_dict()
- if hasattr(self, 'href') and self.href is not None:
- _dict['href'] = self.href
- if hasattr(self, 'id') and self.id is not None:
- _dict['id'] = self.id
+ if hasattr(self, 'allow_ip_spoofing') and self.allow_ip_spoofing is not None:
+ _dict['allow_ip_spoofing'] = self.allow_ip_spoofing
+ if hasattr(self, 'enable_infrastructure_nat') and self.enable_infrastructure_nat is not None:
+ _dict['enable_infrastructure_nat'] = self.enable_infrastructure_nat
if hasattr(self, 'name') and self.name is not None:
_dict['name'] = self.name
- if hasattr(self, 'resource_type') and self.resource_type is not None:
- _dict['resource_type'] = self.resource_type
+ if hasattr(self, 'primary_ip') and self.primary_ip is not None:
+ if isinstance(self.primary_ip, dict):
+ _dict['primary_ip'] = self.primary_ip
+ else:
+ _dict['primary_ip'] = self.primary_ip.to_dict()
+ if hasattr(self, 'security_groups') and self.security_groups is not None:
+ security_groups_list = []
+ for v in self.security_groups:
+ if isinstance(v, dict):
+ security_groups_list.append(v)
+ else:
+ security_groups_list.append(v.to_dict())
+ _dict['security_groups'] = security_groups_list
+ if hasattr(self, 'subnet') and self.subnet is not None:
+ if isinstance(self.subnet, dict):
+ _dict['subnet'] = self.subnet
+ else:
+ _dict['subnet'] = self.subnet.to_dict()
+ if hasattr(self, 'interface_type') and self.interface_type is not None:
+ _dict['interface_type'] = self.interface_type
return _dict
def _to_dict(self):
@@ -94408,195 +100443,508 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this FloatingIPTargetPublicGatewayReference object."""
+ """Return a `str` version of this BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'FloatingIPTargetPublicGatewayReference') -> bool:
+ def __eq__(self, other: 'BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'FloatingIPTargetPublicGatewayReference') -> bool:
+ def __ne__(self, other: 'BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class ResourceTypeEnum(str, Enum):
+ class InterfaceTypeEnum(str, Enum):
"""
- The resource type.
+ - `hipersocket`: a virtual network device that provides high-speed TCP/IP
+ connectivity
+ within a `s390x` based system.
+ - Not supported on bare metal servers with a `cpu.architecture` of `amd64`.
"""
- PUBLIC_GATEWAY = 'public_gateway'
+ HIPERSOCKET = 'hipersocket'
-class FlowLogCollectorTargetPrototypeInstanceIdentity(FlowLogCollectorTargetPrototype):
+class BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPCIPrototype(BareMetalServerNetworkInterfacePrototype):
"""
- Identifies a virtual server instance by a unique property.
+ BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPCIPrototype.
+ :param bool allow_ip_spoofing: (optional) Indicates whether source IP spoofing
+ is allowed on this bare metal server network interface.
+ If this bare metal server has network attachments, this network interface is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and source IP spoofing is managed on the attached virtual network
+ interface.
+ :param bool enable_infrastructure_nat: (optional) If `true`:
+ - The VPC infrastructure performs any needed NAT operations.
+ - `floating_ips` must not have more than one floating IP.
+ If `false`:
+ - Packets are passed unchanged to/from the bare metal server network interface,
+ allowing the workload to perform any needed NAT operations.
+ - `allow_ip_spoofing` must be `false`.
+ - `interface_type` must not be `hipersocket`.
+ If this bare metal server has network attachments, this network interface is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and infrastructure NAT is managed on the attached virtual network
+ interface.
+ :param str name: (optional) The name for this bare metal server network
+ interface. The name must not be used by another network interface on the bare
+ metal server. If unspecified, the name will be a hyphenated list of
+ randomly-selected words.
+ :param NetworkInterfaceIPPrototype primary_ip: (optional) The primary IP address
+ to bind to the bare metal server network interface. This can be specified using
+ an existing reserved IP, or a prototype object for a new reserved IP.
+ If an existing reserved IP or a prototype object with an address is specified,
+ it must be available on the bare metal server network interface's subnet.
+ Otherwise, an available address on the subnet will be automatically selected and
+ reserved.
+ :param List[SecurityGroupIdentity] security_groups: (optional) The security
+ groups to use for this bare metal server network interface. If unspecified, the
+ VPC's default security group is used.
+ :param SubnetIdentity subnet: The associated subnet.
+ :param List[int] allowed_vlans: (optional) The VLAN IDs to allow for `vlan`
+ interfaces using this PCI interface.
+ :param str interface_type: - `pci`: a physical PCI device which can only be
+ created or deleted when the bare metal
+ server is stopped
+ - Has an `allowed_vlans` property which controls the VLANs that will be
+ permitted
+ to use the PCI interface
+ - Cannot directly use an IEEE 802.1Q tag.
+ - Not supported on bare metal servers with a `cpu.architecture` of `s390x`.
"""
def __init__(
self,
+ subnet: 'SubnetIdentity',
+ interface_type: str,
+ *,
+ allow_ip_spoofing: Optional[bool] = None,
+ enable_infrastructure_nat: Optional[bool] = None,
+ name: Optional[str] = None,
+ primary_ip: Optional['NetworkInterfaceIPPrototype'] = None,
+ security_groups: Optional[List['SecurityGroupIdentity']] = None,
+ allowed_vlans: Optional[List[int]] = None,
) -> None:
"""
- Initialize a FlowLogCollectorTargetPrototypeInstanceIdentity object.
+ Initialize a BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPCIPrototype object.
+ :param SubnetIdentity subnet: The associated subnet.
+ :param str interface_type: - `pci`: a physical PCI device which can only be
+ created or deleted when the bare metal
+ server is stopped
+ - Has an `allowed_vlans` property which controls the VLANs that will be
+ permitted
+ to use the PCI interface
+ - Cannot directly use an IEEE 802.1Q tag.
+ - Not supported on bare metal servers with a `cpu.architecture` of
+ `s390x`.
+ :param bool allow_ip_spoofing: (optional) Indicates whether source IP
+ spoofing is allowed on this bare metal server network interface.
+ If this bare metal server has network attachments, this network interface
+ is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and source IP spoofing is managed on the attached virtual
+ network interface.
+ :param bool enable_infrastructure_nat: (optional) If `true`:
+ - The VPC infrastructure performs any needed NAT operations.
+ - `floating_ips` must not have more than one floating IP.
+ If `false`:
+ - Packets are passed unchanged to/from the bare metal server network
+ interface,
+ allowing the workload to perform any needed NAT operations.
+ - `allow_ip_spoofing` must be `false`.
+ - `interface_type` must not be `hipersocket`.
+ If this bare metal server has network attachments, this network interface
+ is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and infrastructure NAT is managed on the attached virtual
+ network interface.
+ :param str name: (optional) The name for this bare metal server network
+ interface. The name must not be used by another network interface on the
+ bare metal server. If unspecified, the name will be a hyphenated list of
+ randomly-selected words.
+ :param NetworkInterfaceIPPrototype primary_ip: (optional) The primary IP
+ address to bind to the bare metal server network interface. This can be
+ specified using an existing reserved IP, or a prototype object for a new
+ reserved IP.
+ If an existing reserved IP or a prototype object with an address is
+ specified, it must be available on the bare metal server network
+ interface's subnet. Otherwise, an available address on the subnet will be
+ automatically selected and reserved.
+ :param List[SecurityGroupIdentity] security_groups: (optional) The security
+ groups to use for this bare metal server network interface. If unspecified,
+ the VPC's default security group is used.
+ :param List[int] allowed_vlans: (optional) The VLAN IDs to allow for `vlan`
+ interfaces using this PCI interface.
"""
# pylint: disable=super-init-not-called
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityById', 'FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByCRN', 'FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByHref'])
- )
- raise Exception(msg)
-
+ self.allow_ip_spoofing = allow_ip_spoofing
+ self.enable_infrastructure_nat = enable_infrastructure_nat
+ self.name = name
+ self.primary_ip = primary_ip
+ self.security_groups = security_groups
+ self.subnet = subnet
+ self.allowed_vlans = allowed_vlans
+ self.interface_type = interface_type
-class FlowLogCollectorTargetPrototypeNetworkInterfaceIdentity(FlowLogCollectorTargetPrototype):
- """
- Identifies an instance network interface by a unique property.
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPCIPrototype':
+ """Initialize a BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPCIPrototype object from a json dictionary."""
+ args = {}
+ if (allow_ip_spoofing := _dict.get('allow_ip_spoofing')) is not None:
+ args['allow_ip_spoofing'] = allow_ip_spoofing
+ if (enable_infrastructure_nat := _dict.get('enable_infrastructure_nat')) is not None:
+ args['enable_infrastructure_nat'] = enable_infrastructure_nat
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ if (primary_ip := _dict.get('primary_ip')) is not None:
+ args['primary_ip'] = primary_ip
+ if (security_groups := _dict.get('security_groups')) is not None:
+ args['security_groups'] = security_groups
+ if (subnet := _dict.get('subnet')) is not None:
+ args['subnet'] = subnet
+ else:
+ raise ValueError('Required property \'subnet\' not present in BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPCIPrototype JSON')
+ if (allowed_vlans := _dict.get('allowed_vlans')) is not None:
+ args['allowed_vlans'] = allowed_vlans
+ if (interface_type := _dict.get('interface_type')) is not None:
+ args['interface_type'] = interface_type
+ else:
+ raise ValueError('Required property \'interface_type\' not present in BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPCIPrototype JSON')
+ return cls(**args)
- """
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPCIPrototype object from a json dictionary."""
+ return cls.from_dict(_dict)
- def __init__(
- self,
- ) -> None:
- """
- Initialize a FlowLogCollectorTargetPrototypeNetworkInterfaceIdentity object.
+ def to_dict(self) -> Dict:
+ """Return a json dictionary representing this model."""
+ _dict = {}
+ if hasattr(self, 'allow_ip_spoofing') and self.allow_ip_spoofing is not None:
+ _dict['allow_ip_spoofing'] = self.allow_ip_spoofing
+ if hasattr(self, 'enable_infrastructure_nat') and self.enable_infrastructure_nat is not None:
+ _dict['enable_infrastructure_nat'] = self.enable_infrastructure_nat
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ if hasattr(self, 'primary_ip') and self.primary_ip is not None:
+ if isinstance(self.primary_ip, dict):
+ _dict['primary_ip'] = self.primary_ip
+ else:
+ _dict['primary_ip'] = self.primary_ip.to_dict()
+ if hasattr(self, 'security_groups') and self.security_groups is not None:
+ security_groups_list = []
+ for v in self.security_groups:
+ if isinstance(v, dict):
+ security_groups_list.append(v)
+ else:
+ security_groups_list.append(v.to_dict())
+ _dict['security_groups'] = security_groups_list
+ if hasattr(self, 'subnet') and self.subnet is not None:
+ if isinstance(self.subnet, dict):
+ _dict['subnet'] = self.subnet
+ else:
+ _dict['subnet'] = self.subnet.to_dict()
+ if hasattr(self, 'allowed_vlans') and self.allowed_vlans is not None:
+ _dict['allowed_vlans'] = self.allowed_vlans
+ if hasattr(self, 'interface_type') and self.interface_type is not None:
+ _dict['interface_type'] = self.interface_type
+ return _dict
- """
- # pylint: disable=super-init-not-called
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityById', 'FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref'])
- )
- raise Exception(msg)
+ def _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)
-class FlowLogCollectorTargetPrototypeSubnetIdentity(FlowLogCollectorTargetPrototype):
- """
- Identifies a subnet by a unique property.
+ 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
- def __init__(
- self,
- ) -> None:
+ class InterfaceTypeEnum(str, Enum):
"""
- Initialize a FlowLogCollectorTargetPrototypeSubnetIdentity object.
-
+ - `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 tag.
+ - Not supported on bare metal servers with a `cpu.architecture` of `s390x`.
"""
- # pylint: disable=super-init-not-called
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityById', 'FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByCRN', 'FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByHref'])
- )
- raise Exception(msg)
-
-
-class FlowLogCollectorTargetPrototypeVPCIdentity(FlowLogCollectorTargetPrototype):
- """
- Identifies a VPC by a unique property.
- """
-
- def __init__(
- self,
- ) -> None:
- """
- Initialize a FlowLogCollectorTargetPrototypeVPCIdentity object.
+ PCI = 'pci'
- """
- # pylint: disable=super-init-not-called
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityById', 'FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByCRN', 'FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByHref'])
- )
- raise Exception(msg)
-class FlowLogCollectorTargetInstanceReference(FlowLogCollectorTarget):
+class BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVLANPrototype(BareMetalServerNetworkInterfacePrototype):
"""
- FlowLogCollectorTargetInstanceReference.
+ BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVLANPrototype.
- :attr str crn: The CRN for this virtual server instance.
- :attr InstanceReferenceDeleted deleted: (optional) If present, this property
- indicates the referenced resource has been deleted, and provides
- some supplementary information.
- :attr str href: The URL for this virtual server instance.
- :attr str id: The unique identifier for this virtual server instance.
- :attr str name: The name for this virtual server instance. The name is unique
- across all virtual server instances in the region.
+ :param bool allow_ip_spoofing: (optional) Indicates whether source IP spoofing
+ is allowed on this bare metal server network interface.
+ If this bare metal server has network attachments, this network interface is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and source IP spoofing is managed on the attached virtual network
+ interface.
+ :param bool enable_infrastructure_nat: (optional) If `true`:
+ - The VPC infrastructure performs any needed NAT operations.
+ - `floating_ips` must not have more than one floating IP.
+ If `false`:
+ - Packets are passed unchanged to/from the bare metal server network interface,
+ allowing the workload to perform any needed NAT operations.
+ - `allow_ip_spoofing` must be `false`.
+ - `interface_type` must not be `hipersocket`.
+ If this bare metal server has network attachments, this network interface is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and infrastructure NAT is managed on the attached virtual network
+ interface.
+ :param str name: (optional) The name for this bare metal server network
+ interface. The name must not be used by another network interface on the bare
+ metal server. If unspecified, the name will be a hyphenated list of
+ randomly-selected words.
+ :param NetworkInterfaceIPPrototype primary_ip: (optional) The primary IP address
+ to bind to the bare metal server network interface. This can be specified using
+ an existing reserved IP, or a prototype object for a new reserved IP.
+ If an existing reserved IP or a prototype object with an address is specified,
+ it must be available on the bare metal server network interface's subnet.
+ Otherwise, an available address on the subnet will be automatically selected and
+ reserved.
+ :param List[SecurityGroupIdentity] security_groups: (optional) The security
+ groups to use for this bare metal server network interface. If unspecified, the
+ VPC's default security group is used.
+ :param SubnetIdentity subnet: The associated subnet.
+ :param bool allow_interface_to_float: (optional) Indicates if the data path for
+ the network interface can float to another bare metal server. Can only be `true`
+ for network interfaces with an `interface_type` of `vlan`.
+ If `true`, and the network detects traffic for this data path on another bare
+ metal server in the resource group, the network interface will be automatically
+ deleted from this bare metal server and a new network interface with the same
+ `id`, `name` and `vlan` will be created on the other bare metal server.
+ For the data path to float, the other bare metal server must be in the same
+ `resource_group`, and must have a network interface with `interface_type` of
+ `pci` with `allowed_vlans` including this network interface's `vlan`.
+ If this bare metal server has network attachments, this network interface is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and the value of this property matches that of the `allow_to_float`
+ property of the corresponding network attachment.
+ :param str interface_type: - `vlan`: a virtual device, used through a `pci`
+ device that has the `vlan` in its array
+ of `allowed_vlans`.
+ - Must use an IEEE 802.1Q tag.
+ - Has its own security groups and does not inherit those of the PCI device
+ through
+ which traffic flows.
+ - Not supported on bare metal servers with a `cpu.architecture` of `s390x`.
+ :param int vlan: The VLAN ID used in the IEEE 802.1Q tag present in all traffic
+ on this interface.
+ If this bare metal server has network attachments, this network interface is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and the VLAN ID matches the `vlan` of the corresponding network
+ attachment.
"""
def __init__(
self,
- crn: str,
- href: str,
- id: str,
- name: str,
+ subnet: 'SubnetIdentity',
+ interface_type: str,
+ vlan: int,
*,
- deleted: 'InstanceReferenceDeleted' = None,
+ allow_ip_spoofing: Optional[bool] = None,
+ enable_infrastructure_nat: Optional[bool] = None,
+ name: Optional[str] = None,
+ primary_ip: Optional['NetworkInterfaceIPPrototype'] = None,
+ security_groups: Optional[List['SecurityGroupIdentity']] = None,
+ allow_interface_to_float: Optional[bool] = None,
) -> None:
"""
- Initialize a FlowLogCollectorTargetInstanceReference object.
+ Initialize a BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVLANPrototype object.
- :param str crn: The CRN for this virtual server instance.
- :param str href: The URL for this virtual server instance.
- :param str id: The unique identifier for this virtual server instance.
- :param str name: The name for this virtual server instance. The name is
- unique across all virtual server instances in the region.
- :param InstanceReferenceDeleted deleted: (optional) If present, this
- property indicates the referenced resource has been deleted, and provides
- some supplementary information.
+ :param SubnetIdentity subnet: The associated subnet.
+ :param str interface_type: - `vlan`: a virtual device, used through a `pci`
+ device that has the `vlan` in its array
+ of `allowed_vlans`.
+ - Must use an IEEE 802.1Q tag.
+ - Has its own security groups and does not inherit those of the PCI
+ device through
+ which traffic flows.
+ - Not supported on bare metal servers with a `cpu.architecture` of
+ `s390x`.
+ :param int vlan: The VLAN ID used in the IEEE 802.1Q tag present in all
+ traffic on this interface.
+ If this bare metal server has network attachments, this network interface
+ is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and the VLAN ID matches the `vlan` of the corresponding network
+ attachment.
+ :param bool allow_ip_spoofing: (optional) Indicates whether source IP
+ spoofing is allowed on this bare metal server network interface.
+ If this bare metal server has network attachments, this network interface
+ is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and source IP spoofing is managed on the attached virtual
+ network interface.
+ :param bool enable_infrastructure_nat: (optional) If `true`:
+ - The VPC infrastructure performs any needed NAT operations.
+ - `floating_ips` must not have more than one floating IP.
+ If `false`:
+ - Packets are passed unchanged to/from the bare metal server network
+ interface,
+ allowing the workload to perform any needed NAT operations.
+ - `allow_ip_spoofing` must be `false`.
+ - `interface_type` must not be `hipersocket`.
+ If this bare metal server has network attachments, this network interface
+ is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and infrastructure NAT is managed on the attached virtual
+ network interface.
+ :param str name: (optional) The name for this bare metal server network
+ interface. The name must not be used by another network interface on the
+ bare metal server. If unspecified, the name will be a hyphenated list of
+ randomly-selected words.
+ :param NetworkInterfaceIPPrototype primary_ip: (optional) The primary IP
+ address to bind to the bare metal server network interface. This can be
+ specified using an existing reserved IP, or a prototype object for a new
+ reserved IP.
+ If an existing reserved IP or a prototype object with an address is
+ specified, it must be available on the bare metal server network
+ interface's subnet. Otherwise, an available address on the subnet will be
+ automatically selected and reserved.
+ :param List[SecurityGroupIdentity] security_groups: (optional) The security
+ groups to use for this bare metal server network interface. If unspecified,
+ the VPC's default security group is used.
+ :param bool allow_interface_to_float: (optional) Indicates if the data path
+ for the network interface can float to another bare metal server. Can only
+ be `true` for network interfaces with an `interface_type` of `vlan`.
+ If `true`, and the network detects traffic for this data path on another
+ bare metal server in the resource group, the network interface will be
+ automatically deleted from this bare metal server and a new network
+ interface with the same `id`, `name` and `vlan` will be created on the
+ other bare metal server.
+ For the data path to float, the other bare metal server must be in the same
+ `resource_group`, and must have a network interface with `interface_type`
+ of `pci` with `allowed_vlans` including this network interface's `vlan`.
+ If this bare metal server has network attachments, this network interface
+ is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and the value of this property matches that of the
+ `allow_to_float` property of the corresponding network attachment.
"""
# pylint: disable=super-init-not-called
- self.crn = crn
- self.deleted = deleted
- self.href = href
- self.id = id
+ self.allow_ip_spoofing = allow_ip_spoofing
+ self.enable_infrastructure_nat = enable_infrastructure_nat
self.name = name
+ self.primary_ip = primary_ip
+ self.security_groups = security_groups
+ self.subnet = subnet
+ self.allow_interface_to_float = allow_interface_to_float
+ self.interface_type = interface_type
+ self.vlan = vlan
@classmethod
- def from_dict(cls, _dict: Dict) -> 'FlowLogCollectorTargetInstanceReference':
- """Initialize a FlowLogCollectorTargetInstanceReference object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVLANPrototype':
+ """Initialize a BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVLANPrototype object from a json dictionary."""
args = {}
- if 'crn' in _dict:
- args['crn'] = _dict.get('crn')
- else:
- raise ValueError('Required property \'crn\' not present in FlowLogCollectorTargetInstanceReference JSON')
- if 'deleted' in _dict:
- args['deleted'] = InstanceReferenceDeleted.from_dict(_dict.get('deleted'))
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ if (allow_ip_spoofing := _dict.get('allow_ip_spoofing')) is not None:
+ args['allow_ip_spoofing'] = allow_ip_spoofing
+ if (enable_infrastructure_nat := _dict.get('enable_infrastructure_nat')) is not None:
+ args['enable_infrastructure_nat'] = enable_infrastructure_nat
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ if (primary_ip := _dict.get('primary_ip')) is not None:
+ args['primary_ip'] = primary_ip
+ if (security_groups := _dict.get('security_groups')) is not None:
+ args['security_groups'] = security_groups
+ if (subnet := _dict.get('subnet')) is not None:
+ args['subnet'] = subnet
else:
- raise ValueError('Required property \'href\' not present in FlowLogCollectorTargetInstanceReference JSON')
- if 'id' in _dict:
- args['id'] = _dict.get('id')
+ raise ValueError('Required property \'subnet\' not present in BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVLANPrototype JSON')
+ if (allow_interface_to_float := _dict.get('allow_interface_to_float')) is not None:
+ args['allow_interface_to_float'] = allow_interface_to_float
+ if (interface_type := _dict.get('interface_type')) is not None:
+ args['interface_type'] = interface_type
else:
- raise ValueError('Required property \'id\' not present in FlowLogCollectorTargetInstanceReference JSON')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
+ raise ValueError('Required property \'interface_type\' not present in BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVLANPrototype JSON')
+ if (vlan := _dict.get('vlan')) is not None:
+ args['vlan'] = vlan
else:
- raise ValueError('Required property \'name\' not present in FlowLogCollectorTargetInstanceReference JSON')
+ raise ValueError('Required property \'vlan\' not present in BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVLANPrototype JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a FlowLogCollectorTargetInstanceReference 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, 'crn') and self.crn is not None:
- _dict['crn'] = self.crn
- if hasattr(self, 'deleted') and self.deleted is not None:
- if isinstance(self.deleted, dict):
- _dict['deleted'] = self.deleted
- else:
- _dict['deleted'] = self.deleted.to_dict()
- if hasattr(self, 'href') and self.href is not None:
- _dict['href'] = self.href
- if hasattr(self, 'id') and self.id is not None:
- _dict['id'] = self.id
+ if hasattr(self, 'allow_ip_spoofing') and self.allow_ip_spoofing is not None:
+ _dict['allow_ip_spoofing'] = self.allow_ip_spoofing
+ if hasattr(self, 'enable_infrastructure_nat') and self.enable_infrastructure_nat is not None:
+ _dict['enable_infrastructure_nat'] = self.enable_infrastructure_nat
if hasattr(self, 'name') and self.name is not None:
_dict['name'] = self.name
+ if hasattr(self, 'primary_ip') and self.primary_ip is not None:
+ if isinstance(self.primary_ip, dict):
+ _dict['primary_ip'] = self.primary_ip
+ else:
+ _dict['primary_ip'] = self.primary_ip.to_dict()
+ if hasattr(self, 'security_groups') and self.security_groups is not None:
+ security_groups_list = []
+ for v in self.security_groups:
+ if isinstance(v, dict):
+ security_groups_list.append(v)
+ else:
+ security_groups_list.append(v.to_dict())
+ _dict['security_groups'] = security_groups_list
+ if hasattr(self, 'subnet') and self.subnet is not None:
+ if isinstance(self.subnet, dict):
+ _dict['subnet'] = self.subnet
+ else:
+ _dict['subnet'] = self.subnet.to_dict()
+ if hasattr(self, 'allow_interface_to_float') and self.allow_interface_to_float is not None:
+ _dict['allow_interface_to_float'] = self.allow_interface_to_float
+ if hasattr(self, 'interface_type') and self.interface_type is not None:
+ _dict['interface_type'] = self.interface_type
+ if hasattr(self, 'vlan') and self.vlan is not None:
+ _dict['vlan'] = self.vlan
return _dict
def _to_dict(self):
@@ -94604,107 +100952,127 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this FlowLogCollectorTargetInstanceReference object."""
+ """Return a `str` version of this BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVLANPrototype object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'FlowLogCollectorTargetInstanceReference') -> 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: 'FlowLogCollectorTargetInstanceReference') -> bool:
+ def __ne__(self, other: 'BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVLANPrototype') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
+ class InterfaceTypeEnum(str, Enum):
+ """
+ - `vlan`: a virtual device, used through a `pci` device that has the `vlan` in its
+ array
+ of `allowed_vlans`.
+ - Must use an IEEE 802.1Q tag.
+ - Has its own security groups and does not inherit those of the PCI device
+ through
+ which traffic flows.
+ - Not supported on bare metal servers with a `cpu.architecture` of `s390x`.
+ """
+
+ VLAN = 'vlan'
-class FlowLogCollectorTargetNetworkInterfaceReferenceTargetContext(FlowLogCollectorTarget):
+
+
+class BareMetalServerPrimaryNetworkAttachmentPrototypeBareMetalServerPrimaryNetworkAttachmentByPCIPrototype(BareMetalServerPrimaryNetworkAttachmentPrototype):
"""
- FlowLogCollectorTargetNetworkInterfaceReferenceTargetContext.
+ BareMetalServerPrimaryNetworkAttachmentPrototypeBareMetalServerPrimaryNetworkAttachmentByPCIPrototype.
- :attr NetworkInterfaceReferenceTargetContextDeleted deleted: (optional) If
- present, this property indicates the referenced resource has been deleted, and
- provides
- some supplementary information.
- :attr str href: The URL for this instance network interface.
- :attr str id: The unique identifier for this instance network interface.
- :attr str name: The name for this instance network interface.
- :attr str resource_type: The resource type.
+ :param str name: (optional) The name for this bare metal server network
+ attachment. Names must be unique within the bare metal server the network
+ attachment resides in. If unspecified, the name will be a hyphenated list of
+ randomly-selected words.
+ :param BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterface
+ virtual_network_interface:
+ :param List[int] allowed_vlans: (optional) The VLAN IDs to allow for `vlan`
+ attachments using this PCI attachment.
+ :param str interface_type: (optional) - `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 attachment
+ - Cannot directly use an IEEE 802.1Q tag.
+ - Not supported on bare metal servers with a `cpu.architecture` of `s390x`.
"""
def __init__(
self,
- href: str,
- id: str,
- name: str,
- resource_type: str,
+ virtual_network_interface: 'BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterface',
*,
- deleted: 'NetworkInterfaceReferenceTargetContextDeleted' = None,
+ name: Optional[str] = None,
+ allowed_vlans: Optional[List[int]] = None,
+ interface_type: Optional[str] = None,
) -> None:
"""
- Initialize a FlowLogCollectorTargetNetworkInterfaceReferenceTargetContext object.
+ Initialize a BareMetalServerPrimaryNetworkAttachmentPrototypeBareMetalServerPrimaryNetworkAttachmentByPCIPrototype object.
- :param str href: The URL for this instance network interface.
- :param str id: The unique identifier for this instance network interface.
- :param str name: The name for this instance network interface.
- :param str resource_type: The resource type.
- :param NetworkInterfaceReferenceTargetContextDeleted deleted: (optional) If
- present, this property indicates the referenced resource has been deleted,
- and provides
- some supplementary information.
+ :param BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterface
+ virtual_network_interface:
+ :param str name: (optional) The name for this bare metal server network
+ attachment. Names must be unique within the bare metal server the network
+ attachment resides in. If unspecified, the name will be a hyphenated list
+ of randomly-selected words.
+ :param List[int] allowed_vlans: (optional) The VLAN IDs to allow for `vlan`
+ attachments using this PCI attachment.
+ :param str interface_type: (optional) - `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 attachment
+ - Cannot directly use an IEEE 802.1Q tag.
+ - Not supported on bare metal servers with a `cpu.architecture` of
+ `s390x`.
"""
# pylint: disable=super-init-not-called
- self.deleted = deleted
- self.href = href
- self.id = id
self.name = name
- self.resource_type = resource_type
+ self.virtual_network_interface = virtual_network_interface
+ self.allowed_vlans = allowed_vlans
+ self.interface_type = interface_type
@classmethod
- def from_dict(cls, _dict: Dict) -> 'FlowLogCollectorTargetNetworkInterfaceReferenceTargetContext':
- """Initialize a FlowLogCollectorTargetNetworkInterfaceReferenceTargetContext object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'BareMetalServerPrimaryNetworkAttachmentPrototypeBareMetalServerPrimaryNetworkAttachmentByPCIPrototype':
+ """Initialize a BareMetalServerPrimaryNetworkAttachmentPrototypeBareMetalServerPrimaryNetworkAttachmentByPCIPrototype object from a json dictionary."""
args = {}
- if 'deleted' in _dict:
- args['deleted'] = NetworkInterfaceReferenceTargetContextDeleted.from_dict(_dict.get('deleted'))
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ if (virtual_network_interface := _dict.get('virtual_network_interface')) is not None:
+ args['virtual_network_interface'] = virtual_network_interface
else:
- raise ValueError('Required property \'href\' not present in FlowLogCollectorTargetNetworkInterfaceReferenceTargetContext JSON')
- if 'id' in _dict:
- args['id'] = _dict.get('id')
- else:
- raise ValueError('Required property \'id\' not present in FlowLogCollectorTargetNetworkInterfaceReferenceTargetContext JSON')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
- else:
- raise ValueError('Required property \'name\' not present in FlowLogCollectorTargetNetworkInterfaceReferenceTargetContext JSON')
- if 'resource_type' in _dict:
- args['resource_type'] = _dict.get('resource_type')
- else:
- raise ValueError('Required property \'resource_type\' not present in FlowLogCollectorTargetNetworkInterfaceReferenceTargetContext JSON')
+ raise ValueError('Required property \'virtual_network_interface\' not present in BareMetalServerPrimaryNetworkAttachmentPrototypeBareMetalServerPrimaryNetworkAttachmentByPCIPrototype JSON')
+ if (allowed_vlans := _dict.get('allowed_vlans')) is not None:
+ args['allowed_vlans'] = allowed_vlans
+ if (interface_type := _dict.get('interface_type')) is not None:
+ args['interface_type'] = interface_type
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a FlowLogCollectorTargetNetworkInterfaceReferenceTargetContext object from a json dictionary."""
+ """Initialize a BareMetalServerPrimaryNetworkAttachmentPrototypeBareMetalServerPrimaryNetworkAttachmentByPCIPrototype object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'deleted') and self.deleted is not None:
- if isinstance(self.deleted, dict):
- _dict['deleted'] = self.deleted
- else:
- _dict['deleted'] = self.deleted.to_dict()
- if hasattr(self, 'href') and self.href is not None:
- _dict['href'] = self.href
- if hasattr(self, 'id') and self.id is not None:
- _dict['id'] = self.id
if hasattr(self, 'name') and self.name is not None:
_dict['name'] = self.name
- if hasattr(self, 'resource_type') and self.resource_type is not None:
- _dict['resource_type'] = self.resource_type
+ if hasattr(self, 'virtual_network_interface') and self.virtual_network_interface is not None:
+ if isinstance(self.virtual_network_interface, dict):
+ _dict['virtual_network_interface'] = self.virtual_network_interface
+ else:
+ _dict['virtual_network_interface'] = self.virtual_network_interface.to_dict()
+ if hasattr(self, 'allowed_vlans') and self.allowed_vlans is not None:
+ _dict['allowed_vlans'] = self.allowed_vlans
+ if hasattr(self, 'interface_type') and self.interface_type is not None:
+ _dict['interface_type'] = self.interface_type
return _dict
def _to_dict(self):
@@ -94712,125 +101080,76 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this FlowLogCollectorTargetNetworkInterfaceReferenceTargetContext object."""
+ """Return a `str` version of this BareMetalServerPrimaryNetworkAttachmentPrototypeBareMetalServerPrimaryNetworkAttachmentByPCIPrototype object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'FlowLogCollectorTargetNetworkInterfaceReferenceTargetContext') -> bool:
+ def __eq__(self, other: 'BareMetalServerPrimaryNetworkAttachmentPrototypeBareMetalServerPrimaryNetworkAttachmentByPCIPrototype') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'FlowLogCollectorTargetNetworkInterfaceReferenceTargetContext') -> bool:
+ def __ne__(self, other: 'BareMetalServerPrimaryNetworkAttachmentPrototypeBareMetalServerPrimaryNetworkAttachmentByPCIPrototype') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class ResourceTypeEnum(str, Enum):
+ class InterfaceTypeEnum(str, Enum):
"""
- The resource type.
+ - `pci`: a physical PCI device which can only be created or deleted when the bare
+ metal
+ server is stopped
+ - Has an `allowed_vlans` property which controls the VLANs that will be
+ permitted
+ to use the PCI attachment
+ - Cannot directly use an IEEE 802.1Q tag.
+ - Not supported on bare metal servers with a `cpu.architecture` of `s390x`.
"""
- NETWORK_INTERFACE = 'network_interface'
+ PCI = 'pci'
-class FlowLogCollectorTargetSubnetReference(FlowLogCollectorTarget):
+class BareMetalServerProfileBandwidthDependent(BareMetalServerProfileBandwidth):
"""
- FlowLogCollectorTargetSubnetReference.
+ The total bandwidth shared across the bare metal server network attachments or bare
+ metal server network interfaces of a bare metal server with this profile depends on
+ its configuration.
- :attr str crn: The CRN for this subnet.
- :attr SubnetReferenceDeleted deleted: (optional) If present, this property
- indicates the referenced resource has been deleted, and provides
- some supplementary information.
- :attr str href: The URL for this subnet.
- :attr str id: The unique identifier for this subnet.
- :attr str name: The name for this subnet. The name is unique across all subnets
- in the VPC.
- :attr str resource_type: The resource type.
+ :param str type: The type for this profile field.
"""
def __init__(
self,
- crn: str,
- href: str,
- id: str,
- name: str,
- resource_type: str,
- *,
- deleted: 'SubnetReferenceDeleted' = None,
+ type: str,
) -> None:
"""
- Initialize a FlowLogCollectorTargetSubnetReference object.
+ Initialize a BareMetalServerProfileBandwidthDependent object.
- :param str crn: The CRN for this subnet.
- :param str href: The URL for this subnet.
- :param str id: The unique identifier for this subnet.
- :param str name: The name for this subnet. The name is unique across all
- subnets in the VPC.
- :param str resource_type: The resource type.
- :param SubnetReferenceDeleted deleted: (optional) If present, this property
- indicates the referenced resource has been deleted, and provides
- some supplementary information.
+ :param str type: The type for this profile field.
"""
# pylint: disable=super-init-not-called
- self.crn = crn
- self.deleted = deleted
- self.href = href
- self.id = id
- self.name = name
- self.resource_type = resource_type
+ self.type = type
@classmethod
- def from_dict(cls, _dict: Dict) -> 'FlowLogCollectorTargetSubnetReference':
- """Initialize a FlowLogCollectorTargetSubnetReference object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileBandwidthDependent':
+ """Initialize a BareMetalServerProfileBandwidthDependent object from a json dictionary."""
args = {}
- if 'crn' in _dict:
- args['crn'] = _dict.get('crn')
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
else:
- raise ValueError('Required property \'crn\' not present in FlowLogCollectorTargetSubnetReference JSON')
- if 'deleted' in _dict:
- args['deleted'] = SubnetReferenceDeleted.from_dict(_dict.get('deleted'))
- if 'href' in _dict:
- args['href'] = _dict.get('href')
- else:
- raise ValueError('Required property \'href\' not present in FlowLogCollectorTargetSubnetReference JSON')
- if 'id' in _dict:
- args['id'] = _dict.get('id')
- else:
- raise ValueError('Required property \'id\' not present in FlowLogCollectorTargetSubnetReference JSON')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
- else:
- raise ValueError('Required property \'name\' not present in FlowLogCollectorTargetSubnetReference JSON')
- if 'resource_type' in _dict:
- args['resource_type'] = _dict.get('resource_type')
- else:
- raise ValueError('Required property \'resource_type\' not present in FlowLogCollectorTargetSubnetReference JSON')
+ raise ValueError('Required property \'type\' not present in BareMetalServerProfileBandwidthDependent JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a FlowLogCollectorTargetSubnetReference 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, 'crn') and self.crn is not None:
- _dict['crn'] = self.crn
- if hasattr(self, 'deleted') and self.deleted is not None:
- if isinstance(self.deleted, dict):
- _dict['deleted'] = self.deleted
- else:
- _dict['deleted'] = self.deleted.to_dict()
- if hasattr(self, 'href') and self.href is not None:
- _dict['href'] = self.href
- if hasattr(self, 'id') and self.id is not None:
- _dict['id'] = self.id
- if hasattr(self, 'name') and self.name is not None:
- _dict['name'] = self.name
- if hasattr(self, 'resource_type') and self.resource_type is not None:
- _dict['resource_type'] = self.resource_type
+ if hasattr(self, 'type') and self.type is not None:
+ _dict['type'] = self.type
return _dict
def _to_dict(self):
@@ -94838,125 +101157,89 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this FlowLogCollectorTargetSubnetReference object."""
+ """Return a `str` version of this BareMetalServerProfileBandwidthDependent object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'FlowLogCollectorTargetSubnetReference') -> 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: 'FlowLogCollectorTargetSubnetReference') -> bool:
+ def __ne__(self, other: 'BareMetalServerProfileBandwidthDependent') -> 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.
"""
- SUBNET = 'subnet'
+ DEPENDENT = 'dependent'
-class FlowLogCollectorTargetVPCReference(FlowLogCollectorTarget):
+class BareMetalServerProfileBandwidthEnum(BareMetalServerProfileBandwidth):
"""
- FlowLogCollectorTargetVPCReference.
+ The permitted total bandwidth values (in megabits per second) shared across the bare
+ metal server network attachments or bare metal server network interfaces of a bare
+ metal server with this profile.
- :attr str crn: The CRN for this VPC.
- :attr VPCReferenceDeleted deleted: (optional) If present, this property
- indicates the referenced resource has been deleted, and provides
- some supplementary information.
- :attr str href: The URL for this VPC.
- :attr str id: The unique identifier for this VPC.
- :attr str name: The name for this VPC. The name is unique across all VPCs in the
- region.
- :attr str resource_type: The resource type.
+ :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.
"""
def __init__(
self,
- crn: str,
- href: str,
- id: str,
- name: str,
- resource_type: str,
- *,
- deleted: 'VPCReferenceDeleted' = None,
+ default: int,
+ type: str,
+ values: List[int],
) -> None:
"""
- Initialize a FlowLogCollectorTargetVPCReference object.
+ Initialize a BareMetalServerProfileBandwidthEnum object.
- :param str crn: The CRN for this VPC.
- :param str href: The URL for this VPC.
- :param str id: The unique identifier for this VPC.
- :param str name: The name for this VPC. The name is unique across all VPCs
- in the region.
- :param str resource_type: The resource type.
- :param VPCReferenceDeleted deleted: (optional) If present, this property
- indicates the referenced resource has been deleted, and provides
- some supplementary information.
+ :param int default: The default value for this profile field.
+ :param str type: The type for this profile field.
+ :param List[int] values: The permitted values for this profile field.
"""
# pylint: disable=super-init-not-called
- self.crn = crn
- self.deleted = deleted
- self.href = href
- self.id = id
- self.name = name
- self.resource_type = resource_type
+ self.default = default
+ self.type = type
+ self.values = values
@classmethod
- def from_dict(cls, _dict: Dict) -> 'FlowLogCollectorTargetVPCReference':
- """Initialize a FlowLogCollectorTargetVPCReference object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileBandwidthEnum':
+ """Initialize a BareMetalServerProfileBandwidthEnum object from a json dictionary."""
args = {}
- if 'crn' in _dict:
- args['crn'] = _dict.get('crn')
- else:
- raise ValueError('Required property \'crn\' not present in FlowLogCollectorTargetVPCReference JSON')
- if 'deleted' in _dict:
- args['deleted'] = VPCReferenceDeleted.from_dict(_dict.get('deleted'))
- if 'href' in _dict:
- args['href'] = _dict.get('href')
- else:
- raise ValueError('Required property \'href\' not present in FlowLogCollectorTargetVPCReference JSON')
- if 'id' in _dict:
- args['id'] = _dict.get('id')
+ if (default := _dict.get('default')) is not None:
+ args['default'] = default
else:
- raise ValueError('Required property \'id\' not present in FlowLogCollectorTargetVPCReference JSON')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
+ raise ValueError('Required property \'default\' not present in BareMetalServerProfileBandwidthEnum JSON')
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
else:
- raise ValueError('Required property \'name\' not present in FlowLogCollectorTargetVPCReference JSON')
- if 'resource_type' in _dict:
- args['resource_type'] = _dict.get('resource_type')
+ raise ValueError('Required property \'type\' not present in BareMetalServerProfileBandwidthEnum JSON')
+ if (values := _dict.get('values')) is not None:
+ args['values'] = values
else:
- raise ValueError('Required property \'resource_type\' not present in FlowLogCollectorTargetVPCReference JSON')
+ raise ValueError('Required property \'values\' not present in BareMetalServerProfileBandwidthEnum JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a FlowLogCollectorTargetVPCReference 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, 'crn') and self.crn is not None:
- _dict['crn'] = self.crn
- if hasattr(self, 'deleted') and self.deleted is not None:
- if isinstance(self.deleted, dict):
- _dict['deleted'] = self.deleted
- else:
- _dict['deleted'] = self.deleted.to_dict()
- if hasattr(self, 'href') and self.href is not None:
- _dict['href'] = self.href
- if hasattr(self, 'id') and self.id is not None:
- _dict['id'] = self.id
- if hasattr(self, 'name') and self.name is not None:
- _dict['name'] = self.name
- if hasattr(self, 'resource_type') and self.resource_type is not None:
- _dict['resource_type'] = self.resource_type
+ if hasattr(self, 'default') and self.default is not None:
+ _dict['default'] = self.default
+ if hasattr(self, 'type') and self.type is not None:
+ _dict['type'] = self.type
+ if hasattr(self, 'values') and self.values is not None:
+ _dict['values'] = self.values
return _dict
def _to_dict(self):
@@ -94964,67 +101247,79 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this FlowLogCollectorTargetVPCReference object."""
+ """Return a `str` version of this BareMetalServerProfileBandwidthEnum object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'FlowLogCollectorTargetVPCReference') -> 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: 'FlowLogCollectorTargetVPCReference') -> bool:
+ def __ne__(self, other: 'BareMetalServerProfileBandwidthEnum') -> 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.
"""
- VPC = 'vpc'
+ ENUM = 'enum'
-class ImageIdentityByCRN(ImageIdentity):
+class BareMetalServerProfileBandwidthFixed(BareMetalServerProfileBandwidth):
"""
- ImageIdentityByCRN.
+ The total bandwidth (in megabits per second) shared across the bare metal server
+ network attachments or bare metal server network interfaces of a bare metal server
+ with this profile.
- :attr str crn: The CRN for this image.
+ :param str type: The type for this profile field.
+ :param int value: The value for this profile field.
"""
def __init__(
self,
- crn: str,
+ type: str,
+ value: int,
) -> None:
"""
- Initialize a ImageIdentityByCRN object.
+ Initialize a BareMetalServerProfileBandwidthFixed object.
- :param str crn: The CRN for this image.
+ :param str type: The type for this profile field.
+ :param int value: The value for this profile field.
"""
# pylint: disable=super-init-not-called
- self.crn = crn
+ self.type = type
+ self.value = value
@classmethod
- def from_dict(cls, _dict: Dict) -> 'ImageIdentityByCRN':
- """Initialize a ImageIdentityByCRN object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileBandwidthFixed':
+ """Initialize a BareMetalServerProfileBandwidthFixed object from a json dictionary."""
args = {}
- if 'crn' in _dict:
- args['crn'] = _dict.get('crn')
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
else:
- raise ValueError('Required property \'crn\' not present in ImageIdentityByCRN JSON')
+ raise ValueError('Required property \'type\' not present in BareMetalServerProfileBandwidthFixed JSON')
+ if (value := _dict.get('value')) is not None:
+ args['value'] = value
+ else:
+ raise ValueError('Required property \'value\' not present in BareMetalServerProfileBandwidthFixed JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a ImageIdentityByCRN 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, 'crn') and self.crn is not None:
- _dict['crn'] = self.crn
+ if hasattr(self, 'type') and self.type is not None:
+ _dict['type'] = self.type
+ if hasattr(self, 'value') and self.value is not None:
+ _dict['value'] = self.value
return _dict
def _to_dict(self):
@@ -95032,59 +101327,108 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this ImageIdentityByCRN object."""
+ """Return a `str` version of this BareMetalServerProfileBandwidthFixed object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'ImageIdentityByCRN') -> 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: 'ImageIdentityByCRN') -> bool:
+ def __ne__(self, other: 'BareMetalServerProfileBandwidthFixed') -> 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 ImageIdentityByHref(ImageIdentity):
+
+
+class BareMetalServerProfileBandwidthRange(BareMetalServerProfileBandwidth):
"""
- ImageIdentityByHref.
+ The permitted total bandwidth range (in megabits per second) shared across the network
+ attachments or network interfaces of a bare metal server with this profile.
- :attr str href: The URL for this image.
+ :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.
"""
def __init__(
self,
- href: str,
+ default: int,
+ max: int,
+ min: int,
+ step: int,
+ type: str,
) -> None:
"""
- Initialize a ImageIdentityByHref object.
+ Initialize a BareMetalServerProfileBandwidthRange object.
- :param str href: The URL for this image.
+ :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.href = href
+ self.default = default
+ self.max = max
+ self.min = min
+ self.step = step
+ self.type = type
@classmethod
- def from_dict(cls, _dict: Dict) -> 'ImageIdentityByHref':
- """Initialize a ImageIdentityByHref object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileBandwidthRange':
+ """Initialize a BareMetalServerProfileBandwidthRange object from a json dictionary."""
args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ if (default := _dict.get('default')) is not None:
+ args['default'] = default
else:
- raise ValueError('Required property \'href\' not present in ImageIdentityByHref JSON')
+ raise ValueError('Required property \'default\' not present in BareMetalServerProfileBandwidthRange JSON')
+ if (max := _dict.get('max')) is not None:
+ args['max'] = max
+ else:
+ raise ValueError('Required property \'max\' not present in BareMetalServerProfileBandwidthRange JSON')
+ if (min := _dict.get('min')) is not None:
+ args['min'] = min
+ else:
+ raise ValueError('Required property \'min\' not present in BareMetalServerProfileBandwidthRange JSON')
+ if (step := _dict.get('step')) is not None:
+ args['step'] = step
+ else:
+ raise ValueError('Required property \'step\' not present in BareMetalServerProfileBandwidthRange JSON')
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
+ else:
+ raise ValueError('Required property \'type\' not present in BareMetalServerProfileBandwidthRange JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a ImageIdentityByHref 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, '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):
@@ -95092,59 +101436,68 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this ImageIdentityByHref object."""
+ """Return a `str` version of this BareMetalServerProfileBandwidthRange object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'ImageIdentityByHref') -> 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: 'ImageIdentityByHref') -> bool:
+ def __ne__(self, other: 'BareMetalServerProfileBandwidthRange') -> 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 ImageIdentityById(ImageIdentity):
+
+
+class BareMetalServerProfileCPUCoreCountDependent(BareMetalServerProfileCPUCoreCount):
"""
- ImageIdentityById.
+ The CPU core count for a bare metal server with this profile depends on its
+ configuration.
- :attr str id: The unique identifier for this image.
+ :param str type: The type for this profile field.
"""
def __init__(
self,
- id: str,
+ type: str,
) -> None:
"""
- Initialize a ImageIdentityById object.
+ Initialize a BareMetalServerProfileCPUCoreCountDependent object.
- :param str id: The unique identifier for this image.
+ :param str type: The type for this profile field.
"""
# pylint: disable=super-init-not-called
- self.id = id
+ self.type = type
@classmethod
- def from_dict(cls, _dict: Dict) -> 'ImageIdentityById':
- """Initialize a ImageIdentityById object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileCPUCoreCountDependent':
+ """Initialize a BareMetalServerProfileCPUCoreCountDependent object from a json dictionary."""
args = {}
- if 'id' in _dict:
- args['id'] = _dict.get('id')
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
else:
- raise ValueError('Required property \'id\' not present in ImageIdentityById JSON')
+ raise ValueError('Required property \'type\' not present in BareMetalServerProfileCPUCoreCountDependent JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a ImageIdentityById 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, '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):
@@ -95152,207 +101505,87 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this ImageIdentityById object."""
+ """Return a `str` version of this BareMetalServerProfileCPUCoreCountDependent object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'ImageIdentityById') -> 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: 'ImageIdentityById') -> bool:
+ def __ne__(self, other: 'BareMetalServerProfileCPUCoreCountDependent') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
+ class TypeEnum(str, Enum):
+ """
+ The type for this profile field.
+ """
-class ImagePrototypeImageByFile(ImagePrototype):
+ DEPENDENT = 'dependent'
+
+
+
+class BareMetalServerProfileCPUCoreCountEnum(BareMetalServerProfileCPUCoreCount):
"""
- ImagePrototypeImageByFile.
+ The permitted values for CPU cores for a bare metal server with this profile.
- :attr datetime deprecation_at: (optional) The deprecation date and time to set
- for this image.
- The date and time must not be in the past, and must be earlier than
- `obsolescence_at`
- (if `obsolescence_at` is set).
- If unspecified, no deprecation date and time will be set.
- If the deprecation date and time is reached while the image has a status of
- `pending`, the image's status will transition to `deprecated` upon its
- successful creation (or
- `obsolete` if the obsolescence date and time was also reached).
- :attr str name: (optional) The name for this image. The name must not be used by
- another image in the region. Names starting with `ibm-` are reserved for
- system-provided images, and are not allowed. If unspecified, the name will be a
- hyphenated list of randomly-selected words.
- :attr datetime obsolescence_at: (optional) The obsolescence date and time to set
- for this image.
- The date and time must not be in the past, and must be later than
- `deprecation_at` (if
- `deprecation_at` is set).
- If unspecified, no obsolescence date and time will be set.
- If the obsolescence date and time is reached while the image has a status of
- `pending`, the image's status will transition to `obsolete` upon its successful
- creation.
- :attr ResourceGroupIdentity resource_group: (optional)
- :attr str encrypted_data_key: (optional) A base64-encoded, encrypted
- representation of the key that was used to encrypt the data for this image.
- That representation is created by wrapping the key's value with the
- `encryption_key` root key (which must also be specified), using either [Key
- Protect](https://cloud.ibm.com/docs/key-protect?topic=key-protect-wrap-keys) or
- the
- [Hyper Protect Crypto
- Services](https://cloud.ibm.com/docs/services/hs-crypto?topic=hs-crypto-wrap-keys).
- If unspecified, the imported image is treated as unencrypted.
- :attr EncryptionKeyIdentity encryption_key: (optional) The root key that was
- used to wrap the data key (which is ultimately represented as
- `encrypted_data_key`). Additionally, the root key will be used to encrypt
- volumes
- created from this image (unless an alternate `encryption_key` is specified at
- volume
- creation).
- If unspecified, the imported image is treated as unencrypted.
- :attr ImageFilePrototype file: The file from which to create the image.
- :attr OperatingSystemIdentity operating_system: The [supported operating
- system](https://cloud.ibm.com/apidocs/vpc#list-operating-systems) included in
- this
- image.
+ :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.
"""
def __init__(
self,
- file: 'ImageFilePrototype',
- operating_system: 'OperatingSystemIdentity',
- *,
- deprecation_at: datetime = None,
- name: str = None,
- obsolescence_at: datetime = None,
- resource_group: 'ResourceGroupIdentity' = None,
- encrypted_data_key: str = None,
- encryption_key: 'EncryptionKeyIdentity' = None,
+ default: int,
+ type: str,
+ values: List[int],
) -> None:
"""
- Initialize a ImagePrototypeImageByFile object.
+ Initialize a BareMetalServerProfileCPUCoreCountEnum object.
- :param ImageFilePrototype file: The file from which to create the image.
- :param OperatingSystemIdentity operating_system: The [supported operating
- system](https://cloud.ibm.com/apidocs/vpc#list-operating-systems) included
- in this
- image.
- :param datetime deprecation_at: (optional) The deprecation date and time to
- set for this image.
- The date and time must not be in the past, and must be earlier than
- `obsolescence_at`
- (if `obsolescence_at` is set).
- If unspecified, no deprecation date and time will be set.
- If the deprecation date and time is reached while the image has a status of
- `pending`, the image's status will transition to `deprecated` upon its
- successful creation (or
- `obsolete` if the obsolescence date and time was also reached).
- :param str name: (optional) The name for this image. The name must not be
- used by another image in the region. Names starting with `ibm-` are
- reserved for system-provided images, and are not allowed. If unspecified,
- the name will be a hyphenated list of randomly-selected words.
- :param datetime obsolescence_at: (optional) The obsolescence date and time
- to set for this image.
- The date and time must not be in the past, and must be later than
- `deprecation_at` (if
- `deprecation_at` is set).
- If unspecified, no obsolescence date and time will be set.
- If the obsolescence date and time is reached while the image has a status
- of
- `pending`, the image's status will transition to `obsolete` upon its
- successful creation.
- :param ResourceGroupIdentity resource_group: (optional)
- :param str encrypted_data_key: (optional) A base64-encoded, encrypted
- representation of the key that was used to encrypt the data for this image.
- That representation is created by wrapping the key's value with the
- `encryption_key` root key (which must also be specified), using either [Key
- Protect](https://cloud.ibm.com/docs/key-protect?topic=key-protect-wrap-keys)
- or the
- [Hyper Protect Crypto
- Services](https://cloud.ibm.com/docs/services/hs-crypto?topic=hs-crypto-wrap-keys).
- If unspecified, the imported image is treated as unencrypted.
- :param EncryptionKeyIdentity encryption_key: (optional) The root key that
- was used to wrap the data key (which is ultimately represented as
- `encrypted_data_key`). Additionally, the root key will be used to encrypt
- volumes
- created from this image (unless an alternate `encryption_key` is specified
- at volume
- creation).
- If unspecified, the imported image is treated as unencrypted.
+ :param int default: The default value for this profile field.
+ :param str type: The type for this profile field.
+ :param List[int] values: The permitted values for this profile field.
"""
# pylint: disable=super-init-not-called
- self.deprecation_at = deprecation_at
- self.name = name
- self.obsolescence_at = obsolescence_at
- self.resource_group = resource_group
- self.encrypted_data_key = encrypted_data_key
- self.encryption_key = encryption_key
- self.file = file
- self.operating_system = operating_system
+ self.default = default
+ self.type = type
+ self.values = values
@classmethod
- def from_dict(cls, _dict: Dict) -> 'ImagePrototypeImageByFile':
- """Initialize a ImagePrototypeImageByFile object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileCPUCoreCountEnum':
+ """Initialize a BareMetalServerProfileCPUCoreCountEnum object from a json dictionary."""
args = {}
- if 'deprecation_at' in _dict:
- args['deprecation_at'] = string_to_datetime(_dict.get('deprecation_at'))
- if 'name' in _dict:
- args['name'] = _dict.get('name')
- if 'obsolescence_at' in _dict:
- args['obsolescence_at'] = string_to_datetime(_dict.get('obsolescence_at'))
- if 'resource_group' in _dict:
- args['resource_group'] = _dict.get('resource_group')
- if 'encrypted_data_key' in _dict:
- args['encrypted_data_key'] = _dict.get('encrypted_data_key')
- if 'encryption_key' in _dict:
- args['encryption_key'] = _dict.get('encryption_key')
- if 'file' in _dict:
- args['file'] = ImageFilePrototype.from_dict(_dict.get('file'))
+ if (default := _dict.get('default')) is not None:
+ args['default'] = default
else:
- raise ValueError('Required property \'file\' not present in ImagePrototypeImageByFile JSON')
- if 'operating_system' in _dict:
- args['operating_system'] = _dict.get('operating_system')
+ raise ValueError('Required property \'default\' not present in BareMetalServerProfileCPUCoreCountEnum JSON')
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
else:
- raise ValueError('Required property \'operating_system\' not present in ImagePrototypeImageByFile JSON')
+ raise ValueError('Required property \'type\' not present in BareMetalServerProfileCPUCoreCountEnum JSON')
+ if (values := _dict.get('values')) is not None:
+ args['values'] = values
+ else:
+ raise ValueError('Required property \'values\' not present in BareMetalServerProfileCPUCoreCountEnum JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a ImagePrototypeImageByFile 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, 'deprecation_at') and self.deprecation_at is not None:
- _dict['deprecation_at'] = datetime_to_string(self.deprecation_at)
- if hasattr(self, 'name') and self.name is not None:
- _dict['name'] = self.name
- if hasattr(self, 'obsolescence_at') and self.obsolescence_at is not None:
- _dict['obsolescence_at'] = datetime_to_string(self.obsolescence_at)
- if hasattr(self, 'resource_group') and self.resource_group is not None:
- if isinstance(self.resource_group, dict):
- _dict['resource_group'] = self.resource_group
- else:
- _dict['resource_group'] = self.resource_group.to_dict()
- if hasattr(self, 'encrypted_data_key') and self.encrypted_data_key is not None:
- _dict['encrypted_data_key'] = self.encrypted_data_key
- if hasattr(self, 'encryption_key') and self.encryption_key is not None:
- if isinstance(self.encryption_key, dict):
- _dict['encryption_key'] = self.encryption_key
- else:
- _dict['encryption_key'] = self.encryption_key.to_dict()
- if hasattr(self, 'file') and self.file is not None:
- if isinstance(self.file, dict):
- _dict['file'] = self.file
- else:
- _dict['file'] = self.file.to_dict()
- if hasattr(self, 'operating_system') and self.operating_system is not None:
- if isinstance(self.operating_system, dict):
- _dict['operating_system'] = self.operating_system
- else:
- _dict['operating_system'] = self.operating_system.to_dict()
+ if hasattr(self, '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):
@@ -95360,164 +101593,77 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this ImagePrototypeImageByFile object."""
+ """Return a `str` version of this BareMetalServerProfileCPUCoreCountEnum object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'ImagePrototypeImageByFile') -> 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: 'ImagePrototypeImageByFile') -> bool:
+ def __ne__(self, other: 'BareMetalServerProfileCPUCoreCountEnum') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
+ class TypeEnum(str, Enum):
+ """
+ The type for this profile field.
+ """
-class ImagePrototypeImageBySourceVolume(ImagePrototype):
+ ENUM = 'enum'
+
+
+
+class BareMetalServerProfileCPUCoreCountFixed(BareMetalServerProfileCPUCoreCount):
"""
- ImagePrototypeImageBySourceVolume.
+ The CPU core count for a bare metal server with this profile.
- :attr datetime deprecation_at: (optional) The deprecation date and time to set
- for this image.
- The date and time must not be in the past, and must be earlier than
- `obsolescence_at`
- (if `obsolescence_at` is set).
- If unspecified, no deprecation date and time will be set.
- If the deprecation date and time is reached while the image has a status of
- `pending`, the image's status will transition to `deprecated` upon its
- successful creation (or
- `obsolete` if the obsolescence date and time was also reached).
- :attr str name: (optional) The name for this image. The name must not be used by
- another image in the region. Names starting with `ibm-` are reserved for
- system-provided images, and are not allowed. If unspecified, the name will be a
- hyphenated list of randomly-selected words.
- :attr datetime obsolescence_at: (optional) The obsolescence date and time to set
- for this image.
- The date and time must not be in the past, and must be later than
- `deprecation_at` (if
- `deprecation_at` is set).
- If unspecified, no obsolescence date and time will be set.
- If the obsolescence date and time is reached while the image has a status of
- `pending`, the image's status will transition to `obsolete` upon its successful
- creation.
- :attr ResourceGroupIdentity resource_group: (optional)
- :attr EncryptionKeyIdentity encryption_key: (optional) The root key used to wrap
- the system-generated data encryption key for the image.
- If unspecified, the root key from `source_volume` will be used.
- :attr VolumeIdentity source_volume: The volume from which to create the image.
- The specified volume must:
- - Have an `operating_system`, which will be used to populate this image's
- operating system information.
- - Not be `active` or `busy`.
- During image creation, the specified volume may briefly become `busy`.
+ :param str type: The type for this profile field.
+ :param int value: The value for this profile field.
"""
def __init__(
self,
- source_volume: 'VolumeIdentity',
- *,
- deprecation_at: datetime = None,
- name: str = None,
- obsolescence_at: datetime = None,
- resource_group: 'ResourceGroupIdentity' = None,
- encryption_key: 'EncryptionKeyIdentity' = None,
+ type: str,
+ value: int,
) -> None:
"""
- Initialize a ImagePrototypeImageBySourceVolume object.
+ Initialize a BareMetalServerProfileCPUCoreCountFixed object.
- :param VolumeIdentity source_volume: The volume from which to create the
- image. The specified volume must:
- - Have an `operating_system`, which will be used to populate this image's
- operating system information.
- - Not be `active` or `busy`.
- During image creation, the specified volume may briefly become `busy`.
- :param datetime deprecation_at: (optional) The deprecation date and time to
- set for this image.
- The date and time must not be in the past, and must be earlier than
- `obsolescence_at`
- (if `obsolescence_at` is set).
- If unspecified, no deprecation date and time will be set.
- If the deprecation date and time is reached while the image has a status of
- `pending`, the image's status will transition to `deprecated` upon its
- successful creation (or
- `obsolete` if the obsolescence date and time was also reached).
- :param str name: (optional) The name for this image. The name must not be
- used by another image in the region. Names starting with `ibm-` are
- reserved for system-provided images, and are not allowed. If unspecified,
- the name will be a hyphenated list of randomly-selected words.
- :param datetime obsolescence_at: (optional) The obsolescence date and time
- to set for this image.
- The date and time must not be in the past, and must be later than
- `deprecation_at` (if
- `deprecation_at` is set).
- If unspecified, no obsolescence date and time will be set.
- If the obsolescence date and time is reached while the image has a status
- of
- `pending`, the image's status will transition to `obsolete` upon its
- successful creation.
- :param ResourceGroupIdentity resource_group: (optional)
- :param EncryptionKeyIdentity encryption_key: (optional) The root key used
- to wrap the system-generated data encryption key for the image.
- If unspecified, the root key from `source_volume` will be used.
+ :param str type: The type for this profile field.
+ :param int value: The value for this profile field.
"""
# pylint: disable=super-init-not-called
- self.deprecation_at = deprecation_at
- self.name = name
- self.obsolescence_at = obsolescence_at
- self.resource_group = resource_group
- self.encryption_key = encryption_key
- self.source_volume = source_volume
+ self.type = type
+ self.value = value
@classmethod
- def from_dict(cls, _dict: Dict) -> 'ImagePrototypeImageBySourceVolume':
- """Initialize a ImagePrototypeImageBySourceVolume object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileCPUCoreCountFixed':
+ """Initialize a BareMetalServerProfileCPUCoreCountFixed object from a json dictionary."""
args = {}
- if 'deprecation_at' in _dict:
- args['deprecation_at'] = string_to_datetime(_dict.get('deprecation_at'))
- if 'name' in _dict:
- args['name'] = _dict.get('name')
- if 'obsolescence_at' in _dict:
- args['obsolescence_at'] = string_to_datetime(_dict.get('obsolescence_at'))
- if 'resource_group' in _dict:
- args['resource_group'] = _dict.get('resource_group')
- if 'encryption_key' in _dict:
- args['encryption_key'] = _dict.get('encryption_key')
- if 'source_volume' in _dict:
- args['source_volume'] = _dict.get('source_volume')
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
else:
- raise ValueError('Required property \'source_volume\' not present in ImagePrototypeImageBySourceVolume JSON')
+ raise ValueError('Required property \'type\' not present in BareMetalServerProfileCPUCoreCountFixed JSON')
+ if (value := _dict.get('value')) is not None:
+ args['value'] = value
+ else:
+ raise ValueError('Required property \'value\' not present in BareMetalServerProfileCPUCoreCountFixed JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a ImagePrototypeImageBySourceVolume 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, 'deprecation_at') and self.deprecation_at is not None:
- _dict['deprecation_at'] = datetime_to_string(self.deprecation_at)
- if hasattr(self, 'name') and self.name is not None:
- _dict['name'] = self.name
- if hasattr(self, 'obsolescence_at') and self.obsolescence_at is not None:
- _dict['obsolescence_at'] = datetime_to_string(self.obsolescence_at)
- if hasattr(self, 'resource_group') and self.resource_group is not None:
- if isinstance(self.resource_group, dict):
- _dict['resource_group'] = self.resource_group
- else:
- _dict['resource_group'] = self.resource_group.to_dict()
- if hasattr(self, 'encryption_key') and self.encryption_key is not None:
- if isinstance(self.encryption_key, dict):
- _dict['encryption_key'] = self.encryption_key
- else:
- _dict['encryption_key'] = self.encryption_key.to_dict()
- if hasattr(self, 'source_volume') and self.source_volume is not None:
- if isinstance(self.source_volume, dict):
- _dict['source_volume'] = self.source_volume
- else:
- _dict['source_volume'] = self.source_volume.to_dict()
+ 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):
@@ -95525,66 +101671,108 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this ImagePrototypeImageBySourceVolume object."""
+ """Return a `str` version of this BareMetalServerProfileCPUCoreCountFixed object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'ImagePrototypeImageBySourceVolume') -> 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: 'ImagePrototypeImageBySourceVolume') -> bool:
+ def __ne__(self, other: 'BareMetalServerProfileCPUCoreCountFixed') -> 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 InstanceCatalogOfferingPrototypeCatalogOfferingByOffering(InstanceCatalogOfferingPrototype):
+
+class BareMetalServerProfileCPUCoreCountRange(BareMetalServerProfileCPUCoreCount):
"""
- InstanceCatalogOfferingPrototypeCatalogOfferingByOffering.
+ The permitted range for the number of CPU cores for a bare metal server with this
+ profile.
- :attr CatalogOfferingIdentity offering: Identifies a
- [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user)
- offering by a unique property.
+ :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.
"""
def __init__(
self,
- offering: 'CatalogOfferingIdentity',
+ default: int,
+ max: int,
+ min: int,
+ step: int,
+ type: str,
) -> None:
"""
- Initialize a InstanceCatalogOfferingPrototypeCatalogOfferingByOffering object.
+ Initialize a BareMetalServerProfileCPUCoreCountRange object.
- :param CatalogOfferingIdentity offering: Identifies a
- [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user)
- offering by a unique property.
+ :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.offering = offering
+ self.default = default
+ self.max = max
+ self.min = min
+ self.step = step
+ self.type = type
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstanceCatalogOfferingPrototypeCatalogOfferingByOffering':
- """Initialize a InstanceCatalogOfferingPrototypeCatalogOfferingByOffering object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileCPUCoreCountRange':
+ """Initialize a BareMetalServerProfileCPUCoreCountRange object from a json dictionary."""
args = {}
- if 'offering' in _dict:
- args['offering'] = _dict.get('offering')
+ if (default := _dict.get('default')) is not None:
+ args['default'] = default
else:
- raise ValueError('Required property \'offering\' not present in InstanceCatalogOfferingPrototypeCatalogOfferingByOffering JSON')
+ raise ValueError('Required property \'default\' not present in BareMetalServerProfileCPUCoreCountRange JSON')
+ if (max := _dict.get('max')) is not None:
+ args['max'] = max
+ else:
+ raise ValueError('Required property \'max\' not present in BareMetalServerProfileCPUCoreCountRange JSON')
+ if (min := _dict.get('min')) is not None:
+ args['min'] = min
+ else:
+ raise ValueError('Required property \'min\' not present in BareMetalServerProfileCPUCoreCountRange JSON')
+ if (step := _dict.get('step')) is not None:
+ args['step'] = step
+ else:
+ raise ValueError('Required property \'step\' not present in BareMetalServerProfileCPUCoreCountRange JSON')
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
+ else:
+ raise ValueError('Required property \'type\' not present in BareMetalServerProfileCPUCoreCountRange JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceCatalogOfferingPrototypeCatalogOfferingByOffering 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, 'offering') and self.offering is not None:
- if isinstance(self.offering, dict):
- _dict['offering'] = self.offering
- else:
- _dict['offering'] = self.offering.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):
@@ -95592,68 +101780,68 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this InstanceCatalogOfferingPrototypeCatalogOfferingByOffering object."""
+ """Return a `str` version of this BareMetalServerProfileCPUCoreCountRange object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceCatalogOfferingPrototypeCatalogOfferingByOffering') -> 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: 'InstanceCatalogOfferingPrototypeCatalogOfferingByOffering') -> 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 for this profile field.
+ """
+
+ RANGE = 'range'
+
-class InstanceCatalogOfferingPrototypeCatalogOfferingByVersion(InstanceCatalogOfferingPrototype):
+
+class BareMetalServerProfileCPUSocketCountDependent(BareMetalServerProfileCPUSocketCount):
"""
- InstanceCatalogOfferingPrototypeCatalogOfferingByVersion.
+ The CPU socket count for a bare metal server with this profile depends on its
+ configuration.
- :attr CatalogOfferingVersionIdentity version: Identifies a version of a
- [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user)
- offering by a
- unique property.
+ :param str type: The type for this profile field.
"""
def __init__(
self,
- version: 'CatalogOfferingVersionIdentity',
+ type: str,
) -> None:
"""
- Initialize a InstanceCatalogOfferingPrototypeCatalogOfferingByVersion object.
+ Initialize a BareMetalServerProfileCPUSocketCountDependent object.
- :param CatalogOfferingVersionIdentity version: Identifies a version of a
- [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user)
- offering by a
- unique property.
+ :param str type: The type for this profile field.
"""
# pylint: disable=super-init-not-called
- self.version = version
+ self.type = type
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstanceCatalogOfferingPrototypeCatalogOfferingByVersion':
- """Initialize a InstanceCatalogOfferingPrototypeCatalogOfferingByVersion object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileCPUSocketCountDependent':
+ """Initialize a BareMetalServerProfileCPUSocketCountDependent object from a json dictionary."""
args = {}
- if 'version' in _dict:
- args['version'] = _dict.get('version')
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
else:
- raise ValueError('Required property \'version\' not present in InstanceCatalogOfferingPrototypeCatalogOfferingByVersion JSON')
+ raise ValueError('Required property \'type\' not present in BareMetalServerProfileCPUSocketCountDependent JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceCatalogOfferingPrototypeCatalogOfferingByVersion 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, 'version') and self.version is not None:
- if isinstance(self.version, dict):
- _dict['version'] = self.version
- else:
- _dict['version'] = self.version.to_dict()
+ if hasattr(self, 'type') and self.type is not None:
+ _dict['type'] = self.type
return _dict
def _to_dict(self):
@@ -95661,354 +101849,165 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this InstanceCatalogOfferingPrototypeCatalogOfferingByVersion object."""
+ """Return a `str` version of this BareMetalServerProfileCPUSocketCountDependent object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceCatalogOfferingPrototypeCatalogOfferingByVersion') -> 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: 'InstanceCatalogOfferingPrototypeCatalogOfferingByVersion') -> bool:
+ def __ne__(self, other: 'BareMetalServerProfileCPUSocketCountDependent') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-
-class InstanceGroupManagerActionPrototypeScheduledActionPrototype(InstanceGroupManagerActionPrototype):
- """
- InstanceGroupManagerActionPrototypeScheduledActionPrototype.
-
- :attr str name: (optional) The name for this instance group manager action. The
- name must not be used by another action for the instance group manager. If
- unspecified, the name will be a hyphenated list of randomly-selected words.
- """
-
- def __init__(
- self,
- *,
- name: str = None,
- ) -> None:
+ class TypeEnum(str, Enum):
"""
- Initialize a InstanceGroupManagerActionPrototypeScheduledActionPrototype object.
-
- :param str name: (optional) The name for this instance group manager
- action. The name must not be used by another action for the instance group
- manager. If unspecified, the name will be a hyphenated list of
- randomly-selected words.
+ The type for this profile field.
"""
- # pylint: disable=super-init-not-called
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAt', 'InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpec'])
- )
- raise Exception(msg)
+
+ DEPENDENT = 'dependent'
-class InstanceGroupManagerActionScheduledAction(InstanceGroupManagerAction):
+
+class BareMetalServerProfileCPUSocketCountEnum(BareMetalServerProfileCPUSocketCount):
"""
- InstanceGroupManagerActionScheduledAction.
+ The permitted values for CPU sockets for a bare metal server with this profile.
- :attr bool auto_delete: Indicates whether this scheduled action will be
- automatically deleted after it has completed and `auto_delete_timeout` hours
- have passed. At present, this is always
- `true`, but may be modifiable in the future.
- :attr int auto_delete_timeout: If `auto_delete` is `true`, and this scheduled
- action has finished, the hours after which it will be automatically deleted. If
- the value is `0`, the action will be deleted once it has finished. This value
- may be modifiable in the future.
- :attr datetime created_at: The date and time that the instance group manager
- action was created.
- :attr str href: The URL for this instance group manager action.
- :attr str id: The unique identifier for this instance group manager action.
- :attr str name: The name for this instance group manager action. The name is
- unique across all actions for the instance group manager.
- :attr str resource_type: The resource type.
- :attr str status: The status of the instance group action
- - `active`: Action is ready to be run
- - `completed`: Action was completed successfully
- - `failed`: Action could not be completed successfully
- - `incompatible`: Action parameters are not compatible with the group or manager
- - `omitted`: Action was not applied because this action's manager was disabled.
- :attr datetime updated_at: The date and time that the instance group manager
- action was updated.
- :attr str action_type: The type of action for the instance group.
- :attr str cron_spec: (optional) The cron specification for a recurring scheduled
- action. Actions can be applied a maximum of one time within a 5 min period.
- :attr datetime last_applied_at: (optional) The date and time the scheduled
- action was last applied. If absent, the action has never been applied.
- :attr datetime next_run_at: (optional) The date and time the scheduled action
- will next run. If absent, the system is currently calculating the next run time.
+ :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.
"""
def __init__(
self,
- auto_delete: bool,
- auto_delete_timeout: int,
- created_at: datetime,
- href: str,
- id: str,
- name: str,
- resource_type: str,
- status: str,
- updated_at: datetime,
- action_type: str,
- *,
- cron_spec: str = None,
- last_applied_at: datetime = None,
- next_run_at: datetime = None,
+ default: int,
+ type: str,
+ values: List[int],
) -> None:
"""
- Initialize a InstanceGroupManagerActionScheduledAction object.
+ Initialize a BareMetalServerProfileCPUSocketCountEnum object.
- :param bool auto_delete: Indicates whether this scheduled action will be
- automatically deleted after it has completed and `auto_delete_timeout`
- hours have passed. At present, this is always
- `true`, but may be modifiable in the future.
- :param int auto_delete_timeout: If `auto_delete` is `true`, and this
- scheduled action has finished, the hours after which it will be
- automatically deleted. If the value is `0`, the action will be deleted once
- it has finished. This value may be modifiable in the future.
- :param datetime created_at: The date and time that the instance group
- manager action was created.
- :param str href: The URL for this instance group manager action.
- :param str id: The unique identifier for this instance group manager
- action.
- :param str name: The name for this instance group manager action. The name
- is unique across all actions for the instance group manager.
- :param str resource_type: The resource type.
- :param str status: The status of the instance group action
- - `active`: Action is ready to be run
- - `completed`: Action was completed successfully
- - `failed`: Action could not be completed successfully
- - `incompatible`: Action parameters are not compatible with the group or
- manager
- - `omitted`: Action was not applied because this action's manager was
- disabled.
- :param datetime updated_at: The date and time that the instance group
- manager action was updated.
- :param str action_type: The type of action for the instance group.
- :param str cron_spec: (optional) The cron specification for a recurring
- scheduled action. Actions can be applied a maximum of one time within a 5
- min period.
- :param datetime last_applied_at: (optional) The date and time the scheduled
- action was last applied. If absent, the action has never been applied.
- :param datetime next_run_at: (optional) The date and time the scheduled
- action will next run. If absent, the system is currently calculating the
- next run time.
+ :param int default: The default value for this profile field.
+ :param str type: The type for this profile field.
+ :param List[int] values: The permitted values for this profile field.
"""
# pylint: disable=super-init-not-called
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['InstanceGroupManagerActionScheduledActionGroupTarget', 'InstanceGroupManagerActionScheduledActionManagerTarget'])
- )
- raise Exception(msg)
+ self.default = default
+ self.type = type
+ self.values = values
- class ResourceTypeEnum(str, Enum):
- """
- The resource type.
- """
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileCPUSocketCountEnum':
+ """Initialize a BareMetalServerProfileCPUSocketCountEnum object from a json dictionary."""
+ args = {}
+ if (default := _dict.get('default')) is not None:
+ args['default'] = default
+ else:
+ raise ValueError('Required property \'default\' not present in BareMetalServerProfileCPUSocketCountEnum JSON')
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
+ else:
+ raise ValueError('Required property \'type\' not present in BareMetalServerProfileCPUSocketCountEnum JSON')
+ if (values := _dict.get('values')) is not None:
+ args['values'] = values
+ else:
+ raise ValueError('Required property \'values\' not present in BareMetalServerProfileCPUSocketCountEnum JSON')
+ return cls(**args)
- INSTANCE_GROUP_MANAGER_ACTION = 'instance_group_manager_action'
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a BareMetalServerProfileCPUSocketCountEnum object from a json dictionary."""
+ return cls.from_dict(_dict)
+ def to_dict(self) -> Dict:
+ """Return a json dictionary representing this model."""
+ _dict = {}
+ if hasattr(self, '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
- 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.
- """
+ def _to_dict(self):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
- ACTIVE = 'active'
- COMPLETED = 'completed'
- FAILED = 'failed'
- INCOMPATIBLE = 'incompatible'
- OMITTED = 'omitted'
+ 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__
- class ActionTypeEnum(str, Enum):
+ 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):
"""
- The type of action for the instance group.
+ The type for this profile field.
"""
- SCHEDULED = 'scheduled'
+ ENUM = 'enum'
-class InstanceGroupManagerAutoScale(InstanceGroupManager):
+class BareMetalServerProfileCPUSocketCountFixed(BareMetalServerProfileCPUSocketCount):
"""
- InstanceGroupManagerAutoScale.
+ The number of CPU sockets for a bare metal server with this profile.
- :attr datetime created_at: The date and time that the instance group manager was
- created.
- :attr str href: The URL for this instance group manager.
- :attr str id: The unique identifier for this instance group manager.
- :attr bool management_enabled: Indicates whether this manager will control the
- instance group.
- :attr str name: The name for this instance group manager. The name is unique
- across all managers for the instance group.
- :attr datetime updated_at: The date and time that the instance group manager was
- updated.
- :attr int aggregation_window: The time window in seconds to aggregate metrics
- prior to evaluation.
- :attr int cooldown: The duration of time in seconds to pause further scale
- actions after scaling has taken place.
- :attr str manager_type: The type of instance group manager.
- :attr int max_membership_count: The maximum number of members in a managed
- instance group.
- :attr int min_membership_count: The minimum number of members in a managed
- instance group.
- :attr List[InstanceGroupManagerPolicyReference] policies: The policies of the
- instance group manager.
+ :param str type: The type for this profile field.
+ :param int value: The value for this profile field.
"""
def __init__(
self,
- created_at: datetime,
- href: str,
- id: str,
- management_enabled: bool,
- name: str,
- updated_at: datetime,
- aggregation_window: int,
- cooldown: int,
- manager_type: str,
- max_membership_count: int,
- min_membership_count: int,
- policies: List['InstanceGroupManagerPolicyReference'],
+ type: str,
+ value: int,
) -> None:
"""
- Initialize a InstanceGroupManagerAutoScale object.
+ Initialize a BareMetalServerProfileCPUSocketCountFixed object.
- :param datetime created_at: The date and time that the instance group
- manager was created.
- :param str href: The URL for this instance group manager.
- :param str id: The unique identifier for this instance group manager.
- :param bool management_enabled: Indicates whether this manager will control
- the instance group.
- :param str name: The name for this instance group manager. The name is
- unique across all managers for the instance group.
- :param datetime updated_at: The date and time that the instance group
- manager was updated.
- :param int aggregation_window: The time window in seconds to aggregate
- metrics prior to evaluation.
- :param int cooldown: The duration of time in seconds to pause further scale
- actions after scaling has taken place.
- :param str manager_type: The type of instance group manager.
- :param int max_membership_count: The maximum number of members in a managed
- instance group.
- :param int min_membership_count: The minimum number of members in a managed
- instance group.
- :param List[InstanceGroupManagerPolicyReference] policies: The policies of
- the instance group manager.
+ :param str type: The type for this profile field.
+ :param int value: The value for this profile field.
"""
# pylint: disable=super-init-not-called
- self.created_at = created_at
- self.href = href
- self.id = id
- self.management_enabled = management_enabled
- self.name = name
- self.updated_at = updated_at
- self.aggregation_window = aggregation_window
- self.cooldown = cooldown
- self.manager_type = manager_type
- self.max_membership_count = max_membership_count
- self.min_membership_count = min_membership_count
- self.policies = policies
+ self.type = type
+ self.value = value
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerAutoScale':
- """Initialize a InstanceGroupManagerAutoScale object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileCPUSocketCountFixed':
+ """Initialize a BareMetalServerProfileCPUSocketCountFixed object from a json dictionary."""
args = {}
- if 'created_at' in _dict:
- args['created_at'] = string_to_datetime(_dict.get('created_at'))
- else:
- raise ValueError('Required property \'created_at\' not present in InstanceGroupManagerAutoScale JSON')
- if 'href' in _dict:
- args['href'] = _dict.get('href')
- else:
- raise ValueError('Required property \'href\' not present in InstanceGroupManagerAutoScale JSON')
- if 'id' in _dict:
- args['id'] = _dict.get('id')
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
else:
- raise ValueError('Required property \'id\' not present in InstanceGroupManagerAutoScale JSON')
- if 'management_enabled' in _dict:
- args['management_enabled'] = _dict.get('management_enabled')
- else:
- raise ValueError('Required property \'management_enabled\' not present in InstanceGroupManagerAutoScale JSON')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
- else:
- raise ValueError('Required property \'name\' not present in InstanceGroupManagerAutoScale JSON')
- if 'updated_at' in _dict:
- args['updated_at'] = string_to_datetime(_dict.get('updated_at'))
- else:
- raise ValueError('Required property \'updated_at\' not present in InstanceGroupManagerAutoScale JSON')
- if 'aggregation_window' in _dict:
- args['aggregation_window'] = _dict.get('aggregation_window')
- else:
- raise ValueError('Required property \'aggregation_window\' not present in InstanceGroupManagerAutoScale JSON')
- if 'cooldown' in _dict:
- args['cooldown'] = _dict.get('cooldown')
- else:
- raise ValueError('Required property \'cooldown\' not present in InstanceGroupManagerAutoScale JSON')
- if 'manager_type' in _dict:
- args['manager_type'] = _dict.get('manager_type')
- else:
- raise ValueError('Required property \'manager_type\' not present in InstanceGroupManagerAutoScale JSON')
- if 'max_membership_count' in _dict:
- args['max_membership_count'] = _dict.get('max_membership_count')
- else:
- raise ValueError('Required property \'max_membership_count\' not present in InstanceGroupManagerAutoScale JSON')
- if 'min_membership_count' in _dict:
- args['min_membership_count'] = _dict.get('min_membership_count')
- else:
- raise ValueError('Required property \'min_membership_count\' not present in InstanceGroupManagerAutoScale JSON')
- if 'policies' in _dict:
- args['policies'] = [InstanceGroupManagerPolicyReference.from_dict(v) for v in _dict.get('policies')]
+ raise ValueError('Required property \'type\' not present in BareMetalServerProfileCPUSocketCountFixed JSON')
+ if (value := _dict.get('value')) is not None:
+ args['value'] = value
else:
- raise ValueError('Required property \'policies\' not present in InstanceGroupManagerAutoScale JSON')
+ raise ValueError('Required property \'value\' not present in BareMetalServerProfileCPUSocketCountFixed JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceGroupManagerAutoScale 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, 'created_at') and self.created_at is not None:
- _dict['created_at'] = datetime_to_string(self.created_at)
- if hasattr(self, 'href') and self.href is not None:
- _dict['href'] = self.href
- if hasattr(self, 'id') and self.id is not None:
- _dict['id'] = self.id
- if hasattr(self, 'management_enabled') and self.management_enabled is not None:
- _dict['management_enabled'] = self.management_enabled
- if hasattr(self, 'name') and self.name is not None:
- _dict['name'] = self.name
- if hasattr(self, 'updated_at') and self.updated_at is not None:
- _dict['updated_at'] = datetime_to_string(self.updated_at)
- if hasattr(self, 'aggregation_window') and self.aggregation_window is not None:
- _dict['aggregation_window'] = self.aggregation_window
- if hasattr(self, 'cooldown') and self.cooldown is not None:
- _dict['cooldown'] = self.cooldown
- if hasattr(self, 'manager_type') and self.manager_type is not None:
- _dict['manager_type'] = self.manager_type
- if hasattr(self, 'max_membership_count') and self.max_membership_count is not None:
- _dict['max_membership_count'] = self.max_membership_count
- if hasattr(self, 'min_membership_count') and self.min_membership_count is not None:
- _dict['min_membership_count'] = self.min_membership_count
- if hasattr(self, 'policies') and self.policies is not None:
- policies_list = []
- for v in self.policies:
- if isinstance(v, dict):
- policies_list.append(v)
- else:
- policies_list.append(v.to_dict())
- _dict['policies'] = policies_list
+ if hasattr(self, '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):
@@ -96016,101 +102015,108 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this InstanceGroupManagerAutoScale object."""
+ """Return a `str` version of this BareMetalServerProfileCPUSocketCountFixed object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceGroupManagerAutoScale') -> 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: 'InstanceGroupManagerAutoScale') -> bool:
+ def __ne__(self, other: 'BareMetalServerProfileCPUSocketCountFixed') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class ManagerTypeEnum(str, Enum):
+ class TypeEnum(str, Enum):
"""
- The type of instance group manager.
+ The type for this profile field.
"""
- AUTOSCALE = 'autoscale'
+ FIXED = 'fixed'
-class InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype(InstanceGroupManagerPolicyPrototype):
+class BareMetalServerProfileCPUSocketCountRange(BareMetalServerProfileCPUSocketCount):
"""
- InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype.
+ The permitted range for the number of CPU sockets for a bare metal server with this
+ profile.
- :attr str name: (optional) The name for this instance group manager policy. The
- name must not be used by another policy for the instance group manager. If
- unspecified, the name will be a hyphenated list of randomly-selected words.
- :attr str metric_type: The type of metric to be evaluated.
- :attr int metric_value: The metric value to be evaluated.
- :attr str policy_type: The type of policy for the instance group.
+ :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.
"""
def __init__(
self,
- metric_type: str,
- metric_value: int,
- policy_type: str,
- *,
- name: str = None,
+ default: int,
+ max: int,
+ min: int,
+ step: int,
+ type: str,
) -> None:
"""
- Initialize a InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype object.
+ Initialize a BareMetalServerProfileCPUSocketCountRange object.
- :param str metric_type: The type of metric to be evaluated.
- :param int metric_value: The metric value to be evaluated.
- :param str policy_type: The type of policy for the instance group.
- :param str name: (optional) The name for this instance group manager
- policy. The name must not be used by another policy for the instance group
- manager. If unspecified, the name will be a hyphenated list of
- randomly-selected words.
+ :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.name = name
- self.metric_type = metric_type
- self.metric_value = metric_value
- self.policy_type = policy_type
+ self.default = default
+ self.max = max
+ self.min = min
+ self.step = step
+ self.type = type
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype':
- """Initialize a InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileCPUSocketCountRange':
+ """Initialize a BareMetalServerProfileCPUSocketCountRange object from a json dictionary."""
args = {}
- if 'name' in _dict:
- args['name'] = _dict.get('name')
- if 'metric_type' in _dict:
- args['metric_type'] = _dict.get('metric_type')
+ if (default := _dict.get('default')) is not None:
+ args['default'] = default
else:
- raise ValueError('Required property \'metric_type\' not present in InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype JSON')
- if 'metric_value' in _dict:
- args['metric_value'] = _dict.get('metric_value')
+ raise ValueError('Required property \'default\' not present in BareMetalServerProfileCPUSocketCountRange JSON')
+ if (max := _dict.get('max')) is not None:
+ args['max'] = max
else:
- raise ValueError('Required property \'metric_value\' not present in InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype JSON')
- if 'policy_type' in _dict:
- args['policy_type'] = _dict.get('policy_type')
+ raise ValueError('Required property \'max\' not present in BareMetalServerProfileCPUSocketCountRange JSON')
+ if (min := _dict.get('min')) is not None:
+ args['min'] = min
else:
- raise ValueError('Required property \'policy_type\' not present in InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype JSON')
+ raise ValueError('Required property \'min\' not present in BareMetalServerProfileCPUSocketCountRange JSON')
+ if (step := _dict.get('step')) is not None:
+ args['step'] = step
+ else:
+ raise ValueError('Required property \'step\' not present in BareMetalServerProfileCPUSocketCountRange JSON')
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
+ else:
+ raise ValueError('Required property \'type\' not present in BareMetalServerProfileCPUSocketCountRange JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype 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, 'name') and self.name is not None:
- _dict['name'] = self.name
- if hasattr(self, 'metric_type') and self.metric_type is not None:
- _dict['metric_type'] = self.metric_type
- if hasattr(self, 'metric_value') and self.metric_value is not None:
- _dict['metric_value'] = self.metric_value
- if hasattr(self, 'policy_type') and self.policy_type is not None:
- _dict['policy_type'] = self.policy_type
+ if hasattr(self, '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):
@@ -96118,155 +102124,68 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype object."""
+ """Return a `str` version of this BareMetalServerProfileCPUSocketCountRange object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype') -> 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: 'InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype') -> bool:
+ def __ne__(self, other: 'BareMetalServerProfileCPUSocketCountRange') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class MetricTypeEnum(str, Enum):
- """
- The type of metric to be evaluated.
- """
-
- CPU = 'cpu'
- MEMORY = 'memory'
- NETWORK_IN = 'network_in'
- NETWORK_OUT = 'network_out'
-
-
- class PolicyTypeEnum(str, Enum):
+ class TypeEnum(str, Enum):
"""
- The type of policy for the instance group.
+ The type for this profile field.
"""
- TARGET = 'target'
+ RANGE = 'range'
-class InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy(InstanceGroupManagerPolicy):
+class BareMetalServerProfileDiskQuantityDependent(BareMetalServerProfileDiskQuantity):
"""
- InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy.
+ The number of disks of this configuration for a bare metal server with this profile
+ depends on its bare metal server configuration.
- :attr datetime created_at: The date and time that the instance group manager
- policy was created.
- :attr str href: The URL for this instance group manager policy.
- :attr str id: The unique identifier for this instance group manager policy.
- :attr str name: The name for this instance group manager policy. The name is
- unique across all policies for the instance group manager.
- :attr datetime updated_at: The date and time that the instance group manager
- policy was updated.
- :attr str metric_type: The type of metric to be evaluated.
- :attr int metric_value: The metric value to be evaluated.
- :attr str policy_type: The type of policy for the instance group.
+ :param str type: The type for this profile field.
"""
def __init__(
self,
- created_at: datetime,
- href: str,
- id: str,
- name: str,
- updated_at: datetime,
- metric_type: str,
- metric_value: int,
- policy_type: str,
+ type: str,
) -> None:
"""
- Initialize a InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy object.
+ Initialize a BareMetalServerProfileDiskQuantityDependent object.
- :param datetime created_at: The date and time that the instance group
- manager policy was created.
- :param str href: The URL for this instance group manager policy.
- :param str id: The unique identifier for this instance group manager
- policy.
- :param str name: The name for this instance group manager policy. The name
- is unique across all policies for the instance group manager.
- :param datetime updated_at: The date and time that the instance group
- manager policy was updated.
- :param str metric_type: The type of metric to be evaluated.
- :param int metric_value: The metric value to be evaluated.
- :param str policy_type: The type of policy for the instance group.
+ :param str type: The type for this profile field.
"""
# pylint: disable=super-init-not-called
- self.created_at = created_at
- self.href = href
- self.id = id
- self.name = name
- self.updated_at = updated_at
- self.metric_type = metric_type
- self.metric_value = metric_value
- self.policy_type = policy_type
+ self.type = type
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy':
- """Initialize a InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileDiskQuantityDependent':
+ """Initialize a BareMetalServerProfileDiskQuantityDependent object from a json dictionary."""
args = {}
- if 'created_at' in _dict:
- args['created_at'] = string_to_datetime(_dict.get('created_at'))
- else:
- raise ValueError('Required property \'created_at\' not present in InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy JSON')
- if 'href' in _dict:
- args['href'] = _dict.get('href')
- else:
- raise ValueError('Required property \'href\' not present in InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy JSON')
- if 'id' in _dict:
- args['id'] = _dict.get('id')
- else:
- raise ValueError('Required property \'id\' not present in InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy JSON')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
- else:
- raise ValueError('Required property \'name\' not present in InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy JSON')
- if 'updated_at' in _dict:
- args['updated_at'] = string_to_datetime(_dict.get('updated_at'))
- else:
- raise ValueError('Required property \'updated_at\' not present in InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy JSON')
- if 'metric_type' in _dict:
- args['metric_type'] = _dict.get('metric_type')
- else:
- raise ValueError('Required property \'metric_type\' not present in InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy JSON')
- if 'metric_value' in _dict:
- args['metric_value'] = _dict.get('metric_value')
- else:
- raise ValueError('Required property \'metric_value\' not present in InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy JSON')
- if 'policy_type' in _dict:
- args['policy_type'] = _dict.get('policy_type')
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
else:
- raise ValueError('Required property \'policy_type\' not present in InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy JSON')
+ raise ValueError('Required property \'type\' not present in BareMetalServerProfileDiskQuantityDependent JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy 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, 'created_at') and self.created_at is not None:
- _dict['created_at'] = datetime_to_string(self.created_at)
- if hasattr(self, 'href') and self.href is not None:
- _dict['href'] = self.href
- if hasattr(self, 'id') and self.id is not None:
- _dict['id'] = self.id
- if hasattr(self, 'name') and self.name is not None:
- _dict['name'] = self.name
- if hasattr(self, 'updated_at') and self.updated_at is not None:
- _dict['updated_at'] = datetime_to_string(self.updated_at)
- if hasattr(self, 'metric_type') and self.metric_type is not None:
- _dict['metric_type'] = self.metric_type
- if hasattr(self, 'metric_value') and self.metric_value is not None:
- _dict['metric_value'] = self.metric_value
- if hasattr(self, 'policy_type') and self.policy_type is not None:
- _dict['policy_type'] = self.policy_type
+ if hasattr(self, 'type') and self.type is not None:
+ _dict['type'] = self.type
return _dict
def _to_dict(self):
@@ -96274,143 +102193,88 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy object."""
+ """Return a `str` version of this BareMetalServerProfileDiskQuantityDependent object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy') -> 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: 'InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy') -> bool:
+ def __ne__(self, other: 'BareMetalServerProfileDiskQuantityDependent') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class MetricTypeEnum(str, Enum):
- """
- The type of metric to be evaluated.
- """
-
- CPU = 'cpu'
- MEMORY = 'memory'
- NETWORK_IN = 'network_in'
- NETWORK_OUT = 'network_out'
-
-
- class PolicyTypeEnum(str, Enum):
+ class TypeEnum(str, Enum):
"""
- The type of policy for the instance group.
+ The type for this profile field.
"""
- TARGET = 'target'
+ DEPENDENT = 'dependent'
-class InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype(InstanceGroupManagerPrototype):
+class BareMetalServerProfileDiskQuantityEnum(BareMetalServerProfileDiskQuantity):
"""
- InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype.
+ The permitted the number of disks of this configuration for a bare metal server with
+ this profile.
- :attr bool management_enabled: (optional) Indicates whether this manager will
- control the instance group.
- :attr str name: (optional) The name for this instance group manager. The name
- must not be used by another manager for the instance group. If unspecified, the
- name will be a hyphenated list of randomly-selected words.
- :attr int aggregation_window: (optional) The time window in seconds to aggregate
- metrics prior to evaluation.
- :attr int cooldown: (optional) The duration of time in seconds to pause further
- scale actions after scaling has taken place.
- :attr str manager_type: The type of instance group manager.
- :attr int max_membership_count: The maximum number of members in a managed
- instance group.
- :attr int min_membership_count: (optional) The minimum number of members in a
- managed instance group.
+ :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.
"""
def __init__(
self,
- manager_type: str,
- max_membership_count: int,
- *,
- management_enabled: bool = None,
- name: str = None,
- aggregation_window: int = None,
- cooldown: int = None,
- min_membership_count: int = None,
+ default: int,
+ type: str,
+ values: List[int],
) -> None:
"""
- Initialize a InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype object.
+ Initialize a BareMetalServerProfileDiskQuantityEnum object.
- :param str manager_type: The type of instance group manager.
- :param int max_membership_count: The maximum number of members in a managed
- instance group.
- :param bool management_enabled: (optional) Indicates whether this manager
- will control the instance group.
- :param str name: (optional) The name for this instance group manager. The
- name must not be used by another manager for the instance group. If
- unspecified, the name will be a hyphenated list of randomly-selected words.
- :param int aggregation_window: (optional) The time window in seconds to
- aggregate metrics prior to evaluation.
- :param int cooldown: (optional) The duration of time in seconds to pause
- further scale actions after scaling has taken place.
- :param int min_membership_count: (optional) The minimum number of members
- in a managed instance group.
+ :param int default: The default value for this profile field.
+ :param str type: The type for this profile field.
+ :param List[int] values: The permitted values for this profile field.
"""
# pylint: disable=super-init-not-called
- self.management_enabled = management_enabled
- self.name = name
- self.aggregation_window = aggregation_window
- self.cooldown = cooldown
- self.manager_type = manager_type
- self.max_membership_count = max_membership_count
- self.min_membership_count = min_membership_count
+ self.default = default
+ self.type = type
+ self.values = values
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype':
- """Initialize a InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileDiskQuantityEnum':
+ """Initialize a BareMetalServerProfileDiskQuantityEnum object from a json dictionary."""
args = {}
- if 'management_enabled' in _dict:
- args['management_enabled'] = _dict.get('management_enabled')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
- if 'aggregation_window' in _dict:
- args['aggregation_window'] = _dict.get('aggregation_window')
- if 'cooldown' in _dict:
- args['cooldown'] = _dict.get('cooldown')
- if 'manager_type' in _dict:
- args['manager_type'] = _dict.get('manager_type')
+ if (default := _dict.get('default')) is not None:
+ args['default'] = default
else:
- raise ValueError('Required property \'manager_type\' not present in InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype JSON')
- if 'max_membership_count' in _dict:
- args['max_membership_count'] = _dict.get('max_membership_count')
+ raise ValueError('Required property \'default\' not present in BareMetalServerProfileDiskQuantityEnum JSON')
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
else:
- raise ValueError('Required property \'max_membership_count\' not present in InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype JSON')
- if 'min_membership_count' in _dict:
- args['min_membership_count'] = _dict.get('min_membership_count')
+ raise ValueError('Required property \'type\' not present in BareMetalServerProfileDiskQuantityEnum JSON')
+ if (values := _dict.get('values')) is not None:
+ args['values'] = values
+ else:
+ raise ValueError('Required property \'values\' not present in BareMetalServerProfileDiskQuantityEnum JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype 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, 'management_enabled') and self.management_enabled is not None:
- _dict['management_enabled'] = self.management_enabled
- if hasattr(self, 'name') and self.name is not None:
- _dict['name'] = self.name
- if hasattr(self, 'aggregation_window') and self.aggregation_window is not None:
- _dict['aggregation_window'] = self.aggregation_window
- if hasattr(self, 'cooldown') and self.cooldown is not None:
- _dict['cooldown'] = self.cooldown
- if hasattr(self, 'manager_type') and self.manager_type is not None:
- _dict['manager_type'] = self.manager_type
- if hasattr(self, 'max_membership_count') and self.max_membership_count is not None:
- _dict['max_membership_count'] = self.max_membership_count
- if hasattr(self, 'min_membership_count') and self.min_membership_count is not None:
- _dict['min_membership_count'] = self.min_membership_count
+ if hasattr(self, '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):
@@ -96418,90 +102282,77 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype object."""
+ """Return a `str` version of this BareMetalServerProfileDiskQuantityEnum object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype') -> 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: 'InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype') -> bool:
+ def __ne__(self, other: 'BareMetalServerProfileDiskQuantityEnum') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class ManagerTypeEnum(str, Enum):
+ class TypeEnum(str, Enum):
"""
- The type of instance group manager.
+ The type for this profile field.
"""
- AUTOSCALE = 'autoscale'
+ ENUM = 'enum'
-class InstanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype(InstanceGroupManagerPrototype):
+class BareMetalServerProfileDiskQuantityFixed(BareMetalServerProfileDiskQuantity):
"""
- InstanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype.
+ The number of disks of this configuration for a bare metal server with this profile.
- :attr bool management_enabled: (optional) Indicates whether this manager will
- control the instance group.
- :attr str name: (optional) The name for this instance group manager. The name
- must not be used by another manager for the instance group. If unspecified, the
- name will be a hyphenated list of randomly-selected words.
- :attr str manager_type: The type of instance group manager.
+ :param str type: The type for this profile field.
+ :param int value: The value for this profile field.
"""
def __init__(
self,
- manager_type: str,
- *,
- management_enabled: bool = None,
- name: str = None,
+ type: str,
+ value: int,
) -> None:
"""
- Initialize a InstanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype object.
+ Initialize a BareMetalServerProfileDiskQuantityFixed object.
- :param str manager_type: The type of instance group manager.
- :param bool management_enabled: (optional) Indicates whether this manager
- will control the instance group.
- :param str name: (optional) The name for this instance group manager. The
- name must not be used by another manager for the instance group. If
- unspecified, the name will be a hyphenated list of randomly-selected words.
+ :param str type: The type for this profile field.
+ :param int value: The value for this profile field.
"""
# pylint: disable=super-init-not-called
- self.management_enabled = management_enabled
- self.name = name
- self.manager_type = manager_type
+ self.type = type
+ self.value = value
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype':
- """Initialize a InstanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileDiskQuantityFixed':
+ """Initialize a BareMetalServerProfileDiskQuantityFixed object from a json dictionary."""
args = {}
- if 'management_enabled' in _dict:
- args['management_enabled'] = _dict.get('management_enabled')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
- if 'manager_type' in _dict:
- args['manager_type'] = _dict.get('manager_type')
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
else:
- raise ValueError('Required property \'manager_type\' not present in InstanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype JSON')
+ raise ValueError('Required property \'type\' not present in BareMetalServerProfileDiskQuantityFixed JSON')
+ if (value := _dict.get('value')) is not None:
+ args['value'] = value
+ else:
+ raise ValueError('Required property \'value\' not present in BareMetalServerProfileDiskQuantityFixed JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype 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, 'management_enabled') and self.management_enabled is not None:
- _dict['management_enabled'] = self.management_enabled
- if hasattr(self, 'name') and self.name is not None:
- _dict['name'] = self.name
- if hasattr(self, 'manager_type') and self.manager_type is not None:
- _dict['manager_type'] = self.manager_type
+ if hasattr(self, '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):
@@ -96509,153 +102360,108 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this InstanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype object."""
+ """Return a `str` version of this BareMetalServerProfileDiskQuantityFixed object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype') -> 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: 'InstanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype') -> bool:
+ def __ne__(self, other: 'BareMetalServerProfileDiskQuantityFixed') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class ManagerTypeEnum(str, Enum):
+ class TypeEnum(str, Enum):
"""
- The type of instance group manager.
+ The type for this profile field.
"""
- SCHEDULED = 'scheduled'
+ FIXED = 'fixed'
-class InstanceGroupManagerScheduled(InstanceGroupManager):
+class BareMetalServerProfileDiskQuantityRange(BareMetalServerProfileDiskQuantity):
"""
- InstanceGroupManagerScheduled.
+ The permitted range for the number of disks of this configuration for a bare metal
+ server with this profile.
- :attr datetime created_at: The date and time that the instance group manager was
- created.
- :attr str href: The URL for this instance group manager.
- :attr str id: The unique identifier for this instance group manager.
- :attr bool management_enabled: Indicates whether this manager will control the
- instance group.
- :attr str name: The name for this instance group manager. The name is unique
- across all managers for the instance group.
- :attr datetime updated_at: The date and time that the instance group manager was
- updated.
- :attr List[InstanceGroupManagerActionReference] actions: The actions of the
- instance group manager.
- :attr str manager_type: The type of instance group manager.
+ :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.
"""
def __init__(
self,
- created_at: datetime,
- href: str,
- id: str,
- management_enabled: bool,
- name: str,
- updated_at: datetime,
- actions: List['InstanceGroupManagerActionReference'],
- manager_type: str,
+ default: int,
+ max: int,
+ min: int,
+ step: int,
+ type: str,
) -> None:
"""
- Initialize a InstanceGroupManagerScheduled object.
+ Initialize a BareMetalServerProfileDiskQuantityRange object.
- :param datetime created_at: The date and time that the instance group
- manager was created.
- :param str href: The URL for this instance group manager.
- :param str id: The unique identifier for this instance group manager.
- :param bool management_enabled: Indicates whether this manager will control
- the instance group.
- :param str name: The name for this instance group manager. The name is
- unique across all managers for the instance group.
- :param datetime updated_at: The date and time that the instance group
- manager was updated.
- :param List[InstanceGroupManagerActionReference] actions: The actions of
- the instance group manager.
- :param str manager_type: The type of instance group manager.
+ :param int default: The default value for this profile field.
+ :param int max: The maximum value for this profile field.
+ :param int min: The minimum value for this profile field.
+ :param int step: The increment step value for this profile field.
+ :param str type: The type for this profile field.
"""
# pylint: disable=super-init-not-called
- self.created_at = created_at
- self.href = href
- self.id = id
- self.management_enabled = management_enabled
- self.name = name
- self.updated_at = updated_at
- self.actions = actions
- self.manager_type = manager_type
+ self.default = default
+ self.max = max
+ self.min = min
+ self.step = step
+ self.type = type
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerScheduled':
- """Initialize a InstanceGroupManagerScheduled object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileDiskQuantityRange':
+ """Initialize a BareMetalServerProfileDiskQuantityRange object from a json dictionary."""
args = {}
- if 'created_at' in _dict:
- args['created_at'] = string_to_datetime(_dict.get('created_at'))
- else:
- raise ValueError('Required property \'created_at\' not present in InstanceGroupManagerScheduled JSON')
- if 'href' in _dict:
- args['href'] = _dict.get('href')
- else:
- raise ValueError('Required property \'href\' not present in InstanceGroupManagerScheduled JSON')
- if 'id' in _dict:
- args['id'] = _dict.get('id')
- else:
- raise ValueError('Required property \'id\' not present in InstanceGroupManagerScheduled JSON')
- if 'management_enabled' in _dict:
- args['management_enabled'] = _dict.get('management_enabled')
+ if (default := _dict.get('default')) is not None:
+ args['default'] = default
else:
- raise ValueError('Required property \'management_enabled\' not present in InstanceGroupManagerScheduled JSON')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
+ raise ValueError('Required property \'default\' not present in BareMetalServerProfileDiskQuantityRange JSON')
+ if (max := _dict.get('max')) is not None:
+ args['max'] = max
else:
- raise ValueError('Required property \'name\' not present in InstanceGroupManagerScheduled JSON')
- if 'updated_at' in _dict:
- args['updated_at'] = string_to_datetime(_dict.get('updated_at'))
+ raise ValueError('Required property \'max\' not present in BareMetalServerProfileDiskQuantityRange JSON')
+ if (min := _dict.get('min')) is not None:
+ args['min'] = min
else:
- raise ValueError('Required property \'updated_at\' not present in InstanceGroupManagerScheduled JSON')
- if 'actions' in _dict:
- args['actions'] = [InstanceGroupManagerActionReference.from_dict(v) for v in _dict.get('actions')]
+ raise ValueError('Required property \'min\' not present in BareMetalServerProfileDiskQuantityRange JSON')
+ if (step := _dict.get('step')) is not None:
+ args['step'] = step
else:
- raise ValueError('Required property \'actions\' not present in InstanceGroupManagerScheduled JSON')
- if 'manager_type' in _dict:
- args['manager_type'] = _dict.get('manager_type')
+ raise ValueError('Required property \'step\' not present in BareMetalServerProfileDiskQuantityRange JSON')
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
else:
- raise ValueError('Required property \'manager_type\' not present in InstanceGroupManagerScheduled JSON')
+ raise ValueError('Required property \'type\' not present in BareMetalServerProfileDiskQuantityRange JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceGroupManagerScheduled 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, 'created_at') and self.created_at is not None:
- _dict['created_at'] = datetime_to_string(self.created_at)
- if hasattr(self, 'href') and self.href is not None:
- _dict['href'] = self.href
- if hasattr(self, 'id') and self.id is not None:
- _dict['id'] = self.id
- if hasattr(self, 'management_enabled') and self.management_enabled is not None:
- _dict['management_enabled'] = self.management_enabled
- if hasattr(self, 'name') and self.name is not None:
- _dict['name'] = self.name
- if hasattr(self, 'updated_at') and self.updated_at is not None:
- _dict['updated_at'] = datetime_to_string(self.updated_at)
- if hasattr(self, 'actions') and self.actions is not None:
- actions_list = []
- for v in self.actions:
- if isinstance(v, dict):
- actions_list.append(v)
- else:
- actions_list.append(v.to_dict())
- _dict['actions'] = actions_list
- if hasattr(self, 'manager_type') and self.manager_type is not None:
- _dict['manager_type'] = self.manager_type
+ if hasattr(self, '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):
@@ -96663,126 +102469,68 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this InstanceGroupManagerScheduled object."""
+ """Return a `str` version of this BareMetalServerProfileDiskQuantityRange object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceGroupManagerScheduled') -> 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: 'InstanceGroupManagerScheduled') -> bool:
+ def __ne__(self, other: 'BareMetalServerProfileDiskQuantityRange') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class ManagerTypeEnum(str, Enum):
+ class TypeEnum(str, Enum):
"""
- The type of instance group manager.
+ The type for this profile field.
"""
- SCHEDULED = 'scheduled'
+ RANGE = 'range'
-class InstanceGroupManagerScheduledActionManagerAutoScale(InstanceGroupManagerScheduledActionManager):
+class BareMetalServerProfileDiskSizeDependent(BareMetalServerProfileDiskSize):
"""
- InstanceGroupManagerScheduledActionManagerAutoScale.
+ 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 InstanceGroupManagerReferenceDeleted deleted: (optional) If present, this
- property indicates the referenced resource has been deleted, and provides
- some supplementary information.
- :attr str href: The URL for this instance group manager.
- :attr str id: The unique identifier for this instance group manager.
- :attr str name: The name for this instance group manager. The name is unique
- across all managers for the instance group.
- :attr int max_membership_count: (optional) The desired maximum number of
- instance group members at the scheduled time.
- :attr int min_membership_count: (optional) The desired minimum number of
- instance group members at the scheduled time.
+ :param str type: The type for this profile field.
"""
def __init__(
self,
- href: str,
- id: str,
- name: str,
- *,
- deleted: 'InstanceGroupManagerReferenceDeleted' = None,
- max_membership_count: int = None,
- min_membership_count: int = None,
+ type: str,
) -> None:
"""
- Initialize a InstanceGroupManagerScheduledActionManagerAutoScale object.
+ Initialize a BareMetalServerProfileDiskSizeDependent object.
- :param str href: The URL for this instance group manager.
- :param str id: The unique identifier for this instance group manager.
- :param str name: The name for this instance group manager. The name is
- unique across all managers for the instance group.
- :param InstanceGroupManagerReferenceDeleted deleted: (optional) If present,
- this property indicates the referenced resource has been deleted, and
- provides
- some supplementary information.
- :param int max_membership_count: (optional) The desired maximum number of
- instance group members at the scheduled time.
- :param int min_membership_count: (optional) The desired minimum number of
- instance group members at the scheduled time.
+ :param str type: The type for this profile field.
"""
# pylint: disable=super-init-not-called
- self.deleted = deleted
- self.href = href
- self.id = id
- self.name = name
- self.max_membership_count = max_membership_count
- self.min_membership_count = min_membership_count
+ self.type = type
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerScheduledActionManagerAutoScale':
- """Initialize a InstanceGroupManagerScheduledActionManagerAutoScale object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileDiskSizeDependent':
+ """Initialize a BareMetalServerProfileDiskSizeDependent object from a json dictionary."""
args = {}
- if 'deleted' in _dict:
- args['deleted'] = InstanceGroupManagerReferenceDeleted.from_dict(_dict.get('deleted'))
- if 'href' in _dict:
- args['href'] = _dict.get('href')
- else:
- raise ValueError('Required property \'href\' not present in InstanceGroupManagerScheduledActionManagerAutoScale JSON')
- if 'id' in _dict:
- args['id'] = _dict.get('id')
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
else:
- raise ValueError('Required property \'id\' not present in InstanceGroupManagerScheduledActionManagerAutoScale JSON')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
- else:
- raise ValueError('Required property \'name\' not present in InstanceGroupManagerScheduledActionManagerAutoScale JSON')
- if 'max_membership_count' in _dict:
- args['max_membership_count'] = _dict.get('max_membership_count')
- if 'min_membership_count' in _dict:
- args['min_membership_count'] = _dict.get('min_membership_count')
+ raise ValueError('Required property \'type\' not present in BareMetalServerProfileDiskSizeDependent JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceGroupManagerScheduledActionManagerAutoScale 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, 'deleted') and self.deleted is not None:
- if isinstance(self.deleted, dict):
- _dict['deleted'] = self.deleted
- else:
- _dict['deleted'] = self.deleted.to_dict()
- if hasattr(self, 'href') and self.href is not None:
- _dict['href'] = self.href
- if hasattr(self, 'id') and self.id is not None:
- _dict['id'] = self.id
- if hasattr(self, 'name') and self.name is not None:
- _dict['name'] = self.name
- if hasattr(self, 'max_membership_count') and self.max_membership_count is not None:
- _dict['max_membership_count'] = self.max_membership_count
- if hasattr(self, 'min_membership_count') and self.min_membership_count is not None:
- _dict['min_membership_count'] = self.min_membership_count
+ if hasattr(self, 'type') and self.type is not None:
+ _dict['type'] = self.type
return _dict
def _to_dict(self):
@@ -96790,93 +102538,88 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this InstanceGroupManagerScheduledActionManagerAutoScale object."""
+ """Return a `str` version of this BareMetalServerProfileDiskSizeDependent object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceGroupManagerScheduledActionManagerAutoScale') -> 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: 'InstanceGroupManagerScheduledActionManagerAutoScale') -> bool:
+ def __ne__(self, other: 'BareMetalServerProfileDiskSizeDependent') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-
-class InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototype(InstanceGroupManagerScheduledActionManagerPrototype):
- """
- The auto scale manager to update, and one or more properties to be updated. Either
- `id` or `href` must be specified, in addition to at least one of
- `min_membership_count` and
- `max_membership_count`.
-
- :attr int max_membership_count: (optional) The desired maximum number of
- instance group members at the scheduled time.
- :attr int min_membership_count: (optional) The desired minimum number of
- instance group members at the scheduled time.
- """
-
- def __init__(
- self,
- *,
- max_membership_count: int = None,
- min_membership_count: int = None,
- ) -> None:
+ class TypeEnum(str, Enum):
"""
- Initialize a InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototype object.
-
- :param int max_membership_count: (optional) The desired maximum number of
- instance group members at the scheduled time.
- :param int min_membership_count: (optional) The desired minimum number of
- instance group members at the scheduled time.
+ The type for this profile field.
"""
- # pylint: disable=super-init-not-called
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeById', 'InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByHref'])
- )
- raise Exception(msg)
+ DEPENDENT = 'dependent'
-class InstancePatchProfileInstanceProfileIdentityByHref(InstancePatchProfile):
+
+
+class BareMetalServerProfileDiskSizeEnum(BareMetalServerProfileDiskSize):
"""
- InstancePatchProfileInstanceProfileIdentityByHref.
+ The permitted disk size in GB (gigabytes) of this configuration for a bare metal
+ server with this profile.
- :attr str href: The URL for this virtual server instance profile.
+ :param int default: The default value for this profile field.
+ :param str type: The type for this profile field.
+ :param List[int] values: The permitted values for this profile field.
"""
def __init__(
self,
- href: str,
+ default: int,
+ type: str,
+ values: List[int],
) -> None:
"""
- Initialize a InstancePatchProfileInstanceProfileIdentityByHref object.
+ Initialize a BareMetalServerProfileDiskSizeEnum object.
- :param str href: The URL for this virtual server instance profile.
+ :param int default: The default value for this profile field.
+ :param str type: The type for this profile field.
+ :param List[int] values: The permitted values for this profile field.
"""
# pylint: disable=super-init-not-called
- self.href = href
+ self.default = default
+ self.type = type
+ self.values = values
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstancePatchProfileInstanceProfileIdentityByHref':
- """Initialize a InstancePatchProfileInstanceProfileIdentityByHref 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 := _dict.get('default')) is not None:
+ args['default'] = default
else:
- raise ValueError('Required property \'href\' not present in InstancePatchProfileInstanceProfileIdentityByHref JSON')
+ raise ValueError('Required property \'default\' not present in BareMetalServerProfileDiskSizeEnum JSON')
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
+ else:
+ raise ValueError('Required property \'type\' not present in BareMetalServerProfileDiskSizeEnum JSON')
+ if (values := _dict.get('values')) is not None:
+ args['values'] = values
+ else:
+ raise ValueError('Required property \'values\' not present in BareMetalServerProfileDiskSizeEnum JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstancePatchProfileInstanceProfileIdentityByHref 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):
@@ -96884,61 +102627,77 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this InstancePatchProfileInstanceProfileIdentityByHref object."""
+ """Return a `str` version of this BareMetalServerProfileDiskSizeEnum object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstancePatchProfileInstanceProfileIdentityByHref') -> 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: 'InstancePatchProfileInstanceProfileIdentityByHref') -> bool:
+ def __ne__(self, other: 'BareMetalServerProfileDiskSizeEnum') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
+ class TypeEnum(str, Enum):
+ """
+ The type for this profile field.
+ """
-class InstancePatchProfileInstanceProfileIdentityByName(InstancePatchProfile):
+ ENUM = 'enum'
+
+
+
+class BareMetalServerProfileDiskSizeFixed(BareMetalServerProfileDiskSize):
"""
- InstancePatchProfileInstanceProfileIdentityByName.
+ The size of the disk in GB (gigabytes).
- :attr str name: The globally unique name for this virtual server instance
- profile.
+ :param str type: The type for this profile field.
+ :param int value: The value for this profile field.
"""
def __init__(
self,
- name: str,
+ type: str,
+ value: int,
) -> None:
"""
- Initialize a InstancePatchProfileInstanceProfileIdentityByName object.
+ Initialize a BareMetalServerProfileDiskSizeFixed object.
- :param str name: The globally unique name for this virtual server instance
- profile.
+ :param str type: The type for this profile field.
+ :param int value: The value for this profile field.
"""
# pylint: disable=super-init-not-called
- self.name = name
+ self.type = type
+ self.value = value
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstancePatchProfileInstanceProfileIdentityByName':
- """Initialize a InstancePatchProfileInstanceProfileIdentityByName object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileDiskSizeFixed':
+ """Initialize a BareMetalServerProfileDiskSizeFixed object from a json dictionary."""
args = {}
- if 'name' in _dict:
- args['name'] = _dict.get('name')
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
else:
- raise ValueError('Required property \'name\' not present in InstancePatchProfileInstanceProfileIdentityByName JSON')
+ raise ValueError('Required property \'type\' not present in BareMetalServerProfileDiskSizeFixed JSON')
+ if (value := _dict.get('value')) is not None:
+ args['value'] = value
+ else:
+ raise ValueError('Required property \'value\' not present in BareMetalServerProfileDiskSizeFixed JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstancePatchProfileInstanceProfileIdentityByName 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, '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):
@@ -96946,218 +102705,108 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this InstancePatchProfileInstanceProfileIdentityByName object."""
+ """Return a `str` version of this BareMetalServerProfileDiskSizeFixed object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstancePatchProfileInstanceProfileIdentityByName') -> 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: 'InstancePatchProfileInstanceProfileIdentityByName') -> bool:
+ def __ne__(self, other: 'BareMetalServerProfileDiskSizeFixed') -> bool:
"""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.
-
- """
-
- def __init__(
- self,
- ) -> None:
- """
- Initialize a InstancePlacementTargetPrototypeDedicatedHostGroupIdentity object.
-
- """
- # pylint: disable=super-init-not-called
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityById', 'InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN', 'InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref'])
- )
- raise Exception(msg)
-
-
-class InstancePlacementTargetPrototypeDedicatedHostIdentity(InstancePlacementTargetPrototype):
- """
- Identifies a dedicated host by a unique property.
-
- """
-
- def __init__(
- self,
- ) -> None:
+ class TypeEnum(str, Enum):
"""
- Initialize a InstancePlacementTargetPrototypeDedicatedHostIdentity object.
-
+ The type for this profile field.
"""
- # pylint: disable=super-init-not-called
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById', 'InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByCRN', 'InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByHref'])
- )
- raise Exception(msg)
+ FIXED = 'fixed'
-class InstancePlacementTargetPrototypePlacementGroupIdentity(InstancePlacementTargetPrototype):
- """
- Identifies a placement group by a unique property.
-
- """
-
- def __init__(
- self,
- ) -> None:
- """
- Initialize a InstancePlacementTargetPrototypePlacementGroupIdentity object.
-
- """
- # pylint: disable=super-init-not-called
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityById', 'InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByCRN', 'InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByHref'])
- )
- raise Exception(msg)
-class InstancePlacementTargetDedicatedHostGroupReference(InstancePlacementTarget):
+class BareMetalServerProfileDiskSizeRange(BareMetalServerProfileDiskSize):
"""
- InstancePlacementTargetDedicatedHostGroupReference.
+ The permitted range for the disk size of this configuration in GB (gigabytes) for a
+ bare metal server with this profile.
- :attr str crn: The CRN for this dedicated host group.
- :attr DedicatedHostGroupReferenceDeleted deleted: (optional) If present, this
- property indicates the referenced resource has been deleted, and provides
- some supplementary information.
- :attr str href: The URL for this dedicated host group.
- :attr str id: The unique identifier for this dedicated host group.
- :attr str name: The name for this dedicated host group. The name is unique
- across all dedicated host groups in the region.
- :attr str resource_type: The resource type.
+ :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.
"""
def __init__(
self,
- crn: str,
- href: str,
- id: str,
- name: str,
- resource_type: str,
- *,
- deleted: 'DedicatedHostGroupReferenceDeleted' = None,
+ default: int,
+ max: int,
+ min: int,
+ step: int,
+ type: str,
) -> None:
"""
- Initialize a InstancePlacementTargetDedicatedHostGroupReference object.
+ Initialize a BareMetalServerProfileDiskSizeRange object.
- :param str crn: The CRN for this dedicated host group.
- :param str href: The URL for this dedicated host group.
- :param str id: The unique identifier for this dedicated host group.
- :param str name: The name for this dedicated host group. The name is unique
- across all dedicated host groups in the region.
- :param str resource_type: The resource type.
- :param DedicatedHostGroupReferenceDeleted deleted: (optional) If present,
- this property indicates the referenced resource has been deleted, and
- provides
- some supplementary information.
+ :param int default: The default value for this profile field.
+ :param int max: The maximum value for this profile field.
+ :param int min: The minimum value for this profile field.
+ :param int step: The increment step value for this profile field.
+ :param str type: The type for this profile field.
"""
# pylint: disable=super-init-not-called
- self.crn = crn
- self.deleted = deleted
- self.href = href
- self.id = id
- self.name = name
- self.resource_type = resource_type
+ self.default = default
+ self.max = max
+ self.min = min
+ self.step = step
+ self.type = type
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstancePlacementTargetDedicatedHostGroupReference':
- """Initialize a InstancePlacementTargetDedicatedHostGroupReference object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileDiskSizeRange':
+ """Initialize a BareMetalServerProfileDiskSizeRange object from a json dictionary."""
args = {}
- if 'crn' in _dict:
- args['crn'] = _dict.get('crn')
+ if (default := _dict.get('default')) is not None:
+ args['default'] = default
else:
- raise ValueError('Required property \'crn\' not present in InstancePlacementTargetDedicatedHostGroupReference JSON')
- if 'deleted' in _dict:
- args['deleted'] = DedicatedHostGroupReferenceDeleted.from_dict(_dict.get('deleted'))
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ raise ValueError('Required property \'default\' not present in BareMetalServerProfileDiskSizeRange JSON')
+ if (max := _dict.get('max')) is not None:
+ args['max'] = max
else:
- raise ValueError('Required property \'href\' not present in InstancePlacementTargetDedicatedHostGroupReference JSON')
- if 'id' in _dict:
- args['id'] = _dict.get('id')
+ raise ValueError('Required property \'max\' not present in BareMetalServerProfileDiskSizeRange JSON')
+ if (min := _dict.get('min')) is not None:
+ args['min'] = min
else:
- raise ValueError('Required property \'id\' not present in InstancePlacementTargetDedicatedHostGroupReference JSON')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
+ raise ValueError('Required property \'min\' not present in BareMetalServerProfileDiskSizeRange JSON')
+ if (step := _dict.get('step')) is not None:
+ args['step'] = step
else:
- raise ValueError('Required property \'name\' not present in InstancePlacementTargetDedicatedHostGroupReference JSON')
- if 'resource_type' in _dict:
- args['resource_type'] = _dict.get('resource_type')
+ raise ValueError('Required property \'step\' not present in BareMetalServerProfileDiskSizeRange JSON')
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
else:
- raise ValueError('Required property \'resource_type\' not present in InstancePlacementTargetDedicatedHostGroupReference JSON')
+ raise ValueError('Required property \'type\' not present in BareMetalServerProfileDiskSizeRange JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstancePlacementTargetDedicatedHostGroupReference 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, 'crn') and self.crn is not None:
- _dict['crn'] = self.crn
- if hasattr(self, 'deleted') and self.deleted is not None:
- if isinstance(self.deleted, dict):
- _dict['deleted'] = self.deleted
- else:
- _dict['deleted'] = self.deleted.to_dict()
- if hasattr(self, 'href') and self.href is not None:
- _dict['href'] = self.href
- if hasattr(self, 'id') and self.id is not None:
- _dict['id'] = self.id
- if hasattr(self, 'name') and self.name is not None:
- _dict['name'] = self.name
- if hasattr(self, 'resource_type') and self.resource_type is not None:
- _dict['resource_type'] = self.resource_type
+ if hasattr(self, 'default') and self.default is not None:
+ _dict['default'] = self.default
+ if hasattr(self, '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):
@@ -97165,125 +102814,67 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this InstancePlacementTargetDedicatedHostGroupReference object."""
+ """Return a `str` version of this BareMetalServerProfileDiskSizeRange object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstancePlacementTargetDedicatedHostGroupReference') -> 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: 'InstancePlacementTargetDedicatedHostGroupReference') -> bool:
+ def __ne__(self, other: 'BareMetalServerProfileDiskSizeRange') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class ResourceTypeEnum(str, Enum):
+ class TypeEnum(str, Enum):
"""
- The resource type.
+ The type for this profile field.
"""
- DEDICATED_HOST_GROUP = 'dedicated_host_group'
+ RANGE = 'range'
-class InstancePlacementTargetDedicatedHostReference(InstancePlacementTarget):
+class BareMetalServerProfileIdentityByHref(BareMetalServerProfileIdentity):
"""
- InstancePlacementTargetDedicatedHostReference.
+ BareMetalServerProfileIdentityByHref.
- :attr str crn: The CRN for this dedicated host.
- :attr DedicatedHostReferenceDeleted deleted: (optional) If present, this
- property indicates the referenced resource has been deleted, and provides
- some supplementary information.
- :attr str href: The URL for this dedicated host.
- :attr str id: The unique identifier for this dedicated host.
- :attr str name: The name for this dedicated host. The name is unique across all
- dedicated hosts in the region.
- :attr str resource_type: The resource type.
+ :param str href: The URL for this bare metal server profile.
"""
def __init__(
self,
- crn: str,
href: str,
- id: str,
- name: str,
- resource_type: str,
- *,
- deleted: 'DedicatedHostReferenceDeleted' = None,
) -> None:
"""
- Initialize a InstancePlacementTargetDedicatedHostReference object.
+ Initialize a BareMetalServerProfileIdentityByHref object.
- :param str crn: The CRN for this dedicated host.
- :param str href: The URL for this dedicated host.
- :param str id: The unique identifier for this dedicated host.
- :param str name: The name for this dedicated host. The name is unique
- across all dedicated hosts in the region.
- :param str resource_type: The resource type.
- :param DedicatedHostReferenceDeleted deleted: (optional) If present, this
- property indicates the referenced resource has been deleted, and provides
- some supplementary information.
+ :param str href: The URL for this bare metal server profile.
"""
# pylint: disable=super-init-not-called
- self.crn = crn
- self.deleted = deleted
self.href = href
- self.id = id
- self.name = name
- self.resource_type = resource_type
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstancePlacementTargetDedicatedHostReference':
- """Initialize a InstancePlacementTargetDedicatedHostReference object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileIdentityByHref':
+ """Initialize a BareMetalServerProfileIdentityByHref object from a json dictionary."""
args = {}
- if 'crn' in _dict:
- args['crn'] = _dict.get('crn')
- else:
- raise ValueError('Required property \'crn\' not present in InstancePlacementTargetDedicatedHostReference JSON')
- if 'deleted' in _dict:
- args['deleted'] = DedicatedHostReferenceDeleted.from_dict(_dict.get('deleted'))
- if 'href' in _dict:
- args['href'] = _dict.get('href')
- else:
- raise ValueError('Required property \'href\' not present in InstancePlacementTargetDedicatedHostReference JSON')
- if 'id' in _dict:
- args['id'] = _dict.get('id')
- else:
- raise ValueError('Required property \'id\' not present in InstancePlacementTargetDedicatedHostReference JSON')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
- else:
- raise ValueError('Required property \'name\' not present in InstancePlacementTargetDedicatedHostReference JSON')
- if 'resource_type' in _dict:
- args['resource_type'] = _dict.get('resource_type')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'resource_type\' not present in InstancePlacementTargetDedicatedHostReference JSON')
+ raise ValueError('Required property \'href\' not present in BareMetalServerProfileIdentityByHref JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstancePlacementTargetDedicatedHostReference 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:
- if isinstance(self.deleted, dict):
- _dict['deleted'] = self.deleted
- else:
- _dict['deleted'] = self.deleted.to_dict()
if hasattr(self, 'href') and self.href is not None:
_dict['href'] = self.href
- if hasattr(self, 'id') and self.id is not None:
- _dict['id'] = self.id
- if hasattr(self, 'name') and self.name is not None:
- _dict['name'] = self.name
- if hasattr(self, 'resource_type') and self.resource_type is not None:
- _dict['resource_type'] = self.resource_type
return _dict
def _to_dict(self):
@@ -97291,125 +102882,59 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this InstancePlacementTargetDedicatedHostReference object."""
+ """Return a `str` version of this BareMetalServerProfileIdentityByHref object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstancePlacementTargetDedicatedHostReference') -> 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: 'InstancePlacementTargetDedicatedHostReference') -> bool:
+ def __ne__(self, other: 'BareMetalServerProfileIdentityByHref') -> 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 InstancePlacementTargetPlacementGroupReference(InstancePlacementTarget):
+class BareMetalServerProfileIdentityByName(BareMetalServerProfileIdentity):
"""
- InstancePlacementTargetPlacementGroupReference.
+ BareMetalServerProfileIdentityByName.
- :attr str crn: The CRN for this placement group.
- :attr PlacementGroupReferenceDeleted deleted: (optional) If present, this
- property indicates the referenced resource has been deleted, and provides
- some supplementary information.
- :attr str href: The URL for this placement group.
- :attr str id: The unique identifier for this placement group.
- :attr str name: The name for this placement group. The name is unique across all
- placement groups in the region.
- :attr str resource_type: The resource type.
+ :param str name: The name for this bare metal server profile.
"""
def __init__(
self,
- crn: str,
- href: str,
- id: str,
name: str,
- resource_type: str,
- *,
- deleted: 'PlacementGroupReferenceDeleted' = None,
) -> None:
"""
- Initialize a InstancePlacementTargetPlacementGroupReference object.
+ Initialize a BareMetalServerProfileIdentityByName object.
- :param str crn: The CRN for this placement group.
- :param str href: The URL for this placement group.
- :param str id: The unique identifier for this placement group.
- :param str name: The name for this placement group. The name is unique
- across all placement groups in the region.
- :param str resource_type: The resource type.
- :param PlacementGroupReferenceDeleted deleted: (optional) If present, this
- property indicates the referenced resource has been deleted, and provides
- some supplementary information.
+ :param str name: The name for this bare metal server profile.
"""
# pylint: disable=super-init-not-called
- self.crn = crn
- self.deleted = deleted
- self.href = href
- self.id = id
self.name = name
- self.resource_type = resource_type
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstancePlacementTargetPlacementGroupReference':
- """Initialize a InstancePlacementTargetPlacementGroupReference object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileIdentityByName':
+ """Initialize a BareMetalServerProfileIdentityByName object from a json dictionary."""
args = {}
- if 'crn' in _dict:
- args['crn'] = _dict.get('crn')
- else:
- raise ValueError('Required property \'crn\' not present in InstancePlacementTargetPlacementGroupReference JSON')
- if 'deleted' in _dict:
- args['deleted'] = PlacementGroupReferenceDeleted.from_dict(_dict.get('deleted'))
- if 'href' in _dict:
- args['href'] = _dict.get('href')
- else:
- raise ValueError('Required property \'href\' not present in InstancePlacementTargetPlacementGroupReference JSON')
- if 'id' in _dict:
- args['id'] = _dict.get('id')
- else:
- raise ValueError('Required property \'id\' not present in InstancePlacementTargetPlacementGroupReference JSON')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
- else:
- raise ValueError('Required property \'name\' not present in InstancePlacementTargetPlacementGroupReference JSON')
- if 'resource_type' in _dict:
- args['resource_type'] = _dict.get('resource_type')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
else:
- raise ValueError('Required property \'resource_type\' not present in InstancePlacementTargetPlacementGroupReference JSON')
+ raise ValueError('Required property \'name\' not present in BareMetalServerProfileIdentityByName JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstancePlacementTargetPlacementGroupReference 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, 'crn') and self.crn is not None:
- _dict['crn'] = self.crn
- if hasattr(self, 'deleted') and self.deleted is not None:
- if isinstance(self.deleted, dict):
- _dict['deleted'] = self.deleted
- else:
- _dict['deleted'] = self.deleted.to_dict()
- if hasattr(self, 'href') and self.href is not None:
- _dict['href'] = self.href
- if hasattr(self, 'id') and self.id is not None:
- _dict['id'] = self.id
if hasattr(self, 'name') and self.name is not None:
_dict['name'] = self.name
- if hasattr(self, 'resource_type') and self.resource_type is not None:
- _dict['resource_type'] = self.resource_type
return _dict
def _to_dict(self):
@@ -97417,34 +102942,26 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this InstancePlacementTargetPlacementGroupReference object."""
+ """Return a `str` version of this BareMetalServerProfileIdentityByName object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstancePlacementTargetPlacementGroupReference') -> 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: 'InstancePlacementTargetPlacementGroupReference') -> bool:
+ def __ne__(self, other: 'BareMetalServerProfileIdentityByName') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class ResourceTypeEnum(str, Enum):
- """
- The resource type.
- """
-
- PLACEMENT_GROUP = 'placement_group'
-
-
-class InstanceProfileBandwidthDependent(InstanceProfileBandwidth):
+class BareMetalServerProfileMemoryDependent(BareMetalServerProfileMemory):
"""
- The total bandwidth shared across the network interfaces and storage volumes of an
- instance with this profile depends on its configuration.
+ The memory value for a bare metal server with this profile depends on its
+ configuration.
- :attr str type: The type for this profile field.
+ :param str type: The type for this profile field.
"""
def __init__(
@@ -97452,7 +102969,7 @@ def __init__(
type: str,
) -> None:
"""
- Initialize a InstanceProfileBandwidthDependent object.
+ Initialize a BareMetalServerProfileMemoryDependent object.
:param str type: The type for this profile field.
"""
@@ -97460,18 +102977,18 @@ def __init__(
self.type = type
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstanceProfileBandwidthDependent':
- """Initialize a InstanceProfileBandwidthDependent object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileMemoryDependent':
+ """Initialize a BareMetalServerProfileMemoryDependent object from a json dictionary."""
args = {}
- if 'type' in _dict:
- args['type'] = _dict.get('type')
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
else:
- raise ValueError('Required property \'type\' not present in InstanceProfileBandwidthDependent JSON')
+ raise ValueError('Required property \'type\' not present in BareMetalServerProfileMemoryDependent JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceProfileBandwidthDependent object from a json dictionary."""
+ """Initialize a BareMetalServerProfileMemoryDependent object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -97486,16 +103003,16 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this InstanceProfileBandwidthDependent object."""
+ """Return a `str` version of this BareMetalServerProfileMemoryDependent object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceProfileBandwidthDependent') -> 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: 'InstanceProfileBandwidthDependent') -> bool:
+ def __ne__(self, other: 'BareMetalServerProfileMemoryDependent') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
@@ -97508,14 +103025,13 @@ class TypeEnum(str, Enum):
-class InstanceProfileBandwidthEnum(InstanceProfileBandwidth):
+class BareMetalServerProfileMemoryEnum(BareMetalServerProfileMemory):
"""
- The permitted total bandwidth values (in megabits per second) shared across the
- network interfaces and storage volumes of an instance with this profile.
+ The permitted memory values (in gibibytes) for a bare metal server with this profile.
- :attr int default: The default value for this profile field.
- :attr str type: The type for this profile field.
- :attr List[int] values: The permitted values for this profile field.
+ :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.
"""
def __init__(
@@ -97525,7 +103041,7 @@ def __init__(
values: List[int],
) -> None:
"""
- Initialize a InstanceProfileBandwidthEnum object.
+ Initialize a BareMetalServerProfileMemoryEnum object.
:param int default: The default value for this profile field.
:param str type: The type for this profile field.
@@ -97537,26 +103053,26 @@ def __init__(
self.values = values
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstanceProfileBandwidthEnum':
- """Initialize a InstanceProfileBandwidthEnum object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileMemoryEnum':
+ """Initialize a BareMetalServerProfileMemoryEnum object from a json dictionary."""
args = {}
- if 'default' in _dict:
- args['default'] = _dict.get('default')
+ if (default := _dict.get('default')) is not None:
+ args['default'] = default
else:
- raise ValueError('Required property \'default\' not present in InstanceProfileBandwidthEnum JSON')
- if 'type' in _dict:
- args['type'] = _dict.get('type')
+ raise ValueError('Required property \'default\' not present in BareMetalServerProfileMemoryEnum JSON')
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
else:
- raise ValueError('Required property \'type\' not present in InstanceProfileBandwidthEnum JSON')
- if 'values' in _dict:
- args['values'] = _dict.get('values')
+ raise ValueError('Required property \'type\' not present in BareMetalServerProfileMemoryEnum JSON')
+ if (values := _dict.get('values')) is not None:
+ args['values'] = values
else:
- raise ValueError('Required property \'values\' not present in InstanceProfileBandwidthEnum JSON')
+ raise ValueError('Required property \'values\' not present in BareMetalServerProfileMemoryEnum JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceProfileBandwidthEnum object from a json dictionary."""
+ """Initialize a BareMetalServerProfileMemoryEnum object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -97575,16 +103091,16 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this InstanceProfileBandwidthEnum object."""
+ """Return a `str` version of this BareMetalServerProfileMemoryEnum object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceProfileBandwidthEnum') -> 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: 'InstanceProfileBandwidthEnum') -> bool:
+ def __ne__(self, other: 'BareMetalServerProfileMemoryEnum') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
@@ -97597,13 +103113,12 @@ class TypeEnum(str, Enum):
-class InstanceProfileBandwidthFixed(InstanceProfileBandwidth):
+class BareMetalServerProfileMemoryFixed(BareMetalServerProfileMemory):
"""
- The total bandwidth (in megabits per second) shared across the network interfaces and
- storage volumes of an instance with this profile.
+ The memory (in gibibytes) for a bare metal server with this profile.
- :attr str type: The type for this profile field.
- :attr int value: The value for this profile field.
+ :param str type: The type for this profile field.
+ :param int value: The value for this profile field.
"""
def __init__(
@@ -97612,7 +103127,7 @@ def __init__(
value: int,
) -> None:
"""
- Initialize a InstanceProfileBandwidthFixed object.
+ Initialize a BareMetalServerProfileMemoryFixed object.
:param str type: The type for this profile field.
:param int value: The value for this profile field.
@@ -97622,22 +103137,22 @@ def __init__(
self.value = value
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstanceProfileBandwidthFixed':
- """Initialize a InstanceProfileBandwidthFixed object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileMemoryFixed':
+ """Initialize a BareMetalServerProfileMemoryFixed object from a json dictionary."""
args = {}
- if 'type' in _dict:
- args['type'] = _dict.get('type')
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
else:
- raise ValueError('Required property \'type\' not present in InstanceProfileBandwidthFixed JSON')
- if 'value' in _dict:
- args['value'] = _dict.get('value')
+ raise ValueError('Required property \'type\' not present in BareMetalServerProfileMemoryFixed JSON')
+ if (value := _dict.get('value')) is not None:
+ args['value'] = value
else:
- raise ValueError('Required property \'value\' not present in InstanceProfileBandwidthFixed JSON')
+ raise ValueError('Required property \'value\' not present in BareMetalServerProfileMemoryFixed JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceProfileBandwidthFixed object from a json dictionary."""
+ """Initialize a BareMetalServerProfileMemoryFixed object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -97654,16 +103169,16 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this InstanceProfileBandwidthFixed object."""
+ """Return a `str` version of this BareMetalServerProfileMemoryFixed object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceProfileBandwidthFixed') -> 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: 'InstanceProfileBandwidthFixed') -> bool:
+ def __ne__(self, other: 'BareMetalServerProfileMemoryFixed') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
@@ -97676,16 +103191,15 @@ class TypeEnum(str, Enum):
-class InstanceProfileBandwidthRange(InstanceProfileBandwidth):
+class BareMetalServerProfileMemoryRange(BareMetalServerProfileMemory):
"""
- The permitted total bandwidth range (in megabits per second) shared across the network
- interfaces and storage volumes of an instance with this profile.
+ The permitted memory range (in gibibytes) for a bare metal server with this profile.
- :attr int default: The default value for this profile field.
- :attr int max: The maximum value for this profile field.
- :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.
+ :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.
"""
def __init__(
@@ -97697,7 +103211,7 @@ def __init__(
type: str,
) -> None:
"""
- Initialize a InstanceProfileBandwidthRange object.
+ Initialize a BareMetalServerProfileMemoryRange object.
:param int default: The default value for this profile field.
:param int max: The maximum value for this profile field.
@@ -97713,34 +103227,34 @@ def __init__(
self.type = type
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstanceProfileBandwidthRange':
- """Initialize a InstanceProfileBandwidthRange object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileMemoryRange':
+ """Initialize a BareMetalServerProfileMemoryRange object from a json dictionary."""
args = {}
- if 'default' in _dict:
- args['default'] = _dict.get('default')
+ if (default := _dict.get('default')) is not None:
+ args['default'] = default
else:
- raise ValueError('Required property \'default\' not present in InstanceProfileBandwidthRange JSON')
- if 'max' in _dict:
- args['max'] = _dict.get('max')
+ raise ValueError('Required property \'default\' not present in BareMetalServerProfileMemoryRange JSON')
+ if (max := _dict.get('max')) is not None:
+ args['max'] = max
else:
- raise ValueError('Required property \'max\' not present in InstanceProfileBandwidthRange JSON')
- if 'min' in _dict:
- args['min'] = _dict.get('min')
+ raise ValueError('Required property \'max\' not present in BareMetalServerProfileMemoryRange JSON')
+ if (min := _dict.get('min')) is not None:
+ args['min'] = min
else:
- raise ValueError('Required property \'min\' not present in InstanceProfileBandwidthRange JSON')
- if 'step' in _dict:
- args['step'] = _dict.get('step')
+ raise ValueError('Required property \'min\' not present in BareMetalServerProfileMemoryRange JSON')
+ if (step := _dict.get('step')) is not None:
+ args['step'] = step
else:
- raise ValueError('Required property \'step\' not present in InstanceProfileBandwidthRange JSON')
- if 'type' in _dict:
- args['type'] = _dict.get('type')
+ raise ValueError('Required property \'step\' not present in BareMetalServerProfileMemoryRange JSON')
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
else:
- raise ValueError('Required property \'type\' not present in InstanceProfileBandwidthRange JSON')
+ raise ValueError('Required property \'type\' not present in BareMetalServerProfileMemoryRange JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceProfileBandwidthRange object from a json dictionary."""
+ """Initialize a BareMetalServerProfileMemoryRange object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -97763,16 +103277,16 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this InstanceProfileBandwidthRange object."""
+ """Return a `str` version of this BareMetalServerProfileMemoryRange object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceProfileBandwidthRange') -> 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: 'InstanceProfileBandwidthRange') -> bool:
+ def __ne__(self, other: 'BareMetalServerProfileMemoryRange') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
@@ -97785,12 +103299,12 @@ class TypeEnum(str, Enum):
-class InstanceProfileDiskQuantityDependent(InstanceProfileDiskQuantity):
+class BareMetalServerProfileNetworkAttachmentCountDependent(BareMetalServerProfileNetworkAttachmentCount):
"""
- The number of disks of this configuration for an instance with this profile depends on
- its instance configuration.
+ The number of network attachments supported on a bare metal server with this profile
+ is dependent on its configuration.
- :attr str type: The type for this profile field.
+ :param str type: The type for this profile field.
"""
def __init__(
@@ -97798,7 +103312,7 @@ def __init__(
type: str,
) -> None:
"""
- Initialize a InstanceProfileDiskQuantityDependent object.
+ Initialize a BareMetalServerProfileNetworkAttachmentCountDependent object.
:param str type: The type for this profile field.
"""
@@ -97806,18 +103320,18 @@ def __init__(
self.type = type
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstanceProfileDiskQuantityDependent':
- """Initialize a InstanceProfileDiskQuantityDependent object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileNetworkAttachmentCountDependent':
+ """Initialize a BareMetalServerProfileNetworkAttachmentCountDependent object from a json dictionary."""
args = {}
- if 'type' in _dict:
- args['type'] = _dict.get('type')
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
else:
- raise ValueError('Required property \'type\' not present in InstanceProfileDiskQuantityDependent JSON')
+ raise ValueError('Required property \'type\' not present in BareMetalServerProfileNetworkAttachmentCountDependent JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceProfileDiskQuantityDependent object from a json dictionary."""
+ """Initialize a BareMetalServerProfileNetworkAttachmentCountDependent object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -97832,16 +103346,16 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this InstanceProfileDiskQuantityDependent object."""
+ """Return a `str` version of this BareMetalServerProfileNetworkAttachmentCountDependent object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceProfileDiskQuantityDependent') -> bool:
+ def __eq__(self, other: 'BareMetalServerProfileNetworkAttachmentCountDependent') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'InstanceProfileDiskQuantityDependent') -> bool:
+ def __ne__(self, other: 'BareMetalServerProfileNetworkAttachmentCountDependent') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
@@ -97854,66 +103368,62 @@ class TypeEnum(str, Enum):
-class InstanceProfileDiskQuantityEnum(InstanceProfileDiskQuantity):
+class BareMetalServerProfileNetworkAttachmentCountRange(BareMetalServerProfileNetworkAttachmentCount):
"""
- The permitted the number of disks of this configuration for an instance with this
- profile.
+ The number of network attachments supported on 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.
+ :param int max: (optional) The maximum value for this profile field.
+ :param int min: (optional) The minimum value for this profile field.
+ :param str type: The type for this profile field.
"""
def __init__(
self,
- default: int,
type: str,
- values: List[int],
+ *,
+ max: Optional[int] = None,
+ min: Optional[int] = None,
) -> None:
"""
- Initialize a InstanceProfileDiskQuantityEnum object.
+ Initialize a BareMetalServerProfileNetworkAttachmentCountRange object.
- :param int default: The default value for this profile field.
:param str type: The type for this profile field.
- :param List[int] values: The permitted values for this profile field.
+ :param int max: (optional) The maximum value for this profile field.
+ :param int min: (optional) The minimum value for this profile field.
"""
# pylint: disable=super-init-not-called
- self.default = default
+ self.max = max
+ self.min = min
self.type = type
- self.values = values
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstanceProfileDiskQuantityEnum':
- """Initialize a InstanceProfileDiskQuantityEnum object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileNetworkAttachmentCountRange':
+ """Initialize a BareMetalServerProfileNetworkAttachmentCountRange object from a json dictionary."""
args = {}
- if 'default' in _dict:
- args['default'] = _dict.get('default')
- else:
- raise ValueError('Required property \'default\' not present in InstanceProfileDiskQuantityEnum JSON')
- if 'type' in _dict:
- args['type'] = _dict.get('type')
- else:
- raise ValueError('Required property \'type\' not present in InstanceProfileDiskQuantityEnum JSON')
- if 'values' in _dict:
- args['values'] = _dict.get('values')
+ if (max := _dict.get('max')) is not None:
+ args['max'] = max
+ if (min := _dict.get('min')) is not None:
+ args['min'] = min
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
else:
- raise ValueError('Required property \'values\' not present in InstanceProfileDiskQuantityEnum JSON')
+ raise ValueError('Required property \'type\' not present in BareMetalServerProfileNetworkAttachmentCountRange JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceProfileDiskQuantityEnum object from a json dictionary."""
+ """Initialize a BareMetalServerProfileNetworkAttachmentCountRange object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'default') and self.default is not None:
- _dict['default'] = self.default
+ if hasattr(self, 'max') and self.max is not None:
+ _dict['max'] = self.max
+ if hasattr(self, 'min') and self.min is not None:
+ _dict['min'] = self.min
if hasattr(self, 'type') and self.type is not None:
_dict['type'] = self.type
- if hasattr(self, 'values') and self.values is not None:
- _dict['values'] = self.values
return _dict
def _to_dict(self):
@@ -97921,16 +103431,16 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this InstanceProfileDiskQuantityEnum object."""
+ """Return a `str` version of this BareMetalServerProfileNetworkAttachmentCountRange object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceProfileDiskQuantityEnum') -> bool:
+ def __eq__(self, other: 'BareMetalServerProfileNetworkAttachmentCountRange') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'InstanceProfileDiskQuantityEnum') -> bool:
+ def __ne__(self, other: 'BareMetalServerProfileNetworkAttachmentCountRange') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
@@ -97939,50 +103449,43 @@ class TypeEnum(str, Enum):
The type for this profile field.
"""
- ENUM = 'enum'
+ RANGE = 'range'
-class InstanceProfileDiskQuantityFixed(InstanceProfileDiskQuantity):
+class BareMetalServerProfileNetworkInterfaceCountDependent(BareMetalServerProfileNetworkInterfaceCount):
"""
- The number of disks of this configuration for an instance with this profile.
+ The number of bare metal server network interfaces supported on a bare metal server
+ with this profile is dependent on its configuration.
- :attr str type: The type for this profile field.
- :attr int value: The value for this profile field.
+ :param str type: The type for this profile field.
"""
def __init__(
self,
type: str,
- value: int,
) -> None:
"""
- Initialize a InstanceProfileDiskQuantityFixed object.
+ Initialize a BareMetalServerProfileNetworkInterfaceCountDependent object.
:param str type: The type for this profile field.
- :param int value: The value for this profile field.
"""
# pylint: disable=super-init-not-called
self.type = type
- self.value = value
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstanceProfileDiskQuantityFixed':
- """Initialize a InstanceProfileDiskQuantityFixed object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileNetworkInterfaceCountDependent':
+ """Initialize a BareMetalServerProfileNetworkInterfaceCountDependent object from a json dictionary."""
args = {}
- if 'type' in _dict:
- args['type'] = _dict.get('type')
- else:
- raise ValueError('Required property \'type\' not present in InstanceProfileDiskQuantityFixed JSON')
- if 'value' in _dict:
- args['value'] = _dict.get('value')
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
else:
- raise ValueError('Required property \'value\' not present in InstanceProfileDiskQuantityFixed JSON')
+ raise ValueError('Required property \'type\' not present in BareMetalServerProfileNetworkInterfaceCountDependent JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceProfileDiskQuantityFixed object from a json dictionary."""
+ """Initialize a BareMetalServerProfileNetworkInterfaceCountDependent object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -97990,8 +103493,6 @@ def to_dict(self) -> Dict:
_dict = {}
if hasattr(self, 'type') and self.type is not None:
_dict['type'] = self.type
- if hasattr(self, 'value') and self.value is not None:
- _dict['value'] = self.value
return _dict
def _to_dict(self):
@@ -97999,16 +103500,16 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this InstanceProfileDiskQuantityFixed object."""
+ """Return a `str` version of this BareMetalServerProfileNetworkInterfaceCountDependent object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceProfileDiskQuantityFixed') -> bool:
+ def __eq__(self, other: 'BareMetalServerProfileNetworkInterfaceCountDependent') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'InstanceProfileDiskQuantityFixed') -> bool:
+ def __ne__(self, other: 'BareMetalServerProfileNetworkInterfaceCountDependent') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
@@ -98017,88 +103518,65 @@ class TypeEnum(str, Enum):
The type for this profile field.
"""
- FIXED = 'fixed'
+ DEPENDENT = 'dependent'
-class InstanceProfileDiskQuantityRange(InstanceProfileDiskQuantity):
+class BareMetalServerProfileNetworkInterfaceCountRange(BareMetalServerProfileNetworkInterfaceCount):
"""
- The permitted range for the number of disks of this configuration for an instance with
- this profile.
+ The number of bare metal server network interfaces supported on a bare metal server
+ with this profile.
- :attr int default: The default value for this profile field.
- :attr int max: 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.
+ :param int max: (optional) The maximum value for this profile field.
+ :param int min: (optional) The minimum value for this profile field.
+ :param str type: The type for this profile field.
"""
def __init__(
self,
- default: int,
- max: int,
- min: int,
- step: int,
type: str,
+ *,
+ max: Optional[int] = None,
+ min: Optional[int] = None,
) -> None:
"""
- Initialize a InstanceProfileDiskQuantityRange object.
+ Initialize a BareMetalServerProfileNetworkInterfaceCountRange object.
- :param int default: The default value for this profile field.
- :param int max: The maximum value for this profile field.
- :param int min: The minimum value for this profile field.
- :param int step: The increment step value for this profile field.
:param str type: The type for this profile field.
+ :param int max: (optional) The maximum value for this profile field.
+ :param int min: (optional) The minimum value for this profile field.
"""
# pylint: disable=super-init-not-called
- self.default = default
self.max = max
self.min = min
- self.step = step
self.type = type
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstanceProfileDiskQuantityRange':
- """Initialize a InstanceProfileDiskQuantityRange object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileNetworkInterfaceCountRange':
+ """Initialize a BareMetalServerProfileNetworkInterfaceCountRange object from a json dictionary."""
args = {}
- if 'default' in _dict:
- args['default'] = _dict.get('default')
- else:
- raise ValueError('Required property \'default\' not present in InstanceProfileDiskQuantityRange JSON')
- if 'max' in _dict:
- args['max'] = _dict.get('max')
- else:
- raise ValueError('Required property \'max\' not present in InstanceProfileDiskQuantityRange JSON')
- if 'min' in _dict:
- args['min'] = _dict.get('min')
- else:
- raise ValueError('Required property \'min\' not present in InstanceProfileDiskQuantityRange JSON')
- if 'step' in _dict:
- args['step'] = _dict.get('step')
- else:
- raise ValueError('Required property \'step\' not present in InstanceProfileDiskQuantityRange JSON')
- if 'type' in _dict:
- args['type'] = _dict.get('type')
+ if (max := _dict.get('max')) is not None:
+ args['max'] = max
+ if (min := _dict.get('min')) is not None:
+ args['min'] = min
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
else:
- raise ValueError('Required property \'type\' not present in InstanceProfileDiskQuantityRange JSON')
+ raise ValueError('Required property \'type\' not present in BareMetalServerProfileNetworkInterfaceCountRange JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceProfileDiskQuantityRange object from a json dictionary."""
+ """Initialize a BareMetalServerProfileNetworkInterfaceCountRange object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'default') and self.default is not None:
- _dict['default'] = self.default
if hasattr(self, 'max') and self.max is not None:
_dict['max'] = self.max
if hasattr(self, 'min') and self.min is not None:
_dict['min'] = self.min
- if hasattr(self, '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
@@ -98108,16 +103586,16 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this InstanceProfileDiskQuantityRange object."""
+ """Return a `str` version of this BareMetalServerProfileNetworkInterfaceCountRange object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceProfileDiskQuantityRange') -> bool:
+ def __eq__(self, other: 'BareMetalServerProfileNetworkInterfaceCountRange') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'InstanceProfileDiskQuantityRange') -> bool:
+ def __ne__(self, other: 'BareMetalServerProfileNetworkInterfaceCountRange') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
@@ -98130,46 +103608,181 @@ class TypeEnum(str, Enum):
-class InstanceProfileDiskSizeDependent(InstanceProfileDiskSize):
+class BareMetalServerPrototypeBareMetalServerByNetworkAttachment(BareMetalServerPrototype):
"""
- The disk size in GB (gigabytes) of this configuration for an instance with this
- profile depends on its instance configuration.
+ BareMetalServerPrototypeBareMetalServerByNetworkAttachment.
- :attr str type: The type for this profile field.
+ :param bool enable_secure_boot: (optional) Indicates whether secure boot is
+ enabled. If enabled, the image must support secure boot or the server will fail
+ to boot.
+ :param BareMetalServerInitializationPrototype initialization:
+ :param str name: (optional) The name for this bare metal server. The name must
+ not be used by another bare metal server in the region. If unspecified, the name
+ will be a hyphenated list of randomly-selected words.
+ The system hostname will be based on this name.
+ :param BareMetalServerProfileIdentity profile: The
+ [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-bare-metal-servers-profile)
+ to use for this bare metal server.
+ :param ResourceGroupIdentity resource_group: (optional)
+ :param BareMetalServerTrustedPlatformModulePrototype trusted_platform_module:
+ (optional)
+ :param VPCIdentity vpc: (optional) The VPC this bare metal server will reside
+ in.
+ If specified, it must match the VPC for the subnets that the network attachments
+ or network interfaces of the bare metal server are attached to.
+ :param ZoneIdentity zone: The zone this bare metal server will reside in.
+ :param List[BareMetalServerNetworkAttachmentPrototype] network_attachments:
+ (optional) The additional network attachments to create for the bare metal
+ server.
+ :param BareMetalServerPrimaryNetworkAttachmentPrototype
+ primary_network_attachment: The primary network attachment to create for the
+ bare metal server.
"""
def __init__(
self,
- type: str,
+ initialization: 'BareMetalServerInitializationPrototype',
+ profile: 'BareMetalServerProfileIdentity',
+ zone: 'ZoneIdentity',
+ primary_network_attachment: 'BareMetalServerPrimaryNetworkAttachmentPrototype',
+ *,
+ enable_secure_boot: Optional[bool] = None,
+ name: Optional[str] = None,
+ resource_group: Optional['ResourceGroupIdentity'] = None,
+ trusted_platform_module: Optional['BareMetalServerTrustedPlatformModulePrototype'] = None,
+ vpc: Optional['VPCIdentity'] = None,
+ network_attachments: Optional[List['BareMetalServerNetworkAttachmentPrototype']] = None,
) -> None:
"""
- Initialize a InstanceProfileDiskSizeDependent object.
+ Initialize a BareMetalServerPrototypeBareMetalServerByNetworkAttachment object.
- :param str type: The type for this profile field.
+ :param BareMetalServerInitializationPrototype initialization:
+ :param BareMetalServerProfileIdentity profile: The
+ [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-bare-metal-servers-profile)
+ to use for this bare metal server.
+ :param ZoneIdentity zone: The zone this bare metal server will reside in.
+ :param BareMetalServerPrimaryNetworkAttachmentPrototype
+ primary_network_attachment: The primary network attachment to create for
+ the bare metal server.
+ :param bool enable_secure_boot: (optional) Indicates whether secure boot is
+ enabled. If enabled, the image must support secure boot or the server will
+ fail to boot.
+ :param str name: (optional) The name for this bare metal server. The name
+ must not be used by another bare metal server in the region. If
+ unspecified, the name will be a hyphenated list of randomly-selected words.
+ The system hostname will be based on this name.
+ :param ResourceGroupIdentity resource_group: (optional)
+ :param BareMetalServerTrustedPlatformModulePrototype
+ trusted_platform_module: (optional)
+ :param VPCIdentity vpc: (optional) The VPC this bare metal server will
+ reside in.
+ If specified, it must match the VPC for the subnets that the network
+ attachments or network interfaces of the bare metal server are attached to.
+ :param List[BareMetalServerNetworkAttachmentPrototype] network_attachments:
+ (optional) The additional network attachments to create for the bare metal
+ server.
"""
# pylint: disable=super-init-not-called
- self.type = type
+ self.enable_secure_boot = enable_secure_boot
+ self.initialization = initialization
+ self.name = name
+ self.profile = profile
+ self.resource_group = resource_group
+ self.trusted_platform_module = trusted_platform_module
+ self.vpc = vpc
+ self.zone = zone
+ self.network_attachments = network_attachments
+ self.primary_network_attachment = primary_network_attachment
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstanceProfileDiskSizeDependent':
- """Initialize a InstanceProfileDiskSizeDependent object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'BareMetalServerPrototypeBareMetalServerByNetworkAttachment':
+ """Initialize a BareMetalServerPrototypeBareMetalServerByNetworkAttachment object from a json dictionary."""
args = {}
- if 'type' in _dict:
- args['type'] = _dict.get('type')
+ if (enable_secure_boot := _dict.get('enable_secure_boot')) is not None:
+ args['enable_secure_boot'] = enable_secure_boot
+ if (initialization := _dict.get('initialization')) is not None:
+ args['initialization'] = BareMetalServerInitializationPrototype.from_dict(initialization)
else:
- raise ValueError('Required property \'type\' not present in InstanceProfileDiskSizeDependent JSON')
+ raise ValueError('Required property \'initialization\' not present in BareMetalServerPrototypeBareMetalServerByNetworkAttachment JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ if (profile := _dict.get('profile')) is not None:
+ args['profile'] = profile
+ else:
+ raise ValueError('Required property \'profile\' not present in BareMetalServerPrototypeBareMetalServerByNetworkAttachment JSON')
+ if (resource_group := _dict.get('resource_group')) is not None:
+ args['resource_group'] = resource_group
+ if (trusted_platform_module := _dict.get('trusted_platform_module')) is not None:
+ args['trusted_platform_module'] = BareMetalServerTrustedPlatformModulePrototype.from_dict(trusted_platform_module)
+ if (vpc := _dict.get('vpc')) is not None:
+ args['vpc'] = vpc
+ if (zone := _dict.get('zone')) is not None:
+ args['zone'] = zone
+ else:
+ raise ValueError('Required property \'zone\' not present in BareMetalServerPrototypeBareMetalServerByNetworkAttachment JSON')
+ if (network_attachments := _dict.get('network_attachments')) is not None:
+ args['network_attachments'] = network_attachments
+ if (primary_network_attachment := _dict.get('primary_network_attachment')) is not None:
+ args['primary_network_attachment'] = primary_network_attachment
+ else:
+ raise ValueError('Required property \'primary_network_attachment\' not present in BareMetalServerPrototypeBareMetalServerByNetworkAttachment JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceProfileDiskSizeDependent object from a json dictionary."""
+ """Initialize a BareMetalServerPrototypeBareMetalServerByNetworkAttachment object from 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, 'enable_secure_boot') and self.enable_secure_boot is not None:
+ _dict['enable_secure_boot'] = self.enable_secure_boot
+ if hasattr(self, 'initialization') and self.initialization is not None:
+ if isinstance(self.initialization, dict):
+ _dict['initialization'] = self.initialization
+ else:
+ _dict['initialization'] = self.initialization.to_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, '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, 'trusted_platform_module') and self.trusted_platform_module is not None:
+ if isinstance(self.trusted_platform_module, dict):
+ _dict['trusted_platform_module'] = self.trusted_platform_module
+ else:
+ _dict['trusted_platform_module'] = self.trusted_platform_module.to_dict()
+ if hasattr(self, 'vpc') and self.vpc is not None:
+ if isinstance(self.vpc, dict):
+ _dict['vpc'] = self.vpc
+ else:
+ _dict['vpc'] = self.vpc.to_dict()
+ if hasattr(self, 'zone') and self.zone is not None:
+ if isinstance(self.zone, dict):
+ _dict['zone'] = self.zone
+ else:
+ _dict['zone'] = self.zone.to_dict()
+ if hasattr(self, 'network_attachments') and self.network_attachments is not None:
+ network_attachments_list = []
+ for v in self.network_attachments:
+ if isinstance(v, dict):
+ network_attachments_list.append(v)
+ else:
+ network_attachments_list.append(v.to_dict())
+ _dict['network_attachments'] = network_attachments_list
+ if hasattr(self, 'primary_network_attachment') and self.primary_network_attachment is not None:
+ if isinstance(self.primary_network_attachment, dict):
+ _dict['primary_network_attachment'] = self.primary_network_attachment
+ else:
+ _dict['primary_network_attachment'] = self.primary_network_attachment.to_dict()
return _dict
def _to_dict(self):
@@ -98177,88 +103790,193 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this InstanceProfileDiskSizeDependent object."""
+ """Return a `str` version of this BareMetalServerPrototypeBareMetalServerByNetworkAttachment object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceProfileDiskSizeDependent') -> bool:
+ def __eq__(self, other: 'BareMetalServerPrototypeBareMetalServerByNetworkAttachment') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'InstanceProfileDiskSizeDependent') -> bool:
+ def __ne__(self, other: 'BareMetalServerPrototypeBareMetalServerByNetworkAttachment') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class TypeEnum(str, Enum):
- """
- The type for this profile field.
- """
-
- DEPENDENT = 'dependent'
-
-
-class InstanceProfileDiskSizeEnum(InstanceProfileDiskSize):
+class BareMetalServerPrototypeBareMetalServerByNetworkInterface(BareMetalServerPrototype):
"""
- The permitted disk size in GB (gigabytes) of this configuration for an instance with
- this profile.
+ BareMetalServerPrototypeBareMetalServerByNetworkInterface.
- :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.
+ :param bool enable_secure_boot: (optional) Indicates whether secure boot is
+ enabled. If enabled, the image must support secure boot or the server will fail
+ to boot.
+ :param BareMetalServerInitializationPrototype initialization:
+ :param str name: (optional) The name for this bare metal server. The name must
+ not be used by another bare metal server in the region. If unspecified, the name
+ will be a hyphenated list of randomly-selected words.
+ The system hostname will be based on this name.
+ :param BareMetalServerProfileIdentity profile: The
+ [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-bare-metal-servers-profile)
+ to use for this bare metal server.
+ :param ResourceGroupIdentity resource_group: (optional)
+ :param BareMetalServerTrustedPlatformModulePrototype trusted_platform_module:
+ (optional)
+ :param VPCIdentity vpc: (optional) The VPC this bare metal server will reside
+ in.
+ If specified, it must match the VPC for the subnets that the network attachments
+ or network interfaces of the bare metal server are attached to.
+ :param ZoneIdentity zone: The zone this bare metal server will reside in.
+ :param List[BareMetalServerNetworkInterfacePrototype] network_interfaces:
+ (optional) The additional bare metal server network interfaces to create.
+ :param BareMetalServerPrimaryNetworkInterfacePrototype
+ primary_network_interface: The primary bare metal server network interface to
+ create.
"""
def __init__(
self,
- default: int,
- type: str,
- values: List[int],
+ initialization: 'BareMetalServerInitializationPrototype',
+ profile: 'BareMetalServerProfileIdentity',
+ zone: 'ZoneIdentity',
+ primary_network_interface: 'BareMetalServerPrimaryNetworkInterfacePrototype',
+ *,
+ enable_secure_boot: Optional[bool] = None,
+ name: Optional[str] = None,
+ resource_group: Optional['ResourceGroupIdentity'] = None,
+ trusted_platform_module: Optional['BareMetalServerTrustedPlatformModulePrototype'] = None,
+ vpc: Optional['VPCIdentity'] = None,
+ network_interfaces: Optional[List['BareMetalServerNetworkInterfacePrototype']] = None,
) -> None:
"""
- Initialize a InstanceProfileDiskSizeEnum object.
+ Initialize a BareMetalServerPrototypeBareMetalServerByNetworkInterface object.
- :param int default: The default value for this profile field.
- :param str type: The type for this profile field.
- :param List[int] values: The permitted values for this profile field.
+ :param BareMetalServerInitializationPrototype initialization:
+ :param BareMetalServerProfileIdentity profile: The
+ [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-bare-metal-servers-profile)
+ to use for this bare metal server.
+ :param ZoneIdentity zone: The zone this bare metal server will reside in.
+ :param BareMetalServerPrimaryNetworkInterfacePrototype
+ primary_network_interface: The primary bare metal server network interface
+ to create.
+ :param bool enable_secure_boot: (optional) Indicates whether secure boot is
+ enabled. If enabled, the image must support secure boot or the server will
+ fail to boot.
+ :param str name: (optional) The name for this bare metal server. The name
+ must not be used by another bare metal server in the region. If
+ unspecified, the name will be a hyphenated list of randomly-selected words.
+ The system hostname will be based on this name.
+ :param ResourceGroupIdentity resource_group: (optional)
+ :param BareMetalServerTrustedPlatformModulePrototype
+ trusted_platform_module: (optional)
+ :param VPCIdentity vpc: (optional) The VPC this bare metal server will
+ reside in.
+ If specified, it must match the VPC for the subnets that the network
+ attachments or network interfaces of the bare metal server are attached to.
+ :param List[BareMetalServerNetworkInterfacePrototype] network_interfaces:
+ (optional) The additional bare metal server network interfaces to create.
"""
# pylint: disable=super-init-not-called
- self.default = default
- self.type = type
- self.values = values
+ self.enable_secure_boot = enable_secure_boot
+ self.initialization = initialization
+ self.name = name
+ self.profile = profile
+ self.resource_group = resource_group
+ self.trusted_platform_module = trusted_platform_module
+ self.vpc = vpc
+ self.zone = zone
+ self.network_interfaces = network_interfaces
+ self.primary_network_interface = primary_network_interface
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstanceProfileDiskSizeEnum':
- """Initialize a InstanceProfileDiskSizeEnum object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'BareMetalServerPrototypeBareMetalServerByNetworkInterface':
+ """Initialize a BareMetalServerPrototypeBareMetalServerByNetworkInterface object from a json dictionary."""
args = {}
- if 'default' in _dict:
- args['default'] = _dict.get('default')
+ if (enable_secure_boot := _dict.get('enable_secure_boot')) is not None:
+ args['enable_secure_boot'] = enable_secure_boot
+ if (initialization := _dict.get('initialization')) is not None:
+ args['initialization'] = BareMetalServerInitializationPrototype.from_dict(initialization)
else:
- raise ValueError('Required property \'default\' not present in InstanceProfileDiskSizeEnum JSON')
- if 'type' in _dict:
- args['type'] = _dict.get('type')
+ raise ValueError('Required property \'initialization\' not present in BareMetalServerPrototypeBareMetalServerByNetworkInterface JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ if (profile := _dict.get('profile')) is not None:
+ args['profile'] = profile
else:
- raise ValueError('Required property \'type\' not present in InstanceProfileDiskSizeEnum JSON')
- if 'values' in _dict:
- args['values'] = _dict.get('values')
+ raise ValueError('Required property \'profile\' not present in BareMetalServerPrototypeBareMetalServerByNetworkInterface JSON')
+ if (resource_group := _dict.get('resource_group')) is not None:
+ args['resource_group'] = resource_group
+ if (trusted_platform_module := _dict.get('trusted_platform_module')) is not None:
+ args['trusted_platform_module'] = BareMetalServerTrustedPlatformModulePrototype.from_dict(trusted_platform_module)
+ if (vpc := _dict.get('vpc')) is not None:
+ args['vpc'] = vpc
+ if (zone := _dict.get('zone')) is not None:
+ args['zone'] = zone
else:
- raise ValueError('Required property \'values\' not present in InstanceProfileDiskSizeEnum JSON')
+ raise ValueError('Required property \'zone\' not present in BareMetalServerPrototypeBareMetalServerByNetworkInterface JSON')
+ if (network_interfaces := _dict.get('network_interfaces')) is not None:
+ args['network_interfaces'] = [BareMetalServerNetworkInterfacePrototype.from_dict(v) for v in network_interfaces]
+ if (primary_network_interface := _dict.get('primary_network_interface')) is not None:
+ args['primary_network_interface'] = BareMetalServerPrimaryNetworkInterfacePrototype.from_dict(primary_network_interface)
+ else:
+ raise ValueError('Required property \'primary_network_interface\' not present in BareMetalServerPrototypeBareMetalServerByNetworkInterface JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceProfileDiskSizeEnum object from a json dictionary."""
+ """Initialize a BareMetalServerPrototypeBareMetalServerByNetworkInterface object from 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, 'enable_secure_boot') and self.enable_secure_boot is not None:
+ _dict['enable_secure_boot'] = self.enable_secure_boot
+ if hasattr(self, 'initialization') and self.initialization is not None:
+ if isinstance(self.initialization, dict):
+ _dict['initialization'] = self.initialization
+ else:
+ _dict['initialization'] = self.initialization.to_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, '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, 'trusted_platform_module') and self.trusted_platform_module is not None:
+ if isinstance(self.trusted_platform_module, dict):
+ _dict['trusted_platform_module'] = self.trusted_platform_module
+ else:
+ _dict['trusted_platform_module'] = self.trusted_platform_module.to_dict()
+ if hasattr(self, 'vpc') and self.vpc is not None:
+ if isinstance(self.vpc, dict):
+ _dict['vpc'] = self.vpc
+ else:
+ _dict['vpc'] = self.vpc.to_dict()
+ if hasattr(self, 'zone') and self.zone is not None:
+ if isinstance(self.zone, dict):
+ _dict['zone'] = self.zone
+ else:
+ _dict['zone'] = self.zone.to_dict()
+ if hasattr(self, 'network_interfaces') and self.network_interfaces is not None:
+ network_interfaces_list = []
+ for v in self.network_interfaces:
+ if isinstance(v, dict):
+ network_interfaces_list.append(v)
+ else:
+ network_interfaces_list.append(v.to_dict())
+ _dict['network_interfaces'] = network_interfaces_list
+ if hasattr(self, 'primary_network_interface') and self.primary_network_interface is not None:
+ if isinstance(self.primary_network_interface, dict):
+ _dict['primary_network_interface'] = self.primary_network_interface
+ else:
+ _dict['primary_network_interface'] = self.primary_network_interface.to_dict()
return _dict
def _to_dict(self):
@@ -98266,77 +103984,63 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this InstanceProfileDiskSizeEnum object."""
+ """Return a `str` version of this BareMetalServerPrototypeBareMetalServerByNetworkInterface object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceProfileDiskSizeEnum') -> bool:
+ def __eq__(self, other: 'BareMetalServerPrototypeBareMetalServerByNetworkInterface') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'InstanceProfileDiskSizeEnum') -> bool:
+ def __ne__(self, other: 'BareMetalServerPrototypeBareMetalServerByNetworkInterface') -> 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 InstanceProfileDiskSizeFixed(InstanceProfileDiskSize):
+class CatalogOfferingIdentityCatalogOfferingByCRN(CatalogOfferingIdentity):
"""
- The size of the disk in GB (gigabytes).
+ CatalogOfferingIdentityCatalogOfferingByCRN.
- :attr str type: The type for this profile field.
- :attr int value: The value for this profile field.
+ :param str crn: The CRN for this
+ [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user)
+ offering.
"""
def __init__(
self,
- type: str,
- value: int,
+ crn: str,
) -> None:
"""
- Initialize a InstanceProfileDiskSizeFixed object.
+ Initialize a CatalogOfferingIdentityCatalogOfferingByCRN object.
- :param str type: The type for this profile field.
- :param int value: The value for this profile field.
+ :param str crn: The CRN for this
+ [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user)
+ offering.
"""
# pylint: disable=super-init-not-called
- self.type = type
- self.value = value
+ self.crn = crn
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstanceProfileDiskSizeFixed':
- """Initialize a InstanceProfileDiskSizeFixed object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'CatalogOfferingIdentityCatalogOfferingByCRN':
+ """Initialize a CatalogOfferingIdentityCatalogOfferingByCRN object from a json dictionary."""
args = {}
- if 'type' in _dict:
- args['type'] = _dict.get('type')
- else:
- raise ValueError('Required property \'type\' not present in InstanceProfileDiskSizeFixed JSON')
- if 'value' in _dict:
- args['value'] = _dict.get('value')
+ if (crn := _dict.get('crn')) is not None:
+ args['crn'] = crn
else:
- raise ValueError('Required property \'value\' not present in InstanceProfileDiskSizeFixed JSON')
+ raise ValueError('Required property \'crn\' not present in CatalogOfferingIdentityCatalogOfferingByCRN JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceProfileDiskSizeFixed object from a json dictionary."""
+ """Initialize a CatalogOfferingIdentityCatalogOfferingByCRN object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'type') and self.type is not None:
- _dict['type'] = self.type
- if hasattr(self, 'value') and self.value is not None:
- _dict['value'] = self.value
+ if hasattr(self, 'crn') and self.crn is not None:
+ _dict['crn'] = self.crn
return _dict
def _to_dict(self):
@@ -98344,108 +104048,63 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this InstanceProfileDiskSizeFixed object."""
+ """Return a `str` version of this CatalogOfferingIdentityCatalogOfferingByCRN object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceProfileDiskSizeFixed') -> bool:
+ def __eq__(self, other: 'CatalogOfferingIdentityCatalogOfferingByCRN') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'InstanceProfileDiskSizeFixed') -> bool:
+ def __ne__(self, other: 'CatalogOfferingIdentityCatalogOfferingByCRN') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class TypeEnum(str, Enum):
- """
- The type for this profile field.
- """
-
- FIXED = 'fixed'
-
-
-class InstanceProfileDiskSizeRange(InstanceProfileDiskSize):
+class CatalogOfferingVersionIdentityCatalogOfferingVersionByCRN(CatalogOfferingVersionIdentity):
"""
- The permitted range for the disk size of this configuration in GB (gigabytes) for an
- instance with this profile.
+ CatalogOfferingVersionIdentityCatalogOfferingVersionByCRN.
- :attr int default: The default value for this profile field.
- :attr int max: The maximum value for this profile field.
- :attr int min: The minimum value for this profile field.
- :attr int step: The increment step value for this profile field.
- :attr str type: The type for this profile field.
+ :param str crn: The CRN for this version of a
+ [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user)
+ offering.
"""
def __init__(
self,
- default: int,
- max: int,
- min: int,
- step: int,
- type: str,
+ crn: str,
) -> None:
"""
- Initialize a InstanceProfileDiskSizeRange object.
+ Initialize a CatalogOfferingVersionIdentityCatalogOfferingVersionByCRN object.
- :param int default: The default value for this profile field.
- :param int max: The maximum value for this profile field.
- :param int min: The minimum value for this profile field.
- :param int step: The increment step value for this profile field.
- :param str type: The type for this profile field.
+ :param str crn: The CRN for this version of a
+ [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user)
+ offering.
"""
# pylint: disable=super-init-not-called
- self.default = default
- self.max = max
- self.min = min
- self.step = step
- self.type = type
+ self.crn = crn
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstanceProfileDiskSizeRange':
- """Initialize a InstanceProfileDiskSizeRange object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'CatalogOfferingVersionIdentityCatalogOfferingVersionByCRN':
+ """Initialize a CatalogOfferingVersionIdentityCatalogOfferingVersionByCRN object from a json dictionary."""
args = {}
- if 'default' in _dict:
- args['default'] = _dict.get('default')
- else:
- raise ValueError('Required property \'default\' not present in InstanceProfileDiskSizeRange JSON')
- if 'max' in _dict:
- args['max'] = _dict.get('max')
+ if (crn := _dict.get('crn')) is not None:
+ args['crn'] = crn
else:
- raise ValueError('Required property \'max\' not present in InstanceProfileDiskSizeRange JSON')
- if 'min' in _dict:
- args['min'] = _dict.get('min')
- else:
- raise ValueError('Required property \'min\' not present in InstanceProfileDiskSizeRange JSON')
- if 'step' in _dict:
- args['step'] = _dict.get('step')
- else:
- raise ValueError('Required property \'step\' not present in InstanceProfileDiskSizeRange JSON')
- if 'type' in _dict:
- args['type'] = _dict.get('type')
- else:
- raise ValueError('Required property \'type\' not present in InstanceProfileDiskSizeRange JSON')
+ raise ValueError('Required property \'crn\' not present in CatalogOfferingVersionIdentityCatalogOfferingVersionByCRN JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceProfileDiskSizeRange object from a json dictionary."""
+ """Initialize a CatalogOfferingVersionIdentityCatalogOfferingVersionByCRN object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'default') and self.default is not None:
- _dict['default'] = self.default
- if hasattr(self, 'max') and self.max is not None:
- _dict['max'] = self.max
- if hasattr(self, 'min') and self.min is not None:
- _dict['min'] = self.min
- if hasattr(self, 'step') and self.step is not None:
- _dict['step'] = self.step
- if hasattr(self, 'type') and self.type is not None:
- _dict['type'] = self.type
+ if hasattr(self, 'crn') and self.crn is not None:
+ _dict['crn'] = self.crn
return _dict
def _to_dict(self):
@@ -98453,67 +104112,59 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this InstanceProfileDiskSizeRange object."""
+ """Return a `str` version of this CatalogOfferingVersionIdentityCatalogOfferingVersionByCRN object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceProfileDiskSizeRange') -> bool:
+ def __eq__(self, other: 'CatalogOfferingVersionIdentityCatalogOfferingVersionByCRN') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'InstanceProfileDiskSizeRange') -> bool:
+ def __ne__(self, other: 'CatalogOfferingVersionIdentityCatalogOfferingVersionByCRN') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class TypeEnum(str, Enum):
- """
- The type for this profile field.
- """
-
- RANGE = 'range'
-
-
-class InstanceProfileGPUDependent(InstanceProfileGPU):
+class CertificateInstanceIdentityByCRN(CertificateInstanceIdentity):
"""
- The GPU count for an instance with this profile depends on its configuration.
+ CertificateInstanceIdentityByCRN.
- :attr str type: The type for this profile field.
+ :param str crn: The CRN for this certificate instance.
"""
def __init__(
self,
- type: str,
+ crn: str,
) -> None:
"""
- Initialize a InstanceProfileGPUDependent object.
+ Initialize a CertificateInstanceIdentityByCRN object.
- :param str type: The type for this profile field.
+ :param str crn: The CRN for this certificate instance.
"""
# pylint: disable=super-init-not-called
- self.type = type
+ self.crn = crn
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstanceProfileGPUDependent':
- """Initialize a InstanceProfileGPUDependent object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'CertificateInstanceIdentityByCRN':
+ """Initialize a CertificateInstanceIdentityByCRN object from a json dictionary."""
args = {}
- if 'type' in _dict:
- args['type'] = _dict.get('type')
+ if (crn := _dict.get('crn')) is not None:
+ args['crn'] = crn
else:
- raise ValueError('Required property \'type\' not present in InstanceProfileGPUDependent JSON')
+ raise ValueError('Required property \'crn\' not present in CertificateInstanceIdentityByCRN JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceProfileGPUDependent object from a json dictionary."""
+ """Initialize a CertificateInstanceIdentityByCRN object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'type') and self.type is not None:
- _dict['type'] = self.type
+ if hasattr(self, 'crn') and self.crn is not None:
+ _dict['crn'] = self.crn
return _dict
def _to_dict(self):
@@ -98521,87 +104172,59 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this InstanceProfileGPUDependent object."""
+ """Return a `str` version of this CertificateInstanceIdentityByCRN object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceProfileGPUDependent') -> bool:
+ def __eq__(self, other: 'CertificateInstanceIdentityByCRN') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'InstanceProfileGPUDependent') -> bool:
+ def __ne__(self, other: 'CertificateInstanceIdentityByCRN') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class TypeEnum(str, Enum):
- """
- The type for this profile field.
- """
-
- DEPENDENT = 'dependent'
-
-
-class InstanceProfileGPUEnum(InstanceProfileGPU):
+class CloudObjectStorageBucketIdentityByCRN(CloudObjectStorageBucketIdentity):
"""
- The permitted GPU count values for an instance with this profile.
+ CloudObjectStorageBucketIdentityByCRN.
- :attr int default: The default value for this profile field.
- :attr str type: The type for this profile field.
- :attr List[int] values: The permitted values for this profile field.
+ :param str crn: The CRN of this Cloud Object Storage bucket.
"""
def __init__(
self,
- default: int,
- type: str,
- values: List[int],
+ crn: str,
) -> None:
"""
- Initialize a InstanceProfileGPUEnum object.
+ Initialize a CloudObjectStorageBucketIdentityByCRN object.
- :param int default: The default value for this profile field.
- :param str type: The type for this profile field.
- :param List[int] values: The permitted values for this profile field.
+ :param str crn: The CRN of this Cloud Object Storage bucket.
"""
# pylint: disable=super-init-not-called
- self.default = default
- self.type = type
- self.values = values
+ self.crn = crn
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstanceProfileGPUEnum':
- """Initialize a InstanceProfileGPUEnum object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'CloudObjectStorageBucketIdentityByCRN':
+ """Initialize a CloudObjectStorageBucketIdentityByCRN object from a json dictionary."""
args = {}
- if 'default' in _dict:
- args['default'] = _dict.get('default')
- else:
- raise ValueError('Required property \'default\' not present in InstanceProfileGPUEnum JSON')
- if 'type' in _dict:
- args['type'] = _dict.get('type')
- else:
- raise ValueError('Required property \'type\' not present in InstanceProfileGPUEnum JSON')
- if 'values' in _dict:
- args['values'] = _dict.get('values')
+ if (crn := _dict.get('crn')) is not None:
+ args['crn'] = crn
else:
- raise ValueError('Required property \'values\' not present in InstanceProfileGPUEnum JSON')
+ raise ValueError('Required property \'crn\' not present in CloudObjectStorageBucketIdentityByCRN JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceProfileGPUEnum object from a json dictionary."""
+ """Initialize a CloudObjectStorageBucketIdentityByCRN object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'default') and self.default is not None:
- _dict['default'] = self.default
- if hasattr(self, 'type') and self.type is not None:
- _dict['type'] = self.type
- if hasattr(self, 'values') and self.values is not None:
- _dict['values'] = self.values
+ if hasattr(self, 'crn') and self.crn is not None:
+ _dict['crn'] = self.crn
return _dict
def _to_dict(self):
@@ -98609,77 +104232,60 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this InstanceProfileGPUEnum object."""
+ """Return a `str` version of this CloudObjectStorageBucketIdentityByCRN object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceProfileGPUEnum') -> bool:
+ def __eq__(self, other: 'CloudObjectStorageBucketIdentityByCRN') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'InstanceProfileGPUEnum') -> bool:
+ def __ne__(self, other: 'CloudObjectStorageBucketIdentityByCRN') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class TypeEnum(str, Enum):
- """
- The type for this profile field.
- """
-
- ENUM = 'enum'
-
-
-class InstanceProfileGPUFixed(InstanceProfileGPU):
+class CloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName(CloudObjectStorageBucketIdentity):
"""
- The GPU count for an instance with this profile.
+ CloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName.
- :attr str type: The type for this profile field.
- :attr int value: The value for this profile field.
+ :param str name: The globally unique name of this Cloud Object Storage bucket.
"""
def __init__(
self,
- type: str,
- value: int,
+ name: str,
) -> None:
"""
- Initialize a InstanceProfileGPUFixed object.
+ Initialize a CloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName object.
- :param str type: The type for this profile field.
- :param int value: The value for this profile field.
+ :param str name: The globally unique name of this Cloud Object Storage
+ bucket.
"""
# pylint: disable=super-init-not-called
- self.type = type
- self.value = value
+ self.name = name
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstanceProfileGPUFixed':
- """Initialize a InstanceProfileGPUFixed object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'CloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName':
+ """Initialize a CloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName object from a json dictionary."""
args = {}
- if 'type' in _dict:
- args['type'] = _dict.get('type')
- else:
- raise ValueError('Required property \'type\' not present in InstanceProfileGPUFixed JSON')
- if 'value' in _dict:
- args['value'] = _dict.get('value')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
else:
- raise ValueError('Required property \'value\' not present in InstanceProfileGPUFixed JSON')
+ raise ValueError('Required property \'name\' not present in CloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceProfileGPUFixed object from a json dictionary."""
+ """Initialize a CloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'type') and self.type is not None:
- _dict['type'] = self.type
- if hasattr(self, 'value') and self.value is not None:
- _dict['value'] = self.value
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
return _dict
def _to_dict(self):
@@ -98687,68 +104293,59 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this InstanceProfileGPUFixed object."""
+ """Return a `str` version of this CloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceProfileGPUFixed') -> bool:
+ def __eq__(self, other: 'CloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'InstanceProfileGPUFixed') -> bool:
+ def __ne__(self, other: 'CloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class TypeEnum(str, Enum):
- """
- The type for this profile field.
- """
-
- FIXED = 'fixed'
-
-
-class InstanceProfileGPUMemoryDependent(InstanceProfileGPUMemory):
+class DNSInstanceIdentityByCRN(DNSInstanceIdentity):
"""
- The overall GPU memory value for an instance with this profile depends on its
- configuration.
+ DNSInstanceIdentityByCRN.
- :attr str type: The type for this profile field.
+ :param str crn: The CRN for this DNS instance.
"""
def __init__(
self,
- type: str,
+ crn: str,
) -> None:
"""
- Initialize a InstanceProfileGPUMemoryDependent object.
+ Initialize a DNSInstanceIdentityByCRN object.
- :param str type: The type for this profile field.
+ :param str crn: The CRN for this DNS instance.
"""
# pylint: disable=super-init-not-called
- self.type = type
+ self.crn = crn
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstanceProfileGPUMemoryDependent':
- """Initialize a InstanceProfileGPUMemoryDependent object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'DNSInstanceIdentityByCRN':
+ """Initialize a DNSInstanceIdentityByCRN object from a json dictionary."""
args = {}
- if 'type' in _dict:
- args['type'] = _dict.get('type')
+ if (crn := _dict.get('crn')) is not None:
+ args['crn'] = crn
else:
- raise ValueError('Required property \'type\' not present in InstanceProfileGPUMemoryDependent JSON')
+ raise ValueError('Required property \'crn\' not present in DNSInstanceIdentityByCRN JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceProfileGPUMemoryDependent object from a json dictionary."""
+ """Initialize a DNSInstanceIdentityByCRN object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'type') and self.type is not None:
- _dict['type'] = self.type
+ if hasattr(self, 'crn') and self.crn is not None:
+ _dict['crn'] = self.crn
return _dict
def _to_dict(self):
@@ -98756,88 +104353,59 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this InstanceProfileGPUMemoryDependent object."""
+ """Return a `str` version of this DNSInstanceIdentityByCRN object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceProfileGPUMemoryDependent') -> bool:
+ def __eq__(self, other: 'DNSInstanceIdentityByCRN') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'InstanceProfileGPUMemoryDependent') -> bool:
+ def __ne__(self, other: 'DNSInstanceIdentityByCRN') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class TypeEnum(str, Enum):
- """
- The type for this profile field.
- """
-
- DEPENDENT = 'dependent'
-
-
-class InstanceProfileGPUMemoryEnum(InstanceProfileGPUMemory):
+class DNSZoneIdentityById(DNSZoneIdentity):
"""
- The permitted overall GPU memory values in GiB (gibibytes) for an instance with this
- profile.
+ DNSZoneIdentityById.
- :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.
+ :param str id:
"""
def __init__(
self,
- default: int,
- type: str,
- values: List[int],
+ id: str,
) -> None:
"""
- Initialize a InstanceProfileGPUMemoryEnum object.
+ Initialize a DNSZoneIdentityById object.
- :param int default: The default value for this profile field.
- :param str type: The type for this profile field.
- :param List[int] values: The permitted values for this profile field.
+ :param str id:
"""
# pylint: disable=super-init-not-called
- self.default = default
- self.type = type
- self.values = values
+ self.id = id
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstanceProfileGPUMemoryEnum':
- """Initialize a InstanceProfileGPUMemoryEnum object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'DNSZoneIdentityById':
+ """Initialize a DNSZoneIdentityById object from a json dictionary."""
args = {}
- if 'default' in _dict:
- args['default'] = _dict.get('default')
- else:
- raise ValueError('Required property \'default\' not present in InstanceProfileGPUMemoryEnum JSON')
- if 'type' in _dict:
- args['type'] = _dict.get('type')
- else:
- raise ValueError('Required property \'type\' not present in InstanceProfileGPUMemoryEnum JSON')
- if 'values' in _dict:
- args['values'] = _dict.get('values')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
else:
- raise ValueError('Required property \'values\' not present in InstanceProfileGPUMemoryEnum JSON')
+ raise ValueError('Required property \'id\' not present in DNSZoneIdentityById JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceProfileGPUMemoryEnum object from a json dictionary."""
+ """Initialize a DNSZoneIdentityById object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'default') and self.default is not None:
- _dict['default'] = self.default
- if hasattr(self, 'type') and self.type is not None:
- _dict['type'] = self.type
- if hasattr(self, 'values') and self.values is not None:
- _dict['values'] = self.values
+ if hasattr(self, 'id') and self.id is not None:
+ _dict['id'] = self.id
return _dict
def _to_dict(self):
@@ -98845,77 +104413,59 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this InstanceProfileGPUMemoryEnum object."""
+ """Return a `str` version of this DNSZoneIdentityById object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceProfileGPUMemoryEnum') -> bool:
+ def __eq__(self, other: 'DNSZoneIdentityById') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'InstanceProfileGPUMemoryEnum') -> bool:
+ def __ne__(self, other: 'DNSZoneIdentityById') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class TypeEnum(str, Enum):
- """
- The type for this profile field.
- """
-
- ENUM = 'enum'
-
-
-class InstanceProfileGPUMemoryFixed(InstanceProfileGPUMemory):
+class DedicatedHostGroupIdentityByCRN(DedicatedHostGroupIdentity):
"""
- The overall GPU memory in GiB (gibibytes) for an instance with this profile.
+ DedicatedHostGroupIdentityByCRN.
- :attr str type: The type for this profile field.
- :attr int value: The value for this profile field.
+ :param str crn: The CRN for this dedicated host group.
"""
def __init__(
self,
- type: str,
- value: int,
+ crn: str,
) -> None:
"""
- Initialize a InstanceProfileGPUMemoryFixed object.
+ Initialize a DedicatedHostGroupIdentityByCRN object.
- :param str type: The type for this profile field.
- :param int value: The value for this profile field.
+ :param str crn: The CRN for this dedicated host group.
"""
# pylint: disable=super-init-not-called
- self.type = type
- self.value = value
+ self.crn = crn
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstanceProfileGPUMemoryFixed':
- """Initialize a InstanceProfileGPUMemoryFixed object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'DedicatedHostGroupIdentityByCRN':
+ """Initialize a DedicatedHostGroupIdentityByCRN object from a json dictionary."""
args = {}
- if 'type' in _dict:
- args['type'] = _dict.get('type')
- else:
- raise ValueError('Required property \'type\' not present in InstanceProfileGPUMemoryFixed JSON')
- if 'value' in _dict:
- args['value'] = _dict.get('value')
+ if (crn := _dict.get('crn')) is not None:
+ args['crn'] = crn
else:
- raise ValueError('Required property \'value\' not present in InstanceProfileGPUMemoryFixed JSON')
+ raise ValueError('Required property \'crn\' not present in DedicatedHostGroupIdentityByCRN JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceProfileGPUMemoryFixed object from a json dictionary."""
+ """Initialize a DedicatedHostGroupIdentityByCRN object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'type') and self.type is not None:
- _dict['type'] = self.type
- if hasattr(self, 'value') and self.value is not None:
- _dict['value'] = self.value
+ if hasattr(self, 'crn') and self.crn is not None:
+ _dict['crn'] = self.crn
return _dict
def _to_dict(self):
@@ -98923,108 +104473,59 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this InstanceProfileGPUMemoryFixed object."""
+ """Return a `str` version of this DedicatedHostGroupIdentityByCRN object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceProfileGPUMemoryFixed') -> bool:
+ def __eq__(self, other: 'DedicatedHostGroupIdentityByCRN') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'InstanceProfileGPUMemoryFixed') -> bool:
+ def __ne__(self, other: 'DedicatedHostGroupIdentityByCRN') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class TypeEnum(str, Enum):
- """
- The type for this profile field.
- """
-
- FIXED = 'fixed'
-
-
-class InstanceProfileGPUMemoryRange(InstanceProfileGPUMemory):
+class DedicatedHostGroupIdentityByHref(DedicatedHostGroupIdentity):
"""
- The permitted overall GPU memory range in GiB (gibibytes) for an instance with this
- profile.
+ DedicatedHostGroupIdentityByHref.
- :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.
+ :param str href: The URL for this dedicated host group.
"""
def __init__(
self,
- default: int,
- max: int,
- min: int,
- step: int,
- type: str,
+ href: str,
) -> None:
"""
- Initialize a InstanceProfileGPUMemoryRange object.
+ Initialize a DedicatedHostGroupIdentityByHref object.
- :param int default: The default value for this profile field.
- :param int max: The maximum value for this profile field.
- :param int min: The minimum value for this profile field.
- :param int step: The increment step value for this profile field.
- :param str type: The type for this profile field.
+ :param str href: The URL for this dedicated host group.
"""
# pylint: disable=super-init-not-called
- self.default = default
- self.max = max
- self.min = min
- self.step = step
- self.type = type
+ self.href = href
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstanceProfileGPUMemoryRange':
- """Initialize a InstanceProfileGPUMemoryRange object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'DedicatedHostGroupIdentityByHref':
+ """Initialize a DedicatedHostGroupIdentityByHref object from a json dictionary."""
args = {}
- if 'default' in _dict:
- args['default'] = _dict.get('default')
- else:
- raise ValueError('Required property \'default\' not present in InstanceProfileGPUMemoryRange JSON')
- if 'max' in _dict:
- args['max'] = _dict.get('max')
- else:
- raise ValueError('Required property \'max\' not present in InstanceProfileGPUMemoryRange JSON')
- if 'min' in _dict:
- args['min'] = _dict.get('min')
- else:
- raise ValueError('Required property \'min\' not present in InstanceProfileGPUMemoryRange JSON')
- if 'step' in _dict:
- args['step'] = _dict.get('step')
- else:
- raise ValueError('Required property \'step\' not present in InstanceProfileGPUMemoryRange JSON')
- if 'type' in _dict:
- args['type'] = _dict.get('type')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'type\' not present in InstanceProfileGPUMemoryRange JSON')
+ raise ValueError('Required property \'href\' not present in DedicatedHostGroupIdentityByHref JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceProfileGPUMemoryRange object from a json dictionary."""
+ """Initialize a DedicatedHostGroupIdentityByHref object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'default') and self.default is not None:
- _dict['default'] = self.default
- if hasattr(self, 'max') and self.max is not None:
- _dict['max'] = self.max
- if hasattr(self, 'min') and self.min is not None:
- _dict['min'] = self.min
- if hasattr(self, 'step') and self.step is not None:
- _dict['step'] = self.step
- if hasattr(self, 'type') and self.type is not None:
- _dict['type'] = self.type
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
return _dict
def _to_dict(self):
@@ -99032,107 +104533,59 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this InstanceProfileGPUMemoryRange object."""
+ """Return a `str` version of this DedicatedHostGroupIdentityByHref object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceProfileGPUMemoryRange') -> bool:
+ def __eq__(self, other: 'DedicatedHostGroupIdentityByHref') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'InstanceProfileGPUMemoryRange') -> bool:
+ def __ne__(self, other: 'DedicatedHostGroupIdentityByHref') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class TypeEnum(str, Enum):
- """
- The type for this profile field.
- """
-
- RANGE = 'range'
-
-
-class InstanceProfileGPURange(InstanceProfileGPU):
+class DedicatedHostGroupIdentityById(DedicatedHostGroupIdentity):
"""
- The permitted GPU count range for an instance with this profile.
+ DedicatedHostGroupIdentityById.
- :attr int default: The default value for this profile field.
- :attr int max: The maximum value for this profile field.
- :attr int min: The minimum value for this profile field.
- :attr int step: The increment step value for this profile field.
- :attr str type: The type for this profile field.
+ :param str id: The unique identifier for this dedicated host group.
"""
def __init__(
self,
- default: int,
- max: int,
- min: int,
- step: int,
- type: str,
+ id: str,
) -> None:
"""
- Initialize a InstanceProfileGPURange object.
+ Initialize a DedicatedHostGroupIdentityById object.
- :param int default: The default value for this profile field.
- :param int max: The maximum value for this profile field.
- :param int min: The minimum value for this profile field.
- :param int step: The increment step value for this profile field.
- :param str type: The type for this profile field.
+ :param str id: The unique identifier for this dedicated host group.
"""
# pylint: disable=super-init-not-called
- self.default = default
- self.max = max
- self.min = min
- self.step = step
- self.type = type
+ self.id = id
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstanceProfileGPURange':
- """Initialize a InstanceProfileGPURange object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'DedicatedHostGroupIdentityById':
+ """Initialize a DedicatedHostGroupIdentityById object from a json dictionary."""
args = {}
- if 'default' in _dict:
- args['default'] = _dict.get('default')
- else:
- raise ValueError('Required property \'default\' not present in InstanceProfileGPURange JSON')
- if 'max' in _dict:
- args['max'] = _dict.get('max')
- else:
- raise ValueError('Required property \'max\' not present in InstanceProfileGPURange JSON')
- if 'min' in _dict:
- args['min'] = _dict.get('min')
- else:
- raise ValueError('Required property \'min\' not present in InstanceProfileGPURange JSON')
- if 'step' in _dict:
- args['step'] = _dict.get('step')
- else:
- raise ValueError('Required property \'step\' not present in InstanceProfileGPURange JSON')
- if 'type' in _dict:
- args['type'] = _dict.get('type')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
else:
- raise ValueError('Required property \'type\' not present in InstanceProfileGPURange JSON')
+ raise ValueError('Required property \'id\' not present in DedicatedHostGroupIdentityById JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceProfileGPURange object from a json dictionary."""
+ """Initialize a DedicatedHostGroupIdentityById object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'default') and self.default is not None:
- _dict['default'] = self.default
- if hasattr(self, 'max') and self.max is not None:
- _dict['max'] = self.max
- if hasattr(self, 'min') and self.min is not None:
- _dict['min'] = self.min
- if hasattr(self, 'step') and self.step is not None:
- _dict['step'] = self.step
- if hasattr(self, 'type') and self.type is not None:
- _dict['type'] = self.type
+ if hasattr(self, 'id') and self.id is not None:
+ _dict['id'] = self.id
return _dict
def _to_dict(self):
@@ -99140,33 +104593,25 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this InstanceProfileGPURange object."""
+ """Return a `str` version of this DedicatedHostGroupIdentityById object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceProfileGPURange') -> bool:
+ def __eq__(self, other: 'DedicatedHostGroupIdentityById') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'InstanceProfileGPURange') -> bool:
+ def __ne__(self, other: 'DedicatedHostGroupIdentityById') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class TypeEnum(str, Enum):
- """
- The type for this profile field.
- """
-
- RANGE = 'range'
-
-
-class InstanceProfileIdentityByHref(InstanceProfileIdentity):
+class DedicatedHostProfileIdentityByHref(DedicatedHostProfileIdentity):
"""
- InstanceProfileIdentityByHref.
+ DedicatedHostProfileIdentityByHref.
- :attr str href: The URL for this virtual server instance profile.
+ :param str href: The URL for this dedicated host profile.
"""
def __init__(
@@ -99174,26 +104619,26 @@ def __init__(
href: str,
) -> None:
"""
- Initialize a InstanceProfileIdentityByHref object.
+ Initialize a DedicatedHostProfileIdentityByHref object.
- :param str href: The URL for this virtual server instance profile.
+ :param str href: The URL for this dedicated host profile.
"""
# pylint: disable=super-init-not-called
self.href = href
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstanceProfileIdentityByHref':
- """Initialize a InstanceProfileIdentityByHref object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'DedicatedHostProfileIdentityByHref':
+ """Initialize a DedicatedHostProfileIdentityByHref object from a json dictionary."""
args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'href\' not present in InstanceProfileIdentityByHref JSON')
+ raise ValueError('Required property \'href\' not present in DedicatedHostProfileIdentityByHref JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceProfileIdentityByHref object from a json dictionary."""
+ """Initialize a DedicatedHostProfileIdentityByHref object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -99208,26 +104653,25 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this InstanceProfileIdentityByHref object."""
+ """Return a `str` version of this DedicatedHostProfileIdentityByHref object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceProfileIdentityByHref') -> bool:
+ def __eq__(self, other: 'DedicatedHostProfileIdentityByHref') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'InstanceProfileIdentityByHref') -> bool:
+ def __ne__(self, other: 'DedicatedHostProfileIdentityByHref') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class InstanceProfileIdentityByName(InstanceProfileIdentity):
+class DedicatedHostProfileIdentityByName(DedicatedHostProfileIdentity):
"""
- InstanceProfileIdentityByName.
+ DedicatedHostProfileIdentityByName.
- :attr str name: The globally unique name for this virtual server instance
- profile.
+ :param str name: The globally unique name for this dedicated host profile.
"""
def __init__(
@@ -99235,27 +104679,26 @@ def __init__(
name: str,
) -> None:
"""
- Initialize a InstanceProfileIdentityByName object.
+ Initialize a DedicatedHostProfileIdentityByName object.
- :param str name: The globally unique name for this virtual server instance
- profile.
+ :param str name: The globally unique name for this dedicated host profile.
"""
# pylint: disable=super-init-not-called
self.name = name
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstanceProfileIdentityByName':
- """Initialize a InstanceProfileIdentityByName object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'DedicatedHostProfileIdentityByName':
+ """Initialize a DedicatedHostProfileIdentityByName object from a json dictionary."""
args = {}
- if 'name' in _dict:
- args['name'] = _dict.get('name')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
else:
- raise ValueError('Required property \'name\' not present in InstanceProfileIdentityByName JSON')
+ raise ValueError('Required property \'name\' not present in DedicatedHostProfileIdentityByName JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceProfileIdentityByName object from a json dictionary."""
+ """Initialize a DedicatedHostProfileIdentityByName object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -99270,25 +104713,25 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this InstanceProfileIdentityByName object."""
+ """Return a `str` version of this DedicatedHostProfileIdentityByName object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceProfileIdentityByName') -> bool:
+ def __eq__(self, other: 'DedicatedHostProfileIdentityByName') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'InstanceProfileIdentityByName') -> bool:
+ def __ne__(self, other: 'DedicatedHostProfileIdentityByName') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class InstanceProfileMemoryDependent(InstanceProfileMemory):
+class DedicatedHostProfileMemoryDependent(DedicatedHostProfileMemory):
"""
- The memory value for an instance with this profile depends on its configuration.
+ The memory value for a dedicated host with this profile depends on its configuration.
- :attr str type: The type for this profile field.
+ :param str type: The type for this profile field.
"""
def __init__(
@@ -99296,7 +104739,7 @@ def __init__(
type: str,
) -> None:
"""
- Initialize a InstanceProfileMemoryDependent object.
+ Initialize a DedicatedHostProfileMemoryDependent object.
:param str type: The type for this profile field.
"""
@@ -99304,18 +104747,18 @@ def __init__(
self.type = type
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstanceProfileMemoryDependent':
- """Initialize a InstanceProfileMemoryDependent object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'DedicatedHostProfileMemoryDependent':
+ """Initialize a DedicatedHostProfileMemoryDependent object from a json dictionary."""
args = {}
- if 'type' in _dict:
- args['type'] = _dict.get('type')
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
else:
- raise ValueError('Required property \'type\' not present in InstanceProfileMemoryDependent JSON')
+ raise ValueError('Required property \'type\' not present in DedicatedHostProfileMemoryDependent JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceProfileMemoryDependent object from a json dictionary."""
+ """Initialize a DedicatedHostProfileMemoryDependent object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -99330,16 +104773,16 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this InstanceProfileMemoryDependent object."""
+ """Return a `str` version of this DedicatedHostProfileMemoryDependent object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceProfileMemoryDependent') -> bool:
+ def __eq__(self, other: 'DedicatedHostProfileMemoryDependent') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'InstanceProfileMemoryDependent') -> bool:
+ def __ne__(self, other: 'DedicatedHostProfileMemoryDependent') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
@@ -99352,13 +104795,13 @@ class TypeEnum(str, Enum):
-class InstanceProfileMemoryEnum(InstanceProfileMemory):
+class DedicatedHostProfileMemoryEnum(DedicatedHostProfileMemory):
"""
- The permitted memory values (in gibibytes) for an instance with this profile.
+ The permitted memory values (in gibibytes) for a dedicated host with this profile.
- :attr int default: The default value for this profile field.
- :attr str type: The type for this profile field.
- :attr List[int] values: The permitted values for this profile field.
+ :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.
"""
def __init__(
@@ -99368,7 +104811,7 @@ def __init__(
values: List[int],
) -> None:
"""
- Initialize a InstanceProfileMemoryEnum object.
+ Initialize a DedicatedHostProfileMemoryEnum object.
:param int default: The default value for this profile field.
:param str type: The type for this profile field.
@@ -99380,26 +104823,26 @@ def __init__(
self.values = values
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstanceProfileMemoryEnum':
- """Initialize a InstanceProfileMemoryEnum object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'DedicatedHostProfileMemoryEnum':
+ """Initialize a DedicatedHostProfileMemoryEnum object from a json dictionary."""
args = {}
- if 'default' in _dict:
- args['default'] = _dict.get('default')
+ if (default := _dict.get('default')) is not None:
+ args['default'] = default
else:
- raise ValueError('Required property \'default\' not present in InstanceProfileMemoryEnum JSON')
- if 'type' in _dict:
- args['type'] = _dict.get('type')
+ raise ValueError('Required property \'default\' not present in DedicatedHostProfileMemoryEnum JSON')
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
else:
- raise ValueError('Required property \'type\' not present in InstanceProfileMemoryEnum JSON')
- if 'values' in _dict:
- args['values'] = _dict.get('values')
+ raise ValueError('Required property \'type\' not present in DedicatedHostProfileMemoryEnum JSON')
+ if (values := _dict.get('values')) is not None:
+ args['values'] = values
else:
- raise ValueError('Required property \'values\' not present in InstanceProfileMemoryEnum JSON')
+ raise ValueError('Required property \'values\' not present in DedicatedHostProfileMemoryEnum JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceProfileMemoryEnum object from a json dictionary."""
+ """Initialize a DedicatedHostProfileMemoryEnum object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -99418,16 +104861,16 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this InstanceProfileMemoryEnum object."""
+ """Return a `str` version of this DedicatedHostProfileMemoryEnum object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceProfileMemoryEnum') -> bool:
+ def __eq__(self, other: 'DedicatedHostProfileMemoryEnum') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'InstanceProfileMemoryEnum') -> bool:
+ def __ne__(self, other: 'DedicatedHostProfileMemoryEnum') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
@@ -99440,12 +104883,12 @@ class TypeEnum(str, Enum):
-class InstanceProfileMemoryFixed(InstanceProfileMemory):
+class DedicatedHostProfileMemoryFixed(DedicatedHostProfileMemory):
"""
- The memory (in gibibytes) for an instance with this profile.
+ The memory (in gibibytes) for a dedicated host with this profile.
- :attr str type: The type for this profile field.
- :attr int value: The value for this profile field.
+ :param str type: The type for this profile field.
+ :param int value: The value for this profile field.
"""
def __init__(
@@ -99454,7 +104897,7 @@ def __init__(
value: int,
) -> None:
"""
- Initialize a InstanceProfileMemoryFixed object.
+ Initialize a DedicatedHostProfileMemoryFixed object.
:param str type: The type for this profile field.
:param int value: The value for this profile field.
@@ -99464,22 +104907,22 @@ def __init__(
self.value = value
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstanceProfileMemoryFixed':
- """Initialize a InstanceProfileMemoryFixed object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'DedicatedHostProfileMemoryFixed':
+ """Initialize a DedicatedHostProfileMemoryFixed object from a json dictionary."""
args = {}
- if 'type' in _dict:
- args['type'] = _dict.get('type')
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
else:
- raise ValueError('Required property \'type\' not present in InstanceProfileMemoryFixed JSON')
- if 'value' in _dict:
- args['value'] = _dict.get('value')
+ raise ValueError('Required property \'type\' not present in DedicatedHostProfileMemoryFixed JSON')
+ if (value := _dict.get('value')) is not None:
+ args['value'] = value
else:
- raise ValueError('Required property \'value\' not present in InstanceProfileMemoryFixed JSON')
+ raise ValueError('Required property \'value\' not present in DedicatedHostProfileMemoryFixed JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceProfileMemoryFixed object from a json dictionary."""
+ """Initialize a DedicatedHostProfileMemoryFixed object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -99496,16 +104939,16 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this InstanceProfileMemoryFixed object."""
+ """Return a `str` version of this DedicatedHostProfileMemoryFixed object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceProfileMemoryFixed') -> bool:
+ def __eq__(self, other: 'DedicatedHostProfileMemoryFixed') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'InstanceProfileMemoryFixed') -> bool:
+ def __ne__(self, other: 'DedicatedHostProfileMemoryFixed') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
@@ -99518,15 +104961,15 @@ class TypeEnum(str, Enum):
-class InstanceProfileMemoryRange(InstanceProfileMemory):
+class DedicatedHostProfileMemoryRange(DedicatedHostProfileMemory):
"""
- The permitted memory range (in gibibytes) for an instance with this profile.
+ The permitted memory range (in gibibytes) for a dedicated host with this profile.
- :attr int default: The default value for this profile field.
- :attr int max: The maximum value for this profile field.
- :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.
+ :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.
"""
def __init__(
@@ -99538,7 +104981,7 @@ def __init__(
type: str,
) -> None:
"""
- Initialize a InstanceProfileMemoryRange object.
+ Initialize a DedicatedHostProfileMemoryRange object.
:param int default: The default value for this profile field.
:param int max: The maximum value for this profile field.
@@ -99554,34 +104997,34 @@ def __init__(
self.type = type
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstanceProfileMemoryRange':
- """Initialize a InstanceProfileMemoryRange object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'DedicatedHostProfileMemoryRange':
+ """Initialize a DedicatedHostProfileMemoryRange object from a json dictionary."""
args = {}
- if 'default' in _dict:
- args['default'] = _dict.get('default')
+ if (default := _dict.get('default')) is not None:
+ args['default'] = default
else:
- raise ValueError('Required property \'default\' not present in InstanceProfileMemoryRange JSON')
- if 'max' in _dict:
- args['max'] = _dict.get('max')
+ raise ValueError('Required property \'default\' not present in DedicatedHostProfileMemoryRange JSON')
+ if (max := _dict.get('max')) is not None:
+ args['max'] = max
else:
- raise ValueError('Required property \'max\' not present in InstanceProfileMemoryRange JSON')
- if 'min' in _dict:
- args['min'] = _dict.get('min')
+ raise ValueError('Required property \'max\' not present in DedicatedHostProfileMemoryRange JSON')
+ if (min := _dict.get('min')) is not None:
+ args['min'] = min
else:
- raise ValueError('Required property \'min\' not present in InstanceProfileMemoryRange JSON')
- if 'step' in _dict:
- args['step'] = _dict.get('step')
+ raise ValueError('Required property \'min\' not present in DedicatedHostProfileMemoryRange JSON')
+ if (step := _dict.get('step')) is not None:
+ args['step'] = step
else:
- raise ValueError('Required property \'step\' not present in InstanceProfileMemoryRange JSON')
- if 'type' in _dict:
- args['type'] = _dict.get('type')
+ raise ValueError('Required property \'step\' not present in DedicatedHostProfileMemoryRange JSON')
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
else:
- raise ValueError('Required property \'type\' not present in InstanceProfileMemoryRange JSON')
+ raise ValueError('Required property \'type\' not present in DedicatedHostProfileMemoryRange JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceProfileMemoryRange object from a json dictionary."""
+ """Initialize a DedicatedHostProfileMemoryRange object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -99604,16 +105047,16 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this InstanceProfileMemoryRange object."""
+ """Return a `str` version of this DedicatedHostProfileMemoryRange object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceProfileMemoryRange') -> bool:
+ def __eq__(self, other: 'DedicatedHostProfileMemoryRange') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'InstanceProfileMemoryRange') -> bool:
+ def __ne__(self, other: 'DedicatedHostProfileMemoryRange') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
@@ -99626,12 +105069,12 @@ class TypeEnum(str, Enum):
-class InstanceProfileNUMACountDependent(InstanceProfileNUMACount):
+class DedicatedHostProfileSocketDependent(DedicatedHostProfileSocket):
"""
- The total number of NUMA nodes for an instance with this profile depends on its
- configuration and the capacity constraints within the zone.
+ The CPU socket count for a dedicated host with this profile depends on its
+ configuration.
- :attr str type: The type for this profile field.
+ :param str type: The type for this profile field.
"""
def __init__(
@@ -99639,7 +105082,7 @@ def __init__(
type: str,
) -> None:
"""
- Initialize a InstanceProfileNUMACountDependent object.
+ Initialize a DedicatedHostProfileSocketDependent object.
:param str type: The type for this profile field.
"""
@@ -99647,18 +105090,18 @@ def __init__(
self.type = type
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstanceProfileNUMACountDependent':
- """Initialize a InstanceProfileNUMACountDependent object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'DedicatedHostProfileSocketDependent':
+ """Initialize a DedicatedHostProfileSocketDependent object from a json dictionary."""
args = {}
- if 'type' in _dict:
- args['type'] = _dict.get('type')
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
else:
- raise ValueError('Required property \'type\' not present in InstanceProfileNUMACountDependent JSON')
+ raise ValueError('Required property \'type\' not present in DedicatedHostProfileSocketDependent JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceProfileNUMACountDependent object from a json dictionary."""
+ """Initialize a DedicatedHostProfileSocketDependent object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -99673,16 +105116,16 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this InstanceProfileNUMACountDependent object."""
+ """Return a `str` version of this DedicatedHostProfileSocketDependent object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceProfileNUMACountDependent') -> bool:
+ def __eq__(self, other: 'DedicatedHostProfileSocketDependent') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'InstanceProfileNUMACountDependent') -> bool:
+ def __ne__(self, other: 'DedicatedHostProfileSocketDependent') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
@@ -99695,55 +105138,65 @@ class TypeEnum(str, Enum):
-class InstanceProfileNUMACountFixed(InstanceProfileNUMACount):
+class DedicatedHostProfileSocketEnum(DedicatedHostProfileSocket):
"""
- The total number of NUMA nodes for an instance with this profile.
+ The permitted values for CPU socket count 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.
+ :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.
"""
def __init__(
self,
+ default: int,
type: str,
- value: int,
+ values: List[int],
) -> None:
"""
- Initialize a InstanceProfileNUMACountFixed object.
+ Initialize a DedicatedHostProfileSocketEnum object.
+ :param int default: The default value for this profile field.
:param str type: The type for this profile field.
- :param int value: The value for this profile field.
+ :param List[int] values: The permitted values for this profile field.
"""
# pylint: disable=super-init-not-called
+ self.default = default
self.type = type
- self.value = value
+ self.values = values
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstanceProfileNUMACountFixed':
- """Initialize a InstanceProfileNUMACountFixed object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'DedicatedHostProfileSocketEnum':
+ """Initialize a DedicatedHostProfileSocketEnum object from a json dictionary."""
args = {}
- if 'type' in _dict:
- args['type'] = _dict.get('type')
+ if (default := _dict.get('default')) is not None:
+ args['default'] = default
else:
- raise ValueError('Required property \'type\' not present in InstanceProfileNUMACountFixed JSON')
- if 'value' in _dict:
- args['value'] = _dict.get('value')
+ raise ValueError('Required property \'default\' not present in DedicatedHostProfileSocketEnum JSON')
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
else:
- raise ValueError('Required property \'value\' not present in InstanceProfileNUMACountFixed JSON')
+ raise ValueError('Required property \'type\' not present in DedicatedHostProfileSocketEnum JSON')
+ if (values := _dict.get('values')) is not None:
+ args['values'] = values
+ else:
+ raise ValueError('Required property \'values\' not present in DedicatedHostProfileSocketEnum JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceProfileNUMACountFixed object from a json dictionary."""
+ """Initialize a DedicatedHostProfileSocketEnum object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
+ if hasattr(self, '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, 'values') and self.values is not None:
+ _dict['values'] = self.values
return _dict
def _to_dict(self):
@@ -99751,16 +105204,16 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this InstanceProfileNUMACountFixed object."""
+ """Return a `str` version of this DedicatedHostProfileSocketEnum object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceProfileNUMACountFixed') -> bool:
+ def __eq__(self, other: 'DedicatedHostProfileSocketEnum') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'InstanceProfileNUMACountFixed') -> bool:
+ def __ne__(self, other: 'DedicatedHostProfileSocketEnum') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
@@ -99769,43 +105222,50 @@ class TypeEnum(str, Enum):
The type for this profile field.
"""
- FIXED = 'fixed'
+ ENUM = 'enum'
-class InstanceProfileNetworkInterfaceCountDependent(InstanceProfileNetworkInterfaceCount):
+class DedicatedHostProfileSocketFixed(DedicatedHostProfileSocket):
"""
- The number of network interfaces supported on an instance with this profile is
- dependent on its configuration.
+ The CPU socket count for a dedicated host with this profile.
- :attr str type: The type for this profile field.
+ :param str type: The type for this profile field.
+ :param int value: The value for this profile field.
"""
def __init__(
self,
type: str,
+ value: int,
) -> None:
"""
- Initialize a InstanceProfileNetworkInterfaceCountDependent object.
+ Initialize a DedicatedHostProfileSocketFixed object.
:param str type: The type for this profile field.
+ :param int value: The value for this profile field.
"""
# pylint: disable=super-init-not-called
self.type = type
+ self.value = value
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstanceProfileNetworkInterfaceCountDependent':
- """Initialize a InstanceProfileNetworkInterfaceCountDependent object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'DedicatedHostProfileSocketFixed':
+ """Initialize a DedicatedHostProfileSocketFixed object from a json dictionary."""
args = {}
- if 'type' in _dict:
- args['type'] = _dict.get('type')
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
else:
- raise ValueError('Required property \'type\' not present in InstanceProfileNetworkInterfaceCountDependent JSON')
+ raise ValueError('Required property \'type\' not present in DedicatedHostProfileSocketFixed JSON')
+ if (value := _dict.get('value')) is not None:
+ args['value'] = value
+ else:
+ raise ValueError('Required property \'value\' not present in DedicatedHostProfileSocketFixed JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceProfileNetworkInterfaceCountDependent object from a json dictionary."""
+ """Initialize a DedicatedHostProfileSocketFixed object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -99813,6 +105273,8 @@ def to_dict(self) -> Dict:
_dict = {}
if hasattr(self, 'type') and self.type is not None:
_dict['type'] = self.type
+ if hasattr(self, 'value') and self.value is not None:
+ _dict['value'] = self.value
return _dict
def _to_dict(self):
@@ -99820,16 +105282,16 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this InstanceProfileNetworkInterfaceCountDependent object."""
+ """Return a `str` version of this DedicatedHostProfileSocketFixed object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceProfileNetworkInterfaceCountDependent') -> bool:
+ def __eq__(self, other: 'DedicatedHostProfileSocketFixed') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'InstanceProfileNetworkInterfaceCountDependent') -> bool:
+ def __ne__(self, other: 'DedicatedHostProfileSocketFixed') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
@@ -99838,64 +105300,87 @@ class TypeEnum(str, Enum):
The type for this profile field.
"""
- DEPENDENT = 'dependent'
+ FIXED = 'fixed'
-class InstanceProfileNetworkInterfaceCountRange(InstanceProfileNetworkInterfaceCount):
+class DedicatedHostProfileSocketRange(DedicatedHostProfileSocket):
"""
- The number of network interfaces supported on an instance with this profile.
+ The permitted range for CPU socket count for a dedicated host with this profile.
- :attr int max: (optional) The maximum value for this profile field.
- :attr int min: (optional) The minimum value for this profile field.
- :attr str type: The type for this profile field.
+ :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.
"""
def __init__(
self,
+ default: int,
+ max: int,
+ min: int,
+ step: int,
type: str,
- *,
- max: int = None,
- min: int = None,
) -> None:
"""
- Initialize a InstanceProfileNetworkInterfaceCountRange object.
+ Initialize a DedicatedHostProfileSocketRange object.
+ :param int default: The default value for this profile field.
+ :param int max: The maximum value for this profile field.
+ :param int min: The minimum value for this profile field.
+ :param int step: The increment step value for this profile field.
:param str type: The type for this profile field.
- :param int max: (optional) The maximum value for this profile field.
- :param int min: (optional) The minimum value for this profile field.
"""
# pylint: disable=super-init-not-called
+ self.default = default
self.max = max
self.min = min
+ self.step = step
self.type = type
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstanceProfileNetworkInterfaceCountRange':
- """Initialize a InstanceProfileNetworkInterfaceCountRange object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'DedicatedHostProfileSocketRange':
+ """Initialize a DedicatedHostProfileSocketRange object from a json dictionary."""
args = {}
- if 'max' in _dict:
- args['max'] = _dict.get('max')
- if 'min' in _dict:
- args['min'] = _dict.get('min')
- if 'type' in _dict:
- args['type'] = _dict.get('type')
+ if (default := _dict.get('default')) is not None:
+ args['default'] = default
else:
- raise ValueError('Required property \'type\' not present in InstanceProfileNetworkInterfaceCountRange JSON')
+ raise ValueError('Required property \'default\' not present in DedicatedHostProfileSocketRange JSON')
+ if (max := _dict.get('max')) is not None:
+ args['max'] = max
+ else:
+ raise ValueError('Required property \'max\' not present in DedicatedHostProfileSocketRange JSON')
+ if (min := _dict.get('min')) is not None:
+ args['min'] = min
+ else:
+ raise ValueError('Required property \'min\' not present in DedicatedHostProfileSocketRange JSON')
+ if (step := _dict.get('step')) is not None:
+ args['step'] = step
+ else:
+ raise ValueError('Required property \'step\' not present in DedicatedHostProfileSocketRange JSON')
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
+ else:
+ raise ValueError('Required property \'type\' not present in DedicatedHostProfileSocketRange JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceProfileNetworkInterfaceCountRange object from a json dictionary."""
+ """Initialize a DedicatedHostProfileSocketRange object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
+ if hasattr(self, '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
@@ -99905,16 +105390,16 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this InstanceProfileNetworkInterfaceCountRange object."""
+ """Return a `str` version of this DedicatedHostProfileSocketRange object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceProfileNetworkInterfaceCountRange') -> bool:
+ def __eq__(self, other: 'DedicatedHostProfileSocketRange') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'InstanceProfileNetworkInterfaceCountRange') -> bool:
+ def __ne__(self, other: 'DedicatedHostProfileSocketRange') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
@@ -99927,159 +105412,11 @@ class TypeEnum(str, Enum):
-class InstanceProfilePortSpeedDependent(InstanceProfilePortSpeed):
- """
- The port speed of each network interface of an instance with this profile depends on
- its configuration.
-
- :attr str type: The type for this profile field.
- """
-
- def __init__(
- self,
- type: str,
- ) -> None:
- """
- Initialize a InstanceProfilePortSpeedDependent object.
-
- :param str type: The type for this profile field.
- """
- # pylint: disable=super-init-not-called
- self.type = type
-
- @classmethod
- def from_dict(cls, _dict: Dict) -> 'InstanceProfilePortSpeedDependent':
- """Initialize a InstanceProfilePortSpeedDependent object from a json dictionary."""
- args = {}
- if 'type' in _dict:
- args['type'] = _dict.get('type')
- else:
- raise ValueError('Required property \'type\' not present in InstanceProfilePortSpeedDependent JSON')
- return cls(**args)
-
- @classmethod
- def _from_dict(cls, _dict):
- """Initialize a InstanceProfilePortSpeedDependent object from a json dictionary."""
- return cls.from_dict(_dict)
-
- def to_dict(self) -> Dict:
- """Return a json dictionary representing this model."""
- _dict = {}
- if hasattr(self, 'type') and self.type is not None:
- _dict['type'] = self.type
- return _dict
-
- def _to_dict(self):
- """Return a json dictionary representing this model."""
- return self.to_dict()
-
- def __str__(self) -> str:
- """Return a `str` version of this InstanceProfilePortSpeedDependent object."""
- return json.dumps(self.to_dict(), indent=2)
-
- def __eq__(self, other: 'InstanceProfilePortSpeedDependent') -> bool:
- """Return `true` when self and other are equal, false otherwise."""
- if not isinstance(other, self.__class__):
- return False
- return self.__dict__ == other.__dict__
-
- def __ne__(self, other: 'InstanceProfilePortSpeedDependent') -> bool:
- """Return `true` when self and other are not equal, false otherwise."""
- return not self == other
-
- class TypeEnum(str, Enum):
- """
- The type for this profile field.
- """
-
- DEPENDENT = 'dependent'
-
-
-
-class InstanceProfilePortSpeedFixed(InstanceProfilePortSpeed):
- """
- The maximum speed (in megabits per second) of each network interface of an instance
- with this profile.
-
- :attr str type: The type for this profile field.
- :attr int value: The value for this profile field.
- """
-
- def __init__(
- self,
- type: str,
- value: int,
- ) -> None:
- """
- Initialize a InstanceProfilePortSpeedFixed object.
-
- :param str type: The type for this profile field.
- :param int value: The value for this profile field.
- """
- # pylint: disable=super-init-not-called
- self.type = type
- self.value = value
-
- @classmethod
- def from_dict(cls, _dict: Dict) -> 'InstanceProfilePortSpeedFixed':
- """Initialize a InstanceProfilePortSpeedFixed object from a json dictionary."""
- args = {}
- if 'type' in _dict:
- args['type'] = _dict.get('type')
- else:
- raise ValueError('Required property \'type\' not present in InstanceProfilePortSpeedFixed JSON')
- if 'value' in _dict:
- args['value'] = _dict.get('value')
- else:
- raise ValueError('Required property \'value\' not present in InstanceProfilePortSpeedFixed JSON')
- return cls(**args)
-
- @classmethod
- def _from_dict(cls, _dict):
- """Initialize a InstanceProfilePortSpeedFixed object from 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 InstanceProfilePortSpeedFixed object."""
- return json.dumps(self.to_dict(), indent=2)
-
- def __eq__(self, other: 'InstanceProfilePortSpeedFixed') -> bool:
- """Return `true` when self and other are equal, false otherwise."""
- if not isinstance(other, self.__class__):
- return False
- return self.__dict__ == other.__dict__
-
- def __ne__(self, other: 'InstanceProfilePortSpeedFixed') -> bool:
- """Return `true` when self and other are not equal, false otherwise."""
- return not self == other
-
- class TypeEnum(str, Enum):
- """
- The type for this profile field.
- """
-
- FIXED = 'fixed'
-
-
-
-class InstanceProfileVCPUDependent(InstanceProfileVCPU):
+class DedicatedHostProfileVCPUDependent(DedicatedHostProfileVCPU):
"""
- The VCPU count for an instance with this profile depends on its configuration.
+ The VCPU count for a dedicated host with this profile depends on its configuration.
- :attr str type: The type for this profile field.
+ :param str type: The type for this profile field.
"""
def __init__(
@@ -100087,7 +105424,7 @@ def __init__(
type: str,
) -> None:
"""
- Initialize a InstanceProfileVCPUDependent object.
+ Initialize a DedicatedHostProfileVCPUDependent object.
:param str type: The type for this profile field.
"""
@@ -100095,18 +105432,18 @@ def __init__(
self.type = type
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstanceProfileVCPUDependent':
- """Initialize a InstanceProfileVCPUDependent object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'DedicatedHostProfileVCPUDependent':
+ """Initialize a DedicatedHostProfileVCPUDependent object from a json dictionary."""
args = {}
- if 'type' in _dict:
- args['type'] = _dict.get('type')
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
else:
- raise ValueError('Required property \'type\' not present in InstanceProfileVCPUDependent JSON')
+ raise ValueError('Required property \'type\' not present in DedicatedHostProfileVCPUDependent JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceProfileVCPUDependent object from a json dictionary."""
+ """Initialize a DedicatedHostProfileVCPUDependent object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -100121,16 +105458,16 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this InstanceProfileVCPUDependent object."""
+ """Return a `str` version of this DedicatedHostProfileVCPUDependent object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceProfileVCPUDependent') -> bool:
+ def __eq__(self, other: 'DedicatedHostProfileVCPUDependent') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'InstanceProfileVCPUDependent') -> bool:
+ def __ne__(self, other: 'DedicatedHostProfileVCPUDependent') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
@@ -100143,13 +105480,13 @@ class TypeEnum(str, Enum):
-class InstanceProfileVCPUEnum(InstanceProfileVCPU):
+class DedicatedHostProfileVCPUEnum(DedicatedHostProfileVCPU):
"""
- The permitted values for VCPU count for an instance with this profile.
+ The permitted values for VCPU count for a dedicated host with this profile.
- :attr int default: The default value for this profile field.
- :attr str type: The type for this profile field.
- :attr List[int] values: The permitted values for this profile field.
+ :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.
"""
def __init__(
@@ -100159,7 +105496,7 @@ def __init__(
values: List[int],
) -> None:
"""
- Initialize a InstanceProfileVCPUEnum object.
+ Initialize a DedicatedHostProfileVCPUEnum object.
:param int default: The default value for this profile field.
:param str type: The type for this profile field.
@@ -100171,26 +105508,26 @@ def __init__(
self.values = values
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstanceProfileVCPUEnum':
- """Initialize a InstanceProfileVCPUEnum object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'DedicatedHostProfileVCPUEnum':
+ """Initialize a DedicatedHostProfileVCPUEnum object from a json dictionary."""
args = {}
- if 'default' in _dict:
- args['default'] = _dict.get('default')
+ if (default := _dict.get('default')) is not None:
+ args['default'] = default
else:
- raise ValueError('Required property \'default\' not present in InstanceProfileVCPUEnum JSON')
- if 'type' in _dict:
- args['type'] = _dict.get('type')
+ raise ValueError('Required property \'default\' not present in DedicatedHostProfileVCPUEnum JSON')
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
else:
- raise ValueError('Required property \'type\' not present in InstanceProfileVCPUEnum JSON')
- if 'values' in _dict:
- args['values'] = _dict.get('values')
+ raise ValueError('Required property \'type\' not present in DedicatedHostProfileVCPUEnum JSON')
+ if (values := _dict.get('values')) is not None:
+ args['values'] = values
else:
- raise ValueError('Required property \'values\' not present in InstanceProfileVCPUEnum JSON')
+ raise ValueError('Required property \'values\' not present in DedicatedHostProfileVCPUEnum JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceProfileVCPUEnum object from a json dictionary."""
+ """Initialize a DedicatedHostProfileVCPUEnum object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -100209,16 +105546,16 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this InstanceProfileVCPUEnum object."""
+ """Return a `str` version of this DedicatedHostProfileVCPUEnum object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceProfileVCPUEnum') -> bool:
+ def __eq__(self, other: 'DedicatedHostProfileVCPUEnum') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'InstanceProfileVCPUEnum') -> bool:
+ def __ne__(self, other: 'DedicatedHostProfileVCPUEnum') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
@@ -100231,12 +105568,12 @@ class TypeEnum(str, Enum):
-class InstanceProfileVCPUFixed(InstanceProfileVCPU):
+class DedicatedHostProfileVCPUFixed(DedicatedHostProfileVCPU):
"""
- The VCPU count for an instance with this profile.
+ The VCPU count 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.
+ :param str type: The type for this profile field.
+ :param int value: The value for this profile field.
"""
def __init__(
@@ -100245,7 +105582,7 @@ def __init__(
value: int,
) -> None:
"""
- Initialize a InstanceProfileVCPUFixed object.
+ Initialize a DedicatedHostProfileVCPUFixed object.
:param str type: The type for this profile field.
:param int value: The value for this profile field.
@@ -100255,22 +105592,22 @@ def __init__(
self.value = value
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstanceProfileVCPUFixed':
- """Initialize a InstanceProfileVCPUFixed object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'DedicatedHostProfileVCPUFixed':
+ """Initialize a DedicatedHostProfileVCPUFixed object from a json dictionary."""
args = {}
- if 'type' in _dict:
- args['type'] = _dict.get('type')
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
else:
- raise ValueError('Required property \'type\' not present in InstanceProfileVCPUFixed JSON')
- if 'value' in _dict:
- args['value'] = _dict.get('value')
+ raise ValueError('Required property \'type\' not present in DedicatedHostProfileVCPUFixed JSON')
+ if (value := _dict.get('value')) is not None:
+ args['value'] = value
else:
- raise ValueError('Required property \'value\' not present in InstanceProfileVCPUFixed JSON')
+ raise ValueError('Required property \'value\' not present in DedicatedHostProfileVCPUFixed JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceProfileVCPUFixed object from a json dictionary."""
+ """Initialize a DedicatedHostProfileVCPUFixed object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -100287,16 +105624,16 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this InstanceProfileVCPUFixed object."""
+ """Return a `str` version of this DedicatedHostProfileVCPUFixed object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceProfileVCPUFixed') -> bool:
+ def __eq__(self, other: 'DedicatedHostProfileVCPUFixed') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'InstanceProfileVCPUFixed') -> bool:
+ def __ne__(self, other: 'DedicatedHostProfileVCPUFixed') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
@@ -100309,15 +105646,15 @@ class TypeEnum(str, Enum):
-class InstanceProfileVCPURange(InstanceProfileVCPU):
+class DedicatedHostProfileVCPURange(DedicatedHostProfileVCPU):
"""
- The permitted range for VCPU count for an instance with this profile.
+ The permitted range for VCPU count for a dedicated host with this profile.
- :attr int default: The default value for this profile field.
- :attr int max: The maximum value for this profile field.
- :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.
+ :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.
"""
def __init__(
@@ -100329,7 +105666,7 @@ def __init__(
type: str,
) -> None:
"""
- Initialize a InstanceProfileVCPURange object.
+ Initialize a DedicatedHostProfileVCPURange object.
:param int default: The default value for this profile field.
:param int max: The maximum value for this profile field.
@@ -100345,34 +105682,34 @@ def __init__(
self.type = type
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstanceProfileVCPURange':
- """Initialize a InstanceProfileVCPURange object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'DedicatedHostProfileVCPURange':
+ """Initialize a DedicatedHostProfileVCPURange object from a json dictionary."""
args = {}
- if 'default' in _dict:
- args['default'] = _dict.get('default')
+ if (default := _dict.get('default')) is not None:
+ args['default'] = default
else:
- raise ValueError('Required property \'default\' not present in InstanceProfileVCPURange JSON')
- if 'max' in _dict:
- args['max'] = _dict.get('max')
+ raise ValueError('Required property \'default\' not present in DedicatedHostProfileVCPURange JSON')
+ if (max := _dict.get('max')) is not None:
+ args['max'] = max
else:
- raise ValueError('Required property \'max\' not present in InstanceProfileVCPURange JSON')
- if 'min' in _dict:
- args['min'] = _dict.get('min')
+ raise ValueError('Required property \'max\' not present in DedicatedHostProfileVCPURange JSON')
+ if (min := _dict.get('min')) is not None:
+ args['min'] = min
else:
- raise ValueError('Required property \'min\' not present in InstanceProfileVCPURange JSON')
- if 'step' in _dict:
- args['step'] = _dict.get('step')
+ raise ValueError('Required property \'min\' not present in DedicatedHostProfileVCPURange JSON')
+ if (step := _dict.get('step')) is not None:
+ args['step'] = step
else:
- raise ValueError('Required property \'step\' not present in InstanceProfileVCPURange JSON')
- if 'type' in _dict:
- args['type'] = _dict.get('type')
+ raise ValueError('Required property \'step\' not present in DedicatedHostProfileVCPURange JSON')
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
else:
- raise ValueError('Required property \'type\' not present in InstanceProfileVCPURange JSON')
+ raise ValueError('Required property \'type\' not present in DedicatedHostProfileVCPURange JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceProfileVCPURange object from a json dictionary."""
+ """Initialize a DedicatedHostProfileVCPURange object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -100395,16 +105732,16 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this InstanceProfileVCPURange object."""
+ """Return a `str` version of this DedicatedHostProfileVCPURange object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceProfileVCPURange') -> bool:
+ def __eq__(self, other: 'DedicatedHostProfileVCPURange') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'InstanceProfileVCPURange') -> bool:
+ def __ne__(self, other: 'DedicatedHostProfileVCPURange') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
@@ -100417,46 +105754,101 @@ class TypeEnum(str, Enum):
-class InstanceProfileVolumeBandwidthDependent(InstanceProfileVolumeBandwidth):
+class DedicatedHostPrototypeDedicatedHostByGroup(DedicatedHostPrototype):
"""
- The storage bandwidth shared across the storage volumes of an instance with this
- profile depends on its configuration.
+ DedicatedHostPrototypeDedicatedHostByGroup.
- :attr str type: The type for this profile field.
+ :param bool instance_placement_enabled: (optional) If set to true, instances can
+ be placed on this dedicated host.
+ :param str name: (optional) The name for this dedicated host. The name must not
+ be used by another dedicated host in the region. If unspecified, the name will
+ be a hyphenated list of randomly-selected words.
+ :param DedicatedHostProfileIdentity profile: The
+ [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-dh-profiles) to use for this
+ dedicated host.
+ :param ResourceGroupIdentity resource_group: (optional)
+ :param DedicatedHostGroupIdentity group: The dedicated host group for this
+ dedicated host.
"""
def __init__(
self,
- type: str,
+ profile: 'DedicatedHostProfileIdentity',
+ group: 'DedicatedHostGroupIdentity',
+ *,
+ instance_placement_enabled: Optional[bool] = None,
+ name: Optional[str] = None,
+ resource_group: Optional['ResourceGroupIdentity'] = None,
) -> None:
"""
- Initialize a InstanceProfileVolumeBandwidthDependent object.
+ Initialize a DedicatedHostPrototypeDedicatedHostByGroup object.
- :param str type: The type for this profile field.
+ :param DedicatedHostProfileIdentity profile: The
+ [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-dh-profiles) to use for
+ this dedicated host.
+ :param DedicatedHostGroupIdentity group: The dedicated host group for this
+ dedicated host.
+ :param bool instance_placement_enabled: (optional) If set to true,
+ instances can be placed on this dedicated host.
+ :param str name: (optional) The name for this dedicated host. The name must
+ not be used by another dedicated host in the region. If unspecified, the
+ name will be a hyphenated list of randomly-selected words.
+ :param ResourceGroupIdentity resource_group: (optional)
"""
# pylint: disable=super-init-not-called
- self.type = type
+ self.instance_placement_enabled = instance_placement_enabled
+ self.name = name
+ self.profile = profile
+ self.resource_group = resource_group
+ self.group = group
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstanceProfileVolumeBandwidthDependent':
- """Initialize a InstanceProfileVolumeBandwidthDependent object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'DedicatedHostPrototypeDedicatedHostByGroup':
+ """Initialize a DedicatedHostPrototypeDedicatedHostByGroup object from a json dictionary."""
args = {}
- if 'type' in _dict:
- args['type'] = _dict.get('type')
+ if (instance_placement_enabled := _dict.get('instance_placement_enabled')) is not None:
+ args['instance_placement_enabled'] = instance_placement_enabled
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ if (profile := _dict.get('profile')) is not None:
+ args['profile'] = profile
else:
- raise ValueError('Required property \'type\' not present in InstanceProfileVolumeBandwidthDependent JSON')
+ raise ValueError('Required property \'profile\' not present in DedicatedHostPrototypeDedicatedHostByGroup JSON')
+ if (resource_group := _dict.get('resource_group')) is not None:
+ args['resource_group'] = resource_group
+ if (group := _dict.get('group')) is not None:
+ args['group'] = group
+ else:
+ raise ValueError('Required property \'group\' not present in DedicatedHostPrototypeDedicatedHostByGroup JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceProfileVolumeBandwidthDependent object from a json dictionary."""
+ """Initialize a DedicatedHostPrototypeDedicatedHostByGroup object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'type') and self.type is not None:
- _dict['type'] = self.type
+ if hasattr(self, 'instance_placement_enabled') and self.instance_placement_enabled is not None:
+ _dict['instance_placement_enabled'] = self.instance_placement_enabled
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ if hasattr(self, 'profile') and self.profile is not None:
+ if isinstance(self.profile, dict):
+ _dict['profile'] = self.profile
+ else:
+ _dict['profile'] = self.profile.to_dict()
+ if hasattr(self, 'resource_group') and self.resource_group is not None:
+ if isinstance(self.resource_group, dict):
+ _dict['resource_group'] = self.resource_group
+ else:
+ _dict['resource_group'] = self.resource_group.to_dict()
+ if hasattr(self, 'group') and self.group is not None:
+ if isinstance(self.group, dict):
+ _dict['group'] = self.group
+ else:
+ _dict['group'] = self.group.to_dict()
return _dict
def _to_dict(self):
@@ -100464,88 +105856,125 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this InstanceProfileVolumeBandwidthDependent object."""
+ """Return a `str` version of this DedicatedHostPrototypeDedicatedHostByGroup object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceProfileVolumeBandwidthDependent') -> bool:
+ def __eq__(self, other: 'DedicatedHostPrototypeDedicatedHostByGroup') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'InstanceProfileVolumeBandwidthDependent') -> bool:
+ def __ne__(self, other: 'DedicatedHostPrototypeDedicatedHostByGroup') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class TypeEnum(str, Enum):
- """
- The type for this profile field.
- """
-
- DEPENDENT = 'dependent'
-
-
-class InstanceProfileVolumeBandwidthEnum(InstanceProfileVolumeBandwidth):
+class DedicatedHostPrototypeDedicatedHostByZone(DedicatedHostPrototype):
"""
- The permitted storage bandwidth values (in megabits per second) shared across the
- storage volumes of an instance with this profile.
+ DedicatedHostPrototypeDedicatedHostByZone.
- :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.
+ :param bool instance_placement_enabled: (optional) If set to true, instances can
+ be placed on this dedicated host.
+ :param str name: (optional) The name for this dedicated host. The name must not
+ be used by another dedicated host in the region. If unspecified, the name will
+ be a hyphenated list of randomly-selected words.
+ :param DedicatedHostProfileIdentity profile: The
+ [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-dh-profiles) to use for this
+ dedicated host.
+ :param ResourceGroupIdentity resource_group: (optional)
+ :param DedicatedHostGroupPrototypeDedicatedHostByZoneContext group: (optional)
+ :param ZoneIdentity zone: The zone this dedicated host will reside in.
"""
def __init__(
self,
- default: int,
- type: str,
- values: List[int],
+ profile: 'DedicatedHostProfileIdentity',
+ zone: 'ZoneIdentity',
+ *,
+ instance_placement_enabled: Optional[bool] = None,
+ name: Optional[str] = None,
+ resource_group: Optional['ResourceGroupIdentity'] = None,
+ group: Optional['DedicatedHostGroupPrototypeDedicatedHostByZoneContext'] = None,
) -> None:
"""
- Initialize a InstanceProfileVolumeBandwidthEnum object.
+ Initialize a DedicatedHostPrototypeDedicatedHostByZone object.
- :param int default: The default value for this profile field.
- :param str type: The type for this profile field.
- :param List[int] values: The permitted values for this profile field.
+ :param DedicatedHostProfileIdentity profile: The
+ [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-dh-profiles) to use for
+ this dedicated host.
+ :param ZoneIdentity zone: The zone this dedicated host will reside in.
+ :param bool instance_placement_enabled: (optional) If set to true,
+ instances can be placed on this dedicated host.
+ :param str name: (optional) The name for this dedicated host. The name must
+ not be used by another dedicated host in the region. If unspecified, the
+ name will be a hyphenated list of randomly-selected words.
+ :param ResourceGroupIdentity resource_group: (optional)
+ :param DedicatedHostGroupPrototypeDedicatedHostByZoneContext group:
+ (optional)
"""
# pylint: disable=super-init-not-called
- self.default = default
- self.type = type
- self.values = values
+ self.instance_placement_enabled = instance_placement_enabled
+ self.name = name
+ self.profile = profile
+ self.resource_group = resource_group
+ self.group = group
+ self.zone = zone
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstanceProfileVolumeBandwidthEnum':
- """Initialize a InstanceProfileVolumeBandwidthEnum object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'DedicatedHostPrototypeDedicatedHostByZone':
+ """Initialize a DedicatedHostPrototypeDedicatedHostByZone object from a json dictionary."""
args = {}
- if 'default' in _dict:
- args['default'] = _dict.get('default')
- else:
- raise ValueError('Required property \'default\' not present in InstanceProfileVolumeBandwidthEnum JSON')
- if 'type' in _dict:
- args['type'] = _dict.get('type')
+ if (instance_placement_enabled := _dict.get('instance_placement_enabled')) is not None:
+ args['instance_placement_enabled'] = instance_placement_enabled
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ if (profile := _dict.get('profile')) is not None:
+ args['profile'] = profile
else:
- raise ValueError('Required property \'type\' not present in InstanceProfileVolumeBandwidthEnum JSON')
- if 'values' in _dict:
- args['values'] = _dict.get('values')
+ raise ValueError('Required property \'profile\' not present in DedicatedHostPrototypeDedicatedHostByZone JSON')
+ if (resource_group := _dict.get('resource_group')) is not None:
+ args['resource_group'] = resource_group
+ if (group := _dict.get('group')) is not None:
+ args['group'] = DedicatedHostGroupPrototypeDedicatedHostByZoneContext.from_dict(group)
+ if (zone := _dict.get('zone')) is not None:
+ args['zone'] = zone
else:
- raise ValueError('Required property \'values\' not present in InstanceProfileVolumeBandwidthEnum JSON')
+ raise ValueError('Required property \'zone\' not present in DedicatedHostPrototypeDedicatedHostByZone JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceProfileVolumeBandwidthEnum object from a json dictionary."""
+ """Initialize a DedicatedHostPrototypeDedicatedHostByZone object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, '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, 'instance_placement_enabled') and self.instance_placement_enabled is not None:
+ _dict['instance_placement_enabled'] = self.instance_placement_enabled
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ if hasattr(self, 'profile') and self.profile is not None:
+ if isinstance(self.profile, dict):
+ _dict['profile'] = self.profile
+ else:
+ _dict['profile'] = self.profile.to_dict()
+ if hasattr(self, 'resource_group') and self.resource_group is not None:
+ if isinstance(self.resource_group, dict):
+ _dict['resource_group'] = self.resource_group
+ else:
+ _dict['resource_group'] = self.resource_group.to_dict()
+ if hasattr(self, 'group') and self.group is not None:
+ if isinstance(self.group, dict):
+ _dict['group'] = self.group
+ else:
+ _dict['group'] = self.group.to_dict()
+ if hasattr(self, 'zone') and self.zone is not None:
+ if isinstance(self.zone, dict):
+ _dict['zone'] = self.zone
+ else:
+ _dict['zone'] = self.zone.to_dict()
return _dict
def _to_dict(self):
@@ -100553,78 +105982,67 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this InstanceProfileVolumeBandwidthEnum object."""
+ """Return a `str` version of this DedicatedHostPrototypeDedicatedHostByZone object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceProfileVolumeBandwidthEnum') -> bool:
+ def __eq__(self, other: 'DedicatedHostPrototypeDedicatedHostByZone') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'InstanceProfileVolumeBandwidthEnum') -> bool:
+ def __ne__(self, other: 'DedicatedHostPrototypeDedicatedHostByZone') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class TypeEnum(str, Enum):
- """
- The type for this profile field.
- """
-
- ENUM = 'enum'
-
-
-class InstanceProfileVolumeBandwidthFixed(InstanceProfileVolumeBandwidth):
+class EncryptionKeyIdentityByCRN(EncryptionKeyIdentity):
"""
- The storage bandwidth (in megabits per second) shared across the storage volumes of an
- instance with this profile.
+ EncryptionKeyIdentityByCRN.
- :attr str type: The type for this profile field.
- :attr int value: The value for this profile field.
+ :param str crn: The CRN of the [Key Protect Root
+ Key](https://cloud.ibm.com/docs/key-protect?topic=key-protect-getting-started-tutorial)
+ or [Hyper Protect Crypto Services Root
+ Key](https://cloud.ibm.com/docs/hs-crypto?topic=hs-crypto-get-started) for this
+ resource.
"""
def __init__(
self,
- type: str,
- value: int,
+ crn: str,
) -> None:
"""
- Initialize a InstanceProfileVolumeBandwidthFixed object.
+ Initialize a EncryptionKeyIdentityByCRN object.
- :param str type: The type for this profile field.
- :param int value: The value for this profile field.
+ :param str crn: The CRN of the [Key Protect Root
+ Key](https://cloud.ibm.com/docs/key-protect?topic=key-protect-getting-started-tutorial)
+ or [Hyper Protect Crypto Services Root
+ Key](https://cloud.ibm.com/docs/hs-crypto?topic=hs-crypto-get-started) for
+ this resource.
"""
# pylint: disable=super-init-not-called
- self.type = type
- self.value = value
+ self.crn = crn
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstanceProfileVolumeBandwidthFixed':
- """Initialize a InstanceProfileVolumeBandwidthFixed object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'EncryptionKeyIdentityByCRN':
+ """Initialize a EncryptionKeyIdentityByCRN object from a json dictionary."""
args = {}
- if 'type' in _dict:
- args['type'] = _dict.get('type')
- else:
- raise ValueError('Required property \'type\' not present in InstanceProfileVolumeBandwidthFixed JSON')
- if 'value' in _dict:
- args['value'] = _dict.get('value')
+ if (crn := _dict.get('crn')) is not None:
+ args['crn'] = crn
else:
- raise ValueError('Required property \'value\' not present in InstanceProfileVolumeBandwidthFixed JSON')
+ raise ValueError('Required property \'crn\' not present in EncryptionKeyIdentityByCRN JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceProfileVolumeBandwidthFixed object from a json dictionary."""
+ """Initialize a EncryptionKeyIdentityByCRN object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'type') and self.type is not None:
- _dict['type'] = self.type
- if hasattr(self, 'value') and self.value is not None:
- _dict['value'] = self.value
+ if hasattr(self, 'crn') and self.crn is not None:
+ _dict['crn'] = self.crn
return _dict
def _to_dict(self):
@@ -100632,108 +106050,124 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this InstanceProfileVolumeBandwidthFixed object."""
+ """Return a `str` version of this EncryptionKeyIdentityByCRN object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceProfileVolumeBandwidthFixed') -> bool:
+ def __eq__(self, other: 'EncryptionKeyIdentityByCRN') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'InstanceProfileVolumeBandwidthFixed') -> bool:
+ def __ne__(self, other: 'EncryptionKeyIdentityByCRN') -> 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 EndpointGatewayReservedIPReservedIPIdentity(EndpointGatewayReservedIP):
+ """
+ Identifies a reserved IP by a unique property.
+ """
+ def __init__(
+ self,
+ ) -> None:
+ """
+ Initialize a EndpointGatewayReservedIPReservedIPIdentity object.
-class InstanceProfileVolumeBandwidthRange(InstanceProfileVolumeBandwidth):
+ """
+ # pylint: disable=super-init-not-called
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['EndpointGatewayReservedIPReservedIPIdentityById', 'EndpointGatewayReservedIPReservedIPIdentityByHref'])
+ )
+ raise Exception(msg)
+
+
+class EndpointGatewayReservedIPReservedIPPrototypeTargetContext(EndpointGatewayReservedIP):
"""
- The permitted storage bandwidth range (in megabits per second) shared across the
- storage volumes of an instance with this profile.
+ EndpointGatewayReservedIPReservedIPPrototypeTargetContext.
- :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.
+ :param str address: (optional) The IP address to reserve, which must not already
+ be reserved on the subnet.
+ If unspecified, an available address on the subnet will automatically be
+ selected.
+ :param bool auto_delete: (optional) Indicates whether this reserved IP member
+ will be automatically deleted when either
+ `target` is deleted, or the reserved IP is unbound.
+ :param str name: (optional) The name for this reserved IP. The name must not be
+ used by another reserved IP in the subnet. Names starting with `ibm-` are
+ reserved for provider-owned resources, and are not allowed. If unspecified, the
+ name will be a hyphenated list of randomly-selected words.
+ :param SubnetIdentity subnet: The subnet in which to create this reserved IP.
"""
def __init__(
self,
- default: int,
- max: int,
- min: int,
- step: int,
- type: str,
+ subnet: 'SubnetIdentity',
+ *,
+ address: Optional[str] = None,
+ auto_delete: Optional[bool] = None,
+ name: Optional[str] = None,
) -> None:
"""
- Initialize a InstanceProfileVolumeBandwidthRange object.
+ Initialize a EndpointGatewayReservedIPReservedIPPrototypeTargetContext object.
- :param int default: The default value for this profile field.
- :param int max: The maximum value for this profile field.
- :param int min: The minimum value for this profile field.
- :param int step: The increment step value for this profile field.
- :param str type: The type for this profile field.
+ :param SubnetIdentity subnet: The subnet in which to create this reserved
+ IP.
+ :param str address: (optional) The IP address to reserve, which must not
+ already be reserved on the subnet.
+ If unspecified, an available address on the subnet will automatically be
+ selected.
+ :param bool auto_delete: (optional) Indicates whether this reserved IP
+ member will be automatically deleted when either
+ `target` is deleted, or the reserved IP is unbound.
+ :param str name: (optional) The name for this reserved IP. The name must
+ not be used by another reserved IP in the subnet. Names starting with
+ `ibm-` are reserved for provider-owned resources, and are not allowed. If
+ unspecified, the name will be a hyphenated list of randomly-selected words.
"""
# pylint: disable=super-init-not-called
- self.default = default
- self.max = max
- self.min = min
- self.step = step
- self.type = type
+ self.address = address
+ self.auto_delete = auto_delete
+ self.name = name
+ self.subnet = subnet
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstanceProfileVolumeBandwidthRange':
- """Initialize a InstanceProfileVolumeBandwidthRange object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'EndpointGatewayReservedIPReservedIPPrototypeTargetContext':
+ """Initialize a EndpointGatewayReservedIPReservedIPPrototypeTargetContext object from a json dictionary."""
args = {}
- if 'default' in _dict:
- args['default'] = _dict.get('default')
- else:
- raise ValueError('Required property \'default\' not present in InstanceProfileVolumeBandwidthRange JSON')
- if 'max' in _dict:
- args['max'] = _dict.get('max')
- else:
- raise ValueError('Required property \'max\' not present in InstanceProfileVolumeBandwidthRange JSON')
- if 'min' in _dict:
- args['min'] = _dict.get('min')
- else:
- raise ValueError('Required property \'min\' not present in InstanceProfileVolumeBandwidthRange JSON')
- if 'step' in _dict:
- args['step'] = _dict.get('step')
- else:
- raise ValueError('Required property \'step\' not present in InstanceProfileVolumeBandwidthRange JSON')
- if 'type' in _dict:
- args['type'] = _dict.get('type')
+ if (address := _dict.get('address')) is not None:
+ args['address'] = address
+ if (auto_delete := _dict.get('auto_delete')) is not None:
+ args['auto_delete'] = auto_delete
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ if (subnet := _dict.get('subnet')) is not None:
+ args['subnet'] = subnet
else:
- raise ValueError('Required property \'type\' not present in InstanceProfileVolumeBandwidthRange JSON')
+ raise ValueError('Required property \'subnet\' not present in EndpointGatewayReservedIPReservedIPPrototypeTargetContext JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceProfileVolumeBandwidthRange object from a json dictionary."""
+ """Initialize a EndpointGatewayReservedIPReservedIPPrototypeTargetContext object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'default') and self.default is not None:
- _dict['default'] = self.default
- if hasattr(self, 'max') and self.max is not None:
- _dict['max'] = self.max
- if hasattr(self, 'min') and self.min is not None:
- _dict['min'] = self.min
- if hasattr(self, 'step') and self.step is not None:
- _dict['step'] = self.step
- if hasattr(self, 'type') and self.type is not None:
- _dict['type'] = self.type
+ if hasattr(self, 'address') and self.address is not None:
+ _dict['address'] = self.address
+ if hasattr(self, 'auto_delete') and self.auto_delete is not None:
+ _dict['auto_delete'] = self.auto_delete
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ if hasattr(self, 'subnet') and self.subnet is not None:
+ if isinstance(self.subnet, dict):
+ _dict['subnet'] = self.subnet
+ else:
+ _dict['subnet'] = self.subnet.to_dict()
return _dict
def _to_dict(self):
@@ -100741,355 +106175,135 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this InstanceProfileVolumeBandwidthRange object."""
+ """Return a `str` version of this EndpointGatewayReservedIPReservedIPPrototypeTargetContext object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceProfileVolumeBandwidthRange') -> bool:
+ def __eq__(self, other: 'EndpointGatewayReservedIPReservedIPPrototypeTargetContext') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'InstanceProfileVolumeBandwidthRange') -> bool:
+ def __ne__(self, other: 'EndpointGatewayReservedIPReservedIPPrototypeTargetContext') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class TypeEnum(str, Enum):
+
+class EndpointGatewayTargetPrototypeProviderCloudServiceIdentity(EndpointGatewayTargetPrototype):
+ """
+ EndpointGatewayTargetPrototypeProviderCloudServiceIdentity.
+
+ :param str resource_type: The type of target for this endpoint gateway.
+ """
+
+ def __init__(
+ self,
+ resource_type: str,
+ ) -> None:
"""
- The type for this profile field.
+ Initialize a EndpointGatewayTargetPrototypeProviderCloudServiceIdentity object.
+
+ :param str resource_type: The type of target for this endpoint gateway.
"""
+ # pylint: disable=super-init-not-called
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['EndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRN'])
+ )
+ raise Exception(msg)
- RANGE = 'range'
+ 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 InstancePrototypeInstanceByCatalogOffering(InstancePrototype):
+
+class EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentity(EndpointGatewayTargetPrototype):
"""
- Create an instance by using a catalog offering.
+ EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentity.
- :attr InstanceAvailabilityPolicyPrototype availability_policy: (optional) The
- availability policy to use for this virtual server instance.
- :attr InstanceDefaultTrustedProfilePrototype default_trusted_profile: (optional)
- The default trusted profile configuration to use for this virtual server
- instance
- This property's value is used when provisioning the virtual server instance, but
- not subsequently managed. Accordingly, it is reflected as an [instance
- initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
- property.
- :attr List[KeyIdentity] keys: (optional) The public SSH keys for the
- administrative user of the virtual server instance. Keys will be made available
- to the virtual server instance as cloud-init vendor data. For cloud-init enabled
- images, these keys will also be added as SSH authorized keys for the
- administrative user.
- For Windows images, the keys of type `rsa` must be specified, and one will be
- selected to encrypt [the administrator
- password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys
- are optional for other images, but if no keys are specified, the instance will
- be inaccessible unless the specified image provides another means of access.
- This property's value is used when provisioning the virtual server instance, but
- not subsequently managed. Accordingly, it is reflected as an [instance
- initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
- property.
- :attr InstanceMetadataServicePrototype metadata_service: (optional)
- :attr str name: (optional) The name for this virtual server instance. The name
- must not be used by another virtual server instance in the region. If
- unspecified, the name will be a hyphenated list of randomly-selected words.
- The system hostname will be based on this name.
- :attr InstancePlacementTargetPrototype placement_target: (optional) The
- placement restrictions to use for the virtual server instance.
- :attr InstanceProfileIdentity profile: (optional) The
- [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this
- virtual server instance.
- If unspecified, `bx2-2x8` will be used, but this default value is expected to
- change in the future.
- :attr ResourceGroupIdentity resource_group: (optional)
- :attr int total_volume_bandwidth: (optional) The amount of bandwidth (in
- megabits per second) allocated exclusively to instance storage volumes. An
- increase in this value will result in a corresponding decrease to
- `total_network_bandwidth`.
- :attr str user_data: (optional) [User
- data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when
- setting up the virtual server instance.
- :attr List[VolumeAttachmentPrototype] volume_attachments: (optional) The
- additional volume attachments to create for the virtual server instance.
- :attr VPCIdentity vpc: (optional) The VPC this virtual server instance will
- reside in.
- If specified, it must match the VPC for the subnets of the instance network
- interfaces.
- :attr VolumeAttachmentPrototypeInstanceByImageContext boot_volume_attachment:
- (optional) The boot volume attachment to create for the virtual server instance.
- :attr InstanceCatalogOfferingPrototype catalog_offering: The
- [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user)
- offering
- or offering version to use when provisioning this virtual server instance.
- If an offering is specified, the latest version of that offering will be used.
- The specified offering or offering version may be in a different account in the
- same
- [enterprise](https://cloud.ibm.com/docs/account?topic=account-what-is-enterprise),
- subject
- to IAM policies.
- :attr List[NetworkInterfacePrototype] network_interfaces: (optional) The
- additional instance network interfaces to create.
- :attr NetworkInterfacePrototype primary_network_interface: The primary instance
- network interface to create.
- :attr ZoneIdentity zone: The zone this virtual server instance will reside in.
+ :param str resource_type: The type of target for this endpoint gateway.
"""
def __init__(
self,
- catalog_offering: 'InstanceCatalogOfferingPrototype',
- primary_network_interface: 'NetworkInterfacePrototype',
- zone: 'ZoneIdentity',
- *,
- availability_policy: 'InstanceAvailabilityPolicyPrototype' = None,
- default_trusted_profile: 'InstanceDefaultTrustedProfilePrototype' = None,
- keys: List['KeyIdentity'] = None,
- metadata_service: 'InstanceMetadataServicePrototype' = None,
- name: str = None,
- placement_target: 'InstancePlacementTargetPrototype' = None,
- profile: 'InstanceProfileIdentity' = None,
- resource_group: 'ResourceGroupIdentity' = None,
- total_volume_bandwidth: int = None,
- user_data: str = None,
- volume_attachments: List['VolumeAttachmentPrototype'] = None,
- vpc: 'VPCIdentity' = None,
- boot_volume_attachment: 'VolumeAttachmentPrototypeInstanceByImageContext' = None,
- network_interfaces: List['NetworkInterfacePrototype'] = None,
+ resource_type: str,
) -> None:
"""
- Initialize a InstancePrototypeInstanceByCatalogOffering object.
+ Initialize a EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentity object.
- :param InstanceCatalogOfferingPrototype catalog_offering: The
- [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user)
- offering
- or offering version to use when provisioning this virtual server instance.
- If an offering is specified, the latest version of that offering will be
- used.
- The specified offering or offering version may be in a different account in
- the same
- [enterprise](https://cloud.ibm.com/docs/account?topic=account-what-is-enterprise),
- subject
- to IAM policies.
- :param NetworkInterfacePrototype primary_network_interface: The primary
- instance network interface to create.
- :param ZoneIdentity zone: The zone this virtual server instance will reside
- in.
- :param InstanceAvailabilityPolicyPrototype availability_policy: (optional)
- The availability policy to use for this virtual server instance.
- :param InstanceDefaultTrustedProfilePrototype default_trusted_profile:
- (optional) The default trusted profile configuration to use for this
- virtual server instance
- This property's value is used when provisioning the virtual server
- instance, but not subsequently managed. Accordingly, it is reflected as an
- [instance
- initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
- property.
- :param List[KeyIdentity] keys: (optional) The public SSH keys for the
- administrative user of the virtual server instance. Keys will be made
- available to the virtual server instance as cloud-init vendor data. For
- cloud-init enabled images, these keys will also be added as SSH authorized
- keys for the administrative user.
- For Windows images, the keys of type `rsa` must be specified, and one will
- be selected to encrypt [the administrator
- password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization).
- Keys are optional for other images, but if no keys are specified, the
- instance will be inaccessible unless the specified image provides another
- means of access.
- This property's value is used when provisioning the virtual server
- instance, but not subsequently managed. Accordingly, it is reflected as an
- [instance
- initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
- property.
- :param InstanceMetadataServicePrototype metadata_service: (optional)
- :param str name: (optional) The name for this virtual server instance. The
- name must not be used by another virtual server instance in the region. If
- unspecified, the name will be a hyphenated list of randomly-selected words.
- The system hostname will be based on this name.
- :param InstancePlacementTargetPrototype placement_target: (optional) The
- placement restrictions to use for the virtual server instance.
- :param InstanceProfileIdentity profile: (optional) The
- [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for
- this virtual server instance.
- If unspecified, `bx2-2x8` will be used, but this default value is expected
- to change in the future.
- :param ResourceGroupIdentity resource_group: (optional)
- :param int total_volume_bandwidth: (optional) The amount of bandwidth (in
- megabits per second) allocated exclusively to instance storage volumes. An
- increase in this value will result in a corresponding decrease to
- `total_network_bandwidth`.
- :param str user_data: (optional) [User
- data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available
- when setting up the virtual server instance.
- :param List[VolumeAttachmentPrototype] volume_attachments: (optional) The
- additional volume attachments to create for the virtual server instance.
- :param VPCIdentity vpc: (optional) The VPC this virtual server instance
- will reside in.
- If specified, it must match the VPC for the subnets of the instance network
- interfaces.
- :param VolumeAttachmentPrototypeInstanceByImageContext
- boot_volume_attachment: (optional) The boot volume attachment to create for
- the virtual server instance.
- :param List[NetworkInterfacePrototype] network_interfaces: (optional) The
- additional instance network interfaces to create.
+ :param str resource_type: The type of target for this endpoint gateway.
"""
# pylint: disable=super-init-not-called
- self.availability_policy = availability_policy
- self.default_trusted_profile = default_trusted_profile
- self.keys = keys
- self.metadata_service = metadata_service
- self.name = name
- self.placement_target = placement_target
- self.profile = profile
- self.resource_group = resource_group
- self.total_volume_bandwidth = total_volume_bandwidth
- self.user_data = user_data
- self.volume_attachments = volume_attachments
- self.vpc = vpc
- self.boot_volume_attachment = boot_volume_attachment
- self.catalog_offering = catalog_offering
- self.network_interfaces = network_interfaces
- self.primary_network_interface = primary_network_interface
- self.zone = zone
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityProviderInfrastructureServiceIdentityByName'])
+ )
+ raise Exception(msg)
+
+ class ResourceTypeEnum(str, Enum):
+ """
+ The type of target for this endpoint gateway.
+ """
+
+ PROVIDER_CLOUD_SERVICE = 'provider_cloud_service'
+ PROVIDER_INFRASTRUCTURE_SERVICE = 'provider_infrastructure_service'
+
+
+
+class EndpointGatewayTargetProviderCloudServiceReference(EndpointGatewayTarget):
+ """
+ EndpointGatewayTargetProviderCloudServiceReference.
+
+ :param str crn: The CRN for this provider cloud service, or the CRN for the
+ user's instance of a provider cloud service.
+ :param str resource_type: The type of target.
+ """
+
+ def __init__(
+ self,
+ crn: str,
+ resource_type: str,
+ ) -> None:
+ """
+ Initialize a EndpointGatewayTargetProviderCloudServiceReference object.
+
+ :param str crn: The CRN for this provider cloud service, or the CRN for the
+ user's instance of a provider cloud service.
+ :param str resource_type: The type of target.
+ """
+ # pylint: disable=super-init-not-called
+ self.crn = crn
+ self.resource_type = resource_type
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstancePrototypeInstanceByCatalogOffering':
- """Initialize a InstancePrototypeInstanceByCatalogOffering object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'EndpointGatewayTargetProviderCloudServiceReference':
+ """Initialize a EndpointGatewayTargetProviderCloudServiceReference object from a json dictionary."""
args = {}
- if 'availability_policy' in _dict:
- args['availability_policy'] = InstanceAvailabilityPolicyPrototype.from_dict(_dict.get('availability_policy'))
- if 'default_trusted_profile' in _dict:
- args['default_trusted_profile'] = InstanceDefaultTrustedProfilePrototype.from_dict(_dict.get('default_trusted_profile'))
- if 'keys' in _dict:
- args['keys'] = _dict.get('keys')
- if 'metadata_service' in _dict:
- args['metadata_service'] = InstanceMetadataServicePrototype.from_dict(_dict.get('metadata_service'))
- if 'name' in _dict:
- args['name'] = _dict.get('name')
- if 'placement_target' in _dict:
- args['placement_target'] = _dict.get('placement_target')
- if 'profile' in _dict:
- args['profile'] = _dict.get('profile')
- if 'resource_group' in _dict:
- args['resource_group'] = _dict.get('resource_group')
- if 'total_volume_bandwidth' in _dict:
- args['total_volume_bandwidth'] = _dict.get('total_volume_bandwidth')
- if 'user_data' in _dict:
- args['user_data'] = _dict.get('user_data')
- if 'volume_attachments' in _dict:
- args['volume_attachments'] = [VolumeAttachmentPrototype.from_dict(v) for v in _dict.get('volume_attachments')]
- if 'vpc' in _dict:
- args['vpc'] = _dict.get('vpc')
- if 'boot_volume_attachment' in _dict:
- args['boot_volume_attachment'] = VolumeAttachmentPrototypeInstanceByImageContext.from_dict(_dict.get('boot_volume_attachment'))
- if 'catalog_offering' in _dict:
- args['catalog_offering'] = _dict.get('catalog_offering')
- else:
- raise ValueError('Required property \'catalog_offering\' not present in InstancePrototypeInstanceByCatalogOffering JSON')
- if 'network_interfaces' in _dict:
- args['network_interfaces'] = [NetworkInterfacePrototype.from_dict(v) for v in _dict.get('network_interfaces')]
- if 'primary_network_interface' in _dict:
- args['primary_network_interface'] = NetworkInterfacePrototype.from_dict(_dict.get('primary_network_interface'))
+ if (crn := _dict.get('crn')) is not None:
+ args['crn'] = crn
else:
- raise ValueError('Required property \'primary_network_interface\' not present in InstancePrototypeInstanceByCatalogOffering JSON')
- if 'zone' in _dict:
- args['zone'] = _dict.get('zone')
+ raise ValueError('Required property \'crn\' not present in EndpointGatewayTargetProviderCloudServiceReference JSON')
+ if (resource_type := _dict.get('resource_type')) is not None:
+ args['resource_type'] = resource_type
else:
- raise ValueError('Required property \'zone\' not present in InstancePrototypeInstanceByCatalogOffering JSON')
+ raise ValueError('Required property \'resource_type\' not present in EndpointGatewayTargetProviderCloudServiceReference JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstancePrototypeInstanceByCatalogOffering object from a json dictionary."""
+ """Initialize a EndpointGatewayTargetProviderCloudServiceReference object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'availability_policy') and self.availability_policy is not None:
- if isinstance(self.availability_policy, dict):
- _dict['availability_policy'] = self.availability_policy
- else:
- _dict['availability_policy'] = self.availability_policy.to_dict()
- if hasattr(self, 'default_trusted_profile') and self.default_trusted_profile is not None:
- if isinstance(self.default_trusted_profile, dict):
- _dict['default_trusted_profile'] = self.default_trusted_profile
- else:
- _dict['default_trusted_profile'] = self.default_trusted_profile.to_dict()
- if hasattr(self, 'keys') and self.keys is not None:
- keys_list = []
- for v in self.keys:
- if isinstance(v, dict):
- keys_list.append(v)
- else:
- keys_list.append(v.to_dict())
- _dict['keys'] = keys_list
- if hasattr(self, 'metadata_service') and self.metadata_service is not None:
- if isinstance(self.metadata_service, dict):
- _dict['metadata_service'] = self.metadata_service
- else:
- _dict['metadata_service'] = self.metadata_service.to_dict()
- if hasattr(self, 'name') and self.name is not None:
- _dict['name'] = self.name
- if hasattr(self, 'placement_target') and self.placement_target is not None:
- if isinstance(self.placement_target, dict):
- _dict['placement_target'] = self.placement_target
- else:
- _dict['placement_target'] = self.placement_target.to_dict()
- if hasattr(self, 'profile') and self.profile is not None:
- if isinstance(self.profile, dict):
- _dict['profile'] = self.profile
- else:
- _dict['profile'] = self.profile.to_dict()
- if hasattr(self, 'resource_group') and self.resource_group is not None:
- if isinstance(self.resource_group, dict):
- _dict['resource_group'] = self.resource_group
- else:
- _dict['resource_group'] = self.resource_group.to_dict()
- if hasattr(self, 'total_volume_bandwidth') and self.total_volume_bandwidth is not None:
- _dict['total_volume_bandwidth'] = self.total_volume_bandwidth
- if hasattr(self, 'user_data') and self.user_data is not None:
- _dict['user_data'] = self.user_data
- if hasattr(self, 'volume_attachments') and self.volume_attachments is not None:
- volume_attachments_list = []
- for v in self.volume_attachments:
- if isinstance(v, dict):
- volume_attachments_list.append(v)
- else:
- volume_attachments_list.append(v.to_dict())
- _dict['volume_attachments'] = volume_attachments_list
- if hasattr(self, 'vpc') and self.vpc is not None:
- if isinstance(self.vpc, dict):
- _dict['vpc'] = self.vpc
- else:
- _dict['vpc'] = self.vpc.to_dict()
- if hasattr(self, 'boot_volume_attachment') and self.boot_volume_attachment is not None:
- if isinstance(self.boot_volume_attachment, dict):
- _dict['boot_volume_attachment'] = self.boot_volume_attachment
- else:
- _dict['boot_volume_attachment'] = self.boot_volume_attachment.to_dict()
- if hasattr(self, 'catalog_offering') and self.catalog_offering is not None:
- if isinstance(self.catalog_offering, dict):
- _dict['catalog_offering'] = self.catalog_offering
- else:
- _dict['catalog_offering'] = self.catalog_offering.to_dict()
- if hasattr(self, 'network_interfaces') and self.network_interfaces is not None:
- network_interfaces_list = []
- for v in self.network_interfaces:
- if isinstance(v, dict):
- network_interfaces_list.append(v)
- else:
- network_interfaces_list.append(v.to_dict())
- _dict['network_interfaces'] = network_interfaces_list
- if hasattr(self, 'primary_network_interface') and self.primary_network_interface is not None:
- if isinstance(self.primary_network_interface, dict):
- _dict['primary_network_interface'] = self.primary_network_interface
- else:
- _dict['primary_network_interface'] = self.primary_network_interface.to_dict()
- if hasattr(self, 'zone') and self.zone is not None:
- if isinstance(self.zone, dict):
- _dict['zone'] = self.zone
- else:
- _dict['zone'] = self.zone.to_dict()
+ if hasattr(self, 'crn') and self.crn is not None:
+ _dict['crn'] = self.crn
+ if hasattr(self, 'resource_type') and self.resource_type is not None:
+ _dict['resource_type'] = self.resource_type
return _dict
def _to_dict(self):
@@ -101097,330 +106311,79 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this InstancePrototypeInstanceByCatalogOffering object."""
+ """Return a `str` version of this EndpointGatewayTargetProviderCloudServiceReference object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstancePrototypeInstanceByCatalogOffering') -> bool:
+ def __eq__(self, other: 'EndpointGatewayTargetProviderCloudServiceReference') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'InstancePrototypeInstanceByCatalogOffering') -> bool:
+ def __ne__(self, other: 'EndpointGatewayTargetProviderCloudServiceReference') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
+ class ResourceTypeEnum(str, Enum):
+ """
+ The type of target.
+ """
-class InstancePrototypeInstanceByImage(InstancePrototype):
+ PROVIDER_CLOUD_SERVICE = 'provider_cloud_service'
+
+
+
+class EndpointGatewayTargetProviderInfrastructureServiceReference(EndpointGatewayTarget):
"""
- Create an instance by using an image.
+ The name of this provider infrastructure service.
- :attr InstanceAvailabilityPolicyPrototype availability_policy: (optional) The
- availability policy to use for this virtual server instance.
- :attr InstanceDefaultTrustedProfilePrototype default_trusted_profile: (optional)
- The default trusted profile configuration to use for this virtual server
- instance
- This property's value is used when provisioning the virtual server instance, but
- not subsequently managed. Accordingly, it is reflected as an [instance
- initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
- property.
- :attr List[KeyIdentity] keys: (optional) The public SSH keys for the
- administrative user of the virtual server instance. Keys will be made available
- to the virtual server instance as cloud-init vendor data. For cloud-init enabled
- images, these keys will also be added as SSH authorized keys for the
- administrative user.
- For Windows images, the keys of type `rsa` must be specified, and one will be
- selected to encrypt [the administrator
- password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys
- are optional for other images, but if no keys are specified, the instance will
- be inaccessible unless the specified image provides another means of access.
- This property's value is used when provisioning the virtual server instance, but
- not subsequently managed. Accordingly, it is reflected as an [instance
- initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
- property.
- :attr InstanceMetadataServicePrototype metadata_service: (optional)
- :attr str name: (optional) The name for this virtual server instance. The name
- must not be used by another virtual server instance in the region. If
- unspecified, the name will be a hyphenated list of randomly-selected words.
- The system hostname will be based on this name.
- :attr InstancePlacementTargetPrototype placement_target: (optional) The
- placement restrictions to use for the virtual server instance.
- :attr InstanceProfileIdentity profile: (optional) The
- [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this
- virtual server instance.
- If unspecified, `bx2-2x8` will be used, but this default value is expected to
- change in the future.
- :attr ResourceGroupIdentity resource_group: (optional)
- :attr int total_volume_bandwidth: (optional) The amount of bandwidth (in
- megabits per second) allocated exclusively to instance storage volumes. An
- increase in this value will result in a corresponding decrease to
- `total_network_bandwidth`.
- :attr str user_data: (optional) [User
- data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when
- setting up the virtual server instance.
- :attr List[VolumeAttachmentPrototype] volume_attachments: (optional) The
- additional volume attachments to create for the virtual server instance.
- :attr VPCIdentity vpc: (optional) The VPC this virtual server instance will
- reside in.
- If specified, it must match the VPC for the subnets of the instance network
- interfaces.
- :attr VolumeAttachmentPrototypeInstanceByImageContext boot_volume_attachment:
- (optional) The boot volume attachment to create for the virtual server instance.
- :attr ImageIdentity image: The image to use when provisioning the virtual server
- instance.
- :attr List[NetworkInterfacePrototype] network_interfaces: (optional) The
- additional instance network interfaces to create.
- :attr NetworkInterfacePrototype primary_network_interface: The primary instance
- network interface to create.
- :attr ZoneIdentity zone: The zone this virtual server instance will reside in.
+ :param str name: The name of a provider infrastructure service. Must be:
+ - `ibm-ntp-server`: An NTP (Network Time Protocol) server provided by IBM.
+ :param str resource_type: The type of target.
"""
def __init__(
self,
- image: 'ImageIdentity',
- primary_network_interface: 'NetworkInterfacePrototype',
- zone: 'ZoneIdentity',
- *,
- availability_policy: 'InstanceAvailabilityPolicyPrototype' = None,
- default_trusted_profile: 'InstanceDefaultTrustedProfilePrototype' = None,
- keys: List['KeyIdentity'] = None,
- metadata_service: 'InstanceMetadataServicePrototype' = None,
- name: str = None,
- placement_target: 'InstancePlacementTargetPrototype' = None,
- profile: 'InstanceProfileIdentity' = None,
- resource_group: 'ResourceGroupIdentity' = None,
- total_volume_bandwidth: int = None,
- user_data: str = None,
- volume_attachments: List['VolumeAttachmentPrototype'] = None,
- vpc: 'VPCIdentity' = None,
- boot_volume_attachment: 'VolumeAttachmentPrototypeInstanceByImageContext' = None,
- network_interfaces: List['NetworkInterfacePrototype'] = None,
+ name: str,
+ resource_type: str,
) -> None:
"""
- Initialize a InstancePrototypeInstanceByImage object.
+ Initialize a EndpointGatewayTargetProviderInfrastructureServiceReference object.
- :param ImageIdentity image: The image to use when provisioning the virtual
- server instance.
- :param NetworkInterfacePrototype primary_network_interface: The primary
- instance network interface to create.
- :param ZoneIdentity zone: The zone this virtual server instance will reside
- in.
- :param InstanceAvailabilityPolicyPrototype availability_policy: (optional)
- The availability policy to use for this virtual server instance.
- :param InstanceDefaultTrustedProfilePrototype default_trusted_profile:
- (optional) The default trusted profile configuration to use for this
- virtual server instance
- This property's value is used when provisioning the virtual server
- instance, but not subsequently managed. Accordingly, it is reflected as an
- [instance
- initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
- property.
- :param List[KeyIdentity] keys: (optional) The public SSH keys for the
- administrative user of the virtual server instance. Keys will be made
- available to the virtual server instance as cloud-init vendor data. For
- cloud-init enabled images, these keys will also be added as SSH authorized
- keys for the administrative user.
- For Windows images, the keys of type `rsa` must be specified, and one will
- be selected to encrypt [the administrator
- password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization).
- Keys are optional for other images, but if no keys are specified, the
- instance will be inaccessible unless the specified image provides another
- means of access.
- This property's value is used when provisioning the virtual server
- instance, but not subsequently managed. Accordingly, it is reflected as an
- [instance
- initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
- property.
- :param InstanceMetadataServicePrototype metadata_service: (optional)
- :param str name: (optional) The name for this virtual server instance. The
- name must not be used by another virtual server instance in the region. If
- unspecified, the name will be a hyphenated list of randomly-selected words.
- The system hostname will be based on this name.
- :param InstancePlacementTargetPrototype placement_target: (optional) The
- placement restrictions to use for the virtual server instance.
- :param InstanceProfileIdentity profile: (optional) The
- [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for
- this virtual server instance.
- If unspecified, `bx2-2x8` will be used, but this default value is expected
- to change in the future.
- :param ResourceGroupIdentity resource_group: (optional)
- :param int total_volume_bandwidth: (optional) The amount of bandwidth (in
- megabits per second) allocated exclusively to instance storage volumes. An
- increase in this value will result in a corresponding decrease to
- `total_network_bandwidth`.
- :param str user_data: (optional) [User
- data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available
- when setting up the virtual server instance.
- :param List[VolumeAttachmentPrototype] volume_attachments: (optional) The
- additional volume attachments to create for the virtual server instance.
- :param VPCIdentity vpc: (optional) The VPC this virtual server instance
- will reside in.
- If specified, it must match the VPC for the subnets of the instance network
- interfaces.
- :param VolumeAttachmentPrototypeInstanceByImageContext
- boot_volume_attachment: (optional) The boot volume attachment to create for
- the virtual server instance.
- :param List[NetworkInterfacePrototype] network_interfaces: (optional) The
- additional instance network interfaces to create.
+ :param str name: The name of a provider infrastructure service. Must be:
+ - `ibm-ntp-server`: An NTP (Network Time Protocol) server provided by IBM.
+ :param str resource_type: The type of target.
"""
# pylint: disable=super-init-not-called
- self.availability_policy = availability_policy
- self.default_trusted_profile = default_trusted_profile
- self.keys = keys
- self.metadata_service = metadata_service
self.name = name
- self.placement_target = placement_target
- self.profile = profile
- self.resource_group = resource_group
- self.total_volume_bandwidth = total_volume_bandwidth
- self.user_data = user_data
- self.volume_attachments = volume_attachments
- self.vpc = vpc
- self.boot_volume_attachment = boot_volume_attachment
- self.image = image
- self.network_interfaces = network_interfaces
- self.primary_network_interface = primary_network_interface
- self.zone = zone
+ self.resource_type = resource_type
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstancePrototypeInstanceByImage':
- """Initialize a InstancePrototypeInstanceByImage object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'EndpointGatewayTargetProviderInfrastructureServiceReference':
+ """Initialize a EndpointGatewayTargetProviderInfrastructureServiceReference object from a json dictionary."""
args = {}
- if 'availability_policy' in _dict:
- args['availability_policy'] = InstanceAvailabilityPolicyPrototype.from_dict(_dict.get('availability_policy'))
- if 'default_trusted_profile' in _dict:
- args['default_trusted_profile'] = InstanceDefaultTrustedProfilePrototype.from_dict(_dict.get('default_trusted_profile'))
- if 'keys' in _dict:
- args['keys'] = _dict.get('keys')
- if 'metadata_service' in _dict:
- args['metadata_service'] = InstanceMetadataServicePrototype.from_dict(_dict.get('metadata_service'))
- if 'name' in _dict:
- args['name'] = _dict.get('name')
- if 'placement_target' in _dict:
- args['placement_target'] = _dict.get('placement_target')
- if 'profile' in _dict:
- args['profile'] = _dict.get('profile')
- if 'resource_group' in _dict:
- args['resource_group'] = _dict.get('resource_group')
- if 'total_volume_bandwidth' in _dict:
- args['total_volume_bandwidth'] = _dict.get('total_volume_bandwidth')
- if 'user_data' in _dict:
- args['user_data'] = _dict.get('user_data')
- if 'volume_attachments' in _dict:
- args['volume_attachments'] = [VolumeAttachmentPrototype.from_dict(v) for v in _dict.get('volume_attachments')]
- if 'vpc' in _dict:
- args['vpc'] = _dict.get('vpc')
- if 'boot_volume_attachment' in _dict:
- args['boot_volume_attachment'] = VolumeAttachmentPrototypeInstanceByImageContext.from_dict(_dict.get('boot_volume_attachment'))
- if 'image' in _dict:
- args['image'] = _dict.get('image')
- else:
- raise ValueError('Required property \'image\' not present in InstancePrototypeInstanceByImage JSON')
- if 'network_interfaces' in _dict:
- args['network_interfaces'] = [NetworkInterfacePrototype.from_dict(v) for v in _dict.get('network_interfaces')]
- if 'primary_network_interface' in _dict:
- args['primary_network_interface'] = NetworkInterfacePrototype.from_dict(_dict.get('primary_network_interface'))
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
else:
- raise ValueError('Required property \'primary_network_interface\' not present in InstancePrototypeInstanceByImage JSON')
- if 'zone' in _dict:
- args['zone'] = _dict.get('zone')
+ raise ValueError('Required property \'name\' not present in EndpointGatewayTargetProviderInfrastructureServiceReference JSON')
+ if (resource_type := _dict.get('resource_type')) is not None:
+ args['resource_type'] = resource_type
else:
- raise ValueError('Required property \'zone\' not present in InstancePrototypeInstanceByImage JSON')
+ raise ValueError('Required property \'resource_type\' not present in EndpointGatewayTargetProviderInfrastructureServiceReference JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstancePrototypeInstanceByImage object from a json dictionary."""
+ """Initialize a EndpointGatewayTargetProviderInfrastructureServiceReference object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'availability_policy') and self.availability_policy is not None:
- if isinstance(self.availability_policy, dict):
- _dict['availability_policy'] = self.availability_policy
- else:
- _dict['availability_policy'] = self.availability_policy.to_dict()
- if hasattr(self, 'default_trusted_profile') and self.default_trusted_profile is not None:
- if isinstance(self.default_trusted_profile, dict):
- _dict['default_trusted_profile'] = self.default_trusted_profile
- else:
- _dict['default_trusted_profile'] = self.default_trusted_profile.to_dict()
- if hasattr(self, 'keys') and self.keys is not None:
- keys_list = []
- for v in self.keys:
- if isinstance(v, dict):
- keys_list.append(v)
- else:
- keys_list.append(v.to_dict())
- _dict['keys'] = keys_list
- if hasattr(self, 'metadata_service') and self.metadata_service is not None:
- if isinstance(self.metadata_service, dict):
- _dict['metadata_service'] = self.metadata_service
- else:
- _dict['metadata_service'] = self.metadata_service.to_dict()
if hasattr(self, 'name') and self.name is not None:
_dict['name'] = self.name
- if hasattr(self, 'placement_target') and self.placement_target is not None:
- if isinstance(self.placement_target, dict):
- _dict['placement_target'] = self.placement_target
- else:
- _dict['placement_target'] = self.placement_target.to_dict()
- if hasattr(self, 'profile') and self.profile is not None:
- if isinstance(self.profile, dict):
- _dict['profile'] = self.profile
- else:
- _dict['profile'] = self.profile.to_dict()
- if hasattr(self, 'resource_group') and self.resource_group is not None:
- if isinstance(self.resource_group, dict):
- _dict['resource_group'] = self.resource_group
- else:
- _dict['resource_group'] = self.resource_group.to_dict()
- if hasattr(self, 'total_volume_bandwidth') and self.total_volume_bandwidth is not None:
- _dict['total_volume_bandwidth'] = self.total_volume_bandwidth
- if hasattr(self, 'user_data') and self.user_data is not None:
- _dict['user_data'] = self.user_data
- if hasattr(self, 'volume_attachments') and self.volume_attachments is not None:
- volume_attachments_list = []
- for v in self.volume_attachments:
- if isinstance(v, dict):
- volume_attachments_list.append(v)
- else:
- volume_attachments_list.append(v.to_dict())
- _dict['volume_attachments'] = volume_attachments_list
- if hasattr(self, 'vpc') and self.vpc is not None:
- if isinstance(self.vpc, dict):
- _dict['vpc'] = self.vpc
- else:
- _dict['vpc'] = self.vpc.to_dict()
- if hasattr(self, 'boot_volume_attachment') and self.boot_volume_attachment is not None:
- if isinstance(self.boot_volume_attachment, dict):
- _dict['boot_volume_attachment'] = self.boot_volume_attachment
- else:
- _dict['boot_volume_attachment'] = self.boot_volume_attachment.to_dict()
- if hasattr(self, 'image') and self.image is not None:
- if isinstance(self.image, dict):
- _dict['image'] = self.image
- else:
- _dict['image'] = self.image.to_dict()
- if hasattr(self, 'network_interfaces') and self.network_interfaces is not None:
- network_interfaces_list = []
- for v in self.network_interfaces:
- if isinstance(v, dict):
- network_interfaces_list.append(v)
- else:
- network_interfaces_list.append(v.to_dict())
- _dict['network_interfaces'] = network_interfaces_list
- if hasattr(self, 'primary_network_interface') and self.primary_network_interface is not None:
- if isinstance(self.primary_network_interface, dict):
- _dict['primary_network_interface'] = self.primary_network_interface
- else:
- _dict['primary_network_interface'] = self.primary_network_interface.to_dict()
- if hasattr(self, 'zone') and self.zone is not None:
- if isinstance(self.zone, dict):
- _dict['zone'] = self.zone
- else:
- _dict['zone'] = self.zone.to_dict()
+ if hasattr(self, 'resource_type') and self.resource_type is not None:
+ _dict['resource_type'] = self.resource_type
return _dict
def _to_dict(self):
@@ -101428,318 +106391,111 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this InstancePrototypeInstanceByImage object."""
+ """Return a `str` version of this EndpointGatewayTargetProviderInfrastructureServiceReference object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstancePrototypeInstanceByImage') -> bool:
+ def __eq__(self, other: 'EndpointGatewayTargetProviderInfrastructureServiceReference') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'InstancePrototypeInstanceByImage') -> bool:
+ def __ne__(self, other: 'EndpointGatewayTargetProviderInfrastructureServiceReference') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
+ class ResourceTypeEnum(str, Enum):
+ """
+ The type of target.
+ """
+
+ PROVIDER_INFRASTRUCTURE_SERVICE = 'provider_infrastructure_service'
-class InstancePrototypeInstanceBySourceSnapshot(InstancePrototype):
+
+
+class FloatingIPPrototypeFloatingIPByTarget(FloatingIPPrototype):
"""
- Create an instance by using a snapshot.
+ FloatingIPPrototypeFloatingIPByTarget.
- :attr InstanceAvailabilityPolicyPrototype availability_policy: (optional) The
- availability policy to use for this virtual server instance.
- :attr InstanceDefaultTrustedProfilePrototype default_trusted_profile: (optional)
- The default trusted profile configuration to use for this virtual server
- instance
- This property's value is used when provisioning the virtual server instance, but
- not subsequently managed. Accordingly, it is reflected as an [instance
- initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
- property.
- :attr List[KeyIdentity] keys: (optional) The public SSH keys for the
- administrative user of the virtual server instance. Keys will be made available
- to the virtual server instance as cloud-init vendor data. For cloud-init enabled
- images, these keys will also be added as SSH authorized keys for the
- administrative user.
- For Windows images, the keys of type `rsa` must be specified, and one will be
- selected to encrypt [the administrator
- password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys
- are optional for other images, but if no keys are specified, the instance will
- be inaccessible unless the specified image provides another means of access.
- This property's value is used when provisioning the virtual server instance, but
- not subsequently managed. Accordingly, it is reflected as an [instance
- initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
- property.
- :attr InstanceMetadataServicePrototype metadata_service: (optional)
- :attr str name: (optional) The name for this virtual server instance. The name
- must not be used by another virtual server instance in the region. If
- unspecified, the name will be a hyphenated list of randomly-selected words.
- The system hostname will be based on this name.
- :attr InstancePlacementTargetPrototype placement_target: (optional) The
- placement restrictions to use for the virtual server instance.
- :attr InstanceProfileIdentity profile: (optional) The
- [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this
- virtual server instance.
- If unspecified, `bx2-2x8` will be used, but this default value is expected to
- change in the future.
- :attr ResourceGroupIdentity resource_group: (optional)
- :attr int total_volume_bandwidth: (optional) The amount of bandwidth (in
- megabits per second) allocated exclusively to instance storage volumes. An
- increase in this value will result in a corresponding decrease to
- `total_network_bandwidth`.
- :attr str user_data: (optional) [User
- data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when
- setting up the virtual server instance.
- :attr List[VolumeAttachmentPrototype] volume_attachments: (optional) The
- additional volume attachments to create for the virtual server instance.
- :attr VPCIdentity vpc: (optional) The VPC this virtual server instance will
- reside in.
- If specified, it must match the VPC for the subnets of the instance network
- interfaces.
- :attr VolumeAttachmentPrototypeInstanceBySourceSnapshotContext
- boot_volume_attachment: The boot volume attachment to create for the virtual
- server instance.
- :attr List[NetworkInterfacePrototype] network_interfaces: (optional) The
- additional instance network interfaces to create.
- :attr NetworkInterfacePrototype primary_network_interface: The primary instance
- network interface to create.
- :attr ZoneIdentity zone: The zone this virtual server instance will reside in.
+ :param str name: (optional) The name for this floating IP. The name must not be
+ used by another floating IP in the region. If unspecified, the name will be a
+ hyphenated list of randomly-selected words.
+ :param ResourceGroupIdentity resource_group: (optional)
+ :param FloatingIPTargetPrototype target: The target resource to bind this
+ floating IP to.
+ The target resource must not already have a floating IP bound to it if the
+ target
+ resource is:
+ - an instance network interface
+ - a bare metal server network interface with `enable_infrastructure_nat` set to
+ `true`
+ - a virtual network interface with `enable_infrastructure_nat` set to `true`.
"""
def __init__(
self,
- boot_volume_attachment: 'VolumeAttachmentPrototypeInstanceBySourceSnapshotContext',
- primary_network_interface: 'NetworkInterfacePrototype',
- zone: 'ZoneIdentity',
+ target: 'FloatingIPTargetPrototype',
*,
- availability_policy: 'InstanceAvailabilityPolicyPrototype' = None,
- default_trusted_profile: 'InstanceDefaultTrustedProfilePrototype' = None,
- keys: List['KeyIdentity'] = None,
- metadata_service: 'InstanceMetadataServicePrototype' = None,
- name: str = None,
- placement_target: 'InstancePlacementTargetPrototype' = None,
- profile: 'InstanceProfileIdentity' = None,
- resource_group: 'ResourceGroupIdentity' = None,
- total_volume_bandwidth: int = None,
- user_data: str = None,
- volume_attachments: List['VolumeAttachmentPrototype'] = None,
- vpc: 'VPCIdentity' = None,
- network_interfaces: List['NetworkInterfacePrototype'] = None,
+ name: Optional[str] = None,
+ resource_group: Optional['ResourceGroupIdentity'] = None,
) -> None:
"""
- Initialize a InstancePrototypeInstanceBySourceSnapshot object.
+ Initialize a FloatingIPPrototypeFloatingIPByTarget object.
- :param VolumeAttachmentPrototypeInstanceBySourceSnapshotContext
- boot_volume_attachment: The boot volume attachment to create for the
- virtual server instance.
- :param NetworkInterfacePrototype primary_network_interface: The primary
- instance network interface to create.
- :param ZoneIdentity zone: The zone this virtual server instance will reside
- in.
- :param InstanceAvailabilityPolicyPrototype availability_policy: (optional)
- The availability policy to use for this virtual server instance.
- :param InstanceDefaultTrustedProfilePrototype default_trusted_profile:
- (optional) The default trusted profile configuration to use for this
- virtual server instance
- This property's value is used when provisioning the virtual server
- instance, but not subsequently managed. Accordingly, it is reflected as an
- [instance
- initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
- property.
- :param List[KeyIdentity] keys: (optional) The public SSH keys for the
- administrative user of the virtual server instance. Keys will be made
- available to the virtual server instance as cloud-init vendor data. For
- cloud-init enabled images, these keys will also be added as SSH authorized
- keys for the administrative user.
- For Windows images, the keys of type `rsa` must be specified, and one will
- be selected to encrypt [the administrator
- password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization).
- Keys are optional for other images, but if no keys are specified, the
- instance will be inaccessible unless the specified image provides another
- means of access.
- This property's value is used when provisioning the virtual server
- instance, but not subsequently managed. Accordingly, it is reflected as an
- [instance
- initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
- property.
- :param InstanceMetadataServicePrototype metadata_service: (optional)
- :param str name: (optional) The name for this virtual server instance. The
- name must not be used by another virtual server instance in the region. If
- unspecified, the name will be a hyphenated list of randomly-selected words.
- The system hostname will be based on this name.
- :param InstancePlacementTargetPrototype placement_target: (optional) The
- placement restrictions to use for the virtual server instance.
- :param InstanceProfileIdentity profile: (optional) The
- [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for
- this virtual server instance.
- If unspecified, `bx2-2x8` will be used, but this default value is expected
- to change in the future.
+ :param FloatingIPTargetPrototype target: The target resource to bind this
+ floating IP to.
+ The target resource must not already have a floating IP bound to it if the
+ target
+ resource is:
+ - an instance network interface
+ - a bare metal server network interface with `enable_infrastructure_nat`
+ set to `true`
+ - a virtual network interface with `enable_infrastructure_nat` set to
+ `true`.
+ :param str name: (optional) The name for this floating IP. The name must
+ not be used by another floating IP in the region. If unspecified, the name
+ will be a hyphenated list of randomly-selected words.
:param ResourceGroupIdentity resource_group: (optional)
- :param int total_volume_bandwidth: (optional) The amount of bandwidth (in
- megabits per second) allocated exclusively to instance storage volumes. An
- increase in this value will result in a corresponding decrease to
- `total_network_bandwidth`.
- :param str user_data: (optional) [User
- data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available
- when setting up the virtual server instance.
- :param List[VolumeAttachmentPrototype] volume_attachments: (optional) The
- additional volume attachments to create for the virtual server instance.
- :param VPCIdentity vpc: (optional) The VPC this virtual server instance
- will reside in.
- If specified, it must match the VPC for the subnets of the instance network
- interfaces.
- :param List[NetworkInterfacePrototype] network_interfaces: (optional) The
- additional instance network interfaces to create.
"""
# pylint: disable=super-init-not-called
- self.availability_policy = availability_policy
- self.default_trusted_profile = default_trusted_profile
- self.keys = keys
- self.metadata_service = metadata_service
self.name = name
- self.placement_target = placement_target
- self.profile = profile
self.resource_group = resource_group
- self.total_volume_bandwidth = total_volume_bandwidth
- self.user_data = user_data
- self.volume_attachments = volume_attachments
- self.vpc = vpc
- self.boot_volume_attachment = boot_volume_attachment
- self.network_interfaces = network_interfaces
- self.primary_network_interface = primary_network_interface
- self.zone = zone
+ self.target = target
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstancePrototypeInstanceBySourceSnapshot':
- """Initialize a InstancePrototypeInstanceBySourceSnapshot object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'FloatingIPPrototypeFloatingIPByTarget':
+ """Initialize a FloatingIPPrototypeFloatingIPByTarget object from a json dictionary."""
args = {}
- if 'availability_policy' in _dict:
- args['availability_policy'] = InstanceAvailabilityPolicyPrototype.from_dict(_dict.get('availability_policy'))
- if 'default_trusted_profile' in _dict:
- args['default_trusted_profile'] = InstanceDefaultTrustedProfilePrototype.from_dict(_dict.get('default_trusted_profile'))
- if 'keys' in _dict:
- args['keys'] = _dict.get('keys')
- if 'metadata_service' in _dict:
- args['metadata_service'] = InstanceMetadataServicePrototype.from_dict(_dict.get('metadata_service'))
- if 'name' in _dict:
- args['name'] = _dict.get('name')
- if 'placement_target' in _dict:
- args['placement_target'] = _dict.get('placement_target')
- if 'profile' in _dict:
- args['profile'] = _dict.get('profile')
- if 'resource_group' in _dict:
- args['resource_group'] = _dict.get('resource_group')
- if 'total_volume_bandwidth' in _dict:
- args['total_volume_bandwidth'] = _dict.get('total_volume_bandwidth')
- if 'user_data' in _dict:
- args['user_data'] = _dict.get('user_data')
- if 'volume_attachments' in _dict:
- args['volume_attachments'] = [VolumeAttachmentPrototype.from_dict(v) for v in _dict.get('volume_attachments')]
- if 'vpc' in _dict:
- args['vpc'] = _dict.get('vpc')
- if 'boot_volume_attachment' in _dict:
- args['boot_volume_attachment'] = VolumeAttachmentPrototypeInstanceBySourceSnapshotContext.from_dict(_dict.get('boot_volume_attachment'))
- else:
- raise ValueError('Required property \'boot_volume_attachment\' not present in InstancePrototypeInstanceBySourceSnapshot JSON')
- if 'network_interfaces' in _dict:
- args['network_interfaces'] = [NetworkInterfacePrototype.from_dict(v) for v in _dict.get('network_interfaces')]
- if 'primary_network_interface' in _dict:
- args['primary_network_interface'] = NetworkInterfacePrototype.from_dict(_dict.get('primary_network_interface'))
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ if (resource_group := _dict.get('resource_group')) is not None:
+ args['resource_group'] = resource_group
+ if (target := _dict.get('target')) is not None:
+ args['target'] = target
else:
- raise ValueError('Required property \'primary_network_interface\' not present in InstancePrototypeInstanceBySourceSnapshot JSON')
- if 'zone' in _dict:
- args['zone'] = _dict.get('zone')
- else:
- raise ValueError('Required property \'zone\' not present in InstancePrototypeInstanceBySourceSnapshot JSON')
+ raise ValueError('Required property \'target\' not present in FloatingIPPrototypeFloatingIPByTarget JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstancePrototypeInstanceBySourceSnapshot object from a json dictionary."""
+ """Initialize a FloatingIPPrototypeFloatingIPByTarget object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'availability_policy') and self.availability_policy is not None:
- if isinstance(self.availability_policy, dict):
- _dict['availability_policy'] = self.availability_policy
- else:
- _dict['availability_policy'] = self.availability_policy.to_dict()
- if hasattr(self, 'default_trusted_profile') and self.default_trusted_profile is not None:
- if isinstance(self.default_trusted_profile, dict):
- _dict['default_trusted_profile'] = self.default_trusted_profile
- else:
- _dict['default_trusted_profile'] = self.default_trusted_profile.to_dict()
- if hasattr(self, 'keys') and self.keys is not None:
- keys_list = []
- for v in self.keys:
- if isinstance(v, dict):
- keys_list.append(v)
- else:
- keys_list.append(v.to_dict())
- _dict['keys'] = keys_list
- if hasattr(self, 'metadata_service') and self.metadata_service is not None:
- if isinstance(self.metadata_service, dict):
- _dict['metadata_service'] = self.metadata_service
- else:
- _dict['metadata_service'] = self.metadata_service.to_dict()
if hasattr(self, 'name') and self.name is not None:
_dict['name'] = self.name
- if hasattr(self, 'placement_target') and self.placement_target is not None:
- if isinstance(self.placement_target, dict):
- _dict['placement_target'] = self.placement_target
- else:
- _dict['placement_target'] = self.placement_target.to_dict()
- if hasattr(self, 'profile') and self.profile is not None:
- if isinstance(self.profile, dict):
- _dict['profile'] = self.profile
- else:
- _dict['profile'] = self.profile.to_dict()
if hasattr(self, 'resource_group') and self.resource_group is not None:
if isinstance(self.resource_group, dict):
_dict['resource_group'] = self.resource_group
else:
_dict['resource_group'] = self.resource_group.to_dict()
- if hasattr(self, 'total_volume_bandwidth') and self.total_volume_bandwidth is not None:
- _dict['total_volume_bandwidth'] = self.total_volume_bandwidth
- if hasattr(self, 'user_data') and self.user_data is not None:
- _dict['user_data'] = self.user_data
- if hasattr(self, 'volume_attachments') and self.volume_attachments is not None:
- volume_attachments_list = []
- for v in self.volume_attachments:
- if isinstance(v, dict):
- volume_attachments_list.append(v)
- else:
- volume_attachments_list.append(v.to_dict())
- _dict['volume_attachments'] = volume_attachments_list
- if hasattr(self, 'vpc') and self.vpc is not None:
- if isinstance(self.vpc, dict):
- _dict['vpc'] = self.vpc
- else:
- _dict['vpc'] = self.vpc.to_dict()
- if hasattr(self, 'boot_volume_attachment') and self.boot_volume_attachment is not None:
- if isinstance(self.boot_volume_attachment, dict):
- _dict['boot_volume_attachment'] = self.boot_volume_attachment
- else:
- _dict['boot_volume_attachment'] = self.boot_volume_attachment.to_dict()
- if hasattr(self, 'network_interfaces') and self.network_interfaces is not None:
- network_interfaces_list = []
- for v in self.network_interfaces:
- if isinstance(v, dict):
- network_interfaces_list.append(v)
- else:
- network_interfaces_list.append(v.to_dict())
- _dict['network_interfaces'] = network_interfaces_list
- if hasattr(self, 'primary_network_interface') and self.primary_network_interface is not None:
- if isinstance(self.primary_network_interface, dict):
- _dict['primary_network_interface'] = self.primary_network_interface
- else:
- _dict['primary_network_interface'] = self.primary_network_interface.to_dict()
- if hasattr(self, 'zone') and self.zone is not None:
- if isinstance(self.zone, dict):
- _dict['zone'] = self.zone
+ if hasattr(self, 'target') and self.target is not None:
+ if isinstance(self.target, dict):
+ _dict['target'] = self.target
else:
- _dict['zone'] = self.zone.to_dict()
+ _dict['target'] = self.target.to_dict()
return _dict
def _to_dict(self):
@@ -101747,366 +106503,81 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this InstancePrototypeInstanceBySourceSnapshot object."""
+ """Return a `str` version of this FloatingIPPrototypeFloatingIPByTarget object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstancePrototypeInstanceBySourceSnapshot') -> bool:
+ def __eq__(self, other: 'FloatingIPPrototypeFloatingIPByTarget') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'InstancePrototypeInstanceBySourceSnapshot') -> bool:
+ def __ne__(self, other: 'FloatingIPPrototypeFloatingIPByTarget') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class InstancePrototypeInstanceBySourceTemplate(InstancePrototype):
+class FloatingIPPrototypeFloatingIPByZone(FloatingIPPrototype):
"""
- Create an instance by using an instance template.
- The `primary_network_interface` and `network_interfaces` properties may only be
- specified if `primary_network_interface` is specified in the source template.
+ FloatingIPPrototypeFloatingIPByZone.
- :attr InstanceAvailabilityPolicyPrototype availability_policy: (optional) The
- availability policy to use for this virtual server instance.
- :attr InstanceDefaultTrustedProfilePrototype default_trusted_profile: (optional)
- The default trusted profile configuration to use for this virtual server
- instance
- This property's value is used when provisioning the virtual server instance, but
- not subsequently managed. Accordingly, it is reflected as an [instance
- initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
- property.
- :attr List[KeyIdentity] keys: (optional) The public SSH keys for the
- administrative user of the virtual server instance. Keys will be made available
- to the virtual server instance as cloud-init vendor data. For cloud-init enabled
- images, these keys will also be added as SSH authorized keys for the
- administrative user.
- For Windows images, the keys of type `rsa` must be specified, and one will be
- selected to encrypt [the administrator
- password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys
- are optional for other images, but if no keys are specified, the instance will
- be inaccessible unless the specified image provides another means of access.
- This property's value is used when provisioning the virtual server instance, but
- not subsequently managed. Accordingly, it is reflected as an [instance
- initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
- property.
- :attr InstanceMetadataServicePrototype metadata_service: (optional)
- :attr str name: (optional) The name for this virtual server instance. The name
- must not be used by another virtual server instance in the region. If
- unspecified, the name will be a hyphenated list of randomly-selected words.
- The system hostname will be based on this name.
- :attr InstancePlacementTargetPrototype placement_target: (optional) The
- placement restrictions to use for the virtual server instance.
- :attr InstanceProfileIdentity profile: (optional) The
- [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this
- virtual server instance.
- If unspecified, `bx2-2x8` will be used, but this default value is expected to
- change in the future.
- :attr ResourceGroupIdentity resource_group: (optional)
- :attr int total_volume_bandwidth: (optional) The amount of bandwidth (in
- megabits per second) allocated exclusively to instance storage volumes. An
- increase in this value will result in a corresponding decrease to
- `total_network_bandwidth`.
- :attr str user_data: (optional) [User
- data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when
- setting up the virtual server instance.
- :attr List[VolumeAttachmentPrototype] volume_attachments: (optional) The
- additional volume attachments to create for the virtual server instance.
- :attr VPCIdentity vpc: (optional) The VPC this virtual server instance will
- reside in.
- If specified, it must match the VPC for the subnets of the instance network
- interfaces.
- :attr VolumeAttachmentPrototypeInstanceByImageContext boot_volume_attachment:
- (optional) The boot volume attachment to create for the virtual server instance.
- :attr InstanceCatalogOfferingPrototype catalog_offering: (optional) The
- [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user)
- offering version to use when provisioning this virtual server instance.
- If an offering is specified, the latest version of that offering will be used.
- The specified offering or offering version may be in a different account,
- subject to
- IAM policies.
- If specified, `image` must not be specified, and `source_template` must not have
- `image` specified.
- :attr ImageIdentity image: (optional) The image to use when provisioning the
- virtual server instance.
- :attr List[NetworkInterfacePrototype] network_interfaces: (optional) The
- additional instance network interfaces to create.
- :attr NetworkInterfacePrototype primary_network_interface: (optional) The
- primary instance network interface to create.
- :attr InstanceTemplateIdentity source_template: The template to create this
- virtual server instance from.
- :attr ZoneIdentity zone: (optional) The zone this virtual server instance will
- reside in.
+ :param str name: (optional) The name for this floating IP. The name must not be
+ used by another floating IP in the region. If unspecified, the name will be a
+ hyphenated list of randomly-selected words.
+ :param ResourceGroupIdentity resource_group: (optional)
+ :param ZoneIdentity zone: The zone this floating IP will reside in.
"""
def __init__(
self,
- source_template: 'InstanceTemplateIdentity',
+ zone: 'ZoneIdentity',
*,
- availability_policy: 'InstanceAvailabilityPolicyPrototype' = None,
- default_trusted_profile: 'InstanceDefaultTrustedProfilePrototype' = None,
- keys: List['KeyIdentity'] = None,
- metadata_service: 'InstanceMetadataServicePrototype' = None,
- name: str = None,
- placement_target: 'InstancePlacementTargetPrototype' = None,
- profile: 'InstanceProfileIdentity' = None,
- resource_group: 'ResourceGroupIdentity' = None,
- total_volume_bandwidth: int = None,
- user_data: str = None,
- volume_attachments: List['VolumeAttachmentPrototype'] = None,
- vpc: 'VPCIdentity' = None,
- boot_volume_attachment: 'VolumeAttachmentPrototypeInstanceByImageContext' = None,
- catalog_offering: 'InstanceCatalogOfferingPrototype' = None,
- image: 'ImageIdentity' = None,
- network_interfaces: List['NetworkInterfacePrototype'] = None,
- primary_network_interface: 'NetworkInterfacePrototype' = None,
- zone: 'ZoneIdentity' = None,
+ name: Optional[str] = None,
+ resource_group: Optional['ResourceGroupIdentity'] = None,
) -> None:
"""
- Initialize a InstancePrototypeInstanceBySourceTemplate object.
+ Initialize a FloatingIPPrototypeFloatingIPByZone object.
- :param InstanceTemplateIdentity source_template: The template to create
- this virtual server instance from.
- :param InstanceAvailabilityPolicyPrototype availability_policy: (optional)
- The availability policy to use for this virtual server instance.
- :param InstanceDefaultTrustedProfilePrototype default_trusted_profile:
- (optional) The default trusted profile configuration to use for this
- virtual server instance
- This property's value is used when provisioning the virtual server
- instance, but not subsequently managed. Accordingly, it is reflected as an
- [instance
- initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
- property.
- :param List[KeyIdentity] keys: (optional) The public SSH keys for the
- administrative user of the virtual server instance. Keys will be made
- available to the virtual server instance as cloud-init vendor data. For
- cloud-init enabled images, these keys will also be added as SSH authorized
- keys for the administrative user.
- For Windows images, the keys of type `rsa` must be specified, and one will
- be selected to encrypt [the administrator
- password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization).
- Keys are optional for other images, but if no keys are specified, the
- instance will be inaccessible unless the specified image provides another
- means of access.
- This property's value is used when provisioning the virtual server
- instance, but not subsequently managed. Accordingly, it is reflected as an
- [instance
- initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
- property.
- :param InstanceMetadataServicePrototype metadata_service: (optional)
- :param str name: (optional) The name for this virtual server instance. The
- name must not be used by another virtual server instance in the region. If
- unspecified, the name will be a hyphenated list of randomly-selected words.
- The system hostname will be based on this name.
- :param InstancePlacementTargetPrototype placement_target: (optional) The
- placement restrictions to use for the virtual server instance.
- :param InstanceProfileIdentity profile: (optional) The
- [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for
- this virtual server instance.
- If unspecified, `bx2-2x8` will be used, but this default value is expected
- to change in the future.
+ :param ZoneIdentity zone: The zone this floating IP will reside in.
+ :param str name: (optional) The name for this floating IP. The name must
+ not be used by another floating IP in the region. If unspecified, the name
+ will be a hyphenated list of randomly-selected words.
:param ResourceGroupIdentity resource_group: (optional)
- :param int total_volume_bandwidth: (optional) The amount of bandwidth (in
- megabits per second) allocated exclusively to instance storage volumes. An
- increase in this value will result in a corresponding decrease to
- `total_network_bandwidth`.
- :param str user_data: (optional) [User
- data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available
- when setting up the virtual server instance.
- :param List[VolumeAttachmentPrototype] volume_attachments: (optional) The
- additional volume attachments to create for the virtual server instance.
- :param VPCIdentity vpc: (optional) The VPC this virtual server instance
- will reside in.
- If specified, it must match the VPC for the subnets of the instance network
- interfaces.
- :param VolumeAttachmentPrototypeInstanceByImageContext
- boot_volume_attachment: (optional) The boot volume attachment to create for
- the virtual server instance.
- :param InstanceCatalogOfferingPrototype catalog_offering: (optional) The
- [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user)
- offering version to use when provisioning this virtual server instance.
- If an offering is specified, the latest version of that offering will be
- used.
- The specified offering or offering version may be in a different account,
- subject to
- IAM policies.
- If specified, `image` must not be specified, and `source_template` must not
- have
- `image` specified.
- :param ImageIdentity image: (optional) The image to use when provisioning
- the virtual server instance.
- :param List[NetworkInterfacePrototype] network_interfaces: (optional) The
- additional instance network interfaces to create.
- :param NetworkInterfacePrototype primary_network_interface: (optional) The
- primary instance network interface to create.
- :param ZoneIdentity zone: (optional) The zone this virtual server instance
- will reside in.
"""
# pylint: disable=super-init-not-called
- self.availability_policy = availability_policy
- self.default_trusted_profile = default_trusted_profile
- self.keys = keys
- self.metadata_service = metadata_service
self.name = name
- self.placement_target = placement_target
- self.profile = profile
self.resource_group = resource_group
- self.total_volume_bandwidth = total_volume_bandwidth
- self.user_data = user_data
- self.volume_attachments = volume_attachments
- self.vpc = vpc
- self.boot_volume_attachment = boot_volume_attachment
- self.catalog_offering = catalog_offering
- self.image = image
- self.network_interfaces = network_interfaces
- self.primary_network_interface = primary_network_interface
- self.source_template = source_template
self.zone = zone
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstancePrototypeInstanceBySourceTemplate':
- """Initialize a InstancePrototypeInstanceBySourceTemplate object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'FloatingIPPrototypeFloatingIPByZone':
+ """Initialize a FloatingIPPrototypeFloatingIPByZone object from a json dictionary."""
args = {}
- if 'availability_policy' in _dict:
- args['availability_policy'] = InstanceAvailabilityPolicyPrototype.from_dict(_dict.get('availability_policy'))
- if 'default_trusted_profile' in _dict:
- args['default_trusted_profile'] = InstanceDefaultTrustedProfilePrototype.from_dict(_dict.get('default_trusted_profile'))
- if 'keys' in _dict:
- args['keys'] = _dict.get('keys')
- if 'metadata_service' in _dict:
- args['metadata_service'] = InstanceMetadataServicePrototype.from_dict(_dict.get('metadata_service'))
- if 'name' in _dict:
- args['name'] = _dict.get('name')
- if 'placement_target' in _dict:
- args['placement_target'] = _dict.get('placement_target')
- if 'profile' in _dict:
- args['profile'] = _dict.get('profile')
- if 'resource_group' in _dict:
- args['resource_group'] = _dict.get('resource_group')
- if 'total_volume_bandwidth' in _dict:
- args['total_volume_bandwidth'] = _dict.get('total_volume_bandwidth')
- if 'user_data' in _dict:
- args['user_data'] = _dict.get('user_data')
- if 'volume_attachments' in _dict:
- args['volume_attachments'] = [VolumeAttachmentPrototype.from_dict(v) for v in _dict.get('volume_attachments')]
- if 'vpc' in _dict:
- args['vpc'] = _dict.get('vpc')
- if 'boot_volume_attachment' in _dict:
- args['boot_volume_attachment'] = VolumeAttachmentPrototypeInstanceByImageContext.from_dict(_dict.get('boot_volume_attachment'))
- if 'catalog_offering' in _dict:
- args['catalog_offering'] = _dict.get('catalog_offering')
- if 'image' in _dict:
- args['image'] = _dict.get('image')
- if 'network_interfaces' in _dict:
- args['network_interfaces'] = [NetworkInterfacePrototype.from_dict(v) for v in _dict.get('network_interfaces')]
- if 'primary_network_interface' in _dict:
- args['primary_network_interface'] = NetworkInterfacePrototype.from_dict(_dict.get('primary_network_interface'))
- if 'source_template' in _dict:
- args['source_template'] = _dict.get('source_template')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ if (resource_group := _dict.get('resource_group')) is not None:
+ args['resource_group'] = resource_group
+ if (zone := _dict.get('zone')) is not None:
+ args['zone'] = zone
else:
- raise ValueError('Required property \'source_template\' not present in InstancePrototypeInstanceBySourceTemplate JSON')
- if 'zone' in _dict:
- args['zone'] = _dict.get('zone')
+ raise ValueError('Required property \'zone\' not present in FloatingIPPrototypeFloatingIPByZone JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstancePrototypeInstanceBySourceTemplate object from a json dictionary."""
+ """Initialize a FloatingIPPrototypeFloatingIPByZone object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'availability_policy') and self.availability_policy is not None:
- if isinstance(self.availability_policy, dict):
- _dict['availability_policy'] = self.availability_policy
- else:
- _dict['availability_policy'] = self.availability_policy.to_dict()
- if hasattr(self, 'default_trusted_profile') and self.default_trusted_profile is not None:
- if isinstance(self.default_trusted_profile, dict):
- _dict['default_trusted_profile'] = self.default_trusted_profile
- else:
- _dict['default_trusted_profile'] = self.default_trusted_profile.to_dict()
- if hasattr(self, 'keys') and self.keys is not None:
- keys_list = []
- for v in self.keys:
- if isinstance(v, dict):
- keys_list.append(v)
- else:
- keys_list.append(v.to_dict())
- _dict['keys'] = keys_list
- if hasattr(self, 'metadata_service') and self.metadata_service is not None:
- if isinstance(self.metadata_service, dict):
- _dict['metadata_service'] = self.metadata_service
- else:
- _dict['metadata_service'] = self.metadata_service.to_dict()
if hasattr(self, 'name') and self.name is not None:
_dict['name'] = self.name
- if hasattr(self, 'placement_target') and self.placement_target is not None:
- if isinstance(self.placement_target, dict):
- _dict['placement_target'] = self.placement_target
- else:
- _dict['placement_target'] = self.placement_target.to_dict()
- if hasattr(self, 'profile') and self.profile is not None:
- if isinstance(self.profile, dict):
- _dict['profile'] = self.profile
- else:
- _dict['profile'] = self.profile.to_dict()
if hasattr(self, 'resource_group') and self.resource_group is not None:
if isinstance(self.resource_group, dict):
_dict['resource_group'] = self.resource_group
else:
_dict['resource_group'] = self.resource_group.to_dict()
- if hasattr(self, 'total_volume_bandwidth') and self.total_volume_bandwidth is not None:
- _dict['total_volume_bandwidth'] = self.total_volume_bandwidth
- if hasattr(self, 'user_data') and self.user_data is not None:
- _dict['user_data'] = self.user_data
- if hasattr(self, 'volume_attachments') and self.volume_attachments is not None:
- volume_attachments_list = []
- for v in self.volume_attachments:
- if isinstance(v, dict):
- volume_attachments_list.append(v)
- else:
- volume_attachments_list.append(v.to_dict())
- _dict['volume_attachments'] = volume_attachments_list
- if hasattr(self, 'vpc') and self.vpc is not None:
- if isinstance(self.vpc, dict):
- _dict['vpc'] = self.vpc
- else:
- _dict['vpc'] = self.vpc.to_dict()
- if hasattr(self, 'boot_volume_attachment') and self.boot_volume_attachment is not None:
- if isinstance(self.boot_volume_attachment, dict):
- _dict['boot_volume_attachment'] = self.boot_volume_attachment
- else:
- _dict['boot_volume_attachment'] = self.boot_volume_attachment.to_dict()
- if hasattr(self, 'catalog_offering') and self.catalog_offering is not None:
- if isinstance(self.catalog_offering, dict):
- _dict['catalog_offering'] = self.catalog_offering
- else:
- _dict['catalog_offering'] = self.catalog_offering.to_dict()
- if hasattr(self, 'image') and self.image is not None:
- if isinstance(self.image, dict):
- _dict['image'] = self.image
- else:
- _dict['image'] = self.image.to_dict()
- if hasattr(self, 'network_interfaces') and self.network_interfaces is not None:
- network_interfaces_list = []
- for v in self.network_interfaces:
- if isinstance(v, dict):
- network_interfaces_list.append(v)
- else:
- network_interfaces_list.append(v.to_dict())
- _dict['network_interfaces'] = network_interfaces_list
- if hasattr(self, 'primary_network_interface') and self.primary_network_interface is not None:
- if isinstance(self.primary_network_interface, dict):
- _dict['primary_network_interface'] = self.primary_network_interface
- else:
- _dict['primary_network_interface'] = self.primary_network_interface.to_dict()
- if hasattr(self, 'source_template') and self.source_template is not None:
- if isinstance(self.source_template, dict):
- _dict['source_template'] = self.source_template
- else:
- _dict['source_template'] = self.source_template.to_dict()
if hasattr(self, 'zone') and self.zone is not None:
if isinstance(self.zone, dict):
_dict['zone'] = self.zone
@@ -102119,377 +106590,263 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this InstancePrototypeInstanceBySourceTemplate object."""
+ """Return a `str` version of this FloatingIPPrototypeFloatingIPByZone object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstancePrototypeInstanceBySourceTemplate') -> bool:
+ def __eq__(self, other: 'FloatingIPPrototypeFloatingIPByZone') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'InstancePrototypeInstanceBySourceTemplate') -> bool:
+ def __ne__(self, other: 'FloatingIPPrototypeFloatingIPByZone') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class InstancePrototypeInstanceByVolume(InstancePrototype):
+class FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentity(FloatingIPTargetPatch):
"""
- Create an instance by using a boot volume.
+ Identifies a bare metal server network interface by a unique property.
- :attr InstanceAvailabilityPolicyPrototype availability_policy: (optional) The
- availability policy to use for this virtual server instance.
- :attr InstanceDefaultTrustedProfilePrototype default_trusted_profile: (optional)
- The default trusted profile configuration to use for this virtual server
- instance
- This property's value is used when provisioning the virtual server instance, but
- not subsequently managed. Accordingly, it is reflected as an [instance
- initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
- property.
- :attr List[KeyIdentity] keys: (optional) The public SSH keys for the
- administrative user of the virtual server instance. Keys will be made available
- to the virtual server instance as cloud-init vendor data. For cloud-init enabled
- images, these keys will also be added as SSH authorized keys for the
- administrative user.
- For Windows images, the keys of type `rsa` must be specified, and one will be
- selected to encrypt [the administrator
- password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys
- are optional for other images, but if no keys are specified, the instance will
- be inaccessible unless the specified image provides another means of access.
- This property's value is used when provisioning the virtual server instance, but
- not subsequently managed. Accordingly, it is reflected as an [instance
- initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
- property.
- :attr InstanceMetadataServicePrototype metadata_service: (optional)
- :attr str name: (optional) The name for this virtual server instance. The name
- must not be used by another virtual server instance in the region. If
- unspecified, the name will be a hyphenated list of randomly-selected words.
- The system hostname will be based on this name.
- :attr InstancePlacementTargetPrototype placement_target: (optional) The
- placement restrictions to use for the virtual server instance.
- :attr InstanceProfileIdentity profile: (optional) The
- [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this
- virtual server instance.
- If unspecified, `bx2-2x8` will be used, but this default value is expected to
- change in the future.
- :attr ResourceGroupIdentity resource_group: (optional)
- :attr int total_volume_bandwidth: (optional) The amount of bandwidth (in
- megabits per second) allocated exclusively to instance storage volumes. An
- increase in this value will result in a corresponding decrease to
- `total_network_bandwidth`.
- :attr str user_data: (optional) [User
- data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when
- setting up the virtual server instance.
- :attr List[VolumeAttachmentPrototype] volume_attachments: (optional) The
- additional volume attachments to create for the virtual server instance.
- :attr VPCIdentity vpc: (optional) The VPC this virtual server instance will
- reside in.
- If specified, it must match the VPC for the subnets of the instance network
- interfaces.
- :attr VolumeAttachmentPrototypeInstanceByVolumeContext boot_volume_attachment:
- The boot volume attachment for the virtual server instance.
- :attr List[NetworkInterfacePrototype] network_interfaces: (optional) The
- additional instance network interfaces to create.
- :attr NetworkInterfacePrototype primary_network_interface: The primary instance
- network interface to create.
- :attr ZoneIdentity zone: The zone this virtual server instance will reside in.
"""
def __init__(
self,
- boot_volume_attachment: 'VolumeAttachmentPrototypeInstanceByVolumeContext',
- primary_network_interface: 'NetworkInterfacePrototype',
- zone: 'ZoneIdentity',
- *,
- availability_policy: 'InstanceAvailabilityPolicyPrototype' = None,
- default_trusted_profile: 'InstanceDefaultTrustedProfilePrototype' = None,
- keys: List['KeyIdentity'] = None,
- metadata_service: 'InstanceMetadataServicePrototype' = None,
- name: str = None,
- placement_target: 'InstancePlacementTargetPrototype' = None,
- profile: 'InstanceProfileIdentity' = None,
- resource_group: 'ResourceGroupIdentity' = None,
- total_volume_bandwidth: int = None,
- user_data: str = None,
- volume_attachments: List['VolumeAttachmentPrototype'] = None,
- vpc: 'VPCIdentity' = None,
- network_interfaces: List['NetworkInterfacePrototype'] = None,
) -> None:
"""
- Initialize a InstancePrototypeInstanceByVolume object.
+ Initialize a FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentity object.
- :param VolumeAttachmentPrototypeInstanceByVolumeContext
- boot_volume_attachment: The boot volume attachment for the virtual server
- instance.
- :param NetworkInterfacePrototype primary_network_interface: The primary
- instance network interface to create.
- :param ZoneIdentity zone: The zone this virtual server instance will reside
- in.
- :param InstanceAvailabilityPolicyPrototype availability_policy: (optional)
- The availability policy to use for this virtual server instance.
- :param InstanceDefaultTrustedProfilePrototype default_trusted_profile:
- (optional) The default trusted profile configuration to use for this
- virtual server instance
- This property's value is used when provisioning the virtual server
- instance, but not subsequently managed. Accordingly, it is reflected as an
- [instance
- initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
- property.
- :param List[KeyIdentity] keys: (optional) The public SSH keys for the
- administrative user of the virtual server instance. Keys will be made
- available to the virtual server instance as cloud-init vendor data. For
- cloud-init enabled images, these keys will also be added as SSH authorized
- keys for the administrative user.
- For Windows images, the keys of type `rsa` must be specified, and one will
- be selected to encrypt [the administrator
- password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization).
- Keys are optional for other images, but if no keys are specified, the
- instance will be inaccessible unless the specified image provides another
- means of access.
- This property's value is used when provisioning the virtual server
- instance, but not subsequently managed. Accordingly, it is reflected as an
- [instance
- initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
- property.
- :param InstanceMetadataServicePrototype metadata_service: (optional)
- :param str name: (optional) The name for this virtual server instance. The
- name must not be used by another virtual server instance in the region. If
- unspecified, the name will be a hyphenated list of randomly-selected words.
- The system hostname will be based on this name.
- :param InstancePlacementTargetPrototype placement_target: (optional) The
- placement restrictions to use for the virtual server instance.
- :param InstanceProfileIdentity profile: (optional) The
- [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for
- this virtual server instance.
- If unspecified, `bx2-2x8` will be used, but this default value is expected
- to change in the future.
- :param ResourceGroupIdentity resource_group: (optional)
- :param int total_volume_bandwidth: (optional) The amount of bandwidth (in
- megabits per second) allocated exclusively to instance storage volumes. An
- increase in this value will result in a corresponding decrease to
- `total_network_bandwidth`.
- :param str user_data: (optional) [User
- data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available
- when setting up the virtual server instance.
- :param List[VolumeAttachmentPrototype] volume_attachments: (optional) The
- additional volume attachments to create for the virtual server instance.
- :param VPCIdentity vpc: (optional) The VPC this virtual server instance
- will reside in.
- If specified, it must match the VPC for the subnets of the instance network
- interfaces.
- :param List[NetworkInterfacePrototype] network_interfaces: (optional) The
- additional instance network interfaces to create.
"""
# pylint: disable=super-init-not-called
- self.availability_policy = availability_policy
- self.default_trusted_profile = default_trusted_profile
- self.keys = keys
- self.metadata_service = metadata_service
- self.name = name
- self.placement_target = placement_target
- self.profile = profile
- self.resource_group = resource_group
- self.total_volume_bandwidth = total_volume_bandwidth
- self.user_data = user_data
- self.volume_attachments = volume_attachments
- self.vpc = vpc
- self.boot_volume_attachment = boot_volume_attachment
- self.network_interfaces = network_interfaces
- self.primary_network_interface = primary_network_interface
- self.zone = zone
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityById', 'FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref'])
+ )
+ raise Exception(msg)
- @classmethod
- def from_dict(cls, _dict: Dict) -> 'InstancePrototypeInstanceByVolume':
- """Initialize a InstancePrototypeInstanceByVolume object from a json dictionary."""
- args = {}
- if 'availability_policy' in _dict:
- args['availability_policy'] = InstanceAvailabilityPolicyPrototype.from_dict(_dict.get('availability_policy'))
- if 'default_trusted_profile' in _dict:
- args['default_trusted_profile'] = InstanceDefaultTrustedProfilePrototype.from_dict(_dict.get('default_trusted_profile'))
- if 'keys' in _dict:
- args['keys'] = _dict.get('keys')
- if 'metadata_service' in _dict:
- args['metadata_service'] = InstanceMetadataServicePrototype.from_dict(_dict.get('metadata_service'))
- if 'name' in _dict:
- args['name'] = _dict.get('name')
- if 'placement_target' in _dict:
- args['placement_target'] = _dict.get('placement_target')
- if 'profile' in _dict:
- args['profile'] = _dict.get('profile')
- if 'resource_group' in _dict:
- args['resource_group'] = _dict.get('resource_group')
- if 'total_volume_bandwidth' in _dict:
- args['total_volume_bandwidth'] = _dict.get('total_volume_bandwidth')
- if 'user_data' in _dict:
- args['user_data'] = _dict.get('user_data')
- if 'volume_attachments' in _dict:
- args['volume_attachments'] = [VolumeAttachmentPrototype.from_dict(v) for v in _dict.get('volume_attachments')]
- if 'vpc' in _dict:
- args['vpc'] = _dict.get('vpc')
- if 'boot_volume_attachment' in _dict:
- args['boot_volume_attachment'] = VolumeAttachmentPrototypeInstanceByVolumeContext.from_dict(_dict.get('boot_volume_attachment'))
- else:
- raise ValueError('Required property \'boot_volume_attachment\' not present in InstancePrototypeInstanceByVolume JSON')
- if 'network_interfaces' in _dict:
- args['network_interfaces'] = [NetworkInterfacePrototype.from_dict(v) for v in _dict.get('network_interfaces')]
- if 'primary_network_interface' in _dict:
- args['primary_network_interface'] = NetworkInterfacePrototype.from_dict(_dict.get('primary_network_interface'))
- else:
- raise ValueError('Required property \'primary_network_interface\' not present in InstancePrototypeInstanceByVolume JSON')
- if 'zone' in _dict:
- args['zone'] = _dict.get('zone')
- else:
- raise ValueError('Required property \'zone\' not present in InstancePrototypeInstanceByVolume JSON')
- return cls(**args)
- @classmethod
- def _from_dict(cls, _dict):
- """Initialize a InstancePrototypeInstanceByVolume object from a json dictionary."""
- return cls.from_dict(_dict)
+class FloatingIPTargetPatchNetworkInterfaceIdentity(FloatingIPTargetPatch):
+ """
+ Identifies an instance network interface by a unique property.
- def to_dict(self) -> Dict:
- """Return a json dictionary representing this model."""
- _dict = {}
- if hasattr(self, 'availability_policy') and self.availability_policy is not None:
- if isinstance(self.availability_policy, dict):
- _dict['availability_policy'] = self.availability_policy
- else:
- _dict['availability_policy'] = self.availability_policy.to_dict()
- if hasattr(self, 'default_trusted_profile') and self.default_trusted_profile is not None:
- if isinstance(self.default_trusted_profile, dict):
- _dict['default_trusted_profile'] = self.default_trusted_profile
- else:
- _dict['default_trusted_profile'] = self.default_trusted_profile.to_dict()
- if hasattr(self, 'keys') and self.keys is not None:
- keys_list = []
- for v in self.keys:
- if isinstance(v, dict):
- keys_list.append(v)
- else:
- keys_list.append(v.to_dict())
- _dict['keys'] = keys_list
- if hasattr(self, 'metadata_service') and self.metadata_service is not None:
- if isinstance(self.metadata_service, dict):
- _dict['metadata_service'] = self.metadata_service
- else:
- _dict['metadata_service'] = self.metadata_service.to_dict()
- if hasattr(self, 'name') and self.name is not None:
- _dict['name'] = self.name
- if hasattr(self, 'placement_target') and self.placement_target is not None:
- if isinstance(self.placement_target, dict):
- _dict['placement_target'] = self.placement_target
- else:
- _dict['placement_target'] = self.placement_target.to_dict()
- if hasattr(self, 'profile') and self.profile is not None:
- if isinstance(self.profile, dict):
- _dict['profile'] = self.profile
- else:
- _dict['profile'] = self.profile.to_dict()
- if hasattr(self, 'resource_group') and self.resource_group is not None:
- if isinstance(self.resource_group, dict):
- _dict['resource_group'] = self.resource_group
- else:
- _dict['resource_group'] = self.resource_group.to_dict()
- if hasattr(self, 'total_volume_bandwidth') and self.total_volume_bandwidth is not None:
- _dict['total_volume_bandwidth'] = self.total_volume_bandwidth
- if hasattr(self, 'user_data') and self.user_data is not None:
- _dict['user_data'] = self.user_data
- if hasattr(self, 'volume_attachments') and self.volume_attachments is not None:
- volume_attachments_list = []
- for v in self.volume_attachments:
- if isinstance(v, dict):
- volume_attachments_list.append(v)
- else:
- volume_attachments_list.append(v.to_dict())
- _dict['volume_attachments'] = volume_attachments_list
- if hasattr(self, 'vpc') and self.vpc is not None:
- if isinstance(self.vpc, dict):
- _dict['vpc'] = self.vpc
- else:
- _dict['vpc'] = self.vpc.to_dict()
- if hasattr(self, 'boot_volume_attachment') and self.boot_volume_attachment is not None:
- if isinstance(self.boot_volume_attachment, dict):
- _dict['boot_volume_attachment'] = self.boot_volume_attachment
- else:
- _dict['boot_volume_attachment'] = self.boot_volume_attachment.to_dict()
- if hasattr(self, 'network_interfaces') and self.network_interfaces is not None:
- network_interfaces_list = []
- for v in self.network_interfaces:
- if isinstance(v, dict):
- network_interfaces_list.append(v)
- else:
- network_interfaces_list.append(v.to_dict())
- _dict['network_interfaces'] = network_interfaces_list
- if hasattr(self, 'primary_network_interface') and self.primary_network_interface is not None:
- if isinstance(self.primary_network_interface, dict):
- _dict['primary_network_interface'] = self.primary_network_interface
- else:
- _dict['primary_network_interface'] = self.primary_network_interface.to_dict()
- if hasattr(self, 'zone') and self.zone is not None:
- if isinstance(self.zone, dict):
- _dict['zone'] = self.zone
- else:
- _dict['zone'] = self.zone.to_dict()
- return _dict
+ """
- def _to_dict(self):
- """Return a json dictionary representing this model."""
- return self.to_dict()
+ def __init__(
+ self,
+ ) -> None:
+ """
+ Initialize a FloatingIPTargetPatchNetworkInterfaceIdentity object.
- def __str__(self) -> str:
- """Return a `str` version of this InstancePrototypeInstanceByVolume object."""
- return json.dumps(self.to_dict(), indent=2)
+ """
+ # pylint: disable=super-init-not-called
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityById', 'FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByHref'])
+ )
+ raise Exception(msg)
- def __eq__(self, other: 'InstancePrototypeInstanceByVolume') -> bool:
- """Return `true` when self and other are equal, false otherwise."""
- if not isinstance(other, self.__class__):
- return False
- return self.__dict__ == other.__dict__
- def __ne__(self, other: 'InstancePrototypeInstanceByVolume') -> bool:
- """Return `true` when self and other are not equal, false otherwise."""
- return not self == other
+class FloatingIPTargetPatchVirtualNetworkInterfaceIdentity(FloatingIPTargetPatch):
+ """
+ Identifies a virtual network interface by a unique property.
+ """
-class InstanceTemplateIdentityByCRN(InstanceTemplateIdentity):
+ def __init__(
+ self,
+ ) -> None:
+ """
+ Initialize a FloatingIPTargetPatchVirtualNetworkInterfaceIdentity object.
+
+ """
+ # pylint: disable=super-init-not-called
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['FloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById', 'FloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref', 'FloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN'])
+ )
+ raise Exception(msg)
+
+
+class FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentity(FloatingIPTargetPrototype):
"""
- InstanceTemplateIdentityByCRN.
+ Identifies a bare metal server network interface by a unique property.
- :attr str crn: The CRN for this instance template.
"""
def __init__(
self,
- crn: str,
) -> None:
"""
- Initialize a InstanceTemplateIdentityByCRN object.
+ Initialize a FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentity object.
- :param str crn: The CRN for this instance template.
"""
# pylint: disable=super-init-not-called
- self.crn = crn
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityById', 'FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref'])
+ )
+ raise Exception(msg)
+
+
+class FloatingIPTargetPrototypeNetworkInterfaceIdentity(FloatingIPTargetPrototype):
+ """
+ Identifies an instance network interface by a unique property.
+
+ """
+
+ def __init__(
+ self,
+ ) -> None:
+ """
+ Initialize a FloatingIPTargetPrototypeNetworkInterfaceIdentity object.
+
+ """
+ # pylint: disable=super-init-not-called
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityById', 'FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref'])
+ )
+ raise Exception(msg)
+
+
+class FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentity(FloatingIPTargetPrototype):
+ """
+ Identifies a virtual network interface by a unique property.
+
+ """
+
+ def __init__(
+ self,
+ ) -> None:
+ """
+ Initialize a FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentity object.
+
+ """
+ # pylint: disable=super-init-not-called
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById', 'FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref', 'FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN'])
+ )
+ raise Exception(msg)
+
+
+class FloatingIPTargetBareMetalServerNetworkInterfaceReference(FloatingIPTarget):
+ """
+ FloatingIPTargetBareMetalServerNetworkInterfaceReference.
+
+ :param BareMetalServerNetworkInterfaceReferenceDeleted 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 network interface.
+ If this bare metal server has network attachments, this network interface is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment.
+ :param str id: The unique identifier for this bare metal server network
+ interface.
+ If this bare metal server has network attachments, this network interface is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and the identifier is that of the corresponding network attachment.
+ :param str name: The name for this bare metal server network interface.
+ :param ReservedIPReference primary_ip:
+ :param str resource_type: The resource type.
+ """
+
+ def __init__(
+ self,
+ href: str,
+ id: str,
+ name: str,
+ primary_ip: 'ReservedIPReference',
+ resource_type: str,
+ *,
+ deleted: Optional['BareMetalServerNetworkInterfaceReferenceDeleted'] = None,
+ ) -> None:
+ """
+ Initialize a FloatingIPTargetBareMetalServerNetworkInterfaceReference object.
+
+ :param str href: The URL for this bare metal server network interface.
+ If this bare metal server has network attachments, this network interface
+ is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment.
+ :param str id: The unique identifier for this bare metal server network
+ interface.
+ If this bare metal server has network attachments, this network interface
+ is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and the identifier is that of the corresponding network
+ attachment.
+ :param str name: The name for this bare metal server network interface.
+ :param ReservedIPReference primary_ip:
+ :param str resource_type: The resource type.
+ :param BareMetalServerNetworkInterfaceReferenceDeleted deleted: (optional)
+ If present, this property indicates the referenced resource has been
+ deleted, and provides
+ some supplementary information.
+ """
+ # pylint: disable=super-init-not-called
+ self.deleted = deleted
+ self.href = href
+ self.id = id
+ self.name = name
+ self.primary_ip = primary_ip
+ self.resource_type = resource_type
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstanceTemplateIdentityByCRN':
- """Initialize a InstanceTemplateIdentityByCRN object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'FloatingIPTargetBareMetalServerNetworkInterfaceReference':
+ """Initialize a FloatingIPTargetBareMetalServerNetworkInterfaceReference object from a json dictionary."""
args = {}
- if 'crn' in _dict:
- args['crn'] = _dict.get('crn')
+ if (deleted := _dict.get('deleted')) is not None:
+ args['deleted'] = BareMetalServerNetworkInterfaceReferenceDeleted.from_dict(deleted)
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'crn\' not present in InstanceTemplateIdentityByCRN JSON')
+ raise ValueError('Required property \'href\' not present in FloatingIPTargetBareMetalServerNetworkInterfaceReference JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
+ else:
+ raise ValueError('Required property \'id\' not present in FloatingIPTargetBareMetalServerNetworkInterfaceReference JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ else:
+ raise ValueError('Required property \'name\' not present in FloatingIPTargetBareMetalServerNetworkInterfaceReference JSON')
+ if (primary_ip := _dict.get('primary_ip')) is not None:
+ args['primary_ip'] = ReservedIPReference.from_dict(primary_ip)
+ else:
+ raise ValueError('Required property \'primary_ip\' not present in FloatingIPTargetBareMetalServerNetworkInterfaceReference JSON')
+ if (resource_type := _dict.get('resource_type')) is not None:
+ args['resource_type'] = resource_type
+ else:
+ raise ValueError('Required property \'resource_type\' not present in FloatingIPTargetBareMetalServerNetworkInterfaceReference JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceTemplateIdentityByCRN object from a json dictionary."""
+ """Initialize a FloatingIPTargetBareMetalServerNetworkInterfaceReference object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'crn') and self.crn is not None:
- _dict['crn'] = self.crn
+ if hasattr(self, 'deleted') and self.deleted is not None:
+ if isinstance(self.deleted, dict):
+ _dict['deleted'] = self.deleted
+ else:
+ _dict['deleted'] = self.deleted.to_dict()
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
+ if hasattr(self, 'id') and self.id is not None:
+ _dict['id'] = self.id
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ if hasattr(self, 'primary_ip') and self.primary_ip is not None:
+ if isinstance(self.primary_ip, dict):
+ _dict['primary_ip'] = self.primary_ip
+ else:
+ _dict['primary_ip'] = self.primary_ip.to_dict()
+ if hasattr(self, 'resource_type') and self.resource_type is not None:
+ _dict['resource_type'] = self.resource_type
return _dict
def _to_dict(self):
@@ -102497,59 +106854,146 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this InstanceTemplateIdentityByCRN object."""
+ """Return a `str` version of this FloatingIPTargetBareMetalServerNetworkInterfaceReference object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceTemplateIdentityByCRN') -> bool:
+ def __eq__(self, other: 'FloatingIPTargetBareMetalServerNetworkInterfaceReference') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'InstanceTemplateIdentityByCRN') -> bool:
+ def __ne__(self, other: 'FloatingIPTargetBareMetalServerNetworkInterfaceReference') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
+ class ResourceTypeEnum(str, Enum):
+ """
+ The resource type.
+ """
-class InstanceTemplateIdentityByHref(InstanceTemplateIdentity):
+ NETWORK_INTERFACE = 'network_interface'
+
+
+
+class FloatingIPTargetNetworkInterfaceReference(FloatingIPTarget):
"""
- InstanceTemplateIdentityByHref.
+ FloatingIPTargetNetworkInterfaceReference.
- :attr str href: The URL for this instance template.
+ :param NetworkInterfaceReferenceDeleted 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 instance network interface.
+ If this instance has network attachments, this network interface is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment.
+ :param str id: The unique identifier for this instance network interface.
+ If this instance has network attachments, this network interface is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and the identifier is that of the corresponding network attachment.
+ :param str name: The name for this instance network interface.
+ :param ReservedIPReference primary_ip:
+ :param str resource_type: The resource type.
"""
def __init__(
self,
href: str,
+ id: str,
+ name: str,
+ primary_ip: 'ReservedIPReference',
+ resource_type: str,
+ *,
+ deleted: Optional['NetworkInterfaceReferenceDeleted'] = None,
) -> None:
"""
- Initialize a InstanceTemplateIdentityByHref object.
+ Initialize a FloatingIPTargetNetworkInterfaceReference object.
- :param str href: The URL for this instance template.
+ :param str href: The URL for this instance network interface.
+ If this instance has network attachments, this network interface is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment.
+ :param str id: The unique identifier for this instance network interface.
+ If this instance has network attachments, this network interface is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and the identifier is that of the corresponding network
+ attachment.
+ :param str name: The name for this instance network interface.
+ :param ReservedIPReference primary_ip:
+ :param str resource_type: The resource type.
+ :param NetworkInterfaceReferenceDeleted deleted: (optional) If present,
+ this property indicates the referenced resource has been deleted, and
+ provides
+ some supplementary information.
"""
# pylint: disable=super-init-not-called
+ self.deleted = deleted
self.href = href
+ self.id = id
+ self.name = name
+ self.primary_ip = primary_ip
+ self.resource_type = resource_type
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstanceTemplateIdentityByHref':
- """Initialize a InstanceTemplateIdentityByHref object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'FloatingIPTargetNetworkInterfaceReference':
+ """Initialize a FloatingIPTargetNetworkInterfaceReference object from a json dictionary."""
args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ if (deleted := _dict.get('deleted')) is not None:
+ args['deleted'] = NetworkInterfaceReferenceDeleted.from_dict(deleted)
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'href\' not present in InstanceTemplateIdentityByHref JSON')
+ raise ValueError('Required property \'href\' not present in FloatingIPTargetNetworkInterfaceReference JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
+ else:
+ raise ValueError('Required property \'id\' not present in FloatingIPTargetNetworkInterfaceReference JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ else:
+ raise ValueError('Required property \'name\' not present in FloatingIPTargetNetworkInterfaceReference JSON')
+ if (primary_ip := _dict.get('primary_ip')) is not None:
+ args['primary_ip'] = ReservedIPReference.from_dict(primary_ip)
+ else:
+ raise ValueError('Required property \'primary_ip\' not present in FloatingIPTargetNetworkInterfaceReference JSON')
+ if (resource_type := _dict.get('resource_type')) is not None:
+ args['resource_type'] = resource_type
+ else:
+ raise ValueError('Required property \'resource_type\' not present in FloatingIPTargetNetworkInterfaceReference JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceTemplateIdentityByHref object from a json dictionary."""
+ """Initialize a FloatingIPTargetNetworkInterfaceReference object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
+ if hasattr(self, 'deleted') and self.deleted is not None:
+ if isinstance(self.deleted, dict):
+ _dict['deleted'] = self.deleted
+ else:
+ _dict['deleted'] = self.deleted.to_dict()
if hasattr(self, 'href') and self.href is not None:
_dict['href'] = self.href
+ if hasattr(self, 'id') and self.id is not None:
+ _dict['id'] = self.id
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ if hasattr(self, 'primary_ip') and self.primary_ip is not None:
+ if isinstance(self.primary_ip, dict):
+ _dict['primary_ip'] = self.primary_ip
+ else:
+ _dict['primary_ip'] = self.primary_ip.to_dict()
+ if hasattr(self, 'resource_type') and self.resource_type is not None:
+ _dict['resource_type'] = self.resource_type
return _dict
def _to_dict(self):
@@ -102557,59 +107001,125 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this InstanceTemplateIdentityByHref object."""
+ """Return a `str` version of this FloatingIPTargetNetworkInterfaceReference object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceTemplateIdentityByHref') -> bool:
+ def __eq__(self, other: 'FloatingIPTargetNetworkInterfaceReference') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'InstanceTemplateIdentityByHref') -> bool:
+ def __ne__(self, other: 'FloatingIPTargetNetworkInterfaceReference') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
+ class ResourceTypeEnum(str, Enum):
+ """
+ The resource type.
+ """
-class InstanceTemplateIdentityById(InstanceTemplateIdentity):
+ NETWORK_INTERFACE = 'network_interface'
+
+
+
+class FloatingIPTargetPublicGatewayReference(FloatingIPTarget):
"""
- InstanceTemplateIdentityById.
+ FloatingIPTargetPublicGatewayReference.
- :attr str id: The unique identifier for this instance template.
+ :param str crn: The CRN for this public gateway.
+ :param PublicGatewayReferenceDeleted 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 public gateway.
+ :param str id: The unique identifier for this public gateway.
+ :param str name: The name for this public gateway. The name is unique across all
+ public gateways in the VPC.
+ :param str resource_type: The resource type.
"""
def __init__(
self,
+ crn: str,
+ href: str,
id: str,
+ name: str,
+ resource_type: str,
+ *,
+ deleted: Optional['PublicGatewayReferenceDeleted'] = None,
) -> None:
"""
- Initialize a InstanceTemplateIdentityById object.
+ Initialize a FloatingIPTargetPublicGatewayReference object.
- :param str id: The unique identifier for this instance template.
+ :param str crn: The CRN for this public gateway.
+ :param str href: The URL for this public gateway.
+ :param str id: The unique identifier for this public gateway.
+ :param str name: The name for this public gateway. The name is unique
+ across all public gateways in the VPC.
+ :param str resource_type: The resource type.
+ :param PublicGatewayReferenceDeleted deleted: (optional) If present, this
+ property indicates the referenced resource has been deleted, and provides
+ some supplementary information.
"""
# pylint: disable=super-init-not-called
+ self.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) -> 'InstanceTemplateIdentityById':
- """Initialize a InstanceTemplateIdentityById object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'FloatingIPTargetPublicGatewayReference':
+ """Initialize a FloatingIPTargetPublicGatewayReference object from a json dictionary."""
args = {}
- if 'id' in _dict:
- args['id'] = _dict.get('id')
+ if (crn := _dict.get('crn')) is not None:
+ args['crn'] = crn
else:
- raise ValueError('Required property \'id\' not present in InstanceTemplateIdentityById JSON')
+ raise ValueError('Required property \'crn\' not present in FloatingIPTargetPublicGatewayReference JSON')
+ if (deleted := _dict.get('deleted')) is not None:
+ args['deleted'] = PublicGatewayReferenceDeleted.from_dict(deleted)
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
+ else:
+ raise ValueError('Required property \'href\' not present in FloatingIPTargetPublicGatewayReference JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
+ else:
+ raise ValueError('Required property \'id\' not present in FloatingIPTargetPublicGatewayReference JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ else:
+ raise ValueError('Required property \'name\' not present in FloatingIPTargetPublicGatewayReference JSON')
+ if (resource_type := _dict.get('resource_type')) is not None:
+ args['resource_type'] = resource_type
+ else:
+ raise ValueError('Required property \'resource_type\' not present in FloatingIPTargetPublicGatewayReference JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceTemplateIdentityById object from a json dictionary."""
+ """Initialize a FloatingIPTargetPublicGatewayReference object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
+ if hasattr(self, 'crn') and self.crn is not None:
+ _dict['crn'] = self.crn
+ if hasattr(self, 'deleted') and self.deleted is not None:
+ if isinstance(self.deleted, dict):
+ _dict['deleted'] = self.deleted
+ else:
+ _dict['deleted'] = self.deleted.to_dict()
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
if hasattr(self, 'id') and self.id is not None:
_dict['id'] = self.id
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ if hasattr(self, 'resource_type') and self.resource_type is not None:
+ _dict['resource_type'] = self.resource_type
return _dict
def _to_dict(self):
@@ -102617,345 +107127,154 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this InstanceTemplateIdentityById object."""
+ """Return a `str` version of this FloatingIPTargetPublicGatewayReference object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceTemplateIdentityById') -> bool:
+ def __eq__(self, other: 'FloatingIPTargetPublicGatewayReference') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'InstanceTemplateIdentityById') -> bool:
+ def __ne__(self, other: 'FloatingIPTargetPublicGatewayReference') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
+ class ResourceTypeEnum(str, Enum):
+ """
+ The resource type.
+ """
-class InstanceTemplatePrototypeInstanceTemplateByCatalogOffering(InstanceTemplatePrototype):
+ PUBLIC_GATEWAY = 'public_gateway'
+
+
+
+class FloatingIPTargetVirtualNetworkInterfaceReference(FloatingIPTarget):
"""
- Create an instance template that creates instances by using a catalog offering.
+ FloatingIPTargetVirtualNetworkInterfaceReference.
- :attr InstanceAvailabilityPolicyPrototype availability_policy: (optional) The
- availability policy to use for this virtual server instance.
- :attr InstanceDefaultTrustedProfilePrototype default_trusted_profile: (optional)
- The default trusted profile configuration to use for this virtual server
- instance
- This property's value is used when provisioning the virtual server instance, but
- not subsequently managed. Accordingly, it is reflected as an [instance
- initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
- property.
- :attr List[KeyIdentity] keys: (optional) The public SSH keys for the
- administrative user of the virtual server instance. Keys will be made available
- to the virtual server instance as cloud-init vendor data. For cloud-init enabled
- images, these keys will also be added as SSH authorized keys for the
- administrative user.
- For Windows images, the keys of type `rsa` must be specified, and one will be
- selected to encrypt [the administrator
- password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys
- are optional for other images, but if no keys are specified, the instance will
- be inaccessible unless the specified image provides another means of access.
- This property's value is used when provisioning the virtual server instance, but
- not subsequently managed. Accordingly, it is reflected as an [instance
- initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
- property.
- :attr InstanceMetadataServicePrototype metadata_service: (optional)
- :attr str name: (optional) The name for this instance template. The name must
- not be used by another instance template in the region. If unspecified, the name
- will be a hyphenated list of randomly-selected words.
- :attr InstancePlacementTargetPrototype placement_target: (optional) The
- placement restrictions to use for the virtual server instance.
- :attr InstanceProfileIdentity profile: (optional) The
- [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this
- virtual server instance.
- If unspecified, `bx2-2x8` will be used, but this default value is expected to
- change in the future.
- :attr ResourceGroupIdentity resource_group: (optional)
- :attr int total_volume_bandwidth: (optional) The amount of bandwidth (in
- megabits per second) allocated exclusively to instance storage volumes. An
- increase in this value will result in a corresponding decrease to
- `total_network_bandwidth`.
- :attr str user_data: (optional) [User
- data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when
- setting up the virtual server instance.
- :attr List[VolumeAttachmentPrototype] volume_attachments: (optional) The
- additional volume attachments to create for the virtual server instance.
- :attr VPCIdentity vpc: (optional) The VPC this virtual server instance will
- reside in.
- If specified, it must match the VPC for the subnets of the instance network
- interfaces.
- :attr VolumeAttachmentPrototypeInstanceByImageContext boot_volume_attachment:
- (optional) The boot volume attachment to create for the virtual server instance.
- :attr InstanceCatalogOfferingPrototype catalog_offering: The
- [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user)
- offering
- or offering version to use when provisioning this virtual server instance.
- If an offering is specified, the latest version of that offering will be used.
- The specified offering or offering version may be in a different account in the
- same
- [enterprise](https://cloud.ibm.com/docs/account?topic=account-what-is-enterprise),
- subject
- to IAM policies.
- :attr List[NetworkInterfacePrototype] network_interfaces: (optional) The
- additional instance network interfaces to create.
- :attr NetworkInterfacePrototype primary_network_interface: The primary instance
- network interface to create.
- :attr ZoneIdentity zone: The zone this virtual server instance will reside in.
+ :param str crn: The CRN for this virtual network interface.
+ :param VirtualNetworkInterfaceReferenceDeleted 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 virtual network interface.
+ :param str id: The unique identifier for this virtual network interface.
+ :param str name: The name for this virtual network interface. The name is unique
+ across all virtual network interfaces in the VPC.
+ :param ReservedIPReference primary_ip: The primary IP for this virtual network
+ interface.
+ :param str resource_type: The resource type.
+ :param SubnetReference subnet: The associated subnet.
"""
def __init__(
self,
- catalog_offering: 'InstanceCatalogOfferingPrototype',
- primary_network_interface: 'NetworkInterfacePrototype',
- zone: 'ZoneIdentity',
+ crn: str,
+ href: str,
+ id: str,
+ name: str,
+ primary_ip: 'ReservedIPReference',
+ resource_type: str,
+ subnet: 'SubnetReference',
*,
- availability_policy: 'InstanceAvailabilityPolicyPrototype' = None,
- default_trusted_profile: 'InstanceDefaultTrustedProfilePrototype' = None,
- keys: List['KeyIdentity'] = None,
- metadata_service: 'InstanceMetadataServicePrototype' = None,
- name: str = None,
- placement_target: 'InstancePlacementTargetPrototype' = None,
- profile: 'InstanceProfileIdentity' = None,
- resource_group: 'ResourceGroupIdentity' = None,
- total_volume_bandwidth: int = None,
- user_data: str = None,
- volume_attachments: List['VolumeAttachmentPrototype'] = None,
- vpc: 'VPCIdentity' = None,
- boot_volume_attachment: 'VolumeAttachmentPrototypeInstanceByImageContext' = None,
- network_interfaces: List['NetworkInterfacePrototype'] = None,
+ deleted: Optional['VirtualNetworkInterfaceReferenceDeleted'] = None,
) -> None:
"""
- Initialize a InstanceTemplatePrototypeInstanceTemplateByCatalogOffering object.
+ Initialize a FloatingIPTargetVirtualNetworkInterfaceReference object.
- :param InstanceCatalogOfferingPrototype catalog_offering: The
- [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user)
- offering
- or offering version to use when provisioning this virtual server instance.
- If an offering is specified, the latest version of that offering will be
- used.
- The specified offering or offering version may be in a different account in
- the same
- [enterprise](https://cloud.ibm.com/docs/account?topic=account-what-is-enterprise),
- subject
- to IAM policies.
- :param NetworkInterfacePrototype primary_network_interface: The primary
- instance network interface to create.
- :param ZoneIdentity zone: The zone this virtual server instance will reside
- in.
- :param InstanceAvailabilityPolicyPrototype availability_policy: (optional)
- The availability policy to use for this virtual server instance.
- :param InstanceDefaultTrustedProfilePrototype default_trusted_profile:
- (optional) The default trusted profile configuration to use for this
- virtual server instance
- This property's value is used when provisioning the virtual server
- instance, but not subsequently managed. Accordingly, it is reflected as an
- [instance
- initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
- property.
- :param List[KeyIdentity] keys: (optional) The public SSH keys for the
- administrative user of the virtual server instance. Keys will be made
- available to the virtual server instance as cloud-init vendor data. For
- cloud-init enabled images, these keys will also be added as SSH authorized
- keys for the administrative user.
- For Windows images, the keys of type `rsa` must be specified, and one will
- be selected to encrypt [the administrator
- password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization).
- Keys are optional for other images, but if no keys are specified, the
- instance will be inaccessible unless the specified image provides another
- means of access.
- This property's value is used when provisioning the virtual server
- instance, but not subsequently managed. Accordingly, it is reflected as an
- [instance
- initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
- property.
- :param InstanceMetadataServicePrototype metadata_service: (optional)
- :param str name: (optional) The name for this instance template. The name
- must not be used by another instance template in the region. If
- unspecified, the name will be a hyphenated list of randomly-selected words.
- :param InstancePlacementTargetPrototype placement_target: (optional) The
- placement restrictions to use for the virtual server instance.
- :param InstanceProfileIdentity profile: (optional) The
- [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for
- this virtual server instance.
- If unspecified, `bx2-2x8` will be used, but this default value is expected
- to change in the future.
- :param ResourceGroupIdentity resource_group: (optional)
- :param int total_volume_bandwidth: (optional) The amount of bandwidth (in
- megabits per second) allocated exclusively to instance storage volumes. An
- increase in this value will result in a corresponding decrease to
- `total_network_bandwidth`.
- :param str user_data: (optional) [User
- data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available
- when setting up the virtual server instance.
- :param List[VolumeAttachmentPrototype] volume_attachments: (optional) The
- additional volume attachments to create for the virtual server instance.
- :param VPCIdentity vpc: (optional) The VPC this virtual server instance
- will reside in.
- If specified, it must match the VPC for the subnets of the instance network
- interfaces.
- :param VolumeAttachmentPrototypeInstanceByImageContext
- boot_volume_attachment: (optional) The boot volume attachment to create for
- the virtual server instance.
- :param List[NetworkInterfacePrototype] network_interfaces: (optional) The
- additional instance network interfaces to create.
+ :param str crn: The CRN for this virtual network interface.
+ :param str href: The URL for this virtual network interface.
+ :param str id: The unique identifier for this virtual network interface.
+ :param str name: The name for this virtual network interface. The name is
+ unique across all virtual network interfaces in the VPC.
+ :param ReservedIPReference primary_ip: The primary IP for this virtual
+ network interface.
+ :param str resource_type: The resource type.
+ :param SubnetReference subnet: The associated subnet.
+ :param VirtualNetworkInterfaceReferenceDeleted deleted: (optional) If
+ present, this property indicates the referenced resource has been deleted,
+ and provides
+ some supplementary information.
"""
# pylint: disable=super-init-not-called
- self.availability_policy = availability_policy
- self.default_trusted_profile = default_trusted_profile
- self.keys = keys
- self.metadata_service = metadata_service
+ self.crn = crn
+ self.deleted = deleted
+ self.href = href
+ self.id = id
self.name = name
- self.placement_target = placement_target
- self.profile = profile
- self.resource_group = resource_group
- self.total_volume_bandwidth = total_volume_bandwidth
- self.user_data = user_data
- self.volume_attachments = volume_attachments
- self.vpc = vpc
- self.boot_volume_attachment = boot_volume_attachment
- self.catalog_offering = catalog_offering
- self.network_interfaces = network_interfaces
- self.primary_network_interface = primary_network_interface
- self.zone = zone
+ self.primary_ip = primary_ip
+ self.resource_type = resource_type
+ self.subnet = subnet
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstanceTemplatePrototypeInstanceTemplateByCatalogOffering':
- """Initialize a InstanceTemplatePrototypeInstanceTemplateByCatalogOffering object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'FloatingIPTargetVirtualNetworkInterfaceReference':
+ """Initialize a FloatingIPTargetVirtualNetworkInterfaceReference object from a json dictionary."""
args = {}
- if 'availability_policy' in _dict:
- args['availability_policy'] = InstanceAvailabilityPolicyPrototype.from_dict(_dict.get('availability_policy'))
- if 'default_trusted_profile' in _dict:
- args['default_trusted_profile'] = InstanceDefaultTrustedProfilePrototype.from_dict(_dict.get('default_trusted_profile'))
- if 'keys' in _dict:
- args['keys'] = _dict.get('keys')
- if 'metadata_service' in _dict:
- args['metadata_service'] = InstanceMetadataServicePrototype.from_dict(_dict.get('metadata_service'))
- if 'name' in _dict:
- args['name'] = _dict.get('name')
- if 'placement_target' in _dict:
- args['placement_target'] = _dict.get('placement_target')
- if 'profile' in _dict:
- args['profile'] = _dict.get('profile')
- if 'resource_group' in _dict:
- args['resource_group'] = _dict.get('resource_group')
- if 'total_volume_bandwidth' in _dict:
- args['total_volume_bandwidth'] = _dict.get('total_volume_bandwidth')
- if 'user_data' in _dict:
- args['user_data'] = _dict.get('user_data')
- if 'volume_attachments' in _dict:
- args['volume_attachments'] = [VolumeAttachmentPrototype.from_dict(v) for v in _dict.get('volume_attachments')]
- if 'vpc' in _dict:
- args['vpc'] = _dict.get('vpc')
- if 'boot_volume_attachment' in _dict:
- args['boot_volume_attachment'] = VolumeAttachmentPrototypeInstanceByImageContext.from_dict(_dict.get('boot_volume_attachment'))
- if 'catalog_offering' in _dict:
- args['catalog_offering'] = _dict.get('catalog_offering')
+ if (crn := _dict.get('crn')) is not None:
+ args['crn'] = crn
+ else:
+ raise ValueError('Required property \'crn\' not present in FloatingIPTargetVirtualNetworkInterfaceReference JSON')
+ if (deleted := _dict.get('deleted')) is not None:
+ args['deleted'] = VirtualNetworkInterfaceReferenceDeleted.from_dict(deleted)
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
+ else:
+ raise ValueError('Required property \'href\' not present in FloatingIPTargetVirtualNetworkInterfaceReference JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
+ else:
+ raise ValueError('Required property \'id\' not present in FloatingIPTargetVirtualNetworkInterfaceReference JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
else:
- raise ValueError('Required property \'catalog_offering\' not present in InstanceTemplatePrototypeInstanceTemplateByCatalogOffering JSON')
- if 'network_interfaces' in _dict:
- args['network_interfaces'] = [NetworkInterfacePrototype.from_dict(v) for v in _dict.get('network_interfaces')]
- if 'primary_network_interface' in _dict:
- args['primary_network_interface'] = NetworkInterfacePrototype.from_dict(_dict.get('primary_network_interface'))
+ raise ValueError('Required property \'name\' not present in FloatingIPTargetVirtualNetworkInterfaceReference JSON')
+ if (primary_ip := _dict.get('primary_ip')) is not None:
+ args['primary_ip'] = ReservedIPReference.from_dict(primary_ip)
else:
- raise ValueError('Required property \'primary_network_interface\' not present in InstanceTemplatePrototypeInstanceTemplateByCatalogOffering JSON')
- if 'zone' in _dict:
- args['zone'] = _dict.get('zone')
+ raise ValueError('Required property \'primary_ip\' not present in FloatingIPTargetVirtualNetworkInterfaceReference JSON')
+ if (resource_type := _dict.get('resource_type')) is not None:
+ args['resource_type'] = resource_type
else:
- raise ValueError('Required property \'zone\' not present in InstanceTemplatePrototypeInstanceTemplateByCatalogOffering JSON')
+ raise ValueError('Required property \'resource_type\' not present in FloatingIPTargetVirtualNetworkInterfaceReference JSON')
+ if (subnet := _dict.get('subnet')) is not None:
+ args['subnet'] = SubnetReference.from_dict(subnet)
+ else:
+ raise ValueError('Required property \'subnet\' not present in FloatingIPTargetVirtualNetworkInterfaceReference JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceTemplatePrototypeInstanceTemplateByCatalogOffering object from a json dictionary."""
+ """Initialize a FloatingIPTargetVirtualNetworkInterfaceReference object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'availability_policy') and self.availability_policy is not None:
- if isinstance(self.availability_policy, dict):
- _dict['availability_policy'] = self.availability_policy
- else:
- _dict['availability_policy'] = self.availability_policy.to_dict()
- if hasattr(self, 'default_trusted_profile') and self.default_trusted_profile is not None:
- if isinstance(self.default_trusted_profile, dict):
- _dict['default_trusted_profile'] = self.default_trusted_profile
+ if hasattr(self, 'crn') and self.crn is not None:
+ _dict['crn'] = self.crn
+ if hasattr(self, 'deleted') and self.deleted is not None:
+ if isinstance(self.deleted, dict):
+ _dict['deleted'] = self.deleted
else:
- _dict['default_trusted_profile'] = self.default_trusted_profile.to_dict()
- if hasattr(self, 'keys') and self.keys is not None:
- keys_list = []
- for v in self.keys:
- if isinstance(v, dict):
- keys_list.append(v)
- else:
- keys_list.append(v.to_dict())
- _dict['keys'] = keys_list
- if hasattr(self, 'metadata_service') and self.metadata_service is not None:
- if isinstance(self.metadata_service, dict):
- _dict['metadata_service'] = self.metadata_service
- else:
- _dict['metadata_service'] = self.metadata_service.to_dict()
+ _dict['deleted'] = self.deleted.to_dict()
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
+ if hasattr(self, 'id') and self.id is not None:
+ _dict['id'] = self.id
if hasattr(self, 'name') and self.name is not None:
_dict['name'] = self.name
- if hasattr(self, 'placement_target') and self.placement_target is not None:
- if isinstance(self.placement_target, dict):
- _dict['placement_target'] = self.placement_target
- else:
- _dict['placement_target'] = self.placement_target.to_dict()
- if hasattr(self, 'profile') and self.profile is not None:
- if isinstance(self.profile, dict):
- _dict['profile'] = self.profile
- else:
- _dict['profile'] = self.profile.to_dict()
- if hasattr(self, 'resource_group') and self.resource_group is not None:
- if isinstance(self.resource_group, dict):
- _dict['resource_group'] = self.resource_group
- else:
- _dict['resource_group'] = self.resource_group.to_dict()
- if hasattr(self, 'total_volume_bandwidth') and self.total_volume_bandwidth is not None:
- _dict['total_volume_bandwidth'] = self.total_volume_bandwidth
- if hasattr(self, 'user_data') and self.user_data is not None:
- _dict['user_data'] = self.user_data
- if hasattr(self, 'volume_attachments') and self.volume_attachments is not None:
- volume_attachments_list = []
- for v in self.volume_attachments:
- if isinstance(v, dict):
- volume_attachments_list.append(v)
- else:
- volume_attachments_list.append(v.to_dict())
- _dict['volume_attachments'] = volume_attachments_list
- if hasattr(self, 'vpc') and self.vpc is not None:
- if isinstance(self.vpc, dict):
- _dict['vpc'] = self.vpc
- else:
- _dict['vpc'] = self.vpc.to_dict()
- if hasattr(self, 'boot_volume_attachment') and self.boot_volume_attachment is not None:
- if isinstance(self.boot_volume_attachment, dict):
- _dict['boot_volume_attachment'] = self.boot_volume_attachment
- else:
- _dict['boot_volume_attachment'] = self.boot_volume_attachment.to_dict()
- if hasattr(self, 'catalog_offering') and self.catalog_offering is not None:
- if isinstance(self.catalog_offering, dict):
- _dict['catalog_offering'] = self.catalog_offering
- else:
- _dict['catalog_offering'] = self.catalog_offering.to_dict()
- if hasattr(self, 'network_interfaces') and self.network_interfaces is not None:
- network_interfaces_list = []
- for v in self.network_interfaces:
- if isinstance(v, dict):
- network_interfaces_list.append(v)
- else:
- network_interfaces_list.append(v.to_dict())
- _dict['network_interfaces'] = network_interfaces_list
- if hasattr(self, 'primary_network_interface') and self.primary_network_interface is not None:
- if isinstance(self.primary_network_interface, dict):
- _dict['primary_network_interface'] = self.primary_network_interface
+ if hasattr(self, 'primary_ip') and self.primary_ip is not None:
+ if isinstance(self.primary_ip, dict):
+ _dict['primary_ip'] = self.primary_ip
else:
- _dict['primary_network_interface'] = self.primary_network_interface.to_dict()
- if hasattr(self, 'zone') and self.zone is not None:
- if isinstance(self.zone, dict):
- _dict['zone'] = self.zone
+ _dict['primary_ip'] = self.primary_ip.to_dict()
+ if hasattr(self, 'resource_type') and self.resource_type is not None:
+ _dict['resource_type'] = self.resource_type
+ if hasattr(self, 'subnet') and self.subnet is not None:
+ if isinstance(self.subnet, dict):
+ _dict['subnet'] = self.subnet
else:
- _dict['zone'] = self.zone.to_dict()
+ _dict['subnet'] = self.subnet.to_dict()
return _dict
def _to_dict(self):
@@ -102963,328 +107282,268 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this InstanceTemplatePrototypeInstanceTemplateByCatalogOffering object."""
+ """Return a `str` version of this FloatingIPTargetVirtualNetworkInterfaceReference object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceTemplatePrototypeInstanceTemplateByCatalogOffering') -> bool:
+ def __eq__(self, other: 'FloatingIPTargetVirtualNetworkInterfaceReference') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'InstanceTemplatePrototypeInstanceTemplateByCatalogOffering') -> bool:
+ def __ne__(self, other: 'FloatingIPTargetVirtualNetworkInterfaceReference') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
+ class ResourceTypeEnum(str, Enum):
+ """
+ The resource type.
+ """
+
+ VIRTUAL_NETWORK_INTERFACE = 'virtual_network_interface'
-class InstanceTemplatePrototypeInstanceTemplateByImage(InstanceTemplatePrototype):
+
+
+class FlowLogCollectorTargetPrototypeInstanceIdentity(FlowLogCollectorTargetPrototype):
"""
- Create an instance template that creates instances by using an image.
+ Identifies a virtual server instance by a unique property.
- :attr InstanceAvailabilityPolicyPrototype availability_policy: (optional) The
- availability policy to use for this virtual server instance.
- :attr InstanceDefaultTrustedProfilePrototype default_trusted_profile: (optional)
- The default trusted profile configuration to use for this virtual server
- instance
- This property's value is used when provisioning the virtual server instance, but
- not subsequently managed. Accordingly, it is reflected as an [instance
- initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
- property.
- :attr List[KeyIdentity] keys: (optional) The public SSH keys for the
- administrative user of the virtual server instance. Keys will be made available
- to the virtual server instance as cloud-init vendor data. For cloud-init enabled
- images, these keys will also be added as SSH authorized keys for the
- administrative user.
- For Windows images, the keys of type `rsa` must be specified, and one will be
- selected to encrypt [the administrator
- password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys
- are optional for other images, but if no keys are specified, the instance will
- be inaccessible unless the specified image provides another means of access.
- This property's value is used when provisioning the virtual server instance, but
- not subsequently managed. Accordingly, it is reflected as an [instance
- initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
- property.
- :attr InstanceMetadataServicePrototype metadata_service: (optional)
- :attr str name: (optional) The name for this instance template. The name must
- not be used by another instance template in the region. If unspecified, the name
- will be a hyphenated list of randomly-selected words.
- :attr InstancePlacementTargetPrototype placement_target: (optional) The
- placement restrictions to use for the virtual server instance.
- :attr InstanceProfileIdentity profile: (optional) The
- [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this
- virtual server instance.
- If unspecified, `bx2-2x8` will be used, but this default value is expected to
- change in the future.
- :attr ResourceGroupIdentity resource_group: (optional)
- :attr int total_volume_bandwidth: (optional) The amount of bandwidth (in
- megabits per second) allocated exclusively to instance storage volumes. An
- increase in this value will result in a corresponding decrease to
- `total_network_bandwidth`.
- :attr str user_data: (optional) [User
- data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when
- setting up the virtual server instance.
- :attr List[VolumeAttachmentPrototype] volume_attachments: (optional) The
- additional volume attachments to create for the virtual server instance.
- :attr VPCIdentity vpc: (optional) The VPC this virtual server instance will
- reside in.
- If specified, it must match the VPC for the subnets of the instance network
- interfaces.
- :attr VolumeAttachmentPrototypeInstanceByImageContext boot_volume_attachment:
- (optional) The boot volume attachment to create for the virtual server instance.
- :attr ImageIdentity image: The image to use when provisioning the virtual server
- instance.
- :attr List[NetworkInterfacePrototype] network_interfaces: (optional) The
- additional instance network interfaces to create.
- :attr NetworkInterfacePrototype primary_network_interface: The primary instance
- network interface to create.
- :attr ZoneIdentity zone: The zone this virtual server instance will reside in.
"""
def __init__(
self,
- image: 'ImageIdentity',
- primary_network_interface: 'NetworkInterfacePrototype',
- zone: 'ZoneIdentity',
+ ) -> None:
+ """
+ Initialize a FlowLogCollectorTargetPrototypeInstanceIdentity object.
+
+ """
+ # pylint: disable=super-init-not-called
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityById', 'FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByCRN', 'FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByHref'])
+ )
+ raise Exception(msg)
+
+
+class FlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentity(FlowLogCollectorTargetPrototype):
+ """
+ Identifies an instance network attachment by a unique property.
+
+ """
+
+ def __init__(
+ self,
+ ) -> None:
+ """
+ Initialize a FlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentity object.
+
+ """
+ # pylint: disable=super-init-not-called
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['FlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentityInstanceNetworkAttachmentIdentityById', 'FlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentityInstanceNetworkAttachmentIdentityByHref'])
+ )
+ raise Exception(msg)
+
+
+class FlowLogCollectorTargetPrototypeNetworkInterfaceIdentity(FlowLogCollectorTargetPrototype):
+ """
+ Identifies an instance network interface by a unique property.
+
+ """
+
+ def __init__(
+ self,
+ ) -> None:
+ """
+ Initialize a FlowLogCollectorTargetPrototypeNetworkInterfaceIdentity object.
+
+ """
+ # pylint: disable=super-init-not-called
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityById', 'FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref'])
+ )
+ raise Exception(msg)
+
+
+class FlowLogCollectorTargetPrototypeSubnetIdentity(FlowLogCollectorTargetPrototype):
+ """
+ Identifies a subnet by a unique property.
+
+ """
+
+ def __init__(
+ self,
+ ) -> None:
+ """
+ Initialize a FlowLogCollectorTargetPrototypeSubnetIdentity object.
+
+ """
+ # pylint: disable=super-init-not-called
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityById', 'FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByCRN', 'FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByHref'])
+ )
+ raise Exception(msg)
+
+
+class FlowLogCollectorTargetPrototypeVPCIdentity(FlowLogCollectorTargetPrototype):
+ """
+ Identifies a VPC by a unique property.
+
+ """
+
+ def __init__(
+ self,
+ ) -> None:
+ """
+ Initialize a FlowLogCollectorTargetPrototypeVPCIdentity object.
+
+ """
+ # pylint: disable=super-init-not-called
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityById', 'FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByCRN', 'FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByHref'])
+ )
+ raise Exception(msg)
+
+
+class FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentity(FlowLogCollectorTargetPrototype):
+ """
+ Identifies a virtual network interface by a unique property.
+
+ """
+
+ def __init__(
+ self,
+ ) -> None:
+ """
+ Initialize a FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentity object.
+
+ """
+ # pylint: disable=super-init-not-called
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById', 'FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref', 'FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN'])
+ )
+ raise Exception(msg)
+
+
+class FlowLogCollectorTargetInstanceNetworkAttachmentReference(FlowLogCollectorTarget):
+ """
+ FlowLogCollectorTargetInstanceNetworkAttachmentReference.
+
+ :param InstanceNetworkAttachmentReferenceDeleted 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 instance network attachment.
+ :param str id: The unique identifier for this instance network attachment.
+ :param str name: The name for this instance network attachment. The name is
+ unique across all network attachments for the instance.
+ :param ReservedIPReference primary_ip: The primary IP address of the virtual
+ network interface for the instance network
+ attachment.
+ :param str resource_type: The resource type.
+ :param SubnetReference subnet: The subnet of the virtual network interface for
+ the instance network attachment.
+ """
+
+ def __init__(
+ self,
+ href: str,
+ id: str,
+ name: str,
+ primary_ip: 'ReservedIPReference',
+ resource_type: str,
+ subnet: 'SubnetReference',
*,
- availability_policy: 'InstanceAvailabilityPolicyPrototype' = None,
- default_trusted_profile: 'InstanceDefaultTrustedProfilePrototype' = None,
- keys: List['KeyIdentity'] = None,
- metadata_service: 'InstanceMetadataServicePrototype' = None,
- name: str = None,
- placement_target: 'InstancePlacementTargetPrototype' = None,
- profile: 'InstanceProfileIdentity' = None,
- resource_group: 'ResourceGroupIdentity' = None,
- total_volume_bandwidth: int = None,
- user_data: str = None,
- volume_attachments: List['VolumeAttachmentPrototype'] = None,
- vpc: 'VPCIdentity' = None,
- boot_volume_attachment: 'VolumeAttachmentPrototypeInstanceByImageContext' = None,
- network_interfaces: List['NetworkInterfacePrototype'] = None,
+ deleted: Optional['InstanceNetworkAttachmentReferenceDeleted'] = None,
) -> None:
"""
- Initialize a InstanceTemplatePrototypeInstanceTemplateByImage object.
+ Initialize a FlowLogCollectorTargetInstanceNetworkAttachmentReference object.
- :param ImageIdentity image: The image to use when provisioning the virtual
- server instance.
- :param NetworkInterfacePrototype primary_network_interface: The primary
- instance network interface to create.
- :param ZoneIdentity zone: The zone this virtual server instance will reside
- in.
- :param InstanceAvailabilityPolicyPrototype availability_policy: (optional)
- The availability policy to use for this virtual server instance.
- :param InstanceDefaultTrustedProfilePrototype default_trusted_profile:
- (optional) The default trusted profile configuration to use for this
- virtual server instance
- This property's value is used when provisioning the virtual server
- instance, but not subsequently managed. Accordingly, it is reflected as an
- [instance
- initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
- property.
- :param List[KeyIdentity] keys: (optional) The public SSH keys for the
- administrative user of the virtual server instance. Keys will be made
- available to the virtual server instance as cloud-init vendor data. For
- cloud-init enabled images, these keys will also be added as SSH authorized
- keys for the administrative user.
- For Windows images, the keys of type `rsa` must be specified, and one will
- be selected to encrypt [the administrator
- password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization).
- Keys are optional for other images, but if no keys are specified, the
- instance will be inaccessible unless the specified image provides another
- means of access.
- This property's value is used when provisioning the virtual server
- instance, but not subsequently managed. Accordingly, it is reflected as an
- [instance
- initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
- property.
- :param InstanceMetadataServicePrototype metadata_service: (optional)
- :param str name: (optional) The name for this instance template. The name
- must not be used by another instance template in the region. If
- unspecified, the name will be a hyphenated list of randomly-selected words.
- :param InstancePlacementTargetPrototype placement_target: (optional) The
- placement restrictions to use for the virtual server instance.
- :param InstanceProfileIdentity profile: (optional) The
- [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for
- this virtual server instance.
- If unspecified, `bx2-2x8` will be used, but this default value is expected
- to change in the future.
- :param ResourceGroupIdentity resource_group: (optional)
- :param int total_volume_bandwidth: (optional) The amount of bandwidth (in
- megabits per second) allocated exclusively to instance storage volumes. An
- increase in this value will result in a corresponding decrease to
- `total_network_bandwidth`.
- :param str user_data: (optional) [User
- data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available
- when setting up the virtual server instance.
- :param List[VolumeAttachmentPrototype] volume_attachments: (optional) The
- additional volume attachments to create for the virtual server instance.
- :param VPCIdentity vpc: (optional) The VPC this virtual server instance
- will reside in.
- If specified, it must match the VPC for the subnets of the instance network
- interfaces.
- :param VolumeAttachmentPrototypeInstanceByImageContext
- boot_volume_attachment: (optional) The boot volume attachment to create for
- the virtual server instance.
- :param List[NetworkInterfacePrototype] network_interfaces: (optional) The
- additional instance network interfaces to create.
+ :param str href: The URL for this instance network attachment.
+ :param str id: The unique identifier for this instance network attachment.
+ :param str name: The name for this instance network attachment. The name is
+ unique across all network attachments for the instance.
+ :param ReservedIPReference primary_ip: The primary IP address of the
+ virtual network interface for the instance network
+ attachment.
+ :param str resource_type: The resource type.
+ :param SubnetReference subnet: The subnet of the virtual network interface
+ for the instance network attachment.
+ :param InstanceNetworkAttachmentReferenceDeleted deleted: (optional) If
+ present, this property indicates the referenced resource has been deleted,
+ and provides
+ some supplementary information.
"""
# pylint: disable=super-init-not-called
- self.availability_policy = availability_policy
- self.default_trusted_profile = default_trusted_profile
- self.keys = keys
- self.metadata_service = metadata_service
+ self.deleted = deleted
+ self.href = href
+ self.id = id
self.name = name
- self.placement_target = placement_target
- self.profile = profile
- self.resource_group = resource_group
- self.total_volume_bandwidth = total_volume_bandwidth
- self.user_data = user_data
- self.volume_attachments = volume_attachments
- self.vpc = vpc
- self.boot_volume_attachment = boot_volume_attachment
- self.image = image
- self.network_interfaces = network_interfaces
- self.primary_network_interface = primary_network_interface
- self.zone = zone
+ self.primary_ip = primary_ip
+ self.resource_type = resource_type
+ self.subnet = subnet
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstanceTemplatePrototypeInstanceTemplateByImage':
- """Initialize a InstanceTemplatePrototypeInstanceTemplateByImage object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'FlowLogCollectorTargetInstanceNetworkAttachmentReference':
+ """Initialize a FlowLogCollectorTargetInstanceNetworkAttachmentReference object from a json dictionary."""
args = {}
- if 'availability_policy' in _dict:
- args['availability_policy'] = InstanceAvailabilityPolicyPrototype.from_dict(_dict.get('availability_policy'))
- if 'default_trusted_profile' in _dict:
- args['default_trusted_profile'] = InstanceDefaultTrustedProfilePrototype.from_dict(_dict.get('default_trusted_profile'))
- if 'keys' in _dict:
- args['keys'] = _dict.get('keys')
- if 'metadata_service' in _dict:
- args['metadata_service'] = InstanceMetadataServicePrototype.from_dict(_dict.get('metadata_service'))
- if 'name' in _dict:
- args['name'] = _dict.get('name')
- if 'placement_target' in _dict:
- args['placement_target'] = _dict.get('placement_target')
- if 'profile' in _dict:
- args['profile'] = _dict.get('profile')
- if 'resource_group' in _dict:
- args['resource_group'] = _dict.get('resource_group')
- if 'total_volume_bandwidth' in _dict:
- args['total_volume_bandwidth'] = _dict.get('total_volume_bandwidth')
- if 'user_data' in _dict:
- args['user_data'] = _dict.get('user_data')
- if 'volume_attachments' in _dict:
- args['volume_attachments'] = [VolumeAttachmentPrototype.from_dict(v) for v in _dict.get('volume_attachments')]
- if 'vpc' in _dict:
- args['vpc'] = _dict.get('vpc')
- if 'boot_volume_attachment' in _dict:
- args['boot_volume_attachment'] = VolumeAttachmentPrototypeInstanceByImageContext.from_dict(_dict.get('boot_volume_attachment'))
- if 'image' in _dict:
- args['image'] = _dict.get('image')
+ if (deleted := _dict.get('deleted')) is not None:
+ args['deleted'] = InstanceNetworkAttachmentReferenceDeleted.from_dict(deleted)
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
+ else:
+ raise ValueError('Required property \'href\' not present in FlowLogCollectorTargetInstanceNetworkAttachmentReference JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
else:
- raise ValueError('Required property \'image\' not present in InstanceTemplatePrototypeInstanceTemplateByImage JSON')
- if 'network_interfaces' in _dict:
- args['network_interfaces'] = [NetworkInterfacePrototype.from_dict(v) for v in _dict.get('network_interfaces')]
- if 'primary_network_interface' in _dict:
- args['primary_network_interface'] = NetworkInterfacePrototype.from_dict(_dict.get('primary_network_interface'))
+ raise ValueError('Required property \'id\' not present in FlowLogCollectorTargetInstanceNetworkAttachmentReference JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
else:
- raise ValueError('Required property \'primary_network_interface\' not present in InstanceTemplatePrototypeInstanceTemplateByImage JSON')
- if 'zone' in _dict:
- args['zone'] = _dict.get('zone')
+ raise ValueError('Required property \'name\' not present in FlowLogCollectorTargetInstanceNetworkAttachmentReference JSON')
+ if (primary_ip := _dict.get('primary_ip')) is not None:
+ args['primary_ip'] = ReservedIPReference.from_dict(primary_ip)
else:
- raise ValueError('Required property \'zone\' not present in InstanceTemplatePrototypeInstanceTemplateByImage JSON')
+ raise ValueError('Required property \'primary_ip\' not present in FlowLogCollectorTargetInstanceNetworkAttachmentReference JSON')
+ if (resource_type := _dict.get('resource_type')) is not None:
+ args['resource_type'] = resource_type
+ else:
+ raise ValueError('Required property \'resource_type\' not present in FlowLogCollectorTargetInstanceNetworkAttachmentReference JSON')
+ if (subnet := _dict.get('subnet')) is not None:
+ args['subnet'] = SubnetReference.from_dict(subnet)
+ else:
+ raise ValueError('Required property \'subnet\' not present in FlowLogCollectorTargetInstanceNetworkAttachmentReference JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceTemplatePrototypeInstanceTemplateByImage object from a json dictionary."""
+ """Initialize a FlowLogCollectorTargetInstanceNetworkAttachmentReference object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'availability_policy') and self.availability_policy is not None:
- if isinstance(self.availability_policy, dict):
- _dict['availability_policy'] = self.availability_policy
- else:
- _dict['availability_policy'] = self.availability_policy.to_dict()
- if hasattr(self, 'default_trusted_profile') and self.default_trusted_profile is not None:
- if isinstance(self.default_trusted_profile, dict):
- _dict['default_trusted_profile'] = self.default_trusted_profile
- else:
- _dict['default_trusted_profile'] = self.default_trusted_profile.to_dict()
- if hasattr(self, 'keys') and self.keys is not None:
- keys_list = []
- for v in self.keys:
- if isinstance(v, dict):
- keys_list.append(v)
- else:
- keys_list.append(v.to_dict())
- _dict['keys'] = keys_list
- if hasattr(self, 'metadata_service') and self.metadata_service is not None:
- if isinstance(self.metadata_service, dict):
- _dict['metadata_service'] = self.metadata_service
+ if hasattr(self, 'deleted') and self.deleted is not None:
+ if isinstance(self.deleted, dict):
+ _dict['deleted'] = self.deleted
else:
- _dict['metadata_service'] = self.metadata_service.to_dict()
+ _dict['deleted'] = self.deleted.to_dict()
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
+ if hasattr(self, 'id') and self.id is not None:
+ _dict['id'] = self.id
if hasattr(self, 'name') and self.name is not None:
_dict['name'] = self.name
- if hasattr(self, 'placement_target') and self.placement_target is not None:
- if isinstance(self.placement_target, dict):
- _dict['placement_target'] = self.placement_target
- else:
- _dict['placement_target'] = self.placement_target.to_dict()
- if hasattr(self, 'profile') and self.profile is not None:
- if isinstance(self.profile, dict):
- _dict['profile'] = self.profile
- else:
- _dict['profile'] = self.profile.to_dict()
- if hasattr(self, 'resource_group') and self.resource_group is not None:
- if isinstance(self.resource_group, dict):
- _dict['resource_group'] = self.resource_group
- else:
- _dict['resource_group'] = self.resource_group.to_dict()
- if hasattr(self, 'total_volume_bandwidth') and self.total_volume_bandwidth is not None:
- _dict['total_volume_bandwidth'] = self.total_volume_bandwidth
- if hasattr(self, 'user_data') and self.user_data is not None:
- _dict['user_data'] = self.user_data
- if hasattr(self, 'volume_attachments') and self.volume_attachments is not None:
- volume_attachments_list = []
- for v in self.volume_attachments:
- if isinstance(v, dict):
- volume_attachments_list.append(v)
- else:
- volume_attachments_list.append(v.to_dict())
- _dict['volume_attachments'] = volume_attachments_list
- if hasattr(self, 'vpc') and self.vpc is not None:
- if isinstance(self.vpc, dict):
- _dict['vpc'] = self.vpc
- else:
- _dict['vpc'] = self.vpc.to_dict()
- if hasattr(self, 'boot_volume_attachment') and self.boot_volume_attachment is not None:
- if isinstance(self.boot_volume_attachment, dict):
- _dict['boot_volume_attachment'] = self.boot_volume_attachment
- else:
- _dict['boot_volume_attachment'] = self.boot_volume_attachment.to_dict()
- if hasattr(self, 'image') and self.image is not None:
- if isinstance(self.image, dict):
- _dict['image'] = self.image
- else:
- _dict['image'] = self.image.to_dict()
- if hasattr(self, 'network_interfaces') and self.network_interfaces is not None:
- network_interfaces_list = []
- for v in self.network_interfaces:
- if isinstance(v, dict):
- network_interfaces_list.append(v)
- else:
- network_interfaces_list.append(v.to_dict())
- _dict['network_interfaces'] = network_interfaces_list
- if hasattr(self, 'primary_network_interface') and self.primary_network_interface is not None:
- if isinstance(self.primary_network_interface, dict):
- _dict['primary_network_interface'] = self.primary_network_interface
+ if hasattr(self, 'primary_ip') and self.primary_ip is not None:
+ if isinstance(self.primary_ip, dict):
+ _dict['primary_ip'] = self.primary_ip
else:
- _dict['primary_network_interface'] = self.primary_network_interface.to_dict()
- if hasattr(self, 'zone') and self.zone is not None:
- if isinstance(self.zone, dict):
- _dict['zone'] = self.zone
+ _dict['primary_ip'] = self.primary_ip.to_dict()
+ if hasattr(self, 'resource_type') and self.resource_type is not None:
+ _dict['resource_type'] = self.resource_type
+ if hasattr(self, 'subnet') and self.subnet is not None:
+ if isinstance(self.subnet, dict):
+ _dict['subnet'] = self.subnet
else:
- _dict['zone'] = self.zone.to_dict()
+ _dict['subnet'] = self.subnet.to_dict()
return _dict
def _to_dict(self):
@@ -103292,316 +107551,115 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this InstanceTemplatePrototypeInstanceTemplateByImage object."""
+ """Return a `str` version of this FlowLogCollectorTargetInstanceNetworkAttachmentReference object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceTemplatePrototypeInstanceTemplateByImage') -> bool:
+ def __eq__(self, other: 'FlowLogCollectorTargetInstanceNetworkAttachmentReference') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'InstanceTemplatePrototypeInstanceTemplateByImage') -> bool:
+ def __ne__(self, other: 'FlowLogCollectorTargetInstanceNetworkAttachmentReference') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
+ class ResourceTypeEnum(str, Enum):
+ """
+ The resource type.
+ """
-class InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot(InstanceTemplatePrototype):
+ INSTANCE_NETWORK_ATTACHMENT = 'instance_network_attachment'
+
+
+
+class FlowLogCollectorTargetInstanceReference(FlowLogCollectorTarget):
"""
- Create an instance template that creates instances by using a snapshot.
+ FlowLogCollectorTargetInstanceReference.
- :attr InstanceAvailabilityPolicyPrototype availability_policy: (optional) The
- availability policy to use for this virtual server instance.
- :attr InstanceDefaultTrustedProfilePrototype default_trusted_profile: (optional)
- The default trusted profile configuration to use for this virtual server
- instance
- This property's value is used when provisioning the virtual server instance, but
- not subsequently managed. Accordingly, it is reflected as an [instance
- initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
- property.
- :attr List[KeyIdentity] keys: (optional) The public SSH keys for the
- administrative user of the virtual server instance. Keys will be made available
- to the virtual server instance as cloud-init vendor data. For cloud-init enabled
- images, these keys will also be added as SSH authorized keys for the
- administrative user.
- For Windows images, the keys of type `rsa` must be specified, and one will be
- selected to encrypt [the administrator
- password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys
- are optional for other images, but if no keys are specified, the instance will
- be inaccessible unless the specified image provides another means of access.
- This property's value is used when provisioning the virtual server instance, but
- not subsequently managed. Accordingly, it is reflected as an [instance
- initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
- property.
- :attr InstanceMetadataServicePrototype metadata_service: (optional)
- :attr str name: (optional) The name for this instance template. The name must
- not be used by another instance template in the region. If unspecified, the name
- will be a hyphenated list of randomly-selected words.
- :attr InstancePlacementTargetPrototype placement_target: (optional) The
- placement restrictions to use for the virtual server instance.
- :attr InstanceProfileIdentity profile: (optional) The
- [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this
- virtual server instance.
- If unspecified, `bx2-2x8` will be used, but this default value is expected to
- change in the future.
- :attr ResourceGroupIdentity resource_group: (optional)
- :attr int total_volume_bandwidth: (optional) The amount of bandwidth (in
- megabits per second) allocated exclusively to instance storage volumes. An
- increase in this value will result in a corresponding decrease to
- `total_network_bandwidth`.
- :attr str user_data: (optional) [User
- data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when
- setting up the virtual server instance.
- :attr List[VolumeAttachmentPrototype] volume_attachments: (optional) The
- additional volume attachments to create for the virtual server instance.
- :attr VPCIdentity vpc: (optional) The VPC this virtual server instance will
- reside in.
- If specified, it must match the VPC for the subnets of the instance network
- interfaces.
- :attr VolumeAttachmentPrototypeInstanceBySourceSnapshotContext
- boot_volume_attachment: The boot volume attachment to create for the virtual
- server instance.
- :attr List[NetworkInterfacePrototype] network_interfaces: (optional) The
- additional instance network interfaces to create.
- :attr NetworkInterfacePrototype primary_network_interface: The primary instance
- network interface to create.
- :attr ZoneIdentity zone: The zone this virtual server instance will reside in.
+ :param str crn: The CRN for this virtual server instance.
+ :param InstanceReferenceDeleted 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 virtual server instance.
+ :param str id: The unique identifier for this virtual server instance.
+ :param str name: The name for this virtual server instance. The name is unique
+ across all virtual server instances in the region.
"""
def __init__(
self,
- boot_volume_attachment: 'VolumeAttachmentPrototypeInstanceBySourceSnapshotContext',
- primary_network_interface: 'NetworkInterfacePrototype',
- zone: 'ZoneIdentity',
+ crn: str,
+ href: str,
+ id: str,
+ name: str,
*,
- availability_policy: 'InstanceAvailabilityPolicyPrototype' = None,
- default_trusted_profile: 'InstanceDefaultTrustedProfilePrototype' = None,
- keys: List['KeyIdentity'] = None,
- metadata_service: 'InstanceMetadataServicePrototype' = None,
- name: str = None,
- placement_target: 'InstancePlacementTargetPrototype' = None,
- profile: 'InstanceProfileIdentity' = None,
- resource_group: 'ResourceGroupIdentity' = None,
- total_volume_bandwidth: int = None,
- user_data: str = None,
- volume_attachments: List['VolumeAttachmentPrototype'] = None,
- vpc: 'VPCIdentity' = None,
- network_interfaces: List['NetworkInterfacePrototype'] = None,
+ deleted: Optional['InstanceReferenceDeleted'] = None,
) -> None:
"""
- Initialize a InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot object.
+ Initialize a FlowLogCollectorTargetInstanceReference object.
- :param VolumeAttachmentPrototypeInstanceBySourceSnapshotContext
- boot_volume_attachment: The boot volume attachment to create for the
- virtual server instance.
- :param NetworkInterfacePrototype primary_network_interface: The primary
- instance network interface to create.
- :param ZoneIdentity zone: The zone this virtual server instance will reside
- in.
- :param InstanceAvailabilityPolicyPrototype availability_policy: (optional)
- The availability policy to use for this virtual server instance.
- :param InstanceDefaultTrustedProfilePrototype default_trusted_profile:
- (optional) The default trusted profile configuration to use for this
- virtual server instance
- This property's value is used when provisioning the virtual server
- instance, but not subsequently managed. Accordingly, it is reflected as an
- [instance
- initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
- property.
- :param List[KeyIdentity] keys: (optional) The public SSH keys for the
- administrative user of the virtual server instance. Keys will be made
- available to the virtual server instance as cloud-init vendor data. For
- cloud-init enabled images, these keys will also be added as SSH authorized
- keys for the administrative user.
- For Windows images, the keys of type `rsa` must be specified, and one will
- be selected to encrypt [the administrator
- password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization).
- Keys are optional for other images, but if no keys are specified, the
- instance will be inaccessible unless the specified image provides another
- means of access.
- This property's value is used when provisioning the virtual server
- instance, but not subsequently managed. Accordingly, it is reflected as an
- [instance
- initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
- property.
- :param InstanceMetadataServicePrototype metadata_service: (optional)
- :param str name: (optional) The name for this instance template. The name
- must not be used by another instance template in the region. If
- unspecified, the name will be a hyphenated list of randomly-selected words.
- :param InstancePlacementTargetPrototype placement_target: (optional) The
- placement restrictions to use for the virtual server instance.
- :param InstanceProfileIdentity profile: (optional) The
- [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for
- this virtual server instance.
- If unspecified, `bx2-2x8` will be used, but this default value is expected
- to change in the future.
- :param ResourceGroupIdentity resource_group: (optional)
- :param int total_volume_bandwidth: (optional) The amount of bandwidth (in
- megabits per second) allocated exclusively to instance storage volumes. An
- increase in this value will result in a corresponding decrease to
- `total_network_bandwidth`.
- :param str user_data: (optional) [User
- data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available
- when setting up the virtual server instance.
- :param List[VolumeAttachmentPrototype] volume_attachments: (optional) The
- additional volume attachments to create for the virtual server instance.
- :param VPCIdentity vpc: (optional) The VPC this virtual server instance
- will reside in.
- If specified, it must match the VPC for the subnets of the instance network
- interfaces.
- :param List[NetworkInterfacePrototype] network_interfaces: (optional) The
- additional instance network interfaces to create.
+ :param str crn: The CRN for this virtual server instance.
+ :param str href: The URL for this virtual server instance.
+ :param str id: The unique identifier for this virtual server instance.
+ :param str name: The name for this virtual server instance. The name is
+ unique across all virtual server instances in the region.
+ :param InstanceReferenceDeleted deleted: (optional) If present, this
+ property indicates the referenced resource has been deleted, and provides
+ some supplementary information.
"""
# pylint: disable=super-init-not-called
- self.availability_policy = availability_policy
- self.default_trusted_profile = default_trusted_profile
- self.keys = keys
- self.metadata_service = metadata_service
+ self.crn = crn
+ self.deleted = deleted
+ self.href = href
+ self.id = id
self.name = name
- self.placement_target = placement_target
- self.profile = profile
- self.resource_group = resource_group
- self.total_volume_bandwidth = total_volume_bandwidth
- self.user_data = user_data
- self.volume_attachments = volume_attachments
- self.vpc = vpc
- self.boot_volume_attachment = boot_volume_attachment
- self.network_interfaces = network_interfaces
- self.primary_network_interface = primary_network_interface
- self.zone = zone
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot':
- """Initialize a InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'FlowLogCollectorTargetInstanceReference':
+ """Initialize a FlowLogCollectorTargetInstanceReference object from a json dictionary."""
args = {}
- if 'availability_policy' in _dict:
- args['availability_policy'] = InstanceAvailabilityPolicyPrototype.from_dict(_dict.get('availability_policy'))
- if 'default_trusted_profile' in _dict:
- args['default_trusted_profile'] = InstanceDefaultTrustedProfilePrototype.from_dict(_dict.get('default_trusted_profile'))
- if 'keys' in _dict:
- args['keys'] = _dict.get('keys')
- if 'metadata_service' in _dict:
- args['metadata_service'] = InstanceMetadataServicePrototype.from_dict(_dict.get('metadata_service'))
- if 'name' in _dict:
- args['name'] = _dict.get('name')
- if 'placement_target' in _dict:
- args['placement_target'] = _dict.get('placement_target')
- if 'profile' in _dict:
- args['profile'] = _dict.get('profile')
- if 'resource_group' in _dict:
- args['resource_group'] = _dict.get('resource_group')
- if 'total_volume_bandwidth' in _dict:
- args['total_volume_bandwidth'] = _dict.get('total_volume_bandwidth')
- if 'user_data' in _dict:
- args['user_data'] = _dict.get('user_data')
- if 'volume_attachments' in _dict:
- args['volume_attachments'] = [VolumeAttachmentPrototype.from_dict(v) for v in _dict.get('volume_attachments')]
- if 'vpc' in _dict:
- args['vpc'] = _dict.get('vpc')
- if 'boot_volume_attachment' in _dict:
- args['boot_volume_attachment'] = VolumeAttachmentPrototypeInstanceBySourceSnapshotContext.from_dict(_dict.get('boot_volume_attachment'))
+ if (crn := _dict.get('crn')) is not None:
+ args['crn'] = crn
+ else:
+ raise ValueError('Required property \'crn\' not present in FlowLogCollectorTargetInstanceReference JSON')
+ if (deleted := _dict.get('deleted')) is not None:
+ args['deleted'] = InstanceReferenceDeleted.from_dict(deleted)
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'boot_volume_attachment\' not present in InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot JSON')
- if 'network_interfaces' in _dict:
- args['network_interfaces'] = [NetworkInterfacePrototype.from_dict(v) for v in _dict.get('network_interfaces')]
- if 'primary_network_interface' in _dict:
- args['primary_network_interface'] = NetworkInterfacePrototype.from_dict(_dict.get('primary_network_interface'))
+ raise ValueError('Required property \'href\' not present in FlowLogCollectorTargetInstanceReference JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
else:
- raise ValueError('Required property \'primary_network_interface\' not present in InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot JSON')
- if 'zone' in _dict:
- args['zone'] = _dict.get('zone')
+ raise ValueError('Required property \'id\' not present in FlowLogCollectorTargetInstanceReference JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
else:
- raise ValueError('Required property \'zone\' not present in InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot JSON')
+ raise ValueError('Required property \'name\' not present in FlowLogCollectorTargetInstanceReference JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot object from a json dictionary."""
+ """Initialize a FlowLogCollectorTargetInstanceReference object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'availability_policy') and self.availability_policy is not None:
- if isinstance(self.availability_policy, dict):
- _dict['availability_policy'] = self.availability_policy
- else:
- _dict['availability_policy'] = self.availability_policy.to_dict()
- if hasattr(self, 'default_trusted_profile') and self.default_trusted_profile is not None:
- if isinstance(self.default_trusted_profile, dict):
- _dict['default_trusted_profile'] = self.default_trusted_profile
- else:
- _dict['default_trusted_profile'] = self.default_trusted_profile.to_dict()
- if hasattr(self, 'keys') and self.keys is not None:
- keys_list = []
- for v in self.keys:
- if isinstance(v, dict):
- keys_list.append(v)
- else:
- keys_list.append(v.to_dict())
- _dict['keys'] = keys_list
- if hasattr(self, 'metadata_service') and self.metadata_service is not None:
- if isinstance(self.metadata_service, dict):
- _dict['metadata_service'] = self.metadata_service
+ if hasattr(self, 'crn') and self.crn is not None:
+ _dict['crn'] = self.crn
+ if hasattr(self, 'deleted') and self.deleted is not None:
+ if isinstance(self.deleted, dict):
+ _dict['deleted'] = self.deleted
else:
- _dict['metadata_service'] = self.metadata_service.to_dict()
+ _dict['deleted'] = self.deleted.to_dict()
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
+ if hasattr(self, 'id') and self.id is not None:
+ _dict['id'] = self.id
if hasattr(self, 'name') and self.name is not None:
_dict['name'] = self.name
- if hasattr(self, 'placement_target') and self.placement_target is not None:
- if isinstance(self.placement_target, dict):
- _dict['placement_target'] = self.placement_target
- else:
- _dict['placement_target'] = self.placement_target.to_dict()
- if hasattr(self, 'profile') and self.profile is not None:
- if isinstance(self.profile, dict):
- _dict['profile'] = self.profile
- else:
- _dict['profile'] = self.profile.to_dict()
- if hasattr(self, 'resource_group') and self.resource_group is not None:
- if isinstance(self.resource_group, dict):
- _dict['resource_group'] = self.resource_group
- else:
- _dict['resource_group'] = self.resource_group.to_dict()
- if hasattr(self, 'total_volume_bandwidth') and self.total_volume_bandwidth is not None:
- _dict['total_volume_bandwidth'] = self.total_volume_bandwidth
- if hasattr(self, 'user_data') and self.user_data is not None:
- _dict['user_data'] = self.user_data
- if hasattr(self, 'volume_attachments') and self.volume_attachments is not None:
- volume_attachments_list = []
- for v in self.volume_attachments:
- if isinstance(v, dict):
- volume_attachments_list.append(v)
- else:
- volume_attachments_list.append(v.to_dict())
- _dict['volume_attachments'] = volume_attachments_list
- if hasattr(self, 'vpc') and self.vpc is not None:
- if isinstance(self.vpc, dict):
- _dict['vpc'] = self.vpc
- else:
- _dict['vpc'] = self.vpc.to_dict()
- if hasattr(self, 'boot_volume_attachment') and self.boot_volume_attachment is not None:
- if isinstance(self.boot_volume_attachment, dict):
- _dict['boot_volume_attachment'] = self.boot_volume_attachment
- else:
- _dict['boot_volume_attachment'] = self.boot_volume_attachment.to_dict()
- if hasattr(self, 'network_interfaces') and self.network_interfaces is not None:
- network_interfaces_list = []
- for v in self.network_interfaces:
- if isinstance(v, dict):
- network_interfaces_list.append(v)
- else:
- network_interfaces_list.append(v.to_dict())
- _dict['network_interfaces'] = network_interfaces_list
- if hasattr(self, 'primary_network_interface') and self.primary_network_interface is not None:
- if isinstance(self.primary_network_interface, dict):
- _dict['primary_network_interface'] = self.primary_network_interface
- else:
- _dict['primary_network_interface'] = self.primary_network_interface.to_dict()
- if hasattr(self, 'zone') and self.zone is not None:
- if isinstance(self.zone, dict):
- _dict['zone'] = self.zone
- else:
- _dict['zone'] = self.zone.to_dict()
return _dict
def _to_dict(self):
@@ -103609,367 +107667,126 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot object."""
+ """Return a `str` version of this FlowLogCollectorTargetInstanceReference object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot') -> bool:
+ def __eq__(self, other: 'FlowLogCollectorTargetInstanceReference') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot') -> bool:
+ def __ne__(self, other: 'FlowLogCollectorTargetInstanceReference') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class InstanceTemplatePrototypeInstanceTemplateBySourceTemplate(InstanceTemplatePrototype):
+class FlowLogCollectorTargetNetworkInterfaceReferenceTargetContext(FlowLogCollectorTarget):
"""
- Create an instance template from an existing instance template.
+ FlowLogCollectorTargetNetworkInterfaceReferenceTargetContext.
- :attr InstanceAvailabilityPolicyPrototype availability_policy: (optional) The
- availability policy to use for this virtual server instance.
- :attr InstanceDefaultTrustedProfilePrototype default_trusted_profile: (optional)
- The default trusted profile configuration to use for this virtual server
- instance
- This property's value is used when provisioning the virtual server instance, but
- not subsequently managed. Accordingly, it is reflected as an [instance
- initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
- property.
- :attr List[KeyIdentity] keys: (optional) The public SSH keys for the
- administrative user of the virtual server instance. Keys will be made available
- to the virtual server instance as cloud-init vendor data. For cloud-init enabled
- images, these keys will also be added as SSH authorized keys for the
- administrative user.
- For Windows images, the keys of type `rsa` must be specified, and one will be
- selected to encrypt [the administrator
- password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys
- are optional for other images, but if no keys are specified, the instance will
- be inaccessible unless the specified image provides another means of access.
- This property's value is used when provisioning the virtual server instance, but
- not subsequently managed. Accordingly, it is reflected as an [instance
- initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
- property.
- :attr InstanceMetadataServicePrototype metadata_service: (optional)
- :attr str name: (optional) The name for this instance template. The name must
- not be used by another instance template in the region. If unspecified, the name
- will be a hyphenated list of randomly-selected words.
- :attr InstancePlacementTargetPrototype placement_target: (optional) The
- placement restrictions to use for the virtual server instance.
- :attr InstanceProfileIdentity profile: (optional) The
- [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this
- virtual server instance.
- If unspecified, `bx2-2x8` will be used, but this default value is expected to
- change in the future.
- :attr ResourceGroupIdentity resource_group: (optional)
- :attr int total_volume_bandwidth: (optional) The amount of bandwidth (in
- megabits per second) allocated exclusively to instance storage volumes. An
- increase in this value will result in a corresponding decrease to
- `total_network_bandwidth`.
- :attr str user_data: (optional) [User
- data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when
- setting up the virtual server instance.
- :attr List[VolumeAttachmentPrototype] volume_attachments: (optional) The
- additional volume attachments to create for the virtual server instance.
- :attr VPCIdentity vpc: (optional) The VPC this virtual server instance will
- reside in.
- If specified, it must match the VPC for the subnets of the instance network
- interfaces.
- :attr VolumeAttachmentPrototypeInstanceByImageContext boot_volume_attachment:
- (optional) The boot volume attachment to create for the virtual server instance.
- :attr InstanceCatalogOfferingPrototype catalog_offering: (optional) The
- [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user)
- offering version to use when provisioning this virtual server instance.
- If an offering is specified, the latest version of that offering will be used.
- The specified offering or offering version may be in a different account,
- subject to
- IAM policies.
- If specified, `image` must not be specified, and `source_template` must not have
- `image` specified.
- :attr ImageIdentity image: (optional) The image to use when provisioning the
- virtual server instance.
- :attr List[NetworkInterfacePrototype] network_interfaces: (optional) The
- additional instance network interfaces to create.
- :attr NetworkInterfacePrototype primary_network_interface: (optional) The
- primary instance network interface to create.
- :attr InstanceTemplateIdentity source_template: The template to create this
- virtual server instance from.
- :attr ZoneIdentity zone: (optional) The zone this virtual server instance will
- reside in.
+ :param NetworkInterfaceReferenceTargetContextDeleted 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 instance network interface.
+ If this instance has network attachments, this network interface is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment.
+ :param str id: The unique identifier for this instance network interface.
+ If this instance has network attachments, this network interface is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and the identifier is that of the corresponding network attachment.
+ :param str name: The name for this instance network interface.
+ :param str resource_type: The resource type.
"""
def __init__(
self,
- source_template: 'InstanceTemplateIdentity',
+ href: str,
+ id: str,
+ name: str,
+ resource_type: str,
*,
- availability_policy: 'InstanceAvailabilityPolicyPrototype' = None,
- default_trusted_profile: 'InstanceDefaultTrustedProfilePrototype' = None,
- keys: List['KeyIdentity'] = None,
- metadata_service: 'InstanceMetadataServicePrototype' = None,
- name: str = None,
- placement_target: 'InstancePlacementTargetPrototype' = None,
- profile: 'InstanceProfileIdentity' = None,
- resource_group: 'ResourceGroupIdentity' = None,
- total_volume_bandwidth: int = None,
- user_data: str = None,
- volume_attachments: List['VolumeAttachmentPrototype'] = None,
- vpc: 'VPCIdentity' = None,
- boot_volume_attachment: 'VolumeAttachmentPrototypeInstanceByImageContext' = None,
- catalog_offering: 'InstanceCatalogOfferingPrototype' = None,
- image: 'ImageIdentity' = None,
- network_interfaces: List['NetworkInterfacePrototype'] = None,
- primary_network_interface: 'NetworkInterfacePrototype' = None,
- zone: 'ZoneIdentity' = None,
+ deleted: Optional['NetworkInterfaceReferenceTargetContextDeleted'] = None,
) -> None:
"""
- Initialize a InstanceTemplatePrototypeInstanceTemplateBySourceTemplate object.
+ Initialize a FlowLogCollectorTargetNetworkInterfaceReferenceTargetContext object.
- :param InstanceTemplateIdentity source_template: The template to create
- this virtual server instance from.
- :param InstanceAvailabilityPolicyPrototype availability_policy: (optional)
- The availability policy to use for this virtual server instance.
- :param InstanceDefaultTrustedProfilePrototype default_trusted_profile:
- (optional) The default trusted profile configuration to use for this
- virtual server instance
- This property's value is used when provisioning the virtual server
- instance, but not subsequently managed. Accordingly, it is reflected as an
- [instance
- initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
- property.
- :param List[KeyIdentity] keys: (optional) The public SSH keys for the
- administrative user of the virtual server instance. Keys will be made
- available to the virtual server instance as cloud-init vendor data. For
- cloud-init enabled images, these keys will also be added as SSH authorized
- keys for the administrative user.
- For Windows images, the keys of type `rsa` must be specified, and one will
- be selected to encrypt [the administrator
- password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization).
- Keys are optional for other images, but if no keys are specified, the
- instance will be inaccessible unless the specified image provides another
- means of access.
- This property's value is used when provisioning the virtual server
- instance, but not subsequently managed. Accordingly, it is reflected as an
- [instance
- initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
- property.
- :param InstanceMetadataServicePrototype metadata_service: (optional)
- :param str name: (optional) The name for this instance template. The name
- must not be used by another instance template in the region. If
- unspecified, the name will be a hyphenated list of randomly-selected words.
- :param InstancePlacementTargetPrototype placement_target: (optional) The
- placement restrictions to use for the virtual server instance.
- :param InstanceProfileIdentity profile: (optional) The
- [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for
- this virtual server instance.
- If unspecified, `bx2-2x8` will be used, but this default value is expected
- to change in the future.
- :param ResourceGroupIdentity resource_group: (optional)
- :param int total_volume_bandwidth: (optional) The amount of bandwidth (in
- megabits per second) allocated exclusively to instance storage volumes. An
- increase in this value will result in a corresponding decrease to
- `total_network_bandwidth`.
- :param str user_data: (optional) [User
- data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available
- when setting up the virtual server instance.
- :param List[VolumeAttachmentPrototype] volume_attachments: (optional) The
- additional volume attachments to create for the virtual server instance.
- :param VPCIdentity vpc: (optional) The VPC this virtual server instance
- will reside in.
- If specified, it must match the VPC for the subnets of the instance network
- interfaces.
- :param VolumeAttachmentPrototypeInstanceByImageContext
- boot_volume_attachment: (optional) The boot volume attachment to create for
- the virtual server instance.
- :param InstanceCatalogOfferingPrototype catalog_offering: (optional) The
- [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user)
- offering version to use when provisioning this virtual server instance.
- If an offering is specified, the latest version of that offering will be
- used.
- The specified offering or offering version may be in a different account,
- subject to
- IAM policies.
- If specified, `image` must not be specified, and `source_template` must not
- have
- `image` specified.
- :param ImageIdentity image: (optional) The image to use when provisioning
- the virtual server instance.
- :param List[NetworkInterfacePrototype] network_interfaces: (optional) The
- additional instance network interfaces to create.
- :param NetworkInterfacePrototype primary_network_interface: (optional) The
- primary instance network interface to create.
- :param ZoneIdentity zone: (optional) The zone this virtual server instance
- will reside in.
+ :param str href: The URL for this instance network interface.
+ If this instance has network attachments, this network interface is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment.
+ :param str id: The unique identifier for this instance network interface.
+ If this instance has network attachments, this network interface is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and the identifier is that of the corresponding network
+ attachment.
+ :param str name: The name for this instance network interface.
+ :param str resource_type: The resource type.
+ :param NetworkInterfaceReferenceTargetContextDeleted deleted: (optional) If
+ present, this property indicates the referenced resource has been deleted,
+ and provides
+ some supplementary information.
"""
# pylint: disable=super-init-not-called
- self.availability_policy = availability_policy
- self.default_trusted_profile = default_trusted_profile
- self.keys = keys
- self.metadata_service = metadata_service
+ self.deleted = deleted
+ self.href = href
+ self.id = id
self.name = name
- self.placement_target = placement_target
- self.profile = profile
- self.resource_group = resource_group
- self.total_volume_bandwidth = total_volume_bandwidth
- self.user_data = user_data
- self.volume_attachments = volume_attachments
- self.vpc = vpc
- self.boot_volume_attachment = boot_volume_attachment
- self.catalog_offering = catalog_offering
- self.image = image
- self.network_interfaces = network_interfaces
- self.primary_network_interface = primary_network_interface
- self.source_template = source_template
- self.zone = zone
+ self.resource_type = resource_type
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstanceTemplatePrototypeInstanceTemplateBySourceTemplate':
- """Initialize a InstanceTemplatePrototypeInstanceTemplateBySourceTemplate object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'FlowLogCollectorTargetNetworkInterfaceReferenceTargetContext':
+ """Initialize a FlowLogCollectorTargetNetworkInterfaceReferenceTargetContext object from a json dictionary."""
args = {}
- if 'availability_policy' in _dict:
- args['availability_policy'] = InstanceAvailabilityPolicyPrototype.from_dict(_dict.get('availability_policy'))
- if 'default_trusted_profile' in _dict:
- args['default_trusted_profile'] = InstanceDefaultTrustedProfilePrototype.from_dict(_dict.get('default_trusted_profile'))
- if 'keys' in _dict:
- args['keys'] = _dict.get('keys')
- if 'metadata_service' in _dict:
- args['metadata_service'] = InstanceMetadataServicePrototype.from_dict(_dict.get('metadata_service'))
- if 'name' in _dict:
- args['name'] = _dict.get('name')
- if 'placement_target' in _dict:
- args['placement_target'] = _dict.get('placement_target')
- if 'profile' in _dict:
- args['profile'] = _dict.get('profile')
- if 'resource_group' in _dict:
- args['resource_group'] = _dict.get('resource_group')
- if 'total_volume_bandwidth' in _dict:
- args['total_volume_bandwidth'] = _dict.get('total_volume_bandwidth')
- if 'user_data' in _dict:
- args['user_data'] = _dict.get('user_data')
- if 'volume_attachments' in _dict:
- args['volume_attachments'] = [VolumeAttachmentPrototype.from_dict(v) for v in _dict.get('volume_attachments')]
- if 'vpc' in _dict:
- args['vpc'] = _dict.get('vpc')
- if 'boot_volume_attachment' in _dict:
- args['boot_volume_attachment'] = VolumeAttachmentPrototypeInstanceByImageContext.from_dict(_dict.get('boot_volume_attachment'))
- if 'catalog_offering' in _dict:
- args['catalog_offering'] = _dict.get('catalog_offering')
- if 'image' in _dict:
- args['image'] = _dict.get('image')
- if 'network_interfaces' in _dict:
- args['network_interfaces'] = [NetworkInterfacePrototype.from_dict(v) for v in _dict.get('network_interfaces')]
- if 'primary_network_interface' in _dict:
- args['primary_network_interface'] = NetworkInterfacePrototype.from_dict(_dict.get('primary_network_interface'))
- if 'source_template' in _dict:
- args['source_template'] = _dict.get('source_template')
+ if (deleted := _dict.get('deleted')) is not None:
+ args['deleted'] = NetworkInterfaceReferenceTargetContextDeleted.from_dict(deleted)
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'source_template\' not present in InstanceTemplatePrototypeInstanceTemplateBySourceTemplate JSON')
- if 'zone' in _dict:
- args['zone'] = _dict.get('zone')
+ raise ValueError('Required property \'href\' not present in FlowLogCollectorTargetNetworkInterfaceReferenceTargetContext JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
+ else:
+ raise ValueError('Required property \'id\' not present in FlowLogCollectorTargetNetworkInterfaceReferenceTargetContext JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ else:
+ raise ValueError('Required property \'name\' not present in FlowLogCollectorTargetNetworkInterfaceReferenceTargetContext JSON')
+ if (resource_type := _dict.get('resource_type')) is not None:
+ args['resource_type'] = resource_type
+ else:
+ raise ValueError('Required property \'resource_type\' not present in FlowLogCollectorTargetNetworkInterfaceReferenceTargetContext JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceTemplatePrototypeInstanceTemplateBySourceTemplate object from a json dictionary."""
+ """Initialize a FlowLogCollectorTargetNetworkInterfaceReferenceTargetContext object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'availability_policy') and self.availability_policy is not None:
- if isinstance(self.availability_policy, dict):
- _dict['availability_policy'] = self.availability_policy
- else:
- _dict['availability_policy'] = self.availability_policy.to_dict()
- if hasattr(self, 'default_trusted_profile') and self.default_trusted_profile is not None:
- if isinstance(self.default_trusted_profile, dict):
- _dict['default_trusted_profile'] = self.default_trusted_profile
- else:
- _dict['default_trusted_profile'] = self.default_trusted_profile.to_dict()
- if hasattr(self, 'keys') and self.keys is not None:
- keys_list = []
- for v in self.keys:
- if isinstance(v, dict):
- keys_list.append(v)
- else:
- keys_list.append(v.to_dict())
- _dict['keys'] = keys_list
- if hasattr(self, 'metadata_service') and self.metadata_service is not None:
- if isinstance(self.metadata_service, dict):
- _dict['metadata_service'] = self.metadata_service
+ if hasattr(self, 'deleted') and self.deleted is not None:
+ if isinstance(self.deleted, dict):
+ _dict['deleted'] = self.deleted
else:
- _dict['metadata_service'] = self.metadata_service.to_dict()
+ _dict['deleted'] = self.deleted.to_dict()
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
+ if hasattr(self, 'id') and self.id is not None:
+ _dict['id'] = self.id
if hasattr(self, 'name') and self.name is not None:
_dict['name'] = self.name
- if hasattr(self, 'placement_target') and self.placement_target is not None:
- if isinstance(self.placement_target, dict):
- _dict['placement_target'] = self.placement_target
- else:
- _dict['placement_target'] = self.placement_target.to_dict()
- if hasattr(self, 'profile') and self.profile is not None:
- if isinstance(self.profile, dict):
- _dict['profile'] = self.profile
- else:
- _dict['profile'] = self.profile.to_dict()
- if hasattr(self, 'resource_group') and self.resource_group is not None:
- if isinstance(self.resource_group, dict):
- _dict['resource_group'] = self.resource_group
- else:
- _dict['resource_group'] = self.resource_group.to_dict()
- if hasattr(self, 'total_volume_bandwidth') and self.total_volume_bandwidth is not None:
- _dict['total_volume_bandwidth'] = self.total_volume_bandwidth
- if hasattr(self, 'user_data') and self.user_data is not None:
- _dict['user_data'] = self.user_data
- if hasattr(self, 'volume_attachments') and self.volume_attachments is not None:
- volume_attachments_list = []
- for v in self.volume_attachments:
- if isinstance(v, dict):
- volume_attachments_list.append(v)
- else:
- volume_attachments_list.append(v.to_dict())
- _dict['volume_attachments'] = volume_attachments_list
- if hasattr(self, 'vpc') and self.vpc is not None:
- if isinstance(self.vpc, dict):
- _dict['vpc'] = self.vpc
- else:
- _dict['vpc'] = self.vpc.to_dict()
- if hasattr(self, 'boot_volume_attachment') and self.boot_volume_attachment is not None:
- if isinstance(self.boot_volume_attachment, dict):
- _dict['boot_volume_attachment'] = self.boot_volume_attachment
- else:
- _dict['boot_volume_attachment'] = self.boot_volume_attachment.to_dict()
- if hasattr(self, 'catalog_offering') and self.catalog_offering is not None:
- if isinstance(self.catalog_offering, dict):
- _dict['catalog_offering'] = self.catalog_offering
- else:
- _dict['catalog_offering'] = self.catalog_offering.to_dict()
- if hasattr(self, 'image') and self.image is not None:
- if isinstance(self.image, dict):
- _dict['image'] = self.image
- else:
- _dict['image'] = self.image.to_dict()
- if hasattr(self, 'network_interfaces') and self.network_interfaces is not None:
- network_interfaces_list = []
- for v in self.network_interfaces:
- if isinstance(v, dict):
- network_interfaces_list.append(v)
- else:
- network_interfaces_list.append(v.to_dict())
- _dict['network_interfaces'] = network_interfaces_list
- if hasattr(self, 'primary_network_interface') and self.primary_network_interface is not None:
- if isinstance(self.primary_network_interface, dict):
- _dict['primary_network_interface'] = self.primary_network_interface
- else:
- _dict['primary_network_interface'] = self.primary_network_interface.to_dict()
- if hasattr(self, 'source_template') and self.source_template is not None:
- if isinstance(self.source_template, dict):
- _dict['source_template'] = self.source_template
- else:
- _dict['source_template'] = self.source_template.to_dict()
- if hasattr(self, 'zone') and self.zone is not None:
- if isinstance(self.zone, dict):
- _dict['zone'] = self.zone
- else:
- _dict['zone'] = self.zone.to_dict()
+ if hasattr(self, 'resource_type') and self.resource_type is not None:
+ _dict['resource_type'] = self.resource_type
return _dict
def _to_dict(self):
@@ -103977,389 +107794,125 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this InstanceTemplatePrototypeInstanceTemplateBySourceTemplate object."""
+ """Return a `str` version of this FlowLogCollectorTargetNetworkInterfaceReferenceTargetContext object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceTemplatePrototypeInstanceTemplateBySourceTemplate') -> bool:
+ def __eq__(self, other: 'FlowLogCollectorTargetNetworkInterfaceReferenceTargetContext') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'InstanceTemplatePrototypeInstanceTemplateBySourceTemplate') -> bool:
+ def __ne__(self, other: 'FlowLogCollectorTargetNetworkInterfaceReferenceTargetContext') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
+ class ResourceTypeEnum(str, Enum):
+ """
+ The resource type.
+ """
-class InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext(InstanceTemplate):
+ NETWORK_INTERFACE = 'network_interface'
+
+
+
+class FlowLogCollectorTargetSubnetReference(FlowLogCollectorTarget):
"""
- Create an instance by using a catalog offering.
+ FlowLogCollectorTargetSubnetReference.
- :attr InstanceAvailabilityPolicyPrototype availability_policy: (optional) The
- availability policy to use for this virtual server instance.
- :attr datetime created_at: The date and time that the instance template was
- created.
- :attr str crn: The CRN for this instance template.
- :attr InstanceDefaultTrustedProfilePrototype default_trusted_profile: (optional)
- The default trusted profile configuration to use for this virtual server
- instance
- This property's value is used when provisioning the virtual server instance, but
- not subsequently managed. Accordingly, it is reflected as an [instance
- initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
- property.
- :attr str href: The URL for this instance template.
- :attr str id: The unique identifier for this instance template.
- :attr List[KeyIdentity] keys: (optional) The public SSH keys for the
- administrative user of the virtual server instance. Keys will be made available
- to the virtual server instance as cloud-init vendor data. For cloud-init enabled
- images, these keys will also be added as SSH authorized keys for the
- administrative user.
- For Windows images, the keys of type `rsa` must be specified, and one will be
- selected to encrypt [the administrator
- password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys
- are optional for other images, but if no keys are specified, the instance will
- be inaccessible unless the specified image provides another means of access.
- This property's value is used when provisioning the virtual server instance, but
- not subsequently managed. Accordingly, it is reflected as an [instance
- initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
- property.
- :attr InstanceMetadataServicePrototype metadata_service: (optional)
- :attr str name: The name for this instance template. The name is unique across
- all instance templates in the region.
- :attr InstancePlacementTargetPrototype placement_target: (optional) The
- placement restrictions to use for the virtual server instance.
- :attr InstanceProfileIdentity profile: (optional) The
- [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this
- virtual server instance.
- If unspecified, `bx2-2x8` will be used, but this default value is expected to
- change in the future.
- :attr ResourceGroupReference resource_group: The resource group for this
- instance template.
- :attr int total_volume_bandwidth: (optional) The amount of bandwidth (in
- megabits per second) allocated exclusively to instance storage volumes. An
- increase in this value will result in a corresponding decrease to
- `total_network_bandwidth`.
- :attr str user_data: (optional) [User
- data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when
- setting up the virtual server instance.
- :attr List[VolumeAttachmentPrototype] volume_attachments: (optional) The
- additional volume attachments to create for the virtual server instance.
- :attr VPCIdentity vpc: (optional) The VPC this virtual server instance will
- reside in.
- If specified, it must match the VPC for the subnets of the instance network
- interfaces.
- :attr VolumeAttachmentPrototypeInstanceByImageContext boot_volume_attachment:
- (optional) The boot volume attachment to create for the virtual server instance.
- :attr InstanceCatalogOfferingPrototype catalog_offering: The
- [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user)
- offering
- or offering version to use when provisioning this virtual server instance.
- If an offering is specified, the latest version of that offering will be used.
- The specified offering or offering version may be in a different account in the
- same
- [enterprise](https://cloud.ibm.com/docs/account?topic=account-what-is-enterprise),
- subject
- to IAM policies.
- :attr List[NetworkInterfacePrototype] network_interfaces: (optional) The
- additional instance network interfaces to create.
- :attr NetworkInterfacePrototype primary_network_interface: (optional) The
- primary instance network interface to create.
- :attr ZoneIdentity zone: The zone this virtual server instance will reside in.
+ :param str crn: The CRN for this subnet.
+ :param SubnetReferenceDeleted 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 subnet.
+ :param str id: The unique identifier for this subnet.
+ :param str name: The name for this subnet. The name is unique across all subnets
+ in the VPC.
+ :param str resource_type: The resource type.
"""
def __init__(
self,
- created_at: datetime,
crn: str,
href: str,
id: str,
name: str,
- resource_group: 'ResourceGroupReference',
- catalog_offering: 'InstanceCatalogOfferingPrototype',
- zone: 'ZoneIdentity',
+ resource_type: str,
*,
- availability_policy: 'InstanceAvailabilityPolicyPrototype' = None,
- default_trusted_profile: 'InstanceDefaultTrustedProfilePrototype' = None,
- keys: List['KeyIdentity'] = None,
- metadata_service: 'InstanceMetadataServicePrototype' = None,
- placement_target: 'InstancePlacementTargetPrototype' = None,
- profile: 'InstanceProfileIdentity' = None,
- total_volume_bandwidth: int = None,
- user_data: str = None,
- volume_attachments: List['VolumeAttachmentPrototype'] = None,
- vpc: 'VPCIdentity' = None,
- boot_volume_attachment: 'VolumeAttachmentPrototypeInstanceByImageContext' = None,
- network_interfaces: List['NetworkInterfacePrototype'] = None,
- primary_network_interface: 'NetworkInterfacePrototype' = None,
+ deleted: Optional['SubnetReferenceDeleted'] = None,
) -> None:
"""
- Initialize a InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext object.
+ Initialize a FlowLogCollectorTargetSubnetReference object.
- :param datetime created_at: The date and time that the instance template
- was created.
- :param str crn: The CRN for this instance template.
- :param str href: The URL for this instance template.
- :param str id: The unique identifier for this instance template.
- :param str name: The name for this instance template. The name is unique
- across all instance templates in the region.
- :param ResourceGroupReference resource_group: The resource group for this
- instance template.
- :param InstanceCatalogOfferingPrototype catalog_offering: The
- [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user)
- offering
- or offering version to use when provisioning this virtual server instance.
- If an offering is specified, the latest version of that offering will be
- used.
- The specified offering or offering version may be in a different account in
- the same
- [enterprise](https://cloud.ibm.com/docs/account?topic=account-what-is-enterprise),
- subject
- to IAM policies.
- :param ZoneIdentity zone: The zone this virtual server instance will reside
- in.
- :param InstanceAvailabilityPolicyPrototype availability_policy: (optional)
- The availability policy to use for this virtual server instance.
- :param InstanceDefaultTrustedProfilePrototype default_trusted_profile:
- (optional) The default trusted profile configuration to use for this
- virtual server instance
- This property's value is used when provisioning the virtual server
- instance, but not subsequently managed. Accordingly, it is reflected as an
- [instance
- initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
- property.
- :param List[KeyIdentity] keys: (optional) The public SSH keys for the
- administrative user of the virtual server instance. Keys will be made
- available to the virtual server instance as cloud-init vendor data. For
- cloud-init enabled images, these keys will also be added as SSH authorized
- keys for the administrative user.
- For Windows images, the keys of type `rsa` must be specified, and one will
- be selected to encrypt [the administrator
- password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization).
- Keys are optional for other images, but if no keys are specified, the
- instance will be inaccessible unless the specified image provides another
- means of access.
- This property's value is used when provisioning the virtual server
- instance, but not subsequently managed. Accordingly, it is reflected as an
- [instance
- initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
- property.
- :param InstanceMetadataServicePrototype metadata_service: (optional)
- :param InstancePlacementTargetPrototype placement_target: (optional) The
- placement restrictions to use for the virtual server instance.
- :param InstanceProfileIdentity profile: (optional) The
- [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for
- this virtual server instance.
- If unspecified, `bx2-2x8` will be used, but this default value is expected
- to change in the future.
- :param int total_volume_bandwidth: (optional) The amount of bandwidth (in
- megabits per second) allocated exclusively to instance storage volumes. An
- increase in this value will result in a corresponding decrease to
- `total_network_bandwidth`.
- :param str user_data: (optional) [User
- data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available
- when setting up the virtual server instance.
- :param List[VolumeAttachmentPrototype] volume_attachments: (optional) The
- additional volume attachments to create for the virtual server instance.
- :param VPCIdentity vpc: (optional) The VPC this virtual server instance
- will reside in.
- If specified, it must match the VPC for the subnets of the instance network
- interfaces.
- :param VolumeAttachmentPrototypeInstanceByImageContext
- boot_volume_attachment: (optional) The boot volume attachment to create for
- the virtual server instance.
- :param List[NetworkInterfacePrototype] network_interfaces: (optional) The
- additional instance network interfaces to create.
- :param NetworkInterfacePrototype primary_network_interface: (optional) The
- primary instance network interface to create.
+ :param str crn: The CRN for this subnet.
+ :param str href: The URL for this subnet.
+ :param str id: The unique identifier for this subnet.
+ :param str name: The name for this subnet. The name is unique across all
+ subnets in the VPC.
+ :param str resource_type: The resource type.
+ :param SubnetReferenceDeleted deleted: (optional) If present, this property
+ indicates the referenced resource has been deleted, and provides
+ some supplementary information.
"""
# pylint: disable=super-init-not-called
- self.availability_policy = availability_policy
- self.created_at = created_at
self.crn = crn
- self.default_trusted_profile = default_trusted_profile
+ self.deleted = deleted
self.href = href
self.id = id
- self.keys = keys
- self.metadata_service = metadata_service
self.name = name
- self.placement_target = placement_target
- self.profile = profile
- self.resource_group = resource_group
- self.total_volume_bandwidth = total_volume_bandwidth
- self.user_data = user_data
- self.volume_attachments = volume_attachments
- self.vpc = vpc
- self.boot_volume_attachment = boot_volume_attachment
- self.catalog_offering = catalog_offering
- self.network_interfaces = network_interfaces
- self.primary_network_interface = primary_network_interface
- self.zone = zone
+ self.resource_type = resource_type
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext':
- """Initialize a InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'FlowLogCollectorTargetSubnetReference':
+ """Initialize a FlowLogCollectorTargetSubnetReference object from a json dictionary."""
args = {}
- if 'availability_policy' in _dict:
- args['availability_policy'] = InstanceAvailabilityPolicyPrototype.from_dict(_dict.get('availability_policy'))
- if 'created_at' in _dict:
- args['created_at'] = string_to_datetime(_dict.get('created_at'))
- else:
- raise ValueError('Required property \'created_at\' not present in InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext JSON')
- if 'crn' in _dict:
- args['crn'] = _dict.get('crn')
+ if (crn := _dict.get('crn')) is not None:
+ args['crn'] = crn
else:
- raise ValueError('Required property \'crn\' not present in InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext JSON')
- if 'default_trusted_profile' in _dict:
- args['default_trusted_profile'] = InstanceDefaultTrustedProfilePrototype.from_dict(_dict.get('default_trusted_profile'))
- if 'href' in _dict:
- args['href'] = _dict.get('href')
- else:
- raise ValueError('Required property \'href\' not present in InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext JSON')
- if 'id' in _dict:
- args['id'] = _dict.get('id')
- else:
- raise ValueError('Required property \'id\' not present in InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext JSON')
- if 'keys' in _dict:
- args['keys'] = _dict.get('keys')
- if 'metadata_service' in _dict:
- args['metadata_service'] = InstanceMetadataServicePrototype.from_dict(_dict.get('metadata_service'))
- if 'name' in _dict:
- args['name'] = _dict.get('name')
+ raise ValueError('Required property \'crn\' not present in FlowLogCollectorTargetSubnetReference JSON')
+ if (deleted := _dict.get('deleted')) is not None:
+ args['deleted'] = SubnetReferenceDeleted.from_dict(deleted)
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'name\' not present in InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext JSON')
- if 'placement_target' in _dict:
- args['placement_target'] = _dict.get('placement_target')
- if 'profile' in _dict:
- args['profile'] = _dict.get('profile')
- if 'resource_group' in _dict:
- args['resource_group'] = ResourceGroupReference.from_dict(_dict.get('resource_group'))
+ raise ValueError('Required property \'href\' not present in FlowLogCollectorTargetSubnetReference JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
else:
- raise ValueError('Required property \'resource_group\' not present in InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext JSON')
- if 'total_volume_bandwidth' in _dict:
- args['total_volume_bandwidth'] = _dict.get('total_volume_bandwidth')
- if 'user_data' in _dict:
- args['user_data'] = _dict.get('user_data')
- if 'volume_attachments' in _dict:
- args['volume_attachments'] = [VolumeAttachmentPrototype.from_dict(v) for v in _dict.get('volume_attachments')]
- if 'vpc' in _dict:
- args['vpc'] = _dict.get('vpc')
- if 'boot_volume_attachment' in _dict:
- args['boot_volume_attachment'] = VolumeAttachmentPrototypeInstanceByImageContext.from_dict(_dict.get('boot_volume_attachment'))
- if 'catalog_offering' in _dict:
- args['catalog_offering'] = _dict.get('catalog_offering')
+ raise ValueError('Required property \'id\' not present in FlowLogCollectorTargetSubnetReference JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
else:
- raise ValueError('Required property \'catalog_offering\' not present in InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext JSON')
- if 'network_interfaces' in _dict:
- args['network_interfaces'] = [NetworkInterfacePrototype.from_dict(v) for v in _dict.get('network_interfaces')]
- if 'primary_network_interface' in _dict:
- args['primary_network_interface'] = NetworkInterfacePrototype.from_dict(_dict.get('primary_network_interface'))
- if 'zone' in _dict:
- args['zone'] = _dict.get('zone')
+ raise ValueError('Required property \'name\' not present in FlowLogCollectorTargetSubnetReference JSON')
+ if (resource_type := _dict.get('resource_type')) is not None:
+ args['resource_type'] = resource_type
else:
- raise ValueError('Required property \'zone\' not present in InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext JSON')
+ raise ValueError('Required property \'resource_type\' not present in FlowLogCollectorTargetSubnetReference JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext object from a json dictionary."""
+ """Initialize a FlowLogCollectorTargetSubnetReference object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'availability_policy') and self.availability_policy is not None:
- if isinstance(self.availability_policy, dict):
- _dict['availability_policy'] = self.availability_policy
- else:
- _dict['availability_policy'] = self.availability_policy.to_dict()
- if hasattr(self, 'created_at') and self.created_at is not None:
- _dict['created_at'] = datetime_to_string(self.created_at)
if hasattr(self, 'crn') and self.crn is not None:
_dict['crn'] = self.crn
- if hasattr(self, 'default_trusted_profile') and self.default_trusted_profile is not None:
- if isinstance(self.default_trusted_profile, dict):
- _dict['default_trusted_profile'] = self.default_trusted_profile
+ if hasattr(self, 'deleted') and self.deleted is not None:
+ if isinstance(self.deleted, dict):
+ _dict['deleted'] = self.deleted
else:
- _dict['default_trusted_profile'] = self.default_trusted_profile.to_dict()
+ _dict['deleted'] = self.deleted.to_dict()
if hasattr(self, 'href') and self.href is not None:
_dict['href'] = self.href
if hasattr(self, 'id') and self.id is not None:
_dict['id'] = self.id
- if hasattr(self, 'keys') and self.keys is not None:
- keys_list = []
- for v in self.keys:
- if isinstance(v, dict):
- keys_list.append(v)
- else:
- keys_list.append(v.to_dict())
- _dict['keys'] = keys_list
- if hasattr(self, 'metadata_service') and self.metadata_service is not None:
- if isinstance(self.metadata_service, dict):
- _dict['metadata_service'] = self.metadata_service
- else:
- _dict['metadata_service'] = self.metadata_service.to_dict()
if hasattr(self, 'name') and self.name is not None:
_dict['name'] = self.name
- if hasattr(self, 'placement_target') and self.placement_target is not None:
- if isinstance(self.placement_target, dict):
- _dict['placement_target'] = self.placement_target
- else:
- _dict['placement_target'] = self.placement_target.to_dict()
- if hasattr(self, 'profile') and self.profile is not None:
- if isinstance(self.profile, dict):
- _dict['profile'] = self.profile
- else:
- _dict['profile'] = self.profile.to_dict()
- if hasattr(self, 'resource_group') and self.resource_group is not None:
- if isinstance(self.resource_group, dict):
- _dict['resource_group'] = self.resource_group
- else:
- _dict['resource_group'] = self.resource_group.to_dict()
- if hasattr(self, 'total_volume_bandwidth') and self.total_volume_bandwidth is not None:
- _dict['total_volume_bandwidth'] = self.total_volume_bandwidth
- if hasattr(self, 'user_data') and self.user_data is not None:
- _dict['user_data'] = self.user_data
- if hasattr(self, 'volume_attachments') and self.volume_attachments is not None:
- volume_attachments_list = []
- for v in self.volume_attachments:
- if isinstance(v, dict):
- volume_attachments_list.append(v)
- else:
- volume_attachments_list.append(v.to_dict())
- _dict['volume_attachments'] = volume_attachments_list
- if hasattr(self, 'vpc') and self.vpc is not None:
- if isinstance(self.vpc, dict):
- _dict['vpc'] = self.vpc
- else:
- _dict['vpc'] = self.vpc.to_dict()
- if hasattr(self, 'boot_volume_attachment') and self.boot_volume_attachment is not None:
- if isinstance(self.boot_volume_attachment, dict):
- _dict['boot_volume_attachment'] = self.boot_volume_attachment
- else:
- _dict['boot_volume_attachment'] = self.boot_volume_attachment.to_dict()
- if hasattr(self, 'catalog_offering') and self.catalog_offering is not None:
- if isinstance(self.catalog_offering, dict):
- _dict['catalog_offering'] = self.catalog_offering
- else:
- _dict['catalog_offering'] = self.catalog_offering.to_dict()
- if hasattr(self, 'network_interfaces') and self.network_interfaces is not None:
- network_interfaces_list = []
- for v in self.network_interfaces:
- if isinstance(v, dict):
- network_interfaces_list.append(v)
- else:
- network_interfaces_list.append(v.to_dict())
- _dict['network_interfaces'] = network_interfaces_list
- if hasattr(self, 'primary_network_interface') and self.primary_network_interface is not None:
- if isinstance(self.primary_network_interface, dict):
- _dict['primary_network_interface'] = self.primary_network_interface
- else:
- _dict['primary_network_interface'] = self.primary_network_interface.to_dict()
- if hasattr(self, 'zone') and self.zone is not None:
- if isinstance(self.zone, dict):
- _dict['zone'] = self.zone
- else:
- _dict['zone'] = self.zone.to_dict()
+ if hasattr(self, 'resource_type') and self.resource_type is not None:
+ _dict['resource_type'] = self.resource_type
return _dict
def _to_dict(self):
@@ -104367,372 +107920,125 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext object."""
+ """Return a `str` version of this FlowLogCollectorTargetSubnetReference object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext') -> bool:
+ def __eq__(self, other: 'FlowLogCollectorTargetSubnetReference') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext') -> bool:
+ def __ne__(self, other: 'FlowLogCollectorTargetSubnetReference') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
+ class ResourceTypeEnum(str, Enum):
+ """
+ The resource type.
+ """
+
+ SUBNET = 'subnet'
-class InstanceTemplateInstanceByImageInstanceTemplateContext(InstanceTemplate):
+
+
+class FlowLogCollectorTargetVPCReference(FlowLogCollectorTarget):
"""
- Create an instance by using an image.
+ FlowLogCollectorTargetVPCReference.
- :attr InstanceAvailabilityPolicyPrototype availability_policy: (optional) The
- availability policy to use for this virtual server instance.
- :attr datetime created_at: The date and time that the instance template was
- created.
- :attr str crn: The CRN for this instance template.
- :attr InstanceDefaultTrustedProfilePrototype default_trusted_profile: (optional)
- The default trusted profile configuration to use for this virtual server
- instance
- This property's value is used when provisioning the virtual server instance, but
- not subsequently managed. Accordingly, it is reflected as an [instance
- initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
- property.
- :attr str href: The URL for this instance template.
- :attr str id: The unique identifier for this instance template.
- :attr List[KeyIdentity] keys: (optional) The public SSH keys for the
- administrative user of the virtual server instance. Keys will be made available
- to the virtual server instance as cloud-init vendor data. For cloud-init enabled
- images, these keys will also be added as SSH authorized keys for the
- administrative user.
- For Windows images, the keys of type `rsa` must be specified, and one will be
- selected to encrypt [the administrator
- password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys
- are optional for other images, but if no keys are specified, the instance will
- be inaccessible unless the specified image provides another means of access.
- This property's value is used when provisioning the virtual server instance, but
- not subsequently managed. Accordingly, it is reflected as an [instance
- initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
- property.
- :attr InstanceMetadataServicePrototype metadata_service: (optional)
- :attr str name: The name for this instance template. The name is unique across
- all instance templates in the region.
- :attr InstancePlacementTargetPrototype placement_target: (optional) The
- placement restrictions to use for the virtual server instance.
- :attr InstanceProfileIdentity profile: (optional) The
- [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this
- virtual server instance.
- If unspecified, `bx2-2x8` will be used, but this default value is expected to
- change in the future.
- :attr ResourceGroupReference resource_group: The resource group for this
- instance template.
- :attr int total_volume_bandwidth: (optional) The amount of bandwidth (in
- megabits per second) allocated exclusively to instance storage volumes. An
- increase in this value will result in a corresponding decrease to
- `total_network_bandwidth`.
- :attr str user_data: (optional) [User
- data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when
- setting up the virtual server instance.
- :attr List[VolumeAttachmentPrototype] volume_attachments: (optional) The
- additional volume attachments to create for the virtual server instance.
- :attr VPCIdentity vpc: (optional) The VPC this virtual server instance will
- reside in.
- If specified, it must match the VPC for the subnets of the instance network
- interfaces.
- :attr VolumeAttachmentPrototypeInstanceByImageContext boot_volume_attachment:
- (optional) The boot volume attachment to create for the virtual server instance.
- :attr ImageIdentity image: The image to use when provisioning the virtual server
- instance.
- :attr List[NetworkInterfacePrototype] network_interfaces: (optional) The
- additional instance network interfaces to create.
- :attr NetworkInterfacePrototype primary_network_interface: (optional) The
- primary instance network interface to create.
- :attr ZoneIdentity zone: The zone this virtual server instance will reside in.
+ :param str crn: The CRN 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 href: The URL for this VPC.
+ :param str id: The unique identifier for this VPC.
+ :param str name: The name for this VPC. The name is unique across all VPCs in
+ the region.
+ :param str resource_type: The resource type.
"""
def __init__(
self,
- created_at: datetime,
crn: str,
href: str,
id: str,
name: str,
- resource_group: 'ResourceGroupReference',
- image: 'ImageIdentity',
- zone: 'ZoneIdentity',
+ resource_type: str,
*,
- availability_policy: 'InstanceAvailabilityPolicyPrototype' = None,
- default_trusted_profile: 'InstanceDefaultTrustedProfilePrototype' = None,
- keys: List['KeyIdentity'] = None,
- metadata_service: 'InstanceMetadataServicePrototype' = None,
- placement_target: 'InstancePlacementTargetPrototype' = None,
- profile: 'InstanceProfileIdentity' = None,
- total_volume_bandwidth: int = None,
- user_data: str = None,
- volume_attachments: List['VolumeAttachmentPrototype'] = None,
- vpc: 'VPCIdentity' = None,
- boot_volume_attachment: 'VolumeAttachmentPrototypeInstanceByImageContext' = None,
- network_interfaces: List['NetworkInterfacePrototype'] = None,
- primary_network_interface: 'NetworkInterfacePrototype' = None,
+ deleted: Optional['VPCReferenceDeleted'] = None,
) -> None:
"""
- Initialize a InstanceTemplateInstanceByImageInstanceTemplateContext object.
+ Initialize a FlowLogCollectorTargetVPCReference object.
- :param datetime created_at: The date and time that the instance template
- was created.
- :param str crn: The CRN for this instance template.
- :param str href: The URL for this instance template.
- :param str id: The unique identifier for this instance template.
- :param str name: The name for this instance template. The name is unique
- across all instance templates in the region.
- :param ResourceGroupReference resource_group: The resource group for this
- instance template.
- :param ImageIdentity image: The image to use when provisioning the virtual
- server instance.
- :param ZoneIdentity zone: The zone this virtual server instance will reside
- in.
- :param InstanceAvailabilityPolicyPrototype availability_policy: (optional)
- The availability policy to use for this virtual server instance.
- :param InstanceDefaultTrustedProfilePrototype default_trusted_profile:
- (optional) The default trusted profile configuration to use for this
- virtual server instance
- This property's value is used when provisioning the virtual server
- instance, but not subsequently managed. Accordingly, it is reflected as an
- [instance
- initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
- property.
- :param List[KeyIdentity] keys: (optional) The public SSH keys for the
- administrative user of the virtual server instance. Keys will be made
- available to the virtual server instance as cloud-init vendor data. For
- cloud-init enabled images, these keys will also be added as SSH authorized
- keys for the administrative user.
- For Windows images, the keys of type `rsa` must be specified, and one will
- be selected to encrypt [the administrator
- password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization).
- Keys are optional for other images, but if no keys are specified, the
- instance will be inaccessible unless the specified image provides another
- means of access.
- This property's value is used when provisioning the virtual server
- instance, but not subsequently managed. Accordingly, it is reflected as an
- [instance
- initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
- property.
- :param InstanceMetadataServicePrototype metadata_service: (optional)
- :param InstancePlacementTargetPrototype placement_target: (optional) The
- placement restrictions to use for the virtual server instance.
- :param InstanceProfileIdentity profile: (optional) The
- [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for
- this virtual server instance.
- If unspecified, `bx2-2x8` will be used, but this default value is expected
- to change in the future.
- :param int total_volume_bandwidth: (optional) The amount of bandwidth (in
- megabits per second) allocated exclusively to instance storage volumes. An
- increase in this value will result in a corresponding decrease to
- `total_network_bandwidth`.
- :param str user_data: (optional) [User
- data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available
- when setting up the virtual server instance.
- :param List[VolumeAttachmentPrototype] volume_attachments: (optional) The
- additional volume attachments to create for the virtual server instance.
- :param VPCIdentity vpc: (optional) The VPC this virtual server instance
- will reside in.
- If specified, it must match the VPC for the subnets of the instance network
- interfaces.
- :param VolumeAttachmentPrototypeInstanceByImageContext
- boot_volume_attachment: (optional) The boot volume attachment to create for
- the virtual server instance.
- :param List[NetworkInterfacePrototype] network_interfaces: (optional) The
- additional instance network interfaces to create.
- :param NetworkInterfacePrototype primary_network_interface: (optional) The
- primary instance network interface to create.
+ :param str crn: The CRN for this VPC.
+ :param str href: The URL for this VPC.
+ :param str id: The unique identifier for this VPC.
+ :param str name: The name for this VPC. The name is unique across all VPCs
+ in the region.
+ :param str resource_type: The resource type.
+ :param VPCReferenceDeleted deleted: (optional) If present, this property
+ indicates the referenced resource has been deleted, and provides
+ some supplementary information.
"""
# pylint: disable=super-init-not-called
- self.availability_policy = availability_policy
- self.created_at = created_at
self.crn = crn
- self.default_trusted_profile = default_trusted_profile
+ self.deleted = deleted
self.href = href
self.id = id
- self.keys = keys
- self.metadata_service = metadata_service
self.name = name
- self.placement_target = placement_target
- self.profile = profile
- self.resource_group = resource_group
- self.total_volume_bandwidth = total_volume_bandwidth
- self.user_data = user_data
- self.volume_attachments = volume_attachments
- self.vpc = vpc
- self.boot_volume_attachment = boot_volume_attachment
- self.image = image
- self.network_interfaces = network_interfaces
- self.primary_network_interface = primary_network_interface
- self.zone = zone
+ self.resource_type = resource_type
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstanceTemplateInstanceByImageInstanceTemplateContext':
- """Initialize a InstanceTemplateInstanceByImageInstanceTemplateContext object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'FlowLogCollectorTargetVPCReference':
+ """Initialize a FlowLogCollectorTargetVPCReference object from a json dictionary."""
args = {}
- if 'availability_policy' in _dict:
- args['availability_policy'] = InstanceAvailabilityPolicyPrototype.from_dict(_dict.get('availability_policy'))
- if 'created_at' in _dict:
- args['created_at'] = string_to_datetime(_dict.get('created_at'))
- else:
- raise ValueError('Required property \'created_at\' not present in InstanceTemplateInstanceByImageInstanceTemplateContext JSON')
- if 'crn' in _dict:
- args['crn'] = _dict.get('crn')
+ if (crn := _dict.get('crn')) is not None:
+ args['crn'] = crn
else:
- raise ValueError('Required property \'crn\' not present in InstanceTemplateInstanceByImageInstanceTemplateContext JSON')
- if 'default_trusted_profile' in _dict:
- args['default_trusted_profile'] = InstanceDefaultTrustedProfilePrototype.from_dict(_dict.get('default_trusted_profile'))
- if 'href' in _dict:
- args['href'] = _dict.get('href')
- else:
- raise ValueError('Required property \'href\' not present in InstanceTemplateInstanceByImageInstanceTemplateContext JSON')
- if 'id' in _dict:
- args['id'] = _dict.get('id')
- else:
- raise ValueError('Required property \'id\' not present in InstanceTemplateInstanceByImageInstanceTemplateContext JSON')
- if 'keys' in _dict:
- args['keys'] = _dict.get('keys')
- if 'metadata_service' in _dict:
- args['metadata_service'] = InstanceMetadataServicePrototype.from_dict(_dict.get('metadata_service'))
- if 'name' in _dict:
- args['name'] = _dict.get('name')
+ raise ValueError('Required property \'crn\' not present in FlowLogCollectorTargetVPCReference JSON')
+ if (deleted := _dict.get('deleted')) is not None:
+ args['deleted'] = VPCReferenceDeleted.from_dict(deleted)
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'name\' not present in InstanceTemplateInstanceByImageInstanceTemplateContext JSON')
- if 'placement_target' in _dict:
- args['placement_target'] = _dict.get('placement_target')
- if 'profile' in _dict:
- args['profile'] = _dict.get('profile')
- if 'resource_group' in _dict:
- args['resource_group'] = ResourceGroupReference.from_dict(_dict.get('resource_group'))
+ raise ValueError('Required property \'href\' not present in FlowLogCollectorTargetVPCReference JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
else:
- raise ValueError('Required property \'resource_group\' not present in InstanceTemplateInstanceByImageInstanceTemplateContext JSON')
- if 'total_volume_bandwidth' in _dict:
- args['total_volume_bandwidth'] = _dict.get('total_volume_bandwidth')
- if 'user_data' in _dict:
- args['user_data'] = _dict.get('user_data')
- if 'volume_attachments' in _dict:
- args['volume_attachments'] = [VolumeAttachmentPrototype.from_dict(v) for v in _dict.get('volume_attachments')]
- if 'vpc' in _dict:
- args['vpc'] = _dict.get('vpc')
- if 'boot_volume_attachment' in _dict:
- args['boot_volume_attachment'] = VolumeAttachmentPrototypeInstanceByImageContext.from_dict(_dict.get('boot_volume_attachment'))
- if 'image' in _dict:
- args['image'] = _dict.get('image')
+ raise ValueError('Required property \'id\' not present in FlowLogCollectorTargetVPCReference JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
else:
- raise ValueError('Required property \'image\' not present in InstanceTemplateInstanceByImageInstanceTemplateContext JSON')
- if 'network_interfaces' in _dict:
- args['network_interfaces'] = [NetworkInterfacePrototype.from_dict(v) for v in _dict.get('network_interfaces')]
- if 'primary_network_interface' in _dict:
- args['primary_network_interface'] = NetworkInterfacePrototype.from_dict(_dict.get('primary_network_interface'))
- if 'zone' in _dict:
- args['zone'] = _dict.get('zone')
+ raise ValueError('Required property \'name\' not present in FlowLogCollectorTargetVPCReference JSON')
+ if (resource_type := _dict.get('resource_type')) is not None:
+ args['resource_type'] = resource_type
else:
- raise ValueError('Required property \'zone\' not present in InstanceTemplateInstanceByImageInstanceTemplateContext JSON')
+ raise ValueError('Required property \'resource_type\' not present in FlowLogCollectorTargetVPCReference JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceTemplateInstanceByImageInstanceTemplateContext object from a json dictionary."""
+ """Initialize a FlowLogCollectorTargetVPCReference object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'availability_policy') and self.availability_policy is not None:
- if isinstance(self.availability_policy, dict):
- _dict['availability_policy'] = self.availability_policy
- else:
- _dict['availability_policy'] = self.availability_policy.to_dict()
- if hasattr(self, 'created_at') and self.created_at is not None:
- _dict['created_at'] = datetime_to_string(self.created_at)
if hasattr(self, 'crn') and self.crn is not None:
_dict['crn'] = self.crn
- if hasattr(self, 'default_trusted_profile') and self.default_trusted_profile is not None:
- if isinstance(self.default_trusted_profile, dict):
- _dict['default_trusted_profile'] = self.default_trusted_profile
+ if hasattr(self, 'deleted') and self.deleted is not None:
+ if isinstance(self.deleted, dict):
+ _dict['deleted'] = self.deleted
else:
- _dict['default_trusted_profile'] = self.default_trusted_profile.to_dict()
+ _dict['deleted'] = self.deleted.to_dict()
if hasattr(self, 'href') and self.href is not None:
_dict['href'] = self.href
if hasattr(self, 'id') and self.id is not None:
_dict['id'] = self.id
- if hasattr(self, 'keys') and self.keys is not None:
- keys_list = []
- for v in self.keys:
- if isinstance(v, dict):
- keys_list.append(v)
- else:
- keys_list.append(v.to_dict())
- _dict['keys'] = keys_list
- if hasattr(self, 'metadata_service') and self.metadata_service is not None:
- if isinstance(self.metadata_service, dict):
- _dict['metadata_service'] = self.metadata_service
- else:
- _dict['metadata_service'] = self.metadata_service.to_dict()
if hasattr(self, 'name') and self.name is not None:
_dict['name'] = self.name
- if hasattr(self, 'placement_target') and self.placement_target is not None:
- if isinstance(self.placement_target, dict):
- _dict['placement_target'] = self.placement_target
- else:
- _dict['placement_target'] = self.placement_target.to_dict()
- if hasattr(self, 'profile') and self.profile is not None:
- if isinstance(self.profile, dict):
- _dict['profile'] = self.profile
- else:
- _dict['profile'] = self.profile.to_dict()
- if hasattr(self, 'resource_group') and self.resource_group is not None:
- if isinstance(self.resource_group, dict):
- _dict['resource_group'] = self.resource_group
- else:
- _dict['resource_group'] = self.resource_group.to_dict()
- if hasattr(self, 'total_volume_bandwidth') and self.total_volume_bandwidth is not None:
- _dict['total_volume_bandwidth'] = self.total_volume_bandwidth
- if hasattr(self, 'user_data') and self.user_data is not None:
- _dict['user_data'] = self.user_data
- if hasattr(self, 'volume_attachments') and self.volume_attachments is not None:
- volume_attachments_list = []
- for v in self.volume_attachments:
- if isinstance(v, dict):
- volume_attachments_list.append(v)
- else:
- volume_attachments_list.append(v.to_dict())
- _dict['volume_attachments'] = volume_attachments_list
- if hasattr(self, 'vpc') and self.vpc is not None:
- if isinstance(self.vpc, dict):
- _dict['vpc'] = self.vpc
- else:
- _dict['vpc'] = self.vpc.to_dict()
- if hasattr(self, 'boot_volume_attachment') and self.boot_volume_attachment is not None:
- if isinstance(self.boot_volume_attachment, dict):
- _dict['boot_volume_attachment'] = self.boot_volume_attachment
- else:
- _dict['boot_volume_attachment'] = self.boot_volume_attachment.to_dict()
- if hasattr(self, 'image') and self.image is not None:
- if isinstance(self.image, dict):
- _dict['image'] = self.image
- else:
- _dict['image'] = self.image.to_dict()
- if hasattr(self, 'network_interfaces') and self.network_interfaces is not None:
- network_interfaces_list = []
- for v in self.network_interfaces:
- if isinstance(v, dict):
- network_interfaces_list.append(v)
- else:
- network_interfaces_list.append(v.to_dict())
- _dict['network_interfaces'] = network_interfaces_list
- if hasattr(self, 'primary_network_interface') and self.primary_network_interface is not None:
- if isinstance(self.primary_network_interface, dict):
- _dict['primary_network_interface'] = self.primary_network_interface
- else:
- _dict['primary_network_interface'] = self.primary_network_interface.to_dict()
- if hasattr(self, 'zone') and self.zone is not None:
- if isinstance(self.zone, dict):
- _dict['zone'] = self.zone
- else:
- _dict['zone'] = self.zone.to_dict()
+ if hasattr(self, 'resource_type') and self.resource_type is not None:
+ _dict['resource_type'] = self.resource_type
return _dict
def _to_dict(self):
@@ -104740,360 +108046,109 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this InstanceTemplateInstanceByImageInstanceTemplateContext object."""
+ """Return a `str` version of this FlowLogCollectorTargetVPCReference object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceTemplateInstanceByImageInstanceTemplateContext') -> bool:
+ def __eq__(self, other: 'FlowLogCollectorTargetVPCReference') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'InstanceTemplateInstanceByImageInstanceTemplateContext') -> bool:
+ def __ne__(self, other: 'FlowLogCollectorTargetVPCReference') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
+ class ResourceTypeEnum(str, Enum):
+ """
+ The resource type.
+ """
+
+ VPC = 'vpc'
-class InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext(InstanceTemplate):
+
+
+class FlowLogCollectorTargetVirtualNetworkInterfaceReferenceAttachmentContext(FlowLogCollectorTarget):
"""
- Create an instance by using a snapshot.
+ FlowLogCollectorTargetVirtualNetworkInterfaceReferenceAttachmentContext.
- :attr InstanceAvailabilityPolicyPrototype availability_policy: (optional) The
- availability policy to use for this virtual server instance.
- :attr datetime created_at: The date and time that the instance template was
- created.
- :attr str crn: The CRN for this instance template.
- :attr InstanceDefaultTrustedProfilePrototype default_trusted_profile: (optional)
- The default trusted profile configuration to use for this virtual server
- instance
- This property's value is used when provisioning the virtual server instance, but
- not subsequently managed. Accordingly, it is reflected as an [instance
- initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
- property.
- :attr str href: The URL for this instance template.
- :attr str id: The unique identifier for this instance template.
- :attr List[KeyIdentity] keys: (optional) The public SSH keys for the
- administrative user of the virtual server instance. Keys will be made available
- to the virtual server instance as cloud-init vendor data. For cloud-init enabled
- images, these keys will also be added as SSH authorized keys for the
- administrative user.
- For Windows images, the keys of type `rsa` must be specified, and one will be
- selected to encrypt [the administrator
- password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys
- are optional for other images, but if no keys are specified, the instance will
- be inaccessible unless the specified image provides another means of access.
- This property's value is used when provisioning the virtual server instance, but
- not subsequently managed. Accordingly, it is reflected as an [instance
- initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
- property.
- :attr InstanceMetadataServicePrototype metadata_service: (optional)
- :attr str name: The name for this instance template. The name is unique across
- all instance templates in the region.
- :attr InstancePlacementTargetPrototype placement_target: (optional) The
- placement restrictions to use for the virtual server instance.
- :attr InstanceProfileIdentity profile: (optional) The
- [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this
- virtual server instance.
- If unspecified, `bx2-2x8` will be used, but this default value is expected to
- change in the future.
- :attr ResourceGroupReference resource_group: The resource group for this
- instance template.
- :attr int total_volume_bandwidth: (optional) The amount of bandwidth (in
- megabits per second) allocated exclusively to instance storage volumes. An
- increase in this value will result in a corresponding decrease to
- `total_network_bandwidth`.
- :attr str user_data: (optional) [User
- data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when
- setting up the virtual server instance.
- :attr List[VolumeAttachmentPrototype] volume_attachments: (optional) The
- additional volume attachments to create for the virtual server instance.
- :attr VPCIdentity vpc: (optional) The VPC this virtual server instance will
- reside in.
- If specified, it must match the VPC for the subnets of the instance network
- interfaces.
- :attr VolumeAttachmentPrototypeInstanceBySourceSnapshotContext
- boot_volume_attachment: The boot volume attachment to create for the virtual
- server instance.
- :attr List[NetworkInterfacePrototype] network_interfaces: (optional) The
- additional instance network interfaces to create.
- :attr NetworkInterfacePrototype primary_network_interface: (optional) The
- primary instance network interface to create.
- :attr ZoneIdentity zone: The zone this virtual server instance will reside in.
+ :param str crn: The CRN for this virtual network interface.
+ :param str href: The URL for this virtual network interface.
+ :param str id: The unique identifier for this virtual network interface.
+ :param str name: The name for this virtual network interface. The name is unique
+ across all virtual network interfaces in the VPC.
+ :param str resource_type: The resource type.
"""
def __init__(
self,
- created_at: datetime,
crn: str,
href: str,
id: str,
name: str,
- resource_group: 'ResourceGroupReference',
- boot_volume_attachment: 'VolumeAttachmentPrototypeInstanceBySourceSnapshotContext',
- zone: 'ZoneIdentity',
- *,
- availability_policy: 'InstanceAvailabilityPolicyPrototype' = None,
- default_trusted_profile: 'InstanceDefaultTrustedProfilePrototype' = None,
- keys: List['KeyIdentity'] = None,
- metadata_service: 'InstanceMetadataServicePrototype' = None,
- placement_target: 'InstancePlacementTargetPrototype' = None,
- profile: 'InstanceProfileIdentity' = None,
- total_volume_bandwidth: int = None,
- user_data: str = None,
- volume_attachments: List['VolumeAttachmentPrototype'] = None,
- vpc: 'VPCIdentity' = None,
- network_interfaces: List['NetworkInterfacePrototype'] = None,
- primary_network_interface: 'NetworkInterfacePrototype' = None,
+ resource_type: str,
) -> None:
"""
- Initialize a InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext object.
+ Initialize a FlowLogCollectorTargetVirtualNetworkInterfaceReferenceAttachmentContext object.
- :param datetime created_at: The date and time that the instance template
- was created.
- :param str crn: The CRN for this instance template.
- :param str href: The URL for this instance template.
- :param str id: The unique identifier for this instance template.
- :param str name: The name for this instance template. The name is unique
- across all instance templates in the region.
- :param ResourceGroupReference resource_group: The resource group for this
- instance template.
- :param VolumeAttachmentPrototypeInstanceBySourceSnapshotContext
- boot_volume_attachment: The boot volume attachment to create for the
- virtual server instance.
- :param ZoneIdentity zone: The zone this virtual server instance will reside
- in.
- :param InstanceAvailabilityPolicyPrototype availability_policy: (optional)
- The availability policy to use for this virtual server instance.
- :param InstanceDefaultTrustedProfilePrototype default_trusted_profile:
- (optional) The default trusted profile configuration to use for this
- virtual server instance
- This property's value is used when provisioning the virtual server
- instance, but not subsequently managed. Accordingly, it is reflected as an
- [instance
- initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
- property.
- :param List[KeyIdentity] keys: (optional) The public SSH keys for the
- administrative user of the virtual server instance. Keys will be made
- available to the virtual server instance as cloud-init vendor data. For
- cloud-init enabled images, these keys will also be added as SSH authorized
- keys for the administrative user.
- For Windows images, the keys of type `rsa` must be specified, and one will
- be selected to encrypt [the administrator
- password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization).
- Keys are optional for other images, but if no keys are specified, the
- instance will be inaccessible unless the specified image provides another
- means of access.
- This property's value is used when provisioning the virtual server
- instance, but not subsequently managed. Accordingly, it is reflected as an
- [instance
- initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
- property.
- :param InstanceMetadataServicePrototype metadata_service: (optional)
- :param InstancePlacementTargetPrototype placement_target: (optional) The
- placement restrictions to use for the virtual server instance.
- :param InstanceProfileIdentity profile: (optional) The
- [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for
- this virtual server instance.
- If unspecified, `bx2-2x8` will be used, but this default value is expected
- to change in the future.
- :param int total_volume_bandwidth: (optional) The amount of bandwidth (in
- megabits per second) allocated exclusively to instance storage volumes. An
- increase in this value will result in a corresponding decrease to
- `total_network_bandwidth`.
- :param str user_data: (optional) [User
- data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available
- when setting up the virtual server instance.
- :param List[VolumeAttachmentPrototype] volume_attachments: (optional) The
- additional volume attachments to create for the virtual server instance.
- :param VPCIdentity vpc: (optional) The VPC this virtual server instance
- will reside in.
- If specified, it must match the VPC for the subnets of the instance network
- interfaces.
- :param List[NetworkInterfacePrototype] network_interfaces: (optional) The
- additional instance network interfaces to create.
- :param NetworkInterfacePrototype primary_network_interface: (optional) The
- primary instance network interface to create.
+ :param str crn: The CRN for this virtual network interface.
+ :param str href: The URL for this virtual network interface.
+ :param str id: The unique identifier for this virtual network interface.
+ :param str name: The name for this virtual network interface. The name is
+ unique across all virtual network interfaces in the VPC.
+ :param str resource_type: The resource type.
"""
# pylint: disable=super-init-not-called
- self.availability_policy = availability_policy
- self.created_at = created_at
self.crn = crn
- self.default_trusted_profile = default_trusted_profile
self.href = href
self.id = id
- self.keys = keys
- self.metadata_service = metadata_service
self.name = name
- self.placement_target = placement_target
- self.profile = profile
- self.resource_group = resource_group
- self.total_volume_bandwidth = total_volume_bandwidth
- self.user_data = user_data
- self.volume_attachments = volume_attachments
- self.vpc = vpc
- self.boot_volume_attachment = boot_volume_attachment
- self.network_interfaces = network_interfaces
- self.primary_network_interface = primary_network_interface
- self.zone = zone
+ self.resource_type = resource_type
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext':
- """Initialize a InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'FlowLogCollectorTargetVirtualNetworkInterfaceReferenceAttachmentContext':
+ """Initialize a FlowLogCollectorTargetVirtualNetworkInterfaceReferenceAttachmentContext object from a json dictionary."""
args = {}
- if 'availability_policy' in _dict:
- args['availability_policy'] = InstanceAvailabilityPolicyPrototype.from_dict(_dict.get('availability_policy'))
- if 'created_at' in _dict:
- args['created_at'] = string_to_datetime(_dict.get('created_at'))
- else:
- raise ValueError('Required property \'created_at\' not present in InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext JSON')
- if 'crn' in _dict:
- args['crn'] = _dict.get('crn')
- else:
- raise ValueError('Required property \'crn\' not present in InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext JSON')
- if 'default_trusted_profile' in _dict:
- args['default_trusted_profile'] = InstanceDefaultTrustedProfilePrototype.from_dict(_dict.get('default_trusted_profile'))
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ if (crn := _dict.get('crn')) is not None:
+ args['crn'] = crn
else:
- raise ValueError('Required property \'href\' not present in InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext JSON')
- if 'id' in _dict:
- args['id'] = _dict.get('id')
+ raise ValueError('Required property \'crn\' not present in FlowLogCollectorTargetVirtualNetworkInterfaceReferenceAttachmentContext JSON')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'id\' not present in InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext JSON')
- if 'keys' in _dict:
- args['keys'] = _dict.get('keys')
- if 'metadata_service' in _dict:
- args['metadata_service'] = InstanceMetadataServicePrototype.from_dict(_dict.get('metadata_service'))
- if 'name' in _dict:
- args['name'] = _dict.get('name')
+ raise ValueError('Required property \'href\' not present in FlowLogCollectorTargetVirtualNetworkInterfaceReferenceAttachmentContext JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
else:
- raise ValueError('Required property \'name\' not present in InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext JSON')
- if 'placement_target' in _dict:
- args['placement_target'] = _dict.get('placement_target')
- if 'profile' in _dict:
- args['profile'] = _dict.get('profile')
- if 'resource_group' in _dict:
- args['resource_group'] = ResourceGroupReference.from_dict(_dict.get('resource_group'))
+ raise ValueError('Required property \'id\' not present in FlowLogCollectorTargetVirtualNetworkInterfaceReferenceAttachmentContext JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
else:
- raise ValueError('Required property \'resource_group\' not present in InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext JSON')
- if 'total_volume_bandwidth' in _dict:
- args['total_volume_bandwidth'] = _dict.get('total_volume_bandwidth')
- if 'user_data' in _dict:
- args['user_data'] = _dict.get('user_data')
- if 'volume_attachments' in _dict:
- args['volume_attachments'] = [VolumeAttachmentPrototype.from_dict(v) for v in _dict.get('volume_attachments')]
- if 'vpc' in _dict:
- args['vpc'] = _dict.get('vpc')
- if 'boot_volume_attachment' in _dict:
- args['boot_volume_attachment'] = VolumeAttachmentPrototypeInstanceBySourceSnapshotContext.from_dict(_dict.get('boot_volume_attachment'))
+ raise ValueError('Required property \'name\' not present in FlowLogCollectorTargetVirtualNetworkInterfaceReferenceAttachmentContext JSON')
+ if (resource_type := _dict.get('resource_type')) is not None:
+ args['resource_type'] = resource_type
else:
- raise ValueError('Required property \'boot_volume_attachment\' not present in InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext JSON')
- if 'network_interfaces' in _dict:
- args['network_interfaces'] = [NetworkInterfacePrototype.from_dict(v) for v in _dict.get('network_interfaces')]
- if 'primary_network_interface' in _dict:
- args['primary_network_interface'] = NetworkInterfacePrototype.from_dict(_dict.get('primary_network_interface'))
- if 'zone' in _dict:
- args['zone'] = _dict.get('zone')
- else:
- raise ValueError('Required property \'zone\' not present in InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext JSON')
+ raise ValueError('Required property \'resource_type\' not present in FlowLogCollectorTargetVirtualNetworkInterfaceReferenceAttachmentContext JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext object from a json dictionary."""
+ """Initialize a FlowLogCollectorTargetVirtualNetworkInterfaceReferenceAttachmentContext object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'availability_policy') and self.availability_policy is not None:
- if isinstance(self.availability_policy, dict):
- _dict['availability_policy'] = self.availability_policy
- else:
- _dict['availability_policy'] = self.availability_policy.to_dict()
- if hasattr(self, 'created_at') and self.created_at is not None:
- _dict['created_at'] = datetime_to_string(self.created_at)
if hasattr(self, 'crn') and self.crn is not None:
_dict['crn'] = self.crn
- if hasattr(self, 'default_trusted_profile') and self.default_trusted_profile is not None:
- if isinstance(self.default_trusted_profile, dict):
- _dict['default_trusted_profile'] = self.default_trusted_profile
- else:
- _dict['default_trusted_profile'] = self.default_trusted_profile.to_dict()
if hasattr(self, 'href') and self.href is not None:
_dict['href'] = self.href
if hasattr(self, 'id') and self.id is not None:
_dict['id'] = self.id
- if hasattr(self, 'keys') and self.keys is not None:
- keys_list = []
- for v in self.keys:
- if isinstance(v, dict):
- keys_list.append(v)
- else:
- keys_list.append(v.to_dict())
- _dict['keys'] = keys_list
- if hasattr(self, 'metadata_service') and self.metadata_service is not None:
- if isinstance(self.metadata_service, dict):
- _dict['metadata_service'] = self.metadata_service
- else:
- _dict['metadata_service'] = self.metadata_service.to_dict()
if hasattr(self, 'name') and self.name is not None:
_dict['name'] = self.name
- if hasattr(self, 'placement_target') and self.placement_target is not None:
- if isinstance(self.placement_target, dict):
- _dict['placement_target'] = self.placement_target
- else:
- _dict['placement_target'] = self.placement_target.to_dict()
- if hasattr(self, 'profile') and self.profile is not None:
- if isinstance(self.profile, dict):
- _dict['profile'] = self.profile
- else:
- _dict['profile'] = self.profile.to_dict()
- if hasattr(self, 'resource_group') and self.resource_group is not None:
- if isinstance(self.resource_group, dict):
- _dict['resource_group'] = self.resource_group
- else:
- _dict['resource_group'] = self.resource_group.to_dict()
- if hasattr(self, 'total_volume_bandwidth') and self.total_volume_bandwidth is not None:
- _dict['total_volume_bandwidth'] = self.total_volume_bandwidth
- if hasattr(self, 'user_data') and self.user_data is not None:
- _dict['user_data'] = self.user_data
- if hasattr(self, 'volume_attachments') and self.volume_attachments is not None:
- volume_attachments_list = []
- for v in self.volume_attachments:
- if isinstance(v, dict):
- volume_attachments_list.append(v)
- else:
- volume_attachments_list.append(v.to_dict())
- _dict['volume_attachments'] = volume_attachments_list
- if hasattr(self, 'vpc') and self.vpc is not None:
- if isinstance(self.vpc, dict):
- _dict['vpc'] = self.vpc
- else:
- _dict['vpc'] = self.vpc.to_dict()
- if hasattr(self, 'boot_volume_attachment') and self.boot_volume_attachment is not None:
- if isinstance(self.boot_volume_attachment, dict):
- _dict['boot_volume_attachment'] = self.boot_volume_attachment
- else:
- _dict['boot_volume_attachment'] = self.boot_volume_attachment.to_dict()
- if hasattr(self, 'network_interfaces') and self.network_interfaces is not None:
- network_interfaces_list = []
- for v in self.network_interfaces:
- if isinstance(v, dict):
- network_interfaces_list.append(v)
- else:
- network_interfaces_list.append(v.to_dict())
- _dict['network_interfaces'] = network_interfaces_list
- if hasattr(self, 'primary_network_interface') and self.primary_network_interface is not None:
- if isinstance(self.primary_network_interface, dict):
- _dict['primary_network_interface'] = self.primary_network_interface
- else:
- _dict['primary_network_interface'] = self.primary_network_interface.to_dict()
- if hasattr(self, 'zone') and self.zone is not None:
- if isinstance(self.zone, dict):
- _dict['zone'] = self.zone
- else:
- _dict['zone'] = self.zone.to_dict()
+ if hasattr(self, 'resource_type') and self.resource_type is not None:
+ _dict['resource_type'] = self.resource_type
return _dict
def _to_dict(self):
@@ -105101,122 +108156,67 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext object."""
+ """Return a `str` version of this FlowLogCollectorTargetVirtualNetworkInterfaceReferenceAttachmentContext object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext') -> bool:
+ def __eq__(self, other: 'FlowLogCollectorTargetVirtualNetworkInterfaceReferenceAttachmentContext') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext') -> bool:
+ def __ne__(self, other: 'FlowLogCollectorTargetVirtualNetworkInterfaceReferenceAttachmentContext') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-
-class KeyIdentityByCRN(KeyIdentity):
- """
- KeyIdentityByCRN.
-
- :attr str crn: The CRN for this key.
- """
-
- def __init__(
- self,
- crn: str,
- ) -> None:
+ class ResourceTypeEnum(str, Enum):
"""
- Initialize a KeyIdentityByCRN object.
-
- :param str crn: The CRN for this key.
+ The resource type.
"""
- # pylint: disable=super-init-not-called
- self.crn = crn
-
- @classmethod
- def from_dict(cls, _dict: Dict) -> 'KeyIdentityByCRN':
- """Initialize a KeyIdentityByCRN object from a json dictionary."""
- args = {}
- if 'crn' in _dict:
- args['crn'] = _dict.get('crn')
- else:
- raise ValueError('Required property \'crn\' not present in KeyIdentityByCRN JSON')
- return cls(**args)
-
- @classmethod
- def _from_dict(cls, _dict):
- """Initialize a KeyIdentityByCRN object from a json dictionary."""
- return cls.from_dict(_dict)
-
- def to_dict(self) -> Dict:
- """Return a json dictionary representing this model."""
- _dict = {}
- if hasattr(self, 'crn') and self.crn is not None:
- _dict['crn'] = self.crn
- return _dict
-
- def _to_dict(self):
- """Return a json dictionary representing this model."""
- return self.to_dict()
-
- def __str__(self) -> str:
- """Return a `str` version of this KeyIdentityByCRN object."""
- return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'KeyIdentityByCRN') -> bool:
- """Return `true` when self and other are equal, false otherwise."""
- if not isinstance(other, self.__class__):
- return False
- return self.__dict__ == other.__dict__
+ VIRTUAL_NETWORK_INTERFACE = 'virtual_network_interface'
- def __ne__(self, other: 'KeyIdentityByCRN') -> bool:
- """Return `true` when self and other are not equal, false otherwise."""
- return not self == other
-class KeyIdentityByFingerprint(KeyIdentity):
+class ImageIdentityByCRN(ImageIdentity):
"""
- KeyIdentityByFingerprint.
+ ImageIdentityByCRN.
- :attr str fingerprint: The fingerprint for this key. The value is returned
- base64-encoded and prefixed with the hash algorithm (always `SHA256`).
+ :param str crn: The CRN for this image.
"""
def __init__(
self,
- fingerprint: str,
+ crn: str,
) -> None:
"""
- Initialize a KeyIdentityByFingerprint object.
+ Initialize a ImageIdentityByCRN object.
- :param str fingerprint: The fingerprint for this key. The value is
- returned base64-encoded and prefixed with the hash algorithm (always
- `SHA256`).
+ :param str crn: The CRN for this image.
"""
# pylint: disable=super-init-not-called
- self.fingerprint = fingerprint
+ self.crn = crn
@classmethod
- def from_dict(cls, _dict: Dict) -> 'KeyIdentityByFingerprint':
- """Initialize a KeyIdentityByFingerprint object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'ImageIdentityByCRN':
+ """Initialize a ImageIdentityByCRN object from a json dictionary."""
args = {}
- if 'fingerprint' in _dict:
- args['fingerprint'] = _dict.get('fingerprint')
+ if (crn := _dict.get('crn')) is not None:
+ args['crn'] = crn
else:
- raise ValueError('Required property \'fingerprint\' not present in KeyIdentityByFingerprint JSON')
+ raise ValueError('Required property \'crn\' not present in ImageIdentityByCRN JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a KeyIdentityByFingerprint object from a json dictionary."""
+ """Initialize a ImageIdentityByCRN object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'fingerprint') and self.fingerprint is not None:
- _dict['fingerprint'] = self.fingerprint
+ if hasattr(self, 'crn') and self.crn is not None:
+ _dict['crn'] = self.crn
return _dict
def _to_dict(self):
@@ -105224,25 +108224,25 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this KeyIdentityByFingerprint object."""
+ """Return a `str` version of this ImageIdentityByCRN object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'KeyIdentityByFingerprint') -> bool:
+ def __eq__(self, other: 'ImageIdentityByCRN') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'KeyIdentityByFingerprint') -> bool:
+ def __ne__(self, other: 'ImageIdentityByCRN') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class KeyIdentityByHref(KeyIdentity):
+class ImageIdentityByHref(ImageIdentity):
"""
- KeyIdentityByHref.
+ ImageIdentityByHref.
- :attr str href: The URL for this key.
+ :param str href: The URL for this image.
"""
def __init__(
@@ -105250,26 +108250,26 @@ def __init__(
href: str,
) -> None:
"""
- Initialize a KeyIdentityByHref object.
+ Initialize a ImageIdentityByHref object.
- :param str href: The URL for this key.
+ :param str href: The URL for this image.
"""
# pylint: disable=super-init-not-called
self.href = href
@classmethod
- def from_dict(cls, _dict: Dict) -> 'KeyIdentityByHref':
- """Initialize a KeyIdentityByHref object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'ImageIdentityByHref':
+ """Initialize a ImageIdentityByHref object from a json dictionary."""
args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'href\' not present in KeyIdentityByHref JSON')
+ raise ValueError('Required property \'href\' not present in ImageIdentityByHref JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a KeyIdentityByHref object from a json dictionary."""
+ """Initialize a ImageIdentityByHref object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -105284,25 +108284,25 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this KeyIdentityByHref object."""
+ """Return a `str` version of this ImageIdentityByHref object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'KeyIdentityByHref') -> bool:
+ def __eq__(self, other: 'ImageIdentityByHref') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'KeyIdentityByHref') -> bool:
+ def __ne__(self, other: 'ImageIdentityByHref') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class KeyIdentityById(KeyIdentity):
+class ImageIdentityById(ImageIdentity):
"""
- KeyIdentityById.
+ ImageIdentityById.
- :attr str id: The unique identifier for this key.
+ :param str id: The unique identifier for this image.
"""
def __init__(
@@ -105310,26 +108310,26 @@ def __init__(
id: str,
) -> None:
"""
- Initialize a KeyIdentityById object.
+ Initialize a ImageIdentityById object.
- :param str id: The unique identifier for this key.
+ :param str id: The unique identifier for this image.
"""
# pylint: disable=super-init-not-called
self.id = id
@classmethod
- def from_dict(cls, _dict: Dict) -> 'KeyIdentityById':
- """Initialize a KeyIdentityById object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'ImageIdentityById':
+ """Initialize a ImageIdentityById object from a json dictionary."""
args = {}
- if 'id' in _dict:
- args['id'] = _dict.get('id')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
else:
- raise ValueError('Required property \'id\' not present in KeyIdentityById JSON')
+ raise ValueError('Required property \'id\' not present in ImageIdentityById JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a KeyIdentityById object from a json dictionary."""
+ """Initialize a ImageIdentityById object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -105344,60 +108344,207 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this KeyIdentityById object."""
+ """Return a `str` version of this ImageIdentityById object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'KeyIdentityById') -> bool:
+ def __eq__(self, other: 'ImageIdentityById') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'KeyIdentityById') -> bool:
+ def __ne__(self, other: 'ImageIdentityById') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName(LegacyCloudObjectStorageBucketIdentity):
+class ImagePrototypeImageByFile(ImagePrototype):
"""
- LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName.
+ ImagePrototypeImageByFile.
- :attr str name: The globally unique name of this Cloud Object Storage bucket.
+ :param datetime deprecation_at: (optional) The deprecation date and time to set
+ for this image.
+ The date and time must not be in the past, and must be earlier than
+ `obsolescence_at`
+ (if `obsolescence_at` is set).
+ If unspecified, no deprecation date and time will be set.
+ If the deprecation date and time is reached while the image has a status of
+ `pending`, the image's status will transition to `deprecated` upon its
+ successful creation (or
+ `obsolete` if the obsolescence date and time was also reached).
+ :param str name: (optional) The name for this image. The name must not be used
+ by another image in the region. Names starting with `ibm-` are reserved for
+ system-provided images, and are not allowed. If unspecified, the name will be a
+ hyphenated list of randomly-selected words.
+ :param datetime obsolescence_at: (optional) The obsolescence date and time to
+ set for this image.
+ The date and time must not be in the past, and must be later than
+ `deprecation_at` (if
+ `deprecation_at` is set).
+ If unspecified, no obsolescence date and time will be set.
+ If the obsolescence date and time is reached while the image has a status of
+ `pending`, the image's status will transition to `obsolete` upon its successful
+ creation.
+ :param ResourceGroupIdentity resource_group: (optional)
+ :param str encrypted_data_key: (optional) A base64-encoded, encrypted
+ representation of the key that was used to encrypt the data for this image.
+ That representation is created by wrapping the key's value with the
+ `encryption_key` root key (which must also be specified), using either [Key
+ Protect](https://cloud.ibm.com/docs/key-protect?topic=key-protect-wrap-keys) or
+ the
+ [Hyper Protect Crypto
+ Services](https://cloud.ibm.com/docs/services/hs-crypto?topic=hs-crypto-wrap-keys).
+ If unspecified, the imported image is treated as unencrypted.
+ :param EncryptionKeyIdentity encryption_key: (optional) The root key that was
+ used to wrap the data key (which is ultimately represented as
+ `encrypted_data_key`). Additionally, the root key will be used to encrypt
+ volumes
+ created from this image (unless an alternate `encryption_key` is specified at
+ volume
+ creation).
+ If unspecified, the imported image is treated as unencrypted.
+ :param ImageFilePrototype file: The file from which to create the image.
+ :param OperatingSystemIdentity operating_system: The [supported operating
+ system](https://cloud.ibm.com/apidocs/vpc#list-operating-systems) included in
+ this
+ image.
"""
def __init__(
self,
- name: str,
+ file: 'ImageFilePrototype',
+ operating_system: 'OperatingSystemIdentity',
+ *,
+ deprecation_at: Optional[datetime] = None,
+ name: Optional[str] = None,
+ obsolescence_at: Optional[datetime] = None,
+ resource_group: Optional['ResourceGroupIdentity'] = None,
+ encrypted_data_key: Optional[str] = None,
+ encryption_key: Optional['EncryptionKeyIdentity'] = None,
) -> None:
"""
- Initialize a LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName object.
+ Initialize a ImagePrototypeImageByFile object.
- :param str name: The globally unique name of this Cloud Object Storage
- bucket.
+ :param ImageFilePrototype file: The file from which to create the image.
+ :param OperatingSystemIdentity operating_system: The [supported operating
+ system](https://cloud.ibm.com/apidocs/vpc#list-operating-systems) included
+ in this
+ image.
+ :param datetime deprecation_at: (optional) The deprecation date and time to
+ set for this image.
+ The date and time must not be in the past, and must be earlier than
+ `obsolescence_at`
+ (if `obsolescence_at` is set).
+ If unspecified, no deprecation date and time will be set.
+ If the deprecation date and time is reached while the image has a status of
+ `pending`, the image's status will transition to `deprecated` upon its
+ successful creation (or
+ `obsolete` if the obsolescence date and time was also reached).
+ :param str name: (optional) The name for this image. The name must not be
+ used by another image in the region. Names starting with `ibm-` are
+ reserved for system-provided images, and are not allowed. If unspecified,
+ the name will be a hyphenated list of randomly-selected words.
+ :param datetime obsolescence_at: (optional) The obsolescence date and time
+ to set for this image.
+ The date and time must not be in the past, and must be later than
+ `deprecation_at` (if
+ `deprecation_at` is set).
+ If unspecified, no obsolescence date and time will be set.
+ If the obsolescence date and time is reached while the image has a status
+ of
+ `pending`, the image's status will transition to `obsolete` upon its
+ successful creation.
+ :param ResourceGroupIdentity resource_group: (optional)
+ :param str encrypted_data_key: (optional) A base64-encoded, encrypted
+ representation of the key that was used to encrypt the data for this image.
+ That representation is created by wrapping the key's value with the
+ `encryption_key` root key (which must also be specified), using either [Key
+ Protect](https://cloud.ibm.com/docs/key-protect?topic=key-protect-wrap-keys)
+ or the
+ [Hyper Protect Crypto
+ Services](https://cloud.ibm.com/docs/services/hs-crypto?topic=hs-crypto-wrap-keys).
+ If unspecified, the imported image is treated as unencrypted.
+ :param EncryptionKeyIdentity encryption_key: (optional) The root key that
+ was used to wrap the data key (which is ultimately represented as
+ `encrypted_data_key`). Additionally, the root key will be used to encrypt
+ volumes
+ created from this image (unless an alternate `encryption_key` is specified
+ at volume
+ creation).
+ If unspecified, the imported image is treated as unencrypted.
"""
# pylint: disable=super-init-not-called
+ self.deprecation_at = deprecation_at
self.name = name
+ self.obsolescence_at = obsolescence_at
+ self.resource_group = resource_group
+ self.encrypted_data_key = encrypted_data_key
+ self.encryption_key = encryption_key
+ self.file = file
+ self.operating_system = operating_system
@classmethod
- def from_dict(cls, _dict: Dict) -> 'LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName':
- """Initialize a LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'ImagePrototypeImageByFile':
+ """Initialize a ImagePrototypeImageByFile object from a json dictionary."""
args = {}
- if 'name' in _dict:
- args['name'] = _dict.get('name')
+ if (deprecation_at := _dict.get('deprecation_at')) is not None:
+ args['deprecation_at'] = string_to_datetime(deprecation_at)
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ if (obsolescence_at := _dict.get('obsolescence_at')) is not None:
+ args['obsolescence_at'] = string_to_datetime(obsolescence_at)
+ if (resource_group := _dict.get('resource_group')) is not None:
+ args['resource_group'] = resource_group
+ if (encrypted_data_key := _dict.get('encrypted_data_key')) is not None:
+ args['encrypted_data_key'] = encrypted_data_key
+ if (encryption_key := _dict.get('encryption_key')) is not None:
+ args['encryption_key'] = encryption_key
+ if (file := _dict.get('file')) is not None:
+ args['file'] = ImageFilePrototype.from_dict(file)
else:
- raise ValueError('Required property \'name\' not present in LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName JSON')
+ raise ValueError('Required property \'file\' not present in ImagePrototypeImageByFile JSON')
+ if (operating_system := _dict.get('operating_system')) is not None:
+ args['operating_system'] = operating_system
+ else:
+ raise ValueError('Required property \'operating_system\' not present in ImagePrototypeImageByFile JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName object from a json dictionary."""
+ """Initialize a ImagePrototypeImageByFile object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
+ if hasattr(self, 'deprecation_at') and self.deprecation_at is not None:
+ _dict['deprecation_at'] = datetime_to_string(self.deprecation_at)
if hasattr(self, 'name') and self.name is not None:
_dict['name'] = self.name
+ if hasattr(self, 'obsolescence_at') and self.obsolescence_at is not None:
+ _dict['obsolescence_at'] = datetime_to_string(self.obsolescence_at)
+ if hasattr(self, 'resource_group') and self.resource_group is not None:
+ if isinstance(self.resource_group, dict):
+ _dict['resource_group'] = self.resource_group
+ else:
+ _dict['resource_group'] = self.resource_group.to_dict()
+ if hasattr(self, 'encrypted_data_key') and self.encrypted_data_key is not None:
+ _dict['encrypted_data_key'] = self.encrypted_data_key
+ if hasattr(self, 'encryption_key') and self.encryption_key is not None:
+ if isinstance(self.encryption_key, dict):
+ _dict['encryption_key'] = self.encryption_key
+ else:
+ _dict['encryption_key'] = self.encryption_key.to_dict()
+ if hasattr(self, 'file') and self.file is not None:
+ if isinstance(self.file, dict):
+ _dict['file'] = self.file
+ else:
+ _dict['file'] = self.file.to_dict()
+ if hasattr(self, 'operating_system') and self.operating_system is not None:
+ if isinstance(self.operating_system, dict):
+ _dict['operating_system'] = self.operating_system
+ else:
+ _dict['operating_system'] = self.operating_system.to_dict()
return _dict
def _to_dict(self):
@@ -105405,59 +108552,164 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName object."""
+ """Return a `str` version of this ImagePrototypeImageByFile object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName') -> bool:
+ def __eq__(self, other: 'ImagePrototypeImageByFile') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName') -> bool:
+ def __ne__(self, other: 'ImagePrototypeImageByFile') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class LoadBalancerIdentityByCRN(LoadBalancerIdentity):
- """
- LoadBalancerIdentityByCRN.
-
- :attr str crn: The load balancer's CRN.
+class ImagePrototypeImageBySourceVolume(ImagePrototype):
"""
+ ImagePrototypeImageBySourceVolume.
- def __init__(
- self,
- crn: str,
- ) -> None:
- """
- Initialize a LoadBalancerIdentityByCRN object.
-
- :param str crn: The load balancer's CRN.
- """
- # pylint: disable=super-init-not-called
- self.crn = crn
-
- @classmethod
- def from_dict(cls, _dict: Dict) -> 'LoadBalancerIdentityByCRN':
- """Initialize a LoadBalancerIdentityByCRN object from a json dictionary."""
+ :param datetime deprecation_at: (optional) The deprecation date and time to set
+ for this image.
+ The date and time must not be in the past, and must be earlier than
+ `obsolescence_at`
+ (if `obsolescence_at` is set).
+ If unspecified, no deprecation date and time will be set.
+ If the deprecation date and time is reached while the image has a status of
+ `pending`, the image's status will transition to `deprecated` upon its
+ successful creation (or
+ `obsolete` if the obsolescence date and time was also reached).
+ :param str name: (optional) The name for this image. The name must not be used
+ by another image in the region. Names starting with `ibm-` are reserved for
+ system-provided images, and are not allowed. If unspecified, the name will be a
+ hyphenated list of randomly-selected words.
+ :param datetime obsolescence_at: (optional) The obsolescence date and time to
+ set for this image.
+ The date and time must not be in the past, and must be later than
+ `deprecation_at` (if
+ `deprecation_at` is set).
+ If unspecified, no obsolescence date and time will be set.
+ If the obsolescence date and time is reached while the image has a status of
+ `pending`, the image's status will transition to `obsolete` upon its successful
+ creation.
+ :param ResourceGroupIdentity resource_group: (optional)
+ :param EncryptionKeyIdentity encryption_key: (optional) The root key used to
+ wrap the system-generated data encryption key for the image.
+ If unspecified, the root key from `source_volume` will be used.
+ :param VolumeIdentity source_volume: The volume from which to create the image.
+ The specified volume must:
+ - Have an `operating_system`, which will be used to populate this image's
+ operating system information.
+ - Not be `active` or `busy`.
+ During image creation, the specified volume may briefly become `busy`.
+ """
+
+ def __init__(
+ self,
+ source_volume: 'VolumeIdentity',
+ *,
+ deprecation_at: Optional[datetime] = None,
+ name: Optional[str] = None,
+ obsolescence_at: Optional[datetime] = None,
+ resource_group: Optional['ResourceGroupIdentity'] = None,
+ encryption_key: Optional['EncryptionKeyIdentity'] = None,
+ ) -> None:
+ """
+ Initialize a ImagePrototypeImageBySourceVolume object.
+
+ :param VolumeIdentity source_volume: The volume from which to create the
+ image. The specified volume must:
+ - Have an `operating_system`, which will be used to populate this image's
+ operating system information.
+ - Not be `active` or `busy`.
+ During image creation, the specified volume may briefly become `busy`.
+ :param datetime deprecation_at: (optional) The deprecation date and time to
+ set for this image.
+ The date and time must not be in the past, and must be earlier than
+ `obsolescence_at`
+ (if `obsolescence_at` is set).
+ If unspecified, no deprecation date and time will be set.
+ If the deprecation date and time is reached while the image has a status of
+ `pending`, the image's status will transition to `deprecated` upon its
+ successful creation (or
+ `obsolete` if the obsolescence date and time was also reached).
+ :param str name: (optional) The name for this image. The name must not be
+ used by another image in the region. Names starting with `ibm-` are
+ reserved for system-provided images, and are not allowed. If unspecified,
+ the name will be a hyphenated list of randomly-selected words.
+ :param datetime obsolescence_at: (optional) The obsolescence date and time
+ to set for this image.
+ The date and time must not be in the past, and must be later than
+ `deprecation_at` (if
+ `deprecation_at` is set).
+ If unspecified, no obsolescence date and time will be set.
+ If the obsolescence date and time is reached while the image has a status
+ of
+ `pending`, the image's status will transition to `obsolete` upon its
+ successful creation.
+ :param ResourceGroupIdentity resource_group: (optional)
+ :param EncryptionKeyIdentity encryption_key: (optional) The root key used
+ to wrap the system-generated data encryption key for the image.
+ If unspecified, the root key from `source_volume` will be used.
+ """
+ # pylint: disable=super-init-not-called
+ self.deprecation_at = deprecation_at
+ self.name = name
+ self.obsolescence_at = obsolescence_at
+ self.resource_group = resource_group
+ self.encryption_key = encryption_key
+ self.source_volume = source_volume
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'ImagePrototypeImageBySourceVolume':
+ """Initialize a ImagePrototypeImageBySourceVolume object from a json dictionary."""
args = {}
- if 'crn' in _dict:
- args['crn'] = _dict.get('crn')
+ if (deprecation_at := _dict.get('deprecation_at')) is not None:
+ args['deprecation_at'] = string_to_datetime(deprecation_at)
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ if (obsolescence_at := _dict.get('obsolescence_at')) is not None:
+ args['obsolescence_at'] = string_to_datetime(obsolescence_at)
+ if (resource_group := _dict.get('resource_group')) is not None:
+ args['resource_group'] = resource_group
+ if (encryption_key := _dict.get('encryption_key')) is not None:
+ args['encryption_key'] = encryption_key
+ if (source_volume := _dict.get('source_volume')) is not None:
+ args['source_volume'] = source_volume
else:
- raise ValueError('Required property \'crn\' not present in LoadBalancerIdentityByCRN JSON')
+ raise ValueError('Required property \'source_volume\' not present in ImagePrototypeImageBySourceVolume JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a LoadBalancerIdentityByCRN object from a json dictionary."""
+ """Initialize a ImagePrototypeImageBySourceVolume object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'crn') and self.crn is not None:
- _dict['crn'] = self.crn
+ if hasattr(self, 'deprecation_at') and self.deprecation_at is not None:
+ _dict['deprecation_at'] = datetime_to_string(self.deprecation_at)
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ if hasattr(self, 'obsolescence_at') and self.obsolescence_at is not None:
+ _dict['obsolescence_at'] = datetime_to_string(self.obsolescence_at)
+ if hasattr(self, 'resource_group') and self.resource_group is not None:
+ if isinstance(self.resource_group, dict):
+ _dict['resource_group'] = self.resource_group
+ else:
+ _dict['resource_group'] = self.resource_group.to_dict()
+ if hasattr(self, 'encryption_key') and self.encryption_key is not None:
+ if isinstance(self.encryption_key, dict):
+ _dict['encryption_key'] = self.encryption_key
+ else:
+ _dict['encryption_key'] = self.encryption_key.to_dict()
+ if hasattr(self, 'source_volume') and self.source_volume is not None:
+ if isinstance(self.source_volume, dict):
+ _dict['source_volume'] = self.source_volume
+ else:
+ _dict['source_volume'] = self.source_volume.to_dict()
return _dict
def _to_dict(self):
@@ -105465,59 +108717,66 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this LoadBalancerIdentityByCRN object."""
+ """Return a `str` version of this ImagePrototypeImageBySourceVolume object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'LoadBalancerIdentityByCRN') -> bool:
+ def __eq__(self, other: 'ImagePrototypeImageBySourceVolume') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'LoadBalancerIdentityByCRN') -> bool:
+ def __ne__(self, other: 'ImagePrototypeImageBySourceVolume') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class LoadBalancerIdentityByHref(LoadBalancerIdentity):
+class InstanceCatalogOfferingPrototypeCatalogOfferingByOffering(InstanceCatalogOfferingPrototype):
"""
- LoadBalancerIdentityByHref.
+ InstanceCatalogOfferingPrototypeCatalogOfferingByOffering.
- :attr str href: The load balancer's canonical URL.
+ :param CatalogOfferingIdentity offering: Identifies a
+ [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user)
+ offering by a unique property.
"""
def __init__(
self,
- href: str,
+ offering: 'CatalogOfferingIdentity',
) -> None:
"""
- Initialize a LoadBalancerIdentityByHref object.
+ Initialize a InstanceCatalogOfferingPrototypeCatalogOfferingByOffering object.
- :param str href: The load balancer's canonical URL.
+ :param CatalogOfferingIdentity offering: Identifies a
+ [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user)
+ offering by a unique property.
"""
# pylint: disable=super-init-not-called
- self.href = href
+ self.offering = offering
@classmethod
- def from_dict(cls, _dict: Dict) -> 'LoadBalancerIdentityByHref':
- """Initialize a LoadBalancerIdentityByHref object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceCatalogOfferingPrototypeCatalogOfferingByOffering':
+ """Initialize a InstanceCatalogOfferingPrototypeCatalogOfferingByOffering object from a json dictionary."""
args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ if (offering := _dict.get('offering')) is not None:
+ args['offering'] = offering
else:
- raise ValueError('Required property \'href\' not present in LoadBalancerIdentityByHref JSON')
+ raise ValueError('Required property \'offering\' not present in InstanceCatalogOfferingPrototypeCatalogOfferingByOffering JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a LoadBalancerIdentityByHref object from a json dictionary."""
+ """Initialize a InstanceCatalogOfferingPrototypeCatalogOfferingByOffering object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'href') and self.href is not None:
- _dict['href'] = self.href
+ if hasattr(self, 'offering') and self.offering is not None:
+ if isinstance(self.offering, dict):
+ _dict['offering'] = self.offering
+ else:
+ _dict['offering'] = self.offering.to_dict()
return _dict
def _to_dict(self):
@@ -105525,59 +108784,68 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this LoadBalancerIdentityByHref object."""
+ """Return a `str` version of this InstanceCatalogOfferingPrototypeCatalogOfferingByOffering object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'LoadBalancerIdentityByHref') -> bool:
+ def __eq__(self, other: 'InstanceCatalogOfferingPrototypeCatalogOfferingByOffering') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'LoadBalancerIdentityByHref') -> bool:
+ def __ne__(self, other: 'InstanceCatalogOfferingPrototypeCatalogOfferingByOffering') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class LoadBalancerIdentityById(LoadBalancerIdentity):
+class InstanceCatalogOfferingPrototypeCatalogOfferingByVersion(InstanceCatalogOfferingPrototype):
"""
- LoadBalancerIdentityById.
+ InstanceCatalogOfferingPrototypeCatalogOfferingByVersion.
- :attr str id: The unique identifier for this load balancer.
+ :param CatalogOfferingVersionIdentity version: Identifies a version of a
+ [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user)
+ offering by a
+ unique property.
"""
def __init__(
self,
- id: str,
+ version: 'CatalogOfferingVersionIdentity',
) -> None:
"""
- Initialize a LoadBalancerIdentityById object.
+ Initialize a InstanceCatalogOfferingPrototypeCatalogOfferingByVersion object.
- :param str id: The unique identifier for this load balancer.
+ :param CatalogOfferingVersionIdentity version: Identifies a version of a
+ [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user)
+ offering by a
+ unique property.
"""
# pylint: disable=super-init-not-called
- self.id = id
+ self.version = version
@classmethod
- def from_dict(cls, _dict: Dict) -> 'LoadBalancerIdentityById':
- """Initialize a LoadBalancerIdentityById object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceCatalogOfferingPrototypeCatalogOfferingByVersion':
+ """Initialize a InstanceCatalogOfferingPrototypeCatalogOfferingByVersion object from a json dictionary."""
args = {}
- if 'id' in _dict:
- args['id'] = _dict.get('id')
+ if (version := _dict.get('version')) is not None:
+ args['version'] = version
else:
- raise ValueError('Required property \'id\' not present in LoadBalancerIdentityById JSON')
+ raise ValueError('Required property \'version\' not present in InstanceCatalogOfferingPrototypeCatalogOfferingByVersion JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a LoadBalancerIdentityById object from a json dictionary."""
+ """Initialize a InstanceCatalogOfferingPrototypeCatalogOfferingByVersion object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'id') and self.id is not None:
- _dict['id'] = self.id
+ if hasattr(self, 'version') and self.version is not None:
+ if isinstance(self.version, dict):
+ _dict['version'] = self.version
+ else:
+ _dict['version'] = self.version.to_dict()
return _dict
def _to_dict(self):
@@ -105585,119 +108853,355 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this LoadBalancerIdentityById object."""
+ """Return a `str` version of this InstanceCatalogOfferingPrototypeCatalogOfferingByVersion object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'LoadBalancerIdentityById') -> bool:
+ def __eq__(self, other: 'InstanceCatalogOfferingPrototypeCatalogOfferingByVersion') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'LoadBalancerIdentityById') -> bool:
+ def __ne__(self, other: 'InstanceCatalogOfferingPrototypeCatalogOfferingByVersion') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class LoadBalancerListenerIdentityByHref(LoadBalancerListenerIdentity):
+class InstanceGroupManagerActionPrototypeScheduledActionPrototype(InstanceGroupManagerActionPrototype):
"""
- LoadBalancerListenerIdentityByHref.
+ InstanceGroupManagerActionPrototypeScheduledActionPrototype.
+
+ :param str name: (optional) The name for this instance group manager action. The
+ name must not be used by another action for the instance group manager. If
+ unspecified, the name will be a hyphenated list of randomly-selected words.
+ """
+
+ def __init__(
+ self,
+ *,
+ name: Optional[str] = None,
+ ) -> None:
+ """
+ Initialize a InstanceGroupManagerActionPrototypeScheduledActionPrototype object.
+
+ :param str name: (optional) The name for this instance group manager
+ action. The name must not be used by another action for the instance group
+ manager. If unspecified, the name will be a hyphenated list of
+ randomly-selected words.
+ """
+ # pylint: disable=super-init-not-called
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAt', 'InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpec'])
+ )
+ raise Exception(msg)
+
- :attr str href: The listener's canonical URL.
+class InstanceGroupManagerActionScheduledAction(InstanceGroupManagerAction):
+ """
+ InstanceGroupManagerActionScheduledAction.
+
+ :param bool auto_delete: Indicates whether this scheduled action will be
+ automatically deleted after it has completed and `auto_delete_timeout` hours
+ have passed. At present, this is always
+ `true`, but may be modifiable in the future.
+ :param int auto_delete_timeout: If `auto_delete` is `true`, and this scheduled
+ action has finished, the hours after which it will be automatically deleted. If
+ the value is `0`, the action will be deleted once it has finished. This value
+ may be modifiable in the future.
+ :param datetime created_at: The date and time that the instance group manager
+ action was created.
+ :param str href: The URL for this instance group manager action.
+ :param str id: The unique identifier for this instance group manager action.
+ :param str name: The name for this instance group manager action. The name is
+ unique across all actions for the instance group manager.
+ :param str resource_type: The resource type.
+ :param str status: The status of the instance group action
+ - `active`: Action is ready to be run
+ - `completed`: Action was completed successfully
+ - `failed`: Action could not be completed successfully
+ - `incompatible`: Action parameters are not compatible with the group or manager
+ - `omitted`: Action was not applied because this action's manager was disabled.
+ :param datetime updated_at: The date and time that the instance group manager
+ action was updated.
+ :param str action_type: The type of action for the instance group.
+ :param str cron_spec: (optional) The cron specification for a recurring
+ scheduled action. Actions can be applied a maximum of one time within a 5 min
+ period.
+ :param datetime last_applied_at: (optional) The date and time the scheduled
+ action was last applied. If absent, the action has never been applied.
+ :param datetime next_run_at: (optional) The date and time the scheduled action
+ will next run. If absent, the system is currently calculating the next run time.
"""
def __init__(
self,
+ auto_delete: bool,
+ auto_delete_timeout: int,
+ created_at: datetime,
href: str,
+ id: str,
+ name: str,
+ resource_type: str,
+ status: str,
+ updated_at: datetime,
+ action_type: str,
+ *,
+ cron_spec: Optional[str] = None,
+ last_applied_at: Optional[datetime] = None,
+ next_run_at: Optional[datetime] = None,
) -> None:
"""
- Initialize a LoadBalancerListenerIdentityByHref object.
+ Initialize a InstanceGroupManagerActionScheduledAction object.
- :param str href: The listener's canonical URL.
+ :param bool auto_delete: Indicates whether this scheduled action will be
+ automatically deleted after it has completed and `auto_delete_timeout`
+ hours have passed. At present, this is always
+ `true`, but may be modifiable in the future.
+ :param int auto_delete_timeout: If `auto_delete` is `true`, and this
+ scheduled action has finished, the hours after which it will be
+ automatically deleted. If the value is `0`, the action will be deleted once
+ it has finished. This value may be modifiable in the future.
+ :param datetime created_at: The date and time that the instance group
+ manager action was created.
+ :param str href: The URL for this instance group manager action.
+ :param str id: The unique identifier for this instance group manager
+ action.
+ :param str name: The name for this instance group manager action. The name
+ is unique across all actions for the instance group manager.
+ :param str resource_type: The resource type.
+ :param str status: The status of the instance group action
+ - `active`: Action is ready to be run
+ - `completed`: Action was completed successfully
+ - `failed`: Action could not be completed successfully
+ - `incompatible`: Action parameters are not compatible with the group or
+ manager
+ - `omitted`: Action was not applied because this action's manager was
+ disabled.
+ :param datetime updated_at: The date and time that the instance group
+ manager action was updated.
+ :param str action_type: The type of action for the instance group.
+ :param str cron_spec: (optional) The cron specification for a recurring
+ scheduled action. Actions can be applied a maximum of one time within a 5
+ min period.
+ :param datetime last_applied_at: (optional) The date and time the scheduled
+ action was last applied. If absent, the action has never been applied.
+ :param datetime next_run_at: (optional) The date and time the scheduled
+ action will next run. If absent, the system is currently calculating the
+ next run time.
"""
# pylint: disable=super-init-not-called
- self.href = href
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['InstanceGroupManagerActionScheduledActionGroupTarget', 'InstanceGroupManagerActionScheduledActionManagerTarget'])
+ )
+ raise Exception(msg)
- @classmethod
- def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerIdentityByHref':
- """Initialize a LoadBalancerListenerIdentityByHref object from a json dictionary."""
- args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
- else:
- raise ValueError('Required property \'href\' not present in LoadBalancerListenerIdentityByHref JSON')
- return cls(**args)
+ class ResourceTypeEnum(str, Enum):
+ """
+ The resource type.
+ """
- @classmethod
- def _from_dict(cls, _dict):
- """Initialize a LoadBalancerListenerIdentityByHref object from a json dictionary."""
- return cls.from_dict(_dict)
+ INSTANCE_GROUP_MANAGER_ACTION = 'instance_group_manager_action'
- 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 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.
+ """
- def __str__(self) -> str:
- """Return a `str` version of this LoadBalancerListenerIdentityByHref object."""
- return json.dumps(self.to_dict(), indent=2)
+ ACTIVE = 'active'
+ COMPLETED = 'completed'
+ FAILED = 'failed'
+ INCOMPATIBLE = 'incompatible'
+ OMITTED = 'omitted'
- def __eq__(self, other: 'LoadBalancerListenerIdentityByHref') -> bool:
- """Return `true` when self and other are equal, false otherwise."""
- if not isinstance(other, self.__class__):
- return False
- return self.__dict__ == other.__dict__
- def __ne__(self, other: 'LoadBalancerListenerIdentityByHref') -> bool:
- """Return `true` when self and other are not equal, false otherwise."""
- return not self == other
+ class ActionTypeEnum(str, Enum):
+ """
+ The type of action for the instance group.
+ """
+
+ SCHEDULED = 'scheduled'
-class LoadBalancerListenerIdentityById(LoadBalancerListenerIdentity):
+
+class InstanceGroupManagerAutoScale(InstanceGroupManager):
"""
- LoadBalancerListenerIdentityById.
+ InstanceGroupManagerAutoScale.
- :attr str id: The unique identifier for this load balancer listener.
+ :param datetime created_at: The date and time that the instance group manager
+ was created.
+ :param str href: The URL for this instance group manager.
+ :param str id: The unique identifier for this instance group manager.
+ :param bool management_enabled: Indicates whether this manager will control the
+ instance group.
+ :param str name: The name for this instance group manager. The name is unique
+ across all managers for the instance group.
+ :param datetime updated_at: The date and time that the instance group manager
+ was updated.
+ :param int aggregation_window: The time window in seconds to aggregate metrics
+ prior to evaluation.
+ :param int cooldown: The duration of time in seconds to pause further scale
+ actions after scaling has taken place.
+ :param str manager_type: The type of instance group manager.
+ :param int max_membership_count: The maximum number of members in a managed
+ instance group.
+ :param int min_membership_count: The minimum number of members in a managed
+ instance group.
+ :param List[InstanceGroupManagerPolicyReference] policies: The policies of the
+ instance group manager.
"""
def __init__(
self,
+ created_at: datetime,
+ href: str,
id: str,
+ management_enabled: bool,
+ name: str,
+ updated_at: datetime,
+ aggregation_window: int,
+ cooldown: int,
+ manager_type: str,
+ max_membership_count: int,
+ min_membership_count: int,
+ policies: List['InstanceGroupManagerPolicyReference'],
) -> None:
"""
- Initialize a LoadBalancerListenerIdentityById object.
+ Initialize a InstanceGroupManagerAutoScale object.
- :param str id: The unique identifier for this load balancer listener.
+ :param datetime created_at: The date and time that the instance group
+ manager was created.
+ :param str href: The URL for this instance group manager.
+ :param str id: The unique identifier for this instance group manager.
+ :param bool management_enabled: Indicates whether this manager will control
+ the instance group.
+ :param str name: The name for this instance group manager. The name is
+ unique across all managers for the instance group.
+ :param datetime updated_at: The date and time that the instance group
+ manager was updated.
+ :param int aggregation_window: The time window in seconds to aggregate
+ metrics prior to evaluation.
+ :param int cooldown: The duration of time in seconds to pause further scale
+ actions after scaling has taken place.
+ :param str manager_type: The type of instance group manager.
+ :param int max_membership_count: The maximum number of members in a managed
+ instance group.
+ :param int min_membership_count: The minimum number of members in a managed
+ instance group.
+ :param List[InstanceGroupManagerPolicyReference] policies: The policies of
+ the instance group manager.
"""
# pylint: disable=super-init-not-called
+ self.created_at = created_at
+ self.href = href
self.id = id
+ self.management_enabled = management_enabled
+ self.name = name
+ self.updated_at = updated_at
+ self.aggregation_window = aggregation_window
+ self.cooldown = cooldown
+ self.manager_type = manager_type
+ self.max_membership_count = max_membership_count
+ self.min_membership_count = min_membership_count
+ self.policies = policies
@classmethod
- def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerIdentityById':
- """Initialize a LoadBalancerListenerIdentityById object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerAutoScale':
+ """Initialize a InstanceGroupManagerAutoScale object from a json dictionary."""
args = {}
- if 'id' in _dict:
- args['id'] = _dict.get('id')
+ if (created_at := _dict.get('created_at')) is not None:
+ args['created_at'] = string_to_datetime(created_at)
else:
- raise ValueError('Required property \'id\' not present in LoadBalancerListenerIdentityById JSON')
+ raise ValueError('Required property \'created_at\' not present in InstanceGroupManagerAutoScale JSON')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
+ else:
+ raise ValueError('Required property \'href\' not present in InstanceGroupManagerAutoScale JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
+ else:
+ raise ValueError('Required property \'id\' not present in InstanceGroupManagerAutoScale JSON')
+ if (management_enabled := _dict.get('management_enabled')) is not None:
+ args['management_enabled'] = management_enabled
+ else:
+ raise ValueError('Required property \'management_enabled\' not present in InstanceGroupManagerAutoScale JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ else:
+ raise ValueError('Required property \'name\' not present in InstanceGroupManagerAutoScale JSON')
+ if (updated_at := _dict.get('updated_at')) is not None:
+ args['updated_at'] = string_to_datetime(updated_at)
+ else:
+ raise ValueError('Required property \'updated_at\' not present in InstanceGroupManagerAutoScale JSON')
+ if (aggregation_window := _dict.get('aggregation_window')) is not None:
+ args['aggregation_window'] = aggregation_window
+ else:
+ raise ValueError('Required property \'aggregation_window\' not present in InstanceGroupManagerAutoScale JSON')
+ if (cooldown := _dict.get('cooldown')) is not None:
+ args['cooldown'] = cooldown
+ else:
+ raise ValueError('Required property \'cooldown\' not present in InstanceGroupManagerAutoScale JSON')
+ if (manager_type := _dict.get('manager_type')) is not None:
+ args['manager_type'] = manager_type
+ else:
+ raise ValueError('Required property \'manager_type\' not present in InstanceGroupManagerAutoScale JSON')
+ if (max_membership_count := _dict.get('max_membership_count')) is not None:
+ args['max_membership_count'] = max_membership_count
+ else:
+ raise ValueError('Required property \'max_membership_count\' not present in InstanceGroupManagerAutoScale JSON')
+ if (min_membership_count := _dict.get('min_membership_count')) is not None:
+ args['min_membership_count'] = min_membership_count
+ else:
+ raise ValueError('Required property \'min_membership_count\' not present in InstanceGroupManagerAutoScale JSON')
+ if (policies := _dict.get('policies')) is not None:
+ args['policies'] = [InstanceGroupManagerPolicyReference.from_dict(v) for v in policies]
+ else:
+ raise ValueError('Required property \'policies\' not present in InstanceGroupManagerAutoScale JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a LoadBalancerListenerIdentityById object from a json dictionary."""
+ """Initialize a InstanceGroupManagerAutoScale object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
+ if hasattr(self, 'created_at') and self.created_at is not None:
+ _dict['created_at'] = datetime_to_string(self.created_at)
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
if hasattr(self, 'id') and self.id is not None:
_dict['id'] = self.id
+ if hasattr(self, 'management_enabled') and self.management_enabled is not None:
+ _dict['management_enabled'] = self.management_enabled
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ if hasattr(self, 'updated_at') and self.updated_at is not None:
+ _dict['updated_at'] = datetime_to_string(self.updated_at)
+ if hasattr(self, 'aggregation_window') and self.aggregation_window is not None:
+ _dict['aggregation_window'] = self.aggregation_window
+ if hasattr(self, 'cooldown') and self.cooldown is not None:
+ _dict['cooldown'] = self.cooldown
+ if hasattr(self, 'manager_type') and self.manager_type is not None:
+ _dict['manager_type'] = self.manager_type
+ if hasattr(self, 'max_membership_count') and self.max_membership_count is not None:
+ _dict['max_membership_count'] = self.max_membership_count
+ if hasattr(self, 'min_membership_count') and self.min_membership_count is not None:
+ _dict['min_membership_count'] = self.min_membership_count
+ if hasattr(self, 'policies') and self.policies is not None:
+ policies_list = []
+ for v in self.policies:
+ if isinstance(v, dict):
+ policies_list.append(v)
+ else:
+ policies_list.append(v.to_dict())
+ _dict['policies'] = policies_list
return _dict
def _to_dict(self):
@@ -105705,80 +109209,101 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this LoadBalancerListenerIdentityById object."""
+ """Return a `str` version of this InstanceGroupManagerAutoScale object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'LoadBalancerListenerIdentityById') -> bool:
+ def __eq__(self, other: 'InstanceGroupManagerAutoScale') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'LoadBalancerListenerIdentityById') -> bool:
+ def __ne__(self, other: 'InstanceGroupManagerAutoScale') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
+ class ManagerTypeEnum(str, Enum):
+ """
+ The type of instance group manager.
+ """
+
+ AUTOSCALE = 'autoscale'
-class LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerHTTPSRedirectPatch(LoadBalancerListenerPolicyTargetPatch):
+
+
+class InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype(InstanceGroupManagerPolicyPrototype):
"""
- LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerHTTPSRedirectPatch.
+ InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype.
- :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.
+ :param str name: (optional) The name for this instance group manager policy. The
+ name must not be used by another policy for the instance group manager. If
+ unspecified, the name will be a hyphenated list of randomly-selected words.
+ :param str metric_type: The type of metric to be evaluated.
+ :param int metric_value: The metric value to be evaluated.
+ :param str policy_type: The type of policy for the instance group.
"""
def __init__(
self,
+ metric_type: str,
+ metric_value: int,
+ policy_type: str,
*,
- http_status_code: int = None,
- listener: 'LoadBalancerListenerIdentity' = None,
- uri: str = None,
+ name: Optional[str] = None,
) -> None:
"""
- Initialize a LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerHTTPSRedirectPatch object.
+ Initialize a InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype 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 metric_type: The type of metric to be evaluated.
+ :param int metric_value: The metric value to be evaluated.
+ :param str policy_type: The type of policy for the instance group.
+ :param str name: (optional) The name for this instance group manager
+ policy. The name must not be used by another policy for the instance group
+ manager. If unspecified, the name will be a hyphenated list of
+ randomly-selected words.
"""
# pylint: disable=super-init-not-called
- self.http_status_code = http_status_code
- self.listener = listener
- self.uri = uri
+ self.name = name
+ self.metric_type = metric_type
+ self.metric_value = metric_value
+ self.policy_type = policy_type
@classmethod
- def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerHTTPSRedirectPatch':
- """Initialize a LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerHTTPSRedirectPatch object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype':
+ """Initialize a InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype 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 (name := _dict.get('name')) is not None:
+ args['name'] = name
+ if (metric_type := _dict.get('metric_type')) is not None:
+ args['metric_type'] = metric_type
+ else:
+ raise ValueError('Required property \'metric_type\' not present in InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype JSON')
+ if (metric_value := _dict.get('metric_value')) is not None:
+ args['metric_value'] = metric_value
+ else:
+ raise ValueError('Required property \'metric_value\' not present in InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype JSON')
+ if (policy_type := _dict.get('policy_type')) is not None:
+ args['policy_type'] = policy_type
+ else:
+ raise ValueError('Required property \'policy_type\' not present in InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerHTTPSRedirectPatch object from a json dictionary."""
+ """Initialize a InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, '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, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ if hasattr(self, 'metric_type') and self.metric_type is not None:
+ _dict['metric_type'] = self.metric_type
+ if hasattr(self, 'metric_value') and self.metric_value is not None:
+ _dict['metric_value'] = self.metric_value
+ if hasattr(self, 'policy_type') and self.policy_type is not None:
+ _dict['policy_type'] = self.policy_type
return _dict
def _to_dict(self):
@@ -105786,67 +109311,155 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerHTTPSRedirectPatch object."""
+ """Return a `str` version of this InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerHTTPSRedirectPatch') -> bool:
+ def __eq__(self, other: 'InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerHTTPSRedirectPatch') -> bool:
+ def __ne__(self, other: 'InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype') -> 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 LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerPolicyRedirectURLPatch(LoadBalancerListenerPolicyTargetPatch):
+ class PolicyTypeEnum(str, Enum):
+ """
+ The type of policy for the instance group.
+ """
+
+ TARGET = 'target'
+
+
+
+class InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy(InstanceGroupManagerPolicy):
"""
- LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerPolicyRedirectURLPatch.
+ InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy.
- :attr int http_status_code: (optional) The HTTP status code for this redirect.
- :attr str url: (optional) The redirect target URL.
+ :param datetime created_at: The date and time that the instance group manager
+ policy was created.
+ :param str href: The URL for this instance group manager policy.
+ :param str id: The unique identifier for this instance group manager policy.
+ :param str name: The name for this instance group manager policy. The name is
+ unique across all policies for the instance group manager.
+ :param datetime updated_at: The date and time that the instance group manager
+ policy was updated.
+ :param str metric_type: The type of metric to be evaluated.
+ :param int metric_value: The metric value to be evaluated.
+ :param str policy_type: The type of policy for the instance group.
"""
def __init__(
self,
- *,
- http_status_code: int = None,
- url: str = None,
+ created_at: datetime,
+ href: str,
+ id: str,
+ name: str,
+ updated_at: datetime,
+ metric_type: str,
+ metric_value: int,
+ policy_type: str,
) -> None:
"""
- Initialize a LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerPolicyRedirectURLPatch object.
+ Initialize a InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy object.
- :param int http_status_code: (optional) The HTTP status code for this
- redirect.
- :param str url: (optional) The redirect target URL.
+ :param datetime created_at: The date and time that the instance group
+ manager policy was created.
+ :param str href: The URL for this instance group manager policy.
+ :param str id: The unique identifier for this instance group manager
+ policy.
+ :param str name: The name for this instance group manager policy. The name
+ is unique across all policies for the instance group manager.
+ :param datetime updated_at: The date and time that the instance group
+ manager policy was updated.
+ :param str metric_type: The type of metric to be evaluated.
+ :param int metric_value: The metric value to be evaluated.
+ :param str policy_type: The type of policy for the instance group.
"""
# pylint: disable=super-init-not-called
- self.http_status_code = http_status_code
- self.url = url
+ self.created_at = created_at
+ self.href = href
+ self.id = id
+ self.name = name
+ self.updated_at = updated_at
+ self.metric_type = metric_type
+ self.metric_value = metric_value
+ self.policy_type = policy_type
@classmethod
- def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerPolicyRedirectURLPatch':
- """Initialize a LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerPolicyRedirectURLPatch object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy':
+ """Initialize a InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy object from a json dictionary."""
args = {}
- if 'http_status_code' in _dict:
- args['http_status_code'] = _dict.get('http_status_code')
- if 'url' in _dict:
- args['url'] = _dict.get('url')
+ if (created_at := _dict.get('created_at')) is not None:
+ args['created_at'] = string_to_datetime(created_at)
+ else:
+ raise ValueError('Required property \'created_at\' not present in InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy JSON')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
+ else:
+ raise ValueError('Required property \'href\' not present in InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
+ else:
+ raise ValueError('Required property \'id\' not present in InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ else:
+ raise ValueError('Required property \'name\' not present in InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy JSON')
+ if (updated_at := _dict.get('updated_at')) is not None:
+ args['updated_at'] = string_to_datetime(updated_at)
+ else:
+ raise ValueError('Required property \'updated_at\' not present in InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy JSON')
+ if (metric_type := _dict.get('metric_type')) is not None:
+ args['metric_type'] = metric_type
+ else:
+ raise ValueError('Required property \'metric_type\' not present in InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy JSON')
+ if (metric_value := _dict.get('metric_value')) is not None:
+ args['metric_value'] = metric_value
+ else:
+ raise ValueError('Required property \'metric_value\' not present in InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy JSON')
+ if (policy_type := _dict.get('policy_type')) is not None:
+ args['policy_type'] = policy_type
+ else:
+ raise ValueError('Required property \'policy_type\' not present in InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerPolicyRedirectURLPatch object from a json dictionary."""
+ """Initialize a InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'http_status_code') and self.http_status_code is not None:
- _dict['http_status_code'] = self.http_status_code
- if hasattr(self, 'url') and self.url is not None:
- _dict['url'] = self.url
+ if hasattr(self, 'created_at') and self.created_at is not None:
+ _dict['created_at'] = datetime_to_string(self.created_at)
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
+ if hasattr(self, 'id') and self.id is not None:
+ _dict['id'] = self.id
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ if hasattr(self, 'updated_at') and self.updated_at is not None:
+ _dict['updated_at'] = datetime_to_string(self.updated_at)
+ if hasattr(self, 'metric_type') and self.metric_type is not None:
+ _dict['metric_type'] = self.metric_type
+ if hasattr(self, 'metric_value') and self.metric_value is not None:
+ _dict['metric_value'] = self.metric_value
+ if hasattr(self, 'policy_type') and self.policy_type is not None:
+ _dict['policy_type'] = self.policy_type
return _dict
def _to_dict(self):
@@ -105854,103 +109467,143 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerPolicyRedirectURLPatch object."""
+ """Return a `str` version of this InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerPolicyRedirectURLPatch') -> bool:
+ def __eq__(self, other: 'InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerPolicyRedirectURLPatch') -> bool:
+ def __ne__(self, other: 'InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy') -> 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.
+ """
-class LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentity(LoadBalancerListenerPolicyTargetPatch):
- """
- Identifies a load balancer pool by a unique property.
+ CPU = 'cpu'
+ MEMORY = 'memory'
+ NETWORK_IN = 'network_in'
+ NETWORK_OUT = 'network_out'
- """
- def __init__(
- self,
- ) -> None:
+ class PolicyTypeEnum(str, Enum):
"""
- Initialize a LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentity object.
-
+ The type of policy for the instance group.
"""
- # pylint: disable=super-init-not-called
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityById', 'LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityByHref'])
- )
- raise Exception(msg)
+
+ TARGET = 'target'
-class LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerHTTPSRedirectPrototype(LoadBalancerListenerPolicyTargetPrototype):
+
+class InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype(InstanceGroupManagerPrototype):
"""
- LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerHTTPSRedirectPrototype.
+ InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype.
- :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.
+ :param bool management_enabled: (optional) Indicates whether this manager will
+ control the instance group.
+ :param str name: (optional) The name for this instance group manager. The name
+ must not be used by another manager for the instance group. If unspecified, the
+ name will be a hyphenated list of randomly-selected words.
+ :param int aggregation_window: (optional) The time window in seconds to
+ aggregate metrics prior to evaluation.
+ :param int cooldown: (optional) The duration of time in seconds to pause further
+ scale actions after scaling has taken place.
+ :param str manager_type: The type of instance group manager.
+ :param int max_membership_count: The maximum number of members in a managed
+ instance group.
+ :param int min_membership_count: (optional) The minimum number of members in a
+ managed instance group.
"""
def __init__(
self,
- http_status_code: int,
- listener: 'LoadBalancerListenerIdentity',
+ manager_type: str,
+ max_membership_count: int,
*,
- uri: str = None,
+ management_enabled: Optional[bool] = None,
+ name: Optional[str] = None,
+ aggregation_window: Optional[int] = None,
+ cooldown: Optional[int] = None,
+ min_membership_count: Optional[int] = None,
) -> None:
"""
- Initialize a LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerHTTPSRedirectPrototype object.
+ Initialize a InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype 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 manager_type: The type of instance group manager.
+ :param int max_membership_count: The maximum number of members in a managed
+ instance group.
+ :param bool management_enabled: (optional) Indicates whether this manager
+ will control the instance group.
+ :param str name: (optional) The name for this instance group manager. The
+ name must not be used by another manager for the instance group. If
+ unspecified, the name will be a hyphenated list of randomly-selected words.
+ :param int aggregation_window: (optional) The time window in seconds to
+ aggregate metrics prior to evaluation.
+ :param int cooldown: (optional) The duration of time in seconds to pause
+ further scale actions after scaling has taken place.
+ :param int min_membership_count: (optional) The minimum number of members
+ in a managed instance group.
"""
# pylint: disable=super-init-not-called
- self.http_status_code = http_status_code
- self.listener = listener
- self.uri = uri
+ self.management_enabled = management_enabled
+ self.name = name
+ self.aggregation_window = aggregation_window
+ self.cooldown = cooldown
+ self.manager_type = manager_type
+ self.max_membership_count = max_membership_count
+ self.min_membership_count = min_membership_count
@classmethod
- def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerHTTPSRedirectPrototype':
- """Initialize a LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerHTTPSRedirectPrototype object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype':
+ """Initialize a InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype object from a json dictionary."""
args = {}
- if 'http_status_code' in _dict:
- args['http_status_code'] = _dict.get('http_status_code')
+ if (management_enabled := _dict.get('management_enabled')) is not None:
+ args['management_enabled'] = management_enabled
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ if (aggregation_window := _dict.get('aggregation_window')) is not None:
+ args['aggregation_window'] = aggregation_window
+ if (cooldown := _dict.get('cooldown')) is not None:
+ args['cooldown'] = cooldown
+ if (manager_type := _dict.get('manager_type')) is not None:
+ args['manager_type'] = manager_type
else:
- raise ValueError('Required property \'http_status_code\' not present in LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerHTTPSRedirectPrototype JSON')
- if 'listener' in _dict:
- args['listener'] = _dict.get('listener')
+ raise ValueError('Required property \'manager_type\' not present in InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype JSON')
+ if (max_membership_count := _dict.get('max_membership_count')) is not None:
+ args['max_membership_count'] = max_membership_count
else:
- raise ValueError('Required property \'listener\' not present in LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerHTTPSRedirectPrototype JSON')
- if 'uri' in _dict:
- args['uri'] = _dict.get('uri')
+ raise ValueError('Required property \'max_membership_count\' not present in InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype JSON')
+ if (min_membership_count := _dict.get('min_membership_count')) is not None:
+ args['min_membership_count'] = min_membership_count
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerHTTPSRedirectPrototype object from a json dictionary."""
+ """Initialize a InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, '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, 'management_enabled') and self.management_enabled is not None:
+ _dict['management_enabled'] = self.management_enabled
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ if hasattr(self, 'aggregation_window') and self.aggregation_window is not None:
+ _dict['aggregation_window'] = self.aggregation_window
+ if hasattr(self, 'cooldown') and self.cooldown is not None:
+ _dict['cooldown'] = self.cooldown
+ if hasattr(self, 'manager_type') and self.manager_type is not None:
+ _dict['manager_type'] = self.manager_type
+ if hasattr(self, 'max_membership_count') and self.max_membership_count is not None:
+ _dict['max_membership_count'] = self.max_membership_count
+ if hasattr(self, 'min_membership_count') and self.min_membership_count is not None:
+ _dict['min_membership_count'] = self.min_membership_count
return _dict
def _to_dict(self):
@@ -105958,69 +109611,90 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerHTTPSRedirectPrototype object."""
+ """Return a `str` version of this InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerHTTPSRedirectPrototype') -> bool:
+ def __eq__(self, other: 'InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerHTTPSRedirectPrototype') -> bool:
+ def __ne__(self, other: 'InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
+ class ManagerTypeEnum(str, Enum):
+ """
+ The type of instance group manager.
+ """
-class LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyRedirectURLPrototype(LoadBalancerListenerPolicyTargetPrototype):
+ AUTOSCALE = 'autoscale'
+
+
+
+class InstanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype(InstanceGroupManagerPrototype):
"""
- LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyRedirectURLPrototype.
+ InstanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype.
- :attr int http_status_code: The HTTP status code for this redirect.
- :attr str url: The redirect target URL.
+ :param bool management_enabled: (optional) Indicates whether this manager will
+ control the instance group.
+ :param str name: (optional) The name for this instance group manager. The name
+ must not be used by another manager for the instance group. If unspecified, the
+ name will be a hyphenated list of randomly-selected words.
+ :param str manager_type: The type of instance group manager.
"""
def __init__(
self,
- http_status_code: int,
- url: str,
+ manager_type: str,
+ *,
+ management_enabled: Optional[bool] = None,
+ name: Optional[str] = None,
) -> None:
"""
- Initialize a LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyRedirectURLPrototype object.
+ Initialize a InstanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype object.
- :param int http_status_code: The HTTP status code for this redirect.
- :param str url: The redirect target URL.
+ :param str manager_type: The type of instance group manager.
+ :param bool management_enabled: (optional) Indicates whether this manager
+ will control the instance group.
+ :param str name: (optional) The name for this instance group manager. The
+ name must not be used by another manager for the instance group. If
+ unspecified, the name will be a hyphenated list of randomly-selected words.
"""
# pylint: disable=super-init-not-called
- self.http_status_code = http_status_code
- self.url = url
+ self.management_enabled = management_enabled
+ self.name = name
+ self.manager_type = manager_type
@classmethod
- def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyRedirectURLPrototype':
- """Initialize a LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyRedirectURLPrototype object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype':
+ """Initialize a InstanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype object from a json dictionary."""
args = {}
- if 'http_status_code' in _dict:
- args['http_status_code'] = _dict.get('http_status_code')
- else:
- raise ValueError('Required property \'http_status_code\' not present in LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyRedirectURLPrototype JSON')
- if 'url' in _dict:
- args['url'] = _dict.get('url')
+ if (management_enabled := _dict.get('management_enabled')) is not None:
+ args['management_enabled'] = management_enabled
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ if (manager_type := _dict.get('manager_type')) is not None:
+ args['manager_type'] = manager_type
else:
- raise ValueError('Required property \'url\' not present in LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyRedirectURLPrototype JSON')
+ raise ValueError('Required property \'manager_type\' not present in InstanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyRedirectURLPrototype object from a json dictionary."""
+ """Initialize a InstanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'http_status_code') and self.http_status_code is not None:
- _dict['http_status_code'] = self.http_status_code
- if hasattr(self, 'url') and self.url is not None:
- _dict['url'] = self.url
+ if hasattr(self, 'management_enabled') and self.management_enabled is not None:
+ _dict['management_enabled'] = self.management_enabled
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ if hasattr(self, 'manager_type') and self.manager_type is not None:
+ _dict['manager_type'] = self.manager_type
return _dict
def _to_dict(self):
@@ -106028,101 +109702,153 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyRedirectURLPrototype object."""
+ """Return a `str` version of this InstanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyRedirectURLPrototype') -> bool:
+ def __eq__(self, other: 'InstanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyRedirectURLPrototype') -> bool:
+ def __ne__(self, other: 'InstanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-
-class LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentity(LoadBalancerListenerPolicyTargetPrototype):
- """
- Identifies a load balancer pool by a unique property.
-
- """
-
- def __init__(
- self,
- ) -> None:
+ class ManagerTypeEnum(str, Enum):
"""
- Initialize a LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentity object.
-
+ The type of instance group manager.
"""
- # pylint: disable=super-init-not-called
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityById', 'LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityByHref'])
- )
- raise Exception(msg)
+ SCHEDULED = 'scheduled'
-class LoadBalancerListenerPolicyTargetLoadBalancerListenerHTTPSRedirect(LoadBalancerListenerPolicyTarget):
+
+
+class InstanceGroupManagerScheduled(InstanceGroupManager):
"""
- LoadBalancerListenerPolicyTargetLoadBalancerListenerHTTPSRedirect.
+ InstanceGroupManagerScheduled.
- :attr int http_status_code: The HTTP status code for this redirect.
- :attr LoadBalancerListenerReference listener:
- :attr str uri: (optional) The redirect relative target URI.
+ :param datetime created_at: The date and time that the instance group manager
+ was created.
+ :param str href: The URL for this instance group manager.
+ :param str id: The unique identifier for this instance group manager.
+ :param bool management_enabled: Indicates whether this manager will control the
+ instance group.
+ :param str name: The name for this instance group manager. The name is unique
+ across all managers for the instance group.
+ :param datetime updated_at: The date and time that the instance group manager
+ was updated.
+ :param List[InstanceGroupManagerActionReference] actions: The actions of the
+ instance group manager.
+ :param str manager_type: The type of instance group manager.
"""
def __init__(
self,
- http_status_code: int,
- listener: 'LoadBalancerListenerReference',
- *,
- uri: str = None,
+ created_at: datetime,
+ href: str,
+ id: str,
+ management_enabled: bool,
+ name: str,
+ updated_at: datetime,
+ actions: List['InstanceGroupManagerActionReference'],
+ manager_type: str,
) -> None:
"""
- Initialize a LoadBalancerListenerPolicyTargetLoadBalancerListenerHTTPSRedirect object.
+ Initialize a InstanceGroupManagerScheduled 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 datetime created_at: The date and time that the instance group
+ manager was created.
+ :param str href: The URL for this instance group manager.
+ :param str id: The unique identifier for this instance group manager.
+ :param bool management_enabled: Indicates whether this manager will control
+ the instance group.
+ :param str name: The name for this instance group manager. The name is
+ unique across all managers for the instance group.
+ :param datetime updated_at: The date and time that the instance group
+ manager was updated.
+ :param List[InstanceGroupManagerActionReference] actions: The actions of
+ the instance group manager.
+ :param str manager_type: The type of instance group manager.
"""
# pylint: disable=super-init-not-called
- self.http_status_code = http_status_code
- self.listener = listener
- self.uri = uri
+ self.created_at = created_at
+ self.href = href
+ self.id = id
+ self.management_enabled = management_enabled
+ self.name = name
+ self.updated_at = updated_at
+ self.actions = actions
+ self.manager_type = manager_type
@classmethod
- def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerPolicyTargetLoadBalancerListenerHTTPSRedirect':
- """Initialize a LoadBalancerListenerPolicyTargetLoadBalancerListenerHTTPSRedirect object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerScheduled':
+ """Initialize a InstanceGroupManagerScheduled object from a json dictionary."""
args = {}
- if 'http_status_code' in _dict:
- args['http_status_code'] = _dict.get('http_status_code')
+ if (created_at := _dict.get('created_at')) is not None:
+ args['created_at'] = string_to_datetime(created_at)
else:
- raise ValueError('Required property \'http_status_code\' not present in LoadBalancerListenerPolicyTargetLoadBalancerListenerHTTPSRedirect JSON')
- if 'listener' in _dict:
- args['listener'] = LoadBalancerListenerReference.from_dict(_dict.get('listener'))
+ raise ValueError('Required property \'created_at\' not present in InstanceGroupManagerScheduled JSON')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'listener\' not present in LoadBalancerListenerPolicyTargetLoadBalancerListenerHTTPSRedirect JSON')
- if 'uri' in _dict:
- args['uri'] = _dict.get('uri')
+ raise ValueError('Required property \'href\' not present in InstanceGroupManagerScheduled JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
+ else:
+ raise ValueError('Required property \'id\' not present in InstanceGroupManagerScheduled JSON')
+ if (management_enabled := _dict.get('management_enabled')) is not None:
+ args['management_enabled'] = management_enabled
+ else:
+ raise ValueError('Required property \'management_enabled\' not present in InstanceGroupManagerScheduled JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ else:
+ raise ValueError('Required property \'name\' not present in InstanceGroupManagerScheduled JSON')
+ if (updated_at := _dict.get('updated_at')) is not None:
+ args['updated_at'] = string_to_datetime(updated_at)
+ else:
+ raise ValueError('Required property \'updated_at\' not present in InstanceGroupManagerScheduled JSON')
+ if (actions := _dict.get('actions')) is not None:
+ args['actions'] = [InstanceGroupManagerActionReference.from_dict(v) for v in actions]
+ else:
+ raise ValueError('Required property \'actions\' not present in InstanceGroupManagerScheduled JSON')
+ if (manager_type := _dict.get('manager_type')) is not None:
+ args['manager_type'] = manager_type
+ else:
+ raise ValueError('Required property \'manager_type\' not present in InstanceGroupManagerScheduled JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a LoadBalancerListenerPolicyTargetLoadBalancerListenerHTTPSRedirect object from a json dictionary."""
+ """Initialize a InstanceGroupManagerScheduled object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, '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, 'created_at') and self.created_at is not None:
+ _dict['created_at'] = datetime_to_string(self.created_at)
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
+ if hasattr(self, 'id') and self.id is not None:
+ _dict['id'] = self.id
+ if hasattr(self, 'management_enabled') and self.management_enabled is not None:
+ _dict['management_enabled'] = self.management_enabled
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ if hasattr(self, 'updated_at') and self.updated_at is not None:
+ _dict['updated_at'] = datetime_to_string(self.updated_at)
+ if hasattr(self, 'actions') and self.actions is not None:
+ actions_list = []
+ for v in self.actions:
+ if isinstance(v, dict):
+ actions_list.append(v)
+ else:
+ actions_list.append(v.to_dict())
+ _dict['actions'] = actions_list
+ if hasattr(self, 'manager_type') and self.manager_type is not None:
+ _dict['manager_type'] = self.manager_type
return _dict
def _to_dict(self):
@@ -106130,168 +109856,411 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this LoadBalancerListenerPolicyTargetLoadBalancerListenerHTTPSRedirect object."""
+ """Return a `str` version of this InstanceGroupManagerScheduled object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'LoadBalancerListenerPolicyTargetLoadBalancerListenerHTTPSRedirect') -> bool:
+ def __eq__(self, other: 'InstanceGroupManagerScheduled') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'LoadBalancerListenerPolicyTargetLoadBalancerListenerHTTPSRedirect') -> bool:
+ def __ne__(self, other: 'InstanceGroupManagerScheduled') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
+ class ManagerTypeEnum(str, Enum):
+ """
+ The type of instance group manager.
+ """
+
+ SCHEDULED = 'scheduled'
-class LoadBalancerListenerPolicyTargetLoadBalancerListenerPolicyRedirectURL(LoadBalancerListenerPolicyTarget):
+
+
+class InstanceGroupManagerScheduledActionManagerAutoScale(InstanceGroupManagerScheduledActionManager):
"""
- LoadBalancerListenerPolicyTargetLoadBalancerListenerPolicyRedirectURL.
+ InstanceGroupManagerScheduledActionManagerAutoScale.
- :attr int http_status_code: The HTTP status code for this redirect.
- :attr str url: The redirect target URL.
+ :param InstanceGroupManagerReferenceDeleted 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 instance group manager.
+ :param str id: The unique identifier for this instance group manager.
+ :param str name: The name for this instance group manager. The name is unique
+ across all managers for the instance group.
+ :param int max_membership_count: (optional) The desired maximum number of
+ instance group members at the scheduled time.
+ :param int min_membership_count: (optional) The desired minimum number of
+ instance group members at the scheduled time.
"""
def __init__(
self,
- http_status_code: int,
- url: str,
+ href: str,
+ id: str,
+ name: str,
+ *,
+ deleted: Optional['InstanceGroupManagerReferenceDeleted'] = None,
+ max_membership_count: Optional[int] = None,
+ min_membership_count: Optional[int] = None,
) -> None:
"""
- Initialize a LoadBalancerListenerPolicyTargetLoadBalancerListenerPolicyRedirectURL object.
+ Initialize a InstanceGroupManagerScheduledActionManagerAutoScale object.
- :param int http_status_code: The HTTP status code for this redirect.
- :param str url: The redirect target URL.
+ :param str href: The URL for this instance group manager.
+ :param str id: The unique identifier for this instance group manager.
+ :param str name: The name for this instance group manager. The name is
+ unique across all managers for the instance group.
+ :param InstanceGroupManagerReferenceDeleted deleted: (optional) If present,
+ this property indicates the referenced resource has been deleted, and
+ provides
+ some supplementary information.
+ :param int max_membership_count: (optional) The desired maximum number of
+ instance group members at the scheduled time.
+ :param int min_membership_count: (optional) The desired minimum number of
+ instance group members at the scheduled time.
"""
# pylint: disable=super-init-not-called
- self.http_status_code = http_status_code
- self.url = url
+ self.deleted = deleted
+ self.href = href
+ self.id = id
+ self.name = name
+ self.max_membership_count = max_membership_count
+ self.min_membership_count = min_membership_count
@classmethod
- def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerPolicyTargetLoadBalancerListenerPolicyRedirectURL':
- """Initialize a LoadBalancerListenerPolicyTargetLoadBalancerListenerPolicyRedirectURL object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerScheduledActionManagerAutoScale':
+ """Initialize a InstanceGroupManagerScheduledActionManagerAutoScale object from a json dictionary."""
args = {}
- if 'http_status_code' in _dict:
- args['http_status_code'] = _dict.get('http_status_code')
+ if (deleted := _dict.get('deleted')) is not None:
+ args['deleted'] = InstanceGroupManagerReferenceDeleted.from_dict(deleted)
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'http_status_code\' not present in LoadBalancerListenerPolicyTargetLoadBalancerListenerPolicyRedirectURL JSON')
- if 'url' in _dict:
- args['url'] = _dict.get('url')
+ raise ValueError('Required property \'href\' not present in InstanceGroupManagerScheduledActionManagerAutoScale JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
else:
- raise ValueError('Required property \'url\' not present in LoadBalancerListenerPolicyTargetLoadBalancerListenerPolicyRedirectURL JSON')
+ raise ValueError('Required property \'id\' not present in InstanceGroupManagerScheduledActionManagerAutoScale JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ else:
+ raise ValueError('Required property \'name\' not present in InstanceGroupManagerScheduledActionManagerAutoScale JSON')
+ if (max_membership_count := _dict.get('max_membership_count')) is not None:
+ args['max_membership_count'] = max_membership_count
+ if (min_membership_count := _dict.get('min_membership_count')) is not None:
+ args['min_membership_count'] = min_membership_count
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a LoadBalancerListenerPolicyTargetLoadBalancerListenerPolicyRedirectURL object from a json dictionary."""
+ """Initialize a InstanceGroupManagerScheduledActionManagerAutoScale object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'http_status_code') and self.http_status_code is not None:
- _dict['http_status_code'] = self.http_status_code
- if hasattr(self, 'url') and self.url is not None:
- _dict['url'] = self.url
- return _dict
-
- def _to_dict(self):
- """Return a json dictionary representing this model."""
- return self.to_dict()
-
- def __str__(self) -> str:
- """Return a `str` version of this LoadBalancerListenerPolicyTargetLoadBalancerListenerPolicyRedirectURL object."""
+ if hasattr(self, 'deleted') and self.deleted is not None:
+ if isinstance(self.deleted, dict):
+ _dict['deleted'] = self.deleted
+ else:
+ _dict['deleted'] = self.deleted.to_dict()
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
+ if hasattr(self, 'id') and self.id is not None:
+ _dict['id'] = self.id
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ if hasattr(self, 'max_membership_count') and self.max_membership_count is not None:
+ _dict['max_membership_count'] = self.max_membership_count
+ if hasattr(self, 'min_membership_count') and self.min_membership_count is not None:
+ _dict['min_membership_count'] = self.min_membership_count
+ return _dict
+
+ def _to_dict(self):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
+
+ def __str__(self) -> str:
+ """Return a `str` version of this InstanceGroupManagerScheduledActionManagerAutoScale object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'LoadBalancerListenerPolicyTargetLoadBalancerListenerPolicyRedirectURL') -> bool:
+ def __eq__(self, other: 'InstanceGroupManagerScheduledActionManagerAutoScale') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'LoadBalancerListenerPolicyTargetLoadBalancerListenerPolicyRedirectURL') -> bool:
+ def __ne__(self, other: 'InstanceGroupManagerScheduledActionManagerAutoScale') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class LoadBalancerListenerPolicyTargetLoadBalancerPoolReference(LoadBalancerListenerPolicyTarget):
+class InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototype(InstanceGroupManagerScheduledActionManagerPrototype):
"""
- LoadBalancerListenerPolicyTargetLoadBalancerPoolReference.
+ The auto scale manager to update, and one or more properties to be updated. Either
+ `id` or `href` must be specified, in addition to at least one of
+ `min_membership_count` and
+ `max_membership_count`.
- :attr LoadBalancerPoolReferenceDeleted deleted: (optional) If present, this
- property indicates the referenced resource has been deleted, and provides
- some supplementary information.
- :attr str href: The pool's canonical URL.
- :attr str id: The unique identifier for this load balancer pool.
- :attr str name: The name for this load balancer pool. The name is unique across
- all pools for the load balancer.
+ :param int max_membership_count: (optional) The desired maximum number of
+ instance group members at the scheduled time.
+ :param int min_membership_count: (optional) The desired minimum number of
+ instance group members at the scheduled time.
"""
def __init__(
self,
- href: str,
- id: str,
- name: str,
*,
- deleted: 'LoadBalancerPoolReferenceDeleted' = None,
+ max_membership_count: Optional[int] = None,
+ min_membership_count: Optional[int] = None,
) -> None:
"""
- Initialize a LoadBalancerListenerPolicyTargetLoadBalancerPoolReference object.
+ Initialize a InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototype object.
- :param str href: The pool's canonical URL.
- :param str id: The unique identifier for this load balancer pool.
- :param str name: The name for this load balancer pool. The name is unique
- across all pools for the load balancer.
- :param LoadBalancerPoolReferenceDeleted deleted: (optional) If present,
- this property indicates the referenced resource has been deleted, and
- provides
- some supplementary information.
+ :param int max_membership_count: (optional) The desired maximum number of
+ instance group members at the scheduled time.
+ :param int min_membership_count: (optional) The desired minimum number of
+ instance group members at the scheduled time.
"""
# pylint: disable=super-init-not-called
- self.deleted = deleted
- self.href = href
- self.id = id
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeById', 'InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByHref'])
+ )
+ raise Exception(msg)
+
+
+class InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentity(InstanceNetworkAttachmentPrototypeVirtualNetworkInterface):
+ """
+ Identifies a virtual network interface by a unique property.
+
+ """
+
+ def __init__(
+ self,
+ ) -> None:
+ """
+ Initialize a InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentity object.
+
+ """
+ # pylint: disable=super-init-not-called
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById', 'InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref', 'InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN'])
+ )
+ raise Exception(msg)
+
+
+class InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeInstanceNetworkAttachmentContext(InstanceNetworkAttachmentPrototypeVirtualNetworkInterface):
+ """
+ The virtual network interface for this target.
+
+ :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 auto_delete: (optional) Indicates whether this virtual network
+ interface will be automatically deleted when
+ `target` is deleted.
+ :param bool enable_infrastructure_nat: (optional) If `true`:
+ - The VPC infrastructure performs any needed NAT operations.
+ - `floating_ips` must not have more than one floating IP.
+ If `false`:
+ - Packets are passed unchanged to/from the virtual network interface,
+ allowing the workload to perform any needed NAT operations.
+ - `allow_ip_spoofing` must be `false`.
+ - Can only be attached to a `target` with a `resource_type` of
+ `bare_metal_server_network_attachment`.
+ :param List[VirtualNetworkInterfaceIPPrototype] ips: (optional) Additional IP
+ addresses to bind to the virtual network interface. Each item may be either a
+ reserved IP identity, or a reserved IP prototype object which will be used to
+ create a new reserved IP. All IP addresses must be in the primary IP's subnet.
+ If reserved IP identities are provided, the specified reserved IPs must be
+ unbound.
+ If reserved IP prototype objects with addresses are provided, the addresses must
+ be available on the virtual network interface's subnet. For any prototype
+ objects that do not specify an address, an available address on the subnet will
+ be automatically selected and reserved.
+ :param str name: (optional) The name for this virtual network interface. The
+ name must not be used by another virtual network interface in the VPC. If
+ unspecified, the name will be a hyphenated list of randomly-selected words.
+ Names beginning with `ibm-` are reserved for provider-owned resources, and are
+ not allowed.
+ :param VirtualNetworkInterfacePrimaryIPPrototype primary_ip: (optional) The
+ primary IP address to bind to the virtual network interface. May be either a
+ reserved IP identity, or a reserved IP prototype object which will be used to
+ create a
+ new reserved IP.
+ If a reserved IP identity is provided, the specified reserved IP must be
+ unbound.
+ If a reserved IP prototype object with an address is provided, the address must
+ be
+ available on the virtual network interface's subnet. If no address is specified,
+ an available address on the subnet will be automatically selected and reserved.
+ :param ResourceGroupIdentity resource_group: (optional) The resource group to
+ use for this virtual network interface. If unspecified, the
+ virtual server instance's resource group will be used.
+ :param List[SecurityGroupIdentity] security_groups: (optional) The security
+ groups to use for this virtual network interface. If unspecified, the default
+ security group of the VPC for the subnet is used.
+ :param SubnetIdentity subnet: (optional) The associated subnet. Required if
+ `primary_ip` does not specify a reserved IP
+ identity.
+ """
+
+ def __init__(
+ self,
+ *,
+ allow_ip_spoofing: Optional[bool] = None,
+ auto_delete: Optional[bool] = None,
+ enable_infrastructure_nat: Optional[bool] = None,
+ ips: Optional[List['VirtualNetworkInterfaceIPPrototype']] = None,
+ name: Optional[str] = None,
+ primary_ip: Optional['VirtualNetworkInterfacePrimaryIPPrototype'] = None,
+ resource_group: Optional['ResourceGroupIdentity'] = None,
+ security_groups: Optional[List['SecurityGroupIdentity']] = None,
+ subnet: Optional['SubnetIdentity'] = None,
+ ) -> None:
+ """
+ Initialize a InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeInstanceNetworkAttachmentContext 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 bool auto_delete: (optional) Indicates whether this virtual network
+ interface will be automatically deleted when
+ `target` is deleted.
+ :param bool enable_infrastructure_nat: (optional) If `true`:
+ - The VPC infrastructure performs any needed NAT operations.
+ - `floating_ips` must not have more than one floating IP.
+ If `false`:
+ - Packets are passed unchanged to/from the virtual network interface,
+ allowing the workload to perform any needed NAT operations.
+ - `allow_ip_spoofing` must be `false`.
+ - Can only be attached to a `target` with a `resource_type` of
+ `bare_metal_server_network_attachment`.
+ :param List[VirtualNetworkInterfaceIPPrototype] ips: (optional) Additional
+ IP addresses to bind to the virtual network interface. Each item may be
+ either a reserved IP identity, or a reserved IP prototype object which will
+ be used to create a new reserved IP. All IP addresses must be in the
+ primary IP's subnet.
+ If reserved IP identities are provided, the specified reserved IPs must be
+ unbound.
+ If reserved IP prototype objects with addresses are provided, the addresses
+ must be available on the virtual network interface's subnet. For any
+ prototype objects that do not specify an address, an available address on
+ the subnet will be automatically selected and reserved.
+ :param str name: (optional) The name for this virtual network interface.
+ The name must not be used by another virtual network interface in the VPC.
+ If unspecified, the name will be a hyphenated list of randomly-selected
+ words. Names beginning with `ibm-` are reserved for provider-owned
+ resources, and are not allowed.
+ :param VirtualNetworkInterfacePrimaryIPPrototype primary_ip: (optional) The
+ primary IP address to bind to the virtual network interface. May be either
+ a
+ reserved IP identity, or a reserved IP prototype object which will be used
+ to create a
+ new reserved IP.
+ If a reserved IP identity is provided, the specified reserved IP must be
+ unbound.
+ If a reserved IP prototype object with an address is provided, the address
+ must be
+ available on the virtual network interface's subnet. If no address is
+ specified,
+ an available address on the subnet will be automatically selected and
+ reserved.
+ :param ResourceGroupIdentity resource_group: (optional) The resource group
+ to use for this virtual network interface. If unspecified, the
+ virtual server instance's resource group will be used.
+ :param List[SecurityGroupIdentity] security_groups: (optional) The security
+ groups to use for this virtual network interface. If unspecified, the
+ default security group of the VPC for the subnet is used.
+ :param SubnetIdentity subnet: (optional) The associated subnet. Required if
+ `primary_ip` does not specify a reserved IP
+ identity.
+ """
+ # pylint: disable=super-init-not-called
+ self.allow_ip_spoofing = allow_ip_spoofing
+ self.auto_delete = auto_delete
+ self.enable_infrastructure_nat = enable_infrastructure_nat
+ self.ips = ips
self.name = name
+ self.primary_ip = primary_ip
+ self.resource_group = resource_group
+ self.security_groups = security_groups
+ self.subnet = subnet
@classmethod
- def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerPolicyTargetLoadBalancerPoolReference':
- """Initialize a LoadBalancerListenerPolicyTargetLoadBalancerPoolReference object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeInstanceNetworkAttachmentContext':
+ """Initialize a InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeInstanceNetworkAttachmentContext object from a json dictionary."""
args = {}
- if 'deleted' in _dict:
- args['deleted'] = LoadBalancerPoolReferenceDeleted.from_dict(_dict.get('deleted'))
- if 'href' in _dict:
- args['href'] = _dict.get('href')
- else:
- raise ValueError('Required property \'href\' not present in LoadBalancerListenerPolicyTargetLoadBalancerPoolReference JSON')
- if 'id' in _dict:
- args['id'] = _dict.get('id')
- else:
- raise ValueError('Required property \'id\' not present in LoadBalancerListenerPolicyTargetLoadBalancerPoolReference JSON')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
- else:
- raise ValueError('Required property \'name\' not present in LoadBalancerListenerPolicyTargetLoadBalancerPoolReference JSON')
+ if (allow_ip_spoofing := _dict.get('allow_ip_spoofing')) is not None:
+ args['allow_ip_spoofing'] = allow_ip_spoofing
+ if (auto_delete := _dict.get('auto_delete')) is not None:
+ args['auto_delete'] = auto_delete
+ if (enable_infrastructure_nat := _dict.get('enable_infrastructure_nat')) is not None:
+ args['enable_infrastructure_nat'] = enable_infrastructure_nat
+ if (ips := _dict.get('ips')) is not None:
+ args['ips'] = ips
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ if (primary_ip := _dict.get('primary_ip')) is not None:
+ args['primary_ip'] = primary_ip
+ if (resource_group := _dict.get('resource_group')) is not None:
+ args['resource_group'] = resource_group
+ if (security_groups := _dict.get('security_groups')) is not None:
+ args['security_groups'] = security_groups
+ if (subnet := _dict.get('subnet')) is not None:
+ args['subnet'] = subnet
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a LoadBalancerListenerPolicyTargetLoadBalancerPoolReference object from a json dictionary."""
+ """Initialize a InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeInstanceNetworkAttachmentContext object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'deleted') and self.deleted is not None:
- if isinstance(self.deleted, dict):
- _dict['deleted'] = self.deleted
- else:
- _dict['deleted'] = self.deleted.to_dict()
- if hasattr(self, 'href') and self.href is not None:
- _dict['href'] = self.href
- if hasattr(self, 'id') and self.id is not None:
- _dict['id'] = self.id
+ if hasattr(self, 'allow_ip_spoofing') and self.allow_ip_spoofing is not None:
+ _dict['allow_ip_spoofing'] = self.allow_ip_spoofing
+ if hasattr(self, 'auto_delete') and self.auto_delete is not None:
+ _dict['auto_delete'] = self.auto_delete
+ 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, 'ips') and self.ips is not None:
+ ips_list = []
+ for v in self.ips:
+ if isinstance(v, dict):
+ ips_list.append(v)
+ else:
+ ips_list.append(v.to_dict())
+ _dict['ips'] = ips_list
if hasattr(self, 'name') and self.name is not None:
_dict['name'] = self.name
+ if hasattr(self, 'primary_ip') and self.primary_ip is not None:
+ if isinstance(self.primary_ip, dict):
+ _dict['primary_ip'] = self.primary_ip
+ else:
+ _dict['primary_ip'] = self.primary_ip.to_dict()
+ if hasattr(self, 'resource_group') and self.resource_group is not None:
+ if isinstance(self.resource_group, dict):
+ _dict['resource_group'] = self.resource_group
+ else:
+ _dict['resource_group'] = self.resource_group.to_dict()
+ if hasattr(self, 'security_groups') and self.security_groups is not None:
+ security_groups_list = []
+ for v in self.security_groups:
+ if isinstance(v, dict):
+ security_groups_list.append(v)
+ else:
+ security_groups_list.append(v.to_dict())
+ _dict['security_groups'] = security_groups_list
+ if hasattr(self, 'subnet') and self.subnet is not None:
+ if isinstance(self.subnet, dict):
+ _dict['subnet'] = self.subnet
+ else:
+ _dict['subnet'] = self.subnet.to_dict()
return _dict
def _to_dict(self):
@@ -106299,25 +110268,25 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this LoadBalancerListenerPolicyTargetLoadBalancerPoolReference object."""
+ """Return a `str` version of this InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeInstanceNetworkAttachmentContext object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'LoadBalancerListenerPolicyTargetLoadBalancerPoolReference') -> bool:
+ def __eq__(self, other: 'InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeInstanceNetworkAttachmentContext') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'LoadBalancerListenerPolicyTargetLoadBalancerPoolReference') -> bool:
+ def __ne__(self, other: 'InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeInstanceNetworkAttachmentContext') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class LoadBalancerPoolIdentityByHref(LoadBalancerPoolIdentity):
+class InstancePatchProfileInstanceProfileIdentityByHref(InstancePatchProfile):
"""
- LoadBalancerPoolIdentityByHref.
+ InstancePatchProfileInstanceProfileIdentityByHref.
- :attr str href: The pool's canonical URL.
+ :param str href: The URL for this virtual server instance profile.
"""
def __init__(
@@ -106325,26 +110294,26 @@ def __init__(
href: str,
) -> None:
"""
- Initialize a LoadBalancerPoolIdentityByHref object.
+ Initialize a InstancePatchProfileInstanceProfileIdentityByHref object.
- :param str href: The pool's canonical URL.
+ :param str href: The URL for this virtual server instance profile.
"""
# pylint: disable=super-init-not-called
self.href = href
@classmethod
- def from_dict(cls, _dict: Dict) -> 'LoadBalancerPoolIdentityByHref':
- """Initialize a LoadBalancerPoolIdentityByHref object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstancePatchProfileInstanceProfileIdentityByHref':
+ """Initialize a InstancePatchProfileInstanceProfileIdentityByHref object from a json dictionary."""
args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'href\' not present in LoadBalancerPoolIdentityByHref JSON')
+ raise ValueError('Required property \'href\' not present in InstancePatchProfileInstanceProfileIdentityByHref JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a LoadBalancerPoolIdentityByHref object from a json dictionary."""
+ """Initialize a InstancePatchProfileInstanceProfileIdentityByHref object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -106359,59 +110328,61 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this LoadBalancerPoolIdentityByHref object."""
+ """Return a `str` version of this InstancePatchProfileInstanceProfileIdentityByHref object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'LoadBalancerPoolIdentityByHref') -> bool:
+ def __eq__(self, other: 'InstancePatchProfileInstanceProfileIdentityByHref') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'LoadBalancerPoolIdentityByHref') -> bool:
+ def __ne__(self, other: 'InstancePatchProfileInstanceProfileIdentityByHref') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class LoadBalancerPoolIdentityById(LoadBalancerPoolIdentity):
+class InstancePatchProfileInstanceProfileIdentityByName(InstancePatchProfile):
"""
- LoadBalancerPoolIdentityById.
+ InstancePatchProfileInstanceProfileIdentityByName.
- :attr str id: The unique identifier for this load balancer pool.
+ :param str name: The globally unique name for this virtual server instance
+ profile.
"""
def __init__(
self,
- id: str,
+ name: str,
) -> None:
"""
- Initialize a LoadBalancerPoolIdentityById object.
+ Initialize a InstancePatchProfileInstanceProfileIdentityByName object.
- :param str id: The unique identifier for this load balancer pool.
+ :param str name: The globally unique name for this virtual server instance
+ profile.
"""
# pylint: disable=super-init-not-called
- self.id = id
+ self.name = name
@classmethod
- def from_dict(cls, _dict: Dict) -> 'LoadBalancerPoolIdentityById':
- """Initialize a LoadBalancerPoolIdentityById object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstancePatchProfileInstanceProfileIdentityByName':
+ """Initialize a InstancePatchProfileInstanceProfileIdentityByName object from a json dictionary."""
args = {}
- if 'id' in _dict:
- args['id'] = _dict.get('id')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
else:
- raise ValueError('Required property \'id\' not present in LoadBalancerPoolIdentityById JSON')
+ raise ValueError('Required property \'name\' not present in InstancePatchProfileInstanceProfileIdentityByName JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a LoadBalancerPoolIdentityById object from a json dictionary."""
+ """Initialize a InstancePatchProfileInstanceProfileIdentityByName object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'id') and self.id is not None:
- _dict['id'] = self.id
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
return _dict
def _to_dict(self):
@@ -106419,92 +110390,63 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this LoadBalancerPoolIdentityById object."""
+ """Return a `str` version of this InstancePatchProfileInstanceProfileIdentityByName object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'LoadBalancerPoolIdentityById') -> bool:
+ def __eq__(self, other: 'InstancePatchProfileInstanceProfileIdentityByName') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'LoadBalancerPoolIdentityById') -> bool:
+ def __ne__(self, other: 'InstancePatchProfileInstanceProfileIdentityByName') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class LoadBalancerPoolMemberTargetPrototypeIP(LoadBalancerPoolMemberTargetPrototype):
+class InstancePlacementTargetPatchDedicatedHostGroupIdentity(InstancePlacementTargetPatch):
"""
- LoadBalancerPoolMemberTargetPrototypeIP.
+ Identifies a dedicated host group by a unique property.
- :attr str address: The IP address.
- This property may add support for IPv6 addresses in the future. When processing
- a value in this property, verify that the address is in an expected format. If
- it is not, log an error. Optionally halt processing and surface the error, or
- bypass the resource on which the unexpected IP address format was encountered.
"""
def __init__(
self,
- address: str,
) -> None:
"""
- Initialize a LoadBalancerPoolMemberTargetPrototypeIP object.
+ Initialize a InstancePlacementTargetPatchDedicatedHostGroupIdentity object.
- :param str address: The IP address.
- This property may add support for IPv6 addresses in the future. When
- processing a value in this property, verify that the address is in an
- expected format. If it is not, log an error. Optionally halt processing and
- surface the error, or bypass the resource on which the unexpected IP
- address format was encountered.
"""
# pylint: disable=super-init-not-called
- self.address = address
-
- @classmethod
- def from_dict(cls, _dict: Dict) -> 'LoadBalancerPoolMemberTargetPrototypeIP':
- """Initialize a LoadBalancerPoolMemberTargetPrototypeIP object from a json dictionary."""
- args = {}
- if 'address' in _dict:
- args['address'] = _dict.get('address')
- else:
- raise ValueError('Required property \'address\' not present in LoadBalancerPoolMemberTargetPrototypeIP JSON')
- return cls(**args)
-
- @classmethod
- def _from_dict(cls, _dict):
- """Initialize a LoadBalancerPoolMemberTargetPrototypeIP object from a json dictionary."""
- return cls.from_dict(_dict)
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityById', 'InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN', 'InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref'])
+ )
+ raise Exception(msg)
- def to_dict(self) -> Dict:
- """Return a json dictionary representing this model."""
- _dict = {}
- if hasattr(self, 'address') and self.address is not None:
- _dict['address'] = self.address
- return _dict
- def _to_dict(self):
- """Return a json dictionary representing this model."""
- return self.to_dict()
+class InstancePlacementTargetPatchDedicatedHostIdentity(InstancePlacementTargetPatch):
+ """
+ Identifies a dedicated host by a unique property.
- def __str__(self) -> str:
- """Return a `str` version of this LoadBalancerPoolMemberTargetPrototypeIP object."""
- return json.dumps(self.to_dict(), indent=2)
+ """
- def __eq__(self, other: 'LoadBalancerPoolMemberTargetPrototypeIP') -> bool:
- """Return `true` when self and other are equal, false otherwise."""
- if not isinstance(other, self.__class__):
- return False
- return self.__dict__ == other.__dict__
+ def __init__(
+ self,
+ ) -> None:
+ """
+ Initialize a InstancePlacementTargetPatchDedicatedHostIdentity object.
- def __ne__(self, other: 'LoadBalancerPoolMemberTargetPrototypeIP') -> bool:
- """Return `true` when self and other are not equal, false otherwise."""
- return not self == other
+ """
+ # 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 LoadBalancerPoolMemberTargetPrototypeInstanceIdentity(LoadBalancerPoolMemberTargetPrototype):
+class InstancePlacementTargetPrototypeDedicatedHostGroupIdentity(InstancePlacementTargetPrototype):
"""
- Identifies a virtual server instance by a unique property.
+ Identifies a dedicated host group by a unique property.
"""
@@ -106512,97 +110454,69 @@ def __init__(
self,
) -> None:
"""
- Initialize a LoadBalancerPoolMemberTargetPrototypeInstanceIdentity object.
+ Initialize a InstancePlacementTargetPrototypeDedicatedHostGroupIdentity object.
"""
# pylint: disable=super-init-not-called
msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById', 'LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByCRN', 'LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByHref'])
+ ", ".join(['InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityById', 'InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN', 'InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref'])
)
raise Exception(msg)
-class LoadBalancerPoolMemberTargetIP(LoadBalancerPoolMemberTarget):
+class InstancePlacementTargetPrototypeDedicatedHostIdentity(InstancePlacementTargetPrototype):
"""
- LoadBalancerPoolMemberTargetIP.
+ Identifies a dedicated host by a unique property.
- :attr str address: The IP address.
- This property may add support for IPv6 addresses in the future. When processing
- a value in this property, verify that the address is in an expected format. If
- it is not, log an error. Optionally halt processing and surface the error, or
- bypass the resource on which the unexpected IP address format was encountered.
"""
def __init__(
self,
- address: str,
) -> None:
"""
- Initialize a LoadBalancerPoolMemberTargetIP object.
+ Initialize a InstancePlacementTargetPrototypeDedicatedHostIdentity object.
- :param str address: The IP address.
- This property may add support for IPv6 addresses in the future. When
- processing a value in this property, verify that the address is in an
- expected format. If it is not, log an error. Optionally halt processing and
- surface the error, or bypass the resource on which the unexpected IP
- address format was encountered.
"""
# pylint: disable=super-init-not-called
- self.address = address
-
- @classmethod
- def from_dict(cls, _dict: Dict) -> 'LoadBalancerPoolMemberTargetIP':
- """Initialize a LoadBalancerPoolMemberTargetIP object from a json dictionary."""
- args = {}
- if 'address' in _dict:
- args['address'] = _dict.get('address')
- else:
- raise ValueError('Required property \'address\' not present in LoadBalancerPoolMemberTargetIP JSON')
- return cls(**args)
-
- @classmethod
- def _from_dict(cls, _dict):
- """Initialize a LoadBalancerPoolMemberTargetIP object from a json dictionary."""
- return cls.from_dict(_dict)
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById', 'InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByCRN', 'InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByHref'])
+ )
+ raise Exception(msg)
- def to_dict(self) -> Dict:
- """Return a json dictionary representing this model."""
- _dict = {}
- if hasattr(self, 'address') and self.address is not None:
- _dict['address'] = self.address
- return _dict
- def _to_dict(self):
- """Return a json dictionary representing this model."""
- return self.to_dict()
+class InstancePlacementTargetPrototypePlacementGroupIdentity(InstancePlacementTargetPrototype):
+ """
+ Identifies a placement group by a unique property.
- def __str__(self) -> str:
- """Return a `str` version of this LoadBalancerPoolMemberTargetIP object."""
- return json.dumps(self.to_dict(), indent=2)
+ """
- def __eq__(self, other: 'LoadBalancerPoolMemberTargetIP') -> bool:
- """Return `true` when self and other are equal, false otherwise."""
- if not isinstance(other, self.__class__):
- return False
- return self.__dict__ == other.__dict__
+ def __init__(
+ self,
+ ) -> None:
+ """
+ Initialize a InstancePlacementTargetPrototypePlacementGroupIdentity object.
- def __ne__(self, other: 'LoadBalancerPoolMemberTargetIP') -> bool:
- """Return `true` when self and other are not equal, false otherwise."""
- return not self == other
+ """
+ # pylint: disable=super-init-not-called
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityById', 'InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByCRN', 'InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByHref'])
+ )
+ raise Exception(msg)
-class LoadBalancerPoolMemberTargetInstanceReference(LoadBalancerPoolMemberTarget):
+class InstancePlacementTargetDedicatedHostGroupReference(InstancePlacementTarget):
"""
- LoadBalancerPoolMemberTargetInstanceReference.
+ InstancePlacementTargetDedicatedHostGroupReference.
- :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
+ :param str crn: The CRN for this dedicated host group.
+ :param 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 virtual server instance.
- :attr str id: The unique identifier for this virtual server instance.
- :attr str name: The name for this virtual server instance. The name is unique
- across all virtual server instances in the region.
+ :param str href: The URL for this dedicated host group.
+ :param str id: The unique identifier for this dedicated host group.
+ :param str name: The name for this dedicated host group. The name is unique
+ across all dedicated host groups in the region.
+ :param str resource_type: The resource type.
"""
def __init__(
@@ -106611,19 +110525,22 @@ def __init__(
href: str,
id: str,
name: str,
+ resource_type: str,
*,
- deleted: 'InstanceReferenceDeleted' = None,
+ deleted: Optional['DedicatedHostGroupReferenceDeleted'] = None,
) -> None:
"""
- Initialize a LoadBalancerPoolMemberTargetInstanceReference object.
+ Initialize a InstancePlacementTargetDedicatedHostGroupReference object.
- :param str crn: The CRN for this virtual server instance.
- :param str href: The URL for this virtual server instance.
- :param str id: The unique identifier for this virtual server instance.
- :param str name: The name for this virtual server instance. The name is
- unique across all virtual server instances in the region.
- :param InstanceReferenceDeleted deleted: (optional) If present, this
- property indicates the referenced resource has been deleted, and provides
+ :param str crn: The CRN for this dedicated host group.
+ :param str href: The URL for this dedicated host group.
+ :param str id: The unique identifier for this dedicated host group.
+ :param str name: The name for this dedicated host group. The name is unique
+ across all dedicated host groups in the region.
+ :param str resource_type: The resource type.
+ :param DedicatedHostGroupReferenceDeleted deleted: (optional) If present,
+ this property indicates the referenced resource has been deleted, and
+ provides
some supplementary information.
"""
# pylint: disable=super-init-not-called
@@ -106632,34 +110549,39 @@ def __init__(
self.href = href
self.id = id
self.name = name
+ self.resource_type = resource_type
@classmethod
- def from_dict(cls, _dict: Dict) -> 'LoadBalancerPoolMemberTargetInstanceReference':
- """Initialize a LoadBalancerPoolMemberTargetInstanceReference object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstancePlacementTargetDedicatedHostGroupReference':
+ """Initialize a InstancePlacementTargetDedicatedHostGroupReference object from a json dictionary."""
args = {}
- if 'crn' in _dict:
- args['crn'] = _dict.get('crn')
+ if (crn := _dict.get('crn')) is not None:
+ args['crn'] = crn
else:
- raise ValueError('Required property \'crn\' not present in LoadBalancerPoolMemberTargetInstanceReference JSON')
- if 'deleted' in _dict:
- args['deleted'] = InstanceReferenceDeleted.from_dict(_dict.get('deleted'))
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ raise ValueError('Required property \'crn\' not present in InstancePlacementTargetDedicatedHostGroupReference JSON')
+ if (deleted := _dict.get('deleted')) is not None:
+ args['deleted'] = DedicatedHostGroupReferenceDeleted.from_dict(deleted)
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'href\' not present in LoadBalancerPoolMemberTargetInstanceReference JSON')
- if 'id' in _dict:
- args['id'] = _dict.get('id')
+ raise ValueError('Required property \'href\' not present in InstancePlacementTargetDedicatedHostGroupReference JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
else:
- raise ValueError('Required property \'id\' not present in LoadBalancerPoolMemberTargetInstanceReference JSON')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
+ raise ValueError('Required property \'id\' not present in InstancePlacementTargetDedicatedHostGroupReference JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
else:
- raise ValueError('Required property \'name\' not present in LoadBalancerPoolMemberTargetInstanceReference JSON')
+ raise ValueError('Required property \'name\' not present in InstancePlacementTargetDedicatedHostGroupReference JSON')
+ if (resource_type := _dict.get('resource_type')) is not None:
+ args['resource_type'] = resource_type
+ else:
+ raise ValueError('Required property \'resource_type\' not present in InstancePlacementTargetDedicatedHostGroupReference JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a LoadBalancerPoolMemberTargetInstanceReference object from a json dictionary."""
+ """Initialize a InstancePlacementTargetDedicatedHostGroupReference object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -106678,6 +110600,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):
@@ -106685,59 +110609,125 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this LoadBalancerPoolMemberTargetInstanceReference object."""
+ """Return a `str` version of this InstancePlacementTargetDedicatedHostGroupReference object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'LoadBalancerPoolMemberTargetInstanceReference') -> bool:
+ def __eq__(self, other: 'InstancePlacementTargetDedicatedHostGroupReference') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'LoadBalancerPoolMemberTargetInstanceReference') -> bool:
+ def __ne__(self, other: 'InstancePlacementTargetDedicatedHostGroupReference') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
+ class ResourceTypeEnum(str, Enum):
+ """
+ The resource type.
+ """
-class LoadBalancerProfileIdentityByHref(LoadBalancerProfileIdentity):
+ DEDICATED_HOST_GROUP = 'dedicated_host_group'
+
+
+
+class InstancePlacementTargetDedicatedHostReference(InstancePlacementTarget):
"""
- LoadBalancerProfileIdentityByHref.
+ InstancePlacementTargetDedicatedHostReference.
- :attr str href: The URL for this load balancer profile.
+ :param str crn: The CRN for this dedicated host.
+ :param DedicatedHostReferenceDeleted 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 dedicated host.
+ :param str id: The unique identifier for this dedicated host.
+ :param str name: The name for this dedicated host. The name is unique across all
+ dedicated hosts in the region.
+ :param str resource_type: The resource type.
"""
def __init__(
self,
+ crn: str,
href: str,
+ id: str,
+ name: str,
+ resource_type: str,
+ *,
+ deleted: Optional['DedicatedHostReferenceDeleted'] = None,
) -> None:
"""
- Initialize a LoadBalancerProfileIdentityByHref object.
+ Initialize a InstancePlacementTargetDedicatedHostReference object.
- :param str href: The URL for this load balancer profile.
+ :param str crn: The CRN for this dedicated host.
+ :param str href: The URL for this dedicated host.
+ :param str id: The unique identifier for this dedicated host.
+ :param str name: The name for this dedicated host. The name is unique
+ across all dedicated hosts in the region.
+ :param str resource_type: The resource type.
+ :param DedicatedHostReferenceDeleted deleted: (optional) If present, this
+ property indicates the referenced resource has been deleted, and provides
+ some supplementary information.
"""
# pylint: disable=super-init-not-called
+ self.crn = crn
+ self.deleted = deleted
self.href = href
+ self.id = id
+ self.name = name
+ self.resource_type = resource_type
@classmethod
- def from_dict(cls, _dict: Dict) -> 'LoadBalancerProfileIdentityByHref':
- """Initialize a LoadBalancerProfileIdentityByHref object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstancePlacementTargetDedicatedHostReference':
+ """Initialize a InstancePlacementTargetDedicatedHostReference object from a json dictionary."""
args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ if (crn := _dict.get('crn')) is not None:
+ args['crn'] = crn
else:
- raise ValueError('Required property \'href\' not present in LoadBalancerProfileIdentityByHref JSON')
+ raise ValueError('Required property \'crn\' not present in InstancePlacementTargetDedicatedHostReference JSON')
+ if (deleted := _dict.get('deleted')) is not None:
+ args['deleted'] = DedicatedHostReferenceDeleted.from_dict(deleted)
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
+ else:
+ raise ValueError('Required property \'href\' not present in InstancePlacementTargetDedicatedHostReference JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
+ else:
+ raise ValueError('Required property \'id\' not present in InstancePlacementTargetDedicatedHostReference JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ else:
+ raise ValueError('Required property \'name\' not present in InstancePlacementTargetDedicatedHostReference JSON')
+ if (resource_type := _dict.get('resource_type')) is not None:
+ args['resource_type'] = resource_type
+ else:
+ raise ValueError('Required property \'resource_type\' not present in InstancePlacementTargetDedicatedHostReference JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a LoadBalancerProfileIdentityByHref object from a json dictionary."""
+ """Initialize a InstancePlacementTargetDedicatedHostReference object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
+ if hasattr(self, 'crn') and self.crn is not None:
+ _dict['crn'] = self.crn
+ if hasattr(self, 'deleted') and self.deleted is not None:
+ if isinstance(self.deleted, dict):
+ _dict['deleted'] = self.deleted
+ else:
+ _dict['deleted'] = self.deleted.to_dict()
if hasattr(self, 'href') and self.href is not None:
_dict['href'] = self.href
+ if hasattr(self, 'id') and self.id is not None:
+ _dict['id'] = self.id
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ if hasattr(self, 'resource_type') and self.resource_type is not None:
+ _dict['resource_type'] = self.resource_type
return _dict
def _to_dict(self):
@@ -106745,59 +110735,125 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this LoadBalancerProfileIdentityByHref object."""
+ """Return a `str` version of this InstancePlacementTargetDedicatedHostReference object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'LoadBalancerProfileIdentityByHref') -> bool:
+ def __eq__(self, other: 'InstancePlacementTargetDedicatedHostReference') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'LoadBalancerProfileIdentityByHref') -> bool:
+ def __ne__(self, other: 'InstancePlacementTargetDedicatedHostReference') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
+ class ResourceTypeEnum(str, Enum):
+ """
+ The resource type.
+ """
-class LoadBalancerProfileIdentityByName(LoadBalancerProfileIdentity):
+ DEDICATED_HOST = 'dedicated_host'
+
+
+
+class InstancePlacementTargetPlacementGroupReference(InstancePlacementTarget):
"""
- LoadBalancerProfileIdentityByName.
+ InstancePlacementTargetPlacementGroupReference.
- :attr str name: The globally unique name for this load balancer profile.
+ :param str crn: The CRN for this placement group.
+ :param PlacementGroupReferenceDeleted 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 placement group.
+ :param str id: The unique identifier for this placement group.
+ :param str name: The name for this placement group. The name is unique across
+ all placement groups in the region.
+ :param str resource_type: The resource type.
"""
def __init__(
self,
+ crn: str,
+ href: str,
+ id: str,
name: str,
+ resource_type: str,
+ *,
+ deleted: Optional['PlacementGroupReferenceDeleted'] = None,
) -> None:
"""
- Initialize a LoadBalancerProfileIdentityByName object.
+ Initialize a InstancePlacementTargetPlacementGroupReference object.
- :param str name: The globally unique name for this load balancer profile.
+ :param str crn: The CRN for this placement group.
+ :param str href: The URL for this placement group.
+ :param str id: The unique identifier for this placement group.
+ :param str name: The name for this placement group. The name is unique
+ across all placement groups in the region.
+ :param str resource_type: The resource type.
+ :param PlacementGroupReferenceDeleted deleted: (optional) If present, this
+ property indicates the referenced resource has been deleted, and provides
+ some supplementary information.
"""
# pylint: disable=super-init-not-called
+ self.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) -> 'LoadBalancerProfileIdentityByName':
- """Initialize a LoadBalancerProfileIdentityByName object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstancePlacementTargetPlacementGroupReference':
+ """Initialize a InstancePlacementTargetPlacementGroupReference object from a json dictionary."""
args = {}
- if 'name' in _dict:
- args['name'] = _dict.get('name')
+ if (crn := _dict.get('crn')) is not None:
+ args['crn'] = crn
else:
- raise ValueError('Required property \'name\' not present in LoadBalancerProfileIdentityByName JSON')
+ raise ValueError('Required property \'crn\' not present in InstancePlacementTargetPlacementGroupReference JSON')
+ if (deleted := _dict.get('deleted')) is not None:
+ args['deleted'] = PlacementGroupReferenceDeleted.from_dict(deleted)
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
+ else:
+ raise ValueError('Required property \'href\' not present in InstancePlacementTargetPlacementGroupReference JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
+ else:
+ raise ValueError('Required property \'id\' not present in InstancePlacementTargetPlacementGroupReference JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ else:
+ raise ValueError('Required property \'name\' not present in InstancePlacementTargetPlacementGroupReference JSON')
+ if (resource_type := _dict.get('resource_type')) is not None:
+ args['resource_type'] = resource_type
+ else:
+ raise ValueError('Required property \'resource_type\' not present in InstancePlacementTargetPlacementGroupReference JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a LoadBalancerProfileIdentityByName object from a json dictionary."""
+ """Initialize a InstancePlacementTargetPlacementGroupReference object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
+ if hasattr(self, 'crn') and self.crn is not None:
+ _dict['crn'] = self.crn
+ if hasattr(self, 'deleted') and self.deleted is not None:
+ if isinstance(self.deleted, dict):
+ _dict['deleted'] = self.deleted
+ else:
+ _dict['deleted'] = self.deleted.to_dict()
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
+ if hasattr(self, 'id') and self.id is not None:
+ _dict['id'] = self.id
if hasattr(self, 'name') and self.name is not None:
_dict['name'] = self.name
+ if hasattr(self, 'resource_type') and self.resource_type is not None:
+ _dict['resource_type'] = self.resource_type
return _dict
def _to_dict(self):
@@ -106805,26 +110861,34 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this LoadBalancerProfileIdentityByName object."""
+ """Return a `str` version of this InstancePlacementTargetPlacementGroupReference object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'LoadBalancerProfileIdentityByName') -> bool:
+ def __eq__(self, other: 'InstancePlacementTargetPlacementGroupReference') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'LoadBalancerProfileIdentityByName') -> bool:
+ def __ne__(self, other: 'InstancePlacementTargetPlacementGroupReference') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
+ class ResourceTypeEnum(str, Enum):
+ """
+ The resource type.
+ """
-class LoadBalancerProfileInstanceGroupsSupportedDependent(LoadBalancerProfileInstanceGroupsSupported):
+ PLACEMENT_GROUP = 'placement_group'
+
+
+
+class InstanceProfileBandwidthDependent(InstanceProfileBandwidth):
"""
- The instance groups support for a load balancer with this profile depends on its
- configuration.
+ The total bandwidth shared across the network attachments or network interfaces and
+ storage volumes of an instance with this profile depends on its configuration.
- :attr str type: The type for this profile field.
+ :param str type: The type for this profile field.
"""
def __init__(
@@ -106832,7 +110896,7 @@ def __init__(
type: str,
) -> None:
"""
- Initialize a LoadBalancerProfileInstanceGroupsSupportedDependent object.
+ Initialize a InstanceProfileBandwidthDependent object.
:param str type: The type for this profile field.
"""
@@ -106840,18 +110904,18 @@ def __init__(
self.type = type
@classmethod
- def from_dict(cls, _dict: Dict) -> 'LoadBalancerProfileInstanceGroupsSupportedDependent':
- """Initialize a LoadBalancerProfileInstanceGroupsSupportedDependent object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceProfileBandwidthDependent':
+ """Initialize a InstanceProfileBandwidthDependent object from a json dictionary."""
args = {}
- if 'type' in _dict:
- args['type'] = _dict.get('type')
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
else:
- raise ValueError('Required property \'type\' not present in LoadBalancerProfileInstanceGroupsSupportedDependent JSON')
+ raise ValueError('Required property \'type\' not present in InstanceProfileBandwidthDependent JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a LoadBalancerProfileInstanceGroupsSupportedDependent object from a json dictionary."""
+ """Initialize a InstanceProfileBandwidthDependent object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -106866,16 +110930,16 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this LoadBalancerProfileInstanceGroupsSupportedDependent object."""
+ """Return a `str` version of this InstanceProfileBandwidthDependent object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'LoadBalancerProfileInstanceGroupsSupportedDependent') -> bool:
+ def __eq__(self, other: 'InstanceProfileBandwidthDependent') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'LoadBalancerProfileInstanceGroupsSupportedDependent') -> bool:
+ def __ne__(self, other: 'InstanceProfileBandwidthDependent') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
@@ -106888,55 +110952,67 @@ class TypeEnum(str, Enum):
-class LoadBalancerProfileInstanceGroupsSupportedFixed(LoadBalancerProfileInstanceGroupsSupported):
+class InstanceProfileBandwidthEnum(InstanceProfileBandwidth):
"""
- The instance groups support for a load balancer with this profile.
+ The permitted total bandwidth values (in megabits per second) shared across the
+ network attachments or network interfaces and storage volumes of an instance with this
+ profile.
- :attr str type: The type for this profile field.
- :attr bool value: The value for this profile field.
+ :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.
"""
def __init__(
self,
+ default: int,
type: str,
- value: bool,
+ values: List[int],
) -> None:
"""
- Initialize a LoadBalancerProfileInstanceGroupsSupportedFixed object.
+ Initialize a InstanceProfileBandwidthEnum object.
+ :param int default: The default value for this profile field.
:param str type: The type for this profile field.
- :param bool value: The value for this profile field.
+ :param List[int] values: The permitted values for this profile field.
"""
# pylint: disable=super-init-not-called
+ self.default = default
self.type = type
- self.value = value
+ self.values = values
@classmethod
- def from_dict(cls, _dict: Dict) -> 'LoadBalancerProfileInstanceGroupsSupportedFixed':
- """Initialize a LoadBalancerProfileInstanceGroupsSupportedFixed object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceProfileBandwidthEnum':
+ """Initialize a InstanceProfileBandwidthEnum object from a json dictionary."""
args = {}
- if 'type' in _dict:
- args['type'] = _dict.get('type')
+ if (default := _dict.get('default')) is not None:
+ args['default'] = default
else:
- raise ValueError('Required property \'type\' not present in LoadBalancerProfileInstanceGroupsSupportedFixed JSON')
- if 'value' in _dict:
- args['value'] = _dict.get('value')
+ raise ValueError('Required property \'default\' not present in InstanceProfileBandwidthEnum JSON')
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
else:
- raise ValueError('Required property \'value\' not present in LoadBalancerProfileInstanceGroupsSupportedFixed JSON')
+ raise ValueError('Required property \'type\' not present in InstanceProfileBandwidthEnum JSON')
+ if (values := _dict.get('values')) is not None:
+ args['values'] = values
+ else:
+ raise ValueError('Required property \'values\' not present in InstanceProfileBandwidthEnum JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a LoadBalancerProfileInstanceGroupsSupportedFixed object from a json dictionary."""
+ """Initialize a InstanceProfileBandwidthEnum object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
+ if hasattr(self, '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, 'values') and self.values is not None:
+ _dict['values'] = self.values
return _dict
def _to_dict(self):
@@ -106944,16 +111020,16 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this LoadBalancerProfileInstanceGroupsSupportedFixed object."""
+ """Return a `str` version of this InstanceProfileBandwidthEnum object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'LoadBalancerProfileInstanceGroupsSupportedFixed') -> bool:
+ def __eq__(self, other: 'InstanceProfileBandwidthEnum') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'LoadBalancerProfileInstanceGroupsSupportedFixed') -> bool:
+ def __ne__(self, other: 'InstanceProfileBandwidthEnum') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
@@ -106962,43 +111038,51 @@ class TypeEnum(str, Enum):
The type for this profile field.
"""
- FIXED = 'fixed'
+ ENUM = 'enum'
-class LoadBalancerProfileRouteModeSupportedDependent(LoadBalancerProfileRouteModeSupported):
+class InstanceProfileBandwidthFixed(InstanceProfileBandwidth):
"""
- The route mode support for a load balancer with this profile depends on its
- configuration.
+ The total bandwidth (in megabits per second) shared across the network attachments or
+ network interfaces and storage volumes of an instance with this profile.
- :attr str type: The type for this profile field.
+ :param str type: The type for this profile field.
+ :param int value: The value for this profile field.
"""
def __init__(
self,
type: str,
+ value: int,
) -> None:
"""
- Initialize a LoadBalancerProfileRouteModeSupportedDependent object.
+ Initialize a InstanceProfileBandwidthFixed object.
:param str type: The type for this profile field.
+ :param int value: The value for this profile field.
"""
# pylint: disable=super-init-not-called
self.type = type
+ self.value = value
@classmethod
- def from_dict(cls, _dict: Dict) -> 'LoadBalancerProfileRouteModeSupportedDependent':
- """Initialize a LoadBalancerProfileRouteModeSupportedDependent object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceProfileBandwidthFixed':
+ """Initialize a InstanceProfileBandwidthFixed object from a json dictionary."""
args = {}
- if 'type' in _dict:
- args['type'] = _dict.get('type')
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
else:
- raise ValueError('Required property \'type\' not present in LoadBalancerProfileRouteModeSupportedDependent JSON')
+ raise ValueError('Required property \'type\' not present in InstanceProfileBandwidthFixed JSON')
+ if (value := _dict.get('value')) is not None:
+ args['value'] = value
+ else:
+ raise ValueError('Required property \'value\' not present in InstanceProfileBandwidthFixed JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a LoadBalancerProfileRouteModeSupportedDependent object from a json dictionary."""
+ """Initialize a InstanceProfileBandwidthFixed object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -107006,6 +111090,8 @@ def to_dict(self) -> Dict:
_dict = {}
if hasattr(self, 'type') and self.type is not None:
_dict['type'] = self.type
+ if hasattr(self, 'value') and self.value is not None:
+ _dict['value'] = self.value
return _dict
def _to_dict(self):
@@ -107013,16 +111099,16 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this LoadBalancerProfileRouteModeSupportedDependent object."""
+ """Return a `str` version of this InstanceProfileBandwidthFixed object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'LoadBalancerProfileRouteModeSupportedDependent') -> bool:
+ def __eq__(self, other: 'InstanceProfileBandwidthFixed') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'LoadBalancerProfileRouteModeSupportedDependent') -> bool:
+ def __ne__(self, other: 'InstanceProfileBandwidthFixed') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
@@ -107031,59 +111117,91 @@ class TypeEnum(str, Enum):
The type for this profile field.
"""
- DEPENDENT = 'dependent'
+ FIXED = 'fixed'
-class LoadBalancerProfileRouteModeSupportedFixed(LoadBalancerProfileRouteModeSupported):
+class InstanceProfileBandwidthRange(InstanceProfileBandwidth):
"""
- The route mode support for a load balancer with this profile.
+ The permitted total bandwidth range (in megabits per second) shared across the network
+ attachments or network interfaces and storage volumes of an instance with this
+ profile.
- :attr str type: The type for this profile field.
- :attr bool value: The value for this profile field.
+ :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.
"""
def __init__(
self,
+ default: int,
+ max: int,
+ min: int,
+ step: int,
type: str,
- value: bool,
) -> None:
"""
- Initialize a LoadBalancerProfileRouteModeSupportedFixed object.
+ Initialize a InstanceProfileBandwidthRange object.
+ :param int default: The default value for this profile field.
+ :param int max: The maximum value for this profile field.
+ :param int min: The minimum value for this profile field.
+ :param int step: The increment step value for this profile field.
:param str type: The type for this profile field.
- :param bool value: The value for this profile field.
"""
# pylint: disable=super-init-not-called
+ self.default = default
+ self.max = max
+ self.min = min
+ self.step = step
self.type = type
- self.value = value
@classmethod
- def from_dict(cls, _dict: Dict) -> 'LoadBalancerProfileRouteModeSupportedFixed':
- """Initialize a LoadBalancerProfileRouteModeSupportedFixed object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceProfileBandwidthRange':
+ """Initialize a InstanceProfileBandwidthRange object from a json dictionary."""
args = {}
- if 'type' in _dict:
- args['type'] = _dict.get('type')
+ if (default := _dict.get('default')) is not None:
+ args['default'] = default
else:
- raise ValueError('Required property \'type\' not present in LoadBalancerProfileRouteModeSupportedFixed JSON')
- if 'value' in _dict:
- args['value'] = _dict.get('value')
+ raise ValueError('Required property \'default\' not present in InstanceProfileBandwidthRange JSON')
+ if (max := _dict.get('max')) is not None:
+ args['max'] = max
else:
- raise ValueError('Required property \'value\' not present in LoadBalancerProfileRouteModeSupportedFixed JSON')
+ raise ValueError('Required property \'max\' not present in InstanceProfileBandwidthRange JSON')
+ if (min := _dict.get('min')) is not None:
+ args['min'] = min
+ else:
+ raise ValueError('Required property \'min\' not present in InstanceProfileBandwidthRange JSON')
+ if (step := _dict.get('step')) is not None:
+ args['step'] = step
+ else:
+ raise ValueError('Required property \'step\' not present in InstanceProfileBandwidthRange JSON')
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
+ else:
+ raise ValueError('Required property \'type\' not present in InstanceProfileBandwidthRange JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a LoadBalancerProfileRouteModeSupportedFixed object from a json dictionary."""
+ """Initialize a InstanceProfileBandwidthRange object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
+ if hasattr(self, 'default') and self.default is not None:
+ _dict['default'] = self.default
+ if hasattr(self, 'max') and self.max is not None:
+ _dict['max'] = self.max
+ if hasattr(self, 'min') and self.min is not None:
+ _dict['min'] = self.min
+ if hasattr(self, 'step') and self.step is not None:
+ _dict['step'] = self.step
if hasattr(self, 'type') and self.type is not None:
_dict['type'] = self.type
- if hasattr(self, 'value') and self.value is not None:
- _dict['value'] = self.value
return _dict
def _to_dict(self):
@@ -107091,16 +111209,16 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this LoadBalancerProfileRouteModeSupportedFixed object."""
+ """Return a `str` version of this InstanceProfileBandwidthRange object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'LoadBalancerProfileRouteModeSupportedFixed') -> bool:
+ def __eq__(self, other: 'InstanceProfileBandwidthRange') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'LoadBalancerProfileRouteModeSupportedFixed') -> bool:
+ def __ne__(self, other: 'InstanceProfileBandwidthRange') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
@@ -107109,16 +111227,16 @@ class TypeEnum(str, Enum):
The type for this profile field.
"""
- FIXED = 'fixed'
+ RANGE = 'range'
-class LoadBalancerProfileSecurityGroupsSupportedDependent(LoadBalancerProfileSecurityGroupsSupported):
+class InstanceProfileDiskQuantityDependent(InstanceProfileDiskQuantity):
"""
- The security group support for a load balancer with this profile depends on its
- configuration.
+ The number of disks of this configuration for an instance with this profile depends on
+ its instance configuration.
- :attr str type: The type for this profile field.
+ :param str type: The type for this profile field.
"""
def __init__(
@@ -107126,7 +111244,7 @@ def __init__(
type: str,
) -> None:
"""
- Initialize a LoadBalancerProfileSecurityGroupsSupportedDependent object.
+ Initialize a InstanceProfileDiskQuantityDependent object.
:param str type: The type for this profile field.
"""
@@ -107134,18 +111252,18 @@ def __init__(
self.type = type
@classmethod
- def from_dict(cls, _dict: Dict) -> 'LoadBalancerProfileSecurityGroupsSupportedDependent':
- """Initialize a LoadBalancerProfileSecurityGroupsSupportedDependent object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceProfileDiskQuantityDependent':
+ """Initialize a InstanceProfileDiskQuantityDependent object from a json dictionary."""
args = {}
- if 'type' in _dict:
- args['type'] = _dict.get('type')
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
else:
- raise ValueError('Required property \'type\' not present in LoadBalancerProfileSecurityGroupsSupportedDependent JSON')
+ raise ValueError('Required property \'type\' not present in InstanceProfileDiskQuantityDependent JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a LoadBalancerProfileSecurityGroupsSupportedDependent object from a json dictionary."""
+ """Initialize a InstanceProfileDiskQuantityDependent object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -107160,16 +111278,16 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this LoadBalancerProfileSecurityGroupsSupportedDependent object."""
+ """Return a `str` version of this InstanceProfileDiskQuantityDependent object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'LoadBalancerProfileSecurityGroupsSupportedDependent') -> bool:
+ def __eq__(self, other: 'InstanceProfileDiskQuantityDependent') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'LoadBalancerProfileSecurityGroupsSupportedDependent') -> bool:
+ def __ne__(self, other: 'InstanceProfileDiskQuantityDependent') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
@@ -107182,55 +111300,66 @@ class TypeEnum(str, Enum):
-class LoadBalancerProfileSecurityGroupsSupportedFixed(LoadBalancerProfileSecurityGroupsSupported):
+class InstanceProfileDiskQuantityEnum(InstanceProfileDiskQuantity):
"""
- The security group support for a load balancer with this profile.
+ The permitted the number of disks of this configuration for an instance with this
+ profile.
- :attr str type: The type for this profile field.
- :attr bool value: The value for this profile field.
+ :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.
"""
def __init__(
self,
+ default: int,
type: str,
- value: bool,
+ values: List[int],
) -> None:
"""
- Initialize a LoadBalancerProfileSecurityGroupsSupportedFixed object.
+ Initialize a InstanceProfileDiskQuantityEnum object.
+ :param int default: The default value for this profile field.
:param str type: The type for this profile field.
- :param bool value: The value for this profile field.
+ :param List[int] values: The permitted values for this profile field.
"""
# pylint: disable=super-init-not-called
+ self.default = default
self.type = type
- self.value = value
+ self.values = values
@classmethod
- def from_dict(cls, _dict: Dict) -> 'LoadBalancerProfileSecurityGroupsSupportedFixed':
- """Initialize a LoadBalancerProfileSecurityGroupsSupportedFixed object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceProfileDiskQuantityEnum':
+ """Initialize a InstanceProfileDiskQuantityEnum object from a json dictionary."""
args = {}
- if 'type' in _dict:
- args['type'] = _dict.get('type')
+ if (default := _dict.get('default')) is not None:
+ args['default'] = default
else:
- raise ValueError('Required property \'type\' not present in LoadBalancerProfileSecurityGroupsSupportedFixed JSON')
- if 'value' in _dict:
- args['value'] = _dict.get('value')
+ raise ValueError('Required property \'default\' not present in InstanceProfileDiskQuantityEnum JSON')
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
else:
- raise ValueError('Required property \'value\' not present in LoadBalancerProfileSecurityGroupsSupportedFixed JSON')
+ raise ValueError('Required property \'type\' not present in InstanceProfileDiskQuantityEnum JSON')
+ if (values := _dict.get('values')) is not None:
+ args['values'] = values
+ else:
+ raise ValueError('Required property \'values\' not present in InstanceProfileDiskQuantityEnum JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a LoadBalancerProfileSecurityGroupsSupportedFixed object from a json dictionary."""
+ """Initialize a InstanceProfileDiskQuantityEnum object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
+ if hasattr(self, '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, 'values') and self.values is not None:
+ _dict['values'] = self.values
return _dict
def _to_dict(self):
@@ -107238,16 +111367,16 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this LoadBalancerProfileSecurityGroupsSupportedFixed object."""
+ """Return a `str` version of this InstanceProfileDiskQuantityEnum object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'LoadBalancerProfileSecurityGroupsSupportedFixed') -> bool:
+ def __eq__(self, other: 'InstanceProfileDiskQuantityEnum') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'LoadBalancerProfileSecurityGroupsSupportedFixed') -> bool:
+ def __ne__(self, other: 'InstanceProfileDiskQuantityEnum') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
@@ -107256,42 +111385,50 @@ class TypeEnum(str, Enum):
The type for this profile field.
"""
- FIXED = 'fixed'
+ ENUM = 'enum'
-class LoadBalancerProfileUDPSupportedDependent(LoadBalancerProfileUDPSupported):
+class InstanceProfileDiskQuantityFixed(InstanceProfileDiskQuantity):
"""
- The UDP support for a load balancer with this profile depends on its configuration.
+ The number of disks of this configuration for an instance with this profile.
- :attr str type: The type for this profile field.
+ :param str type: The type for this profile field.
+ :param int value: The value for this profile field.
"""
def __init__(
self,
type: str,
+ value: int,
) -> None:
"""
- Initialize a LoadBalancerProfileUDPSupportedDependent object.
+ Initialize a InstanceProfileDiskQuantityFixed object.
:param str type: The type for this profile field.
+ :param int value: The value for this profile field.
"""
# pylint: disable=super-init-not-called
self.type = type
+ self.value = value
@classmethod
- def from_dict(cls, _dict: Dict) -> 'LoadBalancerProfileUDPSupportedDependent':
- """Initialize a LoadBalancerProfileUDPSupportedDependent object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceProfileDiskQuantityFixed':
+ """Initialize a InstanceProfileDiskQuantityFixed object from a json dictionary."""
args = {}
- if 'type' in _dict:
- args['type'] = _dict.get('type')
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
else:
- raise ValueError('Required property \'type\' not present in LoadBalancerProfileUDPSupportedDependent JSON')
+ raise ValueError('Required property \'type\' not present in InstanceProfileDiskQuantityFixed JSON')
+ if (value := _dict.get('value')) is not None:
+ args['value'] = value
+ else:
+ raise ValueError('Required property \'value\' not present in InstanceProfileDiskQuantityFixed JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a LoadBalancerProfileUDPSupportedDependent object from a json dictionary."""
+ """Initialize a InstanceProfileDiskQuantityFixed object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -107299,6 +111436,8 @@ def to_dict(self) -> Dict:
_dict = {}
if hasattr(self, 'type') and self.type is not None:
_dict['type'] = self.type
+ if hasattr(self, 'value') and self.value is not None:
+ _dict['value'] = self.value
return _dict
def _to_dict(self):
@@ -107306,16 +111445,16 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this LoadBalancerProfileUDPSupportedDependent object."""
+ """Return a `str` version of this InstanceProfileDiskQuantityFixed object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'LoadBalancerProfileUDPSupportedDependent') -> bool:
+ def __eq__(self, other: 'InstanceProfileDiskQuantityFixed') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'LoadBalancerProfileUDPSupportedDependent') -> bool:
+ def __ne__(self, other: 'InstanceProfileDiskQuantityFixed') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
@@ -107324,59 +111463,90 @@ class TypeEnum(str, Enum):
The type for this profile field.
"""
- DEPENDENT = 'dependent'
+ FIXED = 'fixed'
-class LoadBalancerProfileUDPSupportedFixed(LoadBalancerProfileUDPSupported):
+class InstanceProfileDiskQuantityRange(InstanceProfileDiskQuantity):
"""
- The UDP support for a load balancer with this profile.
+ The permitted range for the number of disks of this configuration for an instance with
+ this profile.
- :attr str type: The type for this profile field.
- :attr bool value: The value for this profile field.
+ :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.
"""
def __init__(
self,
+ default: int,
+ max: int,
+ min: int,
+ step: int,
type: str,
- value: bool,
) -> None:
"""
- Initialize a LoadBalancerProfileUDPSupportedFixed object.
+ Initialize a InstanceProfileDiskQuantityRange object.
+ :param int default: The default value for this profile field.
+ :param int max: The maximum value for this profile field.
+ :param int min: The minimum value for this profile field.
+ :param int step: The increment step value for this profile field.
:param str type: The type for this profile field.
- :param bool value: The value for this profile field.
"""
# pylint: disable=super-init-not-called
+ self.default = default
+ self.max = max
+ self.min = min
+ self.step = step
self.type = type
- self.value = value
@classmethod
- def from_dict(cls, _dict: Dict) -> 'LoadBalancerProfileUDPSupportedFixed':
- """Initialize a LoadBalancerProfileUDPSupportedFixed object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceProfileDiskQuantityRange':
+ """Initialize a InstanceProfileDiskQuantityRange object from a json dictionary."""
args = {}
- if 'type' in _dict:
- args['type'] = _dict.get('type')
+ if (default := _dict.get('default')) is not None:
+ args['default'] = default
else:
- raise ValueError('Required property \'type\' not present in LoadBalancerProfileUDPSupportedFixed JSON')
- if 'value' in _dict:
- args['value'] = _dict.get('value')
+ raise ValueError('Required property \'default\' not present in InstanceProfileDiskQuantityRange JSON')
+ if (max := _dict.get('max')) is not None:
+ args['max'] = max
else:
- raise ValueError('Required property \'value\' not present in LoadBalancerProfileUDPSupportedFixed JSON')
+ raise ValueError('Required property \'max\' not present in InstanceProfileDiskQuantityRange JSON')
+ if (min := _dict.get('min')) is not None:
+ args['min'] = min
+ else:
+ raise ValueError('Required property \'min\' not present in InstanceProfileDiskQuantityRange JSON')
+ if (step := _dict.get('step')) is not None:
+ args['step'] = step
+ else:
+ raise ValueError('Required property \'step\' not present in InstanceProfileDiskQuantityRange JSON')
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
+ else:
+ raise ValueError('Required property \'type\' not present in InstanceProfileDiskQuantityRange JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a LoadBalancerProfileUDPSupportedFixed object from a json dictionary."""
+ """Initialize a InstanceProfileDiskQuantityRange object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
+ if hasattr(self, 'default') and self.default is not None:
+ _dict['default'] = self.default
+ if hasattr(self, 'max') and self.max is not None:
+ _dict['max'] = self.max
+ if hasattr(self, 'min') and self.min is not None:
+ _dict['min'] = self.min
+ if hasattr(self, 'step') and self.step is not None:
+ _dict['step'] = self.step
if hasattr(self, 'type') and self.type is not None:
_dict['type'] = self.type
- if hasattr(self, 'value') and self.value is not None:
- _dict['value'] = self.value
return _dict
def _to_dict(self):
@@ -107384,16 +111554,16 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this LoadBalancerProfileUDPSupportedFixed object."""
+ """Return a `str` version of this InstanceProfileDiskQuantityRange object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'LoadBalancerProfileUDPSupportedFixed') -> bool:
+ def __eq__(self, other: 'InstanceProfileDiskQuantityRange') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'LoadBalancerProfileUDPSupportedFixed') -> bool:
+ def __ne__(self, other: 'InstanceProfileDiskQuantityRange') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
@@ -107402,49 +111572,50 @@ class TypeEnum(str, Enum):
The type for this profile field.
"""
- FIXED = 'fixed'
+ RANGE = 'range'
-class NetworkACLIdentityByCRN(NetworkACLIdentity):
+class InstanceProfileDiskSizeDependent(InstanceProfileDiskSize):
"""
- NetworkACLIdentityByCRN.
+ The disk size in GB (gigabytes) of this configuration for an instance with this
+ profile depends on its instance configuration.
- :attr str crn: The CRN for this network ACL.
+ :param str type: The type for this profile field.
"""
def __init__(
self,
- crn: str,
+ type: str,
) -> None:
"""
- Initialize a NetworkACLIdentityByCRN object.
+ Initialize a InstanceProfileDiskSizeDependent object.
- :param str crn: The CRN for this network ACL.
+ :param str type: The type for this profile field.
"""
# pylint: disable=super-init-not-called
- self.crn = crn
+ self.type = type
@classmethod
- def from_dict(cls, _dict: Dict) -> 'NetworkACLIdentityByCRN':
- """Initialize a NetworkACLIdentityByCRN object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceProfileDiskSizeDependent':
+ """Initialize a InstanceProfileDiskSizeDependent object from a json dictionary."""
args = {}
- if 'crn' in _dict:
- args['crn'] = _dict.get('crn')
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
else:
- raise ValueError('Required property \'crn\' not present in NetworkACLIdentityByCRN JSON')
+ raise ValueError('Required property \'type\' not present in InstanceProfileDiskSizeDependent JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a NetworkACLIdentityByCRN object from a json dictionary."""
+ """Initialize a InstanceProfileDiskSizeDependent object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'crn') and self.crn is not None:
- _dict['crn'] = self.crn
+ if hasattr(self, 'type') and self.type is not None:
+ _dict['type'] = self.type
return _dict
def _to_dict(self):
@@ -107452,59 +111623,88 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this NetworkACLIdentityByCRN object."""
+ """Return a `str` version of this InstanceProfileDiskSizeDependent object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'NetworkACLIdentityByCRN') -> bool:
+ def __eq__(self, other: 'InstanceProfileDiskSizeDependent') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'NetworkACLIdentityByCRN') -> bool:
+ def __ne__(self, other: 'InstanceProfileDiskSizeDependent') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
+ class TypeEnum(str, Enum):
+ """
+ The type for this profile field.
+ """
-class NetworkACLIdentityByHref(NetworkACLIdentity):
+ DEPENDENT = 'dependent'
+
+
+
+class InstanceProfileDiskSizeEnum(InstanceProfileDiskSize):
"""
- NetworkACLIdentityByHref.
+ The permitted disk size in GB (gigabytes) of this configuration for an instance with
+ this profile.
- :attr str href: The URL for this network ACL.
+ :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.
"""
def __init__(
self,
- href: str,
+ default: int,
+ type: str,
+ values: List[int],
) -> None:
"""
- Initialize a NetworkACLIdentityByHref object.
+ Initialize a InstanceProfileDiskSizeEnum object.
- :param str href: The URL for this network ACL.
+ :param int default: The default value for this profile field.
+ :param str type: The type for this profile field.
+ :param List[int] values: The permitted values for this profile field.
"""
# pylint: disable=super-init-not-called
- self.href = href
+ self.default = default
+ self.type = type
+ self.values = values
@classmethod
- def from_dict(cls, _dict: Dict) -> 'NetworkACLIdentityByHref':
- """Initialize a NetworkACLIdentityByHref object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceProfileDiskSizeEnum':
+ """Initialize a InstanceProfileDiskSizeEnum object from a json dictionary."""
args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ if (default := _dict.get('default')) is not None:
+ args['default'] = default
else:
- raise ValueError('Required property \'href\' not present in NetworkACLIdentityByHref JSON')
+ raise ValueError('Required property \'default\' not present in InstanceProfileDiskSizeEnum JSON')
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
+ else:
+ raise ValueError('Required property \'type\' not present in InstanceProfileDiskSizeEnum JSON')
+ if (values := _dict.get('values')) is not None:
+ args['values'] = values
+ else:
+ raise ValueError('Required property \'values\' not present in InstanceProfileDiskSizeEnum JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a NetworkACLIdentityByHref object from a json dictionary."""
+ """Initialize a InstanceProfileDiskSizeEnum object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, '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):
@@ -107512,59 +111712,77 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this NetworkACLIdentityByHref object."""
+ """Return a `str` version of this InstanceProfileDiskSizeEnum object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'NetworkACLIdentityByHref') -> bool:
+ def __eq__(self, other: 'InstanceProfileDiskSizeEnum') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'NetworkACLIdentityByHref') -> bool:
+ def __ne__(self, other: 'InstanceProfileDiskSizeEnum') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
+ class TypeEnum(str, Enum):
+ """
+ The type for this profile field.
+ """
+
+ ENUM = 'enum'
-class NetworkACLIdentityById(NetworkACLIdentity):
+
+
+class InstanceProfileDiskSizeFixed(InstanceProfileDiskSize):
"""
- NetworkACLIdentityById.
+ The size of the disk in GB (gigabytes).
- :attr str id: The unique identifier for this network ACL.
+ :param str type: The type for this profile field.
+ :param int value: The value for this profile field.
"""
def __init__(
self,
- id: str,
+ type: str,
+ value: int,
) -> None:
"""
- Initialize a NetworkACLIdentityById object.
+ Initialize a InstanceProfileDiskSizeFixed object.
- :param str id: The unique identifier for this network ACL.
+ :param str type: The type for this profile field.
+ :param int value: The value for this profile field.
"""
# pylint: disable=super-init-not-called
- self.id = id
+ self.type = type
+ self.value = value
@classmethod
- def from_dict(cls, _dict: Dict) -> 'NetworkACLIdentityById':
- """Initialize a NetworkACLIdentityById object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceProfileDiskSizeFixed':
+ """Initialize a InstanceProfileDiskSizeFixed object from a json dictionary."""
args = {}
- if 'id' in _dict:
- args['id'] = _dict.get('id')
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
else:
- raise ValueError('Required property \'id\' not present in NetworkACLIdentityById JSON')
+ raise ValueError('Required property \'type\' not present in InstanceProfileDiskSizeFixed JSON')
+ if (value := _dict.get('value')) is not None:
+ args['value'] = value
+ else:
+ raise ValueError('Required property \'value\' not present in InstanceProfileDiskSizeFixed JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a NetworkACLIdentityById object from a json dictionary."""
+ """Initialize a InstanceProfileDiskSizeFixed object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'id') and self.id is not None:
- _dict['id'] = self.id
+ if hasattr(self, 'type') and self.type is not None:
+ _dict['type'] = self.type
+ if hasattr(self, 'value') and self.value is not None:
+ _dict['value'] = self.value
return _dict
def _to_dict(self):
@@ -107572,105 +111790,108 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this NetworkACLIdentityById object."""
+ """Return a `str` version of this InstanceProfileDiskSizeFixed object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'NetworkACLIdentityById') -> bool:
+ def __eq__(self, other: 'InstanceProfileDiskSizeFixed') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'NetworkACLIdentityById') -> bool:
+ def __ne__(self, other: 'InstanceProfileDiskSizeFixed') -> 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 NetworkACLPrototypeNetworkACLByRules(NetworkACLPrototype):
+
+class InstanceProfileDiskSizeRange(InstanceProfileDiskSize):
"""
- NetworkACLPrototypeNetworkACLByRules.
+ The permitted range for the disk size of this configuration in GB (gigabytes) for an
+ instance with this profile.
- :attr str name: (optional) The name for this network ACL. The name must not be
- used by another network ACL for the VPC. If unspecified, the name will be a
- hyphenated list of randomly-selected words.
- :attr ResourceGroupIdentity resource_group: (optional)
- :attr VPCIdentity vpc: The VPC this network ACL will reside in.
- :attr List[NetworkACLRulePrototypeNetworkACLContext] rules: (optional) The
- prototype objects for rules to create along with this network ACL. If
- unspecified, no rules will be created, resulting in all traffic being denied.
+ :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.
"""
def __init__(
self,
- vpc: 'VPCIdentity',
- *,
- name: str = None,
- resource_group: 'ResourceGroupIdentity' = None,
- rules: List['NetworkACLRulePrototypeNetworkACLContext'] = None,
+ default: int,
+ max: int,
+ min: int,
+ step: int,
+ type: str,
) -> None:
"""
- Initialize a NetworkACLPrototypeNetworkACLByRules object.
+ Initialize a InstanceProfileDiskSizeRange object.
- :param VPCIdentity vpc: The VPC this network ACL will reside in.
- :param str name: (optional) The name for this network ACL. The name must
- not be used by another network ACL for the VPC. If unspecified, the name
- will be a hyphenated list of randomly-selected words.
- :param ResourceGroupIdentity resource_group: (optional)
- :param List[NetworkACLRulePrototypeNetworkACLContext] rules: (optional) The
- prototype objects for rules to create along with this network ACL. If
- unspecified, no rules will be created, resulting in all traffic being
- denied.
+ :param 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.name = name
- self.resource_group = resource_group
- self.vpc = vpc
- self.rules = rules
+ self.default = default
+ self.max = max
+ self.min = min
+ self.step = step
+ self.type = type
@classmethod
- def from_dict(cls, _dict: Dict) -> 'NetworkACLPrototypeNetworkACLByRules':
- """Initialize a NetworkACLPrototypeNetworkACLByRules object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceProfileDiskSizeRange':
+ """Initialize a InstanceProfileDiskSizeRange 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 'vpc' in _dict:
- args['vpc'] = _dict.get('vpc')
+ if (default := _dict.get('default')) is not None:
+ args['default'] = default
else:
- raise ValueError('Required property \'vpc\' not present in NetworkACLPrototypeNetworkACLByRules JSON')
- if 'rules' in _dict:
- args['rules'] = [NetworkACLRulePrototypeNetworkACLContext.from_dict(v) for v in _dict.get('rules')]
+ raise ValueError('Required property \'default\' not present in InstanceProfileDiskSizeRange JSON')
+ if (max := _dict.get('max')) is not None:
+ args['max'] = max
+ else:
+ raise ValueError('Required property \'max\' not present in InstanceProfileDiskSizeRange JSON')
+ if (min := _dict.get('min')) is not None:
+ args['min'] = min
+ else:
+ raise ValueError('Required property \'min\' not present in InstanceProfileDiskSizeRange JSON')
+ if (step := _dict.get('step')) is not None:
+ args['step'] = step
+ else:
+ raise ValueError('Required property \'step\' not present in InstanceProfileDiskSizeRange JSON')
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
+ else:
+ raise ValueError('Required property \'type\' not present in InstanceProfileDiskSizeRange JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a NetworkACLPrototypeNetworkACLByRules object from a json dictionary."""
+ """Initialize a InstanceProfileDiskSizeRange object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'name') and self.name is not None:
- _dict['name'] = self.name
- if hasattr(self, 'resource_group') and self.resource_group is not None:
- if isinstance(self.resource_group, dict):
- _dict['resource_group'] = self.resource_group
- else:
- _dict['resource_group'] = self.resource_group.to_dict()
- if hasattr(self, 'vpc') and self.vpc is not None:
- if isinstance(self.vpc, dict):
- _dict['vpc'] = self.vpc
- else:
- _dict['vpc'] = self.vpc.to_dict()
- if hasattr(self, 'rules') and self.rules is not None:
- rules_list = []
- for v in self.rules:
- if isinstance(v, dict):
- rules_list.append(v)
- else:
- rules_list.append(v.to_dict())
- _dict['rules'] = rules_list
+ if hasattr(self, '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):
@@ -107678,100 +111899,67 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this NetworkACLPrototypeNetworkACLByRules object."""
+ """Return a `str` version of this InstanceProfileDiskSizeRange object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'NetworkACLPrototypeNetworkACLByRules') -> bool:
+ def __eq__(self, other: 'InstanceProfileDiskSizeRange') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'NetworkACLPrototypeNetworkACLByRules') -> bool:
+ def __ne__(self, other: 'InstanceProfileDiskSizeRange') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
+ class TypeEnum(str, Enum):
+ """
+ The type for this profile field.
+ """
-class NetworkACLPrototypeNetworkACLBySourceNetworkACL(NetworkACLPrototype):
+ RANGE = 'range'
+
+
+
+class InstanceProfileGPUDependent(InstanceProfileGPU):
"""
- NetworkACLPrototypeNetworkACLBySourceNetworkACL.
+ The GPU count for an instance with this profile depends on its configuration.
- :attr str name: (optional) The name for this network ACL. The name must not be
- used by another network ACL for the VPC. If unspecified, the name will be a
- hyphenated list of randomly-selected words.
- :attr ResourceGroupIdentity resource_group: (optional)
- :attr VPCIdentity vpc: The VPC this network ACL will reside in.
- :attr NetworkACLIdentity source_network_acl: Network ACL to copy rules from.
+ :param str type: The type for this profile field.
"""
def __init__(
self,
- vpc: 'VPCIdentity',
- source_network_acl: 'NetworkACLIdentity',
- *,
- name: str = None,
- resource_group: 'ResourceGroupIdentity' = None,
+ type: str,
) -> None:
"""
- Initialize a NetworkACLPrototypeNetworkACLBySourceNetworkACL object.
+ Initialize a InstanceProfileGPUDependent object.
- :param VPCIdentity vpc: The VPC this network ACL will reside in.
- :param NetworkACLIdentity source_network_acl: Network ACL to copy rules
- from.
- :param str name: (optional) The name for this network ACL. The name must
- not be used by another network ACL for the VPC. If unspecified, the name
- will be a hyphenated list of randomly-selected words.
- :param ResourceGroupIdentity resource_group: (optional)
+ :param str type: The type for this profile field.
"""
# pylint: disable=super-init-not-called
- self.name = name
- self.resource_group = resource_group
- self.vpc = vpc
- self.source_network_acl = source_network_acl
+ self.type = type
@classmethod
- def from_dict(cls, _dict: Dict) -> 'NetworkACLPrototypeNetworkACLBySourceNetworkACL':
- """Initialize a NetworkACLPrototypeNetworkACLBySourceNetworkACL object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceProfileGPUDependent':
+ """Initialize a InstanceProfileGPUDependent 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 'vpc' in _dict:
- args['vpc'] = _dict.get('vpc')
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
else:
- raise ValueError('Required property \'vpc\' not present in NetworkACLPrototypeNetworkACLBySourceNetworkACL JSON')
- if 'source_network_acl' in _dict:
- args['source_network_acl'] = _dict.get('source_network_acl')
- else:
- raise ValueError('Required property \'source_network_acl\' not present in NetworkACLPrototypeNetworkACLBySourceNetworkACL JSON')
+ raise ValueError('Required property \'type\' not present in InstanceProfileGPUDependent JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a NetworkACLPrototypeNetworkACLBySourceNetworkACL object from a json dictionary."""
+ """Initialize a InstanceProfileGPUDependent object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'name') and self.name is not None:
- _dict['name'] = self.name
- if hasattr(self, 'resource_group') and self.resource_group is not None:
- if isinstance(self.resource_group, dict):
- _dict['resource_group'] = self.resource_group
- else:
- _dict['resource_group'] = self.resource_group.to_dict()
- if hasattr(self, 'vpc') and self.vpc is not None:
- if isinstance(self.vpc, dict):
- _dict['vpc'] = self.vpc
- else:
- _dict['vpc'] = self.vpc.to_dict()
- if hasattr(self, 'source_network_acl') and self.source_network_acl is not None:
- if isinstance(self.source_network_acl, dict):
- _dict['source_network_acl'] = self.source_network_acl
- else:
- _dict['source_network_acl'] = self.source_network_acl.to_dict()
+ if hasattr(self, 'type') and self.type is not None:
+ _dict['type'] = self.type
return _dict
def _to_dict(self):
@@ -107779,59 +111967,87 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this NetworkACLPrototypeNetworkACLBySourceNetworkACL object."""
+ """Return a `str` version of this InstanceProfileGPUDependent object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'NetworkACLPrototypeNetworkACLBySourceNetworkACL') -> bool:
+ def __eq__(self, other: 'InstanceProfileGPUDependent') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'NetworkACLPrototypeNetworkACLBySourceNetworkACL') -> bool:
+ def __ne__(self, other: 'InstanceProfileGPUDependent') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
+ class TypeEnum(str, Enum):
+ """
+ The type for this profile field.
+ """
+
+ DEPENDENT = 'dependent'
-class NetworkACLRuleBeforePatchNetworkACLRuleIdentityByHref(NetworkACLRuleBeforePatch):
+
+
+class InstanceProfileGPUEnum(InstanceProfileGPU):
"""
- NetworkACLRuleBeforePatchNetworkACLRuleIdentityByHref.
+ The permitted GPU count values for an instance with this profile.
- :attr str href: The URL for this network ACL rule.
+ :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.
"""
def __init__(
self,
- href: str,
+ default: int,
+ type: str,
+ values: List[int],
) -> None:
"""
- Initialize a NetworkACLRuleBeforePatchNetworkACLRuleIdentityByHref object.
+ Initialize a InstanceProfileGPUEnum object.
- :param str href: The URL for this network ACL rule.
+ :param int default: The default value for this profile field.
+ :param str type: The type for this profile field.
+ :param List[int] values: The permitted values for this profile field.
"""
# pylint: disable=super-init-not-called
- self.href = href
+ self.default = default
+ self.type = type
+ self.values = values
@classmethod
- def from_dict(cls, _dict: Dict) -> 'NetworkACLRuleBeforePatchNetworkACLRuleIdentityByHref':
- """Initialize a NetworkACLRuleBeforePatchNetworkACLRuleIdentityByHref object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceProfileGPUEnum':
+ """Initialize a InstanceProfileGPUEnum object from a json dictionary."""
args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ if (default := _dict.get('default')) is not None:
+ args['default'] = default
else:
- raise ValueError('Required property \'href\' not present in NetworkACLRuleBeforePatchNetworkACLRuleIdentityByHref JSON')
+ raise ValueError('Required property \'default\' not present in InstanceProfileGPUEnum JSON')
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
+ else:
+ raise ValueError('Required property \'type\' not present in InstanceProfileGPUEnum JSON')
+ if (values := _dict.get('values')) is not None:
+ args['values'] = values
+ else:
+ raise ValueError('Required property \'values\' not present in InstanceProfileGPUEnum JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a NetworkACLRuleBeforePatchNetworkACLRuleIdentityByHref object from a json dictionary."""
+ """Initialize a InstanceProfileGPUEnum object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, '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):
@@ -107839,59 +112055,77 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this NetworkACLRuleBeforePatchNetworkACLRuleIdentityByHref object."""
+ """Return a `str` version of this InstanceProfileGPUEnum object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'NetworkACLRuleBeforePatchNetworkACLRuleIdentityByHref') -> bool:
+ def __eq__(self, other: 'InstanceProfileGPUEnum') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'NetworkACLRuleBeforePatchNetworkACLRuleIdentityByHref') -> bool:
+ def __ne__(self, other: 'InstanceProfileGPUEnum') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
+ class TypeEnum(str, Enum):
+ """
+ The type for this profile field.
+ """
-class NetworkACLRuleBeforePatchNetworkACLRuleIdentityById(NetworkACLRuleBeforePatch):
+ ENUM = 'enum'
+
+
+
+class InstanceProfileGPUFixed(InstanceProfileGPU):
"""
- NetworkACLRuleBeforePatchNetworkACLRuleIdentityById.
+ The GPU count for an instance with this profile.
- :attr str id: The unique identifier for this network ACL rule.
+ :param str type: The type for this profile field.
+ :param int value: The value for this profile field.
"""
def __init__(
self,
- id: str,
+ type: str,
+ value: int,
) -> None:
"""
- Initialize a NetworkACLRuleBeforePatchNetworkACLRuleIdentityById object.
+ Initialize a InstanceProfileGPUFixed object.
- :param str id: The unique identifier for this network ACL rule.
+ :param str type: The type for this profile field.
+ :param int value: The value for this profile field.
"""
# pylint: disable=super-init-not-called
- self.id = id
+ self.type = type
+ self.value = value
@classmethod
- def from_dict(cls, _dict: Dict) -> 'NetworkACLRuleBeforePatchNetworkACLRuleIdentityById':
- """Initialize a NetworkACLRuleBeforePatchNetworkACLRuleIdentityById object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceProfileGPUFixed':
+ """Initialize a InstanceProfileGPUFixed object from a json dictionary."""
args = {}
- if 'id' in _dict:
- args['id'] = _dict.get('id')
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
else:
- raise ValueError('Required property \'id\' not present in NetworkACLRuleBeforePatchNetworkACLRuleIdentityById JSON')
+ raise ValueError('Required property \'type\' not present in InstanceProfileGPUFixed JSON')
+ if (value := _dict.get('value')) is not None:
+ args['value'] = value
+ else:
+ raise ValueError('Required property \'value\' not present in InstanceProfileGPUFixed JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a NetworkACLRuleBeforePatchNetworkACLRuleIdentityById object from a json dictionary."""
+ """Initialize a InstanceProfileGPUFixed object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'id') and self.id is not None:
- _dict['id'] = self.id
+ if hasattr(self, 'type') and self.type is not None:
+ _dict['type'] = self.type
+ if hasattr(self, 'value') and self.value is not None:
+ _dict['value'] = self.value
return _dict
def _to_dict(self):
@@ -107899,59 +112133,68 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this NetworkACLRuleBeforePatchNetworkACLRuleIdentityById object."""
+ """Return a `str` version of this InstanceProfileGPUFixed object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'NetworkACLRuleBeforePatchNetworkACLRuleIdentityById') -> bool:
+ def __eq__(self, other: 'InstanceProfileGPUFixed') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'NetworkACLRuleBeforePatchNetworkACLRuleIdentityById') -> bool:
+ def __ne__(self, other: 'InstanceProfileGPUFixed') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
+ class TypeEnum(str, Enum):
+ """
+ The type for this profile field.
+ """
-class NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByHref(NetworkACLRuleBeforePrototype):
+ FIXED = 'fixed'
+
+
+
+class InstanceProfileGPUMemoryDependent(InstanceProfileGPUMemory):
"""
- NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByHref.
+ The overall GPU memory value for an instance with this profile depends on its
+ configuration.
- :attr str href: The URL for this network ACL rule.
+ :param str type: The type for this profile field.
"""
def __init__(
self,
- href: str,
+ type: str,
) -> None:
"""
- Initialize a NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByHref object.
+ Initialize a InstanceProfileGPUMemoryDependent object.
- :param str href: The URL for this network ACL rule.
+ :param str type: The type for this profile field.
"""
# pylint: disable=super-init-not-called
- self.href = href
+ self.type = type
@classmethod
- def from_dict(cls, _dict: Dict) -> 'NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByHref':
- """Initialize a NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByHref object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceProfileGPUMemoryDependent':
+ """Initialize a InstanceProfileGPUMemoryDependent object from a json dictionary."""
args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
else:
- raise ValueError('Required property \'href\' not present in NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByHref JSON')
+ raise ValueError('Required property \'type\' not present in InstanceProfileGPUMemoryDependent JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByHref object from a json dictionary."""
+ """Initialize a InstanceProfileGPUMemoryDependent object from 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):
@@ -107959,59 +112202,88 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByHref object."""
+ """Return a `str` version of this InstanceProfileGPUMemoryDependent object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByHref') -> bool:
+ def __eq__(self, other: 'InstanceProfileGPUMemoryDependent') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByHref') -> bool:
+ def __ne__(self, other: 'InstanceProfileGPUMemoryDependent') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
+ class TypeEnum(str, Enum):
+ """
+ The type for this profile field.
+ """
+
+ DEPENDENT = 'dependent'
-class NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityById(NetworkACLRuleBeforePrototype):
+
+
+class InstanceProfileGPUMemoryEnum(InstanceProfileGPUMemory):
"""
- NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityById.
+ The permitted overall GPU memory values in GiB (gibibytes) for an instance with this
+ profile.
- :attr str id: The unique identifier for this network ACL rule.
+ :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.
"""
def __init__(
self,
- id: str,
+ default: int,
+ type: str,
+ values: List[int],
) -> None:
"""
- Initialize a NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityById object.
+ Initialize a InstanceProfileGPUMemoryEnum object.
- :param str id: The unique identifier for this network ACL rule.
+ :param int default: The default value for this profile field.
+ :param str type: The type for this profile field.
+ :param List[int] values: The permitted values for this profile field.
"""
# pylint: disable=super-init-not-called
- self.id = id
+ self.default = default
+ self.type = type
+ self.values = values
@classmethod
- def from_dict(cls, _dict: Dict) -> 'NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityById':
- """Initialize a NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityById object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceProfileGPUMemoryEnum':
+ """Initialize a InstanceProfileGPUMemoryEnum object from a json dictionary."""
args = {}
- if 'id' in _dict:
- args['id'] = _dict.get('id')
+ if (default := _dict.get('default')) is not None:
+ args['default'] = default
else:
- raise ValueError('Required property \'id\' not present in NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityById JSON')
+ raise ValueError('Required property \'default\' not present in InstanceProfileGPUMemoryEnum JSON')
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
+ else:
+ raise ValueError('Required property \'type\' not present in InstanceProfileGPUMemoryEnum JSON')
+ if (values := _dict.get('values')) is not None:
+ args['values'] = values
+ else:
+ raise ValueError('Required property \'values\' not present in InstanceProfileGPUMemoryEnum JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityById object from a json dictionary."""
+ """Initialize a InstanceProfileGPUMemoryEnum object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'id') and self.id is not None:
- _dict['id'] = self.id
+ if hasattr(self, 'default') and self.default is not None:
+ _dict['default'] = self.default
+ if hasattr(self, '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):
@@ -108019,171 +112291,77 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityById object."""
+ """Return a `str` version of this InstanceProfileGPUMemoryEnum object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityById') -> bool:
+ def __eq__(self, other: 'InstanceProfileGPUMemoryEnum') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityById') -> bool:
+ def __ne__(self, other: 'InstanceProfileGPUMemoryEnum') -> 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 NetworkACLRuleItemNetworkACLRuleProtocolAll(NetworkACLRuleItem):
+
+class InstanceProfileGPUMemoryFixed(InstanceProfileGPUMemory):
"""
- NetworkACLRuleItemNetworkACLRuleProtocolAll.
+ The overall GPU memory in GiB (gibibytes) for an instance with this profile.
- :attr str action: The action to perform for a packet matching the rule.
- :attr NetworkACLRuleReference before: (optional) The rule that this rule is
- immediately before. In a rule collection, this always refers to the next item in
- the collection. If absent, this is the last rule.
- :attr datetime created_at: The date and time that the rule was created.
- :attr str destination: The destination IP address or CIDR block to match. The
- CIDR block `0.0.0.0/0` matches all destination addresses.
- :attr str direction: The direction of traffic to match.
- :attr str href: The URL for this network ACL rule.
- :attr str id: The unique identifier for this network ACL rule.
- :attr str ip_version: The IP version for this rule.
- :attr str name: The name for this network ACL rule. The name is unique across
- all rules for the network ACL.
- :attr str source: The source IP address or CIDR block to match. The CIDR block
- `0.0.0.0/0` matches all source addresses.
- :attr str protocol: The protocol to enforce.
+ :param str type: The type for this profile field.
+ :param int value: The value for this profile field.
"""
def __init__(
self,
- action: str,
- created_at: datetime,
- destination: str,
- direction: str,
- href: str,
- id: str,
- ip_version: str,
- name: str,
- source: str,
- protocol: str,
- *,
- before: 'NetworkACLRuleReference' = None,
+ type: str,
+ value: int,
) -> None:
"""
- Initialize a NetworkACLRuleItemNetworkACLRuleProtocolAll object.
+ Initialize a InstanceProfileGPUMemoryFixed object.
- :param str action: The action to perform for a packet matching the rule.
- :param datetime created_at: The date and time that the rule was created.
- :param str destination: The destination IP address or CIDR block to match.
- The CIDR block `0.0.0.0/0` matches all destination addresses.
- :param str direction: The direction of traffic to match.
- :param str href: The URL for this network ACL rule.
- :param str id: The unique identifier for this network ACL rule.
- :param str ip_version: The IP version for this rule.
- :param str name: The name for this network ACL rule. The name is unique
- across all rules for the network ACL.
- :param str source: The source IP address or CIDR block to match. The CIDR
- block `0.0.0.0/0` matches all source addresses.
- :param str protocol: The protocol to enforce.
- :param NetworkACLRuleReference before: (optional) The rule that this rule
- is immediately before. In a rule collection, this always refers to the next
- item in the collection. If absent, this is the last rule.
+ :param str type: The type for this profile field.
+ :param int value: The value for this profile field.
"""
# pylint: disable=super-init-not-called
- self.action = action
- self.before = before
- self.created_at = created_at
- self.destination = destination
- self.direction = direction
- self.href = href
- self.id = id
- self.ip_version = ip_version
- self.name = name
- self.source = source
- self.protocol = protocol
+ self.type = type
+ self.value = value
@classmethod
- def from_dict(cls, _dict: Dict) -> 'NetworkACLRuleItemNetworkACLRuleProtocolAll':
- """Initialize a NetworkACLRuleItemNetworkACLRuleProtocolAll object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceProfileGPUMemoryFixed':
+ """Initialize a InstanceProfileGPUMemoryFixed object from a json dictionary."""
args = {}
- if 'action' in _dict:
- args['action'] = _dict.get('action')
- else:
- raise ValueError('Required property \'action\' not present in NetworkACLRuleItemNetworkACLRuleProtocolAll JSON')
- if 'before' in _dict:
- args['before'] = NetworkACLRuleReference.from_dict(_dict.get('before'))
- if 'created_at' in _dict:
- args['created_at'] = string_to_datetime(_dict.get('created_at'))
- else:
- raise ValueError('Required property \'created_at\' not present in NetworkACLRuleItemNetworkACLRuleProtocolAll JSON')
- if 'destination' in _dict:
- args['destination'] = _dict.get('destination')
- else:
- raise ValueError('Required property \'destination\' not present in NetworkACLRuleItemNetworkACLRuleProtocolAll JSON')
- if 'direction' in _dict:
- args['direction'] = _dict.get('direction')
- else:
- raise ValueError('Required property \'direction\' not present in NetworkACLRuleItemNetworkACLRuleProtocolAll JSON')
- if 'href' in _dict:
- args['href'] = _dict.get('href')
- else:
- raise ValueError('Required property \'href\' not present in NetworkACLRuleItemNetworkACLRuleProtocolAll JSON')
- if 'id' in _dict:
- args['id'] = _dict.get('id')
- else:
- raise ValueError('Required property \'id\' not present in NetworkACLRuleItemNetworkACLRuleProtocolAll JSON')
- if 'ip_version' in _dict:
- args['ip_version'] = _dict.get('ip_version')
- else:
- raise ValueError('Required property \'ip_version\' not present in NetworkACLRuleItemNetworkACLRuleProtocolAll JSON')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
- else:
- raise ValueError('Required property \'name\' not present in NetworkACLRuleItemNetworkACLRuleProtocolAll JSON')
- if 'source' in _dict:
- args['source'] = _dict.get('source')
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
else:
- raise ValueError('Required property \'source\' not present in NetworkACLRuleItemNetworkACLRuleProtocolAll JSON')
- if 'protocol' in _dict:
- args['protocol'] = _dict.get('protocol')
+ raise ValueError('Required property \'type\' not present in InstanceProfileGPUMemoryFixed JSON')
+ if (value := _dict.get('value')) is not None:
+ args['value'] = value
else:
- raise ValueError('Required property \'protocol\' not present in NetworkACLRuleItemNetworkACLRuleProtocolAll JSON')
+ raise ValueError('Required property \'value\' not present in InstanceProfileGPUMemoryFixed JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a NetworkACLRuleItemNetworkACLRuleProtocolAll object from a json dictionary."""
+ """Initialize a InstanceProfileGPUMemoryFixed object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'action') and self.action is not None:
- _dict['action'] = self.action
- if hasattr(self, 'before') and self.before is not None:
- if isinstance(self.before, dict):
- _dict['before'] = self.before
- else:
- _dict['before'] = self.before.to_dict()
- if hasattr(self, 'created_at') and self.created_at is not None:
- _dict['created_at'] = datetime_to_string(self.created_at)
- if hasattr(self, 'destination') and self.destination is not None:
- _dict['destination'] = self.destination
- if hasattr(self, 'direction') and self.direction is not None:
- _dict['direction'] = self.direction
- if hasattr(self, 'href') and self.href is not None:
- _dict['href'] = self.href
- if hasattr(self, 'id') and self.id is not None:
- _dict['id'] = self.id
- if hasattr(self, 'ip_version') and self.ip_version is not None:
- _dict['ip_version'] = self.ip_version
- if hasattr(self, 'name') and self.name is not None:
- _dict['name'] = self.name
- if hasattr(self, 'source') and self.source is not None:
- _dict['source'] = self.source
- if hasattr(self, 'protocol') and self.protocol is not None:
- _dict['protocol'] = self.protocol
+ if hasattr(self, '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):
@@ -108191,223 +112369,106 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this NetworkACLRuleItemNetworkACLRuleProtocolAll object."""
+ """Return a `str` version of this InstanceProfileGPUMemoryFixed object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'NetworkACLRuleItemNetworkACLRuleProtocolAll') -> bool:
+ def __eq__(self, other: 'InstanceProfileGPUMemoryFixed') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'NetworkACLRuleItemNetworkACLRuleProtocolAll') -> bool:
+ def __ne__(self, other: 'InstanceProfileGPUMemoryFixed') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class ActionEnum(str, Enum):
- """
- The action to perform for a packet matching the rule.
- """
-
- ALLOW = 'allow'
- DENY = 'deny'
-
-
- class DirectionEnum(str, Enum):
- """
- The direction of traffic to match.
- """
-
- INBOUND = 'inbound'
- OUTBOUND = 'outbound'
-
-
- class IpVersionEnum(str, Enum):
- """
- The IP version for this rule.
- """
-
- IPV4 = 'ipv4'
-
-
- class ProtocolEnum(str, Enum):
+ class TypeEnum(str, Enum):
"""
- The protocol to enforce.
+ The type for this profile field.
"""
- ALL = 'all'
+ FIXED = 'fixed'
-class NetworkACLRuleItemNetworkACLRuleProtocolICMP(NetworkACLRuleItem):
+class InstanceProfileGPUMemoryRange(InstanceProfileGPUMemory):
"""
- NetworkACLRuleItemNetworkACLRuleProtocolICMP.
+ The permitted overall GPU memory range in GiB (gibibytes) for an instance with this
+ profile.
- :attr str action: The action to perform for a packet matching the rule.
- :attr NetworkACLRuleReference before: (optional) The rule that this rule is
- immediately before. In a rule collection, this always refers to the next item in
- the collection. If absent, this is the last rule.
- :attr datetime created_at: The date and time that the rule was created.
- :attr str destination: The destination IP address or CIDR block to match. The
- CIDR block `0.0.0.0/0` matches all destination addresses.
- :attr str direction: The direction of traffic to match.
- :attr str href: The URL for this network ACL rule.
- :attr str id: The unique identifier for this network ACL rule.
- :attr str ip_version: The IP version for this rule.
- :attr str name: The name for this network ACL rule. The name is unique across
- all rules for the network ACL.
- :attr str source: The source IP address or CIDR block to match. The CIDR block
- `0.0.0.0/0` matches all source addresses.
- :attr int code: (optional) The ICMP traffic code to match.
- If absent, all codes are matched.
- :attr str protocol: The protocol to enforce.
- :attr int type: (optional) The ICMP traffic type to match.
- If absent, all types are matched.
+ :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.
"""
def __init__(
self,
- action: str,
- created_at: datetime,
- destination: str,
- direction: str,
- href: str,
- id: str,
- ip_version: str,
- name: str,
- source: str,
- protocol: str,
- *,
- before: 'NetworkACLRuleReference' = None,
- code: int = None,
- type: int = None,
+ default: int,
+ max: int,
+ min: int,
+ step: int,
+ type: str,
) -> None:
"""
- Initialize a NetworkACLRuleItemNetworkACLRuleProtocolICMP object.
+ Initialize a InstanceProfileGPUMemoryRange object.
- :param str action: The action to perform for a packet matching the rule.
- :param datetime created_at: The date and time that the rule was created.
- :param str destination: The destination IP address or CIDR block to match.
- The CIDR block `0.0.0.0/0` matches all destination addresses.
- :param str direction: The direction of traffic to match.
- :param str href: The URL for this network ACL rule.
- :param str id: The unique identifier for this network ACL rule.
- :param str ip_version: The IP version for this rule.
- :param str name: The name for this network ACL rule. The name is unique
- across all rules for the network ACL.
- :param str source: The source IP address or CIDR block to match. The CIDR
- block `0.0.0.0/0` matches all source addresses.
- :param str protocol: The protocol to enforce.
- :param NetworkACLRuleReference before: (optional) The rule that this rule
- is immediately before. In a rule collection, this always refers to the next
- item in the collection. If absent, this is the last rule.
- :param int code: (optional) The ICMP traffic code to match.
- If absent, all codes are matched.
- :param int type: (optional) The ICMP traffic type to match.
- If absent, all types are matched.
+ :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.action = action
- self.before = before
- self.created_at = created_at
- self.destination = destination
- self.direction = direction
- self.href = href
- self.id = id
- self.ip_version = ip_version
- self.name = name
- self.source = source
- self.code = code
- self.protocol = protocol
+ self.default = default
+ self.max = max
+ self.min = min
+ self.step = step
self.type = type
@classmethod
- def from_dict(cls, _dict: Dict) -> 'NetworkACLRuleItemNetworkACLRuleProtocolICMP':
- """Initialize a NetworkACLRuleItemNetworkACLRuleProtocolICMP object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceProfileGPUMemoryRange':
+ """Initialize a InstanceProfileGPUMemoryRange object from a json dictionary."""
args = {}
- if 'action' in _dict:
- args['action'] = _dict.get('action')
- else:
- raise ValueError('Required property \'action\' not present in NetworkACLRuleItemNetworkACLRuleProtocolICMP JSON')
- if 'before' in _dict:
- args['before'] = NetworkACLRuleReference.from_dict(_dict.get('before'))
- if 'created_at' in _dict:
- args['created_at'] = string_to_datetime(_dict.get('created_at'))
- else:
- raise ValueError('Required property \'created_at\' not present in NetworkACLRuleItemNetworkACLRuleProtocolICMP JSON')
- if 'destination' in _dict:
- args['destination'] = _dict.get('destination')
- else:
- raise ValueError('Required property \'destination\' not present in NetworkACLRuleItemNetworkACLRuleProtocolICMP JSON')
- if 'direction' in _dict:
- args['direction'] = _dict.get('direction')
- else:
- raise ValueError('Required property \'direction\' not present in NetworkACLRuleItemNetworkACLRuleProtocolICMP JSON')
- if 'href' in _dict:
- args['href'] = _dict.get('href')
- else:
- raise ValueError('Required property \'href\' not present in NetworkACLRuleItemNetworkACLRuleProtocolICMP JSON')
- if 'id' in _dict:
- args['id'] = _dict.get('id')
+ if (default := _dict.get('default')) is not None:
+ args['default'] = default
else:
- raise ValueError('Required property \'id\' not present in NetworkACLRuleItemNetworkACLRuleProtocolICMP JSON')
- if 'ip_version' in _dict:
- args['ip_version'] = _dict.get('ip_version')
+ raise ValueError('Required property \'default\' not present in InstanceProfileGPUMemoryRange JSON')
+ if (max := _dict.get('max')) is not None:
+ args['max'] = max
else:
- raise ValueError('Required property \'ip_version\' not present in NetworkACLRuleItemNetworkACLRuleProtocolICMP JSON')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
+ raise ValueError('Required property \'max\' not present in InstanceProfileGPUMemoryRange JSON')
+ if (min := _dict.get('min')) is not None:
+ args['min'] = min
else:
- raise ValueError('Required property \'name\' not present in NetworkACLRuleItemNetworkACLRuleProtocolICMP JSON')
- if 'source' in _dict:
- args['source'] = _dict.get('source')
+ raise ValueError('Required property \'min\' not present in InstanceProfileGPUMemoryRange JSON')
+ if (step := _dict.get('step')) is not None:
+ args['step'] = step
else:
- raise ValueError('Required property \'source\' not present in NetworkACLRuleItemNetworkACLRuleProtocolICMP JSON')
- if 'code' in _dict:
- args['code'] = _dict.get('code')
- if 'protocol' in _dict:
- args['protocol'] = _dict.get('protocol')
+ raise ValueError('Required property \'step\' not present in InstanceProfileGPUMemoryRange JSON')
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
else:
- raise ValueError('Required property \'protocol\' not present in NetworkACLRuleItemNetworkACLRuleProtocolICMP JSON')
- if 'type' in _dict:
- args['type'] = _dict.get('type')
+ raise ValueError('Required property \'type\' not present in InstanceProfileGPUMemoryRange JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a NetworkACLRuleItemNetworkACLRuleProtocolICMP object from a json dictionary."""
+ """Initialize a InstanceProfileGPUMemoryRange object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'action') and self.action is not None:
- _dict['action'] = self.action
- if hasattr(self, 'before') and self.before is not None:
- if isinstance(self.before, dict):
- _dict['before'] = self.before
- else:
- _dict['before'] = self.before.to_dict()
- if hasattr(self, 'created_at') and self.created_at is not None:
- _dict['created_at'] = datetime_to_string(self.created_at)
- if hasattr(self, 'destination') and self.destination is not None:
- _dict['destination'] = self.destination
- if hasattr(self, 'direction') and self.direction is not None:
- _dict['direction'] = self.direction
- if hasattr(self, 'href') and self.href is not None:
- _dict['href'] = self.href
- if hasattr(self, 'id') and self.id is not None:
- _dict['id'] = self.id
- if hasattr(self, 'ip_version') and self.ip_version is not None:
- _dict['ip_version'] = self.ip_version
- if hasattr(self, 'name') and self.name is not None:
- _dict['name'] = self.name
- if hasattr(self, 'source') and self.source is not None:
- _dict['source'] = self.source
- if hasattr(self, 'code') and self.code is not None:
- _dict['code'] = self.code
- if hasattr(self, 'protocol') and self.protocol is not None:
- _dict['protocol'] = self.protocol
+ if hasattr(self, '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
@@ -108417,253 +112478,107 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this NetworkACLRuleItemNetworkACLRuleProtocolICMP object."""
+ """Return a `str` version of this InstanceProfileGPUMemoryRange object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'NetworkACLRuleItemNetworkACLRuleProtocolICMP') -> bool:
+ def __eq__(self, other: 'InstanceProfileGPUMemoryRange') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'NetworkACLRuleItemNetworkACLRuleProtocolICMP') -> bool:
+ def __ne__(self, other: 'InstanceProfileGPUMemoryRange') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class ActionEnum(str, Enum):
- """
- The action to perform for a packet matching the rule.
- """
-
- ALLOW = 'allow'
- DENY = 'deny'
-
-
- class DirectionEnum(str, Enum):
- """
- The direction of traffic to match.
- """
-
- INBOUND = 'inbound'
- OUTBOUND = 'outbound'
-
-
- class IpVersionEnum(str, Enum):
- """
- The IP version for this rule.
- """
-
- IPV4 = 'ipv4'
-
-
- class ProtocolEnum(str, Enum):
+ class TypeEnum(str, Enum):
"""
- The protocol to enforce.
+ The type for this profile field.
"""
- ICMP = 'icmp'
+ RANGE = 'range'
-class NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP(NetworkACLRuleItem):
+class InstanceProfileGPURange(InstanceProfileGPU):
"""
- NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP.
+ The permitted GPU count range for an instance with this profile.
- :attr str action: The action to perform for a packet matching the rule.
- :attr NetworkACLRuleReference before: (optional) The rule that this rule is
- immediately before. In a rule collection, this always refers to the next item in
- the collection. If absent, this is the last rule.
- :attr datetime created_at: The date and time that the rule was created.
- :attr str destination: The destination IP address or CIDR block to match. The
- CIDR block `0.0.0.0/0` matches all destination addresses.
- :attr str direction: The direction of traffic to match.
- :attr str href: The URL for this network ACL rule.
- :attr str id: The unique identifier for this network ACL rule.
- :attr str ip_version: The IP version for this rule.
- :attr str name: The name for this network ACL rule. The name is unique across
- all rules for the network ACL.
- :attr str source: The source IP address or CIDR block to match. The CIDR block
- `0.0.0.0/0` matches all source addresses.
- :attr int destination_port_max: The inclusive upper bound of TCP/UDP destination
- port range.
- :attr int destination_port_min: The inclusive lower bound of TCP/UDP destination
- port range.
- :attr str protocol: The protocol to enforce.
- :attr int source_port_max: The inclusive upper bound of TCP/UDP source port
- range.
- :attr int source_port_min: The inclusive lower bound of TCP/UDP source port
- range.
+ :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.
"""
def __init__(
self,
- action: str,
- created_at: datetime,
- destination: str,
- direction: str,
- href: str,
- id: str,
- ip_version: str,
- name: str,
- source: str,
- destination_port_max: int,
- destination_port_min: int,
- protocol: str,
- source_port_max: int,
- source_port_min: int,
- *,
- before: 'NetworkACLRuleReference' = None,
+ default: int,
+ max: int,
+ min: int,
+ step: int,
+ type: str,
) -> None:
"""
- Initialize a NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP object.
+ Initialize a InstanceProfileGPURange object.
- :param str action: The action to perform for a packet matching the rule.
- :param datetime created_at: The date and time that the rule was created.
- :param str destination: The destination IP address or CIDR block to match.
- The CIDR block `0.0.0.0/0` matches all destination addresses.
- :param str direction: The direction of traffic to match.
- :param str href: The URL for this network ACL rule.
- :param str id: The unique identifier for this network ACL rule.
- :param str ip_version: The IP version for this rule.
- :param str name: The name for this network ACL rule. The name is unique
- across all rules for the network ACL.
- :param str source: The source IP address or CIDR block to match. The CIDR
- block `0.0.0.0/0` matches all source addresses.
- :param int destination_port_max: The inclusive upper bound of TCP/UDP
- destination port range.
- :param int destination_port_min: The inclusive lower bound of TCP/UDP
- destination port range.
- :param str protocol: The protocol to enforce.
- :param int source_port_max: The inclusive upper bound of TCP/UDP source
- port range.
- :param int source_port_min: The inclusive lower bound of TCP/UDP source
- port range.
- :param NetworkACLRuleReference before: (optional) The rule that this rule
- is immediately before. In a rule collection, this always refers to the next
- item in the collection. If absent, this is the last rule.
+ :param 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.action = action
- self.before = before
- self.created_at = created_at
- self.destination = destination
- self.direction = direction
- self.href = href
- self.id = id
- self.ip_version = ip_version
- self.name = name
- self.source = source
- self.destination_port_max = destination_port_max
- self.destination_port_min = destination_port_min
- self.protocol = protocol
- self.source_port_max = source_port_max
- self.source_port_min = source_port_min
+ self.default = default
+ self.max = max
+ self.min = min
+ self.step = step
+ self.type = type
@classmethod
- def from_dict(cls, _dict: Dict) -> 'NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP':
- """Initialize a NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceProfileGPURange':
+ """Initialize a InstanceProfileGPURange object from a json dictionary."""
args = {}
- if 'action' in _dict:
- args['action'] = _dict.get('action')
- else:
- raise ValueError('Required property \'action\' not present in NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP JSON')
- if 'before' in _dict:
- args['before'] = NetworkACLRuleReference.from_dict(_dict.get('before'))
- if 'created_at' in _dict:
- args['created_at'] = string_to_datetime(_dict.get('created_at'))
- else:
- raise ValueError('Required property \'created_at\' not present in NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP JSON')
- if 'destination' in _dict:
- args['destination'] = _dict.get('destination')
- else:
- raise ValueError('Required property \'destination\' not present in NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP JSON')
- if 'direction' in _dict:
- args['direction'] = _dict.get('direction')
- else:
- raise ValueError('Required property \'direction\' not present in NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP JSON')
- if 'href' in _dict:
- args['href'] = _dict.get('href')
- else:
- raise ValueError('Required property \'href\' not present in NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP JSON')
- if 'id' in _dict:
- args['id'] = _dict.get('id')
- else:
- raise ValueError('Required property \'id\' not present in NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP JSON')
- if 'ip_version' in _dict:
- args['ip_version'] = _dict.get('ip_version')
- else:
- raise ValueError('Required property \'ip_version\' not present in NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP JSON')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
+ if (default := _dict.get('default')) is not None:
+ args['default'] = default
else:
- raise ValueError('Required property \'name\' not present in NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP JSON')
- if 'source' in _dict:
- args['source'] = _dict.get('source')
- else:
- raise ValueError('Required property \'source\' not present in NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP JSON')
- if 'destination_port_max' in _dict:
- args['destination_port_max'] = _dict.get('destination_port_max')
- else:
- raise ValueError('Required property \'destination_port_max\' not present in NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP JSON')
- if 'destination_port_min' in _dict:
- args['destination_port_min'] = _dict.get('destination_port_min')
+ raise ValueError('Required property \'default\' not present in InstanceProfileGPURange JSON')
+ if (max := _dict.get('max')) is not None:
+ args['max'] = max
else:
- raise ValueError('Required property \'destination_port_min\' not present in NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP JSON')
- if 'protocol' in _dict:
- args['protocol'] = _dict.get('protocol')
+ raise ValueError('Required property \'max\' not present in InstanceProfileGPURange JSON')
+ if (min := _dict.get('min')) is not None:
+ args['min'] = min
else:
- raise ValueError('Required property \'protocol\' not present in NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP JSON')
- if 'source_port_max' in _dict:
- args['source_port_max'] = _dict.get('source_port_max')
+ raise ValueError('Required property \'min\' not present in InstanceProfileGPURange JSON')
+ if (step := _dict.get('step')) is not None:
+ args['step'] = step
else:
- raise ValueError('Required property \'source_port_max\' not present in NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP JSON')
- if 'source_port_min' in _dict:
- args['source_port_min'] = _dict.get('source_port_min')
+ raise ValueError('Required property \'step\' not present in InstanceProfileGPURange JSON')
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
else:
- raise ValueError('Required property \'source_port_min\' not present in NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP JSON')
+ raise ValueError('Required property \'type\' not present in InstanceProfileGPURange JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP object from a json dictionary."""
+ """Initialize a InstanceProfileGPURange object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'action') and self.action is not None:
- _dict['action'] = self.action
- if hasattr(self, 'before') and self.before is not None:
- if isinstance(self.before, dict):
- _dict['before'] = self.before
- else:
- _dict['before'] = self.before.to_dict()
- if hasattr(self, 'created_at') and self.created_at is not None:
- _dict['created_at'] = datetime_to_string(self.created_at)
- if hasattr(self, 'destination') and self.destination is not None:
- _dict['destination'] = self.destination
- if hasattr(self, 'direction') and self.direction is not None:
- _dict['direction'] = self.direction
- if hasattr(self, 'href') and self.href is not None:
- _dict['href'] = self.href
- if hasattr(self, 'id') and self.id is not None:
- _dict['id'] = self.id
- if hasattr(self, 'ip_version') and self.ip_version is not None:
- _dict['ip_version'] = self.ip_version
- if hasattr(self, 'name') and self.name is not None:
- _dict['name'] = self.name
- if hasattr(self, 'source') and self.source is not None:
- _dict['source'] = self.source
- if hasattr(self, 'destination_port_max') and self.destination_port_max is not None:
- _dict['destination_port_max'] = self.destination_port_max
- if hasattr(self, 'destination_port_min') and self.destination_port_min is not None:
- _dict['destination_port_min'] = self.destination_port_min
- if hasattr(self, 'protocol') and self.protocol is not None:
- _dict['protocol'] = self.protocol
- if hasattr(self, 'source_port_max') and self.source_port_max is not None:
- _dict['source_port_max'] = self.source_port_max
- if hasattr(self, 'source_port_min') and self.source_port_min is not None:
- _dict['source_port_min'] = self.source_port_min
+ 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):
@@ -108671,159 +112586,129 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP object."""
+ """Return a `str` version of this InstanceProfileGPURange object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP') -> bool:
+ def __eq__(self, other: 'InstanceProfileGPURange') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP') -> bool:
+ def __ne__(self, other: 'InstanceProfileGPURange') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class ActionEnum(str, Enum):
+ class TypeEnum(str, Enum):
"""
- The action to perform for a packet matching the rule.
+ The type for this profile field.
"""
- ALLOW = 'allow'
- DENY = 'deny'
+ RANGE = 'range'
- class DirectionEnum(str, Enum):
- """
- The direction of traffic to match.
- """
- INBOUND = 'inbound'
- OUTBOUND = 'outbound'
+class InstanceProfileIdentityByHref(InstanceProfileIdentity):
+ """
+ InstanceProfileIdentityByHref.
+ :param str href: The URL for this virtual server instance profile.
+ """
- class IpVersionEnum(str, Enum):
+ def __init__(
+ self,
+ href: str,
+ ) -> None:
"""
- The IP version for this rule.
+ Initialize a InstanceProfileIdentityByHref object.
+
+ :param str href: The URL for this virtual server instance profile.
"""
+ # pylint: disable=super-init-not-called
+ self.href = href
- IPV4 = 'ipv4'
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'InstanceProfileIdentityByHref':
+ """Initialize a InstanceProfileIdentityByHref object from a json dictionary."""
+ args = {}
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
+ else:
+ raise ValueError('Required property \'href\' not present in InstanceProfileIdentityByHref JSON')
+ return cls(**args)
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a InstanceProfileIdentityByHref object from a json dictionary."""
+ return cls.from_dict(_dict)
- class ProtocolEnum(str, Enum):
- """
- The protocol to enforce.
- """
+ def to_dict(self) -> Dict:
+ """Return a json dictionary representing this model."""
+ _dict = {}
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
+ return _dict
- TCP = 'tcp'
- UDP = 'udp'
+ def _to_dict(self):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
+
+ def __str__(self) -> str:
+ """Return a `str` version of this InstanceProfileIdentityByHref object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'InstanceProfileIdentityByHref') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+ def __ne__(self, other: 'InstanceProfileIdentityByHref') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
-class NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype(NetworkACLRulePrototypeNetworkACLContext):
+class InstanceProfileIdentityByName(InstanceProfileIdentity):
"""
- NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype.
+ InstanceProfileIdentityByName.
- :attr str action: The action to perform for a packet matching the rule.
- :attr str destination: The destination IP address or CIDR block to match. The
- CIDR block `0.0.0.0/0` matches all destination addresses.
- :attr str direction: The direction of traffic to match.
- :attr str ip_version: (optional) The IP version for this rule.
- :attr str name: (optional) The name for this network ACL rule. The name must not
- be used by another rule for the network ACL. If unspecified, the name will be a
- hyphenated list of randomly-selected words.
- :attr str source: The source IP address or CIDR block to match. The CIDR block
- `0.0.0.0/0` matches all source addresses.
- :attr str protocol: The protocol to enforce.
+ :param str name: The globally unique name for this virtual server instance
+ profile.
"""
def __init__(
self,
- action: str,
- destination: str,
- direction: str,
- source: str,
- protocol: str,
- *,
- ip_version: str = None,
- name: str = None,
+ name: str,
) -> None:
"""
- Initialize a NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype object.
+ Initialize a InstanceProfileIdentityByName object.
- :param str action: The action to perform for a packet matching the rule.
- :param str destination: The destination IP address or CIDR block to match.
- The CIDR block `0.0.0.0/0` matches all destination addresses.
- :param str direction: The direction of traffic to match.
- :param str source: The source IP address or CIDR block to match. The CIDR
- block `0.0.0.0/0` matches all source addresses.
- :param str protocol: The protocol to enforce.
- :param str ip_version: (optional) The IP version for this rule.
- :param str name: (optional) The name for this network ACL rule. The name
- must not be used by another rule for the network ACL. If unspecified, the
- name will be a hyphenated list of randomly-selected words.
+ :param str name: The globally unique name for this virtual server instance
+ profile.
"""
# pylint: disable=super-init-not-called
- self.action = action
- self.destination = destination
- self.direction = direction
- self.ip_version = ip_version
self.name = name
- self.source = source
- self.protocol = protocol
@classmethod
- def from_dict(cls, _dict: Dict) -> 'NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype':
- """Initialize a NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceProfileIdentityByName':
+ """Initialize a InstanceProfileIdentityByName object from a json dictionary."""
args = {}
- if 'action' in _dict:
- args['action'] = _dict.get('action')
- else:
- raise ValueError('Required property \'action\' not present in NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype JSON')
- if 'destination' in _dict:
- args['destination'] = _dict.get('destination')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
else:
- raise ValueError('Required property \'destination\' not present in NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype JSON')
- if 'direction' in _dict:
- args['direction'] = _dict.get('direction')
- else:
- raise ValueError('Required property \'direction\' not present in NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype JSON')
- if 'ip_version' in _dict:
- args['ip_version'] = _dict.get('ip_version')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
- if 'source' in _dict:
- args['source'] = _dict.get('source')
- else:
- raise ValueError('Required property \'source\' not present in NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype JSON')
- if 'protocol' in _dict:
- args['protocol'] = _dict.get('protocol')
- else:
- raise ValueError('Required property \'protocol\' not present in NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype JSON')
+ raise ValueError('Required property \'name\' not present in InstanceProfileIdentityByName JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype object from a json dictionary."""
+ """Initialize a InstanceProfileIdentityByName object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'action') and self.action is not None:
- _dict['action'] = self.action
- if hasattr(self, 'destination') and self.destination is not None:
- _dict['destination'] = self.destination
- if hasattr(self, 'direction') and self.direction is not None:
- _dict['direction'] = self.direction
- if hasattr(self, 'ip_version') and self.ip_version is not None:
- _dict['ip_version'] = self.ip_version
if hasattr(self, 'name') and self.name is not None:
_dict['name'] = self.name
- if hasattr(self, 'source') and self.source is not None:
- _dict['source'] = self.source
- if hasattr(self, 'protocol') and self.protocol is not None:
- _dict['protocol'] = self.protocol
return _dict
def _to_dict(self):
@@ -108831,178 +112716,57 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype object."""
+ """Return a `str` version of this InstanceProfileIdentityByName object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype') -> bool:
+ def __eq__(self, other: 'InstanceProfileIdentityByName') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype') -> bool:
+ def __ne__(self, other: 'InstanceProfileIdentityByName') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class ActionEnum(str, Enum):
- """
- The action to perform for a packet matching the rule.
- """
- ALLOW = 'allow'
- DENY = 'deny'
-
-
- class DirectionEnum(str, Enum):
- """
- The direction of traffic to match.
- """
-
- INBOUND = 'inbound'
- OUTBOUND = 'outbound'
-
-
- class IpVersionEnum(str, Enum):
- """
- The IP version for this rule.
- """
-
- IPV4 = 'ipv4'
-
-
- class ProtocolEnum(str, Enum):
- """
- The protocol to enforce.
- """
-
- ALL = 'all'
-
-
-
-class NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype(NetworkACLRulePrototypeNetworkACLContext):
+class InstanceProfileMemoryDependent(InstanceProfileMemory):
"""
- NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype.
+ The memory value for an instance with this profile depends on its configuration.
- :attr str action: The action to perform for a packet matching the rule.
- :attr str destination: The destination IP address or CIDR block to match. The
- CIDR block `0.0.0.0/0` matches all destination addresses.
- :attr str direction: The direction of traffic to match.
- :attr str ip_version: (optional) The IP version for this rule.
- :attr str name: (optional) The name for this network ACL rule. The name must not
- be used by another rule for the network ACL. If unspecified, the name will be a
- hyphenated list of randomly-selected words.
- :attr str source: The source IP address or CIDR block to match. The CIDR block
- `0.0.0.0/0` matches all source addresses.
- :attr int code: (optional) The ICMP traffic code to match.
- If specified, `type` must also be specified. If unspecified, all codes are
- matched.
- :attr str protocol: The protocol to enforce.
- :attr int type: (optional) The ICMP traffic type to match.
- If unspecified, all types are matched.
+ :param str type: The type for this profile field.
"""
def __init__(
self,
- action: str,
- destination: str,
- direction: str,
- source: str,
- protocol: str,
- *,
- ip_version: str = None,
- name: str = None,
- code: int = None,
- type: int = None,
+ type: str,
) -> None:
"""
- Initialize a NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype object.
+ Initialize a InstanceProfileMemoryDependent object.
- :param str action: The action to perform for a packet matching the rule.
- :param str destination: The destination IP address or CIDR block to match.
- The CIDR block `0.0.0.0/0` matches all destination addresses.
- :param str direction: The direction of traffic to match.
- :param str source: The source IP address or CIDR block to match. The CIDR
- block `0.0.0.0/0` matches all source addresses.
- :param str protocol: The protocol to enforce.
- :param str ip_version: (optional) The IP version for this rule.
- :param str name: (optional) The name for this network ACL rule. The name
- must not be used by another rule for the network ACL. If unspecified, the
- name will be a hyphenated list of randomly-selected words.
- :param int code: (optional) The ICMP traffic code to match.
- If specified, `type` must also be specified. If unspecified, all codes are
- matched.
- :param int type: (optional) The ICMP traffic type to match.
- If unspecified, all types are matched.
+ :param str type: The type for this profile field.
"""
# pylint: disable=super-init-not-called
- self.action = action
- self.destination = destination
- self.direction = direction
- self.ip_version = ip_version
- self.name = name
- self.source = source
- self.code = code
- self.protocol = protocol
self.type = type
@classmethod
- def from_dict(cls, _dict: Dict) -> 'NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype':
- """Initialize a NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceProfileMemoryDependent':
+ """Initialize a InstanceProfileMemoryDependent object from a json dictionary."""
args = {}
- if 'action' in _dict:
- args['action'] = _dict.get('action')
- else:
- raise ValueError('Required property \'action\' not present in NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype JSON')
- if 'destination' in _dict:
- args['destination'] = _dict.get('destination')
- else:
- raise ValueError('Required property \'destination\' not present in NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype JSON')
- if 'direction' in _dict:
- args['direction'] = _dict.get('direction')
- else:
- raise ValueError('Required property \'direction\' not present in NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype JSON')
- if 'ip_version' in _dict:
- args['ip_version'] = _dict.get('ip_version')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
- if 'source' in _dict:
- args['source'] = _dict.get('source')
- else:
- raise ValueError('Required property \'source\' not present in NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype JSON')
- if 'code' in _dict:
- args['code'] = _dict.get('code')
- if 'protocol' in _dict:
- args['protocol'] = _dict.get('protocol')
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
else:
- raise ValueError('Required property \'protocol\' not present in NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype JSON')
- if 'type' in _dict:
- args['type'] = _dict.get('type')
+ raise ValueError('Required property \'type\' not present in InstanceProfileMemoryDependent JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype object from a json dictionary."""
+ """Initialize a InstanceProfileMemoryDependent object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'action') and self.action is not None:
- _dict['action'] = self.action
- if hasattr(self, 'destination') and self.destination is not None:
- _dict['destination'] = self.destination
- if hasattr(self, 'direction') and self.direction is not None:
- _dict['direction'] = self.direction
- if hasattr(self, 'ip_version') and self.ip_version is not None:
- _dict['ip_version'] = self.ip_version
- if hasattr(self, 'name') and self.name is not None:
- _dict['name'] = self.name
- if hasattr(self, 'source') and self.source is not None:
- _dict['source'] = self.source
- if hasattr(self, 'code') and self.code is not None:
- _dict['code'] = self.code
- if hasattr(self, 'protocol') and self.protocol is not None:
- _dict['protocol'] = self.protocol
if hasattr(self, 'type') and self.type is not None:
_dict['type'] = self.type
return _dict
@@ -109012,198 +112776,87 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype object."""
+ """Return a `str` version of this InstanceProfileMemoryDependent object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype') -> bool:
+ def __eq__(self, other: 'InstanceProfileMemoryDependent') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype') -> bool:
+ def __ne__(self, other: 'InstanceProfileMemoryDependent') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class ActionEnum(str, Enum):
- """
- The action to perform for a packet matching the rule.
- """
-
- ALLOW = 'allow'
- DENY = 'deny'
-
-
- class DirectionEnum(str, Enum):
- """
- The direction of traffic to match.
- """
-
- INBOUND = 'inbound'
- OUTBOUND = 'outbound'
-
-
- class IpVersionEnum(str, Enum):
- """
- The IP version for this rule.
- """
-
- IPV4 = 'ipv4'
-
-
- class ProtocolEnum(str, Enum):
+ class TypeEnum(str, Enum):
"""
- The protocol to enforce.
+ The type for this profile field.
"""
- ICMP = 'icmp'
+ DEPENDENT = 'dependent'
-class NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype(NetworkACLRulePrototypeNetworkACLContext):
+class InstanceProfileMemoryEnum(InstanceProfileMemory):
"""
- NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype.
+ The permitted memory values (in gibibytes) for an instance with this profile.
- :attr str action: The action to perform for a packet matching the rule.
- :attr str destination: The destination IP address or CIDR block to match. The
- CIDR block `0.0.0.0/0` matches all destination addresses.
- :attr str direction: The direction of traffic to match.
- :attr str ip_version: (optional) The IP version for this rule.
- :attr str name: (optional) The name for this network ACL rule. The name must not
- be used by another rule for the network ACL. If unspecified, the name will be a
- hyphenated list of randomly-selected words.
- :attr str source: The source IP address or CIDR block to match. The CIDR block
- `0.0.0.0/0` matches all source addresses.
- :attr int destination_port_max: (optional) The inclusive upper bound of TCP/UDP
- destination port range.
- :attr int destination_port_min: (optional) The inclusive lower bound of TCP/UDP
- destination port range.
- :attr str protocol: The protocol to enforce.
- :attr int source_port_max: (optional) The inclusive upper bound of TCP/UDP
- source port range.
- :attr int source_port_min: (optional) The inclusive lower bound of TCP/UDP
- source port range.
+ :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.
"""
def __init__(
self,
- action: str,
- destination: str,
- direction: str,
- source: str,
- protocol: str,
- *,
- ip_version: str = None,
- name: str = None,
- destination_port_max: int = None,
- destination_port_min: int = None,
- source_port_max: int = None,
- source_port_min: int = None,
+ default: int,
+ type: str,
+ values: List[int],
) -> None:
"""
- Initialize a NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype object.
+ Initialize a InstanceProfileMemoryEnum object.
- :param str action: The action to perform for a packet matching the rule.
- :param str destination: The destination IP address or CIDR block to match.
- The CIDR block `0.0.0.0/0` matches all destination addresses.
- :param str direction: The direction of traffic to match.
- :param str source: The source IP address or CIDR block to match. The CIDR
- block `0.0.0.0/0` matches all source addresses.
- :param str protocol: The protocol to enforce.
- :param str ip_version: (optional) The IP version for this rule.
- :param str name: (optional) The name for this network ACL rule. The name
- must not be used by another rule for the network ACL. If unspecified, the
- name will be a hyphenated list of randomly-selected words.
- :param int destination_port_max: (optional) The inclusive upper bound of
- TCP/UDP destination port range.
- :param int destination_port_min: (optional) The inclusive lower bound of
- TCP/UDP destination port range.
- :param int source_port_max: (optional) The inclusive upper bound of TCP/UDP
- source port range.
- :param int source_port_min: (optional) The inclusive lower bound of TCP/UDP
- source port range.
+ :param int default: The default value for this profile field.
+ :param str type: The type for this profile field.
+ :param List[int] values: The permitted values for this profile field.
"""
# pylint: disable=super-init-not-called
- self.action = action
- self.destination = destination
- self.direction = direction
- self.ip_version = ip_version
- self.name = name
- self.source = source
- self.destination_port_max = destination_port_max
- self.destination_port_min = destination_port_min
- self.protocol = protocol
- self.source_port_max = source_port_max
- self.source_port_min = source_port_min
+ self.default = default
+ self.type = type
+ self.values = values
@classmethod
- def from_dict(cls, _dict: Dict) -> 'NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype':
- """Initialize a NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceProfileMemoryEnum':
+ """Initialize a InstanceProfileMemoryEnum object from a json dictionary."""
args = {}
- if 'action' in _dict:
- args['action'] = _dict.get('action')
+ if (default := _dict.get('default')) is not None:
+ args['default'] = default
else:
- raise ValueError('Required property \'action\' not present in NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype JSON')
- if 'destination' in _dict:
- args['destination'] = _dict.get('destination')
- else:
- raise ValueError('Required property \'destination\' not present in NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype JSON')
- if 'direction' in _dict:
- args['direction'] = _dict.get('direction')
- else:
- raise ValueError('Required property \'direction\' not present in NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype JSON')
- if 'ip_version' in _dict:
- args['ip_version'] = _dict.get('ip_version')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
- if 'source' in _dict:
- args['source'] = _dict.get('source')
+ raise ValueError('Required property \'default\' not present in InstanceProfileMemoryEnum JSON')
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
else:
- raise ValueError('Required property \'source\' not present in NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype JSON')
- if 'destination_port_max' in _dict:
- args['destination_port_max'] = _dict.get('destination_port_max')
- if 'destination_port_min' in _dict:
- args['destination_port_min'] = _dict.get('destination_port_min')
- if 'protocol' in _dict:
- args['protocol'] = _dict.get('protocol')
+ raise ValueError('Required property \'type\' not present in InstanceProfileMemoryEnum JSON')
+ if (values := _dict.get('values')) is not None:
+ args['values'] = values
else:
- raise ValueError('Required property \'protocol\' not present in NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype JSON')
- if 'source_port_max' in _dict:
- args['source_port_max'] = _dict.get('source_port_max')
- if 'source_port_min' in _dict:
- args['source_port_min'] = _dict.get('source_port_min')
+ raise ValueError('Required property \'values\' not present in InstanceProfileMemoryEnum JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype object from a json dictionary."""
+ """Initialize a InstanceProfileMemoryEnum object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'action') and self.action is not None:
- _dict['action'] = self.action
- if hasattr(self, 'destination') and self.destination is not None:
- _dict['destination'] = self.destination
- if hasattr(self, 'direction') and self.direction is not None:
- _dict['direction'] = self.direction
- if hasattr(self, 'ip_version') and self.ip_version is not None:
- _dict['ip_version'] = self.ip_version
- if hasattr(self, 'name') and self.name is not None:
- _dict['name'] = self.name
- if hasattr(self, 'source') and self.source is not None:
- _dict['source'] = self.source
- if hasattr(self, 'destination_port_max') and self.destination_port_max is not None:
- _dict['destination_port_max'] = self.destination_port_max
- if hasattr(self, 'destination_port_min') and self.destination_port_min is not None:
- _dict['destination_port_min'] = self.destination_port_min
- if hasattr(self, 'protocol') and self.protocol is not None:
- _dict['protocol'] = self.protocol
- if hasattr(self, 'source_port_max') and self.source_port_max is not None:
- _dict['source_port_max'] = self.source_port_max
- if hasattr(self, 'source_port_min') and self.source_port_min is not None:
- _dict['source_port_min'] = self.source_port_min
+ if hasattr(self, '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):
@@ -109211,170 +112864,77 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype object."""
+ """Return a `str` version of this InstanceProfileMemoryEnum object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype') -> bool:
+ def __eq__(self, other: 'InstanceProfileMemoryEnum') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype') -> bool:
+ def __ne__(self, other: 'InstanceProfileMemoryEnum') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class ActionEnum(str, Enum):
- """
- The action to perform for a packet matching the rule.
- """
-
- ALLOW = 'allow'
- DENY = 'deny'
-
-
- class DirectionEnum(str, Enum):
- """
- The direction of traffic to match.
- """
-
- INBOUND = 'inbound'
- OUTBOUND = 'outbound'
-
-
- class IpVersionEnum(str, Enum):
- """
- The IP version for this rule.
- """
-
- IPV4 = 'ipv4'
-
-
- class ProtocolEnum(str, Enum):
+ class TypeEnum(str, Enum):
"""
- The protocol to enforce.
+ The type for this profile field.
"""
- TCP = 'tcp'
- UDP = 'udp'
+ ENUM = 'enum'
-class NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype(NetworkACLRulePrototype):
+class InstanceProfileMemoryFixed(InstanceProfileMemory):
"""
- NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype.
+ The memory (in gibibytes) for an instance with this profile.
- :attr str action: The action to perform for a packet matching the rule.
- :attr NetworkACLRuleBeforePrototype before: (optional)
- :attr str destination: The destination IP address or CIDR block to match. The
- CIDR block `0.0.0.0/0` matches all destination addresses.
- :attr str direction: The direction of traffic to match.
- :attr str ip_version: (optional) The IP version for this rule.
- :attr str name: (optional) The name for this network ACL rule. The name must not
- be used by another rule for the network ACL. If unspecified, the name will be a
- hyphenated list of randomly-selected words.
- :attr str source: The source IP address or CIDR block to match. The CIDR block
- `0.0.0.0/0` matches all source addresses.
- :attr str protocol: The protocol to enforce.
+ :param str type: The type for this profile field.
+ :param int value: The value for this profile field.
"""
def __init__(
self,
- action: str,
- destination: str,
- direction: str,
- source: str,
- protocol: str,
- *,
- before: 'NetworkACLRuleBeforePrototype' = None,
- ip_version: str = None,
- name: str = None,
+ type: str,
+ value: int,
) -> None:
"""
- Initialize a NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype object.
+ Initialize a InstanceProfileMemoryFixed object.
- :param str action: The action to perform for a packet matching the rule.
- :param str destination: The destination IP address or CIDR block to match.
- The CIDR block `0.0.0.0/0` matches all destination addresses.
- :param str direction: The direction of traffic to match.
- :param str source: The source IP address or CIDR block to match. The CIDR
- block `0.0.0.0/0` matches all source addresses.
- :param str protocol: The protocol to enforce.
- :param NetworkACLRuleBeforePrototype before: (optional)
- :param str ip_version: (optional) The IP version for this rule.
- :param str name: (optional) The name for this network ACL rule. The name
- must not be used by another rule for the network ACL. If unspecified, the
- name will be a hyphenated list of randomly-selected words.
+ :param str type: The type for this profile field.
+ :param int value: The value for this profile field.
"""
# pylint: disable=super-init-not-called
- self.action = action
- self.before = before
- self.destination = destination
- self.direction = direction
- self.ip_version = ip_version
- self.name = name
- self.source = source
- self.protocol = protocol
+ self.type = type
+ self.value = value
@classmethod
- def from_dict(cls, _dict: Dict) -> 'NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype':
- """Initialize a NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceProfileMemoryFixed':
+ """Initialize a InstanceProfileMemoryFixed object from a json dictionary."""
args = {}
- if 'action' in _dict:
- args['action'] = _dict.get('action')
- else:
- raise ValueError('Required property \'action\' not present in NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype JSON')
- if 'before' in _dict:
- args['before'] = _dict.get('before')
- if 'destination' in _dict:
- args['destination'] = _dict.get('destination')
- else:
- raise ValueError('Required property \'destination\' not present in NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype JSON')
- if 'direction' in _dict:
- args['direction'] = _dict.get('direction')
- else:
- raise ValueError('Required property \'direction\' not present in NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype JSON')
- if 'ip_version' in _dict:
- args['ip_version'] = _dict.get('ip_version')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
- if 'source' in _dict:
- args['source'] = _dict.get('source')
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
else:
- raise ValueError('Required property \'source\' not present in NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype JSON')
- if 'protocol' in _dict:
- args['protocol'] = _dict.get('protocol')
+ raise ValueError('Required property \'type\' not present in InstanceProfileMemoryFixed JSON')
+ if (value := _dict.get('value')) is not None:
+ args['value'] = value
else:
- raise ValueError('Required property \'protocol\' not present in NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype JSON')
+ raise ValueError('Required property \'value\' not present in InstanceProfileMemoryFixed JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype object from a json dictionary."""
+ """Initialize a InstanceProfileMemoryFixed object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'action') and self.action is not None:
- _dict['action'] = self.action
- if hasattr(self, 'before') and self.before is not None:
- if isinstance(self.before, dict):
- _dict['before'] = self.before
- else:
- _dict['before'] = self.before.to_dict()
- if hasattr(self, 'destination') and self.destination is not None:
- _dict['destination'] = self.destination
- if hasattr(self, 'direction') and self.direction is not None:
- _dict['direction'] = self.direction
- if hasattr(self, 'ip_version') and self.ip_version is not None:
- _dict['ip_version'] = self.ip_version
- if hasattr(self, 'name') and self.name is not None:
- _dict['name'] = self.name
- if hasattr(self, 'source') and self.source is not None:
- _dict['source'] = self.source
- if hasattr(self, 'protocol') and self.protocol is not None:
- _dict['protocol'] = self.protocol
+ if hasattr(self, 'type') and self.type is not None:
+ _dict['type'] = self.type
+ if hasattr(self, 'value') and self.value is not None:
+ _dict['value'] = self.value
return _dict
def _to_dict(self):
@@ -109382,189 +112942,105 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype object."""
+ """Return a `str` version of this InstanceProfileMemoryFixed object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype') -> bool:
+ def __eq__(self, other: 'InstanceProfileMemoryFixed') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype') -> bool:
+ def __ne__(self, other: 'InstanceProfileMemoryFixed') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class ActionEnum(str, Enum):
- """
- The action to perform for a packet matching the rule.
- """
-
- ALLOW = 'allow'
- DENY = 'deny'
-
-
- class DirectionEnum(str, Enum):
- """
- The direction of traffic to match.
- """
-
- INBOUND = 'inbound'
- OUTBOUND = 'outbound'
-
-
- class IpVersionEnum(str, Enum):
- """
- The IP version for this rule.
- """
-
- IPV4 = 'ipv4'
-
-
- class ProtocolEnum(str, Enum):
+ class TypeEnum(str, Enum):
"""
- The protocol to enforce.
+ The type for this profile field.
"""
- ALL = 'all'
+ FIXED = 'fixed'
-class NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype(NetworkACLRulePrototype):
+class InstanceProfileMemoryRange(InstanceProfileMemory):
"""
- NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype.
+ The permitted memory range (in gibibytes) for an instance with this profile.
- :attr str action: The action to perform for a packet matching the rule.
- :attr NetworkACLRuleBeforePrototype before: (optional)
- :attr str destination: The destination IP address or CIDR block to match. The
- CIDR block `0.0.0.0/0` matches all destination addresses.
- :attr str direction: The direction of traffic to match.
- :attr str ip_version: (optional) The IP version for this rule.
- :attr str name: (optional) The name for this network ACL rule. The name must not
- be used by another rule for the network ACL. If unspecified, the name will be a
- hyphenated list of randomly-selected words.
- :attr str source: The source IP address or CIDR block to match. The CIDR block
- `0.0.0.0/0` matches all source addresses.
- :attr int code: (optional) The ICMP traffic code to match.
- If specified, `type` must also be specified. If unspecified, all codes are
- matched.
- :attr str protocol: The protocol to enforce.
- :attr int type: (optional) The ICMP traffic type to match.
- If unspecified, all types are matched.
+ :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.
"""
def __init__(
self,
- action: str,
- destination: str,
- direction: str,
- source: str,
- protocol: str,
- *,
- before: 'NetworkACLRuleBeforePrototype' = None,
- ip_version: str = None,
- name: str = None,
- code: int = None,
- type: int = None,
+ default: int,
+ max: int,
+ min: int,
+ step: int,
+ type: str,
) -> None:
"""
- Initialize a NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype object.
+ Initialize a InstanceProfileMemoryRange object.
- :param str action: The action to perform for a packet matching the rule.
- :param str destination: The destination IP address or CIDR block to match.
- The CIDR block `0.0.0.0/0` matches all destination addresses.
- :param str direction: The direction of traffic to match.
- :param str source: The source IP address or CIDR block to match. The CIDR
- block `0.0.0.0/0` matches all source addresses.
- :param str protocol: The protocol to enforce.
- :param NetworkACLRuleBeforePrototype before: (optional)
- :param str ip_version: (optional) The IP version for this rule.
- :param str name: (optional) The name for this network ACL rule. The name
- must not be used by another rule for the network ACL. If unspecified, the
- name will be a hyphenated list of randomly-selected words.
- :param int code: (optional) The ICMP traffic code to match.
- If specified, `type` must also be specified. If unspecified, all codes are
- matched.
- :param int type: (optional) The ICMP traffic type to match.
- If unspecified, all types are matched.
+ :param 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.action = action
- self.before = before
- self.destination = destination
- self.direction = direction
- self.ip_version = ip_version
- self.name = name
- self.source = source
- self.code = code
- self.protocol = protocol
+ self.default = default
+ self.max = max
+ self.min = min
+ self.step = step
self.type = type
@classmethod
- def from_dict(cls, _dict: Dict) -> 'NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype':
- """Initialize a NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceProfileMemoryRange':
+ """Initialize a InstanceProfileMemoryRange object from a json dictionary."""
args = {}
- if 'action' in _dict:
- args['action'] = _dict.get('action')
+ if (default := _dict.get('default')) is not None:
+ args['default'] = default
else:
- raise ValueError('Required property \'action\' not present in NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype JSON')
- if 'before' in _dict:
- args['before'] = _dict.get('before')
- if 'destination' in _dict:
- args['destination'] = _dict.get('destination')
+ raise ValueError('Required property \'default\' not present in InstanceProfileMemoryRange JSON')
+ if (max := _dict.get('max')) is not None:
+ args['max'] = max
else:
- raise ValueError('Required property \'destination\' not present in NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype JSON')
- if 'direction' in _dict:
- args['direction'] = _dict.get('direction')
+ raise ValueError('Required property \'max\' not present in InstanceProfileMemoryRange JSON')
+ if (min := _dict.get('min')) is not None:
+ args['min'] = min
else:
- raise ValueError('Required property \'direction\' not present in NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype JSON')
- if 'ip_version' in _dict:
- args['ip_version'] = _dict.get('ip_version')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
- if 'source' in _dict:
- args['source'] = _dict.get('source')
+ raise ValueError('Required property \'min\' not present in InstanceProfileMemoryRange JSON')
+ if (step := _dict.get('step')) is not None:
+ args['step'] = step
else:
- raise ValueError('Required property \'source\' not present in NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype JSON')
- if 'code' in _dict:
- args['code'] = _dict.get('code')
- if 'protocol' in _dict:
- args['protocol'] = _dict.get('protocol')
+ raise ValueError('Required property \'step\' not present in InstanceProfileMemoryRange JSON')
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
else:
- raise ValueError('Required property \'protocol\' not present in NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype JSON')
- if 'type' in _dict:
- args['type'] = _dict.get('type')
+ raise ValueError('Required property \'type\' not present in InstanceProfileMemoryRange JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype object from a json dictionary."""
+ """Initialize a InstanceProfileMemoryRange object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'action') and self.action is not None:
- _dict['action'] = self.action
- if hasattr(self, 'before') and self.before is not None:
- if isinstance(self.before, dict):
- _dict['before'] = self.before
- else:
- _dict['before'] = self.before.to_dict()
- if hasattr(self, 'destination') and self.destination is not None:
- _dict['destination'] = self.destination
- if hasattr(self, 'direction') and self.direction is not None:
- _dict['direction'] = self.direction
- if hasattr(self, 'ip_version') and self.ip_version is not None:
- _dict['ip_version'] = self.ip_version
- if hasattr(self, 'name') and self.name is not None:
- _dict['name'] = self.name
- if hasattr(self, 'source') and self.source is not None:
- _dict['source'] = self.source
- if hasattr(self, 'code') and self.code is not None:
- _dict['code'] = self.code
- if hasattr(self, 'protocol') and self.protocol is not None:
- _dict['protocol'] = self.protocol
+ if hasattr(self, '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
@@ -109574,209 +113050,146 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype object."""
+ """Return a `str` version of this InstanceProfileMemoryRange object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype') -> bool:
+ def __eq__(self, other: 'InstanceProfileMemoryRange') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype') -> bool:
+ def __ne__(self, other: 'InstanceProfileMemoryRange') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class ActionEnum(str, Enum):
+ class TypeEnum(str, Enum):
"""
- The action to perform for a packet matching the rule.
+ The type for this profile field.
"""
- ALLOW = 'allow'
- DENY = 'deny'
+ RANGE = 'range'
- class DirectionEnum(str, Enum):
- """
- The direction of traffic to match.
- """
- INBOUND = 'inbound'
- OUTBOUND = 'outbound'
+class InstanceProfileNUMACountDependent(InstanceProfileNUMACount):
+ """
+ The total number of NUMA nodes for an instance with this profile depends on its
+ configuration and the capacity constraints within the zone.
+ :param str type: The type for this profile field.
+ """
- class IpVersionEnum(str, Enum):
+ def __init__(
+ self,
+ type: str,
+ ) -> None:
"""
- The IP version for this rule.
+ Initialize a InstanceProfileNUMACountDependent object.
+
+ :param str type: The type for this profile field.
"""
+ # pylint: disable=super-init-not-called
+ self.type = type
- IPV4 = 'ipv4'
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'InstanceProfileNUMACountDependent':
+ """Initialize a InstanceProfileNUMACountDependent object from a json dictionary."""
+ args = {}
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
+ else:
+ raise ValueError('Required property \'type\' not present in InstanceProfileNUMACountDependent JSON')
+ return cls(**args)
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a InstanceProfileNUMACountDependent object from a json dictionary."""
+ return cls.from_dict(_dict)
- class ProtocolEnum(str, Enum):
+ def to_dict(self) -> Dict:
+ """Return a json dictionary representing this model."""
+ _dict = {}
+ if hasattr(self, 'type') and self.type is not None:
+ _dict['type'] = self.type
+ return _dict
+
+ def _to_dict(self):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
+
+ def __str__(self) -> str:
+ """Return a `str` version of this InstanceProfileNUMACountDependent object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'InstanceProfileNUMACountDependent') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'InstanceProfileNUMACountDependent') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+ class TypeEnum(str, Enum):
"""
- The protocol to enforce.
+ The type for this profile field.
"""
- ICMP = 'icmp'
+ DEPENDENT = 'dependent'
-class NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype(NetworkACLRulePrototype):
+class InstanceProfileNUMACountFixed(InstanceProfileNUMACount):
"""
- NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype.
+ The total number of NUMA nodes for an instance with this profile.
- :attr str action: The action to perform for a packet matching the rule.
- :attr NetworkACLRuleBeforePrototype before: (optional)
- :attr str destination: The destination IP address or CIDR block to match. The
- CIDR block `0.0.0.0/0` matches all destination addresses.
- :attr str direction: The direction of traffic to match.
- :attr str ip_version: (optional) The IP version for this rule.
- :attr str name: (optional) The name for this network ACL rule. The name must not
- be used by another rule for the network ACL. If unspecified, the name will be a
- hyphenated list of randomly-selected words.
- :attr str source: The source IP address or CIDR block to match. The CIDR block
- `0.0.0.0/0` matches all source addresses.
- :attr int destination_port_max: (optional) The inclusive upper bound of TCP/UDP
- destination port range.
- :attr int destination_port_min: (optional) The inclusive lower bound of TCP/UDP
- destination port range.
- :attr str protocol: The protocol to enforce.
- :attr int source_port_max: (optional) The inclusive upper bound of TCP/UDP
- source port range.
- :attr int source_port_min: (optional) The inclusive lower bound of TCP/UDP
- source port range.
+ :param str type: The type for this profile field.
+ :param int value: The value for this profile field.
"""
def __init__(
self,
- action: str,
- destination: str,
- direction: str,
- source: str,
- protocol: str,
- *,
- before: 'NetworkACLRuleBeforePrototype' = None,
- ip_version: str = None,
- name: str = None,
- destination_port_max: int = None,
- destination_port_min: int = None,
- source_port_max: int = None,
- source_port_min: int = None,
+ type: str,
+ value: int,
) -> None:
"""
- Initialize a NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype object.
+ Initialize a InstanceProfileNUMACountFixed object.
- :param str action: The action to perform for a packet matching the rule.
- :param str destination: The destination IP address or CIDR block to match.
- The CIDR block `0.0.0.0/0` matches all destination addresses.
- :param str direction: The direction of traffic to match.
- :param str source: The source IP address or CIDR block to match. The CIDR
- block `0.0.0.0/0` matches all source addresses.
- :param str protocol: The protocol to enforce.
- :param NetworkACLRuleBeforePrototype before: (optional)
- :param str ip_version: (optional) The IP version for this rule.
- :param str name: (optional) The name for this network ACL rule. The name
- must not be used by another rule for the network ACL. If unspecified, the
- name will be a hyphenated list of randomly-selected words.
- :param int destination_port_max: (optional) The inclusive upper bound of
- TCP/UDP destination port range.
- :param int destination_port_min: (optional) The inclusive lower bound of
- TCP/UDP destination port range.
- :param int source_port_max: (optional) The inclusive upper bound of TCP/UDP
- source port range.
- :param int source_port_min: (optional) The inclusive lower bound of TCP/UDP
- source port range.
+ :param str type: The type for this profile field.
+ :param int value: The value for this profile field.
"""
# pylint: disable=super-init-not-called
- self.action = action
- self.before = before
- self.destination = destination
- self.direction = direction
- self.ip_version = ip_version
- self.name = name
- self.source = source
- self.destination_port_max = destination_port_max
- self.destination_port_min = destination_port_min
- self.protocol = protocol
- self.source_port_max = source_port_max
- self.source_port_min = source_port_min
+ self.type = type
+ self.value = value
@classmethod
- def from_dict(cls, _dict: Dict) -> 'NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype':
- """Initialize a NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceProfileNUMACountFixed':
+ """Initialize a InstanceProfileNUMACountFixed object from a json dictionary."""
args = {}
- if 'action' in _dict:
- args['action'] = _dict.get('action')
- else:
- raise ValueError('Required property \'action\' not present in NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype JSON')
- if 'before' in _dict:
- args['before'] = _dict.get('before')
- if 'destination' in _dict:
- args['destination'] = _dict.get('destination')
- else:
- raise ValueError('Required property \'destination\' not present in NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype JSON')
- if 'direction' in _dict:
- args['direction'] = _dict.get('direction')
- else:
- raise ValueError('Required property \'direction\' not present in NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype JSON')
- if 'ip_version' in _dict:
- args['ip_version'] = _dict.get('ip_version')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
- if 'source' in _dict:
- args['source'] = _dict.get('source')
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
else:
- raise ValueError('Required property \'source\' not present in NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype JSON')
- if 'destination_port_max' in _dict:
- args['destination_port_max'] = _dict.get('destination_port_max')
- if 'destination_port_min' in _dict:
- args['destination_port_min'] = _dict.get('destination_port_min')
- if 'protocol' in _dict:
- args['protocol'] = _dict.get('protocol')
+ raise ValueError('Required property \'type\' not present in InstanceProfileNUMACountFixed JSON')
+ if (value := _dict.get('value')) is not None:
+ args['value'] = value
else:
- raise ValueError('Required property \'protocol\' not present in NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype JSON')
- if 'source_port_max' in _dict:
- args['source_port_max'] = _dict.get('source_port_max')
- if 'source_port_min' in _dict:
- args['source_port_min'] = _dict.get('source_port_min')
+ raise ValueError('Required property \'value\' not present in InstanceProfileNUMACountFixed JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype object from a json dictionary."""
+ """Initialize a InstanceProfileNUMACountFixed object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'action') and self.action is not None:
- _dict['action'] = self.action
- if hasattr(self, 'before') and self.before is not None:
- if isinstance(self.before, dict):
- _dict['before'] = self.before
- else:
- _dict['before'] = self.before.to_dict()
- if hasattr(self, 'destination') and self.destination is not None:
- _dict['destination'] = self.destination
- if hasattr(self, 'direction') and self.direction is not None:
- _dict['direction'] = self.direction
- if hasattr(self, 'ip_version') and self.ip_version is not None:
- _dict['ip_version'] = self.ip_version
- if hasattr(self, 'name') and self.name is not None:
- _dict['name'] = self.name
- if hasattr(self, 'source') and self.source is not None:
- _dict['source'] = self.source
- if hasattr(self, 'destination_port_max') and self.destination_port_max is not None:
- _dict['destination_port_max'] = self.destination_port_max
- if hasattr(self, 'destination_port_min') and self.destination_port_min is not None:
- _dict['destination_port_min'] = self.destination_port_min
- if hasattr(self, 'protocol') and self.protocol is not None:
- _dict['protocol'] = self.protocol
- if hasattr(self, 'source_port_max') and self.source_port_max is not None:
- _dict['source_port_max'] = self.source_port_max
- if hasattr(self, 'source_port_min') and self.source_port_min is not None:
- _dict['source_port_min'] = self.source_port_min
+ if hasattr(self, '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):
@@ -109784,204 +113197,153 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype object."""
+ """Return a `str` version of this InstanceProfileNUMACountFixed object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype') -> bool:
+ def __eq__(self, other: 'InstanceProfileNUMACountFixed') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype') -> bool:
+ def __ne__(self, other: 'InstanceProfileNUMACountFixed') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class ActionEnum(str, Enum):
+ class TypeEnum(str, Enum):
"""
- The action to perform for a packet matching the rule.
+ The type for this profile field.
"""
- ALLOW = 'allow'
- DENY = 'deny'
+ FIXED = 'fixed'
- class DirectionEnum(str, Enum):
- """
- The direction of traffic to match.
- """
- INBOUND = 'inbound'
- OUTBOUND = 'outbound'
+class InstanceProfileNetworkAttachmentCountDependent(InstanceProfileNetworkAttachmentCount):
+ """
+ The number of network attachments supported on an instance with this profile is
+ dependent on its configuration.
+ :param str type: The type for this profile field.
+ """
- class IpVersionEnum(str, Enum):
+ def __init__(
+ self,
+ type: str,
+ ) -> None:
"""
- The IP version for this rule.
+ Initialize a InstanceProfileNetworkAttachmentCountDependent object.
+
+ :param str type: The type for this profile field.
"""
+ # pylint: disable=super-init-not-called
+ self.type = type
- IPV4 = 'ipv4'
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'InstanceProfileNetworkAttachmentCountDependent':
+ """Initialize a InstanceProfileNetworkAttachmentCountDependent object from a json dictionary."""
+ args = {}
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
+ else:
+ raise ValueError('Required property \'type\' not present in InstanceProfileNetworkAttachmentCountDependent JSON')
+ return cls(**args)
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a InstanceProfileNetworkAttachmentCountDependent object from a json dictionary."""
+ return cls.from_dict(_dict)
- class ProtocolEnum(str, Enum):
+ def to_dict(self) -> Dict:
+ """Return a json dictionary representing this model."""
+ _dict = {}
+ if hasattr(self, 'type') and self.type is not None:
+ _dict['type'] = self.type
+ return _dict
+
+ def _to_dict(self):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
+
+ def __str__(self) -> str:
+ """Return a `str` version of this InstanceProfileNetworkAttachmentCountDependent object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'InstanceProfileNetworkAttachmentCountDependent') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'InstanceProfileNetworkAttachmentCountDependent') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+ class TypeEnum(str, Enum):
"""
- The protocol to enforce.
+ The type for this profile field.
"""
- TCP = 'tcp'
- UDP = 'udp'
+ DEPENDENT = 'dependent'
-class NetworkACLRuleNetworkACLRuleProtocolAll(NetworkACLRule):
+class InstanceProfileNetworkAttachmentCountRange(InstanceProfileNetworkAttachmentCount):
"""
- NetworkACLRuleNetworkACLRuleProtocolAll.
+ The number of network attachments supported on an instance with this profile.
- :attr str action: The action to perform for a packet matching the rule.
- :attr NetworkACLRuleReference before: (optional) The rule that this rule is
- immediately before. If absent, this is the last rule.
- :attr datetime created_at: The date and time that the rule was created.
- :attr str destination: The destination IP address or CIDR block to match. The
- CIDR block `0.0.0.0/0` matches all destination addresses.
- :attr str direction: The direction of traffic to match.
- :attr str href: The URL for this network ACL rule.
- :attr str id: The unique identifier for this network ACL rule.
- :attr str ip_version: The IP version for this rule.
- :attr str name: The name for this network ACL rule. The name is unique across
- all rules for the network ACL.
- :attr str source: The source IP address or CIDR block to match. The CIDR block
- `0.0.0.0/0` matches all source addresses.
- :attr str protocol: The protocol to enforce.
+ :param int max: (optional) The maximum value for this profile field.
+ :param int min: (optional) The minimum value for this profile field.
+ :param str type: The type for this profile field.
"""
def __init__(
self,
- action: str,
- created_at: datetime,
- destination: str,
- direction: str,
- href: str,
- id: str,
- ip_version: str,
- name: str,
- source: str,
- protocol: str,
+ type: str,
*,
- before: 'NetworkACLRuleReference' = None,
+ max: Optional[int] = None,
+ min: Optional[int] = None,
) -> None:
"""
- Initialize a NetworkACLRuleNetworkACLRuleProtocolAll object.
+ Initialize a InstanceProfileNetworkAttachmentCountRange object.
- :param str action: The action to perform for a packet matching the rule.
- :param datetime created_at: The date and time that the rule was created.
- :param str destination: The destination IP address or CIDR block to match.
- The CIDR block `0.0.0.0/0` matches all destination addresses.
- :param str direction: The direction of traffic to match.
- :param str href: The URL for this network ACL rule.
- :param str id: The unique identifier for this network ACL rule.
- :param str ip_version: The IP version for this rule.
- :param str name: The name for this network ACL rule. The name is unique
- across all rules for the network ACL.
- :param str source: The source IP address or CIDR block to match. The CIDR
- block `0.0.0.0/0` matches all source addresses.
- :param str protocol: The protocol to enforce.
- :param NetworkACLRuleReference before: (optional) The rule that this rule
- is immediately before. If absent, this is the last rule.
+ :param str type: The type for this profile field.
+ :param int max: (optional) The maximum value for this profile field.
+ :param int min: (optional) The minimum value for this profile field.
"""
# pylint: disable=super-init-not-called
- self.action = action
- self.before = before
- self.created_at = created_at
- self.destination = destination
- self.direction = direction
- self.href = href
- self.id = id
- self.ip_version = ip_version
- self.name = name
- self.source = source
- self.protocol = protocol
+ self.max = max
+ self.min = min
+ self.type = type
@classmethod
- def from_dict(cls, _dict: Dict) -> 'NetworkACLRuleNetworkACLRuleProtocolAll':
- """Initialize a NetworkACLRuleNetworkACLRuleProtocolAll object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceProfileNetworkAttachmentCountRange':
+ """Initialize a InstanceProfileNetworkAttachmentCountRange object from a json dictionary."""
args = {}
- if 'action' in _dict:
- args['action'] = _dict.get('action')
- else:
- raise ValueError('Required property \'action\' not present in NetworkACLRuleNetworkACLRuleProtocolAll JSON')
- if 'before' in _dict:
- args['before'] = NetworkACLRuleReference.from_dict(_dict.get('before'))
- if 'created_at' in _dict:
- args['created_at'] = string_to_datetime(_dict.get('created_at'))
- else:
- raise ValueError('Required property \'created_at\' not present in NetworkACLRuleNetworkACLRuleProtocolAll JSON')
- if 'destination' in _dict:
- args['destination'] = _dict.get('destination')
- else:
- raise ValueError('Required property \'destination\' not present in NetworkACLRuleNetworkACLRuleProtocolAll JSON')
- if 'direction' in _dict:
- args['direction'] = _dict.get('direction')
- else:
- raise ValueError('Required property \'direction\' not present in NetworkACLRuleNetworkACLRuleProtocolAll JSON')
- if 'href' in _dict:
- args['href'] = _dict.get('href')
- else:
- raise ValueError('Required property \'href\' not present in NetworkACLRuleNetworkACLRuleProtocolAll JSON')
- if 'id' in _dict:
- args['id'] = _dict.get('id')
- else:
- raise ValueError('Required property \'id\' not present in NetworkACLRuleNetworkACLRuleProtocolAll JSON')
- if 'ip_version' in _dict:
- args['ip_version'] = _dict.get('ip_version')
- else:
- raise ValueError('Required property \'ip_version\' not present in NetworkACLRuleNetworkACLRuleProtocolAll JSON')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
- else:
- raise ValueError('Required property \'name\' not present in NetworkACLRuleNetworkACLRuleProtocolAll JSON')
- if 'source' in _dict:
- args['source'] = _dict.get('source')
- else:
- raise ValueError('Required property \'source\' not present in NetworkACLRuleNetworkACLRuleProtocolAll JSON')
- if 'protocol' in _dict:
- args['protocol'] = _dict.get('protocol')
+ if (max := _dict.get('max')) is not None:
+ args['max'] = max
+ if (min := _dict.get('min')) is not None:
+ args['min'] = min
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
else:
- raise ValueError('Required property \'protocol\' not present in NetworkACLRuleNetworkACLRuleProtocolAll JSON')
+ raise ValueError('Required property \'type\' not present in InstanceProfileNetworkAttachmentCountRange JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a NetworkACLRuleNetworkACLRuleProtocolAll object from a json dictionary."""
+ """Initialize a InstanceProfileNetworkAttachmentCountRange object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'action') and self.action is not None:
- _dict['action'] = self.action
- if hasattr(self, 'before') and self.before is not None:
- if isinstance(self.before, dict):
- _dict['before'] = self.before
- else:
- _dict['before'] = self.before.to_dict()
- if hasattr(self, 'created_at') and self.created_at is not None:
- _dict['created_at'] = datetime_to_string(self.created_at)
- if hasattr(self, 'destination') and self.destination is not None:
- _dict['destination'] = self.destination
- if hasattr(self, 'direction') and self.direction is not None:
- _dict['direction'] = self.direction
- if hasattr(self, 'href') and self.href is not None:
- _dict['href'] = self.href
- if hasattr(self, 'id') and self.id is not None:
- _dict['id'] = self.id
- if hasattr(self, 'ip_version') and self.ip_version is not None:
- _dict['ip_version'] = self.ip_version
- if hasattr(self, 'name') and self.name is not None:
- _dict['name'] = self.name
- if hasattr(self, 'source') and self.source is not None:
- _dict['source'] = self.source
- if hasattr(self, 'protocol') and self.protocol is not None:
- _dict['protocol'] = self.protocol
+ if hasattr(self, 'max') and self.max is not None:
+ _dict['max'] = self.max
+ if hasattr(self, 'min') and self.min is not None:
+ _dict['min'] = self.min
+ if hasattr(self, 'type') and self.type is not None:
+ _dict['type'] = self.type
return _dict
def _to_dict(self):
@@ -109989,221 +113351,66 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this NetworkACLRuleNetworkACLRuleProtocolAll object."""
+ """Return a `str` version of this InstanceProfileNetworkAttachmentCountRange object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'NetworkACLRuleNetworkACLRuleProtocolAll') -> bool:
+ def __eq__(self, other: 'InstanceProfileNetworkAttachmentCountRange') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'NetworkACLRuleNetworkACLRuleProtocolAll') -> bool:
+ def __ne__(self, other: 'InstanceProfileNetworkAttachmentCountRange') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class ActionEnum(str, Enum):
- """
- The action to perform for a packet matching the rule.
- """
-
- ALLOW = 'allow'
- DENY = 'deny'
-
-
- class DirectionEnum(str, Enum):
- """
- The direction of traffic to match.
- """
-
- INBOUND = 'inbound'
- OUTBOUND = 'outbound'
-
-
- class IpVersionEnum(str, Enum):
- """
- The IP version for this rule.
- """
-
- IPV4 = 'ipv4'
-
-
- class ProtocolEnum(str, Enum):
+ class TypeEnum(str, Enum):
"""
- The protocol to enforce.
+ The type for this profile field.
"""
- ALL = 'all'
+ RANGE = 'range'
-class NetworkACLRuleNetworkACLRuleProtocolICMP(NetworkACLRule):
+class InstanceProfileNetworkInterfaceCountDependent(InstanceProfileNetworkInterfaceCount):
"""
- NetworkACLRuleNetworkACLRuleProtocolICMP.
+ The number of network interfaces supported on an instance with this profile is
+ dependent on its configuration.
- :attr str action: The action to perform for a packet matching the rule.
- :attr NetworkACLRuleReference before: (optional) The rule that this rule is
- immediately before. If absent, this is the last rule.
- :attr datetime created_at: The date and time that the rule was created.
- :attr str destination: The destination IP address or CIDR block to match. The
- CIDR block `0.0.0.0/0` matches all destination addresses.
- :attr str direction: The direction of traffic to match.
- :attr str href: The URL for this network ACL rule.
- :attr str id: The unique identifier for this network ACL rule.
- :attr str ip_version: The IP version for this rule.
- :attr str name: The name for this network ACL rule. The name is unique across
- all rules for the network ACL.
- :attr str source: The source IP address or CIDR block to match. The CIDR block
- `0.0.0.0/0` matches all source addresses.
- :attr int code: (optional) The ICMP traffic code to match.
- If absent, all codes are matched.
- :attr str protocol: The protocol to enforce.
- :attr int type: (optional) The ICMP traffic type to match.
- If absent, all types are matched.
+ :param str type: The type for this profile field.
"""
def __init__(
self,
- action: str,
- created_at: datetime,
- destination: str,
- direction: str,
- href: str,
- id: str,
- ip_version: str,
- name: str,
- source: str,
- protocol: str,
- *,
- before: 'NetworkACLRuleReference' = None,
- code: int = None,
- type: int = None,
+ type: str,
) -> None:
"""
- Initialize a NetworkACLRuleNetworkACLRuleProtocolICMP object.
+ Initialize a InstanceProfileNetworkInterfaceCountDependent object.
- :param str action: The action to perform for a packet matching the rule.
- :param datetime created_at: The date and time that the rule was created.
- :param str destination: The destination IP address or CIDR block to match.
- The CIDR block `0.0.0.0/0` matches all destination addresses.
- :param str direction: The direction of traffic to match.
- :param str href: The URL for this network ACL rule.
- :param str id: The unique identifier for this network ACL rule.
- :param str ip_version: The IP version for this rule.
- :param str name: The name for this network ACL rule. The name is unique
- across all rules for the network ACL.
- :param str source: The source IP address or CIDR block to match. The CIDR
- block `0.0.0.0/0` matches all source addresses.
- :param str protocol: The protocol to enforce.
- :param NetworkACLRuleReference before: (optional) The rule that this rule
- is immediately before. If absent, this is the last rule.
- :param int code: (optional) The ICMP traffic code to match.
- If absent, all codes are matched.
- :param int type: (optional) The ICMP traffic type to match.
- If absent, all types are matched.
+ :param str type: The type for this profile field.
"""
# pylint: disable=super-init-not-called
- self.action = action
- self.before = before
- self.created_at = created_at
- self.destination = destination
- self.direction = direction
- self.href = href
- self.id = id
- self.ip_version = ip_version
- self.name = name
- self.source = source
- self.code = code
- self.protocol = protocol
self.type = type
@classmethod
- def from_dict(cls, _dict: Dict) -> 'NetworkACLRuleNetworkACLRuleProtocolICMP':
- """Initialize a NetworkACLRuleNetworkACLRuleProtocolICMP object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceProfileNetworkInterfaceCountDependent':
+ """Initialize a InstanceProfileNetworkInterfaceCountDependent object from a json dictionary."""
args = {}
- if 'action' in _dict:
- args['action'] = _dict.get('action')
- else:
- raise ValueError('Required property \'action\' not present in NetworkACLRuleNetworkACLRuleProtocolICMP JSON')
- if 'before' in _dict:
- args['before'] = NetworkACLRuleReference.from_dict(_dict.get('before'))
- if 'created_at' in _dict:
- args['created_at'] = string_to_datetime(_dict.get('created_at'))
- else:
- raise ValueError('Required property \'created_at\' not present in NetworkACLRuleNetworkACLRuleProtocolICMP JSON')
- if 'destination' in _dict:
- args['destination'] = _dict.get('destination')
- else:
- raise ValueError('Required property \'destination\' not present in NetworkACLRuleNetworkACLRuleProtocolICMP JSON')
- if 'direction' in _dict:
- args['direction'] = _dict.get('direction')
- else:
- raise ValueError('Required property \'direction\' not present in NetworkACLRuleNetworkACLRuleProtocolICMP JSON')
- if 'href' in _dict:
- args['href'] = _dict.get('href')
- else:
- raise ValueError('Required property \'href\' not present in NetworkACLRuleNetworkACLRuleProtocolICMP JSON')
- if 'id' in _dict:
- args['id'] = _dict.get('id')
- else:
- raise ValueError('Required property \'id\' not present in NetworkACLRuleNetworkACLRuleProtocolICMP JSON')
- if 'ip_version' in _dict:
- args['ip_version'] = _dict.get('ip_version')
- else:
- raise ValueError('Required property \'ip_version\' not present in NetworkACLRuleNetworkACLRuleProtocolICMP JSON')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
- else:
- raise ValueError('Required property \'name\' not present in NetworkACLRuleNetworkACLRuleProtocolICMP JSON')
- if 'source' in _dict:
- args['source'] = _dict.get('source')
- else:
- raise ValueError('Required property \'source\' not present in NetworkACLRuleNetworkACLRuleProtocolICMP JSON')
- if 'code' in _dict:
- args['code'] = _dict.get('code')
- if 'protocol' in _dict:
- args['protocol'] = _dict.get('protocol')
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
else:
- raise ValueError('Required property \'protocol\' not present in NetworkACLRuleNetworkACLRuleProtocolICMP JSON')
- if 'type' in _dict:
- args['type'] = _dict.get('type')
+ raise ValueError('Required property \'type\' not present in InstanceProfileNetworkInterfaceCountDependent JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a NetworkACLRuleNetworkACLRuleProtocolICMP object from a json dictionary."""
+ """Initialize a InstanceProfileNetworkInterfaceCountDependent object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'action') and self.action is not None:
- _dict['action'] = self.action
- if hasattr(self, 'before') and self.before is not None:
- if isinstance(self.before, dict):
- _dict['before'] = self.before
- else:
- _dict['before'] = self.before.to_dict()
- if hasattr(self, 'created_at') and self.created_at is not None:
- _dict['created_at'] = datetime_to_string(self.created_at)
- if hasattr(self, 'destination') and self.destination is not None:
- _dict['destination'] = self.destination
- if hasattr(self, 'direction') and self.direction is not None:
- _dict['direction'] = self.direction
- if hasattr(self, 'href') and self.href is not None:
- _dict['href'] = self.href
- if hasattr(self, 'id') and self.id is not None:
- _dict['id'] = self.id
- if hasattr(self, 'ip_version') and self.ip_version is not None:
- _dict['ip_version'] = self.ip_version
- if hasattr(self, 'name') and self.name is not None:
- _dict['name'] = self.name
- if hasattr(self, 'source') and self.source is not None:
- _dict['source'] = self.source
- if hasattr(self, 'code') and self.code is not None:
- _dict['code'] = self.code
- if hasattr(self, 'protocol') and self.protocol is not None:
- _dict['protocol'] = self.protocol
if hasattr(self, 'type') and self.type is not None:
_dict['type'] = self.type
return _dict
@@ -110213,251 +113420,84 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this NetworkACLRuleNetworkACLRuleProtocolICMP object."""
+ """Return a `str` version of this InstanceProfileNetworkInterfaceCountDependent object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'NetworkACLRuleNetworkACLRuleProtocolICMP') -> bool:
+ def __eq__(self, other: 'InstanceProfileNetworkInterfaceCountDependent') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'NetworkACLRuleNetworkACLRuleProtocolICMP') -> bool:
+ def __ne__(self, other: 'InstanceProfileNetworkInterfaceCountDependent') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class ActionEnum(str, Enum):
+ class TypeEnum(str, Enum):
"""
- The action to perform for a packet matching the rule.
+ The type for this profile field.
"""
- ALLOW = 'allow'
- DENY = 'deny'
-
-
- class DirectionEnum(str, Enum):
- """
- The direction of traffic to match.
- """
-
- INBOUND = 'inbound'
- OUTBOUND = 'outbound'
-
-
- class IpVersionEnum(str, Enum):
- """
- The IP version for this rule.
- """
-
- IPV4 = 'ipv4'
-
-
- class ProtocolEnum(str, Enum):
- """
- The protocol to enforce.
- """
-
- ICMP = 'icmp'
+ DEPENDENT = 'dependent'
-class NetworkACLRuleNetworkACLRuleProtocolTCPUDP(NetworkACLRule):
+class InstanceProfileNetworkInterfaceCountRange(InstanceProfileNetworkInterfaceCount):
"""
- NetworkACLRuleNetworkACLRuleProtocolTCPUDP.
+ The number of network interfaces supported on an instance with this profile.
- :attr str action: The action to perform for a packet matching the rule.
- :attr NetworkACLRuleReference before: (optional) The rule that this rule is
- immediately before. If absent, this is the last rule.
- :attr datetime created_at: The date and time that the rule was created.
- :attr str destination: The destination IP address or CIDR block to match. The
- CIDR block `0.0.0.0/0` matches all destination addresses.
- :attr str direction: The direction of traffic to match.
- :attr str href: The URL for this network ACL rule.
- :attr str id: The unique identifier for this network ACL rule.
- :attr str ip_version: The IP version for this rule.
- :attr str name: The name for this network ACL rule. The name is unique across
- all rules for the network ACL.
- :attr str source: The source IP address or CIDR block to match. The CIDR block
- `0.0.0.0/0` matches all source addresses.
- :attr int destination_port_max: The inclusive upper bound of TCP/UDP destination
- port range.
- :attr int destination_port_min: The inclusive lower bound of TCP/UDP destination
- port range.
- :attr str protocol: The protocol to enforce.
- :attr int source_port_max: The inclusive upper bound of TCP/UDP source port
- range.
- :attr int source_port_min: The inclusive lower bound of TCP/UDP source port
- range.
+ :param int max: (optional) The maximum value for this profile field.
+ :param int min: (optional) The minimum value for this profile field.
+ :param str type: The type for this profile field.
"""
def __init__(
self,
- action: str,
- created_at: datetime,
- destination: str,
- direction: str,
- href: str,
- id: str,
- ip_version: str,
- name: str,
- source: str,
- destination_port_max: int,
- destination_port_min: int,
- protocol: str,
- source_port_max: int,
- source_port_min: int,
+ type: str,
*,
- before: 'NetworkACLRuleReference' = None,
+ max: Optional[int] = None,
+ min: Optional[int] = None,
) -> None:
"""
- Initialize a NetworkACLRuleNetworkACLRuleProtocolTCPUDP object.
+ Initialize a InstanceProfileNetworkInterfaceCountRange object.
- :param str action: The action to perform for a packet matching the rule.
- :param datetime created_at: The date and time that the rule was created.
- :param str destination: The destination IP address or CIDR block to match.
- The CIDR block `0.0.0.0/0` matches all destination addresses.
- :param str direction: The direction of traffic to match.
- :param str href: The URL for this network ACL rule.
- :param str id: The unique identifier for this network ACL rule.
- :param str ip_version: The IP version for this rule.
- :param str name: The name for this network ACL rule. The name is unique
- across all rules for the network ACL.
- :param str source: The source IP address or CIDR block to match. The CIDR
- block `0.0.0.0/0` matches all source addresses.
- :param int destination_port_max: The inclusive upper bound of TCP/UDP
- destination port range.
- :param int destination_port_min: The inclusive lower bound of TCP/UDP
- destination port range.
- :param str protocol: The protocol to enforce.
- :param int source_port_max: The inclusive upper bound of TCP/UDP source
- port range.
- :param int source_port_min: The inclusive lower bound of TCP/UDP source
- port range.
- :param NetworkACLRuleReference before: (optional) The rule that this rule
- is immediately before. If absent, this is the last rule.
+ :param str type: The type for this profile field.
+ :param int max: (optional) The maximum value for this profile field.
+ :param int min: (optional) The minimum value for this profile field.
"""
# pylint: disable=super-init-not-called
- self.action = action
- self.before = before
- self.created_at = created_at
- self.destination = destination
- self.direction = direction
- self.href = href
- self.id = id
- self.ip_version = ip_version
- self.name = name
- self.source = source
- self.destination_port_max = destination_port_max
- self.destination_port_min = destination_port_min
- self.protocol = protocol
- self.source_port_max = source_port_max
- self.source_port_min = source_port_min
+ self.max = max
+ self.min = min
+ self.type = type
@classmethod
- def from_dict(cls, _dict: Dict) -> 'NetworkACLRuleNetworkACLRuleProtocolTCPUDP':
- """Initialize a NetworkACLRuleNetworkACLRuleProtocolTCPUDP object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceProfileNetworkInterfaceCountRange':
+ """Initialize a InstanceProfileNetworkInterfaceCountRange object from a json dictionary."""
args = {}
- if 'action' in _dict:
- args['action'] = _dict.get('action')
- else:
- raise ValueError('Required property \'action\' not present in NetworkACLRuleNetworkACLRuleProtocolTCPUDP JSON')
- if 'before' in _dict:
- args['before'] = NetworkACLRuleReference.from_dict(_dict.get('before'))
- if 'created_at' in _dict:
- args['created_at'] = string_to_datetime(_dict.get('created_at'))
- else:
- raise ValueError('Required property \'created_at\' not present in NetworkACLRuleNetworkACLRuleProtocolTCPUDP JSON')
- if 'destination' in _dict:
- args['destination'] = _dict.get('destination')
- else:
- raise ValueError('Required property \'destination\' not present in NetworkACLRuleNetworkACLRuleProtocolTCPUDP JSON')
- if 'direction' in _dict:
- args['direction'] = _dict.get('direction')
- else:
- raise ValueError('Required property \'direction\' not present in NetworkACLRuleNetworkACLRuleProtocolTCPUDP JSON')
- if 'href' in _dict:
- args['href'] = _dict.get('href')
- else:
- raise ValueError('Required property \'href\' not present in NetworkACLRuleNetworkACLRuleProtocolTCPUDP JSON')
- if 'id' in _dict:
- args['id'] = _dict.get('id')
- else:
- raise ValueError('Required property \'id\' not present in NetworkACLRuleNetworkACLRuleProtocolTCPUDP JSON')
- if 'ip_version' in _dict:
- args['ip_version'] = _dict.get('ip_version')
- else:
- raise ValueError('Required property \'ip_version\' not present in NetworkACLRuleNetworkACLRuleProtocolTCPUDP JSON')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
- else:
- raise ValueError('Required property \'name\' not present in NetworkACLRuleNetworkACLRuleProtocolTCPUDP JSON')
- if 'source' in _dict:
- args['source'] = _dict.get('source')
- else:
- raise ValueError('Required property \'source\' not present in NetworkACLRuleNetworkACLRuleProtocolTCPUDP JSON')
- if 'destination_port_max' in _dict:
- args['destination_port_max'] = _dict.get('destination_port_max')
- else:
- raise ValueError('Required property \'destination_port_max\' not present in NetworkACLRuleNetworkACLRuleProtocolTCPUDP JSON')
- if 'destination_port_min' in _dict:
- args['destination_port_min'] = _dict.get('destination_port_min')
- else:
- raise ValueError('Required property \'destination_port_min\' not present in NetworkACLRuleNetworkACLRuleProtocolTCPUDP JSON')
- if 'protocol' in _dict:
- args['protocol'] = _dict.get('protocol')
- else:
- raise ValueError('Required property \'protocol\' not present in NetworkACLRuleNetworkACLRuleProtocolTCPUDP JSON')
- if 'source_port_max' in _dict:
- args['source_port_max'] = _dict.get('source_port_max')
- else:
- raise ValueError('Required property \'source_port_max\' not present in NetworkACLRuleNetworkACLRuleProtocolTCPUDP JSON')
- if 'source_port_min' in _dict:
- args['source_port_min'] = _dict.get('source_port_min')
+ if (max := _dict.get('max')) is not None:
+ args['max'] = max
+ if (min := _dict.get('min')) is not None:
+ args['min'] = min
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
else:
- raise ValueError('Required property \'source_port_min\' not present in NetworkACLRuleNetworkACLRuleProtocolTCPUDP JSON')
+ raise ValueError('Required property \'type\' not present in InstanceProfileNetworkInterfaceCountRange JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a NetworkACLRuleNetworkACLRuleProtocolTCPUDP object from a json dictionary."""
+ """Initialize a InstanceProfileNetworkInterfaceCountRange object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'action') and self.action is not None:
- _dict['action'] = self.action
- if hasattr(self, 'before') and self.before is not None:
- if isinstance(self.before, dict):
- _dict['before'] = self.before
- else:
- _dict['before'] = self.before.to_dict()
- if hasattr(self, 'created_at') and self.created_at is not None:
- _dict['created_at'] = datetime_to_string(self.created_at)
- if hasattr(self, 'destination') and self.destination is not None:
- _dict['destination'] = self.destination
- if hasattr(self, 'direction') and self.direction is not None:
- _dict['direction'] = self.direction
- if hasattr(self, 'href') and self.href is not None:
- _dict['href'] = self.href
- if hasattr(self, 'id') and self.id is not None:
- _dict['id'] = self.id
- if hasattr(self, 'ip_version') and self.ip_version is not None:
- _dict['ip_version'] = self.ip_version
- if hasattr(self, 'name') and self.name is not None:
- _dict['name'] = self.name
- if hasattr(self, 'source') and self.source is not None:
- _dict['source'] = self.source
- if hasattr(self, 'destination_port_max') and self.destination_port_max is not None:
- _dict['destination_port_max'] = self.destination_port_max
- if hasattr(self, 'destination_port_min') and self.destination_port_min is not None:
- _dict['destination_port_min'] = self.destination_port_min
- if hasattr(self, 'protocol') and self.protocol is not None:
- _dict['protocol'] = self.protocol
- if hasattr(self, 'source_port_max') and self.source_port_max is not None:
- _dict['source_port_max'] = self.source_port_max
- if hasattr(self, 'source_port_min') and self.source_port_min is not None:
- _dict['source_port_min'] = self.source_port_min
+ if hasattr(self, 'max') and self.max is not None:
+ _dict['max'] = self.max
+ if hasattr(self, 'min') and self.min is not None:
+ _dict['min'] = self.min
+ if hasattr(self, 'type') and self.type is not None:
+ _dict['type'] = self.type
return _dict
def _to_dict(self):
@@ -110465,145 +113505,68 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this NetworkACLRuleNetworkACLRuleProtocolTCPUDP object."""
+ """Return a `str` version of this InstanceProfileNetworkInterfaceCountRange object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'NetworkACLRuleNetworkACLRuleProtocolTCPUDP') -> bool:
+ def __eq__(self, other: 'InstanceProfileNetworkInterfaceCountRange') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'NetworkACLRuleNetworkACLRuleProtocolTCPUDP') -> bool:
+ def __ne__(self, other: 'InstanceProfileNetworkInterfaceCountRange') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class ActionEnum(str, Enum):
- """
- The action to perform for a packet matching the rule.
- """
-
- ALLOW = 'allow'
- DENY = 'deny'
-
-
- class DirectionEnum(str, Enum):
- """
- The direction of traffic to match.
- """
-
- INBOUND = 'inbound'
- OUTBOUND = 'outbound'
-
-
- class IpVersionEnum(str, Enum):
- """
- The IP version for this rule.
- """
-
- IPV4 = 'ipv4'
-
-
- class ProtocolEnum(str, Enum):
+ class TypeEnum(str, Enum):
"""
- The protocol to enforce.
+ The type for this profile field.
"""
- TCP = 'tcp'
- UDP = 'udp'
-
-
-
-class NetworkInterfaceIPPrototypeReservedIPIdentity(NetworkInterfaceIPPrototype):
- """
- Identifies a reserved IP by a unique property.
-
- """
-
- def __init__(
- self,
- ) -> None:
- """
- Initialize a NetworkInterfaceIPPrototypeReservedIPIdentity object.
+ RANGE = 'range'
- """
- # pylint: disable=super-init-not-called
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['NetworkInterfaceIPPrototypeReservedIPIdentityById', 'NetworkInterfaceIPPrototypeReservedIPIdentityByHref'])
- )
- raise Exception(msg)
-class NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext(NetworkInterfaceIPPrototype):
+class InstanceProfilePortSpeedDependent(InstanceProfilePortSpeed):
"""
- NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext.
+ The port speed of each network interface of an instance with this profile depends on
+ its configuration.
- :attr str address: (optional) The IP address to reserve, which must not already
- be reserved on the subnet.
- If unspecified, an available address on the subnet will automatically be
- selected.
- :attr bool auto_delete: (optional) Indicates whether this reserved IP member
- will be automatically deleted when either
- `target` is deleted, or the reserved IP is unbound.
- :attr str name: (optional) The name for this reserved IP. The name must not be
- used by another reserved IP in the subnet. Names starting with `ibm-` are
- reserved for provider-owned resources, and are not allowed. If unspecified, the
- name will be a hyphenated list of randomly-selected words.
+ :param str type: The type for this profile field.
"""
def __init__(
self,
- *,
- address: str = None,
- auto_delete: bool = None,
- name: str = None,
+ type: str,
) -> None:
"""
- Initialize a NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext object.
+ Initialize a InstanceProfilePortSpeedDependent object.
- :param str address: (optional) The IP address to reserve, which must not
- already be reserved on the subnet.
- If unspecified, an available address on the subnet will automatically be
- selected.
- :param bool auto_delete: (optional) Indicates whether this reserved IP
- member will be automatically deleted when either
- `target` is deleted, or the reserved IP is unbound.
- :param str name: (optional) The name for this reserved IP. The name must
- not be used by another reserved IP in the subnet. Names starting with
- `ibm-` are reserved for provider-owned resources, and are not allowed. If
- unspecified, the name will be a hyphenated list of randomly-selected words.
+ :param str type: The type for this profile field.
"""
# pylint: disable=super-init-not-called
- self.address = address
- self.auto_delete = auto_delete
- self.name = name
+ self.type = type
@classmethod
- def from_dict(cls, _dict: Dict) -> 'NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext':
- """Initialize a NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceProfilePortSpeedDependent':
+ """Initialize a InstanceProfilePortSpeedDependent object from a json dictionary."""
args = {}
- if 'address' in _dict:
- args['address'] = _dict.get('address')
- if 'auto_delete' in _dict:
- args['auto_delete'] = _dict.get('auto_delete')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
+ else:
+ raise ValueError('Required property \'type\' not present in InstanceProfilePortSpeedDependent JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext object from a json dictionary."""
+ """Initialize a InstanceProfilePortSpeedDependent object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'address') and self.address is not None:
- _dict['address'] = self.address
- if hasattr(self, 'auto_delete') and self.auto_delete is not None:
- _dict['auto_delete'] = self.auto_delete
- if hasattr(self, 'name') and self.name is not None:
- _dict['name'] = self.name
+ if hasattr(self, 'type') and self.type is not None:
+ _dict['type'] = self.type
return _dict
def _to_dict(self):
@@ -110611,59 +113574,78 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext object."""
+ """Return a `str` version of this InstanceProfilePortSpeedDependent object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext') -> bool:
+ def __eq__(self, other: 'InstanceProfilePortSpeedDependent') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext') -> bool:
+ def __ne__(self, other: 'InstanceProfilePortSpeedDependent') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
+ class TypeEnum(str, Enum):
+ """
+ The type for this profile field.
+ """
+
+ DEPENDENT = 'dependent'
-class OperatingSystemIdentityByHref(OperatingSystemIdentity):
+
+
+class InstanceProfilePortSpeedFixed(InstanceProfilePortSpeed):
"""
- OperatingSystemIdentityByHref.
+ The maximum speed (in megabits per second) of each network interface of an instance
+ with this profile.
- :attr str href: The URL for this operating system.
+ :param str type: The type for this profile field.
+ :param int value: The value for this profile field.
"""
def __init__(
self,
- href: str,
+ type: str,
+ value: int,
) -> None:
"""
- Initialize a OperatingSystemIdentityByHref object.
+ Initialize a InstanceProfilePortSpeedFixed object.
- :param str href: The URL for this operating system.
+ :param str type: The type for this profile field.
+ :param int value: The value for this profile field.
"""
# pylint: disable=super-init-not-called
- self.href = href
+ self.type = type
+ self.value = value
@classmethod
- def from_dict(cls, _dict: Dict) -> 'OperatingSystemIdentityByHref':
- """Initialize a OperatingSystemIdentityByHref object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceProfilePortSpeedFixed':
+ """Initialize a InstanceProfilePortSpeedFixed object from a json dictionary."""
args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
else:
- raise ValueError('Required property \'href\' not present in OperatingSystemIdentityByHref JSON')
+ raise ValueError('Required property \'type\' not present in InstanceProfilePortSpeedFixed JSON')
+ if (value := _dict.get('value')) is not None:
+ args['value'] = value
+ else:
+ raise ValueError('Required property \'value\' not present in InstanceProfilePortSpeedFixed JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a OperatingSystemIdentityByHref object from a json dictionary."""
+ """Initialize a InstanceProfilePortSpeedFixed object from 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
+ if hasattr(self, 'value') and self.value is not None:
+ _dict['value'] = self.value
return _dict
def _to_dict(self):
@@ -110671,59 +113653,67 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this OperatingSystemIdentityByHref object."""
+ """Return a `str` version of this InstanceProfilePortSpeedFixed object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'OperatingSystemIdentityByHref') -> bool:
+ def __eq__(self, other: 'InstanceProfilePortSpeedFixed') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'OperatingSystemIdentityByHref') -> bool:
+ def __ne__(self, other: 'InstanceProfilePortSpeedFixed') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
+ class TypeEnum(str, Enum):
+ """
+ The type for this profile field.
+ """
-class OperatingSystemIdentityByName(OperatingSystemIdentity):
+ FIXED = 'fixed'
+
+
+
+class InstanceProfileVCPUDependent(InstanceProfileVCPU):
"""
- OperatingSystemIdentityByName.
+ The VCPU count for an instance with this profile depends on its configuration.
- :attr str name: The globally unique name for this operating system.
+ :param str type: The type for this profile field.
"""
def __init__(
self,
- name: str,
+ type: str,
) -> None:
"""
- Initialize a OperatingSystemIdentityByName object.
+ Initialize a InstanceProfileVCPUDependent object.
- :param str name: The globally unique name for this operating system.
+ :param str type: The type for this profile field.
"""
# pylint: disable=super-init-not-called
- self.name = name
+ self.type = type
@classmethod
- def from_dict(cls, _dict: Dict) -> 'OperatingSystemIdentityByName':
- """Initialize a OperatingSystemIdentityByName object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceProfileVCPUDependent':
+ """Initialize a InstanceProfileVCPUDependent object from a json dictionary."""
args = {}
- if 'name' in _dict:
- args['name'] = _dict.get('name')
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
else:
- raise ValueError('Required property \'name\' not present in OperatingSystemIdentityByName JSON')
+ raise ValueError('Required property \'type\' not present in InstanceProfileVCPUDependent JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a OperatingSystemIdentityByName object from a json dictionary."""
+ """Initialize a InstanceProfileVCPUDependent object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'name') and self.name is not None:
- _dict['name'] = self.name
+ if hasattr(self, 'type') and self.type is not None:
+ _dict['type'] = self.type
return _dict
def _to_dict(self):
@@ -110731,99 +113721,87 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this OperatingSystemIdentityByName object."""
+ """Return a `str` version of this InstanceProfileVCPUDependent object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'OperatingSystemIdentityByName') -> bool:
+ def __eq__(self, other: 'InstanceProfileVCPUDependent') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'OperatingSystemIdentityByName') -> bool:
+ def __ne__(self, other: 'InstanceProfileVCPUDependent') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-
-class PublicGatewayFloatingIPPrototypeFloatingIPIdentity(PublicGatewayFloatingIPPrototype):
- """
- Identifies a floating IP by a unique property.
-
- """
-
- def __init__(
- self,
- ) -> None:
+ class TypeEnum(str, Enum):
"""
- Initialize a PublicGatewayFloatingIPPrototypeFloatingIPIdentity object.
-
+ The type for this profile field.
"""
- # pylint: disable=super-init-not-called
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityById', 'PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByCRN', 'PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByHref', 'PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByAddress'])
- )
- raise Exception(msg)
+ DEPENDENT = 'dependent'
-class PublicGatewayFloatingIPPrototypeFloatingIPPrototypeTargetContext(PublicGatewayFloatingIPPrototype):
+
+
+class InstanceProfileVCPUEnum(InstanceProfileVCPU):
"""
- PublicGatewayFloatingIPPrototypeFloatingIPPrototypeTargetContext.
+ The permitted values for VCPU count for an instance with this profile.
- :attr str name: (optional) The name for this floating IP. The name must not be
- used by another floating IP in the region. If unspecified, the name will be a
- hyphenated list of randomly-selected words.
- :attr ResourceGroupIdentity resource_group: (optional) The resource group to
- use. If unspecified, the account's [default resource
- group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be
- used.
+ :param int default: The default value for this profile field.
+ :param str type: The type for this profile field.
+ :param List[int] values: The permitted values for this profile field.
"""
def __init__(
self,
- *,
- name: str = None,
- resource_group: 'ResourceGroupIdentity' = None,
+ default: int,
+ type: str,
+ values: List[int],
) -> None:
"""
- Initialize a PublicGatewayFloatingIPPrototypeFloatingIPPrototypeTargetContext object.
+ Initialize a InstanceProfileVCPUEnum object.
- :param str name: (optional) The name for this floating IP. The name must
- not be used by another floating IP in the region. If unspecified, the name
- will be a hyphenated list of randomly-selected words.
- :param ResourceGroupIdentity resource_group: (optional) The resource group
- to use. If unspecified, the account's [default resource
- group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be
- used.
+ :param int default: The default value for this profile field.
+ :param str type: The type for this profile field.
+ :param List[int] values: The permitted values for this profile field.
"""
# pylint: disable=super-init-not-called
- self.name = name
- self.resource_group = resource_group
+ self.default = default
+ self.type = type
+ self.values = values
@classmethod
- def from_dict(cls, _dict: Dict) -> 'PublicGatewayFloatingIPPrototypeFloatingIPPrototypeTargetContext':
- """Initialize a PublicGatewayFloatingIPPrototypeFloatingIPPrototypeTargetContext object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceProfileVCPUEnum':
+ """Initialize a InstanceProfileVCPUEnum 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 (default := _dict.get('default')) is not None:
+ args['default'] = default
+ else:
+ raise ValueError('Required property \'default\' not present in InstanceProfileVCPUEnum JSON')
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
+ else:
+ raise ValueError('Required property \'type\' not present in InstanceProfileVCPUEnum JSON')
+ if (values := _dict.get('values')) is not None:
+ args['values'] = values
+ else:
+ raise ValueError('Required property \'values\' not present in InstanceProfileVCPUEnum JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a PublicGatewayFloatingIPPrototypeFloatingIPPrototypeTargetContext object from a json dictionary."""
+ """Initialize a InstanceProfileVCPUEnum object from 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, '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):
@@ -110831,59 +113809,77 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this PublicGatewayFloatingIPPrototypeFloatingIPPrototypeTargetContext object."""
+ """Return a `str` version of this InstanceProfileVCPUEnum object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'PublicGatewayFloatingIPPrototypeFloatingIPPrototypeTargetContext') -> bool:
+ def __eq__(self, other: 'InstanceProfileVCPUEnum') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'PublicGatewayFloatingIPPrototypeFloatingIPPrototypeTargetContext') -> bool:
+ def __ne__(self, other: 'InstanceProfileVCPUEnum') -> 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 PublicGatewayIdentityPublicGatewayIdentityByCRN(PublicGatewayIdentity):
+
+
+class InstanceProfileVCPUFixed(InstanceProfileVCPU):
"""
- PublicGatewayIdentityPublicGatewayIdentityByCRN.
+ The VCPU count for an instance with this profile.
- :attr str crn: The CRN for this public gateway.
+ :param str type: The type for this profile field.
+ :param int value: The value for this profile field.
"""
def __init__(
self,
- crn: str,
+ type: str,
+ value: int,
) -> None:
"""
- Initialize a PublicGatewayIdentityPublicGatewayIdentityByCRN object.
+ Initialize a InstanceProfileVCPUFixed object.
- :param str crn: The CRN for this public gateway.
+ :param str type: The type for this profile field.
+ :param int value: The value for this profile field.
"""
# pylint: disable=super-init-not-called
- self.crn = crn
+ self.type = type
+ self.value = value
@classmethod
- def from_dict(cls, _dict: Dict) -> 'PublicGatewayIdentityPublicGatewayIdentityByCRN':
- """Initialize a PublicGatewayIdentityPublicGatewayIdentityByCRN object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceProfileVCPUFixed':
+ """Initialize a InstanceProfileVCPUFixed object from a json dictionary."""
args = {}
- if 'crn' in _dict:
- args['crn'] = _dict.get('crn')
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
else:
- raise ValueError('Required property \'crn\' not present in PublicGatewayIdentityPublicGatewayIdentityByCRN JSON')
+ raise ValueError('Required property \'type\' not present in InstanceProfileVCPUFixed JSON')
+ if (value := _dict.get('value')) is not None:
+ args['value'] = value
+ else:
+ raise ValueError('Required property \'value\' not present in InstanceProfileVCPUFixed JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a PublicGatewayIdentityPublicGatewayIdentityByCRN object from a json dictionary."""
+ """Initialize a InstanceProfileVCPUFixed object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'crn') and self.crn is not None:
- _dict['crn'] = self.crn
+ if hasattr(self, 'type') and self.type is not None:
+ _dict['type'] = self.type
+ if hasattr(self, 'value') and self.value is not None:
+ _dict['value'] = self.value
return _dict
def _to_dict(self):
@@ -110891,59 +113887,107 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this PublicGatewayIdentityPublicGatewayIdentityByCRN object."""
+ """Return a `str` version of this InstanceProfileVCPUFixed object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'PublicGatewayIdentityPublicGatewayIdentityByCRN') -> bool:
+ def __eq__(self, other: 'InstanceProfileVCPUFixed') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'PublicGatewayIdentityPublicGatewayIdentityByCRN') -> bool:
+ def __ne__(self, other: 'InstanceProfileVCPUFixed') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
+ class TypeEnum(str, Enum):
+ """
+ The type for this profile field.
+ """
-class PublicGatewayIdentityPublicGatewayIdentityByHref(PublicGatewayIdentity):
+ FIXED = 'fixed'
+
+
+
+class InstanceProfileVCPURange(InstanceProfileVCPU):
"""
- PublicGatewayIdentityPublicGatewayIdentityByHref.
+ The permitted range for VCPU count for an instance with this profile.
- :attr str href: The URL for this public gateway.
+ :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.
"""
def __init__(
self,
- href: str,
- ) -> None:
+ default: int,
+ max: int,
+ min: int,
+ step: int,
+ type: str,
+ ) -> None:
"""
- Initialize a PublicGatewayIdentityPublicGatewayIdentityByHref object.
+ Initialize a InstanceProfileVCPURange object.
- :param str href: The URL for this public gateway.
+ :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.href = href
+ self.default = default
+ self.max = max
+ self.min = min
+ self.step = step
+ self.type = type
@classmethod
- def from_dict(cls, _dict: Dict) -> 'PublicGatewayIdentityPublicGatewayIdentityByHref':
- """Initialize a PublicGatewayIdentityPublicGatewayIdentityByHref object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceProfileVCPURange':
+ """Initialize a InstanceProfileVCPURange object from a json dictionary."""
args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ if (default := _dict.get('default')) is not None:
+ args['default'] = default
else:
- raise ValueError('Required property \'href\' not present in PublicGatewayIdentityPublicGatewayIdentityByHref JSON')
+ raise ValueError('Required property \'default\' not present in InstanceProfileVCPURange JSON')
+ if (max := _dict.get('max')) is not None:
+ args['max'] = max
+ else:
+ raise ValueError('Required property \'max\' not present in InstanceProfileVCPURange JSON')
+ if (min := _dict.get('min')) is not None:
+ args['min'] = min
+ else:
+ raise ValueError('Required property \'min\' not present in InstanceProfileVCPURange JSON')
+ if (step := _dict.get('step')) is not None:
+ args['step'] = step
+ else:
+ raise ValueError('Required property \'step\' not present in InstanceProfileVCPURange JSON')
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
+ else:
+ raise ValueError('Required property \'type\' not present in InstanceProfileVCPURange JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a PublicGatewayIdentityPublicGatewayIdentityByHref object from a json dictionary."""
+ """Initialize a InstanceProfileVCPURange object from 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):
@@ -110951,119 +113995,68 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this PublicGatewayIdentityPublicGatewayIdentityByHref object."""
+ """Return a `str` version of this InstanceProfileVCPURange object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'PublicGatewayIdentityPublicGatewayIdentityByHref') -> bool:
+ def __eq__(self, other: 'InstanceProfileVCPURange') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'PublicGatewayIdentityPublicGatewayIdentityByHref') -> bool:
+ def __ne__(self, other: 'InstanceProfileVCPURange') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-
-class PublicGatewayIdentityPublicGatewayIdentityById(PublicGatewayIdentity):
- """
- PublicGatewayIdentityPublicGatewayIdentityById.
-
- :attr str id: The unique identifier for this public gateway.
- """
-
- def __init__(
- self,
- id: str,
- ) -> None:
+ class TypeEnum(str, Enum):
"""
- Initialize a PublicGatewayIdentityPublicGatewayIdentityById object.
-
- :param str id: The unique identifier for this public gateway.
+ The type for this profile field.
"""
- # pylint: disable=super-init-not-called
- self.id = id
-
- @classmethod
- 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 PublicGatewayIdentityPublicGatewayIdentityById JSON')
- return cls(**args)
-
- @classmethod
- def _from_dict(cls, _dict):
- """Initialize a PublicGatewayIdentityPublicGatewayIdentityById object from a json dictionary."""
- return cls.from_dict(_dict)
-
- def to_dict(self) -> Dict:
- """Return a json dictionary representing this model."""
- _dict = {}
- if hasattr(self, '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 PublicGatewayIdentityPublicGatewayIdentityById object."""
- return json.dumps(self.to_dict(), indent=2)
-
- 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__
+ RANGE = 'range'
- def __ne__(self, other: 'PublicGatewayIdentityPublicGatewayIdentityById') -> bool:
- """Return `true` when self and other are not equal, false otherwise."""
- return not self == other
-class RegionIdentityByHref(RegionIdentity):
+class InstanceProfileVolumeBandwidthDependent(InstanceProfileVolumeBandwidth):
"""
- RegionIdentityByHref.
+ The storage bandwidth shared across the storage volumes of an instance with this
+ profile depends on its configuration.
- :attr str href: The URL for this region.
+ :param str type: The type for this profile field.
"""
def __init__(
self,
- href: str,
+ type: str,
) -> None:
"""
- Initialize a RegionIdentityByHref object.
+ Initialize a InstanceProfileVolumeBandwidthDependent object.
- :param str href: The URL for this region.
+ :param str type: The type for this profile field.
"""
# pylint: disable=super-init-not-called
- self.href = href
+ self.type = type
@classmethod
- def from_dict(cls, _dict: Dict) -> 'RegionIdentityByHref':
- """Initialize a RegionIdentityByHref object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceProfileVolumeBandwidthDependent':
+ """Initialize a InstanceProfileVolumeBandwidthDependent object from a json dictionary."""
args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
else:
- raise ValueError('Required property \'href\' not present in RegionIdentityByHref JSON')
+ raise ValueError('Required property \'type\' not present in InstanceProfileVolumeBandwidthDependent JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a RegionIdentityByHref object from a json dictionary."""
+ """Initialize a InstanceProfileVolumeBandwidthDependent object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, '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):
@@ -111071,59 +114064,88 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this RegionIdentityByHref object."""
+ """Return a `str` version of this InstanceProfileVolumeBandwidthDependent object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'RegionIdentityByHref') -> bool:
+ def __eq__(self, other: 'InstanceProfileVolumeBandwidthDependent') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'RegionIdentityByHref') -> bool:
+ def __ne__(self, other: 'InstanceProfileVolumeBandwidthDependent') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
+ class TypeEnum(str, Enum):
+ """
+ The type for this profile field.
+ """
+
+ DEPENDENT = 'dependent'
+
-class RegionIdentityByName(RegionIdentity):
+
+class InstanceProfileVolumeBandwidthEnum(InstanceProfileVolumeBandwidth):
"""
- RegionIdentityByName.
+ The permitted storage bandwidth values (in megabits per second) shared across the
+ storage volumes of an instance with this profile.
- :attr str name: The globally unique name for this region.
+ :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.
"""
def __init__(
self,
- name: str,
+ default: int,
+ type: str,
+ values: List[int],
) -> None:
"""
- Initialize a RegionIdentityByName object.
+ Initialize a InstanceProfileVolumeBandwidthEnum object.
- :param str name: The globally unique name for this region.
+ :param int default: The default value for this profile field.
+ :param str type: The type for this profile field.
+ :param List[int] values: The permitted values for this profile field.
"""
# pylint: disable=super-init-not-called
- self.name = name
+ self.default = default
+ self.type = type
+ self.values = values
@classmethod
- def from_dict(cls, _dict: Dict) -> 'RegionIdentityByName':
- """Initialize a RegionIdentityByName object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceProfileVolumeBandwidthEnum':
+ """Initialize a InstanceProfileVolumeBandwidthEnum object from a json dictionary."""
args = {}
- if 'name' in _dict:
- args['name'] = _dict.get('name')
+ if (default := _dict.get('default')) is not None:
+ args['default'] = default
else:
- raise ValueError('Required property \'name\' not present in RegionIdentityByName JSON')
+ raise ValueError('Required property \'default\' not present in InstanceProfileVolumeBandwidthEnum JSON')
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
+ else:
+ raise ValueError('Required property \'type\' not present in InstanceProfileVolumeBandwidthEnum JSON')
+ if (values := _dict.get('values')) is not None:
+ args['values'] = values
+ else:
+ raise ValueError('Required property \'values\' not present in InstanceProfileVolumeBandwidthEnum JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a RegionIdentityByName object from a json dictionary."""
+ """Initialize a InstanceProfileVolumeBandwidthEnum object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, '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):
@@ -111131,129 +114153,78 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this RegionIdentityByName object."""
+ """Return a `str` version of this InstanceProfileVolumeBandwidthEnum object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'RegionIdentityByName') -> bool:
+ def __eq__(self, other: 'InstanceProfileVolumeBandwidthEnum') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'RegionIdentityByName') -> bool:
+ def __ne__(self, other: 'InstanceProfileVolumeBandwidthEnum') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-
-class ReservedIPTargetPrototypeEndpointGatewayIdentity(ReservedIPTargetPrototype):
- """
- ReservedIPTargetPrototypeEndpointGatewayIdentity.
-
- """
-
- def __init__(
- self,
- ) -> None:
+ class TypeEnum(str, Enum):
"""
- Initialize a ReservedIPTargetPrototypeEndpointGatewayIdentity object.
-
+ The type for this profile field.
"""
- # pylint: disable=super-init-not-called
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityById', 'ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByCRN', 'ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByHref'])
- )
- raise Exception(msg)
+ ENUM = 'enum'
-class ReservedIPTargetBareMetalServerNetworkInterfaceReferenceTargetContext(ReservedIPTarget):
+
+
+class InstanceProfileVolumeBandwidthFixed(InstanceProfileVolumeBandwidth):
"""
- ReservedIPTargetBareMetalServerNetworkInterfaceReferenceTargetContext.
+ The storage bandwidth (in megabits per second) shared across the storage volumes of an
+ instance with this profile.
- :attr BareMetalServerNetworkInterfaceReferenceTargetContextDeleted deleted:
- (optional) If present, this property indicates the referenced resource has been
- deleted, and provides
- some supplementary information.
- :attr str href: The URL for this bare metal server network interface.
- :attr str id: The unique identifier for this bare metal server network
- interface.
- :attr str name: The name for this bare metal server network interface.
- :attr str resource_type: The resource type.
+ :param str type: The type for this profile field.
+ :param int value: The value for this profile field.
"""
def __init__(
self,
- href: str,
- id: str,
- name: str,
- resource_type: str,
- *,
- deleted: 'BareMetalServerNetworkInterfaceReferenceTargetContextDeleted' = None,
+ type: str,
+ value: int,
) -> None:
"""
- Initialize a ReservedIPTargetBareMetalServerNetworkInterfaceReferenceTargetContext object.
+ Initialize a InstanceProfileVolumeBandwidthFixed object.
- :param str href: The URL for this bare metal server network interface.
- :param str id: The unique identifier for this bare metal server network
- interface.
- :param str name: The name for this bare metal server network interface.
- :param str resource_type: The resource type.
- :param BareMetalServerNetworkInterfaceReferenceTargetContextDeleted
- deleted: (optional) If present, this property indicates the referenced
- resource has been deleted, and provides
- some supplementary information.
+ :param str type: The type for this profile field.
+ :param int value: The value for this profile field.
"""
# pylint: disable=super-init-not-called
- self.deleted = deleted
- self.href = href
- self.id = id
- self.name = name
- self.resource_type = resource_type
+ self.type = type
+ self.value = value
@classmethod
- def from_dict(cls, _dict: Dict) -> 'ReservedIPTargetBareMetalServerNetworkInterfaceReferenceTargetContext':
- """Initialize a ReservedIPTargetBareMetalServerNetworkInterfaceReferenceTargetContext object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceProfileVolumeBandwidthFixed':
+ """Initialize a InstanceProfileVolumeBandwidthFixed object from a json dictionary."""
args = {}
- if 'deleted' in _dict:
- args['deleted'] = BareMetalServerNetworkInterfaceReferenceTargetContextDeleted.from_dict(_dict.get('deleted'))
- if 'href' in _dict:
- args['href'] = _dict.get('href')
- else:
- raise ValueError('Required property \'href\' not present in ReservedIPTargetBareMetalServerNetworkInterfaceReferenceTargetContext JSON')
- if 'id' in _dict:
- args['id'] = _dict.get('id')
- else:
- raise ValueError('Required property \'id\' not present in ReservedIPTargetBareMetalServerNetworkInterfaceReferenceTargetContext JSON')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
else:
- raise ValueError('Required property \'name\' not present in ReservedIPTargetBareMetalServerNetworkInterfaceReferenceTargetContext JSON')
- if 'resource_type' in _dict:
- args['resource_type'] = _dict.get('resource_type')
+ raise ValueError('Required property \'type\' not present in InstanceProfileVolumeBandwidthFixed JSON')
+ if (value := _dict.get('value')) is not None:
+ args['value'] = value
else:
- raise ValueError('Required property \'resource_type\' not present in ReservedIPTargetBareMetalServerNetworkInterfaceReferenceTargetContext JSON')
+ raise ValueError('Required property \'value\' not present in InstanceProfileVolumeBandwidthFixed JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a ReservedIPTargetBareMetalServerNetworkInterfaceReferenceTargetContext object from a json dictionary."""
+ """Initialize a InstanceProfileVolumeBandwidthFixed object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'deleted') and self.deleted is not None:
- if isinstance(self.deleted, dict):
- _dict['deleted'] = self.deleted
- else:
- _dict['deleted'] = self.deleted.to_dict()
- if hasattr(self, 'href') and self.href is not None:
- _dict['href'] = self.href
- if hasattr(self, 'id') and self.id is not None:
- _dict['id'] = self.id
- if hasattr(self, 'name') and self.name is not None:
- _dict['name'] = self.name
- if hasattr(self, 'resource_type') and self.resource_type is not None:
- _dict['resource_type'] = self.resource_type
+ if hasattr(self, 'type') and self.type is not None:
+ _dict['type'] = self.type
+ if hasattr(self, 'value') and self.value is not None:
+ _dict['value'] = self.value
return _dict
def _to_dict(self):
@@ -111261,125 +114232,108 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this ReservedIPTargetBareMetalServerNetworkInterfaceReferenceTargetContext object."""
+ """Return a `str` version of this InstanceProfileVolumeBandwidthFixed object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'ReservedIPTargetBareMetalServerNetworkInterfaceReferenceTargetContext') -> bool:
+ def __eq__(self, other: 'InstanceProfileVolumeBandwidthFixed') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'ReservedIPTargetBareMetalServerNetworkInterfaceReferenceTargetContext') -> bool:
+ def __ne__(self, other: 'InstanceProfileVolumeBandwidthFixed') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class ResourceTypeEnum(str, Enum):
+ class TypeEnum(str, Enum):
"""
- The resource type.
+ The type for this profile field.
"""
- NETWORK_INTERFACE = 'network_interface'
+ FIXED = 'fixed'
-class ReservedIPTargetEndpointGatewayReference(ReservedIPTarget):
+class InstanceProfileVolumeBandwidthRange(InstanceProfileVolumeBandwidth):
"""
- ReservedIPTargetEndpointGatewayReference.
+ The permitted storage bandwidth range (in megabits per second) shared across the
+ storage volumes of an instance with this profile.
- :attr str crn: The CRN for this endpoint gateway.
- :attr EndpointGatewayReferenceDeleted deleted: (optional) If present, this
- property indicates the referenced resource has been deleted, and provides
- some supplementary information.
- :attr str href: The URL for this endpoint gateway.
- :attr str id: The unique identifier for this endpoint gateway.
- :attr str name: The name for this endpoint gateway. The name is unique across
- all endpoint gateways in the VPC.
- :attr str resource_type: The resource type.
+ :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.
"""
def __init__(
self,
- crn: str,
- href: str,
- id: str,
- name: str,
- resource_type: str,
- *,
- deleted: 'EndpointGatewayReferenceDeleted' = None,
+ default: int,
+ max: int,
+ min: int,
+ step: int,
+ type: str,
) -> None:
"""
- Initialize a ReservedIPTargetEndpointGatewayReference object.
+ Initialize a InstanceProfileVolumeBandwidthRange object.
- :param str crn: The CRN for this endpoint gateway.
- :param str href: The URL for this endpoint gateway.
- :param str id: The unique identifier for this endpoint gateway.
- :param str name: The name for this endpoint gateway. The name is unique
- across all endpoint gateways in the VPC.
- :param str resource_type: The resource type.
- :param EndpointGatewayReferenceDeleted deleted: (optional) If present, this
- property indicates the referenced resource has been deleted, and provides
- some supplementary information.
+ :param int default: The default value for this profile field.
+ :param int max: The maximum value for this profile field.
+ :param int min: The minimum value for this profile field.
+ :param int step: The increment step value for this profile field.
+ :param str type: The type for this profile field.
"""
# pylint: disable=super-init-not-called
- self.crn = crn
- self.deleted = deleted
- self.href = href
- self.id = id
- self.name = name
- self.resource_type = resource_type
+ self.default = default
+ self.max = max
+ self.min = min
+ self.step = step
+ self.type = type
@classmethod
- def from_dict(cls, _dict: Dict) -> 'ReservedIPTargetEndpointGatewayReference':
- """Initialize a ReservedIPTargetEndpointGatewayReference object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceProfileVolumeBandwidthRange':
+ """Initialize a InstanceProfileVolumeBandwidthRange object from a json dictionary."""
args = {}
- if 'crn' in _dict:
- args['crn'] = _dict.get('crn')
+ if (default := _dict.get('default')) is not None:
+ args['default'] = default
else:
- raise ValueError('Required property \'crn\' not present in ReservedIPTargetEndpointGatewayReference JSON')
- if 'deleted' in _dict:
- args['deleted'] = EndpointGatewayReferenceDeleted.from_dict(_dict.get('deleted'))
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ raise ValueError('Required property \'default\' not present in InstanceProfileVolumeBandwidthRange JSON')
+ if (max := _dict.get('max')) is not None:
+ args['max'] = max
else:
- raise ValueError('Required property \'href\' not present in ReservedIPTargetEndpointGatewayReference JSON')
- if 'id' in _dict:
- args['id'] = _dict.get('id')
+ raise ValueError('Required property \'max\' not present in InstanceProfileVolumeBandwidthRange JSON')
+ if (min := _dict.get('min')) is not None:
+ args['min'] = min
else:
- raise ValueError('Required property \'id\' not present in ReservedIPTargetEndpointGatewayReference JSON')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
+ raise ValueError('Required property \'min\' not present in InstanceProfileVolumeBandwidthRange JSON')
+ if (step := _dict.get('step')) is not None:
+ args['step'] = step
else:
- raise ValueError('Required property \'name\' not present in ReservedIPTargetEndpointGatewayReference JSON')
- if 'resource_type' in _dict:
- args['resource_type'] = _dict.get('resource_type')
+ raise ValueError('Required property \'step\' not present in InstanceProfileVolumeBandwidthRange JSON')
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
else:
- raise ValueError('Required property \'resource_type\' not present in ReservedIPTargetEndpointGatewayReference JSON')
+ raise ValueError('Required property \'type\' not present in InstanceProfileVolumeBandwidthRange JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a ReservedIPTargetEndpointGatewayReference object from a json dictionary."""
+ """Initialize a InstanceProfileVolumeBandwidthRange object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'crn') and self.crn is not None:
- _dict['crn'] = self.crn
- if hasattr(self, 'deleted') and self.deleted is not None:
- if isinstance(self.deleted, dict):
- _dict['deleted'] = self.deleted
- else:
- _dict['deleted'] = self.deleted.to_dict()
- if hasattr(self, 'href') and self.href is not None:
- _dict['href'] = self.href
- if hasattr(self, 'id') and self.id is not None:
- _dict['id'] = self.id
- if hasattr(self, 'name') and self.name is not None:
- _dict['name'] = self.name
- if hasattr(self, 'resource_type') and self.resource_type is not None:
- _dict['resource_type'] = self.resource_type
+ if hasattr(self, 'default') and self.default is not None:
+ _dict['default'] = self.default
+ if hasattr(self, '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):
@@ -111387,135 +114341,12594 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this ReservedIPTargetEndpointGatewayReference object."""
+ """Return a `str` version of this InstanceProfileVolumeBandwidthRange object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'ReservedIPTargetEndpointGatewayReference') -> bool:
+ def __eq__(self, other: 'InstanceProfileVolumeBandwidthRange') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'ReservedIPTargetEndpointGatewayReference') -> bool:
+ def __ne__(self, other: 'InstanceProfileVolumeBandwidthRange') -> 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.
"""
- ENDPOINT_GATEWAY = 'endpoint_gateway'
+ RANGE = 'range'
-class ReservedIPTargetGenericResourceReference(ReservedIPTarget):
+class InstancePrototypeInstanceByCatalogOffering(InstancePrototype):
"""
- Identifying information for a resource that is not native to the VPC API.
+ Create an instance by using a catalog offering.
- :attr str crn: The CRN for the resource.
- :attr GenericResourceReferenceDeleted deleted: (optional) If present, this
- property indicates the referenced resource has been deleted, and provides
- some supplementary information.
- :attr str resource_type: The resource type.
+ :param InstanceAvailabilityPolicyPrototype availability_policy: (optional) The
+ availability policy to use for this virtual server instance.
+ :param InstanceDefaultTrustedProfilePrototype default_trusted_profile:
+ (optional) The default trusted profile configuration to use for this virtual
+ server instance
+ This property's value is used when provisioning the virtual server instance, but
+ not subsequently managed. Accordingly, it is reflected as an [instance
+ initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
+ property.
+ :param List[KeyIdentity] keys: (optional) The public SSH keys for the
+ administrative user of the virtual server instance. Keys will be made available
+ to the virtual server instance as cloud-init vendor data. For cloud-init enabled
+ images, these keys will also be added as SSH authorized keys for the
+ administrative user.
+ For Windows images, the keys of type `rsa` must be specified, and one will be
+ selected to encrypt [the administrator
+ password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys
+ are optional for other images, but if no keys are specified, the instance will
+ be inaccessible unless the specified image provides another means of access.
+ This property's value is used when provisioning the virtual server instance, but
+ not subsequently managed. Accordingly, it is reflected as an [instance
+ initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
+ property.
+ :param InstanceMetadataServicePrototype metadata_service: (optional)
+ :param str name: (optional) The name for this virtual server instance. The name
+ must not be used by another virtual server instance in the region. If
+ unspecified, the name will be a hyphenated list of randomly-selected words.
+ The system hostname will be based on this name.
+ :param InstancePlacementTargetPrototype placement_target: (optional) The
+ placement restrictions to use for the virtual server instance.
+ If specified, `reservation_affinity.policy` must be `disabled`.
+ :param InstanceProfileIdentity profile: (optional) The
+ [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this
+ virtual server instance.
+ If unspecified, `bx2-2x8` will be used, but this default value is expected to
+ change in the future.
+ :param InstanceReservationAffinityPrototype reservation_affinity: (optional)
+ :param ResourceGroupIdentity resource_group: (optional)
+ :param int total_volume_bandwidth: (optional) The amount of bandwidth (in
+ megabits per second) allocated exclusively to instance storage volumes. An
+ increase in this value will result in a corresponding decrease to
+ `total_network_bandwidth`.
+ :param str user_data: (optional) [User
+ data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when
+ setting up the virtual server instance.
+ :param List[VolumeAttachmentPrototype] volume_attachments: (optional) The
+ additional volume attachments to create for the virtual server instance.
+ :param VPCIdentity vpc: (optional) The VPC this virtual server instance will
+ reside in.
+ If specified, it must match the VPC for the subnets of the instance network
+ attachments or instance network interfaces.
+ :param VolumeAttachmentPrototypeInstanceByImageContext boot_volume_attachment:
+ (optional) The boot volume attachment to create for the virtual server instance.
+ :param InstanceCatalogOfferingPrototype catalog_offering: The
+ [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user)
+ offering
+ or offering version to use when provisioning this virtual server instance.
+ If an offering is specified, the latest version of that offering will be used.
+ The specified offering or offering version may be in a different account in the
+ same
+ [enterprise](https://cloud.ibm.com/docs/account?topic=account-what-is-enterprise),
+ subject
+ to IAM policies.
+ :param ZoneIdentity zone: The zone this virtual server instance will reside in.
"""
def __init__(
self,
- crn: str,
- resource_type: str,
+ catalog_offering: 'InstanceCatalogOfferingPrototype',
+ zone: 'ZoneIdentity',
*,
- deleted: 'GenericResourceReferenceDeleted' = None,
+ availability_policy: Optional['InstanceAvailabilityPolicyPrototype'] = None,
+ default_trusted_profile: Optional['InstanceDefaultTrustedProfilePrototype'] = None,
+ keys: Optional[List['KeyIdentity']] = None,
+ metadata_service: Optional['InstanceMetadataServicePrototype'] = None,
+ name: Optional[str] = None,
+ placement_target: Optional['InstancePlacementTargetPrototype'] = None,
+ profile: Optional['InstanceProfileIdentity'] = None,
+ reservation_affinity: Optional['InstanceReservationAffinityPrototype'] = None,
+ resource_group: Optional['ResourceGroupIdentity'] = None,
+ total_volume_bandwidth: Optional[int] = None,
+ user_data: Optional[str] = None,
+ volume_attachments: Optional[List['VolumeAttachmentPrototype']] = None,
+ vpc: Optional['VPCIdentity'] = None,
+ boot_volume_attachment: Optional['VolumeAttachmentPrototypeInstanceByImageContext'] = None,
) -> None:
"""
- Initialize a ReservedIPTargetGenericResourceReference object.
-
- :param str crn: The CRN for the resource.
- :param str resource_type: The resource type.
- :param GenericResourceReferenceDeleted deleted: (optional) If present, this
- property indicates the referenced resource has been deleted, and provides
- some supplementary information.
- """
- # pylint: disable=super-init-not-called
- self.crn = crn
- self.deleted = deleted
- self.resource_type = resource_type
-
- @classmethod
- def from_dict(cls, _dict: Dict) -> 'ReservedIPTargetGenericResourceReference':
- """Initialize a ReservedIPTargetGenericResourceReference object from a json dictionary."""
- args = {}
- if 'crn' in _dict:
- args['crn'] = _dict.get('crn')
- else:
- raise ValueError('Required property \'crn\' not present in ReservedIPTargetGenericResourceReference JSON')
- if 'deleted' in _dict:
- args['deleted'] = GenericResourceReferenceDeleted.from_dict(_dict.get('deleted'))
- if 'resource_type' in _dict:
- args['resource_type'] = _dict.get('resource_type')
- else:
- raise ValueError('Required property \'resource_type\' not present in ReservedIPTargetGenericResourceReference JSON')
- return cls(**args)
-
- @classmethod
- def _from_dict(cls, _dict):
- """Initialize a ReservedIPTargetGenericResourceReference object from a json dictionary."""
- return cls.from_dict(_dict)
-
- def to_dict(self) -> Dict:
- """Return a json dictionary representing this model."""
- _dict = {}
- if hasattr(self, 'crn') and self.crn is not None:
- _dict['crn'] = self.crn
- if hasattr(self, 'deleted') and self.deleted is not None:
- if isinstance(self.deleted, dict):
- _dict['deleted'] = self.deleted
- else:
- _dict['deleted'] = self.deleted.to_dict()
- if hasattr(self, 'resource_type') and self.resource_type is not None:
- _dict['resource_type'] = self.resource_type
- return _dict
-
- def _to_dict(self):
- """Return a json dictionary representing this model."""
- return self.to_dict()
-
- def __str__(self) -> str:
- """Return a `str` version of this ReservedIPTargetGenericResourceReference object."""
- return json.dumps(self.to_dict(), indent=2)
-
- def __eq__(self, other: 'ReservedIPTargetGenericResourceReference') -> bool:
- """Return `true` when self and other are equal, false otherwise."""
- if not isinstance(other, self.__class__):
- return False
- return self.__dict__ == other.__dict__
-
- def __ne__(self, other: 'ReservedIPTargetGenericResourceReference') -> bool:
- """Return `true` when self and other are not equal, false otherwise."""
- return not self == other
-
- class ResourceTypeEnum(str, Enum):
- """
- The resource type.
- """
+ Initialize a InstancePrototypeInstanceByCatalogOffering object.
+
+ :param InstanceCatalogOfferingPrototype catalog_offering: The
+ [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user)
+ offering
+ or offering version to use when provisioning this virtual server instance.
+ If an offering is specified, the latest version of that offering will be
+ used.
+ The specified offering or offering version may be in a different account in
+ the same
+ [enterprise](https://cloud.ibm.com/docs/account?topic=account-what-is-enterprise),
+ subject
+ to IAM policies.
+ :param ZoneIdentity zone: The zone this virtual server instance will reside
+ in.
+ :param InstanceAvailabilityPolicyPrototype availability_policy: (optional)
+ The availability policy to use for this virtual server instance.
+ :param InstanceDefaultTrustedProfilePrototype default_trusted_profile:
+ (optional) The default trusted profile configuration to use for this
+ virtual server instance
+ This property's value is used when provisioning the virtual server
+ instance, but not subsequently managed. Accordingly, it is reflected as an
+ [instance
+ initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
+ property.
+ :param List[KeyIdentity] keys: (optional) The public SSH keys for the
+ administrative user of the virtual server instance. Keys will be made
+ available to the virtual server instance as cloud-init vendor data. For
+ cloud-init enabled images, these keys will also be added as SSH authorized
+ keys for the administrative user.
+ For Windows images, the keys of type `rsa` must be specified, and one will
+ be selected to encrypt [the administrator
+ password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization).
+ Keys are optional for other images, but if no keys are specified, the
+ instance will be inaccessible unless the specified image provides another
+ means of access.
+ This property's value is used when provisioning the virtual server
+ instance, but not subsequently managed. Accordingly, it is reflected as an
+ [instance
+ initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
+ property.
+ :param InstanceMetadataServicePrototype metadata_service: (optional)
+ :param str name: (optional) The name for this virtual server instance. The
+ name must not be used by another virtual server instance in the region. If
+ unspecified, the name will be a hyphenated list of randomly-selected words.
+ The system hostname will be based on this name.
+ :param InstancePlacementTargetPrototype placement_target: (optional) The
+ placement restrictions to use for the virtual server instance.
+ If specified, `reservation_affinity.policy` must be `disabled`.
+ :param InstanceProfileIdentity profile: (optional) The
+ [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for
+ this virtual server instance.
+ If unspecified, `bx2-2x8` will be used, but this default value is expected
+ to change in the future.
+ :param InstanceReservationAffinityPrototype reservation_affinity:
+ (optional)
+ :param ResourceGroupIdentity resource_group: (optional)
+ :param int total_volume_bandwidth: (optional) The amount of bandwidth (in
+ megabits per second) allocated exclusively to instance storage volumes. An
+ increase in this value will result in a corresponding decrease to
+ `total_network_bandwidth`.
+ :param str user_data: (optional) [User
+ data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available
+ when setting up the virtual server instance.
+ :param List[VolumeAttachmentPrototype] volume_attachments: (optional) The
+ additional volume attachments to create for the virtual server instance.
+ :param VPCIdentity vpc: (optional) The VPC this virtual server instance
+ will reside in.
+ If specified, it must match the VPC for the subnets of the instance network
+ attachments or instance network interfaces.
+ :param VolumeAttachmentPrototypeInstanceByImageContext
+ boot_volume_attachment: (optional) The boot volume attachment to create for
+ the virtual server instance.
+ """
+ # pylint: disable=super-init-not-called
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkAttachment', 'InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkInterface'])
+ )
+ raise Exception(msg)
+
+
+class InstancePrototypeInstanceByImage(InstancePrototype):
+ """
+ Create an instance by using an image.
+
+ :param InstanceAvailabilityPolicyPrototype availability_policy: (optional) The
+ availability policy to use for this virtual server instance.
+ :param InstanceDefaultTrustedProfilePrototype default_trusted_profile:
+ (optional) The default trusted profile configuration to use for this virtual
+ server instance
+ This property's value is used when provisioning the virtual server instance, but
+ not subsequently managed. Accordingly, it is reflected as an [instance
+ initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
+ property.
+ :param List[KeyIdentity] keys: (optional) The public SSH keys for the
+ administrative user of the virtual server instance. Keys will be made available
+ to the virtual server instance as cloud-init vendor data. For cloud-init enabled
+ images, these keys will also be added as SSH authorized keys for the
+ administrative user.
+ For Windows images, the keys of type `rsa` must be specified, and one will be
+ selected to encrypt [the administrator
+ password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys
+ are optional for other images, but if no keys are specified, the instance will
+ be inaccessible unless the specified image provides another means of access.
+ This property's value is used when provisioning the virtual server instance, but
+ not subsequently managed. Accordingly, it is reflected as an [instance
+ initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
+ property.
+ :param InstanceMetadataServicePrototype metadata_service: (optional)
+ :param str name: (optional) The name for this virtual server instance. The name
+ must not be used by another virtual server instance in the region. If
+ unspecified, the name will be a hyphenated list of randomly-selected words.
+ The system hostname will be based on this name.
+ :param InstancePlacementTargetPrototype placement_target: (optional) The
+ placement restrictions to use for the virtual server instance.
+ If specified, `reservation_affinity.policy` must be `disabled`.
+ :param InstanceProfileIdentity profile: (optional) The
+ [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this
+ virtual server instance.
+ If unspecified, `bx2-2x8` will be used, but this default value is expected to
+ change in the future.
+ :param InstanceReservationAffinityPrototype reservation_affinity: (optional)
+ :param ResourceGroupIdentity resource_group: (optional)
+ :param int total_volume_bandwidth: (optional) The amount of bandwidth (in
+ megabits per second) allocated exclusively to instance storage volumes. An
+ increase in this value will result in a corresponding decrease to
+ `total_network_bandwidth`.
+ :param str user_data: (optional) [User
+ data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when
+ setting up the virtual server instance.
+ :param List[VolumeAttachmentPrototype] volume_attachments: (optional) The
+ additional volume attachments to create for the virtual server instance.
+ :param VPCIdentity vpc: (optional) The VPC this virtual server instance will
+ reside in.
+ If specified, it must match the VPC for the subnets of the instance network
+ attachments or instance network interfaces.
+ :param VolumeAttachmentPrototypeInstanceByImageContext boot_volume_attachment:
+ (optional) The boot volume attachment to create for the virtual server instance.
+ :param ImageIdentity image: The image to use when provisioning the virtual
+ server instance.
+ :param ZoneIdentity zone: The zone this virtual server instance will reside in.
+ """
+
+ def __init__(
+ self,
+ image: 'ImageIdentity',
+ zone: 'ZoneIdentity',
+ *,
+ availability_policy: Optional['InstanceAvailabilityPolicyPrototype'] = None,
+ default_trusted_profile: Optional['InstanceDefaultTrustedProfilePrototype'] = None,
+ keys: Optional[List['KeyIdentity']] = None,
+ metadata_service: Optional['InstanceMetadataServicePrototype'] = None,
+ name: Optional[str] = None,
+ placement_target: Optional['InstancePlacementTargetPrototype'] = None,
+ profile: Optional['InstanceProfileIdentity'] = None,
+ reservation_affinity: Optional['InstanceReservationAffinityPrototype'] = None,
+ resource_group: Optional['ResourceGroupIdentity'] = None,
+ total_volume_bandwidth: Optional[int] = None,
+ user_data: Optional[str] = None,
+ volume_attachments: Optional[List['VolumeAttachmentPrototype']] = None,
+ vpc: Optional['VPCIdentity'] = None,
+ boot_volume_attachment: Optional['VolumeAttachmentPrototypeInstanceByImageContext'] = None,
+ ) -> None:
+ """
+ Initialize a InstancePrototypeInstanceByImage object.
+
+ :param ImageIdentity image: The image to use when provisioning the virtual
+ server instance.
+ :param ZoneIdentity zone: The zone this virtual server instance will reside
+ in.
+ :param InstanceAvailabilityPolicyPrototype availability_policy: (optional)
+ The availability policy to use for this virtual server instance.
+ :param InstanceDefaultTrustedProfilePrototype default_trusted_profile:
+ (optional) The default trusted profile configuration to use for this
+ virtual server instance
+ This property's value is used when provisioning the virtual server
+ instance, but not subsequently managed. Accordingly, it is reflected as an
+ [instance
+ initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
+ property.
+ :param List[KeyIdentity] keys: (optional) The public SSH keys for the
+ administrative user of the virtual server instance. Keys will be made
+ available to the virtual server instance as cloud-init vendor data. For
+ cloud-init enabled images, these keys will also be added as SSH authorized
+ keys for the administrative user.
+ For Windows images, the keys of type `rsa` must be specified, and one will
+ be selected to encrypt [the administrator
+ password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization).
+ Keys are optional for other images, but if no keys are specified, the
+ instance will be inaccessible unless the specified image provides another
+ means of access.
+ This property's value is used when provisioning the virtual server
+ instance, but not subsequently managed. Accordingly, it is reflected as an
+ [instance
+ initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
+ property.
+ :param InstanceMetadataServicePrototype metadata_service: (optional)
+ :param str name: (optional) The name for this virtual server instance. The
+ name must not be used by another virtual server instance in the region. If
+ unspecified, the name will be a hyphenated list of randomly-selected words.
+ The system hostname will be based on this name.
+ :param InstancePlacementTargetPrototype placement_target: (optional) The
+ placement restrictions to use for the virtual server instance.
+ If specified, `reservation_affinity.policy` must be `disabled`.
+ :param InstanceProfileIdentity profile: (optional) The
+ [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for
+ this virtual server instance.
+ If unspecified, `bx2-2x8` will be used, but this default value is expected
+ to change in the future.
+ :param InstanceReservationAffinityPrototype reservation_affinity:
+ (optional)
+ :param ResourceGroupIdentity resource_group: (optional)
+ :param int total_volume_bandwidth: (optional) The amount of bandwidth (in
+ megabits per second) allocated exclusively to instance storage volumes. An
+ increase in this value will result in a corresponding decrease to
+ `total_network_bandwidth`.
+ :param str user_data: (optional) [User
+ data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available
+ when setting up the virtual server instance.
+ :param List[VolumeAttachmentPrototype] volume_attachments: (optional) The
+ additional volume attachments to create for the virtual server instance.
+ :param VPCIdentity vpc: (optional) The VPC this virtual server instance
+ will reside in.
+ If specified, it must match the VPC for the subnets of the instance network
+ attachments or instance network interfaces.
+ :param VolumeAttachmentPrototypeInstanceByImageContext
+ boot_volume_attachment: (optional) The boot volume attachment to create for
+ the virtual server instance.
+ """
+ # pylint: disable=super-init-not-called
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkAttachment', 'InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterface'])
+ )
+ raise Exception(msg)
+
+
+class InstancePrototypeInstanceBySourceSnapshot(InstancePrototype):
+ """
+ Create an instance by using a snapshot.
+
+ :param InstanceAvailabilityPolicyPrototype availability_policy: (optional) The
+ availability policy to use for this virtual server instance.
+ :param InstanceDefaultTrustedProfilePrototype default_trusted_profile:
+ (optional) The default trusted profile configuration to use for this virtual
+ server instance
+ This property's value is used when provisioning the virtual server instance, but
+ not subsequently managed. Accordingly, it is reflected as an [instance
+ initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
+ property.
+ :param List[KeyIdentity] keys: (optional) The public SSH keys for the
+ administrative user of the virtual server instance. Keys will be made available
+ to the virtual server instance as cloud-init vendor data. For cloud-init enabled
+ images, these keys will also be added as SSH authorized keys for the
+ administrative user.
+ For Windows images, the keys of type `rsa` must be specified, and one will be
+ selected to encrypt [the administrator
+ password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys
+ are optional for other images, but if no keys are specified, the instance will
+ be inaccessible unless the specified image provides another means of access.
+ This property's value is used when provisioning the virtual server instance, but
+ not subsequently managed. Accordingly, it is reflected as an [instance
+ initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
+ property.
+ :param InstanceMetadataServicePrototype metadata_service: (optional)
+ :param str name: (optional) The name for this virtual server instance. The name
+ must not be used by another virtual server instance in the region. If
+ unspecified, the name will be a hyphenated list of randomly-selected words.
+ The system hostname will be based on this name.
+ :param InstancePlacementTargetPrototype placement_target: (optional) The
+ placement restrictions to use for the virtual server instance.
+ If specified, `reservation_affinity.policy` must be `disabled`.
+ :param InstanceProfileIdentity profile: (optional) The
+ [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this
+ virtual server instance.
+ If unspecified, `bx2-2x8` will be used, but this default value is expected to
+ change in the future.
+ :param InstanceReservationAffinityPrototype reservation_affinity: (optional)
+ :param ResourceGroupIdentity resource_group: (optional)
+ :param int total_volume_bandwidth: (optional) The amount of bandwidth (in
+ megabits per second) allocated exclusively to instance storage volumes. An
+ increase in this value will result in a corresponding decrease to
+ `total_network_bandwidth`.
+ :param str user_data: (optional) [User
+ data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when
+ setting up the virtual server instance.
+ :param List[VolumeAttachmentPrototype] volume_attachments: (optional) The
+ additional volume attachments to create for the virtual server instance.
+ :param VPCIdentity vpc: (optional) The VPC this virtual server instance will
+ reside in.
+ If specified, it must match the VPC for the subnets of the instance network
+ attachments or instance network interfaces.
+ :param VolumeAttachmentPrototypeInstanceBySourceSnapshotContext
+ boot_volume_attachment: The boot volume attachment to create for the virtual
+ server instance.
+ :param ZoneIdentity zone: The zone this virtual server instance will reside in.
+ """
+
+ def __init__(
+ self,
+ boot_volume_attachment: 'VolumeAttachmentPrototypeInstanceBySourceSnapshotContext',
+ zone: 'ZoneIdentity',
+ *,
+ availability_policy: Optional['InstanceAvailabilityPolicyPrototype'] = None,
+ default_trusted_profile: Optional['InstanceDefaultTrustedProfilePrototype'] = None,
+ keys: Optional[List['KeyIdentity']] = None,
+ metadata_service: Optional['InstanceMetadataServicePrototype'] = None,
+ name: Optional[str] = None,
+ placement_target: Optional['InstancePlacementTargetPrototype'] = None,
+ profile: Optional['InstanceProfileIdentity'] = None,
+ reservation_affinity: Optional['InstanceReservationAffinityPrototype'] = None,
+ resource_group: Optional['ResourceGroupIdentity'] = None,
+ total_volume_bandwidth: Optional[int] = None,
+ user_data: Optional[str] = None,
+ volume_attachments: Optional[List['VolumeAttachmentPrototype']] = None,
+ vpc: Optional['VPCIdentity'] = None,
+ ) -> None:
+ """
+ Initialize a InstancePrototypeInstanceBySourceSnapshot object.
+
+ :param VolumeAttachmentPrototypeInstanceBySourceSnapshotContext
+ boot_volume_attachment: The boot volume attachment to create for the
+ virtual server instance.
+ :param ZoneIdentity zone: The zone this virtual server instance will reside
+ in.
+ :param InstanceAvailabilityPolicyPrototype availability_policy: (optional)
+ The availability policy to use for this virtual server instance.
+ :param InstanceDefaultTrustedProfilePrototype default_trusted_profile:
+ (optional) The default trusted profile configuration to use for this
+ virtual server instance
+ This property's value is used when provisioning the virtual server
+ instance, but not subsequently managed. Accordingly, it is reflected as an
+ [instance
+ initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
+ property.
+ :param List[KeyIdentity] keys: (optional) The public SSH keys for the
+ administrative user of the virtual server instance. Keys will be made
+ available to the virtual server instance as cloud-init vendor data. For
+ cloud-init enabled images, these keys will also be added as SSH authorized
+ keys for the administrative user.
+ For Windows images, the keys of type `rsa` must be specified, and one will
+ be selected to encrypt [the administrator
+ password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization).
+ Keys are optional for other images, but if no keys are specified, the
+ instance will be inaccessible unless the specified image provides another
+ means of access.
+ This property's value is used when provisioning the virtual server
+ instance, but not subsequently managed. Accordingly, it is reflected as an
+ [instance
+ initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
+ property.
+ :param InstanceMetadataServicePrototype metadata_service: (optional)
+ :param str name: (optional) The name for this virtual server instance. The
+ name must not be used by another virtual server instance in the region. If
+ unspecified, the name will be a hyphenated list of randomly-selected words.
+ The system hostname will be based on this name.
+ :param InstancePlacementTargetPrototype placement_target: (optional) The
+ placement restrictions to use for the virtual server instance.
+ If specified, `reservation_affinity.policy` must be `disabled`.
+ :param InstanceProfileIdentity profile: (optional) The
+ [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for
+ this virtual server instance.
+ If unspecified, `bx2-2x8` will be used, but this default value is expected
+ to change in the future.
+ :param InstanceReservationAffinityPrototype reservation_affinity:
+ (optional)
+ :param ResourceGroupIdentity resource_group: (optional)
+ :param int total_volume_bandwidth: (optional) The amount of bandwidth (in
+ megabits per second) allocated exclusively to instance storage volumes. An
+ increase in this value will result in a corresponding decrease to
+ `total_network_bandwidth`.
+ :param str user_data: (optional) [User
+ data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available
+ when setting up the virtual server instance.
+ :param List[VolumeAttachmentPrototype] volume_attachments: (optional) The
+ additional volume attachments to create for the virtual server instance.
+ :param VPCIdentity vpc: (optional) The VPC this virtual server instance
+ will reside in.
+ If specified, it must match the VPC for the subnets of the instance network
+ attachments or instance network interfaces.
+ """
+ # pylint: disable=super-init-not-called
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkAttachment', 'InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkInterface'])
+ )
+ raise Exception(msg)
+
+
+class InstancePrototypeInstanceBySourceTemplate(InstancePrototype):
+ """
+ Create an instance by using an instance template.
+ The `primary_network_attachment` and `network_attachments` properties may only be
+ specified if `primary_network_attachment` is specified in the source template.
+ The `primary_network_interface` and `network_interfaces` properties may only be
+ specified if `primary_network_interface` is specified in the source template.
+
+ :param InstanceAvailabilityPolicyPrototype availability_policy: (optional) The
+ availability policy to use for this virtual server instance.
+ :param InstanceDefaultTrustedProfilePrototype default_trusted_profile:
+ (optional) The default trusted profile configuration to use for this virtual
+ server instance
+ This property's value is used when provisioning the virtual server instance, but
+ not subsequently managed. Accordingly, it is reflected as an [instance
+ initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
+ property.
+ :param List[KeyIdentity] keys: (optional) The public SSH keys for the
+ administrative user of the virtual server instance. Keys will be made available
+ to the virtual server instance as cloud-init vendor data. For cloud-init enabled
+ images, these keys will also be added as SSH authorized keys for the
+ administrative user.
+ For Windows images, the keys of type `rsa` must be specified, and one will be
+ selected to encrypt [the administrator
+ password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys
+ are optional for other images, but if no keys are specified, the instance will
+ be inaccessible unless the specified image provides another means of access.
+ This property's value is used when provisioning the virtual server instance, but
+ not subsequently managed. Accordingly, it is reflected as an [instance
+ initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
+ property.
+ :param InstanceMetadataServicePrototype metadata_service: (optional)
+ :param str name: (optional) The name for this virtual server instance. The name
+ must not be used by another virtual server instance in the region. If
+ unspecified, the name will be a hyphenated list of randomly-selected words.
+ The system hostname will be based on this name.
+ :param InstancePlacementTargetPrototype placement_target: (optional) The
+ placement restrictions to use for the virtual server instance.
+ If specified, `reservation_affinity.policy` must be `disabled`.
+ :param InstanceProfileIdentity profile: (optional) The
+ [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this
+ virtual server instance.
+ If unspecified, `bx2-2x8` will be used, but this default value is expected to
+ change in the future.
+ :param InstanceReservationAffinityPrototype reservation_affinity: (optional)
+ :param ResourceGroupIdentity resource_group: (optional)
+ :param int total_volume_bandwidth: (optional) The amount of bandwidth (in
+ megabits per second) allocated exclusively to instance storage volumes. An
+ increase in this value will result in a corresponding decrease to
+ `total_network_bandwidth`.
+ :param str user_data: (optional) [User
+ data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when
+ setting up the virtual server instance.
+ :param List[VolumeAttachmentPrototype] volume_attachments: (optional) The
+ additional volume attachments to create for the virtual server instance.
+ :param VPCIdentity vpc: (optional) The VPC this virtual server instance will
+ reside in.
+ If specified, it must match the VPC for the subnets of the instance network
+ attachments or instance network interfaces.
+ :param VolumeAttachmentPrototypeInstanceByImageContext boot_volume_attachment:
+ (optional) The boot volume attachment to create for the virtual server instance.
+ :param InstanceCatalogOfferingPrototype catalog_offering: (optional) The
+ [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user)
+ offering version to use when provisioning this virtual server instance.
+ If an offering is specified, the latest version of that offering will be used.
+ The specified offering or offering version may be in a different account,
+ subject to
+ IAM policies.
+ If specified, `image` must not be specified, and `source_template` must not have
+ `image` specified.
+ :param ImageIdentity image: (optional) The image to use when provisioning the
+ virtual server instance.
+ :param List[InstanceNetworkAttachmentPrototype] network_attachments: (optional)
+ The additional network attachments to create for the virtual server instance.
+ :param List[NetworkInterfacePrototype] network_interfaces: (optional) The
+ additional instance network interfaces to create.
+ :param InstanceNetworkAttachmentPrototype primary_network_attachment: (optional)
+ The primary network attachment to create for the virtual server instance.
+ :param NetworkInterfacePrototype primary_network_interface: (optional) The
+ primary instance network interface to create.
+ :param InstanceTemplateIdentity source_template: The template to create this
+ virtual server instance from.
+ :param ZoneIdentity zone: (optional) The zone this virtual server instance will
+ reside in.
+ """
+
+ def __init__(
+ self,
+ source_template: 'InstanceTemplateIdentity',
+ *,
+ availability_policy: Optional['InstanceAvailabilityPolicyPrototype'] = None,
+ default_trusted_profile: Optional['InstanceDefaultTrustedProfilePrototype'] = None,
+ keys: Optional[List['KeyIdentity']] = None,
+ metadata_service: Optional['InstanceMetadataServicePrototype'] = None,
+ name: Optional[str] = None,
+ placement_target: Optional['InstancePlacementTargetPrototype'] = None,
+ profile: Optional['InstanceProfileIdentity'] = None,
+ reservation_affinity: Optional['InstanceReservationAffinityPrototype'] = None,
+ resource_group: Optional['ResourceGroupIdentity'] = None,
+ total_volume_bandwidth: Optional[int] = None,
+ user_data: Optional[str] = None,
+ volume_attachments: Optional[List['VolumeAttachmentPrototype']] = None,
+ vpc: Optional['VPCIdentity'] = None,
+ boot_volume_attachment: Optional['VolumeAttachmentPrototypeInstanceByImageContext'] = None,
+ catalog_offering: Optional['InstanceCatalogOfferingPrototype'] = None,
+ image: Optional['ImageIdentity'] = None,
+ network_attachments: Optional[List['InstanceNetworkAttachmentPrototype']] = None,
+ network_interfaces: Optional[List['NetworkInterfacePrototype']] = None,
+ primary_network_attachment: Optional['InstanceNetworkAttachmentPrototype'] = None,
+ primary_network_interface: Optional['NetworkInterfacePrototype'] = None,
+ zone: Optional['ZoneIdentity'] = None,
+ ) -> None:
+ """
+ Initialize a InstancePrototypeInstanceBySourceTemplate object.
+
+ :param InstanceTemplateIdentity source_template: The template to create
+ this virtual server instance from.
+ :param InstanceAvailabilityPolicyPrototype availability_policy: (optional)
+ The availability policy to use for this virtual server instance.
+ :param InstanceDefaultTrustedProfilePrototype default_trusted_profile:
+ (optional) The default trusted profile configuration to use for this
+ virtual server instance
+ This property's value is used when provisioning the virtual server
+ instance, but not subsequently managed. Accordingly, it is reflected as an
+ [instance
+ initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
+ property.
+ :param List[KeyIdentity] keys: (optional) The public SSH keys for the
+ administrative user of the virtual server instance. Keys will be made
+ available to the virtual server instance as cloud-init vendor data. For
+ cloud-init enabled images, these keys will also be added as SSH authorized
+ keys for the administrative user.
+ For Windows images, the keys of type `rsa` must be specified, and one will
+ be selected to encrypt [the administrator
+ password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization).
+ Keys are optional for other images, but if no keys are specified, the
+ instance will be inaccessible unless the specified image provides another
+ means of access.
+ This property's value is used when provisioning the virtual server
+ instance, but not subsequently managed. Accordingly, it is reflected as an
+ [instance
+ initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
+ property.
+ :param InstanceMetadataServicePrototype metadata_service: (optional)
+ :param str name: (optional) The name for this virtual server instance. The
+ name must not be used by another virtual server instance in the region. If
+ unspecified, the name will be a hyphenated list of randomly-selected words.
+ The system hostname will be based on this name.
+ :param InstancePlacementTargetPrototype placement_target: (optional) The
+ placement restrictions to use for the virtual server instance.
+ If specified, `reservation_affinity.policy` must be `disabled`.
+ :param InstanceProfileIdentity profile: (optional) The
+ [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for
+ this virtual server instance.
+ If unspecified, `bx2-2x8` will be used, but this default value is expected
+ to change in the future.
+ :param InstanceReservationAffinityPrototype reservation_affinity:
+ (optional)
+ :param ResourceGroupIdentity resource_group: (optional)
+ :param int total_volume_bandwidth: (optional) The amount of bandwidth (in
+ megabits per second) allocated exclusively to instance storage volumes. An
+ increase in this value will result in a corresponding decrease to
+ `total_network_bandwidth`.
+ :param str user_data: (optional) [User
+ data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available
+ when setting up the virtual server instance.
+ :param List[VolumeAttachmentPrototype] volume_attachments: (optional) The
+ additional volume attachments to create for the virtual server instance.
+ :param VPCIdentity vpc: (optional) The VPC this virtual server instance
+ will reside in.
+ If specified, it must match the VPC for the subnets of the instance network
+ attachments or instance network interfaces.
+ :param VolumeAttachmentPrototypeInstanceByImageContext
+ boot_volume_attachment: (optional) The boot volume attachment to create for
+ the virtual server instance.
+ :param InstanceCatalogOfferingPrototype catalog_offering: (optional) The
+ [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user)
+ offering version to use when provisioning this virtual server instance.
+ If an offering is specified, the latest version of that offering will be
+ used.
+ The specified offering or offering version may be in a different account,
+ subject to
+ IAM policies.
+ If specified, `image` must not be specified, and `source_template` must not
+ have
+ `image` specified.
+ :param ImageIdentity image: (optional) The image to use when provisioning
+ the virtual server instance.
+ :param List[InstanceNetworkAttachmentPrototype] network_attachments:
+ (optional) The additional network attachments to create for the virtual
+ server instance.
+ :param List[NetworkInterfacePrototype] network_interfaces: (optional) The
+ additional instance network interfaces to create.
+ :param InstanceNetworkAttachmentPrototype primary_network_attachment:
+ (optional) The primary network attachment to create for the virtual server
+ instance.
+ :param NetworkInterfacePrototype primary_network_interface: (optional) The
+ primary instance network interface to create.
+ :param ZoneIdentity zone: (optional) The zone this virtual server instance
+ will reside in.
+ """
+ # pylint: disable=super-init-not-called
+ self.availability_policy = availability_policy
+ self.default_trusted_profile = default_trusted_profile
+ self.keys = keys
+ self.metadata_service = metadata_service
+ self.name = name
+ self.placement_target = placement_target
+ self.profile = profile
+ self.reservation_affinity = reservation_affinity
+ self.resource_group = resource_group
+ self.total_volume_bandwidth = total_volume_bandwidth
+ self.user_data = user_data
+ self.volume_attachments = volume_attachments
+ self.vpc = vpc
+ self.boot_volume_attachment = boot_volume_attachment
+ self.catalog_offering = catalog_offering
+ self.image = image
+ self.network_attachments = network_attachments
+ self.network_interfaces = network_interfaces
+ self.primary_network_attachment = primary_network_attachment
+ self.primary_network_interface = primary_network_interface
+ self.source_template = source_template
+ self.zone = zone
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'InstancePrototypeInstanceBySourceTemplate':
+ """Initialize a InstancePrototypeInstanceBySourceTemplate object from a json dictionary."""
+ args = {}
+ if (availability_policy := _dict.get('availability_policy')) is not None:
+ args['availability_policy'] = InstanceAvailabilityPolicyPrototype.from_dict(availability_policy)
+ if (default_trusted_profile := _dict.get('default_trusted_profile')) is not None:
+ args['default_trusted_profile'] = InstanceDefaultTrustedProfilePrototype.from_dict(default_trusted_profile)
+ if (keys := _dict.get('keys')) is not None:
+ args['keys'] = keys
+ if (metadata_service := _dict.get('metadata_service')) is not None:
+ args['metadata_service'] = InstanceMetadataServicePrototype.from_dict(metadata_service)
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ if (placement_target := _dict.get('placement_target')) is not None:
+ args['placement_target'] = placement_target
+ if (profile := _dict.get('profile')) is not None:
+ args['profile'] = profile
+ if (reservation_affinity := _dict.get('reservation_affinity')) is not None:
+ args['reservation_affinity'] = InstanceReservationAffinityPrototype.from_dict(reservation_affinity)
+ if (resource_group := _dict.get('resource_group')) is not None:
+ args['resource_group'] = resource_group
+ if (total_volume_bandwidth := _dict.get('total_volume_bandwidth')) is not None:
+ args['total_volume_bandwidth'] = total_volume_bandwidth
+ if (user_data := _dict.get('user_data')) is not None:
+ args['user_data'] = user_data
+ if (volume_attachments := _dict.get('volume_attachments')) is not None:
+ args['volume_attachments'] = [VolumeAttachmentPrototype.from_dict(v) for v in volume_attachments]
+ if (vpc := _dict.get('vpc')) is not None:
+ args['vpc'] = vpc
+ if (boot_volume_attachment := _dict.get('boot_volume_attachment')) is not None:
+ args['boot_volume_attachment'] = VolumeAttachmentPrototypeInstanceByImageContext.from_dict(boot_volume_attachment)
+ if (catalog_offering := _dict.get('catalog_offering')) is not None:
+ args['catalog_offering'] = catalog_offering
+ if (image := _dict.get('image')) is not None:
+ args['image'] = image
+ if (network_attachments := _dict.get('network_attachments')) is not None:
+ args['network_attachments'] = [InstanceNetworkAttachmentPrototype.from_dict(v) for v in network_attachments]
+ if (network_interfaces := _dict.get('network_interfaces')) is not None:
+ args['network_interfaces'] = [NetworkInterfacePrototype.from_dict(v) for v in network_interfaces]
+ if (primary_network_attachment := _dict.get('primary_network_attachment')) is not None:
+ args['primary_network_attachment'] = InstanceNetworkAttachmentPrototype.from_dict(primary_network_attachment)
+ if (primary_network_interface := _dict.get('primary_network_interface')) is not None:
+ args['primary_network_interface'] = NetworkInterfacePrototype.from_dict(primary_network_interface)
+ if (source_template := _dict.get('source_template')) is not None:
+ args['source_template'] = source_template
+ else:
+ raise ValueError('Required property \'source_template\' not present in InstancePrototypeInstanceBySourceTemplate JSON')
+ if (zone := _dict.get('zone')) is not None:
+ args['zone'] = zone
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a InstancePrototypeInstanceBySourceTemplate object from a json dictionary."""
+ return cls.from_dict(_dict)
+
+ def to_dict(self) -> Dict:
+ """Return a json dictionary representing this model."""
+ _dict = {}
+ if hasattr(self, 'availability_policy') and self.availability_policy is not None:
+ if isinstance(self.availability_policy, dict):
+ _dict['availability_policy'] = self.availability_policy
+ else:
+ _dict['availability_policy'] = self.availability_policy.to_dict()
+ if hasattr(self, 'default_trusted_profile') and self.default_trusted_profile is not None:
+ if isinstance(self.default_trusted_profile, dict):
+ _dict['default_trusted_profile'] = self.default_trusted_profile
+ else:
+ _dict['default_trusted_profile'] = self.default_trusted_profile.to_dict()
+ if hasattr(self, 'keys') and self.keys is not None:
+ keys_list = []
+ for v in self.keys:
+ if isinstance(v, dict):
+ keys_list.append(v)
+ else:
+ keys_list.append(v.to_dict())
+ _dict['keys'] = keys_list
+ if hasattr(self, 'metadata_service') and self.metadata_service is not None:
+ if isinstance(self.metadata_service, dict):
+ _dict['metadata_service'] = self.metadata_service
+ else:
+ _dict['metadata_service'] = self.metadata_service.to_dict()
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ if hasattr(self, 'placement_target') and self.placement_target is not None:
+ if isinstance(self.placement_target, dict):
+ _dict['placement_target'] = self.placement_target
+ else:
+ _dict['placement_target'] = self.placement_target.to_dict()
+ if hasattr(self, 'profile') and self.profile is not None:
+ if isinstance(self.profile, dict):
+ _dict['profile'] = self.profile
+ else:
+ _dict['profile'] = self.profile.to_dict()
+ if hasattr(self, 'reservation_affinity') and self.reservation_affinity is not None:
+ if isinstance(self.reservation_affinity, dict):
+ _dict['reservation_affinity'] = self.reservation_affinity
+ else:
+ _dict['reservation_affinity'] = self.reservation_affinity.to_dict()
+ if hasattr(self, 'resource_group') and self.resource_group is not None:
+ if isinstance(self.resource_group, dict):
+ _dict['resource_group'] = self.resource_group
+ else:
+ _dict['resource_group'] = self.resource_group.to_dict()
+ if hasattr(self, 'total_volume_bandwidth') and self.total_volume_bandwidth is not None:
+ _dict['total_volume_bandwidth'] = self.total_volume_bandwidth
+ if hasattr(self, 'user_data') and self.user_data is not None:
+ _dict['user_data'] = self.user_data
+ if hasattr(self, 'volume_attachments') and self.volume_attachments is not None:
+ volume_attachments_list = []
+ for v in self.volume_attachments:
+ if isinstance(v, dict):
+ volume_attachments_list.append(v)
+ else:
+ volume_attachments_list.append(v.to_dict())
+ _dict['volume_attachments'] = volume_attachments_list
+ if hasattr(self, 'vpc') and self.vpc is not None:
+ if isinstance(self.vpc, dict):
+ _dict['vpc'] = self.vpc
+ else:
+ _dict['vpc'] = self.vpc.to_dict()
+ if hasattr(self, 'boot_volume_attachment') and self.boot_volume_attachment is not None:
+ if isinstance(self.boot_volume_attachment, dict):
+ _dict['boot_volume_attachment'] = self.boot_volume_attachment
+ else:
+ _dict['boot_volume_attachment'] = self.boot_volume_attachment.to_dict()
+ if hasattr(self, 'catalog_offering') and self.catalog_offering is not None:
+ if isinstance(self.catalog_offering, dict):
+ _dict['catalog_offering'] = self.catalog_offering
+ else:
+ _dict['catalog_offering'] = self.catalog_offering.to_dict()
+ if hasattr(self, 'image') and self.image is not None:
+ if isinstance(self.image, dict):
+ _dict['image'] = self.image
+ else:
+ _dict['image'] = self.image.to_dict()
+ if hasattr(self, 'network_attachments') and self.network_attachments is not None:
+ network_attachments_list = []
+ for v in self.network_attachments:
+ if isinstance(v, dict):
+ network_attachments_list.append(v)
+ else:
+ network_attachments_list.append(v.to_dict())
+ _dict['network_attachments'] = network_attachments_list
+ if hasattr(self, 'network_interfaces') and self.network_interfaces is not None:
+ network_interfaces_list = []
+ for v in self.network_interfaces:
+ if isinstance(v, dict):
+ network_interfaces_list.append(v)
+ else:
+ network_interfaces_list.append(v.to_dict())
+ _dict['network_interfaces'] = network_interfaces_list
+ if hasattr(self, 'primary_network_attachment') and self.primary_network_attachment is not None:
+ if isinstance(self.primary_network_attachment, dict):
+ _dict['primary_network_attachment'] = self.primary_network_attachment
+ else:
+ _dict['primary_network_attachment'] = self.primary_network_attachment.to_dict()
+ if hasattr(self, 'primary_network_interface') and self.primary_network_interface is not None:
+ if isinstance(self.primary_network_interface, dict):
+ _dict['primary_network_interface'] = self.primary_network_interface
+ else:
+ _dict['primary_network_interface'] = self.primary_network_interface.to_dict()
+ if hasattr(self, 'source_template') and self.source_template is not None:
+ if isinstance(self.source_template, dict):
+ _dict['source_template'] = self.source_template
+ else:
+ _dict['source_template'] = self.source_template.to_dict()
+ if hasattr(self, 'zone') and self.zone is not None:
+ if isinstance(self.zone, dict):
+ _dict['zone'] = self.zone
+ else:
+ _dict['zone'] = self.zone.to_dict()
+ return _dict
+
+ def _to_dict(self):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
+
+ def __str__(self) -> str:
+ """Return a `str` version of this InstancePrototypeInstanceBySourceTemplate object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'InstancePrototypeInstanceBySourceTemplate') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'InstancePrototypeInstanceBySourceTemplate') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+
+class InstancePrototypeInstanceByVolume(InstancePrototype):
+ """
+ Create an instance by using a boot volume.
+
+ :param InstanceAvailabilityPolicyPrototype availability_policy: (optional) The
+ availability policy to use for this virtual server instance.
+ :param InstanceDefaultTrustedProfilePrototype default_trusted_profile:
+ (optional) The default trusted profile configuration to use for this virtual
+ server instance
+ This property's value is used when provisioning the virtual server instance, but
+ not subsequently managed. Accordingly, it is reflected as an [instance
+ initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
+ property.
+ :param List[KeyIdentity] keys: (optional) The public SSH keys for the
+ administrative user of the virtual server instance. Keys will be made available
+ to the virtual server instance as cloud-init vendor data. For cloud-init enabled
+ images, these keys will also be added as SSH authorized keys for the
+ administrative user.
+ For Windows images, the keys of type `rsa` must be specified, and one will be
+ selected to encrypt [the administrator
+ password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys
+ are optional for other images, but if no keys are specified, the instance will
+ be inaccessible unless the specified image provides another means of access.
+ This property's value is used when provisioning the virtual server instance, but
+ not subsequently managed. Accordingly, it is reflected as an [instance
+ initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
+ property.
+ :param InstanceMetadataServicePrototype metadata_service: (optional)
+ :param str name: (optional) The name for this virtual server instance. The name
+ must not be used by another virtual server instance in the region. If
+ unspecified, the name will be a hyphenated list of randomly-selected words.
+ The system hostname will be based on this name.
+ :param InstancePlacementTargetPrototype placement_target: (optional) The
+ placement restrictions to use for the virtual server instance.
+ If specified, `reservation_affinity.policy` must be `disabled`.
+ :param InstanceProfileIdentity profile: (optional) The
+ [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this
+ virtual server instance.
+ If unspecified, `bx2-2x8` will be used, but this default value is expected to
+ change in the future.
+ :param InstanceReservationAffinityPrototype reservation_affinity: (optional)
+ :param ResourceGroupIdentity resource_group: (optional)
+ :param int total_volume_bandwidth: (optional) The amount of bandwidth (in
+ megabits per second) allocated exclusively to instance storage volumes. An
+ increase in this value will result in a corresponding decrease to
+ `total_network_bandwidth`.
+ :param str user_data: (optional) [User
+ data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when
+ setting up the virtual server instance.
+ :param List[VolumeAttachmentPrototype] volume_attachments: (optional) The
+ additional volume attachments to create for the virtual server instance.
+ :param VPCIdentity vpc: (optional) The VPC this virtual server instance will
+ reside in.
+ If specified, it must match the VPC for the subnets of the instance network
+ attachments or instance network interfaces.
+ :param VolumeAttachmentPrototypeInstanceByVolumeContext boot_volume_attachment:
+ The boot volume attachment for the virtual server instance.
+ :param ZoneIdentity zone: The zone this virtual server instance will reside in.
+ """
+
+ def __init__(
+ self,
+ boot_volume_attachment: 'VolumeAttachmentPrototypeInstanceByVolumeContext',
+ zone: 'ZoneIdentity',
+ *,
+ availability_policy: Optional['InstanceAvailabilityPolicyPrototype'] = None,
+ default_trusted_profile: Optional['InstanceDefaultTrustedProfilePrototype'] = None,
+ keys: Optional[List['KeyIdentity']] = None,
+ metadata_service: Optional['InstanceMetadataServicePrototype'] = None,
+ name: Optional[str] = None,
+ placement_target: Optional['InstancePlacementTargetPrototype'] = None,
+ profile: Optional['InstanceProfileIdentity'] = None,
+ reservation_affinity: Optional['InstanceReservationAffinityPrototype'] = None,
+ resource_group: Optional['ResourceGroupIdentity'] = None,
+ total_volume_bandwidth: Optional[int] = None,
+ user_data: Optional[str] = None,
+ volume_attachments: Optional[List['VolumeAttachmentPrototype']] = None,
+ vpc: Optional['VPCIdentity'] = None,
+ ) -> None:
+ """
+ Initialize a InstancePrototypeInstanceByVolume object.
+
+ :param VolumeAttachmentPrototypeInstanceByVolumeContext
+ boot_volume_attachment: The boot volume attachment for the virtual server
+ instance.
+ :param ZoneIdentity zone: The zone this virtual server instance will reside
+ in.
+ :param InstanceAvailabilityPolicyPrototype availability_policy: (optional)
+ The availability policy to use for this virtual server instance.
+ :param InstanceDefaultTrustedProfilePrototype default_trusted_profile:
+ (optional) The default trusted profile configuration to use for this
+ virtual server instance
+ This property's value is used when provisioning the virtual server
+ instance, but not subsequently managed. Accordingly, it is reflected as an
+ [instance
+ initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
+ property.
+ :param List[KeyIdentity] keys: (optional) The public SSH keys for the
+ administrative user of the virtual server instance. Keys will be made
+ available to the virtual server instance as cloud-init vendor data. For
+ cloud-init enabled images, these keys will also be added as SSH authorized
+ keys for the administrative user.
+ For Windows images, the keys of type `rsa` must be specified, and one will
+ be selected to encrypt [the administrator
+ password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization).
+ Keys are optional for other images, but if no keys are specified, the
+ instance will be inaccessible unless the specified image provides another
+ means of access.
+ This property's value is used when provisioning the virtual server
+ instance, but not subsequently managed. Accordingly, it is reflected as an
+ [instance
+ initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
+ property.
+ :param InstanceMetadataServicePrototype metadata_service: (optional)
+ :param str name: (optional) The name for this virtual server instance. The
+ name must not be used by another virtual server instance in the region. If
+ unspecified, the name will be a hyphenated list of randomly-selected words.
+ The system hostname will be based on this name.
+ :param InstancePlacementTargetPrototype placement_target: (optional) The
+ placement restrictions to use for the virtual server instance.
+ If specified, `reservation_affinity.policy` must be `disabled`.
+ :param InstanceProfileIdentity profile: (optional) The
+ [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for
+ this virtual server instance.
+ If unspecified, `bx2-2x8` will be used, but this default value is expected
+ to change in the future.
+ :param InstanceReservationAffinityPrototype reservation_affinity:
+ (optional)
+ :param ResourceGroupIdentity resource_group: (optional)
+ :param int total_volume_bandwidth: (optional) The amount of bandwidth (in
+ megabits per second) allocated exclusively to instance storage volumes. An
+ increase in this value will result in a corresponding decrease to
+ `total_network_bandwidth`.
+ :param str user_data: (optional) [User
+ data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available
+ when setting up the virtual server instance.
+ :param List[VolumeAttachmentPrototype] volume_attachments: (optional) The
+ additional volume attachments to create for the virtual server instance.
+ :param VPCIdentity vpc: (optional) The VPC this virtual server instance
+ will reside in.
+ If specified, it must match the VPC for the subnets of the instance network
+ attachments or instance network interfaces.
+ """
+ # pylint: disable=super-init-not-called
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkAttachment', 'InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkInterface'])
+ )
+ raise Exception(msg)
+
+
+class InstanceTemplateIdentityByCRN(InstanceTemplateIdentity):
+ """
+ InstanceTemplateIdentityByCRN.
+
+ :param str crn: The CRN for this instance template.
+ """
+
+ def __init__(
+ self,
+ crn: str,
+ ) -> None:
+ """
+ Initialize a InstanceTemplateIdentityByCRN object.
+
+ :param str crn: The CRN for this instance template.
+ """
+ # pylint: disable=super-init-not-called
+ self.crn = crn
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'InstanceTemplateIdentityByCRN':
+ """Initialize a InstanceTemplateIdentityByCRN object from a json dictionary."""
+ args = {}
+ if (crn := _dict.get('crn')) is not None:
+ args['crn'] = crn
+ else:
+ raise ValueError('Required property \'crn\' not present in InstanceTemplateIdentityByCRN JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a InstanceTemplateIdentityByCRN object from a json dictionary."""
+ return cls.from_dict(_dict)
+
+ def to_dict(self) -> Dict:
+ """Return a json dictionary representing this model."""
+ _dict = {}
+ if hasattr(self, '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 InstanceTemplateIdentityByCRN object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'InstanceTemplateIdentityByCRN') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'InstanceTemplateIdentityByCRN') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+
+class InstanceTemplateIdentityByHref(InstanceTemplateIdentity):
+ """
+ InstanceTemplateIdentityByHref.
+
+ :param str href: The URL for this instance template.
+ """
+
+ def __init__(
+ self,
+ href: str,
+ ) -> None:
+ """
+ Initialize a InstanceTemplateIdentityByHref object.
+
+ :param str href: The URL for this instance template.
+ """
+ # pylint: disable=super-init-not-called
+ self.href = href
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'InstanceTemplateIdentityByHref':
+ """Initialize a InstanceTemplateIdentityByHref object from a json dictionary."""
+ args = {}
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
+ else:
+ raise ValueError('Required property \'href\' not present in InstanceTemplateIdentityByHref JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a InstanceTemplateIdentityByHref object from a json dictionary."""
+ return cls.from_dict(_dict)
+
+ def to_dict(self) -> Dict:
+ """Return a json dictionary representing this model."""
+ _dict = {}
+ if hasattr(self, '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 InstanceTemplateIdentityByHref object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'InstanceTemplateIdentityByHref') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'InstanceTemplateIdentityByHref') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+
+class InstanceTemplateIdentityById(InstanceTemplateIdentity):
+ """
+ InstanceTemplateIdentityById.
+
+ :param str id: The unique identifier for this instance template.
+ """
+
+ def __init__(
+ self,
+ id: str,
+ ) -> None:
+ """
+ Initialize a InstanceTemplateIdentityById object.
+
+ :param str id: The unique identifier for this instance template.
+ """
+ # pylint: disable=super-init-not-called
+ self.id = id
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'InstanceTemplateIdentityById':
+ """Initialize a InstanceTemplateIdentityById object from a json dictionary."""
+ args = {}
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
+ else:
+ raise ValueError('Required property \'id\' not present in InstanceTemplateIdentityById JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a InstanceTemplateIdentityById object from a json dictionary."""
+ return cls.from_dict(_dict)
+
+ def to_dict(self) -> Dict:
+ """Return a json dictionary representing this model."""
+ _dict = {}
+ if hasattr(self, '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 InstanceTemplateIdentityById object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'InstanceTemplateIdentityById') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'InstanceTemplateIdentityById') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+
+class InstanceTemplatePrototypeInstanceTemplateByCatalogOffering(InstanceTemplatePrototype):
+ """
+ Create an instance template that creates instances by using a catalog offering.
+
+ :param InstanceAvailabilityPolicyPrototype availability_policy: (optional) The
+ availability policy to use for this virtual server instance.
+ :param InstanceDefaultTrustedProfilePrototype default_trusted_profile:
+ (optional) The default trusted profile configuration to use for this virtual
+ server instance
+ This property's value is used when provisioning the virtual server instance, but
+ not subsequently managed. Accordingly, it is reflected as an [instance
+ initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
+ property.
+ :param List[KeyIdentity] keys: (optional) The public SSH keys for the
+ administrative user of the virtual server instance. Keys will be made available
+ to the virtual server instance as cloud-init vendor data. For cloud-init enabled
+ images, these keys will also be added as SSH authorized keys for the
+ administrative user.
+ For Windows images, the keys of type `rsa` must be specified, and one will be
+ selected to encrypt [the administrator
+ password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys
+ are optional for other images, but if no keys are specified, the instance will
+ be inaccessible unless the specified image provides another means of access.
+ This property's value is used when provisioning the virtual server instance, but
+ not subsequently managed. Accordingly, it is reflected as an [instance
+ initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
+ property.
+ :param InstanceMetadataServicePrototype metadata_service: (optional)
+ :param str name: (optional) The name for this instance template. The name must
+ not be used by another instance template in the region. If unspecified, the name
+ will be a hyphenated list of randomly-selected words.
+ :param InstancePlacementTargetPrototype placement_target: (optional) The
+ placement restrictions to use for the virtual server instance.
+ If specified, `reservation_affinity.policy` must be `disabled`.
+ :param InstanceProfileIdentity profile: (optional) The
+ [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this
+ virtual server instance.
+ If unspecified, `bx2-2x8` will be used, but this default value is expected to
+ change in the future.
+ :param InstanceReservationAffinityPrototype reservation_affinity: (optional)
+ :param ResourceGroupIdentity resource_group: (optional)
+ :param int total_volume_bandwidth: (optional) The amount of bandwidth (in
+ megabits per second) allocated exclusively to instance storage volumes. An
+ increase in this value will result in a corresponding decrease to
+ `total_network_bandwidth`.
+ :param str user_data: (optional) [User
+ data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when
+ setting up the virtual server instance.
+ :param List[VolumeAttachmentPrototype] volume_attachments: (optional) The
+ additional volume attachments to create for the virtual server instance.
+ :param VPCIdentity vpc: (optional) The VPC this virtual server instance will
+ reside in.
+ If specified, it must match the VPC for the subnets of the instance network
+ attachments or instance network interfaces.
+ :param VolumeAttachmentPrototypeInstanceByImageContext boot_volume_attachment:
+ (optional) The boot volume attachment to create for the virtual server instance.
+ :param InstanceCatalogOfferingPrototype catalog_offering: The
+ [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user)
+ offering
+ or offering version to use when provisioning this virtual server instance.
+ If an offering is specified, the latest version of that offering will be used.
+ The specified offering or offering version may be in a different account in the
+ same
+ [enterprise](https://cloud.ibm.com/docs/account?topic=account-what-is-enterprise),
+ subject
+ to IAM policies.
+ :param ZoneIdentity zone: The zone this virtual server instance will reside in.
+ """
+
+ def __init__(
+ self,
+ catalog_offering: 'InstanceCatalogOfferingPrototype',
+ zone: 'ZoneIdentity',
+ *,
+ availability_policy: Optional['InstanceAvailabilityPolicyPrototype'] = None,
+ default_trusted_profile: Optional['InstanceDefaultTrustedProfilePrototype'] = None,
+ keys: Optional[List['KeyIdentity']] = None,
+ metadata_service: Optional['InstanceMetadataServicePrototype'] = None,
+ name: Optional[str] = None,
+ placement_target: Optional['InstancePlacementTargetPrototype'] = None,
+ profile: Optional['InstanceProfileIdentity'] = None,
+ reservation_affinity: Optional['InstanceReservationAffinityPrototype'] = None,
+ resource_group: Optional['ResourceGroupIdentity'] = None,
+ total_volume_bandwidth: Optional[int] = None,
+ user_data: Optional[str] = None,
+ volume_attachments: Optional[List['VolumeAttachmentPrototype']] = None,
+ vpc: Optional['VPCIdentity'] = None,
+ boot_volume_attachment: Optional['VolumeAttachmentPrototypeInstanceByImageContext'] = None,
+ ) -> None:
+ """
+ Initialize a InstanceTemplatePrototypeInstanceTemplateByCatalogOffering object.
+
+ :param InstanceCatalogOfferingPrototype catalog_offering: The
+ [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user)
+ offering
+ or offering version to use when provisioning this virtual server instance.
+ If an offering is specified, the latest version of that offering will be
+ used.
+ The specified offering or offering version may be in a different account in
+ the same
+ [enterprise](https://cloud.ibm.com/docs/account?topic=account-what-is-enterprise),
+ subject
+ to IAM policies.
+ :param ZoneIdentity zone: The zone this virtual server instance will reside
+ in.
+ :param InstanceAvailabilityPolicyPrototype availability_policy: (optional)
+ The availability policy to use for this virtual server instance.
+ :param InstanceDefaultTrustedProfilePrototype default_trusted_profile:
+ (optional) The default trusted profile configuration to use for this
+ virtual server instance
+ This property's value is used when provisioning the virtual server
+ instance, but not subsequently managed. Accordingly, it is reflected as an
+ [instance
+ initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
+ property.
+ :param List[KeyIdentity] keys: (optional) The public SSH keys for the
+ administrative user of the virtual server instance. Keys will be made
+ available to the virtual server instance as cloud-init vendor data. For
+ cloud-init enabled images, these keys will also be added as SSH authorized
+ keys for the administrative user.
+ For Windows images, the keys of type `rsa` must be specified, and one will
+ be selected to encrypt [the administrator
+ password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization).
+ Keys are optional for other images, but if no keys are specified, the
+ instance will be inaccessible unless the specified image provides another
+ means of access.
+ This property's value is used when provisioning the virtual server
+ instance, but not subsequently managed. Accordingly, it is reflected as an
+ [instance
+ initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
+ property.
+ :param InstanceMetadataServicePrototype metadata_service: (optional)
+ :param str name: (optional) The name for this instance template. The name
+ must not be used by another instance template in the region. If
+ unspecified, the name will be a hyphenated list of randomly-selected words.
+ :param InstancePlacementTargetPrototype placement_target: (optional) The
+ placement restrictions to use for the virtual server instance.
+ If specified, `reservation_affinity.policy` must be `disabled`.
+ :param InstanceProfileIdentity profile: (optional) The
+ [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for
+ this virtual server instance.
+ If unspecified, `bx2-2x8` will be used, but this default value is expected
+ to change in the future.
+ :param InstanceReservationAffinityPrototype reservation_affinity:
+ (optional)
+ :param ResourceGroupIdentity resource_group: (optional)
+ :param int total_volume_bandwidth: (optional) The amount of bandwidth (in
+ megabits per second) allocated exclusively to instance storage volumes. An
+ increase in this value will result in a corresponding decrease to
+ `total_network_bandwidth`.
+ :param str user_data: (optional) [User
+ data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available
+ when setting up the virtual server instance.
+ :param List[VolumeAttachmentPrototype] volume_attachments: (optional) The
+ additional volume attachments to create for the virtual server instance.
+ :param VPCIdentity vpc: (optional) The VPC this virtual server instance
+ will reside in.
+ If specified, it must match the VPC for the subnets of the instance network
+ attachments or instance network interfaces.
+ :param VolumeAttachmentPrototypeInstanceByImageContext
+ boot_volume_attachment: (optional) The boot volume attachment to create for
+ the virtual server instance.
+ """
+ # pylint: disable=super-init-not-called
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkAttachment', 'InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkInterface'])
+ )
+ raise Exception(msg)
+
+
+class InstanceTemplatePrototypeInstanceTemplateByImage(InstanceTemplatePrototype):
+ """
+ Create an instance template that creates instances by using an image.
+
+ :param InstanceAvailabilityPolicyPrototype availability_policy: (optional) The
+ availability policy to use for this virtual server instance.
+ :param InstanceDefaultTrustedProfilePrototype default_trusted_profile:
+ (optional) The default trusted profile configuration to use for this virtual
+ server instance
+ This property's value is used when provisioning the virtual server instance, but
+ not subsequently managed. Accordingly, it is reflected as an [instance
+ initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
+ property.
+ :param List[KeyIdentity] keys: (optional) The public SSH keys for the
+ administrative user of the virtual server instance. Keys will be made available
+ to the virtual server instance as cloud-init vendor data. For cloud-init enabled
+ images, these keys will also be added as SSH authorized keys for the
+ administrative user.
+ For Windows images, the keys of type `rsa` must be specified, and one will be
+ selected to encrypt [the administrator
+ password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys
+ are optional for other images, but if no keys are specified, the instance will
+ be inaccessible unless the specified image provides another means of access.
+ This property's value is used when provisioning the virtual server instance, but
+ not subsequently managed. Accordingly, it is reflected as an [instance
+ initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
+ property.
+ :param InstanceMetadataServicePrototype metadata_service: (optional)
+ :param str name: (optional) The name for this instance template. The name must
+ not be used by another instance template in the region. If unspecified, the name
+ will be a hyphenated list of randomly-selected words.
+ :param InstancePlacementTargetPrototype placement_target: (optional) The
+ placement restrictions to use for the virtual server instance.
+ If specified, `reservation_affinity.policy` must be `disabled`.
+ :param InstanceProfileIdentity profile: (optional) The
+ [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this
+ virtual server instance.
+ If unspecified, `bx2-2x8` will be used, but this default value is expected to
+ change in the future.
+ :param InstanceReservationAffinityPrototype reservation_affinity: (optional)
+ :param ResourceGroupIdentity resource_group: (optional)
+ :param int total_volume_bandwidth: (optional) The amount of bandwidth (in
+ megabits per second) allocated exclusively to instance storage volumes. An
+ increase in this value will result in a corresponding decrease to
+ `total_network_bandwidth`.
+ :param str user_data: (optional) [User
+ data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when
+ setting up the virtual server instance.
+ :param List[VolumeAttachmentPrototype] volume_attachments: (optional) The
+ additional volume attachments to create for the virtual server instance.
+ :param VPCIdentity vpc: (optional) The VPC this virtual server instance will
+ reside in.
+ If specified, it must match the VPC for the subnets of the instance network
+ attachments or instance network interfaces.
+ :param VolumeAttachmentPrototypeInstanceByImageContext boot_volume_attachment:
+ (optional) The boot volume attachment to create for the virtual server instance.
+ :param ImageIdentity image: The image to use when provisioning the virtual
+ server instance.
+ :param ZoneIdentity zone: The zone this virtual server instance will reside in.
+ """
+
+ def __init__(
+ self,
+ image: 'ImageIdentity',
+ zone: 'ZoneIdentity',
+ *,
+ availability_policy: Optional['InstanceAvailabilityPolicyPrototype'] = None,
+ default_trusted_profile: Optional['InstanceDefaultTrustedProfilePrototype'] = None,
+ keys: Optional[List['KeyIdentity']] = None,
+ metadata_service: Optional['InstanceMetadataServicePrototype'] = None,
+ name: Optional[str] = None,
+ placement_target: Optional['InstancePlacementTargetPrototype'] = None,
+ profile: Optional['InstanceProfileIdentity'] = None,
+ reservation_affinity: Optional['InstanceReservationAffinityPrototype'] = None,
+ resource_group: Optional['ResourceGroupIdentity'] = None,
+ total_volume_bandwidth: Optional[int] = None,
+ user_data: Optional[str] = None,
+ volume_attachments: Optional[List['VolumeAttachmentPrototype']] = None,
+ vpc: Optional['VPCIdentity'] = None,
+ boot_volume_attachment: Optional['VolumeAttachmentPrototypeInstanceByImageContext'] = None,
+ ) -> None:
+ """
+ Initialize a InstanceTemplatePrototypeInstanceTemplateByImage object.
+
+ :param ImageIdentity image: The image to use when provisioning the virtual
+ server instance.
+ :param ZoneIdentity zone: The zone this virtual server instance will reside
+ in.
+ :param InstanceAvailabilityPolicyPrototype availability_policy: (optional)
+ The availability policy to use for this virtual server instance.
+ :param InstanceDefaultTrustedProfilePrototype default_trusted_profile:
+ (optional) The default trusted profile configuration to use for this
+ virtual server instance
+ This property's value is used when provisioning the virtual server
+ instance, but not subsequently managed. Accordingly, it is reflected as an
+ [instance
+ initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
+ property.
+ :param List[KeyIdentity] keys: (optional) The public SSH keys for the
+ administrative user of the virtual server instance. Keys will be made
+ available to the virtual server instance as cloud-init vendor data. For
+ cloud-init enabled images, these keys will also be added as SSH authorized
+ keys for the administrative user.
+ For Windows images, the keys of type `rsa` must be specified, and one will
+ be selected to encrypt [the administrator
+ password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization).
+ Keys are optional for other images, but if no keys are specified, the
+ instance will be inaccessible unless the specified image provides another
+ means of access.
+ This property's value is used when provisioning the virtual server
+ instance, but not subsequently managed. Accordingly, it is reflected as an
+ [instance
+ initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
+ property.
+ :param InstanceMetadataServicePrototype metadata_service: (optional)
+ :param str name: (optional) The name for this instance template. The name
+ must not be used by another instance template in the region. If
+ unspecified, the name will be a hyphenated list of randomly-selected words.
+ :param InstancePlacementTargetPrototype placement_target: (optional) The
+ placement restrictions to use for the virtual server instance.
+ If specified, `reservation_affinity.policy` must be `disabled`.
+ :param InstanceProfileIdentity profile: (optional) The
+ [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for
+ this virtual server instance.
+ If unspecified, `bx2-2x8` will be used, but this default value is expected
+ to change in the future.
+ :param InstanceReservationAffinityPrototype reservation_affinity:
+ (optional)
+ :param ResourceGroupIdentity resource_group: (optional)
+ :param int total_volume_bandwidth: (optional) The amount of bandwidth (in
+ megabits per second) allocated exclusively to instance storage volumes. An
+ increase in this value will result in a corresponding decrease to
+ `total_network_bandwidth`.
+ :param str user_data: (optional) [User
+ data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available
+ when setting up the virtual server instance.
+ :param List[VolumeAttachmentPrototype] volume_attachments: (optional) The
+ additional volume attachments to create for the virtual server instance.
+ :param VPCIdentity vpc: (optional) The VPC this virtual server instance
+ will reside in.
+ If specified, it must match the VPC for the subnets of the instance network
+ attachments or instance network interfaces.
+ :param VolumeAttachmentPrototypeInstanceByImageContext
+ boot_volume_attachment: (optional) The boot volume attachment to create for
+ the virtual server instance.
+ """
+ # pylint: disable=super-init-not-called
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachment', 'InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkInterface'])
+ )
+ raise Exception(msg)
+
+
+class InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot(InstanceTemplatePrototype):
+ """
+ Create an instance template that creates instances by using a snapshot.
+
+ :param InstanceAvailabilityPolicyPrototype availability_policy: (optional) The
+ availability policy to use for this virtual server instance.
+ :param InstanceDefaultTrustedProfilePrototype default_trusted_profile:
+ (optional) The default trusted profile configuration to use for this virtual
+ server instance
+ This property's value is used when provisioning the virtual server instance, but
+ not subsequently managed. Accordingly, it is reflected as an [instance
+ initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
+ property.
+ :param List[KeyIdentity] keys: (optional) The public SSH keys for the
+ administrative user of the virtual server instance. Keys will be made available
+ to the virtual server instance as cloud-init vendor data. For cloud-init enabled
+ images, these keys will also be added as SSH authorized keys for the
+ administrative user.
+ For Windows images, the keys of type `rsa` must be specified, and one will be
+ selected to encrypt [the administrator
+ password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys
+ are optional for other images, but if no keys are specified, the instance will
+ be inaccessible unless the specified image provides another means of access.
+ This property's value is used when provisioning the virtual server instance, but
+ not subsequently managed. Accordingly, it is reflected as an [instance
+ initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
+ property.
+ :param InstanceMetadataServicePrototype metadata_service: (optional)
+ :param str name: (optional) The name for this instance template. The name must
+ not be used by another instance template in the region. If unspecified, the name
+ will be a hyphenated list of randomly-selected words.
+ :param InstancePlacementTargetPrototype placement_target: (optional) The
+ placement restrictions to use for the virtual server instance.
+ If specified, `reservation_affinity.policy` must be `disabled`.
+ :param InstanceProfileIdentity profile: (optional) The
+ [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this
+ virtual server instance.
+ If unspecified, `bx2-2x8` will be used, but this default value is expected to
+ change in the future.
+ :param InstanceReservationAffinityPrototype reservation_affinity: (optional)
+ :param ResourceGroupIdentity resource_group: (optional)
+ :param int total_volume_bandwidth: (optional) The amount of bandwidth (in
+ megabits per second) allocated exclusively to instance storage volumes. An
+ increase in this value will result in a corresponding decrease to
+ `total_network_bandwidth`.
+ :param str user_data: (optional) [User
+ data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when
+ setting up the virtual server instance.
+ :param List[VolumeAttachmentPrototype] volume_attachments: (optional) The
+ additional volume attachments to create for the virtual server instance.
+ :param VPCIdentity vpc: (optional) The VPC this virtual server instance will
+ reside in.
+ If specified, it must match the VPC for the subnets of the instance network
+ attachments or instance network interfaces.
+ :param VolumeAttachmentPrototypeInstanceBySourceSnapshotContext
+ boot_volume_attachment: The boot volume attachment to create for the virtual
+ server instance.
+ :param ZoneIdentity zone: The zone this virtual server instance will reside in.
+ """
+
+ def __init__(
+ self,
+ boot_volume_attachment: 'VolumeAttachmentPrototypeInstanceBySourceSnapshotContext',
+ zone: 'ZoneIdentity',
+ *,
+ availability_policy: Optional['InstanceAvailabilityPolicyPrototype'] = None,
+ default_trusted_profile: Optional['InstanceDefaultTrustedProfilePrototype'] = None,
+ keys: Optional[List['KeyIdentity']] = None,
+ metadata_service: Optional['InstanceMetadataServicePrototype'] = None,
+ name: Optional[str] = None,
+ placement_target: Optional['InstancePlacementTargetPrototype'] = None,
+ profile: Optional['InstanceProfileIdentity'] = None,
+ reservation_affinity: Optional['InstanceReservationAffinityPrototype'] = None,
+ resource_group: Optional['ResourceGroupIdentity'] = None,
+ total_volume_bandwidth: Optional[int] = None,
+ user_data: Optional[str] = None,
+ volume_attachments: Optional[List['VolumeAttachmentPrototype']] = None,
+ vpc: Optional['VPCIdentity'] = None,
+ ) -> None:
+ """
+ Initialize a InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot object.
+
+ :param VolumeAttachmentPrototypeInstanceBySourceSnapshotContext
+ boot_volume_attachment: The boot volume attachment to create for the
+ virtual server instance.
+ :param ZoneIdentity zone: The zone this virtual server instance will reside
+ in.
+ :param InstanceAvailabilityPolicyPrototype availability_policy: (optional)
+ The availability policy to use for this virtual server instance.
+ :param InstanceDefaultTrustedProfilePrototype default_trusted_profile:
+ (optional) The default trusted profile configuration to use for this
+ virtual server instance
+ This property's value is used when provisioning the virtual server
+ instance, but not subsequently managed. Accordingly, it is reflected as an
+ [instance
+ initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
+ property.
+ :param List[KeyIdentity] keys: (optional) The public SSH keys for the
+ administrative user of the virtual server instance. Keys will be made
+ available to the virtual server instance as cloud-init vendor data. For
+ cloud-init enabled images, these keys will also be added as SSH authorized
+ keys for the administrative user.
+ For Windows images, the keys of type `rsa` must be specified, and one will
+ be selected to encrypt [the administrator
+ password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization).
+ Keys are optional for other images, but if no keys are specified, the
+ instance will be inaccessible unless the specified image provides another
+ means of access.
+ This property's value is used when provisioning the virtual server
+ instance, but not subsequently managed. Accordingly, it is reflected as an
+ [instance
+ initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
+ property.
+ :param InstanceMetadataServicePrototype metadata_service: (optional)
+ :param str name: (optional) The name for this instance template. The name
+ must not be used by another instance template in the region. If
+ unspecified, the name will be a hyphenated list of randomly-selected words.
+ :param InstancePlacementTargetPrototype placement_target: (optional) The
+ placement restrictions to use for the virtual server instance.
+ If specified, `reservation_affinity.policy` must be `disabled`.
+ :param InstanceProfileIdentity profile: (optional) The
+ [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for
+ this virtual server instance.
+ If unspecified, `bx2-2x8` will be used, but this default value is expected
+ to change in the future.
+ :param InstanceReservationAffinityPrototype reservation_affinity:
+ (optional)
+ :param ResourceGroupIdentity resource_group: (optional)
+ :param int total_volume_bandwidth: (optional) The amount of bandwidth (in
+ megabits per second) allocated exclusively to instance storage volumes. An
+ increase in this value will result in a corresponding decrease to
+ `total_network_bandwidth`.
+ :param str user_data: (optional) [User
+ data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available
+ when setting up the virtual server instance.
+ :param List[VolumeAttachmentPrototype] volume_attachments: (optional) The
+ additional volume attachments to create for the virtual server instance.
+ :param VPCIdentity vpc: (optional) The VPC this virtual server instance
+ will reside in.
+ If specified, it must match the VPC for the subnets of the instance network
+ attachments or instance network interfaces.
+ """
+ # pylint: disable=super-init-not-called
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkAttachment', 'InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkInterface'])
+ )
+ raise Exception(msg)
+
+
+class InstanceTemplatePrototypeInstanceTemplateBySourceTemplate(InstanceTemplatePrototype):
+ """
+ Create an instance template from an existing source instance template.
+ The `primary_network_attachment` and `network_attachments` properties may only be
+ specified if `primary_network_attachment` is specified in the source template.
+ The `primary_network_interface` and `network_interfaces` properties may only be
+ specified if `primary_network_interface` is specified in the source template.
+
+ :param InstanceAvailabilityPolicyPrototype availability_policy: (optional) The
+ availability policy to use for this virtual server instance.
+ :param InstanceDefaultTrustedProfilePrototype default_trusted_profile:
+ (optional) The default trusted profile configuration to use for this virtual
+ server instance
+ This property's value is used when provisioning the virtual server instance, but
+ not subsequently managed. Accordingly, it is reflected as an [instance
+ initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
+ property.
+ :param List[KeyIdentity] keys: (optional) The public SSH keys for the
+ administrative user of the virtual server instance. Keys will be made available
+ to the virtual server instance as cloud-init vendor data. For cloud-init enabled
+ images, these keys will also be added as SSH authorized keys for the
+ administrative user.
+ For Windows images, the keys of type `rsa` must be specified, and one will be
+ selected to encrypt [the administrator
+ password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys
+ are optional for other images, but if no keys are specified, the instance will
+ be inaccessible unless the specified image provides another means of access.
+ This property's value is used when provisioning the virtual server instance, but
+ not subsequently managed. Accordingly, it is reflected as an [instance
+ initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
+ property.
+ :param InstanceMetadataServicePrototype metadata_service: (optional)
+ :param str name: (optional) The name for this instance template. The name must
+ not be used by another instance template in the region. If unspecified, the name
+ will be a hyphenated list of randomly-selected words.
+ :param InstancePlacementTargetPrototype placement_target: (optional) The
+ placement restrictions to use for the virtual server instance.
+ If specified, `reservation_affinity.policy` must be `disabled`.
+ :param InstanceProfileIdentity profile: (optional) The
+ [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this
+ virtual server instance.
+ If unspecified, `bx2-2x8` will be used, but this default value is expected to
+ change in the future.
+ :param InstanceReservationAffinityPrototype reservation_affinity: (optional)
+ :param ResourceGroupIdentity resource_group: (optional)
+ :param int total_volume_bandwidth: (optional) The amount of bandwidth (in
+ megabits per second) allocated exclusively to instance storage volumes. An
+ increase in this value will result in a corresponding decrease to
+ `total_network_bandwidth`.
+ :param str user_data: (optional) [User
+ data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when
+ setting up the virtual server instance.
+ :param List[VolumeAttachmentPrototype] volume_attachments: (optional) The
+ additional volume attachments to create for the virtual server instance.
+ :param VPCIdentity vpc: (optional) The VPC this virtual server instance will
+ reside in.
+ If specified, it must match the VPC for the subnets of the instance network
+ attachments or instance network interfaces.
+ :param VolumeAttachmentPrototypeInstanceByImageContext boot_volume_attachment:
+ (optional) The boot volume attachment to create for the virtual server instance.
+ :param InstanceCatalogOfferingPrototype catalog_offering: (optional) The
+ [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user)
+ offering version to use when provisioning this virtual server instance.
+ If an offering is specified, the latest version of that offering will be used.
+ The specified offering or offering version may be in a different account,
+ subject to
+ IAM policies.
+ If specified, `image` must not be specified, and `source_template` must not have
+ `image` specified.
+ :param ImageIdentity image: (optional) The image to use when provisioning the
+ virtual server instance.
+ :param List[InstanceNetworkAttachmentPrototype] network_attachments: (optional)
+ The additional network attachments to create for the virtual server instance.
+ :param List[NetworkInterfacePrototype] network_interfaces: (optional) The
+ additional instance network interfaces to create.
+ :param InstanceNetworkAttachmentPrototype primary_network_attachment: (optional)
+ The primary network attachment to create for the virtual server instance.
+ :param NetworkInterfacePrototype primary_network_interface: (optional) The
+ primary instance network interface to create.
+ :param InstanceTemplateIdentity source_template: The template to create this
+ virtual server instance from.
+ :param ZoneIdentity zone: (optional) The zone this virtual server instance will
+ reside in.
+ """
+
+ def __init__(
+ self,
+ source_template: 'InstanceTemplateIdentity',
+ *,
+ availability_policy: Optional['InstanceAvailabilityPolicyPrototype'] = None,
+ default_trusted_profile: Optional['InstanceDefaultTrustedProfilePrototype'] = None,
+ keys: Optional[List['KeyIdentity']] = None,
+ metadata_service: Optional['InstanceMetadataServicePrototype'] = None,
+ name: Optional[str] = None,
+ placement_target: Optional['InstancePlacementTargetPrototype'] = None,
+ profile: Optional['InstanceProfileIdentity'] = None,
+ reservation_affinity: Optional['InstanceReservationAffinityPrototype'] = None,
+ resource_group: Optional['ResourceGroupIdentity'] = None,
+ total_volume_bandwidth: Optional[int] = None,
+ user_data: Optional[str] = None,
+ volume_attachments: Optional[List['VolumeAttachmentPrototype']] = None,
+ vpc: Optional['VPCIdentity'] = None,
+ boot_volume_attachment: Optional['VolumeAttachmentPrototypeInstanceByImageContext'] = None,
+ catalog_offering: Optional['InstanceCatalogOfferingPrototype'] = None,
+ image: Optional['ImageIdentity'] = None,
+ network_attachments: Optional[List['InstanceNetworkAttachmentPrototype']] = None,
+ network_interfaces: Optional[List['NetworkInterfacePrototype']] = None,
+ primary_network_attachment: Optional['InstanceNetworkAttachmentPrototype'] = None,
+ primary_network_interface: Optional['NetworkInterfacePrototype'] = None,
+ zone: Optional['ZoneIdentity'] = None,
+ ) -> None:
+ """
+ Initialize a InstanceTemplatePrototypeInstanceTemplateBySourceTemplate object.
+
+ :param InstanceTemplateIdentity source_template: The template to create
+ this virtual server instance from.
+ :param InstanceAvailabilityPolicyPrototype availability_policy: (optional)
+ The availability policy to use for this virtual server instance.
+ :param InstanceDefaultTrustedProfilePrototype default_trusted_profile:
+ (optional) The default trusted profile configuration to use for this
+ virtual server instance
+ This property's value is used when provisioning the virtual server
+ instance, but not subsequently managed. Accordingly, it is reflected as an
+ [instance
+ initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
+ property.
+ :param List[KeyIdentity] keys: (optional) The public SSH keys for the
+ administrative user of the virtual server instance. Keys will be made
+ available to the virtual server instance as cloud-init vendor data. For
+ cloud-init enabled images, these keys will also be added as SSH authorized
+ keys for the administrative user.
+ For Windows images, the keys of type `rsa` must be specified, and one will
+ be selected to encrypt [the administrator
+ password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization).
+ Keys are optional for other images, but if no keys are specified, the
+ instance will be inaccessible unless the specified image provides another
+ means of access.
+ This property's value is used when provisioning the virtual server
+ instance, but not subsequently managed. Accordingly, it is reflected as an
+ [instance
+ initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
+ property.
+ :param InstanceMetadataServicePrototype metadata_service: (optional)
+ :param str name: (optional) The name for this instance template. The name
+ must not be used by another instance template in the region. If
+ unspecified, the name will be a hyphenated list of randomly-selected words.
+ :param InstancePlacementTargetPrototype placement_target: (optional) The
+ placement restrictions to use for the virtual server instance.
+ If specified, `reservation_affinity.policy` must be `disabled`.
+ :param InstanceProfileIdentity profile: (optional) The
+ [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for
+ this virtual server instance.
+ If unspecified, `bx2-2x8` will be used, but this default value is expected
+ to change in the future.
+ :param InstanceReservationAffinityPrototype reservation_affinity:
+ (optional)
+ :param ResourceGroupIdentity resource_group: (optional)
+ :param int total_volume_bandwidth: (optional) The amount of bandwidth (in
+ megabits per second) allocated exclusively to instance storage volumes. An
+ increase in this value will result in a corresponding decrease to
+ `total_network_bandwidth`.
+ :param str user_data: (optional) [User
+ data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available
+ when setting up the virtual server instance.
+ :param List[VolumeAttachmentPrototype] volume_attachments: (optional) The
+ additional volume attachments to create for the virtual server instance.
+ :param VPCIdentity vpc: (optional) The VPC this virtual server instance
+ will reside in.
+ If specified, it must match the VPC for the subnets of the instance network
+ attachments or instance network interfaces.
+ :param VolumeAttachmentPrototypeInstanceByImageContext
+ boot_volume_attachment: (optional) The boot volume attachment to create for
+ the virtual server instance.
+ :param InstanceCatalogOfferingPrototype catalog_offering: (optional) The
+ [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user)
+ offering version to use when provisioning this virtual server instance.
+ If an offering is specified, the latest version of that offering will be
+ used.
+ The specified offering or offering version may be in a different account,
+ subject to
+ IAM policies.
+ If specified, `image` must not be specified, and `source_template` must not
+ have
+ `image` specified.
+ :param ImageIdentity image: (optional) The image to use when provisioning
+ the virtual server instance.
+ :param List[InstanceNetworkAttachmentPrototype] network_attachments:
+ (optional) The additional network attachments to create for the virtual
+ server instance.
+ :param List[NetworkInterfacePrototype] network_interfaces: (optional) The
+ additional instance network interfaces to create.
+ :param InstanceNetworkAttachmentPrototype primary_network_attachment:
+ (optional) The primary network attachment to create for the virtual server
+ instance.
+ :param NetworkInterfacePrototype primary_network_interface: (optional) The
+ primary instance network interface to create.
+ :param ZoneIdentity zone: (optional) The zone this virtual server instance
+ will reside in.
+ """
+ # pylint: disable=super-init-not-called
+ self.availability_policy = availability_policy
+ self.default_trusted_profile = default_trusted_profile
+ self.keys = keys
+ self.metadata_service = metadata_service
+ self.name = name
+ self.placement_target = placement_target
+ self.profile = profile
+ self.reservation_affinity = reservation_affinity
+ self.resource_group = resource_group
+ self.total_volume_bandwidth = total_volume_bandwidth
+ self.user_data = user_data
+ self.volume_attachments = volume_attachments
+ self.vpc = vpc
+ self.boot_volume_attachment = boot_volume_attachment
+ self.catalog_offering = catalog_offering
+ self.image = image
+ self.network_attachments = network_attachments
+ self.network_interfaces = network_interfaces
+ self.primary_network_attachment = primary_network_attachment
+ self.primary_network_interface = primary_network_interface
+ self.source_template = source_template
+ self.zone = zone
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'InstanceTemplatePrototypeInstanceTemplateBySourceTemplate':
+ """Initialize a InstanceTemplatePrototypeInstanceTemplateBySourceTemplate object from a json dictionary."""
+ args = {}
+ if (availability_policy := _dict.get('availability_policy')) is not None:
+ args['availability_policy'] = InstanceAvailabilityPolicyPrototype.from_dict(availability_policy)
+ if (default_trusted_profile := _dict.get('default_trusted_profile')) is not None:
+ args['default_trusted_profile'] = InstanceDefaultTrustedProfilePrototype.from_dict(default_trusted_profile)
+ if (keys := _dict.get('keys')) is not None:
+ args['keys'] = keys
+ if (metadata_service := _dict.get('metadata_service')) is not None:
+ args['metadata_service'] = InstanceMetadataServicePrototype.from_dict(metadata_service)
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ if (placement_target := _dict.get('placement_target')) is not None:
+ args['placement_target'] = placement_target
+ if (profile := _dict.get('profile')) is not None:
+ args['profile'] = profile
+ if (reservation_affinity := _dict.get('reservation_affinity')) is not None:
+ args['reservation_affinity'] = InstanceReservationAffinityPrototype.from_dict(reservation_affinity)
+ if (resource_group := _dict.get('resource_group')) is not None:
+ args['resource_group'] = resource_group
+ if (total_volume_bandwidth := _dict.get('total_volume_bandwidth')) is not None:
+ args['total_volume_bandwidth'] = total_volume_bandwidth
+ if (user_data := _dict.get('user_data')) is not None:
+ args['user_data'] = user_data
+ if (volume_attachments := _dict.get('volume_attachments')) is not None:
+ args['volume_attachments'] = [VolumeAttachmentPrototype.from_dict(v) for v in volume_attachments]
+ if (vpc := _dict.get('vpc')) is not None:
+ args['vpc'] = vpc
+ if (boot_volume_attachment := _dict.get('boot_volume_attachment')) is not None:
+ args['boot_volume_attachment'] = VolumeAttachmentPrototypeInstanceByImageContext.from_dict(boot_volume_attachment)
+ if (catalog_offering := _dict.get('catalog_offering')) is not None:
+ args['catalog_offering'] = catalog_offering
+ if (image := _dict.get('image')) is not None:
+ args['image'] = image
+ if (network_attachments := _dict.get('network_attachments')) is not None:
+ args['network_attachments'] = [InstanceNetworkAttachmentPrototype.from_dict(v) for v in network_attachments]
+ if (network_interfaces := _dict.get('network_interfaces')) is not None:
+ args['network_interfaces'] = [NetworkInterfacePrototype.from_dict(v) for v in network_interfaces]
+ if (primary_network_attachment := _dict.get('primary_network_attachment')) is not None:
+ args['primary_network_attachment'] = InstanceNetworkAttachmentPrototype.from_dict(primary_network_attachment)
+ if (primary_network_interface := _dict.get('primary_network_interface')) is not None:
+ args['primary_network_interface'] = NetworkInterfacePrototype.from_dict(primary_network_interface)
+ if (source_template := _dict.get('source_template')) is not None:
+ args['source_template'] = source_template
+ else:
+ raise ValueError('Required property \'source_template\' not present in InstanceTemplatePrototypeInstanceTemplateBySourceTemplate JSON')
+ if (zone := _dict.get('zone')) is not None:
+ args['zone'] = zone
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a InstanceTemplatePrototypeInstanceTemplateBySourceTemplate object from a json dictionary."""
+ return cls.from_dict(_dict)
+
+ def to_dict(self) -> Dict:
+ """Return a json dictionary representing this model."""
+ _dict = {}
+ if hasattr(self, 'availability_policy') and self.availability_policy is not None:
+ if isinstance(self.availability_policy, dict):
+ _dict['availability_policy'] = self.availability_policy
+ else:
+ _dict['availability_policy'] = self.availability_policy.to_dict()
+ if hasattr(self, 'default_trusted_profile') and self.default_trusted_profile is not None:
+ if isinstance(self.default_trusted_profile, dict):
+ _dict['default_trusted_profile'] = self.default_trusted_profile
+ else:
+ _dict['default_trusted_profile'] = self.default_trusted_profile.to_dict()
+ if hasattr(self, 'keys') and self.keys is not None:
+ keys_list = []
+ for v in self.keys:
+ if isinstance(v, dict):
+ keys_list.append(v)
+ else:
+ keys_list.append(v.to_dict())
+ _dict['keys'] = keys_list
+ if hasattr(self, 'metadata_service') and self.metadata_service is not None:
+ if isinstance(self.metadata_service, dict):
+ _dict['metadata_service'] = self.metadata_service
+ else:
+ _dict['metadata_service'] = self.metadata_service.to_dict()
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ if hasattr(self, 'placement_target') and self.placement_target is not None:
+ if isinstance(self.placement_target, dict):
+ _dict['placement_target'] = self.placement_target
+ else:
+ _dict['placement_target'] = self.placement_target.to_dict()
+ if hasattr(self, 'profile') and self.profile is not None:
+ if isinstance(self.profile, dict):
+ _dict['profile'] = self.profile
+ else:
+ _dict['profile'] = self.profile.to_dict()
+ if hasattr(self, 'reservation_affinity') and self.reservation_affinity is not None:
+ if isinstance(self.reservation_affinity, dict):
+ _dict['reservation_affinity'] = self.reservation_affinity
+ else:
+ _dict['reservation_affinity'] = self.reservation_affinity.to_dict()
+ if hasattr(self, 'resource_group') and self.resource_group is not None:
+ if isinstance(self.resource_group, dict):
+ _dict['resource_group'] = self.resource_group
+ else:
+ _dict['resource_group'] = self.resource_group.to_dict()
+ if hasattr(self, 'total_volume_bandwidth') and self.total_volume_bandwidth is not None:
+ _dict['total_volume_bandwidth'] = self.total_volume_bandwidth
+ if hasattr(self, 'user_data') and self.user_data is not None:
+ _dict['user_data'] = self.user_data
+ if hasattr(self, 'volume_attachments') and self.volume_attachments is not None:
+ volume_attachments_list = []
+ for v in self.volume_attachments:
+ if isinstance(v, dict):
+ volume_attachments_list.append(v)
+ else:
+ volume_attachments_list.append(v.to_dict())
+ _dict['volume_attachments'] = volume_attachments_list
+ if hasattr(self, 'vpc') and self.vpc is not None:
+ if isinstance(self.vpc, dict):
+ _dict['vpc'] = self.vpc
+ else:
+ _dict['vpc'] = self.vpc.to_dict()
+ if hasattr(self, 'boot_volume_attachment') and self.boot_volume_attachment is not None:
+ if isinstance(self.boot_volume_attachment, dict):
+ _dict['boot_volume_attachment'] = self.boot_volume_attachment
+ else:
+ _dict['boot_volume_attachment'] = self.boot_volume_attachment.to_dict()
+ if hasattr(self, 'catalog_offering') and self.catalog_offering is not None:
+ if isinstance(self.catalog_offering, dict):
+ _dict['catalog_offering'] = self.catalog_offering
+ else:
+ _dict['catalog_offering'] = self.catalog_offering.to_dict()
+ if hasattr(self, 'image') and self.image is not None:
+ if isinstance(self.image, dict):
+ _dict['image'] = self.image
+ else:
+ _dict['image'] = self.image.to_dict()
+ if hasattr(self, 'network_attachments') and self.network_attachments is not None:
+ network_attachments_list = []
+ for v in self.network_attachments:
+ if isinstance(v, dict):
+ network_attachments_list.append(v)
+ else:
+ network_attachments_list.append(v.to_dict())
+ _dict['network_attachments'] = network_attachments_list
+ if hasattr(self, 'network_interfaces') and self.network_interfaces is not None:
+ network_interfaces_list = []
+ for v in self.network_interfaces:
+ if isinstance(v, dict):
+ network_interfaces_list.append(v)
+ else:
+ network_interfaces_list.append(v.to_dict())
+ _dict['network_interfaces'] = network_interfaces_list
+ if hasattr(self, 'primary_network_attachment') and self.primary_network_attachment is not None:
+ if isinstance(self.primary_network_attachment, dict):
+ _dict['primary_network_attachment'] = self.primary_network_attachment
+ else:
+ _dict['primary_network_attachment'] = self.primary_network_attachment.to_dict()
+ if hasattr(self, 'primary_network_interface') and self.primary_network_interface is not None:
+ if isinstance(self.primary_network_interface, dict):
+ _dict['primary_network_interface'] = self.primary_network_interface
+ else:
+ _dict['primary_network_interface'] = self.primary_network_interface.to_dict()
+ if hasattr(self, 'source_template') and self.source_template is not None:
+ if isinstance(self.source_template, dict):
+ _dict['source_template'] = self.source_template
+ else:
+ _dict['source_template'] = self.source_template.to_dict()
+ if hasattr(self, 'zone') and self.zone is not None:
+ if isinstance(self.zone, dict):
+ _dict['zone'] = self.zone
+ else:
+ _dict['zone'] = self.zone.to_dict()
+ return _dict
+
+ def _to_dict(self):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
+
+ def __str__(self) -> str:
+ """Return a `str` version of this InstanceTemplatePrototypeInstanceTemplateBySourceTemplate object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'InstanceTemplatePrototypeInstanceTemplateBySourceTemplate') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'InstanceTemplatePrototypeInstanceTemplateBySourceTemplate') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+
+class InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext(InstanceTemplate):
+ """
+ Create an instance by using a catalog offering.
+
+ :param InstanceAvailabilityPolicyPrototype availability_policy: (optional) The
+ availability policy to use for this virtual server instance.
+ :param datetime created_at: The date and time that the instance template was
+ created.
+ :param str crn: The CRN for this instance template.
+ :param InstanceDefaultTrustedProfilePrototype default_trusted_profile:
+ (optional) The default trusted profile configuration to use for this virtual
+ server instance
+ This property's value is used when provisioning the virtual server instance, but
+ not subsequently managed. Accordingly, it is reflected as an [instance
+ initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
+ property.
+ :param str href: The URL for this instance template.
+ :param str id: The unique identifier 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, the keys of type `rsa` must be specified, and one will be
+ selected to encrypt [the administrator
+ password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys
+ are optional for other images, but if no keys are specified, the instance will
+ be inaccessible unless the specified image provides another means of access.
+ This property's value is used when provisioning the virtual server instance, but
+ not subsequently managed. Accordingly, it is reflected as an [instance
+ initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
+ property.
+ :param InstanceMetadataServicePrototype metadata_service: (optional)
+ :param str name: The name for this instance template. The name is unique across
+ all instance templates in the region.
+ :param InstancePlacementTargetPrototype placement_target: (optional) The
+ placement restrictions to use for the virtual server instance.
+ If specified, `reservation_affinity.policy` must be `disabled`.
+ :param InstanceProfileIdentity profile: (optional) The
+ [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this
+ virtual server instance.
+ If unspecified, `bx2-2x8` will be used, but this default value is expected to
+ change in the future.
+ :param InstanceReservationAffinityPrototype reservation_affinity: (optional)
+ :param ResourceGroupReference resource_group: The resource group for this
+ instance template.
+ :param int total_volume_bandwidth: (optional) The amount of bandwidth (in
+ megabits per second) allocated exclusively to instance storage volumes. An
+ increase in this value will result in a corresponding decrease to
+ `total_network_bandwidth`.
+ :param str user_data: (optional) [User
+ data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when
+ setting up the virtual server instance.
+ :param List[VolumeAttachmentPrototype] volume_attachments: (optional) The
+ additional volume attachments to create for the virtual server instance.
+ :param VPCIdentity vpc: (optional) The VPC this virtual server instance will
+ reside in.
+ If specified, it must match the VPC for the subnets of the instance network
+ attachments or instance network interfaces.
+ :param VolumeAttachmentPrototypeInstanceByImageContext boot_volume_attachment:
+ (optional) The boot volume attachment to create for the virtual server instance.
+ :param InstanceCatalogOfferingPrototype catalog_offering: The
+ [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user)
+ offering
+ or offering version to use when provisioning this virtual server instance.
+ If an offering is specified, the latest version of that offering will be used.
+ The specified offering or offering version may be in a different account in the
+ same
+ [enterprise](https://cloud.ibm.com/docs/account?topic=account-what-is-enterprise),
+ subject
+ to IAM policies.
+ :param ZoneIdentity zone: The zone this virtual server instance will reside in.
+ """
+
+ def __init__(
+ self,
+ created_at: datetime,
+ crn: str,
+ href: str,
+ id: str,
+ name: str,
+ resource_group: 'ResourceGroupReference',
+ catalog_offering: 'InstanceCatalogOfferingPrototype',
+ zone: 'ZoneIdentity',
+ *,
+ availability_policy: Optional['InstanceAvailabilityPolicyPrototype'] = None,
+ default_trusted_profile: Optional['InstanceDefaultTrustedProfilePrototype'] = None,
+ keys: Optional[List['KeyIdentity']] = None,
+ metadata_service: Optional['InstanceMetadataServicePrototype'] = None,
+ placement_target: Optional['InstancePlacementTargetPrototype'] = None,
+ profile: Optional['InstanceProfileIdentity'] = None,
+ reservation_affinity: Optional['InstanceReservationAffinityPrototype'] = None,
+ total_volume_bandwidth: Optional[int] = None,
+ user_data: Optional[str] = None,
+ volume_attachments: Optional[List['VolumeAttachmentPrototype']] = None,
+ vpc: Optional['VPCIdentity'] = None,
+ boot_volume_attachment: Optional['VolumeAttachmentPrototypeInstanceByImageContext'] = None,
+ ) -> None:
+ """
+ Initialize a InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext object.
+
+ :param datetime created_at: The date and time that the instance template
+ was created.
+ :param str crn: The CRN for this instance template.
+ :param str href: The URL for this instance template.
+ :param str id: The unique identifier for this instance template.
+ :param str name: The name for this instance template. The name is unique
+ across all instance templates in the region.
+ :param ResourceGroupReference resource_group: The resource group for this
+ instance template.
+ :param InstanceCatalogOfferingPrototype catalog_offering: The
+ [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user)
+ offering
+ or offering version to use when provisioning this virtual server instance.
+ If an offering is specified, the latest version of that offering will be
+ used.
+ The specified offering or offering version may be in a different account in
+ the same
+ [enterprise](https://cloud.ibm.com/docs/account?topic=account-what-is-enterprise),
+ subject
+ to IAM policies.
+ :param ZoneIdentity zone: The zone this virtual server instance will reside
+ in.
+ :param InstanceAvailabilityPolicyPrototype availability_policy: (optional)
+ The availability policy to use for this virtual server instance.
+ :param InstanceDefaultTrustedProfilePrototype default_trusted_profile:
+ (optional) The default trusted profile configuration to use for this
+ virtual server instance
+ This property's value is used when provisioning the virtual server
+ instance, but not subsequently managed. Accordingly, it is reflected as an
+ [instance
+ initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
+ property.
+ :param List[KeyIdentity] keys: (optional) The public SSH keys for the
+ administrative user of the virtual server instance. Keys will be made
+ available to the virtual server instance as cloud-init vendor data. For
+ cloud-init enabled images, these keys will also be added as SSH authorized
+ keys for the administrative user.
+ For Windows images, the keys of type `rsa` must be specified, and one will
+ be selected to encrypt [the administrator
+ password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization).
+ Keys are optional for other images, but if no keys are specified, the
+ instance will be inaccessible unless the specified image provides another
+ means of access.
+ This property's value is used when provisioning the virtual server
+ instance, but not subsequently managed. Accordingly, it is reflected as an
+ [instance
+ initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
+ property.
+ :param InstanceMetadataServicePrototype metadata_service: (optional)
+ :param InstancePlacementTargetPrototype placement_target: (optional) The
+ placement restrictions to use for the virtual server instance.
+ If specified, `reservation_affinity.policy` must be `disabled`.
+ :param InstanceProfileIdentity profile: (optional) The
+ [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for
+ this virtual server instance.
+ If unspecified, `bx2-2x8` will be used, but this default value is expected
+ to change in the future.
+ :param InstanceReservationAffinityPrototype reservation_affinity:
+ (optional)
+ :param int total_volume_bandwidth: (optional) The amount of bandwidth (in
+ megabits per second) allocated exclusively to instance storage volumes. An
+ increase in this value will result in a corresponding decrease to
+ `total_network_bandwidth`.
+ :param str user_data: (optional) [User
+ data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available
+ when setting up the virtual server instance.
+ :param List[VolumeAttachmentPrototype] volume_attachments: (optional) The
+ additional volume attachments to create for the virtual server instance.
+ :param VPCIdentity vpc: (optional) The VPC this virtual server instance
+ will reside in.
+ If specified, it must match the VPC for the subnets of the instance network
+ attachments or instance network interfaces.
+ :param VolumeAttachmentPrototypeInstanceByImageContext
+ boot_volume_attachment: (optional) The boot volume attachment to create for
+ the virtual server instance.
+ """
+ # pylint: disable=super-init-not-called
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkAttachment', 'InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkInterface'])
+ )
+ raise Exception(msg)
+
+
+class InstanceTemplateInstanceByImageInstanceTemplateContext(InstanceTemplate):
+ """
+ Create an instance by using an image.
+
+ :param InstanceAvailabilityPolicyPrototype availability_policy: (optional) The
+ availability policy to use for this virtual server instance.
+ :param datetime created_at: The date and time that the instance template was
+ created.
+ :param str crn: The CRN for this instance template.
+ :param InstanceDefaultTrustedProfilePrototype default_trusted_profile:
+ (optional) The default trusted profile configuration to use for this virtual
+ server instance
+ This property's value is used when provisioning the virtual server instance, but
+ not subsequently managed. Accordingly, it is reflected as an [instance
+ initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
+ property.
+ :param str href: The URL for this instance template.
+ :param str id: The unique identifier 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, the keys of type `rsa` must be specified, and one will be
+ selected to encrypt [the administrator
+ password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys
+ are optional for other images, but if no keys are specified, the instance will
+ be inaccessible unless the specified image provides another means of access.
+ This property's value is used when provisioning the virtual server instance, but
+ not subsequently managed. Accordingly, it is reflected as an [instance
+ initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
+ property.
+ :param InstanceMetadataServicePrototype metadata_service: (optional)
+ :param str name: The name for this instance template. The name is unique across
+ all instance templates in the region.
+ :param InstancePlacementTargetPrototype placement_target: (optional) The
+ placement restrictions to use for the virtual server instance.
+ If specified, `reservation_affinity.policy` must be `disabled`.
+ :param InstanceProfileIdentity profile: (optional) The
+ [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this
+ virtual server instance.
+ If unspecified, `bx2-2x8` will be used, but this default value is expected to
+ change in the future.
+ :param InstanceReservationAffinityPrototype reservation_affinity: (optional)
+ :param ResourceGroupReference resource_group: The resource group for this
+ instance template.
+ :param int total_volume_bandwidth: (optional) The amount of bandwidth (in
+ megabits per second) allocated exclusively to instance storage volumes. An
+ increase in this value will result in a corresponding decrease to
+ `total_network_bandwidth`.
+ :param str user_data: (optional) [User
+ data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when
+ setting up the virtual server instance.
+ :param List[VolumeAttachmentPrototype] volume_attachments: (optional) The
+ additional volume attachments to create for the virtual server instance.
+ :param VPCIdentity vpc: (optional) The VPC this virtual server instance will
+ reside in.
+ If specified, it must match the VPC for the subnets of the instance network
+ attachments or instance network interfaces.
+ :param VolumeAttachmentPrototypeInstanceByImageContext boot_volume_attachment:
+ (optional) The boot volume attachment to create for the virtual server instance.
+ :param ImageIdentity image: The image to use when provisioning the virtual
+ server instance.
+ :param ZoneIdentity zone: The zone this virtual server instance will reside in.
+ """
+
+ def __init__(
+ self,
+ created_at: datetime,
+ crn: str,
+ href: str,
+ id: str,
+ name: str,
+ resource_group: 'ResourceGroupReference',
+ image: 'ImageIdentity',
+ zone: 'ZoneIdentity',
+ *,
+ availability_policy: Optional['InstanceAvailabilityPolicyPrototype'] = None,
+ default_trusted_profile: Optional['InstanceDefaultTrustedProfilePrototype'] = None,
+ keys: Optional[List['KeyIdentity']] = None,
+ metadata_service: Optional['InstanceMetadataServicePrototype'] = None,
+ placement_target: Optional['InstancePlacementTargetPrototype'] = None,
+ profile: Optional['InstanceProfileIdentity'] = None,
+ reservation_affinity: Optional['InstanceReservationAffinityPrototype'] = None,
+ total_volume_bandwidth: Optional[int] = None,
+ user_data: Optional[str] = None,
+ volume_attachments: Optional[List['VolumeAttachmentPrototype']] = None,
+ vpc: Optional['VPCIdentity'] = None,
+ boot_volume_attachment: Optional['VolumeAttachmentPrototypeInstanceByImageContext'] = None,
+ ) -> None:
+ """
+ Initialize a InstanceTemplateInstanceByImageInstanceTemplateContext object.
+
+ :param datetime created_at: The date and time that the instance template
+ was created.
+ :param str crn: The CRN for this instance template.
+ :param str href: The URL for this instance template.
+ :param str id: The unique identifier for this instance template.
+ :param str name: The name for this instance template. The name is unique
+ across all instance templates in the region.
+ :param ResourceGroupReference resource_group: The resource group for this
+ instance template.
+ :param ImageIdentity image: The image to use when provisioning the virtual
+ server instance.
+ :param ZoneIdentity zone: The zone this virtual server instance will reside
+ in.
+ :param InstanceAvailabilityPolicyPrototype availability_policy: (optional)
+ The availability policy to use for this virtual server instance.
+ :param InstanceDefaultTrustedProfilePrototype default_trusted_profile:
+ (optional) The default trusted profile configuration to use for this
+ virtual server instance
+ This property's value is used when provisioning the virtual server
+ instance, but not subsequently managed. Accordingly, it is reflected as an
+ [instance
+ initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
+ property.
+ :param List[KeyIdentity] keys: (optional) The public SSH keys for the
+ administrative user of the virtual server instance. Keys will be made
+ available to the virtual server instance as cloud-init vendor data. For
+ cloud-init enabled images, these keys will also be added as SSH authorized
+ keys for the administrative user.
+ For Windows images, the keys of type `rsa` must be specified, and one will
+ be selected to encrypt [the administrator
+ password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization).
+ Keys are optional for other images, but if no keys are specified, the
+ instance will be inaccessible unless the specified image provides another
+ means of access.
+ This property's value is used when provisioning the virtual server
+ instance, but not subsequently managed. Accordingly, it is reflected as an
+ [instance
+ initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
+ property.
+ :param InstanceMetadataServicePrototype metadata_service: (optional)
+ :param InstancePlacementTargetPrototype placement_target: (optional) The
+ placement restrictions to use for the virtual server instance.
+ If specified, `reservation_affinity.policy` must be `disabled`.
+ :param InstanceProfileIdentity profile: (optional) The
+ [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for
+ this virtual server instance.
+ If unspecified, `bx2-2x8` will be used, but this default value is expected
+ to change in the future.
+ :param InstanceReservationAffinityPrototype reservation_affinity:
+ (optional)
+ :param int total_volume_bandwidth: (optional) The amount of bandwidth (in
+ megabits per second) allocated exclusively to instance storage volumes. An
+ increase in this value will result in a corresponding decrease to
+ `total_network_bandwidth`.
+ :param str user_data: (optional) [User
+ data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available
+ when setting up the virtual server instance.
+ :param List[VolumeAttachmentPrototype] volume_attachments: (optional) The
+ additional volume attachments to create for the virtual server instance.
+ :param VPCIdentity vpc: (optional) The VPC this virtual server instance
+ will reside in.
+ If specified, it must match the VPC for the subnets of the instance network
+ attachments or instance network interfaces.
+ :param VolumeAttachmentPrototypeInstanceByImageContext
+ boot_volume_attachment: (optional) The boot volume attachment to create for
+ the virtual server instance.
+ """
+ # pylint: disable=super-init-not-called
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkAttachment', 'InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkInterface'])
+ )
+ raise Exception(msg)
+
+
+class InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext(InstanceTemplate):
+ """
+ Create an instance by using a snapshot.
+
+ :param InstanceAvailabilityPolicyPrototype availability_policy: (optional) The
+ availability policy to use for this virtual server instance.
+ :param datetime created_at: The date and time that the instance template was
+ created.
+ :param str crn: The CRN for this instance template.
+ :param InstanceDefaultTrustedProfilePrototype default_trusted_profile:
+ (optional) The default trusted profile configuration to use for this virtual
+ server instance
+ This property's value is used when provisioning the virtual server instance, but
+ not subsequently managed. Accordingly, it is reflected as an [instance
+ initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
+ property.
+ :param str href: The URL for this instance template.
+ :param str id: The unique identifier 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, the keys of type `rsa` must be specified, and one will be
+ selected to encrypt [the administrator
+ password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys
+ are optional for other images, but if no keys are specified, the instance will
+ be inaccessible unless the specified image provides another means of access.
+ This property's value is used when provisioning the virtual server instance, but
+ not subsequently managed. Accordingly, it is reflected as an [instance
+ initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
+ property.
+ :param InstanceMetadataServicePrototype metadata_service: (optional)
+ :param str name: The name for this instance template. The name is unique across
+ all instance templates in the region.
+ :param InstancePlacementTargetPrototype placement_target: (optional) The
+ placement restrictions to use for the virtual server instance.
+ If specified, `reservation_affinity.policy` must be `disabled`.
+ :param InstanceProfileIdentity profile: (optional) The
+ [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this
+ virtual server instance.
+ If unspecified, `bx2-2x8` will be used, but this default value is expected to
+ change in the future.
+ :param InstanceReservationAffinityPrototype reservation_affinity: (optional)
+ :param ResourceGroupReference resource_group: The resource group for this
+ instance template.
+ :param int total_volume_bandwidth: (optional) The amount of bandwidth (in
+ megabits per second) allocated exclusively to instance storage volumes. An
+ increase in this value will result in a corresponding decrease to
+ `total_network_bandwidth`.
+ :param str user_data: (optional) [User
+ data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when
+ setting up the virtual server instance.
+ :param List[VolumeAttachmentPrototype] volume_attachments: (optional) The
+ additional volume attachments to create for the virtual server instance.
+ :param VPCIdentity vpc: (optional) The VPC this virtual server instance will
+ reside in.
+ If specified, it must match the VPC for the subnets of the instance network
+ attachments or instance network interfaces.
+ :param VolumeAttachmentPrototypeInstanceBySourceSnapshotContext
+ boot_volume_attachment: The boot volume attachment to create for the virtual
+ server instance.
+ :param List[InstanceNetworkAttachmentPrototype] network_attachments: (optional)
+ The additional network attachments to create for the virtual server instance.
+ :param List[NetworkInterfacePrototype] network_interfaces: (optional) The
+ additional instance network interfaces to create.
+ :param InstanceNetworkAttachmentPrototype primary_network_attachment: (optional)
+ The primary network attachment to create for the virtual server instance.
+ :param ZoneIdentity zone: The zone this virtual server instance will reside in.
+ """
+
+ def __init__(
+ self,
+ created_at: datetime,
+ crn: str,
+ href: str,
+ id: str,
+ name: str,
+ resource_group: 'ResourceGroupReference',
+ boot_volume_attachment: 'VolumeAttachmentPrototypeInstanceBySourceSnapshotContext',
+ zone: 'ZoneIdentity',
+ *,
+ availability_policy: Optional['InstanceAvailabilityPolicyPrototype'] = None,
+ default_trusted_profile: Optional['InstanceDefaultTrustedProfilePrototype'] = None,
+ keys: Optional[List['KeyIdentity']] = None,
+ metadata_service: Optional['InstanceMetadataServicePrototype'] = None,
+ placement_target: Optional['InstancePlacementTargetPrototype'] = None,
+ profile: Optional['InstanceProfileIdentity'] = None,
+ reservation_affinity: Optional['InstanceReservationAffinityPrototype'] = None,
+ total_volume_bandwidth: Optional[int] = None,
+ user_data: Optional[str] = None,
+ volume_attachments: Optional[List['VolumeAttachmentPrototype']] = None,
+ vpc: Optional['VPCIdentity'] = None,
+ network_attachments: Optional[List['InstanceNetworkAttachmentPrototype']] = None,
+ network_interfaces: Optional[List['NetworkInterfacePrototype']] = None,
+ primary_network_attachment: Optional['InstanceNetworkAttachmentPrototype'] = None,
+ ) -> None:
+ """
+ Initialize a InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext object.
+
+ :param datetime created_at: The date and time that the instance template
+ was created.
+ :param str crn: The CRN for this instance template.
+ :param str href: The URL for this instance template.
+ :param str id: The unique identifier for this instance template.
+ :param str name: The name for this instance template. The name is unique
+ across all instance templates in the region.
+ :param ResourceGroupReference resource_group: The resource group for this
+ instance template.
+ :param VolumeAttachmentPrototypeInstanceBySourceSnapshotContext
+ boot_volume_attachment: The boot volume attachment to create for the
+ virtual server instance.
+ :param ZoneIdentity zone: The zone this virtual server instance will reside
+ in.
+ :param InstanceAvailabilityPolicyPrototype availability_policy: (optional)
+ The availability policy to use for this virtual server instance.
+ :param InstanceDefaultTrustedProfilePrototype default_trusted_profile:
+ (optional) The default trusted profile configuration to use for this
+ virtual server instance
+ This property's value is used when provisioning the virtual server
+ instance, but not subsequently managed. Accordingly, it is reflected as an
+ [instance
+ initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
+ property.
+ :param List[KeyIdentity] keys: (optional) The public SSH keys for the
+ administrative user of the virtual server instance. Keys will be made
+ available to the virtual server instance as cloud-init vendor data. For
+ cloud-init enabled images, these keys will also be added as SSH authorized
+ keys for the administrative user.
+ For Windows images, the keys of type `rsa` must be specified, and one will
+ be selected to encrypt [the administrator
+ password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization).
+ Keys are optional for other images, but if no keys are specified, the
+ instance will be inaccessible unless the specified image provides another
+ means of access.
+ This property's value is used when provisioning the virtual server
+ instance, but not subsequently managed. Accordingly, it is reflected as an
+ [instance
+ initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
+ property.
+ :param InstanceMetadataServicePrototype metadata_service: (optional)
+ :param InstancePlacementTargetPrototype placement_target: (optional) The
+ placement restrictions to use for the virtual server instance.
+ If specified, `reservation_affinity.policy` must be `disabled`.
+ :param InstanceProfileIdentity profile: (optional) The
+ [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for
+ this virtual server instance.
+ If unspecified, `bx2-2x8` will be used, but this default value is expected
+ to change in the future.
+ :param InstanceReservationAffinityPrototype reservation_affinity:
+ (optional)
+ :param int total_volume_bandwidth: (optional) The amount of bandwidth (in
+ megabits per second) allocated exclusively to instance storage volumes. An
+ increase in this value will result in a corresponding decrease to
+ `total_network_bandwidth`.
+ :param str user_data: (optional) [User
+ data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available
+ when setting up the virtual server instance.
+ :param List[VolumeAttachmentPrototype] volume_attachments: (optional) The
+ additional volume attachments to create for the virtual server instance.
+ :param VPCIdentity vpc: (optional) The VPC this virtual server instance
+ will reside in.
+ If specified, it must match the VPC for the subnets of the instance network
+ attachments or instance network interfaces.
+ :param List[InstanceNetworkAttachmentPrototype] network_attachments:
+ (optional) The additional network attachments to create for the virtual
+ server instance.
+ :param List[NetworkInterfacePrototype] network_interfaces: (optional) The
+ additional instance network interfaces to create.
+ :param InstanceNetworkAttachmentPrototype primary_network_attachment:
+ (optional) The primary network attachment to create for the virtual server
+ instance.
+ """
+ # pylint: disable=super-init-not-called
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkAttachment', 'InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkInterface'])
+ )
+ raise Exception(msg)
+
+
+class KeyIdentityByCRN(KeyIdentity):
+ """
+ KeyIdentityByCRN.
+
+ :param str crn: The CRN for this key.
+ """
+
+ def __init__(
+ self,
+ crn: str,
+ ) -> None:
+ """
+ Initialize a KeyIdentityByCRN object.
+
+ :param str crn: The CRN for this key.
+ """
+ # pylint: disable=super-init-not-called
+ self.crn = crn
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'KeyIdentityByCRN':
+ """Initialize a KeyIdentityByCRN object from a json dictionary."""
+ args = {}
+ if (crn := _dict.get('crn')) is not None:
+ args['crn'] = crn
+ else:
+ raise ValueError('Required property \'crn\' not present in KeyIdentityByCRN JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a KeyIdentityByCRN object from a json dictionary."""
+ return cls.from_dict(_dict)
+
+ def to_dict(self) -> Dict:
+ """Return a json dictionary representing this model."""
+ _dict = {}
+ if hasattr(self, 'crn') and self.crn is not None:
+ _dict['crn'] = self.crn
+ return _dict
+
+ def _to_dict(self):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
+
+ def __str__(self) -> str:
+ """Return a `str` version of this KeyIdentityByCRN object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'KeyIdentityByCRN') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'KeyIdentityByCRN') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+
+class KeyIdentityByFingerprint(KeyIdentity):
+ """
+ KeyIdentityByFingerprint.
+
+ :param str fingerprint: The fingerprint for this key. The value is returned
+ base64-encoded and prefixed with the hash algorithm (always `SHA256`).
+ """
+
+ def __init__(
+ self,
+ fingerprint: str,
+ ) -> None:
+ """
+ Initialize a KeyIdentityByFingerprint object.
+
+ :param str fingerprint: The fingerprint for this key. The value is
+ returned base64-encoded and prefixed with the hash algorithm (always
+ `SHA256`).
+ """
+ # pylint: disable=super-init-not-called
+ self.fingerprint = fingerprint
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'KeyIdentityByFingerprint':
+ """Initialize a KeyIdentityByFingerprint object from a json dictionary."""
+ args = {}
+ if (fingerprint := _dict.get('fingerprint')) is not None:
+ args['fingerprint'] = fingerprint
+ else:
+ raise ValueError('Required property \'fingerprint\' not present in KeyIdentityByFingerprint JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a KeyIdentityByFingerprint object from a json dictionary."""
+ return cls.from_dict(_dict)
+
+ def to_dict(self) -> Dict:
+ """Return a json dictionary representing this model."""
+ _dict = {}
+ if hasattr(self, 'fingerprint') and self.fingerprint is not None:
+ _dict['fingerprint'] = self.fingerprint
+ return _dict
+
+ def _to_dict(self):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
+
+ def __str__(self) -> str:
+ """Return a `str` version of this KeyIdentityByFingerprint object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'KeyIdentityByFingerprint') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'KeyIdentityByFingerprint') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+
+class KeyIdentityByHref(KeyIdentity):
+ """
+ KeyIdentityByHref.
+
+ :param str href: The URL for this key.
+ """
+
+ def __init__(
+ self,
+ href: str,
+ ) -> None:
+ """
+ Initialize a KeyIdentityByHref object.
+
+ :param str href: The URL for this key.
+ """
+ # pylint: disable=super-init-not-called
+ self.href = href
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'KeyIdentityByHref':
+ """Initialize a KeyIdentityByHref object from a json dictionary."""
+ args = {}
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
+ else:
+ raise ValueError('Required property \'href\' not present in KeyIdentityByHref JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a KeyIdentityByHref object from a json dictionary."""
+ return cls.from_dict(_dict)
+
+ def to_dict(self) -> Dict:
+ """Return a json dictionary representing this model."""
+ _dict = {}
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
+ return _dict
+
+ def _to_dict(self):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
+
+ def __str__(self) -> str:
+ """Return a `str` version of this KeyIdentityByHref object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'KeyIdentityByHref') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'KeyIdentityByHref') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+
+class KeyIdentityById(KeyIdentity):
+ """
+ KeyIdentityById.
+
+ :param str id: The unique identifier for this key.
+ """
+
+ def __init__(
+ self,
+ id: str,
+ ) -> None:
+ """
+ Initialize a KeyIdentityById object.
+
+ :param str id: The unique identifier for this key.
+ """
+ # pylint: disable=super-init-not-called
+ self.id = id
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'KeyIdentityById':
+ """Initialize a KeyIdentityById object from a json dictionary."""
+ args = {}
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
+ else:
+ raise ValueError('Required property \'id\' not present in KeyIdentityById JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a KeyIdentityById object from a json dictionary."""
+ return cls.from_dict(_dict)
+
+ def to_dict(self) -> Dict:
+ """Return a json dictionary representing this model."""
+ _dict = {}
+ if hasattr(self, 'id') and self.id is not None:
+ _dict['id'] = self.id
+ return _dict
+
+ def _to_dict(self):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
+
+ def __str__(self) -> str:
+ """Return a `str` version of this KeyIdentityById object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'KeyIdentityById') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'KeyIdentityById') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+
+class LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName(LegacyCloudObjectStorageBucketIdentity):
+ """
+ LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName.
+
+ :param str name: The globally unique name of this Cloud Object Storage bucket.
+ """
+
+ def __init__(
+ self,
+ name: str,
+ ) -> None:
+ """
+ Initialize a LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName object.
+
+ :param str name: The globally unique name of this Cloud Object Storage
+ bucket.
+ """
+ # pylint: disable=super-init-not-called
+ self.name = name
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName':
+ """Initialize a LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName object from a json dictionary."""
+ args = {}
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ else:
+ raise ValueError('Required property \'name\' not present in LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName object from a json dictionary."""
+ return cls.from_dict(_dict)
+
+ def to_dict(self) -> Dict:
+ """Return a json dictionary representing this model."""
+ _dict = {}
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ return _dict
+
+ def _to_dict(self):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
+
+ def __str__(self) -> str:
+ """Return a `str` version of this LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+
+class LoadBalancerIdentityByCRN(LoadBalancerIdentity):
+ """
+ LoadBalancerIdentityByCRN.
+
+ :param str crn: The load balancer's CRN.
+ """
+
+ def __init__(
+ self,
+ crn: str,
+ ) -> None:
+ """
+ Initialize a LoadBalancerIdentityByCRN object.
+
+ :param str crn: The load balancer's CRN.
+ """
+ # pylint: disable=super-init-not-called
+ self.crn = crn
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'LoadBalancerIdentityByCRN':
+ """Initialize a LoadBalancerIdentityByCRN object from a json dictionary."""
+ args = {}
+ if (crn := _dict.get('crn')) is not None:
+ args['crn'] = crn
+ else:
+ raise ValueError('Required property \'crn\' not present in LoadBalancerIdentityByCRN JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a LoadBalancerIdentityByCRN object from a json dictionary."""
+ return cls.from_dict(_dict)
+
+ def to_dict(self) -> Dict:
+ """Return a json dictionary representing this model."""
+ _dict = {}
+ if hasattr(self, 'crn') and self.crn is not None:
+ _dict['crn'] = self.crn
+ return _dict
+
+ def _to_dict(self):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
+
+ def __str__(self) -> str:
+ """Return a `str` version of this LoadBalancerIdentityByCRN object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'LoadBalancerIdentityByCRN') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'LoadBalancerIdentityByCRN') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+
+class LoadBalancerIdentityByHref(LoadBalancerIdentity):
+ """
+ LoadBalancerIdentityByHref.
+
+ :param str href: The load balancer's canonical URL.
+ """
+
+ def __init__(
+ self,
+ href: str,
+ ) -> None:
+ """
+ Initialize a LoadBalancerIdentityByHref object.
+
+ :param str href: The load balancer's canonical URL.
+ """
+ # pylint: disable=super-init-not-called
+ self.href = href
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'LoadBalancerIdentityByHref':
+ """Initialize a LoadBalancerIdentityByHref object from a json dictionary."""
+ args = {}
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
+ else:
+ raise ValueError('Required property \'href\' not present in LoadBalancerIdentityByHref JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a LoadBalancerIdentityByHref object from a json dictionary."""
+ return cls.from_dict(_dict)
+
+ def to_dict(self) -> Dict:
+ """Return a json dictionary representing this model."""
+ _dict = {}
+ if hasattr(self, '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 LoadBalancerIdentityByHref object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'LoadBalancerIdentityByHref') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'LoadBalancerIdentityByHref') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+
+class LoadBalancerIdentityById(LoadBalancerIdentity):
+ """
+ LoadBalancerIdentityById.
+
+ :param str id: The unique identifier for this load balancer.
+ """
+
+ def __init__(
+ self,
+ id: str,
+ ) -> None:
+ """
+ Initialize a LoadBalancerIdentityById object.
+
+ :param str id: The unique identifier for this load balancer.
+ """
+ # pylint: disable=super-init-not-called
+ self.id = id
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'LoadBalancerIdentityById':
+ """Initialize a LoadBalancerIdentityById object from a json dictionary."""
+ args = {}
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
+ else:
+ raise ValueError('Required property \'id\' not present in LoadBalancerIdentityById JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a LoadBalancerIdentityById object from a json dictionary."""
+ return cls.from_dict(_dict)
+
+ def to_dict(self) -> Dict:
+ """Return a json dictionary representing this model."""
+ _dict = {}
+ if hasattr(self, 'id') and self.id is not None:
+ _dict['id'] = self.id
+ return _dict
+
+ def _to_dict(self):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
+
+ def __str__(self) -> str:
+ """Return a `str` version of this LoadBalancerIdentityById object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'LoadBalancerIdentityById') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'LoadBalancerIdentityById') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+
+class LoadBalancerListenerIdentityByHref(LoadBalancerListenerIdentity):
+ """
+ LoadBalancerListenerIdentityByHref.
+
+ :param str href: The listener's canonical URL.
+ """
+
+ def __init__(
+ self,
+ href: str,
+ ) -> None:
+ """
+ Initialize a LoadBalancerListenerIdentityByHref object.
+
+ :param str href: The listener's canonical URL.
+ """
+ # pylint: disable=super-init-not-called
+ self.href = href
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerIdentityByHref':
+ """Initialize a LoadBalancerListenerIdentityByHref object from a json dictionary."""
+ args = {}
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
+ else:
+ raise ValueError('Required property \'href\' not present in LoadBalancerListenerIdentityByHref JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a LoadBalancerListenerIdentityByHref object from a json dictionary."""
+ return cls.from_dict(_dict)
+
+ def to_dict(self) -> Dict:
+ """Return a json dictionary representing this model."""
+ _dict = {}
+ if hasattr(self, '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 LoadBalancerListenerIdentityByHref object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'LoadBalancerListenerIdentityByHref') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'LoadBalancerListenerIdentityByHref') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+
+class LoadBalancerListenerIdentityById(LoadBalancerListenerIdentity):
+ """
+ LoadBalancerListenerIdentityById.
+
+ :param str id: The unique identifier for this load balancer listener.
+ """
+
+ def __init__(
+ self,
+ id: str,
+ ) -> None:
+ """
+ Initialize a LoadBalancerListenerIdentityById object.
+
+ :param str id: The unique identifier for this load balancer listener.
+ """
+ # pylint: disable=super-init-not-called
+ self.id = id
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerIdentityById':
+ """Initialize a LoadBalancerListenerIdentityById object from a json dictionary."""
+ args = {}
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
+ else:
+ raise ValueError('Required property \'id\' not present in LoadBalancerListenerIdentityById JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a LoadBalancerListenerIdentityById object from a json dictionary."""
+ return cls.from_dict(_dict)
+
+ def to_dict(self) -> Dict:
+ """Return a json dictionary representing this model."""
+ _dict = {}
+ if hasattr(self, '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 LoadBalancerListenerIdentityById object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'LoadBalancerListenerIdentityById') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'LoadBalancerListenerIdentityById') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+
+class LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerHTTPSRedirectPatch(LoadBalancerListenerPolicyTargetPatch):
+ """
+ LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerHTTPSRedirectPatch.
+
+ :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.
+ """
+
+ def __init__(
+ self,
+ *,
+ http_status_code: Optional[int] = None,
+ listener: Optional['LoadBalancerListenerIdentity'] = None,
+ uri: Optional[str] = None,
+ ) -> None:
+ """
+ Initialize a LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerHTTPSRedirectPatch 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.
+ """
+ # pylint: disable=super-init-not-called
+ self.http_status_code = http_status_code
+ self.listener = listener
+ self.uri = uri
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerHTTPSRedirectPatch':
+ """Initialize a LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerHTTPSRedirectPatch object from a json dictionary."""
+ args = {}
+ if (http_status_code := _dict.get('http_status_code')) is not None:
+ args['http_status_code'] = http_status_code
+ if (listener := _dict.get('listener')) is not None:
+ args['listener'] = listener
+ if (uri := _dict.get('uri')) is not None:
+ args['uri'] = uri
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerHTTPSRedirectPatch object from a json dictionary."""
+ return cls.from_dict(_dict)
+
+ def to_dict(self) -> Dict:
+ """Return a json dictionary representing this model."""
+ _dict = {}
+ if hasattr(self, '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):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
+
+ def __str__(self) -> str:
+ """Return a `str` version of this LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerHTTPSRedirectPatch object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerHTTPSRedirectPatch') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerHTTPSRedirectPatch') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+
+class LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerPolicyRedirectURLPatch(LoadBalancerListenerPolicyTargetPatch):
+ """
+ LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerPolicyRedirectURLPatch.
+
+ :param int http_status_code: (optional) The HTTP status code for this redirect.
+ :param str url: (optional) The redirect target URL.
+ """
+
+ def __init__(
+ self,
+ *,
+ http_status_code: Optional[int] = None,
+ url: Optional[str] = None,
+ ) -> None:
+ """
+ Initialize a LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerPolicyRedirectURLPatch object.
+
+ :param int http_status_code: (optional) The HTTP status code for this
+ redirect.
+ :param str url: (optional) The redirect target URL.
+ """
+ # pylint: disable=super-init-not-called
+ self.http_status_code = http_status_code
+ self.url = url
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerPolicyRedirectURLPatch':
+ """Initialize a LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerPolicyRedirectURLPatch object from a json dictionary."""
+ args = {}
+ if (http_status_code := _dict.get('http_status_code')) is not None:
+ args['http_status_code'] = http_status_code
+ if (url := _dict.get('url')) is not None:
+ args['url'] = url
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerPolicyRedirectURLPatch object from a json dictionary."""
+ return cls.from_dict(_dict)
+
+ def to_dict(self) -> Dict:
+ """Return a json dictionary representing this model."""
+ _dict = {}
+ if hasattr(self, 'http_status_code') and self.http_status_code is not None:
+ _dict['http_status_code'] = self.http_status_code
+ if hasattr(self, 'url') and self.url is not None:
+ _dict['url'] = self.url
+ return _dict
+
+ def _to_dict(self):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
+
+ def __str__(self) -> str:
+ """Return a `str` version of this LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerPolicyRedirectURLPatch object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerPolicyRedirectURLPatch') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerPolicyRedirectURLPatch') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+
+class LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentity(LoadBalancerListenerPolicyTargetPatch):
+ """
+ Identifies a load balancer pool by a unique property.
+
+ """
+
+ def __init__(
+ self,
+ ) -> None:
+ """
+ Initialize a LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentity object.
+
+ """
+ # pylint: disable=super-init-not-called
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityById', 'LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityByHref'])
+ )
+ raise Exception(msg)
+
+
+class LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerHTTPSRedirectPrototype(LoadBalancerListenerPolicyTargetPrototype):
+ """
+ LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerHTTPSRedirectPrototype.
+
+ :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.
+ """
+
+ def __init__(
+ self,
+ http_status_code: int,
+ listener: 'LoadBalancerListenerIdentity',
+ *,
+ uri: Optional[str] = None,
+ ) -> None:
+ """
+ Initialize a LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerHTTPSRedirectPrototype object.
+
+ :param int http_status_code: The HTTP status code for this redirect.
+ :param LoadBalancerListenerIdentity listener: Identifies a load balancer
+ listener by a unique property.
+ :param str uri: (optional) The redirect relative target URI.
+ """
+ # pylint: disable=super-init-not-called
+ self.http_status_code = http_status_code
+ self.listener = listener
+ self.uri = uri
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerHTTPSRedirectPrototype':
+ """Initialize a LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerHTTPSRedirectPrototype object from a json dictionary."""
+ args = {}
+ if (http_status_code := _dict.get('http_status_code')) is not None:
+ args['http_status_code'] = http_status_code
+ else:
+ raise ValueError('Required property \'http_status_code\' not present in LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerHTTPSRedirectPrototype JSON')
+ if (listener := _dict.get('listener')) is not None:
+ args['listener'] = listener
+ else:
+ raise ValueError('Required property \'listener\' not present in LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerHTTPSRedirectPrototype JSON')
+ if (uri := _dict.get('uri')) is not None:
+ args['uri'] = uri
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerHTTPSRedirectPrototype object from a json dictionary."""
+ return cls.from_dict(_dict)
+
+ def to_dict(self) -> Dict:
+ """Return a json dictionary representing this model."""
+ _dict = {}
+ if hasattr(self, '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):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
+
+ def __str__(self) -> str:
+ """Return a `str` version of this LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerHTTPSRedirectPrototype object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerHTTPSRedirectPrototype') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerHTTPSRedirectPrototype') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+
+class LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyRedirectURLPrototype(LoadBalancerListenerPolicyTargetPrototype):
+ """
+ LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyRedirectURLPrototype.
+
+ :param int http_status_code: The HTTP status code for this redirect.
+ :param str url: The redirect target URL.
+ """
+
+ def __init__(
+ self,
+ http_status_code: int,
+ url: str,
+ ) -> None:
+ """
+ Initialize a LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyRedirectURLPrototype object.
+
+ :param int http_status_code: The HTTP status code for this redirect.
+ :param str url: The redirect target URL.
+ """
+ # pylint: disable=super-init-not-called
+ self.http_status_code = http_status_code
+ self.url = url
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyRedirectURLPrototype':
+ """Initialize a LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyRedirectURLPrototype object from a json dictionary."""
+ args = {}
+ if (http_status_code := _dict.get('http_status_code')) is not None:
+ args['http_status_code'] = http_status_code
+ else:
+ raise ValueError('Required property \'http_status_code\' not present in LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyRedirectURLPrototype JSON')
+ if (url := _dict.get('url')) is not None:
+ args['url'] = url
+ else:
+ raise ValueError('Required property \'url\' not present in LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyRedirectURLPrototype JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyRedirectURLPrototype object from a json dictionary."""
+ return cls.from_dict(_dict)
+
+ def to_dict(self) -> Dict:
+ """Return a json dictionary representing this model."""
+ _dict = {}
+ if hasattr(self, 'http_status_code') and self.http_status_code is not None:
+ _dict['http_status_code'] = self.http_status_code
+ if hasattr(self, 'url') and self.url is not None:
+ _dict['url'] = self.url
+ return _dict
+
+ def _to_dict(self):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
+
+ def __str__(self) -> str:
+ """Return a `str` version of this LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyRedirectURLPrototype object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyRedirectURLPrototype') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyRedirectURLPrototype') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+
+class LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentity(LoadBalancerListenerPolicyTargetPrototype):
+ """
+ Identifies a load balancer pool by a unique property.
+
+ """
+
+ def __init__(
+ self,
+ ) -> None:
+ """
+ Initialize a LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentity object.
+
+ """
+ # pylint: disable=super-init-not-called
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityById', 'LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityByHref'])
+ )
+ raise Exception(msg)
+
+
+class LoadBalancerListenerPolicyTargetLoadBalancerListenerHTTPSRedirect(LoadBalancerListenerPolicyTarget):
+ """
+ LoadBalancerListenerPolicyTargetLoadBalancerListenerHTTPSRedirect.
+
+ :param int http_status_code: The HTTP status code for this redirect.
+ :param LoadBalancerListenerReference listener:
+ :param str uri: (optional) The redirect relative target URI.
+ """
+
+ def __init__(
+ self,
+ http_status_code: int,
+ listener: 'LoadBalancerListenerReference',
+ *,
+ uri: Optional[str] = None,
+ ) -> None:
+ """
+ Initialize a LoadBalancerListenerPolicyTargetLoadBalancerListenerHTTPSRedirect 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.
+ """
+ # pylint: disable=super-init-not-called
+ self.http_status_code = http_status_code
+ self.listener = listener
+ self.uri = uri
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerPolicyTargetLoadBalancerListenerHTTPSRedirect':
+ """Initialize a LoadBalancerListenerPolicyTargetLoadBalancerListenerHTTPSRedirect object from a json dictionary."""
+ args = {}
+ if (http_status_code := _dict.get('http_status_code')) is not None:
+ args['http_status_code'] = http_status_code
+ else:
+ raise ValueError('Required property \'http_status_code\' not present in LoadBalancerListenerPolicyTargetLoadBalancerListenerHTTPSRedirect JSON')
+ if (listener := _dict.get('listener')) is not None:
+ args['listener'] = LoadBalancerListenerReference.from_dict(listener)
+ else:
+ raise ValueError('Required property \'listener\' not present in LoadBalancerListenerPolicyTargetLoadBalancerListenerHTTPSRedirect JSON')
+ if (uri := _dict.get('uri')) is not None:
+ args['uri'] = uri
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a LoadBalancerListenerPolicyTargetLoadBalancerListenerHTTPSRedirect object from a json dictionary."""
+ return cls.from_dict(_dict)
+
+ def to_dict(self) -> Dict:
+ """Return a json dictionary representing this model."""
+ _dict = {}
+ if hasattr(self, '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):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
+
+ def __str__(self) -> str:
+ """Return a `str` version of this LoadBalancerListenerPolicyTargetLoadBalancerListenerHTTPSRedirect object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'LoadBalancerListenerPolicyTargetLoadBalancerListenerHTTPSRedirect') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'LoadBalancerListenerPolicyTargetLoadBalancerListenerHTTPSRedirect') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+
+class LoadBalancerListenerPolicyTargetLoadBalancerListenerPolicyRedirectURL(LoadBalancerListenerPolicyTarget):
+ """
+ LoadBalancerListenerPolicyTargetLoadBalancerListenerPolicyRedirectURL.
+
+ :param int http_status_code: The HTTP status code for this redirect.
+ :param str url: The redirect target URL.
+ """
+
+ def __init__(
+ self,
+ http_status_code: int,
+ url: str,
+ ) -> None:
+ """
+ Initialize a LoadBalancerListenerPolicyTargetLoadBalancerListenerPolicyRedirectURL object.
+
+ :param int http_status_code: The HTTP status code for this redirect.
+ :param str url: The redirect target URL.
+ """
+ # pylint: disable=super-init-not-called
+ self.http_status_code = http_status_code
+ self.url = url
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerPolicyTargetLoadBalancerListenerPolicyRedirectURL':
+ """Initialize a LoadBalancerListenerPolicyTargetLoadBalancerListenerPolicyRedirectURL object from a json dictionary."""
+ args = {}
+ if (http_status_code := _dict.get('http_status_code')) is not None:
+ args['http_status_code'] = http_status_code
+ else:
+ raise ValueError('Required property \'http_status_code\' not present in LoadBalancerListenerPolicyTargetLoadBalancerListenerPolicyRedirectURL JSON')
+ if (url := _dict.get('url')) is not None:
+ args['url'] = url
+ else:
+ raise ValueError('Required property \'url\' not present in LoadBalancerListenerPolicyTargetLoadBalancerListenerPolicyRedirectURL JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a LoadBalancerListenerPolicyTargetLoadBalancerListenerPolicyRedirectURL object from a json dictionary."""
+ return cls.from_dict(_dict)
+
+ def to_dict(self) -> Dict:
+ """Return a json dictionary representing this model."""
+ _dict = {}
+ if hasattr(self, 'http_status_code') and self.http_status_code is not None:
+ _dict['http_status_code'] = self.http_status_code
+ if hasattr(self, 'url') and self.url is not None:
+ _dict['url'] = self.url
+ return _dict
+
+ def _to_dict(self):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
+
+ def __str__(self) -> str:
+ """Return a `str` version of this LoadBalancerListenerPolicyTargetLoadBalancerListenerPolicyRedirectURL object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'LoadBalancerListenerPolicyTargetLoadBalancerListenerPolicyRedirectURL') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'LoadBalancerListenerPolicyTargetLoadBalancerListenerPolicyRedirectURL') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+
+class LoadBalancerListenerPolicyTargetLoadBalancerPoolReference(LoadBalancerListenerPolicyTarget):
+ """
+ LoadBalancerListenerPolicyTargetLoadBalancerPoolReference.
+
+ :param LoadBalancerPoolReferenceDeleted deleted: (optional) If present, this
+ property indicates the referenced resource has been deleted, and provides
+ some supplementary information.
+ :param str href: The pool's canonical URL.
+ :param str id: The unique identifier for this load balancer pool.
+ :param str name: The name for this load balancer pool. The name is unique across
+ all pools for the load balancer.
+ """
+
+ def __init__(
+ self,
+ href: str,
+ id: str,
+ name: str,
+ *,
+ deleted: Optional['LoadBalancerPoolReferenceDeleted'] = None,
+ ) -> None:
+ """
+ Initialize a LoadBalancerListenerPolicyTargetLoadBalancerPoolReference object.
+
+ :param str href: The pool's canonical URL.
+ :param str id: The unique identifier for this load balancer pool.
+ :param str name: The name for this load balancer pool. The name is unique
+ across all pools for the load balancer.
+ :param LoadBalancerPoolReferenceDeleted deleted: (optional) If present,
+ this property indicates the referenced resource has been deleted, and
+ provides
+ some supplementary information.
+ """
+ # pylint: disable=super-init-not-called
+ self.deleted = deleted
+ self.href = href
+ self.id = id
+ self.name = name
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerPolicyTargetLoadBalancerPoolReference':
+ """Initialize a LoadBalancerListenerPolicyTargetLoadBalancerPoolReference object from a json dictionary."""
+ args = {}
+ if (deleted := _dict.get('deleted')) is not None:
+ args['deleted'] = LoadBalancerPoolReferenceDeleted.from_dict(deleted)
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
+ else:
+ raise ValueError('Required property \'href\' not present in LoadBalancerListenerPolicyTargetLoadBalancerPoolReference JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
+ else:
+ raise ValueError('Required property \'id\' not present in LoadBalancerListenerPolicyTargetLoadBalancerPoolReference JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ else:
+ raise ValueError('Required property \'name\' not present in LoadBalancerListenerPolicyTargetLoadBalancerPoolReference JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a LoadBalancerListenerPolicyTargetLoadBalancerPoolReference object from a json dictionary."""
+ return cls.from_dict(_dict)
+
+ def to_dict(self) -> Dict:
+ """Return a json dictionary representing this model."""
+ _dict = {}
+ if hasattr(self, 'deleted') and self.deleted is not None:
+ if isinstance(self.deleted, dict):
+ _dict['deleted'] = self.deleted
+ else:
+ _dict['deleted'] = self.deleted.to_dict()
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
+ if hasattr(self, 'id') and self.id is not None:
+ _dict['id'] = self.id
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ return _dict
+
+ def _to_dict(self):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
+
+ def __str__(self) -> str:
+ """Return a `str` version of this LoadBalancerListenerPolicyTargetLoadBalancerPoolReference object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'LoadBalancerListenerPolicyTargetLoadBalancerPoolReference') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'LoadBalancerListenerPolicyTargetLoadBalancerPoolReference') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+
+class LoadBalancerPoolIdentityByHref(LoadBalancerPoolIdentity):
+ """
+ LoadBalancerPoolIdentityByHref.
+
+ :param str href: The pool's canonical URL.
+ """
+
+ def __init__(
+ self,
+ href: str,
+ ) -> None:
+ """
+ Initialize a LoadBalancerPoolIdentityByHref object.
+
+ :param str href: The pool's canonical URL.
+ """
+ # pylint: disable=super-init-not-called
+ self.href = href
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'LoadBalancerPoolIdentityByHref':
+ """Initialize a LoadBalancerPoolIdentityByHref object from a json dictionary."""
+ args = {}
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
+ else:
+ raise ValueError('Required property \'href\' not present in LoadBalancerPoolIdentityByHref JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a LoadBalancerPoolIdentityByHref object from a json dictionary."""
+ return cls.from_dict(_dict)
+
+ def to_dict(self) -> Dict:
+ """Return a json dictionary representing this model."""
+ _dict = {}
+ if hasattr(self, '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 LoadBalancerPoolIdentityByHref object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'LoadBalancerPoolIdentityByHref') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'LoadBalancerPoolIdentityByHref') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+
+class LoadBalancerPoolIdentityById(LoadBalancerPoolIdentity):
+ """
+ LoadBalancerPoolIdentityById.
+
+ :param str id: The unique identifier for this load balancer pool.
+ """
+
+ def __init__(
+ self,
+ id: str,
+ ) -> None:
+ """
+ Initialize a LoadBalancerPoolIdentityById object.
+
+ :param str id: The unique identifier for this load balancer pool.
+ """
+ # pylint: disable=super-init-not-called
+ self.id = id
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'LoadBalancerPoolIdentityById':
+ """Initialize a LoadBalancerPoolIdentityById object from a json dictionary."""
+ args = {}
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
+ else:
+ raise ValueError('Required property \'id\' not present in LoadBalancerPoolIdentityById JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a LoadBalancerPoolIdentityById object from a json dictionary."""
+ return cls.from_dict(_dict)
+
+ def to_dict(self) -> Dict:
+ """Return a json dictionary representing this model."""
+ _dict = {}
+ if hasattr(self, '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 LoadBalancerPoolIdentityById object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'LoadBalancerPoolIdentityById') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'LoadBalancerPoolIdentityById') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+
+class LoadBalancerPoolMemberTargetPrototypeIP(LoadBalancerPoolMemberTargetPrototype):
+ """
+ LoadBalancerPoolMemberTargetPrototypeIP.
+
+ :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.
+ """
+
+ def __init__(
+ self,
+ address: str,
+ ) -> None:
+ """
+ Initialize a LoadBalancerPoolMemberTargetPrototypeIP object.
+
+ :param str address: The IP address.
+ This property may add support for IPv6 addresses in the future. When
+ processing a value in this property, verify that the address is in an
+ expected format. If it is not, log an error. Optionally halt processing and
+ surface the error, or bypass the resource on which the unexpected IP
+ address format was encountered.
+ """
+ # pylint: disable=super-init-not-called
+ self.address = address
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'LoadBalancerPoolMemberTargetPrototypeIP':
+ """Initialize a LoadBalancerPoolMemberTargetPrototypeIP object from a json dictionary."""
+ args = {}
+ if (address := _dict.get('address')) is not None:
+ args['address'] = address
+ else:
+ raise ValueError('Required property \'address\' not present in LoadBalancerPoolMemberTargetPrototypeIP JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a LoadBalancerPoolMemberTargetPrototypeIP object from a json dictionary."""
+ return cls.from_dict(_dict)
+
+ def to_dict(self) -> Dict:
+ """Return a json dictionary representing this model."""
+ _dict = {}
+ if hasattr(self, 'address') and self.address is not None:
+ _dict['address'] = self.address
+ return _dict
+
+ def _to_dict(self):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
+
+ def __str__(self) -> str:
+ """Return a `str` version of this LoadBalancerPoolMemberTargetPrototypeIP object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'LoadBalancerPoolMemberTargetPrototypeIP') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'LoadBalancerPoolMemberTargetPrototypeIP') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+
+class LoadBalancerPoolMemberTargetPrototypeInstanceIdentity(LoadBalancerPoolMemberTargetPrototype):
+ """
+ Identifies a virtual server instance by a unique property.
+
+ """
+
+ def __init__(
+ self,
+ ) -> None:
+ """
+ Initialize a LoadBalancerPoolMemberTargetPrototypeInstanceIdentity object.
+
+ """
+ # pylint: disable=super-init-not-called
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById', 'LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByCRN', 'LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByHref'])
+ )
+ raise Exception(msg)
+
+
+class LoadBalancerPoolMemberTargetIP(LoadBalancerPoolMemberTarget):
+ """
+ LoadBalancerPoolMemberTargetIP.
+
+ :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.
+ """
+
+ def __init__(
+ self,
+ address: str,
+ ) -> None:
+ """
+ Initialize a LoadBalancerPoolMemberTargetIP object.
+
+ :param str address: The IP address.
+ This property may add support for IPv6 addresses in the future. When
+ processing a value in this property, verify that the address is in an
+ expected format. If it is not, log an error. Optionally halt processing and
+ surface the error, or bypass the resource on which the unexpected IP
+ address format was encountered.
+ """
+ # pylint: disable=super-init-not-called
+ self.address = address
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'LoadBalancerPoolMemberTargetIP':
+ """Initialize a LoadBalancerPoolMemberTargetIP object from a json dictionary."""
+ args = {}
+ if (address := _dict.get('address')) is not None:
+ args['address'] = address
+ else:
+ raise ValueError('Required property \'address\' not present in LoadBalancerPoolMemberTargetIP JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a LoadBalancerPoolMemberTargetIP object from a json dictionary."""
+ return cls.from_dict(_dict)
+
+ def to_dict(self) -> Dict:
+ """Return a json dictionary representing this model."""
+ _dict = {}
+ if hasattr(self, 'address') and self.address is not None:
+ _dict['address'] = self.address
+ return _dict
+
+ def _to_dict(self):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
+
+ def __str__(self) -> str:
+ """Return a `str` version of this LoadBalancerPoolMemberTargetIP object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'LoadBalancerPoolMemberTargetIP') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'LoadBalancerPoolMemberTargetIP') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+
+class LoadBalancerPoolMemberTargetInstanceReference(LoadBalancerPoolMemberTarget):
+ """
+ LoadBalancerPoolMemberTargetInstanceReference.
+
+ :param str crn: The CRN for this virtual server instance.
+ :param InstanceReferenceDeleted 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 virtual server instance.
+ :param str id: The unique identifier for this virtual server instance.
+ :param str name: The name for this virtual server instance. The name is unique
+ across all virtual server instances in the region.
+ """
+
+ def __init__(
+ self,
+ crn: str,
+ href: str,
+ id: str,
+ name: str,
+ *,
+ deleted: Optional['InstanceReferenceDeleted'] = None,
+ ) -> None:
+ """
+ Initialize a LoadBalancerPoolMemberTargetInstanceReference object.
+
+ :param str crn: The CRN for this virtual server instance.
+ :param str href: The URL for this virtual server instance.
+ :param str id: The unique identifier for this virtual server instance.
+ :param str name: The name for this virtual server instance. The name is
+ unique across all virtual server instances in the region.
+ :param InstanceReferenceDeleted deleted: (optional) If present, this
+ property indicates the referenced resource has been deleted, and provides
+ some supplementary information.
+ """
+ # pylint: disable=super-init-not-called
+ self.crn = crn
+ self.deleted = deleted
+ self.href = href
+ self.id = id
+ self.name = name
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'LoadBalancerPoolMemberTargetInstanceReference':
+ """Initialize a LoadBalancerPoolMemberTargetInstanceReference object from a json dictionary."""
+ args = {}
+ if (crn := _dict.get('crn')) is not None:
+ args['crn'] = crn
+ else:
+ raise ValueError('Required property \'crn\' not present in LoadBalancerPoolMemberTargetInstanceReference JSON')
+ if (deleted := _dict.get('deleted')) is not None:
+ args['deleted'] = InstanceReferenceDeleted.from_dict(deleted)
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
+ else:
+ raise ValueError('Required property \'href\' not present in LoadBalancerPoolMemberTargetInstanceReference JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
+ else:
+ raise ValueError('Required property \'id\' not present in LoadBalancerPoolMemberTargetInstanceReference JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ else:
+ raise ValueError('Required property \'name\' not present in LoadBalancerPoolMemberTargetInstanceReference JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a LoadBalancerPoolMemberTargetInstanceReference object from a json dictionary."""
+ return cls.from_dict(_dict)
+
+ def to_dict(self) -> Dict:
+ """Return a json dictionary representing this model."""
+ _dict = {}
+ if hasattr(self, 'crn') and self.crn is not None:
+ _dict['crn'] = self.crn
+ if hasattr(self, 'deleted') and self.deleted is not None:
+ if isinstance(self.deleted, dict):
+ _dict['deleted'] = self.deleted
+ else:
+ _dict['deleted'] = self.deleted.to_dict()
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
+ if hasattr(self, 'id') and self.id is not None:
+ _dict['id'] = self.id
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ return _dict
+
+ def _to_dict(self):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
+
+ def __str__(self) -> str:
+ """Return a `str` version of this LoadBalancerPoolMemberTargetInstanceReference object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'LoadBalancerPoolMemberTargetInstanceReference') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'LoadBalancerPoolMemberTargetInstanceReference') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+
+class LoadBalancerProfileIdentityByHref(LoadBalancerProfileIdentity):
+ """
+ LoadBalancerProfileIdentityByHref.
+
+ :param str href: The URL for this load balancer profile.
+ """
+
+ def __init__(
+ self,
+ href: str,
+ ) -> None:
+ """
+ Initialize a LoadBalancerProfileIdentityByHref object.
+
+ :param str href: The URL for this load balancer profile.
+ """
+ # pylint: disable=super-init-not-called
+ self.href = href
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'LoadBalancerProfileIdentityByHref':
+ """Initialize a LoadBalancerProfileIdentityByHref object from a json dictionary."""
+ args = {}
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
+ else:
+ raise ValueError('Required property \'href\' not present in LoadBalancerProfileIdentityByHref JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a LoadBalancerProfileIdentityByHref object from a json dictionary."""
+ return cls.from_dict(_dict)
+
+ def to_dict(self) -> Dict:
+ """Return a json dictionary representing this model."""
+ _dict = {}
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
+ return _dict
+
+ def _to_dict(self):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
+
+ def __str__(self) -> str:
+ """Return a `str` version of this LoadBalancerProfileIdentityByHref object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'LoadBalancerProfileIdentityByHref') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'LoadBalancerProfileIdentityByHref') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+
+class LoadBalancerProfileIdentityByName(LoadBalancerProfileIdentity):
+ """
+ LoadBalancerProfileIdentityByName.
+
+ :param str name: The globally unique name for this load balancer profile.
+ """
+
+ def __init__(
+ self,
+ name: str,
+ ) -> None:
+ """
+ Initialize a LoadBalancerProfileIdentityByName object.
+
+ :param str name: The globally unique name for this load balancer profile.
+ """
+ # pylint: disable=super-init-not-called
+ self.name = name
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'LoadBalancerProfileIdentityByName':
+ """Initialize a LoadBalancerProfileIdentityByName object from a json dictionary."""
+ args = {}
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ else:
+ raise ValueError('Required property \'name\' not present in LoadBalancerProfileIdentityByName JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a LoadBalancerProfileIdentityByName object from a json dictionary."""
+ return cls.from_dict(_dict)
+
+ def to_dict(self) -> Dict:
+ """Return a json dictionary representing this model."""
+ _dict = {}
+ if hasattr(self, '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 LoadBalancerProfileIdentityByName object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'LoadBalancerProfileIdentityByName') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'LoadBalancerProfileIdentityByName') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+
+class LoadBalancerProfileInstanceGroupsSupportedDependent(LoadBalancerProfileInstanceGroupsSupported):
+ """
+ The instance groups support for a load balancer with this profile depends on its
+ configuration.
+
+ :param str type: The type for this profile field.
+ """
+
+ def __init__(
+ self,
+ type: str,
+ ) -> None:
+ """
+ Initialize a LoadBalancerProfileInstanceGroupsSupportedDependent object.
+
+ :param str type: The type for this profile field.
+ """
+ # pylint: disable=super-init-not-called
+ self.type = type
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'LoadBalancerProfileInstanceGroupsSupportedDependent':
+ """Initialize a LoadBalancerProfileInstanceGroupsSupportedDependent object from a json dictionary."""
+ args = {}
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
+ else:
+ raise ValueError('Required property \'type\' not present in LoadBalancerProfileInstanceGroupsSupportedDependent JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a LoadBalancerProfileInstanceGroupsSupportedDependent object from a json dictionary."""
+ return cls.from_dict(_dict)
+
+ def to_dict(self) -> Dict:
+ """Return a json dictionary representing this model."""
+ _dict = {}
+ if hasattr(self, 'type') and self.type is not None:
+ _dict['type'] = self.type
+ return _dict
+
+ def _to_dict(self):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
+
+ def __str__(self) -> str:
+ """Return a `str` version of this LoadBalancerProfileInstanceGroupsSupportedDependent object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'LoadBalancerProfileInstanceGroupsSupportedDependent') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'LoadBalancerProfileInstanceGroupsSupportedDependent') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+ class TypeEnum(str, Enum):
+ """
+ The type for this profile field.
+ """
+
+ DEPENDENT = 'dependent'
+
+
+
+class LoadBalancerProfileInstanceGroupsSupportedFixed(LoadBalancerProfileInstanceGroupsSupported):
+ """
+ The instance groups support for a load balancer with this profile.
+
+ :param str type: The type for this profile field.
+ :param bool value: The value for this profile field.
+ """
+
+ def __init__(
+ self,
+ type: str,
+ value: bool,
+ ) -> None:
+ """
+ Initialize a LoadBalancerProfileInstanceGroupsSupportedFixed object.
+
+ :param str type: The type for this profile field.
+ :param bool value: The value for this profile field.
+ """
+ # pylint: disable=super-init-not-called
+ self.type = type
+ self.value = value
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'LoadBalancerProfileInstanceGroupsSupportedFixed':
+ """Initialize a LoadBalancerProfileInstanceGroupsSupportedFixed object from a json dictionary."""
+ args = {}
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
+ else:
+ raise ValueError('Required property \'type\' not present in LoadBalancerProfileInstanceGroupsSupportedFixed JSON')
+ if (value := _dict.get('value')) is not None:
+ args['value'] = value
+ else:
+ raise ValueError('Required property \'value\' not present in LoadBalancerProfileInstanceGroupsSupportedFixed JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a LoadBalancerProfileInstanceGroupsSupportedFixed object from a json dictionary."""
+ return cls.from_dict(_dict)
+
+ def to_dict(self) -> Dict:
+ """Return a json dictionary representing this model."""
+ _dict = {}
+ if hasattr(self, '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 LoadBalancerProfileInstanceGroupsSupportedFixed object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'LoadBalancerProfileInstanceGroupsSupportedFixed') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'LoadBalancerProfileInstanceGroupsSupportedFixed') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+ class TypeEnum(str, Enum):
+ """
+ The type for this profile field.
+ """
+
+ FIXED = 'fixed'
+
+
+
+class LoadBalancerProfileRouteModeSupportedDependent(LoadBalancerProfileRouteModeSupported):
+ """
+ The route mode support for a load balancer with this profile depends on its
+ configuration.
+
+ :param str type: The type for this profile field.
+ """
+
+ def __init__(
+ self,
+ type: str,
+ ) -> None:
+ """
+ Initialize a LoadBalancerProfileRouteModeSupportedDependent object.
+
+ :param str type: The type for this profile field.
+ """
+ # pylint: disable=super-init-not-called
+ self.type = type
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'LoadBalancerProfileRouteModeSupportedDependent':
+ """Initialize a LoadBalancerProfileRouteModeSupportedDependent object from a json dictionary."""
+ args = {}
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
+ else:
+ raise ValueError('Required property \'type\' not present in LoadBalancerProfileRouteModeSupportedDependent JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a LoadBalancerProfileRouteModeSupportedDependent object from a json dictionary."""
+ return cls.from_dict(_dict)
+
+ def to_dict(self) -> Dict:
+ """Return a json dictionary representing this model."""
+ _dict = {}
+ if hasattr(self, 'type') and self.type is not None:
+ _dict['type'] = self.type
+ return _dict
+
+ def _to_dict(self):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
+
+ def __str__(self) -> str:
+ """Return a `str` version of this LoadBalancerProfileRouteModeSupportedDependent object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'LoadBalancerProfileRouteModeSupportedDependent') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'LoadBalancerProfileRouteModeSupportedDependent') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+ class TypeEnum(str, Enum):
+ """
+ The type for this profile field.
+ """
+
+ DEPENDENT = 'dependent'
+
+
+
+class LoadBalancerProfileRouteModeSupportedFixed(LoadBalancerProfileRouteModeSupported):
+ """
+ The route mode support for a load balancer with this profile.
+
+ :param str type: The type for this profile field.
+ :param bool value: The value for this profile field.
+ """
+
+ def __init__(
+ self,
+ type: str,
+ value: bool,
+ ) -> None:
+ """
+ Initialize a LoadBalancerProfileRouteModeSupportedFixed object.
+
+ :param str type: The type for this profile field.
+ :param bool value: The value for this profile field.
+ """
+ # pylint: disable=super-init-not-called
+ self.type = type
+ self.value = value
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'LoadBalancerProfileRouteModeSupportedFixed':
+ """Initialize a LoadBalancerProfileRouteModeSupportedFixed object from a json dictionary."""
+ args = {}
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
+ else:
+ raise ValueError('Required property \'type\' not present in LoadBalancerProfileRouteModeSupportedFixed JSON')
+ if (value := _dict.get('value')) is not None:
+ args['value'] = value
+ else:
+ raise ValueError('Required property \'value\' not present in LoadBalancerProfileRouteModeSupportedFixed JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a LoadBalancerProfileRouteModeSupportedFixed object from a json dictionary."""
+ return cls.from_dict(_dict)
+
+ def to_dict(self) -> Dict:
+ """Return a json dictionary representing this model."""
+ _dict = {}
+ if hasattr(self, '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 LoadBalancerProfileRouteModeSupportedFixed object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'LoadBalancerProfileRouteModeSupportedFixed') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'LoadBalancerProfileRouteModeSupportedFixed') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+ class TypeEnum(str, Enum):
+ """
+ The type for this profile field.
+ """
+
+ FIXED = 'fixed'
+
+
+
+class LoadBalancerProfileSecurityGroupsSupportedDependent(LoadBalancerProfileSecurityGroupsSupported):
+ """
+ The security group support for a load balancer with this profile depends on its
+ configuration.
+
+ :param str type: The type for this profile field.
+ """
+
+ def __init__(
+ self,
+ type: str,
+ ) -> None:
+ """
+ Initialize a LoadBalancerProfileSecurityGroupsSupportedDependent object.
+
+ :param str type: The type for this profile field.
+ """
+ # pylint: disable=super-init-not-called
+ self.type = type
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'LoadBalancerProfileSecurityGroupsSupportedDependent':
+ """Initialize a LoadBalancerProfileSecurityGroupsSupportedDependent object from a json dictionary."""
+ args = {}
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
+ else:
+ raise ValueError('Required property \'type\' not present in LoadBalancerProfileSecurityGroupsSupportedDependent JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a LoadBalancerProfileSecurityGroupsSupportedDependent object from a json dictionary."""
+ return cls.from_dict(_dict)
+
+ def to_dict(self) -> Dict:
+ """Return a json dictionary representing this model."""
+ _dict = {}
+ if hasattr(self, 'type') and self.type is not None:
+ _dict['type'] = self.type
+ return _dict
+
+ def _to_dict(self):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
+
+ def __str__(self) -> str:
+ """Return a `str` version of this LoadBalancerProfileSecurityGroupsSupportedDependent object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'LoadBalancerProfileSecurityGroupsSupportedDependent') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'LoadBalancerProfileSecurityGroupsSupportedDependent') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+ class TypeEnum(str, Enum):
+ """
+ The type for this profile field.
+ """
+
+ DEPENDENT = 'dependent'
+
+
+
+class LoadBalancerProfileSecurityGroupsSupportedFixed(LoadBalancerProfileSecurityGroupsSupported):
+ """
+ The security group support for a load balancer with this profile.
+
+ :param str type: The type for this profile field.
+ :param bool value: The value for this profile field.
+ """
+
+ def __init__(
+ self,
+ type: str,
+ value: bool,
+ ) -> None:
+ """
+ Initialize a LoadBalancerProfileSecurityGroupsSupportedFixed object.
+
+ :param str type: The type for this profile field.
+ :param bool value: The value for this profile field.
+ """
+ # pylint: disable=super-init-not-called
+ self.type = type
+ self.value = value
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'LoadBalancerProfileSecurityGroupsSupportedFixed':
+ """Initialize a LoadBalancerProfileSecurityGroupsSupportedFixed object from a json dictionary."""
+ args = {}
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
+ else:
+ raise ValueError('Required property \'type\' not present in LoadBalancerProfileSecurityGroupsSupportedFixed JSON')
+ if (value := _dict.get('value')) is not None:
+ args['value'] = value
+ else:
+ raise ValueError('Required property \'value\' not present in LoadBalancerProfileSecurityGroupsSupportedFixed JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a LoadBalancerProfileSecurityGroupsSupportedFixed object from a json dictionary."""
+ return cls.from_dict(_dict)
+
+ def to_dict(self) -> Dict:
+ """Return a json dictionary representing this model."""
+ _dict = {}
+ if hasattr(self, '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 LoadBalancerProfileSecurityGroupsSupportedFixed object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'LoadBalancerProfileSecurityGroupsSupportedFixed') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'LoadBalancerProfileSecurityGroupsSupportedFixed') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+ class TypeEnum(str, Enum):
+ """
+ The type for this profile field.
+ """
+
+ FIXED = 'fixed'
+
+
+
+class LoadBalancerProfileUDPSupportedDependent(LoadBalancerProfileUDPSupported):
+ """
+ The UDP support for a load balancer with this profile depends on its configuration.
+
+ :param str type: The type for this profile field.
+ """
+
+ def __init__(
+ self,
+ type: str,
+ ) -> None:
+ """
+ Initialize a LoadBalancerProfileUDPSupportedDependent object.
+
+ :param str type: The type for this profile field.
+ """
+ # pylint: disable=super-init-not-called
+ self.type = type
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'LoadBalancerProfileUDPSupportedDependent':
+ """Initialize a LoadBalancerProfileUDPSupportedDependent object from a json dictionary."""
+ args = {}
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
+ else:
+ raise ValueError('Required property \'type\' not present in LoadBalancerProfileUDPSupportedDependent JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a LoadBalancerProfileUDPSupportedDependent object from a json dictionary."""
+ return cls.from_dict(_dict)
+
+ def to_dict(self) -> Dict:
+ """Return a json dictionary representing this model."""
+ _dict = {}
+ if hasattr(self, 'type') and self.type is not None:
+ _dict['type'] = self.type
+ return _dict
+
+ def _to_dict(self):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
+
+ def __str__(self) -> str:
+ """Return a `str` version of this LoadBalancerProfileUDPSupportedDependent object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'LoadBalancerProfileUDPSupportedDependent') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'LoadBalancerProfileUDPSupportedDependent') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+ class TypeEnum(str, Enum):
+ """
+ The type for this profile field.
+ """
+
+ DEPENDENT = 'dependent'
+
+
+
+class LoadBalancerProfileUDPSupportedFixed(LoadBalancerProfileUDPSupported):
+ """
+ The UDP support for a load balancer with this profile.
+
+ :param str type: The type for this profile field.
+ :param bool value: The value for this profile field.
+ """
+
+ def __init__(
+ self,
+ type: str,
+ value: bool,
+ ) -> None:
+ """
+ Initialize a LoadBalancerProfileUDPSupportedFixed object.
+
+ :param str type: The type for this profile field.
+ :param bool value: The value for this profile field.
+ """
+ # pylint: disable=super-init-not-called
+ self.type = type
+ self.value = value
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'LoadBalancerProfileUDPSupportedFixed':
+ """Initialize a LoadBalancerProfileUDPSupportedFixed object from a json dictionary."""
+ args = {}
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
+ else:
+ raise ValueError('Required property \'type\' not present in LoadBalancerProfileUDPSupportedFixed JSON')
+ if (value := _dict.get('value')) is not None:
+ args['value'] = value
+ else:
+ raise ValueError('Required property \'value\' not present in LoadBalancerProfileUDPSupportedFixed JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a LoadBalancerProfileUDPSupportedFixed object from a json dictionary."""
+ return cls.from_dict(_dict)
+
+ def to_dict(self) -> Dict:
+ """Return a json dictionary representing this model."""
+ _dict = {}
+ if hasattr(self, 'type') and self.type is not None:
+ _dict['type'] = self.type
+ if hasattr(self, 'value') and self.value is not None:
+ _dict['value'] = self.value
+ return _dict
+
+ def _to_dict(self):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
+
+ def __str__(self) -> str:
+ """Return a `str` version of this LoadBalancerProfileUDPSupportedFixed object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'LoadBalancerProfileUDPSupportedFixed') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'LoadBalancerProfileUDPSupportedFixed') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+ class TypeEnum(str, Enum):
+ """
+ The type for this profile field.
+ """
+
+ FIXED = 'fixed'
+
+
+
+class NetworkACLIdentityByCRN(NetworkACLIdentity):
+ """
+ NetworkACLIdentityByCRN.
+
+ :param str crn: The CRN for this network ACL.
+ """
+
+ def __init__(
+ self,
+ crn: str,
+ ) -> None:
+ """
+ Initialize a NetworkACLIdentityByCRN object.
+
+ :param str crn: The CRN for this network ACL.
+ """
+ # pylint: disable=super-init-not-called
+ self.crn = crn
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'NetworkACLIdentityByCRN':
+ """Initialize a NetworkACLIdentityByCRN object from a json dictionary."""
+ args = {}
+ if (crn := _dict.get('crn')) is not None:
+ args['crn'] = crn
+ else:
+ raise ValueError('Required property \'crn\' not present in NetworkACLIdentityByCRN JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a NetworkACLIdentityByCRN object from a json dictionary."""
+ return cls.from_dict(_dict)
+
+ def to_dict(self) -> Dict:
+ """Return a json dictionary representing this model."""
+ _dict = {}
+ if hasattr(self, 'crn') and self.crn is not None:
+ _dict['crn'] = self.crn
+ return _dict
+
+ def _to_dict(self):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
+
+ def __str__(self) -> str:
+ """Return a `str` version of this NetworkACLIdentityByCRN object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'NetworkACLIdentityByCRN') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'NetworkACLIdentityByCRN') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+
+class NetworkACLIdentityByHref(NetworkACLIdentity):
+ """
+ NetworkACLIdentityByHref.
+
+ :param str href: The URL for this network ACL.
+ """
+
+ def __init__(
+ self,
+ href: str,
+ ) -> None:
+ """
+ Initialize a NetworkACLIdentityByHref object.
+
+ :param str href: The URL for this network ACL.
+ """
+ # pylint: disable=super-init-not-called
+ self.href = href
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'NetworkACLIdentityByHref':
+ """Initialize a NetworkACLIdentityByHref object from a json dictionary."""
+ args = {}
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
+ else:
+ raise ValueError('Required property \'href\' not present in NetworkACLIdentityByHref JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a NetworkACLIdentityByHref object from a json dictionary."""
+ return cls.from_dict(_dict)
+
+ def to_dict(self) -> Dict:
+ """Return a json dictionary representing this model."""
+ _dict = {}
+ if hasattr(self, '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 NetworkACLIdentityByHref object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'NetworkACLIdentityByHref') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'NetworkACLIdentityByHref') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+
+class NetworkACLIdentityById(NetworkACLIdentity):
+ """
+ NetworkACLIdentityById.
+
+ :param str id: The unique identifier for this network ACL.
+ """
+
+ def __init__(
+ self,
+ id: str,
+ ) -> None:
+ """
+ Initialize a NetworkACLIdentityById object.
+
+ :param str id: The unique identifier for this network ACL.
+ """
+ # pylint: disable=super-init-not-called
+ self.id = id
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'NetworkACLIdentityById':
+ """Initialize a NetworkACLIdentityById object from a json dictionary."""
+ args = {}
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
+ else:
+ raise ValueError('Required property \'id\' not present in NetworkACLIdentityById JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a NetworkACLIdentityById object from a json dictionary."""
+ return cls.from_dict(_dict)
+
+ def to_dict(self) -> Dict:
+ """Return a json dictionary representing this model."""
+ _dict = {}
+ if hasattr(self, 'id') and self.id is not None:
+ _dict['id'] = self.id
+ return _dict
+
+ def _to_dict(self):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
+
+ def __str__(self) -> str:
+ """Return a `str` version of this NetworkACLIdentityById object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'NetworkACLIdentityById') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'NetworkACLIdentityById') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+
+class NetworkACLPrototypeNetworkACLByRules(NetworkACLPrototype):
+ """
+ NetworkACLPrototypeNetworkACLByRules.
+
+ :param str name: (optional) The name for this network ACL. The name must not be
+ used by another network ACL for the VPC. If unspecified, the name will be a
+ hyphenated list of randomly-selected words.
+ :param ResourceGroupIdentity resource_group: (optional)
+ :param VPCIdentity vpc: The VPC this network ACL will reside in.
+ :param List[NetworkACLRulePrototypeNetworkACLContext] rules: (optional) The
+ prototype objects for rules to create along with this network ACL. If
+ unspecified, no rules will be created, resulting in all traffic being denied.
+ """
+
+ def __init__(
+ self,
+ vpc: 'VPCIdentity',
+ *,
+ name: Optional[str] = None,
+ resource_group: Optional['ResourceGroupIdentity'] = None,
+ rules: Optional[List['NetworkACLRulePrototypeNetworkACLContext']] = None,
+ ) -> None:
+ """
+ Initialize a NetworkACLPrototypeNetworkACLByRules object.
+
+ :param VPCIdentity vpc: The VPC this network ACL will reside in.
+ :param str name: (optional) The name for this network ACL. The name must
+ not be used by another network ACL for the VPC. If unspecified, the name
+ will be a hyphenated list of randomly-selected words.
+ :param ResourceGroupIdentity resource_group: (optional)
+ :param List[NetworkACLRulePrototypeNetworkACLContext] rules: (optional) The
+ prototype objects for rules to create along with this network ACL. If
+ unspecified, no rules will be created, resulting in all traffic being
+ denied.
+ """
+ # pylint: disable=super-init-not-called
+ self.name = name
+ self.resource_group = resource_group
+ self.vpc = vpc
+ self.rules = rules
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'NetworkACLPrototypeNetworkACLByRules':
+ """Initialize a NetworkACLPrototypeNetworkACLByRules object from a json dictionary."""
+ args = {}
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ if (resource_group := _dict.get('resource_group')) is not None:
+ args['resource_group'] = resource_group
+ if (vpc := _dict.get('vpc')) is not None:
+ args['vpc'] = vpc
+ else:
+ raise ValueError('Required property \'vpc\' not present in NetworkACLPrototypeNetworkACLByRules JSON')
+ if (rules := _dict.get('rules')) is not None:
+ args['rules'] = [NetworkACLRulePrototypeNetworkACLContext.from_dict(v) for v in rules]
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a NetworkACLPrototypeNetworkACLByRules object from a json dictionary."""
+ return cls.from_dict(_dict)
+
+ def to_dict(self) -> Dict:
+ """Return a json dictionary representing this model."""
+ _dict = {}
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ if hasattr(self, 'resource_group') and self.resource_group is not None:
+ if isinstance(self.resource_group, dict):
+ _dict['resource_group'] = self.resource_group
+ else:
+ _dict['resource_group'] = self.resource_group.to_dict()
+ if hasattr(self, 'vpc') and self.vpc is not None:
+ if isinstance(self.vpc, dict):
+ _dict['vpc'] = self.vpc
+ else:
+ _dict['vpc'] = self.vpc.to_dict()
+ if hasattr(self, 'rules') and self.rules is not None:
+ rules_list = []
+ for v in self.rules:
+ if isinstance(v, dict):
+ rules_list.append(v)
+ else:
+ rules_list.append(v.to_dict())
+ _dict['rules'] = rules_list
+ return _dict
+
+ def _to_dict(self):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
+
+ def __str__(self) -> str:
+ """Return a `str` version of this NetworkACLPrototypeNetworkACLByRules object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'NetworkACLPrototypeNetworkACLByRules') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'NetworkACLPrototypeNetworkACLByRules') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+
+class NetworkACLPrototypeNetworkACLBySourceNetworkACL(NetworkACLPrototype):
+ """
+ NetworkACLPrototypeNetworkACLBySourceNetworkACL.
+
+ :param str name: (optional) The name for this network ACL. The name must not be
+ used by another network ACL for the VPC. If unspecified, the name will be a
+ hyphenated list of randomly-selected words.
+ :param ResourceGroupIdentity resource_group: (optional)
+ :param VPCIdentity vpc: The VPC this network ACL will reside in.
+ :param NetworkACLIdentity source_network_acl: Network ACL to copy rules from.
+ """
+
+ def __init__(
+ self,
+ vpc: 'VPCIdentity',
+ source_network_acl: 'NetworkACLIdentity',
+ *,
+ name: Optional[str] = None,
+ resource_group: Optional['ResourceGroupIdentity'] = None,
+ ) -> None:
+ """
+ Initialize a NetworkACLPrototypeNetworkACLBySourceNetworkACL object.
+
+ :param VPCIdentity vpc: The VPC this network ACL will reside in.
+ :param NetworkACLIdentity source_network_acl: Network ACL to copy rules
+ from.
+ :param str name: (optional) The name for this network ACL. The name must
+ not be used by another network ACL for the VPC. If unspecified, the name
+ will be a hyphenated list of randomly-selected words.
+ :param ResourceGroupIdentity resource_group: (optional)
+ """
+ # pylint: disable=super-init-not-called
+ self.name = name
+ self.resource_group = resource_group
+ self.vpc = vpc
+ self.source_network_acl = source_network_acl
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'NetworkACLPrototypeNetworkACLBySourceNetworkACL':
+ """Initialize a NetworkACLPrototypeNetworkACLBySourceNetworkACL object from a json dictionary."""
+ args = {}
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ if (resource_group := _dict.get('resource_group')) is not None:
+ args['resource_group'] = resource_group
+ if (vpc := _dict.get('vpc')) is not None:
+ args['vpc'] = vpc
+ else:
+ raise ValueError('Required property \'vpc\' not present in NetworkACLPrototypeNetworkACLBySourceNetworkACL JSON')
+ if (source_network_acl := _dict.get('source_network_acl')) is not None:
+ args['source_network_acl'] = source_network_acl
+ else:
+ raise ValueError('Required property \'source_network_acl\' not present in NetworkACLPrototypeNetworkACLBySourceNetworkACL JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a NetworkACLPrototypeNetworkACLBySourceNetworkACL object from a json dictionary."""
+ return cls.from_dict(_dict)
+
+ def to_dict(self) -> Dict:
+ """Return a json dictionary representing this model."""
+ _dict = {}
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ if hasattr(self, 'resource_group') and self.resource_group is not None:
+ if isinstance(self.resource_group, dict):
+ _dict['resource_group'] = self.resource_group
+ else:
+ _dict['resource_group'] = self.resource_group.to_dict()
+ if hasattr(self, 'vpc') and self.vpc is not None:
+ if isinstance(self.vpc, dict):
+ _dict['vpc'] = self.vpc
+ else:
+ _dict['vpc'] = self.vpc.to_dict()
+ if hasattr(self, 'source_network_acl') and self.source_network_acl is not None:
+ if isinstance(self.source_network_acl, dict):
+ _dict['source_network_acl'] = self.source_network_acl
+ else:
+ _dict['source_network_acl'] = self.source_network_acl.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 NetworkACLPrototypeNetworkACLBySourceNetworkACL object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'NetworkACLPrototypeNetworkACLBySourceNetworkACL') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'NetworkACLPrototypeNetworkACLBySourceNetworkACL') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+
+class NetworkACLRuleBeforePatchNetworkACLRuleIdentityByHref(NetworkACLRuleBeforePatch):
+ """
+ NetworkACLRuleBeforePatchNetworkACLRuleIdentityByHref.
+
+ :param str href: The URL for this network ACL rule.
+ """
+
+ def __init__(
+ self,
+ href: str,
+ ) -> None:
+ """
+ Initialize a NetworkACLRuleBeforePatchNetworkACLRuleIdentityByHref object.
+
+ :param str href: The URL for this network ACL rule.
+ """
+ # pylint: disable=super-init-not-called
+ self.href = href
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'NetworkACLRuleBeforePatchNetworkACLRuleIdentityByHref':
+ """Initialize a NetworkACLRuleBeforePatchNetworkACLRuleIdentityByHref object from a json dictionary."""
+ args = {}
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
+ else:
+ raise ValueError('Required property \'href\' not present in NetworkACLRuleBeforePatchNetworkACLRuleIdentityByHref JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a NetworkACLRuleBeforePatchNetworkACLRuleIdentityByHref object from a json dictionary."""
+ return cls.from_dict(_dict)
+
+ def to_dict(self) -> Dict:
+ """Return a json dictionary representing this model."""
+ _dict = {}
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
+ return _dict
+
+ def _to_dict(self):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
+
+ def __str__(self) -> str:
+ """Return a `str` version of this NetworkACLRuleBeforePatchNetworkACLRuleIdentityByHref object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'NetworkACLRuleBeforePatchNetworkACLRuleIdentityByHref') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'NetworkACLRuleBeforePatchNetworkACLRuleIdentityByHref') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+
+class NetworkACLRuleBeforePatchNetworkACLRuleIdentityById(NetworkACLRuleBeforePatch):
+ """
+ NetworkACLRuleBeforePatchNetworkACLRuleIdentityById.
+
+ :param str id: The unique identifier for this network ACL rule.
+ """
+
+ def __init__(
+ self,
+ id: str,
+ ) -> None:
+ """
+ Initialize a NetworkACLRuleBeforePatchNetworkACLRuleIdentityById object.
+
+ :param str id: The unique identifier for this network ACL rule.
+ """
+ # pylint: disable=super-init-not-called
+ self.id = id
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'NetworkACLRuleBeforePatchNetworkACLRuleIdentityById':
+ """Initialize a NetworkACLRuleBeforePatchNetworkACLRuleIdentityById object from a json dictionary."""
+ args = {}
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
+ else:
+ raise ValueError('Required property \'id\' not present in NetworkACLRuleBeforePatchNetworkACLRuleIdentityById JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a NetworkACLRuleBeforePatchNetworkACLRuleIdentityById object from a json dictionary."""
+ return cls.from_dict(_dict)
+
+ def to_dict(self) -> Dict:
+ """Return a json dictionary representing this model."""
+ _dict = {}
+ if hasattr(self, '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 NetworkACLRuleBeforePatchNetworkACLRuleIdentityById object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'NetworkACLRuleBeforePatchNetworkACLRuleIdentityById') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'NetworkACLRuleBeforePatchNetworkACLRuleIdentityById') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+
+class NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByHref(NetworkACLRuleBeforePrototype):
+ """
+ NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByHref.
+
+ :param str href: The URL for this network ACL rule.
+ """
+
+ def __init__(
+ self,
+ href: str,
+ ) -> None:
+ """
+ Initialize a NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByHref object.
+
+ :param str href: The URL for this network ACL rule.
+ """
+ # pylint: disable=super-init-not-called
+ self.href = href
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByHref':
+ """Initialize a NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByHref object from a json dictionary."""
+ args = {}
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
+ else:
+ raise ValueError('Required property \'href\' not present in NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByHref JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByHref object from 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 NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByHref object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByHref') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByHref') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+
+class NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityById(NetworkACLRuleBeforePrototype):
+ """
+ NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityById.
+
+ :param str id: The unique identifier for this network ACL rule.
+ """
+
+ def __init__(
+ self,
+ id: str,
+ ) -> None:
+ """
+ Initialize a NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityById object.
+
+ :param str id: The unique identifier for this network ACL rule.
+ """
+ # pylint: disable=super-init-not-called
+ self.id = id
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityById':
+ """Initialize a NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityById object from a json dictionary."""
+ args = {}
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
+ else:
+ raise ValueError('Required property \'id\' not present in NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityById JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityById object from 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 NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityById object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityById') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityById') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+
+class NetworkACLRuleItemNetworkACLRuleProtocolAll(NetworkACLRuleItem):
+ """
+ NetworkACLRuleItemNetworkACLRuleProtocolAll.
+
+ :param str action: The action to perform for a packet matching the rule.
+ :param NetworkACLRuleReference before: (optional) The rule that this rule is
+ immediately before. In a rule collection, this always refers to the next item in
+ the collection. If absent, this is the last rule.
+ :param datetime created_at: The date and time that the rule was created.
+ :param str destination: The destination IP address or CIDR block to match. The
+ CIDR block `0.0.0.0/0` matches all destination addresses.
+ :param str direction: The direction of traffic to match.
+ :param str href: The URL for this network ACL rule.
+ :param str id: The unique identifier for this network ACL rule.
+ :param str ip_version: The IP version for this rule.
+ :param str name: The name for this network ACL rule. The name is unique across
+ all rules for the network ACL.
+ :param str source: The source IP address or CIDR block to match. The CIDR block
+ `0.0.0.0/0` matches all source addresses.
+ :param str protocol: The protocol to enforce.
+ """
+
+ def __init__(
+ self,
+ action: str,
+ created_at: datetime,
+ destination: str,
+ direction: str,
+ href: str,
+ id: str,
+ ip_version: str,
+ name: str,
+ source: str,
+ protocol: str,
+ *,
+ before: Optional['NetworkACLRuleReference'] = None,
+ ) -> None:
+ """
+ Initialize a NetworkACLRuleItemNetworkACLRuleProtocolAll object.
+
+ :param str action: The action to perform for a packet matching the rule.
+ :param datetime created_at: The date and time that the rule was created.
+ :param str destination: The destination IP address or CIDR block to match.
+ The CIDR block `0.0.0.0/0` matches all destination addresses.
+ :param str direction: The direction of traffic to match.
+ :param str href: The URL for this network ACL rule.
+ :param str id: The unique identifier for this network ACL rule.
+ :param str ip_version: The IP version for this rule.
+ :param str name: The name for this network ACL rule. The name is unique
+ across all rules for the network ACL.
+ :param str source: The source IP address or CIDR block to match. The CIDR
+ block `0.0.0.0/0` matches all source addresses.
+ :param str protocol: The protocol to enforce.
+ :param NetworkACLRuleReference before: (optional) The rule that this rule
+ is immediately before. In a rule collection, this always refers to the next
+ item in the collection. If absent, this is the last rule.
+ """
+ # pylint: disable=super-init-not-called
+ self.action = action
+ self.before = before
+ self.created_at = created_at
+ self.destination = destination
+ self.direction = direction
+ self.href = href
+ self.id = id
+ self.ip_version = ip_version
+ self.name = name
+ self.source = source
+ self.protocol = protocol
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'NetworkACLRuleItemNetworkACLRuleProtocolAll':
+ """Initialize a NetworkACLRuleItemNetworkACLRuleProtocolAll object from a json dictionary."""
+ args = {}
+ if (action := _dict.get('action')) is not None:
+ args['action'] = action
+ else:
+ raise ValueError('Required property \'action\' not present in NetworkACLRuleItemNetworkACLRuleProtocolAll JSON')
+ if (before := _dict.get('before')) is not None:
+ args['before'] = NetworkACLRuleReference.from_dict(before)
+ if (created_at := _dict.get('created_at')) is not None:
+ args['created_at'] = string_to_datetime(created_at)
+ else:
+ raise ValueError('Required property \'created_at\' not present in NetworkACLRuleItemNetworkACLRuleProtocolAll JSON')
+ if (destination := _dict.get('destination')) is not None:
+ args['destination'] = destination
+ else:
+ raise ValueError('Required property \'destination\' not present in NetworkACLRuleItemNetworkACLRuleProtocolAll JSON')
+ if (direction := _dict.get('direction')) is not None:
+ args['direction'] = direction
+ else:
+ raise ValueError('Required property \'direction\' not present in NetworkACLRuleItemNetworkACLRuleProtocolAll JSON')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
+ else:
+ raise ValueError('Required property \'href\' not present in NetworkACLRuleItemNetworkACLRuleProtocolAll JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
+ else:
+ raise ValueError('Required property \'id\' not present in NetworkACLRuleItemNetworkACLRuleProtocolAll JSON')
+ if (ip_version := _dict.get('ip_version')) is not None:
+ args['ip_version'] = ip_version
+ else:
+ raise ValueError('Required property \'ip_version\' not present in NetworkACLRuleItemNetworkACLRuleProtocolAll JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ else:
+ raise ValueError('Required property \'name\' not present in NetworkACLRuleItemNetworkACLRuleProtocolAll JSON')
+ if (source := _dict.get('source')) is not None:
+ args['source'] = source
+ else:
+ raise ValueError('Required property \'source\' not present in NetworkACLRuleItemNetworkACLRuleProtocolAll JSON')
+ if (protocol := _dict.get('protocol')) is not None:
+ args['protocol'] = protocol
+ else:
+ raise ValueError('Required property \'protocol\' not present in NetworkACLRuleItemNetworkACLRuleProtocolAll JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a NetworkACLRuleItemNetworkACLRuleProtocolAll object from a json dictionary."""
+ return cls.from_dict(_dict)
+
+ def to_dict(self) -> Dict:
+ """Return a json dictionary representing this model."""
+ _dict = {}
+ if hasattr(self, 'action') and self.action is not None:
+ _dict['action'] = self.action
+ if hasattr(self, 'before') and self.before is not None:
+ if isinstance(self.before, dict):
+ _dict['before'] = self.before
+ else:
+ _dict['before'] = self.before.to_dict()
+ if hasattr(self, 'created_at') and self.created_at is not None:
+ _dict['created_at'] = datetime_to_string(self.created_at)
+ if hasattr(self, 'destination') and self.destination is not None:
+ _dict['destination'] = self.destination
+ if hasattr(self, 'direction') and self.direction is not None:
+ _dict['direction'] = self.direction
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
+ if hasattr(self, 'id') and self.id is not None:
+ _dict['id'] = self.id
+ if hasattr(self, 'ip_version') and self.ip_version is not None:
+ _dict['ip_version'] = self.ip_version
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ if hasattr(self, 'source') and self.source is not None:
+ _dict['source'] = self.source
+ if hasattr(self, 'protocol') and self.protocol is not None:
+ _dict['protocol'] = self.protocol
+ return _dict
+
+ def _to_dict(self):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
+
+ def __str__(self) -> str:
+ """Return a `str` version of this NetworkACLRuleItemNetworkACLRuleProtocolAll object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'NetworkACLRuleItemNetworkACLRuleProtocolAll') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'NetworkACLRuleItemNetworkACLRuleProtocolAll') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+ class ActionEnum(str, Enum):
+ """
+ The action to perform for a packet matching the rule.
+ """
+
+ ALLOW = 'allow'
+ DENY = 'deny'
+
+
+ class DirectionEnum(str, Enum):
+ """
+ The direction of traffic to match.
+ """
+
+ INBOUND = 'inbound'
+ OUTBOUND = 'outbound'
+
+
+ class IpVersionEnum(str, Enum):
+ """
+ The IP version for this rule.
+ """
+
+ IPV4 = 'ipv4'
+
+
+ class ProtocolEnum(str, Enum):
+ """
+ The protocol to enforce.
+ """
+
+ ALL = 'all'
+
+
+
+class NetworkACLRuleItemNetworkACLRuleProtocolICMP(NetworkACLRuleItem):
+ """
+ NetworkACLRuleItemNetworkACLRuleProtocolICMP.
+
+ :param str action: The action to perform for a packet matching the rule.
+ :param NetworkACLRuleReference before: (optional) The rule that this rule is
+ immediately before. In a rule collection, this always refers to the next item in
+ the collection. If absent, this is the last rule.
+ :param datetime created_at: The date and time that the rule was created.
+ :param str destination: The destination IP address or CIDR block to match. The
+ CIDR block `0.0.0.0/0` matches all destination addresses.
+ :param str direction: The direction of traffic to match.
+ :param str href: The URL for this network ACL rule.
+ :param str id: The unique identifier for this network ACL rule.
+ :param str ip_version: The IP version for this rule.
+ :param str name: The name for this network ACL rule. The name is unique across
+ all rules for the network ACL.
+ :param str source: The source IP address or CIDR block to match. The CIDR block
+ `0.0.0.0/0` matches all source addresses.
+ :param int code: (optional) The ICMP traffic code to match.
+ If absent, all codes are matched.
+ :param str protocol: The protocol to enforce.
+ :param int type: (optional) The ICMP traffic type to match.
+ If absent, all types are matched.
+ """
+
+ def __init__(
+ self,
+ action: str,
+ created_at: datetime,
+ destination: str,
+ direction: str,
+ href: str,
+ id: str,
+ ip_version: str,
+ name: str,
+ source: str,
+ protocol: str,
+ *,
+ before: Optional['NetworkACLRuleReference'] = None,
+ code: Optional[int] = None,
+ type: Optional[int] = None,
+ ) -> None:
+ """
+ Initialize a NetworkACLRuleItemNetworkACLRuleProtocolICMP object.
+
+ :param str action: The action to perform for a packet matching the rule.
+ :param datetime created_at: The date and time that the rule was created.
+ :param str destination: The destination IP address or CIDR block to match.
+ The CIDR block `0.0.0.0/0` matches all destination addresses.
+ :param str direction: The direction of traffic to match.
+ :param str href: The URL for this network ACL rule.
+ :param str id: The unique identifier for this network ACL rule.
+ :param str ip_version: The IP version for this rule.
+ :param str name: The name for this network ACL rule. The name is unique
+ across all rules for the network ACL.
+ :param str source: The source IP address or CIDR block to match. The CIDR
+ block `0.0.0.0/0` matches all source addresses.
+ :param str protocol: The protocol to enforce.
+ :param NetworkACLRuleReference before: (optional) The rule that this rule
+ is immediately before. In a rule collection, this always refers to the next
+ item in the collection. If absent, this is the last rule.
+ :param int code: (optional) The ICMP traffic code to match.
+ If absent, all codes are matched.
+ :param int type: (optional) The ICMP traffic type to match.
+ If absent, all types are matched.
+ """
+ # pylint: disable=super-init-not-called
+ self.action = action
+ self.before = before
+ self.created_at = created_at
+ self.destination = destination
+ self.direction = direction
+ self.href = href
+ self.id = id
+ self.ip_version = ip_version
+ self.name = name
+ self.source = source
+ self.code = code
+ self.protocol = protocol
+ self.type = type
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'NetworkACLRuleItemNetworkACLRuleProtocolICMP':
+ """Initialize a NetworkACLRuleItemNetworkACLRuleProtocolICMP object from a json dictionary."""
+ args = {}
+ if (action := _dict.get('action')) is not None:
+ args['action'] = action
+ else:
+ raise ValueError('Required property \'action\' not present in NetworkACLRuleItemNetworkACLRuleProtocolICMP JSON')
+ if (before := _dict.get('before')) is not None:
+ args['before'] = NetworkACLRuleReference.from_dict(before)
+ if (created_at := _dict.get('created_at')) is not None:
+ args['created_at'] = string_to_datetime(created_at)
+ else:
+ raise ValueError('Required property \'created_at\' not present in NetworkACLRuleItemNetworkACLRuleProtocolICMP JSON')
+ if (destination := _dict.get('destination')) is not None:
+ args['destination'] = destination
+ else:
+ raise ValueError('Required property \'destination\' not present in NetworkACLRuleItemNetworkACLRuleProtocolICMP JSON')
+ if (direction := _dict.get('direction')) is not None:
+ args['direction'] = direction
+ else:
+ raise ValueError('Required property \'direction\' not present in NetworkACLRuleItemNetworkACLRuleProtocolICMP JSON')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
+ else:
+ raise ValueError('Required property \'href\' not present in NetworkACLRuleItemNetworkACLRuleProtocolICMP JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
+ else:
+ raise ValueError('Required property \'id\' not present in NetworkACLRuleItemNetworkACLRuleProtocolICMP JSON')
+ if (ip_version := _dict.get('ip_version')) is not None:
+ args['ip_version'] = ip_version
+ else:
+ raise ValueError('Required property \'ip_version\' not present in NetworkACLRuleItemNetworkACLRuleProtocolICMP JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ else:
+ raise ValueError('Required property \'name\' not present in NetworkACLRuleItemNetworkACLRuleProtocolICMP JSON')
+ if (source := _dict.get('source')) is not None:
+ args['source'] = source
+ else:
+ raise ValueError('Required property \'source\' not present in NetworkACLRuleItemNetworkACLRuleProtocolICMP JSON')
+ if (code := _dict.get('code')) is not None:
+ args['code'] = code
+ if (protocol := _dict.get('protocol')) is not None:
+ args['protocol'] = protocol
+ else:
+ raise ValueError('Required property \'protocol\' not present in NetworkACLRuleItemNetworkACLRuleProtocolICMP JSON')
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a NetworkACLRuleItemNetworkACLRuleProtocolICMP object from a json dictionary."""
+ return cls.from_dict(_dict)
+
+ def to_dict(self) -> Dict:
+ """Return a json dictionary representing this model."""
+ _dict = {}
+ if hasattr(self, 'action') and self.action is not None:
+ _dict['action'] = self.action
+ if hasattr(self, 'before') and self.before is not None:
+ if isinstance(self.before, dict):
+ _dict['before'] = self.before
+ else:
+ _dict['before'] = self.before.to_dict()
+ if hasattr(self, 'created_at') and self.created_at is not None:
+ _dict['created_at'] = datetime_to_string(self.created_at)
+ if hasattr(self, 'destination') and self.destination is not None:
+ _dict['destination'] = self.destination
+ if hasattr(self, 'direction') and self.direction is not None:
+ _dict['direction'] = self.direction
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
+ if hasattr(self, 'id') and self.id is not None:
+ _dict['id'] = self.id
+ if hasattr(self, 'ip_version') and self.ip_version is not None:
+ _dict['ip_version'] = self.ip_version
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ if hasattr(self, 'source') and self.source is not None:
+ _dict['source'] = self.source
+ if hasattr(self, 'code') and self.code is not None:
+ _dict['code'] = self.code
+ if hasattr(self, 'protocol') and self.protocol is not None:
+ _dict['protocol'] = self.protocol
+ if hasattr(self, 'type') and self.type is not None:
+ _dict['type'] = self.type
+ return _dict
+
+ def _to_dict(self):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
+
+ def __str__(self) -> str:
+ """Return a `str` version of this NetworkACLRuleItemNetworkACLRuleProtocolICMP object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'NetworkACLRuleItemNetworkACLRuleProtocolICMP') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'NetworkACLRuleItemNetworkACLRuleProtocolICMP') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+ class ActionEnum(str, Enum):
+ """
+ The action to perform for a packet matching the rule.
+ """
+
+ ALLOW = 'allow'
+ DENY = 'deny'
+
+
+ class DirectionEnum(str, Enum):
+ """
+ The direction of traffic to match.
+ """
+
+ INBOUND = 'inbound'
+ OUTBOUND = 'outbound'
+
+
+ class IpVersionEnum(str, Enum):
+ """
+ The IP version for this rule.
+ """
+
+ IPV4 = 'ipv4'
+
+
+ class ProtocolEnum(str, Enum):
+ """
+ The protocol to enforce.
+ """
+
+ ICMP = 'icmp'
+
+
+
+class NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP(NetworkACLRuleItem):
+ """
+ NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP.
+
+ :param str action: The action to perform for a packet matching the rule.
+ :param NetworkACLRuleReference before: (optional) The rule that this rule is
+ immediately before. In a rule collection, this always refers to the next item in
+ the collection. If absent, this is the last rule.
+ :param datetime created_at: The date and time that the rule was created.
+ :param str destination: The destination IP address or CIDR block to match. The
+ CIDR block `0.0.0.0/0` matches all destination addresses.
+ :param str direction: The direction of traffic to match.
+ :param str href: The URL for this network ACL rule.
+ :param str id: The unique identifier for this network ACL rule.
+ :param str ip_version: The IP version for this rule.
+ :param str name: The name for this network ACL rule. The name is unique across
+ all rules for the network ACL.
+ :param str source: The source IP address or CIDR block to match. The CIDR block
+ `0.0.0.0/0` matches all source addresses.
+ :param int destination_port_max: The inclusive upper bound of TCP/UDP
+ destination port range.
+ :param int destination_port_min: The inclusive lower bound of TCP/UDP
+ destination port range.
+ :param str protocol: The protocol to enforce.
+ :param int source_port_max: The inclusive upper bound of TCP/UDP source port
+ range.
+ :param int source_port_min: The inclusive lower bound of TCP/UDP source port
+ range.
+ """
+
+ def __init__(
+ self,
+ action: str,
+ created_at: datetime,
+ destination: str,
+ direction: str,
+ href: str,
+ id: str,
+ ip_version: str,
+ name: str,
+ source: str,
+ destination_port_max: int,
+ destination_port_min: int,
+ protocol: str,
+ source_port_max: int,
+ source_port_min: int,
+ *,
+ before: Optional['NetworkACLRuleReference'] = None,
+ ) -> None:
+ """
+ Initialize a NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP object.
+
+ :param str action: The action to perform for a packet matching the rule.
+ :param datetime created_at: The date and time that the rule was created.
+ :param str destination: The destination IP address or CIDR block to match.
+ The CIDR block `0.0.0.0/0` matches all destination addresses.
+ :param str direction: The direction of traffic to match.
+ :param str href: The URL for this network ACL rule.
+ :param str id: The unique identifier for this network ACL rule.
+ :param str ip_version: The IP version for this rule.
+ :param str name: The name for this network ACL rule. The name is unique
+ across all rules for the network ACL.
+ :param str source: The source IP address or CIDR block to match. The CIDR
+ block `0.0.0.0/0` matches all source addresses.
+ :param int destination_port_max: The inclusive upper bound of TCP/UDP
+ destination port range.
+ :param int destination_port_min: The inclusive lower bound of TCP/UDP
+ destination port range.
+ :param str protocol: The protocol to enforce.
+ :param int source_port_max: The inclusive upper bound of TCP/UDP source
+ port range.
+ :param int source_port_min: The inclusive lower bound of TCP/UDP source
+ port range.
+ :param NetworkACLRuleReference before: (optional) The rule that this rule
+ is immediately before. In a rule collection, this always refers to the next
+ item in the collection. If absent, this is the last rule.
+ """
+ # pylint: disable=super-init-not-called
+ self.action = action
+ self.before = before
+ self.created_at = created_at
+ self.destination = destination
+ self.direction = direction
+ self.href = href
+ self.id = id
+ self.ip_version = ip_version
+ self.name = name
+ self.source = source
+ self.destination_port_max = destination_port_max
+ self.destination_port_min = destination_port_min
+ self.protocol = protocol
+ self.source_port_max = source_port_max
+ self.source_port_min = source_port_min
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP':
+ """Initialize a NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP object from a json dictionary."""
+ args = {}
+ if (action := _dict.get('action')) is not None:
+ args['action'] = action
+ else:
+ raise ValueError('Required property \'action\' not present in NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP JSON')
+ if (before := _dict.get('before')) is not None:
+ args['before'] = NetworkACLRuleReference.from_dict(before)
+ if (created_at := _dict.get('created_at')) is not None:
+ args['created_at'] = string_to_datetime(created_at)
+ else:
+ raise ValueError('Required property \'created_at\' not present in NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP JSON')
+ if (destination := _dict.get('destination')) is not None:
+ args['destination'] = destination
+ else:
+ raise ValueError('Required property \'destination\' not present in NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP JSON')
+ if (direction := _dict.get('direction')) is not None:
+ args['direction'] = direction
+ else:
+ raise ValueError('Required property \'direction\' not present in NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP JSON')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
+ else:
+ raise ValueError('Required property \'href\' not present in NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
+ else:
+ raise ValueError('Required property \'id\' not present in NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP JSON')
+ if (ip_version := _dict.get('ip_version')) is not None:
+ args['ip_version'] = ip_version
+ else:
+ raise ValueError('Required property \'ip_version\' not present in NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ else:
+ raise ValueError('Required property \'name\' not present in NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP JSON')
+ if (source := _dict.get('source')) is not None:
+ args['source'] = source
+ else:
+ raise ValueError('Required property \'source\' not present in NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP JSON')
+ if (destination_port_max := _dict.get('destination_port_max')) is not None:
+ args['destination_port_max'] = destination_port_max
+ else:
+ raise ValueError('Required property \'destination_port_max\' not present in NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP JSON')
+ if (destination_port_min := _dict.get('destination_port_min')) is not None:
+ args['destination_port_min'] = destination_port_min
+ else:
+ raise ValueError('Required property \'destination_port_min\' not present in NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP JSON')
+ if (protocol := _dict.get('protocol')) is not None:
+ args['protocol'] = protocol
+ else:
+ raise ValueError('Required property \'protocol\' not present in NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP JSON')
+ if (source_port_max := _dict.get('source_port_max')) is not None:
+ args['source_port_max'] = source_port_max
+ else:
+ raise ValueError('Required property \'source_port_max\' not present in NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP JSON')
+ if (source_port_min := _dict.get('source_port_min')) is not None:
+ args['source_port_min'] = source_port_min
+ else:
+ raise ValueError('Required property \'source_port_min\' not present in NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP object from a json dictionary."""
+ return cls.from_dict(_dict)
+
+ def to_dict(self) -> Dict:
+ """Return a json dictionary representing this model."""
+ _dict = {}
+ if hasattr(self, 'action') and self.action is not None:
+ _dict['action'] = self.action
+ if hasattr(self, 'before') and self.before is not None:
+ if isinstance(self.before, dict):
+ _dict['before'] = self.before
+ else:
+ _dict['before'] = self.before.to_dict()
+ if hasattr(self, 'created_at') and self.created_at is not None:
+ _dict['created_at'] = datetime_to_string(self.created_at)
+ if hasattr(self, 'destination') and self.destination is not None:
+ _dict['destination'] = self.destination
+ if hasattr(self, 'direction') and self.direction is not None:
+ _dict['direction'] = self.direction
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
+ if hasattr(self, 'id') and self.id is not None:
+ _dict['id'] = self.id
+ if hasattr(self, 'ip_version') and self.ip_version is not None:
+ _dict['ip_version'] = self.ip_version
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ if hasattr(self, 'source') and self.source is not None:
+ _dict['source'] = self.source
+ if hasattr(self, 'destination_port_max') and self.destination_port_max is not None:
+ _dict['destination_port_max'] = self.destination_port_max
+ if hasattr(self, 'destination_port_min') and self.destination_port_min is not None:
+ _dict['destination_port_min'] = self.destination_port_min
+ if hasattr(self, 'protocol') and self.protocol is not None:
+ _dict['protocol'] = self.protocol
+ if hasattr(self, 'source_port_max') and self.source_port_max is not None:
+ _dict['source_port_max'] = self.source_port_max
+ if hasattr(self, 'source_port_min') and self.source_port_min is not None:
+ _dict['source_port_min'] = self.source_port_min
+ return _dict
+
+ def _to_dict(self):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
+
+ def __str__(self) -> str:
+ """Return a `str` version of this NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+ class ActionEnum(str, Enum):
+ """
+ The action to perform for a packet matching the rule.
+ """
+
+ ALLOW = 'allow'
+ DENY = 'deny'
+
+
+ class DirectionEnum(str, Enum):
+ """
+ The direction of traffic to match.
+ """
+
+ INBOUND = 'inbound'
+ OUTBOUND = 'outbound'
+
+
+ class IpVersionEnum(str, Enum):
+ """
+ The IP version for this rule.
+ """
+
+ IPV4 = 'ipv4'
+
+
+ class ProtocolEnum(str, Enum):
+ """
+ The protocol to enforce.
+ """
+
+ TCP = 'tcp'
+ UDP = 'udp'
+
+
+
+class NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype(NetworkACLRulePrototypeNetworkACLContext):
+ """
+ NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype.
+
+ :param str action: The action to perform for a packet matching the rule.
+ :param str destination: The destination IP address or CIDR block to match. The
+ CIDR block `0.0.0.0/0` matches all destination addresses.
+ :param str direction: The direction of traffic to match.
+ :param str ip_version: (optional) The IP version for this rule.
+ :param str name: (optional) The name for this network ACL rule. The name must
+ not be used by another rule for the network ACL. If unspecified, the name will
+ be a hyphenated list of randomly-selected words.
+ :param str source: The source IP address or CIDR block to match. The CIDR block
+ `0.0.0.0/0` matches all source addresses.
+ :param str protocol: The protocol to enforce.
+ """
+
+ def __init__(
+ self,
+ action: str,
+ destination: str,
+ direction: str,
+ source: str,
+ protocol: str,
+ *,
+ ip_version: Optional[str] = None,
+ name: Optional[str] = None,
+ ) -> None:
+ """
+ Initialize a NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype object.
+
+ :param str action: The action to perform for a packet matching the rule.
+ :param str destination: The destination IP address or CIDR block to match.
+ The CIDR block `0.0.0.0/0` matches all destination addresses.
+ :param str direction: The direction of traffic to match.
+ :param str source: The source IP address or CIDR block to match. The CIDR
+ block `0.0.0.0/0` matches all source addresses.
+ :param str protocol: The protocol to enforce.
+ :param str ip_version: (optional) The IP version for this rule.
+ :param str name: (optional) The name for this network ACL rule. The name
+ must not be used by another rule for the network ACL. If unspecified, the
+ name will be a hyphenated list of randomly-selected words.
+ """
+ # pylint: disable=super-init-not-called
+ self.action = action
+ self.destination = destination
+ self.direction = direction
+ self.ip_version = ip_version
+ self.name = name
+ self.source = source
+ self.protocol = protocol
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype':
+ """Initialize a NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype object from a json dictionary."""
+ args = {}
+ if (action := _dict.get('action')) is not None:
+ args['action'] = action
+ else:
+ raise ValueError('Required property \'action\' not present in NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype JSON')
+ if (destination := _dict.get('destination')) is not None:
+ args['destination'] = destination
+ else:
+ raise ValueError('Required property \'destination\' not present in NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype JSON')
+ if (direction := _dict.get('direction')) is not None:
+ args['direction'] = direction
+ else:
+ raise ValueError('Required property \'direction\' not present in NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype JSON')
+ if (ip_version := _dict.get('ip_version')) is not None:
+ args['ip_version'] = ip_version
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ if (source := _dict.get('source')) is not None:
+ args['source'] = source
+ else:
+ raise ValueError('Required property \'source\' not present in NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype JSON')
+ if (protocol := _dict.get('protocol')) is not None:
+ args['protocol'] = protocol
+ else:
+ raise ValueError('Required property \'protocol\' not present in NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype object from a json dictionary."""
+ return cls.from_dict(_dict)
+
+ def to_dict(self) -> Dict:
+ """Return a json dictionary representing this model."""
+ _dict = {}
+ if hasattr(self, 'action') and self.action is not None:
+ _dict['action'] = self.action
+ if hasattr(self, 'destination') and self.destination is not None:
+ _dict['destination'] = self.destination
+ if hasattr(self, 'direction') and self.direction is not None:
+ _dict['direction'] = self.direction
+ if hasattr(self, 'ip_version') and self.ip_version is not None:
+ _dict['ip_version'] = self.ip_version
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ if hasattr(self, 'source') and self.source is not None:
+ _dict['source'] = self.source
+ if hasattr(self, 'protocol') and self.protocol is not None:
+ _dict['protocol'] = self.protocol
+ return _dict
+
+ def _to_dict(self):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
+
+ def __str__(self) -> str:
+ """Return a `str` version of this NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+ class ActionEnum(str, Enum):
+ """
+ The action to perform for a packet matching the rule.
+ """
+
+ ALLOW = 'allow'
+ DENY = 'deny'
+
+
+ class DirectionEnum(str, Enum):
+ """
+ The direction of traffic to match.
+ """
+
+ INBOUND = 'inbound'
+ OUTBOUND = 'outbound'
+
+
+ class IpVersionEnum(str, Enum):
+ """
+ The IP version for this rule.
+ """
+
+ IPV4 = 'ipv4'
+
+
+ class ProtocolEnum(str, Enum):
+ """
+ The protocol to enforce.
+ """
+
+ ALL = 'all'
+
+
+
+class NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype(NetworkACLRulePrototypeNetworkACLContext):
+ """
+ NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype.
+
+ :param str action: The action to perform for a packet matching the rule.
+ :param str destination: The destination IP address or CIDR block to match. The
+ CIDR block `0.0.0.0/0` matches all destination addresses.
+ :param str direction: The direction of traffic to match.
+ :param str ip_version: (optional) The IP version for this rule.
+ :param str name: (optional) The name for this network ACL rule. The name must
+ not be used by another rule for the network ACL. If unspecified, the name will
+ be a hyphenated list of randomly-selected words.
+ :param str source: The source IP address or CIDR block to match. The CIDR block
+ `0.0.0.0/0` matches all source addresses.
+ :param int code: (optional) The ICMP traffic code to match.
+ If specified, `type` must also be specified. If unspecified, all codes are
+ matched.
+ :param str protocol: The protocol to enforce.
+ :param int type: (optional) The ICMP traffic type to match.
+ If unspecified, all types are matched.
+ """
+
+ def __init__(
+ self,
+ action: str,
+ destination: str,
+ direction: str,
+ source: str,
+ protocol: str,
+ *,
+ ip_version: Optional[str] = None,
+ name: Optional[str] = None,
+ code: Optional[int] = None,
+ type: Optional[int] = None,
+ ) -> None:
+ """
+ Initialize a NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype object.
+
+ :param str action: The action to perform for a packet matching the rule.
+ :param str destination: The destination IP address or CIDR block to match.
+ The CIDR block `0.0.0.0/0` matches all destination addresses.
+ :param str direction: The direction of traffic to match.
+ :param str source: The source IP address or CIDR block to match. The CIDR
+ block `0.0.0.0/0` matches all source addresses.
+ :param str protocol: The protocol to enforce.
+ :param str ip_version: (optional) The IP version for this rule.
+ :param str name: (optional) The name for this network ACL rule. The name
+ must not be used by another rule for the network ACL. If unspecified, the
+ name will be a hyphenated list of randomly-selected words.
+ :param int code: (optional) The ICMP traffic code to match.
+ If specified, `type` must also be specified. If unspecified, all codes are
+ matched.
+ :param int type: (optional) The ICMP traffic type to match.
+ If unspecified, all types are matched.
+ """
+ # pylint: disable=super-init-not-called
+ self.action = action
+ self.destination = destination
+ self.direction = direction
+ self.ip_version = ip_version
+ self.name = name
+ self.source = source
+ self.code = code
+ self.protocol = protocol
+ self.type = type
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype':
+ """Initialize a NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype object from a json dictionary."""
+ args = {}
+ if (action := _dict.get('action')) is not None:
+ args['action'] = action
+ else:
+ raise ValueError('Required property \'action\' not present in NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype JSON')
+ if (destination := _dict.get('destination')) is not None:
+ args['destination'] = destination
+ else:
+ raise ValueError('Required property \'destination\' not present in NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype JSON')
+ if (direction := _dict.get('direction')) is not None:
+ args['direction'] = direction
+ else:
+ raise ValueError('Required property \'direction\' not present in NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype JSON')
+ if (ip_version := _dict.get('ip_version')) is not None:
+ args['ip_version'] = ip_version
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ if (source := _dict.get('source')) is not None:
+ args['source'] = source
+ else:
+ raise ValueError('Required property \'source\' not present in NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype JSON')
+ if (code := _dict.get('code')) is not None:
+ args['code'] = code
+ if (protocol := _dict.get('protocol')) is not None:
+ args['protocol'] = protocol
+ else:
+ raise ValueError('Required property \'protocol\' not present in NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype JSON')
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype object from a json dictionary."""
+ return cls.from_dict(_dict)
+
+ def to_dict(self) -> Dict:
+ """Return a json dictionary representing this model."""
+ _dict = {}
+ if hasattr(self, 'action') and self.action is not None:
+ _dict['action'] = self.action
+ if hasattr(self, 'destination') and self.destination is not None:
+ _dict['destination'] = self.destination
+ if hasattr(self, 'direction') and self.direction is not None:
+ _dict['direction'] = self.direction
+ if hasattr(self, 'ip_version') and self.ip_version is not None:
+ _dict['ip_version'] = self.ip_version
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ if hasattr(self, 'source') and self.source is not None:
+ _dict['source'] = self.source
+ if hasattr(self, 'code') and self.code is not None:
+ _dict['code'] = self.code
+ if hasattr(self, 'protocol') and self.protocol is not None:
+ _dict['protocol'] = self.protocol
+ if hasattr(self, 'type') and self.type is not None:
+ _dict['type'] = self.type
+ return _dict
+
+ def _to_dict(self):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
+
+ def __str__(self) -> str:
+ """Return a `str` version of this NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+ class ActionEnum(str, Enum):
+ """
+ The action to perform for a packet matching the rule.
+ """
+
+ ALLOW = 'allow'
+ DENY = 'deny'
+
+
+ class DirectionEnum(str, Enum):
+ """
+ The direction of traffic to match.
+ """
+
+ INBOUND = 'inbound'
+ OUTBOUND = 'outbound'
+
+
+ class IpVersionEnum(str, Enum):
+ """
+ The IP version for this rule.
+ """
+
+ IPV4 = 'ipv4'
+
+
+ class ProtocolEnum(str, Enum):
+ """
+ The protocol to enforce.
+ """
+
+ ICMP = 'icmp'
+
+
+
+class NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype(NetworkACLRulePrototypeNetworkACLContext):
+ """
+ NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype.
+
+ :param str action: The action to perform for a packet matching the rule.
+ :param str destination: The destination IP address or CIDR block to match. The
+ CIDR block `0.0.0.0/0` matches all destination addresses.
+ :param str direction: The direction of traffic to match.
+ :param str ip_version: (optional) The IP version for this rule.
+ :param str name: (optional) The name for this network ACL rule. The name must
+ not be used by another rule for the network ACL. If unspecified, the name will
+ be a hyphenated list of randomly-selected words.
+ :param str source: The source IP address or CIDR block to match. The CIDR block
+ `0.0.0.0/0` matches all source addresses.
+ :param int destination_port_max: (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 protocol: The protocol to enforce.
+ :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.
+ """
+
+ def __init__(
+ self,
+ action: str,
+ destination: str,
+ direction: str,
+ source: str,
+ protocol: str,
+ *,
+ ip_version: Optional[str] = None,
+ name: Optional[str] = None,
+ destination_port_max: Optional[int] = None,
+ destination_port_min: Optional[int] = None,
+ source_port_max: Optional[int] = None,
+ source_port_min: Optional[int] = None,
+ ) -> None:
+ """
+ Initialize a NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype object.
+
+ :param str action: The action to perform for a packet matching the rule.
+ :param str destination: The destination IP address or CIDR block to match.
+ The CIDR block `0.0.0.0/0` matches all destination addresses.
+ :param str direction: The direction of traffic to match.
+ :param str source: The source IP address or CIDR block to match. The CIDR
+ block `0.0.0.0/0` matches all source addresses.
+ :param str protocol: The protocol to enforce.
+ :param str ip_version: (optional) The IP version for this rule.
+ :param str name: (optional) The name for this network ACL rule. The name
+ must not be used by another rule for the network ACL. If unspecified, the
+ name will be a hyphenated list of randomly-selected words.
+ :param int destination_port_max: (optional) The inclusive upper bound of
+ TCP/UDP destination port range.
+ :param int destination_port_min: (optional) The inclusive lower bound of
+ TCP/UDP destination port range.
+ :param int source_port_max: (optional) The inclusive upper bound of TCP/UDP
+ source port range.
+ :param int source_port_min: (optional) The inclusive lower bound of TCP/UDP
+ source port range.
+ """
+ # pylint: disable=super-init-not-called
+ self.action = action
+ self.destination = destination
+ self.direction = direction
+ self.ip_version = ip_version
+ self.name = name
+ self.source = source
+ self.destination_port_max = destination_port_max
+ self.destination_port_min = destination_port_min
+ self.protocol = protocol
+ self.source_port_max = source_port_max
+ self.source_port_min = source_port_min
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype':
+ """Initialize a NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype object from a json dictionary."""
+ args = {}
+ if (action := _dict.get('action')) is not None:
+ args['action'] = action
+ else:
+ raise ValueError('Required property \'action\' not present in NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype JSON')
+ if (destination := _dict.get('destination')) is not None:
+ args['destination'] = destination
+ else:
+ raise ValueError('Required property \'destination\' not present in NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype JSON')
+ if (direction := _dict.get('direction')) is not None:
+ args['direction'] = direction
+ else:
+ raise ValueError('Required property \'direction\' not present in NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype JSON')
+ if (ip_version := _dict.get('ip_version')) is not None:
+ args['ip_version'] = ip_version
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ if (source := _dict.get('source')) is not None:
+ args['source'] = source
+ else:
+ raise ValueError('Required property \'source\' not present in NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype JSON')
+ if (destination_port_max := _dict.get('destination_port_max')) is not None:
+ args['destination_port_max'] = destination_port_max
+ if (destination_port_min := _dict.get('destination_port_min')) is not None:
+ args['destination_port_min'] = destination_port_min
+ if (protocol := _dict.get('protocol')) is not None:
+ args['protocol'] = protocol
+ else:
+ raise ValueError('Required property \'protocol\' not present in NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype JSON')
+ if (source_port_max := _dict.get('source_port_max')) is not None:
+ args['source_port_max'] = source_port_max
+ if (source_port_min := _dict.get('source_port_min')) is not None:
+ args['source_port_min'] = source_port_min
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype object from a json dictionary."""
+ return cls.from_dict(_dict)
+
+ def to_dict(self) -> Dict:
+ """Return a json dictionary representing this model."""
+ _dict = {}
+ if hasattr(self, 'action') and self.action is not None:
+ _dict['action'] = self.action
+ if hasattr(self, 'destination') and self.destination is not None:
+ _dict['destination'] = self.destination
+ if hasattr(self, 'direction') and self.direction is not None:
+ _dict['direction'] = self.direction
+ if hasattr(self, 'ip_version') and self.ip_version is not None:
+ _dict['ip_version'] = self.ip_version
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ if hasattr(self, 'source') and self.source is not None:
+ _dict['source'] = self.source
+ if hasattr(self, 'destination_port_max') and self.destination_port_max is not None:
+ _dict['destination_port_max'] = self.destination_port_max
+ if hasattr(self, 'destination_port_min') and self.destination_port_min is not None:
+ _dict['destination_port_min'] = self.destination_port_min
+ if hasattr(self, 'protocol') and self.protocol is not None:
+ _dict['protocol'] = self.protocol
+ if hasattr(self, 'source_port_max') and self.source_port_max is not None:
+ _dict['source_port_max'] = self.source_port_max
+ if hasattr(self, 'source_port_min') and self.source_port_min is not None:
+ _dict['source_port_min'] = self.source_port_min
+ return _dict
+
+ def _to_dict(self):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
+
+ def __str__(self) -> str:
+ """Return a `str` version of this NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+ class ActionEnum(str, Enum):
+ """
+ The action to perform for a packet matching the rule.
+ """
+
+ ALLOW = 'allow'
+ DENY = 'deny'
+
+
+ class DirectionEnum(str, Enum):
+ """
+ The direction of traffic to match.
+ """
+
+ INBOUND = 'inbound'
+ OUTBOUND = 'outbound'
+
+
+ class IpVersionEnum(str, Enum):
+ """
+ The IP version for this rule.
+ """
+
+ IPV4 = 'ipv4'
+
+
+ class ProtocolEnum(str, Enum):
+ """
+ The protocol to enforce.
+ """
+
+ TCP = 'tcp'
+ UDP = 'udp'
+
+
+
+class NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype(NetworkACLRulePrototype):
+ """
+ NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype.
+
+ :param str action: The action to perform for a packet matching the rule.
+ :param NetworkACLRuleBeforePrototype before: (optional)
+ :param str destination: The destination IP address or CIDR block to match. The
+ CIDR block `0.0.0.0/0` matches all destination addresses.
+ :param str direction: The direction of traffic to match.
+ :param str ip_version: (optional) The IP version for this rule.
+ :param str name: (optional) The name for this network ACL rule. The name must
+ not be used by another rule for the network ACL. If unspecified, the name will
+ be a hyphenated list of randomly-selected words.
+ :param str source: The source IP address or CIDR block to match. The CIDR block
+ `0.0.0.0/0` matches all source addresses.
+ :param str protocol: The protocol to enforce.
+ """
+
+ def __init__(
+ self,
+ action: str,
+ destination: str,
+ direction: str,
+ source: str,
+ protocol: str,
+ *,
+ before: Optional['NetworkACLRuleBeforePrototype'] = None,
+ ip_version: Optional[str] = None,
+ name: Optional[str] = None,
+ ) -> None:
+ """
+ Initialize a NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype object.
+
+ :param str action: The action to perform for a packet matching the rule.
+ :param str destination: The destination IP address or CIDR block to match.
+ The CIDR block `0.0.0.0/0` matches all destination addresses.
+ :param str direction: The direction of traffic to match.
+ :param str source: The source IP address or CIDR block to match. The CIDR
+ block `0.0.0.0/0` matches all source addresses.
+ :param str protocol: The protocol to enforce.
+ :param NetworkACLRuleBeforePrototype before: (optional)
+ :param str ip_version: (optional) The IP version for this rule.
+ :param str name: (optional) The name for this network ACL rule. The name
+ must not be used by another rule for the network ACL. If unspecified, the
+ name will be a hyphenated list of randomly-selected words.
+ """
+ # pylint: disable=super-init-not-called
+ self.action = action
+ self.before = before
+ self.destination = destination
+ self.direction = direction
+ self.ip_version = ip_version
+ self.name = name
+ self.source = source
+ self.protocol = protocol
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype':
+ """Initialize a NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype object from a json dictionary."""
+ args = {}
+ if (action := _dict.get('action')) is not None:
+ args['action'] = action
+ else:
+ raise ValueError('Required property \'action\' not present in NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype JSON')
+ if (before := _dict.get('before')) is not None:
+ args['before'] = before
+ if (destination := _dict.get('destination')) is not None:
+ args['destination'] = destination
+ else:
+ raise ValueError('Required property \'destination\' not present in NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype JSON')
+ if (direction := _dict.get('direction')) is not None:
+ args['direction'] = direction
+ else:
+ raise ValueError('Required property \'direction\' not present in NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype JSON')
+ if (ip_version := _dict.get('ip_version')) is not None:
+ args['ip_version'] = ip_version
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ if (source := _dict.get('source')) is not None:
+ args['source'] = source
+ else:
+ raise ValueError('Required property \'source\' not present in NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype JSON')
+ if (protocol := _dict.get('protocol')) is not None:
+ args['protocol'] = protocol
+ else:
+ raise ValueError('Required property \'protocol\' not present in NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype object from a json dictionary."""
+ return cls.from_dict(_dict)
+
+ def to_dict(self) -> Dict:
+ """Return a json dictionary representing this model."""
+ _dict = {}
+ if hasattr(self, 'action') and self.action is not None:
+ _dict['action'] = self.action
+ if hasattr(self, 'before') and self.before is not None:
+ if isinstance(self.before, dict):
+ _dict['before'] = self.before
+ else:
+ _dict['before'] = self.before.to_dict()
+ if hasattr(self, 'destination') and self.destination is not None:
+ _dict['destination'] = self.destination
+ if hasattr(self, 'direction') and self.direction is not None:
+ _dict['direction'] = self.direction
+ if hasattr(self, 'ip_version') and self.ip_version is not None:
+ _dict['ip_version'] = self.ip_version
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ if hasattr(self, 'source') and self.source is not None:
+ _dict['source'] = self.source
+ if hasattr(self, 'protocol') and self.protocol is not None:
+ _dict['protocol'] = self.protocol
+ return _dict
+
+ def _to_dict(self):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
+
+ def __str__(self) -> str:
+ """Return a `str` version of this NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+ class ActionEnum(str, Enum):
+ """
+ The action to perform for a packet matching the rule.
+ """
+
+ ALLOW = 'allow'
+ DENY = 'deny'
+
+
+ class DirectionEnum(str, Enum):
+ """
+ The direction of traffic to match.
+ """
+
+ INBOUND = 'inbound'
+ OUTBOUND = 'outbound'
+
+
+ class IpVersionEnum(str, Enum):
+ """
+ The IP version for this rule.
+ """
+
+ IPV4 = 'ipv4'
+
+
+ class ProtocolEnum(str, Enum):
+ """
+ The protocol to enforce.
+ """
+
+ ALL = 'all'
+
+
+
+class NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype(NetworkACLRulePrototype):
+ """
+ NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype.
+
+ :param str action: The action to perform for a packet matching the rule.
+ :param NetworkACLRuleBeforePrototype before: (optional)
+ :param str destination: The destination IP address or CIDR block to match. The
+ CIDR block `0.0.0.0/0` matches all destination addresses.
+ :param str direction: The direction of traffic to match.
+ :param str ip_version: (optional) The IP version for this rule.
+ :param str name: (optional) The name for this network ACL rule. The name must
+ not be used by another rule for the network ACL. If unspecified, the name will
+ be a hyphenated list of randomly-selected words.
+ :param str source: The source IP address or CIDR block to match. The CIDR block
+ `0.0.0.0/0` matches all source addresses.
+ :param int code: (optional) The ICMP traffic code to match.
+ If specified, `type` must also be specified. If unspecified, all codes are
+ matched.
+ :param str protocol: The protocol to enforce.
+ :param int type: (optional) The ICMP traffic type to match.
+ If unspecified, all types are matched.
+ """
+
+ def __init__(
+ self,
+ action: str,
+ destination: str,
+ direction: str,
+ source: str,
+ protocol: str,
+ *,
+ before: Optional['NetworkACLRuleBeforePrototype'] = None,
+ ip_version: Optional[str] = None,
+ name: Optional[str] = None,
+ code: Optional[int] = None,
+ type: Optional[int] = None,
+ ) -> None:
+ """
+ Initialize a NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype object.
+
+ :param str action: The action to perform for a packet matching the rule.
+ :param str destination: The destination IP address or CIDR block to match.
+ The CIDR block `0.0.0.0/0` matches all destination addresses.
+ :param str direction: The direction of traffic to match.
+ :param str source: The source IP address or CIDR block to match. The CIDR
+ block `0.0.0.0/0` matches all source addresses.
+ :param str protocol: The protocol to enforce.
+ :param NetworkACLRuleBeforePrototype before: (optional)
+ :param str ip_version: (optional) The IP version for this rule.
+ :param str name: (optional) The name for this network ACL rule. The name
+ must not be used by another rule for the network ACL. If unspecified, the
+ name will be a hyphenated list of randomly-selected words.
+ :param int code: (optional) The ICMP traffic code to match.
+ If specified, `type` must also be specified. If unspecified, all codes are
+ matched.
+ :param int type: (optional) The ICMP traffic type to match.
+ If unspecified, all types are matched.
+ """
+ # pylint: disable=super-init-not-called
+ self.action = action
+ self.before = before
+ self.destination = destination
+ self.direction = direction
+ self.ip_version = ip_version
+ self.name = name
+ self.source = source
+ self.code = code
+ self.protocol = protocol
+ self.type = type
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype':
+ """Initialize a NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype object from a json dictionary."""
+ args = {}
+ if (action := _dict.get('action')) is not None:
+ args['action'] = action
+ else:
+ raise ValueError('Required property \'action\' not present in NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype JSON')
+ if (before := _dict.get('before')) is not None:
+ args['before'] = before
+ if (destination := _dict.get('destination')) is not None:
+ args['destination'] = destination
+ else:
+ raise ValueError('Required property \'destination\' not present in NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype JSON')
+ if (direction := _dict.get('direction')) is not None:
+ args['direction'] = direction
+ else:
+ raise ValueError('Required property \'direction\' not present in NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype JSON')
+ if (ip_version := _dict.get('ip_version')) is not None:
+ args['ip_version'] = ip_version
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ if (source := _dict.get('source')) is not None:
+ args['source'] = source
+ else:
+ raise ValueError('Required property \'source\' not present in NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype JSON')
+ if (code := _dict.get('code')) is not None:
+ args['code'] = code
+ if (protocol := _dict.get('protocol')) is not None:
+ args['protocol'] = protocol
+ else:
+ raise ValueError('Required property \'protocol\' not present in NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype JSON')
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype object from a json dictionary."""
+ return cls.from_dict(_dict)
+
+ def to_dict(self) -> Dict:
+ """Return a json dictionary representing this model."""
+ _dict = {}
+ if hasattr(self, 'action') and self.action is not None:
+ _dict['action'] = self.action
+ if hasattr(self, 'before') and self.before is not None:
+ if isinstance(self.before, dict):
+ _dict['before'] = self.before
+ else:
+ _dict['before'] = self.before.to_dict()
+ if hasattr(self, 'destination') and self.destination is not None:
+ _dict['destination'] = self.destination
+ if hasattr(self, 'direction') and self.direction is not None:
+ _dict['direction'] = self.direction
+ if hasattr(self, 'ip_version') and self.ip_version is not None:
+ _dict['ip_version'] = self.ip_version
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ if hasattr(self, 'source') and self.source is not None:
+ _dict['source'] = self.source
+ if hasattr(self, 'code') and self.code is not None:
+ _dict['code'] = self.code
+ if hasattr(self, 'protocol') and self.protocol is not None:
+ _dict['protocol'] = self.protocol
+ if hasattr(self, 'type') and self.type is not None:
+ _dict['type'] = self.type
+ return _dict
+
+ def _to_dict(self):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
+
+ def __str__(self) -> str:
+ """Return a `str` version of this NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+ class ActionEnum(str, Enum):
+ """
+ The action to perform for a packet matching the rule.
+ """
+
+ ALLOW = 'allow'
+ DENY = 'deny'
+
+
+ class DirectionEnum(str, Enum):
+ """
+ The direction of traffic to match.
+ """
+
+ INBOUND = 'inbound'
+ OUTBOUND = 'outbound'
+
+
+ class IpVersionEnum(str, Enum):
+ """
+ The IP version for this rule.
+ """
+
+ IPV4 = 'ipv4'
+
+
+ class ProtocolEnum(str, Enum):
+ """
+ The protocol to enforce.
+ """
+
+ ICMP = 'icmp'
+
+
+
+class NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype(NetworkACLRulePrototype):
+ """
+ NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype.
+
+ :param str action: The action to perform for a packet matching the rule.
+ :param NetworkACLRuleBeforePrototype before: (optional)
+ :param str destination: The destination IP address or CIDR block to match. The
+ CIDR block `0.0.0.0/0` matches all destination addresses.
+ :param str direction: The direction of traffic to match.
+ :param str ip_version: (optional) The IP version for this rule.
+ :param str name: (optional) The name for this network ACL rule. The name must
+ not be used by another rule for the network ACL. If unspecified, the name will
+ be a hyphenated list of randomly-selected words.
+ :param str source: The source IP address or CIDR block to match. The CIDR block
+ `0.0.0.0/0` matches all source addresses.
+ :param int destination_port_max: (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 protocol: The protocol to enforce.
+ :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.
+ """
+
+ def __init__(
+ self,
+ action: str,
+ destination: str,
+ direction: str,
+ source: str,
+ protocol: str,
+ *,
+ before: Optional['NetworkACLRuleBeforePrototype'] = None,
+ ip_version: Optional[str] = None,
+ name: Optional[str] = None,
+ destination_port_max: Optional[int] = None,
+ destination_port_min: Optional[int] = None,
+ source_port_max: Optional[int] = None,
+ source_port_min: Optional[int] = None,
+ ) -> None:
+ """
+ Initialize a NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype object.
+
+ :param str action: The action to perform for a packet matching the rule.
+ :param str destination: The destination IP address or CIDR block to match.
+ The CIDR block `0.0.0.0/0` matches all destination addresses.
+ :param str direction: The direction of traffic to match.
+ :param str source: The source IP address or CIDR block to match. The CIDR
+ block `0.0.0.0/0` matches all source addresses.
+ :param str protocol: The protocol to enforce.
+ :param NetworkACLRuleBeforePrototype before: (optional)
+ :param str ip_version: (optional) The IP version for this rule.
+ :param str name: (optional) The name for this network ACL rule. The name
+ must not be used by another rule for the network ACL. If unspecified, the
+ name will be a hyphenated list of randomly-selected words.
+ :param int destination_port_max: (optional) The inclusive upper bound of
+ TCP/UDP destination port range.
+ :param int destination_port_min: (optional) The inclusive lower bound of
+ TCP/UDP destination port range.
+ :param int source_port_max: (optional) The inclusive upper bound of TCP/UDP
+ source port range.
+ :param int source_port_min: (optional) The inclusive lower bound of TCP/UDP
+ source port range.
+ """
+ # pylint: disable=super-init-not-called
+ self.action = action
+ self.before = before
+ self.destination = destination
+ self.direction = direction
+ self.ip_version = ip_version
+ self.name = name
+ self.source = source
+ self.destination_port_max = destination_port_max
+ self.destination_port_min = destination_port_min
+ self.protocol = protocol
+ self.source_port_max = source_port_max
+ self.source_port_min = source_port_min
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype':
+ """Initialize a NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype object from a json dictionary."""
+ args = {}
+ if (action := _dict.get('action')) is not None:
+ args['action'] = action
+ else:
+ raise ValueError('Required property \'action\' not present in NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype JSON')
+ if (before := _dict.get('before')) is not None:
+ args['before'] = before
+ if (destination := _dict.get('destination')) is not None:
+ args['destination'] = destination
+ else:
+ raise ValueError('Required property \'destination\' not present in NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype JSON')
+ if (direction := _dict.get('direction')) is not None:
+ args['direction'] = direction
+ else:
+ raise ValueError('Required property \'direction\' not present in NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype JSON')
+ if (ip_version := _dict.get('ip_version')) is not None:
+ args['ip_version'] = ip_version
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ if (source := _dict.get('source')) is not None:
+ args['source'] = source
+ else:
+ raise ValueError('Required property \'source\' not present in NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype JSON')
+ if (destination_port_max := _dict.get('destination_port_max')) is not None:
+ args['destination_port_max'] = destination_port_max
+ if (destination_port_min := _dict.get('destination_port_min')) is not None:
+ args['destination_port_min'] = destination_port_min
+ if (protocol := _dict.get('protocol')) is not None:
+ args['protocol'] = protocol
+ else:
+ raise ValueError('Required property \'protocol\' not present in NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype JSON')
+ if (source_port_max := _dict.get('source_port_max')) is not None:
+ args['source_port_max'] = source_port_max
+ if (source_port_min := _dict.get('source_port_min')) is not None:
+ args['source_port_min'] = source_port_min
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype object from a json dictionary."""
+ return cls.from_dict(_dict)
+
+ def to_dict(self) -> Dict:
+ """Return a json dictionary representing this model."""
+ _dict = {}
+ if hasattr(self, 'action') and self.action is not None:
+ _dict['action'] = self.action
+ if hasattr(self, 'before') and self.before is not None:
+ if isinstance(self.before, dict):
+ _dict['before'] = self.before
+ else:
+ _dict['before'] = self.before.to_dict()
+ if hasattr(self, 'destination') and self.destination is not None:
+ _dict['destination'] = self.destination
+ if hasattr(self, 'direction') and self.direction is not None:
+ _dict['direction'] = self.direction
+ if hasattr(self, 'ip_version') and self.ip_version is not None:
+ _dict['ip_version'] = self.ip_version
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ if hasattr(self, 'source') and self.source is not None:
+ _dict['source'] = self.source
+ if hasattr(self, 'destination_port_max') and self.destination_port_max is not None:
+ _dict['destination_port_max'] = self.destination_port_max
+ if hasattr(self, 'destination_port_min') and self.destination_port_min is not None:
+ _dict['destination_port_min'] = self.destination_port_min
+ if hasattr(self, 'protocol') and self.protocol is not None:
+ _dict['protocol'] = self.protocol
+ if hasattr(self, 'source_port_max') and self.source_port_max is not None:
+ _dict['source_port_max'] = self.source_port_max
+ if hasattr(self, 'source_port_min') and self.source_port_min is not None:
+ _dict['source_port_min'] = self.source_port_min
+ return _dict
+
+ def _to_dict(self):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
+
+ def __str__(self) -> str:
+ """Return a `str` version of this NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+ class ActionEnum(str, Enum):
+ """
+ The action to perform for a packet matching the rule.
+ """
+
+ ALLOW = 'allow'
+ DENY = 'deny'
+
+
+ class DirectionEnum(str, Enum):
+ """
+ The direction of traffic to match.
+ """
+
+ INBOUND = 'inbound'
+ OUTBOUND = 'outbound'
+
+
+ class IpVersionEnum(str, Enum):
+ """
+ The IP version for this rule.
+ """
+
+ IPV4 = 'ipv4'
+
+
+ class ProtocolEnum(str, Enum):
+ """
+ The protocol to enforce.
+ """
+
+ TCP = 'tcp'
+ UDP = 'udp'
+
+
+
+class NetworkACLRuleNetworkACLRuleProtocolAll(NetworkACLRule):
+ """
+ NetworkACLRuleNetworkACLRuleProtocolAll.
+
+ :param str action: The action to perform for a packet matching the rule.
+ :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 rule was created.
+ :param str destination: The destination IP address or CIDR block to match. The
+ CIDR block `0.0.0.0/0` matches all destination addresses.
+ :param str direction: The direction of traffic to match.
+ :param str href: The URL for this network ACL rule.
+ :param str id: The unique identifier for this network ACL rule.
+ :param str ip_version: The IP version for this rule.
+ :param str name: The name for this network ACL rule. The name is unique across
+ all rules for the network ACL.
+ :param str source: The source IP address or CIDR block to match. The CIDR block
+ `0.0.0.0/0` matches all source addresses.
+ :param str protocol: The protocol to enforce.
+ """
+
+ def __init__(
+ self,
+ action: str,
+ created_at: datetime,
+ destination: str,
+ direction: str,
+ href: str,
+ id: str,
+ ip_version: str,
+ name: str,
+ source: str,
+ protocol: str,
+ *,
+ before: Optional['NetworkACLRuleReference'] = None,
+ ) -> None:
+ """
+ Initialize a NetworkACLRuleNetworkACLRuleProtocolAll object.
+
+ :param str action: The action to perform for a packet matching the rule.
+ :param datetime created_at: The date and time that the rule was created.
+ :param str destination: The destination IP address or CIDR block to match.
+ The CIDR block `0.0.0.0/0` matches all destination addresses.
+ :param str direction: The direction of traffic to match.
+ :param str href: The URL for this network ACL rule.
+ :param str id: The unique identifier for this network ACL rule.
+ :param str ip_version: The IP version for this rule.
+ :param str name: The name for this network ACL rule. The name is unique
+ across all rules for the network ACL.
+ :param str source: The source IP address or CIDR block to match. The CIDR
+ block `0.0.0.0/0` matches all source addresses.
+ :param str protocol: The protocol to enforce.
+ :param NetworkACLRuleReference before: (optional) The rule that this rule
+ is immediately before. If absent, this is the last rule.
+ """
+ # pylint: disable=super-init-not-called
+ self.action = action
+ self.before = before
+ self.created_at = created_at
+ self.destination = destination
+ self.direction = direction
+ self.href = href
+ self.id = id
+ self.ip_version = ip_version
+ self.name = name
+ self.source = source
+ self.protocol = protocol
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'NetworkACLRuleNetworkACLRuleProtocolAll':
+ """Initialize a NetworkACLRuleNetworkACLRuleProtocolAll object from a json dictionary."""
+ args = {}
+ if (action := _dict.get('action')) is not None:
+ args['action'] = action
+ else:
+ raise ValueError('Required property \'action\' not present in NetworkACLRuleNetworkACLRuleProtocolAll JSON')
+ if (before := _dict.get('before')) is not None:
+ args['before'] = NetworkACLRuleReference.from_dict(before)
+ if (created_at := _dict.get('created_at')) is not None:
+ args['created_at'] = string_to_datetime(created_at)
+ else:
+ raise ValueError('Required property \'created_at\' not present in NetworkACLRuleNetworkACLRuleProtocolAll JSON')
+ if (destination := _dict.get('destination')) is not None:
+ args['destination'] = destination
+ else:
+ raise ValueError('Required property \'destination\' not present in NetworkACLRuleNetworkACLRuleProtocolAll JSON')
+ if (direction := _dict.get('direction')) is not None:
+ args['direction'] = direction
+ else:
+ raise ValueError('Required property \'direction\' not present in NetworkACLRuleNetworkACLRuleProtocolAll JSON')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
+ else:
+ raise ValueError('Required property \'href\' not present in NetworkACLRuleNetworkACLRuleProtocolAll JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
+ else:
+ raise ValueError('Required property \'id\' not present in NetworkACLRuleNetworkACLRuleProtocolAll JSON')
+ if (ip_version := _dict.get('ip_version')) is not None:
+ args['ip_version'] = ip_version
+ else:
+ raise ValueError('Required property \'ip_version\' not present in NetworkACLRuleNetworkACLRuleProtocolAll JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ else:
+ raise ValueError('Required property \'name\' not present in NetworkACLRuleNetworkACLRuleProtocolAll JSON')
+ if (source := _dict.get('source')) is not None:
+ args['source'] = source
+ else:
+ raise ValueError('Required property \'source\' not present in NetworkACLRuleNetworkACLRuleProtocolAll JSON')
+ if (protocol := _dict.get('protocol')) is not None:
+ args['protocol'] = protocol
+ else:
+ raise ValueError('Required property \'protocol\' not present in NetworkACLRuleNetworkACLRuleProtocolAll JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a NetworkACLRuleNetworkACLRuleProtocolAll object from a json dictionary."""
+ return cls.from_dict(_dict)
+
+ def to_dict(self) -> Dict:
+ """Return a json dictionary representing this model."""
+ _dict = {}
+ if hasattr(self, 'action') and self.action is not None:
+ _dict['action'] = self.action
+ if hasattr(self, 'before') and self.before is not None:
+ if isinstance(self.before, dict):
+ _dict['before'] = self.before
+ else:
+ _dict['before'] = self.before.to_dict()
+ if hasattr(self, 'created_at') and self.created_at is not None:
+ _dict['created_at'] = datetime_to_string(self.created_at)
+ if hasattr(self, 'destination') and self.destination is not None:
+ _dict['destination'] = self.destination
+ if hasattr(self, 'direction') and self.direction is not None:
+ _dict['direction'] = self.direction
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
+ if hasattr(self, 'id') and self.id is not None:
+ _dict['id'] = self.id
+ if hasattr(self, 'ip_version') and self.ip_version is not None:
+ _dict['ip_version'] = self.ip_version
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ if hasattr(self, 'source') and self.source is not None:
+ _dict['source'] = self.source
+ if hasattr(self, 'protocol') and self.protocol is not None:
+ _dict['protocol'] = self.protocol
+ return _dict
+
+ def _to_dict(self):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
+
+ def __str__(self) -> str:
+ """Return a `str` version of this NetworkACLRuleNetworkACLRuleProtocolAll object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'NetworkACLRuleNetworkACLRuleProtocolAll') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'NetworkACLRuleNetworkACLRuleProtocolAll') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+ class ActionEnum(str, Enum):
+ """
+ The action to perform for a packet matching the rule.
+ """
+
+ ALLOW = 'allow'
+ DENY = 'deny'
+
+
+ class DirectionEnum(str, Enum):
+ """
+ The direction of traffic to match.
+ """
+
+ INBOUND = 'inbound'
+ OUTBOUND = 'outbound'
+
+
+ class IpVersionEnum(str, Enum):
+ """
+ The IP version for this rule.
+ """
+
+ IPV4 = 'ipv4'
+
+
+ class ProtocolEnum(str, Enum):
+ """
+ The protocol to enforce.
+ """
+
+ ALL = 'all'
+
+
+
+class NetworkACLRuleNetworkACLRuleProtocolICMP(NetworkACLRule):
+ """
+ NetworkACLRuleNetworkACLRuleProtocolICMP.
+
+ :param str action: The action to perform for a packet matching the rule.
+ :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 rule was created.
+ :param str destination: The destination IP address or CIDR block to match. The
+ CIDR block `0.0.0.0/0` matches all destination addresses.
+ :param str direction: The direction of traffic to match.
+ :param str href: The URL for this network ACL rule.
+ :param str id: The unique identifier for this network ACL rule.
+ :param str ip_version: The IP version for this rule.
+ :param str name: The name for this network ACL rule. The name is unique across
+ all rules for the network ACL.
+ :param str source: The source IP address or CIDR block to match. The CIDR block
+ `0.0.0.0/0` matches all source addresses.
+ :param int code: (optional) The ICMP traffic code to match.
+ If absent, all codes are matched.
+ :param str protocol: The protocol to enforce.
+ :param int type: (optional) The ICMP traffic type to match.
+ If absent, all types are matched.
+ """
+
+ def __init__(
+ self,
+ action: str,
+ created_at: datetime,
+ destination: str,
+ direction: str,
+ href: str,
+ id: str,
+ ip_version: str,
+ name: str,
+ source: str,
+ protocol: str,
+ *,
+ before: Optional['NetworkACLRuleReference'] = None,
+ code: Optional[int] = None,
+ type: Optional[int] = None,
+ ) -> None:
+ """
+ Initialize a NetworkACLRuleNetworkACLRuleProtocolICMP object.
+
+ :param str action: The action to perform for a packet matching the rule.
+ :param datetime created_at: The date and time that the rule was created.
+ :param str destination: The destination IP address or CIDR block to match.
+ The CIDR block `0.0.0.0/0` matches all destination addresses.
+ :param str direction: The direction of traffic to match.
+ :param str href: The URL for this network ACL rule.
+ :param str id: The unique identifier for this network ACL rule.
+ :param str ip_version: The IP version for this rule.
+ :param str name: The name for this network ACL rule. The name is unique
+ across all rules for the network ACL.
+ :param str source: The source IP address or CIDR block to match. The CIDR
+ block `0.0.0.0/0` matches all source addresses.
+ :param str protocol: The protocol to enforce.
+ :param NetworkACLRuleReference before: (optional) The rule that this rule
+ is immediately before. If absent, this is the last rule.
+ :param int code: (optional) The ICMP traffic code to match.
+ If absent, all codes are matched.
+ :param int type: (optional) The ICMP traffic type to match.
+ If absent, all types are matched.
+ """
+ # pylint: disable=super-init-not-called
+ self.action = action
+ self.before = before
+ self.created_at = created_at
+ self.destination = destination
+ self.direction = direction
+ self.href = href
+ self.id = id
+ self.ip_version = ip_version
+ self.name = name
+ self.source = source
+ self.code = code
+ self.protocol = protocol
+ self.type = type
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'NetworkACLRuleNetworkACLRuleProtocolICMP':
+ """Initialize a NetworkACLRuleNetworkACLRuleProtocolICMP object from a json dictionary."""
+ args = {}
+ if (action := _dict.get('action')) is not None:
+ args['action'] = action
+ else:
+ raise ValueError('Required property \'action\' not present in NetworkACLRuleNetworkACLRuleProtocolICMP JSON')
+ if (before := _dict.get('before')) is not None:
+ args['before'] = NetworkACLRuleReference.from_dict(before)
+ if (created_at := _dict.get('created_at')) is not None:
+ args['created_at'] = string_to_datetime(created_at)
+ else:
+ raise ValueError('Required property \'created_at\' not present in NetworkACLRuleNetworkACLRuleProtocolICMP JSON')
+ if (destination := _dict.get('destination')) is not None:
+ args['destination'] = destination
+ else:
+ raise ValueError('Required property \'destination\' not present in NetworkACLRuleNetworkACLRuleProtocolICMP JSON')
+ if (direction := _dict.get('direction')) is not None:
+ args['direction'] = direction
+ else:
+ raise ValueError('Required property \'direction\' not present in NetworkACLRuleNetworkACLRuleProtocolICMP JSON')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
+ else:
+ raise ValueError('Required property \'href\' not present in NetworkACLRuleNetworkACLRuleProtocolICMP JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
+ else:
+ raise ValueError('Required property \'id\' not present in NetworkACLRuleNetworkACLRuleProtocolICMP JSON')
+ if (ip_version := _dict.get('ip_version')) is not None:
+ args['ip_version'] = ip_version
+ else:
+ raise ValueError('Required property \'ip_version\' not present in NetworkACLRuleNetworkACLRuleProtocolICMP JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ else:
+ raise ValueError('Required property \'name\' not present in NetworkACLRuleNetworkACLRuleProtocolICMP JSON')
+ if (source := _dict.get('source')) is not None:
+ args['source'] = source
+ else:
+ raise ValueError('Required property \'source\' not present in NetworkACLRuleNetworkACLRuleProtocolICMP JSON')
+ if (code := _dict.get('code')) is not None:
+ args['code'] = code
+ if (protocol := _dict.get('protocol')) is not None:
+ args['protocol'] = protocol
+ else:
+ raise ValueError('Required property \'protocol\' not present in NetworkACLRuleNetworkACLRuleProtocolICMP JSON')
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a NetworkACLRuleNetworkACLRuleProtocolICMP object from a json dictionary."""
+ return cls.from_dict(_dict)
+
+ def to_dict(self) -> Dict:
+ """Return a json dictionary representing this model."""
+ _dict = {}
+ if hasattr(self, 'action') and self.action is not None:
+ _dict['action'] = self.action
+ if hasattr(self, 'before') and self.before is not None:
+ if isinstance(self.before, dict):
+ _dict['before'] = self.before
+ else:
+ _dict['before'] = self.before.to_dict()
+ if hasattr(self, 'created_at') and self.created_at is not None:
+ _dict['created_at'] = datetime_to_string(self.created_at)
+ if hasattr(self, 'destination') and self.destination is not None:
+ _dict['destination'] = self.destination
+ if hasattr(self, 'direction') and self.direction is not None:
+ _dict['direction'] = self.direction
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
+ if hasattr(self, 'id') and self.id is not None:
+ _dict['id'] = self.id
+ if hasattr(self, 'ip_version') and self.ip_version is not None:
+ _dict['ip_version'] = self.ip_version
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ if hasattr(self, 'source') and self.source is not None:
+ _dict['source'] = self.source
+ if hasattr(self, 'code') and self.code is not None:
+ _dict['code'] = self.code
+ if hasattr(self, 'protocol') and self.protocol is not None:
+ _dict['protocol'] = self.protocol
+ if hasattr(self, 'type') and self.type is not None:
+ _dict['type'] = self.type
+ return _dict
+
+ def _to_dict(self):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
+
+ def __str__(self) -> str:
+ """Return a `str` version of this NetworkACLRuleNetworkACLRuleProtocolICMP object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'NetworkACLRuleNetworkACLRuleProtocolICMP') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'NetworkACLRuleNetworkACLRuleProtocolICMP') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+ class ActionEnum(str, Enum):
+ """
+ The action to perform for a packet matching the rule.
+ """
+
+ ALLOW = 'allow'
+ DENY = 'deny'
+
+
+ class DirectionEnum(str, Enum):
+ """
+ The direction of traffic to match.
+ """
+
+ INBOUND = 'inbound'
+ OUTBOUND = 'outbound'
+
+
+ class IpVersionEnum(str, Enum):
+ """
+ The IP version for this rule.
+ """
+
+ IPV4 = 'ipv4'
+
+
+ class ProtocolEnum(str, Enum):
+ """
+ The protocol to enforce.
+ """
+
+ ICMP = 'icmp'
+
+
+
+class NetworkACLRuleNetworkACLRuleProtocolTCPUDP(NetworkACLRule):
+ """
+ NetworkACLRuleNetworkACLRuleProtocolTCPUDP.
+
+ :param str action: The action to perform for a packet matching the rule.
+ :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 rule was created.
+ :param str destination: The destination IP address or CIDR block to match. The
+ CIDR block `0.0.0.0/0` matches all destination addresses.
+ :param str direction: The direction of traffic to match.
+ :param str href: The URL for this network ACL rule.
+ :param str id: The unique identifier for this network ACL rule.
+ :param str ip_version: The IP version for this rule.
+ :param str name: The name for this network ACL rule. The name is unique across
+ all rules for the network ACL.
+ :param str source: The source IP address or CIDR block to match. The CIDR block
+ `0.0.0.0/0` matches all source addresses.
+ :param int destination_port_max: The inclusive upper bound of TCP/UDP
+ destination port range.
+ :param int destination_port_min: The inclusive lower bound of TCP/UDP
+ destination port range.
+ :param str protocol: The protocol to enforce.
+ :param int source_port_max: The inclusive upper bound of TCP/UDP source port
+ range.
+ :param int source_port_min: The inclusive lower bound of TCP/UDP source port
+ range.
+ """
+
+ def __init__(
+ self,
+ action: str,
+ created_at: datetime,
+ destination: str,
+ direction: str,
+ href: str,
+ id: str,
+ ip_version: str,
+ name: str,
+ source: str,
+ destination_port_max: int,
+ destination_port_min: int,
+ protocol: str,
+ source_port_max: int,
+ source_port_min: int,
+ *,
+ before: Optional['NetworkACLRuleReference'] = None,
+ ) -> None:
+ """
+ Initialize a NetworkACLRuleNetworkACLRuleProtocolTCPUDP object.
+
+ :param str action: The action to perform for a packet matching the rule.
+ :param datetime created_at: The date and time that the rule was created.
+ :param str destination: The destination IP address or CIDR block to match.
+ The CIDR block `0.0.0.0/0` matches all destination addresses.
+ :param str direction: The direction of traffic to match.
+ :param str href: The URL for this network ACL rule.
+ :param str id: The unique identifier for this network ACL rule.
+ :param str ip_version: The IP version for this rule.
+ :param str name: The name for this network ACL rule. The name is unique
+ across all rules for the network ACL.
+ :param str source: The source IP address or CIDR block to match. The CIDR
+ block `0.0.0.0/0` matches all source addresses.
+ :param int destination_port_max: The inclusive upper bound of TCP/UDP
+ destination port range.
+ :param int destination_port_min: The inclusive lower bound of TCP/UDP
+ destination port range.
+ :param str protocol: The protocol to enforce.
+ :param int source_port_max: The inclusive upper bound of TCP/UDP source
+ port range.
+ :param int source_port_min: The inclusive lower bound of TCP/UDP source
+ port range.
+ :param NetworkACLRuleReference before: (optional) The rule that this rule
+ is immediately before. If absent, this is the last rule.
+ """
+ # pylint: disable=super-init-not-called
+ self.action = action
+ self.before = before
+ self.created_at = created_at
+ self.destination = destination
+ self.direction = direction
+ self.href = href
+ self.id = id
+ self.ip_version = ip_version
+ self.name = name
+ self.source = source
+ self.destination_port_max = destination_port_max
+ self.destination_port_min = destination_port_min
+ self.protocol = protocol
+ self.source_port_max = source_port_max
+ self.source_port_min = source_port_min
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'NetworkACLRuleNetworkACLRuleProtocolTCPUDP':
+ """Initialize a NetworkACLRuleNetworkACLRuleProtocolTCPUDP object from a json dictionary."""
+ args = {}
+ if (action := _dict.get('action')) is not None:
+ args['action'] = action
+ else:
+ raise ValueError('Required property \'action\' not present in NetworkACLRuleNetworkACLRuleProtocolTCPUDP JSON')
+ if (before := _dict.get('before')) is not None:
+ args['before'] = NetworkACLRuleReference.from_dict(before)
+ if (created_at := _dict.get('created_at')) is not None:
+ args['created_at'] = string_to_datetime(created_at)
+ else:
+ raise ValueError('Required property \'created_at\' not present in NetworkACLRuleNetworkACLRuleProtocolTCPUDP JSON')
+ if (destination := _dict.get('destination')) is not None:
+ args['destination'] = destination
+ else:
+ raise ValueError('Required property \'destination\' not present in NetworkACLRuleNetworkACLRuleProtocolTCPUDP JSON')
+ if (direction := _dict.get('direction')) is not None:
+ args['direction'] = direction
+ else:
+ raise ValueError('Required property \'direction\' not present in NetworkACLRuleNetworkACLRuleProtocolTCPUDP JSON')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
+ else:
+ raise ValueError('Required property \'href\' not present in NetworkACLRuleNetworkACLRuleProtocolTCPUDP JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
+ else:
+ raise ValueError('Required property \'id\' not present in NetworkACLRuleNetworkACLRuleProtocolTCPUDP JSON')
+ if (ip_version := _dict.get('ip_version')) is not None:
+ args['ip_version'] = ip_version
+ else:
+ raise ValueError('Required property \'ip_version\' not present in NetworkACLRuleNetworkACLRuleProtocolTCPUDP JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ else:
+ raise ValueError('Required property \'name\' not present in NetworkACLRuleNetworkACLRuleProtocolTCPUDP JSON')
+ if (source := _dict.get('source')) is not None:
+ args['source'] = source
+ else:
+ raise ValueError('Required property \'source\' not present in NetworkACLRuleNetworkACLRuleProtocolTCPUDP JSON')
+ if (destination_port_max := _dict.get('destination_port_max')) is not None:
+ args['destination_port_max'] = destination_port_max
+ else:
+ raise ValueError('Required property \'destination_port_max\' not present in NetworkACLRuleNetworkACLRuleProtocolTCPUDP JSON')
+ if (destination_port_min := _dict.get('destination_port_min')) is not None:
+ args['destination_port_min'] = destination_port_min
+ else:
+ raise ValueError('Required property \'destination_port_min\' not present in NetworkACLRuleNetworkACLRuleProtocolTCPUDP JSON')
+ if (protocol := _dict.get('protocol')) is not None:
+ args['protocol'] = protocol
+ else:
+ raise ValueError('Required property \'protocol\' not present in NetworkACLRuleNetworkACLRuleProtocolTCPUDP JSON')
+ if (source_port_max := _dict.get('source_port_max')) is not None:
+ args['source_port_max'] = source_port_max
+ else:
+ raise ValueError('Required property \'source_port_max\' not present in NetworkACLRuleNetworkACLRuleProtocolTCPUDP JSON')
+ if (source_port_min := _dict.get('source_port_min')) is not None:
+ args['source_port_min'] = source_port_min
+ else:
+ raise ValueError('Required property \'source_port_min\' not present in NetworkACLRuleNetworkACLRuleProtocolTCPUDP JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a NetworkACLRuleNetworkACLRuleProtocolTCPUDP object from a json dictionary."""
+ return cls.from_dict(_dict)
+
+ def to_dict(self) -> Dict:
+ """Return a json dictionary representing this model."""
+ _dict = {}
+ if hasattr(self, 'action') and self.action is not None:
+ _dict['action'] = self.action
+ if hasattr(self, 'before') and self.before is not None:
+ if isinstance(self.before, dict):
+ _dict['before'] = self.before
+ else:
+ _dict['before'] = self.before.to_dict()
+ if hasattr(self, 'created_at') and self.created_at is not None:
+ _dict['created_at'] = datetime_to_string(self.created_at)
+ if hasattr(self, 'destination') and self.destination is not None:
+ _dict['destination'] = self.destination
+ if hasattr(self, 'direction') and self.direction is not None:
+ _dict['direction'] = self.direction
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
+ if hasattr(self, 'id') and self.id is not None:
+ _dict['id'] = self.id
+ if hasattr(self, 'ip_version') and self.ip_version is not None:
+ _dict['ip_version'] = self.ip_version
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ if hasattr(self, 'source') and self.source is not None:
+ _dict['source'] = self.source
+ if hasattr(self, 'destination_port_max') and self.destination_port_max is not None:
+ _dict['destination_port_max'] = self.destination_port_max
+ if hasattr(self, 'destination_port_min') and self.destination_port_min is not None:
+ _dict['destination_port_min'] = self.destination_port_min
+ if hasattr(self, 'protocol') and self.protocol is not None:
+ _dict['protocol'] = self.protocol
+ if hasattr(self, 'source_port_max') and self.source_port_max is not None:
+ _dict['source_port_max'] = self.source_port_max
+ if hasattr(self, 'source_port_min') and self.source_port_min is not None:
+ _dict['source_port_min'] = self.source_port_min
+ return _dict
+
+ def _to_dict(self):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
+
+ def __str__(self) -> str:
+ """Return a `str` version of this NetworkACLRuleNetworkACLRuleProtocolTCPUDP object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'NetworkACLRuleNetworkACLRuleProtocolTCPUDP') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'NetworkACLRuleNetworkACLRuleProtocolTCPUDP') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+ class ActionEnum(str, Enum):
+ """
+ The action to perform for a packet matching the rule.
+ """
+
+ ALLOW = 'allow'
+ DENY = 'deny'
+
+
+ class DirectionEnum(str, Enum):
+ """
+ The direction of traffic to match.
+ """
+
+ INBOUND = 'inbound'
+ OUTBOUND = 'outbound'
+
+
+ class IpVersionEnum(str, Enum):
+ """
+ The IP version for this rule.
+ """
+
+ IPV4 = 'ipv4'
+
+
+ class ProtocolEnum(str, Enum):
+ """
+ The protocol to enforce.
+ """
+
+ TCP = 'tcp'
+ UDP = 'udp'
+
+
+
+class NetworkInterfaceIPPrototypeReservedIPIdentity(NetworkInterfaceIPPrototype):
+ """
+ Identifies a reserved IP by a unique property.
+
+ """
+
+ def __init__(
+ self,
+ ) -> None:
+ """
+ Initialize a NetworkInterfaceIPPrototypeReservedIPIdentity object.
+
+ """
+ # pylint: disable=super-init-not-called
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['NetworkInterfaceIPPrototypeReservedIPIdentityById', 'NetworkInterfaceIPPrototypeReservedIPIdentityByHref'])
+ )
+ raise Exception(msg)
+
+
+class NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext(NetworkInterfaceIPPrototype):
+ """
+ NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext.
+
+ :param str address: (optional) The IP address to reserve, which must not already
+ be reserved on the subnet.
+ If unspecified, an available address on the subnet will automatically be
+ selected.
+ :param bool auto_delete: (optional) Indicates whether this reserved IP member
+ will be automatically deleted when either
+ `target` is deleted, or the reserved IP is unbound.
+ :param str name: (optional) The name for this reserved IP. The name must not be
+ used by another reserved IP in the subnet. Names starting with `ibm-` are
+ reserved for provider-owned resources, and are not allowed. If unspecified, the
+ name will be a hyphenated list of randomly-selected words.
+ """
+
+ def __init__(
+ self,
+ *,
+ address: Optional[str] = None,
+ auto_delete: Optional[bool] = None,
+ name: Optional[str] = None,
+ ) -> None:
+ """
+ Initialize a NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext object.
+
+ :param str address: (optional) The IP address to reserve, which must not
+ already be reserved on the subnet.
+ If unspecified, an available address on the subnet will automatically be
+ selected.
+ :param bool auto_delete: (optional) Indicates whether this reserved IP
+ member will be automatically deleted when either
+ `target` is deleted, or the reserved IP is unbound.
+ :param str name: (optional) The name for this reserved IP. The name must
+ not be used by another reserved IP in the subnet. Names starting with
+ `ibm-` are reserved for provider-owned resources, and are not allowed. If
+ unspecified, the name will be a hyphenated list of randomly-selected words.
+ """
+ # pylint: disable=super-init-not-called
+ self.address = address
+ self.auto_delete = auto_delete
+ self.name = name
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext':
+ """Initialize a NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext object from a json dictionary."""
+ args = {}
+ if (address := _dict.get('address')) is not None:
+ args['address'] = address
+ if (auto_delete := _dict.get('auto_delete')) is not None:
+ args['auto_delete'] = auto_delete
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext object from a json dictionary."""
+ return cls.from_dict(_dict)
+
+ def to_dict(self) -> Dict:
+ """Return a json dictionary representing this model."""
+ _dict = {}
+ if hasattr(self, 'address') and self.address is not None:
+ _dict['address'] = self.address
+ if hasattr(self, 'auto_delete') and self.auto_delete is not None:
+ _dict['auto_delete'] = self.auto_delete
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ return _dict
+
+ def _to_dict(self):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
+
+ def __str__(self) -> str:
+ """Return a `str` version of this NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+
+class OperatingSystemIdentityByHref(OperatingSystemIdentity):
+ """
+ OperatingSystemIdentityByHref.
+
+ :param str href: The URL for this operating system.
+ """
+
+ def __init__(
+ self,
+ href: str,
+ ) -> None:
+ """
+ Initialize a OperatingSystemIdentityByHref object.
+
+ :param str href: The URL for this operating system.
+ """
+ # pylint: disable=super-init-not-called
+ self.href = href
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'OperatingSystemIdentityByHref':
+ """Initialize a OperatingSystemIdentityByHref object from a json dictionary."""
+ args = {}
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
+ else:
+ raise ValueError('Required property \'href\' not present in OperatingSystemIdentityByHref JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a OperatingSystemIdentityByHref object from 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 OperatingSystemIdentityByHref object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'OperatingSystemIdentityByHref') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'OperatingSystemIdentityByHref') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+
+class OperatingSystemIdentityByName(OperatingSystemIdentity):
+ """
+ OperatingSystemIdentityByName.
+
+ :param str name: The globally unique name for this operating system.
+ """
+
+ def __init__(
+ self,
+ name: str,
+ ) -> None:
+ """
+ Initialize a OperatingSystemIdentityByName object.
+
+ :param str name: The globally unique name for this operating system.
+ """
+ # pylint: disable=super-init-not-called
+ self.name = name
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'OperatingSystemIdentityByName':
+ """Initialize a OperatingSystemIdentityByName object from a json dictionary."""
+ args = {}
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ else:
+ raise ValueError('Required property \'name\' not present in OperatingSystemIdentityByName JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a OperatingSystemIdentityByName object from a json dictionary."""
+ return cls.from_dict(_dict)
+
+ def to_dict(self) -> Dict:
+ """Return a json dictionary representing this model."""
+ _dict = {}
+ if hasattr(self, '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 OperatingSystemIdentityByName object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'OperatingSystemIdentityByName') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'OperatingSystemIdentityByName') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+
+class PublicGatewayFloatingIPPrototypeFloatingIPIdentity(PublicGatewayFloatingIPPrototype):
+ """
+ Identifies a floating IP by a unique property.
+
+ """
+
+ def __init__(
+ self,
+ ) -> None:
+ """
+ Initialize a PublicGatewayFloatingIPPrototypeFloatingIPIdentity object.
+
+ """
+ # pylint: disable=super-init-not-called
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityById', 'PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByCRN', 'PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByHref', 'PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByAddress'])
+ )
+ raise Exception(msg)
+
+
+class PublicGatewayFloatingIPPrototypeFloatingIPPrototypeTargetContext(PublicGatewayFloatingIPPrototype):
+ """
+ PublicGatewayFloatingIPPrototypeFloatingIPPrototypeTargetContext.
+
+ :param str name: (optional) The name for this floating IP. The name must not be
+ used by another floating IP in the region. If unspecified, the name will be a
+ hyphenated list of randomly-selected words.
+ :param ResourceGroupIdentity resource_group: (optional) The resource group to
+ use. If unspecified, the account's [default resource
+ group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be
+ used.
+ """
+
+ def __init__(
+ self,
+ *,
+ name: Optional[str] = None,
+ resource_group: Optional['ResourceGroupIdentity'] = None,
+ ) -> None:
+ """
+ Initialize a PublicGatewayFloatingIPPrototypeFloatingIPPrototypeTargetContext object.
+
+ :param str name: (optional) The name for this floating IP. The name must
+ not be used by another floating IP in the region. If unspecified, the name
+ will be a hyphenated list of randomly-selected words.
+ :param ResourceGroupIdentity resource_group: (optional) The resource group
+ to use. If unspecified, the account's [default resource
+ group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be
+ used.
+ """
+ # pylint: disable=super-init-not-called
+ self.name = name
+ self.resource_group = resource_group
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'PublicGatewayFloatingIPPrototypeFloatingIPPrototypeTargetContext':
+ """Initialize a PublicGatewayFloatingIPPrototypeFloatingIPPrototypeTargetContext object from a json dictionary."""
+ args = {}
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ if (resource_group := _dict.get('resource_group')) is not None:
+ args['resource_group'] = resource_group
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a PublicGatewayFloatingIPPrototypeFloatingIPPrototypeTargetContext object from a json dictionary."""
+ return cls.from_dict(_dict)
+
+ def to_dict(self) -> Dict:
+ """Return a json dictionary representing this model."""
+ _dict = {}
+ if hasattr(self, '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 PublicGatewayFloatingIPPrototypeFloatingIPPrototypeTargetContext object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'PublicGatewayFloatingIPPrototypeFloatingIPPrototypeTargetContext') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'PublicGatewayFloatingIPPrototypeFloatingIPPrototypeTargetContext') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+
+class PublicGatewayIdentityPublicGatewayIdentityByCRN(PublicGatewayIdentity):
+ """
+ PublicGatewayIdentityPublicGatewayIdentityByCRN.
+
+ :param str crn: The CRN for this public gateway.
+ """
+
+ def __init__(
+ self,
+ crn: str,
+ ) -> None:
+ """
+ Initialize a PublicGatewayIdentityPublicGatewayIdentityByCRN 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) -> 'PublicGatewayIdentityPublicGatewayIdentityByCRN':
+ """Initialize a PublicGatewayIdentityPublicGatewayIdentityByCRN object from a json dictionary."""
+ args = {}
+ if (crn := _dict.get('crn')) is not None:
+ args['crn'] = crn
+ else:
+ raise ValueError('Required property \'crn\' not present in PublicGatewayIdentityPublicGatewayIdentityByCRN JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a PublicGatewayIdentityPublicGatewayIdentityByCRN object from a json dictionary."""
+ return cls.from_dict(_dict)
+
+ def to_dict(self) -> Dict:
+ """Return a json dictionary representing this model."""
+ _dict = {}
+ if hasattr(self, '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 PublicGatewayIdentityPublicGatewayIdentityByCRN object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ 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: 'PublicGatewayIdentityPublicGatewayIdentityByCRN') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+
+class PublicGatewayIdentityPublicGatewayIdentityByHref(PublicGatewayIdentity):
+ """
+ PublicGatewayIdentityPublicGatewayIdentityByHref.
+
+ :param str href: The URL for this public gateway.
+ """
+
+ def __init__(
+ self,
+ href: str,
+ ) -> None:
+ """
+ Initialize a PublicGatewayIdentityPublicGatewayIdentityByHref 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) -> 'PublicGatewayIdentityPublicGatewayIdentityByHref':
+ """Initialize a PublicGatewayIdentityPublicGatewayIdentityByHref object from a json dictionary."""
+ args = {}
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
+ else:
+ raise ValueError('Required property \'href\' not present in PublicGatewayIdentityPublicGatewayIdentityByHref JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a PublicGatewayIdentityPublicGatewayIdentityByHref object from 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 PublicGatewayIdentityPublicGatewayIdentityByHref object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'PublicGatewayIdentityPublicGatewayIdentityByHref') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'PublicGatewayIdentityPublicGatewayIdentityByHref') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+
+class PublicGatewayIdentityPublicGatewayIdentityById(PublicGatewayIdentity):
+ """
+ PublicGatewayIdentityPublicGatewayIdentityById.
+
+ :param str id: The unique identifier for this public gateway.
+ """
+
+ def __init__(
+ self,
+ id: str,
+ ) -> None:
+ """
+ Initialize a PublicGatewayIdentityPublicGatewayIdentityById 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) -> 'PublicGatewayIdentityPublicGatewayIdentityById':
+ """Initialize a PublicGatewayIdentityPublicGatewayIdentityById object from a json dictionary."""
+ args = {}
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
+ else:
+ raise ValueError('Required property \'id\' not present in PublicGatewayIdentityPublicGatewayIdentityById JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a PublicGatewayIdentityPublicGatewayIdentityById object from a json dictionary."""
+ return cls.from_dict(_dict)
+
+ def to_dict(self) -> Dict:
+ """Return a json dictionary representing this model."""
+ _dict = {}
+ if hasattr(self, '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 PublicGatewayIdentityPublicGatewayIdentityById object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ 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: 'PublicGatewayIdentityPublicGatewayIdentityById') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+
+class RegionIdentityByHref(RegionIdentity):
+ """
+ RegionIdentityByHref.
+
+ :param str href: The URL for this region.
+ """
+
+ def __init__(
+ self,
+ href: str,
+ ) -> None:
+ """
+ Initialize a RegionIdentityByHref object.
+
+ :param str href: The URL for this region.
+ """
+ # pylint: disable=super-init-not-called
+ self.href = href
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'RegionIdentityByHref':
+ """Initialize a RegionIdentityByHref object from a json dictionary."""
+ args = {}
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
+ else:
+ raise ValueError('Required property \'href\' not present in RegionIdentityByHref JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a RegionIdentityByHref object from 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 RegionIdentityByHref object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'RegionIdentityByHref') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'RegionIdentityByHref') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+
+class RegionIdentityByName(RegionIdentity):
+ """
+ RegionIdentityByName.
+
+ :param str name: The globally unique name for this region.
+ """
+
+ def __init__(
+ self,
+ name: str,
+ ) -> None:
+ """
+ Initialize a RegionIdentityByName object.
+
+ :param str name: The globally unique name for this region.
+ """
+ # pylint: disable=super-init-not-called
+ self.name = name
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'RegionIdentityByName':
+ """Initialize a RegionIdentityByName object from a json dictionary."""
+ args = {}
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ else:
+ raise ValueError('Required property \'name\' not present in RegionIdentityByName JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a RegionIdentityByName object from a json dictionary."""
+ return cls.from_dict(_dict)
+
+ def to_dict(self) -> Dict:
+ """Return a json dictionary representing this model."""
+ _dict = {}
+ if hasattr(self, '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 RegionIdentityByName object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'RegionIdentityByName') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'RegionIdentityByName') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+
+class ReservationIdentityByCRN(ReservationIdentity):
+ """
+ ReservationIdentityByCRN.
+
+ :param str crn: The CRN for this reservation.
+ """
+
+ def __init__(
+ self,
+ crn: str,
+ ) -> None:
+ """
+ Initialize a ReservationIdentityByCRN object.
+
+ :param str crn: The CRN for this reservation.
+ """
+ # pylint: disable=super-init-not-called
+ self.crn = crn
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'ReservationIdentityByCRN':
+ """Initialize a ReservationIdentityByCRN object from a json dictionary."""
+ args = {}
+ if (crn := _dict.get('crn')) is not None:
+ args['crn'] = crn
+ else:
+ raise ValueError('Required property \'crn\' not present in ReservationIdentityByCRN JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a ReservationIdentityByCRN object from 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 ReservationIdentityByCRN object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'ReservationIdentityByCRN') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'ReservationIdentityByCRN') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+
+class ReservationIdentityByHref(ReservationIdentity):
+ """
+ ReservationIdentityByHref.
+
+ :param str href: The URL for this reservation.
+ """
+
+ def __init__(
+ self,
+ href: str,
+ ) -> None:
+ """
+ Initialize a ReservationIdentityByHref object.
+
+ :param str href: The URL for this reservation.
+ """
+ # pylint: disable=super-init-not-called
+ self.href = href
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'ReservationIdentityByHref':
+ """Initialize a ReservationIdentityByHref object from a json dictionary."""
+ args = {}
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
+ else:
+ raise ValueError('Required property \'href\' not present in ReservationIdentityByHref JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a ReservationIdentityByHref object from 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 ReservationIdentityByHref object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'ReservationIdentityByHref') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'ReservationIdentityByHref') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+
+class ReservationIdentityById(ReservationIdentity):
+ """
+ ReservationIdentityById.
+
+ :param str id: The unique identifier for this reservation.
+ """
+
+ def __init__(
+ self,
+ id: str,
+ ) -> None:
+ """
+ Initialize a ReservationIdentityById object.
+
+ :param str id: The unique identifier for this reservation.
+ """
+ # pylint: disable=super-init-not-called
+ self.id = id
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'ReservationIdentityById':
+ """Initialize a ReservationIdentityById object from a json dictionary."""
+ args = {}
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
+ else:
+ raise ValueError('Required property \'id\' not present in ReservationIdentityById JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a ReservationIdentityById object from 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 ReservationIdentityById object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'ReservationIdentityById') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'ReservationIdentityById') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+
+class ReservedIPTargetPrototypeEndpointGatewayIdentity(ReservedIPTargetPrototype):
+ """
+ ReservedIPTargetPrototypeEndpointGatewayIdentity.
+
+ """
+
+ def __init__(
+ self,
+ ) -> None:
+ """
+ Initialize a ReservedIPTargetPrototypeEndpointGatewayIdentity object.
+
+ """
+ # pylint: disable=super-init-not-called
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityById', 'ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByCRN', 'ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByHref'])
+ )
+ raise Exception(msg)
+
+
+class ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentity(ReservedIPTargetPrototype):
+ """
+ Identifies a virtual network interface by a unique property.
+
+ """
+
+ def __init__(
+ self,
+ ) -> None:
+ """
+ Initialize a ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentity object.
+
+ """
+ # pylint: disable=super-init-not-called
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById', 'ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref', 'ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN'])
+ )
+ raise Exception(msg)
+
+
+class ReservedIPTargetBareMetalServerNetworkInterfaceReferenceTargetContext(ReservedIPTarget):
+ """
+ ReservedIPTargetBareMetalServerNetworkInterfaceReferenceTargetContext.
+
+ :param BareMetalServerNetworkInterfaceReferenceTargetContextDeleted 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 network interface.
+ If this bare metal server has network attachments, this network interface is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment.
+ :param str id: The unique identifier for this bare metal server network
+ interface.
+ If this bare metal server has network attachments, this network interface is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and the identifier is that of the corresponding network attachment.
+ :param str name: The name for this bare metal server network interface.
+ :param str resource_type: The resource type.
+ """
+
+ def __init__(
+ self,
+ href: str,
+ id: str,
+ name: str,
+ resource_type: str,
+ *,
+ deleted: Optional['BareMetalServerNetworkInterfaceReferenceTargetContextDeleted'] = None,
+ ) -> None:
+ """
+ Initialize a ReservedIPTargetBareMetalServerNetworkInterfaceReferenceTargetContext object.
+
+ :param str href: The URL for this bare metal server network interface.
+ If this bare metal server has network attachments, this network interface
+ is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment.
+ :param str id: The unique identifier for this bare metal server network
+ interface.
+ If this bare metal server has network attachments, this network interface
+ is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and the identifier is that of the corresponding network
+ attachment.
+ :param str name: The name for this bare metal server network interface.
+ :param str resource_type: The resource type.
+ :param BareMetalServerNetworkInterfaceReferenceTargetContextDeleted
+ deleted: (optional) If present, this property indicates the referenced
+ resource has been deleted, and provides
+ some supplementary information.
+ """
+ # pylint: disable=super-init-not-called
+ self.deleted = deleted
+ self.href = href
+ self.id = id
+ self.name = name
+ self.resource_type = resource_type
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'ReservedIPTargetBareMetalServerNetworkInterfaceReferenceTargetContext':
+ """Initialize a ReservedIPTargetBareMetalServerNetworkInterfaceReferenceTargetContext object from a json dictionary."""
+ args = {}
+ if (deleted := _dict.get('deleted')) is not None:
+ args['deleted'] = BareMetalServerNetworkInterfaceReferenceTargetContextDeleted.from_dict(deleted)
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
+ else:
+ raise ValueError('Required property \'href\' not present in ReservedIPTargetBareMetalServerNetworkInterfaceReferenceTargetContext JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
+ else:
+ raise ValueError('Required property \'id\' not present in ReservedIPTargetBareMetalServerNetworkInterfaceReferenceTargetContext JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ else:
+ raise ValueError('Required property \'name\' not present in ReservedIPTargetBareMetalServerNetworkInterfaceReferenceTargetContext JSON')
+ if (resource_type := _dict.get('resource_type')) is not None:
+ args['resource_type'] = resource_type
+ else:
+ raise ValueError('Required property \'resource_type\' not present in ReservedIPTargetBareMetalServerNetworkInterfaceReferenceTargetContext JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a ReservedIPTargetBareMetalServerNetworkInterfaceReferenceTargetContext object from a json dictionary."""
+ return cls.from_dict(_dict)
+
+ def to_dict(self) -> Dict:
+ """Return a json dictionary representing this model."""
+ _dict = {}
+ if hasattr(self, 'deleted') and self.deleted is not None:
+ if isinstance(self.deleted, dict):
+ _dict['deleted'] = self.deleted
+ else:
+ _dict['deleted'] = self.deleted.to_dict()
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
+ if hasattr(self, 'id') and self.id is not None:
+ _dict['id'] = self.id
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ if hasattr(self, 'resource_type') and self.resource_type is not None:
+ _dict['resource_type'] = self.resource_type
+ return _dict
+
+ def _to_dict(self):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
+
+ def __str__(self) -> str:
+ """Return a `str` version of this ReservedIPTargetBareMetalServerNetworkInterfaceReferenceTargetContext object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'ReservedIPTargetBareMetalServerNetworkInterfaceReferenceTargetContext') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'ReservedIPTargetBareMetalServerNetworkInterfaceReferenceTargetContext') -> 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 ReservedIPTargetEndpointGatewayReference(ReservedIPTarget):
+ """
+ ReservedIPTargetEndpointGatewayReference.
+
+ :param str crn: The CRN for this endpoint gateway.
+ :param EndpointGatewayReferenceDeleted deleted: (optional) If present, this
+ property indicates the referenced resource has been deleted, and provides
+ some supplementary information.
+ :param str href: The URL for this endpoint gateway.
+ :param str id: The unique identifier for this endpoint gateway.
+ :param str name: The name for this endpoint gateway. The name is unique across
+ all endpoint gateways in the VPC.
+ :param str resource_type: The resource type.
+ """
+
+ def __init__(
+ self,
+ crn: str,
+ href: str,
+ id: str,
+ name: str,
+ resource_type: str,
+ *,
+ deleted: Optional['EndpointGatewayReferenceDeleted'] = None,
+ ) -> None:
+ """
+ Initialize a ReservedIPTargetEndpointGatewayReference object.
+
+ :param str crn: The CRN for this endpoint gateway.
+ :param str href: The URL for this endpoint gateway.
+ :param str id: The unique identifier for this endpoint gateway.
+ :param str name: The name for this endpoint gateway. The name is unique
+ across all endpoint gateways in the VPC.
+ :param str resource_type: The resource type.
+ :param EndpointGatewayReferenceDeleted deleted: (optional) If present, this
+ property indicates the referenced resource has been deleted, and provides
+ some supplementary information.
+ """
+ # 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) -> 'ReservedIPTargetEndpointGatewayReference':
+ """Initialize a ReservedIPTargetEndpointGatewayReference object from a json dictionary."""
+ args = {}
+ if (crn := _dict.get('crn')) is not None:
+ args['crn'] = crn
+ else:
+ raise ValueError('Required property \'crn\' not present in ReservedIPTargetEndpointGatewayReference JSON')
+ if (deleted := _dict.get('deleted')) is not None:
+ args['deleted'] = EndpointGatewayReferenceDeleted.from_dict(deleted)
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
+ else:
+ raise ValueError('Required property \'href\' not present in ReservedIPTargetEndpointGatewayReference JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
+ else:
+ raise ValueError('Required property \'id\' not present in ReservedIPTargetEndpointGatewayReference JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ else:
+ raise ValueError('Required property \'name\' not present in ReservedIPTargetEndpointGatewayReference JSON')
+ if (resource_type := _dict.get('resource_type')) is not None:
+ args['resource_type'] = resource_type
+ else:
+ raise ValueError('Required property \'resource_type\' not present in ReservedIPTargetEndpointGatewayReference JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a ReservedIPTargetEndpointGatewayReference object from a json dictionary."""
+ return cls.from_dict(_dict)
+
+ def to_dict(self) -> Dict:
+ """Return a json dictionary representing this model."""
+ _dict = {}
+ if hasattr(self, 'crn') and self.crn is not None:
+ _dict['crn'] = self.crn
+ if hasattr(self, 'deleted') and self.deleted is not None:
+ if isinstance(self.deleted, dict):
+ _dict['deleted'] = self.deleted
+ else:
+ _dict['deleted'] = self.deleted.to_dict()
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
+ if hasattr(self, 'id') and self.id is not None:
+ _dict['id'] = self.id
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ if hasattr(self, 'resource_type') and self.resource_type is not None:
+ _dict['resource_type'] = self.resource_type
+ return _dict
+
+ def _to_dict(self):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
+
+ def __str__(self) -> str:
+ """Return a `str` version of this ReservedIPTargetEndpointGatewayReference object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'ReservedIPTargetEndpointGatewayReference') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'ReservedIPTargetEndpointGatewayReference') -> 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 ReservedIPTargetGenericResourceReference(ReservedIPTarget):
+ """
+ Identifying information for a resource that is not native to the VPC API.
+
+ :param str crn: The CRN for the resource.
+ :param GenericResourceReferenceDeleted deleted: (optional) If present, this
+ property indicates the referenced resource has been deleted, and provides
+ some supplementary information.
+ :param str resource_type: The resource type.
+ """
+
+ def __init__(
+ self,
+ crn: str,
+ resource_type: str,
+ *,
+ deleted: Optional['GenericResourceReferenceDeleted'] = None,
+ ) -> None:
+ """
+ Initialize a ReservedIPTargetGenericResourceReference object.
+
+ :param str crn: The CRN for the resource.
+ :param str resource_type: The resource type.
+ :param GenericResourceReferenceDeleted deleted: (optional) If present, this
+ property indicates the referenced resource has been deleted, and provides
+ some supplementary information.
+ """
+ # pylint: disable=super-init-not-called
+ self.crn = crn
+ self.deleted = deleted
+ self.resource_type = resource_type
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'ReservedIPTargetGenericResourceReference':
+ """Initialize a ReservedIPTargetGenericResourceReference object from a json dictionary."""
+ args = {}
+ if (crn := _dict.get('crn')) is not None:
+ args['crn'] = crn
+ else:
+ raise ValueError('Required property \'crn\' not present in ReservedIPTargetGenericResourceReference JSON')
+ if (deleted := _dict.get('deleted')) is not None:
+ args['deleted'] = GenericResourceReferenceDeleted.from_dict(deleted)
+ if (resource_type := _dict.get('resource_type')) is not None:
+ args['resource_type'] = resource_type
+ else:
+ raise ValueError('Required property \'resource_type\' not present in ReservedIPTargetGenericResourceReference JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a ReservedIPTargetGenericResourceReference object from a json dictionary."""
+ return cls.from_dict(_dict)
+
+ def to_dict(self) -> Dict:
+ """Return a json dictionary representing this model."""
+ _dict = {}
+ if hasattr(self, 'crn') and self.crn is not None:
+ _dict['crn'] = self.crn
+ if hasattr(self, 'deleted') and self.deleted is not None:
+ if isinstance(self.deleted, dict):
+ _dict['deleted'] = self.deleted
+ else:
+ _dict['deleted'] = self.deleted.to_dict()
+ if hasattr(self, 'resource_type') and self.resource_type is not None:
+ _dict['resource_type'] = self.resource_type
+ return _dict
+
+ def _to_dict(self):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
+
+ def __str__(self) -> str:
+ """Return a `str` version of this ReservedIPTargetGenericResourceReference object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'ReservedIPTargetGenericResourceReference') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'ReservedIPTargetGenericResourceReference') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+ class ResourceTypeEnum(str, Enum):
+ """
+ The resource type.
+ """
CLOUD_RESOURCE = 'cloud_resource'
-class ReservedIPTargetLoadBalancerReference(ReservedIPTarget):
+class ReservedIPTargetLoadBalancerReference(ReservedIPTarget):
+ """
+ ReservedIPTargetLoadBalancerReference.
+
+ :param str crn: The load balancer's CRN.
+ :param LoadBalancerReferenceDeleted deleted: (optional) If present, this
+ property indicates the referenced resource has been deleted, and provides
+ some supplementary information.
+ :param str href: The load balancer's canonical URL.
+ :param str id: The unique identifier for this load balancer.
+ :param str name: The name for this load balancer. The name is unique across all
+ load balancers in the VPC.
+ :param str resource_type: The resource type.
+ """
+
+ def __init__(
+ self,
+ crn: str,
+ href: str,
+ id: str,
+ name: str,
+ resource_type: str,
+ *,
+ deleted: Optional['LoadBalancerReferenceDeleted'] = None,
+ ) -> None:
+ """
+ Initialize a ReservedIPTargetLoadBalancerReference object.
+
+ :param str crn: The load balancer's CRN.
+ :param str href: The load balancer's canonical URL.
+ :param str id: The unique identifier for this load balancer.
+ :param str name: The name for this load balancer. The name is unique across
+ all load balancers in the VPC.
+ :param str resource_type: The resource type.
+ :param LoadBalancerReferenceDeleted deleted: (optional) If present, this
+ property indicates the referenced resource has been deleted, and provides
+ some supplementary information.
+ """
+ # pylint: disable=super-init-not-called
+ self.crn = crn
+ self.deleted = deleted
+ self.href = href
+ self.id = id
+ self.name = name
+ self.resource_type = resource_type
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'ReservedIPTargetLoadBalancerReference':
+ """Initialize a ReservedIPTargetLoadBalancerReference object from a json dictionary."""
+ args = {}
+ if (crn := _dict.get('crn')) is not None:
+ args['crn'] = crn
+ else:
+ raise ValueError('Required property \'crn\' not present in ReservedIPTargetLoadBalancerReference JSON')
+ if (deleted := _dict.get('deleted')) is not None:
+ args['deleted'] = LoadBalancerReferenceDeleted.from_dict(deleted)
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
+ else:
+ raise ValueError('Required property \'href\' not present in ReservedIPTargetLoadBalancerReference JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
+ else:
+ raise ValueError('Required property \'id\' not present in ReservedIPTargetLoadBalancerReference JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ else:
+ raise ValueError('Required property \'name\' not present in ReservedIPTargetLoadBalancerReference JSON')
+ if (resource_type := _dict.get('resource_type')) is not None:
+ args['resource_type'] = resource_type
+ else:
+ raise ValueError('Required property \'resource_type\' not present in ReservedIPTargetLoadBalancerReference JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a ReservedIPTargetLoadBalancerReference object from a json dictionary."""
+ return cls.from_dict(_dict)
+
+ def to_dict(self) -> Dict:
+ """Return a json dictionary representing this model."""
+ _dict = {}
+ if hasattr(self, 'crn') and self.crn is not None:
+ _dict['crn'] = self.crn
+ if hasattr(self, 'deleted') and self.deleted is not None:
+ if isinstance(self.deleted, dict):
+ _dict['deleted'] = self.deleted
+ else:
+ _dict['deleted'] = self.deleted.to_dict()
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
+ if hasattr(self, 'id') and self.id is not None:
+ _dict['id'] = self.id
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ if hasattr(self, 'resource_type') and self.resource_type is not None:
+ _dict['resource_type'] = self.resource_type
+ return _dict
+
+ def _to_dict(self):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
+
+ def __str__(self) -> str:
+ """Return a `str` version of this ReservedIPTargetLoadBalancerReference object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'ReservedIPTargetLoadBalancerReference') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'ReservedIPTargetLoadBalancerReference') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+ class ResourceTypeEnum(str, Enum):
+ """
+ The resource type.
+ """
+
+ LOAD_BALANCER = 'load_balancer'
+
+
+
+class ReservedIPTargetNetworkInterfaceReferenceTargetContext(ReservedIPTarget):
+ """
+ ReservedIPTargetNetworkInterfaceReferenceTargetContext.
+
+ :param NetworkInterfaceReferenceTargetContextDeleted 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 instance network interface.
+ If this instance has network attachments, this network interface is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment.
+ :param str id: The unique identifier for this instance network interface.
+ If this instance has network attachments, this network interface is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and the identifier is that of the corresponding network attachment.
+ :param str name: The name for this instance network interface.
+ :param str resource_type: The resource type.
+ """
+
+ def __init__(
+ self,
+ href: str,
+ id: str,
+ name: str,
+ resource_type: str,
+ *,
+ deleted: Optional['NetworkInterfaceReferenceTargetContextDeleted'] = None,
+ ) -> None:
+ """
+ Initialize a ReservedIPTargetNetworkInterfaceReferenceTargetContext object.
+
+ :param str href: The URL for this instance network interface.
+ If this instance has network attachments, this network interface is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment.
+ :param str id: The unique identifier for this instance network interface.
+ If this instance has network attachments, this network interface is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and the identifier is that of the corresponding network
+ attachment.
+ :param str name: The name for this instance network interface.
+ :param str resource_type: The resource type.
+ :param NetworkInterfaceReferenceTargetContextDeleted deleted: (optional) If
+ present, this property indicates the referenced resource has been deleted,
+ and provides
+ some supplementary information.
+ """
+ # pylint: disable=super-init-not-called
+ self.deleted = deleted
+ self.href = href
+ self.id = id
+ self.name = name
+ self.resource_type = resource_type
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'ReservedIPTargetNetworkInterfaceReferenceTargetContext':
+ """Initialize a ReservedIPTargetNetworkInterfaceReferenceTargetContext object from a json dictionary."""
+ args = {}
+ if (deleted := _dict.get('deleted')) is not None:
+ args['deleted'] = NetworkInterfaceReferenceTargetContextDeleted.from_dict(deleted)
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
+ else:
+ raise ValueError('Required property \'href\' not present in ReservedIPTargetNetworkInterfaceReferenceTargetContext JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
+ else:
+ raise ValueError('Required property \'id\' not present in ReservedIPTargetNetworkInterfaceReferenceTargetContext JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ else:
+ raise ValueError('Required property \'name\' not present in ReservedIPTargetNetworkInterfaceReferenceTargetContext JSON')
+ if (resource_type := _dict.get('resource_type')) is not None:
+ args['resource_type'] = resource_type
+ else:
+ raise ValueError('Required property \'resource_type\' not present in ReservedIPTargetNetworkInterfaceReferenceTargetContext JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a ReservedIPTargetNetworkInterfaceReferenceTargetContext object from a json dictionary."""
+ return cls.from_dict(_dict)
+
+ def to_dict(self) -> Dict:
+ """Return a json dictionary representing this model."""
+ _dict = {}
+ if hasattr(self, 'deleted') and self.deleted is not None:
+ if isinstance(self.deleted, dict):
+ _dict['deleted'] = self.deleted
+ else:
+ _dict['deleted'] = self.deleted.to_dict()
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
+ if hasattr(self, 'id') and self.id is not None:
+ _dict['id'] = self.id
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ if hasattr(self, 'resource_type') and self.resource_type is not None:
+ _dict['resource_type'] = self.resource_type
+ return _dict
+
+ def _to_dict(self):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
+
+ def __str__(self) -> str:
+ """Return a `str` version of this ReservedIPTargetNetworkInterfaceReferenceTargetContext object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'ReservedIPTargetNetworkInterfaceReferenceTargetContext') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'ReservedIPTargetNetworkInterfaceReferenceTargetContext') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+ class ResourceTypeEnum(str, Enum):
+ """
+ The resource type.
+ """
+
+ NETWORK_INTERFACE = 'network_interface'
+
+
+
+class ReservedIPTargetVPNGatewayReference(ReservedIPTarget):
+ """
+ ReservedIPTargetVPNGatewayReference.
+
+ :param str crn: The VPN gateway's CRN.
+ :param VPNGatewayReferenceDeleted deleted: (optional) If present, this property
+ indicates the referenced resource has been deleted, and provides
+ some supplementary information.
+ :param str href: The VPN gateway's canonical URL.
+ :param str id: The unique identifier for this VPN gateway.
+ :param str name: The name for this VPN gateway. The name is unique across all
+ VPN gateways in the VPC.
+ :param str resource_type: The resource type.
+ """
+
+ def __init__(
+ self,
+ crn: str,
+ href: str,
+ id: str,
+ name: str,
+ resource_type: str,
+ *,
+ deleted: Optional['VPNGatewayReferenceDeleted'] = None,
+ ) -> None:
+ """
+ Initialize a ReservedIPTargetVPNGatewayReference object.
+
+ :param str crn: The VPN gateway's CRN.
+ :param str href: The VPN gateway's canonical URL.
+ :param str id: The unique identifier for this VPN gateway.
+ :param str name: The name for this VPN gateway. The name is unique across
+ all VPN gateways in the VPC.
+ :param str resource_type: The resource type.
+ :param VPNGatewayReferenceDeleted deleted: (optional) If present, this
+ property indicates the referenced resource has been deleted, and provides
+ some supplementary information.
+ """
+ # pylint: disable=super-init-not-called
+ self.crn = crn
+ self.deleted = deleted
+ self.href = href
+ self.id = id
+ self.name = name
+ self.resource_type = resource_type
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'ReservedIPTargetVPNGatewayReference':
+ """Initialize a ReservedIPTargetVPNGatewayReference object from a json dictionary."""
+ args = {}
+ if (crn := _dict.get('crn')) is not None:
+ args['crn'] = crn
+ else:
+ raise ValueError('Required property \'crn\' not present in ReservedIPTargetVPNGatewayReference JSON')
+ if (deleted := _dict.get('deleted')) is not None:
+ args['deleted'] = VPNGatewayReferenceDeleted.from_dict(deleted)
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
+ else:
+ raise ValueError('Required property \'href\' not present in ReservedIPTargetVPNGatewayReference JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
+ else:
+ raise ValueError('Required property \'id\' not present in ReservedIPTargetVPNGatewayReference JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ else:
+ raise ValueError('Required property \'name\' not present in ReservedIPTargetVPNGatewayReference JSON')
+ if (resource_type := _dict.get('resource_type')) is not None:
+ args['resource_type'] = resource_type
+ else:
+ raise ValueError('Required property \'resource_type\' not present in ReservedIPTargetVPNGatewayReference JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a ReservedIPTargetVPNGatewayReference object from a json dictionary."""
+ return cls.from_dict(_dict)
+
+ def to_dict(self) -> Dict:
+ """Return a json dictionary representing this model."""
+ _dict = {}
+ if hasattr(self, 'crn') and self.crn is not None:
+ _dict['crn'] = self.crn
+ if hasattr(self, 'deleted') and self.deleted is not None:
+ if isinstance(self.deleted, dict):
+ _dict['deleted'] = self.deleted
+ else:
+ _dict['deleted'] = self.deleted.to_dict()
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
+ if hasattr(self, 'id') and self.id is not None:
+ _dict['id'] = self.id
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ if hasattr(self, 'resource_type') and self.resource_type is not None:
+ _dict['resource_type'] = self.resource_type
+ return _dict
+
+ def _to_dict(self):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
+
+ def __str__(self) -> str:
+ """Return a `str` version of this ReservedIPTargetVPNGatewayReference object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'ReservedIPTargetVPNGatewayReference') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'ReservedIPTargetVPNGatewayReference') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+ class ResourceTypeEnum(str, Enum):
+ """
+ The resource type.
+ """
+
+ VPN_GATEWAY = 'vpn_gateway'
+
+
+
+class ReservedIPTargetVPNServerReference(ReservedIPTarget):
+ """
+ ReservedIPTargetVPNServerReference.
+
+ :param str crn: The CRN for this VPN server.
+ :param VPNServerReferenceDeleted 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 VPN server.
+ :param str id: The unique identifier for this VPN server.
+ :param str name: The name for this VPN server. The name is unique across all VPN
+ servers in the VPC.
+ :param str resource_type: The resource type.
+ """
+
+ def __init__(
+ self,
+ crn: str,
+ href: str,
+ id: str,
+ name: str,
+ resource_type: str,
+ *,
+ deleted: Optional['VPNServerReferenceDeleted'] = None,
+ ) -> None:
+ """
+ Initialize a ReservedIPTargetVPNServerReference object.
+
+ :param str crn: The CRN for this VPN server.
+ :param str href: The URL for this VPN server.
+ :param str id: The unique identifier for this VPN server.
+ :param str name: The name for this VPN server. The name is unique across
+ all VPN servers in the VPC.
+ :param str resource_type: The resource type.
+ :param VPNServerReferenceDeleted deleted: (optional) If present, this
+ property indicates the referenced resource has been deleted, and provides
+ some supplementary information.
+ """
+ # 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) -> 'ReservedIPTargetVPNServerReference':
+ """Initialize a ReservedIPTargetVPNServerReference object from a json dictionary."""
+ args = {}
+ if (crn := _dict.get('crn')) is not None:
+ args['crn'] = crn
+ else:
+ raise ValueError('Required property \'crn\' not present in ReservedIPTargetVPNServerReference JSON')
+ if (deleted := _dict.get('deleted')) is not None:
+ args['deleted'] = VPNServerReferenceDeleted.from_dict(deleted)
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
+ else:
+ raise ValueError('Required property \'href\' not present in ReservedIPTargetVPNServerReference JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
+ else:
+ raise ValueError('Required property \'id\' not present in ReservedIPTargetVPNServerReference JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ else:
+ raise ValueError('Required property \'name\' not present in ReservedIPTargetVPNServerReference JSON')
+ if (resource_type := _dict.get('resource_type')) is not None:
+ args['resource_type'] = resource_type
+ else:
+ raise ValueError('Required property \'resource_type\' not present in ReservedIPTargetVPNServerReference JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a ReservedIPTargetVPNServerReference object from a json dictionary."""
+ return cls.from_dict(_dict)
+
+ def to_dict(self) -> Dict:
+ """Return a json dictionary representing this model."""
+ _dict = {}
+ if hasattr(self, 'crn') and self.crn is not None:
+ _dict['crn'] = self.crn
+ if hasattr(self, 'deleted') and self.deleted is not None:
+ if isinstance(self.deleted, dict):
+ _dict['deleted'] = self.deleted
+ else:
+ _dict['deleted'] = self.deleted.to_dict()
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
+ if hasattr(self, 'id') and self.id is not None:
+ _dict['id'] = self.id
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ if hasattr(self, 'resource_type') and self.resource_type is not None:
+ _dict['resource_type'] = self.resource_type
+ return _dict
+
+ def _to_dict(self):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
+
+ def __str__(self) -> str:
+ """Return a `str` version of this ReservedIPTargetVPNServerReference object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'ReservedIPTargetVPNServerReference') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'ReservedIPTargetVPNServerReference') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+ class ResourceTypeEnum(str, Enum):
+ """
+ The resource type.
+ """
+
+ VPN_SERVER = 'vpn_server'
+
+
+
+class ReservedIPTargetVirtualNetworkInterfaceReferenceReservedIPTargetContext(ReservedIPTarget):
+ """
+ ReservedIPTargetVirtualNetworkInterfaceReferenceReservedIPTargetContext.
+
+ :param str crn: The CRN for this virtual network interface.
+ :param str href: The URL for this virtual network interface.
+ :param str id: The unique identifier for this virtual network interface.
+ :param str name: The name for this virtual network interface. The name is unique
+ across all virtual network interfaces in the VPC.
+ :param str resource_type: The resource type.
+ """
+
+ def __init__(
+ self,
+ crn: str,
+ href: str,
+ id: str,
+ name: str,
+ resource_type: str,
+ ) -> None:
+ """
+ Initialize a ReservedIPTargetVirtualNetworkInterfaceReferenceReservedIPTargetContext object.
+
+ :param str crn: The CRN for this virtual network interface.
+ :param str href: The URL for this virtual network interface.
+ :param str id: The unique identifier for this virtual network interface.
+ :param str name: The name for this virtual network interface. The name is
+ unique across all virtual network interfaces in the VPC.
+ :param str resource_type: The resource type.
+ """
+ # pylint: disable=super-init-not-called
+ self.crn = crn
+ self.href = href
+ self.id = id
+ self.name = name
+ self.resource_type = resource_type
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'ReservedIPTargetVirtualNetworkInterfaceReferenceReservedIPTargetContext':
+ """Initialize a ReservedIPTargetVirtualNetworkInterfaceReferenceReservedIPTargetContext object from a json dictionary."""
+ args = {}
+ if (crn := _dict.get('crn')) is not None:
+ args['crn'] = crn
+ else:
+ raise ValueError('Required property \'crn\' not present in ReservedIPTargetVirtualNetworkInterfaceReferenceReservedIPTargetContext JSON')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
+ else:
+ raise ValueError('Required property \'href\' not present in ReservedIPTargetVirtualNetworkInterfaceReferenceReservedIPTargetContext JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
+ else:
+ raise ValueError('Required property \'id\' not present in ReservedIPTargetVirtualNetworkInterfaceReferenceReservedIPTargetContext JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ else:
+ raise ValueError('Required property \'name\' not present in ReservedIPTargetVirtualNetworkInterfaceReferenceReservedIPTargetContext JSON')
+ if (resource_type := _dict.get('resource_type')) is not None:
+ args['resource_type'] = resource_type
+ else:
+ raise ValueError('Required property \'resource_type\' not present in ReservedIPTargetVirtualNetworkInterfaceReferenceReservedIPTargetContext JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a ReservedIPTargetVirtualNetworkInterfaceReferenceReservedIPTargetContext object from a json dictionary."""
+ return cls.from_dict(_dict)
+
+ def to_dict(self) -> Dict:
+ """Return a json dictionary representing this model."""
+ _dict = {}
+ if hasattr(self, '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_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 ReservedIPTargetVirtualNetworkInterfaceReferenceReservedIPTargetContext object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'ReservedIPTargetVirtualNetworkInterfaceReferenceReservedIPTargetContext') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'ReservedIPTargetVirtualNetworkInterfaceReferenceReservedIPTargetContext') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+ class ResourceTypeEnum(str, Enum):
+ """
+ The resource type.
+ """
+
+ VIRTUAL_NETWORK_INTERFACE = 'virtual_network_interface'
+
+
+
+class ResourceGroupIdentityById(ResourceGroupIdentity):
+ """
+ ResourceGroupIdentityById.
+
+ :param str id: The unique identifier for this resource group.
+ """
+
+ def __init__(
+ self,
+ id: str,
+ ) -> None:
+ """
+ Initialize a ResourceGroupIdentityById object.
+
+ :param str id: The unique identifier for this resource group.
+ """
+ # pylint: disable=super-init-not-called
+ self.id = id
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'ResourceGroupIdentityById':
+ """Initialize a ResourceGroupIdentityById object from a json dictionary."""
+ args = {}
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
+ else:
+ raise ValueError('Required property \'id\' not present in ResourceGroupIdentityById JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a ResourceGroupIdentityById object from a json dictionary."""
+ return cls.from_dict(_dict)
+
+ 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 ResourceGroupIdentityById object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'ResourceGroupIdentityById') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'ResourceGroupIdentityById') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+
+class RouteCreatorVPNGatewayReference(RouteCreator):
+ """
+ RouteCreatorVPNGatewayReference.
+
+ :param str crn: The VPN gateway's CRN.
+ :param VPNGatewayReferenceDeleted deleted: (optional) If present, this property
+ indicates the referenced resource has been deleted, and provides
+ some supplementary information.
+ :param str href: The VPN gateway's canonical URL.
+ :param str id: The unique identifier for this VPN gateway.
+ :param str name: The name for this VPN gateway. The name is unique across all
+ VPN gateways in the VPC.
+ :param str resource_type: The resource type.
+ """
+
+ def __init__(
+ self,
+ crn: str,
+ href: str,
+ id: str,
+ name: str,
+ resource_type: str,
+ *,
+ deleted: Optional['VPNGatewayReferenceDeleted'] = None,
+ ) -> None:
+ """
+ Initialize a RouteCreatorVPNGatewayReference object.
+
+ :param str crn: The VPN gateway's CRN.
+ :param str href: The VPN gateway's canonical URL.
+ :param str id: The unique identifier for this VPN gateway.
+ :param str name: The name for this VPN gateway. The name is unique across
+ all VPN gateways in the VPC.
+ :param str resource_type: The resource type.
+ :param VPNGatewayReferenceDeleted deleted: (optional) If present, this
+ property indicates the referenced resource has been deleted, and provides
+ some supplementary information.
+ """
+ # 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) -> 'RouteCreatorVPNGatewayReference':
+ """Initialize a RouteCreatorVPNGatewayReference object from a json dictionary."""
+ args = {}
+ if (crn := _dict.get('crn')) is not None:
+ args['crn'] = crn
+ else:
+ raise ValueError('Required property \'crn\' not present in RouteCreatorVPNGatewayReference JSON')
+ if (deleted := _dict.get('deleted')) is not None:
+ args['deleted'] = VPNGatewayReferenceDeleted.from_dict(deleted)
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
+ else:
+ raise ValueError('Required property \'href\' not present in RouteCreatorVPNGatewayReference JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
+ else:
+ raise ValueError('Required property \'id\' not present in RouteCreatorVPNGatewayReference JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ else:
+ raise ValueError('Required property \'name\' not present in RouteCreatorVPNGatewayReference JSON')
+ if (resource_type := _dict.get('resource_type')) is not None:
+ args['resource_type'] = resource_type
+ else:
+ raise ValueError('Required property \'resource_type\' not present in RouteCreatorVPNGatewayReference JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a RouteCreatorVPNGatewayReference object from a json dictionary."""
+ return cls.from_dict(_dict)
+
+ def to_dict(self) -> Dict:
+ """Return a json dictionary representing this model."""
+ _dict = {}
+ if hasattr(self, 'crn') and self.crn is not None:
+ _dict['crn'] = self.crn
+ if hasattr(self, 'deleted') and self.deleted is not None:
+ if isinstance(self.deleted, dict):
+ _dict['deleted'] = self.deleted
+ else:
+ _dict['deleted'] = self.deleted.to_dict()
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
+ if hasattr(self, 'id') and self.id is not None:
+ _dict['id'] = self.id
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ if hasattr(self, 'resource_type') and self.resource_type is not None:
+ _dict['resource_type'] = self.resource_type
+ return _dict
+
+ def _to_dict(self):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
+
+ def __str__(self) -> str:
+ """Return a `str` version of this RouteCreatorVPNGatewayReference object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'RouteCreatorVPNGatewayReference') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'RouteCreatorVPNGatewayReference') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+ class ResourceTypeEnum(str, Enum):
+ """
+ The resource type.
+ """
+
+ VPN_GATEWAY = 'vpn_gateway'
+
+
+
+class RouteCreatorVPNServerReference(RouteCreator):
+ """
+ RouteCreatorVPNServerReference.
+
+ :param str crn: The CRN for this VPN server.
+ :param VPNServerReferenceDeleted 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 VPN server.
+ :param str id: The unique identifier for this VPN server.
+ :param str name: The name for this VPN server. The name is unique across all VPN
+ servers in the VPC.
+ :param str resource_type: The resource type.
+ """
+
+ def __init__(
+ self,
+ crn: str,
+ href: str,
+ id: str,
+ name: str,
+ resource_type: str,
+ *,
+ deleted: Optional['VPNServerReferenceDeleted'] = None,
+ ) -> None:
+ """
+ Initialize a RouteCreatorVPNServerReference object.
+
+ :param str crn: The CRN for this VPN server.
+ :param str href: The URL for this VPN server.
+ :param str id: The unique identifier for this VPN server.
+ :param str name: The name for this VPN server. The name is unique across
+ all VPN servers in the VPC.
+ :param str resource_type: The resource type.
+ :param VPNServerReferenceDeleted deleted: (optional) If present, this
+ property indicates the referenced resource has been deleted, and provides
+ some supplementary information.
+ """
+ # 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) -> 'RouteCreatorVPNServerReference':
+ """Initialize a RouteCreatorVPNServerReference object from a json dictionary."""
+ args = {}
+ if (crn := _dict.get('crn')) is not None:
+ args['crn'] = crn
+ else:
+ raise ValueError('Required property \'crn\' not present in RouteCreatorVPNServerReference JSON')
+ if (deleted := _dict.get('deleted')) is not None:
+ args['deleted'] = VPNServerReferenceDeleted.from_dict(deleted)
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
+ else:
+ raise ValueError('Required property \'href\' not present in RouteCreatorVPNServerReference JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
+ else:
+ raise ValueError('Required property \'id\' not present in RouteCreatorVPNServerReference JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ else:
+ raise ValueError('Required property \'name\' not present in RouteCreatorVPNServerReference JSON')
+ if (resource_type := _dict.get('resource_type')) is not None:
+ args['resource_type'] = resource_type
+ else:
+ raise ValueError('Required property \'resource_type\' not present in RouteCreatorVPNServerReference JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a RouteCreatorVPNServerReference object from a json dictionary."""
+ return cls.from_dict(_dict)
+
+ def to_dict(self) -> Dict:
+ """Return a json dictionary representing this model."""
+ _dict = {}
+ if hasattr(self, 'crn') and self.crn is not None:
+ _dict['crn'] = self.crn
+ if hasattr(self, 'deleted') and self.deleted is not None:
+ if isinstance(self.deleted, dict):
+ _dict['deleted'] = self.deleted
+ else:
+ _dict['deleted'] = self.deleted.to_dict()
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
+ if hasattr(self, 'id') and self.id is not None:
+ _dict['id'] = self.id
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ if hasattr(self, 'resource_type') and self.resource_type is not None:
+ _dict['resource_type'] = self.resource_type
+ return _dict
+
+ def _to_dict(self):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
+
+ def __str__(self) -> str:
+ """Return a `str` version of this RouteCreatorVPNServerReference object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'RouteCreatorVPNServerReference') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'RouteCreatorVPNServerReference') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+ class ResourceTypeEnum(str, Enum):
+ """
+ The resource type.
+ """
+
+ VPN_SERVER = 'vpn_server'
+
+
+
+class RouteNextHopIP(RouteNextHop):
+ """
+ RouteNextHopIP.
+
+ :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.
+ """
+
+ def __init__(
+ self,
+ address: str,
+ ) -> None:
+ """
+ Initialize a RouteNextHopIP object.
+
+ :param str address: The IP address.
+ This property may add support for IPv6 addresses in the future. When
+ processing a value in this property, verify that the address is in an
+ expected format. If it is not, log an error. Optionally halt processing and
+ surface the error, or bypass the resource on which the unexpected IP
+ address format was encountered.
+ """
+ # pylint: disable=super-init-not-called
+ self.address = address
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'RouteNextHopIP':
+ """Initialize a RouteNextHopIP object from a json dictionary."""
+ args = {}
+ if (address := _dict.get('address')) is not None:
+ args['address'] = address
+ else:
+ raise ValueError('Required property \'address\' not present in RouteNextHopIP JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a RouteNextHopIP object from a json dictionary."""
+ return cls.from_dict(_dict)
+
+ def to_dict(self) -> Dict:
+ """Return a json dictionary representing this model."""
+ _dict = {}
+ if hasattr(self, 'address') and self.address is not None:
+ _dict['address'] = self.address
+ return _dict
+
+ def _to_dict(self):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
+
+ def __str__(self) -> str:
+ """Return a `str` version of this RouteNextHopIP object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'RouteNextHopIP') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'RouteNextHopIP') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+
+class RouteNextHopPatchRouteNextHopIP(RouteNextHopPatch):
+ """
+ RouteNextHopPatchRouteNextHopIP.
+
+ """
+
+ def __init__(
+ self,
+ ) -> None:
+ """
+ Initialize a RouteNextHopPatchRouteNextHopIP object.
+
+ """
+ # pylint: disable=super-init-not-called
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['RouteNextHopPatchRouteNextHopIPRouteNextHopIPSentinelIP', 'RouteNextHopPatchRouteNextHopIPRouteNextHopIPUnicastIP'])
+ )
+ raise Exception(msg)
+
+
+class RouteNextHopPatchVPNGatewayConnectionIdentity(RouteNextHopPatch):
+ """
+ Identifies a VPN gateway connection by a unique property.
+
+ """
+
+ def __init__(
+ self,
+ ) -> None:
+ """
+ Initialize a RouteNextHopPatchVPNGatewayConnectionIdentity object.
+
+ """
+ # pylint: disable=super-init-not-called
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['RouteNextHopPatchVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityById', 'RouteNextHopPatchVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityByHref'])
+ )
+ raise Exception(msg)
+
+
+class RouteNextHopVPNGatewayConnectionReference(RouteNextHop):
+ """
+ RouteNextHopVPNGatewayConnectionReference.
+
+ :param VPNGatewayConnectionReferenceDeleted deleted: (optional) If present, this
+ property indicates the referenced resource has been deleted, and provides
+ some supplementary information.
+ :param str href: The VPN connection's canonical URL.
+ :param str id: The unique identifier for this VPN gateway connection.
+ :param str name: The name for this VPN gateway connection. The name is unique
+ across all connections for the VPN gateway.
+ :param str resource_type: The resource type.
+ """
+
+ def __init__(
+ self,
+ href: str,
+ id: str,
+ name: str,
+ resource_type: str,
+ *,
+ deleted: Optional['VPNGatewayConnectionReferenceDeleted'] = None,
+ ) -> None:
+ """
+ Initialize a RouteNextHopVPNGatewayConnectionReference object.
+
+ :param str href: The VPN connection's canonical URL.
+ :param str id: The unique identifier for this VPN gateway connection.
+ :param str name: The name for this VPN gateway connection. The name is
+ unique across all connections for the VPN gateway.
+ :param str resource_type: The resource type.
+ :param VPNGatewayConnectionReferenceDeleted deleted: (optional) If present,
+ this property indicates the referenced resource has been deleted, and
+ provides
+ some supplementary information.
+ """
+ # 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) -> 'RouteNextHopVPNGatewayConnectionReference':
+ """Initialize a RouteNextHopVPNGatewayConnectionReference object from a json dictionary."""
+ args = {}
+ if (deleted := _dict.get('deleted')) is not None:
+ args['deleted'] = VPNGatewayConnectionReferenceDeleted.from_dict(deleted)
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
+ else:
+ raise ValueError('Required property \'href\' not present in RouteNextHopVPNGatewayConnectionReference JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
+ else:
+ raise ValueError('Required property \'id\' not present in RouteNextHopVPNGatewayConnectionReference JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ else:
+ raise ValueError('Required property \'name\' not present in RouteNextHopVPNGatewayConnectionReference JSON')
+ if (resource_type := _dict.get('resource_type')) is not None:
+ args['resource_type'] = resource_type
+ else:
+ raise ValueError('Required property \'resource_type\' not present in RouteNextHopVPNGatewayConnectionReference JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a RouteNextHopVPNGatewayConnectionReference object from a json dictionary."""
+ return cls.from_dict(_dict)
+
+ def to_dict(self) -> Dict:
+ """Return a json dictionary representing this model."""
+ _dict = {}
+ if hasattr(self, 'deleted') and self.deleted is not None:
+ if isinstance(self.deleted, dict):
+ _dict['deleted'] = self.deleted
+ else:
+ _dict['deleted'] = self.deleted.to_dict()
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
+ if hasattr(self, 'id') and self.id is not None:
+ _dict['id'] = self.id
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ if hasattr(self, 'resource_type') and self.resource_type is not None:
+ _dict['resource_type'] = self.resource_type
+ return _dict
+
+ def _to_dict(self):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
+
+ def __str__(self) -> str:
+ """Return a `str` version of this RouteNextHopVPNGatewayConnectionReference object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'RouteNextHopVPNGatewayConnectionReference') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'RouteNextHopVPNGatewayConnectionReference') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+ class ResourceTypeEnum(str, Enum):
+ """
+ The resource type.
+ """
+
+ VPN_GATEWAY_CONNECTION = 'vpn_gateway_connection'
+
+
+
+class RoutePrototypeNextHopRouteNextHopPrototypeRouteNextHopIP(RoutePrototypeNextHop):
+ """
+ RoutePrototypeNextHopRouteNextHopPrototypeRouteNextHopIP.
+
+ """
+
+ def __init__(
+ self,
+ ) -> None:
+ """
+ Initialize a RoutePrototypeNextHopRouteNextHopPrototypeRouteNextHopIP object.
+
+ """
+ # pylint: disable=super-init-not-called
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['RoutePrototypeNextHopRouteNextHopPrototypeRouteNextHopIPRouteNextHopPrototypeRouteNextHopIPRouteNextHopIPSentinelIP', 'RoutePrototypeNextHopRouteNextHopPrototypeRouteNextHopIPRouteNextHopPrototypeRouteNextHopIPRouteNextHopIPUnicastIP'])
+ )
+ raise Exception(msg)
+
+
+class RoutePrototypeNextHopRouteNextHopPrototypeVPNGatewayConnectionIdentity(RoutePrototypeNextHop):
+ """
+ Identifies a VPN gateway connection by a unique property.
+
+ """
+
+ def __init__(
+ self,
+ ) -> None:
+ """
+ Initialize a RoutePrototypeNextHopRouteNextHopPrototypeVPNGatewayConnectionIdentity object.
+
+ """
+ # pylint: disable=super-init-not-called
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['RoutePrototypeNextHopRouteNextHopPrototypeVPNGatewayConnectionIdentityRouteNextHopPrototypeVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityById', 'RoutePrototypeNextHopRouteNextHopPrototypeVPNGatewayConnectionIdentityRouteNextHopPrototypeVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityByHref'])
+ )
+ raise Exception(msg)
+
+
+class RoutingTableIdentityByHref(RoutingTableIdentity):
+ """
+ RoutingTableIdentityByHref.
+
+ :param str href: The URL for this routing table.
+ """
+
+ def __init__(
+ self,
+ href: str,
+ ) -> None:
+ """
+ Initialize a RoutingTableIdentityByHref object.
+
+ :param str href: The URL for this routing table.
+ """
+ # pylint: disable=super-init-not-called
+ self.href = href
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'RoutingTableIdentityByHref':
+ """Initialize a RoutingTableIdentityByHref object from a json dictionary."""
+ args = {}
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
+ else:
+ raise ValueError('Required property \'href\' not present in RoutingTableIdentityByHref JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a RoutingTableIdentityByHref object from a json dictionary."""
+ return cls.from_dict(_dict)
+
+ def to_dict(self) -> Dict:
+ """Return a json dictionary representing this model."""
+ _dict = {}
+ if hasattr(self, '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 RoutingTableIdentityByHref object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'RoutingTableIdentityByHref') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'RoutingTableIdentityByHref') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+
+class RoutingTableIdentityById(RoutingTableIdentity):
+ """
+ RoutingTableIdentityById.
+
+ :param str id: The unique identifier for this routing table.
+ """
+
+ def __init__(
+ self,
+ id: str,
+ ) -> None:
+ """
+ Initialize a RoutingTableIdentityById object.
+
+ :param str id: The unique identifier for this routing table.
+ """
+ # pylint: disable=super-init-not-called
+ self.id = id
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'RoutingTableIdentityById':
+ """Initialize a RoutingTableIdentityById object from a json dictionary."""
+ args = {}
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
+ else:
+ raise ValueError('Required property \'id\' not present in RoutingTableIdentityById JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a RoutingTableIdentityById object from a json dictionary."""
+ return cls.from_dict(_dict)
+
+ def to_dict(self) -> Dict:
+ """Return a json dictionary representing this model."""
+ _dict = {}
+ if hasattr(self, '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 RoutingTableIdentityById object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'RoutingTableIdentityById') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'RoutingTableIdentityById') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+
+class SecurityGroupIdentityByCRN(SecurityGroupIdentity):
+ """
+ SecurityGroupIdentityByCRN.
+
+ :param str crn: The security group's CRN.
+ """
+
+ def __init__(
+ self,
+ crn: str,
+ ) -> None:
+ """
+ Initialize a SecurityGroupIdentityByCRN object.
+
+ :param str crn: The security group's CRN.
+ """
+ # pylint: disable=super-init-not-called
+ self.crn = crn
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'SecurityGroupIdentityByCRN':
+ """Initialize a SecurityGroupIdentityByCRN object from a json dictionary."""
+ args = {}
+ if (crn := _dict.get('crn')) is not None:
+ args['crn'] = crn
+ else:
+ raise ValueError('Required property \'crn\' not present in SecurityGroupIdentityByCRN JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a SecurityGroupIdentityByCRN object from a json dictionary."""
+ return cls.from_dict(_dict)
+
+ def to_dict(self) -> Dict:
+ """Return a json dictionary representing this model."""
+ _dict = {}
+ if hasattr(self, '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 SecurityGroupIdentityByCRN object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'SecurityGroupIdentityByCRN') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'SecurityGroupIdentityByCRN') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+
+class SecurityGroupIdentityByHref(SecurityGroupIdentity):
+ """
+ SecurityGroupIdentityByHref.
+
+ :param str href: The security group's canonical URL.
+ """
+
+ def __init__(
+ self,
+ href: str,
+ ) -> None:
+ """
+ Initialize a SecurityGroupIdentityByHref object.
+
+ :param str href: The security group's canonical URL.
+ """
+ # pylint: disable=super-init-not-called
+ self.href = href
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'SecurityGroupIdentityByHref':
+ """Initialize a SecurityGroupIdentityByHref object from a json dictionary."""
+ args = {}
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
+ else:
+ raise ValueError('Required property \'href\' not present in SecurityGroupIdentityByHref JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a SecurityGroupIdentityByHref object from a json dictionary."""
+ return cls.from_dict(_dict)
+
+ def to_dict(self) -> Dict:
+ """Return a json dictionary representing this model."""
+ _dict = {}
+ if hasattr(self, '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 SecurityGroupIdentityByHref object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'SecurityGroupIdentityByHref') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'SecurityGroupIdentityByHref') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+
+class SecurityGroupIdentityById(SecurityGroupIdentity):
+ """
+ SecurityGroupIdentityById.
+
+ :param str id: The unique identifier for this security group.
+ """
+
+ def __init__(
+ self,
+ id: str,
+ ) -> None:
+ """
+ Initialize a SecurityGroupIdentityById object.
+
+ :param str id: The unique identifier for this security group.
+ """
+ # pylint: disable=super-init-not-called
+ self.id = id
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'SecurityGroupIdentityById':
+ """Initialize a SecurityGroupIdentityById object from a json dictionary."""
+ args = {}
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
+ else:
+ raise ValueError('Required property \'id\' not present in SecurityGroupIdentityById JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a SecurityGroupIdentityById object from a json dictionary."""
+ return cls.from_dict(_dict)
+
+ def to_dict(self) -> Dict:
+ """Return a json dictionary representing this model."""
+ _dict = {}
+ if hasattr(self, '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 SecurityGroupIdentityById object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'SecurityGroupIdentityById') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'SecurityGroupIdentityById') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+
+class SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll(SecurityGroupRulePrototype):
+ """
+ A rule allowing traffic for all supported protocols.
+
+ :param str direction: The direction of traffic to enforce.
+ :param str ip_version: (optional) The IP version to enforce. The format of
+ `remote.address` or `remote.cidr_block` must match this property, if they are
+ used. Alternatively, if `remote` references a security group, then this rule
+ only applies to IP addresses (network interfaces) in that group matching this IP
+ version.
+ :param str protocol: The protocol to enforce.
+ :param SecurityGroupRuleRemotePrototype remote: (optional) The remote IP
+ addresses or security groups from which this rule will allow traffic (or to
+ which, for outbound rules). Can be specified as an IP address, a CIDR block, or
+ a
+ security group within the VPC.
+ If unspecified, a CIDR block of `0.0.0.0/0` will be used to allow traffic from
+ any source
+ (or to any destination, for outbound rules).
+ """
+
+ def __init__(
+ self,
+ direction: str,
+ protocol: str,
+ *,
+ ip_version: Optional[str] = None,
+ remote: Optional['SecurityGroupRuleRemotePrototype'] = None,
+ ) -> None:
+ """
+ Initialize a SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll object.
+
+ :param str direction: The direction of traffic to enforce.
+ :param str protocol: The protocol to enforce.
+ :param str ip_version: (optional) The IP version to enforce. The format of
+ `remote.address` or `remote.cidr_block` must match this property, if they
+ are used. Alternatively, if `remote` references a security group, then this
+ rule only applies to IP addresses (network interfaces) in that group
+ matching this IP version.
+ :param SecurityGroupRuleRemotePrototype remote: (optional) The remote IP
+ addresses or security groups from which this rule will allow traffic (or to
+ which, for outbound rules). Can be specified as an IP address, a CIDR
+ block, or a
+ security group within the VPC.
+ If unspecified, a CIDR block of `0.0.0.0/0` will be used to allow traffic
+ from any source
+ (or to any destination, for outbound rules).
+ """
+ # pylint: disable=super-init-not-called
+ self.direction = direction
+ self.ip_version = ip_version
+ self.protocol = protocol
+ self.remote = remote
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll':
+ """Initialize a SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll object from a json dictionary."""
+ args = {}
+ if (direction := _dict.get('direction')) is not None:
+ args['direction'] = direction
+ else:
+ raise ValueError('Required property \'direction\' not present in SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll JSON')
+ if (ip_version := _dict.get('ip_version')) is not None:
+ args['ip_version'] = ip_version
+ if (protocol := _dict.get('protocol')) is not None:
+ args['protocol'] = protocol
+ else:
+ raise ValueError('Required property \'protocol\' not present in SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll JSON')
+ if (remote := _dict.get('remote')) is not None:
+ args['remote'] = remote
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll object from a json dictionary."""
+ return cls.from_dict(_dict)
+
+ def to_dict(self) -> Dict:
+ """Return a json dictionary representing this model."""
+ _dict = {}
+ if hasattr(self, 'direction') and self.direction is not None:
+ _dict['direction'] = self.direction
+ if hasattr(self, 'ip_version') and self.ip_version is not None:
+ _dict['ip_version'] = self.ip_version
+ if hasattr(self, 'protocol') and self.protocol is not None:
+ _dict['protocol'] = self.protocol
+ if hasattr(self, 'remote') and self.remote is not None:
+ if isinstance(self.remote, dict):
+ _dict['remote'] = self.remote
+ else:
+ _dict['remote'] = self.remote.to_dict()
+ return _dict
+
+ def _to_dict(self):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
+
+ def __str__(self) -> str:
+ """Return a `str` version of this SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+ class DirectionEnum(str, Enum):
+ """
+ The direction of traffic to enforce.
+ """
+
+ INBOUND = 'inbound'
+ OUTBOUND = 'outbound'
+
+
+ class IpVersionEnum(str, Enum):
+ """
+ The IP version to enforce. The format of `remote.address` or `remote.cidr_block`
+ must match this property, if they are used. Alternatively, if `remote` references
+ a security group, then this rule only applies to IP addresses (network interfaces)
+ in that group matching this IP version.
+ """
+
+ IPV4 = 'ipv4'
+
+
+ class ProtocolEnum(str, Enum):
+ """
+ The protocol to enforce.
+ """
+
+ ALL = 'all'
+
+
+
+class SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP(SecurityGroupRulePrototype):
+ """
+ A rule specifying the ICMP traffic to allow.
+
+ :param int code: (optional) The ICMP traffic code to allow.
+ If specified, `type` must also be specified. If unspecified, all codes are
+ allowed.
+ :param str direction: The direction of traffic to enforce.
+ :param str ip_version: (optional) The IP version to enforce. The format of
+ `remote.address` or `remote.cidr_block` must match this property, if they are
+ used. Alternatively, if `remote` references a security group, then this rule
+ only applies to IP addresses (network interfaces) in that group matching this IP
+ version.
+ :param str protocol: The protocol to enforce.
+ :param SecurityGroupRuleRemotePrototype remote: (optional) The remote IP
+ addresses or security groups from which this rule will allow traffic (or to
+ which, for outbound rules). Can be specified as an IP address, a CIDR block, or
+ a
+ security group within the VPC.
+ If unspecified, a CIDR block of `0.0.0.0/0` will be used to allow traffic from
+ any source
+ (or to any destination, for outbound rules).
+ :param int type: (optional) The ICMP traffic type to allow.
+ If unspecified, all types are allowed.
+ """
+
+ def __init__(
+ self,
+ direction: str,
+ protocol: str,
+ *,
+ code: Optional[int] = None,
+ ip_version: Optional[str] = None,
+ remote: Optional['SecurityGroupRuleRemotePrototype'] = None,
+ type: Optional[int] = None,
+ ) -> None:
+ """
+ Initialize a SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP object.
+
+ :param str direction: The direction of traffic to enforce.
+ :param str protocol: The protocol to enforce.
+ :param int code: (optional) The ICMP traffic code to allow.
+ If specified, `type` must also be specified. If unspecified, all codes are
+ allowed.
+ :param str ip_version: (optional) The IP version to enforce. The format of
+ `remote.address` or `remote.cidr_block` must match this property, if they
+ are used. Alternatively, if `remote` references a security group, then this
+ rule only applies to IP addresses (network interfaces) in that group
+ matching this IP version.
+ :param SecurityGroupRuleRemotePrototype remote: (optional) The remote IP
+ addresses or security groups from which this rule will allow traffic (or to
+ which, for outbound rules). Can be specified as an IP address, a CIDR
+ block, or a
+ security group within the VPC.
+ If unspecified, a CIDR block of `0.0.0.0/0` will be used to allow traffic
+ from any source
+ (or to any destination, for outbound rules).
+ :param int type: (optional) The ICMP traffic type to allow.
+ If unspecified, all types are allowed.
+ """
+ # pylint: disable=super-init-not-called
+ self.code = code
+ self.direction = direction
+ self.ip_version = ip_version
+ self.protocol = protocol
+ self.remote = remote
+ self.type = type
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP':
+ """Initialize a SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP object from a json dictionary."""
+ args = {}
+ if (code := _dict.get('code')) is not None:
+ args['code'] = code
+ if (direction := _dict.get('direction')) is not None:
+ args['direction'] = direction
+ else:
+ raise ValueError('Required property \'direction\' not present in SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP JSON')
+ if (ip_version := _dict.get('ip_version')) is not None:
+ args['ip_version'] = ip_version
+ if (protocol := _dict.get('protocol')) is not None:
+ args['protocol'] = protocol
+ else:
+ raise ValueError('Required property \'protocol\' not present in SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP JSON')
+ if (remote := _dict.get('remote')) is not None:
+ args['remote'] = remote
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP object from a json dictionary."""
+ return cls.from_dict(_dict)
+
+ def to_dict(self) -> Dict:
+ """Return a json dictionary representing this model."""
+ _dict = {}
+ if hasattr(self, 'code') and self.code is not None:
+ _dict['code'] = self.code
+ if hasattr(self, 'direction') and self.direction is not None:
+ _dict['direction'] = self.direction
+ if hasattr(self, 'ip_version') and self.ip_version is not None:
+ _dict['ip_version'] = self.ip_version
+ if hasattr(self, 'protocol') and self.protocol is not None:
+ _dict['protocol'] = self.protocol
+ if hasattr(self, 'remote') and self.remote is not None:
+ if isinstance(self.remote, dict):
+ _dict['remote'] = self.remote
+ else:
+ _dict['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):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
+
+ def __str__(self) -> str:
+ """Return a `str` version of this SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+ class DirectionEnum(str, Enum):
+ """
+ The direction of traffic to enforce.
+ """
+
+ INBOUND = 'inbound'
+ OUTBOUND = 'outbound'
+
+
+ class IpVersionEnum(str, Enum):
+ """
+ The IP version to enforce. The format of `remote.address` or `remote.cidr_block`
+ must match this property, if they are used. Alternatively, if `remote` references
+ a security group, then this rule only applies to IP addresses (network interfaces)
+ in that group matching this IP version.
+ """
+
+ IPV4 = 'ipv4'
+
+
+ class ProtocolEnum(str, Enum):
+ """
+ The protocol to enforce.
+ """
+
+ ICMP = 'icmp'
+
+
+
+class SecurityGroupRulePrototypeSecurityGroupRuleProtocolTCPUDP(SecurityGroupRulePrototype):
+ """
+ A rule specifying the TCP or UDP traffic to allow.
+ Either both `port_min` and `port_max` will be present, or neither. When neither is
+ present, all destination ports are allowed for the protocol. When both have the same
+ value, that single destination port is allowed.
+
+ :param str direction: The direction of traffic to enforce.
+ :param str ip_version: (optional) The IP version to enforce. The format of
+ `remote.address` or `remote.cidr_block` must match this property, if they are
+ used. Alternatively, if `remote` references a security group, then this rule
+ only applies to IP addresses (network interfaces) in that group matching this IP
+ version.
+ :param int port_max: (optional) The inclusive upper bound of TCP/UDP destination
+ port range.
+ If specified, `port_min` must also be specified, and must not be larger. If
+ unspecified,
+ `port_min` must also be unspecified, allowing traffic on all destination ports.
+ :param int port_min: (optional) The inclusive lower bound of TCP/UDP destination
+ port range
+ If specified, `port_max` must also be specified, and must not be smaller. If
+ unspecified, `port_max` must also be unspecified, allowing traffic on all
+ destination ports.
+ :param str protocol: The protocol to enforce.
+ :param SecurityGroupRuleRemotePrototype remote: (optional) The remote IP
+ addresses or security groups from which this rule will allow traffic (or to
+ which, for outbound rules). Can be specified as an IP address, a CIDR block, or
+ a
+ security group within the VPC.
+ If unspecified, a CIDR block of `0.0.0.0/0` will be used to allow traffic from
+ any source
+ (or to any destination, for outbound rules).
+ """
+
+ def __init__(
+ self,
+ direction: str,
+ protocol: str,
+ *,
+ ip_version: Optional[str] = None,
+ port_max: Optional[int] = None,
+ port_min: Optional[int] = None,
+ remote: Optional['SecurityGroupRuleRemotePrototype'] = None,
+ ) -> None:
+ """
+ Initialize a SecurityGroupRulePrototypeSecurityGroupRuleProtocolTCPUDP object.
+
+ :param str direction: The direction of traffic to enforce.
+ :param str protocol: The protocol to enforce.
+ :param str ip_version: (optional) The IP version to enforce. The format of
+ `remote.address` or `remote.cidr_block` must match this property, if they
+ are used. Alternatively, if `remote` references a security group, then this
+ rule only applies to IP addresses (network interfaces) in that group
+ matching this IP version.
+ :param int port_max: (optional) The inclusive upper bound of TCP/UDP
+ destination port range.
+ If specified, `port_min` must also be specified, and must not be larger. If
+ unspecified,
+ `port_min` must also be unspecified, allowing traffic on all destination
+ ports.
+ :param int port_min: (optional) The inclusive lower bound of TCP/UDP
+ destination port range
+ If specified, `port_max` must also be specified, and must not be smaller.
+ If unspecified, `port_max` must also be unspecified, allowing traffic on
+ all destination ports.
+ :param SecurityGroupRuleRemotePrototype remote: (optional) The remote IP
+ addresses or security groups from which this rule will allow traffic (or to
+ which, for outbound rules). Can be specified as an IP address, a CIDR
+ block, or a
+ security group within the VPC.
+ If unspecified, a CIDR block of `0.0.0.0/0` will be used to allow traffic
+ from any source
+ (or to any destination, for outbound rules).
+ """
+ # pylint: disable=super-init-not-called
+ self.direction = direction
+ self.ip_version = ip_version
+ self.port_max = port_max
+ self.port_min = port_min
+ self.protocol = protocol
+ self.remote = remote
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'SecurityGroupRulePrototypeSecurityGroupRuleProtocolTCPUDP':
+ """Initialize a SecurityGroupRulePrototypeSecurityGroupRuleProtocolTCPUDP object from a json dictionary."""
+ args = {}
+ if (direction := _dict.get('direction')) is not None:
+ args['direction'] = direction
+ else:
+ raise ValueError('Required property \'direction\' not present in SecurityGroupRulePrototypeSecurityGroupRuleProtocolTCPUDP JSON')
+ if (ip_version := _dict.get('ip_version')) is not None:
+ args['ip_version'] = ip_version
+ if (port_max := _dict.get('port_max')) is not None:
+ args['port_max'] = port_max
+ if (port_min := _dict.get('port_min')) is not None:
+ args['port_min'] = port_min
+ if (protocol := _dict.get('protocol')) is not None:
+ args['protocol'] = protocol
+ else:
+ raise ValueError('Required property \'protocol\' not present in SecurityGroupRulePrototypeSecurityGroupRuleProtocolTCPUDP JSON')
+ if (remote := _dict.get('remote')) is not None:
+ args['remote'] = remote
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a SecurityGroupRulePrototypeSecurityGroupRuleProtocolTCPUDP object from a json dictionary."""
+ return cls.from_dict(_dict)
+
+ def to_dict(self) -> Dict:
+ """Return a json dictionary representing this model."""
+ _dict = {}
+ if hasattr(self, 'direction') and self.direction is not None:
+ _dict['direction'] = self.direction
+ if hasattr(self, 'ip_version') and self.ip_version is not None:
+ _dict['ip_version'] = self.ip_version
+ if hasattr(self, 'port_max') and self.port_max is not None:
+ _dict['port_max'] = self.port_max
+ if hasattr(self, 'port_min') and self.port_min is not None:
+ _dict['port_min'] = self.port_min
+ if hasattr(self, 'protocol') and self.protocol is not None:
+ _dict['protocol'] = self.protocol
+ if hasattr(self, 'remote') and self.remote is not None:
+ if isinstance(self.remote, dict):
+ _dict['remote'] = self.remote
+ else:
+ _dict['remote'] = self.remote.to_dict()
+ return _dict
+
+ def _to_dict(self):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
+
+ def __str__(self) -> str:
+ """Return a `str` version of this SecurityGroupRulePrototypeSecurityGroupRuleProtocolTCPUDP object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'SecurityGroupRulePrototypeSecurityGroupRuleProtocolTCPUDP') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'SecurityGroupRulePrototypeSecurityGroupRuleProtocolTCPUDP') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+ class DirectionEnum(str, Enum):
+ """
+ The direction of traffic to enforce.
+ """
+
+ INBOUND = 'inbound'
+ OUTBOUND = 'outbound'
+
+
+ class IpVersionEnum(str, Enum):
+ """
+ The IP version to enforce. The format of `remote.address` or `remote.cidr_block`
+ must match this property, if they are used. Alternatively, if `remote` references
+ a security group, then this rule only applies to IP addresses (network interfaces)
+ in that group matching this IP version.
+ """
+
+ IPV4 = 'ipv4'
+
+
+ class ProtocolEnum(str, Enum):
+ """
+ The protocol to enforce.
+ """
+
+ TCP = 'tcp'
+ UDP = 'udp'
+
+
+
+class SecurityGroupRuleRemotePatchCIDR(SecurityGroupRuleRemotePatch):
+ """
+ SecurityGroupRuleRemotePatchCIDR.
+
+ :param str cidr_block: The CIDR block. This property may add support for IPv6
+ CIDR blocks in the future. When processing a value in this property, verify that
+ the CIDR block is in an expected format. If it is not, log an error. Optionally
+ halt processing and surface the error, or bypass the resource on which the
+ unexpected CIDR block format was encountered.
+ """
+
+ def __init__(
+ self,
+ cidr_block: str,
+ ) -> None:
+ """
+ Initialize a SecurityGroupRuleRemotePatchCIDR object.
+
+ :param str cidr_block: The CIDR block. This property may add support for
+ IPv6 CIDR blocks in the future. When processing a value in this property,
+ verify that the CIDR block is in an expected format. If it is not, log an
+ error. Optionally halt processing and surface the error, or bypass the
+ resource on which the unexpected CIDR block format was encountered.
+ """
+ # pylint: disable=super-init-not-called
+ self.cidr_block = cidr_block
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'SecurityGroupRuleRemotePatchCIDR':
+ """Initialize a SecurityGroupRuleRemotePatchCIDR object from a json dictionary."""
+ args = {}
+ if (cidr_block := _dict.get('cidr_block')) is not None:
+ args['cidr_block'] = cidr_block
+ else:
+ raise ValueError('Required property \'cidr_block\' not present in SecurityGroupRuleRemotePatchCIDR JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a SecurityGroupRuleRemotePatchCIDR object from a json dictionary."""
+ return cls.from_dict(_dict)
+
+ def to_dict(self) -> Dict:
+ """Return a json dictionary representing this model."""
+ _dict = {}
+ if hasattr(self, 'cidr_block') and self.cidr_block is not None:
+ _dict['cidr_block'] = self.cidr_block
+ return _dict
+
+ def _to_dict(self):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
+
+ def __str__(self) -> str:
+ """Return a `str` version of this SecurityGroupRuleRemotePatchCIDR object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'SecurityGroupRuleRemotePatchCIDR') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'SecurityGroupRuleRemotePatchCIDR') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+
+class SecurityGroupRuleRemotePatchIP(SecurityGroupRuleRemotePatch):
+ """
+ SecurityGroupRuleRemotePatchIP.
+
+ :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.
+ """
+
+ def __init__(
+ self,
+ address: str,
+ ) -> None:
+ """
+ Initialize a SecurityGroupRuleRemotePatchIP object.
+
+ :param str address: The IP address.
+ This property may add support for IPv6 addresses in the future. When
+ processing a value in this property, verify that the address is in an
+ expected format. If it is not, log an error. Optionally halt processing and
+ surface the error, or bypass the resource on which the unexpected IP
+ address format was encountered.
+ """
+ # pylint: disable=super-init-not-called
+ self.address = address
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'SecurityGroupRuleRemotePatchIP':
+ """Initialize a SecurityGroupRuleRemotePatchIP object from a json dictionary."""
+ args = {}
+ if (address := _dict.get('address')) is not None:
+ args['address'] = address
+ else:
+ raise ValueError('Required property \'address\' not present in SecurityGroupRuleRemotePatchIP JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a SecurityGroupRuleRemotePatchIP object from a json dictionary."""
+ return cls.from_dict(_dict)
+
+ def to_dict(self) -> Dict:
+ """Return a json dictionary representing this model."""
+ _dict = {}
+ if hasattr(self, 'address') and self.address is not None:
+ _dict['address'] = self.address
+ return _dict
+
+ def _to_dict(self):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
+
+ def __str__(self) -> str:
+ """Return a `str` version of this SecurityGroupRuleRemotePatchIP object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'SecurityGroupRuleRemotePatchIP') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'SecurityGroupRuleRemotePatchIP') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+
+class SecurityGroupRuleRemotePatchSecurityGroupIdentity(SecurityGroupRuleRemotePatch):
+ """
+ Identifies a security group by a unique property.
+
+ """
+
+ def __init__(
+ self,
+ ) -> None:
+ """
+ Initialize a SecurityGroupRuleRemotePatchSecurityGroupIdentity object.
+
+ """
+ # pylint: disable=super-init-not-called
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['SecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityById', 'SecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityByCRN', 'SecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityByHref'])
+ )
+ raise Exception(msg)
+
+
+class SecurityGroupRuleRemotePrototypeCIDR(SecurityGroupRuleRemotePrototype):
+ """
+ SecurityGroupRuleRemotePrototypeCIDR.
+
+ :param str cidr_block: The CIDR block. This property may add support for IPv6
+ CIDR blocks in the future. When processing a value in this property, verify that
+ the CIDR block is in an expected format. If it is not, log an error. Optionally
+ halt processing and surface the error, or bypass the resource on which the
+ unexpected CIDR block format was encountered.
+ """
+
+ def __init__(
+ self,
+ cidr_block: str,
+ ) -> None:
+ """
+ Initialize a SecurityGroupRuleRemotePrototypeCIDR object.
+
+ :param str cidr_block: The CIDR block. This property may add support for
+ IPv6 CIDR blocks in the future. When processing a value in this property,
+ verify that the CIDR block is in an expected format. If it is not, log an
+ error. Optionally halt processing and surface the error, or bypass the
+ resource on which the unexpected CIDR block format was encountered.
+ """
+ # pylint: disable=super-init-not-called
+ self.cidr_block = cidr_block
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'SecurityGroupRuleRemotePrototypeCIDR':
+ """Initialize a SecurityGroupRuleRemotePrototypeCIDR object from a json dictionary."""
+ args = {}
+ if (cidr_block := _dict.get('cidr_block')) is not None:
+ args['cidr_block'] = cidr_block
+ else:
+ raise ValueError('Required property \'cidr_block\' not present in SecurityGroupRuleRemotePrototypeCIDR JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a SecurityGroupRuleRemotePrototypeCIDR object from a json dictionary."""
+ return cls.from_dict(_dict)
+
+ def to_dict(self) -> Dict:
+ """Return a json dictionary representing this model."""
+ _dict = {}
+ if hasattr(self, 'cidr_block') and self.cidr_block is not None:
+ _dict['cidr_block'] = self.cidr_block
+ return _dict
+
+ def _to_dict(self):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
+
+ def __str__(self) -> str:
+ """Return a `str` version of this SecurityGroupRuleRemotePrototypeCIDR object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'SecurityGroupRuleRemotePrototypeCIDR') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'SecurityGroupRuleRemotePrototypeCIDR') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+
+class SecurityGroupRuleRemotePrototypeIP(SecurityGroupRuleRemotePrototype):
+ """
+ SecurityGroupRuleRemotePrototypeIP.
+
+ :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.
+ """
+
+ def __init__(
+ self,
+ address: str,
+ ) -> None:
+ """
+ Initialize a SecurityGroupRuleRemotePrototypeIP object.
+
+ :param str address: The IP address.
+ This property may add support for IPv6 addresses in the future. When
+ processing a value in this property, verify that the address is in an
+ expected format. If it is not, log an error. Optionally halt processing and
+ surface the error, or bypass the resource on which the unexpected IP
+ address format was encountered.
+ """
+ # pylint: disable=super-init-not-called
+ self.address = address
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'SecurityGroupRuleRemotePrototypeIP':
+ """Initialize a SecurityGroupRuleRemotePrototypeIP object from a json dictionary."""
+ args = {}
+ if (address := _dict.get('address')) is not None:
+ args['address'] = address
+ else:
+ raise ValueError('Required property \'address\' not present in SecurityGroupRuleRemotePrototypeIP JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a SecurityGroupRuleRemotePrototypeIP object from a json dictionary."""
+ return cls.from_dict(_dict)
+
+ def to_dict(self) -> Dict:
+ """Return a json dictionary representing this model."""
+ _dict = {}
+ if hasattr(self, 'address') and self.address is not None:
+ _dict['address'] = self.address
+ return _dict
+
+ def _to_dict(self):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
+
+ def __str__(self) -> str:
+ """Return a `str` version of this SecurityGroupRuleRemotePrototypeIP object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'SecurityGroupRuleRemotePrototypeIP') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'SecurityGroupRuleRemotePrototypeIP') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+
+class SecurityGroupRuleRemotePrototypeSecurityGroupIdentity(SecurityGroupRuleRemotePrototype):
+ """
+ Identifies a security group by a unique property.
+
+ """
+
+ def __init__(
+ self,
+ ) -> None:
+ """
+ Initialize a SecurityGroupRuleRemotePrototypeSecurityGroupIdentity object.
+
+ """
+ # pylint: disable=super-init-not-called
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['SecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityById', 'SecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityByCRN', 'SecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityByHref'])
+ )
+ raise Exception(msg)
+
+
+class SecurityGroupRuleRemoteCIDR(SecurityGroupRuleRemote):
+ """
+ SecurityGroupRuleRemoteCIDR.
+
+ :param str cidr_block: The CIDR block. This property may add support for IPv6
+ CIDR blocks in the future. When processing a value in this property, verify that
+ the CIDR block is in an expected format. If it is not, log an error. Optionally
+ halt processing and surface the error, or bypass the resource on which the
+ unexpected CIDR block format was encountered.
+ """
+
+ def __init__(
+ self,
+ cidr_block: str,
+ ) -> None:
+ """
+ Initialize a SecurityGroupRuleRemoteCIDR object.
+
+ :param str cidr_block: The CIDR block. This property may add support for
+ IPv6 CIDR blocks in the future. When processing a value in this property,
+ verify that the CIDR block is in an expected format. If it is not, log an
+ error. Optionally halt processing and surface the error, or bypass the
+ resource on which the unexpected CIDR block format was encountered.
+ """
+ # pylint: disable=super-init-not-called
+ self.cidr_block = cidr_block
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'SecurityGroupRuleRemoteCIDR':
+ """Initialize a SecurityGroupRuleRemoteCIDR object from a json dictionary."""
+ args = {}
+ if (cidr_block := _dict.get('cidr_block')) is not None:
+ args['cidr_block'] = cidr_block
+ else:
+ raise ValueError('Required property \'cidr_block\' not present in SecurityGroupRuleRemoteCIDR JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a SecurityGroupRuleRemoteCIDR object from a json dictionary."""
+ return cls.from_dict(_dict)
+
+ def to_dict(self) -> Dict:
+ """Return a json dictionary representing this model."""
+ _dict = {}
+ if hasattr(self, 'cidr_block') and self.cidr_block is not None:
+ _dict['cidr_block'] = self.cidr_block
+ return _dict
+
+ def _to_dict(self):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
+
+ def __str__(self) -> str:
+ """Return a `str` version of this SecurityGroupRuleRemoteCIDR object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'SecurityGroupRuleRemoteCIDR') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'SecurityGroupRuleRemoteCIDR') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+
+class SecurityGroupRuleRemoteIP(SecurityGroupRuleRemote):
+ """
+ SecurityGroupRuleRemoteIP.
+
+ :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.
+ """
+
+ def __init__(
+ self,
+ address: str,
+ ) -> None:
+ """
+ Initialize a SecurityGroupRuleRemoteIP object.
+
+ :param str address: The IP address.
+ This property may add support for IPv6 addresses in the future. When
+ processing a value in this property, verify that the address is in an
+ expected format. If it is not, log an error. Optionally halt processing and
+ surface the error, or bypass the resource on which the unexpected IP
+ address format was encountered.
+ """
+ # pylint: disable=super-init-not-called
+ self.address = address
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'SecurityGroupRuleRemoteIP':
+ """Initialize a SecurityGroupRuleRemoteIP object from a json dictionary."""
+ args = {}
+ if (address := _dict.get('address')) is not None:
+ args['address'] = address
+ else:
+ raise ValueError('Required property \'address\' not present in SecurityGroupRuleRemoteIP JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a SecurityGroupRuleRemoteIP object from a json dictionary."""
+ return cls.from_dict(_dict)
+
+ def to_dict(self) -> Dict:
+ """Return a json dictionary representing this model."""
+ _dict = {}
+ if hasattr(self, 'address') and self.address is not None:
+ _dict['address'] = self.address
+ return _dict
+
+ def _to_dict(self):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
+
+ def __str__(self) -> str:
+ """Return a `str` version of this SecurityGroupRuleRemoteIP object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'SecurityGroupRuleRemoteIP') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'SecurityGroupRuleRemoteIP') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+
+class SecurityGroupRuleRemoteSecurityGroupReference(SecurityGroupRuleRemote):
+ """
+ SecurityGroupRuleRemoteSecurityGroupReference.
+
+ :param str crn: The security group's CRN.
+ :param SecurityGroupReferenceDeleted deleted: (optional) If present, this
+ property indicates the referenced resource has been deleted, and provides
+ some supplementary information.
+ :param str href: The security group's canonical URL.
+ :param str id: The unique identifier for this security group.
+ :param str name: The name for this security group. The name is unique across all
+ security groups for the VPC.
+ """
+
+ def __init__(
+ self,
+ crn: str,
+ href: str,
+ id: str,
+ name: str,
+ *,
+ deleted: Optional['SecurityGroupReferenceDeleted'] = None,
+ ) -> None:
+ """
+ Initialize a SecurityGroupRuleRemoteSecurityGroupReference object.
+
+ :param str crn: The security group's CRN.
+ :param str href: The security group's canonical URL.
+ :param str id: The unique identifier for this security group.
+ :param str name: The name for this security group. The name is unique
+ across all security groups for the VPC.
+ :param SecurityGroupReferenceDeleted deleted: (optional) If present, this
+ property indicates the referenced resource has been deleted, and provides
+ some supplementary information.
+ """
+ # pylint: disable=super-init-not-called
+ self.crn = crn
+ self.deleted = deleted
+ self.href = href
+ self.id = id
+ self.name = name
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'SecurityGroupRuleRemoteSecurityGroupReference':
+ """Initialize a SecurityGroupRuleRemoteSecurityGroupReference object from a json dictionary."""
+ args = {}
+ if (crn := _dict.get('crn')) is not None:
+ args['crn'] = crn
+ else:
+ raise ValueError('Required property \'crn\' not present in SecurityGroupRuleRemoteSecurityGroupReference JSON')
+ if (deleted := _dict.get('deleted')) is not None:
+ args['deleted'] = SecurityGroupReferenceDeleted.from_dict(deleted)
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
+ else:
+ raise ValueError('Required property \'href\' not present in SecurityGroupRuleRemoteSecurityGroupReference JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
+ else:
+ raise ValueError('Required property \'id\' not present in SecurityGroupRuleRemoteSecurityGroupReference JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ else:
+ raise ValueError('Required property \'name\' not present in SecurityGroupRuleRemoteSecurityGroupReference JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a SecurityGroupRuleRemoteSecurityGroupReference object from a json dictionary."""
+ return cls.from_dict(_dict)
+
+ def to_dict(self) -> Dict:
+ """Return a json dictionary representing this model."""
+ _dict = {}
+ if hasattr(self, 'crn') and self.crn is not None:
+ _dict['crn'] = self.crn
+ if hasattr(self, 'deleted') and self.deleted is not None:
+ if isinstance(self.deleted, dict):
+ _dict['deleted'] = self.deleted
+ else:
+ _dict['deleted'] = self.deleted.to_dict()
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
+ if hasattr(self, 'id') and self.id is not None:
+ _dict['id'] = self.id
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ return _dict
+
+ def _to_dict(self):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
+
+ def __str__(self) -> str:
+ """Return a `str` version of this SecurityGroupRuleRemoteSecurityGroupReference object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'SecurityGroupRuleRemoteSecurityGroupReference') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'SecurityGroupRuleRemoteSecurityGroupReference') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+
+class SecurityGroupRuleSecurityGroupRuleProtocolAll(SecurityGroupRule):
+ """
+ A rule allowing traffic for all supported protocols.
+
+ :param str direction: The direction of traffic to enforce.
+ :param str href: The URL for this security group rule.
+ :param str id: The unique identifier for this security group rule.
+ :param str ip_version: The IP version to enforce. The format of `remote.address`
+ or `remote.cidr_block` must match this property, if they are used.
+ Alternatively, if `remote` references a security group, then this rule only
+ applies to IP addresses (network interfaces) in that group matching this IP
+ version.
+ :param SecurityGroupRuleRemote remote:
+ :param str protocol: The protocol to enforce.
+ """
+
+ def __init__(
+ self,
+ direction: str,
+ href: str,
+ id: str,
+ ip_version: str,
+ remote: 'SecurityGroupRuleRemote',
+ protocol: str,
+ ) -> None:
+ """
+ Initialize a SecurityGroupRuleSecurityGroupRuleProtocolAll object.
+
+ :param str direction: The direction of traffic to enforce.
+ :param str href: The URL for this security group rule.
+ :param str id: The unique identifier for this security group rule.
+ :param str ip_version: The IP version to enforce. The format of
+ `remote.address` or `remote.cidr_block` must match this property, if they
+ are used. Alternatively, if `remote` references a security group, then this
+ rule only applies to IP addresses (network interfaces) in that group
+ matching this IP version.
+ :param SecurityGroupRuleRemote remote:
+ :param str protocol: The protocol to enforce.
+ """
+ # pylint: disable=super-init-not-called
+ self.direction = direction
+ self.href = href
+ self.id = id
+ self.ip_version = ip_version
+ self.remote = remote
+ self.protocol = protocol
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'SecurityGroupRuleSecurityGroupRuleProtocolAll':
+ """Initialize a SecurityGroupRuleSecurityGroupRuleProtocolAll object from a json dictionary."""
+ args = {}
+ if (direction := _dict.get('direction')) is not None:
+ args['direction'] = direction
+ else:
+ raise ValueError('Required property \'direction\' not present in SecurityGroupRuleSecurityGroupRuleProtocolAll JSON')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
+ else:
+ raise ValueError('Required property \'href\' not present in SecurityGroupRuleSecurityGroupRuleProtocolAll JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
+ else:
+ raise ValueError('Required property \'id\' not present in SecurityGroupRuleSecurityGroupRuleProtocolAll JSON')
+ if (ip_version := _dict.get('ip_version')) is not None:
+ args['ip_version'] = ip_version
+ else:
+ raise ValueError('Required property \'ip_version\' not present in SecurityGroupRuleSecurityGroupRuleProtocolAll JSON')
+ if (remote := _dict.get('remote')) is not None:
+ args['remote'] = remote
+ else:
+ raise ValueError('Required property \'remote\' not present in SecurityGroupRuleSecurityGroupRuleProtocolAll JSON')
+ if (protocol := _dict.get('protocol')) is not None:
+ args['protocol'] = protocol
+ else:
+ raise ValueError('Required property \'protocol\' not present in SecurityGroupRuleSecurityGroupRuleProtocolAll JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a SecurityGroupRuleSecurityGroupRuleProtocolAll object from a json dictionary."""
+ return cls.from_dict(_dict)
+
+ def to_dict(self) -> Dict:
+ """Return a json dictionary representing this model."""
+ _dict = {}
+ if hasattr(self, 'direction') and self.direction is not None:
+ _dict['direction'] = self.direction
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
+ if hasattr(self, 'id') and self.id is not None:
+ _dict['id'] = self.id
+ if hasattr(self, 'ip_version') and self.ip_version is not None:
+ _dict['ip_version'] = self.ip_version
+ if hasattr(self, 'remote') and self.remote is not None:
+ if isinstance(self.remote, dict):
+ _dict['remote'] = self.remote
+ else:
+ _dict['remote'] = self.remote.to_dict()
+ if hasattr(self, 'protocol') and self.protocol is not None:
+ _dict['protocol'] = self.protocol
+ return _dict
+
+ def _to_dict(self):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
+
+ def __str__(self) -> str:
+ """Return a `str` version of this SecurityGroupRuleSecurityGroupRuleProtocolAll object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'SecurityGroupRuleSecurityGroupRuleProtocolAll') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'SecurityGroupRuleSecurityGroupRuleProtocolAll') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+ class DirectionEnum(str, Enum):
+ """
+ The direction of traffic to enforce.
+ """
+
+ INBOUND = 'inbound'
+ OUTBOUND = 'outbound'
+
+
+ class IpVersionEnum(str, Enum):
+ """
+ The IP version to enforce. The format of `remote.address` or `remote.cidr_block`
+ must match this property, if they are used. Alternatively, if `remote` references
+ a security group, then this rule only applies to IP addresses (network interfaces)
+ in that group matching this IP version.
+ """
+
+ IPV4 = 'ipv4'
+
+
+ class ProtocolEnum(str, Enum):
+ """
+ The protocol to enforce.
+ """
+
+ ALL = 'all'
+
+
+
+class SecurityGroupRuleSecurityGroupRuleProtocolICMP(SecurityGroupRule):
+ """
+ A rule specifying the ICMP traffic to allow.
+
+ :param str direction: The direction of traffic to enforce.
+ :param str href: The URL for this security group rule.
+ :param str id: The unique identifier for this security group rule.
+ :param str ip_version: The IP version to enforce. The format of `remote.address`
+ or `remote.cidr_block` must match this property, if they are used.
+ Alternatively, if `remote` references a security group, then this rule only
+ applies to IP addresses (network interfaces) in that group matching this IP
+ version.
+ :param SecurityGroupRuleRemote remote:
+ :param int code: (optional) The ICMP traffic code to allow. If absent, all codes
+ are allowed.
+ :param str protocol: The protocol to enforce.
+ :param int type: (optional) The ICMP traffic type to allow. If absent, all types
+ are allowed.
+ """
+
+ def __init__(
+ self,
+ direction: str,
+ href: str,
+ id: str,
+ ip_version: str,
+ remote: 'SecurityGroupRuleRemote',
+ protocol: str,
+ *,
+ code: Optional[int] = None,
+ type: Optional[int] = None,
+ ) -> None:
+ """
+ Initialize a SecurityGroupRuleSecurityGroupRuleProtocolICMP object.
+
+ :param str direction: The direction of traffic to enforce.
+ :param str href: The URL for this security group rule.
+ :param str id: The unique identifier for this security group rule.
+ :param str ip_version: The IP version to enforce. The format of
+ `remote.address` or `remote.cidr_block` must match this property, if they
+ are used. Alternatively, if `remote` references a security group, then this
+ rule only applies to IP addresses (network interfaces) in that group
+ matching this IP version.
+ :param SecurityGroupRuleRemote remote:
+ :param str protocol: The protocol to enforce.
+ :param int code: (optional) The ICMP traffic code to allow. If absent, all
+ codes are allowed.
+ :param int type: (optional) The ICMP traffic type to allow. If absent, all
+ types are allowed.
+ """
+ # pylint: disable=super-init-not-called
+ self.direction = direction
+ self.href = href
+ self.id = id
+ self.ip_version = ip_version
+ self.remote = remote
+ self.code = code
+ self.protocol = protocol
+ self.type = type
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'SecurityGroupRuleSecurityGroupRuleProtocolICMP':
+ """Initialize a SecurityGroupRuleSecurityGroupRuleProtocolICMP object from a json dictionary."""
+ args = {}
+ if (direction := _dict.get('direction')) is not None:
+ args['direction'] = direction
+ else:
+ raise ValueError('Required property \'direction\' not present in SecurityGroupRuleSecurityGroupRuleProtocolICMP JSON')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
+ else:
+ raise ValueError('Required property \'href\' not present in SecurityGroupRuleSecurityGroupRuleProtocolICMP JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
+ else:
+ raise ValueError('Required property \'id\' not present in SecurityGroupRuleSecurityGroupRuleProtocolICMP JSON')
+ if (ip_version := _dict.get('ip_version')) is not None:
+ args['ip_version'] = ip_version
+ else:
+ raise ValueError('Required property \'ip_version\' not present in SecurityGroupRuleSecurityGroupRuleProtocolICMP JSON')
+ if (remote := _dict.get('remote')) is not None:
+ args['remote'] = remote
+ else:
+ raise ValueError('Required property \'remote\' not present in SecurityGroupRuleSecurityGroupRuleProtocolICMP JSON')
+ if (code := _dict.get('code')) is not None:
+ args['code'] = code
+ if (protocol := _dict.get('protocol')) is not None:
+ args['protocol'] = protocol
+ else:
+ raise ValueError('Required property \'protocol\' not present in SecurityGroupRuleSecurityGroupRuleProtocolICMP JSON')
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a SecurityGroupRuleSecurityGroupRuleProtocolICMP object from a json dictionary."""
+ return cls.from_dict(_dict)
+
+ def to_dict(self) -> Dict:
+ """Return a json dictionary representing this model."""
+ _dict = {}
+ if hasattr(self, 'direction') and self.direction is not None:
+ _dict['direction'] = self.direction
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
+ if hasattr(self, 'id') and self.id is not None:
+ _dict['id'] = self.id
+ if hasattr(self, 'ip_version') and self.ip_version is not None:
+ _dict['ip_version'] = self.ip_version
+ if hasattr(self, 'remote') and self.remote is not None:
+ if isinstance(self.remote, dict):
+ _dict['remote'] = self.remote
+ else:
+ _dict['remote'] = self.remote.to_dict()
+ if hasattr(self, 'code') and self.code is not None:
+ _dict['code'] = self.code
+ if hasattr(self, 'protocol') and self.protocol is not None:
+ _dict['protocol'] = self.protocol
+ if hasattr(self, 'type') and self.type is not None:
+ _dict['type'] = self.type
+ return _dict
+
+ def _to_dict(self):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
+
+ def __str__(self) -> str:
+ """Return a `str` version of this SecurityGroupRuleSecurityGroupRuleProtocolICMP object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'SecurityGroupRuleSecurityGroupRuleProtocolICMP') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'SecurityGroupRuleSecurityGroupRuleProtocolICMP') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+ class DirectionEnum(str, Enum):
+ """
+ The direction of traffic to enforce.
+ """
+
+ INBOUND = 'inbound'
+ OUTBOUND = 'outbound'
+
+
+ class IpVersionEnum(str, Enum):
+ """
+ The IP version to enforce. The format of `remote.address` or `remote.cidr_block`
+ must match this property, if they are used. Alternatively, if `remote` references
+ a security group, then this rule only applies to IP addresses (network interfaces)
+ in that group matching this IP version.
+ """
+
+ IPV4 = 'ipv4'
+
+
+ class ProtocolEnum(str, Enum):
+ """
+ The protocol to enforce.
+ """
+
+ ICMP = 'icmp'
+
+
+
+class SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP(SecurityGroupRule):
+ """
+ A rule specifying the TCP or UDP traffic to allow.
+ Either both `port_min` and `port_max` will be present, or neither. When neither is
+ present, all destination ports are allowed for the protocol. When both have the same
+ value, that single destination port is allowed.
+
+ :param str direction: The direction of traffic to enforce.
+ :param str href: The URL for this security group rule.
+ :param str id: The unique identifier for this security group rule.
+ :param str ip_version: The IP version to enforce. The format of `remote.address`
+ or `remote.cidr_block` must match this property, if they are used.
+ Alternatively, if `remote` references a security group, then this rule only
+ applies to IP addresses (network interfaces) in that group matching this IP
+ version.
+ :param SecurityGroupRuleRemote remote:
+ :param int port_max: (optional) The inclusive upper bound of TCP/UDP destination
+ port range.
+ :param int port_min: (optional) The inclusive lower bound of TCP/UDP destination
+ port range.
+ :param str protocol: The protocol to enforce.
+ """
+
+ def __init__(
+ self,
+ direction: str,
+ href: str,
+ id: str,
+ ip_version: str,
+ remote: 'SecurityGroupRuleRemote',
+ protocol: str,
+ *,
+ port_max: Optional[int] = None,
+ port_min: Optional[int] = None,
+ ) -> None:
+ """
+ Initialize a SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP object.
+
+ :param str direction: The direction of traffic to enforce.
+ :param str href: The URL for this security group rule.
+ :param str id: The unique identifier for this security group rule.
+ :param str ip_version: The IP version to enforce. The format of
+ `remote.address` or `remote.cidr_block` must match this property, if they
+ are used. Alternatively, if `remote` references a security group, then this
+ rule only applies to IP addresses (network interfaces) in that group
+ matching this IP version.
+ :param SecurityGroupRuleRemote remote:
+ :param str protocol: The protocol to enforce.
+ :param int port_max: (optional) The inclusive upper bound of TCP/UDP
+ destination port range.
+ :param int port_min: (optional) The inclusive lower bound of TCP/UDP
+ destination port range.
+ """
+ # pylint: disable=super-init-not-called
+ self.direction = direction
+ self.href = href
+ self.id = id
+ self.ip_version = ip_version
+ self.remote = remote
+ self.port_max = port_max
+ self.port_min = port_min
+ self.protocol = protocol
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP':
+ """Initialize a SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP object from a json dictionary."""
+ args = {}
+ if (direction := _dict.get('direction')) is not None:
+ args['direction'] = direction
+ else:
+ raise ValueError('Required property \'direction\' not present in SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP JSON')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
+ else:
+ raise ValueError('Required property \'href\' not present in SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
+ else:
+ raise ValueError('Required property \'id\' not present in SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP JSON')
+ if (ip_version := _dict.get('ip_version')) is not None:
+ args['ip_version'] = ip_version
+ else:
+ raise ValueError('Required property \'ip_version\' not present in SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP JSON')
+ if (remote := _dict.get('remote')) is not None:
+ args['remote'] = remote
+ else:
+ raise ValueError('Required property \'remote\' not present in SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP JSON')
+ if (port_max := _dict.get('port_max')) is not None:
+ args['port_max'] = port_max
+ if (port_min := _dict.get('port_min')) is not None:
+ args['port_min'] = port_min
+ if (protocol := _dict.get('protocol')) is not None:
+ args['protocol'] = protocol
+ else:
+ raise ValueError('Required property \'protocol\' not present in SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP object from a json dictionary."""
+ return cls.from_dict(_dict)
+
+ def to_dict(self) -> Dict:
+ """Return a json dictionary representing this model."""
+ _dict = {}
+ if hasattr(self, 'direction') and self.direction is not None:
+ _dict['direction'] = self.direction
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
+ if hasattr(self, 'id') and self.id is not None:
+ _dict['id'] = self.id
+ if hasattr(self, 'ip_version') and self.ip_version is not None:
+ _dict['ip_version'] = self.ip_version
+ if hasattr(self, 'remote') and self.remote is not None:
+ if isinstance(self.remote, dict):
+ _dict['remote'] = self.remote
+ else:
+ _dict['remote'] = self.remote.to_dict()
+ if hasattr(self, 'port_max') and self.port_max is not None:
+ _dict['port_max'] = self.port_max
+ if hasattr(self, 'port_min') and self.port_min is not None:
+ _dict['port_min'] = self.port_min
+ if hasattr(self, 'protocol') and self.protocol is not None:
+ _dict['protocol'] = self.protocol
+ return _dict
+
+ def _to_dict(self):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
+
+ def __str__(self) -> str:
+ """Return a `str` version of this SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+ class DirectionEnum(str, Enum):
+ """
+ The direction of traffic to enforce.
+ """
+
+ INBOUND = 'inbound'
+ OUTBOUND = 'outbound'
+
+
+ class IpVersionEnum(str, Enum):
+ """
+ The IP version to enforce. The format of `remote.address` or `remote.cidr_block`
+ must match this property, if they are used. Alternatively, if `remote` references
+ a security group, then this rule only applies to IP addresses (network interfaces)
+ in that group matching this IP version.
+ """
+
+ IPV4 = 'ipv4'
+
+
+ class ProtocolEnum(str, Enum):
+ """
+ The protocol to enforce.
+ """
+
+ TCP = 'tcp'
+ UDP = 'udp'
+
+
+
+class SecurityGroupTargetReferenceBareMetalServerNetworkInterfaceReferenceTargetContext(SecurityGroupTargetReference):
+ """
+ SecurityGroupTargetReferenceBareMetalServerNetworkInterfaceReferenceTargetContext.
+
+ :param BareMetalServerNetworkInterfaceReferenceTargetContextDeleted 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 network interface.
+ If this bare metal server has network attachments, this network interface is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment.
+ :param str id: The unique identifier for this bare metal server network
+ interface.
+ If this bare metal server has network attachments, this network interface is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and the identifier is that of the corresponding network attachment.
+ :param str name: The name for this bare metal server network interface.
+ :param str resource_type: The resource type.
+ """
+
+ def __init__(
+ self,
+ href: str,
+ id: str,
+ name: str,
+ resource_type: str,
+ *,
+ deleted: Optional['BareMetalServerNetworkInterfaceReferenceTargetContextDeleted'] = None,
+ ) -> None:
+ """
+ Initialize a SecurityGroupTargetReferenceBareMetalServerNetworkInterfaceReferenceTargetContext object.
+
+ :param str href: The URL for this bare metal server network interface.
+ If this bare metal server has network attachments, this network interface
+ is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment.
+ :param str id: The unique identifier for this bare metal server network
+ interface.
+ If this bare metal server has network attachments, this network interface
+ is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and the identifier is that of the corresponding network
+ attachment.
+ :param str name: The name for this bare metal server network interface.
+ :param str resource_type: The resource type.
+ :param BareMetalServerNetworkInterfaceReferenceTargetContextDeleted
+ deleted: (optional) If present, this property indicates the referenced
+ resource has been deleted, and provides
+ some supplementary information.
+ """
+ # pylint: disable=super-init-not-called
+ self.deleted = deleted
+ self.href = href
+ self.id = id
+ self.name = name
+ self.resource_type = resource_type
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'SecurityGroupTargetReferenceBareMetalServerNetworkInterfaceReferenceTargetContext':
+ """Initialize a SecurityGroupTargetReferenceBareMetalServerNetworkInterfaceReferenceTargetContext object from a json dictionary."""
+ args = {}
+ if (deleted := _dict.get('deleted')) is not None:
+ args['deleted'] = BareMetalServerNetworkInterfaceReferenceTargetContextDeleted.from_dict(deleted)
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
+ else:
+ raise ValueError('Required property \'href\' not present in SecurityGroupTargetReferenceBareMetalServerNetworkInterfaceReferenceTargetContext JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
+ else:
+ raise ValueError('Required property \'id\' not present in SecurityGroupTargetReferenceBareMetalServerNetworkInterfaceReferenceTargetContext JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ else:
+ raise ValueError('Required property \'name\' not present in SecurityGroupTargetReferenceBareMetalServerNetworkInterfaceReferenceTargetContext JSON')
+ if (resource_type := _dict.get('resource_type')) is not None:
+ args['resource_type'] = resource_type
+ else:
+ raise ValueError('Required property \'resource_type\' not present in SecurityGroupTargetReferenceBareMetalServerNetworkInterfaceReferenceTargetContext JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a SecurityGroupTargetReferenceBareMetalServerNetworkInterfaceReferenceTargetContext object from a json dictionary."""
+ return cls.from_dict(_dict)
+
+ def to_dict(self) -> Dict:
+ """Return a json dictionary representing this model."""
+ _dict = {}
+ if hasattr(self, 'deleted') and self.deleted is not None:
+ if isinstance(self.deleted, dict):
+ _dict['deleted'] = self.deleted
+ else:
+ _dict['deleted'] = self.deleted.to_dict()
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
+ if hasattr(self, 'id') and self.id is not None:
+ _dict['id'] = self.id
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ if hasattr(self, 'resource_type') and self.resource_type is not None:
+ _dict['resource_type'] = self.resource_type
+ return _dict
+
+ def _to_dict(self):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
+
+ def __str__(self) -> str:
+ """Return a `str` version of this SecurityGroupTargetReferenceBareMetalServerNetworkInterfaceReferenceTargetContext object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'SecurityGroupTargetReferenceBareMetalServerNetworkInterfaceReferenceTargetContext') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'SecurityGroupTargetReferenceBareMetalServerNetworkInterfaceReferenceTargetContext') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+ class ResourceTypeEnum(str, Enum):
+ """
+ The resource type.
+ """
+
+ NETWORK_INTERFACE = 'network_interface'
+
+
+
+class SecurityGroupTargetReferenceEndpointGatewayReference(SecurityGroupTargetReference):
+ """
+ SecurityGroupTargetReferenceEndpointGatewayReference.
+
+ :param str crn: The CRN for this endpoint gateway.
+ :param EndpointGatewayReferenceDeleted deleted: (optional) If present, this
+ property indicates the referenced resource has been deleted, and provides
+ some supplementary information.
+ :param str href: The URL for this endpoint gateway.
+ :param str id: The unique identifier for this endpoint gateway.
+ :param str name: The name for this endpoint gateway. The name is unique across
+ all endpoint gateways in the VPC.
+ :param str resource_type: The resource type.
+ """
+
+ def __init__(
+ self,
+ crn: str,
+ href: str,
+ id: str,
+ name: str,
+ resource_type: str,
+ *,
+ deleted: Optional['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 name for this endpoint gateway. The name is unique
+ across all endpoint gateways in the VPC.
+ :param str resource_type: The resource type.
+ :param EndpointGatewayReferenceDeleted deleted: (optional) If present, this
+ property indicates the referenced resource has been deleted, and provides
+ some supplementary information.
+ """
+ # pylint: disable=super-init-not-called
+ self.crn = crn
+ self.deleted = deleted
+ self.href = href
+ self.id = id
+ self.name = name
+ self.resource_type = resource_type
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'SecurityGroupTargetReferenceEndpointGatewayReference':
+ """Initialize a SecurityGroupTargetReferenceEndpointGatewayReference object from a json dictionary."""
+ args = {}
+ if (crn := _dict.get('crn')) is not None:
+ args['crn'] = crn
+ else:
+ raise ValueError('Required property \'crn\' not present in SecurityGroupTargetReferenceEndpointGatewayReference JSON')
+ if (deleted := _dict.get('deleted')) is not None:
+ args['deleted'] = EndpointGatewayReferenceDeleted.from_dict(deleted)
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
+ else:
+ raise ValueError('Required property \'href\' not present in SecurityGroupTargetReferenceEndpointGatewayReference JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
+ else:
+ raise ValueError('Required property \'id\' not present in SecurityGroupTargetReferenceEndpointGatewayReference JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ else:
+ raise ValueError('Required property \'name\' not present in SecurityGroupTargetReferenceEndpointGatewayReference JSON')
+ if (resource_type := _dict.get('resource_type')) is not None:
+ args['resource_type'] = 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:
+ if isinstance(self.deleted, dict):
+ _dict['deleted'] = self.deleted
+ else:
+ _dict['deleted'] = self.deleted.to_dict()
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
+ if hasattr(self, 'id') and self.id is not None:
+ _dict['id'] = self.id
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ if hasattr(self, 'resource_type') and self.resource_type is not None:
+ _dict['resource_type'] = self.resource_type
+ return _dict
+
+ def _to_dict(self):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
+
+ def __str__(self) -> str:
+ """Return a `str` version of this 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):
"""
- ReservedIPTargetLoadBalancerReference.
+ SecurityGroupTargetReferenceLoadBalancerReference.
- :attr str crn: The load balancer's CRN.
- :attr LoadBalancerReferenceDeleted deleted: (optional) If present, this property
- indicates the referenced resource has been deleted, and provides
+ :param str crn: The load balancer's CRN.
+ :param LoadBalancerReferenceDeleted deleted: (optional) If present, this
+ property indicates the referenced resource has been deleted, and provides
some supplementary information.
- :attr str href: The load balancer's canonical URL.
- :attr str id: The unique identifier for this load balancer.
- :attr str name: The name for this load balancer. The name is unique across all
+ :param str href: The load balancer's canonical URL.
+ :param str id: The unique identifier for this load balancer.
+ :param str name: The name for this load balancer. The name is unique across all
load balancers in the VPC.
- :attr str resource_type: The resource type.
+ :param str resource_type: The resource type.
"""
def __init__(
@@ -111526,10 +126939,10 @@ def __init__(
name: str,
resource_type: str,
*,
- deleted: 'LoadBalancerReferenceDeleted' = None,
+ deleted: Optional['LoadBalancerReferenceDeleted'] = None,
) -> None:
"""
- Initialize a ReservedIPTargetLoadBalancerReference object.
+ Initialize a SecurityGroupTargetReferenceLoadBalancerReference object.
:param str crn: The load balancer's CRN.
:param str href: The load balancer's canonical URL.
@@ -111550,36 +126963,36 @@ def __init__(
self.resource_type = resource_type
@classmethod
- def from_dict(cls, _dict: Dict) -> 'ReservedIPTargetLoadBalancerReference':
- """Initialize a ReservedIPTargetLoadBalancerReference object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'SecurityGroupTargetReferenceLoadBalancerReference':
+ """Initialize a SecurityGroupTargetReferenceLoadBalancerReference object from a json dictionary."""
args = {}
- if 'crn' in _dict:
- args['crn'] = _dict.get('crn')
+ if (crn := _dict.get('crn')) is not None:
+ args['crn'] = crn
else:
- raise ValueError('Required property \'crn\' not present in ReservedIPTargetLoadBalancerReference JSON')
- if 'deleted' in _dict:
- args['deleted'] = LoadBalancerReferenceDeleted.from_dict(_dict.get('deleted'))
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ raise ValueError('Required property \'crn\' not present in SecurityGroupTargetReferenceLoadBalancerReference JSON')
+ if (deleted := _dict.get('deleted')) is not None:
+ args['deleted'] = LoadBalancerReferenceDeleted.from_dict(deleted)
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'href\' not present in ReservedIPTargetLoadBalancerReference JSON')
- if 'id' in _dict:
- args['id'] = _dict.get('id')
+ raise ValueError('Required property \'href\' not present in SecurityGroupTargetReferenceLoadBalancerReference JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
else:
- raise ValueError('Required property \'id\' not present in ReservedIPTargetLoadBalancerReference JSON')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
+ raise ValueError('Required property \'id\' not present in SecurityGroupTargetReferenceLoadBalancerReference JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
else:
- raise ValueError('Required property \'name\' not present in ReservedIPTargetLoadBalancerReference JSON')
- if 'resource_type' in _dict:
- args['resource_type'] = _dict.get('resource_type')
+ raise ValueError('Required property \'name\' not present in SecurityGroupTargetReferenceLoadBalancerReference JSON')
+ if (resource_type := _dict.get('resource_type')) is not None:
+ args['resource_type'] = resource_type
else:
- raise ValueError('Required property \'resource_type\' not present in ReservedIPTargetLoadBalancerReference JSON')
+ raise ValueError('Required property \'resource_type\' not present in SecurityGroupTargetReferenceLoadBalancerReference JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a ReservedIPTargetLoadBalancerReference object from a json dictionary."""
+ """Initialize a SecurityGroupTargetReferenceLoadBalancerReference object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -111607,16 +127020,16 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this ReservedIPTargetLoadBalancerReference object."""
+ """Return a `str` version of this SecurityGroupTargetReferenceLoadBalancerReference object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'ReservedIPTargetLoadBalancerReference') -> bool:
+ def __eq__(self, other: 'SecurityGroupTargetReferenceLoadBalancerReference') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'ReservedIPTargetLoadBalancerReference') -> bool:
+ def __ne__(self, other: 'SecurityGroupTargetReferenceLoadBalancerReference') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
@@ -111629,18 +127042,27 @@ class ResourceTypeEnum(str, Enum):
-class ReservedIPTargetNetworkInterfaceReferenceTargetContext(ReservedIPTarget):
+class SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext(SecurityGroupTargetReference):
"""
- ReservedIPTargetNetworkInterfaceReferenceTargetContext.
+ SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext.
- :attr NetworkInterfaceReferenceTargetContextDeleted deleted: (optional) If
+ :param NetworkInterfaceReferenceTargetContextDeleted deleted: (optional) If
present, this property indicates the referenced resource has been deleted, and
provides
some supplementary information.
- :attr str href: The URL for this instance network interface.
- :attr str id: The unique identifier for this instance network interface.
- :attr str name: The name for this instance network interface.
- :attr str resource_type: The resource type.
+ :param str href: The URL for this instance network interface.
+ If this instance has network attachments, this network interface is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment.
+ :param str id: The unique identifier for this instance network interface.
+ If this instance has network attachments, this network interface is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and the identifier is that of the corresponding network attachment.
+ :param str name: The name for this instance network interface.
+ :param str resource_type: The resource type.
"""
def __init__(
@@ -111650,13 +127072,23 @@ def __init__(
name: str,
resource_type: str,
*,
- deleted: 'NetworkInterfaceReferenceTargetContextDeleted' = None,
+ deleted: Optional['NetworkInterfaceReferenceTargetContextDeleted'] = None,
) -> None:
"""
- Initialize a ReservedIPTargetNetworkInterfaceReferenceTargetContext object.
+ Initialize a SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext object.
:param str href: The URL for this instance network interface.
+ If this instance has network attachments, this network interface is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment.
:param str id: The unique identifier for this instance network interface.
+ If this instance has network attachments, this network interface is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and the identifier is that of the corresponding network
+ attachment.
:param str name: The name for this instance network interface.
:param str resource_type: The resource type.
:param NetworkInterfaceReferenceTargetContextDeleted deleted: (optional) If
@@ -111672,37 +127104,308 @@ def __init__(
self.resource_type = resource_type
@classmethod
- def from_dict(cls, _dict: Dict) -> 'ReservedIPTargetNetworkInterfaceReferenceTargetContext':
- """Initialize a ReservedIPTargetNetworkInterfaceReferenceTargetContext object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext':
+ """Initialize a SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext object from a json dictionary."""
args = {}
- if 'deleted' in _dict:
- args['deleted'] = NetworkInterfaceReferenceTargetContextDeleted.from_dict(_dict.get('deleted'))
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ if (deleted := _dict.get('deleted')) is not None:
+ args['deleted'] = NetworkInterfaceReferenceTargetContextDeleted.from_dict(deleted)
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'href\' not present in ReservedIPTargetNetworkInterfaceReferenceTargetContext JSON')
- if 'id' in _dict:
- args['id'] = _dict.get('id')
+ raise ValueError('Required property \'href\' not present in SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
else:
- raise ValueError('Required property \'id\' not present in ReservedIPTargetNetworkInterfaceReferenceTargetContext JSON')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
+ raise ValueError('Required property \'id\' not present in SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
else:
- raise ValueError('Required property \'name\' not present in ReservedIPTargetNetworkInterfaceReferenceTargetContext JSON')
- if 'resource_type' in _dict:
- args['resource_type'] = _dict.get('resource_type')
+ raise ValueError('Required property \'name\' not present in SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext JSON')
+ if (resource_type := _dict.get('resource_type')) is not None:
+ args['resource_type'] = resource_type
else:
- raise ValueError('Required property \'resource_type\' not present in ReservedIPTargetNetworkInterfaceReferenceTargetContext JSON')
+ raise ValueError('Required property \'resource_type\' not present in SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a ReservedIPTargetNetworkInterfaceReferenceTargetContext object from a json dictionary."""
+ """Initialize a SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext object from a json dictionary."""
+ return cls.from_dict(_dict)
+
+ def to_dict(self) -> Dict:
+ """Return a json dictionary representing this model."""
+ _dict = {}
+ if hasattr(self, 'deleted') and self.deleted is not None:
+ if isinstance(self.deleted, dict):
+ _dict['deleted'] = self.deleted
+ else:
+ _dict['deleted'] = self.deleted.to_dict()
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
+ if hasattr(self, 'id') and self.id is not None:
+ _dict['id'] = self.id
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ if hasattr(self, 'resource_type') and self.resource_type is not None:
+ _dict['resource_type'] = self.resource_type
+ return _dict
+
+ def _to_dict(self):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
+
+ def __str__(self) -> str:
+ """Return a `str` version of this SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+ class ResourceTypeEnum(str, Enum):
+ """
+ The resource type.
+ """
+
+ NETWORK_INTERFACE = 'network_interface'
+
+
+
+class SecurityGroupTargetReferenceVPNServerReference(SecurityGroupTargetReference):
+ """
+ SecurityGroupTargetReferenceVPNServerReference.
+
+ :param str crn: The CRN for this VPN server.
+ :param VPNServerReferenceDeleted 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 VPN server.
+ :param str id: The unique identifier for this VPN server.
+ :param str name: The name for this VPN server. The name is unique across all VPN
+ servers in the VPC.
+ :param str resource_type: The resource type.
+ """
+
+ def __init__(
+ self,
+ crn: str,
+ href: str,
+ id: str,
+ name: str,
+ resource_type: str,
+ *,
+ deleted: Optional['VPNServerReferenceDeleted'] = None,
+ ) -> None:
+ """
+ Initialize a SecurityGroupTargetReferenceVPNServerReference object.
+
+ :param str crn: The CRN for this VPN server.
+ :param str href: The URL for this VPN server.
+ :param str id: The unique identifier for this VPN server.
+ :param str name: The name for this VPN server. The name is unique across
+ all VPN servers in the VPC.
+ :param str resource_type: The resource type.
+ :param VPNServerReferenceDeleted deleted: (optional) If present, this
+ property indicates the referenced resource has been deleted, and provides
+ some supplementary information.
+ """
+ # 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) -> 'SecurityGroupTargetReferenceVPNServerReference':
+ """Initialize a SecurityGroupTargetReferenceVPNServerReference object from a json dictionary."""
+ args = {}
+ if (crn := _dict.get('crn')) is not None:
+ args['crn'] = crn
+ else:
+ raise ValueError('Required property \'crn\' not present in SecurityGroupTargetReferenceVPNServerReference JSON')
+ if (deleted := _dict.get('deleted')) is not None:
+ args['deleted'] = VPNServerReferenceDeleted.from_dict(deleted)
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
+ else:
+ raise ValueError('Required property \'href\' not present in SecurityGroupTargetReferenceVPNServerReference JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
+ else:
+ raise ValueError('Required property \'id\' not present in SecurityGroupTargetReferenceVPNServerReference JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ else:
+ raise ValueError('Required property \'name\' not present in SecurityGroupTargetReferenceVPNServerReference JSON')
+ if (resource_type := _dict.get('resource_type')) is not None:
+ args['resource_type'] = resource_type
+ else:
+ raise ValueError('Required property \'resource_type\' not present in SecurityGroupTargetReferenceVPNServerReference JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a SecurityGroupTargetReferenceVPNServerReference object from a json dictionary."""
+ return cls.from_dict(_dict)
+
+ def to_dict(self) -> Dict:
+ """Return a json dictionary representing this model."""
+ _dict = {}
+ if hasattr(self, 'crn') and self.crn is not None:
+ _dict['crn'] = self.crn
+ if hasattr(self, 'deleted') and self.deleted is not None:
+ if isinstance(self.deleted, dict):
+ _dict['deleted'] = self.deleted
+ else:
+ _dict['deleted'] = self.deleted.to_dict()
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
+ if hasattr(self, 'id') and self.id is not None:
+ _dict['id'] = self.id
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ if hasattr(self, 'resource_type') and self.resource_type is not None:
+ _dict['resource_type'] = self.resource_type
+ return _dict
+
+ def _to_dict(self):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
+
+ def __str__(self) -> str:
+ """Return a `str` version of this SecurityGroupTargetReferenceVPNServerReference object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'SecurityGroupTargetReferenceVPNServerReference') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'SecurityGroupTargetReferenceVPNServerReference') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+ class ResourceTypeEnum(str, Enum):
+ """
+ The resource type.
+ """
+
+ VPN_SERVER = 'vpn_server'
+
+
+
+class SecurityGroupTargetReferenceVirtualNetworkInterfaceReference(SecurityGroupTargetReference):
+ """
+ SecurityGroupTargetReferenceVirtualNetworkInterfaceReference.
+
+ :param str crn: The CRN for this virtual network interface.
+ :param VirtualNetworkInterfaceReferenceDeleted 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 virtual network interface.
+ :param str id: The unique identifier for this virtual network interface.
+ :param str name: The name for this virtual network interface. The name is unique
+ across all virtual network interfaces in the VPC.
+ :param ReservedIPReference primary_ip: The primary IP for this virtual network
+ interface.
+ :param str resource_type: The resource type.
+ :param SubnetReference subnet: The associated subnet.
+ """
+
+ def __init__(
+ self,
+ crn: str,
+ href: str,
+ id: str,
+ name: str,
+ primary_ip: 'ReservedIPReference',
+ resource_type: str,
+ subnet: 'SubnetReference',
+ *,
+ deleted: Optional['VirtualNetworkInterfaceReferenceDeleted'] = None,
+ ) -> None:
+ """
+ Initialize a SecurityGroupTargetReferenceVirtualNetworkInterfaceReference object.
+
+ :param str crn: The CRN for this virtual network interface.
+ :param str href: The URL for this virtual network interface.
+ :param str id: The unique identifier for this virtual network interface.
+ :param str name: The name for this virtual network interface. The name is
+ unique across all virtual network interfaces in the VPC.
+ :param ReservedIPReference primary_ip: The primary IP for this virtual
+ network interface.
+ :param str resource_type: The resource type.
+ :param SubnetReference subnet: The associated subnet.
+ :param VirtualNetworkInterfaceReferenceDeleted deleted: (optional) If
+ present, this property indicates the referenced resource has been deleted,
+ and provides
+ some supplementary information.
+ """
+ # pylint: disable=super-init-not-called
+ self.crn = crn
+ self.deleted = deleted
+ self.href = href
+ self.id = id
+ self.name = name
+ self.primary_ip = primary_ip
+ self.resource_type = resource_type
+ self.subnet = subnet
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'SecurityGroupTargetReferenceVirtualNetworkInterfaceReference':
+ """Initialize a SecurityGroupTargetReferenceVirtualNetworkInterfaceReference object from a json dictionary."""
+ args = {}
+ if (crn := _dict.get('crn')) is not None:
+ args['crn'] = crn
+ else:
+ raise ValueError('Required property \'crn\' not present in SecurityGroupTargetReferenceVirtualNetworkInterfaceReference JSON')
+ if (deleted := _dict.get('deleted')) is not None:
+ args['deleted'] = VirtualNetworkInterfaceReferenceDeleted.from_dict(deleted)
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
+ else:
+ raise ValueError('Required property \'href\' not present in SecurityGroupTargetReferenceVirtualNetworkInterfaceReference JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
+ else:
+ raise ValueError('Required property \'id\' not present in SecurityGroupTargetReferenceVirtualNetworkInterfaceReference JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ else:
+ raise ValueError('Required property \'name\' not present in SecurityGroupTargetReferenceVirtualNetworkInterfaceReference JSON')
+ if (primary_ip := _dict.get('primary_ip')) is not None:
+ args['primary_ip'] = ReservedIPReference.from_dict(primary_ip)
+ else:
+ raise ValueError('Required property \'primary_ip\' not present in SecurityGroupTargetReferenceVirtualNetworkInterfaceReference JSON')
+ if (resource_type := _dict.get('resource_type')) is not None:
+ args['resource_type'] = resource_type
+ else:
+ raise ValueError('Required property \'resource_type\' not present in SecurityGroupTargetReferenceVirtualNetworkInterfaceReference JSON')
+ if (subnet := _dict.get('subnet')) is not None:
+ args['subnet'] = SubnetReference.from_dict(subnet)
+ else:
+ raise ValueError('Required property \'subnet\' not present in SecurityGroupTargetReferenceVirtualNetworkInterfaceReference JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a SecurityGroupTargetReferenceVirtualNetworkInterfaceReference object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
+ if hasattr(self, 'crn') and self.crn is not None:
+ _dict['crn'] = self.crn
if hasattr(self, 'deleted') and self.deleted is not None:
if isinstance(self.deleted, dict):
_dict['deleted'] = self.deleted
@@ -111712,10 +127415,208 @@ 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, 'resource_type') and self.resource_type is not None:
- _dict['resource_type'] = self.resource_type
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ if hasattr(self, 'primary_ip') and self.primary_ip is not None:
+ if isinstance(self.primary_ip, dict):
+ _dict['primary_ip'] = self.primary_ip
+ else:
+ _dict['primary_ip'] = self.primary_ip.to_dict()
+ if hasattr(self, 'resource_type') and self.resource_type is not None:
+ _dict['resource_type'] = self.resource_type
+ if hasattr(self, 'subnet') and self.subnet is not None:
+ if isinstance(self.subnet, dict):
+ _dict['subnet'] = self.subnet
+ else:
+ _dict['subnet'] = self.subnet.to_dict()
+ return _dict
+
+ def _to_dict(self):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
+
+ def __str__(self) -> str:
+ """Return a `str` version of this SecurityGroupTargetReferenceVirtualNetworkInterfaceReference object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'SecurityGroupTargetReferenceVirtualNetworkInterfaceReference') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'SecurityGroupTargetReferenceVirtualNetworkInterfaceReference') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+ class ResourceTypeEnum(str, Enum):
+ """
+ The resource type.
+ """
+
+ VIRTUAL_NETWORK_INTERFACE = 'virtual_network_interface'
+
+
+
+class ShareIdentityByCRN(ShareIdentity):
+ """
+ ShareIdentityByCRN.
+
+ :param str crn: The CRN for this file share.
+ """
+
+ def __init__(
+ self,
+ crn: str,
+ ) -> None:
+ """
+ Initialize a ShareIdentityByCRN object.
+
+ :param str crn: The CRN for this file share.
+ """
+ # pylint: disable=super-init-not-called
+ self.crn = crn
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'ShareIdentityByCRN':
+ """Initialize a ShareIdentityByCRN object from a json dictionary."""
+ args = {}
+ if (crn := _dict.get('crn')) is not None:
+ args['crn'] = crn
+ else:
+ raise ValueError('Required property \'crn\' not present in ShareIdentityByCRN JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a ShareIdentityByCRN object from a json dictionary."""
+ return cls.from_dict(_dict)
+
+ def to_dict(self) -> Dict:
+ """Return a json dictionary representing this model."""
+ _dict = {}
+ if hasattr(self, '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 ShareIdentityByCRN object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'ShareIdentityByCRN') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'ShareIdentityByCRN') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+
+class ShareIdentityByHref(ShareIdentity):
+ """
+ ShareIdentityByHref.
+
+ :param str href: The URL for this file share.
+ """
+
+ def __init__(
+ self,
+ href: str,
+ ) -> None:
+ """
+ Initialize a ShareIdentityByHref object.
+
+ :param str href: The URL for this file share.
+ """
+ # pylint: disable=super-init-not-called
+ self.href = href
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'ShareIdentityByHref':
+ """Initialize a ShareIdentityByHref object from a json dictionary."""
+ args = {}
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
+ else:
+ raise ValueError('Required property \'href\' not present in ShareIdentityByHref JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a ShareIdentityByHref object from a json dictionary."""
+ return cls.from_dict(_dict)
+
+ def to_dict(self) -> Dict:
+ """Return a json dictionary representing this model."""
+ _dict = {}
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
+ return _dict
+
+ def _to_dict(self):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
+
+ def __str__(self) -> str:
+ """Return a `str` version of this ShareIdentityByHref object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'ShareIdentityByHref') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'ShareIdentityByHref') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+
+class ShareIdentityById(ShareIdentity):
+ """
+ ShareIdentityById.
+
+ :param str id: The unique identifier for this file share.
+ """
+
+ def __init__(
+ self,
+ id: str,
+ ) -> None:
+ """
+ Initialize a ShareIdentityById object.
+
+ :param str id: The unique identifier for this file share.
+ """
+ # pylint: disable=super-init-not-called
+ self.id = id
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'ShareIdentityById':
+ """Initialize a ShareIdentityById object from a json dictionary."""
+ args = {}
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
+ else:
+ raise ValueError('Required property \'id\' not present in ShareIdentityById JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a ShareIdentityById object from a json dictionary."""
+ return cls.from_dict(_dict)
+
+ def to_dict(self) -> Dict:
+ """Return a json dictionary representing this model."""
+ _dict = {}
+ if hasattr(self, 'id') and self.id is not None:
+ _dict['id'] = self.id
return _dict
def _to_dict(self):
@@ -111723,125 +127624,102 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this ReservedIPTargetNetworkInterfaceReferenceTargetContext object."""
+ """Return a `str` version of this ShareIdentityById object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'ReservedIPTargetNetworkInterfaceReferenceTargetContext') -> bool:
+ def __eq__(self, other: 'ShareIdentityById') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'ReservedIPTargetNetworkInterfaceReferenceTargetContext') -> bool:
+ def __ne__(self, other: 'ShareIdentityById') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class ResourceTypeEnum(str, Enum):
- """
- The resource type.
- """
-
- NETWORK_INTERFACE = 'network_interface'
-
-
-class ReservedIPTargetVPNGatewayReference(ReservedIPTarget):
+class ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup(ShareMountTargetPrototype):
"""
- ReservedIPTargetVPNGatewayReference.
+ The virtual network interface for this share mount target. The virtual network
+ interface must:
+ - have `allow_ip_spoofing` set to `false`
+ - have `enable_infrastructure_nat` set to `true`
+ - not be in the same VPC as an existing mount target for this share
+ - not have `ips` other than the `primary_ip` address
+ If an existing virtual network interface is specified, it must not have a floating IP
+ bound to it, and it must not be the target of a flow log collector.
+ Required if the share's `access_control_mode` is `security_group`.
- :attr str crn: The VPN gateway's CRN.
- :attr VPNGatewayReferenceDeleted deleted: (optional) If present, this property
- indicates the referenced resource has been deleted, and provides
- some supplementary information.
- :attr str href: The VPN gateway's canonical URL.
- :attr str id: The unique identifier for this VPN gateway.
- :attr str name: The name for this VPN gateway. The name is unique across all VPN
- gateways in the VPC.
- :attr str resource_type: The resource type.
+ :param str name: (optional) The name for this share mount target. The name must
+ not be used by another mount target for the file share.
+ :param str transit_encryption: (optional) The transit encryption mode to use for
+ this share mount target:
+ - `none`: Not encrypted in transit.
+ - `user_managed`: Encrypted in transit using an instance identity certificate.
+ The
+ `access_control_mode` for the share must be `security_group`.
+ :param ShareMountTargetVirtualNetworkInterfacePrototype
+ virtual_network_interface:
"""
def __init__(
self,
- crn: str,
- href: str,
- id: str,
- name: str,
- resource_type: str,
+ virtual_network_interface: 'ShareMountTargetVirtualNetworkInterfacePrototype',
*,
- deleted: 'VPNGatewayReferenceDeleted' = None,
+ name: Optional[str] = None,
+ transit_encryption: Optional[str] = None,
) -> None:
"""
- Initialize a ReservedIPTargetVPNGatewayReference object.
+ Initialize a ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup object.
- :param str crn: The VPN gateway's CRN.
- :param str href: The VPN gateway's canonical URL.
- :param str id: The unique identifier for this VPN gateway.
- :param str name: The name for this VPN gateway. The name is unique across
- all VPN gateways in the VPC.
- :param str resource_type: The resource type.
- :param VPNGatewayReferenceDeleted deleted: (optional) If present, this
- property indicates the referenced resource has been deleted, and provides
- some supplementary information.
+ :param ShareMountTargetVirtualNetworkInterfacePrototype
+ virtual_network_interface:
+ :param str name: (optional) The name for this share mount target. The name
+ must not be used by another mount target for the file share.
+ :param str transit_encryption: (optional) The transit encryption mode to
+ use for this share mount target:
+ - `none`: Not encrypted in transit.
+ - `user_managed`: Encrypted in transit using an instance identity
+ certificate. The
+ `access_control_mode` for the share must be
+ `security_group`.
"""
# pylint: disable=super-init-not-called
- self.crn = crn
- self.deleted = deleted
- self.href = href
- self.id = id
self.name = name
- self.resource_type = resource_type
+ self.transit_encryption = transit_encryption
+ self.virtual_network_interface = virtual_network_interface
@classmethod
- def from_dict(cls, _dict: Dict) -> 'ReservedIPTargetVPNGatewayReference':
- """Initialize a ReservedIPTargetVPNGatewayReference object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup':
+ """Initialize a ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup object from a json dictionary."""
args = {}
- if 'crn' in _dict:
- args['crn'] = _dict.get('crn')
- else:
- raise ValueError('Required property \'crn\' not present in ReservedIPTargetVPNGatewayReference JSON')
- if 'deleted' in _dict:
- args['deleted'] = VPNGatewayReferenceDeleted.from_dict(_dict.get('deleted'))
- if 'href' in _dict:
- args['href'] = _dict.get('href')
- else:
- raise ValueError('Required property \'href\' not present in ReservedIPTargetVPNGatewayReference JSON')
- if 'id' in _dict:
- args['id'] = _dict.get('id')
- else:
- raise ValueError('Required property \'id\' not present in ReservedIPTargetVPNGatewayReference JSON')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
- else:
- raise ValueError('Required property \'name\' not present in ReservedIPTargetVPNGatewayReference JSON')
- if 'resource_type' in _dict:
- args['resource_type'] = _dict.get('resource_type')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ if (transit_encryption := _dict.get('transit_encryption')) is not None:
+ args['transit_encryption'] = transit_encryption
+ if (virtual_network_interface := _dict.get('virtual_network_interface')) is not None:
+ args['virtual_network_interface'] = virtual_network_interface
else:
- raise ValueError('Required property \'resource_type\' not present in ReservedIPTargetVPNGatewayReference JSON')
+ raise ValueError('Required property \'virtual_network_interface\' not present in ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a ReservedIPTargetVPNGatewayReference object from a json dictionary."""
+ """Initialize a ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'crn') and self.crn is not None:
- _dict['crn'] = self.crn
- if hasattr(self, 'deleted') and self.deleted is not None:
- if isinstance(self.deleted, dict):
- _dict['deleted'] = self.deleted
- else:
- _dict['deleted'] = self.deleted.to_dict()
- if hasattr(self, 'href') and self.href is not None:
- _dict['href'] = self.href
- if hasattr(self, 'id') and self.id is not None:
- _dict['id'] = self.id
if hasattr(self, 'name') and self.name is not None:
_dict['name'] = self.name
- if hasattr(self, 'resource_type') and self.resource_type is not None:
- _dict['resource_type'] = self.resource_type
+ if hasattr(self, 'transit_encryption') and self.transit_encryption is not None:
+ _dict['transit_encryption'] = self.transit_encryption
+ if hasattr(self, 'virtual_network_interface') and self.virtual_network_interface is not None:
+ if isinstance(self.virtual_network_interface, dict):
+ _dict['virtual_network_interface'] = self.virtual_network_interface
+ else:
+ _dict['virtual_network_interface'] = self.virtual_network_interface.to_dict()
return _dict
def _to_dict(self):
@@ -111849,125 +127727,107 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this ReservedIPTargetVPNGatewayReference object."""
+ """Return a `str` version of this ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'ReservedIPTargetVPNGatewayReference') -> bool:
+ def __eq__(self, other: 'ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'ReservedIPTargetVPNGatewayReference') -> bool:
+ def __ne__(self, other: 'ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class ResourceTypeEnum(str, Enum):
+ class TransitEncryptionEnum(str, Enum):
"""
- The resource type.
+ The transit encryption mode to use for this share mount target:
+ - `none`: Not encrypted in transit.
+ - `user_managed`: Encrypted in transit using an instance identity certificate.
+ The
+ `access_control_mode` for the share must be `security_group`.
"""
- VPN_GATEWAY = 'vpn_gateway'
+ NONE = 'none'
+ USER_MANAGED = 'user_managed'
-class ReservedIPTargetVPNServerReference(ReservedIPTarget):
+class ShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC(ShareMountTargetPrototype):
"""
- ReservedIPTargetVPNServerReference.
+ The VPC in which clients can mount the file share using this mount target. The VPC
+ must not be used by another mount target for this share.
+ Required if the share's `access_control_mode` is `vpc`.
- :attr str crn: The CRN for this VPN server.
- :attr VPNServerReferenceDeleted deleted: (optional) If present, this property
- indicates the referenced resource has been deleted, and provides
- some supplementary information.
- :attr str href: The URL for this VPN server.
- :attr str id: The unique identifier for this VPN server.
- :attr str name: The name for this VPN server. The name is unique across all VPN
- servers in the VPC.
- :attr str resource_type: The resource type.
+ :param str name: (optional) The name for this share mount target. The name must
+ not be used by another mount target for the file share.
+ :param str transit_encryption: (optional) The transit encryption mode to use for
+ this share mount target:
+ - `none`: Not encrypted in transit.
+ - `user_managed`: Encrypted in transit using an instance identity certificate.
+ The
+ `access_control_mode` for the share must be `security_group`.
+ :param VPCIdentity vpc: Identifies a VPC by a unique property.
"""
def __init__(
self,
- crn: str,
- href: str,
- id: str,
- name: str,
- resource_type: str,
+ vpc: 'VPCIdentity',
*,
- deleted: 'VPNServerReferenceDeleted' = None,
+ name: Optional[str] = None,
+ transit_encryption: Optional[str] = None,
) -> None:
"""
- Initialize a ReservedIPTargetVPNServerReference object.
+ Initialize a ShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC object.
- :param str crn: The CRN for this VPN server.
- :param str href: The URL for this VPN server.
- :param str id: The unique identifier for this VPN server.
- :param str name: The name for this VPN server. The name is unique across
- all VPN servers in the VPC.
- :param str resource_type: The resource type.
- :param VPNServerReferenceDeleted deleted: (optional) If present, this
- property indicates the referenced resource has been deleted, and provides
- some supplementary information.
+ :param VPCIdentity vpc: Identifies a VPC by a unique property.
+ :param str name: (optional) The name for this share mount target. The name
+ must not be used by another mount target for the file share.
+ :param str transit_encryption: (optional) The transit encryption mode to
+ use for this share mount target:
+ - `none`: Not encrypted in transit.
+ - `user_managed`: Encrypted in transit using an instance identity
+ certificate. The
+ `access_control_mode` for the share must be
+ `security_group`.
"""
# pylint: disable=super-init-not-called
- self.crn = crn
- self.deleted = deleted
- self.href = href
- self.id = id
self.name = name
- self.resource_type = resource_type
+ self.transit_encryption = transit_encryption
+ self.vpc = vpc
@classmethod
- def from_dict(cls, _dict: Dict) -> 'ReservedIPTargetVPNServerReference':
- """Initialize a ReservedIPTargetVPNServerReference object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'ShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC':
+ """Initialize a ShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC object from a json dictionary."""
args = {}
- if 'crn' in _dict:
- args['crn'] = _dict.get('crn')
- else:
- raise ValueError('Required property \'crn\' not present in ReservedIPTargetVPNServerReference JSON')
- if 'deleted' in _dict:
- args['deleted'] = VPNServerReferenceDeleted.from_dict(_dict.get('deleted'))
- if 'href' in _dict:
- args['href'] = _dict.get('href')
- else:
- raise ValueError('Required property \'href\' not present in ReservedIPTargetVPNServerReference JSON')
- if 'id' in _dict:
- args['id'] = _dict.get('id')
- else:
- raise ValueError('Required property \'id\' not present in ReservedIPTargetVPNServerReference JSON')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
- else:
- raise ValueError('Required property \'name\' not present in ReservedIPTargetVPNServerReference JSON')
- if 'resource_type' in _dict:
- args['resource_type'] = _dict.get('resource_type')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ if (transit_encryption := _dict.get('transit_encryption')) is not None:
+ args['transit_encryption'] = transit_encryption
+ if (vpc := _dict.get('vpc')) is not None:
+ args['vpc'] = vpc
else:
- raise ValueError('Required property \'resource_type\' not present in ReservedIPTargetVPNServerReference JSON')
+ raise ValueError('Required property \'vpc\' not present in ShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a ReservedIPTargetVPNServerReference object from a json dictionary."""
+ """Initialize a ShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'crn') and self.crn is not None:
- _dict['crn'] = self.crn
- if hasattr(self, 'deleted') and self.deleted is not None:
- if isinstance(self.deleted, dict):
- _dict['deleted'] = self.deleted
- else:
- _dict['deleted'] = self.deleted.to_dict()
- if hasattr(self, 'href') and self.href is not None:
- _dict['href'] = self.href
- if hasattr(self, 'id') and self.id is not None:
- _dict['id'] = self.id
if hasattr(self, 'name') and self.name is not None:
_dict['name'] = self.name
- if hasattr(self, 'resource_type') and self.resource_type is not None:
- _dict['resource_type'] = self.resource_type
+ if hasattr(self, 'transit_encryption') and self.transit_encryption is not None:
+ _dict['transit_encryption'] = self.transit_encryption
+ if hasattr(self, 'vpc') and self.vpc is not None:
+ if isinstance(self.vpc, dict):
+ _dict['vpc'] = self.vpc
+ else:
+ _dict['vpc'] = self.vpc.to_dict()
return _dict
def _to_dict(self):
@@ -111975,109 +127835,263 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this ReservedIPTargetVPNServerReference object."""
+ """Return a `str` version of this ShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'ReservedIPTargetVPNServerReference') -> bool:
+ def __eq__(self, other: 'ShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'ReservedIPTargetVPNServerReference') -> bool:
+ def __ne__(self, other: 'ShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class ResourceTypeEnum(str, Enum):
+ class TransitEncryptionEnum(str, Enum):
"""
- The resource type.
+ The transit encryption mode to use for this share mount target:
+ - `none`: Not encrypted in transit.
+ - `user_managed`: Encrypted in transit using an instance identity certificate.
+ The
+ `access_control_mode` for the share must be `security_group`.
"""
- VPN_SERVER = 'vpn_server'
+ NONE = 'none'
+ USER_MANAGED = 'user_managed'
-class ReservedIPTargetVirtualNetworkInterfaceReferenceReservedIPTargetContext(ReservedIPTarget):
+class ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentity(ShareMountTargetVirtualNetworkInterfacePrototype):
"""
- ReservedIPTargetVirtualNetworkInterfaceReferenceReservedIPTargetContext.
+ Identifies a virtual network interface by a unique property.
- :attr str crn: The CRN for this virtual network interface.
- :attr str href: The URL for this virtual network interface.
- :attr str id: The unique identifier for this virtual network interface.
- :attr str name: The name for this virtual network interface. The name is unique
- across all virtual network interfaces in the VPC.
- :attr str resource_type: The resource type.
"""
def __init__(
self,
- crn: str,
- href: str,
- id: str,
- name: str,
- resource_type: str,
) -> None:
"""
- Initialize a ReservedIPTargetVirtualNetworkInterfaceReferenceReservedIPTargetContext object.
+ Initialize a ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentity object.
- :param str crn: The CRN for this virtual network interface.
- :param str href: The URL for this virtual network interface.
- :param str id: The unique identifier for this virtual network interface.
- :param str name: The name for this virtual network interface. The name is
- unique across all virtual network interfaces in the VPC.
- :param str resource_type: The resource type.
"""
# pylint: disable=super-init-not-called
- self.crn = crn
- self.href = href
- self.id = id
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById', 'ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref', 'ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN'])
+ )
+ raise Exception(msg)
+
+
+class ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfacePrototypeShareMountTargetContext(ShareMountTargetVirtualNetworkInterfacePrototype):
+ """
+ The virtual network interface for this target.
+
+ :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 auto_delete: (optional) Indicates whether this virtual network
+ interface will be automatically deleted when
+ `target` is deleted.
+ :param bool enable_infrastructure_nat: (optional) If `true`:
+ - The VPC infrastructure performs any needed NAT operations.
+ - `floating_ips` must not have more than one floating IP.
+ If `false`:
+ - Packets are passed unchanged to/from the virtual network interface,
+ allowing the workload to perform any needed NAT operations.
+ - `allow_ip_spoofing` must be `false`.
+ - Can only be attached to a `target` with a `resource_type` of
+ `bare_metal_server_network_attachment`.
+ :param List[VirtualNetworkInterfaceIPPrototype] ips: (optional) Additional IP
+ addresses to bind to the virtual network interface. Each item may be either a
+ reserved IP identity, or a reserved IP prototype object which will be used to
+ create a new reserved IP. All IP addresses must be in the primary IP's subnet.
+ If reserved IP identities are provided, the specified reserved IPs must be
+ unbound.
+ If reserved IP prototype objects with addresses are provided, the addresses must
+ be available on the virtual network interface's subnet. For any prototype
+ objects that do not specify an address, an available address on the subnet will
+ be automatically selected and reserved.
+ :param str name: (optional) The name for this virtual network interface. The
+ name must not be used by another virtual network interface in the VPC. If
+ unspecified, the name will be a hyphenated list of randomly-selected words.
+ Names beginning with `ibm-` are reserved for provider-owned resources, and are
+ not allowed.
+ :param VirtualNetworkInterfacePrimaryIPPrototype primary_ip: (optional) The
+ primary IP address to bind to the virtual network interface. May be either a
+ reserved IP identity, or a reserved IP prototype object which will be used to
+ create a
+ new reserved IP.
+ If a reserved IP identity is provided, the specified reserved IP must be
+ unbound.
+ If a reserved IP prototype object with an address is provided, the address must
+ be
+ available on the virtual network interface's subnet. If no address is specified,
+ an available address on the subnet will be automatically selected and reserved.
+ :param ResourceGroupIdentity resource_group: (optional) The resource group to
+ use for this virtual network interface. If unspecified, the
+ share's resource group will be used.
+ :param List[SecurityGroupIdentity] security_groups: (optional) The security
+ groups to use for this virtual network interface. If unspecified, the default
+ security group of the VPC for the subnet is used.
+ :param SubnetIdentity subnet: (optional) The associated subnet. Required if
+ `primary_ip` does not specify a reserved IP
+ identity.
+ """
+
+ def __init__(
+ self,
+ *,
+ allow_ip_spoofing: Optional[bool] = None,
+ auto_delete: Optional[bool] = None,
+ enable_infrastructure_nat: Optional[bool] = None,
+ ips: Optional[List['VirtualNetworkInterfaceIPPrototype']] = None,
+ name: Optional[str] = None,
+ primary_ip: Optional['VirtualNetworkInterfacePrimaryIPPrototype'] = None,
+ resource_group: Optional['ResourceGroupIdentity'] = None,
+ security_groups: Optional[List['SecurityGroupIdentity']] = None,
+ subnet: Optional['SubnetIdentity'] = None,
+ ) -> None:
+ """
+ Initialize a ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfacePrototypeShareMountTargetContext 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 bool auto_delete: (optional) Indicates whether this virtual network
+ interface will be automatically deleted when
+ `target` is deleted.
+ :param bool enable_infrastructure_nat: (optional) If `true`:
+ - The VPC infrastructure performs any needed NAT operations.
+ - `floating_ips` must not have more than one floating IP.
+ If `false`:
+ - Packets are passed unchanged to/from the virtual network interface,
+ allowing the workload to perform any needed NAT operations.
+ - `allow_ip_spoofing` must be `false`.
+ - Can only be attached to a `target` with a `resource_type` of
+ `bare_metal_server_network_attachment`.
+ :param List[VirtualNetworkInterfaceIPPrototype] ips: (optional) Additional
+ IP addresses to bind to the virtual network interface. Each item may be
+ either a reserved IP identity, or a reserved IP prototype object which will
+ be used to create a new reserved IP. All IP addresses must be in the
+ primary IP's subnet.
+ If reserved IP identities are provided, the specified reserved IPs must be
+ unbound.
+ If reserved IP prototype objects with addresses are provided, the addresses
+ must be available on the virtual network interface's subnet. For any
+ prototype objects that do not specify an address, an available address on
+ the subnet will be automatically selected and reserved.
+ :param str name: (optional) The name for this virtual network interface.
+ The name must not be used by another virtual network interface in the VPC.
+ If unspecified, the name will be a hyphenated list of randomly-selected
+ words. Names beginning with `ibm-` are reserved for provider-owned
+ resources, and are not allowed.
+ :param VirtualNetworkInterfacePrimaryIPPrototype primary_ip: (optional) The
+ primary IP address to bind to the virtual network interface. May be either
+ a
+ reserved IP identity, or a reserved IP prototype object which will be used
+ to create a
+ new reserved IP.
+ If a reserved IP identity is provided, the specified reserved IP must be
+ unbound.
+ If a reserved IP prototype object with an address is provided, the address
+ must be
+ available on the virtual network interface's subnet. If no address is
+ specified,
+ an available address on the subnet will be automatically selected and
+ reserved.
+ :param ResourceGroupIdentity resource_group: (optional) The resource group
+ to use for this virtual network interface. If unspecified, the
+ share's resource group will be used.
+ :param List[SecurityGroupIdentity] security_groups: (optional) The security
+ groups to use for this virtual network interface. If unspecified, the
+ default security group of the VPC for the subnet is used.
+ :param SubnetIdentity subnet: (optional) The associated subnet. Required if
+ `primary_ip` does not specify a reserved IP
+ identity.
+ """
+ # pylint: disable=super-init-not-called
+ self.allow_ip_spoofing = allow_ip_spoofing
+ self.auto_delete = auto_delete
+ self.enable_infrastructure_nat = enable_infrastructure_nat
+ self.ips = ips
self.name = name
- self.resource_type = resource_type
+ self.primary_ip = primary_ip
+ self.resource_group = resource_group
+ self.security_groups = security_groups
+ self.subnet = subnet
@classmethod
- def from_dict(cls, _dict: Dict) -> 'ReservedIPTargetVirtualNetworkInterfaceReferenceReservedIPTargetContext':
- """Initialize a ReservedIPTargetVirtualNetworkInterfaceReferenceReservedIPTargetContext object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfacePrototypeShareMountTargetContext':
+ """Initialize a ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfacePrototypeShareMountTargetContext object from a json dictionary."""
args = {}
- if 'crn' in _dict:
- args['crn'] = _dict.get('crn')
- else:
- raise ValueError('Required property \'crn\' not present in ReservedIPTargetVirtualNetworkInterfaceReferenceReservedIPTargetContext JSON')
- if 'href' in _dict:
- args['href'] = _dict.get('href')
- else:
- raise ValueError('Required property \'href\' not present in ReservedIPTargetVirtualNetworkInterfaceReferenceReservedIPTargetContext JSON')
- if 'id' in _dict:
- args['id'] = _dict.get('id')
- else:
- raise ValueError('Required property \'id\' not present in ReservedIPTargetVirtualNetworkInterfaceReferenceReservedIPTargetContext JSON')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
- else:
- raise ValueError('Required property \'name\' not present in ReservedIPTargetVirtualNetworkInterfaceReferenceReservedIPTargetContext JSON')
- if 'resource_type' in _dict:
- args['resource_type'] = _dict.get('resource_type')
- else:
- raise ValueError('Required property \'resource_type\' not present in ReservedIPTargetVirtualNetworkInterfaceReferenceReservedIPTargetContext JSON')
+ if (allow_ip_spoofing := _dict.get('allow_ip_spoofing')) is not None:
+ args['allow_ip_spoofing'] = allow_ip_spoofing
+ if (auto_delete := _dict.get('auto_delete')) is not None:
+ args['auto_delete'] = auto_delete
+ if (enable_infrastructure_nat := _dict.get('enable_infrastructure_nat')) is not None:
+ args['enable_infrastructure_nat'] = enable_infrastructure_nat
+ if (ips := _dict.get('ips')) is not None:
+ args['ips'] = ips
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ if (primary_ip := _dict.get('primary_ip')) is not None:
+ args['primary_ip'] = primary_ip
+ if (resource_group := _dict.get('resource_group')) is not None:
+ args['resource_group'] = resource_group
+ if (security_groups := _dict.get('security_groups')) is not None:
+ args['security_groups'] = security_groups
+ if (subnet := _dict.get('subnet')) is not None:
+ args['subnet'] = subnet
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a ReservedIPTargetVirtualNetworkInterfaceReferenceReservedIPTargetContext object from a json dictionary."""
+ """Initialize a ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfacePrototypeShareMountTargetContext object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, '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, 'allow_ip_spoofing') and self.allow_ip_spoofing is not None:
+ _dict['allow_ip_spoofing'] = self.allow_ip_spoofing
+ if hasattr(self, 'auto_delete') and self.auto_delete is not None:
+ _dict['auto_delete'] = self.auto_delete
+ 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, 'ips') and self.ips is not None:
+ ips_list = []
+ for v in self.ips:
+ if isinstance(v, dict):
+ ips_list.append(v)
+ else:
+ ips_list.append(v.to_dict())
+ _dict['ips'] = ips_list
if hasattr(self, 'name') and self.name is not None:
_dict['name'] = self.name
- if hasattr(self, 'resource_type') and self.resource_type is not None:
- _dict['resource_type'] = self.resource_type
+ if hasattr(self, 'primary_ip') and self.primary_ip is not None:
+ if isinstance(self.primary_ip, dict):
+ _dict['primary_ip'] = self.primary_ip
+ else:
+ _dict['primary_ip'] = self.primary_ip.to_dict()
+ if hasattr(self, 'resource_group') and self.resource_group is not None:
+ if isinstance(self.resource_group, dict):
+ _dict['resource_group'] = self.resource_group
+ else:
+ _dict['resource_group'] = self.resource_group.to_dict()
+ if hasattr(self, 'security_groups') and self.security_groups is not None:
+ security_groups_list = []
+ for v in self.security_groups:
+ if isinstance(v, dict):
+ security_groups_list.append(v)
+ else:
+ security_groups_list.append(v.to_dict())
+ _dict['security_groups'] = security_groups_list
+ if hasattr(self, 'subnet') and self.subnet is not None:
+ if isinstance(self.subnet, dict):
+ _dict['subnet'] = self.subnet
+ else:
+ _dict['subnet'] = self.subnet.to_dict()
return _dict
def _to_dict(self):
@@ -112085,67 +128099,90 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this ReservedIPTargetVirtualNetworkInterfaceReferenceReservedIPTargetContext object."""
+ """Return a `str` version of this ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfacePrototypeShareMountTargetContext object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'ReservedIPTargetVirtualNetworkInterfaceReferenceReservedIPTargetContext') -> bool:
+ def __eq__(self, other: 'ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfacePrototypeShareMountTargetContext') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'ReservedIPTargetVirtualNetworkInterfaceReferenceReservedIPTargetContext') -> bool:
+ def __ne__(self, other: 'ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfacePrototypeShareMountTargetContext') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class ResourceTypeEnum(str, Enum):
- """
- The resource type.
- """
-
- VIRTUAL_NETWORK_INTERFACE = 'virtual_network_interface'
-
-
-class ResourceGroupIdentityById(ResourceGroupIdentity):
+class ShareProfileCapacityDependentRange(ShareProfileCapacity):
"""
- ResourceGroupIdentityById.
+ The permitted total capacity (in gigabytes) of a share with this profile depends on
+ its configuration.
- :attr str id: The unique identifier for this resource group.
+ :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.
"""
def __init__(
self,
- id: str,
+ max: int,
+ min: int,
+ step: int,
+ type: str,
) -> None:
"""
- Initialize a ResourceGroupIdentityById object.
+ Initialize a ShareProfileCapacityDependentRange object.
- :param str id: The unique identifier for this resource group.
+ :param int max: The maximum value for this profile field.
+ :param int min: The minimum value for this profile field.
+ :param int step: The increment step value for this profile field.
+ :param str type: The type for this profile field.
"""
# pylint: disable=super-init-not-called
- self.id = id
+ self.max = max
+ self.min = min
+ self.step = step
+ self.type = type
@classmethod
- def from_dict(cls, _dict: Dict) -> 'ResourceGroupIdentityById':
- """Initialize a ResourceGroupIdentityById object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'ShareProfileCapacityDependentRange':
+ """Initialize a ShareProfileCapacityDependentRange object from a json dictionary."""
args = {}
- if 'id' in _dict:
- args['id'] = _dict.get('id')
+ if (max := _dict.get('max')) is not None:
+ args['max'] = max
else:
- raise ValueError('Required property \'id\' not present in ResourceGroupIdentityById JSON')
+ raise ValueError('Required property \'max\' not present in ShareProfileCapacityDependentRange JSON')
+ if (min := _dict.get('min')) is not None:
+ args['min'] = min
+ else:
+ raise ValueError('Required property \'min\' not present in ShareProfileCapacityDependentRange JSON')
+ if (step := _dict.get('step')) is not None:
+ args['step'] = step
+ else:
+ raise ValueError('Required property \'step\' not present in ShareProfileCapacityDependentRange JSON')
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
+ else:
+ raise ValueError('Required property \'type\' not present in ShareProfileCapacityDependentRange JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a ResourceGroupIdentityById object from a json dictionary."""
+ """Initialize a ShareProfileCapacityDependentRange object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'id') and self.id is not None:
- _dict['id'] = self.id
+ 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):
@@ -112153,117 +128190,88 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this ResourceGroupIdentityById object."""
+ """Return a `str` version of this ShareProfileCapacityDependentRange object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'ResourceGroupIdentityById') -> bool:
+ def __eq__(self, other: 'ShareProfileCapacityDependentRange') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'ResourceGroupIdentityById') -> bool:
+ def __ne__(self, other: 'ShareProfileCapacityDependentRange') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
+ class TypeEnum(str, Enum):
+ """
+ The type for this profile field.
+ """
+
+ DEPENDENT = 'dependent'
+ DEPENDENT_RANGE = 'dependent_range'
+
-class RouteCreatorVPNGatewayReference(RouteCreator):
+
+class ShareProfileCapacityEnum(ShareProfileCapacity):
"""
- RouteCreatorVPNGatewayReference.
+ The permitted total capacities (in gigabytes) of a share with this profile.
- :attr str crn: The VPN gateway's CRN.
- :attr VPNGatewayReferenceDeleted deleted: (optional) If present, this property
- indicates the referenced resource has been deleted, and provides
- some supplementary information.
- :attr str href: The VPN gateway's canonical URL.
- :attr str id: The unique identifier for this VPN gateway.
- :attr str name: The name for this VPN gateway. The name is unique across all VPN
- gateways in the VPC.
- :attr str resource_type: The resource type.
+ :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.
"""
def __init__(
self,
- crn: str,
- href: str,
- id: str,
- name: str,
- resource_type: str,
- *,
- deleted: 'VPNGatewayReferenceDeleted' = None,
+ default: int,
+ type: str,
+ values: List[int],
) -> None:
"""
- Initialize a RouteCreatorVPNGatewayReference object.
+ Initialize a ShareProfileCapacityEnum object.
- :param str crn: The VPN gateway's CRN.
- :param str href: The VPN gateway's canonical URL.
- :param str id: The unique identifier for this VPN gateway.
- :param str name: The name for this VPN gateway. The name is unique across
- all VPN gateways in the VPC.
- :param str resource_type: The resource type.
- :param VPNGatewayReferenceDeleted deleted: (optional) If present, this
- property indicates the referenced resource has been deleted, and provides
- some supplementary information.
+ :param int default: The default value for this profile field.
+ :param str type: The type for this profile field.
+ :param List[int] values: The permitted values for this profile field.
"""
# pylint: disable=super-init-not-called
- self.crn = crn
- self.deleted = deleted
- self.href = href
- self.id = id
- self.name = name
- self.resource_type = resource_type
+ self.default = default
+ self.type = type
+ self.values = values
@classmethod
- def from_dict(cls, _dict: Dict) -> 'RouteCreatorVPNGatewayReference':
- """Initialize a RouteCreatorVPNGatewayReference object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'ShareProfileCapacityEnum':
+ """Initialize a ShareProfileCapacityEnum object from a json dictionary."""
args = {}
- if 'crn' in _dict:
- args['crn'] = _dict.get('crn')
+ if (default := _dict.get('default')) is not None:
+ args['default'] = default
else:
- raise ValueError('Required property \'crn\' not present in RouteCreatorVPNGatewayReference JSON')
- if 'deleted' in _dict:
- args['deleted'] = VPNGatewayReferenceDeleted.from_dict(_dict.get('deleted'))
- if 'href' in _dict:
- args['href'] = _dict.get('href')
- else:
- raise ValueError('Required property \'href\' not present in RouteCreatorVPNGatewayReference JSON')
- if 'id' in _dict:
- args['id'] = _dict.get('id')
- else:
- raise ValueError('Required property \'id\' not present in RouteCreatorVPNGatewayReference JSON')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
+ raise ValueError('Required property \'default\' not present in ShareProfileCapacityEnum JSON')
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
else:
- raise ValueError('Required property \'name\' not present in RouteCreatorVPNGatewayReference JSON')
- if 'resource_type' in _dict:
- args['resource_type'] = _dict.get('resource_type')
+ raise ValueError('Required property \'type\' not present in ShareProfileCapacityEnum JSON')
+ if (values := _dict.get('values')) is not None:
+ args['values'] = values
else:
- raise ValueError('Required property \'resource_type\' not present in RouteCreatorVPNGatewayReference JSON')
+ raise ValueError('Required property \'values\' not present in ShareProfileCapacityEnum JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a RouteCreatorVPNGatewayReference object from a json dictionary."""
+ """Initialize a ShareProfileCapacityEnum object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'crn') and self.crn is not None:
- _dict['crn'] = self.crn
- if hasattr(self, 'deleted') and self.deleted is not None:
- if isinstance(self.deleted, dict):
- _dict['deleted'] = self.deleted
- else:
- _dict['deleted'] = self.deleted.to_dict()
- if hasattr(self, 'href') and self.href is not None:
- _dict['href'] = self.href
- if hasattr(self, 'id') and self.id is not None:
- _dict['id'] = self.id
- if hasattr(self, 'name') and self.name is not None:
- _dict['name'] = self.name
- if hasattr(self, 'resource_type') and self.resource_type is not None:
- _dict['resource_type'] = self.resource_type
+ if hasattr(self, 'default') and self.default is not None:
+ _dict['default'] = self.default
+ if hasattr(self, 'type') and self.type is not None:
+ _dict['type'] = self.type
+ if hasattr(self, 'values') and self.values is not None:
+ _dict['values'] = self.values
return _dict
def _to_dict(self):
@@ -112271,125 +128279,77 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this RouteCreatorVPNGatewayReference object."""
+ """Return a `str` version of this ShareProfileCapacityEnum object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'RouteCreatorVPNGatewayReference') -> bool:
+ def __eq__(self, other: 'ShareProfileCapacityEnum') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'RouteCreatorVPNGatewayReference') -> bool:
+ def __ne__(self, other: 'ShareProfileCapacityEnum') -> 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.
"""
- VPN_GATEWAY = 'vpn_gateway'
+ ENUM = 'enum'
-class RouteCreatorVPNServerReference(RouteCreator):
+class ShareProfileCapacityFixed(ShareProfileCapacity):
"""
- RouteCreatorVPNServerReference.
+ The permitted total capacity (in gigabytes) of a share with this profile is fixed.
- :attr str crn: The CRN for this VPN server.
- :attr VPNServerReferenceDeleted deleted: (optional) If present, this property
- indicates the referenced resource has been deleted, and provides
- some supplementary information.
- :attr str href: The URL for this VPN server.
- :attr str id: The unique identifier for this VPN server.
- :attr str name: The name for this VPN server. The name is unique across all VPN
- servers in the VPC.
- :attr str resource_type: The resource type.
+ :param str type: The type for this profile field.
+ :param int value: The value for this profile field.
"""
def __init__(
self,
- crn: str,
- href: str,
- id: str,
- name: str,
- resource_type: str,
- *,
- deleted: 'VPNServerReferenceDeleted' = None,
+ type: str,
+ value: int,
) -> None:
"""
- Initialize a RouteCreatorVPNServerReference object.
+ Initialize a ShareProfileCapacityFixed object.
- :param str crn: The CRN for this VPN server.
- :param str href: The URL for this VPN server.
- :param str id: The unique identifier for this VPN server.
- :param str name: The name for this VPN server. The name is unique across
- all VPN servers in the VPC.
- :param str resource_type: The resource type.
- :param VPNServerReferenceDeleted deleted: (optional) If present, this
- property indicates the referenced resource has been deleted, and provides
- some supplementary information.
+ :param str type: The type for this profile field.
+ :param int value: The value for this profile field.
"""
# pylint: disable=super-init-not-called
- self.crn = crn
- self.deleted = deleted
- self.href = href
- self.id = id
- self.name = name
- self.resource_type = resource_type
+ self.type = type
+ self.value = value
@classmethod
- def from_dict(cls, _dict: Dict) -> 'RouteCreatorVPNServerReference':
- """Initialize a RouteCreatorVPNServerReference object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'ShareProfileCapacityFixed':
+ """Initialize a ShareProfileCapacityFixed object from a json dictionary."""
args = {}
- if 'crn' in _dict:
- args['crn'] = _dict.get('crn')
- else:
- raise ValueError('Required property \'crn\' not present in RouteCreatorVPNServerReference JSON')
- if 'deleted' in _dict:
- args['deleted'] = VPNServerReferenceDeleted.from_dict(_dict.get('deleted'))
- if 'href' in _dict:
- args['href'] = _dict.get('href')
- else:
- raise ValueError('Required property \'href\' not present in RouteCreatorVPNServerReference JSON')
- if 'id' in _dict:
- args['id'] = _dict.get('id')
- else:
- raise ValueError('Required property \'id\' not present in RouteCreatorVPNServerReference JSON')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
else:
- raise ValueError('Required property \'name\' not present in RouteCreatorVPNServerReference JSON')
- if 'resource_type' in _dict:
- args['resource_type'] = _dict.get('resource_type')
+ raise ValueError('Required property \'type\' not present in ShareProfileCapacityFixed JSON')
+ if (value := _dict.get('value')) is not None:
+ args['value'] = value
else:
- raise ValueError('Required property \'resource_type\' not present in RouteCreatorVPNServerReference JSON')
+ raise ValueError('Required property \'value\' not present in ShareProfileCapacityFixed JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a RouteCreatorVPNServerReference object from a json dictionary."""
+ """Initialize a ShareProfileCapacityFixed object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'crn') and self.crn is not None:
- _dict['crn'] = self.crn
- if hasattr(self, 'deleted') and self.deleted is not None:
- if isinstance(self.deleted, dict):
- _dict['deleted'] = self.deleted
- else:
- _dict['deleted'] = self.deleted.to_dict()
- if hasattr(self, 'href') and self.href is not None:
- _dict['href'] = self.href
- if hasattr(self, 'id') and self.id is not None:
- _dict['id'] = self.id
- if hasattr(self, 'name') and self.name is not None:
- _dict['name'] = self.name
- if hasattr(self, 'resource_type') and self.resource_type is not None:
- _dict['resource_type'] = self.resource_type
+ if hasattr(self, 'type') and self.type is not None:
+ _dict['type'] = self.type
+ if hasattr(self, 'value') and self.value is not None:
+ _dict['value'] = self.value
return _dict
def _to_dict(self):
@@ -112397,76 +128357,107 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this RouteCreatorVPNServerReference object."""
+ """Return a `str` version of this ShareProfileCapacityFixed object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'RouteCreatorVPNServerReference') -> bool:
+ def __eq__(self, other: 'ShareProfileCapacityFixed') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'RouteCreatorVPNServerReference') -> bool:
+ def __ne__(self, other: 'ShareProfileCapacityFixed') -> 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.
"""
- VPN_SERVER = 'vpn_server'
+ FIXED = 'fixed'
-class RouteNextHopIP(RouteNextHop):
+class ShareProfileCapacityRange(ShareProfileCapacity):
"""
- RouteNextHopIP.
+ The permitted total capacity range (in gigabytes) of a share with this profile.
- :attr str address: The IP address.
- This property may add support for IPv6 addresses in the future. When processing
- a value in this property, verify that the address is in an expected format. If
- it is not, log an error. Optionally halt processing and surface the error, or
- bypass the resource on which the unexpected IP address format was encountered.
+ :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.
"""
def __init__(
self,
- address: str,
+ default: int,
+ max: int,
+ min: int,
+ step: int,
+ type: str,
) -> None:
"""
- Initialize a RouteNextHopIP object.
+ Initialize a ShareProfileCapacityRange object.
- :param str address: The IP address.
- This property may add support for IPv6 addresses in the future. When
- processing a value in this property, verify that the address is in an
- expected format. If it is not, log an error. Optionally halt processing and
- surface the error, or bypass the resource on which the unexpected IP
- address format was encountered.
+ :param int default: The default value for this profile field.
+ :param int max: The maximum value for this profile field.
+ :param int min: The minimum value for this profile field.
+ :param int step: The increment step value for this profile field.
+ :param str type: The type for this profile field.
"""
# pylint: disable=super-init-not-called
- self.address = address
+ self.default = default
+ self.max = max
+ self.min = min
+ self.step = step
+ self.type = type
@classmethod
- def from_dict(cls, _dict: Dict) -> 'RouteNextHopIP':
- """Initialize a RouteNextHopIP object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'ShareProfileCapacityRange':
+ """Initialize a ShareProfileCapacityRange object from a json dictionary."""
args = {}
- if 'address' in _dict:
- args['address'] = _dict.get('address')
+ if (default := _dict.get('default')) is not None:
+ args['default'] = default
else:
- raise ValueError('Required property \'address\' not present in RouteNextHopIP JSON')
+ raise ValueError('Required property \'default\' not present in ShareProfileCapacityRange JSON')
+ if (max := _dict.get('max')) is not None:
+ args['max'] = max
+ else:
+ raise ValueError('Required property \'max\' not present in ShareProfileCapacityRange JSON')
+ if (min := _dict.get('min')) is not None:
+ args['min'] = min
+ else:
+ raise ValueError('Required property \'min\' not present in ShareProfileCapacityRange JSON')
+ if (step := _dict.get('step')) is not None:
+ args['step'] = step
+ else:
+ raise ValueError('Required property \'step\' not present in ShareProfileCapacityRange JSON')
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
+ else:
+ raise ValueError('Required property \'type\' not present in ShareProfileCapacityRange JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a RouteNextHopIP object from a json dictionary."""
+ """Initialize a ShareProfileCapacityRange object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'address') and self.address is not None:
- _dict['address'] = self.address
+ if hasattr(self, 'default') and self.default is not None:
+ _dict['default'] = self.default
+ if hasattr(self, 'max') and self.max is not None:
+ _dict['max'] = self.max
+ if hasattr(self, 'min') and self.min is not None:
+ _dict['min'] = self.min
+ if hasattr(self, 'step') and self.step is not None:
+ _dict['step'] = self.step
+ if hasattr(self, 'type') and self.type is not None:
+ _dict['type'] = self.type
return _dict
def _to_dict(self):
@@ -112474,148 +128465,97 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this RouteNextHopIP object."""
+ """Return a `str` version of this ShareProfileCapacityRange object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'RouteNextHopIP') -> bool:
+ def __eq__(self, other: 'ShareProfileCapacityRange') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'RouteNextHopIP') -> bool:
+ def __ne__(self, other: 'ShareProfileCapacityRange') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-
-class RouteNextHopPatchRouteNextHopIP(RouteNextHopPatch):
- """
- RouteNextHopPatchRouteNextHopIP.
-
- """
-
- def __init__(
- self,
- ) -> None:
+ class TypeEnum(str, Enum):
"""
- Initialize a RouteNextHopPatchRouteNextHopIP object.
-
+ The type for this profile field.
"""
- # pylint: disable=super-init-not-called
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['RouteNextHopPatchRouteNextHopIPRouteNextHopIPSentinelIP', 'RouteNextHopPatchRouteNextHopIPRouteNextHopIPUnicastIP'])
- )
- raise Exception(msg)
-
-
-class RouteNextHopPatchVPNGatewayConnectionIdentity(RouteNextHopPatch):
- """
- Identifies a VPN gateway connection by a unique property.
-
- """
- def __init__(
- self,
- ) -> None:
- """
- Initialize a RouteNextHopPatchVPNGatewayConnectionIdentity object.
+ RANGE = 'range'
- """
- # pylint: disable=super-init-not-called
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['RouteNextHopPatchVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityById', 'RouteNextHopPatchVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityByHref'])
- )
- raise Exception(msg)
-class RouteNextHopVPNGatewayConnectionReference(RouteNextHop):
+class ShareProfileIOPSDependentRange(ShareProfileIOPS):
"""
- RouteNextHopVPNGatewayConnectionReference.
+ The permitted IOPS range of a share with this profile depends on its configuration.
- :attr VPNGatewayConnectionReferenceDeleted deleted: (optional) If present, this
- property indicates the referenced resource has been deleted, and provides
- some supplementary information.
- :attr str href: The VPN connection's canonical URL.
- :attr str id: The unique identifier for this VPN gateway connection.
- :attr str name: The name for this VPN gateway connection. The name is unique
- across all connections for the VPN gateway.
- :attr str resource_type: The resource type.
+ :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.
"""
def __init__(
self,
- href: str,
- id: str,
- name: str,
- resource_type: str,
- *,
- deleted: 'VPNGatewayConnectionReferenceDeleted' = None,
+ max: int,
+ min: int,
+ step: int,
+ type: str,
) -> None:
"""
- Initialize a RouteNextHopVPNGatewayConnectionReference object.
+ Initialize a ShareProfileIOPSDependentRange object.
- :param str href: The VPN connection's canonical URL.
- :param str id: The unique identifier for this VPN gateway connection.
- :param str name: The name for this VPN gateway connection. The name is
- unique across all connections for the VPN gateway.
- :param str resource_type: The resource type.
- :param VPNGatewayConnectionReferenceDeleted deleted: (optional) If present,
- this property indicates the referenced resource has been deleted, and
- provides
- some supplementary information.
+ :param int max: The maximum value for this profile field.
+ :param int min: The minimum value for this profile field.
+ :param int step: The increment step value for this profile field.
+ :param str type: The type for this profile field.
"""
# pylint: disable=super-init-not-called
- self.deleted = deleted
- self.href = href
- self.id = id
- self.name = name
- self.resource_type = resource_type
+ self.max = max
+ self.min = min
+ self.step = step
+ self.type = type
@classmethod
- def from_dict(cls, _dict: Dict) -> 'RouteNextHopVPNGatewayConnectionReference':
- """Initialize a RouteNextHopVPNGatewayConnectionReference object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'ShareProfileIOPSDependentRange':
+ """Initialize a ShareProfileIOPSDependentRange 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')
+ if (max := _dict.get('max')) is not None:
+ args['max'] = max
else:
- raise ValueError('Required property \'href\' not present in RouteNextHopVPNGatewayConnectionReference JSON')
- if 'id' in _dict:
- args['id'] = _dict.get('id')
+ raise ValueError('Required property \'max\' not present in ShareProfileIOPSDependentRange JSON')
+ if (min := _dict.get('min')) is not None:
+ args['min'] = min
else:
- raise ValueError('Required property \'id\' not present in RouteNextHopVPNGatewayConnectionReference JSON')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
+ raise ValueError('Required property \'min\' not present in ShareProfileIOPSDependentRange JSON')
+ if (step := _dict.get('step')) is not None:
+ args['step'] = step
else:
- raise ValueError('Required property \'name\' not present in RouteNextHopVPNGatewayConnectionReference JSON')
- if 'resource_type' in _dict:
- args['resource_type'] = _dict.get('resource_type')
+ raise ValueError('Required property \'step\' not present in ShareProfileIOPSDependentRange JSON')
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
else:
- raise ValueError('Required property \'resource_type\' not present in RouteNextHopVPNGatewayConnectionReference JSON')
+ raise ValueError('Required property \'type\' not present in ShareProfileIOPSDependentRange JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a RouteNextHopVPNGatewayConnectionReference object from a json dictionary."""
+ """Initialize a ShareProfileIOPSDependentRange object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'deleted') and self.deleted is not None:
- if isinstance(self.deleted, dict):
- _dict['deleted'] = self.deleted
- else:
- _dict['deleted'] = self.deleted.to_dict()
- if hasattr(self, 'href') and self.href is not None:
- _dict['href'] = self.href
- if hasattr(self, 'id') and self.id is not None:
- _dict['id'] = self.id
- if hasattr(self, 'name') and self.name is not None:
- _dict['name'] = self.name
- if hasattr(self, 'resource_type') and self.resource_type is not None:
- _dict['resource_type'] = self.resource_type
+ if hasattr(self, '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):
@@ -112623,107 +128563,88 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this RouteNextHopVPNGatewayConnectionReference object."""
+ """Return a `str` version of this ShareProfileIOPSDependentRange object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'RouteNextHopVPNGatewayConnectionReference') -> bool:
+ def __eq__(self, other: 'ShareProfileIOPSDependentRange') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'RouteNextHopVPNGatewayConnectionReference') -> bool:
+ def __ne__(self, other: 'ShareProfileIOPSDependentRange') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class ResourceTypeEnum(str, Enum):
- """
- The resource type.
- """
-
- VPN_GATEWAY_CONNECTION = 'vpn_gateway_connection'
-
-
-
-class RoutePrototypeNextHopRouteNextHopPrototypeRouteNextHopIP(RoutePrototypeNextHop):
- """
- RoutePrototypeNextHopRouteNextHopPrototypeRouteNextHopIP.
-
- """
-
- def __init__(
- self,
- ) -> None:
+ class TypeEnum(str, Enum):
"""
- Initialize a RoutePrototypeNextHopRouteNextHopPrototypeRouteNextHopIP object.
-
+ The type for this profile field.
"""
- # pylint: disable=super-init-not-called
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['RoutePrototypeNextHopRouteNextHopPrototypeRouteNextHopIPRouteNextHopPrototypeRouteNextHopIPRouteNextHopIPSentinelIP', 'RoutePrototypeNextHopRouteNextHopPrototypeRouteNextHopIPRouteNextHopPrototypeRouteNextHopIPRouteNextHopIPUnicastIP'])
- )
- raise Exception(msg)
-
-
-class RoutePrototypeNextHopRouteNextHopPrototypeVPNGatewayConnectionIdentity(RoutePrototypeNextHop):
- """
- Identifies a VPN gateway connection by a unique property.
-
- """
- def __init__(
- self,
- ) -> None:
- """
- Initialize a RoutePrototypeNextHopRouteNextHopPrototypeVPNGatewayConnectionIdentity object.
+ DEPENDENT = 'dependent'
+ DEPENDENT_RANGE = 'dependent_range'
- """
- # pylint: disable=super-init-not-called
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['RoutePrototypeNextHopRouteNextHopPrototypeVPNGatewayConnectionIdentityRouteNextHopPrototypeVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityById', 'RoutePrototypeNextHopRouteNextHopPrototypeVPNGatewayConnectionIdentityRouteNextHopPrototypeVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityByHref'])
- )
- raise Exception(msg)
-class RoutingTableIdentityByHref(RoutingTableIdentity):
+class ShareProfileIOPSEnum(ShareProfileIOPS):
"""
- RoutingTableIdentityByHref.
+ The permitted IOPS values of a share with this profile.
- :attr str href: The URL for this routing table.
+ :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.
"""
def __init__(
self,
- href: str,
+ default: int,
+ type: str,
+ values: List[int],
) -> None:
"""
- Initialize a RoutingTableIdentityByHref object.
+ Initialize a ShareProfileIOPSEnum object.
- :param str href: The URL for this routing table.
+ :param int default: The default value for this profile field.
+ :param str type: The type for this profile field.
+ :param List[int] values: The permitted values for this profile field.
"""
# pylint: disable=super-init-not-called
- self.href = href
+ self.default = default
+ self.type = type
+ self.values = values
@classmethod
- def from_dict(cls, _dict: Dict) -> 'RoutingTableIdentityByHref':
- """Initialize a RoutingTableIdentityByHref object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'ShareProfileIOPSEnum':
+ """Initialize a ShareProfileIOPSEnum object from a json dictionary."""
args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ if (default := _dict.get('default')) is not None:
+ args['default'] = default
else:
- raise ValueError('Required property \'href\' not present in RoutingTableIdentityByHref JSON')
+ raise ValueError('Required property \'default\' not present in ShareProfileIOPSEnum JSON')
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
+ else:
+ raise ValueError('Required property \'type\' not present in ShareProfileIOPSEnum JSON')
+ if (values := _dict.get('values')) is not None:
+ args['values'] = values
+ else:
+ raise ValueError('Required property \'values\' not present in ShareProfileIOPSEnum JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a RoutingTableIdentityByHref object from a json dictionary."""
+ """Initialize a ShareProfileIOPSEnum object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, '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):
@@ -112731,59 +128652,77 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this RoutingTableIdentityByHref object."""
+ """Return a `str` version of this ShareProfileIOPSEnum object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'RoutingTableIdentityByHref') -> bool:
+ def __eq__(self, other: 'ShareProfileIOPSEnum') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'RoutingTableIdentityByHref') -> bool:
+ def __ne__(self, other: 'ShareProfileIOPSEnum') -> 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 RoutingTableIdentityById(RoutingTableIdentity):
+
+
+class ShareProfileIOPSFixed(ShareProfileIOPS):
"""
- RoutingTableIdentityById.
+ The permitted IOPS of a share with this profile is fixed.
- :attr str id: The unique identifier for this routing table.
+ :param str type: The type for this profile field.
+ :param int value: The value for this profile field.
"""
def __init__(
self,
- id: str,
+ type: str,
+ value: int,
) -> None:
"""
- Initialize a RoutingTableIdentityById object.
+ Initialize a ShareProfileIOPSFixed object.
- :param str id: The unique identifier for this routing table.
+ :param str type: The type for this profile field.
+ :param int value: The value for this profile field.
"""
# pylint: disable=super-init-not-called
- self.id = id
+ self.type = type
+ self.value = value
@classmethod
- def from_dict(cls, _dict: Dict) -> 'RoutingTableIdentityById':
- """Initialize a RoutingTableIdentityById object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'ShareProfileIOPSFixed':
+ """Initialize a ShareProfileIOPSFixed object from a json dictionary."""
args = {}
- if 'id' in _dict:
- args['id'] = _dict.get('id')
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
else:
- raise ValueError('Required property \'id\' not present in RoutingTableIdentityById JSON')
+ raise ValueError('Required property \'type\' not present in ShareProfileIOPSFixed JSON')
+ if (value := _dict.get('value')) is not None:
+ args['value'] = value
+ else:
+ raise ValueError('Required property \'value\' not present in ShareProfileIOPSFixed JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a RoutingTableIdentityById object from a json dictionary."""
+ """Initialize a ShareProfileIOPSFixed object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'id') and self.id is not None:
- _dict['id'] = self.id
+ if hasattr(self, 'type') and self.type is not None:
+ _dict['type'] = self.type
+ if hasattr(self, 'value') and self.value is not None:
+ _dict['value'] = self.value
return _dict
def _to_dict(self):
@@ -112791,59 +128730,107 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this RoutingTableIdentityById object."""
+ """Return a `str` version of this ShareProfileIOPSFixed object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'RoutingTableIdentityById') -> bool:
+ def __eq__(self, other: 'ShareProfileIOPSFixed') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'RoutingTableIdentityById') -> bool:
+ def __ne__(self, other: 'ShareProfileIOPSFixed') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
+ class TypeEnum(str, Enum):
+ """
+ The type for this profile field.
+ """
-class SecurityGroupIdentityByCRN(SecurityGroupIdentity):
+ FIXED = 'fixed'
+
+
+
+class ShareProfileIOPSRange(ShareProfileIOPS):
"""
- SecurityGroupIdentityByCRN.
+ The permitted IOPS range of a share with this profile.
- :attr str crn: The security group's CRN.
+ :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.
"""
def __init__(
self,
- crn: str,
+ default: int,
+ max: int,
+ min: int,
+ step: int,
+ type: str,
) -> None:
"""
- Initialize a SecurityGroupIdentityByCRN object.
+ Initialize a ShareProfileIOPSRange object.
- :param str crn: The security group's CRN.
+ :param int default: The default value for this profile field.
+ :param int max: The maximum value for this profile field.
+ :param int min: The minimum value for this profile field.
+ :param int step: The increment step value for this profile field.
+ :param str type: The type for this profile field.
"""
# pylint: disable=super-init-not-called
- self.crn = crn
+ self.default = default
+ self.max = max
+ self.min = min
+ self.step = step
+ self.type = type
@classmethod
- def from_dict(cls, _dict: Dict) -> 'SecurityGroupIdentityByCRN':
- """Initialize a SecurityGroupIdentityByCRN object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'ShareProfileIOPSRange':
+ """Initialize a ShareProfileIOPSRange object from a json dictionary."""
args = {}
- if 'crn' in _dict:
- args['crn'] = _dict.get('crn')
+ if (default := _dict.get('default')) is not None:
+ args['default'] = default
else:
- raise ValueError('Required property \'crn\' not present in SecurityGroupIdentityByCRN JSON')
+ raise ValueError('Required property \'default\' not present in ShareProfileIOPSRange JSON')
+ if (max := _dict.get('max')) is not None:
+ args['max'] = max
+ else:
+ raise ValueError('Required property \'max\' not present in ShareProfileIOPSRange JSON')
+ if (min := _dict.get('min')) is not None:
+ args['min'] = min
+ else:
+ raise ValueError('Required property \'min\' not present in ShareProfileIOPSRange JSON')
+ if (step := _dict.get('step')) is not None:
+ args['step'] = step
+ else:
+ raise ValueError('Required property \'step\' not present in ShareProfileIOPSRange JSON')
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
+ else:
+ raise ValueError('Required property \'type\' not present in ShareProfileIOPSRange JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a SecurityGroupIdentityByCRN object from a json dictionary."""
+ """Initialize a ShareProfileIOPSRange object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'crn') and self.crn is not None:
- _dict['crn'] = self.crn
+ if hasattr(self, 'default') and self.default is not None:
+ _dict['default'] = self.default
+ if hasattr(self, 'max') and self.max is not None:
+ _dict['max'] = self.max
+ if hasattr(self, 'min') and self.min is not None:
+ _dict['min'] = self.min
+ if hasattr(self, 'step') and self.step is not None:
+ _dict['step'] = self.step
+ if hasattr(self, 'type') and self.type is not None:
+ _dict['type'] = self.type
return _dict
def _to_dict(self):
@@ -112851,25 +128838,33 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this SecurityGroupIdentityByCRN object."""
+ """Return a `str` version of this ShareProfileIOPSRange object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'SecurityGroupIdentityByCRN') -> bool:
+ def __eq__(self, other: 'ShareProfileIOPSRange') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'SecurityGroupIdentityByCRN') -> bool:
+ def __ne__(self, other: 'ShareProfileIOPSRange') -> 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 SecurityGroupIdentityByHref(SecurityGroupIdentity):
+
+class ShareProfileIdentityByHref(ShareProfileIdentity):
"""
- SecurityGroupIdentityByHref.
+ ShareProfileIdentityByHref.
- :attr str href: The security group's canonical URL.
+ :param str href: The URL for this share profile.
"""
def __init__(
@@ -112877,26 +128872,26 @@ def __init__(
href: str,
) -> None:
"""
- Initialize a SecurityGroupIdentityByHref object.
+ Initialize a ShareProfileIdentityByHref object.
- :param str href: The security group's canonical URL.
+ :param str href: The URL for this share profile.
"""
# pylint: disable=super-init-not-called
self.href = href
@classmethod
- def from_dict(cls, _dict: Dict) -> 'SecurityGroupIdentityByHref':
- """Initialize a SecurityGroupIdentityByHref object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'ShareProfileIdentityByHref':
+ """Initialize a ShareProfileIdentityByHref object from a json dictionary."""
args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'href\' not present in SecurityGroupIdentityByHref JSON')
+ raise ValueError('Required property \'href\' not present in ShareProfileIdentityByHref JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a SecurityGroupIdentityByHref object from a json dictionary."""
+ """Initialize a ShareProfileIdentityByHref object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -112911,59 +128906,59 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this SecurityGroupIdentityByHref object."""
+ """Return a `str` version of this ShareProfileIdentityByHref object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'SecurityGroupIdentityByHref') -> bool:
+ def __eq__(self, other: 'ShareProfileIdentityByHref') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'SecurityGroupIdentityByHref') -> bool:
+ def __ne__(self, other: 'ShareProfileIdentityByHref') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class SecurityGroupIdentityById(SecurityGroupIdentity):
+class ShareProfileIdentityByName(ShareProfileIdentity):
"""
- SecurityGroupIdentityById.
+ ShareProfileIdentityByName.
- :attr str id: The unique identifier for this security group.
+ :param str name: The globally unique name for this share profile.
"""
def __init__(
self,
- id: str,
+ name: str,
) -> None:
"""
- Initialize a SecurityGroupIdentityById object.
+ Initialize a ShareProfileIdentityByName object.
- :param str id: The unique identifier for this security group.
+ :param str name: The globally unique name for this share profile.
"""
# pylint: disable=super-init-not-called
- self.id = id
+ self.name = name
@classmethod
- def from_dict(cls, _dict: Dict) -> 'SecurityGroupIdentityById':
- """Initialize a SecurityGroupIdentityById object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'ShareProfileIdentityByName':
+ """Initialize a ShareProfileIdentityByName object from a json dictionary."""
args = {}
- if 'id' in _dict:
- args['id'] = _dict.get('id')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
else:
- raise ValueError('Required property \'id\' not present in SecurityGroupIdentityById JSON')
+ raise ValueError('Required property \'name\' not present in ShareProfileIdentityByName JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a SecurityGroupIdentityById object from a json dictionary."""
+ """Initialize a ShareProfileIdentityByName object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, '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):
@@ -112971,111 +128966,237 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this SecurityGroupIdentityById object."""
+ """Return a `str` version of this ShareProfileIdentityByName object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'SecurityGroupIdentityById') -> bool:
+ def __eq__(self, other: 'ShareProfileIdentityByName') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'SecurityGroupIdentityById') -> bool:
+ def __ne__(self, other: 'ShareProfileIdentityByName') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll(SecurityGroupRulePrototype):
+class SharePrototypeShareBySize(SharePrototype):
"""
- A rule allowing traffic for all supported protocols.
+ Create a file share by size.
- :attr str direction: The direction of traffic to enforce.
- :attr str ip_version: (optional) The IP version to enforce. The format of
- `remote.address` or `remote.cidr_block` must match this property, if they are
- used. Alternatively, if `remote` references a security group, then this rule
- only applies to IP addresses (network interfaces) in that group matching this IP
- version.
- :attr str protocol: The protocol to enforce.
- :attr SecurityGroupRuleRemotePrototype remote: (optional) The remote IP
- addresses or security groups from which this rule will allow traffic (or to
- which, for outbound rules). Can be specified as an IP address, a CIDR block, or
- a
- security group within the VPC.
- If unspecified, a CIDR block of `0.0.0.0/0` will be used to allow traffic from
- any source
- (or to any destination, for outbound rules).
+ :param int iops: (optional) The maximum input/output operations per second
+ (IOPS) for the file share. The share must be in the `defined_performance`
+ profile family, and the value must be in the range supported by the share's
+ specified size.
+ In addition, each client accessing the share will be restricted to 48,000 IOPS.
+ :param List[ShareMountTargetPrototype] mount_targets: (optional) The mount
+ targets for the file share. Each mount target must be in a unique VPC.
+ :param str name: (optional) The name for this share. The name must not be used
+ by another share in the region. If unspecified, the name will be a hyphenated
+ list of randomly-selected words.
+ :param ShareProfileIdentity profile: The
+ [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-profiles) to use
+ for this file share. The profile must support the share's specified IOPS and
+ size.
+ :param SharePrototypeShareContext replica_share: (optional)
+ :param List[str] user_tags: (optional) Tags for this resource.
+ :param ZoneIdentity zone: The zone this file share will reside in.
+ For a replica share, this must be a different zone in the same region as the
+ source share.
+ :param str access_control_mode: (optional) The access control mode for the
+ share:
+ - `security_group`: The security groups on the virtual network interface for a
+ mount target control access to the mount target. Mount targets for this share
+ require a virtual network interface.
+ - `vpc`: All clients in the VPC for a mount target have access to the mount
+ target.
+ Mount targets for this share require a VPC.
+ :param EncryptionKeyIdentity encryption_key: (optional) The root key to use to
+ wrap the data encryption key for the share.
+ If unspecified, the `encryption` type for the share will be `provider_managed`.
+ The specified key may be in a different account, subject to IAM policies.
+ :param ShareInitialOwner initial_owner: (optional) The owner assigned to the
+ file share at creation. Subsequent changes to the owner
+ must be performed by a client that has mounted the file share.
+ :param ResourceGroupIdentity resource_group: (optional) The resource group to
+ use. If unspecified, the account's [default resource
+ group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be
+ used.
+ :param int size: The size of the file share rounded up to the next gigabyte.
+ The maximum size for a share may increase in the future.
"""
def __init__(
self,
- direction: str,
- protocol: str,
+ profile: 'ShareProfileIdentity',
+ zone: 'ZoneIdentity',
+ size: int,
*,
- ip_version: str = None,
- remote: 'SecurityGroupRuleRemotePrototype' = None,
+ iops: Optional[int] = None,
+ mount_targets: Optional[List['ShareMountTargetPrototype']] = None,
+ name: Optional[str] = None,
+ replica_share: Optional['SharePrototypeShareContext'] = None,
+ user_tags: Optional[List[str]] = None,
+ access_control_mode: Optional[str] = None,
+ encryption_key: Optional['EncryptionKeyIdentity'] = None,
+ initial_owner: Optional['ShareInitialOwner'] = None,
+ resource_group: Optional['ResourceGroupIdentity'] = None,
) -> None:
"""
- Initialize a SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll object.
+ Initialize a SharePrototypeShareBySize object.
- :param str direction: The direction of traffic to enforce.
- :param str protocol: The protocol to enforce.
- :param str ip_version: (optional) The IP version to enforce. The format of
- `remote.address` or `remote.cidr_block` must match this property, if they
- are used. Alternatively, if `remote` references a security group, then this
- rule only applies to IP addresses (network interfaces) in that group
- matching this IP version.
- :param SecurityGroupRuleRemotePrototype remote: (optional) The remote IP
- addresses or security groups from which this rule will allow traffic (or to
- which, for outbound rules). Can be specified as an IP address, a CIDR
- block, or a
- security group within the VPC.
- If unspecified, a CIDR block of `0.0.0.0/0` will be used to allow traffic
- from any source
- (or to any destination, for outbound rules).
+ :param ShareProfileIdentity profile: The
+ [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-profiles)
+ to use for this file share. The profile must support the share's specified
+ IOPS and size.
+ :param ZoneIdentity zone: The zone this file share will reside in.
+ For a replica share, this must be a different zone in the same region as
+ the source share.
+ :param int size: The size of the file share rounded up to the next
+ gigabyte.
+ The maximum size for a share may increase in the future.
+ :param int iops: (optional) The maximum input/output operations per second
+ (IOPS) for the file share. The share must be in the `defined_performance`
+ profile family, and the value must be in the range supported by the share's
+ specified size.
+ In addition, each client accessing the share will be restricted to 48,000
+ IOPS.
+ :param List[ShareMountTargetPrototype] mount_targets: (optional) The mount
+ targets for the file share. Each mount target must be in a unique VPC.
+ :param str name: (optional) The name for this share. The name must not be
+ used by another share in the region. If unspecified, the name will be a
+ hyphenated list of randomly-selected words.
+ :param SharePrototypeShareContext replica_share: (optional)
+ :param List[str] user_tags: (optional) Tags for this resource.
+ :param str access_control_mode: (optional) The access control mode for the
+ share:
+ - `security_group`: The security groups on the virtual network interface
+ for a
+ mount target control access to the mount target. Mount targets for this
+ share
+ require a virtual network interface.
+ - `vpc`: All clients in the VPC for a mount target have access to the mount
+ target.
+ Mount targets for this share require a VPC.
+ :param EncryptionKeyIdentity encryption_key: (optional) The root key to use
+ to wrap the data encryption key for the share.
+ If unspecified, the `encryption` type for the share will be
+ `provider_managed`.
+ The specified key may be in a different account, subject to IAM policies.
+ :param ShareInitialOwner initial_owner: (optional) The owner assigned to
+ the file share at creation. Subsequent changes to the owner
+ must be performed by a client that has mounted the file share.
+ :param ResourceGroupIdentity resource_group: (optional) The resource group
+ to use. If unspecified, the account's [default resource
+ group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be
+ used.
"""
# pylint: disable=super-init-not-called
- self.direction = direction
- self.ip_version = ip_version
- self.protocol = protocol
- self.remote = remote
+ self.iops = iops
+ self.mount_targets = mount_targets
+ self.name = name
+ self.profile = profile
+ self.replica_share = replica_share
+ self.user_tags = user_tags
+ self.zone = zone
+ self.access_control_mode = access_control_mode
+ self.encryption_key = encryption_key
+ self.initial_owner = initial_owner
+ self.resource_group = resource_group
+ self.size = size
@classmethod
- def from_dict(cls, _dict: Dict) -> 'SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll':
- """Initialize a SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'SharePrototypeShareBySize':
+ """Initialize a SharePrototypeShareBySize object from a json dictionary."""
args = {}
- if 'direction' in _dict:
- args['direction'] = _dict.get('direction')
+ if (iops := _dict.get('iops')) is not None:
+ args['iops'] = iops
+ if (mount_targets := _dict.get('mount_targets')) is not None:
+ args['mount_targets'] = mount_targets
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ if (profile := _dict.get('profile')) is not None:
+ args['profile'] = profile
else:
- raise ValueError('Required property \'direction\' not present in SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll JSON')
- if 'ip_version' in _dict:
- args['ip_version'] = _dict.get('ip_version')
- if 'protocol' in _dict:
- args['protocol'] = _dict.get('protocol')
+ raise ValueError('Required property \'profile\' not present in SharePrototypeShareBySize JSON')
+ if (replica_share := _dict.get('replica_share')) is not None:
+ args['replica_share'] = SharePrototypeShareContext.from_dict(replica_share)
+ if (user_tags := _dict.get('user_tags')) is not None:
+ args['user_tags'] = user_tags
+ if (zone := _dict.get('zone')) is not None:
+ args['zone'] = zone
else:
- raise ValueError('Required property \'protocol\' not present in SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll JSON')
- if 'remote' in _dict:
- args['remote'] = _dict.get('remote')
+ raise ValueError('Required property \'zone\' not present in SharePrototypeShareBySize JSON')
+ if (access_control_mode := _dict.get('access_control_mode')) is not None:
+ args['access_control_mode'] = access_control_mode
+ if (encryption_key := _dict.get('encryption_key')) is not None:
+ args['encryption_key'] = encryption_key
+ if (initial_owner := _dict.get('initial_owner')) is not None:
+ args['initial_owner'] = ShareInitialOwner.from_dict(initial_owner)
+ if (resource_group := _dict.get('resource_group')) is not None:
+ args['resource_group'] = resource_group
+ if (size := _dict.get('size')) is not None:
+ args['size'] = size
+ else:
+ raise ValueError('Required property \'size\' not present in SharePrototypeShareBySize JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll object from a json dictionary."""
+ """Initialize a SharePrototypeShareBySize object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'direction') and self.direction is not None:
- _dict['direction'] = self.direction
- if hasattr(self, 'ip_version') and self.ip_version is not None:
- _dict['ip_version'] = self.ip_version
- if hasattr(self, 'protocol') and self.protocol is not None:
- _dict['protocol'] = self.protocol
- if hasattr(self, 'remote') and self.remote is not None:
- if isinstance(self.remote, dict):
- _dict['remote'] = self.remote
+ if hasattr(self, 'iops') and self.iops is not None:
+ _dict['iops'] = self.iops
+ if hasattr(self, 'mount_targets') and self.mount_targets is not None:
+ mount_targets_list = []
+ for v in self.mount_targets:
+ if isinstance(v, dict):
+ mount_targets_list.append(v)
+ else:
+ mount_targets_list.append(v.to_dict())
+ _dict['mount_targets'] = mount_targets_list
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ if hasattr(self, 'profile') and self.profile is not None:
+ if isinstance(self.profile, dict):
+ _dict['profile'] = self.profile
else:
- _dict['remote'] = self.remote.to_dict()
+ _dict['profile'] = self.profile.to_dict()
+ if hasattr(self, 'replica_share') and self.replica_share is not None:
+ if isinstance(self.replica_share, dict):
+ _dict['replica_share'] = self.replica_share
+ else:
+ _dict['replica_share'] = self.replica_share.to_dict()
+ if hasattr(self, 'user_tags') and self.user_tags is not None:
+ _dict['user_tags'] = self.user_tags
+ if hasattr(self, 'zone') and self.zone is not None:
+ if isinstance(self.zone, dict):
+ _dict['zone'] = self.zone
+ else:
+ _dict['zone'] = self.zone.to_dict()
+ if hasattr(self, 'access_control_mode') and self.access_control_mode is not None:
+ _dict['access_control_mode'] = self.access_control_mode
+ if hasattr(self, 'encryption_key') and self.encryption_key is not None:
+ if isinstance(self.encryption_key, dict):
+ _dict['encryption_key'] = self.encryption_key
+ else:
+ _dict['encryption_key'] = self.encryption_key.to_dict()
+ if hasattr(self, 'initial_owner') and self.initial_owner is not None:
+ if isinstance(self.initial_owner, dict):
+ _dict['initial_owner'] = self.initial_owner
+ else:
+ _dict['initial_owner'] = self.initial_owner.to_dict()
+ if hasattr(self, 'resource_group') and self.resource_group is not None:
+ if isinstance(self.resource_group, dict):
+ _dict['resource_group'] = self.resource_group
+ else:
+ _dict['resource_group'] = self.resource_group.to_dict()
+ if hasattr(self, 'size') and self.size is not None:
+ _dict['size'] = self.size
return _dict
def _to_dict(self):
@@ -113083,161 +129204,243 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll object."""
+ """Return a `str` version of this SharePrototypeShareBySize object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll') -> bool:
+ def __eq__(self, other: 'SharePrototypeShareBySize') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll') -> bool:
+ def __ne__(self, other: 'SharePrototypeShareBySize') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class DirectionEnum(str, Enum):
- """
- The direction of traffic to enforce.
- """
-
- INBOUND = 'inbound'
- OUTBOUND = 'outbound'
-
-
- class IpVersionEnum(str, Enum):
- """
- The IP version to enforce. The format of `remote.address` or `remote.cidr_block`
- must match this property, if they are used. Alternatively, if `remote` references
- a security group, then this rule only applies to IP addresses (network interfaces)
- in that group matching this IP version.
- """
-
- IPV4 = 'ipv4'
-
-
- class ProtocolEnum(str, Enum):
+ class AccessControlModeEnum(str, Enum):
"""
- The protocol to enforce.
+ The access control mode for the share:
+ - `security_group`: The security groups on the virtual network interface for a
+ mount target control access to the mount target. Mount targets for this share
+ require a virtual network interface.
+ - `vpc`: All clients in the VPC for a mount target have access to the mount
+ target.
+ Mount targets for this share require a VPC.
"""
- ALL = 'all'
+ SECURITY_GROUP = 'security_group'
+ VPC = 'vpc'
-class SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP(SecurityGroupRulePrototype):
+class SharePrototypeShareBySourceShare(SharePrototype):
"""
- A rule specifying the ICMP traffic to allow.
-
- :attr int code: (optional) The ICMP traffic code to allow.
- If specified, `type` must also be specified. If unspecified, all codes are
- allowed.
- :attr str direction: The direction of traffic to enforce.
- :attr str ip_version: (optional) The IP version to enforce. The format of
- `remote.address` or `remote.cidr_block` must match this property, if they are
- used. Alternatively, if `remote` references a security group, then this rule
- only applies to IP addresses (network interfaces) in that group matching this IP
- version.
- :attr str protocol: The protocol to enforce.
- :attr SecurityGroupRuleRemotePrototype remote: (optional) The remote IP
- addresses or security groups from which this rule will allow traffic (or to
- which, for outbound rules). Can be specified as an IP address, a CIDR block, or
- a
- security group within the VPC.
- If unspecified, a CIDR block of `0.0.0.0/0` will be used to allow traffic from
- any source
- (or to any destination, for outbound rules).
- :attr int type: (optional) The ICMP traffic type to allow.
- If unspecified, all types are allowed.
+ Create a replica file share for an existing file share. The values for
+ `initial_owner`,
+ `access_control_mode`, `encryption_key` and `size` will be inherited from
+ `source_share`.
+
+ :param int iops: (optional) The maximum input/output operations per second
+ (IOPS) for the file share. The share must be in the `defined_performance`
+ profile family, and the value must be in the range supported by the share's
+ specified size.
+ In addition, each client accessing the share will be restricted to 48,000 IOPS.
+ :param List[ShareMountTargetPrototype] mount_targets: (optional) The mount
+ targets for the file share. Each mount target must be in a unique VPC.
+ :param str name: (optional) The name for this share. The name must not be used
+ by another share in the region. If unspecified, the name will be a hyphenated
+ list of randomly-selected words.
+ :param ShareProfileIdentity profile: The
+ [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-profiles) to use
+ for this file share. The profile must support the share's specified IOPS and
+ size.
+ :param SharePrototypeShareContext replica_share: (optional)
+ :param List[str] user_tags: (optional) Tags for this resource.
+ :param ZoneIdentity zone: The zone this file share will reside in.
+ For a replica share, this must be a different zone in the same region as the
+ source share.
+ :param EncryptionKeyIdentity encryption_key: (optional) The root key to use to
+ wrap the data encryption key for the share.
+ This property must be specified if the `source_share` is in a different region
+ and has
+ an `encryption` type of `user_managed`, and must not be specified otherwise (its
+ value
+ will be inherited from `source_share`).
+ :param str replication_cron_spec: The cron specification for the file share
+ replication schedule.
+ Replication of a share can be scheduled to occur at most once per hour.
+ :param ResourceGroupIdentity resource_group: (optional) The resource group to
+ use. If unspecified, the resource group from
+ the source share will be used.
+ :param ShareIdentity source_share: The source file share for this replica file
+ share. The specified file share must not
+ already have a replica, and must not be a replica. If source file share is
+ specified
+ by CRN, it may be in an [associated partner
+ region](https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-replication).
"""
def __init__(
self,
- direction: str,
- protocol: str,
+ profile: 'ShareProfileIdentity',
+ zone: 'ZoneIdentity',
+ replication_cron_spec: str,
+ source_share: 'ShareIdentity',
*,
- code: int = None,
- ip_version: str = None,
- remote: 'SecurityGroupRuleRemotePrototype' = None,
- type: int = None,
+ iops: Optional[int] = None,
+ mount_targets: Optional[List['ShareMountTargetPrototype']] = None,
+ name: Optional[str] = None,
+ replica_share: Optional['SharePrototypeShareContext'] = None,
+ user_tags: Optional[List[str]] = None,
+ encryption_key: Optional['EncryptionKeyIdentity'] = None,
+ resource_group: Optional['ResourceGroupIdentity'] = None,
) -> None:
"""
- Initialize a SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP object.
+ Initialize a SharePrototypeShareBySourceShare object.
- :param str direction: The direction of traffic to enforce.
- :param str protocol: The protocol to enforce.
- :param int code: (optional) The ICMP traffic code to allow.
- If specified, `type` must also be specified. If unspecified, all codes are
- allowed.
- :param str ip_version: (optional) The IP version to enforce. The format of
- `remote.address` or `remote.cidr_block` must match this property, if they
- are used. Alternatively, if `remote` references a security group, then this
- rule only applies to IP addresses (network interfaces) in that group
- matching this IP version.
- :param SecurityGroupRuleRemotePrototype remote: (optional) The remote IP
- addresses or security groups from which this rule will allow traffic (or to
- which, for outbound rules). Can be specified as an IP address, a CIDR
- block, or a
- security group within the VPC.
- If unspecified, a CIDR block of `0.0.0.0/0` will be used to allow traffic
- from any source
- (or to any destination, for outbound rules).
- :param int type: (optional) The ICMP traffic type to allow.
- If unspecified, all types are allowed.
+ :param ShareProfileIdentity profile: The
+ [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-profiles)
+ to use for this file share. The profile must support the share's specified
+ IOPS and size.
+ :param ZoneIdentity zone: The zone this file share will reside in.
+ For a replica share, this must be a different zone in the same region as
+ the source share.
+ :param str replication_cron_spec: The cron specification for the file share
+ replication schedule.
+ Replication of a share can be scheduled to occur at most once per hour.
+ :param ShareIdentity source_share: The source file share for this replica
+ file share. The specified file share must not
+ already have a replica, and must not be a replica. If source file share is
+ specified
+ by CRN, it may be in an [associated partner
+ region](https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-replication).
+ :param int iops: (optional) The maximum input/output operations per second
+ (IOPS) for the file share. The share must be in the `defined_performance`
+ profile family, and the value must be in the range supported by the share's
+ specified size.
+ In addition, each client accessing the share will be restricted to 48,000
+ IOPS.
+ :param List[ShareMountTargetPrototype] mount_targets: (optional) The mount
+ targets for the file share. Each mount target must be in a unique VPC.
+ :param str name: (optional) The name for this share. The name must not be
+ used by another share in the region. If unspecified, the name will be a
+ hyphenated list of randomly-selected words.
+ :param SharePrototypeShareContext replica_share: (optional)
+ :param List[str] user_tags: (optional) Tags for this resource.
+ :param EncryptionKeyIdentity encryption_key: (optional) The root key to use
+ to wrap the data encryption key for the share.
+ This property must be specified if the `source_share` is in a different
+ region and has
+ an `encryption` type of `user_managed`, and must not be specified otherwise
+ (its value
+ will be inherited from `source_share`).
+ :param ResourceGroupIdentity resource_group: (optional) The resource group
+ to use. If unspecified, the resource group from
+ the source share will be used.
"""
# pylint: disable=super-init-not-called
- self.code = code
- self.direction = direction
- self.ip_version = ip_version
- self.protocol = protocol
- self.remote = remote
- self.type = type
+ self.iops = iops
+ self.mount_targets = mount_targets
+ self.name = name
+ self.profile = profile
+ self.replica_share = replica_share
+ self.user_tags = user_tags
+ self.zone = zone
+ self.encryption_key = encryption_key
+ self.replication_cron_spec = replication_cron_spec
+ self.resource_group = resource_group
+ self.source_share = source_share
@classmethod
- def from_dict(cls, _dict: Dict) -> 'SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP':
- """Initialize a SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'SharePrototypeShareBySourceShare':
+ """Initialize a SharePrototypeShareBySourceShare 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 (iops := _dict.get('iops')) is not None:
+ args['iops'] = iops
+ if (mount_targets := _dict.get('mount_targets')) is not None:
+ args['mount_targets'] = mount_targets
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ if (profile := _dict.get('profile')) is not None:
+ args['profile'] = profile
else:
- raise ValueError('Required property \'direction\' not present in SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP JSON')
- if 'ip_version' in _dict:
- args['ip_version'] = _dict.get('ip_version')
- if 'protocol' in _dict:
- args['protocol'] = _dict.get('protocol')
+ raise ValueError('Required property \'profile\' not present in SharePrototypeShareBySourceShare JSON')
+ if (replica_share := _dict.get('replica_share')) is not None:
+ args['replica_share'] = SharePrototypeShareContext.from_dict(replica_share)
+ if (user_tags := _dict.get('user_tags')) is not None:
+ args['user_tags'] = user_tags
+ if (zone := _dict.get('zone')) is not None:
+ args['zone'] = zone
else:
- raise ValueError('Required property \'protocol\' not present in SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP JSON')
- if 'remote' in _dict:
- args['remote'] = _dict.get('remote')
- if 'type' in _dict:
- args['type'] = _dict.get('type')
+ raise ValueError('Required property \'zone\' not present in SharePrototypeShareBySourceShare JSON')
+ if (encryption_key := _dict.get('encryption_key')) is not None:
+ args['encryption_key'] = encryption_key
+ if (replication_cron_spec := _dict.get('replication_cron_spec')) is not None:
+ args['replication_cron_spec'] = replication_cron_spec
+ else:
+ raise ValueError('Required property \'replication_cron_spec\' not present in SharePrototypeShareBySourceShare JSON')
+ if (resource_group := _dict.get('resource_group')) is not None:
+ args['resource_group'] = resource_group
+ if (source_share := _dict.get('source_share')) is not None:
+ args['source_share'] = source_share
+ else:
+ raise ValueError('Required property \'source_share\' not present in SharePrototypeShareBySourceShare JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP object from a json dictionary."""
+ """Initialize a SharePrototypeShareBySourceShare object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'code') and self.code is not None:
- _dict['code'] = self.code
- if hasattr(self, 'direction') and self.direction is not None:
- _dict['direction'] = self.direction
- if hasattr(self, 'ip_version') and self.ip_version is not None:
- _dict['ip_version'] = self.ip_version
- if hasattr(self, 'protocol') and self.protocol is not None:
- _dict['protocol'] = self.protocol
- if hasattr(self, 'remote') and self.remote is not None:
- if isinstance(self.remote, dict):
- _dict['remote'] = self.remote
+ if hasattr(self, 'iops') and self.iops is not None:
+ _dict['iops'] = self.iops
+ if hasattr(self, 'mount_targets') and self.mount_targets is not None:
+ mount_targets_list = []
+ for v in self.mount_targets:
+ if isinstance(v, dict):
+ mount_targets_list.append(v)
+ else:
+ mount_targets_list.append(v.to_dict())
+ _dict['mount_targets'] = mount_targets_list
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ if hasattr(self, 'profile') and self.profile is not None:
+ if isinstance(self.profile, dict):
+ _dict['profile'] = self.profile
else:
- _dict['remote'] = self.remote.to_dict()
- if hasattr(self, 'type') and self.type is not None:
- _dict['type'] = self.type
+ _dict['profile'] = self.profile.to_dict()
+ if hasattr(self, 'replica_share') and self.replica_share is not None:
+ if isinstance(self.replica_share, dict):
+ _dict['replica_share'] = self.replica_share
+ else:
+ _dict['replica_share'] = self.replica_share.to_dict()
+ if hasattr(self, 'user_tags') and self.user_tags is not None:
+ _dict['user_tags'] = self.user_tags
+ if hasattr(self, 'zone') and self.zone is not None:
+ if isinstance(self.zone, dict):
+ _dict['zone'] = self.zone
+ else:
+ _dict['zone'] = self.zone.to_dict()
+ if hasattr(self, '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, 'replication_cron_spec') and self.replication_cron_spec is not None:
+ _dict['replication_cron_spec'] = self.replication_cron_spec
+ if hasattr(self, 'resource_group') and self.resource_group is not None:
+ if isinstance(self.resource_group, dict):
+ _dict['resource_group'] = self.resource_group
+ else:
+ _dict['resource_group'] = self.resource_group.to_dict()
+ if hasattr(self, 'source_share') and self.source_share is not None:
+ if isinstance(self.source_share, dict):
+ _dict['source_share'] = self.source_share
+ else:
+ _dict['source_share'] = self.source_share.to_dict()
return _dict
def _to_dict(self):
@@ -113245,175 +129448,107 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP object."""
+ """Return a `str` version of this SharePrototypeShareBySourceShare object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP') -> bool:
+ def __eq__(self, other: 'SharePrototypeShareBySourceShare') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
- if not isinstance(other, self.__class__):
- return False
- return self.__dict__ == other.__dict__
-
- def __ne__(self, other: 'SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP') -> bool:
- """Return `true` when self and other are not equal, false otherwise."""
- return not self == other
-
- class DirectionEnum(str, Enum):
- """
- The direction of traffic to enforce.
- """
-
- INBOUND = 'inbound'
- OUTBOUND = 'outbound'
-
-
- class IpVersionEnum(str, Enum):
- """
- The IP version to enforce. The format of `remote.address` or `remote.cidr_block`
- must match this property, if they are used. Alternatively, if `remote` references
- a security group, then this rule only applies to IP addresses (network interfaces)
- in that group matching this IP version.
- """
-
- IPV4 = 'ipv4'
-
-
- class ProtocolEnum(str, Enum):
- """
- The protocol to enforce.
- """
-
- ICMP = 'icmp'
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+ def __ne__(self, other: 'SharePrototypeShareBySourceShare') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
-class SecurityGroupRulePrototypeSecurityGroupRuleProtocolTCPUDP(SecurityGroupRulePrototype):
+class SnapshotConsistencyGroupPrototypeSnapshotConsistencyGroupBySnapshots(SnapshotConsistencyGroupPrototype):
"""
- A rule specifying the TCP or UDP traffic to allow.
- Either both `port_min` and `port_max` will be present, or neither. When neither is
- present, all destination ports are allowed for the protocol. When both have the same
- value, that single destination port is allowed.
+ SnapshotConsistencyGroupPrototypeSnapshotConsistencyGroupBySnapshots.
- :attr str direction: The direction of traffic to enforce.
- :attr str ip_version: (optional) The IP version to enforce. The format of
- `remote.address` or `remote.cidr_block` must match this property, if they are
- used. Alternatively, if `remote` references a security group, then this rule
- only applies to IP addresses (network interfaces) in that group matching this IP
- version.
- :attr int port_max: (optional) The inclusive upper bound of TCP/UDP destination
- port range.
- If specified, `port_min` must also be specified, and must not be larger. If
- unspecified,
- `port_min` must also be unspecified, allowing traffic on all destination ports.
- :attr int port_min: (optional) The inclusive lower bound of TCP/UDP destination
- port range
- If specified, `port_max` must also be specified, and must not be smaller. If
- unspecified, `port_max` must also be unspecified, allowing traffic on all
- destination ports.
- :attr str protocol: The protocol to enforce.
- :attr SecurityGroupRuleRemotePrototype remote: (optional) The remote IP
- addresses or security groups from which this rule will allow traffic (or to
- which, for outbound rules). Can be specified as an IP address, a CIDR block, or
- a
- security group within the VPC.
- If unspecified, a CIDR block of `0.0.0.0/0` will be used to allow traffic from
- any source
- (or to any destination, for outbound rules).
+ :param bool delete_snapshots_on_delete: (optional) Indicates whether deleting
+ the snapshot consistency group will also delete the snapshots in the group.
+ :param str name: (optional) The name for this snapshot consistency group. The
+ name must be unique across all snapshot consistency groups in the region.
+ If unspecified, the name will be a hyphenated list of randomly-selected words.
+ :param ResourceGroupIdentity resource_group: (optional)
+ :param List[SnapshotPrototypeSnapshotConsistencyGroupContext] snapshots: The
+ data-consistent member snapshots to create. All snapshots must specify a
+ `source_volume` attached to the same virtual server instance.
"""
def __init__(
self,
- direction: str,
- protocol: str,
+ snapshots: List['SnapshotPrototypeSnapshotConsistencyGroupContext'],
*,
- ip_version: str = None,
- port_max: int = None,
- port_min: int = None,
- remote: 'SecurityGroupRuleRemotePrototype' = None,
+ delete_snapshots_on_delete: Optional[bool] = None,
+ name: Optional[str] = None,
+ resource_group: Optional['ResourceGroupIdentity'] = None,
) -> None:
"""
- Initialize a SecurityGroupRulePrototypeSecurityGroupRuleProtocolTCPUDP object.
+ Initialize a SnapshotConsistencyGroupPrototypeSnapshotConsistencyGroupBySnapshots object.
- :param str direction: The direction of traffic to enforce.
- :param str protocol: The protocol to enforce.
- :param str ip_version: (optional) The IP version to enforce. The format of
- `remote.address` or `remote.cidr_block` must match this property, if they
- are used. Alternatively, if `remote` references a security group, then this
- rule only applies to IP addresses (network interfaces) in that group
- matching this IP version.
- :param int port_max: (optional) The inclusive upper bound of TCP/UDP
- destination port range.
- If specified, `port_min` must also be specified, and must not be larger. If
- unspecified,
- `port_min` must also be unspecified, allowing traffic on all destination
- ports.
- :param int port_min: (optional) The inclusive lower bound of TCP/UDP
- destination port range
- If specified, `port_max` must also be specified, and must not be smaller.
- If unspecified, `port_max` must also be unspecified, allowing traffic on
- all destination ports.
- :param SecurityGroupRuleRemotePrototype remote: (optional) The remote IP
- addresses or security groups from which this rule will allow traffic (or to
- which, for outbound rules). Can be specified as an IP address, a CIDR
- block, or a
- security group within the VPC.
- If unspecified, a CIDR block of `0.0.0.0/0` will be used to allow traffic
- from any source
- (or to any destination, for outbound rules).
+ :param List[SnapshotPrototypeSnapshotConsistencyGroupContext] snapshots:
+ The data-consistent member snapshots to create. All snapshots must specify
+ a
+ `source_volume` attached to the same virtual server instance.
+ :param bool delete_snapshots_on_delete: (optional) Indicates whether
+ deleting the snapshot consistency group will also delete the snapshots in
+ the group.
+ :param str name: (optional) The name for this snapshot consistency group.
+ The name must be unique across all snapshot consistency groups in the
+ region.
+ If unspecified, the name will be a hyphenated list of randomly-selected
+ words.
+ :param ResourceGroupIdentity resource_group: (optional)
"""
# pylint: disable=super-init-not-called
- self.direction = direction
- self.ip_version = ip_version
- self.port_max = port_max
- self.port_min = port_min
- self.protocol = protocol
- self.remote = remote
+ self.delete_snapshots_on_delete = delete_snapshots_on_delete
+ self.name = name
+ self.resource_group = resource_group
+ self.snapshots = snapshots
@classmethod
- def from_dict(cls, _dict: Dict) -> 'SecurityGroupRulePrototypeSecurityGroupRuleProtocolTCPUDP':
- """Initialize a SecurityGroupRulePrototypeSecurityGroupRuleProtocolTCPUDP object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'SnapshotConsistencyGroupPrototypeSnapshotConsistencyGroupBySnapshots':
+ """Initialize a SnapshotConsistencyGroupPrototypeSnapshotConsistencyGroupBySnapshots object from a json dictionary."""
args = {}
- if 'direction' in _dict:
- args['direction'] = _dict.get('direction')
- else:
- raise ValueError('Required property \'direction\' not present in SecurityGroupRulePrototypeSecurityGroupRuleProtocolTCPUDP JSON')
- if 'ip_version' in _dict:
- args['ip_version'] = _dict.get('ip_version')
- if 'port_max' in _dict:
- args['port_max'] = _dict.get('port_max')
- if 'port_min' in _dict:
- args['port_min'] = _dict.get('port_min')
- if 'protocol' in _dict:
- args['protocol'] = _dict.get('protocol')
+ if (delete_snapshots_on_delete := _dict.get('delete_snapshots_on_delete')) is not None:
+ args['delete_snapshots_on_delete'] = delete_snapshots_on_delete
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ if (resource_group := _dict.get('resource_group')) is not None:
+ args['resource_group'] = resource_group
+ if (snapshots := _dict.get('snapshots')) is not None:
+ args['snapshots'] = [SnapshotPrototypeSnapshotConsistencyGroupContext.from_dict(v) for v in snapshots]
else:
- raise ValueError('Required property \'protocol\' not present in SecurityGroupRulePrototypeSecurityGroupRuleProtocolTCPUDP JSON')
- if 'remote' in _dict:
- args['remote'] = _dict.get('remote')
+ raise ValueError('Required property \'snapshots\' not present in SnapshotConsistencyGroupPrototypeSnapshotConsistencyGroupBySnapshots JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a SecurityGroupRulePrototypeSecurityGroupRuleProtocolTCPUDP object from a json dictionary."""
+ """Initialize a SnapshotConsistencyGroupPrototypeSnapshotConsistencyGroupBySnapshots object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'direction') and self.direction is not None:
- _dict['direction'] = self.direction
- if hasattr(self, 'ip_version') and self.ip_version is not None:
- _dict['ip_version'] = self.ip_version
- if hasattr(self, 'port_max') and self.port_max is not None:
- _dict['port_max'] = self.port_max
- if hasattr(self, 'port_min') and self.port_min is not None:
- _dict['port_min'] = self.port_min
- if hasattr(self, 'protocol') and self.protocol is not None:
- _dict['protocol'] = self.protocol
- if hasattr(self, 'remote') and self.remote is not None:
- if isinstance(self.remote, dict):
- _dict['remote'] = self.remote
+ if hasattr(self, 'delete_snapshots_on_delete') and self.delete_snapshots_on_delete is not None:
+ _dict['delete_snapshots_on_delete'] = self.delete_snapshots_on_delete
+ 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['remote'] = self.remote.to_dict()
+ _dict['resource_group'] = self.resource_group.to_dict()
+ if hasattr(self, 'snapshots') and self.snapshots is not None:
+ snapshots_list = []
+ for v in self.snapshots:
+ if isinstance(v, dict):
+ snapshots_list.append(v)
+ else:
+ snapshots_list.append(v.to_dict())
+ _dict['snapshots'] = snapshots_list
return _dict
def _to_dict(self):
@@ -113421,96 +129556,59 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this SecurityGroupRulePrototypeSecurityGroupRuleProtocolTCPUDP object."""
+ """Return a `str` version of this SnapshotConsistencyGroupPrototypeSnapshotConsistencyGroupBySnapshots object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'SecurityGroupRulePrototypeSecurityGroupRuleProtocolTCPUDP') -> bool:
+ def __eq__(self, other: 'SnapshotConsistencyGroupPrototypeSnapshotConsistencyGroupBySnapshots') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'SecurityGroupRulePrototypeSecurityGroupRuleProtocolTCPUDP') -> bool:
+ def __ne__(self, other: 'SnapshotConsistencyGroupPrototypeSnapshotConsistencyGroupBySnapshots') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class DirectionEnum(str, Enum):
- """
- The direction of traffic to enforce.
- """
-
- INBOUND = 'inbound'
- OUTBOUND = 'outbound'
-
-
- class IpVersionEnum(str, Enum):
- """
- The IP version to enforce. The format of `remote.address` or `remote.cidr_block`
- must match this property, if they are used. Alternatively, if `remote` references
- a security group, then this rule only applies to IP addresses (network interfaces)
- in that group matching this IP version.
- """
-
- IPV4 = 'ipv4'
-
- class ProtocolEnum(str, Enum):
- """
- The protocol to enforce.
- """
-
- TCP = 'tcp'
- UDP = 'udp'
-
-
-
-class SecurityGroupRuleRemotePatchCIDR(SecurityGroupRuleRemotePatch):
+class SnapshotIdentityByCRN(SnapshotIdentity):
"""
- SecurityGroupRuleRemotePatchCIDR.
+ SnapshotIdentityByCRN.
- :attr str cidr_block: The CIDR block. This property may add support for IPv6
- CIDR blocks in the future. When processing a value in this property, verify that
- the CIDR block is in an expected format. If it is not, log an error. Optionally
- halt processing and surface the error, or bypass the resource on which the
- unexpected CIDR block format was encountered.
+ :param str crn: The CRN of this snapshot.
"""
def __init__(
self,
- cidr_block: str,
+ crn: str,
) -> None:
"""
- Initialize a SecurityGroupRuleRemotePatchCIDR object.
+ Initialize a SnapshotIdentityByCRN object.
- :param str cidr_block: The CIDR block. This property may add support for
- IPv6 CIDR blocks in the future. When processing a value in this property,
- verify that the CIDR block is in an expected format. If it is not, log an
- error. Optionally halt processing and surface the error, or bypass the
- resource on which the unexpected CIDR block format was encountered.
+ :param str crn: The CRN of this snapshot.
"""
# pylint: disable=super-init-not-called
- self.cidr_block = cidr_block
+ self.crn = crn
@classmethod
- def from_dict(cls, _dict: Dict) -> 'SecurityGroupRuleRemotePatchCIDR':
- """Initialize a SecurityGroupRuleRemotePatchCIDR object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'SnapshotIdentityByCRN':
+ """Initialize a SnapshotIdentityByCRN object from a json dictionary."""
args = {}
- if 'cidr_block' in _dict:
- args['cidr_block'] = _dict.get('cidr_block')
+ if (crn := _dict.get('crn')) is not None:
+ args['crn'] = crn
else:
- raise ValueError('Required property \'cidr_block\' not present in SecurityGroupRuleRemotePatchCIDR JSON')
+ raise ValueError('Required property \'crn\' not present in SnapshotIdentityByCRN JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a SecurityGroupRuleRemotePatchCIDR object from a json dictionary."""
+ """Initialize a SnapshotIdentityByCRN object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'cidr_block') and self.cidr_block is not None:
- _dict['cidr_block'] = self.cidr_block
+ if hasattr(self, 'crn') and self.crn is not None:
+ _dict['crn'] = self.crn
return _dict
def _to_dict(self):
@@ -113518,68 +129616,59 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this SecurityGroupRuleRemotePatchCIDR object."""
+ """Return a `str` version of this SnapshotIdentityByCRN object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'SecurityGroupRuleRemotePatchCIDR') -> bool:
+ def __eq__(self, other: 'SnapshotIdentityByCRN') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'SecurityGroupRuleRemotePatchCIDR') -> bool:
+ def __ne__(self, other: 'SnapshotIdentityByCRN') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class SecurityGroupRuleRemotePatchIP(SecurityGroupRuleRemotePatch):
+class SnapshotIdentityByHref(SnapshotIdentity):
"""
- SecurityGroupRuleRemotePatchIP.
+ SnapshotIdentityByHref.
- :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.
+ :param str href: The URL for this snapshot.
"""
def __init__(
self,
- address: str,
+ href: str,
) -> None:
"""
- Initialize a SecurityGroupRuleRemotePatchIP object.
+ Initialize a SnapshotIdentityByHref object.
- :param str address: The IP address.
- This property may add support for IPv6 addresses in the future. When
- processing a value in this property, verify that the address is in an
- expected format. If it is not, log an error. Optionally halt processing and
- surface the error, or bypass the resource on which the unexpected IP
- address format was encountered.
+ :param str href: The URL for this snapshot.
"""
# pylint: disable=super-init-not-called
- self.address = address
+ self.href = href
@classmethod
- def from_dict(cls, _dict: Dict) -> 'SecurityGroupRuleRemotePatchIP':
- """Initialize a SecurityGroupRuleRemotePatchIP object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'SnapshotIdentityByHref':
+ """Initialize a SnapshotIdentityByHref object from a json dictionary."""
args = {}
- if 'address' in _dict:
- args['address'] = _dict.get('address')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'address\' not present in SecurityGroupRuleRemotePatchIP JSON')
+ raise ValueError('Required property \'href\' not present in SnapshotIdentityByHref JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a SecurityGroupRuleRemotePatchIP object from a json dictionary."""
+ """Initialize a SnapshotIdentityByHref object from 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, 'href') and self.href is not None:
+ _dict['href'] = self.href
return _dict
def _to_dict(self):
@@ -113587,87 +129676,59 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this SecurityGroupRuleRemotePatchIP object."""
+ """Return a `str` version of this SnapshotIdentityByHref object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'SecurityGroupRuleRemotePatchIP') -> bool:
+ def __eq__(self, other: 'SnapshotIdentityByHref') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'SecurityGroupRuleRemotePatchIP') -> bool:
+ def __ne__(self, other: 'SnapshotIdentityByHref') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class SecurityGroupRuleRemotePatchSecurityGroupIdentity(SecurityGroupRuleRemotePatch):
- """
- Identifies a security group by a unique property.
-
- """
-
- def __init__(
- self,
- ) -> None:
- """
- Initialize a SecurityGroupRuleRemotePatchSecurityGroupIdentity object.
-
- """
- # pylint: disable=super-init-not-called
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['SecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityById', 'SecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityByCRN', 'SecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityByHref'])
- )
- raise Exception(msg)
-
-
-class SecurityGroupRuleRemotePrototypeCIDR(SecurityGroupRuleRemotePrototype):
+class SnapshotIdentityById(SnapshotIdentity):
"""
- SecurityGroupRuleRemotePrototypeCIDR.
+ SnapshotIdentityById.
- :attr str cidr_block: The CIDR block. This property may add support for IPv6
- CIDR blocks in the future. When processing a value in this property, verify that
- the CIDR block is in an expected format. If it is not, log an error. Optionally
- halt processing and surface the error, or bypass the resource on which the
- unexpected CIDR block format was encountered.
+ :param str id: The unique identifier for this snapshot.
"""
def __init__(
self,
- cidr_block: str,
+ id: str,
) -> None:
"""
- Initialize a SecurityGroupRuleRemotePrototypeCIDR object.
+ Initialize a SnapshotIdentityById object.
- :param str cidr_block: The CIDR block. This property may add support for
- IPv6 CIDR blocks in the future. When processing a value in this property,
- verify that the CIDR block is in an expected format. If it is not, log an
- error. Optionally halt processing and surface the error, or bypass the
- resource on which the unexpected CIDR block format was encountered.
+ :param str id: The unique identifier for this snapshot.
"""
# pylint: disable=super-init-not-called
- self.cidr_block = cidr_block
+ self.id = id
@classmethod
- def from_dict(cls, _dict: Dict) -> 'SecurityGroupRuleRemotePrototypeCIDR':
- """Initialize a SecurityGroupRuleRemotePrototypeCIDR object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'SnapshotIdentityById':
+ """Initialize a SnapshotIdentityById object from a json dictionary."""
args = {}
- if 'cidr_block' in _dict:
- args['cidr_block'] = _dict.get('cidr_block')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
else:
- raise ValueError('Required property \'cidr_block\' not present in SecurityGroupRuleRemotePrototypeCIDR JSON')
+ raise ValueError('Required property \'id\' not present in SnapshotIdentityById JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a SecurityGroupRuleRemotePrototypeCIDR object from a json dictionary."""
+ """Initialize a SnapshotIdentityById object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'cidr_block') and self.cidr_block is not None:
- _dict['cidr_block'] = self.cidr_block
+ if hasattr(self, 'id') and self.id is not None:
+ _dict['id'] = self.id
return _dict
def _to_dict(self):
@@ -113675,68 +129736,151 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this SecurityGroupRuleRemotePrototypeCIDR object."""
+ """Return a `str` version of this SnapshotIdentityById object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'SecurityGroupRuleRemotePrototypeCIDR') -> bool:
+ def __eq__(self, other: 'SnapshotIdentityById') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'SecurityGroupRuleRemotePrototypeCIDR') -> bool:
+ def __ne__(self, other: 'SnapshotIdentityById') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class SecurityGroupRuleRemotePrototypeIP(SecurityGroupRuleRemotePrototype):
+class SnapshotPrototypeSnapshotBySourceSnapshot(SnapshotPrototype):
"""
- SecurityGroupRuleRemotePrototypeIP.
+ SnapshotPrototypeSnapshotBySourceSnapshot.
- :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.
+ :param List[SnapshotClonePrototype] clones: (optional) Clones to create for this
+ snapshot.
+ :param str name: (optional) The name for this snapshot. The name must not be
+ used by another snapshot in the region. If unspecified, the name will be a
+ hyphenated list of randomly-selected words.
+ :param ResourceGroupIdentity resource_group: (optional)
+ :param List[str] user_tags: (optional) The [user
+ tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with this
+ snapshot.
+ :param EncryptionKeyIdentity encryption_key: (optional) The root key to use to
+ wrap the data encryption key for this snapshot.
+ A key must be specified if and only if the source snapshot has an `encryption`
+ type of
+ `user_managed`. To maximize snapshot availability and sharing of snapshot data,
+ specify
+ a key in the same region as the new snapshot, and use the same encryption key
+ for all
+ snapshots using the same source volume.
+ The specified key may be in a different account, subject to IAM policies.
+ :param SnapshotIdentityByCRN source_snapshot: The source snapshot (in another
+ region) to create this snapshot from.
+ The specified snapshot must not already be the source of another snapshot in
+ this
+ region.
"""
def __init__(
self,
- address: str,
+ source_snapshot: 'SnapshotIdentityByCRN',
+ *,
+ clones: Optional[List['SnapshotClonePrototype']] = None,
+ name: Optional[str] = None,
+ resource_group: Optional['ResourceGroupIdentity'] = None,
+ user_tags: Optional[List[str]] = None,
+ encryption_key: Optional['EncryptionKeyIdentity'] = None,
) -> None:
"""
- Initialize a SecurityGroupRuleRemotePrototypeIP object.
+ Initialize a SnapshotPrototypeSnapshotBySourceSnapshot 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 SnapshotIdentityByCRN source_snapshot: The source snapshot (in
+ another region) to create this snapshot from.
+ The specified snapshot must not already be the source of another snapshot
+ in this
+ region.
+ :param List[SnapshotClonePrototype] clones: (optional) Clones to create for
+ this snapshot.
+ :param str name: (optional) The name for this snapshot. The name must not
+ be used by another snapshot in the region. If unspecified, the name will be
+ a hyphenated list of randomly-selected words.
+ :param ResourceGroupIdentity resource_group: (optional)
+ :param List[str] user_tags: (optional) The [user
+ tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with
+ this snapshot.
+ :param EncryptionKeyIdentity encryption_key: (optional) The root key to use
+ to wrap the data encryption key for this snapshot.
+ A key must be specified if and only if the source snapshot has an
+ `encryption` type of
+ `user_managed`. To maximize snapshot availability and sharing of snapshot
+ data, specify
+ a key in the same region as the new snapshot, and use the same encryption
+ key for all
+ snapshots using the same source volume.
+ The specified key may be in a different account, subject to IAM policies.
"""
# pylint: disable=super-init-not-called
- self.address = address
+ self.clones = clones
+ self.name = name
+ self.resource_group = resource_group
+ self.user_tags = user_tags
+ self.encryption_key = encryption_key
+ self.source_snapshot = source_snapshot
@classmethod
- def from_dict(cls, _dict: Dict) -> 'SecurityGroupRuleRemotePrototypeIP':
- """Initialize a SecurityGroupRuleRemotePrototypeIP object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'SnapshotPrototypeSnapshotBySourceSnapshot':
+ """Initialize a SnapshotPrototypeSnapshotBySourceSnapshot object from a json dictionary."""
args = {}
- if 'address' in _dict:
- args['address'] = _dict.get('address')
+ if (clones := _dict.get('clones')) is not None:
+ args['clones'] = [SnapshotClonePrototype.from_dict(v) for v in clones]
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ if (resource_group := _dict.get('resource_group')) is not None:
+ args['resource_group'] = resource_group
+ if (user_tags := _dict.get('user_tags')) is not None:
+ args['user_tags'] = user_tags
+ if (encryption_key := _dict.get('encryption_key')) is not None:
+ args['encryption_key'] = encryption_key
+ if (source_snapshot := _dict.get('source_snapshot')) is not None:
+ args['source_snapshot'] = SnapshotIdentityByCRN.from_dict(source_snapshot)
else:
- raise ValueError('Required property \'address\' not present in SecurityGroupRuleRemotePrototypeIP JSON')
+ raise ValueError('Required property \'source_snapshot\' not present in SnapshotPrototypeSnapshotBySourceSnapshot JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a SecurityGroupRuleRemotePrototypeIP object from a json dictionary."""
+ """Initialize a SnapshotPrototypeSnapshotBySourceSnapshot object from 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, 'clones') and self.clones is not None:
+ clones_list = []
+ for v in self.clones:
+ if isinstance(v, dict):
+ clones_list.append(v)
+ else:
+ clones_list.append(v.to_dict())
+ _dict['clones'] = clones_list
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ if hasattr(self, 'resource_group') and self.resource_group is not None:
+ if isinstance(self.resource_group, dict):
+ _dict['resource_group'] = self.resource_group
+ else:
+ _dict['resource_group'] = self.resource_group.to_dict()
+ if hasattr(self, 'user_tags') and self.user_tags is not None:
+ _dict['user_tags'] = self.user_tags
+ if hasattr(self, 'encryption_key') and self.encryption_key is not None:
+ if isinstance(self.encryption_key, dict):
+ _dict['encryption_key'] = self.encryption_key
+ else:
+ _dict['encryption_key'] = self.encryption_key.to_dict()
+ if hasattr(self, 'source_snapshot') and self.source_snapshot is not None:
+ if isinstance(self.source_snapshot, dict):
+ _dict['source_snapshot'] = self.source_snapshot
+ else:
+ _dict['source_snapshot'] = self.source_snapshot.to_dict()
return _dict
def _to_dict(self):
@@ -113744,87 +129888,115 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this SecurityGroupRuleRemotePrototypeIP object."""
+ """Return a `str` version of this SnapshotPrototypeSnapshotBySourceSnapshot object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'SecurityGroupRuleRemotePrototypeIP') -> bool:
+ def __eq__(self, other: 'SnapshotPrototypeSnapshotBySourceSnapshot') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'SecurityGroupRuleRemotePrototypeIP') -> bool:
+ def __ne__(self, other: 'SnapshotPrototypeSnapshotBySourceSnapshot') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class SecurityGroupRuleRemotePrototypeSecurityGroupIdentity(SecurityGroupRuleRemotePrototype):
- """
- Identifies a security group by a unique property.
-
- """
-
- def __init__(
- self,
- ) -> None:
- """
- Initialize a SecurityGroupRuleRemotePrototypeSecurityGroupIdentity object.
-
- """
- # pylint: disable=super-init-not-called
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['SecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityById', 'SecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityByCRN', 'SecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityByHref'])
- )
- raise Exception(msg)
-
-
-class SecurityGroupRuleRemoteCIDR(SecurityGroupRuleRemote):
+class SnapshotPrototypeSnapshotBySourceVolume(SnapshotPrototype):
"""
- SecurityGroupRuleRemoteCIDR.
+ SnapshotPrototypeSnapshotBySourceVolume.
- :attr str cidr_block: The CIDR block. This property may add support for IPv6
- CIDR blocks in the future. When processing a value in this property, verify that
- the CIDR block is in an expected format. If it is not, log an error. Optionally
- halt processing and surface the error, or bypass the resource on which the
- unexpected CIDR block format was encountered.
+ :param List[SnapshotClonePrototype] clones: (optional) Clones to create for this
+ snapshot.
+ :param str name: (optional) The name for this snapshot. The name must not be
+ used by another snapshot in the region. If unspecified, the name will be a
+ hyphenated list of randomly-selected words.
+ :param ResourceGroupIdentity resource_group: (optional)
+ :param List[str] user_tags: (optional) The [user
+ tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with this
+ snapshot.
+ :param VolumeIdentity source_volume: The volume to create this snapshot from.
"""
def __init__(
self,
- cidr_block: str,
+ source_volume: 'VolumeIdentity',
+ *,
+ clones: Optional[List['SnapshotClonePrototype']] = None,
+ name: Optional[str] = None,
+ resource_group: Optional['ResourceGroupIdentity'] = None,
+ user_tags: Optional[List[str]] = None,
) -> None:
"""
- Initialize a SecurityGroupRuleRemoteCIDR object.
+ Initialize a SnapshotPrototypeSnapshotBySourceVolume object.
- :param str cidr_block: The CIDR block. This property may add support for
- IPv6 CIDR blocks in the future. When processing a value in this property,
- verify that the CIDR block is in an expected format. If it is not, log an
- error. Optionally halt processing and surface the error, or bypass the
- resource on which the unexpected CIDR block format was encountered.
+ :param VolumeIdentity source_volume: The volume to create this snapshot
+ from.
+ :param List[SnapshotClonePrototype] clones: (optional) Clones to create for
+ this snapshot.
+ :param str name: (optional) The name for this snapshot. The name must not
+ be used by another snapshot in the region. If unspecified, the name will be
+ a hyphenated list of randomly-selected words.
+ :param ResourceGroupIdentity resource_group: (optional)
+ :param List[str] user_tags: (optional) The [user
+ tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with
+ this snapshot.
"""
# pylint: disable=super-init-not-called
- self.cidr_block = cidr_block
+ self.clones = clones
+ self.name = name
+ self.resource_group = resource_group
+ self.user_tags = user_tags
+ self.source_volume = source_volume
@classmethod
- def from_dict(cls, _dict: Dict) -> 'SecurityGroupRuleRemoteCIDR':
- """Initialize a SecurityGroupRuleRemoteCIDR object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'SnapshotPrototypeSnapshotBySourceVolume':
+ """Initialize a SnapshotPrototypeSnapshotBySourceVolume object from a json dictionary."""
args = {}
- if 'cidr_block' in _dict:
- args['cidr_block'] = _dict.get('cidr_block')
+ if (clones := _dict.get('clones')) is not None:
+ args['clones'] = [SnapshotClonePrototype.from_dict(v) for v in clones]
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ if (resource_group := _dict.get('resource_group')) is not None:
+ args['resource_group'] = resource_group
+ if (user_tags := _dict.get('user_tags')) is not None:
+ args['user_tags'] = user_tags
+ if (source_volume := _dict.get('source_volume')) is not None:
+ args['source_volume'] = source_volume
else:
- raise ValueError('Required property \'cidr_block\' not present in SecurityGroupRuleRemoteCIDR JSON')
+ raise ValueError('Required property \'source_volume\' not present in SnapshotPrototypeSnapshotBySourceVolume JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a SecurityGroupRuleRemoteCIDR object from a json dictionary."""
+ """Initialize a SnapshotPrototypeSnapshotBySourceVolume object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'cidr_block') and self.cidr_block is not None:
- _dict['cidr_block'] = self.cidr_block
+ if hasattr(self, 'clones') and self.clones is not None:
+ clones_list = []
+ for v in self.clones:
+ if isinstance(v, dict):
+ clones_list.append(v)
+ else:
+ clones_list.append(v.to_dict())
+ _dict['clones'] = clones_list
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ if hasattr(self, 'resource_group') and self.resource_group is not None:
+ if isinstance(self.resource_group, dict):
+ _dict['resource_group'] = self.resource_group
+ else:
+ _dict['resource_group'] = self.resource_group.to_dict()
+ if hasattr(self, 'user_tags') and self.user_tags is not None:
+ _dict['user_tags'] = self.user_tags
+ if hasattr(self, 'source_volume') and self.source_volume is not None:
+ if isinstance(self.source_volume, dict):
+ _dict['source_volume'] = self.source_volume
+ else:
+ _dict['source_volume'] = self.source_volume.to_dict()
return _dict
def _to_dict(self):
@@ -113832,68 +130004,59 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this SecurityGroupRuleRemoteCIDR object."""
+ """Return a `str` version of this SnapshotPrototypeSnapshotBySourceVolume object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'SecurityGroupRuleRemoteCIDR') -> bool:
+ def __eq__(self, other: 'SnapshotPrototypeSnapshotBySourceVolume') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'SecurityGroupRuleRemoteCIDR') -> bool:
+ def __ne__(self, other: 'SnapshotPrototypeSnapshotBySourceVolume') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class SecurityGroupRuleRemoteIP(SecurityGroupRuleRemote):
+class SubnetIdentityByCRN(SubnetIdentity):
"""
- SecurityGroupRuleRemoteIP.
+ SubnetIdentityByCRN.
- :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.
+ :param str crn: The CRN for this subnet.
"""
def __init__(
self,
- address: str,
+ crn: str,
) -> None:
"""
- Initialize a SecurityGroupRuleRemoteIP object.
+ Initialize a SubnetIdentityByCRN object.
- :param str address: The IP address.
- This property may add support for IPv6 addresses in the future. When
- processing a value in this property, verify that the address is in an
- expected format. If it is not, log an error. Optionally halt processing and
- surface the error, or bypass the resource on which the unexpected IP
- address format was encountered.
+ :param str crn: The CRN for this subnet.
"""
# pylint: disable=super-init-not-called
- self.address = address
+ self.crn = crn
@classmethod
- def from_dict(cls, _dict: Dict) -> 'SecurityGroupRuleRemoteIP':
- """Initialize a SecurityGroupRuleRemoteIP object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'SubnetIdentityByCRN':
+ """Initialize a SubnetIdentityByCRN object from a json dictionary."""
args = {}
- if 'address' in _dict:
- args['address'] = _dict.get('address')
+ if (crn := _dict.get('crn')) is not None:
+ args['crn'] = crn
else:
- raise ValueError('Required property \'address\' not present in SecurityGroupRuleRemoteIP JSON')
+ raise ValueError('Required property \'crn\' not present in SubnetIdentityByCRN JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a SecurityGroupRuleRemoteIP object from a json dictionary."""
+ """Initialize a SubnetIdentityByCRN object from 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
+ _dict = {}
+ if hasattr(self, 'crn') and self.crn is not None:
+ _dict['crn'] = self.crn
return _dict
def _to_dict(self):
@@ -113901,107 +130064,59 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this SecurityGroupRuleRemoteIP object."""
+ """Return a `str` version of this SubnetIdentityByCRN object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'SecurityGroupRuleRemoteIP') -> bool:
+ def __eq__(self, other: 'SubnetIdentityByCRN') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'SecurityGroupRuleRemoteIP') -> bool:
+ def __ne__(self, other: 'SubnetIdentityByCRN') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class SecurityGroupRuleRemoteSecurityGroupReference(SecurityGroupRuleRemote):
+class SubnetIdentityByHref(SubnetIdentity):
"""
- SecurityGroupRuleRemoteSecurityGroupReference.
+ SubnetIdentityByHref.
- :attr str crn: The security group's CRN.
- :attr SecurityGroupReferenceDeleted deleted: (optional) If present, this
- property indicates the referenced resource has been deleted, and provides
- some supplementary information.
- :attr str href: The security group's canonical URL.
- :attr str id: The unique identifier for this security group.
- :attr str name: The name for this security group. The name is unique across all
- security groups for the VPC.
+ :param str href: The URL for this subnet.
"""
def __init__(
self,
- crn: str,
href: str,
- id: str,
- name: str,
- *,
- deleted: 'SecurityGroupReferenceDeleted' = None,
) -> None:
"""
- Initialize a SecurityGroupRuleRemoteSecurityGroupReference object.
+ Initialize a SubnetIdentityByHref object.
- :param str crn: The security group's CRN.
- :param str href: The security group's canonical URL.
- :param str id: The unique identifier for this security group.
- :param str name: The name for this security group. The name is unique
- across all security groups for the VPC.
- :param SecurityGroupReferenceDeleted deleted: (optional) If present, this
- property indicates the referenced resource has been deleted, and provides
- some supplementary information.
+ :param str href: The URL for this subnet.
"""
# pylint: disable=super-init-not-called
- self.crn = crn
- self.deleted = deleted
self.href = href
- self.id = id
- self.name = name
@classmethod
- def from_dict(cls, _dict: Dict) -> 'SecurityGroupRuleRemoteSecurityGroupReference':
- """Initialize a SecurityGroupRuleRemoteSecurityGroupReference object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'SubnetIdentityByHref':
+ """Initialize a SubnetIdentityByHref object from a json dictionary."""
args = {}
- if 'crn' in _dict:
- args['crn'] = _dict.get('crn')
- else:
- raise ValueError('Required property \'crn\' not present in SecurityGroupRuleRemoteSecurityGroupReference JSON')
- if 'deleted' in _dict:
- args['deleted'] = SecurityGroupReferenceDeleted.from_dict(_dict.get('deleted'))
- if 'href' in _dict:
- args['href'] = _dict.get('href')
- else:
- raise ValueError('Required property \'href\' not present in SecurityGroupRuleRemoteSecurityGroupReference JSON')
- if 'id' in _dict:
- args['id'] = _dict.get('id')
- else:
- raise ValueError('Required property \'id\' not present in SecurityGroupRuleRemoteSecurityGroupReference JSON')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'name\' not present in SecurityGroupRuleRemoteSecurityGroupReference JSON')
+ raise ValueError('Required property \'href\' not present in SubnetIdentityByHref JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a SecurityGroupRuleRemoteSecurityGroupReference object from a json dictionary."""
+ """Initialize a SubnetIdentityByHref object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'crn') and self.crn is not None:
- _dict['crn'] = self.crn
- if hasattr(self, 'deleted') and self.deleted is not None:
- if isinstance(self.deleted, dict):
- _dict['deleted'] = self.deleted
- else:
- _dict['deleted'] = self.deleted.to_dict()
if hasattr(self, 'href') and self.href is not None:
_dict['href'] = self.href
- if hasattr(self, 'id') and self.id is not None:
- _dict['id'] = self.id
- if hasattr(self, 'name') and self.name is not None:
- _dict['name'] = self.name
return _dict
def _to_dict(self):
@@ -114009,120 +130124,59 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this SecurityGroupRuleRemoteSecurityGroupReference object."""
+ """Return a `str` version of this SubnetIdentityByHref object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'SecurityGroupRuleRemoteSecurityGroupReference') -> bool:
+ def __eq__(self, other: 'SubnetIdentityByHref') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'SecurityGroupRuleRemoteSecurityGroupReference') -> bool:
+ def __ne__(self, other: 'SubnetIdentityByHref') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class SecurityGroupRuleSecurityGroupRuleProtocolAll(SecurityGroupRule):
+class SubnetIdentityById(SubnetIdentity):
"""
- A rule allowing traffic for all supported protocols.
+ SubnetIdentityById.
- :attr str direction: The direction of traffic to enforce.
- :attr str href: The URL for this security group rule.
- :attr str id: The unique identifier for this security group rule.
- :attr str ip_version: The IP version to enforce. The format of `remote.address`
- or `remote.cidr_block` must match this property, if they are used.
- Alternatively, if `remote` references a security group, then this rule only
- applies to IP addresses (network interfaces) in that group matching this IP
- version.
- :attr SecurityGroupRuleRemote remote:
- :attr str protocol: The protocol to enforce.
+ :param str id: The unique identifier for this subnet.
"""
def __init__(
self,
- direction: str,
- href: str,
id: str,
- ip_version: str,
- remote: 'SecurityGroupRuleRemote',
- protocol: str,
) -> None:
"""
- Initialize a SecurityGroupRuleSecurityGroupRuleProtocolAll object.
+ Initialize a SubnetIdentityById object.
- :param str direction: The direction of traffic to enforce.
- :param str href: The URL for this security group rule.
- :param str id: The unique identifier for this security group rule.
- :param str ip_version: The IP version to enforce. The format of
- `remote.address` or `remote.cidr_block` must match this property, if they
- are used. Alternatively, if `remote` references a security group, then this
- rule only applies to IP addresses (network interfaces) in that group
- matching this IP version.
- :param SecurityGroupRuleRemote remote:
- :param str protocol: The protocol to enforce.
+ :param str id: The unique identifier for this subnet.
"""
# pylint: disable=super-init-not-called
- self.direction = direction
- self.href = href
self.id = id
- self.ip_version = ip_version
- self.remote = remote
- self.protocol = protocol
@classmethod
- def from_dict(cls, _dict: Dict) -> 'SecurityGroupRuleSecurityGroupRuleProtocolAll':
- """Initialize a SecurityGroupRuleSecurityGroupRuleProtocolAll object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'SubnetIdentityById':
+ """Initialize a SubnetIdentityById object from a json dictionary."""
args = {}
- if 'direction' in _dict:
- args['direction'] = _dict.get('direction')
- else:
- raise ValueError('Required property \'direction\' not present in SecurityGroupRuleSecurityGroupRuleProtocolAll JSON')
- if 'href' in _dict:
- args['href'] = _dict.get('href')
- else:
- raise ValueError('Required property \'href\' not present in SecurityGroupRuleSecurityGroupRuleProtocolAll JSON')
- if 'id' in _dict:
- args['id'] = _dict.get('id')
- else:
- raise ValueError('Required property \'id\' not present in SecurityGroupRuleSecurityGroupRuleProtocolAll JSON')
- if 'ip_version' in _dict:
- args['ip_version'] = _dict.get('ip_version')
- else:
- raise ValueError('Required property \'ip_version\' not present in SecurityGroupRuleSecurityGroupRuleProtocolAll JSON')
- if 'remote' in _dict:
- args['remote'] = _dict.get('remote')
- else:
- raise ValueError('Required property \'remote\' not present in SecurityGroupRuleSecurityGroupRuleProtocolAll JSON')
- if 'protocol' in _dict:
- args['protocol'] = _dict.get('protocol')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
else:
- raise ValueError('Required property \'protocol\' not present in SecurityGroupRuleSecurityGroupRuleProtocolAll JSON')
+ raise ValueError('Required property \'id\' not present in SubnetIdentityById JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a SecurityGroupRuleSecurityGroupRuleProtocolAll object from a json dictionary."""
+ """Initialize a SubnetIdentityById object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'direction') and self.direction is not None:
- _dict['direction'] = self.direction
- if hasattr(self, 'href') and self.href is not None:
- _dict['href'] = self.href
if hasattr(self, 'id') and self.id is not None:
_dict['id'] = self.id
- if hasattr(self, 'ip_version') and self.ip_version is not None:
- _dict['ip_version'] = self.ip_version
- if hasattr(self, 'remote') and self.remote is not None:
- if isinstance(self.remote, dict):
- _dict['remote'] = self.remote
- else:
- _dict['remote'] = self.remote.to_dict()
- if hasattr(self, 'protocol') and self.protocol is not None:
- _dict['protocol'] = self.protocol
return _dict
def _to_dict(self):
@@ -114130,169 +130184,176 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this SecurityGroupRuleSecurityGroupRuleProtocolAll object."""
+ """Return a `str` version of this SubnetIdentityById object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'SecurityGroupRuleSecurityGroupRuleProtocolAll') -> bool:
+ def __eq__(self, other: 'SubnetIdentityById') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'SecurityGroupRuleSecurityGroupRuleProtocolAll') -> bool:
+ def __ne__(self, other: 'SubnetIdentityById') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class DirectionEnum(str, Enum):
- """
- The direction of traffic to enforce.
- """
-
- INBOUND = 'inbound'
- OUTBOUND = 'outbound'
-
-
- class IpVersionEnum(str, Enum):
- """
- The IP version to enforce. The format of `remote.address` or `remote.cidr_block`
- must match this property, if they are used. Alternatively, if `remote` references
- a security group, then this rule only applies to IP addresses (network interfaces)
- in that group matching this IP version.
- """
-
- IPV4 = 'ipv4'
-
-
- class ProtocolEnum(str, Enum):
- """
- The protocol to enforce.
- """
-
- ALL = 'all'
-
-
-class SecurityGroupRuleSecurityGroupRuleProtocolICMP(SecurityGroupRule):
+class SubnetPrototypeSubnetByCIDR(SubnetPrototype):
"""
- A rule specifying the ICMP traffic to allow.
+ SubnetPrototypeSubnetByCIDR.
- :attr str direction: The direction of traffic to enforce.
- :attr str href: The URL for this security group rule.
- :attr str id: The unique identifier for this security group rule.
- :attr str ip_version: The IP version to enforce. The format of `remote.address`
- or `remote.cidr_block` must match this property, if they are used.
- Alternatively, if `remote` references a security group, then this rule only
- applies to IP addresses (network interfaces) in that group matching this IP
- version.
- :attr SecurityGroupRuleRemote remote:
- :attr int code: (optional) The ICMP traffic code to allow. If absent, all codes
- are allowed.
- :attr str protocol: The protocol to enforce.
- :attr int type: (optional) The ICMP traffic type to allow. If absent, all types
- are allowed.
+ :param str ip_version: (optional) The IP version(s) to support for this subnet.
+ :param str name: (optional) The name for this subnet. The name must not be used
+ by another subnet in the VPC. If unspecified, the name will be a hyphenated list
+ of randomly-selected words.
+ :param NetworkACLIdentity network_acl: (optional) The network ACL to use for
+ this subnet.
+ :param PublicGatewayIdentity public_gateway: (optional) The public gateway to
+ use for internet-bound traffic for this subnet. If unspecified, the subnet will
+ not be attached to a public gateway.
+ :param ResourceGroupIdentity resource_group: (optional)
+ :param RoutingTableIdentity routing_table: (optional) The routing table to use
+ for this subnet. If unspecified, the default routing table for the VPC is used.
+ The routing table properties `route_direct_link_ingress`,
+ `route_internet_ingress`, `route_transit_gateway_ingress`, and
+ `route_vpc_zone_ingress` must be `false`.
+ :param VPCIdentity vpc: The VPC the subnet will reside in.
+ :param str ipv4_cidr_block: The IPv4 range of the subnet, expressed in CIDR
+ format. The prefix length of the subnet's CIDR must be between `/9` (8,388,608
+ addresses) and `/29` (8 addresses). The IPv4 range of the subnet's CIDR must
+ fall within an existing address prefix in the VPC and must not overlap with any
+ existing subnet. The subnet will be created in the zone of the address prefix
+ that contains the IPv4 CIDR. If zone is specified, it must match the zone of the
+ address prefix that contains the subnet's IPv4 CIDR.
+ :param ZoneIdentity zone: (optional) The zone this subnet will reside in.
"""
def __init__(
self,
- direction: str,
- href: str,
- id: str,
- ip_version: str,
- remote: 'SecurityGroupRuleRemote',
- protocol: str,
+ vpc: 'VPCIdentity',
+ ipv4_cidr_block: str,
*,
- code: int = None,
- type: int = None,
+ ip_version: Optional[str] = None,
+ name: Optional[str] = None,
+ network_acl: Optional['NetworkACLIdentity'] = None,
+ public_gateway: Optional['PublicGatewayIdentity'] = None,
+ resource_group: Optional['ResourceGroupIdentity'] = None,
+ routing_table: Optional['RoutingTableIdentity'] = None,
+ zone: Optional['ZoneIdentity'] = None,
) -> None:
"""
- Initialize a SecurityGroupRuleSecurityGroupRuleProtocolICMP object.
+ Initialize a SubnetPrototypeSubnetByCIDR object.
- :param str direction: The direction of traffic to enforce.
- :param str href: The URL for this security group rule.
- :param str id: The unique identifier for this security group rule.
- :param str ip_version: The IP version to enforce. The format of
- `remote.address` or `remote.cidr_block` must match this property, if they
- are used. Alternatively, if `remote` references a security group, then this
- rule only applies to IP addresses (network interfaces) in that group
- matching this IP version.
- :param SecurityGroupRuleRemote remote:
- :param str protocol: The protocol to enforce.
- :param int code: (optional) The ICMP traffic code to allow. If absent, all
- codes are allowed.
- :param int type: (optional) The ICMP traffic type to allow. If absent, all
- types are allowed.
+ :param VPCIdentity vpc: The VPC the subnet will reside in.
+ :param str ipv4_cidr_block: The IPv4 range of the subnet, expressed in CIDR
+ format. The prefix length of the subnet's CIDR must be between `/9`
+ (8,388,608 addresses) and `/29` (8 addresses). The IPv4 range of the
+ subnet's CIDR must fall within an existing address prefix in the VPC and
+ must not overlap with any existing subnet. The subnet will be created in
+ the zone of the address prefix that contains the IPv4 CIDR. If zone is
+ specified, it must match the zone of the address prefix that contains the
+ subnet's IPv4 CIDR.
+ :param str ip_version: (optional) The IP version(s) to support for this
+ subnet.
+ :param str name: (optional) The name for this subnet. The name must not be
+ used by another subnet in the VPC. If unspecified, the name will be a
+ hyphenated list of randomly-selected words.
+ :param NetworkACLIdentity network_acl: (optional) The network ACL to use
+ for this subnet.
+ :param PublicGatewayIdentity public_gateway: (optional) The public gateway
+ to use for internet-bound traffic for this subnet. If unspecified, the
+ subnet will not be attached to a public gateway.
+ :param ResourceGroupIdentity resource_group: (optional)
+ :param RoutingTableIdentity routing_table: (optional) The routing table to
+ use for this subnet. If unspecified, the default routing table for the VPC
+ is used. The routing table properties `route_direct_link_ingress`,
+ `route_internet_ingress`, `route_transit_gateway_ingress`, and
+ `route_vpc_zone_ingress` must be `false`.
+ :param ZoneIdentity zone: (optional) The zone this subnet will reside in.
"""
# pylint: disable=super-init-not-called
- self.direction = direction
- self.href = href
- self.id = id
self.ip_version = ip_version
- self.remote = remote
- self.code = code
- self.protocol = protocol
- self.type = type
+ self.name = name
+ self.network_acl = network_acl
+ self.public_gateway = public_gateway
+ self.resource_group = resource_group
+ self.routing_table = routing_table
+ self.vpc = vpc
+ self.ipv4_cidr_block = ipv4_cidr_block
+ self.zone = zone
@classmethod
- def from_dict(cls, _dict: Dict) -> 'SecurityGroupRuleSecurityGroupRuleProtocolICMP':
- """Initialize a SecurityGroupRuleSecurityGroupRuleProtocolICMP object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'SubnetPrototypeSubnetByCIDR':
+ """Initialize a SubnetPrototypeSubnetByCIDR object from a json dictionary."""
args = {}
- if 'direction' in _dict:
- args['direction'] = _dict.get('direction')
- else:
- raise ValueError('Required property \'direction\' not present in SecurityGroupRuleSecurityGroupRuleProtocolICMP JSON')
- if 'href' in _dict:
- args['href'] = _dict.get('href')
- else:
- raise ValueError('Required property \'href\' not present in SecurityGroupRuleSecurityGroupRuleProtocolICMP JSON')
- if 'id' in _dict:
- args['id'] = _dict.get('id')
- else:
- raise ValueError('Required property \'id\' not present in SecurityGroupRuleSecurityGroupRuleProtocolICMP JSON')
- if 'ip_version' in _dict:
- args['ip_version'] = _dict.get('ip_version')
- else:
- raise ValueError('Required property \'ip_version\' not present in SecurityGroupRuleSecurityGroupRuleProtocolICMP JSON')
- if 'remote' in _dict:
- args['remote'] = _dict.get('remote')
+ if (ip_version := _dict.get('ip_version')) is not None:
+ args['ip_version'] = ip_version
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ if (network_acl := _dict.get('network_acl')) is not None:
+ args['network_acl'] = network_acl
+ if (public_gateway := _dict.get('public_gateway')) is not None:
+ args['public_gateway'] = public_gateway
+ if (resource_group := _dict.get('resource_group')) is not None:
+ args['resource_group'] = resource_group
+ if (routing_table := _dict.get('routing_table')) is not None:
+ args['routing_table'] = routing_table
+ if (vpc := _dict.get('vpc')) is not None:
+ args['vpc'] = vpc
else:
- raise ValueError('Required property \'remote\' not present in SecurityGroupRuleSecurityGroupRuleProtocolICMP JSON')
- if 'code' in _dict:
- args['code'] = _dict.get('code')
- if 'protocol' in _dict:
- args['protocol'] = _dict.get('protocol')
+ raise ValueError('Required property \'vpc\' not present in SubnetPrototypeSubnetByCIDR JSON')
+ if (ipv4_cidr_block := _dict.get('ipv4_cidr_block')) is not None:
+ args['ipv4_cidr_block'] = ipv4_cidr_block
else:
- raise ValueError('Required property \'protocol\' not present in SecurityGroupRuleSecurityGroupRuleProtocolICMP JSON')
- if 'type' in _dict:
- args['type'] = _dict.get('type')
+ raise ValueError('Required property \'ipv4_cidr_block\' not present in SubnetPrototypeSubnetByCIDR JSON')
+ if (zone := _dict.get('zone')) is not None:
+ args['zone'] = zone
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a SecurityGroupRuleSecurityGroupRuleProtocolICMP object from a json dictionary."""
+ """Initialize a SubnetPrototypeSubnetByCIDR object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'direction') and self.direction is not None:
- _dict['direction'] = self.direction
- if hasattr(self, 'href') and self.href is not None:
- _dict['href'] = self.href
- if hasattr(self, 'id') and self.id is not None:
- _dict['id'] = self.id
if hasattr(self, 'ip_version') and self.ip_version is not None:
_dict['ip_version'] = self.ip_version
- if hasattr(self, 'remote') and self.remote is not None:
- if isinstance(self.remote, dict):
- _dict['remote'] = self.remote
+ 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['remote'] = self.remote.to_dict()
- if hasattr(self, 'code') and self.code is not None:
- _dict['code'] = self.code
- if hasattr(self, 'protocol') and self.protocol is not None:
- _dict['protocol'] = self.protocol
- if hasattr(self, 'type') and self.type is not None:
- _dict['type'] = self.type
+ _dict['network_acl'] = self.network_acl.to_dict()
+ if hasattr(self, 'public_gateway') and self.public_gateway is not None:
+ if isinstance(self.public_gateway, dict):
+ _dict['public_gateway'] = self.public_gateway
+ else:
+ _dict['public_gateway'] = self.public_gateway.to_dict()
+ if hasattr(self, 'resource_group') and self.resource_group is not None:
+ if isinstance(self.resource_group, dict):
+ _dict['resource_group'] = self.resource_group
+ else:
+ _dict['resource_group'] = self.resource_group.to_dict()
+ if hasattr(self, 'routing_table') and self.routing_table is not None:
+ if isinstance(self.routing_table, dict):
+ _dict['routing_table'] = self.routing_table
+ else:
+ _dict['routing_table'] = self.routing_table.to_dict()
+ if hasattr(self, 'vpc') and self.vpc is not None:
+ if isinstance(self.vpc, dict):
+ _dict['vpc'] = self.vpc
+ else:
+ _dict['vpc'] = self.vpc.to_dict()
+ if hasattr(self, 'ipv4_cidr_block') and self.ipv4_cidr_block is not None:
+ _dict['ipv4_cidr_block'] = self.ipv4_cidr_block
+ 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):
@@ -114300,172 +130361,179 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this SecurityGroupRuleSecurityGroupRuleProtocolICMP object."""
+ """Return a `str` version of this SubnetPrototypeSubnetByCIDR object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'SecurityGroupRuleSecurityGroupRuleProtocolICMP') -> bool:
+ def __eq__(self, other: 'SubnetPrototypeSubnetByCIDR') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'SecurityGroupRuleSecurityGroupRuleProtocolICMP') -> bool:
+ def __ne__(self, other: 'SubnetPrototypeSubnetByCIDR') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class DirectionEnum(str, Enum):
- """
- The direction of traffic to enforce.
- """
-
- INBOUND = 'inbound'
- OUTBOUND = 'outbound'
-
-
class IpVersionEnum(str, Enum):
"""
- The IP version to enforce. The format of `remote.address` or `remote.cidr_block`
- must match this property, if they are used. Alternatively, if `remote` references
- a security group, then this rule only applies to IP addresses (network interfaces)
- in that group matching this IP version.
+ The IP version(s) to support for this subnet.
"""
IPV4 = 'ipv4'
- class ProtocolEnum(str, Enum):
- """
- The protocol to enforce.
- """
-
- ICMP = 'icmp'
-
-
-class SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP(SecurityGroupRule):
+class SubnetPrototypeSubnetByTotalCount(SubnetPrototype):
"""
- A rule specifying the TCP or UDP traffic to allow.
- Either both `port_min` and `port_max` will be present, or neither. When neither is
- present, all destination ports are allowed for the protocol. When both have the same
- value, that single destination port is allowed.
+ SubnetPrototypeSubnetByTotalCount.
- :attr str direction: The direction of traffic to enforce.
- :attr str href: The URL for this security group rule.
- :attr str id: The unique identifier for this security group rule.
- :attr str ip_version: The IP version to enforce. The format of `remote.address`
- or `remote.cidr_block` must match this property, if they are used.
- Alternatively, if `remote` references a security group, then this rule only
- applies to IP addresses (network interfaces) in that group matching this IP
- version.
- :attr SecurityGroupRuleRemote remote:
- :attr int port_max: (optional) The inclusive upper bound of TCP/UDP destination
- port range.
- :attr int port_min: (optional) The inclusive lower bound of TCP/UDP destination
- port range.
- :attr str protocol: The protocol to enforce.
+ :param str ip_version: (optional) The IP version(s) to support for this subnet.
+ :param str name: (optional) The name for this subnet. The name must not be used
+ by another subnet in the VPC. If unspecified, the name will be a hyphenated list
+ of randomly-selected words.
+ :param NetworkACLIdentity network_acl: (optional) The network ACL to use for
+ this subnet.
+ :param PublicGatewayIdentity public_gateway: (optional) The public gateway to
+ use for internet-bound traffic for this subnet. If unspecified, the subnet will
+ not be attached to a public gateway.
+ :param ResourceGroupIdentity resource_group: (optional)
+ :param RoutingTableIdentity routing_table: (optional) The routing table to use
+ for this subnet. If unspecified, the default routing table for the VPC is used.
+ The routing table properties `route_direct_link_ingress`,
+ `route_internet_ingress`, `route_transit_gateway_ingress`, and
+ `route_vpc_zone_ingress` must be `false`.
+ :param VPCIdentity vpc: The VPC the subnet will reside in.
+ :param int total_ipv4_address_count: The total number of IPv4 addresses
+ required. Must be a power of 2. The VPC must have a default address prefix in
+ the specified zone, and that prefix must have a free CIDR range with at least
+ this number of addresses.
+ :param ZoneIdentity zone: The zone this subnet will reside in.
"""
def __init__(
self,
- direction: str,
- href: str,
- id: str,
- ip_version: str,
- remote: 'SecurityGroupRuleRemote',
- protocol: str,
+ vpc: 'VPCIdentity',
+ total_ipv4_address_count: int,
+ zone: 'ZoneIdentity',
*,
- port_max: int = None,
- port_min: int = None,
+ ip_version: Optional[str] = None,
+ name: Optional[str] = None,
+ network_acl: Optional['NetworkACLIdentity'] = None,
+ public_gateway: Optional['PublicGatewayIdentity'] = None,
+ resource_group: Optional['ResourceGroupIdentity'] = None,
+ routing_table: Optional['RoutingTableIdentity'] = None,
) -> None:
"""
- Initialize a SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP object.
+ Initialize a SubnetPrototypeSubnetByTotalCount object.
- :param str direction: The direction of traffic to enforce.
- :param str href: The URL for this security group rule.
- :param str id: The unique identifier for this security group rule.
- :param str ip_version: The IP version to enforce. The format of
- `remote.address` or `remote.cidr_block` must match this property, if they
- are used. Alternatively, if `remote` references a security group, then this
- rule only applies to IP addresses (network interfaces) in that group
- matching this IP version.
- :param SecurityGroupRuleRemote remote:
- :param str protocol: The protocol to enforce.
- :param int port_max: (optional) The inclusive upper bound of TCP/UDP
- destination port range.
- :param int port_min: (optional) The inclusive lower bound of TCP/UDP
- destination port range.
+ :param VPCIdentity vpc: The VPC the subnet will reside in.
+ :param int total_ipv4_address_count: The total number of IPv4 addresses
+ required. Must be a power of 2. The VPC must have a default address prefix
+ in the specified zone, and that prefix must have a free CIDR range with at
+ least this number of addresses.
+ :param ZoneIdentity zone: The zone this subnet will reside in.
+ :param str ip_version: (optional) The IP version(s) to support for this
+ subnet.
+ :param str name: (optional) The name for this subnet. The name must not be
+ used by another subnet in the VPC. If unspecified, the name will be a
+ hyphenated list of randomly-selected words.
+ :param NetworkACLIdentity network_acl: (optional) The network ACL to use
+ for this subnet.
+ :param PublicGatewayIdentity public_gateway: (optional) The public gateway
+ to use for internet-bound traffic for this subnet. If unspecified, the
+ subnet will not be attached to a public gateway.
+ :param ResourceGroupIdentity resource_group: (optional)
+ :param RoutingTableIdentity routing_table: (optional) The routing table to
+ use for this subnet. If unspecified, the default routing table for the VPC
+ is used. The routing table properties `route_direct_link_ingress`,
+ `route_internet_ingress`, `route_transit_gateway_ingress`, and
+ `route_vpc_zone_ingress` must be `false`.
"""
# pylint: disable=super-init-not-called
- self.direction = direction
- self.href = href
- self.id = id
self.ip_version = ip_version
- self.remote = remote
- self.port_max = port_max
- self.port_min = port_min
- self.protocol = protocol
+ self.name = name
+ self.network_acl = network_acl
+ self.public_gateway = public_gateway
+ self.resource_group = resource_group
+ self.routing_table = routing_table
+ self.vpc = vpc
+ self.total_ipv4_address_count = total_ipv4_address_count
+ self.zone = zone
@classmethod
- def from_dict(cls, _dict: Dict) -> 'SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP':
- """Initialize a SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'SubnetPrototypeSubnetByTotalCount':
+ """Initialize a SubnetPrototypeSubnetByTotalCount object from a json dictionary."""
args = {}
- if 'direction' in _dict:
- args['direction'] = _dict.get('direction')
- else:
- raise ValueError('Required property \'direction\' not present in SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP JSON')
- if 'href' in _dict:
- args['href'] = _dict.get('href')
- else:
- raise ValueError('Required property \'href\' not present in SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP JSON')
- if 'id' in _dict:
- args['id'] = _dict.get('id')
- else:
- raise ValueError('Required property \'id\' not present in SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP JSON')
- if 'ip_version' in _dict:
- args['ip_version'] = _dict.get('ip_version')
+ if (ip_version := _dict.get('ip_version')) is not None:
+ args['ip_version'] = ip_version
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ if (network_acl := _dict.get('network_acl')) is not None:
+ args['network_acl'] = network_acl
+ if (public_gateway := _dict.get('public_gateway')) is not None:
+ args['public_gateway'] = public_gateway
+ if (resource_group := _dict.get('resource_group')) is not None:
+ args['resource_group'] = resource_group
+ if (routing_table := _dict.get('routing_table')) is not None:
+ args['routing_table'] = routing_table
+ if (vpc := _dict.get('vpc')) is not None:
+ args['vpc'] = vpc
else:
- raise ValueError('Required property \'ip_version\' not present in SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP JSON')
- if 'remote' in _dict:
- args['remote'] = _dict.get('remote')
+ raise ValueError('Required property \'vpc\' not present in SubnetPrototypeSubnetByTotalCount JSON')
+ if (total_ipv4_address_count := _dict.get('total_ipv4_address_count')) is not None:
+ args['total_ipv4_address_count'] = total_ipv4_address_count
else:
- raise ValueError('Required property \'remote\' not present in SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP JSON')
- if 'port_max' in _dict:
- args['port_max'] = _dict.get('port_max')
- if 'port_min' in _dict:
- args['port_min'] = _dict.get('port_min')
- if 'protocol' in _dict:
- args['protocol'] = _dict.get('protocol')
+ raise ValueError('Required property \'total_ipv4_address_count\' not present in SubnetPrototypeSubnetByTotalCount JSON')
+ if (zone := _dict.get('zone')) is not None:
+ args['zone'] = zone
else:
- raise ValueError('Required property \'protocol\' not present in SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP JSON')
+ raise ValueError('Required property \'zone\' not present in SubnetPrototypeSubnetByTotalCount JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP object from a json dictionary."""
+ """Initialize a SubnetPrototypeSubnetByTotalCount object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'direction') and self.direction is not None:
- _dict['direction'] = self.direction
- if hasattr(self, 'href') and self.href is not None:
- _dict['href'] = self.href
- if hasattr(self, 'id') and self.id is not None:
- _dict['id'] = self.id
if hasattr(self, 'ip_version') and self.ip_version is not None:
_dict['ip_version'] = self.ip_version
- if hasattr(self, 'remote') and self.remote is not None:
- if isinstance(self.remote, dict):
- _dict['remote'] = self.remote
+ 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['remote'] = self.remote.to_dict()
- if hasattr(self, 'port_max') and self.port_max is not None:
- _dict['port_max'] = self.port_max
- if hasattr(self, 'port_min') and self.port_min is not None:
- _dict['port_min'] = self.port_min
- if hasattr(self, 'protocol') and self.protocol is not None:
- _dict['protocol'] = self.protocol
+ _dict['network_acl'] = self.network_acl.to_dict()
+ if hasattr(self, 'public_gateway') and self.public_gateway is not None:
+ if isinstance(self.public_gateway, dict):
+ _dict['public_gateway'] = self.public_gateway
+ else:
+ _dict['public_gateway'] = self.public_gateway.to_dict()
+ if hasattr(self, 'resource_group') and self.resource_group is not None:
+ if isinstance(self.resource_group, dict):
+ _dict['resource_group'] = self.resource_group
+ else:
+ _dict['resource_group'] = self.resource_group.to_dict()
+ if hasattr(self, 'routing_table') and self.routing_table is not None:
+ if isinstance(self.routing_table, dict):
+ _dict['routing_table'] = self.routing_table
+ else:
+ _dict['routing_table'] = self.routing_table.to_dict()
+ if hasattr(self, 'vpc') and self.vpc is not None:
+ if isinstance(self.vpc, dict):
+ _dict['vpc'] = self.vpc
+ else:
+ _dict['vpc'] = self.vpc.to_dict()
+ if hasattr(self, '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, '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):
@@ -114473,138 +130541,67 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP object."""
+ """Return a `str` version of this SubnetPrototypeSubnetByTotalCount object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP') -> bool:
- """Return `true` when self and other are equal, false otherwise."""
- if not isinstance(other, self.__class__):
- return False
- return self.__dict__ == other.__dict__
-
- def __ne__(self, other: 'SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP') -> bool:
- """Return `true` when self and other are not equal, false otherwise."""
- return not self == other
-
- class DirectionEnum(str, Enum):
- """
- The direction of traffic to enforce.
- """
-
- INBOUND = 'inbound'
- OUTBOUND = 'outbound'
+ def __eq__(self, other: 'SubnetPrototypeSubnetByTotalCount') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+ def __ne__(self, other: 'SubnetPrototypeSubnetByTotalCount') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
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.
+ The IP version(s) to support for this subnet.
"""
IPV4 = 'ipv4'
- class ProtocolEnum(str, Enum):
- """
- The protocol to enforce.
- """
-
- TCP = 'tcp'
- UDP = 'udp'
-
-
-class SecurityGroupTargetReferenceBareMetalServerNetworkInterfaceReferenceTargetContext(SecurityGroupTargetReference):
+class SubnetPublicGatewayPatchPublicGatewayIdentityByCRN(SubnetPublicGatewayPatch):
"""
- SecurityGroupTargetReferenceBareMetalServerNetworkInterfaceReferenceTargetContext.
+ SubnetPublicGatewayPatchPublicGatewayIdentityByCRN.
- :attr BareMetalServerNetworkInterfaceReferenceTargetContextDeleted deleted:
- (optional) If present, this property indicates the referenced resource has been
- deleted, and provides
- some supplementary information.
- :attr str href: The URL for this bare metal server network interface.
- :attr str id: The unique identifier for this bare metal server network
- interface.
- :attr str name: The name for this bare metal server network interface.
- :attr str resource_type: The resource type.
+ :param str crn: The CRN for this public gateway.
"""
def __init__(
self,
- href: str,
- id: str,
- name: str,
- resource_type: str,
- *,
- deleted: 'BareMetalServerNetworkInterfaceReferenceTargetContextDeleted' = None,
+ crn: str,
) -> None:
"""
- Initialize a SecurityGroupTargetReferenceBareMetalServerNetworkInterfaceReferenceTargetContext object.
+ Initialize a SubnetPublicGatewayPatchPublicGatewayIdentityByCRN object.
- :param str href: The URL for this bare metal server network interface.
- :param str id: The unique identifier for this bare metal server network
- interface.
- :param str name: The name for this bare metal server network interface.
- :param str resource_type: The resource type.
- :param BareMetalServerNetworkInterfaceReferenceTargetContextDeleted
- deleted: (optional) If present, this property indicates the referenced
- resource has been deleted, and provides
- some supplementary information.
+ :param str crn: The CRN for this public gateway.
"""
# pylint: disable=super-init-not-called
- self.deleted = deleted
- self.href = href
- self.id = id
- self.name = name
- self.resource_type = resource_type
+ self.crn = crn
@classmethod
- def from_dict(cls, _dict: Dict) -> 'SecurityGroupTargetReferenceBareMetalServerNetworkInterfaceReferenceTargetContext':
- """Initialize a SecurityGroupTargetReferenceBareMetalServerNetworkInterfaceReferenceTargetContext object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'SubnetPublicGatewayPatchPublicGatewayIdentityByCRN':
+ """Initialize a SubnetPublicGatewayPatchPublicGatewayIdentityByCRN object from a json dictionary."""
args = {}
- if 'deleted' in _dict:
- args['deleted'] = BareMetalServerNetworkInterfaceReferenceTargetContextDeleted.from_dict(_dict.get('deleted'))
- if 'href' in _dict:
- args['href'] = _dict.get('href')
- else:
- raise ValueError('Required property \'href\' not present in SecurityGroupTargetReferenceBareMetalServerNetworkInterfaceReferenceTargetContext JSON')
- if 'id' in _dict:
- args['id'] = _dict.get('id')
- else:
- raise ValueError('Required property \'id\' not present in SecurityGroupTargetReferenceBareMetalServerNetworkInterfaceReferenceTargetContext JSON')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
- else:
- raise ValueError('Required property \'name\' not present in SecurityGroupTargetReferenceBareMetalServerNetworkInterfaceReferenceTargetContext JSON')
- if 'resource_type' in _dict:
- args['resource_type'] = _dict.get('resource_type')
+ if (crn := _dict.get('crn')) is not None:
+ args['crn'] = crn
else:
- raise ValueError('Required property \'resource_type\' not present in SecurityGroupTargetReferenceBareMetalServerNetworkInterfaceReferenceTargetContext JSON')
+ raise ValueError('Required property \'crn\' not present in SubnetPublicGatewayPatchPublicGatewayIdentityByCRN JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a SecurityGroupTargetReferenceBareMetalServerNetworkInterfaceReferenceTargetContext object from a json dictionary."""
+ """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, 'deleted') and self.deleted is not None:
- if isinstance(self.deleted, dict):
- _dict['deleted'] = self.deleted
- else:
- _dict['deleted'] = self.deleted.to_dict()
- if hasattr(self, 'href') and self.href is not None:
- _dict['href'] = self.href
- if hasattr(self, 'id') and self.id is not None:
- _dict['id'] = self.id
- if hasattr(self, 'name') and self.name is not None:
- _dict['name'] = self.name
- if hasattr(self, 'resource_type') and self.resource_type is not None:
- _dict['resource_type'] = self.resource_type
+ if hasattr(self, 'crn') and self.crn is not None:
+ _dict['crn'] = self.crn
return _dict
def _to_dict(self):
@@ -114612,125 +130609,59 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this SecurityGroupTargetReferenceBareMetalServerNetworkInterfaceReferenceTargetContext object."""
+ """Return a `str` version of this SubnetPublicGatewayPatchPublicGatewayIdentityByCRN object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'SecurityGroupTargetReferenceBareMetalServerNetworkInterfaceReferenceTargetContext') -> bool:
+ 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: 'SecurityGroupTargetReferenceBareMetalServerNetworkInterfaceReferenceTargetContext') -> bool:
+ def __ne__(self, other: 'SubnetPublicGatewayPatchPublicGatewayIdentityByCRN') -> 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 SecurityGroupTargetReferenceEndpointGatewayReference(SecurityGroupTargetReference):
+class SubnetPublicGatewayPatchPublicGatewayIdentityByHref(SubnetPublicGatewayPatch):
"""
- SecurityGroupTargetReferenceEndpointGatewayReference.
+ SubnetPublicGatewayPatchPublicGatewayIdentityByHref.
- :attr str crn: The CRN for this endpoint gateway.
- :attr EndpointGatewayReferenceDeleted deleted: (optional) If present, this
- property indicates the referenced resource has been deleted, and provides
- some supplementary information.
- :attr str href: The URL for this endpoint gateway.
- :attr str id: The unique identifier for this endpoint gateway.
- :attr str name: The name for this endpoint gateway. The name is unique across
- all endpoint gateways in the VPC.
- :attr str resource_type: The resource type.
+ :param str href: The URL for this public gateway.
"""
def __init__(
self,
- crn: str,
href: str,
- id: str,
- name: str,
- resource_type: str,
- *,
- deleted: 'EndpointGatewayReferenceDeleted' = None,
) -> None:
"""
- Initialize a SecurityGroupTargetReferenceEndpointGatewayReference object.
+ Initialize a SubnetPublicGatewayPatchPublicGatewayIdentityByHref object.
- :param str crn: The CRN for this endpoint gateway.
- :param str href: The URL for this endpoint gateway.
- :param str id: The unique identifier for this endpoint gateway.
- :param str name: The name for this endpoint gateway. The name is unique
- across all endpoint gateways in the VPC.
- :param str resource_type: The resource type.
- :param EndpointGatewayReferenceDeleted deleted: (optional) If present, this
- property indicates the referenced resource has been deleted, and provides
- some supplementary information.
+ :param str href: The URL for this public gateway.
"""
# pylint: disable=super-init-not-called
- self.crn = crn
- self.deleted = deleted
self.href = href
- self.id = id
- self.name = name
- self.resource_type = resource_type
@classmethod
- def from_dict(cls, _dict: Dict) -> 'SecurityGroupTargetReferenceEndpointGatewayReference':
- """Initialize a SecurityGroupTargetReferenceEndpointGatewayReference object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'SubnetPublicGatewayPatchPublicGatewayIdentityByHref':
+ """Initialize a SubnetPublicGatewayPatchPublicGatewayIdentityByHref 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')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'resource_type\' not present in SecurityGroupTargetReferenceEndpointGatewayReference JSON')
+ raise ValueError('Required property \'href\' not present in SubnetPublicGatewayPatchPublicGatewayIdentityByHref JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a SecurityGroupTargetReferenceEndpointGatewayReference object from a json dictionary."""
+ """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, 'crn') and self.crn is not None:
- _dict['crn'] = self.crn
- if hasattr(self, 'deleted') and self.deleted is not None:
- if isinstance(self.deleted, dict):
- _dict['deleted'] = self.deleted
- else:
- _dict['deleted'] = self.deleted.to_dict()
if hasattr(self, 'href') and self.href is not None:
_dict['href'] = self.href
- if hasattr(self, 'id') and self.id is not None:
- _dict['id'] = self.id
- if hasattr(self, 'name') and self.name is not None:
- _dict['name'] = self.name
- if hasattr(self, 'resource_type') and self.resource_type is not None:
- _dict['resource_type'] = self.resource_type
return _dict
def _to_dict(self):
@@ -114738,125 +130669,59 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this SecurityGroupTargetReferenceEndpointGatewayReference object."""
+ """Return a `str` version of this SubnetPublicGatewayPatchPublicGatewayIdentityByHref object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'SecurityGroupTargetReferenceEndpointGatewayReference') -> bool:
+ 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: 'SecurityGroupTargetReferenceEndpointGatewayReference') -> bool:
+ def __ne__(self, other: 'SubnetPublicGatewayPatchPublicGatewayIdentityByHref') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class ResourceTypeEnum(str, Enum):
- """
- The resource type.
- """
-
- ENDPOINT_GATEWAY = 'endpoint_gateway'
-
-
-class SecurityGroupTargetReferenceLoadBalancerReference(SecurityGroupTargetReference):
+class SubnetPublicGatewayPatchPublicGatewayIdentityById(SubnetPublicGatewayPatch):
"""
- SecurityGroupTargetReferenceLoadBalancerReference.
+ SubnetPublicGatewayPatchPublicGatewayIdentityById.
- :attr str crn: The load balancer's CRN.
- :attr LoadBalancerReferenceDeleted deleted: (optional) If present, this property
- indicates the referenced resource has been deleted, and provides
- some supplementary information.
- :attr str href: The load balancer's canonical URL.
- :attr str id: The unique identifier for this load balancer.
- :attr str name: The name for this load balancer. The name is unique across all
- load balancers in the VPC.
- :attr str resource_type: The resource type.
+ :param str id: The unique identifier for this public gateway.
"""
def __init__(
self,
- crn: str,
- href: str,
id: str,
- name: str,
- resource_type: str,
- *,
- deleted: 'LoadBalancerReferenceDeleted' = None,
) -> None:
"""
- Initialize a SecurityGroupTargetReferenceLoadBalancerReference object.
+ Initialize a SubnetPublicGatewayPatchPublicGatewayIdentityById object.
- :param str crn: The load balancer's CRN.
- :param str href: The load balancer's canonical URL.
- :param str id: The unique identifier for this load balancer.
- :param str name: The name for this load balancer. The name is unique across
- all load balancers in the VPC.
- :param str resource_type: The resource type.
- :param LoadBalancerReferenceDeleted deleted: (optional) If present, this
- property indicates the referenced resource has been deleted, and provides
- some supplementary information.
+ :param str id: The unique identifier for this public gateway.
"""
# pylint: disable=super-init-not-called
- self.crn = crn
- self.deleted = deleted
- self.href = href
self.id = id
- self.name = name
- self.resource_type = resource_type
@classmethod
- def from_dict(cls, _dict: Dict) -> 'SecurityGroupTargetReferenceLoadBalancerReference':
- """Initialize a SecurityGroupTargetReferenceLoadBalancerReference object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'SubnetPublicGatewayPatchPublicGatewayIdentityById':
+ """Initialize a SubnetPublicGatewayPatchPublicGatewayIdentityById object from a json dictionary."""
args = {}
- if 'crn' in _dict:
- args['crn'] = _dict.get('crn')
- else:
- raise ValueError('Required property \'crn\' not present in SecurityGroupTargetReferenceLoadBalancerReference JSON')
- if 'deleted' in _dict:
- args['deleted'] = LoadBalancerReferenceDeleted.from_dict(_dict.get('deleted'))
- if 'href' in _dict:
- args['href'] = _dict.get('href')
- else:
- raise ValueError('Required property \'href\' not present in SecurityGroupTargetReferenceLoadBalancerReference JSON')
- if 'id' in _dict:
- args['id'] = _dict.get('id')
- else:
- raise ValueError('Required property \'id\' not present in SecurityGroupTargetReferenceLoadBalancerReference JSON')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
- else:
- raise ValueError('Required property \'name\' not present in SecurityGroupTargetReferenceLoadBalancerReference JSON')
- if 'resource_type' in _dict:
- args['resource_type'] = _dict.get('resource_type')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
else:
- raise ValueError('Required property \'resource_type\' not present in SecurityGroupTargetReferenceLoadBalancerReference JSON')
+ raise ValueError('Required property \'id\' not present in SubnetPublicGatewayPatchPublicGatewayIdentityById JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a SecurityGroupTargetReferenceLoadBalancerReference object from a json dictionary."""
+ """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, 'crn') and self.crn is not None:
- _dict['crn'] = self.crn
- if hasattr(self, 'deleted') and self.deleted is not None:
- if isinstance(self.deleted, dict):
- _dict['deleted'] = self.deleted
- else:
- _dict['deleted'] = self.deleted.to_dict()
- if hasattr(self, 'href') and self.href is not None:
- _dict['href'] = self.href
if hasattr(self, 'id') and self.id is not None:
_dict['id'] = self.id
- if hasattr(self, 'name') and self.name is not None:
- _dict['name'] = self.name
- if hasattr(self, 'resource_type') and self.resource_type is not None:
- _dict['resource_type'] = self.resource_type
return _dict
def _to_dict(self):
@@ -114864,115 +130729,59 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this SecurityGroupTargetReferenceLoadBalancerReference object."""
+ """Return a `str` version of this SubnetPublicGatewayPatchPublicGatewayIdentityById object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'SecurityGroupTargetReferenceLoadBalancerReference') -> bool:
+ 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: 'SecurityGroupTargetReferenceLoadBalancerReference') -> bool:
+ def __ne__(self, other: 'SubnetPublicGatewayPatchPublicGatewayIdentityById') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class ResourceTypeEnum(str, Enum):
- """
- The resource type.
- """
-
- LOAD_BALANCER = 'load_balancer'
-
-
-class SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext(SecurityGroupTargetReference):
+class TrustedProfileIdentityTrustedProfileByCRN(TrustedProfileIdentity):
"""
- SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext.
+ TrustedProfileIdentityTrustedProfileByCRN.
- :attr NetworkInterfaceReferenceTargetContextDeleted deleted: (optional) If
- present, this property indicates the referenced resource has been deleted, and
- provides
- some supplementary information.
- :attr str href: The URL for this instance network interface.
- :attr str id: The unique identifier for this instance network interface.
- :attr str name: The name for this instance network interface.
- :attr str resource_type: The resource type.
+ :param str crn: The CRN for this trusted profile.
"""
def __init__(
self,
- href: str,
- id: str,
- name: str,
- resource_type: str,
- *,
- deleted: 'NetworkInterfaceReferenceTargetContextDeleted' = None,
+ crn: str,
) -> None:
"""
- Initialize a SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext object.
+ Initialize a TrustedProfileIdentityTrustedProfileByCRN object.
- :param str href: The URL for this instance network interface.
- :param str id: The unique identifier for this instance network interface.
- :param str name: The name for this instance network interface.
- :param str resource_type: The resource type.
- :param NetworkInterfaceReferenceTargetContextDeleted deleted: (optional) If
- present, this property indicates the referenced resource has been deleted,
- and provides
- some supplementary information.
+ :param str crn: The CRN for this trusted profile.
"""
# pylint: disable=super-init-not-called
- self.deleted = deleted
- self.href = href
- self.id = id
- self.name = name
- self.resource_type = resource_type
+ self.crn = crn
@classmethod
- def from_dict(cls, _dict: Dict) -> 'SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext':
- """Initialize a SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'TrustedProfileIdentityTrustedProfileByCRN':
+ """Initialize a TrustedProfileIdentityTrustedProfileByCRN object from a json dictionary."""
args = {}
- if 'deleted' in _dict:
- args['deleted'] = NetworkInterfaceReferenceTargetContextDeleted.from_dict(_dict.get('deleted'))
- if 'href' in _dict:
- args['href'] = _dict.get('href')
- else:
- raise ValueError('Required property \'href\' not present in SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext JSON')
- if 'id' in _dict:
- args['id'] = _dict.get('id')
- else:
- raise ValueError('Required property \'id\' not present in SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext JSON')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
- else:
- raise ValueError('Required property \'name\' not present in SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext JSON')
- if 'resource_type' in _dict:
- args['resource_type'] = _dict.get('resource_type')
+ if (crn := _dict.get('crn')) is not None:
+ args['crn'] = crn
else:
- raise ValueError('Required property \'resource_type\' not present in SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext JSON')
+ raise ValueError('Required property \'crn\' not present in TrustedProfileIdentityTrustedProfileByCRN JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext object from a json dictionary."""
+ """Initialize a TrustedProfileIdentityTrustedProfileByCRN object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'deleted') and self.deleted is not None:
- if isinstance(self.deleted, dict):
- _dict['deleted'] = self.deleted
- else:
- _dict['deleted'] = self.deleted.to_dict()
- if hasattr(self, 'href') and self.href is not None:
- _dict['href'] = self.href
- if hasattr(self, 'id') and self.id is not None:
- _dict['id'] = self.id
- if hasattr(self, 'name') and self.name is not None:
- _dict['name'] = self.name
- if hasattr(self, 'resource_type') and self.resource_type is not None:
- _dict['resource_type'] = self.resource_type
+ if hasattr(self, 'crn') and self.crn is not None:
+ _dict['crn'] = self.crn
return _dict
def _to_dict(self):
@@ -114980,125 +130789,59 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext object."""
+ """Return a `str` version of this TrustedProfileIdentityTrustedProfileByCRN object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext') -> bool:
+ def __eq__(self, other: 'TrustedProfileIdentityTrustedProfileByCRN') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext') -> bool:
+ def __ne__(self, other: 'TrustedProfileIdentityTrustedProfileByCRN') -> 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 SecurityGroupTargetReferenceVPNServerReference(SecurityGroupTargetReference):
+class TrustedProfileIdentityTrustedProfileById(TrustedProfileIdentity):
"""
- SecurityGroupTargetReferenceVPNServerReference.
+ TrustedProfileIdentityTrustedProfileById.
- :attr str crn: The CRN for this VPN server.
- :attr VPNServerReferenceDeleted deleted: (optional) If present, this property
- indicates the referenced resource has been deleted, and provides
- some supplementary information.
- :attr str href: The URL for this VPN server.
- :attr str id: The unique identifier for this VPN server.
- :attr str name: The name for this VPN server. The name is unique across all VPN
- servers in the VPC.
- :attr str resource_type: The resource type.
+ :param str id: The unique identifier for this trusted profile.
"""
def __init__(
self,
- crn: str,
- href: str,
id: str,
- name: str,
- resource_type: str,
- *,
- deleted: 'VPNServerReferenceDeleted' = None,
) -> None:
"""
- Initialize a SecurityGroupTargetReferenceVPNServerReference object.
+ Initialize a TrustedProfileIdentityTrustedProfileById object.
- :param str crn: The CRN for this VPN server.
- :param str href: The URL for this VPN server.
- :param str id: The unique identifier for this VPN server.
- :param str name: The name for this VPN server. The name is unique across
- all VPN servers in the VPC.
- :param str resource_type: The resource type.
- :param VPNServerReferenceDeleted deleted: (optional) If present, this
- property indicates the referenced resource has been deleted, and provides
- some supplementary information.
+ :param str id: The unique identifier for this trusted profile.
"""
# pylint: disable=super-init-not-called
- self.crn = crn
- self.deleted = deleted
- self.href = href
self.id = id
- self.name = name
- self.resource_type = resource_type
@classmethod
- def from_dict(cls, _dict: Dict) -> 'SecurityGroupTargetReferenceVPNServerReference':
- """Initialize a SecurityGroupTargetReferenceVPNServerReference object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'TrustedProfileIdentityTrustedProfileById':
+ """Initialize a TrustedProfileIdentityTrustedProfileById object from a json dictionary."""
args = {}
- if 'crn' in _dict:
- args['crn'] = _dict.get('crn')
- else:
- raise ValueError('Required property \'crn\' not present in SecurityGroupTargetReferenceVPNServerReference JSON')
- if 'deleted' in _dict:
- args['deleted'] = VPNServerReferenceDeleted.from_dict(_dict.get('deleted'))
- if 'href' in _dict:
- args['href'] = _dict.get('href')
- else:
- raise ValueError('Required property \'href\' not present in SecurityGroupTargetReferenceVPNServerReference JSON')
- if 'id' in _dict:
- args['id'] = _dict.get('id')
- else:
- raise ValueError('Required property \'id\' not present in SecurityGroupTargetReferenceVPNServerReference JSON')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
else:
- raise ValueError('Required property \'name\' not present in SecurityGroupTargetReferenceVPNServerReference JSON')
- if 'resource_type' in _dict:
- args['resource_type'] = _dict.get('resource_type')
- else:
- raise ValueError('Required property \'resource_type\' not present in SecurityGroupTargetReferenceVPNServerReference JSON')
+ raise ValueError('Required property \'id\' not present in TrustedProfileIdentityTrustedProfileById JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a SecurityGroupTargetReferenceVPNServerReference object from a json dictionary."""
+ """Initialize a TrustedProfileIdentityTrustedProfileById object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'crn') and self.crn is not None:
- _dict['crn'] = self.crn
- if hasattr(self, 'deleted') and self.deleted is not None:
- if isinstance(self.deleted, dict):
- _dict['deleted'] = self.deleted
- else:
- _dict['deleted'] = self.deleted.to_dict()
- if hasattr(self, 'href') and self.href is not None:
- _dict['href'] = self.href
if hasattr(self, 'id') and self.id is not None:
_dict['id'] = self.id
- if hasattr(self, 'name') and self.name is not None:
- _dict['name'] = self.name
- if hasattr(self, 'resource_type') and self.resource_type is not None:
- _dict['resource_type'] = self.resource_type
return _dict
def _to_dict(self):
@@ -115106,154 +130849,97 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this SecurityGroupTargetReferenceVPNServerReference object."""
+ """Return a `str` version of this TrustedProfileIdentityTrustedProfileById object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'SecurityGroupTargetReferenceVPNServerReference') -> bool:
+ def __eq__(self, other: 'TrustedProfileIdentityTrustedProfileById') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'SecurityGroupTargetReferenceVPNServerReference') -> bool:
+ def __ne__(self, other: 'TrustedProfileIdentityTrustedProfileById') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class ResourceTypeEnum(str, Enum):
- """
- The resource type.
- """
-
- VPN_SERVER = 'vpn_server'
-
-
-class SecurityGroupTargetReferenceVirtualNetworkInterfaceReference(SecurityGroupTargetReference):
+class VPCDNSResolverPrototypeVPCDNSResolverTypeManualPrototype(VPCDNSResolverPrototype):
"""
- SecurityGroupTargetReferenceVirtualNetworkInterfaceReference.
+ Manually specify the DNS server addresses for this VPC.
- :attr str crn: The CRN for this virtual network interface.
- :attr VirtualNetworkInterfaceReferenceDeleted deleted: (optional) If present,
- this property indicates the referenced resource has been deleted, and provides
- some supplementary information.
- :attr str href: The URL for this virtual network interface.
- :attr str id: The unique identifier for this virtual network interface.
- :attr str name: The name for this virtual network interface. The name is unique
- across all virtual network interfaces in the VPC.
- :attr ReservedIPReference primary_ip: The primary IP for this virtual network
- interface.
- :attr str resource_type: The resource type.
- :attr SubnetReference subnet: The associated subnet.
+ :param List[DNSServerPrototype] manual_servers: The DNS servers to use for this
+ VPC. All the DNS servers must either:
+ - have a unique `zone_affinity`, or
+ - not have a `zone_affinity`.
+ If `zone_affinity` is specified, exactly one DNS server must be specified for
+ each zone in the region. The DHCP [Domain Name Server
+ Option](https://datatracker.ietf.org/doc/html/rfc2132#section-3.8) for a zone
+ will list this DNS server first, followed by unique DNS servers from other zones
+ if available.
+ If `zone_affinity` is not specified, the DHCP [Domain Name Server
+ Option](https://datatracker.ietf.org/doc/html/rfc2132#section-3.8) for each zone
+ will list all the manual DNS servers in the order specified.
+ :param str type: The type of the DNS resolver to use.
"""
def __init__(
self,
- crn: str,
- href: str,
- id: str,
- name: str,
- primary_ip: 'ReservedIPReference',
- resource_type: str,
- subnet: 'SubnetReference',
- *,
- deleted: 'VirtualNetworkInterfaceReferenceDeleted' = None,
+ manual_servers: List['DNSServerPrototype'],
+ type: str,
) -> None:
"""
- Initialize a SecurityGroupTargetReferenceVirtualNetworkInterfaceReference object.
+ Initialize a VPCDNSResolverPrototypeVPCDNSResolverTypeManualPrototype object.
- :param str crn: The CRN for this virtual network interface.
- :param str href: The URL for this virtual network interface.
- :param str id: The unique identifier for this virtual network interface.
- :param str name: The name for this virtual network interface. The name is
- unique across all virtual network interfaces in the VPC.
- :param ReservedIPReference primary_ip: The primary IP for this virtual
- network interface.
- :param str resource_type: The resource type.
- :param SubnetReference subnet: The associated subnet.
- :param VirtualNetworkInterfaceReferenceDeleted deleted: (optional) If
- present, this property indicates the referenced resource has been deleted,
- and provides
- some supplementary information.
+ :param List[DNSServerPrototype] manual_servers: The DNS servers to use for
+ this VPC. All the DNS servers must either:
+ - have a unique `zone_affinity`, or
+ - not have a `zone_affinity`.
+ If `zone_affinity` is specified, exactly one DNS server must be specified
+ for each zone in the region. The DHCP [Domain Name Server
+ Option](https://datatracker.ietf.org/doc/html/rfc2132#section-3.8) for a
+ zone will list this DNS server first, followed by unique DNS servers from
+ other zones if available.
+ If `zone_affinity` is not specified, the DHCP [Domain Name Server
+ Option](https://datatracker.ietf.org/doc/html/rfc2132#section-3.8) for each
+ zone will list all the manual DNS servers in the order specified.
+ :param str type: The type of the DNS resolver to use.
"""
# pylint: disable=super-init-not-called
- self.crn = crn
- self.deleted = deleted
- self.href = href
- self.id = id
- self.name = name
- self.primary_ip = primary_ip
- self.resource_type = resource_type
- self.subnet = subnet
+ self.manual_servers = manual_servers
+ self.type = type
@classmethod
- def from_dict(cls, _dict: Dict) -> 'SecurityGroupTargetReferenceVirtualNetworkInterfaceReference':
- """Initialize a SecurityGroupTargetReferenceVirtualNetworkInterfaceReference object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VPCDNSResolverPrototypeVPCDNSResolverTypeManualPrototype':
+ """Initialize a VPCDNSResolverPrototypeVPCDNSResolverTypeManualPrototype object from a json dictionary."""
args = {}
- if 'crn' in _dict:
- args['crn'] = _dict.get('crn')
- else:
- raise ValueError('Required property \'crn\' not present in SecurityGroupTargetReferenceVirtualNetworkInterfaceReference JSON')
- if 'deleted' in _dict:
- args['deleted'] = VirtualNetworkInterfaceReferenceDeleted.from_dict(_dict.get('deleted'))
- if 'href' in _dict:
- args['href'] = _dict.get('href')
- else:
- raise ValueError('Required property \'href\' not present in SecurityGroupTargetReferenceVirtualNetworkInterfaceReference JSON')
- if 'id' in _dict:
- args['id'] = _dict.get('id')
- else:
- raise ValueError('Required property \'id\' not present in SecurityGroupTargetReferenceVirtualNetworkInterfaceReference JSON')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
- else:
- raise ValueError('Required property \'name\' not present in SecurityGroupTargetReferenceVirtualNetworkInterfaceReference JSON')
- if 'primary_ip' in _dict:
- args['primary_ip'] = ReservedIPReference.from_dict(_dict.get('primary_ip'))
+ if (manual_servers := _dict.get('manual_servers')) is not None:
+ args['manual_servers'] = [DNSServerPrototype.from_dict(v) for v in manual_servers]
else:
- raise ValueError('Required property \'primary_ip\' not present in SecurityGroupTargetReferenceVirtualNetworkInterfaceReference JSON')
- if 'resource_type' in _dict:
- args['resource_type'] = _dict.get('resource_type')
- else:
- raise ValueError('Required property \'resource_type\' not present in SecurityGroupTargetReferenceVirtualNetworkInterfaceReference JSON')
- if 'subnet' in _dict:
- args['subnet'] = SubnetReference.from_dict(_dict.get('subnet'))
+ raise ValueError('Required property \'manual_servers\' not present in VPCDNSResolverPrototypeVPCDNSResolverTypeManualPrototype JSON')
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
else:
- raise ValueError('Required property \'subnet\' not present in SecurityGroupTargetReferenceVirtualNetworkInterfaceReference JSON')
+ raise ValueError('Required property \'type\' not present in VPCDNSResolverPrototypeVPCDNSResolverTypeManualPrototype JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a SecurityGroupTargetReferenceVirtualNetworkInterfaceReference object from a json dictionary."""
+ """Initialize a VPCDNSResolverPrototypeVPCDNSResolverTypeManualPrototype object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'crn') and self.crn is not None:
- _dict['crn'] = self.crn
- if hasattr(self, 'deleted') and self.deleted is not None:
- if isinstance(self.deleted, dict):
- _dict['deleted'] = self.deleted
- else:
- _dict['deleted'] = self.deleted.to_dict()
- if hasattr(self, 'href') and self.href is not None:
- _dict['href'] = self.href
- if hasattr(self, 'id') and self.id is not None:
- _dict['id'] = self.id
- if hasattr(self, 'name') and self.name is not None:
- _dict['name'] = self.name
- if hasattr(self, 'primary_ip') and self.primary_ip is not None:
- if isinstance(self.primary_ip, dict):
- _dict['primary_ip'] = self.primary_ip
- else:
- _dict['primary_ip'] = self.primary_ip.to_dict()
- if hasattr(self, 'resource_type') and self.resource_type is not None:
- _dict['resource_type'] = self.resource_type
- if hasattr(self, 'subnet') and self.subnet is not None:
- if isinstance(self.subnet, dict):
- _dict['subnet'] = self.subnet
- else:
- _dict['subnet'] = self.subnet.to_dict()
+ if hasattr(self, 'manual_servers') and self.manual_servers is not None:
+ manual_servers_list = []
+ for v in self.manual_servers:
+ if isinstance(v, dict):
+ manual_servers_list.append(v)
+ else:
+ manual_servers_list.append(v.to_dict())
+ _dict['manual_servers'] = manual_servers_list
+ if hasattr(self, 'type') and self.type is not None:
+ _dict['type'] = self.type
return _dict
def _to_dict(self):
@@ -115261,67 +130947,70 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this SecurityGroupTargetReferenceVirtualNetworkInterfaceReference object."""
+ """Return a `str` version of this VPCDNSResolverPrototypeVPCDNSResolverTypeManualPrototype object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'SecurityGroupTargetReferenceVirtualNetworkInterfaceReference') -> bool:
+ def __eq__(self, other: 'VPCDNSResolverPrototypeVPCDNSResolverTypeManualPrototype') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'SecurityGroupTargetReferenceVirtualNetworkInterfaceReference') -> bool:
+ def __ne__(self, other: 'VPCDNSResolverPrototypeVPCDNSResolverTypeManualPrototype') -> 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 of the DNS resolver to use.
"""
- VIRTUAL_NETWORK_INTERFACE = 'virtual_network_interface'
+ MANUAL = 'manual'
-class ShareIdentityByCRN(ShareIdentity):
+class VPCDNSResolverPrototypeVPCDNSResolverTypeSystemPrototype(VPCDNSResolverPrototype):
"""
- ShareIdentityByCRN.
+ The system will provide DNS server addresses for this VPC. The system-provided DNS
+ server addresses depend on whether any endpoint gateways reside in the VPC, and
+ whether a
+ [DNS Services](https://cloud.ibm.com/docs/dns-svcs) instance is configured for the
+ VPC.
- :attr str crn: The CRN for this file share.
+ :param str type: (optional) The type of the DNS resolver to use.
"""
def __init__(
self,
- crn: str,
+ *,
+ type: Optional[str] = None,
) -> None:
"""
- Initialize a ShareIdentityByCRN object.
+ Initialize a VPCDNSResolverPrototypeVPCDNSResolverTypeSystemPrototype object.
- :param str crn: The CRN for this file share.
+ :param str type: (optional) The type of the DNS resolver to use.
"""
# pylint: disable=super-init-not-called
- self.crn = crn
+ self.type = type
@classmethod
- def from_dict(cls, _dict: Dict) -> 'ShareIdentityByCRN':
- """Initialize a ShareIdentityByCRN object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VPCDNSResolverPrototypeVPCDNSResolverTypeSystemPrototype':
+ """Initialize a VPCDNSResolverPrototypeVPCDNSResolverTypeSystemPrototype object from a json dictionary."""
args = {}
- if 'crn' in _dict:
- args['crn'] = _dict.get('crn')
- else:
- raise ValueError('Required property \'crn\' not present in ShareIdentityByCRN JSON')
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a ShareIdentityByCRN object from a json dictionary."""
+ """Initialize a VPCDNSResolverPrototypeVPCDNSResolverTypeSystemPrototype object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'crn') and self.crn is not None:
- _dict['crn'] = self.crn
+ if hasattr(self, 'type') and self.type is not None:
+ _dict['type'] = self.type
return _dict
def _to_dict(self):
@@ -115329,59 +131018,111 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this ShareIdentityByCRN object."""
+ """Return a `str` version of this VPCDNSResolverPrototypeVPCDNSResolverTypeSystemPrototype object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'ShareIdentityByCRN') -> bool:
+ def __eq__(self, other: 'VPCDNSResolverPrototypeVPCDNSResolverTypeSystemPrototype') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'ShareIdentityByCRN') -> bool:
+ def __ne__(self, other: 'VPCDNSResolverPrototypeVPCDNSResolverTypeSystemPrototype') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
+ class TypeEnum(str, Enum):
+ """
+ The type of the DNS resolver to use.
+ """
+
+ SYSTEM = 'system'
-class ShareIdentityByHref(ShareIdentity):
+
+
+class VPCDNSResolverTypeDelegated(VPCDNSResolver):
"""
- ShareIdentityByHref.
+ The DNS server addresses are delegated to the DNS resolver of another VPC.
- :attr str href: The URL for this file share.
+ :param List[DNSServer] servers: The DNS servers for this VPC. The servers are
+ populated:
+ - by the system when `dns.resolver.type` is `system`
+ - using the DNS servers in `dns.resolver.vpc` when `dns.resolver.type` is
+ `delegated`
+ - using `dns.resolver.manual_servers` when the `dns.resolver.type` is `manual`.
+ :param str type: The type of the DNS resolver used for the VPC.
+ :param VPCReferenceDNSResolverContext vpc: The VPC whose DNS resolver provides
+ the DNS server addresses for this VPC.
+ The VPC may be remote and therefore may not be directly retrievable.
"""
def __init__(
self,
- href: str,
+ servers: List['DNSServer'],
+ type: str,
+ vpc: 'VPCReferenceDNSResolverContext',
) -> None:
"""
- Initialize a ShareIdentityByHref object.
+ Initialize a VPCDNSResolverTypeDelegated object.
- :param str href: The URL for this file share.
+ :param List[DNSServer] servers: The DNS servers for this VPC. The servers
+ are populated:
+ - by the system when `dns.resolver.type` is `system`
+ - using the DNS servers in `dns.resolver.vpc` when `dns.resolver.type` is
+ `delegated`
+ - using `dns.resolver.manual_servers` when the `dns.resolver.type` is
+ `manual`.
+ :param str type: The type of the DNS resolver used for the VPC.
+ :param VPCReferenceDNSResolverContext vpc: The VPC whose DNS resolver
+ provides the DNS server addresses for this VPC.
+ The VPC may be remote and therefore may not be directly retrievable.
"""
# pylint: disable=super-init-not-called
- self.href = href
+ self.servers = servers
+ self.type = type
+ self.vpc = vpc
@classmethod
- def from_dict(cls, _dict: Dict) -> 'ShareIdentityByHref':
- """Initialize a ShareIdentityByHref object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VPCDNSResolverTypeDelegated':
+ """Initialize a VPCDNSResolverTypeDelegated object from a json dictionary."""
args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ if (servers := _dict.get('servers')) is not None:
+ args['servers'] = [DNSServer.from_dict(v) for v in servers]
else:
- raise ValueError('Required property \'href\' not present in ShareIdentityByHref JSON')
+ raise ValueError('Required property \'servers\' not present in VPCDNSResolverTypeDelegated JSON')
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
+ else:
+ raise ValueError('Required property \'type\' not present in VPCDNSResolverTypeDelegated JSON')
+ if (vpc := _dict.get('vpc')) is not None:
+ args['vpc'] = VPCReferenceDNSResolverContext.from_dict(vpc)
+ else:
+ raise ValueError('Required property \'vpc\' not present in VPCDNSResolverTypeDelegated JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a ShareIdentityByHref object from a json dictionary."""
+ """Initialize a VPCDNSResolverTypeDelegated object from 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, 'servers') and self.servers is not None:
+ servers_list = []
+ for v in self.servers:
+ if isinstance(v, dict):
+ servers_list.append(v)
+ else:
+ servers_list.append(v.to_dict())
+ _dict['servers'] = servers_list
+ if hasattr(self, 'type') and self.type is not None:
+ _dict['type'] = self.type
+ if hasattr(self, 'vpc') and self.vpc is not None:
+ if isinstance(self.vpc, dict):
+ _dict['vpc'] = self.vpc
+ else:
+ _dict['vpc'] = self.vpc.to_dict()
return _dict
def _to_dict(self):
@@ -115389,59 +131130,126 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this ShareIdentityByHref object."""
+ """Return a `str` version of this VPCDNSResolverTypeDelegated object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'ShareIdentityByHref') -> bool:
+ def __eq__(self, other: 'VPCDNSResolverTypeDelegated') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'ShareIdentityByHref') -> bool:
+ def __ne__(self, other: 'VPCDNSResolverTypeDelegated') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
+ class TypeEnum(str, Enum):
+ """
+ The type of the DNS resolver used for the VPC.
+ """
+
+ DELEGATED = 'delegated'
-class ShareIdentityById(ShareIdentity):
+
+
+class VPCDNSResolverTypeManual(VPCDNSResolver):
"""
- ShareIdentityById.
+ The DNS server addresses are manually specified.
- :attr str id: The unique identifier for this file share.
+ :param List[DNSServer] servers: The DNS servers for this VPC. The servers are
+ populated:
+ - by the system when `dns.resolver.type` is `system`
+ - using the DNS servers in `dns.resolver.vpc` when `dns.resolver.type` is
+ `delegated`
+ - using `dns.resolver.manual_servers` when the `dns.resolver.type` is `manual`.
+ :param List[DNSServer] manual_servers: The manually specified DNS servers for
+ this VPC.
+ If the DNS servers have `zone_affinity`, the DHCP [Domain Name Server
+ Option](https://datatracker.ietf.org/doc/html/rfc2132#section-3.8) for a zone
+ will list the DNS server with the affinity for that zone first, followed by the
+ unique DNS servers from other zones.
+ If the DNS servers do not have `zone_affinity`, the DHCP [Domain Name Server
+ Option](https://datatracker.ietf.org/doc/html/rfc2132#section-3.8) for each zone
+ will list all the manual DNS servers in the order specified.
+ :param str type: The type of the DNS resolver used for the VPC.
"""
def __init__(
self,
- id: str,
+ servers: List['DNSServer'],
+ manual_servers: List['DNSServer'],
+ type: str,
) -> None:
"""
- Initialize a ShareIdentityById object.
+ Initialize a VPCDNSResolverTypeManual object.
- :param str id: The unique identifier for this file share.
+ :param List[DNSServer] servers: The DNS servers for this VPC. The servers
+ are populated:
+ - by the system when `dns.resolver.type` is `system`
+ - using the DNS servers in `dns.resolver.vpc` when `dns.resolver.type` is
+ `delegated`
+ - using `dns.resolver.manual_servers` when the `dns.resolver.type` is
+ `manual`.
+ :param List[DNSServer] manual_servers: The manually specified DNS servers
+ for this VPC.
+ If the DNS servers have `zone_affinity`, the DHCP [Domain Name Server
+ Option](https://datatracker.ietf.org/doc/html/rfc2132#section-3.8) for a
+ zone will list the DNS server with the affinity for that zone first,
+ followed by the unique DNS servers from other zones.
+ If the DNS servers do not have `zone_affinity`, the DHCP [Domain Name
+ Server Option](https://datatracker.ietf.org/doc/html/rfc2132#section-3.8)
+ for each zone will list all the manual DNS servers in the order specified.
+ :param str type: The type of the DNS resolver used for the VPC.
"""
# pylint: disable=super-init-not-called
- self.id = id
+ self.servers = servers
+ self.manual_servers = manual_servers
+ self.type = type
@classmethod
- def from_dict(cls, _dict: Dict) -> 'ShareIdentityById':
- """Initialize a ShareIdentityById object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VPCDNSResolverTypeManual':
+ """Initialize a VPCDNSResolverTypeManual object from a json dictionary."""
args = {}
- if 'id' in _dict:
- args['id'] = _dict.get('id')
+ if (servers := _dict.get('servers')) is not None:
+ args['servers'] = [DNSServer.from_dict(v) for v in servers]
else:
- raise ValueError('Required property \'id\' not present in ShareIdentityById JSON')
+ raise ValueError('Required property \'servers\' not present in VPCDNSResolverTypeManual JSON')
+ if (manual_servers := _dict.get('manual_servers')) is not None:
+ args['manual_servers'] = [DNSServer.from_dict(v) for v in manual_servers]
+ else:
+ raise ValueError('Required property \'manual_servers\' not present in VPCDNSResolverTypeManual JSON')
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
+ else:
+ raise ValueError('Required property \'type\' not present in VPCDNSResolverTypeManual JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a ShareIdentityById object from a json dictionary."""
+ """Initialize a VPCDNSResolverTypeManual object from 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, 'servers') and self.servers is not None:
+ servers_list = []
+ for v in self.servers:
+ if isinstance(v, dict):
+ servers_list.append(v)
+ else:
+ servers_list.append(v.to_dict())
+ _dict['servers'] = servers_list
+ if hasattr(self, 'manual_servers') and self.manual_servers is not None:
+ manual_servers_list = []
+ for v in self.manual_servers:
+ if isinstance(v, dict):
+ manual_servers_list.append(v)
+ else:
+ manual_servers_list.append(v.to_dict())
+ _dict['manual_servers'] = manual_servers_list
+ if hasattr(self, 'type') and self.type is not None:
+ _dict['type'] = self.type
return _dict
def _to_dict(self):
@@ -115449,97 +131257,133 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this ShareIdentityById object."""
+ """Return a `str` version of this VPCDNSResolverTypeManual object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'ShareIdentityById') -> bool:
+ def __eq__(self, other: 'VPCDNSResolverTypeManual') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'ShareIdentityById') -> bool:
+ def __ne__(self, other: 'VPCDNSResolverTypeManual') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
+ class TypeEnum(str, Enum):
+ """
+ The type of the DNS resolver used for the VPC.
+ """
-class ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup(ShareMountTargetPrototype):
+ MANUAL = 'manual'
+
+
+
+class VPCDNSResolverTypeSystem(VPCDNSResolver):
"""
- The virtual network interface for this share mount target. The virtual network
- interface's VPC must not be used by a virtual network interface for another mount
- target for this share.
- Required if the share's `access_control_mode` is `security_group`.
+ The DNS server addresses are provided by the system and depend on the configuration.
- :attr str name: (optional) The name for this share mount target. The name must
- not be used by another mount target for the file share.
- :attr str transit_encryption: (optional) The transit encryption mode to use for
- this share mount target:
- - `none`: Not encrypted in transit.
- - `user_managed`: Encrypted in transit using an instance identity certificate.
- The
- `access_control_mode` for the share must be `security_group`.
- :attr ShareMountTargetVirtualNetworkInterfacePrototype
- virtual_network_interface:
+ :param List[DNSServer] servers: The DNS servers for this VPC. The servers are
+ populated:
+ - by the system when `dns.resolver.type` is `system`
+ - using the DNS servers in `dns.resolver.vpc` when `dns.resolver.type` is
+ `delegated`
+ - using `dns.resolver.manual_servers` when the `dns.resolver.type` is `manual`.
+ :param str configuration: The configuration of the system DNS resolver for this
+ VPC.
+ - `custom_resolver`: A custom DNS resolver is configured for this VPC.
+ - `private_resolver`: A private DNS resolver is configured for this VPC.
+ Applicable when
+ the VPC has either or both of the following:
+ - at least one endpoint gateway residing in it
+ - a [DNS Services](https://cloud.ibm.com/docs/dns-svcs) private zone
+ configured for it
+ - `default`: The provider default DNS resolvers are configured for this VPC.
+ This system DNS resolver configuration is used when the VPC has:
+ - no custom DNS resolver configured for it, and
+ - no endpoint gateways residing in it, and
+ - no [DNS Services](https://cloud.ibm.com/docs/dns-svcs) private zone
+ configured for it.
+ :param str type: The type of the DNS resolver used for the VPC.
"""
def __init__(
self,
- virtual_network_interface: 'ShareMountTargetVirtualNetworkInterfacePrototype',
- *,
- name: str = None,
- transit_encryption: str = None,
+ servers: List['DNSServer'],
+ configuration: str,
+ type: str,
) -> None:
"""
- Initialize a ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup object.
+ Initialize a VPCDNSResolverTypeSystem object.
- :param ShareMountTargetVirtualNetworkInterfacePrototype
- virtual_network_interface:
- :param str name: (optional) The name for this share mount target. The name
- must not be used by another mount target for the file share.
- :param str transit_encryption: (optional) The transit encryption mode to
- use for this share mount target:
- - `none`: Not encrypted in transit.
- - `user_managed`: Encrypted in transit using an instance identity
- certificate. The
- `access_control_mode` for the share must be
- `security_group`.
+ :param List[DNSServer] servers: The DNS servers for this VPC. The servers
+ are populated:
+ - by the system when `dns.resolver.type` is `system`
+ - using the DNS servers in `dns.resolver.vpc` when `dns.resolver.type` is
+ `delegated`
+ - using `dns.resolver.manual_servers` when the `dns.resolver.type` is
+ `manual`.
+ :param str configuration: The configuration of the system DNS resolver for
+ this VPC.
+ - `custom_resolver`: A custom DNS resolver is configured for this VPC.
+ - `private_resolver`: A private DNS resolver is configured for this VPC.
+ Applicable when
+ the VPC has either or both of the following:
+ - at least one endpoint gateway residing in it
+ - a [DNS Services](https://cloud.ibm.com/docs/dns-svcs) private zone
+ configured for it
+ - `default`: The provider default DNS resolvers are configured for this
+ VPC.
+ This system DNS resolver configuration is used when the VPC has:
+ - no custom DNS resolver configured for it, and
+ - no endpoint gateways residing in it, and
+ - no [DNS Services](https://cloud.ibm.com/docs/dns-svcs) private zone
+ configured for it.
+ :param str type: The type of the DNS resolver used for the VPC.
"""
# pylint: disable=super-init-not-called
- self.name = name
- self.transit_encryption = transit_encryption
- self.virtual_network_interface = virtual_network_interface
+ self.servers = servers
+ self.configuration = configuration
+ self.type = type
@classmethod
- def from_dict(cls, _dict: Dict) -> 'ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup':
- """Initialize a ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VPCDNSResolverTypeSystem':
+ """Initialize a VPCDNSResolverTypeSystem object from a json dictionary."""
args = {}
- if 'name' in _dict:
- args['name'] = _dict.get('name')
- if 'transit_encryption' in _dict:
- args['transit_encryption'] = _dict.get('transit_encryption')
- if 'virtual_network_interface' in _dict:
- args['virtual_network_interface'] = _dict.get('virtual_network_interface')
+ if (servers := _dict.get('servers')) is not None:
+ args['servers'] = [DNSServer.from_dict(v) for v in servers]
else:
- raise ValueError('Required property \'virtual_network_interface\' not present in ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup JSON')
+ raise ValueError('Required property \'servers\' not present in VPCDNSResolverTypeSystem JSON')
+ if (configuration := _dict.get('configuration')) is not None:
+ args['configuration'] = configuration
+ else:
+ raise ValueError('Required property \'configuration\' not present in VPCDNSResolverTypeSystem JSON')
+ if (type := _dict.get('type')) is not None:
+ args['type'] = type
+ else:
+ raise ValueError('Required property \'type\' not present in VPCDNSResolverTypeSystem JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup object from a json dictionary."""
+ """Initialize a VPCDNSResolverTypeSystem object from 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, 'transit_encryption') and self.transit_encryption is not None:
- _dict['transit_encryption'] = self.transit_encryption
- if hasattr(self, 'virtual_network_interface') and self.virtual_network_interface is not None:
- if isinstance(self.virtual_network_interface, dict):
- _dict['virtual_network_interface'] = self.virtual_network_interface
- else:
- _dict['virtual_network_interface'] = self.virtual_network_interface.to_dict()
+ if hasattr(self, 'servers') and self.servers is not None:
+ servers_list = []
+ for v in self.servers:
+ if isinstance(v, dict):
+ servers_list.append(v)
+ else:
+ servers_list.append(v.to_dict())
+ _dict['servers'] = servers_list
+ if hasattr(self, 'configuration') and self.configuration is not None:
+ _dict['configuration'] = self.configuration
+ if hasattr(self, 'type') and self.type is not None:
+ _dict['type'] = self.type
return _dict
def _to_dict(self):
@@ -115547,107 +131391,90 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup object."""
+ """Return a `str` version of this VPCDNSResolverTypeSystem object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup') -> bool:
+ def __eq__(self, other: 'VPCDNSResolverTypeSystem') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup') -> bool:
+ def __ne__(self, other: 'VPCDNSResolverTypeSystem') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class TransitEncryptionEnum(str, Enum):
+ class ConfigurationEnum(str, Enum):
"""
- The transit encryption mode to use for this share mount target:
- - `none`: Not encrypted in transit.
- - `user_managed`: Encrypted in transit using an instance identity certificate.
- The
- `access_control_mode` for the share must be `security_group`.
+ The configuration of the system DNS resolver for this VPC.
+ - `custom_resolver`: A custom DNS resolver is configured for this VPC.
+ - `private_resolver`: A private DNS resolver is configured for this VPC.
+ Applicable when
+ the VPC has either or both of the following:
+ - at least one endpoint gateway residing in it
+ - a [DNS Services](https://cloud.ibm.com/docs/dns-svcs) private zone
+ configured for it
+ - `default`: The provider default DNS resolvers are configured for this VPC.
+ This system DNS resolver configuration is used when the VPC has:
+ - no custom DNS resolver configured for it, and
+ - no endpoint gateways residing in it, and
+ - no [DNS Services](https://cloud.ibm.com/docs/dns-svcs) private zone configured
+ for it.
"""
- NONE = 'none'
- USER_MANAGED = 'user_managed'
+ CUSTOM_RESOLVER = 'custom_resolver'
+ DEFAULT = 'default'
+ PRIVATE_RESOLVER = 'private_resolver'
+ class TypeEnum(str, Enum):
+ """
+ The type of the DNS resolver used for the VPC.
+ """
-class ShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC(ShareMountTargetPrototype):
+ SYSTEM = 'system'
+
+
+
+class VPCDNSResolverVPCPatchVPCIdentityByCRN(VPCDNSResolverVPCPatch):
"""
- The VPC in which clients can mount the file share using this mount target. The VPC
- must not be used by another mount target for this share.
- Required if the share's `access_control_mode` is `vpc`.
+ VPCDNSResolverVPCPatchVPCIdentityByCRN.
- :attr str name: (optional) The name for this share mount target. The name must
- not be used by another mount target for the file share.
- :attr str transit_encryption: (optional) The transit encryption mode to use for
- this share mount target:
- - `none`: Not encrypted in transit.
- - `user_managed`: Encrypted in transit using an instance identity certificate.
- The
- `access_control_mode` for the share must be `security_group`.
- :attr VPCIdentity vpc: Identifies a VPC by a unique property.
+ :param str crn: The CRN for this VPC.
"""
def __init__(
self,
- vpc: 'VPCIdentity',
- *,
- name: str = None,
- transit_encryption: str = None,
+ crn: str,
) -> None:
"""
- Initialize a ShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC object.
+ Initialize a VPCDNSResolverVPCPatchVPCIdentityByCRN object.
- :param VPCIdentity vpc: Identifies a VPC by a unique property.
- :param str name: (optional) The name for this share mount target. The name
- must not be used by another mount target for the file share.
- :param str transit_encryption: (optional) The transit encryption mode to
- use for this share mount target:
- - `none`: Not encrypted in transit.
- - `user_managed`: Encrypted in transit using an instance identity
- certificate. The
- `access_control_mode` for the share must be
- `security_group`.
+ :param str crn: The CRN for this VPC.
"""
# pylint: disable=super-init-not-called
- self.name = name
- self.transit_encryption = transit_encryption
- self.vpc = vpc
+ self.crn = crn
@classmethod
- def from_dict(cls, _dict: Dict) -> 'ShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC':
- """Initialize a ShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VPCDNSResolverVPCPatchVPCIdentityByCRN':
+ """Initialize a VPCDNSResolverVPCPatchVPCIdentityByCRN object from a json dictionary."""
args = {}
- if 'name' in _dict:
- args['name'] = _dict.get('name')
- if 'transit_encryption' in _dict:
- args['transit_encryption'] = _dict.get('transit_encryption')
- if 'vpc' in _dict:
- args['vpc'] = _dict.get('vpc')
+ if (crn := _dict.get('crn')) is not None:
+ args['crn'] = crn
else:
- raise ValueError('Required property \'vpc\' not present in ShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC JSON')
+ raise ValueError('Required property \'crn\' not present in VPCDNSResolverVPCPatchVPCIdentityByCRN JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a ShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC object from a json dictionary."""
+ """Initialize a VPCDNSResolverVPCPatchVPCIdentityByCRN object from 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, 'transit_encryption') and self.transit_encryption is not None:
- _dict['transit_encryption'] = self.transit_encryption
- if hasattr(self, 'vpc') and self.vpc is not None:
- if isinstance(self.vpc, dict):
- _dict['vpc'] = self.vpc
- else:
- _dict['vpc'] = self.vpc.to_dict()
+ if hasattr(self, 'crn') and self.crn is not None:
+ _dict['crn'] = self.crn
return _dict
def _to_dict(self):
@@ -115655,161 +131482,59 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this ShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC object."""
+ """Return a `str` version of this VPCDNSResolverVPCPatchVPCIdentityByCRN object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'ShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC') -> bool:
+ def __eq__(self, other: 'VPCDNSResolverVPCPatchVPCIdentityByCRN') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'ShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC') -> bool:
+ def __ne__(self, other: 'VPCDNSResolverVPCPatchVPCIdentityByCRN') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class TransitEncryptionEnum(str, Enum):
- """
- The transit encryption mode to use for this share mount target:
- - `none`: Not encrypted in transit.
- - `user_managed`: Encrypted in transit using an instance identity certificate.
- The
- `access_control_mode` for the share must be `security_group`.
- """
-
- NONE = 'none'
- USER_MANAGED = 'user_managed'
-
-
-class ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfacePrototypeShareMountTargetContext(ShareMountTargetVirtualNetworkInterfacePrototype):
+class VPCDNSResolverVPCPatchVPCIdentityByHref(VPCDNSResolverVPCPatch):
"""
- The virtual network interface for this target.
+ VPCDNSResolverVPCPatchVPCIdentityByHref.
- :attr str name: (optional) The name for this virtual network interface. The name
- must not be used by another virtual network interface in the VPC. If
- unspecified, the name will be a hyphenated list of randomly-selected words.
- Names beginning with `ibm-` are reserved for provider-owned resources, and are
- not allowed.
- :attr VirtualNetworkInterfacePrimaryIPPrototype primary_ip: (optional) The
- primary IP address to bind to the virtual network interface. May be either a
- reserved IP identity, or a reserved IP prototype object which will be used to
- create a
- new reserved IP.
- If a reserved IP identity is provided, the specified reserved IP must be
- unbound.
- If a reserved IP prototype object with an address is provided, the address must
- be
- available on the virtual network interface's subnet. If no address is specified,
- an available address on the subnet will be automatically selected and reserved.
- :attr ResourceGroupIdentity resource_group: (optional) The resource group to use
- for this virtual network interface. If unspecified, the
- share's resource group will be used.
- :attr List[SecurityGroupIdentity] security_groups: (optional) The security
- groups to use for this virtual network interface. If unspecified, the default
- security group of the VPC for the subnet is used.
- :attr SubnetIdentity subnet: (optional) The associated subnet. Required if
- `primary_ip` does not specify a reserved IP
- identity.
+ :param str href: The URL for this VPC.
"""
def __init__(
self,
- *,
- name: str = None,
- primary_ip: 'VirtualNetworkInterfacePrimaryIPPrototype' = None,
- resource_group: 'ResourceGroupIdentity' = None,
- security_groups: List['SecurityGroupIdentity'] = None,
- subnet: 'SubnetIdentity' = None,
+ href: str,
) -> None:
"""
- Initialize a ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfacePrototypeShareMountTargetContext object.
+ Initialize a VPCDNSResolverVPCPatchVPCIdentityByHref object.
- :param str name: (optional) The name for this virtual network interface.
- The name must not be used by another virtual network interface in the VPC.
- If unspecified, the name will be a hyphenated list of randomly-selected
- words. Names beginning with `ibm-` are reserved for provider-owned
- resources, and are not allowed.
- :param VirtualNetworkInterfacePrimaryIPPrototype primary_ip: (optional) The
- primary IP address to bind to the virtual network interface. May be either
- a
- reserved IP identity, or a reserved IP prototype object which will be used
- to create a
- new reserved IP.
- If a reserved IP identity is provided, the specified reserved IP must be
- unbound.
- If a reserved IP prototype object with an address is provided, the address
- must be
- available on the virtual network interface's subnet. If no address is
- specified,
- an available address on the subnet will be automatically selected and
- reserved.
- :param ResourceGroupIdentity resource_group: (optional) The resource group
- to use for this virtual network interface. If unspecified, the
- share's resource group will be used.
- :param List[SecurityGroupIdentity] security_groups: (optional) The security
- groups to use for this virtual network interface. If unspecified, the
- default security group of the VPC for the subnet is used.
- :param SubnetIdentity subnet: (optional) The associated subnet. Required if
- `primary_ip` does not specify a reserved IP
- identity.
+ :param str href: The URL for this VPC.
"""
# pylint: disable=super-init-not-called
- self.name = name
- self.primary_ip = primary_ip
- self.resource_group = resource_group
- self.security_groups = security_groups
- self.subnet = subnet
-
- @classmethod
- def from_dict(cls, _dict: Dict) -> 'ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfacePrototypeShareMountTargetContext':
- """Initialize a ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfacePrototypeShareMountTargetContext object from a json dictionary."""
- args = {}
- if 'name' in _dict:
- args['name'] = _dict.get('name')
- if 'primary_ip' in _dict:
- args['primary_ip'] = _dict.get('primary_ip')
- if 'resource_group' in _dict:
- args['resource_group'] = _dict.get('resource_group')
- if 'security_groups' in _dict:
- args['security_groups'] = _dict.get('security_groups')
- if 'subnet' in _dict:
- args['subnet'] = _dict.get('subnet')
- return cls(**args)
-
- @classmethod
- def _from_dict(cls, _dict):
- """Initialize a ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfacePrototypeShareMountTargetContext object from a json dictionary."""
- return cls.from_dict(_dict)
-
- def to_dict(self) -> Dict:
- """Return a json dictionary representing this model."""
- _dict = {}
- if hasattr(self, 'name') and self.name is not None:
- _dict['name'] = self.name
- if hasattr(self, 'primary_ip') and self.primary_ip is not None:
- if isinstance(self.primary_ip, dict):
- _dict['primary_ip'] = self.primary_ip
- else:
- _dict['primary_ip'] = self.primary_ip.to_dict()
- if hasattr(self, 'resource_group') and self.resource_group is not None:
- if isinstance(self.resource_group, dict):
- _dict['resource_group'] = self.resource_group
- else:
- _dict['resource_group'] = self.resource_group.to_dict()
- if hasattr(self, 'security_groups') and self.security_groups is not None:
- security_groups_list = []
- for v in self.security_groups:
- if isinstance(v, dict):
- security_groups_list.append(v)
- else:
- security_groups_list.append(v.to_dict())
- _dict['security_groups'] = security_groups_list
- if hasattr(self, 'subnet') and self.subnet is not None:
- if isinstance(self.subnet, dict):
- _dict['subnet'] = self.subnet
- else:
- _dict['subnet'] = self.subnet.to_dict()
+ self.href = href
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'VPCDNSResolverVPCPatchVPCIdentityByHref':
+ """Initialize a VPCDNSResolverVPCPatchVPCIdentityByHref object from a json dictionary."""
+ args = {}
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
+ else:
+ raise ValueError('Required property \'href\' not present in VPCDNSResolverVPCPatchVPCIdentityByHref JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a VPCDNSResolverVPCPatchVPCIdentityByHref object from 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):
@@ -115817,90 +131542,59 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfacePrototypeShareMountTargetContext object."""
+ """Return a `str` version of this VPCDNSResolverVPCPatchVPCIdentityByHref object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfacePrototypeShareMountTargetContext') -> bool:
+ def __eq__(self, other: 'VPCDNSResolverVPCPatchVPCIdentityByHref') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfacePrototypeShareMountTargetContext') -> bool:
+ def __ne__(self, other: 'VPCDNSResolverVPCPatchVPCIdentityByHref') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class ShareProfileCapacityDependentRange(ShareProfileCapacity):
+class VPCDNSResolverVPCPatchVPCIdentityById(VPCDNSResolverVPCPatch):
"""
- The permitted total capacity (in gigabytes) of a share with this profile depends on
- its configuration.
+ VPCDNSResolverVPCPatchVPCIdentityById.
- :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.
+ :param str id: The unique identifier for this VPC.
"""
def __init__(
self,
- max: int,
- min: int,
- step: int,
- type: str,
+ id: str,
) -> None:
"""
- Initialize a ShareProfileCapacityDependentRange object.
+ Initialize a VPCDNSResolverVPCPatchVPCIdentityById object.
- :param int max: The maximum value for this profile field.
- :param int min: The minimum value for this profile field.
- :param int step: The increment step value for this profile field.
- :param str type: The type for this profile field.
+ :param str id: The unique identifier for this VPC.
"""
# pylint: disable=super-init-not-called
- self.max = max
- self.min = min
- self.step = step
- self.type = type
+ self.id = id
@classmethod
- def from_dict(cls, _dict: Dict) -> 'ShareProfileCapacityDependentRange':
- """Initialize a ShareProfileCapacityDependentRange object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VPCDNSResolverVPCPatchVPCIdentityById':
+ """Initialize a VPCDNSResolverVPCPatchVPCIdentityById object from a json dictionary."""
args = {}
- if 'max' in _dict:
- args['max'] = _dict.get('max')
- else:
- raise ValueError('Required property \'max\' not present in ShareProfileCapacityDependentRange JSON')
- if 'min' in _dict:
- args['min'] = _dict.get('min')
- else:
- raise ValueError('Required property \'min\' not present in ShareProfileCapacityDependentRange JSON')
- if 'step' in _dict:
- args['step'] = _dict.get('step')
- else:
- raise ValueError('Required property \'step\' not present in ShareProfileCapacityDependentRange JSON')
- if 'type' in _dict:
- args['type'] = _dict.get('type')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
else:
- raise ValueError('Required property \'type\' not present in ShareProfileCapacityDependentRange JSON')
+ raise ValueError('Required property \'id\' not present in VPCDNSResolverVPCPatchVPCIdentityById JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a ShareProfileCapacityDependentRange object from a json dictionary."""
+ """Initialize a VPCDNSResolverVPCPatchVPCIdentityById object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'max') and self.max is not None:
- _dict['max'] = self.max
- if hasattr(self, 'min') and self.min is not None:
- _dict['min'] = self.min
- if hasattr(self, 'step') and self.step is not None:
- _dict['step'] = self.step
- if hasattr(self, 'type') and self.type is not None:
- _dict['type'] = self.type
+ if hasattr(self, 'id') and self.id is not None:
+ _dict['id'] = self.id
return _dict
def _to_dict(self):
@@ -115908,88 +131602,59 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this ShareProfileCapacityDependentRange object."""
+ """Return a `str` version of this VPCDNSResolverVPCPatchVPCIdentityById object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'ShareProfileCapacityDependentRange') -> bool:
+ def __eq__(self, other: 'VPCDNSResolverVPCPatchVPCIdentityById') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'ShareProfileCapacityDependentRange') -> bool:
+ def __ne__(self, other: 'VPCDNSResolverVPCPatchVPCIdentityById') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class TypeEnum(str, Enum):
- """
- The type for this profile field.
- """
-
- DEPENDENT = 'dependent'
- DEPENDENT_RANGE = 'dependent_range'
-
-
-class ShareProfileCapacityEnum(ShareProfileCapacity):
+class VPCIdentityByCRN(VPCIdentity):
"""
- The permitted total capacities (in gigabytes) of a share with this profile.
+ VPCIdentityByCRN.
- :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.
+ :param str crn: The CRN for this VPC.
"""
def __init__(
self,
- default: int,
- type: str,
- values: List[int],
+ crn: str,
) -> None:
"""
- Initialize a ShareProfileCapacityEnum object.
+ Initialize a VPCIdentityByCRN object.
- :param int default: The default value for this profile field.
- :param str type: The type for this profile field.
- :param List[int] values: The permitted values for this profile field.
+ :param str crn: The CRN for this VPC.
"""
# pylint: disable=super-init-not-called
- self.default = default
- self.type = type
- self.values = values
+ self.crn = crn
@classmethod
- def from_dict(cls, _dict: Dict) -> 'ShareProfileCapacityEnum':
- """Initialize a ShareProfileCapacityEnum object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VPCIdentityByCRN':
+ """Initialize a VPCIdentityByCRN object from a json dictionary."""
args = {}
- if 'default' in _dict:
- args['default'] = _dict.get('default')
- else:
- raise ValueError('Required property \'default\' not present in ShareProfileCapacityEnum JSON')
- if 'type' in _dict:
- args['type'] = _dict.get('type')
- else:
- raise ValueError('Required property \'type\' not present in ShareProfileCapacityEnum JSON')
- if 'values' in _dict:
- args['values'] = _dict.get('values')
+ if (crn := _dict.get('crn')) is not None:
+ args['crn'] = crn
else:
- raise ValueError('Required property \'values\' not present in ShareProfileCapacityEnum JSON')
+ raise ValueError('Required property \'crn\' not present in VPCIdentityByCRN JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a ShareProfileCapacityEnum object from a json dictionary."""
+ """Initialize a VPCIdentityByCRN object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'default') and self.default is not None:
- _dict['default'] = self.default
- if hasattr(self, 'type') and self.type is not None:
- _dict['type'] = self.type
- if hasattr(self, 'values') and self.values is not None:
- _dict['values'] = self.values
+ if hasattr(self, 'crn') and self.crn is not None:
+ _dict['crn'] = self.crn
return _dict
def _to_dict(self):
@@ -115997,77 +131662,59 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this ShareProfileCapacityEnum object."""
+ """Return a `str` version of this VPCIdentityByCRN object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'ShareProfileCapacityEnum') -> bool:
+ def __eq__(self, other: 'VPCIdentityByCRN') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'ShareProfileCapacityEnum') -> bool:
+ def __ne__(self, other: 'VPCIdentityByCRN') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class TypeEnum(str, Enum):
- """
- The type for this profile field.
- """
-
- ENUM = 'enum'
-
-
-class ShareProfileCapacityFixed(ShareProfileCapacity):
+class VPCIdentityByHref(VPCIdentity):
"""
- The permitted total capacity (in gigabytes) of a share with this profile is fixed.
+ VPCIdentityByHref.
- :attr str type: The type for this profile field.
- :attr int value: The value for this profile field.
+ :param str href: The URL for this VPC.
"""
def __init__(
self,
- type: str,
- value: int,
+ href: str,
) -> None:
"""
- Initialize a ShareProfileCapacityFixed object.
+ Initialize a VPCIdentityByHref object.
- :param str type: The type for this profile field.
- :param int value: The value for this profile field.
+ :param str href: The URL for this VPC.
"""
# pylint: disable=super-init-not-called
- self.type = type
- self.value = value
+ self.href = href
@classmethod
- def from_dict(cls, _dict: Dict) -> 'ShareProfileCapacityFixed':
- """Initialize a ShareProfileCapacityFixed object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VPCIdentityByHref':
+ """Initialize a VPCIdentityByHref object from a json dictionary."""
args = {}
- if 'type' in _dict:
- args['type'] = _dict.get('type')
- else:
- raise ValueError('Required property \'type\' not present in ShareProfileCapacityFixed JSON')
- if 'value' in _dict:
- args['value'] = _dict.get('value')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'value\' not present in ShareProfileCapacityFixed JSON')
+ raise ValueError('Required property \'href\' not present in VPCIdentityByHref JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a ShareProfileCapacityFixed object from a json dictionary."""
+ """Initialize a VPCIdentityByHref object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'type') and self.type is not None:
- _dict['type'] = self.type
- if hasattr(self, 'value') and self.value is not None:
- _dict['value'] = self.value
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
return _dict
def _to_dict(self):
@@ -116075,107 +131722,59 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this ShareProfileCapacityFixed object."""
+ """Return a `str` version of this VPCIdentityByHref object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'ShareProfileCapacityFixed') -> bool:
+ def __eq__(self, other: 'VPCIdentityByHref') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'ShareProfileCapacityFixed') -> bool:
+ def __ne__(self, other: 'VPCIdentityByHref') -> 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 ShareProfileCapacityRange(ShareProfileCapacity):
+class VPCIdentityById(VPCIdentity):
"""
- The permitted total capacity range (in gigabytes) of a share with this profile.
+ VPCIdentityById.
- :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.
+ :param str id: The unique identifier for this VPC.
"""
def __init__(
self,
- default: int,
- max: int,
- min: int,
- step: int,
- type: str,
+ id: str,
) -> None:
"""
- Initialize a ShareProfileCapacityRange object.
+ Initialize a VPCIdentityById object.
- :param int default: The default value for this profile field.
- :param int max: The maximum value for this profile field.
- :param int min: The minimum value for this profile field.
- :param int step: The increment step value for this profile field.
- :param str type: The type for this profile field.
+ :param str id: The unique identifier for this VPC.
"""
# pylint: disable=super-init-not-called
- self.default = default
- self.max = max
- self.min = min
- self.step = step
- self.type = type
+ self.id = id
@classmethod
- def from_dict(cls, _dict: Dict) -> 'ShareProfileCapacityRange':
- """Initialize a ShareProfileCapacityRange object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VPCIdentityById':
+ """Initialize a VPCIdentityById object from a json dictionary."""
args = {}
- if 'default' in _dict:
- args['default'] = _dict.get('default')
- else:
- raise ValueError('Required property \'default\' not present in ShareProfileCapacityRange JSON')
- if 'max' in _dict:
- args['max'] = _dict.get('max')
- else:
- raise ValueError('Required property \'max\' not present in ShareProfileCapacityRange JSON')
- if 'min' in _dict:
- args['min'] = _dict.get('min')
- else:
- raise ValueError('Required property \'min\' not present in ShareProfileCapacityRange JSON')
- if 'step' in _dict:
- args['step'] = _dict.get('step')
- else:
- raise ValueError('Required property \'step\' not present in ShareProfileCapacityRange JSON')
- if 'type' in _dict:
- args['type'] = _dict.get('type')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
else:
- raise ValueError('Required property \'type\' not present in ShareProfileCapacityRange JSON')
+ raise ValueError('Required property \'id\' not present in VPCIdentityById JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a ShareProfileCapacityRange object from a json dictionary."""
+ """Initialize a VPCIdentityById object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'default') and self.default is not None:
- _dict['default'] = self.default
- if hasattr(self, 'max') and self.max is not None:
- _dict['max'] = self.max
- if hasattr(self, 'min') and self.min is not None:
- _dict['min'] = self.min
- if hasattr(self, 'step') and self.step is not None:
- _dict['step'] = self.step
- if hasattr(self, 'type') and self.type is not None:
- _dict['type'] = self.type
+ if hasattr(self, 'id') and self.id is not None:
+ _dict['id'] = self.id
return _dict
def _to_dict(self):
@@ -116183,97 +131782,59 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this ShareProfileCapacityRange object."""
+ """Return a `str` version of this VPCIdentityById object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'ShareProfileCapacityRange') -> bool:
+ def __eq__(self, other: 'VPCIdentityById') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'ShareProfileCapacityRange') -> bool:
+ def __ne__(self, other: 'VPCIdentityById') -> 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 ShareProfileIOPSDependentRange(ShareProfileIOPS):
+class VPNGatewayConnectionIKEPolicyPatchIKEPolicyIdentityByHref(VPNGatewayConnectionIKEPolicyPatch):
"""
- The permitted IOPS range of a share with this profile depends on its configuration.
+ VPNGatewayConnectionIKEPolicyPatchIKEPolicyIdentityByHref.
- :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.
+ :param str href: The IKE policy's canonical URL.
"""
def __init__(
self,
- max: int,
- min: int,
- step: int,
- type: str,
+ href: str,
) -> None:
"""
- Initialize a ShareProfileIOPSDependentRange object.
+ Initialize a VPNGatewayConnectionIKEPolicyPatchIKEPolicyIdentityByHref object.
- :param int max: The maximum value for this profile field.
- :param int min: The minimum value for this profile field.
- :param int step: The increment step value for this profile field.
- :param str type: The type for this profile field.
+ :param str href: The IKE policy's canonical URL.
"""
# pylint: disable=super-init-not-called
- self.max = max
- self.min = min
- self.step = step
- self.type = type
+ self.href = href
@classmethod
- def from_dict(cls, _dict: Dict) -> 'ShareProfileIOPSDependentRange':
- """Initialize a ShareProfileIOPSDependentRange object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VPNGatewayConnectionIKEPolicyPatchIKEPolicyIdentityByHref':
+ """Initialize a VPNGatewayConnectionIKEPolicyPatchIKEPolicyIdentityByHref object from a json dictionary."""
args = {}
- if 'max' in _dict:
- args['max'] = _dict.get('max')
- else:
- raise ValueError('Required property \'max\' not present in ShareProfileIOPSDependentRange JSON')
- if 'min' in _dict:
- args['min'] = _dict.get('min')
- else:
- raise ValueError('Required property \'min\' not present in ShareProfileIOPSDependentRange JSON')
- if 'step' in _dict:
- args['step'] = _dict.get('step')
- else:
- raise ValueError('Required property \'step\' not present in ShareProfileIOPSDependentRange JSON')
- if 'type' in _dict:
- args['type'] = _dict.get('type')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'type\' not present in ShareProfileIOPSDependentRange JSON')
+ raise ValueError('Required property \'href\' not present in VPNGatewayConnectionIKEPolicyPatchIKEPolicyIdentityByHref JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a ShareProfileIOPSDependentRange object from a json dictionary."""
+ """Initialize a VPNGatewayConnectionIKEPolicyPatchIKEPolicyIdentityByHref object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'max') and self.max is not None:
- _dict['max'] = self.max
- if hasattr(self, 'min') and self.min is not None:
- _dict['min'] = self.min
- if hasattr(self, 'step') and self.step is not None:
- _dict['step'] = self.step
- if hasattr(self, 'type') and self.type is not None:
- _dict['type'] = self.type
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
return _dict
def _to_dict(self):
@@ -116281,88 +131842,59 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this ShareProfileIOPSDependentRange object."""
+ """Return a `str` version of this VPNGatewayConnectionIKEPolicyPatchIKEPolicyIdentityByHref object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'ShareProfileIOPSDependentRange') -> bool:
+ def __eq__(self, other: 'VPNGatewayConnectionIKEPolicyPatchIKEPolicyIdentityByHref') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'ShareProfileIOPSDependentRange') -> bool:
+ def __ne__(self, other: 'VPNGatewayConnectionIKEPolicyPatchIKEPolicyIdentityByHref') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class TypeEnum(str, Enum):
- """
- The type for this profile field.
- """
-
- DEPENDENT = 'dependent'
- DEPENDENT_RANGE = 'dependent_range'
-
-
-class ShareProfileIOPSEnum(ShareProfileIOPS):
+class VPNGatewayConnectionIKEPolicyPatchIKEPolicyIdentityById(VPNGatewayConnectionIKEPolicyPatch):
"""
- The permitted IOPS values of a share with this profile.
+ VPNGatewayConnectionIKEPolicyPatchIKEPolicyIdentityById.
- :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.
+ :param str id: The unique identifier for this IKE policy.
"""
def __init__(
self,
- default: int,
- type: str,
- values: List[int],
+ id: str,
) -> None:
"""
- Initialize a ShareProfileIOPSEnum object.
+ Initialize a VPNGatewayConnectionIKEPolicyPatchIKEPolicyIdentityById object.
- :param int default: The default value for this profile field.
- :param str type: The type for this profile field.
- :param List[int] values: The permitted values for this profile field.
+ :param str id: The unique identifier for this IKE policy.
"""
# pylint: disable=super-init-not-called
- self.default = default
- self.type = type
- self.values = values
+ self.id = id
@classmethod
- def from_dict(cls, _dict: Dict) -> 'ShareProfileIOPSEnum':
- """Initialize a ShareProfileIOPSEnum object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VPNGatewayConnectionIKEPolicyPatchIKEPolicyIdentityById':
+ """Initialize a VPNGatewayConnectionIKEPolicyPatchIKEPolicyIdentityById object from a json dictionary."""
args = {}
- if 'default' in _dict:
- args['default'] = _dict.get('default')
- else:
- raise ValueError('Required property \'default\' not present in ShareProfileIOPSEnum JSON')
- if 'type' in _dict:
- args['type'] = _dict.get('type')
- else:
- raise ValueError('Required property \'type\' not present in ShareProfileIOPSEnum JSON')
- if 'values' in _dict:
- args['values'] = _dict.get('values')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
else:
- raise ValueError('Required property \'values\' not present in ShareProfileIOPSEnum JSON')
+ raise ValueError('Required property \'id\' not present in VPNGatewayConnectionIKEPolicyPatchIKEPolicyIdentityById JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a ShareProfileIOPSEnum object from a json dictionary."""
+ """Initialize a VPNGatewayConnectionIKEPolicyPatchIKEPolicyIdentityById object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'default') and self.default is not None:
- _dict['default'] = self.default
- if hasattr(self, 'type') and self.type is not None:
- _dict['type'] = self.type
- if hasattr(self, 'values') and self.values is not None:
- _dict['values'] = self.values
+ if hasattr(self, 'id') and self.id is not None:
+ _dict['id'] = self.id
return _dict
def _to_dict(self):
@@ -116370,77 +131902,59 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this ShareProfileIOPSEnum object."""
+ """Return a `str` version of this VPNGatewayConnectionIKEPolicyPatchIKEPolicyIdentityById object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'ShareProfileIOPSEnum') -> bool:
+ def __eq__(self, other: 'VPNGatewayConnectionIKEPolicyPatchIKEPolicyIdentityById') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'ShareProfileIOPSEnum') -> bool:
+ def __ne__(self, other: 'VPNGatewayConnectionIKEPolicyPatchIKEPolicyIdentityById') -> 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 ShareProfileIOPSFixed(ShareProfileIOPS):
+class VPNGatewayConnectionIKEPolicyPrototypeIKEPolicyIdentityByHref(VPNGatewayConnectionIKEPolicyPrototype):
"""
- The permitted IOPS of a share with this profile is fixed.
+ VPNGatewayConnectionIKEPolicyPrototypeIKEPolicyIdentityByHref.
- :attr str type: The type for this profile field.
- :attr int value: The value for this profile field.
+ :param str href: The IKE policy's canonical URL.
"""
def __init__(
self,
- type: str,
- value: int,
+ href: str,
) -> None:
"""
- Initialize a ShareProfileIOPSFixed object.
+ Initialize a VPNGatewayConnectionIKEPolicyPrototypeIKEPolicyIdentityByHref 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.
"""
# pylint: disable=super-init-not-called
- self.type = type
- self.value = value
+ self.href = href
@classmethod
- def from_dict(cls, _dict: Dict) -> 'ShareProfileIOPSFixed':
- """Initialize a ShareProfileIOPSFixed object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VPNGatewayConnectionIKEPolicyPrototypeIKEPolicyIdentityByHref':
+ """Initialize a VPNGatewayConnectionIKEPolicyPrototypeIKEPolicyIdentityByHref object from a json dictionary."""
args = {}
- if 'type' in _dict:
- args['type'] = _dict.get('type')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'type\' not present in ShareProfileIOPSFixed JSON')
- if 'value' in _dict:
- args['value'] = _dict.get('value')
- else:
- raise ValueError('Required property \'value\' not present in ShareProfileIOPSFixed JSON')
+ raise ValueError('Required property \'href\' not present in VPNGatewayConnectionIKEPolicyPrototypeIKEPolicyIdentityByHref JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a ShareProfileIOPSFixed object from a json dictionary."""
+ """Initialize a VPNGatewayConnectionIKEPolicyPrototypeIKEPolicyIdentityByHref object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'type') and self.type is not None:
- _dict['type'] = self.type
- if hasattr(self, 'value') and self.value is not None:
- _dict['value'] = self.value
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
return _dict
def _to_dict(self):
@@ -116448,107 +131962,59 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this ShareProfileIOPSFixed object."""
+ """Return a `str` version of this VPNGatewayConnectionIKEPolicyPrototypeIKEPolicyIdentityByHref object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'ShareProfileIOPSFixed') -> bool:
+ def __eq__(self, other: 'VPNGatewayConnectionIKEPolicyPrototypeIKEPolicyIdentityByHref') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'ShareProfileIOPSFixed') -> bool:
+ def __ne__(self, other: 'VPNGatewayConnectionIKEPolicyPrototypeIKEPolicyIdentityByHref') -> 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 ShareProfileIOPSRange(ShareProfileIOPS):
+class VPNGatewayConnectionIKEPolicyPrototypeIKEPolicyIdentityById(VPNGatewayConnectionIKEPolicyPrototype):
"""
- The permitted IOPS range of a share with this profile.
+ VPNGatewayConnectionIKEPolicyPrototypeIKEPolicyIdentityById.
- :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.
+ :param str id: The unique identifier for this IKE policy.
"""
def __init__(
self,
- default: int,
- max: int,
- min: int,
- step: int,
- type: str,
+ id: str,
) -> None:
"""
- Initialize a ShareProfileIOPSRange object.
+ Initialize a VPNGatewayConnectionIKEPolicyPrototypeIKEPolicyIdentityById object.
- :param int default: The default value for this profile field.
- :param int max: The maximum value for this profile field.
- :param int min: The minimum value for this profile field.
- :param int step: The increment step value for this profile field.
- :param str type: The type for this profile field.
+ :param str id: The unique identifier for this IKE policy.
"""
# pylint: disable=super-init-not-called
- self.default = default
- self.max = max
- self.min = min
- self.step = step
- self.type = type
+ self.id = id
@classmethod
- def from_dict(cls, _dict: Dict) -> 'ShareProfileIOPSRange':
- """Initialize a ShareProfileIOPSRange object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VPNGatewayConnectionIKEPolicyPrototypeIKEPolicyIdentityById':
+ """Initialize a VPNGatewayConnectionIKEPolicyPrototypeIKEPolicyIdentityById object from a json dictionary."""
args = {}
- if 'default' in _dict:
- args['default'] = _dict.get('default')
- else:
- raise ValueError('Required property \'default\' not present in ShareProfileIOPSRange JSON')
- if 'max' in _dict:
- args['max'] = _dict.get('max')
- else:
- raise ValueError('Required property \'max\' not present in ShareProfileIOPSRange JSON')
- if 'min' in _dict:
- args['min'] = _dict.get('min')
- else:
- raise ValueError('Required property \'min\' not present in ShareProfileIOPSRange JSON')
- if 'step' in _dict:
- args['step'] = _dict.get('step')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
else:
- raise ValueError('Required property \'step\' not present in ShareProfileIOPSRange JSON')
- if 'type' in _dict:
- args['type'] = _dict.get('type')
- else:
- raise ValueError('Required property \'type\' not present in ShareProfileIOPSRange JSON')
+ raise ValueError('Required property \'id\' not present in VPNGatewayConnectionIKEPolicyPrototypeIKEPolicyIdentityById JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a ShareProfileIOPSRange object from a json dictionary."""
+ """Initialize a VPNGatewayConnectionIKEPolicyPrototypeIKEPolicyIdentityById object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'default') and self.default is not None:
- _dict['default'] = self.default
- if hasattr(self, 'max') and self.max is not None:
- _dict['max'] = self.max
- if hasattr(self, 'min') and self.min is not None:
- _dict['min'] = self.min
- if hasattr(self, 'step') and self.step is not None:
- _dict['step'] = self.step
- if hasattr(self, 'type') and self.type is not None:
- _dict['type'] = self.type
+ if hasattr(self, 'id') and self.id is not None:
+ _dict['id'] = self.id
return _dict
def _to_dict(self):
@@ -116556,33 +132022,25 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this ShareProfileIOPSRange object."""
+ """Return a `str` version of this VPNGatewayConnectionIKEPolicyPrototypeIKEPolicyIdentityById object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'ShareProfileIOPSRange') -> bool:
+ def __eq__(self, other: 'VPNGatewayConnectionIKEPolicyPrototypeIKEPolicyIdentityById') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'ShareProfileIOPSRange') -> bool:
+ def __ne__(self, other: 'VPNGatewayConnectionIKEPolicyPrototypeIKEPolicyIdentityById') -> 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 ShareProfileIdentityByHref(ShareProfileIdentity):
+class VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByHref(VPNGatewayConnectionIPsecPolicyPatch):
"""
- ShareProfileIdentityByHref.
+ VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByHref.
- :attr str href: The URL for this share profile.
+ :param str href: The IPsec policy's canonical URL.
"""
def __init__(
@@ -116590,26 +132048,26 @@ def __init__(
href: str,
) -> None:
"""
- Initialize a ShareProfileIdentityByHref object.
+ Initialize a VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByHref object.
- :param str href: The URL for this share profile.
+ :param str href: The IPsec policy's canonical URL.
"""
# pylint: disable=super-init-not-called
self.href = href
@classmethod
- def from_dict(cls, _dict: Dict) -> 'ShareProfileIdentityByHref':
- """Initialize a ShareProfileIdentityByHref object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByHref':
+ """Initialize a VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByHref object from a json dictionary."""
args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'href\' not present in ShareProfileIdentityByHref JSON')
+ raise ValueError('Required property \'href\' not present in VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByHref JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a ShareProfileIdentityByHref object from a json dictionary."""
+ """Initialize a VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByHref object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -116624,59 +132082,59 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this ShareProfileIdentityByHref object."""
+ """Return a `str` version of this VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByHref object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'ShareProfileIdentityByHref') -> bool:
+ def __eq__(self, other: 'VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByHref') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'ShareProfileIdentityByHref') -> bool:
+ def __ne__(self, other: 'VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByHref') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class ShareProfileIdentityByName(ShareProfileIdentity):
+class VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityById(VPNGatewayConnectionIPsecPolicyPatch):
"""
- ShareProfileIdentityByName.
+ VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityById.
- :attr str name: The globally unique name for this share profile.
+ :param str id: The unique identifier for this IPsec policy.
"""
def __init__(
self,
- name: str,
+ id: str,
) -> None:
"""
- Initialize a ShareProfileIdentityByName object.
+ Initialize a VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityById object.
- :param str name: The globally unique name for this share profile.
+ :param str id: The unique identifier for this IPsec policy.
"""
# pylint: disable=super-init-not-called
- self.name = name
+ self.id = id
@classmethod
- def from_dict(cls, _dict: Dict) -> 'ShareProfileIdentityByName':
- """Initialize a ShareProfileIdentityByName object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityById':
+ """Initialize a VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityById object from a json dictionary."""
args = {}
- if 'name' in _dict:
- args['name'] = _dict.get('name')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
else:
- raise ValueError('Required property \'name\' not present in ShareProfileIdentityByName JSON')
+ raise ValueError('Required property \'id\' not present in VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityById JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a ShareProfileIdentityByName object from a json dictionary."""
+ """Initialize a VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityById object from 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, 'id') and self.id is not None:
+ _dict['id'] = self.id
return _dict
def _to_dict(self):
@@ -116684,236 +132142,59 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this ShareProfileIdentityByName object."""
+ """Return a `str` version of this VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityById object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'ShareProfileIdentityByName') -> bool:
+ def __eq__(self, other: 'VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityById') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'ShareProfileIdentityByName') -> bool:
+ def __ne__(self, other: 'VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityById') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class SharePrototypeShareBySize(SharePrototype):
+class VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByHref(VPNGatewayConnectionIPsecPolicyPrototype):
"""
- Create a file share by size.
+ VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByHref.
- :attr int iops: (optional) The maximum input/output operations per second (IOPS)
- for the file share. The share must be in the `defined_performance` profile
- family, and the value must be in the range supported by the share's specified
- size.
- In addition, each client accessing the share will be restricted to 48,000 IOPS.
- :attr List[ShareMountTargetPrototype] mount_targets: (optional) The mount
- targets for the file share. Each mount target must be in a unique VPC.
- :attr str name: (optional) The name for this share. The name must not be used by
- another share in the region. If unspecified, the name will be a hyphenated list
- of randomly-selected words.
- :attr ShareProfileIdentity profile: The
- [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-profiles) to use
- for this file share. The profile must support the share's specified IOPS and
- size.
- :attr SharePrototypeShareContext replica_share: (optional)
- :attr List[str] user_tags: (optional) Tags for this resource.
- :attr ZoneIdentity zone: The zone this file share will reside in.
- For a replica share, this must be a different zone in the same region as the
- source share.
- :attr str access_control_mode: (optional) The access control mode for the share:
- - `security_group`: The security groups on the virtual network interface for a
- mount target control access to the mount target. Mount targets for this share
- require a virtual network interface.
- - `vpc`: All clients in the VPC for a mount target have access to the mount
- target.
- Mount targets for this share require a VPC.
- :attr EncryptionKeyIdentity encryption_key: (optional) The root key to use to
- wrap the data encryption key for the share.
- If unspecified, the `encryption` type for the share will be `provider_managed`.
- The specified key may be in a different account, subject to IAM policies.
- :attr ShareInitialOwner initial_owner: (optional) The owner assigned to the file
- share at creation. Subsequent changes to the owner
- must be performed by a client that has mounted the file share.
- :attr ResourceGroupIdentity resource_group: (optional) The resource group to
- use. If unspecified, the account's [default resource
- group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be
- used.
- :attr int size: The size of the file share rounded up to the next gigabyte.
- The maximum size for a share may increase in the future.
+ :param str href: The IPsec policy's canonical URL.
"""
def __init__(
self,
- profile: 'ShareProfileIdentity',
- zone: 'ZoneIdentity',
- size: int,
- *,
- iops: int = None,
- mount_targets: List['ShareMountTargetPrototype'] = None,
- name: str = None,
- replica_share: 'SharePrototypeShareContext' = None,
- user_tags: List[str] = None,
- access_control_mode: str = None,
- encryption_key: 'EncryptionKeyIdentity' = None,
- initial_owner: 'ShareInitialOwner' = None,
- resource_group: 'ResourceGroupIdentity' = None,
+ href: str,
) -> None:
"""
- Initialize a SharePrototypeShareBySize object.
+ Initialize a VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByHref object.
- :param ShareProfileIdentity profile: The
- [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-profiles)
- to use for this file share. The profile must support the share's specified
- IOPS and size.
- :param ZoneIdentity zone: The zone this file share will reside in.
- For a replica share, this must be a different zone in the same region as
- the source share.
- :param int size: The size of the file share rounded up to the next
- gigabyte.
- The maximum size for a share may increase in the future.
- :param int iops: (optional) The maximum input/output operations per second
- (IOPS) for the file share. The share must be in the `defined_performance`
- profile family, and the value must be in the range supported by the share's
- specified size.
- In addition, each client accessing the share will be restricted to 48,000
- IOPS.
- :param List[ShareMountTargetPrototype] mount_targets: (optional) The mount
- targets for the file share. Each mount target must be in a unique VPC.
- :param str name: (optional) The name for this share. The name must not be
- used by another share in the region. If unspecified, the name will be a
- hyphenated list of randomly-selected words.
- :param SharePrototypeShareContext replica_share: (optional)
- :param List[str] user_tags: (optional) Tags for this resource.
- :param str access_control_mode: (optional) The access control mode for the
- share:
- - `security_group`: The security groups on the virtual network interface
- for a
- mount target control access to the mount target. Mount targets for this
- share
- require a virtual network interface.
- - `vpc`: All clients in the VPC for a mount target have access to the mount
- target.
- Mount targets for this share require a VPC.
- :param EncryptionKeyIdentity encryption_key: (optional) The root key to use
- to wrap the data encryption key for the share.
- If unspecified, the `encryption` type for the share will be
- `provider_managed`.
- The specified key may be in a different account, subject to IAM policies.
- :param ShareInitialOwner initial_owner: (optional) The owner assigned to
- the file share at creation. Subsequent changes to the owner
- must be performed by a client that has mounted the file share.
- :param ResourceGroupIdentity resource_group: (optional) The resource group
- to use. If unspecified, the account's [default resource
- group](https://cloud.ibm.com/apidocs/resource-manager#introduction) will be
- used.
+ :param str href: The IPsec policy's canonical URL.
"""
# pylint: disable=super-init-not-called
- self.iops = iops
- self.mount_targets = mount_targets
- self.name = name
- self.profile = profile
- self.replica_share = replica_share
- self.user_tags = user_tags
- self.zone = zone
- self.access_control_mode = access_control_mode
- self.encryption_key = encryption_key
- self.initial_owner = initial_owner
- self.resource_group = resource_group
- self.size = size
+ self.href = href
@classmethod
- def from_dict(cls, _dict: Dict) -> 'SharePrototypeShareBySize':
- """Initialize a SharePrototypeShareBySize object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByHref':
+ """Initialize a VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByHref object from a json dictionary."""
args = {}
- if 'iops' in _dict:
- args['iops'] = _dict.get('iops')
- if 'mount_targets' in _dict:
- args['mount_targets'] = _dict.get('mount_targets')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
- if 'profile' in _dict:
- args['profile'] = _dict.get('profile')
- else:
- raise ValueError('Required property \'profile\' not present in SharePrototypeShareBySize JSON')
- if 'replica_share' in _dict:
- args['replica_share'] = SharePrototypeShareContext.from_dict(_dict.get('replica_share'))
- if 'user_tags' in _dict:
- args['user_tags'] = _dict.get('user_tags')
- if 'zone' in _dict:
- args['zone'] = _dict.get('zone')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'zone\' not present in SharePrototypeShareBySize JSON')
- if 'access_control_mode' in _dict:
- args['access_control_mode'] = _dict.get('access_control_mode')
- if 'encryption_key' in _dict:
- args['encryption_key'] = _dict.get('encryption_key')
- if 'initial_owner' in _dict:
- args['initial_owner'] = ShareInitialOwner.from_dict(_dict.get('initial_owner'))
- if 'resource_group' in _dict:
- args['resource_group'] = _dict.get('resource_group')
- if 'size' in _dict:
- args['size'] = _dict.get('size')
- else:
- raise ValueError('Required property \'size\' not present in SharePrototypeShareBySize JSON')
+ raise ValueError('Required property \'href\' not present in VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByHref JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a SharePrototypeShareBySize object from a json dictionary."""
+ """Initialize a VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByHref object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'iops') and self.iops is not None:
- _dict['iops'] = self.iops
- if hasattr(self, 'mount_targets') and self.mount_targets is not None:
- mount_targets_list = []
- for v in self.mount_targets:
- if isinstance(v, dict):
- mount_targets_list.append(v)
- else:
- mount_targets_list.append(v.to_dict())
- _dict['mount_targets'] = mount_targets_list
- if hasattr(self, 'name') and self.name is not None:
- _dict['name'] = self.name
- if hasattr(self, 'profile') and self.profile is not None:
- if isinstance(self.profile, dict):
- _dict['profile'] = self.profile
- else:
- _dict['profile'] = self.profile.to_dict()
- if hasattr(self, 'replica_share') and self.replica_share is not None:
- if isinstance(self.replica_share, dict):
- _dict['replica_share'] = self.replica_share
- else:
- _dict['replica_share'] = self.replica_share.to_dict()
- if hasattr(self, 'user_tags') and self.user_tags is not None:
- _dict['user_tags'] = self.user_tags
- if hasattr(self, 'zone') and self.zone is not None:
- if isinstance(self.zone, dict):
- _dict['zone'] = self.zone
- else:
- _dict['zone'] = self.zone.to_dict()
- if hasattr(self, 'access_control_mode') and self.access_control_mode is not None:
- _dict['access_control_mode'] = self.access_control_mode
- if hasattr(self, 'encryption_key') and self.encryption_key is not None:
- if isinstance(self.encryption_key, dict):
- _dict['encryption_key'] = self.encryption_key
- else:
- _dict['encryption_key'] = self.encryption_key.to_dict()
- if hasattr(self, 'initial_owner') and self.initial_owner is not None:
- if isinstance(self.initial_owner, dict):
- _dict['initial_owner'] = self.initial_owner
- else:
- _dict['initial_owner'] = self.initial_owner.to_dict()
- if hasattr(self, 'resource_group') and self.resource_group is not None:
- if isinstance(self.resource_group, dict):
- _dict['resource_group'] = self.resource_group
- else:
- _dict['resource_group'] = self.resource_group.to_dict()
- if hasattr(self, 'size') and self.size is not None:
- _dict['size'] = self.size
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
return _dict
def _to_dict(self):
@@ -116921,213 +132202,59 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this SharePrototypeShareBySize object."""
+ """Return a `str` version of this VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByHref object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'SharePrototypeShareBySize') -> bool:
+ def __eq__(self, other: 'VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByHref') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'SharePrototypeShareBySize') -> bool:
+ def __ne__(self, other: 'VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByHref') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class AccessControlModeEnum(str, Enum):
- """
- The access control mode for the share:
- - `security_group`: The security groups on the virtual network interface for a
- mount target control access to the mount target. Mount targets for this share
- require a virtual network interface.
- - `vpc`: All clients in the VPC for a mount target have access to the mount
- target.
- Mount targets for this share require a VPC.
- """
-
- SECURITY_GROUP = 'security_group'
- VPC = 'vpc'
-
-
-class SharePrototypeShareBySourceShare(SharePrototype):
+class VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityById(VPNGatewayConnectionIPsecPolicyPrototype):
"""
- Create a replica file share for an existing file share. The values for
- `access_control_mode`,
- `encryption_key`, `initial_owner`, and `size` will be inherited from `source_share`.
+ VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityById.
- :attr int iops: (optional) The maximum input/output operations per second (IOPS)
- for the file share. The share must be in the `defined_performance` profile
- family, and the value must be in the range supported by the share's specified
- size.
- In addition, each client accessing the share will be restricted to 48,000 IOPS.
- :attr List[ShareMountTargetPrototype] mount_targets: (optional) The mount
- targets for the file share. Each mount target must be in a unique VPC.
- :attr str name: (optional) The name for this share. The name must not be used by
- another share in the region. If unspecified, the name will be a hyphenated list
- of randomly-selected words.
- :attr ShareProfileIdentity profile: The
- [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-profiles) to use
- for this file share. The profile must support the share's specified IOPS and
- size.
- :attr SharePrototypeShareContext replica_share: (optional)
- :attr List[str] user_tags: (optional) Tags for this resource.
- :attr ZoneIdentity zone: The zone this file share will reside in.
- For a replica share, this must be a different zone in the same region as the
- source share.
- :attr str replication_cron_spec: The cron specification for the file share
- replication schedule.
- Replication of a share can be scheduled to occur at most once per hour.
- :attr ResourceGroupIdentity resource_group: (optional) The resource group to
- use. If unspecified, the resource group from
- the source share will be used.
- :attr ShareIdentity source_share: The source file share for this replica file
- share. The specified file share must not
- already have a replica, and must not be a replica.
+ :param str id: The unique identifier for this IPsec policy.
"""
def __init__(
self,
- profile: 'ShareProfileIdentity',
- zone: 'ZoneIdentity',
- replication_cron_spec: str,
- source_share: 'ShareIdentity',
- *,
- iops: int = None,
- mount_targets: List['ShareMountTargetPrototype'] = None,
- name: str = None,
- replica_share: 'SharePrototypeShareContext' = None,
- user_tags: List[str] = None,
- resource_group: 'ResourceGroupIdentity' = None,
+ id: str,
) -> None:
"""
- Initialize a SharePrototypeShareBySourceShare object.
+ Initialize a VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityById object.
- :param ShareProfileIdentity profile: The
- [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-profiles)
- to use for this file share. The profile must support the share's specified
- IOPS and size.
- :param ZoneIdentity zone: The zone this file share will reside in.
- For a replica share, this must be a different zone in the same region as
- the source share.
- :param str replication_cron_spec: The cron specification for the file share
- replication schedule.
- Replication of a share can be scheduled to occur at most once per hour.
- :param ShareIdentity source_share: The source file share for this replica
- file share. The specified file share must not
- already have a replica, and must not be a replica.
- :param int iops: (optional) The maximum input/output operations per second
- (IOPS) for the file share. The share must be in the `defined_performance`
- profile family, and the value must be in the range supported by the share's
- specified size.
- In addition, each client accessing the share will be restricted to 48,000
- IOPS.
- :param List[ShareMountTargetPrototype] mount_targets: (optional) The mount
- targets for the file share. Each mount target must be in a unique VPC.
- :param str name: (optional) The name for this share. The name must not be
- used by another share in the region. If unspecified, the name will be a
- hyphenated list of randomly-selected words.
- :param SharePrototypeShareContext replica_share: (optional)
- :param List[str] user_tags: (optional) Tags for this resource.
- :param ResourceGroupIdentity resource_group: (optional) The resource group
- to use. If unspecified, the resource group from
- the source share will be used.
+ :param str id: The unique identifier for this IPsec policy.
"""
# pylint: disable=super-init-not-called
- self.iops = iops
- self.mount_targets = mount_targets
- self.name = name
- self.profile = profile
- self.replica_share = replica_share
- self.user_tags = user_tags
- self.zone = zone
- self.replication_cron_spec = replication_cron_spec
- self.resource_group = resource_group
- self.source_share = source_share
+ self.id = id
@classmethod
- def from_dict(cls, _dict: Dict) -> 'SharePrototypeShareBySourceShare':
- """Initialize a SharePrototypeShareBySourceShare object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityById':
+ """Initialize a VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityById object from a json dictionary."""
args = {}
- if 'iops' in _dict:
- args['iops'] = _dict.get('iops')
- if 'mount_targets' in _dict:
- args['mount_targets'] = _dict.get('mount_targets')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
- if 'profile' in _dict:
- args['profile'] = _dict.get('profile')
- else:
- raise ValueError('Required property \'profile\' not present in SharePrototypeShareBySourceShare JSON')
- if 'replica_share' in _dict:
- args['replica_share'] = SharePrototypeShareContext.from_dict(_dict.get('replica_share'))
- if 'user_tags' in _dict:
- args['user_tags'] = _dict.get('user_tags')
- if 'zone' in _dict:
- args['zone'] = _dict.get('zone')
- else:
- raise ValueError('Required property \'zone\' not present in SharePrototypeShareBySourceShare JSON')
- if 'replication_cron_spec' in _dict:
- args['replication_cron_spec'] = _dict.get('replication_cron_spec')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
else:
- raise ValueError('Required property \'replication_cron_spec\' not present in SharePrototypeShareBySourceShare JSON')
- if 'resource_group' in _dict:
- args['resource_group'] = _dict.get('resource_group')
- if 'source_share' in _dict:
- args['source_share'] = _dict.get('source_share')
- else:
- raise ValueError('Required property \'source_share\' not present in SharePrototypeShareBySourceShare JSON')
+ raise ValueError('Required property \'id\' not present in VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityById JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a SharePrototypeShareBySourceShare object from a json dictionary."""
+ """Initialize a VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityById object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'iops') and self.iops is not None:
- _dict['iops'] = self.iops
- if hasattr(self, 'mount_targets') and self.mount_targets is not None:
- mount_targets_list = []
- for v in self.mount_targets:
- if isinstance(v, dict):
- mount_targets_list.append(v)
- else:
- mount_targets_list.append(v.to_dict())
- _dict['mount_targets'] = mount_targets_list
- if hasattr(self, 'name') and self.name is not None:
- _dict['name'] = self.name
- if hasattr(self, 'profile') and self.profile is not None:
- if isinstance(self.profile, dict):
- _dict['profile'] = self.profile
- else:
- _dict['profile'] = self.profile.to_dict()
- if hasattr(self, 'replica_share') and self.replica_share is not None:
- if isinstance(self.replica_share, dict):
- _dict['replica_share'] = self.replica_share
- else:
- _dict['replica_share'] = self.replica_share.to_dict()
- if hasattr(self, 'user_tags') and self.user_tags is not None:
- _dict['user_tags'] = self.user_tags
- if hasattr(self, 'zone') and self.zone is not None:
- if isinstance(self.zone, dict):
- _dict['zone'] = self.zone
- else:
- _dict['zone'] = self.zone.to_dict()
- if hasattr(self, 'replication_cron_spec') and self.replication_cron_spec is not None:
- _dict['replication_cron_spec'] = self.replication_cron_spec
- if hasattr(self, 'resource_group') and self.resource_group is not None:
- if isinstance(self.resource_group, dict):
- _dict['resource_group'] = self.resource_group
- else:
- _dict['resource_group'] = self.resource_group.to_dict()
- if hasattr(self, 'source_share') and self.source_share is not None:
- if isinstance(self.source_share, dict):
- _dict['source_share'] = self.source_share
- else:
- _dict['source_share'] = self.source_share.to_dict()
+ if hasattr(self, 'id') and self.id is not None:
+ _dict['id'] = self.id
return _dict
def _to_dict(self):
@@ -117135,59 +132262,300 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this SharePrototypeShareBySourceShare object."""
+ """Return a `str` version of this VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityById object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'SharePrototypeShareBySourceShare') -> bool:
+ def __eq__(self, other: 'VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityById') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'SharePrototypeShareBySourceShare') -> bool:
+ def __ne__(self, other: 'VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityById') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class SnapshotIdentityByCRN(SnapshotIdentity):
+class VPNGatewayConnectionPolicyMode(VPNGatewayConnection):
"""
- SnapshotIdentityByCRN.
+ VPNGatewayConnectionPolicyMode.
- :attr str crn: The CRN of this snapshot.
+ :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:
+ :param str href: The VPN connection's canonical URL.
+ :param str id: The unique identifier for this 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).
+ :param str mode: The mode of the VPN gateway.
+ :param str name: The name for this VPN gateway connection. The name is unique
+ across all connections for the VPN gateway.
+ :param str peer_address: The IP address of the peer VPN gateway.
+ :param str psk: The pre-shared key.
+ :param str resource_type: The resource type.
+ :param str status: The status of a VPN gateway connection.
+ :param List[VPNGatewayConnectionStatusReason] status_reasons: The reasons for
+ the current VPN gateway connection status (if any):
+ - `cannot_authenticate_connection`: Failed to authenticate a connection because
+ of
+ mismatched IKE ID and PSK (check IKE ID and PSK in peer VPN configuration)
+ - `internal_error`: Internal error (contact IBM support)
+ - `ike_policy_mismatch`: None of the proposed IKE crypto suites was acceptable
+ (check
+ the IKE policies on both sides of the VPN)
+ - `ike_v1_id_local_remote_cidr_mismatch`: Invalid IKE ID or mismatched local
+ CIDRs and
+ remote CIDRs in IKE V1 (check the IKE ID or the local CIDRs and remote CIDRs
+ in IKE
+ V1 configuration)
+ - `ike_v2_local_remote_cidr_mismatch`: Mismatched local CIDRs and remote CIDRs
+ in IKE
+ V2 (check the local CIDRs and remote CIDRs in IKE V2 configuration)
+ - `ipsec_policy_mismatch`: None of the proposed IPsec crypto suites was
+ acceptable
+ (check the IPsec policies on both sides of the VPN)
+ - `peer_not_responding`: No response from peer (check network ACL configuration,
+ peer
+ availability, and on-premise firewall configuration)
+ The enumerated reason code values for this property will expand in the future.
+ When processing this property, check for and log unknown values. Optionally halt
+ processing and surface the error, or bypass the resource on which the unexpected
+ reason code was encountered.
+ :param List[str] local_cidrs: The local CIDRs for this resource.
+ :param List[str] peer_cidrs: The peer CIDRs for this resource.
"""
def __init__(
self,
- crn: str,
+ 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,
+ status_reasons: List['VPNGatewayConnectionStatusReason'],
+ local_cidrs: List[str],
+ peer_cidrs: List[str],
+ *,
+ ike_policy: Optional['IKEPolicyReference'] = None,
+ ipsec_policy: Optional['IPsecPolicyReference'] = None,
) -> None:
"""
- Initialize a SnapshotIdentityByCRN object.
+ Initialize a VPNGatewayConnectionPolicyMode object.
- :param str crn: The CRN of this snapshot.
+ :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:
+ :param str href: The VPN connection's canonical URL.
+ :param str id: The unique identifier for this VPN gateway connection.
+ :param str mode: The mode of the VPN gateway.
+ :param str name: The name for this VPN gateway connection. The name is
+ unique across all connections for the VPN gateway.
+ :param str peer_address: The IP address of the peer VPN gateway.
+ :param str psk: The pre-shared key.
+ :param str resource_type: The resource type.
+ :param str status: The status of a VPN gateway connection.
+ :param List[VPNGatewayConnectionStatusReason] status_reasons: The reasons
+ for the current VPN gateway connection status (if any):
+ - `cannot_authenticate_connection`: Failed to authenticate a connection
+ because of
+ mismatched IKE ID and PSK (check IKE ID and PSK in peer VPN
+ configuration)
+ - `internal_error`: Internal error (contact IBM support)
+ - `ike_policy_mismatch`: None of the proposed IKE crypto suites was
+ acceptable (check
+ the IKE policies on both sides of the VPN)
+ - `ike_v1_id_local_remote_cidr_mismatch`: Invalid IKE ID or mismatched
+ local CIDRs and
+ remote CIDRs in IKE V1 (check the IKE ID or the local CIDRs and remote
+ CIDRs in IKE
+ V1 configuration)
+ - `ike_v2_local_remote_cidr_mismatch`: Mismatched local CIDRs and remote
+ CIDRs in IKE
+ V2 (check the local CIDRs and remote CIDRs in IKE V2 configuration)
+ - `ipsec_policy_mismatch`: None of the proposed IPsec crypto suites was
+ acceptable
+ (check the IPsec policies on both sides of the VPN)
+ - `peer_not_responding`: No response from peer (check network ACL
+ configuration, peer
+ availability, and on-premise firewall configuration)
+ The enumerated reason code values for this property will expand in the
+ future. When processing this property, check for and log unknown values.
+ Optionally halt processing and surface the error, or bypass the resource on
+ which the unexpected reason code was encountered.
+ :param List[str] local_cidrs: The local CIDRs for this resource.
+ :param List[str] peer_cidrs: The peer CIDRs for this resource.
+ :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).
"""
# pylint: disable=super-init-not-called
- self.crn = crn
+ self.admin_state_up = admin_state_up
+ self.authentication_mode = authentication_mode
+ self.created_at = created_at
+ self.dead_peer_detection = dead_peer_detection
+ self.href = href
+ self.id = id
+ self.ike_policy = ike_policy
+ self.ipsec_policy = ipsec_policy
+ self.mode = mode
+ self.name = name
+ self.peer_address = peer_address
+ self.psk = psk
+ self.resource_type = resource_type
+ self.status = status
+ self.status_reasons = status_reasons
+ self.local_cidrs = local_cidrs
+ self.peer_cidrs = peer_cidrs
@classmethod
- def from_dict(cls, _dict: Dict) -> 'SnapshotIdentityByCRN':
- """Initialize a SnapshotIdentityByCRN object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VPNGatewayConnectionPolicyMode':
+ """Initialize a VPNGatewayConnectionPolicyMode object from a json dictionary."""
args = {}
- if 'crn' in _dict:
- args['crn'] = _dict.get('crn')
+ if (admin_state_up := _dict.get('admin_state_up')) is not None:
+ args['admin_state_up'] = admin_state_up
else:
- raise ValueError('Required property \'crn\' not present in SnapshotIdentityByCRN JSON')
+ raise ValueError('Required property \'admin_state_up\' not present in VPNGatewayConnectionPolicyMode JSON')
+ if (authentication_mode := _dict.get('authentication_mode')) is not None:
+ args['authentication_mode'] = authentication_mode
+ else:
+ raise ValueError('Required property \'authentication_mode\' not present in VPNGatewayConnectionPolicyMode JSON')
+ if (created_at := _dict.get('created_at')) is not None:
+ args['created_at'] = string_to_datetime(created_at)
+ else:
+ raise ValueError('Required property \'created_at\' not present in VPNGatewayConnectionPolicyMode JSON')
+ if (dead_peer_detection := _dict.get('dead_peer_detection')) is not None:
+ args['dead_peer_detection'] = VPNGatewayConnectionDPD.from_dict(dead_peer_detection)
+ else:
+ raise ValueError('Required property \'dead_peer_detection\' not present in VPNGatewayConnectionPolicyMode JSON')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
+ else:
+ raise ValueError('Required property \'href\' not present in VPNGatewayConnectionPolicyMode JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
+ else:
+ raise ValueError('Required property \'id\' not present in VPNGatewayConnectionPolicyMode JSON')
+ if (ike_policy := _dict.get('ike_policy')) is not None:
+ args['ike_policy'] = IKEPolicyReference.from_dict(ike_policy)
+ if (ipsec_policy := _dict.get('ipsec_policy')) is not None:
+ args['ipsec_policy'] = IPsecPolicyReference.from_dict(ipsec_policy)
+ if (mode := _dict.get('mode')) is not None:
+ args['mode'] = mode
+ else:
+ raise ValueError('Required property \'mode\' not present in VPNGatewayConnectionPolicyMode JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ else:
+ raise ValueError('Required property \'name\' not present in VPNGatewayConnectionPolicyMode JSON')
+ if (peer_address := _dict.get('peer_address')) is not None:
+ args['peer_address'] = peer_address
+ else:
+ raise ValueError('Required property \'peer_address\' not present in VPNGatewayConnectionPolicyMode JSON')
+ if (psk := _dict.get('psk')) is not None:
+ args['psk'] = psk
+ else:
+ raise ValueError('Required property \'psk\' not present in VPNGatewayConnectionPolicyMode JSON')
+ if (resource_type := _dict.get('resource_type')) is not None:
+ args['resource_type'] = resource_type
+ else:
+ raise ValueError('Required property \'resource_type\' not present in VPNGatewayConnectionPolicyMode JSON')
+ if (status := _dict.get('status')) is not None:
+ args['status'] = status
+ else:
+ raise ValueError('Required property \'status\' not present in VPNGatewayConnectionPolicyMode JSON')
+ if (status_reasons := _dict.get('status_reasons')) is not None:
+ args['status_reasons'] = [VPNGatewayConnectionStatusReason.from_dict(v) for v in status_reasons]
+ else:
+ raise ValueError('Required property \'status_reasons\' not present in VPNGatewayConnectionPolicyMode JSON')
+ if (local_cidrs := _dict.get('local_cidrs')) is not None:
+ args['local_cidrs'] = local_cidrs
+ else:
+ raise ValueError('Required property \'local_cidrs\' not present in VPNGatewayConnectionPolicyMode JSON')
+ if (peer_cidrs := _dict.get('peer_cidrs')) is not None:
+ args['peer_cidrs'] = peer_cidrs
+ else:
+ raise ValueError('Required property \'peer_cidrs\' not present in VPNGatewayConnectionPolicyMode JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a SnapshotIdentityByCRN object from a json dictionary."""
+ """Initialize a VPNGatewayConnectionPolicyMode object from 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, 'admin_state_up') and self.admin_state_up is not None:
+ _dict['admin_state_up'] = self.admin_state_up
+ if hasattr(self, 'authentication_mode') and self.authentication_mode is not None:
+ _dict['authentication_mode'] = self.authentication_mode
+ if hasattr(self, 'created_at') and self.created_at is not None:
+ _dict['created_at'] = datetime_to_string(self.created_at)
+ if hasattr(self, 'dead_peer_detection') and self.dead_peer_detection is not None:
+ if isinstance(self.dead_peer_detection, dict):
+ _dict['dead_peer_detection'] = self.dead_peer_detection
+ else:
+ _dict['dead_peer_detection'] = self.dead_peer_detection.to_dict()
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
+ if hasattr(self, 'id') and self.id is not None:
+ _dict['id'] = self.id
+ if hasattr(self, 'ike_policy') and self.ike_policy is not None:
+ if isinstance(self.ike_policy, dict):
+ _dict['ike_policy'] = self.ike_policy
+ else:
+ _dict['ike_policy'] = self.ike_policy.to_dict()
+ if hasattr(self, 'ipsec_policy') and self.ipsec_policy is not None:
+ if isinstance(self.ipsec_policy, dict):
+ _dict['ipsec_policy'] = self.ipsec_policy
+ else:
+ _dict['ipsec_policy'] = self.ipsec_policy.to_dict()
+ if hasattr(self, 'mode') and self.mode is not None:
+ _dict['mode'] = self.mode
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ if hasattr(self, 'peer_address') and self.peer_address is not None:
+ _dict['peer_address'] = self.peer_address
+ if hasattr(self, 'psk') and self.psk is not None:
+ _dict['psk'] = self.psk
+ if hasattr(self, 'resource_type') and self.resource_type is not None:
+ _dict['resource_type'] = self.resource_type
+ if hasattr(self, 'status') and self.status is not None:
+ _dict['status'] = self.status
+ if hasattr(self, 'status_reasons') and self.status_reasons is not None:
+ status_reasons_list = []
+ for v in self.status_reasons:
+ if isinstance(v, dict):
+ status_reasons_list.append(v)
+ else:
+ status_reasons_list.append(v.to_dict())
+ _dict['status_reasons'] = status_reasons_list
+ if hasattr(self, 'local_cidrs') and self.local_cidrs is not None:
+ _dict['local_cidrs'] = self.local_cidrs
+ if hasattr(self, 'peer_cidrs') and self.peer_cidrs is not None:
+ _dict['peer_cidrs'] = self.peer_cidrs
return _dict
def _to_dict(self):
@@ -117195,59 +132563,179 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this SnapshotIdentityByCRN object."""
+ """Return a `str` version of this VPNGatewayConnectionPolicyMode object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'SnapshotIdentityByCRN') -> bool:
+ def __eq__(self, other: 'VPNGatewayConnectionPolicyMode') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'SnapshotIdentityByCRN') -> bool:
+ def __ne__(self, other: 'VPNGatewayConnectionPolicyMode') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
+ class AuthenticationModeEnum(str, Enum):
+ """
+ The authentication mode. Only `psk` is currently supported.
+ """
-class SnapshotIdentityByHref(SnapshotIdentity):
+ 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 VPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype(VPNGatewayConnectionPrototype):
"""
- SnapshotIdentityByHref.
+ VPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype.
- :attr str href: The URL for this snapshot.
+ :param bool admin_state_up: (optional) If set to false, the VPN gateway
+ connection is shut down.
+ :param VPNGatewayConnectionDPDPrototype dead_peer_detection: (optional)
+ :param VPNGatewayConnectionIKEPolicyPrototype ike_policy: (optional)
+ :param VPNGatewayConnectionIPsecPolicyPrototype ipsec_policy: (optional)
+ :param str name: (optional) The name for this VPN gateway connection. The name
+ must not be used by another connection for the VPN gateway. If unspecified, the
+ name will be a hyphenated list of randomly-selected words.
+ :param str peer_address: The IP address of the peer VPN gateway.
+ :param str psk: The pre-shared key.
+ :param List[str] local_cidrs: The local CIDRs for this resource.
+ :param List[str] peer_cidrs: The peer CIDRs for this resource.
"""
def __init__(
self,
- href: str,
+ peer_address: str,
+ psk: str,
+ local_cidrs: List[str],
+ peer_cidrs: List[str],
+ *,
+ admin_state_up: Optional[bool] = None,
+ dead_peer_detection: Optional['VPNGatewayConnectionDPDPrototype'] = None,
+ ike_policy: Optional['VPNGatewayConnectionIKEPolicyPrototype'] = None,
+ ipsec_policy: Optional['VPNGatewayConnectionIPsecPolicyPrototype'] = None,
+ name: Optional[str] = None,
) -> None:
"""
- Initialize a SnapshotIdentityByHref object.
+ Initialize a VPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype object.
- :param str href: The URL for this snapshot.
+ :param str peer_address: The IP address of the peer VPN gateway.
+ :param str psk: The pre-shared key.
+ :param List[str] local_cidrs: The local CIDRs for this resource.
+ :param List[str] peer_cidrs: The peer CIDRs for this resource.
+ :param bool admin_state_up: (optional) If set to false, the VPN gateway
+ connection is shut down.
+ :param VPNGatewayConnectionDPDPrototype dead_peer_detection: (optional)
+ :param VPNGatewayConnectionIKEPolicyPrototype ike_policy: (optional)
+ :param VPNGatewayConnectionIPsecPolicyPrototype ipsec_policy: (optional)
+ :param str name: (optional) The name for this VPN gateway connection. The
+ name must not be used by another connection for the VPN gateway. If
+ unspecified, the name will be a hyphenated list of randomly-selected words.
"""
# pylint: disable=super-init-not-called
- self.href = href
+ self.admin_state_up = admin_state_up
+ self.dead_peer_detection = dead_peer_detection
+ self.ike_policy = ike_policy
+ self.ipsec_policy = ipsec_policy
+ self.name = name
+ self.peer_address = peer_address
+ self.psk = psk
+ self.local_cidrs = local_cidrs
+ self.peer_cidrs = peer_cidrs
@classmethod
- def from_dict(cls, _dict: Dict) -> 'SnapshotIdentityByHref':
- """Initialize a SnapshotIdentityByHref object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype':
+ """Initialize a VPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype object from a json dictionary."""
args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ if (admin_state_up := _dict.get('admin_state_up')) is not None:
+ args['admin_state_up'] = admin_state_up
+ if (dead_peer_detection := _dict.get('dead_peer_detection')) is not None:
+ args['dead_peer_detection'] = VPNGatewayConnectionDPDPrototype.from_dict(dead_peer_detection)
+ if (ike_policy := _dict.get('ike_policy')) is not None:
+ args['ike_policy'] = ike_policy
+ if (ipsec_policy := _dict.get('ipsec_policy')) is not None:
+ args['ipsec_policy'] = ipsec_policy
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ if (peer_address := _dict.get('peer_address')) is not None:
+ args['peer_address'] = peer_address
else:
- raise ValueError('Required property \'href\' not present in SnapshotIdentityByHref JSON')
+ raise ValueError('Required property \'peer_address\' not present in VPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype JSON')
+ if (psk := _dict.get('psk')) is not None:
+ args['psk'] = psk
+ else:
+ raise ValueError('Required property \'psk\' not present in VPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype JSON')
+ if (local_cidrs := _dict.get('local_cidrs')) is not None:
+ args['local_cidrs'] = local_cidrs
+ else:
+ raise ValueError('Required property \'local_cidrs\' not present in VPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype JSON')
+ if (peer_cidrs := _dict.get('peer_cidrs')) is not None:
+ args['peer_cidrs'] = peer_cidrs
+ else:
+ raise ValueError('Required property \'peer_cidrs\' not present in VPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a SnapshotIdentityByHref object from a json dictionary."""
+ """Initialize a VPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype object from 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, 'admin_state_up') and self.admin_state_up is not None:
+ _dict['admin_state_up'] = self.admin_state_up
+ if hasattr(self, 'dead_peer_detection') and self.dead_peer_detection is not None:
+ if isinstance(self.dead_peer_detection, dict):
+ _dict['dead_peer_detection'] = self.dead_peer_detection
+ else:
+ _dict['dead_peer_detection'] = self.dead_peer_detection.to_dict()
+ if hasattr(self, 'ike_policy') and self.ike_policy is not None:
+ if isinstance(self.ike_policy, dict):
+ _dict['ike_policy'] = self.ike_policy
+ else:
+ _dict['ike_policy'] = self.ike_policy.to_dict()
+ if hasattr(self, 'ipsec_policy') and self.ipsec_policy is not None:
+ if isinstance(self.ipsec_policy, dict):
+ _dict['ipsec_policy'] = self.ipsec_policy
+ else:
+ _dict['ipsec_policy'] = self.ipsec_policy.to_dict()
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ if hasattr(self, 'peer_address') and self.peer_address is not None:
+ _dict['peer_address'] = self.peer_address
+ if hasattr(self, 'psk') and self.psk is not None:
+ _dict['psk'] = self.psk
+ if hasattr(self, 'local_cidrs') and self.local_cidrs is not None:
+ _dict['local_cidrs'] = self.local_cidrs
+ if hasattr(self, 'peer_cidrs') and self.peer_cidrs is not None:
+ _dict['peer_cidrs'] = self.peer_cidrs
return _dict
def _to_dict(self):
@@ -117255,59 +132743,135 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this SnapshotIdentityByHref object."""
+ """Return a `str` version of this VPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'SnapshotIdentityByHref') -> bool:
+ def __eq__(self, other: 'VPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'SnapshotIdentityByHref') -> bool:
+ def __ne__(self, other: 'VPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class SnapshotIdentityById(SnapshotIdentity):
+class VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype(VPNGatewayConnectionPrototype):
"""
- SnapshotIdentityById.
+ VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype.
- :attr str id: The unique identifier for this snapshot.
+ :param bool admin_state_up: (optional) If set to false, the VPN gateway
+ connection is shut down.
+ :param VPNGatewayConnectionDPDPrototype dead_peer_detection: (optional)
+ :param VPNGatewayConnectionIKEPolicyPrototype ike_policy: (optional)
+ :param VPNGatewayConnectionIPsecPolicyPrototype ipsec_policy: (optional)
+ :param str name: (optional) The name for this VPN gateway connection. The name
+ must not be used by another connection for the VPN gateway. If unspecified, the
+ name will be a hyphenated list of randomly-selected words.
+ :param str peer_address: The IP address of the peer VPN gateway.
+ :param str psk: The pre-shared key.
+ :param str routing_protocol: (optional) Routing protocols are disabled for this
+ VPN gateway connection.
"""
def __init__(
self,
- id: str,
+ peer_address: str,
+ psk: str,
+ *,
+ admin_state_up: Optional[bool] = None,
+ dead_peer_detection: Optional['VPNGatewayConnectionDPDPrototype'] = None,
+ ike_policy: Optional['VPNGatewayConnectionIKEPolicyPrototype'] = None,
+ ipsec_policy: Optional['VPNGatewayConnectionIPsecPolicyPrototype'] = None,
+ name: Optional[str] = None,
+ routing_protocol: Optional[str] = None,
) -> None:
"""
- Initialize a SnapshotIdentityById object.
+ Initialize a VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype object.
- :param str id: The unique identifier for this snapshot.
+ :param str peer_address: The IP address of the peer VPN gateway.
+ :param str psk: The pre-shared key.
+ :param bool admin_state_up: (optional) If set to false, the VPN gateway
+ connection is shut down.
+ :param VPNGatewayConnectionDPDPrototype dead_peer_detection: (optional)
+ :param VPNGatewayConnectionIKEPolicyPrototype ike_policy: (optional)
+ :param VPNGatewayConnectionIPsecPolicyPrototype ipsec_policy: (optional)
+ :param str name: (optional) The name for this VPN gateway connection. The
+ name must not be used by another connection for the VPN gateway. If
+ unspecified, the name will be a hyphenated list of randomly-selected words.
+ :param str routing_protocol: (optional) Routing protocols are disabled for
+ this VPN gateway connection.
"""
# pylint: disable=super-init-not-called
- self.id = id
+ self.admin_state_up = admin_state_up
+ self.dead_peer_detection = dead_peer_detection
+ self.ike_policy = ike_policy
+ self.ipsec_policy = ipsec_policy
+ self.name = name
+ self.peer_address = peer_address
+ self.psk = psk
+ self.routing_protocol = routing_protocol
@classmethod
- def from_dict(cls, _dict: Dict) -> 'SnapshotIdentityById':
- """Initialize a SnapshotIdentityById object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype':
+ """Initialize a VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype object from a json dictionary."""
args = {}
- if 'id' in _dict:
- args['id'] = _dict.get('id')
+ if (admin_state_up := _dict.get('admin_state_up')) is not None:
+ args['admin_state_up'] = admin_state_up
+ if (dead_peer_detection := _dict.get('dead_peer_detection')) is not None:
+ args['dead_peer_detection'] = VPNGatewayConnectionDPDPrototype.from_dict(dead_peer_detection)
+ if (ike_policy := _dict.get('ike_policy')) is not None:
+ args['ike_policy'] = ike_policy
+ if (ipsec_policy := _dict.get('ipsec_policy')) is not None:
+ args['ipsec_policy'] = ipsec_policy
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ if (peer_address := _dict.get('peer_address')) is not None:
+ args['peer_address'] = peer_address
else:
- raise ValueError('Required property \'id\' not present in SnapshotIdentityById JSON')
+ raise ValueError('Required property \'peer_address\' not present in VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype JSON')
+ if (psk := _dict.get('psk')) is not None:
+ args['psk'] = psk
+ else:
+ raise ValueError('Required property \'psk\' not present in VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype JSON')
+ if (routing_protocol := _dict.get('routing_protocol')) is not None:
+ args['routing_protocol'] = routing_protocol
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a SnapshotIdentityById object from a json dictionary."""
+ """Initialize a VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype object from 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, 'admin_state_up') and self.admin_state_up is not None:
+ _dict['admin_state_up'] = self.admin_state_up
+ if hasattr(self, 'dead_peer_detection') and self.dead_peer_detection is not None:
+ if isinstance(self.dead_peer_detection, dict):
+ _dict['dead_peer_detection'] = self.dead_peer_detection
+ else:
+ _dict['dead_peer_detection'] = self.dead_peer_detection.to_dict()
+ if hasattr(self, 'ike_policy') and self.ike_policy is not None:
+ if isinstance(self.ike_policy, dict):
+ _dict['ike_policy'] = self.ike_policy
+ else:
+ _dict['ike_policy'] = self.ike_policy.to_dict()
+ if hasattr(self, 'ipsec_policy') and self.ipsec_policy is not None:
+ if isinstance(self.ipsec_policy, dict):
+ _dict['ipsec_policy'] = self.ipsec_policy
+ else:
+ _dict['ipsec_policy'] = self.ipsec_policy.to_dict()
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ if hasattr(self, 'peer_address') and self.peer_address is not None:
+ _dict['peer_address'] = self.peer_address
+ if hasattr(self, 'psk') and self.psk is not None:
+ _dict['psk'] = self.psk
+ if hasattr(self, 'routing_protocol') and self.routing_protocol is not None:
+ _dict['routing_protocol'] = self.routing_protocol
return _dict
def _to_dict(self):
@@ -117315,151 +132879,319 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this SnapshotIdentityById object."""
+ """Return a `str` version of this VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'SnapshotIdentityById') -> bool:
+ def __eq__(self, other: 'VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'SnapshotIdentityById') -> bool:
+ def __ne__(self, other: 'VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
+ class RoutingProtocolEnum(str, Enum):
+ """
+ Routing protocols are disabled for this VPN gateway connection.
+ """
-class SnapshotPrototypeSnapshotBySourceSnapshot(SnapshotPrototype):
+ NONE = 'none'
+
+
+
+class VPNGatewayConnectionStaticRouteMode(VPNGatewayConnection):
"""
- SnapshotPrototypeSnapshotBySourceSnapshot.
+ VPNGatewayConnectionStaticRouteMode.
- :attr List[SnapshotClonePrototype] clones: (optional) Clones to create for this
- snapshot.
- :attr str name: (optional) The name for this snapshot. The name must not be used
- by another snapshot in the region. If unspecified, the name will be a hyphenated
- list of randomly-selected words.
- :attr ResourceGroupIdentity resource_group: (optional)
- :attr List[str] user_tags: (optional) The [user
- tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with this
- snapshot.
- :attr EncryptionKeyIdentity encryption_key: (optional) The root key to use to
- wrap the data encryption key for this snapshot.
- A key must be specified if and only if the source snapshot has an `encryption`
- type of
- `user_managed`. To maximize snapshot availability and sharing of snapshot data,
- specify
- a key in the same region as the new snapshot, and use the same encryption key
- for all
- snapshots using the same source volume.
- The specified key may be in a different account, subject to IAM policies.
- :attr SnapshotIdentityByCRN source_snapshot: The source snapshot (in another
- region) to create this snapshot from.
- The specified snapshot must not already be the source of another snapshot in
- this
- region.
+ :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:
+ :param str href: The VPN connection's canonical URL.
+ :param str id: The unique identifier for this 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).
+ :param str mode: The mode of the VPN gateway.
+ :param str name: The name for this VPN gateway connection. The name is unique
+ across all connections for the VPN gateway.
+ :param str peer_address: The IP address of the peer VPN gateway.
+ :param str psk: The pre-shared key.
+ :param str resource_type: The resource type.
+ :param str status: The status of a VPN gateway connection.
+ :param List[VPNGatewayConnectionStatusReason] status_reasons: The reasons for
+ the current VPN gateway connection status (if any):
+ - `cannot_authenticate_connection`: Failed to authenticate a connection because
+ of
+ mismatched IKE ID and PSK (check IKE ID and PSK in peer VPN configuration)
+ - `internal_error`: Internal error (contact IBM support)
+ - `ike_policy_mismatch`: None of the proposed IKE crypto suites was acceptable
+ (check
+ the IKE policies on both sides of the VPN)
+ - `ike_v1_id_local_remote_cidr_mismatch`: Invalid IKE ID or mismatched local
+ CIDRs and
+ remote CIDRs in IKE V1 (check the IKE ID or the local CIDRs and remote CIDRs
+ in IKE
+ V1 configuration)
+ - `ike_v2_local_remote_cidr_mismatch`: Mismatched local CIDRs and remote CIDRs
+ in IKE
+ V2 (check the local CIDRs and remote CIDRs in IKE V2 configuration)
+ - `ipsec_policy_mismatch`: None of the proposed IPsec crypto suites was
+ acceptable
+ (check the IPsec policies on both sides of the VPN)
+ - `peer_not_responding`: No response from peer (check network ACL configuration,
+ peer
+ availability, and on-premise firewall configuration)
+ 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 routing_protocol: Routing protocols are disabled for this VPN gateway
+ connection.
+ :param List[VPNGatewayConnectionStaticRouteModeTunnel] tunnels: The VPN tunnel
+ configuration for this VPN gateway connection (in static route mode).
"""
def __init__(
self,
- source_snapshot: 'SnapshotIdentityByCRN',
+ 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,
+ status_reasons: List['VPNGatewayConnectionStatusReason'],
+ routing_protocol: str,
+ tunnels: List['VPNGatewayConnectionStaticRouteModeTunnel'],
*,
- clones: List['SnapshotClonePrototype'] = None,
- name: str = None,
- resource_group: 'ResourceGroupIdentity' = None,
- user_tags: List[str] = None,
- encryption_key: 'EncryptionKeyIdentity' = None,
+ ike_policy: Optional['IKEPolicyReference'] = None,
+ ipsec_policy: Optional['IPsecPolicyReference'] = None,
) -> None:
"""
- Initialize a SnapshotPrototypeSnapshotBySourceSnapshot object.
+ Initialize a VPNGatewayConnectionStaticRouteMode object.
- :param SnapshotIdentityByCRN source_snapshot: The source snapshot (in
- another region) to create this snapshot from.
- The specified snapshot must not already be the source of another snapshot
- in this
- region.
- :param List[SnapshotClonePrototype] clones: (optional) Clones to create for
- this snapshot.
- :param str name: (optional) The name for this snapshot. The name must not
- be used by another snapshot in the region. If unspecified, the name will be
- a hyphenated list of randomly-selected words.
- :param ResourceGroupIdentity resource_group: (optional)
- :param List[str] user_tags: (optional) The [user
- tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with
- this snapshot.
- :param EncryptionKeyIdentity encryption_key: (optional) The root key to use
- to wrap the data encryption key for this snapshot.
- A key must be specified if and only if the source snapshot has an
- `encryption` type of
- `user_managed`. To maximize snapshot availability and sharing of snapshot
- data, specify
- a key in the same region as the new snapshot, and use the same encryption
- key for all
- snapshots using the same source volume.
- The specified key may be in a different account, subject to IAM policies.
+ :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:
+ :param str href: The VPN connection's canonical URL.
+ :param str id: The unique identifier for this VPN gateway connection.
+ :param str mode: The mode of the VPN gateway.
+ :param str name: The name for this VPN gateway connection. The name is
+ unique across all connections for the VPN gateway.
+ :param str peer_address: The IP address of the peer VPN gateway.
+ :param str psk: The pre-shared key.
+ :param str resource_type: The resource type.
+ :param str status: The status of a VPN gateway connection.
+ :param List[VPNGatewayConnectionStatusReason] status_reasons: The reasons
+ for the current VPN gateway connection status (if any):
+ - `cannot_authenticate_connection`: Failed to authenticate a connection
+ because of
+ mismatched IKE ID and PSK (check IKE ID and PSK in peer VPN
+ configuration)
+ - `internal_error`: Internal error (contact IBM support)
+ - `ike_policy_mismatch`: None of the proposed IKE crypto suites was
+ acceptable (check
+ the IKE policies on both sides of the VPN)
+ - `ike_v1_id_local_remote_cidr_mismatch`: Invalid IKE ID or mismatched
+ local CIDRs and
+ remote CIDRs in IKE V1 (check the IKE ID or the local CIDRs and remote
+ CIDRs in IKE
+ V1 configuration)
+ - `ike_v2_local_remote_cidr_mismatch`: Mismatched local CIDRs and remote
+ CIDRs in IKE
+ V2 (check the local CIDRs and remote CIDRs in IKE V2 configuration)
+ - `ipsec_policy_mismatch`: None of the proposed IPsec crypto suites was
+ acceptable
+ (check the IPsec policies on both sides of the VPN)
+ - `peer_not_responding`: No response from peer (check network ACL
+ configuration, peer
+ availability, and on-premise firewall configuration)
+ 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 routing_protocol: Routing protocols are disabled for this VPN
+ gateway connection.
+ :param List[VPNGatewayConnectionStaticRouteModeTunnel] tunnels: The VPN
+ tunnel configuration for this VPN gateway connection (in static route
+ mode).
+ :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).
"""
# pylint: disable=super-init-not-called
- self.clones = clones
+ self.admin_state_up = admin_state_up
+ self.authentication_mode = authentication_mode
+ self.created_at = created_at
+ self.dead_peer_detection = dead_peer_detection
+ self.href = href
+ self.id = id
+ self.ike_policy = ike_policy
+ self.ipsec_policy = ipsec_policy
+ self.mode = mode
self.name = name
- self.resource_group = resource_group
- self.user_tags = user_tags
- self.encryption_key = encryption_key
- self.source_snapshot = source_snapshot
+ self.peer_address = peer_address
+ self.psk = psk
+ self.resource_type = resource_type
+ self.status = status
+ self.status_reasons = status_reasons
+ self.routing_protocol = routing_protocol
+ self.tunnels = tunnels
@classmethod
- def from_dict(cls, _dict: Dict) -> 'SnapshotPrototypeSnapshotBySourceSnapshot':
- """Initialize a SnapshotPrototypeSnapshotBySourceSnapshot object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VPNGatewayConnectionStaticRouteMode':
+ """Initialize a VPNGatewayConnectionStaticRouteMode object from a json dictionary."""
args = {}
- if 'clones' in _dict:
- args['clones'] = [SnapshotClonePrototype.from_dict(v) for v in _dict.get('clones')]
- if 'name' in _dict:
- args['name'] = _dict.get('name')
- if 'resource_group' in _dict:
- args['resource_group'] = _dict.get('resource_group')
- if 'user_tags' in _dict:
- args['user_tags'] = _dict.get('user_tags')
- if 'encryption_key' in _dict:
- args['encryption_key'] = _dict.get('encryption_key')
- if 'source_snapshot' in _dict:
- args['source_snapshot'] = SnapshotIdentityByCRN.from_dict(_dict.get('source_snapshot'))
+ if (admin_state_up := _dict.get('admin_state_up')) is not None:
+ args['admin_state_up'] = admin_state_up
else:
- raise ValueError('Required property \'source_snapshot\' not present in SnapshotPrototypeSnapshotBySourceSnapshot JSON')
+ raise ValueError('Required property \'admin_state_up\' not present in VPNGatewayConnectionStaticRouteMode JSON')
+ if (authentication_mode := _dict.get('authentication_mode')) is not None:
+ args['authentication_mode'] = authentication_mode
+ else:
+ raise ValueError('Required property \'authentication_mode\' not present in VPNGatewayConnectionStaticRouteMode JSON')
+ if (created_at := _dict.get('created_at')) is not None:
+ args['created_at'] = string_to_datetime(created_at)
+ else:
+ raise ValueError('Required property \'created_at\' not present in VPNGatewayConnectionStaticRouteMode JSON')
+ if (dead_peer_detection := _dict.get('dead_peer_detection')) is not None:
+ args['dead_peer_detection'] = VPNGatewayConnectionDPD.from_dict(dead_peer_detection)
+ else:
+ raise ValueError('Required property \'dead_peer_detection\' not present in VPNGatewayConnectionStaticRouteMode JSON')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
+ else:
+ raise ValueError('Required property \'href\' not present in VPNGatewayConnectionStaticRouteMode JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
+ else:
+ raise ValueError('Required property \'id\' not present in VPNGatewayConnectionStaticRouteMode JSON')
+ if (ike_policy := _dict.get('ike_policy')) is not None:
+ args['ike_policy'] = IKEPolicyReference.from_dict(ike_policy)
+ if (ipsec_policy := _dict.get('ipsec_policy')) is not None:
+ args['ipsec_policy'] = IPsecPolicyReference.from_dict(ipsec_policy)
+ if (mode := _dict.get('mode')) is not None:
+ args['mode'] = mode
+ else:
+ raise ValueError('Required property \'mode\' not present in VPNGatewayConnectionStaticRouteMode JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ else:
+ raise ValueError('Required property \'name\' not present in VPNGatewayConnectionStaticRouteMode JSON')
+ if (peer_address := _dict.get('peer_address')) is not None:
+ args['peer_address'] = peer_address
+ else:
+ raise ValueError('Required property \'peer_address\' not present in VPNGatewayConnectionStaticRouteMode JSON')
+ if (psk := _dict.get('psk')) is not None:
+ args['psk'] = psk
+ else:
+ raise ValueError('Required property \'psk\' not present in VPNGatewayConnectionStaticRouteMode JSON')
+ if (resource_type := _dict.get('resource_type')) is not None:
+ args['resource_type'] = resource_type
+ else:
+ raise ValueError('Required property \'resource_type\' not present in VPNGatewayConnectionStaticRouteMode JSON')
+ if (status := _dict.get('status')) is not None:
+ args['status'] = status
+ else:
+ raise ValueError('Required property \'status\' not present in VPNGatewayConnectionStaticRouteMode JSON')
+ if (status_reasons := _dict.get('status_reasons')) is not None:
+ args['status_reasons'] = [VPNGatewayConnectionStatusReason.from_dict(v) for v in status_reasons]
+ else:
+ raise ValueError('Required property \'status_reasons\' not present in VPNGatewayConnectionStaticRouteMode JSON')
+ if (routing_protocol := _dict.get('routing_protocol')) is not None:
+ args['routing_protocol'] = routing_protocol
+ else:
+ raise ValueError('Required property \'routing_protocol\' not present in VPNGatewayConnectionStaticRouteMode JSON')
+ if (tunnels := _dict.get('tunnels')) is not None:
+ args['tunnels'] = [VPNGatewayConnectionStaticRouteModeTunnel.from_dict(v) for v in tunnels]
+ else:
+ raise ValueError('Required property \'tunnels\' not present in VPNGatewayConnectionStaticRouteMode JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a SnapshotPrototypeSnapshotBySourceSnapshot object from a json dictionary."""
+ """Initialize a VPNGatewayConnectionStaticRouteMode object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'clones') and self.clones is not None:
- clones_list = []
- for v in self.clones:
- if isinstance(v, dict):
- clones_list.append(v)
- else:
- clones_list.append(v.to_dict())
- _dict['clones'] = clones_list
- if hasattr(self, 'name') and self.name is not None:
- _dict['name'] = self.name
- if hasattr(self, 'resource_group') and self.resource_group is not None:
- if isinstance(self.resource_group, dict):
- _dict['resource_group'] = self.resource_group
+ if hasattr(self, 'admin_state_up') and self.admin_state_up is not None:
+ _dict['admin_state_up'] = self.admin_state_up
+ if hasattr(self, 'authentication_mode') and self.authentication_mode is not None:
+ _dict['authentication_mode'] = self.authentication_mode
+ if hasattr(self, 'created_at') and self.created_at is not None:
+ _dict['created_at'] = datetime_to_string(self.created_at)
+ if hasattr(self, 'dead_peer_detection') and self.dead_peer_detection is not None:
+ if isinstance(self.dead_peer_detection, dict):
+ _dict['dead_peer_detection'] = self.dead_peer_detection
else:
- _dict['resource_group'] = self.resource_group.to_dict()
- if hasattr(self, 'user_tags') and self.user_tags is not None:
- _dict['user_tags'] = self.user_tags
- if hasattr(self, 'encryption_key') and self.encryption_key is not None:
- if isinstance(self.encryption_key, dict):
- _dict['encryption_key'] = self.encryption_key
+ _dict['dead_peer_detection'] = self.dead_peer_detection.to_dict()
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
+ if hasattr(self, 'id') and self.id is not None:
+ _dict['id'] = self.id
+ if hasattr(self, 'ike_policy') and self.ike_policy is not None:
+ if isinstance(self.ike_policy, dict):
+ _dict['ike_policy'] = self.ike_policy
else:
- _dict['encryption_key'] = self.encryption_key.to_dict()
- if hasattr(self, 'source_snapshot') and self.source_snapshot is not None:
- if isinstance(self.source_snapshot, dict):
- _dict['source_snapshot'] = self.source_snapshot
+ _dict['ike_policy'] = self.ike_policy.to_dict()
+ if hasattr(self, 'ipsec_policy') and self.ipsec_policy is not None:
+ if isinstance(self.ipsec_policy, dict):
+ _dict['ipsec_policy'] = self.ipsec_policy
else:
- _dict['source_snapshot'] = self.source_snapshot.to_dict()
+ _dict['ipsec_policy'] = self.ipsec_policy.to_dict()
+ if hasattr(self, 'mode') and self.mode is not None:
+ _dict['mode'] = self.mode
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ if hasattr(self, 'peer_address') and self.peer_address is not None:
+ _dict['peer_address'] = self.peer_address
+ if hasattr(self, 'psk') and self.psk is not None:
+ _dict['psk'] = self.psk
+ if hasattr(self, 'resource_type') and self.resource_type is not None:
+ _dict['resource_type'] = self.resource_type
+ if hasattr(self, 'status') and self.status is not None:
+ _dict['status'] = self.status
+ if hasattr(self, 'status_reasons') and self.status_reasons is not None:
+ status_reasons_list = []
+ for v in self.status_reasons:
+ if isinstance(v, dict):
+ status_reasons_list.append(v)
+ else:
+ status_reasons_list.append(v.to_dict())
+ _dict['status_reasons'] = status_reasons_list
+ if hasattr(self, 'routing_protocol') and self.routing_protocol is not None:
+ _dict['routing_protocol'] = self.routing_protocol
+ if hasattr(self, 'tunnels') and self.tunnels is not None:
+ tunnels_list = []
+ for v in self.tunnels:
+ if isinstance(v, dict):
+ tunnels_list.append(v)
+ else:
+ tunnels_list.append(v.to_dict())
+ _dict['tunnels'] = tunnels_list
return _dict
def _to_dict(self):
@@ -117467,101 +133199,322 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this SnapshotPrototypeSnapshotBySourceSnapshot object."""
+ """Return a `str` version of this VPNGatewayConnectionStaticRouteMode object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'SnapshotPrototypeSnapshotBySourceSnapshot') -> bool:
+ def __eq__(self, other: 'VPNGatewayConnectionStaticRouteMode') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'SnapshotPrototypeSnapshotBySourceSnapshot') -> bool:
+ def __ne__(self, other: 'VPNGatewayConnectionStaticRouteMode') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
+ class AuthenticationModeEnum(str, Enum):
+ """
+ The authentication mode. Only `psk` is currently supported.
+ """
+
+ PSK = 'psk'
+
-class SnapshotPrototypeSnapshotBySourceVolume(SnapshotPrototype):
+ 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 RoutingProtocolEnum(str, Enum):
+ """
+ Routing protocols are disabled for this VPN gateway connection.
+ """
+
+ NONE = 'none'
+
+
+
+class VPNGatewayPolicyMode(VPNGateway):
"""
- SnapshotPrototypeSnapshotBySourceVolume.
+ VPNGatewayPolicyMode.
- :attr List[SnapshotClonePrototype] clones: (optional) Clones to create for this
- snapshot.
- :attr str name: (optional) The name for this snapshot. The name must not be used
- by another snapshot in the region. If unspecified, the name will be a hyphenated
- list of randomly-selected words.
- :attr ResourceGroupIdentity resource_group: (optional)
- :attr List[str] user_tags: (optional) The [user
- tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with this
- snapshot.
- :attr VolumeIdentity source_volume: The volume to create this snapshot from.
+ :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 List[VPNGatewayHealthReason] health_reasons: The reasons for the current
+ VPN gateway health_state (if any):
+ - `cannot_create_vpc_route`: VPN cannot create route (check for conflict)
+ - `cannot_reserve_ip_address`: IP address exhaustion (release addresses on the
+ VPN's
+ subnet)
+ - `internal_error`: Internal error (contact IBM support)
+ The enumerated reason code values for this property will expand in the future.
+ When processing this property, check for and log unknown values. Optionally halt
+ processing and surface the error, or bypass the resource on which the unexpected
+ reason code was encountered.
+ :param str health_state: The health of this resource.
+ - `ok`: No abnormal behavior detected
+ - `degraded`: Experiencing compromised performance, capacity, or connectivity
+ - `faulted`: Completely unreachable, inoperative, or otherwise entirely
+ incapacitated
+ - `inapplicable`: The health state does not apply because of the current
+ lifecycle state. A resource with a lifecycle state of `failed` or `deleting`
+ will have a health state of `inapplicable`. A `pending` resource may also have
+ this state.
+ :param str href: The VPN gateway's canonical URL.
+ :param str id: The unique identifier for this VPN gateway.
+ :param List[VPNGatewayLifecycleReason] lifecycle_reasons: The reasons for the
+ current VPN gateway lifecycle_state (if any):
+ - `resource_suspended_by_provider`: The resource has been suspended (contact IBM
+ support)
+ The enumerated reason code values for this property will expand in the future.
+ When processing this property, check for and log unknown values. Optionally halt
+ processing and surface the error, or bypass the resource on which the unexpected
+ reason code was encountered.
+ :param str lifecycle_state: The lifecycle state of the VPN gateway.
+ :param List[VPNGatewayMember] members: Collection of VPN gateway members.
+ :param str name: The name for this VPN gateway. The name is unique across all
+ VPN gateways in the VPC.
+ :param ResourceGroupReference resource_group: The resource group for this VPN
+ gateway.
+ :param str resource_type: The resource type.
+ :param SubnetReference subnet:
+ :param VPCReference vpc: The VPC this VPN gateway resides in.
+ :param str mode: Policy mode VPN gateway.
"""
def __init__(
self,
- source_volume: 'VolumeIdentity',
- *,
- clones: List['SnapshotClonePrototype'] = None,
- name: str = None,
- resource_group: 'ResourceGroupIdentity' = None,
- user_tags: List[str] = None,
+ connections: List['VPNGatewayConnectionReference'],
+ created_at: datetime,
+ crn: str,
+ health_reasons: List['VPNGatewayHealthReason'],
+ health_state: str,
+ href: str,
+ id: str,
+ lifecycle_reasons: List['VPNGatewayLifecycleReason'],
+ lifecycle_state: str,
+ members: List['VPNGatewayMember'],
+ name: str,
+ resource_group: 'ResourceGroupReference',
+ resource_type: str,
+ subnet: 'SubnetReference',
+ vpc: 'VPCReference',
+ mode: str,
) -> None:
"""
- Initialize a SnapshotPrototypeSnapshotBySourceVolume object.
+ Initialize a VPNGatewayPolicyMode object.
- :param VolumeIdentity source_volume: The volume to create this snapshot
- from.
- :param List[SnapshotClonePrototype] clones: (optional) Clones to create for
- this snapshot.
- :param str name: (optional) The name for this snapshot. The name must not
- be used by another snapshot in the region. If unspecified, the name will be
- a hyphenated list of randomly-selected words.
- :param ResourceGroupIdentity resource_group: (optional)
- :param List[str] user_tags: (optional) The [user
- tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with
- this snapshot.
+ :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 List[VPNGatewayHealthReason] health_reasons: The reasons for the
+ current VPN gateway health_state (if any):
+ - `cannot_create_vpc_route`: VPN cannot create route (check for conflict)
+ - `cannot_reserve_ip_address`: IP address exhaustion (release addresses on
+ the VPN's
+ subnet)
+ - `internal_error`: Internal error (contact IBM support)
+ The enumerated reason code values for this property will expand in the
+ future. When processing this property, check for and log unknown values.
+ Optionally halt processing and surface the error, or bypass the resource on
+ which the unexpected reason code was encountered.
+ :param str health_state: The health of this resource.
+ - `ok`: No abnormal behavior detected
+ - `degraded`: Experiencing compromised performance, capacity, or
+ connectivity
+ - `faulted`: Completely unreachable, inoperative, or otherwise entirely
+ incapacitated
+ - `inapplicable`: The health state does not apply because of the current
+ lifecycle state. A resource with a lifecycle state of `failed` or
+ `deleting` will have a health state of `inapplicable`. A `pending` resource
+ may also have this state.
+ :param str href: The VPN gateway's canonical URL.
+ :param str id: The unique identifier for this VPN gateway.
+ :param List[VPNGatewayLifecycleReason] lifecycle_reasons: The reasons for
+ the current VPN gateway lifecycle_state (if any):
+ - `resource_suspended_by_provider`: The resource has been suspended
+ (contact IBM
+ support)
+ The enumerated reason code values for this property will expand in the
+ future. When processing this property, check for and log unknown values.
+ Optionally halt processing and surface the error, or bypass the resource on
+ which the unexpected reason code was encountered.
+ :param str lifecycle_state: The lifecycle state of the VPN gateway.
+ :param List[VPNGatewayMember] members: Collection of VPN gateway members.
+ :param str name: The name for this VPN gateway. The name is unique across
+ all VPN gateways in the VPC.
+ :param ResourceGroupReference resource_group: The resource group for this
+ VPN gateway.
+ :param str resource_type: The resource type.
+ :param SubnetReference subnet:
+ :param VPCReference vpc: The VPC this VPN gateway resides in.
+ :param str mode: Policy mode VPN gateway.
"""
# pylint: disable=super-init-not-called
- self.clones = clones
+ self.connections = connections
+ self.created_at = created_at
+ self.crn = crn
+ self.health_reasons = health_reasons
+ self.health_state = health_state
+ self.href = href
+ self.id = id
+ self.lifecycle_reasons = lifecycle_reasons
+ self.lifecycle_state = lifecycle_state
+ self.members = members
self.name = name
self.resource_group = resource_group
- self.user_tags = user_tags
- self.source_volume = source_volume
+ self.resource_type = resource_type
+ self.subnet = subnet
+ self.vpc = vpc
+ self.mode = mode
@classmethod
- def from_dict(cls, _dict: Dict) -> 'SnapshotPrototypeSnapshotBySourceVolume':
- """Initialize a SnapshotPrototypeSnapshotBySourceVolume object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VPNGatewayPolicyMode':
+ """Initialize a VPNGatewayPolicyMode object from a json dictionary."""
args = {}
- if 'clones' in _dict:
- args['clones'] = [SnapshotClonePrototype.from_dict(v) for v in _dict.get('clones')]
- if 'name' in _dict:
- args['name'] = _dict.get('name')
- if 'resource_group' in _dict:
- args['resource_group'] = _dict.get('resource_group')
- if 'user_tags' in _dict:
- args['user_tags'] = _dict.get('user_tags')
- if 'source_volume' in _dict:
- args['source_volume'] = _dict.get('source_volume')
+ if (connections := _dict.get('connections')) is not None:
+ args['connections'] = [VPNGatewayConnectionReference.from_dict(v) for v in connections]
else:
- raise ValueError('Required property \'source_volume\' not present in SnapshotPrototypeSnapshotBySourceVolume JSON')
+ raise ValueError('Required property \'connections\' not present in VPNGatewayPolicyMode JSON')
+ if (created_at := _dict.get('created_at')) is not None:
+ args['created_at'] = string_to_datetime(created_at)
+ else:
+ raise ValueError('Required property \'created_at\' not present in VPNGatewayPolicyMode JSON')
+ if (crn := _dict.get('crn')) is not None:
+ args['crn'] = crn
+ else:
+ raise ValueError('Required property \'crn\' not present in VPNGatewayPolicyMode JSON')
+ if (health_reasons := _dict.get('health_reasons')) is not None:
+ args['health_reasons'] = [VPNGatewayHealthReason.from_dict(v) for v in health_reasons]
+ else:
+ raise ValueError('Required property \'health_reasons\' not present in VPNGatewayPolicyMode JSON')
+ if (health_state := _dict.get('health_state')) is not None:
+ args['health_state'] = health_state
+ else:
+ raise ValueError('Required property \'health_state\' not present in VPNGatewayPolicyMode JSON')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
+ else:
+ raise ValueError('Required property \'href\' not present in VPNGatewayPolicyMode JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
+ else:
+ raise ValueError('Required property \'id\' not present in VPNGatewayPolicyMode JSON')
+ if (lifecycle_reasons := _dict.get('lifecycle_reasons')) is not None:
+ args['lifecycle_reasons'] = [VPNGatewayLifecycleReason.from_dict(v) for v in lifecycle_reasons]
+ else:
+ raise ValueError('Required property \'lifecycle_reasons\' not present in VPNGatewayPolicyMode JSON')
+ if (lifecycle_state := _dict.get('lifecycle_state')) is not None:
+ args['lifecycle_state'] = lifecycle_state
+ else:
+ raise ValueError('Required property \'lifecycle_state\' not present in VPNGatewayPolicyMode JSON')
+ if (members := _dict.get('members')) is not None:
+ args['members'] = [VPNGatewayMember.from_dict(v) for v in members]
+ else:
+ raise ValueError('Required property \'members\' not present in VPNGatewayPolicyMode JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ else:
+ raise ValueError('Required property \'name\' not present in VPNGatewayPolicyMode JSON')
+ if (resource_group := _dict.get('resource_group')) is not None:
+ args['resource_group'] = ResourceGroupReference.from_dict(resource_group)
+ else:
+ raise ValueError('Required property \'resource_group\' not present in VPNGatewayPolicyMode JSON')
+ if (resource_type := _dict.get('resource_type')) is not None:
+ args['resource_type'] = resource_type
+ else:
+ raise ValueError('Required property \'resource_type\' not present in VPNGatewayPolicyMode JSON')
+ if (subnet := _dict.get('subnet')) is not None:
+ args['subnet'] = SubnetReference.from_dict(subnet)
+ else:
+ raise ValueError('Required property \'subnet\' not present in VPNGatewayPolicyMode JSON')
+ if (vpc := _dict.get('vpc')) is not None:
+ args['vpc'] = VPCReference.from_dict(vpc)
+ else:
+ raise ValueError('Required property \'vpc\' not present in VPNGatewayPolicyMode JSON')
+ if (mode := _dict.get('mode')) is not None:
+ args['mode'] = mode
+ else:
+ raise ValueError('Required property \'mode\' not present in VPNGatewayPolicyMode JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a SnapshotPrototypeSnapshotBySourceVolume object from a json dictionary."""
+ """Initialize a VPNGatewayPolicyMode object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'clones') and self.clones is not None:
- clones_list = []
- for v in self.clones:
+ if hasattr(self, 'connections') and self.connections is not None:
+ connections_list = []
+ for v in self.connections:
if isinstance(v, dict):
- clones_list.append(v)
+ connections_list.append(v)
else:
- clones_list.append(v.to_dict())
- _dict['clones'] = clones_list
+ connections_list.append(v.to_dict())
+ _dict['connections'] = connections_list
+ if hasattr(self, 'created_at') and self.created_at is not None:
+ _dict['created_at'] = datetime_to_string(self.created_at)
+ if hasattr(self, 'crn') and self.crn is not None:
+ _dict['crn'] = self.crn
+ if hasattr(self, 'health_reasons') and self.health_reasons is not None:
+ health_reasons_list = []
+ for v in self.health_reasons:
+ if isinstance(v, dict):
+ health_reasons_list.append(v)
+ else:
+ health_reasons_list.append(v.to_dict())
+ _dict['health_reasons'] = health_reasons_list
+ if hasattr(self, 'health_state') and self.health_state is not None:
+ _dict['health_state'] = self.health_state
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
+ if hasattr(self, 'id') and self.id is not None:
+ _dict['id'] = self.id
+ if hasattr(self, 'lifecycle_reasons') and self.lifecycle_reasons is not None:
+ lifecycle_reasons_list = []
+ for v in self.lifecycle_reasons:
+ if isinstance(v, dict):
+ lifecycle_reasons_list.append(v)
+ else:
+ lifecycle_reasons_list.append(v.to_dict())
+ _dict['lifecycle_reasons'] = lifecycle_reasons_list
+ if hasattr(self, 'lifecycle_state') and self.lifecycle_state is not None:
+ _dict['lifecycle_state'] = self.lifecycle_state
+ if hasattr(self, 'members') and self.members is not None:
+ members_list = []
+ for v in self.members:
+ if isinstance(v, dict):
+ members_list.append(v)
+ else:
+ members_list.append(v.to_dict())
+ _dict['members'] = members_list
if hasattr(self, 'name') and self.name is not None:
_dict['name'] = self.name
if hasattr(self, 'resource_group') and self.resource_group is not None:
@@ -117569,13 +133522,20 @@ def to_dict(self) -> Dict:
_dict['resource_group'] = self.resource_group
else:
_dict['resource_group'] = self.resource_group.to_dict()
- if hasattr(self, 'user_tags') and self.user_tags is not None:
- _dict['user_tags'] = self.user_tags
- if hasattr(self, 'source_volume') and self.source_volume is not None:
- if isinstance(self.source_volume, dict):
- _dict['source_volume'] = self.source_volume
+ if hasattr(self, 'resource_type') and self.resource_type is not None:
+ _dict['resource_type'] = self.resource_type
+ if hasattr(self, 'subnet') and self.subnet is not None:
+ if isinstance(self.subnet, dict):
+ _dict['subnet'] = self.subnet
else:
- _dict['source_volume'] = self.source_volume.to_dict()
+ _dict['subnet'] = self.subnet.to_dict()
+ if hasattr(self, 'vpc') and self.vpc is not None:
+ if isinstance(self.vpc, dict):
+ _dict['vpc'] = self.vpc
+ else:
+ _dict['vpc'] = self.vpc.to_dict()
+ if hasattr(self, 'mode') and self.mode is not None:
+ _dict['mode'] = self.mode
return _dict
def _to_dict(self):
@@ -117583,119 +133543,142 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this SnapshotPrototypeSnapshotBySourceVolume object."""
+ """Return a `str` version of this VPNGatewayPolicyMode object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'SnapshotPrototypeSnapshotBySourceVolume') -> bool:
+ def __eq__(self, other: 'VPNGatewayPolicyMode') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'SnapshotPrototypeSnapshotBySourceVolume') -> bool:
+ def __ne__(self, other: 'VPNGatewayPolicyMode') -> 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.
+ """
-class SubnetIdentityByCRN(SubnetIdentity):
- """
- SubnetIdentityByCRN.
+ DEGRADED = 'degraded'
+ FAULTED = 'faulted'
+ INAPPLICABLE = 'inapplicable'
+ OK = 'ok'
- :attr str crn: The CRN for this subnet.
- """
- def __init__(
- self,
- crn: str,
- ) -> None:
+ class LifecycleStateEnum(str, Enum):
"""
- Initialize a SubnetIdentityByCRN object.
-
- :param str crn: The CRN for this subnet.
+ The lifecycle state of the VPN gateway.
"""
- # pylint: disable=super-init-not-called
- self.crn = crn
- @classmethod
- def from_dict(cls, _dict: Dict) -> 'SubnetIdentityByCRN':
- """Initialize a SubnetIdentityByCRN object from a json dictionary."""
- args = {}
- if 'crn' in _dict:
- args['crn'] = _dict.get('crn')
- else:
- raise ValueError('Required property \'crn\' not present in SubnetIdentityByCRN JSON')
- return cls(**args)
+ DELETING = 'deleting'
+ FAILED = 'failed'
+ PENDING = 'pending'
+ STABLE = 'stable'
+ SUSPENDED = 'suspended'
+ UPDATING = 'updating'
+ WAITING = 'waiting'
- @classmethod
- def _from_dict(cls, _dict):
- """Initialize a SubnetIdentityByCRN object from 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
+ class ResourceTypeEnum(str, Enum):
+ """
+ The resource type.
+ """
- def _to_dict(self):
- """Return a json dictionary representing this model."""
- return self.to_dict()
+ VPN_GATEWAY = 'vpn_gateway'
- def __str__(self) -> str:
- """Return a `str` version of this SubnetIdentityByCRN object."""
- return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'SubnetIdentityByCRN') -> 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 ModeEnum(str, Enum):
+ """
+ Policy mode VPN gateway.
+ """
- def __ne__(self, other: 'SubnetIdentityByCRN') -> bool:
- """Return `true` when self and other are not equal, false otherwise."""
- return not self == other
+ POLICY = 'policy'
-class SubnetIdentityByHref(SubnetIdentity):
+
+class VPNGatewayPrototypeVPNGatewayPolicyModePrototype(VPNGatewayPrototype):
"""
- SubnetIdentityByHref.
+ VPNGatewayPrototypeVPNGatewayPolicyModePrototype.
- :attr str href: The URL for this subnet.
+ :param str name: (optional) The name for this VPN gateway. The name must not be
+ used by another VPN gateway in the VPC. If unspecified, the name will be a
+ hyphenated list of randomly-selected words.
+ :param ResourceGroupIdentity resource_group: (optional)
+ :param SubnetIdentity subnet:
+ :param str mode: (optional) Policy mode VPN gateway.
"""
def __init__(
self,
- href: str,
+ subnet: 'SubnetIdentity',
+ *,
+ name: Optional[str] = None,
+ resource_group: Optional['ResourceGroupIdentity'] = None,
+ mode: Optional[str] = None,
) -> None:
"""
- Initialize a SubnetIdentityByHref object.
+ Initialize a VPNGatewayPrototypeVPNGatewayPolicyModePrototype object.
- :param str href: The URL for this subnet.
+ :param SubnetIdentity subnet:
+ :param str name: (optional) The name for this VPN gateway. The name must
+ not be used by another VPN gateway in the VPC. If unspecified, the name
+ will be a hyphenated list of randomly-selected words.
+ :param ResourceGroupIdentity resource_group: (optional)
+ :param str mode: (optional) Policy mode VPN gateway.
"""
# pylint: disable=super-init-not-called
- self.href = href
+ self.name = name
+ self.resource_group = resource_group
+ self.subnet = subnet
+ self.mode = mode
@classmethod
- def from_dict(cls, _dict: Dict) -> 'SubnetIdentityByHref':
- """Initialize a SubnetIdentityByHref object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VPNGatewayPrototypeVPNGatewayPolicyModePrototype':
+ """Initialize a VPNGatewayPrototypeVPNGatewayPolicyModePrototype object from a json dictionary."""
args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ if (resource_group := _dict.get('resource_group')) is not None:
+ args['resource_group'] = resource_group
+ if (subnet := _dict.get('subnet')) is not None:
+ args['subnet'] = subnet
else:
- raise ValueError('Required property \'href\' not present in SubnetIdentityByHref JSON')
+ raise ValueError('Required property \'subnet\' not present in VPNGatewayPrototypeVPNGatewayPolicyModePrototype JSON')
+ if (mode := _dict.get('mode')) is not None:
+ args['mode'] = mode
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a SubnetIdentityByHref object from a json dictionary."""
+ """Initialize a VPNGatewayPrototypeVPNGatewayPolicyModePrototype object from 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_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, '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, 'mode') and self.mode is not None:
+ _dict['mode'] = self.mode
return _dict
def _to_dict(self):
@@ -117703,59 +133686,102 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this SubnetIdentityByHref object."""
+ """Return a `str` version of this VPNGatewayPrototypeVPNGatewayPolicyModePrototype object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'SubnetIdentityByHref') -> bool:
+ def __eq__(self, other: 'VPNGatewayPrototypeVPNGatewayPolicyModePrototype') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'SubnetIdentityByHref') -> bool:
+ def __ne__(self, other: 'VPNGatewayPrototypeVPNGatewayPolicyModePrototype') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
+ class ModeEnum(str, Enum):
+ """
+ Policy mode VPN gateway.
+ """
+
+ POLICY = 'policy'
+
-class SubnetIdentityById(SubnetIdentity):
+
+class VPNGatewayPrototypeVPNGatewayRouteModePrototype(VPNGatewayPrototype):
"""
- SubnetIdentityById.
+ VPNGatewayPrototypeVPNGatewayRouteModePrototype.
- :attr str id: The unique identifier for this subnet.
+ :param str name: (optional) The name for this VPN gateway. The name must not be
+ used by another VPN gateway in the VPC. If unspecified, the name will be a
+ hyphenated list of randomly-selected words.
+ :param ResourceGroupIdentity resource_group: (optional)
+ :param SubnetIdentity subnet:
+ :param str mode: (optional) Route mode VPN gateway.
"""
def __init__(
self,
- id: str,
+ subnet: 'SubnetIdentity',
+ *,
+ name: Optional[str] = None,
+ resource_group: Optional['ResourceGroupIdentity'] = None,
+ mode: Optional[str] = None,
) -> None:
"""
- Initialize a SubnetIdentityById object.
+ Initialize a VPNGatewayPrototypeVPNGatewayRouteModePrototype object.
- :param str id: The unique identifier for this subnet.
+ :param SubnetIdentity subnet:
+ :param str name: (optional) The name for this VPN gateway. The name must
+ not be used by another VPN gateway in the VPC. If unspecified, the name
+ will be a hyphenated list of randomly-selected words.
+ :param ResourceGroupIdentity resource_group: (optional)
+ :param str mode: (optional) Route mode VPN gateway.
"""
# pylint: disable=super-init-not-called
- self.id = id
+ self.name = name
+ self.resource_group = resource_group
+ self.subnet = subnet
+ self.mode = mode
@classmethod
- def from_dict(cls, _dict: Dict) -> 'SubnetIdentityById':
- """Initialize a SubnetIdentityById object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VPNGatewayPrototypeVPNGatewayRouteModePrototype':
+ """Initialize a VPNGatewayPrototypeVPNGatewayRouteModePrototype object from a json dictionary."""
args = {}
- if 'id' in _dict:
- args['id'] = _dict.get('id')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ if (resource_group := _dict.get('resource_group')) is not None:
+ args['resource_group'] = resource_group
+ if (subnet := _dict.get('subnet')) is not None:
+ args['subnet'] = subnet
else:
- raise ValueError('Required property \'id\' not present in SubnetIdentityById JSON')
+ raise ValueError('Required property \'subnet\' not present in VPNGatewayPrototypeVPNGatewayRouteModePrototype JSON')
+ if (mode := _dict.get('mode')) is not None:
+ args['mode'] = mode
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a SubnetIdentityById object from a json dictionary."""
+ """Initialize a VPNGatewayPrototypeVPNGatewayRouteModePrototype object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'id') and self.id is not None:
- _dict['id'] = self.id
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ 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, '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, 'mode') and self.mode is not None:
+ _dict['mode'] = self.mode
return _dict
def _to_dict(self):
@@ -117763,176 +133789,309 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this SubnetIdentityById object."""
+ """Return a `str` version of this VPNGatewayPrototypeVPNGatewayRouteModePrototype object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'SubnetIdentityById') -> bool:
+ def __eq__(self, other: 'VPNGatewayPrototypeVPNGatewayRouteModePrototype') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'SubnetIdentityById') -> bool:
+ def __ne__(self, other: 'VPNGatewayPrototypeVPNGatewayRouteModePrototype') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
+ class ModeEnum(str, Enum):
+ """
+ Route mode VPN gateway.
+ """
-class SubnetPrototypeSubnetByCIDR(SubnetPrototype):
- """
- SubnetPrototypeSubnetByCIDR.
+ ROUTE = 'route'
- :attr str ip_version: (optional) The IP version(s) to support for this subnet.
- :attr str name: (optional) The name for this subnet. The name must not be used
- by another subnet in the VPC. If unspecified, the name will be a hyphenated list
- of randomly-selected words.
- :attr NetworkACLIdentity network_acl: (optional) The network ACL to use for this
- subnet.
- :attr PublicGatewayIdentity public_gateway: (optional) The public gateway to use
- for internet-bound traffic for this subnet. If unspecified, the subnet will not
- be attached to a public gateway.
- :attr ResourceGroupIdentity resource_group: (optional)
- :attr RoutingTableIdentity routing_table: (optional) The routing table to use
- for this subnet. If unspecified, the default routing table for the VPC is used.
- The routing table properties `route_direct_link_ingress`,
- `route_internet_ingress`, `route_transit_gateway_ingress`, and
- `route_vpc_zone_ingress` must be `false`.
- :attr VPCIdentity vpc: The VPC the subnet will reside in.
- :attr str ipv4_cidr_block: The IPv4 range of the subnet, expressed in CIDR
- format. The prefix length of the subnet's CIDR must be between `/9` (8,388,608
- addresses) and `/29` (8 addresses). The IPv4 range of the subnet's CIDR must
- fall within an existing address prefix in the VPC and must not overlap with any
- existing subnet. The subnet will be created in the zone of the address prefix
- that contains the IPv4 CIDR. If zone is specified, it must match the zone of the
- address prefix that contains the subnet's IPv4 CIDR.
- :attr ZoneIdentity zone: (optional) The zone this subnet will reside in.
+
+
+class VPNGatewayRouteMode(VPNGateway):
+ """
+ VPNGatewayRouteMode.
+
+ :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 List[VPNGatewayHealthReason] health_reasons: The reasons for the current
+ VPN gateway health_state (if any):
+ - `cannot_create_vpc_route`: VPN cannot create route (check for conflict)
+ - `cannot_reserve_ip_address`: IP address exhaustion (release addresses on the
+ VPN's
+ subnet)
+ - `internal_error`: Internal error (contact IBM support)
+ The enumerated reason code values for this property will expand in the future.
+ When processing this property, check for and log unknown values. Optionally halt
+ processing and surface the error, or bypass the resource on which the unexpected
+ reason code was encountered.
+ :param str health_state: The health of this resource.
+ - `ok`: No abnormal behavior detected
+ - `degraded`: Experiencing compromised performance, capacity, or connectivity
+ - `faulted`: Completely unreachable, inoperative, or otherwise entirely
+ incapacitated
+ - `inapplicable`: The health state does not apply because of the current
+ lifecycle state. A resource with a lifecycle state of `failed` or `deleting`
+ will have a health state of `inapplicable`. A `pending` resource may also have
+ this state.
+ :param str href: The VPN gateway's canonical URL.
+ :param str id: The unique identifier for this VPN gateway.
+ :param List[VPNGatewayLifecycleReason] lifecycle_reasons: The reasons for the
+ current VPN gateway lifecycle_state (if any):
+ - `resource_suspended_by_provider`: The resource has been suspended (contact IBM
+ support)
+ The enumerated reason code values for this property will expand in the future.
+ When processing this property, check for and log unknown values. Optionally halt
+ processing and surface the error, or bypass the resource on which the unexpected
+ reason code was encountered.
+ :param str lifecycle_state: The lifecycle state of the VPN gateway.
+ :param List[VPNGatewayMember] members: Collection of VPN gateway members.
+ :param str name: The name for this VPN gateway. The name is unique across all
+ VPN gateways in the VPC.
+ :param ResourceGroupReference resource_group: The resource group for this VPN
+ gateway.
+ :param str resource_type: The resource type.
+ :param SubnetReference subnet:
+ :param VPCReference vpc: The VPC this VPN gateway resides in.
+ :param str mode: Route mode VPN gateway.
"""
def __init__(
self,
- vpc: 'VPCIdentity',
- ipv4_cidr_block: str,
- *,
- ip_version: str = None,
- name: str = None,
- network_acl: 'NetworkACLIdentity' = None,
- public_gateway: 'PublicGatewayIdentity' = None,
- resource_group: 'ResourceGroupIdentity' = None,
- routing_table: 'RoutingTableIdentity' = None,
- zone: 'ZoneIdentity' = None,
+ connections: List['VPNGatewayConnectionReference'],
+ created_at: datetime,
+ crn: str,
+ health_reasons: List['VPNGatewayHealthReason'],
+ health_state: str,
+ href: str,
+ id: str,
+ lifecycle_reasons: List['VPNGatewayLifecycleReason'],
+ lifecycle_state: str,
+ members: List['VPNGatewayMember'],
+ name: str,
+ resource_group: 'ResourceGroupReference',
+ resource_type: str,
+ subnet: 'SubnetReference',
+ vpc: 'VPCReference',
+ mode: str,
) -> None:
"""
- Initialize a SubnetPrototypeSubnetByCIDR object.
+ Initialize a VPNGatewayRouteMode object.
- :param VPCIdentity vpc: The VPC the subnet will reside in.
- :param str ipv4_cidr_block: The IPv4 range of the subnet, expressed in CIDR
- format. The prefix length of the subnet's CIDR must be between `/9`
- (8,388,608 addresses) and `/29` (8 addresses). The IPv4 range of the
- subnet's CIDR must fall within an existing address prefix in the VPC and
- must not overlap with any existing subnet. The subnet will be created in
- the zone of the address prefix that contains the IPv4 CIDR. If zone is
- specified, it must match the zone of the address prefix that contains the
- subnet's IPv4 CIDR.
- :param str ip_version: (optional) The IP version(s) to support for this
- subnet.
- :param str name: (optional) The name for this subnet. The name must not be
- used by another subnet in the VPC. If unspecified, the name will be a
- hyphenated list of randomly-selected words.
- :param NetworkACLIdentity network_acl: (optional) The network ACL to use
- for this subnet.
- :param PublicGatewayIdentity public_gateway: (optional) The public gateway
- to use for internet-bound traffic for this subnet. If unspecified, the
- subnet will not be attached to a public gateway.
- :param ResourceGroupIdentity resource_group: (optional)
- :param RoutingTableIdentity routing_table: (optional) The routing table to
- use for this subnet. If unspecified, the default routing table for the VPC
- is used. The routing table properties `route_direct_link_ingress`,
- `route_internet_ingress`, `route_transit_gateway_ingress`, and
- `route_vpc_zone_ingress` must be `false`.
- :param ZoneIdentity zone: (optional) The zone this subnet will reside in.
+ :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 List[VPNGatewayHealthReason] health_reasons: The reasons for the
+ current VPN gateway health_state (if any):
+ - `cannot_create_vpc_route`: VPN cannot create route (check for conflict)
+ - `cannot_reserve_ip_address`: IP address exhaustion (release addresses on
+ the VPN's
+ subnet)
+ - `internal_error`: Internal error (contact IBM support)
+ The enumerated reason code values for this property will expand in the
+ future. When processing this property, check for and log unknown values.
+ Optionally halt processing and surface the error, or bypass the resource on
+ which the unexpected reason code was encountered.
+ :param str health_state: The health of this resource.
+ - `ok`: No abnormal behavior detected
+ - `degraded`: Experiencing compromised performance, capacity, or
+ connectivity
+ - `faulted`: Completely unreachable, inoperative, or otherwise entirely
+ incapacitated
+ - `inapplicable`: The health state does not apply because of the current
+ lifecycle state. A resource with a lifecycle state of `failed` or
+ `deleting` will have a health state of `inapplicable`. A `pending` resource
+ may also have this state.
+ :param str href: The VPN gateway's canonical URL.
+ :param str id: The unique identifier for this VPN gateway.
+ :param List[VPNGatewayLifecycleReason] lifecycle_reasons: The reasons for
+ the current VPN gateway lifecycle_state (if any):
+ - `resource_suspended_by_provider`: The resource has been suspended
+ (contact IBM
+ support)
+ The enumerated reason code values for this property will expand in the
+ future. When processing this property, check for and log unknown values.
+ Optionally halt processing and surface the error, or bypass the resource on
+ which the unexpected reason code was encountered.
+ :param str lifecycle_state: The lifecycle state of the VPN gateway.
+ :param List[VPNGatewayMember] members: Collection of VPN gateway members.
+ :param str name: The name for this VPN gateway. The name is unique across
+ all VPN gateways in the VPC.
+ :param ResourceGroupReference resource_group: The resource group for this
+ VPN gateway.
+ :param str resource_type: The resource type.
+ :param SubnetReference subnet:
+ :param VPCReference vpc: The VPC this VPN gateway resides in.
+ :param str mode: Route mode VPN gateway.
"""
# pylint: disable=super-init-not-called
- self.ip_version = ip_version
+ self.connections = connections
+ self.created_at = created_at
+ self.crn = crn
+ self.health_reasons = health_reasons
+ self.health_state = health_state
+ self.href = href
+ self.id = id
+ self.lifecycle_reasons = lifecycle_reasons
+ self.lifecycle_state = lifecycle_state
+ self.members = members
self.name = name
- self.network_acl = network_acl
- self.public_gateway = public_gateway
self.resource_group = resource_group
- self.routing_table = routing_table
+ self.resource_type = resource_type
+ self.subnet = subnet
self.vpc = vpc
- self.ipv4_cidr_block = ipv4_cidr_block
- self.zone = zone
+ self.mode = mode
@classmethod
- def from_dict(cls, _dict: Dict) -> 'SubnetPrototypeSubnetByCIDR':
- """Initialize a SubnetPrototypeSubnetByCIDR object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VPNGatewayRouteMode':
+ """Initialize a VPNGatewayRouteMode object from a json dictionary."""
args = {}
- if 'ip_version' in _dict:
- args['ip_version'] = _dict.get('ip_version')
- 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 'resource_group' in _dict:
- args['resource_group'] = _dict.get('resource_group')
- if 'routing_table' in _dict:
- args['routing_table'] = _dict.get('routing_table')
- if 'vpc' in _dict:
- args['vpc'] = _dict.get('vpc')
+ if (connections := _dict.get('connections')) is not None:
+ args['connections'] = [VPNGatewayConnectionReference.from_dict(v) for v in connections]
else:
- raise ValueError('Required property \'vpc\' not present in SubnetPrototypeSubnetByCIDR JSON')
- if 'ipv4_cidr_block' in _dict:
- args['ipv4_cidr_block'] = _dict.get('ipv4_cidr_block')
+ raise ValueError('Required property \'connections\' not present in VPNGatewayRouteMode JSON')
+ if (created_at := _dict.get('created_at')) is not None:
+ args['created_at'] = string_to_datetime(created_at)
else:
- raise ValueError('Required property \'ipv4_cidr_block\' not present in SubnetPrototypeSubnetByCIDR JSON')
- if 'zone' in _dict:
- args['zone'] = _dict.get('zone')
+ raise ValueError('Required property \'created_at\' not present in VPNGatewayRouteMode JSON')
+ if (crn := _dict.get('crn')) is not None:
+ args['crn'] = crn
+ else:
+ raise ValueError('Required property \'crn\' not present in VPNGatewayRouteMode JSON')
+ if (health_reasons := _dict.get('health_reasons')) is not None:
+ args['health_reasons'] = [VPNGatewayHealthReason.from_dict(v) for v in health_reasons]
+ else:
+ raise ValueError('Required property \'health_reasons\' not present in VPNGatewayRouteMode JSON')
+ if (health_state := _dict.get('health_state')) is not None:
+ args['health_state'] = health_state
+ else:
+ raise ValueError('Required property \'health_state\' not present in VPNGatewayRouteMode JSON')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
+ else:
+ raise ValueError('Required property \'href\' not present in VPNGatewayRouteMode JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
+ else:
+ raise ValueError('Required property \'id\' not present in VPNGatewayRouteMode JSON')
+ if (lifecycle_reasons := _dict.get('lifecycle_reasons')) is not None:
+ args['lifecycle_reasons'] = [VPNGatewayLifecycleReason.from_dict(v) for v in lifecycle_reasons]
+ else:
+ raise ValueError('Required property \'lifecycle_reasons\' not present in VPNGatewayRouteMode JSON')
+ if (lifecycle_state := _dict.get('lifecycle_state')) is not None:
+ args['lifecycle_state'] = lifecycle_state
+ else:
+ raise ValueError('Required property \'lifecycle_state\' not present in VPNGatewayRouteMode JSON')
+ if (members := _dict.get('members')) is not None:
+ args['members'] = [VPNGatewayMember.from_dict(v) for v in members]
+ else:
+ raise ValueError('Required property \'members\' not present in VPNGatewayRouteMode JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ else:
+ raise ValueError('Required property \'name\' not present in VPNGatewayRouteMode JSON')
+ if (resource_group := _dict.get('resource_group')) is not None:
+ args['resource_group'] = ResourceGroupReference.from_dict(resource_group)
+ else:
+ raise ValueError('Required property \'resource_group\' not present in VPNGatewayRouteMode JSON')
+ if (resource_type := _dict.get('resource_type')) is not None:
+ args['resource_type'] = resource_type
+ else:
+ raise ValueError('Required property \'resource_type\' not present in VPNGatewayRouteMode JSON')
+ if (subnet := _dict.get('subnet')) is not None:
+ args['subnet'] = SubnetReference.from_dict(subnet)
+ else:
+ raise ValueError('Required property \'subnet\' not present in VPNGatewayRouteMode JSON')
+ if (vpc := _dict.get('vpc')) is not None:
+ args['vpc'] = VPCReference.from_dict(vpc)
+ else:
+ raise ValueError('Required property \'vpc\' not present in VPNGatewayRouteMode JSON')
+ if (mode := _dict.get('mode')) is not None:
+ args['mode'] = mode
+ else:
+ raise ValueError('Required property \'mode\' not present in VPNGatewayRouteMode JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a SubnetPrototypeSubnetByCIDR object from a json dictionary."""
+ """Initialize a VPNGatewayRouteMode object from 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_version') and self.ip_version is not None:
- _dict['ip_version'] = self.ip_version
+ if hasattr(self, 'connections') and self.connections is not None:
+ connections_list = []
+ for v in self.connections:
+ if isinstance(v, dict):
+ connections_list.append(v)
+ else:
+ connections_list.append(v.to_dict())
+ _dict['connections'] = connections_list
+ if hasattr(self, 'created_at') and self.created_at is not None:
+ _dict['created_at'] = datetime_to_string(self.created_at)
+ if hasattr(self, 'crn') and self.crn is not None:
+ _dict['crn'] = self.crn
+ if hasattr(self, 'health_reasons') and self.health_reasons is not None:
+ health_reasons_list = []
+ for v in self.health_reasons:
+ if isinstance(v, dict):
+ health_reasons_list.append(v)
+ else:
+ health_reasons_list.append(v.to_dict())
+ _dict['health_reasons'] = health_reasons_list
+ if hasattr(self, 'health_state') and self.health_state is not None:
+ _dict['health_state'] = self.health_state
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
+ if hasattr(self, 'id') and self.id is not None:
+ _dict['id'] = self.id
+ if hasattr(self, 'lifecycle_reasons') and self.lifecycle_reasons is not None:
+ lifecycle_reasons_list = []
+ for v in self.lifecycle_reasons:
+ if isinstance(v, dict):
+ lifecycle_reasons_list.append(v)
+ else:
+ lifecycle_reasons_list.append(v.to_dict())
+ _dict['lifecycle_reasons'] = lifecycle_reasons_list
+ if hasattr(self, 'lifecycle_state') and self.lifecycle_state is not None:
+ _dict['lifecycle_state'] = self.lifecycle_state
+ if hasattr(self, 'members') and self.members is not None:
+ members_list = []
+ for v in self.members:
+ if isinstance(v, dict):
+ members_list.append(v)
+ else:
+ members_list.append(v.to_dict())
+ _dict['members'] = members_list
if hasattr(self, 'name') and self.name is not None:
_dict['name'] = self.name
- if hasattr(self, 'network_acl') and self.network_acl is not None:
- if isinstance(self.network_acl, dict):
- _dict['network_acl'] = self.network_acl
- else:
- _dict['network_acl'] = self.network_acl.to_dict()
- if hasattr(self, 'public_gateway') and self.public_gateway is not None:
- if isinstance(self.public_gateway, dict):
- _dict['public_gateway'] = self.public_gateway
- else:
- _dict['public_gateway'] = self.public_gateway.to_dict()
if hasattr(self, 'resource_group') and self.resource_group is not None:
if isinstance(self.resource_group, dict):
_dict['resource_group'] = self.resource_group
else:
_dict['resource_group'] = self.resource_group.to_dict()
- if hasattr(self, 'routing_table') and self.routing_table is not None:
- if isinstance(self.routing_table, dict):
- _dict['routing_table'] = self.routing_table
+ if hasattr(self, 'resource_type') and self.resource_type is not None:
+ _dict['resource_type'] = self.resource_type
+ if hasattr(self, 'subnet') and self.subnet is not None:
+ if isinstance(self.subnet, dict):
+ _dict['subnet'] = self.subnet
else:
- _dict['routing_table'] = self.routing_table.to_dict()
+ _dict['subnet'] = self.subnet.to_dict()
if hasattr(self, 'vpc') and self.vpc is not None:
if isinstance(self.vpc, dict):
_dict['vpc'] = self.vpc
else:
_dict['vpc'] = self.vpc.to_dict()
- if hasattr(self, 'ipv4_cidr_block') and self.ipv4_cidr_block is not None:
- _dict['ipv4_cidr_block'] = self.ipv4_cidr_block
- if hasattr(self, 'zone') and self.zone is not None:
- if isinstance(self.zone, dict):
- _dict['zone'] = self.zone
- else:
- _dict['zone'] = self.zone.to_dict()
+ if hasattr(self, 'mode') and self.mode is not None:
+ _dict['mode'] = self.mode
return _dict
def _to_dict(self):
@@ -117940,179 +134099,133 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this SubnetPrototypeSubnetByCIDR object."""
+ """Return a `str` version of this VPNGatewayRouteMode object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'SubnetPrototypeSubnetByCIDR') -> bool:
+ def __eq__(self, other: 'VPNGatewayRouteMode') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'SubnetPrototypeSubnetByCIDR') -> bool:
+ def __ne__(self, other: 'VPNGatewayRouteMode') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class IpVersionEnum(str, Enum):
+ class HealthStateEnum(str, Enum):
"""
- The IP version(s) to support for this subnet.
+ 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.
"""
- IPV4 = 'ipv4'
+ DEGRADED = 'degraded'
+ FAULTED = 'faulted'
+ INAPPLICABLE = 'inapplicable'
+ OK = 'ok'
+ class LifecycleStateEnum(str, Enum):
+ """
+ The lifecycle state of the VPN gateway.
+ """
-class SubnetPrototypeSubnetByTotalCount(SubnetPrototype):
+ DELETING = 'deleting'
+ FAILED = 'failed'
+ PENDING = 'pending'
+ STABLE = 'stable'
+ SUSPENDED = 'suspended'
+ UPDATING = 'updating'
+ WAITING = 'waiting'
+
+
+ class ResourceTypeEnum(str, Enum):
+ """
+ The resource type.
+ """
+
+ VPN_GATEWAY = 'vpn_gateway'
+
+
+ class ModeEnum(str, Enum):
+ """
+ Route mode VPN gateway.
+ """
+
+ ROUTE = 'route'
+
+
+
+class VPNServerAuthenticationByCertificate(VPNServerAuthentication):
"""
- SubnetPrototypeSubnetByTotalCount.
+ VPNServerAuthenticationByCertificate.
- :attr str ip_version: (optional) The IP version(s) to support for this subnet.
- :attr str name: (optional) The name for this subnet. The name must not be used
- by another subnet in the VPC. If unspecified, the name will be a hyphenated list
- of randomly-selected words.
- :attr NetworkACLIdentity network_acl: (optional) The network ACL to use for this
- subnet.
- :attr PublicGatewayIdentity public_gateway: (optional) The public gateway to use
- for internet-bound traffic for this subnet. If unspecified, the subnet will not
- be attached to a public gateway.
- :attr ResourceGroupIdentity resource_group: (optional)
- :attr RoutingTableIdentity routing_table: (optional) The routing table to use
- for this subnet. If unspecified, the default routing table for the VPC is used.
- The routing table properties `route_direct_link_ingress`,
- `route_internet_ingress`, `route_transit_gateway_ingress`, and
- `route_vpc_zone_ingress` must be `false`.
- :attr VPCIdentity vpc: The VPC the subnet will reside in.
- :attr int total_ipv4_address_count: The total number of IPv4 addresses required.
- Must be a power of 2. The VPC must have a default address prefix in the
- specified zone, and that prefix must have a free CIDR range with at least this
- number of addresses.
- :attr ZoneIdentity zone: The zone this subnet will reside in.
+ :param str method: The type of authentication.
+ :param CertificateInstanceReference client_ca: The certificate instance used for
+ the VPN client certificate authority (CA).
+ :param str crl: (optional) The certificate revocation list contents, encoded in
+ PEM format.
"""
def __init__(
self,
- vpc: 'VPCIdentity',
- total_ipv4_address_count: int,
- zone: 'ZoneIdentity',
+ method: str,
+ client_ca: 'CertificateInstanceReference',
*,
- ip_version: str = None,
- name: str = None,
- network_acl: 'NetworkACLIdentity' = None,
- public_gateway: 'PublicGatewayIdentity' = None,
- resource_group: 'ResourceGroupIdentity' = None,
- routing_table: 'RoutingTableIdentity' = None,
+ crl: Optional[str] = None,
) -> None:
"""
- Initialize a SubnetPrototypeSubnetByTotalCount object.
+ Initialize a VPNServerAuthenticationByCertificate object.
- :param VPCIdentity vpc: The VPC the subnet will reside in.
- :param int total_ipv4_address_count: The total number of IPv4 addresses
- required. Must be a power of 2. The VPC must have a default address prefix
- in the specified zone, and that prefix must have a free CIDR range with at
- least this number of addresses.
- :param ZoneIdentity zone: The zone this subnet will reside in.
- :param str ip_version: (optional) The IP version(s) to support for this
- subnet.
- :param str name: (optional) The name for this subnet. The name must not be
- used by another subnet in the VPC. If unspecified, the name will be a
- hyphenated list of randomly-selected words.
- :param NetworkACLIdentity network_acl: (optional) The network ACL to use
- for this subnet.
- :param PublicGatewayIdentity public_gateway: (optional) The public gateway
- to use for internet-bound traffic for this subnet. If unspecified, the
- subnet will not be attached to a public gateway.
- :param ResourceGroupIdentity resource_group: (optional)
- :param RoutingTableIdentity routing_table: (optional) The routing table to
- use for this subnet. If unspecified, the default routing table for the VPC
- is used. The routing table properties `route_direct_link_ingress`,
- `route_internet_ingress`, `route_transit_gateway_ingress`, and
- `route_vpc_zone_ingress` must be `false`.
+ :param str method: The type of authentication.
+ :param CertificateInstanceReference client_ca: The certificate instance
+ used for the VPN client certificate authority (CA).
+ :param str crl: (optional) The certificate revocation list contents,
+ encoded in PEM format.
"""
# pylint: disable=super-init-not-called
- self.ip_version = ip_version
- self.name = name
- self.network_acl = network_acl
- self.public_gateway = public_gateway
- self.resource_group = resource_group
- self.routing_table = routing_table
- self.vpc = vpc
- self.total_ipv4_address_count = total_ipv4_address_count
- self.zone = zone
+ self.method = method
+ self.client_ca = client_ca
+ self.crl = crl
@classmethod
- def from_dict(cls, _dict: Dict) -> 'SubnetPrototypeSubnetByTotalCount':
- """Initialize a SubnetPrototypeSubnetByTotalCount object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VPNServerAuthenticationByCertificate':
+ """Initialize a VPNServerAuthenticationByCertificate object from a json dictionary."""
args = {}
- if 'ip_version' in _dict:
- args['ip_version'] = _dict.get('ip_version')
- 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 'resource_group' in _dict:
- args['resource_group'] = _dict.get('resource_group')
- if 'routing_table' in _dict:
- args['routing_table'] = _dict.get('routing_table')
- if 'vpc' in _dict:
- args['vpc'] = _dict.get('vpc')
+ if (method := _dict.get('method')) is not None:
+ args['method'] = method
else:
- raise ValueError('Required property \'vpc\' not present in SubnetPrototypeSubnetByTotalCount 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 SubnetPrototypeSubnetByTotalCount JSON')
- if 'zone' in _dict:
- args['zone'] = _dict.get('zone')
+ raise ValueError('Required property \'method\' not present in VPNServerAuthenticationByCertificate JSON')
+ if (client_ca := _dict.get('client_ca')) is not None:
+ args['client_ca'] = CertificateInstanceReference.from_dict(client_ca)
else:
- raise ValueError('Required property \'zone\' not present in SubnetPrototypeSubnetByTotalCount JSON')
+ raise ValueError('Required property \'client_ca\' not present in VPNServerAuthenticationByCertificate JSON')
+ if (crl := _dict.get('crl')) is not None:
+ args['crl'] = crl
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a SubnetPrototypeSubnetByTotalCount object from a json dictionary."""
+ """Initialize a VPNServerAuthenticationByCertificate object from 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_version') and self.ip_version is not None:
- _dict['ip_version'] = self.ip_version
- if hasattr(self, 'name') and self.name is not None:
- _dict['name'] = self.name
- if hasattr(self, 'network_acl') and self.network_acl is not None:
- if isinstance(self.network_acl, dict):
- _dict['network_acl'] = self.network_acl
- else:
- _dict['network_acl'] = self.network_acl.to_dict()
- if hasattr(self, 'public_gateway') and self.public_gateway is not None:
- if isinstance(self.public_gateway, dict):
- _dict['public_gateway'] = self.public_gateway
- else:
- _dict['public_gateway'] = self.public_gateway.to_dict()
- if hasattr(self, 'resource_group') and self.resource_group is not None:
- if isinstance(self.resource_group, dict):
- _dict['resource_group'] = self.resource_group
- else:
- _dict['resource_group'] = self.resource_group.to_dict()
- if hasattr(self, 'routing_table') and self.routing_table is not None:
- if isinstance(self.routing_table, dict):
- _dict['routing_table'] = self.routing_table
- else:
- _dict['routing_table'] = self.routing_table.to_dict()
- if hasattr(self, 'vpc') and self.vpc is not None:
- if isinstance(self.vpc, dict):
- _dict['vpc'] = self.vpc
- else:
- _dict['vpc'] = self.vpc.to_dict()
- if hasattr(self, '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, 'zone') and self.zone is not None:
- if isinstance(self.zone, dict):
- _dict['zone'] = self.zone
+ if hasattr(self, 'method') and self.method is not None:
+ _dict['method'] = self.method
+ if hasattr(self, 'client_ca') and self.client_ca is not None:
+ if isinstance(self.client_ca, dict):
+ _dict['client_ca'] = self.client_ca
else:
- _dict['zone'] = self.zone.to_dict()
+ _dict['client_ca'] = self.client_ca.to_dict()
+ if hasattr(self, 'crl') and self.crl is not None:
+ _dict['crl'] = self.crl
return _dict
def _to_dict(self):
@@ -118120,67 +134233,83 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this SubnetPrototypeSubnetByTotalCount object."""
+ """Return a `str` version of this VPNServerAuthenticationByCertificate object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'SubnetPrototypeSubnetByTotalCount') -> bool:
+ def __eq__(self, other: 'VPNServerAuthenticationByCertificate') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'SubnetPrototypeSubnetByTotalCount') -> bool:
+ def __ne__(self, other: 'VPNServerAuthenticationByCertificate') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class IpVersionEnum(str, Enum):
+ class MethodEnum(str, Enum):
"""
- The IP version(s) to support for this subnet.
+ The type of authentication.
"""
- IPV4 = 'ipv4'
+ CERTIFICATE = 'certificate'
+ USERNAME = 'username'
-class SubnetPublicGatewayPatchPublicGatewayIdentityByCRN(SubnetPublicGatewayPatch):
+class VPNServerAuthenticationByUsername(VPNServerAuthentication):
"""
- SubnetPublicGatewayPatchPublicGatewayIdentityByCRN.
+ VPNServerAuthenticationByUsername.
- :attr str crn: The CRN for this public gateway.
+ :param str method: The type of authentication.
+ :param VPNServerAuthenticationByUsernameIdProvider identity_provider: The type
+ of identity provider to be used by VPN client.
"""
def __init__(
self,
- crn: str,
+ method: str,
+ identity_provider: 'VPNServerAuthenticationByUsernameIdProvider',
) -> None:
"""
- Initialize a SubnetPublicGatewayPatchPublicGatewayIdentityByCRN object.
+ Initialize a VPNServerAuthenticationByUsername object.
- :param str crn: The CRN for this public gateway.
+ :param str method: The type of authentication.
+ :param VPNServerAuthenticationByUsernameIdProvider identity_provider: The
+ type of identity provider to be used by VPN client.
"""
# pylint: disable=super-init-not-called
- self.crn = crn
+ self.method = method
+ self.identity_provider = identity_provider
@classmethod
- def from_dict(cls, _dict: Dict) -> 'SubnetPublicGatewayPatchPublicGatewayIdentityByCRN':
- """Initialize a SubnetPublicGatewayPatchPublicGatewayIdentityByCRN object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VPNServerAuthenticationByUsername':
+ """Initialize a VPNServerAuthenticationByUsername object from a json dictionary."""
args = {}
- if 'crn' in _dict:
- args['crn'] = _dict.get('crn')
+ if (method := _dict.get('method')) is not None:
+ args['method'] = method
else:
- raise ValueError('Required property \'crn\' not present in SubnetPublicGatewayPatchPublicGatewayIdentityByCRN JSON')
+ raise ValueError('Required property \'method\' not present in VPNServerAuthenticationByUsername JSON')
+ if (identity_provider := _dict.get('identity_provider')) is not None:
+ args['identity_provider'] = identity_provider
+ else:
+ raise ValueError('Required property \'identity_provider\' not present in VPNServerAuthenticationByUsername JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a SubnetPublicGatewayPatchPublicGatewayIdentityByCRN object from a json dictionary."""
+ """Initialize a VPNServerAuthenticationByUsername object from 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, 'method') and self.method is not None:
+ _dict['method'] = self.method
+ if hasattr(self, 'identity_provider') and self.identity_provider is not None:
+ if isinstance(self.identity_provider, dict):
+ _dict['identity_provider'] = self.identity_provider
+ else:
+ _dict['identity_provider'] = self.identity_provider.to_dict()
return _dict
def _to_dict(self):
@@ -118188,59 +134317,80 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this SubnetPublicGatewayPatchPublicGatewayIdentityByCRN object."""
+ """Return a `str` version of this VPNServerAuthenticationByUsername object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'SubnetPublicGatewayPatchPublicGatewayIdentityByCRN') -> bool:
+ def __eq__(self, other: 'VPNServerAuthenticationByUsername') -> bool:
"""Return `true` when 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:
+ def __ne__(self, other: 'VPNServerAuthenticationByUsername') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
+ class MethodEnum(str, Enum):
+ """
+ The type of authentication.
+ """
-class SubnetPublicGatewayPatchPublicGatewayIdentityByHref(SubnetPublicGatewayPatch):
+ CERTIFICATE = 'certificate'
+ USERNAME = 'username'
+
+
+
+class VPNServerAuthenticationByUsernameIdProviderByIAM(VPNServerAuthenticationByUsernameIdProvider):
"""
- SubnetPublicGatewayPatchPublicGatewayIdentityByHref.
+ VPNServerAuthenticationByUsernameIdProviderByIAM.
- :attr str href: The URL for this public gateway.
+ :param str provider_type: The type of identity provider to be used by the VPN
+ client.
+ - `iam`: IBM identity and access management
+ The enumerated values for this property are expected to expand in the future.
+ When processing this property, check for and log unknown values. Optionally halt
+ processing and surface the error, or bypass the route on which the unexpected
+ property value was encountered.
"""
def __init__(
self,
- href: str,
+ provider_type: str,
) -> None:
"""
- Initialize a SubnetPublicGatewayPatchPublicGatewayIdentityByHref object.
+ Initialize a VPNServerAuthenticationByUsernameIdProviderByIAM object.
- :param str href: The URL for this public gateway.
+ :param str provider_type: The type of identity provider to be used by the
+ VPN client.
+ - `iam`: IBM identity and access management
+ The enumerated values for this property are expected to expand in the
+ future. When processing this property, check for and log unknown values.
+ Optionally halt processing and surface the error, or bypass the route on
+ which the unexpected property value was encountered.
"""
# pylint: disable=super-init-not-called
- self.href = href
+ self.provider_type = provider_type
@classmethod
- def from_dict(cls, _dict: Dict) -> 'SubnetPublicGatewayPatchPublicGatewayIdentityByHref':
- """Initialize a SubnetPublicGatewayPatchPublicGatewayIdentityByHref object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VPNServerAuthenticationByUsernameIdProviderByIAM':
+ """Initialize a VPNServerAuthenticationByUsernameIdProviderByIAM object from a json dictionary."""
args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ if (provider_type := _dict.get('provider_type')) is not None:
+ args['provider_type'] = provider_type
else:
- raise ValueError('Required property \'href\' not present in SubnetPublicGatewayPatchPublicGatewayIdentityByHref JSON')
+ raise ValueError('Required property \'provider_type\' not present in VPNServerAuthenticationByUsernameIdProviderByIAM JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a SubnetPublicGatewayPatchPublicGatewayIdentityByHref object from a json dictionary."""
+ """Initialize a VPNServerAuthenticationByUsernameIdProviderByIAM object from 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, 'provider_type') and self.provider_type is not None:
+ _dict['provider_type'] = self.provider_type
return _dict
def _to_dict(self):
@@ -118248,59 +134398,98 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this SubnetPublicGatewayPatchPublicGatewayIdentityByHref object."""
+ """Return a `str` version of this VPNServerAuthenticationByUsernameIdProviderByIAM object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'SubnetPublicGatewayPatchPublicGatewayIdentityByHref') -> bool:
+ def __eq__(self, other: 'VPNServerAuthenticationByUsernameIdProviderByIAM') -> bool:
"""Return `true` when 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:
+ def __ne__(self, other: 'VPNServerAuthenticationByUsernameIdProviderByIAM') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
+ class ProviderTypeEnum(str, Enum):
+ """
+ The type of identity provider to be used by the VPN client.
+ - `iam`: IBM identity and access management
+ The enumerated values for this property are expected to expand in the future. When
+ processing this property, check for and log unknown values. Optionally halt
+ processing and surface the error, or bypass the route on which the unexpected
+ property value was encountered.
+ """
+
+ IAM = 'iam'
-class SubnetPublicGatewayPatchPublicGatewayIdentityById(SubnetPublicGatewayPatch):
+
+
+class VPNServerAuthenticationPrototypeVPNServerAuthenticationByCertificatePrototype(VPNServerAuthenticationPrototype):
"""
- SubnetPublicGatewayPatchPublicGatewayIdentityById.
+ VPNServerAuthenticationPrototypeVPNServerAuthenticationByCertificatePrototype.
- :attr str id: The unique identifier for this public gateway.
+ :param str method: The type of authentication.
+ :param CertificateInstanceIdentity client_ca: The certificate instance to use
+ for the VPN client certificate authority (CA).
+ :param str crl: (optional) The certificate revocation list contents, encoded in
+ PEM format.
"""
def __init__(
self,
- id: str,
+ method: str,
+ client_ca: 'CertificateInstanceIdentity',
+ *,
+ crl: Optional[str] = None,
) -> None:
"""
- Initialize a SubnetPublicGatewayPatchPublicGatewayIdentityById object.
+ Initialize a VPNServerAuthenticationPrototypeVPNServerAuthenticationByCertificatePrototype object.
- :param str id: The unique identifier for this public gateway.
+ :param str method: The type of authentication.
+ :param CertificateInstanceIdentity client_ca: The certificate instance to
+ use for the VPN client certificate authority (CA).
+ :param str crl: (optional) The certificate revocation list contents,
+ encoded in PEM format.
"""
# pylint: disable=super-init-not-called
- self.id = id
+ self.method = method
+ self.client_ca = client_ca
+ self.crl = crl
@classmethod
- def from_dict(cls, _dict: Dict) -> 'SubnetPublicGatewayPatchPublicGatewayIdentityById':
- """Initialize a SubnetPublicGatewayPatchPublicGatewayIdentityById object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VPNServerAuthenticationPrototypeVPNServerAuthenticationByCertificatePrototype':
+ """Initialize a VPNServerAuthenticationPrototypeVPNServerAuthenticationByCertificatePrototype object from a json dictionary."""
args = {}
- if 'id' in _dict:
- args['id'] = _dict.get('id')
+ if (method := _dict.get('method')) is not None:
+ args['method'] = method
else:
- raise ValueError('Required property \'id\' not present in SubnetPublicGatewayPatchPublicGatewayIdentityById JSON')
+ raise ValueError('Required property \'method\' not present in VPNServerAuthenticationPrototypeVPNServerAuthenticationByCertificatePrototype JSON')
+ if (client_ca := _dict.get('client_ca')) is not None:
+ args['client_ca'] = client_ca
+ else:
+ raise ValueError('Required property \'client_ca\' not present in VPNServerAuthenticationPrototypeVPNServerAuthenticationByCertificatePrototype JSON')
+ if (crl := _dict.get('crl')) is not None:
+ args['crl'] = crl
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a SubnetPublicGatewayPatchPublicGatewayIdentityById object from a json dictionary."""
+ """Initialize a VPNServerAuthenticationPrototypeVPNServerAuthenticationByCertificatePrototype object from 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, 'method') and self.method is not None:
+ _dict['method'] = self.method
+ if hasattr(self, 'client_ca') and self.client_ca is not None:
+ if isinstance(self.client_ca, dict):
+ _dict['client_ca'] = self.client_ca
+ else:
+ _dict['client_ca'] = self.client_ca.to_dict()
+ if hasattr(self, 'crl') and self.crl is not None:
+ _dict['crl'] = self.crl
return _dict
def _to_dict(self):
@@ -118308,59 +134497,83 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this SubnetPublicGatewayPatchPublicGatewayIdentityById object."""
+ """Return a `str` version of this VPNServerAuthenticationPrototypeVPNServerAuthenticationByCertificatePrototype object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'SubnetPublicGatewayPatchPublicGatewayIdentityById') -> bool:
+ def __eq__(self, other: 'VPNServerAuthenticationPrototypeVPNServerAuthenticationByCertificatePrototype') -> bool:
"""Return `true` when 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:
+ def __ne__(self, other: 'VPNServerAuthenticationPrototypeVPNServerAuthenticationByCertificatePrototype') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
+ class MethodEnum(str, Enum):
+ """
+ The type of authentication.
+ """
-class TrustedProfileIdentityTrustedProfileByCRN(TrustedProfileIdentity):
+ CERTIFICATE = 'certificate'
+ USERNAME = 'username'
+
+
+
+class VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype(VPNServerAuthenticationPrototype):
"""
- TrustedProfileIdentityTrustedProfileByCRN.
+ VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype.
- :attr str crn: The CRN for this trusted profile.
+ :param str method: The type of authentication.
+ :param VPNServerAuthenticationByUsernameIdProvider identity_provider: The type
+ of identity provider to be used by VPN client.
"""
def __init__(
self,
- crn: str,
+ method: str,
+ identity_provider: 'VPNServerAuthenticationByUsernameIdProvider',
) -> None:
"""
- Initialize a TrustedProfileIdentityTrustedProfileByCRN object.
+ Initialize a VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype object.
- :param str crn: The CRN for this trusted profile.
+ :param str method: The type of authentication.
+ :param VPNServerAuthenticationByUsernameIdProvider identity_provider: The
+ type of identity provider to be used by VPN client.
"""
# pylint: disable=super-init-not-called
- self.crn = crn
+ self.method = method
+ self.identity_provider = identity_provider
@classmethod
- def from_dict(cls, _dict: Dict) -> 'TrustedProfileIdentityTrustedProfileByCRN':
- """Initialize a TrustedProfileIdentityTrustedProfileByCRN object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype':
+ """Initialize a VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype object from a json dictionary."""
args = {}
- if 'crn' in _dict:
- args['crn'] = _dict.get('crn')
+ if (method := _dict.get('method')) is not None:
+ args['method'] = method
else:
- raise ValueError('Required property \'crn\' not present in TrustedProfileIdentityTrustedProfileByCRN JSON')
+ raise ValueError('Required property \'method\' not present in VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype JSON')
+ if (identity_provider := _dict.get('identity_provider')) is not None:
+ args['identity_provider'] = identity_provider
+ else:
+ raise ValueError('Required property \'identity_provider\' not present in VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a TrustedProfileIdentityTrustedProfileByCRN object from a json dictionary."""
+ """Initialize a VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype object from 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, 'method') and self.method is not None:
+ _dict['method'] = self.method
+ if hasattr(self, 'identity_provider') and self.identity_provider is not None:
+ if isinstance(self.identity_provider, dict):
+ _dict['identity_provider'] = self.identity_provider
+ else:
+ _dict['identity_provider'] = self.identity_provider.to_dict()
return _dict
def _to_dict(self):
@@ -118368,59 +134581,120 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this TrustedProfileIdentityTrustedProfileByCRN object."""
+ """Return a `str` version of this VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'TrustedProfileIdentityTrustedProfileByCRN') -> bool:
+ def __eq__(self, other: 'VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'TrustedProfileIdentityTrustedProfileByCRN') -> bool:
+ def __ne__(self, other: 'VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
+ class MethodEnum(str, Enum):
+ """
+ The type of authentication.
+ """
-class TrustedProfileIdentityTrustedProfileById(TrustedProfileIdentity):
+ CERTIFICATE = 'certificate'
+ USERNAME = 'username'
+
+
+
+class VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContext(VirtualNetworkInterfaceIPPrototype):
"""
- TrustedProfileIdentityTrustedProfileById.
+ Identifies a reserved IP by a unique property. The reserved IP must be currently
+ unbound and in the primary IP's subnet.
- :attr str id: The unique identifier for this trusted profile.
"""
def __init__(
self,
- id: str,
) -> None:
"""
- Initialize a TrustedProfileIdentityTrustedProfileById object.
+ Initialize a VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContext object.
- :param str id: The unique identifier for this trusted profile.
"""
# pylint: disable=super-init-not-called
- self.id = id
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextById', 'VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextByHref'])
+ )
+ raise Exception(msg)
+
+
+class VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext(VirtualNetworkInterfaceIPPrototype):
+ """
+ The prototype for a new reserved IP. Must be in the primary IP's subnet.
+
+ :param str address: (optional) The IP address to reserve, which must not already
+ be reserved on the subnet.
+ If unspecified, an available address on the subnet will automatically be
+ selected.
+ :param bool auto_delete: (optional) Indicates whether this reserved IP member
+ will be automatically deleted when either
+ `target` is deleted, or the reserved IP is unbound.
+ :param str name: (optional) The name for this reserved IP. The name must not be
+ used by another reserved IP in the subnet. Names starting with `ibm-` are
+ reserved for provider-owned resources, and are not allowed. If unspecified, the
+ name will be a hyphenated list of randomly-selected words.
+ """
+
+ def __init__(
+ self,
+ *,
+ address: Optional[str] = None,
+ auto_delete: Optional[bool] = None,
+ name: Optional[str] = None,
+ ) -> None:
+ """
+ Initialize a VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext object.
+
+ :param str address: (optional) The IP address to reserve, which must not
+ already be reserved on the subnet.
+ If unspecified, an available address on the subnet will automatically be
+ selected.
+ :param bool auto_delete: (optional) Indicates whether this reserved IP
+ member will be automatically deleted when either
+ `target` is deleted, or the reserved IP is unbound.
+ :param str name: (optional) The name for this reserved IP. The name must
+ not be used by another reserved IP in the subnet. Names starting with
+ `ibm-` are reserved for provider-owned resources, and are not allowed. If
+ unspecified, the name will be a hyphenated list of randomly-selected words.
+ """
+ # pylint: disable=super-init-not-called
+ self.address = address
+ self.auto_delete = auto_delete
+ self.name = name
@classmethod
- def from_dict(cls, _dict: Dict) -> 'TrustedProfileIdentityTrustedProfileById':
- """Initialize a TrustedProfileIdentityTrustedProfileById object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext':
+ """Initialize a VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext object from a json dictionary."""
args = {}
- if 'id' in _dict:
- args['id'] = _dict.get('id')
- else:
- raise ValueError('Required property \'id\' not present in TrustedProfileIdentityTrustedProfileById JSON')
+ if (address := _dict.get('address')) is not None:
+ args['address'] = address
+ if (auto_delete := _dict.get('auto_delete')) is not None:
+ args['auto_delete'] = auto_delete
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a TrustedProfileIdentityTrustedProfileById object from a json dictionary."""
+ """Initialize a VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'id') and self.id is not None:
- _dict['id'] = self.id
+ if hasattr(self, 'address') and self.address is not None:
+ _dict['address'] = self.address
+ if hasattr(self, 'auto_delete') and self.auto_delete is not None:
+ _dict['auto_delete'] = self.auto_delete
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
return _dict
def _to_dict(self):
@@ -118428,81 +134702,111 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this TrustedProfileIdentityTrustedProfileById object."""
+ """Return a `str` version of this VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'TrustedProfileIdentityTrustedProfileById') -> bool:
+ def __eq__(self, other: 'VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'TrustedProfileIdentityTrustedProfileById') -> bool:
+ def __ne__(self, other: 'VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class VPCDNSResolverPrototypeVPCDNSResolverTypeManualPrototype(VPCDNSResolverPrototype):
+class VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContext(VirtualNetworkInterfacePrimaryIPPrototype):
"""
- Manually specify the DNS server addresses for this VPC.
+ Identifies a reserved IP by a unique property. Required if `subnet` is not specified.
+ The reserved IP must be currently unbound.
- :attr List[DNSServerPrototype] manual_servers: The DNS servers to use for this
- VPC. All the DNS servers must either:
- - have a unique `zone_affinity`, or
- - not have a `zone_affinity`.
- :attr str type: The type of the DNS resolver to use.
"""
def __init__(
self,
- manual_servers: List['DNSServerPrototype'],
- type: str,
) -> None:
"""
- Initialize a VPCDNSResolverPrototypeVPCDNSResolverTypeManualPrototype object.
+ Initialize a VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContext object.
- :param List[DNSServerPrototype] manual_servers: The DNS servers to use for
- this VPC. All the DNS servers must either:
- - have a unique `zone_affinity`, or
- - not have a `zone_affinity`.
- :param str type: The type of the DNS resolver to use.
"""
# pylint: disable=super-init-not-called
- self.manual_servers = manual_servers
- self.type = type
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContextById', 'VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContextByHref'])
+ )
+ raise Exception(msg)
+
+
+class VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext(VirtualNetworkInterfacePrimaryIPPrototype):
+ """
+ The prototype for a new reserved IP. Requires `subnet` to be specified.
+
+ :param str address: (optional) The IP address to reserve, which must not already
+ be reserved on the subnet.
+ If unspecified, an available address on the subnet will automatically be
+ selected.
+ :param bool auto_delete: (optional) Indicates whether this reserved IP member
+ will be automatically deleted when either
+ `target` is deleted, or the reserved IP is unbound.
+ :param str name: (optional) The name for this reserved IP. The name must not be
+ used by another reserved IP in the subnet. Names starting with `ibm-` are
+ reserved for provider-owned resources, and are not allowed. If unspecified, the
+ name will be a hyphenated list of randomly-selected words.
+ """
+
+ def __init__(
+ self,
+ *,
+ address: Optional[str] = None,
+ auto_delete: Optional[bool] = None,
+ name: Optional[str] = None,
+ ) -> None:
+ """
+ Initialize a VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext object.
+
+ :param str address: (optional) The IP address to reserve, which must not
+ already be reserved on the subnet.
+ If unspecified, an available address on the subnet will automatically be
+ selected.
+ :param bool auto_delete: (optional) Indicates whether this reserved IP
+ member will be automatically deleted when either
+ `target` is deleted, or the reserved IP is unbound.
+ :param str name: (optional) The name for this reserved IP. The name must
+ not be used by another reserved IP in the subnet. Names starting with
+ `ibm-` are reserved for provider-owned resources, and are not allowed. If
+ unspecified, the name will be a hyphenated list of randomly-selected words.
+ """
+ # pylint: disable=super-init-not-called
+ self.address = address
+ self.auto_delete = auto_delete
+ self.name = name
@classmethod
- def from_dict(cls, _dict: Dict) -> 'VPCDNSResolverPrototypeVPCDNSResolverTypeManualPrototype':
- """Initialize a VPCDNSResolverPrototypeVPCDNSResolverTypeManualPrototype object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext':
+ """Initialize a VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext object from a json dictionary."""
args = {}
- if 'manual_servers' in _dict:
- args['manual_servers'] = [DNSServerPrototype.from_dict(v) for v in _dict.get('manual_servers')]
- else:
- raise ValueError('Required property \'manual_servers\' not present in VPCDNSResolverPrototypeVPCDNSResolverTypeManualPrototype JSON')
- if 'type' in _dict:
- args['type'] = _dict.get('type')
- else:
- raise ValueError('Required property \'type\' not present in VPCDNSResolverPrototypeVPCDNSResolverTypeManualPrototype JSON')
+ if (address := _dict.get('address')) is not None:
+ args['address'] = address
+ if (auto_delete := _dict.get('auto_delete')) is not None:
+ args['auto_delete'] = auto_delete
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VPCDNSResolverPrototypeVPCDNSResolverTypeManualPrototype object from a json dictionary."""
+ """Initialize a VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'manual_servers') and self.manual_servers is not None:
- manual_servers_list = []
- for v in self.manual_servers:
- if isinstance(v, dict):
- manual_servers_list.append(v)
- else:
- manual_servers_list.append(v.to_dict())
- _dict['manual_servers'] = manual_servers_list
- if hasattr(self, 'type') and self.type is not None:
- _dict['type'] = self.type
+ if hasattr(self, 'address') and self.address is not None:
+ _dict['address'] = self.address
+ if hasattr(self, 'auto_delete') and self.auto_delete is not None:
+ _dict['auto_delete'] = self.auto_delete
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
return _dict
def _to_dict(self):
@@ -118510,70 +134814,94 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this VPCDNSResolverPrototypeVPCDNSResolverTypeManualPrototype object."""
+ """Return a `str` version of this VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VPCDNSResolverPrototypeVPCDNSResolverTypeManualPrototype') -> bool:
+ def __eq__(self, other: 'VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'VPCDNSResolverPrototypeVPCDNSResolverTypeManualPrototype') -> bool:
+ def __ne__(self, other: 'VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class TypeEnum(str, Enum):
- """
- The type of the DNS resolver to use.
- """
-
- MANUAL = 'manual'
-
-
-class VPCDNSResolverPrototypeVPCDNSResolverTypeSystemPrototype(VPCDNSResolverPrototype):
+class VirtualNetworkInterfaceTargetBareMetalServerNetworkAttachmentReferenceVirtualNetworkInterfaceContext(VirtualNetworkInterfaceTarget):
"""
- The system will provide DNS server addresses for this VPC. The system-provided DNS
- server addresses depend on whether any endpoint gateways reside in the VPC, and
- whether a
- [DNS Services](https://cloud.ibm.com/docs/dns-svcs) instance is configured for the
- VPC.
+ VirtualNetworkInterfaceTargetBareMetalServerNetworkAttachmentReferenceVirtualNetworkInterfaceContext.
- :attr str type: (optional) The type of the DNS resolver to use.
+ :param str href: The URL for this bare metal server network attachment.
+ :param str id: The unique identifier for this bare metal server network
+ attachment.
+ :param str name: The name for this bare metal server network attachment. The
+ name is unique across all network attachments for the bare metal server.
+ :param str resource_type: The resource type.
"""
def __init__(
self,
- *,
- type: str = None,
+ href: str,
+ id: str,
+ name: str,
+ resource_type: str,
) -> None:
"""
- Initialize a VPCDNSResolverPrototypeVPCDNSResolverTypeSystemPrototype object.
+ Initialize a VirtualNetworkInterfaceTargetBareMetalServerNetworkAttachmentReferenceVirtualNetworkInterfaceContext object.
- :param str type: (optional) The type of the DNS resolver to use.
+ :param str href: The URL for this bare metal server network attachment.
+ :param str id: The unique identifier for this bare metal server network
+ attachment.
+ :param str name: The name for this bare metal server network attachment.
+ The name is unique across all network attachments for the bare metal
+ server.
+ :param str resource_type: The resource type.
"""
# pylint: disable=super-init-not-called
- self.type = type
+ self.href = href
+ self.id = id
+ self.name = name
+ self.resource_type = resource_type
@classmethod
- def from_dict(cls, _dict: Dict) -> 'VPCDNSResolverPrototypeVPCDNSResolverTypeSystemPrototype':
- """Initialize a VPCDNSResolverPrototypeVPCDNSResolverTypeSystemPrototype object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VirtualNetworkInterfaceTargetBareMetalServerNetworkAttachmentReferenceVirtualNetworkInterfaceContext':
+ """Initialize a VirtualNetworkInterfaceTargetBareMetalServerNetworkAttachmentReferenceVirtualNetworkInterfaceContext object from a json dictionary."""
args = {}
- if 'type' in _dict:
- args['type'] = _dict.get('type')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
+ else:
+ raise ValueError('Required property \'href\' not present in VirtualNetworkInterfaceTargetBareMetalServerNetworkAttachmentReferenceVirtualNetworkInterfaceContext JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
+ else:
+ raise ValueError('Required property \'id\' not present in VirtualNetworkInterfaceTargetBareMetalServerNetworkAttachmentReferenceVirtualNetworkInterfaceContext JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ else:
+ raise ValueError('Required property \'name\' not present in VirtualNetworkInterfaceTargetBareMetalServerNetworkAttachmentReferenceVirtualNetworkInterfaceContext JSON')
+ if (resource_type := _dict.get('resource_type')) is not None:
+ args['resource_type'] = resource_type
+ else:
+ raise ValueError('Required property \'resource_type\' not present in VirtualNetworkInterfaceTargetBareMetalServerNetworkAttachmentReferenceVirtualNetworkInterfaceContext JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VPCDNSResolverPrototypeVPCDNSResolverTypeSystemPrototype object from a json dictionary."""
+ """Initialize a VirtualNetworkInterfaceTargetBareMetalServerNetworkAttachmentReferenceVirtualNetworkInterfaceContext object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'type') and self.type is not None:
- _dict['type'] = self.type
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
+ 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):
@@ -118581,111 +134909,99 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this VPCDNSResolverPrototypeVPCDNSResolverTypeSystemPrototype object."""
+ """Return a `str` version of this VirtualNetworkInterfaceTargetBareMetalServerNetworkAttachmentReferenceVirtualNetworkInterfaceContext object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VPCDNSResolverPrototypeVPCDNSResolverTypeSystemPrototype') -> bool:
+ def __eq__(self, other: 'VirtualNetworkInterfaceTargetBareMetalServerNetworkAttachmentReferenceVirtualNetworkInterfaceContext') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'VPCDNSResolverPrototypeVPCDNSResolverTypeSystemPrototype') -> bool:
+ def __ne__(self, other: 'VirtualNetworkInterfaceTargetBareMetalServerNetworkAttachmentReferenceVirtualNetworkInterfaceContext') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class TypeEnum(str, Enum):
+ class ResourceTypeEnum(str, Enum):
"""
- The type of the DNS resolver to use.
+ The resource type.
"""
- SYSTEM = 'system'
+ BARE_METAL_SERVER_NETWORK_ATTACHMENT = 'bare_metal_server_network_attachment'
-class VPCDNSResolverTypeDelegated(VPCDNSResolver):
+class VirtualNetworkInterfaceTargetInstanceNetworkAttachmentReferenceVirtualNetworkInterfaceContext(VirtualNetworkInterfaceTarget):
"""
- The DNS server addresses are delegated to the DNS resolver of another VPC.
+ VirtualNetworkInterfaceTargetInstanceNetworkAttachmentReferenceVirtualNetworkInterfaceContext.
- :attr List[DNSServer] servers: The DNS servers for this VPC. The servers are
- populated:
- - by the system when `dns.resolver.type` is `system`
- - using the DNS servers in `dns.resolver.vpc` when `dns.resolver.type` is
- `delegated`
- - using `dns.resolver.manual_servers` when the `dns.resolver.type` is `manual`.
- :attr str type: The type of the DNS resolver used for the VPC.
- :attr VPCReferenceDNSResolverContext vpc: The VPC whose DNS resolver provides
- the DNS server addresses for this VPC.
- The VPC may be remote and therefore may not be directly retrievable.
+ :param str href: The URL for this instance network attachment.
+ :param str id: The unique identifier for this instance network attachment.
+ :param str name: The name for this instance network attachment. The name is
+ unique across all network attachments for the instance.
+ :param str resource_type: The resource type.
"""
def __init__(
self,
- servers: List['DNSServer'],
- type: str,
- vpc: 'VPCReferenceDNSResolverContext',
+ href: str,
+ id: str,
+ name: str,
+ resource_type: str,
) -> None:
"""
- Initialize a VPCDNSResolverTypeDelegated object.
+ Initialize a VirtualNetworkInterfaceTargetInstanceNetworkAttachmentReferenceVirtualNetworkInterfaceContext object.
- :param List[DNSServer] servers: The DNS servers for this VPC. The servers
- are populated:
- - by the system when `dns.resolver.type` is `system`
- - using the DNS servers in `dns.resolver.vpc` when `dns.resolver.type` is
- `delegated`
- - using `dns.resolver.manual_servers` when the `dns.resolver.type` is
- `manual`.
- :param str type: The type of the DNS resolver used for the VPC.
- :param VPCReferenceDNSResolverContext vpc: The VPC whose DNS resolver
- provides the DNS server addresses for this VPC.
- The VPC may be remote and therefore may not be directly retrievable.
+ :param str href: The URL for this instance network attachment.
+ :param str id: The unique identifier for this instance network attachment.
+ :param str name: The name for this instance network attachment. The name is
+ unique across all network attachments for the instance.
+ :param str resource_type: The resource type.
"""
# pylint: disable=super-init-not-called
- self.servers = servers
- self.type = type
- self.vpc = vpc
+ self.href = href
+ self.id = id
+ self.name = name
+ self.resource_type = resource_type
@classmethod
- def from_dict(cls, _dict: Dict) -> 'VPCDNSResolverTypeDelegated':
- """Initialize a VPCDNSResolverTypeDelegated object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VirtualNetworkInterfaceTargetInstanceNetworkAttachmentReferenceVirtualNetworkInterfaceContext':
+ """Initialize a VirtualNetworkInterfaceTargetInstanceNetworkAttachmentReferenceVirtualNetworkInterfaceContext object from a json dictionary."""
args = {}
- if 'servers' in _dict:
- args['servers'] = [DNSServer.from_dict(v) for v in _dict.get('servers')]
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'servers\' not present in VPCDNSResolverTypeDelegated JSON')
- if 'type' in _dict:
- args['type'] = _dict.get('type')
+ raise ValueError('Required property \'href\' not present in VirtualNetworkInterfaceTargetInstanceNetworkAttachmentReferenceVirtualNetworkInterfaceContext JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
else:
- raise ValueError('Required property \'type\' not present in VPCDNSResolverTypeDelegated JSON')
- if 'vpc' in _dict:
- args['vpc'] = VPCReferenceDNSResolverContext.from_dict(_dict.get('vpc'))
+ raise ValueError('Required property \'id\' not present in VirtualNetworkInterfaceTargetInstanceNetworkAttachmentReferenceVirtualNetworkInterfaceContext JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
else:
- raise ValueError('Required property \'vpc\' not present in VPCDNSResolverTypeDelegated JSON')
+ raise ValueError('Required property \'name\' not present in VirtualNetworkInterfaceTargetInstanceNetworkAttachmentReferenceVirtualNetworkInterfaceContext JSON')
+ if (resource_type := _dict.get('resource_type')) is not None:
+ args['resource_type'] = resource_type
+ else:
+ raise ValueError('Required property \'resource_type\' not present in VirtualNetworkInterfaceTargetInstanceNetworkAttachmentReferenceVirtualNetworkInterfaceContext JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VPCDNSResolverTypeDelegated object from a json dictionary."""
+ """Initialize a VirtualNetworkInterfaceTargetInstanceNetworkAttachmentReferenceVirtualNetworkInterfaceContext object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'servers') and self.servers is not None:
- servers_list = []
- for v in self.servers:
- if isinstance(v, dict):
- servers_list.append(v)
- else:
- servers_list.append(v.to_dict())
- _dict['servers'] = servers_list
- if hasattr(self, 'type') and self.type is not None:
- _dict['type'] = self.type
- if hasattr(self, 'vpc') and self.vpc is not None:
- if isinstance(self.vpc, dict):
- _dict['vpc'] = self.vpc
- else:
- _dict['vpc'] = self.vpc.to_dict()
+ if hasattr(self, 'href') and self.href 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):
@@ -118693,112 +135009,116 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this VPCDNSResolverTypeDelegated object."""
+ """Return a `str` version of this VirtualNetworkInterfaceTargetInstanceNetworkAttachmentReferenceVirtualNetworkInterfaceContext object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VPCDNSResolverTypeDelegated') -> bool:
+ def __eq__(self, other: 'VirtualNetworkInterfaceTargetInstanceNetworkAttachmentReferenceVirtualNetworkInterfaceContext') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'VPCDNSResolverTypeDelegated') -> bool:
+ def __ne__(self, other: 'VirtualNetworkInterfaceTargetInstanceNetworkAttachmentReferenceVirtualNetworkInterfaceContext') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class TypeEnum(str, Enum):
+ class ResourceTypeEnum(str, Enum):
"""
- The type of the DNS resolver used for the VPC.
+ The resource type.
"""
- DELEGATED = 'delegated'
+ INSTANCE_NETWORK_ATTACHMENT = 'instance_network_attachment'
-class VPCDNSResolverTypeManual(VPCDNSResolver):
+class VirtualNetworkInterfaceTargetShareMountTargetReference(VirtualNetworkInterfaceTarget):
"""
- The DNS server addresses are manually specified.
+ VirtualNetworkInterfaceTargetShareMountTargetReference.
- :attr List[DNSServer] servers: The DNS servers for this VPC. The servers are
- populated:
- - by the system when `dns.resolver.type` is `system`
- - using the DNS servers in `dns.resolver.vpc` when `dns.resolver.type` is
- `delegated`
- - using `dns.resolver.manual_servers` when the `dns.resolver.type` is `manual`.
- :attr List[DNSServer] manual_servers: The manually specified DNS servers for
- this VPC.
- :attr str type: The type of the DNS resolver used for the VPC.
+ :param ShareMountTargetReferenceDeleted deleted: (optional) If present, this
+ property indicates the referenced resource has been deleted, and provides
+ some supplementary information.
+ :param str href: The URL for this share mount target.
+ :param str id: The unique identifier for this share mount target.
+ :param str name: The name for this share mount target. The name is unique across
+ all mount targets for the file share.
+ :param str resource_type: The resource type.
"""
def __init__(
self,
- servers: List['DNSServer'],
- manual_servers: List['DNSServer'],
- type: str,
+ href: str,
+ id: str,
+ name: str,
+ resource_type: str,
+ *,
+ deleted: Optional['ShareMountTargetReferenceDeleted'] = None,
) -> None:
"""
- Initialize a VPCDNSResolverTypeManual object.
+ Initialize a VirtualNetworkInterfaceTargetShareMountTargetReference object.
- :param List[DNSServer] servers: The DNS servers for this VPC. The servers
- are populated:
- - by the system when `dns.resolver.type` is `system`
- - using the DNS servers in `dns.resolver.vpc` when `dns.resolver.type` is
- `delegated`
- - using `dns.resolver.manual_servers` when the `dns.resolver.type` is
- `manual`.
- :param List[DNSServer] manual_servers: The manually specified DNS servers
- for this VPC.
- :param str type: The type of the DNS resolver used for the VPC.
+ :param str href: The URL for this share mount target.
+ :param str id: The unique identifier for this share mount target.
+ :param str name: The name for this share mount target. The name is unique
+ across all mount targets for the file share.
+ :param str resource_type: The resource type.
+ :param ShareMountTargetReferenceDeleted deleted: (optional) If present,
+ this property indicates the referenced resource has been deleted, and
+ provides
+ some supplementary information.
"""
# pylint: disable=super-init-not-called
- self.servers = servers
- self.manual_servers = manual_servers
- self.type = type
+ self.deleted = deleted
+ self.href = href
+ self.id = id
+ self.name = name
+ self.resource_type = resource_type
@classmethod
- def from_dict(cls, _dict: Dict) -> 'VPCDNSResolverTypeManual':
- """Initialize a VPCDNSResolverTypeManual object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VirtualNetworkInterfaceTargetShareMountTargetReference':
+ """Initialize a VirtualNetworkInterfaceTargetShareMountTargetReference object from a json dictionary."""
args = {}
- if 'servers' in _dict:
- args['servers'] = [DNSServer.from_dict(v) for v in _dict.get('servers')]
- else:
- raise ValueError('Required property \'servers\' not present in VPCDNSResolverTypeManual JSON')
- if 'manual_servers' in _dict:
- args['manual_servers'] = [DNSServer.from_dict(v) for v in _dict.get('manual_servers')]
+ if (deleted := _dict.get('deleted')) is not None:
+ args['deleted'] = ShareMountTargetReferenceDeleted.from_dict(deleted)
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'manual_servers\' not present in VPCDNSResolverTypeManual JSON')
- if 'type' in _dict:
- args['type'] = _dict.get('type')
+ raise ValueError('Required property \'href\' not present in VirtualNetworkInterfaceTargetShareMountTargetReference JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
else:
- raise ValueError('Required property \'type\' not present in VPCDNSResolverTypeManual JSON')
- return cls(**args)
-
- @classmethod
- def _from_dict(cls, _dict):
- """Initialize a VPCDNSResolverTypeManual object from a json dictionary."""
- return cls.from_dict(_dict)
-
- def to_dict(self) -> Dict:
- """Return a json dictionary representing this model."""
- _dict = {}
- if hasattr(self, 'servers') and self.servers is not None:
- servers_list = []
- for v in self.servers:
- if isinstance(v, dict):
- servers_list.append(v)
- else:
- servers_list.append(v.to_dict())
- _dict['servers'] = servers_list
- if hasattr(self, 'manual_servers') and self.manual_servers is not None:
- manual_servers_list = []
- for v in self.manual_servers:
- if isinstance(v, dict):
- manual_servers_list.append(v)
- else:
- manual_servers_list.append(v.to_dict())
- _dict['manual_servers'] = manual_servers_list
- if hasattr(self, 'type') and self.type is not None:
- _dict['type'] = self.type
+ raise ValueError('Required property \'id\' not present in VirtualNetworkInterfaceTargetShareMountTargetReference JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ else:
+ raise ValueError('Required property \'name\' not present in VirtualNetworkInterfaceTargetShareMountTargetReference JSON')
+ if (resource_type := _dict.get('resource_type')) is not None:
+ args['resource_type'] = resource_type
+ else:
+ raise ValueError('Required property \'resource_type\' not present in VirtualNetworkInterfaceTargetShareMountTargetReference JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a VirtualNetworkInterfaceTargetShareMountTargetReference object from a json dictionary."""
+ return cls.from_dict(_dict)
+
+ def to_dict(self) -> Dict:
+ """Return a json dictionary representing this model."""
+ _dict = {}
+ if hasattr(self, 'deleted') and self.deleted is not None:
+ if isinstance(self.deleted, dict):
+ _dict['deleted'] = self.deleted
+ else:
+ _dict['deleted'] = self.deleted.to_dict()
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
+ if hasattr(self, 'id') and self.id is not None:
+ _dict['id'] = self.id
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ if hasattr(self, 'resource_type') and self.resource_type is not None:
+ _dict['resource_type'] = self.resource_type
return _dict
def _to_dict(self):
@@ -118806,133 +135126,144 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this VPCDNSResolverTypeManual object."""
+ """Return a `str` version of this VirtualNetworkInterfaceTargetShareMountTargetReference object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VPCDNSResolverTypeManual') -> bool:
+ def __eq__(self, other: 'VirtualNetworkInterfaceTargetShareMountTargetReference') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'VPCDNSResolverTypeManual') -> bool:
+ def __ne__(self, other: 'VirtualNetworkInterfaceTargetShareMountTargetReference') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class TypeEnum(str, Enum):
+ class ResourceTypeEnum(str, Enum):
"""
- The type of the DNS resolver used for the VPC.
+ The resource type.
"""
- MANUAL = 'manual'
+ SHARE_MOUNT_TARGET = 'share_mount_target'
-class VPCDNSResolverTypeSystem(VPCDNSResolver):
+class VolumeAttachmentPrototypeVolumeVolumeIdentity(VolumeAttachmentPrototypeVolume):
"""
- The DNS server addresses are provided by the system and depend on the configuration.
+ Identifies a volume by a unique property.
- :attr List[DNSServer] servers: The DNS servers for this VPC. The servers are
- populated:
- - by the system when `dns.resolver.type` is `system`
- - using the DNS servers in `dns.resolver.vpc` when `dns.resolver.type` is
- `delegated`
- - using `dns.resolver.manual_servers` when the `dns.resolver.type` is `manual`.
- :attr str configuration: The configuration of the system DNS resolver for this
- VPC.
- - `custom_resolver`: A custom DNS resolver is configured for this VPC.
- - `private_resolver`: A private DNS resolver is configured for this VPC.
- Applicable when
- the VPC has either or both of the following:
- - at least one endpoint gateway residing in it
- - a [DNS Services](https://cloud.ibm.com/docs/dns-svcs) private zone
- configured for it
- - `default`: The provider default DNS resolvers are configured for this VPC.
- This system DNS resolver configuration is used when the VPC has:
- - no custom DNS resolver configured for it, and
- - no endpoint gateways residing in it, and
- - no [DNS Services](https://cloud.ibm.com/docs/dns-svcs) private zone
- configured for it.
- :attr str type: The type of the DNS resolver used for the VPC.
"""
def __init__(
self,
- servers: List['DNSServer'],
- configuration: str,
- type: str,
) -> None:
"""
- Initialize a VPCDNSResolverTypeSystem object.
+ Initialize a VolumeAttachmentPrototypeVolumeVolumeIdentity object.
- :param List[DNSServer] servers: The DNS servers for this VPC. The servers
- are populated:
- - by the system when `dns.resolver.type` is `system`
- - using the DNS servers in `dns.resolver.vpc` when `dns.resolver.type` is
- `delegated`
- - using `dns.resolver.manual_servers` when the `dns.resolver.type` is
- `manual`.
- :param str configuration: The configuration of the system DNS resolver for
- this VPC.
- - `custom_resolver`: A custom DNS resolver is configured for this VPC.
- - `private_resolver`: A private DNS resolver is configured for this VPC.
- Applicable when
- the VPC has either or both of the following:
- - at least one endpoint gateway residing in it
- - a [DNS Services](https://cloud.ibm.com/docs/dns-svcs) private zone
- configured for it
- - `default`: The provider default DNS resolvers are configured for this
- VPC.
- This system DNS resolver configuration is used when the VPC has:
- - no custom DNS resolver configured for it, and
- - no endpoint gateways residing in it, and
- - no [DNS Services](https://cloud.ibm.com/docs/dns-svcs) private zone
- configured for it.
- :param str type: The type of the DNS resolver used for the VPC.
"""
# pylint: disable=super-init-not-called
- self.servers = servers
- self.configuration = configuration
- self.type = type
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById', 'VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityByCRN', 'VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityByHref'])
+ )
+ raise Exception(msg)
+
+
+class VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContext(VolumeAttachmentPrototypeVolume):
+ """
+ VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContext.
+
+ :param int iops: (optional) The maximum I/O operations per second (IOPS) to use
+ for this volume. Applicable only to volumes using a profile `family` of
+ `custom`.
+ :param str name: (optional) The name for this volume. The name must not be used
+ by another volume in the region. If unspecified, the name will be a hyphenated
+ list of randomly-selected words.
+ :param VolumeProfileIdentity profile: The
+ [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-block-storage-profiles) to
+ use for this volume.
+ :param ResourceGroupIdentity resource_group: (optional) The resource group to
+ use for this volume. If unspecified, the instance's resource
+ group will be used.
+ :param List[str] user_tags: (optional) The [user
+ tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with this
+ volume.
+ """
+
+ def __init__(
+ self,
+ profile: 'VolumeProfileIdentity',
+ *,
+ iops: Optional[int] = None,
+ name: Optional[str] = None,
+ resource_group: Optional['ResourceGroupIdentity'] = None,
+ user_tags: Optional[List[str]] = None,
+ ) -> None:
+ """
+ Initialize a VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContext object.
+
+ :param VolumeProfileIdentity profile: The
+ [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-block-storage-profiles)
+ to
+ use for this volume.
+ :param int iops: (optional) The maximum I/O operations per second (IOPS) to
+ use for this volume. Applicable only to volumes using a profile `family` of
+ `custom`.
+ :param str name: (optional) The name for this volume. The name must not be
+ used by another volume in the region. If unspecified, the name will be a
+ hyphenated list of randomly-selected words.
+ :param ResourceGroupIdentity resource_group: (optional) The resource group
+ to use for this volume. If unspecified, the instance's resource
+ group will be used.
+ :param List[str] user_tags: (optional) The [user
+ tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with
+ this volume.
+ """
+ # pylint: disable=super-init-not-called
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity', 'VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshot'])
+ )
+ raise Exception(msg)
+
+
+class VolumeIdentityByCRN(VolumeIdentity):
+ """
+ VolumeIdentityByCRN.
+
+ :param str crn: The CRN for this volume.
+ """
+
+ def __init__(
+ self,
+ crn: str,
+ ) -> None:
+ """
+ Initialize a VolumeIdentityByCRN object.
+
+ :param str crn: The CRN for this volume.
+ """
+ # pylint: disable=super-init-not-called
+ self.crn = crn
@classmethod
- def from_dict(cls, _dict: Dict) -> 'VPCDNSResolverTypeSystem':
- """Initialize a VPCDNSResolverTypeSystem object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VolumeIdentityByCRN':
+ """Initialize a VolumeIdentityByCRN object from a json dictionary."""
args = {}
- if 'servers' in _dict:
- args['servers'] = [DNSServer.from_dict(v) for v in _dict.get('servers')]
+ if (crn := _dict.get('crn')) is not None:
+ args['crn'] = crn
else:
- raise ValueError('Required property \'servers\' not present in VPCDNSResolverTypeSystem JSON')
- if 'configuration' in _dict:
- args['configuration'] = _dict.get('configuration')
- else:
- raise ValueError('Required property \'configuration\' not present in VPCDNSResolverTypeSystem JSON')
- if 'type' in _dict:
- args['type'] = _dict.get('type')
- else:
- raise ValueError('Required property \'type\' not present in VPCDNSResolverTypeSystem JSON')
+ raise ValueError('Required property \'crn\' not present in VolumeIdentityByCRN JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VPCDNSResolverTypeSystem object from a json dictionary."""
+ """Initialize a VolumeIdentityByCRN object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'servers') and self.servers is not None:
- servers_list = []
- for v in self.servers:
- if isinstance(v, dict):
- servers_list.append(v)
- else:
- servers_list.append(v.to_dict())
- _dict['servers'] = servers_list
- if hasattr(self, 'configuration') and self.configuration is not None:
- _dict['configuration'] = self.configuration
- if hasattr(self, 'type') and self.type is not None:
- _dict['type'] = self.type
+ if hasattr(self, 'crn') and self.crn is not None:
+ _dict['crn'] = self.crn
return _dict
def _to_dict(self):
@@ -118940,90 +135271,59 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this VPCDNSResolverTypeSystem object."""
+ """Return a `str` version of this VolumeIdentityByCRN object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VPCDNSResolverTypeSystem') -> bool:
+ def __eq__(self, other: 'VolumeIdentityByCRN') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'VPCDNSResolverTypeSystem') -> bool:
+ def __ne__(self, other: 'VolumeIdentityByCRN') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class ConfigurationEnum(str, Enum):
- """
- The configuration of the system DNS resolver for this VPC.
- - `custom_resolver`: A custom DNS resolver is configured for this VPC.
- - `private_resolver`: A private DNS resolver is configured for this VPC.
- Applicable when
- the VPC has either or both of the following:
- - at least one endpoint gateway residing in it
- - a [DNS Services](https://cloud.ibm.com/docs/dns-svcs) private zone
- configured for it
- - `default`: The provider default DNS resolvers are configured for this VPC.
- This system DNS resolver configuration is used when the VPC has:
- - no custom DNS resolver configured for it, and
- - no endpoint gateways residing in it, and
- - no [DNS Services](https://cloud.ibm.com/docs/dns-svcs) private zone configured
- for it.
- """
-
- CUSTOM_RESOLVER = 'custom_resolver'
- DEFAULT = 'default'
- PRIVATE_RESOLVER = 'private_resolver'
-
-
- class TypeEnum(str, Enum):
- """
- The type of the DNS resolver used for the VPC.
- """
-
- SYSTEM = 'system'
-
-
-class VPCDNSResolverVPCPatchVPCIdentityByCRN(VPCDNSResolverVPCPatch):
+class VolumeIdentityByHref(VolumeIdentity):
"""
- VPCDNSResolverVPCPatchVPCIdentityByCRN.
+ VolumeIdentityByHref.
- :attr str crn: The CRN for this VPC.
+ :param str href: The URL for this volume.
"""
def __init__(
self,
- crn: str,
+ href: str,
) -> None:
"""
- Initialize a VPCDNSResolverVPCPatchVPCIdentityByCRN object.
+ Initialize a VolumeIdentityByHref object.
- :param str crn: The CRN for this VPC.
+ :param str href: The URL for this volume.
"""
# pylint: disable=super-init-not-called
- self.crn = crn
+ self.href = href
@classmethod
- def from_dict(cls, _dict: Dict) -> 'VPCDNSResolverVPCPatchVPCIdentityByCRN':
- """Initialize a VPCDNSResolverVPCPatchVPCIdentityByCRN object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VolumeIdentityByHref':
+ """Initialize a VolumeIdentityByHref object from a json dictionary."""
args = {}
- if 'crn' in _dict:
- args['crn'] = _dict.get('crn')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'crn\' not present in VPCDNSResolverVPCPatchVPCIdentityByCRN JSON')
+ raise ValueError('Required property \'href\' not present in VolumeIdentityByHref JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VPCDNSResolverVPCPatchVPCIdentityByCRN object from a json dictionary."""
+ """Initialize a VolumeIdentityByHref object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'crn') and self.crn is not None:
- _dict['crn'] = self.crn
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
return _dict
def _to_dict(self):
@@ -119031,59 +135331,59 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this VPCDNSResolverVPCPatchVPCIdentityByCRN object."""
+ """Return a `str` version of this VolumeIdentityByHref object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VPCDNSResolverVPCPatchVPCIdentityByCRN') -> bool:
+ def __eq__(self, other: 'VolumeIdentityByHref') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'VPCDNSResolverVPCPatchVPCIdentityByCRN') -> bool:
+ def __ne__(self, other: 'VolumeIdentityByHref') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class VPCDNSResolverVPCPatchVPCIdentityByHref(VPCDNSResolverVPCPatch):
+class VolumeIdentityById(VolumeIdentity):
"""
- VPCDNSResolverVPCPatchVPCIdentityByHref.
+ VolumeIdentityById.
- :attr str href: The URL for this VPC.
+ :param str id: The unique identifier for this volume.
"""
def __init__(
self,
- href: str,
+ id: str,
) -> None:
"""
- Initialize a VPCDNSResolverVPCPatchVPCIdentityByHref object.
+ Initialize a VolumeIdentityById object.
- :param str href: The URL for this VPC.
+ :param str id: The unique identifier for this volume.
"""
# pylint: disable=super-init-not-called
- self.href = href
+ self.id = id
@classmethod
- def from_dict(cls, _dict: Dict) -> 'VPCDNSResolverVPCPatchVPCIdentityByHref':
- """Initialize a VPCDNSResolverVPCPatchVPCIdentityByHref object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VolumeIdentityById':
+ """Initialize a VolumeIdentityById object from a json dictionary."""
args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
else:
- raise ValueError('Required property \'href\' not present in VPCDNSResolverVPCPatchVPCIdentityByHref JSON')
+ raise ValueError('Required property \'id\' not present in VolumeIdentityById JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VPCDNSResolverVPCPatchVPCIdentityByHref object from a json dictionary."""
+ """Initialize a VolumeIdentityById object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'href') and self.href is not None:
- _dict['href'] = self.href
+ if hasattr(self, 'id') and self.id is not None:
+ _dict['id'] = self.id
return _dict
def _to_dict(self):
@@ -119091,59 +135391,59 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this VPCDNSResolverVPCPatchVPCIdentityByHref object."""
+ """Return a `str` version of this VolumeIdentityById object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VPCDNSResolverVPCPatchVPCIdentityByHref') -> bool:
+ def __eq__(self, other: 'VolumeIdentityById') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'VPCDNSResolverVPCPatchVPCIdentityByHref') -> bool:
+ def __ne__(self, other: 'VolumeIdentityById') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class VPCDNSResolverVPCPatchVPCIdentityById(VPCDNSResolverVPCPatch):
+class VolumeProfileIdentityByHref(VolumeProfileIdentity):
"""
- VPCDNSResolverVPCPatchVPCIdentityById.
+ VolumeProfileIdentityByHref.
- :attr str id: The unique identifier for this VPC.
+ :param str href: The URL for this volume profile.
"""
def __init__(
self,
- id: str,
+ href: str,
) -> None:
"""
- Initialize a VPCDNSResolverVPCPatchVPCIdentityById object.
+ Initialize a VolumeProfileIdentityByHref object.
- :param str id: The unique identifier for this VPC.
+ :param str href: The URL for this volume profile.
"""
# pylint: disable=super-init-not-called
- self.id = id
+ self.href = href
@classmethod
- def from_dict(cls, _dict: Dict) -> 'VPCDNSResolverVPCPatchVPCIdentityById':
- """Initialize a VPCDNSResolverVPCPatchVPCIdentityById object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VolumeProfileIdentityByHref':
+ """Initialize a VolumeProfileIdentityByHref object from a json dictionary."""
args = {}
- if 'id' in _dict:
- args['id'] = _dict.get('id')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'id\' not present in VPCDNSResolverVPCPatchVPCIdentityById JSON')
+ raise ValueError('Required property \'href\' not present in VolumeProfileIdentityByHref JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VPCDNSResolverVPCPatchVPCIdentityById object from a json dictionary."""
+ """Initialize a VolumeProfileIdentityByHref object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'id') and self.id is not None:
- _dict['id'] = self.id
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
return _dict
def _to_dict(self):
@@ -119151,59 +135451,59 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this VPCDNSResolverVPCPatchVPCIdentityById object."""
+ """Return a `str` version of this VolumeProfileIdentityByHref object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VPCDNSResolverVPCPatchVPCIdentityById') -> bool:
+ def __eq__(self, other: 'VolumeProfileIdentityByHref') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'VPCDNSResolverVPCPatchVPCIdentityById') -> bool:
+ def __ne__(self, other: 'VolumeProfileIdentityByHref') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class VPCIdentityByCRN(VPCIdentity):
+class VolumeProfileIdentityByName(VolumeProfileIdentity):
"""
- VPCIdentityByCRN.
+ VolumeProfileIdentityByName.
- :attr str crn: The CRN for this VPC.
+ :param str name: The globally unique name for this volume profile.
"""
def __init__(
self,
- crn: str,
+ name: str,
) -> None:
"""
- Initialize a VPCIdentityByCRN object.
+ Initialize a VolumeProfileIdentityByName object.
- :param str crn: The CRN for this VPC.
+ :param str name: The globally unique name for this volume profile.
"""
# pylint: disable=super-init-not-called
- self.crn = crn
+ self.name = name
@classmethod
- def from_dict(cls, _dict: Dict) -> 'VPCIdentityByCRN':
- """Initialize a VPCIdentityByCRN object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VolumeProfileIdentityByName':
+ """Initialize a VolumeProfileIdentityByName object from a json dictionary."""
args = {}
- if 'crn' in _dict:
- args['crn'] = _dict.get('crn')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
else:
- raise ValueError('Required property \'crn\' not present in VPCIdentityByCRN JSON')
+ raise ValueError('Required property \'name\' not present in VolumeProfileIdentityByName JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VPCIdentityByCRN object from a json dictionary."""
+ """Initialize a VolumeProfileIdentityByName object from 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, 'name') and self.name is not None:
+ _dict['name'] = self.name
return _dict
def _to_dict(self):
@@ -119211,59 +135511,157 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this VPCIdentityByCRN object."""
+ """Return a `str` version of this VolumeProfileIdentityByName object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VPCIdentityByCRN') -> bool:
+ def __eq__(self, other: 'VolumeProfileIdentityByName') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'VPCIdentityByCRN') -> bool:
+ def __ne__(self, other: 'VolumeProfileIdentityByName') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class VPCIdentityByHref(VPCIdentity):
+class VolumePrototypeVolumeByCapacity(VolumePrototype):
"""
- VPCIdentityByHref.
+ VolumePrototypeVolumeByCapacity.
- :attr str href: The URL for this VPC.
+ :param int iops: (optional) The maximum I/O operations per second (IOPS) to use
+ for this volume. Applicable only to volumes using a profile `family` of
+ `custom`.
+ :param str name: (optional) The name for this volume. The name must not be used
+ by another volume in the region. If unspecified, the name will be a hyphenated
+ list of randomly-selected words.
+ :param VolumeProfileIdentity profile: The
+ [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-block-storage-profiles) to
+ use for this volume.
+ :param ResourceGroupIdentity resource_group: (optional)
+ :param List[str] user_tags: (optional) The [user
+ tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with this
+ volume.
+ :param ZoneIdentity zone: The zone this volume will reside in.
+ :param int capacity: The capacity to use for the volume (in gigabytes). The
+ specified minimum and maximum capacity values for creating or updating volumes
+ may expand in the future.
+ :param EncryptionKeyIdentity encryption_key: (optional) The root key to use to
+ wrap the data encryption key for the volume.
+ If unspecified, the `encryption` type for the volume will be `provider_managed`.
"""
def __init__(
self,
- href: str,
+ profile: 'VolumeProfileIdentity',
+ zone: 'ZoneIdentity',
+ capacity: int,
+ *,
+ iops: Optional[int] = None,
+ name: Optional[str] = None,
+ resource_group: Optional['ResourceGroupIdentity'] = None,
+ user_tags: Optional[List[str]] = None,
+ encryption_key: Optional['EncryptionKeyIdentity'] = None,
) -> None:
"""
- Initialize a VPCIdentityByHref object.
+ Initialize a VolumePrototypeVolumeByCapacity object.
- :param str href: The URL for this VPC.
+ :param VolumeProfileIdentity profile: The
+ [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-block-storage-profiles)
+ to use for this volume.
+ :param ZoneIdentity zone: The zone this volume will reside in.
+ :param int capacity: The capacity to use for the volume (in gigabytes). The
+ specified minimum and maximum capacity values for creating or updating
+ volumes may expand in the future.
+ :param int iops: (optional) The maximum I/O operations per second (IOPS) to
+ use for this volume. Applicable only to volumes using a profile `family` of
+ `custom`.
+ :param str name: (optional) The name for this volume. The name must not be
+ used by another volume in the region. If unspecified, the name will be a
+ hyphenated list of randomly-selected words.
+ :param ResourceGroupIdentity resource_group: (optional)
+ :param List[str] user_tags: (optional) The [user
+ tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with
+ this volume.
+ :param EncryptionKeyIdentity encryption_key: (optional) The root key to use
+ to wrap the data encryption key for the volume.
+ If unspecified, the `encryption` type for the volume will be
+ `provider_managed`.
"""
# pylint: disable=super-init-not-called
- self.href = href
+ self.iops = iops
+ self.name = name
+ self.profile = profile
+ self.resource_group = resource_group
+ self.user_tags = user_tags
+ self.zone = zone
+ self.capacity = capacity
+ self.encryption_key = encryption_key
@classmethod
- def from_dict(cls, _dict: Dict) -> 'VPCIdentityByHref':
- """Initialize a VPCIdentityByHref object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VolumePrototypeVolumeByCapacity':
+ """Initialize a VolumePrototypeVolumeByCapacity object from a json dictionary."""
args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ if (iops := _dict.get('iops')) is not None:
+ args['iops'] = iops
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ if (profile := _dict.get('profile')) is not None:
+ args['profile'] = profile
else:
- raise ValueError('Required property \'href\' not present in VPCIdentityByHref JSON')
+ raise ValueError('Required property \'profile\' not present in VolumePrototypeVolumeByCapacity JSON')
+ if (resource_group := _dict.get('resource_group')) is not None:
+ args['resource_group'] = resource_group
+ if (user_tags := _dict.get('user_tags')) is not None:
+ args['user_tags'] = user_tags
+ if (zone := _dict.get('zone')) is not None:
+ args['zone'] = zone
+ else:
+ raise ValueError('Required property \'zone\' not present in VolumePrototypeVolumeByCapacity JSON')
+ if (capacity := _dict.get('capacity')) is not None:
+ args['capacity'] = capacity
+ else:
+ raise ValueError('Required property \'capacity\' not present in VolumePrototypeVolumeByCapacity JSON')
+ if (encryption_key := _dict.get('encryption_key')) is not None:
+ args['encryption_key'] = encryption_key
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VPCIdentityByHref object from a json dictionary."""
+ """Initialize a VolumePrototypeVolumeByCapacity object from 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, 'iops') and self.iops is not None:
+ _dict['iops'] = self.iops
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ if hasattr(self, 'profile') and self.profile is not None:
+ if isinstance(self.profile, dict):
+ _dict['profile'] = self.profile
+ else:
+ _dict['profile'] = self.profile.to_dict()
+ if hasattr(self, 'resource_group') and self.resource_group is not None:
+ if isinstance(self.resource_group, dict):
+ _dict['resource_group'] = self.resource_group
+ else:
+ _dict['resource_group'] = self.resource_group.to_dict()
+ if hasattr(self, 'user_tags') and self.user_tags is not None:
+ _dict['user_tags'] = self.user_tags
+ if hasattr(self, 'zone') and self.zone is not None:
+ if isinstance(self.zone, dict):
+ _dict['zone'] = self.zone
+ else:
+ _dict['zone'] = self.zone.to_dict()
+ if hasattr(self, 'capacity') and self.capacity is not None:
+ _dict['capacity'] = self.capacity
+ if hasattr(self, 'encryption_key') and self.encryption_key is not None:
+ if isinstance(self.encryption_key, dict):
+ _dict['encryption_key'] = self.encryption_key
+ else:
+ _dict['encryption_key'] = self.encryption_key.to_dict()
return _dict
def _to_dict(self):
@@ -119271,59 +135669,173 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this VPCIdentityByHref object."""
+ """Return a `str` version of this VolumePrototypeVolumeByCapacity object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VPCIdentityByHref') -> bool:
+ def __eq__(self, other: 'VolumePrototypeVolumeByCapacity') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'VPCIdentityByHref') -> bool:
+ def __ne__(self, other: 'VolumePrototypeVolumeByCapacity') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class VPCIdentityById(VPCIdentity):
+class VolumePrototypeVolumeBySourceSnapshot(VolumePrototype):
"""
- VPCIdentityById.
+ VolumePrototypeVolumeBySourceSnapshot.
- :attr str id: The unique identifier for this VPC.
+ :param int iops: (optional) The maximum I/O operations per second (IOPS) to use
+ for this volume. Applicable only to volumes using a profile `family` of
+ `custom`.
+ :param str name: (optional) The name for this volume. The name must not be used
+ by another volume in the region. If unspecified, the name will be a hyphenated
+ list of randomly-selected words.
+ :param VolumeProfileIdentity profile: The
+ [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-block-storage-profiles) to
+ use for this volume.
+ :param ResourceGroupIdentity resource_group: (optional)
+ :param List[str] user_tags: (optional) The [user
+ tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with this
+ volume.
+ :param ZoneIdentity zone: The zone this volume will reside in.
+ :param int capacity: (optional) The capacity to use for the volume (in
+ gigabytes). Must be at least the snapshot's
+ `minimum_capacity`. The maximum value may increase in the future.
+ If unspecified, the capacity will be the source snapshot's `minimum_capacity`.
+ :param EncryptionKeyIdentity encryption_key: (optional) The root key to use to
+ wrap the data encryption key for the volume.
+ If unspecified, the `encryption` type for the volume will be `provider_managed`.
+ :param SnapshotIdentity source_snapshot: The snapshot from which to clone the
+ volume.
"""
def __init__(
self,
- id: str,
+ profile: 'VolumeProfileIdentity',
+ zone: 'ZoneIdentity',
+ source_snapshot: 'SnapshotIdentity',
+ *,
+ iops: Optional[int] = None,
+ name: Optional[str] = None,
+ resource_group: Optional['ResourceGroupIdentity'] = None,
+ user_tags: Optional[List[str]] = None,
+ capacity: Optional[int] = None,
+ encryption_key: Optional['EncryptionKeyIdentity'] = None,
) -> None:
"""
- Initialize a VPCIdentityById object.
+ Initialize a VolumePrototypeVolumeBySourceSnapshot object.
- :param str id: The unique identifier for this VPC.
+ :param VolumeProfileIdentity profile: The
+ [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-block-storage-profiles)
+ to use for this volume.
+ :param ZoneIdentity zone: The zone this volume will reside in.
+ :param SnapshotIdentity source_snapshot: The snapshot from which to clone
+ the volume.
+ :param int iops: (optional) The maximum I/O operations per second (IOPS) to
+ use for this volume. Applicable only to volumes using a profile `family` of
+ `custom`.
+ :param str name: (optional) The name for this volume. The name must not be
+ used by another volume in the region. If unspecified, the name will be a
+ hyphenated list of randomly-selected words.
+ :param ResourceGroupIdentity resource_group: (optional)
+ :param List[str] user_tags: (optional) The [user
+ tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with
+ this volume.
+ :param int capacity: (optional) The capacity to use for the volume (in
+ gigabytes). Must be at least the snapshot's
+ `minimum_capacity`. The maximum value may increase in the future.
+ If unspecified, the capacity will be the source snapshot's
+ `minimum_capacity`.
+ :param EncryptionKeyIdentity encryption_key: (optional) The root key to use
+ to wrap the data encryption key for the volume.
+ If unspecified, the `encryption` type for the volume will be
+ `provider_managed`.
"""
# pylint: disable=super-init-not-called
- self.id = id
+ self.iops = iops
+ self.name = name
+ self.profile = profile
+ self.resource_group = resource_group
+ self.user_tags = user_tags
+ self.zone = zone
+ self.capacity = capacity
+ self.encryption_key = encryption_key
+ self.source_snapshot = source_snapshot
@classmethod
- def from_dict(cls, _dict: Dict) -> 'VPCIdentityById':
- """Initialize a VPCIdentityById object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VolumePrototypeVolumeBySourceSnapshot':
+ """Initialize a VolumePrototypeVolumeBySourceSnapshot object from a json dictionary."""
args = {}
- if 'id' in _dict:
- args['id'] = _dict.get('id')
+ if (iops := _dict.get('iops')) is not None:
+ args['iops'] = iops
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ if (profile := _dict.get('profile')) is not None:
+ args['profile'] = profile
else:
- raise ValueError('Required property \'id\' not present in VPCIdentityById JSON')
+ raise ValueError('Required property \'profile\' not present in VolumePrototypeVolumeBySourceSnapshot JSON')
+ if (resource_group := _dict.get('resource_group')) is not None:
+ args['resource_group'] = resource_group
+ if (user_tags := _dict.get('user_tags')) is not None:
+ args['user_tags'] = user_tags
+ if (zone := _dict.get('zone')) is not None:
+ args['zone'] = zone
+ else:
+ raise ValueError('Required property \'zone\' not present in VolumePrototypeVolumeBySourceSnapshot JSON')
+ if (capacity := _dict.get('capacity')) is not None:
+ args['capacity'] = capacity
+ if (encryption_key := _dict.get('encryption_key')) is not None:
+ args['encryption_key'] = encryption_key
+ if (source_snapshot := _dict.get('source_snapshot')) is not None:
+ args['source_snapshot'] = source_snapshot
+ else:
+ raise ValueError('Required property \'source_snapshot\' not present in VolumePrototypeVolumeBySourceSnapshot JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VPCIdentityById object from a json dictionary."""
+ """Initialize a VolumePrototypeVolumeBySourceSnapshot object from 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, 'iops') and self.iops is not None:
+ _dict['iops'] = self.iops
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ if hasattr(self, 'profile') and self.profile is not None:
+ if isinstance(self.profile, dict):
+ _dict['profile'] = self.profile
+ else:
+ _dict['profile'] = self.profile.to_dict()
+ if hasattr(self, 'resource_group') and self.resource_group is not None:
+ if isinstance(self.resource_group, dict):
+ _dict['resource_group'] = self.resource_group
+ else:
+ _dict['resource_group'] = self.resource_group.to_dict()
+ if hasattr(self, 'user_tags') and self.user_tags is not None:
+ _dict['user_tags'] = self.user_tags
+ if hasattr(self, 'zone') and self.zone is not None:
+ if isinstance(self.zone, dict):
+ _dict['zone'] = self.zone
+ else:
+ _dict['zone'] = self.zone.to_dict()
+ if hasattr(self, 'capacity') and self.capacity is not None:
+ _dict['capacity'] = self.capacity
+ if hasattr(self, 'encryption_key') and self.encryption_key is not None:
+ if isinstance(self.encryption_key, dict):
+ _dict['encryption_key'] = self.encryption_key
+ else:
+ _dict['encryption_key'] = self.encryption_key.to_dict()
+ if hasattr(self, 'source_snapshot') and self.source_snapshot is not None:
+ if isinstance(self.source_snapshot, dict):
+ _dict['source_snapshot'] = self.source_snapshot
+ else:
+ _dict['source_snapshot'] = self.source_snapshot.to_dict()
return _dict
def _to_dict(self):
@@ -119331,25 +135843,25 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this VPCIdentityById object."""
+ """Return a `str` version of this VolumePrototypeVolumeBySourceSnapshot object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VPCIdentityById') -> bool:
+ def __eq__(self, other: 'VolumePrototypeVolumeBySourceSnapshot') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'VPCIdentityById') -> bool:
+ def __ne__(self, other: 'VolumePrototypeVolumeBySourceSnapshot') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class VPNGatewayConnectionIKEPolicyPatchIKEPolicyIdentityByHref(VPNGatewayConnectionIKEPolicyPatch):
+class ZoneIdentityByHref(ZoneIdentity):
"""
- VPNGatewayConnectionIKEPolicyPatchIKEPolicyIdentityByHref.
+ ZoneIdentityByHref.
- :attr str href: The IKE policy's canonical URL.
+ :param str href: The URL for this zone.
"""
def __init__(
@@ -119357,26 +135869,26 @@ def __init__(
href: str,
) -> None:
"""
- Initialize a VPNGatewayConnectionIKEPolicyPatchIKEPolicyIdentityByHref object.
+ Initialize a ZoneIdentityByHref object.
- :param str href: The IKE policy's canonical URL.
+ :param str href: The URL for this zone.
"""
# pylint: disable=super-init-not-called
self.href = href
@classmethod
- def from_dict(cls, _dict: Dict) -> 'VPNGatewayConnectionIKEPolicyPatchIKEPolicyIdentityByHref':
- """Initialize a VPNGatewayConnectionIKEPolicyPatchIKEPolicyIdentityByHref object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'ZoneIdentityByHref':
+ """Initialize a ZoneIdentityByHref object from a json dictionary."""
args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'href\' not present in VPNGatewayConnectionIKEPolicyPatchIKEPolicyIdentityByHref JSON')
+ raise ValueError('Required property \'href\' not present in ZoneIdentityByHref JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VPNGatewayConnectionIKEPolicyPatchIKEPolicyIdentityByHref object from a json dictionary."""
+ """Initialize a ZoneIdentityByHref object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -119391,59 +135903,59 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this VPNGatewayConnectionIKEPolicyPatchIKEPolicyIdentityByHref object."""
+ """Return a `str` version of this ZoneIdentityByHref object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VPNGatewayConnectionIKEPolicyPatchIKEPolicyIdentityByHref') -> bool:
+ def __eq__(self, other: 'ZoneIdentityByHref') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'VPNGatewayConnectionIKEPolicyPatchIKEPolicyIdentityByHref') -> bool:
+ def __ne__(self, other: 'ZoneIdentityByHref') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class VPNGatewayConnectionIKEPolicyPatchIKEPolicyIdentityById(VPNGatewayConnectionIKEPolicyPatch):
+class ZoneIdentityByName(ZoneIdentity):
"""
- VPNGatewayConnectionIKEPolicyPatchIKEPolicyIdentityById.
+ ZoneIdentityByName.
- :attr str id: The unique identifier for this IKE policy.
+ :param str name: The globally unique name for this zone.
"""
def __init__(
self,
- id: str,
+ name: str,
) -> None:
"""
- Initialize a VPNGatewayConnectionIKEPolicyPatchIKEPolicyIdentityById object.
+ Initialize a ZoneIdentityByName object.
- :param str id: The unique identifier for this IKE policy.
+ :param str name: The globally unique name for this zone.
"""
# pylint: disable=super-init-not-called
- self.id = id
+ self.name = name
@classmethod
- def from_dict(cls, _dict: Dict) -> 'VPNGatewayConnectionIKEPolicyPatchIKEPolicyIdentityById':
- """Initialize a VPNGatewayConnectionIKEPolicyPatchIKEPolicyIdentityById object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'ZoneIdentityByName':
+ """Initialize a ZoneIdentityByName object from a json dictionary."""
args = {}
- if 'id' in _dict:
- args['id'] = _dict.get('id')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
else:
- raise ValueError('Required property \'id\' not present in VPNGatewayConnectionIKEPolicyPatchIKEPolicyIdentityById JSON')
+ raise ValueError('Required property \'name\' not present in ZoneIdentityByName JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VPNGatewayConnectionIKEPolicyPatchIKEPolicyIdentityById object from a json dictionary."""
+ """Initialize a ZoneIdentityByName object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'id') and self.id is not None:
- _dict['id'] = self.id
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
return _dict
def _to_dict(self):
@@ -119451,59 +135963,59 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this VPNGatewayConnectionIKEPolicyPatchIKEPolicyIdentityById object."""
+ """Return a `str` version of this ZoneIdentityByName object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VPNGatewayConnectionIKEPolicyPatchIKEPolicyIdentityById') -> bool:
+ def __eq__(self, other: 'ZoneIdentityByName') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'VPNGatewayConnectionIKEPolicyPatchIKEPolicyIdentityById') -> bool:
+ def __ne__(self, other: 'ZoneIdentityByName') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class VPNGatewayConnectionIKEPolicyPrototypeIKEPolicyIdentityByHref(VPNGatewayConnectionIKEPolicyPrototype):
+class BackupPolicyScopePrototypeEnterpriseIdentityEnterpriseIdentityByCRN(BackupPolicyScopePrototypeEnterpriseIdentity):
"""
- VPNGatewayConnectionIKEPolicyPrototypeIKEPolicyIdentityByHref.
+ BackupPolicyScopePrototypeEnterpriseIdentityEnterpriseIdentityByCRN.
- :attr str href: The IKE policy's canonical URL.
+ :param str crn: The CRN for this enterprise.
"""
def __init__(
self,
- href: str,
+ crn: str,
) -> None:
"""
- Initialize a VPNGatewayConnectionIKEPolicyPrototypeIKEPolicyIdentityByHref object.
+ Initialize a BackupPolicyScopePrototypeEnterpriseIdentityEnterpriseIdentityByCRN object.
- :param str href: The IKE policy's canonical URL.
+ :param str crn: The CRN for this enterprise.
"""
# pylint: disable=super-init-not-called
- self.href = href
+ self.crn = crn
@classmethod
- def from_dict(cls, _dict: Dict) -> 'VPNGatewayConnectionIKEPolicyPrototypeIKEPolicyIdentityByHref':
- """Initialize a VPNGatewayConnectionIKEPolicyPrototypeIKEPolicyIdentityByHref object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'BackupPolicyScopePrototypeEnterpriseIdentityEnterpriseIdentityByCRN':
+ """Initialize a BackupPolicyScopePrototypeEnterpriseIdentityEnterpriseIdentityByCRN object from a json dictionary."""
args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ if (crn := _dict.get('crn')) is not None:
+ args['crn'] = crn
else:
- raise ValueError('Required property \'href\' not present in VPNGatewayConnectionIKEPolicyPrototypeIKEPolicyIdentityByHref JSON')
+ raise ValueError('Required property \'crn\' not present in BackupPolicyScopePrototypeEnterpriseIdentityEnterpriseIdentityByCRN JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VPNGatewayConnectionIKEPolicyPrototypeIKEPolicyIdentityByHref object from a json dictionary."""
+ """Initialize a BackupPolicyScopePrototypeEnterpriseIdentityEnterpriseIdentityByCRN object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'href') and self.href is not None:
- _dict['href'] = self.href
+ if hasattr(self, 'crn') and self.crn is not None:
+ _dict['crn'] = self.crn
return _dict
def _to_dict(self):
@@ -119511,59 +136023,59 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this VPNGatewayConnectionIKEPolicyPrototypeIKEPolicyIdentityByHref object."""
+ """Return a `str` version of this BackupPolicyScopePrototypeEnterpriseIdentityEnterpriseIdentityByCRN object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VPNGatewayConnectionIKEPolicyPrototypeIKEPolicyIdentityByHref') -> bool:
+ def __eq__(self, other: 'BackupPolicyScopePrototypeEnterpriseIdentityEnterpriseIdentityByCRN') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'VPNGatewayConnectionIKEPolicyPrototypeIKEPolicyIdentityByHref') -> bool:
+ def __ne__(self, other: 'BackupPolicyScopePrototypeEnterpriseIdentityEnterpriseIdentityByCRN') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class VPNGatewayConnectionIKEPolicyPrototypeIKEPolicyIdentityById(VPNGatewayConnectionIKEPolicyPrototype):
+class BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN(BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentity):
"""
- VPNGatewayConnectionIKEPolicyPrototypeIKEPolicyIdentityById.
+ BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN.
- :attr str id: The unique identifier for this IKE policy.
+ :param str crn: The CRN for this virtual network interface.
"""
def __init__(
self,
- id: str,
+ crn: str,
) -> None:
"""
- Initialize a VPNGatewayConnectionIKEPolicyPrototypeIKEPolicyIdentityById object.
+ Initialize a BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN object.
- :param str id: The unique identifier for this IKE policy.
+ :param str crn: The CRN for this virtual network interface.
"""
# pylint: disable=super-init-not-called
- self.id = id
+ self.crn = crn
@classmethod
- def from_dict(cls, _dict: Dict) -> 'VPNGatewayConnectionIKEPolicyPrototypeIKEPolicyIdentityById':
- """Initialize a VPNGatewayConnectionIKEPolicyPrototypeIKEPolicyIdentityById object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN':
+ """Initialize a BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN object from a json dictionary."""
args = {}
- if 'id' in _dict:
- args['id'] = _dict.get('id')
+ if (crn := _dict.get('crn')) is not None:
+ args['crn'] = crn
else:
- raise ValueError('Required property \'id\' not present in VPNGatewayConnectionIKEPolicyPrototypeIKEPolicyIdentityById JSON')
+ raise ValueError('Required property \'crn\' not present in BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VPNGatewayConnectionIKEPolicyPrototypeIKEPolicyIdentityById object from a json dictionary."""
+ """Initialize a BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'id') and self.id is not None:
- _dict['id'] = self.id
+ if hasattr(self, 'crn') and self.crn is not None:
+ _dict['crn'] = self.crn
return _dict
def _to_dict(self):
@@ -119571,25 +136083,25 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this VPNGatewayConnectionIKEPolicyPrototypeIKEPolicyIdentityById object."""
+ """Return a `str` version of this BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VPNGatewayConnectionIKEPolicyPrototypeIKEPolicyIdentityById') -> bool:
+ def __eq__(self, other: 'BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'VPNGatewayConnectionIKEPolicyPrototypeIKEPolicyIdentityById') -> bool:
+ def __ne__(self, other: 'BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByHref(VPNGatewayConnectionIPsecPolicyPatch):
+class BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref(BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentity):
"""
- VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByHref.
+ BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref.
- :attr str href: The IPsec policy's canonical URL.
+ :param str href: The URL for this virtual network interface.
"""
def __init__(
@@ -119597,26 +136109,26 @@ def __init__(
href: str,
) -> None:
"""
- Initialize a VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByHref object.
+ Initialize a BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref object.
- :param str href: The IPsec policy's canonical URL.
+ :param str href: The URL for this virtual network interface.
"""
# pylint: disable=super-init-not-called
self.href = href
@classmethod
- def from_dict(cls, _dict: Dict) -> 'VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByHref':
- """Initialize a VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByHref object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref':
+ """Initialize a BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref object from a json dictionary."""
args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'href\' not present in VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByHref JSON')
+ raise ValueError('Required property \'href\' not present in BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByHref object from a json dictionary."""
+ """Initialize a BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -119631,25 +136143,25 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByHref object."""
+ """Return a `str` version of this BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByHref') -> bool:
+ def __eq__(self, other: 'BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByHref') -> bool:
+ def __ne__(self, other: 'BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityById(VPNGatewayConnectionIPsecPolicyPatch):
+class BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById(BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentity):
"""
- VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityById.
+ BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById.
- :attr str id: The unique identifier for this IPsec policy.
+ :param str id: The unique identifier for this virtual network interface.
"""
def __init__(
@@ -119657,26 +136169,26 @@ def __init__(
id: str,
) -> None:
"""
- Initialize a VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityById object.
+ Initialize a BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById object.
- :param str id: The unique identifier for this IPsec policy.
+ :param str id: The unique identifier for this virtual network interface.
"""
# pylint: disable=super-init-not-called
self.id = id
@classmethod
- def from_dict(cls, _dict: Dict) -> 'VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityById':
- """Initialize a VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityById object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById':
+ """Initialize a BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById object from a json dictionary."""
args = {}
- if 'id' in _dict:
- args['id'] = _dict.get('id')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
else:
- raise ValueError('Required property \'id\' not present in VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityById JSON')
+ raise ValueError('Required property \'id\' not present in BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityById object from a json dictionary."""
+ """Initialize a BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -119691,25 +136203,25 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityById object."""
+ """Return a `str` version of this BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityById') -> bool:
+ def __eq__(self, other: 'BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityById') -> bool:
+ def __ne__(self, other: 'BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByHref(VPNGatewayConnectionIPsecPolicyPrototype):
+class EndpointGatewayReservedIPReservedIPIdentityByHref(EndpointGatewayReservedIPReservedIPIdentity):
"""
- VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByHref.
+ EndpointGatewayReservedIPReservedIPIdentityByHref.
- :attr str href: The IPsec policy's canonical URL.
+ :param str href: The URL for this reserved IP.
"""
def __init__(
@@ -119717,26 +136229,26 @@ def __init__(
href: str,
) -> None:
"""
- Initialize a VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByHref object.
+ Initialize a EndpointGatewayReservedIPReservedIPIdentityByHref object.
- :param str href: The IPsec policy's canonical URL.
+ :param str href: The URL for this reserved IP.
"""
# pylint: disable=super-init-not-called
self.href = href
@classmethod
- def from_dict(cls, _dict: Dict) -> 'VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByHref':
- """Initialize a VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByHref object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'EndpointGatewayReservedIPReservedIPIdentityByHref':
+ """Initialize a EndpointGatewayReservedIPReservedIPIdentityByHref object from a json dictionary."""
args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'href\' not present in VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByHref JSON')
+ raise ValueError('Required property \'href\' not present in EndpointGatewayReservedIPReservedIPIdentityByHref JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByHref object from a json dictionary."""
+ """Initialize a EndpointGatewayReservedIPReservedIPIdentityByHref object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -119751,25 +136263,25 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByHref object."""
+ """Return a `str` version of this EndpointGatewayReservedIPReservedIPIdentityByHref object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByHref') -> bool:
+ def __eq__(self, other: 'EndpointGatewayReservedIPReservedIPIdentityByHref') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByHref') -> bool:
+ def __ne__(self, other: 'EndpointGatewayReservedIPReservedIPIdentityByHref') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityById(VPNGatewayConnectionIPsecPolicyPrototype):
+class EndpointGatewayReservedIPReservedIPIdentityById(EndpointGatewayReservedIPReservedIPIdentity):
"""
- VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityById.
+ EndpointGatewayReservedIPReservedIPIdentityById.
- :attr str id: The unique identifier for this IPsec policy.
+ :param str id: The unique identifier for this reserved IP.
"""
def __init__(
@@ -119777,26 +136289,26 @@ def __init__(
id: str,
) -> None:
"""
- Initialize a VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityById object.
+ Initialize a EndpointGatewayReservedIPReservedIPIdentityById object.
- :param str id: The unique identifier for this IPsec policy.
+ :param str id: The unique identifier for this reserved IP.
"""
# pylint: disable=super-init-not-called
self.id = id
@classmethod
- def from_dict(cls, _dict: Dict) -> 'VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityById':
- """Initialize a VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityById object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'EndpointGatewayReservedIPReservedIPIdentityById':
+ """Initialize a EndpointGatewayReservedIPReservedIPIdentityById object from a json dictionary."""
args = {}
- if 'id' in _dict:
- args['id'] = _dict.get('id')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
else:
- raise ValueError('Required property \'id\' not present in VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityById JSON')
+ raise ValueError('Required property \'id\' not present in EndpointGatewayReservedIPReservedIPIdentityById JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityById object from a json dictionary."""
+ """Initialize a EndpointGatewayReservedIPReservedIPIdentityById object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -119811,129 +136323,71 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityById object."""
+ """Return a `str` version of this EndpointGatewayReservedIPReservedIPIdentityById object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityById') -> bool:
+ def __eq__(self, other: 'EndpointGatewayReservedIPReservedIPIdentityById') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityById') -> bool:
+ def __ne__(self, other: 'EndpointGatewayReservedIPReservedIPIdentityById') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class VPNGatewayConnectionPatchVPNGatewayConnectionStaticRouteModePatch(VPNGatewayConnectionPatch):
+class EndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRN(EndpointGatewayTargetPrototypeProviderCloudServiceIdentity):
"""
- VPNGatewayConnectionPatchVPNGatewayConnectionStaticRouteModePatch.
+ EndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRN.
- :attr bool admin_state_up: (optional) If set to false, the VPN gateway
- connection is shut down.
- :attr VPNGatewayConnectionDPDPatch dead_peer_detection: (optional)
- :attr VPNGatewayConnectionIKEPolicyPatch ike_policy: (optional)
- :attr VPNGatewayConnectionIPsecPolicyPatch ipsec_policy: (optional)
- :attr str name: (optional) The name for this VPN gateway connection. The name
- must not be used by another connection for the VPN gateway.
- :attr str peer_address: (optional) The IP address of the peer VPN gateway.
- :attr str psk: (optional) The pre-shared key.
- :attr str routing_protocol: (optional) Routing protocols are disabled for this
- VPN gateway connection.
+ :param str resource_type: The type of target for this endpoint gateway.
+ :param str crn: The CRN for this provider cloud service, or the CRN for the
+ user's instance of a provider cloud service.
"""
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,
- routing_protocol: str = None,
+ resource_type: str,
+ crn: str,
) -> None:
"""
- Initialize a VPNGatewayConnectionPatchVPNGatewayConnectionStaticRouteModePatch object.
+ Initialize a EndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRN object.
- :param bool admin_state_up: (optional) If set to false, the VPN gateway
- connection is shut down.
- :param VPNGatewayConnectionDPDPatch dead_peer_detection: (optional)
- :param VPNGatewayConnectionIKEPolicyPatch ike_policy: (optional)
- :param VPNGatewayConnectionIPsecPolicyPatch ipsec_policy: (optional)
- :param str name: (optional) The name for this VPN gateway connection. The
- name must not be used by another connection for the VPN gateway.
- :param str peer_address: (optional) The IP address of the peer VPN gateway.
- :param str psk: (optional) The pre-shared key.
- :param str routing_protocol: (optional) Routing protocols are disabled for
- this VPN gateway connection.
+ :param str resource_type: The type of target for this endpoint gateway.
+ :param str crn: The CRN for this provider cloud service, or the CRN for the
+ user's instance of a provider cloud service.
"""
# pylint: disable=super-init-not-called
- self.admin_state_up = admin_state_up
- self.dead_peer_detection = dead_peer_detection
- self.ike_policy = ike_policy
- self.ipsec_policy = ipsec_policy
- self.name = name
- self.peer_address = peer_address
- self.psk = psk
- self.routing_protocol = routing_protocol
+ self.resource_type = resource_type
+ self.crn = crn
@classmethod
- def from_dict(cls, _dict: Dict) -> 'VPNGatewayConnectionPatchVPNGatewayConnectionStaticRouteModePatch':
- """Initialize a VPNGatewayConnectionPatchVPNGatewayConnectionStaticRouteModePatch object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'EndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRN':
+ """Initialize a EndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRN object from a json dictionary."""
args = {}
- if 'admin_state_up' in _dict:
- args['admin_state_up'] = _dict.get('admin_state_up')
- if 'dead_peer_detection' in _dict:
- args['dead_peer_detection'] = VPNGatewayConnectionDPDPatch.from_dict(_dict.get('dead_peer_detection'))
- if 'ike_policy' in _dict:
- args['ike_policy'] = _dict.get('ike_policy')
- if 'ipsec_policy' in _dict:
- args['ipsec_policy'] = _dict.get('ipsec_policy')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
- if 'peer_address' in _dict:
- args['peer_address'] = _dict.get('peer_address')
- if 'psk' in _dict:
- args['psk'] = _dict.get('psk')
- if 'routing_protocol' in _dict:
- args['routing_protocol'] = _dict.get('routing_protocol')
+ if (resource_type := _dict.get('resource_type')) is not None:
+ args['resource_type'] = resource_type
+ else:
+ raise ValueError('Required property \'resource_type\' not present in EndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRN JSON')
+ if (crn := _dict.get('crn')) is not None:
+ args['crn'] = crn
+ else:
+ raise ValueError('Required property \'crn\' not present in EndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRN JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VPNGatewayConnectionPatchVPNGatewayConnectionStaticRouteModePatch object from a json dictionary."""
+ """Initialize a EndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRN object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'admin_state_up') and self.admin_state_up is not None:
- _dict['admin_state_up'] = self.admin_state_up
- if hasattr(self, 'dead_peer_detection') and self.dead_peer_detection is not None:
- if isinstance(self.dead_peer_detection, dict):
- _dict['dead_peer_detection'] = self.dead_peer_detection
- else:
- _dict['dead_peer_detection'] = self.dead_peer_detection.to_dict()
- if hasattr(self, 'ike_policy') and self.ike_policy is not None:
- if isinstance(self.ike_policy, dict):
- _dict['ike_policy'] = self.ike_policy
- else:
- _dict['ike_policy'] = self.ike_policy.to_dict()
- if hasattr(self, 'ipsec_policy') and self.ipsec_policy is not None:
- if isinstance(self.ipsec_policy, dict):
- _dict['ipsec_policy'] = self.ipsec_policy
- else:
- _dict['ipsec_policy'] = self.ipsec_policy.to_dict()
- if hasattr(self, 'name') and self.name is not None:
- _dict['name'] = self.name
- if hasattr(self, 'peer_address') and self.peer_address is not None:
- _dict['peer_address'] = self.peer_address
- if hasattr(self, 'psk') and self.psk is not None:
- _dict['psk'] = self.psk
- if hasattr(self, 'routing_protocol') and self.routing_protocol is not None:
- _dict['routing_protocol'] = self.routing_protocol
+ if hasattr(self, 'resource_type') and self.resource_type is not None:
+ _dict['resource_type'] = self.resource_type
+ if hasattr(self, 'crn') and self.crn is not None:
+ _dict['crn'] = self.crn
return _dict
def _to_dict(self):
@@ -119941,308 +136395,80 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this VPNGatewayConnectionPatchVPNGatewayConnectionStaticRouteModePatch object."""
+ """Return a `str` version of this EndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRN object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VPNGatewayConnectionPatchVPNGatewayConnectionStaticRouteModePatch') -> bool:
+ def __eq__(self, other: 'EndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRN') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'VPNGatewayConnectionPatchVPNGatewayConnectionStaticRouteModePatch') -> bool:
+ def __ne__(self, other: 'EndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRN') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class RoutingProtocolEnum(str, Enum):
+ class ResourceTypeEnum(str, Enum):
"""
- Routing protocols are disabled for this VPN gateway connection.
+ The type of target for this endpoint gateway.
"""
- NONE = 'none'
+ PROVIDER_CLOUD_SERVICE = 'provider_cloud_service'
+ PROVIDER_INFRASTRUCTURE_SERVICE = 'provider_infrastructure_service'
-class VPNGatewayConnectionPolicyMode(VPNGatewayConnection):
+class EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityProviderInfrastructureServiceIdentityByName(EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentity):
"""
- VPNGatewayConnectionPolicyMode.
+ The name of this provider infrastructure service.
- :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:
- :attr str href: The VPN connection's canonical URL.
- :attr str id: The unique identifier for this VPN gateway connection.
- :attr IKEPolicyReference ike_policy: (optional) The IKE policy. If absent,
- [auto-negotiation is
- used](https://cloud.ibm.com/docs/vpc?topic=vpc-using-vpn&interface=ui#ike-auto-negotiation-phase-1).
- :attr IPsecPolicyReference ipsec_policy: (optional) The IPsec policy. If absent,
- [auto-negotiation is
- used](https://cloud.ibm.com/docs/vpc?topic=vpc-using-vpn&interface=ui#ipsec-auto-negotiation-phase-2).
- :attr str mode: The mode of the VPN gateway.
- :attr str name: The name for this VPN gateway connection. The name is unique
- across all connections for the VPN gateway.
- :attr str peer_address: The IP address of the peer VPN gateway.
- :attr str psk: The pre-shared key.
- :attr str resource_type: The resource type.
- :attr str status: The status of a VPN gateway connection.
- :attr List[VPNGatewayConnectionStatusReason] status_reasons: The reasons for the
- current VPN gateway connection status (if any):
- - `cannot_authenticate_connection`: Failed to authenticate a connection because
- of
- mismatched IKE ID and PSK (check IKE ID and PSK in peer VPN configuration)
- - `internal_error`: Internal error (contact IBM support)
- - `ike_policy_mismatch`: None of the proposed IKE crypto suites was acceptable
- (check
- the IKE policies on both sides of the VPN)
- - `ike_v1_id_local_remote_cidr_mismatch`: Invalid IKE ID or mismatched local
- CIDRs and
- remote CIDRs in IKE V1 (check the IKE ID or the local CIDRs and remote CIDRs
- in IKE
- V1 configuration)
- - `ike_v2_local_remote_cidr_mismatch`: Mismatched local CIDRs and remote CIDRs
- in IKE
- V2 (check the local CIDRs and remote CIDRs in IKE V2 configuration)
- - `ipsec_policy_mismatch`: None of the proposed IPsec crypto suites was
- acceptable
- (check the IPsec policies on both sides of the VPN)
- - `peer_not_responding`: No response from peer (check network ACL configuration,
- peer
- availability, and on-premise firewall configuration)
- The enumerated reason code values for this property will expand in the future.
- When processing this property, check for and log unknown values. Optionally halt
- processing and surface the error, or bypass the resource on which the unexpected
- reason code was encountered.
- :attr List[str] local_cidrs: The local CIDRs for this resource.
- :attr List[str] peer_cidrs: The peer CIDRs for this resource.
+ :param str resource_type: The type of target for this endpoint gateway.
+ :param str name: The name of a provider infrastructure service. Must be:
+ - `ibm-ntp-server`: An NTP (Network Time Protocol) server provided by IBM.
"""
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,
- status_reasons: List['VPNGatewayConnectionStatusReason'],
- local_cidrs: List[str],
- peer_cidrs: List[str],
- *,
- ike_policy: 'IKEPolicyReference' = None,
- ipsec_policy: 'IPsecPolicyReference' = None,
+ name: str,
) -> None:
"""
- Initialize a VPNGatewayConnectionPolicyMode object.
+ Initialize a EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityProviderInfrastructureServiceIdentityByName 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:
- :param str href: The VPN connection's canonical URL.
- :param str id: The unique identifier for this VPN gateway connection.
- :param str mode: The mode of the VPN gateway.
- :param str name: The name for this VPN gateway connection. The name is
- unique across all connections for the VPN gateway.
- :param str peer_address: The IP address of the peer VPN gateway.
- :param str psk: The pre-shared key.
- :param str resource_type: The resource type.
- :param str status: The status of a VPN gateway connection.
- :param List[VPNGatewayConnectionStatusReason] status_reasons: The reasons
- for the current VPN gateway connection status (if any):
- - `cannot_authenticate_connection`: Failed to authenticate a connection
- because of
- mismatched IKE ID and PSK (check IKE ID and PSK in peer VPN
- configuration)
- - `internal_error`: Internal error (contact IBM support)
- - `ike_policy_mismatch`: None of the proposed IKE crypto suites was
- acceptable (check
- the IKE policies on both sides of the VPN)
- - `ike_v1_id_local_remote_cidr_mismatch`: Invalid IKE ID or mismatched
- local CIDRs and
- remote CIDRs in IKE V1 (check the IKE ID or the local CIDRs and remote
- CIDRs in IKE
- V1 configuration)
- - `ike_v2_local_remote_cidr_mismatch`: Mismatched local CIDRs and remote
- CIDRs in IKE
- V2 (check the local CIDRs and remote CIDRs in IKE V2 configuration)
- - `ipsec_policy_mismatch`: None of the proposed IPsec crypto suites was
- acceptable
- (check the IPsec policies on both sides of the VPN)
- - `peer_not_responding`: No response from peer (check network ACL
- configuration, peer
- availability, and on-premise firewall configuration)
- The enumerated reason code values for this property will expand in the
- future. When processing this property, check for and log unknown values.
- Optionally halt processing and surface the error, or bypass the resource on
- which the unexpected reason code was encountered.
- :param List[str] local_cidrs: The local CIDRs for this resource.
- :param List[str] peer_cidrs: The peer CIDRs for this resource.
- :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).
+ :param str resource_type: The type of target for this endpoint gateway.
+ :param str name: The name of a provider infrastructure service. Must be:
+ - `ibm-ntp-server`: An NTP (Network Time Protocol) server provided by IBM.
"""
# pylint: disable=super-init-not-called
- self.admin_state_up = admin_state_up
- self.authentication_mode = authentication_mode
- self.created_at = created_at
- self.dead_peer_detection = dead_peer_detection
- self.href = href
- self.id = id
- self.ike_policy = ike_policy
- self.ipsec_policy = ipsec_policy
- self.mode = mode
- self.name = name
- self.peer_address = peer_address
- self.psk = psk
self.resource_type = resource_type
- self.status = status
- self.status_reasons = status_reasons
- self.local_cidrs = local_cidrs
- self.peer_cidrs = peer_cidrs
+ self.name = name
@classmethod
- def from_dict(cls, _dict: Dict) -> 'VPNGatewayConnectionPolicyMode':
- """Initialize a VPNGatewayConnectionPolicyMode object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityProviderInfrastructureServiceIdentityByName':
+ """Initialize a EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityProviderInfrastructureServiceIdentityByName object from a json dictionary."""
args = {}
- if 'admin_state_up' in _dict:
- args['admin_state_up'] = _dict.get('admin_state_up')
- else:
- raise ValueError('Required property \'admin_state_up\' not present in VPNGatewayConnectionPolicyMode JSON')
- if 'authentication_mode' in _dict:
- args['authentication_mode'] = _dict.get('authentication_mode')
- else:
- raise ValueError('Required property \'authentication_mode\' not present in VPNGatewayConnectionPolicyMode 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 VPNGatewayConnectionPolicyMode JSON')
- if 'dead_peer_detection' in _dict:
- args['dead_peer_detection'] = VPNGatewayConnectionDPD.from_dict(_dict.get('dead_peer_detection'))
- else:
- raise ValueError('Required property \'dead_peer_detection\' not present in VPNGatewayConnectionPolicyMode JSON')
- if 'href' in _dict:
- args['href'] = _dict.get('href')
- else:
- raise ValueError('Required property \'href\' not present in VPNGatewayConnectionPolicyMode JSON')
- if 'id' in _dict:
- args['id'] = _dict.get('id')
- else:
- raise ValueError('Required property \'id\' not present in VPNGatewayConnectionPolicyMode JSON')
- if 'ike_policy' in _dict:
- args['ike_policy'] = IKEPolicyReference.from_dict(_dict.get('ike_policy'))
- if 'ipsec_policy' in _dict:
- args['ipsec_policy'] = IPsecPolicyReference.from_dict(_dict.get('ipsec_policy'))
- if 'mode' in _dict:
- args['mode'] = _dict.get('mode')
- else:
- raise ValueError('Required property \'mode\' not present in VPNGatewayConnectionPolicyMode JSON')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
- else:
- raise ValueError('Required property \'name\' not present in VPNGatewayConnectionPolicyMode JSON')
- if 'peer_address' in _dict:
- args['peer_address'] = _dict.get('peer_address')
- else:
- raise ValueError('Required property \'peer_address\' not present in VPNGatewayConnectionPolicyMode JSON')
- if 'psk' in _dict:
- args['psk'] = _dict.get('psk')
- else:
- raise ValueError('Required property \'psk\' not present in VPNGatewayConnectionPolicyMode JSON')
- if 'resource_type' in _dict:
- args['resource_type'] = _dict.get('resource_type')
- else:
- raise ValueError('Required property \'resource_type\' not present in VPNGatewayConnectionPolicyMode JSON')
- if 'status' in _dict:
- args['status'] = _dict.get('status')
- else:
- raise ValueError('Required property \'status\' not present in VPNGatewayConnectionPolicyMode JSON')
- if 'status_reasons' in _dict:
- args['status_reasons'] = [VPNGatewayConnectionStatusReason.from_dict(v) for v in _dict.get('status_reasons')]
- else:
- raise ValueError('Required property \'status_reasons\' not present in VPNGatewayConnectionPolicyMode JSON')
- if 'local_cidrs' in _dict:
- args['local_cidrs'] = _dict.get('local_cidrs')
+ if (resource_type := _dict.get('resource_type')) is not None:
+ args['resource_type'] = resource_type
else:
- raise ValueError('Required property \'local_cidrs\' not present in VPNGatewayConnectionPolicyMode JSON')
- if 'peer_cidrs' in _dict:
- args['peer_cidrs'] = _dict.get('peer_cidrs')
+ raise ValueError('Required property \'resource_type\' not present in EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityProviderInfrastructureServiceIdentityByName JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
else:
- raise ValueError('Required property \'peer_cidrs\' not present in VPNGatewayConnectionPolicyMode JSON')
+ raise ValueError('Required property \'name\' not present in EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityProviderInfrastructureServiceIdentityByName JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VPNGatewayConnectionPolicyMode object from a json dictionary."""
+ """Initialize a EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityProviderInfrastructureServiceIdentityByName object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'admin_state_up') and self.admin_state_up is not None:
- _dict['admin_state_up'] = self.admin_state_up
- if hasattr(self, 'authentication_mode') and self.authentication_mode is not None:
- _dict['authentication_mode'] = self.authentication_mode
- if hasattr(self, 'created_at') and self.created_at is not None:
- _dict['created_at'] = datetime_to_string(self.created_at)
- if hasattr(self, 'dead_peer_detection') and self.dead_peer_detection is not None:
- if isinstance(self.dead_peer_detection, dict):
- _dict['dead_peer_detection'] = self.dead_peer_detection
- else:
- _dict['dead_peer_detection'] = self.dead_peer_detection.to_dict()
- if hasattr(self, 'href') and self.href is not None:
- _dict['href'] = self.href
- if hasattr(self, 'id') and self.id is not None:
- _dict['id'] = self.id
- if hasattr(self, 'ike_policy') and self.ike_policy is not None:
- if isinstance(self.ike_policy, dict):
- _dict['ike_policy'] = self.ike_policy
- else:
- _dict['ike_policy'] = self.ike_policy.to_dict()
- if hasattr(self, 'ipsec_policy') and self.ipsec_policy is not None:
- if isinstance(self.ipsec_policy, dict):
- _dict['ipsec_policy'] = self.ipsec_policy
- else:
- _dict['ipsec_policy'] = self.ipsec_policy.to_dict()
- if hasattr(self, 'mode') and self.mode is not None:
- _dict['mode'] = self.mode
- if hasattr(self, 'name') and self.name is not None:
- _dict['name'] = self.name
- if hasattr(self, 'peer_address') and self.peer_address is not None:
- _dict['peer_address'] = self.peer_address
- if hasattr(self, 'psk') and self.psk is not None:
- _dict['psk'] = self.psk
if hasattr(self, 'resource_type') and self.resource_type is not None:
_dict['resource_type'] = self.resource_type
- if hasattr(self, 'status') and self.status is not None:
- _dict['status'] = self.status
- if hasattr(self, 'status_reasons') and self.status_reasons is not None:
- status_reasons_list = []
- for v in self.status_reasons:
- if isinstance(v, dict):
- status_reasons_list.append(v)
- else:
- status_reasons_list.append(v.to_dict())
- _dict['status_reasons'] = status_reasons_list
- if hasattr(self, 'local_cidrs') and self.local_cidrs is not None:
- _dict['local_cidrs'] = self.local_cidrs
- if hasattr(self, 'peer_cidrs') and self.peer_cidrs is not None:
- _dict['peer_cidrs'] = self.peer_cidrs
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
return _dict
def _to_dict(self):
@@ -120250,179 +136476,151 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this VPNGatewayConnectionPolicyMode object."""
+ """Return a `str` version of this EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityProviderInfrastructureServiceIdentityByName object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VPNGatewayConnectionPolicyMode') -> bool:
+ def __eq__(self, other: 'EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityProviderInfrastructureServiceIdentityByName') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'VPNGatewayConnectionPolicyMode') -> bool:
+ def __ne__(self, other: 'EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityProviderInfrastructureServiceIdentityByName') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class AuthenticationModeEnum(str, Enum):
+ class ResourceTypeEnum(str, Enum):
"""
- The authentication mode. Only `psk` is currently supported.
+ The type of target for this endpoint gateway.
"""
- PSK = 'psk'
+ PROVIDER_CLOUD_SERVICE = 'provider_cloud_service'
+ PROVIDER_INFRASTRUCTURE_SERVICE = 'provider_infrastructure_service'
- class ModeEnum(str, Enum):
- """
- The mode of the VPN gateway.
- """
- POLICY = 'policy'
- ROUTE = 'route'
+class FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref(FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentity):
+ """
+ FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref.
+ :param str href: The URL for this bare metal server network interface.
+ If this bare metal server has network attachments, this network interface is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment.
+ """
- class ResourceTypeEnum(str, Enum):
+ def __init__(
+ self,
+ href: str,
+ ) -> None:
"""
- The resource type.
+ Initialize a FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref object.
+
+ :param str href: The URL for this bare metal server network interface.
+ If this bare metal server has network attachments, this network interface
+ is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment.
"""
+ # pylint: disable=super-init-not-called
+ self.href = href
- VPN_GATEWAY_CONNECTION = 'vpn_gateway_connection'
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref':
+ """Initialize a FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref object from a json dictionary."""
+ args = {}
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
+ else:
+ raise ValueError('Required property \'href\' not present in FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref JSON')
+ return cls(**args)
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref object from a json dictionary."""
+ return cls.from_dict(_dict)
- class StatusEnum(str, Enum):
- """
- The status of a VPN gateway connection.
- """
+ 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
- DOWN = 'down'
- UP = 'up'
+ def _to_dict(self):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
+
+ def __str__(self) -> str:
+ """Return a `str` version of this FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+ def __ne__(self, other: 'FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
-class VPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype(VPNGatewayConnectionPrototype):
+class FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityById(FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentity):
"""
- VPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype.
+ FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityById.
- :attr bool admin_state_up: (optional) If set to false, the VPN gateway
- connection is shut down.
- :attr VPNGatewayConnectionDPDPrototype dead_peer_detection: (optional)
- :attr VPNGatewayConnectionIKEPolicyPrototype ike_policy: (optional)
- :attr VPNGatewayConnectionIPsecPolicyPrototype ipsec_policy: (optional)
- :attr str name: (optional) The name for this VPN gateway connection. The name
- must not be used by another connection for the VPN gateway. If unspecified, the
- name will be a hyphenated list of randomly-selected words.
- :attr str peer_address: The IP address of the peer VPN gateway.
- :attr str psk: The pre-shared key.
- :attr List[str] local_cidrs: The local CIDRs for this resource.
- :attr List[str] peer_cidrs: The peer CIDRs for this resource.
+ :param str id: The unique identifier for this bare metal server network
+ interface.
+ If this bare metal server has network attachments, this network interface is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and the identifier is that of the corresponding network attachment.
"""
def __init__(
self,
- peer_address: str,
- psk: str,
- local_cidrs: List[str],
- peer_cidrs: List[str],
- *,
- admin_state_up: bool = None,
- dead_peer_detection: 'VPNGatewayConnectionDPDPrototype' = None,
- ike_policy: 'VPNGatewayConnectionIKEPolicyPrototype' = None,
- ipsec_policy: 'VPNGatewayConnectionIPsecPolicyPrototype' = None,
- name: str = None,
+ id: str,
) -> None:
"""
- Initialize a VPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype object.
+ Initialize a FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityById object.
- :param str peer_address: The IP address of the peer VPN gateway.
- :param str psk: The pre-shared key.
- :param List[str] local_cidrs: The local CIDRs for this resource.
- :param List[str] peer_cidrs: The peer CIDRs for this resource.
- :param bool admin_state_up: (optional) If set to false, the VPN gateway
- connection is shut down.
- :param VPNGatewayConnectionDPDPrototype dead_peer_detection: (optional)
- :param VPNGatewayConnectionIKEPolicyPrototype ike_policy: (optional)
- :param VPNGatewayConnectionIPsecPolicyPrototype ipsec_policy: (optional)
- :param str name: (optional) The name for this VPN gateway connection. The
- name must not be used by another connection for the VPN gateway. If
- unspecified, the name will be a hyphenated list of randomly-selected words.
+ :param str id: The unique identifier for this bare metal server network
+ interface.
+ If this bare metal server has network attachments, this network interface
+ is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and the identifier is that of the corresponding network
+ attachment.
"""
# pylint: disable=super-init-not-called
- self.admin_state_up = admin_state_up
- self.dead_peer_detection = dead_peer_detection
- self.ike_policy = ike_policy
- self.ipsec_policy = ipsec_policy
- self.name = name
- self.peer_address = peer_address
- self.psk = psk
- self.local_cidrs = local_cidrs
- self.peer_cidrs = peer_cidrs
+ self.id = id
@classmethod
- def from_dict(cls, _dict: Dict) -> 'VPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype':
- """Initialize a VPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityById':
+ """Initialize a FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityById object from a json dictionary."""
args = {}
- if 'admin_state_up' in _dict:
- args['admin_state_up'] = _dict.get('admin_state_up')
- if 'dead_peer_detection' in _dict:
- args['dead_peer_detection'] = VPNGatewayConnectionDPDPrototype.from_dict(_dict.get('dead_peer_detection'))
- if 'ike_policy' in _dict:
- args['ike_policy'] = _dict.get('ike_policy')
- if 'ipsec_policy' in _dict:
- args['ipsec_policy'] = _dict.get('ipsec_policy')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
- if 'peer_address' in _dict:
- args['peer_address'] = _dict.get('peer_address')
- else:
- raise ValueError('Required property \'peer_address\' not present in VPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype JSON')
- if 'psk' in _dict:
- args['psk'] = _dict.get('psk')
- else:
- raise ValueError('Required property \'psk\' not present in VPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype JSON')
- if 'local_cidrs' in _dict:
- args['local_cidrs'] = _dict.get('local_cidrs')
- else:
- raise ValueError('Required property \'local_cidrs\' not present in VPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype JSON')
- if 'peer_cidrs' in _dict:
- args['peer_cidrs'] = _dict.get('peer_cidrs')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
else:
- raise ValueError('Required property \'peer_cidrs\' not present in VPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype JSON')
+ raise ValueError('Required property \'id\' not present in FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityById JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype object from a json dictionary."""
+ """Initialize a FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityById object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'admin_state_up') and self.admin_state_up is not None:
- _dict['admin_state_up'] = self.admin_state_up
- if hasattr(self, 'dead_peer_detection') and self.dead_peer_detection is not None:
- if isinstance(self.dead_peer_detection, dict):
- _dict['dead_peer_detection'] = self.dead_peer_detection
- else:
- _dict['dead_peer_detection'] = self.dead_peer_detection.to_dict()
- if hasattr(self, 'ike_policy') and self.ike_policy is not None:
- if isinstance(self.ike_policy, dict):
- _dict['ike_policy'] = self.ike_policy
- else:
- _dict['ike_policy'] = self.ike_policy.to_dict()
- if hasattr(self, 'ipsec_policy') and self.ipsec_policy is not None:
- if isinstance(self.ipsec_policy, dict):
- _dict['ipsec_policy'] = self.ipsec_policy
- else:
- _dict['ipsec_policy'] = self.ipsec_policy.to_dict()
- if hasattr(self, 'name') and self.name is not None:
- _dict['name'] = self.name
- if hasattr(self, 'peer_address') and self.peer_address is not None:
- _dict['peer_address'] = self.peer_address
- if hasattr(self, 'psk') and self.psk is not None:
- _dict['psk'] = self.psk
- if hasattr(self, 'local_cidrs') and self.local_cidrs is not None:
- _dict['local_cidrs'] = self.local_cidrs
- if hasattr(self, 'peer_cidrs') and self.peer_cidrs is not None:
- _dict['peer_cidrs'] = self.peer_cidrs
+ if hasattr(self, 'id') and self.id is not None:
+ _dict['id'] = self.id
return _dict
def _to_dict(self):
@@ -120430,135 +136628,67 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this VPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype object."""
+ """Return a `str` version of this FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityById object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype') -> bool:
+ def __eq__(self, other: 'FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityById') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'VPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype') -> bool:
+ def __ne__(self, other: 'FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityById') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype(VPNGatewayConnectionPrototype):
+class FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByHref(FloatingIPTargetPatchNetworkInterfaceIdentity):
"""
- VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype.
+ FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByHref.
- :attr bool admin_state_up: (optional) If set to false, the VPN gateway
- connection is shut down.
- :attr VPNGatewayConnectionDPDPrototype dead_peer_detection: (optional)
- :attr VPNGatewayConnectionIKEPolicyPrototype ike_policy: (optional)
- :attr VPNGatewayConnectionIPsecPolicyPrototype ipsec_policy: (optional)
- :attr str name: (optional) The name for this VPN gateway connection. The name
- must not be used by another connection for the VPN gateway. If unspecified, the
- name will be a hyphenated list of randomly-selected words.
- :attr str peer_address: The IP address of the peer VPN gateway.
- :attr str psk: The pre-shared key.
- :attr str routing_protocol: (optional) Routing protocols are disabled for this
- VPN gateway connection.
+ :param str href: The URL for this instance network interface.
+ If this instance has network attachments, this network interface is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment.
"""
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,
- routing_protocol: str = None,
+ href: str,
) -> None:
"""
- Initialize a VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype object.
+ Initialize a FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByHref object.
- :param str peer_address: The IP address of the peer VPN gateway.
- :param str psk: The pre-shared key.
- :param bool admin_state_up: (optional) If set to false, the VPN gateway
- connection is shut down.
- :param VPNGatewayConnectionDPDPrototype dead_peer_detection: (optional)
- :param VPNGatewayConnectionIKEPolicyPrototype ike_policy: (optional)
- :param VPNGatewayConnectionIPsecPolicyPrototype ipsec_policy: (optional)
- :param str name: (optional) The name for this VPN gateway connection. The
- name must not be used by another connection for the VPN gateway. If
- unspecified, the name will be a hyphenated list of randomly-selected words.
- :param str routing_protocol: (optional) Routing protocols are disabled for
- this VPN gateway connection.
+ :param str href: The URL for this instance network interface.
+ If this instance has network attachments, this network interface is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment.
"""
# pylint: disable=super-init-not-called
- self.admin_state_up = admin_state_up
- self.dead_peer_detection = dead_peer_detection
- self.ike_policy = ike_policy
- self.ipsec_policy = ipsec_policy
- self.name = name
- self.peer_address = peer_address
- self.psk = psk
- self.routing_protocol = routing_protocol
+ self.href = href
@classmethod
- def from_dict(cls, _dict: Dict) -> 'VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype':
- """Initialize a VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByHref':
+ """Initialize a FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByHref object from a json dictionary."""
args = {}
- if 'admin_state_up' in _dict:
- args['admin_state_up'] = _dict.get('admin_state_up')
- if 'dead_peer_detection' in _dict:
- args['dead_peer_detection'] = VPNGatewayConnectionDPDPrototype.from_dict(_dict.get('dead_peer_detection'))
- if 'ike_policy' in _dict:
- args['ike_policy'] = _dict.get('ike_policy')
- if 'ipsec_policy' in _dict:
- args['ipsec_policy'] = _dict.get('ipsec_policy')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
- if 'peer_address' in _dict:
- args['peer_address'] = _dict.get('peer_address')
- else:
- raise ValueError('Required property \'peer_address\' not present in VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype JSON')
- if 'psk' in _dict:
- args['psk'] = _dict.get('psk')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'psk\' not present in VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype JSON')
- if 'routing_protocol' in _dict:
- args['routing_protocol'] = _dict.get('routing_protocol')
+ raise ValueError('Required property \'href\' not present in FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByHref JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype object from a json dictionary."""
+ """Initialize a FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByHref object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'admin_state_up') and self.admin_state_up is not None:
- _dict['admin_state_up'] = self.admin_state_up
- if hasattr(self, 'dead_peer_detection') and self.dead_peer_detection is not None:
- if isinstance(self.dead_peer_detection, dict):
- _dict['dead_peer_detection'] = self.dead_peer_detection
- else:
- _dict['dead_peer_detection'] = self.dead_peer_detection.to_dict()
- if hasattr(self, 'ike_policy') and self.ike_policy is not None:
- if isinstance(self.ike_policy, dict):
- _dict['ike_policy'] = self.ike_policy
- else:
- _dict['ike_policy'] = self.ike_policy.to_dict()
- if hasattr(self, 'ipsec_policy') and self.ipsec_policy is not None:
- if isinstance(self.ipsec_policy, dict):
- _dict['ipsec_policy'] = self.ipsec_policy
- else:
- _dict['ipsec_policy'] = self.ipsec_policy.to_dict()
- if hasattr(self, 'name') and self.name is not None:
- _dict['name'] = self.name
- if hasattr(self, 'peer_address') and self.peer_address is not None:
- _dict['peer_address'] = self.peer_address
- if hasattr(self, 'psk') and self.psk is not None:
- _dict['psk'] = self.psk
- if hasattr(self, 'routing_protocol') and self.routing_protocol is not None:
- _dict['routing_protocol'] = self.routing_protocol
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
return _dict
def _to_dict(self):
@@ -120566,319 +136696,70 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype object."""
+ """Return a `str` version of this FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByHref object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype') -> bool:
+ def __eq__(self, other: 'FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByHref') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype') -> bool:
+ def __ne__(self, other: 'FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByHref') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class RoutingProtocolEnum(str, Enum):
- """
- Routing protocols are disabled for this VPN gateway connection.
- """
-
- NONE = 'none'
-
-
-class VPNGatewayConnectionStaticRouteMode(VPNGatewayConnection):
+class FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityById(FloatingIPTargetPatchNetworkInterfaceIdentity):
"""
- VPNGatewayConnectionStaticRouteMode.
+ FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityById.
- :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:
- :attr str href: The VPN connection's canonical URL.
- :attr str id: The unique identifier for this VPN gateway connection.
- :attr IKEPolicyReference ike_policy: (optional) The IKE policy. If absent,
- [auto-negotiation is
- used](https://cloud.ibm.com/docs/vpc?topic=vpc-using-vpn&interface=ui#ike-auto-negotiation-phase-1).
- :attr IPsecPolicyReference ipsec_policy: (optional) The IPsec policy. If absent,
- [auto-negotiation is
- used](https://cloud.ibm.com/docs/vpc?topic=vpc-using-vpn&interface=ui#ipsec-auto-negotiation-phase-2).
- :attr str mode: The mode of the VPN gateway.
- :attr str name: The name for this VPN gateway connection. The name is unique
- across all connections for the VPN gateway.
- :attr str peer_address: The IP address of the peer VPN gateway.
- :attr str psk: The pre-shared key.
- :attr str resource_type: The resource type.
- :attr str status: The status of a VPN gateway connection.
- :attr List[VPNGatewayConnectionStatusReason] status_reasons: The reasons for the
- current VPN gateway connection status (if any):
- - `cannot_authenticate_connection`: Failed to authenticate a connection because
- of
- mismatched IKE ID and PSK (check IKE ID and PSK in peer VPN configuration)
- - `internal_error`: Internal error (contact IBM support)
- - `ike_policy_mismatch`: None of the proposed IKE crypto suites was acceptable
- (check
- the IKE policies on both sides of the VPN)
- - `ike_v1_id_local_remote_cidr_mismatch`: Invalid IKE ID or mismatched local
- CIDRs and
- remote CIDRs in IKE V1 (check the IKE ID or the local CIDRs and remote CIDRs
- in IKE
- V1 configuration)
- - `ike_v2_local_remote_cidr_mismatch`: Mismatched local CIDRs and remote CIDRs
- in IKE
- V2 (check the local CIDRs and remote CIDRs in IKE V2 configuration)
- - `ipsec_policy_mismatch`: None of the proposed IPsec crypto suites was
- acceptable
- (check the IPsec policies on both sides of the VPN)
- - `peer_not_responding`: No response from peer (check network ACL configuration,
- peer
- availability, and on-premise firewall configuration)
- 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 routing_protocol: Routing protocols are disabled for this VPN gateway
- connection.
- :attr List[VPNGatewayConnectionStaticRouteModeTunnel] tunnels: The VPN tunnel
- configuration for this VPN gateway connection (in static route mode).
+ :param str id: The unique identifier for this instance network interface.
+ If this instance has network attachments, this network interface is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and the identifier is that of the corresponding network attachment.
"""
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,
- status_reasons: List['VPNGatewayConnectionStatusReason'],
- routing_protocol: str,
- tunnels: List['VPNGatewayConnectionStaticRouteModeTunnel'],
- *,
- ike_policy: 'IKEPolicyReference' = None,
- ipsec_policy: 'IPsecPolicyReference' = None,
) -> None:
"""
- Initialize a VPNGatewayConnectionStaticRouteMode object.
+ Initialize a FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityById 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:
- :param str href: The VPN connection's canonical URL.
- :param str id: The unique identifier for this VPN gateway connection.
- :param str mode: The mode of the VPN gateway.
- :param str name: The name for this VPN gateway connection. The name is
- unique across all connections for the VPN gateway.
- :param str peer_address: The IP address of the peer VPN gateway.
- :param str psk: The pre-shared key.
- :param str resource_type: The resource type.
- :param str status: The status of a VPN gateway connection.
- :param List[VPNGatewayConnectionStatusReason] status_reasons: The reasons
- for the current VPN gateway connection status (if any):
- - `cannot_authenticate_connection`: Failed to authenticate a connection
- because of
- mismatched IKE ID and PSK (check IKE ID and PSK in peer VPN
- configuration)
- - `internal_error`: Internal error (contact IBM support)
- - `ike_policy_mismatch`: None of the proposed IKE crypto suites was
- acceptable (check
- the IKE policies on both sides of the VPN)
- - `ike_v1_id_local_remote_cidr_mismatch`: Invalid IKE ID or mismatched
- local CIDRs and
- remote CIDRs in IKE V1 (check the IKE ID or the local CIDRs and remote
- CIDRs in IKE
- V1 configuration)
- - `ike_v2_local_remote_cidr_mismatch`: Mismatched local CIDRs and remote
- CIDRs in IKE
- V2 (check the local CIDRs and remote CIDRs in IKE V2 configuration)
- - `ipsec_policy_mismatch`: None of the proposed IPsec crypto suites was
- acceptable
- (check the IPsec policies on both sides of the VPN)
- - `peer_not_responding`: No response from peer (check network ACL
- configuration, peer
- availability, and on-premise firewall configuration)
- 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 routing_protocol: Routing protocols are disabled for this VPN
- gateway connection.
- :param List[VPNGatewayConnectionStaticRouteModeTunnel] tunnels: The VPN
- tunnel configuration for this VPN gateway connection (in static route
- mode).
- :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).
+ :param str id: The unique identifier for this instance network interface.
+ If this instance has network attachments, this network interface is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and the identifier is that of the corresponding network
+ attachment.
"""
# pylint: disable=super-init-not-called
- self.admin_state_up = admin_state_up
- self.authentication_mode = authentication_mode
- self.created_at = created_at
- self.dead_peer_detection = dead_peer_detection
- self.href = href
self.id = id
- self.ike_policy = ike_policy
- self.ipsec_policy = ipsec_policy
- self.mode = mode
- self.name = name
- self.peer_address = peer_address
- self.psk = psk
- self.resource_type = resource_type
- self.status = status
- self.status_reasons = status_reasons
- self.routing_protocol = routing_protocol
- self.tunnels = tunnels
@classmethod
- def from_dict(cls, _dict: Dict) -> 'VPNGatewayConnectionStaticRouteMode':
- """Initialize a VPNGatewayConnectionStaticRouteMode object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityById':
+ """Initialize a FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityById object from a json dictionary."""
args = {}
- if 'admin_state_up' in _dict:
- args['admin_state_up'] = _dict.get('admin_state_up')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
else:
- raise ValueError('Required property \'admin_state_up\' not present in VPNGatewayConnectionStaticRouteMode JSON')
- if 'authentication_mode' in _dict:
- args['authentication_mode'] = _dict.get('authentication_mode')
- else:
- raise ValueError('Required property \'authentication_mode\' not present in VPNGatewayConnectionStaticRouteMode 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 VPNGatewayConnectionStaticRouteMode JSON')
- if 'dead_peer_detection' in _dict:
- args['dead_peer_detection'] = VPNGatewayConnectionDPD.from_dict(_dict.get('dead_peer_detection'))
- else:
- raise ValueError('Required property \'dead_peer_detection\' not present in VPNGatewayConnectionStaticRouteMode JSON')
- if 'href' in _dict:
- args['href'] = _dict.get('href')
- else:
- raise ValueError('Required property \'href\' not present in VPNGatewayConnectionStaticRouteMode JSON')
- if 'id' in _dict:
- args['id'] = _dict.get('id')
- else:
- raise ValueError('Required property \'id\' not present in VPNGatewayConnectionStaticRouteMode JSON')
- if 'ike_policy' in _dict:
- args['ike_policy'] = IKEPolicyReference.from_dict(_dict.get('ike_policy'))
- if 'ipsec_policy' in _dict:
- args['ipsec_policy'] = IPsecPolicyReference.from_dict(_dict.get('ipsec_policy'))
- if 'mode' in _dict:
- args['mode'] = _dict.get('mode')
- else:
- raise ValueError('Required property \'mode\' not present in VPNGatewayConnectionStaticRouteMode JSON')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
- else:
- raise ValueError('Required property \'name\' not present in VPNGatewayConnectionStaticRouteMode JSON')
- if 'peer_address' in _dict:
- args['peer_address'] = _dict.get('peer_address')
- else:
- raise ValueError('Required property \'peer_address\' not present in VPNGatewayConnectionStaticRouteMode JSON')
- if 'psk' in _dict:
- args['psk'] = _dict.get('psk')
- else:
- raise ValueError('Required property \'psk\' not present in VPNGatewayConnectionStaticRouteMode JSON')
- if 'resource_type' in _dict:
- args['resource_type'] = _dict.get('resource_type')
- else:
- raise ValueError('Required property \'resource_type\' not present in VPNGatewayConnectionStaticRouteMode JSON')
- if 'status' in _dict:
- args['status'] = _dict.get('status')
- else:
- raise ValueError('Required property \'status\' not present in VPNGatewayConnectionStaticRouteMode JSON')
- if 'status_reasons' in _dict:
- args['status_reasons'] = [VPNGatewayConnectionStatusReason.from_dict(v) for v in _dict.get('status_reasons')]
- else:
- raise ValueError('Required property \'status_reasons\' not present in VPNGatewayConnectionStaticRouteMode JSON')
- if 'routing_protocol' in _dict:
- args['routing_protocol'] = _dict.get('routing_protocol')
- else:
- raise ValueError('Required property \'routing_protocol\' not present in VPNGatewayConnectionStaticRouteMode JSON')
- if 'tunnels' in _dict:
- args['tunnels'] = [VPNGatewayConnectionStaticRouteModeTunnel.from_dict(v) for v in _dict.get('tunnels')]
- else:
- raise ValueError('Required property \'tunnels\' not present in VPNGatewayConnectionStaticRouteMode JSON')
+ raise ValueError('Required property \'id\' not present in FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityById JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VPNGatewayConnectionStaticRouteMode object from a json dictionary."""
+ """Initialize a FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityById object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'admin_state_up') and self.admin_state_up is not None:
- _dict['admin_state_up'] = self.admin_state_up
- if hasattr(self, 'authentication_mode') and self.authentication_mode is not None:
- _dict['authentication_mode'] = self.authentication_mode
- if hasattr(self, 'created_at') and self.created_at is not None:
- _dict['created_at'] = datetime_to_string(self.created_at)
- if hasattr(self, 'dead_peer_detection') and self.dead_peer_detection is not None:
- if isinstance(self.dead_peer_detection, dict):
- _dict['dead_peer_detection'] = self.dead_peer_detection
- else:
- _dict['dead_peer_detection'] = self.dead_peer_detection.to_dict()
- if hasattr(self, 'href') and self.href is not None:
- _dict['href'] = self.href
if hasattr(self, 'id') and self.id is not None:
_dict['id'] = self.id
- if hasattr(self, 'ike_policy') and self.ike_policy is not None:
- if isinstance(self.ike_policy, dict):
- _dict['ike_policy'] = self.ike_policy
- else:
- _dict['ike_policy'] = self.ike_policy.to_dict()
- if hasattr(self, 'ipsec_policy') and self.ipsec_policy is not None:
- if isinstance(self.ipsec_policy, dict):
- _dict['ipsec_policy'] = self.ipsec_policy
- else:
- _dict['ipsec_policy'] = self.ipsec_policy.to_dict()
- if hasattr(self, 'mode') and self.mode is not None:
- _dict['mode'] = self.mode
- if hasattr(self, 'name') and self.name is not None:
- _dict['name'] = self.name
- if hasattr(self, 'peer_address') and self.peer_address is not None:
- _dict['peer_address'] = self.peer_address
- if hasattr(self, 'psk') and self.psk is not None:
- _dict['psk'] = self.psk
- if hasattr(self, 'resource_type') and self.resource_type is not None:
- _dict['resource_type'] = self.resource_type
- if hasattr(self, 'status') and self.status is not None:
- _dict['status'] = self.status
- if hasattr(self, 'status_reasons') and self.status_reasons is not None:
- status_reasons_list = []
- for v in self.status_reasons:
- if isinstance(v, dict):
- status_reasons_list.append(v)
- else:
- status_reasons_list.append(v.to_dict())
- _dict['status_reasons'] = status_reasons_list
- if hasattr(self, 'routing_protocol') and self.routing_protocol is not None:
- _dict['routing_protocol'] = self.routing_protocol
- if hasattr(self, 'tunnels') and self.tunnels is not None:
- tunnels_list = []
- for v in self.tunnels:
- if isinstance(v, dict):
- tunnels_list.append(v)
- else:
- tunnels_list.append(v.to_dict())
- _dict['tunnels'] = tunnels_list
return _dict
def _to_dict(self):
@@ -120886,343 +136767,248 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this VPNGatewayConnectionStaticRouteMode object."""
+ """Return a `str` version of this FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityById object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityById') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityById') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+
+class FloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN(FloatingIPTargetPatchVirtualNetworkInterfaceIdentity):
+ """
+ FloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN.
+
+ :param str crn: The CRN for this virtual network interface.
+ """
+
+ def __init__(
+ self,
+ crn: str,
+ ) -> None:
+ """
+ Initialize a FloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN object.
+
+ :param str crn: The CRN for this virtual network interface.
+ """
+ # pylint: disable=super-init-not-called
+ self.crn = crn
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'FloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN':
+ """Initialize a FloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN object from a json dictionary."""
+ args = {}
+ if (crn := _dict.get('crn')) is not None:
+ args['crn'] = crn
+ else:
+ raise ValueError('Required property \'crn\' not present in FloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a FloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN object from 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 FloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VPNGatewayConnectionStaticRouteMode') -> bool:
+ def __eq__(self, other: 'FloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'VPNGatewayConnectionStaticRouteMode') -> bool:
+ def __ne__(self, other: 'FloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class AuthenticationModeEnum(str, Enum):
- """
- The authentication mode. Only `psk` is currently supported.
- """
- PSK = 'psk'
+class FloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref(FloatingIPTargetPatchVirtualNetworkInterfaceIdentity):
+ """
+ FloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref.
+ :param str href: The URL for this virtual network interface.
+ """
- class ModeEnum(str, Enum):
+ def __init__(
+ self,
+ href: str,
+ ) -> None:
"""
- The mode of the VPN gateway.
+ Initialize a FloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref object.
+
+ :param str href: The URL for this virtual network interface.
"""
+ # pylint: disable=super-init-not-called
+ self.href = href
- POLICY = 'policy'
- ROUTE = 'route'
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'FloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref':
+ """Initialize a FloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref object from a json dictionary."""
+ args = {}
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
+ else:
+ raise ValueError('Required property \'href\' not present in FloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref JSON')
+ return cls(**args)
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a FloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref object from a json dictionary."""
+ return cls.from_dict(_dict)
- class ResourceTypeEnum(str, Enum):
- """
- The resource type.
- """
+ 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
- VPN_GATEWAY_CONNECTION = 'vpn_gateway_connection'
+ def _to_dict(self):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
+ def __str__(self) -> str:
+ """Return a `str` version of this FloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref object."""
+ return json.dumps(self.to_dict(), indent=2)
- class StatusEnum(str, Enum):
- """
- The status of a VPN gateway connection.
- """
+ def __eq__(self, other: 'FloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
- DOWN = 'down'
- UP = 'up'
+ def __ne__(self, other: 'FloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
- class RoutingProtocolEnum(str, Enum):
+class FloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById(FloatingIPTargetPatchVirtualNetworkInterfaceIdentity):
+ """
+ FloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById.
+
+ :param str id: The unique identifier for this virtual network interface.
+ """
+
+ def __init__(
+ self,
+ id: str,
+ ) -> None:
"""
- Routing protocols are disabled for this VPN gateway connection.
+ Initialize a FloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById object.
+
+ :param str id: The unique identifier for this virtual network interface.
"""
+ # pylint: disable=super-init-not-called
+ self.id = id
- NONE = 'none'
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'FloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById':
+ """Initialize a FloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById object from a json dictionary."""
+ args = {}
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
+ else:
+ raise ValueError('Required property \'id\' not present in FloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById JSON')
+ return cls(**args)
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a FloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById object from a json dictionary."""
+ return cls.from_dict(_dict)
+ def to_dict(self) -> Dict:
+ """Return a json dictionary representing this model."""
+ _dict = {}
+ if hasattr(self, 'id') and self.id is not None:
+ _dict['id'] = self.id
+ return _dict
-class VPNGatewayPolicyMode(VPNGateway):
+ def _to_dict(self):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
+
+ def __str__(self) -> str:
+ """Return a `str` version of this FloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'FloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'FloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+
+class FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref(FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentity):
"""
- VPNGatewayPolicyMode.
+ FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref.
- :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 List[VPNGatewayHealthReason] health_reasons: The reasons for the current
- VPN gateway health_state (if any):
- - `cannot_create_vpc_route`: VPN cannot create route (check for conflict)
- - `cannot_reserve_ip_address`: IP address exhaustion (release addresses on the
- VPN's
- subnet)
- - `internal_error`: Internal error (contact IBM support)
- The enumerated reason code values for this property will expand in the future.
- When processing this property, check for and log unknown values. Optionally halt
- processing and surface the error, or bypass the resource on which the unexpected
- reason code was encountered.
- :attr str health_state: The health of this resource.
- - `ok`: No abnormal behavior detected
- - `degraded`: Experiencing compromised performance, capacity, or connectivity
- - `faulted`: Completely unreachable, inoperative, or otherwise entirely
- incapacitated
- - `inapplicable`: The health state does not apply because of the current
- lifecycle state. A resource with a lifecycle state of `failed` or `deleting`
- will have a health state of `inapplicable`. A `pending` resource may also have
- this state.
- :attr str href: The VPN gateway's canonical URL.
- :attr str id: The unique identifier for this VPN gateway.
- :attr List[VPNGatewayLifecycleReason] lifecycle_reasons: The reasons for the
- current VPN gateway lifecycle_state (if any):
- - `resource_suspended_by_provider`: The resource has been suspended (contact IBM
- support)
- The enumerated reason code values for this property will expand in the future.
- When processing this property, check for and log unknown values. Optionally halt
- processing and surface the error, or bypass the resource on which the unexpected
- reason code was encountered.
- :attr str lifecycle_state: The lifecycle state of the VPN gateway.
- :attr List[VPNGatewayMember] members: Collection of VPN gateway members.
- :attr str name: The name for this VPN gateway. The name is unique across all VPN
- gateways in the VPC.
- :attr ResourceGroupReference resource_group: The resource group for this VPN
- gateway.
- :attr str resource_type: The resource type.
- :attr SubnetReference subnet:
- :attr VPCReference vpc: The VPC this VPN gateway resides in.
- :attr str mode: Policy mode VPN gateway.
+ :param str href: The URL for this bare metal server network interface.
+ If this bare metal server has network attachments, this network interface is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment.
"""
def __init__(
self,
- connections: List['VPNGatewayConnectionReference'],
- created_at: datetime,
- crn: str,
- health_reasons: List['VPNGatewayHealthReason'],
- health_state: str,
href: str,
- id: str,
- lifecycle_reasons: List['VPNGatewayLifecycleReason'],
- lifecycle_state: str,
- members: List['VPNGatewayMember'],
- name: str,
- resource_group: 'ResourceGroupReference',
- resource_type: str,
- subnet: 'SubnetReference',
- vpc: 'VPCReference',
- mode: str,
) -> None:
"""
- Initialize a VPNGatewayPolicyMode object.
+ Initialize a FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref 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 List[VPNGatewayHealthReason] health_reasons: The reasons for the
- current VPN gateway health_state (if any):
- - `cannot_create_vpc_route`: VPN cannot create route (check for conflict)
- - `cannot_reserve_ip_address`: IP address exhaustion (release addresses on
- the VPN's
- subnet)
- - `internal_error`: Internal error (contact IBM support)
- The enumerated reason code values for this property will expand in the
- future. When processing this property, check for and log unknown values.
- Optionally halt processing and surface the error, or bypass the resource on
- which the unexpected reason code was encountered.
- :param str health_state: The health of this resource.
- - `ok`: No abnormal behavior detected
- - `degraded`: Experiencing compromised performance, capacity, or
- connectivity
- - `faulted`: Completely unreachable, inoperative, or otherwise entirely
- incapacitated
- - `inapplicable`: The health state does not apply because of the current
- lifecycle state. A resource with a lifecycle state of `failed` or
- `deleting` will have a health state of `inapplicable`. A `pending` resource
- may also have this state.
- :param str href: The VPN gateway's canonical URL.
- :param str id: The unique identifier for this VPN gateway.
- :param List[VPNGatewayLifecycleReason] lifecycle_reasons: The reasons for
- the current VPN gateway lifecycle_state (if any):
- - `resource_suspended_by_provider`: The resource has been suspended
- (contact IBM
- support)
- The enumerated reason code values for this property will expand in the
- future. When processing this property, check for and log unknown values.
- Optionally halt processing and surface the error, or bypass the resource on
- which the unexpected reason code was encountered.
- :param str lifecycle_state: The lifecycle state of the VPN gateway.
- :param List[VPNGatewayMember] members: Collection of VPN gateway members.
- :param str name: The name for this VPN gateway. The name is unique across
- all VPN gateways in the VPC.
- :param ResourceGroupReference resource_group: The resource group for this
- VPN gateway.
- :param str resource_type: The resource type.
- :param SubnetReference subnet:
- :param VPCReference vpc: The VPC this VPN gateway resides in.
- :param str mode: Policy mode VPN gateway.
+ :param str href: The URL for this bare metal server network interface.
+ If this bare metal server has network attachments, this network interface
+ is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment.
"""
# pylint: disable=super-init-not-called
- self.connections = connections
- self.created_at = created_at
- self.crn = crn
- self.health_reasons = health_reasons
- self.health_state = health_state
self.href = href
- self.id = id
- self.lifecycle_reasons = lifecycle_reasons
- self.lifecycle_state = lifecycle_state
- self.members = members
- self.name = name
- self.resource_group = resource_group
- self.resource_type = resource_type
- self.subnet = subnet
- self.vpc = vpc
- self.mode = mode
@classmethod
- def from_dict(cls, _dict: Dict) -> 'VPNGatewayPolicyMode':
- """Initialize a VPNGatewayPolicyMode object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref':
+ """Initialize a FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref object from a json dictionary."""
args = {}
- if 'connections' in _dict:
- args['connections'] = [VPNGatewayConnectionReference.from_dict(v) for v in _dict.get('connections')]
- else:
- raise ValueError('Required property \'connections\' not present in VPNGatewayPolicyMode 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 VPNGatewayPolicyMode JSON')
- if 'crn' in _dict:
- args['crn'] = _dict.get('crn')
- else:
- raise ValueError('Required property \'crn\' not present in VPNGatewayPolicyMode JSON')
- if 'health_reasons' in _dict:
- args['health_reasons'] = [VPNGatewayHealthReason.from_dict(v) for v in _dict.get('health_reasons')]
- else:
- raise ValueError('Required property \'health_reasons\' not present in VPNGatewayPolicyMode JSON')
- if 'health_state' in _dict:
- args['health_state'] = _dict.get('health_state')
- else:
- raise ValueError('Required property \'health_state\' not present in VPNGatewayPolicyMode JSON')
- if 'href' in _dict:
- args['href'] = _dict.get('href')
- else:
- raise ValueError('Required property \'href\' not present in VPNGatewayPolicyMode JSON')
- if 'id' in _dict:
- args['id'] = _dict.get('id')
- else:
- raise ValueError('Required property \'id\' not present in VPNGatewayPolicyMode JSON')
- if 'lifecycle_reasons' in _dict:
- args['lifecycle_reasons'] = [VPNGatewayLifecycleReason.from_dict(v) for v in _dict.get('lifecycle_reasons')]
- else:
- raise ValueError('Required property \'lifecycle_reasons\' not present in VPNGatewayPolicyMode JSON')
- if 'lifecycle_state' in _dict:
- args['lifecycle_state'] = _dict.get('lifecycle_state')
- else:
- raise ValueError('Required property \'lifecycle_state\' not present in VPNGatewayPolicyMode JSON')
- if 'members' in _dict:
- args['members'] = [VPNGatewayMember.from_dict(v) for v in _dict.get('members')]
- else:
- raise ValueError('Required property \'members\' not present in VPNGatewayPolicyMode JSON')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
- else:
- raise ValueError('Required property \'name\' not present in VPNGatewayPolicyMode 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 VPNGatewayPolicyMode JSON')
- if 'resource_type' in _dict:
- args['resource_type'] = _dict.get('resource_type')
- else:
- raise ValueError('Required property \'resource_type\' not present in VPNGatewayPolicyMode JSON')
- if 'subnet' in _dict:
- args['subnet'] = SubnetReference.from_dict(_dict.get('subnet'))
- else:
- raise ValueError('Required property \'subnet\' not present in VPNGatewayPolicyMode JSON')
- if 'vpc' in _dict:
- args['vpc'] = VPCReference.from_dict(_dict.get('vpc'))
- else:
- raise ValueError('Required property \'vpc\' not present in VPNGatewayPolicyMode JSON')
- if 'mode' in _dict:
- args['mode'] = _dict.get('mode')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'mode\' not present in VPNGatewayPolicyMode JSON')
+ raise ValueError('Required property \'href\' not present in FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VPNGatewayPolicyMode object from a json dictionary."""
+ """Initialize a FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'connections') and self.connections is not None:
- connections_list = []
- for v in self.connections:
- if isinstance(v, dict):
- connections_list.append(v)
- else:
- connections_list.append(v.to_dict())
- _dict['connections'] = connections_list
- if hasattr(self, 'created_at') and self.created_at is not None:
- _dict['created_at'] = datetime_to_string(self.created_at)
- if hasattr(self, 'crn') and self.crn is not None:
- _dict['crn'] = self.crn
- if hasattr(self, 'health_reasons') and self.health_reasons is not None:
- health_reasons_list = []
- for v in self.health_reasons:
- if isinstance(v, dict):
- health_reasons_list.append(v)
- else:
- health_reasons_list.append(v.to_dict())
- _dict['health_reasons'] = health_reasons_list
- if hasattr(self, 'health_state') and self.health_state is not None:
- _dict['health_state'] = self.health_state
if hasattr(self, 'href') and self.href is not None:
_dict['href'] = self.href
- if hasattr(self, 'id') and self.id is not None:
- _dict['id'] = self.id
- if hasattr(self, 'lifecycle_reasons') and self.lifecycle_reasons is not None:
- lifecycle_reasons_list = []
- for v in self.lifecycle_reasons:
- if isinstance(v, dict):
- lifecycle_reasons_list.append(v)
- else:
- lifecycle_reasons_list.append(v.to_dict())
- _dict['lifecycle_reasons'] = lifecycle_reasons_list
- if hasattr(self, 'lifecycle_state') and self.lifecycle_state is not None:
- _dict['lifecycle_state'] = self.lifecycle_state
- if hasattr(self, 'members') and self.members is not None:
- members_list = []
- for v in self.members:
- if isinstance(v, dict):
- members_list.append(v)
- else:
- members_list.append(v.to_dict())
- _dict['members'] = members_list
- if hasattr(self, 'name') and self.name is not None:
- _dict['name'] = self.name
- if hasattr(self, 'resource_group') and self.resource_group is not None:
- if isinstance(self.resource_group, dict):
- _dict['resource_group'] = self.resource_group
- else:
- _dict['resource_group'] = self.resource_group.to_dict()
- if hasattr(self, 'resource_type') and self.resource_type is not None:
- _dict['resource_type'] = self.resource_type
- if hasattr(self, '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, 'vpc') and self.vpc is not None:
- if isinstance(self.vpc, dict):
- _dict['vpc'] = self.vpc
- else:
- _dict['vpc'] = self.vpc.to_dict()
- if hasattr(self, 'mode') and self.mode is not None:
- _dict['mode'] = self.mode
return _dict
def _to_dict(self):
@@ -121230,142 +137016,141 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this VPNGatewayPolicyMode object."""
+ """Return a `str` version of this FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VPNGatewayPolicyMode') -> bool:
+ def __eq__(self, other: 'FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'VPNGatewayPolicyMode') -> bool:
+ def __ne__(self, other: 'FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class HealthStateEnum(str, Enum):
- """
- The health of this resource.
- - `ok`: No abnormal behavior detected
- - `degraded`: Experiencing compromised performance, capacity, or connectivity
- - `faulted`: Completely unreachable, inoperative, or otherwise entirely
- incapacitated
- - `inapplicable`: The health state does not apply because of the current lifecycle
- state. A resource with a lifecycle state of `failed` or `deleting` will have a
- health state of `inapplicable`. A `pending` resource may also have this state.
- """
- DEGRADED = 'degraded'
- FAULTED = 'faulted'
- INAPPLICABLE = 'inapplicable'
- OK = 'ok'
+class FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityById(FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentity):
+ """
+ FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityById.
+ :param str id: The unique identifier for this bare metal server network
+ interface.
+ If this bare metal server has network attachments, this network interface is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and the identifier is that of the corresponding network attachment.
+ """
- class LifecycleStateEnum(str, Enum):
- """
- The lifecycle state of the VPN gateway.
+ def __init__(
+ self,
+ id: str,
+ ) -> None:
"""
+ Initialize a FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityById object.
- DELETING = 'deleting'
- FAILED = 'failed'
- PENDING = 'pending'
- STABLE = 'stable'
- SUSPENDED = 'suspended'
- UPDATING = 'updating'
- WAITING = 'waiting'
+ :param str id: The unique identifier for this bare metal server network
+ interface.
+ If this bare metal server has network attachments, this network interface
+ is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and the identifier is that of the corresponding network
+ attachment.
+ """
+ # pylint: disable=super-init-not-called
+ self.id = id
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityById':
+ """Initialize a FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityById object from a json dictionary."""
+ args = {}
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
+ else:
+ raise ValueError('Required property \'id\' not present in FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityById JSON')
+ return cls(**args)
- class ResourceTypeEnum(str, Enum):
- """
- The resource type.
- """
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityById object from a json dictionary."""
+ return cls.from_dict(_dict)
- VPN_GATEWAY = 'vpn_gateway'
+ 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()
- class ModeEnum(str, Enum):
- """
- Policy mode VPN gateway.
- """
+ def __str__(self) -> str:
+ """Return a `str` version of this FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityById object."""
+ return json.dumps(self.to_dict(), indent=2)
- POLICY = 'policy'
+ def __eq__(self, other: 'FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityById') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+ def __ne__(self, other: 'FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityById') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
-class VPNGatewayPrototypeVPNGatewayPolicyModePrototype(VPNGatewayPrototype):
+class FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref(FloatingIPTargetPrototypeNetworkInterfaceIdentity):
"""
- VPNGatewayPrototypeVPNGatewayPolicyModePrototype.
+ FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref.
- :attr str name: (optional) The name for this VPN gateway. The name must not be
- used by another VPN gateway in the VPC. If unspecified, the name will be a
- hyphenated list of randomly-selected words.
- :attr ResourceGroupIdentity resource_group: (optional)
- :attr SubnetIdentity subnet:
- :attr str mode: (optional) Policy mode VPN gateway.
+ :param str href: The URL for this instance network interface.
+ If this instance has network attachments, this network interface is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment.
"""
def __init__(
self,
- subnet: 'SubnetIdentity',
- *,
- name: str = None,
- resource_group: 'ResourceGroupIdentity' = None,
- mode: str = None,
+ href: str,
) -> None:
"""
- Initialize a VPNGatewayPrototypeVPNGatewayPolicyModePrototype object.
+ Initialize a FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref object.
- :param SubnetIdentity subnet:
- :param str name: (optional) The name for this VPN gateway. The name must
- not be used by another VPN gateway in the VPC. If unspecified, the name
- will be a hyphenated list of randomly-selected words.
- :param ResourceGroupIdentity resource_group: (optional)
- :param str mode: (optional) Policy mode VPN gateway.
+ :param str href: The URL for this instance network interface.
+ If this instance has network attachments, this network interface is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment.
"""
# pylint: disable=super-init-not-called
- self.name = name
- self.resource_group = resource_group
- self.subnet = subnet
- self.mode = mode
+ self.href = href
@classmethod
- def from_dict(cls, _dict: Dict) -> 'VPNGatewayPrototypeVPNGatewayPolicyModePrototype':
- """Initialize a VPNGatewayPrototypeVPNGatewayPolicyModePrototype object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref':
+ """Initialize a FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref 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 'subnet' in _dict:
- args['subnet'] = _dict.get('subnet')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'subnet\' not present in VPNGatewayPrototypeVPNGatewayPolicyModePrototype JSON')
- if 'mode' in _dict:
- args['mode'] = _dict.get('mode')
+ raise ValueError('Required property \'href\' not present in FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VPNGatewayPrototypeVPNGatewayPolicyModePrototype object from a json dictionary."""
+ """Initialize a FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref object from 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, '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, 'mode') and self.mode is not None:
- _dict['mode'] = self.mode
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
return _dict
def _to_dict(self):
@@ -121373,102 +137158,130 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this VPNGatewayPrototypeVPNGatewayPolicyModePrototype object."""
+ """Return a `str` version of this FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VPNGatewayPrototypeVPNGatewayPolicyModePrototype') -> bool:
+ def __eq__(self, other: 'FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'VPNGatewayPrototypeVPNGatewayPolicyModePrototype') -> bool:
+ def __ne__(self, other: 'FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class ModeEnum(str, Enum):
+
+class FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityById(FloatingIPTargetPrototypeNetworkInterfaceIdentity):
+ """
+ FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityById.
+
+ :param str id: The unique identifier for this instance network interface.
+ If this instance has network attachments, this network interface is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and the identifier is that of the corresponding network attachment.
+ """
+
+ def __init__(
+ self,
+ id: str,
+ ) -> None:
"""
- Policy mode VPN gateway.
+ Initialize a FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityById object.
+
+ :param str id: The unique identifier for this instance network interface.
+ If this instance has network attachments, this network interface is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and the identifier is that of the corresponding network
+ attachment.
"""
+ # pylint: disable=super-init-not-called
+ self.id = id
- POLICY = 'policy'
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityById':
+ """Initialize a FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityById object from a json dictionary."""
+ args = {}
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
+ else:
+ raise ValueError('Required property \'id\' not present in FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityById JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityById object from 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 FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityById object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityById') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+ def __ne__(self, other: 'FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityById') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
-class VPNGatewayPrototypeVPNGatewayRouteModePrototype(VPNGatewayPrototype):
+class FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN(FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentity):
"""
- VPNGatewayPrototypeVPNGatewayRouteModePrototype.
+ FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN.
- :attr str name: (optional) The name for this VPN gateway. The name must not be
- used by another VPN gateway in the VPC. If unspecified, the name will be a
- hyphenated list of randomly-selected words.
- :attr ResourceGroupIdentity resource_group: (optional)
- :attr SubnetIdentity subnet:
- :attr str mode: (optional) Route mode VPN gateway.
+ :param str crn: The CRN for this virtual network interface.
"""
def __init__(
self,
- subnet: 'SubnetIdentity',
- *,
- name: str = None,
- resource_group: 'ResourceGroupIdentity' = None,
- mode: str = None,
+ crn: str,
) -> None:
"""
- Initialize a VPNGatewayPrototypeVPNGatewayRouteModePrototype object.
+ Initialize a FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN object.
- :param SubnetIdentity subnet:
- :param str name: (optional) The name for this VPN gateway. The name must
- not be used by another VPN gateway in the VPC. If unspecified, the name
- will be a hyphenated list of randomly-selected words.
- :param ResourceGroupIdentity resource_group: (optional)
- :param str mode: (optional) Route mode VPN gateway.
+ :param str crn: The CRN for this virtual network interface.
"""
# pylint: disable=super-init-not-called
- self.name = name
- self.resource_group = resource_group
- self.subnet = subnet
- self.mode = mode
+ self.crn = crn
@classmethod
- def from_dict(cls, _dict: Dict) -> 'VPNGatewayPrototypeVPNGatewayRouteModePrototype':
- """Initialize a VPNGatewayPrototypeVPNGatewayRouteModePrototype object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN':
+ """Initialize a FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN 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 'subnet' in _dict:
- args['subnet'] = _dict.get('subnet')
+ if (crn := _dict.get('crn')) is not None:
+ args['crn'] = crn
else:
- raise ValueError('Required property \'subnet\' not present in VPNGatewayPrototypeVPNGatewayRouteModePrototype JSON')
- if 'mode' in _dict:
- args['mode'] = _dict.get('mode')
+ raise ValueError('Required property \'crn\' not present in FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VPNGatewayPrototypeVPNGatewayRouteModePrototype object from a json dictionary."""
+ """Initialize a FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN object from 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, '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, 'mode') and self.mode is not None:
- _dict['mode'] = self.mode
+ if hasattr(self, 'crn') and self.crn is not None:
+ _dict['crn'] = self.crn
return _dict
def _to_dict(self):
@@ -121476,309 +137289,59 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this VPNGatewayPrototypeVPNGatewayRouteModePrototype object."""
+ """Return a `str` version of this FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VPNGatewayPrototypeVPNGatewayRouteModePrototype') -> bool:
+ def __eq__(self, other: 'FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'VPNGatewayPrototypeVPNGatewayRouteModePrototype') -> bool:
+ def __ne__(self, other: 'FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class ModeEnum(str, Enum):
- """
- Route mode VPN gateway.
- """
-
- ROUTE = 'route'
-
-
-class VPNGatewayRouteMode(VPNGateway):
+class FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref(FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentity):
"""
- VPNGatewayRouteMode.
+ FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref.
- :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 List[VPNGatewayHealthReason] health_reasons: The reasons for the current
- VPN gateway health_state (if any):
- - `cannot_create_vpc_route`: VPN cannot create route (check for conflict)
- - `cannot_reserve_ip_address`: IP address exhaustion (release addresses on the
- VPN's
- subnet)
- - `internal_error`: Internal error (contact IBM support)
- The enumerated reason code values for this property will expand in the future.
- When processing this property, check for and log unknown values. Optionally halt
- processing and surface the error, or bypass the resource on which the unexpected
- reason code was encountered.
- :attr str health_state: The health of this resource.
- - `ok`: No abnormal behavior detected
- - `degraded`: Experiencing compromised performance, capacity, or connectivity
- - `faulted`: Completely unreachable, inoperative, or otherwise entirely
- incapacitated
- - `inapplicable`: The health state does not apply because of the current
- lifecycle state. A resource with a lifecycle state of `failed` or `deleting`
- will have a health state of `inapplicable`. A `pending` resource may also have
- this state.
- :attr str href: The VPN gateway's canonical URL.
- :attr str id: The unique identifier for this VPN gateway.
- :attr List[VPNGatewayLifecycleReason] lifecycle_reasons: The reasons for the
- current VPN gateway lifecycle_state (if any):
- - `resource_suspended_by_provider`: The resource has been suspended (contact IBM
- support)
- The enumerated reason code values for this property will expand in the future.
- When processing this property, check for and log unknown values. Optionally halt
- processing and surface the error, or bypass the resource on which the unexpected
- reason code was encountered.
- :attr str lifecycle_state: The lifecycle state of the VPN gateway.
- :attr List[VPNGatewayMember] members: Collection of VPN gateway members.
- :attr str name: The name for this VPN gateway. The name is unique across all VPN
- gateways in the VPC.
- :attr ResourceGroupReference resource_group: The resource group for this VPN
- gateway.
- :attr str resource_type: The resource type.
- :attr SubnetReference subnet:
- :attr VPCReference vpc: The VPC this VPN gateway resides in.
- :attr str mode: Route mode VPN gateway.
+ :param str href: The URL for this virtual network interface.
"""
def __init__(
self,
- connections: List['VPNGatewayConnectionReference'],
- created_at: datetime,
- crn: str,
- health_reasons: List['VPNGatewayHealthReason'],
- health_state: str,
href: str,
- id: str,
- lifecycle_reasons: List['VPNGatewayLifecycleReason'],
- lifecycle_state: str,
- members: List['VPNGatewayMember'],
- name: str,
- resource_group: 'ResourceGroupReference',
- resource_type: str,
- subnet: 'SubnetReference',
- vpc: 'VPCReference',
- mode: str,
) -> None:
"""
- Initialize a VPNGatewayRouteMode object.
+ Initialize a FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref 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 List[VPNGatewayHealthReason] health_reasons: The reasons for the
- current VPN gateway health_state (if any):
- - `cannot_create_vpc_route`: VPN cannot create route (check for conflict)
- - `cannot_reserve_ip_address`: IP address exhaustion (release addresses on
- the VPN's
- subnet)
- - `internal_error`: Internal error (contact IBM support)
- The enumerated reason code values for this property will expand in the
- future. When processing this property, check for and log unknown values.
- Optionally halt processing and surface the error, or bypass the resource on
- which the unexpected reason code was encountered.
- :param str health_state: The health of this resource.
- - `ok`: No abnormal behavior detected
- - `degraded`: Experiencing compromised performance, capacity, or
- connectivity
- - `faulted`: Completely unreachable, inoperative, or otherwise entirely
- incapacitated
- - `inapplicable`: The health state does not apply because of the current
- lifecycle state. A resource with a lifecycle state of `failed` or
- `deleting` will have a health state of `inapplicable`. A `pending` resource
- may also have this state.
- :param str href: The VPN gateway's canonical URL.
- :param str id: The unique identifier for this VPN gateway.
- :param List[VPNGatewayLifecycleReason] lifecycle_reasons: The reasons for
- the current VPN gateway lifecycle_state (if any):
- - `resource_suspended_by_provider`: The resource has been suspended
- (contact IBM
- support)
- The enumerated reason code values for this property will expand in the
- future. When processing this property, check for and log unknown values.
- Optionally halt processing and surface the error, or bypass the resource on
- which the unexpected reason code was encountered.
- :param str lifecycle_state: The lifecycle state of the VPN gateway.
- :param List[VPNGatewayMember] members: Collection of VPN gateway members.
- :param str name: The name for this VPN gateway. The name is unique across
- all VPN gateways in the VPC.
- :param ResourceGroupReference resource_group: The resource group for this
- VPN gateway.
- :param str resource_type: The resource type.
- :param SubnetReference subnet:
- :param VPCReference vpc: The VPC this VPN gateway resides in.
- :param str mode: Route mode VPN gateway.
+ :param str href: The URL for this virtual network interface.
"""
# pylint: disable=super-init-not-called
- self.connections = connections
- self.created_at = created_at
- self.crn = crn
- self.health_reasons = health_reasons
- self.health_state = health_state
self.href = href
- self.id = id
- self.lifecycle_reasons = lifecycle_reasons
- self.lifecycle_state = lifecycle_state
- self.members = members
- self.name = name
- self.resource_group = resource_group
- self.resource_type = resource_type
- self.subnet = subnet
- self.vpc = vpc
- self.mode = mode
@classmethod
- def from_dict(cls, _dict: Dict) -> 'VPNGatewayRouteMode':
- """Initialize a VPNGatewayRouteMode object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref':
+ """Initialize a FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref object from a json dictionary."""
args = {}
- if 'connections' in _dict:
- args['connections'] = [VPNGatewayConnectionReference.from_dict(v) for v in _dict.get('connections')]
- else:
- raise ValueError('Required property \'connections\' not present in VPNGatewayRouteMode 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 VPNGatewayRouteMode JSON')
- if 'crn' in _dict:
- args['crn'] = _dict.get('crn')
- else:
- raise ValueError('Required property \'crn\' not present in VPNGatewayRouteMode JSON')
- if 'health_reasons' in _dict:
- args['health_reasons'] = [VPNGatewayHealthReason.from_dict(v) for v in _dict.get('health_reasons')]
- else:
- raise ValueError('Required property \'health_reasons\' not present in VPNGatewayRouteMode JSON')
- if 'health_state' in _dict:
- args['health_state'] = _dict.get('health_state')
- else:
- raise ValueError('Required property \'health_state\' not present in VPNGatewayRouteMode JSON')
- if 'href' in _dict:
- args['href'] = _dict.get('href')
- else:
- raise ValueError('Required property \'href\' not present in VPNGatewayRouteMode JSON')
- if 'id' in _dict:
- args['id'] = _dict.get('id')
- else:
- raise ValueError('Required property \'id\' not present in VPNGatewayRouteMode JSON')
- if 'lifecycle_reasons' in _dict:
- args['lifecycle_reasons'] = [VPNGatewayLifecycleReason.from_dict(v) for v in _dict.get('lifecycle_reasons')]
- else:
- raise ValueError('Required property \'lifecycle_reasons\' not present in VPNGatewayRouteMode JSON')
- if 'lifecycle_state' in _dict:
- args['lifecycle_state'] = _dict.get('lifecycle_state')
- else:
- raise ValueError('Required property \'lifecycle_state\' not present in VPNGatewayRouteMode JSON')
- if 'members' in _dict:
- args['members'] = [VPNGatewayMember.from_dict(v) for v in _dict.get('members')]
- else:
- raise ValueError('Required property \'members\' not present in VPNGatewayRouteMode JSON')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
- else:
- raise ValueError('Required property \'name\' not present in VPNGatewayRouteMode 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 VPNGatewayRouteMode JSON')
- if 'resource_type' in _dict:
- args['resource_type'] = _dict.get('resource_type')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'resource_type\' not present in VPNGatewayRouteMode JSON')
- if 'subnet' in _dict:
- args['subnet'] = SubnetReference.from_dict(_dict.get('subnet'))
- else:
- raise ValueError('Required property \'subnet\' not present in VPNGatewayRouteMode JSON')
- if 'vpc' in _dict:
- args['vpc'] = VPCReference.from_dict(_dict.get('vpc'))
- else:
- raise ValueError('Required property \'vpc\' not present in VPNGatewayRouteMode JSON')
- if 'mode' in _dict:
- args['mode'] = _dict.get('mode')
- else:
- raise ValueError('Required property \'mode\' not present in VPNGatewayRouteMode JSON')
+ raise ValueError('Required property \'href\' not present in FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VPNGatewayRouteMode object from a json dictionary."""
+ """Initialize a FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'connections') and self.connections is not None:
- connections_list = []
- for v in self.connections:
- if isinstance(v, dict):
- connections_list.append(v)
- else:
- connections_list.append(v.to_dict())
- _dict['connections'] = connections_list
- if hasattr(self, 'created_at') and self.created_at is not None:
- _dict['created_at'] = datetime_to_string(self.created_at)
- if hasattr(self, 'crn') and self.crn is not None:
- _dict['crn'] = self.crn
- if hasattr(self, 'health_reasons') and self.health_reasons is not None:
- health_reasons_list = []
- for v in self.health_reasons:
- if isinstance(v, dict):
- health_reasons_list.append(v)
- else:
- health_reasons_list.append(v.to_dict())
- _dict['health_reasons'] = health_reasons_list
- if hasattr(self, 'health_state') and self.health_state is not None:
- _dict['health_state'] = self.health_state
if hasattr(self, 'href') and self.href is not None:
_dict['href'] = self.href
- if hasattr(self, 'id') and self.id is not None:
- _dict['id'] = self.id
- if hasattr(self, 'lifecycle_reasons') and self.lifecycle_reasons is not None:
- lifecycle_reasons_list = []
- for v in self.lifecycle_reasons:
- if isinstance(v, dict):
- lifecycle_reasons_list.append(v)
- else:
- lifecycle_reasons_list.append(v.to_dict())
- _dict['lifecycle_reasons'] = lifecycle_reasons_list
- if hasattr(self, 'lifecycle_state') and self.lifecycle_state is not None:
- _dict['lifecycle_state'] = self.lifecycle_state
- if hasattr(self, 'members') and self.members is not None:
- members_list = []
- for v in self.members:
- if isinstance(v, dict):
- members_list.append(v)
- else:
- members_list.append(v.to_dict())
- _dict['members'] = members_list
- if hasattr(self, 'name') and self.name is not None:
- _dict['name'] = self.name
- if hasattr(self, 'resource_group') and self.resource_group is not None:
- if isinstance(self.resource_group, dict):
- _dict['resource_group'] = self.resource_group
- else:
- _dict['resource_group'] = self.resource_group.to_dict()
- if hasattr(self, 'resource_type') and self.resource_type is not None:
- _dict['resource_type'] = self.resource_type
- if hasattr(self, '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, 'vpc') and self.vpc is not None:
- if isinstance(self.vpc, dict):
- _dict['vpc'] = self.vpc
- else:
- _dict['vpc'] = self.vpc.to_dict()
- if hasattr(self, 'mode') and self.mode is not None:
- _dict['mode'] = self.mode
return _dict
def _to_dict(self):
@@ -121786,133 +137349,59 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this VPNGatewayRouteMode object."""
+ """Return a `str` version of this FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VPNGatewayRouteMode') -> bool:
+ def __eq__(self, other: 'FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'VPNGatewayRouteMode') -> bool:
+ def __ne__(self, other: 'FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class HealthStateEnum(str, Enum):
- """
- The health of this resource.
- - `ok`: No abnormal behavior detected
- - `degraded`: Experiencing compromised performance, capacity, or connectivity
- - `faulted`: Completely unreachable, inoperative, or otherwise entirely
- incapacitated
- - `inapplicable`: The health state does not apply because of the current lifecycle
- state. A resource with a lifecycle state of `failed` or `deleting` will have a
- health state of `inapplicable`. A `pending` resource may also have this state.
- """
-
- DEGRADED = 'degraded'
- FAULTED = 'faulted'
- INAPPLICABLE = 'inapplicable'
- OK = 'ok'
-
-
- class LifecycleStateEnum(str, Enum):
- """
- The lifecycle state of the VPN gateway.
- """
-
- DELETING = 'deleting'
- FAILED = 'failed'
- PENDING = 'pending'
- STABLE = 'stable'
- SUSPENDED = 'suspended'
- UPDATING = 'updating'
- WAITING = 'waiting'
-
-
- class ResourceTypeEnum(str, Enum):
- """
- The resource type.
- """
-
- VPN_GATEWAY = 'vpn_gateway'
-
-
- class ModeEnum(str, Enum):
- """
- Route mode VPN gateway.
- """
-
- ROUTE = 'route'
-
-
-class VPNServerAuthenticationByCertificate(VPNServerAuthentication):
+class FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById(FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentity):
"""
- VPNServerAuthenticationByCertificate.
+ FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById.
- :attr str method: The type of authentication.
- :attr CertificateInstanceReference client_ca: The certificate instance used for
- the VPN client certificate authority (CA).
- :attr str crl: (optional) The certificate revocation list contents, encoded in
- PEM format.
+ :param str id: The unique identifier for this virtual network interface.
"""
def __init__(
self,
- method: str,
- client_ca: 'CertificateInstanceReference',
- *,
- crl: str = None,
+ id: str,
) -> None:
"""
- Initialize a VPNServerAuthenticationByCertificate object.
+ Initialize a FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById object.
- :param str method: The type of authentication.
- :param CertificateInstanceReference client_ca: The certificate instance
- used for the VPN client certificate authority (CA).
- :param str crl: (optional) The certificate revocation list contents,
- encoded in PEM format.
+ :param str id: The unique identifier for this virtual network interface.
"""
# pylint: disable=super-init-not-called
- self.method = method
- self.client_ca = client_ca
- self.crl = crl
+ self.id = id
@classmethod
- def from_dict(cls, _dict: Dict) -> 'VPNServerAuthenticationByCertificate':
- """Initialize a VPNServerAuthenticationByCertificate object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById':
+ """Initialize a FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById object from a json dictionary."""
args = {}
- if 'method' in _dict:
- args['method'] = _dict.get('method')
- else:
- raise ValueError('Required property \'method\' not present in VPNServerAuthenticationByCertificate JSON')
- if 'client_ca' in _dict:
- args['client_ca'] = CertificateInstanceReference.from_dict(_dict.get('client_ca'))
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
else:
- raise ValueError('Required property \'client_ca\' not present in VPNServerAuthenticationByCertificate JSON')
- if 'crl' in _dict:
- args['crl'] = _dict.get('crl')
+ raise ValueError('Required property \'id\' not present in FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VPNServerAuthenticationByCertificate object from a json dictionary."""
+ """Initialize a FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'method') and self.method is not None:
- _dict['method'] = self.method
- if hasattr(self, 'client_ca') and self.client_ca is not None:
- if isinstance(self.client_ca, dict):
- _dict['client_ca'] = self.client_ca
- else:
- _dict['client_ca'] = self.client_ca.to_dict()
- if hasattr(self, 'crl') and self.crl is not None:
- _dict['crl'] = self.crl
+ if hasattr(self, 'id') and self.id is not None:
+ _dict['id'] = self.id
return _dict
def _to_dict(self):
@@ -121920,83 +137409,59 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this VPNServerAuthenticationByCertificate object."""
+ """Return a `str` version of this FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VPNServerAuthenticationByCertificate') -> bool:
+ def __eq__(self, other: 'FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'VPNServerAuthenticationByCertificate') -> bool:
+ def __ne__(self, other: 'FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class MethodEnum(str, Enum):
- """
- The type of authentication.
- """
-
- CERTIFICATE = 'certificate'
- USERNAME = 'username'
-
-
-class VPNServerAuthenticationByUsername(VPNServerAuthentication):
+class FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByCRN(FlowLogCollectorTargetPrototypeInstanceIdentity):
"""
- VPNServerAuthenticationByUsername.
+ FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByCRN.
- :attr str method: The type of authentication.
- :attr VPNServerAuthenticationByUsernameIdProvider identity_provider: The type of
- identity provider to be used by VPN client.
+ :param str crn: The CRN for this virtual server instance.
"""
def __init__(
self,
- method: str,
- identity_provider: 'VPNServerAuthenticationByUsernameIdProvider',
+ crn: str,
) -> None:
"""
- Initialize a VPNServerAuthenticationByUsername object.
+ Initialize a FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByCRN object.
- :param str method: The type of authentication.
- :param VPNServerAuthenticationByUsernameIdProvider identity_provider: The
- type of identity provider to be used by VPN client.
+ :param str crn: The CRN for this virtual server instance.
"""
# pylint: disable=super-init-not-called
- self.method = method
- self.identity_provider = identity_provider
+ self.crn = crn
@classmethod
- def from_dict(cls, _dict: Dict) -> 'VPNServerAuthenticationByUsername':
- """Initialize a VPNServerAuthenticationByUsername object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByCRN':
+ """Initialize a FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByCRN object from a json dictionary."""
args = {}
- if 'method' in _dict:
- args['method'] = _dict.get('method')
- else:
- raise ValueError('Required property \'method\' not present in VPNServerAuthenticationByUsername JSON')
- if 'identity_provider' in _dict:
- args['identity_provider'] = _dict.get('identity_provider')
+ if (crn := _dict.get('crn')) is not None:
+ args['crn'] = crn
else:
- raise ValueError('Required property \'identity_provider\' not present in VPNServerAuthenticationByUsername JSON')
+ raise ValueError('Required property \'crn\' not present in FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByCRN JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VPNServerAuthenticationByUsername object from a json dictionary."""
+ """Initialize a FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByCRN object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'method') and self.method is not None:
- _dict['method'] = self.method
- if hasattr(self, 'identity_provider') and self.identity_provider is not None:
- if isinstance(self.identity_provider, dict):
- _dict['identity_provider'] = self.identity_provider
- else:
- _dict['identity_provider'] = self.identity_provider.to_dict()
+ if hasattr(self, 'crn') and self.crn is not None:
+ _dict['crn'] = self.crn
return _dict
def _to_dict(self):
@@ -122004,80 +137469,59 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this VPNServerAuthenticationByUsername object."""
+ """Return a `str` version of this FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByCRN object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VPNServerAuthenticationByUsername') -> bool:
+ def __eq__(self, other: 'FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByCRN') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'VPNServerAuthenticationByUsername') -> bool:
+ def __ne__(self, other: 'FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByCRN') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class MethodEnum(str, Enum):
- """
- The type of authentication.
- """
-
- CERTIFICATE = 'certificate'
- USERNAME = 'username'
-
-
-class VPNServerAuthenticationByUsernameIdProviderByIAM(VPNServerAuthenticationByUsernameIdProvider):
+class FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByHref(FlowLogCollectorTargetPrototypeInstanceIdentity):
"""
- VPNServerAuthenticationByUsernameIdProviderByIAM.
+ FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByHref.
- :attr str provider_type: The type of identity provider to be used by the VPN
- client.
- - `iam`: IBM identity and access management
- The enumerated values for this property are expected to expand in the future.
- When processing this property, check for and log unknown values. Optionally halt
- processing and surface the error, or bypass the route on which the unexpected
- property value was encountered.
+ :param str href: The URL for this virtual server instance.
"""
def __init__(
self,
- provider_type: str,
+ href: str,
) -> None:
"""
- Initialize a VPNServerAuthenticationByUsernameIdProviderByIAM object.
+ Initialize a FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByHref object.
- :param str provider_type: The type of identity provider to be used by the
- VPN client.
- - `iam`: IBM identity and access management
- The enumerated values for this property are expected to expand in the
- future. When processing this property, check for and log unknown values.
- Optionally halt processing and surface the error, or bypass the route on
- which the unexpected property value was encountered.
+ :param str href: The URL for this virtual server instance.
"""
# pylint: disable=super-init-not-called
- self.provider_type = provider_type
+ self.href = href
@classmethod
- def from_dict(cls, _dict: Dict) -> 'VPNServerAuthenticationByUsernameIdProviderByIAM':
- """Initialize a VPNServerAuthenticationByUsernameIdProviderByIAM object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByHref':
+ """Initialize a FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByHref object from a json dictionary."""
args = {}
- if 'provider_type' in _dict:
- args['provider_type'] = _dict.get('provider_type')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'provider_type\' not present in VPNServerAuthenticationByUsernameIdProviderByIAM JSON')
+ raise ValueError('Required property \'href\' not present in FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByHref JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VPNServerAuthenticationByUsernameIdProviderByIAM object from a json dictionary."""
+ """Initialize a FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByHref object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'provider_type') and self.provider_type is not None:
- _dict['provider_type'] = self.provider_type
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
return _dict
def _to_dict(self):
@@ -122085,98 +137529,59 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this VPNServerAuthenticationByUsernameIdProviderByIAM object."""
+ """Return a `str` version of this FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByHref object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VPNServerAuthenticationByUsernameIdProviderByIAM') -> bool:
+ def __eq__(self, other: 'FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByHref') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'VPNServerAuthenticationByUsernameIdProviderByIAM') -> bool:
+ def __ne__(self, other: 'FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByHref') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class ProviderTypeEnum(str, Enum):
- """
- The type of identity provider to be used by the VPN client.
- - `iam`: IBM identity and access management
- The enumerated values for this property are expected to expand in the future. When
- processing this property, check for and log unknown values. Optionally halt
- processing and surface the error, or bypass the route on which the unexpected
- property value was encountered.
- """
-
- IAM = 'iam'
-
-
-class VPNServerAuthenticationPrototypeVPNServerAuthenticationByCertificatePrototype(VPNServerAuthenticationPrototype):
+class FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityById(FlowLogCollectorTargetPrototypeInstanceIdentity):
"""
- VPNServerAuthenticationPrototypeVPNServerAuthenticationByCertificatePrototype.
+ FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityById.
- :attr str method: The type of authentication.
- :attr CertificateInstanceIdentity client_ca: The certificate instance to use for
- the VPN client certificate authority (CA).
- :attr str crl: (optional) The certificate revocation list contents, encoded in
- PEM format.
+ :param str id: The unique identifier for this virtual server instance.
"""
def __init__(
self,
- method: str,
- client_ca: 'CertificateInstanceIdentity',
- *,
- crl: str = None,
+ id: str,
) -> None:
"""
- Initialize a VPNServerAuthenticationPrototypeVPNServerAuthenticationByCertificatePrototype object.
+ Initialize a FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityById object.
- :param str method: The type of authentication.
- :param CertificateInstanceIdentity client_ca: The certificate instance to
- use for the VPN client certificate authority (CA).
- :param str crl: (optional) The certificate revocation list contents,
- encoded in PEM format.
+ :param str id: The unique identifier for this virtual server instance.
"""
# pylint: disable=super-init-not-called
- self.method = method
- self.client_ca = client_ca
- self.crl = crl
+ self.id = id
@classmethod
- def from_dict(cls, _dict: Dict) -> 'VPNServerAuthenticationPrototypeVPNServerAuthenticationByCertificatePrototype':
- """Initialize a VPNServerAuthenticationPrototypeVPNServerAuthenticationByCertificatePrototype object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityById':
+ """Initialize a FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityById object from a json dictionary."""
args = {}
- if 'method' in _dict:
- args['method'] = _dict.get('method')
- else:
- raise ValueError('Required property \'method\' not present in VPNServerAuthenticationPrototypeVPNServerAuthenticationByCertificatePrototype JSON')
- if 'client_ca' in _dict:
- args['client_ca'] = _dict.get('client_ca')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
else:
- raise ValueError('Required property \'client_ca\' not present in VPNServerAuthenticationPrototypeVPNServerAuthenticationByCertificatePrototype JSON')
- if 'crl' in _dict:
- args['crl'] = _dict.get('crl')
+ raise ValueError('Required property \'id\' not present in FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityById JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VPNServerAuthenticationPrototypeVPNServerAuthenticationByCertificatePrototype object from a json dictionary."""
+ """Initialize a FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityById object from a json dictionary."""
return cls.from_dict(_dict)
-
- def to_dict(self) -> Dict:
- """Return a json dictionary representing this model."""
- _dict = {}
- if hasattr(self, 'method') and self.method is not None:
- _dict['method'] = self.method
- if hasattr(self, 'client_ca') and self.client_ca is not None:
- if isinstance(self.client_ca, dict):
- _dict['client_ca'] = self.client_ca
- else:
- _dict['client_ca'] = self.client_ca.to_dict()
- if hasattr(self, 'crl') and self.crl is not None:
- _dict['crl'] = self.crl
+
+ 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):
@@ -122184,83 +137589,59 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this VPNServerAuthenticationPrototypeVPNServerAuthenticationByCertificatePrototype object."""
+ """Return a `str` version of this FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityById object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VPNServerAuthenticationPrototypeVPNServerAuthenticationByCertificatePrototype') -> bool:
+ def __eq__(self, other: 'FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityById') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'VPNServerAuthenticationPrototypeVPNServerAuthenticationByCertificatePrototype') -> bool:
+ def __ne__(self, other: 'FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityById') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class MethodEnum(str, Enum):
- """
- The type of authentication.
- """
-
- CERTIFICATE = 'certificate'
- USERNAME = 'username'
-
-
-class VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype(VPNServerAuthenticationPrototype):
+class FlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentityInstanceNetworkAttachmentIdentityByHref(FlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentity):
"""
- VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype.
+ FlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentityInstanceNetworkAttachmentIdentityByHref.
- :attr str method: The type of authentication.
- :attr VPNServerAuthenticationByUsernameIdProvider identity_provider: The type of
- identity provider to be used by VPN client.
+ :param str href: The URL for this instance network attachment.
"""
def __init__(
self,
- method: str,
- identity_provider: 'VPNServerAuthenticationByUsernameIdProvider',
+ href: str,
) -> None:
"""
- Initialize a VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype object.
+ Initialize a FlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentityInstanceNetworkAttachmentIdentityByHref object.
- :param str method: The type of authentication.
- :param VPNServerAuthenticationByUsernameIdProvider identity_provider: The
- type of identity provider to be used by VPN client.
+ :param str href: The URL for this instance network attachment.
"""
# pylint: disable=super-init-not-called
- self.method = method
- self.identity_provider = identity_provider
+ self.href = href
@classmethod
- def from_dict(cls, _dict: Dict) -> 'VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype':
- """Initialize a VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'FlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentityInstanceNetworkAttachmentIdentityByHref':
+ """Initialize a FlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentityInstanceNetworkAttachmentIdentityByHref object from a json dictionary."""
args = {}
- if 'method' in _dict:
- args['method'] = _dict.get('method')
- else:
- raise ValueError('Required property \'method\' not present in VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype JSON')
- if 'identity_provider' in _dict:
- args['identity_provider'] = _dict.get('identity_provider')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'identity_provider\' not present in VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype JSON')
+ raise ValueError('Required property \'href\' not present in FlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentityInstanceNetworkAttachmentIdentityByHref JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype object from a json dictionary."""
+ """Initialize a FlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentityInstanceNetworkAttachmentIdentityByHref object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'method') and self.method is not None:
- _dict['method'] = self.method
- if hasattr(self, 'identity_provider') and self.identity_provider is not None:
- if isinstance(self.identity_provider, dict):
- _dict['identity_provider'] = self.identity_provider
- else:
- _dict['identity_provider'] = self.identity_provider.to_dict()
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
return _dict
def _to_dict(self):
@@ -122268,120 +137649,59 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype object."""
+ """Return a `str` version of this FlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentityInstanceNetworkAttachmentIdentityByHref object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype') -> bool:
+ def __eq__(self, other: 'FlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentityInstanceNetworkAttachmentIdentityByHref') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype') -> bool:
+ def __ne__(self, other: 'FlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentityInstanceNetworkAttachmentIdentityByHref') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class MethodEnum(str, Enum):
- """
- The type of authentication.
- """
-
- CERTIFICATE = 'certificate'
- USERNAME = 'username'
-
-
-
-class VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContext(VirtualNetworkInterfacePrimaryIPPrototype):
- """
- Identifies a reserved IP by a unique property. Required if `subnet` is not specified.
- The reserved IP must be currently unbound.
-
- """
-
- def __init__(
- self,
- ) -> None:
- """
- Initialize a VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContext object.
-
- """
- # pylint: disable=super-init-not-called
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContextById', 'VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContextByHref'])
- )
- raise Exception(msg)
-
-class VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext(VirtualNetworkInterfacePrimaryIPPrototype):
+class FlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentityInstanceNetworkAttachmentIdentityById(FlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentity):
"""
- The prototype for a new reserved IP. Requires `subnet` to be specified.
+ FlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentityInstanceNetworkAttachmentIdentityById.
- :attr str address: (optional) The IP address to reserve, which must not already
- be reserved on the subnet.
- If unspecified, an available address on the subnet will automatically be
- selected.
- :attr bool auto_delete: (optional) Indicates whether this reserved IP member
- will be automatically deleted when either
- `target` is deleted, or the reserved IP is unbound.
- :attr str name: (optional) The name for this reserved IP. The name must not be
- used by another reserved IP in the subnet. Names starting with `ibm-` are
- reserved for provider-owned resources, and are not allowed. If unspecified, the
- name will be a hyphenated list of randomly-selected words.
+ :param str id: The unique identifier for this instance network attachment.
"""
def __init__(
self,
- *,
- address: str = None,
- auto_delete: bool = None,
- name: str = None,
+ id: str,
) -> None:
"""
- Initialize a VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext object.
+ Initialize a FlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentityInstanceNetworkAttachmentIdentityById object.
- :param str address: (optional) The IP address to reserve, which must not
- already be reserved on the subnet.
- If unspecified, an available address on the subnet will automatically be
- selected.
- :param bool auto_delete: (optional) Indicates whether this reserved IP
- member will be automatically deleted when either
- `target` is deleted, or the reserved IP is unbound.
- :param str name: (optional) The name for this reserved IP. The name must
- not be used by another reserved IP in the subnet. Names starting with
- `ibm-` are reserved for provider-owned resources, and are not allowed. If
- unspecified, the name will be a hyphenated list of randomly-selected words.
+ :param str id: The unique identifier for this instance network attachment.
"""
# pylint: disable=super-init-not-called
- self.address = address
- self.auto_delete = auto_delete
- self.name = name
+ self.id = id
@classmethod
- def from_dict(cls, _dict: Dict) -> 'VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext':
- """Initialize a VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'FlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentityInstanceNetworkAttachmentIdentityById':
+ """Initialize a FlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentityInstanceNetworkAttachmentIdentityById object from a json dictionary."""
args = {}
- if 'address' in _dict:
- args['address'] = _dict.get('address')
- if 'auto_delete' in _dict:
- args['auto_delete'] = _dict.get('auto_delete')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
+ else:
+ raise ValueError('Required property \'id\' not present in FlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentityInstanceNetworkAttachmentIdentityById JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext object from a json dictionary."""
+ """Initialize a FlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentityInstanceNetworkAttachmentIdentityById object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'address') and self.address is not None:
- _dict['address'] = self.address
- if hasattr(self, 'auto_delete') and self.auto_delete is not None:
- _dict['auto_delete'] = self.auto_delete
- if hasattr(self, 'name') and self.name is not None:
- _dict['name'] = self.name
+ if hasattr(self, 'id') and self.id is not None:
+ _dict['id'] = self.id
return _dict
def _to_dict(self):
@@ -122389,108 +137709,67 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext object."""
+ """Return a `str` version of this FlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentityInstanceNetworkAttachmentIdentityById object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext') -> bool:
+ def __eq__(self, other: 'FlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentityInstanceNetworkAttachmentIdentityById') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext') -> bool:
+ def __ne__(self, other: 'FlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentityInstanceNetworkAttachmentIdentityById') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class VirtualNetworkInterfaceTargetShareMountTargetReference(VirtualNetworkInterfaceTarget):
+class FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref(FlowLogCollectorTargetPrototypeNetworkInterfaceIdentity):
"""
- VirtualNetworkInterfaceTargetShareMountTargetReference.
+ FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref.
- :attr ShareMountTargetReferenceDeleted deleted: (optional) If present, this
- property indicates the referenced resource has been deleted, and provides
- some supplementary information.
- :attr str href: The URL for this share mount target.
- :attr str id: The unique identifier for this share mount target.
- :attr str name: The name for this share mount target. The name is unique across
- all mount targets for the file share.
- :attr str resource_type: The resource type.
+ :param str href: The URL for this instance network interface.
+ If this instance has network attachments, this network interface is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment.
"""
def __init__(
self,
href: str,
- id: str,
- name: str,
- resource_type: str,
- *,
- deleted: 'ShareMountTargetReferenceDeleted' = None,
) -> None:
"""
- Initialize a VirtualNetworkInterfaceTargetShareMountTargetReference object.
+ Initialize a FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref object.
- :param str href: The URL for this share mount target.
- :param str id: The unique identifier for this share mount target.
- :param str name: The name for this share mount target. The name is unique
- across all mount targets for the file share.
- :param str resource_type: The resource type.
- :param ShareMountTargetReferenceDeleted deleted: (optional) If present,
- this property indicates the referenced resource has been deleted, and
- provides
- some supplementary information.
+ :param str href: The URL for this instance network interface.
+ If this instance has network attachments, this network interface is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment.
"""
# pylint: disable=super-init-not-called
- self.deleted = deleted
self.href = href
- self.id = id
- self.name = name
- self.resource_type = resource_type
@classmethod
- def from_dict(cls, _dict: Dict) -> 'VirtualNetworkInterfaceTargetShareMountTargetReference':
- """Initialize a VirtualNetworkInterfaceTargetShareMountTargetReference object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref':
+ """Initialize a FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref object from a json dictionary."""
args = {}
- if 'deleted' in _dict:
- args['deleted'] = ShareMountTargetReferenceDeleted.from_dict(_dict.get('deleted'))
- if 'href' in _dict:
- args['href'] = _dict.get('href')
- else:
- raise ValueError('Required property \'href\' not present in VirtualNetworkInterfaceTargetShareMountTargetReference JSON')
- if 'id' in _dict:
- args['id'] = _dict.get('id')
- else:
- raise ValueError('Required property \'id\' not present in VirtualNetworkInterfaceTargetShareMountTargetReference JSON')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'name\' not present in VirtualNetworkInterfaceTargetShareMountTargetReference JSON')
- if 'resource_type' in _dict:
- args['resource_type'] = _dict.get('resource_type')
- else:
- raise ValueError('Required property \'resource_type\' not present in VirtualNetworkInterfaceTargetShareMountTargetReference JSON')
+ raise ValueError('Required property \'href\' not present in FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VirtualNetworkInterfaceTargetShareMountTargetReference object from a json dictionary."""
+ """Initialize a FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'deleted') and self.deleted is not None:
- if isinstance(self.deleted, dict):
- _dict['deleted'] = self.deleted
- else:
- _dict['deleted'] = self.deleted.to_dict()
if hasattr(self, 'href') and self.href is not None:
_dict['href'] = self.href
- if hasattr(self, 'id') and self.id is not None:
- _dict['id'] = self.id
- if hasattr(self, 'name') and self.name is not None:
- _dict['name'] = self.name
- if hasattr(self, 'resource_type') and self.resource_type is not None:
- _dict['resource_type'] = self.resource_type
return _dict
def _to_dict(self):
@@ -122498,110 +137777,96 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this VirtualNetworkInterfaceTargetShareMountTargetReference object."""
+ """Return a `str` version of this FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VirtualNetworkInterfaceTargetShareMountTargetReference') -> bool:
+ def __eq__(self, other: 'FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'VirtualNetworkInterfaceTargetShareMountTargetReference') -> bool:
+ def __ne__(self, other: 'FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class ResourceTypeEnum(str, Enum):
- """
- The resource type.
- """
-
- SHARE_MOUNT_TARGET = 'share_mount_target'
-
-
-class VolumeAttachmentPrototypeVolumeVolumeIdentity(VolumeAttachmentPrototypeVolume):
+class FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityById(FlowLogCollectorTargetPrototypeNetworkInterfaceIdentity):
"""
- Identifies a volume by a unique property.
+ FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityById.
+ :param str id: The unique identifier for this instance network interface.
+ If this instance has network attachments, this network interface is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and the identifier is that of the corresponding network attachment.
"""
def __init__(
self,
+ id: str,
) -> None:
"""
- Initialize a VolumeAttachmentPrototypeVolumeVolumeIdentity object.
+ Initialize a FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityById object.
+ :param str id: The unique identifier for this instance network interface.
+ If this instance has network attachments, this network interface is a
+ [read-only
+ representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients)
+ of its corresponding network attachment and its attached virtual network
+ interface, and the identifier is that of the corresponding network
+ attachment.
"""
# pylint: disable=super-init-not-called
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById', 'VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityByCRN', 'VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityByHref'])
- )
- raise Exception(msg)
+ self.id = id
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityById':
+ """Initialize a FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityById object from a json dictionary."""
+ args = {}
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
+ else:
+ raise ValueError('Required property \'id\' not present in FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityById JSON')
+ return cls(**args)
-class VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContext(VolumeAttachmentPrototypeVolume):
- """
- VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContext.
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityById object from a json dictionary."""
+ return cls.from_dict(_dict)
- :attr int iops: (optional) The maximum I/O operations per second (IOPS) to use
- for this volume. Applicable only to volumes using a profile `family` of
- `custom`.
- :attr str name: (optional) The name for this volume. The name must not be used
- by another volume in the region. If unspecified, the name will be a hyphenated
- list of randomly-selected words.
- :attr VolumeProfileIdentity profile: The
- [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-block-storage-profiles) to
- use for this volume.
- :attr ResourceGroupIdentity resource_group: (optional) The resource group to use
- for this volume. If unspecified, the instance's resource
- group will be used.
- :attr List[str] user_tags: (optional) The [user
- tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with this
- volume.
- """
+ def 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 __init__(
- self,
- profile: 'VolumeProfileIdentity',
- *,
- iops: int = None,
- name: str = None,
- resource_group: 'ResourceGroupIdentity' = None,
- user_tags: List[str] = None,
- ) -> None:
- """
- Initialize a VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContext object.
+ def _to_dict(self):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
- :param VolumeProfileIdentity profile: The
- [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-block-storage-profiles)
- to
- use for this volume.
- :param int iops: (optional) The maximum I/O operations per second (IOPS) to
- use for this volume. Applicable only to volumes using a profile `family` of
- `custom`.
- :param str name: (optional) The name for this volume. The name must not be
- used by another volume in the region. If unspecified, the name will be a
- hyphenated list of randomly-selected words.
- :param ResourceGroupIdentity resource_group: (optional) The resource group
- to use for this volume. If unspecified, the instance's resource
- group will be used.
- :param List[str] user_tags: (optional) The [user
- tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with
- this volume.
- """
- # pylint: disable=super-init-not-called
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity', 'VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshot'])
- )
- raise Exception(msg)
+ def __str__(self) -> str:
+ """Return a `str` version of this FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityById object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityById') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+ def __ne__(self, other: 'FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityById') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
-class VolumeIdentityByCRN(VolumeIdentity):
+
+class FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByCRN(FlowLogCollectorTargetPrototypeSubnetIdentity):
"""
- VolumeIdentityByCRN.
+ FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByCRN.
- :attr str crn: The CRN for this volume.
+ :param str crn: The CRN for this subnet.
"""
def __init__(
@@ -122609,26 +137874,26 @@ def __init__(
crn: str,
) -> None:
"""
- Initialize a VolumeIdentityByCRN object.
+ Initialize a FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByCRN object.
- :param str crn: The CRN for this volume.
+ :param str crn: The CRN for this subnet.
"""
# pylint: disable=super-init-not-called
self.crn = crn
@classmethod
- def from_dict(cls, _dict: Dict) -> 'VolumeIdentityByCRN':
- """Initialize a VolumeIdentityByCRN object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByCRN':
+ """Initialize a FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByCRN object from a json dictionary."""
args = {}
- if 'crn' in _dict:
- args['crn'] = _dict.get('crn')
+ if (crn := _dict.get('crn')) is not None:
+ args['crn'] = crn
else:
- raise ValueError('Required property \'crn\' not present in VolumeIdentityByCRN JSON')
+ raise ValueError('Required property \'crn\' not present in FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByCRN JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VolumeIdentityByCRN object from a json dictionary."""
+ """Initialize a FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByCRN object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -122643,25 +137908,25 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this VolumeIdentityByCRN object."""
+ """Return a `str` version of this FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByCRN object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VolumeIdentityByCRN') -> bool:
+ def __eq__(self, other: 'FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByCRN') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'VolumeIdentityByCRN') -> bool:
+ def __ne__(self, other: 'FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByCRN') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class VolumeIdentityByHref(VolumeIdentity):
+class FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByHref(FlowLogCollectorTargetPrototypeSubnetIdentity):
"""
- VolumeIdentityByHref.
+ FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByHref.
- :attr str href: The URL for this volume.
+ :param str href: The URL for this subnet.
"""
def __init__(
@@ -122669,26 +137934,26 @@ def __init__(
href: str,
) -> None:
"""
- Initialize a VolumeIdentityByHref object.
+ Initialize a FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByHref object.
- :param str href: The URL for this volume.
+ :param str href: The URL for this subnet.
"""
# pylint: disable=super-init-not-called
self.href = href
@classmethod
- def from_dict(cls, _dict: Dict) -> 'VolumeIdentityByHref':
- """Initialize a VolumeIdentityByHref object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByHref':
+ """Initialize a FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByHref object from a json dictionary."""
args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'href\' not present in VolumeIdentityByHref JSON')
+ raise ValueError('Required property \'href\' not present in FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByHref JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VolumeIdentityByHref object from a json dictionary."""
+ """Initialize a FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByHref object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -122703,25 +137968,25 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this VolumeIdentityByHref object."""
+ """Return a `str` version of this FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByHref object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VolumeIdentityByHref') -> bool:
+ def __eq__(self, other: 'FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByHref') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'VolumeIdentityByHref') -> bool:
+ def __ne__(self, other: 'FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByHref') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class VolumeIdentityById(VolumeIdentity):
+class FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityById(FlowLogCollectorTargetPrototypeSubnetIdentity):
"""
- VolumeIdentityById.
+ FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityById.
- :attr str id: The unique identifier for this volume.
+ :param str id: The unique identifier for this subnet.
"""
def __init__(
@@ -122729,26 +137994,26 @@ def __init__(
id: str,
) -> None:
"""
- Initialize a VolumeIdentityById object.
+ Initialize a FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityById object.
- :param str id: The unique identifier for this volume.
+ :param str id: The unique identifier for this subnet.
"""
# pylint: disable=super-init-not-called
self.id = id
@classmethod
- def from_dict(cls, _dict: Dict) -> 'VolumeIdentityById':
- """Initialize a VolumeIdentityById object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityById':
+ """Initialize a FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityById object from a json dictionary."""
args = {}
- if 'id' in _dict:
- args['id'] = _dict.get('id')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
else:
- raise ValueError('Required property \'id\' not present in VolumeIdentityById JSON')
+ raise ValueError('Required property \'id\' not present in FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityById JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VolumeIdentityById object from a json dictionary."""
+ """Initialize a FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityById object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -122763,59 +138028,59 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this VolumeIdentityById object."""
+ """Return a `str` version of this FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityById object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VolumeIdentityById') -> bool:
+ def __eq__(self, other: 'FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityById') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'VolumeIdentityById') -> bool:
+ def __ne__(self, other: 'FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityById') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class VolumeProfileIdentityByHref(VolumeProfileIdentity):
+class FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByCRN(FlowLogCollectorTargetPrototypeVPCIdentity):
"""
- VolumeProfileIdentityByHref.
+ FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByCRN.
- :attr str href: The URL for this volume profile.
+ :param str crn: The CRN for this VPC.
"""
def __init__(
self,
- href: str,
+ crn: str,
) -> None:
"""
- Initialize a VolumeProfileIdentityByHref object.
+ Initialize a FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByCRN object.
- :param str href: The URL for this volume profile.
+ :param str crn: The CRN for this VPC.
"""
# pylint: disable=super-init-not-called
- self.href = href
+ self.crn = crn
@classmethod
- def from_dict(cls, _dict: Dict) -> 'VolumeProfileIdentityByHref':
- """Initialize a VolumeProfileIdentityByHref object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByCRN':
+ """Initialize a FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByCRN object from a json dictionary."""
args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ if (crn := _dict.get('crn')) is not None:
+ args['crn'] = crn
else:
- raise ValueError('Required property \'href\' not present in VolumeProfileIdentityByHref JSON')
+ raise ValueError('Required property \'crn\' not present in FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByCRN JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VolumeProfileIdentityByHref object from a json dictionary."""
+ """Initialize a FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByCRN object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'href') and self.href is not None:
- _dict['href'] = self.href
+ if hasattr(self, 'crn') and self.crn is not None:
+ _dict['crn'] = self.crn
return _dict
def _to_dict(self):
@@ -122823,59 +138088,59 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this VolumeProfileIdentityByHref object."""
+ """Return a `str` version of this FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByCRN object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VolumeProfileIdentityByHref') -> bool:
+ def __eq__(self, other: 'FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByCRN') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'VolumeProfileIdentityByHref') -> bool:
+ def __ne__(self, other: 'FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByCRN') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class VolumeProfileIdentityByName(VolumeProfileIdentity):
+class FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByHref(FlowLogCollectorTargetPrototypeVPCIdentity):
"""
- VolumeProfileIdentityByName.
+ FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByHref.
- :attr str name: The globally unique name for this volume profile.
+ :param str href: The URL for this VPC.
"""
def __init__(
self,
- name: str,
+ href: str,
) -> None:
"""
- Initialize a VolumeProfileIdentityByName object.
+ Initialize a FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByHref object.
- :param str name: The globally unique name for this volume profile.
+ :param str href: The URL for this VPC.
"""
# pylint: disable=super-init-not-called
- self.name = name
+ self.href = href
@classmethod
- def from_dict(cls, _dict: Dict) -> 'VolumeProfileIdentityByName':
- """Initialize a VolumeProfileIdentityByName object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByHref':
+ """Initialize a FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByHref object from a json dictionary."""
args = {}
- if 'name' in _dict:
- args['name'] = _dict.get('name')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'name\' not present in VolumeProfileIdentityByName JSON')
+ raise ValueError('Required property \'href\' not present in FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByHref JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VolumeProfileIdentityByName object from a json dictionary."""
+ """Initialize a FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByHref object from 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):
@@ -122883,157 +138148,59 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this VolumeProfileIdentityByName object."""
+ """Return a `str` version of this FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByHref object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VolumeProfileIdentityByName') -> bool:
+ def __eq__(self, other: 'FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByHref') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'VolumeProfileIdentityByName') -> bool:
+ def __ne__(self, other: 'FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByHref') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class VolumePrototypeVolumeByCapacity(VolumePrototype):
+class FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityById(FlowLogCollectorTargetPrototypeVPCIdentity):
"""
- VolumePrototypeVolumeByCapacity.
+ FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityById.
- :attr int iops: (optional) The maximum I/O operations per second (IOPS) to use
- for this volume. Applicable only to volumes using a profile `family` of
- `custom`.
- :attr str name: (optional) The name for this volume. The name must not be used
- by another volume in the region. If unspecified, the name will be a hyphenated
- list of randomly-selected words.
- :attr VolumeProfileIdentity profile: The
- [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-block-storage-profiles) to
- use for this volume.
- :attr ResourceGroupIdentity resource_group: (optional)
- :attr List[str] user_tags: (optional) The [user
- tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with this
- volume.
- :attr ZoneIdentity zone: The zone this volume will reside in.
- :attr int capacity: The capacity to use for the volume (in gigabytes). The
- specified minimum and maximum capacity values for creating or updating volumes
- may expand in the future.
- :attr EncryptionKeyIdentity encryption_key: (optional) The root key to use to
- wrap the data encryption key for the volume.
- If unspecified, the `encryption` type for the volume will be `provider_managed`.
+ :param str id: The unique identifier for this VPC.
"""
def __init__(
self,
- profile: 'VolumeProfileIdentity',
- zone: 'ZoneIdentity',
- capacity: int,
- *,
- iops: int = None,
- name: str = None,
- resource_group: 'ResourceGroupIdentity' = None,
- user_tags: List[str] = None,
- encryption_key: 'EncryptionKeyIdentity' = None,
- ) -> None:
- """
- Initialize a VolumePrototypeVolumeByCapacity object.
-
- :param VolumeProfileIdentity profile: The
- [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-block-storage-profiles)
- to use for this volume.
- :param ZoneIdentity zone: The zone this volume will reside in.
- :param int capacity: The capacity to use for the volume (in gigabytes). The
- specified minimum and maximum capacity values for creating or updating
- volumes may expand in the future.
- :param int iops: (optional) The maximum I/O operations per second (IOPS) to
- use for this volume. Applicable only to volumes using a profile `family` of
- `custom`.
- :param str name: (optional) The name for this volume. The name must not be
- used by another volume in the region. If unspecified, the name will be a
- hyphenated list of randomly-selected words.
- :param ResourceGroupIdentity resource_group: (optional)
- :param List[str] user_tags: (optional) The [user
- tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with
- this volume.
- :param EncryptionKeyIdentity encryption_key: (optional) The root key to use
- to wrap the data encryption key for the volume.
- If unspecified, the `encryption` type for the volume will be
- `provider_managed`.
- """
- # pylint: disable=super-init-not-called
- self.iops = iops
- self.name = name
- self.profile = profile
- self.resource_group = resource_group
- self.user_tags = user_tags
- self.zone = zone
- self.capacity = capacity
- self.encryption_key = encryption_key
-
- @classmethod
- def from_dict(cls, _dict: Dict) -> 'VolumePrototypeVolumeByCapacity':
- """Initialize a VolumePrototypeVolumeByCapacity object from a json dictionary."""
- args = {}
- if 'iops' in _dict:
- args['iops'] = _dict.get('iops')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
- if 'profile' in _dict:
- args['profile'] = _dict.get('profile')
- else:
- raise ValueError('Required property \'profile\' not present in VolumePrototypeVolumeByCapacity JSON')
- if 'resource_group' in _dict:
- args['resource_group'] = _dict.get('resource_group')
- if 'user_tags' in _dict:
- args['user_tags'] = _dict.get('user_tags')
- if 'zone' in _dict:
- args['zone'] = _dict.get('zone')
- else:
- raise ValueError('Required property \'zone\' not present in VolumePrototypeVolumeByCapacity JSON')
- if 'capacity' in _dict:
- args['capacity'] = _dict.get('capacity')
- else:
- raise ValueError('Required property \'capacity\' not present in VolumePrototypeVolumeByCapacity JSON')
- if 'encryption_key' in _dict:
- args['encryption_key'] = _dict.get('encryption_key')
- return cls(**args)
-
- @classmethod
- def _from_dict(cls, _dict):
- """Initialize a VolumePrototypeVolumeByCapacity object from a json dictionary."""
- return cls.from_dict(_dict)
-
- def to_dict(self) -> Dict:
- """Return a json dictionary representing this model."""
- _dict = {}
- if hasattr(self, 'iops') and self.iops is not None:
- _dict['iops'] = self.iops
- if hasattr(self, 'name') and self.name is not None:
- _dict['name'] = self.name
- if hasattr(self, 'profile') and self.profile is not None:
- if isinstance(self.profile, dict):
- _dict['profile'] = self.profile
- else:
- _dict['profile'] = self.profile.to_dict()
- if hasattr(self, 'resource_group') and self.resource_group is not None:
- if isinstance(self.resource_group, dict):
- _dict['resource_group'] = self.resource_group
- else:
- _dict['resource_group'] = self.resource_group.to_dict()
- if hasattr(self, 'user_tags') and self.user_tags is not None:
- _dict['user_tags'] = self.user_tags
- if hasattr(self, 'zone') and self.zone is not None:
- if isinstance(self.zone, dict):
- _dict['zone'] = self.zone
- else:
- _dict['zone'] = self.zone.to_dict()
- 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()
+ id: str,
+ ) -> None:
+ """
+ Initialize a FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityById object.
+
+ :param str id: The unique identifier for this VPC.
+ """
+ # pylint: disable=super-init-not-called
+ self.id = id
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityById':
+ """Initialize a FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityById object from a json dictionary."""
+ args = {}
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
+ else:
+ raise ValueError('Required property \'id\' not present in FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityById JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityById object from 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):
@@ -123041,173 +138208,59 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this VolumePrototypeVolumeByCapacity object."""
+ """Return a `str` version of this FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityById object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VolumePrototypeVolumeByCapacity') -> bool:
+ def __eq__(self, other: 'FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityById') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'VolumePrototypeVolumeByCapacity') -> bool:
+ def __ne__(self, other: 'FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityById') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class VolumePrototypeVolumeBySourceSnapshot(VolumePrototype):
+class FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN(FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentity):
"""
- VolumePrototypeVolumeBySourceSnapshot.
+ FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN.
- :attr int iops: (optional) The maximum I/O operations per second (IOPS) to use
- for this volume. Applicable only to volumes using a profile `family` of
- `custom`.
- :attr str name: (optional) The name for this volume. The name must not be used
- by another volume in the region. If unspecified, the name will be a hyphenated
- list of randomly-selected words.
- :attr VolumeProfileIdentity profile: The
- [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-block-storage-profiles) to
- use for this volume.
- :attr ResourceGroupIdentity resource_group: (optional)
- :attr List[str] user_tags: (optional) The [user
- tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with this
- volume.
- :attr ZoneIdentity zone: The zone this volume will reside in.
- :attr int capacity: (optional) The capacity to use for the volume (in
- gigabytes). Must be at least the snapshot's
- `minimum_capacity`. The maximum value may increase in the future.
- If unspecified, the capacity will be the source snapshot's `minimum_capacity`.
- :attr EncryptionKeyIdentity encryption_key: (optional) The root key to use to
- wrap the data encryption key for the volume.
- If unspecified, the `encryption` type for the volume will be `provider_managed`.
- :attr SnapshotIdentity source_snapshot: The snapshot from which to clone the
- volume.
+ :param str crn: The CRN for this virtual network interface.
"""
def __init__(
self,
- profile: 'VolumeProfileIdentity',
- zone: 'ZoneIdentity',
- source_snapshot: 'SnapshotIdentity',
- *,
- iops: int = None,
- name: str = None,
- resource_group: 'ResourceGroupIdentity' = None,
- user_tags: List[str] = None,
- capacity: int = None,
- encryption_key: 'EncryptionKeyIdentity' = None,
+ crn: str,
) -> None:
"""
- Initialize a VolumePrototypeVolumeBySourceSnapshot object.
+ Initialize a FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN object.
- :param VolumeProfileIdentity profile: The
- [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-block-storage-profiles)
- to use for this volume.
- :param ZoneIdentity zone: The zone this volume will reside in.
- :param SnapshotIdentity source_snapshot: The snapshot from which to clone
- the volume.
- :param int iops: (optional) The maximum I/O operations per second (IOPS) to
- use for this volume. Applicable only to volumes using a profile `family` of
- `custom`.
- :param str name: (optional) The name for this volume. The name must not be
- used by another volume in the region. If unspecified, the name will be a
- hyphenated list of randomly-selected words.
- :param ResourceGroupIdentity resource_group: (optional)
- :param List[str] user_tags: (optional) The [user
- tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with
- this volume.
- :param int capacity: (optional) The capacity to use for the volume (in
- gigabytes). Must be at least the snapshot's
- `minimum_capacity`. The maximum value may increase in the future.
- If unspecified, the capacity will be the source snapshot's
- `minimum_capacity`.
- :param EncryptionKeyIdentity encryption_key: (optional) The root key to use
- to wrap the data encryption key for the volume.
- If unspecified, the `encryption` type for the volume will be
- `provider_managed`.
+ :param str crn: The CRN for this virtual network interface.
"""
# pylint: disable=super-init-not-called
- self.iops = iops
- self.name = name
- self.profile = profile
- self.resource_group = resource_group
- self.user_tags = user_tags
- self.zone = zone
- self.capacity = capacity
- self.encryption_key = encryption_key
- self.source_snapshot = source_snapshot
+ self.crn = crn
@classmethod
- def from_dict(cls, _dict: Dict) -> 'VolumePrototypeVolumeBySourceSnapshot':
- """Initialize a VolumePrototypeVolumeBySourceSnapshot object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN':
+ """Initialize a FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN object from a json dictionary."""
args = {}
- if 'iops' in _dict:
- args['iops'] = _dict.get('iops')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
- if 'profile' in _dict:
- args['profile'] = _dict.get('profile')
- else:
- raise ValueError('Required property \'profile\' not present in VolumePrototypeVolumeBySourceSnapshot JSON')
- if 'resource_group' in _dict:
- args['resource_group'] = _dict.get('resource_group')
- if 'user_tags' in _dict:
- args['user_tags'] = _dict.get('user_tags')
- if 'zone' in _dict:
- args['zone'] = _dict.get('zone')
+ if (crn := _dict.get('crn')) is not None:
+ args['crn'] = crn
else:
- raise ValueError('Required property \'zone\' not present in VolumePrototypeVolumeBySourceSnapshot JSON')
- if 'capacity' in _dict:
- args['capacity'] = _dict.get('capacity')
- if 'encryption_key' in _dict:
- args['encryption_key'] = _dict.get('encryption_key')
- if 'source_snapshot' in _dict:
- args['source_snapshot'] = _dict.get('source_snapshot')
- else:
- raise ValueError('Required property \'source_snapshot\' not present in VolumePrototypeVolumeBySourceSnapshot JSON')
+ raise ValueError('Required property \'crn\' not present in FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VolumePrototypeVolumeBySourceSnapshot object from a json dictionary."""
+ """Initialize a FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'iops') and self.iops is not None:
- _dict['iops'] = self.iops
- if hasattr(self, 'name') and self.name is not None:
- _dict['name'] = self.name
- if hasattr(self, 'profile') and self.profile is not None:
- if isinstance(self.profile, dict):
- _dict['profile'] = self.profile
- else:
- _dict['profile'] = self.profile.to_dict()
- if hasattr(self, 'resource_group') and self.resource_group is not None:
- if isinstance(self.resource_group, dict):
- _dict['resource_group'] = self.resource_group
- else:
- _dict['resource_group'] = self.resource_group.to_dict()
- if hasattr(self, 'user_tags') and self.user_tags is not None:
- _dict['user_tags'] = self.user_tags
- if hasattr(self, 'zone') and self.zone is not None:
- if isinstance(self.zone, dict):
- _dict['zone'] = self.zone
- else:
- _dict['zone'] = self.zone.to_dict()
- if hasattr(self, 'capacity') and self.capacity is not None:
- _dict['capacity'] = self.capacity
- if hasattr(self, 'encryption_key') and self.encryption_key is not None:
- if isinstance(self.encryption_key, dict):
- _dict['encryption_key'] = self.encryption_key
- else:
- _dict['encryption_key'] = self.encryption_key.to_dict()
- if hasattr(self, 'source_snapshot') and self.source_snapshot is not None:
- if isinstance(self.source_snapshot, dict):
- _dict['source_snapshot'] = self.source_snapshot
- else:
- _dict['source_snapshot'] = self.source_snapshot.to_dict()
+ if hasattr(self, 'crn') and self.crn is not None:
+ _dict['crn'] = self.crn
return _dict
def _to_dict(self):
@@ -123215,25 +138268,25 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this VolumePrototypeVolumeBySourceSnapshot object."""
+ """Return a `str` version of this FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VolumePrototypeVolumeBySourceSnapshot') -> bool:
+ def __eq__(self, other: 'FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'VolumePrototypeVolumeBySourceSnapshot') -> bool:
+ def __ne__(self, other: 'FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class ZoneIdentityByHref(ZoneIdentity):
+class FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref(FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentity):
"""
- ZoneIdentityByHref.
+ FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref.
- :attr str href: The URL for this zone.
+ :param str href: The URL for this virtual network interface.
"""
def __init__(
@@ -123241,26 +138294,26 @@ def __init__(
href: str,
) -> None:
"""
- Initialize a ZoneIdentityByHref object.
+ Initialize a FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref object.
- :param str href: The URL for this zone.
+ :param str href: The URL for this virtual network interface.
"""
# pylint: disable=super-init-not-called
self.href = href
@classmethod
- def from_dict(cls, _dict: Dict) -> 'ZoneIdentityByHref':
- """Initialize a ZoneIdentityByHref object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref':
+ """Initialize a FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref object from a json dictionary."""
args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'href\' not present in ZoneIdentityByHref JSON')
+ raise ValueError('Required property \'href\' not present in FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a ZoneIdentityByHref object from a json dictionary."""
+ """Initialize a FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -123275,59 +138328,59 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this ZoneIdentityByHref object."""
+ """Return a `str` version of this FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'ZoneIdentityByHref') -> bool:
+ def __eq__(self, other: 'FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'ZoneIdentityByHref') -> bool:
+ def __ne__(self, other: 'FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class ZoneIdentityByName(ZoneIdentity):
+class FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById(FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentity):
"""
- ZoneIdentityByName.
+ FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById.
- :attr str name: The globally unique name for this zone.
+ :param str id: The unique identifier for this virtual network interface.
"""
def __init__(
self,
- name: str,
+ id: str,
) -> None:
"""
- Initialize a ZoneIdentityByName object.
+ Initialize a FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById object.
- :param str name: The globally unique name for this zone.
+ :param str id: The unique identifier for this virtual network interface.
"""
# pylint: disable=super-init-not-called
- self.name = name
+ self.id = id
@classmethod
- def from_dict(cls, _dict: Dict) -> 'ZoneIdentityByName':
- """Initialize a ZoneIdentityByName object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById':
+ """Initialize a FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById object from a json dictionary."""
args = {}
- if 'name' in _dict:
- args['name'] = _dict.get('name')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
else:
- raise ValueError('Required property \'name\' not present in ZoneIdentityByName JSON')
+ raise ValueError('Required property \'id\' not present in FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a ZoneIdentityByName object from a json dictionary."""
+ """Initialize a FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById object from 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, 'id') and self.id is not None:
+ _dict['id'] = self.id
return _dict
def _to_dict(self):
@@ -123335,59 +138388,297 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this ZoneIdentityByName object."""
+ """Return a `str` version of this FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'ZoneIdentityByName') -> bool:
+ def __eq__(self, other: 'FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'ZoneIdentityByName') -> bool:
+ def __ne__(self, other: 'FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class BackupPolicyScopePrototypeEnterpriseIdentityEnterpriseIdentityByCRN(BackupPolicyScopePrototypeEnterpriseIdentity):
+class InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpec(InstanceGroupManagerActionPrototypeScheduledActionPrototype):
"""
- BackupPolicyScopePrototypeEnterpriseIdentityEnterpriseIdentityByCRN.
+ InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpec.
- :attr str crn: The CRN for this enterprise.
+ :param str name: (optional) The name for this instance group manager action. The
+ name must not be used by another action for the instance group manager. If
+ unspecified, the name will be a hyphenated list of randomly-selected words.
+ :param str cron_spec: (optional) The cron specification for a recurring
+ scheduled action. Actions can be applied a maximum of one time within a 5 min
+ period.
"""
def __init__(
self,
- crn: str,
+ *,
+ name: Optional[str] = None,
+ cron_spec: Optional[str] = None,
) -> None:
"""
- Initialize a BackupPolicyScopePrototypeEnterpriseIdentityEnterpriseIdentityByCRN object.
+ Initialize a InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpec object.
- :param str crn: The CRN for this enterprise.
+ :param str name: (optional) The name for this instance group manager
+ action. The name must not be used by another action for the instance group
+ manager. If unspecified, the name will be a hyphenated list of
+ randomly-selected words.
+ :param str cron_spec: (optional) The cron specification for a recurring
+ scheduled action. Actions can be applied a maximum of one time within a 5
+ min period.
"""
# pylint: disable=super-init-not-called
- self.crn = crn
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByGroup', 'InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByManager'])
+ )
+ raise Exception(msg)
+
+
+class InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAt(InstanceGroupManagerActionPrototypeScheduledActionPrototype):
+ """
+ InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAt.
+
+ :param str name: (optional) The name for this instance group manager action. The
+ name must not be used by another action for the instance group manager. If
+ unspecified, the name will be a hyphenated list of randomly-selected words.
+ :param datetime run_at: (optional) The date and time the scheduled action will
+ run.
+ """
+
+ def __init__(
+ self,
+ *,
+ name: Optional[str] = None,
+ run_at: Optional[datetime] = None,
+ ) -> None:
+ """
+ Initialize a InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAt object.
+
+ :param str name: (optional) The name for this instance group manager
+ action. The name must not be used by another action for the instance group
+ manager. If unspecified, the name will be a hyphenated list of
+ randomly-selected words.
+ :param datetime run_at: (optional) The date and time the scheduled action
+ will run.
+ """
+ # pylint: disable=super-init-not-called
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroup', 'InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByManager'])
+ )
+ raise Exception(msg)
+
+
+class InstanceGroupManagerActionScheduledActionGroupTarget(InstanceGroupManagerActionScheduledAction):
+ """
+ InstanceGroupManagerActionScheduledActionGroupTarget.
+
+ :param bool auto_delete: Indicates whether this scheduled action will be
+ automatically deleted after it has completed and `auto_delete_timeout` hours
+ have passed. At present, this is always
+ `true`, but may be modifiable in the future.
+ :param int auto_delete_timeout: If `auto_delete` is `true`, and this scheduled
+ action has finished, the hours after which it will be automatically deleted. If
+ the value is `0`, the action will be deleted once it has finished. This value
+ may be modifiable in the future.
+ :param datetime created_at: The date and time that the instance group manager
+ action was created.
+ :param str href: The URL for this instance group manager action.
+ :param str id: The unique identifier for this instance group manager action.
+ :param str name: The name for this instance group manager action. The name is
+ unique across all actions for the instance group manager.
+ :param str resource_type: The resource type.
+ :param str status: The status of the instance group action
+ - `active`: Action is ready to be run
+ - `completed`: Action was completed successfully
+ - `failed`: Action could not be completed successfully
+ - `incompatible`: Action parameters are not compatible with the group or manager
+ - `omitted`: Action was not applied because this action's manager was disabled.
+ :param datetime updated_at: The date and time that the instance group manager
+ action was updated.
+ :param str action_type: The type of action for the instance group.
+ :param str cron_spec: (optional) The cron specification for a recurring
+ scheduled action. Actions can be applied a maximum of one time within a 5 min
+ period.
+ :param datetime last_applied_at: (optional) The date and time the scheduled
+ action was last applied. If absent, the action has never been applied.
+ :param datetime next_run_at: (optional) The date and time the scheduled action
+ will next run. If absent, the system is currently calculating the next run time.
+ :param InstanceGroupManagerScheduledActionGroup group:
+ """
+
+ def __init__(
+ self,
+ auto_delete: bool,
+ auto_delete_timeout: int,
+ created_at: datetime,
+ href: str,
+ id: str,
+ name: str,
+ resource_type: str,
+ status: str,
+ updated_at: datetime,
+ action_type: str,
+ group: 'InstanceGroupManagerScheduledActionGroup',
+ *,
+ cron_spec: Optional[str] = None,
+ last_applied_at: Optional[datetime] = None,
+ next_run_at: Optional[datetime] = None,
+ ) -> None:
+ """
+ Initialize a InstanceGroupManagerActionScheduledActionGroupTarget object.
+
+ :param bool auto_delete: Indicates whether this scheduled action will be
+ automatically deleted after it has completed and `auto_delete_timeout`
+ hours have passed. At present, this is always
+ `true`, but may be modifiable in the future.
+ :param int auto_delete_timeout: If `auto_delete` is `true`, and this
+ scheduled action has finished, the hours after which it will be
+ automatically deleted. If the value is `0`, the action will be deleted once
+ it has finished. This value may be modifiable in the future.
+ :param datetime created_at: The date and time that the instance group
+ manager action was created.
+ :param str href: The URL for this instance group manager action.
+ :param str id: The unique identifier for this instance group manager
+ action.
+ :param str name: The name for this instance group manager action. The name
+ is unique across all actions for the instance group manager.
+ :param str resource_type: The resource type.
+ :param str status: The status of the instance group action
+ - `active`: Action is ready to be run
+ - `completed`: Action was completed successfully
+ - `failed`: Action could not be completed successfully
+ - `incompatible`: Action parameters are not compatible with the group or
+ manager
+ - `omitted`: Action was not applied because this action's manager was
+ disabled.
+ :param datetime updated_at: The date and time that the instance group
+ manager action was updated.
+ :param str action_type: The type of action for the instance group.
+ :param InstanceGroupManagerScheduledActionGroup group:
+ :param str cron_spec: (optional) The cron specification for a recurring
+ scheduled action. Actions can be applied a maximum of one time within a 5
+ min period.
+ :param datetime last_applied_at: (optional) The date and time the scheduled
+ action was last applied. If absent, the action has never been applied.
+ :param datetime next_run_at: (optional) The date and time the scheduled
+ action will next run. If absent, the system is currently calculating the
+ next run time.
+ """
+ # pylint: disable=super-init-not-called
+ self.auto_delete = auto_delete
+ self.auto_delete_timeout = auto_delete_timeout
+ self.created_at = created_at
+ self.href = href
+ self.id = id
+ self.name = name
+ self.resource_type = resource_type
+ self.status = status
+ self.updated_at = updated_at
+ self.action_type = action_type
+ self.cron_spec = cron_spec
+ self.last_applied_at = last_applied_at
+ self.next_run_at = next_run_at
+ self.group = group
@classmethod
- def from_dict(cls, _dict: Dict) -> 'BackupPolicyScopePrototypeEnterpriseIdentityEnterpriseIdentityByCRN':
- """Initialize a BackupPolicyScopePrototypeEnterpriseIdentityEnterpriseIdentityByCRN object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerActionScheduledActionGroupTarget':
+ """Initialize a InstanceGroupManagerActionScheduledActionGroupTarget object from a json dictionary."""
args = {}
- if 'crn' in _dict:
- args['crn'] = _dict.get('crn')
+ if (auto_delete := _dict.get('auto_delete')) is not None:
+ args['auto_delete'] = auto_delete
else:
- raise ValueError('Required property \'crn\' not present in BackupPolicyScopePrototypeEnterpriseIdentityEnterpriseIdentityByCRN JSON')
+ raise ValueError('Required property \'auto_delete\' not present in InstanceGroupManagerActionScheduledActionGroupTarget JSON')
+ if (auto_delete_timeout := _dict.get('auto_delete_timeout')) is not None:
+ args['auto_delete_timeout'] = auto_delete_timeout
+ else:
+ raise ValueError('Required property \'auto_delete_timeout\' not present in InstanceGroupManagerActionScheduledActionGroupTarget JSON')
+ if (created_at := _dict.get('created_at')) is not None:
+ args['created_at'] = string_to_datetime(created_at)
+ else:
+ raise ValueError('Required property \'created_at\' not present in InstanceGroupManagerActionScheduledActionGroupTarget JSON')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
+ else:
+ raise ValueError('Required property \'href\' not present in InstanceGroupManagerActionScheduledActionGroupTarget JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
+ else:
+ raise ValueError('Required property \'id\' not present in InstanceGroupManagerActionScheduledActionGroupTarget JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ else:
+ raise ValueError('Required property \'name\' not present in InstanceGroupManagerActionScheduledActionGroupTarget JSON')
+ if (resource_type := _dict.get('resource_type')) is not None:
+ args['resource_type'] = resource_type
+ else:
+ raise ValueError('Required property \'resource_type\' not present in InstanceGroupManagerActionScheduledActionGroupTarget JSON')
+ if (status := _dict.get('status')) is not None:
+ args['status'] = status
+ else:
+ raise ValueError('Required property \'status\' not present in InstanceGroupManagerActionScheduledActionGroupTarget JSON')
+ if (updated_at := _dict.get('updated_at')) is not None:
+ args['updated_at'] = string_to_datetime(updated_at)
+ else:
+ raise ValueError('Required property \'updated_at\' not present in InstanceGroupManagerActionScheduledActionGroupTarget JSON')
+ if (action_type := _dict.get('action_type')) is not None:
+ args['action_type'] = action_type
+ else:
+ raise ValueError('Required property \'action_type\' not present in InstanceGroupManagerActionScheduledActionGroupTarget JSON')
+ if (cron_spec := _dict.get('cron_spec')) is not None:
+ args['cron_spec'] = cron_spec
+ if (last_applied_at := _dict.get('last_applied_at')) is not None:
+ args['last_applied_at'] = string_to_datetime(last_applied_at)
+ if (next_run_at := _dict.get('next_run_at')) is not None:
+ args['next_run_at'] = string_to_datetime(next_run_at)
+ if (group := _dict.get('group')) is not None:
+ args['group'] = InstanceGroupManagerScheduledActionGroup.from_dict(group)
+ else:
+ raise ValueError('Required property \'group\' not present in InstanceGroupManagerActionScheduledActionGroupTarget JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a BackupPolicyScopePrototypeEnterpriseIdentityEnterpriseIdentityByCRN object from a json dictionary."""
+ """Initialize a InstanceGroupManagerActionScheduledActionGroupTarget object from 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, 'auto_delete') and self.auto_delete is not None:
+ _dict['auto_delete'] = self.auto_delete
+ if hasattr(self, 'auto_delete_timeout') and self.auto_delete_timeout is not None:
+ _dict['auto_delete_timeout'] = self.auto_delete_timeout
+ if hasattr(self, 'created_at') and self.created_at is not None:
+ _dict['created_at'] = datetime_to_string(self.created_at)
+ if hasattr(self, 'href') and self.href 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, 'updated_at') and self.updated_at is not None:
+ _dict['updated_at'] = datetime_to_string(self.updated_at)
+ if hasattr(self, 'action_type') and self.action_type is not None:
+ _dict['action_type'] = self.action_type
+ if hasattr(self, 'cron_spec') and self.cron_spec is not None:
+ _dict['cron_spec'] = self.cron_spec
+ if hasattr(self, 'last_applied_at') and self.last_applied_at is not None:
+ _dict['last_applied_at'] = datetime_to_string(self.last_applied_at)
+ if hasattr(self, 'next_run_at') and self.next_run_at is not None:
+ _dict['next_run_at'] = datetime_to_string(self.next_run_at)
+ if hasattr(self, 'group') and self.group is not None:
+ if isinstance(self.group, dict):
+ _dict['group'] = self.group
+ else:
+ _dict['group'] = self.group.to_dict()
return _dict
def _to_dict(self):
@@ -123395,59 +138686,260 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this BackupPolicyScopePrototypeEnterpriseIdentityEnterpriseIdentityByCRN object."""
+ """Return a `str` version of this InstanceGroupManagerActionScheduledActionGroupTarget object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'BackupPolicyScopePrototypeEnterpriseIdentityEnterpriseIdentityByCRN') -> bool:
+ def __eq__(self, other: 'InstanceGroupManagerActionScheduledActionGroupTarget') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'BackupPolicyScopePrototypeEnterpriseIdentityEnterpriseIdentityByCRN') -> bool:
+ def __ne__(self, other: 'InstanceGroupManagerActionScheduledActionGroupTarget') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
+ class ResourceTypeEnum(str, Enum):
+ """
+ The resource type.
+ """
-class EndpointGatewayReservedIPReservedIPIdentityByHref(EndpointGatewayReservedIPReservedIPIdentity):
+ INSTANCE_GROUP_MANAGER_ACTION = 'instance_group_manager_action'
+
+
+ class StatusEnum(str, Enum):
+ """
+ The status of the instance group action
+ - `active`: Action is ready to be run
+ - `completed`: Action was completed successfully
+ - `failed`: Action could not be completed successfully
+ - `incompatible`: Action parameters are not compatible with the group or manager
+ - `omitted`: Action was not applied because this action's manager was disabled.
+ """
+
+ ACTIVE = 'active'
+ COMPLETED = 'completed'
+ FAILED = 'failed'
+ INCOMPATIBLE = 'incompatible'
+ OMITTED = 'omitted'
+
+
+ class ActionTypeEnum(str, Enum):
+ """
+ The type of action for the instance group.
+ """
+
+ SCHEDULED = 'scheduled'
+
+
+
+class InstanceGroupManagerActionScheduledActionManagerTarget(InstanceGroupManagerActionScheduledAction):
"""
- EndpointGatewayReservedIPReservedIPIdentityByHref.
+ InstanceGroupManagerActionScheduledActionManagerTarget.
- :attr str href: The URL for this reserved IP.
+ :param bool auto_delete: Indicates whether this scheduled action will be
+ automatically deleted after it has completed and `auto_delete_timeout` hours
+ have passed. At present, this is always
+ `true`, but may be modifiable in the future.
+ :param int auto_delete_timeout: If `auto_delete` is `true`, and this scheduled
+ action has finished, the hours after which it will be automatically deleted. If
+ the value is `0`, the action will be deleted once it has finished. This value
+ may be modifiable in the future.
+ :param datetime created_at: The date and time that the instance group manager
+ action was created.
+ :param str href: The URL for this instance group manager action.
+ :param str id: The unique identifier for this instance group manager action.
+ :param str name: The name for this instance group manager action. The name is
+ unique across all actions for the instance group manager.
+ :param str resource_type: The resource type.
+ :param str status: The status of the instance group action
+ - `active`: Action is ready to be run
+ - `completed`: Action was completed successfully
+ - `failed`: Action could not be completed successfully
+ - `incompatible`: Action parameters are not compatible with the group or manager
+ - `omitted`: Action was not applied because this action's manager was disabled.
+ :param datetime updated_at: The date and time that the instance group manager
+ action was updated.
+ :param str action_type: The type of action for the instance group.
+ :param str cron_spec: (optional) The cron specification for a recurring
+ scheduled action. Actions can be applied a maximum of one time within a 5 min
+ period.
+ :param datetime last_applied_at: (optional) The date and time the scheduled
+ action was last applied. If absent, the action has never been applied.
+ :param datetime next_run_at: (optional) The date and time the scheduled action
+ will next run. If absent, the system is currently calculating the next run time.
+ :param InstanceGroupManagerScheduledActionManager manager:
"""
def __init__(
self,
+ auto_delete: bool,
+ auto_delete_timeout: int,
+ created_at: datetime,
href: str,
+ id: str,
+ name: str,
+ resource_type: str,
+ status: str,
+ updated_at: datetime,
+ action_type: str,
+ manager: 'InstanceGroupManagerScheduledActionManager',
+ *,
+ cron_spec: Optional[str] = None,
+ last_applied_at: Optional[datetime] = None,
+ next_run_at: Optional[datetime] = None,
) -> None:
"""
- Initialize a EndpointGatewayReservedIPReservedIPIdentityByHref object.
+ Initialize a InstanceGroupManagerActionScheduledActionManagerTarget object.
- :param str href: The URL for this reserved IP.
+ :param bool auto_delete: Indicates whether this scheduled action will be
+ automatically deleted after it has completed and `auto_delete_timeout`
+ hours have passed. At present, this is always
+ `true`, but may be modifiable in the future.
+ :param int auto_delete_timeout: If `auto_delete` is `true`, and this
+ scheduled action has finished, the hours after which it will be
+ automatically deleted. If the value is `0`, the action will be deleted once
+ it has finished. This value may be modifiable in the future.
+ :param datetime created_at: The date and time that the instance group
+ manager action was created.
+ :param str href: The URL for this instance group manager action.
+ :param str id: The unique identifier for this instance group manager
+ action.
+ :param str name: The name for this instance group manager action. The name
+ is unique across all actions for the instance group manager.
+ :param str resource_type: The resource type.
+ :param str status: The status of the instance group action
+ - `active`: Action is ready to be run
+ - `completed`: Action was completed successfully
+ - `failed`: Action could not be completed successfully
+ - `incompatible`: Action parameters are not compatible with the group or
+ manager
+ - `omitted`: Action was not applied because this action's manager was
+ disabled.
+ :param datetime updated_at: The date and time that the instance group
+ manager action was updated.
+ :param str action_type: The type of action for the instance group.
+ :param InstanceGroupManagerScheduledActionManager manager:
+ :param str cron_spec: (optional) The cron specification for a recurring
+ scheduled action. Actions can be applied a maximum of one time within a 5
+ min period.
+ :param datetime last_applied_at: (optional) The date and time the scheduled
+ action was last applied. If absent, the action has never been applied.
+ :param datetime next_run_at: (optional) The date and time the scheduled
+ action will next run. If absent, the system is currently calculating the
+ next run time.
"""
# pylint: disable=super-init-not-called
+ self.auto_delete = auto_delete
+ self.auto_delete_timeout = auto_delete_timeout
+ self.created_at = created_at
self.href = href
+ self.id = id
+ self.name = name
+ self.resource_type = resource_type
+ self.status = status
+ self.updated_at = updated_at
+ self.action_type = action_type
+ self.cron_spec = cron_spec
+ self.last_applied_at = last_applied_at
+ self.next_run_at = next_run_at
+ self.manager = manager
@classmethod
- def from_dict(cls, _dict: Dict) -> 'EndpointGatewayReservedIPReservedIPIdentityByHref':
- """Initialize a EndpointGatewayReservedIPReservedIPIdentityByHref object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerActionScheduledActionManagerTarget':
+ """Initialize a InstanceGroupManagerActionScheduledActionManagerTarget object from a json dictionary."""
args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ if (auto_delete := _dict.get('auto_delete')) is not None:
+ args['auto_delete'] = auto_delete
+ else:
+ raise ValueError('Required property \'auto_delete\' not present in InstanceGroupManagerActionScheduledActionManagerTarget JSON')
+ if (auto_delete_timeout := _dict.get('auto_delete_timeout')) is not None:
+ args['auto_delete_timeout'] = auto_delete_timeout
+ else:
+ raise ValueError('Required property \'auto_delete_timeout\' not present in InstanceGroupManagerActionScheduledActionManagerTarget JSON')
+ if (created_at := _dict.get('created_at')) is not None:
+ args['created_at'] = string_to_datetime(created_at)
+ else:
+ raise ValueError('Required property \'created_at\' not present in InstanceGroupManagerActionScheduledActionManagerTarget JSON')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
+ else:
+ raise ValueError('Required property \'href\' not present in InstanceGroupManagerActionScheduledActionManagerTarget JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
else:
- raise ValueError('Required property \'href\' not present in EndpointGatewayReservedIPReservedIPIdentityByHref JSON')
+ raise ValueError('Required property \'id\' not present in InstanceGroupManagerActionScheduledActionManagerTarget JSON')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ else:
+ raise ValueError('Required property \'name\' not present in InstanceGroupManagerActionScheduledActionManagerTarget JSON')
+ if (resource_type := _dict.get('resource_type')) is not None:
+ args['resource_type'] = resource_type
+ else:
+ raise ValueError('Required property \'resource_type\' not present in InstanceGroupManagerActionScheduledActionManagerTarget JSON')
+ if (status := _dict.get('status')) is not None:
+ args['status'] = status
+ else:
+ raise ValueError('Required property \'status\' not present in InstanceGroupManagerActionScheduledActionManagerTarget JSON')
+ if (updated_at := _dict.get('updated_at')) is not None:
+ args['updated_at'] = string_to_datetime(updated_at)
+ else:
+ raise ValueError('Required property \'updated_at\' not present in InstanceGroupManagerActionScheduledActionManagerTarget JSON')
+ if (action_type := _dict.get('action_type')) is not None:
+ args['action_type'] = action_type
+ else:
+ raise ValueError('Required property \'action_type\' not present in InstanceGroupManagerActionScheduledActionManagerTarget JSON')
+ if (cron_spec := _dict.get('cron_spec')) is not None:
+ args['cron_spec'] = cron_spec
+ if (last_applied_at := _dict.get('last_applied_at')) is not None:
+ args['last_applied_at'] = string_to_datetime(last_applied_at)
+ if (next_run_at := _dict.get('next_run_at')) is not None:
+ args['next_run_at'] = string_to_datetime(next_run_at)
+ if (manager := _dict.get('manager')) is not None:
+ args['manager'] = manager
+ else:
+ raise ValueError('Required property \'manager\' not present in InstanceGroupManagerActionScheduledActionManagerTarget JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a EndpointGatewayReservedIPReservedIPIdentityByHref object from a json dictionary."""
+ """Initialize a InstanceGroupManagerActionScheduledActionManagerTarget object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
+ if hasattr(self, 'auto_delete') and self.auto_delete is not None:
+ _dict['auto_delete'] = self.auto_delete
+ if hasattr(self, 'auto_delete_timeout') and self.auto_delete_timeout is not None:
+ _dict['auto_delete_timeout'] = self.auto_delete_timeout
+ if hasattr(self, 'created_at') and self.created_at is not None:
+ _dict['created_at'] = datetime_to_string(self.created_at)
if hasattr(self, 'href') and self.href 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, 'updated_at') and self.updated_at is not None:
+ _dict['updated_at'] = datetime_to_string(self.updated_at)
+ if hasattr(self, 'action_type') and self.action_type is not None:
+ _dict['action_type'] = self.action_type
+ if hasattr(self, 'cron_spec') and self.cron_spec is not None:
+ _dict['cron_spec'] = self.cron_spec
+ if hasattr(self, 'last_applied_at') and self.last_applied_at is not None:
+ _dict['last_applied_at'] = datetime_to_string(self.last_applied_at)
+ if hasattr(self, 'next_run_at') and self.next_run_at is not None:
+ _dict['next_run_at'] = datetime_to_string(self.next_run_at)
+ if hasattr(self, 'manager') and self.manager is not None:
+ if isinstance(self.manager, dict):
+ _dict['manager'] = self.manager
+ else:
+ _dict['manager'] = self.manager.to_dict()
return _dict
def _to_dict(self):
@@ -123455,59 +138947,113 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this EndpointGatewayReservedIPReservedIPIdentityByHref object."""
+ """Return a `str` version of this InstanceGroupManagerActionScheduledActionManagerTarget object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'EndpointGatewayReservedIPReservedIPIdentityByHref') -> bool:
+ def __eq__(self, other: 'InstanceGroupManagerActionScheduledActionManagerTarget') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'EndpointGatewayReservedIPReservedIPIdentityByHref') -> bool:
+ def __ne__(self, other: 'InstanceGroupManagerActionScheduledActionManagerTarget') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
+ class ResourceTypeEnum(str, Enum):
+ """
+ The resource type.
+ """
-class EndpointGatewayReservedIPReservedIPIdentityById(EndpointGatewayReservedIPReservedIPIdentity):
+ INSTANCE_GROUP_MANAGER_ACTION = 'instance_group_manager_action'
+
+
+ class StatusEnum(str, Enum):
+ """
+ The status of the instance group action
+ - `active`: Action is ready to be run
+ - `completed`: Action was completed successfully
+ - `failed`: Action could not be completed successfully
+ - `incompatible`: Action parameters are not compatible with the group or manager
+ - `omitted`: Action was not applied because this action's manager was disabled.
+ """
+
+ ACTIVE = 'active'
+ COMPLETED = 'completed'
+ FAILED = 'failed'
+ INCOMPATIBLE = 'incompatible'
+ OMITTED = 'omitted'
+
+
+ class ActionTypeEnum(str, Enum):
+ """
+ The type of action for the instance group.
+ """
+
+ SCHEDULED = 'scheduled'
+
+
+
+class InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByHref(InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototype):
"""
- EndpointGatewayReservedIPReservedIPIdentityById.
+ InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByHref.
- :attr str id: The unique identifier for this reserved IP.
+ :param int max_membership_count: (optional) The desired maximum number of
+ instance group members at the scheduled time.
+ :param int min_membership_count: (optional) The desired minimum number of
+ instance group members at the scheduled time.
+ :param str href: The URL for this instance group manager.
"""
def __init__(
self,
- id: str,
+ href: str,
+ *,
+ max_membership_count: Optional[int] = None,
+ min_membership_count: Optional[int] = None,
) -> None:
"""
- Initialize a EndpointGatewayReservedIPReservedIPIdentityById object.
+ Initialize a InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByHref object.
- :param str id: The unique identifier for this reserved IP.
+ :param str href: The URL for this instance group manager.
+ :param int max_membership_count: (optional) The desired maximum number of
+ instance group members at the scheduled time.
+ :param int min_membership_count: (optional) The desired minimum number of
+ instance group members at the scheduled time.
"""
# pylint: disable=super-init-not-called
- self.id = id
+ self.max_membership_count = max_membership_count
+ self.min_membership_count = min_membership_count
+ self.href = href
@classmethod
- def from_dict(cls, _dict: Dict) -> 'EndpointGatewayReservedIPReservedIPIdentityById':
- """Initialize a EndpointGatewayReservedIPReservedIPIdentityById object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByHref':
+ """Initialize a InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByHref object from a json dictionary."""
args = {}
- if 'id' in _dict:
- args['id'] = _dict.get('id')
+ if (max_membership_count := _dict.get('max_membership_count')) is not None:
+ args['max_membership_count'] = max_membership_count
+ if (min_membership_count := _dict.get('min_membership_count')) is not None:
+ args['min_membership_count'] = min_membership_count
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'id\' not present in EndpointGatewayReservedIPReservedIPIdentityById JSON')
+ raise ValueError('Required property \'href\' not present in InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByHref JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a EndpointGatewayReservedIPReservedIPIdentityById object from a json dictionary."""
+ """Initialize a InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByHref object from 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, '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, 'href') and self.href is not None:
+ _dict['href'] = self.href
return _dict
def _to_dict(self):
@@ -123515,71 +139061,80 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this EndpointGatewayReservedIPReservedIPIdentityById object."""
+ """Return a `str` version of this InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByHref object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'EndpointGatewayReservedIPReservedIPIdentityById') -> bool:
+ def __eq__(self, other: 'InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByHref') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'EndpointGatewayReservedIPReservedIPIdentityById') -> bool:
+ def __ne__(self, other: 'InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByHref') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class EndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRN(EndpointGatewayTargetPrototypeProviderCloudServiceIdentity):
+class InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeById(InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototype):
"""
- EndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRN.
+ InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeById.
- :attr str resource_type: The type of target for this endpoint gateway.
- :attr str crn: The CRN for this provider cloud service, or the CRN for the
- user's instance of a provider cloud service.
+ :param int max_membership_count: (optional) The desired maximum number of
+ instance group members at the scheduled time.
+ :param int min_membership_count: (optional) The desired minimum number of
+ instance group members at the scheduled time.
+ :param str id: The unique identifier for this instance group manager.
"""
def __init__(
self,
- resource_type: str,
- crn: str,
+ id: str,
+ *,
+ max_membership_count: Optional[int] = None,
+ min_membership_count: Optional[int] = None,
) -> None:
"""
- Initialize a EndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRN object.
+ Initialize a InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeById object.
- :param str resource_type: The type of target for this endpoint gateway.
- :param str crn: The CRN for this provider cloud service, or the CRN for the
- user's instance of a provider cloud service.
+ :param str id: The unique identifier for this instance group manager.
+ :param int max_membership_count: (optional) The desired maximum number of
+ instance group members at the scheduled time.
+ :param int min_membership_count: (optional) The desired minimum number of
+ instance group members at the scheduled time.
"""
# pylint: disable=super-init-not-called
- self.resource_type = resource_type
- self.crn = crn
+ self.max_membership_count = max_membership_count
+ self.min_membership_count = min_membership_count
+ self.id = id
@classmethod
- def from_dict(cls, _dict: Dict) -> 'EndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRN':
- """Initialize a EndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRN object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeById':
+ """Initialize a InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeById object from a json dictionary."""
args = {}
- if 'resource_type' in _dict:
- args['resource_type'] = _dict.get('resource_type')
- else:
- raise ValueError('Required property \'resource_type\' not present in EndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRN JSON')
- if 'crn' in _dict:
- args['crn'] = _dict.get('crn')
+ if (max_membership_count := _dict.get('max_membership_count')) is not None:
+ args['max_membership_count'] = max_membership_count
+ if (min_membership_count := _dict.get('min_membership_count')) is not None:
+ args['min_membership_count'] = min_membership_count
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
else:
- raise ValueError('Required property \'crn\' not present in EndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRN JSON')
+ raise ValueError('Required property \'id\' not present in InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeById JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a EndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRN object from a json dictionary."""
+ """Initialize a InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeById object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'resource_type') and self.resource_type is not None:
- _dict['resource_type'] = self.resource_type
- if hasattr(self, 'crn') and self.crn is not None:
- _dict['crn'] = self.crn
+ 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, 'id') and self.id is not None:
+ _dict['id'] = self.id
return _dict
def _to_dict(self):
@@ -123587,80 +139142,59 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this EndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRN object."""
+ """Return a `str` version of this InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeById object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'EndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRN') -> bool:
+ def __eq__(self, other: 'InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeById') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'EndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRN') -> bool:
+ def __ne__(self, other: 'InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeById') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- 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 EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityProviderInfrastructureServiceIdentityByName(EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentity):
+class InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN(InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentity):
"""
- The name of this provider infrastructure service.
+ InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN.
- :attr str resource_type: The type of target for this endpoint gateway.
- :attr str name: The name of a provider infrastructure service. Must be:
- - `ibm-ntp-server`: An NTP (Network Time Protocol) server provided by IBM.
+ :param str crn: The CRN for this virtual network interface.
"""
def __init__(
self,
- resource_type: str,
- name: str,
+ crn: str,
) -> None:
"""
- Initialize a EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityProviderInfrastructureServiceIdentityByName object.
+ Initialize a InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN object.
- :param str resource_type: The type of target for this endpoint gateway.
- :param str name: The name of a provider infrastructure service. Must be:
- - `ibm-ntp-server`: An NTP (Network Time Protocol) server provided by IBM.
+ :param str crn: The CRN for this virtual network interface.
"""
# pylint: disable=super-init-not-called
- self.resource_type = resource_type
- self.name = name
+ self.crn = crn
@classmethod
- def from_dict(cls, _dict: Dict) -> 'EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityProviderInfrastructureServiceIdentityByName':
- """Initialize a EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityProviderInfrastructureServiceIdentityByName object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN':
+ """Initialize a InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN object from a json dictionary."""
args = {}
- if 'resource_type' in _dict:
- args['resource_type'] = _dict.get('resource_type')
+ if (crn := _dict.get('crn')) is not None:
+ args['crn'] = crn
else:
- raise ValueError('Required property \'resource_type\' not present in EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityProviderInfrastructureServiceIdentityByName JSON')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
- else:
- raise ValueError('Required property \'name\' not present in EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityProviderInfrastructureServiceIdentityByName JSON')
+ raise ValueError('Required property \'crn\' not present in InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityProviderInfrastructureServiceIdentityByName object from a json dictionary."""
+ """Initialize a InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'resource_type') and self.resource_type is not None:
- _dict['resource_type'] = self.resource_type
- if hasattr(self, 'name') and self.name is not None:
- _dict['name'] = self.name
+ if hasattr(self, 'crn') and self.crn is not None:
+ _dict['crn'] = self.crn
return _dict
def _to_dict(self):
@@ -123668,34 +139202,25 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityProviderInfrastructureServiceIdentityByName object."""
+ """Return a `str` version of this InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityProviderInfrastructureServiceIdentityByName') -> bool:
+ def __eq__(self, other: 'InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityProviderInfrastructureServiceIdentityByName') -> bool:
+ def __ne__(self, other: 'InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- 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 FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref(FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentity):
+class InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref(InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentity):
"""
- FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref.
+ InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref.
- :attr str href: The URL for this bare metal server network interface.
+ :param str href: The URL for this virtual network interface.
"""
def __init__(
@@ -123703,26 +139228,26 @@ def __init__(
href: str,
) -> None:
"""
- Initialize a FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref object.
+ Initialize a InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref object.
- :param str href: The URL for this bare metal server network interface.
+ :param str href: The URL for this virtual network interface.
"""
# pylint: disable=super-init-not-called
self.href = href
@classmethod
- def from_dict(cls, _dict: Dict) -> 'FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref':
- """Initialize a FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref':
+ """Initialize a InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref object from a json dictionary."""
args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'href\' not present in FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref JSON')
+ raise ValueError('Required property \'href\' not present in InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref object from a json dictionary."""
+ """Initialize a InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -123737,26 +139262,25 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref object."""
+ """Return a `str` version of this InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref') -> bool:
+ def __eq__(self, other: 'InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref') -> bool:
+ def __ne__(self, other: 'InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityById(FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentity):
+class InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById(InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentity):
"""
- FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityById.
+ InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById.
- :attr str id: The unique identifier for this bare metal server network
- interface.
+ :param str id: The unique identifier for this virtual network interface.
"""
def __init__(
@@ -123764,27 +139288,26 @@ def __init__(
id: str,
) -> None:
"""
- Initialize a FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityById object.
+ Initialize a InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById object.
- :param str id: The unique identifier for this bare metal server network
- interface.
+ :param str id: The unique identifier for this virtual network interface.
"""
# pylint: disable=super-init-not-called
self.id = id
@classmethod
- def from_dict(cls, _dict: Dict) -> 'FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityById':
- """Initialize a FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityById object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById':
+ """Initialize a InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById object from a json dictionary."""
args = {}
- if 'id' in _dict:
- args['id'] = _dict.get('id')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
else:
- raise ValueError('Required property \'id\' not present in FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityById JSON')
+ raise ValueError('Required property \'id\' not present in InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityById object from a json dictionary."""
+ """Initialize a InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -123799,59 +139322,59 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityById object."""
+ """Return a `str` version of this InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityById') -> bool:
+ def __eq__(self, other: 'InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityById') -> bool:
+ def __ne__(self, other: 'InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByHref(FloatingIPTargetPatchNetworkInterfaceIdentity):
+class InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN(InstancePlacementTargetPatchDedicatedHostGroupIdentity):
"""
- FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByHref.
+ InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN.
- :attr str href: The URL for this instance network interface.
+ :param str crn: The CRN for this dedicated host group.
"""
def __init__(
self,
- href: str,
+ crn: str,
) -> None:
"""
- Initialize a FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByHref object.
+ Initialize a InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN object.
- :param str href: The URL for this instance network interface.
+ :param str crn: The CRN for this dedicated host group.
"""
# pylint: disable=super-init-not-called
- self.href = href
+ self.crn = crn
@classmethod
- def from_dict(cls, _dict: Dict) -> 'FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByHref':
- """Initialize a FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByHref object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN':
+ """Initialize a InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN object from a json dictionary."""
args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ if (crn := _dict.get('crn')) is not None:
+ args['crn'] = crn
else:
- raise ValueError('Required property \'href\' not present in FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByHref JSON')
+ raise ValueError('Required property \'crn\' not present in InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByHref object from a json dictionary."""
+ """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, 'href') and self.href is not None:
- _dict['href'] = self.href
+ if hasattr(self, 'crn') and self.crn is not None:
+ _dict['crn'] = self.crn
return _dict
def _to_dict(self):
@@ -123859,59 +139382,59 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByHref object."""
+ """Return a `str` version of this InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByHref') -> bool:
+ 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: 'FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByHref') -> bool:
+ def __ne__(self, other: 'InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityById(FloatingIPTargetPatchNetworkInterfaceIdentity):
+class InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref(InstancePlacementTargetPatchDedicatedHostGroupIdentity):
"""
- FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityById.
+ InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref.
- :attr str id: The unique identifier for this instance network interface.
+ :param str href: The URL for this dedicated host group.
"""
def __init__(
self,
- id: str,
+ href: str,
) -> None:
"""
- Initialize a FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityById object.
+ Initialize a InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref object.
- :param str id: The unique identifier for this instance network interface.
+ :param str href: The URL for this dedicated host group.
"""
# pylint: disable=super-init-not-called
- self.id = id
+ self.href = href
@classmethod
- def from_dict(cls, _dict: Dict) -> 'FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityById':
- """Initialize a FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityById object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref':
+ """Initialize a InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref object from a json dictionary."""
args = {}
- if 'id' in _dict:
- args['id'] = _dict.get('id')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'id\' not present in FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityById JSON')
+ raise ValueError('Required property \'href\' not present in InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityById object from a json dictionary."""
+ """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, 'id') and self.id is not None:
- _dict['id'] = self.id
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
return _dict
def _to_dict(self):
@@ -123919,59 +139442,59 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityById object."""
+ """Return a `str` version of this InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityById') -> bool:
+ 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: 'FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityById') -> bool:
+ def __ne__(self, other: 'InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref(FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentity):
+class InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityById(InstancePlacementTargetPatchDedicatedHostGroupIdentity):
"""
- FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref.
+ InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityById.
- :attr str href: The URL for this bare metal server network interface.
+ :param str id: The unique identifier for this dedicated host group.
"""
def __init__(
self,
- href: str,
+ id: str,
) -> None:
"""
- Initialize a FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref object.
+ Initialize a InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityById object.
- :param str href: The URL for this bare metal server network interface.
+ :param str id: The unique identifier for this dedicated host group.
"""
# pylint: disable=super-init-not-called
- self.href = href
+ self.id = id
@classmethod
- def from_dict(cls, _dict: Dict) -> 'FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref':
- """Initialize a FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityById':
+ """Initialize a InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityById object from a json dictionary."""
args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
else:
- raise ValueError('Required property \'href\' not present in FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref JSON')
+ raise ValueError('Required property \'id\' not present in InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityById JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref object from a json dictionary."""
+ """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, 'href') 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):
@@ -123979,61 +139502,59 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref object."""
+ """Return a `str` version of this InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityById object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref') -> bool:
+ 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: 'FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref') -> bool:
+ def __ne__(self, other: 'InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityById') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityById(FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentity):
+class InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByCRN(InstancePlacementTargetPatchDedicatedHostIdentity):
"""
- FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityById.
+ InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByCRN.
- :attr str id: The unique identifier for this bare metal server network
- interface.
+ :param str crn: The CRN for this dedicated host.
"""
def __init__(
self,
- id: str,
+ crn: str,
) -> None:
"""
- Initialize a FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityById object.
+ Initialize a InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByCRN object.
- :param str id: The unique identifier for this bare metal server network
- interface.
+ :param str crn: The CRN for this dedicated host.
"""
# pylint: disable=super-init-not-called
- self.id = id
+ self.crn = crn
@classmethod
- def from_dict(cls, _dict: Dict) -> 'FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityById':
- """Initialize a FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityById object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByCRN':
+ """Initialize a InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByCRN object from a json dictionary."""
args = {}
- if 'id' in _dict:
- args['id'] = _dict.get('id')
+ if (crn := _dict.get('crn')) is not None:
+ args['crn'] = crn
else:
- raise ValueError('Required property \'id\' not present in FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityById JSON')
+ raise ValueError('Required property \'crn\' not present in InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByCRN JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityById object from a json dictionary."""
+ """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, 'id') and self.id is not None:
- _dict['id'] = self.id
+ if hasattr(self, 'crn') and self.crn is not None:
+ _dict['crn'] = self.crn
return _dict
def _to_dict(self):
@@ -124041,25 +139562,25 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityById object."""
+ """Return a `str` version of this InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByCRN object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityById') -> bool:
+ 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: 'FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityById') -> bool:
+ def __ne__(self, other: 'InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByCRN') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref(FloatingIPTargetPrototypeNetworkInterfaceIdentity):
+class InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByHref(InstancePlacementTargetPatchDedicatedHostIdentity):
"""
- FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref.
+ InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByHref.
- :attr str href: The URL for this instance network interface.
+ :param str href: The URL for this dedicated host.
"""
def __init__(
@@ -124067,26 +139588,26 @@ def __init__(
href: str,
) -> None:
"""
- Initialize a FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref object.
+ Initialize a InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByHref object.
- :param str href: The URL for this instance network interface.
+ :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) -> 'FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref':
- """Initialize a FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref object from a json dictionary."""
+ 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')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'href\' not present in FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref JSON')
+ raise ValueError('Required property \'href\' not present in InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByHref JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref object from a json dictionary."""
+ """Initialize a InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByHref object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -124101,25 +139622,25 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref object."""
+ """Return a `str` version of this InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByHref object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref') -> bool:
+ 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: 'FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref') -> bool:
+ def __ne__(self, other: 'InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByHref') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityById(FloatingIPTargetPrototypeNetworkInterfaceIdentity):
+class InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityById(InstancePlacementTargetPatchDedicatedHostIdentity):
"""
- FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityById.
+ InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityById.
- :attr str id: The unique identifier for this instance network interface.
+ :param str id: The unique identifier for this dedicated host.
"""
def __init__(
@@ -124127,26 +139648,26 @@ def __init__(
id: str,
) -> None:
"""
- Initialize a FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityById object.
+ Initialize a InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityById object.
- :param str id: The unique identifier for this instance network interface.
+ :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) -> 'FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityById':
- """Initialize a FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityById object from a json dictionary."""
+ 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')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
else:
- raise ValueError('Required property \'id\' not present in FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityById JSON')
+ raise ValueError('Required property \'id\' not present in InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityById JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityById object from a json dictionary."""
+ """Initialize a InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityById object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -124161,25 +139682,25 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityById object."""
+ """Return a `str` version of this InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityById object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityById') -> bool:
+ 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: 'FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityById') -> bool:
+ def __ne__(self, other: 'InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityById') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByCRN(FlowLogCollectorTargetPrototypeInstanceIdentity):
+class InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN(InstancePlacementTargetPrototypeDedicatedHostGroupIdentity):
"""
- FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByCRN.
+ InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN.
- :attr str crn: The CRN for this virtual server instance.
+ :param str crn: The CRN for this dedicated host group.
"""
def __init__(
@@ -124187,26 +139708,26 @@ def __init__(
crn: str,
) -> None:
"""
- Initialize a FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByCRN object.
+ Initialize a InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN object.
- :param str crn: The CRN for this virtual server instance.
+ :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) -> 'FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByCRN':
- """Initialize a FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByCRN object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN':
+ """Initialize a InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN object from a json dictionary."""
args = {}
- if 'crn' in _dict:
- args['crn'] = _dict.get('crn')
+ if (crn := _dict.get('crn')) is not None:
+ args['crn'] = crn
else:
- raise ValueError('Required property \'crn\' not present in FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByCRN JSON')
+ raise ValueError('Required property \'crn\' not present in InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByCRN object from a json dictionary."""
+ """Initialize a InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -124221,25 +139742,25 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByCRN object."""
+ """Return a `str` version of this InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByCRN') -> bool:
+ def __eq__(self, other: 'InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByCRN') -> bool:
+ def __ne__(self, other: 'InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByHref(FlowLogCollectorTargetPrototypeInstanceIdentity):
+class InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref(InstancePlacementTargetPrototypeDedicatedHostGroupIdentity):
"""
- FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByHref.
+ InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref.
- :attr str href: The URL for this virtual server instance.
+ :param str href: The URL for this dedicated host group.
"""
def __init__(
@@ -124247,26 +139768,26 @@ def __init__(
href: str,
) -> None:
"""
- Initialize a FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByHref object.
+ Initialize a InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref object.
- :param str href: The URL for this virtual server instance.
+ :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) -> 'FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByHref':
- """Initialize a FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByHref object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref':
+ """Initialize a InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref object from a json dictionary."""
args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'href\' not present in FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByHref JSON')
+ raise ValueError('Required property \'href\' not present in InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByHref object from a json dictionary."""
+ """Initialize a InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -124281,25 +139802,25 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByHref object."""
+ """Return a `str` version of this InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByHref') -> bool:
+ def __eq__(self, other: 'InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByHref') -> bool:
+ def __ne__(self, other: 'InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityById(FlowLogCollectorTargetPrototypeInstanceIdentity):
+class InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityById(InstancePlacementTargetPrototypeDedicatedHostGroupIdentity):
"""
- FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityById.
+ InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityById.
- :attr str id: The unique identifier for this virtual server instance.
+ :param str id: The unique identifier for this dedicated host group.
"""
def __init__(
@@ -124307,26 +139828,26 @@ def __init__(
id: str,
) -> None:
"""
- Initialize a FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityById object.
+ Initialize a InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityById object.
- :param str id: The unique identifier for this virtual server instance.
+ :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) -> 'FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityById':
- """Initialize a FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityById object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityById':
+ """Initialize a InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityById object from a json dictionary."""
args = {}
- if 'id' in _dict:
- args['id'] = _dict.get('id')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
else:
- raise ValueError('Required property \'id\' not present in FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityById JSON')
+ raise ValueError('Required property \'id\' not present in InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityById JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityById object from a json dictionary."""
+ """Initialize a InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityById object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -124341,59 +139862,59 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityById object."""
+ """Return a `str` version of this InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityById object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityById') -> bool:
+ def __eq__(self, other: 'InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityById') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityById') -> bool:
+ def __ne__(self, other: 'InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityById') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref(FlowLogCollectorTargetPrototypeNetworkInterfaceIdentity):
+class InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByCRN(InstancePlacementTargetPrototypeDedicatedHostIdentity):
"""
- FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref.
+ InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByCRN.
- :attr str href: The URL for this instance network interface.
+ :param str crn: The CRN for this dedicated host.
"""
def __init__(
self,
- href: str,
+ crn: str,
) -> None:
"""
- Initialize a FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref object.
+ Initialize a InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByCRN object.
- :param str href: The URL for this instance network interface.
+ :param str crn: The CRN for this dedicated host.
"""
# pylint: disable=super-init-not-called
- self.href = href
+ self.crn = crn
@classmethod
- def from_dict(cls, _dict: Dict) -> 'FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref':
- """Initialize a FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByCRN':
+ """Initialize a InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByCRN object from a json dictionary."""
args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ if (crn := _dict.get('crn')) is not None:
+ args['crn'] = crn
else:
- raise ValueError('Required property \'href\' not present in FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref JSON')
+ raise ValueError('Required property \'crn\' not present in InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByCRN JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref object from a json dictionary."""
+ """Initialize a InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByCRN object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'href') and self.href is not None:
- _dict['href'] = self.href
+ if hasattr(self, 'crn') and self.crn is not None:
+ _dict['crn'] = self.crn
return _dict
def _to_dict(self):
@@ -124401,59 +139922,59 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref object."""
+ """Return a `str` version of this InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByCRN object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref') -> bool:
+ def __eq__(self, other: 'InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByCRN') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref') -> bool:
+ def __ne__(self, other: 'InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByCRN') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityById(FlowLogCollectorTargetPrototypeNetworkInterfaceIdentity):
+class InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByHref(InstancePlacementTargetPrototypeDedicatedHostIdentity):
"""
- FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityById.
+ InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByHref.
- :attr str id: The unique identifier for this instance network interface.
+ :param str href: The URL for this dedicated host.
"""
def __init__(
self,
- id: str,
+ href: str,
) -> None:
"""
- Initialize a FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityById object.
+ Initialize a InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByHref object.
- :param str id: The unique identifier for this instance network interface.
+ :param str href: The URL for this dedicated host.
"""
# pylint: disable=super-init-not-called
- self.id = id
+ self.href = href
@classmethod
- def from_dict(cls, _dict: Dict) -> 'FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityById':
- """Initialize a FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityById object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByHref':
+ """Initialize a InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByHref object from a json dictionary."""
args = {}
- if 'id' in _dict:
- args['id'] = _dict.get('id')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'id\' not present in FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityById JSON')
+ raise ValueError('Required property \'href\' not present in InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByHref JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityById object from a json dictionary."""
+ """Initialize a InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByHref object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'id') and self.id is not None:
- _dict['id'] = self.id
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
return _dict
def _to_dict(self):
@@ -124461,59 +139982,59 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityById object."""
+ """Return a `str` version of this InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByHref object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityById') -> bool:
+ def __eq__(self, other: 'InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByHref') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityById') -> bool:
+ def __ne__(self, other: 'InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByHref') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByCRN(FlowLogCollectorTargetPrototypeSubnetIdentity):
+class InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById(InstancePlacementTargetPrototypeDedicatedHostIdentity):
"""
- FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByCRN.
+ InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById.
- :attr str crn: The CRN for this subnet.
+ :param str id: The unique identifier for this dedicated host.
"""
def __init__(
self,
- crn: str,
+ id: str,
) -> None:
"""
- Initialize a FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByCRN object.
+ Initialize a InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById object.
- :param str crn: The CRN for this subnet.
+ :param str id: The unique identifier for this dedicated host.
"""
# pylint: disable=super-init-not-called
- self.crn = crn
+ self.id = id
@classmethod
- def from_dict(cls, _dict: Dict) -> 'FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByCRN':
- """Initialize a FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByCRN object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById':
+ """Initialize a InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById object from a json dictionary."""
args = {}
- if 'crn' in _dict:
- args['crn'] = _dict.get('crn')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
else:
- raise ValueError('Required property \'crn\' not present in FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByCRN JSON')
+ raise ValueError('Required property \'id\' not present in InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByCRN object from a json dictionary."""
+ """Initialize a InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'crn') and self.crn is not None:
- _dict['crn'] = self.crn
+ if hasattr(self, 'id') and self.id is not None:
+ _dict['id'] = self.id
return _dict
def _to_dict(self):
@@ -124521,59 +140042,59 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByCRN object."""
+ """Return a `str` version of this InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByCRN') -> bool:
+ def __eq__(self, other: 'InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByCRN') -> bool:
+ def __ne__(self, other: 'InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByHref(FlowLogCollectorTargetPrototypeSubnetIdentity):
+class InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByCRN(InstancePlacementTargetPrototypePlacementGroupIdentity):
"""
- FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByHref.
+ InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByCRN.
- :attr str href: The URL for this subnet.
+ :param str crn: The CRN for this placement group.
"""
def __init__(
self,
- href: str,
+ crn: str,
) -> None:
"""
- Initialize a FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByHref object.
+ Initialize a InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByCRN object.
- :param str href: The URL for this subnet.
+ :param str crn: The CRN for this placement group.
"""
# pylint: disable=super-init-not-called
- self.href = href
+ self.crn = crn
@classmethod
- def from_dict(cls, _dict: Dict) -> 'FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByHref':
- """Initialize a FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByHref object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByCRN':
+ """Initialize a InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByCRN object from a json dictionary."""
args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ if (crn := _dict.get('crn')) is not None:
+ args['crn'] = crn
else:
- raise ValueError('Required property \'href\' not present in FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByHref JSON')
+ raise ValueError('Required property \'crn\' not present in InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByCRN JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByHref object from a json dictionary."""
+ """Initialize a InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByCRN object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'href') and self.href is not None:
- _dict['href'] = self.href
+ if hasattr(self, 'crn') and self.crn is not None:
+ _dict['crn'] = self.crn
return _dict
def _to_dict(self):
@@ -124581,59 +140102,59 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByHref object."""
+ """Return a `str` version of this InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByCRN object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByHref') -> bool:
+ def __eq__(self, other: 'InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByCRN') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByHref') -> bool:
+ def __ne__(self, other: 'InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByCRN') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityById(FlowLogCollectorTargetPrototypeSubnetIdentity):
+class InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByHref(InstancePlacementTargetPrototypePlacementGroupIdentity):
"""
- FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityById.
+ InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByHref.
- :attr str id: The unique identifier for this subnet.
+ :param str href: The URL for this placement group.
"""
def __init__(
self,
- id: str,
+ href: str,
) -> None:
"""
- Initialize a FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityById object.
+ Initialize a InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByHref object.
- :param str id: The unique identifier for this subnet.
+ :param str href: The URL for this placement group.
"""
# pylint: disable=super-init-not-called
- self.id = id
+ self.href = href
@classmethod
- def from_dict(cls, _dict: Dict) -> 'FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityById':
- """Initialize a FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityById object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByHref':
+ """Initialize a InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByHref object from a json dictionary."""
args = {}
- if 'id' in _dict:
- args['id'] = _dict.get('id')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
- raise ValueError('Required property \'id\' not present in FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityById JSON')
+ raise ValueError('Required property \'href\' not present in InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByHref JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityById object from a json dictionary."""
+ """Initialize a InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByHref object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'id') and self.id is not None:
- _dict['id'] = self.id
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
return _dict
def _to_dict(self):
@@ -124641,59 +140162,59 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityById object."""
+ """Return a `str` version of this InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByHref object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityById') -> bool:
+ def __eq__(self, other: 'InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByHref') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityById') -> bool:
+ def __ne__(self, other: 'InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByHref') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByCRN(FlowLogCollectorTargetPrototypeVPCIdentity):
+class InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityById(InstancePlacementTargetPrototypePlacementGroupIdentity):
"""
- FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByCRN.
+ InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityById.
- :attr str crn: The CRN for this VPC.
+ :param str id: The unique identifier for this placement group.
"""
def __init__(
self,
- crn: str,
+ id: str,
) -> None:
"""
- Initialize a FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByCRN object.
+ Initialize a InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityById object.
- :param str crn: The CRN for this VPC.
+ :param str id: The unique identifier for this placement group.
"""
# pylint: disable=super-init-not-called
- self.crn = crn
+ self.id = id
@classmethod
- def from_dict(cls, _dict: Dict) -> 'FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByCRN':
- """Initialize a FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByCRN object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityById':
+ """Initialize a InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityById object from a json dictionary."""
args = {}
- if 'crn' in _dict:
- args['crn'] = _dict.get('crn')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
else:
- raise ValueError('Required property \'crn\' not present in FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByCRN JSON')
+ raise ValueError('Required property \'id\' not present in InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityById JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByCRN object from a json dictionary."""
+ """Initialize a InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityById object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'crn') and self.crn is not None:
- _dict['crn'] = self.crn
+ if hasattr(self, 'id') and self.id is not None:
+ _dict['id'] = self.id
return _dict
def _to_dict(self):
@@ -124701,59 +140222,343 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByCRN object."""
+ """Return a `str` version of this InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityById object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByCRN') -> bool:
+ def __eq__(self, other: 'InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityById') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByCRN') -> bool:
+ def __ne__(self, other: 'InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityById') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByHref(FlowLogCollectorTargetPrototypeVPCIdentity):
+class InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkAttachment(InstancePrototypeInstanceByCatalogOffering):
"""
- FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByHref.
+ InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkAttachment.
- :attr str href: The URL for this VPC.
+ :param InstanceAvailabilityPolicyPrototype availability_policy: (optional) The
+ availability policy to use for this virtual server instance.
+ :param InstanceDefaultTrustedProfilePrototype default_trusted_profile:
+ (optional) The default trusted profile configuration to use for this virtual
+ server instance
+ This property's value is used when provisioning the virtual server instance, but
+ not subsequently managed. Accordingly, it is reflected as an [instance
+ initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
+ property.
+ :param List[KeyIdentity] keys: (optional) The public SSH keys for the
+ administrative user of the virtual server instance. Keys will be made available
+ to the virtual server instance as cloud-init vendor data. For cloud-init enabled
+ images, these keys will also be added as SSH authorized keys for the
+ administrative user.
+ For Windows images, the keys of type `rsa` must be specified, and one will be
+ selected to encrypt [the administrator
+ password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys
+ are optional for other images, but if no keys are specified, the instance will
+ be inaccessible unless the specified image provides another means of access.
+ This property's value is used when provisioning the virtual server instance, but
+ not subsequently managed. Accordingly, it is reflected as an [instance
+ initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
+ property.
+ :param InstanceMetadataServicePrototype metadata_service: (optional)
+ :param str name: (optional) The name for this virtual server instance. The name
+ must not be used by another virtual server instance in the region. If
+ unspecified, the name will be a hyphenated list of randomly-selected words.
+ The system hostname will be based on this name.
+ :param InstancePlacementTargetPrototype placement_target: (optional) The
+ placement restrictions to use for the virtual server instance.
+ If specified, `reservation_affinity.policy` must be `disabled`.
+ :param InstanceProfileIdentity profile: (optional) The
+ [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this
+ virtual server instance.
+ If unspecified, `bx2-2x8` will be used, but this default value is expected to
+ change in the future.
+ :param InstanceReservationAffinityPrototype reservation_affinity: (optional)
+ :param ResourceGroupIdentity resource_group: (optional)
+ :param int total_volume_bandwidth: (optional) The amount of bandwidth (in
+ megabits per second) allocated exclusively to instance storage volumes. An
+ increase in this value will result in a corresponding decrease to
+ `total_network_bandwidth`.
+ :param str user_data: (optional) [User
+ data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when
+ setting up the virtual server instance.
+ :param List[VolumeAttachmentPrototype] volume_attachments: (optional) The
+ additional volume attachments to create for the virtual server instance.
+ :param VPCIdentity vpc: (optional) The VPC this virtual server instance will
+ reside in.
+ If specified, it must match the VPC for the subnets of the instance network
+ attachments or instance network interfaces.
+ :param VolumeAttachmentPrototypeInstanceByImageContext boot_volume_attachment:
+ (optional) The boot volume attachment to create for the virtual server instance.
+ :param InstanceCatalogOfferingPrototype catalog_offering:
+ :param ZoneIdentity zone: The zone this virtual server instance will reside in.
+ :param List[InstanceNetworkAttachmentPrototype] network_attachments: (optional)
+ The additional network attachments to create for the virtual server instance.
+ :param InstanceNetworkAttachmentPrototype primary_network_attachment: The
+ primary network attachment to create for the virtual server instance.
"""
def __init__(
self,
- href: str,
- ) -> None:
- """
- Initialize a FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByHref object.
-
- :param str href: The URL for this VPC.
+ catalog_offering: 'InstanceCatalogOfferingPrototype',
+ zone: 'ZoneIdentity',
+ primary_network_attachment: 'InstanceNetworkAttachmentPrototype',
+ *,
+ availability_policy: Optional['InstanceAvailabilityPolicyPrototype'] = None,
+ default_trusted_profile: Optional['InstanceDefaultTrustedProfilePrototype'] = None,
+ keys: Optional[List['KeyIdentity']] = None,
+ metadata_service: Optional['InstanceMetadataServicePrototype'] = None,
+ name: Optional[str] = None,
+ placement_target: Optional['InstancePlacementTargetPrototype'] = None,
+ profile: Optional['InstanceProfileIdentity'] = None,
+ reservation_affinity: Optional['InstanceReservationAffinityPrototype'] = None,
+ resource_group: Optional['ResourceGroupIdentity'] = None,
+ total_volume_bandwidth: Optional[int] = None,
+ user_data: Optional[str] = None,
+ volume_attachments: Optional[List['VolumeAttachmentPrototype']] = None,
+ vpc: Optional['VPCIdentity'] = None,
+ boot_volume_attachment: Optional['VolumeAttachmentPrototypeInstanceByImageContext'] = None,
+ network_attachments: Optional[List['InstanceNetworkAttachmentPrototype']] = None,
+ ) -> None:
+ """
+ Initialize a InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkAttachment object.
+
+ :param InstanceCatalogOfferingPrototype catalog_offering:
+ :param ZoneIdentity zone: The zone this virtual server instance will reside
+ in.
+ :param InstanceNetworkAttachmentPrototype primary_network_attachment: The
+ primary network attachment to create for the virtual server instance.
+ :param InstanceAvailabilityPolicyPrototype availability_policy: (optional)
+ The availability policy to use for this virtual server instance.
+ :param InstanceDefaultTrustedProfilePrototype default_trusted_profile:
+ (optional) The default trusted profile configuration to use for this
+ virtual server instance
+ This property's value is used when provisioning the virtual server
+ instance, but not subsequently managed. Accordingly, it is reflected as an
+ [instance
+ initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
+ property.
+ :param List[KeyIdentity] keys: (optional) The public SSH keys for the
+ administrative user of the virtual server instance. Keys will be made
+ available to the virtual server instance as cloud-init vendor data. For
+ cloud-init enabled images, these keys will also be added as SSH authorized
+ keys for the administrative user.
+ For Windows images, the keys of type `rsa` must be specified, and one will
+ be selected to encrypt [the administrator
+ password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization).
+ Keys are optional for other images, but if no keys are specified, the
+ instance will be inaccessible unless the specified image provides another
+ means of access.
+ This property's value is used when provisioning the virtual server
+ instance, but not subsequently managed. Accordingly, it is reflected as an
+ [instance
+ initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
+ property.
+ :param InstanceMetadataServicePrototype metadata_service: (optional)
+ :param str name: (optional) The name for this virtual server instance. The
+ name must not be used by another virtual server instance in the region. If
+ unspecified, the name will be a hyphenated list of randomly-selected words.
+ The system hostname will be based on this name.
+ :param InstancePlacementTargetPrototype placement_target: (optional) The
+ placement restrictions to use for the virtual server instance.
+ If specified, `reservation_affinity.policy` must be `disabled`.
+ :param InstanceProfileIdentity profile: (optional) The
+ [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for
+ this virtual server instance.
+ If unspecified, `bx2-2x8` will be used, but this default value is expected
+ to change in the future.
+ :param InstanceReservationAffinityPrototype reservation_affinity:
+ (optional)
+ :param ResourceGroupIdentity resource_group: (optional)
+ :param int total_volume_bandwidth: (optional) The amount of bandwidth (in
+ megabits per second) allocated exclusively to instance storage volumes. An
+ increase in this value will result in a corresponding decrease to
+ `total_network_bandwidth`.
+ :param str user_data: (optional) [User
+ data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available
+ when setting up the virtual server instance.
+ :param List[VolumeAttachmentPrototype] volume_attachments: (optional) The
+ additional volume attachments to create for the virtual server instance.
+ :param VPCIdentity vpc: (optional) The VPC this virtual server instance
+ will reside in.
+ If specified, it must match the VPC for the subnets of the instance network
+ attachments or instance network interfaces.
+ :param VolumeAttachmentPrototypeInstanceByImageContext
+ boot_volume_attachment: (optional) The boot volume attachment to create for
+ the virtual server instance.
+ :param List[InstanceNetworkAttachmentPrototype] network_attachments:
+ (optional) The additional network attachments to create for the virtual
+ server instance.
"""
# pylint: disable=super-init-not-called
- self.href = href
+ self.availability_policy = availability_policy
+ self.default_trusted_profile = default_trusted_profile
+ self.keys = keys
+ self.metadata_service = metadata_service
+ self.name = name
+ self.placement_target = placement_target
+ self.profile = profile
+ self.reservation_affinity = reservation_affinity
+ self.resource_group = resource_group
+ self.total_volume_bandwidth = total_volume_bandwidth
+ self.user_data = user_data
+ self.volume_attachments = volume_attachments
+ self.vpc = vpc
+ self.boot_volume_attachment = boot_volume_attachment
+ self.catalog_offering = catalog_offering
+ self.zone = zone
+ self.network_attachments = network_attachments
+ self.primary_network_attachment = primary_network_attachment
@classmethod
- def from_dict(cls, _dict: Dict) -> 'FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByHref':
- """Initialize a FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByHref object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkAttachment':
+ """Initialize a InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkAttachment object from a json dictionary."""
args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ if (availability_policy := _dict.get('availability_policy')) is not None:
+ args['availability_policy'] = InstanceAvailabilityPolicyPrototype.from_dict(availability_policy)
+ if (default_trusted_profile := _dict.get('default_trusted_profile')) is not None:
+ args['default_trusted_profile'] = InstanceDefaultTrustedProfilePrototype.from_dict(default_trusted_profile)
+ if (keys := _dict.get('keys')) is not None:
+ args['keys'] = keys
+ if (metadata_service := _dict.get('metadata_service')) is not None:
+ args['metadata_service'] = InstanceMetadataServicePrototype.from_dict(metadata_service)
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ if (placement_target := _dict.get('placement_target')) is not None:
+ args['placement_target'] = placement_target
+ if (profile := _dict.get('profile')) is not None:
+ args['profile'] = profile
+ if (reservation_affinity := _dict.get('reservation_affinity')) is not None:
+ args['reservation_affinity'] = InstanceReservationAffinityPrototype.from_dict(reservation_affinity)
+ if (resource_group := _dict.get('resource_group')) is not None:
+ args['resource_group'] = resource_group
+ if (total_volume_bandwidth := _dict.get('total_volume_bandwidth')) is not None:
+ args['total_volume_bandwidth'] = total_volume_bandwidth
+ if (user_data := _dict.get('user_data')) is not None:
+ args['user_data'] = user_data
+ if (volume_attachments := _dict.get('volume_attachments')) is not None:
+ args['volume_attachments'] = [VolumeAttachmentPrototype.from_dict(v) for v in volume_attachments]
+ if (vpc := _dict.get('vpc')) is not None:
+ args['vpc'] = vpc
+ if (boot_volume_attachment := _dict.get('boot_volume_attachment')) is not None:
+ args['boot_volume_attachment'] = VolumeAttachmentPrototypeInstanceByImageContext.from_dict(boot_volume_attachment)
+ if (catalog_offering := _dict.get('catalog_offering')) is not None:
+ args['catalog_offering'] = catalog_offering
else:
- raise ValueError('Required property \'href\' not present in FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByHref JSON')
+ raise ValueError('Required property \'catalog_offering\' not present in InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkAttachment JSON')
+ if (zone := _dict.get('zone')) is not None:
+ args['zone'] = zone
+ else:
+ raise ValueError('Required property \'zone\' not present in InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkAttachment JSON')
+ if (network_attachments := _dict.get('network_attachments')) is not None:
+ args['network_attachments'] = [InstanceNetworkAttachmentPrototype.from_dict(v) for v in network_attachments]
+ if (primary_network_attachment := _dict.get('primary_network_attachment')) is not None:
+ args['primary_network_attachment'] = InstanceNetworkAttachmentPrototype.from_dict(primary_network_attachment)
+ else:
+ raise ValueError('Required property \'primary_network_attachment\' not present in InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkAttachment JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByHref object from a json dictionary."""
+ """Initialize a InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkAttachment object from 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, 'availability_policy') and self.availability_policy is not None:
+ if isinstance(self.availability_policy, dict):
+ _dict['availability_policy'] = self.availability_policy
+ else:
+ _dict['availability_policy'] = self.availability_policy.to_dict()
+ if hasattr(self, 'default_trusted_profile') and self.default_trusted_profile is not None:
+ if isinstance(self.default_trusted_profile, dict):
+ _dict['default_trusted_profile'] = self.default_trusted_profile
+ else:
+ _dict['default_trusted_profile'] = self.default_trusted_profile.to_dict()
+ if hasattr(self, 'keys') and self.keys is not None:
+ keys_list = []
+ for v in self.keys:
+ if isinstance(v, dict):
+ keys_list.append(v)
+ else:
+ keys_list.append(v.to_dict())
+ _dict['keys'] = keys_list
+ if hasattr(self, 'metadata_service') and self.metadata_service is not None:
+ if isinstance(self.metadata_service, dict):
+ _dict['metadata_service'] = self.metadata_service
+ else:
+ _dict['metadata_service'] = self.metadata_service.to_dict()
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ if hasattr(self, 'placement_target') and self.placement_target is not None:
+ if isinstance(self.placement_target, dict):
+ _dict['placement_target'] = self.placement_target
+ else:
+ _dict['placement_target'] = self.placement_target.to_dict()
+ if hasattr(self, 'profile') and self.profile is not None:
+ if isinstance(self.profile, dict):
+ _dict['profile'] = self.profile
+ else:
+ _dict['profile'] = self.profile.to_dict()
+ if hasattr(self, 'reservation_affinity') and self.reservation_affinity is not None:
+ if isinstance(self.reservation_affinity, dict):
+ _dict['reservation_affinity'] = self.reservation_affinity
+ else:
+ _dict['reservation_affinity'] = self.reservation_affinity.to_dict()
+ if hasattr(self, 'resource_group') and self.resource_group is not None:
+ if isinstance(self.resource_group, dict):
+ _dict['resource_group'] = self.resource_group
+ else:
+ _dict['resource_group'] = self.resource_group.to_dict()
+ if hasattr(self, 'total_volume_bandwidth') and self.total_volume_bandwidth is not None:
+ _dict['total_volume_bandwidth'] = self.total_volume_bandwidth
+ if hasattr(self, 'user_data') and self.user_data is not None:
+ _dict['user_data'] = self.user_data
+ if hasattr(self, 'volume_attachments') and self.volume_attachments is not None:
+ volume_attachments_list = []
+ for v in self.volume_attachments:
+ if isinstance(v, dict):
+ volume_attachments_list.append(v)
+ else:
+ volume_attachments_list.append(v.to_dict())
+ _dict['volume_attachments'] = volume_attachments_list
+ if hasattr(self, 'vpc') and self.vpc is not None:
+ if isinstance(self.vpc, dict):
+ _dict['vpc'] = self.vpc
+ else:
+ _dict['vpc'] = self.vpc.to_dict()
+ if hasattr(self, 'boot_volume_attachment') and self.boot_volume_attachment is not None:
+ if isinstance(self.boot_volume_attachment, dict):
+ _dict['boot_volume_attachment'] = self.boot_volume_attachment
+ else:
+ _dict['boot_volume_attachment'] = self.boot_volume_attachment.to_dict()
+ if hasattr(self, 'catalog_offering') and self.catalog_offering is not None:
+ if isinstance(self.catalog_offering, dict):
+ _dict['catalog_offering'] = self.catalog_offering
+ else:
+ _dict['catalog_offering'] = self.catalog_offering.to_dict()
+ if hasattr(self, 'zone') and self.zone is not None:
+ if isinstance(self.zone, dict):
+ _dict['zone'] = self.zone
+ else:
+ _dict['zone'] = self.zone.to_dict()
+ if hasattr(self, 'network_attachments') and self.network_attachments is not None:
+ network_attachments_list = []
+ for v in self.network_attachments:
+ if isinstance(v, dict):
+ network_attachments_list.append(v)
+ else:
+ network_attachments_list.append(v.to_dict())
+ _dict['network_attachments'] = network_attachments_list
+ if hasattr(self, 'primary_network_attachment') and self.primary_network_attachment is not None:
+ if isinstance(self.primary_network_attachment, dict):
+ _dict['primary_network_attachment'] = self.primary_network_attachment
+ else:
+ _dict['primary_network_attachment'] = self.primary_network_attachment.to_dict()
return _dict
def _to_dict(self):
@@ -124761,59 +140566,342 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByHref object."""
+ """Return a `str` version of this InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkAttachment object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByHref') -> bool:
+ def __eq__(self, other: 'InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkAttachment') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByHref') -> bool:
+ def __ne__(self, other: 'InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkAttachment') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityById(FlowLogCollectorTargetPrototypeVPCIdentity):
+class InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkInterface(InstancePrototypeInstanceByCatalogOffering):
"""
- FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityById.
+ InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkInterface.
- :attr str id: The unique identifier for this VPC.
+ :param InstanceAvailabilityPolicyPrototype availability_policy: (optional) The
+ availability policy to use for this virtual server instance.
+ :param InstanceDefaultTrustedProfilePrototype default_trusted_profile:
+ (optional) The default trusted profile configuration to use for this virtual
+ server instance
+ This property's value is used when provisioning the virtual server instance, but
+ not subsequently managed. Accordingly, it is reflected as an [instance
+ initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
+ property.
+ :param List[KeyIdentity] keys: (optional) The public SSH keys for the
+ administrative user of the virtual server instance. Keys will be made available
+ to the virtual server instance as cloud-init vendor data. For cloud-init enabled
+ images, these keys will also be added as SSH authorized keys for the
+ administrative user.
+ For Windows images, the keys of type `rsa` must be specified, and one will be
+ selected to encrypt [the administrator
+ password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys
+ are optional for other images, but if no keys are specified, the instance will
+ be inaccessible unless the specified image provides another means of access.
+ This property's value is used when provisioning the virtual server instance, but
+ not subsequently managed. Accordingly, it is reflected as an [instance
+ initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
+ property.
+ :param InstanceMetadataServicePrototype metadata_service: (optional)
+ :param str name: (optional) The name for this virtual server instance. The name
+ must not be used by another virtual server instance in the region. If
+ unspecified, the name will be a hyphenated list of randomly-selected words.
+ The system hostname will be based on this name.
+ :param InstancePlacementTargetPrototype placement_target: (optional) The
+ placement restrictions to use for the virtual server instance.
+ If specified, `reservation_affinity.policy` must be `disabled`.
+ :param InstanceProfileIdentity profile: (optional) The
+ [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this
+ virtual server instance.
+ If unspecified, `bx2-2x8` will be used, but this default value is expected to
+ change in the future.
+ :param InstanceReservationAffinityPrototype reservation_affinity: (optional)
+ :param ResourceGroupIdentity resource_group: (optional)
+ :param int total_volume_bandwidth: (optional) The amount of bandwidth (in
+ megabits per second) allocated exclusively to instance storage volumes. An
+ increase in this value will result in a corresponding decrease to
+ `total_network_bandwidth`.
+ :param str user_data: (optional) [User
+ data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when
+ setting up the virtual server instance.
+ :param List[VolumeAttachmentPrototype] volume_attachments: (optional) The
+ additional volume attachments to create for the virtual server instance.
+ :param VPCIdentity vpc: (optional) The VPC this virtual server instance will
+ reside in.
+ If specified, it must match the VPC for the subnets of the instance network
+ attachments or instance network interfaces.
+ :param VolumeAttachmentPrototypeInstanceByImageContext boot_volume_attachment:
+ (optional) The boot volume attachment to create for the virtual server instance.
+ :param InstanceCatalogOfferingPrototype catalog_offering:
+ :param ZoneIdentity zone: The zone this virtual server instance will reside in.
+ :param List[NetworkInterfacePrototype] network_interfaces: (optional) The
+ additional instance network interfaces to create.
+ :param NetworkInterfacePrototype primary_network_interface: The primary instance
+ network interface to create.
"""
def __init__(
self,
- id: str,
- ) -> None:
- """
- Initialize a FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityById object.
-
- :param str id: The unique identifier for this VPC.
+ catalog_offering: 'InstanceCatalogOfferingPrototype',
+ zone: 'ZoneIdentity',
+ primary_network_interface: 'NetworkInterfacePrototype',
+ *,
+ availability_policy: Optional['InstanceAvailabilityPolicyPrototype'] = None,
+ default_trusted_profile: Optional['InstanceDefaultTrustedProfilePrototype'] = None,
+ keys: Optional[List['KeyIdentity']] = None,
+ metadata_service: Optional['InstanceMetadataServicePrototype'] = None,
+ name: Optional[str] = None,
+ placement_target: Optional['InstancePlacementTargetPrototype'] = None,
+ profile: Optional['InstanceProfileIdentity'] = None,
+ reservation_affinity: Optional['InstanceReservationAffinityPrototype'] = None,
+ resource_group: Optional['ResourceGroupIdentity'] = None,
+ total_volume_bandwidth: Optional[int] = None,
+ user_data: Optional[str] = None,
+ volume_attachments: Optional[List['VolumeAttachmentPrototype']] = None,
+ vpc: Optional['VPCIdentity'] = None,
+ boot_volume_attachment: Optional['VolumeAttachmentPrototypeInstanceByImageContext'] = None,
+ network_interfaces: Optional[List['NetworkInterfacePrototype']] = None,
+ ) -> None:
+ """
+ Initialize a InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkInterface object.
+
+ :param InstanceCatalogOfferingPrototype catalog_offering:
+ :param ZoneIdentity zone: The zone this virtual server instance will reside
+ in.
+ :param NetworkInterfacePrototype primary_network_interface: The primary
+ instance network interface to create.
+ :param InstanceAvailabilityPolicyPrototype availability_policy: (optional)
+ The availability policy to use for this virtual server instance.
+ :param InstanceDefaultTrustedProfilePrototype default_trusted_profile:
+ (optional) The default trusted profile configuration to use for this
+ virtual server instance
+ This property's value is used when provisioning the virtual server
+ instance, but not subsequently managed. Accordingly, it is reflected as an
+ [instance
+ initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
+ property.
+ :param List[KeyIdentity] keys: (optional) The public SSH keys for the
+ administrative user of the virtual server instance. Keys will be made
+ available to the virtual server instance as cloud-init vendor data. For
+ cloud-init enabled images, these keys will also be added as SSH authorized
+ keys for the administrative user.
+ For Windows images, the keys of type `rsa` must be specified, and one will
+ be selected to encrypt [the administrator
+ password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization).
+ Keys are optional for other images, but if no keys are specified, the
+ instance will be inaccessible unless the specified image provides another
+ means of access.
+ This property's value is used when provisioning the virtual server
+ instance, but not subsequently managed. Accordingly, it is reflected as an
+ [instance
+ initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
+ property.
+ :param InstanceMetadataServicePrototype metadata_service: (optional)
+ :param str name: (optional) The name for this virtual server instance. The
+ name must not be used by another virtual server instance in the region. If
+ unspecified, the name will be a hyphenated list of randomly-selected words.
+ The system hostname will be based on this name.
+ :param InstancePlacementTargetPrototype placement_target: (optional) The
+ placement restrictions to use for the virtual server instance.
+ If specified, `reservation_affinity.policy` must be `disabled`.
+ :param InstanceProfileIdentity profile: (optional) The
+ [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for
+ this virtual server instance.
+ If unspecified, `bx2-2x8` will be used, but this default value is expected
+ to change in the future.
+ :param InstanceReservationAffinityPrototype reservation_affinity:
+ (optional)
+ :param ResourceGroupIdentity resource_group: (optional)
+ :param int total_volume_bandwidth: (optional) The amount of bandwidth (in
+ megabits per second) allocated exclusively to instance storage volumes. An
+ increase in this value will result in a corresponding decrease to
+ `total_network_bandwidth`.
+ :param str user_data: (optional) [User
+ data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available
+ when setting up the virtual server instance.
+ :param List[VolumeAttachmentPrototype] volume_attachments: (optional) The
+ additional volume attachments to create for the virtual server instance.
+ :param VPCIdentity vpc: (optional) The VPC this virtual server instance
+ will reside in.
+ If specified, it must match the VPC for the subnets of the instance network
+ attachments or instance network interfaces.
+ :param VolumeAttachmentPrototypeInstanceByImageContext
+ boot_volume_attachment: (optional) The boot volume attachment to create for
+ the virtual server instance.
+ :param List[NetworkInterfacePrototype] network_interfaces: (optional) The
+ additional instance network interfaces to create.
"""
# pylint: disable=super-init-not-called
- self.id = id
+ self.availability_policy = availability_policy
+ self.default_trusted_profile = default_trusted_profile
+ self.keys = keys
+ self.metadata_service = metadata_service
+ self.name = name
+ self.placement_target = placement_target
+ self.profile = profile
+ self.reservation_affinity = reservation_affinity
+ self.resource_group = resource_group
+ self.total_volume_bandwidth = total_volume_bandwidth
+ self.user_data = user_data
+ self.volume_attachments = volume_attachments
+ self.vpc = vpc
+ self.boot_volume_attachment = boot_volume_attachment
+ self.catalog_offering = catalog_offering
+ self.zone = zone
+ self.network_interfaces = network_interfaces
+ self.primary_network_interface = primary_network_interface
@classmethod
- def from_dict(cls, _dict: Dict) -> 'FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityById':
- """Initialize a FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityById object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkInterface':
+ """Initialize a InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkInterface object from a json dictionary."""
args = {}
- if 'id' in _dict:
- args['id'] = _dict.get('id')
+ if (availability_policy := _dict.get('availability_policy')) is not None:
+ args['availability_policy'] = InstanceAvailabilityPolicyPrototype.from_dict(availability_policy)
+ if (default_trusted_profile := _dict.get('default_trusted_profile')) is not None:
+ args['default_trusted_profile'] = InstanceDefaultTrustedProfilePrototype.from_dict(default_trusted_profile)
+ if (keys := _dict.get('keys')) is not None:
+ args['keys'] = keys
+ if (metadata_service := _dict.get('metadata_service')) is not None:
+ args['metadata_service'] = InstanceMetadataServicePrototype.from_dict(metadata_service)
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ if (placement_target := _dict.get('placement_target')) is not None:
+ args['placement_target'] = placement_target
+ if (profile := _dict.get('profile')) is not None:
+ args['profile'] = profile
+ if (reservation_affinity := _dict.get('reservation_affinity')) is not None:
+ args['reservation_affinity'] = InstanceReservationAffinityPrototype.from_dict(reservation_affinity)
+ if (resource_group := _dict.get('resource_group')) is not None:
+ args['resource_group'] = resource_group
+ if (total_volume_bandwidth := _dict.get('total_volume_bandwidth')) is not None:
+ args['total_volume_bandwidth'] = total_volume_bandwidth
+ if (user_data := _dict.get('user_data')) is not None:
+ args['user_data'] = user_data
+ if (volume_attachments := _dict.get('volume_attachments')) is not None:
+ args['volume_attachments'] = [VolumeAttachmentPrototype.from_dict(v) for v in volume_attachments]
+ if (vpc := _dict.get('vpc')) is not None:
+ args['vpc'] = vpc
+ if (boot_volume_attachment := _dict.get('boot_volume_attachment')) is not None:
+ args['boot_volume_attachment'] = VolumeAttachmentPrototypeInstanceByImageContext.from_dict(boot_volume_attachment)
+ if (catalog_offering := _dict.get('catalog_offering')) is not None:
+ args['catalog_offering'] = catalog_offering
else:
- raise ValueError('Required property \'id\' not present in FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityById JSON')
+ raise ValueError('Required property \'catalog_offering\' not present in InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkInterface JSON')
+ if (zone := _dict.get('zone')) is not None:
+ args['zone'] = zone
+ else:
+ raise ValueError('Required property \'zone\' not present in InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkInterface JSON')
+ if (network_interfaces := _dict.get('network_interfaces')) is not None:
+ args['network_interfaces'] = [NetworkInterfacePrototype.from_dict(v) for v in network_interfaces]
+ if (primary_network_interface := _dict.get('primary_network_interface')) is not None:
+ args['primary_network_interface'] = NetworkInterfacePrototype.from_dict(primary_network_interface)
+ else:
+ raise ValueError('Required property \'primary_network_interface\' not present in InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkInterface JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityById object from a json dictionary."""
+ """Initialize a InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkInterface object from 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, 'availability_policy') and self.availability_policy is not None:
+ if isinstance(self.availability_policy, dict):
+ _dict['availability_policy'] = self.availability_policy
+ else:
+ _dict['availability_policy'] = self.availability_policy.to_dict()
+ if hasattr(self, 'default_trusted_profile') and self.default_trusted_profile is not None:
+ if isinstance(self.default_trusted_profile, dict):
+ _dict['default_trusted_profile'] = self.default_trusted_profile
+ else:
+ _dict['default_trusted_profile'] = self.default_trusted_profile.to_dict()
+ if hasattr(self, 'keys') and self.keys is not None:
+ keys_list = []
+ for v in self.keys:
+ if isinstance(v, dict):
+ keys_list.append(v)
+ else:
+ keys_list.append(v.to_dict())
+ _dict['keys'] = keys_list
+ if hasattr(self, 'metadata_service') and self.metadata_service is not None:
+ if isinstance(self.metadata_service, dict):
+ _dict['metadata_service'] = self.metadata_service
+ else:
+ _dict['metadata_service'] = self.metadata_service.to_dict()
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ if hasattr(self, 'placement_target') and self.placement_target is not None:
+ if isinstance(self.placement_target, dict):
+ _dict['placement_target'] = self.placement_target
+ else:
+ _dict['placement_target'] = self.placement_target.to_dict()
+ if hasattr(self, 'profile') and self.profile is not None:
+ if isinstance(self.profile, dict):
+ _dict['profile'] = self.profile
+ else:
+ _dict['profile'] = self.profile.to_dict()
+ if hasattr(self, 'reservation_affinity') and self.reservation_affinity is not None:
+ if isinstance(self.reservation_affinity, dict):
+ _dict['reservation_affinity'] = self.reservation_affinity
+ else:
+ _dict['reservation_affinity'] = self.reservation_affinity.to_dict()
+ if hasattr(self, 'resource_group') and self.resource_group is not None:
+ if isinstance(self.resource_group, dict):
+ _dict['resource_group'] = self.resource_group
+ else:
+ _dict['resource_group'] = self.resource_group.to_dict()
+ if hasattr(self, 'total_volume_bandwidth') and self.total_volume_bandwidth is not None:
+ _dict['total_volume_bandwidth'] = self.total_volume_bandwidth
+ if hasattr(self, 'user_data') and self.user_data is not None:
+ _dict['user_data'] = self.user_data
+ if hasattr(self, 'volume_attachments') and self.volume_attachments is not None:
+ volume_attachments_list = []
+ for v in self.volume_attachments:
+ if isinstance(v, dict):
+ volume_attachments_list.append(v)
+ else:
+ volume_attachments_list.append(v.to_dict())
+ _dict['volume_attachments'] = volume_attachments_list
+ if hasattr(self, 'vpc') and self.vpc is not None:
+ if isinstance(self.vpc, dict):
+ _dict['vpc'] = self.vpc
+ else:
+ _dict['vpc'] = self.vpc.to_dict()
+ if hasattr(self, 'boot_volume_attachment') and self.boot_volume_attachment is not None:
+ if isinstance(self.boot_volume_attachment, dict):
+ _dict['boot_volume_attachment'] = self.boot_volume_attachment
+ else:
+ _dict['boot_volume_attachment'] = self.boot_volume_attachment.to_dict()
+ if hasattr(self, 'catalog_offering') and self.catalog_offering is not None:
+ if isinstance(self.catalog_offering, dict):
+ _dict['catalog_offering'] = self.catalog_offering
+ else:
+ _dict['catalog_offering'] = self.catalog_offering.to_dict()
+ if hasattr(self, 'zone') and self.zone is not None:
+ if isinstance(self.zone, dict):
+ _dict['zone'] = self.zone
+ else:
+ _dict['zone'] = self.zone.to_dict()
+ if hasattr(self, 'network_interfaces') and self.network_interfaces is not None:
+ network_interfaces_list = []
+ for v in self.network_interfaces:
+ if isinstance(v, dict):
+ network_interfaces_list.append(v)
+ else:
+ network_interfaces_list.append(v.to_dict())
+ _dict['network_interfaces'] = network_interfaces_list
+ if hasattr(self, 'primary_network_interface') and self.primary_network_interface is not None:
+ if isinstance(self.primary_network_interface, dict):
+ _dict['primary_network_interface'] = self.primary_network_interface
+ else:
+ _dict['primary_network_interface'] = self.primary_network_interface.to_dict()
return _dict
def _to_dict(self):
@@ -124821,295 +140909,345 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityById object."""
+ """Return a `str` version of this InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkInterface object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityById') -> bool:
+ def __eq__(self, other: 'InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkInterface') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityById') -> bool:
+ def __ne__(self, other: 'InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkInterface') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpec(InstanceGroupManagerActionPrototypeScheduledActionPrototype):
- """
- InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpec.
-
- :attr str name: (optional) The name for this instance group manager action. The
- name must not be used by another action for the instance group manager. If
- unspecified, the name will be a hyphenated list of randomly-selected words.
- :attr str cron_spec: (optional) The cron specification for a recurring scheduled
- action. Actions can be applied a maximum of one time within a 5 min period.
- """
-
- def __init__(
- self,
- *,
- name: str = None,
- cron_spec: str = None,
- ) -> None:
- """
- Initialize a InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpec object.
-
- :param str name: (optional) The name for this instance group manager
- action. The name must not be used by another action for the instance group
- manager. If unspecified, the name will be a hyphenated list of
- randomly-selected words.
- :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.
- """
- # pylint: disable=super-init-not-called
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByGroup', 'InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByManager'])
- )
- raise Exception(msg)
-
-
-class InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAt(InstanceGroupManagerActionPrototypeScheduledActionPrototype):
+class InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkAttachment(InstancePrototypeInstanceByImage):
"""
- InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAt.
+ InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkAttachment.
- :attr str name: (optional) The name for this instance group manager action. The
- name must not be used by another action for the instance group manager. If
+ :param InstanceAvailabilityPolicyPrototype availability_policy: (optional) The
+ availability policy to use for this virtual server instance.
+ :param InstanceDefaultTrustedProfilePrototype default_trusted_profile:
+ (optional) The default trusted profile configuration to use for this virtual
+ server instance
+ This property's value is used when provisioning the virtual server instance, but
+ not subsequently managed. Accordingly, it is reflected as an [instance
+ initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
+ property.
+ :param List[KeyIdentity] keys: (optional) The public SSH keys for the
+ administrative user of the virtual server instance. Keys will be made available
+ to the virtual server instance as cloud-init vendor data. For cloud-init enabled
+ images, these keys will also be added as SSH authorized keys for the
+ administrative user.
+ For Windows images, the keys of type `rsa` must be specified, and one will be
+ selected to encrypt [the administrator
+ password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys
+ are optional for other images, but if no keys are specified, the instance will
+ be inaccessible unless the specified image provides another means of access.
+ This property's value is used when provisioning the virtual server instance, but
+ not subsequently managed. Accordingly, it is reflected as an [instance
+ initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
+ property.
+ :param InstanceMetadataServicePrototype metadata_service: (optional)
+ :param str name: (optional) The name for this virtual server instance. The name
+ must not be used by another virtual server instance in the region. If
unspecified, the name will be a hyphenated list of randomly-selected words.
- :attr datetime run_at: (optional) The date and time the scheduled action will
- run.
- """
-
- def __init__(
- self,
- *,
- name: str = None,
- run_at: datetime = None,
- ) -> None:
- """
- Initialize a InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAt object.
-
- :param str name: (optional) The name for this instance group manager
- action. The name must not be used by another action for the instance group
- manager. If unspecified, the name will be a hyphenated list of
- randomly-selected words.
- :param datetime run_at: (optional) The date and time the scheduled action
- will run.
- """
- # pylint: disable=super-init-not-called
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroup', 'InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByManager'])
- )
- raise Exception(msg)
-
-
-class InstanceGroupManagerActionScheduledActionGroupTarget(InstanceGroupManagerActionScheduledAction):
- """
- InstanceGroupManagerActionScheduledActionGroupTarget.
-
- :attr bool auto_delete: Indicates whether this scheduled action will be
- automatically deleted after it has completed and `auto_delete_timeout` hours
- have passed. At present, this is always
- `true`, but may be modifiable in the future.
- :attr int auto_delete_timeout: If `auto_delete` is `true`, and this scheduled
- action has finished, the hours after which it will be automatically deleted. If
- the value is `0`, the action will be deleted once it has finished. This value
- may be modifiable in the future.
- :attr datetime created_at: The date and time that the instance group manager
- action was created.
- :attr str href: The URL for this instance group manager action.
- :attr str id: The unique identifier for this instance group manager action.
- :attr str name: The name for this instance group manager action. The name is
- unique across all actions for the instance group manager.
- :attr str resource_type: The resource type.
- :attr str status: The status of the instance group action
- - `active`: Action is ready to be run
- - `completed`: Action was completed successfully
- - `failed`: Action could not be completed successfully
- - `incompatible`: Action parameters are not compatible with the group or manager
- - `omitted`: Action was not applied because this action's manager was disabled.
- :attr datetime updated_at: The date and time that the instance group manager
- action was updated.
- :attr str action_type: The type of action for the instance group.
- :attr str cron_spec: (optional) The cron specification for a recurring scheduled
- action. Actions can be applied a maximum of one time within a 5 min period.
- :attr datetime last_applied_at: (optional) The date and time the scheduled
- action was last applied. If absent, the action has never been applied.
- :attr datetime next_run_at: (optional) The date and time the scheduled action
- will next run. If absent, the system is currently calculating the next run time.
- :attr InstanceGroupManagerScheduledActionGroup group:
+ The system hostname will be based on this name.
+ :param InstancePlacementTargetPrototype placement_target: (optional) The
+ placement restrictions to use for the virtual server instance.
+ If specified, `reservation_affinity.policy` must be `disabled`.
+ :param InstanceProfileIdentity profile: (optional) The
+ [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this
+ virtual server instance.
+ If unspecified, `bx2-2x8` will be used, but this default value is expected to
+ change in the future.
+ :param InstanceReservationAffinityPrototype reservation_affinity: (optional)
+ :param ResourceGroupIdentity resource_group: (optional)
+ :param int total_volume_bandwidth: (optional) The amount of bandwidth (in
+ megabits per second) allocated exclusively to instance storage volumes. An
+ increase in this value will result in a corresponding decrease to
+ `total_network_bandwidth`.
+ :param str user_data: (optional) [User
+ data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when
+ setting up the virtual server instance.
+ :param List[VolumeAttachmentPrototype] volume_attachments: (optional) The
+ additional volume attachments to create for the virtual server instance.
+ :param VPCIdentity vpc: (optional) The VPC this virtual server instance will
+ reside in.
+ If specified, it must match the VPC for the subnets of the instance network
+ attachments or instance network interfaces.
+ :param VolumeAttachmentPrototypeInstanceByImageContext boot_volume_attachment:
+ (optional) The boot volume attachment to create for the virtual server instance.
+ :param ImageIdentity image: The image to use when provisioning the virtual
+ server instance.
+ :param ZoneIdentity zone: The zone this virtual server instance will reside in.
+ :param List[InstanceNetworkAttachmentPrototype] network_attachments: (optional)
+ The additional network attachments to create for the virtual server instance.
+ :param InstanceNetworkAttachmentPrototype primary_network_attachment: The
+ primary network attachment to create for the virtual server instance.
"""
def __init__(
self,
- auto_delete: bool,
- auto_delete_timeout: int,
- created_at: datetime,
- href: str,
- id: str,
- name: str,
- resource_type: str,
- status: str,
- updated_at: datetime,
- action_type: str,
- group: 'InstanceGroupManagerScheduledActionGroup',
- *,
- cron_spec: str = None,
- last_applied_at: datetime = None,
- next_run_at: datetime = None,
- ) -> None:
- """
- Initialize a InstanceGroupManagerActionScheduledActionGroupTarget object.
+ image: 'ImageIdentity',
+ zone: 'ZoneIdentity',
+ primary_network_attachment: 'InstanceNetworkAttachmentPrototype',
+ *,
+ availability_policy: Optional['InstanceAvailabilityPolicyPrototype'] = None,
+ default_trusted_profile: Optional['InstanceDefaultTrustedProfilePrototype'] = None,
+ keys: Optional[List['KeyIdentity']] = None,
+ metadata_service: Optional['InstanceMetadataServicePrototype'] = None,
+ name: Optional[str] = None,
+ placement_target: Optional['InstancePlacementTargetPrototype'] = None,
+ profile: Optional['InstanceProfileIdentity'] = None,
+ reservation_affinity: Optional['InstanceReservationAffinityPrototype'] = None,
+ resource_group: Optional['ResourceGroupIdentity'] = None,
+ total_volume_bandwidth: Optional[int] = None,
+ user_data: Optional[str] = None,
+ volume_attachments: Optional[List['VolumeAttachmentPrototype']] = None,
+ vpc: Optional['VPCIdentity'] = None,
+ boot_volume_attachment: Optional['VolumeAttachmentPrototypeInstanceByImageContext'] = None,
+ network_attachments: Optional[List['InstanceNetworkAttachmentPrototype']] = None,
+ ) -> None:
+ """
+ Initialize a InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkAttachment object.
- :param bool auto_delete: Indicates whether this scheduled action will be
- automatically deleted after it has completed and `auto_delete_timeout`
- hours have passed. At present, this is always
- `true`, but may be modifiable in the future.
- :param int auto_delete_timeout: If `auto_delete` is `true`, and this
- scheduled action has finished, the hours after which it will be
- automatically deleted. If the value is `0`, the action will be deleted once
- it has finished. This value may be modifiable in the future.
- :param datetime created_at: The date and time that the instance group
- manager action was created.
- :param str href: The URL for this instance group manager action.
- :param str id: The unique identifier for this instance group manager
- action.
- :param str name: The name for this instance group manager action. The name
- is unique across all actions for the instance group manager.
- :param str resource_type: The resource type.
- :param str status: The status of the instance group action
- - `active`: Action is ready to be run
- - `completed`: Action was completed successfully
- - `failed`: Action could not be completed successfully
- - `incompatible`: Action parameters are not compatible with the group or
- manager
- - `omitted`: Action was not applied because this action's manager was
- disabled.
- :param datetime updated_at: The date and time that the instance group
- manager action was updated.
- :param str action_type: The type of action for the instance group.
- :param InstanceGroupManagerScheduledActionGroup group:
- :param str cron_spec: (optional) The cron specification for a recurring
- scheduled action. Actions can be applied a maximum of one time within a 5
- min period.
- :param datetime last_applied_at: (optional) The date and time the scheduled
- action was last applied. If absent, the action has never been applied.
- :param datetime next_run_at: (optional) The date and time the scheduled
- action will next run. If absent, the system is currently calculating the
- next run time.
+ :param ImageIdentity image: The image to use when provisioning the virtual
+ server instance.
+ :param ZoneIdentity zone: The zone this virtual server instance will reside
+ in.
+ :param InstanceNetworkAttachmentPrototype primary_network_attachment: The
+ primary network attachment to create for the virtual server instance.
+ :param InstanceAvailabilityPolicyPrototype availability_policy: (optional)
+ The availability policy to use for this virtual server instance.
+ :param InstanceDefaultTrustedProfilePrototype default_trusted_profile:
+ (optional) The default trusted profile configuration to use for this
+ virtual server instance
+ This property's value is used when provisioning the virtual server
+ instance, but not subsequently managed. Accordingly, it is reflected as an
+ [instance
+ initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
+ property.
+ :param List[KeyIdentity] keys: (optional) The public SSH keys for the
+ administrative user of the virtual server instance. Keys will be made
+ available to the virtual server instance as cloud-init vendor data. For
+ cloud-init enabled images, these keys will also be added as SSH authorized
+ keys for the administrative user.
+ For Windows images, the keys of type `rsa` must be specified, and one will
+ be selected to encrypt [the administrator
+ password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization).
+ Keys are optional for other images, but if no keys are specified, the
+ instance will be inaccessible unless the specified image provides another
+ means of access.
+ This property's value is used when provisioning the virtual server
+ instance, but not subsequently managed. Accordingly, it is reflected as an
+ [instance
+ initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
+ property.
+ :param InstanceMetadataServicePrototype metadata_service: (optional)
+ :param str name: (optional) The name for this virtual server instance. The
+ name must not be used by another virtual server instance in the region. If
+ unspecified, the name will be a hyphenated list of randomly-selected words.
+ The system hostname will be based on this name.
+ :param InstancePlacementTargetPrototype placement_target: (optional) The
+ placement restrictions to use for the virtual server instance.
+ If specified, `reservation_affinity.policy` must be `disabled`.
+ :param InstanceProfileIdentity profile: (optional) The
+ [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for
+ this virtual server instance.
+ If unspecified, `bx2-2x8` will be used, but this default value is expected
+ to change in the future.
+ :param InstanceReservationAffinityPrototype reservation_affinity:
+ (optional)
+ :param ResourceGroupIdentity resource_group: (optional)
+ :param int total_volume_bandwidth: (optional) The amount of bandwidth (in
+ megabits per second) allocated exclusively to instance storage volumes. An
+ increase in this value will result in a corresponding decrease to
+ `total_network_bandwidth`.
+ :param str user_data: (optional) [User
+ data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available
+ when setting up the virtual server instance.
+ :param List[VolumeAttachmentPrototype] volume_attachments: (optional) The
+ additional volume attachments to create for the virtual server instance.
+ :param VPCIdentity vpc: (optional) The VPC this virtual server instance
+ will reside in.
+ If specified, it must match the VPC for the subnets of the instance network
+ attachments or instance network interfaces.
+ :param VolumeAttachmentPrototypeInstanceByImageContext
+ boot_volume_attachment: (optional) The boot volume attachment to create for
+ the virtual server instance.
+ :param List[InstanceNetworkAttachmentPrototype] network_attachments:
+ (optional) The additional network attachments to create for the virtual
+ server instance.
"""
# pylint: disable=super-init-not-called
- self.auto_delete = auto_delete
- self.auto_delete_timeout = auto_delete_timeout
- self.created_at = created_at
- self.href = href
- self.id = id
+ self.availability_policy = availability_policy
+ self.default_trusted_profile = default_trusted_profile
+ self.keys = keys
+ self.metadata_service = metadata_service
self.name = name
- self.resource_type = resource_type
- self.status = status
- self.updated_at = updated_at
- self.action_type = action_type
- self.cron_spec = cron_spec
- self.last_applied_at = last_applied_at
- self.next_run_at = next_run_at
- self.group = group
+ self.placement_target = placement_target
+ self.profile = profile
+ self.reservation_affinity = reservation_affinity
+ self.resource_group = resource_group
+ self.total_volume_bandwidth = total_volume_bandwidth
+ self.user_data = user_data
+ self.volume_attachments = volume_attachments
+ self.vpc = vpc
+ self.boot_volume_attachment = boot_volume_attachment
+ self.image = image
+ self.zone = zone
+ self.network_attachments = network_attachments
+ self.primary_network_attachment = primary_network_attachment
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerActionScheduledActionGroupTarget':
- """Initialize a InstanceGroupManagerActionScheduledActionGroupTarget object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkAttachment':
+ """Initialize a InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkAttachment object from a json dictionary."""
args = {}
- if 'auto_delete' in _dict:
- args['auto_delete'] = _dict.get('auto_delete')
- else:
- raise ValueError('Required property \'auto_delete\' not present in InstanceGroupManagerActionScheduledActionGroupTarget JSON')
- if 'auto_delete_timeout' in _dict:
- args['auto_delete_timeout'] = _dict.get('auto_delete_timeout')
- else:
- raise ValueError('Required property \'auto_delete_timeout\' not present in InstanceGroupManagerActionScheduledActionGroupTarget 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 InstanceGroupManagerActionScheduledActionGroupTarget JSON')
- if 'href' in _dict:
- args['href'] = _dict.get('href')
- else:
- raise ValueError('Required property \'href\' not present in InstanceGroupManagerActionScheduledActionGroupTarget JSON')
- if 'id' in _dict:
- args['id'] = _dict.get('id')
- else:
- raise ValueError('Required property \'id\' not present in InstanceGroupManagerActionScheduledActionGroupTarget JSON')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
- else:
- raise ValueError('Required property \'name\' not present in InstanceGroupManagerActionScheduledActionGroupTarget JSON')
- if 'resource_type' in _dict:
- args['resource_type'] = _dict.get('resource_type')
- else:
- raise ValueError('Required property \'resource_type\' not present in InstanceGroupManagerActionScheduledActionGroupTarget JSON')
- if 'status' in _dict:
- args['status'] = _dict.get('status')
- else:
- raise ValueError('Required property \'status\' not present in InstanceGroupManagerActionScheduledActionGroupTarget JSON')
- if 'updated_at' in _dict:
- args['updated_at'] = string_to_datetime(_dict.get('updated_at'))
+ if (availability_policy := _dict.get('availability_policy')) is not None:
+ args['availability_policy'] = InstanceAvailabilityPolicyPrototype.from_dict(availability_policy)
+ if (default_trusted_profile := _dict.get('default_trusted_profile')) is not None:
+ args['default_trusted_profile'] = InstanceDefaultTrustedProfilePrototype.from_dict(default_trusted_profile)
+ if (keys := _dict.get('keys')) is not None:
+ args['keys'] = keys
+ if (metadata_service := _dict.get('metadata_service')) is not None:
+ args['metadata_service'] = InstanceMetadataServicePrototype.from_dict(metadata_service)
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ if (placement_target := _dict.get('placement_target')) is not None:
+ args['placement_target'] = placement_target
+ if (profile := _dict.get('profile')) is not None:
+ args['profile'] = profile
+ if (reservation_affinity := _dict.get('reservation_affinity')) is not None:
+ args['reservation_affinity'] = InstanceReservationAffinityPrototype.from_dict(reservation_affinity)
+ if (resource_group := _dict.get('resource_group')) is not None:
+ args['resource_group'] = resource_group
+ if (total_volume_bandwidth := _dict.get('total_volume_bandwidth')) is not None:
+ args['total_volume_bandwidth'] = total_volume_bandwidth
+ if (user_data := _dict.get('user_data')) is not None:
+ args['user_data'] = user_data
+ if (volume_attachments := _dict.get('volume_attachments')) is not None:
+ args['volume_attachments'] = [VolumeAttachmentPrototype.from_dict(v) for v in volume_attachments]
+ if (vpc := _dict.get('vpc')) is not None:
+ args['vpc'] = vpc
+ if (boot_volume_attachment := _dict.get('boot_volume_attachment')) is not None:
+ args['boot_volume_attachment'] = VolumeAttachmentPrototypeInstanceByImageContext.from_dict(boot_volume_attachment)
+ if (image := _dict.get('image')) is not None:
+ args['image'] = image
else:
- raise ValueError('Required property \'updated_at\' not present in InstanceGroupManagerActionScheduledActionGroupTarget JSON')
- if 'action_type' in _dict:
- args['action_type'] = _dict.get('action_type')
+ raise ValueError('Required property \'image\' not present in InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkAttachment JSON')
+ if (zone := _dict.get('zone')) is not None:
+ args['zone'] = zone
else:
- raise ValueError('Required property \'action_type\' not present in InstanceGroupManagerActionScheduledActionGroupTarget JSON')
- if 'cron_spec' in _dict:
- args['cron_spec'] = _dict.get('cron_spec')
- if 'last_applied_at' in _dict:
- args['last_applied_at'] = string_to_datetime(_dict.get('last_applied_at'))
- if 'next_run_at' in _dict:
- args['next_run_at'] = string_to_datetime(_dict.get('next_run_at'))
- if 'group' in _dict:
- args['group'] = InstanceGroupManagerScheduledActionGroup.from_dict(_dict.get('group'))
+ raise ValueError('Required property \'zone\' not present in InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkAttachment JSON')
+ if (network_attachments := _dict.get('network_attachments')) is not None:
+ args['network_attachments'] = [InstanceNetworkAttachmentPrototype.from_dict(v) for v in network_attachments]
+ if (primary_network_attachment := _dict.get('primary_network_attachment')) is not None:
+ args['primary_network_attachment'] = InstanceNetworkAttachmentPrototype.from_dict(primary_network_attachment)
else:
- raise ValueError('Required property \'group\' not present in InstanceGroupManagerActionScheduledActionGroupTarget JSON')
+ raise ValueError('Required property \'primary_network_attachment\' not present in InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkAttachment JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceGroupManagerActionScheduledActionGroupTarget object from a json dictionary."""
+ """Initialize a InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkAttachment object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'auto_delete') and self.auto_delete is not None:
- _dict['auto_delete'] = self.auto_delete
- if hasattr(self, 'auto_delete_timeout') and self.auto_delete_timeout is not None:
- _dict['auto_delete_timeout'] = self.auto_delete_timeout
- if hasattr(self, 'created_at') and self.created_at is not None:
- _dict['created_at'] = datetime_to_string(self.created_at)
- if hasattr(self, 'href') and self.href is not None:
- _dict['href'] = self.href
- if hasattr(self, 'id') and self.id is not None:
- _dict['id'] = self.id
+ if hasattr(self, 'availability_policy') and self.availability_policy is not None:
+ if isinstance(self.availability_policy, dict):
+ _dict['availability_policy'] = self.availability_policy
+ else:
+ _dict['availability_policy'] = self.availability_policy.to_dict()
+ if hasattr(self, 'default_trusted_profile') and self.default_trusted_profile is not None:
+ if isinstance(self.default_trusted_profile, dict):
+ _dict['default_trusted_profile'] = self.default_trusted_profile
+ else:
+ _dict['default_trusted_profile'] = self.default_trusted_profile.to_dict()
+ if hasattr(self, 'keys') and self.keys is not None:
+ keys_list = []
+ for v in self.keys:
+ if isinstance(v, dict):
+ keys_list.append(v)
+ else:
+ keys_list.append(v.to_dict())
+ _dict['keys'] = keys_list
+ if hasattr(self, 'metadata_service') and self.metadata_service is not None:
+ if isinstance(self.metadata_service, dict):
+ _dict['metadata_service'] = self.metadata_service
+ else:
+ _dict['metadata_service'] = self.metadata_service.to_dict()
if hasattr(self, 'name') and self.name is not None:
_dict['name'] = self.name
- if hasattr(self, '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, 'updated_at') and self.updated_at is not None:
- _dict['updated_at'] = datetime_to_string(self.updated_at)
- if hasattr(self, 'action_type') and self.action_type is not None:
- _dict['action_type'] = self.action_type
- if hasattr(self, 'cron_spec') and self.cron_spec is not None:
- _dict['cron_spec'] = self.cron_spec
- if hasattr(self, 'last_applied_at') and self.last_applied_at is not None:
- _dict['last_applied_at'] = datetime_to_string(self.last_applied_at)
- if hasattr(self, 'next_run_at') and self.next_run_at is not None:
- _dict['next_run_at'] = datetime_to_string(self.next_run_at)
- if hasattr(self, 'group') and self.group is not None:
- if isinstance(self.group, dict):
- _dict['group'] = self.group
+ if hasattr(self, 'placement_target') and self.placement_target is not None:
+ if isinstance(self.placement_target, dict):
+ _dict['placement_target'] = self.placement_target
else:
- _dict['group'] = self.group.to_dict()
+ _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, 'reservation_affinity') and self.reservation_affinity is not None:
+ if isinstance(self.reservation_affinity, dict):
+ _dict['reservation_affinity'] = self.reservation_affinity
+ else:
+ _dict['reservation_affinity'] = self.reservation_affinity.to_dict()
+ if hasattr(self, 'resource_group') and self.resource_group is not None:
+ if isinstance(self.resource_group, dict):
+ _dict['resource_group'] = self.resource_group
+ else:
+ _dict['resource_group'] = self.resource_group.to_dict()
+ if hasattr(self, 'total_volume_bandwidth') and self.total_volume_bandwidth is not None:
+ _dict['total_volume_bandwidth'] = self.total_volume_bandwidth
+ if hasattr(self, 'user_data') and self.user_data is not None:
+ _dict['user_data'] = self.user_data
+ if hasattr(self, 'volume_attachments') and self.volume_attachments is not None:
+ volume_attachments_list = []
+ for v in self.volume_attachments:
+ if isinstance(v, dict):
+ volume_attachments_list.append(v)
+ else:
+ volume_attachments_list.append(v.to_dict())
+ _dict['volume_attachments'] = volume_attachments_list
+ if hasattr(self, 'vpc') and self.vpc is not None:
+ if isinstance(self.vpc, dict):
+ _dict['vpc'] = self.vpc
+ else:
+ _dict['vpc'] = self.vpc.to_dict()
+ if hasattr(self, 'boot_volume_attachment') and self.boot_volume_attachment is not None:
+ if isinstance(self.boot_volume_attachment, dict):
+ _dict['boot_volume_attachment'] = self.boot_volume_attachment
+ else:
+ _dict['boot_volume_attachment'] = self.boot_volume_attachment.to_dict()
+ if hasattr(self, 'image') and self.image is not None:
+ if isinstance(self.image, dict):
+ _dict['image'] = self.image
+ else:
+ _dict['image'] = self.image.to_dict()
+ if hasattr(self, 'zone') and self.zone is not None:
+ if isinstance(self.zone, dict):
+ _dict['zone'] = self.zone
+ else:
+ _dict['zone'] = self.zone.to_dict()
+ if hasattr(self, 'network_attachments') and self.network_attachments is not None:
+ network_attachments_list = []
+ for v in self.network_attachments:
+ if isinstance(v, dict):
+ network_attachments_list.append(v)
+ else:
+ network_attachments_list.append(v.to_dict())
+ _dict['network_attachments'] = network_attachments_list
+ if hasattr(self, 'primary_network_attachment') and self.primary_network_attachment is not None:
+ if isinstance(self.primary_network_attachment, dict):
+ _dict['primary_network_attachment'] = self.primary_network_attachment
+ else:
+ _dict['primary_network_attachment'] = self.primary_network_attachment.to_dict()
return _dict
def _to_dict(self):
@@ -125117,259 +141255,344 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this InstanceGroupManagerActionScheduledActionGroupTarget object."""
+ """Return a `str` version of this InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkAttachment object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceGroupManagerActionScheduledActionGroupTarget') -> bool:
+ def __eq__(self, other: 'InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkAttachment') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
- if not isinstance(other, self.__class__):
- return False
- return self.__dict__ == other.__dict__
-
- def __ne__(self, other: 'InstanceGroupManagerActionScheduledActionGroupTarget') -> bool:
- """Return `true` when self and other are not equal, false otherwise."""
- return not self == other
-
- class ResourceTypeEnum(str, Enum):
- """
- The resource type.
- """
-
- INSTANCE_GROUP_MANAGER_ACTION = 'instance_group_manager_action'
-
-
- class StatusEnum(str, Enum):
- """
- The status of the instance group action
- - `active`: Action is ready to be run
- - `completed`: Action was completed successfully
- - `failed`: Action could not be completed successfully
- - `incompatible`: Action parameters are not compatible with the group or manager
- - `omitted`: Action was not applied because this action's manager was disabled.
- """
-
- ACTIVE = 'active'
- COMPLETED = 'completed'
- FAILED = 'failed'
- INCOMPATIBLE = 'incompatible'
- OMITTED = 'omitted'
-
-
- class ActionTypeEnum(str, Enum):
- """
- The type of action for the instance group.
- """
-
- SCHEDULED = 'scheduled'
-
-
-
-class InstanceGroupManagerActionScheduledActionManagerTarget(InstanceGroupManagerActionScheduledAction):
- """
- InstanceGroupManagerActionScheduledActionManagerTarget.
-
- :attr bool auto_delete: Indicates whether this scheduled action will be
- automatically deleted after it has completed and `auto_delete_timeout` hours
- have passed. At present, this is always
- `true`, but may be modifiable in the future.
- :attr int auto_delete_timeout: If `auto_delete` is `true`, and this scheduled
- action has finished, the hours after which it will be automatically deleted. If
- the value is `0`, the action will be deleted once it has finished. This value
- may be modifiable in the future.
- :attr datetime created_at: The date and time that the instance group manager
- action was created.
- :attr str href: The URL for this instance group manager action.
- :attr str id: The unique identifier for this instance group manager action.
- :attr str name: The name for this instance group manager action. The name is
- unique across all actions for the instance group manager.
- :attr str resource_type: The resource type.
- :attr str status: The status of the instance group action
- - `active`: Action is ready to be run
- - `completed`: Action was completed successfully
- - `failed`: Action could not be completed successfully
- - `incompatible`: Action parameters are not compatible with the group or manager
- - `omitted`: Action was not applied because this action's manager was disabled.
- :attr datetime updated_at: The date and time that the instance group manager
- action was updated.
- :attr str action_type: The type of action for the instance group.
- :attr str cron_spec: (optional) The cron specification for a recurring scheduled
- action. Actions can be applied a maximum of one time within a 5 min period.
- :attr datetime last_applied_at: (optional) The date and time the scheduled
- action was last applied. If absent, the action has never been applied.
- :attr datetime next_run_at: (optional) The date and time the scheduled action
- will next run. If absent, the system is currently calculating the next run time.
- :attr InstanceGroupManagerScheduledActionManager manager:
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkAttachment') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+
+class InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterface(InstancePrototypeInstanceByImage):
+ """
+ InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterface.
+
+ :param InstanceAvailabilityPolicyPrototype availability_policy: (optional) The
+ availability policy to use for this virtual server instance.
+ :param InstanceDefaultTrustedProfilePrototype default_trusted_profile:
+ (optional) The default trusted profile configuration to use for this virtual
+ server instance
+ This property's value is used when provisioning the virtual server instance, but
+ not subsequently managed. Accordingly, it is reflected as an [instance
+ initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
+ property.
+ :param List[KeyIdentity] keys: (optional) The public SSH keys for the
+ administrative user of the virtual server instance. Keys will be made available
+ to the virtual server instance as cloud-init vendor data. For cloud-init enabled
+ images, these keys will also be added as SSH authorized keys for the
+ administrative user.
+ For Windows images, the keys of type `rsa` must be specified, and one will be
+ selected to encrypt [the administrator
+ password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys
+ are optional for other images, but if no keys are specified, the instance will
+ be inaccessible unless the specified image provides another means of access.
+ This property's value is used when provisioning the virtual server instance, but
+ not subsequently managed. Accordingly, it is reflected as an [instance
+ initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
+ property.
+ :param InstanceMetadataServicePrototype metadata_service: (optional)
+ :param str name: (optional) The name for this virtual server instance. The name
+ must not be used by another virtual server instance in the region. If
+ unspecified, the name will be a hyphenated list of randomly-selected words.
+ The system hostname will be based on this name.
+ :param InstancePlacementTargetPrototype placement_target: (optional) The
+ placement restrictions to use for the virtual server instance.
+ If specified, `reservation_affinity.policy` must be `disabled`.
+ :param InstanceProfileIdentity profile: (optional) The
+ [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this
+ virtual server instance.
+ If unspecified, `bx2-2x8` will be used, but this default value is expected to
+ change in the future.
+ :param InstanceReservationAffinityPrototype reservation_affinity: (optional)
+ :param ResourceGroupIdentity resource_group: (optional)
+ :param int total_volume_bandwidth: (optional) The amount of bandwidth (in
+ megabits per second) allocated exclusively to instance storage volumes. An
+ increase in this value will result in a corresponding decrease to
+ `total_network_bandwidth`.
+ :param str user_data: (optional) [User
+ data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when
+ setting up the virtual server instance.
+ :param List[VolumeAttachmentPrototype] volume_attachments: (optional) The
+ additional volume attachments to create for the virtual server instance.
+ :param VPCIdentity vpc: (optional) The VPC this virtual server instance will
+ reside in.
+ If specified, it must match the VPC for the subnets of the instance network
+ attachments or instance network interfaces.
+ :param VolumeAttachmentPrototypeInstanceByImageContext boot_volume_attachment:
+ (optional) The boot volume attachment to create for the virtual server instance.
+ :param ImageIdentity image: The image to use when provisioning the virtual
+ server instance.
+ :param ZoneIdentity zone: The zone this virtual server instance will reside in.
+ :param List[NetworkInterfacePrototype] network_interfaces: (optional) The
+ additional instance network interfaces to create.
+ :param NetworkInterfacePrototype primary_network_interface: The primary instance
+ network interface to create.
"""
def __init__(
self,
- auto_delete: bool,
- auto_delete_timeout: int,
- created_at: datetime,
- href: str,
- id: str,
- name: str,
- resource_type: str,
- status: str,
- updated_at: datetime,
- action_type: str,
- manager: 'InstanceGroupManagerScheduledActionManager',
+ image: 'ImageIdentity',
+ zone: 'ZoneIdentity',
+ primary_network_interface: 'NetworkInterfacePrototype',
*,
- cron_spec: str = None,
- last_applied_at: datetime = None,
- next_run_at: datetime = None,
- ) -> None:
- """
- Initialize a InstanceGroupManagerActionScheduledActionManagerTarget object.
+ availability_policy: Optional['InstanceAvailabilityPolicyPrototype'] = None,
+ default_trusted_profile: Optional['InstanceDefaultTrustedProfilePrototype'] = None,
+ keys: Optional[List['KeyIdentity']] = None,
+ metadata_service: Optional['InstanceMetadataServicePrototype'] = None,
+ name: Optional[str] = None,
+ placement_target: Optional['InstancePlacementTargetPrototype'] = None,
+ profile: Optional['InstanceProfileIdentity'] = None,
+ reservation_affinity: Optional['InstanceReservationAffinityPrototype'] = None,
+ resource_group: Optional['ResourceGroupIdentity'] = None,
+ total_volume_bandwidth: Optional[int] = None,
+ user_data: Optional[str] = None,
+ volume_attachments: Optional[List['VolumeAttachmentPrototype']] = None,
+ vpc: Optional['VPCIdentity'] = None,
+ boot_volume_attachment: Optional['VolumeAttachmentPrototypeInstanceByImageContext'] = None,
+ network_interfaces: Optional[List['NetworkInterfacePrototype']] = None,
+ ) -> None:
+ """
+ Initialize a InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterface object.
- :param bool auto_delete: Indicates whether this scheduled action will be
- automatically deleted after it has completed and `auto_delete_timeout`
- hours have passed. At present, this is always
- `true`, but may be modifiable in the future.
- :param int auto_delete_timeout: If `auto_delete` is `true`, and this
- scheduled action has finished, the hours after which it will be
- automatically deleted. If the value is `0`, the action will be deleted once
- it has finished. This value may be modifiable in the future.
- :param datetime created_at: The date and time that the instance group
- manager action was created.
- :param str href: The URL for this instance group manager action.
- :param str id: The unique identifier for this instance group manager
- action.
- :param str name: The name for this instance group manager action. The name
- is unique across all actions for the instance group manager.
- :param str resource_type: The resource type.
- :param str status: The status of the instance group action
- - `active`: Action is ready to be run
- - `completed`: Action was completed successfully
- - `failed`: Action could not be completed successfully
- - `incompatible`: Action parameters are not compatible with the group or
- manager
- - `omitted`: Action was not applied because this action's manager was
- disabled.
- :param datetime updated_at: The date and time that the instance group
- manager action was updated.
- :param str action_type: The type of action for the instance group.
- :param InstanceGroupManagerScheduledActionManager manager:
- :param str cron_spec: (optional) The cron specification for a recurring
- scheduled action. Actions can be applied a maximum of one time within a 5
- min period.
- :param datetime last_applied_at: (optional) The date and time the scheduled
- action was last applied. If absent, the action has never been applied.
- :param datetime next_run_at: (optional) The date and time the scheduled
- action will next run. If absent, the system is currently calculating the
- next run time.
+ :param ImageIdentity image: The image to use when provisioning the virtual
+ server instance.
+ :param ZoneIdentity zone: The zone this virtual server instance will reside
+ in.
+ :param NetworkInterfacePrototype primary_network_interface: The primary
+ instance network interface to create.
+ :param InstanceAvailabilityPolicyPrototype availability_policy: (optional)
+ The availability policy to use for this virtual server instance.
+ :param InstanceDefaultTrustedProfilePrototype default_trusted_profile:
+ (optional) The default trusted profile configuration to use for this
+ virtual server instance
+ This property's value is used when provisioning the virtual server
+ instance, but not subsequently managed. Accordingly, it is reflected as an
+ [instance
+ initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
+ property.
+ :param List[KeyIdentity] keys: (optional) The public SSH keys for the
+ administrative user of the virtual server instance. Keys will be made
+ available to the virtual server instance as cloud-init vendor data. For
+ cloud-init enabled images, these keys will also be added as SSH authorized
+ keys for the administrative user.
+ For Windows images, the keys of type `rsa` must be specified, and one will
+ be selected to encrypt [the administrator
+ password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization).
+ Keys are optional for other images, but if no keys are specified, the
+ instance will be inaccessible unless the specified image provides another
+ means of access.
+ This property's value is used when provisioning the virtual server
+ instance, but not subsequently managed. Accordingly, it is reflected as an
+ [instance
+ initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
+ property.
+ :param InstanceMetadataServicePrototype metadata_service: (optional)
+ :param str name: (optional) The name for this virtual server instance. The
+ name must not be used by another virtual server instance in the region. If
+ unspecified, the name will be a hyphenated list of randomly-selected words.
+ The system hostname will be based on this name.
+ :param InstancePlacementTargetPrototype placement_target: (optional) The
+ placement restrictions to use for the virtual server instance.
+ If specified, `reservation_affinity.policy` must be `disabled`.
+ :param InstanceProfileIdentity profile: (optional) The
+ [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for
+ this virtual server instance.
+ If unspecified, `bx2-2x8` will be used, but this default value is expected
+ to change in the future.
+ :param InstanceReservationAffinityPrototype reservation_affinity:
+ (optional)
+ :param ResourceGroupIdentity resource_group: (optional)
+ :param int total_volume_bandwidth: (optional) The amount of bandwidth (in
+ megabits per second) allocated exclusively to instance storage volumes. An
+ increase in this value will result in a corresponding decrease to
+ `total_network_bandwidth`.
+ :param str user_data: (optional) [User
+ data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available
+ when setting up the virtual server instance.
+ :param List[VolumeAttachmentPrototype] volume_attachments: (optional) The
+ additional volume attachments to create for the virtual server instance.
+ :param VPCIdentity vpc: (optional) The VPC this virtual server instance
+ will reside in.
+ If specified, it must match the VPC for the subnets of the instance network
+ attachments or instance network interfaces.
+ :param VolumeAttachmentPrototypeInstanceByImageContext
+ boot_volume_attachment: (optional) The boot volume attachment to create for
+ the virtual server instance.
+ :param List[NetworkInterfacePrototype] network_interfaces: (optional) The
+ additional instance network interfaces to create.
"""
# pylint: disable=super-init-not-called
- self.auto_delete = auto_delete
- self.auto_delete_timeout = auto_delete_timeout
- self.created_at = created_at
- self.href = href
- self.id = id
+ self.availability_policy = availability_policy
+ self.default_trusted_profile = default_trusted_profile
+ self.keys = keys
+ self.metadata_service = metadata_service
self.name = name
- self.resource_type = resource_type
- self.status = status
- self.updated_at = updated_at
- self.action_type = action_type
- self.cron_spec = cron_spec
- self.last_applied_at = last_applied_at
- self.next_run_at = next_run_at
- self.manager = manager
+ self.placement_target = placement_target
+ self.profile = profile
+ self.reservation_affinity = reservation_affinity
+ self.resource_group = resource_group
+ self.total_volume_bandwidth = total_volume_bandwidth
+ self.user_data = user_data
+ self.volume_attachments = volume_attachments
+ self.vpc = vpc
+ self.boot_volume_attachment = boot_volume_attachment
+ self.image = image
+ self.zone = zone
+ self.network_interfaces = network_interfaces
+ self.primary_network_interface = primary_network_interface
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerActionScheduledActionManagerTarget':
- """Initialize a InstanceGroupManagerActionScheduledActionManagerTarget object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterface':
+ """Initialize a InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterface object from a json dictionary."""
args = {}
- if 'auto_delete' in _dict:
- args['auto_delete'] = _dict.get('auto_delete')
- else:
- raise ValueError('Required property \'auto_delete\' not present in InstanceGroupManagerActionScheduledActionManagerTarget JSON')
- if 'auto_delete_timeout' in _dict:
- args['auto_delete_timeout'] = _dict.get('auto_delete_timeout')
- else:
- raise ValueError('Required property \'auto_delete_timeout\' not present in InstanceGroupManagerActionScheduledActionManagerTarget 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 InstanceGroupManagerActionScheduledActionManagerTarget JSON')
- if 'href' in _dict:
- args['href'] = _dict.get('href')
- else:
- raise ValueError('Required property \'href\' not present in InstanceGroupManagerActionScheduledActionManagerTarget JSON')
- if 'id' in _dict:
- args['id'] = _dict.get('id')
- else:
- raise ValueError('Required property \'id\' not present in InstanceGroupManagerActionScheduledActionManagerTarget JSON')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
- else:
- raise ValueError('Required property \'name\' not present in InstanceGroupManagerActionScheduledActionManagerTarget JSON')
- if 'resource_type' in _dict:
- args['resource_type'] = _dict.get('resource_type')
- else:
- raise ValueError('Required property \'resource_type\' not present in InstanceGroupManagerActionScheduledActionManagerTarget JSON')
- if 'status' in _dict:
- args['status'] = _dict.get('status')
- else:
- raise ValueError('Required property \'status\' not present in InstanceGroupManagerActionScheduledActionManagerTarget JSON')
- if 'updated_at' in _dict:
- args['updated_at'] = string_to_datetime(_dict.get('updated_at'))
+ if (availability_policy := _dict.get('availability_policy')) is not None:
+ args['availability_policy'] = InstanceAvailabilityPolicyPrototype.from_dict(availability_policy)
+ if (default_trusted_profile := _dict.get('default_trusted_profile')) is not None:
+ args['default_trusted_profile'] = InstanceDefaultTrustedProfilePrototype.from_dict(default_trusted_profile)
+ if (keys := _dict.get('keys')) is not None:
+ args['keys'] = keys
+ if (metadata_service := _dict.get('metadata_service')) is not None:
+ args['metadata_service'] = InstanceMetadataServicePrototype.from_dict(metadata_service)
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ if (placement_target := _dict.get('placement_target')) is not None:
+ args['placement_target'] = placement_target
+ if (profile := _dict.get('profile')) is not None:
+ args['profile'] = profile
+ if (reservation_affinity := _dict.get('reservation_affinity')) is not None:
+ args['reservation_affinity'] = InstanceReservationAffinityPrototype.from_dict(reservation_affinity)
+ if (resource_group := _dict.get('resource_group')) is not None:
+ args['resource_group'] = resource_group
+ if (total_volume_bandwidth := _dict.get('total_volume_bandwidth')) is not None:
+ args['total_volume_bandwidth'] = total_volume_bandwidth
+ if (user_data := _dict.get('user_data')) is not None:
+ args['user_data'] = user_data
+ if (volume_attachments := _dict.get('volume_attachments')) is not None:
+ args['volume_attachments'] = [VolumeAttachmentPrototype.from_dict(v) for v in volume_attachments]
+ if (vpc := _dict.get('vpc')) is not None:
+ args['vpc'] = vpc
+ if (boot_volume_attachment := _dict.get('boot_volume_attachment')) is not None:
+ args['boot_volume_attachment'] = VolumeAttachmentPrototypeInstanceByImageContext.from_dict(boot_volume_attachment)
+ if (image := _dict.get('image')) is not None:
+ args['image'] = image
else:
- raise ValueError('Required property \'updated_at\' not present in InstanceGroupManagerActionScheduledActionManagerTarget JSON')
- if 'action_type' in _dict:
- args['action_type'] = _dict.get('action_type')
+ raise ValueError('Required property \'image\' not present in InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterface JSON')
+ if (zone := _dict.get('zone')) is not None:
+ args['zone'] = zone
else:
- raise ValueError('Required property \'action_type\' not present in InstanceGroupManagerActionScheduledActionManagerTarget JSON')
- if 'cron_spec' in _dict:
- args['cron_spec'] = _dict.get('cron_spec')
- if 'last_applied_at' in _dict:
- args['last_applied_at'] = string_to_datetime(_dict.get('last_applied_at'))
- if 'next_run_at' in _dict:
- args['next_run_at'] = string_to_datetime(_dict.get('next_run_at'))
- if 'manager' in _dict:
- args['manager'] = _dict.get('manager')
+ raise ValueError('Required property \'zone\' not present in InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterface JSON')
+ if (network_interfaces := _dict.get('network_interfaces')) is not None:
+ args['network_interfaces'] = [NetworkInterfacePrototype.from_dict(v) for v in network_interfaces]
+ if (primary_network_interface := _dict.get('primary_network_interface')) is not None:
+ args['primary_network_interface'] = NetworkInterfacePrototype.from_dict(primary_network_interface)
else:
- raise ValueError('Required property \'manager\' not present in InstanceGroupManagerActionScheduledActionManagerTarget JSON')
+ raise ValueError('Required property \'primary_network_interface\' not present in InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterface JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceGroupManagerActionScheduledActionManagerTarget object from a json dictionary."""
+ """Initialize a InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterface object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'auto_delete') and self.auto_delete is not None:
- _dict['auto_delete'] = self.auto_delete
- if hasattr(self, 'auto_delete_timeout') and self.auto_delete_timeout is not None:
- _dict['auto_delete_timeout'] = self.auto_delete_timeout
- if hasattr(self, 'created_at') and self.created_at is not None:
- _dict['created_at'] = datetime_to_string(self.created_at)
- if hasattr(self, 'href') and self.href is not None:
- _dict['href'] = self.href
- if hasattr(self, 'id') and self.id is not None:
- _dict['id'] = self.id
+ if hasattr(self, 'availability_policy') and self.availability_policy is not None:
+ if isinstance(self.availability_policy, dict):
+ _dict['availability_policy'] = self.availability_policy
+ else:
+ _dict['availability_policy'] = self.availability_policy.to_dict()
+ if hasattr(self, 'default_trusted_profile') and self.default_trusted_profile is not None:
+ if isinstance(self.default_trusted_profile, dict):
+ _dict['default_trusted_profile'] = self.default_trusted_profile
+ else:
+ _dict['default_trusted_profile'] = self.default_trusted_profile.to_dict()
+ if hasattr(self, 'keys') and self.keys is not None:
+ keys_list = []
+ for v in self.keys:
+ if isinstance(v, dict):
+ keys_list.append(v)
+ else:
+ keys_list.append(v.to_dict())
+ _dict['keys'] = keys_list
+ if hasattr(self, 'metadata_service') and self.metadata_service is not None:
+ if isinstance(self.metadata_service, dict):
+ _dict['metadata_service'] = self.metadata_service
+ else:
+ _dict['metadata_service'] = self.metadata_service.to_dict()
if hasattr(self, 'name') and self.name is not None:
_dict['name'] = self.name
- if hasattr(self, '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, 'updated_at') and self.updated_at is not None:
- _dict['updated_at'] = datetime_to_string(self.updated_at)
- if hasattr(self, 'action_type') and self.action_type is not None:
- _dict['action_type'] = self.action_type
- if hasattr(self, 'cron_spec') and self.cron_spec is not None:
- _dict['cron_spec'] = self.cron_spec
- if hasattr(self, 'last_applied_at') and self.last_applied_at is not None:
- _dict['last_applied_at'] = datetime_to_string(self.last_applied_at)
- if hasattr(self, 'next_run_at') and self.next_run_at is not None:
- _dict['next_run_at'] = datetime_to_string(self.next_run_at)
- if hasattr(self, 'manager') and self.manager is not None:
- if isinstance(self.manager, dict):
- _dict['manager'] = self.manager
+ 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['manager'] = self.manager.to_dict()
+ _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, 'reservation_affinity') and self.reservation_affinity is not None:
+ if isinstance(self.reservation_affinity, dict):
+ _dict['reservation_affinity'] = self.reservation_affinity
+ else:
+ _dict['reservation_affinity'] = self.reservation_affinity.to_dict()
+ if hasattr(self, 'resource_group') and self.resource_group is not None:
+ if isinstance(self.resource_group, dict):
+ _dict['resource_group'] = self.resource_group
+ else:
+ _dict['resource_group'] = self.resource_group.to_dict()
+ if hasattr(self, 'total_volume_bandwidth') and self.total_volume_bandwidth is not None:
+ _dict['total_volume_bandwidth'] = self.total_volume_bandwidth
+ if hasattr(self, 'user_data') and self.user_data is not None:
+ _dict['user_data'] = self.user_data
+ if hasattr(self, 'volume_attachments') and self.volume_attachments is not None:
+ volume_attachments_list = []
+ for v in self.volume_attachments:
+ if isinstance(v, dict):
+ volume_attachments_list.append(v)
+ else:
+ volume_attachments_list.append(v.to_dict())
+ _dict['volume_attachments'] = volume_attachments_list
+ if hasattr(self, 'vpc') and self.vpc is not None:
+ if isinstance(self.vpc, dict):
+ _dict['vpc'] = self.vpc
+ else:
+ _dict['vpc'] = self.vpc.to_dict()
+ if hasattr(self, 'boot_volume_attachment') and self.boot_volume_attachment is not None:
+ if isinstance(self.boot_volume_attachment, dict):
+ _dict['boot_volume_attachment'] = self.boot_volume_attachment
+ else:
+ _dict['boot_volume_attachment'] = self.boot_volume_attachment.to_dict()
+ if hasattr(self, 'image') and self.image is not None:
+ if isinstance(self.image, dict):
+ _dict['image'] = self.image
+ else:
+ _dict['image'] = self.image.to_dict()
+ if hasattr(self, 'zone') and self.zone is not None:
+ if isinstance(self.zone, dict):
+ _dict['zone'] = self.zone
+ else:
+ _dict['zone'] = self.zone.to_dict()
+ if hasattr(self, 'network_interfaces') and self.network_interfaces is not None:
+ network_interfaces_list = []
+ for v in self.network_interfaces:
+ if isinstance(v, dict):
+ network_interfaces_list.append(v)
+ else:
+ network_interfaces_list.append(v.to_dict())
+ _dict['network_interfaces'] = network_interfaces_list
+ if hasattr(self, 'primary_network_interface') and self.primary_network_interface is not None:
+ if isinstance(self.primary_network_interface, dict):
+ _dict['primary_network_interface'] = self.primary_network_interface
+ else:
+ _dict['primary_network_interface'] = self.primary_network_interface.to_dict()
return _dict
def _to_dict(self):
@@ -125377,113 +141600,333 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this InstanceGroupManagerActionScheduledActionManagerTarget object."""
+ """Return a `str` version of this InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterface object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceGroupManagerActionScheduledActionManagerTarget') -> bool:
+ def __eq__(self, other: 'InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterface') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'InstanceGroupManagerActionScheduledActionManagerTarget') -> bool:
+ def __ne__(self, other: 'InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterface') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class ResourceTypeEnum(str, Enum):
- """
- The resource type.
- """
-
- INSTANCE_GROUP_MANAGER_ACTION = 'instance_group_manager_action'
-
-
- class StatusEnum(str, Enum):
- """
- The status of the instance group action
- - `active`: Action is ready to be run
- - `completed`: Action was completed successfully
- - `failed`: Action could not be completed successfully
- - `incompatible`: Action parameters are not compatible with the group or manager
- - `omitted`: Action was not applied because this action's manager was disabled.
- """
-
- ACTIVE = 'active'
- COMPLETED = 'completed'
- FAILED = 'failed'
- INCOMPATIBLE = 'incompatible'
- OMITTED = 'omitted'
-
-
- class ActionTypeEnum(str, Enum):
- """
- The type of action for the instance group.
- """
-
- SCHEDULED = 'scheduled'
-
-
-class InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByHref(InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototype):
+class InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkAttachment(InstancePrototypeInstanceBySourceSnapshot):
"""
- InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByHref.
+ InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkAttachment.
- :attr int max_membership_count: (optional) The desired maximum number of
- instance group members at the scheduled time.
- :attr int min_membership_count: (optional) The desired minimum number of
- instance group members at the scheduled time.
- :attr str href: The URL for this instance group manager.
+ :param InstanceAvailabilityPolicyPrototype availability_policy: (optional) The
+ availability policy to use for this virtual server instance.
+ :param InstanceDefaultTrustedProfilePrototype default_trusted_profile:
+ (optional) The default trusted profile configuration to use for this virtual
+ server instance
+ This property's value is used when provisioning the virtual server instance, but
+ not subsequently managed. Accordingly, it is reflected as an [instance
+ initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
+ property.
+ :param List[KeyIdentity] keys: (optional) The public SSH keys for the
+ administrative user of the virtual server instance. Keys will be made available
+ to the virtual server instance as cloud-init vendor data. For cloud-init enabled
+ images, these keys will also be added as SSH authorized keys for the
+ administrative user.
+ For Windows images, the keys of type `rsa` must be specified, and one will be
+ selected to encrypt [the administrator
+ password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys
+ are optional for other images, but if no keys are specified, the instance will
+ be inaccessible unless the specified image provides another means of access.
+ This property's value is used when provisioning the virtual server instance, but
+ not subsequently managed. Accordingly, it is reflected as an [instance
+ initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
+ property.
+ :param InstanceMetadataServicePrototype metadata_service: (optional)
+ :param str name: (optional) The name for this virtual server instance. The name
+ must not be used by another virtual server instance in the region. If
+ unspecified, the name will be a hyphenated list of randomly-selected words.
+ The system hostname will be based on this name.
+ :param InstancePlacementTargetPrototype placement_target: (optional) The
+ placement restrictions to use for the virtual server instance.
+ If specified, `reservation_affinity.policy` must be `disabled`.
+ :param InstanceProfileIdentity profile: (optional) The
+ [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this
+ virtual server instance.
+ If unspecified, `bx2-2x8` will be used, but this default value is expected to
+ change in the future.
+ :param InstanceReservationAffinityPrototype reservation_affinity: (optional)
+ :param ResourceGroupIdentity resource_group: (optional)
+ :param int total_volume_bandwidth: (optional) The amount of bandwidth (in
+ megabits per second) allocated exclusively to instance storage volumes. An
+ increase in this value will result in a corresponding decrease to
+ `total_network_bandwidth`.
+ :param str user_data: (optional) [User
+ data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when
+ setting up the virtual server instance.
+ :param List[VolumeAttachmentPrototype] volume_attachments: (optional) The
+ additional volume attachments to create for the virtual server instance.
+ :param VPCIdentity vpc: (optional) The VPC this virtual server instance will
+ reside in.
+ If specified, it must match the VPC for the subnets of the instance network
+ attachments or instance network interfaces.
+ :param VolumeAttachmentPrototypeInstanceBySourceSnapshotContext
+ boot_volume_attachment: The boot volume attachment to create for the virtual
+ server instance.
+ :param ZoneIdentity zone: The zone this virtual server instance will reside in.
+ :param List[InstanceNetworkAttachmentPrototype] network_attachments: (optional)
+ The additional network attachments to create for the virtual server instance.
+ :param InstanceNetworkAttachmentPrototype primary_network_attachment: The
+ primary network attachment to create for the virtual server instance.
"""
def __init__(
self,
- href: str,
- *,
- max_membership_count: int = None,
- min_membership_count: int = None,
- ) -> None:
- """
- Initialize a InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByHref object.
+ boot_volume_attachment: 'VolumeAttachmentPrototypeInstanceBySourceSnapshotContext',
+ zone: 'ZoneIdentity',
+ primary_network_attachment: 'InstanceNetworkAttachmentPrototype',
+ *,
+ availability_policy: Optional['InstanceAvailabilityPolicyPrototype'] = None,
+ default_trusted_profile: Optional['InstanceDefaultTrustedProfilePrototype'] = None,
+ keys: Optional[List['KeyIdentity']] = None,
+ metadata_service: Optional['InstanceMetadataServicePrototype'] = None,
+ name: Optional[str] = None,
+ placement_target: Optional['InstancePlacementTargetPrototype'] = None,
+ profile: Optional['InstanceProfileIdentity'] = None,
+ reservation_affinity: Optional['InstanceReservationAffinityPrototype'] = None,
+ resource_group: Optional['ResourceGroupIdentity'] = None,
+ total_volume_bandwidth: Optional[int] = None,
+ user_data: Optional[str] = None,
+ volume_attachments: Optional[List['VolumeAttachmentPrototype']] = None,
+ vpc: Optional['VPCIdentity'] = None,
+ network_attachments: Optional[List['InstanceNetworkAttachmentPrototype']] = None,
+ ) -> None:
+ """
+ Initialize a InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkAttachment object.
- :param str href: The URL for this instance group manager.
- :param int max_membership_count: (optional) The desired maximum number of
- instance group members at the scheduled time.
- :param int min_membership_count: (optional) The desired minimum number of
- instance group members at the scheduled time.
+ :param VolumeAttachmentPrototypeInstanceBySourceSnapshotContext
+ boot_volume_attachment: The boot volume attachment to create for the
+ virtual server instance.
+ :param ZoneIdentity zone: The zone this virtual server instance will reside
+ in.
+ :param InstanceNetworkAttachmentPrototype primary_network_attachment: The
+ primary network attachment to create for the virtual server instance.
+ :param InstanceAvailabilityPolicyPrototype availability_policy: (optional)
+ The availability policy to use for this virtual server instance.
+ :param InstanceDefaultTrustedProfilePrototype default_trusted_profile:
+ (optional) The default trusted profile configuration to use for this
+ virtual server instance
+ This property's value is used when provisioning the virtual server
+ instance, but not subsequently managed. Accordingly, it is reflected as an
+ [instance
+ initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
+ property.
+ :param List[KeyIdentity] keys: (optional) The public SSH keys for the
+ administrative user of the virtual server instance. Keys will be made
+ available to the virtual server instance as cloud-init vendor data. For
+ cloud-init enabled images, these keys will also be added as SSH authorized
+ keys for the administrative user.
+ For Windows images, the keys of type `rsa` must be specified, and one will
+ be selected to encrypt [the administrator
+ password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization).
+ Keys are optional for other images, but if no keys are specified, the
+ instance will be inaccessible unless the specified image provides another
+ means of access.
+ This property's value is used when provisioning the virtual server
+ instance, but not subsequently managed. Accordingly, it is reflected as an
+ [instance
+ initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
+ property.
+ :param InstanceMetadataServicePrototype metadata_service: (optional)
+ :param str name: (optional) The name for this virtual server instance. The
+ name must not be used by another virtual server instance in the region. If
+ unspecified, the name will be a hyphenated list of randomly-selected words.
+ The system hostname will be based on this name.
+ :param InstancePlacementTargetPrototype placement_target: (optional) The
+ placement restrictions to use for the virtual server instance.
+ If specified, `reservation_affinity.policy` must be `disabled`.
+ :param InstanceProfileIdentity profile: (optional) The
+ [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for
+ this virtual server instance.
+ If unspecified, `bx2-2x8` will be used, but this default value is expected
+ to change in the future.
+ :param InstanceReservationAffinityPrototype reservation_affinity:
+ (optional)
+ :param ResourceGroupIdentity resource_group: (optional)
+ :param int total_volume_bandwidth: (optional) The amount of bandwidth (in
+ megabits per second) allocated exclusively to instance storage volumes. An
+ increase in this value will result in a corresponding decrease to
+ `total_network_bandwidth`.
+ :param str user_data: (optional) [User
+ data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available
+ when setting up the virtual server instance.
+ :param List[VolumeAttachmentPrototype] volume_attachments: (optional) The
+ additional volume attachments to create for the virtual server instance.
+ :param VPCIdentity vpc: (optional) The VPC this virtual server instance
+ will reside in.
+ If specified, it must match the VPC for the subnets of the instance network
+ attachments or instance network interfaces.
+ :param List[InstanceNetworkAttachmentPrototype] network_attachments:
+ (optional) The additional network attachments to create for the virtual
+ server instance.
"""
# pylint: disable=super-init-not-called
- self.max_membership_count = max_membership_count
- self.min_membership_count = min_membership_count
- self.href = href
+ self.availability_policy = availability_policy
+ self.default_trusted_profile = default_trusted_profile
+ self.keys = keys
+ self.metadata_service = metadata_service
+ self.name = name
+ self.placement_target = placement_target
+ self.profile = profile
+ self.reservation_affinity = reservation_affinity
+ self.resource_group = resource_group
+ self.total_volume_bandwidth = total_volume_bandwidth
+ self.user_data = user_data
+ self.volume_attachments = volume_attachments
+ self.vpc = vpc
+ self.boot_volume_attachment = boot_volume_attachment
+ self.zone = zone
+ self.network_attachments = network_attachments
+ self.primary_network_attachment = primary_network_attachment
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByHref':
- """Initialize a InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByHref object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkAttachment':
+ """Initialize a InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkAttachment 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 'href' in _dict:
- args['href'] = _dict.get('href')
+ if (availability_policy := _dict.get('availability_policy')) is not None:
+ args['availability_policy'] = InstanceAvailabilityPolicyPrototype.from_dict(availability_policy)
+ if (default_trusted_profile := _dict.get('default_trusted_profile')) is not None:
+ args['default_trusted_profile'] = InstanceDefaultTrustedProfilePrototype.from_dict(default_trusted_profile)
+ if (keys := _dict.get('keys')) is not None:
+ args['keys'] = keys
+ if (metadata_service := _dict.get('metadata_service')) is not None:
+ args['metadata_service'] = InstanceMetadataServicePrototype.from_dict(metadata_service)
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ if (placement_target := _dict.get('placement_target')) is not None:
+ args['placement_target'] = placement_target
+ if (profile := _dict.get('profile')) is not None:
+ args['profile'] = profile
+ if (reservation_affinity := _dict.get('reservation_affinity')) is not None:
+ args['reservation_affinity'] = InstanceReservationAffinityPrototype.from_dict(reservation_affinity)
+ if (resource_group := _dict.get('resource_group')) is not None:
+ args['resource_group'] = resource_group
+ if (total_volume_bandwidth := _dict.get('total_volume_bandwidth')) is not None:
+ args['total_volume_bandwidth'] = total_volume_bandwidth
+ if (user_data := _dict.get('user_data')) is not None:
+ args['user_data'] = user_data
+ if (volume_attachments := _dict.get('volume_attachments')) is not None:
+ args['volume_attachments'] = [VolumeAttachmentPrototype.from_dict(v) for v in volume_attachments]
+ if (vpc := _dict.get('vpc')) is not None:
+ args['vpc'] = vpc
+ if (boot_volume_attachment := _dict.get('boot_volume_attachment')) is not None:
+ args['boot_volume_attachment'] = VolumeAttachmentPrototypeInstanceBySourceSnapshotContext.from_dict(boot_volume_attachment)
else:
- raise ValueError('Required property \'href\' not present in InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByHref JSON')
+ raise ValueError('Required property \'boot_volume_attachment\' not present in InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkAttachment JSON')
+ if (zone := _dict.get('zone')) is not None:
+ args['zone'] = zone
+ else:
+ raise ValueError('Required property \'zone\' not present in InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkAttachment JSON')
+ if (network_attachments := _dict.get('network_attachments')) is not None:
+ args['network_attachments'] = [InstanceNetworkAttachmentPrototype.from_dict(v) for v in network_attachments]
+ if (primary_network_attachment := _dict.get('primary_network_attachment')) is not None:
+ args['primary_network_attachment'] = InstanceNetworkAttachmentPrototype.from_dict(primary_network_attachment)
+ else:
+ raise ValueError('Required property \'primary_network_attachment\' not present in InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkAttachment JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByHref object from a json dictionary."""
+ """Initialize a InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkAttachment object from 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, 'href') and self.href is not None:
- _dict['href'] = self.href
+ if hasattr(self, 'availability_policy') and self.availability_policy is not None:
+ if isinstance(self.availability_policy, dict):
+ _dict['availability_policy'] = self.availability_policy
+ else:
+ _dict['availability_policy'] = self.availability_policy.to_dict()
+ if hasattr(self, 'default_trusted_profile') and self.default_trusted_profile is not None:
+ if isinstance(self.default_trusted_profile, dict):
+ _dict['default_trusted_profile'] = self.default_trusted_profile
+ else:
+ _dict['default_trusted_profile'] = self.default_trusted_profile.to_dict()
+ if hasattr(self, 'keys') and self.keys is not None:
+ keys_list = []
+ for v in self.keys:
+ if isinstance(v, dict):
+ keys_list.append(v)
+ else:
+ keys_list.append(v.to_dict())
+ _dict['keys'] = keys_list
+ if hasattr(self, 'metadata_service') and self.metadata_service is not None:
+ if isinstance(self.metadata_service, dict):
+ _dict['metadata_service'] = self.metadata_service
+ else:
+ _dict['metadata_service'] = self.metadata_service.to_dict()
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ if hasattr(self, 'placement_target') and self.placement_target is not None:
+ if isinstance(self.placement_target, dict):
+ _dict['placement_target'] = self.placement_target
+ else:
+ _dict['placement_target'] = self.placement_target.to_dict()
+ if hasattr(self, 'profile') and self.profile is not None:
+ if isinstance(self.profile, dict):
+ _dict['profile'] = self.profile
+ else:
+ _dict['profile'] = self.profile.to_dict()
+ if hasattr(self, 'reservation_affinity') and self.reservation_affinity is not None:
+ if isinstance(self.reservation_affinity, dict):
+ _dict['reservation_affinity'] = self.reservation_affinity
+ else:
+ _dict['reservation_affinity'] = self.reservation_affinity.to_dict()
+ if hasattr(self, 'resource_group') and self.resource_group is not None:
+ if isinstance(self.resource_group, dict):
+ _dict['resource_group'] = self.resource_group
+ else:
+ _dict['resource_group'] = self.resource_group.to_dict()
+ if hasattr(self, 'total_volume_bandwidth') and self.total_volume_bandwidth is not None:
+ _dict['total_volume_bandwidth'] = self.total_volume_bandwidth
+ if hasattr(self, 'user_data') and self.user_data is not None:
+ _dict['user_data'] = self.user_data
+ if hasattr(self, 'volume_attachments') and self.volume_attachments is not None:
+ volume_attachments_list = []
+ for v in self.volume_attachments:
+ if isinstance(v, dict):
+ volume_attachments_list.append(v)
+ else:
+ volume_attachments_list.append(v.to_dict())
+ _dict['volume_attachments'] = volume_attachments_list
+ if hasattr(self, 'vpc') and self.vpc is not None:
+ if isinstance(self.vpc, dict):
+ _dict['vpc'] = self.vpc
+ else:
+ _dict['vpc'] = self.vpc.to_dict()
+ if hasattr(self, 'boot_volume_attachment') and self.boot_volume_attachment is not None:
+ if isinstance(self.boot_volume_attachment, dict):
+ _dict['boot_volume_attachment'] = self.boot_volume_attachment
+ else:
+ _dict['boot_volume_attachment'] = self.boot_volume_attachment.to_dict()
+ if hasattr(self, 'zone') and self.zone is not None:
+ if isinstance(self.zone, dict):
+ _dict['zone'] = self.zone
+ else:
+ _dict['zone'] = self.zone.to_dict()
+ if hasattr(self, 'network_attachments') and self.network_attachments is not None:
+ network_attachments_list = []
+ for v in self.network_attachments:
+ if isinstance(v, dict):
+ network_attachments_list.append(v)
+ else:
+ network_attachments_list.append(v.to_dict())
+ _dict['network_attachments'] = network_attachments_list
+ if hasattr(self, 'primary_network_attachment') and self.primary_network_attachment is not None:
+ if isinstance(self.primary_network_attachment, dict):
+ _dict['primary_network_attachment'] = self.primary_network_attachment
+ else:
+ _dict['primary_network_attachment'] = self.primary_network_attachment.to_dict()
return _dict
def _to_dict(self):
@@ -125491,80 +141934,332 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByHref object."""
+ """Return a `str` version of this InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkAttachment object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByHref') -> bool:
+ def __eq__(self, other: 'InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkAttachment') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByHref') -> bool:
+ def __ne__(self, other: 'InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkAttachment') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeById(InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototype):
+class InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkInterface(InstancePrototypeInstanceBySourceSnapshot):
"""
- InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeById.
+ InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkInterface.
- :attr int max_membership_count: (optional) The desired maximum number of
- instance group members at the scheduled time.
- :attr int min_membership_count: (optional) The desired minimum number of
- instance group members at the scheduled time.
- :attr str id: The unique identifier for this instance group manager.
+ :param InstanceAvailabilityPolicyPrototype availability_policy: (optional) The
+ availability policy to use for this virtual server instance.
+ :param InstanceDefaultTrustedProfilePrototype default_trusted_profile:
+ (optional) The default trusted profile configuration to use for this virtual
+ server instance
+ This property's value is used when provisioning the virtual server instance, but
+ not subsequently managed. Accordingly, it is reflected as an [instance
+ initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
+ property.
+ :param List[KeyIdentity] keys: (optional) The public SSH keys for the
+ administrative user of the virtual server instance. Keys will be made available
+ to the virtual server instance as cloud-init vendor data. For cloud-init enabled
+ images, these keys will also be added as SSH authorized keys for the
+ administrative user.
+ For Windows images, the keys of type `rsa` must be specified, and one will be
+ selected to encrypt [the administrator
+ password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys
+ are optional for other images, but if no keys are specified, the instance will
+ be inaccessible unless the specified image provides another means of access.
+ This property's value is used when provisioning the virtual server instance, but
+ not subsequently managed. Accordingly, it is reflected as an [instance
+ initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
+ property.
+ :param InstanceMetadataServicePrototype metadata_service: (optional)
+ :param str name: (optional) The name for this virtual server instance. The name
+ must not be used by another virtual server instance in the region. If
+ unspecified, the name will be a hyphenated list of randomly-selected words.
+ The system hostname will be based on this name.
+ :param InstancePlacementTargetPrototype placement_target: (optional) The
+ placement restrictions to use for the virtual server instance.
+ If specified, `reservation_affinity.policy` must be `disabled`.
+ :param InstanceProfileIdentity profile: (optional) The
+ [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this
+ virtual server instance.
+ If unspecified, `bx2-2x8` will be used, but this default value is expected to
+ change in the future.
+ :param InstanceReservationAffinityPrototype reservation_affinity: (optional)
+ :param ResourceGroupIdentity resource_group: (optional)
+ :param int total_volume_bandwidth: (optional) The amount of bandwidth (in
+ megabits per second) allocated exclusively to instance storage volumes. An
+ increase in this value will result in a corresponding decrease to
+ `total_network_bandwidth`.
+ :param str user_data: (optional) [User
+ data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when
+ setting up the virtual server instance.
+ :param List[VolumeAttachmentPrototype] volume_attachments: (optional) The
+ additional volume attachments to create for the virtual server instance.
+ :param VPCIdentity vpc: (optional) The VPC this virtual server instance will
+ reside in.
+ If specified, it must match the VPC for the subnets of the instance network
+ attachments or instance network interfaces.
+ :param VolumeAttachmentPrototypeInstanceBySourceSnapshotContext
+ boot_volume_attachment: The boot volume attachment to create for the virtual
+ server instance.
+ :param ZoneIdentity zone: The zone this virtual server instance will reside in.
+ :param List[NetworkInterfacePrototype] network_interfaces: (optional) The
+ additional instance network interfaces to create.
+ :param NetworkInterfacePrototype primary_network_interface: The primary instance
+ network interface to create.
"""
def __init__(
self,
- id: str,
+ boot_volume_attachment: 'VolumeAttachmentPrototypeInstanceBySourceSnapshotContext',
+ zone: 'ZoneIdentity',
+ primary_network_interface: 'NetworkInterfacePrototype',
*,
- max_membership_count: int = None,
- min_membership_count: int = None,
+ availability_policy: Optional['InstanceAvailabilityPolicyPrototype'] = None,
+ default_trusted_profile: Optional['InstanceDefaultTrustedProfilePrototype'] = None,
+ keys: Optional[List['KeyIdentity']] = None,
+ metadata_service: Optional['InstanceMetadataServicePrototype'] = None,
+ name: Optional[str] = None,
+ placement_target: Optional['InstancePlacementTargetPrototype'] = None,
+ profile: Optional['InstanceProfileIdentity'] = None,
+ reservation_affinity: Optional['InstanceReservationAffinityPrototype'] = None,
+ resource_group: Optional['ResourceGroupIdentity'] = None,
+ total_volume_bandwidth: Optional[int] = None,
+ user_data: Optional[str] = None,
+ volume_attachments: Optional[List['VolumeAttachmentPrototype']] = None,
+ vpc: Optional['VPCIdentity'] = None,
+ network_interfaces: Optional[List['NetworkInterfacePrototype']] = None,
) -> None:
"""
- Initialize a InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeById object.
+ Initialize a InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkInterface object.
- :param str id: The unique identifier for this instance group manager.
- :param int max_membership_count: (optional) The desired maximum number of
- instance group members at the scheduled time.
- :param int min_membership_count: (optional) The desired minimum number of
- instance group members at the scheduled time.
+ :param VolumeAttachmentPrototypeInstanceBySourceSnapshotContext
+ boot_volume_attachment: The boot volume attachment to create for the
+ virtual server instance.
+ :param ZoneIdentity zone: The zone this virtual server instance will reside
+ in.
+ :param NetworkInterfacePrototype primary_network_interface: The primary
+ instance network interface to create.
+ :param InstanceAvailabilityPolicyPrototype availability_policy: (optional)
+ The availability policy to use for this virtual server instance.
+ :param InstanceDefaultTrustedProfilePrototype default_trusted_profile:
+ (optional) The default trusted profile configuration to use for this
+ virtual server instance
+ This property's value is used when provisioning the virtual server
+ instance, but not subsequently managed. Accordingly, it is reflected as an
+ [instance
+ initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
+ property.
+ :param List[KeyIdentity] keys: (optional) The public SSH keys for the
+ administrative user of the virtual server instance. Keys will be made
+ available to the virtual server instance as cloud-init vendor data. For
+ cloud-init enabled images, these keys will also be added as SSH authorized
+ keys for the administrative user.
+ For Windows images, the keys of type `rsa` must be specified, and one will
+ be selected to encrypt [the administrator
+ password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization).
+ Keys are optional for other images, but if no keys are specified, the
+ instance will be inaccessible unless the specified image provides another
+ means of access.
+ This property's value is used when provisioning the virtual server
+ instance, but not subsequently managed. Accordingly, it is reflected as an
+ [instance
+ initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
+ property.
+ :param InstanceMetadataServicePrototype metadata_service: (optional)
+ :param str name: (optional) The name for this virtual server instance. The
+ name must not be used by another virtual server instance in the region. If
+ unspecified, the name will be a hyphenated list of randomly-selected words.
+ The system hostname will be based on this name.
+ :param InstancePlacementTargetPrototype placement_target: (optional) The
+ placement restrictions to use for the virtual server instance.
+ If specified, `reservation_affinity.policy` must be `disabled`.
+ :param InstanceProfileIdentity profile: (optional) The
+ [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for
+ this virtual server instance.
+ If unspecified, `bx2-2x8` will be used, but this default value is expected
+ to change in the future.
+ :param InstanceReservationAffinityPrototype reservation_affinity:
+ (optional)
+ :param ResourceGroupIdentity resource_group: (optional)
+ :param int total_volume_bandwidth: (optional) The amount of bandwidth (in
+ megabits per second) allocated exclusively to instance storage volumes. An
+ increase in this value will result in a corresponding decrease to
+ `total_network_bandwidth`.
+ :param str user_data: (optional) [User
+ data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available
+ when setting up the virtual server instance.
+ :param List[VolumeAttachmentPrototype] volume_attachments: (optional) The
+ additional volume attachments to create for the virtual server instance.
+ :param VPCIdentity vpc: (optional) The VPC this virtual server instance
+ will reside in.
+ If specified, it must match the VPC for the subnets of the instance network
+ attachments or instance network interfaces.
+ :param List[NetworkInterfacePrototype] network_interfaces: (optional) The
+ additional instance network interfaces to create.
"""
# pylint: disable=super-init-not-called
- self.max_membership_count = max_membership_count
- self.min_membership_count = min_membership_count
- self.id = id
+ self.availability_policy = availability_policy
+ self.default_trusted_profile = default_trusted_profile
+ self.keys = keys
+ self.metadata_service = metadata_service
+ self.name = name
+ self.placement_target = placement_target
+ self.profile = profile
+ self.reservation_affinity = reservation_affinity
+ self.resource_group = resource_group
+ self.total_volume_bandwidth = total_volume_bandwidth
+ self.user_data = user_data
+ self.volume_attachments = volume_attachments
+ self.vpc = vpc
+ self.boot_volume_attachment = boot_volume_attachment
+ self.zone = zone
+ self.network_interfaces = network_interfaces
+ self.primary_network_interface = primary_network_interface
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeById':
- """Initialize a InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeById object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkInterface':
+ """Initialize a InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkInterface 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 'id' in _dict:
- args['id'] = _dict.get('id')
+ if (availability_policy := _dict.get('availability_policy')) is not None:
+ args['availability_policy'] = InstanceAvailabilityPolicyPrototype.from_dict(availability_policy)
+ if (default_trusted_profile := _dict.get('default_trusted_profile')) is not None:
+ args['default_trusted_profile'] = InstanceDefaultTrustedProfilePrototype.from_dict(default_trusted_profile)
+ if (keys := _dict.get('keys')) is not None:
+ args['keys'] = keys
+ if (metadata_service := _dict.get('metadata_service')) is not None:
+ args['metadata_service'] = InstanceMetadataServicePrototype.from_dict(metadata_service)
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ if (placement_target := _dict.get('placement_target')) is not None:
+ args['placement_target'] = placement_target
+ if (profile := _dict.get('profile')) is not None:
+ args['profile'] = profile
+ if (reservation_affinity := _dict.get('reservation_affinity')) is not None:
+ args['reservation_affinity'] = InstanceReservationAffinityPrototype.from_dict(reservation_affinity)
+ if (resource_group := _dict.get('resource_group')) is not None:
+ args['resource_group'] = resource_group
+ if (total_volume_bandwidth := _dict.get('total_volume_bandwidth')) is not None:
+ args['total_volume_bandwidth'] = total_volume_bandwidth
+ if (user_data := _dict.get('user_data')) is not None:
+ args['user_data'] = user_data
+ if (volume_attachments := _dict.get('volume_attachments')) is not None:
+ args['volume_attachments'] = [VolumeAttachmentPrototype.from_dict(v) for v in volume_attachments]
+ if (vpc := _dict.get('vpc')) is not None:
+ args['vpc'] = vpc
+ if (boot_volume_attachment := _dict.get('boot_volume_attachment')) is not None:
+ args['boot_volume_attachment'] = VolumeAttachmentPrototypeInstanceBySourceSnapshotContext.from_dict(boot_volume_attachment)
else:
- raise ValueError('Required property \'id\' not present in InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeById JSON')
+ raise ValueError('Required property \'boot_volume_attachment\' not present in InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkInterface JSON')
+ if (zone := _dict.get('zone')) is not None:
+ args['zone'] = zone
+ else:
+ raise ValueError('Required property \'zone\' not present in InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkInterface JSON')
+ if (network_interfaces := _dict.get('network_interfaces')) is not None:
+ args['network_interfaces'] = [NetworkInterfacePrototype.from_dict(v) for v in network_interfaces]
+ if (primary_network_interface := _dict.get('primary_network_interface')) is not None:
+ args['primary_network_interface'] = NetworkInterfacePrototype.from_dict(primary_network_interface)
+ else:
+ raise ValueError('Required property \'primary_network_interface\' not present in InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkInterface JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeById object from a json dictionary."""
+ """Initialize a InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkInterface object from 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, 'id') and self.id is not None:
- _dict['id'] = self.id
+ if hasattr(self, 'availability_policy') and self.availability_policy is not None:
+ if isinstance(self.availability_policy, dict):
+ _dict['availability_policy'] = self.availability_policy
+ else:
+ _dict['availability_policy'] = self.availability_policy.to_dict()
+ if hasattr(self, 'default_trusted_profile') and self.default_trusted_profile is not None:
+ if isinstance(self.default_trusted_profile, dict):
+ _dict['default_trusted_profile'] = self.default_trusted_profile
+ else:
+ _dict['default_trusted_profile'] = self.default_trusted_profile.to_dict()
+ if hasattr(self, 'keys') and self.keys is not None:
+ keys_list = []
+ for v in self.keys:
+ if isinstance(v, dict):
+ keys_list.append(v)
+ else:
+ keys_list.append(v.to_dict())
+ _dict['keys'] = keys_list
+ if hasattr(self, 'metadata_service') and self.metadata_service is not None:
+ if isinstance(self.metadata_service, dict):
+ _dict['metadata_service'] = self.metadata_service
+ else:
+ _dict['metadata_service'] = self.metadata_service.to_dict()
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ if hasattr(self, 'placement_target') and self.placement_target is not None:
+ if isinstance(self.placement_target, dict):
+ _dict['placement_target'] = self.placement_target
+ else:
+ _dict['placement_target'] = self.placement_target.to_dict()
+ if hasattr(self, 'profile') and self.profile is not None:
+ if isinstance(self.profile, dict):
+ _dict['profile'] = self.profile
+ else:
+ _dict['profile'] = self.profile.to_dict()
+ if hasattr(self, 'reservation_affinity') and self.reservation_affinity is not None:
+ if isinstance(self.reservation_affinity, dict):
+ _dict['reservation_affinity'] = self.reservation_affinity
+ else:
+ _dict['reservation_affinity'] = self.reservation_affinity.to_dict()
+ if hasattr(self, 'resource_group') and self.resource_group is not None:
+ if isinstance(self.resource_group, dict):
+ _dict['resource_group'] = self.resource_group
+ else:
+ _dict['resource_group'] = self.resource_group.to_dict()
+ if hasattr(self, 'total_volume_bandwidth') and self.total_volume_bandwidth is not None:
+ _dict['total_volume_bandwidth'] = self.total_volume_bandwidth
+ if hasattr(self, 'user_data') and self.user_data is not None:
+ _dict['user_data'] = self.user_data
+ if hasattr(self, 'volume_attachments') and self.volume_attachments is not None:
+ volume_attachments_list = []
+ for v in self.volume_attachments:
+ if isinstance(v, dict):
+ volume_attachments_list.append(v)
+ else:
+ volume_attachments_list.append(v.to_dict())
+ _dict['volume_attachments'] = volume_attachments_list
+ if hasattr(self, 'vpc') and self.vpc is not None:
+ if isinstance(self.vpc, dict):
+ _dict['vpc'] = self.vpc
+ else:
+ _dict['vpc'] = self.vpc.to_dict()
+ if hasattr(self, 'boot_volume_attachment') and self.boot_volume_attachment is not None:
+ if isinstance(self.boot_volume_attachment, dict):
+ _dict['boot_volume_attachment'] = self.boot_volume_attachment
+ else:
+ _dict['boot_volume_attachment'] = self.boot_volume_attachment.to_dict()
+ if hasattr(self, 'zone') and self.zone is not None:
+ if isinstance(self.zone, dict):
+ _dict['zone'] = self.zone
+ else:
+ _dict['zone'] = self.zone.to_dict()
+ if hasattr(self, 'network_interfaces') and self.network_interfaces is not None:
+ network_interfaces_list = []
+ for v in self.network_interfaces:
+ if isinstance(v, dict):
+ network_interfaces_list.append(v)
+ else:
+ network_interfaces_list.append(v.to_dict())
+ _dict['network_interfaces'] = network_interfaces_list
+ if hasattr(self, 'primary_network_interface') and self.primary_network_interface is not None:
+ if isinstance(self.primary_network_interface, dict):
+ _dict['primary_network_interface'] = self.primary_network_interface
+ else:
+ _dict['primary_network_interface'] = self.primary_network_interface.to_dict()
return _dict
def _to_dict(self):
@@ -125572,59 +142267,332 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeById object."""
+ """Return a `str` version of this InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkInterface object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeById') -> bool:
+ def __eq__(self, other: 'InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkInterface') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeById') -> bool:
+ def __ne__(self, other: 'InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkInterface') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN(InstancePlacementTargetPatchDedicatedHostGroupIdentity):
+class InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkAttachment(InstancePrototypeInstanceByVolume):
"""
- InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN.
+ InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkAttachment.
- :attr str crn: The CRN for this dedicated host group.
+ :param InstanceAvailabilityPolicyPrototype availability_policy: (optional) The
+ availability policy to use for this virtual server instance.
+ :param InstanceDefaultTrustedProfilePrototype default_trusted_profile:
+ (optional) The default trusted profile configuration to use for this virtual
+ server instance
+ This property's value is used when provisioning the virtual server instance, but
+ not subsequently managed. Accordingly, it is reflected as an [instance
+ initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
+ property.
+ :param List[KeyIdentity] keys: (optional) The public SSH keys for the
+ administrative user of the virtual server instance. Keys will be made available
+ to the virtual server instance as cloud-init vendor data. For cloud-init enabled
+ images, these keys will also be added as SSH authorized keys for the
+ administrative user.
+ For Windows images, the keys of type `rsa` must be specified, and one will be
+ selected to encrypt [the administrator
+ password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys
+ are optional for other images, but if no keys are specified, the instance will
+ be inaccessible unless the specified image provides another means of access.
+ This property's value is used when provisioning the virtual server instance, but
+ not subsequently managed. Accordingly, it is reflected as an [instance
+ initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
+ property.
+ :param InstanceMetadataServicePrototype metadata_service: (optional)
+ :param str name: (optional) The name for this virtual server instance. The name
+ must not be used by another virtual server instance in the region. If
+ unspecified, the name will be a hyphenated list of randomly-selected words.
+ The system hostname will be based on this name.
+ :param InstancePlacementTargetPrototype placement_target: (optional) The
+ placement restrictions to use for the virtual server instance.
+ If specified, `reservation_affinity.policy` must be `disabled`.
+ :param InstanceProfileIdentity profile: (optional) The
+ [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this
+ virtual server instance.
+ If unspecified, `bx2-2x8` will be used, but this default value is expected to
+ change in the future.
+ :param InstanceReservationAffinityPrototype reservation_affinity: (optional)
+ :param ResourceGroupIdentity resource_group: (optional)
+ :param int total_volume_bandwidth: (optional) The amount of bandwidth (in
+ megabits per second) allocated exclusively to instance storage volumes. An
+ increase in this value will result in a corresponding decrease to
+ `total_network_bandwidth`.
+ :param str user_data: (optional) [User
+ data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when
+ setting up the virtual server instance.
+ :param List[VolumeAttachmentPrototype] volume_attachments: (optional) The
+ additional volume attachments to create for the virtual server instance.
+ :param VPCIdentity vpc: (optional) The VPC this virtual server instance will
+ reside in.
+ If specified, it must match the VPC for the subnets of the instance network
+ attachments or instance network interfaces.
+ :param VolumeAttachmentPrototypeInstanceByVolumeContext boot_volume_attachment:
+ The boot volume attachment for the virtual server instance.
+ :param ZoneIdentity zone: The zone this virtual server instance will reside in.
+ :param List[InstanceNetworkAttachmentPrototype] network_attachments: (optional)
+ The additional network attachments to create for the virtual server instance.
+ :param InstanceNetworkAttachmentPrototype primary_network_attachment: The
+ primary network attachment to create for the virtual server instance.
"""
def __init__(
self,
- crn: str,
- ) -> None:
- """
- Initialize a InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN object.
+ boot_volume_attachment: 'VolumeAttachmentPrototypeInstanceByVolumeContext',
+ zone: 'ZoneIdentity',
+ primary_network_attachment: 'InstanceNetworkAttachmentPrototype',
+ *,
+ availability_policy: Optional['InstanceAvailabilityPolicyPrototype'] = None,
+ default_trusted_profile: Optional['InstanceDefaultTrustedProfilePrototype'] = None,
+ keys: Optional[List['KeyIdentity']] = None,
+ metadata_service: Optional['InstanceMetadataServicePrototype'] = None,
+ name: Optional[str] = None,
+ placement_target: Optional['InstancePlacementTargetPrototype'] = None,
+ profile: Optional['InstanceProfileIdentity'] = None,
+ reservation_affinity: Optional['InstanceReservationAffinityPrototype'] = None,
+ resource_group: Optional['ResourceGroupIdentity'] = None,
+ total_volume_bandwidth: Optional[int] = None,
+ user_data: Optional[str] = None,
+ volume_attachments: Optional[List['VolumeAttachmentPrototype']] = None,
+ vpc: Optional['VPCIdentity'] = None,
+ network_attachments: Optional[List['InstanceNetworkAttachmentPrototype']] = None,
+ ) -> None:
+ """
+ Initialize a InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkAttachment object.
- :param str crn: The CRN for this dedicated host group.
+ :param VolumeAttachmentPrototypeInstanceByVolumeContext
+ boot_volume_attachment: The boot volume attachment for the virtual server
+ instance.
+ :param ZoneIdentity zone: The zone this virtual server instance will reside
+ in.
+ :param InstanceNetworkAttachmentPrototype primary_network_attachment: The
+ primary network attachment to create for the virtual server instance.
+ :param InstanceAvailabilityPolicyPrototype availability_policy: (optional)
+ The availability policy to use for this virtual server instance.
+ :param InstanceDefaultTrustedProfilePrototype default_trusted_profile:
+ (optional) The default trusted profile configuration to use for this
+ virtual server instance
+ This property's value is used when provisioning the virtual server
+ instance, but not subsequently managed. Accordingly, it is reflected as an
+ [instance
+ initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
+ property.
+ :param List[KeyIdentity] keys: (optional) The public SSH keys for the
+ administrative user of the virtual server instance. Keys will be made
+ available to the virtual server instance as cloud-init vendor data. For
+ cloud-init enabled images, these keys will also be added as SSH authorized
+ keys for the administrative user.
+ For Windows images, the keys of type `rsa` must be specified, and one will
+ be selected to encrypt [the administrator
+ password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization).
+ Keys are optional for other images, but if no keys are specified, the
+ instance will be inaccessible unless the specified image provides another
+ means of access.
+ This property's value is used when provisioning the virtual server
+ instance, but not subsequently managed. Accordingly, it is reflected as an
+ [instance
+ initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
+ property.
+ :param InstanceMetadataServicePrototype metadata_service: (optional)
+ :param str name: (optional) The name for this virtual server instance. The
+ name must not be used by another virtual server instance in the region. If
+ unspecified, the name will be a hyphenated list of randomly-selected words.
+ The system hostname will be based on this name.
+ :param InstancePlacementTargetPrototype placement_target: (optional) The
+ placement restrictions to use for the virtual server instance.
+ If specified, `reservation_affinity.policy` must be `disabled`.
+ :param InstanceProfileIdentity profile: (optional) The
+ [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for
+ this virtual server instance.
+ If unspecified, `bx2-2x8` will be used, but this default value is expected
+ to change in the future.
+ :param InstanceReservationAffinityPrototype reservation_affinity:
+ (optional)
+ :param ResourceGroupIdentity resource_group: (optional)
+ :param int total_volume_bandwidth: (optional) The amount of bandwidth (in
+ megabits per second) allocated exclusively to instance storage volumes. An
+ increase in this value will result in a corresponding decrease to
+ `total_network_bandwidth`.
+ :param str user_data: (optional) [User
+ data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available
+ when setting up the virtual server instance.
+ :param List[VolumeAttachmentPrototype] volume_attachments: (optional) The
+ additional volume attachments to create for the virtual server instance.
+ :param VPCIdentity vpc: (optional) The VPC this virtual server instance
+ will reside in.
+ If specified, it must match the VPC for the subnets of the instance network
+ attachments or instance network interfaces.
+ :param List[InstanceNetworkAttachmentPrototype] network_attachments:
+ (optional) The additional network attachments to create for the virtual
+ server instance.
"""
# pylint: disable=super-init-not-called
- self.crn = crn
+ self.availability_policy = availability_policy
+ self.default_trusted_profile = default_trusted_profile
+ self.keys = keys
+ self.metadata_service = metadata_service
+ self.name = name
+ self.placement_target = placement_target
+ self.profile = profile
+ self.reservation_affinity = reservation_affinity
+ self.resource_group = resource_group
+ self.total_volume_bandwidth = total_volume_bandwidth
+ self.user_data = user_data
+ self.volume_attachments = volume_attachments
+ self.vpc = vpc
+ self.boot_volume_attachment = boot_volume_attachment
+ self.zone = zone
+ self.network_attachments = network_attachments
+ self.primary_network_attachment = primary_network_attachment
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN':
- """Initialize a InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkAttachment':
+ """Initialize a InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkAttachment object from a json dictionary."""
args = {}
- if 'crn' in _dict:
- args['crn'] = _dict.get('crn')
+ if (availability_policy := _dict.get('availability_policy')) is not None:
+ args['availability_policy'] = InstanceAvailabilityPolicyPrototype.from_dict(availability_policy)
+ if (default_trusted_profile := _dict.get('default_trusted_profile')) is not None:
+ args['default_trusted_profile'] = InstanceDefaultTrustedProfilePrototype.from_dict(default_trusted_profile)
+ if (keys := _dict.get('keys')) is not None:
+ args['keys'] = keys
+ if (metadata_service := _dict.get('metadata_service')) is not None:
+ args['metadata_service'] = InstanceMetadataServicePrototype.from_dict(metadata_service)
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ if (placement_target := _dict.get('placement_target')) is not None:
+ args['placement_target'] = placement_target
+ if (profile := _dict.get('profile')) is not None:
+ args['profile'] = profile
+ if (reservation_affinity := _dict.get('reservation_affinity')) is not None:
+ args['reservation_affinity'] = InstanceReservationAffinityPrototype.from_dict(reservation_affinity)
+ if (resource_group := _dict.get('resource_group')) is not None:
+ args['resource_group'] = resource_group
+ if (total_volume_bandwidth := _dict.get('total_volume_bandwidth')) is not None:
+ args['total_volume_bandwidth'] = total_volume_bandwidth
+ if (user_data := _dict.get('user_data')) is not None:
+ args['user_data'] = user_data
+ if (volume_attachments := _dict.get('volume_attachments')) is not None:
+ args['volume_attachments'] = [VolumeAttachmentPrototype.from_dict(v) for v in volume_attachments]
+ if (vpc := _dict.get('vpc')) is not None:
+ args['vpc'] = vpc
+ if (boot_volume_attachment := _dict.get('boot_volume_attachment')) is not None:
+ args['boot_volume_attachment'] = VolumeAttachmentPrototypeInstanceByVolumeContext.from_dict(boot_volume_attachment)
else:
- raise ValueError('Required property \'crn\' not present in InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN JSON')
+ raise ValueError('Required property \'boot_volume_attachment\' not present in InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkAttachment JSON')
+ if (zone := _dict.get('zone')) is not None:
+ args['zone'] = zone
+ else:
+ raise ValueError('Required property \'zone\' not present in InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkAttachment JSON')
+ if (network_attachments := _dict.get('network_attachments')) is not None:
+ args['network_attachments'] = [InstanceNetworkAttachmentPrototype.from_dict(v) for v in network_attachments]
+ if (primary_network_attachment := _dict.get('primary_network_attachment')) is not None:
+ args['primary_network_attachment'] = InstanceNetworkAttachmentPrototype.from_dict(primary_network_attachment)
+ else:
+ raise ValueError('Required property \'primary_network_attachment\' not present in InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkAttachment JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN object from a json dictionary."""
+ """Initialize a InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkAttachment object from 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, 'availability_policy') and self.availability_policy is not None:
+ if isinstance(self.availability_policy, dict):
+ _dict['availability_policy'] = self.availability_policy
+ else:
+ _dict['availability_policy'] = self.availability_policy.to_dict()
+ if hasattr(self, 'default_trusted_profile') and self.default_trusted_profile is not None:
+ if isinstance(self.default_trusted_profile, dict):
+ _dict['default_trusted_profile'] = self.default_trusted_profile
+ else:
+ _dict['default_trusted_profile'] = self.default_trusted_profile.to_dict()
+ if hasattr(self, 'keys') and self.keys is not None:
+ keys_list = []
+ for v in self.keys:
+ if isinstance(v, dict):
+ keys_list.append(v)
+ else:
+ keys_list.append(v.to_dict())
+ _dict['keys'] = keys_list
+ if hasattr(self, 'metadata_service') and self.metadata_service is not None:
+ if isinstance(self.metadata_service, dict):
+ _dict['metadata_service'] = self.metadata_service
+ else:
+ _dict['metadata_service'] = self.metadata_service.to_dict()
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ if hasattr(self, 'placement_target') and self.placement_target is not None:
+ if isinstance(self.placement_target, dict):
+ _dict['placement_target'] = self.placement_target
+ else:
+ _dict['placement_target'] = self.placement_target.to_dict()
+ if hasattr(self, 'profile') and self.profile is not None:
+ if isinstance(self.profile, dict):
+ _dict['profile'] = self.profile
+ else:
+ _dict['profile'] = self.profile.to_dict()
+ if hasattr(self, 'reservation_affinity') and self.reservation_affinity is not None:
+ if isinstance(self.reservation_affinity, dict):
+ _dict['reservation_affinity'] = self.reservation_affinity
+ else:
+ _dict['reservation_affinity'] = self.reservation_affinity.to_dict()
+ if hasattr(self, 'resource_group') and self.resource_group is not None:
+ if isinstance(self.resource_group, dict):
+ _dict['resource_group'] = self.resource_group
+ else:
+ _dict['resource_group'] = self.resource_group.to_dict()
+ if hasattr(self, 'total_volume_bandwidth') and self.total_volume_bandwidth is not None:
+ _dict['total_volume_bandwidth'] = self.total_volume_bandwidth
+ if hasattr(self, 'user_data') and self.user_data is not None:
+ _dict['user_data'] = self.user_data
+ if hasattr(self, 'volume_attachments') and self.volume_attachments is not None:
+ volume_attachments_list = []
+ for v in self.volume_attachments:
+ if isinstance(v, dict):
+ volume_attachments_list.append(v)
+ else:
+ volume_attachments_list.append(v.to_dict())
+ _dict['volume_attachments'] = volume_attachments_list
+ if hasattr(self, 'vpc') and self.vpc is not None:
+ if isinstance(self.vpc, dict):
+ _dict['vpc'] = self.vpc
+ else:
+ _dict['vpc'] = self.vpc.to_dict()
+ if hasattr(self, 'boot_volume_attachment') and self.boot_volume_attachment is not None:
+ if isinstance(self.boot_volume_attachment, dict):
+ _dict['boot_volume_attachment'] = self.boot_volume_attachment
+ else:
+ _dict['boot_volume_attachment'] = self.boot_volume_attachment.to_dict()
+ if hasattr(self, 'zone') and self.zone is not None:
+ if isinstance(self.zone, dict):
+ _dict['zone'] = self.zone
+ else:
+ _dict['zone'] = self.zone.to_dict()
+ if hasattr(self, 'network_attachments') and self.network_attachments is not None:
+ network_attachments_list = []
+ for v in self.network_attachments:
+ if isinstance(v, dict):
+ network_attachments_list.append(v)
+ else:
+ network_attachments_list.append(v.to_dict())
+ _dict['network_attachments'] = network_attachments_list
+ if hasattr(self, 'primary_network_attachment') and self.primary_network_attachment is not None:
+ if isinstance(self.primary_network_attachment, dict):
+ _dict['primary_network_attachment'] = self.primary_network_attachment
+ else:
+ _dict['primary_network_attachment'] = self.primary_network_attachment.to_dict()
return _dict
def _to_dict(self):
@@ -125632,59 +142600,331 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN object."""
+ """Return a `str` version of this InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkAttachment object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN') -> bool:
+ def __eq__(self, other: 'InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkAttachment') -> bool:
"""Return `true` when 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:
+ def __ne__(self, other: 'InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkAttachment') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref(InstancePlacementTargetPatchDedicatedHostGroupIdentity):
+class InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkInterface(InstancePrototypeInstanceByVolume):
"""
- InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref.
+ InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkInterface.
- :attr str href: The URL for this dedicated host group.
+ :param InstanceAvailabilityPolicyPrototype availability_policy: (optional) The
+ availability policy to use for this virtual server instance.
+ :param InstanceDefaultTrustedProfilePrototype default_trusted_profile:
+ (optional) The default trusted profile configuration to use for this virtual
+ server instance
+ This property's value is used when provisioning the virtual server instance, but
+ not subsequently managed. Accordingly, it is reflected as an [instance
+ initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
+ property.
+ :param List[KeyIdentity] keys: (optional) The public SSH keys for the
+ administrative user of the virtual server instance. Keys will be made available
+ to the virtual server instance as cloud-init vendor data. For cloud-init enabled
+ images, these keys will also be added as SSH authorized keys for the
+ administrative user.
+ For Windows images, the keys of type `rsa` must be specified, and one will be
+ selected to encrypt [the administrator
+ password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys
+ are optional for other images, but if no keys are specified, the instance will
+ be inaccessible unless the specified image provides another means of access.
+ This property's value is used when provisioning the virtual server instance, but
+ not subsequently managed. Accordingly, it is reflected as an [instance
+ initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
+ property.
+ :param InstanceMetadataServicePrototype metadata_service: (optional)
+ :param str name: (optional) The name for this virtual server instance. The name
+ must not be used by another virtual server instance in the region. If
+ unspecified, the name will be a hyphenated list of randomly-selected words.
+ The system hostname will be based on this name.
+ :param InstancePlacementTargetPrototype placement_target: (optional) The
+ placement restrictions to use for the virtual server instance.
+ If specified, `reservation_affinity.policy` must be `disabled`.
+ :param InstanceProfileIdentity profile: (optional) The
+ [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this
+ virtual server instance.
+ If unspecified, `bx2-2x8` will be used, but this default value is expected to
+ change in the future.
+ :param InstanceReservationAffinityPrototype reservation_affinity: (optional)
+ :param ResourceGroupIdentity resource_group: (optional)
+ :param int total_volume_bandwidth: (optional) The amount of bandwidth (in
+ megabits per second) allocated exclusively to instance storage volumes. An
+ increase in this value will result in a corresponding decrease to
+ `total_network_bandwidth`.
+ :param str user_data: (optional) [User
+ data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when
+ setting up the virtual server instance.
+ :param List[VolumeAttachmentPrototype] volume_attachments: (optional) The
+ additional volume attachments to create for the virtual server instance.
+ :param VPCIdentity vpc: (optional) The VPC this virtual server instance will
+ reside in.
+ If specified, it must match the VPC for the subnets of the instance network
+ attachments or instance network interfaces.
+ :param VolumeAttachmentPrototypeInstanceByVolumeContext boot_volume_attachment:
+ The boot volume attachment for the virtual server instance.
+ :param ZoneIdentity zone: The zone this virtual server instance will reside in.
+ :param List[NetworkInterfacePrototype] network_interfaces: (optional) The
+ additional instance network interfaces to create.
+ :param NetworkInterfacePrototype primary_network_interface: The primary instance
+ network interface to create.
"""
def __init__(
self,
- href: str,
+ boot_volume_attachment: 'VolumeAttachmentPrototypeInstanceByVolumeContext',
+ zone: 'ZoneIdentity',
+ primary_network_interface: 'NetworkInterfacePrototype',
+ *,
+ availability_policy: Optional['InstanceAvailabilityPolicyPrototype'] = None,
+ default_trusted_profile: Optional['InstanceDefaultTrustedProfilePrototype'] = None,
+ keys: Optional[List['KeyIdentity']] = None,
+ metadata_service: Optional['InstanceMetadataServicePrototype'] = None,
+ name: Optional[str] = None,
+ placement_target: Optional['InstancePlacementTargetPrototype'] = None,
+ profile: Optional['InstanceProfileIdentity'] = None,
+ reservation_affinity: Optional['InstanceReservationAffinityPrototype'] = None,
+ resource_group: Optional['ResourceGroupIdentity'] = None,
+ total_volume_bandwidth: Optional[int] = None,
+ user_data: Optional[str] = None,
+ volume_attachments: Optional[List['VolumeAttachmentPrototype']] = None,
+ vpc: Optional['VPCIdentity'] = None,
+ network_interfaces: Optional[List['NetworkInterfacePrototype']] = None,
) -> None:
"""
- Initialize a InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref object.
+ Initialize a InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkInterface object.
- :param str href: The URL for this dedicated host group.
+ :param VolumeAttachmentPrototypeInstanceByVolumeContext
+ boot_volume_attachment: The boot volume attachment for the virtual server
+ instance.
+ :param ZoneIdentity zone: The zone this virtual server instance will reside
+ in.
+ :param NetworkInterfacePrototype primary_network_interface: The primary
+ instance network interface to create.
+ :param InstanceAvailabilityPolicyPrototype availability_policy: (optional)
+ The availability policy to use for this virtual server instance.
+ :param InstanceDefaultTrustedProfilePrototype default_trusted_profile:
+ (optional) The default trusted profile configuration to use for this
+ virtual server instance
+ This property's value is used when provisioning the virtual server
+ instance, but not subsequently managed. Accordingly, it is reflected as an
+ [instance
+ initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
+ property.
+ :param List[KeyIdentity] keys: (optional) The public SSH keys for the
+ administrative user of the virtual server instance. Keys will be made
+ available to the virtual server instance as cloud-init vendor data. For
+ cloud-init enabled images, these keys will also be added as SSH authorized
+ keys for the administrative user.
+ For Windows images, the keys of type `rsa` must be specified, and one will
+ be selected to encrypt [the administrator
+ password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization).
+ Keys are optional for other images, but if no keys are specified, the
+ instance will be inaccessible unless the specified image provides another
+ means of access.
+ This property's value is used when provisioning the virtual server
+ instance, but not subsequently managed. Accordingly, it is reflected as an
+ [instance
+ initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
+ property.
+ :param InstanceMetadataServicePrototype metadata_service: (optional)
+ :param str name: (optional) The name for this virtual server instance. The
+ name must not be used by another virtual server instance in the region. If
+ unspecified, the name will be a hyphenated list of randomly-selected words.
+ The system hostname will be based on this name.
+ :param InstancePlacementTargetPrototype placement_target: (optional) The
+ placement restrictions to use for the virtual server instance.
+ If specified, `reservation_affinity.policy` must be `disabled`.
+ :param InstanceProfileIdentity profile: (optional) The
+ [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for
+ this virtual server instance.
+ If unspecified, `bx2-2x8` will be used, but this default value is expected
+ to change in the future.
+ :param InstanceReservationAffinityPrototype reservation_affinity:
+ (optional)
+ :param ResourceGroupIdentity resource_group: (optional)
+ :param int total_volume_bandwidth: (optional) The amount of bandwidth (in
+ megabits per second) allocated exclusively to instance storage volumes. An
+ increase in this value will result in a corresponding decrease to
+ `total_network_bandwidth`.
+ :param str user_data: (optional) [User
+ data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available
+ when setting up the virtual server instance.
+ :param List[VolumeAttachmentPrototype] volume_attachments: (optional) The
+ additional volume attachments to create for the virtual server instance.
+ :param VPCIdentity vpc: (optional) The VPC this virtual server instance
+ will reside in.
+ If specified, it must match the VPC for the subnets of the instance network
+ attachments or instance network interfaces.
+ :param List[NetworkInterfacePrototype] network_interfaces: (optional) The
+ additional instance network interfaces to create.
"""
# pylint: disable=super-init-not-called
- self.href = href
+ self.availability_policy = availability_policy
+ self.default_trusted_profile = default_trusted_profile
+ self.keys = keys
+ self.metadata_service = metadata_service
+ self.name = name
+ self.placement_target = placement_target
+ self.profile = profile
+ self.reservation_affinity = reservation_affinity
+ self.resource_group = resource_group
+ self.total_volume_bandwidth = total_volume_bandwidth
+ self.user_data = user_data
+ self.volume_attachments = volume_attachments
+ self.vpc = vpc
+ self.boot_volume_attachment = boot_volume_attachment
+ self.zone = zone
+ self.network_interfaces = network_interfaces
+ self.primary_network_interface = primary_network_interface
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref':
- """Initialize a InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkInterface':
+ """Initialize a InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkInterface object from a json dictionary."""
args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ if (availability_policy := _dict.get('availability_policy')) is not None:
+ args['availability_policy'] = InstanceAvailabilityPolicyPrototype.from_dict(availability_policy)
+ if (default_trusted_profile := _dict.get('default_trusted_profile')) is not None:
+ args['default_trusted_profile'] = InstanceDefaultTrustedProfilePrototype.from_dict(default_trusted_profile)
+ if (keys := _dict.get('keys')) is not None:
+ args['keys'] = keys
+ if (metadata_service := _dict.get('metadata_service')) is not None:
+ args['metadata_service'] = InstanceMetadataServicePrototype.from_dict(metadata_service)
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ if (placement_target := _dict.get('placement_target')) is not None:
+ args['placement_target'] = placement_target
+ if (profile := _dict.get('profile')) is not None:
+ args['profile'] = profile
+ if (reservation_affinity := _dict.get('reservation_affinity')) is not None:
+ args['reservation_affinity'] = InstanceReservationAffinityPrototype.from_dict(reservation_affinity)
+ if (resource_group := _dict.get('resource_group')) is not None:
+ args['resource_group'] = resource_group
+ if (total_volume_bandwidth := _dict.get('total_volume_bandwidth')) is not None:
+ args['total_volume_bandwidth'] = total_volume_bandwidth
+ if (user_data := _dict.get('user_data')) is not None:
+ args['user_data'] = user_data
+ if (volume_attachments := _dict.get('volume_attachments')) is not None:
+ args['volume_attachments'] = [VolumeAttachmentPrototype.from_dict(v) for v in volume_attachments]
+ if (vpc := _dict.get('vpc')) is not None:
+ args['vpc'] = vpc
+ if (boot_volume_attachment := _dict.get('boot_volume_attachment')) is not None:
+ args['boot_volume_attachment'] = VolumeAttachmentPrototypeInstanceByVolumeContext.from_dict(boot_volume_attachment)
else:
- raise ValueError('Required property \'href\' not present in InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref JSON')
+ raise ValueError('Required property \'boot_volume_attachment\' not present in InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkInterface JSON')
+ if (zone := _dict.get('zone')) is not None:
+ args['zone'] = zone
+ else:
+ raise ValueError('Required property \'zone\' not present in InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkInterface JSON')
+ if (network_interfaces := _dict.get('network_interfaces')) is not None:
+ args['network_interfaces'] = [NetworkInterfacePrototype.from_dict(v) for v in network_interfaces]
+ if (primary_network_interface := _dict.get('primary_network_interface')) is not None:
+ args['primary_network_interface'] = NetworkInterfacePrototype.from_dict(primary_network_interface)
+ else:
+ raise ValueError('Required property \'primary_network_interface\' not present in InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkInterface JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref object from a json dictionary."""
+ """Initialize a InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkInterface object from 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, 'availability_policy') and self.availability_policy is not None:
+ if isinstance(self.availability_policy, dict):
+ _dict['availability_policy'] = self.availability_policy
+ else:
+ _dict['availability_policy'] = self.availability_policy.to_dict()
+ if hasattr(self, 'default_trusted_profile') and self.default_trusted_profile is not None:
+ if isinstance(self.default_trusted_profile, dict):
+ _dict['default_trusted_profile'] = self.default_trusted_profile
+ else:
+ _dict['default_trusted_profile'] = self.default_trusted_profile.to_dict()
+ if hasattr(self, 'keys') and self.keys is not None:
+ keys_list = []
+ for v in self.keys:
+ if isinstance(v, dict):
+ keys_list.append(v)
+ else:
+ keys_list.append(v.to_dict())
+ _dict['keys'] = keys_list
+ if hasattr(self, 'metadata_service') and self.metadata_service is not None:
+ if isinstance(self.metadata_service, dict):
+ _dict['metadata_service'] = self.metadata_service
+ else:
+ _dict['metadata_service'] = self.metadata_service.to_dict()
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ if hasattr(self, 'placement_target') and self.placement_target is not None:
+ if isinstance(self.placement_target, dict):
+ _dict['placement_target'] = self.placement_target
+ else:
+ _dict['placement_target'] = self.placement_target.to_dict()
+ if hasattr(self, 'profile') and self.profile is not None:
+ if isinstance(self.profile, dict):
+ _dict['profile'] = self.profile
+ else:
+ _dict['profile'] = self.profile.to_dict()
+ if hasattr(self, 'reservation_affinity') and self.reservation_affinity is not None:
+ if isinstance(self.reservation_affinity, dict):
+ _dict['reservation_affinity'] = self.reservation_affinity
+ else:
+ _dict['reservation_affinity'] = self.reservation_affinity.to_dict()
+ if hasattr(self, 'resource_group') and self.resource_group is not None:
+ if isinstance(self.resource_group, dict):
+ _dict['resource_group'] = self.resource_group
+ else:
+ _dict['resource_group'] = self.resource_group.to_dict()
+ if hasattr(self, 'total_volume_bandwidth') and self.total_volume_bandwidth is not None:
+ _dict['total_volume_bandwidth'] = self.total_volume_bandwidth
+ if hasattr(self, 'user_data') and self.user_data is not None:
+ _dict['user_data'] = self.user_data
+ if hasattr(self, 'volume_attachments') and self.volume_attachments is not None:
+ volume_attachments_list = []
+ for v in self.volume_attachments:
+ if isinstance(v, dict):
+ volume_attachments_list.append(v)
+ else:
+ volume_attachments_list.append(v.to_dict())
+ _dict['volume_attachments'] = volume_attachments_list
+ if hasattr(self, 'vpc') and self.vpc is not None:
+ if isinstance(self.vpc, dict):
+ _dict['vpc'] = self.vpc
+ else:
+ _dict['vpc'] = self.vpc.to_dict()
+ if hasattr(self, 'boot_volume_attachment') and self.boot_volume_attachment is not None:
+ if isinstance(self.boot_volume_attachment, dict):
+ _dict['boot_volume_attachment'] = self.boot_volume_attachment
+ else:
+ _dict['boot_volume_attachment'] = self.boot_volume_attachment.to_dict()
+ if hasattr(self, 'zone') and self.zone is not None:
+ if isinstance(self.zone, dict):
+ _dict['zone'] = self.zone
+ else:
+ _dict['zone'] = self.zone.to_dict()
+ if hasattr(self, 'network_interfaces') and self.network_interfaces is not None:
+ network_interfaces_list = []
+ for v in self.network_interfaces:
+ if isinstance(v, dict):
+ network_interfaces_list.append(v)
+ else:
+ network_interfaces_list.append(v.to_dict())
+ _dict['network_interfaces'] = network_interfaces_list
+ if hasattr(self, 'primary_network_interface') and self.primary_network_interface is not None:
+ if isinstance(self.primary_network_interface, dict):
+ _dict['primary_network_interface'] = self.primary_network_interface
+ else:
+ _dict['primary_network_interface'] = self.primary_network_interface.to_dict()
return _dict
def _to_dict(self):
@@ -125692,59 +142932,341 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref object."""
+ """Return a `str` version of this InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkInterface object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref') -> bool:
+ def __eq__(self, other: 'InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkInterface') -> bool:
"""Return `true` when 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:
+ def __ne__(self, other: 'InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkInterface') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityById(InstancePlacementTargetPatchDedicatedHostGroupIdentity):
+class InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkAttachment(InstanceTemplatePrototypeInstanceTemplateByCatalogOffering):
"""
- InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityById.
+ InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkAttachment.
- :attr str id: The unique identifier for this dedicated host group.
+ :param InstanceAvailabilityPolicyPrototype availability_policy: (optional) The
+ availability policy to use for this virtual server instance.
+ :param InstanceDefaultTrustedProfilePrototype default_trusted_profile:
+ (optional) The default trusted profile configuration to use for this virtual
+ server instance
+ This property's value is used when provisioning the virtual server instance, but
+ not subsequently managed. Accordingly, it is reflected as an [instance
+ initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
+ property.
+ :param List[KeyIdentity] keys: (optional) The public SSH keys for the
+ administrative user of the virtual server instance. Keys will be made available
+ to the virtual server instance as cloud-init vendor data. For cloud-init enabled
+ images, these keys will also be added as SSH authorized keys for the
+ administrative user.
+ For Windows images, the keys of type `rsa` must be specified, and one will be
+ selected to encrypt [the administrator
+ password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys
+ are optional for other images, but if no keys are specified, the instance will
+ be inaccessible unless the specified image provides another means of access.
+ This property's value is used when provisioning the virtual server instance, but
+ not subsequently managed. Accordingly, it is reflected as an [instance
+ initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
+ property.
+ :param InstanceMetadataServicePrototype metadata_service: (optional)
+ :param str name: (optional) The name for this instance template. The name must
+ not be used by another instance template in the region. If unspecified, the name
+ will be a hyphenated list of randomly-selected words.
+ :param InstancePlacementTargetPrototype placement_target: (optional) The
+ placement restrictions to use for the virtual server instance.
+ If specified, `reservation_affinity.policy` must be `disabled`.
+ :param InstanceProfileIdentity profile: (optional) The
+ [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this
+ virtual server instance.
+ If unspecified, `bx2-2x8` will be used, but this default value is expected to
+ change in the future.
+ :param InstanceReservationAffinityPrototype reservation_affinity: (optional)
+ :param ResourceGroupIdentity resource_group: (optional)
+ :param int total_volume_bandwidth: (optional) The amount of bandwidth (in
+ megabits per second) allocated exclusively to instance storage volumes. An
+ increase in this value will result in a corresponding decrease to
+ `total_network_bandwidth`.
+ :param str user_data: (optional) [User
+ data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when
+ setting up the virtual server instance.
+ :param List[VolumeAttachmentPrototype] volume_attachments: (optional) The
+ additional volume attachments to create for the virtual server instance.
+ :param VPCIdentity vpc: (optional) The VPC this virtual server instance will
+ reside in.
+ If specified, it must match the VPC for the subnets of the instance network
+ attachments or instance network interfaces.
+ :param VolumeAttachmentPrototypeInstanceByImageContext boot_volume_attachment:
+ (optional) The boot volume attachment to create for the virtual server instance.
+ :param InstanceCatalogOfferingPrototype catalog_offering:
+ :param ZoneIdentity zone: The zone this virtual server instance will reside in.
+ :param List[InstanceNetworkAttachmentPrototype] network_attachments: (optional)
+ The additional network attachments to create for the virtual server instance.
+ :param InstanceNetworkAttachmentPrototype primary_network_attachment: The
+ primary network attachment to create for the virtual server instance.
"""
def __init__(
self,
- id: str,
- ) -> None:
- """
- Initialize a InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityById object.
-
- :param str id: The unique identifier for this dedicated host group.
+ catalog_offering: 'InstanceCatalogOfferingPrototype',
+ zone: 'ZoneIdentity',
+ primary_network_attachment: 'InstanceNetworkAttachmentPrototype',
+ *,
+ availability_policy: Optional['InstanceAvailabilityPolicyPrototype'] = None,
+ default_trusted_profile: Optional['InstanceDefaultTrustedProfilePrototype'] = None,
+ keys: Optional[List['KeyIdentity']] = None,
+ metadata_service: Optional['InstanceMetadataServicePrototype'] = None,
+ name: Optional[str] = None,
+ placement_target: Optional['InstancePlacementTargetPrototype'] = None,
+ profile: Optional['InstanceProfileIdentity'] = None,
+ reservation_affinity: Optional['InstanceReservationAffinityPrototype'] = None,
+ resource_group: Optional['ResourceGroupIdentity'] = None,
+ total_volume_bandwidth: Optional[int] = None,
+ user_data: Optional[str] = None,
+ volume_attachments: Optional[List['VolumeAttachmentPrototype']] = None,
+ vpc: Optional['VPCIdentity'] = None,
+ boot_volume_attachment: Optional['VolumeAttachmentPrototypeInstanceByImageContext'] = None,
+ network_attachments: Optional[List['InstanceNetworkAttachmentPrototype']] = None,
+ ) -> None:
+ """
+ Initialize a InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkAttachment object.
+
+ :param InstanceCatalogOfferingPrototype catalog_offering:
+ :param ZoneIdentity zone: The zone this virtual server instance will reside
+ in.
+ :param InstanceNetworkAttachmentPrototype primary_network_attachment: The
+ primary network attachment to create for the virtual server instance.
+ :param InstanceAvailabilityPolicyPrototype availability_policy: (optional)
+ The availability policy to use for this virtual server instance.
+ :param InstanceDefaultTrustedProfilePrototype default_trusted_profile:
+ (optional) The default trusted profile configuration to use for this
+ virtual server instance
+ This property's value is used when provisioning the virtual server
+ instance, but not subsequently managed. Accordingly, it is reflected as an
+ [instance
+ initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
+ property.
+ :param List[KeyIdentity] keys: (optional) The public SSH keys for the
+ administrative user of the virtual server instance. Keys will be made
+ available to the virtual server instance as cloud-init vendor data. For
+ cloud-init enabled images, these keys will also be added as SSH authorized
+ keys for the administrative user.
+ For Windows images, the keys of type `rsa` must be specified, and one will
+ be selected to encrypt [the administrator
+ password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization).
+ Keys are optional for other images, but if no keys are specified, the
+ instance will be inaccessible unless the specified image provides another
+ means of access.
+ This property's value is used when provisioning the virtual server
+ instance, but not subsequently managed. Accordingly, it is reflected as an
+ [instance
+ initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
+ property.
+ :param InstanceMetadataServicePrototype metadata_service: (optional)
+ :param str name: (optional) The name for this instance template. The name
+ must not be used by another instance template in the region. If
+ unspecified, the name will be a hyphenated list of randomly-selected words.
+ :param InstancePlacementTargetPrototype placement_target: (optional) The
+ placement restrictions to use for the virtual server instance.
+ If specified, `reservation_affinity.policy` must be `disabled`.
+ :param InstanceProfileIdentity profile: (optional) The
+ [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for
+ this virtual server instance.
+ If unspecified, `bx2-2x8` will be used, but this default value is expected
+ to change in the future.
+ :param InstanceReservationAffinityPrototype reservation_affinity:
+ (optional)
+ :param ResourceGroupIdentity resource_group: (optional)
+ :param int total_volume_bandwidth: (optional) The amount of bandwidth (in
+ megabits per second) allocated exclusively to instance storage volumes. An
+ increase in this value will result in a corresponding decrease to
+ `total_network_bandwidth`.
+ :param str user_data: (optional) [User
+ data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available
+ when setting up the virtual server instance.
+ :param List[VolumeAttachmentPrototype] volume_attachments: (optional) The
+ additional volume attachments to create for the virtual server instance.
+ :param VPCIdentity vpc: (optional) The VPC this virtual server instance
+ will reside in.
+ If specified, it must match the VPC for the subnets of the instance network
+ attachments or instance network interfaces.
+ :param VolumeAttachmentPrototypeInstanceByImageContext
+ boot_volume_attachment: (optional) The boot volume attachment to create for
+ the virtual server instance.
+ :param List[InstanceNetworkAttachmentPrototype] network_attachments:
+ (optional) The additional network attachments to create for the virtual
+ server instance.
"""
# pylint: disable=super-init-not-called
- self.id = id
+ self.availability_policy = availability_policy
+ self.default_trusted_profile = default_trusted_profile
+ self.keys = keys
+ self.metadata_service = metadata_service
+ self.name = name
+ self.placement_target = placement_target
+ self.profile = profile
+ self.reservation_affinity = reservation_affinity
+ self.resource_group = resource_group
+ self.total_volume_bandwidth = total_volume_bandwidth
+ self.user_data = user_data
+ self.volume_attachments = volume_attachments
+ self.vpc = vpc
+ self.boot_volume_attachment = boot_volume_attachment
+ self.catalog_offering = catalog_offering
+ self.zone = zone
+ self.network_attachments = network_attachments
+ self.primary_network_attachment = primary_network_attachment
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityById':
- """Initialize a InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityById object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkAttachment':
+ """Initialize a InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkAttachment object from a json dictionary."""
args = {}
- if 'id' in _dict:
- args['id'] = _dict.get('id')
+ if (availability_policy := _dict.get('availability_policy')) is not None:
+ args['availability_policy'] = InstanceAvailabilityPolicyPrototype.from_dict(availability_policy)
+ if (default_trusted_profile := _dict.get('default_trusted_profile')) is not None:
+ args['default_trusted_profile'] = InstanceDefaultTrustedProfilePrototype.from_dict(default_trusted_profile)
+ if (keys := _dict.get('keys')) is not None:
+ args['keys'] = keys
+ if (metadata_service := _dict.get('metadata_service')) is not None:
+ args['metadata_service'] = InstanceMetadataServicePrototype.from_dict(metadata_service)
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ if (placement_target := _dict.get('placement_target')) is not None:
+ args['placement_target'] = placement_target
+ if (profile := _dict.get('profile')) is not None:
+ args['profile'] = profile
+ if (reservation_affinity := _dict.get('reservation_affinity')) is not None:
+ args['reservation_affinity'] = InstanceReservationAffinityPrototype.from_dict(reservation_affinity)
+ if (resource_group := _dict.get('resource_group')) is not None:
+ args['resource_group'] = resource_group
+ if (total_volume_bandwidth := _dict.get('total_volume_bandwidth')) is not None:
+ args['total_volume_bandwidth'] = total_volume_bandwidth
+ if (user_data := _dict.get('user_data')) is not None:
+ args['user_data'] = user_data
+ if (volume_attachments := _dict.get('volume_attachments')) is not None:
+ args['volume_attachments'] = [VolumeAttachmentPrototype.from_dict(v) for v in volume_attachments]
+ if (vpc := _dict.get('vpc')) is not None:
+ args['vpc'] = vpc
+ if (boot_volume_attachment := _dict.get('boot_volume_attachment')) is not None:
+ args['boot_volume_attachment'] = VolumeAttachmentPrototypeInstanceByImageContext.from_dict(boot_volume_attachment)
+ if (catalog_offering := _dict.get('catalog_offering')) is not None:
+ args['catalog_offering'] = catalog_offering
else:
- raise ValueError('Required property \'id\' not present in InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityById JSON')
+ raise ValueError('Required property \'catalog_offering\' not present in InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkAttachment JSON')
+ if (zone := _dict.get('zone')) is not None:
+ args['zone'] = zone
+ else:
+ raise ValueError('Required property \'zone\' not present in InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkAttachment JSON')
+ if (network_attachments := _dict.get('network_attachments')) is not None:
+ args['network_attachments'] = [InstanceNetworkAttachmentPrototype.from_dict(v) for v in network_attachments]
+ if (primary_network_attachment := _dict.get('primary_network_attachment')) is not None:
+ args['primary_network_attachment'] = InstanceNetworkAttachmentPrototype.from_dict(primary_network_attachment)
+ else:
+ raise ValueError('Required property \'primary_network_attachment\' not present in InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkAttachment JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityById object from a json dictionary."""
+ """Initialize a InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkAttachment object from 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, 'availability_policy') and self.availability_policy is not None:
+ if isinstance(self.availability_policy, dict):
+ _dict['availability_policy'] = self.availability_policy
+ else:
+ _dict['availability_policy'] = self.availability_policy.to_dict()
+ if hasattr(self, 'default_trusted_profile') and self.default_trusted_profile is not None:
+ if isinstance(self.default_trusted_profile, dict):
+ _dict['default_trusted_profile'] = self.default_trusted_profile
+ else:
+ _dict['default_trusted_profile'] = self.default_trusted_profile.to_dict()
+ if hasattr(self, 'keys') and self.keys is not None:
+ keys_list = []
+ for v in self.keys:
+ if isinstance(v, dict):
+ keys_list.append(v)
+ else:
+ keys_list.append(v.to_dict())
+ _dict['keys'] = keys_list
+ if hasattr(self, 'metadata_service') and self.metadata_service is not None:
+ if isinstance(self.metadata_service, dict):
+ _dict['metadata_service'] = self.metadata_service
+ else:
+ _dict['metadata_service'] = self.metadata_service.to_dict()
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ if hasattr(self, 'placement_target') and self.placement_target is not None:
+ if isinstance(self.placement_target, dict):
+ _dict['placement_target'] = self.placement_target
+ else:
+ _dict['placement_target'] = self.placement_target.to_dict()
+ if hasattr(self, 'profile') and self.profile is not None:
+ if isinstance(self.profile, dict):
+ _dict['profile'] = self.profile
+ else:
+ _dict['profile'] = self.profile.to_dict()
+ if hasattr(self, 'reservation_affinity') and self.reservation_affinity is not None:
+ if isinstance(self.reservation_affinity, dict):
+ _dict['reservation_affinity'] = self.reservation_affinity
+ else:
+ _dict['reservation_affinity'] = self.reservation_affinity.to_dict()
+ if hasattr(self, 'resource_group') and self.resource_group is not None:
+ if isinstance(self.resource_group, dict):
+ _dict['resource_group'] = self.resource_group
+ else:
+ _dict['resource_group'] = self.resource_group.to_dict()
+ if hasattr(self, 'total_volume_bandwidth') and self.total_volume_bandwidth is not None:
+ _dict['total_volume_bandwidth'] = self.total_volume_bandwidth
+ if hasattr(self, 'user_data') and self.user_data is not None:
+ _dict['user_data'] = self.user_data
+ if hasattr(self, 'volume_attachments') and self.volume_attachments is not None:
+ volume_attachments_list = []
+ for v in self.volume_attachments:
+ if isinstance(v, dict):
+ volume_attachments_list.append(v)
+ else:
+ volume_attachments_list.append(v.to_dict())
+ _dict['volume_attachments'] = volume_attachments_list
+ if hasattr(self, 'vpc') and self.vpc is not None:
+ if isinstance(self.vpc, dict):
+ _dict['vpc'] = self.vpc
+ else:
+ _dict['vpc'] = self.vpc.to_dict()
+ if hasattr(self, 'boot_volume_attachment') and self.boot_volume_attachment is not None:
+ if isinstance(self.boot_volume_attachment, dict):
+ _dict['boot_volume_attachment'] = self.boot_volume_attachment
+ else:
+ _dict['boot_volume_attachment'] = self.boot_volume_attachment.to_dict()
+ if hasattr(self, 'catalog_offering') and self.catalog_offering is not None:
+ if isinstance(self.catalog_offering, dict):
+ _dict['catalog_offering'] = self.catalog_offering
+ else:
+ _dict['catalog_offering'] = self.catalog_offering.to_dict()
+ if hasattr(self, 'zone') and self.zone is not None:
+ if isinstance(self.zone, dict):
+ _dict['zone'] = self.zone
+ else:
+ _dict['zone'] = self.zone.to_dict()
+ if hasattr(self, 'network_attachments') and self.network_attachments is not None:
+ network_attachments_list = []
+ for v in self.network_attachments:
+ if isinstance(v, dict):
+ network_attachments_list.append(v)
+ else:
+ network_attachments_list.append(v.to_dict())
+ _dict['network_attachments'] = network_attachments_list
+ if hasattr(self, 'primary_network_attachment') and self.primary_network_attachment is not None:
+ if isinstance(self.primary_network_attachment, dict):
+ _dict['primary_network_attachment'] = self.primary_network_attachment
+ else:
+ _dict['primary_network_attachment'] = self.primary_network_attachment.to_dict()
return _dict
def _to_dict(self):
@@ -125752,59 +143274,340 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityById object."""
+ """Return a `str` version of this InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkAttachment object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityById') -> bool:
+ def __eq__(self, other: 'InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkAttachment') -> bool:
"""Return `true` when 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:
+ def __ne__(self, other: 'InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkAttachment') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByCRN(InstancePlacementTargetPatchDedicatedHostIdentity):
+class InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkInterface(InstanceTemplatePrototypeInstanceTemplateByCatalogOffering):
"""
- InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByCRN.
+ InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkInterface.
- :attr str crn: The CRN for this dedicated host.
+ :param InstanceAvailabilityPolicyPrototype availability_policy: (optional) The
+ availability policy to use for this virtual server instance.
+ :param InstanceDefaultTrustedProfilePrototype default_trusted_profile:
+ (optional) The default trusted profile configuration to use for this virtual
+ server instance
+ This property's value is used when provisioning the virtual server instance, but
+ not subsequently managed. Accordingly, it is reflected as an [instance
+ initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
+ property.
+ :param List[KeyIdentity] keys: (optional) The public SSH keys for the
+ administrative user of the virtual server instance. Keys will be made available
+ to the virtual server instance as cloud-init vendor data. For cloud-init enabled
+ images, these keys will also be added as SSH authorized keys for the
+ administrative user.
+ For Windows images, the keys of type `rsa` must be specified, and one will be
+ selected to encrypt [the administrator
+ password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys
+ are optional for other images, but if no keys are specified, the instance will
+ be inaccessible unless the specified image provides another means of access.
+ This property's value is used when provisioning the virtual server instance, but
+ not subsequently managed. Accordingly, it is reflected as an [instance
+ initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
+ property.
+ :param InstanceMetadataServicePrototype metadata_service: (optional)
+ :param str name: (optional) The name for this instance template. The name must
+ not be used by another instance template in the region. If unspecified, the name
+ will be a hyphenated list of randomly-selected words.
+ :param InstancePlacementTargetPrototype placement_target: (optional) The
+ placement restrictions to use for the virtual server instance.
+ If specified, `reservation_affinity.policy` must be `disabled`.
+ :param InstanceProfileIdentity profile: (optional) The
+ [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this
+ virtual server instance.
+ If unspecified, `bx2-2x8` will be used, but this default value is expected to
+ change in the future.
+ :param InstanceReservationAffinityPrototype reservation_affinity: (optional)
+ :param ResourceGroupIdentity resource_group: (optional)
+ :param int total_volume_bandwidth: (optional) The amount of bandwidth (in
+ megabits per second) allocated exclusively to instance storage volumes. An
+ increase in this value will result in a corresponding decrease to
+ `total_network_bandwidth`.
+ :param str user_data: (optional) [User
+ data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when
+ setting up the virtual server instance.
+ :param List[VolumeAttachmentPrototype] volume_attachments: (optional) The
+ additional volume attachments to create for the virtual server instance.
+ :param VPCIdentity vpc: (optional) The VPC this virtual server instance will
+ reside in.
+ If specified, it must match the VPC for the subnets of the instance network
+ attachments or instance network interfaces.
+ :param VolumeAttachmentPrototypeInstanceByImageContext boot_volume_attachment:
+ (optional) The boot volume attachment to create for the virtual server instance.
+ :param InstanceCatalogOfferingPrototype catalog_offering:
+ :param ZoneIdentity zone: The zone this virtual server instance will reside in.
+ :param List[NetworkInterfacePrototype] network_interfaces: (optional) The
+ additional instance network interfaces to create.
+ :param NetworkInterfacePrototype primary_network_interface: The primary instance
+ network interface to create.
"""
def __init__(
self,
- crn: str,
- ) -> None:
- """
- Initialize a InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByCRN object.
-
- :param str crn: The CRN for this dedicated host.
+ catalog_offering: 'InstanceCatalogOfferingPrototype',
+ zone: 'ZoneIdentity',
+ primary_network_interface: 'NetworkInterfacePrototype',
+ *,
+ availability_policy: Optional['InstanceAvailabilityPolicyPrototype'] = None,
+ default_trusted_profile: Optional['InstanceDefaultTrustedProfilePrototype'] = None,
+ keys: Optional[List['KeyIdentity']] = None,
+ metadata_service: Optional['InstanceMetadataServicePrototype'] = None,
+ name: Optional[str] = None,
+ placement_target: Optional['InstancePlacementTargetPrototype'] = None,
+ profile: Optional['InstanceProfileIdentity'] = None,
+ reservation_affinity: Optional['InstanceReservationAffinityPrototype'] = None,
+ resource_group: Optional['ResourceGroupIdentity'] = None,
+ total_volume_bandwidth: Optional[int] = None,
+ user_data: Optional[str] = None,
+ volume_attachments: Optional[List['VolumeAttachmentPrototype']] = None,
+ vpc: Optional['VPCIdentity'] = None,
+ boot_volume_attachment: Optional['VolumeAttachmentPrototypeInstanceByImageContext'] = None,
+ network_interfaces: Optional[List['NetworkInterfacePrototype']] = None,
+ ) -> None:
+ """
+ Initialize a InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkInterface object.
+
+ :param InstanceCatalogOfferingPrototype catalog_offering:
+ :param ZoneIdentity zone: The zone this virtual server instance will reside
+ in.
+ :param NetworkInterfacePrototype primary_network_interface: The primary
+ instance network interface to create.
+ :param InstanceAvailabilityPolicyPrototype availability_policy: (optional)
+ The availability policy to use for this virtual server instance.
+ :param InstanceDefaultTrustedProfilePrototype default_trusted_profile:
+ (optional) The default trusted profile configuration to use for this
+ virtual server instance
+ This property's value is used when provisioning the virtual server
+ instance, but not subsequently managed. Accordingly, it is reflected as an
+ [instance
+ initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
+ property.
+ :param List[KeyIdentity] keys: (optional) The public SSH keys for the
+ administrative user of the virtual server instance. Keys will be made
+ available to the virtual server instance as cloud-init vendor data. For
+ cloud-init enabled images, these keys will also be added as SSH authorized
+ keys for the administrative user.
+ For Windows images, the keys of type `rsa` must be specified, and one will
+ be selected to encrypt [the administrator
+ password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization).
+ Keys are optional for other images, but if no keys are specified, the
+ instance will be inaccessible unless the specified image provides another
+ means of access.
+ This property's value is used when provisioning the virtual server
+ instance, but not subsequently managed. Accordingly, it is reflected as an
+ [instance
+ initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
+ property.
+ :param InstanceMetadataServicePrototype metadata_service: (optional)
+ :param str name: (optional) The name for this instance template. The name
+ must not be used by another instance template in the region. If
+ unspecified, the name will be a hyphenated list of randomly-selected words.
+ :param InstancePlacementTargetPrototype placement_target: (optional) The
+ placement restrictions to use for the virtual server instance.
+ If specified, `reservation_affinity.policy` must be `disabled`.
+ :param InstanceProfileIdentity profile: (optional) The
+ [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for
+ this virtual server instance.
+ If unspecified, `bx2-2x8` will be used, but this default value is expected
+ to change in the future.
+ :param InstanceReservationAffinityPrototype reservation_affinity:
+ (optional)
+ :param ResourceGroupIdentity resource_group: (optional)
+ :param int total_volume_bandwidth: (optional) The amount of bandwidth (in
+ megabits per second) allocated exclusively to instance storage volumes. An
+ increase in this value will result in a corresponding decrease to
+ `total_network_bandwidth`.
+ :param str user_data: (optional) [User
+ data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available
+ when setting up the virtual server instance.
+ :param List[VolumeAttachmentPrototype] volume_attachments: (optional) The
+ additional volume attachments to create for the virtual server instance.
+ :param VPCIdentity vpc: (optional) The VPC this virtual server instance
+ will reside in.
+ If specified, it must match the VPC for the subnets of the instance network
+ attachments or instance network interfaces.
+ :param VolumeAttachmentPrototypeInstanceByImageContext
+ boot_volume_attachment: (optional) The boot volume attachment to create for
+ the virtual server instance.
+ :param List[NetworkInterfacePrototype] network_interfaces: (optional) The
+ additional instance network interfaces to create.
"""
# pylint: disable=super-init-not-called
- self.crn = crn
+ self.availability_policy = availability_policy
+ self.default_trusted_profile = default_trusted_profile
+ self.keys = keys
+ self.metadata_service = metadata_service
+ self.name = name
+ self.placement_target = placement_target
+ self.profile = profile
+ self.reservation_affinity = reservation_affinity
+ self.resource_group = resource_group
+ self.total_volume_bandwidth = total_volume_bandwidth
+ self.user_data = user_data
+ self.volume_attachments = volume_attachments
+ self.vpc = vpc
+ self.boot_volume_attachment = boot_volume_attachment
+ self.catalog_offering = catalog_offering
+ self.zone = zone
+ self.network_interfaces = network_interfaces
+ self.primary_network_interface = primary_network_interface
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByCRN':
- """Initialize a InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByCRN object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkInterface':
+ """Initialize a InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkInterface object from a json dictionary."""
args = {}
- if 'crn' in _dict:
- args['crn'] = _dict.get('crn')
+ if (availability_policy := _dict.get('availability_policy')) is not None:
+ args['availability_policy'] = InstanceAvailabilityPolicyPrototype.from_dict(availability_policy)
+ if (default_trusted_profile := _dict.get('default_trusted_profile')) is not None:
+ args['default_trusted_profile'] = InstanceDefaultTrustedProfilePrototype.from_dict(default_trusted_profile)
+ if (keys := _dict.get('keys')) is not None:
+ args['keys'] = keys
+ if (metadata_service := _dict.get('metadata_service')) is not None:
+ args['metadata_service'] = InstanceMetadataServicePrototype.from_dict(metadata_service)
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ if (placement_target := _dict.get('placement_target')) is not None:
+ args['placement_target'] = placement_target
+ if (profile := _dict.get('profile')) is not None:
+ args['profile'] = profile
+ if (reservation_affinity := _dict.get('reservation_affinity')) is not None:
+ args['reservation_affinity'] = InstanceReservationAffinityPrototype.from_dict(reservation_affinity)
+ if (resource_group := _dict.get('resource_group')) is not None:
+ args['resource_group'] = resource_group
+ if (total_volume_bandwidth := _dict.get('total_volume_bandwidth')) is not None:
+ args['total_volume_bandwidth'] = total_volume_bandwidth
+ if (user_data := _dict.get('user_data')) is not None:
+ args['user_data'] = user_data
+ if (volume_attachments := _dict.get('volume_attachments')) is not None:
+ args['volume_attachments'] = [VolumeAttachmentPrototype.from_dict(v) for v in volume_attachments]
+ if (vpc := _dict.get('vpc')) is not None:
+ args['vpc'] = vpc
+ if (boot_volume_attachment := _dict.get('boot_volume_attachment')) is not None:
+ args['boot_volume_attachment'] = VolumeAttachmentPrototypeInstanceByImageContext.from_dict(boot_volume_attachment)
+ if (catalog_offering := _dict.get('catalog_offering')) is not None:
+ args['catalog_offering'] = catalog_offering
else:
- raise ValueError('Required property \'crn\' not present in InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByCRN JSON')
+ raise ValueError('Required property \'catalog_offering\' not present in InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkInterface JSON')
+ if (zone := _dict.get('zone')) is not None:
+ args['zone'] = zone
+ else:
+ raise ValueError('Required property \'zone\' not present in InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkInterface JSON')
+ if (network_interfaces := _dict.get('network_interfaces')) is not None:
+ args['network_interfaces'] = [NetworkInterfacePrototype.from_dict(v) for v in network_interfaces]
+ if (primary_network_interface := _dict.get('primary_network_interface')) is not None:
+ args['primary_network_interface'] = NetworkInterfacePrototype.from_dict(primary_network_interface)
+ else:
+ raise ValueError('Required property \'primary_network_interface\' not present in InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkInterface JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByCRN object from a json dictionary."""
+ """Initialize a InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkInterface object from 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, 'availability_policy') and self.availability_policy is not None:
+ if isinstance(self.availability_policy, dict):
+ _dict['availability_policy'] = self.availability_policy
+ else:
+ _dict['availability_policy'] = self.availability_policy.to_dict()
+ if hasattr(self, 'default_trusted_profile') and self.default_trusted_profile is not None:
+ if isinstance(self.default_trusted_profile, dict):
+ _dict['default_trusted_profile'] = self.default_trusted_profile
+ else:
+ _dict['default_trusted_profile'] = self.default_trusted_profile.to_dict()
+ if hasattr(self, 'keys') and self.keys is not None:
+ keys_list = []
+ for v in self.keys:
+ if isinstance(v, dict):
+ keys_list.append(v)
+ else:
+ keys_list.append(v.to_dict())
+ _dict['keys'] = keys_list
+ if hasattr(self, 'metadata_service') and self.metadata_service is not None:
+ if isinstance(self.metadata_service, dict):
+ _dict['metadata_service'] = self.metadata_service
+ else:
+ _dict['metadata_service'] = self.metadata_service.to_dict()
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ if hasattr(self, 'placement_target') and self.placement_target is not None:
+ if isinstance(self.placement_target, dict):
+ _dict['placement_target'] = self.placement_target
+ else:
+ _dict['placement_target'] = self.placement_target.to_dict()
+ if hasattr(self, 'profile') and self.profile is not None:
+ if isinstance(self.profile, dict):
+ _dict['profile'] = self.profile
+ else:
+ _dict['profile'] = self.profile.to_dict()
+ if hasattr(self, 'reservation_affinity') and self.reservation_affinity is not None:
+ if isinstance(self.reservation_affinity, dict):
+ _dict['reservation_affinity'] = self.reservation_affinity
+ else:
+ _dict['reservation_affinity'] = self.reservation_affinity.to_dict()
+ if hasattr(self, 'resource_group') and self.resource_group is not None:
+ if isinstance(self.resource_group, dict):
+ _dict['resource_group'] = self.resource_group
+ else:
+ _dict['resource_group'] = self.resource_group.to_dict()
+ if hasattr(self, 'total_volume_bandwidth') and self.total_volume_bandwidth is not None:
+ _dict['total_volume_bandwidth'] = self.total_volume_bandwidth
+ if hasattr(self, 'user_data') and self.user_data is not None:
+ _dict['user_data'] = self.user_data
+ if hasattr(self, 'volume_attachments') and self.volume_attachments is not None:
+ volume_attachments_list = []
+ for v in self.volume_attachments:
+ if isinstance(v, dict):
+ volume_attachments_list.append(v)
+ else:
+ volume_attachments_list.append(v.to_dict())
+ _dict['volume_attachments'] = volume_attachments_list
+ if hasattr(self, 'vpc') and self.vpc is not None:
+ if isinstance(self.vpc, dict):
+ _dict['vpc'] = self.vpc
+ else:
+ _dict['vpc'] = self.vpc.to_dict()
+ if hasattr(self, 'boot_volume_attachment') and self.boot_volume_attachment is not None:
+ if isinstance(self.boot_volume_attachment, dict):
+ _dict['boot_volume_attachment'] = self.boot_volume_attachment
+ else:
+ _dict['boot_volume_attachment'] = self.boot_volume_attachment.to_dict()
+ if hasattr(self, 'catalog_offering') and self.catalog_offering is not None:
+ if isinstance(self.catalog_offering, dict):
+ _dict['catalog_offering'] = self.catalog_offering
+ else:
+ _dict['catalog_offering'] = self.catalog_offering.to_dict()
+ if hasattr(self, 'zone') and self.zone is not None:
+ if isinstance(self.zone, dict):
+ _dict['zone'] = self.zone
+ else:
+ _dict['zone'] = self.zone.to_dict()
+ if hasattr(self, 'network_interfaces') and self.network_interfaces is not None:
+ network_interfaces_list = []
+ for v in self.network_interfaces:
+ if isinstance(v, dict):
+ network_interfaces_list.append(v)
+ else:
+ network_interfaces_list.append(v.to_dict())
+ _dict['network_interfaces'] = network_interfaces_list
+ if hasattr(self, 'primary_network_interface') and self.primary_network_interface is not None:
+ if isinstance(self.primary_network_interface, dict):
+ _dict['primary_network_interface'] = self.primary_network_interface
+ else:
+ _dict['primary_network_interface'] = self.primary_network_interface.to_dict()
return _dict
def _to_dict(self):
@@ -125812,59 +143615,343 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByCRN object."""
+ """Return a `str` version of this InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkInterface object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByCRN') -> bool:
+ def __eq__(self, other: 'InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkInterface') -> bool:
"""Return `true` when 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:
+ def __ne__(self, other: 'InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkInterface') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByHref(InstancePlacementTargetPatchDedicatedHostIdentity):
+class InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachment(InstanceTemplatePrototypeInstanceTemplateByImage):
"""
- InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByHref.
+ InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachment.
- :attr str href: The URL for this dedicated host.
+ :param InstanceAvailabilityPolicyPrototype availability_policy: (optional) The
+ availability policy to use for this virtual server instance.
+ :param InstanceDefaultTrustedProfilePrototype default_trusted_profile:
+ (optional) The default trusted profile configuration to use for this virtual
+ server instance
+ This property's value is used when provisioning the virtual server instance, but
+ not subsequently managed. Accordingly, it is reflected as an [instance
+ initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
+ property.
+ :param List[KeyIdentity] keys: (optional) The public SSH keys for the
+ administrative user of the virtual server instance. Keys will be made available
+ to the virtual server instance as cloud-init vendor data. For cloud-init enabled
+ images, these keys will also be added as SSH authorized keys for the
+ administrative user.
+ For Windows images, the keys of type `rsa` must be specified, and one will be
+ selected to encrypt [the administrator
+ password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys
+ are optional for other images, but if no keys are specified, the instance will
+ be inaccessible unless the specified image provides another means of access.
+ This property's value is used when provisioning the virtual server instance, but
+ not subsequently managed. Accordingly, it is reflected as an [instance
+ initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
+ property.
+ :param InstanceMetadataServicePrototype metadata_service: (optional)
+ :param str name: (optional) The name for this instance template. The name must
+ not be used by another instance template in the region. If unspecified, the name
+ will be a hyphenated list of randomly-selected words.
+ :param InstancePlacementTargetPrototype placement_target: (optional) The
+ placement restrictions to use for the virtual server instance.
+ If specified, `reservation_affinity.policy` must be `disabled`.
+ :param InstanceProfileIdentity profile: (optional) The
+ [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this
+ virtual server instance.
+ If unspecified, `bx2-2x8` will be used, but this default value is expected to
+ change in the future.
+ :param InstanceReservationAffinityPrototype reservation_affinity: (optional)
+ :param ResourceGroupIdentity resource_group: (optional)
+ :param int total_volume_bandwidth: (optional) The amount of bandwidth (in
+ megabits per second) allocated exclusively to instance storage volumes. An
+ increase in this value will result in a corresponding decrease to
+ `total_network_bandwidth`.
+ :param str user_data: (optional) [User
+ data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when
+ setting up the virtual server instance.
+ :param List[VolumeAttachmentPrototype] volume_attachments: (optional) The
+ additional volume attachments to create for the virtual server instance.
+ :param VPCIdentity vpc: (optional) The VPC this virtual server instance will
+ reside in.
+ If specified, it must match the VPC for the subnets of the instance network
+ attachments or instance network interfaces.
+ :param VolumeAttachmentPrototypeInstanceByImageContext boot_volume_attachment:
+ (optional) The boot volume attachment to create for the virtual server instance.
+ :param ImageIdentity image: The image to use when provisioning the virtual
+ server instance.
+ :param ZoneIdentity zone: The zone this virtual server instance will reside in.
+ :param List[InstanceNetworkAttachmentPrototype] network_attachments: (optional)
+ The additional network attachments to create for the virtual server instance.
+ :param InstanceNetworkAttachmentPrototype primary_network_attachment: The
+ primary network attachment to create for the virtual server instance.
"""
def __init__(
self,
- href: str,
- ) -> None:
- """
- Initialize a InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByHref object.
+ image: 'ImageIdentity',
+ zone: 'ZoneIdentity',
+ primary_network_attachment: 'InstanceNetworkAttachmentPrototype',
+ *,
+ availability_policy: Optional['InstanceAvailabilityPolicyPrototype'] = None,
+ default_trusted_profile: Optional['InstanceDefaultTrustedProfilePrototype'] = None,
+ keys: Optional[List['KeyIdentity']] = None,
+ metadata_service: Optional['InstanceMetadataServicePrototype'] = None,
+ name: Optional[str] = None,
+ placement_target: Optional['InstancePlacementTargetPrototype'] = None,
+ profile: Optional['InstanceProfileIdentity'] = None,
+ reservation_affinity: Optional['InstanceReservationAffinityPrototype'] = None,
+ resource_group: Optional['ResourceGroupIdentity'] = None,
+ total_volume_bandwidth: Optional[int] = None,
+ user_data: Optional[str] = None,
+ volume_attachments: Optional[List['VolumeAttachmentPrototype']] = None,
+ vpc: Optional['VPCIdentity'] = None,
+ boot_volume_attachment: Optional['VolumeAttachmentPrototypeInstanceByImageContext'] = None,
+ network_attachments: Optional[List['InstanceNetworkAttachmentPrototype']] = None,
+ ) -> None:
+ """
+ Initialize a InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachment object.
- :param str href: The URL for this dedicated host.
+ :param ImageIdentity image: The image to use when provisioning the virtual
+ server instance.
+ :param ZoneIdentity zone: The zone this virtual server instance will reside
+ in.
+ :param InstanceNetworkAttachmentPrototype primary_network_attachment: The
+ primary network attachment to create for the virtual server instance.
+ :param InstanceAvailabilityPolicyPrototype availability_policy: (optional)
+ The availability policy to use for this virtual server instance.
+ :param InstanceDefaultTrustedProfilePrototype default_trusted_profile:
+ (optional) The default trusted profile configuration to use for this
+ virtual server instance
+ This property's value is used when provisioning the virtual server
+ instance, but not subsequently managed. Accordingly, it is reflected as an
+ [instance
+ initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
+ property.
+ :param List[KeyIdentity] keys: (optional) The public SSH keys for the
+ administrative user of the virtual server instance. Keys will be made
+ available to the virtual server instance as cloud-init vendor data. For
+ cloud-init enabled images, these keys will also be added as SSH authorized
+ keys for the administrative user.
+ For Windows images, the keys of type `rsa` must be specified, and one will
+ be selected to encrypt [the administrator
+ password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization).
+ Keys are optional for other images, but if no keys are specified, the
+ instance will be inaccessible unless the specified image provides another
+ means of access.
+ This property's value is used when provisioning the virtual server
+ instance, but not subsequently managed. Accordingly, it is reflected as an
+ [instance
+ initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
+ property.
+ :param InstanceMetadataServicePrototype metadata_service: (optional)
+ :param str name: (optional) The name for this instance template. The name
+ must not be used by another instance template in the region. If
+ unspecified, the name will be a hyphenated list of randomly-selected words.
+ :param InstancePlacementTargetPrototype placement_target: (optional) The
+ placement restrictions to use for the virtual server instance.
+ If specified, `reservation_affinity.policy` must be `disabled`.
+ :param InstanceProfileIdentity profile: (optional) The
+ [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for
+ this virtual server instance.
+ If unspecified, `bx2-2x8` will be used, but this default value is expected
+ to change in the future.
+ :param InstanceReservationAffinityPrototype reservation_affinity:
+ (optional)
+ :param ResourceGroupIdentity resource_group: (optional)
+ :param int total_volume_bandwidth: (optional) The amount of bandwidth (in
+ megabits per second) allocated exclusively to instance storage volumes. An
+ increase in this value will result in a corresponding decrease to
+ `total_network_bandwidth`.
+ :param str user_data: (optional) [User
+ data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available
+ when setting up the virtual server instance.
+ :param List[VolumeAttachmentPrototype] volume_attachments: (optional) The
+ additional volume attachments to create for the virtual server instance.
+ :param VPCIdentity vpc: (optional) The VPC this virtual server instance
+ will reside in.
+ If specified, it must match the VPC for the subnets of the instance network
+ attachments or instance network interfaces.
+ :param VolumeAttachmentPrototypeInstanceByImageContext
+ boot_volume_attachment: (optional) The boot volume attachment to create for
+ the virtual server instance.
+ :param List[InstanceNetworkAttachmentPrototype] network_attachments:
+ (optional) The additional network attachments to create for the virtual
+ server instance.
"""
# pylint: disable=super-init-not-called
- self.href = href
+ self.availability_policy = availability_policy
+ self.default_trusted_profile = default_trusted_profile
+ self.keys = keys
+ self.metadata_service = metadata_service
+ self.name = name
+ self.placement_target = placement_target
+ self.profile = profile
+ self.reservation_affinity = reservation_affinity
+ self.resource_group = resource_group
+ self.total_volume_bandwidth = total_volume_bandwidth
+ self.user_data = user_data
+ self.volume_attachments = volume_attachments
+ self.vpc = vpc
+ self.boot_volume_attachment = boot_volume_attachment
+ self.image = image
+ self.zone = zone
+ self.network_attachments = network_attachments
+ self.primary_network_attachment = primary_network_attachment
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByHref':
- """Initialize a InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByHref object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachment':
+ """Initialize a InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachment object from a json dictionary."""
args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ if (availability_policy := _dict.get('availability_policy')) is not None:
+ args['availability_policy'] = InstanceAvailabilityPolicyPrototype.from_dict(availability_policy)
+ if (default_trusted_profile := _dict.get('default_trusted_profile')) is not None:
+ args['default_trusted_profile'] = InstanceDefaultTrustedProfilePrototype.from_dict(default_trusted_profile)
+ if (keys := _dict.get('keys')) is not None:
+ args['keys'] = keys
+ if (metadata_service := _dict.get('metadata_service')) is not None:
+ args['metadata_service'] = InstanceMetadataServicePrototype.from_dict(metadata_service)
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ if (placement_target := _dict.get('placement_target')) is not None:
+ args['placement_target'] = placement_target
+ if (profile := _dict.get('profile')) is not None:
+ args['profile'] = profile
+ if (reservation_affinity := _dict.get('reservation_affinity')) is not None:
+ args['reservation_affinity'] = InstanceReservationAffinityPrototype.from_dict(reservation_affinity)
+ if (resource_group := _dict.get('resource_group')) is not None:
+ args['resource_group'] = resource_group
+ if (total_volume_bandwidth := _dict.get('total_volume_bandwidth')) is not None:
+ args['total_volume_bandwidth'] = total_volume_bandwidth
+ if (user_data := _dict.get('user_data')) is not None:
+ args['user_data'] = user_data
+ if (volume_attachments := _dict.get('volume_attachments')) is not None:
+ args['volume_attachments'] = [VolumeAttachmentPrototype.from_dict(v) for v in volume_attachments]
+ if (vpc := _dict.get('vpc')) is not None:
+ args['vpc'] = vpc
+ if (boot_volume_attachment := _dict.get('boot_volume_attachment')) is not None:
+ args['boot_volume_attachment'] = VolumeAttachmentPrototypeInstanceByImageContext.from_dict(boot_volume_attachment)
+ if (image := _dict.get('image')) is not None:
+ args['image'] = image
else:
- raise ValueError('Required property \'href\' not present in InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByHref JSON')
+ raise ValueError('Required property \'image\' not present in InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachment JSON')
+ if (zone := _dict.get('zone')) is not None:
+ args['zone'] = zone
+ else:
+ raise ValueError('Required property \'zone\' not present in InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachment JSON')
+ if (network_attachments := _dict.get('network_attachments')) is not None:
+ args['network_attachments'] = [InstanceNetworkAttachmentPrototype.from_dict(v) for v in network_attachments]
+ if (primary_network_attachment := _dict.get('primary_network_attachment')) is not None:
+ args['primary_network_attachment'] = InstanceNetworkAttachmentPrototype.from_dict(primary_network_attachment)
+ else:
+ raise ValueError('Required property \'primary_network_attachment\' not present in InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachment JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByHref object from a json dictionary."""
+ """Initialize a InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachment object from 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, 'availability_policy') and self.availability_policy is not None:
+ if isinstance(self.availability_policy, dict):
+ _dict['availability_policy'] = self.availability_policy
+ else:
+ _dict['availability_policy'] = self.availability_policy.to_dict()
+ if hasattr(self, 'default_trusted_profile') and self.default_trusted_profile is not None:
+ if isinstance(self.default_trusted_profile, dict):
+ _dict['default_trusted_profile'] = self.default_trusted_profile
+ else:
+ _dict['default_trusted_profile'] = self.default_trusted_profile.to_dict()
+ if hasattr(self, 'keys') and self.keys is not None:
+ keys_list = []
+ for v in self.keys:
+ if isinstance(v, dict):
+ keys_list.append(v)
+ else:
+ keys_list.append(v.to_dict())
+ _dict['keys'] = keys_list
+ if hasattr(self, 'metadata_service') and self.metadata_service is not None:
+ if isinstance(self.metadata_service, dict):
+ _dict['metadata_service'] = self.metadata_service
+ else:
+ _dict['metadata_service'] = self.metadata_service.to_dict()
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ if hasattr(self, 'placement_target') and self.placement_target is not None:
+ if isinstance(self.placement_target, dict):
+ _dict['placement_target'] = self.placement_target
+ else:
+ _dict['placement_target'] = self.placement_target.to_dict()
+ if hasattr(self, 'profile') and self.profile is not None:
+ if isinstance(self.profile, dict):
+ _dict['profile'] = self.profile
+ else:
+ _dict['profile'] = self.profile.to_dict()
+ if hasattr(self, 'reservation_affinity') and self.reservation_affinity is not None:
+ if isinstance(self.reservation_affinity, dict):
+ _dict['reservation_affinity'] = self.reservation_affinity
+ else:
+ _dict['reservation_affinity'] = self.reservation_affinity.to_dict()
+ if hasattr(self, 'resource_group') and self.resource_group is not None:
+ if isinstance(self.resource_group, dict):
+ _dict['resource_group'] = self.resource_group
+ else:
+ _dict['resource_group'] = self.resource_group.to_dict()
+ if hasattr(self, 'total_volume_bandwidth') and self.total_volume_bandwidth is not None:
+ _dict['total_volume_bandwidth'] = self.total_volume_bandwidth
+ if hasattr(self, 'user_data') and self.user_data is not None:
+ _dict['user_data'] = self.user_data
+ if hasattr(self, 'volume_attachments') and self.volume_attachments is not None:
+ volume_attachments_list = []
+ for v in self.volume_attachments:
+ if isinstance(v, dict):
+ volume_attachments_list.append(v)
+ else:
+ volume_attachments_list.append(v.to_dict())
+ _dict['volume_attachments'] = volume_attachments_list
+ if hasattr(self, 'vpc') and self.vpc is not None:
+ if isinstance(self.vpc, dict):
+ _dict['vpc'] = self.vpc
+ else:
+ _dict['vpc'] = self.vpc.to_dict()
+ if hasattr(self, 'boot_volume_attachment') and self.boot_volume_attachment is not None:
+ if isinstance(self.boot_volume_attachment, dict):
+ _dict['boot_volume_attachment'] = self.boot_volume_attachment
+ else:
+ _dict['boot_volume_attachment'] = self.boot_volume_attachment.to_dict()
+ if hasattr(self, 'image') and self.image is not None:
+ if isinstance(self.image, dict):
+ _dict['image'] = self.image
+ else:
+ _dict['image'] = self.image.to_dict()
+ if hasattr(self, 'zone') and self.zone is not None:
+ if isinstance(self.zone, dict):
+ _dict['zone'] = self.zone
+ else:
+ _dict['zone'] = self.zone.to_dict()
+ if hasattr(self, 'network_attachments') and self.network_attachments is not None:
+ network_attachments_list = []
+ for v in self.network_attachments:
+ if isinstance(v, dict):
+ network_attachments_list.append(v)
+ else:
+ network_attachments_list.append(v.to_dict())
+ _dict['network_attachments'] = network_attachments_list
+ if hasattr(self, 'primary_network_attachment') and self.primary_network_attachment is not None:
+ if isinstance(self.primary_network_attachment, dict):
+ _dict['primary_network_attachment'] = self.primary_network_attachment
+ else:
+ _dict['primary_network_attachment'] = self.primary_network_attachment.to_dict()
return _dict
def _to_dict(self):
@@ -125872,59 +143959,342 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByHref object."""
+ """Return a `str` version of this InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachment object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByHref') -> bool:
+ def __eq__(self, other: 'InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachment') -> bool:
"""Return `true` when 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:
+ def __ne__(self, other: 'InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachment') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityById(InstancePlacementTargetPatchDedicatedHostIdentity):
+class InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkInterface(InstanceTemplatePrototypeInstanceTemplateByImage):
"""
- InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityById.
+ InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkInterface.
- :attr str id: The unique identifier for this dedicated host.
+ :param InstanceAvailabilityPolicyPrototype availability_policy: (optional) The
+ availability policy to use for this virtual server instance.
+ :param InstanceDefaultTrustedProfilePrototype default_trusted_profile:
+ (optional) The default trusted profile configuration to use for this virtual
+ server instance
+ This property's value is used when provisioning the virtual server instance, but
+ not subsequently managed. Accordingly, it is reflected as an [instance
+ initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
+ property.
+ :param List[KeyIdentity] keys: (optional) The public SSH keys for the
+ administrative user of the virtual server instance. Keys will be made available
+ to the virtual server instance as cloud-init vendor data. For cloud-init enabled
+ images, these keys will also be added as SSH authorized keys for the
+ administrative user.
+ For Windows images, the keys of type `rsa` must be specified, and one will be
+ selected to encrypt [the administrator
+ password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys
+ are optional for other images, but if no keys are specified, the instance will
+ be inaccessible unless the specified image provides another means of access.
+ This property's value is used when provisioning the virtual server instance, but
+ not subsequently managed. Accordingly, it is reflected as an [instance
+ initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
+ property.
+ :param InstanceMetadataServicePrototype metadata_service: (optional)
+ :param str name: (optional) The name for this instance template. The name must
+ not be used by another instance template in the region. If unspecified, the name
+ will be a hyphenated list of randomly-selected words.
+ :param InstancePlacementTargetPrototype placement_target: (optional) The
+ placement restrictions to use for the virtual server instance.
+ If specified, `reservation_affinity.policy` must be `disabled`.
+ :param InstanceProfileIdentity profile: (optional) The
+ [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this
+ virtual server instance.
+ If unspecified, `bx2-2x8` will be used, but this default value is expected to
+ change in the future.
+ :param InstanceReservationAffinityPrototype reservation_affinity: (optional)
+ :param ResourceGroupIdentity resource_group: (optional)
+ :param int total_volume_bandwidth: (optional) The amount of bandwidth (in
+ megabits per second) allocated exclusively to instance storage volumes. An
+ increase in this value will result in a corresponding decrease to
+ `total_network_bandwidth`.
+ :param str user_data: (optional) [User
+ data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when
+ setting up the virtual server instance.
+ :param List[VolumeAttachmentPrototype] volume_attachments: (optional) The
+ additional volume attachments to create for the virtual server instance.
+ :param VPCIdentity vpc: (optional) The VPC this virtual server instance will
+ reside in.
+ If specified, it must match the VPC for the subnets of the instance network
+ attachments or instance network interfaces.
+ :param VolumeAttachmentPrototypeInstanceByImageContext boot_volume_attachment:
+ (optional) The boot volume attachment to create for the virtual server instance.
+ :param ImageIdentity image: The image to use when provisioning the virtual
+ server instance.
+ :param ZoneIdentity zone: The zone this virtual server instance will reside in.
+ :param List[NetworkInterfacePrototype] network_interfaces: (optional) The
+ additional instance network interfaces to create.
+ :param NetworkInterfacePrototype primary_network_interface: The primary instance
+ network interface to create.
"""
def __init__(
self,
- id: str,
- ) -> None:
- """
- Initialize a InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityById object.
+ image: 'ImageIdentity',
+ zone: 'ZoneIdentity',
+ primary_network_interface: 'NetworkInterfacePrototype',
+ *,
+ availability_policy: Optional['InstanceAvailabilityPolicyPrototype'] = None,
+ default_trusted_profile: Optional['InstanceDefaultTrustedProfilePrototype'] = None,
+ keys: Optional[List['KeyIdentity']] = None,
+ metadata_service: Optional['InstanceMetadataServicePrototype'] = None,
+ name: Optional[str] = None,
+ placement_target: Optional['InstancePlacementTargetPrototype'] = None,
+ profile: Optional['InstanceProfileIdentity'] = None,
+ reservation_affinity: Optional['InstanceReservationAffinityPrototype'] = None,
+ resource_group: Optional['ResourceGroupIdentity'] = None,
+ total_volume_bandwidth: Optional[int] = None,
+ user_data: Optional[str] = None,
+ volume_attachments: Optional[List['VolumeAttachmentPrototype']] = None,
+ vpc: Optional['VPCIdentity'] = None,
+ boot_volume_attachment: Optional['VolumeAttachmentPrototypeInstanceByImageContext'] = None,
+ network_interfaces: Optional[List['NetworkInterfacePrototype']] = None,
+ ) -> None:
+ """
+ Initialize a InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkInterface object.
- :param str id: The unique identifier for this dedicated host.
+ :param ImageIdentity image: The image to use when provisioning the virtual
+ server instance.
+ :param ZoneIdentity zone: The zone this virtual server instance will reside
+ in.
+ :param NetworkInterfacePrototype primary_network_interface: The primary
+ instance network interface to create.
+ :param InstanceAvailabilityPolicyPrototype availability_policy: (optional)
+ The availability policy to use for this virtual server instance.
+ :param InstanceDefaultTrustedProfilePrototype default_trusted_profile:
+ (optional) The default trusted profile configuration to use for this
+ virtual server instance
+ This property's value is used when provisioning the virtual server
+ instance, but not subsequently managed. Accordingly, it is reflected as an
+ [instance
+ initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
+ property.
+ :param List[KeyIdentity] keys: (optional) The public SSH keys for the
+ administrative user of the virtual server instance. Keys will be made
+ available to the virtual server instance as cloud-init vendor data. For
+ cloud-init enabled images, these keys will also be added as SSH authorized
+ keys for the administrative user.
+ For Windows images, the keys of type `rsa` must be specified, and one will
+ be selected to encrypt [the administrator
+ password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization).
+ Keys are optional for other images, but if no keys are specified, the
+ instance will be inaccessible unless the specified image provides another
+ means of access.
+ This property's value is used when provisioning the virtual server
+ instance, but not subsequently managed. Accordingly, it is reflected as an
+ [instance
+ initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
+ property.
+ :param InstanceMetadataServicePrototype metadata_service: (optional)
+ :param str name: (optional) The name for this instance template. The name
+ must not be used by another instance template in the region. If
+ unspecified, the name will be a hyphenated list of randomly-selected words.
+ :param InstancePlacementTargetPrototype placement_target: (optional) The
+ placement restrictions to use for the virtual server instance.
+ If specified, `reservation_affinity.policy` must be `disabled`.
+ :param InstanceProfileIdentity profile: (optional) The
+ [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for
+ this virtual server instance.
+ If unspecified, `bx2-2x8` will be used, but this default value is expected
+ to change in the future.
+ :param InstanceReservationAffinityPrototype reservation_affinity:
+ (optional)
+ :param ResourceGroupIdentity resource_group: (optional)
+ :param int total_volume_bandwidth: (optional) The amount of bandwidth (in
+ megabits per second) allocated exclusively to instance storage volumes. An
+ increase in this value will result in a corresponding decrease to
+ `total_network_bandwidth`.
+ :param str user_data: (optional) [User
+ data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available
+ when setting up the virtual server instance.
+ :param List[VolumeAttachmentPrototype] volume_attachments: (optional) The
+ additional volume attachments to create for the virtual server instance.
+ :param VPCIdentity vpc: (optional) The VPC this virtual server instance
+ will reside in.
+ If specified, it must match the VPC for the subnets of the instance network
+ attachments or instance network interfaces.
+ :param VolumeAttachmentPrototypeInstanceByImageContext
+ boot_volume_attachment: (optional) The boot volume attachment to create for
+ the virtual server instance.
+ :param List[NetworkInterfacePrototype] network_interfaces: (optional) The
+ additional instance network interfaces to create.
"""
# pylint: disable=super-init-not-called
- self.id = id
+ self.availability_policy = availability_policy
+ self.default_trusted_profile = default_trusted_profile
+ self.keys = keys
+ self.metadata_service = metadata_service
+ self.name = name
+ self.placement_target = placement_target
+ self.profile = profile
+ self.reservation_affinity = reservation_affinity
+ self.resource_group = resource_group
+ self.total_volume_bandwidth = total_volume_bandwidth
+ self.user_data = user_data
+ self.volume_attachments = volume_attachments
+ self.vpc = vpc
+ self.boot_volume_attachment = boot_volume_attachment
+ self.image = image
+ self.zone = zone
+ self.network_interfaces = network_interfaces
+ self.primary_network_interface = primary_network_interface
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityById':
- """Initialize a InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityById object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkInterface':
+ """Initialize a InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkInterface object from a json dictionary."""
args = {}
- if 'id' in _dict:
- args['id'] = _dict.get('id')
+ if (availability_policy := _dict.get('availability_policy')) is not None:
+ args['availability_policy'] = InstanceAvailabilityPolicyPrototype.from_dict(availability_policy)
+ if (default_trusted_profile := _dict.get('default_trusted_profile')) is not None:
+ args['default_trusted_profile'] = InstanceDefaultTrustedProfilePrototype.from_dict(default_trusted_profile)
+ if (keys := _dict.get('keys')) is not None:
+ args['keys'] = keys
+ if (metadata_service := _dict.get('metadata_service')) is not None:
+ args['metadata_service'] = InstanceMetadataServicePrototype.from_dict(metadata_service)
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ if (placement_target := _dict.get('placement_target')) is not None:
+ args['placement_target'] = placement_target
+ if (profile := _dict.get('profile')) is not None:
+ args['profile'] = profile
+ if (reservation_affinity := _dict.get('reservation_affinity')) is not None:
+ args['reservation_affinity'] = InstanceReservationAffinityPrototype.from_dict(reservation_affinity)
+ if (resource_group := _dict.get('resource_group')) is not None:
+ args['resource_group'] = resource_group
+ if (total_volume_bandwidth := _dict.get('total_volume_bandwidth')) is not None:
+ args['total_volume_bandwidth'] = total_volume_bandwidth
+ if (user_data := _dict.get('user_data')) is not None:
+ args['user_data'] = user_data
+ if (volume_attachments := _dict.get('volume_attachments')) is not None:
+ args['volume_attachments'] = [VolumeAttachmentPrototype.from_dict(v) for v in volume_attachments]
+ if (vpc := _dict.get('vpc')) is not None:
+ args['vpc'] = vpc
+ if (boot_volume_attachment := _dict.get('boot_volume_attachment')) is not None:
+ args['boot_volume_attachment'] = VolumeAttachmentPrototypeInstanceByImageContext.from_dict(boot_volume_attachment)
+ if (image := _dict.get('image')) is not None:
+ args['image'] = image
else:
- raise ValueError('Required property \'id\' not present in InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityById JSON')
+ raise ValueError('Required property \'image\' not present in InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkInterface JSON')
+ if (zone := _dict.get('zone')) is not None:
+ args['zone'] = zone
+ else:
+ raise ValueError('Required property \'zone\' not present in InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkInterface JSON')
+ if (network_interfaces := _dict.get('network_interfaces')) is not None:
+ args['network_interfaces'] = [NetworkInterfacePrototype.from_dict(v) for v in network_interfaces]
+ if (primary_network_interface := _dict.get('primary_network_interface')) is not None:
+ args['primary_network_interface'] = NetworkInterfacePrototype.from_dict(primary_network_interface)
+ else:
+ raise ValueError('Required property \'primary_network_interface\' not present in InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkInterface JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityById object from a json dictionary."""
+ """Initialize a InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkInterface object from 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, 'availability_policy') and self.availability_policy is not None:
+ if isinstance(self.availability_policy, dict):
+ _dict['availability_policy'] = self.availability_policy
+ else:
+ _dict['availability_policy'] = self.availability_policy.to_dict()
+ if hasattr(self, 'default_trusted_profile') and self.default_trusted_profile is not None:
+ if isinstance(self.default_trusted_profile, dict):
+ _dict['default_trusted_profile'] = self.default_trusted_profile
+ else:
+ _dict['default_trusted_profile'] = self.default_trusted_profile.to_dict()
+ if hasattr(self, 'keys') and self.keys is not None:
+ keys_list = []
+ for v in self.keys:
+ if isinstance(v, dict):
+ keys_list.append(v)
+ else:
+ keys_list.append(v.to_dict())
+ _dict['keys'] = keys_list
+ if hasattr(self, 'metadata_service') and self.metadata_service is not None:
+ if isinstance(self.metadata_service, dict):
+ _dict['metadata_service'] = self.metadata_service
+ else:
+ _dict['metadata_service'] = self.metadata_service.to_dict()
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ if hasattr(self, 'placement_target') and self.placement_target is not None:
+ if isinstance(self.placement_target, dict):
+ _dict['placement_target'] = self.placement_target
+ else:
+ _dict['placement_target'] = self.placement_target.to_dict()
+ if hasattr(self, 'profile') and self.profile is not None:
+ if isinstance(self.profile, dict):
+ _dict['profile'] = self.profile
+ else:
+ _dict['profile'] = self.profile.to_dict()
+ if hasattr(self, 'reservation_affinity') and self.reservation_affinity is not None:
+ if isinstance(self.reservation_affinity, dict):
+ _dict['reservation_affinity'] = self.reservation_affinity
+ else:
+ _dict['reservation_affinity'] = self.reservation_affinity.to_dict()
+ if hasattr(self, 'resource_group') and self.resource_group is not None:
+ if isinstance(self.resource_group, dict):
+ _dict['resource_group'] = self.resource_group
+ else:
+ _dict['resource_group'] = self.resource_group.to_dict()
+ if hasattr(self, 'total_volume_bandwidth') and self.total_volume_bandwidth is not None:
+ _dict['total_volume_bandwidth'] = self.total_volume_bandwidth
+ if hasattr(self, 'user_data') and self.user_data is not None:
+ _dict['user_data'] = self.user_data
+ if hasattr(self, 'volume_attachments') and self.volume_attachments is not None:
+ volume_attachments_list = []
+ for v in self.volume_attachments:
+ if isinstance(v, dict):
+ volume_attachments_list.append(v)
+ else:
+ volume_attachments_list.append(v.to_dict())
+ _dict['volume_attachments'] = volume_attachments_list
+ if hasattr(self, 'vpc') and self.vpc is not None:
+ if isinstance(self.vpc, dict):
+ _dict['vpc'] = self.vpc
+ else:
+ _dict['vpc'] = self.vpc.to_dict()
+ if hasattr(self, 'boot_volume_attachment') and self.boot_volume_attachment is not None:
+ if isinstance(self.boot_volume_attachment, dict):
+ _dict['boot_volume_attachment'] = self.boot_volume_attachment
+ else:
+ _dict['boot_volume_attachment'] = self.boot_volume_attachment.to_dict()
+ if hasattr(self, 'image') and self.image is not None:
+ if isinstance(self.image, dict):
+ _dict['image'] = self.image
+ else:
+ _dict['image'] = self.image.to_dict()
+ if hasattr(self, 'zone') and self.zone is not None:
+ if isinstance(self.zone, dict):
+ _dict['zone'] = self.zone
+ else:
+ _dict['zone'] = self.zone.to_dict()
+ if hasattr(self, 'network_interfaces') and self.network_interfaces is not None:
+ network_interfaces_list = []
+ for v in self.network_interfaces:
+ if isinstance(v, dict):
+ network_interfaces_list.append(v)
+ else:
+ network_interfaces_list.append(v.to_dict())
+ _dict['network_interfaces'] = network_interfaces_list
+ if hasattr(self, 'primary_network_interface') and self.primary_network_interface is not None:
+ if isinstance(self.primary_network_interface, dict):
+ _dict['primary_network_interface'] = self.primary_network_interface
+ else:
+ _dict['primary_network_interface'] = self.primary_network_interface.to_dict()
return _dict
def _to_dict(self):
@@ -125932,119 +144302,331 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityById object."""
+ """Return a `str` version of this InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkInterface object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityById') -> bool:
+ def __eq__(self, other: 'InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkInterface') -> bool:
"""Return `true` when 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:
+ def __ne__(self, other: 'InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkInterface') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN(InstancePlacementTargetPrototypeDedicatedHostGroupIdentity):
+class InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkAttachment(InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot):
"""
- InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN.
+ InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkAttachment.
- :attr str crn: The CRN for this dedicated host group.
+ :param InstanceAvailabilityPolicyPrototype availability_policy: (optional) The
+ availability policy to use for this virtual server instance.
+ :param InstanceDefaultTrustedProfilePrototype default_trusted_profile:
+ (optional) The default trusted profile configuration to use for this virtual
+ server instance
+ This property's value is used when provisioning the virtual server instance, but
+ not subsequently managed. Accordingly, it is reflected as an [instance
+ initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
+ property.
+ :param List[KeyIdentity] keys: (optional) The public SSH keys for the
+ administrative user of the virtual server instance. Keys will be made available
+ to the virtual server instance as cloud-init vendor data. For cloud-init enabled
+ images, these keys will also be added as SSH authorized keys for the
+ administrative user.
+ For Windows images, the keys of type `rsa` must be specified, and one will be
+ selected to encrypt [the administrator
+ password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys
+ are optional for other images, but if no keys are specified, the instance will
+ be inaccessible unless the specified image provides another means of access.
+ This property's value is used when provisioning the virtual server instance, but
+ not subsequently managed. Accordingly, it is reflected as an [instance
+ initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
+ property.
+ :param InstanceMetadataServicePrototype metadata_service: (optional)
+ :param str name: (optional) The name for this instance template. The name must
+ not be used by another instance template in the region. If unspecified, the name
+ will be a hyphenated list of randomly-selected words.
+ :param InstancePlacementTargetPrototype placement_target: (optional) The
+ placement restrictions to use for the virtual server instance.
+ If specified, `reservation_affinity.policy` must be `disabled`.
+ :param InstanceProfileIdentity profile: (optional) The
+ [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this
+ virtual server instance.
+ If unspecified, `bx2-2x8` will be used, but this default value is expected to
+ change in the future.
+ :param InstanceReservationAffinityPrototype reservation_affinity: (optional)
+ :param ResourceGroupIdentity resource_group: (optional)
+ :param int total_volume_bandwidth: (optional) The amount of bandwidth (in
+ megabits per second) allocated exclusively to instance storage volumes. An
+ increase in this value will result in a corresponding decrease to
+ `total_network_bandwidth`.
+ :param str user_data: (optional) [User
+ data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when
+ setting up the virtual server instance.
+ :param List[VolumeAttachmentPrototype] volume_attachments: (optional) The
+ additional volume attachments to create for the virtual server instance.
+ :param VPCIdentity vpc: (optional) The VPC this virtual server instance will
+ reside in.
+ If specified, it must match the VPC for the subnets of the instance network
+ attachments or instance network interfaces.
+ :param VolumeAttachmentPrototypeInstanceBySourceSnapshotContext
+ boot_volume_attachment: The boot volume attachment to create for the virtual
+ server instance.
+ :param ZoneIdentity zone: The zone this virtual server instance will reside in.
+ :param List[InstanceNetworkAttachmentPrototype] network_attachments: (optional)
+ The additional network attachments to create for the virtual server instance.
+ :param InstanceNetworkAttachmentPrototype primary_network_attachment: The
+ primary network attachment to create for the virtual server instance.
"""
def __init__(
self,
- crn: str,
- ) -> None:
- """
- Initialize a InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN object.
+ boot_volume_attachment: 'VolumeAttachmentPrototypeInstanceBySourceSnapshotContext',
+ zone: 'ZoneIdentity',
+ primary_network_attachment: 'InstanceNetworkAttachmentPrototype',
+ *,
+ availability_policy: Optional['InstanceAvailabilityPolicyPrototype'] = None,
+ default_trusted_profile: Optional['InstanceDefaultTrustedProfilePrototype'] = None,
+ keys: Optional[List['KeyIdentity']] = None,
+ metadata_service: Optional['InstanceMetadataServicePrototype'] = None,
+ name: Optional[str] = None,
+ placement_target: Optional['InstancePlacementTargetPrototype'] = None,
+ profile: Optional['InstanceProfileIdentity'] = None,
+ reservation_affinity: Optional['InstanceReservationAffinityPrototype'] = None,
+ resource_group: Optional['ResourceGroupIdentity'] = None,
+ total_volume_bandwidth: Optional[int] = None,
+ user_data: Optional[str] = None,
+ volume_attachments: Optional[List['VolumeAttachmentPrototype']] = None,
+ vpc: Optional['VPCIdentity'] = None,
+ network_attachments: Optional[List['InstanceNetworkAttachmentPrototype']] = None,
+ ) -> None:
+ """
+ Initialize a InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkAttachment object.
- :param str crn: The CRN for this dedicated host group.
+ :param VolumeAttachmentPrototypeInstanceBySourceSnapshotContext
+ boot_volume_attachment: The boot volume attachment to create for the
+ virtual server instance.
+ :param ZoneIdentity zone: The zone this virtual server instance will reside
+ in.
+ :param InstanceNetworkAttachmentPrototype primary_network_attachment: The
+ primary network attachment to create for the virtual server instance.
+ :param InstanceAvailabilityPolicyPrototype availability_policy: (optional)
+ The availability policy to use for this virtual server instance.
+ :param InstanceDefaultTrustedProfilePrototype default_trusted_profile:
+ (optional) The default trusted profile configuration to use for this
+ virtual server instance
+ This property's value is used when provisioning the virtual server
+ instance, but not subsequently managed. Accordingly, it is reflected as an
+ [instance
+ initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
+ property.
+ :param List[KeyIdentity] keys: (optional) The public SSH keys for the
+ administrative user of the virtual server instance. Keys will be made
+ available to the virtual server instance as cloud-init vendor data. For
+ cloud-init enabled images, these keys will also be added as SSH authorized
+ keys for the administrative user.
+ For Windows images, the keys of type `rsa` must be specified, and one will
+ be selected to encrypt [the administrator
+ password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization).
+ Keys are optional for other images, but if no keys are specified, the
+ instance will be inaccessible unless the specified image provides another
+ means of access.
+ This property's value is used when provisioning the virtual server
+ instance, but not subsequently managed. Accordingly, it is reflected as an
+ [instance
+ initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
+ property.
+ :param InstanceMetadataServicePrototype metadata_service: (optional)
+ :param str name: (optional) The name for this instance template. The name
+ must not be used by another instance template in the region. If
+ unspecified, the name will be a hyphenated list of randomly-selected words.
+ :param InstancePlacementTargetPrototype placement_target: (optional) The
+ placement restrictions to use for the virtual server instance.
+ If specified, `reservation_affinity.policy` must be `disabled`.
+ :param InstanceProfileIdentity profile: (optional) The
+ [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for
+ this virtual server instance.
+ If unspecified, `bx2-2x8` will be used, but this default value is expected
+ to change in the future.
+ :param InstanceReservationAffinityPrototype reservation_affinity:
+ (optional)
+ :param ResourceGroupIdentity resource_group: (optional)
+ :param int total_volume_bandwidth: (optional) The amount of bandwidth (in
+ megabits per second) allocated exclusively to instance storage volumes. An
+ increase in this value will result in a corresponding decrease to
+ `total_network_bandwidth`.
+ :param str user_data: (optional) [User
+ data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available
+ when setting up the virtual server instance.
+ :param List[VolumeAttachmentPrototype] volume_attachments: (optional) The
+ additional volume attachments to create for the virtual server instance.
+ :param VPCIdentity vpc: (optional) The VPC this virtual server instance
+ will reside in.
+ If specified, it must match the VPC for the subnets of the instance network
+ attachments or instance network interfaces.
+ :param List[InstanceNetworkAttachmentPrototype] network_attachments:
+ (optional) The additional network attachments to create for the virtual
+ server instance.
"""
# pylint: disable=super-init-not-called
- self.crn = crn
+ self.availability_policy = availability_policy
+ self.default_trusted_profile = default_trusted_profile
+ self.keys = keys
+ self.metadata_service = metadata_service
+ self.name = name
+ self.placement_target = placement_target
+ self.profile = profile
+ self.reservation_affinity = reservation_affinity
+ self.resource_group = resource_group
+ self.total_volume_bandwidth = total_volume_bandwidth
+ self.user_data = user_data
+ self.volume_attachments = volume_attachments
+ self.vpc = vpc
+ self.boot_volume_attachment = boot_volume_attachment
+ self.zone = zone
+ self.network_attachments = network_attachments
+ self.primary_network_attachment = primary_network_attachment
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN':
- """Initialize a InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkAttachment':
+ """Initialize a InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkAttachment object from a json dictionary."""
args = {}
- if 'crn' in _dict:
- args['crn'] = _dict.get('crn')
+ if (availability_policy := _dict.get('availability_policy')) is not None:
+ args['availability_policy'] = InstanceAvailabilityPolicyPrototype.from_dict(availability_policy)
+ if (default_trusted_profile := _dict.get('default_trusted_profile')) is not None:
+ args['default_trusted_profile'] = InstanceDefaultTrustedProfilePrototype.from_dict(default_trusted_profile)
+ if (keys := _dict.get('keys')) is not None:
+ args['keys'] = keys
+ if (metadata_service := _dict.get('metadata_service')) is not None:
+ args['metadata_service'] = InstanceMetadataServicePrototype.from_dict(metadata_service)
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ if (placement_target := _dict.get('placement_target')) is not None:
+ args['placement_target'] = placement_target
+ if (profile := _dict.get('profile')) is not None:
+ args['profile'] = profile
+ if (reservation_affinity := _dict.get('reservation_affinity')) is not None:
+ args['reservation_affinity'] = InstanceReservationAffinityPrototype.from_dict(reservation_affinity)
+ if (resource_group := _dict.get('resource_group')) is not None:
+ args['resource_group'] = resource_group
+ if (total_volume_bandwidth := _dict.get('total_volume_bandwidth')) is not None:
+ args['total_volume_bandwidth'] = total_volume_bandwidth
+ if (user_data := _dict.get('user_data')) is not None:
+ args['user_data'] = user_data
+ if (volume_attachments := _dict.get('volume_attachments')) is not None:
+ args['volume_attachments'] = [VolumeAttachmentPrototype.from_dict(v) for v in volume_attachments]
+ if (vpc := _dict.get('vpc')) is not None:
+ args['vpc'] = vpc
+ if (boot_volume_attachment := _dict.get('boot_volume_attachment')) is not None:
+ args['boot_volume_attachment'] = VolumeAttachmentPrototypeInstanceBySourceSnapshotContext.from_dict(boot_volume_attachment)
else:
- raise ValueError('Required property \'crn\' not present in InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN JSON')
- return cls(**args)
-
- @classmethod
- def _from_dict(cls, _dict):
- """Initialize a InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN object from 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 InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN object."""
- return json.dumps(self.to_dict(), indent=2)
-
- def __eq__(self, other: 'InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN') -> bool:
- """Return `true` when self and other are equal, false otherwise."""
- if not isinstance(other, self.__class__):
- return False
- return self.__dict__ == other.__dict__
-
- def __ne__(self, other: 'InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN') -> bool:
- """Return `true` when self and other are not equal, false otherwise."""
- return not self == other
-
-
-class InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref(InstancePlacementTargetPrototypeDedicatedHostGroupIdentity):
- """
- InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref.
-
- :attr str href: The URL for this dedicated host group.
- """
-
- def __init__(
- self,
- href: str,
- ) -> None:
- """
- Initialize a InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref 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) -> 'InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref':
- """Initialize a InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref object from a json dictionary."""
- args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ raise ValueError('Required property \'boot_volume_attachment\' not present in InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkAttachment JSON')
+ if (zone := _dict.get('zone')) is not None:
+ args['zone'] = zone
else:
- raise ValueError('Required property \'href\' not present in InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref JSON')
+ raise ValueError('Required property \'zone\' not present in InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkAttachment JSON')
+ if (network_attachments := _dict.get('network_attachments')) is not None:
+ args['network_attachments'] = [InstanceNetworkAttachmentPrototype.from_dict(v) for v in network_attachments]
+ if (primary_network_attachment := _dict.get('primary_network_attachment')) is not None:
+ args['primary_network_attachment'] = InstanceNetworkAttachmentPrototype.from_dict(primary_network_attachment)
+ else:
+ raise ValueError('Required property \'primary_network_attachment\' not present in InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkAttachment JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref object from a json dictionary."""
+ """Initialize a InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkAttachment object from 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, 'availability_policy') and self.availability_policy is not None:
+ if isinstance(self.availability_policy, dict):
+ _dict['availability_policy'] = self.availability_policy
+ else:
+ _dict['availability_policy'] = self.availability_policy.to_dict()
+ if hasattr(self, 'default_trusted_profile') and self.default_trusted_profile is not None:
+ if isinstance(self.default_trusted_profile, dict):
+ _dict['default_trusted_profile'] = self.default_trusted_profile
+ else:
+ _dict['default_trusted_profile'] = self.default_trusted_profile.to_dict()
+ if hasattr(self, 'keys') and self.keys is not None:
+ keys_list = []
+ for v in self.keys:
+ if isinstance(v, dict):
+ keys_list.append(v)
+ else:
+ keys_list.append(v.to_dict())
+ _dict['keys'] = keys_list
+ if hasattr(self, 'metadata_service') and self.metadata_service is not None:
+ if isinstance(self.metadata_service, dict):
+ _dict['metadata_service'] = self.metadata_service
+ else:
+ _dict['metadata_service'] = self.metadata_service.to_dict()
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ if hasattr(self, 'placement_target') and self.placement_target is not None:
+ if isinstance(self.placement_target, dict):
+ _dict['placement_target'] = self.placement_target
+ else:
+ _dict['placement_target'] = self.placement_target.to_dict()
+ if hasattr(self, 'profile') and self.profile is not None:
+ if isinstance(self.profile, dict):
+ _dict['profile'] = self.profile
+ else:
+ _dict['profile'] = self.profile.to_dict()
+ if hasattr(self, 'reservation_affinity') and self.reservation_affinity is not None:
+ if isinstance(self.reservation_affinity, dict):
+ _dict['reservation_affinity'] = self.reservation_affinity
+ else:
+ _dict['reservation_affinity'] = self.reservation_affinity.to_dict()
+ if hasattr(self, 'resource_group') and self.resource_group is not None:
+ if isinstance(self.resource_group, dict):
+ _dict['resource_group'] = self.resource_group
+ else:
+ _dict['resource_group'] = self.resource_group.to_dict()
+ if hasattr(self, 'total_volume_bandwidth') and self.total_volume_bandwidth is not None:
+ _dict['total_volume_bandwidth'] = self.total_volume_bandwidth
+ if hasattr(self, 'user_data') and self.user_data is not None:
+ _dict['user_data'] = self.user_data
+ if hasattr(self, 'volume_attachments') and self.volume_attachments is not None:
+ volume_attachments_list = []
+ for v in self.volume_attachments:
+ if isinstance(v, dict):
+ volume_attachments_list.append(v)
+ else:
+ volume_attachments_list.append(v.to_dict())
+ _dict['volume_attachments'] = volume_attachments_list
+ if hasattr(self, 'vpc') and self.vpc is not None:
+ if isinstance(self.vpc, dict):
+ _dict['vpc'] = self.vpc
+ else:
+ _dict['vpc'] = self.vpc.to_dict()
+ if hasattr(self, 'boot_volume_attachment') and self.boot_volume_attachment is not None:
+ if isinstance(self.boot_volume_attachment, dict):
+ _dict['boot_volume_attachment'] = self.boot_volume_attachment
+ else:
+ _dict['boot_volume_attachment'] = self.boot_volume_attachment.to_dict()
+ if hasattr(self, 'zone') and self.zone is not None:
+ if isinstance(self.zone, dict):
+ _dict['zone'] = self.zone
+ else:
+ _dict['zone'] = self.zone.to_dict()
+ if hasattr(self, 'network_attachments') and self.network_attachments is not None:
+ network_attachments_list = []
+ for v in self.network_attachments:
+ if isinstance(v, dict):
+ network_attachments_list.append(v)
+ else:
+ network_attachments_list.append(v.to_dict())
+ _dict['network_attachments'] = network_attachments_list
+ if hasattr(self, 'primary_network_attachment') and self.primary_network_attachment is not None:
+ if isinstance(self.primary_network_attachment, dict):
+ _dict['primary_network_attachment'] = self.primary_network_attachment
+ else:
+ _dict['primary_network_attachment'] = self.primary_network_attachment.to_dict()
return _dict
def _to_dict(self):
@@ -126052,59 +144634,330 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref object."""
+ """Return a `str` version of this InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkAttachment object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref') -> bool:
+ def __eq__(self, other: 'InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkAttachment') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref') -> bool:
+ def __ne__(self, other: 'InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkAttachment') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityById(InstancePlacementTargetPrototypeDedicatedHostGroupIdentity):
+class InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkInterface(InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot):
"""
- InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityById.
+ InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkInterface.
- :attr str id: The unique identifier for this dedicated host group.
+ :param InstanceAvailabilityPolicyPrototype availability_policy: (optional) The
+ availability policy to use for this virtual server instance.
+ :param InstanceDefaultTrustedProfilePrototype default_trusted_profile:
+ (optional) The default trusted profile configuration to use for this virtual
+ server instance
+ This property's value is used when provisioning the virtual server instance, but
+ not subsequently managed. Accordingly, it is reflected as an [instance
+ initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
+ property.
+ :param List[KeyIdentity] keys: (optional) The public SSH keys for the
+ administrative user of the virtual server instance. Keys will be made available
+ to the virtual server instance as cloud-init vendor data. For cloud-init enabled
+ images, these keys will also be added as SSH authorized keys for the
+ administrative user.
+ For Windows images, the keys of type `rsa` must be specified, and one will be
+ selected to encrypt [the administrator
+ password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys
+ are optional for other images, but if no keys are specified, the instance will
+ be inaccessible unless the specified image provides another means of access.
+ This property's value is used when provisioning the virtual server instance, but
+ not subsequently managed. Accordingly, it is reflected as an [instance
+ initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
+ property.
+ :param InstanceMetadataServicePrototype metadata_service: (optional)
+ :param str name: (optional) The name for this instance template. The name must
+ not be used by another instance template in the region. If unspecified, the name
+ will be a hyphenated list of randomly-selected words.
+ :param InstancePlacementTargetPrototype placement_target: (optional) The
+ placement restrictions to use for the virtual server instance.
+ If specified, `reservation_affinity.policy` must be `disabled`.
+ :param InstanceProfileIdentity profile: (optional) The
+ [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this
+ virtual server instance.
+ If unspecified, `bx2-2x8` will be used, but this default value is expected to
+ change in the future.
+ :param InstanceReservationAffinityPrototype reservation_affinity: (optional)
+ :param ResourceGroupIdentity resource_group: (optional)
+ :param int total_volume_bandwidth: (optional) The amount of bandwidth (in
+ megabits per second) allocated exclusively to instance storage volumes. An
+ increase in this value will result in a corresponding decrease to
+ `total_network_bandwidth`.
+ :param str user_data: (optional) [User
+ data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when
+ setting up the virtual server instance.
+ :param List[VolumeAttachmentPrototype] volume_attachments: (optional) The
+ additional volume attachments to create for the virtual server instance.
+ :param VPCIdentity vpc: (optional) The VPC this virtual server instance will
+ reside in.
+ If specified, it must match the VPC for the subnets of the instance network
+ attachments or instance network interfaces.
+ :param VolumeAttachmentPrototypeInstanceBySourceSnapshotContext
+ boot_volume_attachment: The boot volume attachment to create for the virtual
+ server instance.
+ :param ZoneIdentity zone: The zone this virtual server instance will reside in.
+ :param List[NetworkInterfacePrototype] network_interfaces: (optional) The
+ additional instance network interfaces to create.
+ :param NetworkInterfacePrototype primary_network_interface: The primary instance
+ network interface to create.
"""
def __init__(
self,
- id: str,
+ boot_volume_attachment: 'VolumeAttachmentPrototypeInstanceBySourceSnapshotContext',
+ zone: 'ZoneIdentity',
+ primary_network_interface: 'NetworkInterfacePrototype',
+ *,
+ availability_policy: Optional['InstanceAvailabilityPolicyPrototype'] = None,
+ default_trusted_profile: Optional['InstanceDefaultTrustedProfilePrototype'] = None,
+ keys: Optional[List['KeyIdentity']] = None,
+ metadata_service: Optional['InstanceMetadataServicePrototype'] = None,
+ name: Optional[str] = None,
+ placement_target: Optional['InstancePlacementTargetPrototype'] = None,
+ profile: Optional['InstanceProfileIdentity'] = None,
+ reservation_affinity: Optional['InstanceReservationAffinityPrototype'] = None,
+ resource_group: Optional['ResourceGroupIdentity'] = None,
+ total_volume_bandwidth: Optional[int] = None,
+ user_data: Optional[str] = None,
+ volume_attachments: Optional[List['VolumeAttachmentPrototype']] = None,
+ vpc: Optional['VPCIdentity'] = None,
+ network_interfaces: Optional[List['NetworkInterfacePrototype']] = None,
) -> None:
"""
- Initialize a InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityById object.
+ Initialize a InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkInterface object.
- :param str id: The unique identifier for this dedicated host group.
+ :param VolumeAttachmentPrototypeInstanceBySourceSnapshotContext
+ boot_volume_attachment: The boot volume attachment to create for the
+ virtual server instance.
+ :param ZoneIdentity zone: The zone this virtual server instance will reside
+ in.
+ :param NetworkInterfacePrototype primary_network_interface: The primary
+ instance network interface to create.
+ :param InstanceAvailabilityPolicyPrototype availability_policy: (optional)
+ The availability policy to use for this virtual server instance.
+ :param InstanceDefaultTrustedProfilePrototype default_trusted_profile:
+ (optional) The default trusted profile configuration to use for this
+ virtual server instance
+ This property's value is used when provisioning the virtual server
+ instance, but not subsequently managed. Accordingly, it is reflected as an
+ [instance
+ initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
+ property.
+ :param List[KeyIdentity] keys: (optional) The public SSH keys for the
+ administrative user of the virtual server instance. Keys will be made
+ available to the virtual server instance as cloud-init vendor data. For
+ cloud-init enabled images, these keys will also be added as SSH authorized
+ keys for the administrative user.
+ For Windows images, the keys of type `rsa` must be specified, and one will
+ be selected to encrypt [the administrator
+ password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization).
+ Keys are optional for other images, but if no keys are specified, the
+ instance will be inaccessible unless the specified image provides another
+ means of access.
+ This property's value is used when provisioning the virtual server
+ instance, but not subsequently managed. Accordingly, it is reflected as an
+ [instance
+ initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
+ property.
+ :param InstanceMetadataServicePrototype metadata_service: (optional)
+ :param str name: (optional) The name for this instance template. The name
+ must not be used by another instance template in the region. If
+ unspecified, the name will be a hyphenated list of randomly-selected words.
+ :param InstancePlacementTargetPrototype placement_target: (optional) The
+ placement restrictions to use for the virtual server instance.
+ If specified, `reservation_affinity.policy` must be `disabled`.
+ :param InstanceProfileIdentity profile: (optional) The
+ [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for
+ this virtual server instance.
+ If unspecified, `bx2-2x8` will be used, but this default value is expected
+ to change in the future.
+ :param InstanceReservationAffinityPrototype reservation_affinity:
+ (optional)
+ :param ResourceGroupIdentity resource_group: (optional)
+ :param int total_volume_bandwidth: (optional) The amount of bandwidth (in
+ megabits per second) allocated exclusively to instance storage volumes. An
+ increase in this value will result in a corresponding decrease to
+ `total_network_bandwidth`.
+ :param str user_data: (optional) [User
+ data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available
+ when setting up the virtual server instance.
+ :param List[VolumeAttachmentPrototype] volume_attachments: (optional) The
+ additional volume attachments to create for the virtual server instance.
+ :param VPCIdentity vpc: (optional) The VPC this virtual server instance
+ will reside in.
+ If specified, it must match the VPC for the subnets of the instance network
+ attachments or instance network interfaces.
+ :param List[NetworkInterfacePrototype] network_interfaces: (optional) The
+ additional instance network interfaces to create.
"""
# pylint: disable=super-init-not-called
- self.id = id
+ self.availability_policy = availability_policy
+ self.default_trusted_profile = default_trusted_profile
+ self.keys = keys
+ self.metadata_service = metadata_service
+ self.name = name
+ self.placement_target = placement_target
+ self.profile = profile
+ self.reservation_affinity = reservation_affinity
+ self.resource_group = resource_group
+ self.total_volume_bandwidth = total_volume_bandwidth
+ self.user_data = user_data
+ self.volume_attachments = volume_attachments
+ self.vpc = vpc
+ self.boot_volume_attachment = boot_volume_attachment
+ self.zone = zone
+ self.network_interfaces = network_interfaces
+ self.primary_network_interface = primary_network_interface
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityById':
- """Initialize a InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityById object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkInterface':
+ """Initialize a InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkInterface object from a json dictionary."""
args = {}
- if 'id' in _dict:
- args['id'] = _dict.get('id')
+ if (availability_policy := _dict.get('availability_policy')) is not None:
+ args['availability_policy'] = InstanceAvailabilityPolicyPrototype.from_dict(availability_policy)
+ if (default_trusted_profile := _dict.get('default_trusted_profile')) is not None:
+ args['default_trusted_profile'] = InstanceDefaultTrustedProfilePrototype.from_dict(default_trusted_profile)
+ if (keys := _dict.get('keys')) is not None:
+ args['keys'] = keys
+ if (metadata_service := _dict.get('metadata_service')) is not None:
+ args['metadata_service'] = InstanceMetadataServicePrototype.from_dict(metadata_service)
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ if (placement_target := _dict.get('placement_target')) is not None:
+ args['placement_target'] = placement_target
+ if (profile := _dict.get('profile')) is not None:
+ args['profile'] = profile
+ if (reservation_affinity := _dict.get('reservation_affinity')) is not None:
+ args['reservation_affinity'] = InstanceReservationAffinityPrototype.from_dict(reservation_affinity)
+ if (resource_group := _dict.get('resource_group')) is not None:
+ args['resource_group'] = resource_group
+ if (total_volume_bandwidth := _dict.get('total_volume_bandwidth')) is not None:
+ args['total_volume_bandwidth'] = total_volume_bandwidth
+ if (user_data := _dict.get('user_data')) is not None:
+ args['user_data'] = user_data
+ if (volume_attachments := _dict.get('volume_attachments')) is not None:
+ args['volume_attachments'] = [VolumeAttachmentPrototype.from_dict(v) for v in volume_attachments]
+ if (vpc := _dict.get('vpc')) is not None:
+ args['vpc'] = vpc
+ if (boot_volume_attachment := _dict.get('boot_volume_attachment')) is not None:
+ args['boot_volume_attachment'] = VolumeAttachmentPrototypeInstanceBySourceSnapshotContext.from_dict(boot_volume_attachment)
else:
- raise ValueError('Required property \'id\' not present in InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityById JSON')
+ raise ValueError('Required property \'boot_volume_attachment\' not present in InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkInterface JSON')
+ if (zone := _dict.get('zone')) is not None:
+ args['zone'] = zone
+ else:
+ raise ValueError('Required property \'zone\' not present in InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkInterface JSON')
+ if (network_interfaces := _dict.get('network_interfaces')) is not None:
+ args['network_interfaces'] = [NetworkInterfacePrototype.from_dict(v) for v in network_interfaces]
+ if (primary_network_interface := _dict.get('primary_network_interface')) is not None:
+ args['primary_network_interface'] = NetworkInterfacePrototype.from_dict(primary_network_interface)
+ else:
+ raise ValueError('Required property \'primary_network_interface\' not present in InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkInterface JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityById object from a json dictionary."""
+ """Initialize a InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkInterface object from 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, 'availability_policy') and self.availability_policy is not None:
+ if isinstance(self.availability_policy, dict):
+ _dict['availability_policy'] = self.availability_policy
+ else:
+ _dict['availability_policy'] = self.availability_policy.to_dict()
+ if hasattr(self, 'default_trusted_profile') and self.default_trusted_profile is not None:
+ if isinstance(self.default_trusted_profile, dict):
+ _dict['default_trusted_profile'] = self.default_trusted_profile
+ else:
+ _dict['default_trusted_profile'] = self.default_trusted_profile.to_dict()
+ if hasattr(self, 'keys') and self.keys is not None:
+ keys_list = []
+ for v in self.keys:
+ if isinstance(v, dict):
+ keys_list.append(v)
+ else:
+ keys_list.append(v.to_dict())
+ _dict['keys'] = keys_list
+ if hasattr(self, 'metadata_service') and self.metadata_service is not None:
+ if isinstance(self.metadata_service, dict):
+ _dict['metadata_service'] = self.metadata_service
+ else:
+ _dict['metadata_service'] = self.metadata_service.to_dict()
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ if hasattr(self, 'placement_target') and self.placement_target is not None:
+ if isinstance(self.placement_target, dict):
+ _dict['placement_target'] = self.placement_target
+ else:
+ _dict['placement_target'] = self.placement_target.to_dict()
+ if hasattr(self, 'profile') and self.profile is not None:
+ if isinstance(self.profile, dict):
+ _dict['profile'] = self.profile
+ else:
+ _dict['profile'] = self.profile.to_dict()
+ if hasattr(self, 'reservation_affinity') and self.reservation_affinity is not None:
+ if isinstance(self.reservation_affinity, dict):
+ _dict['reservation_affinity'] = self.reservation_affinity
+ else:
+ _dict['reservation_affinity'] = self.reservation_affinity.to_dict()
+ if hasattr(self, 'resource_group') and self.resource_group is not None:
+ if isinstance(self.resource_group, dict):
+ _dict['resource_group'] = self.resource_group
+ else:
+ _dict['resource_group'] = self.resource_group.to_dict()
+ if hasattr(self, 'total_volume_bandwidth') and self.total_volume_bandwidth is not None:
+ _dict['total_volume_bandwidth'] = self.total_volume_bandwidth
+ if hasattr(self, 'user_data') and self.user_data is not None:
+ _dict['user_data'] = self.user_data
+ if hasattr(self, 'volume_attachments') and self.volume_attachments is not None:
+ volume_attachments_list = []
+ for v in self.volume_attachments:
+ if isinstance(v, dict):
+ volume_attachments_list.append(v)
+ else:
+ volume_attachments_list.append(v.to_dict())
+ _dict['volume_attachments'] = volume_attachments_list
+ if hasattr(self, 'vpc') and self.vpc is not None:
+ if isinstance(self.vpc, dict):
+ _dict['vpc'] = self.vpc
+ else:
+ _dict['vpc'] = self.vpc.to_dict()
+ if hasattr(self, 'boot_volume_attachment') and self.boot_volume_attachment is not None:
+ if isinstance(self.boot_volume_attachment, dict):
+ _dict['boot_volume_attachment'] = self.boot_volume_attachment
+ else:
+ _dict['boot_volume_attachment'] = self.boot_volume_attachment.to_dict()
+ if hasattr(self, 'zone') and self.zone is not None:
+ if isinstance(self.zone, dict):
+ _dict['zone'] = self.zone
+ else:
+ _dict['zone'] = self.zone.to_dict()
+ if hasattr(self, 'network_interfaces') and self.network_interfaces is not None:
+ network_interfaces_list = []
+ for v in self.network_interfaces:
+ if isinstance(v, dict):
+ network_interfaces_list.append(v)
+ else:
+ network_interfaces_list.append(v.to_dict())
+ _dict['network_interfaces'] = network_interfaces_list
+ if hasattr(self, 'primary_network_interface') and self.primary_network_interface is not None:
+ if isinstance(self.primary_network_interface, dict):
+ _dict['primary_network_interface'] = self.primary_network_interface
+ else:
+ _dict['primary_network_interface'] = self.primary_network_interface.to_dict()
return _dict
def _to_dict(self):
@@ -126112,59 +144965,387 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityById object."""
+ """Return a `str` version of this InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkInterface object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityById') -> bool:
+ def __eq__(self, other: 'InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkInterface') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityById') -> bool:
+ def __ne__(self, other: 'InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkInterface') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByCRN(InstancePlacementTargetPrototypeDedicatedHostIdentity):
+class InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkAttachment(InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext):
"""
- InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByCRN.
+ InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkAttachment.
- :attr str crn: The CRN for this dedicated host.
+ :param InstanceAvailabilityPolicyPrototype availability_policy: (optional) The
+ availability policy to use for this virtual server instance.
+ :param datetime created_at: The date and time that the instance template was
+ created.
+ :param str crn: The CRN for this instance template.
+ :param InstanceDefaultTrustedProfilePrototype default_trusted_profile:
+ (optional) The default trusted profile configuration to use for this virtual
+ server instance
+ This property's value is used when provisioning the virtual server instance, but
+ not subsequently managed. Accordingly, it is reflected as an [instance
+ initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
+ property.
+ :param str href: The URL for this instance template.
+ :param str id: The unique identifier 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, the keys of type `rsa` must be specified, and one will be
+ selected to encrypt [the administrator
+ password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys
+ are optional for other images, but if no keys are specified, the instance will
+ be inaccessible unless the specified image provides another means of access.
+ This property's value is used when provisioning the virtual server instance, but
+ not subsequently managed. Accordingly, it is reflected as an [instance
+ initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
+ property.
+ :param InstanceMetadataServicePrototype metadata_service: (optional)
+ :param str name: The name for this instance template. The name is unique across
+ all instance templates in the region.
+ :param InstancePlacementTargetPrototype placement_target: (optional) The
+ placement restrictions to use for the virtual server instance.
+ If specified, `reservation_affinity.policy` must be `disabled`.
+ :param InstanceProfileIdentity profile: (optional) The
+ [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this
+ virtual server instance.
+ If unspecified, `bx2-2x8` will be used, but this default value is expected to
+ change in the future.
+ :param InstanceReservationAffinityPrototype reservation_affinity: (optional)
+ :param ResourceGroupReference resource_group: The resource group for this
+ instance template.
+ :param int total_volume_bandwidth: (optional) The amount of bandwidth (in
+ megabits per second) allocated exclusively to instance storage volumes. An
+ increase in this value will result in a corresponding decrease to
+ `total_network_bandwidth`.
+ :param str user_data: (optional) [User
+ data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when
+ setting up the virtual server instance.
+ :param List[VolumeAttachmentPrototype] volume_attachments: (optional) The
+ additional volume attachments to create for the virtual server instance.
+ :param VPCIdentity vpc: (optional) The VPC this virtual server instance will
+ reside in.
+ If specified, it must match the VPC for the subnets of the instance network
+ attachments or instance network interfaces.
+ :param VolumeAttachmentPrototypeInstanceByImageContext boot_volume_attachment:
+ (optional) The boot volume attachment to create for the virtual server instance.
+ :param InstanceCatalogOfferingPrototype catalog_offering:
+ :param ZoneIdentity zone: The zone this virtual server instance will reside in.
+ :param List[InstanceNetworkAttachmentPrototype] network_attachments: (optional)
+ The additional network attachments to create for the virtual server instance.
+ :param InstanceNetworkAttachmentPrototype primary_network_attachment: The
+ primary network attachment to create for the virtual server instance.
"""
def __init__(
self,
+ created_at: datetime,
crn: str,
+ href: str,
+ id: str,
+ name: str,
+ resource_group: 'ResourceGroupReference',
+ catalog_offering: 'InstanceCatalogOfferingPrototype',
+ zone: 'ZoneIdentity',
+ primary_network_attachment: 'InstanceNetworkAttachmentPrototype',
+ *,
+ availability_policy: Optional['InstanceAvailabilityPolicyPrototype'] = None,
+ default_trusted_profile: Optional['InstanceDefaultTrustedProfilePrototype'] = None,
+ keys: Optional[List['KeyIdentity']] = None,
+ metadata_service: Optional['InstanceMetadataServicePrototype'] = None,
+ placement_target: Optional['InstancePlacementTargetPrototype'] = None,
+ profile: Optional['InstanceProfileIdentity'] = None,
+ reservation_affinity: Optional['InstanceReservationAffinityPrototype'] = None,
+ total_volume_bandwidth: Optional[int] = None,
+ user_data: Optional[str] = None,
+ volume_attachments: Optional[List['VolumeAttachmentPrototype']] = None,
+ vpc: Optional['VPCIdentity'] = None,
+ boot_volume_attachment: Optional['VolumeAttachmentPrototypeInstanceByImageContext'] = None,
+ network_attachments: Optional[List['InstanceNetworkAttachmentPrototype']] = None,
) -> None:
"""
- Initialize a InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByCRN object.
+ Initialize a InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkAttachment object.
- :param str crn: The CRN for this dedicated host.
+ :param datetime created_at: The date and time that the instance template
+ was created.
+ :param str crn: The CRN for this instance template.
+ :param str href: The URL for this instance template.
+ :param str id: The unique identifier for this instance template.
+ :param str name: The name for this instance template. The name is unique
+ across all instance templates in the region.
+ :param ResourceGroupReference resource_group: The resource group for this
+ instance template.
+ :param InstanceCatalogOfferingPrototype catalog_offering:
+ :param ZoneIdentity zone: The zone this virtual server instance will reside
+ in.
+ :param InstanceNetworkAttachmentPrototype primary_network_attachment: The
+ primary network attachment to create for the virtual server instance.
+ :param InstanceAvailabilityPolicyPrototype availability_policy: (optional)
+ The availability policy to use for this virtual server instance.
+ :param InstanceDefaultTrustedProfilePrototype default_trusted_profile:
+ (optional) The default trusted profile configuration to use for this
+ virtual server instance
+ This property's value is used when provisioning the virtual server
+ instance, but not subsequently managed. Accordingly, it is reflected as an
+ [instance
+ initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
+ property.
+ :param List[KeyIdentity] keys: (optional) The public SSH keys for the
+ administrative user of the virtual server instance. Keys will be made
+ available to the virtual server instance as cloud-init vendor data. For
+ cloud-init enabled images, these keys will also be added as SSH authorized
+ keys for the administrative user.
+ For Windows images, the keys of type `rsa` must be specified, and one will
+ be selected to encrypt [the administrator
+ password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization).
+ Keys are optional for other images, but if no keys are specified, the
+ instance will be inaccessible unless the specified image provides another
+ means of access.
+ This property's value is used when provisioning the virtual server
+ instance, but not subsequently managed. Accordingly, it is reflected as an
+ [instance
+ initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
+ property.
+ :param InstanceMetadataServicePrototype metadata_service: (optional)
+ :param InstancePlacementTargetPrototype placement_target: (optional) The
+ placement restrictions to use for the virtual server instance.
+ If specified, `reservation_affinity.policy` must be `disabled`.
+ :param InstanceProfileIdentity profile: (optional) The
+ [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for
+ this virtual server instance.
+ If unspecified, `bx2-2x8` will be used, but this default value is expected
+ to change in the future.
+ :param InstanceReservationAffinityPrototype reservation_affinity:
+ (optional)
+ :param int total_volume_bandwidth: (optional) The amount of bandwidth (in
+ megabits per second) allocated exclusively to instance storage volumes. An
+ increase in this value will result in a corresponding decrease to
+ `total_network_bandwidth`.
+ :param str user_data: (optional) [User
+ data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available
+ when setting up the virtual server instance.
+ :param List[VolumeAttachmentPrototype] volume_attachments: (optional) The
+ additional volume attachments to create for the virtual server instance.
+ :param VPCIdentity vpc: (optional) The VPC this virtual server instance
+ will reside in.
+ If specified, it must match the VPC for the subnets of the instance network
+ attachments or instance network interfaces.
+ :param VolumeAttachmentPrototypeInstanceByImageContext
+ boot_volume_attachment: (optional) The boot volume attachment to create for
+ the virtual server instance.
+ :param List[InstanceNetworkAttachmentPrototype] network_attachments:
+ (optional) The additional network attachments to create for the virtual
+ server instance.
"""
# pylint: disable=super-init-not-called
+ self.availability_policy = availability_policy
+ self.created_at = created_at
self.crn = crn
+ self.default_trusted_profile = default_trusted_profile
+ self.href = href
+ self.id = id
+ self.keys = keys
+ self.metadata_service = metadata_service
+ self.name = name
+ self.placement_target = placement_target
+ self.profile = profile
+ self.reservation_affinity = reservation_affinity
+ self.resource_group = resource_group
+ self.total_volume_bandwidth = total_volume_bandwidth
+ self.user_data = user_data
+ self.volume_attachments = volume_attachments
+ self.vpc = vpc
+ self.boot_volume_attachment = boot_volume_attachment
+ self.catalog_offering = catalog_offering
+ self.zone = zone
+ self.network_attachments = network_attachments
+ self.primary_network_attachment = primary_network_attachment
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByCRN':
- """Initialize a InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByCRN object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkAttachment':
+ """Initialize a InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkAttachment object from a json dictionary."""
args = {}
- if 'crn' in _dict:
- args['crn'] = _dict.get('crn')
+ if (availability_policy := _dict.get('availability_policy')) is not None:
+ args['availability_policy'] = InstanceAvailabilityPolicyPrototype.from_dict(availability_policy)
+ if (created_at := _dict.get('created_at')) is not None:
+ args['created_at'] = string_to_datetime(created_at)
else:
- raise ValueError('Required property \'crn\' not present in InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByCRN JSON')
+ raise ValueError('Required property \'created_at\' not present in InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkAttachment JSON')
+ if (crn := _dict.get('crn')) is not None:
+ args['crn'] = crn
+ else:
+ raise ValueError('Required property \'crn\' not present in InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkAttachment JSON')
+ if (default_trusted_profile := _dict.get('default_trusted_profile')) is not None:
+ args['default_trusted_profile'] = InstanceDefaultTrustedProfilePrototype.from_dict(default_trusted_profile)
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
+ else:
+ raise ValueError('Required property \'href\' not present in InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkAttachment JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
+ else:
+ raise ValueError('Required property \'id\' not present in InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkAttachment JSON')
+ if (keys := _dict.get('keys')) is not None:
+ args['keys'] = keys
+ if (metadata_service := _dict.get('metadata_service')) is not None:
+ args['metadata_service'] = InstanceMetadataServicePrototype.from_dict(metadata_service)
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ else:
+ raise ValueError('Required property \'name\' not present in InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkAttachment JSON')
+ if (placement_target := _dict.get('placement_target')) is not None:
+ args['placement_target'] = placement_target
+ if (profile := _dict.get('profile')) is not None:
+ args['profile'] = profile
+ if (reservation_affinity := _dict.get('reservation_affinity')) is not None:
+ args['reservation_affinity'] = InstanceReservationAffinityPrototype.from_dict(reservation_affinity)
+ if (resource_group := _dict.get('resource_group')) is not None:
+ args['resource_group'] = ResourceGroupReference.from_dict(resource_group)
+ else:
+ raise ValueError('Required property \'resource_group\' not present in InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkAttachment JSON')
+ if (total_volume_bandwidth := _dict.get('total_volume_bandwidth')) is not None:
+ args['total_volume_bandwidth'] = total_volume_bandwidth
+ if (user_data := _dict.get('user_data')) is not None:
+ args['user_data'] = user_data
+ if (volume_attachments := _dict.get('volume_attachments')) is not None:
+ args['volume_attachments'] = [VolumeAttachmentPrototype.from_dict(v) for v in volume_attachments]
+ if (vpc := _dict.get('vpc')) is not None:
+ args['vpc'] = vpc
+ if (boot_volume_attachment := _dict.get('boot_volume_attachment')) is not None:
+ args['boot_volume_attachment'] = VolumeAttachmentPrototypeInstanceByImageContext.from_dict(boot_volume_attachment)
+ if (catalog_offering := _dict.get('catalog_offering')) is not None:
+ args['catalog_offering'] = catalog_offering
+ else:
+ raise ValueError('Required property \'catalog_offering\' not present in InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkAttachment JSON')
+ if (zone := _dict.get('zone')) is not None:
+ args['zone'] = zone
+ else:
+ raise ValueError('Required property \'zone\' not present in InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkAttachment JSON')
+ if (network_attachments := _dict.get('network_attachments')) is not None:
+ args['network_attachments'] = [InstanceNetworkAttachmentPrototype.from_dict(v) for v in network_attachments]
+ if (primary_network_attachment := _dict.get('primary_network_attachment')) is not None:
+ args['primary_network_attachment'] = InstanceNetworkAttachmentPrototype.from_dict(primary_network_attachment)
+ else:
+ raise ValueError('Required property \'primary_network_attachment\' not present in InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkAttachment JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByCRN object from a json dictionary."""
+ """Initialize a InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkAttachment object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
+ if hasattr(self, 'availability_policy') and self.availability_policy is not None:
+ if isinstance(self.availability_policy, dict):
+ _dict['availability_policy'] = self.availability_policy
+ else:
+ _dict['availability_policy'] = self.availability_policy.to_dict()
+ if hasattr(self, 'created_at') and self.created_at is not None:
+ _dict['created_at'] = datetime_to_string(self.created_at)
if hasattr(self, 'crn') and self.crn is not None:
_dict['crn'] = self.crn
+ if hasattr(self, 'default_trusted_profile') and self.default_trusted_profile is not None:
+ if isinstance(self.default_trusted_profile, dict):
+ _dict['default_trusted_profile'] = self.default_trusted_profile
+ else:
+ _dict['default_trusted_profile'] = self.default_trusted_profile.to_dict()
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
+ if hasattr(self, 'id') and self.id is not None:
+ _dict['id'] = self.id
+ if hasattr(self, 'keys') and self.keys is not None:
+ keys_list = []
+ for v in self.keys:
+ if isinstance(v, dict):
+ keys_list.append(v)
+ else:
+ keys_list.append(v.to_dict())
+ _dict['keys'] = keys_list
+ if hasattr(self, 'metadata_service') and self.metadata_service is not None:
+ if isinstance(self.metadata_service, dict):
+ _dict['metadata_service'] = self.metadata_service
+ else:
+ _dict['metadata_service'] = self.metadata_service.to_dict()
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ if hasattr(self, 'placement_target') and self.placement_target is not None:
+ if isinstance(self.placement_target, dict):
+ _dict['placement_target'] = self.placement_target
+ else:
+ _dict['placement_target'] = self.placement_target.to_dict()
+ if hasattr(self, 'profile') and self.profile is not None:
+ if isinstance(self.profile, dict):
+ _dict['profile'] = self.profile
+ else:
+ _dict['profile'] = self.profile.to_dict()
+ if hasattr(self, 'reservation_affinity') and self.reservation_affinity is not None:
+ if isinstance(self.reservation_affinity, dict):
+ _dict['reservation_affinity'] = self.reservation_affinity
+ else:
+ _dict['reservation_affinity'] = self.reservation_affinity.to_dict()
+ if hasattr(self, 'resource_group') and self.resource_group is not None:
+ if isinstance(self.resource_group, dict):
+ _dict['resource_group'] = self.resource_group
+ else:
+ _dict['resource_group'] = self.resource_group.to_dict()
+ if hasattr(self, 'total_volume_bandwidth') and self.total_volume_bandwidth is not None:
+ _dict['total_volume_bandwidth'] = self.total_volume_bandwidth
+ if hasattr(self, 'user_data') and self.user_data is not None:
+ _dict['user_data'] = self.user_data
+ if hasattr(self, 'volume_attachments') and self.volume_attachments is not None:
+ volume_attachments_list = []
+ for v in self.volume_attachments:
+ if isinstance(v, dict):
+ volume_attachments_list.append(v)
+ else:
+ volume_attachments_list.append(v.to_dict())
+ _dict['volume_attachments'] = volume_attachments_list
+ if hasattr(self, 'vpc') and self.vpc is not None:
+ if isinstance(self.vpc, dict):
+ _dict['vpc'] = self.vpc
+ else:
+ _dict['vpc'] = self.vpc.to_dict()
+ if hasattr(self, 'boot_volume_attachment') and self.boot_volume_attachment is not None:
+ if isinstance(self.boot_volume_attachment, dict):
+ _dict['boot_volume_attachment'] = self.boot_volume_attachment
+ else:
+ _dict['boot_volume_attachment'] = self.boot_volume_attachment.to_dict()
+ if hasattr(self, 'catalog_offering') and self.catalog_offering is not None:
+ if isinstance(self.catalog_offering, dict):
+ _dict['catalog_offering'] = self.catalog_offering
+ else:
+ _dict['catalog_offering'] = self.catalog_offering.to_dict()
+ if hasattr(self, 'zone') and self.zone is not None:
+ if isinstance(self.zone, dict):
+ _dict['zone'] = self.zone
+ else:
+ _dict['zone'] = self.zone.to_dict()
+ if hasattr(self, 'network_attachments') and self.network_attachments is not None:
+ network_attachments_list = []
+ for v in self.network_attachments:
+ if isinstance(v, dict):
+ network_attachments_list.append(v)
+ else:
+ network_attachments_list.append(v.to_dict())
+ _dict['network_attachments'] = network_attachments_list
+ if hasattr(self, 'primary_network_attachment') and self.primary_network_attachment is not None:
+ if isinstance(self.primary_network_attachment, dict):
+ _dict['primary_network_attachment'] = self.primary_network_attachment
+ else:
+ _dict['primary_network_attachment'] = self.primary_network_attachment.to_dict()
return _dict
def _to_dict(self):
@@ -126172,59 +145353,386 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByCRN object."""
+ """Return a `str` version of this InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkAttachment object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByCRN') -> bool:
+ def __eq__(self, other: 'InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkAttachment') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByCRN') -> bool:
+ def __ne__(self, other: 'InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkAttachment') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByHref(InstancePlacementTargetPrototypeDedicatedHostIdentity):
+class InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkInterface(InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext):
"""
- InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByHref.
+ InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkInterface.
- :attr str href: The URL for this dedicated host.
+ :param InstanceAvailabilityPolicyPrototype availability_policy: (optional) The
+ availability policy to use for this virtual server instance.
+ :param datetime created_at: The date and time that the instance template was
+ created.
+ :param str crn: The CRN for this instance template.
+ :param InstanceDefaultTrustedProfilePrototype default_trusted_profile:
+ (optional) The default trusted profile configuration to use for this virtual
+ server instance
+ This property's value is used when provisioning the virtual server instance, but
+ not subsequently managed. Accordingly, it is reflected as an [instance
+ initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
+ property.
+ :param str href: The URL for this instance template.
+ :param str id: The unique identifier 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, the keys of type `rsa` must be specified, and one will be
+ selected to encrypt [the administrator
+ password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys
+ are optional for other images, but if no keys are specified, the instance will
+ be inaccessible unless the specified image provides another means of access.
+ This property's value is used when provisioning the virtual server instance, but
+ not subsequently managed. Accordingly, it is reflected as an [instance
+ initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
+ property.
+ :param InstanceMetadataServicePrototype metadata_service: (optional)
+ :param str name: The name for this instance template. The name is unique across
+ all instance templates in the region.
+ :param InstancePlacementTargetPrototype placement_target: (optional) The
+ placement restrictions to use for the virtual server instance.
+ If specified, `reservation_affinity.policy` must be `disabled`.
+ :param InstanceProfileIdentity profile: (optional) The
+ [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this
+ virtual server instance.
+ If unspecified, `bx2-2x8` will be used, but this default value is expected to
+ change in the future.
+ :param InstanceReservationAffinityPrototype reservation_affinity: (optional)
+ :param ResourceGroupReference resource_group: The resource group for this
+ instance template.
+ :param int total_volume_bandwidth: (optional) The amount of bandwidth (in
+ megabits per second) allocated exclusively to instance storage volumes. An
+ increase in this value will result in a corresponding decrease to
+ `total_network_bandwidth`.
+ :param str user_data: (optional) [User
+ data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when
+ setting up the virtual server instance.
+ :param List[VolumeAttachmentPrototype] volume_attachments: (optional) The
+ additional volume attachments to create for the virtual server instance.
+ :param VPCIdentity vpc: (optional) The VPC this virtual server instance will
+ reside in.
+ If specified, it must match the VPC for the subnets of the instance network
+ attachments or instance network interfaces.
+ :param VolumeAttachmentPrototypeInstanceByImageContext boot_volume_attachment:
+ (optional) The boot volume attachment to create for the virtual server instance.
+ :param InstanceCatalogOfferingPrototype catalog_offering:
+ :param ZoneIdentity zone: The zone this virtual server instance will reside in.
+ :param List[NetworkInterfacePrototype] network_interfaces: (optional) The
+ additional instance network interfaces to create.
+ :param NetworkInterfacePrototype primary_network_interface: The primary instance
+ network interface to create.
"""
def __init__(
self,
+ created_at: datetime,
+ crn: str,
href: str,
+ id: str,
+ name: str,
+ resource_group: 'ResourceGroupReference',
+ catalog_offering: 'InstanceCatalogOfferingPrototype',
+ zone: 'ZoneIdentity',
+ primary_network_interface: 'NetworkInterfacePrototype',
+ *,
+ availability_policy: Optional['InstanceAvailabilityPolicyPrototype'] = None,
+ default_trusted_profile: Optional['InstanceDefaultTrustedProfilePrototype'] = None,
+ keys: Optional[List['KeyIdentity']] = None,
+ metadata_service: Optional['InstanceMetadataServicePrototype'] = None,
+ placement_target: Optional['InstancePlacementTargetPrototype'] = None,
+ profile: Optional['InstanceProfileIdentity'] = None,
+ reservation_affinity: Optional['InstanceReservationAffinityPrototype'] = None,
+ total_volume_bandwidth: Optional[int] = None,
+ user_data: Optional[str] = None,
+ volume_attachments: Optional[List['VolumeAttachmentPrototype']] = None,
+ vpc: Optional['VPCIdentity'] = None,
+ boot_volume_attachment: Optional['VolumeAttachmentPrototypeInstanceByImageContext'] = None,
+ network_interfaces: Optional[List['NetworkInterfacePrototype']] = None,
) -> None:
"""
- Initialize a InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByHref object.
+ Initialize a InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkInterface object.
- :param str href: The URL for this dedicated host.
+ :param datetime created_at: The date and time that the instance template
+ was created.
+ :param str crn: The CRN for this instance template.
+ :param str href: The URL for this instance template.
+ :param str id: The unique identifier for this instance template.
+ :param str name: The name for this instance template. The name is unique
+ across all instance templates in the region.
+ :param ResourceGroupReference resource_group: The resource group for this
+ instance template.
+ :param InstanceCatalogOfferingPrototype catalog_offering:
+ :param ZoneIdentity zone: The zone this virtual server instance will reside
+ in.
+ :param NetworkInterfacePrototype primary_network_interface: The primary
+ instance network interface to create.
+ :param InstanceAvailabilityPolicyPrototype availability_policy: (optional)
+ The availability policy to use for this virtual server instance.
+ :param InstanceDefaultTrustedProfilePrototype default_trusted_profile:
+ (optional) The default trusted profile configuration to use for this
+ virtual server instance
+ This property's value is used when provisioning the virtual server
+ instance, but not subsequently managed. Accordingly, it is reflected as an
+ [instance
+ initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
+ property.
+ :param List[KeyIdentity] keys: (optional) The public SSH keys for the
+ administrative user of the virtual server instance. Keys will be made
+ available to the virtual server instance as cloud-init vendor data. For
+ cloud-init enabled images, these keys will also be added as SSH authorized
+ keys for the administrative user.
+ For Windows images, the keys of type `rsa` must be specified, and one will
+ be selected to encrypt [the administrator
+ password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization).
+ Keys are optional for other images, but if no keys are specified, the
+ instance will be inaccessible unless the specified image provides another
+ means of access.
+ This property's value is used when provisioning the virtual server
+ instance, but not subsequently managed. Accordingly, it is reflected as an
+ [instance
+ initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
+ property.
+ :param InstanceMetadataServicePrototype metadata_service: (optional)
+ :param InstancePlacementTargetPrototype placement_target: (optional) The
+ placement restrictions to use for the virtual server instance.
+ If specified, `reservation_affinity.policy` must be `disabled`.
+ :param InstanceProfileIdentity profile: (optional) The
+ [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for
+ this virtual server instance.
+ If unspecified, `bx2-2x8` will be used, but this default value is expected
+ to change in the future.
+ :param InstanceReservationAffinityPrototype reservation_affinity:
+ (optional)
+ :param int total_volume_bandwidth: (optional) The amount of bandwidth (in
+ megabits per second) allocated exclusively to instance storage volumes. An
+ increase in this value will result in a corresponding decrease to
+ `total_network_bandwidth`.
+ :param str user_data: (optional) [User
+ data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available
+ when setting up the virtual server instance.
+ :param List[VolumeAttachmentPrototype] volume_attachments: (optional) The
+ additional volume attachments to create for the virtual server instance.
+ :param VPCIdentity vpc: (optional) The VPC this virtual server instance
+ will reside in.
+ If specified, it must match the VPC for the subnets of the instance network
+ attachments or instance network interfaces.
+ :param VolumeAttachmentPrototypeInstanceByImageContext
+ boot_volume_attachment: (optional) The boot volume attachment to create for
+ the virtual server instance.
+ :param List[NetworkInterfacePrototype] network_interfaces: (optional) The
+ additional instance network interfaces to create.
"""
# pylint: disable=super-init-not-called
+ self.availability_policy = availability_policy
+ self.created_at = created_at
+ self.crn = crn
+ self.default_trusted_profile = default_trusted_profile
self.href = href
+ self.id = id
+ self.keys = keys
+ self.metadata_service = metadata_service
+ self.name = name
+ self.placement_target = placement_target
+ self.profile = profile
+ self.reservation_affinity = reservation_affinity
+ self.resource_group = resource_group
+ self.total_volume_bandwidth = total_volume_bandwidth
+ self.user_data = user_data
+ self.volume_attachments = volume_attachments
+ self.vpc = vpc
+ self.boot_volume_attachment = boot_volume_attachment
+ self.catalog_offering = catalog_offering
+ self.zone = zone
+ self.network_interfaces = network_interfaces
+ self.primary_network_interface = primary_network_interface
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByHref':
- """Initialize a InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByHref object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkInterface':
+ """Initialize a InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkInterface object from a json dictionary."""
args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ if (availability_policy := _dict.get('availability_policy')) is not None:
+ args['availability_policy'] = InstanceAvailabilityPolicyPrototype.from_dict(availability_policy)
+ if (created_at := _dict.get('created_at')) is not None:
+ args['created_at'] = string_to_datetime(created_at)
else:
- raise ValueError('Required property \'href\' not present in InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByHref JSON')
+ raise ValueError('Required property \'created_at\' not present in InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkInterface JSON')
+ if (crn := _dict.get('crn')) is not None:
+ args['crn'] = crn
+ else:
+ raise ValueError('Required property \'crn\' not present in InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkInterface JSON')
+ if (default_trusted_profile := _dict.get('default_trusted_profile')) is not None:
+ args['default_trusted_profile'] = InstanceDefaultTrustedProfilePrototype.from_dict(default_trusted_profile)
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
+ else:
+ raise ValueError('Required property \'href\' not present in InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkInterface JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
+ else:
+ raise ValueError('Required property \'id\' not present in InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkInterface JSON')
+ if (keys := _dict.get('keys')) is not None:
+ args['keys'] = keys
+ if (metadata_service := _dict.get('metadata_service')) is not None:
+ args['metadata_service'] = InstanceMetadataServicePrototype.from_dict(metadata_service)
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ else:
+ raise ValueError('Required property \'name\' not present in InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkInterface JSON')
+ if (placement_target := _dict.get('placement_target')) is not None:
+ args['placement_target'] = placement_target
+ if (profile := _dict.get('profile')) is not None:
+ args['profile'] = profile
+ if (reservation_affinity := _dict.get('reservation_affinity')) is not None:
+ args['reservation_affinity'] = InstanceReservationAffinityPrototype.from_dict(reservation_affinity)
+ if (resource_group := _dict.get('resource_group')) is not None:
+ args['resource_group'] = ResourceGroupReference.from_dict(resource_group)
+ else:
+ raise ValueError('Required property \'resource_group\' not present in InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkInterface JSON')
+ if (total_volume_bandwidth := _dict.get('total_volume_bandwidth')) is not None:
+ args['total_volume_bandwidth'] = total_volume_bandwidth
+ if (user_data := _dict.get('user_data')) is not None:
+ args['user_data'] = user_data
+ if (volume_attachments := _dict.get('volume_attachments')) is not None:
+ args['volume_attachments'] = [VolumeAttachmentPrototype.from_dict(v) for v in volume_attachments]
+ if (vpc := _dict.get('vpc')) is not None:
+ args['vpc'] = vpc
+ if (boot_volume_attachment := _dict.get('boot_volume_attachment')) is not None:
+ args['boot_volume_attachment'] = VolumeAttachmentPrototypeInstanceByImageContext.from_dict(boot_volume_attachment)
+ if (catalog_offering := _dict.get('catalog_offering')) is not None:
+ args['catalog_offering'] = catalog_offering
+ else:
+ raise ValueError('Required property \'catalog_offering\' not present in InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkInterface JSON')
+ if (zone := _dict.get('zone')) is not None:
+ args['zone'] = zone
+ else:
+ raise ValueError('Required property \'zone\' not present in InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkInterface JSON')
+ if (network_interfaces := _dict.get('network_interfaces')) is not None:
+ args['network_interfaces'] = [NetworkInterfacePrototype.from_dict(v) for v in network_interfaces]
+ if (primary_network_interface := _dict.get('primary_network_interface')) is not None:
+ args['primary_network_interface'] = NetworkInterfacePrototype.from_dict(primary_network_interface)
+ else:
+ raise ValueError('Required property \'primary_network_interface\' not present in InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkInterface JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByHref object from a json dictionary."""
+ """Initialize a InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkInterface object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
+ if hasattr(self, 'availability_policy') and self.availability_policy is not None:
+ if isinstance(self.availability_policy, dict):
+ _dict['availability_policy'] = self.availability_policy
+ else:
+ _dict['availability_policy'] = self.availability_policy.to_dict()
+ if hasattr(self, 'created_at') and self.created_at is not None:
+ _dict['created_at'] = datetime_to_string(self.created_at)
+ if hasattr(self, 'crn') and self.crn is not None:
+ _dict['crn'] = self.crn
+ if hasattr(self, 'default_trusted_profile') and self.default_trusted_profile is not None:
+ if isinstance(self.default_trusted_profile, dict):
+ _dict['default_trusted_profile'] = self.default_trusted_profile
+ else:
+ _dict['default_trusted_profile'] = self.default_trusted_profile.to_dict()
if hasattr(self, 'href') and self.href is not None:
_dict['href'] = self.href
+ if hasattr(self, 'id') and self.id is not None:
+ _dict['id'] = self.id
+ if hasattr(self, 'keys') and self.keys is not None:
+ keys_list = []
+ for v in self.keys:
+ if isinstance(v, dict):
+ keys_list.append(v)
+ else:
+ keys_list.append(v.to_dict())
+ _dict['keys'] = keys_list
+ if hasattr(self, 'metadata_service') and self.metadata_service is not None:
+ if isinstance(self.metadata_service, dict):
+ _dict['metadata_service'] = self.metadata_service
+ else:
+ _dict['metadata_service'] = self.metadata_service.to_dict()
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ if hasattr(self, 'placement_target') and self.placement_target is not None:
+ if isinstance(self.placement_target, dict):
+ _dict['placement_target'] = self.placement_target
+ else:
+ _dict['placement_target'] = self.placement_target.to_dict()
+ if hasattr(self, 'profile') and self.profile is not None:
+ if isinstance(self.profile, dict):
+ _dict['profile'] = self.profile
+ else:
+ _dict['profile'] = self.profile.to_dict()
+ if hasattr(self, 'reservation_affinity') and self.reservation_affinity is not None:
+ if isinstance(self.reservation_affinity, dict):
+ _dict['reservation_affinity'] = self.reservation_affinity
+ else:
+ _dict['reservation_affinity'] = self.reservation_affinity.to_dict()
+ if hasattr(self, 'resource_group') and self.resource_group is not None:
+ if isinstance(self.resource_group, dict):
+ _dict['resource_group'] = self.resource_group
+ else:
+ _dict['resource_group'] = self.resource_group.to_dict()
+ if hasattr(self, 'total_volume_bandwidth') and self.total_volume_bandwidth is not None:
+ _dict['total_volume_bandwidth'] = self.total_volume_bandwidth
+ if hasattr(self, 'user_data') and self.user_data is not None:
+ _dict['user_data'] = self.user_data
+ if hasattr(self, 'volume_attachments') and self.volume_attachments is not None:
+ volume_attachments_list = []
+ for v in self.volume_attachments:
+ if isinstance(v, dict):
+ volume_attachments_list.append(v)
+ else:
+ volume_attachments_list.append(v.to_dict())
+ _dict['volume_attachments'] = volume_attachments_list
+ if hasattr(self, 'vpc') and self.vpc is not None:
+ if isinstance(self.vpc, dict):
+ _dict['vpc'] = self.vpc
+ else:
+ _dict['vpc'] = self.vpc.to_dict()
+ if hasattr(self, 'boot_volume_attachment') and self.boot_volume_attachment is not None:
+ if isinstance(self.boot_volume_attachment, dict):
+ _dict['boot_volume_attachment'] = self.boot_volume_attachment
+ else:
+ _dict['boot_volume_attachment'] = self.boot_volume_attachment.to_dict()
+ if hasattr(self, 'catalog_offering') and self.catalog_offering is not None:
+ if isinstance(self.catalog_offering, dict):
+ _dict['catalog_offering'] = self.catalog_offering
+ else:
+ _dict['catalog_offering'] = self.catalog_offering.to_dict()
+ if hasattr(self, 'zone') and self.zone is not None:
+ if isinstance(self.zone, dict):
+ _dict['zone'] = self.zone
+ else:
+ _dict['zone'] = self.zone.to_dict()
+ if hasattr(self, 'network_interfaces') and self.network_interfaces is not None:
+ network_interfaces_list = []
+ for v in self.network_interfaces:
+ if isinstance(v, dict):
+ network_interfaces_list.append(v)
+ else:
+ network_interfaces_list.append(v.to_dict())
+ _dict['network_interfaces'] = network_interfaces_list
+ if hasattr(self, 'primary_network_interface') and self.primary_network_interface is not None:
+ if isinstance(self.primary_network_interface, dict):
+ _dict['primary_network_interface'] = self.primary_network_interface
+ else:
+ _dict['primary_network_interface'] = self.primary_network_interface.to_dict()
return _dict
def _to_dict(self):
@@ -126232,59 +145740,389 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByHref object."""
+ """Return a `str` version of this InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkInterface object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByHref') -> bool:
+ def __eq__(self, other: 'InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkInterface') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByHref') -> bool:
+ def __ne__(self, other: 'InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkInterface') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById(InstancePlacementTargetPrototypeDedicatedHostIdentity):
+class InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkAttachment(InstanceTemplateInstanceByImageInstanceTemplateContext):
"""
- InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById.
+ InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkAttachment.
- :attr str id: The unique identifier for this dedicated host.
+ :param InstanceAvailabilityPolicyPrototype availability_policy: (optional) The
+ availability policy to use for this virtual server instance.
+ :param datetime created_at: The date and time that the instance template was
+ created.
+ :param str crn: The CRN for this instance template.
+ :param InstanceDefaultTrustedProfilePrototype default_trusted_profile:
+ (optional) The default trusted profile configuration to use for this virtual
+ server instance
+ This property's value is used when provisioning the virtual server instance, but
+ not subsequently managed. Accordingly, it is reflected as an [instance
+ initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
+ property.
+ :param str href: The URL for this instance template.
+ :param str id: The unique identifier 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, the keys of type `rsa` must be specified, and one will be
+ selected to encrypt [the administrator
+ password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys
+ are optional for other images, but if no keys are specified, the instance will
+ be inaccessible unless the specified image provides another means of access.
+ This property's value is used when provisioning the virtual server instance, but
+ not subsequently managed. Accordingly, it is reflected as an [instance
+ initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
+ property.
+ :param InstanceMetadataServicePrototype metadata_service: (optional)
+ :param str name: The name for this instance template. The name is unique across
+ all instance templates in the region.
+ :param InstancePlacementTargetPrototype placement_target: (optional) The
+ placement restrictions to use for the virtual server instance.
+ If specified, `reservation_affinity.policy` must be `disabled`.
+ :param InstanceProfileIdentity profile: (optional) The
+ [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this
+ virtual server instance.
+ If unspecified, `bx2-2x8` will be used, but this default value is expected to
+ change in the future.
+ :param InstanceReservationAffinityPrototype reservation_affinity: (optional)
+ :param ResourceGroupReference resource_group: The resource group for this
+ instance template.
+ :param int total_volume_bandwidth: (optional) The amount of bandwidth (in
+ megabits per second) allocated exclusively to instance storage volumes. An
+ increase in this value will result in a corresponding decrease to
+ `total_network_bandwidth`.
+ :param str user_data: (optional) [User
+ data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when
+ setting up the virtual server instance.
+ :param List[VolumeAttachmentPrototype] volume_attachments: (optional) The
+ additional volume attachments to create for the virtual server instance.
+ :param VPCIdentity vpc: (optional) The VPC this virtual server instance will
+ reside in.
+ If specified, it must match the VPC for the subnets of the instance network
+ attachments or instance network interfaces.
+ :param VolumeAttachmentPrototypeInstanceByImageContext boot_volume_attachment:
+ (optional) The boot volume attachment to create for the virtual server instance.
+ :param ImageIdentity image: The image to use when provisioning the virtual
+ server instance.
+ :param ZoneIdentity zone: The zone this virtual server instance will reside in.
+ :param List[InstanceNetworkAttachmentPrototype] network_attachments: (optional)
+ The additional network attachments to create for the virtual server instance.
+ :param InstanceNetworkAttachmentPrototype primary_network_attachment: The
+ primary network attachment to create for the virtual server instance.
"""
def __init__(
self,
+ created_at: datetime,
+ crn: str,
+ href: str,
id: str,
+ name: str,
+ resource_group: 'ResourceGroupReference',
+ image: 'ImageIdentity',
+ zone: 'ZoneIdentity',
+ primary_network_attachment: 'InstanceNetworkAttachmentPrototype',
+ *,
+ availability_policy: Optional['InstanceAvailabilityPolicyPrototype'] = None,
+ default_trusted_profile: Optional['InstanceDefaultTrustedProfilePrototype'] = None,
+ keys: Optional[List['KeyIdentity']] = None,
+ metadata_service: Optional['InstanceMetadataServicePrototype'] = None,
+ placement_target: Optional['InstancePlacementTargetPrototype'] = None,
+ profile: Optional['InstanceProfileIdentity'] = None,
+ reservation_affinity: Optional['InstanceReservationAffinityPrototype'] = None,
+ total_volume_bandwidth: Optional[int] = None,
+ user_data: Optional[str] = None,
+ volume_attachments: Optional[List['VolumeAttachmentPrototype']] = None,
+ vpc: Optional['VPCIdentity'] = None,
+ boot_volume_attachment: Optional['VolumeAttachmentPrototypeInstanceByImageContext'] = None,
+ network_attachments: Optional[List['InstanceNetworkAttachmentPrototype']] = None,
) -> None:
"""
- Initialize a InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById object.
+ Initialize a InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkAttachment object.
- :param str id: The unique identifier for this dedicated host.
+ :param datetime created_at: The date and time that the instance template
+ was created.
+ :param str crn: The CRN for this instance template.
+ :param str href: The URL for this instance template.
+ :param str id: The unique identifier for this instance template.
+ :param str name: The name for this instance template. The name is unique
+ across all instance templates in the region.
+ :param ResourceGroupReference resource_group: The resource group for this
+ instance template.
+ :param ImageIdentity image: The image to use when provisioning the virtual
+ server instance.
+ :param ZoneIdentity zone: The zone this virtual server instance will reside
+ in.
+ :param InstanceNetworkAttachmentPrototype primary_network_attachment: The
+ primary network attachment to create for the virtual server instance.
+ :param InstanceAvailabilityPolicyPrototype availability_policy: (optional)
+ The availability policy to use for this virtual server instance.
+ :param InstanceDefaultTrustedProfilePrototype default_trusted_profile:
+ (optional) The default trusted profile configuration to use for this
+ virtual server instance
+ This property's value is used when provisioning the virtual server
+ instance, but not subsequently managed. Accordingly, it is reflected as an
+ [instance
+ initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
+ property.
+ :param List[KeyIdentity] keys: (optional) The public SSH keys for the
+ administrative user of the virtual server instance. Keys will be made
+ available to the virtual server instance as cloud-init vendor data. For
+ cloud-init enabled images, these keys will also be added as SSH authorized
+ keys for the administrative user.
+ For Windows images, the keys of type `rsa` must be specified, and one will
+ be selected to encrypt [the administrator
+ password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization).
+ Keys are optional for other images, but if no keys are specified, the
+ instance will be inaccessible unless the specified image provides another
+ means of access.
+ This property's value is used when provisioning the virtual server
+ instance, but not subsequently managed. Accordingly, it is reflected as an
+ [instance
+ initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
+ property.
+ :param InstanceMetadataServicePrototype metadata_service: (optional)
+ :param InstancePlacementTargetPrototype placement_target: (optional) The
+ placement restrictions to use for the virtual server instance.
+ If specified, `reservation_affinity.policy` must be `disabled`.
+ :param InstanceProfileIdentity profile: (optional) The
+ [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for
+ this virtual server instance.
+ If unspecified, `bx2-2x8` will be used, but this default value is expected
+ to change in the future.
+ :param InstanceReservationAffinityPrototype reservation_affinity:
+ (optional)
+ :param int total_volume_bandwidth: (optional) The amount of bandwidth (in
+ megabits per second) allocated exclusively to instance storage volumes. An
+ increase in this value will result in a corresponding decrease to
+ `total_network_bandwidth`.
+ :param str user_data: (optional) [User
+ data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available
+ when setting up the virtual server instance.
+ :param List[VolumeAttachmentPrototype] volume_attachments: (optional) The
+ additional volume attachments to create for the virtual server instance.
+ :param VPCIdentity vpc: (optional) The VPC this virtual server instance
+ will reside in.
+ If specified, it must match the VPC for the subnets of the instance network
+ attachments or instance network interfaces.
+ :param VolumeAttachmentPrototypeInstanceByImageContext
+ boot_volume_attachment: (optional) The boot volume attachment to create for
+ the virtual server instance.
+ :param List[InstanceNetworkAttachmentPrototype] network_attachments:
+ (optional) The additional network attachments to create for the virtual
+ server instance.
"""
# pylint: disable=super-init-not-called
+ self.availability_policy = availability_policy
+ self.created_at = created_at
+ self.crn = crn
+ self.default_trusted_profile = default_trusted_profile
+ self.href = href
self.id = id
+ self.keys = keys
+ self.metadata_service = metadata_service
+ self.name = name
+ self.placement_target = placement_target
+ self.profile = profile
+ self.reservation_affinity = reservation_affinity
+ self.resource_group = resource_group
+ self.total_volume_bandwidth = total_volume_bandwidth
+ self.user_data = user_data
+ self.volume_attachments = volume_attachments
+ self.vpc = vpc
+ self.boot_volume_attachment = boot_volume_attachment
+ self.image = image
+ self.zone = zone
+ self.network_attachments = network_attachments
+ self.primary_network_attachment = primary_network_attachment
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById':
- """Initialize a InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkAttachment':
+ """Initialize a InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkAttachment object from a json dictionary."""
args = {}
- if 'id' in _dict:
- args['id'] = _dict.get('id')
+ if (availability_policy := _dict.get('availability_policy')) is not None:
+ args['availability_policy'] = InstanceAvailabilityPolicyPrototype.from_dict(availability_policy)
+ if (created_at := _dict.get('created_at')) is not None:
+ args['created_at'] = string_to_datetime(created_at)
else:
- raise ValueError('Required property \'id\' not present in InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById JSON')
+ raise ValueError('Required property \'created_at\' not present in InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkAttachment JSON')
+ if (crn := _dict.get('crn')) is not None:
+ args['crn'] = crn
+ else:
+ raise ValueError('Required property \'crn\' not present in InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkAttachment JSON')
+ if (default_trusted_profile := _dict.get('default_trusted_profile')) is not None:
+ args['default_trusted_profile'] = InstanceDefaultTrustedProfilePrototype.from_dict(default_trusted_profile)
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
+ else:
+ raise ValueError('Required property \'href\' not present in InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkAttachment JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
+ else:
+ raise ValueError('Required property \'id\' not present in InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkAttachment JSON')
+ if (keys := _dict.get('keys')) is not None:
+ args['keys'] = keys
+ if (metadata_service := _dict.get('metadata_service')) is not None:
+ args['metadata_service'] = InstanceMetadataServicePrototype.from_dict(metadata_service)
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ else:
+ raise ValueError('Required property \'name\' not present in InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkAttachment JSON')
+ if (placement_target := _dict.get('placement_target')) is not None:
+ args['placement_target'] = placement_target
+ if (profile := _dict.get('profile')) is not None:
+ args['profile'] = profile
+ if (reservation_affinity := _dict.get('reservation_affinity')) is not None:
+ args['reservation_affinity'] = InstanceReservationAffinityPrototype.from_dict(reservation_affinity)
+ if (resource_group := _dict.get('resource_group')) is not None:
+ args['resource_group'] = ResourceGroupReference.from_dict(resource_group)
+ else:
+ raise ValueError('Required property \'resource_group\' not present in InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkAttachment JSON')
+ if (total_volume_bandwidth := _dict.get('total_volume_bandwidth')) is not None:
+ args['total_volume_bandwidth'] = total_volume_bandwidth
+ if (user_data := _dict.get('user_data')) is not None:
+ args['user_data'] = user_data
+ if (volume_attachments := _dict.get('volume_attachments')) is not None:
+ args['volume_attachments'] = [VolumeAttachmentPrototype.from_dict(v) for v in volume_attachments]
+ if (vpc := _dict.get('vpc')) is not None:
+ args['vpc'] = vpc
+ if (boot_volume_attachment := _dict.get('boot_volume_attachment')) is not None:
+ args['boot_volume_attachment'] = VolumeAttachmentPrototypeInstanceByImageContext.from_dict(boot_volume_attachment)
+ if (image := _dict.get('image')) is not None:
+ args['image'] = image
+ else:
+ raise ValueError('Required property \'image\' not present in InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkAttachment JSON')
+ if (zone := _dict.get('zone')) is not None:
+ args['zone'] = zone
+ else:
+ raise ValueError('Required property \'zone\' not present in InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkAttachment JSON')
+ if (network_attachments := _dict.get('network_attachments')) is not None:
+ args['network_attachments'] = [InstanceNetworkAttachmentPrototype.from_dict(v) for v in network_attachments]
+ if (primary_network_attachment := _dict.get('primary_network_attachment')) is not None:
+ args['primary_network_attachment'] = InstanceNetworkAttachmentPrototype.from_dict(primary_network_attachment)
+ else:
+ raise ValueError('Required property \'primary_network_attachment\' not present in InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkAttachment JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById object from a json dictionary."""
+ """Initialize a InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkAttachment object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
+ if hasattr(self, 'availability_policy') and self.availability_policy is not None:
+ if isinstance(self.availability_policy, dict):
+ _dict['availability_policy'] = self.availability_policy
+ else:
+ _dict['availability_policy'] = self.availability_policy.to_dict()
+ if hasattr(self, 'created_at') and self.created_at is not None:
+ _dict['created_at'] = datetime_to_string(self.created_at)
+ if hasattr(self, 'crn') and self.crn is not None:
+ _dict['crn'] = self.crn
+ if hasattr(self, 'default_trusted_profile') and self.default_trusted_profile is not None:
+ if isinstance(self.default_trusted_profile, dict):
+ _dict['default_trusted_profile'] = self.default_trusted_profile
+ else:
+ _dict['default_trusted_profile'] = self.default_trusted_profile.to_dict()
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
if hasattr(self, 'id') and self.id is not None:
_dict['id'] = self.id
+ if hasattr(self, 'keys') and self.keys is not None:
+ keys_list = []
+ for v in self.keys:
+ if isinstance(v, dict):
+ keys_list.append(v)
+ else:
+ keys_list.append(v.to_dict())
+ _dict['keys'] = keys_list
+ if hasattr(self, 'metadata_service') and self.metadata_service is not None:
+ if isinstance(self.metadata_service, dict):
+ _dict['metadata_service'] = self.metadata_service
+ else:
+ _dict['metadata_service'] = self.metadata_service.to_dict()
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ if hasattr(self, 'placement_target') and self.placement_target is not None:
+ if isinstance(self.placement_target, dict):
+ _dict['placement_target'] = self.placement_target
+ else:
+ _dict['placement_target'] = self.placement_target.to_dict()
+ if hasattr(self, 'profile') and self.profile is not None:
+ if isinstance(self.profile, dict):
+ _dict['profile'] = self.profile
+ else:
+ _dict['profile'] = self.profile.to_dict()
+ if hasattr(self, 'reservation_affinity') and self.reservation_affinity is not None:
+ if isinstance(self.reservation_affinity, dict):
+ _dict['reservation_affinity'] = self.reservation_affinity
+ else:
+ _dict['reservation_affinity'] = self.reservation_affinity.to_dict()
+ if hasattr(self, 'resource_group') and self.resource_group is not None:
+ if isinstance(self.resource_group, dict):
+ _dict['resource_group'] = self.resource_group
+ else:
+ _dict['resource_group'] = self.resource_group.to_dict()
+ if hasattr(self, 'total_volume_bandwidth') and self.total_volume_bandwidth is not None:
+ _dict['total_volume_bandwidth'] = self.total_volume_bandwidth
+ if hasattr(self, 'user_data') and self.user_data is not None:
+ _dict['user_data'] = self.user_data
+ if hasattr(self, 'volume_attachments') and self.volume_attachments is not None:
+ volume_attachments_list = []
+ for v in self.volume_attachments:
+ if isinstance(v, dict):
+ volume_attachments_list.append(v)
+ else:
+ volume_attachments_list.append(v.to_dict())
+ _dict['volume_attachments'] = volume_attachments_list
+ if hasattr(self, 'vpc') and self.vpc is not None:
+ if isinstance(self.vpc, dict):
+ _dict['vpc'] = self.vpc
+ else:
+ _dict['vpc'] = self.vpc.to_dict()
+ if hasattr(self, 'boot_volume_attachment') and self.boot_volume_attachment is not None:
+ if isinstance(self.boot_volume_attachment, dict):
+ _dict['boot_volume_attachment'] = self.boot_volume_attachment
+ else:
+ _dict['boot_volume_attachment'] = self.boot_volume_attachment.to_dict()
+ if hasattr(self, 'image') and self.image is not None:
+ if isinstance(self.image, dict):
+ _dict['image'] = self.image
+ else:
+ _dict['image'] = self.image.to_dict()
+ if hasattr(self, 'zone') and self.zone is not None:
+ if isinstance(self.zone, dict):
+ _dict['zone'] = self.zone
+ else:
+ _dict['zone'] = self.zone.to_dict()
+ if hasattr(self, 'network_attachments') and self.network_attachments is not None:
+ network_attachments_list = []
+ for v in self.network_attachments:
+ if isinstance(v, dict):
+ network_attachments_list.append(v)
+ else:
+ network_attachments_list.append(v.to_dict())
+ _dict['network_attachments'] = network_attachments_list
+ if hasattr(self, 'primary_network_attachment') and self.primary_network_attachment is not None:
+ if isinstance(self.primary_network_attachment, dict):
+ _dict['primary_network_attachment'] = self.primary_network_attachment
+ else:
+ _dict['primary_network_attachment'] = self.primary_network_attachment.to_dict()
return _dict
def _to_dict(self):
@@ -126292,59 +146130,388 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById object."""
+ """Return a `str` version of this InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkAttachment object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById') -> bool:
+ def __eq__(self, other: 'InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkAttachment') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById') -> bool:
+ def __ne__(self, other: 'InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkAttachment') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByCRN(InstancePlacementTargetPrototypePlacementGroupIdentity):
+class InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkInterface(InstanceTemplateInstanceByImageInstanceTemplateContext):
"""
- InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByCRN.
+ InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkInterface.
- :attr str crn: The CRN for this placement group.
+ :param InstanceAvailabilityPolicyPrototype availability_policy: (optional) The
+ availability policy to use for this virtual server instance.
+ :param datetime created_at: The date and time that the instance template was
+ created.
+ :param str crn: The CRN for this instance template.
+ :param InstanceDefaultTrustedProfilePrototype default_trusted_profile:
+ (optional) The default trusted profile configuration to use for this virtual
+ server instance
+ This property's value is used when provisioning the virtual server instance, but
+ not subsequently managed. Accordingly, it is reflected as an [instance
+ initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
+ property.
+ :param str href: The URL for this instance template.
+ :param str id: The unique identifier 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, the keys of type `rsa` must be specified, and one will be
+ selected to encrypt [the administrator
+ password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys
+ are optional for other images, but if no keys are specified, the instance will
+ be inaccessible unless the specified image provides another means of access.
+ This property's value is used when provisioning the virtual server instance, but
+ not subsequently managed. Accordingly, it is reflected as an [instance
+ initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
+ property.
+ :param InstanceMetadataServicePrototype metadata_service: (optional)
+ :param str name: The name for this instance template. The name is unique across
+ all instance templates in the region.
+ :param InstancePlacementTargetPrototype placement_target: (optional) The
+ placement restrictions to use for the virtual server instance.
+ If specified, `reservation_affinity.policy` must be `disabled`.
+ :param InstanceProfileIdentity profile: (optional) The
+ [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this
+ virtual server instance.
+ If unspecified, `bx2-2x8` will be used, but this default value is expected to
+ change in the future.
+ :param InstanceReservationAffinityPrototype reservation_affinity: (optional)
+ :param ResourceGroupReference resource_group: The resource group for this
+ instance template.
+ :param int total_volume_bandwidth: (optional) The amount of bandwidth (in
+ megabits per second) allocated exclusively to instance storage volumes. An
+ increase in this value will result in a corresponding decrease to
+ `total_network_bandwidth`.
+ :param str user_data: (optional) [User
+ data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when
+ setting up the virtual server instance.
+ :param List[VolumeAttachmentPrototype] volume_attachments: (optional) The
+ additional volume attachments to create for the virtual server instance.
+ :param VPCIdentity vpc: (optional) The VPC this virtual server instance will
+ reside in.
+ If specified, it must match the VPC for the subnets of the instance network
+ attachments or instance network interfaces.
+ :param VolumeAttachmentPrototypeInstanceByImageContext boot_volume_attachment:
+ (optional) The boot volume attachment to create for the virtual server instance.
+ :param ImageIdentity image: The image to use when provisioning the virtual
+ server instance.
+ :param ZoneIdentity zone: The zone this virtual server instance will reside in.
+ :param List[NetworkInterfacePrototype] network_interfaces: (optional) The
+ additional instance network interfaces to create.
+ :param NetworkInterfacePrototype primary_network_interface: The primary instance
+ network interface to create.
"""
def __init__(
self,
+ created_at: datetime,
crn: str,
+ href: str,
+ id: str,
+ name: str,
+ resource_group: 'ResourceGroupReference',
+ image: 'ImageIdentity',
+ zone: 'ZoneIdentity',
+ primary_network_interface: 'NetworkInterfacePrototype',
+ *,
+ availability_policy: Optional['InstanceAvailabilityPolicyPrototype'] = None,
+ default_trusted_profile: Optional['InstanceDefaultTrustedProfilePrototype'] = None,
+ keys: Optional[List['KeyIdentity']] = None,
+ metadata_service: Optional['InstanceMetadataServicePrototype'] = None,
+ placement_target: Optional['InstancePlacementTargetPrototype'] = None,
+ profile: Optional['InstanceProfileIdentity'] = None,
+ reservation_affinity: Optional['InstanceReservationAffinityPrototype'] = None,
+ total_volume_bandwidth: Optional[int] = None,
+ user_data: Optional[str] = None,
+ volume_attachments: Optional[List['VolumeAttachmentPrototype']] = None,
+ vpc: Optional['VPCIdentity'] = None,
+ boot_volume_attachment: Optional['VolumeAttachmentPrototypeInstanceByImageContext'] = None,
+ network_interfaces: Optional[List['NetworkInterfacePrototype']] = None,
) -> None:
"""
- Initialize a InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByCRN object.
+ Initialize a InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkInterface object.
- :param str crn: The CRN for this placement group.
+ :param datetime created_at: The date and time that the instance template
+ was created.
+ :param str crn: The CRN for this instance template.
+ :param str href: The URL for this instance template.
+ :param str id: The unique identifier for this instance template.
+ :param str name: The name for this instance template. The name is unique
+ across all instance templates in the region.
+ :param ResourceGroupReference resource_group: The resource group for this
+ instance template.
+ :param ImageIdentity image: The image to use when provisioning the virtual
+ server instance.
+ :param ZoneIdentity zone: The zone this virtual server instance will reside
+ in.
+ :param NetworkInterfacePrototype primary_network_interface: The primary
+ instance network interface to create.
+ :param InstanceAvailabilityPolicyPrototype availability_policy: (optional)
+ The availability policy to use for this virtual server instance.
+ :param InstanceDefaultTrustedProfilePrototype default_trusted_profile:
+ (optional) The default trusted profile configuration to use for this
+ virtual server instance
+ This property's value is used when provisioning the virtual server
+ instance, but not subsequently managed. Accordingly, it is reflected as an
+ [instance
+ initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
+ property.
+ :param List[KeyIdentity] keys: (optional) The public SSH keys for the
+ administrative user of the virtual server instance. Keys will be made
+ available to the virtual server instance as cloud-init vendor data. For
+ cloud-init enabled images, these keys will also be added as SSH authorized
+ keys for the administrative user.
+ For Windows images, the keys of type `rsa` must be specified, and one will
+ be selected to encrypt [the administrator
+ password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization).
+ Keys are optional for other images, but if no keys are specified, the
+ instance will be inaccessible unless the specified image provides another
+ means of access.
+ This property's value is used when provisioning the virtual server
+ instance, but not subsequently managed. Accordingly, it is reflected as an
+ [instance
+ initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
+ property.
+ :param InstanceMetadataServicePrototype metadata_service: (optional)
+ :param InstancePlacementTargetPrototype placement_target: (optional) The
+ placement restrictions to use for the virtual server instance.
+ If specified, `reservation_affinity.policy` must be `disabled`.
+ :param InstanceProfileIdentity profile: (optional) The
+ [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for
+ this virtual server instance.
+ If unspecified, `bx2-2x8` will be used, but this default value is expected
+ to change in the future.
+ :param InstanceReservationAffinityPrototype reservation_affinity:
+ (optional)
+ :param int total_volume_bandwidth: (optional) The amount of bandwidth (in
+ megabits per second) allocated exclusively to instance storage volumes. An
+ increase in this value will result in a corresponding decrease to
+ `total_network_bandwidth`.
+ :param str user_data: (optional) [User
+ data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available
+ when setting up the virtual server instance.
+ :param List[VolumeAttachmentPrototype] volume_attachments: (optional) The
+ additional volume attachments to create for the virtual server instance.
+ :param VPCIdentity vpc: (optional) The VPC this virtual server instance
+ will reside in.
+ If specified, it must match the VPC for the subnets of the instance network
+ attachments or instance network interfaces.
+ :param VolumeAttachmentPrototypeInstanceByImageContext
+ boot_volume_attachment: (optional) The boot volume attachment to create for
+ the virtual server instance.
+ :param List[NetworkInterfacePrototype] network_interfaces: (optional) The
+ additional instance network interfaces to create.
"""
# pylint: disable=super-init-not-called
+ self.availability_policy = availability_policy
+ self.created_at = created_at
self.crn = crn
+ self.default_trusted_profile = default_trusted_profile
+ self.href = href
+ self.id = id
+ self.keys = keys
+ self.metadata_service = metadata_service
+ self.name = name
+ self.placement_target = placement_target
+ self.profile = profile
+ self.reservation_affinity = reservation_affinity
+ self.resource_group = resource_group
+ self.total_volume_bandwidth = total_volume_bandwidth
+ self.user_data = user_data
+ self.volume_attachments = volume_attachments
+ self.vpc = vpc
+ self.boot_volume_attachment = boot_volume_attachment
+ self.image = image
+ self.zone = zone
+ self.network_interfaces = network_interfaces
+ self.primary_network_interface = primary_network_interface
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByCRN':
- """Initialize a InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByCRN object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkInterface':
+ """Initialize a InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkInterface object from a json dictionary."""
args = {}
- if 'crn' in _dict:
- args['crn'] = _dict.get('crn')
+ if (availability_policy := _dict.get('availability_policy')) is not None:
+ args['availability_policy'] = InstanceAvailabilityPolicyPrototype.from_dict(availability_policy)
+ if (created_at := _dict.get('created_at')) is not None:
+ args['created_at'] = string_to_datetime(created_at)
else:
- raise ValueError('Required property \'crn\' not present in InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByCRN JSON')
+ raise ValueError('Required property \'created_at\' not present in InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkInterface JSON')
+ if (crn := _dict.get('crn')) is not None:
+ args['crn'] = crn
+ else:
+ raise ValueError('Required property \'crn\' not present in InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkInterface JSON')
+ if (default_trusted_profile := _dict.get('default_trusted_profile')) is not None:
+ args['default_trusted_profile'] = InstanceDefaultTrustedProfilePrototype.from_dict(default_trusted_profile)
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
+ else:
+ raise ValueError('Required property \'href\' not present in InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkInterface JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
+ else:
+ raise ValueError('Required property \'id\' not present in InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkInterface JSON')
+ if (keys := _dict.get('keys')) is not None:
+ args['keys'] = keys
+ if (metadata_service := _dict.get('metadata_service')) is not None:
+ args['metadata_service'] = InstanceMetadataServicePrototype.from_dict(metadata_service)
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ else:
+ raise ValueError('Required property \'name\' not present in InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkInterface JSON')
+ if (placement_target := _dict.get('placement_target')) is not None:
+ args['placement_target'] = placement_target
+ if (profile := _dict.get('profile')) is not None:
+ args['profile'] = profile
+ if (reservation_affinity := _dict.get('reservation_affinity')) is not None:
+ args['reservation_affinity'] = InstanceReservationAffinityPrototype.from_dict(reservation_affinity)
+ if (resource_group := _dict.get('resource_group')) is not None:
+ args['resource_group'] = ResourceGroupReference.from_dict(resource_group)
+ else:
+ raise ValueError('Required property \'resource_group\' not present in InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkInterface JSON')
+ if (total_volume_bandwidth := _dict.get('total_volume_bandwidth')) is not None:
+ args['total_volume_bandwidth'] = total_volume_bandwidth
+ if (user_data := _dict.get('user_data')) is not None:
+ args['user_data'] = user_data
+ if (volume_attachments := _dict.get('volume_attachments')) is not None:
+ args['volume_attachments'] = [VolumeAttachmentPrototype.from_dict(v) for v in volume_attachments]
+ if (vpc := _dict.get('vpc')) is not None:
+ args['vpc'] = vpc
+ if (boot_volume_attachment := _dict.get('boot_volume_attachment')) is not None:
+ args['boot_volume_attachment'] = VolumeAttachmentPrototypeInstanceByImageContext.from_dict(boot_volume_attachment)
+ if (image := _dict.get('image')) is not None:
+ args['image'] = image
+ else:
+ raise ValueError('Required property \'image\' not present in InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkInterface JSON')
+ if (zone := _dict.get('zone')) is not None:
+ args['zone'] = zone
+ else:
+ raise ValueError('Required property \'zone\' not present in InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkInterface JSON')
+ if (network_interfaces := _dict.get('network_interfaces')) is not None:
+ args['network_interfaces'] = [NetworkInterfacePrototype.from_dict(v) for v in network_interfaces]
+ if (primary_network_interface := _dict.get('primary_network_interface')) is not None:
+ args['primary_network_interface'] = NetworkInterfacePrototype.from_dict(primary_network_interface)
+ else:
+ raise ValueError('Required property \'primary_network_interface\' not present in InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkInterface JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByCRN object from a json dictionary."""
+ """Initialize a InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkInterface object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
+ if hasattr(self, 'availability_policy') and self.availability_policy is not None:
+ if isinstance(self.availability_policy, dict):
+ _dict['availability_policy'] = self.availability_policy
+ else:
+ _dict['availability_policy'] = self.availability_policy.to_dict()
+ if hasattr(self, 'created_at') and self.created_at is not None:
+ _dict['created_at'] = datetime_to_string(self.created_at)
if hasattr(self, 'crn') and self.crn is not None:
_dict['crn'] = self.crn
+ if hasattr(self, 'default_trusted_profile') and self.default_trusted_profile is not None:
+ if isinstance(self.default_trusted_profile, dict):
+ _dict['default_trusted_profile'] = self.default_trusted_profile
+ else:
+ _dict['default_trusted_profile'] = self.default_trusted_profile.to_dict()
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
+ if hasattr(self, 'id') and self.id is not None:
+ _dict['id'] = self.id
+ if hasattr(self, 'keys') and self.keys is not None:
+ keys_list = []
+ for v in self.keys:
+ if isinstance(v, dict):
+ keys_list.append(v)
+ else:
+ keys_list.append(v.to_dict())
+ _dict['keys'] = keys_list
+ if hasattr(self, 'metadata_service') and self.metadata_service is not None:
+ if isinstance(self.metadata_service, dict):
+ _dict['metadata_service'] = self.metadata_service
+ else:
+ _dict['metadata_service'] = self.metadata_service.to_dict()
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ if hasattr(self, 'placement_target') and self.placement_target is not None:
+ if isinstance(self.placement_target, dict):
+ _dict['placement_target'] = self.placement_target
+ else:
+ _dict['placement_target'] = self.placement_target.to_dict()
+ if hasattr(self, 'profile') and self.profile is not None:
+ if isinstance(self.profile, dict):
+ _dict['profile'] = self.profile
+ else:
+ _dict['profile'] = self.profile.to_dict()
+ if hasattr(self, 'reservation_affinity') and self.reservation_affinity is not None:
+ if isinstance(self.reservation_affinity, dict):
+ _dict['reservation_affinity'] = self.reservation_affinity
+ else:
+ _dict['reservation_affinity'] = self.reservation_affinity.to_dict()
+ if hasattr(self, 'resource_group') and self.resource_group is not None:
+ if isinstance(self.resource_group, dict):
+ _dict['resource_group'] = self.resource_group
+ else:
+ _dict['resource_group'] = self.resource_group.to_dict()
+ if hasattr(self, 'total_volume_bandwidth') and self.total_volume_bandwidth is not None:
+ _dict['total_volume_bandwidth'] = self.total_volume_bandwidth
+ if hasattr(self, 'user_data') and self.user_data is not None:
+ _dict['user_data'] = self.user_data
+ if hasattr(self, 'volume_attachments') and self.volume_attachments is not None:
+ volume_attachments_list = []
+ for v in self.volume_attachments:
+ if isinstance(v, dict):
+ volume_attachments_list.append(v)
+ else:
+ volume_attachments_list.append(v.to_dict())
+ _dict['volume_attachments'] = volume_attachments_list
+ if hasattr(self, 'vpc') and self.vpc is not None:
+ if isinstance(self.vpc, dict):
+ _dict['vpc'] = self.vpc
+ else:
+ _dict['vpc'] = self.vpc.to_dict()
+ if hasattr(self, 'boot_volume_attachment') and self.boot_volume_attachment is not None:
+ if isinstance(self.boot_volume_attachment, dict):
+ _dict['boot_volume_attachment'] = self.boot_volume_attachment
+ else:
+ _dict['boot_volume_attachment'] = self.boot_volume_attachment.to_dict()
+ if hasattr(self, 'image') and self.image is not None:
+ if isinstance(self.image, dict):
+ _dict['image'] = self.image
+ else:
+ _dict['image'] = self.image.to_dict()
+ if hasattr(self, 'zone') and self.zone is not None:
+ if isinstance(self.zone, dict):
+ _dict['zone'] = self.zone
+ else:
+ _dict['zone'] = self.zone.to_dict()
+ if hasattr(self, 'network_interfaces') and self.network_interfaces is not None:
+ network_interfaces_list = []
+ for v in self.network_interfaces:
+ if isinstance(v, dict):
+ network_interfaces_list.append(v)
+ else:
+ network_interfaces_list.append(v.to_dict())
+ _dict['network_interfaces'] = network_interfaces_list
+ if hasattr(self, 'primary_network_interface') and self.primary_network_interface is not None:
+ if isinstance(self.primary_network_interface, dict):
+ _dict['primary_network_interface'] = self.primary_network_interface
+ else:
+ _dict['primary_network_interface'] = self.primary_network_interface.to_dict()
return _dict
def _to_dict(self):
@@ -126352,59 +146519,393 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByCRN object."""
+ """Return a `str` version of this InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkInterface object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByCRN') -> bool:
+ def __eq__(self, other: 'InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkInterface') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByCRN') -> bool:
+ def __ne__(self, other: 'InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkInterface') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByHref(InstancePlacementTargetPrototypePlacementGroupIdentity):
+class InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkAttachment(InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext):
"""
- InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByHref.
+ InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkAttachment.
- :attr str href: The URL for this placement group.
+ :param InstanceAvailabilityPolicyPrototype availability_policy: (optional) The
+ availability policy to use for this virtual server instance.
+ :param datetime created_at: The date and time that the instance template was
+ created.
+ :param str crn: The CRN for this instance template.
+ :param InstanceDefaultTrustedProfilePrototype default_trusted_profile:
+ (optional) The default trusted profile configuration to use for this virtual
+ server instance
+ This property's value is used when provisioning the virtual server instance, but
+ not subsequently managed. Accordingly, it is reflected as an [instance
+ initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
+ property.
+ :param str href: The URL for this instance template.
+ :param str id: The unique identifier 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, the keys of type `rsa` must be specified, and one will be
+ selected to encrypt [the administrator
+ password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys
+ are optional for other images, but if no keys are specified, the instance will
+ be inaccessible unless the specified image provides another means of access.
+ This property's value is used when provisioning the virtual server instance, but
+ not subsequently managed. Accordingly, it is reflected as an [instance
+ initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
+ property.
+ :param InstanceMetadataServicePrototype metadata_service: (optional)
+ :param str name: The name for this instance template. The name is unique across
+ all instance templates in the region.
+ :param InstancePlacementTargetPrototype placement_target: (optional) The
+ placement restrictions to use for the virtual server instance.
+ If specified, `reservation_affinity.policy` must be `disabled`.
+ :param InstanceProfileIdentity profile: (optional) The
+ [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this
+ virtual server instance.
+ If unspecified, `bx2-2x8` will be used, but this default value is expected to
+ change in the future.
+ :param InstanceReservationAffinityPrototype reservation_affinity: (optional)
+ :param ResourceGroupReference resource_group: The resource group for this
+ instance template.
+ :param int total_volume_bandwidth: (optional) The amount of bandwidth (in
+ megabits per second) allocated exclusively to instance storage volumes. An
+ increase in this value will result in a corresponding decrease to
+ `total_network_bandwidth`.
+ :param str user_data: (optional) [User
+ data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when
+ setting up the virtual server instance.
+ :param List[VolumeAttachmentPrototype] volume_attachments: (optional) The
+ additional volume attachments to create for the virtual server instance.
+ :param VPCIdentity vpc: (optional) The VPC this virtual server instance will
+ reside in.
+ If specified, it must match the VPC for the subnets of the instance network
+ attachments or instance network interfaces.
+ :param VolumeAttachmentPrototypeInstanceBySourceSnapshotContext
+ boot_volume_attachment: The boot volume attachment to create for the virtual
+ server instance.
+ :param List[NetworkInterfacePrototype] network_interfaces: (optional) The
+ additional instance network interfaces to create.
+ :param ZoneIdentity zone: The zone this virtual server instance will reside in.
+ :param List[InstanceNetworkAttachmentPrototype] network_attachments: (optional)
+ The additional network attachments to create for the virtual server instance.
+ :param InstanceNetworkAttachmentPrototype primary_network_attachment: The
+ primary network attachment to create for the virtual server instance.
"""
def __init__(
self,
+ created_at: datetime,
+ crn: str,
href: str,
+ id: str,
+ name: str,
+ resource_group: 'ResourceGroupReference',
+ boot_volume_attachment: 'VolumeAttachmentPrototypeInstanceBySourceSnapshotContext',
+ zone: 'ZoneIdentity',
+ primary_network_attachment: 'InstanceNetworkAttachmentPrototype',
+ *,
+ availability_policy: Optional['InstanceAvailabilityPolicyPrototype'] = None,
+ default_trusted_profile: Optional['InstanceDefaultTrustedProfilePrototype'] = None,
+ keys: Optional[List['KeyIdentity']] = None,
+ metadata_service: Optional['InstanceMetadataServicePrototype'] = None,
+ placement_target: Optional['InstancePlacementTargetPrototype'] = None,
+ profile: Optional['InstanceProfileIdentity'] = None,
+ reservation_affinity: Optional['InstanceReservationAffinityPrototype'] = None,
+ total_volume_bandwidth: Optional[int] = None,
+ user_data: Optional[str] = None,
+ volume_attachments: Optional[List['VolumeAttachmentPrototype']] = None,
+ vpc: Optional['VPCIdentity'] = None,
+ network_interfaces: Optional[List['NetworkInterfacePrototype']] = None,
+ network_attachments: Optional[List['InstanceNetworkAttachmentPrototype']] = None,
) -> None:
"""
- Initialize a InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByHref object.
+ Initialize a InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkAttachment object.
- :param str href: The URL for this placement group.
+ :param datetime created_at: The date and time that the instance template
+ was created.
+ :param str crn: The CRN for this instance template.
+ :param str href: The URL for this instance template.
+ :param str id: The unique identifier for this instance template.
+ :param str name: The name for this instance template. The name is unique
+ across all instance templates in the region.
+ :param ResourceGroupReference resource_group: The resource group for this
+ instance template.
+ :param VolumeAttachmentPrototypeInstanceBySourceSnapshotContext
+ boot_volume_attachment: The boot volume attachment to create for the
+ virtual server instance.
+ :param ZoneIdentity zone: The zone this virtual server instance will reside
+ in.
+ :param InstanceNetworkAttachmentPrototype primary_network_attachment: The
+ primary network attachment to create for the virtual server instance.
+ :param InstanceAvailabilityPolicyPrototype availability_policy: (optional)
+ The availability policy to use for this virtual server instance.
+ :param InstanceDefaultTrustedProfilePrototype default_trusted_profile:
+ (optional) The default trusted profile configuration to use for this
+ virtual server instance
+ This property's value is used when provisioning the virtual server
+ instance, but not subsequently managed. Accordingly, it is reflected as an
+ [instance
+ initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
+ property.
+ :param List[KeyIdentity] keys: (optional) The public SSH keys for the
+ administrative user of the virtual server instance. Keys will be made
+ available to the virtual server instance as cloud-init vendor data. For
+ cloud-init enabled images, these keys will also be added as SSH authorized
+ keys for the administrative user.
+ For Windows images, the keys of type `rsa` must be specified, and one will
+ be selected to encrypt [the administrator
+ password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization).
+ Keys are optional for other images, but if no keys are specified, the
+ instance will be inaccessible unless the specified image provides another
+ means of access.
+ This property's value is used when provisioning the virtual server
+ instance, but not subsequently managed. Accordingly, it is reflected as an
+ [instance
+ initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
+ property.
+ :param InstanceMetadataServicePrototype metadata_service: (optional)
+ :param InstancePlacementTargetPrototype placement_target: (optional) The
+ placement restrictions to use for the virtual server instance.
+ If specified, `reservation_affinity.policy` must be `disabled`.
+ :param InstanceProfileIdentity profile: (optional) The
+ [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for
+ this virtual server instance.
+ If unspecified, `bx2-2x8` will be used, but this default value is expected
+ to change in the future.
+ :param InstanceReservationAffinityPrototype reservation_affinity:
+ (optional)
+ :param int total_volume_bandwidth: (optional) The amount of bandwidth (in
+ megabits per second) allocated exclusively to instance storage volumes. An
+ increase in this value will result in a corresponding decrease to
+ `total_network_bandwidth`.
+ :param str user_data: (optional) [User
+ data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available
+ when setting up the virtual server instance.
+ :param List[VolumeAttachmentPrototype] volume_attachments: (optional) The
+ additional volume attachments to create for the virtual server instance.
+ :param VPCIdentity vpc: (optional) The VPC this virtual server instance
+ will reside in.
+ If specified, it must match the VPC for the subnets of the instance network
+ attachments or instance network interfaces.
+ :param List[NetworkInterfacePrototype] network_interfaces: (optional) The
+ additional instance network interfaces to create.
+ :param List[InstanceNetworkAttachmentPrototype] network_attachments:
+ (optional) The additional network attachments to create for the virtual
+ server instance.
"""
# pylint: disable=super-init-not-called
+ self.availability_policy = availability_policy
+ self.created_at = created_at
+ self.crn = crn
+ self.default_trusted_profile = default_trusted_profile
self.href = href
+ self.id = id
+ self.keys = keys
+ self.metadata_service = metadata_service
+ self.name = name
+ self.placement_target = placement_target
+ self.profile = profile
+ self.reservation_affinity = reservation_affinity
+ self.resource_group = resource_group
+ self.total_volume_bandwidth = total_volume_bandwidth
+ self.user_data = user_data
+ self.volume_attachments = volume_attachments
+ self.vpc = vpc
+ self.boot_volume_attachment = boot_volume_attachment
+ self.network_interfaces = network_interfaces
+ self.zone = zone
+ self.network_attachments = network_attachments
+ self.primary_network_attachment = primary_network_attachment
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByHref':
- """Initialize a InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByHref object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkAttachment':
+ """Initialize a InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkAttachment object from a json dictionary."""
args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ if (availability_policy := _dict.get('availability_policy')) is not None:
+ args['availability_policy'] = InstanceAvailabilityPolicyPrototype.from_dict(availability_policy)
+ if (created_at := _dict.get('created_at')) is not None:
+ args['created_at'] = string_to_datetime(created_at)
else:
- raise ValueError('Required property \'href\' not present in InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByHref JSON')
+ raise ValueError('Required property \'created_at\' not present in InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkAttachment JSON')
+ if (crn := _dict.get('crn')) is not None:
+ args['crn'] = crn
+ else:
+ raise ValueError('Required property \'crn\' not present in InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkAttachment JSON')
+ if (default_trusted_profile := _dict.get('default_trusted_profile')) is not None:
+ args['default_trusted_profile'] = InstanceDefaultTrustedProfilePrototype.from_dict(default_trusted_profile)
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
+ else:
+ raise ValueError('Required property \'href\' not present in InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkAttachment JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
+ else:
+ raise ValueError('Required property \'id\' not present in InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkAttachment JSON')
+ if (keys := _dict.get('keys')) is not None:
+ args['keys'] = keys
+ if (metadata_service := _dict.get('metadata_service')) is not None:
+ args['metadata_service'] = InstanceMetadataServicePrototype.from_dict(metadata_service)
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ else:
+ raise ValueError('Required property \'name\' not present in InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkAttachment JSON')
+ if (placement_target := _dict.get('placement_target')) is not None:
+ args['placement_target'] = placement_target
+ if (profile := _dict.get('profile')) is not None:
+ args['profile'] = profile
+ if (reservation_affinity := _dict.get('reservation_affinity')) is not None:
+ args['reservation_affinity'] = InstanceReservationAffinityPrototype.from_dict(reservation_affinity)
+ if (resource_group := _dict.get('resource_group')) is not None:
+ args['resource_group'] = ResourceGroupReference.from_dict(resource_group)
+ else:
+ raise ValueError('Required property \'resource_group\' not present in InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkAttachment JSON')
+ if (total_volume_bandwidth := _dict.get('total_volume_bandwidth')) is not None:
+ args['total_volume_bandwidth'] = total_volume_bandwidth
+ if (user_data := _dict.get('user_data')) is not None:
+ args['user_data'] = user_data
+ if (volume_attachments := _dict.get('volume_attachments')) is not None:
+ args['volume_attachments'] = [VolumeAttachmentPrototype.from_dict(v) for v in volume_attachments]
+ if (vpc := _dict.get('vpc')) is not None:
+ args['vpc'] = vpc
+ if (boot_volume_attachment := _dict.get('boot_volume_attachment')) is not None:
+ args['boot_volume_attachment'] = VolumeAttachmentPrototypeInstanceBySourceSnapshotContext.from_dict(boot_volume_attachment)
+ else:
+ raise ValueError('Required property \'boot_volume_attachment\' not present in InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkAttachment JSON')
+ if (network_interfaces := _dict.get('network_interfaces')) is not None:
+ args['network_interfaces'] = [NetworkInterfacePrototype.from_dict(v) for v in network_interfaces]
+ if (zone := _dict.get('zone')) is not None:
+ args['zone'] = zone
+ else:
+ raise ValueError('Required property \'zone\' not present in InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkAttachment JSON')
+ if (network_attachments := _dict.get('network_attachments')) is not None:
+ args['network_attachments'] = [InstanceNetworkAttachmentPrototype.from_dict(v) for v in network_attachments]
+ if (primary_network_attachment := _dict.get('primary_network_attachment')) is not None:
+ args['primary_network_attachment'] = InstanceNetworkAttachmentPrototype.from_dict(primary_network_attachment)
+ else:
+ raise ValueError('Required property \'primary_network_attachment\' not present in InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkAttachment JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByHref object from a json dictionary."""
+ """Initialize a InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkAttachment object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
+ if hasattr(self, 'availability_policy') and self.availability_policy is not None:
+ if isinstance(self.availability_policy, dict):
+ _dict['availability_policy'] = self.availability_policy
+ else:
+ _dict['availability_policy'] = self.availability_policy.to_dict()
+ if hasattr(self, 'created_at') and self.created_at is not None:
+ _dict['created_at'] = datetime_to_string(self.created_at)
+ if hasattr(self, 'crn') and self.crn is not None:
+ _dict['crn'] = self.crn
+ if hasattr(self, 'default_trusted_profile') and self.default_trusted_profile is not None:
+ if isinstance(self.default_trusted_profile, dict):
+ _dict['default_trusted_profile'] = self.default_trusted_profile
+ else:
+ _dict['default_trusted_profile'] = self.default_trusted_profile.to_dict()
if hasattr(self, 'href') and self.href is not None:
_dict['href'] = self.href
+ if hasattr(self, 'id') and self.id is not None:
+ _dict['id'] = self.id
+ if hasattr(self, 'keys') and self.keys is not None:
+ keys_list = []
+ for v in self.keys:
+ if isinstance(v, dict):
+ keys_list.append(v)
+ else:
+ keys_list.append(v.to_dict())
+ _dict['keys'] = keys_list
+ if hasattr(self, 'metadata_service') and self.metadata_service is not None:
+ if isinstance(self.metadata_service, dict):
+ _dict['metadata_service'] = self.metadata_service
+ else:
+ _dict['metadata_service'] = self.metadata_service.to_dict()
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ if hasattr(self, 'placement_target') and self.placement_target is not None:
+ if isinstance(self.placement_target, dict):
+ _dict['placement_target'] = self.placement_target
+ else:
+ _dict['placement_target'] = self.placement_target.to_dict()
+ if hasattr(self, 'profile') and self.profile is not None:
+ if isinstance(self.profile, dict):
+ _dict['profile'] = self.profile
+ else:
+ _dict['profile'] = self.profile.to_dict()
+ if hasattr(self, 'reservation_affinity') and self.reservation_affinity is not None:
+ if isinstance(self.reservation_affinity, dict):
+ _dict['reservation_affinity'] = self.reservation_affinity
+ else:
+ _dict['reservation_affinity'] = self.reservation_affinity.to_dict()
+ if hasattr(self, 'resource_group') and self.resource_group is not None:
+ if isinstance(self.resource_group, dict):
+ _dict['resource_group'] = self.resource_group
+ else:
+ _dict['resource_group'] = self.resource_group.to_dict()
+ if hasattr(self, 'total_volume_bandwidth') and self.total_volume_bandwidth is not None:
+ _dict['total_volume_bandwidth'] = self.total_volume_bandwidth
+ if hasattr(self, 'user_data') and self.user_data is not None:
+ _dict['user_data'] = self.user_data
+ if hasattr(self, 'volume_attachments') and self.volume_attachments is not None:
+ volume_attachments_list = []
+ for v in self.volume_attachments:
+ if isinstance(v, dict):
+ volume_attachments_list.append(v)
+ else:
+ volume_attachments_list.append(v.to_dict())
+ _dict['volume_attachments'] = volume_attachments_list
+ if hasattr(self, 'vpc') and self.vpc is not None:
+ if isinstance(self.vpc, dict):
+ _dict['vpc'] = self.vpc
+ else:
+ _dict['vpc'] = self.vpc.to_dict()
+ if hasattr(self, 'boot_volume_attachment') and self.boot_volume_attachment is not None:
+ if isinstance(self.boot_volume_attachment, dict):
+ _dict['boot_volume_attachment'] = self.boot_volume_attachment
+ else:
+ _dict['boot_volume_attachment'] = self.boot_volume_attachment.to_dict()
+ if hasattr(self, 'network_interfaces') and self.network_interfaces is not None:
+ network_interfaces_list = []
+ for v in self.network_interfaces:
+ if isinstance(v, dict):
+ network_interfaces_list.append(v)
+ else:
+ network_interfaces_list.append(v.to_dict())
+ _dict['network_interfaces'] = network_interfaces_list
+ if hasattr(self, 'zone') and self.zone is not None:
+ if isinstance(self.zone, dict):
+ _dict['zone'] = self.zone
+ else:
+ _dict['zone'] = self.zone.to_dict()
+ if hasattr(self, 'network_attachments') and self.network_attachments is not None:
+ network_attachments_list = []
+ for v in self.network_attachments:
+ if isinstance(v, dict):
+ network_attachments_list.append(v)
+ else:
+ network_attachments_list.append(v.to_dict())
+ _dict['network_attachments'] = network_attachments_list
+ if hasattr(self, 'primary_network_attachment') and self.primary_network_attachment is not None:
+ if isinstance(self.primary_network_attachment, dict):
+ _dict['primary_network_attachment'] = self.primary_network_attachment
+ else:
+ _dict['primary_network_attachment'] = self.primary_network_attachment.to_dict()
return _dict
def _to_dict(self):
@@ -126412,59 +146913,407 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByHref object."""
+ """Return a `str` version of this InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkAttachment object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByHref') -> bool:
+ def __eq__(self, other: 'InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkAttachment') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByHref') -> bool:
+ def __ne__(self, other: 'InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkAttachment') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityById(InstancePlacementTargetPrototypePlacementGroupIdentity):
+class InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkInterface(InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext):
"""
- InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityById.
+ InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkInterface.
- :attr str id: The unique identifier for this placement group.
+ :param InstanceAvailabilityPolicyPrototype availability_policy: (optional) The
+ availability policy to use for this virtual server instance.
+ :param datetime created_at: The date and time that the instance template was
+ created.
+ :param str crn: The CRN for this instance template.
+ :param InstanceDefaultTrustedProfilePrototype default_trusted_profile:
+ (optional) The default trusted profile configuration to use for this virtual
+ server instance
+ This property's value is used when provisioning the virtual server instance, but
+ not subsequently managed. Accordingly, it is reflected as an [instance
+ initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
+ property.
+ :param str href: The URL for this instance template.
+ :param str id: The unique identifier 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, the keys of type `rsa` must be specified, and one will be
+ selected to encrypt [the administrator
+ password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys
+ are optional for other images, but if no keys are specified, the instance will
+ be inaccessible unless the specified image provides another means of access.
+ This property's value is used when provisioning the virtual server instance, but
+ not subsequently managed. Accordingly, it is reflected as an [instance
+ initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
+ property.
+ :param InstanceMetadataServicePrototype metadata_service: (optional)
+ :param str name: The name for this instance template. The name is unique across
+ all instance templates in the region.
+ :param InstancePlacementTargetPrototype placement_target: (optional) The
+ placement restrictions to use for the virtual server instance.
+ If specified, `reservation_affinity.policy` must be `disabled`.
+ :param InstanceProfileIdentity profile: (optional) The
+ [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this
+ virtual server instance.
+ If unspecified, `bx2-2x8` will be used, but this default value is expected to
+ change in the future.
+ :param InstanceReservationAffinityPrototype reservation_affinity: (optional)
+ :param ResourceGroupReference resource_group: The resource group for this
+ instance template.
+ :param int total_volume_bandwidth: (optional) The amount of bandwidth (in
+ megabits per second) allocated exclusively to instance storage volumes. An
+ increase in this value will result in a corresponding decrease to
+ `total_network_bandwidth`.
+ :param str user_data: (optional) [User
+ data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when
+ setting up the virtual server instance.
+ :param List[VolumeAttachmentPrototype] volume_attachments: (optional) The
+ additional volume attachments to create for the virtual server instance.
+ :param VPCIdentity vpc: (optional) The VPC this virtual server instance will
+ reside in.
+ If specified, it must match the VPC for the subnets of the instance network
+ attachments or instance network interfaces.
+ :param VolumeAttachmentPrototypeInstanceBySourceSnapshotContext
+ boot_volume_attachment: The boot volume attachment to create for the virtual
+ server instance.
+ :param List[InstanceNetworkAttachmentPrototype] network_attachments: (optional)
+ The additional network attachments to create for the virtual server instance.
+ :param InstanceNetworkAttachmentPrototype primary_network_attachment: (optional)
+ The primary network attachment to create for the virtual server instance.
+ :param ZoneIdentity zone: The zone this virtual server instance will reside in.
+ :param List[NetworkInterfacePrototype] network_interfaces: (optional) The
+ additional instance network interfaces to create.
+ :param NetworkInterfacePrototype primary_network_interface: The primary instance
+ network interface to create.
"""
def __init__(
self,
+ created_at: datetime,
+ crn: str,
+ href: str,
id: str,
+ name: str,
+ resource_group: 'ResourceGroupReference',
+ boot_volume_attachment: 'VolumeAttachmentPrototypeInstanceBySourceSnapshotContext',
+ zone: 'ZoneIdentity',
+ primary_network_interface: 'NetworkInterfacePrototype',
+ *,
+ availability_policy: Optional['InstanceAvailabilityPolicyPrototype'] = None,
+ default_trusted_profile: Optional['InstanceDefaultTrustedProfilePrototype'] = None,
+ keys: Optional[List['KeyIdentity']] = None,
+ metadata_service: Optional['InstanceMetadataServicePrototype'] = None,
+ placement_target: Optional['InstancePlacementTargetPrototype'] = None,
+ profile: Optional['InstanceProfileIdentity'] = None,
+ reservation_affinity: Optional['InstanceReservationAffinityPrototype'] = None,
+ total_volume_bandwidth: Optional[int] = None,
+ user_data: Optional[str] = None,
+ volume_attachments: Optional[List['VolumeAttachmentPrototype']] = None,
+ vpc: Optional['VPCIdentity'] = None,
+ network_attachments: Optional[List['InstanceNetworkAttachmentPrototype']] = None,
+ primary_network_attachment: Optional['InstanceNetworkAttachmentPrototype'] = None,
+ network_interfaces: Optional[List['NetworkInterfacePrototype']] = None,
) -> None:
"""
- Initialize a InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityById object.
+ Initialize a InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkInterface object.
- :param str id: The unique identifier for this placement group.
+ :param datetime created_at: The date and time that the instance template
+ was created.
+ :param str crn: The CRN for this instance template.
+ :param str href: The URL for this instance template.
+ :param str id: The unique identifier for this instance template.
+ :param str name: The name for this instance template. The name is unique
+ across all instance templates in the region.
+ :param ResourceGroupReference resource_group: The resource group for this
+ instance template.
+ :param VolumeAttachmentPrototypeInstanceBySourceSnapshotContext
+ boot_volume_attachment: The boot volume attachment to create for the
+ virtual server instance.
+ :param ZoneIdentity zone: The zone this virtual server instance will reside
+ in.
+ :param NetworkInterfacePrototype primary_network_interface: The primary
+ instance network interface to create.
+ :param InstanceAvailabilityPolicyPrototype availability_policy: (optional)
+ The availability policy to use for this virtual server instance.
+ :param InstanceDefaultTrustedProfilePrototype default_trusted_profile:
+ (optional) The default trusted profile configuration to use for this
+ virtual server instance
+ This property's value is used when provisioning the virtual server
+ instance, but not subsequently managed. Accordingly, it is reflected as an
+ [instance
+ initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
+ property.
+ :param List[KeyIdentity] keys: (optional) The public SSH keys for the
+ administrative user of the virtual server instance. Keys will be made
+ available to the virtual server instance as cloud-init vendor data. For
+ cloud-init enabled images, these keys will also be added as SSH authorized
+ keys for the administrative user.
+ For Windows images, the keys of type `rsa` must be specified, and one will
+ be selected to encrypt [the administrator
+ password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization).
+ Keys are optional for other images, but if no keys are specified, the
+ instance will be inaccessible unless the specified image provides another
+ means of access.
+ This property's value is used when provisioning the virtual server
+ instance, but not subsequently managed. Accordingly, it is reflected as an
+ [instance
+ initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
+ property.
+ :param InstanceMetadataServicePrototype metadata_service: (optional)
+ :param InstancePlacementTargetPrototype placement_target: (optional) The
+ placement restrictions to use for the virtual server instance.
+ If specified, `reservation_affinity.policy` must be `disabled`.
+ :param InstanceProfileIdentity profile: (optional) The
+ [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for
+ this virtual server instance.
+ If unspecified, `bx2-2x8` will be used, but this default value is expected
+ to change in the future.
+ :param InstanceReservationAffinityPrototype reservation_affinity:
+ (optional)
+ :param int total_volume_bandwidth: (optional) The amount of bandwidth (in
+ megabits per second) allocated exclusively to instance storage volumes. An
+ increase in this value will result in a corresponding decrease to
+ `total_network_bandwidth`.
+ :param str user_data: (optional) [User
+ data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available
+ when setting up the virtual server instance.
+ :param List[VolumeAttachmentPrototype] volume_attachments: (optional) The
+ additional volume attachments to create for the virtual server instance.
+ :param VPCIdentity vpc: (optional) The VPC this virtual server instance
+ will reside in.
+ If specified, it must match the VPC for the subnets of the instance network
+ attachments or instance network interfaces.
+ :param List[InstanceNetworkAttachmentPrototype] network_attachments:
+ (optional) The additional network attachments to create for the virtual
+ server instance.
+ :param InstanceNetworkAttachmentPrototype primary_network_attachment:
+ (optional) The primary network attachment to create for the virtual server
+ instance.
+ :param List[NetworkInterfacePrototype] network_interfaces: (optional) The
+ additional instance network interfaces to create.
"""
# pylint: disable=super-init-not-called
+ self.availability_policy = availability_policy
+ self.created_at = created_at
+ self.crn = crn
+ self.default_trusted_profile = default_trusted_profile
+ self.href = href
self.id = id
+ self.keys = keys
+ self.metadata_service = metadata_service
+ self.name = name
+ self.placement_target = placement_target
+ self.profile = profile
+ self.reservation_affinity = reservation_affinity
+ self.resource_group = resource_group
+ self.total_volume_bandwidth = total_volume_bandwidth
+ self.user_data = user_data
+ self.volume_attachments = volume_attachments
+ self.vpc = vpc
+ self.boot_volume_attachment = boot_volume_attachment
+ self.network_attachments = network_attachments
+ self.primary_network_attachment = primary_network_attachment
+ self.zone = zone
+ self.network_interfaces = network_interfaces
+ self.primary_network_interface = primary_network_interface
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityById':
- """Initialize a InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityById object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkInterface':
+ """Initialize a InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkInterface object from a json dictionary."""
args = {}
- if 'id' in _dict:
- args['id'] = _dict.get('id')
+ if (availability_policy := _dict.get('availability_policy')) is not None:
+ args['availability_policy'] = InstanceAvailabilityPolicyPrototype.from_dict(availability_policy)
+ if (created_at := _dict.get('created_at')) is not None:
+ args['created_at'] = string_to_datetime(created_at)
else:
- raise ValueError('Required property \'id\' not present in InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityById JSON')
+ raise ValueError('Required property \'created_at\' not present in InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkInterface JSON')
+ if (crn := _dict.get('crn')) is not None:
+ args['crn'] = crn
+ else:
+ raise ValueError('Required property \'crn\' not present in InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkInterface JSON')
+ if (default_trusted_profile := _dict.get('default_trusted_profile')) is not None:
+ args['default_trusted_profile'] = InstanceDefaultTrustedProfilePrototype.from_dict(default_trusted_profile)
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
+ else:
+ raise ValueError('Required property \'href\' not present in InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkInterface JSON')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
+ else:
+ raise ValueError('Required property \'id\' not present in InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkInterface JSON')
+ if (keys := _dict.get('keys')) is not None:
+ args['keys'] = keys
+ if (metadata_service := _dict.get('metadata_service')) is not None:
+ args['metadata_service'] = InstanceMetadataServicePrototype.from_dict(metadata_service)
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ else:
+ raise ValueError('Required property \'name\' not present in InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkInterface JSON')
+ if (placement_target := _dict.get('placement_target')) is not None:
+ args['placement_target'] = placement_target
+ if (profile := _dict.get('profile')) is not None:
+ args['profile'] = profile
+ if (reservation_affinity := _dict.get('reservation_affinity')) is not None:
+ args['reservation_affinity'] = InstanceReservationAffinityPrototype.from_dict(reservation_affinity)
+ if (resource_group := _dict.get('resource_group')) is not None:
+ args['resource_group'] = ResourceGroupReference.from_dict(resource_group)
+ else:
+ raise ValueError('Required property \'resource_group\' not present in InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkInterface JSON')
+ if (total_volume_bandwidth := _dict.get('total_volume_bandwidth')) is not None:
+ args['total_volume_bandwidth'] = total_volume_bandwidth
+ if (user_data := _dict.get('user_data')) is not None:
+ args['user_data'] = user_data
+ if (volume_attachments := _dict.get('volume_attachments')) is not None:
+ args['volume_attachments'] = [VolumeAttachmentPrototype.from_dict(v) for v in volume_attachments]
+ if (vpc := _dict.get('vpc')) is not None:
+ args['vpc'] = vpc
+ if (boot_volume_attachment := _dict.get('boot_volume_attachment')) is not None:
+ args['boot_volume_attachment'] = VolumeAttachmentPrototypeInstanceBySourceSnapshotContext.from_dict(boot_volume_attachment)
+ else:
+ raise ValueError('Required property \'boot_volume_attachment\' not present in InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkInterface JSON')
+ if (network_attachments := _dict.get('network_attachments')) is not None:
+ args['network_attachments'] = [InstanceNetworkAttachmentPrototype.from_dict(v) for v in network_attachments]
+ if (primary_network_attachment := _dict.get('primary_network_attachment')) is not None:
+ args['primary_network_attachment'] = InstanceNetworkAttachmentPrototype.from_dict(primary_network_attachment)
+ if (zone := _dict.get('zone')) is not None:
+ args['zone'] = zone
+ else:
+ raise ValueError('Required property \'zone\' not present in InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkInterface JSON')
+ if (network_interfaces := _dict.get('network_interfaces')) is not None:
+ args['network_interfaces'] = [NetworkInterfacePrototype.from_dict(v) for v in network_interfaces]
+ if (primary_network_interface := _dict.get('primary_network_interface')) is not None:
+ args['primary_network_interface'] = NetworkInterfacePrototype.from_dict(primary_network_interface)
+ else:
+ raise ValueError('Required property \'primary_network_interface\' not present in InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkInterface JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityById object from a json dictionary."""
+ """Initialize a InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkInterface object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
+ if hasattr(self, 'availability_policy') and self.availability_policy is not None:
+ if isinstance(self.availability_policy, dict):
+ _dict['availability_policy'] = self.availability_policy
+ else:
+ _dict['availability_policy'] = self.availability_policy.to_dict()
+ if hasattr(self, 'created_at') and self.created_at is not None:
+ _dict['created_at'] = datetime_to_string(self.created_at)
+ if hasattr(self, 'crn') and self.crn is not None:
+ _dict['crn'] = self.crn
+ if hasattr(self, 'default_trusted_profile') and self.default_trusted_profile is not None:
+ if isinstance(self.default_trusted_profile, dict):
+ _dict['default_trusted_profile'] = self.default_trusted_profile
+ else:
+ _dict['default_trusted_profile'] = self.default_trusted_profile.to_dict()
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
if hasattr(self, 'id') and self.id is not None:
_dict['id'] = self.id
+ if hasattr(self, 'keys') and self.keys is not None:
+ keys_list = []
+ for v in self.keys:
+ if isinstance(v, dict):
+ keys_list.append(v)
+ else:
+ keys_list.append(v.to_dict())
+ _dict['keys'] = keys_list
+ if hasattr(self, 'metadata_service') and self.metadata_service is not None:
+ if isinstance(self.metadata_service, dict):
+ _dict['metadata_service'] = self.metadata_service
+ else:
+ _dict['metadata_service'] = self.metadata_service.to_dict()
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ if hasattr(self, 'placement_target') and self.placement_target is not None:
+ if isinstance(self.placement_target, dict):
+ _dict['placement_target'] = self.placement_target
+ else:
+ _dict['placement_target'] = self.placement_target.to_dict()
+ if hasattr(self, 'profile') and self.profile is not None:
+ if isinstance(self.profile, dict):
+ _dict['profile'] = self.profile
+ else:
+ _dict['profile'] = self.profile.to_dict()
+ if hasattr(self, 'reservation_affinity') and self.reservation_affinity is not None:
+ if isinstance(self.reservation_affinity, dict):
+ _dict['reservation_affinity'] = self.reservation_affinity
+ else:
+ _dict['reservation_affinity'] = self.reservation_affinity.to_dict()
+ if hasattr(self, 'resource_group') and self.resource_group is not None:
+ if isinstance(self.resource_group, dict):
+ _dict['resource_group'] = self.resource_group
+ else:
+ _dict['resource_group'] = self.resource_group.to_dict()
+ if hasattr(self, 'total_volume_bandwidth') and self.total_volume_bandwidth is not None:
+ _dict['total_volume_bandwidth'] = self.total_volume_bandwidth
+ if hasattr(self, 'user_data') and self.user_data is not None:
+ _dict['user_data'] = self.user_data
+ if hasattr(self, 'volume_attachments') and self.volume_attachments is not None:
+ volume_attachments_list = []
+ for v in self.volume_attachments:
+ if isinstance(v, dict):
+ volume_attachments_list.append(v)
+ else:
+ volume_attachments_list.append(v.to_dict())
+ _dict['volume_attachments'] = volume_attachments_list
+ if hasattr(self, 'vpc') and self.vpc is not None:
+ if isinstance(self.vpc, dict):
+ _dict['vpc'] = self.vpc
+ else:
+ _dict['vpc'] = self.vpc.to_dict()
+ if hasattr(self, 'boot_volume_attachment') and self.boot_volume_attachment is not None:
+ if isinstance(self.boot_volume_attachment, dict):
+ _dict['boot_volume_attachment'] = self.boot_volume_attachment
+ else:
+ _dict['boot_volume_attachment'] = self.boot_volume_attachment.to_dict()
+ if hasattr(self, 'network_attachments') and self.network_attachments is not None:
+ network_attachments_list = []
+ for v in self.network_attachments:
+ if isinstance(v, dict):
+ network_attachments_list.append(v)
+ else:
+ network_attachments_list.append(v.to_dict())
+ _dict['network_attachments'] = network_attachments_list
+ if hasattr(self, 'primary_network_attachment') and self.primary_network_attachment is not None:
+ if isinstance(self.primary_network_attachment, dict):
+ _dict['primary_network_attachment'] = self.primary_network_attachment
+ else:
+ _dict['primary_network_attachment'] = self.primary_network_attachment.to_dict()
+ if hasattr(self, 'zone') and self.zone is not None:
+ if isinstance(self.zone, dict):
+ _dict['zone'] = self.zone
+ else:
+ _dict['zone'] = self.zone.to_dict()
+ if hasattr(self, 'network_interfaces') and self.network_interfaces is not None:
+ network_interfaces_list = []
+ for v in self.network_interfaces:
+ if isinstance(v, dict):
+ network_interfaces_list.append(v)
+ else:
+ network_interfaces_list.append(v.to_dict())
+ _dict['network_interfaces'] = network_interfaces_list
+ if hasattr(self, 'primary_network_interface') and self.primary_network_interface is not None:
+ if isinstance(self.primary_network_interface, dict):
+ _dict['primary_network_interface'] = self.primary_network_interface
+ else:
+ _dict['primary_network_interface'] = self.primary_network_interface.to_dict()
return _dict
def _to_dict(self):
@@ -126472,16 +147321,16 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityById object."""
+ """Return a `str` version of this InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkInterface object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityById') -> bool:
+ def __eq__(self, other: 'InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkInterface') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityById') -> bool:
+ def __ne__(self, other: 'InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkInterface') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
@@ -126490,7 +147339,7 @@ class LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerP
"""
LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityByHref.
- :attr str href: The pool's canonical URL.
+ :param str href: The pool's canonical URL.
"""
def __init__(
@@ -126509,8 +147358,8 @@ def __init__(
def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityByHref':
"""Initialize a LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityByHref object from a json dictionary."""
args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
raise ValueError('Required property \'href\' not present in LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityByHref JSON')
return cls(**args)
@@ -126550,7 +147399,7 @@ class LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerP
"""
LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityById.
- :attr str id: The unique identifier for this load balancer pool.
+ :param str id: The unique identifier for this load balancer pool.
"""
def __init__(
@@ -126569,8 +147418,8 @@ def __init__(
def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityById':
"""Initialize a LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityById object from a json dictionary."""
args = {}
- if 'id' in _dict:
- args['id'] = _dict.get('id')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
else:
raise ValueError('Required property \'id\' not present in LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityById JSON')
return cls(**args)
@@ -126610,7 +147459,7 @@ class LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalan
"""
LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityByHref.
- :attr str href: The pool's canonical URL.
+ :param str href: The pool's canonical URL.
"""
def __init__(
@@ -126629,8 +147478,8 @@ def __init__(
def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityByHref':
"""Initialize a LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityByHref object from a json dictionary."""
args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
raise ValueError('Required property \'href\' not present in LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityByHref JSON')
return cls(**args)
@@ -126670,7 +147519,7 @@ class LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalan
"""
LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityById.
- :attr str id: The unique identifier for this load balancer pool.
+ :param str id: The unique identifier for this load balancer pool.
"""
def __init__(
@@ -126689,8 +147538,8 @@ def __init__(
def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityById':
"""Initialize a LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityById object from a json dictionary."""
args = {}
- if 'id' in _dict:
- args['id'] = _dict.get('id')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
else:
raise ValueError('Required property \'id\' not present in LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityById JSON')
return cls(**args)
@@ -126730,7 +147579,7 @@ class LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByCRN
"""
LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByCRN.
- :attr str crn: The CRN for this virtual server instance.
+ :param str crn: The CRN for this virtual server instance.
"""
def __init__(
@@ -126749,8 +147598,8 @@ def __init__(
def from_dict(cls, _dict: Dict) -> 'LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByCRN':
"""Initialize a LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByCRN object from a json dictionary."""
args = {}
- if 'crn' in _dict:
- args['crn'] = _dict.get('crn')
+ if (crn := _dict.get('crn')) is not None:
+ args['crn'] = crn
else:
raise ValueError('Required property \'crn\' not present in LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByCRN JSON')
return cls(**args)
@@ -126790,7 +147639,7 @@ class LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByHre
"""
LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByHref.
- :attr str href: The URL for this virtual server instance.
+ :param str href: The URL for this virtual server instance.
"""
def __init__(
@@ -126809,8 +147658,8 @@ def __init__(
def from_dict(cls, _dict: Dict) -> 'LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByHref':
"""Initialize a LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByHref object from a json dictionary."""
args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
raise ValueError('Required property \'href\' not present in LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByHref JSON')
return cls(**args)
@@ -126850,7 +147699,7 @@ class LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById(
"""
LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById.
- :attr str id: The unique identifier for this virtual server instance.
+ :param str id: The unique identifier for this virtual server instance.
"""
def __init__(
@@ -126869,8 +147718,8 @@ def __init__(
def from_dict(cls, _dict: Dict) -> 'LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById':
"""Initialize a LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById object from a json dictionary."""
args = {}
- if 'id' in _dict:
- args['id'] = _dict.get('id')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
else:
raise ValueError('Required property \'id\' not present in LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById JSON')
return cls(**args)
@@ -126910,7 +147759,7 @@ class NetworkInterfaceIPPrototypeReservedIPIdentityByHref(NetworkInterfaceIPProt
"""
NetworkInterfaceIPPrototypeReservedIPIdentityByHref.
- :attr str href: The URL for this reserved IP.
+ :param str href: The URL for this reserved IP.
"""
def __init__(
@@ -126929,8 +147778,8 @@ def __init__(
def from_dict(cls, _dict: Dict) -> 'NetworkInterfaceIPPrototypeReservedIPIdentityByHref':
"""Initialize a NetworkInterfaceIPPrototypeReservedIPIdentityByHref object from a json dictionary."""
args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
raise ValueError('Required property \'href\' not present in NetworkInterfaceIPPrototypeReservedIPIdentityByHref JSON')
return cls(**args)
@@ -126970,7 +147819,7 @@ class NetworkInterfaceIPPrototypeReservedIPIdentityById(NetworkInterfaceIPProtot
"""
NetworkInterfaceIPPrototypeReservedIPIdentityById.
- :attr str id: The unique identifier for this reserved IP.
+ :param str id: The unique identifier for this reserved IP.
"""
def __init__(
@@ -126989,8 +147838,8 @@ def __init__(
def from_dict(cls, _dict: Dict) -> 'NetworkInterfaceIPPrototypeReservedIPIdentityById':
"""Initialize a NetworkInterfaceIPPrototypeReservedIPIdentityById object from a json dictionary."""
args = {}
- if 'id' in _dict:
- args['id'] = _dict.get('id')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
else:
raise ValueError('Required property \'id\' not present in NetworkInterfaceIPPrototypeReservedIPIdentityById JSON')
return cls(**args)
@@ -127030,7 +147879,7 @@ class PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByAddr
"""
PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByAddress.
- :attr str address: The globally unique IP address.
+ :param str address: The globally unique IP address.
"""
def __init__(
@@ -127049,8 +147898,8 @@ def __init__(
def from_dict(cls, _dict: Dict) -> 'PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByAddress':
"""Initialize a PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByAddress object from a json dictionary."""
args = {}
- if 'address' in _dict:
- args['address'] = _dict.get('address')
+ if (address := _dict.get('address')) is not None:
+ args['address'] = address
else:
raise ValueError('Required property \'address\' not present in PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByAddress JSON')
return cls(**args)
@@ -127090,7 +147939,7 @@ class PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByCRN(
"""
PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByCRN.
- :attr str crn: The CRN for this floating IP.
+ :param str crn: The CRN for this floating IP.
"""
def __init__(
@@ -127109,8 +147958,8 @@ def __init__(
def from_dict(cls, _dict: Dict) -> 'PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByCRN':
"""Initialize a PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByCRN object from a json dictionary."""
args = {}
- if 'crn' in _dict:
- args['crn'] = _dict.get('crn')
+ if (crn := _dict.get('crn')) is not None:
+ args['crn'] = crn
else:
raise ValueError('Required property \'crn\' not present in PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByCRN JSON')
return cls(**args)
@@ -127150,7 +147999,7 @@ class PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByHref
"""
PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByHref.
- :attr str href: The URL for this floating IP.
+ :param str href: The URL for this floating IP.
"""
def __init__(
@@ -127169,8 +148018,8 @@ def __init__(
def from_dict(cls, _dict: Dict) -> 'PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByHref':
"""Initialize a PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByHref object from a json dictionary."""
args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
raise ValueError('Required property \'href\' not present in PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByHref JSON')
return cls(**args)
@@ -127210,7 +148059,7 @@ class PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityById(P
"""
PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityById.
- :attr str id: The unique identifier for this floating IP.
+ :param str id: The unique identifier for this floating IP.
"""
def __init__(
@@ -127229,8 +148078,8 @@ def __init__(
def from_dict(cls, _dict: Dict) -> 'PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityById':
"""Initialize a PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityById object from a json dictionary."""
args = {}
- if 'id' in _dict:
- args['id'] = _dict.get('id')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
else:
raise ValueError('Required property \'id\' not present in PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityById JSON')
return cls(**args)
@@ -127270,7 +148119,7 @@ class ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByC
"""
ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByCRN.
- :attr str crn: The CRN for this endpoint gateway.
+ :param str crn: The CRN for this endpoint gateway.
"""
def __init__(
@@ -127289,8 +148138,8 @@ def __init__(
def from_dict(cls, _dict: Dict) -> 'ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByCRN':
"""Initialize a ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByCRN object from a json dictionary."""
args = {}
- if 'crn' in _dict:
- args['crn'] = _dict.get('crn')
+ if (crn := _dict.get('crn')) is not None:
+ args['crn'] = crn
else:
raise ValueError('Required property \'crn\' not present in ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByCRN JSON')
return cls(**args)
@@ -127330,7 +148179,7 @@ class ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByH
"""
ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByHref.
- :attr str href: The URL for this endpoint gateway.
+ :param str href: The URL for this endpoint gateway.
"""
def __init__(
@@ -127349,8 +148198,8 @@ def __init__(
def from_dict(cls, _dict: Dict) -> 'ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByHref':
"""Initialize a ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByHref object from a json dictionary."""
args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
raise ValueError('Required property \'href\' not present in ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByHref JSON')
return cls(**args)
@@ -127390,7 +148239,7 @@ class ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByI
"""
ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityById.
- :attr str id: The unique identifier for this endpoint gateway.
+ :param str id: The unique identifier for this endpoint gateway.
"""
def __init__(
@@ -127409,8 +148258,8 @@ def __init__(
def from_dict(cls, _dict: Dict) -> 'ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityById':
"""Initialize a ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityById object from a json dictionary."""
args = {}
- if 'id' in _dict:
- args['id'] = _dict.get('id')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
else:
raise ValueError('Required property \'id\' not present in ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityById JSON')
return cls(**args)
@@ -127446,11 +148295,191 @@ def __ne__(self, other: 'ReservedIPTargetPrototypeEndpointGatewayIdentityEndpoin
return not self == other
+class ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN(ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentity):
+ """
+ ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN.
+
+ :param str crn: The CRN for this virtual network interface.
+ """
+
+ def __init__(
+ self,
+ crn: str,
+ ) -> None:
+ """
+ Initialize a ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN object.
+
+ :param str crn: The CRN for this virtual network interface.
+ """
+ # pylint: disable=super-init-not-called
+ self.crn = crn
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN':
+ """Initialize a ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN object from a json dictionary."""
+ args = {}
+ if (crn := _dict.get('crn')) is not None:
+ args['crn'] = crn
+ else:
+ raise ValueError('Required property \'crn\' not present in ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN object from 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 ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+
+class ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref(ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentity):
+ """
+ ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref.
+
+ :param str href: The URL for this virtual network interface.
+ """
+
+ def __init__(
+ self,
+ href: str,
+ ) -> None:
+ """
+ Initialize a ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref object.
+
+ :param str href: The URL for this virtual network interface.
+ """
+ # pylint: disable=super-init-not-called
+ self.href = href
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref':
+ """Initialize a ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref object from a json dictionary."""
+ args = {}
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
+ else:
+ raise ValueError('Required property \'href\' not present in ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref object from 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 ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+
+class ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById(ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentity):
+ """
+ ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById.
+
+ :param str id: The unique identifier for this virtual network interface.
+ """
+
+ def __init__(
+ self,
+ id: str,
+ ) -> None:
+ """
+ Initialize a ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById object.
+
+ :param str id: The unique identifier for this virtual network interface.
+ """
+ # pylint: disable=super-init-not-called
+ self.id = id
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById':
+ """Initialize a ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById object from a json dictionary."""
+ args = {}
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
+ else:
+ raise ValueError('Required property \'id\' not present in ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById object from 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 ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+
class RouteNextHopPatchRouteNextHopIPRouteNextHopIPSentinelIP(RouteNextHopPatchRouteNextHopIP):
"""
RouteNextHopPatchRouteNextHopIPRouteNextHopIPSentinelIP.
- :attr str address: The sentinel IP address (`0.0.0.0`).
+ :param str address: The sentinel IP address (`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
@@ -127478,8 +148507,8 @@ def __init__(
def from_dict(cls, _dict: Dict) -> 'RouteNextHopPatchRouteNextHopIPRouteNextHopIPSentinelIP':
"""Initialize a RouteNextHopPatchRouteNextHopIPRouteNextHopIPSentinelIP object from a json dictionary."""
args = {}
- if 'address' in _dict:
- args['address'] = _dict.get('address')
+ if (address := _dict.get('address')) is not None:
+ args['address'] = address
else:
raise ValueError('Required property \'address\' not present in RouteNextHopPatchRouteNextHopIPRouteNextHopIPSentinelIP JSON')
return cls(**args)
@@ -127519,7 +148548,7 @@ class RouteNextHopPatchRouteNextHopIPRouteNextHopIPUnicastIP(RouteNextHopPatchRo
"""
RouteNextHopPatchRouteNextHopIPRouteNextHopIPUnicastIP.
- :attr str address: A unicast IP address, which must not be any of the following
+ :param str address: A unicast IP address, which must not be any of the following
values:
- `0.0.0.0` (the sentinel IP address)
- `224.0.0.0` to `239.255.255.255` (multicast IP addresses)
@@ -127555,8 +148584,8 @@ def __init__(
def from_dict(cls, _dict: Dict) -> 'RouteNextHopPatchRouteNextHopIPRouteNextHopIPUnicastIP':
"""Initialize a RouteNextHopPatchRouteNextHopIPRouteNextHopIPUnicastIP object from a json dictionary."""
args = {}
- if 'address' in _dict:
- args['address'] = _dict.get('address')
+ if (address := _dict.get('address')) is not None:
+ args['address'] = address
else:
raise ValueError('Required property \'address\' not present in RouteNextHopPatchRouteNextHopIPRouteNextHopIPUnicastIP JSON')
return cls(**args)
@@ -127596,7 +148625,7 @@ class RouteNextHopPatchVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityB
"""
RouteNextHopPatchVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityByHref.
- :attr str href: The VPN connection's canonical URL.
+ :param str href: The VPN connection's canonical URL.
"""
def __init__(
@@ -127615,8 +148644,8 @@ def __init__(
def from_dict(cls, _dict: Dict) -> 'RouteNextHopPatchVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityByHref':
"""Initialize a RouteNextHopPatchVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityByHref object from a json dictionary."""
args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
raise ValueError('Required property \'href\' not present in RouteNextHopPatchVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityByHref JSON')
return cls(**args)
@@ -127656,7 +148685,7 @@ class RouteNextHopPatchVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityB
"""
RouteNextHopPatchVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityById.
- :attr str id: The unique identifier for this VPN gateway connection.
+ :param str id: The unique identifier for this VPN gateway connection.
"""
def __init__(
@@ -127675,8 +148704,8 @@ def __init__(
def from_dict(cls, _dict: Dict) -> 'RouteNextHopPatchVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityById':
"""Initialize a RouteNextHopPatchVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityById object from a json dictionary."""
args = {}
- if 'id' in _dict:
- args['id'] = _dict.get('id')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
else:
raise ValueError('Required property \'id\' not present in RouteNextHopPatchVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityById JSON')
return cls(**args)
@@ -127716,7 +148745,7 @@ class RoutePrototypeNextHopRouteNextHopPrototypeRouteNextHopIPRouteNextHopProtot
"""
RoutePrototypeNextHopRouteNextHopPrototypeRouteNextHopIPRouteNextHopPrototypeRouteNextHopIPRouteNextHopIPSentinelIP.
- :attr str address: The sentinel IP address (`0.0.0.0`).
+ :param str address: The sentinel IP address (`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
@@ -127744,8 +148773,8 @@ def __init__(
def from_dict(cls, _dict: Dict) -> 'RoutePrototypeNextHopRouteNextHopPrototypeRouteNextHopIPRouteNextHopPrototypeRouteNextHopIPRouteNextHopIPSentinelIP':
"""Initialize a RoutePrototypeNextHopRouteNextHopPrototypeRouteNextHopIPRouteNextHopPrototypeRouteNextHopIPRouteNextHopIPSentinelIP object from a json dictionary."""
args = {}
- if 'address' in _dict:
- args['address'] = _dict.get('address')
+ if (address := _dict.get('address')) is not None:
+ args['address'] = address
else:
raise ValueError('Required property \'address\' not present in RoutePrototypeNextHopRouteNextHopPrototypeRouteNextHopIPRouteNextHopPrototypeRouteNextHopIPRouteNextHopIPSentinelIP JSON')
return cls(**args)
@@ -127785,7 +148814,7 @@ class RoutePrototypeNextHopRouteNextHopPrototypeRouteNextHopIPRouteNextHopProtot
"""
RoutePrototypeNextHopRouteNextHopPrototypeRouteNextHopIPRouteNextHopPrototypeRouteNextHopIPRouteNextHopIPUnicastIP.
- :attr str address: A unicast IP address, which must not be any of the following
+ :param str address: A unicast IP address, which must not be any of the following
values:
- `0.0.0.0` (the sentinel IP address)
- `224.0.0.0` to `239.255.255.255` (multicast IP addresses)
@@ -127821,8 +148850,8 @@ def __init__(
def from_dict(cls, _dict: Dict) -> 'RoutePrototypeNextHopRouteNextHopPrototypeRouteNextHopIPRouteNextHopPrototypeRouteNextHopIPRouteNextHopIPUnicastIP':
"""Initialize a RoutePrototypeNextHopRouteNextHopPrototypeRouteNextHopIPRouteNextHopPrototypeRouteNextHopIPRouteNextHopIPUnicastIP object from a json dictionary."""
args = {}
- if 'address' in _dict:
- args['address'] = _dict.get('address')
+ if (address := _dict.get('address')) is not None:
+ args['address'] = address
else:
raise ValueError('Required property \'address\' not present in RoutePrototypeNextHopRouteNextHopPrototypeRouteNextHopIPRouteNextHopPrototypeRouteNextHopIPRouteNextHopIPUnicastIP JSON')
return cls(**args)
@@ -127862,7 +148891,7 @@ class RoutePrototypeNextHopRouteNextHopPrototypeVPNGatewayConnectionIdentityRout
"""
RoutePrototypeNextHopRouteNextHopPrototypeVPNGatewayConnectionIdentityRouteNextHopPrototypeVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityByHref.
- :attr str href: The VPN connection's canonical URL.
+ :param str href: The VPN connection's canonical URL.
"""
def __init__(
@@ -127881,8 +148910,8 @@ def __init__(
def from_dict(cls, _dict: Dict) -> 'RoutePrototypeNextHopRouteNextHopPrototypeVPNGatewayConnectionIdentityRouteNextHopPrototypeVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityByHref':
"""Initialize a RoutePrototypeNextHopRouteNextHopPrototypeVPNGatewayConnectionIdentityRouteNextHopPrototypeVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityByHref object from a json dictionary."""
args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
raise ValueError('Required property \'href\' not present in RoutePrototypeNextHopRouteNextHopPrototypeVPNGatewayConnectionIdentityRouteNextHopPrototypeVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityByHref JSON')
return cls(**args)
@@ -127922,7 +148951,7 @@ class RoutePrototypeNextHopRouteNextHopPrototypeVPNGatewayConnectionIdentityRout
"""
RoutePrototypeNextHopRouteNextHopPrototypeVPNGatewayConnectionIdentityRouteNextHopPrototypeVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityById.
- :attr str id: The unique identifier for this VPN gateway connection.
+ :param str id: The unique identifier for this VPN gateway connection.
"""
def __init__(
@@ -127941,8 +148970,8 @@ def __init__(
def from_dict(cls, _dict: Dict) -> 'RoutePrototypeNextHopRouteNextHopPrototypeVPNGatewayConnectionIdentityRouteNextHopPrototypeVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityById':
"""Initialize a RoutePrototypeNextHopRouteNextHopPrototypeVPNGatewayConnectionIdentityRouteNextHopPrototypeVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityById object from a json dictionary."""
args = {}
- if 'id' in _dict:
- args['id'] = _dict.get('id')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
else:
raise ValueError('Required property \'id\' not present in RoutePrototypeNextHopRouteNextHopPrototypeVPNGatewayConnectionIdentityRouteNextHopPrototypeVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityById JSON')
return cls(**args)
@@ -127982,7 +149011,7 @@ class SecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityByCR
"""
SecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityByCRN.
- :attr str crn: The security group's CRN.
+ :param str crn: The security group's CRN.
"""
def __init__(
@@ -128001,8 +149030,8 @@ def __init__(
def from_dict(cls, _dict: Dict) -> 'SecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityByCRN':
"""Initialize a SecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityByCRN object from a json dictionary."""
args = {}
- if 'crn' in _dict:
- args['crn'] = _dict.get('crn')
+ if (crn := _dict.get('crn')) is not None:
+ args['crn'] = crn
else:
raise ValueError('Required property \'crn\' not present in SecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityByCRN JSON')
return cls(**args)
@@ -128042,7 +149071,7 @@ class SecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityByHr
"""
SecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityByHref.
- :attr str href: The security group's canonical URL.
+ :param str href: The security group's canonical URL.
"""
def __init__(
@@ -128061,8 +149090,8 @@ def __init__(
def from_dict(cls, _dict: Dict) -> 'SecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityByHref':
"""Initialize a SecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityByHref object from a json dictionary."""
args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
raise ValueError('Required property \'href\' not present in SecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityByHref JSON')
return cls(**args)
@@ -128102,7 +149131,7 @@ class SecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityById
"""
SecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityById.
- :attr str id: The unique identifier for this security group.
+ :param str id: The unique identifier for this security group.
"""
def __init__(
@@ -128121,8 +149150,8 @@ def __init__(
def from_dict(cls, _dict: Dict) -> 'SecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityById':
"""Initialize a SecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityById object from a json dictionary."""
args = {}
- if 'id' in _dict:
- args['id'] = _dict.get('id')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
else:
raise ValueError('Required property \'id\' not present in SecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityById JSON')
return cls(**args)
@@ -128162,7 +149191,7 @@ class SecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentity
"""
SecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityByCRN.
- :attr str crn: The security group's CRN.
+ :param str crn: The security group's CRN.
"""
def __init__(
@@ -128181,8 +149210,8 @@ def __init__(
def from_dict(cls, _dict: Dict) -> 'SecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityByCRN':
"""Initialize a SecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityByCRN object from a json dictionary."""
args = {}
- if 'crn' in _dict:
- args['crn'] = _dict.get('crn')
+ if (crn := _dict.get('crn')) is not None:
+ args['crn'] = crn
else:
raise ValueError('Required property \'crn\' not present in SecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityByCRN JSON')
return cls(**args)
@@ -128222,7 +149251,7 @@ class SecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentity
"""
SecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityByHref.
- :attr str href: The security group's canonical URL.
+ :param str href: The security group's canonical URL.
"""
def __init__(
@@ -128241,8 +149270,8 @@ def __init__(
def from_dict(cls, _dict: Dict) -> 'SecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityByHref':
"""Initialize a SecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityByHref object from a json dictionary."""
args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
raise ValueError('Required property \'href\' not present in SecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityByHref JSON')
return cls(**args)
@@ -128282,7 +149311,7 @@ class SecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentity
"""
SecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityById.
- :attr str id: The unique identifier for this security group.
+ :param str id: The unique identifier for this security group.
"""
def __init__(
@@ -128301,8 +149330,8 @@ def __init__(
def from_dict(cls, _dict: Dict) -> 'SecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityById':
"""Initialize a SecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityById object from a json dictionary."""
args = {}
- if 'id' in _dict:
- args['id'] = _dict.get('id')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
else:
raise ValueError('Required property \'id\' not present in SecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityById JSON')
return cls(**args)
@@ -128338,11 +149367,311 @@ def __ne__(self, other: 'SecurityGroupRuleRemotePrototypeSecurityGroupIdentitySe
return not self == other
+class ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN(ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentity):
+ """
+ ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN.
+
+ :param str crn: The CRN for this virtual network interface.
+ """
+
+ def __init__(
+ self,
+ crn: str,
+ ) -> None:
+ """
+ Initialize a ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN object.
+
+ :param str crn: The CRN for this virtual network interface.
+ """
+ # pylint: disable=super-init-not-called
+ self.crn = crn
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN':
+ """Initialize a ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN object from a json dictionary."""
+ args = {}
+ if (crn := _dict.get('crn')) is not None:
+ args['crn'] = crn
+ else:
+ raise ValueError('Required property \'crn\' not present in ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN object from 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 ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+
+class ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref(ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentity):
+ """
+ ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref.
+
+ :param str href: The URL for this virtual network interface.
+ """
+
+ def __init__(
+ self,
+ href: str,
+ ) -> None:
+ """
+ Initialize a ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref object.
+
+ :param str href: The URL for this virtual network interface.
+ """
+ # pylint: disable=super-init-not-called
+ self.href = href
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref':
+ """Initialize a ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref object from a json dictionary."""
+ args = {}
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
+ else:
+ raise ValueError('Required property \'href\' not present in ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref object from 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 ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+
+class ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById(ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentity):
+ """
+ ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById.
+
+ :param str id: The unique identifier for this virtual network interface.
+ """
+
+ def __init__(
+ self,
+ id: str,
+ ) -> None:
+ """
+ Initialize a ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById object.
+
+ :param str id: The unique identifier for this virtual network interface.
+ """
+ # pylint: disable=super-init-not-called
+ self.id = id
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById':
+ """Initialize a ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById object from a json dictionary."""
+ args = {}
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
+ else:
+ raise ValueError('Required property \'id\' not present in ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById object from 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 ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+
+class VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextByHref(VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContext):
+ """
+ VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextByHref.
+
+ :param str href: The URL for this reserved IP.
+ """
+
+ def __init__(
+ self,
+ href: str,
+ ) -> None:
+ """
+ Initialize a VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextByHref object.
+
+ :param str href: The URL for this reserved IP.
+ """
+ # pylint: disable=super-init-not-called
+ self.href = href
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextByHref':
+ """Initialize a VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextByHref object from a json dictionary."""
+ args = {}
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
+ else:
+ raise ValueError('Required property \'href\' not present in VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextByHref JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextByHref object from 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 VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextByHref object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextByHref') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextByHref') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+
+class VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextById(VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContext):
+ """
+ VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextById.
+
+ :param str id: The unique identifier for this reserved IP.
+ """
+
+ def __init__(
+ self,
+ id: str,
+ ) -> None:
+ """
+ Initialize a VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextById object.
+
+ :param str id: The unique identifier for this reserved IP.
+ """
+ # pylint: disable=super-init-not-called
+ self.id = id
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextById':
+ """Initialize a VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextById object from a json dictionary."""
+ args = {}
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
+ else:
+ raise ValueError('Required property \'id\' not present in VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextById JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextById object from 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 VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextById object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextById') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextById') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+
class VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContextByHref(VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContext):
"""
VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContextByHref.
- :attr str href: The URL for this reserved IP.
+ :param str href: The URL for this reserved IP.
"""
def __init__(
@@ -128361,8 +149690,8 @@ def __init__(
def from_dict(cls, _dict: Dict) -> 'VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContextByHref':
"""Initialize a VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContextByHref object from a json dictionary."""
args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
raise ValueError('Required property \'href\' not present in VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContextByHref JSON')
return cls(**args)
@@ -128402,7 +149731,7 @@ class VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkI
"""
VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContextById.
- :attr str id: The unique identifier for this reserved IP.
+ :param str id: The unique identifier for this reserved IP.
"""
def __init__(
@@ -128421,8 +149750,8 @@ def __init__(
def from_dict(cls, _dict: Dict) -> 'VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContextById':
"""Initialize a VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContextById object from a json dictionary."""
args = {}
- if 'id' in _dict:
- args['id'] = _dict.get('id')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
else:
raise ValueError('Required property \'id\' not present in VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContextById JSON')
return cls(**args)
@@ -128462,7 +149791,7 @@ class VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityByCRN(VolumeAtt
"""
VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityByCRN.
- :attr str crn: The CRN for this volume.
+ :param str crn: The CRN for this volume.
"""
def __init__(
@@ -128481,8 +149810,8 @@ def __init__(
def from_dict(cls, _dict: Dict) -> 'VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityByCRN':
"""Initialize a VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityByCRN object from a json dictionary."""
args = {}
- if 'crn' in _dict:
- args['crn'] = _dict.get('crn')
+ if (crn := _dict.get('crn')) is not None:
+ args['crn'] = crn
else:
raise ValueError('Required property \'crn\' not present in VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityByCRN JSON')
return cls(**args)
@@ -128522,7 +149851,7 @@ class VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityByHref(VolumeAt
"""
VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityByHref.
- :attr str href: The URL for this volume.
+ :param str href: The URL for this volume.
"""
def __init__(
@@ -128541,8 +149870,8 @@ def __init__(
def from_dict(cls, _dict: Dict) -> 'VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityByHref':
"""Initialize a VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityByHref object from a json dictionary."""
args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ if (href := _dict.get('href')) is not None:
+ args['href'] = href
else:
raise ValueError('Required property \'href\' not present in VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityByHref JSON')
return cls(**args)
@@ -128582,7 +149911,7 @@ class VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById(VolumeAtta
"""
VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById.
- :attr str id: The unique identifier for this volume.
+ :param str id: The unique identifier for this volume.
"""
def __init__(
@@ -128601,8 +149930,8 @@ def __init__(
def from_dict(cls, _dict: Dict) -> 'VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById':
"""Initialize a VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById object from a json dictionary."""
args = {}
- if 'id' in _dict:
- args['id'] = _dict.get('id')
+ if (id := _dict.get('id')) is not None:
+ args['id'] = id
else:
raise ValueError('Required property \'id\' not present in VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById JSON')
return cls(**args)
@@ -128642,24 +149971,24 @@ class VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototy
"""
VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity.
- :attr int iops: (optional) The maximum I/O operations per second (IOPS) to use
+ :param int iops: (optional) The maximum I/O operations per second (IOPS) to use
for this volume. Applicable only to volumes using a profile `family` of
`custom`.
- :attr str name: (optional) The name for this volume. The name must not be used
+ :param str name: (optional) The name for this volume. The name must not be used
by another volume in the region. If unspecified, the name will be a hyphenated
list of randomly-selected words.
- :attr VolumeProfileIdentity profile: The
+ :param VolumeProfileIdentity profile: The
[profile](https://cloud.ibm.com/docs/vpc?topic=vpc-block-storage-profiles) to
use for this volume.
- :attr ResourceGroupIdentity resource_group: (optional) The resource group to use
- for this volume. If unspecified, the instance's resource group will be used.
- :attr List[str] user_tags: (optional) The [user
+ :param ResourceGroupIdentity resource_group: (optional) The resource group to
+ use for this volume. If unspecified, the instance's resource group will be used.
+ :param List[str] user_tags: (optional) The [user
tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with this
volume.
- :attr int capacity: The capacity to use for the volume (in gigabytes). The
+ :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.
- :attr EncryptionKeyIdentity encryption_key: (optional) The root key to use to
+ :param EncryptionKeyIdentity encryption_key: (optional) The root key to use to
wrap the data encryption key for the volume.
If unspecified, the `encryption` type for the volume will be `provider_managed`.
"""
@@ -128669,11 +149998,11 @@ def __init__(
profile: 'VolumeProfileIdentity',
capacity: int,
*,
- iops: int = None,
- name: str = None,
- resource_group: 'ResourceGroupIdentity' = None,
- user_tags: List[str] = None,
- encryption_key: 'EncryptionKeyIdentity' = None,
+ iops: Optional[int] = None,
+ name: Optional[str] = None,
+ resource_group: Optional['ResourceGroupIdentity'] = None,
+ user_tags: Optional[List[str]] = None,
+ encryption_key: Optional['EncryptionKeyIdentity'] = None,
) -> None:
"""
Initialize a VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity object.
@@ -128714,24 +150043,24 @@ def __init__(
def from_dict(cls, _dict: Dict) -> 'VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity':
"""Initialize a VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity object from a json dictionary."""
args = {}
- if 'iops' in _dict:
- args['iops'] = _dict.get('iops')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
- if 'profile' in _dict:
- args['profile'] = _dict.get('profile')
+ if (iops := _dict.get('iops')) is not None:
+ args['iops'] = iops
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ if (profile := _dict.get('profile')) is not None:
+ args['profile'] = profile
else:
raise ValueError('Required property \'profile\' not present in VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity JSON')
- if 'resource_group' in _dict:
- args['resource_group'] = _dict.get('resource_group')
- if 'user_tags' in _dict:
- args['user_tags'] = _dict.get('user_tags')
- if 'capacity' in _dict:
- args['capacity'] = _dict.get('capacity')
+ if (resource_group := _dict.get('resource_group')) is not None:
+ args['resource_group'] = resource_group
+ if (user_tags := _dict.get('user_tags')) is not None:
+ args['user_tags'] = user_tags
+ if (capacity := _dict.get('capacity')) is not None:
+ args['capacity'] = capacity
else:
raise ValueError('Required property \'capacity\' not present in VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity JSON')
- if 'encryption_key' in _dict:
- args['encryption_key'] = _dict.get('encryption_key')
+ if (encryption_key := _dict.get('encryption_key')) is not None:
+ args['encryption_key'] = encryption_key
return cls(**args)
@classmethod
@@ -128790,28 +150119,28 @@ class VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototy
"""
VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshot.
- :attr int iops: (optional) The maximum I/O operations per second (IOPS) to use
+ :param int iops: (optional) The maximum I/O operations per second (IOPS) to use
for this volume. Applicable only to volumes using a profile `family` of
`custom`.
- :attr str name: (optional) The name for this volume. The name must not be used
+ :param str name: (optional) The name for this volume. The name must not be used
by another volume in the region. If unspecified, the name will be a hyphenated
list of randomly-selected words.
- :attr VolumeProfileIdentity profile: The
+ :param VolumeProfileIdentity profile: The
[profile](https://cloud.ibm.com/docs/vpc?topic=vpc-block-storage-profiles) to
use for this volume.
- :attr ResourceGroupIdentity resource_group: (optional) The resource group to use
- for this volume. If unspecified, the instance's resource group will be used.
- :attr List[str] user_tags: (optional) The [user
+ :param ResourceGroupIdentity resource_group: (optional) The resource group to
+ use for this volume. If unspecified, the instance's resource group will be used.
+ :param List[str] user_tags: (optional) The [user
tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with this
volume.
- :attr int capacity: (optional) The capacity to use for the volume (in
+ :param int capacity: (optional) The capacity to use for the volume (in
gigabytes). Must be at least the snapshot's
`minimum_capacity`. The maximum value may increase in the future.
If unspecified, the capacity will be the source snapshot's `minimum_capacity`.
- :attr EncryptionKeyIdentity encryption_key: (optional) The root key to use to
+ :param EncryptionKeyIdentity encryption_key: (optional) The root key to use to
wrap the data encryption key for the volume.
If unspecified, the `encryption` type for the volume will be `provider_managed`.
- :attr SnapshotIdentity source_snapshot: The snapshot from which to clone the
+ :param SnapshotIdentity source_snapshot: The snapshot from which to clone the
volume.
"""
@@ -128820,12 +150149,12 @@ def __init__(
profile: 'VolumeProfileIdentity',
source_snapshot: 'SnapshotIdentity',
*,
- iops: int = None,
- name: str = None,
- resource_group: 'ResourceGroupIdentity' = None,
- user_tags: List[str] = None,
- capacity: int = None,
- encryption_key: 'EncryptionKeyIdentity' = None,
+ iops: Optional[int] = None,
+ name: Optional[str] = None,
+ resource_group: Optional['ResourceGroupIdentity'] = None,
+ user_tags: Optional[List[str]] = None,
+ capacity: Optional[int] = None,
+ encryption_key: Optional['EncryptionKeyIdentity'] = None,
) -> None:
"""
Initialize a VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshot object.
@@ -128871,24 +150200,24 @@ def __init__(
def from_dict(cls, _dict: Dict) -> 'VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshot':
"""Initialize a VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshot object from a json dictionary."""
args = {}
- if 'iops' in _dict:
- args['iops'] = _dict.get('iops')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
- if 'profile' in _dict:
- args['profile'] = _dict.get('profile')
+ if (iops := _dict.get('iops')) is not None:
+ args['iops'] = iops
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ if (profile := _dict.get('profile')) is not None:
+ args['profile'] = profile
else:
raise ValueError('Required property \'profile\' not present in VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshot JSON')
- if 'resource_group' in _dict:
- args['resource_group'] = _dict.get('resource_group')
- if 'user_tags' in _dict:
- args['user_tags'] = _dict.get('user_tags')
- if 'capacity' in _dict:
- args['capacity'] = _dict.get('capacity')
- if 'encryption_key' in _dict:
- args['encryption_key'] = _dict.get('encryption_key')
- if 'source_snapshot' in _dict:
- args['source_snapshot'] = _dict.get('source_snapshot')
+ if (resource_group := _dict.get('resource_group')) is not None:
+ args['resource_group'] = resource_group
+ if (user_tags := _dict.get('user_tags')) is not None:
+ args['user_tags'] = user_tags
+ if (capacity := _dict.get('capacity')) is not None:
+ args['capacity'] = capacity
+ if (encryption_key := _dict.get('encryption_key')) is not None:
+ args['encryption_key'] = encryption_key
+ if (source_snapshot := _dict.get('source_snapshot')) is not None:
+ args['source_snapshot'] = source_snapshot
else:
raise ValueError('Required property \'source_snapshot\' not present in VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshot JSON')
return cls(**args)
@@ -128954,20 +150283,21 @@ class InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByGro
"""
InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByGroup.
- :attr str name: (optional) The name for this instance group manager action. The
+ :param str name: (optional) The name for this instance group manager action. The
name must not be used by another action for the instance group manager. If
unspecified, the name will be a hyphenated list of randomly-selected words.
- :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:
+ :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 InstanceGroupManagerScheduledActionGroupPrototype group:
"""
def __init__(
self,
group: 'InstanceGroupManagerScheduledActionGroupPrototype',
*,
- name: str = None,
- cron_spec: str = None,
+ name: Optional[str] = None,
+ cron_spec: Optional[str] = None,
) -> None:
"""
Initialize a InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByGroup object.
@@ -128990,12 +150320,12 @@ def __init__(
def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByGroup':
"""Initialize a InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByGroup object from a json dictionary."""
args = {}
- if 'name' in _dict:
- args['name'] = _dict.get('name')
- if 'cron_spec' in _dict:
- args['cron_spec'] = _dict.get('cron_spec')
- if 'group' in _dict:
- args['group'] = InstanceGroupManagerScheduledActionGroupPrototype.from_dict(_dict.get('group'))
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ if (cron_spec := _dict.get('cron_spec')) is not None:
+ args['cron_spec'] = cron_spec
+ if (group := _dict.get('group')) is not None:
+ args['group'] = InstanceGroupManagerScheduledActionGroupPrototype.from_dict(group)
else:
raise ValueError('Required property \'group\' not present in InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByGroup JSON')
return cls(**args)
@@ -129042,20 +150372,21 @@ class InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByMan
"""
InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByManager.
- :attr str name: (optional) The name for this instance group manager action. The
+ :param str name: (optional) The name for this instance group manager action. The
name must not be used by another action for the instance group manager. If
unspecified, the name will be a hyphenated list of randomly-selected words.
- :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:
+ :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 InstanceGroupManagerScheduledActionManagerPrototype manager:
"""
def __init__(
self,
manager: 'InstanceGroupManagerScheduledActionManagerPrototype',
*,
- name: str = None,
- cron_spec: str = None,
+ name: Optional[str] = None,
+ cron_spec: Optional[str] = None,
) -> None:
"""
Initialize a InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByManager object.
@@ -129078,12 +150409,12 @@ def __init__(
def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByManager':
"""Initialize a InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByManager object from a json dictionary."""
args = {}
- if 'name' in _dict:
- args['name'] = _dict.get('name')
- if 'cron_spec' in _dict:
- args['cron_spec'] = _dict.get('cron_spec')
- if 'manager' in _dict:
- args['manager'] = _dict.get('manager')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ if (cron_spec := _dict.get('cron_spec')) is not None:
+ args['cron_spec'] = cron_spec
+ if (manager := _dict.get('manager')) is not None:
+ args['manager'] = manager
else:
raise ValueError('Required property \'manager\' not present in InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByManager JSON')
return cls(**args)
@@ -129130,20 +150461,20 @@ class InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroup(
"""
InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroup.
- :attr str name: (optional) The name for this instance group manager action. The
+ :param str name: (optional) The name for this instance group manager action. The
name must not be used by another action for the instance group manager. If
unspecified, the name will be a hyphenated list of randomly-selected words.
- :attr datetime run_at: (optional) The date and time the scheduled action will
+ :param datetime run_at: (optional) The date and time the scheduled action will
run.
- :attr InstanceGroupManagerScheduledActionGroupPrototype group:
+ :param InstanceGroupManagerScheduledActionGroupPrototype group:
"""
def __init__(
self,
group: 'InstanceGroupManagerScheduledActionGroupPrototype',
*,
- name: str = None,
- run_at: datetime = None,
+ name: Optional[str] = None,
+ run_at: Optional[datetime] = None,
) -> None:
"""
Initialize a InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroup object.
@@ -129165,12 +150496,12 @@ def __init__(
def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroup':
"""Initialize a InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroup object from a json dictionary."""
args = {}
- 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 'group' in _dict:
- args['group'] = InstanceGroupManagerScheduledActionGroupPrototype.from_dict(_dict.get('group'))
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ if (run_at := _dict.get('run_at')) is not None:
+ args['run_at'] = string_to_datetime(run_at)
+ if (group := _dict.get('group')) is not None:
+ args['group'] = InstanceGroupManagerScheduledActionGroupPrototype.from_dict(group)
else:
raise ValueError('Required property \'group\' not present in InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroup JSON')
return cls(**args)
@@ -129217,20 +150548,20 @@ class InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByManage
"""
InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByManager.
- :attr str name: (optional) The name for this instance group manager action. The
+ :param str name: (optional) The name for this instance group manager action. The
name must not be used by another action for the instance group manager. If
unspecified, the name will be a hyphenated list of randomly-selected words.
- :attr datetime run_at: (optional) The date and time the scheduled action will
+ :param datetime run_at: (optional) The date and time the scheduled action will
run.
- :attr InstanceGroupManagerScheduledActionManagerPrototype manager:
+ :param InstanceGroupManagerScheduledActionManagerPrototype manager:
"""
def __init__(
self,
manager: 'InstanceGroupManagerScheduledActionManagerPrototype',
*,
- name: str = None,
- run_at: datetime = None,
+ name: Optional[str] = None,
+ run_at: Optional[datetime] = None,
) -> None:
"""
Initialize a InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByManager object.
@@ -129252,12 +150583,12 @@ def __init__(
def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByManager':
"""Initialize a InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByManager object from a json dictionary."""
args = {}
- 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 'manager' in _dict:
- args['manager'] = _dict.get('manager')
+ if (name := _dict.get('name')) is not None:
+ args['name'] = name
+ if (run_at := _dict.get('run_at')) is not None:
+ args['run_at'] = string_to_datetime(run_at)
+ if (manager := _dict.get('manager')) is not None:
+ args['manager'] = manager
else:
raise ValueError('Required property \'manager\' not present in InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByManager JSON')
return cls(**args)
@@ -129874,6 +151205,10 @@ def __init__(
subnet_id: str,
limit: int = None,
sort: str = None,
+ target_id: str = None,
+ target_crn: str = None,
+ target_name: str = None,
+ target_resource_type: str = None,
) -> None:
"""
Initialize a SubnetReservedIpsPager object.
@@ -129884,6 +151219,15 @@ def __init__(
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 target_id: (optional) Filters the collection to resources with a
+ `target.id` property matching the specified identifier.
+ :param str target_crn: (optional) Filters the collection to resources with
+ a `target.crn` property matching the specified CRN.
+ :param str target_name: (optional) Filters the collection to resources with
+ a `target.name` property matching the exact specified name.
+ :param str target_resource_type: (optional) Filters the collection to
+ resources with a `target.resource_type` property matching the specified
+ value.
"""
self._has_next = True
self._client = client
@@ -129891,6 +151235,10 @@ def __init__(
self._subnet_id = subnet_id
self._limit = limit
self._sort = sort
+ self._target_id = target_id
+ self._target_crn = target_crn
+ self._target_name = target_name
+ self._target_resource_type = target_resource_type
def has_next(self) -> bool:
"""
@@ -129911,6 +151259,10 @@ def get_next(self) -> List[dict]:
subnet_id=self._subnet_id,
limit=self._limit,
sort=self._sort,
+ target_id=self._target_id,
+ target_crn=self._target_crn,
+ target_name=self._target_name,
+ target_resource_type=self._target_resource_type,
start=self._page_context.get('next'),
).get_result()
@@ -130172,6 +151524,9 @@ def __init__(
placement_group_id: str = None,
placement_group_crn: str = None,
placement_group_name: str = None,
+ reservation_id: str = None,
+ reservation_crn: str = None,
+ reservation_name: str = None,
) -> None:
"""
Initialize a InstancesPager object.
@@ -130204,6 +151559,12 @@ def __init__(
:param str placement_group_name: (optional) Filters the collection to
instances with a `placement_target.name` property matching the exact
specified placement group name.
+ :param str reservation_id: (optional) Filters the collection to instances
+ with a `reservation.id` property matching the specified identifier.
+ :param str reservation_crn: (optional) Filters the collection to instances
+ with a `reservation.crn` property matching the specified CRN.
+ :param str reservation_name: (optional) Filters the collection to resources
+ with a `reservation.name` property matching the exact specified name.
"""
self._has_next = True
self._client = client
@@ -130220,6 +151581,9 @@ def __init__(
self._placement_group_id = placement_group_id
self._placement_group_crn = placement_group_crn
self._placement_group_name = placement_group_name
+ self._reservation_id = reservation_id
+ self._reservation_crn = reservation_crn
+ self._reservation_name = reservation_name
def has_next(self) -> bool:
"""
@@ -130249,6 +151613,9 @@ def get_next(self) -> List[dict]:
placement_group_id=self._placement_group_id,
placement_group_crn=self._placement_group_crn,
placement_group_name=self._placement_group_name,
+ reservation_id=self._reservation_id,
+ reservation_crn=self._reservation_crn,
+ reservation_name=self._reservation_name,
start=self._page_context.get('next'),
).get_result()
@@ -130694,6 +152061,86 @@ def get_all(self) -> List[dict]:
return results
+class ReservationsPager:
+ """
+ ReservationsPager can be used to simplify the use of the "list_reservations" method.
+ """
+
+ def __init__(
+ self,
+ *,
+ client: VpcV1,
+ limit: int = None,
+ name: str = None,
+ resource_group_id: str = None,
+ zone_name: str = None,
+ ) -> None:
+ """
+ Initialize a ReservationsPager object.
+ :param int limit: (optional) The number of resources to return on a page.
+ :param str name: (optional) Filters the collection to resources with a
+ `name` property matching the exact specified name.
+ :param str resource_group_id: (optional) Filters the collection to
+ resources with a `resource_group.id` property matching the specified
+ identifier.
+ :param str zone_name: (optional) Filters the collection to resources with a
+ `zone.name` property matching the exact specified name.
+ """
+ self._has_next = True
+ self._client = client
+ self._page_context = {'next': None}
+ self._limit = limit
+ self._name = name
+ self._resource_group_id = resource_group_id
+ self._zone_name = zone_name
+
+ def has_next(self) -> bool:
+ """
+ Returns true if there are potentially more results to be retrieved.
+ """
+ return self._has_next
+
+ def get_next(self) -> List[dict]:
+ """
+ Returns the next page of results.
+ :return: A List[dict], where each element is a dict that represents an instance of Reservation.
+ :rtype: List[dict]
+ """
+ if not self.has_next():
+ raise StopIteration(message='No more results available')
+
+ result = self._client.list_reservations(
+ limit=self._limit,
+ name=self._name,
+ resource_group_id=self._resource_group_id,
+ zone_name=self._zone_name,
+ start=self._page_context.get('next'),
+ ).get_result()
+
+ next = None
+ next_page_link = result.get('next')
+ if next_page_link is not None:
+ next = get_query_param(next_page_link.get('href'), 'start')
+ self._page_context['next'] = next
+ if next is None:
+ self._has_next = False
+
+ return result.get('reservations')
+
+ def get_all(self) -> List[dict]:
+ """
+ Returns all results by invoking get_next() repeatedly
+ until all pages of results have been retrieved.
+ :return: A List[dict], where each element is a dict that represents an instance of Reservation.
+ :rtype: List[dict]
+ """
+ results = []
+ while self.has_next():
+ next_page = self.get_next()
+ results.extend(next_page)
+ return results
+
+
class DedicatedHostGroupsPager:
"""
DedicatedHostGroupsPager can be used to simplify the use of the "list_dedicated_host_groups" method.
@@ -131326,6 +152773,74 @@ def get_all(self) -> List[dict]:
return results
+class BareMetalServerNetworkAttachmentsPager:
+ """
+ BareMetalServerNetworkAttachmentsPager can be used to simplify the use of the "list_bare_metal_server_network_attachments" method.
+ """
+
+ def __init__(
+ self,
+ *,
+ client: VpcV1,
+ bare_metal_server_id: str,
+ limit: int = None,
+ ) -> None:
+ """
+ Initialize a BareMetalServerNetworkAttachmentsPager object.
+ :param str bare_metal_server_id: The bare metal server identifier.
+ :param int limit: (optional) The number of resources to return on a page.
+ """
+ self._has_next = True
+ self._client = client
+ self._page_context = {'next': None}
+ self._bare_metal_server_id = bare_metal_server_id
+ self._limit = limit
+
+ def has_next(self) -> bool:
+ """
+ Returns true if there are potentially more results to be retrieved.
+ """
+ return self._has_next
+
+ def get_next(self) -> List[dict]:
+ """
+ Returns the next page of results.
+ :return: A List[dict], where each element is a dict that represents an instance of BareMetalServerNetworkAttachment.
+ :rtype: List[dict]
+ """
+ if not self.has_next():
+ raise StopIteration(message='No more results available')
+
+ result = self._client.list_bare_metal_server_network_attachments(
+ bare_metal_server_id=self._bare_metal_server_id,
+ limit=self._limit,
+ start=self._page_context.get('next'),
+ ).get_result()
+
+ next = None
+ next_page_link = result.get('next')
+ if next_page_link is not None:
+ next = get_query_param(next_page_link.get('href'), 'start')
+ self._page_context['next'] = next
+ if next is None:
+ self._has_next = False
+
+ return result.get('network_attachments')
+
+ def get_all(self) -> List[dict]:
+ """
+ Returns all results by invoking get_next() repeatedly
+ until all pages of results have been retrieved.
+ :return: A List[dict], where each element is a dict that represents an instance of BareMetalServerNetworkAttachment.
+ :rtype: List[dict]
+ """
+ results = []
+ while self.has_next():
+ next_page = self.get_next()
+ results.extend(next_page)
+ return results
+
+
class BareMetalServerNetworkInterfacesPager:
"""
BareMetalServerNetworkInterfacesPager can be used to simplify the use of the "list_bare_metal_server_network_interfaces" method.
@@ -131560,6 +153075,95 @@ def get_all(self) -> List[dict]:
return results
+class SnapshotConsistencyGroupsPager:
+ """
+ SnapshotConsistencyGroupsPager can be used to simplify the use of the "list_snapshot_consistency_groups" method.
+ """
+
+ def __init__(
+ self,
+ *,
+ client: VpcV1,
+ limit: int = None,
+ resource_group_id: str = None,
+ name: str = None,
+ sort: str = None,
+ backup_policy_plan_id: str = None,
+ ) -> None:
+ """
+ Initialize a SnapshotConsistencyGroupsPager object.
+ :param int limit: (optional) The number of resources to return on a page.
+ :param str resource_group_id: (optional) Filters the collection to
+ resources with a `resource_group.id` property matching the specified
+ identifier.
+ :param str name: (optional) Filters the collection to resources with a
+ `name` property matching the exact specified name.
+ :param str sort: (optional) Sorts the returned collection by the specified
+ property name in ascending order. A `-` may be prepended to the name to
+ sort in descending order. For example, the value `-created_at` sorts the
+ collection by the `created_at` property in descending order, and the value
+ `name` sorts it by the `name` property in ascending order.
+ :param str backup_policy_plan_id: (optional) Filters the collection to
+ backup policy jobs with a `backup_policy_plan.id` property matching the
+ specified identifier.
+ """
+ self._has_next = True
+ self._client = client
+ self._page_context = {'next': None}
+ self._limit = limit
+ self._resource_group_id = resource_group_id
+ self._name = name
+ self._sort = sort
+ self._backup_policy_plan_id = backup_policy_plan_id
+
+ def has_next(self) -> bool:
+ """
+ Returns true if there are potentially more results to be retrieved.
+ """
+ return self._has_next
+
+ def get_next(self) -> List[dict]:
+ """
+ Returns the next page of results.
+ :return: A List[dict], where each element is a dict that represents an instance of SnapshotConsistencyGroup.
+ :rtype: List[dict]
+ """
+ if not self.has_next():
+ raise StopIteration(message='No more results available')
+
+ result = self._client.list_snapshot_consistency_groups(
+ limit=self._limit,
+ resource_group_id=self._resource_group_id,
+ name=self._name,
+ sort=self._sort,
+ backup_policy_plan_id=self._backup_policy_plan_id,
+ start=self._page_context.get('next'),
+ ).get_result()
+
+ next = None
+ next_page_link = result.get('next')
+ if next_page_link is not None:
+ next = get_query_param(next_page_link.get('href'), 'start')
+ self._page_context['next'] = next
+ if next is None:
+ self._has_next = False
+
+ return result.get('snapshot_consistency_groups')
+
+ def get_all(self) -> List[dict]:
+ """
+ Returns all results by invoking get_next() repeatedly
+ until all pages of results have been retrieved.
+ :return: A List[dict], where each element is a dict that represents an instance of SnapshotConsistencyGroup.
+ :rtype: List[dict]
+ """
+ results = []
+ while self.has_next():
+ next_page = self.get_next()
+ results.extend(next_page)
+ return results
+
+
class SnapshotsPager:
"""
SnapshotsPager can be used to simplify the use of the "list_snapshots" method.
@@ -131588,6 +153192,8 @@ def __init__(
source_volume_remote_region_name: str = None,
source_image_remote_region_name: str = None,
clones_zone_name: str = None,
+ snapshot_consistency_group_id: str = None,
+ snapshot_consistency_group_crn: str = None,
) -> None:
"""
Initialize a SnapshotsPager object.
@@ -131648,6 +153254,12 @@ def __init__(
:param str clones_zone_name: (optional) Filters the collection to snapshots
with an item in the `clones` property with a `zone.name` property matching
the exact specified name.
+ :param str snapshot_consistency_group_id: (optional) Filters the collection
+ to resources with a `snapshot_consistency_group.id` property matching the
+ specified identifier.
+ :param str snapshot_consistency_group_crn: (optional) Filters the
+ collection to resources with a `snapshot_consistency_group.crn` property
+ matching the specified identifier.
"""
self._has_next = True
self._client = client
@@ -131671,6 +153283,8 @@ def __init__(
self._source_volume_remote_region_name = source_volume_remote_region_name
self._source_image_remote_region_name = source_image_remote_region_name
self._clones_zone_name = clones_zone_name
+ self._snapshot_consistency_group_id = snapshot_consistency_group_id
+ self._snapshot_consistency_group_crn = snapshot_consistency_group_crn
def has_next(self) -> bool:
"""
@@ -131707,6 +153321,8 @@ def get_next(self) -> List[dict]:
source_volume_remote_region_name=self._source_volume_remote_region_name,
source_image_remote_region_name=self._source_image_remote_region_name,
clones_zone_name=self._clones_zone_name,
+ snapshot_consistency_group_id=self._snapshot_consistency_group_id,
+ snapshot_consistency_group_crn=self._snapshot_consistency_group_crn,
start=self._page_context.get('next'),
).get_result()
@@ -132037,6 +153653,160 @@ def get_all(self) -> List[dict]:
return results
+class NetworkInterfaceFloatingIpsPager:
+ """
+ NetworkInterfaceFloatingIpsPager can be used to simplify the use of the "list_network_interface_floating_ips" method.
+ """
+
+ def __init__(
+ self,
+ *,
+ client: VpcV1,
+ virtual_network_interface_id: str,
+ limit: int = None,
+ sort: str = None,
+ ) -> None:
+ """
+ Initialize a NetworkInterfaceFloatingIpsPager object.
+ :param str virtual_network_interface_id: The virtual network interface
+ identifier.
+ :param int limit: (optional) The number of resources to return on a page.
+ :param str sort: (optional) Sorts the returned collection by the specified
+ property name in ascending order. A `-` may be prepended to the name to
+ sort in descending order. For example, the value
+ `-name` sorts the collection by the `name` property in descending order,
+ and the value `name` sorts it by the `name` property in ascending order.
+ """
+ self._has_next = True
+ self._client = client
+ self._page_context = {'next': None}
+ self._virtual_network_interface_id = virtual_network_interface_id
+ self._limit = limit
+ self._sort = sort
+
+ def has_next(self) -> bool:
+ """
+ Returns true if there are potentially more results to be retrieved.
+ """
+ return self._has_next
+
+ def get_next(self) -> List[dict]:
+ """
+ Returns the next page of results.
+ :return: A List[dict], where each element is a dict that represents an instance of FloatingIPReference.
+ :rtype: List[dict]
+ """
+ if not self.has_next():
+ raise StopIteration(message='No more results available')
+
+ result = self._client.list_network_interface_floating_ips(
+ virtual_network_interface_id=self._virtual_network_interface_id,
+ limit=self._limit,
+ sort=self._sort,
+ start=self._page_context.get('next'),
+ ).get_result()
+
+ next = None
+ next_page_link = result.get('next')
+ if next_page_link is not None:
+ next = get_query_param(next_page_link.get('href'), 'start')
+ self._page_context['next'] = next
+ if next is None:
+ self._has_next = False
+
+ return result.get('floating_ips')
+
+ def get_all(self) -> List[dict]:
+ """
+ Returns all results by invoking get_next() repeatedly
+ until all pages of results have been retrieved.
+ :return: A List[dict], where each element is a dict that represents an instance of FloatingIPReference.
+ :rtype: List[dict]
+ """
+ results = []
+ while self.has_next():
+ next_page = self.get_next()
+ results.extend(next_page)
+ return results
+
+
+class VirtualNetworkInterfaceIpsPager:
+ """
+ VirtualNetworkInterfaceIpsPager can be used to simplify the use of the "list_virtual_network_interface_ips" method.
+ """
+
+ def __init__(
+ self,
+ *,
+ client: VpcV1,
+ virtual_network_interface_id: str,
+ limit: int = None,
+ sort: str = None,
+ ) -> None:
+ """
+ Initialize a VirtualNetworkInterfaceIpsPager object.
+ :param str virtual_network_interface_id: The virtual network interface
+ identifier.
+ :param int limit: (optional) The number of resources to return on a page.
+ :param str sort: (optional) Sorts the returned collection by the specified
+ property name in ascending order. A `-` may be prepended to the name to
+ sort in descending order. For example, the value
+ `-name` sorts the collection by the `name` property in descending order,
+ and the value `name` sorts it by the `name` property in ascending order.
+ """
+ self._has_next = True
+ self._client = client
+ self._page_context = {'next': None}
+ self._virtual_network_interface_id = virtual_network_interface_id
+ self._limit = limit
+ self._sort = sort
+
+ def has_next(self) -> bool:
+ """
+ Returns true if there are potentially more results to be retrieved.
+ """
+ return self._has_next
+
+ def get_next(self) -> List[dict]:
+ """
+ Returns the next page of results.
+ :return: A List[dict], where each element is a dict that represents an instance of ReservedIPReference.
+ :rtype: List[dict]
+ """
+ if not self.has_next():
+ raise StopIteration(message='No more results available')
+
+ result = self._client.list_virtual_network_interface_ips(
+ virtual_network_interface_id=self._virtual_network_interface_id,
+ limit=self._limit,
+ sort=self._sort,
+ start=self._page_context.get('next'),
+ ).get_result()
+
+ next = None
+ next_page_link = result.get('next')
+ if next_page_link is not None:
+ next = get_query_param(next_page_link.get('href'), 'start')
+ self._page_context['next'] = next
+ if next is None:
+ self._has_next = False
+
+ return result.get('ips')
+
+ def get_all(self) -> List[dict]:
+ """
+ Returns all results by invoking get_next() repeatedly
+ until all pages of results have been retrieved.
+ :return: A List[dict], where each element is a dict that represents an instance of ReservedIPReference.
+ :rtype: List[dict]
+ """
+ results = []
+ while self.has_next():
+ next_page = self.get_next()
+ results.extend(next_page)
+ return results
+
+
class PublicGatewaysPager:
"""
PublicGatewaysPager can be used to simplify the use of the "list_public_gateways" method.
@@ -132119,6 +153889,10 @@ def __init__(
limit: int = None,
resource_group_id: str = None,
sort: str = None,
+ target_id: str = None,
+ target_crn: str = None,
+ target_name: str = None,
+ target_resource_type: str = None,
) -> None:
"""
Initialize a FloatingIpsPager object.
@@ -132131,6 +153905,15 @@ def __init__(
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 target_id: (optional) Filters the collection to resources with a
+ `target.id` property matching the specified identifier.
+ :param str target_crn: (optional) Filters the collection to resources with
+ a `target.crn` property matching the specified CRN.
+ :param str target_name: (optional) Filters the collection to resources with
+ a `target.name` property matching the exact specified name.
+ :param str target_resource_type: (optional) Filters the collection to
+ resources with a `target.resource_type` property matching the specified
+ value.
"""
self._has_next = True
self._client = client
@@ -132138,6 +153921,10 @@ def __init__(
self._limit = limit
self._resource_group_id = resource_group_id
self._sort = sort
+ self._target_id = target_id
+ self._target_crn = target_crn
+ self._target_name = target_name
+ self._target_resource_type = target_resource_type
def has_next(self) -> bool:
"""
@@ -132158,6 +153945,10 @@ def get_next(self) -> List[dict]:
limit=self._limit,
resource_group_id=self._resource_group_id,
sort=self._sort,
+ target_id=self._target_id,
+ target_crn=self._target_crn,
+ target_name=self._target_name,
+ target_resource_type=self._target_resource_type,
start=self._page_context.get('next'),
).get_result()
@@ -132901,7 +154692,7 @@ def get_next(self) -> List[dict]:
sort=self._sort,
start=self._page_context.get('next'),
).get_result()
-
+ print(result)
next = None
next_page_link = result.get('next')
if next_page_link is not None:
diff --git a/test/unit/test_vpc_v1.py b/test/unit/test_vpc_v1.py
index 66879d6..63217bc 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. 2023.
+# (C) Copyright IBM Corp. 2024.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -65,8 +65,7 @@ def preprocess_url(operation_path: str):
# 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('/') + '/+')
+ return re.compile(request_url.rstrip('/') + '/+')
##############################################################################
@@ -133,7 +132,7 @@ def test_list_vpcs_all_params(self):
"""
# Set up mock
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"}, "dns": {"enable_hub": true, "resolution_binding_count": 0, "resolver": {"servers": [{"address": "192.168.3.4", "zone_affinity": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "type": "delegated", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "remote": {"account": {"id": "aa2432b1fa4d4ace891e9b80fc104e34", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "vpc"}}}, "health_reasons": [{"code": "internal_error", "message": "Internal error (contact IBM support).", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-troubleshoot-hub-spoke-1"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpc", "status": "available"}]}'
+ mock_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"}, "dns": {"enable_hub": true, "resolution_binding_count": 0, "resolver": {"servers": [{"address": "192.168.3.4", "zone_affinity": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "type": "delegated", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "remote": {"account": {"id": "aa2432b1fa4d4ace891e9b80fc104e34", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "vpc"}}}, "health_reasons": [{"code": "dns_resolution_binding_failed", "message": "The VPC specified in the DNS resolution binding has been disconnected.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-troubleshoot-hub-spoke-1"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpc", "status": "available"}]}'
responses.add(
responses.GET,
url,
@@ -184,7 +183,7 @@ def test_list_vpcs_required_params(self):
"""
# Set up mock
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"}, "dns": {"enable_hub": true, "resolution_binding_count": 0, "resolver": {"servers": [{"address": "192.168.3.4", "zone_affinity": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "type": "delegated", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "remote": {"account": {"id": "aa2432b1fa4d4ace891e9b80fc104e34", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "vpc"}}}, "health_reasons": [{"code": "internal_error", "message": "Internal error (contact IBM support).", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-troubleshoot-hub-spoke-1"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpc", "status": "available"}]}'
+ mock_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"}, "dns": {"enable_hub": true, "resolution_binding_count": 0, "resolver": {"servers": [{"address": "192.168.3.4", "zone_affinity": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "type": "delegated", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "remote": {"account": {"id": "aa2432b1fa4d4ace891e9b80fc104e34", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "vpc"}}}, "health_reasons": [{"code": "dns_resolution_binding_failed", "message": "The VPC specified in the DNS resolution binding has been disconnected.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-troubleshoot-hub-spoke-1"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpc", "status": "available"}]}'
responses.add(
responses.GET,
url,
@@ -216,7 +215,7 @@ def test_list_vpcs_value_error(self):
"""
# Set up mock
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"}, "dns": {"enable_hub": true, "resolution_binding_count": 0, "resolver": {"servers": [{"address": "192.168.3.4", "zone_affinity": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "type": "delegated", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "remote": {"account": {"id": "aa2432b1fa4d4ace891e9b80fc104e34", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "vpc"}}}, "health_reasons": [{"code": "internal_error", "message": "Internal error (contact IBM support).", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-troubleshoot-hub-spoke-1"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpc", "status": "available"}]}'
+ mock_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"}, "dns": {"enable_hub": true, "resolution_binding_count": 0, "resolver": {"servers": [{"address": "192.168.3.4", "zone_affinity": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "type": "delegated", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "remote": {"account": {"id": "aa2432b1fa4d4ace891e9b80fc104e34", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "vpc"}}}, "health_reasons": [{"code": "dns_resolution_binding_failed", "message": "The VPC specified in the DNS resolution binding has been disconnected.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-troubleshoot-hub-spoke-1"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpc", "status": "available"}]}'
responses.add(
responses.GET,
url,
@@ -249,8 +248,8 @@ def test_list_vpcs_with_pager_get_next(self):
"""
# Set up a two-page mock response
url = preprocess_url('/vpcs')
- mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"vpcs":[{"classic_access":false,"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","cse_source_ips":[{"ip":{"address":"192.168.3.4"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"default_network_acl":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf","id":"a4e28308-8ee7-46ab-8108-9f881f22bdbf","name":"my-network-acl"},"default_routing_table":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840","id":"1a15dca5-7e33-45e1-b7c5-bc690e569531","name":"my-routing-table-1","resource_type":"routing_table"},"default_security_group":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271","id":"be5df5ca-12a0-494b-907e-aa6ec2bfa271","name":"my-security-group"},"dns":{"enable_hub":true,"resolution_binding_count":0,"resolver":{"servers":[{"address":"192.168.3.4","zone_affinity":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"type":"delegated","vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","remote":{"account":{"id":"aa2432b1fa4d4ace891e9b80fc104e34","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"vpc"}}},"health_reasons":[{"code":"internal_error","message":"Internal error (contact IBM support).","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-troubleshoot-hub-spoke-1"}],"health_state":"ok","href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"vpc","status":"available"}]}'
- mock_response2 = '{"total_count":2,"limit":1,"vpcs":[{"classic_access":false,"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","cse_source_ips":[{"ip":{"address":"192.168.3.4"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"default_network_acl":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf","id":"a4e28308-8ee7-46ab-8108-9f881f22bdbf","name":"my-network-acl"},"default_routing_table":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840","id":"1a15dca5-7e33-45e1-b7c5-bc690e569531","name":"my-routing-table-1","resource_type":"routing_table"},"default_security_group":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271","id":"be5df5ca-12a0-494b-907e-aa6ec2bfa271","name":"my-security-group"},"dns":{"enable_hub":true,"resolution_binding_count":0,"resolver":{"servers":[{"address":"192.168.3.4","zone_affinity":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"type":"delegated","vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","remote":{"account":{"id":"aa2432b1fa4d4ace891e9b80fc104e34","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"vpc"}}},"health_reasons":[{"code":"internal_error","message":"Internal error (contact IBM support).","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-troubleshoot-hub-spoke-1"}],"health_state":"ok","href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"vpc","status":"available"}]}'
+ mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"vpcs":[{"classic_access":false,"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","cse_source_ips":[{"ip":{"address":"192.168.3.4"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"default_network_acl":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf","id":"a4e28308-8ee7-46ab-8108-9f881f22bdbf","name":"my-network-acl"},"default_routing_table":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840","id":"1a15dca5-7e33-45e1-b7c5-bc690e569531","name":"my-routing-table-1","resource_type":"routing_table"},"default_security_group":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271","id":"be5df5ca-12a0-494b-907e-aa6ec2bfa271","name":"my-security-group"},"dns":{"enable_hub":true,"resolution_binding_count":0,"resolver":{"servers":[{"address":"192.168.3.4","zone_affinity":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"type":"delegated","vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","remote":{"account":{"id":"aa2432b1fa4d4ace891e9b80fc104e34","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"vpc"}}},"health_reasons":[{"code":"dns_resolution_binding_failed","message":"The VPC specified in the DNS resolution binding has been disconnected.","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-troubleshoot-hub-spoke-1"}],"health_state":"ok","href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"vpc","status":"available"}]}'
+ mock_response2 = '{"total_count":2,"limit":1,"vpcs":[{"classic_access":false,"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","cse_source_ips":[{"ip":{"address":"192.168.3.4"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"default_network_acl":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf","id":"a4e28308-8ee7-46ab-8108-9f881f22bdbf","name":"my-network-acl"},"default_routing_table":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840","id":"1a15dca5-7e33-45e1-b7c5-bc690e569531","name":"my-routing-table-1","resource_type":"routing_table"},"default_security_group":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271","id":"be5df5ca-12a0-494b-907e-aa6ec2bfa271","name":"my-security-group"},"dns":{"enable_hub":true,"resolution_binding_count":0,"resolver":{"servers":[{"address":"192.168.3.4","zone_affinity":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"type":"delegated","vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","remote":{"account":{"id":"aa2432b1fa4d4ace891e9b80fc104e34","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"vpc"}}},"health_reasons":[{"code":"dns_resolution_binding_failed","message":"The VPC specified in the DNS resolution binding has been disconnected.","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-troubleshoot-hub-spoke-1"}],"health_state":"ok","href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"vpc","status":"available"}]}'
responses.add(
responses.GET,
url,
@@ -287,8 +286,8 @@ def test_list_vpcs_with_pager_get_all(self):
"""
# Set up a two-page mock response
url = preprocess_url('/vpcs')
- mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"vpcs":[{"classic_access":false,"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","cse_source_ips":[{"ip":{"address":"192.168.3.4"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"default_network_acl":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf","id":"a4e28308-8ee7-46ab-8108-9f881f22bdbf","name":"my-network-acl"},"default_routing_table":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840","id":"1a15dca5-7e33-45e1-b7c5-bc690e569531","name":"my-routing-table-1","resource_type":"routing_table"},"default_security_group":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271","id":"be5df5ca-12a0-494b-907e-aa6ec2bfa271","name":"my-security-group"},"dns":{"enable_hub":true,"resolution_binding_count":0,"resolver":{"servers":[{"address":"192.168.3.4","zone_affinity":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"type":"delegated","vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","remote":{"account":{"id":"aa2432b1fa4d4ace891e9b80fc104e34","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"vpc"}}},"health_reasons":[{"code":"internal_error","message":"Internal error (contact IBM support).","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-troubleshoot-hub-spoke-1"}],"health_state":"ok","href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"vpc","status":"available"}]}'
- mock_response2 = '{"total_count":2,"limit":1,"vpcs":[{"classic_access":false,"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","cse_source_ips":[{"ip":{"address":"192.168.3.4"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"default_network_acl":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf","id":"a4e28308-8ee7-46ab-8108-9f881f22bdbf","name":"my-network-acl"},"default_routing_table":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840","id":"1a15dca5-7e33-45e1-b7c5-bc690e569531","name":"my-routing-table-1","resource_type":"routing_table"},"default_security_group":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271","id":"be5df5ca-12a0-494b-907e-aa6ec2bfa271","name":"my-security-group"},"dns":{"enable_hub":true,"resolution_binding_count":0,"resolver":{"servers":[{"address":"192.168.3.4","zone_affinity":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"type":"delegated","vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","remote":{"account":{"id":"aa2432b1fa4d4ace891e9b80fc104e34","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"vpc"}}},"health_reasons":[{"code":"internal_error","message":"Internal error (contact IBM support).","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-troubleshoot-hub-spoke-1"}],"health_state":"ok","href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"vpc","status":"available"}]}'
+ mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"vpcs":[{"classic_access":false,"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","cse_source_ips":[{"ip":{"address":"192.168.3.4"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"default_network_acl":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf","id":"a4e28308-8ee7-46ab-8108-9f881f22bdbf","name":"my-network-acl"},"default_routing_table":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840","id":"1a15dca5-7e33-45e1-b7c5-bc690e569531","name":"my-routing-table-1","resource_type":"routing_table"},"default_security_group":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271","id":"be5df5ca-12a0-494b-907e-aa6ec2bfa271","name":"my-security-group"},"dns":{"enable_hub":true,"resolution_binding_count":0,"resolver":{"servers":[{"address":"192.168.3.4","zone_affinity":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"type":"delegated","vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","remote":{"account":{"id":"aa2432b1fa4d4ace891e9b80fc104e34","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"vpc"}}},"health_reasons":[{"code":"dns_resolution_binding_failed","message":"The VPC specified in the DNS resolution binding has been disconnected.","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-troubleshoot-hub-spoke-1"}],"health_state":"ok","href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"vpc","status":"available"}]}'
+ mock_response2 = '{"total_count":2,"limit":1,"vpcs":[{"classic_access":false,"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","cse_source_ips":[{"ip":{"address":"192.168.3.4"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"default_network_acl":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf","id":"a4e28308-8ee7-46ab-8108-9f881f22bdbf","name":"my-network-acl"},"default_routing_table":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840","id":"1a15dca5-7e33-45e1-b7c5-bc690e569531","name":"my-routing-table-1","resource_type":"routing_table"},"default_security_group":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271","id":"be5df5ca-12a0-494b-907e-aa6ec2bfa271","name":"my-security-group"},"dns":{"enable_hub":true,"resolution_binding_count":0,"resolver":{"servers":[{"address":"192.168.3.4","zone_affinity":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"type":"delegated","vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","remote":{"account":{"id":"aa2432b1fa4d4ace891e9b80fc104e34","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"vpc"}}},"health_reasons":[{"code":"dns_resolution_binding_failed","message":"The VPC specified in the DNS resolution binding has been disconnected.","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-troubleshoot-hub-spoke-1"}],"health_state":"ok","href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"vpc","status":"available"}]}'
responses.add(
responses.GET,
url,
@@ -328,7 +327,7 @@ def test_create_vpc_all_params(self):
"""
# Set up mock
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"}, "dns": {"enable_hub": true, "resolution_binding_count": 0, "resolver": {"servers": [{"address": "192.168.3.4", "zone_affinity": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "type": "delegated", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "remote": {"account": {"id": "aa2432b1fa4d4ace891e9b80fc104e34", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "vpc"}}}, "health_reasons": [{"code": "internal_error", "message": "Internal error (contact IBM support).", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-troubleshoot-hub-spoke-1"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpc", "status": "available"}'
+ mock_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"}, "dns": {"enable_hub": true, "resolution_binding_count": 0, "resolver": {"servers": [{"address": "192.168.3.4", "zone_affinity": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "type": "delegated", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "remote": {"account": {"id": "aa2432b1fa4d4ace891e9b80fc104e34", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "vpc"}}}, "health_reasons": [{"code": "dns_resolution_binding_failed", "message": "The VPC specified in the DNS resolution binding has been disconnected.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-troubleshoot-hub-spoke-1"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpc", "status": "available"}'
responses.add(
responses.POST,
url,
@@ -404,7 +403,7 @@ def test_create_vpc_required_params(self):
"""
# Set up mock
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"}, "dns": {"enable_hub": true, "resolution_binding_count": 0, "resolver": {"servers": [{"address": "192.168.3.4", "zone_affinity": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "type": "delegated", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "remote": {"account": {"id": "aa2432b1fa4d4ace891e9b80fc104e34", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "vpc"}}}, "health_reasons": [{"code": "internal_error", "message": "Internal error (contact IBM support).", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-troubleshoot-hub-spoke-1"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpc", "status": "available"}'
+ mock_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"}, "dns": {"enable_hub": true, "resolution_binding_count": 0, "resolver": {"servers": [{"address": "192.168.3.4", "zone_affinity": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "type": "delegated", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "remote": {"account": {"id": "aa2432b1fa4d4ace891e9b80fc104e34", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "vpc"}}}, "health_reasons": [{"code": "dns_resolution_binding_failed", "message": "The VPC specified in the DNS resolution binding has been disconnected.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-troubleshoot-hub-spoke-1"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpc", "status": "available"}'
responses.add(
responses.POST,
url,
@@ -436,7 +435,7 @@ def test_create_vpc_value_error(self):
"""
# Set up mock
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"}, "dns": {"enable_hub": true, "resolution_binding_count": 0, "resolver": {"servers": [{"address": "192.168.3.4", "zone_affinity": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "type": "delegated", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "remote": {"account": {"id": "aa2432b1fa4d4ace891e9b80fc104e34", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "vpc"}}}, "health_reasons": [{"code": "internal_error", "message": "Internal error (contact IBM support).", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-troubleshoot-hub-spoke-1"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpc", "status": "available"}'
+ mock_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"}, "dns": {"enable_hub": true, "resolution_binding_count": 0, "resolver": {"servers": [{"address": "192.168.3.4", "zone_affinity": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "type": "delegated", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "remote": {"account": {"id": "aa2432b1fa4d4ace891e9b80fc104e34", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "vpc"}}}, "health_reasons": [{"code": "dns_resolution_binding_failed", "message": "The VPC specified in the DNS resolution binding has been disconnected.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-troubleshoot-hub-spoke-1"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpc", "status": "available"}'
responses.add(
responses.POST,
url,
@@ -587,7 +586,7 @@ def test_get_vpc_all_params(self):
"""
# Set up mock
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"}, "dns": {"enable_hub": true, "resolution_binding_count": 0, "resolver": {"servers": [{"address": "192.168.3.4", "zone_affinity": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "type": "delegated", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "remote": {"account": {"id": "aa2432b1fa4d4ace891e9b80fc104e34", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "vpc"}}}, "health_reasons": [{"code": "internal_error", "message": "Internal error (contact IBM support).", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-troubleshoot-hub-spoke-1"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpc", "status": "available"}'
+ mock_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"}, "dns": {"enable_hub": true, "resolution_binding_count": 0, "resolver": {"servers": [{"address": "192.168.3.4", "zone_affinity": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "type": "delegated", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "remote": {"account": {"id": "aa2432b1fa4d4ace891e9b80fc104e34", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "vpc"}}}, "health_reasons": [{"code": "dns_resolution_binding_failed", "message": "The VPC specified in the DNS resolution binding has been disconnected.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-troubleshoot-hub-spoke-1"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpc", "status": "available"}'
responses.add(
responses.GET,
url,
@@ -625,7 +624,7 @@ def test_get_vpc_value_error(self):
"""
# Set up mock
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"}, "dns": {"enable_hub": true, "resolution_binding_count": 0, "resolver": {"servers": [{"address": "192.168.3.4", "zone_affinity": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "type": "delegated", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "remote": {"account": {"id": "aa2432b1fa4d4ace891e9b80fc104e34", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "vpc"}}}, "health_reasons": [{"code": "internal_error", "message": "Internal error (contact IBM support).", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-troubleshoot-hub-spoke-1"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpc", "status": "available"}'
+ mock_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"}, "dns": {"enable_hub": true, "resolution_binding_count": 0, "resolver": {"servers": [{"address": "192.168.3.4", "zone_affinity": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "type": "delegated", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "remote": {"account": {"id": "aa2432b1fa4d4ace891e9b80fc104e34", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "vpc"}}}, "health_reasons": [{"code": "dns_resolution_binding_failed", "message": "The VPC specified in the DNS resolution binding has been disconnected.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-troubleshoot-hub-spoke-1"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpc", "status": "available"}'
responses.add(
responses.GET,
url,
@@ -668,7 +667,7 @@ def test_update_vpc_all_params(self):
"""
# Set up mock
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"}, "dns": {"enable_hub": true, "resolution_binding_count": 0, "resolver": {"servers": [{"address": "192.168.3.4", "zone_affinity": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "type": "delegated", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "remote": {"account": {"id": "aa2432b1fa4d4ace891e9b80fc104e34", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "vpc"}}}, "health_reasons": [{"code": "internal_error", "message": "Internal error (contact IBM support).", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-troubleshoot-hub-spoke-1"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpc", "status": "available"}'
+ mock_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"}, "dns": {"enable_hub": true, "resolution_binding_count": 0, "resolver": {"servers": [{"address": "192.168.3.4", "zone_affinity": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "type": "delegated", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "remote": {"account": {"id": "aa2432b1fa4d4ace891e9b80fc104e34", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "vpc"}}}, "health_reasons": [{"code": "dns_resolution_binding_failed", "message": "The VPC specified in the DNS resolution binding has been disconnected.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-troubleshoot-hub-spoke-1"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpc", "status": "available"}'
responses.add(
responses.PATCH,
url,
@@ -742,7 +741,7 @@ def test_update_vpc_required_params(self):
"""
# Set up mock
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"}, "dns": {"enable_hub": true, "resolution_binding_count": 0, "resolver": {"servers": [{"address": "192.168.3.4", "zone_affinity": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "type": "delegated", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "remote": {"account": {"id": "aa2432b1fa4d4ace891e9b80fc104e34", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "vpc"}}}, "health_reasons": [{"code": "internal_error", "message": "Internal error (contact IBM support).", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-troubleshoot-hub-spoke-1"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpc", "status": "available"}'
+ mock_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"}, "dns": {"enable_hub": true, "resolution_binding_count": 0, "resolver": {"servers": [{"address": "192.168.3.4", "zone_affinity": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "type": "delegated", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "remote": {"account": {"id": "aa2432b1fa4d4ace891e9b80fc104e34", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "vpc"}}}, "health_reasons": [{"code": "dns_resolution_binding_failed", "message": "The VPC specified in the DNS resolution binding has been disconnected.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-troubleshoot-hub-spoke-1"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpc", "status": "available"}'
responses.add(
responses.PATCH,
url,
@@ -814,7 +813,7 @@ def test_update_vpc_value_error(self):
"""
# Set up mock
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"}, "dns": {"enable_hub": true, "resolution_binding_count": 0, "resolver": {"servers": [{"address": "192.168.3.4", "zone_affinity": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "type": "delegated", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "remote": {"account": {"id": "aa2432b1fa4d4ace891e9b80fc104e34", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "vpc"}}}, "health_reasons": [{"code": "internal_error", "message": "Internal error (contact IBM support).", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-troubleshoot-hub-spoke-1"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpc", "status": "available"}'
+ mock_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"}, "dns": {"enable_hub": true, "resolution_binding_count": 0, "resolver": {"servers": [{"address": "192.168.3.4", "zone_affinity": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "type": "delegated", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "remote": {"account": {"id": "aa2432b1fa4d4ace891e9b80fc104e34", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "vpc"}}}, "health_reasons": [{"code": "dns_resolution_binding_failed", "message": "The VPC specified in the DNS resolution binding has been disconnected.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-troubleshoot-hub-spoke-1"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpc", "status": "available"}'
responses.add(
responses.PATCH,
url,
@@ -969,7 +968,7 @@ def test_get_vpc_default_routing_table_all_params(self):
"""
# Set up mock
url = preprocess_url('/vpcs/testString/default_routing_table')
- mock_response = '{"accept_routes_from": [{"resource_type": "vpn_gateway"}], "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "is_default": true, "lifecycle_state": "stable", "name": "milled-easy-equine-machines", "resource_type": "routing_table", "route_direct_link_ingress": false, "route_internet_ingress": true, "route_transit_gateway_ingress": false, "route_vpc_zone_ingress": true, "routes": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "name": "my-route-1"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}]}'
+ mock_response = '{"accept_routes_from": [{"resource_type": "vpn_gateway"}], "advertise_routes_to": ["transit_gateway"], "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "is_default": true, "lifecycle_state": "stable", "name": "milled-easy-equine-machines", "resource_type": "routing_table", "route_direct_link_ingress": false, "route_internet_ingress": true, "route_transit_gateway_ingress": false, "route_vpc_zone_ingress": true, "routes": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "name": "my-route-1"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}]}'
responses.add(
responses.GET,
url,
@@ -1007,7 +1006,7 @@ def test_get_vpc_default_routing_table_value_error(self):
"""
# Set up mock
url = preprocess_url('/vpcs/testString/default_routing_table')
- mock_response = '{"accept_routes_from": [{"resource_type": "vpn_gateway"}], "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "is_default": true, "lifecycle_state": "stable", "name": "milled-easy-equine-machines", "resource_type": "routing_table", "route_direct_link_ingress": false, "route_internet_ingress": true, "route_transit_gateway_ingress": false, "route_vpc_zone_ingress": true, "routes": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "name": "my-route-1"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}]}'
+ mock_response = '{"accept_routes_from": [{"resource_type": "vpn_gateway"}], "advertise_routes_to": ["transit_gateway"], "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "is_default": true, "lifecycle_state": "stable", "name": "milled-easy-equine-machines", "resource_type": "routing_table", "route_direct_link_ingress": false, "route_internet_ingress": true, "route_transit_gateway_ingress": false, "route_vpc_zone_ingress": true, "routes": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "name": "my-route-1"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}]}'
responses.add(
responses.GET,
url,
@@ -2029,9 +2028,12 @@ def test_delete_vpc_dns_resolution_binding_all_params(self):
"""
# Set up mock
url = preprocess_url('/vpcs/testString/dns_resolution_bindings/testString')
+ mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "endpoint_gateways": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "name": "my-endpoint-gateway", "remote": {"account": {"id": "aa2432b1fa4d4ace891e9b80fc104e34", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "endpoint_gateway"}], "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-982d72b7-db1b-4606-afb2-ed6bd4b0bed1/dns_resolution_bindings/r006-8a524686-fcf6-4947-a59b-188c1ed78ad1", "id": "r006-8a524686-fcf6-4947-a59b-188c1ed78ad1", "lifecycle_state": "stable", "name": "my-dns-resolution-binding", "resource_type": "vpc_dns_resolution_binding", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "remote": {"account": {"id": "aa2432b1fa4d4ace891e9b80fc104e34", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "vpc"}}'
responses.add(
responses.DELETE,
url,
+ body=mock_response,
+ content_type='application/json',
status=202,
)
@@ -2066,9 +2068,12 @@ def test_delete_vpc_dns_resolution_binding_value_error(self):
"""
# Set up mock
url = preprocess_url('/vpcs/testString/dns_resolution_bindings/testString')
+ mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "endpoint_gateways": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "name": "my-endpoint-gateway", "remote": {"account": {"id": "aa2432b1fa4d4ace891e9b80fc104e34", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "endpoint_gateway"}], "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-982d72b7-db1b-4606-afb2-ed6bd4b0bed1/dns_resolution_bindings/r006-8a524686-fcf6-4947-a59b-188c1ed78ad1", "id": "r006-8a524686-fcf6-4947-a59b-188c1ed78ad1", "lifecycle_state": "stable", "name": "my-dns-resolution-binding", "resource_type": "vpc_dns_resolution_binding", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "remote": {"account": {"id": "aa2432b1fa4d4ace891e9b80fc104e34", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "vpc"}}'
responses.add(
responses.DELETE,
url,
+ body=mock_response,
+ content_type='application/json',
status=202,
)
@@ -2293,7 +2298,7 @@ def test_list_vpc_routes_all_params(self):
"""
# Set up mock
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", "creator": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-vpn-gateway", "resource_type": "vpn_gateway"}, "destination": "192.168.3.0/24", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_state": "stable", "name": "my-route-1", "next_hop": {"address": "192.168.3.4"}, "origin": "service", "priority": 1, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "total_count": 132}'
+ 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", "advertise": false, "created_at": "2019-01-01T12:00:00.000Z", "creator": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-vpn-gateway", "resource_type": "vpn_gateway"}, "destination": "192.168.3.0/24", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_state": "stable", "name": "my-route-1", "next_hop": {"address": "192.168.3.4"}, "origin": "service", "priority": 1, "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,
@@ -2343,7 +2348,7 @@ def test_list_vpc_routes_required_params(self):
"""
# Set up mock
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", "creator": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-vpn-gateway", "resource_type": "vpn_gateway"}, "destination": "192.168.3.0/24", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_state": "stable", "name": "my-route-1", "next_hop": {"address": "192.168.3.4"}, "origin": "service", "priority": 1, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "total_count": 132}'
+ 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", "advertise": false, "created_at": "2019-01-01T12:00:00.000Z", "creator": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-vpn-gateway", "resource_type": "vpn_gateway"}, "destination": "192.168.3.0/24", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_state": "stable", "name": "my-route-1", "next_hop": {"address": "192.168.3.4"}, "origin": "service", "priority": 1, "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,
@@ -2381,7 +2386,7 @@ def test_list_vpc_routes_value_error(self):
"""
# Set up mock
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", "creator": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-vpn-gateway", "resource_type": "vpn_gateway"}, "destination": "192.168.3.0/24", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_state": "stable", "name": "my-route-1", "next_hop": {"address": "192.168.3.4"}, "origin": "service", "priority": 1, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "total_count": 132}'
+ 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", "advertise": false, "created_at": "2019-01-01T12:00:00.000Z", "creator": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-vpn-gateway", "resource_type": "vpn_gateway"}, "destination": "192.168.3.0/24", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_state": "stable", "name": "my-route-1", "next_hop": {"address": "192.168.3.4"}, "origin": "service", "priority": 1, "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,
@@ -2418,8 +2423,8 @@ def test_list_vpc_routes_with_pager_get_next(self):
"""
# Set up a two-page mock response
url = preprocess_url('/vpcs/testString/routes')
- mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"routes":[{"action":"delegate","created_at":"2019-01-01T12:00:00.000Z","creator":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b","id":"ddf51bec-3424-11e8-b467-0ed5f89f718b","name":"my-vpn-gateway","resource_type":"vpn_gateway"},"destination":"192.168.3.0/24","href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531","id":"1a15dca5-7e33-45e1-b7c5-bc690e569531","lifecycle_state":"stable","name":"my-route-1","next_hop":{"address":"192.168.3.4"},"origin":"service","priority":1,"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"total_count":2,"limit":1}'
- mock_response2 = '{"routes":[{"action":"delegate","created_at":"2019-01-01T12:00:00.000Z","creator":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b","id":"ddf51bec-3424-11e8-b467-0ed5f89f718b","name":"my-vpn-gateway","resource_type":"vpn_gateway"},"destination":"192.168.3.0/24","href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531","id":"1a15dca5-7e33-45e1-b7c5-bc690e569531","lifecycle_state":"stable","name":"my-route-1","next_hop":{"address":"192.168.3.4"},"origin":"service","priority":1,"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"total_count":2,"limit":1}'
+ mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"routes":[{"action":"delegate","advertise":false,"created_at":"2019-01-01T12:00:00.000Z","creator":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b","id":"ddf51bec-3424-11e8-b467-0ed5f89f718b","name":"my-vpn-gateway","resource_type":"vpn_gateway"},"destination":"192.168.3.0/24","href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531","id":"1a15dca5-7e33-45e1-b7c5-bc690e569531","lifecycle_state":"stable","name":"my-route-1","next_hop":{"address":"192.168.3.4"},"origin":"service","priority":1,"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"total_count":2,"limit":1}'
+ mock_response2 = '{"routes":[{"action":"delegate","advertise":false,"created_at":"2019-01-01T12:00:00.000Z","creator":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b","id":"ddf51bec-3424-11e8-b467-0ed5f89f718b","name":"my-vpn-gateway","resource_type":"vpn_gateway"},"destination":"192.168.3.0/24","href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531","id":"1a15dca5-7e33-45e1-b7c5-bc690e569531","lifecycle_state":"stable","name":"my-route-1","next_hop":{"address":"192.168.3.4"},"origin":"service","priority":1,"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"total_count":2,"limit":1}'
responses.add(
responses.GET,
url,
@@ -2456,8 +2461,8 @@ def test_list_vpc_routes_with_pager_get_all(self):
"""
# Set up a two-page mock response
url = preprocess_url('/vpcs/testString/routes')
- mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"routes":[{"action":"delegate","created_at":"2019-01-01T12:00:00.000Z","creator":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b","id":"ddf51bec-3424-11e8-b467-0ed5f89f718b","name":"my-vpn-gateway","resource_type":"vpn_gateway"},"destination":"192.168.3.0/24","href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531","id":"1a15dca5-7e33-45e1-b7c5-bc690e569531","lifecycle_state":"stable","name":"my-route-1","next_hop":{"address":"192.168.3.4"},"origin":"service","priority":1,"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"total_count":2,"limit":1}'
- mock_response2 = '{"routes":[{"action":"delegate","created_at":"2019-01-01T12:00:00.000Z","creator":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b","id":"ddf51bec-3424-11e8-b467-0ed5f89f718b","name":"my-vpn-gateway","resource_type":"vpn_gateway"},"destination":"192.168.3.0/24","href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531","id":"1a15dca5-7e33-45e1-b7c5-bc690e569531","lifecycle_state":"stable","name":"my-route-1","next_hop":{"address":"192.168.3.4"},"origin":"service","priority":1,"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"total_count":2,"limit":1}'
+ mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"routes":[{"action":"delegate","advertise":false,"created_at":"2019-01-01T12:00:00.000Z","creator":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b","id":"ddf51bec-3424-11e8-b467-0ed5f89f718b","name":"my-vpn-gateway","resource_type":"vpn_gateway"},"destination":"192.168.3.0/24","href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531","id":"1a15dca5-7e33-45e1-b7c5-bc690e569531","lifecycle_state":"stable","name":"my-route-1","next_hop":{"address":"192.168.3.4"},"origin":"service","priority":1,"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"total_count":2,"limit":1}'
+ mock_response2 = '{"routes":[{"action":"delegate","advertise":false,"created_at":"2019-01-01T12:00:00.000Z","creator":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b","id":"ddf51bec-3424-11e8-b467-0ed5f89f718b","name":"my-vpn-gateway","resource_type":"vpn_gateway"},"destination":"192.168.3.0/24","href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531","id":"1a15dca5-7e33-45e1-b7c5-bc690e569531","lifecycle_state":"stable","name":"my-route-1","next_hop":{"address":"192.168.3.4"},"origin":"service","priority":1,"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"total_count":2,"limit":1}'
responses.add(
responses.GET,
url,
@@ -2497,7 +2502,7 @@ def test_create_vpc_route_all_params(self):
"""
# Set up mock
url = preprocess_url('/vpcs/testString/routes')
- mock_response = '{"action": "delegate", "created_at": "2019-01-01T12:00:00.000Z", "creator": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-vpn-gateway", "resource_type": "vpn_gateway"}, "destination": "192.168.3.0/24", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_state": "stable", "name": "my-route-1", "next_hop": {"address": "192.168.3.4"}, "origin": "service", "priority": 1, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
+ mock_response = '{"action": "delegate", "advertise": false, "created_at": "2019-01-01T12:00:00.000Z", "creator": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-vpn-gateway", "resource_type": "vpn_gateway"}, "destination": "192.168.3.0/24", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_state": "stable", "name": "my-route-1", "next_hop": {"address": "192.168.3.4"}, "origin": "service", "priority": 1, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
responses.add(
responses.POST,
url,
@@ -2519,6 +2524,7 @@ def test_create_vpc_route_all_params(self):
destination = '192.168.3.0/24'
zone = zone_identity_model
action = 'deliver'
+ advertise = False
name = 'my-route-1'
next_hop = route_prototype_next_hop_model
priority = 1
@@ -2529,6 +2535,7 @@ def test_create_vpc_route_all_params(self):
destination,
zone,
action=action,
+ advertise=advertise,
name=name,
next_hop=next_hop,
priority=priority,
@@ -2543,6 +2550,7 @@ def test_create_vpc_route_all_params(self):
assert req_body['destination'] == '192.168.3.0/24'
assert req_body['zone'] == zone_identity_model
assert req_body['action'] == 'deliver'
+ assert req_body['advertise'] == False
assert req_body['name'] == 'my-route-1'
assert req_body['next_hop'] == route_prototype_next_hop_model
assert req_body['priority'] == 1
@@ -2563,7 +2571,7 @@ def test_create_vpc_route_value_error(self):
"""
# Set up mock
url = preprocess_url('/vpcs/testString/routes')
- mock_response = '{"action": "delegate", "created_at": "2019-01-01T12:00:00.000Z", "creator": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-vpn-gateway", "resource_type": "vpn_gateway"}, "destination": "192.168.3.0/24", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_state": "stable", "name": "my-route-1", "next_hop": {"address": "192.168.3.4"}, "origin": "service", "priority": 1, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
+ mock_response = '{"action": "delegate", "advertise": false, "created_at": "2019-01-01T12:00:00.000Z", "creator": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-vpn-gateway", "resource_type": "vpn_gateway"}, "destination": "192.168.3.0/24", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_state": "stable", "name": "my-route-1", "next_hop": {"address": "192.168.3.4"}, "origin": "service", "priority": 1, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
responses.add(
responses.POST,
url,
@@ -2585,6 +2593,7 @@ def test_create_vpc_route_value_error(self):
destination = '192.168.3.0/24'
zone = zone_identity_model
action = 'deliver'
+ advertise = False
name = 'my-route-1'
next_hop = route_prototype_next_hop_model
priority = 1
@@ -2701,7 +2710,7 @@ def test_get_vpc_route_all_params(self):
"""
# Set up mock
url = preprocess_url('/vpcs/testString/routes/testString')
- mock_response = '{"action": "delegate", "created_at": "2019-01-01T12:00:00.000Z", "creator": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-vpn-gateway", "resource_type": "vpn_gateway"}, "destination": "192.168.3.0/24", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_state": "stable", "name": "my-route-1", "next_hop": {"address": "192.168.3.4"}, "origin": "service", "priority": 1, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
+ mock_response = '{"action": "delegate", "advertise": false, "created_at": "2019-01-01T12:00:00.000Z", "creator": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-vpn-gateway", "resource_type": "vpn_gateway"}, "destination": "192.168.3.0/24", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_state": "stable", "name": "my-route-1", "next_hop": {"address": "192.168.3.4"}, "origin": "service", "priority": 1, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
responses.add(
responses.GET,
url,
@@ -2741,7 +2750,7 @@ def test_get_vpc_route_value_error(self):
"""
# Set up mock
url = preprocess_url('/vpcs/testString/routes/testString')
- mock_response = '{"action": "delegate", "created_at": "2019-01-01T12:00:00.000Z", "creator": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-vpn-gateway", "resource_type": "vpn_gateway"}, "destination": "192.168.3.0/24", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_state": "stable", "name": "my-route-1", "next_hop": {"address": "192.168.3.4"}, "origin": "service", "priority": 1, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
+ mock_response = '{"action": "delegate", "advertise": false, "created_at": "2019-01-01T12:00:00.000Z", "creator": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-vpn-gateway", "resource_type": "vpn_gateway"}, "destination": "192.168.3.0/24", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_state": "stable", "name": "my-route-1", "next_hop": {"address": "192.168.3.4"}, "origin": "service", "priority": 1, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
responses.add(
responses.GET,
url,
@@ -2786,7 +2795,7 @@ def test_update_vpc_route_all_params(self):
"""
# Set up mock
url = preprocess_url('/vpcs/testString/routes/testString')
- mock_response = '{"action": "delegate", "created_at": "2019-01-01T12:00:00.000Z", "creator": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-vpn-gateway", "resource_type": "vpn_gateway"}, "destination": "192.168.3.0/24", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_state": "stable", "name": "my-route-1", "next_hop": {"address": "192.168.3.4"}, "origin": "service", "priority": 1, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
+ mock_response = '{"action": "delegate", "advertise": false, "created_at": "2019-01-01T12:00:00.000Z", "creator": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-vpn-gateway", "resource_type": "vpn_gateway"}, "destination": "192.168.3.0/24", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_state": "stable", "name": "my-route-1", "next_hop": {"address": "192.168.3.4"}, "origin": "service", "priority": 1, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
responses.add(
responses.PATCH,
url,
@@ -2801,6 +2810,7 @@ def test_update_vpc_route_all_params(self):
# Construct a dict representation of a RoutePatch model
route_patch_model = {}
+ route_patch_model['advertise'] = True
route_patch_model['name'] = 'my-route-2'
route_patch_model['next_hop'] = route_next_hop_patch_model
route_patch_model['priority'] = 1
@@ -2841,7 +2851,7 @@ def test_update_vpc_route_value_error(self):
"""
# Set up mock
url = preprocess_url('/vpcs/testString/routes/testString')
- mock_response = '{"action": "delegate", "created_at": "2019-01-01T12:00:00.000Z", "creator": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-vpn-gateway", "resource_type": "vpn_gateway"}, "destination": "192.168.3.0/24", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_state": "stable", "name": "my-route-1", "next_hop": {"address": "192.168.3.4"}, "origin": "service", "priority": 1, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
+ mock_response = '{"action": "delegate", "advertise": false, "created_at": "2019-01-01T12:00:00.000Z", "creator": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-vpn-gateway", "resource_type": "vpn_gateway"}, "destination": "192.168.3.0/24", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_state": "stable", "name": "my-route-1", "next_hop": {"address": "192.168.3.4"}, "origin": "service", "priority": 1, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
responses.add(
responses.PATCH,
url,
@@ -2856,6 +2866,7 @@ def test_update_vpc_route_value_error(self):
# Construct a dict representation of a RoutePatch model
route_patch_model = {}
+ route_patch_model['advertise'] = True
route_patch_model['name'] = 'my-route-2'
route_patch_model['next_hop'] = route_next_hop_patch_model
route_patch_model['priority'] = 1
@@ -2898,7 +2909,7 @@ def test_list_vpc_routing_tables_all_params(self):
"""
# Set up mock
url = preprocess_url('/vpcs/testString/routing_tables')
- mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "routing_tables": [{"accept_routes_from": [{"resource_type": "vpn_gateway"}], "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "is_default": true, "lifecycle_state": "stable", "name": "my-routing-table-1", "resource_type": "routing_table", "route_direct_link_ingress": false, "route_internet_ingress": true, "route_transit_gateway_ingress": false, "route_vpc_zone_ingress": true, "routes": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "name": "my-route-1"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}]}], "total_count": 132}'
+ mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "routing_tables": [{"accept_routes_from": [{"resource_type": "vpn_gateway"}], "advertise_routes_to": ["transit_gateway"], "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "is_default": true, "lifecycle_state": "stable", "name": "my-routing-table-1", "resource_type": "routing_table", "route_direct_link_ingress": false, "route_internet_ingress": true, "route_transit_gateway_ingress": false, "route_vpc_zone_ingress": true, "routes": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "name": "my-route-1"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}]}], "total_count": 132}'
responses.add(
responses.GET,
url,
@@ -2948,7 +2959,7 @@ def test_list_vpc_routing_tables_required_params(self):
"""
# Set up mock
url = preprocess_url('/vpcs/testString/routing_tables')
- mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "routing_tables": [{"accept_routes_from": [{"resource_type": "vpn_gateway"}], "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "is_default": true, "lifecycle_state": "stable", "name": "my-routing-table-1", "resource_type": "routing_table", "route_direct_link_ingress": false, "route_internet_ingress": true, "route_transit_gateway_ingress": false, "route_vpc_zone_ingress": true, "routes": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "name": "my-route-1"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}]}], "total_count": 132}'
+ mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "routing_tables": [{"accept_routes_from": [{"resource_type": "vpn_gateway"}], "advertise_routes_to": ["transit_gateway"], "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "is_default": true, "lifecycle_state": "stable", "name": "my-routing-table-1", "resource_type": "routing_table", "route_direct_link_ingress": false, "route_internet_ingress": true, "route_transit_gateway_ingress": false, "route_vpc_zone_ingress": true, "routes": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "name": "my-route-1"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}]}], "total_count": 132}'
responses.add(
responses.GET,
url,
@@ -2986,7 +2997,7 @@ def test_list_vpc_routing_tables_value_error(self):
"""
# Set up mock
url = preprocess_url('/vpcs/testString/routing_tables')
- mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "routing_tables": [{"accept_routes_from": [{"resource_type": "vpn_gateway"}], "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "is_default": true, "lifecycle_state": "stable", "name": "my-routing-table-1", "resource_type": "routing_table", "route_direct_link_ingress": false, "route_internet_ingress": true, "route_transit_gateway_ingress": false, "route_vpc_zone_ingress": true, "routes": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "name": "my-route-1"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}]}], "total_count": 132}'
+ mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "routing_tables": [{"accept_routes_from": [{"resource_type": "vpn_gateway"}], "advertise_routes_to": ["transit_gateway"], "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "is_default": true, "lifecycle_state": "stable", "name": "my-routing-table-1", "resource_type": "routing_table", "route_direct_link_ingress": false, "route_internet_ingress": true, "route_transit_gateway_ingress": false, "route_vpc_zone_ingress": true, "routes": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "name": "my-route-1"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}]}], "total_count": 132}'
responses.add(
responses.GET,
url,
@@ -3023,8 +3034,8 @@ def test_list_vpc_routing_tables_with_pager_get_next(self):
"""
# Set up a two-page mock response
url = preprocess_url('/vpcs/testString/routing_tables')
- mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"routing_tables":[{"accept_routes_from":[{"resource_type":"vpn_gateway"}],"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840","id":"1a15dca5-7e33-45e1-b7c5-bc690e569531","is_default":true,"lifecycle_state":"stable","name":"my-routing-table-1","resource_type":"routing_table","route_direct_link_ingress":false,"route_internet_ingress":true,"route_transit_gateway_ingress":false,"route_vpc_zone_ingress":true,"routes":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531","id":"1a15dca5-7e33-45e1-b7c5-bc690e569531","name":"my-route-1"}],"subnets":[{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}]}],"total_count":2,"limit":1}'
- mock_response2 = '{"routing_tables":[{"accept_routes_from":[{"resource_type":"vpn_gateway"}],"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840","id":"1a15dca5-7e33-45e1-b7c5-bc690e569531","is_default":true,"lifecycle_state":"stable","name":"my-routing-table-1","resource_type":"routing_table","route_direct_link_ingress":false,"route_internet_ingress":true,"route_transit_gateway_ingress":false,"route_vpc_zone_ingress":true,"routes":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531","id":"1a15dca5-7e33-45e1-b7c5-bc690e569531","name":"my-route-1"}],"subnets":[{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}]}],"total_count":2,"limit":1}'
+ mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"routing_tables":[{"accept_routes_from":[{"resource_type":"vpn_gateway"}],"advertise_routes_to":["transit_gateway"],"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840","id":"1a15dca5-7e33-45e1-b7c5-bc690e569531","is_default":true,"lifecycle_state":"stable","name":"my-routing-table-1","resource_type":"routing_table","route_direct_link_ingress":false,"route_internet_ingress":true,"route_transit_gateway_ingress":false,"route_vpc_zone_ingress":true,"routes":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531","id":"1a15dca5-7e33-45e1-b7c5-bc690e569531","name":"my-route-1"}],"subnets":[{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}]}],"total_count":2,"limit":1}'
+ mock_response2 = '{"routing_tables":[{"accept_routes_from":[{"resource_type":"vpn_gateway"}],"advertise_routes_to":["transit_gateway"],"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840","id":"1a15dca5-7e33-45e1-b7c5-bc690e569531","is_default":true,"lifecycle_state":"stable","name":"my-routing-table-1","resource_type":"routing_table","route_direct_link_ingress":false,"route_internet_ingress":true,"route_transit_gateway_ingress":false,"route_vpc_zone_ingress":true,"routes":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531","id":"1a15dca5-7e33-45e1-b7c5-bc690e569531","name":"my-route-1"}],"subnets":[{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}]}],"total_count":2,"limit":1}'
responses.add(
responses.GET,
url,
@@ -3061,8 +3072,8 @@ def test_list_vpc_routing_tables_with_pager_get_all(self):
"""
# Set up a two-page mock response
url = preprocess_url('/vpcs/testString/routing_tables')
- mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"routing_tables":[{"accept_routes_from":[{"resource_type":"vpn_gateway"}],"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840","id":"1a15dca5-7e33-45e1-b7c5-bc690e569531","is_default":true,"lifecycle_state":"stable","name":"my-routing-table-1","resource_type":"routing_table","route_direct_link_ingress":false,"route_internet_ingress":true,"route_transit_gateway_ingress":false,"route_vpc_zone_ingress":true,"routes":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531","id":"1a15dca5-7e33-45e1-b7c5-bc690e569531","name":"my-route-1"}],"subnets":[{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}]}],"total_count":2,"limit":1}'
- mock_response2 = '{"routing_tables":[{"accept_routes_from":[{"resource_type":"vpn_gateway"}],"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840","id":"1a15dca5-7e33-45e1-b7c5-bc690e569531","is_default":true,"lifecycle_state":"stable","name":"my-routing-table-1","resource_type":"routing_table","route_direct_link_ingress":false,"route_internet_ingress":true,"route_transit_gateway_ingress":false,"route_vpc_zone_ingress":true,"routes":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531","id":"1a15dca5-7e33-45e1-b7c5-bc690e569531","name":"my-route-1"}],"subnets":[{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}]}],"total_count":2,"limit":1}'
+ mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"routing_tables":[{"accept_routes_from":[{"resource_type":"vpn_gateway"}],"advertise_routes_to":["transit_gateway"],"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840","id":"1a15dca5-7e33-45e1-b7c5-bc690e569531","is_default":true,"lifecycle_state":"stable","name":"my-routing-table-1","resource_type":"routing_table","route_direct_link_ingress":false,"route_internet_ingress":true,"route_transit_gateway_ingress":false,"route_vpc_zone_ingress":true,"routes":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531","id":"1a15dca5-7e33-45e1-b7c5-bc690e569531","name":"my-route-1"}],"subnets":[{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}]}],"total_count":2,"limit":1}'
+ mock_response2 = '{"routing_tables":[{"accept_routes_from":[{"resource_type":"vpn_gateway"}],"advertise_routes_to":["transit_gateway"],"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840","id":"1a15dca5-7e33-45e1-b7c5-bc690e569531","is_default":true,"lifecycle_state":"stable","name":"my-routing-table-1","resource_type":"routing_table","route_direct_link_ingress":false,"route_internet_ingress":true,"route_transit_gateway_ingress":false,"route_vpc_zone_ingress":true,"routes":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531","id":"1a15dca5-7e33-45e1-b7c5-bc690e569531","name":"my-route-1"}],"subnets":[{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}]}],"total_count":2,"limit":1}'
responses.add(
responses.GET,
url,
@@ -3102,7 +3113,7 @@ def test_create_vpc_routing_table_all_params(self):
"""
# Set up mock
url = preprocess_url('/vpcs/testString/routing_tables')
- mock_response = '{"accept_routes_from": [{"resource_type": "vpn_gateway"}], "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "is_default": true, "lifecycle_state": "stable", "name": "my-routing-table-1", "resource_type": "routing_table", "route_direct_link_ingress": false, "route_internet_ingress": true, "route_transit_gateway_ingress": false, "route_vpc_zone_ingress": true, "routes": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "name": "my-route-1"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}]}'
+ mock_response = '{"accept_routes_from": [{"resource_type": "vpn_gateway"}], "advertise_routes_to": ["transit_gateway"], "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "is_default": true, "lifecycle_state": "stable", "name": "my-routing-table-1", "resource_type": "routing_table", "route_direct_link_ingress": false, "route_internet_ingress": true, "route_transit_gateway_ingress": false, "route_vpc_zone_ingress": true, "routes": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "name": "my-route-1"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}]}'
responses.add(
responses.POST,
url,
@@ -3126,6 +3137,7 @@ def test_create_vpc_routing_table_all_params(self):
# Construct a dict representation of a RoutePrototype model
route_prototype_model = {}
route_prototype_model['action'] = 'deliver'
+ route_prototype_model['advertise'] = False
route_prototype_model['destination'] = '192.168.3.0/24'
route_prototype_model['name'] = 'my-route-1'
route_prototype_model['next_hop'] = route_prototype_next_hop_model
@@ -3135,6 +3147,7 @@ def test_create_vpc_routing_table_all_params(self):
# Set up parameter values
vpc_id = 'testString'
accept_routes_from = [resource_filter_model]
+ advertise_routes_to = []
name = 'my-routing-table-1'
route_direct_link_ingress = False
route_internet_ingress = False
@@ -3146,6 +3159,7 @@ def test_create_vpc_routing_table_all_params(self):
response = _service.create_vpc_routing_table(
vpc_id,
accept_routes_from=accept_routes_from,
+ advertise_routes_to=advertise_routes_to,
name=name,
route_direct_link_ingress=route_direct_link_ingress,
route_internet_ingress=route_internet_ingress,
@@ -3161,6 +3175,7 @@ def test_create_vpc_routing_table_all_params(self):
# Validate body params
req_body = json.loads(str(responses.calls[0].request.body, 'utf-8'))
assert req_body['accept_routes_from'] == [resource_filter_model]
+ assert req_body['advertise_routes_to'] == []
assert req_body['name'] == 'my-routing-table-1'
assert req_body['route_direct_link_ingress'] == False
assert req_body['route_internet_ingress'] == False
@@ -3184,7 +3199,7 @@ def test_create_vpc_routing_table_value_error(self):
"""
# Set up mock
url = preprocess_url('/vpcs/testString/routing_tables')
- mock_response = '{"accept_routes_from": [{"resource_type": "vpn_gateway"}], "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "is_default": true, "lifecycle_state": "stable", "name": "my-routing-table-1", "resource_type": "routing_table", "route_direct_link_ingress": false, "route_internet_ingress": true, "route_transit_gateway_ingress": false, "route_vpc_zone_ingress": true, "routes": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "name": "my-route-1"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}]}'
+ mock_response = '{"accept_routes_from": [{"resource_type": "vpn_gateway"}], "advertise_routes_to": ["transit_gateway"], "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "is_default": true, "lifecycle_state": "stable", "name": "my-routing-table-1", "resource_type": "routing_table", "route_direct_link_ingress": false, "route_internet_ingress": true, "route_transit_gateway_ingress": false, "route_vpc_zone_ingress": true, "routes": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "name": "my-route-1"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}]}'
responses.add(
responses.POST,
url,
@@ -3208,6 +3223,7 @@ def test_create_vpc_routing_table_value_error(self):
# Construct a dict representation of a RoutePrototype model
route_prototype_model = {}
route_prototype_model['action'] = 'deliver'
+ route_prototype_model['advertise'] = False
route_prototype_model['destination'] = '192.168.3.0/24'
route_prototype_model['name'] = 'my-route-1'
route_prototype_model['next_hop'] = route_prototype_next_hop_model
@@ -3217,6 +3233,7 @@ def test_create_vpc_routing_table_value_error(self):
# Set up parameter values
vpc_id = 'testString'
accept_routes_from = [resource_filter_model]
+ advertise_routes_to = []
name = 'my-routing-table-1'
route_direct_link_ingress = False
route_internet_ingress = False
@@ -3373,7 +3390,7 @@ def test_get_vpc_routing_table_all_params(self):
"""
# Set up mock
url = preprocess_url('/vpcs/testString/routing_tables/testString')
- mock_response = '{"accept_routes_from": [{"resource_type": "vpn_gateway"}], "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "is_default": true, "lifecycle_state": "stable", "name": "my-routing-table-1", "resource_type": "routing_table", "route_direct_link_ingress": false, "route_internet_ingress": true, "route_transit_gateway_ingress": false, "route_vpc_zone_ingress": true, "routes": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "name": "my-route-1"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}]}'
+ mock_response = '{"accept_routes_from": [{"resource_type": "vpn_gateway"}], "advertise_routes_to": ["transit_gateway"], "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "is_default": true, "lifecycle_state": "stable", "name": "my-routing-table-1", "resource_type": "routing_table", "route_direct_link_ingress": false, "route_internet_ingress": true, "route_transit_gateway_ingress": false, "route_vpc_zone_ingress": true, "routes": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "name": "my-route-1"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}]}'
responses.add(
responses.GET,
url,
@@ -3413,7 +3430,7 @@ def test_get_vpc_routing_table_value_error(self):
"""
# Set up mock
url = preprocess_url('/vpcs/testString/routing_tables/testString')
- mock_response = '{"accept_routes_from": [{"resource_type": "vpn_gateway"}], "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "is_default": true, "lifecycle_state": "stable", "name": "my-routing-table-1", "resource_type": "routing_table", "route_direct_link_ingress": false, "route_internet_ingress": true, "route_transit_gateway_ingress": false, "route_vpc_zone_ingress": true, "routes": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "name": "my-route-1"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}]}'
+ mock_response = '{"accept_routes_from": [{"resource_type": "vpn_gateway"}], "advertise_routes_to": ["transit_gateway"], "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "is_default": true, "lifecycle_state": "stable", "name": "my-routing-table-1", "resource_type": "routing_table", "route_direct_link_ingress": false, "route_internet_ingress": true, "route_transit_gateway_ingress": false, "route_vpc_zone_ingress": true, "routes": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "name": "my-route-1"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}]}'
responses.add(
responses.GET,
url,
@@ -3458,7 +3475,7 @@ def test_update_vpc_routing_table_all_params(self):
"""
# Set up mock
url = preprocess_url('/vpcs/testString/routing_tables/testString')
- mock_response = '{"accept_routes_from": [{"resource_type": "vpn_gateway"}], "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "is_default": true, "lifecycle_state": "stable", "name": "my-routing-table-1", "resource_type": "routing_table", "route_direct_link_ingress": false, "route_internet_ingress": true, "route_transit_gateway_ingress": false, "route_vpc_zone_ingress": true, "routes": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "name": "my-route-1"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}]}'
+ mock_response = '{"accept_routes_from": [{"resource_type": "vpn_gateway"}], "advertise_routes_to": ["transit_gateway"], "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "is_default": true, "lifecycle_state": "stable", "name": "my-routing-table-1", "resource_type": "routing_table", "route_direct_link_ingress": false, "route_internet_ingress": true, "route_transit_gateway_ingress": false, "route_vpc_zone_ingress": true, "routes": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "name": "my-route-1"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}]}'
responses.add(
responses.PATCH,
url,
@@ -3474,6 +3491,7 @@ def test_update_vpc_routing_table_all_params(self):
# Construct a dict representation of a RoutingTablePatch model
routing_table_patch_model = {}
routing_table_patch_model['accept_routes_from'] = [resource_filter_model]
+ routing_table_patch_model['advertise_routes_to'] = ['transit_gateway']
routing_table_patch_model['name'] = 'my-routing-table-2'
routing_table_patch_model['route_direct_link_ingress'] = True
routing_table_patch_model['route_internet_ingress'] = True
@@ -3518,7 +3536,7 @@ def test_update_vpc_routing_table_required_params(self):
"""
# Set up mock
url = preprocess_url('/vpcs/testString/routing_tables/testString')
- mock_response = '{"accept_routes_from": [{"resource_type": "vpn_gateway"}], "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "is_default": true, "lifecycle_state": "stable", "name": "my-routing-table-1", "resource_type": "routing_table", "route_direct_link_ingress": false, "route_internet_ingress": true, "route_transit_gateway_ingress": false, "route_vpc_zone_ingress": true, "routes": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "name": "my-route-1"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}]}'
+ mock_response = '{"accept_routes_from": [{"resource_type": "vpn_gateway"}], "advertise_routes_to": ["transit_gateway"], "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "is_default": true, "lifecycle_state": "stable", "name": "my-routing-table-1", "resource_type": "routing_table", "route_direct_link_ingress": false, "route_internet_ingress": true, "route_transit_gateway_ingress": false, "route_vpc_zone_ingress": true, "routes": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "name": "my-route-1"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}]}'
responses.add(
responses.PATCH,
url,
@@ -3534,6 +3552,7 @@ def test_update_vpc_routing_table_required_params(self):
# Construct a dict representation of a RoutingTablePatch model
routing_table_patch_model = {}
routing_table_patch_model['accept_routes_from'] = [resource_filter_model]
+ routing_table_patch_model['advertise_routes_to'] = ['transit_gateway']
routing_table_patch_model['name'] = 'my-routing-table-2'
routing_table_patch_model['route_direct_link_ingress'] = True
routing_table_patch_model['route_internet_ingress'] = True
@@ -3576,7 +3595,7 @@ def test_update_vpc_routing_table_value_error(self):
"""
# Set up mock
url = preprocess_url('/vpcs/testString/routing_tables/testString')
- mock_response = '{"accept_routes_from": [{"resource_type": "vpn_gateway"}], "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "is_default": true, "lifecycle_state": "stable", "name": "my-routing-table-1", "resource_type": "routing_table", "route_direct_link_ingress": false, "route_internet_ingress": true, "route_transit_gateway_ingress": false, "route_vpc_zone_ingress": true, "routes": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "name": "my-route-1"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}]}'
+ mock_response = '{"accept_routes_from": [{"resource_type": "vpn_gateway"}], "advertise_routes_to": ["transit_gateway"], "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "is_default": true, "lifecycle_state": "stable", "name": "my-routing-table-1", "resource_type": "routing_table", "route_direct_link_ingress": false, "route_internet_ingress": true, "route_transit_gateway_ingress": false, "route_vpc_zone_ingress": true, "routes": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "name": "my-route-1"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}]}'
responses.add(
responses.PATCH,
url,
@@ -3592,6 +3611,7 @@ def test_update_vpc_routing_table_value_error(self):
# Construct a dict representation of a RoutingTablePatch model
routing_table_patch_model = {}
routing_table_patch_model['accept_routes_from'] = [resource_filter_model]
+ routing_table_patch_model['advertise_routes_to'] = ['transit_gateway']
routing_table_patch_model['name'] = 'my-routing-table-2'
routing_table_patch_model['route_direct_link_ingress'] = True
routing_table_patch_model['route_internet_ingress'] = True
@@ -3636,7 +3656,7 @@ def test_list_vpc_routing_table_routes_all_params(self):
"""
# Set up mock
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", "creator": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-vpn-gateway", "resource_type": "vpn_gateway"}, "destination": "192.168.3.0/24", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_state": "stable", "name": "my-route-1", "next_hop": {"address": "192.168.3.4"}, "origin": "service", "priority": 1, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "total_count": 132}'
+ 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", "advertise": false, "created_at": "2019-01-01T12:00:00.000Z", "creator": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-vpn-gateway", "resource_type": "vpn_gateway"}, "destination": "192.168.3.0/24", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_state": "stable", "name": "my-route-1", "next_hop": {"address": "192.168.3.4"}, "origin": "service", "priority": 1, "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,
@@ -3685,7 +3705,7 @@ def test_list_vpc_routing_table_routes_required_params(self):
"""
# Set up mock
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", "creator": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-vpn-gateway", "resource_type": "vpn_gateway"}, "destination": "192.168.3.0/24", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_state": "stable", "name": "my-route-1", "next_hop": {"address": "192.168.3.4"}, "origin": "service", "priority": 1, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "total_count": 132}'
+ 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", "advertise": false, "created_at": "2019-01-01T12:00:00.000Z", "creator": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-vpn-gateway", "resource_type": "vpn_gateway"}, "destination": "192.168.3.0/24", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_state": "stable", "name": "my-route-1", "next_hop": {"address": "192.168.3.4"}, "origin": "service", "priority": 1, "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,
@@ -3725,7 +3745,7 @@ def test_list_vpc_routing_table_routes_value_error(self):
"""
# Set up mock
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", "creator": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-vpn-gateway", "resource_type": "vpn_gateway"}, "destination": "192.168.3.0/24", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_state": "stable", "name": "my-route-1", "next_hop": {"address": "192.168.3.4"}, "origin": "service", "priority": 1, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "total_count": 132}'
+ 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", "advertise": false, "created_at": "2019-01-01T12:00:00.000Z", "creator": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-vpn-gateway", "resource_type": "vpn_gateway"}, "destination": "192.168.3.0/24", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_state": "stable", "name": "my-route-1", "next_hop": {"address": "192.168.3.4"}, "origin": "service", "priority": 1, "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,
@@ -3764,8 +3784,8 @@ def test_list_vpc_routing_table_routes_with_pager_get_next(self):
"""
# Set up a two-page mock response
url = preprocess_url('/vpcs/testString/routing_tables/testString/routes')
- mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"routes":[{"action":"delegate","created_at":"2019-01-01T12:00:00.000Z","creator":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b","id":"ddf51bec-3424-11e8-b467-0ed5f89f718b","name":"my-vpn-gateway","resource_type":"vpn_gateway"},"destination":"192.168.3.0/24","href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531","id":"1a15dca5-7e33-45e1-b7c5-bc690e569531","lifecycle_state":"stable","name":"my-route-1","next_hop":{"address":"192.168.3.4"},"origin":"service","priority":1,"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"total_count":2,"limit":1}'
- mock_response2 = '{"routes":[{"action":"delegate","created_at":"2019-01-01T12:00:00.000Z","creator":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b","id":"ddf51bec-3424-11e8-b467-0ed5f89f718b","name":"my-vpn-gateway","resource_type":"vpn_gateway"},"destination":"192.168.3.0/24","href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531","id":"1a15dca5-7e33-45e1-b7c5-bc690e569531","lifecycle_state":"stable","name":"my-route-1","next_hop":{"address":"192.168.3.4"},"origin":"service","priority":1,"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"total_count":2,"limit":1}'
+ mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"routes":[{"action":"delegate","advertise":false,"created_at":"2019-01-01T12:00:00.000Z","creator":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b","id":"ddf51bec-3424-11e8-b467-0ed5f89f718b","name":"my-vpn-gateway","resource_type":"vpn_gateway"},"destination":"192.168.3.0/24","href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531","id":"1a15dca5-7e33-45e1-b7c5-bc690e569531","lifecycle_state":"stable","name":"my-route-1","next_hop":{"address":"192.168.3.4"},"origin":"service","priority":1,"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"total_count":2,"limit":1}'
+ mock_response2 = '{"routes":[{"action":"delegate","advertise":false,"created_at":"2019-01-01T12:00:00.000Z","creator":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b","id":"ddf51bec-3424-11e8-b467-0ed5f89f718b","name":"my-vpn-gateway","resource_type":"vpn_gateway"},"destination":"192.168.3.0/24","href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531","id":"1a15dca5-7e33-45e1-b7c5-bc690e569531","lifecycle_state":"stable","name":"my-route-1","next_hop":{"address":"192.168.3.4"},"origin":"service","priority":1,"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"total_count":2,"limit":1}'
responses.add(
responses.GET,
url,
@@ -3802,8 +3822,8 @@ def test_list_vpc_routing_table_routes_with_pager_get_all(self):
"""
# Set up a two-page mock response
url = preprocess_url('/vpcs/testString/routing_tables/testString/routes')
- mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"routes":[{"action":"delegate","created_at":"2019-01-01T12:00:00.000Z","creator":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b","id":"ddf51bec-3424-11e8-b467-0ed5f89f718b","name":"my-vpn-gateway","resource_type":"vpn_gateway"},"destination":"192.168.3.0/24","href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531","id":"1a15dca5-7e33-45e1-b7c5-bc690e569531","lifecycle_state":"stable","name":"my-route-1","next_hop":{"address":"192.168.3.4"},"origin":"service","priority":1,"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"total_count":2,"limit":1}'
- mock_response2 = '{"routes":[{"action":"delegate","created_at":"2019-01-01T12:00:00.000Z","creator":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b","id":"ddf51bec-3424-11e8-b467-0ed5f89f718b","name":"my-vpn-gateway","resource_type":"vpn_gateway"},"destination":"192.168.3.0/24","href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531","id":"1a15dca5-7e33-45e1-b7c5-bc690e569531","lifecycle_state":"stable","name":"my-route-1","next_hop":{"address":"192.168.3.4"},"origin":"service","priority":1,"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"total_count":2,"limit":1}'
+ mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"routes":[{"action":"delegate","advertise":false,"created_at":"2019-01-01T12:00:00.000Z","creator":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b","id":"ddf51bec-3424-11e8-b467-0ed5f89f718b","name":"my-vpn-gateway","resource_type":"vpn_gateway"},"destination":"192.168.3.0/24","href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531","id":"1a15dca5-7e33-45e1-b7c5-bc690e569531","lifecycle_state":"stable","name":"my-route-1","next_hop":{"address":"192.168.3.4"},"origin":"service","priority":1,"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"total_count":2,"limit":1}'
+ mock_response2 = '{"routes":[{"action":"delegate","advertise":false,"created_at":"2019-01-01T12:00:00.000Z","creator":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b","id":"ddf51bec-3424-11e8-b467-0ed5f89f718b","name":"my-vpn-gateway","resource_type":"vpn_gateway"},"destination":"192.168.3.0/24","href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531","id":"1a15dca5-7e33-45e1-b7c5-bc690e569531","lifecycle_state":"stable","name":"my-route-1","next_hop":{"address":"192.168.3.4"},"origin":"service","priority":1,"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"total_count":2,"limit":1}'
responses.add(
responses.GET,
url,
@@ -3843,7 +3863,7 @@ def test_create_vpc_routing_table_route_all_params(self):
"""
# Set up mock
url = preprocess_url('/vpcs/testString/routing_tables/testString/routes')
- mock_response = '{"action": "delegate", "created_at": "2019-01-01T12:00:00.000Z", "creator": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-vpn-gateway", "resource_type": "vpn_gateway"}, "destination": "192.168.3.0/24", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_state": "stable", "name": "my-route-1", "next_hop": {"address": "192.168.3.4"}, "origin": "service", "priority": 1, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
+ mock_response = '{"action": "delegate", "advertise": false, "created_at": "2019-01-01T12:00:00.000Z", "creator": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-vpn-gateway", "resource_type": "vpn_gateway"}, "destination": "192.168.3.0/24", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_state": "stable", "name": "my-route-1", "next_hop": {"address": "192.168.3.4"}, "origin": "service", "priority": 1, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
responses.add(
responses.POST,
url,
@@ -3866,6 +3886,7 @@ def test_create_vpc_routing_table_route_all_params(self):
destination = '192.168.3.0/24'
zone = zone_identity_model
action = 'deliver'
+ advertise = False
name = 'my-route-1'
next_hop = route_prototype_next_hop_model
priority = 1
@@ -3877,6 +3898,7 @@ def test_create_vpc_routing_table_route_all_params(self):
destination,
zone,
action=action,
+ advertise=advertise,
name=name,
next_hop=next_hop,
priority=priority,
@@ -3891,6 +3913,7 @@ def test_create_vpc_routing_table_route_all_params(self):
assert req_body['destination'] == '192.168.3.0/24'
assert req_body['zone'] == zone_identity_model
assert req_body['action'] == 'deliver'
+ assert req_body['advertise'] == False
assert req_body['name'] == 'my-route-1'
assert req_body['next_hop'] == route_prototype_next_hop_model
assert req_body['priority'] == 1
@@ -3911,7 +3934,7 @@ def test_create_vpc_routing_table_route_value_error(self):
"""
# Set up mock
url = preprocess_url('/vpcs/testString/routing_tables/testString/routes')
- mock_response = '{"action": "delegate", "created_at": "2019-01-01T12:00:00.000Z", "creator": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-vpn-gateway", "resource_type": "vpn_gateway"}, "destination": "192.168.3.0/24", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_state": "stable", "name": "my-route-1", "next_hop": {"address": "192.168.3.4"}, "origin": "service", "priority": 1, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
+ mock_response = '{"action": "delegate", "advertise": false, "created_at": "2019-01-01T12:00:00.000Z", "creator": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-vpn-gateway", "resource_type": "vpn_gateway"}, "destination": "192.168.3.0/24", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_state": "stable", "name": "my-route-1", "next_hop": {"address": "192.168.3.4"}, "origin": "service", "priority": 1, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
responses.add(
responses.POST,
url,
@@ -3934,6 +3957,7 @@ def test_create_vpc_routing_table_route_value_error(self):
destination = '192.168.3.0/24'
zone = zone_identity_model
action = 'deliver'
+ advertise = False
name = 'my-route-1'
next_hop = route_prototype_next_hop_model
priority = 1
@@ -4055,7 +4079,7 @@ def test_get_vpc_routing_table_route_all_params(self):
"""
# Set up mock
url = preprocess_url('/vpcs/testString/routing_tables/testString/routes/testString')
- mock_response = '{"action": "delegate", "created_at": "2019-01-01T12:00:00.000Z", "creator": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-vpn-gateway", "resource_type": "vpn_gateway"}, "destination": "192.168.3.0/24", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_state": "stable", "name": "my-route-1", "next_hop": {"address": "192.168.3.4"}, "origin": "service", "priority": 1, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
+ mock_response = '{"action": "delegate", "advertise": false, "created_at": "2019-01-01T12:00:00.000Z", "creator": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-vpn-gateway", "resource_type": "vpn_gateway"}, "destination": "192.168.3.0/24", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_state": "stable", "name": "my-route-1", "next_hop": {"address": "192.168.3.4"}, "origin": "service", "priority": 1, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
responses.add(
responses.GET,
url,
@@ -4097,7 +4121,7 @@ def test_get_vpc_routing_table_route_value_error(self):
"""
# Set up mock
url = preprocess_url('/vpcs/testString/routing_tables/testString/routes/testString')
- mock_response = '{"action": "delegate", "created_at": "2019-01-01T12:00:00.000Z", "creator": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-vpn-gateway", "resource_type": "vpn_gateway"}, "destination": "192.168.3.0/24", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_state": "stable", "name": "my-route-1", "next_hop": {"address": "192.168.3.4"}, "origin": "service", "priority": 1, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
+ mock_response = '{"action": "delegate", "advertise": false, "created_at": "2019-01-01T12:00:00.000Z", "creator": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-vpn-gateway", "resource_type": "vpn_gateway"}, "destination": "192.168.3.0/24", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_state": "stable", "name": "my-route-1", "next_hop": {"address": "192.168.3.4"}, "origin": "service", "priority": 1, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
responses.add(
responses.GET,
url,
@@ -4144,7 +4168,7 @@ def test_update_vpc_routing_table_route_all_params(self):
"""
# Set up mock
url = preprocess_url('/vpcs/testString/routing_tables/testString/routes/testString')
- mock_response = '{"action": "delegate", "created_at": "2019-01-01T12:00:00.000Z", "creator": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-vpn-gateway", "resource_type": "vpn_gateway"}, "destination": "192.168.3.0/24", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_state": "stable", "name": "my-route-1", "next_hop": {"address": "192.168.3.4"}, "origin": "service", "priority": 1, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
+ mock_response = '{"action": "delegate", "advertise": false, "created_at": "2019-01-01T12:00:00.000Z", "creator": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-vpn-gateway", "resource_type": "vpn_gateway"}, "destination": "192.168.3.0/24", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_state": "stable", "name": "my-route-1", "next_hop": {"address": "192.168.3.4"}, "origin": "service", "priority": 1, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
responses.add(
responses.PATCH,
url,
@@ -4159,6 +4183,7 @@ def test_update_vpc_routing_table_route_all_params(self):
# Construct a dict representation of a RoutePatch model
route_patch_model = {}
+ route_patch_model['advertise'] = True
route_patch_model['name'] = 'my-route-2'
route_patch_model['next_hop'] = route_next_hop_patch_model
route_patch_model['priority'] = 1
@@ -4201,7 +4226,7 @@ def test_update_vpc_routing_table_route_value_error(self):
"""
# Set up mock
url = preprocess_url('/vpcs/testString/routing_tables/testString/routes/testString')
- mock_response = '{"action": "delegate", "created_at": "2019-01-01T12:00:00.000Z", "creator": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-vpn-gateway", "resource_type": "vpn_gateway"}, "destination": "192.168.3.0/24", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_state": "stable", "name": "my-route-1", "next_hop": {"address": "192.168.3.4"}, "origin": "service", "priority": 1, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
+ mock_response = '{"action": "delegate", "advertise": false, "created_at": "2019-01-01T12:00:00.000Z", "creator": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-vpn-gateway", "resource_type": "vpn_gateway"}, "destination": "192.168.3.0/24", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_state": "stable", "name": "my-route-1", "next_hop": {"address": "192.168.3.4"}, "origin": "service", "priority": 1, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
responses.add(
responses.PATCH,
url,
@@ -4216,6 +4241,7 @@ def test_update_vpc_routing_table_route_value_error(self):
# Construct a dict representation of a RoutePatch model
route_patch_model = {}
+ route_patch_model['advertise'] = True
route_patch_model['name'] = 'my-route-2'
route_patch_model['next_hop'] = route_next_hop_patch_model
route_patch_model['priority'] = 1
@@ -5404,7 +5430,7 @@ def test_get_subnet_routing_table_all_params(self):
"""
# Set up mock
url = preprocess_url('/subnets/testString/routing_table')
- mock_response = '{"accept_routes_from": [{"resource_type": "vpn_gateway"}], "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "is_default": true, "lifecycle_state": "stable", "name": "my-routing-table-1", "resource_type": "routing_table", "route_direct_link_ingress": false, "route_internet_ingress": true, "route_transit_gateway_ingress": false, "route_vpc_zone_ingress": true, "routes": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "name": "my-route-1"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}]}'
+ mock_response = '{"accept_routes_from": [{"resource_type": "vpn_gateway"}], "advertise_routes_to": ["transit_gateway"], "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "is_default": true, "lifecycle_state": "stable", "name": "my-routing-table-1", "resource_type": "routing_table", "route_direct_link_ingress": false, "route_internet_ingress": true, "route_transit_gateway_ingress": false, "route_vpc_zone_ingress": true, "routes": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "name": "my-route-1"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}]}'
responses.add(
responses.GET,
url,
@@ -5442,7 +5468,7 @@ def test_get_subnet_routing_table_value_error(self):
"""
# Set up mock
url = preprocess_url('/subnets/testString/routing_table')
- mock_response = '{"accept_routes_from": [{"resource_type": "vpn_gateway"}], "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "is_default": true, "lifecycle_state": "stable", "name": "my-routing-table-1", "resource_type": "routing_table", "route_direct_link_ingress": false, "route_internet_ingress": true, "route_transit_gateway_ingress": false, "route_vpc_zone_ingress": true, "routes": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "name": "my-route-1"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}]}'
+ mock_response = '{"accept_routes_from": [{"resource_type": "vpn_gateway"}], "advertise_routes_to": ["transit_gateway"], "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "is_default": true, "lifecycle_state": "stable", "name": "my-routing-table-1", "resource_type": "routing_table", "route_direct_link_ingress": false, "route_internet_ingress": true, "route_transit_gateway_ingress": false, "route_vpc_zone_ingress": true, "routes": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "name": "my-route-1"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}]}'
responses.add(
responses.GET,
url,
@@ -5485,7 +5511,7 @@ def test_replace_subnet_routing_table_all_params(self):
"""
# Set up mock
url = preprocess_url('/subnets/testString/routing_table')
- mock_response = '{"accept_routes_from": [{"resource_type": "vpn_gateway"}], "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "is_default": true, "lifecycle_state": "stable", "name": "my-routing-table-1", "resource_type": "routing_table", "route_direct_link_ingress": false, "route_internet_ingress": true, "route_transit_gateway_ingress": false, "route_vpc_zone_ingress": true, "routes": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "name": "my-route-1"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}]}'
+ mock_response = '{"accept_routes_from": [{"resource_type": "vpn_gateway"}], "advertise_routes_to": ["transit_gateway"], "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "is_default": true, "lifecycle_state": "stable", "name": "my-routing-table-1", "resource_type": "routing_table", "route_direct_link_ingress": false, "route_internet_ingress": true, "route_transit_gateway_ingress": false, "route_vpc_zone_ingress": true, "routes": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "name": "my-route-1"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}]}'
responses.add(
responses.PUT,
url,
@@ -5532,7 +5558,7 @@ def test_replace_subnet_routing_table_value_error(self):
"""
# Set up mock
url = preprocess_url('/subnets/testString/routing_table')
- mock_response = '{"accept_routes_from": [{"resource_type": "vpn_gateway"}], "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "is_default": true, "lifecycle_state": "stable", "name": "my-routing-table-1", "resource_type": "routing_table", "route_direct_link_ingress": false, "route_internet_ingress": true, "route_transit_gateway_ingress": false, "route_vpc_zone_ingress": true, "routes": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "name": "my-route-1"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}]}'
+ mock_response = '{"accept_routes_from": [{"resource_type": "vpn_gateway"}], "advertise_routes_to": ["transit_gateway"], "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "is_default": true, "lifecycle_state": "stable", "name": "my-routing-table-1", "resource_type": "routing_table", "route_direct_link_ingress": false, "route_internet_ingress": true, "route_transit_gateway_ingress": false, "route_vpc_zone_ingress": true, "routes": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "name": "my-route-1"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}]}'
responses.add(
responses.PUT,
url,
@@ -5595,6 +5621,10 @@ def test_list_subnet_reserved_ips_all_params(self):
start = 'testString'
limit = 50
sort = 'name'
+ target_id = 'testString'
+ target_crn = 'crn:v1:bluemix:public:is:us-south:a/123456::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727'
+ target_name = 'my-resource'
+ target_resource_type = 'testString'
# Invoke method
response = _service.list_subnet_reserved_ips(
@@ -5602,6 +5632,10 @@ def test_list_subnet_reserved_ips_all_params(self):
start=start,
limit=limit,
sort=sort,
+ target_id=target_id,
+ target_crn=target_crn,
+ target_name=target_name,
+ target_resource_type=target_resource_type,
headers={},
)
@@ -5614,6 +5648,10 @@ def test_list_subnet_reserved_ips_all_params(self):
assert 'start={}'.format(start) in query_string
assert 'limit={}'.format(limit) in query_string
assert 'sort={}'.format(sort) in query_string
+ assert 'target.id={}'.format(target_id) in query_string
+ assert 'target.crn={}'.format(target_crn) in query_string
+ assert 'target.name={}'.format(target_name) in query_string
+ assert 'target.resource_type={}'.format(target_resource_type) in query_string
def test_list_subnet_reserved_ips_all_params_with_retries(self):
# Enable retries and run test_list_subnet_reserved_ips_all_params.
@@ -5730,6 +5768,10 @@ def test_list_subnet_reserved_ips_with_pager_get_next(self):
subnet_id='testString',
limit=10,
sort='name',
+ target_id='testString',
+ target_crn='crn:v1:bluemix:public:is:us-south:a/123456::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727',
+ target_name='my-resource',
+ target_resource_type='testString',
)
while pager.has_next():
next_page = pager.get_next()
@@ -5767,6 +5809,10 @@ def test_list_subnet_reserved_ips_with_pager_get_all(self):
subnet_id='testString',
limit=10,
sort='name',
+ target_id='testString',
+ target_crn='crn:v1:bluemix:public:is:us-south:a/123456::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727',
+ target_name='my-resource',
+ target_resource_type='testString',
)
all_results = pager.get_all()
assert all_results is not None
@@ -8378,7 +8424,7 @@ def test_list_instance_profiles_all_params(self):
"""
# Set up mock
url = preprocess_url('/instance/profiles')
- mock_response = '{"profiles": [{"bandwidth": {"type": "fixed", "value": 20000}, "disks": [{"quantity": {"type": "fixed", "value": 4}, "size": {"type": "fixed", "value": 100}, "supported_interface_types": {"default": "nvme", "type": "enum", "values": ["nvme"]}}], "family": "balanced", "gpu_count": {"type": "fixed", "value": 2}, "gpu_manufacturer": {"type": "enum", "values": ["nvidia"]}, "gpu_memory": {"type": "fixed", "value": 16}, "gpu_model": {"type": "enum", "values": ["Tesla V100"]}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "memory": {"type": "fixed", "value": 16}, "name": "bx2-4x16", "network_interface_count": {"max": 5, "min": 1, "type": "range"}, "numa_count": {"type": "fixed", "value": 2}, "os_architecture": {"default": "default", "type": "enum", "values": ["amd64"]}, "port_speed": {"type": "fixed", "value": 1000}, "status": "current", "total_volume_bandwidth": {"type": "fixed", "value": 20000}, "vcpu_architecture": {"default": "default", "type": "fixed", "value": "amd64"}, "vcpu_count": {"type": "fixed", "value": 16}, "vcpu_manufacturer": {"default": "default", "type": "fixed", "value": "intel"}}]}'
+ mock_response = '{"profiles": [{"bandwidth": {"type": "fixed", "value": 20000}, "disks": [{"quantity": {"type": "fixed", "value": 4}, "size": {"type": "fixed", "value": 100}, "supported_interface_types": {"default": "nvme", "type": "enum", "values": ["nvme"]}}], "family": "balanced", "gpu_count": {"type": "fixed", "value": 2}, "gpu_manufacturer": {"type": "enum", "values": ["nvidia"]}, "gpu_memory": {"type": "fixed", "value": 16}, "gpu_model": {"type": "enum", "values": ["Tesla V100"]}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "memory": {"type": "fixed", "value": 16}, "name": "bx2-4x16", "network_attachment_count": {"max": 5, "min": 1, "type": "range"}, "network_interface_count": {"max": 5, "min": 1, "type": "range"}, "numa_count": {"type": "fixed", "value": 2}, "os_architecture": {"default": "default", "type": "enum", "values": ["amd64"]}, "port_speed": {"type": "fixed", "value": 1000}, "reservation_terms": {"type": "enum", "values": ["one_year"]}, "resource_type": "instance_profile", "status": "current", "total_volume_bandwidth": {"type": "fixed", "value": 20000}, "vcpu_architecture": {"default": "default", "type": "fixed", "value": "amd64"}, "vcpu_count": {"type": "fixed", "value": 16}, "vcpu_manufacturer": {"default": "default", "type": "fixed", "value": "intel"}}]}'
responses.add(
responses.GET,
url,
@@ -8410,7 +8456,7 @@ def test_list_instance_profiles_value_error(self):
"""
# Set up mock
url = preprocess_url('/instance/profiles')
- mock_response = '{"profiles": [{"bandwidth": {"type": "fixed", "value": 20000}, "disks": [{"quantity": {"type": "fixed", "value": 4}, "size": {"type": "fixed", "value": 100}, "supported_interface_types": {"default": "nvme", "type": "enum", "values": ["nvme"]}}], "family": "balanced", "gpu_count": {"type": "fixed", "value": 2}, "gpu_manufacturer": {"type": "enum", "values": ["nvidia"]}, "gpu_memory": {"type": "fixed", "value": 16}, "gpu_model": {"type": "enum", "values": ["Tesla V100"]}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "memory": {"type": "fixed", "value": 16}, "name": "bx2-4x16", "network_interface_count": {"max": 5, "min": 1, "type": "range"}, "numa_count": {"type": "fixed", "value": 2}, "os_architecture": {"default": "default", "type": "enum", "values": ["amd64"]}, "port_speed": {"type": "fixed", "value": 1000}, "status": "current", "total_volume_bandwidth": {"type": "fixed", "value": 20000}, "vcpu_architecture": {"default": "default", "type": "fixed", "value": "amd64"}, "vcpu_count": {"type": "fixed", "value": 16}, "vcpu_manufacturer": {"default": "default", "type": "fixed", "value": "intel"}}]}'
+ mock_response = '{"profiles": [{"bandwidth": {"type": "fixed", "value": 20000}, "disks": [{"quantity": {"type": "fixed", "value": 4}, "size": {"type": "fixed", "value": 100}, "supported_interface_types": {"default": "nvme", "type": "enum", "values": ["nvme"]}}], "family": "balanced", "gpu_count": {"type": "fixed", "value": 2}, "gpu_manufacturer": {"type": "enum", "values": ["nvidia"]}, "gpu_memory": {"type": "fixed", "value": 16}, "gpu_model": {"type": "enum", "values": ["Tesla V100"]}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "memory": {"type": "fixed", "value": 16}, "name": "bx2-4x16", "network_attachment_count": {"max": 5, "min": 1, "type": "range"}, "network_interface_count": {"max": 5, "min": 1, "type": "range"}, "numa_count": {"type": "fixed", "value": 2}, "os_architecture": {"default": "default", "type": "enum", "values": ["amd64"]}, "port_speed": {"type": "fixed", "value": 1000}, "reservation_terms": {"type": "enum", "values": ["one_year"]}, "resource_type": "instance_profile", "status": "current", "total_volume_bandwidth": {"type": "fixed", "value": 20000}, "vcpu_architecture": {"default": "default", "type": "fixed", "value": "amd64"}, "vcpu_count": {"type": "fixed", "value": 16}, "vcpu_manufacturer": {"default": "default", "type": "fixed", "value": "intel"}}]}'
responses.add(
responses.GET,
url,
@@ -8449,7 +8495,7 @@ def test_get_instance_profile_all_params(self):
"""
# Set up mock
url = preprocess_url('/instance/profiles/testString')
- mock_response = '{"bandwidth": {"type": "fixed", "value": 20000}, "disks": [{"quantity": {"type": "fixed", "value": 4}, "size": {"type": "fixed", "value": 100}, "supported_interface_types": {"default": "nvme", "type": "enum", "values": ["nvme"]}}], "family": "balanced", "gpu_count": {"type": "fixed", "value": 2}, "gpu_manufacturer": {"type": "enum", "values": ["nvidia"]}, "gpu_memory": {"type": "fixed", "value": 16}, "gpu_model": {"type": "enum", "values": ["Tesla V100"]}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "memory": {"type": "fixed", "value": 16}, "name": "bx2-4x16", "network_interface_count": {"max": 5, "min": 1, "type": "range"}, "numa_count": {"type": "fixed", "value": 2}, "os_architecture": {"default": "default", "type": "enum", "values": ["amd64"]}, "port_speed": {"type": "fixed", "value": 1000}, "status": "current", "total_volume_bandwidth": {"type": "fixed", "value": 20000}, "vcpu_architecture": {"default": "default", "type": "fixed", "value": "amd64"}, "vcpu_count": {"type": "fixed", "value": 16}, "vcpu_manufacturer": {"default": "default", "type": "fixed", "value": "intel"}}'
+ mock_response = '{"bandwidth": {"type": "fixed", "value": 20000}, "disks": [{"quantity": {"type": "fixed", "value": 4}, "size": {"type": "fixed", "value": 100}, "supported_interface_types": {"default": "nvme", "type": "enum", "values": ["nvme"]}}], "family": "balanced", "gpu_count": {"type": "fixed", "value": 2}, "gpu_manufacturer": {"type": "enum", "values": ["nvidia"]}, "gpu_memory": {"type": "fixed", "value": 16}, "gpu_model": {"type": "enum", "values": ["Tesla V100"]}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "memory": {"type": "fixed", "value": 16}, "name": "bx2-4x16", "network_attachment_count": {"max": 5, "min": 1, "type": "range"}, "network_interface_count": {"max": 5, "min": 1, "type": "range"}, "numa_count": {"type": "fixed", "value": 2}, "os_architecture": {"default": "default", "type": "enum", "values": ["amd64"]}, "port_speed": {"type": "fixed", "value": 1000}, "reservation_terms": {"type": "enum", "values": ["one_year"]}, "resource_type": "instance_profile", "status": "current", "total_volume_bandwidth": {"type": "fixed", "value": 20000}, "vcpu_architecture": {"default": "default", "type": "fixed", "value": "amd64"}, "vcpu_count": {"type": "fixed", "value": 16}, "vcpu_manufacturer": {"default": "default", "type": "fixed", "value": "intel"}}'
responses.add(
responses.GET,
url,
@@ -8487,7 +8533,7 @@ def test_get_instance_profile_value_error(self):
"""
# Set up mock
url = preprocess_url('/instance/profiles/testString')
- mock_response = '{"bandwidth": {"type": "fixed", "value": 20000}, "disks": [{"quantity": {"type": "fixed", "value": 4}, "size": {"type": "fixed", "value": 100}, "supported_interface_types": {"default": "nvme", "type": "enum", "values": ["nvme"]}}], "family": "balanced", "gpu_count": {"type": "fixed", "value": 2}, "gpu_manufacturer": {"type": "enum", "values": ["nvidia"]}, "gpu_memory": {"type": "fixed", "value": 16}, "gpu_model": {"type": "enum", "values": ["Tesla V100"]}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "memory": {"type": "fixed", "value": 16}, "name": "bx2-4x16", "network_interface_count": {"max": 5, "min": 1, "type": "range"}, "numa_count": {"type": "fixed", "value": 2}, "os_architecture": {"default": "default", "type": "enum", "values": ["amd64"]}, "port_speed": {"type": "fixed", "value": 1000}, "status": "current", "total_volume_bandwidth": {"type": "fixed", "value": 20000}, "vcpu_architecture": {"default": "default", "type": "fixed", "value": "amd64"}, "vcpu_count": {"type": "fixed", "value": 16}, "vcpu_manufacturer": {"default": "default", "type": "fixed", "value": "intel"}}'
+ mock_response = '{"bandwidth": {"type": "fixed", "value": 20000}, "disks": [{"quantity": {"type": "fixed", "value": 4}, "size": {"type": "fixed", "value": 100}, "supported_interface_types": {"default": "nvme", "type": "enum", "values": ["nvme"]}}], "family": "balanced", "gpu_count": {"type": "fixed", "value": 2}, "gpu_manufacturer": {"type": "enum", "values": ["nvidia"]}, "gpu_memory": {"type": "fixed", "value": 16}, "gpu_model": {"type": "enum", "values": ["Tesla V100"]}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "memory": {"type": "fixed", "value": 16}, "name": "bx2-4x16", "network_attachment_count": {"max": 5, "min": 1, "type": "range"}, "network_interface_count": {"max": 5, "min": 1, "type": "range"}, "numa_count": {"type": "fixed", "value": 2}, "os_architecture": {"default": "default", "type": "enum", "values": ["amd64"]}, "port_speed": {"type": "fixed", "value": 1000}, "reservation_terms": {"type": "enum", "values": ["one_year"]}, "resource_type": "instance_profile", "status": "current", "total_volume_bandwidth": {"type": "fixed", "value": 20000}, "vcpu_architecture": {"default": "default", "type": "fixed", "value": "amd64"}, "vcpu_count": {"type": "fixed", "value": 16}, "vcpu_manufacturer": {"default": "default", "type": "fixed", "value": "intel"}}'
responses.add(
responses.GET,
url,
@@ -8530,7 +8576,7 @@ def test_list_instance_templates_all_params(self):
"""
# Set up mock
url = preprocess_url('/instance/templates')
- mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "templates": [{"availability_policy": {"host_failure": "restart"}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "default_trusted_profile": {"auto_link": false, "target": {"id": "Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5"}}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "keys": [{"id": "a6b1a881-2ce8-41a3-80fc-36316a73f803"}], "metadata_service": {"enabled": false, "protocol": "https", "response_hop_limit": 2}, "name": "my-instance-template", "placement_target": {"id": "1e09281b-f177-46fb-baf1-bc152b2e391a"}, "profile": {"name": "bx2-4x16"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "total_volume_bandwidth": 500, "user_data": "user_data", "volume_attachments": [{"delete_volume_on_instance_delete": false, "name": "my-volume-attachment", "volume": {"id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5"}}], "vpc": {"id": "4727d842-f94f-4a2d-824a-9bc9b02c523b"}, "boot_volume_attachment": {"delete_volume_on_instance_delete": true, "name": "my-volume-attachment", "volume": {"capacity": 100, "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "iops": 10000, "name": "my-volume", "profile": {"name": "general-purpose"}, "resource_group": {"id": "fee82deba12e4c0fb69c3b09d1f12345"}, "user_tags": ["user_tags"]}}, "image": {"id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8"}, "network_interfaces": [{"allow_ip_spoofing": true, "name": "my-instance-network-interface", "primary_ip": {"id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb"}, "security_groups": [{"id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}], "primary_network_interface": {"allow_ip_spoofing": true, "name": "my-instance-network-interface", "primary_ip": {"id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb"}, "security_groups": [{"id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}, "zone": {"name": "us-south-1"}}], "total_count": 132}'
+ mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "templates": [{"availability_policy": {"host_failure": "restart"}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "default_trusted_profile": {"auto_link": false, "target": {"id": "Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5"}}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "keys": [{"id": "a6b1a881-2ce8-41a3-80fc-36316a73f803"}], "metadata_service": {"enabled": false, "protocol": "https", "response_hop_limit": 2}, "name": "my-instance-template", "placement_target": {"id": "1e09281b-f177-46fb-baf1-bc152b2e391a"}, "profile": {"name": "bx2-4x16"}, "reservation_affinity": {"policy": "disabled", "pool": [{"id": "7187-ba49df72-37b8-43ac-98da-f8e029de0e63"}]}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "total_volume_bandwidth": 500, "user_data": "user_data", "volume_attachments": [{"delete_volume_on_instance_delete": false, "name": "my-volume-attachment", "volume": {"id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5"}}], "vpc": {"id": "4727d842-f94f-4a2d-824a-9bc9b02c523b"}, "boot_volume_attachment": {"delete_volume_on_instance_delete": true, "name": "my-volume-attachment", "volume": {"capacity": 100, "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "iops": 10000, "name": "my-volume", "profile": {"name": "general-purpose"}, "resource_group": {"id": "fee82deba12e4c0fb69c3b09d1f12345"}, "user_tags": ["user_tags"]}}, "image": {"id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8"}, "zone": {"name": "us-south-1"}, "network_attachments": [{"name": "my-instance-network-attachment", "virtual_network_interface": {"allow_ip_spoofing": true, "auto_delete": false, "enable_infrastructure_nat": true, "ips": [{"id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb"}], "name": "my-virtual-network-interface", "primary_ip": {"id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb"}, "resource_group": {"id": "fee82deba12e4c0fb69c3b09d1f12345"}, "security_groups": [{"id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}}], "primary_network_attachment": {"name": "my-instance-network-attachment", "virtual_network_interface": {"allow_ip_spoofing": true, "auto_delete": false, "enable_infrastructure_nat": true, "ips": [{"id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb"}], "name": "my-virtual-network-interface", "primary_ip": {"id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb"}, "resource_group": {"id": "fee82deba12e4c0fb69c3b09d1f12345"}, "security_groups": [{"id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}}}], "total_count": 132}'
responses.add(
responses.GET,
url,
@@ -8562,7 +8608,7 @@ def test_list_instance_templates_value_error(self):
"""
# Set up mock
url = preprocess_url('/instance/templates')
- mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "templates": [{"availability_policy": {"host_failure": "restart"}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "default_trusted_profile": {"auto_link": false, "target": {"id": "Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5"}}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "keys": [{"id": "a6b1a881-2ce8-41a3-80fc-36316a73f803"}], "metadata_service": {"enabled": false, "protocol": "https", "response_hop_limit": 2}, "name": "my-instance-template", "placement_target": {"id": "1e09281b-f177-46fb-baf1-bc152b2e391a"}, "profile": {"name": "bx2-4x16"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "total_volume_bandwidth": 500, "user_data": "user_data", "volume_attachments": [{"delete_volume_on_instance_delete": false, "name": "my-volume-attachment", "volume": {"id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5"}}], "vpc": {"id": "4727d842-f94f-4a2d-824a-9bc9b02c523b"}, "boot_volume_attachment": {"delete_volume_on_instance_delete": true, "name": "my-volume-attachment", "volume": {"capacity": 100, "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "iops": 10000, "name": "my-volume", "profile": {"name": "general-purpose"}, "resource_group": {"id": "fee82deba12e4c0fb69c3b09d1f12345"}, "user_tags": ["user_tags"]}}, "image": {"id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8"}, "network_interfaces": [{"allow_ip_spoofing": true, "name": "my-instance-network-interface", "primary_ip": {"id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb"}, "security_groups": [{"id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}], "primary_network_interface": {"allow_ip_spoofing": true, "name": "my-instance-network-interface", "primary_ip": {"id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb"}, "security_groups": [{"id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}, "zone": {"name": "us-south-1"}}], "total_count": 132}'
+ mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "templates": [{"availability_policy": {"host_failure": "restart"}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "default_trusted_profile": {"auto_link": false, "target": {"id": "Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5"}}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "keys": [{"id": "a6b1a881-2ce8-41a3-80fc-36316a73f803"}], "metadata_service": {"enabled": false, "protocol": "https", "response_hop_limit": 2}, "name": "my-instance-template", "placement_target": {"id": "1e09281b-f177-46fb-baf1-bc152b2e391a"}, "profile": {"name": "bx2-4x16"}, "reservation_affinity": {"policy": "disabled", "pool": [{"id": "7187-ba49df72-37b8-43ac-98da-f8e029de0e63"}]}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "total_volume_bandwidth": 500, "user_data": "user_data", "volume_attachments": [{"delete_volume_on_instance_delete": false, "name": "my-volume-attachment", "volume": {"id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5"}}], "vpc": {"id": "4727d842-f94f-4a2d-824a-9bc9b02c523b"}, "boot_volume_attachment": {"delete_volume_on_instance_delete": true, "name": "my-volume-attachment", "volume": {"capacity": 100, "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "iops": 10000, "name": "my-volume", "profile": {"name": "general-purpose"}, "resource_group": {"id": "fee82deba12e4c0fb69c3b09d1f12345"}, "user_tags": ["user_tags"]}}, "image": {"id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8"}, "zone": {"name": "us-south-1"}, "network_attachments": [{"name": "my-instance-network-attachment", "virtual_network_interface": {"allow_ip_spoofing": true, "auto_delete": false, "enable_infrastructure_nat": true, "ips": [{"id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb"}], "name": "my-virtual-network-interface", "primary_ip": {"id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb"}, "resource_group": {"id": "fee82deba12e4c0fb69c3b09d1f12345"}, "security_groups": [{"id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}}], "primary_network_attachment": {"name": "my-instance-network-attachment", "virtual_network_interface": {"allow_ip_spoofing": true, "auto_delete": false, "enable_infrastructure_nat": true, "ips": [{"id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb"}], "name": "my-virtual-network-interface", "primary_ip": {"id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb"}, "resource_group": {"id": "fee82deba12e4c0fb69c3b09d1f12345"}, "security_groups": [{"id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}}}], "total_count": 132}'
responses.add(
responses.GET,
url,
@@ -8601,7 +8647,7 @@ def test_create_instance_template_all_params(self):
"""
# Set up mock
url = preprocess_url('/instance/templates')
- mock_response = '{"availability_policy": {"host_failure": "restart"}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "default_trusted_profile": {"auto_link": false, "target": {"id": "Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5"}}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "keys": [{"id": "a6b1a881-2ce8-41a3-80fc-36316a73f803"}], "metadata_service": {"enabled": false, "protocol": "https", "response_hop_limit": 2}, "name": "my-instance-template", "placement_target": {"id": "1e09281b-f177-46fb-baf1-bc152b2e391a"}, "profile": {"name": "bx2-4x16"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "total_volume_bandwidth": 500, "user_data": "user_data", "volume_attachments": [{"delete_volume_on_instance_delete": false, "name": "my-volume-attachment", "volume": {"id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5"}}], "vpc": {"id": "4727d842-f94f-4a2d-824a-9bc9b02c523b"}, "boot_volume_attachment": {"delete_volume_on_instance_delete": true, "name": "my-volume-attachment", "volume": {"capacity": 100, "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "iops": 10000, "name": "my-volume", "profile": {"name": "general-purpose"}, "resource_group": {"id": "fee82deba12e4c0fb69c3b09d1f12345"}, "user_tags": ["user_tags"]}}, "image": {"id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8"}, "network_interfaces": [{"allow_ip_spoofing": true, "name": "my-instance-network-interface", "primary_ip": {"id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb"}, "security_groups": [{"id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}], "primary_network_interface": {"allow_ip_spoofing": true, "name": "my-instance-network-interface", "primary_ip": {"id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb"}, "security_groups": [{"id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}, "zone": {"name": "us-south-1"}}'
+ mock_response = '{"availability_policy": {"host_failure": "restart"}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "default_trusted_profile": {"auto_link": false, "target": {"id": "Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5"}}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "keys": [{"id": "a6b1a881-2ce8-41a3-80fc-36316a73f803"}], "metadata_service": {"enabled": false, "protocol": "https", "response_hop_limit": 2}, "name": "my-instance-template", "placement_target": {"id": "1e09281b-f177-46fb-baf1-bc152b2e391a"}, "profile": {"name": "bx2-4x16"}, "reservation_affinity": {"policy": "disabled", "pool": [{"id": "7187-ba49df72-37b8-43ac-98da-f8e029de0e63"}]}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "total_volume_bandwidth": 500, "user_data": "user_data", "volume_attachments": [{"delete_volume_on_instance_delete": false, "name": "my-volume-attachment", "volume": {"id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5"}}], "vpc": {"id": "4727d842-f94f-4a2d-824a-9bc9b02c523b"}, "boot_volume_attachment": {"delete_volume_on_instance_delete": true, "name": "my-volume-attachment", "volume": {"capacity": 100, "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "iops": 10000, "name": "my-volume", "profile": {"name": "general-purpose"}, "resource_group": {"id": "fee82deba12e4c0fb69c3b09d1f12345"}, "user_tags": ["user_tags"]}}, "image": {"id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8"}, "zone": {"name": "us-south-1"}, "network_attachments": [{"name": "my-instance-network-attachment", "virtual_network_interface": {"allow_ip_spoofing": true, "auto_delete": false, "enable_infrastructure_nat": true, "ips": [{"id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb"}], "name": "my-virtual-network-interface", "primary_ip": {"id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb"}, "resource_group": {"id": "fee82deba12e4c0fb69c3b09d1f12345"}, "security_groups": [{"id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}}], "primary_network_attachment": {"name": "my-instance-network-attachment", "virtual_network_interface": {"allow_ip_spoofing": true, "auto_delete": false, "enable_infrastructure_nat": true, "ips": [{"id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb"}], "name": "my-virtual-network-interface", "primary_ip": {"id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb"}, "resource_group": {"id": "fee82deba12e4c0fb69c3b09d1f12345"}, "security_groups": [{"id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}}}'
responses.add(
responses.POST,
url,
@@ -8641,6 +8687,15 @@ def test_create_instance_template_all_params(self):
instance_profile_identity_model = {}
instance_profile_identity_model['name'] = 'bx2-2x8'
+ # Construct a dict representation of a ReservationIdentityById model
+ reservation_identity_model = {}
+ reservation_identity_model['id'] = '7187-ba49df72-37b8-43ac-98da-f8e029de0e63'
+
+ # Construct a dict representation of a InstanceReservationAffinityPrototype model
+ instance_reservation_affinity_prototype_model = {}
+ instance_reservation_affinity_prototype_model['policy'] = 'disabled'
+ instance_reservation_affinity_prototype_model['pool'] = [reservation_identity_model]
+
# Construct a dict representation of a ResourceGroupIdentityById model
resource_group_identity_model = {}
resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
@@ -8683,15 +8738,29 @@ def test_create_instance_template_all_params(self):
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 CatalogOfferingIdentityCatalogOfferingByCRN model
+ catalog_offering_identity_model = {}
+ catalog_offering_identity_model['crn'] = 'crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:offering:00111601-0ec5-41ac-b142-96d1e64e6442'
+
+ # Construct a dict representation of a InstanceCatalogOfferingPrototypeCatalogOfferingByOffering model
+ instance_catalog_offering_prototype_model = {}
+ instance_catalog_offering_prototype_model['offering'] = catalog_offering_identity_model
+
# Construct a dict representation of a ImageIdentityById model
image_identity_model = {}
image_identity_model['id'] = '3f9a2d96-830e-4100-9b4c-663225a3f872'
- # Construct a dict representation of a NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext model
- network_interface_ip_prototype_model = {}
- network_interface_ip_prototype_model['address'] = '10.0.0.5'
- network_interface_ip_prototype_model['auto_delete'] = False
- network_interface_ip_prototype_model['name'] = 'my-reserved-ip'
+ # Construct a dict representation of a VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext model
+ virtual_network_interface_ip_prototype_model = {}
+ virtual_network_interface_ip_prototype_model['address'] = '10.0.0.5'
+ virtual_network_interface_ip_prototype_model['auto_delete'] = False
+ virtual_network_interface_ip_prototype_model['name'] = 'my-reserved-ip'
+
+ # Construct a dict representation of a VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext model
+ virtual_network_interface_primary_ip_prototype_model = {}
+ virtual_network_interface_primary_ip_prototype_model['address'] = '10.0.0.5'
+ virtual_network_interface_primary_ip_prototype_model['auto_delete'] = False
+ virtual_network_interface_primary_ip_prototype_model['name'] = 'my-reserved-ip'
# Construct a dict representation of a SecurityGroupIdentityById model
security_group_identity_model = {}
@@ -8701,6 +8770,29 @@ def test_create_instance_template_all_params(self):
subnet_identity_model = {}
subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
+ # Construct a dict representation of a InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeInstanceNetworkAttachmentContext model
+ instance_network_attachment_prototype_virtual_network_interface_model = {}
+ instance_network_attachment_prototype_virtual_network_interface_model['allow_ip_spoofing'] = True
+ instance_network_attachment_prototype_virtual_network_interface_model['auto_delete'] = False
+ instance_network_attachment_prototype_virtual_network_interface_model['enable_infrastructure_nat'] = True
+ instance_network_attachment_prototype_virtual_network_interface_model['ips'] = [virtual_network_interface_ip_prototype_model]
+ instance_network_attachment_prototype_virtual_network_interface_model['name'] = 'my-virtual-network-interface'
+ instance_network_attachment_prototype_virtual_network_interface_model['primary_ip'] = virtual_network_interface_primary_ip_prototype_model
+ instance_network_attachment_prototype_virtual_network_interface_model['resource_group'] = resource_group_identity_model
+ instance_network_attachment_prototype_virtual_network_interface_model['security_groups'] = [security_group_identity_model]
+ instance_network_attachment_prototype_virtual_network_interface_model['subnet'] = subnet_identity_model
+
+ # Construct a dict representation of a InstanceNetworkAttachmentPrototype model
+ instance_network_attachment_prototype_model = {}
+ instance_network_attachment_prototype_model['name'] = 'my-instance-network-attachment'
+ instance_network_attachment_prototype_model['virtual_network_interface'] = instance_network_attachment_prototype_virtual_network_interface_model
+
+ # Construct a dict representation of a NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext model
+ network_interface_ip_prototype_model = {}
+ network_interface_ip_prototype_model['address'] = '10.0.0.5'
+ network_interface_ip_prototype_model['auto_delete'] = False
+ network_interface_ip_prototype_model['name'] = 'my-reserved-ip'
+
# Construct a dict representation of a NetworkInterfacePrototype model
network_interface_prototype_model = {}
network_interface_prototype_model['allow_ip_spoofing'] = True
@@ -8709,11 +8801,15 @@ def test_create_instance_template_all_params(self):
network_interface_prototype_model['security_groups'] = [security_group_identity_model]
network_interface_prototype_model['subnet'] = subnet_identity_model
+ # Construct a dict representation of a InstanceTemplateIdentityById model
+ instance_template_identity_model = {}
+ instance_template_identity_model['id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803'
+
# Construct a dict representation of a ZoneIdentityByName model
zone_identity_model = {}
zone_identity_model['name'] = 'us-south-1'
- # Construct a dict representation of a InstanceTemplatePrototypeInstanceTemplateByImage model
+ # Construct a dict representation of a InstanceTemplatePrototypeInstanceTemplateBySourceTemplate model
instance_template_prototype_model = {}
instance_template_prototype_model['availability_policy'] = instance_availability_policy_prototype_model
instance_template_prototype_model['default_trusted_profile'] = instance_default_trusted_profile_prototype_model
@@ -8722,15 +8818,20 @@ def test_create_instance_template_all_params(self):
instance_template_prototype_model['name'] = 'my-instance-template'
instance_template_prototype_model['placement_target'] = instance_placement_target_prototype_model
instance_template_prototype_model['profile'] = instance_profile_identity_model
+ instance_template_prototype_model['reservation_affinity'] = instance_reservation_affinity_prototype_model
instance_template_prototype_model['resource_group'] = resource_group_identity_model
instance_template_prototype_model['total_volume_bandwidth'] = 500
instance_template_prototype_model['user_data'] = 'testString'
instance_template_prototype_model['volume_attachments'] = [volume_attachment_prototype_model]
instance_template_prototype_model['vpc'] = vpc_identity_model
instance_template_prototype_model['boot_volume_attachment'] = volume_attachment_prototype_instance_by_image_context_model
+ instance_template_prototype_model['catalog_offering'] = instance_catalog_offering_prototype_model
instance_template_prototype_model['image'] = image_identity_model
+ instance_template_prototype_model['network_attachments'] = [instance_network_attachment_prototype_model]
instance_template_prototype_model['network_interfaces'] = [network_interface_prototype_model]
+ instance_template_prototype_model['primary_network_attachment'] = instance_network_attachment_prototype_model
instance_template_prototype_model['primary_network_interface'] = network_interface_prototype_model
+ instance_template_prototype_model['source_template'] = instance_template_identity_model
instance_template_prototype_model['zone'] = zone_identity_model
# Set up parameter values
@@ -8765,7 +8866,7 @@ def test_create_instance_template_value_error(self):
"""
# Set up mock
url = preprocess_url('/instance/templates')
- mock_response = '{"availability_policy": {"host_failure": "restart"}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "default_trusted_profile": {"auto_link": false, "target": {"id": "Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5"}}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "keys": [{"id": "a6b1a881-2ce8-41a3-80fc-36316a73f803"}], "metadata_service": {"enabled": false, "protocol": "https", "response_hop_limit": 2}, "name": "my-instance-template", "placement_target": {"id": "1e09281b-f177-46fb-baf1-bc152b2e391a"}, "profile": {"name": "bx2-4x16"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "total_volume_bandwidth": 500, "user_data": "user_data", "volume_attachments": [{"delete_volume_on_instance_delete": false, "name": "my-volume-attachment", "volume": {"id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5"}}], "vpc": {"id": "4727d842-f94f-4a2d-824a-9bc9b02c523b"}, "boot_volume_attachment": {"delete_volume_on_instance_delete": true, "name": "my-volume-attachment", "volume": {"capacity": 100, "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "iops": 10000, "name": "my-volume", "profile": {"name": "general-purpose"}, "resource_group": {"id": "fee82deba12e4c0fb69c3b09d1f12345"}, "user_tags": ["user_tags"]}}, "image": {"id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8"}, "network_interfaces": [{"allow_ip_spoofing": true, "name": "my-instance-network-interface", "primary_ip": {"id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb"}, "security_groups": [{"id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}], "primary_network_interface": {"allow_ip_spoofing": true, "name": "my-instance-network-interface", "primary_ip": {"id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb"}, "security_groups": [{"id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}, "zone": {"name": "us-south-1"}}'
+ mock_response = '{"availability_policy": {"host_failure": "restart"}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "default_trusted_profile": {"auto_link": false, "target": {"id": "Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5"}}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "keys": [{"id": "a6b1a881-2ce8-41a3-80fc-36316a73f803"}], "metadata_service": {"enabled": false, "protocol": "https", "response_hop_limit": 2}, "name": "my-instance-template", "placement_target": {"id": "1e09281b-f177-46fb-baf1-bc152b2e391a"}, "profile": {"name": "bx2-4x16"}, "reservation_affinity": {"policy": "disabled", "pool": [{"id": "7187-ba49df72-37b8-43ac-98da-f8e029de0e63"}]}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "total_volume_bandwidth": 500, "user_data": "user_data", "volume_attachments": [{"delete_volume_on_instance_delete": false, "name": "my-volume-attachment", "volume": {"id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5"}}], "vpc": {"id": "4727d842-f94f-4a2d-824a-9bc9b02c523b"}, "boot_volume_attachment": {"delete_volume_on_instance_delete": true, "name": "my-volume-attachment", "volume": {"capacity": 100, "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "iops": 10000, "name": "my-volume", "profile": {"name": "general-purpose"}, "resource_group": {"id": "fee82deba12e4c0fb69c3b09d1f12345"}, "user_tags": ["user_tags"]}}, "image": {"id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8"}, "zone": {"name": "us-south-1"}, "network_attachments": [{"name": "my-instance-network-attachment", "virtual_network_interface": {"allow_ip_spoofing": true, "auto_delete": false, "enable_infrastructure_nat": true, "ips": [{"id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb"}], "name": "my-virtual-network-interface", "primary_ip": {"id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb"}, "resource_group": {"id": "fee82deba12e4c0fb69c3b09d1f12345"}, "security_groups": [{"id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}}], "primary_network_attachment": {"name": "my-instance-network-attachment", "virtual_network_interface": {"allow_ip_spoofing": true, "auto_delete": false, "enable_infrastructure_nat": true, "ips": [{"id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb"}], "name": "my-virtual-network-interface", "primary_ip": {"id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb"}, "resource_group": {"id": "fee82deba12e4c0fb69c3b09d1f12345"}, "security_groups": [{"id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}}}'
responses.add(
responses.POST,
url,
@@ -8805,6 +8906,15 @@ def test_create_instance_template_value_error(self):
instance_profile_identity_model = {}
instance_profile_identity_model['name'] = 'bx2-2x8'
+ # Construct a dict representation of a ReservationIdentityById model
+ reservation_identity_model = {}
+ reservation_identity_model['id'] = '7187-ba49df72-37b8-43ac-98da-f8e029de0e63'
+
+ # Construct a dict representation of a InstanceReservationAffinityPrototype model
+ instance_reservation_affinity_prototype_model = {}
+ instance_reservation_affinity_prototype_model['policy'] = 'disabled'
+ instance_reservation_affinity_prototype_model['pool'] = [reservation_identity_model]
+
# Construct a dict representation of a ResourceGroupIdentityById model
resource_group_identity_model = {}
resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
@@ -8847,15 +8957,29 @@ def test_create_instance_template_value_error(self):
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 CatalogOfferingIdentityCatalogOfferingByCRN model
+ catalog_offering_identity_model = {}
+ catalog_offering_identity_model['crn'] = 'crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:offering:00111601-0ec5-41ac-b142-96d1e64e6442'
+
+ # Construct a dict representation of a InstanceCatalogOfferingPrototypeCatalogOfferingByOffering model
+ instance_catalog_offering_prototype_model = {}
+ instance_catalog_offering_prototype_model['offering'] = catalog_offering_identity_model
+
# Construct a dict representation of a ImageIdentityById model
image_identity_model = {}
image_identity_model['id'] = '3f9a2d96-830e-4100-9b4c-663225a3f872'
- # Construct a dict representation of a NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext model
- network_interface_ip_prototype_model = {}
- network_interface_ip_prototype_model['address'] = '10.0.0.5'
- network_interface_ip_prototype_model['auto_delete'] = False
- network_interface_ip_prototype_model['name'] = 'my-reserved-ip'
+ # Construct a dict representation of a VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext model
+ virtual_network_interface_ip_prototype_model = {}
+ virtual_network_interface_ip_prototype_model['address'] = '10.0.0.5'
+ virtual_network_interface_ip_prototype_model['auto_delete'] = False
+ virtual_network_interface_ip_prototype_model['name'] = 'my-reserved-ip'
+
+ # Construct a dict representation of a VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext model
+ virtual_network_interface_primary_ip_prototype_model = {}
+ virtual_network_interface_primary_ip_prototype_model['address'] = '10.0.0.5'
+ virtual_network_interface_primary_ip_prototype_model['auto_delete'] = False
+ virtual_network_interface_primary_ip_prototype_model['name'] = 'my-reserved-ip'
# Construct a dict representation of a SecurityGroupIdentityById model
security_group_identity_model = {}
@@ -8865,6 +8989,29 @@ def test_create_instance_template_value_error(self):
subnet_identity_model = {}
subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
+ # Construct a dict representation of a InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeInstanceNetworkAttachmentContext model
+ instance_network_attachment_prototype_virtual_network_interface_model = {}
+ instance_network_attachment_prototype_virtual_network_interface_model['allow_ip_spoofing'] = True
+ instance_network_attachment_prototype_virtual_network_interface_model['auto_delete'] = False
+ instance_network_attachment_prototype_virtual_network_interface_model['enable_infrastructure_nat'] = True
+ instance_network_attachment_prototype_virtual_network_interface_model['ips'] = [virtual_network_interface_ip_prototype_model]
+ instance_network_attachment_prototype_virtual_network_interface_model['name'] = 'my-virtual-network-interface'
+ instance_network_attachment_prototype_virtual_network_interface_model['primary_ip'] = virtual_network_interface_primary_ip_prototype_model
+ instance_network_attachment_prototype_virtual_network_interface_model['resource_group'] = resource_group_identity_model
+ instance_network_attachment_prototype_virtual_network_interface_model['security_groups'] = [security_group_identity_model]
+ instance_network_attachment_prototype_virtual_network_interface_model['subnet'] = subnet_identity_model
+
+ # Construct a dict representation of a InstanceNetworkAttachmentPrototype model
+ instance_network_attachment_prototype_model = {}
+ instance_network_attachment_prototype_model['name'] = 'my-instance-network-attachment'
+ instance_network_attachment_prototype_model['virtual_network_interface'] = instance_network_attachment_prototype_virtual_network_interface_model
+
+ # Construct a dict representation of a NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext model
+ network_interface_ip_prototype_model = {}
+ network_interface_ip_prototype_model['address'] = '10.0.0.5'
+ network_interface_ip_prototype_model['auto_delete'] = False
+ network_interface_ip_prototype_model['name'] = 'my-reserved-ip'
+
# Construct a dict representation of a NetworkInterfacePrototype model
network_interface_prototype_model = {}
network_interface_prototype_model['allow_ip_spoofing'] = True
@@ -8873,11 +9020,15 @@ def test_create_instance_template_value_error(self):
network_interface_prototype_model['security_groups'] = [security_group_identity_model]
network_interface_prototype_model['subnet'] = subnet_identity_model
+ # Construct a dict representation of a InstanceTemplateIdentityById model
+ instance_template_identity_model = {}
+ instance_template_identity_model['id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803'
+
# Construct a dict representation of a ZoneIdentityByName model
zone_identity_model = {}
zone_identity_model['name'] = 'us-south-1'
- # Construct a dict representation of a InstanceTemplatePrototypeInstanceTemplateByImage model
+ # Construct a dict representation of a InstanceTemplatePrototypeInstanceTemplateBySourceTemplate model
instance_template_prototype_model = {}
instance_template_prototype_model['availability_policy'] = instance_availability_policy_prototype_model
instance_template_prototype_model['default_trusted_profile'] = instance_default_trusted_profile_prototype_model
@@ -8886,15 +9037,20 @@ def test_create_instance_template_value_error(self):
instance_template_prototype_model['name'] = 'my-instance-template'
instance_template_prototype_model['placement_target'] = instance_placement_target_prototype_model
instance_template_prototype_model['profile'] = instance_profile_identity_model
+ instance_template_prototype_model['reservation_affinity'] = instance_reservation_affinity_prototype_model
instance_template_prototype_model['resource_group'] = resource_group_identity_model
instance_template_prototype_model['total_volume_bandwidth'] = 500
instance_template_prototype_model['user_data'] = 'testString'
instance_template_prototype_model['volume_attachments'] = [volume_attachment_prototype_model]
instance_template_prototype_model['vpc'] = vpc_identity_model
instance_template_prototype_model['boot_volume_attachment'] = volume_attachment_prototype_instance_by_image_context_model
+ instance_template_prototype_model['catalog_offering'] = instance_catalog_offering_prototype_model
instance_template_prototype_model['image'] = image_identity_model
+ instance_template_prototype_model['network_attachments'] = [instance_network_attachment_prototype_model]
instance_template_prototype_model['network_interfaces'] = [network_interface_prototype_model]
+ instance_template_prototype_model['primary_network_attachment'] = instance_network_attachment_prototype_model
instance_template_prototype_model['primary_network_interface'] = network_interface_prototype_model
+ instance_template_prototype_model['source_template'] = instance_template_identity_model
instance_template_prototype_model['zone'] = zone_identity_model
# Set up parameter values
@@ -9006,7 +9162,7 @@ def test_get_instance_template_all_params(self):
"""
# Set up mock
url = preprocess_url('/instance/templates/testString')
- mock_response = '{"availability_policy": {"host_failure": "restart"}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "default_trusted_profile": {"auto_link": false, "target": {"id": "Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5"}}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "keys": [{"id": "a6b1a881-2ce8-41a3-80fc-36316a73f803"}], "metadata_service": {"enabled": false, "protocol": "https", "response_hop_limit": 2}, "name": "my-instance-template", "placement_target": {"id": "1e09281b-f177-46fb-baf1-bc152b2e391a"}, "profile": {"name": "bx2-4x16"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "total_volume_bandwidth": 500, "user_data": "user_data", "volume_attachments": [{"delete_volume_on_instance_delete": false, "name": "my-volume-attachment", "volume": {"id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5"}}], "vpc": {"id": "4727d842-f94f-4a2d-824a-9bc9b02c523b"}, "boot_volume_attachment": {"delete_volume_on_instance_delete": true, "name": "my-volume-attachment", "volume": {"capacity": 100, "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "iops": 10000, "name": "my-volume", "profile": {"name": "general-purpose"}, "resource_group": {"id": "fee82deba12e4c0fb69c3b09d1f12345"}, "user_tags": ["user_tags"]}}, "image": {"id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8"}, "network_interfaces": [{"allow_ip_spoofing": true, "name": "my-instance-network-interface", "primary_ip": {"id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb"}, "security_groups": [{"id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}], "primary_network_interface": {"allow_ip_spoofing": true, "name": "my-instance-network-interface", "primary_ip": {"id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb"}, "security_groups": [{"id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}, "zone": {"name": "us-south-1"}}'
+ mock_response = '{"availability_policy": {"host_failure": "restart"}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "default_trusted_profile": {"auto_link": false, "target": {"id": "Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5"}}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "keys": [{"id": "a6b1a881-2ce8-41a3-80fc-36316a73f803"}], "metadata_service": {"enabled": false, "protocol": "https", "response_hop_limit": 2}, "name": "my-instance-template", "placement_target": {"id": "1e09281b-f177-46fb-baf1-bc152b2e391a"}, "profile": {"name": "bx2-4x16"}, "reservation_affinity": {"policy": "disabled", "pool": [{"id": "7187-ba49df72-37b8-43ac-98da-f8e029de0e63"}]}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "total_volume_bandwidth": 500, "user_data": "user_data", "volume_attachments": [{"delete_volume_on_instance_delete": false, "name": "my-volume-attachment", "volume": {"id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5"}}], "vpc": {"id": "4727d842-f94f-4a2d-824a-9bc9b02c523b"}, "boot_volume_attachment": {"delete_volume_on_instance_delete": true, "name": "my-volume-attachment", "volume": {"capacity": 100, "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "iops": 10000, "name": "my-volume", "profile": {"name": "general-purpose"}, "resource_group": {"id": "fee82deba12e4c0fb69c3b09d1f12345"}, "user_tags": ["user_tags"]}}, "image": {"id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8"}, "zone": {"name": "us-south-1"}, "network_attachments": [{"name": "my-instance-network-attachment", "virtual_network_interface": {"allow_ip_spoofing": true, "auto_delete": false, "enable_infrastructure_nat": true, "ips": [{"id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb"}], "name": "my-virtual-network-interface", "primary_ip": {"id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb"}, "resource_group": {"id": "fee82deba12e4c0fb69c3b09d1f12345"}, "security_groups": [{"id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}}], "primary_network_attachment": {"name": "my-instance-network-attachment", "virtual_network_interface": {"allow_ip_spoofing": true, "auto_delete": false, "enable_infrastructure_nat": true, "ips": [{"id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb"}], "name": "my-virtual-network-interface", "primary_ip": {"id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb"}, "resource_group": {"id": "fee82deba12e4c0fb69c3b09d1f12345"}, "security_groups": [{"id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}}}'
responses.add(
responses.GET,
url,
@@ -9044,7 +9200,7 @@ def test_get_instance_template_value_error(self):
"""
# Set up mock
url = preprocess_url('/instance/templates/testString')
- mock_response = '{"availability_policy": {"host_failure": "restart"}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "default_trusted_profile": {"auto_link": false, "target": {"id": "Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5"}}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "keys": [{"id": "a6b1a881-2ce8-41a3-80fc-36316a73f803"}], "metadata_service": {"enabled": false, "protocol": "https", "response_hop_limit": 2}, "name": "my-instance-template", "placement_target": {"id": "1e09281b-f177-46fb-baf1-bc152b2e391a"}, "profile": {"name": "bx2-4x16"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "total_volume_bandwidth": 500, "user_data": "user_data", "volume_attachments": [{"delete_volume_on_instance_delete": false, "name": "my-volume-attachment", "volume": {"id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5"}}], "vpc": {"id": "4727d842-f94f-4a2d-824a-9bc9b02c523b"}, "boot_volume_attachment": {"delete_volume_on_instance_delete": true, "name": "my-volume-attachment", "volume": {"capacity": 100, "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "iops": 10000, "name": "my-volume", "profile": {"name": "general-purpose"}, "resource_group": {"id": "fee82deba12e4c0fb69c3b09d1f12345"}, "user_tags": ["user_tags"]}}, "image": {"id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8"}, "network_interfaces": [{"allow_ip_spoofing": true, "name": "my-instance-network-interface", "primary_ip": {"id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb"}, "security_groups": [{"id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}], "primary_network_interface": {"allow_ip_spoofing": true, "name": "my-instance-network-interface", "primary_ip": {"id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb"}, "security_groups": [{"id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}, "zone": {"name": "us-south-1"}}'
+ mock_response = '{"availability_policy": {"host_failure": "restart"}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "default_trusted_profile": {"auto_link": false, "target": {"id": "Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5"}}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "keys": [{"id": "a6b1a881-2ce8-41a3-80fc-36316a73f803"}], "metadata_service": {"enabled": false, "protocol": "https", "response_hop_limit": 2}, "name": "my-instance-template", "placement_target": {"id": "1e09281b-f177-46fb-baf1-bc152b2e391a"}, "profile": {"name": "bx2-4x16"}, "reservation_affinity": {"policy": "disabled", "pool": [{"id": "7187-ba49df72-37b8-43ac-98da-f8e029de0e63"}]}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "total_volume_bandwidth": 500, "user_data": "user_data", "volume_attachments": [{"delete_volume_on_instance_delete": false, "name": "my-volume-attachment", "volume": {"id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5"}}], "vpc": {"id": "4727d842-f94f-4a2d-824a-9bc9b02c523b"}, "boot_volume_attachment": {"delete_volume_on_instance_delete": true, "name": "my-volume-attachment", "volume": {"capacity": 100, "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "iops": 10000, "name": "my-volume", "profile": {"name": "general-purpose"}, "resource_group": {"id": "fee82deba12e4c0fb69c3b09d1f12345"}, "user_tags": ["user_tags"]}}, "image": {"id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8"}, "zone": {"name": "us-south-1"}, "network_attachments": [{"name": "my-instance-network-attachment", "virtual_network_interface": {"allow_ip_spoofing": true, "auto_delete": false, "enable_infrastructure_nat": true, "ips": [{"id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb"}], "name": "my-virtual-network-interface", "primary_ip": {"id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb"}, "resource_group": {"id": "fee82deba12e4c0fb69c3b09d1f12345"}, "security_groups": [{"id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}}], "primary_network_attachment": {"name": "my-instance-network-attachment", "virtual_network_interface": {"allow_ip_spoofing": true, "auto_delete": false, "enable_infrastructure_nat": true, "ips": [{"id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb"}], "name": "my-virtual-network-interface", "primary_ip": {"id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb"}, "resource_group": {"id": "fee82deba12e4c0fb69c3b09d1f12345"}, "security_groups": [{"id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}}}'
responses.add(
responses.GET,
url,
@@ -9087,7 +9243,7 @@ def test_update_instance_template_all_params(self):
"""
# Set up mock
url = preprocess_url('/instance/templates/testString')
- mock_response = '{"availability_policy": {"host_failure": "restart"}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "default_trusted_profile": {"auto_link": false, "target": {"id": "Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5"}}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "keys": [{"id": "a6b1a881-2ce8-41a3-80fc-36316a73f803"}], "metadata_service": {"enabled": false, "protocol": "https", "response_hop_limit": 2}, "name": "my-instance-template", "placement_target": {"id": "1e09281b-f177-46fb-baf1-bc152b2e391a"}, "profile": {"name": "bx2-4x16"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "total_volume_bandwidth": 500, "user_data": "user_data", "volume_attachments": [{"delete_volume_on_instance_delete": false, "name": "my-volume-attachment", "volume": {"id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5"}}], "vpc": {"id": "4727d842-f94f-4a2d-824a-9bc9b02c523b"}, "boot_volume_attachment": {"delete_volume_on_instance_delete": true, "name": "my-volume-attachment", "volume": {"capacity": 100, "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "iops": 10000, "name": "my-volume", "profile": {"name": "general-purpose"}, "resource_group": {"id": "fee82deba12e4c0fb69c3b09d1f12345"}, "user_tags": ["user_tags"]}}, "image": {"id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8"}, "network_interfaces": [{"allow_ip_spoofing": true, "name": "my-instance-network-interface", "primary_ip": {"id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb"}, "security_groups": [{"id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}], "primary_network_interface": {"allow_ip_spoofing": true, "name": "my-instance-network-interface", "primary_ip": {"id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb"}, "security_groups": [{"id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}, "zone": {"name": "us-south-1"}}'
+ mock_response = '{"availability_policy": {"host_failure": "restart"}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "default_trusted_profile": {"auto_link": false, "target": {"id": "Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5"}}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "keys": [{"id": "a6b1a881-2ce8-41a3-80fc-36316a73f803"}], "metadata_service": {"enabled": false, "protocol": "https", "response_hop_limit": 2}, "name": "my-instance-template", "placement_target": {"id": "1e09281b-f177-46fb-baf1-bc152b2e391a"}, "profile": {"name": "bx2-4x16"}, "reservation_affinity": {"policy": "disabled", "pool": [{"id": "7187-ba49df72-37b8-43ac-98da-f8e029de0e63"}]}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "total_volume_bandwidth": 500, "user_data": "user_data", "volume_attachments": [{"delete_volume_on_instance_delete": false, "name": "my-volume-attachment", "volume": {"id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5"}}], "vpc": {"id": "4727d842-f94f-4a2d-824a-9bc9b02c523b"}, "boot_volume_attachment": {"delete_volume_on_instance_delete": true, "name": "my-volume-attachment", "volume": {"capacity": 100, "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "iops": 10000, "name": "my-volume", "profile": {"name": "general-purpose"}, "resource_group": {"id": "fee82deba12e4c0fb69c3b09d1f12345"}, "user_tags": ["user_tags"]}}, "image": {"id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8"}, "zone": {"name": "us-south-1"}, "network_attachments": [{"name": "my-instance-network-attachment", "virtual_network_interface": {"allow_ip_spoofing": true, "auto_delete": false, "enable_infrastructure_nat": true, "ips": [{"id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb"}], "name": "my-virtual-network-interface", "primary_ip": {"id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb"}, "resource_group": {"id": "fee82deba12e4c0fb69c3b09d1f12345"}, "security_groups": [{"id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}}], "primary_network_attachment": {"name": "my-instance-network-attachment", "virtual_network_interface": {"allow_ip_spoofing": true, "auto_delete": false, "enable_infrastructure_nat": true, "ips": [{"id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb"}], "name": "my-virtual-network-interface", "primary_ip": {"id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb"}, "resource_group": {"id": "fee82deba12e4c0fb69c3b09d1f12345"}, "security_groups": [{"id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}}}'
responses.add(
responses.PATCH,
url,
@@ -9134,7 +9290,7 @@ def test_update_instance_template_value_error(self):
"""
# Set up mock
url = preprocess_url('/instance/templates/testString')
- mock_response = '{"availability_policy": {"host_failure": "restart"}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "default_trusted_profile": {"auto_link": false, "target": {"id": "Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5"}}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "keys": [{"id": "a6b1a881-2ce8-41a3-80fc-36316a73f803"}], "metadata_service": {"enabled": false, "protocol": "https", "response_hop_limit": 2}, "name": "my-instance-template", "placement_target": {"id": "1e09281b-f177-46fb-baf1-bc152b2e391a"}, "profile": {"name": "bx2-4x16"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "total_volume_bandwidth": 500, "user_data": "user_data", "volume_attachments": [{"delete_volume_on_instance_delete": false, "name": "my-volume-attachment", "volume": {"id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5"}}], "vpc": {"id": "4727d842-f94f-4a2d-824a-9bc9b02c523b"}, "boot_volume_attachment": {"delete_volume_on_instance_delete": true, "name": "my-volume-attachment", "volume": {"capacity": 100, "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "iops": 10000, "name": "my-volume", "profile": {"name": "general-purpose"}, "resource_group": {"id": "fee82deba12e4c0fb69c3b09d1f12345"}, "user_tags": ["user_tags"]}}, "image": {"id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8"}, "network_interfaces": [{"allow_ip_spoofing": true, "name": "my-instance-network-interface", "primary_ip": {"id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb"}, "security_groups": [{"id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}], "primary_network_interface": {"allow_ip_spoofing": true, "name": "my-instance-network-interface", "primary_ip": {"id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb"}, "security_groups": [{"id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}, "zone": {"name": "us-south-1"}}'
+ mock_response = '{"availability_policy": {"host_failure": "restart"}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "default_trusted_profile": {"auto_link": false, "target": {"id": "Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5"}}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "keys": [{"id": "a6b1a881-2ce8-41a3-80fc-36316a73f803"}], "metadata_service": {"enabled": false, "protocol": "https", "response_hop_limit": 2}, "name": "my-instance-template", "placement_target": {"id": "1e09281b-f177-46fb-baf1-bc152b2e391a"}, "profile": {"name": "bx2-4x16"}, "reservation_affinity": {"policy": "disabled", "pool": [{"id": "7187-ba49df72-37b8-43ac-98da-f8e029de0e63"}]}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "total_volume_bandwidth": 500, "user_data": "user_data", "volume_attachments": [{"delete_volume_on_instance_delete": false, "name": "my-volume-attachment", "volume": {"id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5"}}], "vpc": {"id": "4727d842-f94f-4a2d-824a-9bc9b02c523b"}, "boot_volume_attachment": {"delete_volume_on_instance_delete": true, "name": "my-volume-attachment", "volume": {"capacity": 100, "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "iops": 10000, "name": "my-volume", "profile": {"name": "general-purpose"}, "resource_group": {"id": "fee82deba12e4c0fb69c3b09d1f12345"}, "user_tags": ["user_tags"]}}, "image": {"id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8"}, "zone": {"name": "us-south-1"}, "network_attachments": [{"name": "my-instance-network-attachment", "virtual_network_interface": {"allow_ip_spoofing": true, "auto_delete": false, "enable_infrastructure_nat": true, "ips": [{"id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb"}], "name": "my-virtual-network-interface", "primary_ip": {"id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb"}, "resource_group": {"id": "fee82deba12e4c0fb69c3b09d1f12345"}, "security_groups": [{"id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}}], "primary_network_attachment": {"name": "my-instance-network-attachment", "virtual_network_interface": {"allow_ip_spoofing": true, "auto_delete": false, "enable_infrastructure_nat": true, "ips": [{"id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb"}], "name": "my-virtual-network-interface", "primary_ip": {"id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb"}, "resource_group": {"id": "fee82deba12e4c0fb69c3b09d1f12345"}, "security_groups": [{"id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}}}'
responses.add(
responses.PATCH,
url,
@@ -9183,7 +9339,7 @@ def test_list_instances_all_params(self):
"""
# Set up mock
url = preprocess_url('/instances')
- mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances?limit=20"}, "instances": [{"availability_policy": {"host_failure": "restart"}, "bandwidth": 1000, "boot_volume_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}, "catalog_offering": {"version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "dedicated_host": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-host", "resource_type": "dedicated_host"}, "disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "nvme", "name": "my-instance-disk", "resource_type": "instance_disk", "size": 100}], "gpu": {"count": 1, "manufacturer": "nvidia", "memory": 1, "model": "Tesla V100"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image", "remote": {"account": {"id": "aa2432b1fa4d4ace891e9b80fc104e34", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "memory": 8, "metadata_service": {"enabled": false, "protocol": "http", "response_hop_limit": 1}, "name": "my-instance", "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}], "numa_count": 2, "placement_target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-host-group", "resource_type": "dedicated_host_group"}, "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "instance", "startable": false, "status": "deleting", "status_reasons": [{"code": "cannot_start_storage", "message": "The virtual server instance is unusable because the encryption key for the boot volume\nhas been deleted", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "total_network_bandwidth": 500, "total_volume_bandwidth": 500, "vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "volume_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}'
+ mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances?limit=20"}, "instances": [{"availability_policy": {"host_failure": "restart"}, "bandwidth": 1000, "boot_volume_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}, "catalog_offering": {"version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "dedicated_host": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-host", "resource_type": "dedicated_host"}, "disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "nvme", "name": "my-instance-disk", "resource_type": "instance_disk", "size": 100}], "gpu": {"count": 1, "manufacturer": "nvidia", "memory": 1, "model": "Tesla V100"}, "health_reasons": [{"code": "reservation_expired", "message": "The reservation cannot be used because it has expired.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-virtual-server-health-status-reasons"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image", "remote": {"account": {"id": "aa2432b1fa4d4ace891e9b80fc104e34", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "memory": 8, "metadata_service": {"enabled": false, "protocol": "http", "response_hop_limit": 1}, "name": "my-instance", "network_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/5dd61d72-acaa-47c2-a336-3d849660d010/network_attachments/0767-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0767-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-attachment", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "instance_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}], "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}], "numa_count": 2, "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_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/5dd61d72-acaa-47c2-a336-3d849660d010/network_attachments/0767-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0767-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-attachment", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "instance_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}, "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}, "reservation": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::reservation:7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/reservations/7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "id": "7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "name": "my-reservation", "resource_type": "reservation"}, "reservation_affinity": {"policy": "disabled", "pool": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::reservation:7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/reservations/7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "id": "7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "name": "my-reservation", "resource_type": "reservation"}]}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "instance", "startable": false, "status": "deleting", "status_reasons": [{"code": "cannot_start_storage", "message": "The virtual server instance is unusable because the encryption key for the boot volume\nhas been deleted", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "total_network_bandwidth": 500, "total_volume_bandwidth": 500, "vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "volume_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}'
responses.add(
responses.GET,
url,
@@ -9206,6 +9362,9 @@ def test_list_instances_all_params(self):
placement_group_id = 'testString'
placement_group_crn = 'crn:v1:bluemix:public:is:us-south:a/123456::placement-group:r018-418fe842-a3e9-47b9-a938-1aa5bd632871'
placement_group_name = 'my-placement-group'
+ reservation_id = 'testString'
+ reservation_crn = 'crn:v1:bluemix:public:is:us-south:a/123456::reservation:7187-ba49df72-37b8-43ac-98da-f8e029de0e63'
+ reservation_name = 'my-reservation'
# Invoke method
response = _service.list_instances(
@@ -9222,6 +9381,9 @@ def test_list_instances_all_params(self):
placement_group_id=placement_group_id,
placement_group_crn=placement_group_crn,
placement_group_name=placement_group_name,
+ reservation_id=reservation_id,
+ reservation_crn=reservation_crn,
+ reservation_name=reservation_name,
headers={},
)
@@ -9244,6 +9406,9 @@ def test_list_instances_all_params(self):
assert 'placement_group.id={}'.format(placement_group_id) in query_string
assert 'placement_group.crn={}'.format(placement_group_crn) in query_string
assert 'placement_group.name={}'.format(placement_group_name) in query_string
+ assert 'reservation.id={}'.format(reservation_id) in query_string
+ assert 'reservation.crn={}'.format(reservation_crn) in query_string
+ assert 'reservation.name={}'.format(reservation_name) in query_string
def test_list_instances_all_params_with_retries(self):
# Enable retries and run test_list_instances_all_params.
@@ -9261,7 +9426,7 @@ def test_list_instances_required_params(self):
"""
# Set up mock
url = preprocess_url('/instances')
- mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances?limit=20"}, "instances": [{"availability_policy": {"host_failure": "restart"}, "bandwidth": 1000, "boot_volume_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}, "catalog_offering": {"version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "dedicated_host": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-host", "resource_type": "dedicated_host"}, "disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "nvme", "name": "my-instance-disk", "resource_type": "instance_disk", "size": 100}], "gpu": {"count": 1, "manufacturer": "nvidia", "memory": 1, "model": "Tesla V100"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image", "remote": {"account": {"id": "aa2432b1fa4d4ace891e9b80fc104e34", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "memory": 8, "metadata_service": {"enabled": false, "protocol": "http", "response_hop_limit": 1}, "name": "my-instance", "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}], "numa_count": 2, "placement_target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-host-group", "resource_type": "dedicated_host_group"}, "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "instance", "startable": false, "status": "deleting", "status_reasons": [{"code": "cannot_start_storage", "message": "The virtual server instance is unusable because the encryption key for the boot volume\nhas been deleted", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "total_network_bandwidth": 500, "total_volume_bandwidth": 500, "vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "volume_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}'
+ mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances?limit=20"}, "instances": [{"availability_policy": {"host_failure": "restart"}, "bandwidth": 1000, "boot_volume_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}, "catalog_offering": {"version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "dedicated_host": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-host", "resource_type": "dedicated_host"}, "disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "nvme", "name": "my-instance-disk", "resource_type": "instance_disk", "size": 100}], "gpu": {"count": 1, "manufacturer": "nvidia", "memory": 1, "model": "Tesla V100"}, "health_reasons": [{"code": "reservation_expired", "message": "The reservation cannot be used because it has expired.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-virtual-server-health-status-reasons"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image", "remote": {"account": {"id": "aa2432b1fa4d4ace891e9b80fc104e34", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "memory": 8, "metadata_service": {"enabled": false, "protocol": "http", "response_hop_limit": 1}, "name": "my-instance", "network_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/5dd61d72-acaa-47c2-a336-3d849660d010/network_attachments/0767-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0767-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-attachment", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "instance_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}], "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}], "numa_count": 2, "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_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/5dd61d72-acaa-47c2-a336-3d849660d010/network_attachments/0767-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0767-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-attachment", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "instance_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}, "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}, "reservation": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::reservation:7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/reservations/7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "id": "7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "name": "my-reservation", "resource_type": "reservation"}, "reservation_affinity": {"policy": "disabled", "pool": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::reservation:7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/reservations/7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "id": "7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "name": "my-reservation", "resource_type": "reservation"}]}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "instance", "startable": false, "status": "deleting", "status_reasons": [{"code": "cannot_start_storage", "message": "The virtual server instance is unusable because the encryption key for the boot volume\nhas been deleted", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "total_network_bandwidth": 500, "total_volume_bandwidth": 500, "vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "volume_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}'
responses.add(
responses.GET,
url,
@@ -9293,7 +9458,7 @@ def test_list_instances_value_error(self):
"""
# Set up mock
url = preprocess_url('/instances')
- mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances?limit=20"}, "instances": [{"availability_policy": {"host_failure": "restart"}, "bandwidth": 1000, "boot_volume_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}, "catalog_offering": {"version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "dedicated_host": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-host", "resource_type": "dedicated_host"}, "disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "nvme", "name": "my-instance-disk", "resource_type": "instance_disk", "size": 100}], "gpu": {"count": 1, "manufacturer": "nvidia", "memory": 1, "model": "Tesla V100"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image", "remote": {"account": {"id": "aa2432b1fa4d4ace891e9b80fc104e34", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "memory": 8, "metadata_service": {"enabled": false, "protocol": "http", "response_hop_limit": 1}, "name": "my-instance", "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}], "numa_count": 2, "placement_target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-host-group", "resource_type": "dedicated_host_group"}, "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "instance", "startable": false, "status": "deleting", "status_reasons": [{"code": "cannot_start_storage", "message": "The virtual server instance is unusable because the encryption key for the boot volume\nhas been deleted", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "total_network_bandwidth": 500, "total_volume_bandwidth": 500, "vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "volume_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}'
+ mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances?limit=20"}, "instances": [{"availability_policy": {"host_failure": "restart"}, "bandwidth": 1000, "boot_volume_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}, "catalog_offering": {"version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "dedicated_host": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-host", "resource_type": "dedicated_host"}, "disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "nvme", "name": "my-instance-disk", "resource_type": "instance_disk", "size": 100}], "gpu": {"count": 1, "manufacturer": "nvidia", "memory": 1, "model": "Tesla V100"}, "health_reasons": [{"code": "reservation_expired", "message": "The reservation cannot be used because it has expired.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-virtual-server-health-status-reasons"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image", "remote": {"account": {"id": "aa2432b1fa4d4ace891e9b80fc104e34", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "memory": 8, "metadata_service": {"enabled": false, "protocol": "http", "response_hop_limit": 1}, "name": "my-instance", "network_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/5dd61d72-acaa-47c2-a336-3d849660d010/network_attachments/0767-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0767-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-attachment", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "instance_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}], "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}], "numa_count": 2, "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_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/5dd61d72-acaa-47c2-a336-3d849660d010/network_attachments/0767-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0767-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-attachment", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "instance_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}, "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}, "reservation": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::reservation:7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/reservations/7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "id": "7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "name": "my-reservation", "resource_type": "reservation"}, "reservation_affinity": {"policy": "disabled", "pool": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::reservation:7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/reservations/7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "id": "7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "name": "my-reservation", "resource_type": "reservation"}]}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "instance", "startable": false, "status": "deleting", "status_reasons": [{"code": "cannot_start_storage", "message": "The virtual server instance is unusable because the encryption key for the boot volume\nhas been deleted", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "total_network_bandwidth": 500, "total_volume_bandwidth": 500, "vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "volume_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}'
responses.add(
responses.GET,
url,
@@ -9326,8 +9491,8 @@ def test_list_instances_with_pager_get_next(self):
"""
# Set up a two-page mock response
url = preprocess_url('/instances')
- mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"instances":[{"availability_policy":{"host_failure":"restart"},"bandwidth":1000,"boot_volume_attachment":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"device":{"id":"80b3e36e-41f4-40e9-bd56-beae81792a68"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a","id":"82cbf856-9cbb-45fb-b62f-d7bcef32399a","name":"my-volume-attachment","volume":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5","id":"1a6b7274-678d-4dfb-8981-c71dd9d4daa5","name":"my-volume","resource_type":"volume"}},"catalog_offering":{"version":{"crn":"crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}},"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a","dedicated_host":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a","id":"1e09281b-f177-46fb-baf1-bc152b2e391a","name":"my-host","resource_type":"dedicated_host"},"disks":[{"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","interface_type":"nvme","name":"my-instance-disk","resource_type":"instance_disk","size":100}],"gpu":{"count":1,"manufacturer":"nvidia","memory":1,"model":"Tesla V100"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a","id":"1e09281b-f177-46fb-baf1-bc152b2e391a","image":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","id":"72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","name":"my-image","remote":{"account":{"id":"aa2432b1fa4d4ace891e9b80fc104e34","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"image"},"lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","memory":8,"metadata_service":{"enabled":false,"protocol":"http","response_hop_limit":1},"name":"my-instance","network_interfaces":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-instance-network-interface","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"network_interface","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}}],"numa_count":2,"placement_target":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0","id":"bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0","name":"my-host-group","resource_type":"dedicated_host_group"},"primary_network_interface":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-instance-network-interface","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"network_interface","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}},"profile":{"href":"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16","name":"bx2-4x16"},"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"instance","startable":false,"status":"deleting","status_reasons":[{"code":"cannot_start_storage","message":"The virtual server instance is unusable because the encryption key for the boot volume\\nhas been deleted","more_info":"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}],"total_network_bandwidth":500,"total_volume_bandwidth":500,"vcpu":{"architecture":"amd64","count":4,"manufacturer":"intel"},"volume_attachments":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"device":{"id":"80b3e36e-41f4-40e9-bd56-beae81792a68"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a","id":"82cbf856-9cbb-45fb-b62f-d7bcef32399a","name":"my-volume-attachment","volume":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5","id":"1a6b7274-678d-4dfb-8981-c71dd9d4daa5","name":"my-volume","resource_type":"volume"}}],"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"total_count":2,"limit":1}'
- mock_response2 = '{"instances":[{"availability_policy":{"host_failure":"restart"},"bandwidth":1000,"boot_volume_attachment":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"device":{"id":"80b3e36e-41f4-40e9-bd56-beae81792a68"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a","id":"82cbf856-9cbb-45fb-b62f-d7bcef32399a","name":"my-volume-attachment","volume":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5","id":"1a6b7274-678d-4dfb-8981-c71dd9d4daa5","name":"my-volume","resource_type":"volume"}},"catalog_offering":{"version":{"crn":"crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}},"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a","dedicated_host":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a","id":"1e09281b-f177-46fb-baf1-bc152b2e391a","name":"my-host","resource_type":"dedicated_host"},"disks":[{"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","interface_type":"nvme","name":"my-instance-disk","resource_type":"instance_disk","size":100}],"gpu":{"count":1,"manufacturer":"nvidia","memory":1,"model":"Tesla V100"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a","id":"1e09281b-f177-46fb-baf1-bc152b2e391a","image":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","id":"72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","name":"my-image","remote":{"account":{"id":"aa2432b1fa4d4ace891e9b80fc104e34","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"image"},"lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","memory":8,"metadata_service":{"enabled":false,"protocol":"http","response_hop_limit":1},"name":"my-instance","network_interfaces":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-instance-network-interface","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"network_interface","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}}],"numa_count":2,"placement_target":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0","id":"bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0","name":"my-host-group","resource_type":"dedicated_host_group"},"primary_network_interface":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-instance-network-interface","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"network_interface","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}},"profile":{"href":"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16","name":"bx2-4x16"},"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"instance","startable":false,"status":"deleting","status_reasons":[{"code":"cannot_start_storage","message":"The virtual server instance is unusable because the encryption key for the boot volume\\nhas been deleted","more_info":"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}],"total_network_bandwidth":500,"total_volume_bandwidth":500,"vcpu":{"architecture":"amd64","count":4,"manufacturer":"intel"},"volume_attachments":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"device":{"id":"80b3e36e-41f4-40e9-bd56-beae81792a68"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a","id":"82cbf856-9cbb-45fb-b62f-d7bcef32399a","name":"my-volume-attachment","volume":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5","id":"1a6b7274-678d-4dfb-8981-c71dd9d4daa5","name":"my-volume","resource_type":"volume"}}],"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"total_count":2,"limit":1}'
+ mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"instances":[{"availability_policy":{"host_failure":"restart"},"bandwidth":1000,"boot_volume_attachment":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"device":{"id":"80b3e36e-41f4-40e9-bd56-beae81792a68"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a","id":"82cbf856-9cbb-45fb-b62f-d7bcef32399a","name":"my-volume-attachment","volume":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5","id":"1a6b7274-678d-4dfb-8981-c71dd9d4daa5","name":"my-volume","resource_type":"volume"}},"catalog_offering":{"version":{"crn":"crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}},"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a","dedicated_host":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a","id":"1e09281b-f177-46fb-baf1-bc152b2e391a","name":"my-host","resource_type":"dedicated_host"},"disks":[{"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","interface_type":"nvme","name":"my-instance-disk","resource_type":"instance_disk","size":100}],"gpu":{"count":1,"manufacturer":"nvidia","memory":1,"model":"Tesla V100"},"health_reasons":[{"code":"reservation_expired","message":"The reservation cannot be used because it has expired.","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-virtual-server-health-status-reasons"}],"health_state":"ok","href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a","id":"1e09281b-f177-46fb-baf1-bc152b2e391a","image":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","id":"72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","name":"my-image","remote":{"account":{"id":"aa2432b1fa4d4ace891e9b80fc104e34","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"image"},"lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","memory":8,"metadata_service":{"enabled":false,"protocol":"http","response_hop_limit":1},"name":"my-instance","network_attachments":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/5dd61d72-acaa-47c2-a336-3d849660d010/network_attachments/0767-d54eb633-98ea-459d-aa00-6a8e780175a7","id":"0767-d54eb633-98ea-459d-aa00-6a8e780175a7","name":"my-instance-network-attachment","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"instance_network_attachment","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}}],"network_interfaces":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-instance-network-interface","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"network_interface","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}}],"numa_count":2,"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_attachment":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/5dd61d72-acaa-47c2-a336-3d849660d010/network_attachments/0767-d54eb633-98ea-459d-aa00-6a8e780175a7","id":"0767-d54eb633-98ea-459d-aa00-6a8e780175a7","name":"my-instance-network-attachment","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"instance_network_attachment","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}},"primary_network_interface":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-instance-network-interface","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"network_interface","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}},"profile":{"href":"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16","name":"bx2-4x16","resource_type":"instance_profile"},"reservation":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::reservation:7187-ba49df72-37b8-43ac-98da-f8e029de0e63","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/reservations/7187-ba49df72-37b8-43ac-98da-f8e029de0e63","id":"7187-ba49df72-37b8-43ac-98da-f8e029de0e63","name":"my-reservation","resource_type":"reservation"},"reservation_affinity":{"policy":"disabled","pool":[{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::reservation:7187-ba49df72-37b8-43ac-98da-f8e029de0e63","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/reservations/7187-ba49df72-37b8-43ac-98da-f8e029de0e63","id":"7187-ba49df72-37b8-43ac-98da-f8e029de0e63","name":"my-reservation","resource_type":"reservation"}]},"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"instance","startable":false,"status":"deleting","status_reasons":[{"code":"cannot_start_storage","message":"The virtual server instance is unusable because the encryption key for the boot volume\\nhas been deleted","more_info":"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}],"total_network_bandwidth":500,"total_volume_bandwidth":500,"vcpu":{"architecture":"amd64","count":4,"manufacturer":"intel"},"volume_attachments":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"device":{"id":"80b3e36e-41f4-40e9-bd56-beae81792a68"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a","id":"82cbf856-9cbb-45fb-b62f-d7bcef32399a","name":"my-volume-attachment","volume":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5","id":"1a6b7274-678d-4dfb-8981-c71dd9d4daa5","name":"my-volume","resource_type":"volume"}}],"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"total_count":2,"limit":1}'
+ mock_response2 = '{"instances":[{"availability_policy":{"host_failure":"restart"},"bandwidth":1000,"boot_volume_attachment":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"device":{"id":"80b3e36e-41f4-40e9-bd56-beae81792a68"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a","id":"82cbf856-9cbb-45fb-b62f-d7bcef32399a","name":"my-volume-attachment","volume":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5","id":"1a6b7274-678d-4dfb-8981-c71dd9d4daa5","name":"my-volume","resource_type":"volume"}},"catalog_offering":{"version":{"crn":"crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}},"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a","dedicated_host":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a","id":"1e09281b-f177-46fb-baf1-bc152b2e391a","name":"my-host","resource_type":"dedicated_host"},"disks":[{"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","interface_type":"nvme","name":"my-instance-disk","resource_type":"instance_disk","size":100}],"gpu":{"count":1,"manufacturer":"nvidia","memory":1,"model":"Tesla V100"},"health_reasons":[{"code":"reservation_expired","message":"The reservation cannot be used because it has expired.","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-virtual-server-health-status-reasons"}],"health_state":"ok","href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a","id":"1e09281b-f177-46fb-baf1-bc152b2e391a","image":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","id":"72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","name":"my-image","remote":{"account":{"id":"aa2432b1fa4d4ace891e9b80fc104e34","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"image"},"lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","memory":8,"metadata_service":{"enabled":false,"protocol":"http","response_hop_limit":1},"name":"my-instance","network_attachments":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/5dd61d72-acaa-47c2-a336-3d849660d010/network_attachments/0767-d54eb633-98ea-459d-aa00-6a8e780175a7","id":"0767-d54eb633-98ea-459d-aa00-6a8e780175a7","name":"my-instance-network-attachment","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"instance_network_attachment","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}}],"network_interfaces":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-instance-network-interface","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"network_interface","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}}],"numa_count":2,"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_attachment":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/5dd61d72-acaa-47c2-a336-3d849660d010/network_attachments/0767-d54eb633-98ea-459d-aa00-6a8e780175a7","id":"0767-d54eb633-98ea-459d-aa00-6a8e780175a7","name":"my-instance-network-attachment","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"instance_network_attachment","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}},"primary_network_interface":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-instance-network-interface","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"network_interface","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}},"profile":{"href":"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16","name":"bx2-4x16","resource_type":"instance_profile"},"reservation":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::reservation:7187-ba49df72-37b8-43ac-98da-f8e029de0e63","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/reservations/7187-ba49df72-37b8-43ac-98da-f8e029de0e63","id":"7187-ba49df72-37b8-43ac-98da-f8e029de0e63","name":"my-reservation","resource_type":"reservation"},"reservation_affinity":{"policy":"disabled","pool":[{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::reservation:7187-ba49df72-37b8-43ac-98da-f8e029de0e63","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/reservations/7187-ba49df72-37b8-43ac-98da-f8e029de0e63","id":"7187-ba49df72-37b8-43ac-98da-f8e029de0e63","name":"my-reservation","resource_type":"reservation"}]},"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"instance","startable":false,"status":"deleting","status_reasons":[{"code":"cannot_start_storage","message":"The virtual server instance is unusable because the encryption key for the boot volume\\nhas been deleted","more_info":"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}],"total_network_bandwidth":500,"total_volume_bandwidth":500,"vcpu":{"architecture":"amd64","count":4,"manufacturer":"intel"},"volume_attachments":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"device":{"id":"80b3e36e-41f4-40e9-bd56-beae81792a68"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a","id":"82cbf856-9cbb-45fb-b62f-d7bcef32399a","name":"my-volume-attachment","volume":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5","id":"1a6b7274-678d-4dfb-8981-c71dd9d4daa5","name":"my-volume","resource_type":"volume"}}],"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"total_count":2,"limit":1}'
responses.add(
responses.GET,
url,
@@ -9359,6 +9524,9 @@ def test_list_instances_with_pager_get_next(self):
placement_group_id='testString',
placement_group_crn='crn:v1:bluemix:public:is:us-south:a/123456::placement-group:r018-418fe842-a3e9-47b9-a938-1aa5bd632871',
placement_group_name='my-placement-group',
+ reservation_id='testString',
+ reservation_crn='crn:v1:bluemix:public:is:us-south:a/123456::reservation:7187-ba49df72-37b8-43ac-98da-f8e029de0e63',
+ reservation_name='my-reservation',
)
while pager.has_next():
next_page = pager.get_next()
@@ -9373,8 +9541,8 @@ def test_list_instances_with_pager_get_all(self):
"""
# Set up a two-page mock response
url = preprocess_url('/instances')
- mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"instances":[{"availability_policy":{"host_failure":"restart"},"bandwidth":1000,"boot_volume_attachment":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"device":{"id":"80b3e36e-41f4-40e9-bd56-beae81792a68"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a","id":"82cbf856-9cbb-45fb-b62f-d7bcef32399a","name":"my-volume-attachment","volume":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5","id":"1a6b7274-678d-4dfb-8981-c71dd9d4daa5","name":"my-volume","resource_type":"volume"}},"catalog_offering":{"version":{"crn":"crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}},"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a","dedicated_host":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a","id":"1e09281b-f177-46fb-baf1-bc152b2e391a","name":"my-host","resource_type":"dedicated_host"},"disks":[{"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","interface_type":"nvme","name":"my-instance-disk","resource_type":"instance_disk","size":100}],"gpu":{"count":1,"manufacturer":"nvidia","memory":1,"model":"Tesla V100"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a","id":"1e09281b-f177-46fb-baf1-bc152b2e391a","image":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","id":"72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","name":"my-image","remote":{"account":{"id":"aa2432b1fa4d4ace891e9b80fc104e34","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"image"},"lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","memory":8,"metadata_service":{"enabled":false,"protocol":"http","response_hop_limit":1},"name":"my-instance","network_interfaces":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-instance-network-interface","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"network_interface","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}}],"numa_count":2,"placement_target":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0","id":"bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0","name":"my-host-group","resource_type":"dedicated_host_group"},"primary_network_interface":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-instance-network-interface","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"network_interface","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}},"profile":{"href":"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16","name":"bx2-4x16"},"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"instance","startable":false,"status":"deleting","status_reasons":[{"code":"cannot_start_storage","message":"The virtual server instance is unusable because the encryption key for the boot volume\\nhas been deleted","more_info":"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}],"total_network_bandwidth":500,"total_volume_bandwidth":500,"vcpu":{"architecture":"amd64","count":4,"manufacturer":"intel"},"volume_attachments":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"device":{"id":"80b3e36e-41f4-40e9-bd56-beae81792a68"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a","id":"82cbf856-9cbb-45fb-b62f-d7bcef32399a","name":"my-volume-attachment","volume":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5","id":"1a6b7274-678d-4dfb-8981-c71dd9d4daa5","name":"my-volume","resource_type":"volume"}}],"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"total_count":2,"limit":1}'
- mock_response2 = '{"instances":[{"availability_policy":{"host_failure":"restart"},"bandwidth":1000,"boot_volume_attachment":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"device":{"id":"80b3e36e-41f4-40e9-bd56-beae81792a68"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a","id":"82cbf856-9cbb-45fb-b62f-d7bcef32399a","name":"my-volume-attachment","volume":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5","id":"1a6b7274-678d-4dfb-8981-c71dd9d4daa5","name":"my-volume","resource_type":"volume"}},"catalog_offering":{"version":{"crn":"crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}},"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a","dedicated_host":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a","id":"1e09281b-f177-46fb-baf1-bc152b2e391a","name":"my-host","resource_type":"dedicated_host"},"disks":[{"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","interface_type":"nvme","name":"my-instance-disk","resource_type":"instance_disk","size":100}],"gpu":{"count":1,"manufacturer":"nvidia","memory":1,"model":"Tesla V100"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a","id":"1e09281b-f177-46fb-baf1-bc152b2e391a","image":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","id":"72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","name":"my-image","remote":{"account":{"id":"aa2432b1fa4d4ace891e9b80fc104e34","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"image"},"lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","memory":8,"metadata_service":{"enabled":false,"protocol":"http","response_hop_limit":1},"name":"my-instance","network_interfaces":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-instance-network-interface","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"network_interface","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}}],"numa_count":2,"placement_target":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0","id":"bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0","name":"my-host-group","resource_type":"dedicated_host_group"},"primary_network_interface":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-instance-network-interface","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"network_interface","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}},"profile":{"href":"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16","name":"bx2-4x16"},"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"instance","startable":false,"status":"deleting","status_reasons":[{"code":"cannot_start_storage","message":"The virtual server instance is unusable because the encryption key for the boot volume\\nhas been deleted","more_info":"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}],"total_network_bandwidth":500,"total_volume_bandwidth":500,"vcpu":{"architecture":"amd64","count":4,"manufacturer":"intel"},"volume_attachments":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"device":{"id":"80b3e36e-41f4-40e9-bd56-beae81792a68"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a","id":"82cbf856-9cbb-45fb-b62f-d7bcef32399a","name":"my-volume-attachment","volume":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5","id":"1a6b7274-678d-4dfb-8981-c71dd9d4daa5","name":"my-volume","resource_type":"volume"}}],"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"total_count":2,"limit":1}'
+ mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"instances":[{"availability_policy":{"host_failure":"restart"},"bandwidth":1000,"boot_volume_attachment":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"device":{"id":"80b3e36e-41f4-40e9-bd56-beae81792a68"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a","id":"82cbf856-9cbb-45fb-b62f-d7bcef32399a","name":"my-volume-attachment","volume":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5","id":"1a6b7274-678d-4dfb-8981-c71dd9d4daa5","name":"my-volume","resource_type":"volume"}},"catalog_offering":{"version":{"crn":"crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}},"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a","dedicated_host":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a","id":"1e09281b-f177-46fb-baf1-bc152b2e391a","name":"my-host","resource_type":"dedicated_host"},"disks":[{"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","interface_type":"nvme","name":"my-instance-disk","resource_type":"instance_disk","size":100}],"gpu":{"count":1,"manufacturer":"nvidia","memory":1,"model":"Tesla V100"},"health_reasons":[{"code":"reservation_expired","message":"The reservation cannot be used because it has expired.","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-virtual-server-health-status-reasons"}],"health_state":"ok","href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a","id":"1e09281b-f177-46fb-baf1-bc152b2e391a","image":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","id":"72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","name":"my-image","remote":{"account":{"id":"aa2432b1fa4d4ace891e9b80fc104e34","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"image"},"lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","memory":8,"metadata_service":{"enabled":false,"protocol":"http","response_hop_limit":1},"name":"my-instance","network_attachments":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/5dd61d72-acaa-47c2-a336-3d849660d010/network_attachments/0767-d54eb633-98ea-459d-aa00-6a8e780175a7","id":"0767-d54eb633-98ea-459d-aa00-6a8e780175a7","name":"my-instance-network-attachment","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"instance_network_attachment","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}}],"network_interfaces":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-instance-network-interface","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"network_interface","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}}],"numa_count":2,"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_attachment":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/5dd61d72-acaa-47c2-a336-3d849660d010/network_attachments/0767-d54eb633-98ea-459d-aa00-6a8e780175a7","id":"0767-d54eb633-98ea-459d-aa00-6a8e780175a7","name":"my-instance-network-attachment","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"instance_network_attachment","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}},"primary_network_interface":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-instance-network-interface","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"network_interface","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}},"profile":{"href":"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16","name":"bx2-4x16","resource_type":"instance_profile"},"reservation":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::reservation:7187-ba49df72-37b8-43ac-98da-f8e029de0e63","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/reservations/7187-ba49df72-37b8-43ac-98da-f8e029de0e63","id":"7187-ba49df72-37b8-43ac-98da-f8e029de0e63","name":"my-reservation","resource_type":"reservation"},"reservation_affinity":{"policy":"disabled","pool":[{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::reservation:7187-ba49df72-37b8-43ac-98da-f8e029de0e63","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/reservations/7187-ba49df72-37b8-43ac-98da-f8e029de0e63","id":"7187-ba49df72-37b8-43ac-98da-f8e029de0e63","name":"my-reservation","resource_type":"reservation"}]},"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"instance","startable":false,"status":"deleting","status_reasons":[{"code":"cannot_start_storage","message":"The virtual server instance is unusable because the encryption key for the boot volume\\nhas been deleted","more_info":"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}],"total_network_bandwidth":500,"total_volume_bandwidth":500,"vcpu":{"architecture":"amd64","count":4,"manufacturer":"intel"},"volume_attachments":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"device":{"id":"80b3e36e-41f4-40e9-bd56-beae81792a68"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a","id":"82cbf856-9cbb-45fb-b62f-d7bcef32399a","name":"my-volume-attachment","volume":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5","id":"1a6b7274-678d-4dfb-8981-c71dd9d4daa5","name":"my-volume","resource_type":"volume"}}],"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"total_count":2,"limit":1}'
+ mock_response2 = '{"instances":[{"availability_policy":{"host_failure":"restart"},"bandwidth":1000,"boot_volume_attachment":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"device":{"id":"80b3e36e-41f4-40e9-bd56-beae81792a68"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a","id":"82cbf856-9cbb-45fb-b62f-d7bcef32399a","name":"my-volume-attachment","volume":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5","id":"1a6b7274-678d-4dfb-8981-c71dd9d4daa5","name":"my-volume","resource_type":"volume"}},"catalog_offering":{"version":{"crn":"crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}},"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a","dedicated_host":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a","id":"1e09281b-f177-46fb-baf1-bc152b2e391a","name":"my-host","resource_type":"dedicated_host"},"disks":[{"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","interface_type":"nvme","name":"my-instance-disk","resource_type":"instance_disk","size":100}],"gpu":{"count":1,"manufacturer":"nvidia","memory":1,"model":"Tesla V100"},"health_reasons":[{"code":"reservation_expired","message":"The reservation cannot be used because it has expired.","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-virtual-server-health-status-reasons"}],"health_state":"ok","href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a","id":"1e09281b-f177-46fb-baf1-bc152b2e391a","image":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","id":"72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","name":"my-image","remote":{"account":{"id":"aa2432b1fa4d4ace891e9b80fc104e34","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"image"},"lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","memory":8,"metadata_service":{"enabled":false,"protocol":"http","response_hop_limit":1},"name":"my-instance","network_attachments":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/5dd61d72-acaa-47c2-a336-3d849660d010/network_attachments/0767-d54eb633-98ea-459d-aa00-6a8e780175a7","id":"0767-d54eb633-98ea-459d-aa00-6a8e780175a7","name":"my-instance-network-attachment","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"instance_network_attachment","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}}],"network_interfaces":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-instance-network-interface","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"network_interface","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}}],"numa_count":2,"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_attachment":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/5dd61d72-acaa-47c2-a336-3d849660d010/network_attachments/0767-d54eb633-98ea-459d-aa00-6a8e780175a7","id":"0767-d54eb633-98ea-459d-aa00-6a8e780175a7","name":"my-instance-network-attachment","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"instance_network_attachment","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}},"primary_network_interface":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-instance-network-interface","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"network_interface","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}},"profile":{"href":"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16","name":"bx2-4x16","resource_type":"instance_profile"},"reservation":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::reservation:7187-ba49df72-37b8-43ac-98da-f8e029de0e63","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/reservations/7187-ba49df72-37b8-43ac-98da-f8e029de0e63","id":"7187-ba49df72-37b8-43ac-98da-f8e029de0e63","name":"my-reservation","resource_type":"reservation"},"reservation_affinity":{"policy":"disabled","pool":[{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::reservation:7187-ba49df72-37b8-43ac-98da-f8e029de0e63","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/reservations/7187-ba49df72-37b8-43ac-98da-f8e029de0e63","id":"7187-ba49df72-37b8-43ac-98da-f8e029de0e63","name":"my-reservation","resource_type":"reservation"}]},"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"instance","startable":false,"status":"deleting","status_reasons":[{"code":"cannot_start_storage","message":"The virtual server instance is unusable because the encryption key for the boot volume\\nhas been deleted","more_info":"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}],"total_network_bandwidth":500,"total_volume_bandwidth":500,"vcpu":{"architecture":"amd64","count":4,"manufacturer":"intel"},"volume_attachments":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"device":{"id":"80b3e36e-41f4-40e9-bd56-beae81792a68"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a","id":"82cbf856-9cbb-45fb-b62f-d7bcef32399a","name":"my-volume-attachment","volume":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5","id":"1a6b7274-678d-4dfb-8981-c71dd9d4daa5","name":"my-volume","resource_type":"volume"}}],"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"total_count":2,"limit":1}'
responses.add(
responses.GET,
url,
@@ -9405,6 +9573,9 @@ def test_list_instances_with_pager_get_all(self):
placement_group_id='testString',
placement_group_crn='crn:v1:bluemix:public:is:us-south:a/123456::placement-group:r018-418fe842-a3e9-47b9-a938-1aa5bd632871',
placement_group_name='my-placement-group',
+ reservation_id='testString',
+ reservation_crn='crn:v1:bluemix:public:is:us-south:a/123456::reservation:7187-ba49df72-37b8-43ac-98da-f8e029de0e63',
+ reservation_name='my-reservation',
)
all_results = pager.get_all()
assert all_results is not None
@@ -9423,7 +9594,7 @@ def test_create_instance_all_params(self):
"""
# Set up mock
url = preprocess_url('/instances')
- mock_response = '{"availability_policy": {"host_failure": "restart"}, "bandwidth": 1000, "boot_volume_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}, "catalog_offering": {"version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "dedicated_host": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-host", "resource_type": "dedicated_host"}, "disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "nvme", "name": "my-instance-disk", "resource_type": "instance_disk", "size": 100}], "gpu": {"count": 1, "manufacturer": "nvidia", "memory": 1, "model": "Tesla V100"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image", "remote": {"account": {"id": "aa2432b1fa4d4ace891e9b80fc104e34", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "memory": 8, "metadata_service": {"enabled": false, "protocol": "http", "response_hop_limit": 1}, "name": "my-instance", "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}], "numa_count": 2, "placement_target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-host-group", "resource_type": "dedicated_host_group"}, "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "instance", "startable": false, "status": "deleting", "status_reasons": [{"code": "cannot_start_storage", "message": "The virtual server instance is unusable because the encryption key for the boot volume\nhas been deleted", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "total_network_bandwidth": 500, "total_volume_bandwidth": 500, "vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "volume_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
+ mock_response = '{"availability_policy": {"host_failure": "restart"}, "bandwidth": 1000, "boot_volume_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}, "catalog_offering": {"version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "dedicated_host": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-host", "resource_type": "dedicated_host"}, "disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "nvme", "name": "my-instance-disk", "resource_type": "instance_disk", "size": 100}], "gpu": {"count": 1, "manufacturer": "nvidia", "memory": 1, "model": "Tesla V100"}, "health_reasons": [{"code": "reservation_expired", "message": "The reservation cannot be used because it has expired.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-virtual-server-health-status-reasons"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image", "remote": {"account": {"id": "aa2432b1fa4d4ace891e9b80fc104e34", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "memory": 8, "metadata_service": {"enabled": false, "protocol": "http", "response_hop_limit": 1}, "name": "my-instance", "network_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/5dd61d72-acaa-47c2-a336-3d849660d010/network_attachments/0767-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0767-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-attachment", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "instance_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}], "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}], "numa_count": 2, "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_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/5dd61d72-acaa-47c2-a336-3d849660d010/network_attachments/0767-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0767-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-attachment", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "instance_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}, "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}, "reservation": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::reservation:7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/reservations/7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "id": "7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "name": "my-reservation", "resource_type": "reservation"}, "reservation_affinity": {"policy": "disabled", "pool": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::reservation:7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/reservations/7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "id": "7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "name": "my-reservation", "resource_type": "reservation"}]}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "instance", "startable": false, "status": "deleting", "status_reasons": [{"code": "cannot_start_storage", "message": "The virtual server instance is unusable because the encryption key for the boot volume\nhas been deleted", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "total_network_bandwidth": 500, "total_volume_bandwidth": 500, "vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "volume_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
responses.add(
responses.POST,
url,
@@ -9463,6 +9634,15 @@ def test_create_instance_all_params(self):
instance_profile_identity_model = {}
instance_profile_identity_model['name'] = 'bx2-2x8'
+ # Construct a dict representation of a ReservationIdentityById model
+ reservation_identity_model = {}
+ reservation_identity_model['id'] = '7187-ba49df72-37b8-43ac-98da-f8e029de0e63'
+
+ # Construct a dict representation of a InstanceReservationAffinityPrototype model
+ instance_reservation_affinity_prototype_model = {}
+ instance_reservation_affinity_prototype_model['policy'] = 'disabled'
+ instance_reservation_affinity_prototype_model['pool'] = [reservation_identity_model]
+
# Construct a dict representation of a ResourceGroupIdentityById model
resource_group_identity_model = {}
resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
@@ -9511,16 +9691,255 @@ def test_create_instance_all_params(self):
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 CatalogOfferingIdentityCatalogOfferingByCRN model
+ catalog_offering_identity_model = {}
+ catalog_offering_identity_model['crn'] = 'crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:offering:00111601-0ec5-41ac-b142-96d1e64e6442'
+
+ # Construct a dict representation of a InstanceCatalogOfferingPrototypeCatalogOfferingByOffering model
+ instance_catalog_offering_prototype_model = {}
+ instance_catalog_offering_prototype_model['offering'] = catalog_offering_identity_model
+
# Construct a dict representation of a ImageIdentityById model
image_identity_model = {}
image_identity_model['id'] = '9aaf3bcb-dcd7-4de7-bb60-24e39ff9d366'
+ # Construct a dict representation of a VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext model
+ virtual_network_interface_ip_prototype_model = {}
+ virtual_network_interface_ip_prototype_model['address'] = '10.0.0.5'
+ virtual_network_interface_ip_prototype_model['auto_delete'] = False
+ virtual_network_interface_ip_prototype_model['name'] = 'my-reserved-ip'
+
+ # Construct a dict representation of a VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext model
+ virtual_network_interface_primary_ip_prototype_model = {}
+ virtual_network_interface_primary_ip_prototype_model['address'] = '10.0.0.5'
+ virtual_network_interface_primary_ip_prototype_model['auto_delete'] = False
+ virtual_network_interface_primary_ip_prototype_model['name'] = 'my-reserved-ip'
+
+ # Construct a dict representation of a 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 InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeInstanceNetworkAttachmentContext model
+ instance_network_attachment_prototype_virtual_network_interface_model = {}
+ instance_network_attachment_prototype_virtual_network_interface_model['allow_ip_spoofing'] = True
+ instance_network_attachment_prototype_virtual_network_interface_model['auto_delete'] = False
+ instance_network_attachment_prototype_virtual_network_interface_model['enable_infrastructure_nat'] = True
+ instance_network_attachment_prototype_virtual_network_interface_model['ips'] = [virtual_network_interface_ip_prototype_model]
+ instance_network_attachment_prototype_virtual_network_interface_model['name'] = 'my-virtual-network-interface'
+ instance_network_attachment_prototype_virtual_network_interface_model['primary_ip'] = virtual_network_interface_primary_ip_prototype_model
+ instance_network_attachment_prototype_virtual_network_interface_model['resource_group'] = resource_group_identity_model
+ instance_network_attachment_prototype_virtual_network_interface_model['security_groups'] = [security_group_identity_model]
+ instance_network_attachment_prototype_virtual_network_interface_model['subnet'] = subnet_identity_model
+
+ # Construct a dict representation of a InstanceNetworkAttachmentPrototype model
+ instance_network_attachment_prototype_model = {}
+ instance_network_attachment_prototype_model['name'] = 'my-instance-network-attachment'
+ instance_network_attachment_prototype_model['virtual_network_interface'] = instance_network_attachment_prototype_virtual_network_interface_model
+
# Construct a dict representation of a NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext model
network_interface_ip_prototype_model = {}
network_interface_ip_prototype_model['address'] = '10.0.0.5'
network_interface_ip_prototype_model['auto_delete'] = False
network_interface_ip_prototype_model['name'] = 'my-reserved-ip'
+ # Construct a dict representation of a NetworkInterfacePrototype model
+ network_interface_prototype_model = {}
+ network_interface_prototype_model['allow_ip_spoofing'] = True
+ network_interface_prototype_model['name'] = 'my-instance-network-interface'
+ network_interface_prototype_model['primary_ip'] = network_interface_ip_prototype_model
+ network_interface_prototype_model['security_groups'] = [security_group_identity_model]
+ network_interface_prototype_model['subnet'] = subnet_identity_model
+
+ # Construct a dict representation of a InstanceTemplateIdentityById model
+ instance_template_identity_model = {}
+ instance_template_identity_model['id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803'
+
+ # Construct a dict representation of a ZoneIdentityByName model
+ zone_identity_model = {}
+ zone_identity_model['name'] = 'us-south-1'
+
+ # Construct a dict representation of a InstancePrototypeInstanceBySourceTemplate model
+ instance_prototype_model = {}
+ instance_prototype_model['availability_policy'] = instance_availability_policy_prototype_model
+ instance_prototype_model['default_trusted_profile'] = instance_default_trusted_profile_prototype_model
+ instance_prototype_model['keys'] = [key_identity_model]
+ instance_prototype_model['metadata_service'] = instance_metadata_service_prototype_model
+ instance_prototype_model['name'] = 'my-instance'
+ instance_prototype_model['placement_target'] = instance_placement_target_prototype_model
+ instance_prototype_model['profile'] = instance_profile_identity_model
+ instance_prototype_model['reservation_affinity'] = instance_reservation_affinity_prototype_model
+ instance_prototype_model['resource_group'] = resource_group_identity_model
+ instance_prototype_model['total_volume_bandwidth'] = 500
+ instance_prototype_model['user_data'] = 'testString'
+ instance_prototype_model['volume_attachments'] = [volume_attachment_prototype_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['catalog_offering'] = instance_catalog_offering_prototype_model
+ instance_prototype_model['image'] = image_identity_model
+ instance_prototype_model['network_attachments'] = [instance_network_attachment_prototype_model]
+ instance_prototype_model['network_interfaces'] = [network_interface_prototype_model]
+ instance_prototype_model['primary_network_attachment'] = instance_network_attachment_prototype_model
+ instance_prototype_model['primary_network_interface'] = network_interface_prototype_model
+ instance_prototype_model['source_template'] = instance_template_identity_model
+ instance_prototype_model['zone'] = zone_identity_model
+
+ # Set up parameter values
+ instance_prototype = instance_prototype_model
+
+ # Invoke method
+ response = _service.create_instance(
+ instance_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 == instance_prototype
+
+ def test_create_instance_all_params_with_retries(self):
+ # Enable retries and run test_create_instance_all_params.
+ _service.enable_retries()
+ self.test_create_instance_all_params()
+
+ # Disable retries and run test_create_instance_all_params.
+ _service.disable_retries()
+ self.test_create_instance_all_params()
+
+ @responses.activate
+ def test_create_instance_value_error(self):
+ """
+ test_create_instance_value_error()
+ """
+ # Set up mock
+ url = preprocess_url('/instances')
+ mock_response = '{"availability_policy": {"host_failure": "restart"}, "bandwidth": 1000, "boot_volume_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}, "catalog_offering": {"version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "dedicated_host": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-host", "resource_type": "dedicated_host"}, "disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "nvme", "name": "my-instance-disk", "resource_type": "instance_disk", "size": 100}], "gpu": {"count": 1, "manufacturer": "nvidia", "memory": 1, "model": "Tesla V100"}, "health_reasons": [{"code": "reservation_expired", "message": "The reservation cannot be used because it has expired.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-virtual-server-health-status-reasons"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image", "remote": {"account": {"id": "aa2432b1fa4d4ace891e9b80fc104e34", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "memory": 8, "metadata_service": {"enabled": false, "protocol": "http", "response_hop_limit": 1}, "name": "my-instance", "network_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/5dd61d72-acaa-47c2-a336-3d849660d010/network_attachments/0767-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0767-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-attachment", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "instance_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}], "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}], "numa_count": 2, "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_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/5dd61d72-acaa-47c2-a336-3d849660d010/network_attachments/0767-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0767-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-attachment", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "instance_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}, "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}, "reservation": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::reservation:7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/reservations/7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "id": "7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "name": "my-reservation", "resource_type": "reservation"}, "reservation_affinity": {"policy": "disabled", "pool": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::reservation:7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/reservations/7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "id": "7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "name": "my-reservation", "resource_type": "reservation"}]}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "instance", "startable": false, "status": "deleting", "status_reasons": [{"code": "cannot_start_storage", "message": "The virtual server instance is unusable because the encryption key for the boot volume\nhas been deleted", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "total_network_bandwidth": 500, "total_volume_bandwidth": 500, "vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "volume_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
+ responses.add(
+ responses.POST,
+ url,
+ body=mock_response,
+ content_type='application/json',
+ status=201,
+ )
+
+ # Construct a dict representation of a InstanceAvailabilityPolicyPrototype model
+ instance_availability_policy_prototype_model = {}
+ instance_availability_policy_prototype_model['host_failure'] = 'restart'
+
+ # Construct a dict representation of a TrustedProfileIdentityTrustedProfileById model
+ trusted_profile_identity_model = {}
+ trusted_profile_identity_model['id'] = 'Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5'
+
+ # Construct a dict representation of a InstanceDefaultTrustedProfilePrototype model
+ instance_default_trusted_profile_prototype_model = {}
+ instance_default_trusted_profile_prototype_model['auto_link'] = False
+ instance_default_trusted_profile_prototype_model['target'] = trusted_profile_identity_model
+
+ # Construct a dict representation of a KeyIdentityById model
+ key_identity_model = {}
+ key_identity_model['id'] = '363f6d70-0000-0001-0000-00000013b96c'
+
+ # Construct a dict representation of a InstanceMetadataServicePrototype model
+ instance_metadata_service_prototype_model = {}
+ instance_metadata_service_prototype_model['enabled'] = False
+ instance_metadata_service_prototype_model['protocol'] = 'https'
+ instance_metadata_service_prototype_model['response_hop_limit'] = 2
+
+ # Construct a dict representation of a InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById model
+ instance_placement_target_prototype_model = {}
+ instance_placement_target_prototype_model['id'] = '0787-84e4793a-7cd8-4a7b-b253-818aa19d0512'
+
+ # Construct a dict representation of a InstanceProfileIdentityByName model
+ instance_profile_identity_model = {}
+ instance_profile_identity_model['name'] = 'bx2-2x8'
+
+ # Construct a dict representation of a ReservationIdentityById model
+ reservation_identity_model = {}
+ reservation_identity_model['id'] = '7187-ba49df72-37b8-43ac-98da-f8e029de0e63'
+
+ # Construct a dict representation of a InstanceReservationAffinityPrototype model
+ instance_reservation_affinity_prototype_model = {}
+ instance_reservation_affinity_prototype_model['policy'] = 'disabled'
+ instance_reservation_affinity_prototype_model['pool'] = [reservation_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 VolumeProfileIdentityByName model
+ volume_profile_identity_model = {}
+ volume_profile_identity_model['name'] = '5iops-tier'
+
+ # Construct a dict representation of a EncryptionKeyIdentityByCRN model
+ encryption_key_identity_model = {}
+ encryption_key_identity_model['crn'] = 'crn:[...]'
+
+ # Construct a dict representation of a VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity model
+ volume_attachment_prototype_volume_model = {}
+ volume_attachment_prototype_volume_model['iops'] = 10000
+ volume_attachment_prototype_volume_model['name'] = 'my-data-volume'
+ volume_attachment_prototype_volume_model['profile'] = volume_profile_identity_model
+ volume_attachment_prototype_volume_model['resource_group'] = resource_group_identity_model
+ volume_attachment_prototype_volume_model['user_tags'] = []
+ volume_attachment_prototype_volume_model['capacity'] = 1000
+ volume_attachment_prototype_volume_model['encryption_key'] = encryption_key_identity_model
+
+ # Construct a dict representation of a VolumeAttachmentPrototype model
+ volume_attachment_prototype_model = {}
+ volume_attachment_prototype_model['delete_volume_on_instance_delete'] = False
+ volume_attachment_prototype_model['name'] = 'my-volume-attachment'
+ volume_attachment_prototype_model['volume'] = volume_attachment_prototype_volume_model
+
+ # Construct a dict representation of a VPCIdentityById model
+ vpc_identity_model = {}
+ vpc_identity_model['id'] = 'f0aae929-7047-46d1-92e1-9102b07a7f6f'
+
+ # 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['encryption_key'] = encryption_key_identity_model
+ volume_prototype_instance_by_image_context_model['iops'] = 10000
+ volume_prototype_instance_by_image_context_model['name'] = 'my-boot-volume'
+ volume_prototype_instance_by_image_context_model['profile'] = volume_profile_identity_model
+ volume_prototype_instance_by_image_context_model['resource_group'] = resource_group_identity_model
+ volume_prototype_instance_by_image_context_model['user_tags'] = []
+
+ # 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 CatalogOfferingIdentityCatalogOfferingByCRN model
+ catalog_offering_identity_model = {}
+ catalog_offering_identity_model['crn'] = 'crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:offering:00111601-0ec5-41ac-b142-96d1e64e6442'
+
+ # Construct a dict representation of a InstanceCatalogOfferingPrototypeCatalogOfferingByOffering model
+ instance_catalog_offering_prototype_model = {}
+ instance_catalog_offering_prototype_model['offering'] = catalog_offering_identity_model
+
+ # Construct a dict representation of a ImageIdentityById model
+ image_identity_model = {}
+ image_identity_model['id'] = '9aaf3bcb-dcd7-4de7-bb60-24e39ff9d366'
+
+ # Construct a dict representation of a VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext model
+ virtual_network_interface_ip_prototype_model = {}
+ virtual_network_interface_ip_prototype_model['address'] = '10.0.0.5'
+ virtual_network_interface_ip_prototype_model['auto_delete'] = False
+ virtual_network_interface_ip_prototype_model['name'] = 'my-reserved-ip'
+
+ # Construct a dict representation of a VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext model
+ virtual_network_interface_primary_ip_prototype_model = {}
+ virtual_network_interface_primary_ip_prototype_model['address'] = '10.0.0.5'
+ virtual_network_interface_primary_ip_prototype_model['auto_delete'] = False
+ virtual_network_interface_primary_ip_prototype_model['name'] = 'my-reserved-ip'
+
# Construct a dict representation of a SecurityGroupIdentityById model
security_group_identity_model = {}
security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271'
@@ -9529,6 +9948,29 @@ def test_create_instance_all_params(self):
subnet_identity_model = {}
subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
+ # Construct a dict representation of a InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeInstanceNetworkAttachmentContext model
+ instance_network_attachment_prototype_virtual_network_interface_model = {}
+ instance_network_attachment_prototype_virtual_network_interface_model['allow_ip_spoofing'] = True
+ instance_network_attachment_prototype_virtual_network_interface_model['auto_delete'] = False
+ instance_network_attachment_prototype_virtual_network_interface_model['enable_infrastructure_nat'] = True
+ instance_network_attachment_prototype_virtual_network_interface_model['ips'] = [virtual_network_interface_ip_prototype_model]
+ instance_network_attachment_prototype_virtual_network_interface_model['name'] = 'my-virtual-network-interface'
+ instance_network_attachment_prototype_virtual_network_interface_model['primary_ip'] = virtual_network_interface_primary_ip_prototype_model
+ instance_network_attachment_prototype_virtual_network_interface_model['resource_group'] = resource_group_identity_model
+ instance_network_attachment_prototype_virtual_network_interface_model['security_groups'] = [security_group_identity_model]
+ instance_network_attachment_prototype_virtual_network_interface_model['subnet'] = subnet_identity_model
+
+ # Construct a dict representation of a InstanceNetworkAttachmentPrototype model
+ instance_network_attachment_prototype_model = {}
+ instance_network_attachment_prototype_model['name'] = 'my-instance-network-attachment'
+ instance_network_attachment_prototype_model['virtual_network_interface'] = instance_network_attachment_prototype_virtual_network_interface_model
+
+ # Construct a dict representation of a NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext model
+ network_interface_ip_prototype_model = {}
+ network_interface_ip_prototype_model['address'] = '10.0.0.5'
+ network_interface_ip_prototype_model['auto_delete'] = False
+ network_interface_ip_prototype_model['name'] = 'my-reserved-ip'
+
# Construct a dict representation of a NetworkInterfacePrototype model
network_interface_prototype_model = {}
network_interface_prototype_model['allow_ip_spoofing'] = True
@@ -9537,181 +9979,15 @@ def test_create_instance_all_params(self):
network_interface_prototype_model['security_groups'] = [security_group_identity_model]
network_interface_prototype_model['subnet'] = subnet_identity_model
+ # Construct a dict representation of a InstanceTemplateIdentityById model
+ instance_template_identity_model = {}
+ instance_template_identity_model['id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803'
+
# Construct a dict representation of a ZoneIdentityByName model
zone_identity_model = {}
zone_identity_model['name'] = 'us-south-1'
- # Construct a dict representation of a InstancePrototypeInstanceByImage model
- instance_prototype_model = {}
- instance_prototype_model['availability_policy'] = instance_availability_policy_prototype_model
- instance_prototype_model['default_trusted_profile'] = instance_default_trusted_profile_prototype_model
- instance_prototype_model['keys'] = [key_identity_model]
- instance_prototype_model['metadata_service'] = instance_metadata_service_prototype_model
- instance_prototype_model['name'] = 'my-instance'
- instance_prototype_model['placement_target'] = instance_placement_target_prototype_model
- instance_prototype_model['profile'] = instance_profile_identity_model
- instance_prototype_model['resource_group'] = resource_group_identity_model
- instance_prototype_model['total_volume_bandwidth'] = 500
- instance_prototype_model['user_data'] = 'testString'
- instance_prototype_model['volume_attachments'] = [volume_attachment_prototype_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['network_interfaces'] = [network_interface_prototype_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
-
- # Invoke method
- response = _service.create_instance(
- instance_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 == instance_prototype
-
- def test_create_instance_all_params_with_retries(self):
- # Enable retries and run test_create_instance_all_params.
- _service.enable_retries()
- self.test_create_instance_all_params()
-
- # Disable retries and run test_create_instance_all_params.
- _service.disable_retries()
- self.test_create_instance_all_params()
-
- @responses.activate
- def test_create_instance_value_error(self):
- """
- test_create_instance_value_error()
- """
- # Set up mock
- url = preprocess_url('/instances')
- mock_response = '{"availability_policy": {"host_failure": "restart"}, "bandwidth": 1000, "boot_volume_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}, "catalog_offering": {"version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "dedicated_host": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-host", "resource_type": "dedicated_host"}, "disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "nvme", "name": "my-instance-disk", "resource_type": "instance_disk", "size": 100}], "gpu": {"count": 1, "manufacturer": "nvidia", "memory": 1, "model": "Tesla V100"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image", "remote": {"account": {"id": "aa2432b1fa4d4ace891e9b80fc104e34", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "memory": 8, "metadata_service": {"enabled": false, "protocol": "http", "response_hop_limit": 1}, "name": "my-instance", "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}], "numa_count": 2, "placement_target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-host-group", "resource_type": "dedicated_host_group"}, "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "instance", "startable": false, "status": "deleting", "status_reasons": [{"code": "cannot_start_storage", "message": "The virtual server instance is unusable because the encryption key for the boot volume\nhas been deleted", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "total_network_bandwidth": 500, "total_volume_bandwidth": 500, "vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "volume_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
- responses.add(
- responses.POST,
- url,
- body=mock_response,
- content_type='application/json',
- status=201,
- )
-
- # Construct a dict representation of a InstanceAvailabilityPolicyPrototype model
- instance_availability_policy_prototype_model = {}
- instance_availability_policy_prototype_model['host_failure'] = 'restart'
-
- # Construct a dict representation of a TrustedProfileIdentityTrustedProfileById model
- trusted_profile_identity_model = {}
- trusted_profile_identity_model['id'] = 'Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5'
-
- # Construct a dict representation of a InstanceDefaultTrustedProfilePrototype model
- instance_default_trusted_profile_prototype_model = {}
- instance_default_trusted_profile_prototype_model['auto_link'] = False
- instance_default_trusted_profile_prototype_model['target'] = trusted_profile_identity_model
-
- # Construct a dict representation of a KeyIdentityById model
- key_identity_model = {}
- key_identity_model['id'] = '363f6d70-0000-0001-0000-00000013b96c'
-
- # Construct a dict representation of a InstanceMetadataServicePrototype model
- instance_metadata_service_prototype_model = {}
- instance_metadata_service_prototype_model['enabled'] = False
- instance_metadata_service_prototype_model['protocol'] = 'https'
- instance_metadata_service_prototype_model['response_hop_limit'] = 2
-
- # Construct a dict representation of a InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById model
- instance_placement_target_prototype_model = {}
- instance_placement_target_prototype_model['id'] = '0787-84e4793a-7cd8-4a7b-b253-818aa19d0512'
-
- # Construct a dict representation of a InstanceProfileIdentityByName model
- instance_profile_identity_model = {}
- instance_profile_identity_model['name'] = 'bx2-2x8'
-
- # 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'] = '5iops-tier'
-
- # Construct a dict representation of a EncryptionKeyIdentityByCRN model
- encryption_key_identity_model = {}
- encryption_key_identity_model['crn'] = 'crn:[...]'
-
- # Construct a dict representation of a VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity model
- volume_attachment_prototype_volume_model = {}
- volume_attachment_prototype_volume_model['iops'] = 10000
- volume_attachment_prototype_volume_model['name'] = 'my-data-volume'
- volume_attachment_prototype_volume_model['profile'] = volume_profile_identity_model
- volume_attachment_prototype_volume_model['resource_group'] = resource_group_identity_model
- volume_attachment_prototype_volume_model['user_tags'] = []
- volume_attachment_prototype_volume_model['capacity'] = 1000
- volume_attachment_prototype_volume_model['encryption_key'] = encryption_key_identity_model
-
- # Construct a dict representation of a VolumeAttachmentPrototype model
- volume_attachment_prototype_model = {}
- volume_attachment_prototype_model['delete_volume_on_instance_delete'] = False
- volume_attachment_prototype_model['name'] = 'my-volume-attachment'
- volume_attachment_prototype_model['volume'] = volume_attachment_prototype_volume_model
-
- # Construct a dict representation of a VPCIdentityById model
- vpc_identity_model = {}
- vpc_identity_model['id'] = 'f0aae929-7047-46d1-92e1-9102b07a7f6f'
-
- # 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['encryption_key'] = encryption_key_identity_model
- volume_prototype_instance_by_image_context_model['iops'] = 10000
- volume_prototype_instance_by_image_context_model['name'] = 'my-boot-volume'
- volume_prototype_instance_by_image_context_model['profile'] = volume_profile_identity_model
- volume_prototype_instance_by_image_context_model['resource_group'] = resource_group_identity_model
- volume_prototype_instance_by_image_context_model['user_tags'] = []
-
- # 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 ImageIdentityById model
- image_identity_model = {}
- image_identity_model['id'] = '9aaf3bcb-dcd7-4de7-bb60-24e39ff9d366'
-
- # Construct a dict representation of a NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext model
- network_interface_ip_prototype_model = {}
- network_interface_ip_prototype_model['address'] = '10.0.0.5'
- network_interface_ip_prototype_model['auto_delete'] = False
- network_interface_ip_prototype_model['name'] = 'my-reserved-ip'
-
- # Construct a dict representation of a SecurityGroupIdentityById model
- security_group_identity_model = {}
- security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271'
-
- # 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 NetworkInterfacePrototype model
- network_interface_prototype_model = {}
- network_interface_prototype_model['allow_ip_spoofing'] = True
- network_interface_prototype_model['name'] = 'my-instance-network-interface'
- network_interface_prototype_model['primary_ip'] = network_interface_ip_prototype_model
- network_interface_prototype_model['security_groups'] = [security_group_identity_model]
- network_interface_prototype_model['subnet'] = subnet_identity_model
-
- # Construct a dict representation of a ZoneIdentityByName model
- zone_identity_model = {}
- zone_identity_model['name'] = 'us-south-1'
-
- # Construct a dict representation of a InstancePrototypeInstanceByImage model
+ # Construct a dict representation of a InstancePrototypeInstanceBySourceTemplate model
instance_prototype_model = {}
instance_prototype_model['availability_policy'] = instance_availability_policy_prototype_model
instance_prototype_model['default_trusted_profile'] = instance_default_trusted_profile_prototype_model
@@ -9720,15 +9996,20 @@ def test_create_instance_value_error(self):
instance_prototype_model['name'] = 'my-instance'
instance_prototype_model['placement_target'] = instance_placement_target_prototype_model
instance_prototype_model['profile'] = instance_profile_identity_model
+ instance_prototype_model['reservation_affinity'] = instance_reservation_affinity_prototype_model
instance_prototype_model['resource_group'] = resource_group_identity_model
instance_prototype_model['total_volume_bandwidth'] = 500
instance_prototype_model['user_data'] = 'testString'
instance_prototype_model['volume_attachments'] = [volume_attachment_prototype_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['catalog_offering'] = instance_catalog_offering_prototype_model
instance_prototype_model['image'] = image_identity_model
+ instance_prototype_model['network_attachments'] = [instance_network_attachment_prototype_model]
instance_prototype_model['network_interfaces'] = [network_interface_prototype_model]
+ instance_prototype_model['primary_network_attachment'] = instance_network_attachment_prototype_model
instance_prototype_model['primary_network_interface'] = network_interface_prototype_model
+ instance_prototype_model['source_template'] = instance_template_identity_model
instance_prototype_model['zone'] = zone_identity_model
# Set up parameter values
@@ -9773,10 +10054,12 @@ def test_delete_instance_all_params(self):
# Set up parameter values
id = 'testString'
+ if_match = 'W/"96d225c4-56bd-43d9-98fc-d7148e5c5028"'
# Invoke method
response = _service.delete_instance(
id,
+ if_match=if_match,
headers={},
)
@@ -9793,6 +10076,41 @@ def test_delete_instance_all_params_with_retries(self):
_service.disable_retries()
self.test_delete_instance_all_params()
+ @responses.activate
+ def test_delete_instance_required_params(self):
+ """
+ test_delete_instance_required_params()
+ """
+ # Set up mock
+ url = preprocess_url('/instances/testString')
+ responses.add(
+ responses.DELETE,
+ url,
+ status=204,
+ )
+
+ # Set up parameter values
+ id = 'testString'
+
+ # Invoke method
+ response = _service.delete_instance(
+ id,
+ headers={},
+ )
+
+ # Check for correct operation
+ assert len(responses.calls) == 1
+ assert response.status_code == 204
+
+ def test_delete_instance_required_params_with_retries(self):
+ # Enable retries and run test_delete_instance_required_params.
+ _service.enable_retries()
+ self.test_delete_instance_required_params()
+
+ # Disable retries and run test_delete_instance_required_params.
+ _service.disable_retries()
+ self.test_delete_instance_required_params()
+
@responses.activate
def test_delete_instance_value_error(self):
"""
@@ -9840,7 +10158,7 @@ def test_get_instance_all_params(self):
"""
# Set up mock
url = preprocess_url('/instances/testString')
- mock_response = '{"availability_policy": {"host_failure": "restart"}, "bandwidth": 1000, "boot_volume_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}, "catalog_offering": {"version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "dedicated_host": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-host", "resource_type": "dedicated_host"}, "disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "nvme", "name": "my-instance-disk", "resource_type": "instance_disk", "size": 100}], "gpu": {"count": 1, "manufacturer": "nvidia", "memory": 1, "model": "Tesla V100"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image", "remote": {"account": {"id": "aa2432b1fa4d4ace891e9b80fc104e34", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "memory": 8, "metadata_service": {"enabled": false, "protocol": "http", "response_hop_limit": 1}, "name": "my-instance", "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}], "numa_count": 2, "placement_target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-host-group", "resource_type": "dedicated_host_group"}, "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "instance", "startable": false, "status": "deleting", "status_reasons": [{"code": "cannot_start_storage", "message": "The virtual server instance is unusable because the encryption key for the boot volume\nhas been deleted", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "total_network_bandwidth": 500, "total_volume_bandwidth": 500, "vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "volume_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
+ mock_response = '{"availability_policy": {"host_failure": "restart"}, "bandwidth": 1000, "boot_volume_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}, "catalog_offering": {"version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "dedicated_host": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-host", "resource_type": "dedicated_host"}, "disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "nvme", "name": "my-instance-disk", "resource_type": "instance_disk", "size": 100}], "gpu": {"count": 1, "manufacturer": "nvidia", "memory": 1, "model": "Tesla V100"}, "health_reasons": [{"code": "reservation_expired", "message": "The reservation cannot be used because it has expired.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-virtual-server-health-status-reasons"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image", "remote": {"account": {"id": "aa2432b1fa4d4ace891e9b80fc104e34", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "memory": 8, "metadata_service": {"enabled": false, "protocol": "http", "response_hop_limit": 1}, "name": "my-instance", "network_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/5dd61d72-acaa-47c2-a336-3d849660d010/network_attachments/0767-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0767-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-attachment", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "instance_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}], "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}], "numa_count": 2, "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_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/5dd61d72-acaa-47c2-a336-3d849660d010/network_attachments/0767-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0767-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-attachment", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "instance_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}, "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}, "reservation": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::reservation:7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/reservations/7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "id": "7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "name": "my-reservation", "resource_type": "reservation"}, "reservation_affinity": {"policy": "disabled", "pool": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::reservation:7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/reservations/7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "id": "7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "name": "my-reservation", "resource_type": "reservation"}]}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "instance", "startable": false, "status": "deleting", "status_reasons": [{"code": "cannot_start_storage", "message": "The virtual server instance is unusable because the encryption key for the boot volume\nhas been deleted", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "total_network_bandwidth": 500, "total_volume_bandwidth": 500, "vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "volume_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
responses.add(
responses.GET,
url,
@@ -9878,7 +10196,7 @@ def test_get_instance_value_error(self):
"""
# Set up mock
url = preprocess_url('/instances/testString')
- mock_response = '{"availability_policy": {"host_failure": "restart"}, "bandwidth": 1000, "boot_volume_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}, "catalog_offering": {"version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "dedicated_host": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-host", "resource_type": "dedicated_host"}, "disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "nvme", "name": "my-instance-disk", "resource_type": "instance_disk", "size": 100}], "gpu": {"count": 1, "manufacturer": "nvidia", "memory": 1, "model": "Tesla V100"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image", "remote": {"account": {"id": "aa2432b1fa4d4ace891e9b80fc104e34", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "memory": 8, "metadata_service": {"enabled": false, "protocol": "http", "response_hop_limit": 1}, "name": "my-instance", "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}], "numa_count": 2, "placement_target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-host-group", "resource_type": "dedicated_host_group"}, "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "instance", "startable": false, "status": "deleting", "status_reasons": [{"code": "cannot_start_storage", "message": "The virtual server instance is unusable because the encryption key for the boot volume\nhas been deleted", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "total_network_bandwidth": 500, "total_volume_bandwidth": 500, "vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "volume_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
+ mock_response = '{"availability_policy": {"host_failure": "restart"}, "bandwidth": 1000, "boot_volume_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}, "catalog_offering": {"version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "dedicated_host": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-host", "resource_type": "dedicated_host"}, "disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "nvme", "name": "my-instance-disk", "resource_type": "instance_disk", "size": 100}], "gpu": {"count": 1, "manufacturer": "nvidia", "memory": 1, "model": "Tesla V100"}, "health_reasons": [{"code": "reservation_expired", "message": "The reservation cannot be used because it has expired.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-virtual-server-health-status-reasons"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image", "remote": {"account": {"id": "aa2432b1fa4d4ace891e9b80fc104e34", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "memory": 8, "metadata_service": {"enabled": false, "protocol": "http", "response_hop_limit": 1}, "name": "my-instance", "network_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/5dd61d72-acaa-47c2-a336-3d849660d010/network_attachments/0767-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0767-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-attachment", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "instance_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}], "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}], "numa_count": 2, "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_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/5dd61d72-acaa-47c2-a336-3d849660d010/network_attachments/0767-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0767-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-attachment", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "instance_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}, "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}, "reservation": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::reservation:7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/reservations/7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "id": "7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "name": "my-reservation", "resource_type": "reservation"}, "reservation_affinity": {"policy": "disabled", "pool": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::reservation:7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/reservations/7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "id": "7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "name": "my-reservation", "resource_type": "reservation"}]}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "instance", "startable": false, "status": "deleting", "status_reasons": [{"code": "cannot_start_storage", "message": "The virtual server instance is unusable because the encryption key for the boot volume\nhas been deleted", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "total_network_bandwidth": 500, "total_volume_bandwidth": 500, "vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "volume_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
responses.add(
responses.GET,
url,
@@ -9921,7 +10239,7 @@ def test_update_instance_all_params(self):
"""
# Set up mock
url = preprocess_url('/instances/testString')
- mock_response = '{"availability_policy": {"host_failure": "restart"}, "bandwidth": 1000, "boot_volume_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}, "catalog_offering": {"version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "dedicated_host": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-host", "resource_type": "dedicated_host"}, "disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "nvme", "name": "my-instance-disk", "resource_type": "instance_disk", "size": 100}], "gpu": {"count": 1, "manufacturer": "nvidia", "memory": 1, "model": "Tesla V100"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image", "remote": {"account": {"id": "aa2432b1fa4d4ace891e9b80fc104e34", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "memory": 8, "metadata_service": {"enabled": false, "protocol": "http", "response_hop_limit": 1}, "name": "my-instance", "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}], "numa_count": 2, "placement_target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-host-group", "resource_type": "dedicated_host_group"}, "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "instance", "startable": false, "status": "deleting", "status_reasons": [{"code": "cannot_start_storage", "message": "The virtual server instance is unusable because the encryption key for the boot volume\nhas been deleted", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "total_network_bandwidth": 500, "total_volume_bandwidth": 500, "vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "volume_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
+ mock_response = '{"availability_policy": {"host_failure": "restart"}, "bandwidth": 1000, "boot_volume_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}, "catalog_offering": {"version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "dedicated_host": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-host", "resource_type": "dedicated_host"}, "disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "nvme", "name": "my-instance-disk", "resource_type": "instance_disk", "size": 100}], "gpu": {"count": 1, "manufacturer": "nvidia", "memory": 1, "model": "Tesla V100"}, "health_reasons": [{"code": "reservation_expired", "message": "The reservation cannot be used because it has expired.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-virtual-server-health-status-reasons"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image", "remote": {"account": {"id": "aa2432b1fa4d4ace891e9b80fc104e34", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "memory": 8, "metadata_service": {"enabled": false, "protocol": "http", "response_hop_limit": 1}, "name": "my-instance", "network_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/5dd61d72-acaa-47c2-a336-3d849660d010/network_attachments/0767-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0767-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-attachment", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "instance_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}], "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}], "numa_count": 2, "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_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/5dd61d72-acaa-47c2-a336-3d849660d010/network_attachments/0767-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0767-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-attachment", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "instance_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}, "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}, "reservation": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::reservation:7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/reservations/7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "id": "7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "name": "my-reservation", "resource_type": "reservation"}, "reservation_affinity": {"policy": "disabled", "pool": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::reservation:7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/reservations/7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "id": "7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "name": "my-reservation", "resource_type": "reservation"}]}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "instance", "startable": false, "status": "deleting", "status_reasons": [{"code": "cannot_start_storage", "message": "The virtual server instance is unusable because the encryption key for the boot volume\nhas been deleted", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "total_network_bandwidth": 500, "total_volume_bandwidth": 500, "vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "volume_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
responses.add(
responses.PATCH,
url,
@@ -9948,6 +10266,15 @@ def test_update_instance_all_params(self):
instance_patch_profile_model = {}
instance_patch_profile_model['name'] = 'bx2-4x16'
+ # Construct a dict representation of a ReservationIdentityById model
+ reservation_identity_model = {}
+ reservation_identity_model['id'] = '7187-ba49df72-37b8-43ac-98da-f8e029de0e63'
+
+ # Construct a dict representation of a InstanceReservationAffinityPatch model
+ instance_reservation_affinity_patch_model = {}
+ instance_reservation_affinity_patch_model['policy'] = 'disabled'
+ instance_reservation_affinity_patch_model['pool'] = [reservation_identity_model]
+
# Construct a dict representation of a InstancePatch model
instance_patch_model = {}
instance_patch_model['availability_policy'] = instance_availability_policy_patch_model
@@ -9955,16 +10282,19 @@ def test_update_instance_all_params(self):
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['reservation_affinity'] = instance_reservation_affinity_patch_model
instance_patch_model['total_volume_bandwidth'] = 500
# Set up parameter values
id = 'testString'
instance_patch = instance_patch_model
+ if_match = 'W/"96d225c4-56bd-43d9-98fc-d7148e5c5028"'
# Invoke method
response = _service.update_instance(
id,
instance_patch,
+ if_match=if_match,
headers={},
)
@@ -9984,6 +10314,86 @@ def test_update_instance_all_params_with_retries(self):
_service.disable_retries()
self.test_update_instance_all_params()
+ @responses.activate
+ def test_update_instance_required_params(self):
+ """
+ test_update_instance_required_params()
+ """
+ # Set up mock
+ url = preprocess_url('/instances/testString')
+ mock_response = '{"availability_policy": {"host_failure": "restart"}, "bandwidth": 1000, "boot_volume_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}, "catalog_offering": {"version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "dedicated_host": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-host", "resource_type": "dedicated_host"}, "disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "nvme", "name": "my-instance-disk", "resource_type": "instance_disk", "size": 100}], "gpu": {"count": 1, "manufacturer": "nvidia", "memory": 1, "model": "Tesla V100"}, "health_reasons": [{"code": "reservation_expired", "message": "The reservation cannot be used because it has expired.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-virtual-server-health-status-reasons"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image", "remote": {"account": {"id": "aa2432b1fa4d4ace891e9b80fc104e34", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "memory": 8, "metadata_service": {"enabled": false, "protocol": "http", "response_hop_limit": 1}, "name": "my-instance", "network_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/5dd61d72-acaa-47c2-a336-3d849660d010/network_attachments/0767-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0767-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-attachment", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "instance_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}], "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}], "numa_count": 2, "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_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/5dd61d72-acaa-47c2-a336-3d849660d010/network_attachments/0767-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0767-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-attachment", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "instance_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}, "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}, "reservation": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::reservation:7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/reservations/7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "id": "7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "name": "my-reservation", "resource_type": "reservation"}, "reservation_affinity": {"policy": "disabled", "pool": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::reservation:7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/reservations/7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "id": "7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "name": "my-reservation", "resource_type": "reservation"}]}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "instance", "startable": false, "status": "deleting", "status_reasons": [{"code": "cannot_start_storage", "message": "The virtual server instance is unusable because the encryption key for the boot volume\nhas been deleted", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "total_network_bandwidth": 500, "total_volume_bandwidth": 500, "vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "volume_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
+ responses.add(
+ responses.PATCH,
+ url,
+ body=mock_response,
+ content_type='application/json',
+ status=200,
+ )
+
+ # Construct a dict representation of a InstanceAvailabilityPolicyPatch model
+ instance_availability_policy_patch_model = {}
+ instance_availability_policy_patch_model['host_failure'] = 'restart'
+
+ # Construct a dict representation of a InstanceMetadataServicePatch model
+ instance_metadata_service_patch_model = {}
+ instance_metadata_service_patch_model['enabled'] = True
+ instance_metadata_service_patch_model['protocol'] = 'http'
+ instance_metadata_service_patch_model['response_hop_limit'] = 1
+
+ # 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'] = 'bx2-4x16'
+
+ # Construct a dict representation of a ReservationIdentityById model
+ reservation_identity_model = {}
+ reservation_identity_model['id'] = '7187-ba49df72-37b8-43ac-98da-f8e029de0e63'
+
+ # Construct a dict representation of a InstanceReservationAffinityPatch model
+ instance_reservation_affinity_patch_model = {}
+ instance_reservation_affinity_patch_model['policy'] = 'disabled'
+ instance_reservation_affinity_patch_model['pool'] = [reservation_identity_model]
+
+ # Construct a dict representation of a InstancePatch model
+ instance_patch_model = {}
+ instance_patch_model['availability_policy'] = instance_availability_policy_patch_model
+ instance_patch_model['metadata_service'] = instance_metadata_service_patch_model
+ instance_patch_model['name'] = 'my-instance'
+ instance_patch_model['placement_target'] = instance_placement_target_patch_model
+ instance_patch_model['profile'] = instance_patch_profile_model
+ instance_patch_model['reservation_affinity'] = instance_reservation_affinity_patch_model
+ instance_patch_model['total_volume_bandwidth'] = 500
+
+ # Set up parameter values
+ id = 'testString'
+ instance_patch = instance_patch_model
+
+ # Invoke method
+ response = _service.update_instance(
+ id,
+ instance_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 == instance_patch
+
+ def test_update_instance_required_params_with_retries(self):
+ # Enable retries and run test_update_instance_required_params.
+ _service.enable_retries()
+ self.test_update_instance_required_params()
+
+ # Disable retries and run test_update_instance_required_params.
+ _service.disable_retries()
+ self.test_update_instance_required_params()
+
@responses.activate
def test_update_instance_value_error(self):
"""
@@ -9991,7 +10401,7 @@ def test_update_instance_value_error(self):
"""
# Set up mock
url = preprocess_url('/instances/testString')
- mock_response = '{"availability_policy": {"host_failure": "restart"}, "bandwidth": 1000, "boot_volume_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}, "catalog_offering": {"version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "dedicated_host": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-host", "resource_type": "dedicated_host"}, "disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "nvme", "name": "my-instance-disk", "resource_type": "instance_disk", "size": 100}], "gpu": {"count": 1, "manufacturer": "nvidia", "memory": 1, "model": "Tesla V100"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image", "remote": {"account": {"id": "aa2432b1fa4d4ace891e9b80fc104e34", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "memory": 8, "metadata_service": {"enabled": false, "protocol": "http", "response_hop_limit": 1}, "name": "my-instance", "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}], "numa_count": 2, "placement_target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-host-group", "resource_type": "dedicated_host_group"}, "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "instance", "startable": false, "status": "deleting", "status_reasons": [{"code": "cannot_start_storage", "message": "The virtual server instance is unusable because the encryption key for the boot volume\nhas been deleted", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "total_network_bandwidth": 500, "total_volume_bandwidth": 500, "vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "volume_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
+ mock_response = '{"availability_policy": {"host_failure": "restart"}, "bandwidth": 1000, "boot_volume_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}, "catalog_offering": {"version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "dedicated_host": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-host", "resource_type": "dedicated_host"}, "disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "nvme", "name": "my-instance-disk", "resource_type": "instance_disk", "size": 100}], "gpu": {"count": 1, "manufacturer": "nvidia", "memory": 1, "model": "Tesla V100"}, "health_reasons": [{"code": "reservation_expired", "message": "The reservation cannot be used because it has expired.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-virtual-server-health-status-reasons"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image", "remote": {"account": {"id": "aa2432b1fa4d4ace891e9b80fc104e34", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "memory": 8, "metadata_service": {"enabled": false, "protocol": "http", "response_hop_limit": 1}, "name": "my-instance", "network_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/5dd61d72-acaa-47c2-a336-3d849660d010/network_attachments/0767-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0767-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-attachment", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "instance_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}], "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}], "numa_count": 2, "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_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/5dd61d72-acaa-47c2-a336-3d849660d010/network_attachments/0767-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0767-d54eb633-98ea-459d-aa00-6a8e780175a7", "name": "my-instance-network-attachment", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "instance_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}, "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}, "reservation": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::reservation:7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/reservations/7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "id": "7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "name": "my-reservation", "resource_type": "reservation"}, "reservation_affinity": {"policy": "disabled", "pool": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::reservation:7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/reservations/7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "id": "7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "name": "my-reservation", "resource_type": "reservation"}]}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "instance", "startable": false, "status": "deleting", "status_reasons": [{"code": "cannot_start_storage", "message": "The virtual server instance is unusable because the encryption key for the boot volume\nhas been deleted", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "total_network_bandwidth": 500, "total_volume_bandwidth": 500, "vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "volume_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
responses.add(
responses.PATCH,
url,
@@ -10018,6 +10428,15 @@ def test_update_instance_value_error(self):
instance_patch_profile_model = {}
instance_patch_profile_model['name'] = 'bx2-4x16'
+ # Construct a dict representation of a ReservationIdentityById model
+ reservation_identity_model = {}
+ reservation_identity_model['id'] = '7187-ba49df72-37b8-43ac-98da-f8e029de0e63'
+
+ # Construct a dict representation of a InstanceReservationAffinityPatch model
+ instance_reservation_affinity_patch_model = {}
+ instance_reservation_affinity_patch_model['policy'] = 'disabled'
+ instance_reservation_affinity_patch_model['pool'] = [reservation_identity_model]
+
# Construct a dict representation of a InstancePatch model
instance_patch_model = {}
instance_patch_model['availability_policy'] = instance_availability_policy_patch_model
@@ -10025,6 +10444,7 @@ def test_update_instance_value_error(self):
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['reservation_affinity'] = instance_reservation_affinity_patch_model
instance_patch_model['total_volume_bandwidth'] = 500
# Set up parameter values
@@ -10582,6 +11002,515 @@ def test_update_instance_disk_value_error_with_retries(self):
self.test_update_instance_disk_value_error()
+class TestListInstanceNetworkAttachments:
+ """
+ Test Class for list_instance_network_attachments
+ """
+
+ @responses.activate
+ def test_list_instance_network_attachments_all_params(self):
+ """
+ list_instance_network_attachments()
+ """
+ # Set up mock
+ url = preprocess_url('/instances/testString/network_attachments')
+ mock_response = '{"network_attachments": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/5dd61d72-acaa-47c2-a336-3d849660d010/network_attachments/0767-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0767-d54eb633-98ea-459d-aa00-6a8e780175a7", "lifecycle_state": "stable", "name": "my-instance-network-attachment", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "instance_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary", "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "id": "0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}}]}'
+ responses.add(
+ responses.GET,
+ url,
+ body=mock_response,
+ content_type='application/json',
+ status=200,
+ )
+
+ # Set up parameter values
+ instance_id = 'testString'
+
+ # Invoke method
+ response = _service.list_instance_network_attachments(
+ instance_id,
+ headers={},
+ )
+
+ # Check for correct operation
+ assert len(responses.calls) == 1
+ assert response.status_code == 200
+
+ def test_list_instance_network_attachments_all_params_with_retries(self):
+ # Enable retries and run test_list_instance_network_attachments_all_params.
+ _service.enable_retries()
+ self.test_list_instance_network_attachments_all_params()
+
+ # Disable retries and run test_list_instance_network_attachments_all_params.
+ _service.disable_retries()
+ self.test_list_instance_network_attachments_all_params()
+
+ @responses.activate
+ def test_list_instance_network_attachments_value_error(self):
+ """
+ test_list_instance_network_attachments_value_error()
+ """
+ # Set up mock
+ url = preprocess_url('/instances/testString/network_attachments')
+ mock_response = '{"network_attachments": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/5dd61d72-acaa-47c2-a336-3d849660d010/network_attachments/0767-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0767-d54eb633-98ea-459d-aa00-6a8e780175a7", "lifecycle_state": "stable", "name": "my-instance-network-attachment", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "instance_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary", "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "id": "0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}}]}'
+ responses.add(
+ responses.GET,
+ url,
+ body=mock_response,
+ content_type='application/json',
+ status=200,
+ )
+
+ # Set up parameter values
+ instance_id = 'testString'
+
+ # Pass in all but one required param and check for a ValueError
+ req_param_dict = {
+ "instance_id": instance_id,
+ }
+ for param in req_param_dict.keys():
+ req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()}
+ with pytest.raises(ValueError):
+ _service.list_instance_network_attachments(**req_copy)
+
+ def test_list_instance_network_attachments_value_error_with_retries(self):
+ # Enable retries and run test_list_instance_network_attachments_value_error.
+ _service.enable_retries()
+ self.test_list_instance_network_attachments_value_error()
+
+ # Disable retries and run test_list_instance_network_attachments_value_error.
+ _service.disable_retries()
+ self.test_list_instance_network_attachments_value_error()
+
+
+class TestCreateInstanceNetworkAttachment:
+ """
+ Test Class for create_instance_network_attachment
+ """
+
+ @responses.activate
+ def test_create_instance_network_attachment_all_params(self):
+ """
+ create_instance_network_attachment()
+ """
+ # Set up mock
+ url = preprocess_url('/instances/testString/network_attachments')
+ mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/5dd61d72-acaa-47c2-a336-3d849660d010/network_attachments/0767-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0767-d54eb633-98ea-459d-aa00-6a8e780175a7", "lifecycle_state": "stable", "name": "my-instance-network-attachment", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "instance_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary", "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "id": "0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}}'
+ responses.add(
+ responses.POST,
+ url,
+ body=mock_response,
+ content_type='application/json',
+ status=201,
+ )
+
+ # Construct a dict representation of a VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext model
+ virtual_network_interface_ip_prototype_model = {}
+ virtual_network_interface_ip_prototype_model['address'] = '10.0.0.5'
+ virtual_network_interface_ip_prototype_model['auto_delete'] = False
+ virtual_network_interface_ip_prototype_model['name'] = 'my-reserved-ip'
+
+ # Construct a dict representation of a VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext model
+ virtual_network_interface_primary_ip_prototype_model = {}
+ virtual_network_interface_primary_ip_prototype_model['address'] = '10.0.0.7'
+ virtual_network_interface_primary_ip_prototype_model['auto_delete'] = False
+ virtual_network_interface_primary_ip_prototype_model['name'] = 'my-reserved-ip'
+
+ # Construct a dict representation of a ResourceGroupIdentityById model
+ resource_group_identity_model = {}
+ resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
+
+ # Construct a dict representation of a SecurityGroupIdentityById model
+ security_group_identity_model = {}
+ security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271'
+
+ # Construct a dict representation of a SubnetIdentityById model
+ subnet_identity_model = {}
+ subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
+
+ # Construct a dict representation of a InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeInstanceNetworkAttachmentContext model
+ instance_network_attachment_prototype_virtual_network_interface_model = {}
+ instance_network_attachment_prototype_virtual_network_interface_model['allow_ip_spoofing'] = True
+ instance_network_attachment_prototype_virtual_network_interface_model['auto_delete'] = False
+ instance_network_attachment_prototype_virtual_network_interface_model['enable_infrastructure_nat'] = True
+ instance_network_attachment_prototype_virtual_network_interface_model['ips'] = [virtual_network_interface_ip_prototype_model]
+ instance_network_attachment_prototype_virtual_network_interface_model['name'] = 'my-virtual-network-interface'
+ instance_network_attachment_prototype_virtual_network_interface_model['primary_ip'] = virtual_network_interface_primary_ip_prototype_model
+ instance_network_attachment_prototype_virtual_network_interface_model['resource_group'] = resource_group_identity_model
+ instance_network_attachment_prototype_virtual_network_interface_model['security_groups'] = [security_group_identity_model]
+ instance_network_attachment_prototype_virtual_network_interface_model['subnet'] = subnet_identity_model
+
+ # Set up parameter values
+ instance_id = 'testString'
+ virtual_network_interface = instance_network_attachment_prototype_virtual_network_interface_model
+ name = 'testString'
+
+ # Invoke method
+ response = _service.create_instance_network_attachment(
+ instance_id,
+ virtual_network_interface,
+ name=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['virtual_network_interface'] == instance_network_attachment_prototype_virtual_network_interface_model
+ assert req_body['name'] == 'testString'
+
+ def test_create_instance_network_attachment_all_params_with_retries(self):
+ # Enable retries and run test_create_instance_network_attachment_all_params.
+ _service.enable_retries()
+ self.test_create_instance_network_attachment_all_params()
+
+ # Disable retries and run test_create_instance_network_attachment_all_params.
+ _service.disable_retries()
+ self.test_create_instance_network_attachment_all_params()
+
+ @responses.activate
+ def test_create_instance_network_attachment_value_error(self):
+ """
+ test_create_instance_network_attachment_value_error()
+ """
+ # Set up mock
+ url = preprocess_url('/instances/testString/network_attachments')
+ mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/5dd61d72-acaa-47c2-a336-3d849660d010/network_attachments/0767-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0767-d54eb633-98ea-459d-aa00-6a8e780175a7", "lifecycle_state": "stable", "name": "my-instance-network-attachment", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "instance_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary", "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "id": "0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}}'
+ responses.add(
+ responses.POST,
+ url,
+ body=mock_response,
+ content_type='application/json',
+ status=201,
+ )
+
+ # Construct a dict representation of a VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext model
+ virtual_network_interface_ip_prototype_model = {}
+ virtual_network_interface_ip_prototype_model['address'] = '10.0.0.5'
+ virtual_network_interface_ip_prototype_model['auto_delete'] = False
+ virtual_network_interface_ip_prototype_model['name'] = 'my-reserved-ip'
+
+ # Construct a dict representation of a VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext model
+ virtual_network_interface_primary_ip_prototype_model = {}
+ virtual_network_interface_primary_ip_prototype_model['address'] = '10.0.0.7'
+ virtual_network_interface_primary_ip_prototype_model['auto_delete'] = False
+ virtual_network_interface_primary_ip_prototype_model['name'] = 'my-reserved-ip'
+
+ # Construct a dict representation of a ResourceGroupIdentityById model
+ resource_group_identity_model = {}
+ resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
+
+ # Construct a dict representation of a SecurityGroupIdentityById model
+ security_group_identity_model = {}
+ security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271'
+
+ # Construct a dict representation of a SubnetIdentityById model
+ subnet_identity_model = {}
+ subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
+
+ # Construct a dict representation of a InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeInstanceNetworkAttachmentContext model
+ instance_network_attachment_prototype_virtual_network_interface_model = {}
+ instance_network_attachment_prototype_virtual_network_interface_model['allow_ip_spoofing'] = True
+ instance_network_attachment_prototype_virtual_network_interface_model['auto_delete'] = False
+ instance_network_attachment_prototype_virtual_network_interface_model['enable_infrastructure_nat'] = True
+ instance_network_attachment_prototype_virtual_network_interface_model['ips'] = [virtual_network_interface_ip_prototype_model]
+ instance_network_attachment_prototype_virtual_network_interface_model['name'] = 'my-virtual-network-interface'
+ instance_network_attachment_prototype_virtual_network_interface_model['primary_ip'] = virtual_network_interface_primary_ip_prototype_model
+ instance_network_attachment_prototype_virtual_network_interface_model['resource_group'] = resource_group_identity_model
+ instance_network_attachment_prototype_virtual_network_interface_model['security_groups'] = [security_group_identity_model]
+ instance_network_attachment_prototype_virtual_network_interface_model['subnet'] = subnet_identity_model
+
+ # Set up parameter values
+ instance_id = 'testString'
+ virtual_network_interface = instance_network_attachment_prototype_virtual_network_interface_model
+ name = 'testString'
+
+ # Pass in all but one required param and check for a ValueError
+ req_param_dict = {
+ "instance_id": instance_id,
+ "virtual_network_interface": virtual_network_interface,
+ }
+ 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_instance_network_attachment(**req_copy)
+
+ def test_create_instance_network_attachment_value_error_with_retries(self):
+ # Enable retries and run test_create_instance_network_attachment_value_error.
+ _service.enable_retries()
+ self.test_create_instance_network_attachment_value_error()
+
+ # Disable retries and run test_create_instance_network_attachment_value_error.
+ _service.disable_retries()
+ self.test_create_instance_network_attachment_value_error()
+
+
+class TestDeleteInstanceNetworkAttachment:
+ """
+ Test Class for delete_instance_network_attachment
+ """
+
+ @responses.activate
+ def test_delete_instance_network_attachment_all_params(self):
+ """
+ delete_instance_network_attachment()
+ """
+ # Set up mock
+ url = preprocess_url('/instances/testString/network_attachments/testString')
+ responses.add(
+ responses.DELETE,
+ url,
+ status=202,
+ )
+
+ # Set up parameter values
+ instance_id = 'testString'
+ id = 'testString'
+
+ # Invoke method
+ response = _service.delete_instance_network_attachment(
+ instance_id,
+ id,
+ headers={},
+ )
+
+ # Check for correct operation
+ assert len(responses.calls) == 1
+ assert response.status_code == 202
+
+ def test_delete_instance_network_attachment_all_params_with_retries(self):
+ # Enable retries and run test_delete_instance_network_attachment_all_params.
+ _service.enable_retries()
+ self.test_delete_instance_network_attachment_all_params()
+
+ # Disable retries and run test_delete_instance_network_attachment_all_params.
+ _service.disable_retries()
+ self.test_delete_instance_network_attachment_all_params()
+
+ @responses.activate
+ def test_delete_instance_network_attachment_value_error(self):
+ """
+ test_delete_instance_network_attachment_value_error()
+ """
+ # Set up mock
+ url = preprocess_url('/instances/testString/network_attachments/testString')
+ responses.add(
+ responses.DELETE,
+ url,
+ status=202,
+ )
+
+ # Set up parameter values
+ instance_id = 'testString'
+ id = 'testString'
+
+ # Pass in all but one required param and check for a ValueError
+ req_param_dict = {
+ "instance_id": instance_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_instance_network_attachment(**req_copy)
+
+ def test_delete_instance_network_attachment_value_error_with_retries(self):
+ # Enable retries and run test_delete_instance_network_attachment_value_error.
+ _service.enable_retries()
+ self.test_delete_instance_network_attachment_value_error()
+
+ # Disable retries and run test_delete_instance_network_attachment_value_error.
+ _service.disable_retries()
+ self.test_delete_instance_network_attachment_value_error()
+
+
+class TestGetInstanceNetworkAttachment:
+ """
+ Test Class for get_instance_network_attachment
+ """
+
+ @responses.activate
+ def test_get_instance_network_attachment_all_params(self):
+ """
+ get_instance_network_attachment()
+ """
+ # Set up mock
+ url = preprocess_url('/instances/testString/network_attachments/testString')
+ mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/5dd61d72-acaa-47c2-a336-3d849660d010/network_attachments/0767-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0767-d54eb633-98ea-459d-aa00-6a8e780175a7", "lifecycle_state": "stable", "name": "my-instance-network-attachment", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "instance_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary", "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "id": "0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}}'
+ responses.add(
+ responses.GET,
+ url,
+ body=mock_response,
+ content_type='application/json',
+ status=200,
+ )
+
+ # Set up parameter values
+ instance_id = 'testString'
+ id = 'testString'
+
+ # Invoke method
+ response = _service.get_instance_network_attachment(
+ instance_id,
+ id,
+ headers={},
+ )
+
+ # Check for correct operation
+ assert len(responses.calls) == 1
+ assert response.status_code == 200
+
+ def test_get_instance_network_attachment_all_params_with_retries(self):
+ # Enable retries and run test_get_instance_network_attachment_all_params.
+ _service.enable_retries()
+ self.test_get_instance_network_attachment_all_params()
+
+ # Disable retries and run test_get_instance_network_attachment_all_params.
+ _service.disable_retries()
+ self.test_get_instance_network_attachment_all_params()
+
+ @responses.activate
+ def test_get_instance_network_attachment_value_error(self):
+ """
+ test_get_instance_network_attachment_value_error()
+ """
+ # Set up mock
+ url = preprocess_url('/instances/testString/network_attachments/testString')
+ mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/5dd61d72-acaa-47c2-a336-3d849660d010/network_attachments/0767-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0767-d54eb633-98ea-459d-aa00-6a8e780175a7", "lifecycle_state": "stable", "name": "my-instance-network-attachment", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "instance_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary", "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "id": "0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}}'
+ responses.add(
+ responses.GET,
+ url,
+ body=mock_response,
+ content_type='application/json',
+ status=200,
+ )
+
+ # Set up parameter values
+ instance_id = 'testString'
+ id = 'testString'
+
+ # Pass in all but one required param and check for a ValueError
+ req_param_dict = {
+ "instance_id": instance_id,
+ "id": id,
+ }
+ for param in req_param_dict.keys():
+ req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()}
+ with pytest.raises(ValueError):
+ _service.get_instance_network_attachment(**req_copy)
+
+ def test_get_instance_network_attachment_value_error_with_retries(self):
+ # Enable retries and run test_get_instance_network_attachment_value_error.
+ _service.enable_retries()
+ self.test_get_instance_network_attachment_value_error()
+
+ # Disable retries and run test_get_instance_network_attachment_value_error.
+ _service.disable_retries()
+ self.test_get_instance_network_attachment_value_error()
+
+
+class TestUpdateInstanceNetworkAttachment:
+ """
+ Test Class for update_instance_network_attachment
+ """
+
+ @responses.activate
+ def test_update_instance_network_attachment_all_params(self):
+ """
+ update_instance_network_attachment()
+ """
+ # Set up mock
+ url = preprocess_url('/instances/testString/network_attachments/testString')
+ mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/5dd61d72-acaa-47c2-a336-3d849660d010/network_attachments/0767-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0767-d54eb633-98ea-459d-aa00-6a8e780175a7", "lifecycle_state": "stable", "name": "my-instance-network-attachment", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "instance_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary", "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "id": "0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}}'
+ responses.add(
+ responses.PATCH,
+ url,
+ body=mock_response,
+ content_type='application/json',
+ status=200,
+ )
+
+ # Construct a dict representation of a InstanceNetworkAttachmentPatch model
+ instance_network_attachment_patch_model = {}
+ instance_network_attachment_patch_model['name'] = 'my-instance-network-attachment-updated'
+
+ # Set up parameter values
+ instance_id = 'testString'
+ id = 'testString'
+ instance_network_attachment_patch = instance_network_attachment_patch_model
+
+ # Invoke method
+ response = _service.update_instance_network_attachment(
+ instance_id,
+ id,
+ instance_network_attachment_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 == instance_network_attachment_patch
+
+ def test_update_instance_network_attachment_all_params_with_retries(self):
+ # Enable retries and run test_update_instance_network_attachment_all_params.
+ _service.enable_retries()
+ self.test_update_instance_network_attachment_all_params()
+
+ # Disable retries and run test_update_instance_network_attachment_all_params.
+ _service.disable_retries()
+ self.test_update_instance_network_attachment_all_params()
+
+ @responses.activate
+ def test_update_instance_network_attachment_value_error(self):
+ """
+ test_update_instance_network_attachment_value_error()
+ """
+ # Set up mock
+ url = preprocess_url('/instances/testString/network_attachments/testString')
+ mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/5dd61d72-acaa-47c2-a336-3d849660d010/network_attachments/0767-d54eb633-98ea-459d-aa00-6a8e780175a7", "id": "0767-d54eb633-98ea-459d-aa00-6a8e780175a7", "lifecycle_state": "stable", "name": "my-instance-network-attachment", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "instance_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary", "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "id": "0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}}'
+ responses.add(
+ responses.PATCH,
+ url,
+ body=mock_response,
+ content_type='application/json',
+ status=200,
+ )
+
+ # Construct a dict representation of a InstanceNetworkAttachmentPatch model
+ instance_network_attachment_patch_model = {}
+ instance_network_attachment_patch_model['name'] = 'my-instance-network-attachment-updated'
+
+ # Set up parameter values
+ instance_id = 'testString'
+ id = 'testString'
+ instance_network_attachment_patch = instance_network_attachment_patch_model
+
+ # Pass in all but one required param and check for a ValueError
+ req_param_dict = {
+ "instance_id": instance_id,
+ "id": id,
+ "instance_network_attachment_patch": instance_network_attachment_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_instance_network_attachment(**req_copy)
+
+ def test_update_instance_network_attachment_value_error_with_retries(self):
+ # Enable retries and run test_update_instance_network_attachment_value_error.
+ _service.enable_retries()
+ self.test_update_instance_network_attachment_value_error()
+
+ # Disable retries and run test_update_instance_network_attachment_value_error.
+ _service.disable_retries()
+ self.test_update_instance_network_attachment_value_error()
+
+
class TestListInstanceNetworkInterfaces:
"""
Test Class for list_instance_network_interfaces
@@ -15259,7 +16188,7 @@ def test_update_instance_group_membership_value_error_with_retries(self):
##############################################################################
##############################################################################
-# Start of Service: DedicatedHosts
+# Start of Service: Reservations
##############################################################################
# region
@@ -15310,19 +16239,19 @@ def test_new_instance_required_param_none(self):
)
-class TestListDedicatedHostGroups:
+class TestListReservations:
"""
- Test Class for list_dedicated_host_groups
+ Test Class for list_reservations
"""
@responses.activate
- def test_list_dedicated_host_groups_all_params(self):
+ def test_list_reservations_all_params(self):
"""
- list_dedicated_host_groups()
+ list_reservations()
"""
# Set up mock
- url = preprocess_url('/dedicated_host/groups')
- mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups?limit=20"}, "groups": [{"class": "mx2", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "dedicated_hosts": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-host", "resource_type": "dedicated_host"}], "family": "balanced", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-host-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "dedicated_host_group", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}'
+ url = preprocess_url('/reservations')
+ mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/reservations?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/reservations?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "reservations": [{"affinity_policy": "restricted", "capacity": {"allocated": 10, "available": 2, "status": "allocated", "total": 10, "used": 8}, "committed_use": {"expiration_at": "2019-01-01T12:00:00.000Z", "expiration_policy": "release", "term": "term"}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::reservation:7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "href": "https://us-south.iaas.cloud.ibm.com/v1/reservations/7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "id": "7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "lifecycle_state": "stable", "name": "my-reservation", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "reservation", "status": "activating", "status_reasons": [{"code": "cannot_activate_no_capacity_available", "message": "The reservation cannot be activated because capacity is unavailable", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-reserved-capacity-status-reasons"}], "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,
@@ -15334,17 +16263,17 @@ def test_list_dedicated_host_groups_all_params(self):
# Set up parameter values
start = 'testString'
limit = 50
+ name = 'testString'
resource_group_id = 'testString'
zone_name = 'us-south-1'
- name = 'testString'
# Invoke method
- response = _service.list_dedicated_host_groups(
+ response = _service.list_reservations(
start=start,
limit=limit,
+ name=name,
resource_group_id=resource_group_id,
zone_name=zone_name,
- name=name,
headers={},
)
@@ -15356,27 +16285,27 @@ def test_list_dedicated_host_groups_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 'name={}'.format(name) in query_string
assert 'resource_group.id={}'.format(resource_group_id) in query_string
assert 'zone.name={}'.format(zone_name) in query_string
- assert 'name={}'.format(name) in query_string
- def test_list_dedicated_host_groups_all_params_with_retries(self):
- # Enable retries and run test_list_dedicated_host_groups_all_params.
+ def test_list_reservations_all_params_with_retries(self):
+ # Enable retries and run test_list_reservations_all_params.
_service.enable_retries()
- self.test_list_dedicated_host_groups_all_params()
+ self.test_list_reservations_all_params()
- # Disable retries and run test_list_dedicated_host_groups_all_params.
+ # Disable retries and run test_list_reservations_all_params.
_service.disable_retries()
- self.test_list_dedicated_host_groups_all_params()
+ self.test_list_reservations_all_params()
@responses.activate
- def test_list_dedicated_host_groups_required_params(self):
+ def test_list_reservations_required_params(self):
"""
- test_list_dedicated_host_groups_required_params()
+ test_list_reservations_required_params()
"""
# Set up mock
- url = preprocess_url('/dedicated_host/groups')
- mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups?limit=20"}, "groups": [{"class": "mx2", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "dedicated_hosts": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-host", "resource_type": "dedicated_host"}], "family": "balanced", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-host-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "dedicated_host_group", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}'
+ url = preprocess_url('/reservations')
+ mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/reservations?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/reservations?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "reservations": [{"affinity_policy": "restricted", "capacity": {"allocated": 10, "available": 2, "status": "allocated", "total": 10, "used": 8}, "committed_use": {"expiration_at": "2019-01-01T12:00:00.000Z", "expiration_policy": "release", "term": "term"}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::reservation:7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "href": "https://us-south.iaas.cloud.ibm.com/v1/reservations/7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "id": "7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "lifecycle_state": "stable", "name": "my-reservation", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "reservation", "status": "activating", "status_reasons": [{"code": "cannot_activate_no_capacity_available", "message": "The reservation cannot be activated because capacity is unavailable", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-reserved-capacity-status-reasons"}], "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,
@@ -15386,29 +16315,29 @@ def test_list_dedicated_host_groups_required_params(self):
)
# Invoke method
- response = _service.list_dedicated_host_groups()
+ response = _service.list_reservations()
# Check for correct operation
assert len(responses.calls) == 1
assert response.status_code == 200
- def test_list_dedicated_host_groups_required_params_with_retries(self):
- # Enable retries and run test_list_dedicated_host_groups_required_params.
+ def test_list_reservations_required_params_with_retries(self):
+ # Enable retries and run test_list_reservations_required_params.
_service.enable_retries()
- self.test_list_dedicated_host_groups_required_params()
+ self.test_list_reservations_required_params()
- # Disable retries and run test_list_dedicated_host_groups_required_params.
+ # Disable retries and run test_list_reservations_required_params.
_service.disable_retries()
- self.test_list_dedicated_host_groups_required_params()
+ self.test_list_reservations_required_params()
@responses.activate
- def test_list_dedicated_host_groups_value_error(self):
+ def test_list_reservations_value_error(self):
"""
- test_list_dedicated_host_groups_value_error()
+ test_list_reservations_value_error()
"""
# Set up mock
- url = preprocess_url('/dedicated_host/groups')
- mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups?limit=20"}, "groups": [{"class": "mx2", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "dedicated_hosts": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-host", "resource_type": "dedicated_host"}], "family": "balanced", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-host-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "dedicated_host_group", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}'
+ url = preprocess_url('/reservations')
+ mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/reservations?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/reservations?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "reservations": [{"affinity_policy": "restricted", "capacity": {"allocated": 10, "available": 2, "status": "allocated", "total": 10, "used": 8}, "committed_use": {"expiration_at": "2019-01-01T12:00:00.000Z", "expiration_policy": "release", "term": "term"}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::reservation:7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "href": "https://us-south.iaas.cloud.ibm.com/v1/reservations/7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "id": "7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "lifecycle_state": "stable", "name": "my-reservation", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "reservation", "status": "activating", "status_reasons": [{"code": "cannot_activate_no_capacity_available", "message": "The reservation cannot be activated because capacity is unavailable", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-reserved-capacity-status-reasons"}], "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,
@@ -15423,26 +16352,26 @@ def test_list_dedicated_host_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_dedicated_host_groups(**req_copy)
+ _service.list_reservations(**req_copy)
- def test_list_dedicated_host_groups_value_error_with_retries(self):
- # Enable retries and run test_list_dedicated_host_groups_value_error.
+ def test_list_reservations_value_error_with_retries(self):
+ # Enable retries and run test_list_reservations_value_error.
_service.enable_retries()
- self.test_list_dedicated_host_groups_value_error()
+ self.test_list_reservations_value_error()
- # Disable retries and run test_list_dedicated_host_groups_value_error.
+ # Disable retries and run test_list_reservations_value_error.
_service.disable_retries()
- self.test_list_dedicated_host_groups_value_error()
+ self.test_list_reservations_value_error()
@responses.activate
- def test_list_dedicated_host_groups_with_pager_get_next(self):
+ def test_list_reservations_with_pager_get_next(self):
"""
- test_list_dedicated_host_groups_with_pager_get_next()
+ test_list_reservations_with_pager_get_next()
"""
# Set up a two-page mock response
- url = preprocess_url('/dedicated_host/groups')
- mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"groups":[{"class":"mx2","created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0","dedicated_hosts":[{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a","id":"1e09281b-f177-46fb-baf1-bc152b2e391a","name":"my-host","resource_type":"dedicated_host"}],"family":"balanced","href":"https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0","id":"bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0","name":"my-host-group","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"dedicated_host_group","supported_instance_profiles":[{"href":"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16","name":"bx2-4x16"}],"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}]}'
- mock_response2 = '{"total_count":2,"limit":1,"groups":[{"class":"mx2","created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0","dedicated_hosts":[{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a","id":"1e09281b-f177-46fb-baf1-bc152b2e391a","name":"my-host","resource_type":"dedicated_host"}],"family":"balanced","href":"https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0","id":"bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0","name":"my-host-group","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"dedicated_host_group","supported_instance_profiles":[{"href":"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16","name":"bx2-4x16"}],"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}]}'
+ url = preprocess_url('/reservations')
+ mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"reservations":[{"affinity_policy":"restricted","capacity":{"allocated":10,"available":2,"status":"allocated","total":10,"used":8},"committed_use":{"expiration_at":"2019-01-01T12:00:00.000Z","expiration_policy":"release","term":"term"},"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::reservation:7187-ba49df72-37b8-43ac-98da-f8e029de0e63","href":"https://us-south.iaas.cloud.ibm.com/v1/reservations/7187-ba49df72-37b8-43ac-98da-f8e029de0e63","id":"7187-ba49df72-37b8-43ac-98da-f8e029de0e63","lifecycle_state":"stable","name":"my-reservation","profile":{"href":"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16","name":"bx2-4x16","resource_type":"instance_profile"},"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"reservation","status":"activating","status_reasons":[{"code":"cannot_activate_no_capacity_available","message":"The reservation cannot be activated because capacity is unavailable","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-reserved-capacity-status-reasons"}],"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"total_count":2,"limit":1}'
+ mock_response2 = '{"reservations":[{"affinity_policy":"restricted","capacity":{"allocated":10,"available":2,"status":"allocated","total":10,"used":8},"committed_use":{"expiration_at":"2019-01-01T12:00:00.000Z","expiration_policy":"release","term":"term"},"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::reservation:7187-ba49df72-37b8-43ac-98da-f8e029de0e63","href":"https://us-south.iaas.cloud.ibm.com/v1/reservations/7187-ba49df72-37b8-43ac-98da-f8e029de0e63","id":"7187-ba49df72-37b8-43ac-98da-f8e029de0e63","lifecycle_state":"stable","name":"my-reservation","profile":{"href":"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16","name":"bx2-4x16","resource_type":"instance_profile"},"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"reservation","status":"activating","status_reasons":[{"code":"cannot_activate_no_capacity_available","message":"The reservation cannot be activated because capacity is unavailable","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-reserved-capacity-status-reasons"}],"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"total_count":2,"limit":1}'
responses.add(
responses.GET,
url,
@@ -15460,12 +16389,12 @@ def test_list_dedicated_host_groups_with_pager_get_next(self):
# Exercise the pager class for this operation
all_results = []
- pager = DedicatedHostGroupsPager(
+ pager = ReservationsPager(
client=_service,
limit=10,
+ name='testString',
resource_group_id='testString',
zone_name='us-south-1',
- name='testString',
)
while pager.has_next():
next_page = pager.get_next()
@@ -15474,14 +16403,14 @@ def test_list_dedicated_host_groups_with_pager_get_next(self):
assert len(all_results) == 2
@responses.activate
- def test_list_dedicated_host_groups_with_pager_get_all(self):
+ def test_list_reservations_with_pager_get_all(self):
"""
- test_list_dedicated_host_groups_with_pager_get_all()
+ test_list_reservations_with_pager_get_all()
"""
# Set up a two-page mock response
- url = preprocess_url('/dedicated_host/groups')
- mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"groups":[{"class":"mx2","created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0","dedicated_hosts":[{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a","id":"1e09281b-f177-46fb-baf1-bc152b2e391a","name":"my-host","resource_type":"dedicated_host"}],"family":"balanced","href":"https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0","id":"bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0","name":"my-host-group","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"dedicated_host_group","supported_instance_profiles":[{"href":"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16","name":"bx2-4x16"}],"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}]}'
- mock_response2 = '{"total_count":2,"limit":1,"groups":[{"class":"mx2","created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0","dedicated_hosts":[{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a","id":"1e09281b-f177-46fb-baf1-bc152b2e391a","name":"my-host","resource_type":"dedicated_host"}],"family":"balanced","href":"https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0","id":"bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0","name":"my-host-group","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"dedicated_host_group","supported_instance_profiles":[{"href":"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16","name":"bx2-4x16"}],"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}]}'
+ url = preprocess_url('/reservations')
+ mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"reservations":[{"affinity_policy":"restricted","capacity":{"allocated":10,"available":2,"status":"allocated","total":10,"used":8},"committed_use":{"expiration_at":"2019-01-01T12:00:00.000Z","expiration_policy":"release","term":"term"},"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::reservation:7187-ba49df72-37b8-43ac-98da-f8e029de0e63","href":"https://us-south.iaas.cloud.ibm.com/v1/reservations/7187-ba49df72-37b8-43ac-98da-f8e029de0e63","id":"7187-ba49df72-37b8-43ac-98da-f8e029de0e63","lifecycle_state":"stable","name":"my-reservation","profile":{"href":"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16","name":"bx2-4x16","resource_type":"instance_profile"},"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"reservation","status":"activating","status_reasons":[{"code":"cannot_activate_no_capacity_available","message":"The reservation cannot be activated because capacity is unavailable","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-reserved-capacity-status-reasons"}],"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"total_count":2,"limit":1}'
+ mock_response2 = '{"reservations":[{"affinity_policy":"restricted","capacity":{"allocated":10,"available":2,"status":"allocated","total":10,"used":8},"committed_use":{"expiration_at":"2019-01-01T12:00:00.000Z","expiration_policy":"release","term":"term"},"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::reservation:7187-ba49df72-37b8-43ac-98da-f8e029de0e63","href":"https://us-south.iaas.cloud.ibm.com/v1/reservations/7187-ba49df72-37b8-43ac-98da-f8e029de0e63","id":"7187-ba49df72-37b8-43ac-98da-f8e029de0e63","lifecycle_state":"stable","name":"my-reservation","profile":{"href":"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16","name":"bx2-4x16","resource_type":"instance_profile"},"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"reservation","status":"activating","status_reasons":[{"code":"cannot_activate_no_capacity_available","message":"The reservation cannot be activated because capacity is unavailable","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-reserved-capacity-status-reasons"}],"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"total_count":2,"limit":1}'
responses.add(
responses.GET,
url,
@@ -15498,31 +16427,31 @@ def test_list_dedicated_host_groups_with_pager_get_all(self):
)
# Exercise the pager class for this operation
- pager = DedicatedHostGroupsPager(
+ pager = ReservationsPager(
client=_service,
limit=10,
+ name='testString',
resource_group_id='testString',
zone_name='us-south-1',
- name='testString',
)
all_results = pager.get_all()
assert all_results is not None
assert len(all_results) == 2
-class TestCreateDedicatedHostGroup:
+class TestCreateReservation:
"""
- Test Class for create_dedicated_host_group
+ Test Class for create_reservation
"""
@responses.activate
- def test_create_dedicated_host_group_all_params(self):
+ def test_create_reservation_all_params(self):
"""
- create_dedicated_host_group()
+ create_reservation()
"""
# Set up mock
- url = preprocess_url('/dedicated_host/groups')
- mock_response = '{"class": "mx2", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "dedicated_hosts": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-host", "resource_type": "dedicated_host"}], "family": "balanced", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-host-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "dedicated_host_group", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
+ url = preprocess_url('/reservations')
+ mock_response = '{"affinity_policy": "restricted", "capacity": {"allocated": 10, "available": 2, "status": "allocated", "total": 10, "used": 8}, "committed_use": {"expiration_at": "2019-01-01T12:00:00.000Z", "expiration_policy": "release", "term": "term"}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::reservation:7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "href": "https://us-south.iaas.cloud.ibm.com/v1/reservations/7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "id": "7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "lifecycle_state": "stable", "name": "my-reservation", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "reservation", "status": "activating", "status_reasons": [{"code": "cannot_activate_no_capacity_available", "message": "The reservation cannot be activated because capacity is unavailable", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-reserved-capacity-status-reasons"}], "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,
@@ -15531,6 +16460,20 @@ def test_create_dedicated_host_group_all_params(self):
status=201,
)
+ # Construct a dict representation of a ReservationCapacityPrototype model
+ reservation_capacity_prototype_model = {}
+ reservation_capacity_prototype_model['total'] = 10
+
+ # Construct a dict representation of a ReservationCommittedUsePrototype model
+ reservation_committed_use_prototype_model = {}
+ reservation_committed_use_prototype_model['expiration_policy'] = 'release'
+ reservation_committed_use_prototype_model['term'] = 'testString'
+
+ # Construct a dict representation of a ReservationProfilePrototype model
+ reservation_profile_prototype_model = {}
+ reservation_profile_prototype_model['name'] = 'bx2-4x16'
+ reservation_profile_prototype_model['resource_type'] = 'instance_profile'
+
# Construct a dict representation of a ZoneIdentityByName model
zone_identity_model = {}
zone_identity_model['name'] = 'us-south-1'
@@ -15540,17 +16483,21 @@ def test_create_dedicated_host_group_all_params(self):
resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
# Set up parameter values
- class_ = 'mx2'
- family = 'balanced'
+ capacity = reservation_capacity_prototype_model
+ committed_use = reservation_committed_use_prototype_model
+ profile = reservation_profile_prototype_model
zone = zone_identity_model
- name = 'testString'
+ affinity_policy = 'restricted'
+ name = 'my-reservation'
resource_group = resource_group_identity_model
# Invoke method
- response = _service.create_dedicated_host_group(
- class_,
- family,
+ response = _service.create_reservation(
+ capacity,
+ committed_use,
+ profile,
zone,
+ affinity_policy=affinity_policy,
name=name,
resource_group=resource_group,
headers={},
@@ -15561,29 +16508,31 @@ def test_create_dedicated_host_group_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['class'] == 'mx2'
- assert req_body['family'] == 'balanced'
+ assert req_body['capacity'] == reservation_capacity_prototype_model
+ assert req_body['committed_use'] == reservation_committed_use_prototype_model
+ assert req_body['profile'] == reservation_profile_prototype_model
assert req_body['zone'] == zone_identity_model
- assert req_body['name'] == 'testString'
+ assert req_body['affinity_policy'] == 'restricted'
+ assert req_body['name'] == 'my-reservation'
assert req_body['resource_group'] == resource_group_identity_model
- def test_create_dedicated_host_group_all_params_with_retries(self):
- # Enable retries and run test_create_dedicated_host_group_all_params.
+ def test_create_reservation_all_params_with_retries(self):
+ # Enable retries and run test_create_reservation_all_params.
_service.enable_retries()
- self.test_create_dedicated_host_group_all_params()
+ self.test_create_reservation_all_params()
- # Disable retries and run test_create_dedicated_host_group_all_params.
+ # Disable retries and run test_create_reservation_all_params.
_service.disable_retries()
- self.test_create_dedicated_host_group_all_params()
+ self.test_create_reservation_all_params()
@responses.activate
- def test_create_dedicated_host_group_value_error(self):
+ def test_create_reservation_value_error(self):
"""
- test_create_dedicated_host_group_value_error()
+ test_create_reservation_value_error()
"""
# Set up mock
- url = preprocess_url('/dedicated_host/groups')
- mock_response = '{"class": "mx2", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "dedicated_hosts": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-host", "resource_type": "dedicated_host"}], "family": "balanced", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-host-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "dedicated_host_group", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
+ url = preprocess_url('/reservations')
+ mock_response = '{"affinity_policy": "restricted", "capacity": {"allocated": 10, "available": 2, "status": "allocated", "total": 10, "used": 8}, "committed_use": {"expiration_at": "2019-01-01T12:00:00.000Z", "expiration_policy": "release", "term": "term"}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::reservation:7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "href": "https://us-south.iaas.cloud.ibm.com/v1/reservations/7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "id": "7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "lifecycle_state": "stable", "name": "my-reservation", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "reservation", "status": "activating", "status_reasons": [{"code": "cannot_activate_no_capacity_available", "message": "The reservation cannot be activated because capacity is unavailable", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-reserved-capacity-status-reasons"}], "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,
@@ -15592,6 +16541,20 @@ def test_create_dedicated_host_group_value_error(self):
status=201,
)
+ # Construct a dict representation of a ReservationCapacityPrototype model
+ reservation_capacity_prototype_model = {}
+ reservation_capacity_prototype_model['total'] = 10
+
+ # Construct a dict representation of a ReservationCommittedUsePrototype model
+ reservation_committed_use_prototype_model = {}
+ reservation_committed_use_prototype_model['expiration_policy'] = 'release'
+ reservation_committed_use_prototype_model['term'] = 'testString'
+
+ # Construct a dict representation of a ReservationProfilePrototype model
+ reservation_profile_prototype_model = {}
+ reservation_profile_prototype_model['name'] = 'bx2-4x16'
+ reservation_profile_prototype_model['resource_type'] = 'instance_profile'
+
# Construct a dict representation of a ZoneIdentityByName model
zone_identity_model = {}
zone_identity_model['name'] = 'us-south-1'
@@ -15601,84 +16564,93 @@ def test_create_dedicated_host_group_value_error(self):
resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
# Set up parameter values
- class_ = 'mx2'
- family = 'balanced'
+ capacity = reservation_capacity_prototype_model
+ committed_use = reservation_committed_use_prototype_model
+ profile = reservation_profile_prototype_model
zone = zone_identity_model
- name = 'testString'
+ affinity_policy = 'restricted'
+ name = 'my-reservation'
resource_group = resource_group_identity_model
# Pass in all but one required param and check for a ValueError
req_param_dict = {
- "class_": class_,
- "family": family,
+ "capacity": capacity,
+ "committed_use": committed_use,
+ "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_dedicated_host_group(**req_copy)
+ _service.create_reservation(**req_copy)
- def test_create_dedicated_host_group_value_error_with_retries(self):
- # Enable retries and run test_create_dedicated_host_group_value_error.
+ def test_create_reservation_value_error_with_retries(self):
+ # Enable retries and run test_create_reservation_value_error.
_service.enable_retries()
- self.test_create_dedicated_host_group_value_error()
+ self.test_create_reservation_value_error()
- # Disable retries and run test_create_dedicated_host_group_value_error.
+ # Disable retries and run test_create_reservation_value_error.
_service.disable_retries()
- self.test_create_dedicated_host_group_value_error()
+ self.test_create_reservation_value_error()
-class TestDeleteDedicatedHostGroup:
+class TestDeleteReservation:
"""
- Test Class for delete_dedicated_host_group
+ Test Class for delete_reservation
"""
@responses.activate
- def test_delete_dedicated_host_group_all_params(self):
+ def test_delete_reservation_all_params(self):
"""
- delete_dedicated_host_group()
+ delete_reservation()
"""
# Set up mock
- url = preprocess_url('/dedicated_host/groups/testString')
+ url = preprocess_url('/reservations/testString')
+ mock_response = '{"affinity_policy": "restricted", "capacity": {"allocated": 10, "available": 2, "status": "allocated", "total": 10, "used": 8}, "committed_use": {"expiration_at": "2019-01-01T12:00:00.000Z", "expiration_policy": "release", "term": "term"}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::reservation:7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "href": "https://us-south.iaas.cloud.ibm.com/v1/reservations/7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "id": "7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "lifecycle_state": "stable", "name": "my-reservation", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "reservation", "status": "activating", "status_reasons": [{"code": "cannot_activate_no_capacity_available", "message": "The reservation cannot be activated because capacity is unavailable", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-reserved-capacity-status-reasons"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
responses.add(
responses.DELETE,
url,
- status=204,
+ body=mock_response,
+ content_type='application/json',
+ status=202,
)
# Set up parameter values
id = 'testString'
# Invoke method
- response = _service.delete_dedicated_host_group(
+ response = _service.delete_reservation(
id,
headers={},
)
# Check for correct operation
assert len(responses.calls) == 1
- assert response.status_code == 204
+ assert response.status_code == 202
- def test_delete_dedicated_host_group_all_params_with_retries(self):
- # Enable retries and run test_delete_dedicated_host_group_all_params.
+ def test_delete_reservation_all_params_with_retries(self):
+ # Enable retries and run test_delete_reservation_all_params.
_service.enable_retries()
- self.test_delete_dedicated_host_group_all_params()
+ self.test_delete_reservation_all_params()
- # Disable retries and run test_delete_dedicated_host_group_all_params.
+ # Disable retries and run test_delete_reservation_all_params.
_service.disable_retries()
- self.test_delete_dedicated_host_group_all_params()
+ self.test_delete_reservation_all_params()
@responses.activate
- def test_delete_dedicated_host_group_value_error(self):
+ def test_delete_reservation_value_error(self):
"""
- test_delete_dedicated_host_group_value_error()
+ test_delete_reservation_value_error()
"""
# Set up mock
- url = preprocess_url('/dedicated_host/groups/testString')
+ url = preprocess_url('/reservations/testString')
+ mock_response = '{"affinity_policy": "restricted", "capacity": {"allocated": 10, "available": 2, "status": "allocated", "total": 10, "used": 8}, "committed_use": {"expiration_at": "2019-01-01T12:00:00.000Z", "expiration_policy": "release", "term": "term"}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::reservation:7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "href": "https://us-south.iaas.cloud.ibm.com/v1/reservations/7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "id": "7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "lifecycle_state": "stable", "name": "my-reservation", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "reservation", "status": "activating", "status_reasons": [{"code": "cannot_activate_no_capacity_available", "message": "The reservation cannot be activated because capacity is unavailable", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-reserved-capacity-status-reasons"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
responses.add(
responses.DELETE,
url,
- status=204,
+ body=mock_response,
+ content_type='application/json',
+ status=202,
)
# Set up parameter values
@@ -15691,31 +16663,31 @@ def test_delete_dedicated_host_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_dedicated_host_group(**req_copy)
+ _service.delete_reservation(**req_copy)
- def test_delete_dedicated_host_group_value_error_with_retries(self):
- # Enable retries and run test_delete_dedicated_host_group_value_error.
+ def test_delete_reservation_value_error_with_retries(self):
+ # Enable retries and run test_delete_reservation_value_error.
_service.enable_retries()
- self.test_delete_dedicated_host_group_value_error()
+ self.test_delete_reservation_value_error()
- # Disable retries and run test_delete_dedicated_host_group_value_error.
+ # Disable retries and run test_delete_reservation_value_error.
_service.disable_retries()
- self.test_delete_dedicated_host_group_value_error()
+ self.test_delete_reservation_value_error()
-class TestGetDedicatedHostGroup:
+class TestGetReservation:
"""
- Test Class for get_dedicated_host_group
+ Test Class for get_reservation
"""
@responses.activate
- def test_get_dedicated_host_group_all_params(self):
+ def test_get_reservation_all_params(self):
"""
- get_dedicated_host_group()
+ get_reservation()
"""
# Set up mock
- url = preprocess_url('/dedicated_host/groups/testString')
- mock_response = '{"class": "mx2", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "dedicated_hosts": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-host", "resource_type": "dedicated_host"}], "family": "balanced", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-host-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "dedicated_host_group", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
+ url = preprocess_url('/reservations/testString')
+ mock_response = '{"affinity_policy": "restricted", "capacity": {"allocated": 10, "available": 2, "status": "allocated", "total": 10, "used": 8}, "committed_use": {"expiration_at": "2019-01-01T12:00:00.000Z", "expiration_policy": "release", "term": "term"}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::reservation:7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "href": "https://us-south.iaas.cloud.ibm.com/v1/reservations/7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "id": "7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "lifecycle_state": "stable", "name": "my-reservation", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "reservation", "status": "activating", "status_reasons": [{"code": "cannot_activate_no_capacity_available", "message": "The reservation cannot be activated because capacity is unavailable", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-reserved-capacity-status-reasons"}], "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,
@@ -15728,7 +16700,7 @@ def test_get_dedicated_host_group_all_params(self):
id = 'testString'
# Invoke method
- response = _service.get_dedicated_host_group(
+ response = _service.get_reservation(
id,
headers={},
)
@@ -15737,23 +16709,23 @@ def test_get_dedicated_host_group_all_params(self):
assert len(responses.calls) == 1
assert response.status_code == 200
- def test_get_dedicated_host_group_all_params_with_retries(self):
- # Enable retries and run test_get_dedicated_host_group_all_params.
+ def test_get_reservation_all_params_with_retries(self):
+ # Enable retries and run test_get_reservation_all_params.
_service.enable_retries()
- self.test_get_dedicated_host_group_all_params()
+ self.test_get_reservation_all_params()
- # Disable retries and run test_get_dedicated_host_group_all_params.
+ # Disable retries and run test_get_reservation_all_params.
_service.disable_retries()
- self.test_get_dedicated_host_group_all_params()
+ self.test_get_reservation_all_params()
@responses.activate
- def test_get_dedicated_host_group_value_error(self):
+ def test_get_reservation_value_error(self):
"""
- test_get_dedicated_host_group_value_error()
+ test_get_reservation_value_error()
"""
# Set up mock
- url = preprocess_url('/dedicated_host/groups/testString')
- mock_response = '{"class": "mx2", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "dedicated_hosts": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-host", "resource_type": "dedicated_host"}], "family": "balanced", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-host-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "dedicated_host_group", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
+ url = preprocess_url('/reservations/testString')
+ mock_response = '{"affinity_policy": "restricted", "capacity": {"allocated": 10, "available": 2, "status": "allocated", "total": 10, "used": 8}, "committed_use": {"expiration_at": "2019-01-01T12:00:00.000Z", "expiration_policy": "release", "term": "term"}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::reservation:7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "href": "https://us-south.iaas.cloud.ibm.com/v1/reservations/7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "id": "7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "lifecycle_state": "stable", "name": "my-reservation", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "reservation", "status": "activating", "status_reasons": [{"code": "cannot_activate_no_capacity_available", "message": "The reservation cannot be activated because capacity is unavailable", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-reserved-capacity-status-reasons"}], "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,
@@ -15772,31 +16744,31 @@ def test_get_dedicated_host_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_dedicated_host_group(**req_copy)
+ _service.get_reservation(**req_copy)
- def test_get_dedicated_host_group_value_error_with_retries(self):
- # Enable retries and run test_get_dedicated_host_group_value_error.
+ def test_get_reservation_value_error_with_retries(self):
+ # Enable retries and run test_get_reservation_value_error.
_service.enable_retries()
- self.test_get_dedicated_host_group_value_error()
+ self.test_get_reservation_value_error()
- # Disable retries and run test_get_dedicated_host_group_value_error.
+ # Disable retries and run test_get_reservation_value_error.
_service.disable_retries()
- self.test_get_dedicated_host_group_value_error()
+ self.test_get_reservation_value_error()
-class TestUpdateDedicatedHostGroup:
+class TestUpdateReservation:
"""
- Test Class for update_dedicated_host_group
+ Test Class for update_reservation
"""
@responses.activate
- def test_update_dedicated_host_group_all_params(self):
+ def test_update_reservation_all_params(self):
"""
- update_dedicated_host_group()
+ update_reservation()
"""
# Set up mock
- url = preprocess_url('/dedicated_host/groups/testString')
- mock_response = '{"class": "mx2", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "dedicated_hosts": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-host", "resource_type": "dedicated_host"}], "family": "balanced", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-host-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "dedicated_host_group", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
+ url = preprocess_url('/reservations/testString')
+ mock_response = '{"affinity_policy": "restricted", "capacity": {"allocated": 10, "available": 2, "status": "allocated", "total": 10, "used": 8}, "committed_use": {"expiration_at": "2019-01-01T12:00:00.000Z", "expiration_policy": "release", "term": "term"}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::reservation:7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "href": "https://us-south.iaas.cloud.ibm.com/v1/reservations/7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "id": "7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "lifecycle_state": "stable", "name": "my-reservation", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "reservation", "status": "activating", "status_reasons": [{"code": "cannot_activate_no_capacity_available", "message": "The reservation cannot be activated because capacity is unavailable", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-reserved-capacity-status-reasons"}], "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,
@@ -15805,18 +16777,35 @@ def test_update_dedicated_host_group_all_params(self):
status=200,
)
- # Construct a dict representation of a DedicatedHostGroupPatch model
- dedicated_host_group_patch_model = {}
- dedicated_host_group_patch_model['name'] = 'my-host-group-updated'
+ # Construct a dict representation of a ReservationCapacityPatch model
+ reservation_capacity_patch_model = {}
+ reservation_capacity_patch_model['total'] = 10
+
+ # Construct a dict representation of a ReservationCommittedUsePatch model
+ reservation_committed_use_patch_model = {}
+ reservation_committed_use_patch_model['expiration_policy'] = 'release'
+ reservation_committed_use_patch_model['term'] = 'testString'
+
+ # Construct a dict representation of a ReservationProfilePatch model
+ reservation_profile_patch_model = {}
+ reservation_profile_patch_model['name'] = 'bx2-4x16'
+ reservation_profile_patch_model['resource_type'] = 'instance_profile'
+
+ # Construct a dict representation of a ReservationPatch model
+ reservation_patch_model = {}
+ reservation_patch_model['capacity'] = reservation_capacity_patch_model
+ reservation_patch_model['committed_use'] = reservation_committed_use_patch_model
+ reservation_patch_model['name'] = 'my-reservation'
+ reservation_patch_model['profile'] = reservation_profile_patch_model
# Set up parameter values
id = 'testString'
- dedicated_host_group_patch = dedicated_host_group_patch_model
+ reservation_patch = reservation_patch_model
# Invoke method
- response = _service.update_dedicated_host_group(
+ response = _service.update_reservation(
id,
- dedicated_host_group_patch,
+ reservation_patch,
headers={},
)
@@ -15825,25 +16814,25 @@ def test_update_dedicated_host_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 == dedicated_host_group_patch
+ assert req_body == reservation_patch
- def test_update_dedicated_host_group_all_params_with_retries(self):
- # Enable retries and run test_update_dedicated_host_group_all_params.
+ def test_update_reservation_all_params_with_retries(self):
+ # Enable retries and run test_update_reservation_all_params.
_service.enable_retries()
- self.test_update_dedicated_host_group_all_params()
+ self.test_update_reservation_all_params()
- # Disable retries and run test_update_dedicated_host_group_all_params.
+ # Disable retries and run test_update_reservation_all_params.
_service.disable_retries()
- self.test_update_dedicated_host_group_all_params()
+ self.test_update_reservation_all_params()
@responses.activate
- def test_update_dedicated_host_group_value_error(self):
+ def test_update_reservation_value_error(self):
"""
- test_update_dedicated_host_group_value_error()
+ test_update_reservation_value_error()
"""
# Set up mock
- url = preprocess_url('/dedicated_host/groups/testString')
- mock_response = '{"class": "mx2", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "dedicated_hosts": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-host", "resource_type": "dedicated_host"}], "family": "balanced", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-host-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "dedicated_host_group", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
+ url = preprocess_url('/reservations/testString')
+ mock_response = '{"affinity_policy": "restricted", "capacity": {"allocated": 10, "available": 2, "status": "allocated", "total": 10, "used": 8}, "committed_use": {"expiration_at": "2019-01-01T12:00:00.000Z", "expiration_policy": "release", "term": "term"}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::reservation:7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "href": "https://us-south.iaas.cloud.ibm.com/v1/reservations/7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "id": "7187-ba49df72-37b8-43ac-98da-f8e029de0e63", "lifecycle_state": "stable", "name": "my-reservation", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "reservation", "status": "activating", "status_reasons": [{"code": "cannot_activate_no_capacity_available", "message": "The reservation cannot be activated because capacity is unavailable", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-reserved-capacity-status-reasons"}], "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,
@@ -15852,313 +16841,196 @@ def test_update_dedicated_host_group_value_error(self):
status=200,
)
- # Construct a dict representation of a DedicatedHostGroupPatch model
- dedicated_host_group_patch_model = {}
- dedicated_host_group_patch_model['name'] = 'my-host-group-updated'
+ # Construct a dict representation of a ReservationCapacityPatch model
+ reservation_capacity_patch_model = {}
+ reservation_capacity_patch_model['total'] = 10
+
+ # Construct a dict representation of a ReservationCommittedUsePatch model
+ reservation_committed_use_patch_model = {}
+ reservation_committed_use_patch_model['expiration_policy'] = 'release'
+ reservation_committed_use_patch_model['term'] = 'testString'
+
+ # Construct a dict representation of a ReservationProfilePatch model
+ reservation_profile_patch_model = {}
+ reservation_profile_patch_model['name'] = 'bx2-4x16'
+ reservation_profile_patch_model['resource_type'] = 'instance_profile'
+
+ # Construct a dict representation of a ReservationPatch model
+ reservation_patch_model = {}
+ reservation_patch_model['capacity'] = reservation_capacity_patch_model
+ reservation_patch_model['committed_use'] = reservation_committed_use_patch_model
+ reservation_patch_model['name'] = 'my-reservation'
+ reservation_patch_model['profile'] = reservation_profile_patch_model
# Set up parameter values
id = 'testString'
- dedicated_host_group_patch = dedicated_host_group_patch_model
+ reservation_patch = reservation_patch_model
# Pass in all but one required param and check for a ValueError
req_param_dict = {
"id": id,
- "dedicated_host_group_patch": dedicated_host_group_patch,
+ "reservation_patch": reservation_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_dedicated_host_group(**req_copy)
+ _service.update_reservation(**req_copy)
- def test_update_dedicated_host_group_value_error_with_retries(self):
- # Enable retries and run test_update_dedicated_host_group_value_error.
+ def test_update_reservation_value_error_with_retries(self):
+ # Enable retries and run test_update_reservation_value_error.
_service.enable_retries()
- self.test_update_dedicated_host_group_value_error()
+ self.test_update_reservation_value_error()
- # Disable retries and run test_update_dedicated_host_group_value_error.
+ # Disable retries and run test_update_reservation_value_error.
_service.disable_retries()
- self.test_update_dedicated_host_group_value_error()
+ self.test_update_reservation_value_error()
-class TestListDedicatedHostProfiles:
+class TestActivateReservation:
"""
- Test Class for list_dedicated_host_profiles
+ Test Class for activate_reservation
"""
@responses.activate
- def test_list_dedicated_host_profiles_all_params(self):
+ def test_activate_reservation_all_params(self):
"""
- list_dedicated_host_profiles()
+ activate_reservation()
"""
# Set up mock
- url = preprocess_url('/dedicated_host/profiles')
- mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/profiles?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/profiles?start=9da91&limit=20"}, "profiles": [{"class": "mx2", "disks": [{"interface_type": {"type": "fixed", "value": "nvme"}, "quantity": {"type": "fixed", "value": 4}, "size": {"type": "fixed", "value": 3200}, "supported_instance_interface_types": {"type": "fixed", "value": ["nvme"]}}], "family": "balanced", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "memory": {"type": "fixed", "value": 16}, "name": "mx2-host-152x1216", "socket_count": {"type": "fixed", "value": 2}, "status": "current", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16"}], "vcpu_architecture": {"type": "fixed", "value": "amd64"}, "vcpu_count": {"type": "fixed", "value": 16}, "vcpu_manufacturer": {"type": "fixed", "value": "intel"}}], "total_count": 132}'
+ url = preprocess_url('/reservations/testString/activate')
responses.add(
- responses.GET,
+ responses.POST,
url,
- body=mock_response,
- content_type='application/json',
- status=200,
+ status=202,
)
# Set up parameter values
- start = 'testString'
- limit = 50
+ id = 'testString'
# Invoke method
- response = _service.list_dedicated_host_profiles(
- start=start,
- limit=limit,
+ response = _service.activate_reservation(
+ 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_dedicated_host_profiles_all_params_with_retries(self):
- # Enable retries and run test_list_dedicated_host_profiles_all_params.
+ def test_activate_reservation_all_params_with_retries(self):
+ # Enable retries and run test_activate_reservation_all_params.
_service.enable_retries()
- self.test_list_dedicated_host_profiles_all_params()
+ self.test_activate_reservation_all_params()
- # Disable retries and run test_list_dedicated_host_profiles_all_params.
+ # Disable retries and run test_activate_reservation_all_params.
_service.disable_retries()
- self.test_list_dedicated_host_profiles_all_params()
+ self.test_activate_reservation_all_params()
@responses.activate
- def test_list_dedicated_host_profiles_required_params(self):
+ def test_activate_reservation_value_error(self):
"""
- test_list_dedicated_host_profiles_required_params()
+ test_activate_reservation_value_error()
"""
# Set up mock
- url = preprocess_url('/dedicated_host/profiles')
- mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/profiles?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/profiles?start=9da91&limit=20"}, "profiles": [{"class": "mx2", "disks": [{"interface_type": {"type": "fixed", "value": "nvme"}, "quantity": {"type": "fixed", "value": 4}, "size": {"type": "fixed", "value": 3200}, "supported_instance_interface_types": {"type": "fixed", "value": ["nvme"]}}], "family": "balanced", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "memory": {"type": "fixed", "value": 16}, "name": "mx2-host-152x1216", "socket_count": {"type": "fixed", "value": 2}, "status": "current", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16"}], "vcpu_architecture": {"type": "fixed", "value": "amd64"}, "vcpu_count": {"type": "fixed", "value": 16}, "vcpu_manufacturer": {"type": "fixed", "value": "intel"}}], "total_count": 132}'
+ url = preprocess_url('/reservations/testString/activate')
responses.add(
- responses.GET,
+ responses.POST,
url,
- body=mock_response,
- content_type='application/json',
- status=200,
+ status=202,
)
- # Invoke method
- response = _service.list_dedicated_host_profiles()
-
- # Check for correct operation
- assert len(responses.calls) == 1
- assert response.status_code == 200
-
- def test_list_dedicated_host_profiles_required_params_with_retries(self):
- # Enable retries and run test_list_dedicated_host_profiles_required_params.
- _service.enable_retries()
- self.test_list_dedicated_host_profiles_required_params()
-
- # Disable retries and run test_list_dedicated_host_profiles_required_params.
- _service.disable_retries()
- self.test_list_dedicated_host_profiles_required_params()
-
- @responses.activate
- def test_list_dedicated_host_profiles_value_error(self):
- """
- test_list_dedicated_host_profiles_value_error()
- """
- # Set up mock
- url = preprocess_url('/dedicated_host/profiles')
- mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/profiles?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/profiles?start=9da91&limit=20"}, "profiles": [{"class": "mx2", "disks": [{"interface_type": {"type": "fixed", "value": "nvme"}, "quantity": {"type": "fixed", "value": 4}, "size": {"type": "fixed", "value": 3200}, "supported_instance_interface_types": {"type": "fixed", "value": ["nvme"]}}], "family": "balanced", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "memory": {"type": "fixed", "value": 16}, "name": "mx2-host-152x1216", "socket_count": {"type": "fixed", "value": 2}, "status": "current", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16"}], "vcpu_architecture": {"type": "fixed", "value": "amd64"}, "vcpu_count": {"type": "fixed", "value": 16}, "vcpu_manufacturer": {"type": "fixed", "value": "intel"}}], "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_dedicated_host_profiles(**req_copy)
+ _service.activate_reservation(**req_copy)
- def test_list_dedicated_host_profiles_value_error_with_retries(self):
- # Enable retries and run test_list_dedicated_host_profiles_value_error.
+ def test_activate_reservation_value_error_with_retries(self):
+ # Enable retries and run test_activate_reservation_value_error.
_service.enable_retries()
- self.test_list_dedicated_host_profiles_value_error()
+ self.test_activate_reservation_value_error()
- # Disable retries and run test_list_dedicated_host_profiles_value_error.
+ # Disable retries and run test_activate_reservation_value_error.
_service.disable_retries()
- self.test_list_dedicated_host_profiles_value_error()
-
- @responses.activate
- def test_list_dedicated_host_profiles_with_pager_get_next(self):
- """
- test_list_dedicated_host_profiles_with_pager_get_next()
- """
- # Set up a two-page mock response
- url = preprocess_url('/dedicated_host/profiles')
- mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"profiles":[{"class":"mx2","disks":[{"interface_type":{"type":"fixed","value":"nvme"},"quantity":{"type":"fixed","value":4},"size":{"type":"fixed","value":3200},"supported_instance_interface_types":{"type":"fixed","value":["nvme"]}}],"family":"balanced","href":"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a","memory":{"type":"fixed","value":16},"name":"mx2-host-152x1216","socket_count":{"type":"fixed","value":2},"status":"current","supported_instance_profiles":[{"href":"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16","name":"bx2-4x16"}],"vcpu_architecture":{"type":"fixed","value":"amd64"},"vcpu_count":{"type":"fixed","value":16},"vcpu_manufacturer":{"type":"fixed","value":"intel"}}]}'
- mock_response2 = '{"total_count":2,"limit":1,"profiles":[{"class":"mx2","disks":[{"interface_type":{"type":"fixed","value":"nvme"},"quantity":{"type":"fixed","value":4},"size":{"type":"fixed","value":3200},"supported_instance_interface_types":{"type":"fixed","value":["nvme"]}}],"family":"balanced","href":"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a","memory":{"type":"fixed","value":16},"name":"mx2-host-152x1216","socket_count":{"type":"fixed","value":2},"status":"current","supported_instance_profiles":[{"href":"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16","name":"bx2-4x16"}],"vcpu_architecture":{"type":"fixed","value":"amd64"},"vcpu_count":{"type":"fixed","value":16},"vcpu_manufacturer":{"type":"fixed","value":"intel"}}]}'
- responses.add(
- responses.GET,
- url,
- body=mock_response1,
- content_type='application/json',
- status=200,
- )
- responses.add(
- responses.GET,
- url,
- body=mock_response2,
- content_type='application/json',
- status=200,
- )
+ self.test_activate_reservation_value_error()
- # Exercise the pager class for this operation
- all_results = []
- pager = DedicatedHostProfilesPager(
- client=_service,
- limit=10,
- )
- while pager.has_next():
- next_page = pager.get_next()
- assert next_page is not None
- all_results.extend(next_page)
- assert len(all_results) == 2
- @responses.activate
- def test_list_dedicated_host_profiles_with_pager_get_all(self):
- """
- test_list_dedicated_host_profiles_with_pager_get_all()
- """
- # Set up a two-page mock response
- url = preprocess_url('/dedicated_host/profiles')
- mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"profiles":[{"class":"mx2","disks":[{"interface_type":{"type":"fixed","value":"nvme"},"quantity":{"type":"fixed","value":4},"size":{"type":"fixed","value":3200},"supported_instance_interface_types":{"type":"fixed","value":["nvme"]}}],"family":"balanced","href":"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a","memory":{"type":"fixed","value":16},"name":"mx2-host-152x1216","socket_count":{"type":"fixed","value":2},"status":"current","supported_instance_profiles":[{"href":"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16","name":"bx2-4x16"}],"vcpu_architecture":{"type":"fixed","value":"amd64"},"vcpu_count":{"type":"fixed","value":16},"vcpu_manufacturer":{"type":"fixed","value":"intel"}}]}'
- mock_response2 = '{"total_count":2,"limit":1,"profiles":[{"class":"mx2","disks":[{"interface_type":{"type":"fixed","value":"nvme"},"quantity":{"type":"fixed","value":4},"size":{"type":"fixed","value":3200},"supported_instance_interface_types":{"type":"fixed","value":["nvme"]}}],"family":"balanced","href":"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a","memory":{"type":"fixed","value":16},"name":"mx2-host-152x1216","socket_count":{"type":"fixed","value":2},"status":"current","supported_instance_profiles":[{"href":"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16","name":"bx2-4x16"}],"vcpu_architecture":{"type":"fixed","value":"amd64"},"vcpu_count":{"type":"fixed","value":16},"vcpu_manufacturer":{"type":"fixed","value":"intel"}}]}'
- responses.add(
- responses.GET,
- url,
- body=mock_response1,
- content_type='application/json',
- status=200,
- )
- responses.add(
- responses.GET,
- url,
- body=mock_response2,
- content_type='application/json',
- status=200,
- )
+# endregion
+##############################################################################
+# End of Service: Reservations
+##############################################################################
- # Exercise the pager class for this operation
- pager = DedicatedHostProfilesPager(
- client=_service,
- limit=10,
- )
- all_results = pager.get_all()
- assert all_results is not None
- assert len(all_results) == 2
+##############################################################################
+# Start of Service: DedicatedHosts
+##############################################################################
+# region
-class TestGetDedicatedHostProfile:
+class TestNewInstance:
"""
- Test Class for get_dedicated_host_profile
+ Test Class for new_instance
"""
- @responses.activate
- def test_get_dedicated_host_profile_all_params(self):
+ def test_new_instance(self):
"""
- get_dedicated_host_profile()
+ new_instance()
"""
- # Set up mock
- url = preprocess_url('/dedicated_host/profiles/testString')
- mock_response = '{"class": "mx2", "disks": [{"interface_type": {"type": "fixed", "value": "nvme"}, "quantity": {"type": "fixed", "value": 4}, "size": {"type": "fixed", "value": 3200}, "supported_instance_interface_types": {"type": "fixed", "value": ["nvme"]}}], "family": "balanced", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "memory": {"type": "fixed", "value": 16}, "name": "mx2-host-152x1216", "socket_count": {"type": "fixed", "value": 2}, "status": "current", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16"}], "vcpu_architecture": {"type": "fixed", "value": "amd64"}, "vcpu_count": {"type": "fixed", "value": 16}, "vcpu_manufacturer": {"type": "fixed", "value": "intel"}}'
- responses.add(
- responses.GET,
- url,
- body=mock_response,
- content_type='application/json',
- status=200,
- )
-
- # Set up parameter values
- name = 'testString'
+ os.environ['TEST_SERVICE_AUTH_TYPE'] = 'noAuth'
- # Invoke method
- response = _service.get_dedicated_host_profile(
- name,
- headers={},
+ service = VpcV1.new_instance(
+ version=version,
+ service_name='TEST_SERVICE',
)
- # Check for correct operation
- assert len(responses.calls) == 1
- assert response.status_code == 200
-
- def test_get_dedicated_host_profile_all_params_with_retries(self):
- # Enable retries and run test_get_dedicated_host_profile_all_params.
- _service.enable_retries()
- self.test_get_dedicated_host_profile_all_params()
-
- # Disable retries and run test_get_dedicated_host_profile_all_params.
- _service.disable_retries()
- self.test_get_dedicated_host_profile_all_params()
+ assert service is not None
+ assert isinstance(service, VpcV1)
- @responses.activate
- def test_get_dedicated_host_profile_value_error(self):
+ def test_new_instance_without_authenticator(self):
"""
- test_get_dedicated_host_profile_value_error()
+ new_instance_without_authenticator()
"""
- # Set up mock
- url = preprocess_url('/dedicated_host/profiles/testString')
- mock_response = '{"class": "mx2", "disks": [{"interface_type": {"type": "fixed", "value": "nvme"}, "quantity": {"type": "fixed", "value": 4}, "size": {"type": "fixed", "value": 3200}, "supported_instance_interface_types": {"type": "fixed", "value": ["nvme"]}}], "family": "balanced", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "memory": {"type": "fixed", "value": 16}, "name": "mx2-host-152x1216", "socket_count": {"type": "fixed", "value": 2}, "status": "current", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16"}], "vcpu_architecture": {"type": "fixed", "value": "amd64"}, "vcpu_count": {"type": "fixed", "value": 16}, "vcpu_manufacturer": {"type": "fixed", "value": "intel"}}'
- responses.add(
- responses.GET,
- url,
- body=mock_response,
- content_type='application/json',
- status=200,
- )
-
- # Set up parameter values
- name = 'testString'
-
- # Pass in all but one required param and check for a ValueError
- req_param_dict = {
- "name": name,
- }
- for param in req_param_dict.keys():
- req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()}
- with pytest.raises(ValueError):
- _service.get_dedicated_host_profile(**req_copy)
+ with pytest.raises(ValueError, match='authenticator must be provided'):
+ service = VpcV1.new_instance(
+ version=version,
+ service_name='TEST_SERVICE_NOT_FOUND',
+ )
- def test_get_dedicated_host_profile_value_error_with_retries(self):
- # Enable retries and run test_get_dedicated_host_profile_value_error.
- _service.enable_retries()
- self.test_get_dedicated_host_profile_value_error()
+ 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()
- # Disable retries and run test_get_dedicated_host_profile_value_error.
- _service.disable_retries()
- self.test_get_dedicated_host_profile_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 TestListDedicatedHosts:
+class TestListDedicatedHostGroups:
"""
- Test Class for list_dedicated_hosts
+ Test Class for list_dedicated_host_groups
"""
@responses.activate
- def test_list_dedicated_hosts_all_params(self):
+ def test_list_dedicated_host_groups_all_params(self):
"""
- list_dedicated_hosts()
+ list_dedicated_host_groups()
"""
# Set up mock
- url = preprocess_url('/dedicated_hosts')
- mock_response = '{"dedicated_hosts": [{"available_memory": 128, "available_vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "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", "numa": {"count": 2, "nodes": [{"available_vcpu": 24, "vcpu": 56}]}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "mx2-host-152x1216"}, "provisionable": false, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "dedicated_host", "socket_count": 4, "state": "available", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16"}], "vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "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}'
+ 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/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}], "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,
@@ -16168,7 +17040,6 @@ def test_list_dedicated_hosts_all_params(self):
)
# Set up parameter values
- dedicated_host_group_id = 'testString'
start = 'testString'
limit = 50
resource_group_id = 'testString'
@@ -16176,8 +17047,7 @@ def test_list_dedicated_hosts_all_params(self):
name = 'testString'
# Invoke method
- response = _service.list_dedicated_hosts(
- dedicated_host_group_id=dedicated_host_group_id,
+ response = _service.list_dedicated_host_groups(
start=start,
limit=limit,
resource_group_id=resource_group_id,
@@ -16192,30 +17062,29 @@ def test_list_dedicated_hosts_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 'dedicated_host_group.id={}'.format(dedicated_host_group_id) 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
assert 'zone.name={}'.format(zone_name) in query_string
assert 'name={}'.format(name) in query_string
- def test_list_dedicated_hosts_all_params_with_retries(self):
- # Enable retries and run test_list_dedicated_hosts_all_params.
+ def test_list_dedicated_host_groups_all_params_with_retries(self):
+ # Enable retries and run test_list_dedicated_host_groups_all_params.
_service.enable_retries()
- self.test_list_dedicated_hosts_all_params()
+ self.test_list_dedicated_host_groups_all_params()
- # Disable retries and run test_list_dedicated_hosts_all_params.
+ # Disable retries and run test_list_dedicated_host_groups_all_params.
_service.disable_retries()
- self.test_list_dedicated_hosts_all_params()
+ self.test_list_dedicated_host_groups_all_params()
@responses.activate
- def test_list_dedicated_hosts_required_params(self):
+ def test_list_dedicated_host_groups_required_params(self):
"""
- test_list_dedicated_hosts_required_params()
+ test_list_dedicated_host_groups_required_params()
"""
# Set up mock
- url = preprocess_url('/dedicated_hosts')
- mock_response = '{"dedicated_hosts": [{"available_memory": 128, "available_vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "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", "numa": {"count": 2, "nodes": [{"available_vcpu": 24, "vcpu": 56}]}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "mx2-host-152x1216"}, "provisionable": false, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "dedicated_host", "socket_count": 4, "state": "available", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16"}], "vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "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}'
+ 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/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}], "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,
@@ -16225,29 +17094,29 @@ def test_list_dedicated_hosts_required_params(self):
)
# Invoke method
- response = _service.list_dedicated_hosts()
+ response = _service.list_dedicated_host_groups()
# Check for correct operation
assert len(responses.calls) == 1
assert response.status_code == 200
- def test_list_dedicated_hosts_required_params_with_retries(self):
- # Enable retries and run test_list_dedicated_hosts_required_params.
+ def test_list_dedicated_host_groups_required_params_with_retries(self):
+ # Enable retries and run test_list_dedicated_host_groups_required_params.
_service.enable_retries()
- self.test_list_dedicated_hosts_required_params()
+ self.test_list_dedicated_host_groups_required_params()
- # Disable retries and run test_list_dedicated_hosts_required_params.
+ # Disable retries and run test_list_dedicated_host_groups_required_params.
_service.disable_retries()
- self.test_list_dedicated_hosts_required_params()
+ self.test_list_dedicated_host_groups_required_params()
@responses.activate
- def test_list_dedicated_hosts_value_error(self):
+ def test_list_dedicated_host_groups_value_error(self):
"""
- test_list_dedicated_hosts_value_error()
+ test_list_dedicated_host_groups_value_error()
"""
# Set up mock
- url = preprocess_url('/dedicated_hosts')
- mock_response = '{"dedicated_hosts": [{"available_memory": 128, "available_vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "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", "numa": {"count": 2, "nodes": [{"available_vcpu": 24, "vcpu": 56}]}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "mx2-host-152x1216"}, "provisionable": false, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "dedicated_host", "socket_count": 4, "state": "available", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16"}], "vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "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}'
+ 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/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}], "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,
@@ -16262,26 +17131,26 @@ def test_list_dedicated_hosts_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_dedicated_hosts(**req_copy)
+ _service.list_dedicated_host_groups(**req_copy)
- def test_list_dedicated_hosts_value_error_with_retries(self):
- # Enable retries and run test_list_dedicated_hosts_value_error.
+ def test_list_dedicated_host_groups_value_error_with_retries(self):
+ # Enable retries and run test_list_dedicated_host_groups_value_error.
_service.enable_retries()
- self.test_list_dedicated_hosts_value_error()
+ self.test_list_dedicated_host_groups_value_error()
- # Disable retries and run test_list_dedicated_hosts_value_error.
+ # Disable retries and run test_list_dedicated_host_groups_value_error.
_service.disable_retries()
- self.test_list_dedicated_hosts_value_error()
+ self.test_list_dedicated_host_groups_value_error()
@responses.activate
- def test_list_dedicated_hosts_with_pager_get_next(self):
+ def test_list_dedicated_host_groups_with_pager_get_next(self):
"""
- test_list_dedicated_hosts_with_pager_get_next()
+ test_list_dedicated_host_groups_with_pager_get_next()
"""
# Set up a two-page mock response
- url = preprocess_url('/dedicated_hosts')
- mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"dedicated_hosts":[{"available_memory":128,"available_vcpu":{"architecture":"amd64","count":4,"manufacturer":"intel"},"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","numa":{"count":2,"nodes":[{"available_vcpu":24,"vcpu":56}]},"profile":{"href":"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a","name":"mx2-host-152x1216"},"provisionable":false,"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"dedicated_host","socket_count":4,"state":"available","supported_instance_profiles":[{"href":"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16","name":"bx2-4x16"}],"vcpu":{"architecture":"amd64","count":4,"manufacturer":"intel"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"total_count":2,"limit":1}'
- mock_response2 = '{"dedicated_hosts":[{"available_memory":128,"available_vcpu":{"architecture":"amd64","count":4,"manufacturer":"intel"},"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","numa":{"count":2,"nodes":[{"available_vcpu":24,"vcpu":56}]},"profile":{"href":"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a","name":"mx2-host-152x1216"},"provisionable":false,"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"dedicated_host","socket_count":4,"state":"available","supported_instance_profiles":[{"href":"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16","name":"bx2-4x16"}],"vcpu":{"architecture":"amd64","count":4,"manufacturer":"intel"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"total_count":2,"limit":1}'
+ url = preprocess_url('/dedicated_host/groups')
+ mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"groups":[{"class":"mx2","created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0","dedicated_hosts":[{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a","id":"1e09281b-f177-46fb-baf1-bc152b2e391a","name":"my-host","resource_type":"dedicated_host"}],"family":"balanced","href":"https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0","id":"bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0","name":"my-host-group","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"dedicated_host_group","supported_instance_profiles":[{"href":"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16","name":"bx2-4x16","resource_type":"instance_profile"}],"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}]}'
+ mock_response2 = '{"total_count":2,"limit":1,"groups":[{"class":"mx2","created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0","dedicated_hosts":[{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a","id":"1e09281b-f177-46fb-baf1-bc152b2e391a","name":"my-host","resource_type":"dedicated_host"}],"family":"balanced","href":"https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0","id":"bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0","name":"my-host-group","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"dedicated_host_group","supported_instance_profiles":[{"href":"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16","name":"bx2-4x16","resource_type":"instance_profile"}],"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,
@@ -16299,9 +17168,8 @@ def test_list_dedicated_hosts_with_pager_get_next(self):
# Exercise the pager class for this operation
all_results = []
- pager = DedicatedHostsPager(
+ pager = DedicatedHostGroupsPager(
client=_service,
- dedicated_host_group_id='testString',
limit=10,
resource_group_id='testString',
zone_name='us-south-1',
@@ -16314,14 +17182,14 @@ def test_list_dedicated_hosts_with_pager_get_next(self):
assert len(all_results) == 2
@responses.activate
- def test_list_dedicated_hosts_with_pager_get_all(self):
+ def test_list_dedicated_host_groups_with_pager_get_all(self):
"""
- test_list_dedicated_hosts_with_pager_get_all()
+ test_list_dedicated_host_groups_with_pager_get_all()
"""
# Set up a two-page mock response
- url = preprocess_url('/dedicated_hosts')
- mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"dedicated_hosts":[{"available_memory":128,"available_vcpu":{"architecture":"amd64","count":4,"manufacturer":"intel"},"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","numa":{"count":2,"nodes":[{"available_vcpu":24,"vcpu":56}]},"profile":{"href":"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a","name":"mx2-host-152x1216"},"provisionable":false,"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"dedicated_host","socket_count":4,"state":"available","supported_instance_profiles":[{"href":"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16","name":"bx2-4x16"}],"vcpu":{"architecture":"amd64","count":4,"manufacturer":"intel"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"total_count":2,"limit":1}'
- mock_response2 = '{"dedicated_hosts":[{"available_memory":128,"available_vcpu":{"architecture":"amd64","count":4,"manufacturer":"intel"},"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","numa":{"count":2,"nodes":[{"available_vcpu":24,"vcpu":56}]},"profile":{"href":"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a","name":"mx2-host-152x1216"},"provisionable":false,"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"dedicated_host","socket_count":4,"state":"available","supported_instance_profiles":[{"href":"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16","name":"bx2-4x16"}],"vcpu":{"architecture":"amd64","count":4,"manufacturer":"intel"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"total_count":2,"limit":1}'
+ url = preprocess_url('/dedicated_host/groups')
+ mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"groups":[{"class":"mx2","created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0","dedicated_hosts":[{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a","id":"1e09281b-f177-46fb-baf1-bc152b2e391a","name":"my-host","resource_type":"dedicated_host"}],"family":"balanced","href":"https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0","id":"bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0","name":"my-host-group","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"dedicated_host_group","supported_instance_profiles":[{"href":"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16","name":"bx2-4x16","resource_type":"instance_profile"}],"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}]}'
+ mock_response2 = '{"total_count":2,"limit":1,"groups":[{"class":"mx2","created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0","dedicated_hosts":[{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a","id":"1e09281b-f177-46fb-baf1-bc152b2e391a","name":"my-host","resource_type":"dedicated_host"}],"family":"balanced","href":"https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0","id":"bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0","name":"my-host-group","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"dedicated_host_group","supported_instance_profiles":[{"href":"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16","name":"bx2-4x16","resource_type":"instance_profile"}],"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,
@@ -16338,9 +17206,8 @@ def test_list_dedicated_hosts_with_pager_get_all(self):
)
# Exercise the pager class for this operation
- pager = DedicatedHostsPager(
+ pager = DedicatedHostGroupsPager(
client=_service,
- dedicated_host_group_id='testString',
limit=10,
resource_group_id='testString',
zone_name='us-south-1',
@@ -16351,19 +17218,19 @@ def test_list_dedicated_hosts_with_pager_get_all(self):
assert len(all_results) == 2
-class TestCreateDedicatedHost:
+class TestCreateDedicatedHostGroup:
"""
- Test Class for create_dedicated_host
+ Test Class for create_dedicated_host_group
"""
@responses.activate
- def test_create_dedicated_host_all_params(self):
+ def test_create_dedicated_host_group_all_params(self):
"""
- create_dedicated_host()
+ create_dedicated_host_group()
"""
# Set up mock
- url = preprocess_url('/dedicated_hosts')
- mock_response = '{"available_memory": 128, "available_vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "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", "numa": {"count": 2, "nodes": [{"available_vcpu": 24, "vcpu": 56}]}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "mx2-host-152x1216"}, "provisionable": false, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "dedicated_host", "socket_count": 4, "state": "available", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16"}], "vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
+ 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/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}], "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,
@@ -16372,32 +17239,28 @@ def test_create_dedicated_host_all_params(self):
status=201,
)
- # Construct a dict representation of a DedicatedHostProfileIdentityByName model
- dedicated_host_profile_identity_model = {}
- dedicated_host_profile_identity_model['name'] = 'm-62x496'
-
- # Construct a dict representation of a ResourceGroupIdentityById model
+ # Construct a dict representation of a ZoneIdentityByName model
+ zone_identity_model = {}
+ zone_identity_model['name'] = 'us-south-1'
+
+ # Construct a dict representation of a ResourceGroupIdentityById model
resource_group_identity_model = {}
resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
- # Construct a dict representation of a DedicatedHostGroupIdentityById model
- dedicated_host_group_identity_model = {}
- dedicated_host_group_identity_model['id'] = '0c8eccb4-271c-4518-956c-32bfce5cf83b'
-
- # Construct a dict representation of a DedicatedHostPrototypeDedicatedHostByGroup model
- dedicated_host_prototype_model = {}
- dedicated_host_prototype_model['instance_placement_enabled'] = True
- dedicated_host_prototype_model['name'] = 'my-host'
- dedicated_host_prototype_model['profile'] = dedicated_host_profile_identity_model
- dedicated_host_prototype_model['resource_group'] = resource_group_identity_model
- dedicated_host_prototype_model['group'] = dedicated_host_group_identity_model
-
# Set up parameter values
- dedicated_host_prototype = dedicated_host_prototype_model
+ class_ = 'mx2'
+ family = 'balanced'
+ zone = zone_identity_model
+ name = 'testString'
+ resource_group = resource_group_identity_model
# Invoke method
- response = _service.create_dedicated_host(
- dedicated_host_prototype,
+ response = _service.create_dedicated_host_group(
+ class_,
+ family,
+ zone,
+ name=name,
+ resource_group=resource_group,
headers={},
)
@@ -16406,25 +17269,29 @@ def test_create_dedicated_host_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 == dedicated_host_prototype
+ assert req_body['class'] == 'mx2'
+ assert req_body['family'] == 'balanced'
+ assert req_body['zone'] == zone_identity_model
+ assert req_body['name'] == 'testString'
+ assert req_body['resource_group'] == resource_group_identity_model
- def test_create_dedicated_host_all_params_with_retries(self):
- # Enable retries and run test_create_dedicated_host_all_params.
+ def test_create_dedicated_host_group_all_params_with_retries(self):
+ # Enable retries and run test_create_dedicated_host_group_all_params.
_service.enable_retries()
- self.test_create_dedicated_host_all_params()
+ self.test_create_dedicated_host_group_all_params()
- # Disable retries and run test_create_dedicated_host_all_params.
+ # Disable retries and run test_create_dedicated_host_group_all_params.
_service.disable_retries()
- self.test_create_dedicated_host_all_params()
+ self.test_create_dedicated_host_group_all_params()
@responses.activate
- def test_create_dedicated_host_value_error(self):
+ def test_create_dedicated_host_group_value_error(self):
"""
- test_create_dedicated_host_value_error()
+ test_create_dedicated_host_group_value_error()
"""
# Set up mock
- url = preprocess_url('/dedicated_hosts')
- mock_response = '{"available_memory": 128, "available_vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "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", "numa": {"count": 2, "nodes": [{"available_vcpu": 24, "vcpu": 56}]}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "mx2-host-152x1216"}, "provisionable": false, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "dedicated_host", "socket_count": 4, "state": "available", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16"}], "vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
+ 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/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}], "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,
@@ -16433,142 +17300,130 @@ def test_create_dedicated_host_value_error(self):
status=201,
)
- # Construct a dict representation of a DedicatedHostProfileIdentityByName model
- dedicated_host_profile_identity_model = {}
- dedicated_host_profile_identity_model['name'] = 'm-62x496'
+ # Construct a dict representation of a ZoneIdentityByName model
+ zone_identity_model = {}
+ zone_identity_model['name'] = 'us-south-1'
# Construct a dict representation of a ResourceGroupIdentityById model
resource_group_identity_model = {}
resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
- # Construct a dict representation of a DedicatedHostGroupIdentityById model
- dedicated_host_group_identity_model = {}
- dedicated_host_group_identity_model['id'] = '0c8eccb4-271c-4518-956c-32bfce5cf83b'
-
- # Construct a dict representation of a DedicatedHostPrototypeDedicatedHostByGroup model
- dedicated_host_prototype_model = {}
- dedicated_host_prototype_model['instance_placement_enabled'] = True
- dedicated_host_prototype_model['name'] = 'my-host'
- dedicated_host_prototype_model['profile'] = dedicated_host_profile_identity_model
- dedicated_host_prototype_model['resource_group'] = resource_group_identity_model
- dedicated_host_prototype_model['group'] = dedicated_host_group_identity_model
-
# Set up parameter values
- dedicated_host_prototype = dedicated_host_prototype_model
+ class_ = 'mx2'
+ family = 'balanced'
+ zone = zone_identity_model
+ name = 'testString'
+ resource_group = resource_group_identity_model
# Pass in all but one required param and check for a ValueError
req_param_dict = {
- "dedicated_host_prototype": dedicated_host_prototype,
+ "class_": class_,
+ "family": family,
+ "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_dedicated_host(**req_copy)
+ _service.create_dedicated_host_group(**req_copy)
- def test_create_dedicated_host_value_error_with_retries(self):
- # Enable retries and run test_create_dedicated_host_value_error.
+ def test_create_dedicated_host_group_value_error_with_retries(self):
+ # Enable retries and run test_create_dedicated_host_group_value_error.
_service.enable_retries()
- self.test_create_dedicated_host_value_error()
+ self.test_create_dedicated_host_group_value_error()
- # Disable retries and run test_create_dedicated_host_value_error.
+ # Disable retries and run test_create_dedicated_host_group_value_error.
_service.disable_retries()
- self.test_create_dedicated_host_value_error()
+ self.test_create_dedicated_host_group_value_error()
-class TestListDedicatedHostDisks:
+class TestDeleteDedicatedHostGroup:
"""
- Test Class for list_dedicated_host_disks
+ Test Class for delete_dedicated_host_group
"""
@responses.activate
- def test_list_dedicated_host_disks_all_params(self):
+ def test_delete_dedicated_host_group_all_params(self):
"""
- list_dedicated_host_disks()
+ delete_dedicated_host_group()
"""
# Set up mock
- 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"]}]}'
+ url = preprocess_url('/dedicated_host/groups/testString')
responses.add(
- responses.GET,
+ responses.DELETE,
url,
- body=mock_response,
- content_type='application/json',
- status=200,
+ status=204,
)
# Set up parameter values
- dedicated_host_id = 'testString'
+ id = 'testString'
# Invoke method
- response = _service.list_dedicated_host_disks(
- dedicated_host_id,
+ response = _service.delete_dedicated_host_group(
+ id,
headers={},
)
# Check for correct operation
assert len(responses.calls) == 1
- assert response.status_code == 200
+ assert response.status_code == 204
- def test_list_dedicated_host_disks_all_params_with_retries(self):
- # Enable retries and run test_list_dedicated_host_disks_all_params.
+ def test_delete_dedicated_host_group_all_params_with_retries(self):
+ # Enable retries and run test_delete_dedicated_host_group_all_params.
_service.enable_retries()
- self.test_list_dedicated_host_disks_all_params()
+ self.test_delete_dedicated_host_group_all_params()
- # Disable retries and run test_list_dedicated_host_disks_all_params.
+ # Disable retries and run test_delete_dedicated_host_group_all_params.
_service.disable_retries()
- self.test_list_dedicated_host_disks_all_params()
+ self.test_delete_dedicated_host_group_all_params()
@responses.activate
- def test_list_dedicated_host_disks_value_error(self):
+ def test_delete_dedicated_host_group_value_error(self):
"""
- test_list_dedicated_host_disks_value_error()
+ test_delete_dedicated_host_group_value_error()
"""
# Set up mock
- 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"]}]}'
+ url = preprocess_url('/dedicated_host/groups/testString')
responses.add(
- responses.GET,
+ responses.DELETE,
url,
- body=mock_response,
- content_type='application/json',
- status=200,
+ status=204,
)
# Set up parameter values
- dedicated_host_id = 'testString'
+ id = 'testString'
# Pass in all but one required param and check for a ValueError
req_param_dict = {
- "dedicated_host_id": dedicated_host_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_dedicated_host_disks(**req_copy)
+ _service.delete_dedicated_host_group(**req_copy)
- def test_list_dedicated_host_disks_value_error_with_retries(self):
- # Enable retries and run test_list_dedicated_host_disks_value_error.
+ def test_delete_dedicated_host_group_value_error_with_retries(self):
+ # Enable retries and run test_delete_dedicated_host_group_value_error.
_service.enable_retries()
- self.test_list_dedicated_host_disks_value_error()
+ self.test_delete_dedicated_host_group_value_error()
- # Disable retries and run test_list_dedicated_host_disks_value_error.
+ # Disable retries and run test_delete_dedicated_host_group_value_error.
_service.disable_retries()
- self.test_list_dedicated_host_disks_value_error()
+ self.test_delete_dedicated_host_group_value_error()
-class TestGetDedicatedHostDisk:
+class TestGetDedicatedHostGroup:
"""
- Test Class for get_dedicated_host_disk
+ Test Class for get_dedicated_host_group
"""
@responses.activate
- def test_get_dedicated_host_disk_all_params(self):
+ def test_get_dedicated_host_group_all_params(self):
"""
- get_dedicated_host_disk()
+ get_dedicated_host_group()
"""
# Set up mock
- 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"]}'
+ 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/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}], "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,
@@ -16578,12 +17433,10 @@ def test_get_dedicated_host_disk_all_params(self):
)
# Set up parameter values
- dedicated_host_id = 'testString'
id = 'testString'
# Invoke method
- response = _service.get_dedicated_host_disk(
- dedicated_host_id,
+ response = _service.get_dedicated_host_group(
id,
headers={},
)
@@ -16592,23 +17445,23 @@ def test_get_dedicated_host_disk_all_params(self):
assert len(responses.calls) == 1
assert response.status_code == 200
- def test_get_dedicated_host_disk_all_params_with_retries(self):
- # Enable retries and run test_get_dedicated_host_disk_all_params.
+ def test_get_dedicated_host_group_all_params_with_retries(self):
+ # Enable retries and run test_get_dedicated_host_group_all_params.
_service.enable_retries()
- self.test_get_dedicated_host_disk_all_params()
+ self.test_get_dedicated_host_group_all_params()
- # Disable retries and run test_get_dedicated_host_disk_all_params.
+ # Disable retries and run test_get_dedicated_host_group_all_params.
_service.disable_retries()
- self.test_get_dedicated_host_disk_all_params()
+ self.test_get_dedicated_host_group_all_params()
@responses.activate
- def test_get_dedicated_host_disk_value_error(self):
+ def test_get_dedicated_host_group_value_error(self):
"""
- test_get_dedicated_host_disk_value_error()
+ test_get_dedicated_host_group_value_error()
"""
# Set up mock
- 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"]}'
+ 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/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}], "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,
@@ -16618,42 +17471,40 @@ def test_get_dedicated_host_disk_value_error(self):
)
# Set up parameter values
- dedicated_host_id = 'testString'
id = 'testString'
# Pass in all but one required param and check for a ValueError
req_param_dict = {
- "dedicated_host_id": dedicated_host_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_dedicated_host_disk(**req_copy)
+ _service.get_dedicated_host_group(**req_copy)
- def test_get_dedicated_host_disk_value_error_with_retries(self):
- # Enable retries and run test_get_dedicated_host_disk_value_error.
+ def test_get_dedicated_host_group_value_error_with_retries(self):
+ # Enable retries and run test_get_dedicated_host_group_value_error.
_service.enable_retries()
- self.test_get_dedicated_host_disk_value_error()
+ self.test_get_dedicated_host_group_value_error()
- # Disable retries and run test_get_dedicated_host_disk_value_error.
+ # Disable retries and run test_get_dedicated_host_group_value_error.
_service.disable_retries()
- self.test_get_dedicated_host_disk_value_error()
+ self.test_get_dedicated_host_group_value_error()
-class TestUpdateDedicatedHostDisk:
+class TestUpdateDedicatedHostGroup:
"""
- Test Class for update_dedicated_host_disk
+ Test Class for update_dedicated_host_group
"""
@responses.activate
- def test_update_dedicated_host_disk_all_params(self):
+ def test_update_dedicated_host_group_all_params(self):
"""
- update_dedicated_host_disk()
+ update_dedicated_host_group()
"""
# Set up mock
- 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"]}'
+ 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/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}], "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,
@@ -16662,20 +17513,18 @@ def test_update_dedicated_host_disk_all_params(self):
status=200,
)
- # Construct a dict representation of a DedicatedHostDiskPatch model
- dedicated_host_disk_patch_model = {}
- dedicated_host_disk_patch_model['name'] = 'my-disk-updated'
+ # Construct a dict representation of a DedicatedHostGroupPatch model
+ dedicated_host_group_patch_model = {}
+ dedicated_host_group_patch_model['name'] = 'my-host-group-updated'
# Set up parameter values
- dedicated_host_id = 'testString'
id = 'testString'
- dedicated_host_disk_patch = dedicated_host_disk_patch_model
+ dedicated_host_group_patch = dedicated_host_group_patch_model
# Invoke method
- response = _service.update_dedicated_host_disk(
- dedicated_host_id,
+ response = _service.update_dedicated_host_group(
id,
- dedicated_host_disk_patch,
+ dedicated_host_group_patch,
headers={},
)
@@ -16684,25 +17533,25 @@ def test_update_dedicated_host_disk_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 == dedicated_host_disk_patch
+ assert req_body == dedicated_host_group_patch
- def test_update_dedicated_host_disk_all_params_with_retries(self):
- # Enable retries and run test_update_dedicated_host_disk_all_params.
+ def test_update_dedicated_host_group_all_params_with_retries(self):
+ # Enable retries and run test_update_dedicated_host_group_all_params.
_service.enable_retries()
- self.test_update_dedicated_host_disk_all_params()
+ self.test_update_dedicated_host_group_all_params()
- # Disable retries and run test_update_dedicated_host_disk_all_params.
+ # Disable retries and run test_update_dedicated_host_group_all_params.
_service.disable_retries()
- self.test_update_dedicated_host_disk_all_params()
+ self.test_update_dedicated_host_group_all_params()
@responses.activate
- def test_update_dedicated_host_disk_value_error(self):
+ def test_update_dedicated_host_group_value_error(self):
"""
- test_update_dedicated_host_disk_value_error()
+ test_update_dedicated_host_group_value_error()
"""
# Set up mock
- 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"]}'
+ 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/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}], "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,
@@ -16711,124 +17560,232 @@ def test_update_dedicated_host_disk_value_error(self):
status=200,
)
- # Construct a dict representation of a DedicatedHostDiskPatch model
- dedicated_host_disk_patch_model = {}
- dedicated_host_disk_patch_model['name'] = 'my-disk-updated'
+ # Construct a dict representation of a DedicatedHostGroupPatch model
+ dedicated_host_group_patch_model = {}
+ dedicated_host_group_patch_model['name'] = 'my-host-group-updated'
# Set up parameter values
- dedicated_host_id = 'testString'
id = 'testString'
- dedicated_host_disk_patch = dedicated_host_disk_patch_model
+ dedicated_host_group_patch = dedicated_host_group_patch_model
# Pass in all but one required param and check for a ValueError
req_param_dict = {
- "dedicated_host_id": dedicated_host_id,
"id": id,
- "dedicated_host_disk_patch": dedicated_host_disk_patch,
+ "dedicated_host_group_patch": dedicated_host_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_dedicated_host_disk(**req_copy)
+ _service.update_dedicated_host_group(**req_copy)
- def test_update_dedicated_host_disk_value_error_with_retries(self):
- # Enable retries and run test_update_dedicated_host_disk_value_error.
+ def test_update_dedicated_host_group_value_error_with_retries(self):
+ # Enable retries and run test_update_dedicated_host_group_value_error.
_service.enable_retries()
- self.test_update_dedicated_host_disk_value_error()
+ self.test_update_dedicated_host_group_value_error()
- # Disable retries and run test_update_dedicated_host_disk_value_error.
+ # Disable retries and run test_update_dedicated_host_group_value_error.
_service.disable_retries()
- self.test_update_dedicated_host_disk_value_error()
+ self.test_update_dedicated_host_group_value_error()
-class TestDeleteDedicatedHost:
+class TestListDedicatedHostProfiles:
"""
- Test Class for delete_dedicated_host
+ Test Class for list_dedicated_host_profiles
"""
@responses.activate
- def test_delete_dedicated_host_all_params(self):
+ def test_list_dedicated_host_profiles_all_params(self):
"""
- delete_dedicated_host()
+ list_dedicated_host_profiles()
"""
# Set up mock
- url = preprocess_url('/dedicated_hosts/testString')
+ 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}, "status": "current", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}], "vcpu_architecture": {"type": "fixed", "value": "amd64"}, "vcpu_count": {"type": "fixed", "value": 16}, "vcpu_manufacturer": {"type": "fixed", "value": "intel"}}], "total_count": 132}'
responses.add(
- responses.DELETE,
+ responses.GET,
url,
- status=204,
+ body=mock_response,
+ content_type='application/json',
+ status=200,
)
# Set up parameter values
- id = 'testString'
+ start = 'testString'
+ limit = 50
# Invoke method
- response = _service.delete_dedicated_host(
- id,
+ response = _service.list_dedicated_host_profiles(
+ 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_delete_dedicated_host_all_params_with_retries(self):
- # Enable retries and run test_delete_dedicated_host_all_params.
+ def test_list_dedicated_host_profiles_all_params_with_retries(self):
+ # Enable retries and run test_list_dedicated_host_profiles_all_params.
_service.enable_retries()
- self.test_delete_dedicated_host_all_params()
+ self.test_list_dedicated_host_profiles_all_params()
- # Disable retries and run test_delete_dedicated_host_all_params.
+ # Disable retries and run test_list_dedicated_host_profiles_all_params.
_service.disable_retries()
- self.test_delete_dedicated_host_all_params()
+ self.test_list_dedicated_host_profiles_all_params()
@responses.activate
- def test_delete_dedicated_host_value_error(self):
+ def test_list_dedicated_host_profiles_required_params(self):
"""
- test_delete_dedicated_host_value_error()
+ test_list_dedicated_host_profiles_required_params()
"""
# Set up mock
- url = preprocess_url('/dedicated_hosts/testString')
+ 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}, "status": "current", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}], "vcpu_architecture": {"type": "fixed", "value": "amd64"}, "vcpu_count": {"type": "fixed", "value": 16}, "vcpu_manufacturer": {"type": "fixed", "value": "intel"}}], "total_count": 132}'
responses.add(
- responses.DELETE,
+ responses.GET,
url,
- status=204,
+ body=mock_response,
+ content_type='application/json',
+ status=200,
)
- # Set up parameter values
- id = 'testString'
+ # Invoke method
+ response = _service.list_dedicated_host_profiles()
+
+ # Check for correct operation
+ assert len(responses.calls) == 1
+ assert response.status_code == 200
+
+ def test_list_dedicated_host_profiles_required_params_with_retries(self):
+ # Enable retries and run test_list_dedicated_host_profiles_required_params.
+ _service.enable_retries()
+ self.test_list_dedicated_host_profiles_required_params()
+
+ # Disable retries and run test_list_dedicated_host_profiles_required_params.
+ _service.disable_retries()
+ self.test_list_dedicated_host_profiles_required_params()
+
+ @responses.activate
+ def test_list_dedicated_host_profiles_value_error(self):
+ """
+ test_list_dedicated_host_profiles_value_error()
+ """
+ # Set up mock
+ url = preprocess_url('/dedicated_host/profiles')
+ mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/profiles?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/profiles?start=9da91&limit=20"}, "profiles": [{"class": "mx2", "disks": [{"interface_type": {"type": "fixed", "value": "nvme"}, "quantity": {"type": "fixed", "value": 4}, "size": {"type": "fixed", "value": 3200}, "supported_instance_interface_types": {"type": "fixed", "value": ["nvme"]}}], "family": "balanced", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "memory": {"type": "fixed", "value": 16}, "name": "mx2-host-152x1216", "socket_count": {"type": "fixed", "value": 2}, "status": "current", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}], "vcpu_architecture": {"type": "fixed", "value": "amd64"}, "vcpu_count": {"type": "fixed", "value": 16}, "vcpu_manufacturer": {"type": "fixed", "value": "intel"}}], "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 = {
- "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_dedicated_host(**req_copy)
+ _service.list_dedicated_host_profiles(**req_copy)
- def test_delete_dedicated_host_value_error_with_retries(self):
- # Enable retries and run test_delete_dedicated_host_value_error.
+ def test_list_dedicated_host_profiles_value_error_with_retries(self):
+ # Enable retries and run test_list_dedicated_host_profiles_value_error.
_service.enable_retries()
- self.test_delete_dedicated_host_value_error()
+ self.test_list_dedicated_host_profiles_value_error()
- # Disable retries and run test_delete_dedicated_host_value_error.
+ # Disable retries and run test_list_dedicated_host_profiles_value_error.
_service.disable_retries()
- self.test_delete_dedicated_host_value_error()
+ self.test_list_dedicated_host_profiles_value_error()
+
+ @responses.activate
+ def test_list_dedicated_host_profiles_with_pager_get_next(self):
+ """
+ test_list_dedicated_host_profiles_with_pager_get_next()
+ """
+ # Set up a two-page mock response
+ url = preprocess_url('/dedicated_host/profiles')
+ mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"profiles":[{"class":"mx2","disks":[{"interface_type":{"type":"fixed","value":"nvme"},"quantity":{"type":"fixed","value":4},"size":{"type":"fixed","value":3200},"supported_instance_interface_types":{"type":"fixed","value":["nvme"]}}],"family":"balanced","href":"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a","memory":{"type":"fixed","value":16},"name":"mx2-host-152x1216","socket_count":{"type":"fixed","value":2},"status":"current","supported_instance_profiles":[{"href":"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16","name":"bx2-4x16","resource_type":"instance_profile"}],"vcpu_architecture":{"type":"fixed","value":"amd64"},"vcpu_count":{"type":"fixed","value":16},"vcpu_manufacturer":{"type":"fixed","value":"intel"}}]}'
+ mock_response2 = '{"total_count":2,"limit":1,"profiles":[{"class":"mx2","disks":[{"interface_type":{"type":"fixed","value":"nvme"},"quantity":{"type":"fixed","value":4},"size":{"type":"fixed","value":3200},"supported_instance_interface_types":{"type":"fixed","value":["nvme"]}}],"family":"balanced","href":"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a","memory":{"type":"fixed","value":16},"name":"mx2-host-152x1216","socket_count":{"type":"fixed","value":2},"status":"current","supported_instance_profiles":[{"href":"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16","name":"bx2-4x16","resource_type":"instance_profile"}],"vcpu_architecture":{"type":"fixed","value":"amd64"},"vcpu_count":{"type":"fixed","value":16},"vcpu_manufacturer":{"type":"fixed","value":"intel"}}]}'
+ responses.add(
+ responses.GET,
+ url,
+ body=mock_response1,
+ content_type='application/json',
+ status=200,
+ )
+ responses.add(
+ responses.GET,
+ url,
+ body=mock_response2,
+ content_type='application/json',
+ status=200,
+ )
+ # Exercise the pager class for this operation
+ all_results = []
+ pager = DedicatedHostProfilesPager(
+ client=_service,
+ limit=10,
+ )
+ while pager.has_next():
+ next_page = pager.get_next()
+ assert next_page is not None
+ all_results.extend(next_page)
+ assert len(all_results) == 2
-class TestGetDedicatedHost:
+ @responses.activate
+ def test_list_dedicated_host_profiles_with_pager_get_all(self):
+ """
+ test_list_dedicated_host_profiles_with_pager_get_all()
+ """
+ # Set up a two-page mock response
+ url = preprocess_url('/dedicated_host/profiles')
+ mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"profiles":[{"class":"mx2","disks":[{"interface_type":{"type":"fixed","value":"nvme"},"quantity":{"type":"fixed","value":4},"size":{"type":"fixed","value":3200},"supported_instance_interface_types":{"type":"fixed","value":["nvme"]}}],"family":"balanced","href":"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a","memory":{"type":"fixed","value":16},"name":"mx2-host-152x1216","socket_count":{"type":"fixed","value":2},"status":"current","supported_instance_profiles":[{"href":"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16","name":"bx2-4x16","resource_type":"instance_profile"}],"vcpu_architecture":{"type":"fixed","value":"amd64"},"vcpu_count":{"type":"fixed","value":16},"vcpu_manufacturer":{"type":"fixed","value":"intel"}}]}'
+ mock_response2 = '{"total_count":2,"limit":1,"profiles":[{"class":"mx2","disks":[{"interface_type":{"type":"fixed","value":"nvme"},"quantity":{"type":"fixed","value":4},"size":{"type":"fixed","value":3200},"supported_instance_interface_types":{"type":"fixed","value":["nvme"]}}],"family":"balanced","href":"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a","memory":{"type":"fixed","value":16},"name":"mx2-host-152x1216","socket_count":{"type":"fixed","value":2},"status":"current","supported_instance_profiles":[{"href":"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16","name":"bx2-4x16","resource_type":"instance_profile"}],"vcpu_architecture":{"type":"fixed","value":"amd64"},"vcpu_count":{"type":"fixed","value":16},"vcpu_manufacturer":{"type":"fixed","value":"intel"}}]}'
+ responses.add(
+ responses.GET,
+ url,
+ body=mock_response1,
+ content_type='application/json',
+ status=200,
+ )
+ responses.add(
+ responses.GET,
+ url,
+ body=mock_response2,
+ content_type='application/json',
+ status=200,
+ )
+
+ # Exercise the pager class for this operation
+ pager = DedicatedHostProfilesPager(
+ client=_service,
+ limit=10,
+ )
+ all_results = pager.get_all()
+ assert all_results is not None
+ assert len(all_results) == 2
+
+
+class TestGetDedicatedHostProfile:
"""
- Test Class for get_dedicated_host
+ Test Class for get_dedicated_host_profile
"""
@responses.activate
- def test_get_dedicated_host_all_params(self):
+ def test_get_dedicated_host_profile_all_params(self):
"""
- get_dedicated_host()
+ get_dedicated_host_profile()
"""
# Set up mock
- url = preprocess_url('/dedicated_hosts/testString')
- mock_response = '{"available_memory": 128, "available_vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "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", "numa": {"count": 2, "nodes": [{"available_vcpu": 24, "vcpu": 56}]}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "mx2-host-152x1216"}, "provisionable": false, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "dedicated_host", "socket_count": 4, "state": "available", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16"}], "vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
+ 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}, "status": "current", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}], "vcpu_architecture": {"type": "fixed", "value": "amd64"}, "vcpu_count": {"type": "fixed", "value": 16}, "vcpu_manufacturer": {"type": "fixed", "value": "intel"}}'
responses.add(
responses.GET,
url,
@@ -16838,11 +17795,11 @@ def test_get_dedicated_host_all_params(self):
)
# Set up parameter values
- id = 'testString'
+ name = 'testString'
# Invoke method
- response = _service.get_dedicated_host(
- id,
+ response = _service.get_dedicated_host_profile(
+ name,
headers={},
)
@@ -16850,23 +17807,23 @@ def test_get_dedicated_host_all_params(self):
assert len(responses.calls) == 1
assert response.status_code == 200
- def test_get_dedicated_host_all_params_with_retries(self):
- # Enable retries and run test_get_dedicated_host_all_params.
+ def test_get_dedicated_host_profile_all_params_with_retries(self):
+ # Enable retries and run test_get_dedicated_host_profile_all_params.
_service.enable_retries()
- self.test_get_dedicated_host_all_params()
+ self.test_get_dedicated_host_profile_all_params()
- # Disable retries and run test_get_dedicated_host_all_params.
+ # Disable retries and run test_get_dedicated_host_profile_all_params.
_service.disable_retries()
- self.test_get_dedicated_host_all_params()
+ self.test_get_dedicated_host_profile_all_params()
@responses.activate
- def test_get_dedicated_host_value_error(self):
+ def test_get_dedicated_host_profile_value_error(self):
"""
- test_get_dedicated_host_value_error()
+ test_get_dedicated_host_profile_value_error()
"""
# Set up mock
- url = preprocess_url('/dedicated_hosts/testString')
- mock_response = '{"available_memory": 128, "available_vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "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", "numa": {"count": 2, "nodes": [{"available_vcpu": 24, "vcpu": 56}]}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "mx2-host-152x1216"}, "provisionable": false, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "dedicated_host", "socket_count": 4, "state": "available", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16"}], "vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
+ 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}, "status": "current", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}], "vcpu_architecture": {"type": "fixed", "value": "amd64"}, "vcpu_count": {"type": "fixed", "value": 16}, "vcpu_manufacturer": {"type": "fixed", "value": "intel"}}'
responses.add(
responses.GET,
url,
@@ -16876,217 +17833,64 @@ def test_get_dedicated_host_value_error(self):
)
# Set up parameter values
- id = 'testString'
+ name = 'testString'
# Pass in all but one required param and check for a ValueError
req_param_dict = {
- "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.get_dedicated_host(**req_copy)
+ _service.get_dedicated_host_profile(**req_copy)
- def test_get_dedicated_host_value_error_with_retries(self):
- # Enable retries and run test_get_dedicated_host_value_error.
+ def test_get_dedicated_host_profile_value_error_with_retries(self):
+ # Enable retries and run test_get_dedicated_host_profile_value_error.
_service.enable_retries()
- self.test_get_dedicated_host_value_error()
+ self.test_get_dedicated_host_profile_value_error()
- # Disable retries and run test_get_dedicated_host_value_error.
+ # Disable retries and run test_get_dedicated_host_profile_value_error.
_service.disable_retries()
- self.test_get_dedicated_host_value_error()
+ self.test_get_dedicated_host_profile_value_error()
-class TestUpdateDedicatedHost:
+class TestListDedicatedHosts:
"""
- Test Class for update_dedicated_host
+ Test Class for list_dedicated_hosts
"""
@responses.activate
- def test_update_dedicated_host_all_params(self):
+ def test_list_dedicated_hosts_all_params(self):
"""
- update_dedicated_host()
+ list_dedicated_hosts()
"""
# Set up mock
- url = preprocess_url('/dedicated_hosts/testString')
- mock_response = '{"available_memory": 128, "available_vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "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", "numa": {"count": 2, "nodes": [{"available_vcpu": 24, "vcpu": 56}]}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "mx2-host-152x1216"}, "provisionable": false, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "dedicated_host", "socket_count": 4, "state": "available", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16"}], "vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
+ url = preprocess_url('/dedicated_hosts')
+ mock_response = '{"dedicated_hosts": [{"available_memory": 128, "available_vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "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", "numa": {"count": 2, "nodes": [{"available_vcpu": 24, "vcpu": 56}]}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "mx2-host-152x1216"}, "provisionable": false, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "dedicated_host", "socket_count": 4, "state": "available", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}], "vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "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.PATCH,
+ responses.GET,
url,
body=mock_response,
content_type='application/json',
status=200,
)
- # Construct a dict representation of a DedicatedHostPatch model
- dedicated_host_patch_model = {}
- dedicated_host_patch_model['instance_placement_enabled'] = True
- dedicated_host_patch_model['name'] = 'my-host'
-
# Set up parameter values
- id = 'testString'
- dedicated_host_patch = dedicated_host_patch_model
+ dedicated_host_group_id = 'testString'
+ start = 'testString'
+ limit = 50
+ resource_group_id = 'testString'
+ zone_name = 'us-south-1'
+ name = 'testString'
# Invoke method
- response = _service.update_dedicated_host(
- id,
- dedicated_host_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 == dedicated_host_patch
-
- def test_update_dedicated_host_all_params_with_retries(self):
- # Enable retries and run test_update_dedicated_host_all_params.
- _service.enable_retries()
- self.test_update_dedicated_host_all_params()
-
- # Disable retries and run test_update_dedicated_host_all_params.
- _service.disable_retries()
- self.test_update_dedicated_host_all_params()
-
- @responses.activate
- def test_update_dedicated_host_value_error(self):
- """
- test_update_dedicated_host_value_error()
- """
- # Set up mock
- url = preprocess_url('/dedicated_hosts/testString')
- mock_response = '{"available_memory": 128, "available_vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "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", "numa": {"count": 2, "nodes": [{"available_vcpu": 24, "vcpu": 56}]}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "mx2-host-152x1216"}, "provisionable": false, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "dedicated_host", "socket_count": 4, "state": "available", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16"}], "vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "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 DedicatedHostPatch model
- dedicated_host_patch_model = {}
- dedicated_host_patch_model['instance_placement_enabled'] = True
- dedicated_host_patch_model['name'] = 'my-host'
-
- # Set up parameter values
- id = 'testString'
- dedicated_host_patch = dedicated_host_patch_model
-
- # Pass in all but one required param and check for a ValueError
- req_param_dict = {
- "id": id,
- "dedicated_host_patch": dedicated_host_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_dedicated_host(**req_copy)
-
- def test_update_dedicated_host_value_error_with_retries(self):
- # Enable retries and run test_update_dedicated_host_value_error.
- _service.enable_retries()
- self.test_update_dedicated_host_value_error()
-
- # Disable retries and run test_update_dedicated_host_value_error.
- _service.disable_retries()
- self.test_update_dedicated_host_value_error()
-
-
-# endregion
-##############################################################################
-# End of Service: DedicatedHosts
-##############################################################################
-
-##############################################################################
-# Start of Service: BackupPolicies
-##############################################################################
-# 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 TestListBackupPolicies:
- """
- Test Class for list_backup_policies
- """
-
- @responses.activate
- def test_list_backup_policies_all_params(self):
- """
- list_backup_policies()
- """
- # Set up mock
- url = preprocess_url('/backup_policies')
- mock_response = '{"backup_policies": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::backup-policy:r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "health_reasons": [{"code": "missing_service_authorization_policies", "message": "One or more accounts are missing service authorization policies", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-backup-service-about&interface=ui"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "id": "r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "last_job_completed_at": "2019-01-01T12:00:00.000Z", "lifecycle_state": "stable", "match_resource_types": ["volume"], "match_user_tags": ["match_user_tags"], "name": "my-backup-policy", "plans": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "backup_policy", "scope": {"crn": "crn:v1:bluemix:public:enterprise::a/123456::enterprise:ebc2b430240943458b9e91e1432cfcce", "id": "fee82deba12e4c0fb69c3b09d1f12345", "resource_type": "enterprise"}}], "first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies?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 = 50
- resource_group_id = 'testString'
- name = 'testString'
- tag = 'testString'
-
- # Invoke method
- response = _service.list_backup_policies(
+ response = _service.list_dedicated_hosts(
+ dedicated_host_group_id=dedicated_host_group_id,
start=start,
limit=limit,
resource_group_id=resource_group_id,
+ zone_name=zone_name,
name=name,
- tag=tag,
headers={},
)
@@ -17096,29 +17900,30 @@ def test_list_backup_policies_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 'dedicated_host_group.id={}'.format(dedicated_host_group_id) 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
+ assert 'zone.name={}'.format(zone_name) in query_string
assert 'name={}'.format(name) in query_string
- assert 'tag={}'.format(tag) in query_string
- def test_list_backup_policies_all_params_with_retries(self):
- # Enable retries and run test_list_backup_policies_all_params.
+ def test_list_dedicated_hosts_all_params_with_retries(self):
+ # Enable retries and run test_list_dedicated_hosts_all_params.
_service.enable_retries()
- self.test_list_backup_policies_all_params()
+ self.test_list_dedicated_hosts_all_params()
- # Disable retries and run test_list_backup_policies_all_params.
+ # Disable retries and run test_list_dedicated_hosts_all_params.
_service.disable_retries()
- self.test_list_backup_policies_all_params()
+ self.test_list_dedicated_hosts_all_params()
@responses.activate
- def test_list_backup_policies_required_params(self):
+ def test_list_dedicated_hosts_required_params(self):
"""
- test_list_backup_policies_required_params()
+ test_list_dedicated_hosts_required_params()
"""
# Set up mock
- url = preprocess_url('/backup_policies')
- mock_response = '{"backup_policies": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::backup-policy:r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "health_reasons": [{"code": "missing_service_authorization_policies", "message": "One or more accounts are missing service authorization policies", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-backup-service-about&interface=ui"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "id": "r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "last_job_completed_at": "2019-01-01T12:00:00.000Z", "lifecycle_state": "stable", "match_resource_types": ["volume"], "match_user_tags": ["match_user_tags"], "name": "my-backup-policy", "plans": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "backup_policy", "scope": {"crn": "crn:v1:bluemix:public:enterprise::a/123456::enterprise:ebc2b430240943458b9e91e1432cfcce", "id": "fee82deba12e4c0fb69c3b09d1f12345", "resource_type": "enterprise"}}], "first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}'
+ url = preprocess_url('/dedicated_hosts')
+ mock_response = '{"dedicated_hosts": [{"available_memory": 128, "available_vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "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", "numa": {"count": 2, "nodes": [{"available_vcpu": 24, "vcpu": 56}]}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "mx2-host-152x1216"}, "provisionable": false, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "dedicated_host", "socket_count": 4, "state": "available", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}], "vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "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,
@@ -17128,29 +17933,29 @@ def test_list_backup_policies_required_params(self):
)
# Invoke method
- response = _service.list_backup_policies()
+ response = _service.list_dedicated_hosts()
# Check for correct operation
assert len(responses.calls) == 1
assert response.status_code == 200
- def test_list_backup_policies_required_params_with_retries(self):
- # Enable retries and run test_list_backup_policies_required_params.
+ def test_list_dedicated_hosts_required_params_with_retries(self):
+ # Enable retries and run test_list_dedicated_hosts_required_params.
_service.enable_retries()
- self.test_list_backup_policies_required_params()
+ self.test_list_dedicated_hosts_required_params()
- # Disable retries and run test_list_backup_policies_required_params.
+ # Disable retries and run test_list_dedicated_hosts_required_params.
_service.disable_retries()
- self.test_list_backup_policies_required_params()
+ self.test_list_dedicated_hosts_required_params()
@responses.activate
- def test_list_backup_policies_value_error(self):
+ def test_list_dedicated_hosts_value_error(self):
"""
- test_list_backup_policies_value_error()
+ test_list_dedicated_hosts_value_error()
"""
# Set up mock
- url = preprocess_url('/backup_policies')
- mock_response = '{"backup_policies": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::backup-policy:r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "health_reasons": [{"code": "missing_service_authorization_policies", "message": "One or more accounts are missing service authorization policies", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-backup-service-about&interface=ui"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "id": "r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "last_job_completed_at": "2019-01-01T12:00:00.000Z", "lifecycle_state": "stable", "match_resource_types": ["volume"], "match_user_tags": ["match_user_tags"], "name": "my-backup-policy", "plans": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "backup_policy", "scope": {"crn": "crn:v1:bluemix:public:enterprise::a/123456::enterprise:ebc2b430240943458b9e91e1432cfcce", "id": "fee82deba12e4c0fb69c3b09d1f12345", "resource_type": "enterprise"}}], "first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}'
+ url = preprocess_url('/dedicated_hosts')
+ mock_response = '{"dedicated_hosts": [{"available_memory": 128, "available_vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "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", "numa": {"count": 2, "nodes": [{"available_vcpu": 24, "vcpu": 56}]}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "mx2-host-152x1216"}, "provisionable": false, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "dedicated_host", "socket_count": 4, "state": "available", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}], "vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "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,
@@ -17165,26 +17970,26 @@ def test_list_backup_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_backup_policies(**req_copy)
+ _service.list_dedicated_hosts(**req_copy)
- def test_list_backup_policies_value_error_with_retries(self):
- # Enable retries and run test_list_backup_policies_value_error.
+ def test_list_dedicated_hosts_value_error_with_retries(self):
+ # Enable retries and run test_list_dedicated_hosts_value_error.
_service.enable_retries()
- self.test_list_backup_policies_value_error()
+ self.test_list_dedicated_hosts_value_error()
- # Disable retries and run test_list_backup_policies_value_error.
+ # Disable retries and run test_list_dedicated_hosts_value_error.
_service.disable_retries()
- self.test_list_backup_policies_value_error()
+ self.test_list_dedicated_hosts_value_error()
@responses.activate
- def test_list_backup_policies_with_pager_get_next(self):
+ def test_list_dedicated_hosts_with_pager_get_next(self):
"""
- test_list_backup_policies_with_pager_get_next()
+ test_list_dedicated_hosts_with_pager_get_next()
"""
# Set up a two-page mock response
- url = preprocess_url('/backup_policies')
- mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"backup_policies":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::backup-policy:r134-076191ba-49c2-4763-94fd-c70de73ee2e6","health_reasons":[{"code":"missing_service_authorization_policies","message":"One or more accounts are missing service authorization policies","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-backup-service-about&interface=ui"}],"health_state":"ok","href":"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6","id":"r134-076191ba-49c2-4763-94fd-c70de73ee2e6","last_job_completed_at":"2019-01-01T12:00:00.000Z","lifecycle_state":"stable","match_resource_types":["volume"],"match_user_tags":["match_user_tags"],"name":"my-backup-policy","plans":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178","id":"r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178","name":"my-policy-plan","remote":{"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"backup_policy_plan"}],"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"backup_policy","scope":{"crn":"crn:v1:bluemix:public:enterprise::a/123456::enterprise:ebc2b430240943458b9e91e1432cfcce","id":"fee82deba12e4c0fb69c3b09d1f12345","resource_type":"enterprise"}}],"total_count":2,"limit":1}'
- mock_response2 = '{"backup_policies":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::backup-policy:r134-076191ba-49c2-4763-94fd-c70de73ee2e6","health_reasons":[{"code":"missing_service_authorization_policies","message":"One or more accounts are missing service authorization policies","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-backup-service-about&interface=ui"}],"health_state":"ok","href":"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6","id":"r134-076191ba-49c2-4763-94fd-c70de73ee2e6","last_job_completed_at":"2019-01-01T12:00:00.000Z","lifecycle_state":"stable","match_resource_types":["volume"],"match_user_tags":["match_user_tags"],"name":"my-backup-policy","plans":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178","id":"r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178","name":"my-policy-plan","remote":{"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"backup_policy_plan"}],"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"backup_policy","scope":{"crn":"crn:v1:bluemix:public:enterprise::a/123456::enterprise:ebc2b430240943458b9e91e1432cfcce","id":"fee82deba12e4c0fb69c3b09d1f12345","resource_type":"enterprise"}}],"total_count":2,"limit":1}'
+ url = preprocess_url('/dedicated_hosts')
+ mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"dedicated_hosts":[{"available_memory":128,"available_vcpu":{"architecture":"amd64","count":4,"manufacturer":"intel"},"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","numa":{"count":2,"nodes":[{"available_vcpu":24,"vcpu":56}]},"profile":{"href":"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a","name":"mx2-host-152x1216"},"provisionable":false,"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"dedicated_host","socket_count":4,"state":"available","supported_instance_profiles":[{"href":"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16","name":"bx2-4x16","resource_type":"instance_profile"}],"vcpu":{"architecture":"amd64","count":4,"manufacturer":"intel"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"total_count":2,"limit":1}'
+ mock_response2 = '{"dedicated_hosts":[{"available_memory":128,"available_vcpu":{"architecture":"amd64","count":4,"manufacturer":"intel"},"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","numa":{"count":2,"nodes":[{"available_vcpu":24,"vcpu":56}]},"profile":{"href":"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a","name":"mx2-host-152x1216"},"provisionable":false,"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"dedicated_host","socket_count":4,"state":"available","supported_instance_profiles":[{"href":"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16","name":"bx2-4x16","resource_type":"instance_profile"}],"vcpu":{"architecture":"amd64","count":4,"manufacturer":"intel"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"total_count":2,"limit":1}'
responses.add(
responses.GET,
url,
@@ -17202,12 +18007,13 @@ def test_list_backup_policies_with_pager_get_next(self):
# Exercise the pager class for this operation
all_results = []
- pager = BackupPoliciesPager(
+ pager = DedicatedHostsPager(
client=_service,
+ dedicated_host_group_id='testString',
limit=10,
resource_group_id='testString',
+ zone_name='us-south-1',
name='testString',
- tag='testString',
)
while pager.has_next():
next_page = pager.get_next()
@@ -17216,14 +18022,14 @@ def test_list_backup_policies_with_pager_get_next(self):
assert len(all_results) == 2
@responses.activate
- def test_list_backup_policies_with_pager_get_all(self):
+ def test_list_dedicated_hosts_with_pager_get_all(self):
"""
- test_list_backup_policies_with_pager_get_all()
+ test_list_dedicated_hosts_with_pager_get_all()
"""
# Set up a two-page mock response
- url = preprocess_url('/backup_policies')
- mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"backup_policies":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::backup-policy:r134-076191ba-49c2-4763-94fd-c70de73ee2e6","health_reasons":[{"code":"missing_service_authorization_policies","message":"One or more accounts are missing service authorization policies","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-backup-service-about&interface=ui"}],"health_state":"ok","href":"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6","id":"r134-076191ba-49c2-4763-94fd-c70de73ee2e6","last_job_completed_at":"2019-01-01T12:00:00.000Z","lifecycle_state":"stable","match_resource_types":["volume"],"match_user_tags":["match_user_tags"],"name":"my-backup-policy","plans":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178","id":"r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178","name":"my-policy-plan","remote":{"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"backup_policy_plan"}],"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"backup_policy","scope":{"crn":"crn:v1:bluemix:public:enterprise::a/123456::enterprise:ebc2b430240943458b9e91e1432cfcce","id":"fee82deba12e4c0fb69c3b09d1f12345","resource_type":"enterprise"}}],"total_count":2,"limit":1}'
- mock_response2 = '{"backup_policies":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::backup-policy:r134-076191ba-49c2-4763-94fd-c70de73ee2e6","health_reasons":[{"code":"missing_service_authorization_policies","message":"One or more accounts are missing service authorization policies","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-backup-service-about&interface=ui"}],"health_state":"ok","href":"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6","id":"r134-076191ba-49c2-4763-94fd-c70de73ee2e6","last_job_completed_at":"2019-01-01T12:00:00.000Z","lifecycle_state":"stable","match_resource_types":["volume"],"match_user_tags":["match_user_tags"],"name":"my-backup-policy","plans":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178","id":"r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178","name":"my-policy-plan","remote":{"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"backup_policy_plan"}],"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"backup_policy","scope":{"crn":"crn:v1:bluemix:public:enterprise::a/123456::enterprise:ebc2b430240943458b9e91e1432cfcce","id":"fee82deba12e4c0fb69c3b09d1f12345","resource_type":"enterprise"}}],"total_count":2,"limit":1}'
+ url = preprocess_url('/dedicated_hosts')
+ mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"dedicated_hosts":[{"available_memory":128,"available_vcpu":{"architecture":"amd64","count":4,"manufacturer":"intel"},"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","numa":{"count":2,"nodes":[{"available_vcpu":24,"vcpu":56}]},"profile":{"href":"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a","name":"mx2-host-152x1216"},"provisionable":false,"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"dedicated_host","socket_count":4,"state":"available","supported_instance_profiles":[{"href":"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16","name":"bx2-4x16","resource_type":"instance_profile"}],"vcpu":{"architecture":"amd64","count":4,"manufacturer":"intel"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"total_count":2,"limit":1}'
+ mock_response2 = '{"dedicated_hosts":[{"available_memory":128,"available_vcpu":{"architecture":"amd64","count":4,"manufacturer":"intel"},"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","numa":{"count":2,"nodes":[{"available_vcpu":24,"vcpu":56}]},"profile":{"href":"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a","name":"mx2-host-152x1216"},"provisionable":false,"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"dedicated_host","socket_count":4,"state":"available","supported_instance_profiles":[{"href":"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16","name":"bx2-4x16","resource_type":"instance_profile"}],"vcpu":{"architecture":"amd64","count":4,"manufacturer":"intel"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"total_count":2,"limit":1}'
responses.add(
responses.GET,
url,
@@ -17240,31 +18046,32 @@ def test_list_backup_policies_with_pager_get_all(self):
)
# Exercise the pager class for this operation
- pager = BackupPoliciesPager(
+ pager = DedicatedHostsPager(
client=_service,
+ dedicated_host_group_id='testString',
limit=10,
resource_group_id='testString',
+ zone_name='us-south-1',
name='testString',
- tag='testString',
)
all_results = pager.get_all()
assert all_results is not None
assert len(all_results) == 2
-class TestCreateBackupPolicy:
+class TestCreateDedicatedHost:
"""
- Test Class for create_backup_policy
+ Test Class for create_dedicated_host
"""
@responses.activate
- def test_create_backup_policy_all_params(self):
+ def test_create_dedicated_host_all_params(self):
"""
- create_backup_policy()
+ create_dedicated_host()
"""
# Set up mock
- url = preprocess_url('/backup_policies')
- mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::backup-policy:r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "health_reasons": [{"code": "missing_service_authorization_policies", "message": "One or more accounts are missing service authorization policies", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-backup-service-about&interface=ui"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "id": "r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "last_job_completed_at": "2019-01-01T12:00:00.000Z", "lifecycle_state": "stable", "match_resource_types": ["volume"], "match_user_tags": ["match_user_tags"], "name": "my-backup-policy", "plans": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "backup_policy", "scope": {"crn": "crn:v1:bluemix:public:enterprise::a/123456::enterprise:ebc2b430240943458b9e91e1432cfcce", "id": "fee82deba12e4c0fb69c3b09d1f12345", "resource_type": "enterprise"}}'
+ url = preprocess_url('/dedicated_hosts')
+ mock_response = '{"available_memory": 128, "available_vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "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", "numa": {"count": 2, "nodes": [{"available_vcpu": 24, "vcpu": 56}]}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "mx2-host-152x1216"}, "provisionable": false, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "dedicated_host", "socket_count": 4, "state": "available", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}], "vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "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,
@@ -17273,69 +18080,32 @@ def test_create_backup_policy_all_params(self):
status=201,
)
- # Construct a dict representation of a ZoneIdentityByName model
- zone_identity_model = {}
- zone_identity_model['name'] = 'us-south-1'
-
- # Construct a dict representation of a BackupPolicyPlanClonePolicyPrototype model
- backup_policy_plan_clone_policy_prototype_model = {}
- backup_policy_plan_clone_policy_prototype_model['max_snapshots'] = 5
- backup_policy_plan_clone_policy_prototype_model['zones'] = [zone_identity_model]
-
- # Construct a dict representation of a BackupPolicyPlanDeletionTriggerPrototype model
- backup_policy_plan_deletion_trigger_prototype_model = {}
- backup_policy_plan_deletion_trigger_prototype_model['delete_after'] = 20
- backup_policy_plan_deletion_trigger_prototype_model['delete_over_count'] = 20
-
- # 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/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179'
-
- # Construct a dict representation of a RegionIdentityByName model
- region_identity_model = {}
- region_identity_model['name'] = 'us-south'
-
- # Construct a dict representation of a BackupPolicyPlanRemoteRegionPolicyPrototype model
- backup_policy_plan_remote_region_policy_prototype_model = {}
- backup_policy_plan_remote_region_policy_prototype_model['delete_over_count'] = 5
- backup_policy_plan_remote_region_policy_prototype_model['encryption_key'] = encryption_key_identity_model
- backup_policy_plan_remote_region_policy_prototype_model['region'] = region_identity_model
-
- # Construct a dict representation of a BackupPolicyPlanPrototype model
- backup_policy_plan_prototype_model = {}
- backup_policy_plan_prototype_model['active'] = True
- backup_policy_plan_prototype_model['attach_user_tags'] = ['my-daily-backup-plan']
- backup_policy_plan_prototype_model['clone_policy'] = backup_policy_plan_clone_policy_prototype_model
- backup_policy_plan_prototype_model['copy_user_tags'] = True
- backup_policy_plan_prototype_model['cron_spec'] = '30 */2 * * 1-5'
- backup_policy_plan_prototype_model['deletion_trigger'] = backup_policy_plan_deletion_trigger_prototype_model
- backup_policy_plan_prototype_model['name'] = 'my-policy-plan'
- backup_policy_plan_prototype_model['remote_region_policies'] = [backup_policy_plan_remote_region_policy_prototype_model]
+ # Construct a dict representation of a DedicatedHostProfileIdentityByName model
+ dedicated_host_profile_identity_model = {}
+ dedicated_host_profile_identity_model['name'] = 'm-62x496'
# Construct a dict representation of a ResourceGroupIdentityById model
resource_group_identity_model = {}
resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
- # Construct a dict representation of a BackupPolicyScopePrototypeEnterpriseIdentityEnterpriseIdentityByCRN model
- backup_policy_scope_prototype_model = {}
- backup_policy_scope_prototype_model['crn'] = 'crn:v1:bluemix:public:enterprise::a/123456::enterprise:ebc2b430240943458b9e91e1432cfcce'
+ # Construct a dict representation of a DedicatedHostGroupIdentityById model
+ dedicated_host_group_identity_model = {}
+ dedicated_host_group_identity_model['id'] = '0c8eccb4-271c-4518-956c-32bfce5cf83b'
+
+ # Construct a dict representation of a DedicatedHostPrototypeDedicatedHostByGroup model
+ dedicated_host_prototype_model = {}
+ dedicated_host_prototype_model['instance_placement_enabled'] = True
+ dedicated_host_prototype_model['name'] = 'my-host'
+ dedicated_host_prototype_model['profile'] = dedicated_host_profile_identity_model
+ dedicated_host_prototype_model['resource_group'] = resource_group_identity_model
+ dedicated_host_prototype_model['group'] = dedicated_host_group_identity_model
# Set up parameter values
- match_user_tags = ['my-daily-backup-policy']
- match_resource_types = ['volume']
- name = 'my-backup-policy'
- plans = [backup_policy_plan_prototype_model]
- resource_group = resource_group_identity_model
- scope = backup_policy_scope_prototype_model
+ dedicated_host_prototype = dedicated_host_prototype_model
# Invoke method
- response = _service.create_backup_policy(
- match_user_tags,
- match_resource_types=match_resource_types,
- name=name,
- plans=plans,
- resource_group=resource_group,
- scope=scope,
+ response = _service.create_dedicated_host(
+ dedicated_host_prototype,
headers={},
)
@@ -17344,30 +18114,25 @@ def test_create_backup_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['match_user_tags'] == ['my-daily-backup-policy']
- assert req_body['match_resource_types'] == ['volume']
- assert req_body['name'] == 'my-backup-policy'
- assert req_body['plans'] == [backup_policy_plan_prototype_model]
- assert req_body['resource_group'] == resource_group_identity_model
- assert req_body['scope'] == backup_policy_scope_prototype_model
+ assert req_body == dedicated_host_prototype
- def test_create_backup_policy_all_params_with_retries(self):
- # Enable retries and run test_create_backup_policy_all_params.
+ def test_create_dedicated_host_all_params_with_retries(self):
+ # Enable retries and run test_create_dedicated_host_all_params.
_service.enable_retries()
- self.test_create_backup_policy_all_params()
+ self.test_create_dedicated_host_all_params()
- # Disable retries and run test_create_backup_policy_all_params.
+ # Disable retries and run test_create_dedicated_host_all_params.
_service.disable_retries()
- self.test_create_backup_policy_all_params()
+ self.test_create_dedicated_host_all_params()
@responses.activate
- def test_create_backup_policy_value_error(self):
+ def test_create_dedicated_host_value_error(self):
"""
- test_create_backup_policy_value_error()
+ test_create_dedicated_host_value_error()
"""
# Set up mock
- url = preprocess_url('/backup_policies')
- mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::backup-policy:r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "health_reasons": [{"code": "missing_service_authorization_policies", "message": "One or more accounts are missing service authorization policies", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-backup-service-about&interface=ui"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "id": "r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "last_job_completed_at": "2019-01-01T12:00:00.000Z", "lifecycle_state": "stable", "match_resource_types": ["volume"], "match_user_tags": ["match_user_tags"], "name": "my-backup-policy", "plans": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "backup_policy", "scope": {"crn": "crn:v1:bluemix:public:enterprise::a/123456::enterprise:ebc2b430240943458b9e91e1432cfcce", "id": "fee82deba12e4c0fb69c3b09d1f12345", "resource_type": "enterprise"}}'
+ url = preprocess_url('/dedicated_hosts')
+ mock_response = '{"available_memory": 128, "available_vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "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", "numa": {"count": 2, "nodes": [{"available_vcpu": 24, "vcpu": 56}]}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "mx2-host-152x1216"}, "provisionable": false, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "dedicated_host", "socket_count": 4, "state": "available", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}], "vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "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,
@@ -17376,93 +18141,61 @@ def test_create_backup_policy_value_error(self):
status=201,
)
- # Construct a dict representation of a ZoneIdentityByName model
- zone_identity_model = {}
- zone_identity_model['name'] = 'us-south-1'
-
- # Construct a dict representation of a BackupPolicyPlanClonePolicyPrototype model
- backup_policy_plan_clone_policy_prototype_model = {}
- backup_policy_plan_clone_policy_prototype_model['max_snapshots'] = 5
- backup_policy_plan_clone_policy_prototype_model['zones'] = [zone_identity_model]
-
- # Construct a dict representation of a BackupPolicyPlanDeletionTriggerPrototype model
- backup_policy_plan_deletion_trigger_prototype_model = {}
- backup_policy_plan_deletion_trigger_prototype_model['delete_after'] = 20
- backup_policy_plan_deletion_trigger_prototype_model['delete_over_count'] = 20
-
- # 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/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179'
-
- # Construct a dict representation of a RegionIdentityByName model
- region_identity_model = {}
- region_identity_model['name'] = 'us-south'
-
- # Construct a dict representation of a BackupPolicyPlanRemoteRegionPolicyPrototype model
- backup_policy_plan_remote_region_policy_prototype_model = {}
- backup_policy_plan_remote_region_policy_prototype_model['delete_over_count'] = 5
- backup_policy_plan_remote_region_policy_prototype_model['encryption_key'] = encryption_key_identity_model
- backup_policy_plan_remote_region_policy_prototype_model['region'] = region_identity_model
-
- # Construct a dict representation of a BackupPolicyPlanPrototype model
- backup_policy_plan_prototype_model = {}
- backup_policy_plan_prototype_model['active'] = True
- backup_policy_plan_prototype_model['attach_user_tags'] = ['my-daily-backup-plan']
- backup_policy_plan_prototype_model['clone_policy'] = backup_policy_plan_clone_policy_prototype_model
- backup_policy_plan_prototype_model['copy_user_tags'] = True
- backup_policy_plan_prototype_model['cron_spec'] = '30 */2 * * 1-5'
- backup_policy_plan_prototype_model['deletion_trigger'] = backup_policy_plan_deletion_trigger_prototype_model
- backup_policy_plan_prototype_model['name'] = 'my-policy-plan'
- backup_policy_plan_prototype_model['remote_region_policies'] = [backup_policy_plan_remote_region_policy_prototype_model]
+ # Construct a dict representation of a DedicatedHostProfileIdentityByName model
+ dedicated_host_profile_identity_model = {}
+ dedicated_host_profile_identity_model['name'] = 'm-62x496'
# Construct a dict representation of a ResourceGroupIdentityById model
resource_group_identity_model = {}
resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
- # Construct a dict representation of a BackupPolicyScopePrototypeEnterpriseIdentityEnterpriseIdentityByCRN model
- backup_policy_scope_prototype_model = {}
- backup_policy_scope_prototype_model['crn'] = 'crn:v1:bluemix:public:enterprise::a/123456::enterprise:ebc2b430240943458b9e91e1432cfcce'
+ # Construct a dict representation of a DedicatedHostGroupIdentityById model
+ dedicated_host_group_identity_model = {}
+ dedicated_host_group_identity_model['id'] = '0c8eccb4-271c-4518-956c-32bfce5cf83b'
+
+ # Construct a dict representation of a DedicatedHostPrototypeDedicatedHostByGroup model
+ dedicated_host_prototype_model = {}
+ dedicated_host_prototype_model['instance_placement_enabled'] = True
+ dedicated_host_prototype_model['name'] = 'my-host'
+ dedicated_host_prototype_model['profile'] = dedicated_host_profile_identity_model
+ dedicated_host_prototype_model['resource_group'] = resource_group_identity_model
+ dedicated_host_prototype_model['group'] = dedicated_host_group_identity_model
# Set up parameter values
- match_user_tags = ['my-daily-backup-policy']
- match_resource_types = ['volume']
- name = 'my-backup-policy'
- plans = [backup_policy_plan_prototype_model]
- resource_group = resource_group_identity_model
- scope = backup_policy_scope_prototype_model
+ dedicated_host_prototype = dedicated_host_prototype_model
# Pass in all but one required param and check for a ValueError
req_param_dict = {
- "match_user_tags": match_user_tags,
+ "dedicated_host_prototype": dedicated_host_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_backup_policy(**req_copy)
+ _service.create_dedicated_host(**req_copy)
- def test_create_backup_policy_value_error_with_retries(self):
- # Enable retries and run test_create_backup_policy_value_error.
+ def test_create_dedicated_host_value_error_with_retries(self):
+ # Enable retries and run test_create_dedicated_host_value_error.
_service.enable_retries()
- self.test_create_backup_policy_value_error()
+ self.test_create_dedicated_host_value_error()
- # Disable retries and run test_create_backup_policy_value_error.
+ # Disable retries and run test_create_dedicated_host_value_error.
_service.disable_retries()
- self.test_create_backup_policy_value_error()
+ self.test_create_dedicated_host_value_error()
-class TestListBackupPolicyJobs:
+class TestListDedicatedHostDisks:
"""
- Test Class for list_backup_policy_jobs
+ Test Class for list_dedicated_host_disks
"""
@responses.activate
- def test_list_backup_policy_jobs_all_params(self):
+ def test_list_dedicated_host_disks_all_params(self):
"""
- list_backup_policy_jobs()
+ list_dedicated_host_disks()
"""
# Set up mock
- url = preprocess_url('/backup_policies/testString/jobs')
- mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/7241e2a8-601f-11ea-8503-000c29475bed/jobs?limit=20"}, "jobs": [{"auto_delete": true, "auto_delete_after": 90, "backup_policy_plan": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}, "completed_at": "2019-01-01T12:00:00.000Z", "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/0fe9e5d8-0a4d-4818-96ec-e99708644a58/jobs/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "job_type": "creation", "resource_type": "backup_policy_job", "source": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "volume"}, "status": "failed", "status_reasons": [{"code": "source_volume_busy", "message": "message", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-troubleshooting-backup-for-vpc"}], "target_snapshots": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}]}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/7241e2a8-601f-11ea-8503-000c29475bed/jobss?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}'
+ 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,
@@ -17472,62 +18205,35 @@ def test_list_backup_policy_jobs_all_params(self):
)
# Set up parameter values
- backup_policy_id = 'testString'
- status = 'failed'
- backup_policy_plan_id = 'testString'
- start = 'testString'
- limit = 50
- sort = 'name'
- source_id = 'testString'
- target_snapshots_id = 'testString'
- target_snapshots_crn = 'crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263'
+ dedicated_host_id = 'testString'
# Invoke method
- response = _service.list_backup_policy_jobs(
- backup_policy_id,
- status=status,
- backup_policy_plan_id=backup_policy_plan_id,
- start=start,
- limit=limit,
- sort=sort,
- source_id=source_id,
- target_snapshots_id=target_snapshots_id,
- target_snapshots_crn=target_snapshots_crn,
+ response = _service.list_dedicated_host_disks(
+ dedicated_host_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 'status={}'.format(status) in query_string
- assert 'backup_policy_plan.id={}'.format(backup_policy_plan_id) in query_string
- assert 'start={}'.format(start) in query_string
- assert 'limit={}'.format(limit) in query_string
- assert 'sort={}'.format(sort) in query_string
- assert 'source.id={}'.format(source_id) in query_string
- assert 'target_snapshots[].id={}'.format(target_snapshots_id) in query_string
- assert 'target_snapshots[].crn={}'.format(target_snapshots_crn) in query_string
- def test_list_backup_policy_jobs_all_params_with_retries(self):
- # Enable retries and run test_list_backup_policy_jobs_all_params.
+ def test_list_dedicated_host_disks_all_params_with_retries(self):
+ # Enable retries and run test_list_dedicated_host_disks_all_params.
_service.enable_retries()
- self.test_list_backup_policy_jobs_all_params()
+ self.test_list_dedicated_host_disks_all_params()
- # Disable retries and run test_list_backup_policy_jobs_all_params.
+ # Disable retries and run test_list_dedicated_host_disks_all_params.
_service.disable_retries()
- self.test_list_backup_policy_jobs_all_params()
+ self.test_list_dedicated_host_disks_all_params()
@responses.activate
- def test_list_backup_policy_jobs_required_params(self):
+ def test_list_dedicated_host_disks_value_error(self):
"""
- test_list_backup_policy_jobs_required_params()
+ test_list_dedicated_host_disks_value_error()
"""
# Set up mock
- url = preprocess_url('/backup_policies/testString/jobs')
- mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/7241e2a8-601f-11ea-8503-000c29475bed/jobs?limit=20"}, "jobs": [{"auto_delete": true, "auto_delete_after": 90, "backup_policy_plan": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}, "completed_at": "2019-01-01T12:00:00.000Z", "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/0fe9e5d8-0a4d-4818-96ec-e99708644a58/jobs/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "job_type": "creation", "resource_type": "backup_policy_job", "source": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "volume"}, "status": "failed", "status_reasons": [{"code": "source_volume_busy", "message": "message", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-troubleshooting-backup-for-vpc"}], "target_snapshots": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}]}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/7241e2a8-601f-11ea-8503-000c29475bed/jobss?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}'
+ 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,
@@ -17537,35 +18243,40 @@ def test_list_backup_policy_jobs_required_params(self):
)
# Set up parameter values
- backup_policy_id = 'testString'
-
- # Invoke method
- response = _service.list_backup_policy_jobs(
- backup_policy_id,
- headers={},
- )
+ dedicated_host_id = 'testString'
- # Check for correct operation
- assert len(responses.calls) == 1
- assert response.status_code == 200
+ # Pass in all but one required param and check for a ValueError
+ req_param_dict = {
+ "dedicated_host_id": dedicated_host_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_dedicated_host_disks(**req_copy)
- def test_list_backup_policy_jobs_required_params_with_retries(self):
- # Enable retries and run test_list_backup_policy_jobs_required_params.
+ def test_list_dedicated_host_disks_value_error_with_retries(self):
+ # Enable retries and run test_list_dedicated_host_disks_value_error.
_service.enable_retries()
- self.test_list_backup_policy_jobs_required_params()
+ self.test_list_dedicated_host_disks_value_error()
- # Disable retries and run test_list_backup_policy_jobs_required_params.
+ # Disable retries and run test_list_dedicated_host_disks_value_error.
_service.disable_retries()
- self.test_list_backup_policy_jobs_required_params()
+ self.test_list_dedicated_host_disks_value_error()
+
+
+class TestGetDedicatedHostDisk:
+ """
+ Test Class for get_dedicated_host_disk
+ """
@responses.activate
- def test_list_backup_policy_jobs_value_error(self):
+ def test_get_dedicated_host_disk_all_params(self):
"""
- test_list_backup_policy_jobs_value_error()
+ get_dedicated_host_disk()
"""
# Set up mock
- url = preprocess_url('/backup_policies/testString/jobs')
- mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/7241e2a8-601f-11ea-8503-000c29475bed/jobs?limit=20"}, "jobs": [{"auto_delete": true, "auto_delete_after": 90, "backup_policy_plan": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}, "completed_at": "2019-01-01T12:00:00.000Z", "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/0fe9e5d8-0a4d-4818-96ec-e99708644a58/jobs/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "job_type": "creation", "resource_type": "backup_policy_job", "source": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "volume"}, "status": "failed", "status_reasons": [{"code": "source_volume_busy", "message": "message", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-troubleshooting-backup-for-vpc"}], "target_snapshots": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}]}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/7241e2a8-601f-11ea-8503-000c29475bed/jobss?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}'
+ 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,
@@ -17575,632 +18286,493 @@ def test_list_backup_policy_jobs_value_error(self):
)
# Set up parameter values
- backup_policy_id = 'testString'
+ dedicated_host_id = 'testString'
+ id = 'testString'
- # Pass in all but one required param and check for a ValueError
- req_param_dict = {
- "backup_policy_id": backup_policy_id,
- }
- for param in req_param_dict.keys():
- req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()}
- with pytest.raises(ValueError):
- _service.list_backup_policy_jobs(**req_copy)
+ # Invoke method
+ response = _service.get_dedicated_host_disk(
+ dedicated_host_id,
+ id,
+ headers={},
+ )
- def test_list_backup_policy_jobs_value_error_with_retries(self):
- # Enable retries and run test_list_backup_policy_jobs_value_error.
- _service.enable_retries()
- self.test_list_backup_policy_jobs_value_error()
+ # Check for correct operation
+ assert len(responses.calls) == 1
+ assert response.status_code == 200
- # Disable retries and run test_list_backup_policy_jobs_value_error.
+ def test_get_dedicated_host_disk_all_params_with_retries(self):
+ # Enable retries and run test_get_dedicated_host_disk_all_params.
+ _service.enable_retries()
+ self.test_get_dedicated_host_disk_all_params()
+
+ # Disable retries and run test_get_dedicated_host_disk_all_params.
_service.disable_retries()
- self.test_list_backup_policy_jobs_value_error()
+ self.test_get_dedicated_host_disk_all_params()
@responses.activate
- def test_list_backup_policy_jobs_with_pager_get_next(self):
+ def test_get_dedicated_host_disk_value_error(self):
"""
- test_list_backup_policy_jobs_with_pager_get_next()
+ test_get_dedicated_host_disk_value_error()
"""
- # Set up a two-page mock response
- url = preprocess_url('/backup_policies/testString/jobs')
- mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"jobs":[{"auto_delete":true,"auto_delete_after":90,"backup_policy_plan":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178","id":"r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178","name":"my-policy-plan","remote":{"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"backup_policy_plan"},"completed_at":"2019-01-01T12:00:00.000Z","created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/0fe9e5d8-0a4d-4818-96ec-e99708644a58/jobs/4cf9171a-0043-4434-8727-15b53dbc374c","id":"4cf9171a-0043-4434-8727-15b53dbc374c","job_type":"creation","resource_type":"backup_policy_job","source":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5","id":"1a6b7274-678d-4dfb-8981-c71dd9d4daa5","name":"my-volume","remote":{"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"volume"},"status":"failed","status_reasons":[{"code":"source_volume_busy","message":"message","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-troubleshooting-backup-for-vpc"}],"target_snapshots":[{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263","id":"r134-f6bfa329-0e36-433f-a3bb-0df632e79263","name":"my-snapshot","remote":{"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"snapshot"}]}],"limit":1}'
- mock_response2 = '{"total_count":2,"jobs":[{"auto_delete":true,"auto_delete_after":90,"backup_policy_plan":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178","id":"r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178","name":"my-policy-plan","remote":{"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"backup_policy_plan"},"completed_at":"2019-01-01T12:00:00.000Z","created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/0fe9e5d8-0a4d-4818-96ec-e99708644a58/jobs/4cf9171a-0043-4434-8727-15b53dbc374c","id":"4cf9171a-0043-4434-8727-15b53dbc374c","job_type":"creation","resource_type":"backup_policy_job","source":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5","id":"1a6b7274-678d-4dfb-8981-c71dd9d4daa5","name":"my-volume","remote":{"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"volume"},"status":"failed","status_reasons":[{"code":"source_volume_busy","message":"message","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-troubleshooting-backup-for-vpc"}],"target_snapshots":[{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263","id":"r134-f6bfa329-0e36-433f-a3bb-0df632e79263","name":"my-snapshot","remote":{"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"snapshot"}]}],"limit":1}'
- responses.add(
- responses.GET,
- url,
- body=mock_response1,
- content_type='application/json',
- status=200,
- )
+ # Set up mock
+ 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,
- body=mock_response2,
+ body=mock_response,
content_type='application/json',
status=200,
)
- # Exercise the pager class for this operation
- all_results = []
- pager = BackupPolicyJobsPager(
- client=_service,
- backup_policy_id='testString',
- status='failed',
- backup_policy_plan_id='testString',
- limit=10,
- sort='name',
- source_id='testString',
- target_snapshots_id='testString',
- target_snapshots_crn='crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263',
- )
- while pager.has_next():
- next_page = pager.get_next()
- assert next_page is not None
- all_results.extend(next_page)
- assert len(all_results) == 2
+ # Set up parameter values
+ dedicated_host_id = 'testString'
+ id = 'testString'
- @responses.activate
- def test_list_backup_policy_jobs_with_pager_get_all(self):
- """
- test_list_backup_policy_jobs_with_pager_get_all()
- """
- # Set up a two-page mock response
- url = preprocess_url('/backup_policies/testString/jobs')
- mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"jobs":[{"auto_delete":true,"auto_delete_after":90,"backup_policy_plan":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178","id":"r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178","name":"my-policy-plan","remote":{"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"backup_policy_plan"},"completed_at":"2019-01-01T12:00:00.000Z","created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/0fe9e5d8-0a4d-4818-96ec-e99708644a58/jobs/4cf9171a-0043-4434-8727-15b53dbc374c","id":"4cf9171a-0043-4434-8727-15b53dbc374c","job_type":"creation","resource_type":"backup_policy_job","source":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5","id":"1a6b7274-678d-4dfb-8981-c71dd9d4daa5","name":"my-volume","remote":{"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"volume"},"status":"failed","status_reasons":[{"code":"source_volume_busy","message":"message","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-troubleshooting-backup-for-vpc"}],"target_snapshots":[{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263","id":"r134-f6bfa329-0e36-433f-a3bb-0df632e79263","name":"my-snapshot","remote":{"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"snapshot"}]}],"limit":1}'
- mock_response2 = '{"total_count":2,"jobs":[{"auto_delete":true,"auto_delete_after":90,"backup_policy_plan":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178","id":"r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178","name":"my-policy-plan","remote":{"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"backup_policy_plan"},"completed_at":"2019-01-01T12:00:00.000Z","created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/0fe9e5d8-0a4d-4818-96ec-e99708644a58/jobs/4cf9171a-0043-4434-8727-15b53dbc374c","id":"4cf9171a-0043-4434-8727-15b53dbc374c","job_type":"creation","resource_type":"backup_policy_job","source":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5","id":"1a6b7274-678d-4dfb-8981-c71dd9d4daa5","name":"my-volume","remote":{"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"volume"},"status":"failed","status_reasons":[{"code":"source_volume_busy","message":"message","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-troubleshooting-backup-for-vpc"}],"target_snapshots":[{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263","id":"r134-f6bfa329-0e36-433f-a3bb-0df632e79263","name":"my-snapshot","remote":{"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"snapshot"}]}],"limit":1}'
- responses.add(
- responses.GET,
- url,
- body=mock_response1,
- content_type='application/json',
- status=200,
- )
- responses.add(
- responses.GET,
- url,
- body=mock_response2,
- content_type='application/json',
- status=200,
- )
+ # Pass in all but one required param and check for a ValueError
+ req_param_dict = {
+ "dedicated_host_id": dedicated_host_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_dedicated_host_disk(**req_copy)
- # Exercise the pager class for this operation
- pager = BackupPolicyJobsPager(
- client=_service,
- backup_policy_id='testString',
- status='failed',
- backup_policy_plan_id='testString',
- limit=10,
- sort='name',
- source_id='testString',
- target_snapshots_id='testString',
- target_snapshots_crn='crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263',
- )
- all_results = pager.get_all()
- assert all_results is not None
- assert len(all_results) == 2
+ def test_get_dedicated_host_disk_value_error_with_retries(self):
+ # Enable retries and run test_get_dedicated_host_disk_value_error.
+ _service.enable_retries()
+ self.test_get_dedicated_host_disk_value_error()
+
+ # Disable retries and run test_get_dedicated_host_disk_value_error.
+ _service.disable_retries()
+ self.test_get_dedicated_host_disk_value_error()
-class TestGetBackupPolicyJob:
+class TestUpdateDedicatedHostDisk:
"""
- Test Class for get_backup_policy_job
+ Test Class for update_dedicated_host_disk
"""
@responses.activate
- def test_get_backup_policy_job_all_params(self):
+ def test_update_dedicated_host_disk_all_params(self):
"""
- get_backup_policy_job()
+ update_dedicated_host_disk()
"""
# Set up mock
- url = preprocess_url('/backup_policies/testString/jobs/testString')
- mock_response = '{"auto_delete": true, "auto_delete_after": 90, "backup_policy_plan": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}, "completed_at": "2019-01-01T12:00:00.000Z", "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/0fe9e5d8-0a4d-4818-96ec-e99708644a58/jobs/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "job_type": "creation", "resource_type": "backup_policy_job", "source": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "volume"}, "status": "failed", "status_reasons": [{"code": "source_volume_busy", "message": "message", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-troubleshooting-backup-for-vpc"}], "target_snapshots": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}]}'
+ 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,
+ responses.PATCH,
url,
body=mock_response,
content_type='application/json',
status=200,
)
+ # Construct a dict representation of a DedicatedHostDiskPatch model
+ dedicated_host_disk_patch_model = {}
+ dedicated_host_disk_patch_model['name'] = 'my-disk-updated'
+
# Set up parameter values
- backup_policy_id = 'testString'
+ dedicated_host_id = 'testString'
id = 'testString'
+ dedicated_host_disk_patch = dedicated_host_disk_patch_model
# Invoke method
- response = _service.get_backup_policy_job(
- backup_policy_id,
+ response = _service.update_dedicated_host_disk(
+ dedicated_host_id,
id,
+ dedicated_host_disk_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 == dedicated_host_disk_patch
- def test_get_backup_policy_job_all_params_with_retries(self):
- # Enable retries and run test_get_backup_policy_job_all_params.
+ def test_update_dedicated_host_disk_all_params_with_retries(self):
+ # Enable retries and run test_update_dedicated_host_disk_all_params.
_service.enable_retries()
- self.test_get_backup_policy_job_all_params()
+ self.test_update_dedicated_host_disk_all_params()
- # Disable retries and run test_get_backup_policy_job_all_params.
+ # Disable retries and run test_update_dedicated_host_disk_all_params.
_service.disable_retries()
- self.test_get_backup_policy_job_all_params()
+ self.test_update_dedicated_host_disk_all_params()
@responses.activate
- def test_get_backup_policy_job_value_error(self):
+ def test_update_dedicated_host_disk_value_error(self):
"""
- test_get_backup_policy_job_value_error()
+ test_update_dedicated_host_disk_value_error()
"""
# Set up mock
- url = preprocess_url('/backup_policies/testString/jobs/testString')
- mock_response = '{"auto_delete": true, "auto_delete_after": 90, "backup_policy_plan": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}, "completed_at": "2019-01-01T12:00:00.000Z", "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/0fe9e5d8-0a4d-4818-96ec-e99708644a58/jobs/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "job_type": "creation", "resource_type": "backup_policy_job", "source": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "volume"}, "status": "failed", "status_reasons": [{"code": "source_volume_busy", "message": "message", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-troubleshooting-backup-for-vpc"}], "target_snapshots": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}]}'
+ 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,
+ responses.PATCH,
url,
body=mock_response,
content_type='application/json',
status=200,
)
+ # Construct a dict representation of a DedicatedHostDiskPatch model
+ dedicated_host_disk_patch_model = {}
+ dedicated_host_disk_patch_model['name'] = 'my-disk-updated'
+
# Set up parameter values
- backup_policy_id = 'testString'
+ dedicated_host_id = 'testString'
id = 'testString'
+ dedicated_host_disk_patch = dedicated_host_disk_patch_model
# Pass in all but one required param and check for a ValueError
req_param_dict = {
- "backup_policy_id": backup_policy_id,
+ "dedicated_host_id": dedicated_host_id,
"id": id,
+ "dedicated_host_disk_patch": dedicated_host_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.get_backup_policy_job(**req_copy)
+ _service.update_dedicated_host_disk(**req_copy)
- def test_get_backup_policy_job_value_error_with_retries(self):
- # Enable retries and run test_get_backup_policy_job_value_error.
+ def test_update_dedicated_host_disk_value_error_with_retries(self):
+ # Enable retries and run test_update_dedicated_host_disk_value_error.
_service.enable_retries()
- self.test_get_backup_policy_job_value_error()
+ self.test_update_dedicated_host_disk_value_error()
- # Disable retries and run test_get_backup_policy_job_value_error.
+ # Disable retries and run test_update_dedicated_host_disk_value_error.
_service.disable_retries()
- self.test_get_backup_policy_job_value_error()
+ self.test_update_dedicated_host_disk_value_error()
-class TestListBackupPolicyPlans:
+class TestDeleteDedicatedHost:
"""
- Test Class for list_backup_policy_plans
+ Test Class for delete_dedicated_host
"""
@responses.activate
- def test_list_backup_policy_plans_all_params(self):
- """
- list_backup_policy_plans()
- """
- # Set up mock
- url = preprocess_url('/backup_policies/testString/plans')
- mock_response = '{"plans": [{"active": true, "attach_user_tags": ["attach_user_tags"], "clone_policy": {"max_snapshots": 1, "zones": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}]}, "copy_user_tags": true, "created_at": "2019-01-01T12:00:00.000Z", "cron_spec": "30 */2 * * 1-5", "deletion_trigger": {"delete_after": 20, "delete_over_count": 20}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "lifecycle_state": "stable", "name": "my-policy-plan", "remote_region_policies": [{"delete_over_count": 1, "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}], "resource_type": "backup_policy_plan"}]}'
- responses.add(
- responses.GET,
- url,
- body=mock_response,
- content_type='application/json',
- status=200,
- )
-
- # Set up parameter values
- backup_policy_id = 'testString'
- name = 'testString'
-
- # Invoke method
- response = _service.list_backup_policy_plans(
- backup_policy_id,
- name=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 'name={}'.format(name) in query_string
-
- def test_list_backup_policy_plans_all_params_with_retries(self):
- # Enable retries and run test_list_backup_policy_plans_all_params.
- _service.enable_retries()
- self.test_list_backup_policy_plans_all_params()
-
- # Disable retries and run test_list_backup_policy_plans_all_params.
- _service.disable_retries()
- self.test_list_backup_policy_plans_all_params()
-
- @responses.activate
- def test_list_backup_policy_plans_required_params(self):
+ def test_delete_dedicated_host_all_params(self):
"""
- test_list_backup_policy_plans_required_params()
+ delete_dedicated_host()
"""
# Set up mock
- url = preprocess_url('/backup_policies/testString/plans')
- mock_response = '{"plans": [{"active": true, "attach_user_tags": ["attach_user_tags"], "clone_policy": {"max_snapshots": 1, "zones": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}]}, "copy_user_tags": true, "created_at": "2019-01-01T12:00:00.000Z", "cron_spec": "30 */2 * * 1-5", "deletion_trigger": {"delete_after": 20, "delete_over_count": 20}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "lifecycle_state": "stable", "name": "my-policy-plan", "remote_region_policies": [{"delete_over_count": 1, "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}], "resource_type": "backup_policy_plan"}]}'
+ url = preprocess_url('/dedicated_hosts/testString')
responses.add(
- responses.GET,
+ responses.DELETE,
url,
- body=mock_response,
- content_type='application/json',
- status=200,
+ status=204,
)
# Set up parameter values
- backup_policy_id = 'testString'
+ id = 'testString'
# Invoke method
- response = _service.list_backup_policy_plans(
- backup_policy_id,
+ response = _service.delete_dedicated_host(
+ id,
headers={},
)
# Check for correct operation
assert len(responses.calls) == 1
- assert response.status_code == 200
+ assert response.status_code == 204
- def test_list_backup_policy_plans_required_params_with_retries(self):
- # Enable retries and run test_list_backup_policy_plans_required_params.
+ def test_delete_dedicated_host_all_params_with_retries(self):
+ # Enable retries and run test_delete_dedicated_host_all_params.
_service.enable_retries()
- self.test_list_backup_policy_plans_required_params()
+ self.test_delete_dedicated_host_all_params()
- # Disable retries and run test_list_backup_policy_plans_required_params.
+ # Disable retries and run test_delete_dedicated_host_all_params.
_service.disable_retries()
- self.test_list_backup_policy_plans_required_params()
+ self.test_delete_dedicated_host_all_params()
@responses.activate
- def test_list_backup_policy_plans_value_error(self):
+ def test_delete_dedicated_host_value_error(self):
"""
- test_list_backup_policy_plans_value_error()
+ test_delete_dedicated_host_value_error()
"""
# Set up mock
- url = preprocess_url('/backup_policies/testString/plans')
- mock_response = '{"plans": [{"active": true, "attach_user_tags": ["attach_user_tags"], "clone_policy": {"max_snapshots": 1, "zones": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}]}, "copy_user_tags": true, "created_at": "2019-01-01T12:00:00.000Z", "cron_spec": "30 */2 * * 1-5", "deletion_trigger": {"delete_after": 20, "delete_over_count": 20}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "lifecycle_state": "stable", "name": "my-policy-plan", "remote_region_policies": [{"delete_over_count": 1, "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}], "resource_type": "backup_policy_plan"}]}'
+ url = preprocess_url('/dedicated_hosts/testString')
responses.add(
- responses.GET,
+ responses.DELETE,
url,
- body=mock_response,
- content_type='application/json',
- status=200,
+ status=204,
)
# Set up parameter values
- backup_policy_id = 'testString'
+ id = 'testString'
# Pass in all but one required param and check for a ValueError
req_param_dict = {
- "backup_policy_id": backup_policy_id,
+ "id": id,
}
for param in req_param_dict.keys():
req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()}
with pytest.raises(ValueError):
- _service.list_backup_policy_plans(**req_copy)
+ _service.delete_dedicated_host(**req_copy)
- def test_list_backup_policy_plans_value_error_with_retries(self):
- # Enable retries and run test_list_backup_policy_plans_value_error.
+ def test_delete_dedicated_host_value_error_with_retries(self):
+ # Enable retries and run test_delete_dedicated_host_value_error.
_service.enable_retries()
- self.test_list_backup_policy_plans_value_error()
+ self.test_delete_dedicated_host_value_error()
- # Disable retries and run test_list_backup_policy_plans_value_error.
+ # Disable retries and run test_delete_dedicated_host_value_error.
_service.disable_retries()
- self.test_list_backup_policy_plans_value_error()
+ self.test_delete_dedicated_host_value_error()
-class TestCreateBackupPolicyPlan:
+class TestGetDedicatedHost:
"""
- Test Class for create_backup_policy_plan
+ Test Class for get_dedicated_host
"""
@responses.activate
- def test_create_backup_policy_plan_all_params(self):
+ def test_get_dedicated_host_all_params(self):
"""
- create_backup_policy_plan()
+ get_dedicated_host()
"""
# Set up mock
- url = preprocess_url('/backup_policies/testString/plans')
- mock_response = '{"active": true, "attach_user_tags": ["attach_user_tags"], "clone_policy": {"max_snapshots": 1, "zones": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}]}, "copy_user_tags": true, "created_at": "2019-01-01T12:00:00.000Z", "cron_spec": "30 */2 * * 1-5", "deletion_trigger": {"delete_after": 20, "delete_over_count": 20}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "lifecycle_state": "stable", "name": "my-policy-plan", "remote_region_policies": [{"delete_over_count": 1, "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}], "resource_type": "backup_policy_plan"}'
+ url = preprocess_url('/dedicated_hosts/testString')
+ mock_response = '{"available_memory": 128, "available_vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "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", "numa": {"count": 2, "nodes": [{"available_vcpu": 24, "vcpu": 56}]}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "mx2-host-152x1216"}, "provisionable": false, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "dedicated_host", "socket_count": 4, "state": "available", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}], "vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "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,
+ responses.GET,
url,
body=mock_response,
content_type='application/json',
- status=201,
+ status=200,
)
- # Construct a dict representation of a ZoneIdentityByName model
- zone_identity_model = {}
- zone_identity_model['name'] = 'us-south-1'
-
- # Construct a dict representation of a BackupPolicyPlanClonePolicyPrototype model
- backup_policy_plan_clone_policy_prototype_model = {}
- backup_policy_plan_clone_policy_prototype_model['max_snapshots'] = 5
- backup_policy_plan_clone_policy_prototype_model['zones'] = [zone_identity_model]
-
- # Construct a dict representation of a BackupPolicyPlanDeletionTriggerPrototype model
- backup_policy_plan_deletion_trigger_prototype_model = {}
- backup_policy_plan_deletion_trigger_prototype_model['delete_after'] = 20
- backup_policy_plan_deletion_trigger_prototype_model['delete_over_count'] = 20
-
- # 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/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179'
-
- # Construct a dict representation of a RegionIdentityByName model
- region_identity_model = {}
- region_identity_model['name'] = 'us-south'
-
- # Construct a dict representation of a BackupPolicyPlanRemoteRegionPolicyPrototype model
- backup_policy_plan_remote_region_policy_prototype_model = {}
- backup_policy_plan_remote_region_policy_prototype_model['delete_over_count'] = 5
- backup_policy_plan_remote_region_policy_prototype_model['encryption_key'] = encryption_key_identity_model
- backup_policy_plan_remote_region_policy_prototype_model['region'] = region_identity_model
-
# Set up parameter values
- backup_policy_id = 'testString'
- cron_spec = '30 */2 * * 1-5'
- active = True
- attach_user_tags = ['my-daily-backup-plan']
- clone_policy = backup_policy_plan_clone_policy_prototype_model
- copy_user_tags = True
- deletion_trigger = backup_policy_plan_deletion_trigger_prototype_model
- name = 'my-policy-plan'
- remote_region_policies = [backup_policy_plan_remote_region_policy_prototype_model]
+ id = 'testString'
# Invoke method
- response = _service.create_backup_policy_plan(
- backup_policy_id,
- cron_spec,
- active=active,
- attach_user_tags=attach_user_tags,
- clone_policy=clone_policy,
- copy_user_tags=copy_user_tags,
- deletion_trigger=deletion_trigger,
- name=name,
- remote_region_policies=remote_region_policies,
+ response = _service.get_dedicated_host(
+ 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['cron_spec'] == '30 */2 * * 1-5'
- assert req_body['active'] == True
- assert req_body['attach_user_tags'] == ['my-daily-backup-plan']
- assert req_body['clone_policy'] == backup_policy_plan_clone_policy_prototype_model
- assert req_body['copy_user_tags'] == True
- assert req_body['deletion_trigger'] == backup_policy_plan_deletion_trigger_prototype_model
- assert req_body['name'] == 'my-policy-plan'
- assert req_body['remote_region_policies'] == [backup_policy_plan_remote_region_policy_prototype_model]
+ assert response.status_code == 200
- def test_create_backup_policy_plan_all_params_with_retries(self):
- # Enable retries and run test_create_backup_policy_plan_all_params.
+ def test_get_dedicated_host_all_params_with_retries(self):
+ # Enable retries and run test_get_dedicated_host_all_params.
_service.enable_retries()
- self.test_create_backup_policy_plan_all_params()
+ self.test_get_dedicated_host_all_params()
- # Disable retries and run test_create_backup_policy_plan_all_params.
+ # Disable retries and run test_get_dedicated_host_all_params.
_service.disable_retries()
- self.test_create_backup_policy_plan_all_params()
+ self.test_get_dedicated_host_all_params()
@responses.activate
- def test_create_backup_policy_plan_value_error(self):
+ def test_get_dedicated_host_value_error(self):
"""
- test_create_backup_policy_plan_value_error()
+ test_get_dedicated_host_value_error()
"""
# Set up mock
- url = preprocess_url('/backup_policies/testString/plans')
- mock_response = '{"active": true, "attach_user_tags": ["attach_user_tags"], "clone_policy": {"max_snapshots": 1, "zones": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}]}, "copy_user_tags": true, "created_at": "2019-01-01T12:00:00.000Z", "cron_spec": "30 */2 * * 1-5", "deletion_trigger": {"delete_after": 20, "delete_over_count": 20}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "lifecycle_state": "stable", "name": "my-policy-plan", "remote_region_policies": [{"delete_over_count": 1, "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}], "resource_type": "backup_policy_plan"}'
+ url = preprocess_url('/dedicated_hosts/testString')
+ mock_response = '{"available_memory": 128, "available_vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "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", "numa": {"count": 2, "nodes": [{"available_vcpu": 24, "vcpu": 56}]}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "mx2-host-152x1216"}, "provisionable": false, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "dedicated_host", "socket_count": 4, "state": "available", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}], "vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "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,
+ responses.GET,
url,
body=mock_response,
content_type='application/json',
- status=201,
+ status=200,
)
- # Construct a dict representation of a ZoneIdentityByName model
- zone_identity_model = {}
- zone_identity_model['name'] = 'us-south-1'
-
- # Construct a dict representation of a BackupPolicyPlanClonePolicyPrototype model
- backup_policy_plan_clone_policy_prototype_model = {}
- backup_policy_plan_clone_policy_prototype_model['max_snapshots'] = 5
- backup_policy_plan_clone_policy_prototype_model['zones'] = [zone_identity_model]
-
- # Construct a dict representation of a BackupPolicyPlanDeletionTriggerPrototype model
- backup_policy_plan_deletion_trigger_prototype_model = {}
- backup_policy_plan_deletion_trigger_prototype_model['delete_after'] = 20
- backup_policy_plan_deletion_trigger_prototype_model['delete_over_count'] = 20
-
- # 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/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179'
-
- # Construct a dict representation of a RegionIdentityByName model
- region_identity_model = {}
- region_identity_model['name'] = 'us-south'
-
- # Construct a dict representation of a BackupPolicyPlanRemoteRegionPolicyPrototype model
- backup_policy_plan_remote_region_policy_prototype_model = {}
- backup_policy_plan_remote_region_policy_prototype_model['delete_over_count'] = 5
- backup_policy_plan_remote_region_policy_prototype_model['encryption_key'] = encryption_key_identity_model
- backup_policy_plan_remote_region_policy_prototype_model['region'] = region_identity_model
-
# Set up parameter values
- backup_policy_id = 'testString'
- cron_spec = '30 */2 * * 1-5'
- active = True
- attach_user_tags = ['my-daily-backup-plan']
- clone_policy = backup_policy_plan_clone_policy_prototype_model
- copy_user_tags = True
- deletion_trigger = backup_policy_plan_deletion_trigger_prototype_model
- name = 'my-policy-plan'
- remote_region_policies = [backup_policy_plan_remote_region_policy_prototype_model]
+ id = 'testString'
# Pass in all but one required param and check for a ValueError
req_param_dict = {
- "backup_policy_id": backup_policy_id,
- "cron_spec": cron_spec,
+ "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_backup_policy_plan(**req_copy)
+ _service.get_dedicated_host(**req_copy)
- def test_create_backup_policy_plan_value_error_with_retries(self):
- # Enable retries and run test_create_backup_policy_plan_value_error.
+ def test_get_dedicated_host_value_error_with_retries(self):
+ # Enable retries and run test_get_dedicated_host_value_error.
_service.enable_retries()
- self.test_create_backup_policy_plan_value_error()
+ self.test_get_dedicated_host_value_error()
- # Disable retries and run test_create_backup_policy_plan_value_error.
+ # Disable retries and run test_get_dedicated_host_value_error.
_service.disable_retries()
- self.test_create_backup_policy_plan_value_error()
+ self.test_get_dedicated_host_value_error()
-class TestDeleteBackupPolicyPlan:
+class TestUpdateDedicatedHost:
"""
- Test Class for delete_backup_policy_plan
+ Test Class for update_dedicated_host
"""
@responses.activate
- def test_delete_backup_policy_plan_all_params(self):
+ def test_update_dedicated_host_all_params(self):
"""
- delete_backup_policy_plan()
+ update_dedicated_host()
"""
# Set up mock
- url = preprocess_url('/backup_policies/testString/plans/testString')
- mock_response = '{"active": true, "attach_user_tags": ["attach_user_tags"], "clone_policy": {"max_snapshots": 1, "zones": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}]}, "copy_user_tags": true, "created_at": "2019-01-01T12:00:00.000Z", "cron_spec": "30 */2 * * 1-5", "deletion_trigger": {"delete_after": 20, "delete_over_count": 20}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "lifecycle_state": "stable", "name": "my-policy-plan", "remote_region_policies": [{"delete_over_count": 1, "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}], "resource_type": "backup_policy_plan"}'
+ url = preprocess_url('/dedicated_hosts/testString')
+ mock_response = '{"available_memory": 128, "available_vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "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", "numa": {"count": 2, "nodes": [{"available_vcpu": 24, "vcpu": 56}]}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "mx2-host-152x1216"}, "provisionable": false, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "dedicated_host", "socket_count": 4, "state": "available", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}], "vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
responses.add(
- responses.DELETE,
+ responses.PATCH,
url,
body=mock_response,
content_type='application/json',
- status=202,
+ status=200,
)
+ # Construct a dict representation of a DedicatedHostPatch model
+ dedicated_host_patch_model = {}
+ dedicated_host_patch_model['instance_placement_enabled'] = True
+ dedicated_host_patch_model['name'] = 'my-host'
+
# Set up parameter values
- backup_policy_id = 'testString'
id = 'testString'
- if_match = 'W/"96d225c4-56bd-43d9-98fc-d7148e5c5028"'
+ dedicated_host_patch = dedicated_host_patch_model
# Invoke method
- response = _service.delete_backup_policy_plan(
- backup_policy_id,
+ response = _service.update_dedicated_host(
id,
- if_match=if_match,
+ dedicated_host_patch,
headers={},
)
# Check for correct operation
assert len(responses.calls) == 1
- assert response.status_code == 202
+ assert response.status_code == 200
+ # Validate body params
+ req_body = json.loads(str(responses.calls[0].request.body, 'utf-8'))
+ assert req_body == dedicated_host_patch
- def test_delete_backup_policy_plan_all_params_with_retries(self):
- # Enable retries and run test_delete_backup_policy_plan_all_params.
+ def test_update_dedicated_host_all_params_with_retries(self):
+ # Enable retries and run test_update_dedicated_host_all_params.
_service.enable_retries()
- self.test_delete_backup_policy_plan_all_params()
+ self.test_update_dedicated_host_all_params()
- # Disable retries and run test_delete_backup_policy_plan_all_params.
+ # Disable retries and run test_update_dedicated_host_all_params.
_service.disable_retries()
- self.test_delete_backup_policy_plan_all_params()
+ self.test_update_dedicated_host_all_params()
@responses.activate
- def test_delete_backup_policy_plan_required_params(self):
+ def test_update_dedicated_host_value_error(self):
"""
- test_delete_backup_policy_plan_required_params()
+ test_update_dedicated_host_value_error()
"""
# Set up mock
- url = preprocess_url('/backup_policies/testString/plans/testString')
- mock_response = '{"active": true, "attach_user_tags": ["attach_user_tags"], "clone_policy": {"max_snapshots": 1, "zones": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}]}, "copy_user_tags": true, "created_at": "2019-01-01T12:00:00.000Z", "cron_spec": "30 */2 * * 1-5", "deletion_trigger": {"delete_after": 20, "delete_over_count": 20}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "lifecycle_state": "stable", "name": "my-policy-plan", "remote_region_policies": [{"delete_over_count": 1, "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}], "resource_type": "backup_policy_plan"}'
+ url = preprocess_url('/dedicated_hosts/testString')
+ mock_response = '{"available_memory": 128, "available_vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "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", "numa": {"count": 2, "nodes": [{"available_vcpu": 24, "vcpu": 56}]}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "mx2-host-152x1216"}, "provisionable": false, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "dedicated_host", "socket_count": 4, "state": "available", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16", "resource_type": "instance_profile"}], "vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
responses.add(
- responses.DELETE,
+ responses.PATCH,
url,
body=mock_response,
content_type='application/json',
- status=202,
+ status=200,
)
+ # Construct a dict representation of a DedicatedHostPatch model
+ dedicated_host_patch_model = {}
+ dedicated_host_patch_model['instance_placement_enabled'] = True
+ dedicated_host_patch_model['name'] = 'my-host'
+
# Set up parameter values
- backup_policy_id = 'testString'
id = 'testString'
+ dedicated_host_patch = dedicated_host_patch_model
- # Invoke method
- response = _service.delete_backup_policy_plan(
- backup_policy_id,
- id,
- headers={},
- )
+ # Pass in all but one required param and check for a ValueError
+ req_param_dict = {
+ "id": id,
+ "dedicated_host_patch": dedicated_host_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_dedicated_host(**req_copy)
- # Check for correct operation
- assert len(responses.calls) == 1
- assert response.status_code == 202
-
- def test_delete_backup_policy_plan_required_params_with_retries(self):
- # Enable retries and run test_delete_backup_policy_plan_required_params.
+ def test_update_dedicated_host_value_error_with_retries(self):
+ # Enable retries and run test_update_dedicated_host_value_error.
_service.enable_retries()
- self.test_delete_backup_policy_plan_required_params()
+ self.test_update_dedicated_host_value_error()
- # Disable retries and run test_delete_backup_policy_plan_required_params.
+ # Disable retries and run test_update_dedicated_host_value_error.
_service.disable_retries()
- self.test_delete_backup_policy_plan_required_params()
+ self.test_update_dedicated_host_value_error()
- @responses.activate
- def test_delete_backup_policy_plan_value_error(self):
+
+# endregion
+##############################################################################
+# End of Service: DedicatedHosts
+##############################################################################
+
+##############################################################################
+# Start of Service: BackupPolicies
+##############################################################################
+# region
+
+
+class TestNewInstance:
+ """
+ Test Class for new_instance
+ """
+
+ def test_new_instance(self):
"""
- test_delete_backup_policy_plan_value_error()
+ new_instance()
"""
- # Set up mock
- url = preprocess_url('/backup_policies/testString/plans/testString')
- mock_response = '{"active": true, "attach_user_tags": ["attach_user_tags"], "clone_policy": {"max_snapshots": 1, "zones": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}]}, "copy_user_tags": true, "created_at": "2019-01-01T12:00:00.000Z", "cron_spec": "30 */2 * * 1-5", "deletion_trigger": {"delete_after": 20, "delete_over_count": 20}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "lifecycle_state": "stable", "name": "my-policy-plan", "remote_region_policies": [{"delete_over_count": 1, "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}], "resource_type": "backup_policy_plan"}'
- responses.add(
- responses.DELETE,
- url,
- body=mock_response,
- content_type='application/json',
- status=202,
+ os.environ['TEST_SERVICE_AUTH_TYPE'] = 'noAuth'
+
+ service = VpcV1.new_instance(
+ version=version,
+ service_name='TEST_SERVICE',
)
- # Set up parameter values
- backup_policy_id = 'testString'
- id = 'testString'
+ assert service is not None
+ assert isinstance(service, VpcV1)
- # Pass in all but one required param and check for a ValueError
- req_param_dict = {
- "backup_policy_id": backup_policy_id,
- "id": id,
- }
- for param in req_param_dict.keys():
- req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()}
- with pytest.raises(ValueError):
- _service.delete_backup_policy_plan(**req_copy)
+ 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_delete_backup_policy_plan_value_error_with_retries(self):
- # Enable retries and run test_delete_backup_policy_plan_value_error.
- _service.enable_retries()
- self.test_delete_backup_policy_plan_value_error()
+ 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()
- # Disable retries and run test_delete_backup_policy_plan_value_error.
- _service.disable_retries()
- self.test_delete_backup_policy_plan_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 TestGetBackupPolicyPlan:
+class TestListBackupPolicies:
"""
- Test Class for get_backup_policy_plan
+ Test Class for list_backup_policies
"""
@responses.activate
- def test_get_backup_policy_plan_all_params(self):
+ def test_list_backup_policies_all_params(self):
"""
- get_backup_policy_plan()
+ list_backup_policies()
"""
# Set up mock
- url = preprocess_url('/backup_policies/testString/plans/testString')
- mock_response = '{"active": true, "attach_user_tags": ["attach_user_tags"], "clone_policy": {"max_snapshots": 1, "zones": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}]}, "copy_user_tags": true, "created_at": "2019-01-01T12:00:00.000Z", "cron_spec": "30 */2 * * 1-5", "deletion_trigger": {"delete_after": 20, "delete_over_count": 20}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "lifecycle_state": "stable", "name": "my-policy-plan", "remote_region_policies": [{"delete_over_count": 1, "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}], "resource_type": "backup_policy_plan"}'
+ url = preprocess_url('/backup_policies')
+ mock_response = '{"backup_policies": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::backup-policy:r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "health_reasons": [{"code": "missing_service_authorization_policies", "message": "One or more accounts are missing service authorization policies", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-backup-service-about&interface=ui"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "id": "r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "last_job_completed_at": "2019-01-01T12:00:00.000Z", "lifecycle_state": "stable", "match_user_tags": ["match_user_tags"], "name": "my-backup-policy", "plans": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "backup_policy", "scope": {"crn": "crn:v1:bluemix:public:enterprise::a/123456::enterprise:ebc2b430240943458b9e91e1432cfcce", "id": "fee82deba12e4c0fb69c3b09d1f12345", "resource_type": "enterprise"}, "included_content": ["data_volumes"], "match_resource_type": "instance"}], "first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}'
responses.add(
responses.GET,
url,
@@ -18210,37 +18782,51 @@ def test_get_backup_policy_plan_all_params(self):
)
# Set up parameter values
- backup_policy_id = 'testString'
- id = 'testString'
+ start = 'testString'
+ limit = 50
+ resource_group_id = 'testString'
+ name = 'testString'
+ tag = 'testString'
# Invoke method
- response = _service.get_backup_policy_plan(
- backup_policy_id,
- id,
+ response = _service.list_backup_policies(
+ start=start,
+ limit=limit,
+ resource_group_id=resource_group_id,
+ name=name,
+ tag=tag,
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 'tag={}'.format(tag) in query_string
- def test_get_backup_policy_plan_all_params_with_retries(self):
- # Enable retries and run test_get_backup_policy_plan_all_params.
+ def test_list_backup_policies_all_params_with_retries(self):
+ # Enable retries and run test_list_backup_policies_all_params.
_service.enable_retries()
- self.test_get_backup_policy_plan_all_params()
+ self.test_list_backup_policies_all_params()
- # Disable retries and run test_get_backup_policy_plan_all_params.
+ # Disable retries and run test_list_backup_policies_all_params.
_service.disable_retries()
- self.test_get_backup_policy_plan_all_params()
+ self.test_list_backup_policies_all_params()
@responses.activate
- def test_get_backup_policy_plan_value_error(self):
+ def test_list_backup_policies_required_params(self):
"""
- test_get_backup_policy_plan_value_error()
+ test_list_backup_policies_required_params()
"""
# Set up mock
- url = preprocess_url('/backup_policies/testString/plans/testString')
- mock_response = '{"active": true, "attach_user_tags": ["attach_user_tags"], "clone_policy": {"max_snapshots": 1, "zones": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}]}, "copy_user_tags": true, "created_at": "2019-01-01T12:00:00.000Z", "cron_spec": "30 */2 * * 1-5", "deletion_trigger": {"delete_after": 20, "delete_over_count": 20}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "lifecycle_state": "stable", "name": "my-policy-plan", "remote_region_policies": [{"delete_over_count": 1, "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}], "resource_type": "backup_policy_plan"}'
+ url = preprocess_url('/backup_policies')
+ mock_response = '{"backup_policies": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::backup-policy:r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "health_reasons": [{"code": "missing_service_authorization_policies", "message": "One or more accounts are missing service authorization policies", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-backup-service-about&interface=ui"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "id": "r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "last_job_completed_at": "2019-01-01T12:00:00.000Z", "lifecycle_state": "stable", "match_user_tags": ["match_user_tags"], "name": "my-backup-policy", "plans": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "backup_policy", "scope": {"crn": "crn:v1:bluemix:public:enterprise::a/123456::enterprise:ebc2b430240943458b9e91e1432cfcce", "id": "fee82deba12e4c0fb69c3b09d1f12345", "resource_type": "enterprise"}, "included_content": ["data_volumes"], "match_resource_type": "instance"}], "first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}'
responses.add(
responses.GET,
url,
@@ -18249,150 +18835,165 @@ def test_get_backup_policy_plan_value_error(self):
status=200,
)
- # Set up parameter values
- backup_policy_id = 'testString'
- id = 'testString'
+ # Invoke method
+ response = _service.list_backup_policies()
- # Pass in all but one required param and check for a ValueError
- req_param_dict = {
- "backup_policy_id": backup_policy_id,
- "id": id,
- }
- for param in req_param_dict.keys():
- req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()}
- with pytest.raises(ValueError):
- _service.get_backup_policy_plan(**req_copy)
+ # Check for correct operation
+ assert len(responses.calls) == 1
+ assert response.status_code == 200
- def test_get_backup_policy_plan_value_error_with_retries(self):
- # Enable retries and run test_get_backup_policy_plan_value_error.
+ def test_list_backup_policies_required_params_with_retries(self):
+ # Enable retries and run test_list_backup_policies_required_params.
_service.enable_retries()
- self.test_get_backup_policy_plan_value_error()
+ self.test_list_backup_policies_required_params()
- # Disable retries and run test_get_backup_policy_plan_value_error.
+ # Disable retries and run test_list_backup_policies_required_params.
_service.disable_retries()
- self.test_get_backup_policy_plan_value_error()
-
-
-class TestUpdateBackupPolicyPlan:
- """
- Test Class for update_backup_policy_plan
- """
+ self.test_list_backup_policies_required_params()
@responses.activate
- def test_update_backup_policy_plan_all_params(self):
+ def test_list_backup_policies_value_error(self):
"""
- update_backup_policy_plan()
+ test_list_backup_policies_value_error()
"""
# Set up mock
- url = preprocess_url('/backup_policies/testString/plans/testString')
- mock_response = '{"active": true, "attach_user_tags": ["attach_user_tags"], "clone_policy": {"max_snapshots": 1, "zones": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}]}, "copy_user_tags": true, "created_at": "2019-01-01T12:00:00.000Z", "cron_spec": "30 */2 * * 1-5", "deletion_trigger": {"delete_after": 20, "delete_over_count": 20}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "lifecycle_state": "stable", "name": "my-policy-plan", "remote_region_policies": [{"delete_over_count": 1, "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}], "resource_type": "backup_policy_plan"}'
+ url = preprocess_url('/backup_policies')
+ mock_response = '{"backup_policies": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::backup-policy:r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "health_reasons": [{"code": "missing_service_authorization_policies", "message": "One or more accounts are missing service authorization policies", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-backup-service-about&interface=ui"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "id": "r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "last_job_completed_at": "2019-01-01T12:00:00.000Z", "lifecycle_state": "stable", "match_user_tags": ["match_user_tags"], "name": "my-backup-policy", "plans": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "backup_policy", "scope": {"crn": "crn:v1:bluemix:public:enterprise::a/123456::enterprise:ebc2b430240943458b9e91e1432cfcce", "id": "fee82deba12e4c0fb69c3b09d1f12345", "resource_type": "enterprise"}, "included_content": ["data_volumes"], "match_resource_type": "instance"}], "first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}'
responses.add(
- responses.PATCH,
+ responses.GET,
url,
body=mock_response,
content_type='application/json',
status=200,
)
- # Construct a dict representation of a ZoneIdentityByName model
- zone_identity_model = {}
- zone_identity_model['name'] = 'us-south-1'
-
- # Construct a dict representation of a BackupPolicyPlanClonePolicyPatch model
- backup_policy_plan_clone_policy_patch_model = {}
- backup_policy_plan_clone_policy_patch_model['max_snapshots'] = 1
- backup_policy_plan_clone_policy_patch_model['zones'] = [zone_identity_model]
-
- # Construct a dict representation of a BackupPolicyPlanDeletionTriggerPatch model
- backup_policy_plan_deletion_trigger_patch_model = {}
- backup_policy_plan_deletion_trigger_patch_model['delete_after'] = 20
- backup_policy_plan_deletion_trigger_patch_model['delete_over_count'] = 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/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179'
+ # 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_backup_policies(**req_copy)
- # Construct a dict representation of a RegionIdentityByName model
- region_identity_model = {}
- region_identity_model['name'] = 'us-south'
+ def test_list_backup_policies_value_error_with_retries(self):
+ # Enable retries and run test_list_backup_policies_value_error.
+ _service.enable_retries()
+ self.test_list_backup_policies_value_error()
- # Construct a dict representation of a BackupPolicyPlanRemoteRegionPolicyPrototype model
- backup_policy_plan_remote_region_policy_prototype_model = {}
- backup_policy_plan_remote_region_policy_prototype_model['delete_over_count'] = 5
- backup_policy_plan_remote_region_policy_prototype_model['encryption_key'] = encryption_key_identity_model
- backup_policy_plan_remote_region_policy_prototype_model['region'] = region_identity_model
+ # Disable retries and run test_list_backup_policies_value_error.
+ _service.disable_retries()
+ self.test_list_backup_policies_value_error()
- # Construct a dict representation of a BackupPolicyPlanPatch model
- backup_policy_plan_patch_model = {}
- backup_policy_plan_patch_model['active'] = True
- backup_policy_plan_patch_model['attach_user_tags'] = ['my-daily-backup-plan']
- backup_policy_plan_patch_model['clone_policy'] = backup_policy_plan_clone_policy_patch_model
- backup_policy_plan_patch_model['copy_user_tags'] = True
- backup_policy_plan_patch_model['cron_spec'] = '30 */2 * * 1-5'
- backup_policy_plan_patch_model['deletion_trigger'] = backup_policy_plan_deletion_trigger_patch_model
- backup_policy_plan_patch_model['name'] = 'my-policy-plan'
- backup_policy_plan_patch_model['remote_region_policies'] = [backup_policy_plan_remote_region_policy_prototype_model]
+ @responses.activate
+ def test_list_backup_policies_with_pager_get_next(self):
+ """
+ test_list_backup_policies_with_pager_get_next()
+ """
+ # Set up a two-page mock response
+ url = preprocess_url('/backup_policies')
+ mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"backup_policies":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::backup-policy:r134-076191ba-49c2-4763-94fd-c70de73ee2e6","health_reasons":[{"code":"missing_service_authorization_policies","message":"One or more accounts are missing service authorization policies","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-backup-service-about&interface=ui"}],"health_state":"ok","href":"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6","id":"r134-076191ba-49c2-4763-94fd-c70de73ee2e6","last_job_completed_at":"2019-01-01T12:00:00.000Z","lifecycle_state":"stable","match_user_tags":["match_user_tags"],"name":"my-backup-policy","plans":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178","id":"r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178","name":"my-policy-plan","remote":{"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"backup_policy_plan"}],"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"backup_policy","scope":{"crn":"crn:v1:bluemix:public:enterprise::a/123456::enterprise:ebc2b430240943458b9e91e1432cfcce","id":"fee82deba12e4c0fb69c3b09d1f12345","resource_type":"enterprise"},"included_content":["data_volumes"],"match_resource_type":"instance"}],"total_count":2,"limit":1}'
+ mock_response2 = '{"backup_policies":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::backup-policy:r134-076191ba-49c2-4763-94fd-c70de73ee2e6","health_reasons":[{"code":"missing_service_authorization_policies","message":"One or more accounts are missing service authorization policies","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-backup-service-about&interface=ui"}],"health_state":"ok","href":"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6","id":"r134-076191ba-49c2-4763-94fd-c70de73ee2e6","last_job_completed_at":"2019-01-01T12:00:00.000Z","lifecycle_state":"stable","match_user_tags":["match_user_tags"],"name":"my-backup-policy","plans":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178","id":"r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178","name":"my-policy-plan","remote":{"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"backup_policy_plan"}],"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"backup_policy","scope":{"crn":"crn:v1:bluemix:public:enterprise::a/123456::enterprise:ebc2b430240943458b9e91e1432cfcce","id":"fee82deba12e4c0fb69c3b09d1f12345","resource_type":"enterprise"},"included_content":["data_volumes"],"match_resource_type":"instance"}],"total_count":2,"limit":1}'
+ responses.add(
+ responses.GET,
+ url,
+ body=mock_response1,
+ content_type='application/json',
+ status=200,
+ )
+ responses.add(
+ responses.GET,
+ url,
+ body=mock_response2,
+ content_type='application/json',
+ status=200,
+ )
- # Set up parameter values
- backup_policy_id = 'testString'
- id = 'testString'
- backup_policy_plan_patch = backup_policy_plan_patch_model
- if_match = 'W/"96d225c4-56bd-43d9-98fc-d7148e5c5028"'
+ # Exercise the pager class for this operation
+ all_results = []
+ pager = BackupPoliciesPager(
+ client=_service,
+ limit=10,
+ resource_group_id='testString',
+ name='testString',
+ tag='testString',
+ )
+ while pager.has_next():
+ next_page = pager.get_next()
+ assert next_page is not None
+ all_results.extend(next_page)
+ assert len(all_results) == 2
- # Invoke method
- response = _service.update_backup_policy_plan(
- backup_policy_id,
- id,
- backup_policy_plan_patch,
- if_match=if_match,
- headers={},
+ @responses.activate
+ def test_list_backup_policies_with_pager_get_all(self):
+ """
+ test_list_backup_policies_with_pager_get_all()
+ """
+ # Set up a two-page mock response
+ url = preprocess_url('/backup_policies')
+ mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"backup_policies":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::backup-policy:r134-076191ba-49c2-4763-94fd-c70de73ee2e6","health_reasons":[{"code":"missing_service_authorization_policies","message":"One or more accounts are missing service authorization policies","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-backup-service-about&interface=ui"}],"health_state":"ok","href":"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6","id":"r134-076191ba-49c2-4763-94fd-c70de73ee2e6","last_job_completed_at":"2019-01-01T12:00:00.000Z","lifecycle_state":"stable","match_user_tags":["match_user_tags"],"name":"my-backup-policy","plans":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178","id":"r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178","name":"my-policy-plan","remote":{"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"backup_policy_plan"}],"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"backup_policy","scope":{"crn":"crn:v1:bluemix:public:enterprise::a/123456::enterprise:ebc2b430240943458b9e91e1432cfcce","id":"fee82deba12e4c0fb69c3b09d1f12345","resource_type":"enterprise"},"included_content":["data_volumes"],"match_resource_type":"instance"}],"total_count":2,"limit":1}'
+ mock_response2 = '{"backup_policies":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::backup-policy:r134-076191ba-49c2-4763-94fd-c70de73ee2e6","health_reasons":[{"code":"missing_service_authorization_policies","message":"One or more accounts are missing service authorization policies","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-backup-service-about&interface=ui"}],"health_state":"ok","href":"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6","id":"r134-076191ba-49c2-4763-94fd-c70de73ee2e6","last_job_completed_at":"2019-01-01T12:00:00.000Z","lifecycle_state":"stable","match_user_tags":["match_user_tags"],"name":"my-backup-policy","plans":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178","id":"r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178","name":"my-policy-plan","remote":{"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"backup_policy_plan"}],"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"backup_policy","scope":{"crn":"crn:v1:bluemix:public:enterprise::a/123456::enterprise:ebc2b430240943458b9e91e1432cfcce","id":"fee82deba12e4c0fb69c3b09d1f12345","resource_type":"enterprise"},"included_content":["data_volumes"],"match_resource_type":"instance"}],"total_count":2,"limit":1}'
+ responses.add(
+ responses.GET,
+ url,
+ body=mock_response1,
+ content_type='application/json',
+ status=200,
+ )
+ responses.add(
+ responses.GET,
+ url,
+ body=mock_response2,
+ content_type='application/json',
+ status=200,
)
- # 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 == backup_policy_plan_patch
+ # Exercise the pager class for this operation
+ pager = BackupPoliciesPager(
+ client=_service,
+ limit=10,
+ resource_group_id='testString',
+ name='testString',
+ tag='testString',
+ )
+ all_results = pager.get_all()
+ assert all_results is not None
+ assert len(all_results) == 2
- def test_update_backup_policy_plan_all_params_with_retries(self):
- # Enable retries and run test_update_backup_policy_plan_all_params.
- _service.enable_retries()
- self.test_update_backup_policy_plan_all_params()
- # Disable retries and run test_update_backup_policy_plan_all_params.
- _service.disable_retries()
- self.test_update_backup_policy_plan_all_params()
+class TestCreateBackupPolicy:
+ """
+ Test Class for create_backup_policy
+ """
@responses.activate
- def test_update_backup_policy_plan_required_params(self):
+ def test_create_backup_policy_all_params(self):
"""
- test_update_backup_policy_plan_required_params()
+ create_backup_policy()
"""
# Set up mock
- url = preprocess_url('/backup_policies/testString/plans/testString')
- mock_response = '{"active": true, "attach_user_tags": ["attach_user_tags"], "clone_policy": {"max_snapshots": 1, "zones": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}]}, "copy_user_tags": true, "created_at": "2019-01-01T12:00:00.000Z", "cron_spec": "30 */2 * * 1-5", "deletion_trigger": {"delete_after": 20, "delete_over_count": 20}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "lifecycle_state": "stable", "name": "my-policy-plan", "remote_region_policies": [{"delete_over_count": 1, "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}], "resource_type": "backup_policy_plan"}'
+ url = preprocess_url('/backup_policies')
+ mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::backup-policy:r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "health_reasons": [{"code": "missing_service_authorization_policies", "message": "One or more accounts are missing service authorization policies", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-backup-service-about&interface=ui"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "id": "r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "last_job_completed_at": "2019-01-01T12:00:00.000Z", "lifecycle_state": "stable", "match_user_tags": ["match_user_tags"], "name": "my-backup-policy", "plans": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "backup_policy", "scope": {"crn": "crn:v1:bluemix:public:enterprise::a/123456::enterprise:ebc2b430240943458b9e91e1432cfcce", "id": "fee82deba12e4c0fb69c3b09d1f12345", "resource_type": "enterprise"}, "included_content": ["data_volumes"], "match_resource_type": "instance"}'
responses.add(
- responses.PATCH,
+ responses.POST,
url,
body=mock_response,
content_type='application/json',
- status=200,
+ status=201,
)
# Construct a dict representation of a ZoneIdentityByName model
zone_identity_model = {}
zone_identity_model['name'] = 'us-south-1'
- # Construct a dict representation of a BackupPolicyPlanClonePolicyPatch model
- backup_policy_plan_clone_policy_patch_model = {}
- backup_policy_plan_clone_policy_patch_model['max_snapshots'] = 1
- backup_policy_plan_clone_policy_patch_model['zones'] = [zone_identity_model]
+ # Construct a dict representation of a BackupPolicyPlanClonePolicyPrototype model
+ backup_policy_plan_clone_policy_prototype_model = {}
+ backup_policy_plan_clone_policy_prototype_model['max_snapshots'] = 5
+ backup_policy_plan_clone_policy_prototype_model['zones'] = [zone_identity_model]
- # Construct a dict representation of a BackupPolicyPlanDeletionTriggerPatch model
- backup_policy_plan_deletion_trigger_patch_model = {}
- backup_policy_plan_deletion_trigger_patch_model['delete_after'] = 20
- backup_policy_plan_deletion_trigger_patch_model['delete_over_count'] = 1
+ # Construct a dict representation of a BackupPolicyPlanDeletionTriggerPrototype model
+ backup_policy_plan_deletion_trigger_prototype_model = {}
+ backup_policy_plan_deletion_trigger_prototype_model['delete_after'] = 20
+ backup_policy_plan_deletion_trigger_prototype_model['delete_over_count'] = 20
# Construct a dict representation of a EncryptionKeyIdentityByCRN model
encryption_key_identity_model = {}
@@ -18408,75 +19009,88 @@ def test_update_backup_policy_plan_required_params(self):
backup_policy_plan_remote_region_policy_prototype_model['encryption_key'] = encryption_key_identity_model
backup_policy_plan_remote_region_policy_prototype_model['region'] = region_identity_model
- # Construct a dict representation of a BackupPolicyPlanPatch model
- backup_policy_plan_patch_model = {}
- backup_policy_plan_patch_model['active'] = True
- backup_policy_plan_patch_model['attach_user_tags'] = ['my-daily-backup-plan']
- backup_policy_plan_patch_model['clone_policy'] = backup_policy_plan_clone_policy_patch_model
- backup_policy_plan_patch_model['copy_user_tags'] = True
- backup_policy_plan_patch_model['cron_spec'] = '30 */2 * * 1-5'
- backup_policy_plan_patch_model['deletion_trigger'] = backup_policy_plan_deletion_trigger_patch_model
- backup_policy_plan_patch_model['name'] = 'my-policy-plan'
- backup_policy_plan_patch_model['remote_region_policies'] = [backup_policy_plan_remote_region_policy_prototype_model]
+ # Construct a dict representation of a BackupPolicyPlanPrototype model
+ backup_policy_plan_prototype_model = {}
+ backup_policy_plan_prototype_model['active'] = True
+ backup_policy_plan_prototype_model['attach_user_tags'] = ['my-daily-backup-plan']
+ backup_policy_plan_prototype_model['clone_policy'] = backup_policy_plan_clone_policy_prototype_model
+ backup_policy_plan_prototype_model['copy_user_tags'] = True
+ backup_policy_plan_prototype_model['cron_spec'] = '30 */2 * * 1-5'
+ backup_policy_plan_prototype_model['deletion_trigger'] = backup_policy_plan_deletion_trigger_prototype_model
+ backup_policy_plan_prototype_model['name'] = 'my-policy-plan'
+ backup_policy_plan_prototype_model['remote_region_policies'] = [backup_policy_plan_remote_region_policy_prototype_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 BackupPolicyScopePrototypeEnterpriseIdentityEnterpriseIdentityByCRN model
+ backup_policy_scope_prototype_model = {}
+ backup_policy_scope_prototype_model['crn'] = 'crn:v1:bluemix:public:enterprise::a/123456::enterprise:ebc2b430240943458b9e91e1432cfcce'
+
+ # Construct a dict representation of a BackupPolicyPrototypeBackupPolicyMatchResourceTypeVolumePrototype model
+ backup_policy_prototype_model = {}
+ backup_policy_prototype_model['match_user_tags'] = ['my-daily-backup-policy']
+ backup_policy_prototype_model['name'] = 'my-backup-policy'
+ backup_policy_prototype_model['plans'] = [backup_policy_plan_prototype_model]
+ backup_policy_prototype_model['resource_group'] = resource_group_identity_model
+ backup_policy_prototype_model['scope'] = backup_policy_scope_prototype_model
+ backup_policy_prototype_model['match_resource_type'] = 'volume'
# Set up parameter values
- backup_policy_id = 'testString'
- id = 'testString'
- backup_policy_plan_patch = backup_policy_plan_patch_model
+ backup_policy_prototype = backup_policy_prototype_model
# Invoke method
- response = _service.update_backup_policy_plan(
- backup_policy_id,
- id,
- backup_policy_plan_patch,
+ response = _service.create_backup_policy(
+ backup_policy_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 == backup_policy_plan_patch
+ assert req_body == backup_policy_prototype
- def test_update_backup_policy_plan_required_params_with_retries(self):
- # Enable retries and run test_update_backup_policy_plan_required_params.
+ def test_create_backup_policy_all_params_with_retries(self):
+ # Enable retries and run test_create_backup_policy_all_params.
_service.enable_retries()
- self.test_update_backup_policy_plan_required_params()
+ self.test_create_backup_policy_all_params()
- # Disable retries and run test_update_backup_policy_plan_required_params.
+ # Disable retries and run test_create_backup_policy_all_params.
_service.disable_retries()
- self.test_update_backup_policy_plan_required_params()
+ self.test_create_backup_policy_all_params()
@responses.activate
- def test_update_backup_policy_plan_value_error(self):
+ def test_create_backup_policy_value_error(self):
"""
- test_update_backup_policy_plan_value_error()
+ test_create_backup_policy_value_error()
"""
# Set up mock
- url = preprocess_url('/backup_policies/testString/plans/testString')
- mock_response = '{"active": true, "attach_user_tags": ["attach_user_tags"], "clone_policy": {"max_snapshots": 1, "zones": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}]}, "copy_user_tags": true, "created_at": "2019-01-01T12:00:00.000Z", "cron_spec": "30 */2 * * 1-5", "deletion_trigger": {"delete_after": 20, "delete_over_count": 20}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "lifecycle_state": "stable", "name": "my-policy-plan", "remote_region_policies": [{"delete_over_count": 1, "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}], "resource_type": "backup_policy_plan"}'
+ url = preprocess_url('/backup_policies')
+ mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::backup-policy:r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "health_reasons": [{"code": "missing_service_authorization_policies", "message": "One or more accounts are missing service authorization policies", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-backup-service-about&interface=ui"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "id": "r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "last_job_completed_at": "2019-01-01T12:00:00.000Z", "lifecycle_state": "stable", "match_user_tags": ["match_user_tags"], "name": "my-backup-policy", "plans": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "backup_policy", "scope": {"crn": "crn:v1:bluemix:public:enterprise::a/123456::enterprise:ebc2b430240943458b9e91e1432cfcce", "id": "fee82deba12e4c0fb69c3b09d1f12345", "resource_type": "enterprise"}, "included_content": ["data_volumes"], "match_resource_type": "instance"}'
responses.add(
- responses.PATCH,
+ responses.POST,
url,
body=mock_response,
content_type='application/json',
- status=200,
+ status=201,
)
# Construct a dict representation of a ZoneIdentityByName model
zone_identity_model = {}
zone_identity_model['name'] = 'us-south-1'
- # Construct a dict representation of a BackupPolicyPlanClonePolicyPatch model
- backup_policy_plan_clone_policy_patch_model = {}
- backup_policy_plan_clone_policy_patch_model['max_snapshots'] = 1
- backup_policy_plan_clone_policy_patch_model['zones'] = [zone_identity_model]
+ # Construct a dict representation of a BackupPolicyPlanClonePolicyPrototype model
+ backup_policy_plan_clone_policy_prototype_model = {}
+ backup_policy_plan_clone_policy_prototype_model['max_snapshots'] = 5
+ backup_policy_plan_clone_policy_prototype_model['zones'] = [zone_identity_model]
- # Construct a dict representation of a BackupPolicyPlanDeletionTriggerPatch model
- backup_policy_plan_deletion_trigger_patch_model = {}
- backup_policy_plan_deletion_trigger_patch_model['delete_after'] = 20
- backup_policy_plan_deletion_trigger_patch_model['delete_over_count'] = 1
+ # Construct a dict representation of a BackupPolicyPlanDeletionTriggerPrototype model
+ backup_policy_plan_deletion_trigger_prototype_model = {}
+ backup_policy_plan_deletion_trigger_prototype_model['delete_after'] = 20
+ backup_policy_plan_deletion_trigger_prototype_model['delete_over_count'] = 20
# Construct a dict representation of a EncryptionKeyIdentityByCRN model
encryption_key_identity_model = {}
@@ -18492,177 +19106,298 @@ def test_update_backup_policy_plan_value_error(self):
backup_policy_plan_remote_region_policy_prototype_model['encryption_key'] = encryption_key_identity_model
backup_policy_plan_remote_region_policy_prototype_model['region'] = region_identity_model
- # Construct a dict representation of a BackupPolicyPlanPatch model
- backup_policy_plan_patch_model = {}
- backup_policy_plan_patch_model['active'] = True
- backup_policy_plan_patch_model['attach_user_tags'] = ['my-daily-backup-plan']
- backup_policy_plan_patch_model['clone_policy'] = backup_policy_plan_clone_policy_patch_model
- backup_policy_plan_patch_model['copy_user_tags'] = True
- backup_policy_plan_patch_model['cron_spec'] = '30 */2 * * 1-5'
- backup_policy_plan_patch_model['deletion_trigger'] = backup_policy_plan_deletion_trigger_patch_model
- backup_policy_plan_patch_model['name'] = 'my-policy-plan'
- backup_policy_plan_patch_model['remote_region_policies'] = [backup_policy_plan_remote_region_policy_prototype_model]
+ # Construct a dict representation of a BackupPolicyPlanPrototype model
+ backup_policy_plan_prototype_model = {}
+ backup_policy_plan_prototype_model['active'] = True
+ backup_policy_plan_prototype_model['attach_user_tags'] = ['my-daily-backup-plan']
+ backup_policy_plan_prototype_model['clone_policy'] = backup_policy_plan_clone_policy_prototype_model
+ backup_policy_plan_prototype_model['copy_user_tags'] = True
+ backup_policy_plan_prototype_model['cron_spec'] = '30 */2 * * 1-5'
+ backup_policy_plan_prototype_model['deletion_trigger'] = backup_policy_plan_deletion_trigger_prototype_model
+ backup_policy_plan_prototype_model['name'] = 'my-policy-plan'
+ backup_policy_plan_prototype_model['remote_region_policies'] = [backup_policy_plan_remote_region_policy_prototype_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 BackupPolicyScopePrototypeEnterpriseIdentityEnterpriseIdentityByCRN model
+ backup_policy_scope_prototype_model = {}
+ backup_policy_scope_prototype_model['crn'] = 'crn:v1:bluemix:public:enterprise::a/123456::enterprise:ebc2b430240943458b9e91e1432cfcce'
+
+ # Construct a dict representation of a BackupPolicyPrototypeBackupPolicyMatchResourceTypeVolumePrototype model
+ backup_policy_prototype_model = {}
+ backup_policy_prototype_model['match_user_tags'] = ['my-daily-backup-policy']
+ backup_policy_prototype_model['name'] = 'my-backup-policy'
+ backup_policy_prototype_model['plans'] = [backup_policy_plan_prototype_model]
+ backup_policy_prototype_model['resource_group'] = resource_group_identity_model
+ backup_policy_prototype_model['scope'] = backup_policy_scope_prototype_model
+ backup_policy_prototype_model['match_resource_type'] = 'volume'
# Set up parameter values
- backup_policy_id = 'testString'
- id = 'testString'
- backup_policy_plan_patch = backup_policy_plan_patch_model
+ backup_policy_prototype = backup_policy_prototype_model
# Pass in all but one required param and check for a ValueError
req_param_dict = {
- "backup_policy_id": backup_policy_id,
- "id": id,
- "backup_policy_plan_patch": backup_policy_plan_patch,
+ "backup_policy_prototype": backup_policy_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_backup_policy_plan(**req_copy)
+ _service.create_backup_policy(**req_copy)
- def test_update_backup_policy_plan_value_error_with_retries(self):
- # Enable retries and run test_update_backup_policy_plan_value_error.
+ def test_create_backup_policy_value_error_with_retries(self):
+ # Enable retries and run test_create_backup_policy_value_error.
_service.enable_retries()
- self.test_update_backup_policy_plan_value_error()
+ self.test_create_backup_policy_value_error()
- # Disable retries and run test_update_backup_policy_plan_value_error.
+ # Disable retries and run test_create_backup_policy_value_error.
_service.disable_retries()
- self.test_update_backup_policy_plan_value_error()
+ self.test_create_backup_policy_value_error()
-class TestDeleteBackupPolicy:
+class TestListBackupPolicyJobs:
"""
- Test Class for delete_backup_policy
+ Test Class for list_backup_policy_jobs
"""
@responses.activate
- def test_delete_backup_policy_all_params(self):
+ def test_list_backup_policy_jobs_all_params(self):
"""
- delete_backup_policy()
+ list_backup_policy_jobs()
"""
# Set up mock
- url = preprocess_url('/backup_policies/testString')
- mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::backup-policy:r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "health_reasons": [{"code": "missing_service_authorization_policies", "message": "One or more accounts are missing service authorization policies", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-backup-service-about&interface=ui"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "id": "r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "last_job_completed_at": "2019-01-01T12:00:00.000Z", "lifecycle_state": "stable", "match_resource_types": ["volume"], "match_user_tags": ["match_user_tags"], "name": "my-backup-policy", "plans": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "backup_policy", "scope": {"crn": "crn:v1:bluemix:public:enterprise::a/123456::enterprise:ebc2b430240943458b9e91e1432cfcce", "id": "fee82deba12e4c0fb69c3b09d1f12345", "resource_type": "enterprise"}}'
+ url = preprocess_url('/backup_policies/testString/jobs')
+ mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/7241e2a8-601f-11ea-8503-000c29475bed/jobs?limit=20"}, "jobs": [{"auto_delete": true, "auto_delete_after": 90, "backup_policy_plan": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}, "completed_at": "2019-01-01T12:00:00.000Z", "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/0fe9e5d8-0a4d-4818-96ec-e99708644a58/jobs/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "job_type": "creation", "resource_type": "backup_policy_job", "source": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "volume"}, "status": "failed", "status_reasons": [{"code": "source_volume_busy", "message": "message", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-troubleshooting-backup-for-vpc"}], "target_snapshots": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}]}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/7241e2a8-601f-11ea-8503-000c29475bed/jobss?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}'
responses.add(
- responses.DELETE,
+ responses.GET,
url,
body=mock_response,
content_type='application/json',
- status=202,
+ status=200,
)
# Set up parameter values
- id = 'testString'
- if_match = 'W/"96d225c4-56bd-43d9-98fc-d7148e5c5028"'
+ backup_policy_id = 'testString'
+ status = 'failed'
+ backup_policy_plan_id = 'testString'
+ start = 'testString'
+ limit = 50
+ sort = 'name'
+ source_id = 'testString'
+ target_snapshots_id = 'testString'
+ target_snapshots_crn = 'crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263'
# Invoke method
- response = _service.delete_backup_policy(
- id,
- if_match=if_match,
- headers={},
+ response = _service.list_backup_policy_jobs(
+ backup_policy_id,
+ status=status,
+ backup_policy_plan_id=backup_policy_plan_id,
+ start=start,
+ limit=limit,
+ sort=sort,
+ source_id=source_id,
+ target_snapshots_id=target_snapshots_id,
+ target_snapshots_crn=target_snapshots_crn,
+ headers={},
)
# Check for correct operation
assert len(responses.calls) == 1
- assert response.status_code == 202
+ assert response.status_code == 200
+ # Validate query params
+ query_string = responses.calls[0].request.url.split('?', 1)[1]
+ query_string = urllib.parse.unquote_plus(query_string)
+ assert 'status={}'.format(status) in query_string
+ assert 'backup_policy_plan.id={}'.format(backup_policy_plan_id) in query_string
+ assert 'start={}'.format(start) in query_string
+ assert 'limit={}'.format(limit) in query_string
+ assert 'sort={}'.format(sort) in query_string
+ assert 'source.id={}'.format(source_id) in query_string
+ assert 'target_snapshots[].id={}'.format(target_snapshots_id) in query_string
+ assert 'target_snapshots[].crn={}'.format(target_snapshots_crn) in query_string
- def test_delete_backup_policy_all_params_with_retries(self):
- # Enable retries and run test_delete_backup_policy_all_params.
+ def test_list_backup_policy_jobs_all_params_with_retries(self):
+ # Enable retries and run test_list_backup_policy_jobs_all_params.
_service.enable_retries()
- self.test_delete_backup_policy_all_params()
+ self.test_list_backup_policy_jobs_all_params()
- # Disable retries and run test_delete_backup_policy_all_params.
+ # Disable retries and run test_list_backup_policy_jobs_all_params.
_service.disable_retries()
- self.test_delete_backup_policy_all_params()
+ self.test_list_backup_policy_jobs_all_params()
@responses.activate
- def test_delete_backup_policy_required_params(self):
+ def test_list_backup_policy_jobs_required_params(self):
"""
- test_delete_backup_policy_required_params()
+ test_list_backup_policy_jobs_required_params()
"""
# Set up mock
- url = preprocess_url('/backup_policies/testString')
- mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::backup-policy:r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "health_reasons": [{"code": "missing_service_authorization_policies", "message": "One or more accounts are missing service authorization policies", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-backup-service-about&interface=ui"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "id": "r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "last_job_completed_at": "2019-01-01T12:00:00.000Z", "lifecycle_state": "stable", "match_resource_types": ["volume"], "match_user_tags": ["match_user_tags"], "name": "my-backup-policy", "plans": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "backup_policy", "scope": {"crn": "crn:v1:bluemix:public:enterprise::a/123456::enterprise:ebc2b430240943458b9e91e1432cfcce", "id": "fee82deba12e4c0fb69c3b09d1f12345", "resource_type": "enterprise"}}'
+ url = preprocess_url('/backup_policies/testString/jobs')
+ mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/7241e2a8-601f-11ea-8503-000c29475bed/jobs?limit=20"}, "jobs": [{"auto_delete": true, "auto_delete_after": 90, "backup_policy_plan": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}, "completed_at": "2019-01-01T12:00:00.000Z", "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/0fe9e5d8-0a4d-4818-96ec-e99708644a58/jobs/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "job_type": "creation", "resource_type": "backup_policy_job", "source": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "volume"}, "status": "failed", "status_reasons": [{"code": "source_volume_busy", "message": "message", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-troubleshooting-backup-for-vpc"}], "target_snapshots": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}]}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/7241e2a8-601f-11ea-8503-000c29475bed/jobss?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}'
responses.add(
- responses.DELETE,
+ responses.GET,
url,
body=mock_response,
content_type='application/json',
- status=202,
+ status=200,
)
# Set up parameter values
- id = 'testString'
+ backup_policy_id = 'testString'
# Invoke method
- response = _service.delete_backup_policy(
- id,
+ response = _service.list_backup_policy_jobs(
+ backup_policy_id,
headers={},
)
# Check for correct operation
assert len(responses.calls) == 1
- assert response.status_code == 202
+ assert response.status_code == 200
- def test_delete_backup_policy_required_params_with_retries(self):
- # Enable retries and run test_delete_backup_policy_required_params.
+ def test_list_backup_policy_jobs_required_params_with_retries(self):
+ # Enable retries and run test_list_backup_policy_jobs_required_params.
_service.enable_retries()
- self.test_delete_backup_policy_required_params()
+ self.test_list_backup_policy_jobs_required_params()
- # Disable retries and run test_delete_backup_policy_required_params.
+ # Disable retries and run test_list_backup_policy_jobs_required_params.
_service.disable_retries()
- self.test_delete_backup_policy_required_params()
+ self.test_list_backup_policy_jobs_required_params()
@responses.activate
- def test_delete_backup_policy_value_error(self):
+ def test_list_backup_policy_jobs_value_error(self):
"""
- test_delete_backup_policy_value_error()
+ test_list_backup_policy_jobs_value_error()
"""
# Set up mock
- url = preprocess_url('/backup_policies/testString')
- mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::backup-policy:r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "health_reasons": [{"code": "missing_service_authorization_policies", "message": "One or more accounts are missing service authorization policies", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-backup-service-about&interface=ui"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "id": "r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "last_job_completed_at": "2019-01-01T12:00:00.000Z", "lifecycle_state": "stable", "match_resource_types": ["volume"], "match_user_tags": ["match_user_tags"], "name": "my-backup-policy", "plans": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "backup_policy", "scope": {"crn": "crn:v1:bluemix:public:enterprise::a/123456::enterprise:ebc2b430240943458b9e91e1432cfcce", "id": "fee82deba12e4c0fb69c3b09d1f12345", "resource_type": "enterprise"}}'
+ url = preprocess_url('/backup_policies/testString/jobs')
+ mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/7241e2a8-601f-11ea-8503-000c29475bed/jobs?limit=20"}, "jobs": [{"auto_delete": true, "auto_delete_after": 90, "backup_policy_plan": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}, "completed_at": "2019-01-01T12:00:00.000Z", "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/0fe9e5d8-0a4d-4818-96ec-e99708644a58/jobs/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "job_type": "creation", "resource_type": "backup_policy_job", "source": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "volume"}, "status": "failed", "status_reasons": [{"code": "source_volume_busy", "message": "message", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-troubleshooting-backup-for-vpc"}], "target_snapshots": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}]}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/7241e2a8-601f-11ea-8503-000c29475bed/jobss?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}'
responses.add(
- responses.DELETE,
+ responses.GET,
url,
body=mock_response,
content_type='application/json',
- status=202,
+ status=200,
)
# Set up parameter values
- id = 'testString'
+ backup_policy_id = 'testString'
# Pass in all but one required param and check for a ValueError
req_param_dict = {
- "id": id,
+ "backup_policy_id": backup_policy_id,
}
for param in req_param_dict.keys():
req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()}
with pytest.raises(ValueError):
- _service.delete_backup_policy(**req_copy)
+ _service.list_backup_policy_jobs(**req_copy)
- def test_delete_backup_policy_value_error_with_retries(self):
- # Enable retries and run test_delete_backup_policy_value_error.
+ def test_list_backup_policy_jobs_value_error_with_retries(self):
+ # Enable retries and run test_list_backup_policy_jobs_value_error.
_service.enable_retries()
- self.test_delete_backup_policy_value_error()
+ self.test_list_backup_policy_jobs_value_error()
- # Disable retries and run test_delete_backup_policy_value_error.
+ # Disable retries and run test_list_backup_policy_jobs_value_error.
_service.disable_retries()
- self.test_delete_backup_policy_value_error()
+ self.test_list_backup_policy_jobs_value_error()
+ @responses.activate
+ def test_list_backup_policy_jobs_with_pager_get_next(self):
+ """
+ test_list_backup_policy_jobs_with_pager_get_next()
+ """
+ # Set up a two-page mock response
+ url = preprocess_url('/backup_policies/testString/jobs')
+ mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"jobs":[{"auto_delete":true,"auto_delete_after":90,"backup_policy_plan":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178","id":"r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178","name":"my-policy-plan","remote":{"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"backup_policy_plan"},"completed_at":"2019-01-01T12:00:00.000Z","created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/0fe9e5d8-0a4d-4818-96ec-e99708644a58/jobs/4cf9171a-0043-4434-8727-15b53dbc374c","id":"4cf9171a-0043-4434-8727-15b53dbc374c","job_type":"creation","resource_type":"backup_policy_job","source":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5","id":"1a6b7274-678d-4dfb-8981-c71dd9d4daa5","name":"my-volume","remote":{"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"volume"},"status":"failed","status_reasons":[{"code":"source_volume_busy","message":"message","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-troubleshooting-backup-for-vpc"}],"target_snapshots":[{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263","id":"r134-f6bfa329-0e36-433f-a3bb-0df632e79263","name":"my-snapshot","remote":{"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"snapshot"}]}],"limit":1}'
+ mock_response2 = '{"total_count":2,"jobs":[{"auto_delete":true,"auto_delete_after":90,"backup_policy_plan":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178","id":"r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178","name":"my-policy-plan","remote":{"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"backup_policy_plan"},"completed_at":"2019-01-01T12:00:00.000Z","created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/0fe9e5d8-0a4d-4818-96ec-e99708644a58/jobs/4cf9171a-0043-4434-8727-15b53dbc374c","id":"4cf9171a-0043-4434-8727-15b53dbc374c","job_type":"creation","resource_type":"backup_policy_job","source":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5","id":"1a6b7274-678d-4dfb-8981-c71dd9d4daa5","name":"my-volume","remote":{"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"volume"},"status":"failed","status_reasons":[{"code":"source_volume_busy","message":"message","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-troubleshooting-backup-for-vpc"}],"target_snapshots":[{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263","id":"r134-f6bfa329-0e36-433f-a3bb-0df632e79263","name":"my-snapshot","remote":{"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"snapshot"}]}],"limit":1}'
+ responses.add(
+ responses.GET,
+ url,
+ body=mock_response1,
+ content_type='application/json',
+ status=200,
+ )
+ responses.add(
+ responses.GET,
+ url,
+ body=mock_response2,
+ content_type='application/json',
+ status=200,
+ )
-class TestGetBackupPolicy:
+ # Exercise the pager class for this operation
+ all_results = []
+ pager = BackupPolicyJobsPager(
+ client=_service,
+ backup_policy_id='testString',
+ status='failed',
+ backup_policy_plan_id='testString',
+ limit=10,
+ sort='name',
+ source_id='testString',
+ target_snapshots_id='testString',
+ target_snapshots_crn='crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263',
+ )
+ while pager.has_next():
+ next_page = pager.get_next()
+ assert next_page is not None
+ all_results.extend(next_page)
+ assert len(all_results) == 2
+
+ @responses.activate
+ def test_list_backup_policy_jobs_with_pager_get_all(self):
+ """
+ test_list_backup_policy_jobs_with_pager_get_all()
+ """
+ # Set up a two-page mock response
+ url = preprocess_url('/backup_policies/testString/jobs')
+ mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"jobs":[{"auto_delete":true,"auto_delete_after":90,"backup_policy_plan":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178","id":"r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178","name":"my-policy-plan","remote":{"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"backup_policy_plan"},"completed_at":"2019-01-01T12:00:00.000Z","created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/0fe9e5d8-0a4d-4818-96ec-e99708644a58/jobs/4cf9171a-0043-4434-8727-15b53dbc374c","id":"4cf9171a-0043-4434-8727-15b53dbc374c","job_type":"creation","resource_type":"backup_policy_job","source":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5","id":"1a6b7274-678d-4dfb-8981-c71dd9d4daa5","name":"my-volume","remote":{"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"volume"},"status":"failed","status_reasons":[{"code":"source_volume_busy","message":"message","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-troubleshooting-backup-for-vpc"}],"target_snapshots":[{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263","id":"r134-f6bfa329-0e36-433f-a3bb-0df632e79263","name":"my-snapshot","remote":{"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"snapshot"}]}],"limit":1}'
+ mock_response2 = '{"total_count":2,"jobs":[{"auto_delete":true,"auto_delete_after":90,"backup_policy_plan":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178","id":"r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178","name":"my-policy-plan","remote":{"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"backup_policy_plan"},"completed_at":"2019-01-01T12:00:00.000Z","created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/0fe9e5d8-0a4d-4818-96ec-e99708644a58/jobs/4cf9171a-0043-4434-8727-15b53dbc374c","id":"4cf9171a-0043-4434-8727-15b53dbc374c","job_type":"creation","resource_type":"backup_policy_job","source":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5","id":"1a6b7274-678d-4dfb-8981-c71dd9d4daa5","name":"my-volume","remote":{"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"volume"},"status":"failed","status_reasons":[{"code":"source_volume_busy","message":"message","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-troubleshooting-backup-for-vpc"}],"target_snapshots":[{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263","id":"r134-f6bfa329-0e36-433f-a3bb-0df632e79263","name":"my-snapshot","remote":{"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"snapshot"}]}],"limit":1}'
+ responses.add(
+ responses.GET,
+ url,
+ body=mock_response1,
+ content_type='application/json',
+ status=200,
+ )
+ responses.add(
+ responses.GET,
+ url,
+ body=mock_response2,
+ content_type='application/json',
+ status=200,
+ )
+
+ # Exercise the pager class for this operation
+ pager = BackupPolicyJobsPager(
+ client=_service,
+ backup_policy_id='testString',
+ status='failed',
+ backup_policy_plan_id='testString',
+ limit=10,
+ sort='name',
+ source_id='testString',
+ target_snapshots_id='testString',
+ target_snapshots_crn='crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263',
+ )
+ all_results = pager.get_all()
+ assert all_results is not None
+ assert len(all_results) == 2
+
+
+class TestGetBackupPolicyJob:
"""
- Test Class for get_backup_policy
+ Test Class for get_backup_policy_job
"""
@responses.activate
- def test_get_backup_policy_all_params(self):
+ def test_get_backup_policy_job_all_params(self):
"""
- get_backup_policy()
+ get_backup_policy_job()
"""
# Set up mock
- url = preprocess_url('/backup_policies/testString')
- mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::backup-policy:r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "health_reasons": [{"code": "missing_service_authorization_policies", "message": "One or more accounts are missing service authorization policies", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-backup-service-about&interface=ui"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "id": "r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "last_job_completed_at": "2019-01-01T12:00:00.000Z", "lifecycle_state": "stable", "match_resource_types": ["volume"], "match_user_tags": ["match_user_tags"], "name": "my-backup-policy", "plans": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "backup_policy", "scope": {"crn": "crn:v1:bluemix:public:enterprise::a/123456::enterprise:ebc2b430240943458b9e91e1432cfcce", "id": "fee82deba12e4c0fb69c3b09d1f12345", "resource_type": "enterprise"}}'
+ url = preprocess_url('/backup_policies/testString/jobs/testString')
+ mock_response = '{"auto_delete": true, "auto_delete_after": 90, "backup_policy_plan": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}, "completed_at": "2019-01-01T12:00:00.000Z", "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/0fe9e5d8-0a4d-4818-96ec-e99708644a58/jobs/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "job_type": "creation", "resource_type": "backup_policy_job", "source": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "volume"}, "status": "failed", "status_reasons": [{"code": "source_volume_busy", "message": "message", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-troubleshooting-backup-for-vpc"}], "target_snapshots": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}]}'
responses.add(
responses.GET,
url,
@@ -18672,10 +19407,12 @@ def test_get_backup_policy_all_params(self):
)
# Set up parameter values
+ backup_policy_id = 'testString'
id = 'testString'
# Invoke method
- response = _service.get_backup_policy(
+ response = _service.get_backup_policy_job(
+ backup_policy_id,
id,
headers={},
)
@@ -18684,23 +19421,23 @@ def test_get_backup_policy_all_params(self):
assert len(responses.calls) == 1
assert response.status_code == 200
- def test_get_backup_policy_all_params_with_retries(self):
- # Enable retries and run test_get_backup_policy_all_params.
+ def test_get_backup_policy_job_all_params_with_retries(self):
+ # Enable retries and run test_get_backup_policy_job_all_params.
_service.enable_retries()
- self.test_get_backup_policy_all_params()
+ self.test_get_backup_policy_job_all_params()
- # Disable retries and run test_get_backup_policy_all_params.
+ # Disable retries and run test_get_backup_policy_job_all_params.
_service.disable_retries()
- self.test_get_backup_policy_all_params()
+ self.test_get_backup_policy_job_all_params()
@responses.activate
- def test_get_backup_policy_value_error(self):
+ def test_get_backup_policy_job_value_error(self):
"""
- test_get_backup_policy_value_error()
+ test_get_backup_policy_job_value_error()
"""
# Set up mock
- url = preprocess_url('/backup_policies/testString')
- mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::backup-policy:r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "health_reasons": [{"code": "missing_service_authorization_policies", "message": "One or more accounts are missing service authorization policies", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-backup-service-about&interface=ui"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "id": "r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "last_job_completed_at": "2019-01-01T12:00:00.000Z", "lifecycle_state": "stable", "match_resource_types": ["volume"], "match_user_tags": ["match_user_tags"], "name": "my-backup-policy", "plans": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "backup_policy", "scope": {"crn": "crn:v1:bluemix:public:enterprise::a/123456::enterprise:ebc2b430240943458b9e91e1432cfcce", "id": "fee82deba12e4c0fb69c3b09d1f12345", "resource_type": "enterprise"}}'
+ url = preprocess_url('/backup_policies/testString/jobs/testString')
+ mock_response = '{"auto_delete": true, "auto_delete_after": 90, "backup_policy_plan": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}, "completed_at": "2019-01-01T12:00:00.000Z", "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/0fe9e5d8-0a4d-4818-96ec-e99708644a58/jobs/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "job_type": "creation", "resource_type": "backup_policy_job", "source": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "volume"}, "status": "failed", "status_reasons": [{"code": "source_volume_busy", "message": "message", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-troubleshooting-backup-for-vpc"}], "target_snapshots": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}]}'
responses.add(
responses.GET,
url,
@@ -18710,540 +19447,396 @@ def test_get_backup_policy_value_error(self):
)
# Set up parameter values
+ backup_policy_id = 'testString'
id = 'testString'
# Pass in all but one required param and check for a ValueError
req_param_dict = {
+ "backup_policy_id": backup_policy_id,
"id": id,
}
for param in req_param_dict.keys():
req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()}
with pytest.raises(ValueError):
- _service.get_backup_policy(**req_copy)
+ _service.get_backup_policy_job(**req_copy)
- def test_get_backup_policy_value_error_with_retries(self):
- # Enable retries and run test_get_backup_policy_value_error.
+ def test_get_backup_policy_job_value_error_with_retries(self):
+ # Enable retries and run test_get_backup_policy_job_value_error.
_service.enable_retries()
- self.test_get_backup_policy_value_error()
+ self.test_get_backup_policy_job_value_error()
- # Disable retries and run test_get_backup_policy_value_error.
+ # Disable retries and run test_get_backup_policy_job_value_error.
_service.disable_retries()
- self.test_get_backup_policy_value_error()
+ self.test_get_backup_policy_job_value_error()
-class TestUpdateBackupPolicy:
+class TestListBackupPolicyPlans:
"""
- Test Class for update_backup_policy
+ Test Class for list_backup_policy_plans
"""
@responses.activate
- def test_update_backup_policy_all_params(self):
+ def test_list_backup_policy_plans_all_params(self):
"""
- update_backup_policy()
+ list_backup_policy_plans()
"""
# Set up mock
- url = preprocess_url('/backup_policies/testString')
- mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::backup-policy:r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "health_reasons": [{"code": "missing_service_authorization_policies", "message": "One or more accounts are missing service authorization policies", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-backup-service-about&interface=ui"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "id": "r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "last_job_completed_at": "2019-01-01T12:00:00.000Z", "lifecycle_state": "stable", "match_resource_types": ["volume"], "match_user_tags": ["match_user_tags"], "name": "my-backup-policy", "plans": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "backup_policy", "scope": {"crn": "crn:v1:bluemix:public:enterprise::a/123456::enterprise:ebc2b430240943458b9e91e1432cfcce", "id": "fee82deba12e4c0fb69c3b09d1f12345", "resource_type": "enterprise"}}'
+ url = preprocess_url('/backup_policies/testString/plans')
+ mock_response = '{"plans": [{"active": true, "attach_user_tags": ["attach_user_tags"], "clone_policy": {"max_snapshots": 1, "zones": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}]}, "copy_user_tags": true, "created_at": "2019-01-01T12:00:00.000Z", "cron_spec": "30 */2 * * 1-5", "deletion_trigger": {"delete_after": 20, "delete_over_count": 20}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "lifecycle_state": "stable", "name": "my-policy-plan", "remote_region_policies": [{"delete_over_count": 1, "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}], "resource_type": "backup_policy_plan"}]}'
responses.add(
- responses.PATCH,
+ responses.GET,
url,
body=mock_response,
content_type='application/json',
status=200,
)
- # Construct a dict representation of a BackupPolicyPatch model
- backup_policy_patch_model = {}
- backup_policy_patch_model['match_user_tags'] = ['my-daily-backup-policy']
- backup_policy_patch_model['name'] = 'my-backup-policy'
-
# Set up parameter values
- id = 'testString'
- backup_policy_patch = backup_policy_patch_model
- if_match = 'W/"96d225c4-56bd-43d9-98fc-d7148e5c5028"'
+ backup_policy_id = 'testString'
+ name = 'testString'
# Invoke method
- response = _service.update_backup_policy(
- id,
- backup_policy_patch,
- if_match=if_match,
+ response = _service.list_backup_policy_plans(
+ backup_policy_id,
+ 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 == backup_policy_patch
+ # 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
- def test_update_backup_policy_all_params_with_retries(self):
- # Enable retries and run test_update_backup_policy_all_params.
+ def test_list_backup_policy_plans_all_params_with_retries(self):
+ # Enable retries and run test_list_backup_policy_plans_all_params.
_service.enable_retries()
- self.test_update_backup_policy_all_params()
+ self.test_list_backup_policy_plans_all_params()
- # Disable retries and run test_update_backup_policy_all_params.
+ # Disable retries and run test_list_backup_policy_plans_all_params.
_service.disable_retries()
- self.test_update_backup_policy_all_params()
+ self.test_list_backup_policy_plans_all_params()
@responses.activate
- def test_update_backup_policy_required_params(self):
+ def test_list_backup_policy_plans_required_params(self):
"""
- test_update_backup_policy_required_params()
+ test_list_backup_policy_plans_required_params()
"""
# Set up mock
- url = preprocess_url('/backup_policies/testString')
- mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::backup-policy:r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "health_reasons": [{"code": "missing_service_authorization_policies", "message": "One or more accounts are missing service authorization policies", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-backup-service-about&interface=ui"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "id": "r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "last_job_completed_at": "2019-01-01T12:00:00.000Z", "lifecycle_state": "stable", "match_resource_types": ["volume"], "match_user_tags": ["match_user_tags"], "name": "my-backup-policy", "plans": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "backup_policy", "scope": {"crn": "crn:v1:bluemix:public:enterprise::a/123456::enterprise:ebc2b430240943458b9e91e1432cfcce", "id": "fee82deba12e4c0fb69c3b09d1f12345", "resource_type": "enterprise"}}'
+ url = preprocess_url('/backup_policies/testString/plans')
+ mock_response = '{"plans": [{"active": true, "attach_user_tags": ["attach_user_tags"], "clone_policy": {"max_snapshots": 1, "zones": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}]}, "copy_user_tags": true, "created_at": "2019-01-01T12:00:00.000Z", "cron_spec": "30 */2 * * 1-5", "deletion_trigger": {"delete_after": 20, "delete_over_count": 20}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "lifecycle_state": "stable", "name": "my-policy-plan", "remote_region_policies": [{"delete_over_count": 1, "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}], "resource_type": "backup_policy_plan"}]}'
responses.add(
- responses.PATCH,
+ responses.GET,
url,
body=mock_response,
content_type='application/json',
status=200,
)
- # Construct a dict representation of a BackupPolicyPatch model
- backup_policy_patch_model = {}
- backup_policy_patch_model['match_user_tags'] = ['my-daily-backup-policy']
- backup_policy_patch_model['name'] = 'my-backup-policy'
-
# Set up parameter values
- id = 'testString'
- backup_policy_patch = backup_policy_patch_model
+ backup_policy_id = 'testString'
# Invoke method
- response = _service.update_backup_policy(
- id,
- backup_policy_patch,
+ response = _service.list_backup_policy_plans(
+ backup_policy_id,
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 == backup_policy_patch
- def test_update_backup_policy_required_params_with_retries(self):
- # Enable retries and run test_update_backup_policy_required_params.
+ def test_list_backup_policy_plans_required_params_with_retries(self):
+ # Enable retries and run test_list_backup_policy_plans_required_params.
_service.enable_retries()
- self.test_update_backup_policy_required_params()
+ self.test_list_backup_policy_plans_required_params()
- # Disable retries and run test_update_backup_policy_required_params.
+ # Disable retries and run test_list_backup_policy_plans_required_params.
_service.disable_retries()
- self.test_update_backup_policy_required_params()
+ self.test_list_backup_policy_plans_required_params()
@responses.activate
- def test_update_backup_policy_value_error(self):
+ def test_list_backup_policy_plans_value_error(self):
"""
- test_update_backup_policy_value_error()
+ test_list_backup_policy_plans_value_error()
"""
# Set up mock
- url = preprocess_url('/backup_policies/testString')
- mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::backup-policy:r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "health_reasons": [{"code": "missing_service_authorization_policies", "message": "One or more accounts are missing service authorization policies", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-backup-service-about&interface=ui"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "id": "r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "last_job_completed_at": "2019-01-01T12:00:00.000Z", "lifecycle_state": "stable", "match_resource_types": ["volume"], "match_user_tags": ["match_user_tags"], "name": "my-backup-policy", "plans": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "backup_policy", "scope": {"crn": "crn:v1:bluemix:public:enterprise::a/123456::enterprise:ebc2b430240943458b9e91e1432cfcce", "id": "fee82deba12e4c0fb69c3b09d1f12345", "resource_type": "enterprise"}}'
+ url = preprocess_url('/backup_policies/testString/plans')
+ mock_response = '{"plans": [{"active": true, "attach_user_tags": ["attach_user_tags"], "clone_policy": {"max_snapshots": 1, "zones": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}]}, "copy_user_tags": true, "created_at": "2019-01-01T12:00:00.000Z", "cron_spec": "30 */2 * * 1-5", "deletion_trigger": {"delete_after": 20, "delete_over_count": 20}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "lifecycle_state": "stable", "name": "my-policy-plan", "remote_region_policies": [{"delete_over_count": 1, "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}], "resource_type": "backup_policy_plan"}]}'
responses.add(
- responses.PATCH,
+ responses.GET,
url,
body=mock_response,
content_type='application/json',
status=200,
)
- # Construct a dict representation of a BackupPolicyPatch model
- backup_policy_patch_model = {}
- backup_policy_patch_model['match_user_tags'] = ['my-daily-backup-policy']
- backup_policy_patch_model['name'] = 'my-backup-policy'
-
# Set up parameter values
- id = 'testString'
- backup_policy_patch = backup_policy_patch_model
+ backup_policy_id = 'testString'
# Pass in all but one required param and check for a ValueError
req_param_dict = {
- "id": id,
- "backup_policy_patch": backup_policy_patch,
+ "backup_policy_id": backup_policy_id,
}
for param in req_param_dict.keys():
req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()}
with pytest.raises(ValueError):
- _service.update_backup_policy(**req_copy)
+ _service.list_backup_policy_plans(**req_copy)
- def test_update_backup_policy_value_error_with_retries(self):
- # Enable retries and run test_update_backup_policy_value_error.
+ def test_list_backup_policy_plans_value_error_with_retries(self):
+ # Enable retries and run test_list_backup_policy_plans_value_error.
_service.enable_retries()
- self.test_update_backup_policy_value_error()
+ self.test_list_backup_policy_plans_value_error()
- # Disable retries and run test_update_backup_policy_value_error.
+ # Disable retries and run test_list_backup_policy_plans_value_error.
_service.disable_retries()
- self.test_update_backup_policy_value_error()
-
-
-# endregion
-##############################################################################
-# End of Service: BackupPolicies
-##############################################################################
-
-##############################################################################
-# Start of Service: PlacementGroups
-##############################################################################
-# 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,
- )
+ self.test_list_backup_policy_plans_value_error()
-class TestListPlacementGroups:
+class TestCreateBackupPolicyPlan:
"""
- Test Class for list_placement_groups
+ Test Class for create_backup_policy_plan
"""
@responses.activate
- def test_list_placement_groups_all_params(self):
+ def test_create_backup_policy_plan_all_params(self):
"""
- list_placement_groups()
+ create_backup_policy_plan()
"""
# Set up mock
- 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}'
+ url = preprocess_url('/backup_policies/testString/plans')
+ mock_response = '{"active": true, "attach_user_tags": ["attach_user_tags"], "clone_policy": {"max_snapshots": 1, "zones": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}]}, "copy_user_tags": true, "created_at": "2019-01-01T12:00:00.000Z", "cron_spec": "30 */2 * * 1-5", "deletion_trigger": {"delete_after": 20, "delete_over_count": 20}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "lifecycle_state": "stable", "name": "my-policy-plan", "remote_region_policies": [{"delete_over_count": 1, "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}], "resource_type": "backup_policy_plan"}'
responses.add(
- responses.GET,
+ responses.POST,
url,
body=mock_response,
content_type='application/json',
- status=200,
+ status=201,
)
+ # Construct a dict representation of a ZoneIdentityByName model
+ zone_identity_model = {}
+ zone_identity_model['name'] = 'us-south-1'
+
+ # Construct a dict representation of a BackupPolicyPlanClonePolicyPrototype model
+ backup_policy_plan_clone_policy_prototype_model = {}
+ backup_policy_plan_clone_policy_prototype_model['max_snapshots'] = 5
+ backup_policy_plan_clone_policy_prototype_model['zones'] = [zone_identity_model]
+
+ # Construct a dict representation of a BackupPolicyPlanDeletionTriggerPrototype model
+ backup_policy_plan_deletion_trigger_prototype_model = {}
+ backup_policy_plan_deletion_trigger_prototype_model['delete_after'] = 20
+ backup_policy_plan_deletion_trigger_prototype_model['delete_over_count'] = 20
+
+ # 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/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179'
+
+ # Construct a dict representation of a RegionIdentityByName model
+ region_identity_model = {}
+ region_identity_model['name'] = 'us-south'
+
+ # Construct a dict representation of a BackupPolicyPlanRemoteRegionPolicyPrototype model
+ backup_policy_plan_remote_region_policy_prototype_model = {}
+ backup_policy_plan_remote_region_policy_prototype_model['delete_over_count'] = 5
+ backup_policy_plan_remote_region_policy_prototype_model['encryption_key'] = encryption_key_identity_model
+ backup_policy_plan_remote_region_policy_prototype_model['region'] = region_identity_model
+
# Set up parameter values
- start = 'testString'
- limit = 50
+ backup_policy_id = 'testString'
+ cron_spec = '30 */2 * * 1-5'
+ active = True
+ attach_user_tags = ['my-daily-backup-plan']
+ clone_policy = backup_policy_plan_clone_policy_prototype_model
+ copy_user_tags = True
+ deletion_trigger = backup_policy_plan_deletion_trigger_prototype_model
+ name = 'my-policy-plan'
+ remote_region_policies = [backup_policy_plan_remote_region_policy_prototype_model]
# Invoke method
- response = _service.list_placement_groups(
- start=start,
- limit=limit,
+ response = _service.create_backup_policy_plan(
+ backup_policy_id,
+ cron_spec,
+ active=active,
+ attach_user_tags=attach_user_tags,
+ clone_policy=clone_policy,
+ copy_user_tags=copy_user_tags,
+ deletion_trigger=deletion_trigger,
+ name=name,
+ remote_region_policies=remote_region_policies,
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 == 201
+ # Validate body params
+ req_body = json.loads(str(responses.calls[0].request.body, 'utf-8'))
+ assert req_body['cron_spec'] == '30 */2 * * 1-5'
+ assert req_body['active'] == True
+ assert req_body['attach_user_tags'] == ['my-daily-backup-plan']
+ assert req_body['clone_policy'] == backup_policy_plan_clone_policy_prototype_model
+ assert req_body['copy_user_tags'] == True
+ assert req_body['deletion_trigger'] == backup_policy_plan_deletion_trigger_prototype_model
+ assert req_body['name'] == 'my-policy-plan'
+ assert req_body['remote_region_policies'] == [backup_policy_plan_remote_region_policy_prototype_model]
- def test_list_placement_groups_all_params_with_retries(self):
- # Enable retries and run test_list_placement_groups_all_params.
+ def test_create_backup_policy_plan_all_params_with_retries(self):
+ # Enable retries and run test_create_backup_policy_plan_all_params.
_service.enable_retries()
- self.test_list_placement_groups_all_params()
+ self.test_create_backup_policy_plan_all_params()
- # Disable retries and run test_list_placement_groups_all_params.
+ # Disable retries and run test_create_backup_policy_plan_all_params.
_service.disable_retries()
- self.test_list_placement_groups_all_params()
+ self.test_create_backup_policy_plan_all_params()
@responses.activate
- def test_list_placement_groups_required_params(self):
+ def test_create_backup_policy_plan_value_error(self):
"""
- test_list_placement_groups_required_params()
+ test_create_backup_policy_plan_value_error()
"""
# Set up mock
- 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}'
+ url = preprocess_url('/backup_policies/testString/plans')
+ mock_response = '{"active": true, "attach_user_tags": ["attach_user_tags"], "clone_policy": {"max_snapshots": 1, "zones": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}]}, "copy_user_tags": true, "created_at": "2019-01-01T12:00:00.000Z", "cron_spec": "30 */2 * * 1-5", "deletion_trigger": {"delete_after": 20, "delete_over_count": 20}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "lifecycle_state": "stable", "name": "my-policy-plan", "remote_region_policies": [{"delete_over_count": 1, "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}], "resource_type": "backup_policy_plan"}'
responses.add(
- responses.GET,
+ responses.POST,
url,
body=mock_response,
content_type='application/json',
- status=200,
+ status=201,
)
- # Invoke method
- response = _service.list_placement_groups()
+ # Construct a dict representation of a ZoneIdentityByName model
+ zone_identity_model = {}
+ zone_identity_model['name'] = 'us-south-1'
- # Check for correct operation
- assert len(responses.calls) == 1
- assert response.status_code == 200
+ # Construct a dict representation of a BackupPolicyPlanClonePolicyPrototype model
+ backup_policy_plan_clone_policy_prototype_model = {}
+ backup_policy_plan_clone_policy_prototype_model['max_snapshots'] = 5
+ backup_policy_plan_clone_policy_prototype_model['zones'] = [zone_identity_model]
- def test_list_placement_groups_required_params_with_retries(self):
- # Enable retries and run test_list_placement_groups_required_params.
- _service.enable_retries()
- self.test_list_placement_groups_required_params()
+ # Construct a dict representation of a BackupPolicyPlanDeletionTriggerPrototype model
+ backup_policy_plan_deletion_trigger_prototype_model = {}
+ backup_policy_plan_deletion_trigger_prototype_model['delete_after'] = 20
+ backup_policy_plan_deletion_trigger_prototype_model['delete_over_count'] = 20
- # Disable retries and run test_list_placement_groups_required_params.
- _service.disable_retries()
- self.test_list_placement_groups_required_params()
+ # 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/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179'
- @responses.activate
- def test_list_placement_groups_value_error(self):
- """
- test_list_placement_groups_value_error()
- """
- # Set up mock
- 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,
- body=mock_response,
- content_type='application/json',
- status=200,
- )
+ # Construct a dict representation of a RegionIdentityByName model
+ region_identity_model = {}
+ region_identity_model['name'] = 'us-south'
+
+ # Construct a dict representation of a BackupPolicyPlanRemoteRegionPolicyPrototype model
+ backup_policy_plan_remote_region_policy_prototype_model = {}
+ backup_policy_plan_remote_region_policy_prototype_model['delete_over_count'] = 5
+ backup_policy_plan_remote_region_policy_prototype_model['encryption_key'] = encryption_key_identity_model
+ backup_policy_plan_remote_region_policy_prototype_model['region'] = region_identity_model
+
+ # Set up parameter values
+ backup_policy_id = 'testString'
+ cron_spec = '30 */2 * * 1-5'
+ active = True
+ attach_user_tags = ['my-daily-backup-plan']
+ clone_policy = backup_policy_plan_clone_policy_prototype_model
+ copy_user_tags = True
+ deletion_trigger = backup_policy_plan_deletion_trigger_prototype_model
+ name = 'my-policy-plan'
+ remote_region_policies = [backup_policy_plan_remote_region_policy_prototype_model]
# Pass in all but one required param and check for a ValueError
req_param_dict = {
+ "backup_policy_id": backup_policy_id,
+ "cron_spec": cron_spec,
}
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_placement_groups(**req_copy)
+ _service.create_backup_policy_plan(**req_copy)
- def test_list_placement_groups_value_error_with_retries(self):
- # Enable retries and run test_list_placement_groups_value_error.
+ def test_create_backup_policy_plan_value_error_with_retries(self):
+ # Enable retries and run test_create_backup_policy_plan_value_error.
_service.enable_retries()
- self.test_list_placement_groups_value_error()
+ self.test_create_backup_policy_plan_value_error()
- # Disable retries and run test_list_placement_groups_value_error.
+ # Disable retries and run test_create_backup_policy_plan_value_error.
_service.disable_retries()
- self.test_list_placement_groups_value_error()
-
- @responses.activate
- def test_list_placement_groups_with_pager_get_next(self):
- """
- test_list_placement_groups_with_pager_get_next()
- """
- # Set up a two-page mock response
- url = preprocess_url('/placement_groups')
- mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"placement_groups":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::placement-group:r018-418fe842-a3e9-47b9-a938-1aa5bd632871","href":"https://us-south.iaas.cloud.ibm.com/v1/placement_groups/r018-418fe842-a3e9-47b9-a938-1aa5bd632871","id":"r018-418fe842-a3e9-47b9-a938-1aa5bd632871","lifecycle_state":"stable","name":"my-placement-group","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"placement_group","strategy":"host_spread"}]}'
- mock_response2 = '{"total_count":2,"limit":1,"placement_groups":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::placement-group:r018-418fe842-a3e9-47b9-a938-1aa5bd632871","href":"https://us-south.iaas.cloud.ibm.com/v1/placement_groups/r018-418fe842-a3e9-47b9-a938-1aa5bd632871","id":"r018-418fe842-a3e9-47b9-a938-1aa5bd632871","lifecycle_state":"stable","name":"my-placement-group","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"placement_group","strategy":"host_spread"}]}'
- responses.add(
- responses.GET,
- url,
- body=mock_response1,
- content_type='application/json',
- status=200,
- )
- responses.add(
- responses.GET,
- url,
- body=mock_response2,
- content_type='application/json',
- status=200,
- )
-
- # Exercise the pager class for this operation
- all_results = []
- pager = PlacementGroupsPager(
- client=_service,
- limit=10,
- )
- while pager.has_next():
- next_page = pager.get_next()
- assert next_page is not None
- all_results.extend(next_page)
- assert len(all_results) == 2
-
- @responses.activate
- def test_list_placement_groups_with_pager_get_all(self):
- """
- test_list_placement_groups_with_pager_get_all()
- """
- # Set up a two-page mock response
- url = preprocess_url('/placement_groups')
- mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"placement_groups":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::placement-group:r018-418fe842-a3e9-47b9-a938-1aa5bd632871","href":"https://us-south.iaas.cloud.ibm.com/v1/placement_groups/r018-418fe842-a3e9-47b9-a938-1aa5bd632871","id":"r018-418fe842-a3e9-47b9-a938-1aa5bd632871","lifecycle_state":"stable","name":"my-placement-group","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"placement_group","strategy":"host_spread"}]}'
- mock_response2 = '{"total_count":2,"limit":1,"placement_groups":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::placement-group:r018-418fe842-a3e9-47b9-a938-1aa5bd632871","href":"https://us-south.iaas.cloud.ibm.com/v1/placement_groups/r018-418fe842-a3e9-47b9-a938-1aa5bd632871","id":"r018-418fe842-a3e9-47b9-a938-1aa5bd632871","lifecycle_state":"stable","name":"my-placement-group","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"placement_group","strategy":"host_spread"}]}'
- responses.add(
- responses.GET,
- url,
- body=mock_response1,
- content_type='application/json',
- status=200,
- )
- responses.add(
- responses.GET,
- url,
- body=mock_response2,
- content_type='application/json',
- status=200,
- )
-
- # Exercise the pager class for this operation
- pager = PlacementGroupsPager(
- client=_service,
- limit=10,
- )
- all_results = pager.get_all()
- assert all_results is not None
- assert len(all_results) == 2
+ self.test_create_backup_policy_plan_value_error()
-class TestCreatePlacementGroup:
+class TestDeleteBackupPolicyPlan:
"""
- Test Class for create_placement_group
+ Test Class for delete_backup_policy_plan
"""
@responses.activate
- def test_create_placement_group_all_params(self):
+ def test_delete_backup_policy_plan_all_params(self):
"""
- create_placement_group()
+ delete_backup_policy_plan()
"""
# Set up mock
- 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"}'
+ url = preprocess_url('/backup_policies/testString/plans/testString')
+ mock_response = '{"active": true, "attach_user_tags": ["attach_user_tags"], "clone_policy": {"max_snapshots": 1, "zones": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}]}, "copy_user_tags": true, "created_at": "2019-01-01T12:00:00.000Z", "cron_spec": "30 */2 * * 1-5", "deletion_trigger": {"delete_after": 20, "delete_over_count": 20}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "lifecycle_state": "stable", "name": "my-policy-plan", "remote_region_policies": [{"delete_over_count": 1, "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}], "resource_type": "backup_policy_plan"}'
responses.add(
- responses.POST,
+ responses.DELETE,
url,
body=mock_response,
content_type='application/json',
- status=201,
+ status=202,
)
- # Construct a dict representation of a ResourceGroupIdentityById model
- resource_group_identity_model = {}
- resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
-
# Set up parameter values
- strategy = 'host_spread'
- name = 'my-placement-group'
- resource_group = resource_group_identity_model
+ backup_policy_id = 'testString'
+ id = 'testString'
+ if_match = 'W/"96d225c4-56bd-43d9-98fc-d7148e5c5028"'
# Invoke method
- response = _service.create_placement_group(
- strategy,
- name=name,
- resource_group=resource_group,
+ response = _service.delete_backup_policy_plan(
+ backup_policy_id,
+ id,
+ if_match=if_match,
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['strategy'] == 'host_spread'
- assert req_body['name'] == 'my-placement-group'
- assert req_body['resource_group'] == resource_group_identity_model
+ assert response.status_code == 202
- def test_create_placement_group_all_params_with_retries(self):
- # Enable retries and run test_create_placement_group_all_params.
+ def test_delete_backup_policy_plan_all_params_with_retries(self):
+ # Enable retries and run test_delete_backup_policy_plan_all_params.
_service.enable_retries()
- self.test_create_placement_group_all_params()
+ self.test_delete_backup_policy_plan_all_params()
- # Disable retries and run test_create_placement_group_all_params.
+ # Disable retries and run test_delete_backup_policy_plan_all_params.
_service.disable_retries()
- self.test_create_placement_group_all_params()
+ self.test_delete_backup_policy_plan_all_params()
@responses.activate
- def test_create_placement_group_value_error(self):
+ def test_delete_backup_policy_plan_required_params(self):
"""
- test_create_placement_group_value_error()
+ test_delete_backup_policy_plan_required_params()
"""
# Set up mock
- 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"}'
+ url = preprocess_url('/backup_policies/testString/plans/testString')
+ mock_response = '{"active": true, "attach_user_tags": ["attach_user_tags"], "clone_policy": {"max_snapshots": 1, "zones": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}]}, "copy_user_tags": true, "created_at": "2019-01-01T12:00:00.000Z", "cron_spec": "30 */2 * * 1-5", "deletion_trigger": {"delete_after": 20, "delete_over_count": 20}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "lifecycle_state": "stable", "name": "my-policy-plan", "remote_region_policies": [{"delete_over_count": 1, "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}], "resource_type": "backup_policy_plan"}'
responses.add(
- responses.POST,
+ responses.DELETE,
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
- strategy = 'host_spread'
- name = 'my-placement-group'
- resource_group = resource_group_identity_model
-
- # Pass in all but one required param and check for a ValueError
- req_param_dict = {
- "strategy": strategy,
- }
- 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_placement_group(**req_copy)
-
- def test_create_placement_group_value_error_with_retries(self):
- # Enable retries and run test_create_placement_group_value_error.
- _service.enable_retries()
- self.test_create_placement_group_value_error()
-
- # Disable retries and run test_create_placement_group_value_error.
- _service.disable_retries()
- self.test_create_placement_group_value_error()
-
-
-class TestDeletePlacementGroup:
- """
- Test Class for delete_placement_group
- """
-
- @responses.activate
- def test_delete_placement_group_all_params(self):
- """
- delete_placement_group()
- """
- # Set up mock
- url = preprocess_url('/placement_groups/testString')
- responses.add(
- responses.DELETE,
- url,
status=202,
)
# Set up parameter values
+ backup_policy_id = 'testString'
id = 'testString'
# Invoke method
- response = _service.delete_placement_group(
+ response = _service.delete_backup_policy_plan(
+ backup_policy_id,
id,
headers={},
)
@@ -19252,63 +19845,68 @@ def test_delete_placement_group_all_params(self):
assert len(responses.calls) == 1
assert response.status_code == 202
- def test_delete_placement_group_all_params_with_retries(self):
- # Enable retries and run test_delete_placement_group_all_params.
+ def test_delete_backup_policy_plan_required_params_with_retries(self):
+ # Enable retries and run test_delete_backup_policy_plan_required_params.
_service.enable_retries()
- self.test_delete_placement_group_all_params()
+ self.test_delete_backup_policy_plan_required_params()
- # Disable retries and run test_delete_placement_group_all_params.
+ # Disable retries and run test_delete_backup_policy_plan_required_params.
_service.disable_retries()
- self.test_delete_placement_group_all_params()
+ self.test_delete_backup_policy_plan_required_params()
@responses.activate
- def test_delete_placement_group_value_error(self):
+ def test_delete_backup_policy_plan_value_error(self):
"""
- test_delete_placement_group_value_error()
+ test_delete_backup_policy_plan_value_error()
"""
# Set up mock
- url = preprocess_url('/placement_groups/testString')
+ url = preprocess_url('/backup_policies/testString/plans/testString')
+ mock_response = '{"active": true, "attach_user_tags": ["attach_user_tags"], "clone_policy": {"max_snapshots": 1, "zones": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}]}, "copy_user_tags": true, "created_at": "2019-01-01T12:00:00.000Z", "cron_spec": "30 */2 * * 1-5", "deletion_trigger": {"delete_after": 20, "delete_over_count": 20}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "lifecycle_state": "stable", "name": "my-policy-plan", "remote_region_policies": [{"delete_over_count": 1, "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}], "resource_type": "backup_policy_plan"}'
responses.add(
responses.DELETE,
url,
+ body=mock_response,
+ content_type='application/json',
status=202,
)
# Set up parameter values
+ backup_policy_id = 'testString'
id = 'testString'
# Pass in all but one required param and check for a ValueError
req_param_dict = {
+ "backup_policy_id": backup_policy_id,
"id": id,
}
for param in req_param_dict.keys():
req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()}
with pytest.raises(ValueError):
- _service.delete_placement_group(**req_copy)
+ _service.delete_backup_policy_plan(**req_copy)
- def test_delete_placement_group_value_error_with_retries(self):
- # Enable retries and run test_delete_placement_group_value_error.
+ def test_delete_backup_policy_plan_value_error_with_retries(self):
+ # Enable retries and run test_delete_backup_policy_plan_value_error.
_service.enable_retries()
- self.test_delete_placement_group_value_error()
+ self.test_delete_backup_policy_plan_value_error()
- # Disable retries and run test_delete_placement_group_value_error.
+ # Disable retries and run test_delete_backup_policy_plan_value_error.
_service.disable_retries()
- self.test_delete_placement_group_value_error()
+ self.test_delete_backup_policy_plan_value_error()
-class TestGetPlacementGroup:
+class TestGetBackupPolicyPlan:
"""
- Test Class for get_placement_group
+ Test Class for get_backup_policy_plan
"""
@responses.activate
- def test_get_placement_group_all_params(self):
+ def test_get_backup_policy_plan_all_params(self):
"""
- get_placement_group()
+ get_backup_policy_plan()
"""
# Set up mock
- 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"}'
+ url = preprocess_url('/backup_policies/testString/plans/testString')
+ mock_response = '{"active": true, "attach_user_tags": ["attach_user_tags"], "clone_policy": {"max_snapshots": 1, "zones": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}]}, "copy_user_tags": true, "created_at": "2019-01-01T12:00:00.000Z", "cron_spec": "30 */2 * * 1-5", "deletion_trigger": {"delete_after": 20, "delete_over_count": 20}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "lifecycle_state": "stable", "name": "my-policy-plan", "remote_region_policies": [{"delete_over_count": 1, "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}], "resource_type": "backup_policy_plan"}'
responses.add(
responses.GET,
url,
@@ -19318,10 +19916,12 @@ def test_get_placement_group_all_params(self):
)
# Set up parameter values
+ backup_policy_id = 'testString'
id = 'testString'
# Invoke method
- response = _service.get_placement_group(
+ response = _service.get_backup_policy_plan(
+ backup_policy_id,
id,
headers={},
)
@@ -19330,23 +19930,23 @@ def test_get_placement_group_all_params(self):
assert len(responses.calls) == 1
assert response.status_code == 200
- def test_get_placement_group_all_params_with_retries(self):
- # Enable retries and run test_get_placement_group_all_params.
+ def test_get_backup_policy_plan_all_params_with_retries(self):
+ # Enable retries and run test_get_backup_policy_plan_all_params.
_service.enable_retries()
- self.test_get_placement_group_all_params()
+ self.test_get_backup_policy_plan_all_params()
- # Disable retries and run test_get_placement_group_all_params.
+ # Disable retries and run test_get_backup_policy_plan_all_params.
_service.disable_retries()
- self.test_get_placement_group_all_params()
+ self.test_get_backup_policy_plan_all_params()
@responses.activate
- def test_get_placement_group_value_error(self):
+ def test_get_backup_policy_plan_value_error(self):
"""
- test_get_placement_group_value_error()
+ test_get_backup_policy_plan_value_error()
"""
# Set up mock
- 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"}'
+ url = preprocess_url('/backup_policies/testString/plans/testString')
+ mock_response = '{"active": true, "attach_user_tags": ["attach_user_tags"], "clone_policy": {"max_snapshots": 1, "zones": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}]}, "copy_user_tags": true, "created_at": "2019-01-01T12:00:00.000Z", "cron_spec": "30 */2 * * 1-5", "deletion_trigger": {"delete_after": 20, "delete_over_count": 20}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "lifecycle_state": "stable", "name": "my-policy-plan", "remote_region_policies": [{"delete_over_count": 1, "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}], "resource_type": "backup_policy_plan"}'
responses.add(
responses.GET,
url,
@@ -19356,40 +19956,42 @@ def test_get_placement_group_value_error(self):
)
# Set up parameter values
+ backup_policy_id = 'testString'
id = 'testString'
# Pass in all but one required param and check for a ValueError
req_param_dict = {
+ "backup_policy_id": backup_policy_id,
"id": id,
}
for param in req_param_dict.keys():
req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()}
with pytest.raises(ValueError):
- _service.get_placement_group(**req_copy)
+ _service.get_backup_policy_plan(**req_copy)
- def test_get_placement_group_value_error_with_retries(self):
- # Enable retries and run test_get_placement_group_value_error.
+ def test_get_backup_policy_plan_value_error_with_retries(self):
+ # Enable retries and run test_get_backup_policy_plan_value_error.
_service.enable_retries()
- self.test_get_placement_group_value_error()
+ self.test_get_backup_policy_plan_value_error()
- # Disable retries and run test_get_placement_group_value_error.
+ # Disable retries and run test_get_backup_policy_plan_value_error.
_service.disable_retries()
- self.test_get_placement_group_value_error()
+ self.test_get_backup_policy_plan_value_error()
-class TestUpdatePlacementGroup:
+class TestUpdateBackupPolicyPlan:
"""
- Test Class for update_placement_group
+ Test Class for update_backup_policy_plan
"""
@responses.activate
- def test_update_placement_group_all_params(self):
+ def test_update_backup_policy_plan_all_params(self):
"""
- update_placement_group()
+ update_backup_policy_plan()
"""
# Set up mock
- 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"}'
+ url = preprocess_url('/backup_policies/testString/plans/testString')
+ mock_response = '{"active": true, "attach_user_tags": ["attach_user_tags"], "clone_policy": {"max_snapshots": 1, "zones": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}]}, "copy_user_tags": true, "created_at": "2019-01-01T12:00:00.000Z", "cron_spec": "30 */2 * * 1-5", "deletion_trigger": {"delete_after": 20, "delete_over_count": 20}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "lifecycle_state": "stable", "name": "my-policy-plan", "remote_region_policies": [{"delete_over_count": 1, "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}], "resource_type": "backup_policy_plan"}'
responses.add(
responses.PATCH,
url,
@@ -19398,18 +20000,57 @@ def test_update_placement_group_all_params(self):
status=200,
)
- # Construct a dict representation of a PlacementGroupPatch model
- placement_group_patch_model = {}
- placement_group_patch_model['name'] = 'my-placement-group'
+ # Construct a dict representation of a ZoneIdentityByName model
+ zone_identity_model = {}
+ zone_identity_model['name'] = 'us-south-1'
+
+ # Construct a dict representation of a BackupPolicyPlanClonePolicyPatch model
+ backup_policy_plan_clone_policy_patch_model = {}
+ backup_policy_plan_clone_policy_patch_model['max_snapshots'] = 1
+ backup_policy_plan_clone_policy_patch_model['zones'] = [zone_identity_model]
+
+ # Construct a dict representation of a BackupPolicyPlanDeletionTriggerPatch model
+ backup_policy_plan_deletion_trigger_patch_model = {}
+ backup_policy_plan_deletion_trigger_patch_model['delete_after'] = 20
+ backup_policy_plan_deletion_trigger_patch_model['delete_over_count'] = 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/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179'
+
+ # Construct a dict representation of a RegionIdentityByName model
+ region_identity_model = {}
+ region_identity_model['name'] = 'us-south'
+
+ # Construct a dict representation of a BackupPolicyPlanRemoteRegionPolicyPrototype model
+ backup_policy_plan_remote_region_policy_prototype_model = {}
+ backup_policy_plan_remote_region_policy_prototype_model['delete_over_count'] = 5
+ backup_policy_plan_remote_region_policy_prototype_model['encryption_key'] = encryption_key_identity_model
+ backup_policy_plan_remote_region_policy_prototype_model['region'] = region_identity_model
+
+ # Construct a dict representation of a BackupPolicyPlanPatch model
+ backup_policy_plan_patch_model = {}
+ backup_policy_plan_patch_model['active'] = True
+ backup_policy_plan_patch_model['attach_user_tags'] = ['my-daily-backup-plan']
+ backup_policy_plan_patch_model['clone_policy'] = backup_policy_plan_clone_policy_patch_model
+ backup_policy_plan_patch_model['copy_user_tags'] = True
+ backup_policy_plan_patch_model['cron_spec'] = '30 */2 * * 1-5'
+ backup_policy_plan_patch_model['deletion_trigger'] = backup_policy_plan_deletion_trigger_patch_model
+ backup_policy_plan_patch_model['name'] = 'my-policy-plan'
+ backup_policy_plan_patch_model['remote_region_policies'] = [backup_policy_plan_remote_region_policy_prototype_model]
# Set up parameter values
+ backup_policy_id = 'testString'
id = 'testString'
- placement_group_patch = placement_group_patch_model
+ backup_policy_plan_patch = backup_policy_plan_patch_model
+ if_match = 'W/"96d225c4-56bd-43d9-98fc-d7148e5c5028"'
# Invoke method
- response = _service.update_placement_group(
+ response = _service.update_backup_policy_plan(
+ backup_policy_id,
id,
- placement_group_patch,
+ backup_policy_plan_patch,
+ if_match=if_match,
headers={},
)
@@ -19418,25 +20059,25 @@ def test_update_placement_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 == placement_group_patch
+ assert req_body == backup_policy_plan_patch
- def test_update_placement_group_all_params_with_retries(self):
- # Enable retries and run test_update_placement_group_all_params.
+ def test_update_backup_policy_plan_all_params_with_retries(self):
+ # Enable retries and run test_update_backup_policy_plan_all_params.
_service.enable_retries()
- self.test_update_placement_group_all_params()
+ self.test_update_backup_policy_plan_all_params()
- # Disable retries and run test_update_placement_group_all_params.
+ # Disable retries and run test_update_backup_policy_plan_all_params.
_service.disable_retries()
- self.test_update_placement_group_all_params()
+ self.test_update_backup_policy_plan_all_params()
@responses.activate
- def test_update_placement_group_value_error(self):
+ def test_update_backup_policy_plan_required_params(self):
"""
- test_update_placement_group_value_error()
+ test_update_backup_policy_plan_required_params()
"""
# Set up mock
- 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"}'
+ url = preprocess_url('/backup_policies/testString/plans/testString')
+ mock_response = '{"active": true, "attach_user_tags": ["attach_user_tags"], "clone_policy": {"max_snapshots": 1, "zones": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}]}, "copy_user_tags": true, "created_at": "2019-01-01T12:00:00.000Z", "cron_spec": "30 */2 * * 1-5", "deletion_trigger": {"delete_after": 20, "delete_over_count": 20}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "lifecycle_state": "stable", "name": "my-policy-plan", "remote_region_policies": [{"delete_over_count": 1, "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}], "resource_type": "backup_policy_plan"}'
responses.add(
responses.PATCH,
url,
@@ -19445,370 +20086,578 @@ def test_update_placement_group_value_error(self):
status=200,
)
- # Construct a dict representation of a PlacementGroupPatch model
- placement_group_patch_model = {}
- placement_group_patch_model['name'] = 'my-placement-group'
-
- # Set up parameter values
- id = 'testString'
- placement_group_patch = placement_group_patch_model
+ # Construct a dict representation of a ZoneIdentityByName model
+ zone_identity_model = {}
+ zone_identity_model['name'] = 'us-south-1'
- # Pass in all but one required param and check for a ValueError
- req_param_dict = {
- "id": id,
- "placement_group_patch": placement_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_placement_group(**req_copy)
+ # Construct a dict representation of a BackupPolicyPlanClonePolicyPatch model
+ backup_policy_plan_clone_policy_patch_model = {}
+ backup_policy_plan_clone_policy_patch_model['max_snapshots'] = 1
+ backup_policy_plan_clone_policy_patch_model['zones'] = [zone_identity_model]
- def test_update_placement_group_value_error_with_retries(self):
- # Enable retries and run test_update_placement_group_value_error.
- _service.enable_retries()
- self.test_update_placement_group_value_error()
+ # Construct a dict representation of a BackupPolicyPlanDeletionTriggerPatch model
+ backup_policy_plan_deletion_trigger_patch_model = {}
+ backup_policy_plan_deletion_trigger_patch_model['delete_after'] = 20
+ backup_policy_plan_deletion_trigger_patch_model['delete_over_count'] = 1
- # Disable retries and run test_update_placement_group_value_error.
- _service.disable_retries()
- self.test_update_placement_group_value_error()
+ # 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/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179'
+ # Construct a dict representation of a RegionIdentityByName model
+ region_identity_model = {}
+ region_identity_model['name'] = 'us-south'
-# endregion
-##############################################################################
-# End of Service: PlacementGroups
-##############################################################################
+ # Construct a dict representation of a BackupPolicyPlanRemoteRegionPolicyPrototype model
+ backup_policy_plan_remote_region_policy_prototype_model = {}
+ backup_policy_plan_remote_region_policy_prototype_model['delete_over_count'] = 5
+ backup_policy_plan_remote_region_policy_prototype_model['encryption_key'] = encryption_key_identity_model
+ backup_policy_plan_remote_region_policy_prototype_model['region'] = region_identity_model
-##############################################################################
-# Start of Service: BareMetalServers
-##############################################################################
-# region
+ # Construct a dict representation of a BackupPolicyPlanPatch model
+ backup_policy_plan_patch_model = {}
+ backup_policy_plan_patch_model['active'] = True
+ backup_policy_plan_patch_model['attach_user_tags'] = ['my-daily-backup-plan']
+ backup_policy_plan_patch_model['clone_policy'] = backup_policy_plan_clone_policy_patch_model
+ backup_policy_plan_patch_model['copy_user_tags'] = True
+ backup_policy_plan_patch_model['cron_spec'] = '30 */2 * * 1-5'
+ backup_policy_plan_patch_model['deletion_trigger'] = backup_policy_plan_deletion_trigger_patch_model
+ backup_policy_plan_patch_model['name'] = 'my-policy-plan'
+ backup_policy_plan_patch_model['remote_region_policies'] = [backup_policy_plan_remote_region_policy_prototype_model]
+ # Set up parameter values
+ backup_policy_id = 'testString'
+ id = 'testString'
+ backup_policy_plan_patch = backup_policy_plan_patch_model
-class TestNewInstance:
- """
- Test Class for new_instance
- """
+ # Invoke method
+ response = _service.update_backup_policy_plan(
+ backup_policy_id,
+ id,
+ backup_policy_plan_patch,
+ headers={},
+ )
- def test_new_instance(self):
- """
- new_instance()
- """
- os.environ['TEST_SERVICE_AUTH_TYPE'] = 'noAuth'
+ # 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 == backup_policy_plan_patch
- service = VpcV1.new_instance(
- version=version,
- service_name='TEST_SERVICE',
- )
+ def test_update_backup_policy_plan_required_params_with_retries(self):
+ # Enable retries and run test_update_backup_policy_plan_required_params.
+ _service.enable_retries()
+ self.test_update_backup_policy_plan_required_params()
- assert service is not None
- assert isinstance(service, VpcV1)
+ # Disable retries and run test_update_backup_policy_plan_required_params.
+ _service.disable_retries()
+ self.test_update_backup_policy_plan_required_params()
- def test_new_instance_without_authenticator(self):
+ @responses.activate
+ def test_update_backup_policy_plan_value_error(self):
"""
- new_instance_without_authenticator()
+ test_update_backup_policy_plan_value_error()
"""
- with pytest.raises(ValueError, match='authenticator must be provided'):
- service = VpcV1.new_instance(
- version=version,
- service_name='TEST_SERVICE_NOT_FOUND',
- )
+ # Set up mock
+ url = preprocess_url('/backup_policies/testString/plans/testString')
+ mock_response = '{"active": true, "attach_user_tags": ["attach_user_tags"], "clone_policy": {"max_snapshots": 1, "zones": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}]}, "copy_user_tags": true, "created_at": "2019-01-01T12:00:00.000Z", "cron_spec": "30 */2 * * 1-5", "deletion_trigger": {"delete_after": 20, "delete_over_count": 20}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "lifecycle_state": "stable", "name": "my-policy-plan", "remote_region_policies": [{"delete_over_count": 1, "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}], "resource_type": "backup_policy_plan"}'
+ responses.add(
+ responses.PATCH,
+ url,
+ body=mock_response,
+ content_type='application/json',
+ status=200,
+ )
- 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()
+ # Construct a dict representation of a ZoneIdentityByName model
+ zone_identity_model = {}
+ zone_identity_model['name'] = 'us-south-1'
- 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,
- )
+ # Construct a dict representation of a BackupPolicyPlanClonePolicyPatch model
+ backup_policy_plan_clone_policy_patch_model = {}
+ backup_policy_plan_clone_policy_patch_model['max_snapshots'] = 1
+ backup_policy_plan_clone_policy_patch_model['zones'] = [zone_identity_model]
+ # Construct a dict representation of a BackupPolicyPlanDeletionTriggerPatch model
+ backup_policy_plan_deletion_trigger_patch_model = {}
+ backup_policy_plan_deletion_trigger_patch_model['delete_after'] = 20
+ backup_policy_plan_deletion_trigger_patch_model['delete_over_count'] = 1
-class TestListBareMetalServerProfiles:
+ # 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/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179'
+
+ # Construct a dict representation of a RegionIdentityByName model
+ region_identity_model = {}
+ region_identity_model['name'] = 'us-south'
+
+ # Construct a dict representation of a BackupPolicyPlanRemoteRegionPolicyPrototype model
+ backup_policy_plan_remote_region_policy_prototype_model = {}
+ backup_policy_plan_remote_region_policy_prototype_model['delete_over_count'] = 5
+ backup_policy_plan_remote_region_policy_prototype_model['encryption_key'] = encryption_key_identity_model
+ backup_policy_plan_remote_region_policy_prototype_model['region'] = region_identity_model
+
+ # Construct a dict representation of a BackupPolicyPlanPatch model
+ backup_policy_plan_patch_model = {}
+ backup_policy_plan_patch_model['active'] = True
+ backup_policy_plan_patch_model['attach_user_tags'] = ['my-daily-backup-plan']
+ backup_policy_plan_patch_model['clone_policy'] = backup_policy_plan_clone_policy_patch_model
+ backup_policy_plan_patch_model['copy_user_tags'] = True
+ backup_policy_plan_patch_model['cron_spec'] = '30 */2 * * 1-5'
+ backup_policy_plan_patch_model['deletion_trigger'] = backup_policy_plan_deletion_trigger_patch_model
+ backup_policy_plan_patch_model['name'] = 'my-policy-plan'
+ backup_policy_plan_patch_model['remote_region_policies'] = [backup_policy_plan_remote_region_policy_prototype_model]
+
+ # Set up parameter values
+ backup_policy_id = 'testString'
+ id = 'testString'
+ backup_policy_plan_patch = backup_policy_plan_patch_model
+
+ # Pass in all but one required param and check for a ValueError
+ req_param_dict = {
+ "backup_policy_id": backup_policy_id,
+ "id": id,
+ "backup_policy_plan_patch": backup_policy_plan_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_backup_policy_plan(**req_copy)
+
+ def test_update_backup_policy_plan_value_error_with_retries(self):
+ # Enable retries and run test_update_backup_policy_plan_value_error.
+ _service.enable_retries()
+ self.test_update_backup_policy_plan_value_error()
+
+ # Disable retries and run test_update_backup_policy_plan_value_error.
+ _service.disable_retries()
+ self.test_update_backup_policy_plan_value_error()
+
+
+class TestDeleteBackupPolicy:
"""
- Test Class for list_bare_metal_server_profiles
+ Test Class for delete_backup_policy
"""
@responses.activate
- def test_list_bare_metal_server_profiles_all_params(self):
+ def test_delete_backup_policy_all_params(self):
"""
- list_bare_metal_server_profiles()
+ delete_backup_policy()
"""
# Set up mock
- url = preprocess_url('/bare_metal_server/profiles')
- mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "profiles": [{"bandwidth": {"type": "fixed", "value": 20000}, "console_types": {"type": "enum", "values": ["serial"]}, "cpu_architecture": {"default": "amd64", "type": "fixed", "value": "amd64"}, "cpu_core_count": {"type": "fixed", "value": 80}, "cpu_socket_count": {"type": "fixed", "value": 4}, "disks": [{"quantity": {"type": "fixed", "value": 4}, "size": {"type": "fixed", "value": 100}, "supported_interface_types": {"default": "fcp", "type": "enum", "values": ["fcp"]}}], "family": "balanced", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768", "memory": {"type": "fixed", "value": 16}, "name": "bx2-metal-192x768", "network_interface_count": {"max": 128, "min": 1, "type": "range"}, "os_architecture": {"default": "amd64", "type": "enum", "values": ["amd64"]}, "resource_type": "bare_metal_server_profile", "supported_trusted_platform_module_modes": {"type": "enum", "values": ["disabled"]}}], "total_count": 132}'
+ url = preprocess_url('/backup_policies/testString')
+ mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::backup-policy:r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "health_reasons": [{"code": "missing_service_authorization_policies", "message": "One or more accounts are missing service authorization policies", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-backup-service-about&interface=ui"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "id": "r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "last_job_completed_at": "2019-01-01T12:00:00.000Z", "lifecycle_state": "stable", "match_user_tags": ["match_user_tags"], "name": "my-backup-policy", "plans": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "backup_policy", "scope": {"crn": "crn:v1:bluemix:public:enterprise::a/123456::enterprise:ebc2b430240943458b9e91e1432cfcce", "id": "fee82deba12e4c0fb69c3b09d1f12345", "resource_type": "enterprise"}, "included_content": ["data_volumes"], "match_resource_type": "instance"}'
responses.add(
- responses.GET,
+ responses.DELETE,
url,
body=mock_response,
content_type='application/json',
- status=200,
+ status=202,
)
# Set up parameter values
- start = 'testString'
- limit = 50
+ id = 'testString'
+ if_match = 'W/"96d225c4-56bd-43d9-98fc-d7148e5c5028"'
# Invoke method
- response = _service.list_bare_metal_server_profiles(
- start=start,
- limit=limit,
+ response = _service.delete_backup_policy(
+ id,
+ if_match=if_match,
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_bare_metal_server_profiles_all_params_with_retries(self):
- # Enable retries and run test_list_bare_metal_server_profiles_all_params.
+ def test_delete_backup_policy_all_params_with_retries(self):
+ # Enable retries and run test_delete_backup_policy_all_params.
_service.enable_retries()
- self.test_list_bare_metal_server_profiles_all_params()
+ self.test_delete_backup_policy_all_params()
- # Disable retries and run test_list_bare_metal_server_profiles_all_params.
+ # Disable retries and run test_delete_backup_policy_all_params.
_service.disable_retries()
- self.test_list_bare_metal_server_profiles_all_params()
+ self.test_delete_backup_policy_all_params()
@responses.activate
- def test_list_bare_metal_server_profiles_required_params(self):
+ def test_delete_backup_policy_required_params(self):
"""
- test_list_bare_metal_server_profiles_required_params()
+ test_delete_backup_policy_required_params()
"""
# Set up mock
- url = preprocess_url('/bare_metal_server/profiles')
- mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "profiles": [{"bandwidth": {"type": "fixed", "value": 20000}, "console_types": {"type": "enum", "values": ["serial"]}, "cpu_architecture": {"default": "amd64", "type": "fixed", "value": "amd64"}, "cpu_core_count": {"type": "fixed", "value": 80}, "cpu_socket_count": {"type": "fixed", "value": 4}, "disks": [{"quantity": {"type": "fixed", "value": 4}, "size": {"type": "fixed", "value": 100}, "supported_interface_types": {"default": "fcp", "type": "enum", "values": ["fcp"]}}], "family": "balanced", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768", "memory": {"type": "fixed", "value": 16}, "name": "bx2-metal-192x768", "network_interface_count": {"max": 128, "min": 1, "type": "range"}, "os_architecture": {"default": "amd64", "type": "enum", "values": ["amd64"]}, "resource_type": "bare_metal_server_profile", "supported_trusted_platform_module_modes": {"type": "enum", "values": ["disabled"]}}], "total_count": 132}'
+ url = preprocess_url('/backup_policies/testString')
+ mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::backup-policy:r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "health_reasons": [{"code": "missing_service_authorization_policies", "message": "One or more accounts are missing service authorization policies", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-backup-service-about&interface=ui"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "id": "r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "last_job_completed_at": "2019-01-01T12:00:00.000Z", "lifecycle_state": "stable", "match_user_tags": ["match_user_tags"], "name": "my-backup-policy", "plans": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "backup_policy", "scope": {"crn": "crn:v1:bluemix:public:enterprise::a/123456::enterprise:ebc2b430240943458b9e91e1432cfcce", "id": "fee82deba12e4c0fb69c3b09d1f12345", "resource_type": "enterprise"}, "included_content": ["data_volumes"], "match_resource_type": "instance"}'
responses.add(
- responses.GET,
+ responses.DELETE,
url,
body=mock_response,
content_type='application/json',
- status=200,
+ status=202,
)
+ # Set up parameter values
+ id = 'testString'
+
# Invoke method
- response = _service.list_bare_metal_server_profiles()
+ response = _service.delete_backup_policy(
+ id,
+ headers={},
+ )
# Check for correct operation
assert len(responses.calls) == 1
- assert response.status_code == 200
+ assert response.status_code == 202
- def test_list_bare_metal_server_profiles_required_params_with_retries(self):
- # Enable retries and run test_list_bare_metal_server_profiles_required_params.
+ def test_delete_backup_policy_required_params_with_retries(self):
+ # Enable retries and run test_delete_backup_policy_required_params.
_service.enable_retries()
- self.test_list_bare_metal_server_profiles_required_params()
+ self.test_delete_backup_policy_required_params()
- # Disable retries and run test_list_bare_metal_server_profiles_required_params.
+ # Disable retries and run test_delete_backup_policy_required_params.
_service.disable_retries()
- self.test_list_bare_metal_server_profiles_required_params()
+ self.test_delete_backup_policy_required_params()
@responses.activate
- def test_list_bare_metal_server_profiles_value_error(self):
+ def test_delete_backup_policy_value_error(self):
"""
- test_list_bare_metal_server_profiles_value_error()
+ test_delete_backup_policy_value_error()
"""
# Set up mock
- url = preprocess_url('/bare_metal_server/profiles')
- mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "profiles": [{"bandwidth": {"type": "fixed", "value": 20000}, "console_types": {"type": "enum", "values": ["serial"]}, "cpu_architecture": {"default": "amd64", "type": "fixed", "value": "amd64"}, "cpu_core_count": {"type": "fixed", "value": 80}, "cpu_socket_count": {"type": "fixed", "value": 4}, "disks": [{"quantity": {"type": "fixed", "value": 4}, "size": {"type": "fixed", "value": 100}, "supported_interface_types": {"default": "fcp", "type": "enum", "values": ["fcp"]}}], "family": "balanced", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768", "memory": {"type": "fixed", "value": 16}, "name": "bx2-metal-192x768", "network_interface_count": {"max": 128, "min": 1, "type": "range"}, "os_architecture": {"default": "amd64", "type": "enum", "values": ["amd64"]}, "resource_type": "bare_metal_server_profile", "supported_trusted_platform_module_modes": {"type": "enum", "values": ["disabled"]}}], "total_count": 132}'
+ url = preprocess_url('/backup_policies/testString')
+ mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::backup-policy:r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "health_reasons": [{"code": "missing_service_authorization_policies", "message": "One or more accounts are missing service authorization policies", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-backup-service-about&interface=ui"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "id": "r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "last_job_completed_at": "2019-01-01T12:00:00.000Z", "lifecycle_state": "stable", "match_user_tags": ["match_user_tags"], "name": "my-backup-policy", "plans": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "backup_policy", "scope": {"crn": "crn:v1:bluemix:public:enterprise::a/123456::enterprise:ebc2b430240943458b9e91e1432cfcce", "id": "fee82deba12e4c0fb69c3b09d1f12345", "resource_type": "enterprise"}, "included_content": ["data_volumes"], "match_resource_type": "instance"}'
responses.add(
- responses.GET,
+ responses.DELETE,
url,
body=mock_response,
content_type='application/json',
- status=200,
+ status=202,
)
+ # Set up parameter values
+ id = 'testString'
+
# Pass in all but one required param and check for a ValueError
req_param_dict = {
+ "id": id,
}
for param in req_param_dict.keys():
req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()}
with pytest.raises(ValueError):
- _service.list_bare_metal_server_profiles(**req_copy)
+ _service.delete_backup_policy(**req_copy)
- def test_list_bare_metal_server_profiles_value_error_with_retries(self):
- # Enable retries and run test_list_bare_metal_server_profiles_value_error.
+ def test_delete_backup_policy_value_error_with_retries(self):
+ # Enable retries and run test_delete_backup_policy_value_error.
_service.enable_retries()
- self.test_list_bare_metal_server_profiles_value_error()
+ self.test_delete_backup_policy_value_error()
- # Disable retries and run test_list_bare_metal_server_profiles_value_error.
+ # Disable retries and run test_delete_backup_policy_value_error.
_service.disable_retries()
- self.test_list_bare_metal_server_profiles_value_error()
+ self.test_delete_backup_policy_value_error()
+
+
+class TestGetBackupPolicy:
+ """
+ Test Class for get_backup_policy
+ """
@responses.activate
- def test_list_bare_metal_server_profiles_with_pager_get_next(self):
+ def test_get_backup_policy_all_params(self):
"""
- test_list_bare_metal_server_profiles_with_pager_get_next()
+ get_backup_policy()
"""
- # Set up a two-page mock response
- url = preprocess_url('/bare_metal_server/profiles')
- mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"profiles":[{"bandwidth":{"type":"fixed","value":20000},"console_types":{"type":"enum","values":["serial"]},"cpu_architecture":{"default":"amd64","type":"fixed","value":"amd64"},"cpu_core_count":{"type":"fixed","value":80},"cpu_socket_count":{"type":"fixed","value":4},"disks":[{"quantity":{"type":"fixed","value":4},"size":{"type":"fixed","value":100},"supported_interface_types":{"default":"fcp","type":"enum","values":["fcp"]}}],"family":"balanced","href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768","memory":{"type":"fixed","value":16},"name":"bx2-metal-192x768","network_interface_count":{"max":128,"min":1,"type":"range"},"os_architecture":{"default":"amd64","type":"enum","values":["amd64"]},"resource_type":"bare_metal_server_profile","supported_trusted_platform_module_modes":{"type":"enum","values":["disabled"]}}]}'
- mock_response2 = '{"total_count":2,"limit":1,"profiles":[{"bandwidth":{"type":"fixed","value":20000},"console_types":{"type":"enum","values":["serial"]},"cpu_architecture":{"default":"amd64","type":"fixed","value":"amd64"},"cpu_core_count":{"type":"fixed","value":80},"cpu_socket_count":{"type":"fixed","value":4},"disks":[{"quantity":{"type":"fixed","value":4},"size":{"type":"fixed","value":100},"supported_interface_types":{"default":"fcp","type":"enum","values":["fcp"]}}],"family":"balanced","href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768","memory":{"type":"fixed","value":16},"name":"bx2-metal-192x768","network_interface_count":{"max":128,"min":1,"type":"range"},"os_architecture":{"default":"amd64","type":"enum","values":["amd64"]},"resource_type":"bare_metal_server_profile","supported_trusted_platform_module_modes":{"type":"enum","values":["disabled"]}}]}'
- responses.add(
- responses.GET,
- url,
- body=mock_response1,
- content_type='application/json',
- status=200,
- )
+ # Set up mock
+ url = preprocess_url('/backup_policies/testString')
+ mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::backup-policy:r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "health_reasons": [{"code": "missing_service_authorization_policies", "message": "One or more accounts are missing service authorization policies", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-backup-service-about&interface=ui"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "id": "r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "last_job_completed_at": "2019-01-01T12:00:00.000Z", "lifecycle_state": "stable", "match_user_tags": ["match_user_tags"], "name": "my-backup-policy", "plans": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "backup_policy", "scope": {"crn": "crn:v1:bluemix:public:enterprise::a/123456::enterprise:ebc2b430240943458b9e91e1432cfcce", "id": "fee82deba12e4c0fb69c3b09d1f12345", "resource_type": "enterprise"}, "included_content": ["data_volumes"], "match_resource_type": "instance"}'
responses.add(
responses.GET,
url,
- body=mock_response2,
+ body=mock_response,
content_type='application/json',
status=200,
)
- # Exercise the pager class for this operation
- all_results = []
- pager = BareMetalServerProfilesPager(
- client=_service,
- limit=10,
+ # Set up parameter values
+ id = 'testString'
+
+ # Invoke method
+ response = _service.get_backup_policy(
+ id,
+ headers={},
)
- while pager.has_next():
- next_page = pager.get_next()
- assert next_page is not None
- all_results.extend(next_page)
- assert len(all_results) == 2
+
+ # Check for correct operation
+ assert len(responses.calls) == 1
+ assert response.status_code == 200
+
+ def test_get_backup_policy_all_params_with_retries(self):
+ # Enable retries and run test_get_backup_policy_all_params.
+ _service.enable_retries()
+ self.test_get_backup_policy_all_params()
+
+ # Disable retries and run test_get_backup_policy_all_params.
+ _service.disable_retries()
+ self.test_get_backup_policy_all_params()
@responses.activate
- def test_list_bare_metal_server_profiles_with_pager_get_all(self):
+ def test_get_backup_policy_value_error(self):
"""
- test_list_bare_metal_server_profiles_with_pager_get_all()
+ test_get_backup_policy_value_error()
"""
- # Set up a two-page mock response
- url = preprocess_url('/bare_metal_server/profiles')
- mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"profiles":[{"bandwidth":{"type":"fixed","value":20000},"console_types":{"type":"enum","values":["serial"]},"cpu_architecture":{"default":"amd64","type":"fixed","value":"amd64"},"cpu_core_count":{"type":"fixed","value":80},"cpu_socket_count":{"type":"fixed","value":4},"disks":[{"quantity":{"type":"fixed","value":4},"size":{"type":"fixed","value":100},"supported_interface_types":{"default":"fcp","type":"enum","values":["fcp"]}}],"family":"balanced","href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768","memory":{"type":"fixed","value":16},"name":"bx2-metal-192x768","network_interface_count":{"max":128,"min":1,"type":"range"},"os_architecture":{"default":"amd64","type":"enum","values":["amd64"]},"resource_type":"bare_metal_server_profile","supported_trusted_platform_module_modes":{"type":"enum","values":["disabled"]}}]}'
- mock_response2 = '{"total_count":2,"limit":1,"profiles":[{"bandwidth":{"type":"fixed","value":20000},"console_types":{"type":"enum","values":["serial"]},"cpu_architecture":{"default":"amd64","type":"fixed","value":"amd64"},"cpu_core_count":{"type":"fixed","value":80},"cpu_socket_count":{"type":"fixed","value":4},"disks":[{"quantity":{"type":"fixed","value":4},"size":{"type":"fixed","value":100},"supported_interface_types":{"default":"fcp","type":"enum","values":["fcp"]}}],"family":"balanced","href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768","memory":{"type":"fixed","value":16},"name":"bx2-metal-192x768","network_interface_count":{"max":128,"min":1,"type":"range"},"os_architecture":{"default":"amd64","type":"enum","values":["amd64"]},"resource_type":"bare_metal_server_profile","supported_trusted_platform_module_modes":{"type":"enum","values":["disabled"]}}]}'
+ # Set up mock
+ url = preprocess_url('/backup_policies/testString')
+ mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::backup-policy:r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "health_reasons": [{"code": "missing_service_authorization_policies", "message": "One or more accounts are missing service authorization policies", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-backup-service-about&interface=ui"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "id": "r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "last_job_completed_at": "2019-01-01T12:00:00.000Z", "lifecycle_state": "stable", "match_user_tags": ["match_user_tags"], "name": "my-backup-policy", "plans": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "backup_policy", "scope": {"crn": "crn:v1:bluemix:public:enterprise::a/123456::enterprise:ebc2b430240943458b9e91e1432cfcce", "id": "fee82deba12e4c0fb69c3b09d1f12345", "resource_type": "enterprise"}, "included_content": ["data_volumes"], "match_resource_type": "instance"}'
responses.add(
responses.GET,
url,
- body=mock_response1,
+ 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_backup_policy(**req_copy)
+
+ def test_get_backup_policy_value_error_with_retries(self):
+ # Enable retries and run test_get_backup_policy_value_error.
+ _service.enable_retries()
+ self.test_get_backup_policy_value_error()
+
+ # Disable retries and run test_get_backup_policy_value_error.
+ _service.disable_retries()
+ self.test_get_backup_policy_value_error()
+
+
+class TestUpdateBackupPolicy:
+ """
+ Test Class for update_backup_policy
+ """
+
+ @responses.activate
+ def test_update_backup_policy_all_params(self):
+ """
+ update_backup_policy()
+ """
+ # Set up mock
+ url = preprocess_url('/backup_policies/testString')
+ mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::backup-policy:r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "health_reasons": [{"code": "missing_service_authorization_policies", "message": "One or more accounts are missing service authorization policies", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-backup-service-about&interface=ui"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "id": "r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "last_job_completed_at": "2019-01-01T12:00:00.000Z", "lifecycle_state": "stable", "match_user_tags": ["match_user_tags"], "name": "my-backup-policy", "plans": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "backup_policy", "scope": {"crn": "crn:v1:bluemix:public:enterprise::a/123456::enterprise:ebc2b430240943458b9e91e1432cfcce", "id": "fee82deba12e4c0fb69c3b09d1f12345", "resource_type": "enterprise"}, "included_content": ["data_volumes"], "match_resource_type": "instance"}'
responses.add(
- responses.GET,
+ responses.PATCH,
url,
- body=mock_response2,
+ body=mock_response,
content_type='application/json',
status=200,
)
- # Exercise the pager class for this operation
- pager = BareMetalServerProfilesPager(
- client=_service,
- limit=10,
+ # Construct a dict representation of a BackupPolicyPatch model
+ backup_policy_patch_model = {}
+ backup_policy_patch_model['included_content'] = ['data_volumes']
+ backup_policy_patch_model['match_user_tags'] = ['my-daily-backup-policy']
+ backup_policy_patch_model['name'] = 'my-backup-policy'
+
+ # Set up parameter values
+ id = 'testString'
+ backup_policy_patch = backup_policy_patch_model
+ if_match = 'W/"96d225c4-56bd-43d9-98fc-d7148e5c5028"'
+
+ # Invoke method
+ response = _service.update_backup_policy(
+ id,
+ backup_policy_patch,
+ if_match=if_match,
+ headers={},
)
- all_results = pager.get_all()
- assert all_results is not None
- assert len(all_results) == 2
+ # 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 == backup_policy_patch
-class TestGetBareMetalServerProfile:
- """
- Test Class for get_bare_metal_server_profile
- """
+ def test_update_backup_policy_all_params_with_retries(self):
+ # Enable retries and run test_update_backup_policy_all_params.
+ _service.enable_retries()
+ self.test_update_backup_policy_all_params()
+
+ # Disable retries and run test_update_backup_policy_all_params.
+ _service.disable_retries()
+ self.test_update_backup_policy_all_params()
@responses.activate
- def test_get_bare_metal_server_profile_all_params(self):
+ def test_update_backup_policy_required_params(self):
"""
- get_bare_metal_server_profile()
+ test_update_backup_policy_required_params()
"""
# Set up mock
- url = preprocess_url('/bare_metal_server/profiles/testString')
- mock_response = '{"bandwidth": {"type": "fixed", "value": 20000}, "console_types": {"type": "enum", "values": ["serial"]}, "cpu_architecture": {"default": "amd64", "type": "fixed", "value": "amd64"}, "cpu_core_count": {"type": "fixed", "value": 80}, "cpu_socket_count": {"type": "fixed", "value": 4}, "disks": [{"quantity": {"type": "fixed", "value": 4}, "size": {"type": "fixed", "value": 100}, "supported_interface_types": {"default": "fcp", "type": "enum", "values": ["fcp"]}}], "family": "balanced", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768", "memory": {"type": "fixed", "value": 16}, "name": "bx2-metal-192x768", "network_interface_count": {"max": 128, "min": 1, "type": "range"}, "os_architecture": {"default": "amd64", "type": "enum", "values": ["amd64"]}, "resource_type": "bare_metal_server_profile", "supported_trusted_platform_module_modes": {"type": "enum", "values": ["disabled"]}}'
+ url = preprocess_url('/backup_policies/testString')
+ mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::backup-policy:r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "health_reasons": [{"code": "missing_service_authorization_policies", "message": "One or more accounts are missing service authorization policies", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-backup-service-about&interface=ui"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "id": "r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "last_job_completed_at": "2019-01-01T12:00:00.000Z", "lifecycle_state": "stable", "match_user_tags": ["match_user_tags"], "name": "my-backup-policy", "plans": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "backup_policy", "scope": {"crn": "crn:v1:bluemix:public:enterprise::a/123456::enterprise:ebc2b430240943458b9e91e1432cfcce", "id": "fee82deba12e4c0fb69c3b09d1f12345", "resource_type": "enterprise"}, "included_content": ["data_volumes"], "match_resource_type": "instance"}'
responses.add(
- responses.GET,
+ responses.PATCH,
url,
body=mock_response,
content_type='application/json',
status=200,
)
+ # Construct a dict representation of a BackupPolicyPatch model
+ backup_policy_patch_model = {}
+ backup_policy_patch_model['included_content'] = ['data_volumes']
+ backup_policy_patch_model['match_user_tags'] = ['my-daily-backup-policy']
+ backup_policy_patch_model['name'] = 'my-backup-policy'
+
# Set up parameter values
- name = 'testString'
+ id = 'testString'
+ backup_policy_patch = backup_policy_patch_model
# Invoke method
- response = _service.get_bare_metal_server_profile(
- name,
+ response = _service.update_backup_policy(
+ id,
+ backup_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 == backup_policy_patch
- def test_get_bare_metal_server_profile_all_params_with_retries(self):
- # Enable retries and run test_get_bare_metal_server_profile_all_params.
+ def test_update_backup_policy_required_params_with_retries(self):
+ # Enable retries and run test_update_backup_policy_required_params.
_service.enable_retries()
- self.test_get_bare_metal_server_profile_all_params()
+ self.test_update_backup_policy_required_params()
- # Disable retries and run test_get_bare_metal_server_profile_all_params.
+ # Disable retries and run test_update_backup_policy_required_params.
_service.disable_retries()
- self.test_get_bare_metal_server_profile_all_params()
+ self.test_update_backup_policy_required_params()
@responses.activate
- def test_get_bare_metal_server_profile_value_error(self):
+ def test_update_backup_policy_value_error(self):
"""
- test_get_bare_metal_server_profile_value_error()
+ test_update_backup_policy_value_error()
"""
# Set up mock
- url = preprocess_url('/bare_metal_server/profiles/testString')
- mock_response = '{"bandwidth": {"type": "fixed", "value": 20000}, "console_types": {"type": "enum", "values": ["serial"]}, "cpu_architecture": {"default": "amd64", "type": "fixed", "value": "amd64"}, "cpu_core_count": {"type": "fixed", "value": 80}, "cpu_socket_count": {"type": "fixed", "value": 4}, "disks": [{"quantity": {"type": "fixed", "value": 4}, "size": {"type": "fixed", "value": 100}, "supported_interface_types": {"default": "fcp", "type": "enum", "values": ["fcp"]}}], "family": "balanced", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768", "memory": {"type": "fixed", "value": 16}, "name": "bx2-metal-192x768", "network_interface_count": {"max": 128, "min": 1, "type": "range"}, "os_architecture": {"default": "amd64", "type": "enum", "values": ["amd64"]}, "resource_type": "bare_metal_server_profile", "supported_trusted_platform_module_modes": {"type": "enum", "values": ["disabled"]}}'
+ url = preprocess_url('/backup_policies/testString')
+ mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::backup-policy:r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "health_reasons": [{"code": "missing_service_authorization_policies", "message": "One or more accounts are missing service authorization policies", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-backup-service-about&interface=ui"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "id": "r134-076191ba-49c2-4763-94fd-c70de73ee2e6", "last_job_completed_at": "2019-01-01T12:00:00.000Z", "lifecycle_state": "stable", "match_user_tags": ["match_user_tags"], "name": "my-backup-policy", "plans": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "backup_policy", "scope": {"crn": "crn:v1:bluemix:public:enterprise::a/123456::enterprise:ebc2b430240943458b9e91e1432cfcce", "id": "fee82deba12e4c0fb69c3b09d1f12345", "resource_type": "enterprise"}, "included_content": ["data_volumes"], "match_resource_type": "instance"}'
responses.add(
- responses.GET,
+ responses.PATCH,
url,
body=mock_response,
content_type='application/json',
status=200,
)
+ # Construct a dict representation of a BackupPolicyPatch model
+ backup_policy_patch_model = {}
+ backup_policy_patch_model['included_content'] = ['data_volumes']
+ backup_policy_patch_model['match_user_tags'] = ['my-daily-backup-policy']
+ backup_policy_patch_model['name'] = 'my-backup-policy'
+
# Set up parameter values
- name = 'testString'
+ id = 'testString'
+ backup_policy_patch = backup_policy_patch_model
# Pass in all but one required param and check for a ValueError
req_param_dict = {
- "name": name,
+ "id": id,
+ "backup_policy_patch": backup_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.get_bare_metal_server_profile(**req_copy)
+ _service.update_backup_policy(**req_copy)
- def test_get_bare_metal_server_profile_value_error_with_retries(self):
- # Enable retries and run test_get_bare_metal_server_profile_value_error.
+ def test_update_backup_policy_value_error_with_retries(self):
+ # Enable retries and run test_update_backup_policy_value_error.
_service.enable_retries()
- self.test_get_bare_metal_server_profile_value_error()
+ self.test_update_backup_policy_value_error()
- # Disable retries and run test_get_bare_metal_server_profile_value_error.
+ # Disable retries and run test_update_backup_policy_value_error.
_service.disable_retries()
- self.test_get_bare_metal_server_profile_value_error()
+ self.test_update_backup_policy_value_error()
-class TestListBareMetalServers:
+# endregion
+##############################################################################
+# End of Service: BackupPolicies
+##############################################################################
+
+##############################################################################
+# Start of Service: PlacementGroups
+##############################################################################
+# region
+
+
+class TestNewInstance:
"""
- Test Class for list_bare_metal_servers
+ 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 TestListPlacementGroups:
+ """
+ Test Class for list_placement_groups
"""
@responses.activate
- def test_list_bare_metal_servers_all_params(self):
+ def test_list_placement_groups_all_params(self):
"""
- list_bare_metal_servers()
+ list_placement_groups()
"""
# Set up mock
- url = preprocess_url('/bare_metal_servers')
- mock_response = '{"bare_metal_servers": [{"bandwidth": 20000, "boot_target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-bare-metal-server-disk", "resource_type": "bare_metal_server_disk"}, "cpu": {"architecture": "amd64", "core_count": 80, "socket_count": 4, "threads_per_core": 2}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::bare-metal-server:1e09281b-f177-46fb-baf1-bc152b2e391a", "disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "fcp", "name": "my-bare-metal-server-disk", "resource_type": "bare_metal_server_disk", "size": 100}], "enable_secure_boot": false, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "memory": 1536, "name": "my-bare-metal-server", "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-bare-metal-server-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}], "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-bare-metal-server-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768", "name": "bx2-metal-192x768", "resource_type": "bare_metal_server_profile"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "bare_metal_server", "status": "deleting", "status_reasons": [{"code": "cannot_start_capacity", "message": "The bare metal server cannot start as there is no more capacity in this\nzone for a bare metal server with the requested profile.", "more_info": "https://console.bluemix.net/docs/iaas/bare_metal_server.html"}], "trusted_platform_module": {"enabled": true, "mode": "disabled", "supported_modes": ["disabled"]}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}'
+ 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,
@@ -19820,21 +20669,11 @@ def test_list_bare_metal_servers_all_params(self):
# Set up parameter values
start = 'testString'
limit = 50
- resource_group_id = 'testString'
- name = 'testString'
- vpc_id = 'testString'
- vpc_crn = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b'
- vpc_name = 'my-vpc'
# Invoke method
- response = _service.list_bare_metal_servers(
+ response = _service.list_placement_groups(
start=start,
limit=limit,
- resource_group_id=resource_group_id,
- name=name,
- vpc_id=vpc_id,
- vpc_crn=vpc_crn,
- vpc_name=vpc_name,
headers={},
)
@@ -19846,29 +20685,24 @@ def test_list_bare_metal_servers_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 '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_bare_metal_servers_all_params_with_retries(self):
- # Enable retries and run test_list_bare_metal_servers_all_params.
+ def test_list_placement_groups_all_params_with_retries(self):
+ # Enable retries and run test_list_placement_groups_all_params.
_service.enable_retries()
- self.test_list_bare_metal_servers_all_params()
+ self.test_list_placement_groups_all_params()
- # Disable retries and run test_list_bare_metal_servers_all_params.
+ # Disable retries and run test_list_placement_groups_all_params.
_service.disable_retries()
- self.test_list_bare_metal_servers_all_params()
+ self.test_list_placement_groups_all_params()
@responses.activate
- def test_list_bare_metal_servers_required_params(self):
+ def test_list_placement_groups_required_params(self):
"""
- test_list_bare_metal_servers_required_params()
+ test_list_placement_groups_required_params()
"""
# Set up mock
- url = preprocess_url('/bare_metal_servers')
- mock_response = '{"bare_metal_servers": [{"bandwidth": 20000, "boot_target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-bare-metal-server-disk", "resource_type": "bare_metal_server_disk"}, "cpu": {"architecture": "amd64", "core_count": 80, "socket_count": 4, "threads_per_core": 2}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::bare-metal-server:1e09281b-f177-46fb-baf1-bc152b2e391a", "disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "fcp", "name": "my-bare-metal-server-disk", "resource_type": "bare_metal_server_disk", "size": 100}], "enable_secure_boot": false, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "memory": 1536, "name": "my-bare-metal-server", "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-bare-metal-server-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}], "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-bare-metal-server-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768", "name": "bx2-metal-192x768", "resource_type": "bare_metal_server_profile"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "bare_metal_server", "status": "deleting", "status_reasons": [{"code": "cannot_start_capacity", "message": "The bare metal server cannot start as there is no more capacity in this\nzone for a bare metal server with the requested profile.", "more_info": "https://console.bluemix.net/docs/iaas/bare_metal_server.html"}], "trusted_platform_module": {"enabled": true, "mode": "disabled", "supported_modes": ["disabled"]}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}'
+ 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,
@@ -19878,29 +20712,29 @@ def test_list_bare_metal_servers_required_params(self):
)
# Invoke method
- response = _service.list_bare_metal_servers()
+ response = _service.list_placement_groups()
# Check for correct operation
assert len(responses.calls) == 1
assert response.status_code == 200
- def test_list_bare_metal_servers_required_params_with_retries(self):
- # Enable retries and run test_list_bare_metal_servers_required_params.
+ def test_list_placement_groups_required_params_with_retries(self):
+ # Enable retries and run test_list_placement_groups_required_params.
_service.enable_retries()
- self.test_list_bare_metal_servers_required_params()
+ self.test_list_placement_groups_required_params()
- # Disable retries and run test_list_bare_metal_servers_required_params.
+ # Disable retries and run test_list_placement_groups_required_params.
_service.disable_retries()
- self.test_list_bare_metal_servers_required_params()
+ self.test_list_placement_groups_required_params()
@responses.activate
- def test_list_bare_metal_servers_value_error(self):
+ def test_list_placement_groups_value_error(self):
"""
- test_list_bare_metal_servers_value_error()
+ test_list_placement_groups_value_error()
"""
# Set up mock
- url = preprocess_url('/bare_metal_servers')
- mock_response = '{"bare_metal_servers": [{"bandwidth": 20000, "boot_target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-bare-metal-server-disk", "resource_type": "bare_metal_server_disk"}, "cpu": {"architecture": "amd64", "core_count": 80, "socket_count": 4, "threads_per_core": 2}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::bare-metal-server:1e09281b-f177-46fb-baf1-bc152b2e391a", "disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "fcp", "name": "my-bare-metal-server-disk", "resource_type": "bare_metal_server_disk", "size": 100}], "enable_secure_boot": false, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "memory": 1536, "name": "my-bare-metal-server", "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-bare-metal-server-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}], "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-bare-metal-server-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768", "name": "bx2-metal-192x768", "resource_type": "bare_metal_server_profile"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "bare_metal_server", "status": "deleting", "status_reasons": [{"code": "cannot_start_capacity", "message": "The bare metal server cannot start as there is no more capacity in this\nzone for a bare metal server with the requested profile.", "more_info": "https://console.bluemix.net/docs/iaas/bare_metal_server.html"}], "trusted_platform_module": {"enabled": true, "mode": "disabled", "supported_modes": ["disabled"]}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}'
+ 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,
@@ -19915,26 +20749,26 @@ def test_list_bare_metal_servers_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_bare_metal_servers(**req_copy)
+ _service.list_placement_groups(**req_copy)
- def test_list_bare_metal_servers_value_error_with_retries(self):
- # Enable retries and run test_list_bare_metal_servers_value_error.
+ def test_list_placement_groups_value_error_with_retries(self):
+ # Enable retries and run test_list_placement_groups_value_error.
_service.enable_retries()
- self.test_list_bare_metal_servers_value_error()
+ self.test_list_placement_groups_value_error()
- # Disable retries and run test_list_bare_metal_servers_value_error.
+ # Disable retries and run test_list_placement_groups_value_error.
_service.disable_retries()
- self.test_list_bare_metal_servers_value_error()
+ self.test_list_placement_groups_value_error()
@responses.activate
- def test_list_bare_metal_servers_with_pager_get_next(self):
+ def test_list_placement_groups_with_pager_get_next(self):
"""
- test_list_bare_metal_servers_with_pager_get_next()
+ test_list_placement_groups_with_pager_get_next()
"""
# Set up a two-page mock response
- url = preprocess_url('/bare_metal_servers')
- mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"bare_metal_servers":[{"bandwidth":20000,"boot_target":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-bare-metal-server-disk","resource_type":"bare_metal_server_disk"},"cpu":{"architecture":"amd64","core_count":80,"socket_count":4,"threads_per_core":2},"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::bare-metal-server:1e09281b-f177-46fb-baf1-bc152b2e391a","disks":[{"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","interface_type":"fcp","name":"my-bare-metal-server-disk","resource_type":"bare_metal_server_disk","size":100}],"enable_secure_boot":false,"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a","id":"1e09281b-f177-46fb-baf1-bc152b2e391a","lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","memory":1536,"name":"my-bare-metal-server","network_interfaces":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-bare-metal-server-network-interface","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"network_interface","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}}],"primary_network_interface":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-bare-metal-server-network-interface","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"network_interface","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}},"profile":{"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768","name":"bx2-metal-192x768","resource_type":"bare_metal_server_profile"},"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"bare_metal_server","status":"deleting","status_reasons":[{"code":"cannot_start_capacity","message":"The bare metal server cannot start as there is no more capacity in this\\nzone for a bare metal server with the requested profile.","more_info":"https://console.bluemix.net/docs/iaas/bare_metal_server.html"}],"trusted_platform_module":{"enabled":true,"mode":"disabled","supported_modes":["disabled"]},"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}]}'
- mock_response2 = '{"total_count":2,"limit":1,"bare_metal_servers":[{"bandwidth":20000,"boot_target":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-bare-metal-server-disk","resource_type":"bare_metal_server_disk"},"cpu":{"architecture":"amd64","core_count":80,"socket_count":4,"threads_per_core":2},"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::bare-metal-server:1e09281b-f177-46fb-baf1-bc152b2e391a","disks":[{"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","interface_type":"fcp","name":"my-bare-metal-server-disk","resource_type":"bare_metal_server_disk","size":100}],"enable_secure_boot":false,"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a","id":"1e09281b-f177-46fb-baf1-bc152b2e391a","lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","memory":1536,"name":"my-bare-metal-server","network_interfaces":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-bare-metal-server-network-interface","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"network_interface","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}}],"primary_network_interface":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-bare-metal-server-network-interface","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"network_interface","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}},"profile":{"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768","name":"bx2-metal-192x768","resource_type":"bare_metal_server_profile"},"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"bare_metal_server","status":"deleting","status_reasons":[{"code":"cannot_start_capacity","message":"The bare metal server cannot start as there is no more capacity in this\\nzone for a bare metal server with the requested profile.","more_info":"https://console.bluemix.net/docs/iaas/bare_metal_server.html"}],"trusted_platform_module":{"enabled":true,"mode":"disabled","supported_modes":["disabled"]},"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}]}'
+ url = preprocess_url('/placement_groups')
+ mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"placement_groups":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::placement-group:r018-418fe842-a3e9-47b9-a938-1aa5bd632871","href":"https://us-south.iaas.cloud.ibm.com/v1/placement_groups/r018-418fe842-a3e9-47b9-a938-1aa5bd632871","id":"r018-418fe842-a3e9-47b9-a938-1aa5bd632871","lifecycle_state":"stable","name":"my-placement-group","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"placement_group","strategy":"host_spread"}]}'
+ mock_response2 = '{"total_count":2,"limit":1,"placement_groups":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::placement-group:r018-418fe842-a3e9-47b9-a938-1aa5bd632871","href":"https://us-south.iaas.cloud.ibm.com/v1/placement_groups/r018-418fe842-a3e9-47b9-a938-1aa5bd632871","id":"r018-418fe842-a3e9-47b9-a938-1aa5bd632871","lifecycle_state":"stable","name":"my-placement-group","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"placement_group","strategy":"host_spread"}]}'
responses.add(
responses.GET,
url,
@@ -19952,14 +20786,9 @@ def test_list_bare_metal_servers_with_pager_get_next(self):
# Exercise the pager class for this operation
all_results = []
- pager = BareMetalServersPager(
+ pager = PlacementGroupsPager(
client=_service,
limit=10,
- resource_group_id='testString',
- name='testString',
- vpc_id='testString',
- vpc_crn='crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b',
- vpc_name='my-vpc',
)
while pager.has_next():
next_page = pager.get_next()
@@ -19968,14 +20797,14 @@ def test_list_bare_metal_servers_with_pager_get_next(self):
assert len(all_results) == 2
@responses.activate
- def test_list_bare_metal_servers_with_pager_get_all(self):
+ def test_list_placement_groups_with_pager_get_all(self):
"""
- test_list_bare_metal_servers_with_pager_get_all()
+ test_list_placement_groups_with_pager_get_all()
"""
# Set up a two-page mock response
- url = preprocess_url('/bare_metal_servers')
- mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"bare_metal_servers":[{"bandwidth":20000,"boot_target":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-bare-metal-server-disk","resource_type":"bare_metal_server_disk"},"cpu":{"architecture":"amd64","core_count":80,"socket_count":4,"threads_per_core":2},"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::bare-metal-server:1e09281b-f177-46fb-baf1-bc152b2e391a","disks":[{"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","interface_type":"fcp","name":"my-bare-metal-server-disk","resource_type":"bare_metal_server_disk","size":100}],"enable_secure_boot":false,"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a","id":"1e09281b-f177-46fb-baf1-bc152b2e391a","lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","memory":1536,"name":"my-bare-metal-server","network_interfaces":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-bare-metal-server-network-interface","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"network_interface","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}}],"primary_network_interface":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-bare-metal-server-network-interface","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"network_interface","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}},"profile":{"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768","name":"bx2-metal-192x768","resource_type":"bare_metal_server_profile"},"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"bare_metal_server","status":"deleting","status_reasons":[{"code":"cannot_start_capacity","message":"The bare metal server cannot start as there is no more capacity in this\\nzone for a bare metal server with the requested profile.","more_info":"https://console.bluemix.net/docs/iaas/bare_metal_server.html"}],"trusted_platform_module":{"enabled":true,"mode":"disabled","supported_modes":["disabled"]},"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}]}'
- mock_response2 = '{"total_count":2,"limit":1,"bare_metal_servers":[{"bandwidth":20000,"boot_target":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-bare-metal-server-disk","resource_type":"bare_metal_server_disk"},"cpu":{"architecture":"amd64","core_count":80,"socket_count":4,"threads_per_core":2},"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::bare-metal-server:1e09281b-f177-46fb-baf1-bc152b2e391a","disks":[{"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","interface_type":"fcp","name":"my-bare-metal-server-disk","resource_type":"bare_metal_server_disk","size":100}],"enable_secure_boot":false,"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a","id":"1e09281b-f177-46fb-baf1-bc152b2e391a","lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","memory":1536,"name":"my-bare-metal-server","network_interfaces":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-bare-metal-server-network-interface","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"network_interface","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}}],"primary_network_interface":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-bare-metal-server-network-interface","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"network_interface","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}},"profile":{"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768","name":"bx2-metal-192x768","resource_type":"bare_metal_server_profile"},"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"bare_metal_server","status":"deleting","status_reasons":[{"code":"cannot_start_capacity","message":"The bare metal server cannot start as there is no more capacity in this\\nzone for a bare metal server with the requested profile.","more_info":"https://console.bluemix.net/docs/iaas/bare_metal_server.html"}],"trusted_platform_module":{"enabled":true,"mode":"disabled","supported_modes":["disabled"]},"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}]}'
+ url = preprocess_url('/placement_groups')
+ mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"placement_groups":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::placement-group:r018-418fe842-a3e9-47b9-a938-1aa5bd632871","href":"https://us-south.iaas.cloud.ibm.com/v1/placement_groups/r018-418fe842-a3e9-47b9-a938-1aa5bd632871","id":"r018-418fe842-a3e9-47b9-a938-1aa5bd632871","lifecycle_state":"stable","name":"my-placement-group","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"placement_group","strategy":"host_spread"}]}'
+ mock_response2 = '{"total_count":2,"limit":1,"placement_groups":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::placement-group:r018-418fe842-a3e9-47b9-a938-1aa5bd632871","href":"https://us-south.iaas.cloud.ibm.com/v1/placement_groups/r018-418fe842-a3e9-47b9-a938-1aa5bd632871","id":"r018-418fe842-a3e9-47b9-a938-1aa5bd632871","lifecycle_state":"stable","name":"my-placement-group","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"placement_group","strategy":"host_spread"}]}'
responses.add(
responses.GET,
url,
@@ -19992,33 +20821,28 @@ def test_list_bare_metal_servers_with_pager_get_all(self):
)
# Exercise the pager class for this operation
- pager = BareMetalServersPager(
+ pager = PlacementGroupsPager(
client=_service,
limit=10,
- resource_group_id='testString',
- name='testString',
- vpc_id='testString',
- vpc_crn='crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b',
- vpc_name='my-vpc',
)
all_results = pager.get_all()
assert all_results is not None
assert len(all_results) == 2
-class TestCreateBareMetalServer:
+class TestCreatePlacementGroup:
"""
- Test Class for create_bare_metal_server
+ Test Class for create_placement_group
"""
@responses.activate
- def test_create_bare_metal_server_all_params(self):
+ def test_create_placement_group_all_params(self):
"""
- create_bare_metal_server()
+ create_placement_group()
"""
# Set up mock
- url = preprocess_url('/bare_metal_servers')
- mock_response = '{"bandwidth": 20000, "boot_target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-bare-metal-server-disk", "resource_type": "bare_metal_server_disk"}, "cpu": {"architecture": "amd64", "core_count": 80, "socket_count": 4, "threads_per_core": 2}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::bare-metal-server:1e09281b-f177-46fb-baf1-bc152b2e391a", "disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "fcp", "name": "my-bare-metal-server-disk", "resource_type": "bare_metal_server_disk", "size": 100}], "enable_secure_boot": false, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "memory": 1536, "name": "my-bare-metal-server", "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-bare-metal-server-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}], "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-bare-metal-server-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768", "name": "bx2-metal-192x768", "resource_type": "bare_metal_server_profile"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "bare_metal_server", "status": "deleting", "status_reasons": [{"code": "cannot_start_capacity", "message": "The bare metal server cannot start as there is no more capacity in this\nzone for a bare metal server with the requested profile.", "more_info": "https://console.bluemix.net/docs/iaas/bare_metal_server.html"}], "trusted_platform_module": {"enabled": true, "mode": "disabled", "supported_modes": ["disabled"]}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
+ 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,
@@ -20027,99 +20851,20 @@ def test_create_bare_metal_server_all_params(self):
status=201,
)
- # 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 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 NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext model
- network_interface_ip_prototype_model = {}
- network_interface_ip_prototype_model['address'] = '10.0.0.5'
- network_interface_ip_prototype_model['auto_delete'] = False
- network_interface_ip_prototype_model['name'] = 'my-reserved-ip'
-
- # Construct a dict representation of a SecurityGroupIdentityById model
- security_group_identity_model = {}
- security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271'
-
- # 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-bare-metal-server-network-interface'
- bare_metal_server_primary_network_interface_prototype_model['primary_ip'] = network_interface_ip_prototype_model
- bare_metal_server_primary_network_interface_prototype_model['security_groups'] = [security_group_identity_model]
- bare_metal_server_primary_network_interface_prototype_model['subnet'] = subnet_identity_model
-
- # 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 BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype model
- bare_metal_server_network_interface_prototype_model = {}
- bare_metal_server_network_interface_prototype_model['allow_ip_spoofing'] = True
- bare_metal_server_network_interface_prototype_model['enable_infrastructure_nat'] = True
- bare_metal_server_network_interface_prototype_model['name'] = 'my-bare-metal-server-network-interface'
- bare_metal_server_network_interface_prototype_model['primary_ip'] = network_interface_ip_prototype_model
- bare_metal_server_network_interface_prototype_model['security_groups'] = [security_group_identity_model]
- bare_metal_server_network_interface_prototype_model['subnet'] = subnet_identity_model
- bare_metal_server_network_interface_prototype_model['interface_type'] = 'hipersocket'
-
# Construct a dict representation of a ResourceGroupIdentityById model
resource_group_identity_model = {}
resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
- # Construct a dict representation of a BareMetalServerTrustedPlatformModulePrototype model
- bare_metal_server_trusted_platform_module_prototype_model = {}
- bare_metal_server_trusted_platform_module_prototype_model['mode'] = 'disabled'
-
- # Construct a dict representation of a VPCIdentityById model
- vpc_identity_model = {}
- vpc_identity_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b'
-
# Set up parameter values
- 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
- enable_secure_boot = False
- name = 'my-bare-metal-server'
- network_interfaces = [bare_metal_server_network_interface_prototype_model]
+ strategy = 'host_spread'
+ name = 'my-placement-group'
resource_group = resource_group_identity_model
- trusted_platform_module = bare_metal_server_trusted_platform_module_prototype_model
- vpc = vpc_identity_model
# Invoke method
- response = _service.create_bare_metal_server(
- initialization,
- primary_network_interface,
- profile,
- zone,
- enable_secure_boot=enable_secure_boot,
+ response = _service.create_placement_group(
+ strategy,
name=name,
- network_interfaces=network_interfaces,
resource_group=resource_group,
- trusted_platform_module=trusted_platform_module,
- vpc=vpc,
headers={},
)
@@ -20128,34 +20873,27 @@ def test_create_bare_metal_server_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['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['enable_secure_boot'] == False
- assert req_body['name'] == 'my-bare-metal-server'
- assert req_body['network_interfaces'] == [bare_metal_server_network_interface_prototype_model]
+ assert req_body['strategy'] == 'host_spread'
+ assert req_body['name'] == 'my-placement-group'
assert req_body['resource_group'] == resource_group_identity_model
- assert req_body['trusted_platform_module'] == bare_metal_server_trusted_platform_module_prototype_model
- assert req_body['vpc'] == vpc_identity_model
- def test_create_bare_metal_server_all_params_with_retries(self):
- # Enable retries and run test_create_bare_metal_server_all_params.
+ def test_create_placement_group_all_params_with_retries(self):
+ # Enable retries and run test_create_placement_group_all_params.
_service.enable_retries()
- self.test_create_bare_metal_server_all_params()
+ self.test_create_placement_group_all_params()
- # Disable retries and run test_create_bare_metal_server_all_params.
+ # Disable retries and run test_create_placement_group_all_params.
_service.disable_retries()
- self.test_create_bare_metal_server_all_params()
+ self.test_create_placement_group_all_params()
@responses.activate
- def test_create_bare_metal_server_value_error(self):
+ def test_create_placement_group_value_error(self):
"""
- test_create_bare_metal_server_value_error()
+ test_create_placement_group_value_error()
"""
# Set up mock
- url = preprocess_url('/bare_metal_servers')
- mock_response = '{"bandwidth": 20000, "boot_target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-bare-metal-server-disk", "resource_type": "bare_metal_server_disk"}, "cpu": {"architecture": "amd64", "core_count": 80, "socket_count": 4, "threads_per_core": 2}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::bare-metal-server:1e09281b-f177-46fb-baf1-bc152b2e391a", "disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "fcp", "name": "my-bare-metal-server-disk", "resource_type": "bare_metal_server_disk", "size": 100}], "enable_secure_boot": false, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "memory": 1536, "name": "my-bare-metal-server", "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-bare-metal-server-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}], "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-bare-metal-server-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768", "name": "bx2-metal-192x768", "resource_type": "bare_metal_server_profile"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "bare_metal_server", "status": "deleting", "status_reasons": [{"code": "cannot_start_capacity", "message": "The bare metal server cannot start as there is no more capacity in this\nzone for a bare metal server with the requested profile.", "more_info": "https://console.bluemix.net/docs/iaas/bare_metal_server.html"}], "trusted_platform_module": {"enabled": true, "mode": "disabled", "supported_modes": ["disabled"]}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
+ 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,
@@ -20164,214 +20902,122 @@ def test_create_bare_metal_server_value_error(self):
status=201,
)
- # 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 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 NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext model
- network_interface_ip_prototype_model = {}
- network_interface_ip_prototype_model['address'] = '10.0.0.5'
- network_interface_ip_prototype_model['auto_delete'] = False
- network_interface_ip_prototype_model['name'] = 'my-reserved-ip'
-
- # Construct a dict representation of a SecurityGroupIdentityById model
- security_group_identity_model = {}
- security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271'
-
- # 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-bare-metal-server-network-interface'
- bare_metal_server_primary_network_interface_prototype_model['primary_ip'] = network_interface_ip_prototype_model
- bare_metal_server_primary_network_interface_prototype_model['security_groups'] = [security_group_identity_model]
- bare_metal_server_primary_network_interface_prototype_model['subnet'] = subnet_identity_model
-
- # 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 BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype model
- bare_metal_server_network_interface_prototype_model = {}
- bare_metal_server_network_interface_prototype_model['allow_ip_spoofing'] = True
- bare_metal_server_network_interface_prototype_model['enable_infrastructure_nat'] = True
- bare_metal_server_network_interface_prototype_model['name'] = 'my-bare-metal-server-network-interface'
- bare_metal_server_network_interface_prototype_model['primary_ip'] = network_interface_ip_prototype_model
- bare_metal_server_network_interface_prototype_model['security_groups'] = [security_group_identity_model]
- bare_metal_server_network_interface_prototype_model['subnet'] = subnet_identity_model
- bare_metal_server_network_interface_prototype_model['interface_type'] = 'hipersocket'
-
# Construct a dict representation of a ResourceGroupIdentityById model
resource_group_identity_model = {}
resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
- # Construct a dict representation of a BareMetalServerTrustedPlatformModulePrototype model
- bare_metal_server_trusted_platform_module_prototype_model = {}
- bare_metal_server_trusted_platform_module_prototype_model['mode'] = 'disabled'
-
- # Construct a dict representation of a VPCIdentityById model
- vpc_identity_model = {}
- vpc_identity_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b'
-
# Set up parameter values
- 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
- enable_secure_boot = False
- name = 'my-bare-metal-server'
- network_interfaces = [bare_metal_server_network_interface_prototype_model]
+ strategy = 'host_spread'
+ name = 'my-placement-group'
resource_group = resource_group_identity_model
- trusted_platform_module = bare_metal_server_trusted_platform_module_prototype_model
- vpc = vpc_identity_model
# Pass in all but one required param and check for a ValueError
req_param_dict = {
- "initialization": initialization,
- "primary_network_interface": primary_network_interface,
- "profile": profile,
- "zone": zone,
+ "strategy": strategy,
}
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_bare_metal_server(**req_copy)
+ _service.create_placement_group(**req_copy)
- def test_create_bare_metal_server_value_error_with_retries(self):
- # Enable retries and run test_create_bare_metal_server_value_error.
+ def test_create_placement_group_value_error_with_retries(self):
+ # Enable retries and run test_create_placement_group_value_error.
_service.enable_retries()
- self.test_create_bare_metal_server_value_error()
+ self.test_create_placement_group_value_error()
- # Disable retries and run test_create_bare_metal_server_value_error.
+ # Disable retries and run test_create_placement_group_value_error.
_service.disable_retries()
- self.test_create_bare_metal_server_value_error()
+ self.test_create_placement_group_value_error()
-class TestCreateBareMetalServerConsoleAccessToken:
+class TestDeletePlacementGroup:
"""
- Test Class for create_bare_metal_server_console_access_token
+ Test Class for delete_placement_group
"""
@responses.activate
- def test_create_bare_metal_server_console_access_token_all_params(self):
+ def test_delete_placement_group_all_params(self):
"""
- create_bare_metal_server_console_access_token()
+ delete_placement_group()
"""
# Set up mock
- 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"}'
+ url = preprocess_url('/placement_groups/testString')
responses.add(
- responses.POST,
+ responses.DELETE,
url,
- body=mock_response,
- content_type='application/json',
- status=200,
+ status=202,
)
# Set up parameter values
- bare_metal_server_id = 'testString'
- console_type = 'serial'
- force = False
+ id = 'testString'
# Invoke method
- response = _service.create_bare_metal_server_console_access_token(
- bare_metal_server_id,
- console_type,
- force=force,
+ response = _service.delete_placement_group(
+ id,
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['console_type'] == 'serial'
- assert req_body['force'] == False
+ assert response.status_code == 202
- 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.
+ def test_delete_placement_group_all_params_with_retries(self):
+ # Enable retries and run test_delete_placement_group_all_params.
_service.enable_retries()
- self.test_create_bare_metal_server_console_access_token_all_params()
+ self.test_delete_placement_group_all_params()
- # Disable retries and run test_create_bare_metal_server_console_access_token_all_params.
+ # Disable retries and run test_delete_placement_group_all_params.
_service.disable_retries()
- self.test_create_bare_metal_server_console_access_token_all_params()
+ self.test_delete_placement_group_all_params()
@responses.activate
- def test_create_bare_metal_server_console_access_token_value_error(self):
+ def test_delete_placement_group_value_error(self):
"""
- test_create_bare_metal_server_console_access_token_value_error()
+ test_delete_placement_group_value_error()
"""
# Set up mock
- 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"}'
+ url = preprocess_url('/placement_groups/testString')
responses.add(
- responses.POST,
+ responses.DELETE,
url,
- body=mock_response,
- content_type='application/json',
- status=200,
+ status=202,
)
# Set up parameter values
- bare_metal_server_id = 'testString'
- console_type = 'serial'
- force = False
+ 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,
- "console_type": console_type,
+ "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_bare_metal_server_console_access_token(**req_copy)
+ _service.delete_placement_group(**req_copy)
- def test_create_bare_metal_server_console_access_token_value_error_with_retries(self):
- # Enable retries and run test_create_bare_metal_server_console_access_token_value_error.
+ def test_delete_placement_group_value_error_with_retries(self):
+ # Enable retries and run test_delete_placement_group_value_error.
_service.enable_retries()
- self.test_create_bare_metal_server_console_access_token_value_error()
+ self.test_delete_placement_group_value_error()
- # Disable retries and run test_create_bare_metal_server_console_access_token_value_error.
+ # Disable retries and run test_delete_placement_group_value_error.
_service.disable_retries()
- self.test_create_bare_metal_server_console_access_token_value_error()
+ self.test_delete_placement_group_value_error()
-class TestListBareMetalServerDisks:
+class TestGetPlacementGroup:
"""
- Test Class for list_bare_metal_server_disks
+ Test Class for get_placement_group
"""
@responses.activate
- def test_list_bare_metal_server_disks_all_params(self):
+ def test_get_placement_group_all_params(self):
"""
- list_bare_metal_server_disks()
+ get_placement_group()
"""
# Set up mock
- url = preprocess_url('/bare_metal_servers/testString/disks')
- mock_response = '{"disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "fcp", "name": "my-bare-metal-server-disk", "resource_type": "bare_metal_server_disk", "size": 100}]}'
+ 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,
@@ -20381,11 +21027,11 @@ def test_list_bare_metal_server_disks_all_params(self):
)
# Set up parameter values
- bare_metal_server_id = 'testString'
+ id = 'testString'
# Invoke method
- response = _service.list_bare_metal_server_disks(
- bare_metal_server_id,
+ response = _service.get_placement_group(
+ id,
headers={},
)
@@ -20393,23 +21039,23 @@ def test_list_bare_metal_server_disks_all_params(self):
assert len(responses.calls) == 1
assert response.status_code == 200
- def test_list_bare_metal_server_disks_all_params_with_retries(self):
- # Enable retries and run test_list_bare_metal_server_disks_all_params.
+ def test_get_placement_group_all_params_with_retries(self):
+ # Enable retries and run test_get_placement_group_all_params.
_service.enable_retries()
- self.test_list_bare_metal_server_disks_all_params()
+ self.test_get_placement_group_all_params()
- # Disable retries and run test_list_bare_metal_server_disks_all_params.
+ # Disable retries and run test_get_placement_group_all_params.
_service.disable_retries()
- self.test_list_bare_metal_server_disks_all_params()
+ self.test_get_placement_group_all_params()
@responses.activate
- def test_list_bare_metal_server_disks_value_error(self):
+ def test_get_placement_group_value_error(self):
"""
- test_list_bare_metal_server_disks_value_error()
+ test_get_placement_group_value_error()
"""
# Set up mock
- url = preprocess_url('/bare_metal_servers/testString/disks')
- mock_response = '{"disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "fcp", "name": "my-bare-metal-server-disk", "resource_type": "bare_metal_server_disk", "size": 100}]}'
+ 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,
@@ -20419,225 +21065,459 @@ def test_list_bare_metal_server_disks_value_error(self):
)
# 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.list_bare_metal_server_disks(**req_copy)
+ _service.get_placement_group(**req_copy)
- def test_list_bare_metal_server_disks_value_error_with_retries(self):
- # Enable retries and run test_list_bare_metal_server_disks_value_error.
+ def test_get_placement_group_value_error_with_retries(self):
+ # Enable retries and run test_get_placement_group_value_error.
_service.enable_retries()
- self.test_list_bare_metal_server_disks_value_error()
+ self.test_get_placement_group_value_error()
- # Disable retries and run test_list_bare_metal_server_disks_value_error.
+ # Disable retries and run test_get_placement_group_value_error.
_service.disable_retries()
- self.test_list_bare_metal_server_disks_value_error()
+ self.test_get_placement_group_value_error()
-class TestGetBareMetalServerDisk:
+class TestUpdatePlacementGroup:
"""
- Test Class for get_bare_metal_server_disk
+ Test Class for update_placement_group
"""
@responses.activate
- def test_get_bare_metal_server_disk_all_params(self):
+ def test_update_placement_group_all_params(self):
"""
- get_bare_metal_server_disk()
+ update_placement_group()
"""
# Set up mock
- url = preprocess_url('/bare_metal_servers/testString/disks/testString')
- mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "fcp", "name": "my-bare-metal-server-disk", "resource_type": "bare_metal_server_disk", "size": 100}'
+ 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,
+ responses.PATCH,
url,
body=mock_response,
content_type='application/json',
status=200,
)
+ # Construct a dict representation of a PlacementGroupPatch model
+ placement_group_patch_model = {}
+ placement_group_patch_model['name'] = 'my-placement-group'
+
# Set up parameter values
- bare_metal_server_id = 'testString'
id = 'testString'
+ placement_group_patch = placement_group_patch_model
# Invoke method
- response = _service.get_bare_metal_server_disk(
- bare_metal_server_id,
+ response = _service.update_placement_group(
id,
+ placement_group_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 == placement_group_patch
- def test_get_bare_metal_server_disk_all_params_with_retries(self):
- # Enable retries and run test_get_bare_metal_server_disk_all_params.
+ def test_update_placement_group_all_params_with_retries(self):
+ # Enable retries and run test_update_placement_group_all_params.
_service.enable_retries()
- self.test_get_bare_metal_server_disk_all_params()
+ self.test_update_placement_group_all_params()
- # Disable retries and run test_get_bare_metal_server_disk_all_params.
+ # Disable retries and run test_update_placement_group_all_params.
_service.disable_retries()
- self.test_get_bare_metal_server_disk_all_params()
+ self.test_update_placement_group_all_params()
@responses.activate
- def test_get_bare_metal_server_disk_value_error(self):
+ def test_update_placement_group_value_error(self):
"""
- test_get_bare_metal_server_disk_value_error()
+ test_update_placement_group_value_error()
"""
# Set up mock
- url = preprocess_url('/bare_metal_servers/testString/disks/testString')
- mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "fcp", "name": "my-bare-metal-server-disk", "resource_type": "bare_metal_server_disk", "size": 100}'
+ 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,
+ responses.PATCH,
url,
body=mock_response,
content_type='application/json',
status=200,
)
+ # Construct a dict representation of a PlacementGroupPatch model
+ placement_group_patch_model = {}
+ placement_group_patch_model['name'] = 'my-placement-group'
+
# Set up parameter values
- bare_metal_server_id = 'testString'
id = 'testString'
+ placement_group_patch = placement_group_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,
+ "placement_group_patch": placement_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.get_bare_metal_server_disk(**req_copy)
+ _service.update_placement_group(**req_copy)
- def test_get_bare_metal_server_disk_value_error_with_retries(self):
- # Enable retries and run test_get_bare_metal_server_disk_value_error.
+ def test_update_placement_group_value_error_with_retries(self):
+ # Enable retries and run test_update_placement_group_value_error.
_service.enable_retries()
- self.test_get_bare_metal_server_disk_value_error()
+ self.test_update_placement_group_value_error()
- # Disable retries and run test_get_bare_metal_server_disk_value_error.
+ # Disable retries and run test_update_placement_group_value_error.
_service.disable_retries()
- self.test_get_bare_metal_server_disk_value_error()
+ self.test_update_placement_group_value_error()
-class TestUpdateBareMetalServerDisk:
+# endregion
+##############################################################################
+# End of Service: PlacementGroups
+##############################################################################
+
+##############################################################################
+# Start of Service: BareMetalServers
+##############################################################################
+# region
+
+
+class TestNewInstance:
"""
- Test Class for update_bare_metal_server_disk
+ 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 TestListBareMetalServerProfiles:
+ """
+ Test Class for list_bare_metal_server_profiles
"""
@responses.activate
- def test_update_bare_metal_server_disk_all_params(self):
+ def test_list_bare_metal_server_profiles_all_params(self):
"""
- update_bare_metal_server_disk()
+ list_bare_metal_server_profiles()
"""
# Set up mock
- url = preprocess_url('/bare_metal_servers/testString/disks/testString')
- mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "fcp", "name": "my-bare-metal-server-disk", "resource_type": "bare_metal_server_disk", "size": 100}'
+ 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}, "console_types": {"type": "enum", "values": ["serial"]}, "cpu_architecture": {"default": "amd64", "type": "fixed", "value": "amd64"}, "cpu_core_count": {"type": "fixed", "value": 80}, "cpu_socket_count": {"type": "fixed", "value": 4}, "disks": [{"quantity": {"type": "fixed", "value": 4}, "size": {"type": "fixed", "value": 100}, "supported_interface_types": {"default": "fcp", "type": "enum", "values": ["fcp"]}}], "family": "balanced", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768", "memory": {"type": "fixed", "value": 16}, "name": "bx2-metal-192x768", "network_attachment_count": {"max": 128, "min": 1, "type": "range"}, "network_interface_count": {"max": 128, "min": 1, "type": "range"}, "os_architecture": {"default": "amd64", "type": "enum", "values": ["amd64"]}, "resource_type": "bare_metal_server_profile", "supported_trusted_platform_module_modes": {"type": "enum", "values": ["disabled"]}, "virtual_network_interfaces_supported": {"type": "fixed", "value": false}}], "total_count": 132}'
responses.add(
- responses.PATCH,
+ responses.GET,
url,
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
- bare_metal_server_id = 'testString'
- id = 'testString'
- bare_metal_server_disk_patch = bare_metal_server_disk_patch_model
+ start = 'testString'
+ limit = 50
# Invoke method
- response = _service.update_bare_metal_server_disk(
- bare_metal_server_id,
- id,
- bare_metal_server_disk_patch,
+ response = _service.list_bare_metal_server_profiles(
+ start=start,
+ limit=limit,
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_disk_patch
+ # 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_update_bare_metal_server_disk_all_params_with_retries(self):
- # Enable retries and run test_update_bare_metal_server_disk_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_update_bare_metal_server_disk_all_params()
+ self.test_list_bare_metal_server_profiles_all_params()
- # Disable retries and run test_update_bare_metal_server_disk_all_params.
+ # Disable retries and run test_list_bare_metal_server_profiles_all_params.
_service.disable_retries()
- self.test_update_bare_metal_server_disk_all_params()
+ self.test_list_bare_metal_server_profiles_all_params()
@responses.activate
- def test_update_bare_metal_server_disk_value_error(self):
+ def test_list_bare_metal_server_profiles_required_params(self):
"""
- test_update_bare_metal_server_disk_value_error()
+ test_list_bare_metal_server_profiles_required_params()
"""
# Set up mock
- url = preprocess_url('/bare_metal_servers/testString/disks/testString')
- mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "fcp", "name": "my-bare-metal-server-disk", "resource_type": "bare_metal_server_disk", "size": 100}'
+ 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}, "console_types": {"type": "enum", "values": ["serial"]}, "cpu_architecture": {"default": "amd64", "type": "fixed", "value": "amd64"}, "cpu_core_count": {"type": "fixed", "value": 80}, "cpu_socket_count": {"type": "fixed", "value": 4}, "disks": [{"quantity": {"type": "fixed", "value": 4}, "size": {"type": "fixed", "value": 100}, "supported_interface_types": {"default": "fcp", "type": "enum", "values": ["fcp"]}}], "family": "balanced", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768", "memory": {"type": "fixed", "value": 16}, "name": "bx2-metal-192x768", "network_attachment_count": {"max": 128, "min": 1, "type": "range"}, "network_interface_count": {"max": 128, "min": 1, "type": "range"}, "os_architecture": {"default": "amd64", "type": "enum", "values": ["amd64"]}, "resource_type": "bare_metal_server_profile", "supported_trusted_platform_module_modes": {"type": "enum", "values": ["disabled"]}, "virtual_network_interfaces_supported": {"type": "fixed", "value": false}}], "total_count": 132}'
responses.add(
- responses.PATCH,
+ responses.GET,
url,
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'
+ # Invoke method
+ response = _service.list_bare_metal_server_profiles()
+
+ # Check for correct operation
+ assert len(responses.calls) == 1
+ assert response.status_code == 200
+
+ 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_bare_metal_server_profiles_required_params()
+
+ # Disable retries and run test_list_bare_metal_server_profiles_required_params.
+ _service.disable_retries()
+ self.test_list_bare_metal_server_profiles_required_params()
+
+ @responses.activate
+ def test_list_bare_metal_server_profiles_value_error(self):
+ """
+ test_list_bare_metal_server_profiles_value_error()
+ """
+ # Set up mock
+ url = preprocess_url('/bare_metal_server/profiles')
+ mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "profiles": [{"bandwidth": {"type": "fixed", "value": 20000}, "console_types": {"type": "enum", "values": ["serial"]}, "cpu_architecture": {"default": "amd64", "type": "fixed", "value": "amd64"}, "cpu_core_count": {"type": "fixed", "value": 80}, "cpu_socket_count": {"type": "fixed", "value": 4}, "disks": [{"quantity": {"type": "fixed", "value": 4}, "size": {"type": "fixed", "value": 100}, "supported_interface_types": {"default": "fcp", "type": "enum", "values": ["fcp"]}}], "family": "balanced", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768", "memory": {"type": "fixed", "value": 16}, "name": "bx2-metal-192x768", "network_attachment_count": {"max": 128, "min": 1, "type": "range"}, "network_interface_count": {"max": 128, "min": 1, "type": "range"}, "os_architecture": {"default": "amd64", "type": "enum", "values": ["amd64"]}, "resource_type": "bare_metal_server_profile", "supported_trusted_platform_module_modes": {"type": "enum", "values": ["disabled"]}, "virtual_network_interfaces_supported": {"type": "fixed", "value": false}}], "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_bare_metal_server_profiles(**req_copy)
+
+ def test_list_bare_metal_server_profiles_value_error_with_retries(self):
+ # Enable retries and run test_list_bare_metal_server_profiles_value_error.
+ _service.enable_retries()
+ self.test_list_bare_metal_server_profiles_value_error()
+
+ # Disable retries and run test_list_bare_metal_server_profiles_value_error.
+ _service.disable_retries()
+ self.test_list_bare_metal_server_profiles_value_error()
+
+ @responses.activate
+ def test_list_bare_metal_server_profiles_with_pager_get_next(self):
+ """
+ test_list_bare_metal_server_profiles_with_pager_get_next()
+ """
+ # Set up a two-page mock response
+ url = preprocess_url('/bare_metal_server/profiles')
+ mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"profiles":[{"bandwidth":{"type":"fixed","value":20000},"console_types":{"type":"enum","values":["serial"]},"cpu_architecture":{"default":"amd64","type":"fixed","value":"amd64"},"cpu_core_count":{"type":"fixed","value":80},"cpu_socket_count":{"type":"fixed","value":4},"disks":[{"quantity":{"type":"fixed","value":4},"size":{"type":"fixed","value":100},"supported_interface_types":{"default":"fcp","type":"enum","values":["fcp"]}}],"family":"balanced","href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768","memory":{"type":"fixed","value":16},"name":"bx2-metal-192x768","network_attachment_count":{"max":128,"min":1,"type":"range"},"network_interface_count":{"max":128,"min":1,"type":"range"},"os_architecture":{"default":"amd64","type":"enum","values":["amd64"]},"resource_type":"bare_metal_server_profile","supported_trusted_platform_module_modes":{"type":"enum","values":["disabled"]},"virtual_network_interfaces_supported":{"type":"fixed","value":false}}]}'
+ mock_response2 = '{"total_count":2,"limit":1,"profiles":[{"bandwidth":{"type":"fixed","value":20000},"console_types":{"type":"enum","values":["serial"]},"cpu_architecture":{"default":"amd64","type":"fixed","value":"amd64"},"cpu_core_count":{"type":"fixed","value":80},"cpu_socket_count":{"type":"fixed","value":4},"disks":[{"quantity":{"type":"fixed","value":4},"size":{"type":"fixed","value":100},"supported_interface_types":{"default":"fcp","type":"enum","values":["fcp"]}}],"family":"balanced","href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768","memory":{"type":"fixed","value":16},"name":"bx2-metal-192x768","network_attachment_count":{"max":128,"min":1,"type":"range"},"network_interface_count":{"max":128,"min":1,"type":"range"},"os_architecture":{"default":"amd64","type":"enum","values":["amd64"]},"resource_type":"bare_metal_server_profile","supported_trusted_platform_module_modes":{"type":"enum","values":["disabled"]},"virtual_network_interfaces_supported":{"type":"fixed","value":false}}]}'
+ responses.add(
+ responses.GET,
+ url,
+ body=mock_response1,
+ content_type='application/json',
+ status=200,
+ )
+ responses.add(
+ responses.GET,
+ url,
+ body=mock_response2,
+ content_type='application/json',
+ status=200,
+ )
+
+ # Exercise the pager class for this operation
+ all_results = []
+ pager = BareMetalServerProfilesPager(
+ client=_service,
+ limit=10,
+ )
+ while pager.has_next():
+ next_page = pager.get_next()
+ assert next_page is not None
+ all_results.extend(next_page)
+ assert len(all_results) == 2
+
+ @responses.activate
+ def test_list_bare_metal_server_profiles_with_pager_get_all(self):
+ """
+ test_list_bare_metal_server_profiles_with_pager_get_all()
+ """
+ # Set up a two-page mock response
+ url = preprocess_url('/bare_metal_server/profiles')
+ mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"profiles":[{"bandwidth":{"type":"fixed","value":20000},"console_types":{"type":"enum","values":["serial"]},"cpu_architecture":{"default":"amd64","type":"fixed","value":"amd64"},"cpu_core_count":{"type":"fixed","value":80},"cpu_socket_count":{"type":"fixed","value":4},"disks":[{"quantity":{"type":"fixed","value":4},"size":{"type":"fixed","value":100},"supported_interface_types":{"default":"fcp","type":"enum","values":["fcp"]}}],"family":"balanced","href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768","memory":{"type":"fixed","value":16},"name":"bx2-metal-192x768","network_attachment_count":{"max":128,"min":1,"type":"range"},"network_interface_count":{"max":128,"min":1,"type":"range"},"os_architecture":{"default":"amd64","type":"enum","values":["amd64"]},"resource_type":"bare_metal_server_profile","supported_trusted_platform_module_modes":{"type":"enum","values":["disabled"]},"virtual_network_interfaces_supported":{"type":"fixed","value":false}}]}'
+ mock_response2 = '{"total_count":2,"limit":1,"profiles":[{"bandwidth":{"type":"fixed","value":20000},"console_types":{"type":"enum","values":["serial"]},"cpu_architecture":{"default":"amd64","type":"fixed","value":"amd64"},"cpu_core_count":{"type":"fixed","value":80},"cpu_socket_count":{"type":"fixed","value":4},"disks":[{"quantity":{"type":"fixed","value":4},"size":{"type":"fixed","value":100},"supported_interface_types":{"default":"fcp","type":"enum","values":["fcp"]}}],"family":"balanced","href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768","memory":{"type":"fixed","value":16},"name":"bx2-metal-192x768","network_attachment_count":{"max":128,"min":1,"type":"range"},"network_interface_count":{"max":128,"min":1,"type":"range"},"os_architecture":{"default":"amd64","type":"enum","values":["amd64"]},"resource_type":"bare_metal_server_profile","supported_trusted_platform_module_modes":{"type":"enum","values":["disabled"]},"virtual_network_interfaces_supported":{"type":"fixed","value":false}}]}'
+ responses.add(
+ responses.GET,
+ url,
+ body=mock_response1,
+ content_type='application/json',
+ status=200,
+ )
+ responses.add(
+ responses.GET,
+ url,
+ body=mock_response2,
+ content_type='application/json',
+ status=200,
+ )
+
+ # Exercise the pager class for this operation
+ pager = BareMetalServerProfilesPager(
+ client=_service,
+ limit=10,
+ )
+ all_results = pager.get_all()
+ assert all_results is not None
+ assert len(all_results) == 2
+
+
+class TestGetBareMetalServerProfile:
+ """
+ Test Class for get_bare_metal_server_profile
+ """
+
+ @responses.activate
+ def test_get_bare_metal_server_profile_all_params(self):
+ """
+ get_bare_metal_server_profile()
+ """
+ # Set up mock
+ url = preprocess_url('/bare_metal_server/profiles/testString')
+ mock_response = '{"bandwidth": {"type": "fixed", "value": 20000}, "console_types": {"type": "enum", "values": ["serial"]}, "cpu_architecture": {"default": "amd64", "type": "fixed", "value": "amd64"}, "cpu_core_count": {"type": "fixed", "value": 80}, "cpu_socket_count": {"type": "fixed", "value": 4}, "disks": [{"quantity": {"type": "fixed", "value": 4}, "size": {"type": "fixed", "value": 100}, "supported_interface_types": {"default": "fcp", "type": "enum", "values": ["fcp"]}}], "family": "balanced", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768", "memory": {"type": "fixed", "value": 16}, "name": "bx2-metal-192x768", "network_attachment_count": {"max": 128, "min": 1, "type": "range"}, "network_interface_count": {"max": 128, "min": 1, "type": "range"}, "os_architecture": {"default": "amd64", "type": "enum", "values": ["amd64"]}, "resource_type": "bare_metal_server_profile", "supported_trusted_platform_module_modes": {"type": "enum", "values": ["disabled"]}, "virtual_network_interfaces_supported": {"type": "fixed", "value": false}}'
+ responses.add(
+ responses.GET,
+ url,
+ body=mock_response,
+ content_type='application/json',
+ status=200,
+ )
# Set up parameter values
- bare_metal_server_id = 'testString'
- id = 'testString'
- bare_metal_server_disk_patch = bare_metal_server_disk_patch_model
+ name = 'testString'
+
+ # Invoke method
+ response = _service.get_bare_metal_server_profile(
+ name,
+ headers={},
+ )
+
+ # Check for correct operation
+ assert len(responses.calls) == 1
+ assert response.status_code == 200
+
+ 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_bare_metal_server_profile_all_params()
+
+ # Disable retries and run test_get_bare_metal_server_profile_all_params.
+ _service.disable_retries()
+ self.test_get_bare_metal_server_profile_all_params()
+
+ @responses.activate
+ def test_get_bare_metal_server_profile_value_error(self):
+ """
+ test_get_bare_metal_server_profile_value_error()
+ """
+ # Set up mock
+ url = preprocess_url('/bare_metal_server/profiles/testString')
+ mock_response = '{"bandwidth": {"type": "fixed", "value": 20000}, "console_types": {"type": "enum", "values": ["serial"]}, "cpu_architecture": {"default": "amd64", "type": "fixed", "value": "amd64"}, "cpu_core_count": {"type": "fixed", "value": 80}, "cpu_socket_count": {"type": "fixed", "value": 4}, "disks": [{"quantity": {"type": "fixed", "value": 4}, "size": {"type": "fixed", "value": 100}, "supported_interface_types": {"default": "fcp", "type": "enum", "values": ["fcp"]}}], "family": "balanced", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768", "memory": {"type": "fixed", "value": 16}, "name": "bx2-metal-192x768", "network_attachment_count": {"max": 128, "min": 1, "type": "range"}, "network_interface_count": {"max": 128, "min": 1, "type": "range"}, "os_architecture": {"default": "amd64", "type": "enum", "values": ["amd64"]}, "resource_type": "bare_metal_server_profile", "supported_trusted_platform_module_modes": {"type": "enum", "values": ["disabled"]}, "virtual_network_interfaces_supported": {"type": "fixed", "value": false}}'
+ responses.add(
+ responses.GET,
+ url,
+ body=mock_response,
+ content_type='application/json',
+ status=200,
+ )
+
+ # Set up parameter values
+ name = 'testString'
# Pass in all but one required param and check for a ValueError
req_param_dict = {
- "bare_metal_server_id": bare_metal_server_id,
- "id": id,
- "bare_metal_server_disk_patch": bare_metal_server_disk_patch,
+ "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_bare_metal_server_disk(**req_copy)
+ _service.get_bare_metal_server_profile(**req_copy)
- def test_update_bare_metal_server_disk_value_error_with_retries(self):
- # Enable retries and run test_update_bare_metal_server_disk_value_error.
+ 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_update_bare_metal_server_disk_value_error()
+ self.test_get_bare_metal_server_profile_value_error()
- # Disable retries and run test_update_bare_metal_server_disk_value_error.
+ # Disable retries and run test_get_bare_metal_server_profile_value_error.
_service.disable_retries()
- self.test_update_bare_metal_server_disk_value_error()
+ self.test_get_bare_metal_server_profile_value_error()
-class TestListBareMetalServerNetworkInterfaces:
+class TestListBareMetalServers:
"""
- Test Class for list_bare_metal_server_network_interfaces
+ Test Class for list_bare_metal_servers
"""
@responses.activate
- def test_list_bare_metal_server_network_interfaces_all_params(self):
+ def test_list_bare_metal_servers_all_params(self):
"""
- list_bare_metal_server_network_interfaces()
+ list_bare_metal_servers()
"""
# Set up mock
- url = preprocess_url('/bare_metal_servers/testString/network_interfaces')
- mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/3b2669a2-4c2b-4003-bc91-1b81f1326267/network_interfaces?limit=20"}, "limit": 20, "network_interfaces": [{"allow_ip_spoofing": true, "created_at": "2019-01-01T12:00:00.000Z", "enable_infrastructure_nat": true, "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}], "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "mac_address": "02:00:04:00:C4:6A", "name": "my-bare-metal-server-network-interface", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary", "interface_type": "hipersocket"}], "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/3b2669a2-4c2b-4003-bc91-1b81f1326267/network_interfaces?start=d3e721fd-c988-4670-9927-dbd5e7b07fc6&limit=20"}, "total_count": 132}'
+ url = preprocess_url('/bare_metal_servers')
+ mock_response = '{"bare_metal_servers": [{"bandwidth": 20000, "boot_target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-bare-metal-server-disk", "resource_type": "bare_metal_server_disk"}, "cpu": {"architecture": "amd64", "core_count": 80, "socket_count": 4, "threads_per_core": 2}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::bare-metal-server:1e09281b-f177-46fb-baf1-bc152b2e391a", "disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "fcp", "name": "my-bare-metal-server-disk", "resource_type": "bare_metal_server_disk", "size": 100}], "enable_secure_boot": false, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "memory": 1536, "name": "my-bare-metal-server", "network_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/2302-f7a2bf57-af7c-49d9-b599-b2c91293d30c/network_attachments/2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "name": "my-bare-metal-server-network-attachment", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "bare_metal_server_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}], "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-bare-metal-server-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}], "primary_network_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/2302-f7a2bf57-af7c-49d9-b599-b2c91293d30c/network_attachments/2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "name": "my-bare-metal-server-network-attachment", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "bare_metal_server_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}, "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-bare-metal-server-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768", "name": "bx2-metal-192x768", "resource_type": "bare_metal_server_profile"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "bare_metal_server", "status": "deleting", "status_reasons": [{"code": "cannot_start_capacity", "message": "The bare metal server cannot start as there is no more capacity in this\nzone for a bare metal server with the requested profile.", "more_info": "https://console.bluemix.net/docs/iaas/bare_metal_server.html"}], "trusted_platform_module": {"enabled": true, "mode": "disabled", "supported_modes": ["disabled"]}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}'
responses.add(
responses.GET,
url,
@@ -20647,15 +21527,23 @@ def test_list_bare_metal_server_network_interfaces_all_params(self):
)
# Set up parameter values
- bare_metal_server_id = 'testString'
start = 'testString'
limit = 50
+ resource_group_id = 'testString'
+ name = 'testString'
+ vpc_id = 'testString'
+ vpc_crn = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b'
+ vpc_name = 'my-vpc'
# Invoke method
- response = _service.list_bare_metal_server_network_interfaces(
- bare_metal_server_id,
+ response = _service.list_bare_metal_servers(
start=start,
limit=limit,
+ resource_group_id=resource_group_id,
+ name=name,
+ vpc_id=vpc_id,
+ vpc_crn=vpc_crn,
+ vpc_name=vpc_name,
headers={},
)
@@ -20667,24 +21555,29 @@ def test_list_bare_metal_server_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
+ 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
- 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.
+ 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_bare_metal_server_network_interfaces_all_params()
+ self.test_list_bare_metal_servers_all_params()
- # Disable retries and run test_list_bare_metal_server_network_interfaces_all_params.
+ # Disable retries and run test_list_bare_metal_servers_all_params.
_service.disable_retries()
- self.test_list_bare_metal_server_network_interfaces_all_params()
+ self.test_list_bare_metal_servers_all_params()
@responses.activate
- def test_list_bare_metal_server_network_interfaces_required_params(self):
+ def test_list_bare_metal_servers_required_params(self):
"""
- test_list_bare_metal_server_network_interfaces_required_params()
+ test_list_bare_metal_servers_required_params()
"""
# Set up mock
- url = preprocess_url('/bare_metal_servers/testString/network_interfaces')
- mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/3b2669a2-4c2b-4003-bc91-1b81f1326267/network_interfaces?limit=20"}, "limit": 20, "network_interfaces": [{"allow_ip_spoofing": true, "created_at": "2019-01-01T12:00:00.000Z", "enable_infrastructure_nat": true, "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}], "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "mac_address": "02:00:04:00:C4:6A", "name": "my-bare-metal-server-network-interface", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary", "interface_type": "hipersocket"}], "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/3b2669a2-4c2b-4003-bc91-1b81f1326267/network_interfaces?start=d3e721fd-c988-4670-9927-dbd5e7b07fc6&limit=20"}, "total_count": 132}'
+ url = preprocess_url('/bare_metal_servers')
+ mock_response = '{"bare_metal_servers": [{"bandwidth": 20000, "boot_target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-bare-metal-server-disk", "resource_type": "bare_metal_server_disk"}, "cpu": {"architecture": "amd64", "core_count": 80, "socket_count": 4, "threads_per_core": 2}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::bare-metal-server:1e09281b-f177-46fb-baf1-bc152b2e391a", "disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "fcp", "name": "my-bare-metal-server-disk", "resource_type": "bare_metal_server_disk", "size": 100}], "enable_secure_boot": false, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "memory": 1536, "name": "my-bare-metal-server", "network_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/2302-f7a2bf57-af7c-49d9-b599-b2c91293d30c/network_attachments/2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "name": "my-bare-metal-server-network-attachment", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "bare_metal_server_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}], "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-bare-metal-server-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}], "primary_network_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/2302-f7a2bf57-af7c-49d9-b599-b2c91293d30c/network_attachments/2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "name": "my-bare-metal-server-network-attachment", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "bare_metal_server_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}, "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-bare-metal-server-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768", "name": "bx2-metal-192x768", "resource_type": "bare_metal_server_profile"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "bare_metal_server", "status": "deleting", "status_reasons": [{"code": "cannot_start_capacity", "message": "The bare metal server cannot start as there is no more capacity in this\nzone for a bare metal server with the requested profile.", "more_info": "https://console.bluemix.net/docs/iaas/bare_metal_server.html"}], "trusted_platform_module": {"enabled": true, "mode": "disabled", "supported_modes": ["disabled"]}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}'
responses.add(
responses.GET,
url,
@@ -20693,36 +21586,30 @@ def test_list_bare_metal_server_network_interfaces_required_params(self):
status=200,
)
- # Set up parameter values
- bare_metal_server_id = 'testString'
-
# Invoke method
- response = _service.list_bare_metal_server_network_interfaces(
- bare_metal_server_id,
- headers={},
- )
+ response = _service.list_bare_metal_servers()
# Check for correct operation
assert len(responses.calls) == 1
assert response.status_code == 200
- 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.
+ 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_bare_metal_server_network_interfaces_required_params()
+ self.test_list_bare_metal_servers_required_params()
- # Disable retries and run test_list_bare_metal_server_network_interfaces_required_params.
+ # Disable retries and run test_list_bare_metal_servers_required_params.
_service.disable_retries()
- self.test_list_bare_metal_server_network_interfaces_required_params()
+ self.test_list_bare_metal_servers_required_params()
@responses.activate
- def test_list_bare_metal_server_network_interfaces_value_error(self):
+ def test_list_bare_metal_servers_value_error(self):
"""
- test_list_bare_metal_server_network_interfaces_value_error()
+ test_list_bare_metal_servers_value_error()
"""
# Set up mock
- url = preprocess_url('/bare_metal_servers/testString/network_interfaces')
- mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/3b2669a2-4c2b-4003-bc91-1b81f1326267/network_interfaces?limit=20"}, "limit": 20, "network_interfaces": [{"allow_ip_spoofing": true, "created_at": "2019-01-01T12:00:00.000Z", "enable_infrastructure_nat": true, "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}], "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "mac_address": "02:00:04:00:C4:6A", "name": "my-bare-metal-server-network-interface", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary", "interface_type": "hipersocket"}], "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/3b2669a2-4c2b-4003-bc91-1b81f1326267/network_interfaces?start=d3e721fd-c988-4670-9927-dbd5e7b07fc6&limit=20"}, "total_count": 132}'
+ url = preprocess_url('/bare_metal_servers')
+ mock_response = '{"bare_metal_servers": [{"bandwidth": 20000, "boot_target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-bare-metal-server-disk", "resource_type": "bare_metal_server_disk"}, "cpu": {"architecture": "amd64", "core_count": 80, "socket_count": 4, "threads_per_core": 2}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::bare-metal-server:1e09281b-f177-46fb-baf1-bc152b2e391a", "disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "fcp", "name": "my-bare-metal-server-disk", "resource_type": "bare_metal_server_disk", "size": 100}], "enable_secure_boot": false, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "memory": 1536, "name": "my-bare-metal-server", "network_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/2302-f7a2bf57-af7c-49d9-b599-b2c91293d30c/network_attachments/2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "name": "my-bare-metal-server-network-attachment", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "bare_metal_server_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}], "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-bare-metal-server-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}], "primary_network_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/2302-f7a2bf57-af7c-49d9-b599-b2c91293d30c/network_attachments/2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "name": "my-bare-metal-server-network-attachment", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "bare_metal_server_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}, "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-bare-metal-server-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768", "name": "bx2-metal-192x768", "resource_type": "bare_metal_server_profile"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "bare_metal_server", "status": "deleting", "status_reasons": [{"code": "cannot_start_capacity", "message": "The bare metal server cannot start as there is no more capacity in this\nzone for a bare metal server with the requested profile.", "more_info": "https://console.bluemix.net/docs/iaas/bare_metal_server.html"}], "trusted_platform_module": {"enabled": true, "mode": "disabled", "supported_modes": ["disabled"]}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}'
responses.add(
responses.GET,
url,
@@ -20731,36 +21618,32 @@ def test_list_bare_metal_server_network_interfaces_value_error(self):
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_bare_metal_server_network_interfaces(**req_copy)
+ _service.list_bare_metal_servers(**req_copy)
- def test_list_bare_metal_server_network_interfaces_value_error_with_retries(self):
- # Enable retries and run test_list_bare_metal_server_network_interfaces_value_error.
+ 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_bare_metal_server_network_interfaces_value_error()
+ self.test_list_bare_metal_servers_value_error()
- # Disable retries and run test_list_bare_metal_server_network_interfaces_value_error.
+ # Disable retries and run test_list_bare_metal_servers_value_error.
_service.disable_retries()
- self.test_list_bare_metal_server_network_interfaces_value_error()
+ self.test_list_bare_metal_servers_value_error()
@responses.activate
- def test_list_bare_metal_server_network_interfaces_with_pager_get_next(self):
+ def test_list_bare_metal_servers_with_pager_get_next(self):
"""
- test_list_bare_metal_server_network_interfaces_with_pager_get_next()
+ test_list_bare_metal_servers_with_pager_get_next()
"""
# Set up a two-page mock response
- url = preprocess_url('/bare_metal_servers/testString/network_interfaces')
- mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"network_interfaces":[{"allow_ip_spoofing":true,"created_at":"2019-01-01T12:00:00.000Z","enable_infrastructure_nat":true,"floating_ips":[{"address":"203.0.113.1","crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689","id":"39300233-9995-4806-89a5-3c1b6eb88689","name":"my-floating-ip"}],"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","mac_address":"02:00:04:00:C4:6A","name":"my-bare-metal-server-network-interface","port_speed":1000,"primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"network_interface","security_groups":[{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271","id":"be5df5ca-12a0-494b-907e-aa6ec2bfa271","name":"my-security-group"}],"status":"available","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"},"type":"primary","interface_type":"hipersocket"}]}'
- mock_response2 = '{"total_count":2,"limit":1,"network_interfaces":[{"allow_ip_spoofing":true,"created_at":"2019-01-01T12:00:00.000Z","enable_infrastructure_nat":true,"floating_ips":[{"address":"203.0.113.1","crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689","id":"39300233-9995-4806-89a5-3c1b6eb88689","name":"my-floating-ip"}],"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","mac_address":"02:00:04:00:C4:6A","name":"my-bare-metal-server-network-interface","port_speed":1000,"primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"network_interface","security_groups":[{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271","id":"be5df5ca-12a0-494b-907e-aa6ec2bfa271","name":"my-security-group"}],"status":"available","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"},"type":"primary","interface_type":"hipersocket"}]}'
+ url = preprocess_url('/bare_metal_servers')
+ mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"bare_metal_servers":[{"bandwidth":20000,"boot_target":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-bare-metal-server-disk","resource_type":"bare_metal_server_disk"},"cpu":{"architecture":"amd64","core_count":80,"socket_count":4,"threads_per_core":2},"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::bare-metal-server:1e09281b-f177-46fb-baf1-bc152b2e391a","disks":[{"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","interface_type":"fcp","name":"my-bare-metal-server-disk","resource_type":"bare_metal_server_disk","size":100}],"enable_secure_boot":false,"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a","id":"1e09281b-f177-46fb-baf1-bc152b2e391a","lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","memory":1536,"name":"my-bare-metal-server","network_attachments":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/2302-f7a2bf57-af7c-49d9-b599-b2c91293d30c/network_attachments/2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6","id":"2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6","name":"my-bare-metal-server-network-attachment","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"bare_metal_server_network_attachment","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}}],"network_interfaces":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-bare-metal-server-network-interface","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"network_interface","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}}],"primary_network_attachment":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/2302-f7a2bf57-af7c-49d9-b599-b2c91293d30c/network_attachments/2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6","id":"2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6","name":"my-bare-metal-server-network-attachment","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"bare_metal_server_network_attachment","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}},"primary_network_interface":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-bare-metal-server-network-interface","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"network_interface","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}},"profile":{"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768","name":"bx2-metal-192x768","resource_type":"bare_metal_server_profile"},"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"bare_metal_server","status":"deleting","status_reasons":[{"code":"cannot_start_capacity","message":"The bare metal server cannot start as there is no more capacity in this\\nzone for a bare metal server with the requested profile.","more_info":"https://console.bluemix.net/docs/iaas/bare_metal_server.html"}],"trusted_platform_module":{"enabled":true,"mode":"disabled","supported_modes":["disabled"]},"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}]}'
+ mock_response2 = '{"total_count":2,"limit":1,"bare_metal_servers":[{"bandwidth":20000,"boot_target":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-bare-metal-server-disk","resource_type":"bare_metal_server_disk"},"cpu":{"architecture":"amd64","core_count":80,"socket_count":4,"threads_per_core":2},"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::bare-metal-server:1e09281b-f177-46fb-baf1-bc152b2e391a","disks":[{"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","interface_type":"fcp","name":"my-bare-metal-server-disk","resource_type":"bare_metal_server_disk","size":100}],"enable_secure_boot":false,"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a","id":"1e09281b-f177-46fb-baf1-bc152b2e391a","lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","memory":1536,"name":"my-bare-metal-server","network_attachments":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/2302-f7a2bf57-af7c-49d9-b599-b2c91293d30c/network_attachments/2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6","id":"2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6","name":"my-bare-metal-server-network-attachment","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"bare_metal_server_network_attachment","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}}],"network_interfaces":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-bare-metal-server-network-interface","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"network_interface","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}}],"primary_network_attachment":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/2302-f7a2bf57-af7c-49d9-b599-b2c91293d30c/network_attachments/2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6","id":"2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6","name":"my-bare-metal-server-network-attachment","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"bare_metal_server_network_attachment","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}},"primary_network_interface":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-bare-metal-server-network-interface","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"network_interface","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}},"profile":{"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768","name":"bx2-metal-192x768","resource_type":"bare_metal_server_profile"},"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"bare_metal_server","status":"deleting","status_reasons":[{"code":"cannot_start_capacity","message":"The bare metal server cannot start as there is no more capacity in this\\nzone for a bare metal server with the requested profile.","more_info":"https://console.bluemix.net/docs/iaas/bare_metal_server.html"}],"trusted_platform_module":{"enabled":true,"mode":"disabled","supported_modes":["disabled"]},"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}]}'
responses.add(
responses.GET,
url,
@@ -20778,10 +21661,14 @@ def test_list_bare_metal_server_network_interfaces_with_pager_get_next(self):
# Exercise the pager class for this operation
all_results = []
- pager = BareMetalServerNetworkInterfacesPager(
+ pager = BareMetalServersPager(
client=_service,
- bare_metal_server_id='testString',
limit=10,
+ resource_group_id='testString',
+ name='testString',
+ vpc_id='testString',
+ vpc_crn='crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b',
+ vpc_name='my-vpc',
)
while pager.has_next():
next_page = pager.get_next()
@@ -20790,14 +21677,14 @@ def test_list_bare_metal_server_network_interfaces_with_pager_get_next(self):
assert len(all_results) == 2
@responses.activate
- def test_list_bare_metal_server_network_interfaces_with_pager_get_all(self):
+ def test_list_bare_metal_servers_with_pager_get_all(self):
"""
- test_list_bare_metal_server_network_interfaces_with_pager_get_all()
+ test_list_bare_metal_servers_with_pager_get_all()
"""
# Set up a two-page mock response
- url = preprocess_url('/bare_metal_servers/testString/network_interfaces')
- mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"network_interfaces":[{"allow_ip_spoofing":true,"created_at":"2019-01-01T12:00:00.000Z","enable_infrastructure_nat":true,"floating_ips":[{"address":"203.0.113.1","crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689","id":"39300233-9995-4806-89a5-3c1b6eb88689","name":"my-floating-ip"}],"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","mac_address":"02:00:04:00:C4:6A","name":"my-bare-metal-server-network-interface","port_speed":1000,"primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"network_interface","security_groups":[{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271","id":"be5df5ca-12a0-494b-907e-aa6ec2bfa271","name":"my-security-group"}],"status":"available","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"},"type":"primary","interface_type":"hipersocket"}]}'
- mock_response2 = '{"total_count":2,"limit":1,"network_interfaces":[{"allow_ip_spoofing":true,"created_at":"2019-01-01T12:00:00.000Z","enable_infrastructure_nat":true,"floating_ips":[{"address":"203.0.113.1","crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689","id":"39300233-9995-4806-89a5-3c1b6eb88689","name":"my-floating-ip"}],"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","mac_address":"02:00:04:00:C4:6A","name":"my-bare-metal-server-network-interface","port_speed":1000,"primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"network_interface","security_groups":[{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271","id":"be5df5ca-12a0-494b-907e-aa6ec2bfa271","name":"my-security-group"}],"status":"available","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"},"type":"primary","interface_type":"hipersocket"}]}'
+ url = preprocess_url('/bare_metal_servers')
+ mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"bare_metal_servers":[{"bandwidth":20000,"boot_target":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-bare-metal-server-disk","resource_type":"bare_metal_server_disk"},"cpu":{"architecture":"amd64","core_count":80,"socket_count":4,"threads_per_core":2},"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::bare-metal-server:1e09281b-f177-46fb-baf1-bc152b2e391a","disks":[{"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","interface_type":"fcp","name":"my-bare-metal-server-disk","resource_type":"bare_metal_server_disk","size":100}],"enable_secure_boot":false,"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a","id":"1e09281b-f177-46fb-baf1-bc152b2e391a","lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","memory":1536,"name":"my-bare-metal-server","network_attachments":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/2302-f7a2bf57-af7c-49d9-b599-b2c91293d30c/network_attachments/2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6","id":"2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6","name":"my-bare-metal-server-network-attachment","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"bare_metal_server_network_attachment","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}}],"network_interfaces":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-bare-metal-server-network-interface","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"network_interface","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}}],"primary_network_attachment":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/2302-f7a2bf57-af7c-49d9-b599-b2c91293d30c/network_attachments/2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6","id":"2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6","name":"my-bare-metal-server-network-attachment","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"bare_metal_server_network_attachment","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}},"primary_network_interface":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-bare-metal-server-network-interface","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"network_interface","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}},"profile":{"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768","name":"bx2-metal-192x768","resource_type":"bare_metal_server_profile"},"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"bare_metal_server","status":"deleting","status_reasons":[{"code":"cannot_start_capacity","message":"The bare metal server cannot start as there is no more capacity in this\\nzone for a bare metal server with the requested profile.","more_info":"https://console.bluemix.net/docs/iaas/bare_metal_server.html"}],"trusted_platform_module":{"enabled":true,"mode":"disabled","supported_modes":["disabled"]},"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}]}'
+ mock_response2 = '{"total_count":2,"limit":1,"bare_metal_servers":[{"bandwidth":20000,"boot_target":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-bare-metal-server-disk","resource_type":"bare_metal_server_disk"},"cpu":{"architecture":"amd64","core_count":80,"socket_count":4,"threads_per_core":2},"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::bare-metal-server:1e09281b-f177-46fb-baf1-bc152b2e391a","disks":[{"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","interface_type":"fcp","name":"my-bare-metal-server-disk","resource_type":"bare_metal_server_disk","size":100}],"enable_secure_boot":false,"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a","id":"1e09281b-f177-46fb-baf1-bc152b2e391a","lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","memory":1536,"name":"my-bare-metal-server","network_attachments":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/2302-f7a2bf57-af7c-49d9-b599-b2c91293d30c/network_attachments/2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6","id":"2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6","name":"my-bare-metal-server-network-attachment","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"bare_metal_server_network_attachment","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}}],"network_interfaces":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-bare-metal-server-network-interface","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"network_interface","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}}],"primary_network_attachment":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/2302-f7a2bf57-af7c-49d9-b599-b2c91293d30c/network_attachments/2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6","id":"2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6","name":"my-bare-metal-server-network-attachment","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"bare_metal_server_network_attachment","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}},"primary_network_interface":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-bare-metal-server-network-interface","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"network_interface","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}},"profile":{"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768","name":"bx2-metal-192x768","resource_type":"bare_metal_server_profile"},"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"bare_metal_server","status":"deleting","status_reasons":[{"code":"cannot_start_capacity","message":"The bare metal server cannot start as there is no more capacity in this\\nzone for a bare metal server with the requested profile.","more_info":"https://console.bluemix.net/docs/iaas/bare_metal_server.html"}],"trusted_platform_module":{"enabled":true,"mode":"disabled","supported_modes":["disabled"]},"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}]}'
responses.add(
responses.GET,
url,
@@ -20814,29 +21701,33 @@ def test_list_bare_metal_server_network_interfaces_with_pager_get_all(self):
)
# Exercise the pager class for this operation
- pager = BareMetalServerNetworkInterfacesPager(
+ pager = BareMetalServersPager(
client=_service,
- bare_metal_server_id='testString',
limit=10,
+ resource_group_id='testString',
+ name='testString',
+ vpc_id='testString',
+ vpc_crn='crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b',
+ vpc_name='my-vpc',
)
all_results = pager.get_all()
assert all_results is not None
assert len(all_results) == 2
-class TestCreateBareMetalServerNetworkInterface:
+class TestCreateBareMetalServer:
"""
- Test Class for create_bare_metal_server_network_interface
+ Test Class for create_bare_metal_server
"""
@responses.activate
- def test_create_bare_metal_server_network_interface_all_params(self):
+ def test_create_bare_metal_server_all_params(self):
"""
- create_bare_metal_server_network_interface()
+ create_bare_metal_server()
"""
# Set up mock
- url = preprocess_url('/bare_metal_servers/testString/network_interfaces')
- mock_response = '{"allow_ip_spoofing": true, "created_at": "2019-01-01T12:00:00.000Z", "enable_infrastructure_nat": true, "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}], "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "mac_address": "02:00:04:00:C4:6A", "name": "my-bare-metal-server-network-interface", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary", "interface_type": "hipersocket"}'
+ url = preprocess_url('/bare_metal_servers')
+ mock_response = '{"bandwidth": 20000, "boot_target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-bare-metal-server-disk", "resource_type": "bare_metal_server_disk"}, "cpu": {"architecture": "amd64", "core_count": 80, "socket_count": 4, "threads_per_core": 2}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::bare-metal-server:1e09281b-f177-46fb-baf1-bc152b2e391a", "disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "fcp", "name": "my-bare-metal-server-disk", "resource_type": "bare_metal_server_disk", "size": 100}], "enable_secure_boot": false, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "memory": 1536, "name": "my-bare-metal-server", "network_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/2302-f7a2bf57-af7c-49d9-b599-b2c91293d30c/network_attachments/2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "name": "my-bare-metal-server-network-attachment", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "bare_metal_server_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}], "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-bare-metal-server-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}], "primary_network_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/2302-f7a2bf57-af7c-49d9-b599-b2c91293d30c/network_attachments/2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "name": "my-bare-metal-server-network-attachment", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "bare_metal_server_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}, "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-bare-metal-server-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768", "name": "bx2-metal-192x768", "resource_type": "bare_metal_server_profile"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "bare_metal_server", "status": "deleting", "status_reasons": [{"code": "cannot_start_capacity", "message": "The bare metal server cannot start as there is no more capacity in this\nzone for a bare metal server with the requested profile.", "more_info": "https://console.bluemix.net/docs/iaas/bare_metal_server.html"}], "trusted_platform_module": {"enabled": true, "mode": "disabled", "supported_modes": ["disabled"]}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
responses.add(
responses.POST,
url,
@@ -20845,11 +21736,51 @@ def test_create_bare_metal_server_network_interface_all_params(self):
status=201,
)
- # Construct a dict representation of a NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext model
- network_interface_ip_prototype_model = {}
- network_interface_ip_prototype_model['address'] = '10.0.0.5'
- network_interface_ip_prototype_model['auto_delete'] = False
- network_interface_ip_prototype_model['name'] = 'my-reserved-ip'
+ # Construct a dict representation of a ImageIdentityById model
+ image_identity_model = {}
+ image_identity_model['id'] = '72b27b5c-f4b0-48bb-b954-5becc7c1dcb8'
+
+ # 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 BareMetalServerProfileIdentityByName model
+ bare_metal_server_profile_identity_model = {}
+ bare_metal_server_profile_identity_model['name'] = 'bx2-metal-192x768'
+
+ # Construct a dict representation of a ResourceGroupIdentityById model
+ resource_group_identity_model = {}
+ resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
+
+ # Construct a dict representation of a BareMetalServerTrustedPlatformModulePrototype model
+ bare_metal_server_trusted_platform_module_prototype_model = {}
+ bare_metal_server_trusted_platform_module_prototype_model['mode'] = 'disabled'
+
+ # 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 VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext model
+ virtual_network_interface_ip_prototype_model = {}
+ virtual_network_interface_ip_prototype_model['address'] = '10.0.0.5'
+ virtual_network_interface_ip_prototype_model['auto_delete'] = False
+ virtual_network_interface_ip_prototype_model['name'] = 'my-reserved-ip'
+
+ # Construct a dict representation of a VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext model
+ virtual_network_interface_primary_ip_prototype_model = {}
+ virtual_network_interface_primary_ip_prototype_model['address'] = '10.0.0.5'
+ virtual_network_interface_primary_ip_prototype_model['auto_delete'] = False
+ virtual_network_interface_primary_ip_prototype_model['name'] = 'my-reserved-ip'
# Construct a dict representation of a SecurityGroupIdentityById model
security_group_identity_model = {}
@@ -20859,24 +21790,51 @@ def test_create_bare_metal_server_network_interface_all_params(self):
subnet_identity_model = {}
subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
- # Construct a dict representation of a BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype model
- bare_metal_server_network_interface_prototype_model = {}
- bare_metal_server_network_interface_prototype_model['allow_ip_spoofing'] = True
- bare_metal_server_network_interface_prototype_model['enable_infrastructure_nat'] = True
- bare_metal_server_network_interface_prototype_model['name'] = 'my-bare-metal-server-network-interface'
- bare_metal_server_network_interface_prototype_model['primary_ip'] = network_interface_ip_prototype_model
- bare_metal_server_network_interface_prototype_model['security_groups'] = [security_group_identity_model]
- bare_metal_server_network_interface_prototype_model['subnet'] = subnet_identity_model
- bare_metal_server_network_interface_prototype_model['interface_type'] = 'hipersocket'
-
- # Set up parameter values
- bare_metal_server_id = 'testString'
- bare_metal_server_network_interface_prototype = bare_metal_server_network_interface_prototype_model
+ # Construct a dict representation of a BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeBareMetalServerNetworkAttachmentContext model
+ bare_metal_server_network_attachment_prototype_virtual_network_interface_model = {}
+ bare_metal_server_network_attachment_prototype_virtual_network_interface_model['allow_ip_spoofing'] = True
+ bare_metal_server_network_attachment_prototype_virtual_network_interface_model['auto_delete'] = False
+ bare_metal_server_network_attachment_prototype_virtual_network_interface_model['enable_infrastructure_nat'] = True
+ bare_metal_server_network_attachment_prototype_virtual_network_interface_model['ips'] = [virtual_network_interface_ip_prototype_model]
+ bare_metal_server_network_attachment_prototype_virtual_network_interface_model['name'] = 'my-virtual-network-interface'
+ bare_metal_server_network_attachment_prototype_virtual_network_interface_model['primary_ip'] = virtual_network_interface_primary_ip_prototype_model
+ bare_metal_server_network_attachment_prototype_virtual_network_interface_model['resource_group'] = resource_group_identity_model
+ bare_metal_server_network_attachment_prototype_virtual_network_interface_model['security_groups'] = [security_group_identity_model]
+ bare_metal_server_network_attachment_prototype_virtual_network_interface_model['subnet'] = subnet_identity_model
+
+ # Construct a dict representation of a BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByPCIPrototype model
+ bare_metal_server_network_attachment_prototype_model = {}
+ bare_metal_server_network_attachment_prototype_model['name'] = 'my-bare-metal-server-network-attachment'
+ bare_metal_server_network_attachment_prototype_model['virtual_network_interface'] = bare_metal_server_network_attachment_prototype_virtual_network_interface_model
+ bare_metal_server_network_attachment_prototype_model['allowed_vlans'] = []
+ bare_metal_server_network_attachment_prototype_model['interface_type'] = 'pci'
+
+ # Construct a dict representation of a BareMetalServerPrimaryNetworkAttachmentPrototypeBareMetalServerPrimaryNetworkAttachmentByPCIPrototype model
+ bare_metal_server_primary_network_attachment_prototype_model = {}
+ bare_metal_server_primary_network_attachment_prototype_model['name'] = 'my-bare-metal-server-network-attachment'
+ bare_metal_server_primary_network_attachment_prototype_model['virtual_network_interface'] = bare_metal_server_network_attachment_prototype_virtual_network_interface_model
+ bare_metal_server_primary_network_attachment_prototype_model['allowed_vlans'] = []
+ bare_metal_server_primary_network_attachment_prototype_model['interface_type'] = 'pci'
+
+ # Construct a dict representation of a BareMetalServerPrototypeBareMetalServerByNetworkAttachment model
+ bare_metal_server_prototype_model = {}
+ bare_metal_server_prototype_model['enable_secure_boot'] = False
+ bare_metal_server_prototype_model['initialization'] = bare_metal_server_initialization_prototype_model
+ bare_metal_server_prototype_model['name'] = 'my-bare-metal-server'
+ bare_metal_server_prototype_model['profile'] = bare_metal_server_profile_identity_model
+ bare_metal_server_prototype_model['resource_group'] = resource_group_identity_model
+ bare_metal_server_prototype_model['trusted_platform_module'] = bare_metal_server_trusted_platform_module_prototype_model
+ bare_metal_server_prototype_model['vpc'] = vpc_identity_model
+ bare_metal_server_prototype_model['zone'] = zone_identity_model
+ bare_metal_server_prototype_model['network_attachments'] = [bare_metal_server_network_attachment_prototype_model]
+ bare_metal_server_prototype_model['primary_network_attachment'] = bare_metal_server_primary_network_attachment_prototype_model
+
+ # Set up parameter values
+ bare_metal_server_prototype = bare_metal_server_prototype_model
# Invoke method
- response = _service.create_bare_metal_server_network_interface(
- bare_metal_server_id,
- bare_metal_server_network_interface_prototype,
+ response = _service.create_bare_metal_server(
+ bare_metal_server_prototype,
headers={},
)
@@ -20885,25 +21843,25 @@ def test_create_bare_metal_server_network_interface_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 == bare_metal_server_network_interface_prototype
+ assert req_body == bare_metal_server_prototype
- 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.
+ 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_bare_metal_server_network_interface_all_params()
+ self.test_create_bare_metal_server_all_params()
- # Disable retries and run test_create_bare_metal_server_network_interface_all_params.
+ # Disable retries and run test_create_bare_metal_server_all_params.
_service.disable_retries()
- self.test_create_bare_metal_server_network_interface_all_params()
+ self.test_create_bare_metal_server_all_params()
@responses.activate
- def test_create_bare_metal_server_network_interface_value_error(self):
+ def test_create_bare_metal_server_value_error(self):
"""
- test_create_bare_metal_server_network_interface_value_error()
+ test_create_bare_metal_server_value_error()
"""
# Set up mock
- url = preprocess_url('/bare_metal_servers/testString/network_interfaces')
- mock_response = '{"allow_ip_spoofing": true, "created_at": "2019-01-01T12:00:00.000Z", "enable_infrastructure_nat": true, "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}], "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "mac_address": "02:00:04:00:C4:6A", "name": "my-bare-metal-server-network-interface", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary", "interface_type": "hipersocket"}'
+ url = preprocess_url('/bare_metal_servers')
+ mock_response = '{"bandwidth": 20000, "boot_target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-bare-metal-server-disk", "resource_type": "bare_metal_server_disk"}, "cpu": {"architecture": "amd64", "core_count": 80, "socket_count": 4, "threads_per_core": 2}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::bare-metal-server:1e09281b-f177-46fb-baf1-bc152b2e391a", "disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "fcp", "name": "my-bare-metal-server-disk", "resource_type": "bare_metal_server_disk", "size": 100}], "enable_secure_boot": false, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "memory": 1536, "name": "my-bare-metal-server", "network_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/2302-f7a2bf57-af7c-49d9-b599-b2c91293d30c/network_attachments/2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "name": "my-bare-metal-server-network-attachment", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "bare_metal_server_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}], "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-bare-metal-server-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}], "primary_network_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/2302-f7a2bf57-af7c-49d9-b599-b2c91293d30c/network_attachments/2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "name": "my-bare-metal-server-network-attachment", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "bare_metal_server_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}, "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-bare-metal-server-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768", "name": "bx2-metal-192x768", "resource_type": "bare_metal_server_profile"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "bare_metal_server", "status": "deleting", "status_reasons": [{"code": "cannot_start_capacity", "message": "The bare metal server cannot start as there is no more capacity in this\nzone for a bare metal server with the requested profile.", "more_info": "https://console.bluemix.net/docs/iaas/bare_metal_server.html"}], "trusted_platform_module": {"enabled": true, "mode": "disabled", "supported_modes": ["disabled"]}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
responses.add(
responses.POST,
url,
@@ -20912,11 +21870,51 @@ def test_create_bare_metal_server_network_interface_value_error(self):
status=201,
)
- # Construct a dict representation of a NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext model
- network_interface_ip_prototype_model = {}
- network_interface_ip_prototype_model['address'] = '10.0.0.5'
- network_interface_ip_prototype_model['auto_delete'] = False
- network_interface_ip_prototype_model['name'] = 'my-reserved-ip'
+ # Construct a dict representation of a ImageIdentityById model
+ image_identity_model = {}
+ image_identity_model['id'] = '72b27b5c-f4b0-48bb-b954-5becc7c1dcb8'
+
+ # 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 BareMetalServerProfileIdentityByName model
+ bare_metal_server_profile_identity_model = {}
+ bare_metal_server_profile_identity_model['name'] = 'bx2-metal-192x768'
+
+ # Construct a dict representation of a ResourceGroupIdentityById model
+ resource_group_identity_model = {}
+ resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
+
+ # Construct a dict representation of a BareMetalServerTrustedPlatformModulePrototype model
+ bare_metal_server_trusted_platform_module_prototype_model = {}
+ bare_metal_server_trusted_platform_module_prototype_model['mode'] = 'disabled'
+
+ # 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 VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext model
+ virtual_network_interface_ip_prototype_model = {}
+ virtual_network_interface_ip_prototype_model['address'] = '10.0.0.5'
+ virtual_network_interface_ip_prototype_model['auto_delete'] = False
+ virtual_network_interface_ip_prototype_model['name'] = 'my-reserved-ip'
+
+ # Construct a dict representation of a VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext model
+ virtual_network_interface_primary_ip_prototype_model = {}
+ virtual_network_interface_primary_ip_prototype_model['address'] = '10.0.0.5'
+ virtual_network_interface_primary_ip_prototype_model['auto_delete'] = False
+ virtual_network_interface_primary_ip_prototype_model['name'] = 'my-reserved-ip'
# Construct a dict representation of a SecurityGroupIdentityById model
security_group_identity_model = {}
@@ -20926,132 +21924,172 @@ def test_create_bare_metal_server_network_interface_value_error(self):
subnet_identity_model = {}
subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
- # Construct a dict representation of a BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype model
- bare_metal_server_network_interface_prototype_model = {}
- bare_metal_server_network_interface_prototype_model['allow_ip_spoofing'] = True
- bare_metal_server_network_interface_prototype_model['enable_infrastructure_nat'] = True
- bare_metal_server_network_interface_prototype_model['name'] = 'my-bare-metal-server-network-interface'
- bare_metal_server_network_interface_prototype_model['primary_ip'] = network_interface_ip_prototype_model
- bare_metal_server_network_interface_prototype_model['security_groups'] = [security_group_identity_model]
- bare_metal_server_network_interface_prototype_model['subnet'] = subnet_identity_model
- bare_metal_server_network_interface_prototype_model['interface_type'] = 'hipersocket'
-
- # Set up parameter values
- bare_metal_server_id = 'testString'
- bare_metal_server_network_interface_prototype = bare_metal_server_network_interface_prototype_model
+ # Construct a dict representation of a BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeBareMetalServerNetworkAttachmentContext model
+ bare_metal_server_network_attachment_prototype_virtual_network_interface_model = {}
+ bare_metal_server_network_attachment_prototype_virtual_network_interface_model['allow_ip_spoofing'] = True
+ bare_metal_server_network_attachment_prototype_virtual_network_interface_model['auto_delete'] = False
+ bare_metal_server_network_attachment_prototype_virtual_network_interface_model['enable_infrastructure_nat'] = True
+ bare_metal_server_network_attachment_prototype_virtual_network_interface_model['ips'] = [virtual_network_interface_ip_prototype_model]
+ bare_metal_server_network_attachment_prototype_virtual_network_interface_model['name'] = 'my-virtual-network-interface'
+ bare_metal_server_network_attachment_prototype_virtual_network_interface_model['primary_ip'] = virtual_network_interface_primary_ip_prototype_model
+ bare_metal_server_network_attachment_prototype_virtual_network_interface_model['resource_group'] = resource_group_identity_model
+ bare_metal_server_network_attachment_prototype_virtual_network_interface_model['security_groups'] = [security_group_identity_model]
+ bare_metal_server_network_attachment_prototype_virtual_network_interface_model['subnet'] = subnet_identity_model
+
+ # Construct a dict representation of a BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByPCIPrototype model
+ bare_metal_server_network_attachment_prototype_model = {}
+ bare_metal_server_network_attachment_prototype_model['name'] = 'my-bare-metal-server-network-attachment'
+ bare_metal_server_network_attachment_prototype_model['virtual_network_interface'] = bare_metal_server_network_attachment_prototype_virtual_network_interface_model
+ bare_metal_server_network_attachment_prototype_model['allowed_vlans'] = []
+ bare_metal_server_network_attachment_prototype_model['interface_type'] = 'pci'
+
+ # Construct a dict representation of a BareMetalServerPrimaryNetworkAttachmentPrototypeBareMetalServerPrimaryNetworkAttachmentByPCIPrototype model
+ bare_metal_server_primary_network_attachment_prototype_model = {}
+ bare_metal_server_primary_network_attachment_prototype_model['name'] = 'my-bare-metal-server-network-attachment'
+ bare_metal_server_primary_network_attachment_prototype_model['virtual_network_interface'] = bare_metal_server_network_attachment_prototype_virtual_network_interface_model
+ bare_metal_server_primary_network_attachment_prototype_model['allowed_vlans'] = []
+ bare_metal_server_primary_network_attachment_prototype_model['interface_type'] = 'pci'
+
+ # Construct a dict representation of a BareMetalServerPrototypeBareMetalServerByNetworkAttachment model
+ bare_metal_server_prototype_model = {}
+ bare_metal_server_prototype_model['enable_secure_boot'] = False
+ bare_metal_server_prototype_model['initialization'] = bare_metal_server_initialization_prototype_model
+ bare_metal_server_prototype_model['name'] = 'my-bare-metal-server'
+ bare_metal_server_prototype_model['profile'] = bare_metal_server_profile_identity_model
+ bare_metal_server_prototype_model['resource_group'] = resource_group_identity_model
+ bare_metal_server_prototype_model['trusted_platform_module'] = bare_metal_server_trusted_platform_module_prototype_model
+ bare_metal_server_prototype_model['vpc'] = vpc_identity_model
+ bare_metal_server_prototype_model['zone'] = zone_identity_model
+ bare_metal_server_prototype_model['network_attachments'] = [bare_metal_server_network_attachment_prototype_model]
+ bare_metal_server_prototype_model['primary_network_attachment'] = bare_metal_server_primary_network_attachment_prototype_model
+
+ # Set up parameter values
+ bare_metal_server_prototype = bare_metal_server_prototype_model
# Pass in all but one required param and check for a ValueError
req_param_dict = {
- "bare_metal_server_id": bare_metal_server_id,
- "bare_metal_server_network_interface_prototype": bare_metal_server_network_interface_prototype,
+ "bare_metal_server_prototype": bare_metal_server_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_bare_metal_server_network_interface(**req_copy)
+ _service.create_bare_metal_server(**req_copy)
- def test_create_bare_metal_server_network_interface_value_error_with_retries(self):
- # Enable retries and run test_create_bare_metal_server_network_interface_value_error.
+ 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_bare_metal_server_network_interface_value_error()
+ self.test_create_bare_metal_server_value_error()
- # Disable retries and run test_create_bare_metal_server_network_interface_value_error.
+ # Disable retries and run test_create_bare_metal_server_value_error.
_service.disable_retries()
- self.test_create_bare_metal_server_network_interface_value_error()
+ self.test_create_bare_metal_server_value_error()
-class TestDeleteBareMetalServerNetworkInterface:
+class TestCreateBareMetalServerConsoleAccessToken:
"""
- Test Class for delete_bare_metal_server_network_interface
+ Test Class for create_bare_metal_server_console_access_token
"""
@responses.activate
- def test_delete_bare_metal_server_network_interface_all_params(self):
+ def test_create_bare_metal_server_console_access_token_all_params(self):
"""
- delete_bare_metal_server_network_interface()
+ create_bare_metal_server_console_access_token()
"""
# Set up mock
- url = preprocess_url('/bare_metal_servers/testString/network_interfaces/testString')
+ 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.DELETE,
+ responses.POST,
url,
- status=204,
+ body=mock_response,
+ content_type='application/json',
+ status=200,
)
# Set up parameter values
bare_metal_server_id = 'testString'
- id = 'testString'
+ console_type = 'serial'
+ force = False
# Invoke method
- response = _service.delete_bare_metal_server_network_interface(
+ response = _service.create_bare_metal_server_console_access_token(
bare_metal_server_id,
- 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_bare_metal_server_network_interface_all_params_with_retries(self):
- # Enable retries and run test_delete_bare_metal_server_network_interface_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_bare_metal_server_network_interface_all_params()
+ self.test_create_bare_metal_server_console_access_token_all_params()
- # Disable retries and run test_delete_bare_metal_server_network_interface_all_params.
+ # Disable retries and run test_create_bare_metal_server_console_access_token_all_params.
_service.disable_retries()
- self.test_delete_bare_metal_server_network_interface_all_params()
+ self.test_create_bare_metal_server_console_access_token_all_params()
@responses.activate
- def test_delete_bare_metal_server_network_interface_value_error(self):
+ def test_create_bare_metal_server_console_access_token_value_error(self):
"""
- test_delete_bare_metal_server_network_interface_value_error()
+ test_create_bare_metal_server_console_access_token_value_error()
"""
# Set up mock
- url = preprocess_url('/bare_metal_servers/testString/network_interfaces/testString')
+ 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.DELETE,
+ responses.POST,
url,
- status=204,
+ body=mock_response,
+ content_type='application/json',
+ status=200,
)
# Set up parameter values
bare_metal_server_id = 'testString'
- id = 'testString'
+ console_type = 'serial'
+ force = False
# 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,
+ "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_bare_metal_server_network_interface(**req_copy)
+ _service.create_bare_metal_server_console_access_token(**req_copy)
- def test_delete_bare_metal_server_network_interface_value_error_with_retries(self):
- # Enable retries and run test_delete_bare_metal_server_network_interface_value_error.
+ 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_bare_metal_server_network_interface_value_error()
+ self.test_create_bare_metal_server_console_access_token_value_error()
- # Disable retries and run test_delete_bare_metal_server_network_interface_value_error.
+ # Disable retries and run test_create_bare_metal_server_console_access_token_value_error.
_service.disable_retries()
- self.test_delete_bare_metal_server_network_interface_value_error()
+ self.test_create_bare_metal_server_console_access_token_value_error()
-class TestGetBareMetalServerNetworkInterface:
+class TestListBareMetalServerDisks:
"""
- Test Class for get_bare_metal_server_network_interface
+ Test Class for list_bare_metal_server_disks
"""
@responses.activate
- def test_get_bare_metal_server_network_interface_all_params(self):
+ def test_list_bare_metal_server_disks_all_params(self):
"""
- get_bare_metal_server_network_interface()
+ list_bare_metal_server_disks()
"""
# Set up mock
- url = preprocess_url('/bare_metal_servers/testString/network_interfaces/testString')
- mock_response = '{"allow_ip_spoofing": true, "created_at": "2019-01-01T12:00:00.000Z", "enable_infrastructure_nat": true, "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}], "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "mac_address": "02:00:04:00:C4:6A", "name": "my-bare-metal-server-network-interface", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary", "interface_type": "hipersocket"}'
+ url = preprocess_url('/bare_metal_servers/testString/disks')
+ mock_response = '{"disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "fcp", "name": "my-bare-metal-server-disk", "resource_type": "bare_metal_server_disk", "size": 100}]}'
responses.add(
responses.GET,
url,
@@ -21062,12 +22100,10 @@ def test_get_bare_metal_server_network_interface_all_params(self):
# Set up parameter values
bare_metal_server_id = 'testString'
- id = 'testString'
# Invoke method
- response = _service.get_bare_metal_server_network_interface(
+ response = _service.list_bare_metal_server_disks(
bare_metal_server_id,
- id,
headers={},
)
@@ -21075,23 +22111,23 @@ def test_get_bare_metal_server_network_interface_all_params(self):
assert len(responses.calls) == 1
assert response.status_code == 200
- 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.
+ 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_bare_metal_server_network_interface_all_params()
+ self.test_list_bare_metal_server_disks_all_params()
- # Disable retries and run test_get_bare_metal_server_network_interface_all_params.
+ # Disable retries and run test_list_bare_metal_server_disks_all_params.
_service.disable_retries()
- self.test_get_bare_metal_server_network_interface_all_params()
+ self.test_list_bare_metal_server_disks_all_params()
@responses.activate
- def test_get_bare_metal_server_network_interface_value_error(self):
+ def test_list_bare_metal_server_disks_value_error(self):
"""
- test_get_bare_metal_server_network_interface_value_error()
+ test_list_bare_metal_server_disks_value_error()
"""
# Set up mock
- url = preprocess_url('/bare_metal_servers/testString/network_interfaces/testString')
- mock_response = '{"allow_ip_spoofing": true, "created_at": "2019-01-01T12:00:00.000Z", "enable_infrastructure_nat": true, "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}], "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "mac_address": "02:00:04:00:C4:6A", "name": "my-bare-metal-server-network-interface", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary", "interface_type": "hipersocket"}'
+ url = preprocess_url('/bare_metal_servers/testString/disks')
+ mock_response = '{"disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "fcp", "name": "my-bare-metal-server-disk", "resource_type": "bare_metal_server_disk", "size": 100}]}'
responses.add(
responses.GET,
url,
@@ -21102,315 +22138,271 @@ def test_get_bare_metal_server_network_interface_value_error(self):
# 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_bare_metal_server_network_interface(**req_copy)
+ _service.list_bare_metal_server_disks(**req_copy)
- def test_get_bare_metal_server_network_interface_value_error_with_retries(self):
- # Enable retries and run test_get_bare_metal_server_network_interface_value_error.
+ 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_bare_metal_server_network_interface_value_error()
+ self.test_list_bare_metal_server_disks_value_error()
- # Disable retries and run test_get_bare_metal_server_network_interface_value_error.
+ # Disable retries and run test_list_bare_metal_server_disks_value_error.
_service.disable_retries()
- self.test_get_bare_metal_server_network_interface_value_error()
+ self.test_list_bare_metal_server_disks_value_error()
-class TestUpdateBareMetalServerNetworkInterface:
+class TestGetBareMetalServerDisk:
"""
- Test Class for update_bare_metal_server_network_interface
+ Test Class for get_bare_metal_server_disk
"""
@responses.activate
- def test_update_bare_metal_server_network_interface_all_params(self):
+ def test_get_bare_metal_server_disk_all_params(self):
"""
- update_bare_metal_server_network_interface()
+ get_bare_metal_server_disk()
"""
# Set up mock
- url = preprocess_url('/bare_metal_servers/testString/network_interfaces/testString')
- mock_response = '{"allow_ip_spoofing": true, "created_at": "2019-01-01T12:00:00.000Z", "enable_infrastructure_nat": true, "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}], "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "mac_address": "02:00:04:00:C4:6A", "name": "my-bare-metal-server-network-interface", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary", "interface_type": "hipersocket"}'
+ url = preprocess_url('/bare_metal_servers/testString/disks/testString')
+ mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "fcp", "name": "my-bare-metal-server-disk", "resource_type": "bare_metal_server_disk", "size": 100}'
responses.add(
- responses.PATCH,
+ responses.GET,
url,
body=mock_response,
content_type='application/json',
status=200,
)
- # 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-bare-metal-server-network-interface'
-
# Set up parameter values
bare_metal_server_id = 'testString'
id = 'testString'
- bare_metal_server_network_interface_patch = bare_metal_server_network_interface_patch_model
# Invoke method
- response = _service.update_bare_metal_server_network_interface(
+ response = _service.get_bare_metal_server_disk(
bare_metal_server_id,
id,
- bare_metal_server_network_interface_patch,
headers={},
)
# Check for correct operation
assert len(responses.calls) == 1
assert response.status_code == 200
- # Validate body params
- req_body = json.loads(str(responses.calls[0].request.body, 'utf-8'))
- assert req_body == bare_metal_server_network_interface_patch
- 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.
+ 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_bare_metal_server_network_interface_all_params()
+ self.test_get_bare_metal_server_disk_all_params()
- # Disable retries and run test_update_bare_metal_server_network_interface_all_params.
+ # Disable retries and run test_get_bare_metal_server_disk_all_params.
_service.disable_retries()
- self.test_update_bare_metal_server_network_interface_all_params()
+ self.test_get_bare_metal_server_disk_all_params()
@responses.activate
- def test_update_bare_metal_server_network_interface_value_error(self):
+ def test_get_bare_metal_server_disk_value_error(self):
"""
- test_update_bare_metal_server_network_interface_value_error()
+ test_get_bare_metal_server_disk_value_error()
"""
# Set up mock
- url = preprocess_url('/bare_metal_servers/testString/network_interfaces/testString')
- mock_response = '{"allow_ip_spoofing": true, "created_at": "2019-01-01T12:00:00.000Z", "enable_infrastructure_nat": true, "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}], "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "mac_address": "02:00:04:00:C4:6A", "name": "my-bare-metal-server-network-interface", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary", "interface_type": "hipersocket"}'
+ url = preprocess_url('/bare_metal_servers/testString/disks/testString')
+ mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "fcp", "name": "my-bare-metal-server-disk", "resource_type": "bare_metal_server_disk", "size": 100}'
responses.add(
- responses.PATCH,
+ responses.GET,
url,
body=mock_response,
content_type='application/json',
status=200,
)
- # 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-bare-metal-server-network-interface'
-
# Set up parameter values
bare_metal_server_id = 'testString'
id = 'testString'
- 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,
- "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_bare_metal_server_network_interface(**req_copy)
+ _service.get_bare_metal_server_disk(**req_copy)
- def test_update_bare_metal_server_network_interface_value_error_with_retries(self):
- # Enable retries and run test_update_bare_metal_server_network_interface_value_error.
+ 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_bare_metal_server_network_interface_value_error()
+ self.test_get_bare_metal_server_disk_value_error()
- # Disable retries and run test_update_bare_metal_server_network_interface_value_error.
+ # Disable retries and run test_get_bare_metal_server_disk_value_error.
_service.disable_retries()
- self.test_update_bare_metal_server_network_interface_value_error()
+ self.test_get_bare_metal_server_disk_value_error()
-class TestListBareMetalServerNetworkInterfaceFloatingIps:
+class TestUpdateBareMetalServerDisk:
"""
- Test Class for list_bare_metal_server_network_interface_floating_ips
+ Test Class for update_bare_metal_server_disk
"""
@responses.activate
- def test_list_bare_metal_server_network_interface_floating_ips_all_params(self):
+ def test_update_bare_metal_server_disk_all_params(self):
"""
- list_bare_metal_server_network_interface_floating_ips()
+ update_bare_metal_server_disk()
"""
# Set up mock
- url = preprocess_url('/bare_metal_servers/testString/network_interfaces/testString/floating_ips')
- mock_response = '{"floating_ips": [{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}]}'
+ url = preprocess_url('/bare_metal_servers/testString/disks/testString')
+ mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "fcp", "name": "my-bare-metal-server-disk", "resource_type": "bare_metal_server_disk", "size": 100}'
responses.add(
- responses.GET,
+ responses.PATCH,
url,
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
bare_metal_server_id = 'testString'
- network_interface_id = 'testString'
+ id = 'testString'
+ bare_metal_server_disk_patch = bare_metal_server_disk_patch_model
# Invoke method
- response = _service.list_bare_metal_server_network_interface_floating_ips(
+ response = _service.update_bare_metal_server_disk(
bare_metal_server_id,
- network_interface_id,
+ id,
+ bare_metal_server_disk_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_disk_patch
- 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.
+ 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_list_bare_metal_server_network_interface_floating_ips_all_params()
+ self.test_update_bare_metal_server_disk_all_params()
- # Disable retries and run test_list_bare_metal_server_network_interface_floating_ips_all_params.
+ # Disable retries and run test_update_bare_metal_server_disk_all_params.
_service.disable_retries()
- self.test_list_bare_metal_server_network_interface_floating_ips_all_params()
+ self.test_update_bare_metal_server_disk_all_params()
@responses.activate
- def test_list_bare_metal_server_network_interface_floating_ips_value_error(self):
+ def test_update_bare_metal_server_disk_value_error(self):
"""
- test_list_bare_metal_server_network_interface_floating_ips_value_error()
+ test_update_bare_metal_server_disk_value_error()
"""
# Set up mock
- url = preprocess_url('/bare_metal_servers/testString/network_interfaces/testString/floating_ips')
- mock_response = '{"floating_ips": [{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}]}'
+ url = preprocess_url('/bare_metal_servers/testString/disks/testString')
+ mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "fcp", "name": "my-bare-metal-server-disk", "resource_type": "bare_metal_server_disk", "size": 100}'
responses.add(
- responses.GET,
+ responses.PATCH,
url,
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
bare_metal_server_id = 'testString'
- network_interface_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 = {
"bare_metal_server_id": bare_metal_server_id,
- "network_interface_id": network_interface_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.list_bare_metal_server_network_interface_floating_ips(**req_copy)
+ _service.update_bare_metal_server_disk(**req_copy)
- def test_list_bare_metal_server_network_interface_floating_ips_value_error_with_retries(self):
- # Enable retries and run test_list_bare_metal_server_network_interface_floating_ips_value_error.
+ 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_list_bare_metal_server_network_interface_floating_ips_value_error()
+ self.test_update_bare_metal_server_disk_value_error()
- # Disable retries and run test_list_bare_metal_server_network_interface_floating_ips_value_error.
+ # Disable retries and run test_update_bare_metal_server_disk_value_error.
_service.disable_retries()
- self.test_list_bare_metal_server_network_interface_floating_ips_value_error()
+ self.test_update_bare_metal_server_disk_value_error()
-class TestRemoveBareMetalServerNetworkInterfaceFloatingIp:
+class TestListBareMetalServerNetworkAttachments:
"""
- Test Class for remove_bare_metal_server_network_interface_floating_ip
+ Test Class for list_bare_metal_server_network_attachments
"""
@responses.activate
- def test_remove_bare_metal_server_network_interface_floating_ip_all_params(self):
+ def test_list_bare_metal_server_network_attachments_all_params(self):
"""
- remove_bare_metal_server_network_interface_floating_ip()
+ list_bare_metal_server_network_attachments()
"""
# Set up mock
- url = preprocess_url('/bare_metal_servers/testString/network_interfaces/testString/floating_ips/testString')
+ url = preprocess_url('/bare_metal_servers/testString/network_attachments')
+ mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/3b2669a2-4c2b-4003-bc91-1b81f1326267/network_attachments?limit=20"}, "limit": 20, "network_attachments": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/2302-f7a2bf57-af7c-49d9-b599-b2c91293d30c/network_attachments/2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "lifecycle_state": "stable", "name": "my-bare-metal-server-network-attachment", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "bare_metal_server_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary", "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "id": "0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}, "allowed_vlans": [4], "interface_type": "pci"}], "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/3b2669a2-4c2b-4003-bc91-1b81f1326267/network_attachments?start=d3e721fd-c988-4670-9927-dbd5e7b07fc6&limit=20"}, "total_count": 132}'
responses.add(
- responses.DELETE,
+ responses.GET,
url,
- status=204,
+ body=mock_response,
+ content_type='application/json',
+ status=200,
)
# Set up parameter values
bare_metal_server_id = 'testString'
- network_interface_id = 'testString'
- id = 'testString'
+ start = 'testString'
+ limit = 50
# Invoke method
- response = _service.remove_bare_metal_server_network_interface_floating_ip(
+ response = _service.list_bare_metal_server_network_attachments(
bare_metal_server_id,
- network_interface_id,
- id,
+ start=start,
+ limit=limit,
headers={},
)
# Check for correct operation
assert len(responses.calls) == 1
- assert response.status_code == 204
-
- 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_remove_bare_metal_server_network_interface_floating_ip_all_params()
-
- # Disable retries and run test_remove_bare_metal_server_network_interface_floating_ip_all_params.
- _service.disable_retries()
- self.test_remove_bare_metal_server_network_interface_floating_ip_all_params()
-
- @responses.activate
- def test_remove_bare_metal_server_network_interface_floating_ip_value_error(self):
- """
- test_remove_bare_metal_server_network_interface_floating_ip_value_error()
- """
- # Set up mock
- url = preprocess_url('/bare_metal_servers/testString/network_interfaces/testString/floating_ips/testString')
- responses.add(
- responses.DELETE,
- url,
- status=204,
- )
-
- # Set up parameter values
- bare_metal_server_id = 'testString'
- network_interface_id = 'testString'
- id = 'testString'
-
- # Pass in all but one required param and check for a ValueError
- req_param_dict = {
- "bare_metal_server_id": bare_metal_server_id,
- "network_interface_id": network_interface_id,
- "id": id,
- }
- for param in req_param_dict.keys():
- req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()}
- with pytest.raises(ValueError):
- _service.remove_bare_metal_server_network_interface_floating_ip(**req_copy)
+ 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_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.
+ def test_list_bare_metal_server_network_attachments_all_params_with_retries(self):
+ # Enable retries and run test_list_bare_metal_server_network_attachments_all_params.
_service.enable_retries()
- self.test_remove_bare_metal_server_network_interface_floating_ip_value_error()
+ self.test_list_bare_metal_server_network_attachments_all_params()
- # Disable retries and run test_remove_bare_metal_server_network_interface_floating_ip_value_error.
+ # Disable retries and run test_list_bare_metal_server_network_attachments_all_params.
_service.disable_retries()
- self.test_remove_bare_metal_server_network_interface_floating_ip_value_error()
-
-
-class TestGetBareMetalServerNetworkInterfaceFloatingIp:
- """
- Test Class for get_bare_metal_server_network_interface_floating_ip
- """
+ self.test_list_bare_metal_server_network_attachments_all_params()
@responses.activate
- def test_get_bare_metal_server_network_interface_floating_ip_all_params(self):
+ def test_list_bare_metal_server_network_attachments_required_params(self):
"""
- get_bare_metal_server_network_interface_floating_ip()
+ test_list_bare_metal_server_network_attachments_required_params()
"""
# Set up mock
- url = preprocess_url('/bare_metal_servers/testString/network_interfaces/testString/floating_ips/testString')
- mock_response = '{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
+ url = preprocess_url('/bare_metal_servers/testString/network_attachments')
+ mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/3b2669a2-4c2b-4003-bc91-1b81f1326267/network_attachments?limit=20"}, "limit": 20, "network_attachments": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/2302-f7a2bf57-af7c-49d9-b599-b2c91293d30c/network_attachments/2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "lifecycle_state": "stable", "name": "my-bare-metal-server-network-attachment", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "bare_metal_server_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary", "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "id": "0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}, "allowed_vlans": [4], "interface_type": "pci"}], "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/3b2669a2-4c2b-4003-bc91-1b81f1326267/network_attachments?start=d3e721fd-c988-4670-9927-dbd5e7b07fc6&limit=20"}, "total_count": 132}'
responses.add(
responses.GET,
url,
@@ -21421,14 +22413,10 @@ def test_get_bare_metal_server_network_interface_floating_ip_all_params(self):
# Set up parameter values
bare_metal_server_id = 'testString'
- network_interface_id = 'testString'
- id = 'testString'
# Invoke method
- response = _service.get_bare_metal_server_network_interface_floating_ip(
+ response = _service.list_bare_metal_server_network_attachments(
bare_metal_server_id,
- network_interface_id,
- id,
headers={},
)
@@ -21436,23 +22424,23 @@ def test_get_bare_metal_server_network_interface_floating_ip_all_params(self):
assert len(responses.calls) == 1
assert response.status_code == 200
- 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.
+ def test_list_bare_metal_server_network_attachments_required_params_with_retries(self):
+ # Enable retries and run test_list_bare_metal_server_network_attachments_required_params.
_service.enable_retries()
- self.test_get_bare_metal_server_network_interface_floating_ip_all_params()
+ self.test_list_bare_metal_server_network_attachments_required_params()
- # Disable retries and run test_get_bare_metal_server_network_interface_floating_ip_all_params.
+ # Disable retries and run test_list_bare_metal_server_network_attachments_required_params.
_service.disable_retries()
- self.test_get_bare_metal_server_network_interface_floating_ip_all_params()
+ self.test_list_bare_metal_server_network_attachments_required_params()
@responses.activate
- def test_get_bare_metal_server_network_interface_floating_ip_value_error(self):
+ def test_list_bare_metal_server_network_attachments_value_error(self):
"""
- test_get_bare_metal_server_network_interface_floating_ip_value_error()
+ test_list_bare_metal_server_network_attachments_value_error()
"""
# Set up mock
- url = preprocess_url('/bare_metal_servers/testString/network_interfaces/testString/floating_ips/testString')
- mock_response = '{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
+ url = preprocess_url('/bare_metal_servers/testString/network_attachments')
+ mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/3b2669a2-4c2b-4003-bc91-1b81f1326267/network_attachments?limit=20"}, "limit": 20, "network_attachments": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/2302-f7a2bf57-af7c-49d9-b599-b2c91293d30c/network_attachments/2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "lifecycle_state": "stable", "name": "my-bare-metal-server-network-attachment", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "bare_metal_server_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary", "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "id": "0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}, "allowed_vlans": [4], "interface_type": "pci"}], "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/3b2669a2-4c2b-4003-bc91-1b81f1326267/network_attachments?start=d3e721fd-c988-4670-9927-dbd5e7b07fc6&limit=20"}, "total_count": 132}'
responses.add(
responses.GET,
url,
@@ -21463,217 +22451,363 @@ def test_get_bare_metal_server_network_interface_floating_ip_value_error(self):
# Set up parameter values
bare_metal_server_id = 'testString'
- network_interface_id = 'testString'
- id = 'testString'
# Pass in all but one required param and check for a ValueError
req_param_dict = {
"bare_metal_server_id": bare_metal_server_id,
- "network_interface_id": network_interface_id,
- "id": id,
}
for param in req_param_dict.keys():
req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()}
with pytest.raises(ValueError):
- _service.get_bare_metal_server_network_interface_floating_ip(**req_copy)
+ _service.list_bare_metal_server_network_attachments(**req_copy)
- def test_get_bare_metal_server_network_interface_floating_ip_value_error_with_retries(self):
- # Enable retries and run test_get_bare_metal_server_network_interface_floating_ip_value_error.
+ def test_list_bare_metal_server_network_attachments_value_error_with_retries(self):
+ # Enable retries and run test_list_bare_metal_server_network_attachments_value_error.
_service.enable_retries()
- self.test_get_bare_metal_server_network_interface_floating_ip_value_error()
+ self.test_list_bare_metal_server_network_attachments_value_error()
- # Disable retries and run test_get_bare_metal_server_network_interface_floating_ip_value_error.
+ # Disable retries and run test_list_bare_metal_server_network_attachments_value_error.
_service.disable_retries()
- self.test_get_bare_metal_server_network_interface_floating_ip_value_error()
+ self.test_list_bare_metal_server_network_attachments_value_error()
+ @responses.activate
+ def test_list_bare_metal_server_network_attachments_with_pager_get_next(self):
+ """
+ test_list_bare_metal_server_network_attachments_with_pager_get_next()
+ """
+ # Set up a two-page mock response
+ url = preprocess_url('/bare_metal_servers/testString/network_attachments')
+ mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"network_attachments":[{"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/2302-f7a2bf57-af7c-49d9-b599-b2c91293d30c/network_attachments/2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6","id":"2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6","lifecycle_state":"stable","name":"my-bare-metal-server-network-attachment","port_speed":1000,"primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"bare_metal_server_network_attachment","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"},"type":"primary","virtual_network_interface":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","href":"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","id":"0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","name":"my-virtual-network-interface","resource_type":"virtual_network_interface"},"allowed_vlans":[4],"interface_type":"pci"}]}'
+ mock_response2 = '{"total_count":2,"limit":1,"network_attachments":[{"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/2302-f7a2bf57-af7c-49d9-b599-b2c91293d30c/network_attachments/2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6","id":"2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6","lifecycle_state":"stable","name":"my-bare-metal-server-network-attachment","port_speed":1000,"primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"bare_metal_server_network_attachment","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"},"type":"primary","virtual_network_interface":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","href":"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","id":"0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","name":"my-virtual-network-interface","resource_type":"virtual_network_interface"},"allowed_vlans":[4],"interface_type":"pci"}]}'
+ responses.add(
+ responses.GET,
+ url,
+ body=mock_response1,
+ content_type='application/json',
+ status=200,
+ )
+ responses.add(
+ responses.GET,
+ url,
+ body=mock_response2,
+ content_type='application/json',
+ status=200,
+ )
-class TestAddBareMetalServerNetworkInterfaceFloatingIp:
+ # Exercise the pager class for this operation
+ all_results = []
+ pager = BareMetalServerNetworkAttachmentsPager(
+ client=_service,
+ bare_metal_server_id='testString',
+ limit=10,
+ )
+ while pager.has_next():
+ next_page = pager.get_next()
+ assert next_page is not None
+ all_results.extend(next_page)
+ assert len(all_results) == 2
+
+ @responses.activate
+ def test_list_bare_metal_server_network_attachments_with_pager_get_all(self):
+ """
+ test_list_bare_metal_server_network_attachments_with_pager_get_all()
+ """
+ # Set up a two-page mock response
+ url = preprocess_url('/bare_metal_servers/testString/network_attachments')
+ mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"network_attachments":[{"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/2302-f7a2bf57-af7c-49d9-b599-b2c91293d30c/network_attachments/2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6","id":"2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6","lifecycle_state":"stable","name":"my-bare-metal-server-network-attachment","port_speed":1000,"primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"bare_metal_server_network_attachment","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"},"type":"primary","virtual_network_interface":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","href":"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","id":"0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","name":"my-virtual-network-interface","resource_type":"virtual_network_interface"},"allowed_vlans":[4],"interface_type":"pci"}]}'
+ mock_response2 = '{"total_count":2,"limit":1,"network_attachments":[{"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/2302-f7a2bf57-af7c-49d9-b599-b2c91293d30c/network_attachments/2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6","id":"2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6","lifecycle_state":"stable","name":"my-bare-metal-server-network-attachment","port_speed":1000,"primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"bare_metal_server_network_attachment","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"},"type":"primary","virtual_network_interface":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","href":"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","id":"0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","name":"my-virtual-network-interface","resource_type":"virtual_network_interface"},"allowed_vlans":[4],"interface_type":"pci"}]}'
+ responses.add(
+ responses.GET,
+ url,
+ body=mock_response1,
+ content_type='application/json',
+ status=200,
+ )
+ responses.add(
+ responses.GET,
+ url,
+ body=mock_response2,
+ content_type='application/json',
+ status=200,
+ )
+
+ # Exercise the pager class for this operation
+ pager = BareMetalServerNetworkAttachmentsPager(
+ client=_service,
+ bare_metal_server_id='testString',
+ limit=10,
+ )
+ all_results = pager.get_all()
+ assert all_results is not None
+ assert len(all_results) == 2
+
+
+class TestCreateBareMetalServerNetworkAttachment:
"""
- Test Class for add_bare_metal_server_network_interface_floating_ip
+ Test Class for create_bare_metal_server_network_attachment
"""
@responses.activate
- def test_add_bare_metal_server_network_interface_floating_ip_all_params(self):
+ def test_create_bare_metal_server_network_attachment_all_params(self):
"""
- add_bare_metal_server_network_interface_floating_ip()
+ create_bare_metal_server_network_attachment()
"""
# Set up mock
- url = preprocess_url('/bare_metal_servers/testString/network_interfaces/testString/floating_ips/testString')
- mock_response = '{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
+ url = preprocess_url('/bare_metal_servers/testString/network_attachments')
+ mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/2302-f7a2bf57-af7c-49d9-b599-b2c91293d30c/network_attachments/2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "lifecycle_state": "stable", "name": "my-bare-metal-server-network-attachment", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "bare_metal_server_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary", "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "id": "0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}, "allowed_vlans": [4], "interface_type": "pci"}'
responses.add(
- responses.PUT,
+ responses.POST,
url,
body=mock_response,
content_type='application/json',
status=201,
)
+ # Construct a dict representation of a VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext model
+ virtual_network_interface_ip_prototype_model = {}
+ virtual_network_interface_ip_prototype_model['address'] = '10.0.0.5'
+ virtual_network_interface_ip_prototype_model['auto_delete'] = False
+ virtual_network_interface_ip_prototype_model['name'] = 'my-reserved-ip'
+
+ # Construct a dict representation of a VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext model
+ virtual_network_interface_primary_ip_prototype_model = {}
+ virtual_network_interface_primary_ip_prototype_model['address'] = '10.0.0.5'
+ virtual_network_interface_primary_ip_prototype_model['auto_delete'] = False
+ virtual_network_interface_primary_ip_prototype_model['name'] = 'my-reserved-ip'
+
+ # Construct a dict representation of a ResourceGroupIdentityById model
+ resource_group_identity_model = {}
+ resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
+
+ # Construct a dict representation of a SecurityGroupIdentityById model
+ security_group_identity_model = {}
+ security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271'
+
+ # Construct a dict representation of a SubnetIdentityById model
+ subnet_identity_model = {}
+ subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
+
+ # Construct a dict representation of a BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeBareMetalServerNetworkAttachmentContext model
+ bare_metal_server_network_attachment_prototype_virtual_network_interface_model = {}
+ bare_metal_server_network_attachment_prototype_virtual_network_interface_model['allow_ip_spoofing'] = True
+ bare_metal_server_network_attachment_prototype_virtual_network_interface_model['auto_delete'] = False
+ bare_metal_server_network_attachment_prototype_virtual_network_interface_model['enable_infrastructure_nat'] = True
+ bare_metal_server_network_attachment_prototype_virtual_network_interface_model['ips'] = [virtual_network_interface_ip_prototype_model]
+ bare_metal_server_network_attachment_prototype_virtual_network_interface_model['name'] = 'my-virtual-network-interface'
+ bare_metal_server_network_attachment_prototype_virtual_network_interface_model['primary_ip'] = virtual_network_interface_primary_ip_prototype_model
+ bare_metal_server_network_attachment_prototype_virtual_network_interface_model['resource_group'] = resource_group_identity_model
+ bare_metal_server_network_attachment_prototype_virtual_network_interface_model['security_groups'] = [security_group_identity_model]
+ bare_metal_server_network_attachment_prototype_virtual_network_interface_model['subnet'] = subnet_identity_model
+
+ # Construct a dict representation of a BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByPCIPrototype model
+ bare_metal_server_network_attachment_prototype_model = {}
+ bare_metal_server_network_attachment_prototype_model['name'] = 'my-bare-metal-server-network-attachment'
+ bare_metal_server_network_attachment_prototype_model['virtual_network_interface'] = bare_metal_server_network_attachment_prototype_virtual_network_interface_model
+ bare_metal_server_network_attachment_prototype_model['allowed_vlans'] = []
+ bare_metal_server_network_attachment_prototype_model['interface_type'] = 'pci'
+
# Set up parameter values
bare_metal_server_id = 'testString'
- network_interface_id = 'testString'
- id = 'testString'
+ bare_metal_server_network_attachment_prototype = bare_metal_server_network_attachment_prototype_model
# Invoke method
- response = _service.add_bare_metal_server_network_interface_floating_ip(
+ response = _service.create_bare_metal_server_network_attachment(
bare_metal_server_id,
- network_interface_id,
- id,
+ bare_metal_server_network_attachment_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 == bare_metal_server_network_attachment_prototype
- 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.
+ def test_create_bare_metal_server_network_attachment_all_params_with_retries(self):
+ # Enable retries and run test_create_bare_metal_server_network_attachment_all_params.
_service.enable_retries()
- self.test_add_bare_metal_server_network_interface_floating_ip_all_params()
+ self.test_create_bare_metal_server_network_attachment_all_params()
- # Disable retries and run test_add_bare_metal_server_network_interface_floating_ip_all_params.
+ # Disable retries and run test_create_bare_metal_server_network_attachment_all_params.
_service.disable_retries()
- self.test_add_bare_metal_server_network_interface_floating_ip_all_params()
+ self.test_create_bare_metal_server_network_attachment_all_params()
@responses.activate
- def test_add_bare_metal_server_network_interface_floating_ip_value_error(self):
+ def test_create_bare_metal_server_network_attachment_value_error(self):
"""
- test_add_bare_metal_server_network_interface_floating_ip_value_error()
+ test_create_bare_metal_server_network_attachment_value_error()
"""
# Set up mock
- url = preprocess_url('/bare_metal_servers/testString/network_interfaces/testString/floating_ips/testString')
- mock_response = '{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
+ url = preprocess_url('/bare_metal_servers/testString/network_attachments')
+ mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/2302-f7a2bf57-af7c-49d9-b599-b2c91293d30c/network_attachments/2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "lifecycle_state": "stable", "name": "my-bare-metal-server-network-attachment", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "bare_metal_server_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary", "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "id": "0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}, "allowed_vlans": [4], "interface_type": "pci"}'
responses.add(
- responses.PUT,
+ responses.POST,
url,
body=mock_response,
content_type='application/json',
status=201,
)
+ # Construct a dict representation of a VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext model
+ virtual_network_interface_ip_prototype_model = {}
+ virtual_network_interface_ip_prototype_model['address'] = '10.0.0.5'
+ virtual_network_interface_ip_prototype_model['auto_delete'] = False
+ virtual_network_interface_ip_prototype_model['name'] = 'my-reserved-ip'
+
+ # Construct a dict representation of a VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext model
+ virtual_network_interface_primary_ip_prototype_model = {}
+ virtual_network_interface_primary_ip_prototype_model['address'] = '10.0.0.5'
+ virtual_network_interface_primary_ip_prototype_model['auto_delete'] = False
+ virtual_network_interface_primary_ip_prototype_model['name'] = 'my-reserved-ip'
+
+ # Construct a dict representation of a ResourceGroupIdentityById model
+ resource_group_identity_model = {}
+ resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
+
+ # Construct a dict representation of a SecurityGroupIdentityById model
+ security_group_identity_model = {}
+ security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271'
+
+ # Construct a dict representation of a SubnetIdentityById model
+ subnet_identity_model = {}
+ subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
+
+ # Construct a dict representation of a BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeBareMetalServerNetworkAttachmentContext model
+ bare_metal_server_network_attachment_prototype_virtual_network_interface_model = {}
+ bare_metal_server_network_attachment_prototype_virtual_network_interface_model['allow_ip_spoofing'] = True
+ bare_metal_server_network_attachment_prototype_virtual_network_interface_model['auto_delete'] = False
+ bare_metal_server_network_attachment_prototype_virtual_network_interface_model['enable_infrastructure_nat'] = True
+ bare_metal_server_network_attachment_prototype_virtual_network_interface_model['ips'] = [virtual_network_interface_ip_prototype_model]
+ bare_metal_server_network_attachment_prototype_virtual_network_interface_model['name'] = 'my-virtual-network-interface'
+ bare_metal_server_network_attachment_prototype_virtual_network_interface_model['primary_ip'] = virtual_network_interface_primary_ip_prototype_model
+ bare_metal_server_network_attachment_prototype_virtual_network_interface_model['resource_group'] = resource_group_identity_model
+ bare_metal_server_network_attachment_prototype_virtual_network_interface_model['security_groups'] = [security_group_identity_model]
+ bare_metal_server_network_attachment_prototype_virtual_network_interface_model['subnet'] = subnet_identity_model
+
+ # Construct a dict representation of a BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByPCIPrototype model
+ bare_metal_server_network_attachment_prototype_model = {}
+ bare_metal_server_network_attachment_prototype_model['name'] = 'my-bare-metal-server-network-attachment'
+ bare_metal_server_network_attachment_prototype_model['virtual_network_interface'] = bare_metal_server_network_attachment_prototype_virtual_network_interface_model
+ bare_metal_server_network_attachment_prototype_model['allowed_vlans'] = []
+ bare_metal_server_network_attachment_prototype_model['interface_type'] = 'pci'
+
# Set up parameter values
bare_metal_server_id = 'testString'
- network_interface_id = 'testString'
- id = 'testString'
+ bare_metal_server_network_attachment_prototype = bare_metal_server_network_attachment_prototype_model
# Pass in all but one required param and check for a ValueError
req_param_dict = {
"bare_metal_server_id": bare_metal_server_id,
- "network_interface_id": network_interface_id,
- "id": id,
+ "bare_metal_server_network_attachment_prototype": bare_metal_server_network_attachment_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.add_bare_metal_server_network_interface_floating_ip(**req_copy)
+ _service.create_bare_metal_server_network_attachment(**req_copy)
- def test_add_bare_metal_server_network_interface_floating_ip_value_error_with_retries(self):
- # Enable retries and run test_add_bare_metal_server_network_interface_floating_ip_value_error.
+ def test_create_bare_metal_server_network_attachment_value_error_with_retries(self):
+ # Enable retries and run test_create_bare_metal_server_network_attachment_value_error.
_service.enable_retries()
- self.test_add_bare_metal_server_network_interface_floating_ip_value_error()
+ self.test_create_bare_metal_server_network_attachment_value_error()
- # Disable retries and run test_add_bare_metal_server_network_interface_floating_ip_value_error.
+ # Disable retries and run test_create_bare_metal_server_network_attachment_value_error.
_service.disable_retries()
- self.test_add_bare_metal_server_network_interface_floating_ip_value_error()
+ self.test_create_bare_metal_server_network_attachment_value_error()
-class TestListBareMetalServerNetworkInterfaceIps:
+class TestDeleteBareMetalServerNetworkAttachment:
"""
- Test Class for list_bare_metal_server_network_interface_ips
+ Test Class for delete_bare_metal_server_network_attachment
"""
@responses.activate
- def test_list_bare_metal_server_network_interface_ips_all_params(self):
+ def test_delete_bare_metal_server_network_attachment_all_params(self):
"""
- list_bare_metal_server_network_interface_ips()
+ delete_bare_metal_server_network_attachment()
"""
# Set up mock
- url = preprocess_url('/bare_metal_servers/testString/network_interfaces/testString/ips')
- mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e/ips?limit=20"}, "ips": [{"address": "192.168.3.4", "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "lifecycle_state": "stable", "name": "my-reserved-ip", "owner": "user", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "name": "my-endpoint-gateway", "resource_type": "endpoint_gateway"}}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e/ips?start=a404e343444b4e1095c9edba76672d67&limit=20"}, "total_count": 132}'
+ url = preprocess_url('/bare_metal_servers/testString/network_attachments/testString')
responses.add(
- responses.GET,
+ responses.DELETE,
url,
- body=mock_response,
- content_type='application/json',
- status=200,
+ status=202,
)
# Set up parameter values
bare_metal_server_id = 'testString'
- network_interface_id = 'testString'
+ id = 'testString'
# Invoke method
- response = _service.list_bare_metal_server_network_interface_ips(
+ response = _service.delete_bare_metal_server_network_attachment(
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 == 202
- def test_list_bare_metal_server_network_interface_ips_all_params_with_retries(self):
- # Enable retries and run test_list_bare_metal_server_network_interface_ips_all_params.
+ def test_delete_bare_metal_server_network_attachment_all_params_with_retries(self):
+ # Enable retries and run test_delete_bare_metal_server_network_attachment_all_params.
_service.enable_retries()
- self.test_list_bare_metal_server_network_interface_ips_all_params()
+ self.test_delete_bare_metal_server_network_attachment_all_params()
- # Disable retries and run test_list_bare_metal_server_network_interface_ips_all_params.
+ # Disable retries and run test_delete_bare_metal_server_network_attachment_all_params.
_service.disable_retries()
- self.test_list_bare_metal_server_network_interface_ips_all_params()
+ self.test_delete_bare_metal_server_network_attachment_all_params()
@responses.activate
- def test_list_bare_metal_server_network_interface_ips_value_error(self):
+ def test_delete_bare_metal_server_network_attachment_value_error(self):
"""
- test_list_bare_metal_server_network_interface_ips_value_error()
+ test_delete_bare_metal_server_network_attachment_value_error()
"""
# Set up mock
- url = preprocess_url('/bare_metal_servers/testString/network_interfaces/testString/ips')
- mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e/ips?limit=20"}, "ips": [{"address": "192.168.3.4", "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "lifecycle_state": "stable", "name": "my-reserved-ip", "owner": "user", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "name": "my-endpoint-gateway", "resource_type": "endpoint_gateway"}}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e/ips?start=a404e343444b4e1095c9edba76672d67&limit=20"}, "total_count": 132}'
+ url = preprocess_url('/bare_metal_servers/testString/network_attachments/testString')
responses.add(
- responses.GET,
+ responses.DELETE,
url,
- body=mock_response,
- content_type='application/json',
- status=200,
+ status=202,
)
# Set up parameter values
bare_metal_server_id = 'testString'
- network_interface_id = 'testString'
+ id = 'testString'
# Pass in all but one required param and check for a ValueError
req_param_dict = {
"bare_metal_server_id": bare_metal_server_id,
- "network_interface_id": network_interface_id,
+ "id": id,
}
for param in req_param_dict.keys():
req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()}
with pytest.raises(ValueError):
- _service.list_bare_metal_server_network_interface_ips(**req_copy)
+ _service.delete_bare_metal_server_network_attachment(**req_copy)
- def test_list_bare_metal_server_network_interface_ips_value_error_with_retries(self):
- # Enable retries and run test_list_bare_metal_server_network_interface_ips_value_error.
+ def test_delete_bare_metal_server_network_attachment_value_error_with_retries(self):
+ # Enable retries and run test_delete_bare_metal_server_network_attachment_value_error.
_service.enable_retries()
- self.test_list_bare_metal_server_network_interface_ips_value_error()
+ self.test_delete_bare_metal_server_network_attachment_value_error()
- # Disable retries and run test_list_bare_metal_server_network_interface_ips_value_error.
+ # Disable retries and run test_delete_bare_metal_server_network_attachment_value_error.
_service.disable_retries()
- self.test_list_bare_metal_server_network_interface_ips_value_error()
+ self.test_delete_bare_metal_server_network_attachment_value_error()
-class TestGetBareMetalServerNetworkInterfaceIp:
+class TestGetBareMetalServerNetworkAttachment:
"""
- Test Class for get_bare_metal_server_network_interface_ip
+ Test Class for get_bare_metal_server_network_attachment
"""
@responses.activate
- def test_get_bare_metal_server_network_interface_ip_all_params(self):
+ def test_get_bare_metal_server_network_attachment_all_params(self):
"""
- get_bare_metal_server_network_interface_ip()
+ get_bare_metal_server_network_attachment()
"""
# Set up mock
- url = preprocess_url('/bare_metal_servers/testString/network_interfaces/testString/ips/testString')
- mock_response = '{"address": "192.168.3.4", "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "lifecycle_state": "stable", "name": "my-reserved-ip", "owner": "user", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "name": "my-endpoint-gateway", "resource_type": "endpoint_gateway"}}'
+ url = preprocess_url('/bare_metal_servers/testString/network_attachments/testString')
+ mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/2302-f7a2bf57-af7c-49d9-b599-b2c91293d30c/network_attachments/2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "lifecycle_state": "stable", "name": "my-bare-metal-server-network-attachment", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "bare_metal_server_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary", "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "id": "0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}, "allowed_vlans": [4], "interface_type": "pci"}'
responses.add(
responses.GET,
url,
@@ -21684,13 +22818,11 @@ def test_get_bare_metal_server_network_interface_ip_all_params(self):
# Set up parameter values
bare_metal_server_id = 'testString'
- network_interface_id = 'testString'
id = 'testString'
# Invoke method
- response = _service.get_bare_metal_server_network_interface_ip(
+ response = _service.get_bare_metal_server_network_attachment(
bare_metal_server_id,
- network_interface_id,
id,
headers={},
)
@@ -21699,23 +22831,23 @@ def test_get_bare_metal_server_network_interface_ip_all_params(self):
assert len(responses.calls) == 1
assert response.status_code == 200
- def test_get_bare_metal_server_network_interface_ip_all_params_with_retries(self):
- # Enable retries and run test_get_bare_metal_server_network_interface_ip_all_params.
+ def test_get_bare_metal_server_network_attachment_all_params_with_retries(self):
+ # Enable retries and run test_get_bare_metal_server_network_attachment_all_params.
_service.enable_retries()
- self.test_get_bare_metal_server_network_interface_ip_all_params()
+ self.test_get_bare_metal_server_network_attachment_all_params()
- # Disable retries and run test_get_bare_metal_server_network_interface_ip_all_params.
+ # Disable retries and run test_get_bare_metal_server_network_attachment_all_params.
_service.disable_retries()
- self.test_get_bare_metal_server_network_interface_ip_all_params()
+ self.test_get_bare_metal_server_network_attachment_all_params()
@responses.activate
- def test_get_bare_metal_server_network_interface_ip_value_error(self):
+ def test_get_bare_metal_server_network_attachment_value_error(self):
"""
- test_get_bare_metal_server_network_interface_ip_value_error()
+ test_get_bare_metal_server_network_attachment_value_error()
"""
# Set up mock
- url = preprocess_url('/bare_metal_servers/testString/network_interfaces/testString/ips/testString')
- mock_response = '{"address": "192.168.3.4", "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "lifecycle_state": "stable", "name": "my-reserved-ip", "owner": "user", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "name": "my-endpoint-gateway", "resource_type": "endpoint_gateway"}}'
+ url = preprocess_url('/bare_metal_servers/testString/network_attachments/testString')
+ mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/2302-f7a2bf57-af7c-49d9-b599-b2c91293d30c/network_attachments/2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "lifecycle_state": "stable", "name": "my-bare-metal-server-network-attachment", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "bare_metal_server_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary", "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "id": "0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}, "allowed_vlans": [4], "interface_type": "pci"}'
responses.add(
responses.GET,
url,
@@ -21726,118 +22858,143 @@ def test_get_bare_metal_server_network_interface_ip_value_error(self):
# Set up parameter values
bare_metal_server_id = 'testString'
- network_interface_id = 'testString'
id = 'testString'
# Pass in all but one required param and check for a ValueError
req_param_dict = {
"bare_metal_server_id": bare_metal_server_id,
- "network_interface_id": network_interface_id,
"id": id,
}
for param in req_param_dict.keys():
req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()}
with pytest.raises(ValueError):
- _service.get_bare_metal_server_network_interface_ip(**req_copy)
+ _service.get_bare_metal_server_network_attachment(**req_copy)
- def test_get_bare_metal_server_network_interface_ip_value_error_with_retries(self):
- # Enable retries and run test_get_bare_metal_server_network_interface_ip_value_error.
+ def test_get_bare_metal_server_network_attachment_value_error_with_retries(self):
+ # Enable retries and run test_get_bare_metal_server_network_attachment_value_error.
_service.enable_retries()
- self.test_get_bare_metal_server_network_interface_ip_value_error()
+ self.test_get_bare_metal_server_network_attachment_value_error()
- # Disable retries and run test_get_bare_metal_server_network_interface_ip_value_error.
+ # Disable retries and run test_get_bare_metal_server_network_attachment_value_error.
_service.disable_retries()
- self.test_get_bare_metal_server_network_interface_ip_value_error()
+ self.test_get_bare_metal_server_network_attachment_value_error()
-class TestDeleteBareMetalServer:
+class TestUpdateBareMetalServerNetworkAttachment:
"""
- Test Class for delete_bare_metal_server
+ Test Class for update_bare_metal_server_network_attachment
"""
@responses.activate
- def test_delete_bare_metal_server_all_params(self):
+ def test_update_bare_metal_server_network_attachment_all_params(self):
"""
- delete_bare_metal_server()
+ update_bare_metal_server_network_attachment()
"""
# Set up mock
- url = preprocess_url('/bare_metal_servers/testString')
+ url = preprocess_url('/bare_metal_servers/testString/network_attachments/testString')
+ mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/2302-f7a2bf57-af7c-49d9-b599-b2c91293d30c/network_attachments/2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "lifecycle_state": "stable", "name": "my-bare-metal-server-network-attachment", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "bare_metal_server_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary", "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "id": "0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}, "allowed_vlans": [4], "interface_type": "pci"}'
responses.add(
- responses.DELETE,
+ responses.PATCH,
url,
- status=202,
+ body=mock_response,
+ content_type='application/json',
+ status=200,
)
+ # Construct a dict representation of a BareMetalServerNetworkAttachmentPatch model
+ bare_metal_server_network_attachment_patch_model = {}
+ bare_metal_server_network_attachment_patch_model['allowed_vlans'] = [4]
+ bare_metal_server_network_attachment_patch_model['name'] = 'my-bare-metal-server-network-attachment-updated'
+
# Set up parameter values
+ bare_metal_server_id = 'testString'
id = 'testString'
+ bare_metal_server_network_attachment_patch = bare_metal_server_network_attachment_patch_model
# Invoke method
- response = _service.delete_bare_metal_server(
+ response = _service.update_bare_metal_server_network_attachment(
+ bare_metal_server_id,
id,
+ bare_metal_server_network_attachment_patch,
headers={},
)
# Check for correct operation
assert len(responses.calls) == 1
- assert response.status_code == 202
+ 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_network_attachment_patch
- def test_delete_bare_metal_server_all_params_with_retries(self):
- # Enable retries and run test_delete_bare_metal_server_all_params.
+ def test_update_bare_metal_server_network_attachment_all_params_with_retries(self):
+ # Enable retries and run test_update_bare_metal_server_network_attachment_all_params.
_service.enable_retries()
- self.test_delete_bare_metal_server_all_params()
+ self.test_update_bare_metal_server_network_attachment_all_params()
- # Disable retries and run test_delete_bare_metal_server_all_params.
+ # Disable retries and run test_update_bare_metal_server_network_attachment_all_params.
_service.disable_retries()
- self.test_delete_bare_metal_server_all_params()
+ self.test_update_bare_metal_server_network_attachment_all_params()
@responses.activate
- def test_delete_bare_metal_server_value_error(self):
+ def test_update_bare_metal_server_network_attachment_value_error(self):
"""
- test_delete_bare_metal_server_value_error()
+ test_update_bare_metal_server_network_attachment_value_error()
"""
# Set up mock
- url = preprocess_url('/bare_metal_servers/testString')
+ url = preprocess_url('/bare_metal_servers/testString/network_attachments/testString')
+ mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/2302-f7a2bf57-af7c-49d9-b599-b2c91293d30c/network_attachments/2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "lifecycle_state": "stable", "name": "my-bare-metal-server-network-attachment", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "bare_metal_server_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary", "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "id": "0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}, "allowed_vlans": [4], "interface_type": "pci"}'
responses.add(
- responses.DELETE,
+ responses.PATCH,
url,
- status=202,
+ body=mock_response,
+ content_type='application/json',
+ status=200,
)
+ # Construct a dict representation of a BareMetalServerNetworkAttachmentPatch model
+ bare_metal_server_network_attachment_patch_model = {}
+ bare_metal_server_network_attachment_patch_model['allowed_vlans'] = [4]
+ bare_metal_server_network_attachment_patch_model['name'] = 'my-bare-metal-server-network-attachment-updated'
+
# Set up parameter values
+ bare_metal_server_id = 'testString'
id = 'testString'
+ bare_metal_server_network_attachment_patch = bare_metal_server_network_attachment_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,
+ "bare_metal_server_network_attachment_patch": bare_metal_server_network_attachment_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_bare_metal_server(**req_copy)
+ _service.update_bare_metal_server_network_attachment(**req_copy)
- def test_delete_bare_metal_server_value_error_with_retries(self):
- # Enable retries and run test_delete_bare_metal_server_value_error.
+ def test_update_bare_metal_server_network_attachment_value_error_with_retries(self):
+ # Enable retries and run test_update_bare_metal_server_network_attachment_value_error.
_service.enable_retries()
- self.test_delete_bare_metal_server_value_error()
+ self.test_update_bare_metal_server_network_attachment_value_error()
- # Disable retries and run test_delete_bare_metal_server_value_error.
+ # Disable retries and run test_update_bare_metal_server_network_attachment_value_error.
_service.disable_retries()
- self.test_delete_bare_metal_server_value_error()
+ self.test_update_bare_metal_server_network_attachment_value_error()
-class TestGetBareMetalServer:
+class TestListBareMetalServerNetworkInterfaces:
"""
- Test Class for get_bare_metal_server
+ Test Class for list_bare_metal_server_network_interfaces
"""
@responses.activate
- def test_get_bare_metal_server_all_params(self):
+ def test_list_bare_metal_server_network_interfaces_all_params(self):
"""
- get_bare_metal_server()
+ list_bare_metal_server_network_interfaces()
"""
# Set up mock
- url = preprocess_url('/bare_metal_servers/testString')
- mock_response = '{"bandwidth": 20000, "boot_target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-bare-metal-server-disk", "resource_type": "bare_metal_server_disk"}, "cpu": {"architecture": "amd64", "core_count": 80, "socket_count": 4, "threads_per_core": 2}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::bare-metal-server:1e09281b-f177-46fb-baf1-bc152b2e391a", "disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "fcp", "name": "my-bare-metal-server-disk", "resource_type": "bare_metal_server_disk", "size": 100}], "enable_secure_boot": false, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "memory": 1536, "name": "my-bare-metal-server", "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-bare-metal-server-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}], "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-bare-metal-server-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768", "name": "bx2-metal-192x768", "resource_type": "bare_metal_server_profile"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "bare_metal_server", "status": "deleting", "status_reasons": [{"code": "cannot_start_capacity", "message": "The bare metal server cannot start as there is no more capacity in this\nzone for a bare metal server with the requested profile.", "more_info": "https://console.bluemix.net/docs/iaas/bare_metal_server.html"}], "trusted_platform_module": {"enabled": true, "mode": "disabled", "supported_modes": ["disabled"]}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
+ url = preprocess_url('/bare_metal_servers/testString/network_interfaces')
+ mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/3b2669a2-4c2b-4003-bc91-1b81f1326267/network_interfaces?limit=20"}, "limit": 20, "network_interfaces": [{"allow_ip_spoofing": true, "created_at": "2019-01-01T12:00:00.000Z", "enable_infrastructure_nat": true, "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}], "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "mac_address": "02:00:04:00:C4:6A", "name": "my-bare-metal-server-network-interface", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary", "interface_type": "hipersocket"}], "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/3b2669a2-4c2b-4003-bc91-1b81f1326267/network_interfaces?start=d3e721fd-c988-4670-9927-dbd5e7b07fc6&limit=20"}, "total_count": 132}'
responses.add(
responses.GET,
url,
@@ -21847,35 +23004,44 @@ def test_get_bare_metal_server_all_params(self):
)
# Set up parameter values
- id = 'testString'
+ bare_metal_server_id = 'testString'
+ start = 'testString'
+ limit = 50
# Invoke method
- response = _service.get_bare_metal_server(
- id,
+ response = _service.list_bare_metal_server_network_interfaces(
+ bare_metal_server_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_get_bare_metal_server_all_params_with_retries(self):
- # Enable retries and run test_get_bare_metal_server_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_get_bare_metal_server_all_params()
+ self.test_list_bare_metal_server_network_interfaces_all_params()
- # Disable retries and run test_get_bare_metal_server_all_params.
+ # Disable retries and run test_list_bare_metal_server_network_interfaces_all_params.
_service.disable_retries()
- self.test_get_bare_metal_server_all_params()
+ self.test_list_bare_metal_server_network_interfaces_all_params()
@responses.activate
- def test_get_bare_metal_server_value_error(self):
+ def test_list_bare_metal_server_network_interfaces_required_params(self):
"""
- test_get_bare_metal_server_value_error()
+ test_list_bare_metal_server_network_interfaces_required_params()
"""
# Set up mock
- url = preprocess_url('/bare_metal_servers/testString')
- mock_response = '{"bandwidth": 20000, "boot_target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-bare-metal-server-disk", "resource_type": "bare_metal_server_disk"}, "cpu": {"architecture": "amd64", "core_count": 80, "socket_count": 4, "threads_per_core": 2}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::bare-metal-server:1e09281b-f177-46fb-baf1-bc152b2e391a", "disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "fcp", "name": "my-bare-metal-server-disk", "resource_type": "bare_metal_server_disk", "size": 100}], "enable_secure_boot": false, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "memory": 1536, "name": "my-bare-metal-server", "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-bare-metal-server-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}], "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-bare-metal-server-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768", "name": "bx2-metal-192x768", "resource_type": "bare_metal_server_profile"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "bare_metal_server", "status": "deleting", "status_reasons": [{"code": "cannot_start_capacity", "message": "The bare metal server cannot start as there is no more capacity in this\nzone for a bare metal server with the requested profile.", "more_info": "https://console.bluemix.net/docs/iaas/bare_metal_server.html"}], "trusted_platform_module": {"enabled": true, "mode": "disabled", "supported_modes": ["disabled"]}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
+ url = preprocess_url('/bare_metal_servers/testString/network_interfaces')
+ mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/3b2669a2-4c2b-4003-bc91-1b81f1326267/network_interfaces?limit=20"}, "limit": 20, "network_interfaces": [{"allow_ip_spoofing": true, "created_at": "2019-01-01T12:00:00.000Z", "enable_infrastructure_nat": true, "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}], "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "mac_address": "02:00:04:00:C4:6A", "name": "my-bare-metal-server-network-interface", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary", "interface_type": "hipersocket"}], "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/3b2669a2-4c2b-4003-bc91-1b81f1326267/network_interfaces?start=d3e721fd-c988-4670-9927-dbd5e7b07fc6&limit=20"}, "total_count": 132}'
responses.add(
responses.GET,
url,
@@ -21885,563 +23051,723 @@ def test_get_bare_metal_server_value_error(self):
)
# Set up parameter values
- id = 'testString'
+ 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_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_bare_metal_server_network_interfaces_required_params()
+
+ # Disable retries and run test_list_bare_metal_server_network_interfaces_required_params.
+ _service.disable_retries()
+ self.test_list_bare_metal_server_network_interfaces_required_params()
+
+ @responses.activate
+ def test_list_bare_metal_server_network_interfaces_value_error(self):
+ """
+ test_list_bare_metal_server_network_interfaces_value_error()
+ """
+ # Set up mock
+ url = preprocess_url('/bare_metal_servers/testString/network_interfaces')
+ mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/3b2669a2-4c2b-4003-bc91-1b81f1326267/network_interfaces?limit=20"}, "limit": 20, "network_interfaces": [{"allow_ip_spoofing": true, "created_at": "2019-01-01T12:00:00.000Z", "enable_infrastructure_nat": true, "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}], "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "mac_address": "02:00:04:00:C4:6A", "name": "my-bare-metal-server-network-interface", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary", "interface_type": "hipersocket"}], "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/3b2669a2-4c2b-4003-bc91-1b81f1326267/network_interfaces?start=d3e721fd-c988-4670-9927-dbd5e7b07fc6&limit=20"}, "total_count": 132}'
+ responses.add(
+ responses.GET,
+ url,
+ 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 = {
- "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_bare_metal_server(**req_copy)
+ _service.list_bare_metal_server_network_interfaces(**req_copy)
- def test_get_bare_metal_server_value_error_with_retries(self):
- # Enable retries and run test_get_bare_metal_server_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_get_bare_metal_server_value_error()
+ self.test_list_bare_metal_server_network_interfaces_value_error()
- # Disable retries and run test_get_bare_metal_server_value_error.
+ # Disable retries and run test_list_bare_metal_server_network_interfaces_value_error.
_service.disable_retries()
- self.test_get_bare_metal_server_value_error()
+ self.test_list_bare_metal_server_network_interfaces_value_error()
+
+ @responses.activate
+ def test_list_bare_metal_server_network_interfaces_with_pager_get_next(self):
+ """
+ test_list_bare_metal_server_network_interfaces_with_pager_get_next()
+ """
+ # Set up a two-page mock response
+ url = preprocess_url('/bare_metal_servers/testString/network_interfaces')
+ mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"network_interfaces":[{"allow_ip_spoofing":true,"created_at":"2019-01-01T12:00:00.000Z","enable_infrastructure_nat":true,"floating_ips":[{"address":"203.0.113.1","crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689","id":"39300233-9995-4806-89a5-3c1b6eb88689","name":"my-floating-ip"}],"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","mac_address":"02:00:04:00:C4:6A","name":"my-bare-metal-server-network-interface","port_speed":1000,"primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"network_interface","security_groups":[{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271","id":"be5df5ca-12a0-494b-907e-aa6ec2bfa271","name":"my-security-group"}],"status":"available","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"},"type":"primary","interface_type":"hipersocket"}]}'
+ mock_response2 = '{"total_count":2,"limit":1,"network_interfaces":[{"allow_ip_spoofing":true,"created_at":"2019-01-01T12:00:00.000Z","enable_infrastructure_nat":true,"floating_ips":[{"address":"203.0.113.1","crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689","id":"39300233-9995-4806-89a5-3c1b6eb88689","name":"my-floating-ip"}],"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","mac_address":"02:00:04:00:C4:6A","name":"my-bare-metal-server-network-interface","port_speed":1000,"primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"network_interface","security_groups":[{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271","id":"be5df5ca-12a0-494b-907e-aa6ec2bfa271","name":"my-security-group"}],"status":"available","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"},"type":"primary","interface_type":"hipersocket"}]}'
+ responses.add(
+ responses.GET,
+ url,
+ body=mock_response1,
+ content_type='application/json',
+ status=200,
+ )
+ responses.add(
+ responses.GET,
+ url,
+ body=mock_response2,
+ content_type='application/json',
+ status=200,
+ )
+ # Exercise the pager class for this operation
+ all_results = []
+ pager = BareMetalServerNetworkInterfacesPager(
+ client=_service,
+ bare_metal_server_id='testString',
+ limit=10,
+ )
+ while pager.has_next():
+ next_page = pager.get_next()
+ assert next_page is not None
+ all_results.extend(next_page)
+ assert len(all_results) == 2
-class TestUpdateBareMetalServer:
+ @responses.activate
+ def test_list_bare_metal_server_network_interfaces_with_pager_get_all(self):
+ """
+ test_list_bare_metal_server_network_interfaces_with_pager_get_all()
+ """
+ # Set up a two-page mock response
+ url = preprocess_url('/bare_metal_servers/testString/network_interfaces')
+ mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"network_interfaces":[{"allow_ip_spoofing":true,"created_at":"2019-01-01T12:00:00.000Z","enable_infrastructure_nat":true,"floating_ips":[{"address":"203.0.113.1","crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689","id":"39300233-9995-4806-89a5-3c1b6eb88689","name":"my-floating-ip"}],"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","mac_address":"02:00:04:00:C4:6A","name":"my-bare-metal-server-network-interface","port_speed":1000,"primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"network_interface","security_groups":[{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271","id":"be5df5ca-12a0-494b-907e-aa6ec2bfa271","name":"my-security-group"}],"status":"available","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"},"type":"primary","interface_type":"hipersocket"}]}'
+ mock_response2 = '{"total_count":2,"limit":1,"network_interfaces":[{"allow_ip_spoofing":true,"created_at":"2019-01-01T12:00:00.000Z","enable_infrastructure_nat":true,"floating_ips":[{"address":"203.0.113.1","crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689","id":"39300233-9995-4806-89a5-3c1b6eb88689","name":"my-floating-ip"}],"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","mac_address":"02:00:04:00:C4:6A","name":"my-bare-metal-server-network-interface","port_speed":1000,"primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"network_interface","security_groups":[{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271","id":"be5df5ca-12a0-494b-907e-aa6ec2bfa271","name":"my-security-group"}],"status":"available","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"},"type":"primary","interface_type":"hipersocket"}]}'
+ responses.add(
+ responses.GET,
+ url,
+ body=mock_response1,
+ content_type='application/json',
+ status=200,
+ )
+ responses.add(
+ responses.GET,
+ url,
+ body=mock_response2,
+ content_type='application/json',
+ status=200,
+ )
+
+ # Exercise the pager class for this operation
+ pager = BareMetalServerNetworkInterfacesPager(
+ client=_service,
+ bare_metal_server_id='testString',
+ limit=10,
+ )
+ all_results = pager.get_all()
+ assert all_results is not None
+ assert len(all_results) == 2
+
+
+class TestCreateBareMetalServerNetworkInterface:
"""
- Test Class for update_bare_metal_server
+ Test Class for create_bare_metal_server_network_interface
"""
@responses.activate
- def test_update_bare_metal_server_all_params(self):
+ def test_create_bare_metal_server_network_interface_all_params(self):
"""
- update_bare_metal_server()
+ create_bare_metal_server_network_interface()
"""
# Set up mock
- url = preprocess_url('/bare_metal_servers/testString')
- mock_response = '{"bandwidth": 20000, "boot_target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-bare-metal-server-disk", "resource_type": "bare_metal_server_disk"}, "cpu": {"architecture": "amd64", "core_count": 80, "socket_count": 4, "threads_per_core": 2}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::bare-metal-server:1e09281b-f177-46fb-baf1-bc152b2e391a", "disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "fcp", "name": "my-bare-metal-server-disk", "resource_type": "bare_metal_server_disk", "size": 100}], "enable_secure_boot": false, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "memory": 1536, "name": "my-bare-metal-server", "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-bare-metal-server-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}], "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-bare-metal-server-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768", "name": "bx2-metal-192x768", "resource_type": "bare_metal_server_profile"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "bare_metal_server", "status": "deleting", "status_reasons": [{"code": "cannot_start_capacity", "message": "The bare metal server cannot start as there is no more capacity in this\nzone for a bare metal server with the requested profile.", "more_info": "https://console.bluemix.net/docs/iaas/bare_metal_server.html"}], "trusted_platform_module": {"enabled": true, "mode": "disabled", "supported_modes": ["disabled"]}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
+ url = preprocess_url('/bare_metal_servers/testString/network_interfaces')
+ mock_response = '{"allow_ip_spoofing": true, "created_at": "2019-01-01T12:00:00.000Z", "enable_infrastructure_nat": true, "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}], "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "mac_address": "02:00:04:00:C4:6A", "name": "my-bare-metal-server-network-interface", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary", "interface_type": "hipersocket"}'
responses.add(
- responses.PATCH,
+ responses.POST,
url,
body=mock_response,
content_type='application/json',
- status=200,
+ status=201,
)
- # Construct a dict representation of a BareMetalServerTrustedPlatformModulePatch model
- bare_metal_server_trusted_platform_module_patch_model = {}
- bare_metal_server_trusted_platform_module_patch_model['mode'] = 'disabled'
+ # Construct a dict representation of a NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext model
+ network_interface_ip_prototype_model = {}
+ network_interface_ip_prototype_model['address'] = '10.0.0.5'
+ network_interface_ip_prototype_model['auto_delete'] = False
+ network_interface_ip_prototype_model['name'] = 'my-reserved-ip'
- # Construct a dict representation of a BareMetalServerPatch model
- bare_metal_server_patch_model = {}
- bare_metal_server_patch_model['enable_secure_boot'] = False
- bare_metal_server_patch_model['name'] = 'my-bare-metal-server'
- bare_metal_server_patch_model['trusted_platform_module'] = bare_metal_server_trusted_platform_module_patch_model
+ # 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 BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype model
+ bare_metal_server_network_interface_prototype_model = {}
+ bare_metal_server_network_interface_prototype_model['allow_ip_spoofing'] = True
+ bare_metal_server_network_interface_prototype_model['enable_infrastructure_nat'] = True
+ bare_metal_server_network_interface_prototype_model['name'] = 'my-bare-metal-server-network-interface'
+ bare_metal_server_network_interface_prototype_model['primary_ip'] = network_interface_ip_prototype_model
+ bare_metal_server_network_interface_prototype_model['security_groups'] = [security_group_identity_model]
+ bare_metal_server_network_interface_prototype_model['subnet'] = subnet_identity_model
+ bare_metal_server_network_interface_prototype_model['interface_type'] = 'hipersocket'
# Set up parameter values
- id = 'testString'
- bare_metal_server_patch = bare_metal_server_patch_model
+ bare_metal_server_id = 'testString'
+ bare_metal_server_network_interface_prototype = bare_metal_server_network_interface_prototype_model
# Invoke method
- response = _service.update_bare_metal_server(
- id,
- bare_metal_server_patch,
+ response = _service.create_bare_metal_server_network_interface(
+ bare_metal_server_id,
+ bare_metal_server_network_interface_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 == bare_metal_server_patch
+ assert req_body == bare_metal_server_network_interface_prototype
- def test_update_bare_metal_server_all_params_with_retries(self):
- # Enable retries and run test_update_bare_metal_server_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_update_bare_metal_server_all_params()
+ self.test_create_bare_metal_server_network_interface_all_params()
- # Disable retries and run test_update_bare_metal_server_all_params.
+ # Disable retries and run test_create_bare_metal_server_network_interface_all_params.
_service.disable_retries()
- self.test_update_bare_metal_server_all_params()
+ self.test_create_bare_metal_server_network_interface_all_params()
@responses.activate
- def test_update_bare_metal_server_value_error(self):
+ def test_create_bare_metal_server_network_interface_value_error(self):
"""
- test_update_bare_metal_server_value_error()
+ test_create_bare_metal_server_network_interface_value_error()
"""
# Set up mock
- url = preprocess_url('/bare_metal_servers/testString')
- mock_response = '{"bandwidth": 20000, "boot_target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-bare-metal-server-disk", "resource_type": "bare_metal_server_disk"}, "cpu": {"architecture": "amd64", "core_count": 80, "socket_count": 4, "threads_per_core": 2}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::bare-metal-server:1e09281b-f177-46fb-baf1-bc152b2e391a", "disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "fcp", "name": "my-bare-metal-server-disk", "resource_type": "bare_metal_server_disk", "size": 100}], "enable_secure_boot": false, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "memory": 1536, "name": "my-bare-metal-server", "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-bare-metal-server-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}], "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-bare-metal-server-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768", "name": "bx2-metal-192x768", "resource_type": "bare_metal_server_profile"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "bare_metal_server", "status": "deleting", "status_reasons": [{"code": "cannot_start_capacity", "message": "The bare metal server cannot start as there is no more capacity in this\nzone for a bare metal server with the requested profile.", "more_info": "https://console.bluemix.net/docs/iaas/bare_metal_server.html"}], "trusted_platform_module": {"enabled": true, "mode": "disabled", "supported_modes": ["disabled"]}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
+ url = preprocess_url('/bare_metal_servers/testString/network_interfaces')
+ mock_response = '{"allow_ip_spoofing": true, "created_at": "2019-01-01T12:00:00.000Z", "enable_infrastructure_nat": true, "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}], "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "mac_address": "02:00:04:00:C4:6A", "name": "my-bare-metal-server-network-interface", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary", "interface_type": "hipersocket"}'
responses.add(
- responses.PATCH,
+ responses.POST,
url,
body=mock_response,
content_type='application/json',
- status=200,
+ status=201,
)
- # Construct a dict representation of a BareMetalServerTrustedPlatformModulePatch model
- bare_metal_server_trusted_platform_module_patch_model = {}
- bare_metal_server_trusted_platform_module_patch_model['mode'] = 'disabled'
+ # Construct a dict representation of a NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext model
+ network_interface_ip_prototype_model = {}
+ network_interface_ip_prototype_model['address'] = '10.0.0.5'
+ network_interface_ip_prototype_model['auto_delete'] = False
+ network_interface_ip_prototype_model['name'] = 'my-reserved-ip'
- # Construct a dict representation of a BareMetalServerPatch model
- bare_metal_server_patch_model = {}
- bare_metal_server_patch_model['enable_secure_boot'] = False
- bare_metal_server_patch_model['name'] = 'my-bare-metal-server'
- bare_metal_server_patch_model['trusted_platform_module'] = bare_metal_server_trusted_platform_module_patch_model
+ # 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 BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype model
+ bare_metal_server_network_interface_prototype_model = {}
+ bare_metal_server_network_interface_prototype_model['allow_ip_spoofing'] = True
+ bare_metal_server_network_interface_prototype_model['enable_infrastructure_nat'] = True
+ bare_metal_server_network_interface_prototype_model['name'] = 'my-bare-metal-server-network-interface'
+ bare_metal_server_network_interface_prototype_model['primary_ip'] = network_interface_ip_prototype_model
+ bare_metal_server_network_interface_prototype_model['security_groups'] = [security_group_identity_model]
+ bare_metal_server_network_interface_prototype_model['subnet'] = subnet_identity_model
+ bare_metal_server_network_interface_prototype_model['interface_type'] = 'hipersocket'
# Set up parameter values
- id = 'testString'
- bare_metal_server_patch = bare_metal_server_patch_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 = {
- "id": id,
- "bare_metal_server_patch": bare_metal_server_patch,
+ "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.update_bare_metal_server(**req_copy)
+ _service.create_bare_metal_server_network_interface(**req_copy)
- def test_update_bare_metal_server_value_error_with_retries(self):
- # Enable retries and run test_update_bare_metal_server_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_update_bare_metal_server_value_error()
+ self.test_create_bare_metal_server_network_interface_value_error()
- # Disable retries and run test_update_bare_metal_server_value_error.
+ # Disable retries and run test_create_bare_metal_server_network_interface_value_error.
_service.disable_retries()
- self.test_update_bare_metal_server_value_error()
+ self.test_create_bare_metal_server_network_interface_value_error()
-class TestGetBareMetalServerInitialization:
+class TestDeleteBareMetalServerNetworkInterface:
"""
- Test Class for get_bare_metal_server_initialization
+ Test Class for delete_bare_metal_server_network_interface
"""
@responses.activate
- def test_get_bare_metal_server_initialization_all_params(self):
+ def test_delete_bare_metal_server_network_interface_all_params(self):
"""
- get_bare_metal_server_initialization()
+ delete_bare_metal_server_network_interface()
"""
# Set up mock
- url = preprocess_url('/bare_metal_servers/testString/initialization')
- mock_response = '{"image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image", "remote": {"account": {"id": "aa2432b1fa4d4ace891e9b80fc104e34", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "keys": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::key:a6b1a881-2ce8-41a3-80fc-36316a73f803", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "fingerprint": "SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY", "href": "https://us-south.iaas.cloud.ibm.com/v1/keys/a6b1a881-2ce8-41a3-80fc-36316a73f803", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "name": "my-key"}], "user_accounts": [{"encrypted_password": "qQ+/YEApnl1ZtEgIrfprzb065307thTkzlnLqL5ICpesdbBN03dyCQ==", "encryption_key": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::key:a6b1a881-2ce8-41a3-80fc-36316a73f803", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "fingerprint": "SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY", "href": "https://us-south.iaas.cloud.ibm.com/v1/keys/a6b1a881-2ce8-41a3-80fc-36316a73f803", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "name": "my-key"}, "resource_type": "host_user_account", "username": "Administrator"}]}'
+ url = preprocess_url('/bare_metal_servers/testString/network_interfaces/testString')
responses.add(
- responses.GET,
+ responses.DELETE,
url,
- body=mock_response,
- content_type='application/json',
- status=200,
+ status=204,
)
# Set up parameter values
+ bare_metal_server_id = 'testString'
id = 'testString'
# Invoke method
- response = _service.get_bare_metal_server_initialization(
+ response = _service.delete_bare_metal_server_network_interface(
+ bare_metal_server_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_bare_metal_server_initialization_all_params_with_retries(self):
- # Enable retries and run test_get_bare_metal_server_initialization_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_get_bare_metal_server_initialization_all_params()
+ self.test_delete_bare_metal_server_network_interface_all_params()
- # Disable retries and run test_get_bare_metal_server_initialization_all_params.
+ # Disable retries and run test_delete_bare_metal_server_network_interface_all_params.
_service.disable_retries()
- self.test_get_bare_metal_server_initialization_all_params()
+ self.test_delete_bare_metal_server_network_interface_all_params()
@responses.activate
- def test_get_bare_metal_server_initialization_value_error(self):
+ def test_delete_bare_metal_server_network_interface_value_error(self):
"""
- test_get_bare_metal_server_initialization_value_error()
+ test_delete_bare_metal_server_network_interface_value_error()
"""
# Set up mock
- url = preprocess_url('/bare_metal_servers/testString/initialization')
- mock_response = '{"image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image", "remote": {"account": {"id": "aa2432b1fa4d4ace891e9b80fc104e34", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "keys": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::key:a6b1a881-2ce8-41a3-80fc-36316a73f803", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "fingerprint": "SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY", "href": "https://us-south.iaas.cloud.ibm.com/v1/keys/a6b1a881-2ce8-41a3-80fc-36316a73f803", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "name": "my-key"}], "user_accounts": [{"encrypted_password": "qQ+/YEApnl1ZtEgIrfprzb065307thTkzlnLqL5ICpesdbBN03dyCQ==", "encryption_key": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::key:a6b1a881-2ce8-41a3-80fc-36316a73f803", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "fingerprint": "SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY", "href": "https://us-south.iaas.cloud.ibm.com/v1/keys/a6b1a881-2ce8-41a3-80fc-36316a73f803", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "name": "my-key"}, "resource_type": "host_user_account", "username": "Administrator"}]}'
+ url = preprocess_url('/bare_metal_servers/testString/network_interfaces/testString')
responses.add(
- responses.GET,
+ responses.DELETE,
url,
- body=mock_response,
- content_type='application/json',
- status=200,
+ 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.get_bare_metal_server_initialization(**req_copy)
+ _service.delete_bare_metal_server_network_interface(**req_copy)
- def test_get_bare_metal_server_initialization_value_error_with_retries(self):
- # Enable retries and run test_get_bare_metal_server_initialization_value_error.
+ 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_get_bare_metal_server_initialization_value_error()
+ self.test_delete_bare_metal_server_network_interface_value_error()
- # Disable retries and run test_get_bare_metal_server_initialization_value_error.
+ # Disable retries and run test_delete_bare_metal_server_network_interface_value_error.
_service.disable_retries()
- self.test_get_bare_metal_server_initialization_value_error()
+ self.test_delete_bare_metal_server_network_interface_value_error()
-class TestRestartBareMetalServer:
+class TestGetBareMetalServerNetworkInterface:
"""
- Test Class for restart_bare_metal_server
+ Test Class for get_bare_metal_server_network_interface
"""
@responses.activate
- def test_restart_bare_metal_server_all_params(self):
+ def test_get_bare_metal_server_network_interface_all_params(self):
"""
- restart_bare_metal_server()
+ get_bare_metal_server_network_interface()
"""
# Set up mock
- url = preprocess_url('/bare_metal_servers/testString/restart')
+ url = preprocess_url('/bare_metal_servers/testString/network_interfaces/testString')
+ mock_response = '{"allow_ip_spoofing": true, "created_at": "2019-01-01T12:00:00.000Z", "enable_infrastructure_nat": true, "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}], "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "mac_address": "02:00:04:00:C4:6A", "name": "my-bare-metal-server-network-interface", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary", "interface_type": "hipersocket"}'
responses.add(
- responses.POST,
+ responses.GET,
url,
- status=204,
+ body=mock_response,
+ content_type='application/json',
+ status=200,
)
# Set up parameter values
+ bare_metal_server_id = 'testString'
id = 'testString'
# Invoke method
- response = _service.restart_bare_metal_server(
+ response = _service.get_bare_metal_server_network_interface(
+ bare_metal_server_id,
id,
headers={},
)
# Check for correct operation
assert len(responses.calls) == 1
- assert response.status_code == 204
+ assert response.status_code == 200
- def test_restart_bare_metal_server_all_params_with_retries(self):
- # Enable retries and run test_restart_bare_metal_server_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_restart_bare_metal_server_all_params()
+ self.test_get_bare_metal_server_network_interface_all_params()
- # Disable retries and run test_restart_bare_metal_server_all_params.
+ # Disable retries and run test_get_bare_metal_server_network_interface_all_params.
_service.disable_retries()
- self.test_restart_bare_metal_server_all_params()
+ self.test_get_bare_metal_server_network_interface_all_params()
@responses.activate
- def test_restart_bare_metal_server_value_error(self):
+ def test_get_bare_metal_server_network_interface_value_error(self):
"""
- test_restart_bare_metal_server_value_error()
+ test_get_bare_metal_server_network_interface_value_error()
"""
# Set up mock
- url = preprocess_url('/bare_metal_servers/testString/restart')
+ url = preprocess_url('/bare_metal_servers/testString/network_interfaces/testString')
+ mock_response = '{"allow_ip_spoofing": true, "created_at": "2019-01-01T12:00:00.000Z", "enable_infrastructure_nat": true, "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}], "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "mac_address": "02:00:04:00:C4:6A", "name": "my-bare-metal-server-network-interface", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary", "interface_type": "hipersocket"}'
responses.add(
- responses.POST,
+ responses.GET,
url,
- status=204,
+ body=mock_response,
+ content_type='application/json',
+ 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.restart_bare_metal_server(**req_copy)
+ _service.get_bare_metal_server_network_interface(**req_copy)
- def test_restart_bare_metal_server_value_error_with_retries(self):
- # Enable retries and run test_restart_bare_metal_server_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_restart_bare_metal_server_value_error()
+ self.test_get_bare_metal_server_network_interface_value_error()
- # Disable retries and run test_restart_bare_metal_server_value_error.
+ # Disable retries and run test_get_bare_metal_server_network_interface_value_error.
_service.disable_retries()
- self.test_restart_bare_metal_server_value_error()
+ self.test_get_bare_metal_server_network_interface_value_error()
-class TestStartBareMetalServer:
+class TestUpdateBareMetalServerNetworkInterface:
"""
- Test Class for start_bare_metal_server
+ Test Class for update_bare_metal_server_network_interface
"""
@responses.activate
- def test_start_bare_metal_server_all_params(self):
+ def test_update_bare_metal_server_network_interface_all_params(self):
"""
- start_bare_metal_server()
+ update_bare_metal_server_network_interface()
"""
# Set up mock
- url = preprocess_url('/bare_metal_servers/testString/start')
+ url = preprocess_url('/bare_metal_servers/testString/network_interfaces/testString')
+ mock_response = '{"allow_ip_spoofing": true, "created_at": "2019-01-01T12:00:00.000Z", "enable_infrastructure_nat": true, "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}], "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "mac_address": "02:00:04:00:C4:6A", "name": "my-bare-metal-server-network-interface", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary", "interface_type": "hipersocket"}'
responses.add(
- responses.POST,
+ responses.PATCH,
url,
- status=204,
+ body=mock_response,
+ content_type='application/json',
+ status=200,
)
+ # 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-bare-metal-server-network-interface'
+
# Set up parameter values
+ bare_metal_server_id = 'testString'
id = 'testString'
+ bare_metal_server_network_interface_patch = bare_metal_server_network_interface_patch_model
# Invoke method
- response = _service.start_bare_metal_server(
+ response = _service.update_bare_metal_server_network_interface(
+ bare_metal_server_id,
id,
+ bare_metal_server_network_interface_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 == bare_metal_server_network_interface_patch
- def test_start_bare_metal_server_all_params_with_retries(self):
- # Enable retries and run test_start_bare_metal_server_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_start_bare_metal_server_all_params()
+ self.test_update_bare_metal_server_network_interface_all_params()
- # Disable retries and run test_start_bare_metal_server_all_params.
+ # Disable retries and run test_update_bare_metal_server_network_interface_all_params.
_service.disable_retries()
- self.test_start_bare_metal_server_all_params()
+ self.test_update_bare_metal_server_network_interface_all_params()
@responses.activate
- def test_start_bare_metal_server_value_error(self):
+ def test_update_bare_metal_server_network_interface_value_error(self):
"""
- test_start_bare_metal_server_value_error()
+ test_update_bare_metal_server_network_interface_value_error()
"""
# Set up mock
- url = preprocess_url('/bare_metal_servers/testString/start')
+ url = preprocess_url('/bare_metal_servers/testString/network_interfaces/testString')
+ mock_response = '{"allow_ip_spoofing": true, "created_at": "2019-01-01T12:00:00.000Z", "enable_infrastructure_nat": true, "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}], "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "mac_address": "02:00:04:00:C4:6A", "name": "my-bare-metal-server-network-interface", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary", "interface_type": "hipersocket"}'
responses.add(
- responses.POST,
+ responses.PATCH,
url,
- status=204,
+ body=mock_response,
+ content_type='application/json',
+ status=200,
)
+ # 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-bare-metal-server-network-interface'
+
# Set up parameter values
+ bare_metal_server_id = 'testString'
id = 'testString'
+ 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,
+ "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.start_bare_metal_server(**req_copy)
+ _service.update_bare_metal_server_network_interface(**req_copy)
- def test_start_bare_metal_server_value_error_with_retries(self):
- # Enable retries and run test_start_bare_metal_server_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_start_bare_metal_server_value_error()
+ self.test_update_bare_metal_server_network_interface_value_error()
- # Disable retries and run test_start_bare_metal_server_value_error.
+ # Disable retries and run test_update_bare_metal_server_network_interface_value_error.
_service.disable_retries()
- self.test_start_bare_metal_server_value_error()
+ self.test_update_bare_metal_server_network_interface_value_error()
-class TestStopBareMetalServer:
+class TestListBareMetalServerNetworkInterfaceFloatingIps:
"""
- Test Class for stop_bare_metal_server
+ Test Class for list_bare_metal_server_network_interface_floating_ips
"""
@responses.activate
- def test_stop_bare_metal_server_all_params(self):
+ def test_list_bare_metal_server_network_interface_floating_ips_all_params(self):
"""
- stop_bare_metal_server()
+ list_bare_metal_server_network_interface_floating_ips()
"""
# Set up mock
- url = preprocess_url('/bare_metal_servers/testString/stop')
+ 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-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}]}'
responses.add(
- responses.POST,
+ responses.GET,
url,
- status=204,
+ body=mock_response,
+ content_type='application/json',
+ status=200,
)
# Set up parameter values
- id = 'testString'
- type = 'hard'
+ bare_metal_server_id = 'testString'
+ network_interface_id = 'testString'
# Invoke method
- response = _service.stop_bare_metal_server(
- id,
- type,
+ 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 == 204
- # Validate body params
- req_body = json.loads(str(responses.calls[0].request.body, 'utf-8'))
- assert req_body['type'] == 'hard'
+ assert response.status_code == 200
- def test_stop_bare_metal_server_all_params_with_retries(self):
- # Enable retries and run test_stop_bare_metal_server_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_stop_bare_metal_server_all_params()
+ self.test_list_bare_metal_server_network_interface_floating_ips_all_params()
- # Disable retries and run test_stop_bare_metal_server_all_params.
+ # Disable retries and run test_list_bare_metal_server_network_interface_floating_ips_all_params.
_service.disable_retries()
- self.test_stop_bare_metal_server_all_params()
+ self.test_list_bare_metal_server_network_interface_floating_ips_all_params()
@responses.activate
- def test_stop_bare_metal_server_value_error(self):
+ def test_list_bare_metal_server_network_interface_floating_ips_value_error(self):
"""
- test_stop_bare_metal_server_value_error()
+ test_list_bare_metal_server_network_interface_floating_ips_value_error()
"""
# Set up mock
- url = preprocess_url('/bare_metal_servers/testString/stop')
+ 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-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}]}'
responses.add(
- responses.POST,
+ responses.GET,
url,
- status=204,
+ body=mock_response,
+ content_type='application/json',
+ status=200,
)
# Set up parameter values
- id = 'testString'
- type = 'hard'
+ bare_metal_server_id = 'testString'
+ network_interface_id = 'testString'
# Pass in all but one required param and check for a ValueError
req_param_dict = {
- "id": id,
- "type": type,
+ "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.stop_bare_metal_server(**req_copy)
+ _service.list_bare_metal_server_network_interface_floating_ips(**req_copy)
- def test_stop_bare_metal_server_value_error_with_retries(self):
- # Enable retries and run test_stop_bare_metal_server_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_stop_bare_metal_server_value_error()
+ self.test_list_bare_metal_server_network_interface_floating_ips_value_error()
- # Disable retries and run test_stop_bare_metal_server_value_error.
+ # Disable retries and run test_list_bare_metal_server_network_interface_floating_ips_value_error.
_service.disable_retries()
- self.test_stop_bare_metal_server_value_error()
-
-
-# endregion
-##############################################################################
-# End of Service: BareMetalServers
-##############################################################################
-
-##############################################################################
-# Start of Service: Volumes
-##############################################################################
-# region
+ self.test_list_bare_metal_server_network_interface_floating_ips_value_error()
-class TestNewInstance:
+class TestRemoveBareMetalServerNetworkInterfaceFloatingIp:
"""
- Test Class for new_instance
+ Test Class for remove_bare_metal_server_network_interface_floating_ip
"""
- def test_new_instance(self):
+ @responses.activate
+ def test_remove_bare_metal_server_network_interface_floating_ip_all_params(self):
"""
- new_instance()
+ remove_bare_metal_server_network_interface_floating_ip()
"""
- os.environ['TEST_SERVICE_AUTH_TYPE'] = 'noAuth'
-
- service = VpcV1.new_instance(
- version=version,
- service_name='TEST_SERVICE',
+ # Set up mock
+ url = preprocess_url('/bare_metal_servers/testString/network_interfaces/testString/floating_ips/testString')
+ responses.add(
+ responses.DELETE,
+ url,
+ status=204,
)
- 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',
- )
+ # Set up parameter values
+ bare_metal_server_id = 'testString'
+ network_interface_id = 'testString'
+ id = 'testString'
- 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()
+ # Invoke method
+ response = _service.remove_bare_metal_server_network_interface_floating_ip(
+ bare_metal_server_id,
+ network_interface_id,
+ id,
+ headers={},
+ )
- 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,
- )
+ # Check for correct operation
+ assert len(responses.calls) == 1
+ assert response.status_code == 204
+ 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_remove_bare_metal_server_network_interface_floating_ip_all_params()
-class TestListVolumeProfiles:
- """
- Test Class for list_volume_profiles
- """
+ # Disable retries and run test_remove_bare_metal_server_network_interface_floating_ip_all_params.
+ _service.disable_retries()
+ self.test_remove_bare_metal_server_network_interface_floating_ip_all_params()
@responses.activate
- def test_list_volume_profiles_all_params(self):
+ def test_remove_bare_metal_server_network_interface_floating_ip_value_error(self):
"""
- list_volume_profiles()
+ test_remove_bare_metal_server_network_interface_floating_ip_value_error()
"""
# Set up mock
- 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}'
+ url = preprocess_url('/bare_metal_servers/testString/network_interfaces/testString/floating_ips/testString')
responses.add(
- responses.GET,
+ responses.DELETE,
url,
- body=mock_response,
- content_type='application/json',
- status=200,
+ status=204,
)
# Set up parameter values
- start = 'testString'
- limit = 50
-
- # Invoke method
- response = _service.list_volume_profiles(
- start=start,
- limit=limit,
- headers={},
- )
+ bare_metal_server_id = 'testString'
+ network_interface_id = 'testString'
+ id = 'testString'
- # 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
+ # Pass in all but one required param and check for a ValueError
+ req_param_dict = {
+ "bare_metal_server_id": bare_metal_server_id,
+ "network_interface_id": network_interface_id,
+ "id": id,
+ }
+ for param in req_param_dict.keys():
+ req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()}
+ with pytest.raises(ValueError):
+ _service.remove_bare_metal_server_network_interface_floating_ip(**req_copy)
- def test_list_volume_profiles_all_params_with_retries(self):
- # Enable retries and run test_list_volume_profiles_all_params.
+ 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_list_volume_profiles_all_params()
+ self.test_remove_bare_metal_server_network_interface_floating_ip_value_error()
- # Disable retries and run test_list_volume_profiles_all_params.
+ # Disable retries and run test_remove_bare_metal_server_network_interface_floating_ip_value_error.
_service.disable_retries()
- self.test_list_volume_profiles_all_params()
+ self.test_remove_bare_metal_server_network_interface_floating_ip_value_error()
+
+
+class TestGetBareMetalServerNetworkInterfaceFloatingIp:
+ """
+ Test Class for get_bare_metal_server_network_interface_floating_ip
+ """
@responses.activate
- def test_list_volume_profiles_required_params(self):
+ def test_get_bare_metal_server_network_interface_floating_ip_all_params(self):
"""
- test_list_volume_profiles_required_params()
+ get_bare_metal_server_network_interface_floating_ip()
"""
# Set up mock
- 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}'
+ 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-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
responses.add(
responses.GET,
url,
@@ -22450,30 +23776,40 @@ def test_list_volume_profiles_required_params(self):
status=200,
)
+ # Set up parameter values
+ bare_metal_server_id = 'testString'
+ network_interface_id = 'testString'
+ id = 'testString'
+
# Invoke method
- response = _service.list_volume_profiles()
+ response = _service.get_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
- def test_list_volume_profiles_required_params_with_retries(self):
- # Enable retries and run test_list_volume_profiles_required_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_volume_profiles_required_params()
+ self.test_get_bare_metal_server_network_interface_floating_ip_all_params()
- # Disable retries and run test_list_volume_profiles_required_params.
+ # Disable retries and run test_get_bare_metal_server_network_interface_floating_ip_all_params.
_service.disable_retries()
- self.test_list_volume_profiles_required_params()
+ self.test_get_bare_metal_server_network_interface_floating_ip_all_params()
@responses.activate
- def test_list_volume_profiles_value_error(self):
+ def test_get_bare_metal_server_network_interface_floating_ip_value_error(self):
"""
- test_list_volume_profiles_value_error()
+ test_get_bare_metal_server_network_interface_floating_ip_value_error()
"""
# Set up mock
- 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}'
+ 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-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
responses.add(
responses.GET,
url,
@@ -22482,187 +23818,134 @@ def test_list_volume_profiles_value_error(self):
status=200,
)
+ # Set up parameter values
+ bare_metal_server_id = 'testString'
+ network_interface_id = 'testString'
+ id = 'testString'
+
# Pass in all but one required param and check for a ValueError
req_param_dict = {
+ "bare_metal_server_id": bare_metal_server_id,
+ "network_interface_id": network_interface_id,
+ "id": id,
}
for param in req_param_dict.keys():
req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()}
with pytest.raises(ValueError):
- _service.list_volume_profiles(**req_copy)
+ _service.get_bare_metal_server_network_interface_floating_ip(**req_copy)
- def test_list_volume_profiles_value_error_with_retries(self):
- # Enable retries and run test_list_volume_profiles_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_volume_profiles_value_error()
+ self.test_get_bare_metal_server_network_interface_floating_ip_value_error()
- # Disable retries and run test_list_volume_profiles_value_error.
+ # Disable retries and run test_get_bare_metal_server_network_interface_floating_ip_value_error.
_service.disable_retries()
- self.test_list_volume_profiles_value_error()
-
- @responses.activate
- def test_list_volume_profiles_with_pager_get_next(self):
- """
- test_list_volume_profiles_with_pager_get_next()
- """
- # Set up a two-page mock response
- url = preprocess_url('/volume/profiles')
- mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"profiles":[{"family":"tiered","href":"https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose","name":"general-purpose"}]}'
- mock_response2 = '{"total_count":2,"limit":1,"profiles":[{"family":"tiered","href":"https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose","name":"general-purpose"}]}'
- responses.add(
- responses.GET,
- url,
- body=mock_response1,
- content_type='application/json',
- status=200,
- )
- responses.add(
- responses.GET,
- url,
- body=mock_response2,
- content_type='application/json',
- status=200,
- )
-
- # Exercise the pager class for this operation
- all_results = []
- pager = VolumeProfilesPager(
- client=_service,
- limit=10,
- )
- while pager.has_next():
- next_page = pager.get_next()
- assert next_page is not None
- all_results.extend(next_page)
- assert len(all_results) == 2
-
- @responses.activate
- def test_list_volume_profiles_with_pager_get_all(self):
- """
- test_list_volume_profiles_with_pager_get_all()
- """
- # Set up a two-page mock response
- url = preprocess_url('/volume/profiles')
- mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"profiles":[{"family":"tiered","href":"https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose","name":"general-purpose"}]}'
- mock_response2 = '{"total_count":2,"limit":1,"profiles":[{"family":"tiered","href":"https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose","name":"general-purpose"}]}'
- responses.add(
- responses.GET,
- url,
- body=mock_response1,
- content_type='application/json',
- status=200,
- )
- responses.add(
- responses.GET,
- url,
- body=mock_response2,
- content_type='application/json',
- status=200,
- )
-
- # Exercise the pager class for this operation
- pager = VolumeProfilesPager(
- client=_service,
- limit=10,
- )
- all_results = pager.get_all()
- assert all_results is not None
- assert len(all_results) == 2
+ self.test_get_bare_metal_server_network_interface_floating_ip_value_error()
-class TestGetVolumeProfile:
+class TestAddBareMetalServerNetworkInterfaceFloatingIp:
"""
- Test Class for get_volume_profile
+ Test Class for add_bare_metal_server_network_interface_floating_ip
"""
@responses.activate
- def test_get_volume_profile_all_params(self):
+ def test_add_bare_metal_server_network_interface_floating_ip_all_params(self):
"""
- get_volume_profile()
+ add_bare_metal_server_network_interface_floating_ip()
"""
# 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"}'
+ 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-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
responses.add(
- responses.GET,
+ responses.PUT,
url,
body=mock_response,
content_type='application/json',
- status=200,
+ status=201,
)
# Set up parameter values
- name = 'testString'
+ bare_metal_server_id = 'testString'
+ network_interface_id = 'testString'
+ id = 'testString'
# Invoke method
- response = _service.get_volume_profile(
- 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_volume_profile_all_params_with_retries(self):
- # Enable retries and run test_get_volume_profile_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_volume_profile_all_params()
+ self.test_add_bare_metal_server_network_interface_floating_ip_all_params()
- # Disable retries and run test_get_volume_profile_all_params.
+ # Disable retries and run test_add_bare_metal_server_network_interface_floating_ip_all_params.
_service.disable_retries()
- self.test_get_volume_profile_all_params()
+ self.test_add_bare_metal_server_network_interface_floating_ip_all_params()
@responses.activate
- def test_get_volume_profile_value_error(self):
+ def test_add_bare_metal_server_network_interface_floating_ip_value_error(self):
"""
- test_get_volume_profile_value_error()
+ test_add_bare_metal_server_network_interface_floating_ip_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"}'
+ 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-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
responses.add(
- responses.GET,
+ responses.PUT,
url,
body=mock_response,
content_type='application/json',
- status=200,
+ status=201,
)
# 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_volume_profile(**req_copy)
+ _service.add_bare_metal_server_network_interface_floating_ip(**req_copy)
- def test_get_volume_profile_value_error_with_retries(self):
- # Enable retries and run test_get_volume_profile_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_volume_profile_value_error()
+ self.test_add_bare_metal_server_network_interface_floating_ip_value_error()
- # Disable retries and run test_get_volume_profile_value_error.
+ # Disable retries and run test_add_bare_metal_server_network_interface_floating_ip_value_error.
_service.disable_retries()
- self.test_get_volume_profile_value_error()
+ self.test_add_bare_metal_server_network_interface_floating_ip_value_error()
-class TestListVolumes:
+class TestListBareMetalServerNetworkInterfaceIps:
"""
- Test Class for list_volumes
+ Test Class for list_bare_metal_server_network_interface_ips
"""
@responses.activate
- def test_list_volumes_all_params(self):
+ def test_list_bare_metal_server_network_interface_ips_all_params(self):
"""
- list_volumes()
+ list_bare_metal_server_network_interface_ips()
"""
# 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"}, "total_count": 132, "volumes": [{"active": true, "attachment_state": "attached", "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/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "health_reasons": [{"code": "initializing_from_snapshot", "message": "Performance will be degraded while this volume is being initialized from its snapshot", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-snapshots-vpc-troubleshooting&interface=ui#snapshot_ts_degraded_perf"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "iops": 10000, "name": "my-volume", "operating_system": {"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"}, "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"}, "resource_type": "volume", "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", "remote": {"account": {"id": "aa2432b1fa4d4ace891e9b80fc104e34", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "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", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "user_tags": ["user_tags"], "volume_attachments": [{"delete_volume_on_instance_delete": true, "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}, "name": "my-volume-attachment", "type": "boot"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}]}'
+ url = preprocess_url('/bare_metal_servers/testString/network_interfaces/testString/ips')
+ mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e/ips?limit=20"}, "ips": [{"address": "192.168.3.4", "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "lifecycle_state": "stable", "name": "my-reserved-ip", "owner": "user", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "name": "my-endpoint-gateway", "resource_type": "endpoint_gateway"}}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e/ips?start=a404e343444b4e1095c9edba76672d67&limit=20"}, "total_count": 132}'
responses.add(
responses.GET,
url,
@@ -22672,60 +23955,37 @@ def test_list_volumes_all_params(self):
)
# Set up parameter values
- start = 'testString'
- limit = 50
- name = 'testString'
- attachment_state = 'attached'
- encryption = 'provider_managed'
- operating_system_family = 'Ubuntu Server'
- operating_system_architecture = 'amd64'
- zone_name = 'us-south-1'
+ bare_metal_server_id = 'testString'
+ network_interface_id = 'testString'
# Invoke method
- response = _service.list_volumes(
- start=start,
- limit=limit,
- name=name,
- attachment_state=attachment_state,
- encryption=encryption,
- operating_system_family=operating_system_family,
- operating_system_architecture=operating_system_architecture,
- zone_name=zone_name,
+ response = _service.list_bare_metal_server_network_interface_ips(
+ bare_metal_server_id,
+ network_interface_id,
headers={},
)
# Check for correct operation
assert len(responses.calls) == 1
assert response.status_code == 200
- # 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 'attachment_state={}'.format(attachment_state) in query_string
- assert 'encryption={}'.format(encryption) in query_string
- assert 'operating_system.family={}'.format(operating_system_family) in query_string
- assert 'operating_system.architecture={}'.format(operating_system_architecture) 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.
+ def test_list_bare_metal_server_network_interface_ips_all_params_with_retries(self):
+ # Enable retries and run test_list_bare_metal_server_network_interface_ips_all_params.
_service.enable_retries()
- self.test_list_volumes_all_params()
+ self.test_list_bare_metal_server_network_interface_ips_all_params()
- # Disable retries and run test_list_volumes_all_params.
+ # Disable retries and run test_list_bare_metal_server_network_interface_ips_all_params.
_service.disable_retries()
- self.test_list_volumes_all_params()
+ self.test_list_bare_metal_server_network_interface_ips_all_params()
@responses.activate
- def test_list_volumes_required_params(self):
+ def test_list_bare_metal_server_network_interface_ips_value_error(self):
"""
- test_list_volumes_required_params()
+ test_list_bare_metal_server_network_interface_ips_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"}, "total_count": 132, "volumes": [{"active": true, "attachment_state": "attached", "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/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "health_reasons": [{"code": "initializing_from_snapshot", "message": "Performance will be degraded while this volume is being initialized from its snapshot", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-snapshots-vpc-troubleshooting&interface=ui#snapshot_ts_degraded_perf"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "iops": 10000, "name": "my-volume", "operating_system": {"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"}, "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"}, "resource_type": "volume", "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", "remote": {"account": {"id": "aa2432b1fa4d4ace891e9b80fc104e34", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "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", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "user_tags": ["user_tags"], "volume_attachments": [{"delete_volume_on_instance_delete": true, "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}, "name": "my-volume-attachment", "type": "boot"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}]}'
+ url = preprocess_url('/bare_metal_servers/testString/network_interfaces/testString/ips')
+ mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e/ips?limit=20"}, "ips": [{"address": "192.168.3.4", "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "lifecycle_state": "stable", "name": "my-reserved-ip", "owner": "user", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "name": "my-endpoint-gateway", "resource_type": "endpoint_gateway"}}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e/ips?start=a404e343444b4e1095c9edba76672d67&limit=20"}, "total_count": 132}'
responses.add(
responses.GET,
url,
@@ -22734,363 +23994,170 @@ def test_list_volumes_required_params(self):
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"}, "total_count": 132, "volumes": [{"active": true, "attachment_state": "attached", "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/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "health_reasons": [{"code": "initializing_from_snapshot", "message": "Performance will be degraded while this volume is being initialized from its snapshot", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-snapshots-vpc-troubleshooting&interface=ui#snapshot_ts_degraded_perf"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "iops": 10000, "name": "my-volume", "operating_system": {"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"}, "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"}, "resource_type": "volume", "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", "remote": {"account": {"id": "aa2432b1fa4d4ace891e9b80fc104e34", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "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", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "user_tags": ["user_tags"], "volume_attachments": [{"delete_volume_on_instance_delete": true, "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}, "name": "my-volume-attachment", "type": "boot"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}]}'
- responses.add(
- responses.GET,
- url,
- body=mock_response,
- 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_volumes(**req_copy)
+ _service.list_bare_metal_server_network_interface_ips(**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_server_network_interface_ips_value_error_with_retries(self):
+ # Enable retries and run test_list_bare_metal_server_network_interface_ips_value_error.
_service.enable_retries()
- self.test_list_volumes_value_error()
+ self.test_list_bare_metal_server_network_interface_ips_value_error()
- # Disable retries and run test_list_volumes_value_error.
+ # Disable retries and run test_list_bare_metal_server_network_interface_ips_value_error.
_service.disable_retries()
- self.test_list_volumes_value_error()
-
- @responses.activate
- def test_list_volumes_with_pager_get_next(self):
- """
- test_list_volumes_with_pager_get_next()
- """
- # Set up a two-page mock response
- url = preprocess_url('/volumes')
- mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"volumes":[{"active":true,"attachment_state":"attached","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/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"},"health_reasons":[{"code":"initializing_from_snapshot","message":"Performance will be degraded while this volume is being initialized from its snapshot","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-snapshots-vpc-troubleshooting&interface=ui#snapshot_ts_degraded_perf"}],"health_state":"ok","href":"https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5","id":"1a6b7274-678d-4dfb-8981-c71dd9d4daa5","iops":10000,"name":"my-volume","operating_system":{"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"},"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"},"resource_type":"volume","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","remote":{"account":{"id":"aa2432b1fa4d4ace891e9b80fc104e34","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"image"},"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","remote":{"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"snapshot"},"status":"available","status_reasons":[{"code":"encryption_key_deleted","message":"message","more_info":"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}],"user_tags":["user_tags"],"volume_attachments":[{"delete_volume_on_instance_delete":true,"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"device":{"id":"80b3e36e-41f4-40e9-bd56-beae81792a68"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a","id":"82cbf856-9cbb-45fb-b62f-d7bcef32399a","instance":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a","id":"1e09281b-f177-46fb-baf1-bc152b2e391a","name":"my-instance"},"name":"my-volume-attachment","type":"boot"}],"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}]}'
- mock_response2 = '{"total_count":2,"limit":1,"volumes":[{"active":true,"attachment_state":"attached","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/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"},"health_reasons":[{"code":"initializing_from_snapshot","message":"Performance will be degraded while this volume is being initialized from its snapshot","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-snapshots-vpc-troubleshooting&interface=ui#snapshot_ts_degraded_perf"}],"health_state":"ok","href":"https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5","id":"1a6b7274-678d-4dfb-8981-c71dd9d4daa5","iops":10000,"name":"my-volume","operating_system":{"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"},"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"},"resource_type":"volume","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","remote":{"account":{"id":"aa2432b1fa4d4ace891e9b80fc104e34","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"image"},"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","remote":{"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"snapshot"},"status":"available","status_reasons":[{"code":"encryption_key_deleted","message":"message","more_info":"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}],"user_tags":["user_tags"],"volume_attachments":[{"delete_volume_on_instance_delete":true,"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"device":{"id":"80b3e36e-41f4-40e9-bd56-beae81792a68"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a","id":"82cbf856-9cbb-45fb-b62f-d7bcef32399a","instance":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a","id":"1e09281b-f177-46fb-baf1-bc152b2e391a","name":"my-instance"},"name":"my-volume-attachment","type":"boot"}],"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}]}'
- responses.add(
- responses.GET,
- url,
- body=mock_response1,
- content_type='application/json',
- status=200,
- )
- responses.add(
- responses.GET,
- url,
- body=mock_response2,
- content_type='application/json',
- status=200,
- )
-
- # Exercise the pager class for this operation
- all_results = []
- pager = VolumesPager(
- client=_service,
- limit=10,
- name='testString',
- attachment_state='attached',
- encryption='provider_managed',
- operating_system_family='Ubuntu Server',
- operating_system_architecture='amd64',
- zone_name='us-south-1',
- )
- while pager.has_next():
- next_page = pager.get_next()
- assert next_page is not None
- all_results.extend(next_page)
- assert len(all_results) == 2
-
- @responses.activate
- def test_list_volumes_with_pager_get_all(self):
- """
- test_list_volumes_with_pager_get_all()
- """
- # Set up a two-page mock response
- url = preprocess_url('/volumes')
- mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"volumes":[{"active":true,"attachment_state":"attached","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/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"},"health_reasons":[{"code":"initializing_from_snapshot","message":"Performance will be degraded while this volume is being initialized from its snapshot","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-snapshots-vpc-troubleshooting&interface=ui#snapshot_ts_degraded_perf"}],"health_state":"ok","href":"https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5","id":"1a6b7274-678d-4dfb-8981-c71dd9d4daa5","iops":10000,"name":"my-volume","operating_system":{"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"},"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"},"resource_type":"volume","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","remote":{"account":{"id":"aa2432b1fa4d4ace891e9b80fc104e34","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"image"},"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","remote":{"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"snapshot"},"status":"available","status_reasons":[{"code":"encryption_key_deleted","message":"message","more_info":"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}],"user_tags":["user_tags"],"volume_attachments":[{"delete_volume_on_instance_delete":true,"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"device":{"id":"80b3e36e-41f4-40e9-bd56-beae81792a68"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a","id":"82cbf856-9cbb-45fb-b62f-d7bcef32399a","instance":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a","id":"1e09281b-f177-46fb-baf1-bc152b2e391a","name":"my-instance"},"name":"my-volume-attachment","type":"boot"}],"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}]}'
- mock_response2 = '{"total_count":2,"limit":1,"volumes":[{"active":true,"attachment_state":"attached","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/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"},"health_reasons":[{"code":"initializing_from_snapshot","message":"Performance will be degraded while this volume is being initialized from its snapshot","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-snapshots-vpc-troubleshooting&interface=ui#snapshot_ts_degraded_perf"}],"health_state":"ok","href":"https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5","id":"1a6b7274-678d-4dfb-8981-c71dd9d4daa5","iops":10000,"name":"my-volume","operating_system":{"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"},"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"},"resource_type":"volume","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","remote":{"account":{"id":"aa2432b1fa4d4ace891e9b80fc104e34","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"image"},"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","remote":{"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"snapshot"},"status":"available","status_reasons":[{"code":"encryption_key_deleted","message":"message","more_info":"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}],"user_tags":["user_tags"],"volume_attachments":[{"delete_volume_on_instance_delete":true,"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"device":{"id":"80b3e36e-41f4-40e9-bd56-beae81792a68"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a","id":"82cbf856-9cbb-45fb-b62f-d7bcef32399a","instance":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a","id":"1e09281b-f177-46fb-baf1-bc152b2e391a","name":"my-instance"},"name":"my-volume-attachment","type":"boot"}],"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}]}'
- responses.add(
- responses.GET,
- url,
- body=mock_response1,
- content_type='application/json',
- status=200,
- )
- responses.add(
- responses.GET,
- url,
- body=mock_response2,
- content_type='application/json',
- status=200,
- )
-
- # Exercise the pager class for this operation
- pager = VolumesPager(
- client=_service,
- limit=10,
- name='testString',
- attachment_state='attached',
- encryption='provider_managed',
- operating_system_family='Ubuntu Server',
- operating_system_architecture='amd64',
- zone_name='us-south-1',
- )
- all_results = pager.get_all()
- assert all_results is not None
- assert len(all_results) == 2
+ self.test_list_bare_metal_server_network_interface_ips_value_error()
-class TestCreateVolume:
+class TestGetBareMetalServerNetworkInterfaceIp:
"""
- Test Class for create_volume
+ Test Class for get_bare_metal_server_network_interface_ip
"""
@responses.activate
- def test_create_volume_all_params(self):
+ def test_get_bare_metal_server_network_interface_ip_all_params(self):
"""
- create_volume()
+ get_bare_metal_server_network_interface_ip()
"""
# Set up mock
- url = preprocess_url('/volumes')
- mock_response = '{"active": true, "attachment_state": "attached", "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/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "health_reasons": [{"code": "initializing_from_snapshot", "message": "Performance will be degraded while this volume is being initialized from its snapshot", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-snapshots-vpc-troubleshooting&interface=ui#snapshot_ts_degraded_perf"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "iops": 10000, "name": "my-volume", "operating_system": {"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"}, "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"}, "resource_type": "volume", "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", "remote": {"account": {"id": "aa2432b1fa4d4ace891e9b80fc104e34", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "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", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "user_tags": ["user_tags"], "volume_attachments": [{"delete_volume_on_instance_delete": true, "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}, "name": "my-volume-attachment", "type": "boot"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
+ url = preprocess_url('/bare_metal_servers/testString/network_interfaces/testString/ips/testString')
+ mock_response = '{"address": "192.168.3.4", "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "lifecycle_state": "stable", "name": "my-reserved-ip", "owner": "user", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "name": "my-endpoint-gateway", "resource_type": "endpoint_gateway"}}'
responses.add(
- responses.POST,
+ responses.GET,
url,
body=mock_response,
content_type='application/json',
- status=201,
+ status=200,
)
- # 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/123456: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['user_tags'] = []
- 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
+ bare_metal_server_id = 'testString'
+ network_interface_id = 'testString'
+ id = 'testString'
# Invoke method
- response = _service.create_volume(
- volume_prototype,
+ response = _service.get_bare_metal_server_network_interface_ip(
+ bare_metal_server_id,
+ network_interface_id,
+ id,
headers={},
)
# Check for correct operation
assert len(responses.calls) == 1
- assert response.status_code == 201
- # Validate body params
- req_body = json.loads(str(responses.calls[0].request.body, 'utf-8'))
- assert req_body == volume_prototype
+ assert response.status_code == 200
- def test_create_volume_all_params_with_retries(self):
- # Enable retries and run test_create_volume_all_params.
+ def test_get_bare_metal_server_network_interface_ip_all_params_with_retries(self):
+ # Enable retries and run test_get_bare_metal_server_network_interface_ip_all_params.
_service.enable_retries()
- self.test_create_volume_all_params()
+ self.test_get_bare_metal_server_network_interface_ip_all_params()
- # Disable retries and run test_create_volume_all_params.
+ # Disable retries and run test_get_bare_metal_server_network_interface_ip_all_params.
_service.disable_retries()
- self.test_create_volume_all_params()
+ self.test_get_bare_metal_server_network_interface_ip_all_params()
@responses.activate
- def test_create_volume_value_error(self):
+ def test_get_bare_metal_server_network_interface_ip_value_error(self):
"""
- test_create_volume_value_error()
+ test_get_bare_metal_server_network_interface_ip_value_error()
"""
# Set up mock
- url = preprocess_url('/volumes')
- mock_response = '{"active": true, "attachment_state": "attached", "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/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "health_reasons": [{"code": "initializing_from_snapshot", "message": "Performance will be degraded while this volume is being initialized from its snapshot", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-snapshots-vpc-troubleshooting&interface=ui#snapshot_ts_degraded_perf"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "iops": 10000, "name": "my-volume", "operating_system": {"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"}, "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"}, "resource_type": "volume", "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", "remote": {"account": {"id": "aa2432b1fa4d4ace891e9b80fc104e34", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "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", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "user_tags": ["user_tags"], "volume_attachments": [{"delete_volume_on_instance_delete": true, "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}, "name": "my-volume-attachment", "type": "boot"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
+ url = preprocess_url('/bare_metal_servers/testString/network_interfaces/testString/ips/testString')
+ mock_response = '{"address": "192.168.3.4", "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "lifecycle_state": "stable", "name": "my-reserved-ip", "owner": "user", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "name": "my-endpoint-gateway", "resource_type": "endpoint_gateway"}}'
responses.add(
- responses.POST,
+ responses.GET,
url,
body=mock_response,
content_type='application/json',
- status=201,
+ status=200,
)
- # 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/123456: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['user_tags'] = []
- 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
+ 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 = {
- "volume_prototype": volume_prototype,
+ "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.create_volume(**req_copy)
+ _service.get_bare_metal_server_network_interface_ip(**req_copy)
- def test_create_volume_value_error_with_retries(self):
- # Enable retries and run test_create_volume_value_error.
+ def test_get_bare_metal_server_network_interface_ip_value_error_with_retries(self):
+ # Enable retries and run test_get_bare_metal_server_network_interface_ip_value_error.
_service.enable_retries()
- self.test_create_volume_value_error()
+ self.test_get_bare_metal_server_network_interface_ip_value_error()
- # Disable retries and run test_create_volume_value_error.
+ # Disable retries and run test_get_bare_metal_server_network_interface_ip_value_error.
_service.disable_retries()
- self.test_create_volume_value_error()
+ self.test_get_bare_metal_server_network_interface_ip_value_error()
-class TestDeleteVolume:
+class TestDeleteBareMetalServer:
"""
- Test Class for delete_volume
+ Test Class for delete_bare_metal_server
"""
@responses.activate
- def test_delete_volume_all_params(self):
- """
- delete_volume()
- """
- # Set up mock
- url = preprocess_url('/volumes/testString')
- responses.add(
- responses.DELETE,
- url,
- status=204,
- )
-
- # Set up parameter values
- id = 'testString'
- if_match = 'W/"96d225c4-56bd-43d9-98fc-d7148e5c5028"'
-
- # Invoke method
- response = _service.delete_volume(
- id,
- if_match=if_match,
- headers={},
- )
-
- # Check for correct operation
- assert len(responses.calls) == 1
- assert response.status_code == 204
-
- def test_delete_volume_all_params_with_retries(self):
- # Enable retries and run test_delete_volume_all_params.
- _service.enable_retries()
- self.test_delete_volume_all_params()
-
- # Disable retries and run test_delete_volume_all_params.
- _service.disable_retries()
- self.test_delete_volume_all_params()
-
- @responses.activate
- def test_delete_volume_required_params(self):
+ def test_delete_bare_metal_server_all_params(self):
"""
- test_delete_volume_required_params()
+ delete_bare_metal_server()
"""
# Set up mock
- url = preprocess_url('/volumes/testString')
+ url = preprocess_url('/bare_metal_servers/testString')
responses.add(
responses.DELETE,
url,
- status=204,
+ status=202,
)
# Set up parameter values
id = 'testString'
# Invoke method
- response = _service.delete_volume(
+ response = _service.delete_bare_metal_server(
id,
headers={},
)
# Check for correct operation
assert len(responses.calls) == 1
- assert response.status_code == 204
+ assert response.status_code == 202
- def test_delete_volume_required_params_with_retries(self):
- # Enable retries and run test_delete_volume_required_params.
+ 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_volume_required_params()
+ self.test_delete_bare_metal_server_all_params()
- # Disable retries and run test_delete_volume_required_params.
+ # Disable retries and run test_delete_bare_metal_server_all_params.
_service.disable_retries()
- self.test_delete_volume_required_params()
+ self.test_delete_bare_metal_server_all_params()
@responses.activate
- def test_delete_volume_value_error(self):
+ def test_delete_bare_metal_server_value_error(self):
"""
- test_delete_volume_value_error()
+ test_delete_bare_metal_server_value_error()
"""
# Set up mock
- url = preprocess_url('/volumes/testString')
+ url = preprocess_url('/bare_metal_servers/testString')
responses.add(
responses.DELETE,
url,
- status=204,
+ status=202,
)
# Set up parameter values
@@ -23103,31 +24170,31 @@ def test_delete_volume_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_volume(**req_copy)
+ _service.delete_bare_metal_server(**req_copy)
- def test_delete_volume_value_error_with_retries(self):
- # Enable retries and run test_delete_volume_value_error.
+ 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_volume_value_error()
+ self.test_delete_bare_metal_server_value_error()
- # Disable retries and run test_delete_volume_value_error.
+ # Disable retries and run test_delete_bare_metal_server_value_error.
_service.disable_retries()
- self.test_delete_volume_value_error()
+ self.test_delete_bare_metal_server_value_error()
-class TestGetVolume:
+class TestGetBareMetalServer:
"""
- Test Class for get_volume
+ Test Class for get_bare_metal_server
"""
@responses.activate
- def test_get_volume_all_params(self):
+ def test_get_bare_metal_server_all_params(self):
"""
- get_volume()
+ get_bare_metal_server()
"""
# Set up mock
- url = preprocess_url('/volumes/testString')
- mock_response = '{"active": true, "attachment_state": "attached", "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/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "health_reasons": [{"code": "initializing_from_snapshot", "message": "Performance will be degraded while this volume is being initialized from its snapshot", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-snapshots-vpc-troubleshooting&interface=ui#snapshot_ts_degraded_perf"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "iops": 10000, "name": "my-volume", "operating_system": {"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"}, "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"}, "resource_type": "volume", "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", "remote": {"account": {"id": "aa2432b1fa4d4ace891e9b80fc104e34", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "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", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "user_tags": ["user_tags"], "volume_attachments": [{"delete_volume_on_instance_delete": true, "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}, "name": "my-volume-attachment", "type": "boot"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
+ url = preprocess_url('/bare_metal_servers/testString')
+ mock_response = '{"bandwidth": 20000, "boot_target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-bare-metal-server-disk", "resource_type": "bare_metal_server_disk"}, "cpu": {"architecture": "amd64", "core_count": 80, "socket_count": 4, "threads_per_core": 2}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::bare-metal-server:1e09281b-f177-46fb-baf1-bc152b2e391a", "disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "fcp", "name": "my-bare-metal-server-disk", "resource_type": "bare_metal_server_disk", "size": 100}], "enable_secure_boot": false, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "memory": 1536, "name": "my-bare-metal-server", "network_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/2302-f7a2bf57-af7c-49d9-b599-b2c91293d30c/network_attachments/2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "name": "my-bare-metal-server-network-attachment", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "bare_metal_server_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}], "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-bare-metal-server-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}], "primary_network_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/2302-f7a2bf57-af7c-49d9-b599-b2c91293d30c/network_attachments/2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "name": "my-bare-metal-server-network-attachment", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "bare_metal_server_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}, "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-bare-metal-server-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768", "name": "bx2-metal-192x768", "resource_type": "bare_metal_server_profile"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "bare_metal_server", "status": "deleting", "status_reasons": [{"code": "cannot_start_capacity", "message": "The bare metal server cannot start as there is no more capacity in this\nzone for a bare metal server with the requested profile.", "more_info": "https://console.bluemix.net/docs/iaas/bare_metal_server.html"}], "trusted_platform_module": {"enabled": true, "mode": "disabled", "supported_modes": ["disabled"]}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
responses.add(
responses.GET,
url,
@@ -23140,7 +24207,7 @@ def test_get_volume_all_params(self):
id = 'testString'
# Invoke method
- response = _service.get_volume(
+ response = _service.get_bare_metal_server(
id,
headers={},
)
@@ -23149,23 +24216,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_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_get_volume_all_params()
+ self.test_get_bare_metal_server_all_params()
- # Disable retries and run test_get_volume_all_params.
+ # Disable retries and run test_get_bare_metal_server_all_params.
_service.disable_retries()
- self.test_get_volume_all_params()
+ self.test_get_bare_metal_server_all_params()
@responses.activate
- def test_get_volume_value_error(self):
+ def test_get_bare_metal_server_value_error(self):
"""
- test_get_volume_value_error()
+ test_get_bare_metal_server_value_error()
"""
# Set up mock
- url = preprocess_url('/volumes/testString')
- mock_response = '{"active": true, "attachment_state": "attached", "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/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "health_reasons": [{"code": "initializing_from_snapshot", "message": "Performance will be degraded while this volume is being initialized from its snapshot", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-snapshots-vpc-troubleshooting&interface=ui#snapshot_ts_degraded_perf"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "iops": 10000, "name": "my-volume", "operating_system": {"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"}, "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"}, "resource_type": "volume", "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", "remote": {"account": {"id": "aa2432b1fa4d4ace891e9b80fc104e34", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "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", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "user_tags": ["user_tags"], "volume_attachments": [{"delete_volume_on_instance_delete": true, "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}, "name": "my-volume-attachment", "type": "boot"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
+ url = preprocess_url('/bare_metal_servers/testString')
+ mock_response = '{"bandwidth": 20000, "boot_target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-bare-metal-server-disk", "resource_type": "bare_metal_server_disk"}, "cpu": {"architecture": "amd64", "core_count": 80, "socket_count": 4, "threads_per_core": 2}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::bare-metal-server:1e09281b-f177-46fb-baf1-bc152b2e391a", "disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "fcp", "name": "my-bare-metal-server-disk", "resource_type": "bare_metal_server_disk", "size": 100}], "enable_secure_boot": false, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "memory": 1536, "name": "my-bare-metal-server", "network_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/2302-f7a2bf57-af7c-49d9-b599-b2c91293d30c/network_attachments/2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "name": "my-bare-metal-server-network-attachment", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "bare_metal_server_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}], "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-bare-metal-server-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}], "primary_network_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/2302-f7a2bf57-af7c-49d9-b599-b2c91293d30c/network_attachments/2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "name": "my-bare-metal-server-network-attachment", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "bare_metal_server_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}, "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-bare-metal-server-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768", "name": "bx2-metal-192x768", "resource_type": "bare_metal_server_profile"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "bare_metal_server", "status": "deleting", "status_reasons": [{"code": "cannot_start_capacity", "message": "The bare metal server cannot start as there is no more capacity in this\nzone for a bare metal server with the requested profile.", "more_info": "https://console.bluemix.net/docs/iaas/bare_metal_server.html"}], "trusted_platform_module": {"enabled": true, "mode": "disabled", "supported_modes": ["disabled"]}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
responses.add(
responses.GET,
url,
@@ -23184,31 +24251,31 @@ def test_get_volume_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(**req_copy)
+ _service.get_bare_metal_server(**req_copy)
- def test_get_volume_value_error_with_retries(self):
- # Enable retries and run test_get_volume_value_error.
+ 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_volume_value_error()
+ self.test_get_bare_metal_server_value_error()
- # Disable retries and run test_get_volume_value_error.
+ # Disable retries and run test_get_bare_metal_server_value_error.
_service.disable_retries()
- self.test_get_volume_value_error()
+ self.test_get_bare_metal_server_value_error()
-class TestUpdateVolume:
+class TestUpdateBareMetalServer:
"""
- Test Class for update_volume
+ Test Class for update_bare_metal_server
"""
@responses.activate
- def test_update_volume_all_params(self):
+ def test_update_bare_metal_server_all_params(self):
"""
- update_volume()
+ update_bare_metal_server()
"""
# Set up mock
- url = preprocess_url('/volumes/testString')
- mock_response = '{"active": true, "attachment_state": "attached", "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/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "health_reasons": [{"code": "initializing_from_snapshot", "message": "Performance will be degraded while this volume is being initialized from its snapshot", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-snapshots-vpc-troubleshooting&interface=ui#snapshot_ts_degraded_perf"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "iops": 10000, "name": "my-volume", "operating_system": {"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"}, "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"}, "resource_type": "volume", "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", "remote": {"account": {"id": "aa2432b1fa4d4ace891e9b80fc104e34", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "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", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "user_tags": ["user_tags"], "volume_attachments": [{"delete_volume_on_instance_delete": true, "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}, "name": "my-volume-attachment", "type": "boot"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
+ url = preprocess_url('/bare_metal_servers/testString')
+ mock_response = '{"bandwidth": 20000, "boot_target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-bare-metal-server-disk", "resource_type": "bare_metal_server_disk"}, "cpu": {"architecture": "amd64", "core_count": 80, "socket_count": 4, "threads_per_core": 2}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::bare-metal-server:1e09281b-f177-46fb-baf1-bc152b2e391a", "disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "fcp", "name": "my-bare-metal-server-disk", "resource_type": "bare_metal_server_disk", "size": 100}], "enable_secure_boot": false, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "memory": 1536, "name": "my-bare-metal-server", "network_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/2302-f7a2bf57-af7c-49d9-b599-b2c91293d30c/network_attachments/2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "name": "my-bare-metal-server-network-attachment", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "bare_metal_server_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}], "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-bare-metal-server-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}], "primary_network_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/2302-f7a2bf57-af7c-49d9-b599-b2c91293d30c/network_attachments/2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "name": "my-bare-metal-server-network-attachment", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "bare_metal_server_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}, "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-bare-metal-server-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768", "name": "bx2-metal-192x768", "resource_type": "bare_metal_server_profile"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "bare_metal_server", "status": "deleting", "status_reasons": [{"code": "cannot_start_capacity", "message": "The bare metal server cannot start as there is no more capacity in this\nzone for a bare metal server with the requested profile.", "more_info": "https://console.bluemix.net/docs/iaas/bare_metal_server.html"}], "trusted_platform_module": {"enabled": true, "mode": "disabled", "supported_modes": ["disabled"]}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
responses.add(
responses.PATCH,
url,
@@ -23217,28 +24284,24 @@ def test_update_volume_all_params(self):
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 BareMetalServerTrustedPlatformModulePatch model
+ bare_metal_server_trusted_platform_module_patch_model = {}
+ bare_metal_server_trusted_platform_module_patch_model['mode'] = 'disabled'
- # Construct a dict representation of a VolumePatch model
- volume_patch_model = {}
- volume_patch_model['capacity'] = 100
- volume_patch_model['iops'] = 10000
- volume_patch_model['name'] = 'my-volume'
- volume_patch_model['profile'] = volume_profile_identity_model
- volume_patch_model['user_tags'] = ['testString']
+ # Construct a dict representation of a BareMetalServerPatch model
+ bare_metal_server_patch_model = {}
+ bare_metal_server_patch_model['enable_secure_boot'] = False
+ bare_metal_server_patch_model['name'] = 'my-bare-metal-server'
+ bare_metal_server_patch_model['trusted_platform_module'] = bare_metal_server_trusted_platform_module_patch_model
# Set up parameter values
id = 'testString'
- volume_patch = volume_patch_model
- if_match = 'W/"96d225c4-56bd-43d9-98fc-d7148e5c5028"'
+ bare_metal_server_patch = bare_metal_server_patch_model
# Invoke method
- response = _service.update_volume(
+ response = _service.update_bare_metal_server(
id,
- volume_patch,
- if_match=if_match,
+ bare_metal_server_patch,
headers={},
)
@@ -23247,25 +24310,25 @@ def test_update_volume_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 == volume_patch
+ assert req_body == bare_metal_server_patch
- def test_update_volume_all_params_with_retries(self):
- # Enable retries and run test_update_volume_all_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_update_volume_all_params()
+ self.test_update_bare_metal_server_all_params()
- # Disable retries and run test_update_volume_all_params.
+ # Disable retries and run test_update_bare_metal_server_all_params.
_service.disable_retries()
- self.test_update_volume_all_params()
+ self.test_update_bare_metal_server_all_params()
@responses.activate
- def test_update_volume_required_params(self):
+ def test_update_bare_metal_server_value_error(self):
"""
- test_update_volume_required_params()
+ test_update_bare_metal_server_value_error()
"""
# Set up mock
- url = preprocess_url('/volumes/testString')
- mock_response = '{"active": true, "attachment_state": "attached", "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/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "health_reasons": [{"code": "initializing_from_snapshot", "message": "Performance will be degraded while this volume is being initialized from its snapshot", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-snapshots-vpc-troubleshooting&interface=ui#snapshot_ts_degraded_perf"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "iops": 10000, "name": "my-volume", "operating_system": {"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"}, "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"}, "resource_type": "volume", "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", "remote": {"account": {"id": "aa2432b1fa4d4ace891e9b80fc104e34", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "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", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "user_tags": ["user_tags"], "volume_attachments": [{"delete_volume_on_instance_delete": true, "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}, "name": "my-volume-attachment", "type": "boot"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
+ url = preprocess_url('/bare_metal_servers/testString')
+ mock_response = '{"bandwidth": 20000, "boot_target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-bare-metal-server-disk", "resource_type": "bare_metal_server_disk"}, "cpu": {"architecture": "amd64", "core_count": 80, "socket_count": 4, "threads_per_core": 2}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::bare-metal-server:1e09281b-f177-46fb-baf1-bc152b2e391a", "disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "fcp", "name": "my-bare-metal-server-disk", "resource_type": "bare_metal_server_disk", "size": 100}], "enable_secure_boot": false, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "memory": 1536, "name": "my-bare-metal-server", "network_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/2302-f7a2bf57-af7c-49d9-b599-b2c91293d30c/network_attachments/2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "name": "my-bare-metal-server-network-attachment", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "bare_metal_server_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}], "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-bare-metal-server-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}], "primary_network_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/2302-f7a2bf57-af7c-49d9-b599-b2c91293d30c/network_attachments/2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "id": "2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6", "name": "my-bare-metal-server-network-attachment", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "bare_metal_server_network_attachment", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}, "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-bare-metal-server-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768", "name": "bx2-metal-192x768", "resource_type": "bare_metal_server_profile"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "bare_metal_server", "status": "deleting", "status_reasons": [{"code": "cannot_start_capacity", "message": "The bare metal server cannot start as there is no more capacity in this\nzone for a bare metal server with the requested profile.", "more_info": "https://console.bluemix.net/docs/iaas/bare_metal_server.html"}], "trusted_platform_module": {"enabled": true, "mode": "disabled", "supported_modes": ["disabled"]}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
responses.add(
responses.PATCH,
url,
@@ -23274,246 +24337,423 @@ def test_update_volume_required_params(self):
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 BareMetalServerTrustedPlatformModulePatch model
+ bare_metal_server_trusted_platform_module_patch_model = {}
+ bare_metal_server_trusted_platform_module_patch_model['mode'] = 'disabled'
- # Construct a dict representation of a VolumePatch model
- volume_patch_model = {}
- volume_patch_model['capacity'] = 100
- volume_patch_model['iops'] = 10000
- volume_patch_model['name'] = 'my-volume'
- volume_patch_model['profile'] = volume_profile_identity_model
- volume_patch_model['user_tags'] = ['testString']
+ # Construct a dict representation of a BareMetalServerPatch model
+ bare_metal_server_patch_model = {}
+ bare_metal_server_patch_model['enable_secure_boot'] = False
+ bare_metal_server_patch_model['name'] = 'my-bare-metal-server'
+ bare_metal_server_patch_model['trusted_platform_module'] = bare_metal_server_trusted_platform_module_patch_model
# Set up parameter values
id = 'testString'
- volume_patch = volume_patch_model
+ bare_metal_server_patch = bare_metal_server_patch_model
- # Invoke method
- response = _service.update_volume(
- id,
- volume_patch,
- headers={},
- )
+ # 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.update_bare_metal_server(**req_copy)
+
+ def test_update_bare_metal_server_value_error_with_retries(self):
+ # Enable retries and run test_update_bare_metal_server_value_error.
+ _service.enable_retries()
+ self.test_update_bare_metal_server_value_error()
+
+ # Disable retries and run test_update_bare_metal_server_value_error.
+ _service.disable_retries()
+ self.test_update_bare_metal_server_value_error()
+
+
+class TestGetBareMetalServerInitialization:
+ """
+ Test Class for get_bare_metal_server_initialization
+ """
+
+ @responses.activate
+ def test_get_bare_metal_server_initialization_all_params(self):
+ """
+ get_bare_metal_server_initialization()
+ """
+ # Set up mock
+ url = preprocess_url('/bare_metal_servers/testString/initialization')
+ mock_response = '{"image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image", "remote": {"account": {"id": "aa2432b1fa4d4ace891e9b80fc104e34", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "keys": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::key:a6b1a881-2ce8-41a3-80fc-36316a73f803", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "fingerprint": "SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY", "href": "https://us-south.iaas.cloud.ibm.com/v1/keys/a6b1a881-2ce8-41a3-80fc-36316a73f803", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "name": "my-key"}], "user_accounts": [{"encrypted_password": "qQ+/YEApnl1ZtEgIrfprzb065307thTkzlnLqL5ICpesdbBN03dyCQ==", "encryption_key": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::key:a6b1a881-2ce8-41a3-80fc-36316a73f803", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "fingerprint": "SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY", "href": "https://us-south.iaas.cloud.ibm.com/v1/keys/a6b1a881-2ce8-41a3-80fc-36316a73f803", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "name": "my-key"}, "resource_type": "host_user_account", "username": "Administrator"}]}'
+ responses.add(
+ responses.GET,
+ url,
+ body=mock_response,
+ content_type='application/json',
+ status=200,
+ )
+
+ # Set up parameter values
+ id = 'testString'
+
+ # Invoke method
+ response = _service.get_bare_metal_server_initialization(
+ id,
+ headers={},
+ )
# Check for correct operation
assert len(responses.calls) == 1
assert response.status_code == 200
- # Validate body params
- req_body = json.loads(str(responses.calls[0].request.body, 'utf-8'))
- assert req_body == volume_patch
- def test_update_volume_required_params_with_retries(self):
- # Enable retries and run test_update_volume_required_params.
+ 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_update_volume_required_params()
+ self.test_get_bare_metal_server_initialization_all_params()
- # Disable retries and run test_update_volume_required_params.
+ # Disable retries and run test_get_bare_metal_server_initialization_all_params.
_service.disable_retries()
- self.test_update_volume_required_params()
+ self.test_get_bare_metal_server_initialization_all_params()
@responses.activate
- def test_update_volume_value_error(self):
+ def test_get_bare_metal_server_initialization_value_error(self):
"""
- test_update_volume_value_error()
+ test_get_bare_metal_server_initialization_value_error()
"""
# Set up mock
- url = preprocess_url('/volumes/testString')
- mock_response = '{"active": true, "attachment_state": "attached", "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/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "health_reasons": [{"code": "initializing_from_snapshot", "message": "Performance will be degraded while this volume is being initialized from its snapshot", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-snapshots-vpc-troubleshooting&interface=ui#snapshot_ts_degraded_perf"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "iops": 10000, "name": "my-volume", "operating_system": {"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"}, "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"}, "resource_type": "volume", "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", "remote": {"account": {"id": "aa2432b1fa4d4ace891e9b80fc104e34", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "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", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "user_tags": ["user_tags"], "volume_attachments": [{"delete_volume_on_instance_delete": true, "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}, "name": "my-volume-attachment", "type": "boot"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
+ url = preprocess_url('/bare_metal_servers/testString/initialization')
+ mock_response = '{"image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image", "remote": {"account": {"id": "aa2432b1fa4d4ace891e9b80fc104e34", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "keys": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::key:a6b1a881-2ce8-41a3-80fc-36316a73f803", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "fingerprint": "SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY", "href": "https://us-south.iaas.cloud.ibm.com/v1/keys/a6b1a881-2ce8-41a3-80fc-36316a73f803", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "name": "my-key"}], "user_accounts": [{"encrypted_password": "qQ+/YEApnl1ZtEgIrfprzb065307thTkzlnLqL5ICpesdbBN03dyCQ==", "encryption_key": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::key:a6b1a881-2ce8-41a3-80fc-36316a73f803", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "fingerprint": "SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY", "href": "https://us-south.iaas.cloud.ibm.com/v1/keys/a6b1a881-2ce8-41a3-80fc-36316a73f803", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "name": "my-key"}, "resource_type": "host_user_account", "username": "Administrator"}]}'
responses.add(
- responses.PATCH,
+ 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
- volume_patch_model['user_tags'] = ['testString']
-
# Set up parameter values
id = 'testString'
- volume_patch = volume_patch_model
# Pass in all but one required param and check for a ValueError
req_param_dict = {
"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_initialization(**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_initialization_value_error_with_retries(self):
+ # Enable retries and run test_get_bare_metal_server_initialization_value_error.
_service.enable_retries()
- self.test_update_volume_value_error()
+ self.test_get_bare_metal_server_initialization_value_error()
- # Disable retries and run test_update_volume_value_error.
+ # Disable retries and run test_get_bare_metal_server_initialization_value_error.
_service.disable_retries()
- self.test_update_volume_value_error()
-
-
-# endregion
-##############################################################################
-# End of Service: Volumes
-##############################################################################
-
-##############################################################################
-# Start of Service: Snapshots
-##############################################################################
-# region
+ self.test_get_bare_metal_server_initialization_value_error()
-class TestNewInstance:
+class TestRestartBareMetalServer:
"""
- Test Class for new_instance
+ Test Class for restart_bare_metal_server
"""
- def test_new_instance(self):
+ @responses.activate
+ def test_restart_bare_metal_server_all_params(self):
"""
- new_instance()
+ restart_bare_metal_server()
"""
- os.environ['TEST_SERVICE_AUTH_TYPE'] = 'noAuth'
+ # Set up mock
+ url = preprocess_url('/bare_metal_servers/testString/restart')
+ responses.add(
+ responses.POST,
+ url,
+ status=204,
+ )
- service = VpcV1.new_instance(
- version=version,
- service_name='TEST_SERVICE',
+ # Set up parameter values
+ id = 'testString'
+
+ # Invoke method
+ response = _service.restart_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):
+ 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_restart_bare_metal_server_all_params()
+
+ # Disable retries and run test_restart_bare_metal_server_all_params.
+ _service.disable_retries()
+ self.test_restart_bare_metal_server_all_params()
+
+ @responses.activate
+ def test_restart_bare_metal_server_value_error(self):
"""
- new_instance_without_authenticator()
+ test_restart_bare_metal_server_value_error()
"""
- with pytest.raises(ValueError, match='authenticator must be provided'):
- service = VpcV1.new_instance(
- version=version,
- service_name='TEST_SERVICE_NOT_FOUND',
- )
+ # Set up mock
+ url = preprocess_url('/bare_metal_servers/testString/restart')
+ responses.add(
+ responses.POST,
+ url,
+ status=204,
+ )
- def test_new_instance_without_required_params(self):
+ # 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.restart_bare_metal_server(**req_copy)
+
+ def test_restart_bare_metal_server_value_error_with_retries(self):
+ # Enable retries and run test_restart_bare_metal_server_value_error.
+ _service.enable_retries()
+ self.test_restart_bare_metal_server_value_error()
+
+ # Disable retries and run test_restart_bare_metal_server_value_error.
+ _service.disable_retries()
+ self.test_restart_bare_metal_server_value_error()
+
+
+class TestStartBareMetalServer:
+ """
+ Test Class for start_bare_metal_server
+ """
+
+ @responses.activate
+ def test_start_bare_metal_server_all_params(self):
"""
- new_instance_without_required_params()
+ start_bare_metal_server()
"""
- with pytest.raises(TypeError, match='new_instance\\(\\) missing \\d required positional arguments?: \'.*\''):
- service = VpcV1.new_instance()
+ # Set up mock
+ url = preprocess_url('/bare_metal_servers/testString/start')
+ responses.add(
+ responses.POST,
+ url,
+ status=204,
+ )
- def test_new_instance_required_param_none(self):
+ # Set up parameter values
+ id = 'testString'
+
+ # Invoke method
+ response = _service.start_bare_metal_server(
+ id,
+ headers={},
+ )
+
+ # Check for correct operation
+ assert len(responses.calls) == 1
+ assert response.status_code == 204
+
+ 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_start_bare_metal_server_all_params()
+
+ # Disable retries and run test_start_bare_metal_server_all_params.
+ _service.disable_retries()
+ self.test_start_bare_metal_server_all_params()
+
+ @responses.activate
+ def test_start_bare_metal_server_value_error(self):
"""
- new_instance_required_param_none()
+ test_start_bare_metal_server_value_error()
"""
- with pytest.raises(ValueError, match='version must be provided'):
- service = VpcV1.new_instance(
- version=None,
- )
+ # Set up mock
+ url = preprocess_url('/bare_metal_servers/testString/start')
+ responses.add(
+ responses.POST,
+ url,
+ status=204,
+ )
+ # Set up parameter values
+ id = 'testString'
-class TestDeleteSnapshots:
+ # 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.start_bare_metal_server(**req_copy)
+
+ def test_start_bare_metal_server_value_error_with_retries(self):
+ # Enable retries and run test_start_bare_metal_server_value_error.
+ _service.enable_retries()
+ self.test_start_bare_metal_server_value_error()
+
+ # Disable retries and run test_start_bare_metal_server_value_error.
+ _service.disable_retries()
+ self.test_start_bare_metal_server_value_error()
+
+
+class TestStopBareMetalServer:
"""
- Test Class for delete_snapshots
+ Test Class for stop_bare_metal_server
"""
@responses.activate
- def test_delete_snapshots_all_params(self):
+ def test_stop_bare_metal_server_all_params(self):
"""
- delete_snapshots()
+ stop_bare_metal_server()
"""
# Set up mock
- url = preprocess_url('/snapshots')
+ url = preprocess_url('/bare_metal_servers/testString/stop')
responses.add(
- responses.DELETE,
+ responses.POST,
url,
status=204,
)
# Set up parameter values
- source_volume_id = 'testString'
+ id = 'testString'
+ type = 'hard'
# Invoke method
- response = _service.delete_snapshots(
- source_volume_id,
+ response = _service.stop_bare_metal_server(
+ id,
+ type,
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
+ # Validate body params
+ req_body = json.loads(str(responses.calls[0].request.body, 'utf-8'))
+ assert req_body['type'] == 'hard'
- def test_delete_snapshots_all_params_with_retries(self):
- # Enable retries and run test_delete_snapshots_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_delete_snapshots_all_params()
+ self.test_stop_bare_metal_server_all_params()
- # Disable retries and run test_delete_snapshots_all_params.
+ # Disable retries and run test_stop_bare_metal_server_all_params.
_service.disable_retries()
- self.test_delete_snapshots_all_params()
+ self.test_stop_bare_metal_server_all_params()
@responses.activate
- def test_delete_snapshots_value_error(self):
+ def test_stop_bare_metal_server_value_error(self):
"""
- test_delete_snapshots_value_error()
+ test_stop_bare_metal_server_value_error()
"""
# Set up mock
- url = preprocess_url('/snapshots')
+ url = preprocess_url('/bare_metal_servers/testString/stop')
responses.add(
- responses.DELETE,
+ responses.POST,
url,
status=204,
)
# Set up parameter values
- source_volume_id = 'testString'
+ id = 'testString'
+ type = 'hard'
# Pass in all but one required param and check for a ValueError
req_param_dict = {
- "source_volume_id": source_volume_id,
+ "id": id,
+ "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.delete_snapshots(**req_copy)
+ _service.stop_bare_metal_server(**req_copy)
- def test_delete_snapshots_value_error_with_retries(self):
- # Enable retries and run test_delete_snapshots_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_delete_snapshots_value_error()
+ self.test_stop_bare_metal_server_value_error()
- # Disable retries and run test_delete_snapshots_value_error.
+ # Disable retries and run test_stop_bare_metal_server_value_error.
_service.disable_retries()
- self.test_delete_snapshots_value_error()
+ self.test_stop_bare_metal_server_value_error()
-class TestListSnapshots:
+# endregion
+##############################################################################
+# End of Service: BareMetalServers
+##############################################################################
+
+##############################################################################
+# Start of Service: Volumes
+##############################################################################
+# region
+
+
+class TestNewInstance:
"""
- Test Class for list_snapshots
+ 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 TestListVolumeProfiles:
+ """
+ Test Class for list_volume_profiles
"""
@responses.activate
- def test_list_snapshots_all_params(self):
+ def test_list_volume_profiles_all_params(self):
"""
- list_snapshots()
+ list_volume_profiles()
"""
# 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": [{"backup_policy_plan": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}, "bootable": true, "captured_at": "2019-01-01T12:00:00.000Z", "clones": [{"available": false, "created_at": "2019-01-01T12:00:00.000Z", "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "copies": [{"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", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}], "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/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "lifecycle_state": "stable", "minimum_capacity": 1, "name": "my-snapshot", "operating_system": {"architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64", "vendor": "Canonical", "version": "16.04 LTS"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "snapshot", "service_tags": ["service_tags"], "size": 1, "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image", "remote": {"account": {"id": "aa2432b1fa4d4ace891e9b80fc104e34", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "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", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}, "source_volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "volume"}, "user_tags": ["user_tags"]}], "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,
@@ -23525,47 +24765,11 @@ def test_list_snapshots_all_params(self):
# Set up parameter values
start = 'testString'
limit = 50
- tag = 'testString'
- resource_group_id = 'testString'
- name = 'testString'
- source_volume_id = 'testString'
- source_volume_crn = 'crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
- source_image_id = 'testString'
- source_image_crn = 'crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8'
- sort = 'name'
- backup_policy_plan_id = 'testString'
- copies_id = 'testString'
- copies_name = 'my-snapshot-copy'
- copies_crn = 'testString'
- copies_remote_region_name = 'us-south'
- source_snapshot_id = 'testString'
- source_snapshot_remote_region_name = 'us-south'
- source_volume_remote_region_name = 'us-south'
- source_image_remote_region_name = 'us-south'
- clones_zone_name = 'us-south-1'
# Invoke method
- response = _service.list_snapshots(
+ response = _service.list_volume_profiles(
start=start,
limit=limit,
- tag=tag,
- 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,
- backup_policy_plan_id=backup_policy_plan_id,
- copies_id=copies_id,
- copies_name=copies_name,
- copies_crn=copies_crn,
- copies_remote_region_name=copies_remote_region_name,
- source_snapshot_id=source_snapshot_id,
- source_snapshot_remote_region_name=source_snapshot_remote_region_name,
- source_volume_remote_region_name=source_volume_remote_region_name,
- source_image_remote_region_name=source_image_remote_region_name,
- clones_zone_name=clones_zone_name,
headers={},
)
@@ -23577,42 +24781,24 @@ 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 'tag={}'.format(tag) 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
- assert 'backup_policy_plan.id={}'.format(backup_policy_plan_id) in query_string
- assert 'copies[].id={}'.format(copies_id) in query_string
- assert 'copies[].name={}'.format(copies_name) in query_string
- assert 'copies[].crn={}'.format(copies_crn) in query_string
- assert 'copies[].remote.region.name={}'.format(copies_remote_region_name) in query_string
- assert 'source_snapshot.id={}'.format(source_snapshot_id) in query_string
- assert 'source_snapshot.remote.region.name={}'.format(source_snapshot_remote_region_name) in query_string
- assert 'source_volume.remote.region.name={}'.format(source_volume_remote_region_name) in query_string
- assert 'source_image.remote.region.name={}'.format(source_image_remote_region_name) in query_string
- assert 'clones[].zone.name={}'.format(clones_zone_name) in query_string
- def test_list_snapshots_all_params_with_retries(self):
- # Enable retries and run test_list_snapshots_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_snapshots_all_params()
+ self.test_list_volume_profiles_all_params()
- # Disable retries and run test_list_snapshots_all_params.
+ # Disable retries and run test_list_volume_profiles_all_params.
_service.disable_retries()
- self.test_list_snapshots_all_params()
+ self.test_list_volume_profiles_all_params()
@responses.activate
- def test_list_snapshots_required_params(self):
+ def test_list_volume_profiles_required_params(self):
"""
- test_list_snapshots_required_params()
+ test_list_volume_profiles_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": [{"backup_policy_plan": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}, "bootable": true, "captured_at": "2019-01-01T12:00:00.000Z", "clones": [{"available": false, "created_at": "2019-01-01T12:00:00.000Z", "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "copies": [{"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", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}], "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/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "lifecycle_state": "stable", "minimum_capacity": 1, "name": "my-snapshot", "operating_system": {"architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64", "vendor": "Canonical", "version": "16.04 LTS"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "snapshot", "service_tags": ["service_tags"], "size": 1, "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image", "remote": {"account": {"id": "aa2432b1fa4d4ace891e9b80fc104e34", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "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", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}, "source_volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "volume"}, "user_tags": ["user_tags"]}], "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,
@@ -23622,29 +24808,29 @@ def test_list_snapshots_required_params(self):
)
# Invoke method
- response = _service.list_snapshots()
+ response = _service.list_volume_profiles()
# 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_volume_profiles_required_params_with_retries(self):
+ # Enable retries and run test_list_volume_profiles_required_params.
_service.enable_retries()
- self.test_list_snapshots_required_params()
+ self.test_list_volume_profiles_required_params()
- # Disable retries and run test_list_snapshots_required_params.
+ # Disable retries and run test_list_volume_profiles_required_params.
_service.disable_retries()
- self.test_list_snapshots_required_params()
+ self.test_list_volume_profiles_required_params()
@responses.activate
- def test_list_snapshots_value_error(self):
+ def test_list_volume_profiles_value_error(self):
"""
- test_list_snapshots_value_error()
+ test_list_volume_profiles_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": [{"backup_policy_plan": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}, "bootable": true, "captured_at": "2019-01-01T12:00:00.000Z", "clones": [{"available": false, "created_at": "2019-01-01T12:00:00.000Z", "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "copies": [{"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", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}], "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/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "lifecycle_state": "stable", "minimum_capacity": 1, "name": "my-snapshot", "operating_system": {"architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64", "vendor": "Canonical", "version": "16.04 LTS"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "snapshot", "service_tags": ["service_tags"], "size": 1, "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image", "remote": {"account": {"id": "aa2432b1fa4d4ace891e9b80fc104e34", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "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", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}, "source_volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "volume"}, "user_tags": ["user_tags"]}], "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,
@@ -23659,26 +24845,26 @@ def test_list_snapshots_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_snapshots(**req_copy)
+ _service.list_volume_profiles(**req_copy)
- def test_list_snapshots_value_error_with_retries(self):
- # Enable retries and run test_list_snapshots_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_snapshots_value_error()
+ self.test_list_volume_profiles_value_error()
- # Disable retries and run test_list_snapshots_value_error.
+ # Disable retries and run test_list_volume_profiles_value_error.
_service.disable_retries()
- self.test_list_snapshots_value_error()
+ self.test_list_volume_profiles_value_error()
@responses.activate
- def test_list_snapshots_with_pager_get_next(self):
+ def test_list_volume_profiles_with_pager_get_next(self):
"""
- test_list_snapshots_with_pager_get_next()
+ test_list_volume_profiles_with_pager_get_next()
"""
# Set up a two-page mock response
- url = preprocess_url('/snapshots')
- mock_response1 = '{"snapshots":[{"backup_policy_plan":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178","id":"r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178","name":"my-policy-plan","remote":{"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"backup_policy_plan"},"bootable":true,"captured_at":"2019-01-01T12:00:00.000Z","clones":[{"available":false,"created_at":"2019-01-01T12:00:00.000Z","zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"copies":[{"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","remote":{"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"snapshot"}],"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/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"},"href":"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263","id":"r134-f6bfa329-0e36-433f-a3bb-0df632e79263","lifecycle_state":"stable","minimum_capacity":1,"name":"my-snapshot","operating_system":{"architecture":"amd64","dedicated_host_only":false,"display_name":"Ubuntu Server 16.04 LTS amd64","family":"Ubuntu Server","href":"https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64","name":"ubuntu-16-amd64","vendor":"Canonical","version":"16.04 LTS"},"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"snapshot","service_tags":["service_tags"],"size":1,"source_image":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","id":"72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","name":"my-image","remote":{"account":{"id":"aa2432b1fa4d4ace891e9b80fc104e34","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"image"},"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","remote":{"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"snapshot"},"source_volume":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5","id":"1a6b7274-678d-4dfb-8981-c71dd9d4daa5","name":"my-volume","remote":{"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"volume"},"user_tags":["user_tags"]}],"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1}'
- mock_response2 = '{"snapshots":[{"backup_policy_plan":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178","id":"r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178","name":"my-policy-plan","remote":{"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"backup_policy_plan"},"bootable":true,"captured_at":"2019-01-01T12:00:00.000Z","clones":[{"available":false,"created_at":"2019-01-01T12:00:00.000Z","zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"copies":[{"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","remote":{"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"snapshot"}],"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/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"},"href":"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263","id":"r134-f6bfa329-0e36-433f-a3bb-0df632e79263","lifecycle_state":"stable","minimum_capacity":1,"name":"my-snapshot","operating_system":{"architecture":"amd64","dedicated_host_only":false,"display_name":"Ubuntu Server 16.04 LTS amd64","family":"Ubuntu Server","href":"https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64","name":"ubuntu-16-amd64","vendor":"Canonical","version":"16.04 LTS"},"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"snapshot","service_tags":["service_tags"],"size":1,"source_image":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","id":"72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","name":"my-image","remote":{"account":{"id":"aa2432b1fa4d4ace891e9b80fc104e34","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"image"},"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","remote":{"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"snapshot"},"source_volume":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5","id":"1a6b7274-678d-4dfb-8981-c71dd9d4daa5","name":"my-volume","remote":{"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"volume"},"user_tags":["user_tags"]}],"total_count":2,"limit":1}'
+ url = preprocess_url('/volume/profiles')
+ mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"profiles":[{"family":"tiered","href":"https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose","name":"general-purpose"}]}'
+ mock_response2 = '{"total_count":2,"limit":1,"profiles":[{"family":"tiered","href":"https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose","name":"general-purpose"}]}'
responses.add(
responses.GET,
url,
@@ -23696,27 +24882,9 @@ def test_list_snapshots_with_pager_get_next(self):
# Exercise the pager class for this operation
all_results = []
- pager = SnapshotsPager(
+ pager = VolumeProfilesPager(
client=_service,
limit=10,
- tag='testString',
- resource_group_id='testString',
- name='testString',
- source_volume_id='testString',
- source_volume_crn='crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5',
- source_image_id='testString',
- source_image_crn='crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8',
- sort='name',
- backup_policy_plan_id='testString',
- copies_id='testString',
- copies_name='my-snapshot-copy',
- copies_crn='testString',
- copies_remote_region_name='us-south',
- source_snapshot_id='testString',
- source_snapshot_remote_region_name='us-south',
- source_volume_remote_region_name='us-south',
- source_image_remote_region_name='us-south',
- clones_zone_name='us-south-1',
)
while pager.has_next():
next_page = pager.get_next()
@@ -23725,14 +24893,14 @@ def test_list_snapshots_with_pager_get_next(self):
assert len(all_results) == 2
@responses.activate
- def test_list_snapshots_with_pager_get_all(self):
+ def test_list_volume_profiles_with_pager_get_all(self):
"""
- test_list_snapshots_with_pager_get_all()
+ test_list_volume_profiles_with_pager_get_all()
"""
# Set up a two-page mock response
- url = preprocess_url('/snapshots')
- mock_response1 = '{"snapshots":[{"backup_policy_plan":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178","id":"r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178","name":"my-policy-plan","remote":{"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"backup_policy_plan"},"bootable":true,"captured_at":"2019-01-01T12:00:00.000Z","clones":[{"available":false,"created_at":"2019-01-01T12:00:00.000Z","zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"copies":[{"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","remote":{"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"snapshot"}],"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/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"},"href":"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263","id":"r134-f6bfa329-0e36-433f-a3bb-0df632e79263","lifecycle_state":"stable","minimum_capacity":1,"name":"my-snapshot","operating_system":{"architecture":"amd64","dedicated_host_only":false,"display_name":"Ubuntu Server 16.04 LTS amd64","family":"Ubuntu Server","href":"https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64","name":"ubuntu-16-amd64","vendor":"Canonical","version":"16.04 LTS"},"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"snapshot","service_tags":["service_tags"],"size":1,"source_image":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","id":"72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","name":"my-image","remote":{"account":{"id":"aa2432b1fa4d4ace891e9b80fc104e34","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"image"},"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","remote":{"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"snapshot"},"source_volume":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5","id":"1a6b7274-678d-4dfb-8981-c71dd9d4daa5","name":"my-volume","remote":{"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"volume"},"user_tags":["user_tags"]}],"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1}'
- mock_response2 = '{"snapshots":[{"backup_policy_plan":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178","id":"r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178","name":"my-policy-plan","remote":{"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"backup_policy_plan"},"bootable":true,"captured_at":"2019-01-01T12:00:00.000Z","clones":[{"available":false,"created_at":"2019-01-01T12:00:00.000Z","zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"copies":[{"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","remote":{"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"snapshot"}],"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/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"},"href":"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263","id":"r134-f6bfa329-0e36-433f-a3bb-0df632e79263","lifecycle_state":"stable","minimum_capacity":1,"name":"my-snapshot","operating_system":{"architecture":"amd64","dedicated_host_only":false,"display_name":"Ubuntu Server 16.04 LTS amd64","family":"Ubuntu Server","href":"https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64","name":"ubuntu-16-amd64","vendor":"Canonical","version":"16.04 LTS"},"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"snapshot","service_tags":["service_tags"],"size":1,"source_image":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","id":"72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","name":"my-image","remote":{"account":{"id":"aa2432b1fa4d4ace891e9b80fc104e34","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"image"},"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","remote":{"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"snapshot"},"source_volume":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5","id":"1a6b7274-678d-4dfb-8981-c71dd9d4daa5","name":"my-volume","remote":{"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"volume"},"user_tags":["user_tags"]}],"total_count":2,"limit":1}'
+ url = preprocess_url('/volume/profiles')
+ mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"profiles":[{"family":"tiered","href":"https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose","name":"general-purpose"}]}'
+ mock_response2 = '{"total_count":2,"limit":1,"profiles":[{"family":"tiered","href":"https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose","name":"general-purpose"}]}'
responses.add(
responses.GET,
url,
@@ -23749,519 +24917,574 @@ def test_list_snapshots_with_pager_get_all(self):
)
# Exercise the pager class for this operation
- pager = SnapshotsPager(
+ pager = VolumeProfilesPager(
client=_service,
limit=10,
- tag='testString',
- resource_group_id='testString',
- name='testString',
- source_volume_id='testString',
- source_volume_crn='crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5',
- source_image_id='testString',
- source_image_crn='crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8',
- sort='name',
- backup_policy_plan_id='testString',
- copies_id='testString',
- copies_name='my-snapshot-copy',
- copies_crn='testString',
- copies_remote_region_name='us-south',
- source_snapshot_id='testString',
- source_snapshot_remote_region_name='us-south',
- source_volume_remote_region_name='us-south',
- source_image_remote_region_name='us-south',
- clones_zone_name='us-south-1',
)
all_results = pager.get_all()
assert all_results is not None
assert len(all_results) == 2
-class TestCreateSnapshot:
+class TestGetVolumeProfile:
"""
- Test Class for create_snapshot
+ Test Class for get_volume_profile
"""
@responses.activate
- def test_create_snapshot_all_params(self):
+ def test_get_volume_profile_all_params(self):
"""
- create_snapshot()
+ get_volume_profile()
"""
# Set up mock
- url = preprocess_url('/snapshots')
- mock_response = '{"backup_policy_plan": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}, "bootable": true, "captured_at": "2019-01-01T12:00:00.000Z", "clones": [{"available": false, "created_at": "2019-01-01T12:00:00.000Z", "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "copies": [{"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", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}], "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/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "lifecycle_state": "stable", "minimum_capacity": 1, "name": "my-snapshot", "operating_system": {"architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64", "vendor": "Canonical", "version": "16.04 LTS"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "snapshot", "service_tags": ["service_tags"], "size": 1, "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image", "remote": {"account": {"id": "aa2432b1fa4d4ace891e9b80fc104e34", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "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", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}, "source_volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "volume"}, "user_tags": ["user_tags"]}'
+ 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.POST,
+ responses.GET,
url,
body=mock_response,
content_type='application/json',
- status=201,
+ status=200,
)
- # Construct a dict representation of a ZoneIdentityByName model
- zone_identity_model = {}
- zone_identity_model['name'] = 'us-south-1'
-
- # Construct a dict representation of a SnapshotClonePrototype model
- snapshot_clone_prototype_model = {}
- snapshot_clone_prototype_model['zone'] = zone_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 VolumeIdentityById model
- volume_identity_model = {}
- volume_identity_model['id'] = '1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
-
- # Construct a dict representation of a SnapshotPrototypeSnapshotBySourceVolume model
- snapshot_prototype_model = {}
- snapshot_prototype_model['clones'] = [snapshot_clone_prototype_model]
- snapshot_prototype_model['name'] = 'my-snapshot'
- snapshot_prototype_model['resource_group'] = resource_group_identity_model
- snapshot_prototype_model['user_tags'] = []
- snapshot_prototype_model['source_volume'] = volume_identity_model
-
# Set up parameter values
- snapshot_prototype = snapshot_prototype_model
+ name = 'testString'
# Invoke method
- response = _service.create_snapshot(
- snapshot_prototype,
+ response = _service.get_volume_profile(
+ 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 == snapshot_prototype
+ assert response.status_code == 200
- def test_create_snapshot_all_params_with_retries(self):
- # Enable retries and run test_create_snapshot_all_params.
+ 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_create_snapshot_all_params()
+ self.test_get_volume_profile_all_params()
- # Disable retries and run test_create_snapshot_all_params.
+ # Disable retries and run test_get_volume_profile_all_params.
_service.disable_retries()
- self.test_create_snapshot_all_params()
+ self.test_get_volume_profile_all_params()
@responses.activate
- def test_create_snapshot_value_error(self):
+ def test_get_volume_profile_value_error(self):
"""
- test_create_snapshot_value_error()
+ test_get_volume_profile_value_error()
"""
# Set up mock
- url = preprocess_url('/snapshots')
- mock_response = '{"backup_policy_plan": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}, "bootable": true, "captured_at": "2019-01-01T12:00:00.000Z", "clones": [{"available": false, "created_at": "2019-01-01T12:00:00.000Z", "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "copies": [{"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", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}], "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/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "lifecycle_state": "stable", "minimum_capacity": 1, "name": "my-snapshot", "operating_system": {"architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64", "vendor": "Canonical", "version": "16.04 LTS"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "snapshot", "service_tags": ["service_tags"], "size": 1, "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image", "remote": {"account": {"id": "aa2432b1fa4d4ace891e9b80fc104e34", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "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", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}, "source_volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "volume"}, "user_tags": ["user_tags"]}'
+ 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.POST,
+ responses.GET,
url,
body=mock_response,
content_type='application/json',
- status=201,
+ status=200,
)
- # Construct a dict representation of a ZoneIdentityByName model
- zone_identity_model = {}
- zone_identity_model['name'] = 'us-south-1'
-
- # Construct a dict representation of a SnapshotClonePrototype model
- snapshot_clone_prototype_model = {}
- snapshot_clone_prototype_model['zone'] = zone_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 VolumeIdentityById model
- volume_identity_model = {}
- volume_identity_model['id'] = '1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
-
- # Construct a dict representation of a SnapshotPrototypeSnapshotBySourceVolume model
- snapshot_prototype_model = {}
- snapshot_prototype_model['clones'] = [snapshot_clone_prototype_model]
- snapshot_prototype_model['name'] = 'my-snapshot'
- snapshot_prototype_model['resource_group'] = resource_group_identity_model
- snapshot_prototype_model['user_tags'] = []
- snapshot_prototype_model['source_volume'] = volume_identity_model
-
# Set up parameter values
- snapshot_prototype = snapshot_prototype_model
+ name = 'testString'
# Pass in all but one required param and check for a ValueError
req_param_dict = {
- "snapshot_prototype": snapshot_prototype,
+ "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.create_snapshot(**req_copy)
+ _service.get_volume_profile(**req_copy)
- def test_create_snapshot_value_error_with_retries(self):
- # Enable retries and run test_create_snapshot_value_error.
+ 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_create_snapshot_value_error()
+ self.test_get_volume_profile_value_error()
- # Disable retries and run test_create_snapshot_value_error.
+ # Disable retries and run test_get_volume_profile_value_error.
_service.disable_retries()
- self.test_create_snapshot_value_error()
+ self.test_get_volume_profile_value_error()
-class TestDeleteSnapshot:
+class TestListVolumes:
"""
- Test Class for delete_snapshot
+ Test Class for list_volumes
"""
@responses.activate
- def test_delete_snapshot_all_params(self):
+ def test_list_volumes_all_params(self):
"""
- delete_snapshot()
+ list_volumes()
"""
# Set up mock
- url = preprocess_url('/snapshots/testString')
+ 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"}, "total_count": 132, "volumes": [{"active": true, "attachment_state": "attached", "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/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "health_reasons": [{"code": "initializing_from_snapshot", "message": "Performance will be degraded while this volume is being initialized from its snapshot", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-snapshots-vpc-troubleshooting&interface=ui#snapshot_ts_degraded_perf"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "iops": 10000, "name": "my-volume", "operating_system": {"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"}, "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"}, "resource_type": "volume", "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", "remote": {"account": {"id": "aa2432b1fa4d4ace891e9b80fc104e34", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "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", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "user_tags": ["user_tags"], "volume_attachments": [{"delete_volume_on_instance_delete": true, "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}, "name": "my-volume-attachment", "type": "boot"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}]}'
responses.add(
- responses.DELETE,
+ responses.GET,
url,
- status=204,
+ body=mock_response,
+ content_type='application/json',
+ status=200,
)
# Set up parameter values
- id = 'testString'
- if_match = 'W/"96d225c4-56bd-43d9-98fc-d7148e5c5028"'
+ start = 'testString'
+ limit = 50
+ name = 'testString'
+ attachment_state = 'attached'
+ encryption = 'provider_managed'
+ operating_system_family = 'Ubuntu Server'
+ operating_system_architecture = 'amd64'
+ zone_name = 'us-south-1'
# Invoke method
- response = _service.delete_snapshot(
- id,
- if_match=if_match,
+ response = _service.list_volumes(
+ start=start,
+ limit=limit,
+ name=name,
+ attachment_state=attachment_state,
+ encryption=encryption,
+ operating_system_family=operating_system_family,
+ operating_system_architecture=operating_system_architecture,
+ zone_name=zone_name,
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
+ assert 'name={}'.format(name) in query_string
+ assert 'attachment_state={}'.format(attachment_state) in query_string
+ assert 'encryption={}'.format(encryption) in query_string
+ assert 'operating_system.family={}'.format(operating_system_family) in query_string
+ assert 'operating_system.architecture={}'.format(operating_system_architecture) in query_string
+ assert 'zone.name={}'.format(zone_name) in query_string
- def test_delete_snapshot_all_params_with_retries(self):
- # Enable retries and run test_delete_snapshot_all_params.
+ def test_list_volumes_all_params_with_retries(self):
+ # Enable retries and run test_list_volumes_all_params.
_service.enable_retries()
- self.test_delete_snapshot_all_params()
+ self.test_list_volumes_all_params()
- # Disable retries and run test_delete_snapshot_all_params.
+ # Disable retries and run test_list_volumes_all_params.
_service.disable_retries()
- self.test_delete_snapshot_all_params()
+ self.test_list_volumes_all_params()
@responses.activate
- def test_delete_snapshot_required_params(self):
+ def test_list_volumes_required_params(self):
"""
- test_delete_snapshot_required_params()
+ test_list_volumes_required_params()
"""
# Set up mock
- url = preprocess_url('/snapshots/testString')
+ 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"}, "total_count": 132, "volumes": [{"active": true, "attachment_state": "attached", "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/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "health_reasons": [{"code": "initializing_from_snapshot", "message": "Performance will be degraded while this volume is being initialized from its snapshot", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-snapshots-vpc-troubleshooting&interface=ui#snapshot_ts_degraded_perf"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "iops": 10000, "name": "my-volume", "operating_system": {"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"}, "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"}, "resource_type": "volume", "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", "remote": {"account": {"id": "aa2432b1fa4d4ace891e9b80fc104e34", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "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", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "user_tags": ["user_tags"], "volume_attachments": [{"delete_volume_on_instance_delete": true, "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}, "name": "my-volume-attachment", "type": "boot"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}]}'
responses.add(
- responses.DELETE,
+ responses.GET,
url,
- status=204,
+ body=mock_response,
+ content_type='application/json',
+ status=200,
)
- # Set up parameter values
- id = 'testString'
-
# Invoke method
- response = _service.delete_snapshot(
- id,
- headers={},
- )
+ response = _service.list_volumes()
# Check for correct operation
assert len(responses.calls) == 1
- assert response.status_code == 204
+ assert response.status_code == 200
- def test_delete_snapshot_required_params_with_retries(self):
- # Enable retries and run test_delete_snapshot_required_params.
+ def test_list_volumes_required_params_with_retries(self):
+ # Enable retries and run test_list_volumes_required_params.
_service.enable_retries()
- self.test_delete_snapshot_required_params()
+ self.test_list_volumes_required_params()
- # Disable retries and run test_delete_snapshot_required_params.
+ # Disable retries and run test_list_volumes_required_params.
_service.disable_retries()
- self.test_delete_snapshot_required_params()
+ self.test_list_volumes_required_params()
@responses.activate
- def test_delete_snapshot_value_error(self):
+ def test_list_volumes_value_error(self):
"""
- test_delete_snapshot_value_error()
+ test_list_volumes_value_error()
"""
# Set up mock
- url = preprocess_url('/snapshots/testString')
+ 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"}, "total_count": 132, "volumes": [{"active": true, "attachment_state": "attached", "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/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "health_reasons": [{"code": "initializing_from_snapshot", "message": "Performance will be degraded while this volume is being initialized from its snapshot", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-snapshots-vpc-troubleshooting&interface=ui#snapshot_ts_degraded_perf"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "iops": 10000, "name": "my-volume", "operating_system": {"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"}, "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"}, "resource_type": "volume", "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", "remote": {"account": {"id": "aa2432b1fa4d4ace891e9b80fc104e34", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "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", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "user_tags": ["user_tags"], "volume_attachments": [{"delete_volume_on_instance_delete": true, "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}, "name": "my-volume-attachment", "type": "boot"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}]}'
responses.add(
- responses.DELETE,
+ responses.GET,
url,
- status=204,
+ 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.delete_snapshot(**req_copy)
+ _service.list_volumes(**req_copy)
- def test_delete_snapshot_value_error_with_retries(self):
- # Enable retries and run test_delete_snapshot_value_error.
+ def test_list_volumes_value_error_with_retries(self):
+ # Enable retries and run test_list_volumes_value_error.
_service.enable_retries()
- self.test_delete_snapshot_value_error()
+ self.test_list_volumes_value_error()
- # Disable retries and run test_delete_snapshot_value_error.
+ # Disable retries and run test_list_volumes_value_error.
_service.disable_retries()
- self.test_delete_snapshot_value_error()
+ self.test_list_volumes_value_error()
+
+ @responses.activate
+ def test_list_volumes_with_pager_get_next(self):
+ """
+ test_list_volumes_with_pager_get_next()
+ """
+ # Set up a two-page mock response
+ url = preprocess_url('/volumes')
+ mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"volumes":[{"active":true,"attachment_state":"attached","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/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"},"health_reasons":[{"code":"initializing_from_snapshot","message":"Performance will be degraded while this volume is being initialized from its snapshot","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-snapshots-vpc-troubleshooting&interface=ui#snapshot_ts_degraded_perf"}],"health_state":"ok","href":"https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5","id":"1a6b7274-678d-4dfb-8981-c71dd9d4daa5","iops":10000,"name":"my-volume","operating_system":{"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"},"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"},"resource_type":"volume","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","remote":{"account":{"id":"aa2432b1fa4d4ace891e9b80fc104e34","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"image"},"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","remote":{"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"snapshot"},"status":"available","status_reasons":[{"code":"encryption_key_deleted","message":"message","more_info":"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}],"user_tags":["user_tags"],"volume_attachments":[{"delete_volume_on_instance_delete":true,"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"device":{"id":"80b3e36e-41f4-40e9-bd56-beae81792a68"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a","id":"82cbf856-9cbb-45fb-b62f-d7bcef32399a","instance":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a","id":"1e09281b-f177-46fb-baf1-bc152b2e391a","name":"my-instance"},"name":"my-volume-attachment","type":"boot"}],"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}]}'
+ mock_response2 = '{"total_count":2,"limit":1,"volumes":[{"active":true,"attachment_state":"attached","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/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"},"health_reasons":[{"code":"initializing_from_snapshot","message":"Performance will be degraded while this volume is being initialized from its snapshot","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-snapshots-vpc-troubleshooting&interface=ui#snapshot_ts_degraded_perf"}],"health_state":"ok","href":"https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5","id":"1a6b7274-678d-4dfb-8981-c71dd9d4daa5","iops":10000,"name":"my-volume","operating_system":{"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"},"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"},"resource_type":"volume","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","remote":{"account":{"id":"aa2432b1fa4d4ace891e9b80fc104e34","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"image"},"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","remote":{"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"snapshot"},"status":"available","status_reasons":[{"code":"encryption_key_deleted","message":"message","more_info":"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}],"user_tags":["user_tags"],"volume_attachments":[{"delete_volume_on_instance_delete":true,"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"device":{"id":"80b3e36e-41f4-40e9-bd56-beae81792a68"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a","id":"82cbf856-9cbb-45fb-b62f-d7bcef32399a","instance":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a","id":"1e09281b-f177-46fb-baf1-bc152b2e391a","name":"my-instance"},"name":"my-volume-attachment","type":"boot"}],"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}]}'
+ responses.add(
+ responses.GET,
+ url,
+ body=mock_response1,
+ content_type='application/json',
+ status=200,
+ )
+ responses.add(
+ responses.GET,
+ url,
+ body=mock_response2,
+ content_type='application/json',
+ status=200,
+ )
+ # Exercise the pager class for this operation
+ all_results = []
+ pager = VolumesPager(
+ client=_service,
+ limit=10,
+ name='testString',
+ attachment_state='attached',
+ encryption='provider_managed',
+ operating_system_family='Ubuntu Server',
+ operating_system_architecture='amd64',
+ zone_name='us-south-1',
+ )
+ while pager.has_next():
+ next_page = pager.get_next()
+ assert next_page is not None
+ all_results.extend(next_page)
+ assert len(all_results) == 2
-class TestGetSnapshot:
+ @responses.activate
+ def test_list_volumes_with_pager_get_all(self):
+ """
+ test_list_volumes_with_pager_get_all()
+ """
+ # Set up a two-page mock response
+ url = preprocess_url('/volumes')
+ mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"volumes":[{"active":true,"attachment_state":"attached","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/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"},"health_reasons":[{"code":"initializing_from_snapshot","message":"Performance will be degraded while this volume is being initialized from its snapshot","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-snapshots-vpc-troubleshooting&interface=ui#snapshot_ts_degraded_perf"}],"health_state":"ok","href":"https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5","id":"1a6b7274-678d-4dfb-8981-c71dd9d4daa5","iops":10000,"name":"my-volume","operating_system":{"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"},"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"},"resource_type":"volume","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","remote":{"account":{"id":"aa2432b1fa4d4ace891e9b80fc104e34","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"image"},"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","remote":{"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"snapshot"},"status":"available","status_reasons":[{"code":"encryption_key_deleted","message":"message","more_info":"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}],"user_tags":["user_tags"],"volume_attachments":[{"delete_volume_on_instance_delete":true,"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"device":{"id":"80b3e36e-41f4-40e9-bd56-beae81792a68"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a","id":"82cbf856-9cbb-45fb-b62f-d7bcef32399a","instance":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a","id":"1e09281b-f177-46fb-baf1-bc152b2e391a","name":"my-instance"},"name":"my-volume-attachment","type":"boot"}],"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}]}'
+ mock_response2 = '{"total_count":2,"limit":1,"volumes":[{"active":true,"attachment_state":"attached","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/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"},"health_reasons":[{"code":"initializing_from_snapshot","message":"Performance will be degraded while this volume is being initialized from its snapshot","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-snapshots-vpc-troubleshooting&interface=ui#snapshot_ts_degraded_perf"}],"health_state":"ok","href":"https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5","id":"1a6b7274-678d-4dfb-8981-c71dd9d4daa5","iops":10000,"name":"my-volume","operating_system":{"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"},"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"},"resource_type":"volume","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","remote":{"account":{"id":"aa2432b1fa4d4ace891e9b80fc104e34","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"image"},"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","remote":{"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"snapshot"},"status":"available","status_reasons":[{"code":"encryption_key_deleted","message":"message","more_info":"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}],"user_tags":["user_tags"],"volume_attachments":[{"delete_volume_on_instance_delete":true,"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"device":{"id":"80b3e36e-41f4-40e9-bd56-beae81792a68"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a","id":"82cbf856-9cbb-45fb-b62f-d7bcef32399a","instance":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a","id":"1e09281b-f177-46fb-baf1-bc152b2e391a","name":"my-instance"},"name":"my-volume-attachment","type":"boot"}],"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}]}'
+ responses.add(
+ responses.GET,
+ url,
+ body=mock_response1,
+ content_type='application/json',
+ status=200,
+ )
+ responses.add(
+ responses.GET,
+ url,
+ body=mock_response2,
+ content_type='application/json',
+ status=200,
+ )
+
+ # Exercise the pager class for this operation
+ pager = VolumesPager(
+ client=_service,
+ limit=10,
+ name='testString',
+ attachment_state='attached',
+ encryption='provider_managed',
+ operating_system_family='Ubuntu Server',
+ operating_system_architecture='amd64',
+ zone_name='us-south-1',
+ )
+ all_results = pager.get_all()
+ assert all_results is not None
+ assert len(all_results) == 2
+
+
+class TestCreateVolume:
"""
- Test Class for get_snapshot
+ Test Class for create_volume
"""
@responses.activate
- def test_get_snapshot_all_params(self):
+ def test_create_volume_all_params(self):
"""
- get_snapshot()
+ create_volume()
"""
# Set up mock
- url = preprocess_url('/snapshots/testString')
- mock_response = '{"backup_policy_plan": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}, "bootable": true, "captured_at": "2019-01-01T12:00:00.000Z", "clones": [{"available": false, "created_at": "2019-01-01T12:00:00.000Z", "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "copies": [{"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", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}], "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/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "lifecycle_state": "stable", "minimum_capacity": 1, "name": "my-snapshot", "operating_system": {"architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64", "vendor": "Canonical", "version": "16.04 LTS"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "snapshot", "service_tags": ["service_tags"], "size": 1, "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image", "remote": {"account": {"id": "aa2432b1fa4d4ace891e9b80fc104e34", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "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", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}, "source_volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "volume"}, "user_tags": ["user_tags"]}'
+ url = preprocess_url('/volumes')
+ mock_response = '{"active": true, "attachment_state": "attached", "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/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "health_reasons": [{"code": "initializing_from_snapshot", "message": "Performance will be degraded while this volume is being initialized from its snapshot", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-snapshots-vpc-troubleshooting&interface=ui#snapshot_ts_degraded_perf"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "iops": 10000, "name": "my-volume", "operating_system": {"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"}, "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"}, "resource_type": "volume", "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", "remote": {"account": {"id": "aa2432b1fa4d4ace891e9b80fc104e34", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "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", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "user_tags": ["user_tags"], "volume_attachments": [{"delete_volume_on_instance_delete": true, "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}, "name": "my-volume-attachment", "type": "boot"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
responses.add(
- responses.GET,
+ responses.POST,
url,
body=mock_response,
content_type='application/json',
- status=200,
+ 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/123456: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['user_tags'] = []
+ 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
- id = 'testString'
+ volume_prototype = volume_prototype_model
# Invoke method
- response = _service.get_snapshot(
- id,
+ response = _service.create_volume(
+ volume_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 == volume_prototype
- def test_get_snapshot_all_params_with_retries(self):
- # Enable retries and run test_get_snapshot_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_get_snapshot_all_params()
+ self.test_create_volume_all_params()
- # Disable retries and run test_get_snapshot_all_params.
+ # Disable retries and run test_create_volume_all_params.
_service.disable_retries()
- self.test_get_snapshot_all_params()
+ self.test_create_volume_all_params()
@responses.activate
- def test_get_snapshot_value_error(self):
+ def test_create_volume_value_error(self):
"""
- test_get_snapshot_value_error()
+ test_create_volume_value_error()
"""
# Set up mock
- url = preprocess_url('/snapshots/testString')
- mock_response = '{"backup_policy_plan": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}, "bootable": true, "captured_at": "2019-01-01T12:00:00.000Z", "clones": [{"available": false, "created_at": "2019-01-01T12:00:00.000Z", "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "copies": [{"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", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}], "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/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "lifecycle_state": "stable", "minimum_capacity": 1, "name": "my-snapshot", "operating_system": {"architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64", "vendor": "Canonical", "version": "16.04 LTS"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "snapshot", "service_tags": ["service_tags"], "size": 1, "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image", "remote": {"account": {"id": "aa2432b1fa4d4ace891e9b80fc104e34", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "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", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}, "source_volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "volume"}, "user_tags": ["user_tags"]}'
+ url = preprocess_url('/volumes')
+ mock_response = '{"active": true, "attachment_state": "attached", "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/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "health_reasons": [{"code": "initializing_from_snapshot", "message": "Performance will be degraded while this volume is being initialized from its snapshot", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-snapshots-vpc-troubleshooting&interface=ui#snapshot_ts_degraded_perf"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "iops": 10000, "name": "my-volume", "operating_system": {"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"}, "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"}, "resource_type": "volume", "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", "remote": {"account": {"id": "aa2432b1fa4d4ace891e9b80fc104e34", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "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", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "user_tags": ["user_tags"], "volume_attachments": [{"delete_volume_on_instance_delete": true, "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}, "name": "my-volume-attachment", "type": "boot"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
responses.add(
- responses.GET,
+ responses.POST,
url,
body=mock_response,
content_type='application/json',
- status=200,
+ 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/123456: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['user_tags'] = []
+ 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
- id = 'testString'
+ volume_prototype = volume_prototype_model
# Pass in all but one required param and check for a ValueError
req_param_dict = {
- "id": id,
+ "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.get_snapshot(**req_copy)
+ _service.create_volume(**req_copy)
- def test_get_snapshot_value_error_with_retries(self):
- # Enable retries and run test_get_snapshot_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_get_snapshot_value_error()
+ self.test_create_volume_value_error()
- # Disable retries and run test_get_snapshot_value_error.
+ # Disable retries and run test_create_volume_value_error.
_service.disable_retries()
- self.test_get_snapshot_value_error()
+ self.test_create_volume_value_error()
-class TestUpdateSnapshot:
+class TestDeleteVolume:
"""
- Test Class for update_snapshot
+ Test Class for delete_volume
"""
@responses.activate
- def test_update_snapshot_all_params(self):
+ def test_delete_volume_all_params(self):
"""
- update_snapshot()
+ delete_volume()
"""
# Set up mock
- url = preprocess_url('/snapshots/testString')
- mock_response = '{"backup_policy_plan": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}, "bootable": true, "captured_at": "2019-01-01T12:00:00.000Z", "clones": [{"available": false, "created_at": "2019-01-01T12:00:00.000Z", "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "copies": [{"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", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}], "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/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "lifecycle_state": "stable", "minimum_capacity": 1, "name": "my-snapshot", "operating_system": {"architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64", "vendor": "Canonical", "version": "16.04 LTS"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "snapshot", "service_tags": ["service_tags"], "size": 1, "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image", "remote": {"account": {"id": "aa2432b1fa4d4ace891e9b80fc104e34", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "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", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}, "source_volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "volume"}, "user_tags": ["user_tags"]}'
+ url = preprocess_url('/volumes/testString')
responses.add(
- responses.PATCH,
+ responses.DELETE,
url,
- body=mock_response,
- content_type='application/json',
- status=200,
+ status=204,
)
- # Construct a dict representation of a SnapshotPatch model
- snapshot_patch_model = {}
- snapshot_patch_model['name'] = 'my-snapshot'
- snapshot_patch_model['user_tags'] = ['testString']
-
# Set up parameter values
id = 'testString'
- snapshot_patch = snapshot_patch_model
if_match = 'W/"96d225c4-56bd-43d9-98fc-d7148e5c5028"'
# Invoke method
- response = _service.update_snapshot(
+ response = _service.delete_volume(
id,
- snapshot_patch,
if_match=if_match,
headers={},
)
# Check for correct operation
assert len(responses.calls) == 1
- assert response.status_code == 200
- # Validate body params
- req_body = json.loads(str(responses.calls[0].request.body, 'utf-8'))
- assert req_body == snapshot_patch
+ assert response.status_code == 204
- def test_update_snapshot_all_params_with_retries(self):
- # Enable retries and run test_update_snapshot_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_update_snapshot_all_params()
+ self.test_delete_volume_all_params()
- # Disable retries and run test_update_snapshot_all_params.
+ # Disable retries and run test_delete_volume_all_params.
_service.disable_retries()
- self.test_update_snapshot_all_params()
+ self.test_delete_volume_all_params()
@responses.activate
- def test_update_snapshot_required_params(self):
+ def test_delete_volume_required_params(self):
"""
- test_update_snapshot_required_params()
+ test_delete_volume_required_params()
"""
# Set up mock
- url = preprocess_url('/snapshots/testString')
- mock_response = '{"backup_policy_plan": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}, "bootable": true, "captured_at": "2019-01-01T12:00:00.000Z", "clones": [{"available": false, "created_at": "2019-01-01T12:00:00.000Z", "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "copies": [{"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", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}], "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/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "lifecycle_state": "stable", "minimum_capacity": 1, "name": "my-snapshot", "operating_system": {"architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64", "vendor": "Canonical", "version": "16.04 LTS"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "snapshot", "service_tags": ["service_tags"], "size": 1, "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image", "remote": {"account": {"id": "aa2432b1fa4d4ace891e9b80fc104e34", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "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", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}, "source_volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "volume"}, "user_tags": ["user_tags"]}'
+ url = preprocess_url('/volumes/testString')
responses.add(
- responses.PATCH,
+ responses.DELETE,
url,
- body=mock_response,
- content_type='application/json',
- status=200,
+ status=204,
)
- # Construct a dict representation of a SnapshotPatch model
- snapshot_patch_model = {}
- snapshot_patch_model['name'] = 'my-snapshot'
- snapshot_patch_model['user_tags'] = ['testString']
-
# Set up parameter values
id = 'testString'
- snapshot_patch = snapshot_patch_model
# Invoke method
- response = _service.update_snapshot(
+ response = _service.delete_volume(
id,
- snapshot_patch,
headers={},
)
# Check for correct operation
assert len(responses.calls) == 1
- assert response.status_code == 200
- # Validate body params
- req_body = json.loads(str(responses.calls[0].request.body, 'utf-8'))
- assert req_body == snapshot_patch
+ assert response.status_code == 204
- def test_update_snapshot_required_params_with_retries(self):
- # Enable retries and run test_update_snapshot_required_params.
+ def test_delete_volume_required_params_with_retries(self):
+ # Enable retries and run test_delete_volume_required_params.
_service.enable_retries()
- self.test_update_snapshot_required_params()
+ self.test_delete_volume_required_params()
- # Disable retries and run test_update_snapshot_required_params.
+ # Disable retries and run test_delete_volume_required_params.
_service.disable_retries()
- self.test_update_snapshot_required_params()
+ self.test_delete_volume_required_params()
@responses.activate
- def test_update_snapshot_value_error(self):
+ def test_delete_volume_value_error(self):
"""
- test_update_snapshot_value_error()
+ test_delete_volume_value_error()
"""
# Set up mock
- url = preprocess_url('/snapshots/testString')
- mock_response = '{"backup_policy_plan": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}, "bootable": true, "captured_at": "2019-01-01T12:00:00.000Z", "clones": [{"available": false, "created_at": "2019-01-01T12:00:00.000Z", "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "copies": [{"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", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}], "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/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "lifecycle_state": "stable", "minimum_capacity": 1, "name": "my-snapshot", "operating_system": {"architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64", "vendor": "Canonical", "version": "16.04 LTS"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "snapshot", "service_tags": ["service_tags"], "size": 1, "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image", "remote": {"account": {"id": "aa2432b1fa4d4ace891e9b80fc104e34", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "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", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}, "source_volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "volume"}, "user_tags": ["user_tags"]}'
+ url = preprocess_url('/volumes/testString')
responses.add(
- responses.PATCH,
+ responses.DELETE,
url,
- body=mock_response,
- content_type='application/json',
- status=200,
+ status=204,
)
- # Construct a dict representation of a SnapshotPatch model
- snapshot_patch_model = {}
- snapshot_patch_model['name'] = 'my-snapshot'
- snapshot_patch_model['user_tags'] = ['testString']
-
# Set up parameter values
id = 'testString'
- snapshot_patch = snapshot_patch_model
# Pass in all but one required param and check for a ValueError
req_param_dict = {
"id": id,
- "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_snapshot(**req_copy)
+ _service.delete_volume(**req_copy)
- def test_update_snapshot_value_error_with_retries(self):
- # Enable retries and run test_update_snapshot_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_update_snapshot_value_error()
+ self.test_delete_volume_value_error()
- # Disable retries and run test_update_snapshot_value_error.
+ # Disable retries and run test_delete_volume_value_error.
_service.disable_retries()
- self.test_update_snapshot_value_error()
+ self.test_delete_volume_value_error()
-class TestListSnapshotClones:
+class TestGetVolume:
"""
- Test Class for list_snapshot_clones
+ Test Class for get_volume
"""
@responses.activate
- def test_list_snapshot_clones_all_params(self):
+ def test_get_volume_all_params(self):
"""
- list_snapshot_clones()
+ get_volume()
"""
# Set up mock
- url = preprocess_url('/snapshots/testString/clones')
- mock_response = '{"clones": [{"available": false, "created_at": "2019-01-01T12:00:00.000Z", "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, "attachment_state": "attached", "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/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "health_reasons": [{"code": "initializing_from_snapshot", "message": "Performance will be degraded while this volume is being initialized from its snapshot", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-snapshots-vpc-troubleshooting&interface=ui#snapshot_ts_degraded_perf"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "iops": 10000, "name": "my-volume", "operating_system": {"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"}, "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"}, "resource_type": "volume", "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", "remote": {"account": {"id": "aa2432b1fa4d4ace891e9b80fc104e34", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "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", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "user_tags": ["user_tags"], "volume_attachments": [{"delete_volume_on_instance_delete": true, "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}, "name": "my-volume-attachment", "type": "boot"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
responses.add(
responses.GET,
url,
@@ -24274,7 +25497,7 @@ def test_list_snapshot_clones_all_params(self):
id = 'testString'
# Invoke method
- response = _service.list_snapshot_clones(
+ response = _service.get_volume(
id,
headers={},
)
@@ -24283,23 +25506,23 @@ def test_list_snapshot_clones_all_params(self):
assert len(responses.calls) == 1
assert response.status_code == 200
- def test_list_snapshot_clones_all_params_with_retries(self):
- # Enable retries and run test_list_snapshot_clones_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_list_snapshot_clones_all_params()
+ self.test_get_volume_all_params()
- # Disable retries and run test_list_snapshot_clones_all_params.
+ # Disable retries and run test_get_volume_all_params.
_service.disable_retries()
- self.test_list_snapshot_clones_all_params()
+ self.test_get_volume_all_params()
@responses.activate
- def test_list_snapshot_clones_value_error(self):
+ def test_get_volume_value_error(self):
"""
- test_list_snapshot_clones_value_error()
+ test_get_volume_value_error()
"""
# Set up mock
- url = preprocess_url('/snapshots/testString/clones')
- mock_response = '{"clones": [{"available": false, "created_at": "2019-01-01T12:00:00.000Z", "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, "attachment_state": "attached", "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/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "health_reasons": [{"code": "initializing_from_snapshot", "message": "Performance will be degraded while this volume is being initialized from its snapshot", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-snapshots-vpc-troubleshooting&interface=ui#snapshot_ts_degraded_perf"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "iops": 10000, "name": "my-volume", "operating_system": {"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"}, "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"}, "resource_type": "volume", "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", "remote": {"account": {"id": "aa2432b1fa4d4ace891e9b80fc104e34", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "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", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "user_tags": ["user_tags"], "volume_attachments": [{"delete_volume_on_instance_delete": true, "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}, "name": "my-volume-attachment", "type": "boot"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
responses.add(
responses.GET,
url,
@@ -24318,274 +25541,194 @@ def test_list_snapshot_clones_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_snapshot_clones(**req_copy)
-
- def test_list_snapshot_clones_value_error_with_retries(self):
- # Enable retries and run test_list_snapshot_clones_value_error.
- _service.enable_retries()
- self.test_list_snapshot_clones_value_error()
-
- # Disable retries and run test_list_snapshot_clones_value_error.
- _service.disable_retries()
- self.test_list_snapshot_clones_value_error()
-
-
-class TestDeleteSnapshotClone:
- """
- Test Class for delete_snapshot_clone
- """
-
- @responses.activate
- def test_delete_snapshot_clone_all_params(self):
- """
- delete_snapshot_clone()
- """
- # Set up mock
- url = preprocess_url('/snapshots/testString/clones/testString')
- responses.add(
- responses.DELETE,
- url,
- status=202,
- )
-
- # Set up parameter values
- id = 'testString'
- zone_name = 'testString'
-
- # Invoke method
- response = _service.delete_snapshot_clone(
- id,
- zone_name,
- headers={},
- )
-
- # Check for correct operation
- assert len(responses.calls) == 1
- assert response.status_code == 202
-
- def test_delete_snapshot_clone_all_params_with_retries(self):
- # Enable retries and run test_delete_snapshot_clone_all_params.
- _service.enable_retries()
- self.test_delete_snapshot_clone_all_params()
-
- # Disable retries and run test_delete_snapshot_clone_all_params.
- _service.disable_retries()
- self.test_delete_snapshot_clone_all_params()
-
- @responses.activate
- def test_delete_snapshot_clone_value_error(self):
- """
- test_delete_snapshot_clone_value_error()
- """
- # Set up mock
- url = preprocess_url('/snapshots/testString/clones/testString')
- responses.add(
- responses.DELETE,
- url,
- status=202,
- )
-
- # Set up parameter values
- id = 'testString'
- zone_name = 'testString'
-
- # Pass in all but one required param and check for a ValueError
- req_param_dict = {
- "id": id,
- "zone_name": zone_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_snapshot_clone(**req_copy)
+ _service.get_volume(**req_copy)
- def test_delete_snapshot_clone_value_error_with_retries(self):
- # Enable retries and run test_delete_snapshot_clone_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_delete_snapshot_clone_value_error()
+ self.test_get_volume_value_error()
- # Disable retries and run test_delete_snapshot_clone_value_error.
+ # Disable retries and run test_get_volume_value_error.
_service.disable_retries()
- self.test_delete_snapshot_clone_value_error()
+ self.test_get_volume_value_error()
-class TestGetSnapshotClone:
+class TestUpdateVolume:
"""
- Test Class for get_snapshot_clone
+ Test Class for update_volume
"""
@responses.activate
- def test_get_snapshot_clone_all_params(self):
+ def test_update_volume_all_params(self):
"""
- get_snapshot_clone()
+ update_volume()
"""
# Set up mock
- url = preprocess_url('/snapshots/testString/clones/testString')
- mock_response = '{"available": false, "created_at": "2019-01-01T12:00:00.000Z", "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, "attachment_state": "attached", "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/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "health_reasons": [{"code": "initializing_from_snapshot", "message": "Performance will be degraded while this volume is being initialized from its snapshot", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-snapshots-vpc-troubleshooting&interface=ui#snapshot_ts_degraded_perf"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "iops": 10000, "name": "my-volume", "operating_system": {"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"}, "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"}, "resource_type": "volume", "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", "remote": {"account": {"id": "aa2432b1fa4d4ace891e9b80fc104e34", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "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", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "user_tags": ["user_tags"], "volume_attachments": [{"delete_volume_on_instance_delete": true, "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}, "name": "my-volume-attachment", "type": "boot"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
responses.add(
- responses.GET,
+ responses.PATCH,
url,
body=mock_response,
content_type='application/json',
status=200,
)
+ # Construct a dict representation of a VolumeProfileIdentityByName model
+ volume_profile_identity_model = {}
+ volume_profile_identity_model['name'] = 'general-purpose'
+
+ # Construct a dict representation of a VolumePatch model
+ volume_patch_model = {}
+ volume_patch_model['capacity'] = 100
+ volume_patch_model['iops'] = 10000
+ volume_patch_model['name'] = 'my-volume'
+ volume_patch_model['profile'] = volume_profile_identity_model
+ volume_patch_model['user_tags'] = ['testString']
+
# Set up parameter values
id = 'testString'
- zone_name = 'testString'
+ volume_patch = volume_patch_model
+ if_match = 'W/"96d225c4-56bd-43d9-98fc-d7148e5c5028"'
# Invoke method
- response = _service.get_snapshot_clone(
+ response = _service.update_volume(
id,
- zone_name,
+ volume_patch,
+ if_match=if_match,
headers={},
)
# Check for correct operation
assert len(responses.calls) == 1
assert response.status_code == 200
+ # Validate body params
+ req_body = json.loads(str(responses.calls[0].request.body, 'utf-8'))
+ assert req_body == volume_patch
- def test_get_snapshot_clone_all_params_with_retries(self):
- # Enable retries and run test_get_snapshot_clone_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_get_snapshot_clone_all_params()
+ self.test_update_volume_all_params()
- # Disable retries and run test_get_snapshot_clone_all_params.
+ # Disable retries and run test_update_volume_all_params.
_service.disable_retries()
- self.test_get_snapshot_clone_all_params()
+ self.test_update_volume_all_params()
@responses.activate
- def test_get_snapshot_clone_value_error(self):
+ def test_update_volume_required_params(self):
"""
- test_get_snapshot_clone_value_error()
+ test_update_volume_required_params()
"""
# Set up mock
- url = preprocess_url('/snapshots/testString/clones/testString')
- mock_response = '{"available": false, "created_at": "2019-01-01T12:00:00.000Z", "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, "attachment_state": "attached", "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/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "health_reasons": [{"code": "initializing_from_snapshot", "message": "Performance will be degraded while this volume is being initialized from its snapshot", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-snapshots-vpc-troubleshooting&interface=ui#snapshot_ts_degraded_perf"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "iops": 10000, "name": "my-volume", "operating_system": {"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"}, "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"}, "resource_type": "volume", "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", "remote": {"account": {"id": "aa2432b1fa4d4ace891e9b80fc104e34", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "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", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "user_tags": ["user_tags"], "volume_attachments": [{"delete_volume_on_instance_delete": true, "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}, "name": "my-volume-attachment", "type": "boot"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
responses.add(
- responses.GET,
+ responses.PATCH,
url,
body=mock_response,
content_type='application/json',
status=200,
)
- # Set up parameter values
- id = 'testString'
- zone_name = 'testString'
-
- # Pass in all but one required param and check for a ValueError
- req_param_dict = {
- "id": id,
- "zone_name": zone_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_snapshot_clone(**req_copy)
-
- def test_get_snapshot_clone_value_error_with_retries(self):
- # Enable retries and run test_get_snapshot_clone_value_error.
- _service.enable_retries()
- self.test_get_snapshot_clone_value_error()
-
- # Disable retries and run test_get_snapshot_clone_value_error.
- _service.disable_retries()
- self.test_get_snapshot_clone_value_error()
-
-
-class TestCreateSnapshotClone:
- """
- Test Class for create_snapshot_clone
- """
+ # Construct a dict representation of a VolumeProfileIdentityByName model
+ volume_profile_identity_model = {}
+ volume_profile_identity_model['name'] = 'general-purpose'
- @responses.activate
- def test_create_snapshot_clone_all_params(self):
- """
- create_snapshot_clone()
- """
- # Set up mock
- url = preprocess_url('/snapshots/testString/clones/testString')
- mock_response = '{"available": false, "created_at": "2019-01-01T12:00:00.000Z", "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,
- )
+ # Construct a dict representation of a VolumePatch model
+ volume_patch_model = {}
+ volume_patch_model['capacity'] = 100
+ volume_patch_model['iops'] = 10000
+ volume_patch_model['name'] = 'my-volume'
+ volume_patch_model['profile'] = volume_profile_identity_model
+ volume_patch_model['user_tags'] = ['testString']
# Set up parameter values
id = 'testString'
- zone_name = 'testString'
+ volume_patch = volume_patch_model
# Invoke method
- response = _service.create_snapshot_clone(
+ response = _service.update_volume(
id,
- zone_name,
+ 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_create_snapshot_clone_all_params_with_retries(self):
- # Enable retries and run test_create_snapshot_clone_all_params.
+ def test_update_volume_required_params_with_retries(self):
+ # Enable retries and run test_update_volume_required_params.
_service.enable_retries()
- self.test_create_snapshot_clone_all_params()
+ self.test_update_volume_required_params()
- # Disable retries and run test_create_snapshot_clone_all_params.
+ # Disable retries and run test_update_volume_required_params.
_service.disable_retries()
- self.test_create_snapshot_clone_all_params()
+ self.test_update_volume_required_params()
@responses.activate
- def test_create_snapshot_clone_value_error(self):
+ def test_update_volume_value_error(self):
"""
- test_create_snapshot_clone_value_error()
+ test_update_volume_value_error()
"""
# Set up mock
- url = preprocess_url('/snapshots/testString/clones/testString')
- mock_response = '{"available": false, "created_at": "2019-01-01T12:00:00.000Z", "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, "attachment_state": "attached", "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/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "health_reasons": [{"code": "initializing_from_snapshot", "message": "Performance will be degraded while this volume is being initialized from its snapshot", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-snapshots-vpc-troubleshooting&interface=ui#snapshot_ts_degraded_perf"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "iops": 10000, "name": "my-volume", "operating_system": {"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"}, "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"}, "resource_type": "volume", "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", "remote": {"account": {"id": "aa2432b1fa4d4ace891e9b80fc104e34", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "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", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "user_tags": ["user_tags"], "volume_attachments": [{"delete_volume_on_instance_delete": true, "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}, "name": "my-volume-attachment", "type": "boot"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
responses.add(
- responses.PUT,
+ responses.PATCH,
url,
body=mock_response,
content_type='application/json',
status=200,
)
+ # Construct a dict representation of a VolumeProfileIdentityByName model
+ volume_profile_identity_model = {}
+ volume_profile_identity_model['name'] = 'general-purpose'
+
+ # Construct a dict representation of a VolumePatch model
+ volume_patch_model = {}
+ volume_patch_model['capacity'] = 100
+ volume_patch_model['iops'] = 10000
+ volume_patch_model['name'] = 'my-volume'
+ volume_patch_model['profile'] = volume_profile_identity_model
+ volume_patch_model['user_tags'] = ['testString']
+
# Set up parameter values
id = 'testString'
- zone_name = 'testString'
+ volume_patch = volume_patch_model
# Pass in all but one required param and check for a ValueError
req_param_dict = {
"id": id,
- "zone_name": zone_name,
+ "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.create_snapshot_clone(**req_copy)
+ _service.update_volume(**req_copy)
- def test_create_snapshot_clone_value_error_with_retries(self):
- # Enable retries and run test_create_snapshot_clone_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_create_snapshot_clone_value_error()
+ self.test_update_volume_value_error()
- # Disable retries and run test_create_snapshot_clone_value_error.
+ # Disable retries and run test_update_volume_value_error.
_service.disable_retries()
- self.test_create_snapshot_clone_value_error()
+ self.test_update_volume_value_error()
# endregion
##############################################################################
-# End of Service: Snapshots
+# End of Service: Volumes
##############################################################################
##############################################################################
-# Start of Service: Shares
+# Start of Service: Snapshots
##############################################################################
# region
@@ -24636,19 +25779,19 @@ def test_new_instance_required_param_none(self):
)
-class TestListShareProfiles:
+class TestListSnapshotConsistencyGroups:
"""
- Test Class for list_share_profiles
+ Test Class for list_snapshot_consistency_groups
"""
@responses.activate
- def test_list_share_profiles_all_params(self):
+ def test_list_snapshot_consistency_groups_all_params(self):
"""
- list_share_profiles()
+ list_snapshot_consistency_groups()
"""
# Set up mock
- url = preprocess_url('/share/profiles')
- mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/share/profiles?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/share/profiles?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "profiles": [{"capacity": {"type": "fixed", "value": 4800}, "family": "defined_performance", "href": "https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops", "iops": {"type": "fixed", "value": 4000}, "name": "tier-3iops", "resource_type": "share_profile"}], "total_count": 132}'
+ url = preprocess_url('/snapshot_consistency_groups')
+ mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/snapshot_consistency_groups?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/snapshot_consistency_groups?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "snapshot_consistency_groups": [{"backup_policy_plan": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::snapshot-consistency-group:r134-fa329f6b-0e36-433f-a3bb-0df632e79263", "delete_snapshots_on_delete": true, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshot_consistency_groups/r134-fa329f6b-0e36-433f-a3bb-0df632e79263", "id": "r134-fa329f6b-0e36-433f-a3bb-0df632e79263", "lifecycle_state": "stable", "name": "my-snapshot-consistency-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "snapshot_consistency_group", "service_tags": ["service_tags"], "snapshots": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}]}], "total_count": 132}'
responses.add(
responses.GET,
url,
@@ -24660,13 +25803,19 @@ def test_list_share_profiles_all_params(self):
# Set up parameter values
start = 'testString'
limit = 50
+ resource_group_id = 'testString'
+ name = 'testString'
sort = 'name'
+ backup_policy_plan_id = 'testString'
# Invoke method
- response = _service.list_share_profiles(
+ response = _service.list_snapshot_consistency_groups(
start=start,
limit=limit,
+ resource_group_id=resource_group_id,
+ name=name,
sort=sort,
+ backup_policy_plan_id=backup_policy_plan_id,
headers={},
)
@@ -24678,25 +25827,28 @@ def test_list_share_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 'name={}'.format(name) in query_string
assert 'sort={}'.format(sort) in query_string
+ assert 'backup_policy_plan.id={}'.format(backup_policy_plan_id) in query_string
- def test_list_share_profiles_all_params_with_retries(self):
- # Enable retries and run test_list_share_profiles_all_params.
+ def test_list_snapshot_consistency_groups_all_params_with_retries(self):
+ # Enable retries and run test_list_snapshot_consistency_groups_all_params.
_service.enable_retries()
- self.test_list_share_profiles_all_params()
+ self.test_list_snapshot_consistency_groups_all_params()
- # Disable retries and run test_list_share_profiles_all_params.
+ # Disable retries and run test_list_snapshot_consistency_groups_all_params.
_service.disable_retries()
- self.test_list_share_profiles_all_params()
+ self.test_list_snapshot_consistency_groups_all_params()
@responses.activate
- def test_list_share_profiles_required_params(self):
+ def test_list_snapshot_consistency_groups_required_params(self):
"""
- test_list_share_profiles_required_params()
+ test_list_snapshot_consistency_groups_required_params()
"""
# Set up mock
- url = preprocess_url('/share/profiles')
- mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/share/profiles?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/share/profiles?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "profiles": [{"capacity": {"type": "fixed", "value": 4800}, "family": "defined_performance", "href": "https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops", "iops": {"type": "fixed", "value": 4000}, "name": "tier-3iops", "resource_type": "share_profile"}], "total_count": 132}'
+ url = preprocess_url('/snapshot_consistency_groups')
+ mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/snapshot_consistency_groups?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/snapshot_consistency_groups?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "snapshot_consistency_groups": [{"backup_policy_plan": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::snapshot-consistency-group:r134-fa329f6b-0e36-433f-a3bb-0df632e79263", "delete_snapshots_on_delete": true, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshot_consistency_groups/r134-fa329f6b-0e36-433f-a3bb-0df632e79263", "id": "r134-fa329f6b-0e36-433f-a3bb-0df632e79263", "lifecycle_state": "stable", "name": "my-snapshot-consistency-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "snapshot_consistency_group", "service_tags": ["service_tags"], "snapshots": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}]}], "total_count": 132}'
responses.add(
responses.GET,
url,
@@ -24706,29 +25858,29 @@ def test_list_share_profiles_required_params(self):
)
# Invoke method
- response = _service.list_share_profiles()
+ response = _service.list_snapshot_consistency_groups()
# Check for correct operation
assert len(responses.calls) == 1
assert response.status_code == 200
- def test_list_share_profiles_required_params_with_retries(self):
- # Enable retries and run test_list_share_profiles_required_params.
+ def test_list_snapshot_consistency_groups_required_params_with_retries(self):
+ # Enable retries and run test_list_snapshot_consistency_groups_required_params.
_service.enable_retries()
- self.test_list_share_profiles_required_params()
+ self.test_list_snapshot_consistency_groups_required_params()
- # Disable retries and run test_list_share_profiles_required_params.
+ # Disable retries and run test_list_snapshot_consistency_groups_required_params.
_service.disable_retries()
- self.test_list_share_profiles_required_params()
+ self.test_list_snapshot_consistency_groups_required_params()
@responses.activate
- def test_list_share_profiles_value_error(self):
+ def test_list_snapshot_consistency_groups_value_error(self):
"""
- test_list_share_profiles_value_error()
+ test_list_snapshot_consistency_groups_value_error()
"""
# Set up mock
- url = preprocess_url('/share/profiles')
- mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/share/profiles?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/share/profiles?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "profiles": [{"capacity": {"type": "fixed", "value": 4800}, "family": "defined_performance", "href": "https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops", "iops": {"type": "fixed", "value": 4000}, "name": "tier-3iops", "resource_type": "share_profile"}], "total_count": 132}'
+ url = preprocess_url('/snapshot_consistency_groups')
+ mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/snapshot_consistency_groups?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/snapshot_consistency_groups?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "snapshot_consistency_groups": [{"backup_policy_plan": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::snapshot-consistency-group:r134-fa329f6b-0e36-433f-a3bb-0df632e79263", "delete_snapshots_on_delete": true, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshot_consistency_groups/r134-fa329f6b-0e36-433f-a3bb-0df632e79263", "id": "r134-fa329f6b-0e36-433f-a3bb-0df632e79263", "lifecycle_state": "stable", "name": "my-snapshot-consistency-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "snapshot_consistency_group", "service_tags": ["service_tags"], "snapshots": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}]}], "total_count": 132}'
responses.add(
responses.GET,
url,
@@ -24743,26 +25895,26 @@ def test_list_share_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_share_profiles(**req_copy)
+ _service.list_snapshot_consistency_groups(**req_copy)
- def test_list_share_profiles_value_error_with_retries(self):
- # Enable retries and run test_list_share_profiles_value_error.
+ def test_list_snapshot_consistency_groups_value_error_with_retries(self):
+ # Enable retries and run test_list_snapshot_consistency_groups_value_error.
_service.enable_retries()
- self.test_list_share_profiles_value_error()
+ self.test_list_snapshot_consistency_groups_value_error()
- # Disable retries and run test_list_share_profiles_value_error.
+ # Disable retries and run test_list_snapshot_consistency_groups_value_error.
_service.disable_retries()
- self.test_list_share_profiles_value_error()
+ self.test_list_snapshot_consistency_groups_value_error()
@responses.activate
- def test_list_share_profiles_with_pager_get_next(self):
+ def test_list_snapshot_consistency_groups_with_pager_get_next(self):
"""
- test_list_share_profiles_with_pager_get_next()
+ test_list_snapshot_consistency_groups_with_pager_get_next()
"""
# Set up a two-page mock response
- url = preprocess_url('/share/profiles')
- mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"profiles":[{"capacity":{"type":"fixed","value":4800},"family":"defined_performance","href":"https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops","iops":{"type":"fixed","value":4000},"name":"tier-3iops","resource_type":"share_profile"}]}'
- mock_response2 = '{"total_count":2,"limit":1,"profiles":[{"capacity":{"type":"fixed","value":4800},"family":"defined_performance","href":"https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops","iops":{"type":"fixed","value":4000},"name":"tier-3iops","resource_type":"share_profile"}]}'
+ url = preprocess_url('/snapshot_consistency_groups')
+ mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"snapshot_consistency_groups":[{"backup_policy_plan":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178","id":"r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178","name":"my-policy-plan","remote":{"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"backup_policy_plan"},"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::snapshot-consistency-group:r134-fa329f6b-0e36-433f-a3bb-0df632e79263","delete_snapshots_on_delete":true,"href":"https://us-south.iaas.cloud.ibm.com/v1/snapshot_consistency_groups/r134-fa329f6b-0e36-433f-a3bb-0df632e79263","id":"r134-fa329f6b-0e36-433f-a3bb-0df632e79263","lifecycle_state":"stable","name":"my-snapshot-consistency-group","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"snapshot_consistency_group","service_tags":["service_tags"],"snapshots":[{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263","id":"r134-f6bfa329-0e36-433f-a3bb-0df632e79263","name":"my-snapshot","remote":{"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"snapshot"}]}],"total_count":2,"limit":1}'
+ mock_response2 = '{"snapshot_consistency_groups":[{"backup_policy_plan":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178","id":"r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178","name":"my-policy-plan","remote":{"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"backup_policy_plan"},"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::snapshot-consistency-group:r134-fa329f6b-0e36-433f-a3bb-0df632e79263","delete_snapshots_on_delete":true,"href":"https://us-south.iaas.cloud.ibm.com/v1/snapshot_consistency_groups/r134-fa329f6b-0e36-433f-a3bb-0df632e79263","id":"r134-fa329f6b-0e36-433f-a3bb-0df632e79263","lifecycle_state":"stable","name":"my-snapshot-consistency-group","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"snapshot_consistency_group","service_tags":["service_tags"],"snapshots":[{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263","id":"r134-f6bfa329-0e36-433f-a3bb-0df632e79263","name":"my-snapshot","remote":{"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"snapshot"}]}],"total_count":2,"limit":1}'
responses.add(
responses.GET,
url,
@@ -24780,10 +25932,13 @@ def test_list_share_profiles_with_pager_get_next(self):
# Exercise the pager class for this operation
all_results = []
- pager = ShareProfilesPager(
+ pager = SnapshotConsistencyGroupsPager(
client=_service,
limit=10,
+ resource_group_id='testString',
+ name='testString',
sort='name',
+ backup_policy_plan_id='testString',
)
while pager.has_next():
next_page = pager.get_next()
@@ -24792,14 +25947,14 @@ def test_list_share_profiles_with_pager_get_next(self):
assert len(all_results) == 2
@responses.activate
- def test_list_share_profiles_with_pager_get_all(self):
+ def test_list_snapshot_consistency_groups_with_pager_get_all(self):
"""
- test_list_share_profiles_with_pager_get_all()
+ test_list_snapshot_consistency_groups_with_pager_get_all()
"""
# Set up a two-page mock response
- url = preprocess_url('/share/profiles')
- mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"profiles":[{"capacity":{"type":"fixed","value":4800},"family":"defined_performance","href":"https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops","iops":{"type":"fixed","value":4000},"name":"tier-3iops","resource_type":"share_profile"}]}'
- mock_response2 = '{"total_count":2,"limit":1,"profiles":[{"capacity":{"type":"fixed","value":4800},"family":"defined_performance","href":"https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops","iops":{"type":"fixed","value":4000},"name":"tier-3iops","resource_type":"share_profile"}]}'
+ url = preprocess_url('/snapshot_consistency_groups')
+ mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"snapshot_consistency_groups":[{"backup_policy_plan":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178","id":"r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178","name":"my-policy-plan","remote":{"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"backup_policy_plan"},"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::snapshot-consistency-group:r134-fa329f6b-0e36-433f-a3bb-0df632e79263","delete_snapshots_on_delete":true,"href":"https://us-south.iaas.cloud.ibm.com/v1/snapshot_consistency_groups/r134-fa329f6b-0e36-433f-a3bb-0df632e79263","id":"r134-fa329f6b-0e36-433f-a3bb-0df632e79263","lifecycle_state":"stable","name":"my-snapshot-consistency-group","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"snapshot_consistency_group","service_tags":["service_tags"],"snapshots":[{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263","id":"r134-f6bfa329-0e36-433f-a3bb-0df632e79263","name":"my-snapshot","remote":{"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"snapshot"}]}],"total_count":2,"limit":1}'
+ mock_response2 = '{"snapshot_consistency_groups":[{"backup_policy_plan":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178","id":"r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178","name":"my-policy-plan","remote":{"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"backup_policy_plan"},"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::snapshot-consistency-group:r134-fa329f6b-0e36-433f-a3bb-0df632e79263","delete_snapshots_on_delete":true,"href":"https://us-south.iaas.cloud.ibm.com/v1/snapshot_consistency_groups/r134-fa329f6b-0e36-433f-a3bb-0df632e79263","id":"r134-fa329f6b-0e36-433f-a3bb-0df632e79263","lifecycle_state":"stable","name":"my-snapshot-consistency-group","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"snapshot_consistency_group","service_tags":["service_tags"],"snapshots":[{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263","id":"r134-f6bfa329-0e36-433f-a3bb-0df632e79263","name":"my-snapshot","remote":{"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"snapshot"}]}],"total_count":2,"limit":1}'
responses.add(
responses.GET,
url,
@@ -24816,1820 +25971,1629 @@ def test_list_share_profiles_with_pager_get_all(self):
)
# Exercise the pager class for this operation
- pager = ShareProfilesPager(
+ pager = SnapshotConsistencyGroupsPager(
client=_service,
limit=10,
+ resource_group_id='testString',
+ name='testString',
sort='name',
+ backup_policy_plan_id='testString',
)
all_results = pager.get_all()
assert all_results is not None
assert len(all_results) == 2
-class TestGetShareProfile:
+class TestCreateSnapshotConsistencyGroup:
"""
- Test Class for get_share_profile
+ Test Class for create_snapshot_consistency_group
"""
@responses.activate
- def test_get_share_profile_all_params(self):
+ def test_create_snapshot_consistency_group_all_params(self):
"""
- get_share_profile()
+ create_snapshot_consistency_group()
"""
# Set up mock
- url = preprocess_url('/share/profiles/testString')
- mock_response = '{"capacity": {"type": "fixed", "value": 4800}, "family": "defined_performance", "href": "https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops", "iops": {"type": "fixed", "value": 4000}, "name": "tier-3iops", "resource_type": "share_profile"}'
+ url = preprocess_url('/snapshot_consistency_groups')
+ mock_response = '{"backup_policy_plan": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::snapshot-consistency-group:r134-fa329f6b-0e36-433f-a3bb-0df632e79263", "delete_snapshots_on_delete": true, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshot_consistency_groups/r134-fa329f6b-0e36-433f-a3bb-0df632e79263", "id": "r134-fa329f6b-0e36-433f-a3bb-0df632e79263", "lifecycle_state": "stable", "name": "my-snapshot-consistency-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "snapshot_consistency_group", "service_tags": ["service_tags"], "snapshots": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}]}'
responses.add(
- responses.GET,
+ 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 VolumeIdentityById model
+ volume_identity_model = {}
+ volume_identity_model['id'] = '1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
+
+ # Construct a dict representation of a SnapshotPrototypeSnapshotConsistencyGroupContext model
+ snapshot_prototype_snapshot_consistency_group_context_model = {}
+ snapshot_prototype_snapshot_consistency_group_context_model['name'] = 'my-snapshot'
+ snapshot_prototype_snapshot_consistency_group_context_model['source_volume'] = volume_identity_model
+ snapshot_prototype_snapshot_consistency_group_context_model['user_tags'] = ['testString']
+
+ # Construct a dict representation of a SnapshotConsistencyGroupPrototypeSnapshotConsistencyGroupBySnapshots model
+ snapshot_consistency_group_prototype_model = {}
+ snapshot_consistency_group_prototype_model['delete_snapshots_on_delete'] = True
+ snapshot_consistency_group_prototype_model['name'] = 'my-snapshot-consistency-group'
+ snapshot_consistency_group_prototype_model['resource_group'] = resource_group_identity_model
+ snapshot_consistency_group_prototype_model['snapshots'] = [snapshot_prototype_snapshot_consistency_group_context_model]
+
# Set up parameter values
- name = 'testString'
+ snapshot_consistency_group_prototype = snapshot_consistency_group_prototype_model
# Invoke method
- response = _service.get_share_profile(
- name,
+ response = _service.create_snapshot_consistency_group(
+ snapshot_consistency_group_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 == snapshot_consistency_group_prototype
- def test_get_share_profile_all_params_with_retries(self):
- # Enable retries and run test_get_share_profile_all_params.
+ def test_create_snapshot_consistency_group_all_params_with_retries(self):
+ # Enable retries and run test_create_snapshot_consistency_group_all_params.
_service.enable_retries()
- self.test_get_share_profile_all_params()
+ self.test_create_snapshot_consistency_group_all_params()
- # Disable retries and run test_get_share_profile_all_params.
+ # Disable retries and run test_create_snapshot_consistency_group_all_params.
_service.disable_retries()
- self.test_get_share_profile_all_params()
+ self.test_create_snapshot_consistency_group_all_params()
@responses.activate
- def test_get_share_profile_value_error(self):
+ def test_create_snapshot_consistency_group_value_error(self):
"""
- test_get_share_profile_value_error()
+ test_create_snapshot_consistency_group_value_error()
"""
# Set up mock
- url = preprocess_url('/share/profiles/testString')
- mock_response = '{"capacity": {"type": "fixed", "value": 4800}, "family": "defined_performance", "href": "https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops", "iops": {"type": "fixed", "value": 4000}, "name": "tier-3iops", "resource_type": "share_profile"}'
+ url = preprocess_url('/snapshot_consistency_groups')
+ mock_response = '{"backup_policy_plan": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::snapshot-consistency-group:r134-fa329f6b-0e36-433f-a3bb-0df632e79263", "delete_snapshots_on_delete": true, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshot_consistency_groups/r134-fa329f6b-0e36-433f-a3bb-0df632e79263", "id": "r134-fa329f6b-0e36-433f-a3bb-0df632e79263", "lifecycle_state": "stable", "name": "my-snapshot-consistency-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "snapshot_consistency_group", "service_tags": ["service_tags"], "snapshots": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}]}'
responses.add(
- responses.GET,
+ 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 VolumeIdentityById model
+ volume_identity_model = {}
+ volume_identity_model['id'] = '1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
+
+ # Construct a dict representation of a SnapshotPrototypeSnapshotConsistencyGroupContext model
+ snapshot_prototype_snapshot_consistency_group_context_model = {}
+ snapshot_prototype_snapshot_consistency_group_context_model['name'] = 'my-snapshot'
+ snapshot_prototype_snapshot_consistency_group_context_model['source_volume'] = volume_identity_model
+ snapshot_prototype_snapshot_consistency_group_context_model['user_tags'] = ['testString']
+
+ # Construct a dict representation of a SnapshotConsistencyGroupPrototypeSnapshotConsistencyGroupBySnapshots model
+ snapshot_consistency_group_prototype_model = {}
+ snapshot_consistency_group_prototype_model['delete_snapshots_on_delete'] = True
+ snapshot_consistency_group_prototype_model['name'] = 'my-snapshot-consistency-group'
+ snapshot_consistency_group_prototype_model['resource_group'] = resource_group_identity_model
+ snapshot_consistency_group_prototype_model['snapshots'] = [snapshot_prototype_snapshot_consistency_group_context_model]
+
# Set up parameter values
- name = 'testString'
+ snapshot_consistency_group_prototype = snapshot_consistency_group_prototype_model
# Pass in all but one required param and check for a ValueError
req_param_dict = {
- "name": name,
+ "snapshot_consistency_group_prototype": snapshot_consistency_group_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_share_profile(**req_copy)
+ _service.create_snapshot_consistency_group(**req_copy)
- def test_get_share_profile_value_error_with_retries(self):
- # Enable retries and run test_get_share_profile_value_error.
+ def test_create_snapshot_consistency_group_value_error_with_retries(self):
+ # Enable retries and run test_create_snapshot_consistency_group_value_error.
_service.enable_retries()
- self.test_get_share_profile_value_error()
+ self.test_create_snapshot_consistency_group_value_error()
- # Disable retries and run test_get_share_profile_value_error.
+ # Disable retries and run test_create_snapshot_consistency_group_value_error.
_service.disable_retries()
- self.test_get_share_profile_value_error()
+ self.test_create_snapshot_consistency_group_value_error()
-class TestListShares:
+class TestDeleteSnapshotConsistencyGroup:
"""
- Test Class for list_shares
+ Test Class for delete_snapshot_consistency_group
"""
@responses.activate
- def test_list_shares_all_params(self):
+ def test_delete_snapshot_consistency_group_all_params(self):
"""
- list_shares()
+ delete_snapshot_consistency_group()
"""
# Set up mock
- url = preprocess_url('/shares')
- mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/shares?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/shares?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "shares": [{"access_control_mode": "security_group", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "iops": 100, "latest_job": {"status": "cancelled", "status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "type": "replication_failover"}, "lifecycle_state": "stable", "mount_targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "name": "my-share-mount-target", "resource_type": "share_mount_target"}], "name": "my-share", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops", "name": "tier-3iops", "resource_type": "share_profile"}, "replica_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "resource_type": "share"}, "replication_cron_spec": "0 */5 * * *", "replication_role": "none", "replication_status": "active", "replication_status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "share", "size": 200, "source_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "resource_type": "share"}, "user_tags": ["user_tags"], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "total_count": 132}'
+ url = preprocess_url('/snapshot_consistency_groups/testString')
+ mock_response = '{"backup_policy_plan": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::snapshot-consistency-group:r134-fa329f6b-0e36-433f-a3bb-0df632e79263", "delete_snapshots_on_delete": true, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshot_consistency_groups/r134-fa329f6b-0e36-433f-a3bb-0df632e79263", "id": "r134-fa329f6b-0e36-433f-a3bb-0df632e79263", "lifecycle_state": "stable", "name": "my-snapshot-consistency-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "snapshot_consistency_group", "service_tags": ["service_tags"], "snapshots": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}]}'
responses.add(
- responses.GET,
+ responses.DELETE,
url,
body=mock_response,
content_type='application/json',
- status=200,
+ status=202,
)
# Set up parameter values
- start = 'testString'
- limit = 50
- resource_group_id = 'testString'
- name = 'testString'
- sort = 'name'
- replication_role = 'none'
+ id = 'testString'
# Invoke method
- response = _service.list_shares(
- start=start,
- limit=limit,
- resource_group_id=resource_group_id,
- name=name,
- sort=sort,
- replication_role=replication_role,
+ response = _service.delete_snapshot_consistency_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
- assert 'name={}'.format(name) in query_string
- assert 'sort={}'.format(sort) in query_string
- assert 'replication_role={}'.format(replication_role) in query_string
+ assert response.status_code == 202
- def test_list_shares_all_params_with_retries(self):
- # Enable retries and run test_list_shares_all_params.
+ def test_delete_snapshot_consistency_group_all_params_with_retries(self):
+ # Enable retries and run test_delete_snapshot_consistency_group_all_params.
_service.enable_retries()
- self.test_list_shares_all_params()
+ self.test_delete_snapshot_consistency_group_all_params()
- # Disable retries and run test_list_shares_all_params.
+ # Disable retries and run test_delete_snapshot_consistency_group_all_params.
_service.disable_retries()
- self.test_list_shares_all_params()
+ self.test_delete_snapshot_consistency_group_all_params()
@responses.activate
- def test_list_shares_required_params(self):
+ def test_delete_snapshot_consistency_group_value_error(self):
"""
- test_list_shares_required_params()
+ test_delete_snapshot_consistency_group_value_error()
"""
# Set up mock
- url = preprocess_url('/shares')
- mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/shares?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/shares?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "shares": [{"access_control_mode": "security_group", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "iops": 100, "latest_job": {"status": "cancelled", "status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "type": "replication_failover"}, "lifecycle_state": "stable", "mount_targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "name": "my-share-mount-target", "resource_type": "share_mount_target"}], "name": "my-share", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops", "name": "tier-3iops", "resource_type": "share_profile"}, "replica_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "resource_type": "share"}, "replication_cron_spec": "0 */5 * * *", "replication_role": "none", "replication_status": "active", "replication_status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "share", "size": 200, "source_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "resource_type": "share"}, "user_tags": ["user_tags"], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "total_count": 132}'
+ url = preprocess_url('/snapshot_consistency_groups/testString')
+ mock_response = '{"backup_policy_plan": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::snapshot-consistency-group:r134-fa329f6b-0e36-433f-a3bb-0df632e79263", "delete_snapshots_on_delete": true, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshot_consistency_groups/r134-fa329f6b-0e36-433f-a3bb-0df632e79263", "id": "r134-fa329f6b-0e36-433f-a3bb-0df632e79263", "lifecycle_state": "stable", "name": "my-snapshot-consistency-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "snapshot_consistency_group", "service_tags": ["service_tags"], "snapshots": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}]}'
responses.add(
- responses.GET,
+ responses.DELETE,
url,
body=mock_response,
content_type='application/json',
- status=200,
+ status=202,
)
- # Invoke method
- response = _service.list_shares()
-
- # Check for correct operation
- assert len(responses.calls) == 1
- assert response.status_code == 200
-
- def test_list_shares_required_params_with_retries(self):
- # Enable retries and run test_list_shares_required_params.
- _service.enable_retries()
- self.test_list_shares_required_params()
-
- # Disable retries and run test_list_shares_required_params.
- _service.disable_retries()
- self.test_list_shares_required_params()
-
- @responses.activate
- def test_list_shares_value_error(self):
- """
- test_list_shares_value_error()
- """
- # Set up mock
- url = preprocess_url('/shares')
- mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/shares?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/shares?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "shares": [{"access_control_mode": "security_group", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "iops": 100, "latest_job": {"status": "cancelled", "status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "type": "replication_failover"}, "lifecycle_state": "stable", "mount_targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "name": "my-share-mount-target", "resource_type": "share_mount_target"}], "name": "my-share", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops", "name": "tier-3iops", "resource_type": "share_profile"}, "replica_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "resource_type": "share"}, "replication_cron_spec": "0 */5 * * *", "replication_role": "none", "replication_status": "active", "replication_status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "share", "size": 200, "source_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "resource_type": "share"}, "user_tags": ["user_tags"], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "total_count": 132}'
- responses.add(
- responses.GET,
- url,
- body=mock_response,
- content_type='application/json',
- status=200,
- )
+ # Set up parameter values
+ 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_shares(**req_copy)
+ _service.delete_snapshot_consistency_group(**req_copy)
- def test_list_shares_value_error_with_retries(self):
- # Enable retries and run test_list_shares_value_error.
+ def test_delete_snapshot_consistency_group_value_error_with_retries(self):
+ # Enable retries and run test_delete_snapshot_consistency_group_value_error.
_service.enable_retries()
- self.test_list_shares_value_error()
+ self.test_delete_snapshot_consistency_group_value_error()
- # Disable retries and run test_list_shares_value_error.
+ # Disable retries and run test_delete_snapshot_consistency_group_value_error.
_service.disable_retries()
- self.test_list_shares_value_error()
-
- @responses.activate
- def test_list_shares_with_pager_get_next(self):
- """
- test_list_shares_with_pager_get_next()
- """
- # Set up a two-page mock response
- url = preprocess_url('/shares')
- mock_response1 = '{"shares":[{"access_control_mode":"security_group","created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58","encryption":"provider_managed","encryption_key":{"crn":"crn:v1:bluemix:public:kms:us-south:a/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"},"href":"https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58","id":"0fe9e5d8-0a4d-4818-96ec-e99708644a58","iops":100,"latest_job":{"status":"cancelled","status_reasons":[{"code":"cannot_reach_source_share","message":"The replication failover failed because the source share cannot be reached.","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}],"type":"replication_failover"},"lifecycle_state":"stable","mount_targets":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c","id":"4cf9171a-0043-4434-8727-15b53dbc374c","name":"my-share-mount-target","resource_type":"share_mount_target"}],"name":"my-share","profile":{"href":"https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops","name":"tier-3iops","resource_type":"share_profile"},"replica_share":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58","id":"0fe9e5d8-0a4d-4818-96ec-e99708644a58","name":"my-share","resource_type":"share"},"replication_cron_spec":"0 */5 * * *","replication_role":"none","replication_status":"active","replication_status_reasons":[{"code":"cannot_reach_source_share","message":"The replication failover failed because the source share cannot be reached.","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}],"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"share","size":200,"source_share":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58","id":"0fe9e5d8-0a4d-4818-96ec-e99708644a58","name":"my-share","resource_type":"share"},"user_tags":["user_tags"],"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1}'
- mock_response2 = '{"shares":[{"access_control_mode":"security_group","created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58","encryption":"provider_managed","encryption_key":{"crn":"crn:v1:bluemix:public:kms:us-south:a/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"},"href":"https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58","id":"0fe9e5d8-0a4d-4818-96ec-e99708644a58","iops":100,"latest_job":{"status":"cancelled","status_reasons":[{"code":"cannot_reach_source_share","message":"The replication failover failed because the source share cannot be reached.","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}],"type":"replication_failover"},"lifecycle_state":"stable","mount_targets":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c","id":"4cf9171a-0043-4434-8727-15b53dbc374c","name":"my-share-mount-target","resource_type":"share_mount_target"}],"name":"my-share","profile":{"href":"https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops","name":"tier-3iops","resource_type":"share_profile"},"replica_share":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58","id":"0fe9e5d8-0a4d-4818-96ec-e99708644a58","name":"my-share","resource_type":"share"},"replication_cron_spec":"0 */5 * * *","replication_role":"none","replication_status":"active","replication_status_reasons":[{"code":"cannot_reach_source_share","message":"The replication failover failed because the source share cannot be reached.","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}],"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"share","size":200,"source_share":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58","id":"0fe9e5d8-0a4d-4818-96ec-e99708644a58","name":"my-share","resource_type":"share"},"user_tags":["user_tags"],"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"total_count":2,"limit":1}'
- responses.add(
- responses.GET,
- url,
- body=mock_response1,
- content_type='application/json',
- status=200,
- )
- responses.add(
- responses.GET,
- url,
- body=mock_response2,
- content_type='application/json',
- status=200,
- )
-
- # Exercise the pager class for this operation
- all_results = []
- pager = SharesPager(
- client=_service,
- limit=10,
- resource_group_id='testString',
- name='testString',
- sort='name',
- replication_role='none',
- )
- while pager.has_next():
- next_page = pager.get_next()
- assert next_page is not None
- all_results.extend(next_page)
- assert len(all_results) == 2
-
- @responses.activate
- def test_list_shares_with_pager_get_all(self):
- """
- test_list_shares_with_pager_get_all()
- """
- # Set up a two-page mock response
- url = preprocess_url('/shares')
- mock_response1 = '{"shares":[{"access_control_mode":"security_group","created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58","encryption":"provider_managed","encryption_key":{"crn":"crn:v1:bluemix:public:kms:us-south:a/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"},"href":"https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58","id":"0fe9e5d8-0a4d-4818-96ec-e99708644a58","iops":100,"latest_job":{"status":"cancelled","status_reasons":[{"code":"cannot_reach_source_share","message":"The replication failover failed because the source share cannot be reached.","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}],"type":"replication_failover"},"lifecycle_state":"stable","mount_targets":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c","id":"4cf9171a-0043-4434-8727-15b53dbc374c","name":"my-share-mount-target","resource_type":"share_mount_target"}],"name":"my-share","profile":{"href":"https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops","name":"tier-3iops","resource_type":"share_profile"},"replica_share":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58","id":"0fe9e5d8-0a4d-4818-96ec-e99708644a58","name":"my-share","resource_type":"share"},"replication_cron_spec":"0 */5 * * *","replication_role":"none","replication_status":"active","replication_status_reasons":[{"code":"cannot_reach_source_share","message":"The replication failover failed because the source share cannot be reached.","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}],"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"share","size":200,"source_share":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58","id":"0fe9e5d8-0a4d-4818-96ec-e99708644a58","name":"my-share","resource_type":"share"},"user_tags":["user_tags"],"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1}'
- mock_response2 = '{"shares":[{"access_control_mode":"security_group","created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58","encryption":"provider_managed","encryption_key":{"crn":"crn:v1:bluemix:public:kms:us-south:a/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"},"href":"https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58","id":"0fe9e5d8-0a4d-4818-96ec-e99708644a58","iops":100,"latest_job":{"status":"cancelled","status_reasons":[{"code":"cannot_reach_source_share","message":"The replication failover failed because the source share cannot be reached.","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}],"type":"replication_failover"},"lifecycle_state":"stable","mount_targets":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c","id":"4cf9171a-0043-4434-8727-15b53dbc374c","name":"my-share-mount-target","resource_type":"share_mount_target"}],"name":"my-share","profile":{"href":"https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops","name":"tier-3iops","resource_type":"share_profile"},"replica_share":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58","id":"0fe9e5d8-0a4d-4818-96ec-e99708644a58","name":"my-share","resource_type":"share"},"replication_cron_spec":"0 */5 * * *","replication_role":"none","replication_status":"active","replication_status_reasons":[{"code":"cannot_reach_source_share","message":"The replication failover failed because the source share cannot be reached.","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}],"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"share","size":200,"source_share":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58","id":"0fe9e5d8-0a4d-4818-96ec-e99708644a58","name":"my-share","resource_type":"share"},"user_tags":["user_tags"],"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"total_count":2,"limit":1}'
- responses.add(
- responses.GET,
- url,
- body=mock_response1,
- content_type='application/json',
- status=200,
- )
- responses.add(
- responses.GET,
- url,
- body=mock_response2,
- content_type='application/json',
- status=200,
- )
-
- # Exercise the pager class for this operation
- pager = SharesPager(
- client=_service,
- limit=10,
- resource_group_id='testString',
- name='testString',
- sort='name',
- replication_role='none',
- )
- all_results = pager.get_all()
- assert all_results is not None
- assert len(all_results) == 2
+ self.test_delete_snapshot_consistency_group_value_error()
-class TestCreateShare:
+class TestGetSnapshotConsistencyGroup:
"""
- Test Class for create_share
+ Test Class for get_snapshot_consistency_group
"""
@responses.activate
- def test_create_share_all_params(self):
+ def test_get_snapshot_consistency_group_all_params(self):
"""
- create_share()
+ get_snapshot_consistency_group()
"""
# Set up mock
- url = preprocess_url('/shares')
- mock_response = '{"access_control_mode": "security_group", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "iops": 100, "latest_job": {"status": "cancelled", "status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "type": "replication_failover"}, "lifecycle_state": "stable", "mount_targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "name": "my-share-mount-target", "resource_type": "share_mount_target"}], "name": "my-share", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops", "name": "tier-3iops", "resource_type": "share_profile"}, "replica_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "resource_type": "share"}, "replication_cron_spec": "0 */5 * * *", "replication_role": "none", "replication_status": "active", "replication_status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "share", "size": 200, "source_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "resource_type": "share"}, "user_tags": ["user_tags"], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
+ url = preprocess_url('/snapshot_consistency_groups/testString')
+ mock_response = '{"backup_policy_plan": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::snapshot-consistency-group:r134-fa329f6b-0e36-433f-a3bb-0df632e79263", "delete_snapshots_on_delete": true, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshot_consistency_groups/r134-fa329f6b-0e36-433f-a3bb-0df632e79263", "id": "r134-fa329f6b-0e36-433f-a3bb-0df632e79263", "lifecycle_state": "stable", "name": "my-snapshot-consistency-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "snapshot_consistency_group", "service_tags": ["service_tags"], "snapshots": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}]}'
responses.add(
- responses.POST,
+ responses.GET,
url,
body=mock_response,
content_type='application/json',
- status=201,
+ status=200,
)
- # Construct a dict representation of a VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext model
- virtual_network_interface_primary_ip_prototype_model = {}
- virtual_network_interface_primary_ip_prototype_model['address'] = '10.0.0.5'
- virtual_network_interface_primary_ip_prototype_model['auto_delete'] = False
- virtual_network_interface_primary_ip_prototype_model['name'] = 'my-reserved-ip'
-
- # Construct a dict representation of a ResourceGroupIdentityById model
- resource_group_identity_model = {}
- resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
-
- # Construct a dict representation of a SecurityGroupIdentityById model
- security_group_identity_model = {}
- security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271'
-
- # Construct a dict representation of a SubnetIdentityById model
- subnet_identity_model = {}
- subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
-
- # Construct a dict representation of a ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfacePrototypeShareMountTargetContext model
- share_mount_target_virtual_network_interface_prototype_model = {}
- share_mount_target_virtual_network_interface_prototype_model['name'] = 'my-virtual-network-interface'
- share_mount_target_virtual_network_interface_prototype_model['primary_ip'] = virtual_network_interface_primary_ip_prototype_model
- share_mount_target_virtual_network_interface_prototype_model['resource_group'] = resource_group_identity_model
- share_mount_target_virtual_network_interface_prototype_model['security_groups'] = [security_group_identity_model]
- share_mount_target_virtual_network_interface_prototype_model['subnet'] = subnet_identity_model
-
- # Construct a dict representation of a ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup model
- share_mount_target_prototype_model = {}
- share_mount_target_prototype_model['name'] = 'my-share-mount-target'
- share_mount_target_prototype_model['transit_encryption'] = 'none'
- share_mount_target_prototype_model['virtual_network_interface'] = share_mount_target_virtual_network_interface_prototype_model
-
- # Construct a dict representation of a ShareProfileIdentityByName model
- share_profile_identity_model = {}
- share_profile_identity_model['name'] = 'tier-3iops'
-
- # Construct a dict representation of a ZoneIdentityByName model
- zone_identity_model = {}
- zone_identity_model['name'] = 'us-south-1'
-
- # Construct a dict representation of a SharePrototypeShareContext model
- share_prototype_share_context_model = {}
- share_prototype_share_context_model['iops'] = 100
- share_prototype_share_context_model['mount_targets'] = [share_mount_target_prototype_model]
- share_prototype_share_context_model['name'] = 'my-share'
- share_prototype_share_context_model['profile'] = share_profile_identity_model
- share_prototype_share_context_model['replication_cron_spec'] = '0 */5 * * *'
- share_prototype_share_context_model['resource_group'] = resource_group_identity_model
- share_prototype_share_context_model['user_tags'] = []
- share_prototype_share_context_model['zone'] = zone_identity_model
-
- # Construct a dict representation of a EncryptionKeyIdentityByCRN model
- encryption_key_identity_model = {}
- encryption_key_identity_model['crn'] = 'crn:v1:bluemix:public:kms:us-south:a/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179'
-
- # Construct a dict representation of a ShareInitialOwner model
- share_initial_owner_model = {}
- share_initial_owner_model['gid'] = 50
- share_initial_owner_model['uid'] = 50
-
- # Construct a dict representation of a SharePrototypeShareBySize model
- share_prototype_model = {}
- share_prototype_model['iops'] = 100
- share_prototype_model['mount_targets'] = [share_mount_target_prototype_model]
- share_prototype_model['name'] = 'my-share'
- share_prototype_model['profile'] = share_profile_identity_model
- share_prototype_model['replica_share'] = share_prototype_share_context_model
- share_prototype_model['user_tags'] = []
- share_prototype_model['zone'] = zone_identity_model
- share_prototype_model['access_control_mode'] = 'security_group'
- share_prototype_model['encryption_key'] = encryption_key_identity_model
- share_prototype_model['initial_owner'] = share_initial_owner_model
- share_prototype_model['resource_group'] = resource_group_identity_model
- share_prototype_model['size'] = 200
-
# Set up parameter values
- share_prototype = share_prototype_model
+ id = 'testString'
# Invoke method
- response = _service.create_share(
- share_prototype,
+ response = _service.get_snapshot_consistency_group(
+ 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 == share_prototype
+ assert response.status_code == 200
- def test_create_share_all_params_with_retries(self):
- # Enable retries and run test_create_share_all_params.
+ def test_get_snapshot_consistency_group_all_params_with_retries(self):
+ # Enable retries and run test_get_snapshot_consistency_group_all_params.
_service.enable_retries()
- self.test_create_share_all_params()
+ self.test_get_snapshot_consistency_group_all_params()
- # Disable retries and run test_create_share_all_params.
+ # Disable retries and run test_get_snapshot_consistency_group_all_params.
_service.disable_retries()
- self.test_create_share_all_params()
+ self.test_get_snapshot_consistency_group_all_params()
@responses.activate
- def test_create_share_value_error(self):
+ def test_get_snapshot_consistency_group_value_error(self):
"""
- test_create_share_value_error()
+ test_get_snapshot_consistency_group_value_error()
"""
# Set up mock
- url = preprocess_url('/shares')
- mock_response = '{"access_control_mode": "security_group", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "iops": 100, "latest_job": {"status": "cancelled", "status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "type": "replication_failover"}, "lifecycle_state": "stable", "mount_targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "name": "my-share-mount-target", "resource_type": "share_mount_target"}], "name": "my-share", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops", "name": "tier-3iops", "resource_type": "share_profile"}, "replica_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "resource_type": "share"}, "replication_cron_spec": "0 */5 * * *", "replication_role": "none", "replication_status": "active", "replication_status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "share", "size": 200, "source_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "resource_type": "share"}, "user_tags": ["user_tags"], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
+ url = preprocess_url('/snapshot_consistency_groups/testString')
+ mock_response = '{"backup_policy_plan": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::snapshot-consistency-group:r134-fa329f6b-0e36-433f-a3bb-0df632e79263", "delete_snapshots_on_delete": true, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshot_consistency_groups/r134-fa329f6b-0e36-433f-a3bb-0df632e79263", "id": "r134-fa329f6b-0e36-433f-a3bb-0df632e79263", "lifecycle_state": "stable", "name": "my-snapshot-consistency-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "snapshot_consistency_group", "service_tags": ["service_tags"], "snapshots": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}]}'
responses.add(
- responses.POST,
+ responses.GET,
url,
body=mock_response,
content_type='application/json',
- status=201,
+ status=200,
)
- # Construct a dict representation of a VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext model
- virtual_network_interface_primary_ip_prototype_model = {}
- virtual_network_interface_primary_ip_prototype_model['address'] = '10.0.0.5'
- virtual_network_interface_primary_ip_prototype_model['auto_delete'] = False
- virtual_network_interface_primary_ip_prototype_model['name'] = 'my-reserved-ip'
-
- # Construct a dict representation of a ResourceGroupIdentityById model
- resource_group_identity_model = {}
- resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
-
- # Construct a dict representation of a SecurityGroupIdentityById model
- security_group_identity_model = {}
- security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271'
-
- # Construct a dict representation of a SubnetIdentityById model
- subnet_identity_model = {}
- subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
-
- # Construct a dict representation of a ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfacePrototypeShareMountTargetContext model
- share_mount_target_virtual_network_interface_prototype_model = {}
- share_mount_target_virtual_network_interface_prototype_model['name'] = 'my-virtual-network-interface'
- share_mount_target_virtual_network_interface_prototype_model['primary_ip'] = virtual_network_interface_primary_ip_prototype_model
- share_mount_target_virtual_network_interface_prototype_model['resource_group'] = resource_group_identity_model
- share_mount_target_virtual_network_interface_prototype_model['security_groups'] = [security_group_identity_model]
- share_mount_target_virtual_network_interface_prototype_model['subnet'] = subnet_identity_model
-
- # Construct a dict representation of a ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup model
- share_mount_target_prototype_model = {}
- share_mount_target_prototype_model['name'] = 'my-share-mount-target'
- share_mount_target_prototype_model['transit_encryption'] = 'none'
- share_mount_target_prototype_model['virtual_network_interface'] = share_mount_target_virtual_network_interface_prototype_model
-
- # Construct a dict representation of a ShareProfileIdentityByName model
- share_profile_identity_model = {}
- share_profile_identity_model['name'] = 'tier-3iops'
-
- # Construct a dict representation of a ZoneIdentityByName model
- zone_identity_model = {}
- zone_identity_model['name'] = 'us-south-1'
-
- # Construct a dict representation of a SharePrototypeShareContext model
- share_prototype_share_context_model = {}
- share_prototype_share_context_model['iops'] = 100
- share_prototype_share_context_model['mount_targets'] = [share_mount_target_prototype_model]
- share_prototype_share_context_model['name'] = 'my-share'
- share_prototype_share_context_model['profile'] = share_profile_identity_model
- share_prototype_share_context_model['replication_cron_spec'] = '0 */5 * * *'
- share_prototype_share_context_model['resource_group'] = resource_group_identity_model
- share_prototype_share_context_model['user_tags'] = []
- share_prototype_share_context_model['zone'] = zone_identity_model
-
- # Construct a dict representation of a EncryptionKeyIdentityByCRN model
- encryption_key_identity_model = {}
- encryption_key_identity_model['crn'] = 'crn:v1:bluemix:public:kms:us-south:a/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179'
-
- # Construct a dict representation of a ShareInitialOwner model
- share_initial_owner_model = {}
- share_initial_owner_model['gid'] = 50
- share_initial_owner_model['uid'] = 50
-
- # Construct a dict representation of a SharePrototypeShareBySize model
- share_prototype_model = {}
- share_prototype_model['iops'] = 100
- share_prototype_model['mount_targets'] = [share_mount_target_prototype_model]
- share_prototype_model['name'] = 'my-share'
- share_prototype_model['profile'] = share_profile_identity_model
- share_prototype_model['replica_share'] = share_prototype_share_context_model
- share_prototype_model['user_tags'] = []
- share_prototype_model['zone'] = zone_identity_model
- share_prototype_model['access_control_mode'] = 'security_group'
- share_prototype_model['encryption_key'] = encryption_key_identity_model
- share_prototype_model['initial_owner'] = share_initial_owner_model
- share_prototype_model['resource_group'] = resource_group_identity_model
- share_prototype_model['size'] = 200
-
# Set up parameter values
- share_prototype = share_prototype_model
+ id = 'testString'
# Pass in all but one required param and check for a ValueError
req_param_dict = {
- "share_prototype": share_prototype,
+ "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_share(**req_copy)
+ _service.get_snapshot_consistency_group(**req_copy)
- def test_create_share_value_error_with_retries(self):
- # Enable retries and run test_create_share_value_error.
+ def test_get_snapshot_consistency_group_value_error_with_retries(self):
+ # Enable retries and run test_get_snapshot_consistency_group_value_error.
_service.enable_retries()
- self.test_create_share_value_error()
+ self.test_get_snapshot_consistency_group_value_error()
- # Disable retries and run test_create_share_value_error.
+ # Disable retries and run test_get_snapshot_consistency_group_value_error.
_service.disable_retries()
- self.test_create_share_value_error()
+ self.test_get_snapshot_consistency_group_value_error()
-class TestDeleteShare:
+class TestUpdateSnapshotConsistencyGroup:
"""
- Test Class for delete_share
+ Test Class for update_snapshot_consistency_group
"""
@responses.activate
- def test_delete_share_all_params(self):
+ def test_update_snapshot_consistency_group_all_params(self):
"""
- delete_share()
+ update_snapshot_consistency_group()
"""
# Set up mock
- url = preprocess_url('/shares/testString')
- mock_response = '{"access_control_mode": "security_group", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "iops": 100, "latest_job": {"status": "cancelled", "status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "type": "replication_failover"}, "lifecycle_state": "stable", "mount_targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "name": "my-share-mount-target", "resource_type": "share_mount_target"}], "name": "my-share", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops", "name": "tier-3iops", "resource_type": "share_profile"}, "replica_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "resource_type": "share"}, "replication_cron_spec": "0 */5 * * *", "replication_role": "none", "replication_status": "active", "replication_status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "share", "size": 200, "source_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "resource_type": "share"}, "user_tags": ["user_tags"], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
+ url = preprocess_url('/snapshot_consistency_groups/testString')
+ mock_response = '{"backup_policy_plan": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::snapshot-consistency-group:r134-fa329f6b-0e36-433f-a3bb-0df632e79263", "delete_snapshots_on_delete": true, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshot_consistency_groups/r134-fa329f6b-0e36-433f-a3bb-0df632e79263", "id": "r134-fa329f6b-0e36-433f-a3bb-0df632e79263", "lifecycle_state": "stable", "name": "my-snapshot-consistency-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "snapshot_consistency_group", "service_tags": ["service_tags"], "snapshots": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}]}'
responses.add(
- responses.DELETE,
+ responses.PATCH,
url,
body=mock_response,
content_type='application/json',
- status=202,
+ status=200,
)
+ # Construct a dict representation of a SnapshotConsistencyGroupPatch model
+ snapshot_consistency_group_patch_model = {}
+ snapshot_consistency_group_patch_model['delete_snapshots_on_delete'] = True
+ snapshot_consistency_group_patch_model['name'] = 'my-snapshot-consistency-group'
+
# Set up parameter values
id = 'testString'
+ snapshot_consistency_group_patch = snapshot_consistency_group_patch_model
if_match = 'W/"96d225c4-56bd-43d9-98fc-d7148e5c5028"'
# Invoke method
- response = _service.delete_share(
+ response = _service.update_snapshot_consistency_group(
id,
+ snapshot_consistency_group_patch,
if_match=if_match,
headers={},
)
# Check for correct operation
assert len(responses.calls) == 1
- assert response.status_code == 202
+ assert response.status_code == 200
+ # Validate body params
+ req_body = json.loads(str(responses.calls[0].request.body, 'utf-8'))
+ assert req_body == snapshot_consistency_group_patch
- def test_delete_share_all_params_with_retries(self):
- # Enable retries and run test_delete_share_all_params.
+ def test_update_snapshot_consistency_group_all_params_with_retries(self):
+ # Enable retries and run test_update_snapshot_consistency_group_all_params.
_service.enable_retries()
- self.test_delete_share_all_params()
+ self.test_update_snapshot_consistency_group_all_params()
- # Disable retries and run test_delete_share_all_params.
+ # Disable retries and run test_update_snapshot_consistency_group_all_params.
_service.disable_retries()
- self.test_delete_share_all_params()
+ self.test_update_snapshot_consistency_group_all_params()
@responses.activate
- def test_delete_share_required_params(self):
+ def test_update_snapshot_consistency_group_required_params(self):
"""
- test_delete_share_required_params()
+ test_update_snapshot_consistency_group_required_params()
"""
# Set up mock
- url = preprocess_url('/shares/testString')
- mock_response = '{"access_control_mode": "security_group", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "iops": 100, "latest_job": {"status": "cancelled", "status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "type": "replication_failover"}, "lifecycle_state": "stable", "mount_targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "name": "my-share-mount-target", "resource_type": "share_mount_target"}], "name": "my-share", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops", "name": "tier-3iops", "resource_type": "share_profile"}, "replica_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "resource_type": "share"}, "replication_cron_spec": "0 */5 * * *", "replication_role": "none", "replication_status": "active", "replication_status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "share", "size": 200, "source_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "resource_type": "share"}, "user_tags": ["user_tags"], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
+ url = preprocess_url('/snapshot_consistency_groups/testString')
+ mock_response = '{"backup_policy_plan": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::snapshot-consistency-group:r134-fa329f6b-0e36-433f-a3bb-0df632e79263", "delete_snapshots_on_delete": true, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshot_consistency_groups/r134-fa329f6b-0e36-433f-a3bb-0df632e79263", "id": "r134-fa329f6b-0e36-433f-a3bb-0df632e79263", "lifecycle_state": "stable", "name": "my-snapshot-consistency-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "snapshot_consistency_group", "service_tags": ["service_tags"], "snapshots": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}]}'
responses.add(
- responses.DELETE,
+ responses.PATCH,
url,
body=mock_response,
content_type='application/json',
- status=202,
+ status=200,
)
+ # Construct a dict representation of a SnapshotConsistencyGroupPatch model
+ snapshot_consistency_group_patch_model = {}
+ snapshot_consistency_group_patch_model['delete_snapshots_on_delete'] = True
+ snapshot_consistency_group_patch_model['name'] = 'my-snapshot-consistency-group'
+
# Set up parameter values
id = 'testString'
+ snapshot_consistency_group_patch = snapshot_consistency_group_patch_model
# Invoke method
- response = _service.delete_share(
+ response = _service.update_snapshot_consistency_group(
id,
+ snapshot_consistency_group_patch,
headers={},
)
# Check for correct operation
assert len(responses.calls) == 1
- assert response.status_code == 202
+ assert response.status_code == 200
+ # Validate body params
+ req_body = json.loads(str(responses.calls[0].request.body, 'utf-8'))
+ assert req_body == snapshot_consistency_group_patch
- def test_delete_share_required_params_with_retries(self):
- # Enable retries and run test_delete_share_required_params.
+ def test_update_snapshot_consistency_group_required_params_with_retries(self):
+ # Enable retries and run test_update_snapshot_consistency_group_required_params.
_service.enable_retries()
- self.test_delete_share_required_params()
+ self.test_update_snapshot_consistency_group_required_params()
- # Disable retries and run test_delete_share_required_params.
+ # Disable retries and run test_update_snapshot_consistency_group_required_params.
_service.disable_retries()
- self.test_delete_share_required_params()
+ self.test_update_snapshot_consistency_group_required_params()
@responses.activate
- def test_delete_share_value_error(self):
+ def test_update_snapshot_consistency_group_value_error(self):
"""
- test_delete_share_value_error()
+ test_update_snapshot_consistency_group_value_error()
"""
# Set up mock
- url = preprocess_url('/shares/testString')
- mock_response = '{"access_control_mode": "security_group", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "iops": 100, "latest_job": {"status": "cancelled", "status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "type": "replication_failover"}, "lifecycle_state": "stable", "mount_targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "name": "my-share-mount-target", "resource_type": "share_mount_target"}], "name": "my-share", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops", "name": "tier-3iops", "resource_type": "share_profile"}, "replica_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "resource_type": "share"}, "replication_cron_spec": "0 */5 * * *", "replication_role": "none", "replication_status": "active", "replication_status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "share", "size": 200, "source_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "resource_type": "share"}, "user_tags": ["user_tags"], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
+ url = preprocess_url('/snapshot_consistency_groups/testString')
+ mock_response = '{"backup_policy_plan": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::snapshot-consistency-group:r134-fa329f6b-0e36-433f-a3bb-0df632e79263", "delete_snapshots_on_delete": true, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshot_consistency_groups/r134-fa329f6b-0e36-433f-a3bb-0df632e79263", "id": "r134-fa329f6b-0e36-433f-a3bb-0df632e79263", "lifecycle_state": "stable", "name": "my-snapshot-consistency-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "snapshot_consistency_group", "service_tags": ["service_tags"], "snapshots": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}]}'
responses.add(
- responses.DELETE,
+ responses.PATCH,
url,
body=mock_response,
content_type='application/json',
- status=202,
+ status=200,
)
+ # Construct a dict representation of a SnapshotConsistencyGroupPatch model
+ snapshot_consistency_group_patch_model = {}
+ snapshot_consistency_group_patch_model['delete_snapshots_on_delete'] = True
+ snapshot_consistency_group_patch_model['name'] = 'my-snapshot-consistency-group'
+
# Set up parameter values
id = 'testString'
+ snapshot_consistency_group_patch = snapshot_consistency_group_patch_model
# Pass in all but one required param and check for a ValueError
req_param_dict = {
"id": id,
+ "snapshot_consistency_group_patch": snapshot_consistency_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.delete_share(**req_copy)
+ _service.update_snapshot_consistency_group(**req_copy)
- def test_delete_share_value_error_with_retries(self):
- # Enable retries and run test_delete_share_value_error.
+ def test_update_snapshot_consistency_group_value_error_with_retries(self):
+ # Enable retries and run test_update_snapshot_consistency_group_value_error.
_service.enable_retries()
- self.test_delete_share_value_error()
+ self.test_update_snapshot_consistency_group_value_error()
- # Disable retries and run test_delete_share_value_error.
+ # Disable retries and run test_update_snapshot_consistency_group_value_error.
_service.disable_retries()
- self.test_delete_share_value_error()
+ self.test_update_snapshot_consistency_group_value_error()
-class TestGetShare:
+class TestDeleteSnapshots:
"""
- Test Class for get_share
+ Test Class for delete_snapshots
"""
@responses.activate
- def test_get_share_all_params(self):
+ def test_delete_snapshots_all_params(self):
"""
- get_share()
+ delete_snapshots()
"""
# Set up mock
- url = preprocess_url('/shares/testString')
- mock_response = '{"access_control_mode": "security_group", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "iops": 100, "latest_job": {"status": "cancelled", "status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "type": "replication_failover"}, "lifecycle_state": "stable", "mount_targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "name": "my-share-mount-target", "resource_type": "share_mount_target"}], "name": "my-share", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops", "name": "tier-3iops", "resource_type": "share_profile"}, "replica_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "resource_type": "share"}, "replication_cron_spec": "0 */5 * * *", "replication_role": "none", "replication_status": "active", "replication_status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "share", "size": 200, "source_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "resource_type": "share"}, "user_tags": ["user_tags"], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
+ url = preprocess_url('/snapshots')
responses.add(
- responses.GET,
+ responses.DELETE,
url,
- body=mock_response,
- content_type='application/json',
- status=200,
+ status=204,
)
# Set up parameter values
- id = 'testString'
+ source_volume_id = 'testString'
# Invoke method
- response = _service.get_share(
- 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 'source_volume.id={}'.format(source_volume_id) in query_string
- def test_get_share_all_params_with_retries(self):
- # Enable retries and run test_get_share_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_get_share_all_params()
+ self.test_delete_snapshots_all_params()
- # Disable retries and run test_get_share_all_params.
+ # Disable retries and run test_delete_snapshots_all_params.
_service.disable_retries()
- self.test_get_share_all_params()
+ self.test_delete_snapshots_all_params()
@responses.activate
- def test_get_share_value_error(self):
+ def test_delete_snapshots_value_error(self):
"""
- test_get_share_value_error()
+ test_delete_snapshots_value_error()
"""
# Set up mock
- url = preprocess_url('/shares/testString')
- mock_response = '{"access_control_mode": "security_group", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "iops": 100, "latest_job": {"status": "cancelled", "status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "type": "replication_failover"}, "lifecycle_state": "stable", "mount_targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "name": "my-share-mount-target", "resource_type": "share_mount_target"}], "name": "my-share", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops", "name": "tier-3iops", "resource_type": "share_profile"}, "replica_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "resource_type": "share"}, "replication_cron_spec": "0 */5 * * *", "replication_role": "none", "replication_status": "active", "replication_status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "share", "size": 200, "source_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "resource_type": "share"}, "user_tags": ["user_tags"], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
+ url = preprocess_url('/snapshots')
responses.add(
- responses.GET,
+ responses.DELETE,
url,
- body=mock_response,
- content_type='application/json',
- status=200,
+ status=204,
)
# Set up parameter values
- id = 'testString'
+ source_volume_id = 'testString'
# Pass in all but one required param and check for a ValueError
req_param_dict = {
- "id": id,
+ "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.get_share(**req_copy)
+ _service.delete_snapshots(**req_copy)
- def test_get_share_value_error_with_retries(self):
- # Enable retries and run test_get_share_value_error.
+ def test_delete_snapshots_value_error_with_retries(self):
+ # Enable retries and run test_delete_snapshots_value_error.
_service.enable_retries()
- self.test_get_share_value_error()
+ self.test_delete_snapshots_value_error()
- # Disable retries and run test_get_share_value_error.
+ # Disable retries and run test_delete_snapshots_value_error.
_service.disable_retries()
- self.test_get_share_value_error()
+ self.test_delete_snapshots_value_error()
-class TestUpdateShare:
+class TestListSnapshots:
"""
- Test Class for update_share
+ Test Class for list_snapshots
"""
@responses.activate
- def test_update_share_all_params(self):
+ def test_list_snapshots_all_params(self):
"""
- update_share()
+ list_snapshots()
"""
# Set up mock
- url = preprocess_url('/shares/testString')
- mock_response = '{"access_control_mode": "security_group", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "iops": 100, "latest_job": {"status": "cancelled", "status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "type": "replication_failover"}, "lifecycle_state": "stable", "mount_targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "name": "my-share-mount-target", "resource_type": "share_mount_target"}], "name": "my-share", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops", "name": "tier-3iops", "resource_type": "share_profile"}, "replica_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "resource_type": "share"}, "replication_cron_spec": "0 */5 * * *", "replication_role": "none", "replication_status": "active", "replication_status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "share", "size": 200, "source_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "resource_type": "share"}, "user_tags": ["user_tags"], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
+ 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": [{"backup_policy_plan": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}, "bootable": true, "captured_at": "2019-01-01T12:00:00.000Z", "clones": [{"available": false, "created_at": "2019-01-01T12:00:00.000Z", "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "copies": [{"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", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}], "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/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "lifecycle_state": "stable", "minimum_capacity": 1, "name": "my-snapshot", "operating_system": {"architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64", "vendor": "Canonical", "version": "16.04 LTS"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "snapshot", "service_tags": ["service_tags"], "size": 1, "snapshot_consistency_group": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::snapshot-consistency-group:r134-fa329f6b-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshot_consistency_groups/r134-fa329f6b-0e36-433f-a3bb-0df632e79263", "id": "r134-fa329f6b-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot-consistency-group", "resource_type": "snapshot_consistency_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", "remote": {"account": {"id": "aa2432b1fa4d4ace891e9b80fc104e34", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "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", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}, "source_volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "volume"}, "user_tags": ["user_tags"]}], "total_count": 132}'
responses.add(
- responses.PATCH,
+ responses.GET,
url,
body=mock_response,
content_type='application/json',
status=200,
)
- # Construct a dict representation of a ShareProfileIdentityByName model
- share_profile_identity_model = {}
- share_profile_identity_model['name'] = 'tier-3iops'
-
- # Construct a dict representation of a SharePatch model
- share_patch_model = {}
- share_patch_model['access_control_mode'] = 'security_group'
- share_patch_model['iops'] = 100
- share_patch_model['name'] = 'my-share'
- share_patch_model['profile'] = share_profile_identity_model
- share_patch_model['replication_cron_spec'] = '0 */5 * * *'
- share_patch_model['size'] = 200
- share_patch_model['user_tags'] = ['testString']
-
# Set up parameter values
- id = 'testString'
- share_patch = share_patch_model
- if_match = 'W/"96d225c4-56bd-43d9-98fc-d7148e5c5028"'
+ start = 'testString'
+ limit = 50
+ tag = 'testString'
+ resource_group_id = 'testString'
+ name = 'testString'
+ source_volume_id = 'testString'
+ source_volume_crn = 'crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
+ source_image_id = 'testString'
+ source_image_crn = 'crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8'
+ sort = 'name'
+ backup_policy_plan_id = 'testString'
+ copies_id = 'testString'
+ copies_name = 'my-snapshot-copy'
+ copies_crn = 'testString'
+ copies_remote_region_name = 'us-south'
+ source_snapshot_id = 'testString'
+ source_snapshot_remote_region_name = 'us-south'
+ source_volume_remote_region_name = 'us-south'
+ source_image_remote_region_name = 'us-south'
+ clones_zone_name = 'us-south-1'
+ snapshot_consistency_group_id = 'testString'
+ snapshot_consistency_group_crn = 'crn:v1:bluemix:public:is:us-south:a/123456::snapshot-consistency-group:r134-fa329f6b-0e36-433f-a3bb-0df632e79263'
# Invoke method
- response = _service.update_share(
- id,
- share_patch,
- if_match=if_match,
+ response = _service.list_snapshots(
+ start=start,
+ limit=limit,
+ tag=tag,
+ 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,
+ backup_policy_plan_id=backup_policy_plan_id,
+ copies_id=copies_id,
+ copies_name=copies_name,
+ copies_crn=copies_crn,
+ copies_remote_region_name=copies_remote_region_name,
+ source_snapshot_id=source_snapshot_id,
+ source_snapshot_remote_region_name=source_snapshot_remote_region_name,
+ source_volume_remote_region_name=source_volume_remote_region_name,
+ source_image_remote_region_name=source_image_remote_region_name,
+ clones_zone_name=clones_zone_name,
+ snapshot_consistency_group_id=snapshot_consistency_group_id,
+ snapshot_consistency_group_crn=snapshot_consistency_group_crn,
headers={},
)
# Check for correct operation
assert len(responses.calls) == 1
assert response.status_code == 200
- # Validate body params
- req_body = json.loads(str(responses.calls[0].request.body, 'utf-8'))
- assert req_body == share_patch
-
- def test_update_share_all_params_with_retries(self):
- # Enable retries and run test_update_share_all_params.
+ # 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 'tag={}'.format(tag) 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
+ assert 'backup_policy_plan.id={}'.format(backup_policy_plan_id) in query_string
+ assert 'copies[].id={}'.format(copies_id) in query_string
+ assert 'copies[].name={}'.format(copies_name) in query_string
+ assert 'copies[].crn={}'.format(copies_crn) in query_string
+ assert 'copies[].remote.region.name={}'.format(copies_remote_region_name) in query_string
+ assert 'source_snapshot.id={}'.format(source_snapshot_id) in query_string
+ assert 'source_snapshot.remote.region.name={}'.format(source_snapshot_remote_region_name) in query_string
+ assert 'source_volume.remote.region.name={}'.format(source_volume_remote_region_name) in query_string
+ assert 'source_image.remote.region.name={}'.format(source_image_remote_region_name) in query_string
+ assert 'clones[].zone.name={}'.format(clones_zone_name) in query_string
+ assert 'snapshot_consistency_group.id={}'.format(snapshot_consistency_group_id) in query_string
+ assert 'snapshot_consistency_group.crn={}'.format(snapshot_consistency_group_crn) 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_update_share_all_params()
+ self.test_list_snapshots_all_params()
- # Disable retries and run test_update_share_all_params.
+ # Disable retries and run test_list_snapshots_all_params.
_service.disable_retries()
- self.test_update_share_all_params()
+ self.test_list_snapshots_all_params()
@responses.activate
- def test_update_share_required_params(self):
+ def test_list_snapshots_required_params(self):
"""
- test_update_share_required_params()
+ test_list_snapshots_required_params()
"""
# Set up mock
- url = preprocess_url('/shares/testString')
- mock_response = '{"access_control_mode": "security_group", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "iops": 100, "latest_job": {"status": "cancelled", "status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "type": "replication_failover"}, "lifecycle_state": "stable", "mount_targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "name": "my-share-mount-target", "resource_type": "share_mount_target"}], "name": "my-share", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops", "name": "tier-3iops", "resource_type": "share_profile"}, "replica_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "resource_type": "share"}, "replication_cron_spec": "0 */5 * * *", "replication_role": "none", "replication_status": "active", "replication_status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "share", "size": 200, "source_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "resource_type": "share"}, "user_tags": ["user_tags"], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
+ 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": [{"backup_policy_plan": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}, "bootable": true, "captured_at": "2019-01-01T12:00:00.000Z", "clones": [{"available": false, "created_at": "2019-01-01T12:00:00.000Z", "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "copies": [{"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", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}], "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/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "lifecycle_state": "stable", "minimum_capacity": 1, "name": "my-snapshot", "operating_system": {"architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64", "vendor": "Canonical", "version": "16.04 LTS"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "snapshot", "service_tags": ["service_tags"], "size": 1, "snapshot_consistency_group": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::snapshot-consistency-group:r134-fa329f6b-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshot_consistency_groups/r134-fa329f6b-0e36-433f-a3bb-0df632e79263", "id": "r134-fa329f6b-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot-consistency-group", "resource_type": "snapshot_consistency_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", "remote": {"account": {"id": "aa2432b1fa4d4ace891e9b80fc104e34", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "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", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}, "source_volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "volume"}, "user_tags": ["user_tags"]}], "total_count": 132}'
responses.add(
- responses.PATCH,
+ responses.GET,
url,
body=mock_response,
content_type='application/json',
status=200,
)
- # Construct a dict representation of a ShareProfileIdentityByName model
- share_profile_identity_model = {}
- share_profile_identity_model['name'] = 'tier-3iops'
-
- # Construct a dict representation of a SharePatch model
- share_patch_model = {}
- share_patch_model['access_control_mode'] = 'security_group'
- share_patch_model['iops'] = 100
- share_patch_model['name'] = 'my-share'
- share_patch_model['profile'] = share_profile_identity_model
- share_patch_model['replication_cron_spec'] = '0 */5 * * *'
- share_patch_model['size'] = 200
- share_patch_model['user_tags'] = ['testString']
-
- # Set up parameter values
- id = 'testString'
- share_patch = share_patch_model
-
# Invoke method
- response = _service.update_share(
- id,
- share_patch,
- headers={},
- )
+ response = _service.list_snapshots()
# Check for correct operation
assert len(responses.calls) == 1
assert response.status_code == 200
- # Validate body params
- req_body = json.loads(str(responses.calls[0].request.body, 'utf-8'))
- assert req_body == share_patch
- def test_update_share_required_params_with_retries(self):
- # Enable retries and run test_update_share_required_params.
+ def test_list_snapshots_required_params_with_retries(self):
+ # Enable retries and run test_list_snapshots_required_params.
_service.enable_retries()
- self.test_update_share_required_params()
+ self.test_list_snapshots_required_params()
- # Disable retries and run test_update_share_required_params.
+ # Disable retries and run test_list_snapshots_required_params.
_service.disable_retries()
- self.test_update_share_required_params()
+ self.test_list_snapshots_required_params()
@responses.activate
- def test_update_share_value_error(self):
+ def test_list_snapshots_value_error(self):
"""
- test_update_share_value_error()
+ test_list_snapshots_value_error()
"""
# Set up mock
- url = preprocess_url('/shares/testString')
- mock_response = '{"access_control_mode": "security_group", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "iops": 100, "latest_job": {"status": "cancelled", "status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "type": "replication_failover"}, "lifecycle_state": "stable", "mount_targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "name": "my-share-mount-target", "resource_type": "share_mount_target"}], "name": "my-share", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops", "name": "tier-3iops", "resource_type": "share_profile"}, "replica_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "resource_type": "share"}, "replication_cron_spec": "0 */5 * * *", "replication_role": "none", "replication_status": "active", "replication_status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "share", "size": 200, "source_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "resource_type": "share"}, "user_tags": ["user_tags"], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
+ 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": [{"backup_policy_plan": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}, "bootable": true, "captured_at": "2019-01-01T12:00:00.000Z", "clones": [{"available": false, "created_at": "2019-01-01T12:00:00.000Z", "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "copies": [{"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", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}], "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/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "lifecycle_state": "stable", "minimum_capacity": 1, "name": "my-snapshot", "operating_system": {"architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64", "vendor": "Canonical", "version": "16.04 LTS"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "snapshot", "service_tags": ["service_tags"], "size": 1, "snapshot_consistency_group": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::snapshot-consistency-group:r134-fa329f6b-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshot_consistency_groups/r134-fa329f6b-0e36-433f-a3bb-0df632e79263", "id": "r134-fa329f6b-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot-consistency-group", "resource_type": "snapshot_consistency_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", "remote": {"account": {"id": "aa2432b1fa4d4ace891e9b80fc104e34", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "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", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}, "source_volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "volume"}, "user_tags": ["user_tags"]}], "total_count": 132}'
responses.add(
- responses.PATCH,
+ responses.GET,
url,
body=mock_response,
content_type='application/json',
status=200,
)
- # Construct a dict representation of a ShareProfileIdentityByName model
- share_profile_identity_model = {}
- share_profile_identity_model['name'] = 'tier-3iops'
-
- # Construct a dict representation of a SharePatch model
- share_patch_model = {}
- share_patch_model['access_control_mode'] = 'security_group'
- share_patch_model['iops'] = 100
- share_patch_model['name'] = 'my-share'
- share_patch_model['profile'] = share_profile_identity_model
- share_patch_model['replication_cron_spec'] = '0 */5 * * *'
- share_patch_model['size'] = 200
- share_patch_model['user_tags'] = ['testString']
-
- # Set up parameter values
- id = 'testString'
- share_patch = share_patch_model
-
# Pass in all but one required param and check for a ValueError
req_param_dict = {
- "id": id,
- "share_patch": share_patch,
}
for param in req_param_dict.keys():
req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()}
with pytest.raises(ValueError):
- _service.update_share(**req_copy)
+ _service.list_snapshots(**req_copy)
- def test_update_share_value_error_with_retries(self):
- # Enable retries and run test_update_share_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_update_share_value_error()
+ self.test_list_snapshots_value_error()
- # Disable retries and run test_update_share_value_error.
+ # Disable retries and run test_list_snapshots_value_error.
_service.disable_retries()
- self.test_update_share_value_error()
-
-
-class TestFailoverShare:
- """
- Test Class for failover_share
- """
+ self.test_list_snapshots_value_error()
@responses.activate
- def test_failover_share_all_params(self):
+ def test_list_snapshots_with_pager_get_next(self):
"""
- failover_share()
+ test_list_snapshots_with_pager_get_next()
"""
- # Set up mock
- url = preprocess_url('/shares/testString/failover')
+ # Set up a two-page mock response
+ url = preprocess_url('/snapshots')
+ mock_response1 = '{"snapshots":[{"backup_policy_plan":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178","id":"r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178","name":"my-policy-plan","remote":{"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"backup_policy_plan"},"bootable":true,"captured_at":"2019-01-01T12:00:00.000Z","clones":[{"available":false,"created_at":"2019-01-01T12:00:00.000Z","zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"copies":[{"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","remote":{"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"snapshot"}],"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/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"},"href":"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263","id":"r134-f6bfa329-0e36-433f-a3bb-0df632e79263","lifecycle_state":"stable","minimum_capacity":1,"name":"my-snapshot","operating_system":{"architecture":"amd64","dedicated_host_only":false,"display_name":"Ubuntu Server 16.04 LTS amd64","family":"Ubuntu Server","href":"https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64","name":"ubuntu-16-amd64","vendor":"Canonical","version":"16.04 LTS"},"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"snapshot","service_tags":["service_tags"],"size":1,"snapshot_consistency_group":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::snapshot-consistency-group:r134-fa329f6b-0e36-433f-a3bb-0df632e79263","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/snapshot_consistency_groups/r134-fa329f6b-0e36-433f-a3bb-0df632e79263","id":"r134-fa329f6b-0e36-433f-a3bb-0df632e79263","name":"my-snapshot-consistency-group","resource_type":"snapshot_consistency_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","remote":{"account":{"id":"aa2432b1fa4d4ace891e9b80fc104e34","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"image"},"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","remote":{"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"snapshot"},"source_volume":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5","id":"1a6b7274-678d-4dfb-8981-c71dd9d4daa5","name":"my-volume","remote":{"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"volume"},"user_tags":["user_tags"]}],"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1}'
+ mock_response2 = '{"snapshots":[{"backup_policy_plan":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178","id":"r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178","name":"my-policy-plan","remote":{"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"backup_policy_plan"},"bootable":true,"captured_at":"2019-01-01T12:00:00.000Z","clones":[{"available":false,"created_at":"2019-01-01T12:00:00.000Z","zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"copies":[{"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","remote":{"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"snapshot"}],"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/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"},"href":"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263","id":"r134-f6bfa329-0e36-433f-a3bb-0df632e79263","lifecycle_state":"stable","minimum_capacity":1,"name":"my-snapshot","operating_system":{"architecture":"amd64","dedicated_host_only":false,"display_name":"Ubuntu Server 16.04 LTS amd64","family":"Ubuntu Server","href":"https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64","name":"ubuntu-16-amd64","vendor":"Canonical","version":"16.04 LTS"},"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"snapshot","service_tags":["service_tags"],"size":1,"snapshot_consistency_group":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::snapshot-consistency-group:r134-fa329f6b-0e36-433f-a3bb-0df632e79263","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/snapshot_consistency_groups/r134-fa329f6b-0e36-433f-a3bb-0df632e79263","id":"r134-fa329f6b-0e36-433f-a3bb-0df632e79263","name":"my-snapshot-consistency-group","resource_type":"snapshot_consistency_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","remote":{"account":{"id":"aa2432b1fa4d4ace891e9b80fc104e34","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"image"},"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","remote":{"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"snapshot"},"source_volume":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5","id":"1a6b7274-678d-4dfb-8981-c71dd9d4daa5","name":"my-volume","remote":{"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"volume"},"user_tags":["user_tags"]}],"total_count":2,"limit":1}'
responses.add(
- responses.POST,
+ responses.GET,
url,
- status=202,
+ body=mock_response1,
+ content_type='application/json',
+ status=200,
+ )
+ responses.add(
+ responses.GET,
+ url,
+ body=mock_response2,
+ content_type='application/json',
+ status=200,
)
- # Set up parameter values
- share_id = 'testString'
- fallback_policy = 'fail'
- timeout = 600
+ # Exercise the pager class for this operation
+ all_results = []
+ pager = SnapshotsPager(
+ client=_service,
+ limit=10,
+ tag='testString',
+ resource_group_id='testString',
+ name='testString',
+ source_volume_id='testString',
+ source_volume_crn='crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5',
+ source_image_id='testString',
+ source_image_crn='crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8',
+ sort='name',
+ backup_policy_plan_id='testString',
+ copies_id='testString',
+ copies_name='my-snapshot-copy',
+ copies_crn='testString',
+ copies_remote_region_name='us-south',
+ source_snapshot_id='testString',
+ source_snapshot_remote_region_name='us-south',
+ source_volume_remote_region_name='us-south',
+ source_image_remote_region_name='us-south',
+ clones_zone_name='us-south-1',
+ snapshot_consistency_group_id='testString',
+ snapshot_consistency_group_crn='crn:v1:bluemix:public:is:us-south:a/123456::snapshot-consistency-group:r134-fa329f6b-0e36-433f-a3bb-0df632e79263',
+ )
+ while pager.has_next():
+ next_page = pager.get_next()
+ assert next_page is not None
+ all_results.extend(next_page)
+ assert len(all_results) == 2
- # Invoke method
- response = _service.failover_share(
- share_id,
- fallback_policy=fallback_policy,
- timeout=timeout,
- headers={},
+ @responses.activate
+ def test_list_snapshots_with_pager_get_all(self):
+ """
+ test_list_snapshots_with_pager_get_all()
+ """
+ # Set up a two-page mock response
+ url = preprocess_url('/snapshots')
+ mock_response1 = '{"snapshots":[{"backup_policy_plan":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178","id":"r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178","name":"my-policy-plan","remote":{"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"backup_policy_plan"},"bootable":true,"captured_at":"2019-01-01T12:00:00.000Z","clones":[{"available":false,"created_at":"2019-01-01T12:00:00.000Z","zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"copies":[{"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","remote":{"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"snapshot"}],"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/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"},"href":"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263","id":"r134-f6bfa329-0e36-433f-a3bb-0df632e79263","lifecycle_state":"stable","minimum_capacity":1,"name":"my-snapshot","operating_system":{"architecture":"amd64","dedicated_host_only":false,"display_name":"Ubuntu Server 16.04 LTS amd64","family":"Ubuntu Server","href":"https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64","name":"ubuntu-16-amd64","vendor":"Canonical","version":"16.04 LTS"},"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"snapshot","service_tags":["service_tags"],"size":1,"snapshot_consistency_group":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::snapshot-consistency-group:r134-fa329f6b-0e36-433f-a3bb-0df632e79263","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/snapshot_consistency_groups/r134-fa329f6b-0e36-433f-a3bb-0df632e79263","id":"r134-fa329f6b-0e36-433f-a3bb-0df632e79263","name":"my-snapshot-consistency-group","resource_type":"snapshot_consistency_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","remote":{"account":{"id":"aa2432b1fa4d4ace891e9b80fc104e34","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"image"},"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","remote":{"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"snapshot"},"source_volume":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5","id":"1a6b7274-678d-4dfb-8981-c71dd9d4daa5","name":"my-volume","remote":{"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"volume"},"user_tags":["user_tags"]}],"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1}'
+ mock_response2 = '{"snapshots":[{"backup_policy_plan":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178","id":"r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178","name":"my-policy-plan","remote":{"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"backup_policy_plan"},"bootable":true,"captured_at":"2019-01-01T12:00:00.000Z","clones":[{"available":false,"created_at":"2019-01-01T12:00:00.000Z","zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"copies":[{"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","remote":{"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"snapshot"}],"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/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"},"href":"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263","id":"r134-f6bfa329-0e36-433f-a3bb-0df632e79263","lifecycle_state":"stable","minimum_capacity":1,"name":"my-snapshot","operating_system":{"architecture":"amd64","dedicated_host_only":false,"display_name":"Ubuntu Server 16.04 LTS amd64","family":"Ubuntu Server","href":"https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64","name":"ubuntu-16-amd64","vendor":"Canonical","version":"16.04 LTS"},"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"snapshot","service_tags":["service_tags"],"size":1,"snapshot_consistency_group":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::snapshot-consistency-group:r134-fa329f6b-0e36-433f-a3bb-0df632e79263","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/snapshot_consistency_groups/r134-fa329f6b-0e36-433f-a3bb-0df632e79263","id":"r134-fa329f6b-0e36-433f-a3bb-0df632e79263","name":"my-snapshot-consistency-group","resource_type":"snapshot_consistency_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","remote":{"account":{"id":"aa2432b1fa4d4ace891e9b80fc104e34","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"image"},"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","remote":{"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"snapshot"},"source_volume":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5","id":"1a6b7274-678d-4dfb-8981-c71dd9d4daa5","name":"my-volume","remote":{"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"volume"},"user_tags":["user_tags"]}],"total_count":2,"limit":1}'
+ responses.add(
+ responses.GET,
+ url,
+ body=mock_response1,
+ content_type='application/json',
+ status=200,
+ )
+ responses.add(
+ responses.GET,
+ url,
+ body=mock_response2,
+ content_type='application/json',
+ status=200,
)
- # Check for correct operation
- assert len(responses.calls) == 1
- assert response.status_code == 202
- # Validate body params
- req_body = json.loads(str(responses.calls[0].request.body, 'utf-8'))
- assert req_body['fallback_policy'] == 'fail'
- assert req_body['timeout'] == 600
+ # Exercise the pager class for this operation
+ pager = SnapshotsPager(
+ client=_service,
+ limit=10,
+ tag='testString',
+ resource_group_id='testString',
+ name='testString',
+ source_volume_id='testString',
+ source_volume_crn='crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5',
+ source_image_id='testString',
+ source_image_crn='crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8',
+ sort='name',
+ backup_policy_plan_id='testString',
+ copies_id='testString',
+ copies_name='my-snapshot-copy',
+ copies_crn='testString',
+ copies_remote_region_name='us-south',
+ source_snapshot_id='testString',
+ source_snapshot_remote_region_name='us-south',
+ source_volume_remote_region_name='us-south',
+ source_image_remote_region_name='us-south',
+ clones_zone_name='us-south-1',
+ snapshot_consistency_group_id='testString',
+ snapshot_consistency_group_crn='crn:v1:bluemix:public:is:us-south:a/123456::snapshot-consistency-group:r134-fa329f6b-0e36-433f-a3bb-0df632e79263',
+ )
+ all_results = pager.get_all()
+ assert all_results is not None
+ assert len(all_results) == 2
- def test_failover_share_all_params_with_retries(self):
- # Enable retries and run test_failover_share_all_params.
- _service.enable_retries()
- self.test_failover_share_all_params()
- # Disable retries and run test_failover_share_all_params.
- _service.disable_retries()
- self.test_failover_share_all_params()
+class TestCreateSnapshot:
+ """
+ Test Class for create_snapshot
+ """
@responses.activate
- def test_failover_share_required_params(self):
+ def test_create_snapshot_all_params(self):
"""
- test_failover_share_required_params()
+ create_snapshot()
"""
# Set up mock
- url = preprocess_url('/shares/testString/failover')
+ url = preprocess_url('/snapshots')
+ mock_response = '{"backup_policy_plan": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}, "bootable": true, "captured_at": "2019-01-01T12:00:00.000Z", "clones": [{"available": false, "created_at": "2019-01-01T12:00:00.000Z", "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "copies": [{"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", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}], "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/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "lifecycle_state": "stable", "minimum_capacity": 1, "name": "my-snapshot", "operating_system": {"architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64", "vendor": "Canonical", "version": "16.04 LTS"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "snapshot", "service_tags": ["service_tags"], "size": 1, "snapshot_consistency_group": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::snapshot-consistency-group:r134-fa329f6b-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshot_consistency_groups/r134-fa329f6b-0e36-433f-a3bb-0df632e79263", "id": "r134-fa329f6b-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot-consistency-group", "resource_type": "snapshot_consistency_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", "remote": {"account": {"id": "aa2432b1fa4d4ace891e9b80fc104e34", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "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", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}, "source_volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "volume"}, "user_tags": ["user_tags"]}'
responses.add(
responses.POST,
url,
- status=202,
+ body=mock_response,
+ content_type='application/json',
+ status=201,
)
+ # Construct a dict representation of a ZoneIdentityByName model
+ zone_identity_model = {}
+ zone_identity_model['name'] = 'us-south-1'
+
+ # Construct a dict representation of a SnapshotClonePrototype model
+ snapshot_clone_prototype_model = {}
+ snapshot_clone_prototype_model['zone'] = zone_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 VolumeIdentityById model
+ volume_identity_model = {}
+ volume_identity_model['id'] = '1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
+
+ # Construct a dict representation of a SnapshotPrototypeSnapshotBySourceVolume model
+ snapshot_prototype_model = {}
+ snapshot_prototype_model['clones'] = [snapshot_clone_prototype_model]
+ snapshot_prototype_model['name'] = 'my-snapshot'
+ snapshot_prototype_model['resource_group'] = resource_group_identity_model
+ snapshot_prototype_model['user_tags'] = []
+ snapshot_prototype_model['source_volume'] = volume_identity_model
+
# Set up parameter values
- share_id = 'testString'
+ snapshot_prototype = snapshot_prototype_model
# Invoke method
- response = _service.failover_share(
- share_id,
+ response = _service.create_snapshot(
+ snapshot_prototype,
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 == snapshot_prototype
- def test_failover_share_required_params_with_retries(self):
- # Enable retries and run test_failover_share_required_params.
+ def test_create_snapshot_all_params_with_retries(self):
+ # Enable retries and run test_create_snapshot_all_params.
_service.enable_retries()
- self.test_failover_share_required_params()
+ self.test_create_snapshot_all_params()
- # Disable retries and run test_failover_share_required_params.
+ # Disable retries and run test_create_snapshot_all_params.
_service.disable_retries()
- self.test_failover_share_required_params()
+ self.test_create_snapshot_all_params()
@responses.activate
- def test_failover_share_value_error(self):
+ def test_create_snapshot_value_error(self):
"""
- test_failover_share_value_error()
+ test_create_snapshot_value_error()
"""
# Set up mock
- url = preprocess_url('/shares/testString/failover')
+ url = preprocess_url('/snapshots')
+ mock_response = '{"backup_policy_plan": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}, "bootable": true, "captured_at": "2019-01-01T12:00:00.000Z", "clones": [{"available": false, "created_at": "2019-01-01T12:00:00.000Z", "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "copies": [{"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", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}], "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/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "lifecycle_state": "stable", "minimum_capacity": 1, "name": "my-snapshot", "operating_system": {"architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64", "vendor": "Canonical", "version": "16.04 LTS"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "snapshot", "service_tags": ["service_tags"], "size": 1, "snapshot_consistency_group": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::snapshot-consistency-group:r134-fa329f6b-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshot_consistency_groups/r134-fa329f6b-0e36-433f-a3bb-0df632e79263", "id": "r134-fa329f6b-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot-consistency-group", "resource_type": "snapshot_consistency_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", "remote": {"account": {"id": "aa2432b1fa4d4ace891e9b80fc104e34", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "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", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}, "source_volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "volume"}, "user_tags": ["user_tags"]}'
responses.add(
responses.POST,
url,
- status=202,
+ body=mock_response,
+ content_type='application/json',
+ status=201,
)
+ # Construct a dict representation of a ZoneIdentityByName model
+ zone_identity_model = {}
+ zone_identity_model['name'] = 'us-south-1'
+
+ # Construct a dict representation of a SnapshotClonePrototype model
+ snapshot_clone_prototype_model = {}
+ snapshot_clone_prototype_model['zone'] = zone_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 VolumeIdentityById model
+ volume_identity_model = {}
+ volume_identity_model['id'] = '1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
+
+ # Construct a dict representation of a SnapshotPrototypeSnapshotBySourceVolume model
+ snapshot_prototype_model = {}
+ snapshot_prototype_model['clones'] = [snapshot_clone_prototype_model]
+ snapshot_prototype_model['name'] = 'my-snapshot'
+ snapshot_prototype_model['resource_group'] = resource_group_identity_model
+ snapshot_prototype_model['user_tags'] = []
+ snapshot_prototype_model['source_volume'] = volume_identity_model
+
# Set up parameter values
- share_id = 'testString'
+ snapshot_prototype = snapshot_prototype_model
# Pass in all but one required param and check for a ValueError
req_param_dict = {
- "share_id": share_id,
+ "snapshot_prototype": snapshot_prototype,
}
for param in req_param_dict.keys():
req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()}
with pytest.raises(ValueError):
- _service.failover_share(**req_copy)
+ _service.create_snapshot(**req_copy)
- def test_failover_share_value_error_with_retries(self):
- # Enable retries and run test_failover_share_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_failover_share_value_error()
+ self.test_create_snapshot_value_error()
- # Disable retries and run test_failover_share_value_error.
+ # Disable retries and run test_create_snapshot_value_error.
_service.disable_retries()
- self.test_failover_share_value_error()
+ self.test_create_snapshot_value_error()
-class TestListShareMountTargets:
+class TestDeleteSnapshot:
"""
- Test Class for list_share_mount_targets
+ Test Class for delete_snapshot
"""
@responses.activate
- def test_list_share_mount_targets_all_params(self):
+ def test_delete_snapshot_all_params(self):
"""
- list_share_mount_targets()
+ delete_snapshot()
"""
# Set up mock
- url = preprocess_url('/shares/testString/mount_targets')
- mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets?limit=20"}, "limit": 20, "mount_targets": [{"access_control_mode": "security_group", "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "lifecycle_state": "stable", "mount_path": "10.240.1.23:/nxg_s_voll_mz7121_58e7e963_8f4b_4a0c_b71a_8ba8d9cd1e2e", "name": "my-share-mount-target", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "share_mount_target", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "transit_encryption": "none", "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "id": "0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}], "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}'
+ url = preprocess_url('/snapshots/testString')
responses.add(
- responses.GET,
+ responses.DELETE,
url,
- body=mock_response,
- content_type='application/json',
- status=200,
+ status=204,
)
# Set up parameter values
- share_id = 'testString'
- name = 'testString'
- start = 'testString'
- limit = 50
+ id = 'testString'
+ if_match = 'W/"96d225c4-56bd-43d9-98fc-d7148e5c5028"'
# Invoke method
- response = _service.list_share_mount_targets(
- share_id,
- name=name,
- start=start,
- limit=limit,
+ response = _service.delete_snapshot(
+ id,
+ if_match=if_match,
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 response.status_code == 204
- def test_list_share_mount_targets_all_params_with_retries(self):
- # Enable retries and run test_list_share_mount_targets_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_list_share_mount_targets_all_params()
+ self.test_delete_snapshot_all_params()
- # Disable retries and run test_list_share_mount_targets_all_params.
+ # Disable retries and run test_delete_snapshot_all_params.
_service.disable_retries()
- self.test_list_share_mount_targets_all_params()
+ self.test_delete_snapshot_all_params()
@responses.activate
- def test_list_share_mount_targets_required_params(self):
+ def test_delete_snapshot_required_params(self):
"""
- test_list_share_mount_targets_required_params()
+ test_delete_snapshot_required_params()
"""
# Set up mock
- url = preprocess_url('/shares/testString/mount_targets')
- mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets?limit=20"}, "limit": 20, "mount_targets": [{"access_control_mode": "security_group", "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "lifecycle_state": "stable", "mount_path": "10.240.1.23:/nxg_s_voll_mz7121_58e7e963_8f4b_4a0c_b71a_8ba8d9cd1e2e", "name": "my-share-mount-target", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "share_mount_target", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "transit_encryption": "none", "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "id": "0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}], "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}'
+ url = preprocess_url('/snapshots/testString')
responses.add(
- responses.GET,
+ responses.DELETE,
url,
- body=mock_response,
- content_type='application/json',
- status=200,
+ status=204,
)
# Set up parameter values
- share_id = 'testString'
+ id = 'testString'
# Invoke method
- response = _service.list_share_mount_targets(
- share_id,
+ response = _service.delete_snapshot(
+ id,
headers={},
)
# Check for correct operation
assert len(responses.calls) == 1
- assert response.status_code == 200
+ assert response.status_code == 204
- def test_list_share_mount_targets_required_params_with_retries(self):
- # Enable retries and run test_list_share_mount_targets_required_params.
+ def test_delete_snapshot_required_params_with_retries(self):
+ # Enable retries and run test_delete_snapshot_required_params.
_service.enable_retries()
- self.test_list_share_mount_targets_required_params()
+ self.test_delete_snapshot_required_params()
- # Disable retries and run test_list_share_mount_targets_required_params.
+ # Disable retries and run test_delete_snapshot_required_params.
_service.disable_retries()
- self.test_list_share_mount_targets_required_params()
+ self.test_delete_snapshot_required_params()
@responses.activate
- def test_list_share_mount_targets_value_error(self):
+ def test_delete_snapshot_value_error(self):
"""
- test_list_share_mount_targets_value_error()
+ test_delete_snapshot_value_error()
"""
# Set up mock
- url = preprocess_url('/shares/testString/mount_targets')
- mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets?limit=20"}, "limit": 20, "mount_targets": [{"access_control_mode": "security_group", "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "lifecycle_state": "stable", "mount_path": "10.240.1.23:/nxg_s_voll_mz7121_58e7e963_8f4b_4a0c_b71a_8ba8d9cd1e2e", "name": "my-share-mount-target", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "share_mount_target", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "transit_encryption": "none", "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "id": "0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}], "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}'
+ url = preprocess_url('/snapshots/testString')
responses.add(
- responses.GET,
+ responses.DELETE,
url,
- body=mock_response,
- content_type='application/json',
- status=200,
+ status=204,
)
# Set up parameter values
- share_id = 'testString'
+ id = 'testString'
# Pass in all but one required param and check for a ValueError
req_param_dict = {
- "share_id": share_id,
+ "id": id,
}
for param in req_param_dict.keys():
req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()}
with pytest.raises(ValueError):
- _service.list_share_mount_targets(**req_copy)
+ _service.delete_snapshot(**req_copy)
- def test_list_share_mount_targets_value_error_with_retries(self):
- # Enable retries and run test_list_share_mount_targets_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_list_share_mount_targets_value_error()
+ self.test_delete_snapshot_value_error()
- # Disable retries and run test_list_share_mount_targets_value_error.
+ # Disable retries and run test_delete_snapshot_value_error.
_service.disable_retries()
- self.test_list_share_mount_targets_value_error()
+ self.test_delete_snapshot_value_error()
+
+
+class TestGetSnapshot:
+ """
+ Test Class for get_snapshot
+ """
@responses.activate
- def test_list_share_mount_targets_with_pager_get_next(self):
+ def test_get_snapshot_all_params(self):
"""
- test_list_share_mount_targets_with_pager_get_next()
+ get_snapshot()
"""
- # Set up a two-page mock response
- url = preprocess_url('/shares/testString/mount_targets')
- mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"mount_targets":[{"access_control_mode":"security_group","created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c","id":"4cf9171a-0043-4434-8727-15b53dbc374c","lifecycle_state":"stable","mount_path":"10.240.1.23:/nxg_s_voll_mz7121_58e7e963_8f4b_4a0c_b71a_8ba8d9cd1e2e","name":"my-share-mount-target","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"share_mount_target","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"},"transit_encryption":"none","virtual_network_interface":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","href":"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","id":"0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","name":"my-virtual-network-interface","resource_type":"virtual_network_interface"},"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"}}]}'
- mock_response2 = '{"total_count":2,"limit":1,"mount_targets":[{"access_control_mode":"security_group","created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c","id":"4cf9171a-0043-4434-8727-15b53dbc374c","lifecycle_state":"stable","mount_path":"10.240.1.23:/nxg_s_voll_mz7121_58e7e963_8f4b_4a0c_b71a_8ba8d9cd1e2e","name":"my-share-mount-target","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"share_mount_target","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"},"transit_encryption":"none","virtual_network_interface":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","href":"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","id":"0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","name":"my-virtual-network-interface","resource_type":"virtual_network_interface"},"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"}}]}'
+ # Set up mock
+ url = preprocess_url('/snapshots/testString')
+ mock_response = '{"backup_policy_plan": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}, "bootable": true, "captured_at": "2019-01-01T12:00:00.000Z", "clones": [{"available": false, "created_at": "2019-01-01T12:00:00.000Z", "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "copies": [{"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", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}], "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/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "lifecycle_state": "stable", "minimum_capacity": 1, "name": "my-snapshot", "operating_system": {"architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64", "vendor": "Canonical", "version": "16.04 LTS"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "snapshot", "service_tags": ["service_tags"], "size": 1, "snapshot_consistency_group": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::snapshot-consistency-group:r134-fa329f6b-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshot_consistency_groups/r134-fa329f6b-0e36-433f-a3bb-0df632e79263", "id": "r134-fa329f6b-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot-consistency-group", "resource_type": "snapshot_consistency_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", "remote": {"account": {"id": "aa2432b1fa4d4ace891e9b80fc104e34", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "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", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}, "source_volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "volume"}, "user_tags": ["user_tags"]}'
responses.add(
responses.GET,
url,
- body=mock_response1,
+ body=mock_response,
content_type='application/json',
status=200,
)
+
+ # Set up parameter values
+ id = 'testString'
+
+ # Invoke method
+ response = _service.get_snapshot(
+ id,
+ headers={},
+ )
+
+ # Check for correct operation
+ 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.
+ _service.enable_retries()
+ self.test_get_snapshot_all_params()
+
+ # Disable retries and run test_get_snapshot_all_params.
+ _service.disable_retries()
+ self.test_get_snapshot_all_params()
+
+ @responses.activate
+ def test_get_snapshot_value_error(self):
+ """
+ test_get_snapshot_value_error()
+ """
+ # Set up mock
+ url = preprocess_url('/snapshots/testString')
+ mock_response = '{"backup_policy_plan": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}, "bootable": true, "captured_at": "2019-01-01T12:00:00.000Z", "clones": [{"available": false, "created_at": "2019-01-01T12:00:00.000Z", "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "copies": [{"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", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}], "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/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "lifecycle_state": "stable", "minimum_capacity": 1, "name": "my-snapshot", "operating_system": {"architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64", "vendor": "Canonical", "version": "16.04 LTS"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "snapshot", "service_tags": ["service_tags"], "size": 1, "snapshot_consistency_group": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::snapshot-consistency-group:r134-fa329f6b-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshot_consistency_groups/r134-fa329f6b-0e36-433f-a3bb-0df632e79263", "id": "r134-fa329f6b-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot-consistency-group", "resource_type": "snapshot_consistency_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", "remote": {"account": {"id": "aa2432b1fa4d4ace891e9b80fc104e34", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "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", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}, "source_volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "volume"}, "user_tags": ["user_tags"]}'
responses.add(
responses.GET,
url,
- body=mock_response2,
+ body=mock_response,
content_type='application/json',
status=200,
)
- # Exercise the pager class for this operation
- all_results = []
- pager = ShareMountTargetsPager(
- client=_service,
- share_id='testString',
- name='testString',
- limit=10,
- )
- while pager.has_next():
- next_page = pager.get_next()
- assert next_page is not None
- all_results.extend(next_page)
- assert len(all_results) == 2
+ # 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_snapshot(**req_copy)
+
+ def test_get_snapshot_value_error_with_retries(self):
+ # Enable retries and run test_get_snapshot_value_error.
+ _service.enable_retries()
+ self.test_get_snapshot_value_error()
+
+ # Disable retries and run test_get_snapshot_value_error.
+ _service.disable_retries()
+ self.test_get_snapshot_value_error()
+
+
+class TestUpdateSnapshot:
+ """
+ Test Class for update_snapshot
+ """
@responses.activate
- def test_list_share_mount_targets_with_pager_get_all(self):
+ def test_update_snapshot_all_params(self):
"""
- test_list_share_mount_targets_with_pager_get_all()
+ update_snapshot()
"""
- # Set up a two-page mock response
- url = preprocess_url('/shares/testString/mount_targets')
- mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"mount_targets":[{"access_control_mode":"security_group","created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c","id":"4cf9171a-0043-4434-8727-15b53dbc374c","lifecycle_state":"stable","mount_path":"10.240.1.23:/nxg_s_voll_mz7121_58e7e963_8f4b_4a0c_b71a_8ba8d9cd1e2e","name":"my-share-mount-target","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"share_mount_target","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"},"transit_encryption":"none","virtual_network_interface":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","href":"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","id":"0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","name":"my-virtual-network-interface","resource_type":"virtual_network_interface"},"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"}}]}'
- mock_response2 = '{"total_count":2,"limit":1,"mount_targets":[{"access_control_mode":"security_group","created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c","id":"4cf9171a-0043-4434-8727-15b53dbc374c","lifecycle_state":"stable","mount_path":"10.240.1.23:/nxg_s_voll_mz7121_58e7e963_8f4b_4a0c_b71a_8ba8d9cd1e2e","name":"my-share-mount-target","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"share_mount_target","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"},"transit_encryption":"none","virtual_network_interface":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","href":"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","id":"0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","name":"my-virtual-network-interface","resource_type":"virtual_network_interface"},"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"}}]}'
- responses.add(
- responses.GET,
- url,
- body=mock_response1,
- content_type='application/json',
- status=200,
- )
+ # Set up mock
+ url = preprocess_url('/snapshots/testString')
+ mock_response = '{"backup_policy_plan": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}, "bootable": true, "captured_at": "2019-01-01T12:00:00.000Z", "clones": [{"available": false, "created_at": "2019-01-01T12:00:00.000Z", "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "copies": [{"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", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}], "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/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "lifecycle_state": "stable", "minimum_capacity": 1, "name": "my-snapshot", "operating_system": {"architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64", "vendor": "Canonical", "version": "16.04 LTS"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "snapshot", "service_tags": ["service_tags"], "size": 1, "snapshot_consistency_group": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::snapshot-consistency-group:r134-fa329f6b-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshot_consistency_groups/r134-fa329f6b-0e36-433f-a3bb-0df632e79263", "id": "r134-fa329f6b-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot-consistency-group", "resource_type": "snapshot_consistency_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", "remote": {"account": {"id": "aa2432b1fa4d4ace891e9b80fc104e34", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "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", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}, "source_volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "volume"}, "user_tags": ["user_tags"]}'
responses.add(
- responses.GET,
+ responses.PATCH,
url,
- body=mock_response2,
+ body=mock_response,
content_type='application/json',
status=200,
)
- # Exercise the pager class for this operation
- pager = ShareMountTargetsPager(
- client=_service,
- share_id='testString',
- name='testString',
- limit=10,
+ # Construct a dict representation of a SnapshotPatch model
+ snapshot_patch_model = {}
+ snapshot_patch_model['name'] = 'my-snapshot'
+ snapshot_patch_model['user_tags'] = ['testString']
+
+ # Set up parameter values
+ id = 'testString'
+ snapshot_patch = snapshot_patch_model
+ if_match = 'W/"96d225c4-56bd-43d9-98fc-d7148e5c5028"'
+
+ # Invoke method
+ response = _service.update_snapshot(
+ id,
+ snapshot_patch,
+ if_match=if_match,
+ headers={},
)
- all_results = pager.get_all()
- assert all_results is not None
- assert len(all_results) == 2
+ # Check for correct operation
+ assert len(responses.calls) == 1
+ assert response.status_code == 200
+ # Validate body params
+ req_body = json.loads(str(responses.calls[0].request.body, 'utf-8'))
+ assert req_body == snapshot_patch
-class TestCreateShareMountTarget:
- """
- Test Class for create_share_mount_target
- """
+ def test_update_snapshot_all_params_with_retries(self):
+ # Enable retries and run test_update_snapshot_all_params.
+ _service.enable_retries()
+ self.test_update_snapshot_all_params()
+
+ # Disable retries and run test_update_snapshot_all_params.
+ _service.disable_retries()
+ self.test_update_snapshot_all_params()
@responses.activate
- def test_create_share_mount_target_all_params(self):
+ def test_update_snapshot_required_params(self):
"""
- create_share_mount_target()
+ test_update_snapshot_required_params()
"""
# Set up mock
- url = preprocess_url('/shares/testString/mount_targets')
- mock_response = '{"access_control_mode": "security_group", "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "lifecycle_state": "stable", "mount_path": "10.240.1.23:/nxg_s_voll_mz7121_58e7e963_8f4b_4a0c_b71a_8ba8d9cd1e2e", "name": "my-share-mount-target", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "share_mount_target", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "transit_encryption": "none", "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "id": "0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}'
+ url = preprocess_url('/snapshots/testString')
+ mock_response = '{"backup_policy_plan": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}, "bootable": true, "captured_at": "2019-01-01T12:00:00.000Z", "clones": [{"available": false, "created_at": "2019-01-01T12:00:00.000Z", "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "copies": [{"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", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}], "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/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "lifecycle_state": "stable", "minimum_capacity": 1, "name": "my-snapshot", "operating_system": {"architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64", "vendor": "Canonical", "version": "16.04 LTS"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "snapshot", "service_tags": ["service_tags"], "size": 1, "snapshot_consistency_group": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::snapshot-consistency-group:r134-fa329f6b-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshot_consistency_groups/r134-fa329f6b-0e36-433f-a3bb-0df632e79263", "id": "r134-fa329f6b-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot-consistency-group", "resource_type": "snapshot_consistency_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", "remote": {"account": {"id": "aa2432b1fa4d4ace891e9b80fc104e34", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "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", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}, "source_volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "volume"}, "user_tags": ["user_tags"]}'
responses.add(
- responses.POST,
+ responses.PATCH,
url,
body=mock_response,
content_type='application/json',
- status=201,
+ status=200,
)
- # Construct a dict representation of a VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext model
- virtual_network_interface_primary_ip_prototype_model = {}
- virtual_network_interface_primary_ip_prototype_model['address'] = '10.0.0.5'
- virtual_network_interface_primary_ip_prototype_model['auto_delete'] = False
- virtual_network_interface_primary_ip_prototype_model['name'] = 'my-reserved-ip'
-
- # Construct a dict representation of a ResourceGroupIdentityById model
- resource_group_identity_model = {}
- resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
-
- # Construct a dict representation of a SecurityGroupIdentityById model
- security_group_identity_model = {}
- security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271'
-
- # Construct a dict representation of a SubnetIdentityById model
- subnet_identity_model = {}
- subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
-
- # Construct a dict representation of a ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfacePrototypeShareMountTargetContext model
- share_mount_target_virtual_network_interface_prototype_model = {}
- share_mount_target_virtual_network_interface_prototype_model['name'] = 'my-virtual-network-interface'
- share_mount_target_virtual_network_interface_prototype_model['primary_ip'] = virtual_network_interface_primary_ip_prototype_model
- share_mount_target_virtual_network_interface_prototype_model['resource_group'] = resource_group_identity_model
- share_mount_target_virtual_network_interface_prototype_model['security_groups'] = [security_group_identity_model]
- share_mount_target_virtual_network_interface_prototype_model['subnet'] = subnet_identity_model
-
- # Construct a dict representation of a ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup model
- share_mount_target_prototype_model = {}
- share_mount_target_prototype_model['name'] = 'my-share-mount-target'
- share_mount_target_prototype_model['transit_encryption'] = 'none'
- share_mount_target_prototype_model['virtual_network_interface'] = share_mount_target_virtual_network_interface_prototype_model
+ # Construct a dict representation of a SnapshotPatch model
+ snapshot_patch_model = {}
+ snapshot_patch_model['name'] = 'my-snapshot'
+ snapshot_patch_model['user_tags'] = ['testString']
# Set up parameter values
- share_id = 'testString'
- share_mount_target_prototype = share_mount_target_prototype_model
+ id = 'testString'
+ snapshot_patch = snapshot_patch_model
# Invoke method
- response = _service.create_share_mount_target(
- share_id,
- share_mount_target_prototype,
+ response = _service.update_snapshot(
+ id,
+ snapshot_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 == share_mount_target_prototype
+ assert req_body == snapshot_patch
- def test_create_share_mount_target_all_params_with_retries(self):
- # Enable retries and run test_create_share_mount_target_all_params.
+ def test_update_snapshot_required_params_with_retries(self):
+ # Enable retries and run test_update_snapshot_required_params.
_service.enable_retries()
- self.test_create_share_mount_target_all_params()
+ self.test_update_snapshot_required_params()
- # Disable retries and run test_create_share_mount_target_all_params.
+ # Disable retries and run test_update_snapshot_required_params.
_service.disable_retries()
- self.test_create_share_mount_target_all_params()
+ self.test_update_snapshot_required_params()
@responses.activate
- def test_create_share_mount_target_value_error(self):
+ def test_update_snapshot_value_error(self):
"""
- test_create_share_mount_target_value_error()
+ test_update_snapshot_value_error()
"""
# Set up mock
- url = preprocess_url('/shares/testString/mount_targets')
- mock_response = '{"access_control_mode": "security_group", "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "lifecycle_state": "stable", "mount_path": "10.240.1.23:/nxg_s_voll_mz7121_58e7e963_8f4b_4a0c_b71a_8ba8d9cd1e2e", "name": "my-share-mount-target", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "share_mount_target", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "transit_encryption": "none", "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "id": "0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}'
+ url = preprocess_url('/snapshots/testString')
+ mock_response = '{"backup_policy_plan": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "id": "r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178", "name": "my-policy-plan", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "backup_policy_plan"}, "bootable": true, "captured_at": "2019-01-01T12:00:00.000Z", "clones": [{"available": false, "created_at": "2019-01-01T12:00:00.000Z", "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "copies": [{"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", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}], "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/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "lifecycle_state": "stable", "minimum_capacity": 1, "name": "my-snapshot", "operating_system": {"architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64", "vendor": "Canonical", "version": "16.04 LTS"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "snapshot", "service_tags": ["service_tags"], "size": 1, "snapshot_consistency_group": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::snapshot-consistency-group:r134-fa329f6b-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshot_consistency_groups/r134-fa329f6b-0e36-433f-a3bb-0df632e79263", "id": "r134-fa329f6b-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot-consistency-group", "resource_type": "snapshot_consistency_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", "remote": {"account": {"id": "aa2432b1fa4d4ace891e9b80fc104e34", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "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", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "snapshot"}, "source_volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "volume"}, "user_tags": ["user_tags"]}'
responses.add(
- responses.POST,
+ responses.PATCH,
url,
body=mock_response,
content_type='application/json',
- status=201,
+ status=200,
)
- # Construct a dict representation of a VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext model
- virtual_network_interface_primary_ip_prototype_model = {}
- virtual_network_interface_primary_ip_prototype_model['address'] = '10.0.0.5'
- virtual_network_interface_primary_ip_prototype_model['auto_delete'] = False
- virtual_network_interface_primary_ip_prototype_model['name'] = 'my-reserved-ip'
-
- # Construct a dict representation of a ResourceGroupIdentityById model
- resource_group_identity_model = {}
- resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
-
- # Construct a dict representation of a SecurityGroupIdentityById model
- security_group_identity_model = {}
- security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271'
-
- # Construct a dict representation of a SubnetIdentityById model
- subnet_identity_model = {}
- subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
-
- # Construct a dict representation of a ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfacePrototypeShareMountTargetContext model
- share_mount_target_virtual_network_interface_prototype_model = {}
- share_mount_target_virtual_network_interface_prototype_model['name'] = 'my-virtual-network-interface'
- share_mount_target_virtual_network_interface_prototype_model['primary_ip'] = virtual_network_interface_primary_ip_prototype_model
- share_mount_target_virtual_network_interface_prototype_model['resource_group'] = resource_group_identity_model
- share_mount_target_virtual_network_interface_prototype_model['security_groups'] = [security_group_identity_model]
- share_mount_target_virtual_network_interface_prototype_model['subnet'] = subnet_identity_model
-
- # Construct a dict representation of a ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup model
- share_mount_target_prototype_model = {}
- share_mount_target_prototype_model['name'] = 'my-share-mount-target'
- share_mount_target_prototype_model['transit_encryption'] = 'none'
- share_mount_target_prototype_model['virtual_network_interface'] = share_mount_target_virtual_network_interface_prototype_model
+ # Construct a dict representation of a SnapshotPatch model
+ snapshot_patch_model = {}
+ snapshot_patch_model['name'] = 'my-snapshot'
+ snapshot_patch_model['user_tags'] = ['testString']
# Set up parameter values
- share_id = 'testString'
- share_mount_target_prototype = share_mount_target_prototype_model
+ id = 'testString'
+ snapshot_patch = snapshot_patch_model
# Pass in all but one required param and check for a ValueError
req_param_dict = {
- "share_id": share_id,
- "share_mount_target_prototype": share_mount_target_prototype,
+ "id": id,
+ "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.create_share_mount_target(**req_copy)
+ _service.update_snapshot(**req_copy)
- def test_create_share_mount_target_value_error_with_retries(self):
- # Enable retries and run test_create_share_mount_target_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_create_share_mount_target_value_error()
+ self.test_update_snapshot_value_error()
- # Disable retries and run test_create_share_mount_target_value_error.
+ # Disable retries and run test_update_snapshot_value_error.
_service.disable_retries()
- self.test_create_share_mount_target_value_error()
+ self.test_update_snapshot_value_error()
-class TestDeleteShareMountTarget:
+class TestListSnapshotClones:
"""
- Test Class for delete_share_mount_target
+ Test Class for list_snapshot_clones
"""
@responses.activate
- def test_delete_share_mount_target_all_params(self):
+ def test_list_snapshot_clones_all_params(self):
"""
- delete_share_mount_target()
+ list_snapshot_clones()
"""
# Set up mock
- url = preprocess_url('/shares/testString/mount_targets/testString')
- mock_response = '{"access_control_mode": "security_group", "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "lifecycle_state": "stable", "mount_path": "10.240.1.23:/nxg_s_voll_mz7121_58e7e963_8f4b_4a0c_b71a_8ba8d9cd1e2e", "name": "my-share-mount-target", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "share_mount_target", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "transit_encryption": "none", "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "id": "0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}'
+ url = preprocess_url('/snapshots/testString/clones')
+ mock_response = '{"clones": [{"available": false, "created_at": "2019-01-01T12:00:00.000Z", "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}]}'
responses.add(
- responses.DELETE,
+ responses.GET,
url,
body=mock_response,
content_type='application/json',
- status=202,
+ status=200,
)
# Set up parameter values
- share_id = 'testString'
id = 'testString'
# Invoke method
- response = _service.delete_share_mount_target(
- share_id,
+ response = _service.list_snapshot_clones(
id,
headers={},
)
# Check for correct operation
assert len(responses.calls) == 1
- assert response.status_code == 202
+ assert response.status_code == 200
- def test_delete_share_mount_target_all_params_with_retries(self):
- # Enable retries and run test_delete_share_mount_target_all_params.
+ def test_list_snapshot_clones_all_params_with_retries(self):
+ # Enable retries and run test_list_snapshot_clones_all_params.
_service.enable_retries()
- self.test_delete_share_mount_target_all_params()
+ self.test_list_snapshot_clones_all_params()
- # Disable retries and run test_delete_share_mount_target_all_params.
+ # Disable retries and run test_list_snapshot_clones_all_params.
_service.disable_retries()
- self.test_delete_share_mount_target_all_params()
+ self.test_list_snapshot_clones_all_params()
@responses.activate
- def test_delete_share_mount_target_value_error(self):
+ def test_list_snapshot_clones_value_error(self):
"""
- test_delete_share_mount_target_value_error()
+ test_list_snapshot_clones_value_error()
"""
# Set up mock
- url = preprocess_url('/shares/testString/mount_targets/testString')
- mock_response = '{"access_control_mode": "security_group", "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "lifecycle_state": "stable", "mount_path": "10.240.1.23:/nxg_s_voll_mz7121_58e7e963_8f4b_4a0c_b71a_8ba8d9cd1e2e", "name": "my-share-mount-target", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "share_mount_target", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "transit_encryption": "none", "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "id": "0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}'
+ url = preprocess_url('/snapshots/testString/clones')
+ mock_response = '{"clones": [{"available": false, "created_at": "2019-01-01T12:00:00.000Z", "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}]}'
responses.add(
- responses.DELETE,
+ responses.GET,
url,
body=mock_response,
content_type='application/json',
- status=202,
+ status=200,
)
# Set up parameter values
- share_id = 'testString'
id = 'testString'
# Pass in all but one required param and check for a ValueError
req_param_dict = {
- "share_id": share_id,
"id": id,
}
for param in req_param_dict.keys():
req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()}
with pytest.raises(ValueError):
- _service.delete_share_mount_target(**req_copy)
+ _service.list_snapshot_clones(**req_copy)
- def test_delete_share_mount_target_value_error_with_retries(self):
- # Enable retries and run test_delete_share_mount_target_value_error.
+ def test_list_snapshot_clones_value_error_with_retries(self):
+ # Enable retries and run test_list_snapshot_clones_value_error.
_service.enable_retries()
- self.test_delete_share_mount_target_value_error()
+ self.test_list_snapshot_clones_value_error()
- # Disable retries and run test_delete_share_mount_target_value_error.
+ # Disable retries and run test_list_snapshot_clones_value_error.
_service.disable_retries()
- self.test_delete_share_mount_target_value_error()
+ self.test_list_snapshot_clones_value_error()
-class TestGetShareMountTarget:
+class TestDeleteSnapshotClone:
"""
- Test Class for get_share_mount_target
+ Test Class for delete_snapshot_clone
"""
@responses.activate
- def test_get_share_mount_target_all_params(self):
+ def test_delete_snapshot_clone_all_params(self):
"""
- get_share_mount_target()
+ delete_snapshot_clone()
"""
# Set up mock
- url = preprocess_url('/shares/testString/mount_targets/testString')
- mock_response = '{"access_control_mode": "security_group", "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "lifecycle_state": "stable", "mount_path": "10.240.1.23:/nxg_s_voll_mz7121_58e7e963_8f4b_4a0c_b71a_8ba8d9cd1e2e", "name": "my-share-mount-target", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "share_mount_target", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "transit_encryption": "none", "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "id": "0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}'
+ url = preprocess_url('/snapshots/testString/clones/testString')
responses.add(
- responses.GET,
+ responses.DELETE,
url,
- body=mock_response,
- content_type='application/json',
- status=200,
+ status=202,
)
# Set up parameter values
- share_id = 'testString'
id = 'testString'
+ zone_name = 'testString'
# Invoke method
- response = _service.get_share_mount_target(
- share_id,
+ response = _service.delete_snapshot_clone(
id,
+ zone_name,
headers={},
)
# Check for correct operation
assert len(responses.calls) == 1
- assert response.status_code == 200
+ assert response.status_code == 202
- def test_get_share_mount_target_all_params_with_retries(self):
- # Enable retries and run test_get_share_mount_target_all_params.
+ def test_delete_snapshot_clone_all_params_with_retries(self):
+ # Enable retries and run test_delete_snapshot_clone_all_params.
_service.enable_retries()
- self.test_get_share_mount_target_all_params()
+ self.test_delete_snapshot_clone_all_params()
- # Disable retries and run test_get_share_mount_target_all_params.
+ # Disable retries and run test_delete_snapshot_clone_all_params.
_service.disable_retries()
- self.test_get_share_mount_target_all_params()
+ self.test_delete_snapshot_clone_all_params()
@responses.activate
- def test_get_share_mount_target_value_error(self):
+ def test_delete_snapshot_clone_value_error(self):
"""
- test_get_share_mount_target_value_error()
+ test_delete_snapshot_clone_value_error()
"""
# Set up mock
- url = preprocess_url('/shares/testString/mount_targets/testString')
- mock_response = '{"access_control_mode": "security_group", "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "lifecycle_state": "stable", "mount_path": "10.240.1.23:/nxg_s_voll_mz7121_58e7e963_8f4b_4a0c_b71a_8ba8d9cd1e2e", "name": "my-share-mount-target", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "share_mount_target", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "transit_encryption": "none", "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "id": "0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}'
+ url = preprocess_url('/snapshots/testString/clones/testString')
responses.add(
- responses.GET,
+ responses.DELETE,
url,
- body=mock_response,
- content_type='application/json',
- status=200,
+ status=202,
)
# Set up parameter values
- share_id = 'testString'
id = 'testString'
+ zone_name = 'testString'
# Pass in all but one required param and check for a ValueError
req_param_dict = {
- "share_id": share_id,
"id": id,
+ "zone_name": zone_name,
}
for param in req_param_dict.keys():
req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()}
with pytest.raises(ValueError):
- _service.get_share_mount_target(**req_copy)
+ _service.delete_snapshot_clone(**req_copy)
- def test_get_share_mount_target_value_error_with_retries(self):
- # Enable retries and run test_get_share_mount_target_value_error.
+ def test_delete_snapshot_clone_value_error_with_retries(self):
+ # Enable retries and run test_delete_snapshot_clone_value_error.
_service.enable_retries()
- self.test_get_share_mount_target_value_error()
+ self.test_delete_snapshot_clone_value_error()
- # Disable retries and run test_get_share_mount_target_value_error.
+ # Disable retries and run test_delete_snapshot_clone_value_error.
_service.disable_retries()
- self.test_get_share_mount_target_value_error()
+ self.test_delete_snapshot_clone_value_error()
-class TestUpdateShareMountTarget:
+class TestGetSnapshotClone:
"""
- Test Class for update_share_mount_target
+ Test Class for get_snapshot_clone
"""
@responses.activate
- def test_update_share_mount_target_all_params(self):
+ def test_get_snapshot_clone_all_params(self):
"""
- update_share_mount_target()
+ get_snapshot_clone()
"""
# Set up mock
- url = preprocess_url('/shares/testString/mount_targets/testString')
- mock_response = '{"access_control_mode": "security_group", "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "lifecycle_state": "stable", "mount_path": "10.240.1.23:/nxg_s_voll_mz7121_58e7e963_8f4b_4a0c_b71a_8ba8d9cd1e2e", "name": "my-share-mount-target", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "share_mount_target", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "transit_encryption": "none", "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "id": "0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}'
+ url = preprocess_url('/snapshots/testString/clones/testString')
+ mock_response = '{"available": false, "created_at": "2019-01-01T12:00:00.000Z", "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,
+ responses.GET,
url,
body=mock_response,
content_type='application/json',
status=200,
)
- # Construct a dict representation of a ShareMountTargetPatch model
- share_mount_target_patch_model = {}
- share_mount_target_patch_model['name'] = 'my-share-mount-target'
-
# Set up parameter values
- share_id = 'testString'
id = 'testString'
- share_mount_target_patch = share_mount_target_patch_model
+ zone_name = 'testString'
# Invoke method
- response = _service.update_share_mount_target(
- share_id,
+ response = _service.get_snapshot_clone(
id,
- share_mount_target_patch,
+ zone_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 == share_mount_target_patch
- def test_update_share_mount_target_all_params_with_retries(self):
- # Enable retries and run test_update_share_mount_target_all_params.
+ def test_get_snapshot_clone_all_params_with_retries(self):
+ # Enable retries and run test_get_snapshot_clone_all_params.
_service.enable_retries()
- self.test_update_share_mount_target_all_params()
+ self.test_get_snapshot_clone_all_params()
- # Disable retries and run test_update_share_mount_target_all_params.
+ # Disable retries and run test_get_snapshot_clone_all_params.
_service.disable_retries()
- self.test_update_share_mount_target_all_params()
+ self.test_get_snapshot_clone_all_params()
@responses.activate
- def test_update_share_mount_target_value_error(self):
+ def test_get_snapshot_clone_value_error(self):
"""
- test_update_share_mount_target_value_error()
+ test_get_snapshot_clone_value_error()
"""
# Set up mock
- url = preprocess_url('/shares/testString/mount_targets/testString')
- mock_response = '{"access_control_mode": "security_group", "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "lifecycle_state": "stable", "mount_path": "10.240.1.23:/nxg_s_voll_mz7121_58e7e963_8f4b_4a0c_b71a_8ba8d9cd1e2e", "name": "my-share-mount-target", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "share_mount_target", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "transit_encryption": "none", "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "id": "0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}'
+ url = preprocess_url('/snapshots/testString/clones/testString')
+ mock_response = '{"available": false, "created_at": "2019-01-01T12:00:00.000Z", "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,
+ responses.GET,
url,
body=mock_response,
content_type='application/json',
status=200,
)
- # Construct a dict representation of a ShareMountTargetPatch model
- share_mount_target_patch_model = {}
- share_mount_target_patch_model['name'] = 'my-share-mount-target'
-
# Set up parameter values
- share_id = 'testString'
id = 'testString'
- share_mount_target_patch = share_mount_target_patch_model
+ zone_name = 'testString'
# Pass in all but one required param and check for a ValueError
req_param_dict = {
- "share_id": share_id,
"id": id,
- "share_mount_target_patch": share_mount_target_patch,
+ "zone_name": zone_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_share_mount_target(**req_copy)
+ _service.get_snapshot_clone(**req_copy)
- def test_update_share_mount_target_value_error_with_retries(self):
- # Enable retries and run test_update_share_mount_target_value_error.
+ def test_get_snapshot_clone_value_error_with_retries(self):
+ # Enable retries and run test_get_snapshot_clone_value_error.
_service.enable_retries()
- self.test_update_share_mount_target_value_error()
+ self.test_get_snapshot_clone_value_error()
- # Disable retries and run test_update_share_mount_target_value_error.
+ # Disable retries and run test_get_snapshot_clone_value_error.
_service.disable_retries()
- self.test_update_share_mount_target_value_error()
+ self.test_get_snapshot_clone_value_error()
-class TestDeleteShareSource:
+class TestCreateSnapshotClone:
"""
- Test Class for delete_share_source
+ Test Class for create_snapshot_clone
"""
@responses.activate
- def test_delete_share_source_all_params(self):
+ def test_create_snapshot_clone_all_params(self):
"""
- delete_share_source()
+ create_snapshot_clone()
"""
# Set up mock
- url = preprocess_url('/shares/testString/source')
+ url = preprocess_url('/snapshots/testString/clones/testString')
+ mock_response = '{"available": false, "created_at": "2019-01-01T12:00:00.000Z", "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
responses.add(
- responses.DELETE,
+ responses.PUT,
url,
- status=202,
+ body=mock_response,
+ content_type='application/json',
+ status=200,
)
# Set up parameter values
- share_id = 'testString'
+ id = 'testString'
+ zone_name = 'testString'
# Invoke method
- response = _service.delete_share_source(
- share_id,
+ response = _service.create_snapshot_clone(
+ id,
+ zone_name,
headers={},
)
# Check for correct operation
assert len(responses.calls) == 1
- assert response.status_code == 202
+ assert response.status_code == 200
- def test_delete_share_source_all_params_with_retries(self):
- # Enable retries and run test_delete_share_source_all_params.
+ def test_create_snapshot_clone_all_params_with_retries(self):
+ # Enable retries and run test_create_snapshot_clone_all_params.
_service.enable_retries()
- self.test_delete_share_source_all_params()
+ self.test_create_snapshot_clone_all_params()
- # Disable retries and run test_delete_share_source_all_params.
+ # Disable retries and run test_create_snapshot_clone_all_params.
_service.disable_retries()
- self.test_delete_share_source_all_params()
+ self.test_create_snapshot_clone_all_params()
@responses.activate
- def test_delete_share_source_value_error(self):
+ def test_create_snapshot_clone_value_error(self):
"""
- test_delete_share_source_value_error()
+ test_create_snapshot_clone_value_error()
"""
# Set up mock
- url = preprocess_url('/shares/testString/source')
+ url = preprocess_url('/snapshots/testString/clones/testString')
+ mock_response = '{"available": false, "created_at": "2019-01-01T12:00:00.000Z", "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
responses.add(
- responses.DELETE,
+ responses.PUT,
url,
- status=202,
+ body=mock_response,
+ content_type='application/json',
+ status=200,
)
# Set up parameter values
- share_id = 'testString'
+ id = 'testString'
+ zone_name = 'testString'
# Pass in all but one required param and check for a ValueError
req_param_dict = {
- "share_id": share_id,
+ "id": id,
+ "zone_name": zone_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_share_source(**req_copy)
+ _service.create_snapshot_clone(**req_copy)
- def test_delete_share_source_value_error_with_retries(self):
- # Enable retries and run test_delete_share_source_value_error.
+ def test_create_snapshot_clone_value_error_with_retries(self):
+ # Enable retries and run test_create_snapshot_clone_value_error.
_service.enable_retries()
- self.test_delete_share_source_value_error()
+ self.test_create_snapshot_clone_value_error()
- # Disable retries and run test_delete_share_source_value_error.
+ # Disable retries and run test_create_snapshot_clone_value_error.
_service.disable_retries()
- self.test_delete_share_source_value_error()
+ self.test_create_snapshot_clone_value_error()
-class TestGetShareSource:
- """
- Test Class for get_share_source
- """
+# endregion
+##############################################################################
+# End of Service: Snapshots
+##############################################################################
- @responses.activate
- def test_get_share_source_all_params(self):
- """
- get_share_source()
- """
- # Set up mock
- url = preprocess_url('/shares/testString/source')
- mock_response = '{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "resource_type": "share"}'
- responses.add(
- responses.GET,
- url,
- body=mock_response,
- content_type='application/json',
- status=200,
- )
-
- # Set up parameter values
- share_id = 'testString'
-
- # Invoke method
- response = _service.get_share_source(
- share_id,
- headers={},
- )
-
- # Check for correct operation
- assert len(responses.calls) == 1
- assert response.status_code == 200
-
- def test_get_share_source_all_params_with_retries(self):
- # Enable retries and run test_get_share_source_all_params.
- _service.enable_retries()
- self.test_get_share_source_all_params()
-
- # Disable retries and run test_get_share_source_all_params.
- _service.disable_retries()
- self.test_get_share_source_all_params()
-
- @responses.activate
- def test_get_share_source_value_error(self):
- """
- test_get_share_source_value_error()
- """
- # Set up mock
- url = preprocess_url('/shares/testString/source')
- mock_response = '{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "resource_type": "share"}'
- responses.add(
- responses.GET,
- url,
- body=mock_response,
- content_type='application/json',
- status=200,
- )
-
- # Set up parameter values
- share_id = 'testString'
-
- # Pass in all but one required param and check for a ValueError
- req_param_dict = {
- "share_id": share_id,
- }
- for param in req_param_dict.keys():
- req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()}
- with pytest.raises(ValueError):
- _service.get_share_source(**req_copy)
-
- def test_get_share_source_value_error_with_retries(self):
- # Enable retries and run test_get_share_source_value_error.
- _service.enable_retries()
- self.test_get_share_source_value_error()
-
- # Disable retries and run test_get_share_source_value_error.
- _service.disable_retries()
- self.test_get_share_source_value_error()
-
-
-# endregion
-##############################################################################
-# End of Service: Shares
##############################################################################
-
-##############################################################################
-# Start of Service: Geography
+# Start of Service: Shares
##############################################################################
# region
@@ -26680,19 +27644,19 @@ def test_new_instance_required_param_none(self):
)
-class TestListRegions:
+class TestListShareProfiles:
"""
- Test Class for list_regions
+ Test Class for list_share_profiles
"""
@responses.activate
- def test_list_regions_all_params(self):
+ def test_list_share_profiles_all_params(self):
"""
- list_regions()
+ list_share_profiles()
"""
# Set up mock
- url = preprocess_url('/regions')
- mock_response = '{"regions": [{"endpoint": "endpoint", "href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south", "status": "available"}]}'
+ url = preprocess_url('/share/profiles')
+ mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/share/profiles?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/share/profiles?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "profiles": [{"capacity": {"type": "fixed", "value": 4800}, "family": "defined_performance", "href": "https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops", "iops": {"type": "fixed", "value": 4000}, "name": "tier-3iops", "resource_type": "share_profile"}], "total_count": 132}'
responses.add(
responses.GET,
url,
@@ -26701,69 +27665,46 @@ def test_list_regions_all_params(self):
status=200,
)
+ # Set up parameter values
+ start = 'testString'
+ limit = 50
+ sort = 'name'
+
# Invoke method
- response = _service.list_regions()
+ response = _service.list_share_profiles(
+ start=start,
+ limit=limit,
+ sort=sort,
+ headers={},
+ )
# Check for correct operation
assert len(responses.calls) == 1
assert response.status_code == 200
+ # Validate query params
+ query_string = responses.calls[0].request.url.split('?', 1)[1]
+ query_string = urllib.parse.unquote_plus(query_string)
+ assert 'start={}'.format(start) in query_string
+ assert 'limit={}'.format(limit) in query_string
+ assert 'sort={}'.format(sort) in query_string
- def test_list_regions_all_params_with_retries(self):
- # Enable retries and run test_list_regions_all_params.
- _service.enable_retries()
- self.test_list_regions_all_params()
-
- # Disable retries and run test_list_regions_all_params.
- _service.disable_retries()
- self.test_list_regions_all_params()
-
- @responses.activate
- def test_list_regions_value_error(self):
- """
- test_list_regions_value_error()
- """
- # Set up mock
- url = preprocess_url('/regions')
- mock_response = '{"regions": [{"endpoint": "endpoint", "href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south", "status": "available"}]}'
- responses.add(
- responses.GET,
- url,
- body=mock_response,
- content_type='application/json',
- status=200,
- )
-
- # Pass in all but one required param and check for a ValueError
- req_param_dict = {
- }
- for param in req_param_dict.keys():
- req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()}
- with pytest.raises(ValueError):
- _service.list_regions(**req_copy)
-
- def test_list_regions_value_error_with_retries(self):
- # Enable retries and run test_list_regions_value_error.
+ def test_list_share_profiles_all_params_with_retries(self):
+ # Enable retries and run test_list_share_profiles_all_params.
_service.enable_retries()
- self.test_list_regions_value_error()
+ self.test_list_share_profiles_all_params()
- # Disable retries and run test_list_regions_value_error.
+ # Disable retries and run test_list_share_profiles_all_params.
_service.disable_retries()
- self.test_list_regions_value_error()
-
-
-class TestGetRegion:
- """
- Test Class for get_region
- """
+ self.test_list_share_profiles_all_params()
@responses.activate
- def test_get_region_all_params(self):
+ def test_list_share_profiles_required_params(self):
"""
- get_region()
+ test_list_share_profiles_required_params()
"""
# Set up mock
- url = preprocess_url('/regions/testString')
- mock_response = '{"endpoint": "endpoint", "href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south", "status": "available"}'
+ url = preprocess_url('/share/profiles')
+ mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/share/profiles?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/share/profiles?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "profiles": [{"capacity": {"type": "fixed", "value": 4800}, "family": "defined_performance", "href": "https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops", "iops": {"type": "fixed", "value": 4000}, "name": "tier-3iops", "resource_type": "share_profile"}], "total_count": 132}'
responses.add(
responses.GET,
url,
@@ -26772,36 +27713,30 @@ def test_get_region_all_params(self):
status=200,
)
- # Set up parameter values
- name = 'testString'
-
# Invoke method
- response = _service.get_region(
- name,
- headers={},
- )
+ response = _service.list_share_profiles()
# Check for correct operation
assert len(responses.calls) == 1
assert response.status_code == 200
- def test_get_region_all_params_with_retries(self):
- # Enable retries and run test_get_region_all_params.
+ def test_list_share_profiles_required_params_with_retries(self):
+ # Enable retries and run test_list_share_profiles_required_params.
_service.enable_retries()
- self.test_get_region_all_params()
+ self.test_list_share_profiles_required_params()
- # Disable retries and run test_get_region_all_params.
+ # Disable retries and run test_list_share_profiles_required_params.
_service.disable_retries()
- self.test_get_region_all_params()
+ self.test_list_share_profiles_required_params()
@responses.activate
- def test_get_region_value_error(self):
+ def test_list_share_profiles_value_error(self):
"""
- test_get_region_value_error()
+ test_list_share_profiles_value_error()
"""
# Set up mock
- url = preprocess_url('/regions/testString')
- mock_response = '{"endpoint": "endpoint", "href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south", "status": "available"}'
+ url = preprocess_url('/share/profiles')
+ mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/share/profiles?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/share/profiles?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "profiles": [{"capacity": {"type": "fixed", "value": 4800}, "family": "defined_performance", "href": "https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops", "iops": {"type": "fixed", "value": 4000}, "name": "tier-3iops", "resource_type": "share_profile"}], "total_count": 132}'
responses.add(
responses.GET,
url,
@@ -26810,122 +27745,108 @@ def test_get_region_value_error(self):
status=200,
)
- # Set up parameter values
- name = 'testString'
-
# Pass in all but one required param and check for a ValueError
req_param_dict = {
- "name": name,
}
for param in req_param_dict.keys():
req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()}
with pytest.raises(ValueError):
- _service.get_region(**req_copy)
+ _service.list_share_profiles(**req_copy)
- def test_get_region_value_error_with_retries(self):
- # Enable retries and run test_get_region_value_error.
+ def test_list_share_profiles_value_error_with_retries(self):
+ # Enable retries and run test_list_share_profiles_value_error.
_service.enable_retries()
- self.test_get_region_value_error()
+ self.test_list_share_profiles_value_error()
- # Disable retries and run test_get_region_value_error.
+ # Disable retries and run test_list_share_profiles_value_error.
_service.disable_retries()
- self.test_get_region_value_error()
-
-
-class TestListRegionZones:
- """
- Test Class for list_region_zones
- """
+ self.test_list_share_profiles_value_error()
@responses.activate
- def test_list_region_zones_all_params(self):
+ def test_list_share_profiles_with_pager_get_next(self):
"""
- list_region_zones()
+ test_list_share_profiles_with_pager_get_next()
"""
- # Set up mock
- url = preprocess_url('/regions/testString/zones')
- mock_response = '{"zones": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1", "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}, "status": "available"}]}'
+ # Set up a two-page mock response
+ url = preprocess_url('/share/profiles')
+ mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"profiles":[{"capacity":{"type":"fixed","value":4800},"family":"defined_performance","href":"https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops","iops":{"type":"fixed","value":4000},"name":"tier-3iops","resource_type":"share_profile"}]}'
+ mock_response2 = '{"total_count":2,"limit":1,"profiles":[{"capacity":{"type":"fixed","value":4800},"family":"defined_performance","href":"https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops","iops":{"type":"fixed","value":4000},"name":"tier-3iops","resource_type":"share_profile"}]}'
responses.add(
responses.GET,
url,
- body=mock_response,
+ body=mock_response1,
content_type='application/json',
status=200,
)
-
- # Set up parameter values
- region_name = 'testString'
-
- # Invoke method
- response = _service.list_region_zones(
- region_name,
- headers={},
+ responses.add(
+ responses.GET,
+ url,
+ body=mock_response2,
+ content_type='application/json',
+ status=200,
)
- # Check for correct operation
- assert len(responses.calls) == 1
- assert response.status_code == 200
-
- def test_list_region_zones_all_params_with_retries(self):
- # Enable retries and run test_list_region_zones_all_params.
- _service.enable_retries()
- self.test_list_region_zones_all_params()
-
- # Disable retries and run test_list_region_zones_all_params.
- _service.disable_retries()
- self.test_list_region_zones_all_params()
+ # Exercise the pager class for this operation
+ all_results = []
+ pager = ShareProfilesPager(
+ client=_service,
+ limit=10,
+ sort='name',
+ )
+ while pager.has_next():
+ next_page = pager.get_next()
+ assert next_page is not None
+ all_results.extend(next_page)
+ assert len(all_results) == 2
@responses.activate
- def test_list_region_zones_value_error(self):
+ def test_list_share_profiles_with_pager_get_all(self):
"""
- test_list_region_zones_value_error()
+ test_list_share_profiles_with_pager_get_all()
"""
- # Set up mock
- url = preprocess_url('/regions/testString/zones')
- mock_response = '{"zones": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1", "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}, "status": "available"}]}'
+ # Set up a two-page mock response
+ url = preprocess_url('/share/profiles')
+ mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"profiles":[{"capacity":{"type":"fixed","value":4800},"family":"defined_performance","href":"https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops","iops":{"type":"fixed","value":4000},"name":"tier-3iops","resource_type":"share_profile"}]}'
+ mock_response2 = '{"total_count":2,"limit":1,"profiles":[{"capacity":{"type":"fixed","value":4800},"family":"defined_performance","href":"https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops","iops":{"type":"fixed","value":4000},"name":"tier-3iops","resource_type":"share_profile"}]}'
responses.add(
responses.GET,
url,
- body=mock_response,
+ body=mock_response1,
+ content_type='application/json',
+ status=200,
+ )
+ responses.add(
+ responses.GET,
+ url,
+ body=mock_response2,
content_type='application/json',
status=200,
)
- # Set up parameter values
- region_name = 'testString'
-
- # Pass in all but one required param and check for a ValueError
- req_param_dict = {
- "region_name": region_name,
- }
- for param in req_param_dict.keys():
- req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()}
- with pytest.raises(ValueError):
- _service.list_region_zones(**req_copy)
-
- def test_list_region_zones_value_error_with_retries(self):
- # Enable retries and run test_list_region_zones_value_error.
- _service.enable_retries()
- self.test_list_region_zones_value_error()
-
- # Disable retries and run test_list_region_zones_value_error.
- _service.disable_retries()
- self.test_list_region_zones_value_error()
+ # Exercise the pager class for this operation
+ pager = ShareProfilesPager(
+ client=_service,
+ limit=10,
+ sort='name',
+ )
+ all_results = pager.get_all()
+ assert all_results is not None
+ assert len(all_results) == 2
-class TestGetRegionZone:
+class TestGetShareProfile:
"""
- Test Class for get_region_zone
+ Test Class for get_share_profile
"""
@responses.activate
- def test_get_region_zone_all_params(self):
+ def test_get_share_profile_all_params(self):
"""
- get_region_zone()
+ get_share_profile()
"""
# Set up mock
- url = preprocess_url('/regions/testString/zones/testString')
- mock_response = '{"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1", "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}, "status": "available"}'
+ url = preprocess_url('/share/profiles/testString')
+ mock_response = '{"capacity": {"type": "fixed", "value": 4800}, "family": "defined_performance", "href": "https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops", "iops": {"type": "fixed", "value": 4000}, "name": "tier-3iops", "resource_type": "share_profile"}'
responses.add(
responses.GET,
url,
@@ -26935,12 +27856,10 @@ def test_get_region_zone_all_params(self):
)
# Set up parameter values
- region_name = 'testString'
name = 'testString'
# Invoke method
- response = _service.get_region_zone(
- region_name,
+ response = _service.get_share_profile(
name,
headers={},
)
@@ -26949,23 +27868,23 @@ def test_get_region_zone_all_params(self):
assert len(responses.calls) == 1
assert response.status_code == 200
- def test_get_region_zone_all_params_with_retries(self):
- # Enable retries and run test_get_region_zone_all_params.
+ def test_get_share_profile_all_params_with_retries(self):
+ # Enable retries and run test_get_share_profile_all_params.
_service.enable_retries()
- self.test_get_region_zone_all_params()
+ self.test_get_share_profile_all_params()
- # Disable retries and run test_get_region_zone_all_params.
+ # Disable retries and run test_get_share_profile_all_params.
_service.disable_retries()
- self.test_get_region_zone_all_params()
+ self.test_get_share_profile_all_params()
@responses.activate
- def test_get_region_zone_value_error(self):
+ def test_get_share_profile_value_error(self):
"""
- test_get_region_zone_value_error()
+ test_get_share_profile_value_error()
"""
# Set up mock
- url = preprocess_url('/regions/testString/zones/testString')
- mock_response = '{"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1", "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}, "status": "available"}'
+ url = preprocess_url('/share/profiles/testString')
+ mock_response = '{"capacity": {"type": "fixed", "value": 4800}, "family": "defined_performance", "href": "https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops", "iops": {"type": "fixed", "value": 4000}, "name": "tier-3iops", "resource_type": "share_profile"}'
responses.add(
responses.GET,
url,
@@ -26975,99 +27894,40 @@ def test_get_region_zone_value_error(self):
)
# Set up parameter values
- region_name = 'testString'
name = 'testString'
# Pass in all but one required param and check for a ValueError
req_param_dict = {
- "region_name": region_name,
"name": name,
}
for param in req_param_dict.keys():
req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()}
with pytest.raises(ValueError):
- _service.get_region_zone(**req_copy)
+ _service.get_share_profile(**req_copy)
- def test_get_region_zone_value_error_with_retries(self):
- # Enable retries and run test_get_region_zone_value_error.
+ def test_get_share_profile_value_error_with_retries(self):
+ # Enable retries and run test_get_share_profile_value_error.
_service.enable_retries()
- self.test_get_region_zone_value_error()
+ self.test_get_share_profile_value_error()
- # Disable retries and run test_get_region_zone_value_error.
+ # Disable retries and run test_get_share_profile_value_error.
_service.disable_retries()
- self.test_get_region_zone_value_error()
-
-
-# endregion
-##############################################################################
-# End of Service: Geography
-##############################################################################
-
-##############################################################################
-# Start of Service: VirtualNetworkInterfaces
-##############################################################################
-# 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,
- )
+ self.test_get_share_profile_value_error()
-class TestListVirtualNetworkInterfaces:
+class TestListShares:
"""
- Test Class for list_virtual_network_interfaces
+ Test Class for list_shares
"""
@responses.activate
- def test_list_virtual_network_interfaces_all_params(self):
+ def test_list_shares_all_params(self):
"""
- list_virtual_network_interfaces()
+ list_shares()
"""
# Set up mock
- url = preprocess_url('/virtual_network_interfaces')
- mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces?start=d3e721fd-c988-4670-9927-dbd5e7b07fc6&limit=20"}, "total_count": 132, "virtual_network_interfaces": [{"auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "id": "0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "lifecycle_state": "stable", "name": "my-virtual-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "virtual_network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "name": "my-share-mount-target", "resource_type": "share_mount_target"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}]}'
+ url = preprocess_url('/shares')
+ mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/shares?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/shares?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "shares": [{"access_control_mode": "security_group", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "iops": 100, "latest_job": {"status": "cancelled", "status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "type": "replication_failover"}, "latest_sync": {"completed_at": "2019-01-01T12:00:00.000Z", "data_transferred": 0, "started_at": "2019-01-01T12:00:00.000Z"}, "lifecycle_state": "stable", "mount_targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "name": "my-share-mount-target", "resource_type": "share_mount_target"}], "name": "my-share", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops", "name": "tier-3iops", "resource_type": "share_profile"}, "replica_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}, "replication_cron_spec": "0 */5 * * *", "replication_role": "none", "replication_status": "active", "replication_status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "share", "size": 200, "source_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}, "user_tags": ["user_tags"], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "total_count": 132}'
responses.add(
responses.GET,
url,
@@ -27080,12 +27940,18 @@ def test_list_virtual_network_interfaces_all_params(self):
start = 'testString'
limit = 50
resource_group_id = 'testString'
+ name = 'testString'
+ sort = 'name'
+ replication_role = 'none'
# Invoke method
- response = _service.list_virtual_network_interfaces(
+ response = _service.list_shares(
start=start,
limit=limit,
resource_group_id=resource_group_id,
+ name=name,
+ sort=sort,
+ replication_role=replication_role,
headers={},
)
@@ -27098,24 +27964,27 @@ def test_list_virtual_network_interfaces_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 'name={}'.format(name) in query_string
+ assert 'sort={}'.format(sort) in query_string
+ assert 'replication_role={}'.format(replication_role) in query_string
- def test_list_virtual_network_interfaces_all_params_with_retries(self):
- # Enable retries and run test_list_virtual_network_interfaces_all_params.
+ def test_list_shares_all_params_with_retries(self):
+ # Enable retries and run test_list_shares_all_params.
_service.enable_retries()
- self.test_list_virtual_network_interfaces_all_params()
+ self.test_list_shares_all_params()
- # Disable retries and run test_list_virtual_network_interfaces_all_params.
+ # Disable retries and run test_list_shares_all_params.
_service.disable_retries()
- self.test_list_virtual_network_interfaces_all_params()
+ self.test_list_shares_all_params()
@responses.activate
- def test_list_virtual_network_interfaces_required_params(self):
+ def test_list_shares_required_params(self):
"""
- test_list_virtual_network_interfaces_required_params()
+ test_list_shares_required_params()
"""
# Set up mock
- url = preprocess_url('/virtual_network_interfaces')
- mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces?start=d3e721fd-c988-4670-9927-dbd5e7b07fc6&limit=20"}, "total_count": 132, "virtual_network_interfaces": [{"auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "id": "0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "lifecycle_state": "stable", "name": "my-virtual-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "virtual_network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "name": "my-share-mount-target", "resource_type": "share_mount_target"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}]}'
+ url = preprocess_url('/shares')
+ mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/shares?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/shares?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "shares": [{"access_control_mode": "security_group", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "iops": 100, "latest_job": {"status": "cancelled", "status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "type": "replication_failover"}, "latest_sync": {"completed_at": "2019-01-01T12:00:00.000Z", "data_transferred": 0, "started_at": "2019-01-01T12:00:00.000Z"}, "lifecycle_state": "stable", "mount_targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "name": "my-share-mount-target", "resource_type": "share_mount_target"}], "name": "my-share", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops", "name": "tier-3iops", "resource_type": "share_profile"}, "replica_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}, "replication_cron_spec": "0 */5 * * *", "replication_role": "none", "replication_status": "active", "replication_status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "share", "size": 200, "source_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}, "user_tags": ["user_tags"], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "total_count": 132}'
responses.add(
responses.GET,
url,
@@ -27125,29 +27994,29 @@ def test_list_virtual_network_interfaces_required_params(self):
)
# Invoke method
- response = _service.list_virtual_network_interfaces()
+ response = _service.list_shares()
# Check for correct operation
assert len(responses.calls) == 1
assert response.status_code == 200
- def test_list_virtual_network_interfaces_required_params_with_retries(self):
- # Enable retries and run test_list_virtual_network_interfaces_required_params.
+ def test_list_shares_required_params_with_retries(self):
+ # Enable retries and run test_list_shares_required_params.
_service.enable_retries()
- self.test_list_virtual_network_interfaces_required_params()
+ self.test_list_shares_required_params()
- # Disable retries and run test_list_virtual_network_interfaces_required_params.
+ # Disable retries and run test_list_shares_required_params.
_service.disable_retries()
- self.test_list_virtual_network_interfaces_required_params()
+ self.test_list_shares_required_params()
@responses.activate
- def test_list_virtual_network_interfaces_value_error(self):
+ def test_list_shares_value_error(self):
"""
- test_list_virtual_network_interfaces_value_error()
+ test_list_shares_value_error()
"""
# Set up mock
- url = preprocess_url('/virtual_network_interfaces')
- mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces?start=d3e721fd-c988-4670-9927-dbd5e7b07fc6&limit=20"}, "total_count": 132, "virtual_network_interfaces": [{"auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "id": "0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "lifecycle_state": "stable", "name": "my-virtual-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "virtual_network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "name": "my-share-mount-target", "resource_type": "share_mount_target"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}]}'
+ url = preprocess_url('/shares')
+ mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/shares?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/shares?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "shares": [{"access_control_mode": "security_group", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "iops": 100, "latest_job": {"status": "cancelled", "status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "type": "replication_failover"}, "latest_sync": {"completed_at": "2019-01-01T12:00:00.000Z", "data_transferred": 0, "started_at": "2019-01-01T12:00:00.000Z"}, "lifecycle_state": "stable", "mount_targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "name": "my-share-mount-target", "resource_type": "share_mount_target"}], "name": "my-share", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops", "name": "tier-3iops", "resource_type": "share_profile"}, "replica_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}, "replication_cron_spec": "0 */5 * * *", "replication_role": "none", "replication_status": "active", "replication_status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "share", "size": 200, "source_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}, "user_tags": ["user_tags"], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "total_count": 132}'
responses.add(
responses.GET,
url,
@@ -27162,26 +28031,26 @@ def test_list_virtual_network_interfaces_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_virtual_network_interfaces(**req_copy)
+ _service.list_shares(**req_copy)
- def test_list_virtual_network_interfaces_value_error_with_retries(self):
- # Enable retries and run test_list_virtual_network_interfaces_value_error.
+ def test_list_shares_value_error_with_retries(self):
+ # Enable retries and run test_list_shares_value_error.
_service.enable_retries()
- self.test_list_virtual_network_interfaces_value_error()
+ self.test_list_shares_value_error()
- # Disable retries and run test_list_virtual_network_interfaces_value_error.
+ # Disable retries and run test_list_shares_value_error.
_service.disable_retries()
- self.test_list_virtual_network_interfaces_value_error()
+ self.test_list_shares_value_error()
@responses.activate
- def test_list_virtual_network_interfaces_with_pager_get_next(self):
+ def test_list_shares_with_pager_get_next(self):
"""
- test_list_virtual_network_interfaces_with_pager_get_next()
+ test_list_shares_with_pager_get_next()
"""
# Set up a two-page mock response
- url = preprocess_url('/virtual_network_interfaces')
- mock_response1 = '{"virtual_network_interfaces":[{"auto_delete":false,"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","href":"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","id":"0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","lifecycle_state":"stable","name":"my-virtual-network-interface","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"virtual_network_interface","security_groups":[{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271","id":"be5df5ca-12a0-494b-907e-aa6ec2bfa271","name":"my-security-group"}],"subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"},"target":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c","id":"4cf9171a-0043-4434-8727-15b53dbc374c","name":"my-share-mount-target","resource_type":"share_mount_target"},"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1}'
- mock_response2 = '{"virtual_network_interfaces":[{"auto_delete":false,"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","href":"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","id":"0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","lifecycle_state":"stable","name":"my-virtual-network-interface","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"virtual_network_interface","security_groups":[{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271","id":"be5df5ca-12a0-494b-907e-aa6ec2bfa271","name":"my-security-group"}],"subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"},"target":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c","id":"4cf9171a-0043-4434-8727-15b53dbc374c","name":"my-share-mount-target","resource_type":"share_mount_target"},"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"total_count":2,"limit":1}'
+ url = preprocess_url('/shares')
+ mock_response1 = '{"shares":[{"access_control_mode":"security_group","created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58","encryption":"provider_managed","encryption_key":{"crn":"crn:v1:bluemix:public:kms:us-south:a/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"},"href":"https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58","id":"0fe9e5d8-0a4d-4818-96ec-e99708644a58","iops":100,"latest_job":{"status":"cancelled","status_reasons":[{"code":"cannot_reach_source_share","message":"The replication failover failed because the source share cannot be reached.","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}],"type":"replication_failover"},"latest_sync":{"completed_at":"2019-01-01T12:00:00.000Z","data_transferred":0,"started_at":"2019-01-01T12:00:00.000Z"},"lifecycle_state":"stable","mount_targets":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c","id":"4cf9171a-0043-4434-8727-15b53dbc374c","name":"my-share-mount-target","resource_type":"share_mount_target"}],"name":"my-share","profile":{"href":"https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops","name":"tier-3iops","resource_type":"share_profile"},"replica_share":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58","id":"0fe9e5d8-0a4d-4818-96ec-e99708644a58","name":"my-share","remote":{"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"share"},"replication_cron_spec":"0 */5 * * *","replication_role":"none","replication_status":"active","replication_status_reasons":[{"code":"cannot_reach_source_share","message":"The replication failover failed because the source share cannot be reached.","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}],"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"share","size":200,"source_share":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58","id":"0fe9e5d8-0a4d-4818-96ec-e99708644a58","name":"my-share","remote":{"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"share"},"user_tags":["user_tags"],"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1}'
+ mock_response2 = '{"shares":[{"access_control_mode":"security_group","created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58","encryption":"provider_managed","encryption_key":{"crn":"crn:v1:bluemix:public:kms:us-south:a/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"},"href":"https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58","id":"0fe9e5d8-0a4d-4818-96ec-e99708644a58","iops":100,"latest_job":{"status":"cancelled","status_reasons":[{"code":"cannot_reach_source_share","message":"The replication failover failed because the source share cannot be reached.","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}],"type":"replication_failover"},"latest_sync":{"completed_at":"2019-01-01T12:00:00.000Z","data_transferred":0,"started_at":"2019-01-01T12:00:00.000Z"},"lifecycle_state":"stable","mount_targets":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c","id":"4cf9171a-0043-4434-8727-15b53dbc374c","name":"my-share-mount-target","resource_type":"share_mount_target"}],"name":"my-share","profile":{"href":"https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops","name":"tier-3iops","resource_type":"share_profile"},"replica_share":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58","id":"0fe9e5d8-0a4d-4818-96ec-e99708644a58","name":"my-share","remote":{"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"share"},"replication_cron_spec":"0 */5 * * *","replication_role":"none","replication_status":"active","replication_status_reasons":[{"code":"cannot_reach_source_share","message":"The replication failover failed because the source share cannot be reached.","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}],"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"share","size":200,"source_share":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58","id":"0fe9e5d8-0a4d-4818-96ec-e99708644a58","name":"my-share","remote":{"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"share"},"user_tags":["user_tags"],"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"total_count":2,"limit":1}'
responses.add(
responses.GET,
url,
@@ -27199,10 +28068,13 @@ def test_list_virtual_network_interfaces_with_pager_get_next(self):
# Exercise the pager class for this operation
all_results = []
- pager = VirtualNetworkInterfacesPager(
+ pager = SharesPager(
client=_service,
limit=10,
resource_group_id='testString',
+ name='testString',
+ sort='name',
+ replication_role='none',
)
while pager.has_next():
next_page = pager.get_next()
@@ -27211,14 +28083,14 @@ def test_list_virtual_network_interfaces_with_pager_get_next(self):
assert len(all_results) == 2
@responses.activate
- def test_list_virtual_network_interfaces_with_pager_get_all(self):
+ def test_list_shares_with_pager_get_all(self):
"""
- test_list_virtual_network_interfaces_with_pager_get_all()
+ test_list_shares_with_pager_get_all()
"""
# Set up a two-page mock response
- url = preprocess_url('/virtual_network_interfaces')
- mock_response1 = '{"virtual_network_interfaces":[{"auto_delete":false,"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","href":"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","id":"0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","lifecycle_state":"stable","name":"my-virtual-network-interface","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"virtual_network_interface","security_groups":[{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271","id":"be5df5ca-12a0-494b-907e-aa6ec2bfa271","name":"my-security-group"}],"subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"},"target":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c","id":"4cf9171a-0043-4434-8727-15b53dbc374c","name":"my-share-mount-target","resource_type":"share_mount_target"},"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1}'
- mock_response2 = '{"virtual_network_interfaces":[{"auto_delete":false,"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","href":"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","id":"0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","lifecycle_state":"stable","name":"my-virtual-network-interface","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"virtual_network_interface","security_groups":[{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271","id":"be5df5ca-12a0-494b-907e-aa6ec2bfa271","name":"my-security-group"}],"subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"},"target":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c","id":"4cf9171a-0043-4434-8727-15b53dbc374c","name":"my-share-mount-target","resource_type":"share_mount_target"},"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"total_count":2,"limit":1}'
+ url = preprocess_url('/shares')
+ mock_response1 = '{"shares":[{"access_control_mode":"security_group","created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58","encryption":"provider_managed","encryption_key":{"crn":"crn:v1:bluemix:public:kms:us-south:a/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"},"href":"https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58","id":"0fe9e5d8-0a4d-4818-96ec-e99708644a58","iops":100,"latest_job":{"status":"cancelled","status_reasons":[{"code":"cannot_reach_source_share","message":"The replication failover failed because the source share cannot be reached.","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}],"type":"replication_failover"},"latest_sync":{"completed_at":"2019-01-01T12:00:00.000Z","data_transferred":0,"started_at":"2019-01-01T12:00:00.000Z"},"lifecycle_state":"stable","mount_targets":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c","id":"4cf9171a-0043-4434-8727-15b53dbc374c","name":"my-share-mount-target","resource_type":"share_mount_target"}],"name":"my-share","profile":{"href":"https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops","name":"tier-3iops","resource_type":"share_profile"},"replica_share":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58","id":"0fe9e5d8-0a4d-4818-96ec-e99708644a58","name":"my-share","remote":{"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"share"},"replication_cron_spec":"0 */5 * * *","replication_role":"none","replication_status":"active","replication_status_reasons":[{"code":"cannot_reach_source_share","message":"The replication failover failed because the source share cannot be reached.","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}],"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"share","size":200,"source_share":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58","id":"0fe9e5d8-0a4d-4818-96ec-e99708644a58","name":"my-share","remote":{"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"share"},"user_tags":["user_tags"],"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1}'
+ mock_response2 = '{"shares":[{"access_control_mode":"security_group","created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58","encryption":"provider_managed","encryption_key":{"crn":"crn:v1:bluemix:public:kms:us-south:a/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"},"href":"https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58","id":"0fe9e5d8-0a4d-4818-96ec-e99708644a58","iops":100,"latest_job":{"status":"cancelled","status_reasons":[{"code":"cannot_reach_source_share","message":"The replication failover failed because the source share cannot be reached.","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}],"type":"replication_failover"},"latest_sync":{"completed_at":"2019-01-01T12:00:00.000Z","data_transferred":0,"started_at":"2019-01-01T12:00:00.000Z"},"lifecycle_state":"stable","mount_targets":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c","id":"4cf9171a-0043-4434-8727-15b53dbc374c","name":"my-share-mount-target","resource_type":"share_mount_target"}],"name":"my-share","profile":{"href":"https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops","name":"tier-3iops","resource_type":"share_profile"},"replica_share":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58","id":"0fe9e5d8-0a4d-4818-96ec-e99708644a58","name":"my-share","remote":{"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"share"},"replication_cron_spec":"0 */5 * * *","replication_role":"none","replication_status":"active","replication_status_reasons":[{"code":"cannot_reach_source_share","message":"The replication failover failed because the source share cannot be reached.","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}],"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"share","size":200,"source_share":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58","id":"0fe9e5d8-0a4d-4818-96ec-e99708644a58","name":"my-share","remote":{"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"share"},"user_tags":["user_tags"],"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"total_count":2,"limit":1}'
responses.add(
responses.GET,
url,
@@ -27235,263 +28107,407 @@ def test_list_virtual_network_interfaces_with_pager_get_all(self):
)
# Exercise the pager class for this operation
- pager = VirtualNetworkInterfacesPager(
+ pager = SharesPager(
client=_service,
limit=10,
resource_group_id='testString',
+ name='testString',
+ sort='name',
+ replication_role='none',
)
all_results = pager.get_all()
assert all_results is not None
assert len(all_results) == 2
-class TestGetVirtualNetworkInterface:
+class TestCreateShare:
"""
- Test Class for get_virtual_network_interface
+ Test Class for create_share
"""
@responses.activate
- def test_get_virtual_network_interface_all_params(self):
+ def test_create_share_all_params(self):
"""
- get_virtual_network_interface()
+ create_share()
"""
# Set up mock
- url = preprocess_url('/virtual_network_interfaces/testString')
- mock_response = '{"auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "id": "0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "lifecycle_state": "stable", "name": "my-virtual-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "virtual_network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "name": "my-share-mount-target", "resource_type": "share_mount_target"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
+ url = preprocess_url('/shares')
+ mock_response = '{"access_control_mode": "security_group", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "iops": 100, "latest_job": {"status": "cancelled", "status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "type": "replication_failover"}, "latest_sync": {"completed_at": "2019-01-01T12:00:00.000Z", "data_transferred": 0, "started_at": "2019-01-01T12:00:00.000Z"}, "lifecycle_state": "stable", "mount_targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "name": "my-share-mount-target", "resource_type": "share_mount_target"}], "name": "my-share", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops", "name": "tier-3iops", "resource_type": "share_profile"}, "replica_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}, "replication_cron_spec": "0 */5 * * *", "replication_role": "none", "replication_status": "active", "replication_status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "share", "size": 200, "source_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}, "user_tags": ["user_tags"], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
responses.add(
- responses.GET,
+ responses.POST,
url,
body=mock_response,
content_type='application/json',
- status=200,
+ status=201,
)
+ # Construct a dict representation of a VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext model
+ virtual_network_interface_ip_prototype_model = {}
+ virtual_network_interface_ip_prototype_model['address'] = '10.0.0.5'
+ virtual_network_interface_ip_prototype_model['auto_delete'] = False
+ virtual_network_interface_ip_prototype_model['name'] = 'my-reserved-ip'
+
+ # Construct a dict representation of a VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext model
+ virtual_network_interface_primary_ip_prototype_model = {}
+ virtual_network_interface_primary_ip_prototype_model['address'] = '10.0.0.5'
+ virtual_network_interface_primary_ip_prototype_model['auto_delete'] = False
+ virtual_network_interface_primary_ip_prototype_model['name'] = 'my-reserved-ip'
+
+ # Construct a dict representation of a ResourceGroupIdentityById model
+ resource_group_identity_model = {}
+ resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
+
+ # Construct a dict representation of a SecurityGroupIdentityById model
+ security_group_identity_model = {}
+ security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271'
+
+ # Construct a dict representation of a SubnetIdentityById model
+ subnet_identity_model = {}
+ subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
+
+ # Construct a dict representation of a ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfacePrototypeShareMountTargetContext model
+ share_mount_target_virtual_network_interface_prototype_model = {}
+ share_mount_target_virtual_network_interface_prototype_model['allow_ip_spoofing'] = True
+ share_mount_target_virtual_network_interface_prototype_model['auto_delete'] = False
+ share_mount_target_virtual_network_interface_prototype_model['enable_infrastructure_nat'] = True
+ share_mount_target_virtual_network_interface_prototype_model['ips'] = [virtual_network_interface_ip_prototype_model]
+ share_mount_target_virtual_network_interface_prototype_model['name'] = 'my-virtual-network-interface'
+ share_mount_target_virtual_network_interface_prototype_model['primary_ip'] = virtual_network_interface_primary_ip_prototype_model
+ share_mount_target_virtual_network_interface_prototype_model['resource_group'] = resource_group_identity_model
+ share_mount_target_virtual_network_interface_prototype_model['security_groups'] = [security_group_identity_model]
+ share_mount_target_virtual_network_interface_prototype_model['subnet'] = subnet_identity_model
+
+ # Construct a dict representation of a ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup model
+ share_mount_target_prototype_model = {}
+ share_mount_target_prototype_model['name'] = 'my-share-mount-target'
+ share_mount_target_prototype_model['transit_encryption'] = 'none'
+ share_mount_target_prototype_model['virtual_network_interface'] = share_mount_target_virtual_network_interface_prototype_model
+
+ # Construct a dict representation of a ShareProfileIdentityByName model
+ share_profile_identity_model = {}
+ share_profile_identity_model['name'] = 'tier-3iops'
+
+ # Construct a dict representation of a ZoneIdentityByName model
+ zone_identity_model = {}
+ zone_identity_model['name'] = 'us-south-1'
+
+ # Construct a dict representation of a SharePrototypeShareContext model
+ share_prototype_share_context_model = {}
+ share_prototype_share_context_model['iops'] = 100
+ share_prototype_share_context_model['mount_targets'] = [share_mount_target_prototype_model]
+ share_prototype_share_context_model['name'] = 'my-share'
+ share_prototype_share_context_model['profile'] = share_profile_identity_model
+ share_prototype_share_context_model['replication_cron_spec'] = '0 */5 * * *'
+ share_prototype_share_context_model['resource_group'] = resource_group_identity_model
+ share_prototype_share_context_model['user_tags'] = []
+ share_prototype_share_context_model['zone'] = zone_identity_model
+
+ # Construct a dict representation of a EncryptionKeyIdentityByCRN model
+ encryption_key_identity_model = {}
+ encryption_key_identity_model['crn'] = 'crn:v1:bluemix:public:kms:us-south:a/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179'
+
+ # Construct a dict representation of a ShareInitialOwner model
+ share_initial_owner_model = {}
+ share_initial_owner_model['gid'] = 50
+ share_initial_owner_model['uid'] = 50
+
+ # Construct a dict representation of a SharePrototypeShareBySize model
+ share_prototype_model = {}
+ share_prototype_model['iops'] = 100
+ share_prototype_model['mount_targets'] = [share_mount_target_prototype_model]
+ share_prototype_model['name'] = 'my-share'
+ share_prototype_model['profile'] = share_profile_identity_model
+ share_prototype_model['replica_share'] = share_prototype_share_context_model
+ share_prototype_model['user_tags'] = []
+ share_prototype_model['zone'] = zone_identity_model
+ share_prototype_model['access_control_mode'] = 'security_group'
+ share_prototype_model['encryption_key'] = encryption_key_identity_model
+ share_prototype_model['initial_owner'] = share_initial_owner_model
+ share_prototype_model['resource_group'] = resource_group_identity_model
+ share_prototype_model['size'] = 200
+
# Set up parameter values
- id = 'testString'
+ share_prototype = share_prototype_model
# Invoke method
- response = _service.get_virtual_network_interface(
- id,
+ response = _service.create_share(
+ share_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 == share_prototype
- def test_get_virtual_network_interface_all_params_with_retries(self):
- # Enable retries and run test_get_virtual_network_interface_all_params.
+ def test_create_share_all_params_with_retries(self):
+ # Enable retries and run test_create_share_all_params.
_service.enable_retries()
- self.test_get_virtual_network_interface_all_params()
+ self.test_create_share_all_params()
- # Disable retries and run test_get_virtual_network_interface_all_params.
+ # Disable retries and run test_create_share_all_params.
_service.disable_retries()
- self.test_get_virtual_network_interface_all_params()
+ self.test_create_share_all_params()
@responses.activate
- def test_get_virtual_network_interface_value_error(self):
+ def test_create_share_value_error(self):
"""
- test_get_virtual_network_interface_value_error()
+ test_create_share_value_error()
"""
# Set up mock
- url = preprocess_url('/virtual_network_interfaces/testString')
- mock_response = '{"auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "id": "0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "lifecycle_state": "stable", "name": "my-virtual-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "virtual_network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "name": "my-share-mount-target", "resource_type": "share_mount_target"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
+ url = preprocess_url('/shares')
+ mock_response = '{"access_control_mode": "security_group", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "iops": 100, "latest_job": {"status": "cancelled", "status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "type": "replication_failover"}, "latest_sync": {"completed_at": "2019-01-01T12:00:00.000Z", "data_transferred": 0, "started_at": "2019-01-01T12:00:00.000Z"}, "lifecycle_state": "stable", "mount_targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "name": "my-share-mount-target", "resource_type": "share_mount_target"}], "name": "my-share", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops", "name": "tier-3iops", "resource_type": "share_profile"}, "replica_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}, "replication_cron_spec": "0 */5 * * *", "replication_role": "none", "replication_status": "active", "replication_status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "share", "size": 200, "source_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}, "user_tags": ["user_tags"], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
responses.add(
- responses.GET,
+ responses.POST,
url,
body=mock_response,
content_type='application/json',
- status=200,
+ status=201,
)
+ # Construct a dict representation of a VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext model
+ virtual_network_interface_ip_prototype_model = {}
+ virtual_network_interface_ip_prototype_model['address'] = '10.0.0.5'
+ virtual_network_interface_ip_prototype_model['auto_delete'] = False
+ virtual_network_interface_ip_prototype_model['name'] = 'my-reserved-ip'
+
+ # Construct a dict representation of a VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext model
+ virtual_network_interface_primary_ip_prototype_model = {}
+ virtual_network_interface_primary_ip_prototype_model['address'] = '10.0.0.5'
+ virtual_network_interface_primary_ip_prototype_model['auto_delete'] = False
+ virtual_network_interface_primary_ip_prototype_model['name'] = 'my-reserved-ip'
+
+ # Construct a dict representation of a ResourceGroupIdentityById model
+ resource_group_identity_model = {}
+ resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
+
+ # Construct a dict representation of a SecurityGroupIdentityById model
+ security_group_identity_model = {}
+ security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271'
+
+ # Construct a dict representation of a SubnetIdentityById model
+ subnet_identity_model = {}
+ subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
+
+ # Construct a dict representation of a ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfacePrototypeShareMountTargetContext model
+ share_mount_target_virtual_network_interface_prototype_model = {}
+ share_mount_target_virtual_network_interface_prototype_model['allow_ip_spoofing'] = True
+ share_mount_target_virtual_network_interface_prototype_model['auto_delete'] = False
+ share_mount_target_virtual_network_interface_prototype_model['enable_infrastructure_nat'] = True
+ share_mount_target_virtual_network_interface_prototype_model['ips'] = [virtual_network_interface_ip_prototype_model]
+ share_mount_target_virtual_network_interface_prototype_model['name'] = 'my-virtual-network-interface'
+ share_mount_target_virtual_network_interface_prototype_model['primary_ip'] = virtual_network_interface_primary_ip_prototype_model
+ share_mount_target_virtual_network_interface_prototype_model['resource_group'] = resource_group_identity_model
+ share_mount_target_virtual_network_interface_prototype_model['security_groups'] = [security_group_identity_model]
+ share_mount_target_virtual_network_interface_prototype_model['subnet'] = subnet_identity_model
+
+ # Construct a dict representation of a ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup model
+ share_mount_target_prototype_model = {}
+ share_mount_target_prototype_model['name'] = 'my-share-mount-target'
+ share_mount_target_prototype_model['transit_encryption'] = 'none'
+ share_mount_target_prototype_model['virtual_network_interface'] = share_mount_target_virtual_network_interface_prototype_model
+
+ # Construct a dict representation of a ShareProfileIdentityByName model
+ share_profile_identity_model = {}
+ share_profile_identity_model['name'] = 'tier-3iops'
+
+ # Construct a dict representation of a ZoneIdentityByName model
+ zone_identity_model = {}
+ zone_identity_model['name'] = 'us-south-1'
+
+ # Construct a dict representation of a SharePrototypeShareContext model
+ share_prototype_share_context_model = {}
+ share_prototype_share_context_model['iops'] = 100
+ share_prototype_share_context_model['mount_targets'] = [share_mount_target_prototype_model]
+ share_prototype_share_context_model['name'] = 'my-share'
+ share_prototype_share_context_model['profile'] = share_profile_identity_model
+ share_prototype_share_context_model['replication_cron_spec'] = '0 */5 * * *'
+ share_prototype_share_context_model['resource_group'] = resource_group_identity_model
+ share_prototype_share_context_model['user_tags'] = []
+ share_prototype_share_context_model['zone'] = zone_identity_model
+
+ # Construct a dict representation of a EncryptionKeyIdentityByCRN model
+ encryption_key_identity_model = {}
+ encryption_key_identity_model['crn'] = 'crn:v1:bluemix:public:kms:us-south:a/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179'
+
+ # Construct a dict representation of a ShareInitialOwner model
+ share_initial_owner_model = {}
+ share_initial_owner_model['gid'] = 50
+ share_initial_owner_model['uid'] = 50
+
+ # Construct a dict representation of a SharePrototypeShareBySize model
+ share_prototype_model = {}
+ share_prototype_model['iops'] = 100
+ share_prototype_model['mount_targets'] = [share_mount_target_prototype_model]
+ share_prototype_model['name'] = 'my-share'
+ share_prototype_model['profile'] = share_profile_identity_model
+ share_prototype_model['replica_share'] = share_prototype_share_context_model
+ share_prototype_model['user_tags'] = []
+ share_prototype_model['zone'] = zone_identity_model
+ share_prototype_model['access_control_mode'] = 'security_group'
+ share_prototype_model['encryption_key'] = encryption_key_identity_model
+ share_prototype_model['initial_owner'] = share_initial_owner_model
+ share_prototype_model['resource_group'] = resource_group_identity_model
+ share_prototype_model['size'] = 200
+
# Set up parameter values
- id = 'testString'
+ share_prototype = share_prototype_model
# Pass in all but one required param and check for a ValueError
req_param_dict = {
- "id": id,
+ "share_prototype": share_prototype,
}
for param in req_param_dict.keys():
req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()}
with pytest.raises(ValueError):
- _service.get_virtual_network_interface(**req_copy)
+ _service.create_share(**req_copy)
- def test_get_virtual_network_interface_value_error_with_retries(self):
- # Enable retries and run test_get_virtual_network_interface_value_error.
+ def test_create_share_value_error_with_retries(self):
+ # Enable retries and run test_create_share_value_error.
_service.enable_retries()
- self.test_get_virtual_network_interface_value_error()
+ self.test_create_share_value_error()
- # Disable retries and run test_get_virtual_network_interface_value_error.
+ # Disable retries and run test_create_share_value_error.
_service.disable_retries()
- self.test_get_virtual_network_interface_value_error()
+ self.test_create_share_value_error()
-class TestUpdateVirtualNetworkInterface:
+class TestDeleteShare:
"""
- Test Class for update_virtual_network_interface
+ Test Class for delete_share
"""
@responses.activate
- def test_update_virtual_network_interface_all_params(self):
+ def test_delete_share_all_params(self):
"""
- update_virtual_network_interface()
+ delete_share()
"""
# Set up mock
- url = preprocess_url('/virtual_network_interfaces/testString')
- mock_response = '{"auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "id": "0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "lifecycle_state": "stable", "name": "my-virtual-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "virtual_network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "name": "my-share-mount-target", "resource_type": "share_mount_target"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
+ url = preprocess_url('/shares/testString')
+ mock_response = '{"access_control_mode": "security_group", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "iops": 100, "latest_job": {"status": "cancelled", "status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "type": "replication_failover"}, "latest_sync": {"completed_at": "2019-01-01T12:00:00.000Z", "data_transferred": 0, "started_at": "2019-01-01T12:00:00.000Z"}, "lifecycle_state": "stable", "mount_targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "name": "my-share-mount-target", "resource_type": "share_mount_target"}], "name": "my-share", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops", "name": "tier-3iops", "resource_type": "share_profile"}, "replica_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}, "replication_cron_spec": "0 */5 * * *", "replication_role": "none", "replication_status": "active", "replication_status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "share", "size": 200, "source_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}, "user_tags": ["user_tags"], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
responses.add(
- responses.PATCH,
+ responses.DELETE,
url,
body=mock_response,
content_type='application/json',
- status=200,
+ status=202,
)
- # Construct a dict representation of a VirtualNetworkInterfacePatch model
- virtual_network_interface_patch_model = {}
- virtual_network_interface_patch_model['name'] = 'my-virtual-network-interface'
-
# Set up parameter values
id = 'testString'
- virtual_network_interface_patch = virtual_network_interface_patch_model
+ if_match = 'W/"96d225c4-56bd-43d9-98fc-d7148e5c5028"'
# Invoke method
- response = _service.update_virtual_network_interface(
+ response = _service.delete_share(
id,
- virtual_network_interface_patch,
+ if_match=if_match,
headers={},
)
# Check for correct operation
assert len(responses.calls) == 1
- assert response.status_code == 200
- # Validate body params
- req_body = json.loads(str(responses.calls[0].request.body, 'utf-8'))
- assert req_body == virtual_network_interface_patch
+ assert response.status_code == 202
- def test_update_virtual_network_interface_all_params_with_retries(self):
- # Enable retries and run test_update_virtual_network_interface_all_params.
+ def test_delete_share_all_params_with_retries(self):
+ # Enable retries and run test_delete_share_all_params.
_service.enable_retries()
- self.test_update_virtual_network_interface_all_params()
+ self.test_delete_share_all_params()
- # Disable retries and run test_update_virtual_network_interface_all_params.
+ # Disable retries and run test_delete_share_all_params.
_service.disable_retries()
- self.test_update_virtual_network_interface_all_params()
+ self.test_delete_share_all_params()
@responses.activate
- def test_update_virtual_network_interface_value_error(self):
+ def test_delete_share_required_params(self):
"""
- test_update_virtual_network_interface_value_error()
+ test_delete_share_required_params()
"""
# Set up mock
- url = preprocess_url('/virtual_network_interfaces/testString')
- mock_response = '{"auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "id": "0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "lifecycle_state": "stable", "name": "my-virtual-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "virtual_network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "name": "my-share-mount-target", "resource_type": "share_mount_target"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
+ url = preprocess_url('/shares/testString')
+ mock_response = '{"access_control_mode": "security_group", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "iops": 100, "latest_job": {"status": "cancelled", "status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "type": "replication_failover"}, "latest_sync": {"completed_at": "2019-01-01T12:00:00.000Z", "data_transferred": 0, "started_at": "2019-01-01T12:00:00.000Z"}, "lifecycle_state": "stable", "mount_targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "name": "my-share-mount-target", "resource_type": "share_mount_target"}], "name": "my-share", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops", "name": "tier-3iops", "resource_type": "share_profile"}, "replica_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}, "replication_cron_spec": "0 */5 * * *", "replication_role": "none", "replication_status": "active", "replication_status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "share", "size": 200, "source_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}, "user_tags": ["user_tags"], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
responses.add(
- responses.PATCH,
+ responses.DELETE,
url,
body=mock_response,
content_type='application/json',
- status=200,
+ status=202,
)
- # Construct a dict representation of a VirtualNetworkInterfacePatch model
- virtual_network_interface_patch_model = {}
- virtual_network_interface_patch_model['name'] = 'my-virtual-network-interface'
-
# Set up parameter values
id = 'testString'
- virtual_network_interface_patch = virtual_network_interface_patch_model
- # Pass in all but one required param and check for a ValueError
- req_param_dict = {
- "id": id,
- "virtual_network_interface_patch": virtual_network_interface_patch,
- }
- for param in req_param_dict.keys():
- req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()}
- with pytest.raises(ValueError):
- _service.update_virtual_network_interface(**req_copy)
+ # Invoke method
+ response = _service.delete_share(
+ id,
+ headers={},
+ )
- def test_update_virtual_network_interface_value_error_with_retries(self):
- # Enable retries and run test_update_virtual_network_interface_value_error.
+ # Check for correct operation
+ assert len(responses.calls) == 1
+ assert response.status_code == 202
+
+ def test_delete_share_required_params_with_retries(self):
+ # Enable retries and run test_delete_share_required_params.
_service.enable_retries()
- self.test_update_virtual_network_interface_value_error()
+ self.test_delete_share_required_params()
- # Disable retries and run test_update_virtual_network_interface_value_error.
+ # Disable retries and run test_delete_share_required_params.
_service.disable_retries()
- self.test_update_virtual_network_interface_value_error()
-
-
-# endregion
-##############################################################################
-# End of Service: VirtualNetworkInterfaces
-##############################################################################
-
-##############################################################################
-# Start of Service: PublicGateways
-##############################################################################
-# region
-
-
-class TestNewInstance:
- """
- Test Class for new_instance
- """
+ self.test_delete_share_required_params()
- def test_new_instance(self):
+ @responses.activate
+ def test_delete_share_value_error(self):
"""
- new_instance()
+ test_delete_share_value_error()
"""
- os.environ['TEST_SERVICE_AUTH_TYPE'] = 'noAuth'
-
- service = VpcV1.new_instance(
- version=version,
- service_name='TEST_SERVICE',
+ # Set up mock
+ url = preprocess_url('/shares/testString')
+ mock_response = '{"access_control_mode": "security_group", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "iops": 100, "latest_job": {"status": "cancelled", "status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "type": "replication_failover"}, "latest_sync": {"completed_at": "2019-01-01T12:00:00.000Z", "data_transferred": 0, "started_at": "2019-01-01T12:00:00.000Z"}, "lifecycle_state": "stable", "mount_targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "name": "my-share-mount-target", "resource_type": "share_mount_target"}], "name": "my-share", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops", "name": "tier-3iops", "resource_type": "share_profile"}, "replica_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}, "replication_cron_spec": "0 */5 * * *", "replication_role": "none", "replication_status": "active", "replication_status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "share", "size": 200, "source_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}, "user_tags": ["user_tags"], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
+ responses.add(
+ responses.DELETE,
+ url,
+ body=mock_response,
+ content_type='application/json',
+ status=202,
)
- assert service is not None
- assert isinstance(service, VpcV1)
+ # Set up parameter values
+ id = 'testString'
- 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',
- )
+ # Pass in all but one required param and check for a ValueError
+ req_param_dict = {
+ "id": id,
+ }
+ for param in req_param_dict.keys():
+ req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()}
+ with pytest.raises(ValueError):
+ _service.delete_share(**req_copy)
- def test_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_delete_share_value_error_with_retries(self):
+ # Enable retries and run test_delete_share_value_error.
+ _service.enable_retries()
+ self.test_delete_share_value_error()
- 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,
- )
+ # Disable retries and run test_delete_share_value_error.
+ _service.disable_retries()
+ self.test_delete_share_value_error()
-class TestListPublicGateways:
+class TestGetShare:
"""
- Test Class for list_public_gateways
+ Test Class for get_share
"""
@responses.activate
- def test_list_public_gateways_all_params(self):
+ def test_get_share_all_params(self):
"""
- list_public_gateways()
+ get_share()
"""
# Set up mock
- 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", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "total_count": 132}'
+ url = preprocess_url('/shares/testString')
+ mock_response = '{"access_control_mode": "security_group", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "iops": 100, "latest_job": {"status": "cancelled", "status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "type": "replication_failover"}, "latest_sync": {"completed_at": "2019-01-01T12:00:00.000Z", "data_transferred": 0, "started_at": "2019-01-01T12:00:00.000Z"}, "lifecycle_state": "stable", "mount_targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "name": "my-share-mount-target", "resource_type": "share_mount_target"}], "name": "my-share", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops", "name": "tier-3iops", "resource_type": "share_profile"}, "replica_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}, "replication_cron_spec": "0 */5 * * *", "replication_role": "none", "replication_status": "active", "replication_status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "share", "size": 200, "source_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}, "user_tags": ["user_tags"], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
responses.add(
responses.GET,
url,
@@ -27501,45 +28517,35 @@ def test_list_public_gateways_all_params(self):
)
# Set up parameter values
- start = 'testString'
- limit = 50
- 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_share(
+ 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_share_all_params_with_retries(self):
+ # Enable retries and run test_get_share_all_params.
_service.enable_retries()
- self.test_list_public_gateways_all_params()
+ self.test_get_share_all_params()
- # Disable retries and run test_list_public_gateways_all_params.
+ # Disable retries and run test_get_share_all_params.
_service.disable_retries()
- self.test_list_public_gateways_all_params()
+ self.test_get_share_all_params()
@responses.activate
- def test_list_public_gateways_required_params(self):
+ def test_get_share_value_error(self):
"""
- test_list_public_gateways_required_params()
+ test_get_share_value_error()
"""
# Set up mock
- 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", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "total_count": 132}'
+ url = preprocess_url('/shares/testString')
+ mock_response = '{"access_control_mode": "security_group", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "iops": 100, "latest_job": {"status": "cancelled", "status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "type": "replication_failover"}, "latest_sync": {"completed_at": "2019-01-01T12:00:00.000Z", "data_transferred": 0, "started_at": "2019-01-01T12:00:00.000Z"}, "lifecycle_state": "stable", "mount_targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "name": "my-share-mount-target", "resource_type": "share_mount_target"}], "name": "my-share", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops", "name": "tier-3iops", "resource_type": "share_profile"}, "replica_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}, "replication_cron_spec": "0 */5 * * *", "replication_role": "none", "replication_status": "active", "replication_status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "share", "size": 200, "source_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}, "user_tags": ["user_tags"], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
responses.add(
responses.GET,
url,
@@ -27548,348 +28554,334 @@ def test_list_public_gateways_required_params(self):
status=200,
)
- # Invoke method
- response = _service.list_public_gateways()
+ # Set up parameter values
+ id = 'testString'
- # Check for correct operation
- assert len(responses.calls) == 1
- assert response.status_code == 200
+ # Pass in all but one required param and check for a ValueError
+ req_param_dict = {
+ "id": id,
+ }
+ for param in req_param_dict.keys():
+ req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()}
+ with pytest.raises(ValueError):
+ _service.get_share(**req_copy)
- def test_list_public_gateways_required_params_with_retries(self):
- # Enable retries and run test_list_public_gateways_required_params.
+ def test_get_share_value_error_with_retries(self):
+ # Enable retries and run test_get_share_value_error.
_service.enable_retries()
- self.test_list_public_gateways_required_params()
+ self.test_get_share_value_error()
- # Disable retries and run test_list_public_gateways_required_params.
+ # Disable retries and run test_get_share_value_error.
_service.disable_retries()
- self.test_list_public_gateways_required_params()
+ self.test_get_share_value_error()
+
+
+class TestUpdateShare:
+ """
+ Test Class for update_share
+ """
@responses.activate
- def test_list_public_gateways_value_error(self):
+ def test_update_share_all_params(self):
"""
- test_list_public_gateways_value_error()
+ update_share()
"""
# Set up mock
- 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", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "total_count": 132}'
+ url = preprocess_url('/shares/testString')
+ mock_response = '{"access_control_mode": "security_group", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "iops": 100, "latest_job": {"status": "cancelled", "status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "type": "replication_failover"}, "latest_sync": {"completed_at": "2019-01-01T12:00:00.000Z", "data_transferred": 0, "started_at": "2019-01-01T12:00:00.000Z"}, "lifecycle_state": "stable", "mount_targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "name": "my-share-mount-target", "resource_type": "share_mount_target"}], "name": "my-share", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops", "name": "tier-3iops", "resource_type": "share_profile"}, "replica_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}, "replication_cron_spec": "0 */5 * * *", "replication_role": "none", "replication_status": "active", "replication_status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "share", "size": 200, "source_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}, "user_tags": ["user_tags"], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
responses.add(
- responses.GET,
+ responses.PATCH,
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_public_gateways(**req_copy)
+ # Construct a dict representation of a ShareProfileIdentityByName model
+ share_profile_identity_model = {}
+ share_profile_identity_model['name'] = 'tier-3iops'
- def test_list_public_gateways_value_error_with_retries(self):
- # Enable retries and run test_list_public_gateways_value_error.
+ # Construct a dict representation of a SharePatch model
+ share_patch_model = {}
+ share_patch_model['access_control_mode'] = 'security_group'
+ share_patch_model['iops'] = 100
+ share_patch_model['name'] = 'my-share'
+ share_patch_model['profile'] = share_profile_identity_model
+ share_patch_model['replication_cron_spec'] = '0 */5 * * *'
+ share_patch_model['size'] = 200
+ share_patch_model['user_tags'] = ['testString']
+
+ # Set up parameter values
+ id = 'testString'
+ share_patch = share_patch_model
+ if_match = 'W/"96d225c4-56bd-43d9-98fc-d7148e5c5028"'
+
+ # Invoke method
+ response = _service.update_share(
+ id,
+ share_patch,
+ if_match=if_match,
+ headers={},
+ )
+
+ # Check for correct operation
+ assert len(responses.calls) == 1
+ assert response.status_code == 200
+ # Validate body params
+ req_body = json.loads(str(responses.calls[0].request.body, 'utf-8'))
+ assert req_body == share_patch
+
+ def test_update_share_all_params_with_retries(self):
+ # Enable retries and run test_update_share_all_params.
_service.enable_retries()
- self.test_list_public_gateways_value_error()
+ self.test_update_share_all_params()
- # Disable retries and run test_list_public_gateways_value_error.
+ # Disable retries and run test_update_share_all_params.
_service.disable_retries()
- self.test_list_public_gateways_value_error()
+ self.test_update_share_all_params()
@responses.activate
- def test_list_public_gateways_with_pager_get_next(self):
+ def test_update_share_required_params(self):
"""
- test_list_public_gateways_with_pager_get_next()
+ test_update_share_required_params()
"""
- # Set up a two-page mock response
- url = preprocess_url('/public_gateways')
- mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"public_gateways":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::public-gateway:dc5431ef-1fc6-4861-adc9-a59d077d1241","floating_ip":{"address":"203.0.113.1","crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689","id":"39300233-9995-4806-89a5-3c1b6eb88689","name":"my-floating-ip"},"href":"https://us-south.iaas.cloud.ibm.com/v1/public_gateways/dc5431ef-1fc6-4861-adc9-a59d077d1241","id":"dc5431ef-1fc6-4861-adc9-a59d077d1241","name":"my-public-gateway","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"public_gateway","status":"available","vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}]}'
- mock_response2 = '{"total_count":2,"limit":1,"public_gateways":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::public-gateway:dc5431ef-1fc6-4861-adc9-a59d077d1241","floating_ip":{"address":"203.0.113.1","crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689","id":"39300233-9995-4806-89a5-3c1b6eb88689","name":"my-floating-ip"},"href":"https://us-south.iaas.cloud.ibm.com/v1/public_gateways/dc5431ef-1fc6-4861-adc9-a59d077d1241","id":"dc5431ef-1fc6-4861-adc9-a59d077d1241","name":"my-public-gateway","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"public_gateway","status":"available","vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}]}'
+ # Set up mock
+ url = preprocess_url('/shares/testString')
+ mock_response = '{"access_control_mode": "security_group", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "iops": 100, "latest_job": {"status": "cancelled", "status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "type": "replication_failover"}, "latest_sync": {"completed_at": "2019-01-01T12:00:00.000Z", "data_transferred": 0, "started_at": "2019-01-01T12:00:00.000Z"}, "lifecycle_state": "stable", "mount_targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "name": "my-share-mount-target", "resource_type": "share_mount_target"}], "name": "my-share", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops", "name": "tier-3iops", "resource_type": "share_profile"}, "replica_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}, "replication_cron_spec": "0 */5 * * *", "replication_role": "none", "replication_status": "active", "replication_status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "share", "size": 200, "source_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}, "user_tags": ["user_tags"], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
responses.add(
- responses.GET,
- url,
- body=mock_response1,
- content_type='application/json',
- status=200,
- )
- responses.add(
- responses.GET,
- url,
- body=mock_response2,
- content_type='application/json',
- status=200,
- )
-
- # Exercise the pager class for this operation
- all_results = []
- pager = PublicGatewaysPager(
- client=_service,
- limit=10,
- resource_group_id='testString',
- )
- while pager.has_next():
- next_page = pager.get_next()
- assert next_page is not None
- all_results.extend(next_page)
- assert len(all_results) == 2
-
- @responses.activate
- def test_list_public_gateways_with_pager_get_all(self):
- """
- test_list_public_gateways_with_pager_get_all()
- """
- # Set up a two-page mock response
- url = preprocess_url('/public_gateways')
- mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"public_gateways":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::public-gateway:dc5431ef-1fc6-4861-adc9-a59d077d1241","floating_ip":{"address":"203.0.113.1","crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689","id":"39300233-9995-4806-89a5-3c1b6eb88689","name":"my-floating-ip"},"href":"https://us-south.iaas.cloud.ibm.com/v1/public_gateways/dc5431ef-1fc6-4861-adc9-a59d077d1241","id":"dc5431ef-1fc6-4861-adc9-a59d077d1241","name":"my-public-gateway","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"public_gateway","status":"available","vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}]}'
- mock_response2 = '{"total_count":2,"limit":1,"public_gateways":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::public-gateway:dc5431ef-1fc6-4861-adc9-a59d077d1241","floating_ip":{"address":"203.0.113.1","crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689","id":"39300233-9995-4806-89a5-3c1b6eb88689","name":"my-floating-ip"},"href":"https://us-south.iaas.cloud.ibm.com/v1/public_gateways/dc5431ef-1fc6-4861-adc9-a59d077d1241","id":"dc5431ef-1fc6-4861-adc9-a59d077d1241","name":"my-public-gateway","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"public_gateway","status":"available","vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}]}'
- responses.add(
- responses.GET,
- url,
- body=mock_response1,
- content_type='application/json',
- status=200,
- )
- responses.add(
- responses.GET,
- url,
- body=mock_response2,
- content_type='application/json',
- status=200,
- )
-
- # Exercise the pager class for this operation
- pager = PublicGatewaysPager(
- client=_service,
- limit=10,
- resource_group_id='testString',
- )
- all_results = pager.get_all()
- assert all_results is not None
- assert len(all_results) == 2
-
-
-class TestCreatePublicGateway:
- """
- Test Class for create_public_gateway
- """
-
- @responses.activate
- def test_create_public_gateway_all_params(self):
- """
- create_public_gateway()
- """
- # Set up mock
- 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", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
- responses.add(
- responses.POST,
+ responses.PATCH,
url,
body=mock_response,
content_type='application/json',
- status=201,
+ status=200,
)
- # 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 ShareProfileIdentityByName model
+ share_profile_identity_model = {}
+ share_profile_identity_model['name'] = 'tier-3iops'
- # Construct a dict representation of a ResourceGroupIdentityById model
- resource_group_identity_model = {}
- resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
+ # Construct a dict representation of a SharePatch model
+ share_patch_model = {}
+ share_patch_model['access_control_mode'] = 'security_group'
+ share_patch_model['iops'] = 100
+ share_patch_model['name'] = 'my-share'
+ share_patch_model['profile'] = share_profile_identity_model
+ share_patch_model['replication_cron_spec'] = '0 */5 * * *'
+ share_patch_model['size'] = 200
+ share_patch_model['user_tags'] = ['testString']
# Set up parameter values
- 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'
+ share_patch = share_patch_model
# Invoke method
- response = _service.create_public_gateway(
- vpc,
- zone,
- floating_ip=floating_ip,
- name=name,
- resource_group=resource_group,
+ response = _service.update_share(
+ id,
+ share_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['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 req_body == share_patch
- def test_create_public_gateway_all_params_with_retries(self):
- # Enable retries and run test_create_public_gateway_all_params.
+ def test_update_share_required_params_with_retries(self):
+ # Enable retries and run test_update_share_required_params.
_service.enable_retries()
- self.test_create_public_gateway_all_params()
+ self.test_update_share_required_params()
- # Disable retries and run test_create_public_gateway_all_params.
+ # Disable retries and run test_update_share_required_params.
_service.disable_retries()
- self.test_create_public_gateway_all_params()
+ self.test_update_share_required_params()
@responses.activate
- def test_create_public_gateway_value_error(self):
+ def test_update_share_value_error(self):
"""
- test_create_public_gateway_value_error()
+ test_update_share_value_error()
"""
# Set up mock
- 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", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
+ url = preprocess_url('/shares/testString')
+ mock_response = '{"access_control_mode": "security_group", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "iops": 100, "latest_job": {"status": "cancelled", "status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "type": "replication_failover"}, "latest_sync": {"completed_at": "2019-01-01T12:00:00.000Z", "data_transferred": 0, "started_at": "2019-01-01T12:00:00.000Z"}, "lifecycle_state": "stable", "mount_targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "name": "my-share-mount-target", "resource_type": "share_mount_target"}], "name": "my-share", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops", "name": "tier-3iops", "resource_type": "share_profile"}, "replica_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}, "replication_cron_spec": "0 */5 * * *", "replication_role": "none", "replication_status": "active", "replication_status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "share", "size": 200, "source_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}, "user_tags": ["user_tags"], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
responses.add(
- responses.POST,
+ responses.PATCH,
url,
body=mock_response,
content_type='application/json',
- status=201,
+ status=200,
)
- # 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 ShareProfileIdentityByName model
+ share_profile_identity_model = {}
+ share_profile_identity_model['name'] = 'tier-3iops'
- # Construct a dict representation of a ResourceGroupIdentityById model
- resource_group_identity_model = {}
- resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
+ # Construct a dict representation of a SharePatch model
+ share_patch_model = {}
+ share_patch_model['access_control_mode'] = 'security_group'
+ share_patch_model['iops'] = 100
+ share_patch_model['name'] = 'my-share'
+ share_patch_model['profile'] = share_profile_identity_model
+ share_patch_model['replication_cron_spec'] = '0 */5 * * *'
+ share_patch_model['size'] = 200
+ share_patch_model['user_tags'] = ['testString']
# Set up parameter values
- 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'
+ share_patch = share_patch_model
# Pass in all but one required param and check for a ValueError
req_param_dict = {
- "vpc": vpc,
- "zone": zone,
+ "id": id,
+ "share_patch": share_patch,
}
for param in req_param_dict.keys():
req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()}
with pytest.raises(ValueError):
- _service.create_public_gateway(**req_copy)
+ _service.update_share(**req_copy)
- def test_create_public_gateway_value_error_with_retries(self):
- # Enable retries and run test_create_public_gateway_value_error.
+ def test_update_share_value_error_with_retries(self):
+ # Enable retries and run test_update_share_value_error.
_service.enable_retries()
- self.test_create_public_gateway_value_error()
+ self.test_update_share_value_error()
- # Disable retries and run test_create_public_gateway_value_error.
+ # Disable retries and run test_update_share_value_error.
_service.disable_retries()
- self.test_create_public_gateway_value_error()
+ self.test_update_share_value_error()
-class TestDeletePublicGateway:
+class TestFailoverShare:
"""
- Test Class for delete_public_gateway
+ Test Class for failover_share
"""
@responses.activate
- def test_delete_public_gateway_all_params(self):
+ def test_failover_share_all_params(self):
"""
- delete_public_gateway()
+ failover_share()
"""
# Set up mock
- url = preprocess_url('/public_gateways/testString')
+ url = preprocess_url('/shares/testString/failover')
responses.add(
- responses.DELETE,
+ responses.POST,
url,
- status=204,
+ status=202,
)
# Set up parameter values
- id = 'testString'
+ share_id = 'testString'
+ fallback_policy = 'fail'
+ timeout = 600
# Invoke method
- response = _service.delete_public_gateway(
- id,
+ response = _service.failover_share(
+ share_id,
+ fallback_policy=fallback_policy,
+ timeout=timeout,
headers={},
)
# Check for correct operation
assert len(responses.calls) == 1
- assert response.status_code == 204
+ assert response.status_code == 202
+ # Validate body params
+ req_body = json.loads(str(responses.calls[0].request.body, 'utf-8'))
+ assert req_body['fallback_policy'] == 'fail'
+ assert req_body['timeout'] == 600
- def test_delete_public_gateway_all_params_with_retries(self):
- # Enable retries and run test_delete_public_gateway_all_params.
+ def test_failover_share_all_params_with_retries(self):
+ # Enable retries and run test_failover_share_all_params.
_service.enable_retries()
- self.test_delete_public_gateway_all_params()
+ self.test_failover_share_all_params()
- # Disable retries and run test_delete_public_gateway_all_params.
+ # Disable retries and run test_failover_share_all_params.
_service.disable_retries()
- self.test_delete_public_gateway_all_params()
+ self.test_failover_share_all_params()
@responses.activate
- def test_delete_public_gateway_value_error(self):
+ def test_failover_share_required_params(self):
"""
- test_delete_public_gateway_value_error()
+ test_failover_share_required_params()
"""
# Set up mock
- url = preprocess_url('/public_gateways/testString')
+ url = preprocess_url('/shares/testString/failover')
responses.add(
- responses.DELETE,
+ responses.POST,
url,
- status=204,
+ status=202,
)
# Set up parameter values
- id = 'testString'
+ share_id = 'testString'
+
+ # Invoke method
+ response = _service.failover_share(
+ share_id,
+ headers={},
+ )
+
+ # Check for correct operation
+ assert len(responses.calls) == 1
+ assert response.status_code == 202
+
+ def test_failover_share_required_params_with_retries(self):
+ # Enable retries and run test_failover_share_required_params.
+ _service.enable_retries()
+ self.test_failover_share_required_params()
+
+ # Disable retries and run test_failover_share_required_params.
+ _service.disable_retries()
+ self.test_failover_share_required_params()
+
+ @responses.activate
+ def test_failover_share_value_error(self):
+ """
+ test_failover_share_value_error()
+ """
+ # Set up mock
+ url = preprocess_url('/shares/testString/failover')
+ responses.add(
+ responses.POST,
+ url,
+ status=202,
+ )
+
+ # Set up parameter values
+ share_id = 'testString'
# Pass in all but one required param and check for a ValueError
req_param_dict = {
- "id": id,
+ "share_id": share_id,
}
for param in req_param_dict.keys():
req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()}
with pytest.raises(ValueError):
- _service.delete_public_gateway(**req_copy)
+ _service.failover_share(**req_copy)
- def test_delete_public_gateway_value_error_with_retries(self):
- # Enable retries and run test_delete_public_gateway_value_error.
+ def test_failover_share_value_error_with_retries(self):
+ # Enable retries and run test_failover_share_value_error.
_service.enable_retries()
- self.test_delete_public_gateway_value_error()
+ self.test_failover_share_value_error()
- # Disable retries and run test_delete_public_gateway_value_error.
+ # Disable retries and run test_failover_share_value_error.
_service.disable_retries()
- self.test_delete_public_gateway_value_error()
+ self.test_failover_share_value_error()
-class TestGetPublicGateway:
+class TestListShareMountTargets:
"""
- Test Class for get_public_gateway
+ Test Class for list_share_mount_targets
"""
@responses.activate
- def test_get_public_gateway_all_params(self):
+ def test_list_share_mount_targets_all_params(self):
"""
- get_public_gateway()
+ list_share_mount_targets()
"""
# Set up mock
- 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", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
+ url = preprocess_url('/shares/testString/mount_targets')
+ mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets?limit=20"}, "limit": 20, "mount_targets": [{"access_control_mode": "security_group", "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "lifecycle_state": "stable", "mount_path": "10.240.1.23:/nxg_s_voll_mz7121_58e7e963_8f4b_4a0c_b71a_8ba8d9cd1e2e", "name": "my-share-mount-target", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "share_mount_target", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "transit_encryption": "none", "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "id": "0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}], "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}'
responses.add(
responses.GET,
url,
@@ -27899,35 +28891,47 @@ def test_get_public_gateway_all_params(self):
)
# Set up parameter values
- id = 'testString'
+ share_id = 'testString'
+ name = 'testString'
+ start = 'testString'
+ limit = 50
# Invoke method
- response = _service.get_public_gateway(
- id,
+ response = _service.list_share_mount_targets(
+ share_id,
+ name=name,
+ start=start,
+ limit=limit,
headers={},
)
# Check for correct operation
assert len(responses.calls) == 1
assert response.status_code == 200
+ # Validate query params
+ query_string = responses.calls[0].request.url.split('?', 1)[1]
+ query_string = urllib.parse.unquote_plus(query_string)
+ assert 'name={}'.format(name) in query_string
+ assert 'start={}'.format(start) in query_string
+ assert 'limit={}'.format(limit) in query_string
- def test_get_public_gateway_all_params_with_retries(self):
- # Enable retries and run test_get_public_gateway_all_params.
+ def test_list_share_mount_targets_all_params_with_retries(self):
+ # Enable retries and run test_list_share_mount_targets_all_params.
_service.enable_retries()
- self.test_get_public_gateway_all_params()
+ self.test_list_share_mount_targets_all_params()
- # Disable retries and run test_get_public_gateway_all_params.
+ # Disable retries and run test_list_share_mount_targets_all_params.
_service.disable_retries()
- self.test_get_public_gateway_all_params()
+ self.test_list_share_mount_targets_all_params()
@responses.activate
- def test_get_public_gateway_value_error(self):
+ def test_list_share_mount_targets_required_params(self):
"""
- test_get_public_gateway_value_error()
+ test_list_share_mount_targets_required_params()
"""
# Set up mock
- 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", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
+ url = preprocess_url('/shares/testString/mount_targets')
+ mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets?limit=20"}, "limit": 20, "mount_targets": [{"access_control_mode": "security_group", "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "lifecycle_state": "stable", "mount_path": "10.240.1.23:/nxg_s_voll_mz7121_58e7e963_8f4b_4a0c_b71a_8ba8d9cd1e2e", "name": "my-share-mount-target", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "share_mount_target", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "transit_encryption": "none", "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "id": "0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}], "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}'
responses.add(
responses.GET,
url,
@@ -27937,348 +28941,111 @@ def test_get_public_gateway_value_error(self):
)
# 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_public_gateway(**req_copy)
-
- def test_get_public_gateway_value_error_with_retries(self):
- # Enable retries and run test_get_public_gateway_value_error.
- _service.enable_retries()
- self.test_get_public_gateway_value_error()
-
- # Disable retries and run test_get_public_gateway_value_error.
- _service.disable_retries()
- self.test_get_public_gateway_value_error()
-
-
-class TestUpdatePublicGateway:
- """
- Test Class for update_public_gateway
- """
-
- @responses.activate
- def test_update_public_gateway_all_params(self):
- """
- update_public_gateway()
- """
- # Set up mock
- 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", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
- responses.add(
- responses.PATCH,
- url,
- body=mock_response,
- 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'
-
- # Set up parameter values
- id = 'testString'
- public_gateway_patch = public_gateway_patch_model
+ share_id = 'testString'
# Invoke method
- response = _service.update_public_gateway(
- id,
- public_gateway_patch,
+ response = _service.list_share_mount_targets(
+ share_id,
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 == public_gateway_patch
- def test_update_public_gateway_all_params_with_retries(self):
- # Enable retries and run test_update_public_gateway_all_params.
+ def test_list_share_mount_targets_required_params_with_retries(self):
+ # Enable retries and run test_list_share_mount_targets_required_params.
_service.enable_retries()
- self.test_update_public_gateway_all_params()
+ self.test_list_share_mount_targets_required_params()
- # Disable retries and run test_update_public_gateway_all_params.
+ # Disable retries and run test_list_share_mount_targets_required_params.
_service.disable_retries()
- self.test_update_public_gateway_all_params()
+ self.test_list_share_mount_targets_required_params()
@responses.activate
- def test_update_public_gateway_value_error(self):
+ def test_list_share_mount_targets_value_error(self):
"""
- test_update_public_gateway_value_error()
+ test_list_share_mount_targets_value_error()
"""
# Set up mock
- 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", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
+ url = preprocess_url('/shares/testString/mount_targets')
+ mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets?limit=20"}, "limit": 20, "mount_targets": [{"access_control_mode": "security_group", "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "lifecycle_state": "stable", "mount_path": "10.240.1.23:/nxg_s_voll_mz7121_58e7e963_8f4b_4a0c_b71a_8ba8d9cd1e2e", "name": "my-share-mount-target", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "share_mount_target", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "transit_encryption": "none", "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "id": "0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}], "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}'
responses.add(
- responses.PATCH,
+ responses.GET,
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'
-
# Set up parameter values
- id = 'testString'
- public_gateway_patch = public_gateway_patch_model
+ share_id = 'testString'
# Pass in all but one required param and check for a ValueError
req_param_dict = {
- "id": id,
- "public_gateway_patch": public_gateway_patch,
+ "share_id": share_id,
}
for param in req_param_dict.keys():
req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()}
with pytest.raises(ValueError):
- _service.update_public_gateway(**req_copy)
+ _service.list_share_mount_targets(**req_copy)
- def test_update_public_gateway_value_error_with_retries(self):
- # Enable retries and run test_update_public_gateway_value_error.
+ def test_list_share_mount_targets_value_error_with_retries(self):
+ # Enable retries and run test_list_share_mount_targets_value_error.
_service.enable_retries()
- self.test_update_public_gateway_value_error()
+ self.test_list_share_mount_targets_value_error()
- # Disable retries and run test_update_public_gateway_value_error.
+ # Disable retries and run test_list_share_mount_targets_value_error.
_service.disable_retries()
- self.test_update_public_gateway_value_error()
-
-
-# endregion
-##############################################################################
-# End of Service: PublicGateways
-##############################################################################
-
-##############################################################################
-# Start of Service: FloatingIPs
-##############################################################################
-# region
-
-
-class TestNewInstance:
- """
- Test Class for new_instance
- """
+ self.test_list_share_mount_targets_value_error()
- def test_new_instance(self):
+ @responses.activate
+ def test_list_share_mount_targets_with_pager_get_next(self):
"""
- new_instance()
+ test_list_share_mount_targets_with_pager_get_next()
"""
- os.environ['TEST_SERVICE_AUTH_TYPE'] = 'noAuth'
-
- service = VpcV1.new_instance(
- version=version,
- service_name='TEST_SERVICE',
+ # Set up a two-page mock response
+ url = preprocess_url('/shares/testString/mount_targets')
+ mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"mount_targets":[{"access_control_mode":"security_group","created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c","id":"4cf9171a-0043-4434-8727-15b53dbc374c","lifecycle_state":"stable","mount_path":"10.240.1.23:/nxg_s_voll_mz7121_58e7e963_8f4b_4a0c_b71a_8ba8d9cd1e2e","name":"my-share-mount-target","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"share_mount_target","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"},"transit_encryption":"none","virtual_network_interface":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","href":"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","id":"0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","name":"my-virtual-network-interface","resource_type":"virtual_network_interface"},"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"}}]}'
+ mock_response2 = '{"total_count":2,"limit":1,"mount_targets":[{"access_control_mode":"security_group","created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c","id":"4cf9171a-0043-4434-8727-15b53dbc374c","lifecycle_state":"stable","mount_path":"10.240.1.23:/nxg_s_voll_mz7121_58e7e963_8f4b_4a0c_b71a_8ba8d9cd1e2e","name":"my-share-mount-target","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"share_mount_target","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"},"transit_encryption":"none","virtual_network_interface":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","href":"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","id":"0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","name":"my-virtual-network-interface","resource_type":"virtual_network_interface"},"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"}}]}'
+ responses.add(
+ responses.GET,
+ url,
+ body=mock_response1,
+ content_type='application/json',
+ status=200,
+ )
+ responses.add(
+ responses.GET,
+ url,
+ body=mock_response2,
+ content_type='application/json',
+ status=200,
)
- assert service is not None
- assert isinstance(service, VpcV1)
+ # Exercise the pager class for this operation
+ all_results = []
+ pager = ShareMountTargetsPager(
+ client=_service,
+ share_id='testString',
+ name='testString',
+ limit=10,
+ )
+ while pager.has_next():
+ next_page = pager.get_next()
+ assert next_page is not None
+ all_results.extend(next_page)
+ assert len(all_results) == 2
- def test_new_instance_without_authenticator(self):
+ @responses.activate
+ def test_list_share_mount_targets_with_pager_get_all(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 TestListFloatingIps:
- """
- Test Class for list_floating_ips
- """
-
- @responses.activate
- def test_list_floating_ips_all_params(self):
- """
- list_floating_ips()
- """
- # Set up mock
- url = preprocess_url('/floating_ips')
- mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips?limit=20"}, "floating_ips": [{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}'
- responses.add(
- responses.GET,
- url,
- body=mock_response,
- content_type='application/json',
- status=200,
- )
-
- # Set up parameter values
- start = 'testString'
- limit = 50
- resource_group_id = 'testString'
- sort = 'name'
-
- # Invoke method
- response = _service.list_floating_ips(
- start=start,
- limit=limit,
- resource_group_id=resource_group_id,
- sort=sort,
- headers={},
- )
-
- # 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 'sort={}'.format(sort) in query_string
-
- def test_list_floating_ips_all_params_with_retries(self):
- # Enable retries and run test_list_floating_ips_all_params.
- _service.enable_retries()
- self.test_list_floating_ips_all_params()
-
- # Disable retries and run test_list_floating_ips_all_params.
- _service.disable_retries()
- self.test_list_floating_ips_all_params()
-
- @responses.activate
- def test_list_floating_ips_required_params(self):
- """
- test_list_floating_ips_required_params()
- """
- # Set up mock
- url = preprocess_url('/floating_ips')
- mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips?limit=20"}, "floating_ips": [{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}'
- responses.add(
- responses.GET,
- url,
- body=mock_response,
- content_type='application/json',
- status=200,
- )
-
- # Invoke method
- response = _service.list_floating_ips()
-
- # 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.
- _service.enable_retries()
- self.test_list_floating_ips_required_params()
-
- # Disable retries and run test_list_floating_ips_required_params.
- _service.disable_retries()
- self.test_list_floating_ips_required_params()
-
- @responses.activate
- def test_list_floating_ips_value_error(self):
- """
- test_list_floating_ips_value_error()
- """
- # Set up mock
- url = preprocess_url('/floating_ips')
- mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips?limit=20"}, "floating_ips": [{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}'
- responses.add(
- responses.GET,
- url,
- 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_floating_ips(**req_copy)
-
- def test_list_floating_ips_value_error_with_retries(self):
- # Enable retries and run test_list_floating_ips_value_error.
- _service.enable_retries()
- self.test_list_floating_ips_value_error()
-
- # Disable retries and run test_list_floating_ips_value_error.
- _service.disable_retries()
- self.test_list_floating_ips_value_error()
-
- @responses.activate
- def test_list_floating_ips_with_pager_get_next(self):
- """
- test_list_floating_ips_with_pager_get_next()
- """
- # Set up a two-page mock response
- url = preprocess_url('/floating_ips')
- mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"floating_ips":[{"address":"203.0.113.1","created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689","href":"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689","id":"39300233-9995-4806-89a5-3c1b6eb88689","name":"my-floating-ip","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"status":"available","target":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-instance-network-interface","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"network_interface"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}]}'
- mock_response2 = '{"total_count":2,"limit":1,"floating_ips":[{"address":"203.0.113.1","created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689","href":"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689","id":"39300233-9995-4806-89a5-3c1b6eb88689","name":"my-floating-ip","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"status":"available","target":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-instance-network-interface","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"network_interface"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}]}'
- responses.add(
- responses.GET,
- url,
- body=mock_response1,
- content_type='application/json',
- status=200,
- )
- responses.add(
- responses.GET,
- url,
- body=mock_response2,
- content_type='application/json',
- status=200,
- )
-
- # Exercise the pager class for this operation
- all_results = []
- pager = FloatingIpsPager(
- client=_service,
- limit=10,
- resource_group_id='testString',
- sort='name',
- )
- while pager.has_next():
- next_page = pager.get_next()
- assert next_page is not None
- all_results.extend(next_page)
- assert len(all_results) == 2
-
- @responses.activate
- def test_list_floating_ips_with_pager_get_all(self):
- """
- test_list_floating_ips_with_pager_get_all()
+ test_list_share_mount_targets_with_pager_get_all()
"""
# Set up a two-page mock response
- url = preprocess_url('/floating_ips')
- mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"floating_ips":[{"address":"203.0.113.1","created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689","href":"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689","id":"39300233-9995-4806-89a5-3c1b6eb88689","name":"my-floating-ip","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"status":"available","target":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-instance-network-interface","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"network_interface"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}]}'
- mock_response2 = '{"total_count":2,"limit":1,"floating_ips":[{"address":"203.0.113.1","created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689","href":"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689","id":"39300233-9995-4806-89a5-3c1b6eb88689","name":"my-floating-ip","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"status":"available","target":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-instance-network-interface","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"network_interface"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}]}'
+ url = preprocess_url('/shares/testString/mount_targets')
+ mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"mount_targets":[{"access_control_mode":"security_group","created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c","id":"4cf9171a-0043-4434-8727-15b53dbc374c","lifecycle_state":"stable","mount_path":"10.240.1.23:/nxg_s_voll_mz7121_58e7e963_8f4b_4a0c_b71a_8ba8d9cd1e2e","name":"my-share-mount-target","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"share_mount_target","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"},"transit_encryption":"none","virtual_network_interface":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","href":"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","id":"0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","name":"my-virtual-network-interface","resource_type":"virtual_network_interface"},"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"}}]}'
+ mock_response2 = '{"total_count":2,"limit":1,"mount_targets":[{"access_control_mode":"security_group","created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c","id":"4cf9171a-0043-4434-8727-15b53dbc374c","lifecycle_state":"stable","mount_path":"10.240.1.23:/nxg_s_voll_mz7121_58e7e963_8f4b_4a0c_b71a_8ba8d9cd1e2e","name":"my-share-mount-target","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"share_mount_target","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"},"transit_encryption":"none","virtual_network_interface":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","href":"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","id":"0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","name":"my-virtual-network-interface","resource_type":"virtual_network_interface"},"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"}}]}'
responses.add(
responses.GET,
url,
@@ -28295,30 +29062,30 @@ def test_list_floating_ips_with_pager_get_all(self):
)
# Exercise the pager class for this operation
- pager = FloatingIpsPager(
+ pager = ShareMountTargetsPager(
client=_service,
+ share_id='testString',
+ name='testString',
limit=10,
- resource_group_id='testString',
- sort='name',
)
all_results = pager.get_all()
assert all_results is not None
assert len(all_results) == 2
-class TestCreateFloatingIp:
+class TestCreateShareMountTarget:
"""
- Test Class for create_floating_ip
+ Test Class for create_share_mount_target
"""
@responses.activate
- def test_create_floating_ip_all_params(self):
+ def test_create_share_mount_target_all_params(self):
"""
- create_floating_ip()
+ create_share_mount_target()
"""
# Set up mock
- url = preprocess_url('/floating_ips')
- mock_response = '{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
+ url = preprocess_url('/shares/testString/mount_targets')
+ mock_response = '{"access_control_mode": "security_group", "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "lifecycle_state": "stable", "mount_path": "10.240.1.23:/nxg_s_voll_mz7121_58e7e963_8f4b_4a0c_b71a_8ba8d9cd1e2e", "name": "my-share-mount-target", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "share_mount_target", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "transit_encryption": "none", "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "id": "0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}'
responses.add(
responses.POST,
url,
@@ -28327,26 +29094,56 @@ def test_create_floating_ip_all_params(self):
status=201,
)
+ # Construct a dict representation of a VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext model
+ virtual_network_interface_ip_prototype_model = {}
+ virtual_network_interface_ip_prototype_model['address'] = '10.0.0.5'
+ virtual_network_interface_ip_prototype_model['auto_delete'] = False
+ virtual_network_interface_ip_prototype_model['name'] = 'my-reserved-ip'
+
+ # Construct a dict representation of a VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext model
+ virtual_network_interface_primary_ip_prototype_model = {}
+ virtual_network_interface_primary_ip_prototype_model['address'] = '10.0.0.5'
+ virtual_network_interface_primary_ip_prototype_model['auto_delete'] = False
+ virtual_network_interface_primary_ip_prototype_model['name'] = 'my-reserved-ip'
+
# Construct a dict representation of a ResourceGroupIdentityById model
resource_group_identity_model = {}
resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
- # Construct a dict representation of a ZoneIdentityByName model
- zone_identity_model = {}
- zone_identity_model['name'] = 'us-south-1'
+ # 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 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 SubnetIdentityById model
+ subnet_identity_model = {}
+ subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
+
+ # Construct a dict representation of a ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfacePrototypeShareMountTargetContext model
+ share_mount_target_virtual_network_interface_prototype_model = {}
+ share_mount_target_virtual_network_interface_prototype_model['allow_ip_spoofing'] = True
+ share_mount_target_virtual_network_interface_prototype_model['auto_delete'] = False
+ share_mount_target_virtual_network_interface_prototype_model['enable_infrastructure_nat'] = True
+ share_mount_target_virtual_network_interface_prototype_model['ips'] = [virtual_network_interface_ip_prototype_model]
+ share_mount_target_virtual_network_interface_prototype_model['name'] = 'my-virtual-network-interface'
+ share_mount_target_virtual_network_interface_prototype_model['primary_ip'] = virtual_network_interface_primary_ip_prototype_model
+ share_mount_target_virtual_network_interface_prototype_model['resource_group'] = resource_group_identity_model
+ share_mount_target_virtual_network_interface_prototype_model['security_groups'] = [security_group_identity_model]
+ share_mount_target_virtual_network_interface_prototype_model['subnet'] = subnet_identity_model
+
+ # Construct a dict representation of a ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup model
+ share_mount_target_prototype_model = {}
+ share_mount_target_prototype_model['name'] = 'my-share-mount-target'
+ share_mount_target_prototype_model['transit_encryption'] = 'none'
+ share_mount_target_prototype_model['virtual_network_interface'] = share_mount_target_virtual_network_interface_prototype_model
# Set up parameter values
- floating_ip_prototype = floating_ip_prototype_model
+ share_id = 'testString'
+ share_mount_target_prototype = share_mount_target_prototype_model
# Invoke method
- response = _service.create_floating_ip(
- floating_ip_prototype,
+ response = _service.create_share_mount_target(
+ share_id,
+ share_mount_target_prototype,
headers={},
)
@@ -28355,25 +29152,25 @@ 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 == share_mount_target_prototype
- def test_create_floating_ip_all_params_with_retries(self):
- # Enable retries and run test_create_floating_ip_all_params.
+ def test_create_share_mount_target_all_params_with_retries(self):
+ # Enable retries and run test_create_share_mount_target_all_params.
_service.enable_retries()
- self.test_create_floating_ip_all_params()
+ self.test_create_share_mount_target_all_params()
- # Disable retries and run test_create_floating_ip_all_params.
+ # Disable retries and run test_create_share_mount_target_all_params.
_service.disable_retries()
- self.test_create_floating_ip_all_params()
+ self.test_create_share_mount_target_all_params()
@responses.activate
- def test_create_floating_ip_value_error(self):
+ def test_create_share_mount_target_value_error(self):
"""
- test_create_floating_ip_value_error()
+ test_create_share_mount_target_value_error()
"""
# Set up mock
- url = preprocess_url('/floating_ips')
- mock_response = '{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
+ url = preprocess_url('/shares/testString/mount_targets')
+ mock_response = '{"access_control_mode": "security_group", "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "lifecycle_state": "stable", "mount_path": "10.240.1.23:/nxg_s_voll_mz7121_58e7e963_8f4b_4a0c_b71a_8ba8d9cd1e2e", "name": "my-share-mount-target", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "share_mount_target", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "transit_encryption": "none", "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "id": "0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}'
responses.add(
responses.POST,
url,
@@ -28382,130 +29179,170 @@ def test_create_floating_ip_value_error(self):
status=201,
)
+ # Construct a dict representation of a VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext model
+ virtual_network_interface_ip_prototype_model = {}
+ virtual_network_interface_ip_prototype_model['address'] = '10.0.0.5'
+ virtual_network_interface_ip_prototype_model['auto_delete'] = False
+ virtual_network_interface_ip_prototype_model['name'] = 'my-reserved-ip'
+
+ # Construct a dict representation of a VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext model
+ virtual_network_interface_primary_ip_prototype_model = {}
+ virtual_network_interface_primary_ip_prototype_model['address'] = '10.0.0.5'
+ virtual_network_interface_primary_ip_prototype_model['auto_delete'] = False
+ virtual_network_interface_primary_ip_prototype_model['name'] = 'my-reserved-ip'
+
# Construct a dict representation of a ResourceGroupIdentityById model
resource_group_identity_model = {}
resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
- # Construct a dict representation of a ZoneIdentityByName model
- zone_identity_model = {}
- zone_identity_model['name'] = 'us-south-1'
+ # 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 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 SubnetIdentityById model
+ subnet_identity_model = {}
+ subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
+
+ # Construct a dict representation of a ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfacePrototypeShareMountTargetContext model
+ share_mount_target_virtual_network_interface_prototype_model = {}
+ share_mount_target_virtual_network_interface_prototype_model['allow_ip_spoofing'] = True
+ share_mount_target_virtual_network_interface_prototype_model['auto_delete'] = False
+ share_mount_target_virtual_network_interface_prototype_model['enable_infrastructure_nat'] = True
+ share_mount_target_virtual_network_interface_prototype_model['ips'] = [virtual_network_interface_ip_prototype_model]
+ share_mount_target_virtual_network_interface_prototype_model['name'] = 'my-virtual-network-interface'
+ share_mount_target_virtual_network_interface_prototype_model['primary_ip'] = virtual_network_interface_primary_ip_prototype_model
+ share_mount_target_virtual_network_interface_prototype_model['resource_group'] = resource_group_identity_model
+ share_mount_target_virtual_network_interface_prototype_model['security_groups'] = [security_group_identity_model]
+ share_mount_target_virtual_network_interface_prototype_model['subnet'] = subnet_identity_model
+
+ # Construct a dict representation of a ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup model
+ share_mount_target_prototype_model = {}
+ share_mount_target_prototype_model['name'] = 'my-share-mount-target'
+ share_mount_target_prototype_model['transit_encryption'] = 'none'
+ share_mount_target_prototype_model['virtual_network_interface'] = share_mount_target_virtual_network_interface_prototype_model
# Set up parameter values
- floating_ip_prototype = floating_ip_prototype_model
+ share_id = 'testString'
+ share_mount_target_prototype = share_mount_target_prototype_model
# Pass in all but one required param and check for a ValueError
req_param_dict = {
- "floating_ip_prototype": floating_ip_prototype,
+ "share_id": share_id,
+ "share_mount_target_prototype": share_mount_target_prototype,
}
for param in req_param_dict.keys():
req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()}
with pytest.raises(ValueError):
- _service.create_floating_ip(**req_copy)
+ _service.create_share_mount_target(**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_share_mount_target_value_error_with_retries(self):
+ # Enable retries and run test_create_share_mount_target_value_error.
_service.enable_retries()
- self.test_create_floating_ip_value_error()
+ self.test_create_share_mount_target_value_error()
- # Disable retries and run test_create_floating_ip_value_error.
+ # Disable retries and run test_create_share_mount_target_value_error.
_service.disable_retries()
- self.test_create_floating_ip_value_error()
+ self.test_create_share_mount_target_value_error()
-class TestDeleteFloatingIp:
+class TestDeleteShareMountTarget:
"""
- Test Class for delete_floating_ip
+ Test Class for delete_share_mount_target
"""
@responses.activate
- def test_delete_floating_ip_all_params(self):
+ def test_delete_share_mount_target_all_params(self):
"""
- delete_floating_ip()
+ delete_share_mount_target()
"""
# Set up mock
- url = preprocess_url('/floating_ips/testString')
+ url = preprocess_url('/shares/testString/mount_targets/testString')
+ mock_response = '{"access_control_mode": "security_group", "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "lifecycle_state": "stable", "mount_path": "10.240.1.23:/nxg_s_voll_mz7121_58e7e963_8f4b_4a0c_b71a_8ba8d9cd1e2e", "name": "my-share-mount-target", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "share_mount_target", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "transit_encryption": "none", "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "id": "0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}'
responses.add(
responses.DELETE,
url,
- status=204,
+ body=mock_response,
+ content_type='application/json',
+ status=202,
)
# Set up parameter values
+ share_id = 'testString'
id = 'testString'
# Invoke method
- response = _service.delete_floating_ip(
+ response = _service.delete_share_mount_target(
+ share_id,
id,
headers={},
)
# Check for correct operation
assert len(responses.calls) == 1
- assert response.status_code == 204
+ assert response.status_code == 202
- def test_delete_floating_ip_all_params_with_retries(self):
- # Enable retries and run test_delete_floating_ip_all_params.
+ def test_delete_share_mount_target_all_params_with_retries(self):
+ # Enable retries and run test_delete_share_mount_target_all_params.
_service.enable_retries()
- self.test_delete_floating_ip_all_params()
+ self.test_delete_share_mount_target_all_params()
- # Disable retries and run test_delete_floating_ip_all_params.
+ # Disable retries and run test_delete_share_mount_target_all_params.
_service.disable_retries()
- self.test_delete_floating_ip_all_params()
+ self.test_delete_share_mount_target_all_params()
@responses.activate
- def test_delete_floating_ip_value_error(self):
+ def test_delete_share_mount_target_value_error(self):
"""
- test_delete_floating_ip_value_error()
+ test_delete_share_mount_target_value_error()
"""
# Set up mock
- url = preprocess_url('/floating_ips/testString')
+ url = preprocess_url('/shares/testString/mount_targets/testString')
+ mock_response = '{"access_control_mode": "security_group", "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "lifecycle_state": "stable", "mount_path": "10.240.1.23:/nxg_s_voll_mz7121_58e7e963_8f4b_4a0c_b71a_8ba8d9cd1e2e", "name": "my-share-mount-target", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "share_mount_target", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "transit_encryption": "none", "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "id": "0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}'
responses.add(
responses.DELETE,
url,
- status=204,
+ body=mock_response,
+ content_type='application/json',
+ status=202,
)
# Set up parameter values
+ share_id = 'testString'
id = 'testString'
# Pass in all but one required param and check for a ValueError
req_param_dict = {
+ "share_id": share_id,
"id": id,
}
for param in req_param_dict.keys():
req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()}
with pytest.raises(ValueError):
- _service.delete_floating_ip(**req_copy)
+ _service.delete_share_mount_target(**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_share_mount_target_value_error_with_retries(self):
+ # Enable retries and run test_delete_share_mount_target_value_error.
_service.enable_retries()
- self.test_delete_floating_ip_value_error()
+ self.test_delete_share_mount_target_value_error()
- # Disable retries and run test_delete_floating_ip_value_error.
+ # Disable retries and run test_delete_share_mount_target_value_error.
_service.disable_retries()
- self.test_delete_floating_ip_value_error()
+ self.test_delete_share_mount_target_value_error()
-class TestGetFloatingIp:
+class TestGetShareMountTarget:
"""
- Test Class for get_floating_ip
+ Test Class for get_share_mount_target
"""
@responses.activate
- def test_get_floating_ip_all_params(self):
+ def test_get_share_mount_target_all_params(self):
"""
- get_floating_ip()
+ get_share_mount_target()
"""
# 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-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
+ url = preprocess_url('/shares/testString/mount_targets/testString')
+ mock_response = '{"access_control_mode": "security_group", "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "lifecycle_state": "stable", "mount_path": "10.240.1.23:/nxg_s_voll_mz7121_58e7e963_8f4b_4a0c_b71a_8ba8d9cd1e2e", "name": "my-share-mount-target", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "share_mount_target", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "transit_encryption": "none", "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "id": "0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}'
responses.add(
responses.GET,
url,
@@ -28515,10 +29352,12 @@ def test_get_floating_ip_all_params(self):
)
# Set up parameter values
+ share_id = 'testString'
id = 'testString'
# Invoke method
- response = _service.get_floating_ip(
+ response = _service.get_share_mount_target(
+ share_id,
id,
headers={},
)
@@ -28527,23 +29366,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_share_mount_target_all_params_with_retries(self):
+ # Enable retries and run test_get_share_mount_target_all_params.
_service.enable_retries()
- self.test_get_floating_ip_all_params()
+ self.test_get_share_mount_target_all_params()
- # Disable retries and run test_get_floating_ip_all_params.
+ # Disable retries and run test_get_share_mount_target_all_params.
_service.disable_retries()
- self.test_get_floating_ip_all_params()
+ self.test_get_share_mount_target_all_params()
@responses.activate
- def test_get_floating_ip_value_error(self):
+ def test_get_share_mount_target_value_error(self):
"""
- test_get_floating_ip_value_error()
+ test_get_share_mount_target_value_error()
"""
# 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-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
+ url = preprocess_url('/shares/testString/mount_targets/testString')
+ mock_response = '{"access_control_mode": "security_group", "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "lifecycle_state": "stable", "mount_path": "10.240.1.23:/nxg_s_voll_mz7121_58e7e963_8f4b_4a0c_b71a_8ba8d9cd1e2e", "name": "my-share-mount-target", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "share_mount_target", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "transit_encryption": "none", "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "id": "0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}'
responses.add(
responses.GET,
url,
@@ -28553,40 +29392,42 @@ def test_get_floating_ip_value_error(self):
)
# Set up parameter values
+ share_id = 'testString'
id = 'testString'
# Pass in all but one required param and check for a ValueError
req_param_dict = {
+ "share_id": share_id,
"id": id,
}
for param in req_param_dict.keys():
req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()}
with pytest.raises(ValueError):
- _service.get_floating_ip(**req_copy)
+ _service.get_share_mount_target(**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_share_mount_target_value_error_with_retries(self):
+ # Enable retries and run test_get_share_mount_target_value_error.
_service.enable_retries()
- self.test_get_floating_ip_value_error()
+ self.test_get_share_mount_target_value_error()
- # Disable retries and run test_get_floating_ip_value_error.
+ # Disable retries and run test_get_share_mount_target_value_error.
_service.disable_retries()
- self.test_get_floating_ip_value_error()
+ self.test_get_share_mount_target_value_error()
-class TestUpdateFloatingIp:
+class TestUpdateShareMountTarget:
"""
- Test Class for update_floating_ip
+ Test Class for update_share_mount_target
"""
@responses.activate
- def test_update_floating_ip_all_params(self):
+ def test_update_share_mount_target_all_params(self):
"""
- update_floating_ip()
+ update_share_mount_target()
"""
# 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-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
+ url = preprocess_url('/shares/testString/mount_targets/testString')
+ mock_response = '{"access_control_mode": "security_group", "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "lifecycle_state": "stable", "mount_path": "10.240.1.23:/nxg_s_voll_mz7121_58e7e963_8f4b_4a0c_b71a_8ba8d9cd1e2e", "name": "my-share-mount-target", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "share_mount_target", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "transit_encryption": "none", "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "id": "0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}'
responses.add(
responses.PATCH,
url,
@@ -28595,23 +29436,20 @@ def test_update_floating_ip_all_params(self):
status=200,
)
- # Construct a dict representation of a FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityById 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
+ # Construct a dict representation of a ShareMountTargetPatch model
+ share_mount_target_patch_model = {}
+ share_mount_target_patch_model['name'] = 'my-share-mount-target'
# Set up parameter values
+ share_id = 'testString'
id = 'testString'
- floating_ip_patch = floating_ip_patch_model
+ share_mount_target_patch = share_mount_target_patch_model
# Invoke method
- response = _service.update_floating_ip(
+ response = _service.update_share_mount_target(
+ share_id,
id,
- floating_ip_patch,
+ share_mount_target_patch,
headers={},
)
@@ -28620,25 +29458,25 @@ 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 == share_mount_target_patch
- def test_update_floating_ip_all_params_with_retries(self):
- # Enable retries and run test_update_floating_ip_all_params.
+ def test_update_share_mount_target_all_params_with_retries(self):
+ # Enable retries and run test_update_share_mount_target_all_params.
_service.enable_retries()
- self.test_update_floating_ip_all_params()
+ self.test_update_share_mount_target_all_params()
- # Disable retries and run test_update_floating_ip_all_params.
+ # Disable retries and run test_update_share_mount_target_all_params.
_service.disable_retries()
- self.test_update_floating_ip_all_params()
+ self.test_update_share_mount_target_all_params()
@responses.activate
- def test_update_floating_ip_value_error(self):
+ def test_update_share_mount_target_value_error(self):
"""
- test_update_floating_ip_value_error()
+ test_update_share_mount_target_value_error()
"""
# 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-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
+ url = preprocess_url('/shares/testString/mount_targets/testString')
+ mock_response = '{"access_control_mode": "security_group", "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "lifecycle_state": "stable", "mount_path": "10.240.1.23:/nxg_s_voll_mz7121_58e7e963_8f4b_4a0c_b71a_8ba8d9cd1e2e", "name": "my-share-mount-target", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "share_mount_target", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "transit_encryption": "none", "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "id": "0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}'
responses.add(
responses.PATCH,
url,
@@ -28647,157 +29485,124 @@ def test_update_floating_ip_value_error(self):
status=200,
)
- # Construct a dict representation of a FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityById 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
+ # Construct a dict representation of a ShareMountTargetPatch model
+ share_mount_target_patch_model = {}
+ share_mount_target_patch_model['name'] = 'my-share-mount-target'
# Set up parameter values
+ share_id = 'testString'
id = 'testString'
- floating_ip_patch = floating_ip_patch_model
+ share_mount_target_patch = share_mount_target_patch_model
# Pass in all but one required param and check for a ValueError
req_param_dict = {
+ "share_id": share_id,
"id": id,
- "floating_ip_patch": floating_ip_patch,
+ "share_mount_target_patch": share_mount_target_patch,
}
for param in req_param_dict.keys():
req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()}
with pytest.raises(ValueError):
- _service.update_floating_ip(**req_copy)
+ _service.update_share_mount_target(**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_share_mount_target_value_error_with_retries(self):
+ # Enable retries and run test_update_share_mount_target_value_error.
_service.enable_retries()
- self.test_update_floating_ip_value_error()
+ self.test_update_share_mount_target_value_error()
- # Disable retries and run test_update_floating_ip_value_error.
+ # Disable retries and run test_update_share_mount_target_value_error.
_service.disable_retries()
- self.test_update_floating_ip_value_error()
+ self.test_update_share_mount_target_value_error()
-# endregion
-##############################################################################
-# End of Service: FloatingIPs
-##############################################################################
-
-##############################################################################
-# Start of Service: NetworkACLs
-##############################################################################
-# region
-
-
-class TestNewInstance:
+class TestDeleteShareSource:
"""
- Test Class for new_instance
+ Test Class for delete_share_source
"""
- def test_new_instance(self):
+ @responses.activate
+ def test_delete_share_source_all_params(self):
"""
- new_instance()
+ delete_share_source()
"""
- os.environ['TEST_SERVICE_AUTH_TYPE'] = 'noAuth'
-
- service = VpcV1.new_instance(
- version=version,
- service_name='TEST_SERVICE',
+ # Set up mock
+ url = preprocess_url('/shares/testString/source')
+ responses.add(
+ responses.DELETE,
+ url,
+ status=202,
)
- 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',
- )
+ # Set up parameter values
+ share_id = 'testString'
- 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()
+ # Invoke method
+ response = _service.delete_share_source(
+ share_id,
+ headers={},
+ )
- 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,
- )
+ # Check for correct operation
+ assert len(responses.calls) == 1
+ assert response.status_code == 202
+ def test_delete_share_source_all_params_with_retries(self):
+ # Enable retries and run test_delete_share_source_all_params.
+ _service.enable_retries()
+ self.test_delete_share_source_all_params()
-class TestListNetworkAcls:
- """
- Test Class for list_network_acls
- """
+ # Disable retries and run test_delete_share_source_all_params.
+ _service.disable_retries()
+ self.test_delete_share_source_all_params()
@responses.activate
- def test_list_network_acls_all_params(self):
+ def test_delete_share_source_value_error(self):
"""
- list_network_acls()
+ test_delete_share_source_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-1", "source": "192.168.3.0/24", "destination_port_max": 22, "destination_port_min": 22, "protocol": "udp", "source_port_max": 65535, "source_port_min": 49152}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}], "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}'
+ url = preprocess_url('/shares/testString/source')
responses.add(
- responses.GET,
+ responses.DELETE,
url,
- body=mock_response,
- content_type='application/json',
- status=200,
+ status=202,
)
# Set up parameter values
- start = 'testString'
- limit = 50
- resource_group_id = 'testString'
-
- # Invoke method
- response = _service.list_network_acls(
- start=start,
- limit=limit,
- resource_group_id=resource_group_id,
- headers={},
- )
+ share_id = 'testString'
- # 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
+ # Pass in all but one required param and check for a ValueError
+ req_param_dict = {
+ "share_id": share_id,
+ }
+ for param in req_param_dict.keys():
+ req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()}
+ with pytest.raises(ValueError):
+ _service.delete_share_source(**req_copy)
- def test_list_network_acls_all_params_with_retries(self):
- # Enable retries and run test_list_network_acls_all_params.
+ def test_delete_share_source_value_error_with_retries(self):
+ # Enable retries and run test_delete_share_source_value_error.
_service.enable_retries()
- self.test_list_network_acls_all_params()
+ self.test_delete_share_source_value_error()
- # Disable retries and run test_list_network_acls_all_params.
+ # Disable retries and run test_delete_share_source_value_error.
_service.disable_retries()
- self.test_list_network_acls_all_params()
+ self.test_delete_share_source_value_error()
+
+
+class TestGetShareSource:
+ """
+ Test Class for get_share_source
+ """
@responses.activate
- def test_list_network_acls_required_params(self):
+ def test_get_share_source_all_params(self):
"""
- test_list_network_acls_required_params()
+ get_share_source()
"""
# 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-1", "source": "192.168.3.0/24", "destination_port_max": 22, "destination_port_min": 22, "protocol": "udp", "source_port_max": 65535, "source_port_min": 49152}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}], "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}'
+ url = preprocess_url('/shares/testString/source')
+ mock_response = '{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}'
responses.add(
responses.GET,
url,
@@ -28806,30 +29611,36 @@ def test_list_network_acls_required_params(self):
status=200,
)
+ # Set up parameter values
+ share_id = 'testString'
+
# Invoke method
- response = _service.list_network_acls()
+ response = _service.get_share_source(
+ share_id,
+ headers={},
+ )
# 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_get_share_source_all_params_with_retries(self):
+ # Enable retries and run test_get_share_source_all_params.
_service.enable_retries()
- self.test_list_network_acls_required_params()
+ self.test_get_share_source_all_params()
- # Disable retries and run test_list_network_acls_required_params.
+ # Disable retries and run test_get_share_source_all_params.
_service.disable_retries()
- self.test_list_network_acls_required_params()
+ self.test_get_share_source_all_params()
@responses.activate
- def test_list_network_acls_value_error(self):
+ def test_get_share_source_value_error(self):
"""
- test_list_network_acls_value_error()
+ test_get_share_source_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-1", "source": "192.168.3.0/24", "destination_port_max": 22, "destination_port_min": 22, "protocol": "udp", "source_port_max": 65535, "source_port_min": 49152}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}], "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}'
+ url = preprocess_url('/shares/testString/source')
+ mock_response = '{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "share"}'
responses.add(
responses.GET,
url,
@@ -28838,325 +29649,250 @@ def test_list_network_acls_value_error(self):
status=200,
)
+ # Set up parameter values
+ share_id = 'testString'
+
# Pass in all but one required param and check for a ValueError
req_param_dict = {
+ "share_id": share_id,
}
for param in req_param_dict.keys():
req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()}
with pytest.raises(ValueError):
- _service.list_network_acls(**req_copy)
+ _service.get_share_source(**req_copy)
- def test_list_network_acls_value_error_with_retries(self):
- # Enable retries and run test_list_network_acls_value_error.
+ def test_get_share_source_value_error_with_retries(self):
+ # Enable retries and run test_get_share_source_value_error.
_service.enable_retries()
- self.test_list_network_acls_value_error()
+ self.test_get_share_source_value_error()
- # Disable retries and run test_list_network_acls_value_error.
+ # Disable retries and run test_get_share_source_value_error.
_service.disable_retries()
- self.test_list_network_acls_value_error()
+ self.test_get_share_source_value_error()
- @responses.activate
- def test_list_network_acls_with_pager_get_next(self):
+
+# endregion
+##############################################################################
+# End of Service: Shares
+##############################################################################
+
+##############################################################################
+# Start of Service: Geography
+##############################################################################
+# region
+
+
+class TestNewInstance:
+ """
+ Test Class for new_instance
+ """
+
+ def test_new_instance(self):
"""
- test_list_network_acls_with_pager_get_next()
+ new_instance()
"""
- # Set up a two-page mock response
- url = preprocess_url('/network_acls')
- mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"network_acls":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf","href":"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf","id":"a4e28308-8ee7-46ab-8108-9f881f22bdbf","name":"my-network-acl","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"rules":[{"action":"allow","before":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9","id":"8daca77a-4980-4d33-8f3e-7038797be8f9","name":"my-rule-1"},"created_at":"2019-01-01T12:00:00.000Z","destination":"192.168.3.0/24","direction":"inbound","href":"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9","id":"8daca77a-4980-4d33-8f3e-7038797be8f9","ip_version":"ipv4","name":"my-rule-1","source":"192.168.3.0/24","destination_port_max":22,"destination_port_min":22,"protocol":"udp","source_port_max":65535,"source_port_min":49152}],"subnets":[{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}],"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"}}],"total_count":2,"limit":1}'
- mock_response2 = '{"network_acls":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf","href":"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf","id":"a4e28308-8ee7-46ab-8108-9f881f22bdbf","name":"my-network-acl","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"rules":[{"action":"allow","before":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9","id":"8daca77a-4980-4d33-8f3e-7038797be8f9","name":"my-rule-1"},"created_at":"2019-01-01T12:00:00.000Z","destination":"192.168.3.0/24","direction":"inbound","href":"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9","id":"8daca77a-4980-4d33-8f3e-7038797be8f9","ip_version":"ipv4","name":"my-rule-1","source":"192.168.3.0/24","destination_port_max":22,"destination_port_min":22,"protocol":"udp","source_port_max":65535,"source_port_min":49152}],"subnets":[{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}],"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"}}],"total_count":2,"limit":1}'
- responses.add(
- responses.GET,
- url,
- body=mock_response1,
- content_type='application/json',
- status=200,
- )
- responses.add(
- responses.GET,
- url,
- body=mock_response2,
- content_type='application/json',
- status=200,
- )
+ os.environ['TEST_SERVICE_AUTH_TYPE'] = 'noAuth'
- # Exercise the pager class for this operation
- all_results = []
- pager = NetworkAclsPager(
- client=_service,
- limit=10,
- resource_group_id='testString',
+ service = VpcV1.new_instance(
+ version=version,
+ service_name='TEST_SERVICE',
)
- while pager.has_next():
- next_page = pager.get_next()
- assert next_page is not None
- all_results.extend(next_page)
- assert len(all_results) == 2
- @responses.activate
- def test_list_network_acls_with_pager_get_all(self):
+ assert service is not None
+ assert isinstance(service, VpcV1)
+
+ def test_new_instance_without_authenticator(self):
"""
- test_list_network_acls_with_pager_get_all()
+ new_instance_without_authenticator()
"""
- # Set up a two-page mock response
- url = preprocess_url('/network_acls')
- mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"network_acls":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf","href":"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf","id":"a4e28308-8ee7-46ab-8108-9f881f22bdbf","name":"my-network-acl","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"rules":[{"action":"allow","before":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9","id":"8daca77a-4980-4d33-8f3e-7038797be8f9","name":"my-rule-1"},"created_at":"2019-01-01T12:00:00.000Z","destination":"192.168.3.0/24","direction":"inbound","href":"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9","id":"8daca77a-4980-4d33-8f3e-7038797be8f9","ip_version":"ipv4","name":"my-rule-1","source":"192.168.3.0/24","destination_port_max":22,"destination_port_min":22,"protocol":"udp","source_port_max":65535,"source_port_min":49152}],"subnets":[{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}],"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"}}],"total_count":2,"limit":1}'
- mock_response2 = '{"network_acls":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf","href":"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf","id":"a4e28308-8ee7-46ab-8108-9f881f22bdbf","name":"my-network-acl","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"rules":[{"action":"allow","before":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9","id":"8daca77a-4980-4d33-8f3e-7038797be8f9","name":"my-rule-1"},"created_at":"2019-01-01T12:00:00.000Z","destination":"192.168.3.0/24","direction":"inbound","href":"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9","id":"8daca77a-4980-4d33-8f3e-7038797be8f9","ip_version":"ipv4","name":"my-rule-1","source":"192.168.3.0/24","destination_port_max":22,"destination_port_min":22,"protocol":"udp","source_port_max":65535,"source_port_min":49152}],"subnets":[{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}],"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"}}],"total_count":2,"limit":1}'
- responses.add(
- responses.GET,
- url,
- body=mock_response1,
- content_type='application/json',
- status=200,
- )
- responses.add(
- responses.GET,
- url,
- body=mock_response2,
- content_type='application/json',
- status=200,
- )
+ with pytest.raises(ValueError, match='authenticator must be provided'):
+ service = VpcV1.new_instance(
+ version=version,
+ service_name='TEST_SERVICE_NOT_FOUND',
+ )
- # Exercise the pager class for this operation
- pager = NetworkAclsPager(
- client=_service,
- limit=10,
- resource_group_id='testString',
- )
- all_results = pager.get_all()
- assert all_results is not None
- assert len(all_results) == 2
+ 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 TestCreateNetworkAcl:
+class TestListRegions:
"""
- Test Class for create_network_acl
+ Test Class for list_regions
"""
@responses.activate
- def test_create_network_acl_all_params(self):
+ def test_list_regions_all_params(self):
"""
- create_network_acl()
+ list_regions()
"""
# 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-1", "source": "192.168.3.0/24", "destination_port_max": 22, "destination_port_min": 22, "protocol": "udp", "source_port_max": 65535, "source_port_min": 49152}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}'
+ 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.POST,
+ 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'
-
- # 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 NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype model
- network_acl_rule_prototype_network_acl_context_model = {}
- network_acl_rule_prototype_network_acl_context_model['action'] = 'allow'
- network_acl_rule_prototype_network_acl_context_model['destination'] = '192.168.3.2/32'
- network_acl_rule_prototype_network_acl_context_model['direction'] = 'inbound'
- 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['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
-
# Invoke method
- response = _service.create_network_acl(
- network_acl_prototype,
- headers={},
- )
+ response = _service.list_regions()
# 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_prototype
+ assert response.status_code == 200
- def test_create_network_acl_all_params_with_retries(self):
- # Enable retries and run test_create_network_acl_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_create_network_acl_all_params()
+ self.test_list_regions_all_params()
- # Disable retries and run test_create_network_acl_all_params.
+ # Disable retries and run test_list_regions_all_params.
_service.disable_retries()
- self.test_create_network_acl_all_params()
+ self.test_list_regions_all_params()
@responses.activate
- def test_create_network_acl_value_error(self):
+ def test_list_regions_value_error(self):
"""
- test_create_network_acl_value_error()
+ test_list_regions_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-1", "source": "192.168.3.0/24", "destination_port_max": 22, "destination_port_min": 22, "protocol": "udp", "source_port_max": 65535, "source_port_min": 49152}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}'
+ 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.POST,
+ 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'
-
- # 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 NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype model
- network_acl_rule_prototype_network_acl_context_model = {}
- network_acl_rule_prototype_network_acl_context_model['action'] = 'allow'
- network_acl_rule_prototype_network_acl_context_model['destination'] = '192.168.3.2/32'
- network_acl_rule_prototype_network_acl_context_model['direction'] = 'inbound'
- 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['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
-
# Pass in all but one required param and check for a ValueError
req_param_dict = {
- "network_acl_prototype": network_acl_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(**req_copy)
+ _service.list_regions(**req_copy)
- def test_create_network_acl_value_error_with_retries(self):
- # Enable retries and run test_create_network_acl_value_error.
+ def test_list_regions_value_error_with_retries(self):
+ # Enable retries and run test_list_regions_value_error.
_service.enable_retries()
- self.test_create_network_acl_value_error()
+ self.test_list_regions_value_error()
- # Disable retries and run test_create_network_acl_value_error.
+ # Disable retries and run test_list_regions_value_error.
_service.disable_retries()
- self.test_create_network_acl_value_error()
+ self.test_list_regions_value_error()
-class TestDeleteNetworkAcl:
+class TestGetRegion:
"""
- Test Class for delete_network_acl
+ Test Class for get_region
"""
@responses.activate
- def test_delete_network_acl_all_params(self):
+ def test_get_region_all_params(self):
"""
- delete_network_acl()
+ get_region()
"""
# Set up mock
- url = preprocess_url('/network_acls/testString')
+ 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.DELETE,
+ responses.GET,
url,
- status=204,
+ body=mock_response,
+ content_type='application/json',
+ status=200,
)
# Set up parameter values
- id = 'testString'
+ name = 'testString'
# Invoke method
- response = _service.delete_network_acl(
- id,
+ response = _service.get_region(
+ name,
headers={},
)
# Check for correct operation
assert len(responses.calls) == 1
- assert response.status_code == 204
+ assert response.status_code == 200
- def test_delete_network_acl_all_params_with_retries(self):
- # Enable retries and run test_delete_network_acl_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_delete_network_acl_all_params()
+ self.test_get_region_all_params()
- # Disable retries and run test_delete_network_acl_all_params.
+ # Disable retries and run test_get_region_all_params.
_service.disable_retries()
- self.test_delete_network_acl_all_params()
+ self.test_get_region_all_params()
@responses.activate
- def test_delete_network_acl_value_error(self):
+ def test_get_region_value_error(self):
"""
- test_delete_network_acl_value_error()
+ test_get_region_value_error()
"""
# Set up mock
- url = preprocess_url('/network_acls/testString')
+ 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.DELETE,
+ responses.GET,
url,
- status=204,
+ body=mock_response,
+ content_type='application/json',
+ status=200,
)
# Set up parameter values
- id = 'testString'
+ name = 'testString'
# Pass in all but one required param and check for a ValueError
req_param_dict = {
- "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(**req_copy)
+ _service.get_region(**req_copy)
- def test_delete_network_acl_value_error_with_retries(self):
- # Enable retries and run test_delete_network_acl_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_value_error()
+ self.test_get_region_value_error()
- # Disable retries and run test_delete_network_acl_value_error.
+ # Disable retries and run test_get_region_value_error.
_service.disable_retries()
- self.test_delete_network_acl_value_error()
+ self.test_get_region_value_error()
-class TestGetNetworkAcl:
+class TestListRegionZones:
"""
- Test Class for get_network_acl
+ Test Class for list_region_zones
"""
@responses.activate
- def test_get_network_acl_all_params(self):
+ def test_list_region_zones_all_params(self):
"""
- get_network_acl()
+ list_region_zones()
"""
# Set up mock
- url = preprocess_url('/network_acls/testString')
- mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-1", "source": "192.168.3.0/24", "destination_port_max": 22, "destination_port_min": 22, "protocol": "udp", "source_port_max": 65535, "source_port_min": 49152}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}'
+ 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,
@@ -29166,11 +29902,11 @@ def test_get_network_acl_all_params(self):
)
# Set up parameter values
- id = 'testString'
+ region_name = 'testString'
# Invoke method
- response = _service.get_network_acl(
- id,
+ response = _service.list_region_zones(
+ region_name,
headers={},
)
@@ -29178,23 +29914,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_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_all_params()
+ self.test_list_region_zones_all_params()
- # Disable retries and run test_get_network_acl_all_params.
+ # Disable retries and run test_list_region_zones_all_params.
_service.disable_retries()
- self.test_get_network_acl_all_params()
+ self.test_list_region_zones_all_params()
@responses.activate
- def test_get_network_acl_value_error(self):
+ def test_list_region_zones_value_error(self):
"""
- test_get_network_acl_value_error()
+ test_list_region_zones_value_error()
"""
# Set up mock
- url = preprocess_url('/network_acls/testString')
- mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-1", "source": "192.168.3.0/24", "destination_port_max": 22, "destination_port_min": 22, "protocol": "udp", "source_port_max": 65535, "source_port_min": 49152}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}'
+ 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,
@@ -29204,136 +29940,182 @@ def test_get_network_acl_value_error(self):
)
# Set up parameter values
- id = 'testString'
+ region_name = 'testString'
# Pass in all but one required param and check for a ValueError
req_param_dict = {
- "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(**req_copy)
+ _service.list_region_zones(**req_copy)
- def test_get_network_acl_value_error_with_retries(self):
- # Enable retries and run test_get_network_acl_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_value_error()
+ self.test_list_region_zones_value_error()
- # Disable retries and run test_get_network_acl_value_error.
+ # Disable retries and run test_list_region_zones_value_error.
_service.disable_retries()
- self.test_get_network_acl_value_error()
+ self.test_list_region_zones_value_error()
-class TestUpdateNetworkAcl:
+class TestGetRegionZone:
"""
- Test Class for update_network_acl
+ Test Class for get_region_zone
"""
@responses.activate
- def test_update_network_acl_all_params(self):
+ def test_get_region_zone_all_params(self):
"""
- update_network_acl()
+ get_region_zone()
"""
# Set up mock
- url = preprocess_url('/network_acls/testString')
- mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-1", "source": "192.168.3.0/24", "destination_port_max": 22, "destination_port_min": 22, "protocol": "udp", "source_port_max": 65535, "source_port_min": 49152}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}'
+ 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.PATCH,
+ responses.GET,
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'
-
# Set up parameter values
- id = 'testString'
- network_acl_patch = network_acl_patch_model
+ region_name = 'testString'
+ name = 'testString'
# Invoke method
- response = _service.update_network_acl(
- id,
- network_acl_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_patch
- def test_update_network_acl_all_params_with_retries(self):
- # Enable retries and run test_update_network_acl_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_all_params()
+ self.test_get_region_zone_all_params()
- # Disable retries and run test_update_network_acl_all_params.
+ # Disable retries and run test_get_region_zone_all_params.
_service.disable_retries()
- self.test_update_network_acl_all_params()
+ self.test_get_region_zone_all_params()
@responses.activate
- def test_update_network_acl_value_error(self):
+ def test_get_region_zone_value_error(self):
"""
- test_update_network_acl_value_error()
+ test_get_region_zone_value_error()
"""
# Set up mock
- url = preprocess_url('/network_acls/testString')
- mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-1", "source": "192.168.3.0/24", "destination_port_max": 22, "destination_port_min": 22, "protocol": "udp", "source_port_max": 65535, "source_port_min": 49152}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}'
+ 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.PATCH,
+ responses.GET,
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'
-
# Set up parameter values
- id = 'testString'
- network_acl_patch = network_acl_patch_model
+ region_name = 'testString'
+ name = 'testString'
# Pass in all but one required param and check for a ValueError
req_param_dict = {
- "id": id,
- "network_acl_patch": network_acl_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(**req_copy)
+ _service.get_region_zone(**req_copy)
- def test_update_network_acl_value_error_with_retries(self):
- # Enable retries and run test_update_network_acl_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_value_error()
+ self.test_get_region_zone_value_error()
- # Disable retries and run test_update_network_acl_value_error.
+ # Disable retries and run test_get_region_zone_value_error.
_service.disable_retries()
- self.test_update_network_acl_value_error()
+ self.test_get_region_zone_value_error()
-class TestListNetworkAclRules:
+# endregion
+##############################################################################
+# End of Service: Geography
+##############################################################################
+
+##############################################################################
+# Start of Service: VirtualNetworkInterfaces
+##############################################################################
+# region
+
+
+class TestNewInstance:
"""
- Test Class for list_network_acl_rules
+ 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 TestListVirtualNetworkInterfaces:
+ """
+ Test Class for list_virtual_network_interfaces
"""
@responses.activate
- def test_list_network_acl_rules_all_params(self):
+ def test_list_virtual_network_interfaces_all_params(self):
"""
- list_network_acl_rules()
+ list_virtual_network_interfaces()
"""
# Set up mock
- url = preprocess_url('/network_acls/testString/rules')
- mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "rules": [{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-1", "source": "192.168.3.0/24", "destination_port_max": 22, "destination_port_min": 22, "protocol": "udp", "source_port_max": 65535, "source_port_min": 49152}], "total_count": 132}'
+ url = preprocess_url('/virtual_network_interfaces')
+ mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces?start=d3e721fd-c988-4670-9927-dbd5e7b07fc6&limit=20"}, "total_count": 132, "virtual_network_interfaces": [{"allow_ip_spoofing": true, "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "enable_infrastructure_nat": true, "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "id": "0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "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", "mac_address": "02:00:4D:45:45:4D", "name": "my-virtual-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "virtual_network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "name": "my-share-mount-target", "resource_type": "share_mount_target"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}]}'
responses.add(
responses.GET,
url,
@@ -29343,17 +30125,15 @@ def test_list_network_acl_rules_all_params(self):
)
# Set up parameter values
- network_acl_id = 'testString'
start = 'testString'
limit = 50
- direction = 'inbound'
+ resource_group_id = 'testString'
# Invoke method
- response = _service.list_network_acl_rules(
- network_acl_id,
+ response = _service.list_virtual_network_interfaces(
start=start,
limit=limit,
- direction=direction,
+ resource_group_id=resource_group_id,
headers={},
)
@@ -29365,25 +30145,25 @@ def test_list_network_acl_rules_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
+ assert 'resource_group.id={}'.format(resource_group_id) 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_virtual_network_interfaces_all_params_with_retries(self):
+ # Enable retries and run test_list_virtual_network_interfaces_all_params.
_service.enable_retries()
- self.test_list_network_acl_rules_all_params()
+ self.test_list_virtual_network_interfaces_all_params()
- # Disable retries and run test_list_network_acl_rules_all_params.
+ # Disable retries and run test_list_virtual_network_interfaces_all_params.
_service.disable_retries()
- self.test_list_network_acl_rules_all_params()
+ self.test_list_virtual_network_interfaces_all_params()
@responses.activate
- def test_list_network_acl_rules_required_params(self):
+ def test_list_virtual_network_interfaces_required_params(self):
"""
- test_list_network_acl_rules_required_params()
+ test_list_virtual_network_interfaces_required_params()
"""
# Set up mock
- url = preprocess_url('/network_acls/testString/rules')
- mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "rules": [{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-1", "source": "192.168.3.0/24", "destination_port_max": 22, "destination_port_min": 22, "protocol": "udp", "source_port_max": 65535, "source_port_min": 49152}], "total_count": 132}'
+ url = preprocess_url('/virtual_network_interfaces')
+ mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces?start=d3e721fd-c988-4670-9927-dbd5e7b07fc6&limit=20"}, "total_count": 132, "virtual_network_interfaces": [{"allow_ip_spoofing": true, "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "enable_infrastructure_nat": true, "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "id": "0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "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", "mac_address": "02:00:4D:45:45:4D", "name": "my-virtual-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "virtual_network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "name": "my-share-mount-target", "resource_type": "share_mount_target"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}]}'
responses.add(
responses.GET,
url,
@@ -29392,36 +30172,30 @@ def test_list_network_acl_rules_required_params(self):
status=200,
)
- # Set up parameter values
- network_acl_id = 'testString'
-
# Invoke method
- response = _service.list_network_acl_rules(
- network_acl_id,
- headers={},
- )
+ response = _service.list_virtual_network_interfaces()
# 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_virtual_network_interfaces_required_params_with_retries(self):
+ # Enable retries and run test_list_virtual_network_interfaces_required_params.
_service.enable_retries()
- self.test_list_network_acl_rules_required_params()
+ self.test_list_virtual_network_interfaces_required_params()
- # Disable retries and run test_list_network_acl_rules_required_params.
+ # Disable retries and run test_list_virtual_network_interfaces_required_params.
_service.disable_retries()
- self.test_list_network_acl_rules_required_params()
+ self.test_list_virtual_network_interfaces_required_params()
@responses.activate
- def test_list_network_acl_rules_value_error(self):
+ def test_list_virtual_network_interfaces_value_error(self):
"""
- test_list_network_acl_rules_value_error()
+ test_list_virtual_network_interfaces_value_error()
"""
# Set up mock
- url = preprocess_url('/network_acls/testString/rules')
- mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "rules": [{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-1", "source": "192.168.3.0/24", "destination_port_max": 22, "destination_port_min": 22, "protocol": "udp", "source_port_max": 65535, "source_port_min": 49152}], "total_count": 132}'
+ url = preprocess_url('/virtual_network_interfaces')
+ mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces?start=d3e721fd-c988-4670-9927-dbd5e7b07fc6&limit=20"}, "total_count": 132, "virtual_network_interfaces": [{"allow_ip_spoofing": true, "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "enable_infrastructure_nat": true, "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "id": "0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "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", "mac_address": "02:00:4D:45:45:4D", "name": "my-virtual-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "virtual_network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "name": "my-share-mount-target", "resource_type": "share_mount_target"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}]}'
responses.add(
responses.GET,
url,
@@ -29430,36 +30204,32 @@ 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)
+ _service.list_virtual_network_interfaces(**req_copy)
- def test_list_network_acl_rules_value_error_with_retries(self):
- # Enable retries and run test_list_network_acl_rules_value_error.
+ def test_list_virtual_network_interfaces_value_error_with_retries(self):
+ # Enable retries and run test_list_virtual_network_interfaces_value_error.
_service.enable_retries()
- self.test_list_network_acl_rules_value_error()
+ self.test_list_virtual_network_interfaces_value_error()
- # Disable retries and run test_list_network_acl_rules_value_error.
+ # Disable retries and run test_list_virtual_network_interfaces_value_error.
_service.disable_retries()
- self.test_list_network_acl_rules_value_error()
+ self.test_list_virtual_network_interfaces_value_error()
@responses.activate
- def test_list_network_acl_rules_with_pager_get_next(self):
+ def test_list_virtual_network_interfaces_with_pager_get_next(self):
"""
- test_list_network_acl_rules_with_pager_get_next()
+ test_list_virtual_network_interfaces_with_pager_get_next()
"""
# Set up a two-page mock response
- url = preprocess_url('/network_acls/testString/rules')
- mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"rules":[{"action":"allow","before":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9","id":"8daca77a-4980-4d33-8f3e-7038797be8f9","name":"my-rule-1"},"created_at":"2019-01-01T12:00:00.000Z","destination":"192.168.3.0/24","direction":"inbound","href":"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9","id":"8daca77a-4980-4d33-8f3e-7038797be8f9","ip_version":"ipv4","name":"my-rule-1","source":"192.168.3.0/24","destination_port_max":22,"destination_port_min":22,"protocol":"udp","source_port_max":65535,"source_port_min":49152}]}'
- mock_response2 = '{"total_count":2,"limit":1,"rules":[{"action":"allow","before":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9","id":"8daca77a-4980-4d33-8f3e-7038797be8f9","name":"my-rule-1"},"created_at":"2019-01-01T12:00:00.000Z","destination":"192.168.3.0/24","direction":"inbound","href":"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9","id":"8daca77a-4980-4d33-8f3e-7038797be8f9","ip_version":"ipv4","name":"my-rule-1","source":"192.168.3.0/24","destination_port_max":22,"destination_port_min":22,"protocol":"udp","source_port_max":65535,"source_port_min":49152}]}'
+ url = preprocess_url('/virtual_network_interfaces')
+ mock_response1 = '{"virtual_network_interfaces":[{"allow_ip_spoofing":true,"auto_delete":false,"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","enable_infrastructure_nat":true,"href":"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","id":"0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","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","mac_address":"02:00:4D:45:45:4D","name":"my-virtual-network-interface","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"virtual_network_interface","security_groups":[{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271","id":"be5df5ca-12a0-494b-907e-aa6ec2bfa271","name":"my-security-group"}],"subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"},"target":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c","id":"4cf9171a-0043-4434-8727-15b53dbc374c","name":"my-share-mount-target","resource_type":"share_mount_target"},"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1}'
+ mock_response2 = '{"virtual_network_interfaces":[{"allow_ip_spoofing":true,"auto_delete":false,"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","enable_infrastructure_nat":true,"href":"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","id":"0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","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","mac_address":"02:00:4D:45:45:4D","name":"my-virtual-network-interface","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"virtual_network_interface","security_groups":[{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271","id":"be5df5ca-12a0-494b-907e-aa6ec2bfa271","name":"my-security-group"}],"subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"},"target":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c","id":"4cf9171a-0043-4434-8727-15b53dbc374c","name":"my-share-mount-target","resource_type":"share_mount_target"},"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"total_count":2,"limit":1}'
responses.add(
responses.GET,
url,
@@ -29477,11 +30247,10 @@ def test_list_network_acl_rules_with_pager_get_next(self):
# Exercise the pager class for this operation
all_results = []
- pager = NetworkAclRulesPager(
+ pager = VirtualNetworkInterfacesPager(
client=_service,
- network_acl_id='testString',
limit=10,
- direction='inbound',
+ resource_group_id='testString',
)
while pager.has_next():
next_page = pager.get_next()
@@ -29490,14 +30259,14 @@ def test_list_network_acl_rules_with_pager_get_next(self):
assert len(all_results) == 2
@responses.activate
- def test_list_network_acl_rules_with_pager_get_all(self):
+ def test_list_virtual_network_interfaces_with_pager_get_all(self):
"""
- test_list_network_acl_rules_with_pager_get_all()
+ test_list_virtual_network_interfaces_with_pager_get_all()
"""
# Set up a two-page mock response
- url = preprocess_url('/network_acls/testString/rules')
- mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"rules":[{"action":"allow","before":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9","id":"8daca77a-4980-4d33-8f3e-7038797be8f9","name":"my-rule-1"},"created_at":"2019-01-01T12:00:00.000Z","destination":"192.168.3.0/24","direction":"inbound","href":"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9","id":"8daca77a-4980-4d33-8f3e-7038797be8f9","ip_version":"ipv4","name":"my-rule-1","source":"192.168.3.0/24","destination_port_max":22,"destination_port_min":22,"protocol":"udp","source_port_max":65535,"source_port_min":49152}]}'
- mock_response2 = '{"total_count":2,"limit":1,"rules":[{"action":"allow","before":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9","id":"8daca77a-4980-4d33-8f3e-7038797be8f9","name":"my-rule-1"},"created_at":"2019-01-01T12:00:00.000Z","destination":"192.168.3.0/24","direction":"inbound","href":"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9","id":"8daca77a-4980-4d33-8f3e-7038797be8f9","ip_version":"ipv4","name":"my-rule-1","source":"192.168.3.0/24","destination_port_max":22,"destination_port_min":22,"protocol":"udp","source_port_max":65535,"source_port_min":49152}]}'
+ url = preprocess_url('/virtual_network_interfaces')
+ mock_response1 = '{"virtual_network_interfaces":[{"allow_ip_spoofing":true,"auto_delete":false,"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","enable_infrastructure_nat":true,"href":"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","id":"0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","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","mac_address":"02:00:4D:45:45:4D","name":"my-virtual-network-interface","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"virtual_network_interface","security_groups":[{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271","id":"be5df5ca-12a0-494b-907e-aa6ec2bfa271","name":"my-security-group"}],"subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"},"target":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c","id":"4cf9171a-0043-4434-8727-15b53dbc374c","name":"my-share-mount-target","resource_type":"share_mount_target"},"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1}'
+ mock_response2 = '{"virtual_network_interfaces":[{"allow_ip_spoofing":true,"auto_delete":false,"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","enable_infrastructure_nat":true,"href":"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","id":"0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","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","mac_address":"02:00:4D:45:45:4D","name":"my-virtual-network-interface","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"virtual_network_interface","security_groups":[{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271","id":"be5df5ca-12a0-494b-907e-aa6ec2bfa271","name":"my-security-group"}],"subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"},"target":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c","id":"4cf9171a-0043-4434-8727-15b53dbc374c","name":"my-share-mount-target","resource_type":"share_mount_target"},"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"total_count":2,"limit":1}'
responses.add(
responses.GET,
url,
@@ -29514,30 +30283,29 @@ def test_list_network_acl_rules_with_pager_get_all(self):
)
# Exercise the pager class for this operation
- pager = NetworkAclRulesPager(
+ pager = VirtualNetworkInterfacesPager(
client=_service,
- network_acl_id='testString',
limit=10,
- direction='inbound',
+ resource_group_id='testString',
)
all_results = pager.get_all()
assert all_results is not None
assert len(all_results) == 2
-class TestCreateNetworkAclRule:
+class TestCreateVirtualNetworkInterface:
"""
- Test Class for create_network_acl_rule
+ Test Class for create_virtual_network_interface
"""
@responses.activate
- def test_create_network_acl_rule_all_params(self):
+ def test_create_virtual_network_interface_all_params(self):
"""
- create_network_acl_rule()
+ create_virtual_network_interface()
"""
# 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-1", "source": "192.168.3.0/24", "destination_port_max": 22, "destination_port_min": 22, "protocol": "udp", "source_port_max": 65535, "source_port_min": 49152}'
+ url = preprocess_url('/virtual_network_interfaces')
+ mock_response = '{"allow_ip_spoofing": true, "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "enable_infrastructure_nat": true, "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "id": "0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "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", "mac_address": "02:00:4D:45:45:4D", "name": "my-virtual-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "virtual_network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "name": "my-share-mount-target", "resource_type": "share_mount_target"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
responses.add(
responses.POST,
url,
@@ -29546,33 +30314,52 @@ def test_create_network_acl_rule_all_params(self):
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 VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext model
+ virtual_network_interface_ip_prototype_model = {}
+ virtual_network_interface_ip_prototype_model['address'] = '10.0.0.5'
+ virtual_network_interface_ip_prototype_model['auto_delete'] = False
+ virtual_network_interface_ip_prototype_model['name'] = 'my-reserved-ip'
- # Construct a dict representation of a NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype model
- network_acl_rule_prototype_model = {}
- network_acl_rule_prototype_model['action'] = 'allow'
- network_acl_rule_prototype_model['before'] = network_acl_rule_before_prototype_model
- network_acl_rule_prototype_model['destination'] = '192.168.3.2/32'
- network_acl_rule_prototype_model['direction'] = 'inbound'
- network_acl_rule_prototype_model['ip_version'] = 'ipv4'
- 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['destination_port_max'] = 22
- network_acl_rule_prototype_model['destination_port_min'] = 22
- network_acl_rule_prototype_model['protocol'] = 'udp'
- network_acl_rule_prototype_model['source_port_max'] = 65535
- network_acl_rule_prototype_model['source_port_min'] = 49152
+ # Construct a dict representation of a VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext model
+ virtual_network_interface_primary_ip_prototype_model = {}
+ virtual_network_interface_primary_ip_prototype_model['address'] = '10.0.0.5'
+ virtual_network_interface_primary_ip_prototype_model['auto_delete'] = False
+ virtual_network_interface_primary_ip_prototype_model['name'] = 'my-reserved-ip'
+
+ # Construct a dict representation of a ResourceGroupIdentityById model
+ resource_group_identity_model = {}
+ resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
+
+ # Construct a dict representation of a SecurityGroupIdentityById model
+ security_group_identity_model = {}
+ security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271'
+
+ # Construct a dict representation of a SubnetIdentityById model
+ subnet_identity_model = {}
+ subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
# Set up parameter values
- network_acl_id = 'testString'
- network_acl_rule_prototype = network_acl_rule_prototype_model
+ allow_ip_spoofing = True
+ auto_delete = False
+ enable_infrastructure_nat = True
+ ips = [virtual_network_interface_ip_prototype_model]
+ name = 'my-virtual-network-interface'
+ primary_ip = virtual_network_interface_primary_ip_prototype_model
+ resource_group = resource_group_identity_model
+ security_groups = [security_group_identity_model]
+ subnet = subnet_identity_model
# Invoke method
- response = _service.create_network_acl_rule(
- network_acl_id,
- network_acl_rule_prototype,
+ response = _service.create_virtual_network_interface(
+ allow_ip_spoofing=allow_ip_spoofing,
+ auto_delete=auto_delete,
+ enable_infrastructure_nat=enable_infrastructure_nat,
+ ips=ips,
+ name=name,
+ primary_ip=primary_ip,
+ resource_group=resource_group,
+ security_groups=security_groups,
+ subnet=subnet,
headers={},
)
@@ -29581,25 +30368,33 @@ def test_create_network_acl_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 == network_acl_rule_prototype
+ assert req_body['allow_ip_spoofing'] == True
+ assert req_body['auto_delete'] == False
+ assert req_body['enable_infrastructure_nat'] == True
+ assert req_body['ips'] == [virtual_network_interface_ip_prototype_model]
+ assert req_body['name'] == 'my-virtual-network-interface'
+ assert req_body['primary_ip'] == virtual_network_interface_primary_ip_prototype_model
+ assert req_body['resource_group'] == resource_group_identity_model
+ assert req_body['security_groups'] == [security_group_identity_model]
+ assert req_body['subnet'] == subnet_identity_model
- def test_create_network_acl_rule_all_params_with_retries(self):
- # Enable retries and run test_create_network_acl_rule_all_params.
+ def test_create_virtual_network_interface_all_params_with_retries(self):
+ # Enable retries and run test_create_virtual_network_interface_all_params.
_service.enable_retries()
- self.test_create_network_acl_rule_all_params()
+ self.test_create_virtual_network_interface_all_params()
- # Disable retries and run test_create_network_acl_rule_all_params.
+ # Disable retries and run test_create_virtual_network_interface_all_params.
_service.disable_retries()
- self.test_create_network_acl_rule_all_params()
+ self.test_create_virtual_network_interface_all_params()
@responses.activate
- def test_create_network_acl_rule_value_error(self):
+ def test_create_virtual_network_interface_value_error(self):
"""
- test_create_network_acl_rule_value_error()
+ test_create_virtual_network_interface_value_error()
"""
# 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-1", "source": "192.168.3.0/24", "destination_port_max": 22, "destination_port_min": 22, "protocol": "udp", "source_port_max": 65535, "source_port_min": 49152}'
+ url = preprocess_url('/virtual_network_interfaces')
+ mock_response = '{"allow_ip_spoofing": true, "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "enable_infrastructure_nat": true, "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "id": "0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "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", "mac_address": "02:00:4D:45:45:4D", "name": "my-virtual-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "virtual_network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "name": "my-share-mount-target", "resource_type": "share_mount_target"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
responses.add(
responses.POST,
url,
@@ -29608,141 +30403,147 @@ def test_create_network_acl_rule_value_error(self):
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 VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext model
+ virtual_network_interface_ip_prototype_model = {}
+ virtual_network_interface_ip_prototype_model['address'] = '10.0.0.5'
+ virtual_network_interface_ip_prototype_model['auto_delete'] = False
+ virtual_network_interface_ip_prototype_model['name'] = 'my-reserved-ip'
- # Construct a dict representation of a NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype model
- network_acl_rule_prototype_model = {}
- network_acl_rule_prototype_model['action'] = 'allow'
- network_acl_rule_prototype_model['before'] = network_acl_rule_before_prototype_model
- network_acl_rule_prototype_model['destination'] = '192.168.3.2/32'
- network_acl_rule_prototype_model['direction'] = 'inbound'
- network_acl_rule_prototype_model['ip_version'] = 'ipv4'
- 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['destination_port_max'] = 22
- network_acl_rule_prototype_model['destination_port_min'] = 22
- network_acl_rule_prototype_model['protocol'] = 'udp'
- network_acl_rule_prototype_model['source_port_max'] = 65535
- network_acl_rule_prototype_model['source_port_min'] = 49152
+ # Construct a dict representation of a VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext model
+ virtual_network_interface_primary_ip_prototype_model = {}
+ virtual_network_interface_primary_ip_prototype_model['address'] = '10.0.0.5'
+ virtual_network_interface_primary_ip_prototype_model['auto_delete'] = False
+ virtual_network_interface_primary_ip_prototype_model['name'] = 'my-reserved-ip'
+
+ # Construct a dict representation of a ResourceGroupIdentityById model
+ resource_group_identity_model = {}
+ resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
+
+ # Construct a dict representation of a SecurityGroupIdentityById model
+ security_group_identity_model = {}
+ security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271'
+
+ # Construct a dict representation of a SubnetIdentityById model
+ subnet_identity_model = {}
+ subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
# Set up parameter values
- network_acl_id = 'testString'
- network_acl_rule_prototype = network_acl_rule_prototype_model
+ allow_ip_spoofing = True
+ auto_delete = False
+ enable_infrastructure_nat = True
+ ips = [virtual_network_interface_ip_prototype_model]
+ name = 'my-virtual-network-interface'
+ primary_ip = virtual_network_interface_primary_ip_prototype_model
+ resource_group = resource_group_identity_model
+ security_groups = [security_group_identity_model]
+ subnet = subnet_identity_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)
+ _service.create_virtual_network_interface(**req_copy)
- def test_create_network_acl_rule_value_error_with_retries(self):
- # Enable retries and run test_create_network_acl_rule_value_error.
+ def test_create_virtual_network_interface_value_error_with_retries(self):
+ # Enable retries and run test_create_virtual_network_interface_value_error.
_service.enable_retries()
- self.test_create_network_acl_rule_value_error()
+ self.test_create_virtual_network_interface_value_error()
- # Disable retries and run test_create_network_acl_rule_value_error.
+ # Disable retries and run test_create_virtual_network_interface_value_error.
_service.disable_retries()
- self.test_create_network_acl_rule_value_error()
+ self.test_create_virtual_network_interface_value_error()
-class TestDeleteNetworkAclRule:
+class TestDeleteVirtualNetworkInterfaces:
"""
- Test Class for delete_network_acl_rule
+ Test Class for delete_virtual_network_interfaces
"""
@responses.activate
- def test_delete_network_acl_rule_all_params(self):
+ def test_delete_virtual_network_interfaces_all_params(self):
"""
- delete_network_acl_rule()
+ delete_virtual_network_interfaces()
"""
# Set up mock
- url = preprocess_url('/network_acls/testString/rules/testString')
+ url = preprocess_url('/virtual_network_interfaces/testString')
responses.add(
responses.DELETE,
url,
- status=204,
+ status=202,
)
# Set up parameter values
- network_acl_id = 'testString'
id = 'testString'
# Invoke method
- response = _service.delete_network_acl_rule(
- network_acl_id,
+ response = _service.delete_virtual_network_interfaces(
id,
headers={},
)
# Check for correct operation
assert len(responses.calls) == 1
- assert response.status_code == 204
+ assert response.status_code == 202
- def test_delete_network_acl_rule_all_params_with_retries(self):
- # Enable retries and run test_delete_network_acl_rule_all_params.
+ def test_delete_virtual_network_interfaces_all_params_with_retries(self):
+ # Enable retries and run test_delete_virtual_network_interfaces_all_params.
_service.enable_retries()
- self.test_delete_network_acl_rule_all_params()
+ self.test_delete_virtual_network_interfaces_all_params()
- # Disable retries and run test_delete_network_acl_rule_all_params.
+ # Disable retries and run test_delete_virtual_network_interfaces_all_params.
_service.disable_retries()
- self.test_delete_network_acl_rule_all_params()
+ self.test_delete_virtual_network_interfaces_all_params()
@responses.activate
- def test_delete_network_acl_rule_value_error(self):
+ def test_delete_virtual_network_interfaces_value_error(self):
"""
- test_delete_network_acl_rule_value_error()
+ test_delete_virtual_network_interfaces_value_error()
"""
# Set up mock
- url = preprocess_url('/network_acls/testString/rules/testString')
+ url = preprocess_url('/virtual_network_interfaces/testString')
responses.add(
responses.DELETE,
url,
- status=204,
+ status=202,
)
# Set up parameter values
- network_acl_id = 'testString'
id = 'testString'
# Pass in all but one required param and check for a ValueError
req_param_dict = {
- "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_network_acl_rule(**req_copy)
+ _service.delete_virtual_network_interfaces(**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_delete_virtual_network_interfaces_value_error_with_retries(self):
+ # Enable retries and run test_delete_virtual_network_interfaces_value_error.
_service.enable_retries()
- self.test_delete_network_acl_rule_value_error()
+ self.test_delete_virtual_network_interfaces_value_error()
- # Disable retries and run test_delete_network_acl_rule_value_error.
+ # Disable retries and run test_delete_virtual_network_interfaces_value_error.
_service.disable_retries()
- self.test_delete_network_acl_rule_value_error()
+ self.test_delete_virtual_network_interfaces_value_error()
-class TestGetNetworkAclRule:
+class TestGetVirtualNetworkInterface:
"""
- Test Class for get_network_acl_rule
+ Test Class for get_virtual_network_interface
"""
@responses.activate
- def test_get_network_acl_rule_all_params(self):
+ def test_get_virtual_network_interface_all_params(self):
"""
- get_network_acl_rule()
+ get_virtual_network_interface()
"""
# Set up mock
- url = preprocess_url('/network_acls/testString/rules/testString')
- mock_response = '{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-1", "source": "192.168.3.0/24", "destination_port_max": 22, "destination_port_min": 22, "protocol": "udp", "source_port_max": 65535, "source_port_min": 49152}'
+ url = preprocess_url('/virtual_network_interfaces/testString')
+ mock_response = '{"allow_ip_spoofing": true, "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "enable_infrastructure_nat": true, "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "id": "0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "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", "mac_address": "02:00:4D:45:45:4D", "name": "my-virtual-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "virtual_network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "name": "my-share-mount-target", "resource_type": "share_mount_target"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
responses.add(
responses.GET,
url,
@@ -29752,12 +30553,10 @@ def test_get_network_acl_rule_all_params(self):
)
# Set up parameter values
- network_acl_id = 'testString'
id = 'testString'
# Invoke method
- response = _service.get_network_acl_rule(
- network_acl_id,
+ response = _service.get_virtual_network_interface(
id,
headers={},
)
@@ -29766,23 +30565,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_get_virtual_network_interface_all_params_with_retries(self):
+ # Enable retries and run test_get_virtual_network_interface_all_params.
_service.enable_retries()
- self.test_get_network_acl_rule_all_params()
+ self.test_get_virtual_network_interface_all_params()
- # Disable retries and run test_get_network_acl_rule_all_params.
+ # Disable retries and run test_get_virtual_network_interface_all_params.
_service.disable_retries()
- self.test_get_network_acl_rule_all_params()
+ self.test_get_virtual_network_interface_all_params()
@responses.activate
- def test_get_network_acl_rule_value_error(self):
+ def test_get_virtual_network_interface_value_error(self):
"""
- test_get_network_acl_rule_value_error()
+ test_get_virtual_network_interface_value_error()
"""
# Set up mock
- url = preprocess_url('/network_acls/testString/rules/testString')
- mock_response = '{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-1", "source": "192.168.3.0/24", "destination_port_max": 22, "destination_port_min": 22, "protocol": "udp", "source_port_max": 65535, "source_port_min": 49152}'
+ url = preprocess_url('/virtual_network_interfaces/testString')
+ mock_response = '{"allow_ip_spoofing": true, "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "enable_infrastructure_nat": true, "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "id": "0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "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", "mac_address": "02:00:4D:45:45:4D", "name": "my-virtual-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "virtual_network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "name": "my-share-mount-target", "resource_type": "share_mount_target"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
responses.add(
responses.GET,
url,
@@ -29792,42 +30591,40 @@ def test_get_network_acl_rule_value_error(self):
)
# Set up parameter values
- network_acl_id = 'testString'
id = 'testString'
# Pass in all but one required param and check for a ValueError
req_param_dict = {
- "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_network_acl_rule(**req_copy)
+ _service.get_virtual_network_interface(**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_get_virtual_network_interface_value_error_with_retries(self):
+ # Enable retries and run test_get_virtual_network_interface_value_error.
_service.enable_retries()
- self.test_get_network_acl_rule_value_error()
+ self.test_get_virtual_network_interface_value_error()
- # Disable retries and run test_get_network_acl_rule_value_error.
+ # Disable retries and run test_get_virtual_network_interface_value_error.
_service.disable_retries()
- self.test_get_network_acl_rule_value_error()
+ self.test_get_virtual_network_interface_value_error()
-class TestUpdateNetworkAclRule:
+class TestUpdateVirtualNetworkInterface:
"""
- Test Class for update_network_acl_rule
+ Test Class for update_virtual_network_interface
"""
@responses.activate
- def test_update_network_acl_rule_all_params(self):
+ def test_update_virtual_network_interface_all_params(self):
"""
- update_network_acl_rule()
+ update_virtual_network_interface()
"""
# Set up mock
- url = preprocess_url('/network_acls/testString/rules/testString')
- mock_response = '{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-1", "source": "192.168.3.0/24", "destination_port_max": 22, "destination_port_min": 22, "protocol": "udp", "source_port_max": 65535, "source_port_min": 49152}'
+ url = preprocess_url('/virtual_network_interfaces/testString')
+ mock_response = '{"allow_ip_spoofing": true, "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "enable_infrastructure_nat": true, "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "id": "0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "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", "mac_address": "02:00:4D:45:45:4D", "name": "my-virtual-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "virtual_network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "name": "my-share-mount-target", "resource_type": "share_mount_target"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
responses.add(
responses.PATCH,
url,
@@ -29836,36 +30633,21 @@ def test_update_network_acl_rule_all_params(self):
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-1'
- network_acl_rule_patch_model['protocol'] = 'tcp'
- network_acl_rule_patch_model['source'] = '192.168.3.2/32'
- network_acl_rule_patch_model['source_port_max'] = 65535
- network_acl_rule_patch_model['source_port_min'] = 49152
- network_acl_rule_patch_model['type'] = 8
+ # Construct a dict representation of a VirtualNetworkInterfacePatch model
+ virtual_network_interface_patch_model = {}
+ virtual_network_interface_patch_model['allow_ip_spoofing'] = True
+ virtual_network_interface_patch_model['auto_delete'] = False
+ virtual_network_interface_patch_model['enable_infrastructure_nat'] = True
+ virtual_network_interface_patch_model['name'] = 'my-virtual-network-interface'
# Set up parameter values
- network_acl_id = 'testString'
id = 'testString'
- network_acl_rule_patch = network_acl_rule_patch_model
+ virtual_network_interface_patch = virtual_network_interface_patch_model
# Invoke method
- response = _service.update_network_acl_rule(
- network_acl_id,
+ response = _service.update_virtual_network_interface(
id,
- network_acl_rule_patch,
+ virtual_network_interface_patch,
headers={},
)
@@ -29874,25 +30656,25 @@ def test_update_network_acl_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 == network_acl_rule_patch
+ assert req_body == virtual_network_interface_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_update_virtual_network_interface_all_params_with_retries(self):
+ # Enable retries and run test_update_virtual_network_interface_all_params.
_service.enable_retries()
- self.test_update_network_acl_rule_all_params()
+ self.test_update_virtual_network_interface_all_params()
- # Disable retries and run test_update_network_acl_rule_all_params.
+ # Disable retries and run test_update_virtual_network_interface_all_params.
_service.disable_retries()
- self.test_update_network_acl_rule_all_params()
+ self.test_update_virtual_network_interface_all_params()
@responses.activate
- def test_update_network_acl_rule_value_error(self):
+ def test_update_virtual_network_interface_value_error(self):
"""
- test_update_network_acl_rule_value_error()
+ test_update_virtual_network_interface_value_error()
"""
# Set up mock
- url = preprocess_url('/network_acls/testString/rules/testString')
- mock_response = '{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-1", "source": "192.168.3.0/24", "destination_port_max": 22, "destination_port_min": 22, "protocol": "udp", "source_port_max": 65535, "source_port_min": 49152}'
+ url = preprocess_url('/virtual_network_interfaces/testString')
+ mock_response = '{"allow_ip_spoofing": true, "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "enable_infrastructure_nat": true, "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "id": "0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "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", "mac_address": "02:00:4D:45:45:4D", "name": "my-virtual-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "virtual_network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "name": "my-share-mount-target", "resource_type": "share_mount_target"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
responses.add(
responses.PATCH,
url,
@@ -29901,122 +30683,50 @@ def test_update_network_acl_rule_value_error(self):
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-1'
- network_acl_rule_patch_model['protocol'] = 'tcp'
- network_acl_rule_patch_model['source'] = '192.168.3.2/32'
- network_acl_rule_patch_model['source_port_max'] = 65535
- network_acl_rule_patch_model['source_port_min'] = 49152
- network_acl_rule_patch_model['type'] = 8
+ # Construct a dict representation of a VirtualNetworkInterfacePatch model
+ virtual_network_interface_patch_model = {}
+ virtual_network_interface_patch_model['allow_ip_spoofing'] = True
+ virtual_network_interface_patch_model['auto_delete'] = False
+ virtual_network_interface_patch_model['enable_infrastructure_nat'] = True
+ virtual_network_interface_patch_model['name'] = 'my-virtual-network-interface'
# Set up parameter values
- network_acl_id = 'testString'
id = 'testString'
- network_acl_rule_patch = network_acl_rule_patch_model
+ virtual_network_interface_patch = virtual_network_interface_patch_model
# 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,
+ "virtual_network_interface_patch": virtual_network_interface_patch,
}
for param in req_param_dict.keys():
req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()}
with pytest.raises(ValueError):
- _service.update_network_acl_rule(**req_copy)
+ _service.update_virtual_network_interface(**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_update_virtual_network_interface_value_error_with_retries(self):
+ # Enable retries and run test_update_virtual_network_interface_value_error.
_service.enable_retries()
- self.test_update_network_acl_rule_value_error()
+ self.test_update_virtual_network_interface_value_error()
- # Disable retries and run test_update_network_acl_rule_value_error.
+ # Disable retries and run test_update_virtual_network_interface_value_error.
_service.disable_retries()
- self.test_update_network_acl_rule_value_error()
-
-
-# endregion
-##############################################################################
-# End of Service: NetworkACLs
-##############################################################################
-
-##############################################################################
-# Start of Service: SecurityGroups
-##############################################################################
-# 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,
- )
+ self.test_update_virtual_network_interface_value_error()
-class TestListSecurityGroups:
+class TestListNetworkInterfaceFloatingIps:
"""
- Test Class for list_security_groups
+ Test Class for list_network_interface_floating_ips
"""
@responses.activate
- def test_list_security_groups_all_params(self):
+ def test_list_network_interface_floating_ips_all_params(self):
"""
- list_security_groups()
+ list_network_interface_floating_ips()
"""
# Set up mock
- url = preprocess_url('/security_groups')
- mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "security_groups": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a", "id": "6f2a6efe-21e2-401c-b237-620aa26ba16a", "ip_version": "ipv4", "remote": {"address": "192.168.3.4"}, "protocol": "all"}], "targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "resource_type": "network_interface"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}], "total_count": 132}'
+ url = preprocess_url('/virtual_network_interfaces/testString/floating_ips')
+ mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9/floating_ips?limit=20"}, "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"}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9/floating_ips?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}'
responses.add(
responses.GET,
url,
@@ -30026,21 +30736,17 @@ def test_list_security_groups_all_params(self):
)
# Set up parameter values
+ virtual_network_interface_id = 'testString'
start = 'testString'
limit = 50
- resource_group_id = 'testString'
- vpc_id = 'testString'
- vpc_crn = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b'
- vpc_name = 'my-vpc'
+ sort = 'name'
# Invoke method
- response = _service.list_security_groups(
+ response = _service.list_network_interface_floating_ips(
+ virtual_network_interface_id,
start=start,
limit=limit,
- resource_group_id=resource_group_id,
- vpc_id=vpc_id,
- vpc_crn=vpc_crn,
- vpc_name=vpc_name,
+ sort=sort,
headers={},
)
@@ -30052,28 +30758,25 @@ def test_list_security_groups_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
+ assert 'sort={}'.format(sort) 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_network_interface_floating_ips_all_params_with_retries(self):
+ # Enable retries and run test_list_network_interface_floating_ips_all_params.
_service.enable_retries()
- self.test_list_security_groups_all_params()
+ self.test_list_network_interface_floating_ips_all_params()
- # Disable retries and run test_list_security_groups_all_params.
+ # Disable retries and run test_list_network_interface_floating_ips_all_params.
_service.disable_retries()
- self.test_list_security_groups_all_params()
+ self.test_list_network_interface_floating_ips_all_params()
@responses.activate
- def test_list_security_groups_required_params(self):
+ def test_list_network_interface_floating_ips_required_params(self):
"""
- test_list_security_groups_required_params()
+ test_list_network_interface_floating_ips_required_params()
"""
# Set up mock
- url = preprocess_url('/security_groups')
- mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "security_groups": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a", "id": "6f2a6efe-21e2-401c-b237-620aa26ba16a", "ip_version": "ipv4", "remote": {"address": "192.168.3.4"}, "protocol": "all"}], "targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "resource_type": "network_interface"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}], "total_count": 132}'
+ url = preprocess_url('/virtual_network_interfaces/testString/floating_ips')
+ mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9/floating_ips?limit=20"}, "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"}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9/floating_ips?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}'
responses.add(
responses.GET,
url,
@@ -30082,30 +30785,36 @@ def test_list_security_groups_required_params(self):
status=200,
)
+ # Set up parameter values
+ virtual_network_interface_id = 'testString'
+
# Invoke method
- response = _service.list_security_groups()
+ response = _service.list_network_interface_floating_ips(
+ virtual_network_interface_id,
+ headers={},
+ )
# 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_network_interface_floating_ips_required_params_with_retries(self):
+ # Enable retries and run test_list_network_interface_floating_ips_required_params.
_service.enable_retries()
- self.test_list_security_groups_required_params()
+ self.test_list_network_interface_floating_ips_required_params()
- # Disable retries and run test_list_security_groups_required_params.
+ # Disable retries and run test_list_network_interface_floating_ips_required_params.
_service.disable_retries()
- self.test_list_security_groups_required_params()
+ self.test_list_network_interface_floating_ips_required_params()
@responses.activate
- def test_list_security_groups_value_error(self):
+ def test_list_network_interface_floating_ips_value_error(self):
"""
- test_list_security_groups_value_error()
+ test_list_network_interface_floating_ips_value_error()
"""
# Set up mock
- url = preprocess_url('/security_groups')
- mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "security_groups": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a", "id": "6f2a6efe-21e2-401c-b237-620aa26ba16a", "ip_version": "ipv4", "remote": {"address": "192.168.3.4"}, "protocol": "all"}], "targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "resource_type": "network_interface"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}], "total_count": 132}'
+ url = preprocess_url('/virtual_network_interfaces/testString/floating_ips')
+ mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9/floating_ips?limit=20"}, "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"}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9/floating_ips?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}'
responses.add(
responses.GET,
url,
@@ -30114,32 +30823,36 @@ def test_list_security_groups_value_error(self):
status=200,
)
+ # Set up parameter values
+ virtual_network_interface_id = 'testString'
+
# Pass in all but one required param and check for a ValueError
req_param_dict = {
+ "virtual_network_interface_id": virtual_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_security_groups(**req_copy)
+ _service.list_network_interface_floating_ips(**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_network_interface_floating_ips_value_error_with_retries(self):
+ # Enable retries and run test_list_network_interface_floating_ips_value_error.
_service.enable_retries()
- self.test_list_security_groups_value_error()
+ self.test_list_network_interface_floating_ips_value_error()
- # Disable retries and run test_list_security_groups_value_error.
+ # Disable retries and run test_list_network_interface_floating_ips_value_error.
_service.disable_retries()
- self.test_list_security_groups_value_error()
+ self.test_list_network_interface_floating_ips_value_error()
@responses.activate
- def test_list_security_groups_with_pager_get_next(self):
+ def test_list_network_interface_floating_ips_with_pager_get_next(self):
"""
- test_list_security_groups_with_pager_get_next()
+ test_list_network_interface_floating_ips_with_pager_get_next()
"""
# Set up a two-page mock response
- url = preprocess_url('/security_groups')
- mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"security_groups":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271","href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271","id":"be5df5ca-12a0-494b-907e-aa6ec2bfa271","name":"my-security-group","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"rules":[{"direction":"inbound","href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a","id":"6f2a6efe-21e2-401c-b237-620aa26ba16a","ip_version":"ipv4","remote":{"address":"192.168.3.4"},"protocol":"all"}],"targets":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-instance-network-interface","resource_type":"network_interface"}],"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"}}],"total_count":2,"limit":1}'
- mock_response2 = '{"security_groups":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271","href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271","id":"be5df5ca-12a0-494b-907e-aa6ec2bfa271","name":"my-security-group","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"rules":[{"direction":"inbound","href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a","id":"6f2a6efe-21e2-401c-b237-620aa26ba16a","ip_version":"ipv4","remote":{"address":"192.168.3.4"},"protocol":"all"}],"targets":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-instance-network-interface","resource_type":"network_interface"}],"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"}}],"total_count":2,"limit":1}'
+ url = preprocess_url('/virtual_network_interfaces/testString/floating_ips')
+ mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"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"}]}'
+ mock_response2 = '{"total_count":2,"limit":1,"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"}]}'
responses.add(
responses.GET,
url,
@@ -30157,13 +30870,11 @@ def test_list_security_groups_with_pager_get_next(self):
# Exercise the pager class for this operation
all_results = []
- pager = SecurityGroupsPager(
+ pager = NetworkInterfaceFloatingIpsPager(
client=_service,
+ virtual_network_interface_id='testString',
limit=10,
- resource_group_id='testString',
- vpc_id='testString',
- vpc_crn='crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b',
- vpc_name='my-vpc',
+ sort='name',
)
while pager.has_next():
next_page = pager.get_next()
@@ -30172,14 +30883,14 @@ def test_list_security_groups_with_pager_get_next(self):
assert len(all_results) == 2
@responses.activate
- def test_list_security_groups_with_pager_get_all(self):
+ def test_list_network_interface_floating_ips_with_pager_get_all(self):
"""
- test_list_security_groups_with_pager_get_all()
+ test_list_network_interface_floating_ips_with_pager_get_all()
"""
# Set up a two-page mock response
- url = preprocess_url('/security_groups')
- mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"security_groups":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271","href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271","id":"be5df5ca-12a0-494b-907e-aa6ec2bfa271","name":"my-security-group","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"rules":[{"direction":"inbound","href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a","id":"6f2a6efe-21e2-401c-b237-620aa26ba16a","ip_version":"ipv4","remote":{"address":"192.168.3.4"},"protocol":"all"}],"targets":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-instance-network-interface","resource_type":"network_interface"}],"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"}}],"total_count":2,"limit":1}'
- mock_response2 = '{"security_groups":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271","href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271","id":"be5df5ca-12a0-494b-907e-aa6ec2bfa271","name":"my-security-group","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"rules":[{"direction":"inbound","href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a","id":"6f2a6efe-21e2-401c-b237-620aa26ba16a","ip_version":"ipv4","remote":{"address":"192.168.3.4"},"protocol":"all"}],"targets":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-instance-network-interface","resource_type":"network_interface"}],"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"}}],"total_count":2,"limit":1}'
+ url = preprocess_url('/virtual_network_interfaces/testString/floating_ips')
+ mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"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"}]}'
+ mock_response2 = '{"total_count":2,"limit":1,"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"}]}'
responses.add(
responses.GET,
url,
@@ -30196,165 +30907,29 @@ def test_list_security_groups_with_pager_get_all(self):
)
# Exercise the pager class for this operation
- pager = SecurityGroupsPager(
+ pager = NetworkInterfaceFloatingIpsPager(
client=_service,
+ virtual_network_interface_id='testString',
limit=10,
- resource_group_id='testString',
- vpc_id='testString',
- vpc_crn='crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b',
- vpc_name='my-vpc',
+ sort='name',
)
all_results = pager.get_all()
assert all_results is not None
assert len(all_results) == 2
-class TestCreateSecurityGroup:
- """
- Test Class for create_security_group
- """
-
- @responses.activate
- def test_create_security_group_all_params(self):
- """
- create_security_group()
- """
- # Set up mock
- url = preprocess_url('/security_groups')
- mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a", "id": "6f2a6efe-21e2-401c-b237-620aa26ba16a", "ip_version": "ipv4", "remote": {"address": "192.168.3.4"}, "protocol": "all"}], "targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "resource_type": "network_interface"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}'
- responses.add(
- responses.POST,
- url,
- 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 SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll 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'] = 'all'
- security_group_rule_prototype_model['remote'] = security_group_rule_remote_prototype_model
-
- # 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_security_group(
- vpc,
- name=name,
- resource_group=resource_group,
- rules=rules,
- 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['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_security_group_all_params_with_retries(self):
- # Enable retries and run test_create_security_group_all_params.
- _service.enable_retries()
- self.test_create_security_group_all_params()
-
- # Disable retries and run test_create_security_group_all_params.
- _service.disable_retries()
- self.test_create_security_group_all_params()
-
- @responses.activate
- def test_create_security_group_value_error(self):
- """
- test_create_security_group_value_error()
- """
- # Set up mock
- url = preprocess_url('/security_groups')
- mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a", "id": "6f2a6efe-21e2-401c-b237-620aa26ba16a", "ip_version": "ipv4", "remote": {"address": "192.168.3.4"}, "protocol": "all"}], "targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "resource_type": "network_interface"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}'
- responses.add(
- responses.POST,
- url,
- 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 SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll 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'] = 'all'
- security_group_rule_prototype_model['remote'] = security_group_rule_remote_prototype_model
-
- # Set up parameter values
- 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 = {
- "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_security_group(**req_copy)
-
- def test_create_security_group_value_error_with_retries(self):
- # Enable retries and run test_create_security_group_value_error.
- _service.enable_retries()
- self.test_create_security_group_value_error()
-
- # Disable retries and run test_create_security_group_value_error.
- _service.disable_retries()
- self.test_create_security_group_value_error()
-
-
-class TestDeleteSecurityGroup:
+class TestRemoveNetworkInterfaceFloatingIp:
"""
- Test Class for delete_security_group
+ Test Class for remove_network_interface_floating_ip
"""
@responses.activate
- def test_delete_security_group_all_params(self):
+ def test_remove_network_interface_floating_ip_all_params(self):
"""
- delete_security_group()
+ remove_network_interface_floating_ip()
"""
# Set up mock
- url = preprocess_url('/security_groups/testString')
+ url = preprocess_url('/virtual_network_interfaces/testString/floating_ips/testString')
responses.add(
responses.DELETE,
url,
@@ -30362,10 +30937,12 @@ def test_delete_security_group_all_params(self):
)
# Set up parameter values
+ virtual_network_interface_id = 'testString'
id = 'testString'
# Invoke method
- response = _service.delete_security_group(
+ response = _service.remove_network_interface_floating_ip(
+ virtual_network_interface_id,
id,
headers={},
)
@@ -30374,22 +30951,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_remove_network_interface_floating_ip_all_params_with_retries(self):
+ # Enable retries and run test_remove_network_interface_floating_ip_all_params.
_service.enable_retries()
- self.test_delete_security_group_all_params()
+ self.test_remove_network_interface_floating_ip_all_params()
- # Disable retries and run test_delete_security_group_all_params.
+ # Disable retries and run test_remove_network_interface_floating_ip_all_params.
_service.disable_retries()
- self.test_delete_security_group_all_params()
+ self.test_remove_network_interface_floating_ip_all_params()
@responses.activate
- def test_delete_security_group_value_error(self):
+ def test_remove_network_interface_floating_ip_value_error(self):
"""
- test_delete_security_group_value_error()
+ test_remove_network_interface_floating_ip_value_error()
"""
# Set up mock
- url = preprocess_url('/security_groups/testString')
+ url = preprocess_url('/virtual_network_interfaces/testString/floating_ips/testString')
responses.add(
responses.DELETE,
url,
@@ -30397,40 +30974,42 @@ def test_delete_security_group_value_error(self):
)
# Set up parameter values
+ virtual_network_interface_id = 'testString'
id = 'testString'
# Pass in all but one required param and check for a ValueError
req_param_dict = {
+ "virtual_network_interface_id": virtual_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.delete_security_group(**req_copy)
+ _service.remove_network_interface_floating_ip(**req_copy)
- def test_delete_security_group_value_error_with_retries(self):
- # Enable retries and run test_delete_security_group_value_error.
+ def test_remove_network_interface_floating_ip_value_error_with_retries(self):
+ # Enable retries and run test_remove_network_interface_floating_ip_value_error.
_service.enable_retries()
- self.test_delete_security_group_value_error()
+ self.test_remove_network_interface_floating_ip_value_error()
- # Disable retries and run test_delete_security_group_value_error.
+ # Disable retries and run test_remove_network_interface_floating_ip_value_error.
_service.disable_retries()
- self.test_delete_security_group_value_error()
+ self.test_remove_network_interface_floating_ip_value_error()
-class TestGetSecurityGroup:
+class TestGetNetworkInterfaceFloatingIp:
"""
- Test Class for get_security_group
+ Test Class for get_network_interface_floating_ip
"""
@responses.activate
- def test_get_security_group_all_params(self):
+ def test_get_network_interface_floating_ip_all_params(self):
"""
- get_security_group()
+ get_network_interface_floating_ip()
"""
# Set up mock
- url = preprocess_url('/security_groups/testString')
- mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a", "id": "6f2a6efe-21e2-401c-b237-620aa26ba16a", "ip_version": "ipv4", "remote": {"address": "192.168.3.4"}, "protocol": "all"}], "targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "resource_type": "network_interface"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}'
+ url = preprocess_url('/virtual_network_interfaces/testString/floating_ips/testString')
+ mock_response = '{"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"}'
responses.add(
responses.GET,
url,
@@ -30440,10 +31019,12 @@ def test_get_security_group_all_params(self):
)
# Set up parameter values
+ virtual_network_interface_id = 'testString'
id = 'testString'
# Invoke method
- response = _service.get_security_group(
+ response = _service.get_network_interface_floating_ip(
+ virtual_network_interface_id,
id,
headers={},
)
@@ -30452,23 +31033,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_network_interface_floating_ip_all_params_with_retries(self):
+ # Enable retries and run test_get_network_interface_floating_ip_all_params.
_service.enable_retries()
- self.test_get_security_group_all_params()
+ self.test_get_network_interface_floating_ip_all_params()
- # Disable retries and run test_get_security_group_all_params.
+ # Disable retries and run test_get_network_interface_floating_ip_all_params.
_service.disable_retries()
- self.test_get_security_group_all_params()
+ self.test_get_network_interface_floating_ip_all_params()
@responses.activate
- def test_get_security_group_value_error(self):
+ def test_get_network_interface_floating_ip_value_error(self):
"""
- test_get_security_group_value_error()
+ test_get_network_interface_floating_ip_value_error()
"""
# Set up mock
- url = preprocess_url('/security_groups/testString')
- mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a", "id": "6f2a6efe-21e2-401c-b237-620aa26ba16a", "ip_version": "ipv4", "remote": {"address": "192.168.3.4"}, "protocol": "all"}], "targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "resource_type": "network_interface"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}'
+ url = preprocess_url('/virtual_network_interfaces/testString/floating_ips/testString')
+ mock_response = '{"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"}'
responses.add(
responses.GET,
url,
@@ -30478,136 +31059,127 @@ def test_get_security_group_value_error(self):
)
# Set up parameter values
+ virtual_network_interface_id = 'testString'
id = 'testString'
# Pass in all but one required param and check for a ValueError
req_param_dict = {
+ "virtual_network_interface_id": virtual_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_security_group(**req_copy)
+ _service.get_network_interface_floating_ip(**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_network_interface_floating_ip_value_error_with_retries(self):
+ # Enable retries and run test_get_network_interface_floating_ip_value_error.
_service.enable_retries()
- self.test_get_security_group_value_error()
+ self.test_get_network_interface_floating_ip_value_error()
- # Disable retries and run test_get_security_group_value_error.
+ # Disable retries and run test_get_network_interface_floating_ip_value_error.
_service.disable_retries()
- self.test_get_security_group_value_error()
+ self.test_get_network_interface_floating_ip_value_error()
-class TestUpdateSecurityGroup:
+class TestAddNetworkInterfaceFloatingIp:
"""
- Test Class for update_security_group
+ Test Class for add_network_interface_floating_ip
"""
@responses.activate
- def test_update_security_group_all_params(self):
+ def test_add_network_interface_floating_ip_all_params(self):
"""
- update_security_group()
+ add_network_interface_floating_ip()
"""
# Set up mock
- url = preprocess_url('/security_groups/testString')
- mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a", "id": "6f2a6efe-21e2-401c-b237-620aa26ba16a", "ip_version": "ipv4", "remote": {"address": "192.168.3.4"}, "protocol": "all"}], "targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "resource_type": "network_interface"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}'
+ url = preprocess_url('/virtual_network_interfaces/testString/floating_ips/testString')
+ mock_response = '{"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"}'
responses.add(
- responses.PATCH,
+ responses.PUT,
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'
-
# Set up parameter values
+ virtual_network_interface_id = 'testString'
id = 'testString'
- security_group_patch = security_group_patch_model
# Invoke method
- response = _service.update_security_group(
+ response = _service.add_network_interface_floating_ip(
+ virtual_network_interface_id,
id,
- security_group_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_patch
- def test_update_security_group_all_params_with_retries(self):
- # Enable retries and run test_update_security_group_all_params.
+ def test_add_network_interface_floating_ip_all_params_with_retries(self):
+ # Enable retries and run test_add_network_interface_floating_ip_all_params.
_service.enable_retries()
- self.test_update_security_group_all_params()
+ self.test_add_network_interface_floating_ip_all_params()
- # Disable retries and run test_update_security_group_all_params.
+ # Disable retries and run test_add_network_interface_floating_ip_all_params.
_service.disable_retries()
- self.test_update_security_group_all_params()
+ self.test_add_network_interface_floating_ip_all_params()
@responses.activate
- def test_update_security_group_value_error(self):
+ def test_add_network_interface_floating_ip_value_error(self):
"""
- test_update_security_group_value_error()
+ test_add_network_interface_floating_ip_value_error()
"""
# Set up mock
- url = preprocess_url('/security_groups/testString')
- mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a", "id": "6f2a6efe-21e2-401c-b237-620aa26ba16a", "ip_version": "ipv4", "remote": {"address": "192.168.3.4"}, "protocol": "all"}], "targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "resource_type": "network_interface"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}'
+ url = preprocess_url('/virtual_network_interfaces/testString/floating_ips/testString')
+ mock_response = '{"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"}'
responses.add(
- responses.PATCH,
+ responses.PUT,
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'
-
# Set up parameter values
+ virtual_network_interface_id = 'testString'
id = 'testString'
- security_group_patch = security_group_patch_model
# Pass in all but one required param and check for a ValueError
req_param_dict = {
+ "virtual_network_interface_id": virtual_network_interface_id,
"id": id,
- "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_security_group(**req_copy)
+ _service.add_network_interface_floating_ip(**req_copy)
- def test_update_security_group_value_error_with_retries(self):
- # Enable retries and run test_update_security_group_value_error.
+ def test_add_network_interface_floating_ip_value_error_with_retries(self):
+ # Enable retries and run test_add_network_interface_floating_ip_value_error.
_service.enable_retries()
- self.test_update_security_group_value_error()
+ self.test_add_network_interface_floating_ip_value_error()
- # Disable retries and run test_update_security_group_value_error.
+ # Disable retries and run test_add_network_interface_floating_ip_value_error.
_service.disable_retries()
- self.test_update_security_group_value_error()
+ self.test_add_network_interface_floating_ip_value_error()
-class TestListSecurityGroupRules:
+class TestListVirtualNetworkInterfaceIps:
"""
- Test Class for list_security_group_rules
+ Test Class for list_virtual_network_interface_ips
"""
@responses.activate
- def test_list_security_group_rules_all_params(self):
+ def test_list_virtual_network_interface_ips_all_params(self):
"""
- list_security_group_rules()
+ list_virtual_network_interface_ips()
"""
# Set up mock
- 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"}]}'
+ url = preprocess_url('/virtual_network_interfaces/testString/ips')
+ mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e/ips?limit=20"}, "ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e/ips?start=a404e343444b4e1095c9edba76672d67&limit=20"}, "total_count": 132}'
responses.add(
responses.GET,
url,
@@ -30617,35 +31189,47 @@ def test_list_security_group_rules_all_params(self):
)
# Set up parameter values
- security_group_id = 'testString'
+ virtual_network_interface_id = 'testString'
+ start = 'testString'
+ limit = 50
+ sort = 'name'
# Invoke method
- response = _service.list_security_group_rules(
- security_group_id,
+ response = _service.list_virtual_network_interface_ips(
+ virtual_network_interface_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_security_group_rules_all_params_with_retries(self):
- # Enable retries and run test_list_security_group_rules_all_params.
+ def test_list_virtual_network_interface_ips_all_params_with_retries(self):
+ # Enable retries and run test_list_virtual_network_interface_ips_all_params.
_service.enable_retries()
- self.test_list_security_group_rules_all_params()
+ self.test_list_virtual_network_interface_ips_all_params()
- # Disable retries and run test_list_security_group_rules_all_params.
+ # Disable retries and run test_list_virtual_network_interface_ips_all_params.
_service.disable_retries()
- self.test_list_security_group_rules_all_params()
+ self.test_list_virtual_network_interface_ips_all_params()
@responses.activate
- def test_list_security_group_rules_value_error(self):
+ def test_list_virtual_network_interface_ips_required_params(self):
"""
- test_list_security_group_rules_value_error()
+ test_list_virtual_network_interface_ips_required_params()
"""
# Set up mock
- 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"}]}'
+ url = preprocess_url('/virtual_network_interfaces/testString/ips')
+ mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e/ips?limit=20"}, "ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e/ips?start=a404e343444b4e1095c9edba76672d67&limit=20"}, "total_count": 132}'
responses.add(
responses.GET,
url,
@@ -30655,149 +31239,150 @@ def test_list_security_group_rules_value_error(self):
)
# Set up parameter values
- security_group_id = 'testString'
+ virtual_network_interface_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_rules(**req_copy)
+ # Invoke method
+ response = _service.list_virtual_network_interface_ips(
+ virtual_network_interface_id,
+ headers={},
+ )
- def test_list_security_group_rules_value_error_with_retries(self):
- # Enable retries and run test_list_security_group_rules_value_error.
+ # Check for correct operation
+ assert len(responses.calls) == 1
+ assert response.status_code == 200
+
+ def test_list_virtual_network_interface_ips_required_params_with_retries(self):
+ # Enable retries and run test_list_virtual_network_interface_ips_required_params.
_service.enable_retries()
- self.test_list_security_group_rules_value_error()
+ self.test_list_virtual_network_interface_ips_required_params()
- # Disable retries and run test_list_security_group_rules_value_error.
+ # Disable retries and run test_list_virtual_network_interface_ips_required_params.
_service.disable_retries()
- self.test_list_security_group_rules_value_error()
-
-
-class TestCreateSecurityGroupRule:
- """
- Test Class for create_security_group_rule
- """
+ self.test_list_virtual_network_interface_ips_required_params()
@responses.activate
- def test_create_security_group_rule_all_params(self):
+ def test_list_virtual_network_interface_ips_value_error(self):
"""
- create_security_group_rule()
+ test_list_virtual_network_interface_ips_value_error()
"""
# 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"}'
+ url = preprocess_url('/virtual_network_interfaces/testString/ips')
+ mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e/ips?limit=20"}, "ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e/ips?start=a404e343444b4e1095c9edba76672d67&limit=20"}, "total_count": 132}'
responses.add(
- responses.POST,
+ responses.GET,
url,
body=mock_response,
content_type='application/json',
- status=201,
+ status=200,
)
- # 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 SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll 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'] = 'all'
- security_group_rule_prototype_model['remote'] = security_group_rule_remote_prototype_model
-
# 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={},
- )
+ virtual_network_interface_id = 'testString'
- # 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
+ # Pass in all but one required param and check for a ValueError
+ req_param_dict = {
+ "virtual_network_interface_id": virtual_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_virtual_network_interface_ips(**req_copy)
- def test_create_security_group_rule_all_params_with_retries(self):
- # Enable retries and run test_create_security_group_rule_all_params.
+ def test_list_virtual_network_interface_ips_value_error_with_retries(self):
+ # Enable retries and run test_list_virtual_network_interface_ips_value_error.
_service.enable_retries()
- self.test_create_security_group_rule_all_params()
+ self.test_list_virtual_network_interface_ips_value_error()
- # Disable retries and run test_create_security_group_rule_all_params.
+ # Disable retries and run test_list_virtual_network_interface_ips_value_error.
_service.disable_retries()
- self.test_create_security_group_rule_all_params()
+ self.test_list_virtual_network_interface_ips_value_error()
@responses.activate
- def test_create_security_group_rule_value_error(self):
+ def test_list_virtual_network_interface_ips_with_pager_get_next(self):
"""
- test_create_security_group_rule_value_error()
+ test_list_virtual_network_interface_ips_with_pager_get_next()
"""
- # 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"}'
+ # Set up a two-page mock response
+ url = preprocess_url('/virtual_network_interfaces/testString/ips')
+ mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"ips":[{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"}]}'
+ mock_response2 = '{"total_count":2,"limit":1,"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"}]}'
responses.add(
- responses.POST,
+ responses.GET,
url,
- body=mock_response,
+ body=mock_response1,
content_type='application/json',
- status=201,
+ status=200,
+ )
+ responses.add(
+ responses.GET,
+ url,
+ body=mock_response2,
+ content_type='application/json',
+ status=200,
)
- # 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 SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll 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'] = 'all'
- security_group_rule_prototype_model['remote'] = security_group_rule_remote_prototype_model
-
- # 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)
+ # Exercise the pager class for this operation
+ all_results = []
+ pager = VirtualNetworkInterfaceIpsPager(
+ client=_service,
+ virtual_network_interface_id='testString',
+ limit=10,
+ sort='name',
+ )
+ while pager.has_next():
+ next_page = pager.get_next()
+ assert next_page is not None
+ all_results.extend(next_page)
+ assert len(all_results) == 2
- 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()
+ @responses.activate
+ def test_list_virtual_network_interface_ips_with_pager_get_all(self):
+ """
+ test_list_virtual_network_interface_ips_with_pager_get_all()
+ """
+ # Set up a two-page mock response
+ url = preprocess_url('/virtual_network_interfaces/testString/ips')
+ mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"ips":[{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"}]}'
+ mock_response2 = '{"total_count":2,"limit":1,"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"}]}'
+ responses.add(
+ responses.GET,
+ url,
+ body=mock_response1,
+ content_type='application/json',
+ status=200,
+ )
+ responses.add(
+ responses.GET,
+ url,
+ body=mock_response2,
+ content_type='application/json',
+ status=200,
+ )
- # Disable retries and run test_create_security_group_rule_value_error.
- _service.disable_retries()
- self.test_create_security_group_rule_value_error()
+ # Exercise the pager class for this operation
+ pager = VirtualNetworkInterfaceIpsPager(
+ client=_service,
+ virtual_network_interface_id='testString',
+ limit=10,
+ sort='name',
+ )
+ all_results = pager.get_all()
+ assert all_results is not None
+ assert len(all_results) == 2
-class TestDeleteSecurityGroupRule:
+class TestRemoveVirtualNetworkInterfaceIp:
"""
- Test Class for delete_security_group_rule
+ Test Class for remove_virtual_network_interface_ip
"""
@responses.activate
- def test_delete_security_group_rule_all_params(self):
+ def test_remove_virtual_network_interface_ip_all_params(self):
"""
- delete_security_group_rule()
+ remove_virtual_network_interface_ip()
"""
# Set up mock
- url = preprocess_url('/security_groups/testString/rules/testString')
+ url = preprocess_url('/virtual_network_interfaces/testString/ips/testString')
responses.add(
responses.DELETE,
url,
@@ -30805,12 +31390,12 @@ def test_delete_security_group_rule_all_params(self):
)
# Set up parameter values
- security_group_id = 'testString'
+ virtual_network_interface_id = 'testString'
id = 'testString'
# Invoke method
- response = _service.delete_security_group_rule(
- security_group_id,
+ response = _service.remove_virtual_network_interface_ip(
+ virtual_network_interface_id,
id,
headers={},
)
@@ -30819,22 +31404,22 @@ 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_remove_virtual_network_interface_ip_all_params_with_retries(self):
+ # Enable retries and run test_remove_virtual_network_interface_ip_all_params.
_service.enable_retries()
- self.test_delete_security_group_rule_all_params()
+ self.test_remove_virtual_network_interface_ip_all_params()
- # Disable retries and run test_delete_security_group_rule_all_params.
+ # Disable retries and run test_remove_virtual_network_interface_ip_all_params.
_service.disable_retries()
- self.test_delete_security_group_rule_all_params()
+ self.test_remove_virtual_network_interface_ip_all_params()
@responses.activate
- def test_delete_security_group_rule_value_error(self):
+ def test_remove_virtual_network_interface_ip_value_error(self):
"""
- test_delete_security_group_rule_value_error()
+ test_remove_virtual_network_interface_ip_value_error()
"""
# Set up mock
- url = preprocess_url('/security_groups/testString/rules/testString')
+ url = preprocess_url('/virtual_network_interfaces/testString/ips/testString')
responses.add(
responses.DELETE,
url,
@@ -30842,42 +31427,42 @@ def test_delete_security_group_rule_value_error(self):
)
# Set up parameter values
- security_group_id = 'testString'
+ virtual_network_interface_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,
+ "virtual_network_interface_id": virtual_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.delete_security_group_rule(**req_copy)
+ _service.remove_virtual_network_interface_ip(**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_remove_virtual_network_interface_ip_value_error_with_retries(self):
+ # Enable retries and run test_remove_virtual_network_interface_ip_value_error.
_service.enable_retries()
- self.test_delete_security_group_rule_value_error()
+ self.test_remove_virtual_network_interface_ip_value_error()
- # Disable retries and run test_delete_security_group_rule_value_error.
+ # Disable retries and run test_remove_virtual_network_interface_ip_value_error.
_service.disable_retries()
- self.test_delete_security_group_rule_value_error()
+ self.test_remove_virtual_network_interface_ip_value_error()
-class TestGetSecurityGroupRule:
+class TestGetVirtualNetworkInterfaceIp:
"""
- Test Class for get_security_group_rule
+ Test Class for get_virtual_network_interface_ip
"""
@responses.activate
- def test_get_security_group_rule_all_params(self):
+ def test_get_virtual_network_interface_ip_all_params(self):
"""
- get_security_group_rule()
+ get_virtual_network_interface_ip()
"""
# Set up mock
- 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"}'
+ url = preprocess_url('/virtual_network_interfaces/testString/ips/testString')
+ mock_response = '{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}'
responses.add(
responses.GET,
url,
@@ -30887,12 +31472,12 @@ def test_get_security_group_rule_all_params(self):
)
# Set up parameter values
- security_group_id = 'testString'
+ virtual_network_interface_id = 'testString'
id = 'testString'
# Invoke method
- response = _service.get_security_group_rule(
- security_group_id,
+ response = _service.get_virtual_network_interface_ip(
+ virtual_network_interface_id,
id,
headers={},
)
@@ -30901,23 +31486,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_virtual_network_interface_ip_all_params_with_retries(self):
+ # Enable retries and run test_get_virtual_network_interface_ip_all_params.
_service.enable_retries()
- self.test_get_security_group_rule_all_params()
+ self.test_get_virtual_network_interface_ip_all_params()
- # Disable retries and run test_get_security_group_rule_all_params.
+ # Disable retries and run test_get_virtual_network_interface_ip_all_params.
_service.disable_retries()
- self.test_get_security_group_rule_all_params()
+ self.test_get_virtual_network_interface_ip_all_params()
@responses.activate
- def test_get_security_group_rule_value_error(self):
+ def test_get_virtual_network_interface_ip_value_error(self):
"""
- test_get_security_group_rule_value_error()
+ test_get_virtual_network_interface_ip_value_error()
"""
# Set up mock
- 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"}'
+ url = preprocess_url('/virtual_network_interfaces/testString/ips/testString')
+ mock_response = '{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}'
responses.add(
responses.GET,
url,
@@ -30927,162 +31512,184 @@ def test_get_security_group_rule_value_error(self):
)
# Set up parameter values
- security_group_id = 'testString'
+ virtual_network_interface_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,
+ "virtual_network_interface_id": virtual_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_security_group_rule(**req_copy)
+ _service.get_virtual_network_interface_ip(**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_virtual_network_interface_ip_value_error_with_retries(self):
+ # Enable retries and run test_get_virtual_network_interface_ip_value_error.
_service.enable_retries()
- self.test_get_security_group_rule_value_error()
+ self.test_get_virtual_network_interface_ip_value_error()
- # Disable retries and run test_get_security_group_rule_value_error.
+ # Disable retries and run test_get_virtual_network_interface_ip_value_error.
_service.disable_retries()
- self.test_get_security_group_rule_value_error()
+ self.test_get_virtual_network_interface_ip_value_error()
-class TestUpdateSecurityGroupRule:
+class TestAddVirtualNetworkInterfaceIp:
"""
- Test Class for update_security_group_rule
+ Test Class for add_virtual_network_interface_ip
"""
@responses.activate
- def test_update_security_group_rule_all_params(self):
+ def test_add_virtual_network_interface_ip_all_params(self):
"""
- update_security_group_rule()
+ add_virtual_network_interface_ip()
"""
# Set up mock
- 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"}'
+ url = preprocess_url('/virtual_network_interfaces/testString/ips/testString')
+ mock_response = '{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}'
responses.add(
- responses.PATCH,
+ responses.PUT,
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'
+ virtual_network_interface_id = 'testString'
id = 'testString'
- security_group_rule_patch = security_group_rule_patch_model
# Invoke method
- response = _service.update_security_group_rule(
- security_group_id,
+ response = _service.add_virtual_network_interface_ip(
+ virtual_network_interface_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_update_security_group_rule_all_params_with_retries(self):
- # Enable retries and run test_update_security_group_rule_all_params.
+ def test_add_virtual_network_interface_ip_all_params_with_retries(self):
+ # Enable retries and run test_add_virtual_network_interface_ip_all_params.
_service.enable_retries()
- self.test_update_security_group_rule_all_params()
+ self.test_add_virtual_network_interface_ip_all_params()
- # Disable retries and run test_update_security_group_rule_all_params.
+ # Disable retries and run test_add_virtual_network_interface_ip_all_params.
_service.disable_retries()
- self.test_update_security_group_rule_all_params()
+ self.test_add_virtual_network_interface_ip_all_params()
@responses.activate
- def test_update_security_group_rule_value_error(self):
+ def test_add_virtual_network_interface_ip_value_error(self):
"""
- test_update_security_group_rule_value_error()
+ test_add_virtual_network_interface_ip_value_error()
"""
# Set up mock
- 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"}'
+ url = preprocess_url('/virtual_network_interfaces/testString/ips/testString')
+ mock_response = '{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}'
responses.add(
- responses.PATCH,
+ responses.PUT,
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'
+ virtual_network_interface_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,
+ "virtual_network_interface_id": virtual_network_interface_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.update_security_group_rule(**req_copy)
+ _service.add_virtual_network_interface_ip(**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_add_virtual_network_interface_ip_value_error_with_retries(self):
+ # Enable retries and run test_add_virtual_network_interface_ip_value_error.
_service.enable_retries()
- self.test_update_security_group_rule_value_error()
+ self.test_add_virtual_network_interface_ip_value_error()
- # Disable retries and run test_update_security_group_rule_value_error.
+ # Disable retries and run test_add_virtual_network_interface_ip_value_error.
_service.disable_retries()
- self.test_update_security_group_rule_value_error()
+ self.test_add_virtual_network_interface_ip_value_error()
-class TestListSecurityGroupTargets:
+# endregion
+##############################################################################
+# End of Service: VirtualNetworkInterfaces
+##############################################################################
+
+##############################################################################
+# Start of Service: PublicGateways
+##############################################################################
+# region
+
+
+class TestNewInstance:
"""
- Test Class for list_security_group_targets
+ 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 TestListPublicGateways:
+ """
+ Test Class for list_public_gateways
"""
@responses.activate
- def test_list_security_group_targets_all_params(self):
+ def test_list_public_gateways_all_params(self):
"""
- list_security_group_targets()
+ list_public_gateways()
"""
# Set up mock
- url = preprocess_url('/security_groups/testString/targets')
- mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/targets?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/targets?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "resource_type": "network_interface"}], "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", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "total_count": 132}'
responses.add(
responses.GET,
url,
@@ -31092,15 +31699,15 @@ def test_list_security_group_targets_all_params(self):
)
# Set up parameter values
- security_group_id = 'testString'
start = 'testString'
limit = 50
+ resource_group_id = 'testString'
# Invoke method
- response = _service.list_security_group_targets(
- security_group_id,
+ response = _service.list_public_gateways(
start=start,
limit=limit,
+ resource_group_id=resource_group_id,
headers={},
)
@@ -31112,24 +31719,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 'resource_group.id={}'.format(resource_group_id) 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_public_gateways_all_params_with_retries(self):
+ # Enable retries and run test_list_public_gateways_all_params.
_service.enable_retries()
- self.test_list_security_group_targets_all_params()
+ self.test_list_public_gateways_all_params()
- # Disable retries and run test_list_security_group_targets_all_params.
+ # Disable retries and run test_list_public_gateways_all_params.
_service.disable_retries()
- self.test_list_security_group_targets_all_params()
+ self.test_list_public_gateways_all_params()
@responses.activate
- def test_list_security_group_targets_required_params(self):
+ def test_list_public_gateways_required_params(self):
"""
- test_list_security_group_targets_required_params()
+ test_list_public_gateways_required_params()
"""
# Set up mock
- url = preprocess_url('/security_groups/testString/targets')
- mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/targets?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/targets?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "resource_type": "network_interface"}], "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", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "total_count": 132}'
responses.add(
responses.GET,
url,
@@ -31138,36 +31746,30 @@ def test_list_security_group_targets_required_params(self):
status=200,
)
- # Set up parameter values
- security_group_id = 'testString'
-
# Invoke method
- response = _service.list_security_group_targets(
- security_group_id,
- headers={},
- )
+ response = _service.list_public_gateways()
# Check for correct operation
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_public_gateways_required_params_with_retries(self):
+ # Enable retries and run test_list_public_gateways_required_params.
_service.enable_retries()
- self.test_list_security_group_targets_required_params()
+ self.test_list_public_gateways_required_params()
- # Disable retries and run test_list_security_group_targets_required_params.
+ # Disable retries and run test_list_public_gateways_required_params.
_service.disable_retries()
- self.test_list_security_group_targets_required_params()
+ self.test_list_public_gateways_required_params()
@responses.activate
- def test_list_security_group_targets_value_error(self):
+ def test_list_public_gateways_value_error(self):
"""
- test_list_security_group_targets_value_error()
+ test_list_public_gateways_value_error()
"""
# Set up mock
- url = preprocess_url('/security_groups/testString/targets')
- mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/targets?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/targets?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "resource_type": "network_interface"}], "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", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "total_count": 132}'
responses.add(
responses.GET,
url,
@@ -31176,36 +31778,32 @@ def test_list_security_group_targets_value_error(self):
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_targets(**req_copy)
+ _service.list_public_gateways(**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_public_gateways_value_error_with_retries(self):
+ # Enable retries and run test_list_public_gateways_value_error.
_service.enable_retries()
- self.test_list_security_group_targets_value_error()
+ self.test_list_public_gateways_value_error()
- # Disable retries and run test_list_security_group_targets_value_error.
+ # Disable retries and run test_list_public_gateways_value_error.
_service.disable_retries()
- self.test_list_security_group_targets_value_error()
+ self.test_list_public_gateways_value_error()
@responses.activate
- def test_list_security_group_targets_with_pager_get_next(self):
+ def test_list_public_gateways_with_pager_get_next(self):
"""
- test_list_security_group_targets_with_pager_get_next()
+ test_list_public_gateways_with_pager_get_next()
"""
# Set up a two-page mock response
- url = preprocess_url('/security_groups/testString/targets')
- mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"targets":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-instance-network-interface","resource_type":"network_interface"}]}'
- mock_response2 = '{"total_count":2,"limit":1,"targets":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-instance-network-interface","resource_type":"network_interface"}]}'
+ url = preprocess_url('/public_gateways')
+ mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"public_gateways":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::public-gateway:dc5431ef-1fc6-4861-adc9-a59d077d1241","floating_ip":{"address":"203.0.113.1","crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689","id":"39300233-9995-4806-89a5-3c1b6eb88689","name":"my-floating-ip"},"href":"https://us-south.iaas.cloud.ibm.com/v1/public_gateways/dc5431ef-1fc6-4861-adc9-a59d077d1241","id":"dc5431ef-1fc6-4861-adc9-a59d077d1241","name":"my-public-gateway","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"public_gateway","status":"available","vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}]}'
+ mock_response2 = '{"total_count":2,"limit":1,"public_gateways":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::public-gateway:dc5431ef-1fc6-4861-adc9-a59d077d1241","floating_ip":{"address":"203.0.113.1","crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689","id":"39300233-9995-4806-89a5-3c1b6eb88689","name":"my-floating-ip"},"href":"https://us-south.iaas.cloud.ibm.com/v1/public_gateways/dc5431ef-1fc6-4861-adc9-a59d077d1241","id":"dc5431ef-1fc6-4861-adc9-a59d077d1241","name":"my-public-gateway","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"public_gateway","status":"available","vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}]}'
responses.add(
responses.GET,
url,
@@ -31223,10 +31821,10 @@ def test_list_security_group_targets_with_pager_get_next(self):
# Exercise the pager class for this operation
all_results = []
- pager = SecurityGroupTargetsPager(
+ pager = PublicGatewaysPager(
client=_service,
- security_group_id='testString',
limit=10,
+ resource_group_id='testString',
)
while pager.has_next():
next_page = pager.get_next()
@@ -31235,14 +31833,14 @@ def test_list_security_group_targets_with_pager_get_next(self):
assert len(all_results) == 2
@responses.activate
- def test_list_security_group_targets_with_pager_get_all(self):
+ def test_list_public_gateways_with_pager_get_all(self):
"""
- test_list_security_group_targets_with_pager_get_all()
+ test_list_public_gateways_with_pager_get_all()
"""
# Set up a two-page mock response
- url = preprocess_url('/security_groups/testString/targets')
- mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"targets":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-instance-network-interface","resource_type":"network_interface"}]}'
- mock_response2 = '{"total_count":2,"limit":1,"targets":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-instance-network-interface","resource_type":"network_interface"}]}'
+ url = preprocess_url('/public_gateways')
+ mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"public_gateways":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::public-gateway:dc5431ef-1fc6-4861-adc9-a59d077d1241","floating_ip":{"address":"203.0.113.1","crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689","id":"39300233-9995-4806-89a5-3c1b6eb88689","name":"my-floating-ip"},"href":"https://us-south.iaas.cloud.ibm.com/v1/public_gateways/dc5431ef-1fc6-4861-adc9-a59d077d1241","id":"dc5431ef-1fc6-4861-adc9-a59d077d1241","name":"my-public-gateway","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"public_gateway","status":"available","vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}]}'
+ mock_response2 = '{"total_count":2,"limit":1,"public_gateways":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::public-gateway:dc5431ef-1fc6-4861-adc9-a59d077d1241","floating_ip":{"address":"203.0.113.1","crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689","id":"39300233-9995-4806-89a5-3c1b6eb88689","name":"my-floating-ip"},"href":"https://us-south.iaas.cloud.ibm.com/v1/public_gateways/dc5431ef-1fc6-4861-adc9-a59d077d1241","id":"dc5431ef-1fc6-4861-adc9-a59d077d1241","name":"my-public-gateway","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"public_gateway","status":"available","vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}]}'
responses.add(
responses.GET,
url,
@@ -31259,150 +31857,277 @@ def test_list_security_group_targets_with_pager_get_all(self):
)
# Exercise the pager class for this operation
- pager = SecurityGroupTargetsPager(
+ pager = PublicGatewaysPager(
client=_service,
- security_group_id='testString',
limit=10,
+ resource_group_id='testString',
)
all_results = pager.get_all()
assert all_results is not None
assert len(all_results) == 2
-class TestDeleteSecurityGroupTargetBinding:
+class TestCreatePublicGateway:
"""
- Test Class for delete_security_group_target_binding
+ Test Class for create_public_gateway
"""
@responses.activate
- def test_delete_security_group_target_binding_all_params(self):
+ def test_create_public_gateway_all_params(self):
"""
- delete_security_group_target_binding()
+ create_public_gateway()
"""
# Set up mock
- url = preprocess_url('/security_groups/testString/targets/testString')
+ 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", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
responses.add(
- responses.DELETE,
+ responses.POST,
url,
- status=204,
+ 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'
+
# Set up parameter values
- security_group_id = 'testString'
- id = 'testString'
+ 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
# Invoke method
- response = _service.delete_security_group_target_binding(
- security_group_id,
- id,
+ response = _service.create_public_gateway(
+ vpc,
+ zone,
+ floating_ip=floating_ip,
+ 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['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
- 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_create_public_gateway_all_params_with_retries(self):
+ # Enable retries and run test_create_public_gateway_all_params.
_service.enable_retries()
- self.test_delete_security_group_target_binding_all_params()
+ self.test_create_public_gateway_all_params()
- # Disable retries and run test_delete_security_group_target_binding_all_params.
+ # Disable retries and run test_create_public_gateway_all_params.
_service.disable_retries()
- self.test_delete_security_group_target_binding_all_params()
+ self.test_create_public_gateway_all_params()
@responses.activate
- def test_delete_security_group_target_binding_value_error(self):
+ def test_create_public_gateway_value_error(self):
"""
- test_delete_security_group_target_binding_value_error()
+ test_create_public_gateway_value_error()
"""
# Set up mock
- url = preprocess_url('/security_groups/testString/targets/testString')
+ 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", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
responses.add(
- responses.DELETE,
+ responses.POST,
url,
- status=204,
+ 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'
+
# Set up parameter values
- security_group_id = 'testString'
- id = 'testString'
+ 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
# Pass in all but one required param and check for a ValueError
req_param_dict = {
- "security_group_id": security_group_id,
- "id": id,
+ "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.delete_security_group_target_binding(**req_copy)
+ _service.create_public_gateway(**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_create_public_gateway_value_error_with_retries(self):
+ # Enable retries and run test_create_public_gateway_value_error.
_service.enable_retries()
- self.test_delete_security_group_target_binding_value_error()
+ self.test_create_public_gateway_value_error()
- # Disable retries and run test_delete_security_group_target_binding_value_error.
+ # Disable retries and run test_create_public_gateway_value_error.
_service.disable_retries()
- self.test_delete_security_group_target_binding_value_error()
+ self.test_create_public_gateway_value_error()
-class TestGetSecurityGroupTarget:
+class TestDeletePublicGateway:
"""
- Test Class for get_security_group_target
+ Test Class for delete_public_gateway
"""
@responses.activate
- def test_get_security_group_target_all_params(self):
+ def test_delete_public_gateway_all_params(self):
"""
- get_security_group_target()
+ delete_public_gateway()
"""
# Set up mock
- url = preprocess_url('/security_groups/testString/targets/testString')
- mock_response = '{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "resource_type": "network_interface"}'
+ url = preprocess_url('/public_gateways/testString')
responses.add(
- responses.GET,
+ 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_target(
- security_group_id,
+ response = _service.delete_public_gateway(
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_target_all_params_with_retries(self):
- # Enable retries and run test_get_security_group_target_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_get_security_group_target_all_params()
+ self.test_delete_public_gateway_all_params()
- # Disable retries and run test_get_security_group_target_all_params.
+ # Disable retries and run test_delete_public_gateway_all_params.
_service.disable_retries()
- self.test_get_security_group_target_all_params()
+ self.test_delete_public_gateway_all_params()
@responses.activate
- def test_get_security_group_target_value_error(self):
+ def test_delete_public_gateway_value_error(self):
"""
- test_get_security_group_target_value_error()
+ test_delete_public_gateway_value_error()
"""
# Set up mock
- url = preprocess_url('/security_groups/testString/targets/testString')
- mock_response = '{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "resource_type": "network_interface"}'
+ url = preprocess_url('/public_gateways/testString')
responses.add(
- responses.GET,
+ 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_public_gateway(**req_copy)
+
+ def test_delete_public_gateway_value_error_with_retries(self):
+ # Enable retries and run test_delete_public_gateway_value_error.
+ _service.enable_retries()
+ self.test_delete_public_gateway_value_error()
+
+ # Disable retries and run test_delete_public_gateway_value_error.
+ _service.disable_retries()
+ self.test_delete_public_gateway_value_error()
+
+
+class TestGetPublicGateway:
+ """
+ Test Class for get_public_gateway
+ """
+
+ @responses.activate
+ def test_get_public_gateway_all_params(self):
+ """
+ get_public_gateway()
+ """
+ # Set up mock
+ 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", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
+ responses.add(
+ responses.GET,
+ url,
+ body=mock_response,
+ content_type='application/json',
+ status=200,
+ )
+
+ # Set up parameter values
+ id = 'testString'
+
+ # Invoke method
+ response = _service.get_public_gateway(
+ id,
+ headers={},
+ )
+
+ # Check for correct operation
+ assert len(responses.calls) == 1
+ assert response.status_code == 200
+
+ 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_public_gateway_all_params()
+
+ # Disable retries and run test_get_public_gateway_all_params.
+ _service.disable_retries()
+ self.test_get_public_gateway_all_params()
+
+ @responses.activate
+ def test_get_public_gateway_value_error(self):
+ """
+ test_get_public_gateway_value_error()
+ """
+ # Set up mock
+ 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", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
+ responses.add(
+ responses.GET,
url,
body=mock_response,
content_type='application/json',
@@ -31410,121 +32135,130 @@ def test_get_security_group_target_value_error(self):
)
# 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_target(**req_copy)
+ _service.get_public_gateway(**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_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_target_value_error()
+ self.test_get_public_gateway_value_error()
- # Disable retries and run test_get_security_group_target_value_error.
+ # Disable retries and run test_get_public_gateway_value_error.
_service.disable_retries()
- self.test_get_security_group_target_value_error()
+ self.test_get_public_gateway_value_error()
-class TestCreateSecurityGroupTargetBinding:
+class TestUpdatePublicGateway:
"""
- Test Class for create_security_group_target_binding
+ Test Class for update_public_gateway
"""
@responses.activate
- def test_create_security_group_target_binding_all_params(self):
+ def test_update_public_gateway_all_params(self):
"""
- create_security_group_target_binding()
+ update_public_gateway()
"""
# Set up mock
- url = preprocess_url('/security_groups/testString/targets/testString')
- mock_response = '{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "resource_type": "network_interface"}'
+ 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", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
responses.add(
- responses.PUT,
+ responses.PATCH,
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'
+
# Set up parameter values
- security_group_id = 'testString'
id = 'testString'
+ public_gateway_patch = public_gateway_patch_model
# Invoke method
- response = _service.create_security_group_target_binding(
- security_group_id,
+ response = _service.update_public_gateway(
id,
+ public_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 == public_gateway_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_public_gateway_all_params_with_retries(self):
+ # Enable retries and run test_update_public_gateway_all_params.
_service.enable_retries()
- self.test_create_security_group_target_binding_all_params()
+ self.test_update_public_gateway_all_params()
- # Disable retries and run test_create_security_group_target_binding_all_params.
+ # Disable retries and run test_update_public_gateway_all_params.
_service.disable_retries()
- self.test_create_security_group_target_binding_all_params()
+ self.test_update_public_gateway_all_params()
@responses.activate
- def test_create_security_group_target_binding_value_error(self):
+ def test_update_public_gateway_value_error(self):
"""
- test_create_security_group_target_binding_value_error()
+ test_update_public_gateway_value_error()
"""
# Set up mock
- url = preprocess_url('/security_groups/testString/targets/testString')
- mock_response = '{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "resource_type": "network_interface"}'
+ 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", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
responses.add(
- responses.PUT,
+ responses.PATCH,
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'
+
# Set up parameter values
- security_group_id = 'testString'
id = 'testString'
+ public_gateway_patch = public_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,
+ "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.create_security_group_target_binding(**req_copy)
+ _service.update_public_gateway(**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_public_gateway_value_error_with_retries(self):
+ # Enable retries and run test_update_public_gateway_value_error.
_service.enable_retries()
- self.test_create_security_group_target_binding_value_error()
+ self.test_update_public_gateway_value_error()
- # Disable retries and run test_create_security_group_target_binding_value_error.
+ # Disable retries and run test_update_public_gateway_value_error.
_service.disable_retries()
- self.test_create_security_group_target_binding_value_error()
+ self.test_update_public_gateway_value_error()
# endregion
##############################################################################
-# End of Service: SecurityGroups
+# End of Service: PublicGateways
##############################################################################
##############################################################################
-# Start of Service: VPNGateways
+# Start of Service: FloatingIPs
##############################################################################
# region
@@ -31575,19 +32309,19 @@ def test_new_instance_required_param_none(self):
)
-class TestListIkePolicies:
+class TestListFloatingIps:
"""
- Test Class for list_ike_policies
+ Test Class for list_floating_ips
"""
@responses.activate
- def test_list_ike_policies_all_params(self):
+ def test_list_floating_ips_all_params(self):
"""
- list_ike_policies()
+ list_floating_ips()
"""
# Set up mock
- 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}'
+ 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-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}'
responses.add(
responses.GET,
url,
@@ -31599,11 +32333,23 @@ def test_list_ike_policies_all_params(self):
# Set up parameter values
start = 'testString'
limit = 50
+ resource_group_id = 'testString'
+ sort = 'name'
+ target_id = 'testString'
+ target_crn = 'crn:v1:bluemix:public:is:us-south:a/123456::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727'
+ target_name = 'my-resource'
+ target_resource_type = 'testString'
# Invoke method
- response = _service.list_ike_policies(
+ response = _service.list_floating_ips(
start=start,
limit=limit,
+ resource_group_id=resource_group_id,
+ sort=sort,
+ target_id=target_id,
+ target_crn=target_crn,
+ target_name=target_name,
+ target_resource_type=target_resource_type,
headers={},
)
@@ -31615,24 +32361,30 @@ 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 'sort={}'.format(sort) in query_string
+ assert 'target.id={}'.format(target_id) in query_string
+ assert 'target.crn={}'.format(target_crn) in query_string
+ assert 'target.name={}'.format(target_name) in query_string
+ assert 'target.resource_type={}'.format(target_resource_type) 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_floating_ips_all_params_with_retries(self):
+ # Enable retries and run test_list_floating_ips_all_params.
_service.enable_retries()
- self.test_list_ike_policies_all_params()
+ self.test_list_floating_ips_all_params()
- # Disable retries and run test_list_ike_policies_all_params.
+ # Disable retries and run test_list_floating_ips_all_params.
_service.disable_retries()
- self.test_list_ike_policies_all_params()
+ self.test_list_floating_ips_all_params()
@responses.activate
- def test_list_ike_policies_required_params(self):
+ def test_list_floating_ips_required_params(self):
"""
- test_list_ike_policies_required_params()
+ test_list_floating_ips_required_params()
"""
# Set up mock
- 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}'
+ 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-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}'
responses.add(
responses.GET,
url,
@@ -31642,29 +32394,29 @@ def test_list_ike_policies_required_params(self):
)
# Invoke method
- response = _service.list_ike_policies()
+ response = _service.list_floating_ips()
# 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_floating_ips_required_params_with_retries(self):
+ # Enable retries and run test_list_floating_ips_required_params.
_service.enable_retries()
- self.test_list_ike_policies_required_params()
+ self.test_list_floating_ips_required_params()
- # Disable retries and run test_list_ike_policies_required_params.
+ # Disable retries and run test_list_floating_ips_required_params.
_service.disable_retries()
- self.test_list_ike_policies_required_params()
+ self.test_list_floating_ips_required_params()
@responses.activate
- def test_list_ike_policies_value_error(self):
+ def test_list_floating_ips_value_error(self):
"""
- test_list_ike_policies_value_error()
+ test_list_floating_ips_value_error()
"""
# Set up mock
- 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}'
+ 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-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}'
responses.add(
responses.GET,
url,
@@ -31679,26 +32431,26 @@ 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_floating_ips(**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_floating_ips_value_error_with_retries(self):
+ # Enable retries and run test_list_floating_ips_value_error.
_service.enable_retries()
- self.test_list_ike_policies_value_error()
+ self.test_list_floating_ips_value_error()
- # Disable retries and run test_list_ike_policies_value_error.
+ # Disable retries and run test_list_floating_ips_value_error.
_service.disable_retries()
- self.test_list_ike_policies_value_error()
+ self.test_list_floating_ips_value_error()
@responses.activate
- def test_list_ike_policies_with_pager_get_next(self):
+ def test_list_floating_ips_with_pager_get_next(self):
"""
- test_list_ike_policies_with_pager_get_next()
+ test_list_floating_ips_with_pager_get_next()
"""
# Set up a two-page mock response
- url = preprocess_url('/ike_policies')
- mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"ike_policies":[{"authentication_algorithm":"md5","connections":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b","id":"a10a5771-dc23-442c-8460-c3601d8542f7","name":"my-vpn-connection","resource_type":"vpn_gateway_connection"}],"created_at":"2019-01-01T12:00:00.000Z","dh_group":14,"encryption_algorithm":"aes128","href":"https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b","id":"ddf51bec-3424-11e8-b467-0ed5f89f718b","ike_version":1,"key_lifetime":28800,"name":"my-ike-policy","negotiation_mode":"main","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"ike_policy"}],"limit":1}'
- mock_response2 = '{"total_count":2,"ike_policies":[{"authentication_algorithm":"md5","connections":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b","id":"a10a5771-dc23-442c-8460-c3601d8542f7","name":"my-vpn-connection","resource_type":"vpn_gateway_connection"}],"created_at":"2019-01-01T12:00:00.000Z","dh_group":14,"encryption_algorithm":"aes128","href":"https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b","id":"ddf51bec-3424-11e8-b467-0ed5f89f718b","ike_version":1,"key_lifetime":28800,"name":"my-ike-policy","negotiation_mode":"main","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"ike_policy"}],"limit":1}'
+ url = preprocess_url('/floating_ips')
+ mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"floating_ips":[{"address":"203.0.113.1","created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689","href":"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689","id":"39300233-9995-4806-89a5-3c1b6eb88689","name":"my-floating-ip","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"status":"available","target":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-instance-network-interface","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"network_interface"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}]}'
+ mock_response2 = '{"total_count":2,"limit":1,"floating_ips":[{"address":"203.0.113.1","created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689","href":"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689","id":"39300233-9995-4806-89a5-3c1b6eb88689","name":"my-floating-ip","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"status":"available","target":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-instance-network-interface","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"network_interface"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}]}'
responses.add(
responses.GET,
url,
@@ -31716,9 +32468,15 @@ def test_list_ike_policies_with_pager_get_next(self):
# Exercise the pager class for this operation
all_results = []
- pager = IkePoliciesPager(
+ pager = FloatingIpsPager(
client=_service,
limit=10,
+ resource_group_id='testString',
+ sort='name',
+ target_id='testString',
+ target_crn='crn:v1:bluemix:public:is:us-south:a/123456::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727',
+ target_name='my-resource',
+ target_resource_type='testString',
)
while pager.has_next():
next_page = pager.get_next()
@@ -31727,14 +32485,14 @@ def test_list_ike_policies_with_pager_get_next(self):
assert len(all_results) == 2
@responses.activate
- def test_list_ike_policies_with_pager_get_all(self):
+ def test_list_floating_ips_with_pager_get_all(self):
"""
- test_list_ike_policies_with_pager_get_all()
+ test_list_floating_ips_with_pager_get_all()
"""
# Set up a two-page mock response
- url = preprocess_url('/ike_policies')
- mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"ike_policies":[{"authentication_algorithm":"md5","connections":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b","id":"a10a5771-dc23-442c-8460-c3601d8542f7","name":"my-vpn-connection","resource_type":"vpn_gateway_connection"}],"created_at":"2019-01-01T12:00:00.000Z","dh_group":14,"encryption_algorithm":"aes128","href":"https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b","id":"ddf51bec-3424-11e8-b467-0ed5f89f718b","ike_version":1,"key_lifetime":28800,"name":"my-ike-policy","negotiation_mode":"main","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"ike_policy"}],"limit":1}'
- mock_response2 = '{"total_count":2,"ike_policies":[{"authentication_algorithm":"md5","connections":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b","id":"a10a5771-dc23-442c-8460-c3601d8542f7","name":"my-vpn-connection","resource_type":"vpn_gateway_connection"}],"created_at":"2019-01-01T12:00:00.000Z","dh_group":14,"encryption_algorithm":"aes128","href":"https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b","id":"ddf51bec-3424-11e8-b467-0ed5f89f718b","ike_version":1,"key_lifetime":28800,"name":"my-ike-policy","negotiation_mode":"main","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"ike_policy"}],"limit":1}'
+ url = preprocess_url('/floating_ips')
+ mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"floating_ips":[{"address":"203.0.113.1","created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689","href":"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689","id":"39300233-9995-4806-89a5-3c1b6eb88689","name":"my-floating-ip","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"status":"available","target":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-instance-network-interface","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"network_interface"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}]}'
+ mock_response2 = '{"total_count":2,"limit":1,"floating_ips":[{"address":"203.0.113.1","created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689","href":"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689","id":"39300233-9995-4806-89a5-3c1b6eb88689","name":"my-floating-ip","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"status":"available","target":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-instance-network-interface","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"network_interface"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}]}'
responses.add(
responses.GET,
url,
@@ -31751,28 +32509,34 @@ def test_list_ike_policies_with_pager_get_all(self):
)
# Exercise the pager class for this operation
- pager = IkePoliciesPager(
+ pager = FloatingIpsPager(
client=_service,
limit=10,
+ resource_group_id='testString',
+ sort='name',
+ target_id='testString',
+ target_crn='crn:v1:bluemix:public:is:us-south:a/123456::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727',
+ target_name='my-resource',
+ target_resource_type='testString',
)
all_results = pager.get_all()
assert all_results is not None
assert len(all_results) == 2
-class TestCreateIkePolicy:
+class TestCreateFloatingIp:
"""
- Test Class for create_ike_policy
+ Test Class for create_floating_ip
"""
@responses.activate
- def test_create_ike_policy_all_params(self):
+ def test_create_floating_ip_all_params(self):
"""
- create_ike_policy()
+ create_floating_ip()
"""
# Set up mock
- 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"}'
+ 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-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
responses.add(
responses.POST,
url,
@@ -31785,24 +32549,22 @@ def test_create_ike_policy_all_params(self):
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
- authentication_algorithm = 'sha256'
- dh_group = 14
- encryption_algorithm = 'aes128'
- ike_version = 1
- key_lifetime = 28800
- name = 'my-ike-policy'
- resource_group = resource_group_identity_model
+ floating_ip_prototype = floating_ip_prototype_model
# Invoke method
- response = _service.create_ike_policy(
- authentication_algorithm,
- dh_group,
- encryption_algorithm,
- ike_version,
- key_lifetime=key_lifetime,
- name=name,
- resource_group=resource_group,
+ response = _service.create_floating_ip(
+ floating_ip_prototype,
headers={},
)
@@ -31811,31 +32573,25 @@ 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'] == 'sha256'
- 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
+ assert req_body == floating_ip_prototype
- def test_create_ike_policy_all_params_with_retries(self):
- # Enable retries and run test_create_ike_policy_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_create_ike_policy_all_params()
+ self.test_create_floating_ip_all_params()
- # Disable retries and run test_create_ike_policy_all_params.
+ # Disable retries and run test_create_floating_ip_all_params.
_service.disable_retries()
- self.test_create_ike_policy_all_params()
+ self.test_create_floating_ip_all_params()
@responses.activate
- def test_create_ike_policy_value_error(self):
+ def test_create_floating_ip_value_error(self):
"""
- test_create_ike_policy_value_error()
+ test_create_floating_ip_value_error()
"""
# Set up mock
- 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"}'
+ 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-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
responses.add(
responses.POST,
url,
@@ -31848,49 +32604,50 @@ def test_create_ike_policy_value_error(self):
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
- authentication_algorithm = 'sha256'
- dh_group = 14
- encryption_algorithm = 'aes128'
- ike_version = 1
- key_lifetime = 28800
- name = 'my-ike-policy'
- resource_group = resource_group_identity_model
+ floating_ip_prototype = floating_ip_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,
+ "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.create_ike_policy(**req_copy)
+ _service.create_floating_ip(**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_floating_ip_value_error_with_retries(self):
+ # Enable retries and run test_create_floating_ip_value_error.
_service.enable_retries()
- self.test_create_ike_policy_value_error()
+ self.test_create_floating_ip_value_error()
- # Disable retries and run test_create_ike_policy_value_error.
+ # Disable retries and run test_create_floating_ip_value_error.
_service.disable_retries()
- self.test_create_ike_policy_value_error()
+ self.test_create_floating_ip_value_error()
-class TestDeleteIkePolicy:
+class TestDeleteFloatingIp:
"""
- Test Class for delete_ike_policy
+ Test Class for delete_floating_ip
"""
@responses.activate
- def test_delete_ike_policy_all_params(self):
+ def test_delete_floating_ip_all_params(self):
"""
- delete_ike_policy()
+ delete_floating_ip()
"""
# Set up mock
- url = preprocess_url('/ike_policies/testString')
+ url = preprocess_url('/floating_ips/testString')
responses.add(
responses.DELETE,
url,
@@ -31901,7 +32658,7 @@ def test_delete_ike_policy_all_params(self):
id = 'testString'
# Invoke method
- response = _service.delete_ike_policy(
+ response = _service.delete_floating_ip(
id,
headers={},
)
@@ -31910,22 +32667,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_floating_ip_all_params_with_retries(self):
+ # Enable retries and run test_delete_floating_ip_all_params.
_service.enable_retries()
- self.test_delete_ike_policy_all_params()
+ self.test_delete_floating_ip_all_params()
- # Disable retries and run test_delete_ike_policy_all_params.
+ # Disable retries and run test_delete_floating_ip_all_params.
_service.disable_retries()
- self.test_delete_ike_policy_all_params()
+ self.test_delete_floating_ip_all_params()
@responses.activate
- def test_delete_ike_policy_value_error(self):
+ def test_delete_floating_ip_value_error(self):
"""
- test_delete_ike_policy_value_error()
+ test_delete_floating_ip_value_error()
"""
# Set up mock
- url = preprocess_url('/ike_policies/testString')
+ url = preprocess_url('/floating_ips/testString')
responses.add(
responses.DELETE,
url,
@@ -31942,31 +32699,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_floating_ip(**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_floating_ip_value_error_with_retries(self):
+ # Enable retries and run test_delete_floating_ip_value_error.
_service.enable_retries()
- self.test_delete_ike_policy_value_error()
+ self.test_delete_floating_ip_value_error()
- # Disable retries and run test_delete_ike_policy_value_error.
+ # Disable retries and run test_delete_floating_ip_value_error.
_service.disable_retries()
- self.test_delete_ike_policy_value_error()
+ self.test_delete_floating_ip_value_error()
-class TestGetIkePolicy:
+class TestGetFloatingIp:
"""
- Test Class for get_ike_policy
+ Test Class for get_floating_ip
"""
@responses.activate
- def test_get_ike_policy_all_params(self):
+ def test_get_floating_ip_all_params(self):
"""
- get_ike_policy()
+ get_floating_ip()
"""
# Set up mock
- 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"}'
+ 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-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
responses.add(
responses.GET,
url,
@@ -31979,7 +32736,7 @@ def test_get_ike_policy_all_params(self):
id = 'testString'
# Invoke method
- response = _service.get_ike_policy(
+ response = _service.get_floating_ip(
id,
headers={},
)
@@ -31988,23 +32745,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_floating_ip_all_params_with_retries(self):
+ # Enable retries and run test_get_floating_ip_all_params.
_service.enable_retries()
- self.test_get_ike_policy_all_params()
+ self.test_get_floating_ip_all_params()
- # Disable retries and run test_get_ike_policy_all_params.
+ # Disable retries and run test_get_floating_ip_all_params.
_service.disable_retries()
- self.test_get_ike_policy_all_params()
+ self.test_get_floating_ip_all_params()
@responses.activate
- def test_get_ike_policy_value_error(self):
+ def test_get_floating_ip_value_error(self):
"""
- test_get_ike_policy_value_error()
+ test_get_floating_ip_value_error()
"""
# Set up mock
- 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"}'
+ 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-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
responses.add(
responses.GET,
url,
@@ -32023,31 +32780,31 @@ 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_floating_ip(**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_floating_ip_value_error_with_retries(self):
+ # Enable retries and run test_get_floating_ip_value_error.
_service.enable_retries()
- self.test_get_ike_policy_value_error()
+ self.test_get_floating_ip_value_error()
- # Disable retries and run test_get_ike_policy_value_error.
+ # Disable retries and run test_get_floating_ip_value_error.
_service.disable_retries()
- self.test_get_ike_policy_value_error()
+ self.test_get_floating_ip_value_error()
-class TestUpdateIkePolicy:
+class TestUpdateFloatingIp:
"""
- Test Class for update_ike_policy
+ Test Class for update_floating_ip
"""
@responses.activate
- def test_update_ike_policy_all_params(self):
+ def test_update_floating_ip_all_params(self):
"""
- update_ike_policy()
+ update_floating_ip()
"""
# Set up mock
- 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"}'
+ 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-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
responses.add(
responses.PATCH,
url,
@@ -32056,23 +32813,23 @@ def test_update_ike_policy_all_params(self):
status=200,
)
- # Construct a dict representation of a IKEPolicyPatch model
- ike_policy_patch_model = {}
- ike_policy_patch_model['authentication_algorithm'] = 'sha256'
- 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 FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityById 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'
- ike_policy_patch = ike_policy_patch_model
+ floating_ip_patch = floating_ip_patch_model
# Invoke method
- response = _service.update_ike_policy(
+ response = _service.update_floating_ip(
id,
- ike_policy_patch,
+ floating_ip_patch,
headers={},
)
@@ -32081,25 +32838,25 @@ 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 == floating_ip_patch
- def test_update_ike_policy_all_params_with_retries(self):
- # Enable retries and run test_update_ike_policy_all_params.
+ 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_ike_policy_all_params()
+ self.test_update_floating_ip_all_params()
- # Disable retries and run test_update_ike_policy_all_params.
+ # Disable retries and run test_update_floating_ip_all_params.
_service.disable_retries()
- self.test_update_ike_policy_all_params()
+ self.test_update_floating_ip_all_params()
@responses.activate
- def test_update_ike_policy_value_error(self):
+ def test_update_floating_ip_value_error(self):
"""
- test_update_ike_policy_value_error()
+ test_update_floating_ip_value_error()
"""
# Set up mock
- 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"}'
+ 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-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
responses.add(
responses.PATCH,
url,
@@ -32108,133 +32865,109 @@ def test_update_ike_policy_value_error(self):
status=200,
)
- # Construct a dict representation of a IKEPolicyPatch model
- ike_policy_patch_model = {}
- ike_policy_patch_model['authentication_algorithm'] = 'sha256'
- 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 FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityById 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'
- ike_policy_patch = ike_policy_patch_model
+ floating_ip_patch = floating_ip_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,
+ "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_ike_policy(**req_copy)
+ _service.update_floating_ip(**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_floating_ip_value_error_with_retries(self):
+ # Enable retries and run test_update_floating_ip_value_error.
_service.enable_retries()
- self.test_update_ike_policy_value_error()
+ self.test_update_floating_ip_value_error()
- # Disable retries and run test_update_ike_policy_value_error.
+ # Disable retries and run test_update_floating_ip_value_error.
_service.disable_retries()
- self.test_update_ike_policy_value_error()
+ self.test_update_floating_ip_value_error()
-class TestListIkePolicyConnections:
+# endregion
+##############################################################################
+# End of Service: FloatingIPs
+##############################################################################
+
+##############################################################################
+# Start of Service: NetworkACLs
+##############################################################################
+# region
+
+
+class TestNewInstance:
"""
- Test Class for list_ike_policy_connections
+ Test Class for new_instance
"""
- @responses.activate
- def test_list_ike_policy_connections_all_params(self):
+ def test_new_instance(self):
"""
- list_ike_policy_connections()
+ new_instance()
"""
- # Set up mock
- 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", "status_reasons": [{"code": "cannot_authenticate_connection", "message": "Failed to authenticate a connection because of mismatched IKE ID and PSK.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}], "routing_protocol": "none", "tunnels": [{"public_ip": {"address": "192.168.3.4"}, "status": "down", "status_reasons": [{"code": "cannot_authenticate_connection", "message": "Failed to authenticate a connection because of mismatched IKE ID and PSK.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}]}]}]}'
- responses.add(
- responses.GET,
- url,
- body=mock_response,
- content_type='application/json',
- status=200,
- )
-
- # Set up parameter values
- id = 'testString'
+ os.environ['TEST_SERVICE_AUTH_TYPE'] = 'noAuth'
- # Invoke method
- response = _service.list_ike_policy_connections(
- id,
- headers={},
+ service = VpcV1.new_instance(
+ version=version,
+ service_name='TEST_SERVICE',
)
- # Check for correct operation
- 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.
- _service.enable_retries()
- self.test_list_ike_policy_connections_all_params()
-
- # Disable retries and run test_list_ike_policy_connections_all_params.
- _service.disable_retries()
- self.test_list_ike_policy_connections_all_params()
+ assert service is not None
+ assert isinstance(service, VpcV1)
- @responses.activate
- def test_list_ike_policy_connections_value_error(self):
+ def test_new_instance_without_authenticator(self):
"""
- test_list_ike_policy_connections_value_error()
+ new_instance_without_authenticator()
"""
- # Set up mock
- 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", "status_reasons": [{"code": "cannot_authenticate_connection", "message": "Failed to authenticate a connection because of mismatched IKE ID and PSK.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}], "routing_protocol": "none", "tunnels": [{"public_ip": {"address": "192.168.3.4"}, "status": "down", "status_reasons": [{"code": "cannot_authenticate_connection", "message": "Failed to authenticate a connection because of mismatched IKE ID and PSK.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}]}]}]}'
- 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_ike_policy_connections(**req_copy)
+ with pytest.raises(ValueError, match='authenticator must be provided'):
+ service = VpcV1.new_instance(
+ version=version,
+ service_name='TEST_SERVICE_NOT_FOUND',
+ )
- 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_ike_policy_connections_value_error()
+ 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()
- # Disable retries and run test_list_ike_policy_connections_value_error.
- _service.disable_retries()
- self.test_list_ike_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 TestListIpsecPolicies:
+class TestListNetworkAcls:
"""
- Test Class for list_ipsec_policies
+ Test Class for list_network_acls
"""
@responses.activate
- def test_list_ipsec_policies_all_params(self):
+ def test_list_network_acls_all_params(self):
"""
- list_ipsec_policies()
+ list_network_acls()
"""
# 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": "disabled", "connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "encapsulation_mode": "tunnel", "encryption_algorithm": "aes128", "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "key_lifetime": 3600, "name": "my-ipsec-policy", "pfs": "disabled", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "ipsec_policy", "transform_protocol": "esp"}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies?start=9d5a91a3e2cbd233b5a5b33436855ed&limit=20"}, "total_count": 132}'
+ 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-1", "source": "192.168.3.0/24", "destination_port_max": 22, "destination_port_min": 22, "protocol": "udp", "source_port_max": 65535, "source_port_min": 49152}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}], "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}'
responses.add(
responses.GET,
url,
@@ -32246,11 +32979,13 @@ def test_list_ipsec_policies_all_params(self):
# Set up parameter values
start = 'testString'
limit = 50
+ resource_group_id = 'testString'
# Invoke method
- response = _service.list_ipsec_policies(
+ response = _service.list_network_acls(
start=start,
limit=limit,
+ resource_group_id=resource_group_id,
headers={},
)
@@ -32262,24 +32997,25 @@ def test_list_ipsec_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
- def test_list_ipsec_policies_all_params_with_retries(self):
- # Enable retries and run test_list_ipsec_policies_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_ipsec_policies_all_params()
+ self.test_list_network_acls_all_params()
- # Disable retries and run test_list_ipsec_policies_all_params.
+ # Disable retries and run test_list_network_acls_all_params.
_service.disable_retries()
- self.test_list_ipsec_policies_all_params()
+ self.test_list_network_acls_all_params()
@responses.activate
- def test_list_ipsec_policies_required_params(self):
+ def test_list_network_acls_required_params(self):
"""
- test_list_ipsec_policies_required_params()
+ test_list_network_acls_required_params()
"""
# 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": "disabled", "connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "encapsulation_mode": "tunnel", "encryption_algorithm": "aes128", "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "key_lifetime": 3600, "name": "my-ipsec-policy", "pfs": "disabled", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "ipsec_policy", "transform_protocol": "esp"}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies?start=9d5a91a3e2cbd233b5a5b33436855ed&limit=20"}, "total_count": 132}'
+ 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-1", "source": "192.168.3.0/24", "destination_port_max": 22, "destination_port_min": 22, "protocol": "udp", "source_port_max": 65535, "source_port_min": 49152}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}], "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}'
responses.add(
responses.GET,
url,
@@ -32289,29 +33025,29 @@ def test_list_ipsec_policies_required_params(self):
)
# Invoke method
- response = _service.list_ipsec_policies()
+ response = _service.list_network_acls()
# 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_list_network_acls_required_params_with_retries(self):
+ # Enable retries and run test_list_network_acls_required_params.
_service.enable_retries()
- self.test_list_ipsec_policies_required_params()
+ self.test_list_network_acls_required_params()
- # Disable retries and run test_list_ipsec_policies_required_params.
+ # Disable retries and run test_list_network_acls_required_params.
_service.disable_retries()
- self.test_list_ipsec_policies_required_params()
+ self.test_list_network_acls_required_params()
@responses.activate
- def test_list_ipsec_policies_value_error(self):
+ def test_list_network_acls_value_error(self):
"""
- test_list_ipsec_policies_value_error()
+ test_list_network_acls_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": "disabled", "connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "encapsulation_mode": "tunnel", "encryption_algorithm": "aes128", "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "key_lifetime": 3600, "name": "my-ipsec-policy", "pfs": "disabled", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "ipsec_policy", "transform_protocol": "esp"}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies?start=9d5a91a3e2cbd233b5a5b33436855ed&limit=20"}, "total_count": 132}'
+ 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-1", "source": "192.168.3.0/24", "destination_port_max": 22, "destination_port_min": 22, "protocol": "udp", "source_port_max": 65535, "source_port_min": 49152}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}], "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}'
responses.add(
responses.GET,
url,
@@ -32326,26 +33062,26 @@ def test_list_ipsec_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_ipsec_policies(**req_copy)
+ _service.list_network_acls(**req_copy)
- def test_list_ipsec_policies_value_error_with_retries(self):
- # Enable retries and run test_list_ipsec_policies_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_ipsec_policies_value_error()
+ self.test_list_network_acls_value_error()
- # Disable retries and run test_list_ipsec_policies_value_error.
+ # Disable retries and run test_list_network_acls_value_error.
_service.disable_retries()
- self.test_list_ipsec_policies_value_error()
+ self.test_list_network_acls_value_error()
@responses.activate
- def test_list_ipsec_policies_with_pager_get_next(self):
+ def test_list_network_acls_with_pager_get_next(self):
"""
- test_list_ipsec_policies_with_pager_get_next()
+ test_list_network_acls_with_pager_get_next()
"""
# Set up a two-page mock response
- url = preprocess_url('/ipsec_policies')
- mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"ipsec_policies":[{"authentication_algorithm":"disabled","connections":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b","id":"a10a5771-dc23-442c-8460-c3601d8542f7","name":"my-vpn-connection","resource_type":"vpn_gateway_connection"}],"created_at":"2019-01-01T12:00:00.000Z","encapsulation_mode":"tunnel","encryption_algorithm":"aes128","href":"https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b","id":"ddf51bec-3424-11e8-b467-0ed5f89f718b","key_lifetime":3600,"name":"my-ipsec-policy","pfs":"disabled","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"ipsec_policy","transform_protocol":"esp"}],"total_count":2,"limit":1}'
- mock_response2 = '{"ipsec_policies":[{"authentication_algorithm":"disabled","connections":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b","id":"a10a5771-dc23-442c-8460-c3601d8542f7","name":"my-vpn-connection","resource_type":"vpn_gateway_connection"}],"created_at":"2019-01-01T12:00:00.000Z","encapsulation_mode":"tunnel","encryption_algorithm":"aes128","href":"https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b","id":"ddf51bec-3424-11e8-b467-0ed5f89f718b","key_lifetime":3600,"name":"my-ipsec-policy","pfs":"disabled","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"ipsec_policy","transform_protocol":"esp"}],"total_count":2,"limit":1}'
+ url = preprocess_url('/network_acls')
+ mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"network_acls":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf","href":"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf","id":"a4e28308-8ee7-46ab-8108-9f881f22bdbf","name":"my-network-acl","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"rules":[{"action":"allow","before":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9","id":"8daca77a-4980-4d33-8f3e-7038797be8f9","name":"my-rule-1"},"created_at":"2019-01-01T12:00:00.000Z","destination":"192.168.3.0/24","direction":"inbound","href":"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9","id":"8daca77a-4980-4d33-8f3e-7038797be8f9","ip_version":"ipv4","name":"my-rule-1","source":"192.168.3.0/24","destination_port_max":22,"destination_port_min":22,"protocol":"udp","source_port_max":65535,"source_port_min":49152}],"subnets":[{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}],"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"}}],"total_count":2,"limit":1}'
+ mock_response2 = '{"network_acls":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf","href":"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf","id":"a4e28308-8ee7-46ab-8108-9f881f22bdbf","name":"my-network-acl","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"rules":[{"action":"allow","before":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9","id":"8daca77a-4980-4d33-8f3e-7038797be8f9","name":"my-rule-1"},"created_at":"2019-01-01T12:00:00.000Z","destination":"192.168.3.0/24","direction":"inbound","href":"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9","id":"8daca77a-4980-4d33-8f3e-7038797be8f9","ip_version":"ipv4","name":"my-rule-1","source":"192.168.3.0/24","destination_port_max":22,"destination_port_min":22,"protocol":"udp","source_port_max":65535,"source_port_min":49152}],"subnets":[{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}],"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"}}],"total_count":2,"limit":1}'
responses.add(
responses.GET,
url,
@@ -32363,9 +33099,10 @@ def test_list_ipsec_policies_with_pager_get_next(self):
# Exercise the pager class for this operation
all_results = []
- pager = IpsecPoliciesPager(
+ pager = NetworkAclsPager(
client=_service,
limit=10,
+ resource_group_id='testString',
)
while pager.has_next():
next_page = pager.get_next()
@@ -32374,14 +33111,14 @@ def test_list_ipsec_policies_with_pager_get_next(self):
assert len(all_results) == 2
@responses.activate
- def test_list_ipsec_policies_with_pager_get_all(self):
+ def test_list_network_acls_with_pager_get_all(self):
"""
- test_list_ipsec_policies_with_pager_get_all()
+ test_list_network_acls_with_pager_get_all()
"""
# Set up a two-page mock response
- url = preprocess_url('/ipsec_policies')
- mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"ipsec_policies":[{"authentication_algorithm":"disabled","connections":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b","id":"a10a5771-dc23-442c-8460-c3601d8542f7","name":"my-vpn-connection","resource_type":"vpn_gateway_connection"}],"created_at":"2019-01-01T12:00:00.000Z","encapsulation_mode":"tunnel","encryption_algorithm":"aes128","href":"https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b","id":"ddf51bec-3424-11e8-b467-0ed5f89f718b","key_lifetime":3600,"name":"my-ipsec-policy","pfs":"disabled","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"ipsec_policy","transform_protocol":"esp"}],"total_count":2,"limit":1}'
- mock_response2 = '{"ipsec_policies":[{"authentication_algorithm":"disabled","connections":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b","id":"a10a5771-dc23-442c-8460-c3601d8542f7","name":"my-vpn-connection","resource_type":"vpn_gateway_connection"}],"created_at":"2019-01-01T12:00:00.000Z","encapsulation_mode":"tunnel","encryption_algorithm":"aes128","href":"https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b","id":"ddf51bec-3424-11e8-b467-0ed5f89f718b","key_lifetime":3600,"name":"my-ipsec-policy","pfs":"disabled","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"ipsec_policy","transform_protocol":"esp"}],"total_count":2,"limit":1}'
+ url = preprocess_url('/network_acls')
+ mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"network_acls":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf","href":"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf","id":"a4e28308-8ee7-46ab-8108-9f881f22bdbf","name":"my-network-acl","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"rules":[{"action":"allow","before":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9","id":"8daca77a-4980-4d33-8f3e-7038797be8f9","name":"my-rule-1"},"created_at":"2019-01-01T12:00:00.000Z","destination":"192.168.3.0/24","direction":"inbound","href":"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9","id":"8daca77a-4980-4d33-8f3e-7038797be8f9","ip_version":"ipv4","name":"my-rule-1","source":"192.168.3.0/24","destination_port_max":22,"destination_port_min":22,"protocol":"udp","source_port_max":65535,"source_port_min":49152}],"subnets":[{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}],"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"}}],"total_count":2,"limit":1}'
+ mock_response2 = '{"network_acls":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf","href":"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf","id":"a4e28308-8ee7-46ab-8108-9f881f22bdbf","name":"my-network-acl","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"rules":[{"action":"allow","before":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9","id":"8daca77a-4980-4d33-8f3e-7038797be8f9","name":"my-rule-1"},"created_at":"2019-01-01T12:00:00.000Z","destination":"192.168.3.0/24","direction":"inbound","href":"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9","id":"8daca77a-4980-4d33-8f3e-7038797be8f9","ip_version":"ipv4","name":"my-rule-1","source":"192.168.3.0/24","destination_port_max":22,"destination_port_min":22,"protocol":"udp","source_port_max":65535,"source_port_min":49152}],"subnets":[{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}],"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"}}],"total_count":2,"limit":1}'
responses.add(
responses.GET,
url,
@@ -32398,28 +33135,29 @@ def test_list_ipsec_policies_with_pager_get_all(self):
)
# Exercise the pager class for this operation
- pager = IpsecPoliciesPager(
+ pager = NetworkAclsPager(
client=_service,
limit=10,
+ resource_group_id='testString',
)
all_results = pager.get_all()
assert all_results is not None
assert len(all_results) == 2
-class TestCreateIpsecPolicy:
+class TestCreateNetworkAcl:
"""
- Test Class for create_ipsec_policy
+ Test Class for create_network_acl
"""
@responses.activate
- def test_create_ipsec_policy_all_params(self):
+ def test_create_network_acl_all_params(self):
"""
- create_ipsec_policy()
+ create_network_acl()
"""
# Set up mock
- url = preprocess_url('/ipsec_policies')
- mock_response = '{"authentication_algorithm": "disabled", "connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "encapsulation_mode": "tunnel", "encryption_algorithm": "aes128", "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "key_lifetime": 3600, "name": "my-ipsec-policy", "pfs": "disabled", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "ipsec_policy", "transform_protocol": "esp"}'
+ 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-1", "source": "192.168.3.0/24", "destination_port_max": 22, "destination_port_min": 22, "protocol": "udp", "source_port_max": 65535, "source_port_min": 49152}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}'
responses.add(
responses.POST,
url,
@@ -32432,22 +33170,37 @@ def test_create_ipsec_policy_all_params(self):
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 NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype model
+ network_acl_rule_prototype_network_acl_context_model = {}
+ network_acl_rule_prototype_network_acl_context_model['action'] = 'allow'
+ network_acl_rule_prototype_network_acl_context_model['destination'] = '192.168.3.2/32'
+ network_acl_rule_prototype_network_acl_context_model['direction'] = 'inbound'
+ 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['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
- authentication_algorithm = 'disabled'
- encryption_algorithm = 'aes128'
- pfs = 'disabled'
- key_lifetime = 3600
- name = 'my-ipsec-policy'
- resource_group = resource_group_identity_model
+ network_acl_prototype = network_acl_prototype_model
# Invoke method
- response = _service.create_ipsec_policy(
- authentication_algorithm,
- encryption_algorithm,
- pfs,
- key_lifetime=key_lifetime,
- name=name,
- resource_group=resource_group,
+ response = _service.create_network_acl(
+ network_acl_prototype,
headers={},
)
@@ -32456,30 +33209,25 @@ def test_create_ipsec_policy_all_params(self):
assert response.status_code == 201
# Validate body params
req_body = json.loads(str(responses.calls[0].request.body, 'utf-8'))
- assert req_body['authentication_algorithm'] == 'disabled'
- 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
+ assert req_body == network_acl_prototype
- def test_create_ipsec_policy_all_params_with_retries(self):
- # Enable retries and run test_create_ipsec_policy_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_ipsec_policy_all_params()
+ self.test_create_network_acl_all_params()
- # Disable retries and run test_create_ipsec_policy_all_params.
+ # Disable retries and run test_create_network_acl_all_params.
_service.disable_retries()
- self.test_create_ipsec_policy_all_params()
+ self.test_create_network_acl_all_params()
@responses.activate
- def test_create_ipsec_policy_value_error(self):
+ def test_create_network_acl_value_error(self):
"""
- test_create_ipsec_policy_value_error()
+ test_create_network_acl_value_error()
"""
# Set up mock
- url = preprocess_url('/ipsec_policies')
- mock_response = '{"authentication_algorithm": "disabled", "connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "encapsulation_mode": "tunnel", "encryption_algorithm": "aes128", "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "key_lifetime": 3600, "name": "my-ipsec-policy", "pfs": "disabled", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "ipsec_policy", "transform_protocol": "esp"}'
+ 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-1", "source": "192.168.3.0/24", "destination_port_max": 22, "destination_port_min": 22, "protocol": "udp", "source_port_max": 65535, "source_port_min": 49152}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}'
responses.add(
responses.POST,
url,
@@ -32492,47 +33240,65 @@ def test_create_ipsec_policy_value_error(self):
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 NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype model
+ network_acl_rule_prototype_network_acl_context_model = {}
+ network_acl_rule_prototype_network_acl_context_model['action'] = 'allow'
+ network_acl_rule_prototype_network_acl_context_model['destination'] = '192.168.3.2/32'
+ network_acl_rule_prototype_network_acl_context_model['direction'] = 'inbound'
+ 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['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
- authentication_algorithm = 'disabled'
- encryption_algorithm = 'aes128'
- pfs = 'disabled'
- key_lifetime = 3600
- name = 'my-ipsec-policy'
- resource_group = resource_group_identity_model
+ network_acl_prototype = network_acl_prototype_model
# 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,
+ "network_acl_prototype": network_acl_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_ipsec_policy(**req_copy)
+ _service.create_network_acl(**req_copy)
- def test_create_ipsec_policy_value_error_with_retries(self):
- # Enable retries and run test_create_ipsec_policy_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_ipsec_policy_value_error()
+ self.test_create_network_acl_value_error()
- # Disable retries and run test_create_ipsec_policy_value_error.
+ # Disable retries and run test_create_network_acl_value_error.
_service.disable_retries()
- self.test_create_ipsec_policy_value_error()
+ self.test_create_network_acl_value_error()
-class TestDeleteIpsecPolicy:
+class TestDeleteNetworkAcl:
"""
- Test Class for delete_ipsec_policy
+ Test Class for delete_network_acl
"""
@responses.activate
- def test_delete_ipsec_policy_all_params(self):
+ def test_delete_network_acl_all_params(self):
"""
- delete_ipsec_policy()
+ delete_network_acl()
"""
# Set up mock
- url = preprocess_url('/ipsec_policies/testString')
+ url = preprocess_url('/network_acls/testString')
responses.add(
responses.DELETE,
url,
@@ -32543,7 +33309,7 @@ def test_delete_ipsec_policy_all_params(self):
id = 'testString'
# Invoke method
- response = _service.delete_ipsec_policy(
+ response = _service.delete_network_acl(
id,
headers={},
)
@@ -32552,22 +33318,22 @@ def test_delete_ipsec_policy_all_params(self):
assert len(responses.calls) == 1
assert response.status_code == 204
- def test_delete_ipsec_policy_all_params_with_retries(self):
- # Enable retries and run test_delete_ipsec_policy_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_ipsec_policy_all_params()
+ self.test_delete_network_acl_all_params()
- # Disable retries and run test_delete_ipsec_policy_all_params.
+ # Disable retries and run test_delete_network_acl_all_params.
_service.disable_retries()
- self.test_delete_ipsec_policy_all_params()
+ self.test_delete_network_acl_all_params()
@responses.activate
- def test_delete_ipsec_policy_value_error(self):
+ def test_delete_network_acl_value_error(self):
"""
- test_delete_ipsec_policy_value_error()
+ test_delete_network_acl_value_error()
"""
# Set up mock
- url = preprocess_url('/ipsec_policies/testString')
+ url = preprocess_url('/network_acls/testString')
responses.add(
responses.DELETE,
url,
@@ -32584,31 +33350,31 @@ def test_delete_ipsec_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_ipsec_policy(**req_copy)
+ _service.delete_network_acl(**req_copy)
- def test_delete_ipsec_policy_value_error_with_retries(self):
- # Enable retries and run test_delete_ipsec_policy_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_ipsec_policy_value_error()
+ self.test_delete_network_acl_value_error()
- # Disable retries and run test_delete_ipsec_policy_value_error.
+ # Disable retries and run test_delete_network_acl_value_error.
_service.disable_retries()
- self.test_delete_ipsec_policy_value_error()
+ self.test_delete_network_acl_value_error()
-class TestGetIpsecPolicy:
+class TestGetNetworkAcl:
"""
- Test Class for get_ipsec_policy
+ Test Class for get_network_acl
"""
@responses.activate
- def test_get_ipsec_policy_all_params(self):
+ def test_get_network_acl_all_params(self):
"""
- get_ipsec_policy()
+ get_network_acl()
"""
# Set up mock
- url = preprocess_url('/ipsec_policies/testString')
- mock_response = '{"authentication_algorithm": "disabled", "connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "encapsulation_mode": "tunnel", "encryption_algorithm": "aes128", "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "key_lifetime": 3600, "name": "my-ipsec-policy", "pfs": "disabled", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "ipsec_policy", "transform_protocol": "esp"}'
+ 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-1", "source": "192.168.3.0/24", "destination_port_max": 22, "destination_port_min": 22, "protocol": "udp", "source_port_max": 65535, "source_port_min": 49152}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}'
responses.add(
responses.GET,
url,
@@ -32621,7 +33387,7 @@ def test_get_ipsec_policy_all_params(self):
id = 'testString'
# Invoke method
- response = _service.get_ipsec_policy(
+ response = _service.get_network_acl(
id,
headers={},
)
@@ -32630,23 +33396,23 @@ def test_get_ipsec_policy_all_params(self):
assert len(responses.calls) == 1
assert response.status_code == 200
- def test_get_ipsec_policy_all_params_with_retries(self):
- # Enable retries and run test_get_ipsec_policy_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_ipsec_policy_all_params()
+ self.test_get_network_acl_all_params()
- # Disable retries and run test_get_ipsec_policy_all_params.
+ # Disable retries and run test_get_network_acl_all_params.
_service.disable_retries()
- self.test_get_ipsec_policy_all_params()
+ self.test_get_network_acl_all_params()
@responses.activate
- def test_get_ipsec_policy_value_error(self):
+ def test_get_network_acl_value_error(self):
"""
- test_get_ipsec_policy_value_error()
+ test_get_network_acl_value_error()
"""
# Set up mock
- url = preprocess_url('/ipsec_policies/testString')
- mock_response = '{"authentication_algorithm": "disabled", "connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "encapsulation_mode": "tunnel", "encryption_algorithm": "aes128", "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "key_lifetime": 3600, "name": "my-ipsec-policy", "pfs": "disabled", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "ipsec_policy", "transform_protocol": "esp"}'
+ 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-1", "source": "192.168.3.0/24", "destination_port_max": 22, "destination_port_min": 22, "protocol": "udp", "source_port_max": 65535, "source_port_min": 49152}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}'
responses.add(
responses.GET,
url,
@@ -32665,31 +33431,31 @@ def test_get_ipsec_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_ipsec_policy(**req_copy)
+ _service.get_network_acl(**req_copy)
- def test_get_ipsec_policy_value_error_with_retries(self):
- # Enable retries and run test_get_ipsec_policy_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_ipsec_policy_value_error()
+ self.test_get_network_acl_value_error()
- # Disable retries and run test_get_ipsec_policy_value_error.
+ # Disable retries and run test_get_network_acl_value_error.
_service.disable_retries()
- self.test_get_ipsec_policy_value_error()
+ self.test_get_network_acl_value_error()
-class TestUpdateIpsecPolicy:
+class TestUpdateNetworkAcl:
"""
- Test Class for update_ipsec_policy
+ Test Class for update_network_acl
"""
@responses.activate
- def test_update_ipsec_policy_all_params(self):
+ def test_update_network_acl_all_params(self):
"""
- update_ipsec_policy()
+ update_network_acl()
"""
# Set up mock
- url = preprocess_url('/ipsec_policies/testString')
- mock_response = '{"authentication_algorithm": "disabled", "connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "encapsulation_mode": "tunnel", "encryption_algorithm": "aes128", "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "key_lifetime": 3600, "name": "my-ipsec-policy", "pfs": "disabled", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "ipsec_policy", "transform_protocol": "esp"}'
+ 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-1", "source": "192.168.3.0/24", "destination_port_max": 22, "destination_port_min": 22, "protocol": "udp", "source_port_max": 65535, "source_port_min": 49152}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}'
responses.add(
responses.PATCH,
url,
@@ -32698,22 +33464,18 @@ def test_update_ipsec_policy_all_params(self):
status=200,
)
- # Construct a dict representation of a IPsecPolicyPatch model
- i_psec_policy_patch_model = {}
- i_psec_policy_patch_model['authentication_algorithm'] = 'disabled'
- i_psec_policy_patch_model['encryption_algorithm'] = 'aes128'
- i_psec_policy_patch_model['key_lifetime'] = 3600
- i_psec_policy_patch_model['name'] = 'my-ipsec-policy'
- i_psec_policy_patch_model['pfs'] = 'disabled'
+ # Construct a dict representation of a NetworkACLPatch model
+ network_acl_patch_model = {}
+ network_acl_patch_model['name'] = 'my-network-acl'
# Set up parameter values
id = 'testString'
- i_psec_policy_patch = i_psec_policy_patch_model
+ network_acl_patch = network_acl_patch_model
# Invoke method
- response = _service.update_ipsec_policy(
+ response = _service.update_network_acl(
id,
- i_psec_policy_patch,
+ network_acl_patch,
headers={},
)
@@ -32722,25 +33484,25 @@ def test_update_ipsec_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 == i_psec_policy_patch
+ assert req_body == network_acl_patch
- def test_update_ipsec_policy_all_params_with_retries(self):
- # Enable retries and run test_update_ipsec_policy_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_ipsec_policy_all_params()
+ self.test_update_network_acl_all_params()
- # Disable retries and run test_update_ipsec_policy_all_params.
+ # Disable retries and run test_update_network_acl_all_params.
_service.disable_retries()
- self.test_update_ipsec_policy_all_params()
+ self.test_update_network_acl_all_params()
@responses.activate
- def test_update_ipsec_policy_value_error(self):
+ def test_update_network_acl_value_error(self):
"""
- test_update_ipsec_policy_value_error()
+ test_update_network_acl_value_error()
"""
# Set up mock
- url = preprocess_url('/ipsec_policies/testString')
- mock_response = '{"authentication_algorithm": "disabled", "connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "encapsulation_mode": "tunnel", "encryption_algorithm": "aes128", "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "key_lifetime": 3600, "name": "my-ipsec-policy", "pfs": "disabled", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "ipsec_policy", "transform_protocol": "esp"}'
+ 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-1", "source": "192.168.3.0/24", "destination_port_max": 22, "destination_port_min": 22, "protocol": "udp", "source_port_max": 65535, "source_port_min": 49152}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}'
responses.add(
responses.PATCH,
url,
@@ -32749,132 +33511,47 @@ def test_update_ipsec_policy_value_error(self):
status=200,
)
- # Construct a dict representation of a IPsecPolicyPatch model
- i_psec_policy_patch_model = {}
- i_psec_policy_patch_model['authentication_algorithm'] = 'disabled'
- i_psec_policy_patch_model['encryption_algorithm'] = 'aes128'
- i_psec_policy_patch_model['key_lifetime'] = 3600
- i_psec_policy_patch_model['name'] = 'my-ipsec-policy'
- i_psec_policy_patch_model['pfs'] = 'disabled'
+ # Construct a dict representation of a NetworkACLPatch model
+ network_acl_patch_model = {}
+ network_acl_patch_model['name'] = 'my-network-acl'
# Set up parameter values
id = 'testString'
- i_psec_policy_patch = i_psec_policy_patch_model
+ network_acl_patch = network_acl_patch_model
# Pass in all but one required param and check for a ValueError
req_param_dict = {
"id": id,
- "i_psec_policy_patch": i_psec_policy_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_ipsec_policy(**req_copy)
+ _service.update_network_acl(**req_copy)
- def test_update_ipsec_policy_value_error_with_retries(self):
- # Enable retries and run test_update_ipsec_policy_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_ipsec_policy_value_error()
-
- # Disable retries and run test_update_ipsec_policy_value_error.
- _service.disable_retries()
- self.test_update_ipsec_policy_value_error()
-
-
-class TestListIpsecPolicyConnections:
- """
- Test Class for list_ipsec_policy_connections
- """
-
- @responses.activate
- def test_list_ipsec_policy_connections_all_params(self):
- """
- list_ipsec_policy_connections()
- """
- # Set up mock
- 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", "status_reasons": [{"code": "cannot_authenticate_connection", "message": "Failed to authenticate a connection because of mismatched IKE ID and PSK.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}], "routing_protocol": "none", "tunnels": [{"public_ip": {"address": "192.168.3.4"}, "status": "down", "status_reasons": [{"code": "cannot_authenticate_connection", "message": "Failed to authenticate a connection because of mismatched IKE ID and PSK.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}]}]}]}'
- responses.add(
- responses.GET,
- url,
- body=mock_response,
- content_type='application/json',
- status=200,
- )
-
- # Set up parameter values
- id = 'testString'
-
- # Invoke method
- response = _service.list_ipsec_policy_connections(
- id,
- headers={},
- )
-
- # Check for correct operation
- assert len(responses.calls) == 1
- assert response.status_code == 200
-
- 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_list_ipsec_policy_connections_all_params()
-
- # Disable retries and run test_list_ipsec_policy_connections_all_params.
- _service.disable_retries()
- self.test_list_ipsec_policy_connections_all_params()
-
- @responses.activate
- def test_list_ipsec_policy_connections_value_error(self):
- """
- test_list_ipsec_policy_connections_value_error()
- """
- # Set up mock
- 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", "status_reasons": [{"code": "cannot_authenticate_connection", "message": "Failed to authenticate a connection because of mismatched IKE ID and PSK.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}], "routing_protocol": "none", "tunnels": [{"public_ip": {"address": "192.168.3.4"}, "status": "down", "status_reasons": [{"code": "cannot_authenticate_connection", "message": "Failed to authenticate a connection because of mismatched IKE ID and PSK.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}]}]}]}'
- 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_ipsec_policy_connections(**req_copy)
-
- def test_list_ipsec_policy_connections_value_error_with_retries(self):
- # Enable retries and run test_list_ipsec_policy_connections_value_error.
- _service.enable_retries()
- self.test_list_ipsec_policy_connections_value_error()
+ self.test_update_network_acl_value_error()
- # Disable retries and run test_list_ipsec_policy_connections_value_error.
+ # Disable retries and run test_update_network_acl_value_error.
_service.disable_retries()
- self.test_list_ipsec_policy_connections_value_error()
+ self.test_update_network_acl_value_error()
-class TestListVpnGateways:
+class TestListNetworkAclRules:
"""
- Test Class for list_vpn_gateways
+ Test Class for list_network_acl_rules
"""
@responses.activate
- def test_list_vpn_gateways_all_params(self):
+ def test_list_network_acl_rules_all_params(self):
"""
- list_vpn_gateways()
+ list_network_acl_rules()
"""
# Set up mock
- url = preprocess_url('/vpn_gateways')
- mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways?start=9d5a91a3e2cbd233b5a5b33436855ed&limit=20"}, "total_count": 132, "vpn_gateways": [{"connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b", "health_reasons": [{"code": "cannot_reserve_ip_address", "message": "IP address exhaustion (release addresses on the VPN\'s subnet).", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "members": [{"health_reasons": [{"code": "cannot_reserve_ip_address", "message": "IP address exhaustion (release addresses on the VPN\'s subnet).", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health"}], "health_state": "ok", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "private_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "public_ip": {"address": "192.168.3.4"}, "role": "active"}], "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", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "mode": "route"}]}'
+ 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-1", "source": "192.168.3.0/24", "destination_port_max": 22, "destination_port_min": 22, "protocol": "udp", "source_port_max": 65535, "source_port_min": 49152}], "total_count": 132}'
responses.add(
responses.GET,
url,
@@ -32884,19 +33561,17 @@ def test_list_vpn_gateways_all_params(self):
)
# Set up parameter values
+ network_acl_id = 'testString'
start = 'testString'
limit = 50
- resource_group_id = 'testString'
- sort = 'name'
- mode = 'route'
+ direction = 'inbound'
# Invoke method
- response = _service.list_vpn_gateways(
+ response = _service.list_network_acl_rules(
+ network_acl_id,
start=start,
limit=limit,
- resource_group_id=resource_group_id,
- sort=sort,
- mode=mode,
+ direction=direction,
headers={},
)
@@ -32908,27 +33583,25 @@ 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 'sort={}'.format(sort) in query_string
- assert 'mode={}'.format(mode) in query_string
+ assert 'direction={}'.format(direction) 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_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_vpn_gateways_all_params()
+ self.test_list_network_acl_rules_all_params()
- # Disable retries and run test_list_vpn_gateways_all_params.
+ # Disable retries and run test_list_network_acl_rules_all_params.
_service.disable_retries()
- self.test_list_vpn_gateways_all_params()
+ self.test_list_network_acl_rules_all_params()
@responses.activate
- def test_list_vpn_gateways_required_params(self):
+ def test_list_network_acl_rules_required_params(self):
"""
- test_list_vpn_gateways_required_params()
+ test_list_network_acl_rules_required_params()
"""
# Set up mock
- url = preprocess_url('/vpn_gateways')
- mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways?start=9d5a91a3e2cbd233b5a5b33436855ed&limit=20"}, "total_count": 132, "vpn_gateways": [{"connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b", "health_reasons": [{"code": "cannot_reserve_ip_address", "message": "IP address exhaustion (release addresses on the VPN\'s subnet).", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "members": [{"health_reasons": [{"code": "cannot_reserve_ip_address", "message": "IP address exhaustion (release addresses on the VPN\'s subnet).", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health"}], "health_state": "ok", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "private_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "public_ip": {"address": "192.168.3.4"}, "role": "active"}], "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", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "mode": "route"}]}'
+ 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-1", "source": "192.168.3.0/24", "destination_port_max": 22, "destination_port_min": 22, "protocol": "udp", "source_port_max": 65535, "source_port_min": 49152}], "total_count": 132}'
responses.add(
responses.GET,
url,
@@ -32937,30 +33610,36 @@ def test_list_vpn_gateways_required_params(self):
status=200,
)
+ # Set up parameter values
+ network_acl_id = 'testString'
+
# Invoke method
- response = _service.list_vpn_gateways()
+ response = _service.list_network_acl_rules(
+ network_acl_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_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_vpn_gateways_required_params()
+ self.test_list_network_acl_rules_required_params()
- # Disable retries and run test_list_vpn_gateways_required_params.
+ # Disable retries and run test_list_network_acl_rules_required_params.
_service.disable_retries()
- self.test_list_vpn_gateways_required_params()
+ self.test_list_network_acl_rules_required_params()
@responses.activate
- def test_list_vpn_gateways_value_error(self):
+ def test_list_network_acl_rules_value_error(self):
"""
- test_list_vpn_gateways_value_error()
+ test_list_network_acl_rules_value_error()
"""
# Set up mock
- url = preprocess_url('/vpn_gateways')
- mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways?start=9d5a91a3e2cbd233b5a5b33436855ed&limit=20"}, "total_count": 132, "vpn_gateways": [{"connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b", "health_reasons": [{"code": "cannot_reserve_ip_address", "message": "IP address exhaustion (release addresses on the VPN\'s subnet).", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "members": [{"health_reasons": [{"code": "cannot_reserve_ip_address", "message": "IP address exhaustion (release addresses on the VPN\'s subnet).", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health"}], "health_state": "ok", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "private_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "public_ip": {"address": "192.168.3.4"}, "role": "active"}], "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", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "mode": "route"}]}'
+ 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-1", "source": "192.168.3.0/24", "destination_port_max": 22, "destination_port_min": 22, "protocol": "udp", "source_port_max": 65535, "source_port_min": 49152}], "total_count": 132}'
responses.add(
responses.GET,
url,
@@ -32969,32 +33648,36 @@ def test_list_vpn_gateways_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_vpn_gateways(**req_copy)
+ _service.list_network_acl_rules(**req_copy)
- def test_list_vpn_gateways_value_error_with_retries(self):
- # Enable retries and run test_list_vpn_gateways_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_vpn_gateways_value_error()
+ self.test_list_network_acl_rules_value_error()
- # Disable retries and run test_list_vpn_gateways_value_error.
+ # Disable retries and run test_list_network_acl_rules_value_error.
_service.disable_retries()
- self.test_list_vpn_gateways_value_error()
+ self.test_list_network_acl_rules_value_error()
@responses.activate
- def test_list_vpn_gateways_with_pager_get_next(self):
+ def test_list_network_acl_rules_with_pager_get_next(self):
"""
- test_list_vpn_gateways_with_pager_get_next()
+ test_list_network_acl_rules_with_pager_get_next()
"""
# Set up a two-page mock response
- url = preprocess_url('/vpn_gateways')
- mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"vpn_gateways":[{"connections":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b","id":"a10a5771-dc23-442c-8460-c3601d8542f7","name":"my-vpn-connection","resource_type":"vpn_gateway_connection"}],"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b","health_reasons":[{"code":"cannot_reserve_ip_address","message":"IP address exhaustion (release addresses on the VPN\'s subnet).","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health"}],"health_state":"ok","href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b","id":"ddf51bec-3424-11e8-b467-0ed5f89f718b","lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","members":[{"health_reasons":[{"code":"cannot_reserve_ip_address","message":"IP address exhaustion (release addresses on the VPN\'s subnet).","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health"}],"health_state":"ok","lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","private_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"public_ip":{"address":"192.168.3.4"},"role":"active"}],"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","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"},"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"},"mode":"route"}]}'
- mock_response2 = '{"total_count":2,"limit":1,"vpn_gateways":[{"connections":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b","id":"a10a5771-dc23-442c-8460-c3601d8542f7","name":"my-vpn-connection","resource_type":"vpn_gateway_connection"}],"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b","health_reasons":[{"code":"cannot_reserve_ip_address","message":"IP address exhaustion (release addresses on the VPN\'s subnet).","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health"}],"health_state":"ok","href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b","id":"ddf51bec-3424-11e8-b467-0ed5f89f718b","lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","members":[{"health_reasons":[{"code":"cannot_reserve_ip_address","message":"IP address exhaustion (release addresses on the VPN\'s subnet).","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health"}],"health_state":"ok","lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","private_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"public_ip":{"address":"192.168.3.4"},"role":"active"}],"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","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"},"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"},"mode":"route"}]}'
+ url = preprocess_url('/network_acls/testString/rules')
+ mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"rules":[{"action":"allow","before":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9","id":"8daca77a-4980-4d33-8f3e-7038797be8f9","name":"my-rule-1"},"created_at":"2019-01-01T12:00:00.000Z","destination":"192.168.3.0/24","direction":"inbound","href":"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9","id":"8daca77a-4980-4d33-8f3e-7038797be8f9","ip_version":"ipv4","name":"my-rule-1","source":"192.168.3.0/24","destination_port_max":22,"destination_port_min":22,"protocol":"udp","source_port_max":65535,"source_port_min":49152}]}'
+ mock_response2 = '{"total_count":2,"limit":1,"rules":[{"action":"allow","before":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9","id":"8daca77a-4980-4d33-8f3e-7038797be8f9","name":"my-rule-1"},"created_at":"2019-01-01T12:00:00.000Z","destination":"192.168.3.0/24","direction":"inbound","href":"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9","id":"8daca77a-4980-4d33-8f3e-7038797be8f9","ip_version":"ipv4","name":"my-rule-1","source":"192.168.3.0/24","destination_port_max":22,"destination_port_min":22,"protocol":"udp","source_port_max":65535,"source_port_min":49152}]}'
responses.add(
responses.GET,
url,
@@ -33012,12 +33695,11 @@ def test_list_vpn_gateways_with_pager_get_next(self):
# Exercise the pager class for this operation
all_results = []
- pager = VpnGatewaysPager(
+ pager = NetworkAclRulesPager(
client=_service,
+ network_acl_id='testString',
limit=10,
- resource_group_id='testString',
- sort='name',
- mode='route',
+ direction='inbound',
)
while pager.has_next():
next_page = pager.get_next()
@@ -33026,14 +33708,14 @@ def test_list_vpn_gateways_with_pager_get_next(self):
assert len(all_results) == 2
@responses.activate
- def test_list_vpn_gateways_with_pager_get_all(self):
+ def test_list_network_acl_rules_with_pager_get_all(self):
"""
- test_list_vpn_gateways_with_pager_get_all()
+ test_list_network_acl_rules_with_pager_get_all()
"""
# Set up a two-page mock response
- url = preprocess_url('/vpn_gateways')
- mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"vpn_gateways":[{"connections":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b","id":"a10a5771-dc23-442c-8460-c3601d8542f7","name":"my-vpn-connection","resource_type":"vpn_gateway_connection"}],"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b","health_reasons":[{"code":"cannot_reserve_ip_address","message":"IP address exhaustion (release addresses on the VPN\'s subnet).","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health"}],"health_state":"ok","href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b","id":"ddf51bec-3424-11e8-b467-0ed5f89f718b","lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","members":[{"health_reasons":[{"code":"cannot_reserve_ip_address","message":"IP address exhaustion (release addresses on the VPN\'s subnet).","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health"}],"health_state":"ok","lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","private_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"public_ip":{"address":"192.168.3.4"},"role":"active"}],"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","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"},"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"},"mode":"route"}]}'
- mock_response2 = '{"total_count":2,"limit":1,"vpn_gateways":[{"connections":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b","id":"a10a5771-dc23-442c-8460-c3601d8542f7","name":"my-vpn-connection","resource_type":"vpn_gateway_connection"}],"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b","health_reasons":[{"code":"cannot_reserve_ip_address","message":"IP address exhaustion (release addresses on the VPN\'s subnet).","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health"}],"health_state":"ok","href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b","id":"ddf51bec-3424-11e8-b467-0ed5f89f718b","lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","members":[{"health_reasons":[{"code":"cannot_reserve_ip_address","message":"IP address exhaustion (release addresses on the VPN\'s subnet).","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health"}],"health_state":"ok","lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","private_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"public_ip":{"address":"192.168.3.4"},"role":"active"}],"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","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"},"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"},"mode":"route"}]}'
+ url = preprocess_url('/network_acls/testString/rules')
+ mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"rules":[{"action":"allow","before":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9","id":"8daca77a-4980-4d33-8f3e-7038797be8f9","name":"my-rule-1"},"created_at":"2019-01-01T12:00:00.000Z","destination":"192.168.3.0/24","direction":"inbound","href":"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9","id":"8daca77a-4980-4d33-8f3e-7038797be8f9","ip_version":"ipv4","name":"my-rule-1","source":"192.168.3.0/24","destination_port_max":22,"destination_port_min":22,"protocol":"udp","source_port_max":65535,"source_port_min":49152}]}'
+ mock_response2 = '{"total_count":2,"limit":1,"rules":[{"action":"allow","before":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9","id":"8daca77a-4980-4d33-8f3e-7038797be8f9","name":"my-rule-1"},"created_at":"2019-01-01T12:00:00.000Z","destination":"192.168.3.0/24","direction":"inbound","href":"https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9","id":"8daca77a-4980-4d33-8f3e-7038797be8f9","ip_version":"ipv4","name":"my-rule-1","source":"192.168.3.0/24","destination_port_max":22,"destination_port_min":22,"protocol":"udp","source_port_max":65535,"source_port_min":49152}]}'
responses.add(
responses.GET,
url,
@@ -33050,31 +33732,30 @@ def test_list_vpn_gateways_with_pager_get_all(self):
)
# Exercise the pager class for this operation
- pager = VpnGatewaysPager(
+ pager = NetworkAclRulesPager(
client=_service,
+ network_acl_id='testString',
limit=10,
- resource_group_id='testString',
- sort='name',
- mode='route',
+ direction='inbound',
)
all_results = pager.get_all()
assert all_results is not None
assert len(all_results) == 2
-class TestCreateVpnGateway:
+class TestCreateNetworkAclRule:
"""
- Test Class for create_vpn_gateway
+ Test Class for create_network_acl_rule
"""
@responses.activate
- def test_create_vpn_gateway_all_params(self):
+ def test_create_network_acl_rule_all_params(self):
"""
- create_vpn_gateway()
+ create_network_acl_rule()
"""
# Set up mock
- url = preprocess_url('/vpn_gateways')
- mock_response = '{"connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b", "health_reasons": [{"code": "cannot_reserve_ip_address", "message": "IP address exhaustion (release addresses on the VPN\'s subnet).", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "members": [{"health_reasons": [{"code": "cannot_reserve_ip_address", "message": "IP address exhaustion (release addresses on the VPN\'s subnet).", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health"}], "health_state": "ok", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "private_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "public_ip": {"address": "192.168.3.4"}, "role": "active"}], "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", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "mode": "route"}'
+ 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-1", "source": "192.168.3.0/24", "destination_port_max": 22, "destination_port_min": 22, "protocol": "udp", "source_port_max": 65535, "source_port_min": 49152}'
responses.add(
responses.POST,
url,
@@ -33083,27 +33764,33 @@ def test_create_vpn_gateway_all_params(self):
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 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 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'
+ # Construct a dict representation of a NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype model
+ network_acl_rule_prototype_model = {}
+ network_acl_rule_prototype_model['action'] = 'allow'
+ network_acl_rule_prototype_model['before'] = network_acl_rule_before_prototype_model
+ network_acl_rule_prototype_model['destination'] = '192.168.3.2/32'
+ network_acl_rule_prototype_model['direction'] = 'inbound'
+ network_acl_rule_prototype_model['ip_version'] = 'ipv4'
+ 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['destination_port_max'] = 22
+ network_acl_rule_prototype_model['destination_port_min'] = 22
+ network_acl_rule_prototype_model['protocol'] = 'udp'
+ network_acl_rule_prototype_model['source_port_max'] = 65535
+ network_acl_rule_prototype_model['source_port_min'] = 49152
# Set up parameter values
- vpn_gateway_prototype = vpn_gateway_prototype_model
+ network_acl_id = 'testString'
+ network_acl_rule_prototype = network_acl_rule_prototype_model
# Invoke method
- response = _service.create_vpn_gateway(
- vpn_gateway_prototype,
+ response = _service.create_network_acl_rule(
+ network_acl_id,
+ network_acl_rule_prototype,
headers={},
)
@@ -33112,25 +33799,25 @@ def test_create_vpn_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 == vpn_gateway_prototype
+ assert req_body == network_acl_rule_prototype
- def test_create_vpn_gateway_all_params_with_retries(self):
- # Enable retries and run test_create_vpn_gateway_all_params.
+ 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_vpn_gateway_all_params()
+ self.test_create_network_acl_rule_all_params()
- # Disable retries and run test_create_vpn_gateway_all_params.
+ # Disable retries and run test_create_network_acl_rule_all_params.
_service.disable_retries()
- self.test_create_vpn_gateway_all_params()
+ self.test_create_network_acl_rule_all_params()
@responses.activate
- def test_create_vpn_gateway_value_error(self):
+ def test_create_network_acl_rule_value_error(self):
"""
- test_create_vpn_gateway_value_error()
+ test_create_network_acl_rule_value_error()
"""
# Set up mock
- url = preprocess_url('/vpn_gateways')
- mock_response = '{"connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b", "health_reasons": [{"code": "cannot_reserve_ip_address", "message": "IP address exhaustion (release addresses on the VPN\'s subnet).", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "members": [{"health_reasons": [{"code": "cannot_reserve_ip_address", "message": "IP address exhaustion (release addresses on the VPN\'s subnet).", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health"}], "health_state": "ok", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "private_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "public_ip": {"address": "192.168.3.4"}, "role": "active"}], "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", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "mode": "route"}'
+ 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-1", "source": "192.168.3.0/24", "destination_port_max": 22, "destination_port_min": 22, "protocol": "udp", "source_port_max": 65535, "source_port_min": 49152}'
responses.add(
responses.POST,
url,
@@ -33139,131 +33826,141 @@ def test_create_vpn_gateway_value_error(self):
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 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 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'
+ # Construct a dict representation of a NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype model
+ network_acl_rule_prototype_model = {}
+ network_acl_rule_prototype_model['action'] = 'allow'
+ network_acl_rule_prototype_model['before'] = network_acl_rule_before_prototype_model
+ network_acl_rule_prototype_model['destination'] = '192.168.3.2/32'
+ network_acl_rule_prototype_model['direction'] = 'inbound'
+ network_acl_rule_prototype_model['ip_version'] = 'ipv4'
+ 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['destination_port_max'] = 22
+ network_acl_rule_prototype_model['destination_port_min'] = 22
+ network_acl_rule_prototype_model['protocol'] = 'udp'
+ network_acl_rule_prototype_model['source_port_max'] = 65535
+ network_acl_rule_prototype_model['source_port_min'] = 49152
# Set up parameter values
- vpn_gateway_prototype = vpn_gateway_prototype_model
+ 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 = {
- "vpn_gateway_prototype": vpn_gateway_prototype,
+ "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_vpn_gateway(**req_copy)
+ _service.create_network_acl_rule(**req_copy)
- def test_create_vpn_gateway_value_error_with_retries(self):
- # Enable retries and run test_create_vpn_gateway_value_error.
+ 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_vpn_gateway_value_error()
+ self.test_create_network_acl_rule_value_error()
- # Disable retries and run test_create_vpn_gateway_value_error.
+ # Disable retries and run test_create_network_acl_rule_value_error.
_service.disable_retries()
- self.test_create_vpn_gateway_value_error()
+ self.test_create_network_acl_rule_value_error()
-class TestDeleteVpnGateway:
+class TestDeleteNetworkAclRule:
"""
- Test Class for delete_vpn_gateway
+ Test Class for delete_network_acl_rule
"""
@responses.activate
- def test_delete_vpn_gateway_all_params(self):
+ def test_delete_network_acl_rule_all_params(self):
"""
- delete_vpn_gateway()
+ delete_network_acl_rule()
"""
# Set up mock
- url = preprocess_url('/vpn_gateways/testString')
+ url = preprocess_url('/network_acls/testString/rules/testString')
responses.add(
responses.DELETE,
url,
- status=202,
+ status=204,
)
# Set up parameter values
+ network_acl_id = 'testString'
id = 'testString'
# Invoke method
- response = _service.delete_vpn_gateway(
+ response = _service.delete_network_acl_rule(
+ network_acl_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_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_vpn_gateway_all_params()
+ self.test_delete_network_acl_rule_all_params()
- # Disable retries and run test_delete_vpn_gateway_all_params.
+ # Disable retries and run test_delete_network_acl_rule_all_params.
_service.disable_retries()
- self.test_delete_vpn_gateway_all_params()
+ self.test_delete_network_acl_rule_all_params()
@responses.activate
- def test_delete_vpn_gateway_value_error(self):
+ def test_delete_network_acl_rule_value_error(self):
"""
- test_delete_vpn_gateway_value_error()
+ test_delete_network_acl_rule_value_error()
"""
# Set up mock
- url = preprocess_url('/vpn_gateways/testString')
+ url = preprocess_url('/network_acls/testString/rules/testString')
responses.add(
responses.DELETE,
url,
- status=202,
+ status=204,
)
# Set up parameter values
+ network_acl_id = 'testString'
id = 'testString'
# Pass in all but one required param and check for a ValueError
req_param_dict = {
+ "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_vpn_gateway(**req_copy)
+ _service.delete_network_acl_rule(**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_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_vpn_gateway_value_error()
+ self.test_delete_network_acl_rule_value_error()
- # Disable retries and run test_delete_vpn_gateway_value_error.
+ # Disable retries and run test_delete_network_acl_rule_value_error.
_service.disable_retries()
- self.test_delete_vpn_gateway_value_error()
+ self.test_delete_network_acl_rule_value_error()
-class TestGetVpnGateway:
+class TestGetNetworkAclRule:
"""
- Test Class for get_vpn_gateway
+ Test Class for get_network_acl_rule
"""
@responses.activate
- def test_get_vpn_gateway_all_params(self):
+ def test_get_network_acl_rule_all_params(self):
"""
- get_vpn_gateway()
+ get_network_acl_rule()
"""
# Set up mock
- url = preprocess_url('/vpn_gateways/testString')
- mock_response = '{"connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b", "health_reasons": [{"code": "cannot_reserve_ip_address", "message": "IP address exhaustion (release addresses on the VPN\'s subnet).", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "members": [{"health_reasons": [{"code": "cannot_reserve_ip_address", "message": "IP address exhaustion (release addresses on the VPN\'s subnet).", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health"}], "health_state": "ok", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "private_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "public_ip": {"address": "192.168.3.4"}, "role": "active"}], "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", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "mode": "route"}'
+ 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-1", "source": "192.168.3.0/24", "destination_port_max": 22, "destination_port_min": 22, "protocol": "udp", "source_port_max": 65535, "source_port_min": 49152}'
responses.add(
responses.GET,
url,
@@ -33273,10 +33970,12 @@ def test_get_vpn_gateway_all_params(self):
)
# Set up parameter values
+ network_acl_id = 'testString'
id = 'testString'
# Invoke method
- response = _service.get_vpn_gateway(
+ response = _service.get_network_acl_rule(
+ network_acl_id,
id,
headers={},
)
@@ -33285,23 +33984,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_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_vpn_gateway_all_params()
+ self.test_get_network_acl_rule_all_params()
- # Disable retries and run test_get_vpn_gateway_all_params.
+ # Disable retries and run test_get_network_acl_rule_all_params.
_service.disable_retries()
- self.test_get_vpn_gateway_all_params()
+ self.test_get_network_acl_rule_all_params()
@responses.activate
- def test_get_vpn_gateway_value_error(self):
+ def test_get_network_acl_rule_value_error(self):
"""
- test_get_vpn_gateway_value_error()
+ test_get_network_acl_rule_value_error()
"""
# Set up mock
- url = preprocess_url('/vpn_gateways/testString')
- mock_response = '{"connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b", "health_reasons": [{"code": "cannot_reserve_ip_address", "message": "IP address exhaustion (release addresses on the VPN\'s subnet).", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "members": [{"health_reasons": [{"code": "cannot_reserve_ip_address", "message": "IP address exhaustion (release addresses on the VPN\'s subnet).", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health"}], "health_state": "ok", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "private_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "public_ip": {"address": "192.168.3.4"}, "role": "active"}], "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", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "mode": "route"}'
+ 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-1", "source": "192.168.3.0/24", "destination_port_max": 22, "destination_port_min": 22, "protocol": "udp", "source_port_max": 65535, "source_port_min": 49152}'
responses.add(
responses.GET,
url,
@@ -33311,40 +34010,42 @@ def test_get_vpn_gateway_value_error(self):
)
# Set up parameter values
+ network_acl_id = 'testString'
id = 'testString'
# Pass in all but one required param and check for a ValueError
req_param_dict = {
+ "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_vpn_gateway(**req_copy)
+ _service.get_network_acl_rule(**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_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_vpn_gateway_value_error()
+ self.test_get_network_acl_rule_value_error()
- # Disable retries and run test_get_vpn_gateway_value_error.
+ # Disable retries and run test_get_network_acl_rule_value_error.
_service.disable_retries()
- self.test_get_vpn_gateway_value_error()
+ self.test_get_network_acl_rule_value_error()
-class TestUpdateVpnGateway:
+class TestUpdateNetworkAclRule:
"""
- Test Class for update_vpn_gateway
+ Test Class for update_network_acl_rule
"""
@responses.activate
- def test_update_vpn_gateway_all_params(self):
+ def test_update_network_acl_rule_all_params(self):
"""
- update_vpn_gateway()
+ update_network_acl_rule()
"""
# Set up mock
- url = preprocess_url('/vpn_gateways/testString')
- mock_response = '{"connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b", "health_reasons": [{"code": "cannot_reserve_ip_address", "message": "IP address exhaustion (release addresses on the VPN\'s subnet).", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "members": [{"health_reasons": [{"code": "cannot_reserve_ip_address", "message": "IP address exhaustion (release addresses on the VPN\'s subnet).", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health"}], "health_state": "ok", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "private_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "public_ip": {"address": "192.168.3.4"}, "role": "active"}], "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", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "mode": "route"}'
+ 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-1", "source": "192.168.3.0/24", "destination_port_max": 22, "destination_port_min": 22, "protocol": "udp", "source_port_max": 65535, "source_port_min": 49152}'
responses.add(
responses.PATCH,
url,
@@ -33353,18 +34054,36 @@ def test_update_vpn_gateway_all_params(self):
status=200,
)
- # Construct a dict representation of a VPNGatewayPatch model
- vpn_gateway_patch_model = {}
- vpn_gateway_patch_model['name'] = 'my-vpn-gateway'
+ # 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-1'
+ network_acl_rule_patch_model['protocol'] = 'tcp'
+ network_acl_rule_patch_model['source'] = '192.168.3.2/32'
+ network_acl_rule_patch_model['source_port_max'] = 65535
+ network_acl_rule_patch_model['source_port_min'] = 49152
+ network_acl_rule_patch_model['type'] = 8
# Set up parameter values
+ network_acl_id = 'testString'
id = 'testString'
- vpn_gateway_patch = vpn_gateway_patch_model
+ network_acl_rule_patch = network_acl_rule_patch_model
# Invoke method
- response = _service.update_vpn_gateway(
+ response = _service.update_network_acl_rule(
+ network_acl_id,
id,
- vpn_gateway_patch,
+ network_acl_rule_patch,
headers={},
)
@@ -33373,25 +34092,25 @@ def test_update_vpn_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 == vpn_gateway_patch
+ assert req_body == network_acl_rule_patch
- def test_update_vpn_gateway_all_params_with_retries(self):
- # Enable retries and run test_update_vpn_gateway_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_update_vpn_gateway_all_params()
+ self.test_update_network_acl_rule_all_params()
- # Disable retries and run test_update_vpn_gateway_all_params.
+ # Disable retries and run test_update_network_acl_rule_all_params.
_service.disable_retries()
- self.test_update_vpn_gateway_all_params()
+ self.test_update_network_acl_rule_all_params()
@responses.activate
- def test_update_vpn_gateway_value_error(self):
+ def test_update_network_acl_rule_value_error(self):
"""
- test_update_vpn_gateway_value_error()
+ test_update_network_acl_rule_value_error()
"""
# Set up mock
- url = preprocess_url('/vpn_gateways/testString')
- mock_response = '{"connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b", "health_reasons": [{"code": "cannot_reserve_ip_address", "message": "IP address exhaustion (release addresses on the VPN\'s subnet).", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "members": [{"health_reasons": [{"code": "cannot_reserve_ip_address", "message": "IP address exhaustion (release addresses on the VPN\'s subnet).", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health"}], "health_state": "ok", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "private_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "public_ip": {"address": "192.168.3.4"}, "role": "active"}], "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", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "mode": "route"}'
+ 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-1", "source": "192.168.3.0/24", "destination_port_max": 22, "destination_port_min": 22, "protocol": "udp", "source_port_max": 65535, "source_port_min": 49152}'
responses.add(
responses.PATCH,
url,
@@ -33400,47 +34119,122 @@ def test_update_vpn_gateway_value_error(self):
status=200,
)
- # Construct a dict representation of a VPNGatewayPatch model
- vpn_gateway_patch_model = {}
- vpn_gateway_patch_model['name'] = 'my-vpn-gateway'
+ # 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-1'
+ network_acl_rule_patch_model['protocol'] = 'tcp'
+ network_acl_rule_patch_model['source'] = '192.168.3.2/32'
+ network_acl_rule_patch_model['source_port_max'] = 65535
+ network_acl_rule_patch_model['source_port_min'] = 49152
+ network_acl_rule_patch_model['type'] = 8
# Set up parameter values
+ network_acl_id = 'testString'
id = 'testString'
- vpn_gateway_patch = vpn_gateway_patch_model
+ network_acl_rule_patch = network_acl_rule_patch_model
# Pass in all but one required param and check for a ValueError
req_param_dict = {
+ "network_acl_id": network_acl_id,
"id": id,
- "vpn_gateway_patch": vpn_gateway_patch,
+ "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.update_vpn_gateway(**req_copy)
+ _service.update_network_acl_rule(**req_copy)
- def test_update_vpn_gateway_value_error_with_retries(self):
- # Enable retries and run test_update_vpn_gateway_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_update_vpn_gateway_value_error()
+ self.test_update_network_acl_rule_value_error()
- # Disable retries and run test_update_vpn_gateway_value_error.
+ # Disable retries and run test_update_network_acl_rule_value_error.
_service.disable_retries()
- self.test_update_vpn_gateway_value_error()
+ self.test_update_network_acl_rule_value_error()
-class TestListVpnGatewayConnections:
+# endregion
+##############################################################################
+# End of Service: NetworkACLs
+##############################################################################
+
+##############################################################################
+# Start of Service: SecurityGroups
+##############################################################################
+# region
+
+
+class TestNewInstance:
"""
- Test Class for list_vpn_gateway_connections
+ 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 TestListSecurityGroups:
+ """
+ Test Class for list_security_groups
"""
@responses.activate
- def test_list_vpn_gateway_connections_all_params(self):
+ def test_list_security_groups_all_params(self):
"""
- list_vpn_gateway_connections()
+ list_security_groups()
"""
# 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", "status_reasons": [{"code": "cannot_authenticate_connection", "message": "Failed to authenticate a connection because of mismatched IKE ID and PSK.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}], "routing_protocol": "none", "tunnels": [{"public_ip": {"address": "192.168.3.4"}, "status": "down", "status_reasons": [{"code": "cannot_authenticate_connection", "message": "Failed to authenticate a connection because of mismatched IKE ID and PSK.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}]}]}]}'
+ url = preprocess_url('/security_groups')
+ mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "security_groups": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a", "id": "6f2a6efe-21e2-401c-b237-620aa26ba16a", "ip_version": "ipv4", "remote": {"address": "192.168.3.4"}, "protocol": "all"}], "targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "resource_type": "network_interface"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}], "total_count": 132}'
responses.add(
responses.GET,
url,
@@ -33450,13 +34244,21 @@ def test_list_vpn_gateway_connections_all_params(self):
)
# Set up parameter values
- vpn_gateway_id = 'testString'
- status = 'down'
+ start = 'testString'
+ limit = 50
+ resource_group_id = 'testString'
+ vpc_id = 'testString'
+ vpc_crn = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b'
+ vpc_name = 'my-vpc'
# Invoke method
- response = _service.list_vpn_gateway_connections(
- vpn_gateway_id,
- status=status,
+ 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={},
)
@@ -33466,25 +34268,30 @@ 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
+ 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_vpn_gateway_connections_all_params_with_retries(self):
- # Enable retries and run test_list_vpn_gateway_connections_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_vpn_gateway_connections_all_params()
+ self.test_list_security_groups_all_params()
- # Disable retries and run test_list_vpn_gateway_connections_all_params.
+ # Disable retries and run test_list_security_groups_all_params.
_service.disable_retries()
- self.test_list_vpn_gateway_connections_all_params()
+ self.test_list_security_groups_all_params()
@responses.activate
- def test_list_vpn_gateway_connections_required_params(self):
+ def test_list_security_groups_required_params(self):
"""
- test_list_vpn_gateway_connections_required_params()
+ test_list_security_groups_required_params()
"""
# 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", "status_reasons": [{"code": "cannot_authenticate_connection", "message": "Failed to authenticate a connection because of mismatched IKE ID and PSK.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}], "routing_protocol": "none", "tunnels": [{"public_ip": {"address": "192.168.3.4"}, "status": "down", "status_reasons": [{"code": "cannot_authenticate_connection", "message": "Failed to authenticate a connection because of mismatched IKE ID and PSK.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}]}]}]}'
+ url = preprocess_url('/security_groups')
+ mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "security_groups": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a", "id": "6f2a6efe-21e2-401c-b237-620aa26ba16a", "ip_version": "ipv4", "remote": {"address": "192.168.3.4"}, "protocol": "all"}], "targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "resource_type": "network_interface"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}], "total_count": 132}'
responses.add(
responses.GET,
url,
@@ -33493,36 +34300,30 @@ def test_list_vpn_gateway_connections_required_params(self):
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_security_groups()
# 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_security_groups_required_params_with_retries(self):
+ # Enable retries and run test_list_security_groups_required_params.
_service.enable_retries()
- self.test_list_vpn_gateway_connections_required_params()
+ self.test_list_security_groups_required_params()
- # Disable retries and run test_list_vpn_gateway_connections_required_params.
+ # Disable retries and run test_list_security_groups_required_params.
_service.disable_retries()
- self.test_list_vpn_gateway_connections_required_params()
+ self.test_list_security_groups_required_params()
@responses.activate
- def test_list_vpn_gateway_connections_value_error(self):
+ def test_list_security_groups_value_error(self):
"""
- test_list_vpn_gateway_connections_value_error()
+ test_list_security_groups_value_error()
"""
# 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", "status_reasons": [{"code": "cannot_authenticate_connection", "message": "Failed to authenticate a connection because of mismatched IKE ID and PSK.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}], "routing_protocol": "none", "tunnels": [{"public_ip": {"address": "192.168.3.4"}, "status": "down", "status_reasons": [{"code": "cannot_authenticate_connection", "message": "Failed to authenticate a connection because of mismatched IKE ID and PSK.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}]}]}]}'
+ url = preprocess_url('/security_groups')
+ mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "security_groups": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a", "id": "6f2a6efe-21e2-401c-b237-620aa26ba16a", "ip_version": "ipv4", "remote": {"address": "192.168.3.4"}, "protocol": "all"}], "targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "resource_type": "network_interface"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}], "total_count": 132}'
responses.add(
responses.GET,
url,
@@ -33531,41 +34332,114 @@ def test_list_vpn_gateway_connections_value_error(self):
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_security_groups(**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_security_groups_value_error_with_retries(self):
+ # Enable retries and run test_list_security_groups_value_error.
_service.enable_retries()
- self.test_list_vpn_gateway_connections_value_error()
+ self.test_list_security_groups_value_error()
- # Disable retries and run test_list_vpn_gateway_connections_value_error.
+ # Disable retries and run test_list_security_groups_value_error.
_service.disable_retries()
- self.test_list_vpn_gateway_connections_value_error()
+ self.test_list_security_groups_value_error()
+ @responses.activate
+ def test_list_security_groups_with_pager_get_next(self):
+ """
+ test_list_security_groups_with_pager_get_next()
+ """
+ # Set up a two-page mock response
+ url = preprocess_url('/security_groups')
+ mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"security_groups":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271","href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271","id":"be5df5ca-12a0-494b-907e-aa6ec2bfa271","name":"my-security-group","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"rules":[{"direction":"inbound","href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a","id":"6f2a6efe-21e2-401c-b237-620aa26ba16a","ip_version":"ipv4","remote":{"address":"192.168.3.4"},"protocol":"all"}],"targets":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-instance-network-interface","resource_type":"network_interface"}],"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"}}],"total_count":2,"limit":1}'
+ mock_response2 = '{"security_groups":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271","href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271","id":"be5df5ca-12a0-494b-907e-aa6ec2bfa271","name":"my-security-group","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"rules":[{"direction":"inbound","href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a","id":"6f2a6efe-21e2-401c-b237-620aa26ba16a","ip_version":"ipv4","remote":{"address":"192.168.3.4"},"protocol":"all"}],"targets":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-instance-network-interface","resource_type":"network_interface"}],"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"}}],"total_count":2,"limit":1}'
+ responses.add(
+ responses.GET,
+ url,
+ body=mock_response1,
+ content_type='application/json',
+ status=200,
+ )
+ responses.add(
+ responses.GET,
+ url,
+ body=mock_response2,
+ content_type='application/json',
+ status=200,
+ )
-class TestCreateVpnGatewayConnection:
+ # Exercise the pager class for this operation
+ all_results = []
+ pager = SecurityGroupsPager(
+ client=_service,
+ limit=10,
+ resource_group_id='testString',
+ vpc_id='testString',
+ vpc_crn='crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b',
+ vpc_name='my-vpc',
+ )
+ while pager.has_next():
+ next_page = pager.get_next()
+ assert next_page is not None
+ all_results.extend(next_page)
+ assert len(all_results) == 2
+
+ @responses.activate
+ def test_list_security_groups_with_pager_get_all(self):
+ """
+ test_list_security_groups_with_pager_get_all()
+ """
+ # Set up a two-page mock response
+ url = preprocess_url('/security_groups')
+ mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"security_groups":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271","href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271","id":"be5df5ca-12a0-494b-907e-aa6ec2bfa271","name":"my-security-group","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"rules":[{"direction":"inbound","href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a","id":"6f2a6efe-21e2-401c-b237-620aa26ba16a","ip_version":"ipv4","remote":{"address":"192.168.3.4"},"protocol":"all"}],"targets":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-instance-network-interface","resource_type":"network_interface"}],"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"}}],"total_count":2,"limit":1}'
+ mock_response2 = '{"security_groups":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271","href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271","id":"be5df5ca-12a0-494b-907e-aa6ec2bfa271","name":"my-security-group","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"rules":[{"direction":"inbound","href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a","id":"6f2a6efe-21e2-401c-b237-620aa26ba16a","ip_version":"ipv4","remote":{"address":"192.168.3.4"},"protocol":"all"}],"targets":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-instance-network-interface","resource_type":"network_interface"}],"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"}}],"total_count":2,"limit":1}'
+ responses.add(
+ responses.GET,
+ url,
+ body=mock_response1,
+ content_type='application/json',
+ status=200,
+ )
+ responses.add(
+ responses.GET,
+ url,
+ body=mock_response2,
+ content_type='application/json',
+ status=200,
+ )
+
+ # Exercise the pager class for this operation
+ pager = SecurityGroupsPager(
+ client=_service,
+ limit=10,
+ resource_group_id='testString',
+ vpc_id='testString',
+ vpc_crn='crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b',
+ vpc_name='my-vpc',
+ )
+ all_results = pager.get_all()
+ assert all_results is not None
+ assert len(all_results) == 2
+
+
+class TestCreateSecurityGroup:
"""
- Test Class for create_vpn_gateway_connection
+ Test Class for create_security_group
"""
@responses.activate
- def test_create_vpn_gateway_connection_all_params(self):
+ def test_create_security_group_all_params(self):
"""
- create_vpn_gateway_connection()
+ create_security_group()
"""
# Set up mock
- 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", "status_reasons": [{"code": "cannot_authenticate_connection", "message": "Failed to authenticate a connection because of mismatched IKE ID and PSK.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}], "routing_protocol": "none", "tunnels": [{"public_ip": {"address": "192.168.3.4"}, "status": "down", "status_reasons": [{"code": "cannot_authenticate_connection", "message": "Failed to authenticate a connection because of mismatched IKE ID and PSK.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}]}]}'
+ url = preprocess_url('/security_groups')
+ mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a", "id": "6f2a6efe-21e2-401c-b237-620aa26ba16a", "ip_version": "ipv4", "remote": {"address": "192.168.3.4"}, "protocol": "all"}], "targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "resource_type": "network_interface"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}'
responses.add(
responses.POST,
url,
@@ -33574,39 +34448,37 @@ def test_create_vpn_gateway_connection_all_params(self):
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 VPCIdentityById model
+ vpc_identity_model = {}
+ vpc_identity_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b'
- # 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 ResourceGroupIdentityById model
+ resource_group_identity_model = {}
+ resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
- # 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 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 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 SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll 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'] = 'all'
+ security_group_rule_prototype_model['remote'] = security_group_rule_remote_prototype_model
# Set up parameter values
- vpn_gateway_id = 'testString'
- vpn_gateway_connection_prototype = vpn_gateway_connection_prototype_model
+ 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_vpn_gateway_connection(
- vpn_gateway_id,
- vpn_gateway_connection_prototype,
+ response = _service.create_security_group(
+ vpc,
+ name=name,
+ resource_group=resource_group,
+ rules=rules,
headers={},
)
@@ -33615,25 +34487,28 @@ 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['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_vpn_gateway_connection_all_params_with_retries(self):
- # Enable retries and run test_create_vpn_gateway_connection_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_vpn_gateway_connection_all_params()
+ self.test_create_security_group_all_params()
- # Disable retries and run test_create_vpn_gateway_connection_all_params.
+ # Disable retries and run test_create_security_group_all_params.
_service.disable_retries()
- self.test_create_vpn_gateway_connection_all_params()
+ self.test_create_security_group_all_params()
@responses.activate
- def test_create_vpn_gateway_connection_value_error(self):
+ def test_create_security_group_value_error(self):
"""
- test_create_vpn_gateway_connection_value_error()
+ test_create_security_group_value_error()
"""
# Set up mock
- 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", "status_reasons": [{"code": "cannot_authenticate_connection", "message": "Failed to authenticate a connection because of mismatched IKE ID and PSK.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}], "routing_protocol": "none", "tunnels": [{"public_ip": {"address": "192.168.3.4"}, "status": "down", "status_reasons": [{"code": "cannot_authenticate_connection", "message": "Failed to authenticate a connection because of mismatched IKE ID and PSK.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}]}]}'
+ url = preprocess_url('/security_groups')
+ mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a", "id": "6f2a6efe-21e2-401c-b237-620aa26ba16a", "ip_version": "ipv4", "remote": {"address": "192.168.3.4"}, "protocol": "all"}], "targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "resource_type": "network_interface"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}'
responses.add(
responses.POST,
url,
@@ -33642,147 +34517,138 @@ def test_create_vpn_gateway_connection_value_error(self):
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 VPCIdentityById model
+ vpc_identity_model = {}
+ vpc_identity_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b'
- # 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 ResourceGroupIdentityById model
+ resource_group_identity_model = {}
+ resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
- # 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 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 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 SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll 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'] = 'all'
+ security_group_rule_prototype_model['remote'] = security_group_rule_remote_prototype_model
# Set up parameter values
- vpn_gateway_id = 'testString'
- vpn_gateway_connection_prototype = vpn_gateway_connection_prototype_model
+ 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 = {
- "vpn_gateway_id": vpn_gateway_id,
- "vpn_gateway_connection_prototype": vpn_gateway_connection_prototype,
+ "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_vpn_gateway_connection(**req_copy)
+ _service.create_security_group(**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_security_group_value_error_with_retries(self):
+ # Enable retries and run test_create_security_group_value_error.
_service.enable_retries()
- self.test_create_vpn_gateway_connection_value_error()
+ self.test_create_security_group_value_error()
- # Disable retries and run test_create_vpn_gateway_connection_value_error.
+ # Disable retries and run test_create_security_group_value_error.
_service.disable_retries()
- self.test_create_vpn_gateway_connection_value_error()
+ self.test_create_security_group_value_error()
-class TestDeleteVpnGatewayConnection:
+class TestDeleteSecurityGroup:
"""
- Test Class for delete_vpn_gateway_connection
+ Test Class for delete_security_group
"""
@responses.activate
- def test_delete_vpn_gateway_connection_all_params(self):
+ def test_delete_security_group_all_params(self):
"""
- delete_vpn_gateway_connection()
+ delete_security_group()
"""
# Set up mock
- url = preprocess_url('/vpn_gateways/testString/connections/testString')
+ url = preprocess_url('/security_groups/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_security_group(
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_security_group_all_params_with_retries(self):
+ # Enable retries and run test_delete_security_group_all_params.
_service.enable_retries()
- self.test_delete_vpn_gateway_connection_all_params()
+ self.test_delete_security_group_all_params()
- # Disable retries and run test_delete_vpn_gateway_connection_all_params.
+ # Disable retries and run test_delete_security_group_all_params.
_service.disable_retries()
- self.test_delete_vpn_gateway_connection_all_params()
+ self.test_delete_security_group_all_params()
@responses.activate
- def test_delete_vpn_gateway_connection_value_error(self):
+ def test_delete_security_group_value_error(self):
"""
- test_delete_vpn_gateway_connection_value_error()
+ test_delete_security_group_value_error()
"""
# Set up mock
- url = preprocess_url('/vpn_gateways/testString/connections/testString')
+ url = preprocess_url('/security_groups/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_security_group(**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_security_group_value_error_with_retries(self):
+ # Enable retries and run test_delete_security_group_value_error.
_service.enable_retries()
- self.test_delete_vpn_gateway_connection_value_error()
+ self.test_delete_security_group_value_error()
- # Disable retries and run test_delete_vpn_gateway_connection_value_error.
+ # Disable retries and run test_delete_security_group_value_error.
_service.disable_retries()
- self.test_delete_vpn_gateway_connection_value_error()
+ self.test_delete_security_group_value_error()
-class TestGetVpnGatewayConnection:
+class TestGetSecurityGroup:
"""
- Test Class for get_vpn_gateway_connection
+ Test Class for get_security_group
"""
@responses.activate
- def test_get_vpn_gateway_connection_all_params(self):
+ def test_get_security_group_all_params(self):
"""
- get_vpn_gateway_connection()
+ get_security_group()
"""
# Set up mock
- 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", "status_reasons": [{"code": "cannot_authenticate_connection", "message": "Failed to authenticate a connection because of mismatched IKE ID and PSK.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}], "routing_protocol": "none", "tunnels": [{"public_ip": {"address": "192.168.3.4"}, "status": "down", "status_reasons": [{"code": "cannot_authenticate_connection", "message": "Failed to authenticate a connection because of mismatched IKE ID and PSK.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}]}]}'
+ url = preprocess_url('/security_groups/testString')
+ mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a", "id": "6f2a6efe-21e2-401c-b237-620aa26ba16a", "ip_version": "ipv4", "remote": {"address": "192.168.3.4"}, "protocol": "all"}], "targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "resource_type": "network_interface"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}'
responses.add(
responses.GET,
url,
@@ -33792,12 +34658,10 @@ def test_get_vpn_gateway_connection_all_params(self):
)
# Set up parameter values
- vpn_gateway_id = 'testString'
id = 'testString'
# Invoke method
- response = _service.get_vpn_gateway_connection(
- vpn_gateway_id,
+ response = _service.get_security_group(
id,
headers={},
)
@@ -33806,23 +34670,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_security_group_all_params_with_retries(self):
+ # Enable retries and run test_get_security_group_all_params.
_service.enable_retries()
- self.test_get_vpn_gateway_connection_all_params()
+ self.test_get_security_group_all_params()
- # Disable retries and run test_get_vpn_gateway_connection_all_params.
+ # Disable retries and run test_get_security_group_all_params.
_service.disable_retries()
- self.test_get_vpn_gateway_connection_all_params()
+ self.test_get_security_group_all_params()
@responses.activate
- def test_get_vpn_gateway_connection_value_error(self):
+ def test_get_security_group_value_error(self):
"""
- test_get_vpn_gateway_connection_value_error()
+ test_get_security_group_value_error()
"""
# Set up mock
- 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", "status_reasons": [{"code": "cannot_authenticate_connection", "message": "Failed to authenticate a connection because of mismatched IKE ID and PSK.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}], "routing_protocol": "none", "tunnels": [{"public_ip": {"address": "192.168.3.4"}, "status": "down", "status_reasons": [{"code": "cannot_authenticate_connection", "message": "Failed to authenticate a connection because of mismatched IKE ID and PSK.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}]}]}'
+ url = preprocess_url('/security_groups/testString')
+ mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a", "id": "6f2a6efe-21e2-401c-b237-620aa26ba16a", "ip_version": "ipv4", "remote": {"address": "192.168.3.4"}, "protocol": "all"}], "targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "resource_type": "network_interface"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}'
responses.add(
responses.GET,
url,
@@ -33832,42 +34696,40 @@ def test_get_vpn_gateway_connection_value_error(self):
)
# 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_security_group(**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_security_group_value_error_with_retries(self):
+ # Enable retries and run test_get_security_group_value_error.
_service.enable_retries()
- self.test_get_vpn_gateway_connection_value_error()
+ self.test_get_security_group_value_error()
- # Disable retries and run test_get_vpn_gateway_connection_value_error.
+ # Disable retries and run test_get_security_group_value_error.
_service.disable_retries()
- self.test_get_vpn_gateway_connection_value_error()
+ self.test_get_security_group_value_error()
-class TestUpdateVpnGatewayConnection:
+class TestUpdateSecurityGroup:
"""
- Test Class for update_vpn_gateway_connection
+ Test Class for update_security_group
"""
@responses.activate
- def test_update_vpn_gateway_connection_all_params(self):
+ def test_update_security_group_all_params(self):
"""
- update_vpn_gateway_connection()
+ update_security_group()
"""
# Set up mock
- 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", "status_reasons": [{"code": "cannot_authenticate_connection", "message": "Failed to authenticate a connection because of mismatched IKE ID and PSK.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}], "routing_protocol": "none", "tunnels": [{"public_ip": {"address": "192.168.3.4"}, "status": "down", "status_reasons": [{"code": "cannot_authenticate_connection", "message": "Failed to authenticate a connection because of mismatched IKE ID and PSK.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}]}]}'
+ url = preprocess_url('/security_groups/testString')
+ mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a", "id": "6f2a6efe-21e2-401c-b237-620aa26ba16a", "ip_version": "ipv4", "remote": {"address": "192.168.3.4"}, "protocol": "all"}], "targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "resource_type": "network_interface"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}'
responses.add(
responses.PATCH,
url,
@@ -33876,41 +34738,18 @@ def test_update_vpn_gateway_connection_all_params(self):
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 SecurityGroupPatch model
+ security_group_patch_model = {}
+ security_group_patch_model['name'] = 'my-security-group'
- # 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'
-
- # Set up parameter values
- vpn_gateway_id = 'testString'
- id = 'testString'
- vpn_gateway_connection_patch = vpn_gateway_connection_patch_model
+ # Set up parameter values
+ id = 'testString'
+ security_group_patch = security_group_patch_model
# Invoke method
- response = _service.update_vpn_gateway_connection(
- vpn_gateway_id,
+ response = _service.update_security_group(
id,
- vpn_gateway_connection_patch,
+ security_group_patch,
headers={},
)
@@ -33919,25 +34758,25 @@ 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 == security_group_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_security_group_all_params_with_retries(self):
+ # Enable retries and run test_update_security_group_all_params.
_service.enable_retries()
- self.test_update_vpn_gateway_connection_all_params()
+ self.test_update_security_group_all_params()
- # Disable retries and run test_update_vpn_gateway_connection_all_params.
+ # Disable retries and run test_update_security_group_all_params.
_service.disable_retries()
- self.test_update_vpn_gateway_connection_all_params()
+ self.test_update_security_group_all_params()
@responses.activate
- def test_update_vpn_gateway_connection_value_error(self):
+ def test_update_security_group_value_error(self):
"""
- test_update_vpn_gateway_connection_value_error()
+ test_update_security_group_value_error()
"""
# Set up mock
- 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", "status_reasons": [{"code": "cannot_authenticate_connection", "message": "Failed to authenticate a connection because of mismatched IKE ID and PSK.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}], "routing_protocol": "none", "tunnels": [{"public_ip": {"address": "192.168.3.4"}, "status": "down", "status_reasons": [{"code": "cannot_authenticate_connection", "message": "Failed to authenticate a connection because of mismatched IKE ID and PSK.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}]}]}'
+ url = preprocess_url('/security_groups/testString')
+ mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a", "id": "6f2a6efe-21e2-401c-b237-620aa26ba16a", "ip_version": "ipv4", "remote": {"address": "192.168.3.4"}, "protocol": "all"}], "targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "resource_type": "network_interface"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}'
responses.add(
responses.PATCH,
url,
@@ -33946,70 +34785,47 @@ def test_update_vpn_gateway_connection_value_error(self):
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 SecurityGroupPatch model
+ security_group_patch_model = {}
+ security_group_patch_model['name'] = 'my-security-group'
# Set up parameter values
- vpn_gateway_id = 'testString'
id = 'testString'
- vpn_gateway_connection_patch = vpn_gateway_connection_patch_model
+ security_group_patch = security_group_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,
+ "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_vpn_gateway_connection(**req_copy)
+ _service.update_security_group(**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_security_group_value_error_with_retries(self):
+ # Enable retries and run test_update_security_group_value_error.
_service.enable_retries()
- self.test_update_vpn_gateway_connection_value_error()
+ self.test_update_security_group_value_error()
- # Disable retries and run test_update_vpn_gateway_connection_value_error.
+ # Disable retries and run test_update_security_group_value_error.
_service.disable_retries()
- self.test_update_vpn_gateway_connection_value_error()
+ self.test_update_security_group_value_error()
-class TestListVpnGatewayConnectionLocalCidrs:
+class TestListSecurityGroupRules:
"""
- Test Class for list_vpn_gateway_connection_local_cidrs
+ Test Class for list_security_group_rules
"""
@responses.activate
- def test_list_vpn_gateway_connection_local_cidrs_all_params(self):
+ def test_list_security_group_rules_all_params(self):
"""
- list_vpn_gateway_connection_local_cidrs()
+ list_security_group_rules()
"""
# Set up mock
- url = preprocess_url('/vpn_gateways/testString/connections/testString/local_cidrs')
- mock_response = '{"local_cidrs": ["192.168.1.0/24"]}'
+ 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,
@@ -34019,13 +34835,11 @@ def test_list_vpn_gateway_connection_local_cidrs_all_params(self):
)
# Set up parameter values
- vpn_gateway_id = 'testString'
- id = 'testString'
+ security_group_id = 'testString'
# Invoke method
- response = _service.list_vpn_gateway_connection_local_cidrs(
- vpn_gateway_id,
- id,
+ response = _service.list_security_group_rules(
+ security_group_id,
headers={},
)
@@ -34033,23 +34847,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_security_group_rules_all_params_with_retries(self):
+ # Enable retries and run test_list_security_group_rules_all_params.
_service.enable_retries()
- self.test_list_vpn_gateway_connection_local_cidrs_all_params()
+ self.test_list_security_group_rules_all_params()
- # Disable retries and run test_list_vpn_gateway_connection_local_cidrs_all_params.
+ # Disable retries and run test_list_security_group_rules_all_params.
_service.disable_retries()
- self.test_list_vpn_gateway_connection_local_cidrs_all_params()
+ self.test_list_security_group_rules_all_params()
@responses.activate
- def test_list_vpn_gateway_connection_local_cidrs_value_error(self):
+ def test_list_security_group_rules_value_error(self):
"""
- test_list_vpn_gateway_connection_local_cidrs_value_error()
+ test_list_security_group_rules_value_error()
"""
# Set up mock
- url = preprocess_url('/vpn_gateways/testString/connections/testString/local_cidrs')
- mock_response = '{"local_cidrs": ["192.168.1.0/24"]}'
+ 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,
@@ -34059,146 +34873,163 @@ def test_list_vpn_gateway_connection_local_cidrs_value_error(self):
)
# Set up parameter values
- vpn_gateway_id = 'testString'
- id = 'testString'
+ security_group_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,
+ "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_gateway_connection_local_cidrs(**req_copy)
+ _service.list_security_group_rules(**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_security_group_rules_value_error_with_retries(self):
+ # Enable retries and run test_list_security_group_rules_value_error.
_service.enable_retries()
- self.test_list_vpn_gateway_connection_local_cidrs_value_error()
+ self.test_list_security_group_rules_value_error()
- # Disable retries and run test_list_vpn_gateway_connection_local_cidrs_value_error.
+ # Disable retries and run test_list_security_group_rules_value_error.
_service.disable_retries()
- self.test_list_vpn_gateway_connection_local_cidrs_value_error()
+ self.test_list_security_group_rules_value_error()
-class TestRemoveVpnGatewayConnectionLocalCidr:
+class TestCreateSecurityGroupRule:
"""
- Test Class for remove_vpn_gateway_connection_local_cidr
+ Test Class for create_security_group_rule
"""
@responses.activate
- def test_remove_vpn_gateway_connection_local_cidr_all_params(self):
+ def test_create_security_group_rule_all_params(self):
"""
- remove_vpn_gateway_connection_local_cidr()
+ create_security_group_rule()
"""
# Set up mock
- url = preprocess_url('/vpn_gateways/testString/connections/testString/local_cidrs/testString/testString')
+ 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.DELETE,
+ responses.POST,
url,
- status=204,
+ 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 SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll 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'] = 'all'
+ security_group_rule_prototype_model['remote'] = security_group_rule_remote_prototype_model
+
# Set up parameter values
- vpn_gateway_id = 'testString'
- id = 'testString'
- cidr_prefix = 'testString'
- prefix_length = 'testString'
+ security_group_id = 'testString'
+ security_group_rule_prototype = security_group_rule_prototype_model
# Invoke method
- response = _service.remove_vpn_gateway_connection_local_cidr(
- vpn_gateway_id,
- id,
- cidr_prefix,
- prefix_length,
+ 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 == 204
+ 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_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_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_remove_vpn_gateway_connection_local_cidr_all_params()
+ self.test_create_security_group_rule_all_params()
- # Disable retries and run test_remove_vpn_gateway_connection_local_cidr_all_params.
+ # Disable retries and run test_create_security_group_rule_all_params.
_service.disable_retries()
- self.test_remove_vpn_gateway_connection_local_cidr_all_params()
+ self.test_create_security_group_rule_all_params()
@responses.activate
- def test_remove_vpn_gateway_connection_local_cidr_value_error(self):
+ def test_create_security_group_rule_value_error(self):
"""
- test_remove_vpn_gateway_connection_local_cidr_value_error()
+ test_create_security_group_rule_value_error()
"""
# Set up mock
- url = preprocess_url('/vpn_gateways/testString/connections/testString/local_cidrs/testString/testString')
+ 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.DELETE,
+ responses.POST,
url,
- status=204,
+ 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 SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll 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'] = 'all'
+ security_group_rule_prototype_model['remote'] = security_group_rule_remote_prototype_model
+
# Set up parameter values
- vpn_gateway_id = 'testString'
- id = 'testString'
- cidr_prefix = 'testString'
- prefix_length = 'testString'
+ 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 = {
- "vpn_gateway_id": vpn_gateway_id,
- "id": id,
- "cidr_prefix": cidr_prefix,
- "prefix_length": prefix_length,
+ "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.remove_vpn_gateway_connection_local_cidr(**req_copy)
+ _service.create_security_group_rule(**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_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_remove_vpn_gateway_connection_local_cidr_value_error()
+ self.test_create_security_group_rule_value_error()
- # Disable retries and run test_remove_vpn_gateway_connection_local_cidr_value_error.
+ # Disable retries and run test_create_security_group_rule_value_error.
_service.disable_retries()
- self.test_remove_vpn_gateway_connection_local_cidr_value_error()
+ self.test_create_security_group_rule_value_error()
-class TestCheckVpnGatewayConnectionLocalCidr:
+class TestDeleteSecurityGroupRule:
"""
- Test Class for check_vpn_gateway_connection_local_cidr
+ Test Class for delete_security_group_rule
"""
@responses.activate
- def test_check_vpn_gateway_connection_local_cidr_all_params(self):
+ def test_delete_security_group_rule_all_params(self):
"""
- check_vpn_gateway_connection_local_cidr()
+ delete_security_group_rule()
"""
# Set up mock
- url = preprocess_url('/vpn_gateways/testString/connections/testString/local_cidrs/testString/testString')
+ url = preprocess_url('/security_groups/testString/rules/testString')
responses.add(
- responses.GET,
+ responses.DELETE,
url,
status=204,
)
# Set up parameter values
- vpn_gateway_id = 'testString'
+ security_group_id = 'testString'
id = 'testString'
- cidr_prefix = 'testString'
- prefix_length = 'testString'
# Invoke method
- response = _service.check_vpn_gateway_connection_local_cidr(
- vpn_gateway_id,
+ response = _service.delete_security_group_rule(
+ security_group_id,
id,
- cidr_prefix,
- prefix_length,
headers={},
)
@@ -34206,281 +35037,468 @@ def test_check_vpn_gateway_connection_local_cidr_all_params(self):
assert len(responses.calls) == 1
assert response.status_code == 204
- 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_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_check_vpn_gateway_connection_local_cidr_all_params()
+ self.test_delete_security_group_rule_all_params()
- # Disable retries and run test_check_vpn_gateway_connection_local_cidr_all_params.
+ # Disable retries and run test_delete_security_group_rule_all_params.
_service.disable_retries()
- self.test_check_vpn_gateway_connection_local_cidr_all_params()
+ self.test_delete_security_group_rule_all_params()
@responses.activate
- def test_check_vpn_gateway_connection_local_cidr_value_error(self):
+ def test_delete_security_group_rule_value_error(self):
"""
- test_check_vpn_gateway_connection_local_cidr_value_error()
+ test_delete_security_group_rule_value_error()
"""
# Set up mock
- url = preprocess_url('/vpn_gateways/testString/connections/testString/local_cidrs/testString/testString')
+ url = preprocess_url('/security_groups/testString/rules/testString')
responses.add(
- responses.GET,
+ responses.DELETE,
url,
status=204,
)
# Set up parameter values
- vpn_gateway_id = 'testString'
+ security_group_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,
+ "security_group_id": security_group_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_local_cidr(**req_copy)
+ _service.delete_security_group_rule(**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_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_check_vpn_gateway_connection_local_cidr_value_error()
+ self.test_delete_security_group_rule_value_error()
- # Disable retries and run test_check_vpn_gateway_connection_local_cidr_value_error.
+ # Disable retries and run test_delete_security_group_rule_value_error.
_service.disable_retries()
- self.test_check_vpn_gateway_connection_local_cidr_value_error()
+ self.test_delete_security_group_rule_value_error()
-class TestAddVpnGatewayConnectionLocalCidr:
+class TestGetSecurityGroupRule:
"""
- Test Class for add_vpn_gateway_connection_local_cidr
+ Test Class for get_security_group_rule
"""
@responses.activate
- def test_add_vpn_gateway_connection_local_cidr_all_params(self):
+ def test_get_security_group_rule_all_params(self):
"""
- add_vpn_gateway_connection_local_cidr()
+ get_security_group_rule()
"""
# Set up mock
- url = preprocess_url('/vpn_gateways/testString/connections/testString/local_cidrs/testString/testString')
+ 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.PUT,
+ responses.GET,
url,
- status=204,
+ body=mock_response,
+ content_type='application/json',
+ status=200,
)
# Set up parameter values
- vpn_gateway_id = 'testString'
+ security_group_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.get_security_group_rule(
+ security_group_id,
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_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_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_add_vpn_gateway_connection_local_cidr_all_params()
+ self.test_get_security_group_rule_all_params()
- # Disable retries and run test_add_vpn_gateway_connection_local_cidr_all_params.
+ # Disable retries and run test_get_security_group_rule_all_params.
_service.disable_retries()
- self.test_add_vpn_gateway_connection_local_cidr_all_params()
+ self.test_get_security_group_rule_all_params()
@responses.activate
- def test_add_vpn_gateway_connection_local_cidr_value_error(self):
+ def test_get_security_group_rule_value_error(self):
"""
- test_add_vpn_gateway_connection_local_cidr_value_error()
+ test_get_security_group_rule_value_error()
"""
# Set up mock
- url = preprocess_url('/vpn_gateways/testString/connections/testString/local_cidrs/testString/testString')
+ 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.PUT,
+ responses.GET,
url,
- status=204,
+ body=mock_response,
+ content_type='application/json',
+ status=200,
)
# Set up parameter values
- vpn_gateway_id = 'testString'
+ security_group_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,
+ "security_group_id": security_group_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.get_security_group_rule(**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_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_add_vpn_gateway_connection_local_cidr_value_error()
+ self.test_get_security_group_rule_value_error()
- # Disable retries and run test_add_vpn_gateway_connection_local_cidr_value_error.
+ # Disable retries and run test_get_security_group_rule_value_error.
_service.disable_retries()
- self.test_add_vpn_gateway_connection_local_cidr_value_error()
+ self.test_get_security_group_rule_value_error()
-class TestListVpnGatewayConnectionPeerCidrs:
+class TestUpdateSecurityGroupRule:
"""
- Test Class for list_vpn_gateway_connection_peer_cidrs
+ Test Class for update_security_group_rule
"""
@responses.activate
- def test_list_vpn_gateway_connection_peer_cidrs_all_params(self):
+ def test_update_security_group_rule_all_params(self):
"""
- list_vpn_gateway_connection_peer_cidrs()
+ update_security_group_rule()
"""
# Set up mock
- url = preprocess_url('/vpn_gateways/testString/connections/testString/peer_cidrs')
- mock_response = '{"peer_cidrs": ["10.45.1.0/24"]}'
+ 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,
+ 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
- vpn_gateway_id = 'testString'
+ security_group_id = 'testString'
id = 'testString'
+ security_group_rule_patch = security_group_rule_patch_model
# Invoke method
- response = _service.list_vpn_gateway_connection_peer_cidrs(
- vpn_gateway_id,
+ 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_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_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_vpn_gateway_connection_peer_cidrs_all_params()
+ self.test_update_security_group_rule_all_params()
- # Disable retries and run test_list_vpn_gateway_connection_peer_cidrs_all_params.
+ # Disable retries and run test_update_security_group_rule_all_params.
_service.disable_retries()
- self.test_list_vpn_gateway_connection_peer_cidrs_all_params()
+ self.test_update_security_group_rule_all_params()
@responses.activate
- def test_list_vpn_gateway_connection_peer_cidrs_value_error(self):
+ def test_update_security_group_rule_value_error(self):
"""
- test_list_vpn_gateway_connection_peer_cidrs_value_error()
+ test_update_security_group_rule_value_error()
"""
# Set up mock
- url = preprocess_url('/vpn_gateways/testString/connections/testString/peer_cidrs')
- mock_response = '{"peer_cidrs": ["10.45.1.0/24"]}'
+ 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,
+ 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
- vpn_gateway_id = 'testString'
+ 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 = {
- "vpn_gateway_id": vpn_gateway_id,
+ "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_vpn_gateway_connection_peer_cidrs(**req_copy)
+ _service.update_security_group_rule(**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_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_vpn_gateway_connection_peer_cidrs_value_error()
+ self.test_update_security_group_rule_value_error()
- # Disable retries and run test_list_vpn_gateway_connection_peer_cidrs_value_error.
+ # Disable retries and run test_update_security_group_rule_value_error.
_service.disable_retries()
- self.test_list_vpn_gateway_connection_peer_cidrs_value_error()
+ self.test_update_security_group_rule_value_error()
-class TestRemoveVpnGatewayConnectionPeerCidr:
+class TestListSecurityGroupTargets:
"""
- Test Class for remove_vpn_gateway_connection_peer_cidr
+ Test Class for list_security_group_targets
"""
@responses.activate
- def test_remove_vpn_gateway_connection_peer_cidr_all_params(self):
+ def test_list_security_group_targets_all_params(self):
"""
- remove_vpn_gateway_connection_peer_cidr()
+ list_security_group_targets()
"""
# Set up mock
- url = preprocess_url('/vpn_gateways/testString/connections/testString/peer_cidrs/testString/testString')
+ 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-instance-network-interface", "resource_type": "network_interface"}], "total_count": 132}'
responses.add(
- responses.DELETE,
+ 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'
+ security_group_id = 'testString'
+ start = 'testString'
+ limit = 50
# Invoke method
- response = _service.remove_vpn_gateway_connection_peer_cidr(
- vpn_gateway_id,
- id,
- cidr_prefix,
- prefix_length,
+ response = _service.list_security_group_targets(
+ security_group_id,
+ 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_peer_cidr_all_params_with_retries(self):
- # Enable retries and run test_remove_vpn_gateway_connection_peer_cidr_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_remove_vpn_gateway_connection_peer_cidr_all_params()
+ self.test_list_security_group_targets_all_params()
- # Disable retries and run test_remove_vpn_gateway_connection_peer_cidr_all_params.
+ # Disable retries and run test_list_security_group_targets_all_params.
_service.disable_retries()
- self.test_remove_vpn_gateway_connection_peer_cidr_all_params()
+ self.test_list_security_group_targets_all_params()
@responses.activate
- def test_remove_vpn_gateway_connection_peer_cidr_value_error(self):
+ def test_list_security_group_targets_required_params(self):
"""
- test_remove_vpn_gateway_connection_peer_cidr_value_error()
+ test_list_security_group_targets_required_params()
"""
# Set up mock
- url = preprocess_url('/vpn_gateways/testString/connections/testString/peer_cidrs/testString/testString')
+ 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-instance-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'
+
+ # 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_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_security_group_targets_required_params()
+
+ # Disable retries and run test_list_security_group_targets_required_params.
+ _service.disable_retries()
+ self.test_list_security_group_targets_required_params()
+
+ @responses.activate
+ def test_list_security_group_targets_value_error(self):
+ """
+ test_list_security_group_targets_value_error()
+ """
+ # Set up mock
+ url = preprocess_url('/security_groups/testString/targets')
+ mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/targets?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/targets?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-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_security_group_targets(**req_copy)
+
+ def test_list_security_group_targets_value_error_with_retries(self):
+ # Enable retries and run test_list_security_group_targets_value_error.
+ _service.enable_retries()
+ self.test_list_security_group_targets_value_error()
+
+ # Disable retries and run test_list_security_group_targets_value_error.
+ _service.disable_retries()
+ self.test_list_security_group_targets_value_error()
+
+ @responses.activate
+ def test_list_security_group_targets_with_pager_get_next(self):
+ """
+ test_list_security_group_targets_with_pager_get_next()
+ """
+ # Set up a two-page mock response
+ url = preprocess_url('/security_groups/testString/targets')
+ mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"targets":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-instance-network-interface","resource_type":"network_interface"}]}'
+ mock_response2 = '{"total_count":2,"limit":1,"targets":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-instance-network-interface","resource_type":"network_interface"}]}'
+ responses.add(
+ responses.GET,
+ url,
+ body=mock_response1,
+ content_type='application/json',
+ status=200,
+ )
+ responses.add(
+ responses.GET,
+ url,
+ body=mock_response2,
+ content_type='application/json',
+ status=200,
+ )
+
+ # Exercise the pager class for this operation
+ all_results = []
+ pager = SecurityGroupTargetsPager(
+ client=_service,
+ security_group_id='testString',
+ limit=10,
+ )
+ while pager.has_next():
+ next_page = pager.get_next()
+ assert next_page is not None
+ all_results.extend(next_page)
+ assert len(all_results) == 2
+
+ @responses.activate
+ def test_list_security_group_targets_with_pager_get_all(self):
+ """
+ test_list_security_group_targets_with_pager_get_all()
+ """
+ # Set up a two-page mock response
+ url = preprocess_url('/security_groups/testString/targets')
+ mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"targets":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-instance-network-interface","resource_type":"network_interface"}]}'
+ mock_response2 = '{"total_count":2,"limit":1,"targets":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-instance-network-interface","resource_type":"network_interface"}]}'
+ responses.add(
+ responses.GET,
+ url,
+ body=mock_response1,
+ content_type='application/json',
+ status=200,
+ )
+ responses.add(
+ responses.GET,
+ url,
+ body=mock_response2,
+ content_type='application/json',
+ status=200,
+ )
+
+ # Exercise the pager class for this operation
+ pager = SecurityGroupTargetsPager(
+ client=_service,
+ security_group_id='testString',
+ limit=10,
+ )
+ all_results = pager.get_all()
+ assert all_results is not None
+ assert len(all_results) == 2
+
+
+class TestDeleteSecurityGroupTargetBinding:
+ """
+ Test Class for delete_security_group_target_binding
+ """
+
+ @responses.activate
+ def test_delete_security_group_target_binding_all_params(self):
+ """
+ delete_security_group_target_binding()
+ """
+ # Set up mock
+ url = preprocess_url('/security_groups/testString/targets/testString')
responses.add(
responses.DELETE,
url,
@@ -34488,214 +35506,243 @@ def test_remove_vpn_gateway_connection_peer_cidr_value_error(self):
)
# Set up parameter values
- vpn_gateway_id = 'testString'
+ security_group_id = 'testString'
+ id = 'testString'
+
+ # Invoke method
+ 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 == 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.
+ _service.enable_retries()
+ self.test_delete_security_group_target_binding_all_params()
+
+ # Disable retries and run test_delete_security_group_target_binding_all_params.
+ _service.disable_retries()
+ self.test_delete_security_group_target_binding_all_params()
+
+ @responses.activate
+ def test_delete_security_group_target_binding_value_error(self):
+ """
+ test_delete_security_group_target_binding_value_error()
+ """
+ # Set up mock
+ url = preprocess_url('/security_groups/testString/targets/testString')
+ responses.add(
+ responses.DELETE,
+ url,
+ status=204,
+ )
+
+ # Set up parameter values
+ security_group_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,
+ "security_group_id": security_group_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_peer_cidr(**req_copy)
+ _service.delete_security_group_target_binding(**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_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_remove_vpn_gateway_connection_peer_cidr_value_error()
+ self.test_delete_security_group_target_binding_value_error()
- # Disable retries and run test_remove_vpn_gateway_connection_peer_cidr_value_error.
+ # Disable retries and run test_delete_security_group_target_binding_value_error.
_service.disable_retries()
- self.test_remove_vpn_gateway_connection_peer_cidr_value_error()
+ self.test_delete_security_group_target_binding_value_error()
-class TestCheckVpnGatewayConnectionPeerCidr:
+class TestGetSecurityGroupTarget:
"""
- Test Class for check_vpn_gateway_connection_peer_cidr
+ Test Class for get_security_group_target
"""
@responses.activate
- def test_check_vpn_gateway_connection_peer_cidr_all_params(self):
+ def test_get_security_group_target_all_params(self):
"""
- check_vpn_gateway_connection_peer_cidr()
+ get_security_group_target()
"""
# Set up mock
- url = preprocess_url('/vpn_gateways/testString/connections/testString/peer_cidrs/testString/testString')
+ 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-instance-network-interface", "resource_type": "network_interface"}'
responses.add(
responses.GET,
url,
- status=204,
+ body=mock_response,
+ content_type='application/json',
+ status=200,
)
# Set up parameter values
- vpn_gateway_id = 'testString'
+ security_group_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.get_security_group_target(
+ security_group_id,
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_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_check_vpn_gateway_connection_peer_cidr_all_params()
+ self.test_get_security_group_target_all_params()
- # Disable retries and run test_check_vpn_gateway_connection_peer_cidr_all_params.
+ # Disable retries and run test_get_security_group_target_all_params.
_service.disable_retries()
- self.test_check_vpn_gateway_connection_peer_cidr_all_params()
+ self.test_get_security_group_target_all_params()
@responses.activate
- def test_check_vpn_gateway_connection_peer_cidr_value_error(self):
+ def test_get_security_group_target_value_error(self):
"""
- test_check_vpn_gateway_connection_peer_cidr_value_error()
+ test_get_security_group_target_value_error()
"""
# Set up mock
- url = preprocess_url('/vpn_gateways/testString/connections/testString/peer_cidrs/testString/testString')
+ 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-instance-network-interface", "resource_type": "network_interface"}'
responses.add(
responses.GET,
url,
- status=204,
+ body=mock_response,
+ content_type='application/json',
+ status=200,
)
# Set up parameter values
- vpn_gateway_id = 'testString'
+ security_group_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,
+ "security_group_id": security_group_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)
+ _service.get_security_group_target(**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.
+ 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_check_vpn_gateway_connection_peer_cidr_value_error()
+ self.test_get_security_group_target_value_error()
- # Disable retries and run test_check_vpn_gateway_connection_peer_cidr_value_error.
+ # Disable retries and run test_get_security_group_target_value_error.
_service.disable_retries()
- self.test_check_vpn_gateway_connection_peer_cidr_value_error()
+ self.test_get_security_group_target_value_error()
-class TestAddVpnGatewayConnectionPeerCidr:
+class TestCreateSecurityGroupTargetBinding:
"""
- Test Class for add_vpn_gateway_connection_peer_cidr
+ Test Class for create_security_group_target_binding
"""
@responses.activate
- def test_add_vpn_gateway_connection_peer_cidr_all_params(self):
+ def test_create_security_group_target_binding_all_params(self):
"""
- add_vpn_gateway_connection_peer_cidr()
+ create_security_group_target_binding()
"""
# Set up mock
- url = preprocess_url('/vpn_gateways/testString/connections/testString/peer_cidrs/testString/testString')
+ 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-instance-network-interface", "resource_type": "network_interface"}'
responses.add(
responses.PUT,
url,
- status=204,
+ body=mock_response,
+ content_type='application/json',
+ status=200,
)
# Set up parameter values
- vpn_gateway_id = 'testString'
+ security_group_id = 'testString'
id = 'testString'
- cidr_prefix = 'testString'
- prefix_length = 'testString'
# Invoke method
- response = _service.add_vpn_gateway_connection_peer_cidr(
- vpn_gateway_id,
+ response = _service.create_security_group_target_binding(
+ security_group_id,
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_add_vpn_gateway_connection_peer_cidr_all_params_with_retries(self):
- # Enable retries and run test_add_vpn_gateway_connection_peer_cidr_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_add_vpn_gateway_connection_peer_cidr_all_params()
+ self.test_create_security_group_target_binding_all_params()
- # Disable retries and run test_add_vpn_gateway_connection_peer_cidr_all_params.
+ # Disable retries and run test_create_security_group_target_binding_all_params.
_service.disable_retries()
- self.test_add_vpn_gateway_connection_peer_cidr_all_params()
+ self.test_create_security_group_target_binding_all_params()
@responses.activate
- def test_add_vpn_gateway_connection_peer_cidr_value_error(self):
+ def test_create_security_group_target_binding_value_error(self):
"""
- test_add_vpn_gateway_connection_peer_cidr_value_error()
+ test_create_security_group_target_binding_value_error()
"""
# Set up mock
- url = preprocess_url('/vpn_gateways/testString/connections/testString/peer_cidrs/testString/testString')
+ 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-instance-network-interface", "resource_type": "network_interface"}'
responses.add(
responses.PUT,
url,
- status=204,
+ body=mock_response,
+ content_type='application/json',
+ status=200,
)
# Set up parameter values
- vpn_gateway_id = 'testString'
+ security_group_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,
+ "security_group_id": security_group_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.create_security_group_target_binding(**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_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_add_vpn_gateway_connection_peer_cidr_value_error()
+ self.test_create_security_group_target_binding_value_error()
- # Disable retries and run test_add_vpn_gateway_connection_peer_cidr_value_error.
+ # Disable retries and run test_create_security_group_target_binding_value_error.
_service.disable_retries()
- self.test_add_vpn_gateway_connection_peer_cidr_value_error()
+ self.test_create_security_group_target_binding_value_error()
# endregion
##############################################################################
-# End of Service: VPNGateways
+# End of Service: SecurityGroups
##############################################################################
##############################################################################
-# Start of Service: VPNServers
+# Start of Service: VPNGateways
##############################################################################
# region
@@ -34746,19 +35793,19 @@ def test_new_instance_required_param_none(self):
)
-class TestListVpnServers:
+class TestListIkePolicies:
"""
- Test Class for list_vpn_servers
+ Test Class for list_ike_policies
"""
@responses.activate
- def test_list_vpn_servers_all_params(self):
+ def test_list_ike_policies_all_params(self):
"""
- list_vpn_servers()
+ list_ike_policies()
"""
# Set up mock
- url = preprocess_url('/vpn_servers')
- mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers?start=ffd653466e284937896724b2dd044c9c&limit=20"}, "total_count": 132, "vpn_servers": [{"certificate": {"crn": "crn:v1:bluemix:public:secrets-manager:us-south:a/123456:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5"}, "client_authentication": [{"method": "certificate", "identity_provider": {"provider_type": "iam"}}], "client_auto_delete": true, "client_auto_delete_timeout": 1, "client_dns_server_ips": [{"address": "192.168.3.4"}], "client_idle_timeout": 600, "client_ip_pool": "172.16.0.0/16", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpn-server:r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "enable_split_tunneling": true, "health_reasons": [{"code": "cannot_access_server_certificate", "message": "Failed to get VPN server\'s server certificate from Secrets Manager.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-health"}], "health_state": "ok", "hostname": "a8506291.us-south.vpn-server.appdomain.cloud", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-vpn-server", "port": 443, "private_ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "protocol": "udp", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpn_server", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}]}'
+ 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,
@@ -34768,19 +35815,13 @@ def test_list_vpn_servers_all_params(self):
)
# Set up parameter values
- name = 'testString'
start = 'testString'
limit = 50
- resource_group_id = 'testString'
- sort = 'name'
# Invoke method
- response = _service.list_vpn_servers(
- name=name,
+ response = _service.list_ike_policies(
start=start,
limit=limit,
- resource_group_id=resource_group_id,
- sort=sort,
headers={},
)
@@ -34790,29 +35831,26 @@ def test_list_vpn_servers_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 '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
- assert 'sort={}'.format(sort) in query_string
- def test_list_vpn_servers_all_params_with_retries(self):
- # Enable retries and run test_list_vpn_servers_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_servers_all_params()
+ self.test_list_ike_policies_all_params()
- # Disable retries and run test_list_vpn_servers_all_params.
+ # Disable retries and run test_list_ike_policies_all_params.
_service.disable_retries()
- self.test_list_vpn_servers_all_params()
+ self.test_list_ike_policies_all_params()
@responses.activate
- def test_list_vpn_servers_required_params(self):
+ def test_list_ike_policies_required_params(self):
"""
- test_list_vpn_servers_required_params()
+ test_list_ike_policies_required_params()
"""
# Set up mock
- url = preprocess_url('/vpn_servers')
- mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers?start=ffd653466e284937896724b2dd044c9c&limit=20"}, "total_count": 132, "vpn_servers": [{"certificate": {"crn": "crn:v1:bluemix:public:secrets-manager:us-south:a/123456:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5"}, "client_authentication": [{"method": "certificate", "identity_provider": {"provider_type": "iam"}}], "client_auto_delete": true, "client_auto_delete_timeout": 1, "client_dns_server_ips": [{"address": "192.168.3.4"}], "client_idle_timeout": 600, "client_ip_pool": "172.16.0.0/16", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpn-server:r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "enable_split_tunneling": true, "health_reasons": [{"code": "cannot_access_server_certificate", "message": "Failed to get VPN server\'s server certificate from Secrets Manager.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-health"}], "health_state": "ok", "hostname": "a8506291.us-south.vpn-server.appdomain.cloud", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-vpn-server", "port": 443, "private_ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "protocol": "udp", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpn_server", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}]}'
+ 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,
@@ -34822,29 +35860,29 @@ def test_list_vpn_servers_required_params(self):
)
# Invoke method
- response = _service.list_vpn_servers()
+ response = _service.list_ike_policies()
# Check for correct operation
assert len(responses.calls) == 1
assert response.status_code == 200
- def test_list_vpn_servers_required_params_with_retries(self):
- # Enable retries and run test_list_vpn_servers_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_servers_required_params()
+ self.test_list_ike_policies_required_params()
- # Disable retries and run test_list_vpn_servers_required_params.
+ # Disable retries and run test_list_ike_policies_required_params.
_service.disable_retries()
- self.test_list_vpn_servers_required_params()
+ self.test_list_ike_policies_required_params()
@responses.activate
- def test_list_vpn_servers_value_error(self):
+ def test_list_ike_policies_value_error(self):
"""
- test_list_vpn_servers_value_error()
+ test_list_ike_policies_value_error()
"""
# Set up mock
- url = preprocess_url('/vpn_servers')
- mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers?start=ffd653466e284937896724b2dd044c9c&limit=20"}, "total_count": 132, "vpn_servers": [{"certificate": {"crn": "crn:v1:bluemix:public:secrets-manager:us-south:a/123456:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5"}, "client_authentication": [{"method": "certificate", "identity_provider": {"provider_type": "iam"}}], "client_auto_delete": true, "client_auto_delete_timeout": 1, "client_dns_server_ips": [{"address": "192.168.3.4"}], "client_idle_timeout": 600, "client_ip_pool": "172.16.0.0/16", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpn-server:r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "enable_split_tunneling": true, "health_reasons": [{"code": "cannot_access_server_certificate", "message": "Failed to get VPN server\'s server certificate from Secrets Manager.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-health"}], "health_state": "ok", "hostname": "a8506291.us-south.vpn-server.appdomain.cloud", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-vpn-server", "port": 443, "private_ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "protocol": "udp", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpn_server", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}]}'
+ 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,
@@ -34859,26 +35897,26 @@ def test_list_vpn_servers_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_vpn_servers(**req_copy)
+ _service.list_ike_policies(**req_copy)
- def test_list_vpn_servers_value_error_with_retries(self):
- # Enable retries and run test_list_vpn_servers_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_servers_value_error()
+ self.test_list_ike_policies_value_error()
- # Disable retries and run test_list_vpn_servers_value_error.
+ # Disable retries and run test_list_ike_policies_value_error.
_service.disable_retries()
- self.test_list_vpn_servers_value_error()
+ self.test_list_ike_policies_value_error()
@responses.activate
- def test_list_vpn_servers_with_pager_get_next(self):
+ def test_list_ike_policies_with_pager_get_next(self):
"""
- test_list_vpn_servers_with_pager_get_next()
+ test_list_ike_policies_with_pager_get_next()
"""
# Set up a two-page mock response
- url = preprocess_url('/vpn_servers')
- mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"vpn_servers":[{"certificate":{"crn":"crn:v1:bluemix:public:secrets-manager:us-south:a/123456:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5"},"client_authentication":[{"method":"certificate","identity_provider":{"provider_type":"iam"}}],"client_auto_delete":true,"client_auto_delete_timeout":1,"client_dns_server_ips":[{"address":"192.168.3.4"}],"client_idle_timeout":600,"client_ip_pool":"172.16.0.0/16","created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpn-server:r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5","enable_split_tunneling":true,"health_reasons":[{"code":"cannot_access_server_certificate","message":"Failed to get VPN server\'s server certificate from Secrets Manager.","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-health"}],"health_state":"ok","hostname":"a8506291.us-south.vpn-server.appdomain.cloud","href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5","id":"r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5","lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","name":"my-vpn-server","port":443,"private_ips":[{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"}],"protocol":"udp","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"vpn_server","security_groups":[{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271","id":"be5df5ca-12a0-494b-907e-aa6ec2bfa271","name":"my-security-group"}],"subnets":[{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}],"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"}}],"total_count":2,"limit":1}'
- mock_response2 = '{"vpn_servers":[{"certificate":{"crn":"crn:v1:bluemix:public:secrets-manager:us-south:a/123456:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5"},"client_authentication":[{"method":"certificate","identity_provider":{"provider_type":"iam"}}],"client_auto_delete":true,"client_auto_delete_timeout":1,"client_dns_server_ips":[{"address":"192.168.3.4"}],"client_idle_timeout":600,"client_ip_pool":"172.16.0.0/16","created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpn-server:r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5","enable_split_tunneling":true,"health_reasons":[{"code":"cannot_access_server_certificate","message":"Failed to get VPN server\'s server certificate from Secrets Manager.","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-health"}],"health_state":"ok","hostname":"a8506291.us-south.vpn-server.appdomain.cloud","href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5","id":"r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5","lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","name":"my-vpn-server","port":443,"private_ips":[{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"}],"protocol":"udp","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"vpn_server","security_groups":[{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271","id":"be5df5ca-12a0-494b-907e-aa6ec2bfa271","name":"my-security-group"}],"subnets":[{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}],"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"}}],"total_count":2,"limit":1}'
+ url = preprocess_url('/ike_policies')
+ mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"ike_policies":[{"authentication_algorithm":"md5","connections":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b","id":"a10a5771-dc23-442c-8460-c3601d8542f7","name":"my-vpn-connection","resource_type":"vpn_gateway_connection"}],"created_at":"2019-01-01T12:00:00.000Z","dh_group":14,"encryption_algorithm":"aes128","href":"https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b","id":"ddf51bec-3424-11e8-b467-0ed5f89f718b","ike_version":1,"key_lifetime":28800,"name":"my-ike-policy","negotiation_mode":"main","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"ike_policy"}],"limit":1}'
+ mock_response2 = '{"total_count":2,"ike_policies":[{"authentication_algorithm":"md5","connections":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b","id":"a10a5771-dc23-442c-8460-c3601d8542f7","name":"my-vpn-connection","resource_type":"vpn_gateway_connection"}],"created_at":"2019-01-01T12:00:00.000Z","dh_group":14,"encryption_algorithm":"aes128","href":"https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b","id":"ddf51bec-3424-11e8-b467-0ed5f89f718b","ike_version":1,"key_lifetime":28800,"name":"my-ike-policy","negotiation_mode":"main","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"ike_policy"}],"limit":1}'
responses.add(
responses.GET,
url,
@@ -34896,12 +35934,9 @@ def test_list_vpn_servers_with_pager_get_next(self):
# Exercise the pager class for this operation
all_results = []
- pager = VpnServersPager(
+ pager = IkePoliciesPager(
client=_service,
- name='testString',
limit=10,
- resource_group_id='testString',
- sort='name',
)
while pager.has_next():
next_page = pager.get_next()
@@ -34910,14 +35945,14 @@ def test_list_vpn_servers_with_pager_get_next(self):
assert len(all_results) == 2
@responses.activate
- def test_list_vpn_servers_with_pager_get_all(self):
+ def test_list_ike_policies_with_pager_get_all(self):
"""
- test_list_vpn_servers_with_pager_get_all()
+ test_list_ike_policies_with_pager_get_all()
"""
# Set up a two-page mock response
- url = preprocess_url('/vpn_servers')
- mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"vpn_servers":[{"certificate":{"crn":"crn:v1:bluemix:public:secrets-manager:us-south:a/123456:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5"},"client_authentication":[{"method":"certificate","identity_provider":{"provider_type":"iam"}}],"client_auto_delete":true,"client_auto_delete_timeout":1,"client_dns_server_ips":[{"address":"192.168.3.4"}],"client_idle_timeout":600,"client_ip_pool":"172.16.0.0/16","created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpn-server:r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5","enable_split_tunneling":true,"health_reasons":[{"code":"cannot_access_server_certificate","message":"Failed to get VPN server\'s server certificate from Secrets Manager.","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-health"}],"health_state":"ok","hostname":"a8506291.us-south.vpn-server.appdomain.cloud","href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5","id":"r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5","lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","name":"my-vpn-server","port":443,"private_ips":[{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"}],"protocol":"udp","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"vpn_server","security_groups":[{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271","id":"be5df5ca-12a0-494b-907e-aa6ec2bfa271","name":"my-security-group"}],"subnets":[{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}],"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"}}],"total_count":2,"limit":1}'
- mock_response2 = '{"vpn_servers":[{"certificate":{"crn":"crn:v1:bluemix:public:secrets-manager:us-south:a/123456:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5"},"client_authentication":[{"method":"certificate","identity_provider":{"provider_type":"iam"}}],"client_auto_delete":true,"client_auto_delete_timeout":1,"client_dns_server_ips":[{"address":"192.168.3.4"}],"client_idle_timeout":600,"client_ip_pool":"172.16.0.0/16","created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpn-server:r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5","enable_split_tunneling":true,"health_reasons":[{"code":"cannot_access_server_certificate","message":"Failed to get VPN server\'s server certificate from Secrets Manager.","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-health"}],"health_state":"ok","hostname":"a8506291.us-south.vpn-server.appdomain.cloud","href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5","id":"r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5","lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","name":"my-vpn-server","port":443,"private_ips":[{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"}],"protocol":"udp","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"vpn_server","security_groups":[{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271","id":"be5df5ca-12a0-494b-907e-aa6ec2bfa271","name":"my-security-group"}],"subnets":[{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}],"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"}}],"total_count":2,"limit":1}'
+ url = preprocess_url('/ike_policies')
+ mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"ike_policies":[{"authentication_algorithm":"md5","connections":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b","id":"a10a5771-dc23-442c-8460-c3601d8542f7","name":"my-vpn-connection","resource_type":"vpn_gateway_connection"}],"created_at":"2019-01-01T12:00:00.000Z","dh_group":14,"encryption_algorithm":"aes128","href":"https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b","id":"ddf51bec-3424-11e8-b467-0ed5f89f718b","ike_version":1,"key_lifetime":28800,"name":"my-ike-policy","negotiation_mode":"main","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"ike_policy"}],"limit":1}'
+ mock_response2 = '{"total_count":2,"ike_policies":[{"authentication_algorithm":"md5","connections":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b","id":"a10a5771-dc23-442c-8460-c3601d8542f7","name":"my-vpn-connection","resource_type":"vpn_gateway_connection"}],"created_at":"2019-01-01T12:00:00.000Z","dh_group":14,"encryption_algorithm":"aes128","href":"https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b","id":"ddf51bec-3424-11e8-b467-0ed5f89f718b","ike_version":1,"key_lifetime":28800,"name":"my-ike-policy","negotiation_mode":"main","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"ike_policy"}],"limit":1}'
responses.add(
responses.GET,
url,
@@ -34934,31 +35969,28 @@ def test_list_vpn_servers_with_pager_get_all(self):
)
# Exercise the pager class for this operation
- pager = VpnServersPager(
+ pager = IkePoliciesPager(
client=_service,
- name='testString',
limit=10,
- resource_group_id='testString',
- sort='name',
)
all_results = pager.get_all()
assert all_results is not None
assert len(all_results) == 2
-class TestCreateVpnServer:
+class TestCreateIkePolicy:
"""
- Test Class for create_vpn_server
+ Test Class for create_ike_policy
"""
@responses.activate
- def test_create_vpn_server_all_params(self):
+ def test_create_ike_policy_all_params(self):
"""
- create_vpn_server()
+ create_ike_policy()
"""
# Set up mock
- url = preprocess_url('/vpn_servers')
- mock_response = '{"certificate": {"crn": "crn:v1:bluemix:public:secrets-manager:us-south:a/123456:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5"}, "client_authentication": [{"method": "certificate", "identity_provider": {"provider_type": "iam"}}], "client_auto_delete": true, "client_auto_delete_timeout": 1, "client_dns_server_ips": [{"address": "192.168.3.4"}], "client_idle_timeout": 600, "client_ip_pool": "172.16.0.0/16", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpn-server:r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "enable_split_tunneling": true, "health_reasons": [{"code": "cannot_access_server_certificate", "message": "Failed to get VPN server\'s server certificate from Secrets Manager.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-health"}], "health_state": "ok", "hostname": "a8506291.us-south.vpn-server.appdomain.cloud", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-vpn-server", "port": 443, "private_ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "protocol": "udp", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpn_server", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}'
+ 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,
@@ -34967,63 +35999,28 @@ def test_create_vpn_server_all_params(self):
status=201,
)
- # Construct a dict representation of a CertificateInstanceIdentityByCRN model
- certificate_instance_identity_model = {}
- certificate_instance_identity_model['crn'] = 'crn:v1:bluemix:public:secrets-manager:us-south:a/123456:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5'
-
- # Construct a dict representation of a VPNServerAuthenticationByUsernameIdProviderByIAM model
- vpn_server_authentication_by_username_id_provider_model = {}
- vpn_server_authentication_by_username_id_provider_model['provider_type'] = 'iam'
-
- # Construct a dict representation of a VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype model
- vpn_server_authentication_prototype_model = {}
- vpn_server_authentication_prototype_model['method'] = 'username'
- vpn_server_authentication_prototype_model['identity_provider'] = vpn_server_authentication_by_username_id_provider_model
-
- # Construct a dict representation of a SubnetIdentityById model
- subnet_identity_model = {}
- subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
-
- # Construct a dict representation of a IP model
- ip_model = {}
- ip_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 SecurityGroupIdentityById model
- security_group_identity_model = {}
- security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271'
-
# Set up parameter values
- certificate = certificate_instance_identity_model
- client_authentication = [vpn_server_authentication_prototype_model]
- client_ip_pool = '172.16.0.0/16'
- subnets = [subnet_identity_model]
- client_dns_server_ips = [ip_model]
- client_idle_timeout = 600
- enable_split_tunneling = False
- name = 'my-vpn-server'
- port = 443
- protocol = 'udp'
+ authentication_algorithm = 'sha256'
+ dh_group = 14
+ encryption_algorithm = 'aes128'
+ ike_version = 1
+ key_lifetime = 28800
+ name = 'my-ike-policy'
resource_group = resource_group_identity_model
- security_groups = [security_group_identity_model]
# Invoke method
- response = _service.create_vpn_server(
- certificate,
- client_authentication,
- client_ip_pool,
- subnets,
- client_dns_server_ips=client_dns_server_ips,
- client_idle_timeout=client_idle_timeout,
- enable_split_tunneling=enable_split_tunneling,
+ response = _service.create_ike_policy(
+ authentication_algorithm,
+ dh_group,
+ encryption_algorithm,
+ ike_version,
+ key_lifetime=key_lifetime,
name=name,
- port=port,
- protocol=protocol,
resource_group=resource_group,
- security_groups=security_groups,
headers={},
)
@@ -35032,36 +36029,31 @@ def test_create_vpn_server_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['certificate'] == certificate_instance_identity_model
- assert req_body['client_authentication'] == [vpn_server_authentication_prototype_model]
- assert req_body['client_ip_pool'] == '172.16.0.0/16'
- assert req_body['subnets'] == [subnet_identity_model]
- assert req_body['client_dns_server_ips'] == [ip_model]
- assert req_body['client_idle_timeout'] == 600
- assert req_body['enable_split_tunneling'] == False
- assert req_body['name'] == 'my-vpn-server'
- assert req_body['port'] == 443
- assert req_body['protocol'] == 'udp'
+ assert req_body['authentication_algorithm'] == 'sha256'
+ 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
- assert req_body['security_groups'] == [security_group_identity_model]
- def test_create_vpn_server_all_params_with_retries(self):
- # Enable retries and run test_create_vpn_server_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_server_all_params()
+ self.test_create_ike_policy_all_params()
- # Disable retries and run test_create_vpn_server_all_params.
+ # Disable retries and run test_create_ike_policy_all_params.
_service.disable_retries()
- self.test_create_vpn_server_all_params()
+ self.test_create_ike_policy_all_params()
@responses.activate
- def test_create_vpn_server_value_error(self):
+ def test_create_ike_policy_value_error(self):
"""
- test_create_vpn_server_value_error()
+ test_create_ike_policy_value_error()
"""
# Set up mock
- url = preprocess_url('/vpn_servers')
- mock_response = '{"certificate": {"crn": "crn:v1:bluemix:public:secrets-manager:us-south:a/123456:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5"}, "client_authentication": [{"method": "certificate", "identity_provider": {"provider_type": "iam"}}], "client_auto_delete": true, "client_auto_delete_timeout": 1, "client_dns_server_ips": [{"address": "192.168.3.4"}], "client_idle_timeout": 600, "client_ip_pool": "172.16.0.0/16", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpn-server:r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "enable_split_tunneling": true, "health_reasons": [{"code": "cannot_access_server_certificate", "message": "Failed to get VPN server\'s server certificate from Secrets Manager.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-health"}], "health_state": "ok", "hostname": "a8506291.us-south.vpn-server.appdomain.cloud", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-vpn-server", "port": 443, "private_ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "protocol": "udp", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpn_server", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}'
+ 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,
@@ -35070,159 +36062,92 @@ def test_create_vpn_server_value_error(self):
status=201,
)
- # Construct a dict representation of a CertificateInstanceIdentityByCRN model
- certificate_instance_identity_model = {}
- certificate_instance_identity_model['crn'] = 'crn:v1:bluemix:public:secrets-manager:us-south:a/123456:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5'
-
- # Construct a dict representation of a VPNServerAuthenticationByUsernameIdProviderByIAM model
- vpn_server_authentication_by_username_id_provider_model = {}
- vpn_server_authentication_by_username_id_provider_model['provider_type'] = 'iam'
-
- # Construct a dict representation of a VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype model
- vpn_server_authentication_prototype_model = {}
- vpn_server_authentication_prototype_model['method'] = 'username'
- vpn_server_authentication_prototype_model['identity_provider'] = vpn_server_authentication_by_username_id_provider_model
-
- # Construct a dict representation of a SubnetIdentityById model
- subnet_identity_model = {}
- subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
-
- # Construct a dict representation of a IP model
- ip_model = {}
- ip_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 SecurityGroupIdentityById model
- security_group_identity_model = {}
- security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271'
-
# Set up parameter values
- certificate = certificate_instance_identity_model
- client_authentication = [vpn_server_authentication_prototype_model]
- client_ip_pool = '172.16.0.0/16'
- subnets = [subnet_identity_model]
- client_dns_server_ips = [ip_model]
- client_idle_timeout = 600
- enable_split_tunneling = False
- name = 'my-vpn-server'
- port = 443
- protocol = 'udp'
+ authentication_algorithm = 'sha256'
+ dh_group = 14
+ encryption_algorithm = 'aes128'
+ ike_version = 1
+ key_lifetime = 28800
+ name = 'my-ike-policy'
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 = {
- "certificate": certificate,
- "client_authentication": client_authentication,
- "client_ip_pool": client_ip_pool,
- "subnets": subnets,
+ "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_server(**req_copy)
+ _service.create_ike_policy(**req_copy)
- def test_create_vpn_server_value_error_with_retries(self):
- # Enable retries and run test_create_vpn_server_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_server_value_error()
+ self.test_create_ike_policy_value_error()
- # Disable retries and run test_create_vpn_server_value_error.
+ # Disable retries and run test_create_ike_policy_value_error.
_service.disable_retries()
- self.test_create_vpn_server_value_error()
+ self.test_create_ike_policy_value_error()
-class TestDeleteVpnServer:
+class TestDeleteIkePolicy:
"""
- Test Class for delete_vpn_server
+ Test Class for delete_ike_policy
"""
@responses.activate
- def test_delete_vpn_server_all_params(self):
- """
- delete_vpn_server()
- """
- # Set up mock
- url = preprocess_url('/vpn_servers/testString')
- responses.add(
- responses.DELETE,
- url,
- status=202,
- )
-
- # Set up parameter values
- id = 'testString'
- if_match = 'W/"96d225c4-56bd-43d9-98fc-d7148e5c5028"'
-
- # Invoke method
- response = _service.delete_vpn_server(
- id,
- if_match=if_match,
- headers={},
- )
-
- # Check for correct operation
- assert len(responses.calls) == 1
- assert response.status_code == 202
-
- def test_delete_vpn_server_all_params_with_retries(self):
- # Enable retries and run test_delete_vpn_server_all_params.
- _service.enable_retries()
- self.test_delete_vpn_server_all_params()
-
- # Disable retries and run test_delete_vpn_server_all_params.
- _service.disable_retries()
- self.test_delete_vpn_server_all_params()
-
- @responses.activate
- def test_delete_vpn_server_required_params(self):
+ def test_delete_ike_policy_all_params(self):
"""
- test_delete_vpn_server_required_params()
+ delete_ike_policy()
"""
# Set up mock
- url = preprocess_url('/vpn_servers/testString')
+ url = preprocess_url('/ike_policies/testString')
responses.add(
responses.DELETE,
url,
- status=202,
+ status=204,
)
# Set up parameter values
id = 'testString'
# Invoke method
- response = _service.delete_vpn_server(
+ 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_server_required_params_with_retries(self):
- # Enable retries and run test_delete_vpn_server_required_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_server_required_params()
+ self.test_delete_ike_policy_all_params()
- # Disable retries and run test_delete_vpn_server_required_params.
+ # Disable retries and run test_delete_ike_policy_all_params.
_service.disable_retries()
- self.test_delete_vpn_server_required_params()
+ self.test_delete_ike_policy_all_params()
@responses.activate
- def test_delete_vpn_server_value_error(self):
+ def test_delete_ike_policy_value_error(self):
"""
- test_delete_vpn_server_value_error()
+ test_delete_ike_policy_value_error()
"""
# Set up mock
- url = preprocess_url('/vpn_servers/testString')
+ url = preprocess_url('/ike_policies/testString')
responses.add(
responses.DELETE,
url,
- status=202,
+ status=204,
)
# Set up parameter values
@@ -35235,31 +36160,31 @@ def test_delete_vpn_server_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_vpn_server(**req_copy)
+ _service.delete_ike_policy(**req_copy)
- def test_delete_vpn_server_value_error_with_retries(self):
- # Enable retries and run test_delete_vpn_server_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_server_value_error()
+ self.test_delete_ike_policy_value_error()
- # Disable retries and run test_delete_vpn_server_value_error.
+ # Disable retries and run test_delete_ike_policy_value_error.
_service.disable_retries()
- self.test_delete_vpn_server_value_error()
+ self.test_delete_ike_policy_value_error()
-class TestGetVpnServer:
+class TestGetIkePolicy:
"""
- Test Class for get_vpn_server
+ Test Class for get_ike_policy
"""
@responses.activate
- def test_get_vpn_server_all_params(self):
+ def test_get_ike_policy_all_params(self):
"""
- get_vpn_server()
+ get_ike_policy()
"""
# Set up mock
- url = preprocess_url('/vpn_servers/testString')
- mock_response = '{"certificate": {"crn": "crn:v1:bluemix:public:secrets-manager:us-south:a/123456:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5"}, "client_authentication": [{"method": "certificate", "identity_provider": {"provider_type": "iam"}}], "client_auto_delete": true, "client_auto_delete_timeout": 1, "client_dns_server_ips": [{"address": "192.168.3.4"}], "client_idle_timeout": 600, "client_ip_pool": "172.16.0.0/16", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpn-server:r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "enable_split_tunneling": true, "health_reasons": [{"code": "cannot_access_server_certificate", "message": "Failed to get VPN server\'s server certificate from Secrets Manager.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-health"}], "health_state": "ok", "hostname": "a8506291.us-south.vpn-server.appdomain.cloud", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-vpn-server", "port": 443, "private_ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "protocol": "udp", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpn_server", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}'
+ 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,
@@ -35272,7 +36197,7 @@ def test_get_vpn_server_all_params(self):
id = 'testString'
# Invoke method
- response = _service.get_vpn_server(
+ response = _service.get_ike_policy(
id,
headers={},
)
@@ -35281,23 +36206,23 @@ def test_get_vpn_server_all_params(self):
assert len(responses.calls) == 1
assert response.status_code == 200
- def test_get_vpn_server_all_params_with_retries(self):
- # Enable retries and run test_get_vpn_server_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_server_all_params()
+ self.test_get_ike_policy_all_params()
- # Disable retries and run test_get_vpn_server_all_params.
+ # Disable retries and run test_get_ike_policy_all_params.
_service.disable_retries()
- self.test_get_vpn_server_all_params()
+ self.test_get_ike_policy_all_params()
@responses.activate
- def test_get_vpn_server_value_error(self):
+ def test_get_ike_policy_value_error(self):
"""
- test_get_vpn_server_value_error()
+ test_get_ike_policy_value_error()
"""
# Set up mock
- url = preprocess_url('/vpn_servers/testString')
- mock_response = '{"certificate": {"crn": "crn:v1:bluemix:public:secrets-manager:us-south:a/123456:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5"}, "client_authentication": [{"method": "certificate", "identity_provider": {"provider_type": "iam"}}], "client_auto_delete": true, "client_auto_delete_timeout": 1, "client_dns_server_ips": [{"address": "192.168.3.4"}], "client_idle_timeout": 600, "client_ip_pool": "172.16.0.0/16", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpn-server:r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "enable_split_tunneling": true, "health_reasons": [{"code": "cannot_access_server_certificate", "message": "Failed to get VPN server\'s server certificate from Secrets Manager.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-health"}], "health_state": "ok", "hostname": "a8506291.us-south.vpn-server.appdomain.cloud", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-vpn-server", "port": 443, "private_ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "protocol": "udp", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpn_server", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}'
+ 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,
@@ -35316,31 +36241,31 @@ def test_get_vpn_server_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_vpn_server(**req_copy)
+ _service.get_ike_policy(**req_copy)
- def test_get_vpn_server_value_error_with_retries(self):
- # Enable retries and run test_get_vpn_server_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_server_value_error()
+ self.test_get_ike_policy_value_error()
- # Disable retries and run test_get_vpn_server_value_error.
+ # Disable retries and run test_get_ike_policy_value_error.
_service.disable_retries()
- self.test_get_vpn_server_value_error()
+ self.test_get_ike_policy_value_error()
-class TestUpdateVpnServer:
+class TestUpdateIkePolicy:
"""
- Test Class for update_vpn_server
+ Test Class for update_ike_policy
"""
@responses.activate
- def test_update_vpn_server_all_params(self):
+ def test_update_ike_policy_all_params(self):
"""
- update_vpn_server()
+ update_ike_policy()
"""
# Set up mock
- url = preprocess_url('/vpn_servers/testString')
- mock_response = '{"certificate": {"crn": "crn:v1:bluemix:public:secrets-manager:us-south:a/123456:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5"}, "client_authentication": [{"method": "certificate", "identity_provider": {"provider_type": "iam"}}], "client_auto_delete": true, "client_auto_delete_timeout": 1, "client_dns_server_ips": [{"address": "192.168.3.4"}], "client_idle_timeout": 600, "client_ip_pool": "172.16.0.0/16", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpn-server:r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "enable_split_tunneling": true, "health_reasons": [{"code": "cannot_access_server_certificate", "message": "Failed to get VPN server\'s server certificate from Secrets Manager.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-health"}], "health_state": "ok", "hostname": "a8506291.us-south.vpn-server.appdomain.cloud", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-vpn-server", "port": 443, "private_ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "protocol": "udp", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpn_server", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}'
+ 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,
@@ -35349,50 +36274,23 @@ def test_update_vpn_server_all_params(self):
status=200,
)
- # Construct a dict representation of a CertificateInstanceIdentityByCRN model
- certificate_instance_identity_model = {}
- certificate_instance_identity_model['crn'] = 'crn:v1:bluemix:public:secrets-manager:us-south:a/123456:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5'
-
- # Construct a dict representation of a VPNServerAuthenticationByUsernameIdProviderByIAM model
- vpn_server_authentication_by_username_id_provider_model = {}
- vpn_server_authentication_by_username_id_provider_model['provider_type'] = 'iam'
-
- # Construct a dict representation of a VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype model
- vpn_server_authentication_prototype_model = {}
- vpn_server_authentication_prototype_model['method'] = 'username'
- vpn_server_authentication_prototype_model['identity_provider'] = vpn_server_authentication_by_username_id_provider_model
-
- # Construct a dict representation of a IP model
- ip_model = {}
- ip_model['address'] = '192.168.3.4'
-
- # 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 VPNServerPatch model
- vpn_server_patch_model = {}
- vpn_server_patch_model['certificate'] = certificate_instance_identity_model
- vpn_server_patch_model['client_authentication'] = [vpn_server_authentication_prototype_model]
- vpn_server_patch_model['client_dns_server_ips'] = [ip_model]
- vpn_server_patch_model['client_idle_timeout'] = 600
- vpn_server_patch_model['client_ip_pool'] = '172.16.0.0/16'
- vpn_server_patch_model['enable_split_tunneling'] = True
- vpn_server_patch_model['name'] = 'my-vpn-server'
- vpn_server_patch_model['port'] = 443
- vpn_server_patch_model['protocol'] = 'udp'
- vpn_server_patch_model['subnets'] = [subnet_identity_model]
+ # Construct a dict representation of a IKEPolicyPatch model
+ ike_policy_patch_model = {}
+ ike_policy_patch_model['authentication_algorithm'] = 'sha256'
+ 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
id = 'testString'
- vpn_server_patch = vpn_server_patch_model
- if_match = 'W/"96d225c4-56bd-43d9-98fc-d7148e5c5028"'
+ ike_policy_patch = ike_policy_patch_model
# Invoke method
- response = _service.update_vpn_server(
+ response = _service.update_ike_policy(
id,
- vpn_server_patch,
- if_match=if_match,
+ ike_policy_patch,
headers={},
)
@@ -35401,25 +36299,25 @@ def test_update_vpn_server_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_server_patch
+ assert req_body == ike_policy_patch
- def test_update_vpn_server_all_params_with_retries(self):
- # Enable retries and run test_update_vpn_server_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_server_all_params()
+ self.test_update_ike_policy_all_params()
- # Disable retries and run test_update_vpn_server_all_params.
+ # Disable retries and run test_update_ike_policy_all_params.
_service.disable_retries()
- self.test_update_vpn_server_all_params()
+ self.test_update_ike_policy_all_params()
@responses.activate
- def test_update_vpn_server_required_params(self):
+ def test_update_ike_policy_value_error(self):
"""
- test_update_vpn_server_required_params()
+ test_update_ike_policy_value_error()
"""
# Set up mock
- url = preprocess_url('/vpn_servers/testString')
- mock_response = '{"certificate": {"crn": "crn:v1:bluemix:public:secrets-manager:us-south:a/123456:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5"}, "client_authentication": [{"method": "certificate", "identity_provider": {"provider_type": "iam"}}], "client_auto_delete": true, "client_auto_delete_timeout": 1, "client_dns_server_ips": [{"address": "192.168.3.4"}], "client_idle_timeout": 600, "client_ip_pool": "172.16.0.0/16", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpn-server:r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "enable_split_tunneling": true, "health_reasons": [{"code": "cannot_access_server_certificate", "message": "Failed to get VPN server\'s server certificate from Secrets Manager.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-health"}], "health_state": "ok", "hostname": "a8506291.us-south.vpn-server.appdomain.cloud", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-vpn-server", "port": 443, "private_ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "protocol": "udp", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpn_server", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}'
+ 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,
@@ -35428,285 +36326,178 @@ def test_update_vpn_server_required_params(self):
status=200,
)
- # Construct a dict representation of a CertificateInstanceIdentityByCRN model
- certificate_instance_identity_model = {}
- certificate_instance_identity_model['crn'] = 'crn:v1:bluemix:public:secrets-manager:us-south:a/123456:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5'
+ # Construct a dict representation of a IKEPolicyPatch model
+ ike_policy_patch_model = {}
+ ike_policy_patch_model['authentication_algorithm'] = 'sha256'
+ 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 VPNServerAuthenticationByUsernameIdProviderByIAM model
- vpn_server_authentication_by_username_id_provider_model = {}
- vpn_server_authentication_by_username_id_provider_model['provider_type'] = 'iam'
+ # Set up parameter values
+ id = 'testString'
+ ike_policy_patch = ike_policy_patch_model
- # Construct a dict representation of a VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype model
- vpn_server_authentication_prototype_model = {}
- vpn_server_authentication_prototype_model['method'] = 'username'
- vpn_server_authentication_prototype_model['identity_provider'] = vpn_server_authentication_by_username_id_provider_model
+ # Pass in all but one required param and check for a ValueError
+ req_param_dict = {
+ "id": id,
+ "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_ike_policy(**req_copy)
- # Construct a dict representation of a IP model
- ip_model = {}
- ip_model['address'] = '192.168.3.4'
+ 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_ike_policy_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_update_ike_policy_value_error.
+ _service.disable_retries()
+ self.test_update_ike_policy_value_error()
- # Construct a dict representation of a VPNServerPatch model
- vpn_server_patch_model = {}
- vpn_server_patch_model['certificate'] = certificate_instance_identity_model
- vpn_server_patch_model['client_authentication'] = [vpn_server_authentication_prototype_model]
- vpn_server_patch_model['client_dns_server_ips'] = [ip_model]
- vpn_server_patch_model['client_idle_timeout'] = 600
- vpn_server_patch_model['client_ip_pool'] = '172.16.0.0/16'
- vpn_server_patch_model['enable_split_tunneling'] = True
- vpn_server_patch_model['name'] = 'my-vpn-server'
- vpn_server_patch_model['port'] = 443
- vpn_server_patch_model['protocol'] = 'udp'
- vpn_server_patch_model['subnets'] = [subnet_identity_model]
+
+class TestListIkePolicyConnections:
+ """
+ Test Class for list_ike_policy_connections
+ """
+
+ @responses.activate
+ def test_list_ike_policy_connections_all_params(self):
+ """
+ list_ike_policy_connections()
+ """
+ # Set up mock
+ 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", "status_reasons": [{"code": "cannot_authenticate_connection", "message": "Failed to authenticate a connection because of mismatched IKE ID and PSK.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}], "routing_protocol": "none", "tunnels": [{"public_ip": {"address": "192.168.3.4"}, "status": "down", "status_reasons": [{"code": "cannot_authenticate_connection", "message": "Failed to authenticate a connection because of mismatched IKE ID and PSK.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}]}]}]}'
+ responses.add(
+ responses.GET,
+ url,
+ body=mock_response,
+ content_type='application/json',
+ status=200,
+ )
# Set up parameter values
id = 'testString'
- vpn_server_patch = vpn_server_patch_model
# Invoke method
- response = _service.update_vpn_server(
+ response = _service.list_ike_policy_connections(
id,
- vpn_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 == vpn_server_patch
- def test_update_vpn_server_required_params_with_retries(self):
- # Enable retries and run test_update_vpn_server_required_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_update_vpn_server_required_params()
+ self.test_list_ike_policy_connections_all_params()
- # Disable retries and run test_update_vpn_server_required_params.
+ # Disable retries and run test_list_ike_policy_connections_all_params.
_service.disable_retries()
- self.test_update_vpn_server_required_params()
+ self.test_list_ike_policy_connections_all_params()
@responses.activate
- def test_update_vpn_server_value_error(self):
+ def test_list_ike_policy_connections_value_error(self):
"""
- test_update_vpn_server_value_error()
+ test_list_ike_policy_connections_value_error()
"""
# Set up mock
- url = preprocess_url('/vpn_servers/testString')
- mock_response = '{"certificate": {"crn": "crn:v1:bluemix:public:secrets-manager:us-south:a/123456:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5"}, "client_authentication": [{"method": "certificate", "identity_provider": {"provider_type": "iam"}}], "client_auto_delete": true, "client_auto_delete_timeout": 1, "client_dns_server_ips": [{"address": "192.168.3.4"}], "client_idle_timeout": 600, "client_ip_pool": "172.16.0.0/16", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpn-server:r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "enable_split_tunneling": true, "health_reasons": [{"code": "cannot_access_server_certificate", "message": "Failed to get VPN server\'s server certificate from Secrets Manager.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-health"}], "health_state": "ok", "hostname": "a8506291.us-south.vpn-server.appdomain.cloud", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-vpn-server", "port": 443, "private_ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "protocol": "udp", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpn_server", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}'
+ 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", "status_reasons": [{"code": "cannot_authenticate_connection", "message": "Failed to authenticate a connection because of mismatched IKE ID and PSK.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}], "routing_protocol": "none", "tunnels": [{"public_ip": {"address": "192.168.3.4"}, "status": "down", "status_reasons": [{"code": "cannot_authenticate_connection", "message": "Failed to authenticate a connection because of mismatched IKE ID and PSK.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}]}]}]}'
responses.add(
- responses.PATCH,
+ 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:secrets-manager:us-south:a/123456:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5'
-
- # Construct a dict representation of a VPNServerAuthenticationByUsernameIdProviderByIAM model
- vpn_server_authentication_by_username_id_provider_model = {}
- vpn_server_authentication_by_username_id_provider_model['provider_type'] = 'iam'
-
- # Construct a dict representation of a VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype model
- vpn_server_authentication_prototype_model = {}
- vpn_server_authentication_prototype_model['method'] = 'username'
- vpn_server_authentication_prototype_model['identity_provider'] = vpn_server_authentication_by_username_id_provider_model
-
- # Construct a dict representation of a IP model
- ip_model = {}
- ip_model['address'] = '192.168.3.4'
-
- # 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 VPNServerPatch model
- vpn_server_patch_model = {}
- vpn_server_patch_model['certificate'] = certificate_instance_identity_model
- vpn_server_patch_model['client_authentication'] = [vpn_server_authentication_prototype_model]
- vpn_server_patch_model['client_dns_server_ips'] = [ip_model]
- vpn_server_patch_model['client_idle_timeout'] = 600
- vpn_server_patch_model['client_ip_pool'] = '172.16.0.0/16'
- vpn_server_patch_model['enable_split_tunneling'] = True
- vpn_server_patch_model['name'] = 'my-vpn-server'
- vpn_server_patch_model['port'] = 443
- vpn_server_patch_model['protocol'] = 'udp'
- vpn_server_patch_model['subnets'] = [subnet_identity_model]
-
# Set up parameter values
id = 'testString'
- vpn_server_patch = vpn_server_patch_model
# Pass in all but one required param and check for a ValueError
req_param_dict = {
"id": id,
- "vpn_server_patch": vpn_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.update_vpn_server(**req_copy)
+ _service.list_ike_policy_connections(**req_copy)
- def test_update_vpn_server_value_error_with_retries(self):
- # Enable retries and run test_update_vpn_server_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_update_vpn_server_value_error()
+ self.test_list_ike_policy_connections_value_error()
- # Disable retries and run test_update_vpn_server_value_error.
+ # Disable retries and run test_list_ike_policy_connections_value_error.
_service.disable_retries()
- self.test_update_vpn_server_value_error()
+ self.test_list_ike_policy_connections_value_error()
-class TestGetVpnServerClientConfiguration:
+class TestListIpsecPolicies:
"""
- Test Class for get_vpn_server_client_configuration
+ Test Class for list_ipsec_policies
"""
@responses.activate
- def test_get_vpn_server_client_configuration_all_params(self):
+ def test_list_ipsec_policies_all_params(self):
"""
- get_vpn_server_client_configuration()
+ list_ipsec_policies()
"""
# Set up mock
- url = preprocess_url('/vpn_servers/testString/client_configuration')
- mock_response = '"client\nproto udp\nremote a8506291.us-south.vpn-server.appdomain.cloud\nport 443\n\ndev tun\nnobind\n\n-----BEGIN CERTIFICATE-----\nxxxxxx\n-----END CERTIFICATE-----\n"'
+ 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": "disabled", "connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "encapsulation_mode": "tunnel", "encryption_algorithm": "aes128", "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "key_lifetime": 3600, "name": "my-ipsec-policy", "pfs": "disabled", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "ipsec_policy", "transform_protocol": "esp"}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies?start=9d5a91a3e2cbd233b5a5b33436855ed&limit=20"}, "total_count": 132}'
responses.add(
responses.GET,
url,
body=mock_response,
- content_type='text/plain',
+ content_type='application/json',
status=200,
)
# Set up parameter values
- id = 'testString'
+ start = 'testString'
+ limit = 50
# Invoke method
- response = _service.get_vpn_server_client_configuration(
- id,
+ response = _service.list_ipsec_policies(
+ 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_vpn_server_client_configuration_all_params_with_retries(self):
- # Enable retries and run test_get_vpn_server_client_configuration_all_params.
- _service.enable_retries()
- self.test_get_vpn_server_client_configuration_all_params()
-
- # Disable retries and run test_get_vpn_server_client_configuration_all_params.
- _service.disable_retries()
- self.test_get_vpn_server_client_configuration_all_params()
-
- @responses.activate
- def test_get_vpn_server_client_configuration_value_error(self):
- """
- test_get_vpn_server_client_configuration_value_error()
- """
- # Set up mock
- url = preprocess_url('/vpn_servers/testString/client_configuration')
- mock_response = '"client\nproto udp\nremote a8506291.us-south.vpn-server.appdomain.cloud\nport 443\n\ndev tun\nnobind\n\n-----BEGIN CERTIFICATE-----\nxxxxxx\n-----END CERTIFICATE-----\n"'
- responses.add(
- responses.GET,
- url,
- body=mock_response,
- content_type='text/plain',
- 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_vpn_server_client_configuration(**req_copy)
-
- def test_get_vpn_server_client_configuration_value_error_with_retries(self):
- # Enable retries and run test_get_vpn_server_client_configuration_value_error.
- _service.enable_retries()
- self.test_get_vpn_server_client_configuration_value_error()
-
- # Disable retries and run test_get_vpn_server_client_configuration_value_error.
- _service.disable_retries()
- self.test_get_vpn_server_client_configuration_value_error()
-
-
-class TestListVpnServerClients:
- """
- Test Class for list_vpn_server_clients
- """
-
- @responses.activate
- def test_list_vpn_server_clients_all_params(self):
- """
- list_vpn_server_clients()
- """
- # Set up mock
- url = preprocess_url('/vpn_servers/testString/clients')
- mock_response = '{"clients": [{"client_ip": {"address": "192.168.3.4"}, "common_name": "common_name", "created_at": "2019-01-01T12:00:00.000Z", "disconnected_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/8e454ead-0db7-48ac-9a8b-2698d8c470a7/clients/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "r006-1a15dca5-7e33-45e1-b7c5-bc690e569531", "remote_ip": {"address": "192.168.3.4"}, "remote_port": 22, "resource_type": "vpn_server_client", "status": "connected", "username": "username"}], "first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-982d72b7-db1b-4606-afb2-ed6bd4b0bed1/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531/clients?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-982d72b7-db1b-4606-afb2-ed6bd4b0bed1/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531/clients?start=a5e812a2-62c0-4555-86a5-907106760c56&limit=20"}, "total_count": 132}'
- responses.add(
- responses.GET,
- url,
- body=mock_response,
- content_type='application/json',
- status=200,
- )
-
- # Set up parameter values
- vpn_server_id = 'testString'
- start = 'testString'
- limit = 50
- sort = 'created_at'
-
- # Invoke method
- response = _service.list_vpn_server_clients(
- vpn_server_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_vpn_server_clients_all_params_with_retries(self):
- # Enable retries and run test_list_vpn_server_clients_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_list_vpn_server_clients_all_params()
+ self.test_list_ipsec_policies_all_params()
- # Disable retries and run test_list_vpn_server_clients_all_params.
+ # Disable retries and run test_list_ipsec_policies_all_params.
_service.disable_retries()
- self.test_list_vpn_server_clients_all_params()
+ self.test_list_ipsec_policies_all_params()
@responses.activate
- def test_list_vpn_server_clients_required_params(self):
+ def test_list_ipsec_policies_required_params(self):
"""
- test_list_vpn_server_clients_required_params()
+ test_list_ipsec_policies_required_params()
"""
# Set up mock
- url = preprocess_url('/vpn_servers/testString/clients')
- mock_response = '{"clients": [{"client_ip": {"address": "192.168.3.4"}, "common_name": "common_name", "created_at": "2019-01-01T12:00:00.000Z", "disconnected_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/8e454ead-0db7-48ac-9a8b-2698d8c470a7/clients/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "r006-1a15dca5-7e33-45e1-b7c5-bc690e569531", "remote_ip": {"address": "192.168.3.4"}, "remote_port": 22, "resource_type": "vpn_server_client", "status": "connected", "username": "username"}], "first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-982d72b7-db1b-4606-afb2-ed6bd4b0bed1/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531/clients?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-982d72b7-db1b-4606-afb2-ed6bd4b0bed1/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531/clients?start=a5e812a2-62c0-4555-86a5-907106760c56&limit=20"}, "total_count": 132}'
+ 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": "disabled", "connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "encapsulation_mode": "tunnel", "encryption_algorithm": "aes128", "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "key_lifetime": 3600, "name": "my-ipsec-policy", "pfs": "disabled", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "ipsec_policy", "transform_protocol": "esp"}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies?start=9d5a91a3e2cbd233b5a5b33436855ed&limit=20"}, "total_count": 132}'
responses.add(
responses.GET,
url,
@@ -35715,36 +36506,30 @@ def test_list_vpn_server_clients_required_params(self):
status=200,
)
- # Set up parameter values
- vpn_server_id = 'testString'
-
# Invoke method
- response = _service.list_vpn_server_clients(
- vpn_server_id,
- headers={},
- )
+ response = _service.list_ipsec_policies()
# Check for correct operation
assert len(responses.calls) == 1
assert response.status_code == 200
- def test_list_vpn_server_clients_required_params_with_retries(self):
- # Enable retries and run test_list_vpn_server_clients_required_params.
+ 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_vpn_server_clients_required_params()
+ self.test_list_ipsec_policies_required_params()
- # Disable retries and run test_list_vpn_server_clients_required_params.
+ # Disable retries and run test_list_ipsec_policies_required_params.
_service.disable_retries()
- self.test_list_vpn_server_clients_required_params()
+ self.test_list_ipsec_policies_required_params()
@responses.activate
- def test_list_vpn_server_clients_value_error(self):
+ def test_list_ipsec_policies_value_error(self):
"""
- test_list_vpn_server_clients_value_error()
+ test_list_ipsec_policies_value_error()
"""
# Set up mock
- url = preprocess_url('/vpn_servers/testString/clients')
- mock_response = '{"clients": [{"client_ip": {"address": "192.168.3.4"}, "common_name": "common_name", "created_at": "2019-01-01T12:00:00.000Z", "disconnected_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/8e454ead-0db7-48ac-9a8b-2698d8c470a7/clients/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "r006-1a15dca5-7e33-45e1-b7c5-bc690e569531", "remote_ip": {"address": "192.168.3.4"}, "remote_port": 22, "resource_type": "vpn_server_client", "status": "connected", "username": "username"}], "first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-982d72b7-db1b-4606-afb2-ed6bd4b0bed1/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531/clients?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-982d72b7-db1b-4606-afb2-ed6bd4b0bed1/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531/clients?start=a5e812a2-62c0-4555-86a5-907106760c56&limit=20"}, "total_count": 132}'
+ 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": "disabled", "connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "encapsulation_mode": "tunnel", "encryption_algorithm": "aes128", "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "key_lifetime": 3600, "name": "my-ipsec-policy", "pfs": "disabled", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "ipsec_policy", "transform_protocol": "esp"}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies?start=9d5a91a3e2cbd233b5a5b33436855ed&limit=20"}, "total_count": 132}'
responses.add(
responses.GET,
url,
@@ -35753,36 +36538,32 @@ def test_list_vpn_server_clients_value_error(self):
status=200,
)
- # Set up parameter values
- vpn_server_id = 'testString'
-
# Pass in all but one required param and check for a ValueError
req_param_dict = {
- "vpn_server_id": vpn_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_vpn_server_clients(**req_copy)
+ _service.list_ipsec_policies(**req_copy)
- def test_list_vpn_server_clients_value_error_with_retries(self):
- # Enable retries and run test_list_vpn_server_clients_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_list_vpn_server_clients_value_error()
+ self.test_list_ipsec_policies_value_error()
- # Disable retries and run test_list_vpn_server_clients_value_error.
+ # Disable retries and run test_list_ipsec_policies_value_error.
_service.disable_retries()
- self.test_list_vpn_server_clients_value_error()
+ self.test_list_ipsec_policies_value_error()
@responses.activate
- def test_list_vpn_server_clients_with_pager_get_next(self):
+ def test_list_ipsec_policies_with_pager_get_next(self):
"""
- test_list_vpn_server_clients_with_pager_get_next()
+ test_list_ipsec_policies_with_pager_get_next()
"""
# Set up a two-page mock response
- url = preprocess_url('/vpn_servers/testString/clients')
- mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"clients":[{"client_ip":{"address":"192.168.3.4"},"common_name":"common_name","created_at":"2019-01-01T12:00:00.000Z","disconnected_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/8e454ead-0db7-48ac-9a8b-2698d8c470a7/clients/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531","id":"r006-1a15dca5-7e33-45e1-b7c5-bc690e569531","remote_ip":{"address":"192.168.3.4"},"remote_port":22,"resource_type":"vpn_server_client","status":"connected","username":"username"}],"total_count":2,"limit":1}'
- mock_response2 = '{"clients":[{"client_ip":{"address":"192.168.3.4"},"common_name":"common_name","created_at":"2019-01-01T12:00:00.000Z","disconnected_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/8e454ead-0db7-48ac-9a8b-2698d8c470a7/clients/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531","id":"r006-1a15dca5-7e33-45e1-b7c5-bc690e569531","remote_ip":{"address":"192.168.3.4"},"remote_port":22,"resource_type":"vpn_server_client","status":"connected","username":"username"}],"total_count":2,"limit":1}'
+ url = preprocess_url('/ipsec_policies')
+ mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"ipsec_policies":[{"authentication_algorithm":"disabled","connections":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b","id":"a10a5771-dc23-442c-8460-c3601d8542f7","name":"my-vpn-connection","resource_type":"vpn_gateway_connection"}],"created_at":"2019-01-01T12:00:00.000Z","encapsulation_mode":"tunnel","encryption_algorithm":"aes128","href":"https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b","id":"ddf51bec-3424-11e8-b467-0ed5f89f718b","key_lifetime":3600,"name":"my-ipsec-policy","pfs":"disabled","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"ipsec_policy","transform_protocol":"esp"}],"total_count":2,"limit":1}'
+ mock_response2 = '{"ipsec_policies":[{"authentication_algorithm":"disabled","connections":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b","id":"a10a5771-dc23-442c-8460-c3601d8542f7","name":"my-vpn-connection","resource_type":"vpn_gateway_connection"}],"created_at":"2019-01-01T12:00:00.000Z","encapsulation_mode":"tunnel","encryption_algorithm":"aes128","href":"https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b","id":"ddf51bec-3424-11e8-b467-0ed5f89f718b","key_lifetime":3600,"name":"my-ipsec-policy","pfs":"disabled","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"ipsec_policy","transform_protocol":"esp"}],"total_count":2,"limit":1}'
responses.add(
responses.GET,
url,
@@ -35800,11 +36581,9 @@ def test_list_vpn_server_clients_with_pager_get_next(self):
# Exercise the pager class for this operation
all_results = []
- pager = VpnServerClientsPager(
+ pager = IpsecPoliciesPager(
client=_service,
- vpn_server_id='testString',
limit=10,
- sort='created_at',
)
while pager.has_next():
next_page = pager.get_next()
@@ -35813,14 +36592,14 @@ def test_list_vpn_server_clients_with_pager_get_next(self):
assert len(all_results) == 2
@responses.activate
- def test_list_vpn_server_clients_with_pager_get_all(self):
+ def test_list_ipsec_policies_with_pager_get_all(self):
"""
- test_list_vpn_server_clients_with_pager_get_all()
+ test_list_ipsec_policies_with_pager_get_all()
"""
# Set up a two-page mock response
- url = preprocess_url('/vpn_servers/testString/clients')
- mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"clients":[{"client_ip":{"address":"192.168.3.4"},"common_name":"common_name","created_at":"2019-01-01T12:00:00.000Z","disconnected_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/8e454ead-0db7-48ac-9a8b-2698d8c470a7/clients/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531","id":"r006-1a15dca5-7e33-45e1-b7c5-bc690e569531","remote_ip":{"address":"192.168.3.4"},"remote_port":22,"resource_type":"vpn_server_client","status":"connected","username":"username"}],"total_count":2,"limit":1}'
- mock_response2 = '{"clients":[{"client_ip":{"address":"192.168.3.4"},"common_name":"common_name","created_at":"2019-01-01T12:00:00.000Z","disconnected_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/8e454ead-0db7-48ac-9a8b-2698d8c470a7/clients/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531","id":"r006-1a15dca5-7e33-45e1-b7c5-bc690e569531","remote_ip":{"address":"192.168.3.4"},"remote_port":22,"resource_type":"vpn_server_client","status":"connected","username":"username"}],"total_count":2,"limit":1}'
+ url = preprocess_url('/ipsec_policies')
+ mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"ipsec_policies":[{"authentication_algorithm":"disabled","connections":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b","id":"a10a5771-dc23-442c-8460-c3601d8542f7","name":"my-vpn-connection","resource_type":"vpn_gateway_connection"}],"created_at":"2019-01-01T12:00:00.000Z","encapsulation_mode":"tunnel","encryption_algorithm":"aes128","href":"https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b","id":"ddf51bec-3424-11e8-b467-0ed5f89f718b","key_lifetime":3600,"name":"my-ipsec-policy","pfs":"disabled","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"ipsec_policy","transform_protocol":"esp"}],"total_count":2,"limit":1}'
+ mock_response2 = '{"ipsec_policies":[{"authentication_algorithm":"disabled","connections":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b","id":"a10a5771-dc23-442c-8460-c3601d8542f7","name":"my-vpn-connection","resource_type":"vpn_gateway_connection"}],"created_at":"2019-01-01T12:00:00.000Z","encapsulation_mode":"tunnel","encryption_algorithm":"aes128","href":"https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b","id":"ddf51bec-3424-11e8-b467-0ed5f89f718b","key_lifetime":3600,"name":"my-ipsec-policy","pfs":"disabled","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"ipsec_policy","transform_protocol":"esp"}],"total_count":2,"limit":1}'
responses.add(
responses.GET,
url,
@@ -35837,361 +36616,402 @@ def test_list_vpn_server_clients_with_pager_get_all(self):
)
# Exercise the pager class for this operation
- pager = VpnServerClientsPager(
+ pager = IpsecPoliciesPager(
client=_service,
- vpn_server_id='testString',
limit=10,
- sort='created_at',
)
all_results = pager.get_all()
assert all_results is not None
assert len(all_results) == 2
-class TestDeleteVpnServerClient:
+class TestCreateIpsecPolicy:
"""
- Test Class for delete_vpn_server_client
+ Test Class for create_ipsec_policy
"""
@responses.activate
- def test_delete_vpn_server_client_all_params(self):
+ def test_create_ipsec_policy_all_params(self):
"""
- delete_vpn_server_client()
+ create_ipsec_policy()
"""
# Set up mock
- url = preprocess_url('/vpn_servers/testString/clients/testString')
+ url = preprocess_url('/ipsec_policies')
+ mock_response = '{"authentication_algorithm": "disabled", "connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "encapsulation_mode": "tunnel", "encryption_algorithm": "aes128", "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "key_lifetime": 3600, "name": "my-ipsec-policy", "pfs": "disabled", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "ipsec_policy", "transform_protocol": "esp"}'
responses.add(
- responses.DELETE,
+ responses.POST,
url,
- status=202,
+ 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_server_id = 'testString'
- id = 'testString'
+ authentication_algorithm = 'disabled'
+ encryption_algorithm = 'aes128'
+ pfs = 'disabled'
+ key_lifetime = 3600
+ name = 'my-ipsec-policy'
+ resource_group = resource_group_identity_model
# Invoke method
- response = _service.delete_vpn_server_client(
- vpn_server_id,
- id,
+ 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 == 202
+ 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'] == 'disabled'
+ 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_delete_vpn_server_client_all_params_with_retries(self):
- # Enable retries and run test_delete_vpn_server_client_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_delete_vpn_server_client_all_params()
+ self.test_create_ipsec_policy_all_params()
- # Disable retries and run test_delete_vpn_server_client_all_params.
+ # Disable retries and run test_create_ipsec_policy_all_params.
_service.disable_retries()
- self.test_delete_vpn_server_client_all_params()
+ self.test_create_ipsec_policy_all_params()
@responses.activate
- def test_delete_vpn_server_client_value_error(self):
+ def test_create_ipsec_policy_value_error(self):
"""
- test_delete_vpn_server_client_value_error()
+ test_create_ipsec_policy_value_error()
"""
# Set up mock
- url = preprocess_url('/vpn_servers/testString/clients/testString')
+ url = preprocess_url('/ipsec_policies')
+ mock_response = '{"authentication_algorithm": "disabled", "connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "encapsulation_mode": "tunnel", "encryption_algorithm": "aes128", "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "key_lifetime": 3600, "name": "my-ipsec-policy", "pfs": "disabled", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "ipsec_policy", "transform_protocol": "esp"}'
responses.add(
- responses.DELETE,
+ responses.POST,
url,
- status=202,
+ 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_server_id = 'testString'
- id = 'testString'
+ authentication_algorithm = 'disabled'
+ 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_server_id": vpn_server_id,
- "id": id,
+ "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.delete_vpn_server_client(**req_copy)
+ _service.create_ipsec_policy(**req_copy)
- def test_delete_vpn_server_client_value_error_with_retries(self):
- # Enable retries and run test_delete_vpn_server_client_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_delete_vpn_server_client_value_error()
+ self.test_create_ipsec_policy_value_error()
- # Disable retries and run test_delete_vpn_server_client_value_error.
+ # Disable retries and run test_create_ipsec_policy_value_error.
_service.disable_retries()
- self.test_delete_vpn_server_client_value_error()
+ self.test_create_ipsec_policy_value_error()
-class TestGetVpnServerClient:
+class TestDeleteIpsecPolicy:
"""
- Test Class for get_vpn_server_client
+ Test Class for delete_ipsec_policy
"""
@responses.activate
- def test_get_vpn_server_client_all_params(self):
+ def test_delete_ipsec_policy_all_params(self):
"""
- get_vpn_server_client()
+ delete_ipsec_policy()
"""
# Set up mock
- url = preprocess_url('/vpn_servers/testString/clients/testString')
- mock_response = '{"client_ip": {"address": "192.168.3.4"}, "common_name": "common_name", "created_at": "2019-01-01T12:00:00.000Z", "disconnected_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/8e454ead-0db7-48ac-9a8b-2698d8c470a7/clients/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "r006-1a15dca5-7e33-45e1-b7c5-bc690e569531", "remote_ip": {"address": "192.168.3.4"}, "remote_port": 22, "resource_type": "vpn_server_client", "status": "connected", "username": "username"}'
+ url = preprocess_url('/ipsec_policies/testString')
responses.add(
- responses.GET,
+ responses.DELETE,
url,
- body=mock_response,
- content_type='application/json',
- status=200,
+ status=204,
)
# Set up parameter values
- vpn_server_id = 'testString'
id = 'testString'
# Invoke method
- response = _service.get_vpn_server_client(
- vpn_server_id,
+ response = _service.delete_ipsec_policy(
id,
headers={},
)
# Check for correct operation
assert len(responses.calls) == 1
- assert response.status_code == 200
+ assert response.status_code == 204
- def test_get_vpn_server_client_all_params_with_retries(self):
- # Enable retries and run test_get_vpn_server_client_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_get_vpn_server_client_all_params()
+ self.test_delete_ipsec_policy_all_params()
- # Disable retries and run test_get_vpn_server_client_all_params.
+ # Disable retries and run test_delete_ipsec_policy_all_params.
_service.disable_retries()
- self.test_get_vpn_server_client_all_params()
+ self.test_delete_ipsec_policy_all_params()
@responses.activate
- def test_get_vpn_server_client_value_error(self):
+ def test_delete_ipsec_policy_value_error(self):
"""
- test_get_vpn_server_client_value_error()
+ test_delete_ipsec_policy_value_error()
"""
# Set up mock
- url = preprocess_url('/vpn_servers/testString/clients/testString')
- mock_response = '{"client_ip": {"address": "192.168.3.4"}, "common_name": "common_name", "created_at": "2019-01-01T12:00:00.000Z", "disconnected_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/8e454ead-0db7-48ac-9a8b-2698d8c470a7/clients/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "r006-1a15dca5-7e33-45e1-b7c5-bc690e569531", "remote_ip": {"address": "192.168.3.4"}, "remote_port": 22, "resource_type": "vpn_server_client", "status": "connected", "username": "username"}'
+ url = preprocess_url('/ipsec_policies/testString')
responses.add(
- responses.GET,
+ responses.DELETE,
url,
- body=mock_response,
- content_type='application/json',
- status=200,
+ status=204,
)
# Set up parameter values
- vpn_server_id = 'testString'
id = 'testString'
# Pass in all but one required param and check for a ValueError
req_param_dict = {
- "vpn_server_id": vpn_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_vpn_server_client(**req_copy)
+ _service.delete_ipsec_policy(**req_copy)
- def test_get_vpn_server_client_value_error_with_retries(self):
- # Enable retries and run test_get_vpn_server_client_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_get_vpn_server_client_value_error()
+ self.test_delete_ipsec_policy_value_error()
- # Disable retries and run test_get_vpn_server_client_value_error.
+ # Disable retries and run test_delete_ipsec_policy_value_error.
_service.disable_retries()
- self.test_get_vpn_server_client_value_error()
+ self.test_delete_ipsec_policy_value_error()
-class TestDisconnectVpnClient:
+class TestGetIpsecPolicy:
"""
- Test Class for disconnect_vpn_client
+ Test Class for get_ipsec_policy
"""
@responses.activate
- def test_disconnect_vpn_client_all_params(self):
+ def test_get_ipsec_policy_all_params(self):
"""
- disconnect_vpn_client()
+ get_ipsec_policy()
"""
# Set up mock
- url = preprocess_url('/vpn_servers/testString/clients/testString/disconnect')
+ url = preprocess_url('/ipsec_policies/testString')
+ mock_response = '{"authentication_algorithm": "disabled", "connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "encapsulation_mode": "tunnel", "encryption_algorithm": "aes128", "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "key_lifetime": 3600, "name": "my-ipsec-policy", "pfs": "disabled", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "ipsec_policy", "transform_protocol": "esp"}'
responses.add(
- responses.POST,
+ responses.GET,
url,
- status=202,
+ body=mock_response,
+ content_type='application/json',
+ status=200,
)
# Set up parameter values
- vpn_server_id = 'testString'
id = 'testString'
# Invoke method
- response = _service.disconnect_vpn_client(
- vpn_server_id,
+ response = _service.get_ipsec_policy(
id,
headers={},
)
# Check for correct operation
assert len(responses.calls) == 1
- assert response.status_code == 202
+ assert response.status_code == 200
- def test_disconnect_vpn_client_all_params_with_retries(self):
- # Enable retries and run test_disconnect_vpn_client_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_disconnect_vpn_client_all_params()
+ self.test_get_ipsec_policy_all_params()
- # Disable retries and run test_disconnect_vpn_client_all_params.
+ # Disable retries and run test_get_ipsec_policy_all_params.
_service.disable_retries()
- self.test_disconnect_vpn_client_all_params()
+ self.test_get_ipsec_policy_all_params()
@responses.activate
- def test_disconnect_vpn_client_value_error(self):
+ def test_get_ipsec_policy_value_error(self):
"""
- test_disconnect_vpn_client_value_error()
+ test_get_ipsec_policy_value_error()
"""
# Set up mock
- url = preprocess_url('/vpn_servers/testString/clients/testString/disconnect')
+ url = preprocess_url('/ipsec_policies/testString')
+ mock_response = '{"authentication_algorithm": "disabled", "connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "encapsulation_mode": "tunnel", "encryption_algorithm": "aes128", "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "key_lifetime": 3600, "name": "my-ipsec-policy", "pfs": "disabled", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "ipsec_policy", "transform_protocol": "esp"}'
responses.add(
- responses.POST,
+ responses.GET,
url,
- status=202,
+ body=mock_response,
+ content_type='application/json',
+ status=200,
)
# Set up parameter values
- vpn_server_id = 'testString'
id = 'testString'
# Pass in all but one required param and check for a ValueError
req_param_dict = {
- "vpn_server_id": vpn_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.disconnect_vpn_client(**req_copy)
+ _service.get_ipsec_policy(**req_copy)
- def test_disconnect_vpn_client_value_error_with_retries(self):
- # Enable retries and run test_disconnect_vpn_client_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_disconnect_vpn_client_value_error()
+ self.test_get_ipsec_policy_value_error()
- # Disable retries and run test_disconnect_vpn_client_value_error.
+ # Disable retries and run test_get_ipsec_policy_value_error.
_service.disable_retries()
- self.test_disconnect_vpn_client_value_error()
+ self.test_get_ipsec_policy_value_error()
-class TestListVpnServerRoutes:
+class TestUpdateIpsecPolicy:
"""
- Test Class for list_vpn_server_routes
+ Test Class for update_ipsec_policy
"""
@responses.activate
- def test_list_vpn_server_routes_all_params(self):
+ def test_update_ipsec_policy_all_params(self):
"""
- list_vpn_server_routes()
+ update_ipsec_policy()
"""
# Set up mock
- url = preprocess_url('/vpn_servers/testString/routes')
- mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routes?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routes?start=a5e812a2-62c0-4555-86a5-907106760c56&limit=20"}, "routes": [{"action": "deliver", "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "health_reasons": [{"code": "internal_error", "message": "Internal error (contact IBM support).", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-route-health"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "r006-1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-vpn-route-1", "resource_type": "vpn_server_route"}], "total_count": 132}'
+ url = preprocess_url('/ipsec_policies/testString')
+ mock_response = '{"authentication_algorithm": "disabled", "connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "encapsulation_mode": "tunnel", "encryption_algorithm": "aes128", "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "key_lifetime": 3600, "name": "my-ipsec-policy", "pfs": "disabled", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "ipsec_policy", "transform_protocol": "esp"}'
responses.add(
- responses.GET,
+ responses.PATCH,
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'] = 'disabled'
+ i_psec_policy_patch_model['encryption_algorithm'] = 'aes128'
+ i_psec_policy_patch_model['key_lifetime'] = 3600
+ i_psec_policy_patch_model['name'] = 'my-ipsec-policy'
+ i_psec_policy_patch_model['pfs'] = 'disabled'
+
# Set up parameter values
- vpn_server_id = 'testString'
- start = 'testString'
- limit = 50
- sort = 'name'
+ id = 'testString'
+ i_psec_policy_patch = i_psec_policy_patch_model
# Invoke method
- response = _service.list_vpn_server_routes(
- vpn_server_id,
- start=start,
- limit=limit,
- sort=sort,
+ response = _service.update_ipsec_policy(
+ id,
+ i_psec_policy_patch,
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
+ # Validate body params
+ req_body = json.loads(str(responses.calls[0].request.body, 'utf-8'))
+ assert req_body == i_psec_policy_patch
- def test_list_vpn_server_routes_all_params_with_retries(self):
- # Enable retries and run test_list_vpn_server_routes_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_list_vpn_server_routes_all_params()
+ self.test_update_ipsec_policy_all_params()
- # Disable retries and run test_list_vpn_server_routes_all_params.
+ # Disable retries and run test_update_ipsec_policy_all_params.
_service.disable_retries()
- self.test_list_vpn_server_routes_all_params()
+ self.test_update_ipsec_policy_all_params()
@responses.activate
- def test_list_vpn_server_routes_required_params(self):
+ def test_update_ipsec_policy_value_error(self):
"""
- test_list_vpn_server_routes_required_params()
+ test_update_ipsec_policy_value_error()
"""
# Set up mock
- url = preprocess_url('/vpn_servers/testString/routes')
- mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routes?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routes?start=a5e812a2-62c0-4555-86a5-907106760c56&limit=20"}, "routes": [{"action": "deliver", "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "health_reasons": [{"code": "internal_error", "message": "Internal error (contact IBM support).", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-route-health"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "r006-1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-vpn-route-1", "resource_type": "vpn_server_route"}], "total_count": 132}'
+ url = preprocess_url('/ipsec_policies/testString')
+ mock_response = '{"authentication_algorithm": "disabled", "connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "encapsulation_mode": "tunnel", "encryption_algorithm": "aes128", "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "key_lifetime": 3600, "name": "my-ipsec-policy", "pfs": "disabled", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "ipsec_policy", "transform_protocol": "esp"}'
responses.add(
- responses.GET,
+ responses.PATCH,
url,
body=mock_response,
content_type='application/json',
status=200,
)
- # Set up parameter values
- vpn_server_id = 'testString'
+ # Construct a dict representation of a IPsecPolicyPatch model
+ i_psec_policy_patch_model = {}
+ i_psec_policy_patch_model['authentication_algorithm'] = 'disabled'
+ i_psec_policy_patch_model['encryption_algorithm'] = 'aes128'
+ i_psec_policy_patch_model['key_lifetime'] = 3600
+ i_psec_policy_patch_model['name'] = 'my-ipsec-policy'
+ i_psec_policy_patch_model['pfs'] = 'disabled'
- # Invoke method
- response = _service.list_vpn_server_routes(
- vpn_server_id,
- headers={},
- )
+ # Set up parameter values
+ id = 'testString'
+ i_psec_policy_patch = i_psec_policy_patch_model
- # Check for correct operation
- assert len(responses.calls) == 1
- assert response.status_code == 200
+ # Pass in all but one required param and check for a ValueError
+ req_param_dict = {
+ "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)
- def test_list_vpn_server_routes_required_params_with_retries(self):
- # Enable retries and run test_list_vpn_server_routes_required_params.
+ 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_list_vpn_server_routes_required_params()
+ self.test_update_ipsec_policy_value_error()
- # Disable retries and run test_list_vpn_server_routes_required_params.
+ # Disable retries and run test_update_ipsec_policy_value_error.
_service.disable_retries()
- self.test_list_vpn_server_routes_required_params()
+ self.test_update_ipsec_policy_value_error()
+
+
+class TestListIpsecPolicyConnections:
+ """
+ Test Class for list_ipsec_policy_connections
+ """
@responses.activate
- def test_list_vpn_server_routes_value_error(self):
+ def test_list_ipsec_policy_connections_all_params(self):
"""
- test_list_vpn_server_routes_value_error()
+ list_ipsec_policy_connections()
"""
# Set up mock
- url = preprocess_url('/vpn_servers/testString/routes')
- mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routes?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routes?start=a5e812a2-62c0-4555-86a5-907106760c56&limit=20"}, "routes": [{"action": "deliver", "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "health_reasons": [{"code": "internal_error", "message": "Internal error (contact IBM support).", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-route-health"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "r006-1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-vpn-route-1", "resource_type": "vpn_server_route"}], "total_count": 132}'
+ 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", "status_reasons": [{"code": "cannot_authenticate_connection", "message": "Failed to authenticate a connection because of mismatched IKE ID and PSK.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}], "routing_protocol": "none", "tunnels": [{"public_ip": {"address": "192.168.3.4"}, "status": "down", "status_reasons": [{"code": "cannot_authenticate_connection", "message": "Failed to authenticate a connection because of mismatched IKE ID and PSK.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}]}]}]}'
responses.add(
responses.GET,
url,
@@ -36201,35 +37021,198 @@ def test_list_vpn_server_routes_value_error(self):
)
# Set up parameter values
- vpn_server_id = 'testString'
+ id = 'testString'
+
+ # Invoke method
+ response = _service.list_ipsec_policy_connections(
+ id,
+ headers={},
+ )
+
+ # Check for correct operation
+ assert len(responses.calls) == 1
+ assert response.status_code == 200
+
+ 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_list_ipsec_policy_connections_all_params()
+
+ # Disable retries and run test_list_ipsec_policy_connections_all_params.
+ _service.disable_retries()
+ self.test_list_ipsec_policy_connections_all_params()
+
+ @responses.activate
+ def test_list_ipsec_policy_connections_value_error(self):
+ """
+ test_list_ipsec_policy_connections_value_error()
+ """
+ # Set up mock
+ 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", "status_reasons": [{"code": "cannot_authenticate_connection", "message": "Failed to authenticate a connection because of mismatched IKE ID and PSK.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}], "routing_protocol": "none", "tunnels": [{"public_ip": {"address": "192.168.3.4"}, "status": "down", "status_reasons": [{"code": "cannot_authenticate_connection", "message": "Failed to authenticate a connection because of mismatched IKE ID and PSK.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}]}]}]}'
+ 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 = {
- "vpn_server_id": vpn_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.list_vpn_server_routes(**req_copy)
+ _service.list_ipsec_policy_connections(**req_copy)
- def test_list_vpn_server_routes_value_error_with_retries(self):
- # Enable retries and run test_list_vpn_server_routes_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_list_vpn_server_routes_value_error()
+ self.test_list_ipsec_policy_connections_value_error()
- # Disable retries and run test_list_vpn_server_routes_value_error.
+ # Disable retries and run test_list_ipsec_policy_connections_value_error.
_service.disable_retries()
- self.test_list_vpn_server_routes_value_error()
+ self.test_list_ipsec_policy_connections_value_error()
+
+
+class TestListVpnGateways:
+ """
+ Test Class for list_vpn_gateways
+ """
@responses.activate
- def test_list_vpn_server_routes_with_pager_get_next(self):
+ def test_list_vpn_gateways_all_params(self):
"""
- test_list_vpn_server_routes_with_pager_get_next()
+ list_vpn_gateways()
+ """
+ # Set up mock
+ url = preprocess_url('/vpn_gateways')
+ mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways?start=9d5a91a3e2cbd233b5a5b33436855ed&limit=20"}, "total_count": 132, "vpn_gateways": [{"connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b", "health_reasons": [{"code": "cannot_reserve_ip_address", "message": "IP address exhaustion (release addresses on the VPN\'s subnet).", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "members": [{"health_reasons": [{"code": "cannot_reserve_ip_address", "message": "IP address exhaustion (release addresses on the VPN\'s subnet).", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health"}], "health_state": "ok", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "private_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "public_ip": {"address": "192.168.3.4"}, "role": "active"}], "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", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "mode": "route"}]}'
+ responses.add(
+ responses.GET,
+ url,
+ body=mock_response,
+ content_type='application/json',
+ status=200,
+ )
+
+ # Set up parameter values
+ start = 'testString'
+ limit = 50
+ resource_group_id = 'testString'
+ sort = 'name'
+ mode = 'route'
+
+ # Invoke method
+ response = _service.list_vpn_gateways(
+ start=start,
+ limit=limit,
+ resource_group_id=resource_group_id,
+ sort=sort,
+ mode=mode,
+ 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 'sort={}'.format(sort) 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.
+ _service.enable_retries()
+ self.test_list_vpn_gateways_all_params()
+
+ # Disable retries and run test_list_vpn_gateways_all_params.
+ _service.disable_retries()
+ self.test_list_vpn_gateways_all_params()
+
+ @responses.activate
+ def test_list_vpn_gateways_required_params(self):
+ """
+ test_list_vpn_gateways_required_params()
+ """
+ # Set up mock
+ url = preprocess_url('/vpn_gateways')
+ mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways?start=9d5a91a3e2cbd233b5a5b33436855ed&limit=20"}, "total_count": 132, "vpn_gateways": [{"connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b", "health_reasons": [{"code": "cannot_reserve_ip_address", "message": "IP address exhaustion (release addresses on the VPN\'s subnet).", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "members": [{"health_reasons": [{"code": "cannot_reserve_ip_address", "message": "IP address exhaustion (release addresses on the VPN\'s subnet).", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health"}], "health_state": "ok", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "private_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "public_ip": {"address": "192.168.3.4"}, "role": "active"}], "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", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "mode": "route"}]}'
+ responses.add(
+ responses.GET,
+ url,
+ body=mock_response,
+ content_type='application/json',
+ status=200,
+ )
+
+ # Invoke method
+ response = _service.list_vpn_gateways()
+
+ # 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.
+ _service.enable_retries()
+ self.test_list_vpn_gateways_required_params()
+
+ # Disable retries and run test_list_vpn_gateways_required_params.
+ _service.disable_retries()
+ self.test_list_vpn_gateways_required_params()
+
+ @responses.activate
+ def test_list_vpn_gateways_value_error(self):
+ """
+ test_list_vpn_gateways_value_error()
+ """
+ # Set up mock
+ url = preprocess_url('/vpn_gateways')
+ mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways?start=9d5a91a3e2cbd233b5a5b33436855ed&limit=20"}, "total_count": 132, "vpn_gateways": [{"connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b", "health_reasons": [{"code": "cannot_reserve_ip_address", "message": "IP address exhaustion (release addresses on the VPN\'s subnet).", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "members": [{"health_reasons": [{"code": "cannot_reserve_ip_address", "message": "IP address exhaustion (release addresses on the VPN\'s subnet).", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health"}], "health_state": "ok", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "private_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "public_ip": {"address": "192.168.3.4"}, "role": "active"}], "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", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "mode": "route"}]}'
+ responses.add(
+ responses.GET,
+ url,
+ body=mock_response,
+ 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_vpn_gateways(**req_copy)
+
+ def test_list_vpn_gateways_value_error_with_retries(self):
+ # Enable retries and run test_list_vpn_gateways_value_error.
+ _service.enable_retries()
+ 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()
+
+ @responses.activate
+ def test_list_vpn_gateways_with_pager_get_next(self):
+ """
+ test_list_vpn_gateways_with_pager_get_next()
"""
# Set up a two-page mock response
- url = preprocess_url('/vpn_servers/testString/routes')
- mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"routes":[{"action":"deliver","created_at":"2019-01-01T12:00:00.000Z","destination":"192.168.3.0/24","health_reasons":[{"code":"internal_error","message":"Internal error (contact IBM support).","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-route-health"}],"health_state":"ok","href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531","id":"r006-1a15dca5-7e33-45e1-b7c5-bc690e569531","lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","name":"my-vpn-route-1","resource_type":"vpn_server_route"}],"total_count":2,"limit":1}'
- mock_response2 = '{"routes":[{"action":"deliver","created_at":"2019-01-01T12:00:00.000Z","destination":"192.168.3.0/24","health_reasons":[{"code":"internal_error","message":"Internal error (contact IBM support).","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-route-health"}],"health_state":"ok","href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531","id":"r006-1a15dca5-7e33-45e1-b7c5-bc690e569531","lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","name":"my-vpn-route-1","resource_type":"vpn_server_route"}],"total_count":2,"limit":1}'
+ url = preprocess_url('/vpn_gateways')
+ mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"vpn_gateways":[{"connections":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b","id":"a10a5771-dc23-442c-8460-c3601d8542f7","name":"my-vpn-connection","resource_type":"vpn_gateway_connection"}],"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b","health_reasons":[{"code":"cannot_reserve_ip_address","message":"IP address exhaustion (release addresses on the VPN\'s subnet).","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health"}],"health_state":"ok","href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b","id":"ddf51bec-3424-11e8-b467-0ed5f89f718b","lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","members":[{"health_reasons":[{"code":"cannot_reserve_ip_address","message":"IP address exhaustion (release addresses on the VPN\'s subnet).","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health"}],"health_state":"ok","lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","private_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"public_ip":{"address":"192.168.3.4"},"role":"active"}],"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","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"},"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"},"mode":"route"}]}'
+ mock_response2 = '{"total_count":2,"limit":1,"vpn_gateways":[{"connections":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b","id":"a10a5771-dc23-442c-8460-c3601d8542f7","name":"my-vpn-connection","resource_type":"vpn_gateway_connection"}],"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b","health_reasons":[{"code":"cannot_reserve_ip_address","message":"IP address exhaustion (release addresses on the VPN\'s subnet).","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health"}],"health_state":"ok","href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b","id":"ddf51bec-3424-11e8-b467-0ed5f89f718b","lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","members":[{"health_reasons":[{"code":"cannot_reserve_ip_address","message":"IP address exhaustion (release addresses on the VPN\'s subnet).","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health"}],"health_state":"ok","lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","private_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"public_ip":{"address":"192.168.3.4"},"role":"active"}],"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","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"},"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"},"mode":"route"}]}'
responses.add(
responses.GET,
url,
@@ -36247,11 +37230,12 @@ def test_list_vpn_server_routes_with_pager_get_next(self):
# Exercise the pager class for this operation
all_results = []
- pager = VpnServerRoutesPager(
+ pager = VpnGatewaysPager(
client=_service,
- vpn_server_id='testString',
limit=10,
+ resource_group_id='testString',
sort='name',
+ mode='route',
)
while pager.has_next():
next_page = pager.get_next()
@@ -36260,14 +37244,14 @@ def test_list_vpn_server_routes_with_pager_get_next(self):
assert len(all_results) == 2
@responses.activate
- def test_list_vpn_server_routes_with_pager_get_all(self):
+ def test_list_vpn_gateways_with_pager_get_all(self):
"""
- test_list_vpn_server_routes_with_pager_get_all()
+ test_list_vpn_gateways_with_pager_get_all()
"""
# Set up a two-page mock response
- url = preprocess_url('/vpn_servers/testString/routes')
- mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"routes":[{"action":"deliver","created_at":"2019-01-01T12:00:00.000Z","destination":"192.168.3.0/24","health_reasons":[{"code":"internal_error","message":"Internal error (contact IBM support).","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-route-health"}],"health_state":"ok","href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531","id":"r006-1a15dca5-7e33-45e1-b7c5-bc690e569531","lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","name":"my-vpn-route-1","resource_type":"vpn_server_route"}],"total_count":2,"limit":1}'
- mock_response2 = '{"routes":[{"action":"deliver","created_at":"2019-01-01T12:00:00.000Z","destination":"192.168.3.0/24","health_reasons":[{"code":"internal_error","message":"Internal error (contact IBM support).","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-route-health"}],"health_state":"ok","href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531","id":"r006-1a15dca5-7e33-45e1-b7c5-bc690e569531","lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","name":"my-vpn-route-1","resource_type":"vpn_server_route"}],"total_count":2,"limit":1}'
+ url = preprocess_url('/vpn_gateways')
+ mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"vpn_gateways":[{"connections":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b","id":"a10a5771-dc23-442c-8460-c3601d8542f7","name":"my-vpn-connection","resource_type":"vpn_gateway_connection"}],"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b","health_reasons":[{"code":"cannot_reserve_ip_address","message":"IP address exhaustion (release addresses on the VPN\'s subnet).","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health"}],"health_state":"ok","href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b","id":"ddf51bec-3424-11e8-b467-0ed5f89f718b","lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","members":[{"health_reasons":[{"code":"cannot_reserve_ip_address","message":"IP address exhaustion (release addresses on the VPN\'s subnet).","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health"}],"health_state":"ok","lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","private_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"public_ip":{"address":"192.168.3.4"},"role":"active"}],"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","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"},"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"},"mode":"route"}]}'
+ mock_response2 = '{"total_count":2,"limit":1,"vpn_gateways":[{"connections":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b","id":"a10a5771-dc23-442c-8460-c3601d8542f7","name":"my-vpn-connection","resource_type":"vpn_gateway_connection"}],"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b","health_reasons":[{"code":"cannot_reserve_ip_address","message":"IP address exhaustion (release addresses on the VPN\'s subnet).","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health"}],"health_state":"ok","href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b","id":"ddf51bec-3424-11e8-b467-0ed5f89f718b","lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","members":[{"health_reasons":[{"code":"cannot_reserve_ip_address","message":"IP address exhaustion (release addresses on the VPN\'s subnet).","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health"}],"health_state":"ok","lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","private_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"public_ip":{"address":"192.168.3.4"},"role":"active"}],"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","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"},"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"},"mode":"route"}]}'
responses.add(
responses.GET,
url,
@@ -36284,30 +37268,31 @@ def test_list_vpn_server_routes_with_pager_get_all(self):
)
# Exercise the pager class for this operation
- pager = VpnServerRoutesPager(
+ pager = VpnGatewaysPager(
client=_service,
- vpn_server_id='testString',
limit=10,
+ resource_group_id='testString',
sort='name',
+ mode='route',
)
all_results = pager.get_all()
assert all_results is not None
assert len(all_results) == 2
-class TestCreateVpnServerRoute:
+class TestCreateVpnGateway:
"""
- Test Class for create_vpn_server_route
+ Test Class for create_vpn_gateway
"""
@responses.activate
- def test_create_vpn_server_route_all_params(self):
+ def test_create_vpn_gateway_all_params(self):
"""
- create_vpn_server_route()
+ create_vpn_gateway()
"""
# Set up mock
- url = preprocess_url('/vpn_servers/testString/routes')
- mock_response = '{"action": "deliver", "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "health_reasons": [{"code": "internal_error", "message": "Internal error (contact IBM support).", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-route-health"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "r006-1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-vpn-route-1", "resource_type": "vpn_server_route"}'
+ 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", "health_reasons": [{"code": "cannot_reserve_ip_address", "message": "IP address exhaustion (release addresses on the VPN\'s subnet).", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "members": [{"health_reasons": [{"code": "cannot_reserve_ip_address", "message": "IP address exhaustion (release addresses on the VPN\'s subnet).", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health"}], "health_state": "ok", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "private_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "public_ip": {"address": "192.168.3.4"}, "role": "active"}], "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", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "mode": "route"}'
responses.add(
responses.POST,
url,
@@ -36316,18 +37301,27 @@ def test_create_vpn_server_route_all_params(self):
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_server_id = 'testString'
- destination = '172.16.0.0/16'
- action = 'deliver'
- name = 'my-vpn-route-2'
+ vpn_gateway_prototype = vpn_gateway_prototype_model
# Invoke method
- response = _service.create_vpn_server_route(
- vpn_server_id,
- destination,
- action=action,
- name=name,
+ response = _service.create_vpn_gateway(
+ vpn_gateway_prototype,
headers={},
)
@@ -36336,27 +37330,25 @@ def test_create_vpn_server_route_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['destination'] == '172.16.0.0/16'
- assert req_body['action'] == 'deliver'
- assert req_body['name'] == 'my-vpn-route-2'
+ assert req_body == vpn_gateway_prototype
- def test_create_vpn_server_route_all_params_with_retries(self):
- # Enable retries and run test_create_vpn_server_route_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_create_vpn_server_route_all_params()
+ self.test_create_vpn_gateway_all_params()
- # Disable retries and run test_create_vpn_server_route_all_params.
+ # Disable retries and run test_create_vpn_gateway_all_params.
_service.disable_retries()
- self.test_create_vpn_server_route_all_params()
+ self.test_create_vpn_gateway_all_params()
@responses.activate
- def test_create_vpn_server_route_value_error(self):
+ def test_create_vpn_gateway_value_error(self):
"""
- test_create_vpn_server_route_value_error()
+ test_create_vpn_gateway_value_error()
"""
# Set up mock
- url = preprocess_url('/vpn_servers/testString/routes')
- mock_response = '{"action": "deliver", "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "health_reasons": [{"code": "internal_error", "message": "Internal error (contact IBM support).", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-route-health"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "r006-1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-vpn-route-1", "resource_type": "vpn_server_route"}'
+ 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", "health_reasons": [{"code": "cannot_reserve_ip_address", "message": "IP address exhaustion (release addresses on the VPN\'s subnet).", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "members": [{"health_reasons": [{"code": "cannot_reserve_ip_address", "message": "IP address exhaustion (release addresses on the VPN\'s subnet).", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health"}], "health_state": "ok", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "private_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "public_ip": {"address": "192.168.3.4"}, "role": "active"}], "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", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "mode": "route"}'
responses.add(
responses.POST,
url,
@@ -36365,44 +37357,55 @@ def test_create_vpn_server_route_value_error(self):
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_server_id = 'testString'
- destination = '172.16.0.0/16'
- action = 'deliver'
- name = 'my-vpn-route-2'
+ vpn_gateway_prototype = vpn_gateway_prototype_model
# Pass in all but one required param and check for a ValueError
req_param_dict = {
- "vpn_server_id": vpn_server_id,
- "destination": destination,
+ "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_server_route(**req_copy)
+ _service.create_vpn_gateway(**req_copy)
- def test_create_vpn_server_route_value_error_with_retries(self):
- # Enable retries and run test_create_vpn_server_route_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_create_vpn_server_route_value_error()
+ self.test_create_vpn_gateway_value_error()
- # Disable retries and run test_create_vpn_server_route_value_error.
+ # Disable retries and run test_create_vpn_gateway_value_error.
_service.disable_retries()
- self.test_create_vpn_server_route_value_error()
+ self.test_create_vpn_gateway_value_error()
-class TestDeleteVpnServerRoute:
+class TestDeleteVpnGateway:
"""
- Test Class for delete_vpn_server_route
+ Test Class for delete_vpn_gateway
"""
@responses.activate
- def test_delete_vpn_server_route_all_params(self):
+ def test_delete_vpn_gateway_all_params(self):
"""
- delete_vpn_server_route()
+ delete_vpn_gateway()
"""
# Set up mock
- url = preprocess_url('/vpn_servers/testString/routes/testString')
+ url = preprocess_url('/vpn_gateways/testString')
responses.add(
responses.DELETE,
url,
@@ -36410,12 +37413,10 @@ def test_delete_vpn_server_route_all_params(self):
)
# Set up parameter values
- vpn_server_id = 'testString'
id = 'testString'
# Invoke method
- response = _service.delete_vpn_server_route(
- vpn_server_id,
+ response = _service.delete_vpn_gateway(
id,
headers={},
)
@@ -36424,22 +37425,22 @@ def test_delete_vpn_server_route_all_params(self):
assert len(responses.calls) == 1
assert response.status_code == 202
- def test_delete_vpn_server_route_all_params_with_retries(self):
- # Enable retries and run test_delete_vpn_server_route_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_delete_vpn_server_route_all_params()
+ self.test_delete_vpn_gateway_all_params()
- # Disable retries and run test_delete_vpn_server_route_all_params.
+ # Disable retries and run test_delete_vpn_gateway_all_params.
_service.disable_retries()
- self.test_delete_vpn_server_route_all_params()
+ self.test_delete_vpn_gateway_all_params()
@responses.activate
- def test_delete_vpn_server_route_value_error(self):
+ def test_delete_vpn_gateway_value_error(self):
"""
- test_delete_vpn_server_route_value_error()
+ test_delete_vpn_gateway_value_error()
"""
# Set up mock
- url = preprocess_url('/vpn_servers/testString/routes/testString')
+ url = preprocess_url('/vpn_gateways/testString')
responses.add(
responses.DELETE,
url,
@@ -36447,42 +37448,40 @@ def test_delete_vpn_server_route_value_error(self):
)
# Set up parameter values
- vpn_server_id = 'testString'
id = 'testString'
# Pass in all but one required param and check for a ValueError
req_param_dict = {
- "vpn_server_id": vpn_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_vpn_server_route(**req_copy)
+ _service.delete_vpn_gateway(**req_copy)
- def test_delete_vpn_server_route_value_error_with_retries(self):
- # Enable retries and run test_delete_vpn_server_route_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_delete_vpn_server_route_value_error()
+ self.test_delete_vpn_gateway_value_error()
- # Disable retries and run test_delete_vpn_server_route_value_error.
+ # Disable retries and run test_delete_vpn_gateway_value_error.
_service.disable_retries()
- self.test_delete_vpn_server_route_value_error()
+ self.test_delete_vpn_gateway_value_error()
-class TestGetVpnServerRoute:
+class TestGetVpnGateway:
"""
- Test Class for get_vpn_server_route
+ Test Class for get_vpn_gateway
"""
@responses.activate
- def test_get_vpn_server_route_all_params(self):
+ def test_get_vpn_gateway_all_params(self):
"""
- get_vpn_server_route()
+ get_vpn_gateway()
"""
# Set up mock
- url = preprocess_url('/vpn_servers/testString/routes/testString')
- mock_response = '{"action": "deliver", "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "health_reasons": [{"code": "internal_error", "message": "Internal error (contact IBM support).", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-route-health"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "r006-1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-vpn-route-1", "resource_type": "vpn_server_route"}'
+ 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", "health_reasons": [{"code": "cannot_reserve_ip_address", "message": "IP address exhaustion (release addresses on the VPN\'s subnet).", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "members": [{"health_reasons": [{"code": "cannot_reserve_ip_address", "message": "IP address exhaustion (release addresses on the VPN\'s subnet).", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health"}], "health_state": "ok", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "private_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "public_ip": {"address": "192.168.3.4"}, "role": "active"}], "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", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "mode": "route"}'
responses.add(
responses.GET,
url,
@@ -36492,12 +37491,10 @@ def test_get_vpn_server_route_all_params(self):
)
# Set up parameter values
- vpn_server_id = 'testString'
id = 'testString'
# Invoke method
- response = _service.get_vpn_server_route(
- vpn_server_id,
+ response = _service.get_vpn_gateway(
id,
headers={},
)
@@ -36506,23 +37503,23 @@ def test_get_vpn_server_route_all_params(self):
assert len(responses.calls) == 1
assert response.status_code == 200
- def test_get_vpn_server_route_all_params_with_retries(self):
- # Enable retries and run test_get_vpn_server_route_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_get_vpn_server_route_all_params()
+ self.test_get_vpn_gateway_all_params()
- # Disable retries and run test_get_vpn_server_route_all_params.
+ # Disable retries and run test_get_vpn_gateway_all_params.
_service.disable_retries()
- self.test_get_vpn_server_route_all_params()
+ self.test_get_vpn_gateway_all_params()
@responses.activate
- def test_get_vpn_server_route_value_error(self):
+ def test_get_vpn_gateway_value_error(self):
"""
- test_get_vpn_server_route_value_error()
+ test_get_vpn_gateway_value_error()
"""
# Set up mock
- url = preprocess_url('/vpn_servers/testString/routes/testString')
- mock_response = '{"action": "deliver", "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "health_reasons": [{"code": "internal_error", "message": "Internal error (contact IBM support).", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-route-health"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "r006-1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-vpn-route-1", "resource_type": "vpn_server_route"}'
+ 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", "health_reasons": [{"code": "cannot_reserve_ip_address", "message": "IP address exhaustion (release addresses on the VPN\'s subnet).", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "members": [{"health_reasons": [{"code": "cannot_reserve_ip_address", "message": "IP address exhaustion (release addresses on the VPN\'s subnet).", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health"}], "health_state": "ok", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "private_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "public_ip": {"address": "192.168.3.4"}, "role": "active"}], "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", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "mode": "route"}'
responses.add(
responses.GET,
url,
@@ -36532,42 +37529,40 @@ def test_get_vpn_server_route_value_error(self):
)
# Set up parameter values
- vpn_server_id = 'testString'
id = 'testString'
# Pass in all but one required param and check for a ValueError
req_param_dict = {
- "vpn_server_id": vpn_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_vpn_server_route(**req_copy)
+ _service.get_vpn_gateway(**req_copy)
- def test_get_vpn_server_route_value_error_with_retries(self):
- # Enable retries and run test_get_vpn_server_route_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_get_vpn_server_route_value_error()
+ self.test_get_vpn_gateway_value_error()
- # Disable retries and run test_get_vpn_server_route_value_error.
+ # Disable retries and run test_get_vpn_gateway_value_error.
_service.disable_retries()
- self.test_get_vpn_server_route_value_error()
+ self.test_get_vpn_gateway_value_error()
-class TestUpdateVpnServerRoute:
+class TestUpdateVpnGateway:
"""
- Test Class for update_vpn_server_route
+ Test Class for update_vpn_gateway
"""
@responses.activate
- def test_update_vpn_server_route_all_params(self):
+ def test_update_vpn_gateway_all_params(self):
"""
- update_vpn_server_route()
+ update_vpn_gateway()
"""
# Set up mock
- url = preprocess_url('/vpn_servers/testString/routes/testString')
- mock_response = '{"action": "deliver", "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "health_reasons": [{"code": "internal_error", "message": "Internal error (contact IBM support).", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-route-health"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "r006-1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-vpn-route-1", "resource_type": "vpn_server_route"}'
+ 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", "health_reasons": [{"code": "cannot_reserve_ip_address", "message": "IP address exhaustion (release addresses on the VPN\'s subnet).", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "members": [{"health_reasons": [{"code": "cannot_reserve_ip_address", "message": "IP address exhaustion (release addresses on the VPN\'s subnet).", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health"}], "health_state": "ok", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "private_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "public_ip": {"address": "192.168.3.4"}, "role": "active"}], "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", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "mode": "route"}'
responses.add(
responses.PATCH,
url,
@@ -36576,20 +37571,18 @@ def test_update_vpn_server_route_all_params(self):
status=200,
)
- # Construct a dict representation of a VPNServerRoutePatch model
- vpn_server_route_patch_model = {}
- vpn_server_route_patch_model['name'] = 'my-vpn-route-2'
+ # Construct a dict representation of a VPNGatewayPatch model
+ vpn_gateway_patch_model = {}
+ vpn_gateway_patch_model['name'] = 'my-vpn-gateway'
# Set up parameter values
- vpn_server_id = 'testString'
id = 'testString'
- vpn_server_route_patch = vpn_server_route_patch_model
+ vpn_gateway_patch = vpn_gateway_patch_model
# Invoke method
- response = _service.update_vpn_server_route(
- vpn_server_id,
+ response = _service.update_vpn_gateway(
id,
- vpn_server_route_patch,
+ vpn_gateway_patch,
headers={},
)
@@ -36598,25 +37591,25 @@ def test_update_vpn_server_route_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_server_route_patch
+ assert req_body == vpn_gateway_patch
- def test_update_vpn_server_route_all_params_with_retries(self):
- # Enable retries and run test_update_vpn_server_route_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_update_vpn_server_route_all_params()
+ self.test_update_vpn_gateway_all_params()
- # Disable retries and run test_update_vpn_server_route_all_params.
+ # Disable retries and run test_update_vpn_gateway_all_params.
_service.disable_retries()
- self.test_update_vpn_server_route_all_params()
+ self.test_update_vpn_gateway_all_params()
@responses.activate
- def test_update_vpn_server_route_value_error(self):
+ def test_update_vpn_gateway_value_error(self):
"""
- test_update_vpn_server_route_value_error()
+ test_update_vpn_gateway_value_error()
"""
# Set up mock
- url = preprocess_url('/vpn_servers/testString/routes/testString')
- mock_response = '{"action": "deliver", "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "health_reasons": [{"code": "internal_error", "message": "Internal error (contact IBM support).", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-route-health"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "r006-1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-vpn-route-1", "resource_type": "vpn_server_route"}'
+ 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", "health_reasons": [{"code": "cannot_reserve_ip_address", "message": "IP address exhaustion (release addresses on the VPN\'s subnet).", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "members": [{"health_reasons": [{"code": "cannot_reserve_ip_address", "message": "IP address exhaustion (release addresses on the VPN\'s subnet).", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health"}], "health_state": "ok", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "private_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "public_ip": {"address": "192.168.3.4"}, "role": "active"}], "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", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "mode": "route"}'
responses.add(
responses.PATCH,
url,
@@ -36625,122 +37618,63 @@ def test_update_vpn_server_route_value_error(self):
status=200,
)
- # Construct a dict representation of a VPNServerRoutePatch model
- vpn_server_route_patch_model = {}
- vpn_server_route_patch_model['name'] = 'my-vpn-route-2'
+ # Construct a dict representation of a VPNGatewayPatch model
+ vpn_gateway_patch_model = {}
+ vpn_gateway_patch_model['name'] = 'my-vpn-gateway'
# Set up parameter values
- vpn_server_id = 'testString'
id = 'testString'
- vpn_server_route_patch = vpn_server_route_patch_model
+ vpn_gateway_patch = vpn_gateway_patch_model
# Pass in all but one required param and check for a ValueError
req_param_dict = {
- "vpn_server_id": vpn_server_id,
"id": id,
- "vpn_server_route_patch": vpn_server_route_patch,
+ "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_server_route(**req_copy)
+ _service.update_vpn_gateway(**req_copy)
- def test_update_vpn_server_route_value_error_with_retries(self):
- # Enable retries and run test_update_vpn_server_route_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_update_vpn_server_route_value_error()
+ self.test_update_vpn_gateway_value_error()
- # Disable retries and run test_update_vpn_server_route_value_error.
+ # Disable retries and run test_update_vpn_gateway_value_error.
_service.disable_retries()
- self.test_update_vpn_server_route_value_error()
-
-
-# endregion
-##############################################################################
-# End of Service: VPNServers
-##############################################################################
-
-##############################################################################
-# Start of Service: LoadBalancers
-##############################################################################
-# region
+ self.test_update_vpn_gateway_value_error()
-class TestNewInstance:
+class TestListVpnGatewayConnections:
"""
- Test Class for new_instance
+ Test Class for list_vpn_gateway_connections
"""
- def test_new_instance(self):
+ @responses.activate
+ def test_list_vpn_gateway_connections_all_params(self):
"""
- new_instance()
+ list_vpn_gateway_connections()
"""
- os.environ['TEST_SERVICE_AUTH_TYPE'] = 'noAuth'
-
- service = VpcV1.new_instance(
- version=version,
- service_name='TEST_SERVICE',
+ # 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", "status_reasons": [{"code": "cannot_authenticate_connection", "message": "Failed to authenticate a connection because of mismatched IKE ID and PSK.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}], "routing_protocol": "none", "tunnels": [{"public_ip": {"address": "192.168.3.4"}, "status": "down", "status_reasons": [{"code": "cannot_authenticate_connection", "message": "Failed to authenticate a connection because of mismatched IKE ID and PSK.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}]}]}]}'
+ responses.add(
+ responses.GET,
+ url,
+ body=mock_response,
+ content_type='application/json',
+ status=200,
)
- 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 TestListLoadBalancerProfiles:
- """
- Test Class for list_load_balancer_profiles
- """
-
- @responses.activate
- def test_list_load_balancer_profiles_all_params(self):
- """
- list_load_balancer_profiles()
- """
- # Set up mock
- url = preprocess_url('/load_balancer/profiles')
- mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "profiles": [{"family": "network", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed", "instance_groups_supported": {"type": "fixed", "value": true}, "logging_supported": {"type": "fixed", "value": ["datapath"]}, "name": "network-fixed", "route_mode_supported": {"type": "fixed", "value": true}, "security_groups_supported": {"type": "fixed", "value": true}, "udp_supported": {"type": "fixed", "value": true}}], "total_count": 132}'
- responses.add(
- responses.GET,
- url,
- body=mock_response,
- content_type='application/json',
- status=200,
- )
-
- # Set up parameter values
- start = 'testString'
- limit = 50
+ # Set up parameter values
+ vpn_gateway_id = 'testString'
+ status = 'down'
# Invoke method
- response = _service.list_load_balancer_profiles(
- start=start,
- limit=limit,
+ response = _service.list_vpn_gateway_connections(
+ vpn_gateway_id,
+ status=status,
headers={},
)
@@ -36750,26 +37684,25 @@ def test_list_load_balancer_profiles_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 'start={}'.format(start) in query_string
- assert 'limit={}'.format(limit) in query_string
+ assert 'status={}'.format(status) 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_gateway_connections_all_params_with_retries(self):
+ # Enable retries and run test_list_vpn_gateway_connections_all_params.
_service.enable_retries()
- self.test_list_load_balancer_profiles_all_params()
+ self.test_list_vpn_gateway_connections_all_params()
- # Disable retries and run test_list_load_balancer_profiles_all_params.
+ # Disable retries and run test_list_vpn_gateway_connections_all_params.
_service.disable_retries()
- self.test_list_load_balancer_profiles_all_params()
+ self.test_list_vpn_gateway_connections_all_params()
@responses.activate
- def test_list_load_balancer_profiles_required_params(self):
+ def test_list_vpn_gateway_connections_required_params(self):
"""
- test_list_load_balancer_profiles_required_params()
+ test_list_vpn_gateway_connections_required_params()
"""
# Set up mock
- url = preprocess_url('/load_balancer/profiles')
- mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "profiles": [{"family": "network", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed", "instance_groups_supported": {"type": "fixed", "value": true}, "logging_supported": {"type": "fixed", "value": ["datapath"]}, "name": "network-fixed", "route_mode_supported": {"type": "fixed", "value": true}, "security_groups_supported": {"type": "fixed", "value": true}, "udp_supported": {"type": "fixed", "value": true}}], "total_count": 132}'
+ 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", "status_reasons": [{"code": "cannot_authenticate_connection", "message": "Failed to authenticate a connection because of mismatched IKE ID and PSK.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}], "routing_protocol": "none", "tunnels": [{"public_ip": {"address": "192.168.3.4"}, "status": "down", "status_reasons": [{"code": "cannot_authenticate_connection", "message": "Failed to authenticate a connection because of mismatched IKE ID and PSK.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}]}]}]}'
responses.add(
responses.GET,
url,
@@ -36778,30 +37711,36 @@ def test_list_load_balancer_profiles_required_params(self):
status=200,
)
+ # Set up parameter values
+ vpn_gateway_id = 'testString'
+
# Invoke method
- response = _service.list_load_balancer_profiles()
+ 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_list_load_balancer_profiles_required_params_with_retries(self):
- # Enable retries and run test_list_load_balancer_profiles_required_params.
+ 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_list_load_balancer_profiles_required_params()
+ self.test_list_vpn_gateway_connections_required_params()
- # Disable retries and run test_list_load_balancer_profiles_required_params.
+ # Disable retries and run test_list_vpn_gateway_connections_required_params.
_service.disable_retries()
- self.test_list_load_balancer_profiles_required_params()
+ self.test_list_vpn_gateway_connections_required_params()
@responses.activate
- def test_list_load_balancer_profiles_value_error(self):
+ def test_list_vpn_gateway_connections_value_error(self):
"""
- test_list_load_balancer_profiles_value_error()
+ test_list_vpn_gateway_connections_value_error()
"""
# Set up mock
- url = preprocess_url('/load_balancer/profiles')
- mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "profiles": [{"family": "network", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed", "instance_groups_supported": {"type": "fixed", "value": true}, "logging_supported": {"type": "fixed", "value": ["datapath"]}, "name": "network-fixed", "route_mode_supported": {"type": "fixed", "value": true}, "security_groups_supported": {"type": "fixed", "value": true}, "udp_supported": {"type": "fixed", "value": true}}], "total_count": 132}'
+ 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", "status_reasons": [{"code": "cannot_authenticate_connection", "message": "Failed to authenticate a connection because of mismatched IKE ID and PSK.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}], "routing_protocol": "none", "tunnels": [{"public_ip": {"address": "192.168.3.4"}, "status": "down", "status_reasons": [{"code": "cannot_authenticate_connection", "message": "Failed to authenticate a connection because of mismatched IKE ID and PSK.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}]}]}]}'
responses.add(
responses.GET,
url,
@@ -36810,187 +37749,258 @@ def test_list_load_balancer_profiles_value_error(self):
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_load_balancer_profiles(**req_copy)
+ _service.list_vpn_gateway_connections(**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_gateway_connections_value_error_with_retries(self):
+ # Enable retries and run test_list_vpn_gateway_connections_value_error.
_service.enable_retries()
- self.test_list_load_balancer_profiles_value_error()
+ self.test_list_vpn_gateway_connections_value_error()
- # Disable retries and run test_list_load_balancer_profiles_value_error.
+ # Disable retries and run test_list_vpn_gateway_connections_value_error.
_service.disable_retries()
- self.test_list_load_balancer_profiles_value_error()
+ self.test_list_vpn_gateway_connections_value_error()
+
+
+class TestCreateVpnGatewayConnection:
+ """
+ Test Class for create_vpn_gateway_connection
+ """
@responses.activate
- def test_list_load_balancer_profiles_with_pager_get_next(self):
+ def test_create_vpn_gateway_connection_all_params(self):
"""
- test_list_load_balancer_profiles_with_pager_get_next()
+ create_vpn_gateway_connection()
"""
- # Set up a two-page mock response
- url = preprocess_url('/load_balancer/profiles')
- mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"profiles":[{"family":"network","href":"https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed","instance_groups_supported":{"type":"fixed","value":true},"logging_supported":{"type":"fixed","value":["datapath"]},"name":"network-fixed","route_mode_supported":{"type":"fixed","value":true},"security_groups_supported":{"type":"fixed","value":true},"udp_supported":{"type":"fixed","value":true}}]}'
- mock_response2 = '{"total_count":2,"limit":1,"profiles":[{"family":"network","href":"https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed","instance_groups_supported":{"type":"fixed","value":true},"logging_supported":{"type":"fixed","value":["datapath"]},"name":"network-fixed","route_mode_supported":{"type":"fixed","value":true},"security_groups_supported":{"type":"fixed","value":true},"udp_supported":{"type":"fixed","value":true}}]}'
- responses.add(
- responses.GET,
- url,
- body=mock_response1,
- content_type='application/json',
- status=200,
- )
+ # Set up mock
+ 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", "status_reasons": [{"code": "cannot_authenticate_connection", "message": "Failed to authenticate a connection because of mismatched IKE ID and PSK.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}], "routing_protocol": "none", "tunnels": [{"public_ip": {"address": "192.168.3.4"}, "status": "down", "status_reasons": [{"code": "cannot_authenticate_connection", "message": "Failed to authenticate a connection because of mismatched IKE ID and PSK.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}]}]}'
responses.add(
- responses.GET,
+ responses.POST,
url,
- body=mock_response2,
+ body=mock_response,
content_type='application/json',
- status=200,
+ status=201,
)
- # Exercise the pager class for this operation
- all_results = []
- pager = LoadBalancerProfilesPager(
- client=_service,
- limit=10,
+ # 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'
+
+ # Set up parameter values
+ vpn_gateway_id = 'testString'
+ vpn_gateway_connection_prototype = vpn_gateway_connection_prototype_model
+
+ # Invoke method
+ response = _service.create_vpn_gateway_connection(
+ vpn_gateway_id,
+ vpn_gateway_connection_prototype,
+ headers={},
)
- while pager.has_next():
- next_page = pager.get_next()
- assert next_page is not None
- all_results.extend(next_page)
- assert len(all_results) == 2
+
+ # 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_connection_prototype
+
+ 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_create_vpn_gateway_connection_all_params()
+
+ # Disable retries and run test_create_vpn_gateway_connection_all_params.
+ _service.disable_retries()
+ self.test_create_vpn_gateway_connection_all_params()
@responses.activate
- def test_list_load_balancer_profiles_with_pager_get_all(self):
+ def test_create_vpn_gateway_connection_value_error(self):
"""
- test_list_load_balancer_profiles_with_pager_get_all()
+ test_create_vpn_gateway_connection_value_error()
"""
- # Set up a two-page mock response
- url = preprocess_url('/load_balancer/profiles')
- mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"profiles":[{"family":"network","href":"https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed","instance_groups_supported":{"type":"fixed","value":true},"logging_supported":{"type":"fixed","value":["datapath"]},"name":"network-fixed","route_mode_supported":{"type":"fixed","value":true},"security_groups_supported":{"type":"fixed","value":true},"udp_supported":{"type":"fixed","value":true}}]}'
- mock_response2 = '{"total_count":2,"limit":1,"profiles":[{"family":"network","href":"https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed","instance_groups_supported":{"type":"fixed","value":true},"logging_supported":{"type":"fixed","value":["datapath"]},"name":"network-fixed","route_mode_supported":{"type":"fixed","value":true},"security_groups_supported":{"type":"fixed","value":true},"udp_supported":{"type":"fixed","value":true}}]}'
- responses.add(
- responses.GET,
- url,
- body=mock_response1,
- content_type='application/json',
- status=200,
- )
+ # Set up mock
+ 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", "status_reasons": [{"code": "cannot_authenticate_connection", "message": "Failed to authenticate a connection because of mismatched IKE ID and PSK.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}], "routing_protocol": "none", "tunnels": [{"public_ip": {"address": "192.168.3.4"}, "status": "down", "status_reasons": [{"code": "cannot_authenticate_connection", "message": "Failed to authenticate a connection because of mismatched IKE ID and PSK.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}]}]}'
responses.add(
- responses.GET,
+ responses.POST,
url,
- body=mock_response2,
+ body=mock_response,
content_type='application/json',
- status=200,
+ status=201,
)
- # Exercise the pager class for this operation
- pager = LoadBalancerProfilesPager(
- client=_service,
- limit=10,
- )
- all_results = pager.get_all()
- assert all_results is not None
- assert len(all_results) == 2
+ # 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'
-class TestGetLoadBalancerProfile:
+ # 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
+
+ # 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,
+ }
+ 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)
+
+ 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_create_vpn_gateway_connection_value_error()
+
+ # Disable retries and run test_create_vpn_gateway_connection_value_error.
+ _service.disable_retries()
+ self.test_create_vpn_gateway_connection_value_error()
+
+
+class TestDeleteVpnGatewayConnection:
"""
- Test Class for get_load_balancer_profile
+ Test Class for delete_vpn_gateway_connection
"""
@responses.activate
- def test_get_load_balancer_profile_all_params(self):
+ def test_delete_vpn_gateway_connection_all_params(self):
"""
- get_load_balancer_profile()
+ delete_vpn_gateway_connection()
"""
# Set up mock
- url = preprocess_url('/load_balancer/profiles/testString')
- mock_response = '{"family": "network", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed", "instance_groups_supported": {"type": "fixed", "value": true}, "logging_supported": {"type": "fixed", "value": ["datapath"]}, "name": "network-fixed", "route_mode_supported": {"type": "fixed", "value": true}, "security_groups_supported": {"type": "fixed", "value": true}, "udp_supported": {"type": "fixed", "value": true}}'
+ url = preprocess_url('/vpn_gateways/testString/connections/testString')
responses.add(
- responses.GET,
+ responses.DELETE,
url,
- body=mock_response,
- content_type='application/json',
- status=200,
+ status=202,
)
# Set up parameter values
- name = 'testString'
+ vpn_gateway_id = 'testString'
+ id = 'testString'
# Invoke method
- response = _service.get_load_balancer_profile(
- name,
+ 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_profile_all_params_with_retries(self):
- # Enable retries and run test_get_load_balancer_profile_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_profile_all_params()
+ self.test_delete_vpn_gateway_connection_all_params()
- # Disable retries and run test_get_load_balancer_profile_all_params.
+ # Disable retries and run test_delete_vpn_gateway_connection_all_params.
_service.disable_retries()
- self.test_get_load_balancer_profile_all_params()
+ self.test_delete_vpn_gateway_connection_all_params()
@responses.activate
- def test_get_load_balancer_profile_value_error(self):
+ def test_delete_vpn_gateway_connection_value_error(self):
"""
- test_get_load_balancer_profile_value_error()
+ test_delete_vpn_gateway_connection_value_error()
"""
# Set up mock
- url = preprocess_url('/load_balancer/profiles/testString')
- mock_response = '{"family": "network", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed", "instance_groups_supported": {"type": "fixed", "value": true}, "logging_supported": {"type": "fixed", "value": ["datapath"]}, "name": "network-fixed", "route_mode_supported": {"type": "fixed", "value": true}, "security_groups_supported": {"type": "fixed", "value": true}, "udp_supported": {"type": "fixed", "value": true}}'
+ url = preprocess_url('/vpn_gateways/testString/connections/testString')
responses.add(
- responses.GET,
+ responses.DELETE,
url,
- body=mock_response,
- content_type='application/json',
- status=200,
+ status=202,
)
# Set up parameter values
- name = 'testString'
+ vpn_gateway_id = 'testString'
+ id = 'testString'
# Pass in all but one required param and check for a ValueError
req_param_dict = {
- "name": name,
+ "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_profile(**req_copy)
+ _service.delete_vpn_gateway_connection(**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_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_profile_value_error()
+ self.test_delete_vpn_gateway_connection_value_error()
- # Disable retries and run test_get_load_balancer_profile_value_error.
+ # Disable retries and run test_delete_vpn_gateway_connection_value_error.
_service.disable_retries()
- self.test_get_load_balancer_profile_value_error()
+ self.test_delete_vpn_gateway_connection_value_error()
-class TestListLoadBalancers:
+class TestGetVpnGatewayConnection:
"""
- Test Class for list_load_balancers
+ Test Class for get_vpn_gateway_connection
"""
@responses.activate
- def test_list_load_balancers_all_params(self):
+ def test_get_vpn_gateway_connection_all_params(self):
"""
- list_load_balancers()
+ get_vpn_gateway_connection()
"""
# Set up mock
- url = preprocess_url('/load_balancers')
- mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers?limit=20"}, "limit": 20, "load_balancers": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "dns": {"instance": {"crn": "crn:v1:bluemix:public:dns-svcs:global:a/123456:6860c359-b2e2-46fa-a944-b38c28201c6e"}, "zone": {"id": "d66662cc-aa23-4fe1-9987-858487a61f45"}}, "hostname": "6b88d615-us-south.lb.appdomain.cloud", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "instance_groups_supported": false, "is_public": true, "listeners": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "logging": {"datapath": {"active": true}}, "name": "my-load-balancer", "operating_status": "offline", "pools": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}], "private_ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "profile": {"family": "network", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed", "name": "network-fixed"}, "provisioning_status": "active", "public_ips": [{"address": "192.168.3.4"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "load_balancer", "route_mode": true, "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "security_groups_supported": false, "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "udp_supported": true}], "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers?start=9d5a91a3e2cbd233b5a5b33436855ed&limit=20"}, "total_count": 132}'
+ 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", "status_reasons": [{"code": "cannot_authenticate_connection", "message": "Failed to authenticate a connection because of mismatched IKE ID and PSK.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}], "routing_protocol": "none", "tunnels": [{"public_ip": {"address": "192.168.3.4"}, "status": "down", "status_reasons": [{"code": "cannot_authenticate_connection", "message": "Failed to authenticate a connection because of mismatched IKE ID and PSK.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}]}]}'
responses.add(
responses.GET,
url,
@@ -37000,42 +38010,37 @@ def test_list_load_balancers_all_params(self):
)
# Set up parameter values
- start = 'testString'
- limit = 50
+ vpn_gateway_id = 'testString'
+ id = 'testString'
# Invoke method
- response = _service.list_load_balancers(
- start=start,
- limit=limit,
+ response = _service.get_vpn_gateway_connection(
+ vpn_gateway_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
- def test_list_load_balancers_all_params_with_retries(self):
- # Enable retries and run test_list_load_balancers_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_balancers_all_params()
+ self.test_get_vpn_gateway_connection_all_params()
- # Disable retries and run test_list_load_balancers_all_params.
+ # Disable retries and run test_get_vpn_gateway_connection_all_params.
_service.disable_retries()
- self.test_list_load_balancers_all_params()
+ self.test_get_vpn_gateway_connection_all_params()
@responses.activate
- def test_list_load_balancers_required_params(self):
+ def test_get_vpn_gateway_connection_value_error(self):
"""
- test_list_load_balancers_required_params()
+ test_get_vpn_gateway_connection_value_error()
"""
# Set up mock
- url = preprocess_url('/load_balancers')
- mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers?limit=20"}, "limit": 20, "load_balancers": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "dns": {"instance": {"crn": "crn:v1:bluemix:public:dns-svcs:global:a/123456:6860c359-b2e2-46fa-a944-b38c28201c6e"}, "zone": {"id": "d66662cc-aa23-4fe1-9987-858487a61f45"}}, "hostname": "6b88d615-us-south.lb.appdomain.cloud", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "instance_groups_supported": false, "is_public": true, "listeners": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "logging": {"datapath": {"active": true}}, "name": "my-load-balancer", "operating_status": "offline", "pools": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}], "private_ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "profile": {"family": "network", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed", "name": "network-fixed"}, "provisioning_status": "active", "public_ips": [{"address": "192.168.3.4"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "load_balancer", "route_mode": true, "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "security_groups_supported": false, "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "udp_supported": true}], "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers?start=9d5a91a3e2cbd233b5a5b33436855ed&limit=20"}, "total_count": 132}'
+ 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", "status_reasons": [{"code": "cannot_authenticate_connection", "message": "Failed to authenticate a connection because of mismatched IKE ID and PSK.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}], "routing_protocol": "none", "tunnels": [{"public_ip": {"address": "192.168.3.4"}, "status": "down", "status_reasons": [{"code": "cannot_authenticate_connection", "message": "Failed to authenticate a connection because of mismatched IKE ID and PSK.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}]}]}'
responses.add(
responses.GET,
url,
@@ -37044,1790 +38049,1359 @@ def test_list_load_balancers_required_params(self):
status=200,
)
- # Invoke method
- response = _service.list_load_balancers()
+ # Set up parameter values
+ vpn_gateway_id = 'testString'
+ id = 'testString'
- # Check for correct operation
- assert len(responses.calls) == 1
- assert response.status_code == 200
+ # Pass in all but one required param and check for a ValueError
+ req_param_dict = {
+ "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)
- def test_list_load_balancers_required_params_with_retries(self):
- # Enable retries and run test_list_load_balancers_required_params.
+ 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_balancers_required_params()
+ self.test_get_vpn_gateway_connection_value_error()
- # Disable retries and run test_list_load_balancers_required_params.
+ # Disable retries and run test_get_vpn_gateway_connection_value_error.
_service.disable_retries()
- self.test_list_load_balancers_required_params()
+ self.test_get_vpn_gateway_connection_value_error()
+
+
+class TestUpdateVpnGatewayConnection:
+ """
+ Test Class for update_vpn_gateway_connection
+ """
@responses.activate
- def test_list_load_balancers_value_error(self):
+ def test_update_vpn_gateway_connection_all_params(self):
"""
- test_list_load_balancers_value_error()
+ update_vpn_gateway_connection()
"""
# Set up mock
- url = preprocess_url('/load_balancers')
- mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers?limit=20"}, "limit": 20, "load_balancers": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "dns": {"instance": {"crn": "crn:v1:bluemix:public:dns-svcs:global:a/123456:6860c359-b2e2-46fa-a944-b38c28201c6e"}, "zone": {"id": "d66662cc-aa23-4fe1-9987-858487a61f45"}}, "hostname": "6b88d615-us-south.lb.appdomain.cloud", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "instance_groups_supported": false, "is_public": true, "listeners": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "logging": {"datapath": {"active": true}}, "name": "my-load-balancer", "operating_status": "offline", "pools": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}], "private_ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "profile": {"family": "network", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed", "name": "network-fixed"}, "provisioning_status": "active", "public_ips": [{"address": "192.168.3.4"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "load_balancer", "route_mode": true, "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "security_groups_supported": false, "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "udp_supported": true}], "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers?start=9d5a91a3e2cbd233b5a5b33436855ed&limit=20"}, "total_count": 132}'
+ 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", "status_reasons": [{"code": "cannot_authenticate_connection", "message": "Failed to authenticate a connection because of mismatched IKE ID and PSK.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}], "routing_protocol": "none", "tunnels": [{"public_ip": {"address": "192.168.3.4"}, "status": "down", "status_reasons": [{"code": "cannot_authenticate_connection", "message": "Failed to authenticate a connection because of mismatched IKE ID and PSK.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}]}]}'
responses.add(
- responses.GET,
+ responses.PATCH,
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_load_balancers(**req_copy)
+ # 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
- def test_list_load_balancers_value_error_with_retries(self):
- # Enable retries and run test_list_load_balancers_value_error.
+ # 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 VPNGatewayConnectionPatch 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
+ vpn_gateway_id = 'testString'
+ id = 'testString'
+ vpn_gateway_connection_patch = vpn_gateway_connection_patch_model
+
+ # Invoke method
+ 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 == 200
+ # Validate body params
+ req_body = json.loads(str(responses.calls[0].request.body, 'utf-8'))
+ assert req_body == vpn_gateway_connection_patch
+
+ 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_list_load_balancers_value_error()
+ self.test_update_vpn_gateway_connection_all_params()
- # Disable retries and run test_list_load_balancers_value_error.
+ # Disable retries and run test_update_vpn_gateway_connection_all_params.
_service.disable_retries()
- self.test_list_load_balancers_value_error()
+ self.test_update_vpn_gateway_connection_all_params()
@responses.activate
- def test_list_load_balancers_with_pager_get_next(self):
+ def test_update_vpn_gateway_connection_value_error(self):
"""
- test_list_load_balancers_with_pager_get_next()
+ test_update_vpn_gateway_connection_value_error()
"""
- # Set up a two-page mock response
- url = preprocess_url('/load_balancers')
- mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"load_balancers":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727","dns":{"instance":{"crn":"crn:v1:bluemix:public:dns-svcs:global:a/123456:6860c359-b2e2-46fa-a944-b38c28201c6e"},"zone":{"id":"d66662cc-aa23-4fe1-9987-858487a61f45"}},"hostname":"6b88d615-us-south.lb.appdomain.cloud","href":"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727","id":"dd754295-e9e0-4c9d-bf6c-58fbc59e5727","instance_groups_supported":false,"is_public":true,"listeners":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004","id":"70294e14-4e61-11e8-bcf4-0242ac110004"}],"logging":{"datapath":{"active":true}},"name":"my-load-balancer","operating_status":"offline","pools":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004","id":"70294e14-4e61-11e8-bcf4-0242ac110004","name":"my-load-balancer-pool"}],"private_ips":[{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"}],"profile":{"family":"network","href":"https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed","name":"network-fixed"},"provisioning_status":"active","public_ips":[{"address":"192.168.3.4"}],"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"load_balancer","route_mode":true,"security_groups":[{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271","id":"be5df5ca-12a0-494b-907e-aa6ec2bfa271","name":"my-security-group"}],"security_groups_supported":false,"subnets":[{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}],"udp_supported":true}]}'
- mock_response2 = '{"total_count":2,"limit":1,"load_balancers":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727","dns":{"instance":{"crn":"crn:v1:bluemix:public:dns-svcs:global:a/123456:6860c359-b2e2-46fa-a944-b38c28201c6e"},"zone":{"id":"d66662cc-aa23-4fe1-9987-858487a61f45"}},"hostname":"6b88d615-us-south.lb.appdomain.cloud","href":"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727","id":"dd754295-e9e0-4c9d-bf6c-58fbc59e5727","instance_groups_supported":false,"is_public":true,"listeners":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004","id":"70294e14-4e61-11e8-bcf4-0242ac110004"}],"logging":{"datapath":{"active":true}},"name":"my-load-balancer","operating_status":"offline","pools":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004","id":"70294e14-4e61-11e8-bcf4-0242ac110004","name":"my-load-balancer-pool"}],"private_ips":[{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"}],"profile":{"family":"network","href":"https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed","name":"network-fixed"},"provisioning_status":"active","public_ips":[{"address":"192.168.3.4"}],"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"load_balancer","route_mode":true,"security_groups":[{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271","id":"be5df5ca-12a0-494b-907e-aa6ec2bfa271","name":"my-security-group"}],"security_groups_supported":false,"subnets":[{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}],"udp_supported":true}]}'
- responses.add(
- responses.GET,
- url,
- body=mock_response1,
- content_type='application/json',
- status=200,
- )
+ # Set up mock
+ 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", "status_reasons": [{"code": "cannot_authenticate_connection", "message": "Failed to authenticate a connection because of mismatched IKE ID and PSK.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}], "routing_protocol": "none", "tunnels": [{"public_ip": {"address": "192.168.3.4"}, "status": "down", "status_reasons": [{"code": "cannot_authenticate_connection", "message": "Failed to authenticate a connection because of mismatched IKE ID and PSK.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health"}]}]}'
responses.add(
- responses.GET,
+ responses.PATCH,
url,
- body=mock_response2,
+ body=mock_response,
content_type='application/json',
status=200,
)
- # Exercise the pager class for this operation
- all_results = []
- pager = LoadBalancersPager(
- client=_service,
- limit=10,
- )
- while pager.has_next():
- next_page = pager.get_next()
- assert next_page is not None
- all_results.extend(next_page)
- assert len(all_results) == 2
+ # 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
- @responses.activate
- def test_list_load_balancers_with_pager_get_all(self):
- """
- test_list_load_balancers_with_pager_get_all()
- """
- # Set up a two-page mock response
- url = preprocess_url('/load_balancers')
- mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"load_balancers":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727","dns":{"instance":{"crn":"crn:v1:bluemix:public:dns-svcs:global:a/123456:6860c359-b2e2-46fa-a944-b38c28201c6e"},"zone":{"id":"d66662cc-aa23-4fe1-9987-858487a61f45"}},"hostname":"6b88d615-us-south.lb.appdomain.cloud","href":"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727","id":"dd754295-e9e0-4c9d-bf6c-58fbc59e5727","instance_groups_supported":false,"is_public":true,"listeners":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004","id":"70294e14-4e61-11e8-bcf4-0242ac110004"}],"logging":{"datapath":{"active":true}},"name":"my-load-balancer","operating_status":"offline","pools":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004","id":"70294e14-4e61-11e8-bcf4-0242ac110004","name":"my-load-balancer-pool"}],"private_ips":[{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"}],"profile":{"family":"network","href":"https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed","name":"network-fixed"},"provisioning_status":"active","public_ips":[{"address":"192.168.3.4"}],"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"load_balancer","route_mode":true,"security_groups":[{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271","id":"be5df5ca-12a0-494b-907e-aa6ec2bfa271","name":"my-security-group"}],"security_groups_supported":false,"subnets":[{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}],"udp_supported":true}]}'
- mock_response2 = '{"total_count":2,"limit":1,"load_balancers":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727","dns":{"instance":{"crn":"crn:v1:bluemix:public:dns-svcs:global:a/123456:6860c359-b2e2-46fa-a944-b38c28201c6e"},"zone":{"id":"d66662cc-aa23-4fe1-9987-858487a61f45"}},"hostname":"6b88d615-us-south.lb.appdomain.cloud","href":"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727","id":"dd754295-e9e0-4c9d-bf6c-58fbc59e5727","instance_groups_supported":false,"is_public":true,"listeners":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004","id":"70294e14-4e61-11e8-bcf4-0242ac110004"}],"logging":{"datapath":{"active":true}},"name":"my-load-balancer","operating_status":"offline","pools":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004","id":"70294e14-4e61-11e8-bcf4-0242ac110004","name":"my-load-balancer-pool"}],"private_ips":[{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"}],"profile":{"family":"network","href":"https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed","name":"network-fixed"},"provisioning_status":"active","public_ips":[{"address":"192.168.3.4"}],"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"load_balancer","route_mode":true,"security_groups":[{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271","id":"be5df5ca-12a0-494b-907e-aa6ec2bfa271","name":"my-security-group"}],"security_groups_supported":false,"subnets":[{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}],"udp_supported":true}]}'
- responses.add(
- responses.GET,
- url,
- body=mock_response1,
- content_type='application/json',
- status=200,
- )
- responses.add(
- responses.GET,
- url,
- body=mock_response2,
- content_type='application/json',
- status=200,
- )
+ # 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'
- # Exercise the pager class for this operation
- pager = LoadBalancersPager(
- client=_service,
- limit=10,
- )
- all_results = pager.get_all()
- assert all_results is not None
- assert len(all_results) == 2
+ # 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 VPNGatewayConnectionPatch 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'
-class TestCreateLoadBalancer:
+ # Set up parameter values
+ 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 = {
+ "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.update_vpn_gateway_connection(**req_copy)
+
+ def test_update_vpn_gateway_connection_value_error_with_retries(self):
+ # Enable retries and run test_update_vpn_gateway_connection_value_error.
+ _service.enable_retries()
+ self.test_update_vpn_gateway_connection_value_error()
+
+ # Disable retries and run test_update_vpn_gateway_connection_value_error.
+ _service.disable_retries()
+ self.test_update_vpn_gateway_connection_value_error()
+
+
+class TestListVpnGatewayConnectionLocalCidrs:
"""
- Test Class for create_load_balancer
+ Test Class for list_vpn_gateway_connection_local_cidrs
"""
@responses.activate
- def test_create_load_balancer_all_params(self):
+ def test_list_vpn_gateway_connection_local_cidrs_all_params(self):
"""
- create_load_balancer()
+ list_vpn_gateway_connection_local_cidrs()
"""
# Set up mock
- url = preprocess_url('/load_balancers')
- mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "dns": {"instance": {"crn": "crn:v1:bluemix:public:dns-svcs:global:a/123456:6860c359-b2e2-46fa-a944-b38c28201c6e"}, "zone": {"id": "d66662cc-aa23-4fe1-9987-858487a61f45"}}, "hostname": "6b88d615-us-south.lb.appdomain.cloud", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "instance_groups_supported": false, "is_public": true, "listeners": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "logging": {"datapath": {"active": true}}, "name": "my-load-balancer", "operating_status": "offline", "pools": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}], "private_ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "profile": {"family": "network", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed", "name": "network-fixed"}, "provisioning_status": "active", "public_ips": [{"address": "192.168.3.4"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "load_balancer", "route_mode": true, "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "security_groups_supported": false, "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "udp_supported": true}'
+ url = preprocess_url('/vpn_gateways/testString/connections/testString/local_cidrs')
+ mock_response = '{"local_cidrs": ["192.168.1.0/24"]}'
responses.add(
- responses.POST,
+ responses.GET,
url,
body=mock_response,
content_type='application/json',
- status=201,
+ status=200,
)
- # 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 LoadBalancerLoggingDatapathPrototype model
- load_balancer_logging_datapath_prototype_model = {}
- load_balancer_logging_datapath_prototype_model['active'] = True
-
- # Construct a dict representation of a DNSInstanceIdentityByCRN model
- dns_instance_identity_model = {}
- dns_instance_identity_model['crn'] = 'crn:v1:bluemix:public:dns-svcs:global:a/123456:6860c359-b2e2-46fa-a944-b38c28201c6e'
-
- # Construct a dict representation of a DNSZoneIdentityById model
- dns_zone_identity_model = {}
- dns_zone_identity_model['id'] = 'd66662cc-aa23-4fe1-9987-858487a61f45'
-
- # Construct a dict representation of a LoadBalancerDNSPrototype model
- load_balancer_dns_prototype_model = {}
- load_balancer_dns_prototype_model['instance'] = dns_instance_identity_model
- load_balancer_dns_prototype_model['zone'] = dns_zone_identity_model
-
- # Construct a dict representation of a CertificateInstanceIdentityByCRN model
- certificate_instance_identity_model = {}
- certificate_instance_identity_model['crn'] = 'crn:v1:bluemix:public:secrets-manager:us-south:a/123456:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5'
-
- # Construct a dict representation of a LoadBalancerPoolIdentityByName model
- load_balancer_pool_identity_by_name_model = {}
- load_balancer_pool_identity_by_name_model['name'] = 'my-load-balancer-pool'
-
- # Construct a dict representation of a LoadBalancerListenerIdentityById model
- load_balancer_listener_identity_model = {}
- load_balancer_listener_identity_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004'
-
- # Construct a dict representation of a LoadBalancerListenerHTTPSRedirectPrototype model
- load_balancer_listener_https_redirect_prototype_model = {}
- load_balancer_listener_https_redirect_prototype_model['http_status_code'] = 301
- load_balancer_listener_https_redirect_prototype_model['listener'] = load_balancer_listener_identity_model
- load_balancer_listener_https_redirect_prototype_model['uri'] = '/example?doc=get'
-
- # Construct a dict representation of a LoadBalancerListenerPrototypeLoadBalancerContext model
- load_balancer_listener_prototype_load_balancer_context_model = {}
- load_balancer_listener_prototype_load_balancer_context_model['accept_proxy_protocol'] = True
- load_balancer_listener_prototype_load_balancer_context_model['certificate_instance'] = certificate_instance_identity_model
- load_balancer_listener_prototype_load_balancer_context_model['connection_limit'] = 2000
- load_balancer_listener_prototype_load_balancer_context_model['default_pool'] = load_balancer_pool_identity_by_name_model
- load_balancer_listener_prototype_load_balancer_context_model['https_redirect'] = load_balancer_listener_https_redirect_prototype_model
- load_balancer_listener_prototype_load_balancer_context_model['idle_connection_timeout'] = 100
- 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 LoadBalancerLoggingPrototype model
- load_balancer_logging_prototype_model = {}
- load_balancer_logging_prototype_model['datapath'] = load_balancer_logging_datapath_prototype_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'
-
# Set up parameter values
- is_public = True
- subnets = [subnet_identity_model]
- datapath = load_balancer_logging_datapath_prototype_model
- dns = load_balancer_dns_prototype_model
- listeners = [load_balancer_listener_prototype_load_balancer_context_model]
- logging = load_balancer_logging_prototype_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]
+ vpn_gateway_id = 'testString'
+ id = 'testString'
# Invoke method
- response = _service.create_load_balancer(
- is_public,
- subnets,
- datapath=datapath,
- dns=dns,
- listeners=listeners,
- logging=logging,
- name=name,
- pools=pools,
- profile=profile,
- resource_group=resource_group,
- route_mode=route_mode,
- security_groups=security_groups,
+ 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 == 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['datapath'] == load_balancer_logging_datapath_prototype_model
- assert req_body['dns'] == load_balancer_dns_prototype_model
- assert req_body['listeners'] == [load_balancer_listener_prototype_load_balancer_context_model]
- assert req_body['logging'] == load_balancer_logging_prototype_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_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_create_load_balancer_all_params()
+ self.test_list_vpn_gateway_connection_local_cidrs_all_params()
- # Disable retries and run test_create_load_balancer_all_params.
+ # Disable retries and run test_list_vpn_gateway_connection_local_cidrs_all_params.
_service.disable_retries()
- self.test_create_load_balancer_all_params()
+ self.test_list_vpn_gateway_connection_local_cidrs_all_params()
@responses.activate
- def test_create_load_balancer_value_error(self):
+ def test_list_vpn_gateway_connection_local_cidrs_value_error(self):
"""
- test_create_load_balancer_value_error()
+ test_list_vpn_gateway_connection_local_cidrs_value_error()
"""
# Set up mock
- url = preprocess_url('/load_balancers')
- mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "dns": {"instance": {"crn": "crn:v1:bluemix:public:dns-svcs:global:a/123456:6860c359-b2e2-46fa-a944-b38c28201c6e"}, "zone": {"id": "d66662cc-aa23-4fe1-9987-858487a61f45"}}, "hostname": "6b88d615-us-south.lb.appdomain.cloud", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "instance_groups_supported": false, "is_public": true, "listeners": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "logging": {"datapath": {"active": true}}, "name": "my-load-balancer", "operating_status": "offline", "pools": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}], "private_ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "profile": {"family": "network", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed", "name": "network-fixed"}, "provisioning_status": "active", "public_ips": [{"address": "192.168.3.4"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "load_balancer", "route_mode": true, "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "security_groups_supported": false, "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "udp_supported": true}'
+ url = preprocess_url('/vpn_gateways/testString/connections/testString/local_cidrs')
+ mock_response = '{"local_cidrs": ["192.168.1.0/24"]}'
responses.add(
- responses.POST,
+ responses.GET,
url,
body=mock_response,
content_type='application/json',
- status=201,
+ status=200,
)
- # 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 LoadBalancerLoggingDatapathPrototype model
- load_balancer_logging_datapath_prototype_model = {}
- load_balancer_logging_datapath_prototype_model['active'] = True
-
- # Construct a dict representation of a DNSInstanceIdentityByCRN model
- dns_instance_identity_model = {}
- dns_instance_identity_model['crn'] = 'crn:v1:bluemix:public:dns-svcs:global:a/123456:6860c359-b2e2-46fa-a944-b38c28201c6e'
-
- # Construct a dict representation of a DNSZoneIdentityById model
- dns_zone_identity_model = {}
- dns_zone_identity_model['id'] = 'd66662cc-aa23-4fe1-9987-858487a61f45'
-
- # Construct a dict representation of a LoadBalancerDNSPrototype model
- load_balancer_dns_prototype_model = {}
- load_balancer_dns_prototype_model['instance'] = dns_instance_identity_model
- load_balancer_dns_prototype_model['zone'] = dns_zone_identity_model
-
- # Construct a dict representation of a CertificateInstanceIdentityByCRN model
- certificate_instance_identity_model = {}
- certificate_instance_identity_model['crn'] = 'crn:v1:bluemix:public:secrets-manager:us-south:a/123456:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5'
-
- # Construct a dict representation of a LoadBalancerPoolIdentityByName model
- load_balancer_pool_identity_by_name_model = {}
- load_balancer_pool_identity_by_name_model['name'] = 'my-load-balancer-pool'
-
- # Construct a dict representation of a LoadBalancerListenerIdentityById model
- load_balancer_listener_identity_model = {}
- load_balancer_listener_identity_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004'
-
- # Construct a dict representation of a LoadBalancerListenerHTTPSRedirectPrototype model
- load_balancer_listener_https_redirect_prototype_model = {}
- load_balancer_listener_https_redirect_prototype_model['http_status_code'] = 301
- load_balancer_listener_https_redirect_prototype_model['listener'] = load_balancer_listener_identity_model
- load_balancer_listener_https_redirect_prototype_model['uri'] = '/example?doc=get'
-
- # Construct a dict representation of a LoadBalancerListenerPrototypeLoadBalancerContext model
- load_balancer_listener_prototype_load_balancer_context_model = {}
- load_balancer_listener_prototype_load_balancer_context_model['accept_proxy_protocol'] = True
- load_balancer_listener_prototype_load_balancer_context_model['certificate_instance'] = certificate_instance_identity_model
- load_balancer_listener_prototype_load_balancer_context_model['connection_limit'] = 2000
- load_balancer_listener_prototype_load_balancer_context_model['default_pool'] = load_balancer_pool_identity_by_name_model
- load_balancer_listener_prototype_load_balancer_context_model['https_redirect'] = load_balancer_listener_https_redirect_prototype_model
- load_balancer_listener_prototype_load_balancer_context_model['idle_connection_timeout'] = 100
- 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 LoadBalancerLoggingPrototype model
- load_balancer_logging_prototype_model = {}
- load_balancer_logging_prototype_model['datapath'] = load_balancer_logging_datapath_prototype_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'
-
# Set up parameter values
- is_public = True
- subnets = [subnet_identity_model]
- datapath = load_balancer_logging_datapath_prototype_model
- dns = load_balancer_dns_prototype_model
- listeners = [load_balancer_listener_prototype_load_balancer_context_model]
- logging = load_balancer_logging_prototype_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]
+ vpn_gateway_id = 'testString'
+ id = 'testString'
# Pass in all but one required param and check for a ValueError
req_param_dict = {
- "is_public": is_public,
- "subnets": subnets,
+ "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(**req_copy)
+ _service.list_vpn_gateway_connection_local_cidrs(**req_copy)
- def test_create_load_balancer_value_error_with_retries(self):
- # Enable retries and run test_create_load_balancer_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_create_load_balancer_value_error()
+ self.test_list_vpn_gateway_connection_local_cidrs_value_error()
- # Disable retries and run test_create_load_balancer_value_error.
+ # Disable retries and run test_list_vpn_gateway_connection_local_cidrs_value_error.
_service.disable_retries()
- self.test_create_load_balancer_value_error()
+ self.test_list_vpn_gateway_connection_local_cidrs_value_error()
-class TestDeleteLoadBalancer:
+class TestRemoveVpnGatewayConnectionLocalCidr:
"""
- Test Class for delete_load_balancer
+ Test Class for remove_vpn_gateway_connection_local_cidr
"""
@responses.activate
- def test_delete_load_balancer_all_params(self):
+ def test_remove_vpn_gateway_connection_local_cidr_all_params(self):
"""
- delete_load_balancer()
+ remove_vpn_gateway_connection_local_cidr()
"""
# Set up mock
- url = preprocess_url('/load_balancers/testString')
+ url = preprocess_url('/vpn_gateways/testString/connections/testString/local_cidrs/testString/testString')
responses.add(
responses.DELETE,
url,
- status=202,
+ status=204,
)
# Set up parameter values
+ vpn_gateway_id = 'testString'
id = 'testString'
- if_match = 'W/"96d225c4-56bd-43d9-98fc-d7148e5c5028"'
+ cidr_prefix = 'testString'
+ prefix_length = 'testString'
# Invoke method
- response = _service.delete_load_balancer(
+ response = _service.remove_vpn_gateway_connection_local_cidr(
+ vpn_gateway_id,
id,
- if_match=if_match,
+ cidr_prefix,
+ prefix_length,
headers={},
)
# Check for correct operation
assert len(responses.calls) == 1
- assert response.status_code == 202
+ assert response.status_code == 204
- def test_delete_load_balancer_all_params_with_retries(self):
- # Enable retries and run test_delete_load_balancer_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_delete_load_balancer_all_params()
+ self.test_remove_vpn_gateway_connection_local_cidr_all_params()
- # Disable retries and run test_delete_load_balancer_all_params.
+ # Disable retries and run test_remove_vpn_gateway_connection_local_cidr_all_params.
_service.disable_retries()
- self.test_delete_load_balancer_all_params()
+ self.test_remove_vpn_gateway_connection_local_cidr_all_params()
@responses.activate
- def test_delete_load_balancer_required_params(self):
+ def test_remove_vpn_gateway_connection_local_cidr_value_error(self):
"""
- test_delete_load_balancer_required_params()
+ test_remove_vpn_gateway_connection_local_cidr_value_error()
"""
# Set up mock
- url = preprocess_url('/load_balancers/testString')
+ url = preprocess_url('/vpn_gateways/testString/connections/testString/local_cidrs/testString/testString')
responses.add(
responses.DELETE,
url,
- status=202,
+ status=204,
)
# Set up parameter values
+ vpn_gateway_id = 'testString'
id = 'testString'
+ cidr_prefix = 'testString'
+ prefix_length = 'testString'
- # Invoke method
- response = _service.delete_load_balancer(
- id,
- headers={},
- )
-
- # Check for correct operation
- assert len(responses.calls) == 1
- assert response.status_code == 202
+ # 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)
- def test_delete_load_balancer_required_params_with_retries(self):
- # Enable retries and run test_delete_load_balancer_required_params.
+ 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_delete_load_balancer_required_params()
+ self.test_remove_vpn_gateway_connection_local_cidr_value_error()
- # Disable retries and run test_delete_load_balancer_required_params.
+ # Disable retries and run test_remove_vpn_gateway_connection_local_cidr_value_error.
_service.disable_retries()
- self.test_delete_load_balancer_required_params()
+ self.test_remove_vpn_gateway_connection_local_cidr_value_error()
+
+
+class TestCheckVpnGatewayConnectionLocalCidr:
+ """
+ Test Class for check_vpn_gateway_connection_local_cidr
+ """
@responses.activate
- def test_delete_load_balancer_value_error(self):
+ def test_check_vpn_gateway_connection_local_cidr_all_params(self):
"""
- test_delete_load_balancer_value_error()
+ check_vpn_gateway_connection_local_cidr()
"""
# Set up mock
- url = preprocess_url('/load_balancers/testString')
+ url = preprocess_url('/vpn_gateways/testString/connections/testString/local_cidrs/testString/testString')
responses.add(
- responses.DELETE,
+ responses.GET,
url,
- status=202,
+ 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
+ # Invoke method
+ response = _service.check_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 == 204
+
+ 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_check_vpn_gateway_connection_local_cidr_all_params()
+
+ # Disable retries and run test_check_vpn_gateway_connection_local_cidr_all_params.
+ _service.disable_retries()
+ self.test_check_vpn_gateway_connection_local_cidr_all_params()
+
+ @responses.activate
+ def test_check_vpn_gateway_connection_local_cidr_value_error(self):
+ """
+ test_check_vpn_gateway_connection_local_cidr_value_error()
+ """
+ # Set up mock
+ url = preprocess_url('/vpn_gateways/testString/connections/testString/local_cidrs/testString/testString')
+ 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.delete_load_balancer(**req_copy)
+ _service.check_vpn_gateway_connection_local_cidr(**req_copy)
- def test_delete_load_balancer_value_error_with_retries(self):
- # Enable retries and run test_delete_load_balancer_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_delete_load_balancer_value_error()
+ self.test_check_vpn_gateway_connection_local_cidr_value_error()
- # Disable retries and run test_delete_load_balancer_value_error.
+ # Disable retries and run test_check_vpn_gateway_connection_local_cidr_value_error.
_service.disable_retries()
- self.test_delete_load_balancer_value_error()
+ self.test_check_vpn_gateway_connection_local_cidr_value_error()
-class TestGetLoadBalancer:
+class TestAddVpnGatewayConnectionLocalCidr:
"""
- Test Class for get_load_balancer
+ Test Class for add_vpn_gateway_connection_local_cidr
"""
@responses.activate
- def test_get_load_balancer_all_params(self):
+ def test_add_vpn_gateway_connection_local_cidr_all_params(self):
"""
- get_load_balancer()
+ add_vpn_gateway_connection_local_cidr()
"""
# Set up mock
- url = preprocess_url('/load_balancers/testString')
- mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "dns": {"instance": {"crn": "crn:v1:bluemix:public:dns-svcs:global:a/123456:6860c359-b2e2-46fa-a944-b38c28201c6e"}, "zone": {"id": "d66662cc-aa23-4fe1-9987-858487a61f45"}}, "hostname": "6b88d615-us-south.lb.appdomain.cloud", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "instance_groups_supported": false, "is_public": true, "listeners": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "logging": {"datapath": {"active": true}}, "name": "my-load-balancer", "operating_status": "offline", "pools": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}], "private_ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "profile": {"family": "network", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed", "name": "network-fixed"}, "provisioning_status": "active", "public_ips": [{"address": "192.168.3.4"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "load_balancer", "route_mode": true, "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "security_groups_supported": false, "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "udp_supported": true}'
+ url = preprocess_url('/vpn_gateways/testString/connections/testString/local_cidrs/testString/testString')
responses.add(
- responses.GET,
+ responses.PUT,
url,
- body=mock_response,
- content_type='application/json',
- status=200,
+ status=204,
)
# Set up parameter values
+ vpn_gateway_id = 'testString'
id = 'testString'
+ cidr_prefix = 'testString'
+ prefix_length = 'testString'
# Invoke method
- response = _service.get_load_balancer(
+ 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_get_load_balancer_all_params_with_retries(self):
- # Enable retries and run test_get_load_balancer_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_get_load_balancer_all_params()
+ self.test_add_vpn_gateway_connection_local_cidr_all_params()
- # Disable retries and run test_get_load_balancer_all_params.
+ # Disable retries and run test_add_vpn_gateway_connection_local_cidr_all_params.
_service.disable_retries()
- self.test_get_load_balancer_all_params()
+ self.test_add_vpn_gateway_connection_local_cidr_all_params()
@responses.activate
- def test_get_load_balancer_value_error(self):
+ def test_add_vpn_gateway_connection_local_cidr_value_error(self):
"""
- test_get_load_balancer_value_error()
+ test_add_vpn_gateway_connection_local_cidr_value_error()
"""
# Set up mock
- url = preprocess_url('/load_balancers/testString')
- mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "dns": {"instance": {"crn": "crn:v1:bluemix:public:dns-svcs:global:a/123456:6860c359-b2e2-46fa-a944-b38c28201c6e"}, "zone": {"id": "d66662cc-aa23-4fe1-9987-858487a61f45"}}, "hostname": "6b88d615-us-south.lb.appdomain.cloud", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "instance_groups_supported": false, "is_public": true, "listeners": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "logging": {"datapath": {"active": true}}, "name": "my-load-balancer", "operating_status": "offline", "pools": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}], "private_ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "profile": {"family": "network", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed", "name": "network-fixed"}, "provisioning_status": "active", "public_ips": [{"address": "192.168.3.4"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "load_balancer", "route_mode": true, "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "security_groups_supported": false, "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "udp_supported": true}'
+ url = preprocess_url('/vpn_gateways/testString/connections/testString/local_cidrs/testString/testString')
responses.add(
- responses.GET,
+ responses.PUT,
url,
- body=mock_response,
- content_type='application/json',
- status=200,
+ 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.get_load_balancer(**req_copy)
+ _service.add_vpn_gateway_connection_local_cidr(**req_copy)
- def test_get_load_balancer_value_error_with_retries(self):
- # Enable retries and run test_get_load_balancer_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_get_load_balancer_value_error()
+ self.test_add_vpn_gateway_connection_local_cidr_value_error()
- # Disable retries and run test_get_load_balancer_value_error.
+ # Disable retries and run test_add_vpn_gateway_connection_local_cidr_value_error.
_service.disable_retries()
- self.test_get_load_balancer_value_error()
+ self.test_add_vpn_gateway_connection_local_cidr_value_error()
-class TestUpdateLoadBalancer:
+class TestListVpnGatewayConnectionPeerCidrs:
"""
- Test Class for update_load_balancer
+ Test Class for list_vpn_gateway_connection_peer_cidrs
"""
@responses.activate
- def test_update_load_balancer_all_params(self):
+ def test_list_vpn_gateway_connection_peer_cidrs_all_params(self):
"""
- update_load_balancer()
+ list_vpn_gateway_connection_peer_cidrs()
"""
# Set up mock
- url = preprocess_url('/load_balancers/testString')
- mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "dns": {"instance": {"crn": "crn:v1:bluemix:public:dns-svcs:global:a/123456:6860c359-b2e2-46fa-a944-b38c28201c6e"}, "zone": {"id": "d66662cc-aa23-4fe1-9987-858487a61f45"}}, "hostname": "6b88d615-us-south.lb.appdomain.cloud", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "instance_groups_supported": false, "is_public": true, "listeners": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "logging": {"datapath": {"active": true}}, "name": "my-load-balancer", "operating_status": "offline", "pools": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}], "private_ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "profile": {"family": "network", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed", "name": "network-fixed"}, "provisioning_status": "active", "public_ips": [{"address": "192.168.3.4"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "load_balancer", "route_mode": true, "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "security_groups_supported": false, "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "udp_supported": true}'
+ url = preprocess_url('/vpn_gateways/testString/connections/testString/peer_cidrs')
+ mock_response = '{"peer_cidrs": ["10.45.1.0/24"]}'
responses.add(
- responses.PATCH,
+ responses.GET,
url,
body=mock_response,
content_type='application/json',
status=200,
)
- # Construct a dict representation of a DNSInstanceIdentityByCRN model
- dns_instance_identity_model = {}
- dns_instance_identity_model['crn'] = 'crn:v1:bluemix:public:dns-svcs:global:a/123456:6860c359-b2e2-46fa-a944-b38c28201c6e'
-
- # Construct a dict representation of a DNSZoneIdentityById model
- dns_zone_identity_model = {}
- dns_zone_identity_model['id'] = 'd66662cc-aa23-4fe1-9987-858487a61f45'
-
- # Construct a dict representation of a LoadBalancerDNSPatch model
- load_balancer_dns_patch_model = {}
- load_balancer_dns_patch_model['instance'] = dns_instance_identity_model
- load_balancer_dns_patch_model['zone'] = dns_zone_identity_model
-
- # Construct a dict representation of a LoadBalancerLoggingDatapathPatch model
- load_balancer_logging_datapath_patch_model = {}
- load_balancer_logging_datapath_patch_model['active'] = True
-
- # Construct a dict representation of a LoadBalancerLoggingPatch model
- load_balancer_logging_patch_model = {}
- load_balancer_logging_patch_model['datapath'] = load_balancer_logging_datapath_patch_model
-
- # Construct a dict representation of a SubnetIdentityById model
- subnet_identity_model = {}
- subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
-
- # Construct a dict representation of a LoadBalancerPatch model
- load_balancer_patch_model = {}
- load_balancer_patch_model['dns'] = load_balancer_dns_patch_model
- load_balancer_patch_model['logging'] = load_balancer_logging_patch_model
- load_balancer_patch_model['name'] = 'my-load-balancer'
- load_balancer_patch_model['subnets'] = [subnet_identity_model]
-
# Set up parameter values
+ vpn_gateway_id = 'testString'
id = 'testString'
- load_balancer_patch = load_balancer_patch_model
- if_match = 'W/"96d225c4-56bd-43d9-98fc-d7148e5c5028"'
# Invoke method
- response = _service.update_load_balancer(
+ response = _service.list_vpn_gateway_connection_peer_cidrs(
+ vpn_gateway_id,
id,
- load_balancer_patch,
- if_match=if_match,
headers={},
)
# Check for correct operation
assert len(responses.calls) == 1
assert response.status_code == 200
- # Validate body params
- req_body = json.loads(str(responses.calls[0].request.body, 'utf-8'))
- assert req_body == load_balancer_patch
- def test_update_load_balancer_all_params_with_retries(self):
- # Enable retries and run test_update_load_balancer_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_update_load_balancer_all_params()
+ self.test_list_vpn_gateway_connection_peer_cidrs_all_params()
- # Disable retries and run test_update_load_balancer_all_params.
+ # Disable retries and run test_list_vpn_gateway_connection_peer_cidrs_all_params.
_service.disable_retries()
- self.test_update_load_balancer_all_params()
+ self.test_list_vpn_gateway_connection_peer_cidrs_all_params()
@responses.activate
- def test_update_load_balancer_required_params(self):
+ def test_list_vpn_gateway_connection_peer_cidrs_value_error(self):
"""
- test_update_load_balancer_required_params()
+ test_list_vpn_gateway_connection_peer_cidrs_value_error()
"""
# Set up mock
- url = preprocess_url('/load_balancers/testString')
- mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "dns": {"instance": {"crn": "crn:v1:bluemix:public:dns-svcs:global:a/123456:6860c359-b2e2-46fa-a944-b38c28201c6e"}, "zone": {"id": "d66662cc-aa23-4fe1-9987-858487a61f45"}}, "hostname": "6b88d615-us-south.lb.appdomain.cloud", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "instance_groups_supported": false, "is_public": true, "listeners": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "logging": {"datapath": {"active": true}}, "name": "my-load-balancer", "operating_status": "offline", "pools": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}], "private_ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "profile": {"family": "network", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed", "name": "network-fixed"}, "provisioning_status": "active", "public_ips": [{"address": "192.168.3.4"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "load_balancer", "route_mode": true, "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "security_groups_supported": false, "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "udp_supported": true}'
+ url = preprocess_url('/vpn_gateways/testString/connections/testString/peer_cidrs')
+ mock_response = '{"peer_cidrs": ["10.45.1.0/24"]}'
responses.add(
- responses.PATCH,
+ responses.GET,
url,
body=mock_response,
content_type='application/json',
status=200,
)
- # Construct a dict representation of a DNSInstanceIdentityByCRN model
- dns_instance_identity_model = {}
- dns_instance_identity_model['crn'] = 'crn:v1:bluemix:public:dns-svcs:global:a/123456:6860c359-b2e2-46fa-a944-b38c28201c6e'
+ # Set up parameter values
+ vpn_gateway_id = 'testString'
+ id = 'testString'
- # Construct a dict representation of a DNSZoneIdentityById model
- dns_zone_identity_model = {}
- dns_zone_identity_model['id'] = 'd66662cc-aa23-4fe1-9987-858487a61f45'
+ # 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)
- # Construct a dict representation of a LoadBalancerDNSPatch model
- load_balancer_dns_patch_model = {}
- load_balancer_dns_patch_model['instance'] = dns_instance_identity_model
- load_balancer_dns_patch_model['zone'] = dns_zone_identity_model
+ 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_list_vpn_gateway_connection_peer_cidrs_value_error()
- # Construct a dict representation of a LoadBalancerLoggingDatapathPatch model
- load_balancer_logging_datapath_patch_model = {}
- load_balancer_logging_datapath_patch_model['active'] = True
+ # Disable retries and run test_list_vpn_gateway_connection_peer_cidrs_value_error.
+ _service.disable_retries()
+ self.test_list_vpn_gateway_connection_peer_cidrs_value_error()
- # Construct a dict representation of a LoadBalancerLoggingPatch model
- load_balancer_logging_patch_model = {}
- load_balancer_logging_patch_model['datapath'] = load_balancer_logging_datapath_patch_model
- # Construct a dict representation of a SubnetIdentityById model
- subnet_identity_model = {}
- subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
+class TestRemoveVpnGatewayConnectionPeerCidr:
+ """
+ Test Class for remove_vpn_gateway_connection_peer_cidr
+ """
- # Construct a dict representation of a LoadBalancerPatch model
- load_balancer_patch_model = {}
- load_balancer_patch_model['dns'] = load_balancer_dns_patch_model
- load_balancer_patch_model['logging'] = load_balancer_logging_patch_model
- load_balancer_patch_model['name'] = 'my-load-balancer'
- load_balancer_patch_model['subnets'] = [subnet_identity_model]
+ @responses.activate
+ def test_remove_vpn_gateway_connection_peer_cidr_all_params(self):
+ """
+ remove_vpn_gateway_connection_peer_cidr()
+ """
+ # Set up mock
+ url = preprocess_url('/vpn_gateways/testString/connections/testString/peer_cidrs/testString/testString')
+ responses.add(
+ responses.DELETE,
+ url,
+ status=204,
+ )
# Set up parameter values
+ vpn_gateway_id = 'testString'
id = 'testString'
- load_balancer_patch = load_balancer_patch_model
+ cidr_prefix = 'testString'
+ prefix_length = 'testString'
# Invoke method
- response = _service.update_load_balancer(
+ response = _service.remove_vpn_gateway_connection_peer_cidr(
+ vpn_gateway_id,
id,
- load_balancer_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_patch
+ assert response.status_code == 204
- def test_update_load_balancer_required_params_with_retries(self):
- # Enable retries and run test_update_load_balancer_required_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_update_load_balancer_required_params()
+ self.test_remove_vpn_gateway_connection_peer_cidr_all_params()
- # Disable retries and run test_update_load_balancer_required_params.
+ # Disable retries and run test_remove_vpn_gateway_connection_peer_cidr_all_params.
_service.disable_retries()
- self.test_update_load_balancer_required_params()
+ self.test_remove_vpn_gateway_connection_peer_cidr_all_params()
@responses.activate
- def test_update_load_balancer_value_error(self):
+ def test_remove_vpn_gateway_connection_peer_cidr_value_error(self):
"""
- test_update_load_balancer_value_error()
+ test_remove_vpn_gateway_connection_peer_cidr_value_error()
"""
# Set up mock
- url = preprocess_url('/load_balancers/testString')
- mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "dns": {"instance": {"crn": "crn:v1:bluemix:public:dns-svcs:global:a/123456:6860c359-b2e2-46fa-a944-b38c28201c6e"}, "zone": {"id": "d66662cc-aa23-4fe1-9987-858487a61f45"}}, "hostname": "6b88d615-us-south.lb.appdomain.cloud", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "instance_groups_supported": false, "is_public": true, "listeners": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "logging": {"datapath": {"active": true}}, "name": "my-load-balancer", "operating_status": "offline", "pools": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}], "private_ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "profile": {"family": "network", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed", "name": "network-fixed"}, "provisioning_status": "active", "public_ips": [{"address": "192.168.3.4"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "load_balancer", "route_mode": true, "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "security_groups_supported": false, "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "udp_supported": true}'
+ url = preprocess_url('/vpn_gateways/testString/connections/testString/peer_cidrs/testString/testString')
responses.add(
- responses.PATCH,
+ responses.DELETE,
url,
- body=mock_response,
- content_type='application/json',
- status=200,
+ status=204,
)
- # Construct a dict representation of a DNSInstanceIdentityByCRN model
- dns_instance_identity_model = {}
- dns_instance_identity_model['crn'] = 'crn:v1:bluemix:public:dns-svcs:global:a/123456:6860c359-b2e2-46fa-a944-b38c28201c6e'
-
- # Construct a dict representation of a DNSZoneIdentityById model
- dns_zone_identity_model = {}
- dns_zone_identity_model['id'] = 'd66662cc-aa23-4fe1-9987-858487a61f45'
-
- # Construct a dict representation of a LoadBalancerDNSPatch model
- load_balancer_dns_patch_model = {}
- load_balancer_dns_patch_model['instance'] = dns_instance_identity_model
- load_balancer_dns_patch_model['zone'] = dns_zone_identity_model
-
- # Construct a dict representation of a LoadBalancerLoggingDatapathPatch model
- load_balancer_logging_datapath_patch_model = {}
- load_balancer_logging_datapath_patch_model['active'] = True
-
- # Construct a dict representation of a LoadBalancerLoggingPatch model
- load_balancer_logging_patch_model = {}
- load_balancer_logging_patch_model['datapath'] = load_balancer_logging_datapath_patch_model
-
- # Construct a dict representation of a SubnetIdentityById model
- subnet_identity_model = {}
- subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
-
- # Construct a dict representation of a LoadBalancerPatch model
- load_balancer_patch_model = {}
- load_balancer_patch_model['dns'] = load_balancer_dns_patch_model
- load_balancer_patch_model['logging'] = load_balancer_logging_patch_model
- load_balancer_patch_model['name'] = 'my-load-balancer'
- load_balancer_patch_model['subnets'] = [subnet_identity_model]
-
# Set up parameter values
+ vpn_gateway_id = 'testString'
id = 'testString'
- load_balancer_patch = load_balancer_patch_model
+ 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,
- "load_balancer_patch": load_balancer_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(**req_copy)
+ _service.remove_vpn_gateway_connection_peer_cidr(**req_copy)
- def test_update_load_balancer_value_error_with_retries(self):
- # Enable retries and run test_update_load_balancer_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_update_load_balancer_value_error()
+ self.test_remove_vpn_gateway_connection_peer_cidr_value_error()
- # Disable retries and run test_update_load_balancer_value_error.
+ # Disable retries and run test_remove_vpn_gateway_connection_peer_cidr_value_error.
_service.disable_retries()
- self.test_update_load_balancer_value_error()
+ self.test_remove_vpn_gateway_connection_peer_cidr_value_error()
-class TestGetLoadBalancerStatistics:
+class TestCheckVpnGatewayConnectionPeerCidr:
"""
- Test Class for get_load_balancer_statistics
+ Test Class for check_vpn_gateway_connection_peer_cidr
"""
@responses.activate
- def test_get_load_balancer_statistics_all_params(self):
+ def test_check_vpn_gateway_connection_peer_cidr_all_params(self):
"""
- get_load_balancer_statistics()
+ check_vpn_gateway_connection_peer_cidr()
"""
# Set up mock
- url = preprocess_url('/load_balancers/testString/statistics')
- mock_response = '{"active_connections": 797, "connection_rate": 91.121, "data_processed_this_month": 10093173145, "throughput": 167.278}'
+ 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
+ vpn_gateway_id = 'testString'
id = 'testString'
+ cidr_prefix = 'testString'
+ prefix_length = 'testString'
# Invoke method
- response = _service.get_load_balancer_statistics(
+ 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_statistics_all_params_with_retries(self):
- # Enable retries and run test_get_load_balancer_statistics_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_statistics_all_params()
+ self.test_check_vpn_gateway_connection_peer_cidr_all_params()
- # Disable retries and run test_get_load_balancer_statistics_all_params.
+ # Disable retries and run test_check_vpn_gateway_connection_peer_cidr_all_params.
_service.disable_retries()
- self.test_get_load_balancer_statistics_all_params()
+ self.test_check_vpn_gateway_connection_peer_cidr_all_params()
@responses.activate
- def test_get_load_balancer_statistics_value_error(self):
+ def test_check_vpn_gateway_connection_peer_cidr_value_error(self):
"""
- test_get_load_balancer_statistics_value_error()
+ test_check_vpn_gateway_connection_peer_cidr_value_error()
"""
# Set up mock
- url = preprocess_url('/load_balancers/testString/statistics')
- mock_response = '{"active_connections": 797, "connection_rate": 91.121, "data_processed_this_month": 10093173145, "throughput": 167.278}'
+ 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
+ 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.get_load_balancer_statistics(**req_copy)
+ _service.check_vpn_gateway_connection_peer_cidr(**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_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_statistics_value_error()
+ self.test_check_vpn_gateway_connection_peer_cidr_value_error()
- # Disable retries and run test_get_load_balancer_statistics_value_error.
+ # Disable retries and run test_check_vpn_gateway_connection_peer_cidr_value_error.
_service.disable_retries()
- self.test_get_load_balancer_statistics_value_error()
+ self.test_check_vpn_gateway_connection_peer_cidr_value_error()
-class TestListLoadBalancerListeners:
+class TestAddVpnGatewayConnectionPeerCidr:
"""
- Test Class for list_load_balancer_listeners
+ Test Class for add_vpn_gateway_connection_peer_cidr
"""
@responses.activate
- def test_list_load_balancer_listeners_all_params(self):
+ def test_add_vpn_gateway_connection_peer_cidr_all_params(self):
"""
- list_load_balancer_listeners()
+ add_vpn_gateway_connection_peer_cidr()
"""
# Set up mock
- url = preprocess_url('/load_balancers/testString/listeners')
- mock_response = '{"listeners": [{"accept_proxy_protocol": true, "certificate_instance": {"crn": "crn:v1:bluemix:public:secrets-manager:us-south:a/123456:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5"}, "connection_limit": 2000, "created_at": "2019-01-01T12:00:00.000Z", "default_pool": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "https_redirect": {"http_status_code": 301, "listener": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}, "uri": "/example?doc=get"}, "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "idle_connection_timeout": 100, "policies": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "anyValue"}], "port": 443, "port_max": 499, "port_min": 443, "protocol": "http", "provisioning_status": "active"}]}'
+ url = preprocess_url('/vpn_gateways/testString/connections/testString/peer_cidrs/testString/testString')
responses.add(
- responses.GET,
+ responses.PUT,
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.list_load_balancer_listeners(
- load_balancer_id,
+ 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 == 200
+ assert response.status_code == 204
- def test_list_load_balancer_listeners_all_params_with_retries(self):
- # Enable retries and run test_list_load_balancer_listeners_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_list_load_balancer_listeners_all_params()
+ self.test_add_vpn_gateway_connection_peer_cidr_all_params()
- # Disable retries and run test_list_load_balancer_listeners_all_params.
+ # Disable retries and run test_add_vpn_gateway_connection_peer_cidr_all_params.
_service.disable_retries()
- self.test_list_load_balancer_listeners_all_params()
+ self.test_add_vpn_gateway_connection_peer_cidr_all_params()
@responses.activate
- def test_list_load_balancer_listeners_value_error(self):
+ def test_add_vpn_gateway_connection_peer_cidr_value_error(self):
"""
- test_list_load_balancer_listeners_value_error()
+ test_add_vpn_gateway_connection_peer_cidr_value_error()
"""
# Set up mock
- url = preprocess_url('/load_balancers/testString/listeners')
- mock_response = '{"listeners": [{"accept_proxy_protocol": true, "certificate_instance": {"crn": "crn:v1:bluemix:public:secrets-manager:us-south:a/123456:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5"}, "connection_limit": 2000, "created_at": "2019-01-01T12:00:00.000Z", "default_pool": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "https_redirect": {"http_status_code": 301, "listener": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}, "uri": "/example?doc=get"}, "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "idle_connection_timeout": 100, "policies": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "anyValue"}], "port": 443, "port_max": 499, "port_min": 443, "protocol": "http", "provisioning_status": "active"}]}'
+ url = preprocess_url('/vpn_gateways/testString/connections/testString/peer_cidrs/testString/testString')
responses.add(
- responses.GET,
+ responses.PUT,
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.list_load_balancer_listeners(**req_copy)
+ _service.add_vpn_gateway_connection_peer_cidr(**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_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_list_load_balancer_listeners_value_error()
+ self.test_add_vpn_gateway_connection_peer_cidr_value_error()
- # Disable retries and run test_list_load_balancer_listeners_value_error.
+ # Disable retries and run test_add_vpn_gateway_connection_peer_cidr_value_error.
_service.disable_retries()
- self.test_list_load_balancer_listeners_value_error()
+ self.test_add_vpn_gateway_connection_peer_cidr_value_error()
-class TestCreateLoadBalancerListener:
+# endregion
+##############################################################################
+# End of Service: VPNGateways
+##############################################################################
+
+##############################################################################
+# Start of Service: VPNServers
+##############################################################################
+# region
+
+
+class TestNewInstance:
"""
- Test Class for create_load_balancer_listener
+ Test Class for new_instance
"""
- @responses.activate
- def test_create_load_balancer_listener_all_params(self):
+ def test_new_instance(self):
"""
- create_load_balancer_listener()
+ new_instance()
"""
- # Set up mock
- url = preprocess_url('/load_balancers/testString/listeners')
- mock_response = '{"accept_proxy_protocol": true, "certificate_instance": {"crn": "crn:v1:bluemix:public:secrets-manager:us-south:a/123456:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5"}, "connection_limit": 2000, "created_at": "2019-01-01T12:00:00.000Z", "default_pool": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "https_redirect": {"http_status_code": 301, "listener": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}, "uri": "/example?doc=get"}, "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "idle_connection_timeout": 100, "policies": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "anyValue"}], "port": 443, "port_max": 499, "port_min": 443, "protocol": "http", "provisioning_status": "active"}'
- responses.add(
- responses.POST,
- url,
- body=mock_response,
- 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:secrets-manager:us-south:a/123456:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5'
-
- # Construct a dict representation of a LoadBalancerPoolIdentityById model
- load_balancer_pool_identity_model = {}
- 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'
+ os.environ['TEST_SERVICE_AUTH_TYPE'] = 'noAuth'
- # 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'
+ service = VpcV1.new_instance(
+ version=version,
+ service_name='TEST_SERVICE',
+ )
- # 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
+ assert service is not None
+ assert isinstance(service, VpcV1)
- # 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
- idle_connection_timeout = 100
- policies = [load_balancer_listener_policy_prototype_model]
- port = 443
- port_max = 499
- port_min = 443
+ 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',
+ )
- # 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,
- idle_connection_timeout=idle_connection_timeout,
- policies=policies,
- port=port,
- port_max=port_max,
- port_min=port_min,
- headers={},
- )
+ 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()
- # 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['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['idle_connection_timeout'] == 100
- 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_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,
+ )
- 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_create_load_balancer_listener_all_params()
- # Disable retries and run test_create_load_balancer_listener_all_params.
- _service.disable_retries()
- self.test_create_load_balancer_listener_all_params()
+class TestListVpnServers:
+ """
+ Test Class for list_vpn_servers
+ """
@responses.activate
- def test_create_load_balancer_listener_value_error(self):
+ def test_list_vpn_servers_all_params(self):
"""
- test_create_load_balancer_listener_value_error()
+ list_vpn_servers()
"""
# Set up mock
- url = preprocess_url('/load_balancers/testString/listeners')
- mock_response = '{"accept_proxy_protocol": true, "certificate_instance": {"crn": "crn:v1:bluemix:public:secrets-manager:us-south:a/123456:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5"}, "connection_limit": 2000, "created_at": "2019-01-01T12:00:00.000Z", "default_pool": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "https_redirect": {"http_status_code": 301, "listener": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}, "uri": "/example?doc=get"}, "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "idle_connection_timeout": 100, "policies": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "anyValue"}], "port": 443, "port_max": 499, "port_min": 443, "protocol": "http", "provisioning_status": "active"}'
+ url = preprocess_url('/vpn_servers')
+ mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers?start=ffd653466e284937896724b2dd044c9c&limit=20"}, "total_count": 132, "vpn_servers": [{"certificate": {"crn": "crn:v1:bluemix:public:secrets-manager:us-south:a/123456:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5"}, "client_authentication": [{"method": "certificate", "identity_provider": {"provider_type": "iam"}}], "client_auto_delete": true, "client_auto_delete_timeout": 1, "client_dns_server_ips": [{"address": "192.168.3.4"}], "client_idle_timeout": 600, "client_ip_pool": "172.16.0.0/16", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpn-server:r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "enable_split_tunneling": true, "health_reasons": [{"code": "cannot_access_server_certificate", "message": "Failed to get VPN server\'s server certificate from Secrets Manager.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-health"}], "health_state": "ok", "hostname": "a8506291.us-south.vpn-server.appdomain.cloud", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-vpn-server", "port": 443, "private_ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "protocol": "udp", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpn_server", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}]}'
responses.add(
- responses.POST,
+ responses.GET,
url,
body=mock_response,
content_type='application/json',
- status=201,
+ status=200,
)
- # Construct a dict representation of a CertificateInstanceIdentityByCRN model
- certificate_instance_identity_model = {}
- certificate_instance_identity_model['crn'] = 'crn:v1:bluemix:public:secrets-manager:us-south:a/123456:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5'
-
- # Construct a dict representation of a 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'
- 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
- idle_connection_timeout = 100
- policies = [load_balancer_listener_policy_prototype_model]
- port = 443
- port_max = 499
- port_min = 443
+ name = 'testString'
+ start = 'testString'
+ limit = 50
+ resource_group_id = 'testString'
+ sort = 'name'
- # Pass in all but one required param and check for a ValueError
- req_param_dict = {
- "load_balancer_id": load_balancer_id,
- "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_load_balancer_listener(**req_copy)
+ # Invoke method
+ response = _service.list_vpn_servers(
+ name=name,
+ start=start,
+ limit=limit,
+ resource_group_id=resource_group_id,
+ sort=sort,
+ headers={},
+ )
- def test_create_load_balancer_listener_value_error_with_retries(self):
- # Enable retries and run test_create_load_balancer_listener_value_error.
+ # 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
+ assert 'sort={}'.format(sort) in query_string
+
+ def test_list_vpn_servers_all_params_with_retries(self):
+ # Enable retries and run test_list_vpn_servers_all_params.
_service.enable_retries()
- self.test_create_load_balancer_listener_value_error()
+ self.test_list_vpn_servers_all_params()
- # Disable retries and run test_create_load_balancer_listener_value_error.
+ # Disable retries and run test_list_vpn_servers_all_params.
_service.disable_retries()
- self.test_create_load_balancer_listener_value_error()
-
-
-class TestDeleteLoadBalancerListener:
- """
- Test Class for delete_load_balancer_listener
- """
+ self.test_list_vpn_servers_all_params()
@responses.activate
- def test_delete_load_balancer_listener_all_params(self):
+ def test_list_vpn_servers_required_params(self):
"""
- delete_load_balancer_listener()
+ test_list_vpn_servers_required_params()
"""
# Set up mock
- url = preprocess_url('/load_balancers/testString/listeners/testString')
+ url = preprocess_url('/vpn_servers')
+ mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers?start=ffd653466e284937896724b2dd044c9c&limit=20"}, "total_count": 132, "vpn_servers": [{"certificate": {"crn": "crn:v1:bluemix:public:secrets-manager:us-south:a/123456:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5"}, "client_authentication": [{"method": "certificate", "identity_provider": {"provider_type": "iam"}}], "client_auto_delete": true, "client_auto_delete_timeout": 1, "client_dns_server_ips": [{"address": "192.168.3.4"}], "client_idle_timeout": 600, "client_ip_pool": "172.16.0.0/16", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpn-server:r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "enable_split_tunneling": true, "health_reasons": [{"code": "cannot_access_server_certificate", "message": "Failed to get VPN server\'s server certificate from Secrets Manager.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-health"}], "health_state": "ok", "hostname": "a8506291.us-south.vpn-server.appdomain.cloud", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-vpn-server", "port": 443, "private_ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "protocol": "udp", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpn_server", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}]}'
responses.add(
- responses.DELETE,
+ responses.GET,
url,
- status=202,
+ body=mock_response,
+ content_type='application/json',
+ status=200,
)
- # Set up parameter values
- load_balancer_id = 'testString'
- id = 'testString'
-
# Invoke method
- response = _service.delete_load_balancer_listener(
- load_balancer_id,
- id,
- headers={},
- )
+ response = _service.list_vpn_servers()
# Check for correct operation
assert len(responses.calls) == 1
- assert response.status_code == 202
+ 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_servers_required_params_with_retries(self):
+ # Enable retries and run test_list_vpn_servers_required_params.
_service.enable_retries()
- self.test_delete_load_balancer_listener_all_params()
+ self.test_list_vpn_servers_required_params()
- # Disable retries and run test_delete_load_balancer_listener_all_params.
+ # Disable retries and run test_list_vpn_servers_required_params.
_service.disable_retries()
- self.test_delete_load_balancer_listener_all_params()
+ self.test_list_vpn_servers_required_params()
@responses.activate
- def test_delete_load_balancer_listener_value_error(self):
+ def test_list_vpn_servers_value_error(self):
"""
- test_delete_load_balancer_listener_value_error()
+ test_list_vpn_servers_value_error()
"""
# Set up mock
- url = preprocess_url('/load_balancers/testString/listeners/testString')
+ url = preprocess_url('/vpn_servers')
+ mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers?start=ffd653466e284937896724b2dd044c9c&limit=20"}, "total_count": 132, "vpn_servers": [{"certificate": {"crn": "crn:v1:bluemix:public:secrets-manager:us-south:a/123456:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5"}, "client_authentication": [{"method": "certificate", "identity_provider": {"provider_type": "iam"}}], "client_auto_delete": true, "client_auto_delete_timeout": 1, "client_dns_server_ips": [{"address": "192.168.3.4"}], "client_idle_timeout": 600, "client_ip_pool": "172.16.0.0/16", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpn-server:r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "enable_split_tunneling": true, "health_reasons": [{"code": "cannot_access_server_certificate", "message": "Failed to get VPN server\'s server certificate from Secrets Manager.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-health"}], "health_state": "ok", "hostname": "a8506291.us-south.vpn-server.appdomain.cloud", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-vpn-server", "port": 443, "private_ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "protocol": "udp", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpn_server", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}]}'
responses.add(
- responses.DELETE,
+ responses.GET,
url,
- status=202,
+ body=mock_response,
+ content_type='application/json',
+ 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.delete_load_balancer_listener(**req_copy)
+ _service.list_vpn_servers(**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_servers_value_error_with_retries(self):
+ # Enable retries and run test_list_vpn_servers_value_error.
_service.enable_retries()
- self.test_delete_load_balancer_listener_value_error()
+ self.test_list_vpn_servers_value_error()
- # Disable retries and run test_delete_load_balancer_listener_value_error.
+ # Disable retries and run test_list_vpn_servers_value_error.
_service.disable_retries()
- self.test_delete_load_balancer_listener_value_error()
-
-
-class TestGetLoadBalancerListener:
- """
- Test Class for get_load_balancer_listener
- """
+ self.test_list_vpn_servers_value_error()
@responses.activate
- def test_get_load_balancer_listener_all_params(self):
+ def test_list_vpn_servers_with_pager_get_next(self):
"""
- get_load_balancer_listener()
+ test_list_vpn_servers_with_pager_get_next()
"""
- # Set up mock
- url = preprocess_url('/load_balancers/testString/listeners/testString')
- mock_response = '{"accept_proxy_protocol": true, "certificate_instance": {"crn": "crn:v1:bluemix:public:secrets-manager:us-south:a/123456:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5"}, "connection_limit": 2000, "created_at": "2019-01-01T12:00:00.000Z", "default_pool": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "https_redirect": {"http_status_code": 301, "listener": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}, "uri": "/example?doc=get"}, "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "idle_connection_timeout": 100, "policies": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "anyValue"}], "port": 443, "port_max": 499, "port_min": 443, "protocol": "http", "provisioning_status": "active"}'
+ # Set up a two-page mock response
+ url = preprocess_url('/vpn_servers')
+ mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"vpn_servers":[{"certificate":{"crn":"crn:v1:bluemix:public:secrets-manager:us-south:a/123456:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5"},"client_authentication":[{"method":"certificate","identity_provider":{"provider_type":"iam"}}],"client_auto_delete":true,"client_auto_delete_timeout":1,"client_dns_server_ips":[{"address":"192.168.3.4"}],"client_idle_timeout":600,"client_ip_pool":"172.16.0.0/16","created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpn-server:r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5","enable_split_tunneling":true,"health_reasons":[{"code":"cannot_access_server_certificate","message":"Failed to get VPN server\'s server certificate from Secrets Manager.","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-health"}],"health_state":"ok","hostname":"a8506291.us-south.vpn-server.appdomain.cloud","href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5","id":"r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5","lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","name":"my-vpn-server","port":443,"private_ips":[{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"}],"protocol":"udp","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"vpn_server","security_groups":[{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271","id":"be5df5ca-12a0-494b-907e-aa6ec2bfa271","name":"my-security-group"}],"subnets":[{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}],"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"}}],"total_count":2,"limit":1}'
+ mock_response2 = '{"vpn_servers":[{"certificate":{"crn":"crn:v1:bluemix:public:secrets-manager:us-south:a/123456:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5"},"client_authentication":[{"method":"certificate","identity_provider":{"provider_type":"iam"}}],"client_auto_delete":true,"client_auto_delete_timeout":1,"client_dns_server_ips":[{"address":"192.168.3.4"}],"client_idle_timeout":600,"client_ip_pool":"172.16.0.0/16","created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpn-server:r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5","enable_split_tunneling":true,"health_reasons":[{"code":"cannot_access_server_certificate","message":"Failed to get VPN server\'s server certificate from Secrets Manager.","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-health"}],"health_state":"ok","hostname":"a8506291.us-south.vpn-server.appdomain.cloud","href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5","id":"r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5","lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","name":"my-vpn-server","port":443,"private_ips":[{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"}],"protocol":"udp","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"vpn_server","security_groups":[{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271","id":"be5df5ca-12a0-494b-907e-aa6ec2bfa271","name":"my-security-group"}],"subnets":[{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}],"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"}}],"total_count":2,"limit":1}'
responses.add(
responses.GET,
url,
- body=mock_response,
+ body=mock_response1,
content_type='application/json',
status=200,
)
-
- # Set up parameter values
- load_balancer_id = 'testString'
- id = 'testString'
-
- # Invoke method
- response = _service.get_load_balancer_listener(
- load_balancer_id,
- id,
- headers={},
+ responses.add(
+ responses.GET,
+ url,
+ body=mock_response2,
+ content_type='application/json',
+ status=200,
)
- # Check for correct operation
- assert len(responses.calls) == 1
- assert response.status_code == 200
-
- 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_listener_all_params()
-
- # Disable retries and run test_get_load_balancer_listener_all_params.
- _service.disable_retries()
- self.test_get_load_balancer_listener_all_params()
+ # Exercise the pager class for this operation
+ all_results = []
+ pager = VpnServersPager(
+ client=_service,
+ name='testString',
+ limit=10,
+ resource_group_id='testString',
+ sort='name',
+ )
+ while pager.has_next():
+ next_page = pager.get_next()
+ assert next_page is not None
+ all_results.extend(next_page)
+ assert len(all_results) == 2
@responses.activate
- def test_get_load_balancer_listener_value_error(self):
+ def test_list_vpn_servers_with_pager_get_all(self):
"""
- test_get_load_balancer_listener_value_error()
+ test_list_vpn_servers_with_pager_get_all()
"""
- # Set up mock
- url = preprocess_url('/load_balancers/testString/listeners/testString')
- mock_response = '{"accept_proxy_protocol": true, "certificate_instance": {"crn": "crn:v1:bluemix:public:secrets-manager:us-south:a/123456:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5"}, "connection_limit": 2000, "created_at": "2019-01-01T12:00:00.000Z", "default_pool": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "https_redirect": {"http_status_code": 301, "listener": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}, "uri": "/example?doc=get"}, "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "idle_connection_timeout": 100, "policies": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "anyValue"}], "port": 443, "port_max": 499, "port_min": 443, "protocol": "http", "provisioning_status": "active"}'
+ # Set up a two-page mock response
+ url = preprocess_url('/vpn_servers')
+ mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"vpn_servers":[{"certificate":{"crn":"crn:v1:bluemix:public:secrets-manager:us-south:a/123456:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5"},"client_authentication":[{"method":"certificate","identity_provider":{"provider_type":"iam"}}],"client_auto_delete":true,"client_auto_delete_timeout":1,"client_dns_server_ips":[{"address":"192.168.3.4"}],"client_idle_timeout":600,"client_ip_pool":"172.16.0.0/16","created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpn-server:r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5","enable_split_tunneling":true,"health_reasons":[{"code":"cannot_access_server_certificate","message":"Failed to get VPN server\'s server certificate from Secrets Manager.","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-health"}],"health_state":"ok","hostname":"a8506291.us-south.vpn-server.appdomain.cloud","href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5","id":"r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5","lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","name":"my-vpn-server","port":443,"private_ips":[{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"}],"protocol":"udp","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"vpn_server","security_groups":[{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271","id":"be5df5ca-12a0-494b-907e-aa6ec2bfa271","name":"my-security-group"}],"subnets":[{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}],"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"}}],"total_count":2,"limit":1}'
+ mock_response2 = '{"vpn_servers":[{"certificate":{"crn":"crn:v1:bluemix:public:secrets-manager:us-south:a/123456:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5"},"client_authentication":[{"method":"certificate","identity_provider":{"provider_type":"iam"}}],"client_auto_delete":true,"client_auto_delete_timeout":1,"client_dns_server_ips":[{"address":"192.168.3.4"}],"client_idle_timeout":600,"client_ip_pool":"172.16.0.0/16","created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpn-server:r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5","enable_split_tunneling":true,"health_reasons":[{"code":"cannot_access_server_certificate","message":"Failed to get VPN server\'s server certificate from Secrets Manager.","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-health"}],"health_state":"ok","hostname":"a8506291.us-south.vpn-server.appdomain.cloud","href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5","id":"r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5","lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","name":"my-vpn-server","port":443,"private_ips":[{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"}],"protocol":"udp","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"vpn_server","security_groups":[{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271","id":"be5df5ca-12a0-494b-907e-aa6ec2bfa271","name":"my-security-group"}],"subnets":[{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}],"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"}}],"total_count":2,"limit":1}'
responses.add(
responses.GET,
url,
- body=mock_response,
+ body=mock_response1,
+ content_type='application/json',
+ status=200,
+ )
+ responses.add(
+ responses.GET,
+ url,
+ body=mock_response2,
content_type='application/json',
status=200,
)
- # Set up parameter values
- 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_listener(**req_copy)
-
- def test_get_load_balancer_listener_value_error_with_retries(self):
- # Enable retries and run test_get_load_balancer_listener_value_error.
- _service.enable_retries()
- self.test_get_load_balancer_listener_value_error()
-
- # Disable retries and run test_get_load_balancer_listener_value_error.
- _service.disable_retries()
- self.test_get_load_balancer_listener_value_error()
+ # Exercise the pager class for this operation
+ pager = VpnServersPager(
+ client=_service,
+ name='testString',
+ limit=10,
+ resource_group_id='testString',
+ sort='name',
+ )
+ all_results = pager.get_all()
+ assert all_results is not None
+ assert len(all_results) == 2
-class TestUpdateLoadBalancerListener:
+class TestCreateVpnServer:
"""
- Test Class for update_load_balancer_listener
+ Test Class for create_vpn_server
"""
@responses.activate
- def test_update_load_balancer_listener_all_params(self):
+ def test_create_vpn_server_all_params(self):
"""
- update_load_balancer_listener()
+ create_vpn_server()
"""
# Set up mock
- url = preprocess_url('/load_balancers/testString/listeners/testString')
- mock_response = '{"accept_proxy_protocol": true, "certificate_instance": {"crn": "crn:v1:bluemix:public:secrets-manager:us-south:a/123456:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5"}, "connection_limit": 2000, "created_at": "2019-01-01T12:00:00.000Z", "default_pool": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "https_redirect": {"http_status_code": 301, "listener": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}, "uri": "/example?doc=get"}, "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "idle_connection_timeout": 100, "policies": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "anyValue"}], "port": 443, "port_max": 499, "port_min": 443, "protocol": "http", "provisioning_status": "active"}'
+ url = preprocess_url('/vpn_servers')
+ mock_response = '{"certificate": {"crn": "crn:v1:bluemix:public:secrets-manager:us-south:a/123456:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5"}, "client_authentication": [{"method": "certificate", "identity_provider": {"provider_type": "iam"}}], "client_auto_delete": true, "client_auto_delete_timeout": 1, "client_dns_server_ips": [{"address": "192.168.3.4"}], "client_idle_timeout": 600, "client_ip_pool": "172.16.0.0/16", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpn-server:r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "enable_split_tunneling": true, "health_reasons": [{"code": "cannot_access_server_certificate", "message": "Failed to get VPN server\'s server certificate from Secrets Manager.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-health"}], "health_state": "ok", "hostname": "a8506291.us-south.vpn-server.appdomain.cloud", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-vpn-server", "port": 443, "private_ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "protocol": "udp", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpn_server", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}'
responses.add(
- responses.PATCH,
+ responses.POST,
url,
body=mock_response,
content_type='application/json',
- status=200,
+ status=201,
)
# Construct a dict representation of a CertificateInstanceIdentityByCRN model
certificate_instance_identity_model = {}
certificate_instance_identity_model['crn'] = 'crn:v1:bluemix:public:secrets-manager:us-south:a/123456:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5'
- # Construct a dict representation of a LoadBalancerPoolIdentityById model
- load_balancer_pool_identity_model = {}
- load_balancer_pool_identity_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004'
+ # Construct a dict representation of a VPNServerAuthenticationByUsernameIdProviderByIAM model
+ vpn_server_authentication_by_username_id_provider_model = {}
+ vpn_server_authentication_by_username_id_provider_model['provider_type'] = 'iam'
- # 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 VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype model
+ vpn_server_authentication_prototype_model = {}
+ vpn_server_authentication_prototype_model['method'] = 'username'
+ vpn_server_authentication_prototype_model['identity_provider'] = vpn_server_authentication_by_username_id_provider_model
- # 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 SubnetIdentityById model
+ subnet_identity_model = {}
+ subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
- # 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['idle_connection_timeout'] = 100
- 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'
+ # Construct a dict representation of a IP model
+ ip_model = {}
+ ip_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 SecurityGroupIdentityById model
+ security_group_identity_model = {}
+ security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271'
# Set up parameter values
- load_balancer_id = 'testString'
- id = 'testString'
- load_balancer_listener_patch = load_balancer_listener_patch_model
+ certificate = certificate_instance_identity_model
+ client_authentication = [vpn_server_authentication_prototype_model]
+ client_ip_pool = '172.16.0.0/16'
+ subnets = [subnet_identity_model]
+ client_dns_server_ips = [ip_model]
+ client_idle_timeout = 600
+ enable_split_tunneling = False
+ name = 'my-vpn-server'
+ port = 443
+ protocol = 'udp'
+ resource_group = resource_group_identity_model
+ security_groups = [security_group_identity_model]
# Invoke method
- response = _service.update_load_balancer_listener(
- load_balancer_id,
- id,
- load_balancer_listener_patch,
+ response = _service.create_vpn_server(
+ certificate,
+ client_authentication,
+ client_ip_pool,
+ subnets,
+ client_dns_server_ips=client_dns_server_ips,
+ client_idle_timeout=client_idle_timeout,
+ enable_split_tunneling=enable_split_tunneling,
+ name=name,
+ port=port,
+ protocol=protocol,
+ resource_group=resource_group,
+ security_groups=security_groups,
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_listener_patch
-
- def test_update_load_balancer_listener_all_params_with_retries(self):
- # Enable retries and run test_update_load_balancer_listener_all_params.
+ assert req_body['certificate'] == certificate_instance_identity_model
+ assert req_body['client_authentication'] == [vpn_server_authentication_prototype_model]
+ assert req_body['client_ip_pool'] == '172.16.0.0/16'
+ assert req_body['subnets'] == [subnet_identity_model]
+ assert req_body['client_dns_server_ips'] == [ip_model]
+ assert req_body['client_idle_timeout'] == 600
+ assert req_body['enable_split_tunneling'] == False
+ assert req_body['name'] == 'my-vpn-server'
+ assert req_body['port'] == 443
+ assert req_body['protocol'] == 'udp'
+ assert req_body['resource_group'] == resource_group_identity_model
+ assert req_body['security_groups'] == [security_group_identity_model]
+
+ def test_create_vpn_server_all_params_with_retries(self):
+ # Enable retries and run test_create_vpn_server_all_params.
_service.enable_retries()
- self.test_update_load_balancer_listener_all_params()
+ self.test_create_vpn_server_all_params()
- # Disable retries and run test_update_load_balancer_listener_all_params.
+ # Disable retries and run test_create_vpn_server_all_params.
_service.disable_retries()
- self.test_update_load_balancer_listener_all_params()
+ self.test_create_vpn_server_all_params()
@responses.activate
- def test_update_load_balancer_listener_value_error(self):
+ def test_create_vpn_server_value_error(self):
"""
- test_update_load_balancer_listener_value_error()
+ test_create_vpn_server_value_error()
"""
# Set up mock
- url = preprocess_url('/load_balancers/testString/listeners/testString')
- mock_response = '{"accept_proxy_protocol": true, "certificate_instance": {"crn": "crn:v1:bluemix:public:secrets-manager:us-south:a/123456:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5"}, "connection_limit": 2000, "created_at": "2019-01-01T12:00:00.000Z", "default_pool": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "https_redirect": {"http_status_code": 301, "listener": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}, "uri": "/example?doc=get"}, "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "idle_connection_timeout": 100, "policies": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "anyValue"}], "port": 443, "port_max": 499, "port_min": 443, "protocol": "http", "provisioning_status": "active"}'
+ url = preprocess_url('/vpn_servers')
+ mock_response = '{"certificate": {"crn": "crn:v1:bluemix:public:secrets-manager:us-south:a/123456:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5"}, "client_authentication": [{"method": "certificate", "identity_provider": {"provider_type": "iam"}}], "client_auto_delete": true, "client_auto_delete_timeout": 1, "client_dns_server_ips": [{"address": "192.168.3.4"}], "client_idle_timeout": 600, "client_ip_pool": "172.16.0.0/16", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpn-server:r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "enable_split_tunneling": true, "health_reasons": [{"code": "cannot_access_server_certificate", "message": "Failed to get VPN server\'s server certificate from Secrets Manager.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-health"}], "health_state": "ok", "hostname": "a8506291.us-south.vpn-server.appdomain.cloud", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-vpn-server", "port": 443, "private_ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "protocol": "udp", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpn_server", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}'
responses.add(
- responses.PATCH,
+ responses.POST,
url,
body=mock_response,
content_type='application/json',
- status=200,
+ status=201,
)
# Construct a dict representation of a CertificateInstanceIdentityByCRN model
certificate_instance_identity_model = {}
certificate_instance_identity_model['crn'] = 'crn:v1:bluemix:public:secrets-manager:us-south:a/123456:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5'
- # Construct a dict representation of a 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['idle_connection_timeout'] = 100
- 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'
- id = 'testString'
- 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,
- "id": id,
- "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_listener(**req_copy)
-
- def test_update_load_balancer_listener_value_error_with_retries(self):
- # Enable retries and run test_update_load_balancer_listener_value_error.
- _service.enable_retries()
- self.test_update_load_balancer_listener_value_error()
-
- # Disable retries and run test_update_load_balancer_listener_value_error.
- _service.disable_retries()
- self.test_update_load_balancer_listener_value_error()
-
-
-class TestListLoadBalancerListenerPolicies:
- """
- Test Class for list_load_balancer_listener_policies
- """
-
- @responses.activate
- def test_list_load_balancer_listener_policies_all_params(self):
- """
- list_load_balancer_listener_policies()
- """
- # Set up mock
- 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,
- )
-
- # Set up parameter values
- load_balancer_id = 'testString'
- listener_id = 'testString'
+ # Construct a dict representation of a VPNServerAuthenticationByUsernameIdProviderByIAM model
+ vpn_server_authentication_by_username_id_provider_model = {}
+ vpn_server_authentication_by_username_id_provider_model['provider_type'] = 'iam'
- # Invoke method
- response = _service.list_load_balancer_listener_policies(
- load_balancer_id,
- listener_id,
- headers={},
- )
+ # Construct a dict representation of a VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype model
+ vpn_server_authentication_prototype_model = {}
+ vpn_server_authentication_prototype_model['method'] = 'username'
+ vpn_server_authentication_prototype_model['identity_provider'] = vpn_server_authentication_by_username_id_provider_model
- # Check for correct operation
- assert len(responses.calls) == 1
- assert response.status_code == 200
+ # Construct a dict representation of a SubnetIdentityById model
+ subnet_identity_model = {}
+ subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
- 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_load_balancer_listener_policies_all_params()
+ # Construct a dict representation of a IP model
+ ip_model = {}
+ ip_model['address'] = '192.168.3.4'
- # Disable retries and run test_list_load_balancer_listener_policies_all_params.
- _service.disable_retries()
- self.test_list_load_balancer_listener_policies_all_params()
+ # Construct a dict representation of a ResourceGroupIdentityById model
+ resource_group_identity_model = {}
+ resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
- @responses.activate
- def test_list_load_balancer_listener_policies_value_error(self):
- """
- test_list_load_balancer_listener_policies_value_error()
- """
- # Set up mock
- 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,
- )
+ # 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'
- listener_id = 'testString'
+ certificate = certificate_instance_identity_model
+ client_authentication = [vpn_server_authentication_prototype_model]
+ client_ip_pool = '172.16.0.0/16'
+ subnets = [subnet_identity_model]
+ client_dns_server_ips = [ip_model]
+ client_idle_timeout = 600
+ enable_split_tunneling = False
+ name = 'my-vpn-server'
+ port = 443
+ protocol = 'udp'
+ 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 = {
- "load_balancer_id": load_balancer_id,
- "listener_id": listener_id,
+ "certificate": certificate,
+ "client_authentication": client_authentication,
+ "client_ip_pool": client_ip_pool,
+ "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.list_load_balancer_listener_policies(**req_copy)
+ _service.create_vpn_server(**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_create_vpn_server_value_error_with_retries(self):
+ # Enable retries and run test_create_vpn_server_value_error.
_service.enable_retries()
- self.test_list_load_balancer_listener_policies_value_error()
+ self.test_create_vpn_server_value_error()
- # Disable retries and run test_list_load_balancer_listener_policies_value_error.
+ # Disable retries and run test_create_vpn_server_value_error.
_service.disable_retries()
- self.test_list_load_balancer_listener_policies_value_error()
+ self.test_create_vpn_server_value_error()
-class TestCreateLoadBalancerListenerPolicy:
+class TestDeleteVpnServer:
"""
- Test Class for create_load_balancer_listener_policy
+ Test Class for delete_vpn_server
"""
@responses.activate
- def test_create_load_balancer_listener_policy_all_params(self):
+ def test_delete_vpn_server_all_params(self):
"""
- create_load_balancer_listener_policy()
+ delete_vpn_server()
"""
# Set up mock
- 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"}}'
+ url = preprocess_url('/vpn_servers/testString')
responses.add(
- responses.POST,
+ responses.DELETE,
url,
- body=mock_response,
- content_type='application/json',
- status=201,
+ status=202,
)
- # 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'
-
# 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
+ id = 'testString'
+ if_match = 'W/"96d225c4-56bd-43d9-98fc-d7148e5c5028"'
# Invoke method
- response = _service.create_load_balancer_listener_policy(
- load_balancer_id,
- listener_id,
- action,
- priority,
- name=name,
- rules=rules,
- target=target,
+ response = _service.delete_vpn_server(
+ id,
+ if_match=if_match,
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
-
- 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_load_balancer_listener_policy_all_params()
-
- # Disable retries and run test_create_load_balancer_listener_policy_all_params.
- _service.disable_retries()
- self.test_create_load_balancer_listener_policy_all_params()
-
- @responses.activate
- def test_create_load_balancer_listener_policy_value_error(self):
- """
- test_create_load_balancer_listener_policy_value_error()
- """
- # Set up mock
- 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 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'
-
- # 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
-
- # 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,
- }
- 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)
+ assert response.status_code == 202
- 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_delete_vpn_server_all_params_with_retries(self):
+ # Enable retries and run test_delete_vpn_server_all_params.
_service.enable_retries()
- self.test_create_load_balancer_listener_policy_value_error()
+ self.test_delete_vpn_server_all_params()
- # Disable retries and run test_create_load_balancer_listener_policy_value_error.
+ # Disable retries and run test_delete_vpn_server_all_params.
_service.disable_retries()
- self.test_create_load_balancer_listener_policy_value_error()
-
-
-class TestDeleteLoadBalancerListenerPolicy:
- """
- Test Class for delete_load_balancer_listener_policy
- """
+ self.test_delete_vpn_server_all_params()
@responses.activate
- def test_delete_load_balancer_listener_policy_all_params(self):
+ def test_delete_vpn_server_required_params(self):
"""
- delete_load_balancer_listener_policy()
+ test_delete_vpn_server_required_params()
"""
# Set up mock
- url = preprocess_url('/load_balancers/testString/listeners/testString/policies/testString')
+ url = preprocess_url('/vpn_servers/testString')
responses.add(
responses.DELETE,
url,
@@ -38835,14 +39409,10 @@ def test_delete_load_balancer_listener_policy_all_params(self):
)
# Set up parameter values
- load_balancer_id = 'testString'
- listener_id = 'testString'
id = 'testString'
# Invoke method
- response = _service.delete_load_balancer_listener_policy(
- load_balancer_id,
- listener_id,
+ response = _service.delete_vpn_server(
id,
headers={},
)
@@ -38851,22 +39421,22 @@ def test_delete_load_balancer_listener_policy_all_params(self):
assert len(responses.calls) == 1
assert response.status_code == 202
- def test_delete_load_balancer_listener_policy_all_params_with_retries(self):
- # Enable retries and run test_delete_load_balancer_listener_policy_all_params.
+ def test_delete_vpn_server_required_params_with_retries(self):
+ # Enable retries and run test_delete_vpn_server_required_params.
_service.enable_retries()
- self.test_delete_load_balancer_listener_policy_all_params()
+ self.test_delete_vpn_server_required_params()
- # Disable retries and run test_delete_load_balancer_listener_policy_all_params.
+ # Disable retries and run test_delete_vpn_server_required_params.
_service.disable_retries()
- self.test_delete_load_balancer_listener_policy_all_params()
+ self.test_delete_vpn_server_required_params()
@responses.activate
- def test_delete_load_balancer_listener_policy_value_error(self):
+ def test_delete_vpn_server_value_error(self):
"""
- test_delete_load_balancer_listener_policy_value_error()
+ test_delete_vpn_server_value_error()
"""
# Set up mock
- url = preprocess_url('/load_balancers/testString/listeners/testString/policies/testString')
+ url = preprocess_url('/vpn_servers/testString')
responses.add(
responses.DELETE,
url,
@@ -38874,44 +39444,40 @@ def test_delete_load_balancer_listener_policy_value_error(self):
)
# 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 = {
- "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)
+ _service.delete_vpn_server(**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_delete_vpn_server_value_error_with_retries(self):
+ # Enable retries and run test_delete_vpn_server_value_error.
_service.enable_retries()
- self.test_delete_load_balancer_listener_policy_value_error()
+ self.test_delete_vpn_server_value_error()
- # Disable retries and run test_delete_load_balancer_listener_policy_value_error.
+ # Disable retries and run test_delete_vpn_server_value_error.
_service.disable_retries()
- self.test_delete_load_balancer_listener_policy_value_error()
+ self.test_delete_vpn_server_value_error()
-class TestGetLoadBalancerListenerPolicy:
+class TestGetVpnServer:
"""
- Test Class for get_load_balancer_listener_policy
+ Test Class for get_vpn_server
"""
@responses.activate
- def test_get_load_balancer_listener_policy_all_params(self):
+ def test_get_vpn_server_all_params(self):
"""
- get_load_balancer_listener_policy()
+ get_vpn_server()
"""
# 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"}}'
+ url = preprocess_url('/vpn_servers/testString')
+ mock_response = '{"certificate": {"crn": "crn:v1:bluemix:public:secrets-manager:us-south:a/123456:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5"}, "client_authentication": [{"method": "certificate", "identity_provider": {"provider_type": "iam"}}], "client_auto_delete": true, "client_auto_delete_timeout": 1, "client_dns_server_ips": [{"address": "192.168.3.4"}], "client_idle_timeout": 600, "client_ip_pool": "172.16.0.0/16", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpn-server:r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "enable_split_tunneling": true, "health_reasons": [{"code": "cannot_access_server_certificate", "message": "Failed to get VPN server\'s server certificate from Secrets Manager.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-health"}], "health_state": "ok", "hostname": "a8506291.us-south.vpn-server.appdomain.cloud", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-vpn-server", "port": 443, "private_ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "protocol": "udp", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpn_server", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}'
responses.add(
responses.GET,
url,
@@ -38921,14 +39487,10 @@ def test_get_load_balancer_listener_policy_all_params(self):
)
# Set up parameter values
- load_balancer_id = 'testString'
- listener_id = 'testString'
id = 'testString'
# Invoke method
- response = _service.get_load_balancer_listener_policy(
- load_balancer_id,
- listener_id,
+ response = _service.get_vpn_server(
id,
headers={},
)
@@ -38937,23 +39499,23 @@ def test_get_load_balancer_listener_policy_all_params(self):
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.
+ def test_get_vpn_server_all_params_with_retries(self):
+ # Enable retries and run test_get_vpn_server_all_params.
_service.enable_retries()
- self.test_get_load_balancer_listener_policy_all_params()
+ self.test_get_vpn_server_all_params()
- # Disable retries and run test_get_load_balancer_listener_policy_all_params.
+ # Disable retries and run test_get_vpn_server_all_params.
_service.disable_retries()
- self.test_get_load_balancer_listener_policy_all_params()
+ self.test_get_vpn_server_all_params()
@responses.activate
- def test_get_load_balancer_listener_policy_value_error(self):
+ def test_get_vpn_server_value_error(self):
"""
- test_get_load_balancer_listener_policy_value_error()
+ test_get_vpn_server_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"}}'
+ url = preprocess_url('/vpn_servers/testString')
+ mock_response = '{"certificate": {"crn": "crn:v1:bluemix:public:secrets-manager:us-south:a/123456:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5"}, "client_authentication": [{"method": "certificate", "identity_provider": {"provider_type": "iam"}}], "client_auto_delete": true, "client_auto_delete_timeout": 1, "client_dns_server_ips": [{"address": "192.168.3.4"}], "client_idle_timeout": 600, "client_ip_pool": "172.16.0.0/16", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpn-server:r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "enable_split_tunneling": true, "health_reasons": [{"code": "cannot_access_server_certificate", "message": "Failed to get VPN server\'s server certificate from Secrets Manager.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-health"}], "health_state": "ok", "hostname": "a8506291.us-south.vpn-server.appdomain.cloud", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-vpn-server", "port": 443, "private_ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "protocol": "udp", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpn_server", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}'
responses.add(
responses.GET,
url,
@@ -38963,44 +39525,40 @@ def test_get_load_balancer_listener_policy_value_error(self):
)
# 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 = {
- "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.get_load_balancer_listener_policy(**req_copy)
+ _service.get_vpn_server(**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_get_vpn_server_value_error_with_retries(self):
+ # Enable retries and run test_get_vpn_server_value_error.
_service.enable_retries()
- self.test_get_load_balancer_listener_policy_value_error()
+ self.test_get_vpn_server_value_error()
- # Disable retries and run test_get_load_balancer_listener_policy_value_error.
+ # Disable retries and run test_get_vpn_server_value_error.
_service.disable_retries()
- self.test_get_load_balancer_listener_policy_value_error()
+ self.test_get_vpn_server_value_error()
-class TestUpdateLoadBalancerListenerPolicy:
+class TestUpdateVpnServer:
"""
- Test Class for update_load_balancer_listener_policy
+ Test Class for update_vpn_server
"""
@responses.activate
- def test_update_load_balancer_listener_policy_all_params(self):
+ def test_update_vpn_server_all_params(self):
"""
- update_load_balancer_listener_policy()
+ update_vpn_server()
"""
# 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"}}'
+ url = preprocess_url('/vpn_servers/testString')
+ mock_response = '{"certificate": {"crn": "crn:v1:bluemix:public:secrets-manager:us-south:a/123456:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5"}, "client_authentication": [{"method": "certificate", "identity_provider": {"provider_type": "iam"}}], "client_auto_delete": true, "client_auto_delete_timeout": 1, "client_dns_server_ips": [{"address": "192.168.3.4"}], "client_idle_timeout": 600, "client_ip_pool": "172.16.0.0/16", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpn-server:r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "enable_split_tunneling": true, "health_reasons": [{"code": "cannot_access_server_certificate", "message": "Failed to get VPN server\'s server certificate from Secrets Manager.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-health"}], "health_state": "ok", "hostname": "a8506291.us-south.vpn-server.appdomain.cloud", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-vpn-server", "port": 443, "private_ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "protocol": "udp", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpn_server", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}'
responses.add(
responses.PATCH,
url,
@@ -39009,28 +39567,50 @@ def test_update_load_balancer_listener_policy_all_params(self):
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 CertificateInstanceIdentityByCRN model
+ certificate_instance_identity_model = {}
+ certificate_instance_identity_model['crn'] = 'crn:v1:bluemix:public:secrets-manager:us-south:a/123456:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5'
- # Construct a dict representation of a 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
+ # Construct a dict representation of a VPNServerAuthenticationByUsernameIdProviderByIAM model
+ vpn_server_authentication_by_username_id_provider_model = {}
+ vpn_server_authentication_by_username_id_provider_model['provider_type'] = 'iam'
+
+ # Construct a dict representation of a VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype model
+ vpn_server_authentication_prototype_model = {}
+ vpn_server_authentication_prototype_model['method'] = 'username'
+ vpn_server_authentication_prototype_model['identity_provider'] = vpn_server_authentication_by_username_id_provider_model
+
+ # Construct a dict representation of a IP model
+ ip_model = {}
+ ip_model['address'] = '192.168.3.4'
+
+ # 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 VPNServerPatch model
+ vpn_server_patch_model = {}
+ vpn_server_patch_model['certificate'] = certificate_instance_identity_model
+ vpn_server_patch_model['client_authentication'] = [vpn_server_authentication_prototype_model]
+ vpn_server_patch_model['client_dns_server_ips'] = [ip_model]
+ vpn_server_patch_model['client_idle_timeout'] = 600
+ vpn_server_patch_model['client_ip_pool'] = '172.16.0.0/16'
+ vpn_server_patch_model['enable_split_tunneling'] = True
+ vpn_server_patch_model['name'] = 'my-vpn-server'
+ vpn_server_patch_model['port'] = 443
+ vpn_server_patch_model['protocol'] = 'udp'
+ vpn_server_patch_model['subnets'] = [subnet_identity_model]
# Set up parameter values
- load_balancer_id = 'testString'
- listener_id = 'testString'
id = 'testString'
- load_balancer_listener_policy_patch = load_balancer_listener_policy_patch_model
+ vpn_server_patch = vpn_server_patch_model
+ if_match = 'W/"96d225c4-56bd-43d9-98fc-d7148e5c5028"'
# Invoke method
- response = _service.update_load_balancer_listener_policy(
- load_balancer_id,
- listener_id,
+ response = _service.update_vpn_server(
id,
- load_balancer_listener_policy_patch,
+ vpn_server_patch,
+ if_match=if_match,
headers={},
)
@@ -39039,25 +39619,25 @@ def test_update_load_balancer_listener_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 == load_balancer_listener_policy_patch
+ assert req_body == vpn_server_patch
- 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_update_vpn_server_all_params_with_retries(self):
+ # Enable retries and run test_update_vpn_server_all_params.
_service.enable_retries()
- self.test_update_load_balancer_listener_policy_all_params()
+ self.test_update_vpn_server_all_params()
- # Disable retries and run test_update_load_balancer_listener_policy_all_params.
+ # Disable retries and run test_update_vpn_server_all_params.
_service.disable_retries()
- self.test_update_load_balancer_listener_policy_all_params()
+ self.test_update_vpn_server_all_params()
@responses.activate
- def test_update_load_balancer_listener_policy_value_error(self):
+ def test_update_vpn_server_required_params(self):
"""
- test_update_load_balancer_listener_policy_value_error()
+ test_update_vpn_server_required_params()
"""
# 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"}}'
+ url = preprocess_url('/vpn_servers/testString')
+ mock_response = '{"certificate": {"crn": "crn:v1:bluemix:public:secrets-manager:us-south:a/123456:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5"}, "client_authentication": [{"method": "certificate", "identity_provider": {"provider_type": "iam"}}], "client_auto_delete": true, "client_auto_delete_timeout": 1, "client_dns_server_ips": [{"address": "192.168.3.4"}], "client_idle_timeout": 600, "client_ip_pool": "172.16.0.0/16", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpn-server:r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "enable_split_tunneling": true, "health_reasons": [{"code": "cannot_access_server_certificate", "message": "Failed to get VPN server\'s server certificate from Secrets Manager.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-health"}], "health_state": "ok", "hostname": "a8506291.us-south.vpn-server.appdomain.cloud", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-vpn-server", "port": 443, "private_ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "protocol": "udp", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpn_server", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}'
responses.add(
responses.PATCH,
url,
@@ -39066,75 +39646,168 @@ def test_update_load_balancer_listener_policy_value_error(self):
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 CertificateInstanceIdentityByCRN model
+ certificate_instance_identity_model = {}
+ certificate_instance_identity_model['crn'] = 'crn:v1:bluemix:public:secrets-manager:us-south:a/123456:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5'
- # Construct a dict representation of a 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
+ # Construct a dict representation of a VPNServerAuthenticationByUsernameIdProviderByIAM model
+ vpn_server_authentication_by_username_id_provider_model = {}
+ vpn_server_authentication_by_username_id_provider_model['provider_type'] = 'iam'
+
+ # Construct a dict representation of a VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype model
+ vpn_server_authentication_prototype_model = {}
+ vpn_server_authentication_prototype_model['method'] = 'username'
+ vpn_server_authentication_prototype_model['identity_provider'] = vpn_server_authentication_by_username_id_provider_model
+
+ # Construct a dict representation of a IP model
+ ip_model = {}
+ ip_model['address'] = '192.168.3.4'
+
+ # 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 VPNServerPatch model
+ vpn_server_patch_model = {}
+ vpn_server_patch_model['certificate'] = certificate_instance_identity_model
+ vpn_server_patch_model['client_authentication'] = [vpn_server_authentication_prototype_model]
+ vpn_server_patch_model['client_dns_server_ips'] = [ip_model]
+ vpn_server_patch_model['client_idle_timeout'] = 600
+ vpn_server_patch_model['client_ip_pool'] = '172.16.0.0/16'
+ vpn_server_patch_model['enable_split_tunneling'] = True
+ vpn_server_patch_model['name'] = 'my-vpn-server'
+ vpn_server_patch_model['port'] = 443
+ vpn_server_patch_model['protocol'] = 'udp'
+ vpn_server_patch_model['subnets'] = [subnet_identity_model]
# Set up parameter values
- load_balancer_id = 'testString'
- listener_id = 'testString'
id = 'testString'
- load_balancer_listener_policy_patch = load_balancer_listener_policy_patch_model
+ vpn_server_patch = vpn_server_patch_model
+
+ # Invoke method
+ response = _service.update_vpn_server(
+ id,
+ vpn_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 == vpn_server_patch
+
+ def test_update_vpn_server_required_params_with_retries(self):
+ # Enable retries and run test_update_vpn_server_required_params.
+ _service.enable_retries()
+ self.test_update_vpn_server_required_params()
+
+ # Disable retries and run test_update_vpn_server_required_params.
+ _service.disable_retries()
+ self.test_update_vpn_server_required_params()
+
+ @responses.activate
+ def test_update_vpn_server_value_error(self):
+ """
+ test_update_vpn_server_value_error()
+ """
+ # Set up mock
+ url = preprocess_url('/vpn_servers/testString')
+ mock_response = '{"certificate": {"crn": "crn:v1:bluemix:public:secrets-manager:us-south:a/123456:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5"}, "client_authentication": [{"method": "certificate", "identity_provider": {"provider_type": "iam"}}], "client_auto_delete": true, "client_auto_delete_timeout": 1, "client_dns_server_ips": [{"address": "192.168.3.4"}], "client_idle_timeout": 600, "client_ip_pool": "172.16.0.0/16", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpn-server:r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "enable_split_tunneling": true, "health_reasons": [{"code": "cannot_access_server_certificate", "message": "Failed to get VPN server\'s server certificate from Secrets Manager.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-health"}], "health_state": "ok", "hostname": "a8506291.us-south.vpn-server.appdomain.cloud", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-vpn-server", "port": 443, "private_ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "protocol": "udp", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpn_server", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}'
+ responses.add(
+ responses.PATCH,
+ 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:secrets-manager:us-south:a/123456:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5'
+
+ # Construct a dict representation of a VPNServerAuthenticationByUsernameIdProviderByIAM model
+ vpn_server_authentication_by_username_id_provider_model = {}
+ vpn_server_authentication_by_username_id_provider_model['provider_type'] = 'iam'
+
+ # Construct a dict representation of a VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype model
+ vpn_server_authentication_prototype_model = {}
+ vpn_server_authentication_prototype_model['method'] = 'username'
+ vpn_server_authentication_prototype_model['identity_provider'] = vpn_server_authentication_by_username_id_provider_model
+
+ # Construct a dict representation of a IP model
+ ip_model = {}
+ ip_model['address'] = '192.168.3.4'
+
+ # 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 VPNServerPatch model
+ vpn_server_patch_model = {}
+ vpn_server_patch_model['certificate'] = certificate_instance_identity_model
+ vpn_server_patch_model['client_authentication'] = [vpn_server_authentication_prototype_model]
+ vpn_server_patch_model['client_dns_server_ips'] = [ip_model]
+ vpn_server_patch_model['client_idle_timeout'] = 600
+ vpn_server_patch_model['client_ip_pool'] = '172.16.0.0/16'
+ vpn_server_patch_model['enable_split_tunneling'] = True
+ vpn_server_patch_model['name'] = 'my-vpn-server'
+ vpn_server_patch_model['port'] = 443
+ vpn_server_patch_model['protocol'] = 'udp'
+ vpn_server_patch_model['subnets'] = [subnet_identity_model]
+
+ # Set up parameter values
+ id = 'testString'
+ vpn_server_patch = vpn_server_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,
"id": id,
- "load_balancer_listener_policy_patch": load_balancer_listener_policy_patch,
+ "vpn_server_patch": vpn_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.update_load_balancer_listener_policy(**req_copy)
+ _service.update_vpn_server(**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_update_vpn_server_value_error_with_retries(self):
+ # Enable retries and run test_update_vpn_server_value_error.
_service.enable_retries()
- self.test_update_load_balancer_listener_policy_value_error()
+ self.test_update_vpn_server_value_error()
- # Disable retries and run test_update_load_balancer_listener_policy_value_error.
+ # Disable retries and run test_update_vpn_server_value_error.
_service.disable_retries()
- self.test_update_load_balancer_listener_policy_value_error()
+ self.test_update_vpn_server_value_error()
-class TestListLoadBalancerListenerPolicyRules:
+class TestGetVpnServerClientConfiguration:
"""
- Test Class for list_load_balancer_listener_policy_rules
+ Test Class for get_vpn_server_client_configuration
"""
@responses.activate
- def test_list_load_balancer_listener_policy_rules_all_params(self):
+ def test_get_vpn_server_client_configuration_all_params(self):
"""
- list_load_balancer_listener_policy_rules()
+ get_vpn_server_client_configuration()
"""
# Set up mock
- 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"}]}'
+ url = preprocess_url('/vpn_servers/testString/client_configuration')
+ mock_response = '"client\nproto udp\nremote a8506291.us-south.vpn-server.appdomain.cloud\nport 443\n\ndev tun\nnobind\n\n-----BEGIN CERTIFICATE-----\nxxxxxx\n-----END CERTIFICATE-----\n"'
responses.add(
responses.GET,
url,
body=mock_response,
- content_type='application/json',
+ content_type='text/plain',
status=200,
)
# Set up parameter values
- load_balancer_id = 'testString'
- listener_id = 'testString'
- policy_id = 'testString'
+ id = 'testString'
# Invoke method
- response = _service.list_load_balancer_listener_policy_rules(
- load_balancer_id,
- listener_id,
- policy_id,
+ response = _service.get_vpn_server_client_configuration(
+ id,
headers={},
)
@@ -39142,179 +39815,269 @@ def test_list_load_balancer_listener_policy_rules_all_params(self):
assert len(responses.calls) == 1
assert response.status_code == 200
- 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_get_vpn_server_client_configuration_all_params_with_retries(self):
+ # Enable retries and run test_get_vpn_server_client_configuration_all_params.
_service.enable_retries()
- self.test_list_load_balancer_listener_policy_rules_all_params()
+ self.test_get_vpn_server_client_configuration_all_params()
- # Disable retries and run test_list_load_balancer_listener_policy_rules_all_params.
+ # Disable retries and run test_get_vpn_server_client_configuration_all_params.
_service.disable_retries()
- self.test_list_load_balancer_listener_policy_rules_all_params()
+ self.test_get_vpn_server_client_configuration_all_params()
@responses.activate
- def test_list_load_balancer_listener_policy_rules_value_error(self):
+ def test_get_vpn_server_client_configuration_value_error(self):
"""
- test_list_load_balancer_listener_policy_rules_value_error()
+ test_get_vpn_server_client_configuration_value_error()
"""
# Set up mock
- 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"}]}'
+ url = preprocess_url('/vpn_servers/testString/client_configuration')
+ mock_response = '"client\nproto udp\nremote a8506291.us-south.vpn-server.appdomain.cloud\nport 443\n\ndev tun\nnobind\n\n-----BEGIN CERTIFICATE-----\nxxxxxx\n-----END CERTIFICATE-----\n"'
responses.add(
responses.GET,
url,
body=mock_response,
- content_type='application/json',
+ content_type='text/plain',
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.list_load_balancer_listener_policy_rules(**req_copy)
+ _service.get_vpn_server_client_configuration(**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.
+ def test_get_vpn_server_client_configuration_value_error_with_retries(self):
+ # Enable retries and run test_get_vpn_server_client_configuration_value_error.
_service.enable_retries()
- self.test_list_load_balancer_listener_policy_rules_value_error()
+ self.test_get_vpn_server_client_configuration_value_error()
- # Disable retries and run test_list_load_balancer_listener_policy_rules_value_error.
+ # Disable retries and run test_get_vpn_server_client_configuration_value_error.
_service.disable_retries()
- self.test_list_load_balancer_listener_policy_rules_value_error()
+ self.test_get_vpn_server_client_configuration_value_error()
-class TestCreateLoadBalancerListenerPolicyRule:
+class TestListVpnServerClients:
"""
- Test Class for create_load_balancer_listener_policy_rule
+ Test Class for list_vpn_server_clients
"""
@responses.activate
- def test_create_load_balancer_listener_policy_rule_all_params(self):
+ def test_list_vpn_server_clients_all_params(self):
"""
- create_load_balancer_listener_policy_rule()
+ list_vpn_server_clients()
"""
# Set up mock
- 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"}'
+ url = preprocess_url('/vpn_servers/testString/clients')
+ mock_response = '{"clients": [{"client_ip": {"address": "192.168.3.4"}, "common_name": "common_name", "created_at": "2019-01-01T12:00:00.000Z", "disconnected_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/8e454ead-0db7-48ac-9a8b-2698d8c470a7/clients/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "r006-1a15dca5-7e33-45e1-b7c5-bc690e569531", "remote_ip": {"address": "192.168.3.4"}, "remote_port": 22, "resource_type": "vpn_server_client", "status": "connected", "username": "username"}], "first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-982d72b7-db1b-4606-afb2-ed6bd4b0bed1/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531/clients?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-982d72b7-db1b-4606-afb2-ed6bd4b0bed1/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531/clients?start=a5e812a2-62c0-4555-86a5-907106760c56&limit=20"}, "total_count": 132}'
responses.add(
- responses.POST,
+ responses.GET,
url,
body=mock_response,
content_type='application/json',
- status=201,
+ status=200,
)
# Set up parameter values
- load_balancer_id = 'testString'
- listener_id = 'testString'
- policy_id = 'testString'
- condition = 'contains'
- type = 'body'
- value = 'testString'
- field = 'MY-APP-HEADER'
+ vpn_server_id = 'testString'
+ start = 'testString'
+ limit = 50
+ sort = 'created_at'
# Invoke method
- response = _service.create_load_balancer_listener_policy_rule(
- load_balancer_id,
- listener_id,
- policy_id,
- condition,
- type,
- value,
- field=field,
+ response = _service.list_vpn_server_clients(
+ vpn_server_id,
+ start=start,
+ limit=limit,
+ sort=sort,
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'
+ 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_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_vpn_server_clients_all_params_with_retries(self):
+ # Enable retries and run test_list_vpn_server_clients_all_params.
_service.enable_retries()
- self.test_create_load_balancer_listener_policy_rule_all_params()
+ self.test_list_vpn_server_clients_all_params()
- # Disable retries and run test_create_load_balancer_listener_policy_rule_all_params.
+ # Disable retries and run test_list_vpn_server_clients_all_params.
_service.disable_retries()
- self.test_create_load_balancer_listener_policy_rule_all_params()
+ self.test_list_vpn_server_clients_all_params()
@responses.activate
- def test_create_load_balancer_listener_policy_rule_value_error(self):
+ def test_list_vpn_server_clients_required_params(self):
"""
- test_create_load_balancer_listener_policy_rule_value_error()
+ test_list_vpn_server_clients_required_params()
"""
# Set up mock
- 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"}'
+ url = preprocess_url('/vpn_servers/testString/clients')
+ mock_response = '{"clients": [{"client_ip": {"address": "192.168.3.4"}, "common_name": "common_name", "created_at": "2019-01-01T12:00:00.000Z", "disconnected_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/8e454ead-0db7-48ac-9a8b-2698d8c470a7/clients/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "r006-1a15dca5-7e33-45e1-b7c5-bc690e569531", "remote_ip": {"address": "192.168.3.4"}, "remote_port": 22, "resource_type": "vpn_server_client", "status": "connected", "username": "username"}], "first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-982d72b7-db1b-4606-afb2-ed6bd4b0bed1/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531/clients?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-982d72b7-db1b-4606-afb2-ed6bd4b0bed1/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531/clients?start=a5e812a2-62c0-4555-86a5-907106760c56&limit=20"}, "total_count": 132}'
responses.add(
- responses.POST,
+ responses.GET,
url,
body=mock_response,
content_type='application/json',
- status=201,
+ status=200,
)
# Set up parameter values
- load_balancer_id = 'testString'
- listener_id = 'testString'
- policy_id = 'testString'
- condition = 'contains'
- type = 'body'
- value = 'testString'
- field = 'MY-APP-HEADER'
+ vpn_server_id = 'testString'
+
+ # Invoke method
+ response = _service.list_vpn_server_clients(
+ vpn_server_id,
+ headers={},
+ )
+
+ # Check for correct operation
+ assert len(responses.calls) == 1
+ assert response.status_code == 200
+
+ def test_list_vpn_server_clients_required_params_with_retries(self):
+ # Enable retries and run test_list_vpn_server_clients_required_params.
+ _service.enable_retries()
+ self.test_list_vpn_server_clients_required_params()
+
+ # Disable retries and run test_list_vpn_server_clients_required_params.
+ _service.disable_retries()
+ self.test_list_vpn_server_clients_required_params()
+
+ @responses.activate
+ def test_list_vpn_server_clients_value_error(self):
+ """
+ test_list_vpn_server_clients_value_error()
+ """
+ # Set up mock
+ url = preprocess_url('/vpn_servers/testString/clients')
+ mock_response = '{"clients": [{"client_ip": {"address": "192.168.3.4"}, "common_name": "common_name", "created_at": "2019-01-01T12:00:00.000Z", "disconnected_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/8e454ead-0db7-48ac-9a8b-2698d8c470a7/clients/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "r006-1a15dca5-7e33-45e1-b7c5-bc690e569531", "remote_ip": {"address": "192.168.3.4"}, "remote_port": 22, "resource_type": "vpn_server_client", "status": "connected", "username": "username"}], "first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-982d72b7-db1b-4606-afb2-ed6bd4b0bed1/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531/clients?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-982d72b7-db1b-4606-afb2-ed6bd4b0bed1/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531/clients?start=a5e812a2-62c0-4555-86a5-907106760c56&limit=20"}, "total_count": 132}'
+ responses.add(
+ responses.GET,
+ url,
+ body=mock_response,
+ content_type='application/json',
+ status=200,
+ )
+
+ # Set up parameter values
+ vpn_server_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,
- "condition": condition,
- "type": type,
- "value": value,
+ "vpn_server_id": vpn_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.create_load_balancer_listener_policy_rule(**req_copy)
+ _service.list_vpn_server_clients(**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_vpn_server_clients_value_error_with_retries(self):
+ # Enable retries and run test_list_vpn_server_clients_value_error.
_service.enable_retries()
- self.test_create_load_balancer_listener_policy_rule_value_error()
+ self.test_list_vpn_server_clients_value_error()
- # Disable retries and run test_create_load_balancer_listener_policy_rule_value_error.
+ # Disable retries and run test_list_vpn_server_clients_value_error.
_service.disable_retries()
- self.test_create_load_balancer_listener_policy_rule_value_error()
+ self.test_list_vpn_server_clients_value_error()
+
+ @responses.activate
+ def test_list_vpn_server_clients_with_pager_get_next(self):
+ """
+ test_list_vpn_server_clients_with_pager_get_next()
+ """
+ # Set up a two-page mock response
+ url = preprocess_url('/vpn_servers/testString/clients')
+ mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"clients":[{"client_ip":{"address":"192.168.3.4"},"common_name":"common_name","created_at":"2019-01-01T12:00:00.000Z","disconnected_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/8e454ead-0db7-48ac-9a8b-2698d8c470a7/clients/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531","id":"r006-1a15dca5-7e33-45e1-b7c5-bc690e569531","remote_ip":{"address":"192.168.3.4"},"remote_port":22,"resource_type":"vpn_server_client","status":"connected","username":"username"}],"total_count":2,"limit":1}'
+ mock_response2 = '{"clients":[{"client_ip":{"address":"192.168.3.4"},"common_name":"common_name","created_at":"2019-01-01T12:00:00.000Z","disconnected_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/8e454ead-0db7-48ac-9a8b-2698d8c470a7/clients/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531","id":"r006-1a15dca5-7e33-45e1-b7c5-bc690e569531","remote_ip":{"address":"192.168.3.4"},"remote_port":22,"resource_type":"vpn_server_client","status":"connected","username":"username"}],"total_count":2,"limit":1}'
+ responses.add(
+ responses.GET,
+ url,
+ body=mock_response1,
+ content_type='application/json',
+ status=200,
+ )
+ responses.add(
+ responses.GET,
+ url,
+ body=mock_response2,
+ content_type='application/json',
+ status=200,
+ )
+ # Exercise the pager class for this operation
+ all_results = []
+ pager = VpnServerClientsPager(
+ client=_service,
+ vpn_server_id='testString',
+ limit=10,
+ sort='created_at',
+ )
+ while pager.has_next():
+ next_page = pager.get_next()
+ assert next_page is not None
+ all_results.extend(next_page)
+ assert len(all_results) == 2
-class TestDeleteLoadBalancerListenerPolicyRule:
+ @responses.activate
+ def test_list_vpn_server_clients_with_pager_get_all(self):
+ """
+ test_list_vpn_server_clients_with_pager_get_all()
+ """
+ # Set up a two-page mock response
+ url = preprocess_url('/vpn_servers/testString/clients')
+ mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"clients":[{"client_ip":{"address":"192.168.3.4"},"common_name":"common_name","created_at":"2019-01-01T12:00:00.000Z","disconnected_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/8e454ead-0db7-48ac-9a8b-2698d8c470a7/clients/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531","id":"r006-1a15dca5-7e33-45e1-b7c5-bc690e569531","remote_ip":{"address":"192.168.3.4"},"remote_port":22,"resource_type":"vpn_server_client","status":"connected","username":"username"}],"total_count":2,"limit":1}'
+ mock_response2 = '{"clients":[{"client_ip":{"address":"192.168.3.4"},"common_name":"common_name","created_at":"2019-01-01T12:00:00.000Z","disconnected_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/8e454ead-0db7-48ac-9a8b-2698d8c470a7/clients/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531","id":"r006-1a15dca5-7e33-45e1-b7c5-bc690e569531","remote_ip":{"address":"192.168.3.4"},"remote_port":22,"resource_type":"vpn_server_client","status":"connected","username":"username"}],"total_count":2,"limit":1}'
+ responses.add(
+ responses.GET,
+ url,
+ body=mock_response1,
+ content_type='application/json',
+ status=200,
+ )
+ responses.add(
+ responses.GET,
+ url,
+ body=mock_response2,
+ content_type='application/json',
+ status=200,
+ )
+
+ # Exercise the pager class for this operation
+ pager = VpnServerClientsPager(
+ client=_service,
+ vpn_server_id='testString',
+ limit=10,
+ sort='created_at',
+ )
+ all_results = pager.get_all()
+ assert all_results is not None
+ assert len(all_results) == 2
+
+
+class TestDeleteVpnServerClient:
"""
- Test Class for delete_load_balancer_listener_policy_rule
+ Test Class for delete_vpn_server_client
"""
@responses.activate
- def test_delete_load_balancer_listener_policy_rule_all_params(self):
+ def test_delete_vpn_server_client_all_params(self):
"""
- delete_load_balancer_listener_policy_rule()
+ delete_vpn_server_client()
"""
# Set up mock
- url = preprocess_url('/load_balancers/testString/listeners/testString/policies/testString/rules/testString')
+ url = preprocess_url('/vpn_servers/testString/clients/testString')
responses.add(
responses.DELETE,
url,
@@ -39322,16 +40085,12 @@ def test_delete_load_balancer_listener_policy_rule_all_params(self):
)
# Set up parameter values
- load_balancer_id = 'testString'
- listener_id = 'testString'
- policy_id = 'testString'
+ vpn_server_id = 'testString'
id = 'testString'
# Invoke method
- response = _service.delete_load_balancer_listener_policy_rule(
- load_balancer_id,
- listener_id,
- policy_id,
+ response = _service.delete_vpn_server_client(
+ vpn_server_id,
id,
headers={},
)
@@ -39340,22 +40099,22 @@ def test_delete_load_balancer_listener_policy_rule_all_params(self):
assert len(responses.calls) == 1
assert response.status_code == 202
- def test_delete_load_balancer_listener_policy_rule_all_params_with_retries(self):
- # Enable retries and run test_delete_load_balancer_listener_policy_rule_all_params.
+ def test_delete_vpn_server_client_all_params_with_retries(self):
+ # Enable retries and run test_delete_vpn_server_client_all_params.
_service.enable_retries()
- self.test_delete_load_balancer_listener_policy_rule_all_params()
+ self.test_delete_vpn_server_client_all_params()
- # Disable retries and run test_delete_load_balancer_listener_policy_rule_all_params.
+ # Disable retries and run test_delete_vpn_server_client_all_params.
_service.disable_retries()
- self.test_delete_load_balancer_listener_policy_rule_all_params()
+ self.test_delete_vpn_server_client_all_params()
@responses.activate
- def test_delete_load_balancer_listener_policy_rule_value_error(self):
+ def test_delete_vpn_server_client_value_error(self):
"""
- test_delete_load_balancer_listener_policy_rule_value_error()
+ test_delete_vpn_server_client_value_error()
"""
# Set up mock
- url = preprocess_url('/load_balancers/testString/listeners/testString/policies/testString/rules/testString')
+ url = preprocess_url('/vpn_servers/testString/clients/testString')
responses.add(
responses.DELETE,
url,
@@ -39363,46 +40122,42 @@ def test_delete_load_balancer_listener_policy_rule_value_error(self):
)
# Set up parameter values
- load_balancer_id = 'testString'
- listener_id = 'testString'
- policy_id = 'testString'
+ vpn_server_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,
+ "vpn_server_id": vpn_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_load_balancer_listener_policy_rule(**req_copy)
+ _service.delete_vpn_server_client(**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_delete_vpn_server_client_value_error_with_retries(self):
+ # Enable retries and run test_delete_vpn_server_client_value_error.
_service.enable_retries()
- self.test_delete_load_balancer_listener_policy_rule_value_error()
+ self.test_delete_vpn_server_client_value_error()
- # Disable retries and run test_delete_load_balancer_listener_policy_rule_value_error.
+ # Disable retries and run test_delete_vpn_server_client_value_error.
_service.disable_retries()
- self.test_delete_load_balancer_listener_policy_rule_value_error()
+ self.test_delete_vpn_server_client_value_error()
-class TestGetLoadBalancerListenerPolicyRule:
+class TestGetVpnServerClient:
"""
- Test Class for get_load_balancer_listener_policy_rule
+ Test Class for get_vpn_server_client
"""
@responses.activate
- def test_get_load_balancer_listener_policy_rule_all_params(self):
+ def test_get_vpn_server_client_all_params(self):
"""
- get_load_balancer_listener_policy_rule()
+ get_vpn_server_client()
"""
# Set up mock
- 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"}'
+ url = preprocess_url('/vpn_servers/testString/clients/testString')
+ mock_response = '{"client_ip": {"address": "192.168.3.4"}, "common_name": "common_name", "created_at": "2019-01-01T12:00:00.000Z", "disconnected_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/8e454ead-0db7-48ac-9a8b-2698d8c470a7/clients/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "r006-1a15dca5-7e33-45e1-b7c5-bc690e569531", "remote_ip": {"address": "192.168.3.4"}, "remote_port": 22, "resource_type": "vpn_server_client", "status": "connected", "username": "username"}'
responses.add(
responses.GET,
url,
@@ -39412,16 +40167,12 @@ def test_get_load_balancer_listener_policy_rule_all_params(self):
)
# Set up parameter values
- load_balancer_id = 'testString'
- listener_id = 'testString'
- policy_id = 'testString'
+ vpn_server_id = 'testString'
id = 'testString'
# Invoke method
- response = _service.get_load_balancer_listener_policy_rule(
- load_balancer_id,
- listener_id,
- policy_id,
+ response = _service.get_vpn_server_client(
+ vpn_server_id,
id,
headers={},
)
@@ -39430,23 +40181,23 @@ def test_get_load_balancer_listener_policy_rule_all_params(self):
assert len(responses.calls) == 1
assert response.status_code == 200
- 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_get_vpn_server_client_all_params_with_retries(self):
+ # Enable retries and run test_get_vpn_server_client_all_params.
_service.enable_retries()
- self.test_get_load_balancer_listener_policy_rule_all_params()
+ self.test_get_vpn_server_client_all_params()
- # Disable retries and run test_get_load_balancer_listener_policy_rule_all_params.
+ # Disable retries and run test_get_vpn_server_client_all_params.
_service.disable_retries()
- self.test_get_load_balancer_listener_policy_rule_all_params()
+ self.test_get_vpn_server_client_all_params()
@responses.activate
- def test_get_load_balancer_listener_policy_rule_value_error(self):
+ def test_get_vpn_server_client_value_error(self):
"""
- test_get_load_balancer_listener_policy_rule_value_error()
+ test_get_vpn_server_client_value_error()
"""
# Set up mock
- 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"}'
+ url = preprocess_url('/vpn_servers/testString/clients/testString')
+ mock_response = '{"client_ip": {"address": "192.168.3.4"}, "common_name": "common_name", "created_at": "2019-01-01T12:00:00.000Z", "disconnected_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/8e454ead-0db7-48ac-9a8b-2698d8c470a7/clients/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "r006-1a15dca5-7e33-45e1-b7c5-bc690e569531", "remote_ip": {"address": "192.168.3.4"}, "remote_port": 22, "resource_type": "vpn_server_client", "status": "connected", "username": "username"}'
responses.add(
responses.GET,
url,
@@ -39456,160 +40207,121 @@ def test_get_load_balancer_listener_policy_rule_value_error(self):
)
# Set up parameter values
- load_balancer_id = 'testString'
- listener_id = 'testString'
- policy_id = 'testString'
+ vpn_server_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,
+ "vpn_server_id": vpn_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_load_balancer_listener_policy_rule(**req_copy)
+ _service.get_vpn_server_client(**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.
+ def test_get_vpn_server_client_value_error_with_retries(self):
+ # Enable retries and run test_get_vpn_server_client_value_error.
_service.enable_retries()
- self.test_get_load_balancer_listener_policy_rule_value_error()
+ self.test_get_vpn_server_client_value_error()
- # Disable retries and run test_get_load_balancer_listener_policy_rule_value_error.
+ # Disable retries and run test_get_vpn_server_client_value_error.
_service.disable_retries()
- self.test_get_load_balancer_listener_policy_rule_value_error()
+ self.test_get_vpn_server_client_value_error()
-class TestUpdateLoadBalancerListenerPolicyRule:
+class TestDisconnectVpnClient:
"""
- Test Class for update_load_balancer_listener_policy_rule
+ Test Class for disconnect_vpn_client
"""
@responses.activate
- def test_update_load_balancer_listener_policy_rule_all_params(self):
+ def test_disconnect_vpn_client_all_params(self):
"""
- update_load_balancer_listener_policy_rule()
+ disconnect_vpn_client()
"""
# Set up mock
- 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"}'
+ url = preprocess_url('/vpn_servers/testString/clients/testString/disconnect')
responses.add(
- responses.PATCH,
+ responses.POST,
url,
- body=mock_response,
- content_type='application/json',
- status=200,
+ status=202,
)
- # 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'
+ vpn_server_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,
+ response = _service.disconnect_vpn_client(
+ vpn_server_id,
id,
- load_balancer_listener_policy_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 == load_balancer_listener_policy_rule_patch
+ assert response.status_code == 202
- 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_disconnect_vpn_client_all_params_with_retries(self):
+ # Enable retries and run test_disconnect_vpn_client_all_params.
_service.enable_retries()
- self.test_update_load_balancer_listener_policy_rule_all_params()
+ self.test_disconnect_vpn_client_all_params()
- # Disable retries and run test_update_load_balancer_listener_policy_rule_all_params.
+ # Disable retries and run test_disconnect_vpn_client_all_params.
_service.disable_retries()
- self.test_update_load_balancer_listener_policy_rule_all_params()
+ self.test_disconnect_vpn_client_all_params()
@responses.activate
- def test_update_load_balancer_listener_policy_rule_value_error(self):
+ def test_disconnect_vpn_client_value_error(self):
"""
- test_update_load_balancer_listener_policy_rule_value_error()
+ test_disconnect_vpn_client_value_error()
"""
# Set up mock
- 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"}'
+ url = preprocess_url('/vpn_servers/testString/clients/testString/disconnect')
responses.add(
- responses.PATCH,
+ responses.POST,
url,
- body=mock_response,
- content_type='application/json',
- status=200,
+ status=202,
)
- # 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'
+ vpn_server_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,
+ "vpn_server_id": vpn_server_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.disconnect_vpn_client(**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_disconnect_vpn_client_value_error_with_retries(self):
+ # Enable retries and run test_disconnect_vpn_client_value_error.
_service.enable_retries()
- self.test_update_load_balancer_listener_policy_rule_value_error()
+ self.test_disconnect_vpn_client_value_error()
- # Disable retries and run test_update_load_balancer_listener_policy_rule_value_error.
+ # Disable retries and run test_disconnect_vpn_client_value_error.
_service.disable_retries()
- self.test_update_load_balancer_listener_policy_rule_value_error()
+ self.test_disconnect_vpn_client_value_error()
-class TestListLoadBalancerPools:
+class TestListVpnServerRoutes:
"""
- Test Class for list_load_balancer_pools
+ Test Class for list_vpn_server_routes
"""
@responses.activate
- def test_list_load_balancer_pools_all_params(self):
+ def test_list_vpn_server_routes_all_params(self):
"""
- list_load_balancer_pools()
+ list_vpn_server_routes()
"""
# Set up mock
- 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"}}]}'
+ url = preprocess_url('/vpn_servers/testString/routes')
+ mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routes?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routes?start=a5e812a2-62c0-4555-86a5-907106760c56&limit=20"}, "routes": [{"action": "deliver", "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "health_reasons": [{"code": "internal_error", "message": "Internal error (contact IBM support).", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-route-health"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "r006-1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-vpn-route-1", "resource_type": "vpn_server_route"}], "total_count": 132}'
responses.add(
responses.GET,
url,
@@ -39619,11 +40331,61 @@ def test_list_load_balancer_pools_all_params(self):
)
# Set up parameter values
- load_balancer_id = 'testString'
+ vpn_server_id = 'testString'
+ start = 'testString'
+ limit = 50
+ sort = 'name'
# Invoke method
- response = _service.list_load_balancer_pools(
- load_balancer_id,
+ response = _service.list_vpn_server_routes(
+ vpn_server_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_vpn_server_routes_all_params_with_retries(self):
+ # Enable retries and run test_list_vpn_server_routes_all_params.
+ _service.enable_retries()
+ self.test_list_vpn_server_routes_all_params()
+
+ # Disable retries and run test_list_vpn_server_routes_all_params.
+ _service.disable_retries()
+ self.test_list_vpn_server_routes_all_params()
+
+ @responses.activate
+ def test_list_vpn_server_routes_required_params(self):
+ """
+ test_list_vpn_server_routes_required_params()
+ """
+ # Set up mock
+ url = preprocess_url('/vpn_servers/testString/routes')
+ mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routes?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routes?start=a5e812a2-62c0-4555-86a5-907106760c56&limit=20"}, "routes": [{"action": "deliver", "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "health_reasons": [{"code": "internal_error", "message": "Internal error (contact IBM support).", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-route-health"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "r006-1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-vpn-route-1", "resource_type": "vpn_server_route"}], "total_count": 132}'
+ responses.add(
+ responses.GET,
+ url,
+ body=mock_response,
+ content_type='application/json',
+ status=200,
+ )
+
+ # Set up parameter values
+ vpn_server_id = 'testString'
+
+ # Invoke method
+ response = _service.list_vpn_server_routes(
+ vpn_server_id,
headers={},
)
@@ -39631,23 +40393,23 @@ def test_list_load_balancer_pools_all_params(self):
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.
+ def test_list_vpn_server_routes_required_params_with_retries(self):
+ # Enable retries and run test_list_vpn_server_routes_required_params.
_service.enable_retries()
- self.test_list_load_balancer_pools_all_params()
+ self.test_list_vpn_server_routes_required_params()
- # Disable retries and run test_list_load_balancer_pools_all_params.
+ # Disable retries and run test_list_vpn_server_routes_required_params.
_service.disable_retries()
- self.test_list_load_balancer_pools_all_params()
+ self.test_list_vpn_server_routes_required_params()
@responses.activate
- def test_list_load_balancer_pools_value_error(self):
+ def test_list_vpn_server_routes_value_error(self):
"""
- test_list_load_balancer_pools_value_error()
+ test_list_vpn_server_routes_value_error()
"""
# Set up mock
- 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"}}]}'
+ url = preprocess_url('/vpn_servers/testString/routes')
+ mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routes?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routes?start=a5e812a2-62c0-4555-86a5-907106760c56&limit=20"}, "routes": [{"action": "deliver", "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "health_reasons": [{"code": "internal_error", "message": "Internal error (contact IBM support).", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-route-health"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "r006-1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-vpn-route-1", "resource_type": "vpn_server_route"}], "total_count": 132}'
responses.add(
responses.GET,
url,
@@ -39657,40 +40419,113 @@ def test_list_load_balancer_pools_value_error(self):
)
# Set up parameter values
- load_balancer_id = 'testString'
+ vpn_server_id = 'testString'
# Pass in all but one required param and check for a ValueError
req_param_dict = {
- "load_balancer_id": load_balancer_id,
+ "vpn_server_id": vpn_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_load_balancer_pools(**req_copy)
+ _service.list_vpn_server_routes(**req_copy)
- def test_list_load_balancer_pools_value_error_with_retries(self):
- # Enable retries and run test_list_load_balancer_pools_value_error.
+ def test_list_vpn_server_routes_value_error_with_retries(self):
+ # Enable retries and run test_list_vpn_server_routes_value_error.
_service.enable_retries()
- self.test_list_load_balancer_pools_value_error()
+ self.test_list_vpn_server_routes_value_error()
- # Disable retries and run test_list_load_balancer_pools_value_error.
+ # Disable retries and run test_list_vpn_server_routes_value_error.
_service.disable_retries()
- self.test_list_load_balancer_pools_value_error()
+ self.test_list_vpn_server_routes_value_error()
+
+ @responses.activate
+ def test_list_vpn_server_routes_with_pager_get_next(self):
+ """
+ test_list_vpn_server_routes_with_pager_get_next()
+ """
+ # Set up a two-page mock response
+ url = preprocess_url('/vpn_servers/testString/routes')
+ mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"routes":[{"action":"deliver","created_at":"2019-01-01T12:00:00.000Z","destination":"192.168.3.0/24","health_reasons":[{"code":"internal_error","message":"Internal error (contact IBM support).","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-route-health"}],"health_state":"ok","href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531","id":"r006-1a15dca5-7e33-45e1-b7c5-bc690e569531","lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","name":"my-vpn-route-1","resource_type":"vpn_server_route"}],"total_count":2,"limit":1}'
+ mock_response2 = '{"routes":[{"action":"deliver","created_at":"2019-01-01T12:00:00.000Z","destination":"192.168.3.0/24","health_reasons":[{"code":"internal_error","message":"Internal error (contact IBM support).","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-route-health"}],"health_state":"ok","href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531","id":"r006-1a15dca5-7e33-45e1-b7c5-bc690e569531","lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","name":"my-vpn-route-1","resource_type":"vpn_server_route"}],"total_count":2,"limit":1}'
+ responses.add(
+ responses.GET,
+ url,
+ body=mock_response1,
+ content_type='application/json',
+ status=200,
+ )
+ responses.add(
+ responses.GET,
+ url,
+ body=mock_response2,
+ content_type='application/json',
+ status=200,
+ )
+ # Exercise the pager class for this operation
+ all_results = []
+ pager = VpnServerRoutesPager(
+ client=_service,
+ vpn_server_id='testString',
+ limit=10,
+ sort='name',
+ )
+ while pager.has_next():
+ next_page = pager.get_next()
+ assert next_page is not None
+ all_results.extend(next_page)
+ assert len(all_results) == 2
-class TestCreateLoadBalancerPool:
+ @responses.activate
+ def test_list_vpn_server_routes_with_pager_get_all(self):
+ """
+ test_list_vpn_server_routes_with_pager_get_all()
+ """
+ # Set up a two-page mock response
+ url = preprocess_url('/vpn_servers/testString/routes')
+ mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"routes":[{"action":"deliver","created_at":"2019-01-01T12:00:00.000Z","destination":"192.168.3.0/24","health_reasons":[{"code":"internal_error","message":"Internal error (contact IBM support).","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-route-health"}],"health_state":"ok","href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531","id":"r006-1a15dca5-7e33-45e1-b7c5-bc690e569531","lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","name":"my-vpn-route-1","resource_type":"vpn_server_route"}],"total_count":2,"limit":1}'
+ mock_response2 = '{"routes":[{"action":"deliver","created_at":"2019-01-01T12:00:00.000Z","destination":"192.168.3.0/24","health_reasons":[{"code":"internal_error","message":"Internal error (contact IBM support).","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-route-health"}],"health_state":"ok","href":"https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531","id":"r006-1a15dca5-7e33-45e1-b7c5-bc690e569531","lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","name":"my-vpn-route-1","resource_type":"vpn_server_route"}],"total_count":2,"limit":1}'
+ responses.add(
+ responses.GET,
+ url,
+ body=mock_response1,
+ content_type='application/json',
+ status=200,
+ )
+ responses.add(
+ responses.GET,
+ url,
+ body=mock_response2,
+ content_type='application/json',
+ status=200,
+ )
+
+ # Exercise the pager class for this operation
+ pager = VpnServerRoutesPager(
+ client=_service,
+ vpn_server_id='testString',
+ limit=10,
+ sort='name',
+ )
+ all_results = pager.get_all()
+ assert all_results is not None
+ assert len(all_results) == 2
+
+
+class TestCreateVpnServerRoute:
"""
- Test Class for create_load_balancer_pool
+ Test Class for create_vpn_server_route
"""
@responses.activate
- def test_create_load_balancer_pool_all_params(self):
+ def test_create_vpn_server_route_all_params(self):
"""
- create_load_balancer_pool()
+ create_vpn_server_route()
"""
# Set up mock
- 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"}}'
+ url = preprocess_url('/vpn_servers/testString/routes')
+ mock_response = '{"action": "deliver", "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "health_reasons": [{"code": "internal_error", "message": "Internal error (contact IBM support).", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-route-health"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "r006-1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-vpn-route-1", "resource_type": "vpn_server_route"}'
responses.add(
responses.POST,
url,
@@ -39699,50 +40534,18 @@ def test_create_load_balancer_pool_all_params(self):
status=201,
)
- # 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'
-
# 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
+ vpn_server_id = 'testString'
+ destination = '172.16.0.0/16'
+ action = 'deliver'
+ name = 'my-vpn-route-2'
# Invoke method
- response = _service.create_load_balancer_pool(
- load_balancer_id,
- algorithm,
- health_monitor,
- protocol,
- members=members,
+ response = _service.create_vpn_server_route(
+ vpn_server_id,
+ destination,
+ action=action,
name=name,
- proxy_protocol=proxy_protocol,
- session_persistence=session_persistence,
headers={},
)
@@ -39751,31 +40554,27 @@ 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['destination'] == '172.16.0.0/16'
+ assert req_body['action'] == 'deliver'
+ assert req_body['name'] == 'my-vpn-route-2'
- 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_vpn_server_route_all_params_with_retries(self):
+ # Enable retries and run test_create_vpn_server_route_all_params.
_service.enable_retries()
- self.test_create_load_balancer_pool_all_params()
+ self.test_create_vpn_server_route_all_params()
- # Disable retries and run test_create_load_balancer_pool_all_params.
+ # Disable retries and run test_create_vpn_server_route_all_params.
_service.disable_retries()
- self.test_create_load_balancer_pool_all_params()
+ self.test_create_vpn_server_route_all_params()
@responses.activate
- def test_create_load_balancer_pool_value_error(self):
+ def test_create_vpn_server_route_value_error(self):
"""
- test_create_load_balancer_pool_value_error()
+ test_create_vpn_server_route_value_error()
"""
# Set up mock
- 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"}}'
+ url = preprocess_url('/vpn_servers/testString/routes')
+ mock_response = '{"action": "deliver", "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "health_reasons": [{"code": "internal_error", "message": "Internal error (contact IBM support).", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-route-health"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "r006-1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-vpn-route-1", "resource_type": "vpn_server_route"}'
responses.add(
responses.POST,
url,
@@ -39784,74 +40583,44 @@ def test_create_load_balancer_pool_value_error(self):
status=201,
)
- # 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'
-
# 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
+ vpn_server_id = 'testString'
+ destination = '172.16.0.0/16'
+ action = 'deliver'
+ name = 'my-vpn-route-2'
# 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,
+ "vpn_server_id": vpn_server_id,
+ "destination": destination,
}
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_vpn_server_route(**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_vpn_server_route_value_error_with_retries(self):
+ # Enable retries and run test_create_vpn_server_route_value_error.
_service.enable_retries()
- self.test_create_load_balancer_pool_value_error()
+ self.test_create_vpn_server_route_value_error()
- # Disable retries and run test_create_load_balancer_pool_value_error.
+ # Disable retries and run test_create_vpn_server_route_value_error.
_service.disable_retries()
- self.test_create_load_balancer_pool_value_error()
+ self.test_create_vpn_server_route_value_error()
-class TestDeleteLoadBalancerPool:
+class TestDeleteVpnServerRoute:
"""
- Test Class for delete_load_balancer_pool
+ Test Class for delete_vpn_server_route
"""
@responses.activate
- def test_delete_load_balancer_pool_all_params(self):
+ def test_delete_vpn_server_route_all_params(self):
"""
- delete_load_balancer_pool()
+ delete_vpn_server_route()
"""
# Set up mock
- url = preprocess_url('/load_balancers/testString/pools/testString')
+ url = preprocess_url('/vpn_servers/testString/routes/testString')
responses.add(
responses.DELETE,
url,
@@ -39859,12 +40628,12 @@ def test_delete_load_balancer_pool_all_params(self):
)
# Set up parameter values
- load_balancer_id = 'testString'
+ vpn_server_id = 'testString'
id = 'testString'
# Invoke method
- response = _service.delete_load_balancer_pool(
- load_balancer_id,
+ response = _service.delete_vpn_server_route(
+ vpn_server_id,
id,
headers={},
)
@@ -39873,22 +40642,22 @@ def test_delete_load_balancer_pool_all_params(self):
assert len(responses.calls) == 1
assert response.status_code == 202
- def test_delete_load_balancer_pool_all_params_with_retries(self):
- # Enable retries and run test_delete_load_balancer_pool_all_params.
+ def test_delete_vpn_server_route_all_params_with_retries(self):
+ # Enable retries and run test_delete_vpn_server_route_all_params.
_service.enable_retries()
- self.test_delete_load_balancer_pool_all_params()
+ self.test_delete_vpn_server_route_all_params()
- # Disable retries and run test_delete_load_balancer_pool_all_params.
+ # Disable retries and run test_delete_vpn_server_route_all_params.
_service.disable_retries()
- self.test_delete_load_balancer_pool_all_params()
+ self.test_delete_vpn_server_route_all_params()
@responses.activate
- def test_delete_load_balancer_pool_value_error(self):
+ def test_delete_vpn_server_route_value_error(self):
"""
- test_delete_load_balancer_pool_value_error()
+ test_delete_vpn_server_route_value_error()
"""
# Set up mock
- url = preprocess_url('/load_balancers/testString/pools/testString')
+ url = preprocess_url('/vpn_servers/testString/routes/testString')
responses.add(
responses.DELETE,
url,
@@ -39896,42 +40665,42 @@ def test_delete_load_balancer_pool_value_error(self):
)
# Set up parameter values
- load_balancer_id = 'testString'
+ vpn_server_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_server_id": vpn_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_load_balancer_pool(**req_copy)
+ _service.delete_vpn_server_route(**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_vpn_server_route_value_error_with_retries(self):
+ # Enable retries and run test_delete_vpn_server_route_value_error.
_service.enable_retries()
- self.test_delete_load_balancer_pool_value_error()
+ self.test_delete_vpn_server_route_value_error()
- # Disable retries and run test_delete_load_balancer_pool_value_error.
+ # Disable retries and run test_delete_vpn_server_route_value_error.
_service.disable_retries()
- self.test_delete_load_balancer_pool_value_error()
+ self.test_delete_vpn_server_route_value_error()
-class TestGetLoadBalancerPool:
+class TestGetVpnServerRoute:
"""
- Test Class for get_load_balancer_pool
+ Test Class for get_vpn_server_route
"""
@responses.activate
- def test_get_load_balancer_pool_all_params(self):
+ def test_get_vpn_server_route_all_params(self):
"""
- get_load_balancer_pool()
+ get_vpn_server_route()
"""
# Set up mock
- 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"}}'
+ url = preprocess_url('/vpn_servers/testString/routes/testString')
+ mock_response = '{"action": "deliver", "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "health_reasons": [{"code": "internal_error", "message": "Internal error (contact IBM support).", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-route-health"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "r006-1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-vpn-route-1", "resource_type": "vpn_server_route"}'
responses.add(
responses.GET,
url,
@@ -39941,12 +40710,12 @@ def test_get_load_balancer_pool_all_params(self):
)
# Set up parameter values
- load_balancer_id = 'testString'
+ vpn_server_id = 'testString'
id = 'testString'
# Invoke method
- response = _service.get_load_balancer_pool(
- load_balancer_id,
+ response = _service.get_vpn_server_route(
+ vpn_server_id,
id,
headers={},
)
@@ -39955,23 +40724,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_vpn_server_route_all_params_with_retries(self):
+ # Enable retries and run test_get_vpn_server_route_all_params.
_service.enable_retries()
- self.test_get_load_balancer_pool_all_params()
+ self.test_get_vpn_server_route_all_params()
- # Disable retries and run test_get_load_balancer_pool_all_params.
+ # Disable retries and run test_get_vpn_server_route_all_params.
_service.disable_retries()
- self.test_get_load_balancer_pool_all_params()
+ self.test_get_vpn_server_route_all_params()
@responses.activate
- def test_get_load_balancer_pool_value_error(self):
+ def test_get_vpn_server_route_value_error(self):
"""
- test_get_load_balancer_pool_value_error()
+ test_get_vpn_server_route_value_error()
"""
# Set up mock
- 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"}}'
+ url = preprocess_url('/vpn_servers/testString/routes/testString')
+ mock_response = '{"action": "deliver", "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "health_reasons": [{"code": "internal_error", "message": "Internal error (contact IBM support).", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-route-health"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "r006-1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-vpn-route-1", "resource_type": "vpn_server_route"}'
responses.add(
responses.GET,
url,
@@ -39981,42 +40750,42 @@ def test_get_load_balancer_pool_value_error(self):
)
# Set up parameter values
- load_balancer_id = 'testString'
+ vpn_server_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_server_id": vpn_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_load_balancer_pool(**req_copy)
+ _service.get_vpn_server_route(**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_vpn_server_route_value_error_with_retries(self):
+ # Enable retries and run test_get_vpn_server_route_value_error.
_service.enable_retries()
- self.test_get_load_balancer_pool_value_error()
+ self.test_get_vpn_server_route_value_error()
- # Disable retries and run test_get_load_balancer_pool_value_error.
+ # Disable retries and run test_get_vpn_server_route_value_error.
_service.disable_retries()
- self.test_get_load_balancer_pool_value_error()
+ self.test_get_vpn_server_route_value_error()
-class TestUpdateLoadBalancerPool:
+class TestUpdateVpnServerRoute:
"""
- Test Class for update_load_balancer_pool
+ Test Class for update_vpn_server_route
"""
@responses.activate
- def test_update_load_balancer_pool_all_params(self):
+ def test_update_vpn_server_route_all_params(self):
"""
- update_load_balancer_pool()
+ update_vpn_server_route()
"""
# Set up mock
- 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"}}'
+ url = preprocess_url('/vpn_servers/testString/routes/testString')
+ mock_response = '{"action": "deliver", "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "health_reasons": [{"code": "internal_error", "message": "Internal error (contact IBM support).", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-route-health"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "r006-1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-vpn-route-1", "resource_type": "vpn_server_route"}'
responses.add(
responses.PATCH,
url,
@@ -40025,39 +40794,20 @@ def test_update_load_balancer_pool_all_params(self):
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 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
+ # Construct a dict representation of a VPNServerRoutePatch model
+ vpn_server_route_patch_model = {}
+ vpn_server_route_patch_model['name'] = 'my-vpn-route-2'
# Set up parameter values
- load_balancer_id = 'testString'
+ vpn_server_id = 'testString'
id = 'testString'
- load_balancer_pool_patch = load_balancer_pool_patch_model
+ vpn_server_route_patch = vpn_server_route_patch_model
# Invoke method
- response = _service.update_load_balancer_pool(
- load_balancer_id,
+ response = _service.update_vpn_server_route(
+ vpn_server_id,
id,
- load_balancer_pool_patch,
+ vpn_server_route_patch,
headers={},
)
@@ -40066,25 +40816,25 @@ 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 == vpn_server_route_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_vpn_server_route_all_params_with_retries(self):
+ # Enable retries and run test_update_vpn_server_route_all_params.
_service.enable_retries()
- self.test_update_load_balancer_pool_all_params()
+ self.test_update_vpn_server_route_all_params()
- # Disable retries and run test_update_load_balancer_pool_all_params.
+ # Disable retries and run test_update_vpn_server_route_all_params.
_service.disable_retries()
- self.test_update_load_balancer_pool_all_params()
+ self.test_update_vpn_server_route_all_params()
@responses.activate
- def test_update_load_balancer_pool_value_error(self):
+ def test_update_vpn_server_route_value_error(self):
"""
- test_update_load_balancer_pool_value_error()
+ test_update_vpn_server_route_value_error()
"""
# Set up mock
- 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"}}'
+ url = preprocess_url('/vpn_servers/testString/routes/testString')
+ mock_response = '{"action": "deliver", "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "health_reasons": [{"code": "internal_error", "message": "Internal error (contact IBM support).", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-route-health"}], "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "r006-1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-vpn-route-1", "resource_type": "vpn_server_route"}'
responses.add(
responses.PATCH,
url,
@@ -40093,68 +40843,106 @@ def test_update_load_balancer_pool_value_error(self):
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 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
+ # Construct a dict representation of a VPNServerRoutePatch model
+ vpn_server_route_patch_model = {}
+ vpn_server_route_patch_model['name'] = 'my-vpn-route-2'
# Set up parameter values
- load_balancer_id = 'testString'
+ vpn_server_id = 'testString'
id = 'testString'
- load_balancer_pool_patch = load_balancer_pool_patch_model
+ vpn_server_route_patch = vpn_server_route_patch_model
# Pass in all but one required param and check for a ValueError
req_param_dict = {
- "load_balancer_id": load_balancer_id,
+ "vpn_server_id": vpn_server_id,
"id": id,
- "load_balancer_pool_patch": load_balancer_pool_patch,
+ "vpn_server_route_patch": vpn_server_route_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_vpn_server_route(**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_vpn_server_route_value_error_with_retries(self):
+ # Enable retries and run test_update_vpn_server_route_value_error.
_service.enable_retries()
- self.test_update_load_balancer_pool_value_error()
+ self.test_update_vpn_server_route_value_error()
- # Disable retries and run test_update_load_balancer_pool_value_error.
+ # Disable retries and run test_update_vpn_server_route_value_error.
_service.disable_retries()
- self.test_update_load_balancer_pool_value_error()
+ self.test_update_vpn_server_route_value_error()
-class TestListLoadBalancerPoolMembers:
+# endregion
+##############################################################################
+# End of Service: VPNServers
+##############################################################################
+
+##############################################################################
+# Start of Service: LoadBalancers
+##############################################################################
+# region
+
+
+class TestNewInstance:
"""
- Test Class for list_load_balancer_pool_members
+ 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 TestListLoadBalancerProfiles:
+ """
+ Test Class for list_load_balancer_profiles
"""
@responses.activate
- def test_list_load_balancer_pool_members_all_params(self):
+ def test_list_load_balancer_profiles_all_params(self):
"""
- list_load_balancer_pool_members()
+ list_load_balancer_profiles()
"""
# 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}]}'
+ 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", "instance_groups_supported": {"type": "fixed", "value": true}, "logging_supported": {"type": "fixed", "value": ["datapath"]}, "name": "network-fixed", "route_mode_supported": {"type": "fixed", "value": true}, "security_groups_supported": {"type": "fixed", "value": true}, "udp_supported": {"type": "fixed", "value": true}}], "total_count": 132}'
responses.add(
responses.GET,
url,
@@ -40164,37 +40952,42 @@ def test_list_load_balancer_pool_members_all_params(self):
)
# Set up parameter values
- load_balancer_id = 'testString'
- pool_id = 'testString'
+ start = 'testString'
+ limit = 50
# Invoke method
- response = _service.list_load_balancer_pool_members(
- load_balancer_id,
- pool_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_pool_members_all_params_with_retries(self):
- # Enable retries and run test_list_load_balancer_pool_members_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_pool_members_all_params()
+ self.test_list_load_balancer_profiles_all_params()
- # Disable retries and run test_list_load_balancer_pool_members_all_params.
+ # Disable retries and run test_list_load_balancer_profiles_all_params.
_service.disable_retries()
- self.test_list_load_balancer_pool_members_all_params()
+ self.test_list_load_balancer_profiles_all_params()
@responses.activate
- def test_list_load_balancer_pool_members_value_error(self):
+ def test_list_load_balancer_profiles_required_params(self):
"""
- test_list_load_balancer_pool_members_value_error()
+ test_list_load_balancer_profiles_required_params()
"""
# 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}]}'
+ 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", "instance_groups_supported": {"type": "fixed", "value": true}, "logging_supported": {"type": "fixed", "value": ["datapath"]}, "name": "network-fixed", "route_mode_supported": {"type": "fixed", "value": true}, "security_groups_supported": {"type": "fixed", "value": true}, "udp_supported": {"type": "fixed", "value": true}}], "total_count": 132}'
responses.add(
responses.GET,
url,
@@ -40203,1258 +40996,1236 @@ def test_list_load_balancer_pool_members_value_error(self):
status=200,
)
- # Set up parameter values
- load_balancer_id = 'testString'
- pool_id = 'testString'
+ # Invoke method
+ response = _service.list_load_balancer_profiles()
+
+ # 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.
+ _service.enable_retries()
+ self.test_list_load_balancer_profiles_required_params()
+
+ # Disable retries and run test_list_load_balancer_profiles_required_params.
+ _service.disable_retries()
+ self.test_list_load_balancer_profiles_required_params()
+
+ @responses.activate
+ def test_list_load_balancer_profiles_value_error(self):
+ """
+ test_list_load_balancer_profiles_value_error()
+ """
+ # Set up mock
+ url = preprocess_url('/load_balancer/profiles')
+ mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "profiles": [{"family": "network", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed", "instance_groups_supported": {"type": "fixed", "value": true}, "logging_supported": {"type": "fixed", "value": ["datapath"]}, "name": "network-fixed", "route_mode_supported": {"type": "fixed", "value": true}, "security_groups_supported": {"type": "fixed", "value": true}, "udp_supported": {"type": "fixed", "value": true}}], "total_count": 132}'
+ responses.add(
+ responses.GET,
+ url,
+ body=mock_response,
+ content_type='application/json',
+ status=200,
+ )
# 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)
+ _service.list_load_balancer_profiles(**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_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_list_load_balancer_pool_members_value_error()
+ self.test_list_load_balancer_profiles_value_error()
- # Disable retries and run test_list_load_balancer_pool_members_value_error.
+ # Disable retries and run test_list_load_balancer_profiles_value_error.
_service.disable_retries()
- self.test_list_load_balancer_pool_members_value_error()
+ self.test_list_load_balancer_profiles_value_error()
+
+ @responses.activate
+ def test_list_load_balancer_profiles_with_pager_get_next(self):
+ """
+ test_list_load_balancer_profiles_with_pager_get_next()
+ """
+ # Set up a two-page mock response
+ url = preprocess_url('/load_balancer/profiles')
+ mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"profiles":[{"family":"network","href":"https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed","instance_groups_supported":{"type":"fixed","value":true},"logging_supported":{"type":"fixed","value":["datapath"]},"name":"network-fixed","route_mode_supported":{"type":"fixed","value":true},"security_groups_supported":{"type":"fixed","value":true},"udp_supported":{"type":"fixed","value":true}}]}'
+ mock_response2 = '{"total_count":2,"limit":1,"profiles":[{"family":"network","href":"https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed","instance_groups_supported":{"type":"fixed","value":true},"logging_supported":{"type":"fixed","value":["datapath"]},"name":"network-fixed","route_mode_supported":{"type":"fixed","value":true},"security_groups_supported":{"type":"fixed","value":true},"udp_supported":{"type":"fixed","value":true}}]}'
+ responses.add(
+ responses.GET,
+ url,
+ body=mock_response1,
+ content_type='application/json',
+ status=200,
+ )
+ responses.add(
+ responses.GET,
+ url,
+ body=mock_response2,
+ content_type='application/json',
+ status=200,
+ )
+ # Exercise the pager class for this operation
+ all_results = []
+ pager = LoadBalancerProfilesPager(
+ client=_service,
+ limit=10,
+ )
+ while pager.has_next():
+ next_page = pager.get_next()
+ assert next_page is not None
+ all_results.extend(next_page)
+ assert len(all_results) == 2
-class TestCreateLoadBalancerPoolMember:
+ @responses.activate
+ def test_list_load_balancer_profiles_with_pager_get_all(self):
+ """
+ test_list_load_balancer_profiles_with_pager_get_all()
+ """
+ # Set up a two-page mock response
+ url = preprocess_url('/load_balancer/profiles')
+ mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"profiles":[{"family":"network","href":"https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed","instance_groups_supported":{"type":"fixed","value":true},"logging_supported":{"type":"fixed","value":["datapath"]},"name":"network-fixed","route_mode_supported":{"type":"fixed","value":true},"security_groups_supported":{"type":"fixed","value":true},"udp_supported":{"type":"fixed","value":true}}]}'
+ mock_response2 = '{"total_count":2,"limit":1,"profiles":[{"family":"network","href":"https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed","instance_groups_supported":{"type":"fixed","value":true},"logging_supported":{"type":"fixed","value":["datapath"]},"name":"network-fixed","route_mode_supported":{"type":"fixed","value":true},"security_groups_supported":{"type":"fixed","value":true},"udp_supported":{"type":"fixed","value":true}}]}'
+ responses.add(
+ responses.GET,
+ url,
+ body=mock_response1,
+ content_type='application/json',
+ status=200,
+ )
+ responses.add(
+ responses.GET,
+ url,
+ body=mock_response2,
+ content_type='application/json',
+ status=200,
+ )
+
+ # Exercise the pager class for this operation
+ pager = LoadBalancerProfilesPager(
+ client=_service,
+ limit=10,
+ )
+ all_results = pager.get_all()
+ assert all_results is not None
+ assert len(all_results) == 2
+
+
+class TestGetLoadBalancerProfile:
"""
- Test Class for create_load_balancer_pool_member
+ Test Class for get_load_balancer_profile
"""
@responses.activate
- def test_create_load_balancer_pool_member_all_params(self):
+ def test_get_load_balancer_profile_all_params(self):
"""
- create_load_balancer_pool_member()
+ get_load_balancer_profile()
"""
# 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}'
+ 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", "instance_groups_supported": {"type": "fixed", "value": true}, "logging_supported": {"type": "fixed", "value": ["datapath"]}, "name": "network-fixed", "route_mode_supported": {"type": "fixed", "value": true}, "security_groups_supported": {"type": "fixed", "value": true}, "udp_supported": {"type": "fixed", "value": true}}'
responses.add(
- responses.POST,
+ responses.GET,
url,
body=mock_response,
content_type='application/json',
- status=201,
+ 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'
-
# Set up parameter values
- load_balancer_id = 'testString'
- pool_id = 'testString'
- port = 80
- target = load_balancer_pool_member_target_prototype_model
- weight = 50
+ name = 'testString'
# Invoke method
- response = _service.create_load_balancer_pool_member(
- load_balancer_id,
- pool_id,
- port,
- target,
- weight=weight,
+ response = _service.get_load_balancer_profile(
+ 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['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_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_create_load_balancer_pool_member_all_params()
+ self.test_get_load_balancer_profile_all_params()
- # Disable retries and run test_create_load_balancer_pool_member_all_params.
+ # Disable retries and run test_get_load_balancer_profile_all_params.
_service.disable_retries()
- self.test_create_load_balancer_pool_member_all_params()
+ self.test_get_load_balancer_profile_all_params()
@responses.activate
- def test_create_load_balancer_pool_member_value_error(self):
+ def test_get_load_balancer_profile_value_error(self):
"""
- test_create_load_balancer_pool_member_value_error()
+ test_get_load_balancer_profile_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}'
+ 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", "instance_groups_supported": {"type": "fixed", "value": true}, "logging_supported": {"type": "fixed", "value": ["datapath"]}, "name": "network-fixed", "route_mode_supported": {"type": "fixed", "value": true}, "security_groups_supported": {"type": "fixed", "value": true}, "udp_supported": {"type": "fixed", "value": true}}'
responses.add(
- responses.POST,
+ responses.GET,
url,
body=mock_response,
content_type='application/json',
- status=201,
+ 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'
-
# Set up parameter values
- load_balancer_id = 'testString'
- pool_id = 'testString'
- port = 80
- target = load_balancer_pool_member_target_prototype_model
- weight = 50
+ name = '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,
- "port": port,
- "target": target,
+ "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.create_load_balancer_pool_member(**req_copy)
+ _service.get_load_balancer_profile(**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_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_create_load_balancer_pool_member_value_error()
+ self.test_get_load_balancer_profile_value_error()
- # Disable retries and run test_create_load_balancer_pool_member_value_error.
+ # Disable retries and run test_get_load_balancer_profile_value_error.
_service.disable_retries()
- self.test_create_load_balancer_pool_member_value_error()
+ self.test_get_load_balancer_profile_value_error()
-class TestReplaceLoadBalancerPoolMembers:
+class TestListLoadBalancers:
"""
- Test Class for replace_load_balancer_pool_members
+ Test Class for list_load_balancers
"""
@responses.activate
- def test_replace_load_balancer_pool_members_all_params(self):
+ def test_list_load_balancers_all_params(self):
"""
- replace_load_balancer_pool_members()
+ list_load_balancers()
"""
# 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}]}'
+ 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", "dns": {"instance": {"crn": "crn:v1:bluemix:public:dns-svcs:global:a/123456:6860c359-b2e2-46fa-a944-b38c28201c6e"}, "zone": {"id": "d66662cc-aa23-4fe1-9987-858487a61f45"}}, "hostname": "6b88d615-us-south.lb.appdomain.cloud", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "instance_groups_supported": false, "is_public": true, "listeners": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "logging": {"datapath": {"active": true}}, "name": "my-load-balancer", "operating_status": "offline", "pools": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}], "private_ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "profile": {"family": "network", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed", "name": "network-fixed"}, "provisioning_status": "active", "public_ips": [{"address": "192.168.3.4"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "load_balancer", "route_mode": true, "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "security_groups_supported": false, "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "udp_supported": true}], "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers?start=9d5a91a3e2cbd233b5a5b33436855ed&limit=20"}, "total_count": 132}'
responses.add(
- responses.PUT,
+ responses.GET,
url,
body=mock_response,
content_type='application/json',
- status=202,
+ 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 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]
+ start = 'testString'
+ limit = 50
# Invoke method
- response = _service.replace_load_balancer_pool_members(
- load_balancer_id,
- pool_id,
- members,
+ response = _service.list_load_balancers(
+ start=start,
+ limit=limit,
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]
+ 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_replace_load_balancer_pool_members_all_params_with_retries(self):
- # Enable retries and run test_replace_load_balancer_pool_members_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_replace_load_balancer_pool_members_all_params()
+ self.test_list_load_balancers_all_params()
- # Disable retries and run test_replace_load_balancer_pool_members_all_params.
+ # Disable retries and run test_list_load_balancers_all_params.
_service.disable_retries()
- self.test_replace_load_balancer_pool_members_all_params()
+ self.test_list_load_balancers_all_params()
@responses.activate
- def test_replace_load_balancer_pool_members_value_error(self):
+ def test_list_load_balancers_required_params(self):
"""
- test_replace_load_balancer_pool_members_value_error()
+ test_list_load_balancers_required_params()
"""
# 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}]}'
+ 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", "dns": {"instance": {"crn": "crn:v1:bluemix:public:dns-svcs:global:a/123456:6860c359-b2e2-46fa-a944-b38c28201c6e"}, "zone": {"id": "d66662cc-aa23-4fe1-9987-858487a61f45"}}, "hostname": "6b88d615-us-south.lb.appdomain.cloud", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "instance_groups_supported": false, "is_public": true, "listeners": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "logging": {"datapath": {"active": true}}, "name": "my-load-balancer", "operating_status": "offline", "pools": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}], "private_ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "profile": {"family": "network", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed", "name": "network-fixed"}, "provisioning_status": "active", "public_ips": [{"address": "192.168.3.4"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "load_balancer", "route_mode": true, "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "security_groups_supported": false, "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "udp_supported": true}], "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers?start=9d5a91a3e2cbd233b5a5b33436855ed&limit=20"}, "total_count": 132}'
responses.add(
- responses.PUT,
+ responses.GET,
url,
body=mock_response,
content_type='application/json',
- status=202,
+ 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'
+ # Invoke method
+ response = _service.list_load_balancers()
- # 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
+ # Check for correct operation
+ assert len(responses.calls) == 1
+ assert response.status_code == 200
- # 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=202,
- )
-
- # 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 == 202
-
- def test_delete_load_balancer_pool_member_all_params_with_retries(self):
- # Enable retries and run test_delete_load_balancer_pool_member_all_params.
+ 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_delete_load_balancer_pool_member_all_params()
+ self.test_list_load_balancers_required_params()
- # Disable retries and run test_delete_load_balancer_pool_member_all_params.
+ # Disable retries and run test_list_load_balancers_required_params.
_service.disable_retries()
- self.test_delete_load_balancer_pool_member_all_params()
+ self.test_list_load_balancers_required_params()
@responses.activate
- def test_delete_load_balancer_pool_member_value_error(self):
+ def test_list_load_balancers_value_error(self):
"""
- test_delete_load_balancer_pool_member_value_error()
+ test_list_load_balancers_value_error()
"""
# Set up mock
- url = preprocess_url('/load_balancers/testString/pools/testString/members/testString')
+ 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", "dns": {"instance": {"crn": "crn:v1:bluemix:public:dns-svcs:global:a/123456:6860c359-b2e2-46fa-a944-b38c28201c6e"}, "zone": {"id": "d66662cc-aa23-4fe1-9987-858487a61f45"}}, "hostname": "6b88d615-us-south.lb.appdomain.cloud", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "instance_groups_supported": false, "is_public": true, "listeners": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "logging": {"datapath": {"active": true}}, "name": "my-load-balancer", "operating_status": "offline", "pools": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}], "private_ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "profile": {"family": "network", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed", "name": "network-fixed"}, "provisioning_status": "active", "public_ips": [{"address": "192.168.3.4"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "load_balancer", "route_mode": true, "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "security_groups_supported": false, "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "udp_supported": true}], "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers?start=9d5a91a3e2cbd233b5a5b33436855ed&limit=20"}, "total_count": 132}'
responses.add(
- responses.DELETE,
+ responses.GET,
url,
- status=202,
+ 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.delete_load_balancer_pool_member(**req_copy)
+ _service.list_load_balancers(**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_list_load_balancers_value_error_with_retries(self):
+ # Enable retries and run test_list_load_balancers_value_error.
_service.enable_retries()
- self.test_delete_load_balancer_pool_member_value_error()
+ self.test_list_load_balancers_value_error()
- # Disable retries and run test_delete_load_balancer_pool_member_value_error.
+ # Disable retries and run test_list_load_balancers_value_error.
_service.disable_retries()
- self.test_delete_load_balancer_pool_member_value_error()
-
-
-class TestGetLoadBalancerPoolMember:
- """
- Test Class for get_load_balancer_pool_member
- """
+ self.test_list_load_balancers_value_error()
@responses.activate
- def test_get_load_balancer_pool_member_all_params(self):
+ def test_list_load_balancers_with_pager_get_next(self):
"""
- get_load_balancer_pool_member()
+ test_list_load_balancers_with_pager_get_next()
"""
- # 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}'
+ # Set up a two-page mock response
+ url = preprocess_url('/load_balancers')
+ mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"load_balancers":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727","dns":{"instance":{"crn":"crn:v1:bluemix:public:dns-svcs:global:a/123456:6860c359-b2e2-46fa-a944-b38c28201c6e"},"zone":{"id":"d66662cc-aa23-4fe1-9987-858487a61f45"}},"hostname":"6b88d615-us-south.lb.appdomain.cloud","href":"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727","id":"dd754295-e9e0-4c9d-bf6c-58fbc59e5727","instance_groups_supported":false,"is_public":true,"listeners":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004","id":"70294e14-4e61-11e8-bcf4-0242ac110004"}],"logging":{"datapath":{"active":true}},"name":"my-load-balancer","operating_status":"offline","pools":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004","id":"70294e14-4e61-11e8-bcf4-0242ac110004","name":"my-load-balancer-pool"}],"private_ips":[{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"}],"profile":{"family":"network","href":"https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed","name":"network-fixed"},"provisioning_status":"active","public_ips":[{"address":"192.168.3.4"}],"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"load_balancer","route_mode":true,"security_groups":[{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271","id":"be5df5ca-12a0-494b-907e-aa6ec2bfa271","name":"my-security-group"}],"security_groups_supported":false,"subnets":[{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}],"udp_supported":true}]}'
+ mock_response2 = '{"total_count":2,"limit":1,"load_balancers":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727","dns":{"instance":{"crn":"crn:v1:bluemix:public:dns-svcs:global:a/123456:6860c359-b2e2-46fa-a944-b38c28201c6e"},"zone":{"id":"d66662cc-aa23-4fe1-9987-858487a61f45"}},"hostname":"6b88d615-us-south.lb.appdomain.cloud","href":"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727","id":"dd754295-e9e0-4c9d-bf6c-58fbc59e5727","instance_groups_supported":false,"is_public":true,"listeners":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004","id":"70294e14-4e61-11e8-bcf4-0242ac110004"}],"logging":{"datapath":{"active":true}},"name":"my-load-balancer","operating_status":"offline","pools":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004","id":"70294e14-4e61-11e8-bcf4-0242ac110004","name":"my-load-balancer-pool"}],"private_ips":[{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"}],"profile":{"family":"network","href":"https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed","name":"network-fixed"},"provisioning_status":"active","public_ips":[{"address":"192.168.3.4"}],"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"load_balancer","route_mode":true,"security_groups":[{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271","id":"be5df5ca-12a0-494b-907e-aa6ec2bfa271","name":"my-security-group"}],"security_groups_supported":false,"subnets":[{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}],"udp_supported":true}]}'
responses.add(
responses.GET,
url,
- body=mock_response,
+ body=mock_response1,
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={},
+ responses.add(
+ responses.GET,
+ url,
+ body=mock_response2,
+ content_type='application/json',
+ status=200,
)
- # 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()
+ # Exercise the pager class for this operation
+ all_results = []
+ pager = LoadBalancersPager(
+ client=_service,
+ limit=10,
+ )
+ while pager.has_next():
+ next_page = pager.get_next()
+ assert next_page is not None
+ all_results.extend(next_page)
+ assert len(all_results) == 2
@responses.activate
- def test_get_load_balancer_pool_member_value_error(self):
+ def test_list_load_balancers_with_pager_get_all(self):
"""
- test_get_load_balancer_pool_member_value_error()
+ test_list_load_balancers_with_pager_get_all()
"""
- # 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}'
+ # Set up a two-page mock response
+ url = preprocess_url('/load_balancers')
+ mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"load_balancers":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727","dns":{"instance":{"crn":"crn:v1:bluemix:public:dns-svcs:global:a/123456:6860c359-b2e2-46fa-a944-b38c28201c6e"},"zone":{"id":"d66662cc-aa23-4fe1-9987-858487a61f45"}},"hostname":"6b88d615-us-south.lb.appdomain.cloud","href":"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727","id":"dd754295-e9e0-4c9d-bf6c-58fbc59e5727","instance_groups_supported":false,"is_public":true,"listeners":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004","id":"70294e14-4e61-11e8-bcf4-0242ac110004"}],"logging":{"datapath":{"active":true}},"name":"my-load-balancer","operating_status":"offline","pools":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004","id":"70294e14-4e61-11e8-bcf4-0242ac110004","name":"my-load-balancer-pool"}],"private_ips":[{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"}],"profile":{"family":"network","href":"https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed","name":"network-fixed"},"provisioning_status":"active","public_ips":[{"address":"192.168.3.4"}],"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"load_balancer","route_mode":true,"security_groups":[{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271","id":"be5df5ca-12a0-494b-907e-aa6ec2bfa271","name":"my-security-group"}],"security_groups_supported":false,"subnets":[{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}],"udp_supported":true}]}'
+ mock_response2 = '{"total_count":2,"limit":1,"load_balancers":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727","dns":{"instance":{"crn":"crn:v1:bluemix:public:dns-svcs:global:a/123456:6860c359-b2e2-46fa-a944-b38c28201c6e"},"zone":{"id":"d66662cc-aa23-4fe1-9987-858487a61f45"}},"hostname":"6b88d615-us-south.lb.appdomain.cloud","href":"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727","id":"dd754295-e9e0-4c9d-bf6c-58fbc59e5727","instance_groups_supported":false,"is_public":true,"listeners":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004","id":"70294e14-4e61-11e8-bcf4-0242ac110004"}],"logging":{"datapath":{"active":true}},"name":"my-load-balancer","operating_status":"offline","pools":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004","id":"70294e14-4e61-11e8-bcf4-0242ac110004","name":"my-load-balancer-pool"}],"private_ips":[{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"}],"profile":{"family":"network","href":"https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed","name":"network-fixed"},"provisioning_status":"active","public_ips":[{"address":"192.168.3.4"}],"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"load_balancer","route_mode":true,"security_groups":[{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271","id":"be5df5ca-12a0-494b-907e-aa6ec2bfa271","name":"my-security-group"}],"security_groups_supported":false,"subnets":[{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}],"udp_supported":true}]}'
responses.add(
responses.GET,
url,
- body=mock_response,
+ body=mock_response1,
+ content_type='application/json',
+ status=200,
+ )
+ responses.add(
+ responses.GET,
+ url,
+ body=mock_response2,
content_type='application/json',
status=200,
)
- # Set up parameter values
- 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()
+ # Exercise the pager class for this operation
+ pager = LoadBalancersPager(
+ client=_service,
+ limit=10,
+ )
+ all_results = pager.get_all()
+ assert all_results is not None
+ assert len(all_results) == 2
-class TestUpdateLoadBalancerPoolMember:
+class TestCreateLoadBalancer:
"""
- Test Class for update_load_balancer_pool_member
+ Test Class for create_load_balancer
"""
@responses.activate
- def test_update_load_balancer_pool_member_all_params(self):
+ def test_create_load_balancer_all_params(self):
"""
- update_load_balancer_pool_member()
+ create_load_balancer()
"""
# 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}'
+ 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", "dns": {"instance": {"crn": "crn:v1:bluemix:public:dns-svcs:global:a/123456:6860c359-b2e2-46fa-a944-b38c28201c6e"}, "zone": {"id": "d66662cc-aa23-4fe1-9987-858487a61f45"}}, "hostname": "6b88d615-us-south.lb.appdomain.cloud", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "instance_groups_supported": false, "is_public": true, "listeners": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "logging": {"datapath": {"active": true}}, "name": "my-load-balancer", "operating_status": "offline", "pools": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}], "private_ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "profile": {"family": "network", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed", "name": "network-fixed"}, "provisioning_status": "active", "public_ips": [{"address": "192.168.3.4"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "load_balancer", "route_mode": true, "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "security_groups_supported": false, "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "udp_supported": true}'
responses.add(
- responses.PATCH,
+ responses.POST,
url,
body=mock_response,
content_type='application/json',
- status=200,
+ 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 DNSInstanceIdentityByCRN model
+ dns_instance_identity_model = {}
+ dns_instance_identity_model['crn'] = 'crn:v1:bluemix:public:dns-svcs:global:a/123456:6860c359-b2e2-46fa-a944-b38c28201c6e'
+
+ # Construct a dict representation of a DNSZoneIdentityById model
+ dns_zone_identity_model = {}
+ dns_zone_identity_model['id'] = 'd66662cc-aa23-4fe1-9987-858487a61f45'
+
+ # Construct a dict representation of a LoadBalancerDNSPrototype model
+ load_balancer_dns_prototype_model = {}
+ load_balancer_dns_prototype_model['instance'] = dns_instance_identity_model
+ load_balancer_dns_prototype_model['zone'] = dns_zone_identity_model
+
+ # Construct a dict representation of a CertificateInstanceIdentityByCRN model
+ certificate_instance_identity_model = {}
+ certificate_instance_identity_model['crn'] = 'crn:v1:bluemix:public:secrets-manager:us-south:a/123456:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5'
+
+ # Construct a dict representation of a LoadBalancerPoolIdentityByName model
+ load_balancer_pool_identity_by_name_model = {}
+ load_balancer_pool_identity_by_name_model['name'] = 'my-load-balancer-pool'
+
+ # Construct a dict representation of a LoadBalancerListenerIdentityById model
+ load_balancer_listener_identity_model = {}
+ load_balancer_listener_identity_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004'
+
+ # Construct a dict representation of a LoadBalancerListenerHTTPSRedirectPrototype model
+ load_balancer_listener_https_redirect_prototype_model = {}
+ load_balancer_listener_https_redirect_prototype_model['http_status_code'] = 301
+ load_balancer_listener_https_redirect_prototype_model['listener'] = load_balancer_listener_identity_model
+ load_balancer_listener_https_redirect_prototype_model['uri'] = '/example?doc=get'
+
+ # Construct a dict representation of a LoadBalancerListenerPrototypeLoadBalancerContext model
+ load_balancer_listener_prototype_load_balancer_context_model = {}
+ load_balancer_listener_prototype_load_balancer_context_model['accept_proxy_protocol'] = True
+ load_balancer_listener_prototype_load_balancer_context_model['certificate_instance'] = certificate_instance_identity_model
+ load_balancer_listener_prototype_load_balancer_context_model['connection_limit'] = 2000
+ load_balancer_listener_prototype_load_balancer_context_model['default_pool'] = load_balancer_pool_identity_by_name_model
+ load_balancer_listener_prototype_load_balancer_context_model['https_redirect'] = load_balancer_listener_https_redirect_prototype_model
+ load_balancer_listener_prototype_load_balancer_context_model['idle_connection_timeout'] = 100
+ 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 LoadBalancerLoggingDatapathPrototype model
+ load_balancer_logging_datapath_prototype_model = {}
+ load_balancer_logging_datapath_prototype_model['active'] = True
+
+ # Construct a dict representation of a LoadBalancerLoggingPrototype model
+ load_balancer_logging_prototype_model = {}
+ load_balancer_logging_prototype_model['datapath'] = load_balancer_logging_datapath_prototype_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 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 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'
# Set up parameter values
- load_balancer_id = 'testString'
- pool_id = 'testString'
- id = 'testString'
- load_balancer_pool_member_patch = load_balancer_pool_member_patch_model
+ is_public = True
+ subnets = [subnet_identity_model]
+ dns = load_balancer_dns_prototype_model
+ listeners = [load_balancer_listener_prototype_load_balancer_context_model]
+ logging = load_balancer_logging_prototype_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.update_load_balancer_pool_member(
- load_balancer_id,
- pool_id,
- id,
- load_balancer_pool_member_patch,
+ response = _service.create_load_balancer(
+ is_public,
+ subnets,
+ dns=dns,
+ listeners=listeners,
+ logging=logging,
+ name=name,
+ pools=pools,
+ profile=profile,
+ resource_group=resource_group,
+ route_mode=route_mode,
+ security_groups=security_groups,
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_pool_member_patch
+ assert req_body['is_public'] == True
+ assert req_body['subnets'] == [subnet_identity_model]
+ assert req_body['dns'] == load_balancer_dns_prototype_model
+ assert req_body['listeners'] == [load_balancer_listener_prototype_load_balancer_context_model]
+ assert req_body['logging'] == load_balancer_logging_prototype_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_update_load_balancer_pool_member_all_params_with_retries(self):
- # Enable retries and run test_update_load_balancer_pool_member_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_update_load_balancer_pool_member_all_params()
+ self.test_create_load_balancer_all_params()
- # Disable retries and run test_update_load_balancer_pool_member_all_params.
+ # Disable retries and run test_create_load_balancer_all_params.
_service.disable_retries()
- self.test_update_load_balancer_pool_member_all_params()
+ self.test_create_load_balancer_all_params()
@responses.activate
- def test_update_load_balancer_pool_member_value_error(self):
+ def test_create_load_balancer_value_error(self):
"""
- test_update_load_balancer_pool_member_value_error()
+ test_create_load_balancer_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}'
+ 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", "dns": {"instance": {"crn": "crn:v1:bluemix:public:dns-svcs:global:a/123456:6860c359-b2e2-46fa-a944-b38c28201c6e"}, "zone": {"id": "d66662cc-aa23-4fe1-9987-858487a61f45"}}, "hostname": "6b88d615-us-south.lb.appdomain.cloud", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "instance_groups_supported": false, "is_public": true, "listeners": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "logging": {"datapath": {"active": true}}, "name": "my-load-balancer", "operating_status": "offline", "pools": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}], "private_ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "profile": {"family": "network", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed", "name": "network-fixed"}, "provisioning_status": "active", "public_ips": [{"address": "192.168.3.4"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "load_balancer", "route_mode": true, "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "security_groups_supported": false, "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "udp_supported": true}'
responses.add(
- responses.PATCH,
+ responses.POST,
url,
body=mock_response,
content_type='application/json',
- status=200,
+ 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 SubnetIdentityById model
+ subnet_identity_model = {}
+ subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
- # 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 DNSInstanceIdentityByCRN model
+ dns_instance_identity_model = {}
+ dns_instance_identity_model['crn'] = 'crn:v1:bluemix:public:dns-svcs:global:a/123456:6860c359-b2e2-46fa-a944-b38c28201c6e'
- # Set up parameter values
- load_balancer_id = 'testString'
- pool_id = 'testString'
- id = 'testString'
- load_balancer_pool_member_patch = load_balancer_pool_member_patch_model
+ # Construct a dict representation of a DNSZoneIdentityById model
+ dns_zone_identity_model = {}
+ dns_zone_identity_model['id'] = 'd66662cc-aa23-4fe1-9987-858487a61f45'
- # 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)
+ # Construct a dict representation of a LoadBalancerDNSPrototype model
+ load_balancer_dns_prototype_model = {}
+ load_balancer_dns_prototype_model['instance'] = dns_instance_identity_model
+ load_balancer_dns_prototype_model['zone'] = dns_zone_identity_model
- 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()
+ # Construct a dict representation of a CertificateInstanceIdentityByCRN model
+ certificate_instance_identity_model = {}
+ certificate_instance_identity_model['crn'] = 'crn:v1:bluemix:public:secrets-manager:us-south:a/123456:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5'
- # Disable retries and run test_update_load_balancer_pool_member_value_error.
- _service.disable_retries()
- self.test_update_load_balancer_pool_member_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'
+ # Construct a dict representation of a LoadBalancerListenerIdentityById model
+ load_balancer_listener_identity_model = {}
+ load_balancer_listener_identity_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004'
-# endregion
-##############################################################################
-# End of Service: LoadBalancers
-##############################################################################
+ # 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'
-##############################################################################
-# Start of Service: EndpointGateways
-##############################################################################
-# region
+ # Construct a dict representation of a LoadBalancerListenerPrototypeLoadBalancerContext model
+ load_balancer_listener_prototype_load_balancer_context_model = {}
+ load_balancer_listener_prototype_load_balancer_context_model['accept_proxy_protocol'] = True
+ load_balancer_listener_prototype_load_balancer_context_model['certificate_instance'] = certificate_instance_identity_model
+ load_balancer_listener_prototype_load_balancer_context_model['connection_limit'] = 2000
+ load_balancer_listener_prototype_load_balancer_context_model['default_pool'] = load_balancer_pool_identity_by_name_model
+ load_balancer_listener_prototype_load_balancer_context_model['https_redirect'] = load_balancer_listener_https_redirect_prototype_model
+ load_balancer_listener_prototype_load_balancer_context_model['idle_connection_timeout'] = 100
+ 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 LoadBalancerLoggingDatapathPrototype model
+ load_balancer_logging_datapath_prototype_model = {}
+ load_balancer_logging_datapath_prototype_model['active'] = True
-class TestNewInstance:
- """
- Test Class for new_instance
- """
+ # Construct a dict representation of a LoadBalancerLoggingPrototype model
+ load_balancer_logging_prototype_model = {}
+ load_balancer_logging_prototype_model['datapath'] = load_balancer_logging_datapath_prototype_model
- def test_new_instance(self):
- """
- new_instance()
- """
- os.environ['TEST_SERVICE_AUTH_TYPE'] = 'noAuth'
+ # 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'] = '/'
- service = VpcV1.new_instance(
- version=version,
- service_name='TEST_SERVICE',
- )
+ # 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'
- assert service is not None
- assert isinstance(service, VpcV1)
+ # 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
- 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',
- )
+ # 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'
- 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()
+ # 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
- 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,
- )
+ # 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'
-class TestListEndpointGateways:
+ # 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
+ is_public = True
+ subnets = [subnet_identity_model]
+ dns = load_balancer_dns_prototype_model
+ listeners = [load_balancer_listener_prototype_load_balancer_context_model]
+ logging = load_balancer_logging_prototype_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 = {
+ "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(**req_copy)
+
+ def test_create_load_balancer_value_error_with_retries(self):
+ # Enable retries and run test_create_load_balancer_value_error.
+ _service.enable_retries()
+ self.test_create_load_balancer_value_error()
+
+ # Disable retries and run test_create_load_balancer_value_error.
+ _service.disable_retries()
+ self.test_create_load_balancer_value_error()
+
+
+class TestDeleteLoadBalancer:
"""
- Test Class for list_endpoint_gateways
+ Test Class for delete_load_balancer
"""
@responses.activate
- def test_list_endpoint_gateways_all_params(self):
+ def test_delete_load_balancer_all_params(self):
"""
- list_endpoint_gateways()
+ delete_load_balancer()
"""
# Set up mock
- url = preprocess_url('/endpoint_gateways')
- mock_response = '{"endpoint_gateways": [{"allow_dns_resolution_binding": true, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "lifecycle_state": "stable", "name": "my-endpoint-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "endpoint_gateway", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "service_endpoint": "my-cloudant-instance.appdomain.cloud", "service_endpoints": ["my-cloudant-instance.appdomain.cloud"], "target": {"crn": "crn:v1:bluemix:public:cloudant:us-south:a/123456:3527280b-9327-4411-8020-591092e60353::", "resource_type": "provider_cloud_service"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}], "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')
responses.add(
- responses.GET,
+ responses.DELETE,
url,
- body=mock_response,
- content_type='application/json',
- status=200,
+ status=202,
)
# Set up parameter values
- name = 'testString'
- start = 'testString'
- limit = 50
- resource_group_id = 'testString'
- vpc_id = 'testString'
- vpc_crn = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b'
- vpc_name = 'my-vpc'
- allow_dns_resolution_binding = True
+ id = 'testString'
+ if_match = 'W/"96d225c4-56bd-43d9-98fc-d7148e5c5028"'
# Invoke method
- response = _service.list_endpoint_gateways(
- name=name,
- start=start,
- limit=limit,
- resource_group_id=resource_group_id,
- vpc_id=vpc_id,
- vpc_crn=vpc_crn,
- vpc_name=vpc_name,
- allow_dns_resolution_binding=allow_dns_resolution_binding,
+ response = _service.delete_load_balancer(
+ id,
+ if_match=if_match,
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
- 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 'allow_dns_resolution_binding={}'.format('true' if allow_dns_resolution_binding else 'false') in query_string
+ assert response.status_code == 202
- def test_list_endpoint_gateways_all_params_with_retries(self):
- # Enable retries and run test_list_endpoint_gateways_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_list_endpoint_gateways_all_params()
+ self.test_delete_load_balancer_all_params()
- # Disable retries and run test_list_endpoint_gateways_all_params.
+ # Disable retries and run test_delete_load_balancer_all_params.
_service.disable_retries()
- self.test_list_endpoint_gateways_all_params()
+ self.test_delete_load_balancer_all_params()
@responses.activate
- def test_list_endpoint_gateways_required_params(self):
+ def test_delete_load_balancer_required_params(self):
"""
- test_list_endpoint_gateways_required_params()
+ test_delete_load_balancer_required_params()
"""
# Set up mock
- url = preprocess_url('/endpoint_gateways')
- mock_response = '{"endpoint_gateways": [{"allow_dns_resolution_binding": true, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "lifecycle_state": "stable", "name": "my-endpoint-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "endpoint_gateway", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "service_endpoint": "my-cloudant-instance.appdomain.cloud", "service_endpoints": ["my-cloudant-instance.appdomain.cloud"], "target": {"crn": "crn:v1:bluemix:public:cloudant:us-south:a/123456:3527280b-9327-4411-8020-591092e60353::", "resource_type": "provider_cloud_service"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}], "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')
responses.add(
- responses.GET,
+ responses.DELETE,
url,
- body=mock_response,
- content_type='application/json',
- status=200,
+ status=202,
)
+ # Set up parameter values
+ id = 'testString'
+
# Invoke method
- response = _service.list_endpoint_gateways()
+ response = _service.delete_load_balancer(
+ id,
+ headers={},
+ )
# Check for correct operation
assert len(responses.calls) == 1
- assert response.status_code == 200
+ assert response.status_code == 202
- def test_list_endpoint_gateways_required_params_with_retries(self):
- # Enable retries and run test_list_endpoint_gateways_required_params.
+ def test_delete_load_balancer_required_params_with_retries(self):
+ # Enable retries and run test_delete_load_balancer_required_params.
_service.enable_retries()
- self.test_list_endpoint_gateways_required_params()
+ self.test_delete_load_balancer_required_params()
- # Disable retries and run test_list_endpoint_gateways_required_params.
+ # Disable retries and run test_delete_load_balancer_required_params.
_service.disable_retries()
- self.test_list_endpoint_gateways_required_params()
+ self.test_delete_load_balancer_required_params()
@responses.activate
- def test_list_endpoint_gateways_value_error(self):
+ def test_delete_load_balancer_value_error(self):
"""
- test_list_endpoint_gateways_value_error()
+ test_delete_load_balancer_value_error()
"""
# Set up mock
- url = preprocess_url('/endpoint_gateways')
- mock_response = '{"endpoint_gateways": [{"allow_dns_resolution_binding": true, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "lifecycle_state": "stable", "name": "my-endpoint-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "endpoint_gateway", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "service_endpoint": "my-cloudant-instance.appdomain.cloud", "service_endpoints": ["my-cloudant-instance.appdomain.cloud"], "target": {"crn": "crn:v1:bluemix:public:cloudant:us-south:a/123456:3527280b-9327-4411-8020-591092e60353::", "resource_type": "provider_cloud_service"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}], "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')
responses.add(
- responses.GET,
+ responses.DELETE,
url,
- body=mock_response,
- content_type='application/json',
- status=200,
+ status=202,
)
+ # Set up parameter values
+ id = 'testString'
+
# Pass in all but one required param and check for a ValueError
req_param_dict = {
+ "id": id,
}
for param in req_param_dict.keys():
req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()}
with pytest.raises(ValueError):
- _service.list_endpoint_gateways(**req_copy)
+ _service.delete_load_balancer(**req_copy)
- def test_list_endpoint_gateways_value_error_with_retries(self):
- # Enable retries and run test_list_endpoint_gateways_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_list_endpoint_gateways_value_error()
+ self.test_delete_load_balancer_value_error()
- # Disable retries and run test_list_endpoint_gateways_value_error.
+ # Disable retries and run test_delete_load_balancer_value_error.
_service.disable_retries()
- self.test_list_endpoint_gateways_value_error()
-
- @responses.activate
- def test_list_endpoint_gateways_with_pager_get_next(self):
- """
- test_list_endpoint_gateways_with_pager_get_next()
- """
- # Set up a two-page mock response
- url = preprocess_url('/endpoint_gateways')
- mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"endpoint_gateways":[{"allow_dns_resolution_binding":true,"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5","health_state":"ok","href":"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5","id":"r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5","ips":[{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"}],"lifecycle_state":"stable","name":"my-endpoint-gateway","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"endpoint_gateway","security_groups":[{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271","id":"be5df5ca-12a0-494b-907e-aa6ec2bfa271","name":"my-security-group"}],"service_endpoint":"my-cloudant-instance.appdomain.cloud","service_endpoints":["my-cloudant-instance.appdomain.cloud"],"target":{"crn":"crn:v1:bluemix:public:cloudant:us-south:a/123456:3527280b-9327-4411-8020-591092e60353::","resource_type":"provider_cloud_service"},"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"}}],"total_count":2,"limit":1}'
- mock_response2 = '{"endpoint_gateways":[{"allow_dns_resolution_binding":true,"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5","health_state":"ok","href":"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5","id":"r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5","ips":[{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"}],"lifecycle_state":"stable","name":"my-endpoint-gateway","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"endpoint_gateway","security_groups":[{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271","id":"be5df5ca-12a0-494b-907e-aa6ec2bfa271","name":"my-security-group"}],"service_endpoint":"my-cloudant-instance.appdomain.cloud","service_endpoints":["my-cloudant-instance.appdomain.cloud"],"target":{"crn":"crn:v1:bluemix:public:cloudant:us-south:a/123456:3527280b-9327-4411-8020-591092e60353::","resource_type":"provider_cloud_service"},"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"}}],"total_count":2,"limit":1}'
- responses.add(
- responses.GET,
- url,
- body=mock_response1,
- content_type='application/json',
- status=200,
- )
- responses.add(
- responses.GET,
- url,
- body=mock_response2,
- content_type='application/json',
- status=200,
- )
-
- # Exercise the pager class for this operation
- all_results = []
- pager = EndpointGatewaysPager(
- client=_service,
- name='testString',
- limit=10,
- resource_group_id='testString',
- vpc_id='testString',
- vpc_crn='crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b',
- vpc_name='my-vpc',
- allow_dns_resolution_binding=True,
- )
- while pager.has_next():
- next_page = pager.get_next()
- assert next_page is not None
- all_results.extend(next_page)
- assert len(all_results) == 2
-
- @responses.activate
- def test_list_endpoint_gateways_with_pager_get_all(self):
- """
- test_list_endpoint_gateways_with_pager_get_all()
- """
- # Set up a two-page mock response
- url = preprocess_url('/endpoint_gateways')
- mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"endpoint_gateways":[{"allow_dns_resolution_binding":true,"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5","health_state":"ok","href":"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5","id":"r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5","ips":[{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"}],"lifecycle_state":"stable","name":"my-endpoint-gateway","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"endpoint_gateway","security_groups":[{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271","id":"be5df5ca-12a0-494b-907e-aa6ec2bfa271","name":"my-security-group"}],"service_endpoint":"my-cloudant-instance.appdomain.cloud","service_endpoints":["my-cloudant-instance.appdomain.cloud"],"target":{"crn":"crn:v1:bluemix:public:cloudant:us-south:a/123456:3527280b-9327-4411-8020-591092e60353::","resource_type":"provider_cloud_service"},"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"}}],"total_count":2,"limit":1}'
- mock_response2 = '{"endpoint_gateways":[{"allow_dns_resolution_binding":true,"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5","health_state":"ok","href":"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5","id":"r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5","ips":[{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"}],"lifecycle_state":"stable","name":"my-endpoint-gateway","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"endpoint_gateway","security_groups":[{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271","id":"be5df5ca-12a0-494b-907e-aa6ec2bfa271","name":"my-security-group"}],"service_endpoint":"my-cloudant-instance.appdomain.cloud","service_endpoints":["my-cloudant-instance.appdomain.cloud"],"target":{"crn":"crn:v1:bluemix:public:cloudant:us-south:a/123456:3527280b-9327-4411-8020-591092e60353::","resource_type":"provider_cloud_service"},"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"}}],"total_count":2,"limit":1}'
- responses.add(
- responses.GET,
- url,
- body=mock_response1,
- content_type='application/json',
- status=200,
- )
- responses.add(
- responses.GET,
- url,
- body=mock_response2,
- content_type='application/json',
- status=200,
- )
-
- # Exercise the pager class for this operation
- pager = EndpointGatewaysPager(
- client=_service,
- name='testString',
- limit=10,
- resource_group_id='testString',
- vpc_id='testString',
- vpc_crn='crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b',
- vpc_name='my-vpc',
- allow_dns_resolution_binding=True,
- )
- all_results = pager.get_all()
- assert all_results is not None
- assert len(all_results) == 2
+ self.test_delete_load_balancer_value_error()
-class TestCreateEndpointGateway:
+class TestGetLoadBalancer:
"""
- Test Class for create_endpoint_gateway
+ Test Class for get_load_balancer
"""
@responses.activate
- def test_create_endpoint_gateway_all_params(self):
+ def test_get_load_balancer_all_params(self):
"""
- create_endpoint_gateway()
+ get_load_balancer()
"""
# Set up mock
- url = preprocess_url('/endpoint_gateways')
- mock_response = '{"allow_dns_resolution_binding": true, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "lifecycle_state": "stable", "name": "my-endpoint-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "endpoint_gateway", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "service_endpoint": "my-cloudant-instance.appdomain.cloud", "service_endpoints": ["my-cloudant-instance.appdomain.cloud"], "target": {"crn": "crn:v1:bluemix:public:cloudant:us-south:a/123456:3527280b-9327-4411-8020-591092e60353::", "resource_type": "provider_cloud_service"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}'
+ 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", "dns": {"instance": {"crn": "crn:v1:bluemix:public:dns-svcs:global:a/123456:6860c359-b2e2-46fa-a944-b38c28201c6e"}, "zone": {"id": "d66662cc-aa23-4fe1-9987-858487a61f45"}}, "hostname": "6b88d615-us-south.lb.appdomain.cloud", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "instance_groups_supported": false, "is_public": true, "listeners": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "logging": {"datapath": {"active": true}}, "name": "my-load-balancer", "operating_status": "offline", "pools": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}], "private_ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "profile": {"family": "network", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed", "name": "network-fixed"}, "provisioning_status": "active", "public_ips": [{"address": "192.168.3.4"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "load_balancer", "route_mode": true, "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "security_groups_supported": false, "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "udp_supported": true}'
responses.add(
- responses.POST,
+ responses.GET,
url,
body=mock_response,
content_type='application/json',
- status=201,
+ status=200,
)
- # 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 EndpointGatewayReservedIPReservedIPIdentityById 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
- allow_dns_resolution_binding = True
- ips = [endpoint_gateway_reserved_ip_model]
- name = 'testString'
- resource_group = resource_group_identity_model
- security_groups = [security_group_identity_model]
+ id = 'testString'
# Invoke method
- response = _service.create_endpoint_gateway(
- target,
- vpc,
- allow_dns_resolution_binding=allow_dns_resolution_binding,
- ips=ips,
- name=name,
- resource_group=resource_group,
- security_groups=security_groups,
+ response = _service.get_load_balancer(
+ 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['target'] == endpoint_gateway_target_prototype_model
- assert req_body['vpc'] == vpc_identity_model
- assert req_body['allow_dns_resolution_binding'] == True
- 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]
+ assert response.status_code == 200
- def test_create_endpoint_gateway_all_params_with_retries(self):
- # Enable retries and run test_create_endpoint_gateway_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_create_endpoint_gateway_all_params()
+ self.test_get_load_balancer_all_params()
- # Disable retries and run test_create_endpoint_gateway_all_params.
+ # Disable retries and run test_get_load_balancer_all_params.
_service.disable_retries()
- self.test_create_endpoint_gateway_all_params()
+ self.test_get_load_balancer_all_params()
@responses.activate
- def test_create_endpoint_gateway_value_error(self):
+ def test_get_load_balancer_value_error(self):
"""
- test_create_endpoint_gateway_value_error()
+ test_get_load_balancer_value_error()
"""
# Set up mock
- url = preprocess_url('/endpoint_gateways')
- mock_response = '{"allow_dns_resolution_binding": true, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "lifecycle_state": "stable", "name": "my-endpoint-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "endpoint_gateway", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "service_endpoint": "my-cloudant-instance.appdomain.cloud", "service_endpoints": ["my-cloudant-instance.appdomain.cloud"], "target": {"crn": "crn:v1:bluemix:public:cloudant:us-south:a/123456:3527280b-9327-4411-8020-591092e60353::", "resource_type": "provider_cloud_service"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}'
+ 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", "dns": {"instance": {"crn": "crn:v1:bluemix:public:dns-svcs:global:a/123456:6860c359-b2e2-46fa-a944-b38c28201c6e"}, "zone": {"id": "d66662cc-aa23-4fe1-9987-858487a61f45"}}, "hostname": "6b88d615-us-south.lb.appdomain.cloud", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "instance_groups_supported": false, "is_public": true, "listeners": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "logging": {"datapath": {"active": true}}, "name": "my-load-balancer", "operating_status": "offline", "pools": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}], "private_ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "profile": {"family": "network", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed", "name": "network-fixed"}, "provisioning_status": "active", "public_ips": [{"address": "192.168.3.4"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "load_balancer", "route_mode": true, "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "security_groups_supported": false, "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "udp_supported": true}'
responses.add(
- responses.POST,
+ responses.GET,
url,
body=mock_response,
content_type='application/json',
- status=201,
+ status=200,
)
- # 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 EndpointGatewayReservedIPReservedIPIdentityById 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
- allow_dns_resolution_binding = True
- ips = [endpoint_gateway_reserved_ip_model]
- name = 'testString'
- resource_group = resource_group_identity_model
- security_groups = [security_group_identity_model]
+ id = 'testString'
# Pass in all but one required param and check for a ValueError
req_param_dict = {
- "target": target,
- "vpc": vpc,
+ "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_endpoint_gateway(**req_copy)
+ _service.get_load_balancer(**req_copy)
- def test_create_endpoint_gateway_value_error_with_retries(self):
- # Enable retries and run test_create_endpoint_gateway_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_create_endpoint_gateway_value_error()
+ self.test_get_load_balancer_value_error()
- # Disable retries and run test_create_endpoint_gateway_value_error.
+ # Disable retries and run test_get_load_balancer_value_error.
_service.disable_retries()
- self.test_create_endpoint_gateway_value_error()
+ self.test_get_load_balancer_value_error()
-class TestListEndpointGatewayIps:
+class TestUpdateLoadBalancer:
"""
- Test Class for list_endpoint_gateway_ips
+ Test Class for update_load_balancer
"""
@responses.activate
- def test_list_endpoint_gateway_ips_all_params(self):
+ def test_update_load_balancer_all_params(self):
"""
- list_endpoint_gateway_ips()
+ update_load_balancer()
"""
# 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", "lifecycle_state": "stable", "name": "my-reserved-ip", "owner": "user", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "name": "my-endpoint-gateway", "resource_type": "endpoint_gateway"}}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5/ips?start=90ac13871b604023ab8b827178518328&limit=20"}, "total_count": 132}'
+ 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", "dns": {"instance": {"crn": "crn:v1:bluemix:public:dns-svcs:global:a/123456:6860c359-b2e2-46fa-a944-b38c28201c6e"}, "zone": {"id": "d66662cc-aa23-4fe1-9987-858487a61f45"}}, "hostname": "6b88d615-us-south.lb.appdomain.cloud", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "instance_groups_supported": false, "is_public": true, "listeners": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "logging": {"datapath": {"active": true}}, "name": "my-load-balancer", "operating_status": "offline", "pools": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}], "private_ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "profile": {"family": "network", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed", "name": "network-fixed"}, "provisioning_status": "active", "public_ips": [{"address": "192.168.3.4"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "load_balancer", "route_mode": true, "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "security_groups_supported": false, "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "udp_supported": true}'
responses.add(
- responses.GET,
+ responses.PATCH,
url,
body=mock_response,
content_type='application/json',
status=200,
)
+ # Construct a dict representation of a DNSInstanceIdentityByCRN model
+ dns_instance_identity_model = {}
+ dns_instance_identity_model['crn'] = 'crn:v1:bluemix:public:dns-svcs:global:a/123456:6860c359-b2e2-46fa-a944-b38c28201c6e'
+
+ # Construct a dict representation of a DNSZoneIdentityById model
+ dns_zone_identity_model = {}
+ dns_zone_identity_model['id'] = 'd66662cc-aa23-4fe1-9987-858487a61f45'
+
+ # Construct a dict representation of a LoadBalancerDNSPatch model
+ load_balancer_dns_patch_model = {}
+ load_balancer_dns_patch_model['instance'] = dns_instance_identity_model
+ load_balancer_dns_patch_model['zone'] = dns_zone_identity_model
+
+ # Construct a dict representation of a LoadBalancerLoggingDatapathPatch model
+ load_balancer_logging_datapath_patch_model = {}
+ load_balancer_logging_datapath_patch_model['active'] = True
+
+ # Construct a dict representation of a LoadBalancerLoggingPatch model
+ load_balancer_logging_patch_model = {}
+ load_balancer_logging_patch_model['datapath'] = load_balancer_logging_datapath_patch_model
+
+ # Construct a dict representation of a SubnetIdentityById model
+ subnet_identity_model = {}
+ subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
+
+ # Construct a dict representation of a LoadBalancerPatch model
+ load_balancer_patch_model = {}
+ load_balancer_patch_model['dns'] = load_balancer_dns_patch_model
+ load_balancer_patch_model['logging'] = load_balancer_logging_patch_model
+ load_balancer_patch_model['name'] = 'my-load-balancer'
+ load_balancer_patch_model['subnets'] = [subnet_identity_model]
+
# Set up parameter values
- endpoint_gateway_id = 'testString'
- start = 'testString'
- limit = 50
- sort = 'name'
+ id = 'testString'
+ load_balancer_patch = load_balancer_patch_model
+ if_match = 'W/"96d225c4-56bd-43d9-98fc-d7148e5c5028"'
# Invoke method
- response = _service.list_endpoint_gateway_ips(
- endpoint_gateway_id,
- start=start,
- limit=limit,
- sort=sort,
+ response = _service.update_load_balancer(
+ id,
+ load_balancer_patch,
+ if_match=if_match,
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
+ # Validate body params
+ req_body = json.loads(str(responses.calls[0].request.body, 'utf-8'))
+ assert req_body == load_balancer_patch
- def test_list_endpoint_gateway_ips_all_params_with_retries(self):
- # Enable retries and run test_list_endpoint_gateway_ips_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_list_endpoint_gateway_ips_all_params()
+ self.test_update_load_balancer_all_params()
- # Disable retries and run test_list_endpoint_gateway_ips_all_params.
+ # Disable retries and run test_update_load_balancer_all_params.
_service.disable_retries()
- self.test_list_endpoint_gateway_ips_all_params()
+ self.test_update_load_balancer_all_params()
@responses.activate
- def test_list_endpoint_gateway_ips_required_params(self):
+ def test_update_load_balancer_required_params(self):
"""
- test_list_endpoint_gateway_ips_required_params()
+ test_update_load_balancer_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", "lifecycle_state": "stable", "name": "my-reserved-ip", "owner": "user", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "name": "my-endpoint-gateway", "resource_type": "endpoint_gateway"}}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5/ips?start=90ac13871b604023ab8b827178518328&limit=20"}, "total_count": 132}'
+ 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", "dns": {"instance": {"crn": "crn:v1:bluemix:public:dns-svcs:global:a/123456:6860c359-b2e2-46fa-a944-b38c28201c6e"}, "zone": {"id": "d66662cc-aa23-4fe1-9987-858487a61f45"}}, "hostname": "6b88d615-us-south.lb.appdomain.cloud", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "instance_groups_supported": false, "is_public": true, "listeners": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "logging": {"datapath": {"active": true}}, "name": "my-load-balancer", "operating_status": "offline", "pools": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}], "private_ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "profile": {"family": "network", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed", "name": "network-fixed"}, "provisioning_status": "active", "public_ips": [{"address": "192.168.3.4"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "load_balancer", "route_mode": true, "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "security_groups_supported": false, "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "udp_supported": true}'
responses.add(
- responses.GET,
+ responses.PATCH,
url,
body=mock_response,
content_type='application/json',
status=200,
)
- # Set up parameter values
- endpoint_gateway_id = 'testString'
+ # Construct a dict representation of a DNSInstanceIdentityByCRN model
+ dns_instance_identity_model = {}
+ dns_instance_identity_model['crn'] = 'crn:v1:bluemix:public:dns-svcs:global:a/123456:6860c359-b2e2-46fa-a944-b38c28201c6e'
- # Invoke method
- response = _service.list_endpoint_gateway_ips(
- endpoint_gateway_id,
- headers={},
+ # Construct a dict representation of a DNSZoneIdentityById model
+ dns_zone_identity_model = {}
+ dns_zone_identity_model['id'] = 'd66662cc-aa23-4fe1-9987-858487a61f45'
+
+ # Construct a dict representation of a LoadBalancerDNSPatch model
+ load_balancer_dns_patch_model = {}
+ load_balancer_dns_patch_model['instance'] = dns_instance_identity_model
+ load_balancer_dns_patch_model['zone'] = dns_zone_identity_model
+
+ # Construct a dict representation of a LoadBalancerLoggingDatapathPatch model
+ load_balancer_logging_datapath_patch_model = {}
+ load_balancer_logging_datapath_patch_model['active'] = True
+
+ # Construct a dict representation of a LoadBalancerLoggingPatch model
+ load_balancer_logging_patch_model = {}
+ load_balancer_logging_patch_model['datapath'] = load_balancer_logging_datapath_patch_model
+
+ # Construct a dict representation of a SubnetIdentityById model
+ subnet_identity_model = {}
+ subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
+
+ # Construct a dict representation of a LoadBalancerPatch model
+ load_balancer_patch_model = {}
+ load_balancer_patch_model['dns'] = load_balancer_dns_patch_model
+ load_balancer_patch_model['logging'] = load_balancer_logging_patch_model
+ load_balancer_patch_model['name'] = 'my-load-balancer'
+ load_balancer_patch_model['subnets'] = [subnet_identity_model]
+
+ # Set up parameter values
+ id = 'testString'
+ load_balancer_patch = load_balancer_patch_model
+
+ # Invoke method
+ response = _service.update_load_balancer(
+ id,
+ load_balancer_patch,
+ headers={},
)
# Check for correct operation
assert len(responses.calls) == 1
assert response.status_code == 200
+ # Validate body params
+ req_body = json.loads(str(responses.calls[0].request.body, 'utf-8'))
+ assert req_body == load_balancer_patch
- def test_list_endpoint_gateway_ips_required_params_with_retries(self):
- # Enable retries and run test_list_endpoint_gateway_ips_required_params.
+ def test_update_load_balancer_required_params_with_retries(self):
+ # Enable retries and run test_update_load_balancer_required_params.
_service.enable_retries()
- self.test_list_endpoint_gateway_ips_required_params()
+ self.test_update_load_balancer_required_params()
- # Disable retries and run test_list_endpoint_gateway_ips_required_params.
+ # Disable retries and run test_update_load_balancer_required_params.
_service.disable_retries()
- self.test_list_endpoint_gateway_ips_required_params()
+ self.test_update_load_balancer_required_params()
@responses.activate
- def test_list_endpoint_gateway_ips_value_error(self):
+ def test_update_load_balancer_value_error(self):
"""
- test_list_endpoint_gateway_ips_value_error()
+ test_update_load_balancer_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", "lifecycle_state": "stable", "name": "my-reserved-ip", "owner": "user", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "name": "my-endpoint-gateway", "resource_type": "endpoint_gateway"}}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5/ips?start=90ac13871b604023ab8b827178518328&limit=20"}, "total_count": 132}'
+ 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", "dns": {"instance": {"crn": "crn:v1:bluemix:public:dns-svcs:global:a/123456:6860c359-b2e2-46fa-a944-b38c28201c6e"}, "zone": {"id": "d66662cc-aa23-4fe1-9987-858487a61f45"}}, "hostname": "6b88d615-us-south.lb.appdomain.cloud", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "instance_groups_supported": false, "is_public": true, "listeners": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "logging": {"datapath": {"active": true}}, "name": "my-load-balancer", "operating_status": "offline", "pools": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}], "private_ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "profile": {"family": "network", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed", "name": "network-fixed"}, "provisioning_status": "active", "public_ips": [{"address": "192.168.3.4"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "load_balancer", "route_mode": true, "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "security_groups_supported": false, "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}], "udp_supported": true}'
responses.add(
- responses.GET,
+ responses.PATCH,
url,
body=mock_response,
content_type='application/json',
status=200,
)
+ # Construct a dict representation of a DNSInstanceIdentityByCRN model
+ dns_instance_identity_model = {}
+ dns_instance_identity_model['crn'] = 'crn:v1:bluemix:public:dns-svcs:global:a/123456:6860c359-b2e2-46fa-a944-b38c28201c6e'
+
+ # Construct a dict representation of a DNSZoneIdentityById model
+ dns_zone_identity_model = {}
+ dns_zone_identity_model['id'] = 'd66662cc-aa23-4fe1-9987-858487a61f45'
+
+ # Construct a dict representation of a LoadBalancerDNSPatch model
+ load_balancer_dns_patch_model = {}
+ load_balancer_dns_patch_model['instance'] = dns_instance_identity_model
+ load_balancer_dns_patch_model['zone'] = dns_zone_identity_model
+
+ # Construct a dict representation of a LoadBalancerLoggingDatapathPatch model
+ load_balancer_logging_datapath_patch_model = {}
+ load_balancer_logging_datapath_patch_model['active'] = True
+
+ # Construct a dict representation of a LoadBalancerLoggingPatch model
+ load_balancer_logging_patch_model = {}
+ load_balancer_logging_patch_model['datapath'] = load_balancer_logging_datapath_patch_model
+
+ # Construct a dict representation of a SubnetIdentityById model
+ subnet_identity_model = {}
+ subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
+
+ # Construct a dict representation of a LoadBalancerPatch model
+ load_balancer_patch_model = {}
+ load_balancer_patch_model['dns'] = load_balancer_dns_patch_model
+ load_balancer_patch_model['logging'] = load_balancer_logging_patch_model
+ load_balancer_patch_model['name'] = 'my-load-balancer'
+ load_balancer_patch_model['subnets'] = [subnet_identity_model]
+
# Set up parameter values
- endpoint_gateway_id = 'testString'
+ id = 'testString'
+ load_balancer_patch = load_balancer_patch_model
# 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_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.list_endpoint_gateway_ips(**req_copy)
+ _service.update_load_balancer(**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_update_load_balancer_value_error_with_retries(self):
+ # Enable retries and run test_update_load_balancer_value_error.
_service.enable_retries()
- self.test_list_endpoint_gateway_ips_value_error()
+ self.test_update_load_balancer_value_error()
- # Disable retries and run test_list_endpoint_gateway_ips_value_error.
+ # Disable retries and run test_update_load_balancer_value_error.
_service.disable_retries()
- self.test_list_endpoint_gateway_ips_value_error()
-
- @responses.activate
- def test_list_endpoint_gateway_ips_with_pager_get_next(self):
- """
- test_list_endpoint_gateway_ips_with_pager_get_next()
- """
- # Set up a two-page mock response
- url = preprocess_url('/endpoint_gateways/testString/ips')
- mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"ips":[{"address":"192.168.3.4","auto_delete":false,"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","lifecycle_state":"stable","name":"my-reserved-ip","owner":"user","resource_type":"subnet_reserved_ip","target":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5","id":"r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5","name":"my-endpoint-gateway","resource_type":"endpoint_gateway"}}]}'
- mock_response2 = '{"total_count":2,"limit":1,"ips":[{"address":"192.168.3.4","auto_delete":false,"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","lifecycle_state":"stable","name":"my-reserved-ip","owner":"user","resource_type":"subnet_reserved_ip","target":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5","id":"r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5","name":"my-endpoint-gateway","resource_type":"endpoint_gateway"}}]}'
- responses.add(
- responses.GET,
- url,
- body=mock_response1,
- content_type='application/json',
- status=200,
- )
- responses.add(
- responses.GET,
- url,
- body=mock_response2,
- content_type='application/json',
- status=200,
- )
-
- # Exercise the pager class for this operation
- all_results = []
- pager = EndpointGatewayIpsPager(
- client=_service,
- endpoint_gateway_id='testString',
- limit=10,
- sort='name',
- )
- while pager.has_next():
- next_page = pager.get_next()
- assert next_page is not None
- all_results.extend(next_page)
- assert len(all_results) == 2
-
- @responses.activate
- def test_list_endpoint_gateway_ips_with_pager_get_all(self):
- """
- test_list_endpoint_gateway_ips_with_pager_get_all()
- """
- # Set up a two-page mock response
- url = preprocess_url('/endpoint_gateways/testString/ips')
- mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"ips":[{"address":"192.168.3.4","auto_delete":false,"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","lifecycle_state":"stable","name":"my-reserved-ip","owner":"user","resource_type":"subnet_reserved_ip","target":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5","id":"r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5","name":"my-endpoint-gateway","resource_type":"endpoint_gateway"}}]}'
- mock_response2 = '{"total_count":2,"limit":1,"ips":[{"address":"192.168.3.4","auto_delete":false,"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","lifecycle_state":"stable","name":"my-reserved-ip","owner":"user","resource_type":"subnet_reserved_ip","target":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5","id":"r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5","name":"my-endpoint-gateway","resource_type":"endpoint_gateway"}}]}'
- responses.add(
- responses.GET,
- url,
- body=mock_response1,
- content_type='application/json',
- status=200,
- )
- responses.add(
- responses.GET,
- url,
- body=mock_response2,
- content_type='application/json',
- status=200,
- )
-
- # Exercise the pager class for this operation
- pager = EndpointGatewayIpsPager(
- client=_service,
- endpoint_gateway_id='testString',
- limit=10,
- sort='name',
- )
- all_results = pager.get_all()
- assert all_results is not None
- assert len(all_results) == 2
+ self.test_update_load_balancer_value_error()
-class TestRemoveEndpointGatewayIp:
+class TestGetLoadBalancerStatistics:
"""
- Test Class for remove_endpoint_gateway_ip
+ Test Class for get_load_balancer_statistics
"""
@responses.activate
- def test_remove_endpoint_gateway_ip_all_params(self):
+ def test_get_load_balancer_statistics_all_params(self):
"""
- remove_endpoint_gateway_ip()
+ get_load_balancer_statistics()
"""
# Set up mock
- url = preprocess_url('/endpoint_gateways/testString/ips/testString')
+ 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.DELETE,
+ responses.GET,
url,
- status=204,
+ body=mock_response,
+ content_type='application/json',
+ status=200,
)
# Set up parameter values
- endpoint_gateway_id = 'testString'
id = 'testString'
# Invoke method
- response = _service.remove_endpoint_gateway_ip(
- endpoint_gateway_id,
+ response = _service.get_load_balancer_statistics(
id,
headers={},
)
# Check for correct operation
assert len(responses.calls) == 1
- assert response.status_code == 204
+ assert response.status_code == 200
- def test_remove_endpoint_gateway_ip_all_params_with_retries(self):
- # Enable retries and run test_remove_endpoint_gateway_ip_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_remove_endpoint_gateway_ip_all_params()
+ self.test_get_load_balancer_statistics_all_params()
- # Disable retries and run test_remove_endpoint_gateway_ip_all_params.
+ # Disable retries and run test_get_load_balancer_statistics_all_params.
_service.disable_retries()
- self.test_remove_endpoint_gateway_ip_all_params()
+ self.test_get_load_balancer_statistics_all_params()
@responses.activate
- def test_remove_endpoint_gateway_ip_value_error(self):
+ def test_get_load_balancer_statistics_value_error(self):
"""
- test_remove_endpoint_gateway_ip_value_error()
+ test_get_load_balancer_statistics_value_error()
"""
# Set up mock
- url = preprocess_url('/endpoint_gateways/testString/ips/testString')
+ 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.DELETE,
+ responses.GET,
url,
- status=204,
+ 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.remove_endpoint_gateway_ip(**req_copy)
+ _service.get_load_balancer_statistics(**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_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_remove_endpoint_gateway_ip_value_error()
+ self.test_get_load_balancer_statistics_value_error()
- # Disable retries and run test_remove_endpoint_gateway_ip_value_error.
+ # Disable retries and run test_get_load_balancer_statistics_value_error.
_service.disable_retries()
- self.test_remove_endpoint_gateway_ip_value_error()
+ self.test_get_load_balancer_statistics_value_error()
-class TestGetEndpointGatewayIp:
+class TestListLoadBalancerListeners:
"""
- Test Class for get_endpoint_gateway_ip
+ Test Class for list_load_balancer_listeners
"""
@responses.activate
- def test_get_endpoint_gateway_ip_all_params(self):
+ def test_list_load_balancer_listeners_all_params(self):
"""
- get_endpoint_gateway_ip()
+ list_load_balancer_listeners()
"""
# 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", "lifecycle_state": "stable", "name": "my-reserved-ip", "owner": "user", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "name": "my-endpoint-gateway", "resource_type": "endpoint_gateway"}}'
+ url = preprocess_url('/load_balancers/testString/listeners')
+ mock_response = '{"listeners": [{"accept_proxy_protocol": true, "certificate_instance": {"crn": "crn:v1:bluemix:public:secrets-manager:us-south:a/123456:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5"}, "connection_limit": 2000, "created_at": "2019-01-01T12:00:00.000Z", "default_pool": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "https_redirect": {"http_status_code": 301, "listener": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}, "uri": "/example?doc=get"}, "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "idle_connection_timeout": 100, "policies": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-policy"}], "port": 443, "port_max": 499, "port_min": 443, "protocol": "http", "provisioning_status": "active"}]}'
responses.add(
responses.GET,
url,
@@ -41464,13 +42235,11 @@ def test_get_endpoint_gateway_ip_all_params(self):
)
# Set up parameter values
- endpoint_gateway_id = 'testString'
- id = 'testString'
+ load_balancer_id = 'testString'
# Invoke method
- response = _service.get_endpoint_gateway_ip(
- endpoint_gateway_id,
- id,
+ response = _service.list_load_balancer_listeners(
+ load_balancer_id,
headers={},
)
@@ -41478,23 +42247,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_listeners_all_params_with_retries(self):
+ # Enable retries and run test_list_load_balancer_listeners_all_params.
_service.enable_retries()
- self.test_get_endpoint_gateway_ip_all_params()
+ self.test_list_load_balancer_listeners_all_params()
- # Disable retries and run test_get_endpoint_gateway_ip_all_params.
+ # Disable retries and run test_list_load_balancer_listeners_all_params.
_service.disable_retries()
- self.test_get_endpoint_gateway_ip_all_params()
+ self.test_list_load_balancer_listeners_all_params()
@responses.activate
- def test_get_endpoint_gateway_ip_value_error(self):
+ def test_list_load_balancer_listeners_value_error(self):
"""
- test_get_endpoint_gateway_ip_value_error()
+ test_list_load_balancer_listeners_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", "lifecycle_state": "stable", "name": "my-reserved-ip", "owner": "user", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "name": "my-endpoint-gateway", "resource_type": "endpoint_gateway"}}'
+ url = preprocess_url('/load_balancers/testString/listeners')
+ mock_response = '{"listeners": [{"accept_proxy_protocol": true, "certificate_instance": {"crn": "crn:v1:bluemix:public:secrets-manager:us-south:a/123456:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5"}, "connection_limit": 2000, "created_at": "2019-01-01T12:00:00.000Z", "default_pool": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "https_redirect": {"http_status_code": 301, "listener": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}, "uri": "/example?doc=get"}, "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "idle_connection_timeout": 100, "policies": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-policy"}], "port": 443, "port_max": 499, "port_min": 443, "protocol": "http", "provisioning_status": "active"}]}'
responses.add(
responses.GET,
url,
@@ -41504,202 +42273,321 @@ def test_get_endpoint_gateway_ip_value_error(self):
)
# Set up parameter values
- endpoint_gateway_id = 'testString'
- id = 'testString'
+ load_balancer_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,
}
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_listeners(**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_listeners_value_error_with_retries(self):
+ # Enable retries and run test_list_load_balancer_listeners_value_error.
_service.enable_retries()
- self.test_get_endpoint_gateway_ip_value_error()
+ self.test_list_load_balancer_listeners_value_error()
- # Disable retries and run test_get_endpoint_gateway_ip_value_error.
+ # Disable retries and run test_list_load_balancer_listeners_value_error.
_service.disable_retries()
- self.test_get_endpoint_gateway_ip_value_error()
+ self.test_list_load_balancer_listeners_value_error()
-class TestAddEndpointGatewayIp:
+class TestCreateLoadBalancerListener:
"""
- Test Class for add_endpoint_gateway_ip
+ Test Class for create_load_balancer_listener
"""
@responses.activate
- def test_add_endpoint_gateway_ip_all_params(self):
+ def test_create_load_balancer_listener_all_params(self):
"""
- add_endpoint_gateway_ip()
+ create_load_balancer_listener()
"""
# 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", "lifecycle_state": "stable", "name": "my-reserved-ip", "owner": "user", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "name": "my-endpoint-gateway", "resource_type": "endpoint_gateway"}}'
+ url = preprocess_url('/load_balancers/testString/listeners')
+ mock_response = '{"accept_proxy_protocol": true, "certificate_instance": {"crn": "crn:v1:bluemix:public:secrets-manager:us-south:a/123456:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5"}, "connection_limit": 2000, "created_at": "2019-01-01T12:00:00.000Z", "default_pool": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "https_redirect": {"http_status_code": 301, "listener": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}, "uri": "/example?doc=get"}, "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "idle_connection_timeout": 100, "policies": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-policy"}], "port": 443, "port_max": 499, "port_min": 443, "protocol": "http", "provisioning_status": "active"}'
responses.add(
- responses.PUT,
+ responses.POST,
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:secrets-manager:us-south:a/123456:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5'
+
+ # Construct a dict representation of a LoadBalancerPoolIdentityById model
+ load_balancer_pool_identity_model = {}
+ 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
- endpoint_gateway_id = 'testString'
- id = 'testString'
+ 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
+ idle_connection_timeout = 100
+ policies = [load_balancer_listener_policy_prototype_model]
+ port = 443
+ port_max = 499
+ port_min = 443
# Invoke method
- response = _service.add_endpoint_gateway_ip(
- endpoint_gateway_id,
- id,
+ 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,
+ idle_connection_timeout=idle_connection_timeout,
+ 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 == 201
+ # 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['idle_connection_timeout'] == 100
+ 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_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_all_params_with_retries(self):
+ # Enable retries and run test_create_load_balancer_listener_all_params.
_service.enable_retries()
- self.test_add_endpoint_gateway_ip_all_params()
+ self.test_create_load_balancer_listener_all_params()
- # Disable retries and run test_add_endpoint_gateway_ip_all_params.
+ # Disable retries and run test_create_load_balancer_listener_all_params.
_service.disable_retries()
- self.test_add_endpoint_gateway_ip_all_params()
+ self.test_create_load_balancer_listener_all_params()
@responses.activate
- def test_add_endpoint_gateway_ip_value_error(self):
+ def test_create_load_balancer_listener_value_error(self):
"""
- test_add_endpoint_gateway_ip_value_error()
+ test_create_load_balancer_listener_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", "lifecycle_state": "stable", "name": "my-reserved-ip", "owner": "user", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "name": "my-endpoint-gateway", "resource_type": "endpoint_gateway"}}'
+ url = preprocess_url('/load_balancers/testString/listeners')
+ mock_response = '{"accept_proxy_protocol": true, "certificate_instance": {"crn": "crn:v1:bluemix:public:secrets-manager:us-south:a/123456:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5"}, "connection_limit": 2000, "created_at": "2019-01-01T12:00:00.000Z", "default_pool": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "https_redirect": {"http_status_code": 301, "listener": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}, "uri": "/example?doc=get"}, "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "idle_connection_timeout": 100, "policies": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-policy"}], "port": 443, "port_max": 499, "port_min": 443, "protocol": "http", "provisioning_status": "active"}'
responses.add(
- responses.PUT,
+ responses.POST,
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:secrets-manager:us-south:a/123456:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5'
+
+ # Construct a dict representation of a LoadBalancerPoolIdentityById model
+ load_balancer_pool_identity_model = {}
+ 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
- endpoint_gateway_id = 'testString'
- id = 'testString'
+ 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
+ idle_connection_timeout = 100
+ 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 = {
- "endpoint_gateway_id": endpoint_gateway_id,
- "id": id,
+ "load_balancer_id": load_balancer_id,
+ "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.add_endpoint_gateway_ip(**req_copy)
+ _service.create_load_balancer_listener(**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_value_error_with_retries(self):
+ # Enable retries and run test_create_load_balancer_listener_value_error.
_service.enable_retries()
- self.test_add_endpoint_gateway_ip_value_error()
+ self.test_create_load_balancer_listener_value_error()
- # Disable retries and run test_add_endpoint_gateway_ip_value_error.
+ # Disable retries and run test_create_load_balancer_listener_value_error.
_service.disable_retries()
- self.test_add_endpoint_gateway_ip_value_error()
+ self.test_create_load_balancer_listener_value_error()
-class TestDeleteEndpointGateway:
+class TestDeleteLoadBalancerListener:
"""
- Test Class for delete_endpoint_gateway
+ Test Class for delete_load_balancer_listener
"""
@responses.activate
- def test_delete_endpoint_gateway_all_params(self):
+ def test_delete_load_balancer_listener_all_params(self):
"""
- delete_endpoint_gateway()
+ delete_load_balancer_listener()
"""
# Set up mock
- url = preprocess_url('/endpoint_gateways/testString')
+ url = preprocess_url('/load_balancers/testString/listeners/testString')
responses.add(
responses.DELETE,
url,
- status=204,
+ status=202,
)
# Set up parameter values
+ load_balancer_id = 'testString'
id = 'testString'
# Invoke method
- response = _service.delete_endpoint_gateway(
+ response = _service.delete_load_balancer_listener(
+ load_balancer_id,
id,
headers={},
)
# Check for correct operation
assert len(responses.calls) == 1
- assert response.status_code == 204
+ assert response.status_code == 202
- 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_all_params_with_retries(self):
+ # Enable retries and run test_delete_load_balancer_listener_all_params.
_service.enable_retries()
- self.test_delete_endpoint_gateway_all_params()
+ self.test_delete_load_balancer_listener_all_params()
- # Disable retries and run test_delete_endpoint_gateway_all_params.
+ # Disable retries and run test_delete_load_balancer_listener_all_params.
_service.disable_retries()
- self.test_delete_endpoint_gateway_all_params()
+ self.test_delete_load_balancer_listener_all_params()
@responses.activate
- def test_delete_endpoint_gateway_value_error(self):
+ def test_delete_load_balancer_listener_value_error(self):
"""
- test_delete_endpoint_gateway_value_error()
+ test_delete_load_balancer_listener_value_error()
"""
# Set up mock
- url = preprocess_url('/endpoint_gateways/testString')
+ url = preprocess_url('/load_balancers/testString/listeners/testString')
responses.add(
responses.DELETE,
url,
- status=204,
+ status=202,
)
# Set up parameter values
+ load_balancer_id = 'testString'
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_endpoint_gateway(**req_copy)
+ _service.delete_load_balancer_listener(**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_value_error_with_retries(self):
+ # Enable retries and run test_delete_load_balancer_listener_value_error.
_service.enable_retries()
- self.test_delete_endpoint_gateway_value_error()
+ self.test_delete_load_balancer_listener_value_error()
- # Disable retries and run test_delete_endpoint_gateway_value_error.
+ # Disable retries and run test_delete_load_balancer_listener_value_error.
_service.disable_retries()
- self.test_delete_endpoint_gateway_value_error()
+ self.test_delete_load_balancer_listener_value_error()
-class TestGetEndpointGateway:
+class TestGetLoadBalancerListener:
"""
- Test Class for get_endpoint_gateway
+ Test Class for get_load_balancer_listener
"""
@responses.activate
- def test_get_endpoint_gateway_all_params(self):
+ def test_get_load_balancer_listener_all_params(self):
"""
- get_endpoint_gateway()
+ get_load_balancer_listener()
"""
# Set up mock
- url = preprocess_url('/endpoint_gateways/testString')
- mock_response = '{"allow_dns_resolution_binding": true, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "lifecycle_state": "stable", "name": "my-endpoint-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "endpoint_gateway", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "service_endpoint": "my-cloudant-instance.appdomain.cloud", "service_endpoints": ["my-cloudant-instance.appdomain.cloud"], "target": {"crn": "crn:v1:bluemix:public:cloudant:us-south:a/123456:3527280b-9327-4411-8020-591092e60353::", "resource_type": "provider_cloud_service"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}'
+ url = preprocess_url('/load_balancers/testString/listeners/testString')
+ mock_response = '{"accept_proxy_protocol": true, "certificate_instance": {"crn": "crn:v1:bluemix:public:secrets-manager:us-south:a/123456:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5"}, "connection_limit": 2000, "created_at": "2019-01-01T12:00:00.000Z", "default_pool": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "https_redirect": {"http_status_code": 301, "listener": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}, "uri": "/example?doc=get"}, "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "idle_connection_timeout": 100, "policies": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-policy"}], "port": 443, "port_max": 499, "port_min": 443, "protocol": "http", "provisioning_status": "active"}'
responses.add(
responses.GET,
url,
@@ -41709,10 +42597,12 @@ def test_get_endpoint_gateway_all_params(self):
)
# Set up parameter values
+ load_balancer_id = 'testString'
id = 'testString'
# Invoke method
- response = _service.get_endpoint_gateway(
+ response = _service.get_load_balancer_listener(
+ load_balancer_id,
id,
headers={},
)
@@ -41721,23 +42611,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_all_params_with_retries(self):
+ # Enable retries and run test_get_load_balancer_listener_all_params.
_service.enable_retries()
- self.test_get_endpoint_gateway_all_params()
+ self.test_get_load_balancer_listener_all_params()
- # Disable retries and run test_get_endpoint_gateway_all_params.
+ # Disable retries and run test_get_load_balancer_listener_all_params.
_service.disable_retries()
- self.test_get_endpoint_gateway_all_params()
+ self.test_get_load_balancer_listener_all_params()
@responses.activate
- def test_get_endpoint_gateway_value_error(self):
+ def test_get_load_balancer_listener_value_error(self):
"""
- test_get_endpoint_gateway_value_error()
+ test_get_load_balancer_listener_value_error()
"""
# Set up mock
- url = preprocess_url('/endpoint_gateways/testString')
- mock_response = '{"allow_dns_resolution_binding": true, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "lifecycle_state": "stable", "name": "my-endpoint-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "endpoint_gateway", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "service_endpoint": "my-cloudant-instance.appdomain.cloud", "service_endpoints": ["my-cloudant-instance.appdomain.cloud"], "target": {"crn": "crn:v1:bluemix:public:cloudant:us-south:a/123456:3527280b-9327-4411-8020-591092e60353::", "resource_type": "provider_cloud_service"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}'
+ url = preprocess_url('/load_balancers/testString/listeners/testString')
+ mock_response = '{"accept_proxy_protocol": true, "certificate_instance": {"crn": "crn:v1:bluemix:public:secrets-manager:us-south:a/123456:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5"}, "connection_limit": 2000, "created_at": "2019-01-01T12:00:00.000Z", "default_pool": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "https_redirect": {"http_status_code": 301, "listener": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}, "uri": "/example?doc=get"}, "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "idle_connection_timeout": 100, "policies": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-policy"}], "port": 443, "port_max": 499, "port_min": 443, "protocol": "http", "provisioning_status": "active"}'
responses.add(
responses.GET,
url,
@@ -41747,40 +42637,42 @@ def test_get_endpoint_gateway_value_error(self):
)
# 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_endpoint_gateway(**req_copy)
+ _service.get_load_balancer_listener(**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_value_error_with_retries(self):
+ # Enable retries and run test_get_load_balancer_listener_value_error.
_service.enable_retries()
- self.test_get_endpoint_gateway_value_error()
+ self.test_get_load_balancer_listener_value_error()
- # Disable retries and run test_get_endpoint_gateway_value_error.
+ # Disable retries and run test_get_load_balancer_listener_value_error.
_service.disable_retries()
- self.test_get_endpoint_gateway_value_error()
+ self.test_get_load_balancer_listener_value_error()
-class TestUpdateEndpointGateway:
+class TestUpdateLoadBalancerListener:
"""
- Test Class for update_endpoint_gateway
+ Test Class for update_load_balancer_listener
"""
@responses.activate
- def test_update_endpoint_gateway_all_params(self):
+ def test_update_load_balancer_listener_all_params(self):
"""
- update_endpoint_gateway()
+ update_load_balancer_listener()
"""
# Set up mock
- url = preprocess_url('/endpoint_gateways/testString')
- mock_response = '{"allow_dns_resolution_binding": true, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "lifecycle_state": "stable", "name": "my-endpoint-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "endpoint_gateway", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "service_endpoint": "my-cloudant-instance.appdomain.cloud", "service_endpoints": ["my-cloudant-instance.appdomain.cloud"], "target": {"crn": "crn:v1:bluemix:public:cloudant:us-south:a/123456:3527280b-9327-4411-8020-591092e60353::", "resource_type": "provider_cloud_service"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}'
+ url = preprocess_url('/load_balancers/testString/listeners/testString')
+ mock_response = '{"accept_proxy_protocol": true, "certificate_instance": {"crn": "crn:v1:bluemix:public:secrets-manager:us-south:a/123456:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5"}, "connection_limit": 2000, "created_at": "2019-01-01T12:00:00.000Z", "default_pool": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "https_redirect": {"http_status_code": 301, "listener": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}, "uri": "/example?doc=get"}, "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "idle_connection_timeout": 100, "policies": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-policy"}], "port": 443, "port_max": 499, "port_min": 443, "protocol": "http", "provisioning_status": "active"}'
responses.add(
responses.PATCH,
url,
@@ -41789,19 +42681,47 @@ def test_update_endpoint_gateway_all_params(self):
status=200,
)
- # Construct a dict representation of a EndpointGatewayPatch model
- endpoint_gateway_patch_model = {}
- endpoint_gateway_patch_model['allow_dns_resolution_binding'] = True
- endpoint_gateway_patch_model['name'] = 'my-endpoint-gateway'
+ # Construct a dict representation of a CertificateInstanceIdentityByCRN model
+ certificate_instance_identity_model = {}
+ certificate_instance_identity_model['crn'] = 'crn:v1:bluemix:public:secrets-manager:us-south:a/123456:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5'
+
+ # Construct a dict representation of a 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['idle_connection_timeout'] = 100
+ 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'
id = 'testString'
- endpoint_gateway_patch = endpoint_gateway_patch_model
+ load_balancer_listener_patch = load_balancer_listener_patch_model
# Invoke method
- response = _service.update_endpoint_gateway(
+ response = _service.update_load_balancer_listener(
+ load_balancer_id,
id,
- endpoint_gateway_patch,
+ load_balancer_listener_patch,
headers={},
)
@@ -41810,25 +42730,25 @@ 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_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_all_params_with_retries(self):
+ # Enable retries and run test_update_load_balancer_listener_all_params.
_service.enable_retries()
- self.test_update_endpoint_gateway_all_params()
+ self.test_update_load_balancer_listener_all_params()
- # Disable retries and run test_update_endpoint_gateway_all_params.
+ # Disable retries and run test_update_load_balancer_listener_all_params.
_service.disable_retries()
- self.test_update_endpoint_gateway_all_params()
+ self.test_update_load_balancer_listener_all_params()
@responses.activate
- def test_update_endpoint_gateway_value_error(self):
+ def test_update_load_balancer_listener_value_error(self):
"""
- test_update_endpoint_gateway_value_error()
+ test_update_load_balancer_listener_value_error()
"""
# Set up mock
- url = preprocess_url('/endpoint_gateways/testString')
- mock_response = '{"allow_dns_resolution_binding": true, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "lifecycle_state": "stable", "name": "my-endpoint-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "endpoint_gateway", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "service_endpoint": "my-cloudant-instance.appdomain.cloud", "service_endpoints": ["my-cloudant-instance.appdomain.cloud"], "target": {"crn": "crn:v1:bluemix:public:cloudant:us-south:a/123456:3527280b-9327-4411-8020-591092e60353::", "resource_type": "provider_cloud_service"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}'
+ url = preprocess_url('/load_balancers/testString/listeners/testString')
+ mock_response = '{"accept_proxy_protocol": true, "certificate_instance": {"crn": "crn:v1:bluemix:public:secrets-manager:us-south:a/123456:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5"}, "connection_limit": 2000, "created_at": "2019-01-01T12:00:00.000Z", "default_pool": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "https_redirect": {"http_status_code": 301, "listener": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}, "uri": "/example?doc=get"}, "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "idle_connection_timeout": 100, "policies": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-policy"}], "port": 443, "port_max": 499, "port_min": 443, "protocol": "http", "provisioning_status": "active"}'
responses.add(
responses.PATCH,
url,
@@ -41837,98 +42757,76 @@ def test_update_endpoint_gateway_value_error(self):
status=200,
)
- # Construct a dict representation of a EndpointGatewayPatch model
- endpoint_gateway_patch_model = {}
- endpoint_gateway_patch_model['allow_dns_resolution_binding'] = True
- endpoint_gateway_patch_model['name'] = 'my-endpoint-gateway'
+ # Construct a dict representation of a CertificateInstanceIdentityByCRN model
+ certificate_instance_identity_model = {}
+ certificate_instance_identity_model['crn'] = 'crn:v1:bluemix:public:secrets-manager:us-south:a/123456:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5'
+
+ # Construct a dict representation of a 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['idle_connection_timeout'] = 100
+ 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'
id = 'testString'
- endpoint_gateway_patch = endpoint_gateway_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,
"id": id,
- "endpoint_gateway_patch": endpoint_gateway_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_endpoint_gateway(**req_copy)
+ _service.update_load_balancer_listener(**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_value_error_with_retries(self):
+ # Enable retries and run test_update_load_balancer_listener_value_error.
_service.enable_retries()
- self.test_update_endpoint_gateway_value_error()
+ self.test_update_load_balancer_listener_value_error()
- # Disable retries and run test_update_endpoint_gateway_value_error.
+ # Disable retries and run test_update_load_balancer_listener_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,
- )
+ self.test_update_load_balancer_listener_value_error()
-class TestListFlowLogCollectors:
+class TestListLoadBalancerListenerPolicies:
"""
- Test Class for list_flow_log_collectors
+ Test Class for list_load_balancer_listener_policies
"""
@responses.activate
- def test_list_flow_log_collectors_all_params(self):
+ def test_list_load_balancer_listener_policies_all_params(self):
"""
- list_flow_log_collectors()
+ list_load_balancer_listener_policies()
"""
# 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-instance-network-interface", "resource_type": "network_interface"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}'
+ 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,
@@ -41938,63 +42836,37 @@ def test_list_flow_log_collectors_all_params(self):
)
# Set up parameter values
- start = 'testString'
- limit = 50
- resource_group_id = 'testString'
- name = 'testString'
- vpc_id = 'testString'
- vpc_crn = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b'
- vpc_name = 'my-vpc'
- target_id = 'testString'
- target_resource_type = 'testString'
+ load_balancer_id = 'testString'
+ listener_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_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 '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_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_flow_log_collectors_all_params()
+ self.test_list_load_balancer_listener_policies_all_params()
- # Disable retries and run test_list_flow_log_collectors_all_params.
+ # Disable retries and run test_list_load_balancer_listener_policies_all_params.
_service.disable_retries()
- self.test_list_flow_log_collectors_all_params()
+ self.test_list_load_balancer_listener_policies_all_params()
@responses.activate
- def test_list_flow_log_collectors_required_params(self):
+ def test_list_load_balancer_listener_policies_value_error(self):
"""
- test_list_flow_log_collectors_required_params()
+ test_list_load_balancer_listener_policies_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-instance-network-interface", "resource_type": "network_interface"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}'
+ 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,
@@ -42003,152 +42875,43 @@ def test_list_flow_log_collectors_required_params(self):
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-instance-network-interface", "resource_type": "network_interface"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}'
- responses.add(
- responses.GET,
- url,
- 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_flow_log_collectors(**req_copy)
+ _service.list_load_balancer_listener_policies(**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_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_flow_log_collectors_value_error()
+ self.test_list_load_balancer_listener_policies_value_error()
- # Disable retries and run test_list_flow_log_collectors_value_error.
+ # Disable retries and run test_list_load_balancer_listener_policies_value_error.
_service.disable_retries()
- self.test_list_flow_log_collectors_value_error()
-
- @responses.activate
- def test_list_flow_log_collectors_with_pager_get_next(self):
- """
- test_list_flow_log_collectors_with_pager_get_next()
- """
- # Set up a two-page mock response
- url = preprocess_url('/flow_log_collectors')
- mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"flow_log_collectors":[{"active":true,"auto_delete":true,"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::flow-log-collector:39300233-9995-4806-89a5-3c1b6eb88689","href":"https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors/39300233-9995-4806-89a5-3c1b6eb88689","id":"39300233-9995-4806-89a5-3c1b6eb88689","lifecycle_state":"stable","name":"my-flow-log-collector","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"storage_bucket":{"name":"bucket-27200-lwx4cfvcue"},"target":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-instance-network-interface","resource_type":"network_interface"},"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"}}]}'
- mock_response2 = '{"total_count":2,"limit":1,"flow_log_collectors":[{"active":true,"auto_delete":true,"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::flow-log-collector:39300233-9995-4806-89a5-3c1b6eb88689","href":"https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors/39300233-9995-4806-89a5-3c1b6eb88689","id":"39300233-9995-4806-89a5-3c1b6eb88689","lifecycle_state":"stable","name":"my-flow-log-collector","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"storage_bucket":{"name":"bucket-27200-lwx4cfvcue"},"target":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-instance-network-interface","resource_type":"network_interface"},"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"}}]}'
- responses.add(
- responses.GET,
- url,
- body=mock_response1,
- content_type='application/json',
- status=200,
- )
- responses.add(
- responses.GET,
- url,
- body=mock_response2,
- content_type='application/json',
- status=200,
- )
-
- # Exercise the pager class for this operation
- all_results = []
- pager = FlowLogCollectorsPager(
- client=_service,
- limit=10,
- resource_group_id='testString',
- name='testString',
- vpc_id='testString',
- vpc_crn='crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b',
- vpc_name='my-vpc',
- target_id='testString',
- target_resource_type='testString',
- )
- while pager.has_next():
- next_page = pager.get_next()
- assert next_page is not None
- all_results.extend(next_page)
- assert len(all_results) == 2
-
- @responses.activate
- def test_list_flow_log_collectors_with_pager_get_all(self):
- """
- test_list_flow_log_collectors_with_pager_get_all()
- """
- # Set up a two-page mock response
- url = preprocess_url('/flow_log_collectors')
- mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"flow_log_collectors":[{"active":true,"auto_delete":true,"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::flow-log-collector:39300233-9995-4806-89a5-3c1b6eb88689","href":"https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors/39300233-9995-4806-89a5-3c1b6eb88689","id":"39300233-9995-4806-89a5-3c1b6eb88689","lifecycle_state":"stable","name":"my-flow-log-collector","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"storage_bucket":{"name":"bucket-27200-lwx4cfvcue"},"target":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-instance-network-interface","resource_type":"network_interface"},"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"}}]}'
- mock_response2 = '{"total_count":2,"limit":1,"flow_log_collectors":[{"active":true,"auto_delete":true,"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::flow-log-collector:39300233-9995-4806-89a5-3c1b6eb88689","href":"https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors/39300233-9995-4806-89a5-3c1b6eb88689","id":"39300233-9995-4806-89a5-3c1b6eb88689","lifecycle_state":"stable","name":"my-flow-log-collector","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"storage_bucket":{"name":"bucket-27200-lwx4cfvcue"},"target":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-instance-network-interface","resource_type":"network_interface"},"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"}}]}'
- responses.add(
- responses.GET,
- url,
- body=mock_response1,
- content_type='application/json',
- status=200,
- )
- responses.add(
- responses.GET,
- url,
- body=mock_response2,
- content_type='application/json',
- status=200,
- )
-
- # Exercise the pager class for this operation
- pager = FlowLogCollectorsPager(
- client=_service,
- limit=10,
- resource_group_id='testString',
- name='testString',
- vpc_id='testString',
- vpc_crn='crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b',
- vpc_name='my-vpc',
- target_id='testString',
- target_resource_type='testString',
- )
- all_results = pager.get_all()
- assert all_results is not None
- assert len(all_results) == 2
+ self.test_list_load_balancer_listener_policies_value_error()
-class TestCreateFlowLogCollector:
+class TestCreateLoadBalancerListenerPolicy:
"""
- Test Class for create_flow_log_collector
+ Test Class for create_load_balancer_listener_policy
"""
@responses.activate
- def test_create_flow_log_collector_all_params(self):
+ def test_create_load_balancer_listener_policy_all_params(self):
"""
- create_flow_log_collector()
+ create_load_balancer_listener_policy()
"""
# 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-instance-network-interface", "resource_type": "network_interface"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}'
+ 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,
@@ -42157,32 +42920,35 @@ def test_create_flow_log_collector_all_params(self):
status=201,
)
- # Construct a dict representation of a LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName model
- legacy_cloud_object_storage_bucket_identity_model = {}
- legacy_cloud_object_storage_bucket_identity_model['name'] = 'bucket-27200-lwx4cfvcue'
-
- # Construct a dict representation of a FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityById 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 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
- storage_bucket = legacy_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'
+ 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_flow_log_collector(
- storage_bucket,
- target,
- active=active,
+ 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={},
)
@@ -42191,29 +42957,29 @@ 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'] == legacy_cloud_object_storage_bucket_identity_model
- assert req_body['target'] == flow_log_collector_target_prototype_model
- assert req_body['active'] == False
- assert req_body['name'] == 'my-flow-log-collector'
- 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_flow_log_collector_all_params_with_retries(self):
- # Enable retries and run test_create_flow_log_collector_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_flow_log_collector_all_params()
+ self.test_create_load_balancer_listener_policy_all_params()
- # Disable retries and run test_create_flow_log_collector_all_params.
+ # Disable retries and run test_create_load_balancer_listener_policy_all_params.
_service.disable_retries()
- self.test_create_flow_log_collector_all_params()
+ self.test_create_load_balancer_listener_policy_all_params()
@responses.activate
- def test_create_flow_log_collector_value_error(self):
+ def test_create_load_balancer_listener_policy_value_error(self):
"""
- test_create_flow_log_collector_value_error()
+ test_create_load_balancer_listener_policy_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-instance-network-interface", "resource_type": "network_interface"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}'
+ 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,
@@ -42222,133 +42988,144 @@ def test_create_flow_log_collector_value_error(self):
status=201,
)
- # Construct a dict representation of a LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName model
- legacy_cloud_object_storage_bucket_identity_model = {}
- legacy_cloud_object_storage_bucket_identity_model['name'] = 'bucket-27200-lwx4cfvcue'
-
- # Construct a dict representation of a FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityById 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 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
- storage_bucket = legacy_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'
+ 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 = {
- "storage_bucket": storage_bucket,
- "target": target,
+ "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_flow_log_collector(**req_copy)
+ _service.create_load_balancer_listener_policy(**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_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_flow_log_collector_value_error()
+ self.test_create_load_balancer_listener_policy_value_error()
- # Disable retries and run test_create_flow_log_collector_value_error.
+ # Disable retries and run test_create_load_balancer_listener_policy_value_error.
_service.disable_retries()
- self.test_create_flow_log_collector_value_error()
+ self.test_create_load_balancer_listener_policy_value_error()
-class TestDeleteFlowLogCollector:
+class TestDeleteLoadBalancerListenerPolicy:
"""
- Test Class for delete_flow_log_collector
+ Test Class for delete_load_balancer_listener_policy
"""
@responses.activate
- def test_delete_flow_log_collector_all_params(self):
+ def test_delete_load_balancer_listener_policy_all_params(self):
"""
- delete_flow_log_collector()
+ delete_load_balancer_listener_policy()
"""
# Set up mock
- url = preprocess_url('/flow_log_collectors/testString')
+ url = preprocess_url('/load_balancers/testString/listeners/testString/policies/testString')
responses.add(
responses.DELETE,
url,
- status=204,
+ status=202,
)
# Set up parameter values
+ load_balancer_id = 'testString'
+ listener_id = 'testString'
id = 'testString'
# Invoke method
- response = _service.delete_flow_log_collector(
+ 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 == 204
+ assert response.status_code == 202
- 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_listener_policy_all_params_with_retries(self):
+ # Enable retries and run test_delete_load_balancer_listener_policy_all_params.
_service.enable_retries()
- self.test_delete_flow_log_collector_all_params()
+ self.test_delete_load_balancer_listener_policy_all_params()
- # Disable retries and run test_delete_flow_log_collector_all_params.
+ # Disable retries and run test_delete_load_balancer_listener_policy_all_params.
_service.disable_retries()
- self.test_delete_flow_log_collector_all_params()
+ self.test_delete_load_balancer_listener_policy_all_params()
@responses.activate
- def test_delete_flow_log_collector_value_error(self):
+ def test_delete_load_balancer_listener_policy_value_error(self):
"""
- test_delete_flow_log_collector_value_error()
+ test_delete_load_balancer_listener_policy_value_error()
"""
# Set up mock
- url = preprocess_url('/flow_log_collectors/testString')
+ url = preprocess_url('/load_balancers/testString/listeners/testString/policies/testString')
responses.add(
responses.DELETE,
url,
- status=204,
+ status=202,
)
# Set up parameter values
+ load_balancer_id = 'testString'
+ listener_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,
"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_listener_policy(**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_listener_policy_value_error_with_retries(self):
+ # Enable retries and run test_delete_load_balancer_listener_policy_value_error.
_service.enable_retries()
- self.test_delete_flow_log_collector_value_error()
+ self.test_delete_load_balancer_listener_policy_value_error()
- # Disable retries and run test_delete_flow_log_collector_value_error.
+ # Disable retries and run test_delete_load_balancer_listener_policy_value_error.
_service.disable_retries()
- self.test_delete_flow_log_collector_value_error()
+ self.test_delete_load_balancer_listener_policy_value_error()
-class TestGetFlowLogCollector:
+class TestGetLoadBalancerListenerPolicy:
"""
- Test Class for get_flow_log_collector
+ Test Class for get_load_balancer_listener_policy
"""
@responses.activate
- def test_get_flow_log_collector_all_params(self):
+ def test_get_load_balancer_listener_policy_all_params(self):
"""
- get_flow_log_collector()
+ get_load_balancer_listener_policy()
"""
# 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-instance-network-interface", "resource_type": "network_interface"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}'
+ 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,
@@ -42358,10 +43135,14 @@ def test_get_flow_log_collector_all_params(self):
)
# Set up parameter values
+ load_balancer_id = 'testString'
+ listener_id = 'testString'
id = 'testString'
# Invoke method
- response = _service.get_flow_log_collector(
+ response = _service.get_load_balancer_listener_policy(
+ load_balancer_id,
+ listener_id,
id,
headers={},
)
@@ -42370,23 +43151,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_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_flow_log_collector_all_params()
+ self.test_get_load_balancer_listener_policy_all_params()
- # Disable retries and run test_get_flow_log_collector_all_params.
+ # Disable retries and run test_get_load_balancer_listener_policy_all_params.
_service.disable_retries()
- self.test_get_flow_log_collector_all_params()
+ self.test_get_load_balancer_listener_policy_all_params()
@responses.activate
- def test_get_flow_log_collector_value_error(self):
+ def test_get_load_balancer_listener_policy_value_error(self):
"""
- test_get_flow_log_collector_value_error()
+ test_get_load_balancer_listener_policy_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-instance-network-interface", "resource_type": "network_interface"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}'
+ 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,
@@ -42396,40 +43177,44 @@ def test_get_flow_log_collector_value_error(self):
)
# 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 = {
+ "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.get_flow_log_collector(**req_copy)
+ _service.get_load_balancer_listener_policy(**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_listener_policy_value_error_with_retries(self):
+ # Enable retries and run test_get_load_balancer_listener_policy_value_error.
_service.enable_retries()
- self.test_get_flow_log_collector_value_error()
+ self.test_get_load_balancer_listener_policy_value_error()
- # Disable retries and run test_get_flow_log_collector_value_error.
+ # Disable retries and run test_get_load_balancer_listener_policy_value_error.
_service.disable_retries()
- self.test_get_flow_log_collector_value_error()
+ self.test_get_load_balancer_listener_policy_value_error()
-class TestUpdateFlowLogCollector:
+class TestUpdateLoadBalancerListenerPolicy:
"""
- Test Class for update_flow_log_collector
+ Test Class for update_load_balancer_listener_policy
"""
@responses.activate
- def test_update_flow_log_collector_all_params(self):
+ def test_update_load_balancer_listener_policy_all_params(self):
"""
- update_flow_log_collector()
+ update_load_balancer_listener_policy()
"""
# 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-instance-network-interface", "resource_type": "network_interface"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}'
+ 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,
@@ -42438,19 +43223,28 @@ def test_update_flow_log_collector_all_params(self):
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 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
+ load_balancer_id = 'testString'
+ listener_id = 'testString'
id = 'testString'
- flow_log_collector_patch = flow_log_collector_patch_model
+ load_balancer_listener_policy_patch = load_balancer_listener_policy_patch_model
# Invoke method
- response = _service.update_flow_log_collector(
+ response = _service.update_load_balancer_listener_policy(
+ load_balancer_id,
+ listener_id,
id,
- flow_log_collector_patch,
+ load_balancer_listener_policy_patch,
headers={},
)
@@ -42459,25 +43253,25 @@ 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_listener_policy_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_listener_policy_all_params_with_retries(self):
+ # Enable retries and run test_update_load_balancer_listener_policy_all_params.
_service.enable_retries()
- self.test_update_flow_log_collector_all_params()
+ self.test_update_load_balancer_listener_policy_all_params()
- # Disable retries and run test_update_flow_log_collector_all_params.
+ # Disable retries and run test_update_load_balancer_listener_policy_all_params.
_service.disable_retries()
- self.test_update_flow_log_collector_all_params()
+ self.test_update_load_balancer_listener_policy_all_params()
@responses.activate
- def test_update_flow_log_collector_value_error(self):
+ def test_update_load_balancer_listener_policy_value_error(self):
"""
- test_update_flow_log_collector_value_error()
+ test_update_load_balancer_listener_policy_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-instance-network-interface", "resource_type": "network_interface"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}'
+ 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,
@@ -42486,5349 +43280,14389 @@ def test_update_flow_log_collector_value_error(self):
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 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
+ load_balancer_id = 'testString'
+ listener_id = 'testString'
id = 'testString'
- flow_log_collector_patch = flow_log_collector_patch_model
+ 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 = {
+ "load_balancer_id": load_balancer_id,
+ "listener_id": listener_id,
"id": id,
- "flow_log_collector_patch": flow_log_collector_patch,
+ "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.update_flow_log_collector(**req_copy)
+ _service.update_load_balancer_listener_policy(**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_listener_policy_value_error_with_retries(self):
+ # Enable retries and run test_update_load_balancer_listener_policy_value_error.
_service.enable_retries()
- self.test_update_flow_log_collector_value_error()
+ self.test_update_load_balancer_listener_policy_value_error()
- # Disable retries and run test_update_flow_log_collector_value_error.
+ # Disable retries and run test_update_load_balancer_listener_policy_value_error.
_service.disable_retries()
- self.test_update_flow_log_collector_value_error()
-
-
-# endregion
-##############################################################################
-# End of Service: FlowLogCollectors
-##############################################################################
-
-
-##############################################################################
-# Start of Model Tests
-##############################################################################
-# region
+ self.test_update_load_balancer_listener_policy_value_error()
-class TestModel_AccountReference:
+class TestListLoadBalancerListenerPolicyRules:
"""
- Test Class for AccountReference
+ Test Class for list_load_balancer_listener_policy_rules
"""
- def test_account_reference_serialization(self):
+ @responses.activate
+ def test_list_load_balancer_listener_policy_rules_all_params(self):
"""
- Test serialization/deserialization for AccountReference
+ list_load_balancer_listener_policy_rules()
"""
+ # Set up mock
+ 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,
+ content_type='application/json',
+ status=200,
+ )
- # Construct a json representation of a AccountReference model
- account_reference_model_json = {}
- account_reference_model_json['id'] = 'aa2432b1fa4d4ace891e9b80fc104e34'
- account_reference_model_json['resource_type'] = 'account'
-
- # Construct a model instance of AccountReference by calling from_dict on the json representation
- account_reference_model = AccountReference.from_dict(account_reference_model_json)
- assert account_reference_model != False
-
- # Construct a model instance of AccountReference by calling from_dict on the json representation
- account_reference_model_dict = AccountReference.from_dict(account_reference_model_json).__dict__
- account_reference_model2 = AccountReference(**account_reference_model_dict)
+ # Set up parameter values
+ load_balancer_id = 'testString'
+ listener_id = 'testString'
+ policy_id = 'testString'
- # Verify the model instances are equivalent
- assert account_reference_model == account_reference_model2
+ # Invoke method
+ response = _service.list_load_balancer_listener_policy_rules(
+ load_balancer_id,
+ listener_id,
+ policy_id,
+ headers={},
+ )
- # Convert model instance back to dict and verify no loss of data
- account_reference_model_json2 = account_reference_model.to_dict()
- assert account_reference_model_json2 == account_reference_model_json
+ # Check for correct operation
+ assert len(responses.calls) == 1
+ assert response.status_code == 200
+ 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_list_load_balancer_listener_policy_rules_all_params()
-class TestModel_AddressPrefix:
- """
- Test Class for AddressPrefix
- """
+ # Disable retries and run test_list_load_balancer_listener_policy_rules_all_params.
+ _service.disable_retries()
+ self.test_list_load_balancer_listener_policy_rules_all_params()
- def test_address_prefix_serialization(self):
+ @responses.activate
+ def test_list_load_balancer_listener_policy_rules_value_error(self):
"""
- Test serialization/deserialization for AddressPrefix
+ test_list_load_balancer_listener_policy_rules_value_error()
"""
+ # Set up mock
+ 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,
+ content_type='application/json',
+ status=200,
+ )
- # 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-1'
- 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
+ # Set up parameter values
+ load_balancer_id = 'testString'
+ listener_id = 'testString'
+ policy_id = 'testString'
- # 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)
+ # 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)
- # Verify the model instances are equivalent
- assert address_prefix_model == address_prefix_model2
+ 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()
- # 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
+ # 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 TestModel_AddressPrefixCollection:
+class TestCreateLoadBalancerListenerPolicyRule:
"""
- Test Class for AddressPrefixCollection
+ Test Class for create_load_balancer_listener_policy_rule
"""
- def test_address_prefix_collection_serialization(self):
+ @responses.activate
+ def test_create_load_balancer_listener_policy_rule_all_params(self):
"""
- Test serialization/deserialization for AddressPrefixCollection
+ create_load_balancer_listener_policy_rule()
"""
+ # Set up mock
+ 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,
+ )
- # Construct dict forms of any model objects needed in order to build this model.
+ # Set up parameter values
+ load_balancer_id = 'testString'
+ listener_id = 'testString'
+ policy_id = 'testString'
+ condition = 'contains'
+ type = 'body'
+ value = 'testString'
+ field = 'MY-APP-HEADER'
- 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'
+ # Invoke method
+ response = _service.create_load_balancer_listener_policy_rule(
+ load_balancer_id,
+ listener_id,
+ policy_id,
+ condition,
+ type,
+ value,
+ field=field,
+ headers={},
+ )
- 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-1'
- address_prefix_model['zone'] = zone_reference_model
+ # 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'
- 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'
+ 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_create_load_balancer_listener_policy_rule_all_params()
- 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'
+ # Disable retries and run test_create_load_balancer_listener_policy_rule_all_params.
+ _service.disable_retries()
+ self.test_create_load_balancer_listener_policy_rule_all_params()
- # 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
+ @responses.activate
+ def test_create_load_balancer_listener_policy_rule_value_error(self):
+ """
+ test_create_load_balancer_listener_policy_rule_value_error()
+ """
+ # Set up mock
+ 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,
+ )
- # 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
+ # Set up parameter values
+ load_balancer_id = 'testString'
+ listener_id = 'testString'
+ policy_id = 'testString'
+ condition = 'contains'
+ type = 'body'
+ value = 'testString'
+ field = 'MY-APP-HEADER'
- # 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)
+ # 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)
- # Verify the model instances are equivalent
- assert address_prefix_collection_model == address_prefix_collection_model2
+ 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_create_load_balancer_listener_policy_rule_value_error()
- # 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
+ # Disable retries and run test_create_load_balancer_listener_policy_rule_value_error.
+ _service.disable_retries()
+ self.test_create_load_balancer_listener_policy_rule_value_error()
-class TestModel_AddressPrefixCollectionFirst:
+class TestDeleteLoadBalancerListenerPolicyRule:
+ """
+ Test Class for delete_load_balancer_listener_policy_rule
+ """
+
+ @responses.activate
+ def test_delete_load_balancer_listener_policy_rule_all_params(self):
+ """
+ delete_load_balancer_listener_policy_rule()
+ """
+ # Set up mock
+ url = preprocess_url('/load_balancers/testString/listeners/testString/policies/testString/rules/testString')
+ responses.add(
+ responses.DELETE,
+ url,
+ status=202,
+ )
+
+ # Set up parameter values
+ load_balancer_id = 'testString'
+ listener_id = 'testString'
+ policy_id = 'testString'
+ id = 'testString'
+
+ # Invoke method
+ response = _service.delete_load_balancer_listener_policy_rule(
+ load_balancer_id,
+ listener_id,
+ policy_id,
+ id,
+ headers={},
+ )
+
+ # Check for correct operation
+ assert len(responses.calls) == 1
+ assert response.status_code == 202
+
+ def test_delete_load_balancer_listener_policy_rule_all_params_with_retries(self):
+ # Enable retries and run test_delete_load_balancer_listener_policy_rule_all_params.
+ _service.enable_retries()
+ self.test_delete_load_balancer_listener_policy_rule_all_params()
+
+ # Disable retries and run test_delete_load_balancer_listener_policy_rule_all_params.
+ _service.disable_retries()
+ self.test_delete_load_balancer_listener_policy_rule_all_params()
+
+ @responses.activate
+ def test_delete_load_balancer_listener_policy_rule_value_error(self):
+ """
+ test_delete_load_balancer_listener_policy_rule_value_error()
+ """
+ # Set up mock
+ url = preprocess_url('/load_balancers/testString/listeners/testString/policies/testString/rules/testString')
+ responses.add(
+ responses.DELETE,
+ url,
+ status=202,
+ )
+
+ # 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_load_balancer_listener_policy_rule(**req_copy)
+
+ def test_delete_load_balancer_listener_policy_rule_value_error_with_retries(self):
+ # Enable retries and run test_delete_load_balancer_listener_policy_rule_value_error.
+ _service.enable_retries()
+ self.test_delete_load_balancer_listener_policy_rule_value_error()
+
+ # Disable retries and run test_delete_load_balancer_listener_policy_rule_value_error.
+ _service.disable_retries()
+ self.test_delete_load_balancer_listener_policy_rule_value_error()
+
+
+class TestGetLoadBalancerListenerPolicyRule:
+ """
+ Test Class for get_load_balancer_listener_policy_rule
+ """
+
+ @responses.activate
+ def test_get_load_balancer_listener_policy_rule_all_params(self):
+ """
+ get_load_balancer_listener_policy_rule()
+ """
+ # Set up mock
+ 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,
+ content_type='application/json',
+ status=200,
+ )
+
+ # Set up parameter values
+ load_balancer_id = 'testString'
+ listener_id = 'testString'
+ policy_id = 'testString'
+ id = 'testString'
+
+ # Invoke method
+ response = _service.get_load_balancer_listener_policy_rule(
+ load_balancer_id,
+ listener_id,
+ policy_id,
+ id,
+ headers={},
+ )
+
+ # Check for correct operation
+ assert len(responses.calls) == 1
+ assert response.status_code == 200
+
+ 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_load_balancer_listener_policy_rule_all_params()
+
+ # Disable retries and run test_get_load_balancer_listener_policy_rule_all_params.
+ _service.disable_retries()
+ self.test_get_load_balancer_listener_policy_rule_all_params()
+
+ @responses.activate
+ def test_get_load_balancer_listener_policy_rule_value_error(self):
+ """
+ test_get_load_balancer_listener_policy_rule_value_error()
+ """
+ # Set up mock
+ 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,
+ 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
+ """
+
+ @responses.activate
+ def test_update_load_balancer_listener_policy_rule_all_params(self):
+ """
+ update_load_balancer_listener_policy_rule()
+ """
+ # Set up mock
+ 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 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={},
+ )
+
+ # 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.
+ _service.enable_retries()
+ self.test_update_load_balancer_listener_policy_rule_all_params()
+
+ # Disable retries and run test_update_load_balancer_listener_policy_rule_all_params.
+ _service.disable_retries()
+ self.test_update_load_balancer_listener_policy_rule_all_params()
+
+ @responses.activate
+ def test_update_load_balancer_listener_policy_rule_value_error(self):
+ """
+ test_update_load_balancer_listener_policy_rule_value_error()
+ """
+ # Set up mock
+ 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 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)
+
+ 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_load_balancer_listener_policy_rule_value_error()
+
+ # Disable retries and run test_update_load_balancer_listener_policy_rule_value_error.
+ _service.disable_retries()
+ self.test_update_load_balancer_listener_policy_rule_value_error()
+
+
+class TestListLoadBalancerPools:
+ """
+ Test Class for list_load_balancer_pools
+ """
+
+ @responses.activate
+ def test_list_load_balancer_pools_all_params(self):
+ """
+ list_load_balancer_pools()
+ """
+ # Set up mock
+ 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,
+ )
+
+ # 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):
+ """
+ test_list_load_balancer_pools_value_error()
+ """
+ # Set up mock
+ 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,
+ )
+
+ # 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)
+
+ 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()
+
+ # Disable retries and run test_list_load_balancer_pools_value_error.
+ _service.disable_retries()
+ self.test_list_load_balancer_pools_value_error()
+
+
+class TestCreateLoadBalancerPool:
+ """
+ Test Class for create_load_balancer_pool
+ """
+
+ @responses.activate
+ def test_create_load_balancer_pool_all_params(self):
+ """
+ create_load_balancer_pool()
+ """
+ # Set up mock
+ 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 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'
+
+ # 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
+
+ # Invoke method
+ response = _service.create_load_balancer_pool(
+ load_balancer_id,
+ algorithm,
+ health_monitor,
+ protocol,
+ members=members,
+ name=name,
+ proxy_protocol=proxy_protocol,
+ session_persistence=session_persistence,
+ 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['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_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_load_balancer_pool_all_params()
+
+ # Disable retries and run test_create_load_balancer_pool_all_params.
+ _service.disable_retries()
+ self.test_create_load_balancer_pool_all_params()
+
+ @responses.activate
+ def test_create_load_balancer_pool_value_error(self):
+ """
+ test_create_load_balancer_pool_value_error()
+ """
+ # Set up mock
+ 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 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'
+
+ # 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
+
+ # 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,
+ }
+ 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)
+
+ 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_load_balancer_pool_value_error()
+
+ # Disable retries and run test_create_load_balancer_pool_value_error.
+ _service.disable_retries()
+ self.test_create_load_balancer_pool_value_error()
+
+
+class TestDeleteLoadBalancerPool:
+ """
+ Test Class for delete_load_balancer_pool
+ """
+
+ @responses.activate
+ def test_delete_load_balancer_pool_all_params(self):
+ """
+ delete_load_balancer_pool()
+ """
+ # Set up mock
+ url = preprocess_url('/load_balancers/testString/pools/testString')
+ responses.add(
+ responses.DELETE,
+ url,
+ status=202,
+ )
+
+ # Set up parameter values
+ load_balancer_id = 'testString'
+ id = 'testString'
+
+ # Invoke method
+ response = _service.delete_load_balancer_pool(
+ load_balancer_id,
+ id,
+ headers={},
+ )
+
+ # Check for correct operation
+ assert len(responses.calls) == 1
+ assert response.status_code == 202
+
+ def test_delete_load_balancer_pool_all_params_with_retries(self):
+ # Enable retries and run test_delete_load_balancer_pool_all_params.
+ _service.enable_retries()
+ self.test_delete_load_balancer_pool_all_params()
+
+ # Disable retries and run test_delete_load_balancer_pool_all_params.
+ _service.disable_retries()
+ self.test_delete_load_balancer_pool_all_params()
+
+ @responses.activate
+ def test_delete_load_balancer_pool_value_error(self):
+ """
+ test_delete_load_balancer_pool_value_error()
+ """
+ # Set up mock
+ url = preprocess_url('/load_balancers/testString/pools/testString')
+ responses.add(
+ responses.DELETE,
+ url,
+ status=202,
+ )
+
+ # 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)
+
+ 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_load_balancer_pool_value_error()
+
+ # Disable retries and run test_delete_load_balancer_pool_value_error.
+ _service.disable_retries()
+ self.test_delete_load_balancer_pool_value_error()
+
+
+class TestGetLoadBalancerPool:
+ """
+ Test Class for get_load_balancer_pool
+ """
+
+ @responses.activate
+ def test_get_load_balancer_pool_all_params(self):
+ """
+ get_load_balancer_pool()
+ """
+ # Set up mock
+ 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,
+ content_type='application/json',
+ status=200,
+ )
+
+ # Set up parameter values
+ load_balancer_id = 'testString'
+ id = 'testString'
+
+ # Invoke method
+ response = _service.get_load_balancer_pool(
+ load_balancer_id,
+ id,
+ headers={},
+ )
+
+ # Check for correct operation
+ 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.
+ _service.enable_retries()
+ self.test_get_load_balancer_pool_all_params()
+
+ # Disable retries and run test_get_load_balancer_pool_all_params.
+ _service.disable_retries()
+ self.test_get_load_balancer_pool_all_params()
+
+ @responses.activate
+ def test_get_load_balancer_pool_value_error(self):
+ """
+ test_get_load_balancer_pool_value_error()
+ """
+ # Set up mock
+ 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,
+ content_type='application/json',
+ 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)
+
+ 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_load_balancer_pool_value_error()
+
+ # Disable retries and run test_get_load_balancer_pool_value_error.
+ _service.disable_retries()
+ self.test_get_load_balancer_pool_value_error()
+
+
+class TestUpdateLoadBalancerPool:
+ """
+ Test Class for update_load_balancer_pool
+ """
+
+ @responses.activate
+ def test_update_load_balancer_pool_all_params(self):
+ """
+ update_load_balancer_pool()
+ """
+ # Set up mock
+ 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 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'
+ load_balancer_pool_patch = load_balancer_pool_patch_model
+
+ # Invoke method
+ response = _service.update_load_balancer_pool(
+ load_balancer_id,
+ id,
+ load_balancer_pool_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_patch
+
+ 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_load_balancer_pool_all_params()
+
+ # Disable retries and run test_update_load_balancer_pool_all_params.
+ _service.disable_retries()
+ self.test_update_load_balancer_pool_all_params()
+
+ @responses.activate
+ def test_update_load_balancer_pool_value_error(self):
+ """
+ test_update_load_balancer_pool_value_error()
+ """
+ # Set up mock
+ 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 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'
+ 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,
+ "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_load_balancer_pool(**req_copy)
+
+ def test_update_load_balancer_pool_value_error_with_retries(self):
+ # Enable retries and run test_update_load_balancer_pool_value_error.
+ _service.enable_retries()
+ self.test_update_load_balancer_pool_value_error()
+
+ # Disable retries and run test_update_load_balancer_pool_value_error.
+ _service.disable_retries()
+ 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=202,
+ )
+
+ # 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 == 202
+
+ def test_delete_load_balancer_pool_member_all_params_with_retries(self):
+ # Enable retries and run test_delete_load_balancer_pool_member_all_params.
+ _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=202,
+ )
+
+ # 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": [{"allow_dns_resolution_binding": true, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "r134-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_reasons": [{"code": "dns_resolution_binding_pending", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-endpoint-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "endpoint_gateway", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "service_endpoint": "my-cloudant-instance.appdomain.cloud", "service_endpoints": ["my-cloudant-instance.appdomain.cloud"], "target": {"crn": "crn:v1:bluemix:public:cloudant:us-south:a/123456:3527280b-9327-4411-8020-591092e60353::", "resource_type": "provider_cloud_service"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}], "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 = 50
+ resource_group_id = 'testString'
+ vpc_id = 'testString'
+ vpc_crn = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b'
+ vpc_name = 'my-vpc'
+ allow_dns_resolution_binding = True
+
+ # Invoke method
+ response = _service.list_endpoint_gateways(
+ name=name,
+ start=start,
+ limit=limit,
+ resource_group_id=resource_group_id,
+ vpc_id=vpc_id,
+ vpc_crn=vpc_crn,
+ vpc_name=vpc_name,
+ allow_dns_resolution_binding=allow_dns_resolution_binding,
+ 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
+ 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 'allow_dns_resolution_binding={}'.format('true' if allow_dns_resolution_binding else 'false') 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": [{"allow_dns_resolution_binding": true, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "r134-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_reasons": [{"code": "dns_resolution_binding_pending", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-endpoint-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "endpoint_gateway", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "service_endpoint": "my-cloudant-instance.appdomain.cloud", "service_endpoints": ["my-cloudant-instance.appdomain.cloud"], "target": {"crn": "crn:v1:bluemix:public:cloudant:us-south:a/123456:3527280b-9327-4411-8020-591092e60353::", "resource_type": "provider_cloud_service"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}], "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": [{"allow_dns_resolution_binding": true, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "r134-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_reasons": [{"code": "dns_resolution_binding_pending", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-endpoint-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "endpoint_gateway", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "service_endpoint": "my-cloudant-instance.appdomain.cloud", "service_endpoints": ["my-cloudant-instance.appdomain.cloud"], "target": {"crn": "crn:v1:bluemix:public:cloudant:us-south:a/123456:3527280b-9327-4411-8020-591092e60353::", "resource_type": "provider_cloud_service"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}], "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()
+
+ @responses.activate
+ def test_list_endpoint_gateways_with_pager_get_next(self):
+ """
+ test_list_endpoint_gateways_with_pager_get_next()
+ """
+ # Set up a two-page mock response
+ url = preprocess_url('/endpoint_gateways')
+ mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"endpoint_gateways":[{"allow_dns_resolution_binding":true,"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5","health_state":"ok","href":"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5","id":"r134-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_reasons":[{"code":"dns_resolution_binding_pending","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","name":"my-endpoint-gateway","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"endpoint_gateway","security_groups":[{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271","id":"be5df5ca-12a0-494b-907e-aa6ec2bfa271","name":"my-security-group"}],"service_endpoint":"my-cloudant-instance.appdomain.cloud","service_endpoints":["my-cloudant-instance.appdomain.cloud"],"target":{"crn":"crn:v1:bluemix:public:cloudant:us-south:a/123456:3527280b-9327-4411-8020-591092e60353::","resource_type":"provider_cloud_service"},"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"}}],"total_count":2,"limit":1}'
+ mock_response2 = '{"endpoint_gateways":[{"allow_dns_resolution_binding":true,"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5","health_state":"ok","href":"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5","id":"r134-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_reasons":[{"code":"dns_resolution_binding_pending","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","name":"my-endpoint-gateway","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"endpoint_gateway","security_groups":[{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271","id":"be5df5ca-12a0-494b-907e-aa6ec2bfa271","name":"my-security-group"}],"service_endpoint":"my-cloudant-instance.appdomain.cloud","service_endpoints":["my-cloudant-instance.appdomain.cloud"],"target":{"crn":"crn:v1:bluemix:public:cloudant:us-south:a/123456:3527280b-9327-4411-8020-591092e60353::","resource_type":"provider_cloud_service"},"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"}}],"total_count":2,"limit":1}'
+ responses.add(
+ responses.GET,
+ url,
+ body=mock_response1,
+ content_type='application/json',
+ status=200,
+ )
+ responses.add(
+ responses.GET,
+ url,
+ body=mock_response2,
+ content_type='application/json',
+ status=200,
+ )
+
+ # Exercise the pager class for this operation
+ all_results = []
+ pager = EndpointGatewaysPager(
+ client=_service,
+ name='testString',
+ limit=10,
+ resource_group_id='testString',
+ vpc_id='testString',
+ vpc_crn='crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b',
+ vpc_name='my-vpc',
+ allow_dns_resolution_binding=True,
+ )
+ while pager.has_next():
+ next_page = pager.get_next()
+ assert next_page is not None
+ all_results.extend(next_page)
+ assert len(all_results) == 2
+
+ @responses.activate
+ def test_list_endpoint_gateways_with_pager_get_all(self):
+ """
+ test_list_endpoint_gateways_with_pager_get_all()
+ """
+ # Set up a two-page mock response
+ url = preprocess_url('/endpoint_gateways')
+ mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"endpoint_gateways":[{"allow_dns_resolution_binding":true,"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5","health_state":"ok","href":"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5","id":"r134-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_reasons":[{"code":"dns_resolution_binding_pending","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","name":"my-endpoint-gateway","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"endpoint_gateway","security_groups":[{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271","id":"be5df5ca-12a0-494b-907e-aa6ec2bfa271","name":"my-security-group"}],"service_endpoint":"my-cloudant-instance.appdomain.cloud","service_endpoints":["my-cloudant-instance.appdomain.cloud"],"target":{"crn":"crn:v1:bluemix:public:cloudant:us-south:a/123456:3527280b-9327-4411-8020-591092e60353::","resource_type":"provider_cloud_service"},"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"}}],"total_count":2,"limit":1}'
+ mock_response2 = '{"endpoint_gateways":[{"allow_dns_resolution_binding":true,"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5","health_state":"ok","href":"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5","id":"r134-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_reasons":[{"code":"dns_resolution_binding_pending","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","name":"my-endpoint-gateway","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"endpoint_gateway","security_groups":[{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271","id":"be5df5ca-12a0-494b-907e-aa6ec2bfa271","name":"my-security-group"}],"service_endpoint":"my-cloudant-instance.appdomain.cloud","service_endpoints":["my-cloudant-instance.appdomain.cloud"],"target":{"crn":"crn:v1:bluemix:public:cloudant:us-south:a/123456:3527280b-9327-4411-8020-591092e60353::","resource_type":"provider_cloud_service"},"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"}}],"total_count":2,"limit":1}'
+ responses.add(
+ responses.GET,
+ url,
+ body=mock_response1,
+ content_type='application/json',
+ status=200,
+ )
+ responses.add(
+ responses.GET,
+ url,
+ body=mock_response2,
+ content_type='application/json',
+ status=200,
+ )
+
+ # Exercise the pager class for this operation
+ pager = EndpointGatewaysPager(
+ client=_service,
+ name='testString',
+ limit=10,
+ resource_group_id='testString',
+ vpc_id='testString',
+ vpc_crn='crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b',
+ vpc_name='my-vpc',
+ allow_dns_resolution_binding=True,
+ )
+ all_results = pager.get_all()
+ assert all_results is not None
+ assert len(all_results) == 2
+
+
+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 = '{"allow_dns_resolution_binding": true, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "r134-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_reasons": [{"code": "dns_resolution_binding_pending", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-endpoint-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "endpoint_gateway", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "service_endpoint": "my-cloudant-instance.appdomain.cloud", "service_endpoints": ["my-cloudant-instance.appdomain.cloud"], "target": {"crn": "crn:v1:bluemix:public:cloudant:us-south:a/123456:3527280b-9327-4411-8020-591092e60353::", "resource_type": "provider_cloud_service"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}'
+ 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 EndpointGatewayReservedIPReservedIPIdentityById 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
+ allow_dns_resolution_binding = True
+ 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,
+ allow_dns_resolution_binding=allow_dns_resolution_binding,
+ 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['allow_dns_resolution_binding'] == True
+ 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 = '{"allow_dns_resolution_binding": true, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "r134-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_reasons": [{"code": "dns_resolution_binding_pending", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-endpoint-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "endpoint_gateway", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "service_endpoint": "my-cloudant-instance.appdomain.cloud", "service_endpoints": ["my-cloudant-instance.appdomain.cloud"], "target": {"crn": "crn:v1:bluemix:public:cloudant:us-south:a/123456:3527280b-9327-4411-8020-591092e60353::", "resource_type": "provider_cloud_service"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}'
+ 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 EndpointGatewayReservedIPReservedIPIdentityById 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
+ allow_dns_resolution_binding = True
+ 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", "lifecycle_state": "stable", "name": "my-reserved-ip", "owner": "user", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "name": "my-endpoint-gateway", "resource_type": "endpoint_gateway"}}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/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 = 50
+ 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", "lifecycle_state": "stable", "name": "my-reserved-ip", "owner": "user", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "name": "my-endpoint-gateway", "resource_type": "endpoint_gateway"}}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/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", "lifecycle_state": "stable", "name": "my-reserved-ip", "owner": "user", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "name": "my-endpoint-gateway", "resource_type": "endpoint_gateway"}}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/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()
+
+ @responses.activate
+ def test_list_endpoint_gateway_ips_with_pager_get_next(self):
+ """
+ test_list_endpoint_gateway_ips_with_pager_get_next()
+ """
+ # Set up a two-page mock response
+ url = preprocess_url('/endpoint_gateways/testString/ips')
+ mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"ips":[{"address":"192.168.3.4","auto_delete":false,"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","lifecycle_state":"stable","name":"my-reserved-ip","owner":"user","resource_type":"subnet_reserved_ip","target":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5","id":"r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5","name":"my-endpoint-gateway","resource_type":"endpoint_gateway"}}]}'
+ mock_response2 = '{"total_count":2,"limit":1,"ips":[{"address":"192.168.3.4","auto_delete":false,"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","lifecycle_state":"stable","name":"my-reserved-ip","owner":"user","resource_type":"subnet_reserved_ip","target":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5","id":"r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5","name":"my-endpoint-gateway","resource_type":"endpoint_gateway"}}]}'
+ responses.add(
+ responses.GET,
+ url,
+ body=mock_response1,
+ content_type='application/json',
+ status=200,
+ )
+ responses.add(
+ responses.GET,
+ url,
+ body=mock_response2,
+ content_type='application/json',
+ status=200,
+ )
+
+ # Exercise the pager class for this operation
+ all_results = []
+ pager = EndpointGatewayIpsPager(
+ client=_service,
+ endpoint_gateway_id='testString',
+ limit=10,
+ sort='name',
+ )
+ while pager.has_next():
+ next_page = pager.get_next()
+ assert next_page is not None
+ all_results.extend(next_page)
+ assert len(all_results) == 2
+
+ @responses.activate
+ def test_list_endpoint_gateway_ips_with_pager_get_all(self):
+ """
+ test_list_endpoint_gateway_ips_with_pager_get_all()
+ """
+ # Set up a two-page mock response
+ url = preprocess_url('/endpoint_gateways/testString/ips')
+ mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"ips":[{"address":"192.168.3.4","auto_delete":false,"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","lifecycle_state":"stable","name":"my-reserved-ip","owner":"user","resource_type":"subnet_reserved_ip","target":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5","id":"r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5","name":"my-endpoint-gateway","resource_type":"endpoint_gateway"}}]}'
+ mock_response2 = '{"total_count":2,"limit":1,"ips":[{"address":"192.168.3.4","auto_delete":false,"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","lifecycle_state":"stable","name":"my-reserved-ip","owner":"user","resource_type":"subnet_reserved_ip","target":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5","id":"r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5","name":"my-endpoint-gateway","resource_type":"endpoint_gateway"}}]}'
+ responses.add(
+ responses.GET,
+ url,
+ body=mock_response1,
+ content_type='application/json',
+ status=200,
+ )
+ responses.add(
+ responses.GET,
+ url,
+ body=mock_response2,
+ content_type='application/json',
+ status=200,
+ )
+
+ # Exercise the pager class for this operation
+ pager = EndpointGatewayIpsPager(
+ client=_service,
+ endpoint_gateway_id='testString',
+ limit=10,
+ sort='name',
+ )
+ all_results = pager.get_all()
+ assert all_results is not None
+ assert len(all_results) == 2
+
+
+class TestRemoveEndpointGatewayIp:
+ """
+ Test Class for remove_endpoint_gateway_ip
+ """
+
+ @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", "lifecycle_state": "stable", "name": "my-reserved-ip", "owner": "user", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "name": "my-endpoint-gateway", "resource_type": "endpoint_gateway"}}'
+ 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", "lifecycle_state": "stable", "name": "my-reserved-ip", "owner": "user", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "name": "my-endpoint-gateway", "resource_type": "endpoint_gateway"}}'
+ 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", "lifecycle_state": "stable", "name": "my-reserved-ip", "owner": "user", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "name": "my-endpoint-gateway", "resource_type": "endpoint_gateway"}}'
+ 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", "lifecycle_state": "stable", "name": "my-reserved-ip", "owner": "user", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "name": "my-endpoint-gateway", "resource_type": "endpoint_gateway"}}'
+ 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 = '{"allow_dns_resolution_binding": true, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "r134-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_reasons": [{"code": "dns_resolution_binding_pending", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-endpoint-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "endpoint_gateway", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "service_endpoint": "my-cloudant-instance.appdomain.cloud", "service_endpoints": ["my-cloudant-instance.appdomain.cloud"], "target": {"crn": "crn:v1:bluemix:public:cloudant:us-south:a/123456:3527280b-9327-4411-8020-591092e60353::", "resource_type": "provider_cloud_service"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}'
+ 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 = '{"allow_dns_resolution_binding": true, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "r134-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_reasons": [{"code": "dns_resolution_binding_pending", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-endpoint-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "endpoint_gateway", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "service_endpoint": "my-cloudant-instance.appdomain.cloud", "service_endpoints": ["my-cloudant-instance.appdomain.cloud"], "target": {"crn": "crn:v1:bluemix:public:cloudant:us-south:a/123456:3527280b-9327-4411-8020-591092e60353::", "resource_type": "provider_cloud_service"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}'
+ 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 = '{"allow_dns_resolution_binding": true, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "r134-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_reasons": [{"code": "dns_resolution_binding_pending", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-endpoint-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "endpoint_gateway", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "service_endpoint": "my-cloudant-instance.appdomain.cloud", "service_endpoints": ["my-cloudant-instance.appdomain.cloud"], "target": {"crn": "crn:v1:bluemix:public:cloudant:us-south:a/123456:3527280b-9327-4411-8020-591092e60353::", "resource_type": "provider_cloud_service"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}'
+ 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['allow_dns_resolution_binding'] = True
+ 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 = '{"allow_dns_resolution_binding": true, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "r134-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_reasons": [{"code": "dns_resolution_binding_pending", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "name": "my-endpoint-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "endpoint_gateway", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "service_endpoint": "my-cloudant-instance.appdomain.cloud", "service_endpoints": ["my-cloudant-instance.appdomain.cloud"], "target": {"crn": "crn:v1:bluemix:public:cloudant:us-south:a/123456:3527280b-9327-4411-8020-591092e60353::", "resource_type": "provider_cloud_service"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}'
+ 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['allow_dns_resolution_binding'] = True
+ 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-instance-network-interface", "resource_type": "network_interface"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}'
+ responses.add(
+ responses.GET,
+ url,
+ body=mock_response,
+ content_type='application/json',
+ status=200,
+ )
+
+ # Set up parameter values
+ start = 'testString'
+ limit = 50
+ resource_group_id = 'testString'
+ name = 'testString'
+ vpc_id = 'testString'
+ vpc_crn = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b'
+ vpc_name = 'my-vpc'
+ target_id = 'testString'
+ target_resource_type = '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,
+ 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-instance-network-interface", "resource_type": "network_interface"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}'
+ responses.add(
+ responses.GET,
+ url,
+ 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-instance-network-interface", "resource_type": "network_interface"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}'
+ responses.add(
+ responses.GET,
+ url,
+ 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()
+
+ @responses.activate
+ def test_list_flow_log_collectors_with_pager_get_next(self):
+ """
+ test_list_flow_log_collectors_with_pager_get_next()
+ """
+ # Set up a two-page mock response
+ url = preprocess_url('/flow_log_collectors')
+ mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"flow_log_collectors":[{"active":true,"auto_delete":true,"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::flow-log-collector:39300233-9995-4806-89a5-3c1b6eb88689","href":"https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors/39300233-9995-4806-89a5-3c1b6eb88689","id":"39300233-9995-4806-89a5-3c1b6eb88689","lifecycle_state":"stable","name":"my-flow-log-collector","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"storage_bucket":{"name":"bucket-27200-lwx4cfvcue"},"target":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-instance-network-interface","resource_type":"network_interface"},"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"}}]}'
+ mock_response2 = '{"total_count":2,"limit":1,"flow_log_collectors":[{"active":true,"auto_delete":true,"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::flow-log-collector:39300233-9995-4806-89a5-3c1b6eb88689","href":"https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors/39300233-9995-4806-89a5-3c1b6eb88689","id":"39300233-9995-4806-89a5-3c1b6eb88689","lifecycle_state":"stable","name":"my-flow-log-collector","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"storage_bucket":{"name":"bucket-27200-lwx4cfvcue"},"target":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-instance-network-interface","resource_type":"network_interface"},"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"}}]}'
+ responses.add(
+ responses.GET,
+ url,
+ body=mock_response1,
+ content_type='application/json',
+ status=200,
+ )
+ responses.add(
+ responses.GET,
+ url,
+ body=mock_response2,
+ content_type='application/json',
+ status=200,
+ )
+
+ # Exercise the pager class for this operation
+ all_results = []
+ pager = FlowLogCollectorsPager(
+ client=_service,
+ limit=10,
+ resource_group_id='testString',
+ name='testString',
+ vpc_id='testString',
+ vpc_crn='crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b',
+ vpc_name='my-vpc',
+ target_id='testString',
+ target_resource_type='testString',
+ )
+ while pager.has_next():
+ next_page = pager.get_next()
+ assert next_page is not None
+ all_results.extend(next_page)
+ assert len(all_results) == 2
+
+ @responses.activate
+ def test_list_flow_log_collectors_with_pager_get_all(self):
+ """
+ test_list_flow_log_collectors_with_pager_get_all()
+ """
+ # Set up a two-page mock response
+ url = preprocess_url('/flow_log_collectors')
+ mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"flow_log_collectors":[{"active":true,"auto_delete":true,"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::flow-log-collector:39300233-9995-4806-89a5-3c1b6eb88689","href":"https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors/39300233-9995-4806-89a5-3c1b6eb88689","id":"39300233-9995-4806-89a5-3c1b6eb88689","lifecycle_state":"stable","name":"my-flow-log-collector","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"storage_bucket":{"name":"bucket-27200-lwx4cfvcue"},"target":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-instance-network-interface","resource_type":"network_interface"},"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"}}]}'
+ mock_response2 = '{"total_count":2,"limit":1,"flow_log_collectors":[{"active":true,"auto_delete":true,"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::flow-log-collector:39300233-9995-4806-89a5-3c1b6eb88689","href":"https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors/39300233-9995-4806-89a5-3c1b6eb88689","id":"39300233-9995-4806-89a5-3c1b6eb88689","lifecycle_state":"stable","name":"my-flow-log-collector","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"storage_bucket":{"name":"bucket-27200-lwx4cfvcue"},"target":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-instance-network-interface","resource_type":"network_interface"},"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"}}]}'
+ responses.add(
+ responses.GET,
+ url,
+ body=mock_response1,
+ content_type='application/json',
+ status=200,
+ )
+ responses.add(
+ responses.GET,
+ url,
+ body=mock_response2,
+ content_type='application/json',
+ status=200,
+ )
+
+ # Exercise the pager class for this operation
+ pager = FlowLogCollectorsPager(
+ client=_service,
+ limit=10,
+ resource_group_id='testString',
+ name='testString',
+ vpc_id='testString',
+ vpc_crn='crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b',
+ vpc_name='my-vpc',
+ target_id='testString',
+ target_resource_type='testString',
+ )
+ all_results = pager.get_all()
+ assert all_results is not None
+ assert len(all_results) == 2
+
+
+class TestCreateFlowLogCollector:
+ """
+ Test Class for create_flow_log_collector
+ """
+
+ @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-instance-network-interface", "resource_type": "network_interface"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}'
+ responses.add(
+ responses.POST,
+ url,
+ body=mock_response,
+ content_type='application/json',
+ status=201,
+ )
+
+ # Construct a dict representation of a LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName model
+ legacy_cloud_object_storage_bucket_identity_model = {}
+ legacy_cloud_object_storage_bucket_identity_model['name'] = 'bucket-27200-lwx4cfvcue'
+
+ # Construct a dict representation of a FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityById 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 = legacy_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'] == legacy_cloud_object_storage_bucket_identity_model
+ assert req_body['target'] == flow_log_collector_target_prototype_model
+ assert req_body['active'] == False
+ assert req_body['name'] == 'my-flow-log-collector'
+ 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-instance-network-interface", "resource_type": "network_interface"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}'
+ responses.add(
+ responses.POST,
+ url,
+ body=mock_response,
+ content_type='application/json',
+ status=201,
+ )
+
+ # Construct a dict representation of a LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName model
+ legacy_cloud_object_storage_bucket_identity_model = {}
+ legacy_cloud_object_storage_bucket_identity_model['name'] = 'bucket-27200-lwx4cfvcue'
+
+ # Construct a dict representation of a FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityById 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 = legacy_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-instance-network-interface", "resource_type": "network_interface"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}'
+ responses.add(
+ responses.GET,
+ url,
+ 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-instance-network-interface", "resource_type": "network_interface"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}'
+ responses.add(
+ responses.GET,
+ url,
+ 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-instance-network-interface", "resource_type": "network_interface"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}'
+ responses.add(
+ responses.PATCH,
+ url,
+ 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-instance-network-interface", "resource_type": "network_interface"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}'
+ responses.add(
+ responses.PATCH,
+ url,
+ 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_AccountReference:
+ """
+ Test Class for AccountReference
+ """
+
+ def test_account_reference_serialization(self):
+ """
+ Test serialization/deserialization for AccountReference
+ """
+
+ # Construct a json representation of a AccountReference model
+ account_reference_model_json = {}
+ account_reference_model_json['id'] = 'aa2432b1fa4d4ace891e9b80fc104e34'
+ account_reference_model_json['resource_type'] = 'account'
+
+ # Construct a model instance of AccountReference by calling from_dict on the json representation
+ account_reference_model = AccountReference.from_dict(account_reference_model_json)
+ assert account_reference_model != False
+
+ # Construct a model instance of AccountReference by calling from_dict on the json representation
+ account_reference_model_dict = AccountReference.from_dict(account_reference_model_json).__dict__
+ account_reference_model2 = AccountReference(**account_reference_model_dict)
+
+ # Verify the model instances are equivalent
+ assert account_reference_model == account_reference_model2
+
+ # Convert model instance back to dict and verify no loss of data
+ account_reference_model_json2 = account_reference_model.to_dict()
+ assert account_reference_model_json2 == account_reference_model_json
+
+
+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-1'
+ 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-1'
+ 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):
+ 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-1'
+
+ # Construct a model instance of AddressPrefixPatch by calling from_dict on the json representation
+ address_prefix_patch_model = AddressPrefixPatch.from_dict(address_prefix_patch_model_json)
+ 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_BackupPolicyCollection:
+ """
+ Test Class for BackupPolicyCollection
+ """
+
+ def test_backup_policy_collection_serialization(self):
+ """
+ Test serialization/deserialization for BackupPolicyCollection
+ """
+
+ # Construct dict forms of any model objects needed in order to build this model.
+
+ backup_policy_health_reason_model = {} # BackupPolicyHealthReason
+ backup_policy_health_reason_model['code'] = 'missing_service_authorization_policies'
+ backup_policy_health_reason_model['message'] = 'One or more accounts are missing service authorization policies'
+ backup_policy_health_reason_model['more_info'] = 'https://cloud.ibm.com/docs/vpc?topic=vpc-backup-service-about&interface=ui'
+
+ backup_policy_plan_reference_deleted_model = {} # BackupPolicyPlanReferenceDeleted
+ backup_policy_plan_reference_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'
+
+ backup_policy_plan_remote_model = {} # BackupPolicyPlanRemote
+ backup_policy_plan_remote_model['region'] = region_reference_model
+
+ backup_policy_plan_reference_model = {} # BackupPolicyPlanReference
+ backup_policy_plan_reference_model['deleted'] = backup_policy_plan_reference_deleted_model
+ backup_policy_plan_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178'
+ backup_policy_plan_reference_model['id'] = 'r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178'
+ backup_policy_plan_reference_model['name'] = 'my-policy-plan'
+ backup_policy_plan_reference_model['remote'] = backup_policy_plan_remote_model
+ backup_policy_plan_reference_model['resource_type'] = 'backup_policy_plan'
+
+ 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'
+
+ backup_policy_scope_model = {} # BackupPolicyScopeEnterpriseReference
+ backup_policy_scope_model['crn'] = 'crn:v1:bluemix:public:enterprise::a/123456::enterprise:ebc2b430240943458b9e91e1432cfcce'
+ backup_policy_scope_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
+ backup_policy_scope_model['resource_type'] = 'enterprise'
+
+ backup_policy_model = {} # BackupPolicyMatchResourceTypeInstance
+ backup_policy_model['created_at'] = '2019-01-01T12:00:00Z'
+ backup_policy_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::backup-policy:r134-076191ba-49c2-4763-94fd-c70de73ee2e6'
+ backup_policy_model['health_reasons'] = [backup_policy_health_reason_model]
+ backup_policy_model['health_state'] = 'ok'
+ backup_policy_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6'
+ backup_policy_model['id'] = 'r134-076191ba-49c2-4763-94fd-c70de73ee2e6'
+ backup_policy_model['last_job_completed_at'] = '2019-01-01T12:00:00Z'
+ backup_policy_model['lifecycle_state'] = 'stable'
+ backup_policy_model['match_user_tags'] = ['my-daily-backup-policy']
+ backup_policy_model['name'] = 'my-backup-policy'
+ backup_policy_model['plans'] = [backup_policy_plan_reference_model]
+ backup_policy_model['resource_group'] = resource_group_reference_model
+ backup_policy_model['resource_type'] = 'backup_policy'
+ backup_policy_model['scope'] = backup_policy_scope_model
+ backup_policy_model['included_content'] = ['data_volumes']
+ backup_policy_model['match_resource_type'] = 'instance'
+
+ backup_policy_collection_first_model = {} # BackupPolicyCollectionFirst
+ backup_policy_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/backup_policies?limit=20'
+
+ backup_policy_collection_next_model = {} # BackupPolicyCollectionNext
+ backup_policy_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/backup_policies?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
+
+ # Construct a json representation of a BackupPolicyCollection model
+ backup_policy_collection_model_json = {}
+ backup_policy_collection_model_json['backup_policies'] = [backup_policy_model]
+ backup_policy_collection_model_json['first'] = backup_policy_collection_first_model
+ backup_policy_collection_model_json['limit'] = 20
+ backup_policy_collection_model_json['next'] = backup_policy_collection_next_model
+ backup_policy_collection_model_json['total_count'] = 132
+
+ # Construct a model instance of BackupPolicyCollection by calling from_dict on the json representation
+ backup_policy_collection_model = BackupPolicyCollection.from_dict(backup_policy_collection_model_json)
+ assert backup_policy_collection_model != False
+
+ # Construct a model instance of BackupPolicyCollection by calling from_dict on the json representation
+ backup_policy_collection_model_dict = BackupPolicyCollection.from_dict(backup_policy_collection_model_json).__dict__
+ backup_policy_collection_model2 = BackupPolicyCollection(**backup_policy_collection_model_dict)
+
+ # Verify the model instances are equivalent
+ assert backup_policy_collection_model == backup_policy_collection_model2
+
+ # Convert model instance back to dict and verify no loss of data
+ backup_policy_collection_model_json2 = backup_policy_collection_model.to_dict()
+ assert backup_policy_collection_model_json2 == backup_policy_collection_model_json
+
+
+class TestModel_BackupPolicyCollectionFirst:
+ """
+ Test Class for BackupPolicyCollectionFirst
+ """
+
+ def test_backup_policy_collection_first_serialization(self):
+ """
+ Test serialization/deserialization for BackupPolicyCollectionFirst
+ """
+
+ # Construct a json representation of a BackupPolicyCollectionFirst model
+ backup_policy_collection_first_model_json = {}
+ backup_policy_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/backup_policies?limit=20'
+
+ # Construct a model instance of BackupPolicyCollectionFirst by calling from_dict on the json representation
+ backup_policy_collection_first_model = BackupPolicyCollectionFirst.from_dict(backup_policy_collection_first_model_json)
+ assert backup_policy_collection_first_model != False
+
+ # Construct a model instance of BackupPolicyCollectionFirst by calling from_dict on the json representation
+ backup_policy_collection_first_model_dict = BackupPolicyCollectionFirst.from_dict(backup_policy_collection_first_model_json).__dict__
+ backup_policy_collection_first_model2 = BackupPolicyCollectionFirst(**backup_policy_collection_first_model_dict)
+
+ # Verify the model instances are equivalent
+ assert backup_policy_collection_first_model == backup_policy_collection_first_model2
+
+ # Convert model instance back to dict and verify no loss of data
+ backup_policy_collection_first_model_json2 = backup_policy_collection_first_model.to_dict()
+ assert backup_policy_collection_first_model_json2 == backup_policy_collection_first_model_json
+
+
+class TestModel_BackupPolicyCollectionNext:
+ """
+ Test Class for BackupPolicyCollectionNext
+ """
+
+ def test_backup_policy_collection_next_serialization(self):
+ """
+ Test serialization/deserialization for BackupPolicyCollectionNext
+ """
+
+ # Construct a json representation of a BackupPolicyCollectionNext model
+ backup_policy_collection_next_model_json = {}
+ backup_policy_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/backup_policies?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
+
+ # Construct a model instance of BackupPolicyCollectionNext by calling from_dict on the json representation
+ backup_policy_collection_next_model = BackupPolicyCollectionNext.from_dict(backup_policy_collection_next_model_json)
+ assert backup_policy_collection_next_model != False
+
+ # Construct a model instance of BackupPolicyCollectionNext by calling from_dict on the json representation
+ backup_policy_collection_next_model_dict = BackupPolicyCollectionNext.from_dict(backup_policy_collection_next_model_json).__dict__
+ backup_policy_collection_next_model2 = BackupPolicyCollectionNext(**backup_policy_collection_next_model_dict)
+
+ # Verify the model instances are equivalent
+ assert backup_policy_collection_next_model == backup_policy_collection_next_model2
+
+ # Convert model instance back to dict and verify no loss of data
+ backup_policy_collection_next_model_json2 = backup_policy_collection_next_model.to_dict()
+ assert backup_policy_collection_next_model_json2 == backup_policy_collection_next_model_json
+
+
+class TestModel_BackupPolicyHealthReason:
+ """
+ Test Class for BackupPolicyHealthReason
+ """
+
+ def test_backup_policy_health_reason_serialization(self):
+ """
+ Test serialization/deserialization for BackupPolicyHealthReason
+ """
+
+ # Construct a json representation of a BackupPolicyHealthReason model
+ backup_policy_health_reason_model_json = {}
+ backup_policy_health_reason_model_json['code'] = 'missing_service_authorization_policies'
+ backup_policy_health_reason_model_json['message'] = 'One or more accounts are missing service authorization policies'
+ backup_policy_health_reason_model_json['more_info'] = 'https://cloud.ibm.com/docs/vpc?topic=vpc-backup-service-about&interface=ui'
+
+ # Construct a model instance of BackupPolicyHealthReason by calling from_dict on the json representation
+ backup_policy_health_reason_model = BackupPolicyHealthReason.from_dict(backup_policy_health_reason_model_json)
+ assert backup_policy_health_reason_model != False
+
+ # Construct a model instance of BackupPolicyHealthReason by calling from_dict on the json representation
+ backup_policy_health_reason_model_dict = BackupPolicyHealthReason.from_dict(backup_policy_health_reason_model_json).__dict__
+ backup_policy_health_reason_model2 = BackupPolicyHealthReason(**backup_policy_health_reason_model_dict)
+
+ # Verify the model instances are equivalent
+ assert backup_policy_health_reason_model == backup_policy_health_reason_model2
+
+ # Convert model instance back to dict and verify no loss of data
+ backup_policy_health_reason_model_json2 = backup_policy_health_reason_model.to_dict()
+ assert backup_policy_health_reason_model_json2 == backup_policy_health_reason_model_json
+
+
+class TestModel_BackupPolicyJob:
+ """
+ Test Class for BackupPolicyJob
+ """
+
+ def test_backup_policy_job_serialization(self):
+ """
+ Test serialization/deserialization for BackupPolicyJob
+ """
+
+ # Construct dict forms of any model objects needed in order to build this model.
+
+ backup_policy_plan_reference_deleted_model = {} # BackupPolicyPlanReferenceDeleted
+ backup_policy_plan_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+
+ 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'
+
+ backup_policy_plan_remote_model = {} # BackupPolicyPlanRemote
+ backup_policy_plan_remote_model['region'] = region_reference_model
+
+ backup_policy_plan_reference_model = {} # BackupPolicyPlanReference
+ backup_policy_plan_reference_model['deleted'] = backup_policy_plan_reference_deleted_model
+ backup_policy_plan_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178'
+ backup_policy_plan_reference_model['id'] = 'r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178'
+ backup_policy_plan_reference_model['name'] = 'my-policy-plan'
+ backup_policy_plan_reference_model['remote'] = backup_policy_plan_remote_model
+ backup_policy_plan_reference_model['resource_type'] = 'backup_policy_plan'
+
+ volume_reference_deleted_model = {} # VolumeReferenceDeleted
+ volume_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+
+ volume_remote_model = {} # VolumeRemote
+ volume_remote_model['region'] = region_reference_model
+
+ backup_policy_job_source_model = {} # BackupPolicyJobSourceVolumeReference
+ backup_policy_job_source_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
+ backup_policy_job_source_model['deleted'] = volume_reference_deleted_model
+ backup_policy_job_source_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
+ backup_policy_job_source_model['id'] = '1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
+ backup_policy_job_source_model['name'] = 'my-volume'
+ backup_policy_job_source_model['remote'] = volume_remote_model
+ backup_policy_job_source_model['resource_type'] = 'volume'
+
+ backup_policy_job_status_reason_model = {} # BackupPolicyJobStatusReason
+ backup_policy_job_status_reason_model['code'] = 'source_volume_busy'
+ backup_policy_job_status_reason_model['message'] = 'testString'
+ backup_policy_job_status_reason_model['more_info'] = 'https://cloud.ibm.com/docs/vpc?topic=vpc-troubleshooting-backup-for-vpc'
+
+ snapshot_reference_deleted_model = {} # SnapshotReferenceDeleted
+ snapshot_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+
+ snapshot_remote_model = {} # SnapshotRemote
+ snapshot_remote_model['region'] = region_reference_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['remote'] = snapshot_remote_model
+ snapshot_reference_model['resource_type'] = 'snapshot'
+
+ # Construct a json representation of a BackupPolicyJob model
+ backup_policy_job_model_json = {}
+ backup_policy_job_model_json['auto_delete'] = True
+ backup_policy_job_model_json['auto_delete_after'] = 90
+ backup_policy_job_model_json['backup_policy_plan'] = backup_policy_plan_reference_model
+ backup_policy_job_model_json['completed_at'] = '2019-01-01T12:00:00Z'
+ backup_policy_job_model_json['created_at'] = '2019-01-01T12:00:00Z'
+ backup_policy_job_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/backup_policies/0fe9e5d8-0a4d-4818-96ec-e99708644a58/jobs/4cf9171a-0043-4434-8727-15b53dbc374c'
+ backup_policy_job_model_json['id'] = '4cf9171a-0043-4434-8727-15b53dbc374c'
+ backup_policy_job_model_json['job_type'] = 'creation'
+ backup_policy_job_model_json['resource_type'] = 'backup_policy_job'
+ backup_policy_job_model_json['source'] = backup_policy_job_source_model
+ backup_policy_job_model_json['status'] = 'failed'
+ backup_policy_job_model_json['status_reasons'] = [backup_policy_job_status_reason_model]
+ backup_policy_job_model_json['target_snapshots'] = [snapshot_reference_model]
+
+ # Construct a model instance of BackupPolicyJob by calling from_dict on the json representation
+ backup_policy_job_model = BackupPolicyJob.from_dict(backup_policy_job_model_json)
+ assert backup_policy_job_model != False
+
+ # Construct a model instance of BackupPolicyJob by calling from_dict on the json representation
+ backup_policy_job_model_dict = BackupPolicyJob.from_dict(backup_policy_job_model_json).__dict__
+ backup_policy_job_model2 = BackupPolicyJob(**backup_policy_job_model_dict)
+
+ # Verify the model instances are equivalent
+ assert backup_policy_job_model == backup_policy_job_model2
+
+ # Convert model instance back to dict and verify no loss of data
+ backup_policy_job_model_json2 = backup_policy_job_model.to_dict()
+ assert backup_policy_job_model_json2 == backup_policy_job_model_json
+
+
+class TestModel_BackupPolicyJobCollection:
+ """
+ Test Class for BackupPolicyJobCollection
+ """
+
+ def test_backup_policy_job_collection_serialization(self):
+ """
+ Test serialization/deserialization for BackupPolicyJobCollection
+ """
+
+ # Construct dict forms of any model objects needed in order to build this model.
+
+ backup_policy_job_collection_first_model = {} # BackupPolicyJobCollectionFirst
+ backup_policy_job_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/backup_policies/7241e2a8-601f-11ea-8503-000c29475bed/jobs?limit=20'
+
+ backup_policy_plan_reference_deleted_model = {} # BackupPolicyPlanReferenceDeleted
+ backup_policy_plan_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+
+ 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'
+
+ backup_policy_plan_remote_model = {} # BackupPolicyPlanRemote
+ backup_policy_plan_remote_model['region'] = region_reference_model
+
+ backup_policy_plan_reference_model = {} # BackupPolicyPlanReference
+ backup_policy_plan_reference_model['deleted'] = backup_policy_plan_reference_deleted_model
+ backup_policy_plan_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178'
+ backup_policy_plan_reference_model['id'] = 'r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178'
+ backup_policy_plan_reference_model['name'] = 'my-policy-plan'
+ backup_policy_plan_reference_model['remote'] = backup_policy_plan_remote_model
+ backup_policy_plan_reference_model['resource_type'] = 'backup_policy_plan'
+
+ volume_reference_deleted_model = {} # VolumeReferenceDeleted
+ volume_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+
+ volume_remote_model = {} # VolumeRemote
+ volume_remote_model['region'] = region_reference_model
+
+ backup_policy_job_source_model = {} # BackupPolicyJobSourceVolumeReference
+ backup_policy_job_source_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
+ backup_policy_job_source_model['deleted'] = volume_reference_deleted_model
+ backup_policy_job_source_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
+ backup_policy_job_source_model['id'] = '1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
+ backup_policy_job_source_model['name'] = 'my-volume'
+ backup_policy_job_source_model['remote'] = volume_remote_model
+ backup_policy_job_source_model['resource_type'] = 'volume'
+
+ backup_policy_job_status_reason_model = {} # BackupPolicyJobStatusReason
+ backup_policy_job_status_reason_model['code'] = 'source_volume_busy'
+ backup_policy_job_status_reason_model['message'] = 'testString'
+ backup_policy_job_status_reason_model['more_info'] = 'https://cloud.ibm.com/docs/vpc?topic=vpc-troubleshooting-backup-for-vpc'
+
+ snapshot_reference_deleted_model = {} # SnapshotReferenceDeleted
+ snapshot_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+
+ snapshot_remote_model = {} # SnapshotRemote
+ snapshot_remote_model['region'] = region_reference_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['remote'] = snapshot_remote_model
+ snapshot_reference_model['resource_type'] = 'snapshot'
+
+ backup_policy_job_model = {} # BackupPolicyJob
+ backup_policy_job_model['auto_delete'] = True
+ backup_policy_job_model['auto_delete_after'] = 90
+ backup_policy_job_model['backup_policy_plan'] = backup_policy_plan_reference_model
+ backup_policy_job_model['completed_at'] = '2019-01-01T12:00:00Z'
+ backup_policy_job_model['created_at'] = '2019-01-01T12:00:00Z'
+ backup_policy_job_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/backup_policies/0fe9e5d8-0a4d-4818-96ec-e99708644a58/jobs/4cf9171a-0043-4434-8727-15b53dbc374c'
+ backup_policy_job_model['id'] = '4cf9171a-0043-4434-8727-15b53dbc374c'
+ backup_policy_job_model['job_type'] = 'creation'
+ backup_policy_job_model['resource_type'] = 'backup_policy_job'
+ backup_policy_job_model['source'] = backup_policy_job_source_model
+ backup_policy_job_model['status'] = 'failed'
+ backup_policy_job_model['status_reasons'] = [backup_policy_job_status_reason_model]
+ backup_policy_job_model['target_snapshots'] = [snapshot_reference_model]
+
+ backup_policy_job_collection_next_model = {} # BackupPolicyJobCollectionNext
+ backup_policy_job_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/backup_policies/7241e2a8-601f-11ea-8503-000c29475bed/jobss?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
+
+ # Construct a json representation of a BackupPolicyJobCollection model
+ backup_policy_job_collection_model_json = {}
+ backup_policy_job_collection_model_json['first'] = backup_policy_job_collection_first_model
+ backup_policy_job_collection_model_json['jobs'] = [backup_policy_job_model]
+ backup_policy_job_collection_model_json['limit'] = 20
+ backup_policy_job_collection_model_json['next'] = backup_policy_job_collection_next_model
+ backup_policy_job_collection_model_json['total_count'] = 132
+
+ # Construct a model instance of BackupPolicyJobCollection by calling from_dict on the json representation
+ backup_policy_job_collection_model = BackupPolicyJobCollection.from_dict(backup_policy_job_collection_model_json)
+ assert backup_policy_job_collection_model != False
+
+ # Construct a model instance of BackupPolicyJobCollection by calling from_dict on the json representation
+ backup_policy_job_collection_model_dict = BackupPolicyJobCollection.from_dict(backup_policy_job_collection_model_json).__dict__
+ backup_policy_job_collection_model2 = BackupPolicyJobCollection(**backup_policy_job_collection_model_dict)
+
+ # Verify the model instances are equivalent
+ assert backup_policy_job_collection_model == backup_policy_job_collection_model2
+
+ # Convert model instance back to dict and verify no loss of data
+ backup_policy_job_collection_model_json2 = backup_policy_job_collection_model.to_dict()
+ assert backup_policy_job_collection_model_json2 == backup_policy_job_collection_model_json
+
+
+class TestModel_BackupPolicyJobCollectionFirst:
+ """
+ Test Class for BackupPolicyJobCollectionFirst
+ """
+
+ def test_backup_policy_job_collection_first_serialization(self):
+ """
+ Test serialization/deserialization for BackupPolicyJobCollectionFirst
+ """
+
+ # Construct a json representation of a BackupPolicyJobCollectionFirst model
+ backup_policy_job_collection_first_model_json = {}
+ backup_policy_job_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/backup_policies/7241e2a8-601f-11ea-8503-000c29475bed/jobs?limit=20'
+
+ # Construct a model instance of BackupPolicyJobCollectionFirst by calling from_dict on the json representation
+ backup_policy_job_collection_first_model = BackupPolicyJobCollectionFirst.from_dict(backup_policy_job_collection_first_model_json)
+ assert backup_policy_job_collection_first_model != False
+
+ # Construct a model instance of BackupPolicyJobCollectionFirst by calling from_dict on the json representation
+ backup_policy_job_collection_first_model_dict = BackupPolicyJobCollectionFirst.from_dict(backup_policy_job_collection_first_model_json).__dict__
+ backup_policy_job_collection_first_model2 = BackupPolicyJobCollectionFirst(**backup_policy_job_collection_first_model_dict)
+
+ # Verify the model instances are equivalent
+ assert backup_policy_job_collection_first_model == backup_policy_job_collection_first_model2
+
+ # Convert model instance back to dict and verify no loss of data
+ backup_policy_job_collection_first_model_json2 = backup_policy_job_collection_first_model.to_dict()
+ assert backup_policy_job_collection_first_model_json2 == backup_policy_job_collection_first_model_json
+
+
+class TestModel_BackupPolicyJobCollectionNext:
+ """
+ Test Class for BackupPolicyJobCollectionNext
+ """
+
+ def test_backup_policy_job_collection_next_serialization(self):
+ """
+ Test serialization/deserialization for BackupPolicyJobCollectionNext
+ """
+
+ # Construct a json representation of a BackupPolicyJobCollectionNext model
+ backup_policy_job_collection_next_model_json = {}
+ backup_policy_job_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/backup_policies/7241e2a8-601f-11ea-8503-000c29475bed/jobss?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
+
+ # Construct a model instance of BackupPolicyJobCollectionNext by calling from_dict on the json representation
+ backup_policy_job_collection_next_model = BackupPolicyJobCollectionNext.from_dict(backup_policy_job_collection_next_model_json)
+ assert backup_policy_job_collection_next_model != False
+
+ # Construct a model instance of BackupPolicyJobCollectionNext by calling from_dict on the json representation
+ backup_policy_job_collection_next_model_dict = BackupPolicyJobCollectionNext.from_dict(backup_policy_job_collection_next_model_json).__dict__
+ backup_policy_job_collection_next_model2 = BackupPolicyJobCollectionNext(**backup_policy_job_collection_next_model_dict)
+
+ # Verify the model instances are equivalent
+ assert backup_policy_job_collection_next_model == backup_policy_job_collection_next_model2
+
+ # Convert model instance back to dict and verify no loss of data
+ backup_policy_job_collection_next_model_json2 = backup_policy_job_collection_next_model.to_dict()
+ assert backup_policy_job_collection_next_model_json2 == backup_policy_job_collection_next_model_json
+
+
+class TestModel_BackupPolicyJobStatusReason:
+ """
+ Test Class for BackupPolicyJobStatusReason
+ """
+
+ def test_backup_policy_job_status_reason_serialization(self):
+ """
+ Test serialization/deserialization for BackupPolicyJobStatusReason
+ """
+
+ # Construct a json representation of a BackupPolicyJobStatusReason model
+ backup_policy_job_status_reason_model_json = {}
+ backup_policy_job_status_reason_model_json['code'] = 'source_volume_busy'
+ backup_policy_job_status_reason_model_json['message'] = 'testString'
+ backup_policy_job_status_reason_model_json['more_info'] = 'https://cloud.ibm.com/docs/vpc?topic=vpc-troubleshooting-backup-for-vpc'
+
+ # Construct a model instance of BackupPolicyJobStatusReason by calling from_dict on the json representation
+ backup_policy_job_status_reason_model = BackupPolicyJobStatusReason.from_dict(backup_policy_job_status_reason_model_json)
+ assert backup_policy_job_status_reason_model != False
+
+ # Construct a model instance of BackupPolicyJobStatusReason by calling from_dict on the json representation
+ backup_policy_job_status_reason_model_dict = BackupPolicyJobStatusReason.from_dict(backup_policy_job_status_reason_model_json).__dict__
+ backup_policy_job_status_reason_model2 = BackupPolicyJobStatusReason(**backup_policy_job_status_reason_model_dict)
+
+ # Verify the model instances are equivalent
+ assert backup_policy_job_status_reason_model == backup_policy_job_status_reason_model2
+
+ # Convert model instance back to dict and verify no loss of data
+ backup_policy_job_status_reason_model_json2 = backup_policy_job_status_reason_model.to_dict()
+ assert backup_policy_job_status_reason_model_json2 == backup_policy_job_status_reason_model_json
+
+
+class TestModel_BackupPolicyPatch:
+ """
+ Test Class for BackupPolicyPatch
+ """
+
+ def test_backup_policy_patch_serialization(self):
+ """
+ Test serialization/deserialization for BackupPolicyPatch
+ """
+
+ # Construct a json representation of a BackupPolicyPatch model
+ backup_policy_patch_model_json = {}
+ backup_policy_patch_model_json['included_content'] = ['data_volumes']
+ backup_policy_patch_model_json['match_user_tags'] = ['my-daily-backup-policy']
+ backup_policy_patch_model_json['name'] = 'my-backup-policy'
+
+ # Construct a model instance of BackupPolicyPatch by calling from_dict on the json representation
+ backup_policy_patch_model = BackupPolicyPatch.from_dict(backup_policy_patch_model_json)
+ assert backup_policy_patch_model != False
+
+ # Construct a model instance of BackupPolicyPatch by calling from_dict on the json representation
+ backup_policy_patch_model_dict = BackupPolicyPatch.from_dict(backup_policy_patch_model_json).__dict__
+ backup_policy_patch_model2 = BackupPolicyPatch(**backup_policy_patch_model_dict)
+
+ # Verify the model instances are equivalent
+ assert backup_policy_patch_model == backup_policy_patch_model2
+
+ # Convert model instance back to dict and verify no loss of data
+ backup_policy_patch_model_json2 = backup_policy_patch_model.to_dict()
+ assert backup_policy_patch_model_json2 == backup_policy_patch_model_json
+
+
+class TestModel_BackupPolicyPlan:
+ """
+ Test Class for BackupPolicyPlan
+ """
+
+ def test_backup_policy_plan_serialization(self):
+ """
+ Test serialization/deserialization for BackupPolicyPlan
+ """
+
+ # 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'
+
+ backup_policy_plan_clone_policy_model = {} # BackupPolicyPlanClonePolicy
+ backup_policy_plan_clone_policy_model['max_snapshots'] = 1
+ backup_policy_plan_clone_policy_model['zones'] = [zone_reference_model]
+
+ backup_policy_plan_deletion_trigger_model = {} # BackupPolicyPlanDeletionTrigger
+ backup_policy_plan_deletion_trigger_model['delete_after'] = 20
+ backup_policy_plan_deletion_trigger_model['delete_over_count'] = 20
+
+ encryption_key_reference_model = {} # EncryptionKeyReference
+ encryption_key_reference_model['crn'] = 'crn:v1:bluemix:public:kms:us-south:a/123456: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'
+
+ backup_policy_plan_remote_region_policy_model = {} # BackupPolicyPlanRemoteRegionPolicy
+ backup_policy_plan_remote_region_policy_model['delete_over_count'] = 1
+ backup_policy_plan_remote_region_policy_model['encryption_key'] = encryption_key_reference_model
+ backup_policy_plan_remote_region_policy_model['region'] = region_reference_model
+
+ # Construct a json representation of a BackupPolicyPlan model
+ backup_policy_plan_model_json = {}
+ backup_policy_plan_model_json['active'] = True
+ backup_policy_plan_model_json['attach_user_tags'] = ['my-daily-backup-plan']
+ backup_policy_plan_model_json['clone_policy'] = backup_policy_plan_clone_policy_model
+ backup_policy_plan_model_json['copy_user_tags'] = True
+ backup_policy_plan_model_json['created_at'] = '2019-01-01T12:00:00Z'
+ backup_policy_plan_model_json['cron_spec'] = '30 */2 * * 1-5'
+ backup_policy_plan_model_json['deletion_trigger'] = backup_policy_plan_deletion_trigger_model
+ backup_policy_plan_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178'
+ backup_policy_plan_model_json['id'] = 'r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178'
+ backup_policy_plan_model_json['lifecycle_state'] = 'stable'
+ backup_policy_plan_model_json['name'] = 'my-policy-plan'
+ backup_policy_plan_model_json['remote_region_policies'] = [backup_policy_plan_remote_region_policy_model]
+ backup_policy_plan_model_json['resource_type'] = 'backup_policy_plan'
+
+ # Construct a model instance of BackupPolicyPlan by calling from_dict on the json representation
+ backup_policy_plan_model = BackupPolicyPlan.from_dict(backup_policy_plan_model_json)
+ assert backup_policy_plan_model != False
+
+ # Construct a model instance of BackupPolicyPlan by calling from_dict on the json representation
+ backup_policy_plan_model_dict = BackupPolicyPlan.from_dict(backup_policy_plan_model_json).__dict__
+ backup_policy_plan_model2 = BackupPolicyPlan(**backup_policy_plan_model_dict)
+
+ # Verify the model instances are equivalent
+ assert backup_policy_plan_model == backup_policy_plan_model2
+
+ # Convert model instance back to dict and verify no loss of data
+ backup_policy_plan_model_json2 = backup_policy_plan_model.to_dict()
+ assert backup_policy_plan_model_json2 == backup_policy_plan_model_json
+
+
+class TestModel_BackupPolicyPlanClonePolicy:
+ """
+ Test Class for BackupPolicyPlanClonePolicy
+ """
+
+ def test_backup_policy_plan_clone_policy_serialization(self):
+ """
+ Test serialization/deserialization for BackupPolicyPlanClonePolicy
+ """
+
+ # 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 BackupPolicyPlanClonePolicy model
+ backup_policy_plan_clone_policy_model_json = {}
+ backup_policy_plan_clone_policy_model_json['max_snapshots'] = 1
+ backup_policy_plan_clone_policy_model_json['zones'] = [zone_reference_model]
+
+ # Construct a model instance of BackupPolicyPlanClonePolicy by calling from_dict on the json representation
+ backup_policy_plan_clone_policy_model = BackupPolicyPlanClonePolicy.from_dict(backup_policy_plan_clone_policy_model_json)
+ assert backup_policy_plan_clone_policy_model != False
+
+ # Construct a model instance of BackupPolicyPlanClonePolicy by calling from_dict on the json representation
+ backup_policy_plan_clone_policy_model_dict = BackupPolicyPlanClonePolicy.from_dict(backup_policy_plan_clone_policy_model_json).__dict__
+ backup_policy_plan_clone_policy_model2 = BackupPolicyPlanClonePolicy(**backup_policy_plan_clone_policy_model_dict)
+
+ # Verify the model instances are equivalent
+ assert backup_policy_plan_clone_policy_model == backup_policy_plan_clone_policy_model2
+
+ # Convert model instance back to dict and verify no loss of data
+ backup_policy_plan_clone_policy_model_json2 = backup_policy_plan_clone_policy_model.to_dict()
+ assert backup_policy_plan_clone_policy_model_json2 == backup_policy_plan_clone_policy_model_json
+
+
+class TestModel_BackupPolicyPlanClonePolicyPatch:
+ """
+ Test Class for BackupPolicyPlanClonePolicyPatch
+ """
+
+ def test_backup_policy_plan_clone_policy_patch_serialization(self):
+ """
+ Test serialization/deserialization for BackupPolicyPlanClonePolicyPatch
+ """
+
+ # 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'
+
+ # Construct a json representation of a BackupPolicyPlanClonePolicyPatch model
+ backup_policy_plan_clone_policy_patch_model_json = {}
+ backup_policy_plan_clone_policy_patch_model_json['max_snapshots'] = 1
+ backup_policy_plan_clone_policy_patch_model_json['zones'] = [zone_identity_model]
+
+ # Construct a model instance of BackupPolicyPlanClonePolicyPatch by calling from_dict on the json representation
+ backup_policy_plan_clone_policy_patch_model = BackupPolicyPlanClonePolicyPatch.from_dict(backup_policy_plan_clone_policy_patch_model_json)
+ assert backup_policy_plan_clone_policy_patch_model != False
+
+ # Construct a model instance of BackupPolicyPlanClonePolicyPatch by calling from_dict on the json representation
+ backup_policy_plan_clone_policy_patch_model_dict = BackupPolicyPlanClonePolicyPatch.from_dict(backup_policy_plan_clone_policy_patch_model_json).__dict__
+ backup_policy_plan_clone_policy_patch_model2 = BackupPolicyPlanClonePolicyPatch(**backup_policy_plan_clone_policy_patch_model_dict)
+
+ # Verify the model instances are equivalent
+ assert backup_policy_plan_clone_policy_patch_model == backup_policy_plan_clone_policy_patch_model2
+
+ # Convert model instance back to dict and verify no loss of data
+ backup_policy_plan_clone_policy_patch_model_json2 = backup_policy_plan_clone_policy_patch_model.to_dict()
+ assert backup_policy_plan_clone_policy_patch_model_json2 == backup_policy_plan_clone_policy_patch_model_json
+
+
+class TestModel_BackupPolicyPlanClonePolicyPrototype:
+ """
+ Test Class for BackupPolicyPlanClonePolicyPrototype
+ """
+
+ def test_backup_policy_plan_clone_policy_prototype_serialization(self):
+ """
+ Test serialization/deserialization for BackupPolicyPlanClonePolicyPrototype
+ """
+
+ # 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'
+
+ # Construct a json representation of a BackupPolicyPlanClonePolicyPrototype model
+ backup_policy_plan_clone_policy_prototype_model_json = {}
+ backup_policy_plan_clone_policy_prototype_model_json['max_snapshots'] = 5
+ backup_policy_plan_clone_policy_prototype_model_json['zones'] = [zone_identity_model]
+
+ # Construct a model instance of BackupPolicyPlanClonePolicyPrototype by calling from_dict on the json representation
+ backup_policy_plan_clone_policy_prototype_model = BackupPolicyPlanClonePolicyPrototype.from_dict(backup_policy_plan_clone_policy_prototype_model_json)
+ assert backup_policy_plan_clone_policy_prototype_model != False
+
+ # Construct a model instance of BackupPolicyPlanClonePolicyPrototype by calling from_dict on the json representation
+ backup_policy_plan_clone_policy_prototype_model_dict = BackupPolicyPlanClonePolicyPrototype.from_dict(backup_policy_plan_clone_policy_prototype_model_json).__dict__
+ backup_policy_plan_clone_policy_prototype_model2 = BackupPolicyPlanClonePolicyPrototype(**backup_policy_plan_clone_policy_prototype_model_dict)
+
+ # Verify the model instances are equivalent
+ assert backup_policy_plan_clone_policy_prototype_model == backup_policy_plan_clone_policy_prototype_model2
+
+ # Convert model instance back to dict and verify no loss of data
+ backup_policy_plan_clone_policy_prototype_model_json2 = backup_policy_plan_clone_policy_prototype_model.to_dict()
+ assert backup_policy_plan_clone_policy_prototype_model_json2 == backup_policy_plan_clone_policy_prototype_model_json
+
+
+class TestModel_BackupPolicyPlanCollection:
+ """
+ Test Class for BackupPolicyPlanCollection
+ """
+
+ def test_backup_policy_plan_collection_serialization(self):
+ """
+ Test serialization/deserialization for BackupPolicyPlanCollection
+ """
+
+ # 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'
+
+ backup_policy_plan_clone_policy_model = {} # BackupPolicyPlanClonePolicy
+ backup_policy_plan_clone_policy_model['max_snapshots'] = 1
+ backup_policy_plan_clone_policy_model['zones'] = [zone_reference_model]
+
+ backup_policy_plan_deletion_trigger_model = {} # BackupPolicyPlanDeletionTrigger
+ backup_policy_plan_deletion_trigger_model['delete_after'] = 20
+ backup_policy_plan_deletion_trigger_model['delete_over_count'] = 20
+
+ encryption_key_reference_model = {} # EncryptionKeyReference
+ encryption_key_reference_model['crn'] = 'crn:v1:bluemix:public:kms:us-south:a/123456: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'
+
+ backup_policy_plan_remote_region_policy_model = {} # BackupPolicyPlanRemoteRegionPolicy
+ backup_policy_plan_remote_region_policy_model['delete_over_count'] = 1
+ backup_policy_plan_remote_region_policy_model['encryption_key'] = encryption_key_reference_model
+ backup_policy_plan_remote_region_policy_model['region'] = region_reference_model
+
+ backup_policy_plan_model = {} # BackupPolicyPlan
+ backup_policy_plan_model['active'] = True
+ backup_policy_plan_model['attach_user_tags'] = ['my-daily-backup-plan']
+ backup_policy_plan_model['clone_policy'] = backup_policy_plan_clone_policy_model
+ backup_policy_plan_model['copy_user_tags'] = True
+ backup_policy_plan_model['created_at'] = '2019-01-01T12:00:00Z'
+ backup_policy_plan_model['cron_spec'] = '30 */2 * * 1-5'
+ backup_policy_plan_model['deletion_trigger'] = backup_policy_plan_deletion_trigger_model
+ backup_policy_plan_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178'
+ backup_policy_plan_model['id'] = 'r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178'
+ backup_policy_plan_model['lifecycle_state'] = 'stable'
+ backup_policy_plan_model['name'] = 'my-policy-plan'
+ backup_policy_plan_model['remote_region_policies'] = [backup_policy_plan_remote_region_policy_model]
+ backup_policy_plan_model['resource_type'] = 'backup_policy_plan'
+
+ # Construct a json representation of a BackupPolicyPlanCollection model
+ backup_policy_plan_collection_model_json = {}
+ backup_policy_plan_collection_model_json['plans'] = [backup_policy_plan_model]
+
+ # Construct a model instance of BackupPolicyPlanCollection by calling from_dict on the json representation
+ backup_policy_plan_collection_model = BackupPolicyPlanCollection.from_dict(backup_policy_plan_collection_model_json)
+ assert backup_policy_plan_collection_model != False
+
+ # Construct a model instance of BackupPolicyPlanCollection by calling from_dict on the json representation
+ backup_policy_plan_collection_model_dict = BackupPolicyPlanCollection.from_dict(backup_policy_plan_collection_model_json).__dict__
+ backup_policy_plan_collection_model2 = BackupPolicyPlanCollection(**backup_policy_plan_collection_model_dict)
+
+ # Verify the model instances are equivalent
+ assert backup_policy_plan_collection_model == backup_policy_plan_collection_model2
+
+ # Convert model instance back to dict and verify no loss of data
+ backup_policy_plan_collection_model_json2 = backup_policy_plan_collection_model.to_dict()
+ assert backup_policy_plan_collection_model_json2 == backup_policy_plan_collection_model_json
+
+
+class TestModel_BackupPolicyPlanDeletionTrigger:
+ """
+ Test Class for BackupPolicyPlanDeletionTrigger
+ """
+
+ def test_backup_policy_plan_deletion_trigger_serialization(self):
+ """
+ Test serialization/deserialization for BackupPolicyPlanDeletionTrigger
+ """
+
+ # Construct a json representation of a BackupPolicyPlanDeletionTrigger model
+ backup_policy_plan_deletion_trigger_model_json = {}
+ backup_policy_plan_deletion_trigger_model_json['delete_after'] = 20
+ backup_policy_plan_deletion_trigger_model_json['delete_over_count'] = 20
+
+ # Construct a model instance of BackupPolicyPlanDeletionTrigger by calling from_dict on the json representation
+ backup_policy_plan_deletion_trigger_model = BackupPolicyPlanDeletionTrigger.from_dict(backup_policy_plan_deletion_trigger_model_json)
+ assert backup_policy_plan_deletion_trigger_model != False
+
+ # Construct a model instance of BackupPolicyPlanDeletionTrigger by calling from_dict on the json representation
+ backup_policy_plan_deletion_trigger_model_dict = BackupPolicyPlanDeletionTrigger.from_dict(backup_policy_plan_deletion_trigger_model_json).__dict__
+ backup_policy_plan_deletion_trigger_model2 = BackupPolicyPlanDeletionTrigger(**backup_policy_plan_deletion_trigger_model_dict)
+
+ # Verify the model instances are equivalent
+ assert backup_policy_plan_deletion_trigger_model == backup_policy_plan_deletion_trigger_model2
+
+ # Convert model instance back to dict and verify no loss of data
+ backup_policy_plan_deletion_trigger_model_json2 = backup_policy_plan_deletion_trigger_model.to_dict()
+ assert backup_policy_plan_deletion_trigger_model_json2 == backup_policy_plan_deletion_trigger_model_json
+
+
+class TestModel_BackupPolicyPlanDeletionTriggerPatch:
+ """
+ Test Class for BackupPolicyPlanDeletionTriggerPatch
+ """
+
+ def test_backup_policy_plan_deletion_trigger_patch_serialization(self):
+ """
+ Test serialization/deserialization for BackupPolicyPlanDeletionTriggerPatch
+ """
+
+ # Construct a json representation of a BackupPolicyPlanDeletionTriggerPatch model
+ backup_policy_plan_deletion_trigger_patch_model_json = {}
+ backup_policy_plan_deletion_trigger_patch_model_json['delete_after'] = 20
+ backup_policy_plan_deletion_trigger_patch_model_json['delete_over_count'] = 1
+
+ # Construct a model instance of BackupPolicyPlanDeletionTriggerPatch by calling from_dict on the json representation
+ backup_policy_plan_deletion_trigger_patch_model = BackupPolicyPlanDeletionTriggerPatch.from_dict(backup_policy_plan_deletion_trigger_patch_model_json)
+ assert backup_policy_plan_deletion_trigger_patch_model != False
+
+ # Construct a model instance of BackupPolicyPlanDeletionTriggerPatch by calling from_dict on the json representation
+ backup_policy_plan_deletion_trigger_patch_model_dict = BackupPolicyPlanDeletionTriggerPatch.from_dict(backup_policy_plan_deletion_trigger_patch_model_json).__dict__
+ backup_policy_plan_deletion_trigger_patch_model2 = BackupPolicyPlanDeletionTriggerPatch(**backup_policy_plan_deletion_trigger_patch_model_dict)
+
+ # Verify the model instances are equivalent
+ assert backup_policy_plan_deletion_trigger_patch_model == backup_policy_plan_deletion_trigger_patch_model2
+
+ # Convert model instance back to dict and verify no loss of data
+ backup_policy_plan_deletion_trigger_patch_model_json2 = backup_policy_plan_deletion_trigger_patch_model.to_dict()
+ assert backup_policy_plan_deletion_trigger_patch_model_json2 == backup_policy_plan_deletion_trigger_patch_model_json
+
+
+class TestModel_BackupPolicyPlanDeletionTriggerPrototype:
+ """
+ Test Class for BackupPolicyPlanDeletionTriggerPrototype
+ """
+
+ def test_backup_policy_plan_deletion_trigger_prototype_serialization(self):
+ """
+ Test serialization/deserialization for BackupPolicyPlanDeletionTriggerPrototype
+ """
+
+ # Construct a json representation of a BackupPolicyPlanDeletionTriggerPrototype model
+ backup_policy_plan_deletion_trigger_prototype_model_json = {}
+ backup_policy_plan_deletion_trigger_prototype_model_json['delete_after'] = 20
+ backup_policy_plan_deletion_trigger_prototype_model_json['delete_over_count'] = 20
+
+ # Construct a model instance of BackupPolicyPlanDeletionTriggerPrototype by calling from_dict on the json representation
+ backup_policy_plan_deletion_trigger_prototype_model = BackupPolicyPlanDeletionTriggerPrototype.from_dict(backup_policy_plan_deletion_trigger_prototype_model_json)
+ assert backup_policy_plan_deletion_trigger_prototype_model != False
+
+ # Construct a model instance of BackupPolicyPlanDeletionTriggerPrototype by calling from_dict on the json representation
+ backup_policy_plan_deletion_trigger_prototype_model_dict = BackupPolicyPlanDeletionTriggerPrototype.from_dict(backup_policy_plan_deletion_trigger_prototype_model_json).__dict__
+ backup_policy_plan_deletion_trigger_prototype_model2 = BackupPolicyPlanDeletionTriggerPrototype(**backup_policy_plan_deletion_trigger_prototype_model_dict)
+
+ # Verify the model instances are equivalent
+ assert backup_policy_plan_deletion_trigger_prototype_model == backup_policy_plan_deletion_trigger_prototype_model2
+
+ # Convert model instance back to dict and verify no loss of data
+ backup_policy_plan_deletion_trigger_prototype_model_json2 = backup_policy_plan_deletion_trigger_prototype_model.to_dict()
+ assert backup_policy_plan_deletion_trigger_prototype_model_json2 == backup_policy_plan_deletion_trigger_prototype_model_json
+
+
+class TestModel_BackupPolicyPlanPatch:
+ """
+ Test Class for BackupPolicyPlanPatch
+ """
+
+ def test_backup_policy_plan_patch_serialization(self):
+ """
+ Test serialization/deserialization for BackupPolicyPlanPatch
+ """
+
+ # 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'
+
+ backup_policy_plan_clone_policy_patch_model = {} # BackupPolicyPlanClonePolicyPatch
+ backup_policy_plan_clone_policy_patch_model['max_snapshots'] = 1
+ backup_policy_plan_clone_policy_patch_model['zones'] = [zone_identity_model]
+
+ backup_policy_plan_deletion_trigger_patch_model = {} # BackupPolicyPlanDeletionTriggerPatch
+ backup_policy_plan_deletion_trigger_patch_model['delete_after'] = 20
+ backup_policy_plan_deletion_trigger_patch_model['delete_over_count'] = 1
+
+ encryption_key_identity_model = {} # EncryptionKeyIdentityByCRN
+ encryption_key_identity_model['crn'] = 'crn:v1:bluemix:public:kms:us-south:a/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179'
+
+ region_identity_model = {} # RegionIdentityByName
+ region_identity_model['name'] = 'us-south'
+
+ backup_policy_plan_remote_region_policy_prototype_model = {} # BackupPolicyPlanRemoteRegionPolicyPrototype
+ backup_policy_plan_remote_region_policy_prototype_model['delete_over_count'] = 5
+ backup_policy_plan_remote_region_policy_prototype_model['encryption_key'] = encryption_key_identity_model
+ backup_policy_plan_remote_region_policy_prototype_model['region'] = region_identity_model
+
+ # Construct a json representation of a BackupPolicyPlanPatch model
+ backup_policy_plan_patch_model_json = {}
+ backup_policy_plan_patch_model_json['active'] = True
+ backup_policy_plan_patch_model_json['attach_user_tags'] = ['my-daily-backup-plan']
+ backup_policy_plan_patch_model_json['clone_policy'] = backup_policy_plan_clone_policy_patch_model
+ backup_policy_plan_patch_model_json['copy_user_tags'] = True
+ backup_policy_plan_patch_model_json['cron_spec'] = '30 */2 * * 1-5'
+ backup_policy_plan_patch_model_json['deletion_trigger'] = backup_policy_plan_deletion_trigger_patch_model
+ backup_policy_plan_patch_model_json['name'] = 'my-policy-plan'
+ backup_policy_plan_patch_model_json['remote_region_policies'] = [backup_policy_plan_remote_region_policy_prototype_model]
+
+ # Construct a model instance of BackupPolicyPlanPatch by calling from_dict on the json representation
+ backup_policy_plan_patch_model = BackupPolicyPlanPatch.from_dict(backup_policy_plan_patch_model_json)
+ assert backup_policy_plan_patch_model != False
+
+ # Construct a model instance of BackupPolicyPlanPatch by calling from_dict on the json representation
+ backup_policy_plan_patch_model_dict = BackupPolicyPlanPatch.from_dict(backup_policy_plan_patch_model_json).__dict__
+ backup_policy_plan_patch_model2 = BackupPolicyPlanPatch(**backup_policy_plan_patch_model_dict)
+
+ # Verify the model instances are equivalent
+ assert backup_policy_plan_patch_model == backup_policy_plan_patch_model2
+
+ # Convert model instance back to dict and verify no loss of data
+ backup_policy_plan_patch_model_json2 = backup_policy_plan_patch_model.to_dict()
+ assert backup_policy_plan_patch_model_json2 == backup_policy_plan_patch_model_json
+
+
+class TestModel_BackupPolicyPlanPrototype:
+ """
+ Test Class for BackupPolicyPlanPrototype
+ """
+
+ def test_backup_policy_plan_prototype_serialization(self):
+ """
+ Test serialization/deserialization for BackupPolicyPlanPrototype
+ """
+
+ # 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'
+
+ backup_policy_plan_clone_policy_prototype_model = {} # BackupPolicyPlanClonePolicyPrototype
+ backup_policy_plan_clone_policy_prototype_model['max_snapshots'] = 5
+ backup_policy_plan_clone_policy_prototype_model['zones'] = [zone_identity_model]
+
+ backup_policy_plan_deletion_trigger_prototype_model = {} # BackupPolicyPlanDeletionTriggerPrototype
+ backup_policy_plan_deletion_trigger_prototype_model['delete_after'] = 20
+ backup_policy_plan_deletion_trigger_prototype_model['delete_over_count'] = 20
+
+ encryption_key_identity_model = {} # EncryptionKeyIdentityByCRN
+ encryption_key_identity_model['crn'] = 'crn:v1:bluemix:public:kms:us-south:a/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179'
+
+ region_identity_model = {} # RegionIdentityByName
+ region_identity_model['name'] = 'us-south'
+
+ backup_policy_plan_remote_region_policy_prototype_model = {} # BackupPolicyPlanRemoteRegionPolicyPrototype
+ backup_policy_plan_remote_region_policy_prototype_model['delete_over_count'] = 5
+ backup_policy_plan_remote_region_policy_prototype_model['encryption_key'] = encryption_key_identity_model
+ backup_policy_plan_remote_region_policy_prototype_model['region'] = region_identity_model
+
+ # Construct a json representation of a BackupPolicyPlanPrototype model
+ backup_policy_plan_prototype_model_json = {}
+ backup_policy_plan_prototype_model_json['active'] = True
+ backup_policy_plan_prototype_model_json['attach_user_tags'] = ['my-daily-backup-plan']
+ backup_policy_plan_prototype_model_json['clone_policy'] = backup_policy_plan_clone_policy_prototype_model
+ backup_policy_plan_prototype_model_json['copy_user_tags'] = True
+ backup_policy_plan_prototype_model_json['cron_spec'] = '30 */2 * * 1-5'
+ backup_policy_plan_prototype_model_json['deletion_trigger'] = backup_policy_plan_deletion_trigger_prototype_model
+ backup_policy_plan_prototype_model_json['name'] = 'my-policy-plan'
+ backup_policy_plan_prototype_model_json['remote_region_policies'] = [backup_policy_plan_remote_region_policy_prototype_model]
+
+ # Construct a model instance of BackupPolicyPlanPrototype by calling from_dict on the json representation
+ backup_policy_plan_prototype_model = BackupPolicyPlanPrototype.from_dict(backup_policy_plan_prototype_model_json)
+ assert backup_policy_plan_prototype_model != False
+
+ # Construct a model instance of BackupPolicyPlanPrototype by calling from_dict on the json representation
+ backup_policy_plan_prototype_model_dict = BackupPolicyPlanPrototype.from_dict(backup_policy_plan_prototype_model_json).__dict__
+ backup_policy_plan_prototype_model2 = BackupPolicyPlanPrototype(**backup_policy_plan_prototype_model_dict)
+
+ # Verify the model instances are equivalent
+ assert backup_policy_plan_prototype_model == backup_policy_plan_prototype_model2
+
+ # Convert model instance back to dict and verify no loss of data
+ backup_policy_plan_prototype_model_json2 = backup_policy_plan_prototype_model.to_dict()
+ assert backup_policy_plan_prototype_model_json2 == backup_policy_plan_prototype_model_json
+
+
+class TestModel_BackupPolicyPlanReference:
+ """
+ Test Class for BackupPolicyPlanReference
+ """
+
+ def test_backup_policy_plan_reference_serialization(self):
+ """
+ Test serialization/deserialization for BackupPolicyPlanReference
+ """
+
+ # Construct dict forms of any model objects needed in order to build this model.
+
+ backup_policy_plan_reference_deleted_model = {} # BackupPolicyPlanReferenceDeleted
+ backup_policy_plan_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+
+ 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'
+
+ backup_policy_plan_remote_model = {} # BackupPolicyPlanRemote
+ backup_policy_plan_remote_model['region'] = region_reference_model
+
+ # Construct a json representation of a BackupPolicyPlanReference model
+ backup_policy_plan_reference_model_json = {}
+ backup_policy_plan_reference_model_json['deleted'] = backup_policy_plan_reference_deleted_model
+ backup_policy_plan_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178'
+ backup_policy_plan_reference_model_json['id'] = 'r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178'
+ backup_policy_plan_reference_model_json['name'] = 'my-policy-plan'
+ backup_policy_plan_reference_model_json['remote'] = backup_policy_plan_remote_model
+ backup_policy_plan_reference_model_json['resource_type'] = 'backup_policy_plan'
+
+ # Construct a model instance of BackupPolicyPlanReference by calling from_dict on the json representation
+ backup_policy_plan_reference_model = BackupPolicyPlanReference.from_dict(backup_policy_plan_reference_model_json)
+ assert backup_policy_plan_reference_model != False
+
+ # Construct a model instance of BackupPolicyPlanReference by calling from_dict on the json representation
+ backup_policy_plan_reference_model_dict = BackupPolicyPlanReference.from_dict(backup_policy_plan_reference_model_json).__dict__
+ backup_policy_plan_reference_model2 = BackupPolicyPlanReference(**backup_policy_plan_reference_model_dict)
+
+ # Verify the model instances are equivalent
+ assert backup_policy_plan_reference_model == backup_policy_plan_reference_model2
+
+ # Convert model instance back to dict and verify no loss of data
+ backup_policy_plan_reference_model_json2 = backup_policy_plan_reference_model.to_dict()
+ assert backup_policy_plan_reference_model_json2 == backup_policy_plan_reference_model_json
+
+
+class TestModel_BackupPolicyPlanReferenceDeleted:
+ """
+ Test Class for BackupPolicyPlanReferenceDeleted
+ """
+
+ def test_backup_policy_plan_reference_deleted_serialization(self):
+ """
+ Test serialization/deserialization for BackupPolicyPlanReferenceDeleted
+ """
+
+ # Construct a json representation of a BackupPolicyPlanReferenceDeleted model
+ backup_policy_plan_reference_deleted_model_json = {}
+ backup_policy_plan_reference_deleted_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+
+ # Construct a model instance of BackupPolicyPlanReferenceDeleted by calling from_dict on the json representation
+ backup_policy_plan_reference_deleted_model = BackupPolicyPlanReferenceDeleted.from_dict(backup_policy_plan_reference_deleted_model_json)
+ assert backup_policy_plan_reference_deleted_model != False
+
+ # Construct a model instance of BackupPolicyPlanReferenceDeleted by calling from_dict on the json representation
+ backup_policy_plan_reference_deleted_model_dict = BackupPolicyPlanReferenceDeleted.from_dict(backup_policy_plan_reference_deleted_model_json).__dict__
+ backup_policy_plan_reference_deleted_model2 = BackupPolicyPlanReferenceDeleted(**backup_policy_plan_reference_deleted_model_dict)
+
+ # Verify the model instances are equivalent
+ assert backup_policy_plan_reference_deleted_model == backup_policy_plan_reference_deleted_model2
+
+ # Convert model instance back to dict and verify no loss of data
+ backup_policy_plan_reference_deleted_model_json2 = backup_policy_plan_reference_deleted_model.to_dict()
+ assert backup_policy_plan_reference_deleted_model_json2 == backup_policy_plan_reference_deleted_model_json
+
+
+class TestModel_BackupPolicyPlanRemote:
+ """
+ Test Class for BackupPolicyPlanRemote
+ """
+
+ def test_backup_policy_plan_remote_serialization(self):
+ """
+ Test serialization/deserialization for BackupPolicyPlanRemote
+ """
+
+ # 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 BackupPolicyPlanRemote model
+ backup_policy_plan_remote_model_json = {}
+ backup_policy_plan_remote_model_json['region'] = region_reference_model
+
+ # Construct a model instance of BackupPolicyPlanRemote by calling from_dict on the json representation
+ backup_policy_plan_remote_model = BackupPolicyPlanRemote.from_dict(backup_policy_plan_remote_model_json)
+ assert backup_policy_plan_remote_model != False
+
+ # Construct a model instance of BackupPolicyPlanRemote by calling from_dict on the json representation
+ backup_policy_plan_remote_model_dict = BackupPolicyPlanRemote.from_dict(backup_policy_plan_remote_model_json).__dict__
+ backup_policy_plan_remote_model2 = BackupPolicyPlanRemote(**backup_policy_plan_remote_model_dict)
+
+ # Verify the model instances are equivalent
+ assert backup_policy_plan_remote_model == backup_policy_plan_remote_model2
+
+ # Convert model instance back to dict and verify no loss of data
+ backup_policy_plan_remote_model_json2 = backup_policy_plan_remote_model.to_dict()
+ assert backup_policy_plan_remote_model_json2 == backup_policy_plan_remote_model_json
+
+
+class TestModel_BackupPolicyPlanRemoteRegionPolicy:
+ """
+ Test Class for BackupPolicyPlanRemoteRegionPolicy
+ """
+
+ def test_backup_policy_plan_remote_region_policy_serialization(self):
+ """
+ Test serialization/deserialization for BackupPolicyPlanRemoteRegionPolicy
+ """
+
+ # 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/123456: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'
+
+ # Construct a json representation of a BackupPolicyPlanRemoteRegionPolicy model
+ backup_policy_plan_remote_region_policy_model_json = {}
+ backup_policy_plan_remote_region_policy_model_json['delete_over_count'] = 1
+ backup_policy_plan_remote_region_policy_model_json['encryption_key'] = encryption_key_reference_model
+ backup_policy_plan_remote_region_policy_model_json['region'] = region_reference_model
+
+ # Construct a model instance of BackupPolicyPlanRemoteRegionPolicy by calling from_dict on the json representation
+ backup_policy_plan_remote_region_policy_model = BackupPolicyPlanRemoteRegionPolicy.from_dict(backup_policy_plan_remote_region_policy_model_json)
+ assert backup_policy_plan_remote_region_policy_model != False
+
+ # Construct a model instance of BackupPolicyPlanRemoteRegionPolicy by calling from_dict on the json representation
+ backup_policy_plan_remote_region_policy_model_dict = BackupPolicyPlanRemoteRegionPolicy.from_dict(backup_policy_plan_remote_region_policy_model_json).__dict__
+ backup_policy_plan_remote_region_policy_model2 = BackupPolicyPlanRemoteRegionPolicy(**backup_policy_plan_remote_region_policy_model_dict)
+
+ # Verify the model instances are equivalent
+ assert backup_policy_plan_remote_region_policy_model == backup_policy_plan_remote_region_policy_model2
+
+ # Convert model instance back to dict and verify no loss of data
+ backup_policy_plan_remote_region_policy_model_json2 = backup_policy_plan_remote_region_policy_model.to_dict()
+ assert backup_policy_plan_remote_region_policy_model_json2 == backup_policy_plan_remote_region_policy_model_json
+
+
+class TestModel_BackupPolicyPlanRemoteRegionPolicyPrototype:
+ """
+ Test Class for BackupPolicyPlanRemoteRegionPolicyPrototype
+ """
+
+ def test_backup_policy_plan_remote_region_policy_prototype_serialization(self):
+ """
+ Test serialization/deserialization for BackupPolicyPlanRemoteRegionPolicyPrototype
+ """
+
+ # 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/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179'
+
+ region_identity_model = {} # RegionIdentityByName
+ region_identity_model['name'] = 'us-south'
+
+ # Construct a json representation of a BackupPolicyPlanRemoteRegionPolicyPrototype model
+ backup_policy_plan_remote_region_policy_prototype_model_json = {}
+ backup_policy_plan_remote_region_policy_prototype_model_json['delete_over_count'] = 5
+ backup_policy_plan_remote_region_policy_prototype_model_json['encryption_key'] = encryption_key_identity_model
+ backup_policy_plan_remote_region_policy_prototype_model_json['region'] = region_identity_model
+
+ # Construct a model instance of BackupPolicyPlanRemoteRegionPolicyPrototype by calling from_dict on the json representation
+ backup_policy_plan_remote_region_policy_prototype_model = BackupPolicyPlanRemoteRegionPolicyPrototype.from_dict(backup_policy_plan_remote_region_policy_prototype_model_json)
+ assert backup_policy_plan_remote_region_policy_prototype_model != False
+
+ # Construct a model instance of BackupPolicyPlanRemoteRegionPolicyPrototype by calling from_dict on the json representation
+ backup_policy_plan_remote_region_policy_prototype_model_dict = BackupPolicyPlanRemoteRegionPolicyPrototype.from_dict(backup_policy_plan_remote_region_policy_prototype_model_json).__dict__
+ backup_policy_plan_remote_region_policy_prototype_model2 = BackupPolicyPlanRemoteRegionPolicyPrototype(**backup_policy_plan_remote_region_policy_prototype_model_dict)
+
+ # Verify the model instances are equivalent
+ assert backup_policy_plan_remote_region_policy_prototype_model == backup_policy_plan_remote_region_policy_prototype_model2
+
+ # Convert model instance back to dict and verify no loss of data
+ backup_policy_plan_remote_region_policy_prototype_model_json2 = backup_policy_plan_remote_region_policy_prototype_model.to_dict()
+ assert backup_policy_plan_remote_region_policy_prototype_model_json2 == backup_policy_plan_remote_region_policy_prototype_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-server-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'] = 'fcp'
+ bare_metal_server_disk_model['name'] = 'my-bare-metal-server-disk'
+ bare_metal_server_disk_model['resource_type'] = 'bare_metal_server_disk'
+ bare_metal_server_disk_model['size'] = 100
+
+ bare_metal_server_lifecycle_reason_model = {} # BareMetalServerLifecycleReason
+ bare_metal_server_lifecycle_reason_model['code'] = 'resource_suspended_by_provider'
+ bare_metal_server_lifecycle_reason_model['message'] = 'The resource has been suspended. Contact IBM support with the CRN for next steps.'
+ bare_metal_server_lifecycle_reason_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#resource-suspension'
+
+ bare_metal_server_network_attachment_reference_deleted_model = {} # BareMetalServerNetworkAttachmentReferenceDeleted
+ bare_metal_server_network_attachment_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+
+ reserved_ip_reference_deleted_model = {} # ReservedIPReferenceDeleted
+ reserved_ip_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+
+ reserved_ip_reference_model = {} # ReservedIPReference
+ reserved_ip_reference_model['address'] = '192.168.3.4'
+ reserved_ip_reference_model['deleted'] = reserved_ip_reference_deleted_model
+ reserved_ip_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb'
+ reserved_ip_reference_model['id'] = '6d353a0f-aeb1-4ae1-832e-1110d10981bb'
+ reserved_ip_reference_model['name'] = 'my-reserved-ip'
+ reserved_ip_reference_model['resource_type'] = 'subnet_reserved_ip'
+
+ subnet_reference_deleted_model = {} # SubnetReferenceDeleted
+ subnet_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+
+ subnet_reference_model = {} # SubnetReference
+ subnet_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
+ subnet_reference_model['deleted'] = subnet_reference_deleted_model
+ subnet_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
+ subnet_reference_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
+ subnet_reference_model['name'] = 'my-subnet'
+ subnet_reference_model['resource_type'] = 'subnet'
+
+ bare_metal_server_network_attachment_reference_model = {} # BareMetalServerNetworkAttachmentReference
+ bare_metal_server_network_attachment_reference_model['deleted'] = bare_metal_server_network_attachment_reference_deleted_model
+ bare_metal_server_network_attachment_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/2302-f7a2bf57-af7c-49d9-b599-b2c91293d30c/network_attachments/2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6'
+ bare_metal_server_network_attachment_reference_model['id'] = '2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6'
+ bare_metal_server_network_attachment_reference_model['name'] = 'my-bare-metal-server-network-attachment'
+ bare_metal_server_network_attachment_reference_model['primary_ip'] = reserved_ip_reference_model
+ bare_metal_server_network_attachment_reference_model['resource_type'] = 'bare_metal_server_network_attachment'
+ bare_metal_server_network_attachment_reference_model['subnet'] = subnet_reference_model
+
+ 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'
+
+ 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-bare-metal-server-network-interface'
+ network_interface_bare_metal_server_context_reference_model['primary_ip'] = reserved_ip_reference_model
+ network_interface_bare_metal_server_context_reference_model['resource_type'] = 'network_interface'
+ network_interface_bare_metal_server_context_reference_model['subnet'] = subnet_reference_model
+
+ 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'] = 'disabled'
+ bare_metal_server_trusted_platform_module_model['supported_modes'] = ['disabled']
+
+ vpc_reference_deleted_model = {} # VPCReferenceDeleted
+ vpc_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+
+ vpc_reference_model = {} # VPCReference
+ vpc_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b'
+ vpc_reference_model['deleted'] = vpc_reference_deleted_model
+ vpc_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b'
+ vpc_reference_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b'
+ vpc_reference_model['name'] = 'my-vpc'
+ vpc_reference_model['resource_type'] = 'vpc'
+
+ 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['lifecycle_reasons'] = [bare_metal_server_lifecycle_reason_model]
+ bare_metal_server_model_json['lifecycle_state'] = 'stable'
+ bare_metal_server_model_json['memory'] = 1536
+ bare_metal_server_model_json['name'] = 'my-bare-metal-server'
+ bare_metal_server_model_json['network_attachments'] = [bare_metal_server_network_attachment_reference_model]
+ bare_metal_server_model_json['network_interfaces'] = [network_interface_bare_metal_server_context_reference_model]
+ bare_metal_server_model_json['primary_network_attachment'] = bare_metal_server_network_attachment_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'] = 'deleting'
+ 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-server-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'] = 'fcp'
+ bare_metal_server_disk_model['name'] = 'my-bare-metal-server-disk'
+ bare_metal_server_disk_model['resource_type'] = 'bare_metal_server_disk'
+ bare_metal_server_disk_model['size'] = 100
+
+ bare_metal_server_lifecycle_reason_model = {} # BareMetalServerLifecycleReason
+ bare_metal_server_lifecycle_reason_model['code'] = 'resource_suspended_by_provider'
+ bare_metal_server_lifecycle_reason_model['message'] = 'The resource has been suspended. Contact IBM support with the CRN for next steps.'
+ bare_metal_server_lifecycle_reason_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#resource-suspension'
+
+ bare_metal_server_network_attachment_reference_deleted_model = {} # BareMetalServerNetworkAttachmentReferenceDeleted
+ bare_metal_server_network_attachment_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+
+ reserved_ip_reference_deleted_model = {} # ReservedIPReferenceDeleted
+ reserved_ip_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+
+ reserved_ip_reference_model = {} # ReservedIPReference
+ reserved_ip_reference_model['address'] = '192.168.3.4'
+ reserved_ip_reference_model['deleted'] = reserved_ip_reference_deleted_model
+ reserved_ip_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb'
+ reserved_ip_reference_model['id'] = '6d353a0f-aeb1-4ae1-832e-1110d10981bb'
+ reserved_ip_reference_model['name'] = 'my-reserved-ip'
+ reserved_ip_reference_model['resource_type'] = 'subnet_reserved_ip'
+
+ subnet_reference_deleted_model = {} # SubnetReferenceDeleted
+ subnet_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+
+ subnet_reference_model = {} # SubnetReference
+ subnet_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
+ subnet_reference_model['deleted'] = subnet_reference_deleted_model
+ subnet_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
+ subnet_reference_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
+ subnet_reference_model['name'] = 'my-subnet'
+ subnet_reference_model['resource_type'] = 'subnet'
+
+ bare_metal_server_network_attachment_reference_model = {} # BareMetalServerNetworkAttachmentReference
+ bare_metal_server_network_attachment_reference_model['deleted'] = bare_metal_server_network_attachment_reference_deleted_model
+ bare_metal_server_network_attachment_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/2302-f7a2bf57-af7c-49d9-b599-b2c91293d30c/network_attachments/2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6'
+ bare_metal_server_network_attachment_reference_model['id'] = '2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6'
+ bare_metal_server_network_attachment_reference_model['name'] = 'my-bare-metal-server-network-attachment'
+ bare_metal_server_network_attachment_reference_model['primary_ip'] = reserved_ip_reference_model
+ bare_metal_server_network_attachment_reference_model['resource_type'] = 'bare_metal_server_network_attachment'
+ bare_metal_server_network_attachment_reference_model['subnet'] = subnet_reference_model
+
+ 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'
+
+ 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-bare-metal-server-network-interface'
+ network_interface_bare_metal_server_context_reference_model['primary_ip'] = reserved_ip_reference_model
+ network_interface_bare_metal_server_context_reference_model['resource_type'] = 'network_interface'
+ network_interface_bare_metal_server_context_reference_model['subnet'] = subnet_reference_model
+
+ 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'] = 'disabled'
+ bare_metal_server_trusted_platform_module_model['supported_modes'] = ['disabled']
+
+ vpc_reference_deleted_model = {} # VPCReferenceDeleted
+ vpc_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+
+ vpc_reference_model = {} # VPCReference
+ vpc_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b'
+ vpc_reference_model['deleted'] = vpc_reference_deleted_model
+ vpc_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b'
+ vpc_reference_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b'
+ vpc_reference_model['name'] = 'my-vpc'
+ vpc_reference_model['resource_type'] = 'vpc'
+
+ 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['lifecycle_reasons'] = [bare_metal_server_lifecycle_reason_model]
+ bare_metal_server_model['lifecycle_state'] = 'stable'
+ bare_metal_server_model['memory'] = 1536
+ bare_metal_server_model['name'] = 'my-bare-metal-server'
+ bare_metal_server_model['network_attachments'] = [bare_metal_server_network_attachment_reference_model]
+ bare_metal_server_model['network_interfaces'] = [network_interface_bare_metal_server_context_reference_model]
+ bare_metal_server_model['primary_network_attachment'] = bare_metal_server_network_attachment_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'] = 'deleting'
+ 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'] = 'fcp'
+ bare_metal_server_disk_model_json['name'] = 'my-bare-metal-server-disk'
+ bare_metal_server_disk_model_json['resource_type'] = 'bare_metal_server_disk'
+ bare_metal_server_disk_model_json['size'] = 100
+
+ # 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'] = 'fcp'
+ bare_metal_server_disk_model['name'] = 'my-bare-metal-server-disk'
+ bare_metal_server_disk_model['resource_type'] = 'bare_metal_server_disk'
+ bare_metal_server_disk_model['size'] = 100
+
+ # 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'
+
+ account_reference_model = {} # AccountReference
+ account_reference_model['id'] = 'aa2432b1fa4d4ace891e9b80fc104e34'
+ account_reference_model['resource_type'] = 'account'
+
+ 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'
+
+ image_remote_model = {} # ImageRemote
+ image_remote_model['account'] = account_reference_model
+ image_remote_model['region'] = region_reference_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'
+ image_reference_model['remote'] = image_remote_model
+ image_reference_model['resource_type'] = '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_BareMetalServerLifecycleReason:
+ """
+ Test Class for BareMetalServerLifecycleReason
+ """
+
+ def test_bare_metal_server_lifecycle_reason_serialization(self):
+ """
+ Test serialization/deserialization for BareMetalServerLifecycleReason
+ """
+
+ # Construct a json representation of a BareMetalServerLifecycleReason model
+ bare_metal_server_lifecycle_reason_model_json = {}
+ bare_metal_server_lifecycle_reason_model_json['code'] = 'resource_suspended_by_provider'
+ bare_metal_server_lifecycle_reason_model_json['message'] = 'The resource has been suspended. Contact IBM support with the CRN for next steps.'
+ bare_metal_server_lifecycle_reason_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#resource-suspension'
+
+ # Construct a model instance of BareMetalServerLifecycleReason by calling from_dict on the json representation
+ bare_metal_server_lifecycle_reason_model = BareMetalServerLifecycleReason.from_dict(bare_metal_server_lifecycle_reason_model_json)
+ assert bare_metal_server_lifecycle_reason_model != False
+
+ # Construct a model instance of BareMetalServerLifecycleReason by calling from_dict on the json representation
+ bare_metal_server_lifecycle_reason_model_dict = BareMetalServerLifecycleReason.from_dict(bare_metal_server_lifecycle_reason_model_json).__dict__
+ bare_metal_server_lifecycle_reason_model2 = BareMetalServerLifecycleReason(**bare_metal_server_lifecycle_reason_model_dict)
+
+ # Verify the model instances are equivalent
+ assert bare_metal_server_lifecycle_reason_model == bare_metal_server_lifecycle_reason_model2
+
+ # Convert model instance back to dict and verify no loss of data
+ bare_metal_server_lifecycle_reason_model_json2 = bare_metal_server_lifecycle_reason_model.to_dict()
+ assert bare_metal_server_lifecycle_reason_model_json2 == bare_metal_server_lifecycle_reason_model_json
+
+
+class TestModel_BareMetalServerNetworkAttachmentCollection:
+ """
+ Test Class for BareMetalServerNetworkAttachmentCollection
+ """
+
+ def test_bare_metal_server_network_attachment_collection_serialization(self):
+ """
+ Test serialization/deserialization for BareMetalServerNetworkAttachmentCollection
+ """
+
+ # Construct dict forms of any model objects needed in order to build this model.
+
+ bare_metal_server_network_attachment_collection_first_model = {} # BareMetalServerNetworkAttachmentCollectionFirst
+ bare_metal_server_network_attachment_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/3b2669a2-4c2b-4003-bc91-1b81f1326267/network_attachments?limit=20'
+
+ reserved_ip_reference_deleted_model = {} # ReservedIPReferenceDeleted
+ reserved_ip_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+
+ reserved_ip_reference_model = {} # ReservedIPReference
+ reserved_ip_reference_model['address'] = '192.168.3.4'
+ reserved_ip_reference_model['deleted'] = reserved_ip_reference_deleted_model
+ reserved_ip_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb'
+ reserved_ip_reference_model['id'] = '6d353a0f-aeb1-4ae1-832e-1110d10981bb'
+ reserved_ip_reference_model['name'] = 'my-reserved-ip'
+ reserved_ip_reference_model['resource_type'] = 'subnet_reserved_ip'
+
+ subnet_reference_deleted_model = {} # SubnetReferenceDeleted
+ subnet_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+
+ subnet_reference_model = {} # SubnetReference
+ subnet_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
+ subnet_reference_model['deleted'] = subnet_reference_deleted_model
+ subnet_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
+ subnet_reference_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
+ subnet_reference_model['name'] = 'my-subnet'
+ subnet_reference_model['resource_type'] = 'subnet'
+
+ virtual_network_interface_reference_attachment_context_model = {} # VirtualNetworkInterfaceReferenceAttachmentContext
+ virtual_network_interface_reference_attachment_context_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9'
+ virtual_network_interface_reference_attachment_context_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9'
+ virtual_network_interface_reference_attachment_context_model['id'] = '0767-fa41aecb-4f21-423d-8082-630bfba1e1d9'
+ virtual_network_interface_reference_attachment_context_model['name'] = 'my-virtual-network-interface'
+ virtual_network_interface_reference_attachment_context_model['resource_type'] = 'virtual_network_interface'
+
+ bare_metal_server_network_attachment_model = {} # BareMetalServerNetworkAttachmentByPCI
+ bare_metal_server_network_attachment_model['created_at'] = '2019-01-01T12:00:00Z'
+ bare_metal_server_network_attachment_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/2302-f7a2bf57-af7c-49d9-b599-b2c91293d30c/network_attachments/2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6'
+ bare_metal_server_network_attachment_model['id'] = '2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6'
+ bare_metal_server_network_attachment_model['lifecycle_state'] = 'stable'
+ bare_metal_server_network_attachment_model['name'] = 'my-bare-metal-server-network-attachment'
+ bare_metal_server_network_attachment_model['port_speed'] = 1000
+ bare_metal_server_network_attachment_model['primary_ip'] = reserved_ip_reference_model
+ bare_metal_server_network_attachment_model['resource_type'] = 'bare_metal_server_network_attachment'
+ bare_metal_server_network_attachment_model['subnet'] = subnet_reference_model
+ bare_metal_server_network_attachment_model['type'] = 'primary'
+ bare_metal_server_network_attachment_model['virtual_network_interface'] = virtual_network_interface_reference_attachment_context_model
+ bare_metal_server_network_attachment_model['allowed_vlans'] = [4]
+ bare_metal_server_network_attachment_model['interface_type'] = 'pci'
+
+ bare_metal_server_network_attachment_collection_next_model = {} # BareMetalServerNetworkAttachmentCollectionNext
+ bare_metal_server_network_attachment_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/3b2669a2-4c2b-4003-bc91-1b81f1326267/network_attachments?start=d3e721fd-c988-4670-9927-dbd5e7b07fc6&limit=20'
+
+ # Construct a json representation of a BareMetalServerNetworkAttachmentCollection model
+ bare_metal_server_network_attachment_collection_model_json = {}
+ bare_metal_server_network_attachment_collection_model_json['first'] = bare_metal_server_network_attachment_collection_first_model
+ bare_metal_server_network_attachment_collection_model_json['limit'] = 20
+ bare_metal_server_network_attachment_collection_model_json['network_attachments'] = [bare_metal_server_network_attachment_model]
+ bare_metal_server_network_attachment_collection_model_json['next'] = bare_metal_server_network_attachment_collection_next_model
+ bare_metal_server_network_attachment_collection_model_json['total_count'] = 132
+
+ # Construct a model instance of BareMetalServerNetworkAttachmentCollection by calling from_dict on the json representation
+ bare_metal_server_network_attachment_collection_model = BareMetalServerNetworkAttachmentCollection.from_dict(bare_metal_server_network_attachment_collection_model_json)
+ assert bare_metal_server_network_attachment_collection_model != False
+
+ # Construct a model instance of BareMetalServerNetworkAttachmentCollection by calling from_dict on the json representation
+ bare_metal_server_network_attachment_collection_model_dict = BareMetalServerNetworkAttachmentCollection.from_dict(bare_metal_server_network_attachment_collection_model_json).__dict__
+ bare_metal_server_network_attachment_collection_model2 = BareMetalServerNetworkAttachmentCollection(**bare_metal_server_network_attachment_collection_model_dict)
+
+ # Verify the model instances are equivalent
+ assert bare_metal_server_network_attachment_collection_model == bare_metal_server_network_attachment_collection_model2
+
+ # Convert model instance back to dict and verify no loss of data
+ bare_metal_server_network_attachment_collection_model_json2 = bare_metal_server_network_attachment_collection_model.to_dict()
+ assert bare_metal_server_network_attachment_collection_model_json2 == bare_metal_server_network_attachment_collection_model_json
+
+
+class TestModel_BareMetalServerNetworkAttachmentCollectionFirst:
+ """
+ Test Class for BareMetalServerNetworkAttachmentCollectionFirst
+ """
+
+ def test_bare_metal_server_network_attachment_collection_first_serialization(self):
+ """
+ Test serialization/deserialization for BareMetalServerNetworkAttachmentCollectionFirst
+ """
+
+ # Construct a json representation of a BareMetalServerNetworkAttachmentCollectionFirst model
+ bare_metal_server_network_attachment_collection_first_model_json = {}
+ bare_metal_server_network_attachment_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/3b2669a2-4c2b-4003-bc91-1b81f1326267/network_attachments?limit=20'
+
+ # Construct a model instance of BareMetalServerNetworkAttachmentCollectionFirst by calling from_dict on the json representation
+ bare_metal_server_network_attachment_collection_first_model = BareMetalServerNetworkAttachmentCollectionFirst.from_dict(bare_metal_server_network_attachment_collection_first_model_json)
+ assert bare_metal_server_network_attachment_collection_first_model != False
+
+ # Construct a model instance of BareMetalServerNetworkAttachmentCollectionFirst by calling from_dict on the json representation
+ bare_metal_server_network_attachment_collection_first_model_dict = BareMetalServerNetworkAttachmentCollectionFirst.from_dict(bare_metal_server_network_attachment_collection_first_model_json).__dict__
+ bare_metal_server_network_attachment_collection_first_model2 = BareMetalServerNetworkAttachmentCollectionFirst(**bare_metal_server_network_attachment_collection_first_model_dict)
+
+ # Verify the model instances are equivalent
+ assert bare_metal_server_network_attachment_collection_first_model == bare_metal_server_network_attachment_collection_first_model2
+
+ # Convert model instance back to dict and verify no loss of data
+ bare_metal_server_network_attachment_collection_first_model_json2 = bare_metal_server_network_attachment_collection_first_model.to_dict()
+ assert bare_metal_server_network_attachment_collection_first_model_json2 == bare_metal_server_network_attachment_collection_first_model_json
+
+
+class TestModel_BareMetalServerNetworkAttachmentCollectionNext:
+ """
+ Test Class for BareMetalServerNetworkAttachmentCollectionNext
+ """
+
+ def test_bare_metal_server_network_attachment_collection_next_serialization(self):
+ """
+ Test serialization/deserialization for BareMetalServerNetworkAttachmentCollectionNext
+ """
+
+ # Construct a json representation of a BareMetalServerNetworkAttachmentCollectionNext model
+ bare_metal_server_network_attachment_collection_next_model_json = {}
+ bare_metal_server_network_attachment_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/3b2669a2-4c2b-4003-bc91-1b81f1326267/network_attachments?start=d3e721fd-c988-4670-9927-dbd5e7b07fc6&limit=20'
+
+ # Construct a model instance of BareMetalServerNetworkAttachmentCollectionNext by calling from_dict on the json representation
+ bare_metal_server_network_attachment_collection_next_model = BareMetalServerNetworkAttachmentCollectionNext.from_dict(bare_metal_server_network_attachment_collection_next_model_json)
+ assert bare_metal_server_network_attachment_collection_next_model != False
+
+ # Construct a model instance of BareMetalServerNetworkAttachmentCollectionNext by calling from_dict on the json representation
+ bare_metal_server_network_attachment_collection_next_model_dict = BareMetalServerNetworkAttachmentCollectionNext.from_dict(bare_metal_server_network_attachment_collection_next_model_json).__dict__
+ bare_metal_server_network_attachment_collection_next_model2 = BareMetalServerNetworkAttachmentCollectionNext(**bare_metal_server_network_attachment_collection_next_model_dict)
+
+ # Verify the model instances are equivalent
+ assert bare_metal_server_network_attachment_collection_next_model == bare_metal_server_network_attachment_collection_next_model2
+
+ # Convert model instance back to dict and verify no loss of data
+ bare_metal_server_network_attachment_collection_next_model_json2 = bare_metal_server_network_attachment_collection_next_model.to_dict()
+ assert bare_metal_server_network_attachment_collection_next_model_json2 == bare_metal_server_network_attachment_collection_next_model_json
+
+
+class TestModel_BareMetalServerNetworkAttachmentPatch:
+ """
+ Test Class for BareMetalServerNetworkAttachmentPatch
+ """
+
+ def test_bare_metal_server_network_attachment_patch_serialization(self):
+ """
+ Test serialization/deserialization for BareMetalServerNetworkAttachmentPatch
+ """
+
+ # Construct a json representation of a BareMetalServerNetworkAttachmentPatch model
+ bare_metal_server_network_attachment_patch_model_json = {}
+ bare_metal_server_network_attachment_patch_model_json['allowed_vlans'] = [4]
+ bare_metal_server_network_attachment_patch_model_json['name'] = 'my-bare-metal-server-network-attachment-updated'
+
+ # Construct a model instance of BareMetalServerNetworkAttachmentPatch by calling from_dict on the json representation
+ bare_metal_server_network_attachment_patch_model = BareMetalServerNetworkAttachmentPatch.from_dict(bare_metal_server_network_attachment_patch_model_json)
+ assert bare_metal_server_network_attachment_patch_model != False
+
+ # Construct a model instance of BareMetalServerNetworkAttachmentPatch by calling from_dict on the json representation
+ bare_metal_server_network_attachment_patch_model_dict = BareMetalServerNetworkAttachmentPatch.from_dict(bare_metal_server_network_attachment_patch_model_json).__dict__
+ bare_metal_server_network_attachment_patch_model2 = BareMetalServerNetworkAttachmentPatch(**bare_metal_server_network_attachment_patch_model_dict)
+
+ # Verify the model instances are equivalent
+ assert bare_metal_server_network_attachment_patch_model == bare_metal_server_network_attachment_patch_model2
+
+ # Convert model instance back to dict and verify no loss of data
+ bare_metal_server_network_attachment_patch_model_json2 = bare_metal_server_network_attachment_patch_model.to_dict()
+ assert bare_metal_server_network_attachment_patch_model_json2 == bare_metal_server_network_attachment_patch_model_json
+
+
+class TestModel_BareMetalServerNetworkAttachmentReference:
+ """
+ Test Class for BareMetalServerNetworkAttachmentReference
+ """
+
+ def test_bare_metal_server_network_attachment_reference_serialization(self):
+ """
+ Test serialization/deserialization for BareMetalServerNetworkAttachmentReference
+ """
+
+ # Construct dict forms of any model objects needed in order to build this model.
+
+ bare_metal_server_network_attachment_reference_deleted_model = {} # BareMetalServerNetworkAttachmentReferenceDeleted
+ bare_metal_server_network_attachment_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+
+ reserved_ip_reference_deleted_model = {} # ReservedIPReferenceDeleted
+ reserved_ip_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+
+ reserved_ip_reference_model = {} # ReservedIPReference
+ reserved_ip_reference_model['address'] = '192.168.3.4'
+ reserved_ip_reference_model['deleted'] = reserved_ip_reference_deleted_model
+ reserved_ip_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb'
+ reserved_ip_reference_model['id'] = '6d353a0f-aeb1-4ae1-832e-1110d10981bb'
+ reserved_ip_reference_model['name'] = 'my-reserved-ip'
+ reserved_ip_reference_model['resource_type'] = 'subnet_reserved_ip'
+
+ subnet_reference_deleted_model = {} # SubnetReferenceDeleted
+ subnet_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+
+ subnet_reference_model = {} # SubnetReference
+ subnet_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
+ subnet_reference_model['deleted'] = subnet_reference_deleted_model
+ subnet_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
+ subnet_reference_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
+ subnet_reference_model['name'] = 'my-subnet'
+ subnet_reference_model['resource_type'] = 'subnet'
+
+ # Construct a json representation of a BareMetalServerNetworkAttachmentReference model
+ bare_metal_server_network_attachment_reference_model_json = {}
+ bare_metal_server_network_attachment_reference_model_json['deleted'] = bare_metal_server_network_attachment_reference_deleted_model
+ bare_metal_server_network_attachment_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/2302-f7a2bf57-af7c-49d9-b599-b2c91293d30c/network_attachments/2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6'
+ bare_metal_server_network_attachment_reference_model_json['id'] = '2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6'
+ bare_metal_server_network_attachment_reference_model_json['name'] = 'my-bare-metal-server-network-attachment'
+ bare_metal_server_network_attachment_reference_model_json['primary_ip'] = reserved_ip_reference_model
+ bare_metal_server_network_attachment_reference_model_json['resource_type'] = 'bare_metal_server_network_attachment'
+ bare_metal_server_network_attachment_reference_model_json['subnet'] = subnet_reference_model
+
+ # Construct a model instance of BareMetalServerNetworkAttachmentReference by calling from_dict on the json representation
+ bare_metal_server_network_attachment_reference_model = BareMetalServerNetworkAttachmentReference.from_dict(bare_metal_server_network_attachment_reference_model_json)
+ assert bare_metal_server_network_attachment_reference_model != False
+
+ # Construct a model instance of BareMetalServerNetworkAttachmentReference by calling from_dict on the json representation
+ bare_metal_server_network_attachment_reference_model_dict = BareMetalServerNetworkAttachmentReference.from_dict(bare_metal_server_network_attachment_reference_model_json).__dict__
+ bare_metal_server_network_attachment_reference_model2 = BareMetalServerNetworkAttachmentReference(**bare_metal_server_network_attachment_reference_model_dict)
+
+ # Verify the model instances are equivalent
+ assert bare_metal_server_network_attachment_reference_model == bare_metal_server_network_attachment_reference_model2
+
+ # Convert model instance back to dict and verify no loss of data
+ bare_metal_server_network_attachment_reference_model_json2 = bare_metal_server_network_attachment_reference_model.to_dict()
+ assert bare_metal_server_network_attachment_reference_model_json2 == bare_metal_server_network_attachment_reference_model_json
+
+
+class TestModel_BareMetalServerNetworkAttachmentReferenceDeleted:
+ """
+ Test Class for BareMetalServerNetworkAttachmentReferenceDeleted
+ """
+
+ def test_bare_metal_server_network_attachment_reference_deleted_serialization(self):
+ """
+ Test serialization/deserialization for BareMetalServerNetworkAttachmentReferenceDeleted
+ """
+
+ # Construct a json representation of a BareMetalServerNetworkAttachmentReferenceDeleted model
+ bare_metal_server_network_attachment_reference_deleted_model_json = {}
+ bare_metal_server_network_attachment_reference_deleted_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+
+ # Construct a model instance of BareMetalServerNetworkAttachmentReferenceDeleted by calling from_dict on the json representation
+ bare_metal_server_network_attachment_reference_deleted_model = BareMetalServerNetworkAttachmentReferenceDeleted.from_dict(bare_metal_server_network_attachment_reference_deleted_model_json)
+ assert bare_metal_server_network_attachment_reference_deleted_model != False
+
+ # Construct a model instance of BareMetalServerNetworkAttachmentReferenceDeleted by calling from_dict on the json representation
+ bare_metal_server_network_attachment_reference_deleted_model_dict = BareMetalServerNetworkAttachmentReferenceDeleted.from_dict(bare_metal_server_network_attachment_reference_deleted_model_json).__dict__
+ bare_metal_server_network_attachment_reference_deleted_model2 = BareMetalServerNetworkAttachmentReferenceDeleted(**bare_metal_server_network_attachment_reference_deleted_model_dict)
+
+ # Verify the model instances are equivalent
+ assert bare_metal_server_network_attachment_reference_deleted_model == bare_metal_server_network_attachment_reference_deleted_model2
+
+ # Convert model instance back to dict and verify no loss of data
+ bare_metal_server_network_attachment_reference_deleted_model_json2 = bare_metal_server_network_attachment_reference_deleted_model.to_dict()
+ assert bare_metal_server_network_attachment_reference_deleted_model_json2 == bare_metal_server_network_attachment_reference_deleted_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'
+
+ reserved_ip_reference_deleted_model = {} # ReservedIPReferenceDeleted
+ reserved_ip_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+
+ reserved_ip_reference_model = {} # ReservedIPReference
+ reserved_ip_reference_model['address'] = '192.168.3.4'
+ reserved_ip_reference_model['deleted'] = reserved_ip_reference_deleted_model
+ reserved_ip_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb'
+ reserved_ip_reference_model['id'] = '6d353a0f-aeb1-4ae1-832e-1110d10981bb'
+ reserved_ip_reference_model['name'] = 'my-reserved-ip'
+ reserved_ip_reference_model['resource_type'] = 'subnet_reserved_ip'
+
+ security_group_reference_deleted_model = {} # SecurityGroupReferenceDeleted
+ security_group_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+
+ security_group_reference_model = {} # SecurityGroupReference
+ security_group_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271'
+ security_group_reference_model['deleted'] = security_group_reference_deleted_model
+ security_group_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271'
+ security_group_reference_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271'
+ security_group_reference_model['name'] = 'my-security-group'
+
+ subnet_reference_deleted_model = {} # SubnetReferenceDeleted
+ subnet_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+
+ subnet_reference_model = {} # SubnetReference
+ subnet_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
+ subnet_reference_model['deleted'] = subnet_reference_deleted_model
+ subnet_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
+ subnet_reference_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
+ subnet_reference_model['name'] = 'my-subnet'
+ subnet_reference_model['resource_type'] = 'subnet'
+
+ bare_metal_server_network_interface_model = {} # BareMetalServerNetworkInterfaceByHiperSocket
+ bare_metal_server_network_interface_model['allow_ip_spoofing'] = True
+ bare_metal_server_network_interface_model['created_at'] = '2019-01-01T12:00:00Z'
+ bare_metal_server_network_interface_model['enable_infrastructure_nat'] = True
+ bare_metal_server_network_interface_model['floating_ips'] = [floating_ip_reference_model]
+ bare_metal_server_network_interface_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e'
+ bare_metal_server_network_interface_model['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e'
+ bare_metal_server_network_interface_model['mac_address'] = '02:00:04:00:C4:6A'
+ bare_metal_server_network_interface_model['name'] = 'my-bare-metal-server-network-interface'
+ bare_metal_server_network_interface_model['port_speed'] = 1000
+ bare_metal_server_network_interface_model['primary_ip'] = reserved_ip_reference_model
+ bare_metal_server_network_interface_model['resource_type'] = 'network_interface'
+ 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['interface_type'] = 'hipersocket'
+
+ bare_metal_server_network_interface_collection_next_model = {} # BareMetalServerNetworkInterfaceCollectionNext
+ bare_metal_server_network_interface_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/3b2669a2-4c2b-4003-bc91-1b81f1326267/network_interfaces?start=d3e721fd-c988-4670-9927-dbd5e7b07fc6&limit=20'
+
+ # 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-bare-metal-server-network-interface'
+
+ # Construct a model instance of BareMetalServerNetworkInterfacePatch by calling from_dict on the json representation
+ bare_metal_server_network_interface_patch_model = BareMetalServerNetworkInterfacePatch.from_dict(bare_metal_server_network_interface_patch_model_json)
+ 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_BareMetalServerNetworkInterfaceReferenceDeleted:
+ """
+ Test Class for BareMetalServerNetworkInterfaceReferenceDeleted
+ """
+
+ def test_bare_metal_server_network_interface_reference_deleted_serialization(self):
+ """
+ Test serialization/deserialization for BareMetalServerNetworkInterfaceReferenceDeleted
+ """
+
+ # Construct a json representation of a BareMetalServerNetworkInterfaceReferenceDeleted model
+ bare_metal_server_network_interface_reference_deleted_model_json = {}
+ bare_metal_server_network_interface_reference_deleted_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+
+ # Construct a model instance of BareMetalServerNetworkInterfaceReferenceDeleted by calling from_dict on the json representation
+ bare_metal_server_network_interface_reference_deleted_model = BareMetalServerNetworkInterfaceReferenceDeleted.from_dict(bare_metal_server_network_interface_reference_deleted_model_json)
+ assert bare_metal_server_network_interface_reference_deleted_model != False
+
+ # Construct a model instance of BareMetalServerNetworkInterfaceReferenceDeleted by calling from_dict on the json representation
+ bare_metal_server_network_interface_reference_deleted_model_dict = BareMetalServerNetworkInterfaceReferenceDeleted.from_dict(bare_metal_server_network_interface_reference_deleted_model_json).__dict__
+ bare_metal_server_network_interface_reference_deleted_model2 = BareMetalServerNetworkInterfaceReferenceDeleted(**bare_metal_server_network_interface_reference_deleted_model_dict)
+
+ # Verify the model instances are equivalent
+ assert bare_metal_server_network_interface_reference_deleted_model == bare_metal_server_network_interface_reference_deleted_model2
+
+ # Convert model instance back to dict and verify no loss of data
+ bare_metal_server_network_interface_reference_deleted_model_json2 = bare_metal_server_network_interface_reference_deleted_model.to_dict()
+ assert bare_metal_server_network_interface_reference_deleted_model_json2 == bare_metal_server_network_interface_reference_deleted_model_json
+
+
+class TestModel_BareMetalServerNetworkInterfaceReferenceTargetContextDeleted:
+ """
+ Test Class for BareMetalServerNetworkInterfaceReferenceTargetContextDeleted
+ """
+
+ def test_bare_metal_server_network_interface_reference_target_context_deleted_serialization(self):
+ """
+ Test serialization/deserialization for BareMetalServerNetworkInterfaceReferenceTargetContextDeleted
+ """
+
+ # Construct a json representation of a BareMetalServerNetworkInterfaceReferenceTargetContextDeleted model
+ bare_metal_server_network_interface_reference_target_context_deleted_model_json = {}
+ bare_metal_server_network_interface_reference_target_context_deleted_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+
+ # Construct a model instance of BareMetalServerNetworkInterfaceReferenceTargetContextDeleted by calling from_dict on the json representation
+ bare_metal_server_network_interface_reference_target_context_deleted_model = BareMetalServerNetworkInterfaceReferenceTargetContextDeleted.from_dict(bare_metal_server_network_interface_reference_target_context_deleted_model_json)
+ assert bare_metal_server_network_interface_reference_target_context_deleted_model != False
+
+ # Construct a model instance of BareMetalServerNetworkInterfaceReferenceTargetContextDeleted by calling from_dict on the json representation
+ bare_metal_server_network_interface_reference_target_context_deleted_model_dict = BareMetalServerNetworkInterfaceReferenceTargetContextDeleted.from_dict(bare_metal_server_network_interface_reference_target_context_deleted_model_json).__dict__
+ bare_metal_server_network_interface_reference_target_context_deleted_model2 = BareMetalServerNetworkInterfaceReferenceTargetContextDeleted(**bare_metal_server_network_interface_reference_target_context_deleted_model_dict)
+
+ # Verify the model instances are equivalent
+ assert bare_metal_server_network_interface_reference_target_context_deleted_model == bare_metal_server_network_interface_reference_target_context_deleted_model2
+
+ # Convert model instance back to dict and verify no loss of data
+ bare_metal_server_network_interface_reference_target_context_deleted_model_json2 = bare_metal_server_network_interface_reference_target_context_deleted_model.to_dict()
+ assert bare_metal_server_network_interface_reference_target_context_deleted_model_json2 == bare_metal_server_network_interface_reference_target_context_deleted_model_json
+
+
+class TestModel_BareMetalServerPatch:
+ """
+ Test Class for BareMetalServerPatch
+ """
+
+ def test_bare_metal_server_patch_serialization(self):
+ """
+ Test serialization/deserialization for BareMetalServerPatch
+ """
+
+ # Construct dict forms of any model objects needed in order to build this model.
+
+ bare_metal_server_trusted_platform_module_patch_model = {} # BareMetalServerTrustedPlatformModulePatch
+ bare_metal_server_trusted_platform_module_patch_model['mode'] = 'disabled'
+
+ # Construct a json representation of a BareMetalServerPatch model
+ bare_metal_server_patch_model_json = {}
+ bare_metal_server_patch_model_json['enable_secure_boot'] = False
+ bare_metal_server_patch_model_json['name'] = 'my-bare-metal-server'
+ bare_metal_server_patch_model_json['trusted_platform_module'] = bare_metal_server_trusted_platform_module_patch_model
+
+ # 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.
+
+ network_interface_ip_prototype_model = {} # NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext
+ network_interface_ip_prototype_model['address'] = '10.0.0.5'
+ network_interface_ip_prototype_model['auto_delete'] = False
+ network_interface_ip_prototype_model['name'] = 'my-reserved-ip'
+
+ security_group_identity_model = {} # SecurityGroupIdentityById
+ security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271'
+
+ subnet_identity_model = {} # SubnetIdentityById
+ subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
+
+ # Construct a json representation of a 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-bare-metal-server-network-interface'
+ bare_metal_server_primary_network_interface_prototype_model_json['primary_ip'] = network_interface_ip_prototype_model
+ bare_metal_server_primary_network_interface_prototype_model_json['security_groups'] = [security_group_identity_model]
+ bare_metal_server_primary_network_interface_prototype_model_json['subnet'] = subnet_identity_model
+
+ # 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_console_types_model = {} # BareMetalServerProfileConsoleTypes
+ bare_metal_server_profile_console_types_model['type'] = 'enum'
+ bare_metal_server_profile_console_types_model['values'] = ['serial']
+
+ 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'] = 'fcp'
+ bare_metal_server_profile_disk_supported_interfaces_model['type'] = 'enum'
+ bare_metal_server_profile_disk_supported_interfaces_model['values'] = ['fcp']
+
+ bare_metal_server_profile_disk_model = {} # BareMetalServerProfileDisk
+ bare_metal_server_profile_disk_model['quantity'] = bare_metal_server_profile_disk_quantity_model
+ 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_network_attachment_count_model = {} # BareMetalServerProfileNetworkAttachmentCountRange
+ bare_metal_server_profile_network_attachment_count_model['max'] = 128
+ bare_metal_server_profile_network_attachment_count_model['min'] = 1
+ bare_metal_server_profile_network_attachment_count_model['type'] = 'range'
+
+ bare_metal_server_profile_network_interface_count_model = {} # BareMetalServerProfileNetworkInterfaceCountRange
+ bare_metal_server_profile_network_interface_count_model['max'] = 128
+ bare_metal_server_profile_network_interface_count_model['min'] = 1
+ bare_metal_server_profile_network_interface_count_model['type'] = 'range'
+
+ 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'] = ['disabled']
+
+ bare_metal_server_profile_virtual_network_interfaces_supported_model = {} # BareMetalServerProfileVirtualNetworkInterfacesSupported
+ bare_metal_server_profile_virtual_network_interfaces_supported_model['type'] = 'fixed'
+ bare_metal_server_profile_virtual_network_interfaces_supported_model['value'] = True
+
+ # 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['console_types'] = bare_metal_server_profile_console_types_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['network_attachment_count'] = bare_metal_server_profile_network_attachment_count_model
+ bare_metal_server_profile_model_json['network_interface_count'] = bare_metal_server_profile_network_interface_count_model
+ 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
+ bare_metal_server_profile_model_json['virtual_network_interfaces_supported'] = bare_metal_server_profile_virtual_network_interfaces_supported_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_console_types_model = {} # BareMetalServerProfileConsoleTypes
+ bare_metal_server_profile_console_types_model['type'] = 'enum'
+ bare_metal_server_profile_console_types_model['values'] = ['serial']
+
+ 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'] = 'fcp'
+ bare_metal_server_profile_disk_supported_interfaces_model['type'] = 'enum'
+ bare_metal_server_profile_disk_supported_interfaces_model['values'] = ['fcp']
+
+ bare_metal_server_profile_disk_model = {} # BareMetalServerProfileDisk
+ bare_metal_server_profile_disk_model['quantity'] = bare_metal_server_profile_disk_quantity_model
+ 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_network_attachment_count_model = {} # BareMetalServerProfileNetworkAttachmentCountRange
+ bare_metal_server_profile_network_attachment_count_model['max'] = 128
+ bare_metal_server_profile_network_attachment_count_model['min'] = 1
+ bare_metal_server_profile_network_attachment_count_model['type'] = 'range'
+
+ bare_metal_server_profile_network_interface_count_model = {} # BareMetalServerProfileNetworkInterfaceCountRange
+ bare_metal_server_profile_network_interface_count_model['max'] = 128
+ bare_metal_server_profile_network_interface_count_model['min'] = 1
+ bare_metal_server_profile_network_interface_count_model['type'] = 'range'
+
+ 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'] = ['disabled']
+
+ bare_metal_server_profile_virtual_network_interfaces_supported_model = {} # BareMetalServerProfileVirtualNetworkInterfacesSupported
+ bare_metal_server_profile_virtual_network_interfaces_supported_model['type'] = 'fixed'
+ bare_metal_server_profile_virtual_network_interfaces_supported_model['value'] = True
+
+ bare_metal_server_profile_model = {} # BareMetalServerProfile
+ bare_metal_server_profile_model['bandwidth'] = bare_metal_server_profile_bandwidth_model
+ bare_metal_server_profile_model['console_types'] = bare_metal_server_profile_console_types_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['network_attachment_count'] = bare_metal_server_profile_network_attachment_count_model
+ bare_metal_server_profile_model['network_interface_count'] = bare_metal_server_profile_network_interface_count_model
+ 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
+ bare_metal_server_profile_model['virtual_network_interfaces_supported'] = bare_metal_server_profile_virtual_network_interfaces_supported_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_BareMetalServerProfileConsoleTypes:
+ """
+ Test Class for BareMetalServerProfileConsoleTypes
+ """
+
+ def test_bare_metal_server_profile_console_types_serialization(self):
+ """
+ Test serialization/deserialization for BareMetalServerProfileConsoleTypes
+ """
+
+ # Construct a json representation of a BareMetalServerProfileConsoleTypes model
+ bare_metal_server_profile_console_types_model_json = {}
+ bare_metal_server_profile_console_types_model_json['type'] = 'enum'
+ bare_metal_server_profile_console_types_model_json['values'] = ['serial']
+
+ # Construct a model instance of BareMetalServerProfileConsoleTypes by calling from_dict on the json representation
+ bare_metal_server_profile_console_types_model = BareMetalServerProfileConsoleTypes.from_dict(bare_metal_server_profile_console_types_model_json)
+ assert bare_metal_server_profile_console_types_model != False
+
+ # Construct a model instance of BareMetalServerProfileConsoleTypes by calling from_dict on the json representation
+ bare_metal_server_profile_console_types_model_dict = BareMetalServerProfileConsoleTypes.from_dict(bare_metal_server_profile_console_types_model_json).__dict__
+ bare_metal_server_profile_console_types_model2 = BareMetalServerProfileConsoleTypes(**bare_metal_server_profile_console_types_model_dict)
+
+ # Verify the model instances are equivalent
+ assert bare_metal_server_profile_console_types_model == bare_metal_server_profile_console_types_model2
+
+ # Convert model instance back to dict and verify no loss of data
+ bare_metal_server_profile_console_types_model_json2 = bare_metal_server_profile_console_types_model.to_dict()
+ assert bare_metal_server_profile_console_types_model_json2 == bare_metal_server_profile_console_types_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'] = 'fcp'
+ bare_metal_server_profile_disk_supported_interfaces_model['type'] = 'enum'
+ bare_metal_server_profile_disk_supported_interfaces_model['values'] = ['fcp']
+
+ # Construct a json representation of a BareMetalServerProfileDisk model
+ bare_metal_server_profile_disk_model_json = {}
+ 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'] = 'fcp'
+ bare_metal_server_profile_disk_supported_interfaces_model_json['type'] = 'enum'
+ bare_metal_server_profile_disk_supported_interfaces_model_json['values'] = ['fcp']
+
+ # Construct a model instance of BareMetalServerProfileDiskSupportedInterfaces by calling from_dict on the json representation
+ bare_metal_server_profile_disk_supported_interfaces_model = BareMetalServerProfileDiskSupportedInterfaces.from_dict(bare_metal_server_profile_disk_supported_interfaces_model_json)
+ 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'] = ['disabled']
+
+ # 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_BareMetalServerProfileVirtualNetworkInterfacesSupported:
+ """
+ Test Class for BareMetalServerProfileVirtualNetworkInterfacesSupported
+ """
+
+ def test_bare_metal_server_profile_virtual_network_interfaces_supported_serialization(self):
+ """
+ Test serialization/deserialization for BareMetalServerProfileVirtualNetworkInterfacesSupported
+ """
+
+ # Construct a json representation of a BareMetalServerProfileVirtualNetworkInterfacesSupported model
+ bare_metal_server_profile_virtual_network_interfaces_supported_model_json = {}
+ bare_metal_server_profile_virtual_network_interfaces_supported_model_json['type'] = 'fixed'
+ bare_metal_server_profile_virtual_network_interfaces_supported_model_json['value'] = True
+
+ # Construct a model instance of BareMetalServerProfileVirtualNetworkInterfacesSupported by calling from_dict on the json representation
+ bare_metal_server_profile_virtual_network_interfaces_supported_model = BareMetalServerProfileVirtualNetworkInterfacesSupported.from_dict(bare_metal_server_profile_virtual_network_interfaces_supported_model_json)
+ assert bare_metal_server_profile_virtual_network_interfaces_supported_model != False
+
+ # Construct a model instance of BareMetalServerProfileVirtualNetworkInterfacesSupported by calling from_dict on the json representation
+ bare_metal_server_profile_virtual_network_interfaces_supported_model_dict = BareMetalServerProfileVirtualNetworkInterfacesSupported.from_dict(bare_metal_server_profile_virtual_network_interfaces_supported_model_json).__dict__
+ bare_metal_server_profile_virtual_network_interfaces_supported_model2 = BareMetalServerProfileVirtualNetworkInterfacesSupported(**bare_metal_server_profile_virtual_network_interfaces_supported_model_dict)
+
+ # Verify the model instances are equivalent
+ assert bare_metal_server_profile_virtual_network_interfaces_supported_model == bare_metal_server_profile_virtual_network_interfaces_supported_model2
+
+ # Convert model instance back to dict and verify no loss of data
+ bare_metal_server_profile_virtual_network_interfaces_supported_model_json2 = bare_metal_server_profile_virtual_network_interfaces_supported_model.to_dict()
+ assert bare_metal_server_profile_virtual_network_interfaces_supported_model_json2 == bare_metal_server_profile_virtual_network_interfaces_supported_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'] = 'disabled'
+ bare_metal_server_trusted_platform_module_model_json['supported_modes'] = ['disabled']
+
+ # 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_BareMetalServerTrustedPlatformModulePatch:
+ """
+ Test Class for BareMetalServerTrustedPlatformModulePatch
+ """
+
+ def test_bare_metal_server_trusted_platform_module_patch_serialization(self):
+ """
+ Test serialization/deserialization for BareMetalServerTrustedPlatformModulePatch
+ """
+
+ # Construct a json representation of a BareMetalServerTrustedPlatformModulePatch model
+ bare_metal_server_trusted_platform_module_patch_model_json = {}
+ bare_metal_server_trusted_platform_module_patch_model_json['mode'] = 'disabled'
+
+ # Construct a model instance of BareMetalServerTrustedPlatformModulePatch by calling from_dict on the json representation
+ bare_metal_server_trusted_platform_module_patch_model = BareMetalServerTrustedPlatformModulePatch.from_dict(bare_metal_server_trusted_platform_module_patch_model_json)
+ assert bare_metal_server_trusted_platform_module_patch_model != False
+
+ # Construct a model instance of BareMetalServerTrustedPlatformModulePatch by calling from_dict on the json representation
+ bare_metal_server_trusted_platform_module_patch_model_dict = BareMetalServerTrustedPlatformModulePatch.from_dict(bare_metal_server_trusted_platform_module_patch_model_json).__dict__
+ bare_metal_server_trusted_platform_module_patch_model2 = BareMetalServerTrustedPlatformModulePatch(**bare_metal_server_trusted_platform_module_patch_model_dict)
+
+ # Verify the model instances are equivalent
+ assert bare_metal_server_trusted_platform_module_patch_model == bare_metal_server_trusted_platform_module_patch_model2
+
+ # Convert model instance back to dict and verify no loss of data
+ bare_metal_server_trusted_platform_module_patch_model_json2 = bare_metal_server_trusted_platform_module_patch_model.to_dict()
+ assert bare_metal_server_trusted_platform_module_patch_model_json2 == bare_metal_server_trusted_platform_module_patch_model_json
+
+
+class TestModel_BareMetalServerTrustedPlatformModulePrototype:
+ """
+ Test Class for BareMetalServerTrustedPlatformModulePrototype
+ """
+
+ def test_bare_metal_server_trusted_platform_module_prototype_serialization(self):
+ """
+ Test serialization/deserialization for BareMetalServerTrustedPlatformModulePrototype
+ """
+
+ # Construct a json representation of a BareMetalServerTrustedPlatformModulePrototype model
+ bare_metal_server_trusted_platform_module_prototype_model_json = {}
+ bare_metal_server_trusted_platform_module_prototype_model_json['mode'] = 'disabled'
+
+ # Construct a model instance of BareMetalServerTrustedPlatformModulePrototype by calling from_dict on the json representation
+ bare_metal_server_trusted_platform_module_prototype_model = BareMetalServerTrustedPlatformModulePrototype.from_dict(bare_metal_server_trusted_platform_module_prototype_model_json)
+ assert bare_metal_server_trusted_platform_module_prototype_model != False
+
+ # Construct a model instance of BareMetalServerTrustedPlatformModulePrototype by calling from_dict on the json representation
+ bare_metal_server_trusted_platform_module_prototype_model_dict = BareMetalServerTrustedPlatformModulePrototype.from_dict(bare_metal_server_trusted_platform_module_prototype_model_json).__dict__
+ bare_metal_server_trusted_platform_module_prototype_model2 = BareMetalServerTrustedPlatformModulePrototype(**bare_metal_server_trusted_platform_module_prototype_model_dict)
+
+ # Verify the model instances are equivalent
+ assert bare_metal_server_trusted_platform_module_prototype_model == bare_metal_server_trusted_platform_module_prototype_model2
+
+ # Convert model instance back to dict and verify no loss of data
+ bare_metal_server_trusted_platform_module_prototype_model_json2 = bare_metal_server_trusted_platform_module_prototype_model.to_dict()
+ assert bare_metal_server_trusted_platform_module_prototype_model_json2 == bare_metal_server_trusted_platform_module_prototype_model_json
+
+
+class TestModel_CatalogOfferingVersionReference:
+ """
+ Test Class for CatalogOfferingVersionReference
+ """
+
+ def test_catalog_offering_version_reference_serialization(self):
+ """
+ Test serialization/deserialization for CatalogOfferingVersionReference
+ """
+
+ # Construct a json representation of a CatalogOfferingVersionReference model
+ catalog_offering_version_reference_model_json = {}
+ catalog_offering_version_reference_model_json['crn'] = 'crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d'
+
+ # Construct a model instance of CatalogOfferingVersionReference by calling from_dict on the json representation
+ catalog_offering_version_reference_model = CatalogOfferingVersionReference.from_dict(catalog_offering_version_reference_model_json)
+ assert catalog_offering_version_reference_model != False
+
+ # Construct a model instance of CatalogOfferingVersionReference by calling from_dict on the json representation
+ catalog_offering_version_reference_model_dict = CatalogOfferingVersionReference.from_dict(catalog_offering_version_reference_model_json).__dict__
+ catalog_offering_version_reference_model2 = CatalogOfferingVersionReference(**catalog_offering_version_reference_model_dict)
+
+ # Verify the model instances are equivalent
+ assert catalog_offering_version_reference_model == catalog_offering_version_reference_model2
+
+ # Convert model instance back to dict and verify no loss of data
+ catalog_offering_version_reference_model_json2 = catalog_offering_version_reference_model.to_dict()
+ assert catalog_offering_version_reference_model_json2 == catalog_offering_version_reference_model_json
+
+
+class TestModel_CertificateInstanceReference:
+ """
+ Test Class for CertificateInstanceReference
+ """
+
+ 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:secrets-manager:us-south:a/123456:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5'
+
+ # Construct a model instance of CertificateInstanceReference by calling from_dict on the json representation
+ certificate_instance_reference_model = CertificateInstanceReference.from_dict(certificate_instance_reference_model_json)
+ 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['crn'] = 'crn:v1:bluemix:public:cloud-object-storage:global:a/123456:1a0ec336-f391-4091-a6fb-5e084a4c56f4:bucket:my-bucket'
+ 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_CloudObjectStorageObjectReference:
+ """
+ Test Class for CloudObjectStorageObjectReference
+ """
+
+ def test_cloud_object_storage_object_reference_serialization(self):
+ """
+ Test serialization/deserialization for CloudObjectStorageObjectReference
+ """
+
+ # Construct a json representation of a CloudObjectStorageObjectReference model
+ cloud_object_storage_object_reference_model_json = {}
+ cloud_object_storage_object_reference_model_json['name'] = 'my-object'
+
+ # Construct a model instance of CloudObjectStorageObjectReference by calling from_dict on the json representation
+ cloud_object_storage_object_reference_model = CloudObjectStorageObjectReference.from_dict(cloud_object_storage_object_reference_model_json)
+ assert cloud_object_storage_object_reference_model != False
+
+ # Construct a model instance of CloudObjectStorageObjectReference by calling from_dict on the json representation
+ cloud_object_storage_object_reference_model_dict = CloudObjectStorageObjectReference.from_dict(cloud_object_storage_object_reference_model_json).__dict__
+ cloud_object_storage_object_reference_model2 = CloudObjectStorageObjectReference(**cloud_object_storage_object_reference_model_dict)
+
+ # Verify the model instances are equivalent
+ assert cloud_object_storage_object_reference_model == cloud_object_storage_object_reference_model2
+
+ # Convert model instance back to dict and verify no loss of data
+ cloud_object_storage_object_reference_model_json2 = cloud_object_storage_object_reference_model.to_dict()
+ assert cloud_object_storage_object_reference_model_json2 == cloud_object_storage_object_reference_model_json
+
+
+class TestModel_DNSInstanceReference:
+ """
+ Test Class for DNSInstanceReference
+ """
+
+ def test_dns_instance_reference_serialization(self):
+ """
+ Test serialization/deserialization for DNSInstanceReference
+ """
+
+ # Construct a json representation of a DNSInstanceReference model
+ dns_instance_reference_model_json = {}
+ dns_instance_reference_model_json['crn'] = 'crn:v1:bluemix:public:dns-svcs:global:a/123456:6860c359-b2e2-46fa-a944-b38c28201c6e'
+
+ # Construct a model instance of DNSInstanceReference by calling from_dict on the json representation
+ dns_instance_reference_model = DNSInstanceReference.from_dict(dns_instance_reference_model_json)
+ assert dns_instance_reference_model != False
+
+ # Construct a model instance of DNSInstanceReference by calling from_dict on the json representation
+ dns_instance_reference_model_dict = DNSInstanceReference.from_dict(dns_instance_reference_model_json).__dict__
+ dns_instance_reference_model2 = DNSInstanceReference(**dns_instance_reference_model_dict)
+
+ # Verify the model instances are equivalent
+ assert dns_instance_reference_model == dns_instance_reference_model2
+
+ # Convert model instance back to dict and verify no loss of data
+ dns_instance_reference_model_json2 = dns_instance_reference_model.to_dict()
+ assert dns_instance_reference_model_json2 == dns_instance_reference_model_json
+
+
+class TestModel_DNSServer:
+ """
+ Test Class for DNSServer
+ """
+
+ def test_dns_server_serialization(self):
+ """
+ Test serialization/deserialization for DNSServer
+ """
+
+ # 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 DNSServer model
+ dns_server_model_json = {}
+ dns_server_model_json['address'] = '192.168.3.4'
+ dns_server_model_json['zone_affinity'] = zone_reference_model
+
+ # Construct a model instance of DNSServer by calling from_dict on the json representation
+ dns_server_model = DNSServer.from_dict(dns_server_model_json)
+ assert dns_server_model != False
+
+ # Construct a model instance of DNSServer by calling from_dict on the json representation
+ dns_server_model_dict = DNSServer.from_dict(dns_server_model_json).__dict__
+ dns_server_model2 = DNSServer(**dns_server_model_dict)
+
+ # Verify the model instances are equivalent
+ assert dns_server_model == dns_server_model2
+
+ # Convert model instance back to dict and verify no loss of data
+ dns_server_model_json2 = dns_server_model.to_dict()
+ assert dns_server_model_json2 == dns_server_model_json
+
+
+class TestModel_DNSServerPrototype:
+ """
+ Test Class for DNSServerPrototype
+ """
+
+ def test_dns_server_prototype_serialization(self):
+ """
+ Test serialization/deserialization for DNSServerPrototype
+ """
+
+ # 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'
+
+ # Construct a json representation of a DNSServerPrototype model
+ dns_server_prototype_model_json = {}
+ dns_server_prototype_model_json['address'] = '192.168.3.4'
+ dns_server_prototype_model_json['zone_affinity'] = zone_identity_model
+
+ # Construct a model instance of DNSServerPrototype by calling from_dict on the json representation
+ dns_server_prototype_model = DNSServerPrototype.from_dict(dns_server_prototype_model_json)
+ assert dns_server_prototype_model != False
+
+ # Construct a model instance of DNSServerPrototype by calling from_dict on the json representation
+ dns_server_prototype_model_dict = DNSServerPrototype.from_dict(dns_server_prototype_model_json).__dict__
+ dns_server_prototype_model2 = DNSServerPrototype(**dns_server_prototype_model_dict)
+
+ # Verify the model instances are equivalent
+ assert dns_server_prototype_model == dns_server_prototype_model2
+
+ # Convert model instance back to dict and verify no loss of data
+ dns_server_prototype_model_json2 = dns_server_prototype_model.to_dict()
+ assert dns_server_prototype_model_json2 == dns_server_prototype_model_json
+
+
+class TestModel_DNSZoneReference:
+ """
+ Test Class for DNSZoneReference
+ """
+
+ def test_dns_zone_reference_serialization(self):
+ """
+ Test serialization/deserialization for DNSZoneReference
+ """
+
+ # Construct a json representation of a DNSZoneReference model
+ dns_zone_reference_model_json = {}
+ dns_zone_reference_model_json['id'] = 'd66662cc-aa23-4fe1-9987-858487a61f45'
+
+ # Construct a model instance of DNSZoneReference by calling from_dict on the json representation
+ dns_zone_reference_model = DNSZoneReference.from_dict(dns_zone_reference_model_json)
+ assert dns_zone_reference_model != False
+
+ # Construct a model instance of DNSZoneReference by calling from_dict on the json representation
+ dns_zone_reference_model_dict = DNSZoneReference.from_dict(dns_zone_reference_model_json).__dict__
+ dns_zone_reference_model2 = DNSZoneReference(**dns_zone_reference_model_dict)
+
+ # Verify the model instances are equivalent
+ assert dns_zone_reference_model == dns_zone_reference_model2
+
+ # Convert model instance back to dict and verify no loss of data
+ dns_zone_reference_model_json2 = dns_zone_reference_model.to_dict()
+ assert dns_zone_reference_model_json2 == dns_zone_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
+ vcpu_model['manufacturer'] = 'intel'
+
+ 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_numa_node_model = {} # DedicatedHostNUMANode
+ dedicated_host_numa_node_model['available_vcpu'] = 24
+ dedicated_host_numa_node_model['vcpu'] = 56
+
+ dedicated_host_numa_model = {} # DedicatedHostNUMA
+ dedicated_host_numa_model['count'] = 2
+ dedicated_host_numa_model['nodes'] = [dedicated_host_numa_node_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'
+
+ 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/bx2-4x16'
+ instance_profile_reference_model['name'] = 'bx2-4x16'
+ instance_profile_reference_model['resource_type'] = 'instance_profile'
+
+ 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['numa'] = dedicated_host_numa_model
+ 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
+ vcpu_model['manufacturer'] = 'intel'
+
+ 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_numa_node_model = {} # DedicatedHostNUMANode
+ dedicated_host_numa_node_model['available_vcpu'] = 24
+ dedicated_host_numa_node_model['vcpu'] = 56
+
+ dedicated_host_numa_model = {} # DedicatedHostNUMA
+ dedicated_host_numa_model['count'] = 2
+ dedicated_host_numa_model['nodes'] = [dedicated_host_numa_node_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'
+
+ 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/bx2-4x16'
+ instance_profile_reference_model['name'] = 'bx2-4x16'
+ instance_profile_reference_model['resource_type'] = 'instance_profile'
+
+ 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['numa'] = dedicated_host_numa_model
+ 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/bx2-4x16'
+ instance_profile_reference_model['name'] = 'bx2-4x16'
+ instance_profile_reference_model['resource_type'] = 'instance_profile'
+
+ 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 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 DedicatedHostGroupCollection
+ """
+
+ def test_dedicated_host_group_collection_serialization(self):
+ """
+ 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/bx2-4x16'
+ instance_profile_reference_model['name'] = 'bx2-4x16'
+ instance_profile_reference_model['resource_type'] = 'instance_profile'
+
+ 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 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 dedicated_host_group_collection_model == dedicated_host_group_collection_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
+
+
+class TestModel_DedicatedHostGroupCollectionFirst:
+ """
+ Test Class for DedicatedHostGroupCollectionFirst
+ """
+
+ def test_dedicated_host_group_collection_first_serialization(self):
+ """
+ Test serialization/deserialization for DedicatedHostGroupCollectionFirst
+ """
+
+ # 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 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 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)
+
+ # Verify the model instances are equivalent
+ assert dedicated_host_group_collection_first_model == dedicated_host_group_collection_first_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
+
+
+class TestModel_DedicatedHostGroupCollectionNext:
+ """
+ Test Class for DedicatedHostGroupCollectionNext
+ """
+
+ def test_dedicated_host_group_collection_next_serialization(self):
+ """
+ Test serialization/deserialization for DedicatedHostGroupCollectionNext
+ """
+
+ # 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 dedicated_host_group_collection_next_model == dedicated_host_group_collection_next_model2
+
+ # 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
+
+
+class TestModel_DedicatedHostGroupPatch:
+ """
+ Test Class for DedicatedHostGroupPatch
+ """
+
+ def test_dedicated_host_group_patch_serialization(self):
+ """
+ Test serialization/deserialization for DedicatedHostGroupPatch
+ """
+
+ # 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 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 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 dedicated_host_group_patch_model == dedicated_host_group_patch_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
+
+
+class TestModel_DedicatedHostGroupPrototypeDedicatedHostByZoneContext:
+ """
+ Test Class for DedicatedHostGroupPrototypeDedicatedHostByZoneContext
+ """
+
+ def test_dedicated_host_group_prototype_dedicated_host_by_zone_context_serialization(self):
+ """
+ Test serialization/deserialization for DedicatedHostGroupPrototypeDedicatedHostByZoneContext
+ """
+
+ # 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'
+
+ # 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 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
+ 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_DedicatedHostGroupReference:
+ """
+ Test Class for DedicatedHostGroupReference
+ """
+
+ def test_dedicated_host_group_reference_serialization(self):
+ """
+ Test serialization/deserialization for DedicatedHostGroupReference
+ """
+
+ # 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'
+
+ # 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 dedicated_host_group_reference_model == dedicated_host_group_reference_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
+
+
+class TestModel_DedicatedHostGroupReferenceDeleted:
+ """
+ Test Class for DedicatedHostGroupReferenceDeleted
+ """
+
+ def test_dedicated_host_group_reference_deleted_serialization(self):
+ """
+ Test serialization/deserialization for DedicatedHostGroupReferenceDeleted
+ """
+
+ # 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 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 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 dedicated_host_group_reference_deleted_model == dedicated_host_group_reference_deleted_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
+
+
+class TestModel_DedicatedHostNUMA:
+ """
+ Test Class for DedicatedHostNUMA
+ """
+
+ def test_dedicated_host_numa_serialization(self):
+ """
+ Test serialization/deserialization for DedicatedHostNUMA
+ """
+
+ # Construct dict forms of any model objects needed in order to build this model.
+
+ dedicated_host_numa_node_model = {} # DedicatedHostNUMANode
+ dedicated_host_numa_node_model['available_vcpu'] = 24
+ dedicated_host_numa_node_model['vcpu'] = 56
+
+ # Construct a json representation of a DedicatedHostNUMA model
+ dedicated_host_numa_model_json = {}
+ dedicated_host_numa_model_json['count'] = 2
+ dedicated_host_numa_model_json['nodes'] = [dedicated_host_numa_node_model]
+
+ # Construct a model instance of DedicatedHostNUMA by calling from_dict on the json representation
+ dedicated_host_numa_model = DedicatedHostNUMA.from_dict(dedicated_host_numa_model_json)
+ assert dedicated_host_numa_model != False
+
+ # Construct a model instance of DedicatedHostNUMA by calling from_dict on the json representation
+ dedicated_host_numa_model_dict = DedicatedHostNUMA.from_dict(dedicated_host_numa_model_json).__dict__
+ dedicated_host_numa_model2 = DedicatedHostNUMA(**dedicated_host_numa_model_dict)
+
+ # Verify the model instances are equivalent
+ assert dedicated_host_numa_model == dedicated_host_numa_model2
+
+ # Convert model instance back to dict and verify no loss of data
+ dedicated_host_numa_model_json2 = dedicated_host_numa_model.to_dict()
+ assert dedicated_host_numa_model_json2 == dedicated_host_numa_model_json
+
+
+class TestModel_DedicatedHostNUMANode:
+ """
+ Test Class for DedicatedHostNUMANode
+ """
+
+ def test_dedicated_host_numa_node_serialization(self):
+ """
+ Test serialization/deserialization for DedicatedHostNUMANode
+ """
+
+ # Construct a json representation of a DedicatedHostNUMANode model
+ dedicated_host_numa_node_model_json = {}
+ dedicated_host_numa_node_model_json['available_vcpu'] = 24
+ dedicated_host_numa_node_model_json['vcpu'] = 56
+
+ # Construct a model instance of DedicatedHostNUMANode by calling from_dict on the json representation
+ dedicated_host_numa_node_model = DedicatedHostNUMANode.from_dict(dedicated_host_numa_node_model_json)
+ assert dedicated_host_numa_node_model != False
+
+ # Construct a model instance of DedicatedHostNUMANode by calling from_dict on the json representation
+ dedicated_host_numa_node_model_dict = DedicatedHostNUMANode.from_dict(dedicated_host_numa_node_model_json).__dict__
+ dedicated_host_numa_node_model2 = DedicatedHostNUMANode(**dedicated_host_numa_node_model_dict)
+
+ # Verify the model instances are equivalent
+ assert dedicated_host_numa_node_model == dedicated_host_numa_node_model2
+
+ # Convert model instance back to dict and verify no loss of data
+ dedicated_host_numa_node_model_json2 = dedicated_host_numa_node_model.to_dict()
+ assert dedicated_host_numa_node_model_json2 == dedicated_host_numa_node_model_json
+
+
+class TestModel_DedicatedHostPatch:
+ """
+ Test Class for DedicatedHostPatch
+ """
+
+ def test_dedicated_host_patch_serialization(self):
+ """
+ Test serialization/deserialization for DedicatedHostPatch
+ """
+
+ # 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 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 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 dedicated_host_patch_model == dedicated_host_patch_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
+
+
+class TestModel_DedicatedHostProfile:
+ """
+ Test Class for DedicatedHostProfile
+ """
+
+ def test_dedicated_host_profile_serialization(self):
+ """
+ Test serialization/deserialization for DedicatedHostProfile
+ """
+
+ # 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'
+
+ 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
+
+ dedicated_host_profile_memory_model = {} # DedicatedHostProfileMemoryFixed
+ dedicated_host_profile_memory_model['type'] = 'fixed'
+ dedicated_host_profile_memory_model['value'] = 16
+
+ 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/bx2-4x16'
+ instance_profile_reference_model['name'] = 'bx2-4x16'
+ instance_profile_reference_model['resource_type'] = 'instance_profile'
+
+ 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_profile_vcpu_model = {} # DedicatedHostProfileVCPUFixed
+ dedicated_host_profile_vcpu_model['type'] = 'fixed'
+ dedicated_host_profile_vcpu_model['value'] = 16
+
+ dedicated_host_profile_vcpu_manufacturer_model = {} # DedicatedHostProfileVCPUManufacturer
+ dedicated_host_profile_vcpu_manufacturer_model['type'] = 'fixed'
+ dedicated_host_profile_vcpu_manufacturer_model['value'] = 'intel'
+
+ # 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['status'] = 'current'
+ 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
+ dedicated_host_profile_model_json['vcpu_manufacturer'] = dedicated_host_profile_vcpu_manufacturer_model
+
+ # 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_profile_model == dedicated_host_profile_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
+
+
+class TestModel_DedicatedHostProfileCollection:
+ """
+ Test Class for DedicatedHostProfileCollection
+ """
+
+ def test_dedicated_host_profile_collection_serialization(self):
+ """
+ Test serialization/deserialization for DedicatedHostProfileCollection
+ """
+
+ # 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
+
+ dedicated_host_profile_memory_model = {} # DedicatedHostProfileMemoryFixed
+ dedicated_host_profile_memory_model['type'] = 'fixed'
+ dedicated_host_profile_memory_model['value'] = 16
+
+ 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/bx2-4x16'
+ instance_profile_reference_model['name'] = 'bx2-4x16'
+ instance_profile_reference_model['resource_type'] = 'instance_profile'
+
+ 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_profile_vcpu_model = {} # DedicatedHostProfileVCPUFixed
+ dedicated_host_profile_vcpu_model['type'] = 'fixed'
+ dedicated_host_profile_vcpu_model['value'] = 16
+
+ dedicated_host_profile_vcpu_manufacturer_model = {} # DedicatedHostProfileVCPUManufacturer
+ dedicated_host_profile_vcpu_manufacturer_model['type'] = 'fixed'
+ dedicated_host_profile_vcpu_manufacturer_model['value'] = 'intel'
+
+ 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['status'] = 'current'
+ 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
+ dedicated_host_profile_model['vcpu_manufacturer'] = dedicated_host_profile_vcpu_manufacturer_model
+
+ # 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 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 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_profile_collection_model == dedicated_host_profile_collection_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
+
+
+class TestModel_DedicatedHostProfileCollectionFirst:
+ """
+ Test Class for DedicatedHostProfileCollectionFirst
+ """
+
+ def test_dedicated_host_profile_collection_first_serialization(self):
+ """
+ Test serialization/deserialization for DedicatedHostProfileCollectionFirst
+ """
+
+ # 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 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 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_profile_collection_first_model == dedicated_host_profile_collection_first_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
+
+
+class TestModel_DedicatedHostProfileCollectionNext:
+ """
+ Test Class for DedicatedHostProfileCollectionNext
+ """
+
+ def test_dedicated_host_profile_collection_next_serialization(self):
+ """
+ Test serialization/deserialization for DedicatedHostProfileCollectionNext
+ """
+
+ # 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 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 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_profile_collection_next_model == dedicated_host_profile_collection_next_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
+
+
+class TestModel_DedicatedHostProfileDisk:
+ """
+ Test Class for DedicatedHostProfileDisk
+ """
+
+ def test_dedicated_host_profile_disk_serialization(self):
+ """
+ Test serialization/deserialization for DedicatedHostProfileDisk
+ """
+
+ # 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'
+
+ 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']
+
+ # 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_profile_disk_model == dedicated_host_profile_disk_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
+
+
+class TestModel_DedicatedHostProfileDiskInterface:
+ """
+ Test Class for DedicatedHostProfileDiskInterface
+ """
+
+ def test_dedicated_host_profile_disk_interface_serialization(self):
+ """
+ Test serialization/deserialization for DedicatedHostProfileDiskInterface
+ """
+
+ # 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 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
+
+ # 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)
+
+ # Verify the model instances are equivalent
+ assert dedicated_host_profile_disk_interface_model == dedicated_host_profile_disk_interface_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
+
+
+class TestModel_DedicatedHostProfileDiskQuantity:
+ """
+ Test Class for DedicatedHostProfileDiskQuantity
+ """
+
+ 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_profile_disk_quantity_model == dedicated_host_profile_disk_quantity_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
+
+
+class TestModel_DedicatedHostProfileDiskSize:
+ """
+ Test Class for DedicatedHostProfileDiskSize
+ """
+
+ def test_dedicated_host_profile_disk_size_serialization(self):
+ """
+ Test serialization/deserialization for DedicatedHostProfileDiskSize
+ """
+
+ # 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 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 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_profile_disk_size_model == dedicated_host_profile_disk_size_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
+
+
+class TestModel_DedicatedHostProfileDiskSupportedInterfaces:
+ """
+ Test Class for DedicatedHostProfileDiskSupportedInterfaces
+ """
+
+ def test_dedicated_host_profile_disk_supported_interfaces_serialization(self):
+ """
+ Test serialization/deserialization for DedicatedHostProfileDiskSupportedInterfaces
+ """
+
+ # 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 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
+
+ # 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)
+
+ # Verify the model instances are equivalent
+ assert dedicated_host_profile_disk_supported_interfaces_model == dedicated_host_profile_disk_supported_interfaces_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
+
+
+class TestModel_DedicatedHostProfileReference:
+ """
+ Test Class for DedicatedHostProfileReference
+ """
+
+ 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 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 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_profile_vcpu_architecture_model == dedicated_host_profile_vcpu_architecture_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
+
+
+class TestModel_DedicatedHostProfileVCPUManufacturer:
+ """
+ Test Class for DedicatedHostProfileVCPUManufacturer
+ """
+
+ def test_dedicated_host_profile_vcpu_manufacturer_serialization(self):
+ """
+ Test serialization/deserialization for DedicatedHostProfileVCPUManufacturer
+ """
+
+ # Construct a json representation of a DedicatedHostProfileVCPUManufacturer model
+ dedicated_host_profile_vcpu_manufacturer_model_json = {}
+ dedicated_host_profile_vcpu_manufacturer_model_json['type'] = 'fixed'
+ dedicated_host_profile_vcpu_manufacturer_model_json['value'] = 'intel'
+
+ # Construct a model instance of DedicatedHostProfileVCPUManufacturer by calling from_dict on the json representation
+ dedicated_host_profile_vcpu_manufacturer_model = DedicatedHostProfileVCPUManufacturer.from_dict(dedicated_host_profile_vcpu_manufacturer_model_json)
+ assert dedicated_host_profile_vcpu_manufacturer_model != False
+
+ # Construct a model instance of DedicatedHostProfileVCPUManufacturer by calling from_dict on the json representation
+ dedicated_host_profile_vcpu_manufacturer_model_dict = DedicatedHostProfileVCPUManufacturer.from_dict(dedicated_host_profile_vcpu_manufacturer_model_json).__dict__
+ dedicated_host_profile_vcpu_manufacturer_model2 = DedicatedHostProfileVCPUManufacturer(**dedicated_host_profile_vcpu_manufacturer_model_dict)
+
+ # Verify the model instances are equivalent
+ assert dedicated_host_profile_vcpu_manufacturer_model == dedicated_host_profile_vcpu_manufacturer_model2
+
+ # Convert model instance back to dict and verify no loss of data
+ dedicated_host_profile_vcpu_manufacturer_model_json2 = dedicated_host_profile_vcpu_manufacturer_model.to_dict()
+ assert dedicated_host_profile_vcpu_manufacturer_model_json2 == dedicated_host_profile_vcpu_manufacturer_model_json
+
+
+class TestModel_DedicatedHostReference:
+ """
+ Test Class for DedicatedHostReference
+ """
+
+ def test_dedicated_host_reference_serialization(self):
+ """
+ Test serialization/deserialization for DedicatedHostReference
+ """
+
+ # 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'
+
+ # 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 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 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_reference_model == dedicated_host_reference_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
+
+
+class TestModel_DedicatedHostReferenceDeleted:
+ """
+ Test Class for DedicatedHostReferenceDeleted
+ """
+
+ def test_dedicated_host_reference_deleted_serialization(self):
+ """
+ Test serialization/deserialization for DedicatedHostReferenceDeleted
+ """
+
+ # 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 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 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_reference_deleted_model == dedicated_host_reference_deleted_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
+
+
+class TestModel_DefaultNetworkACL:
+ """
+ Test Class for DefaultNetworkACL
+ """
+
+ def test_default_network_acl_serialization(self):
+ """
+ Test serialization/deserialization for DefaultNetworkACL
+ """
+
+ # 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 = {} # NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP
+ network_acl_rule_item_model['action'] = 'allow'
+ network_acl_rule_item_model['before'] = network_acl_rule_reference_model
+ network_acl_rule_item_model['created_at'] = '2019-01-01T12:00:00Z'
+ 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-1'
+ network_acl_rule_item_model['source'] = '192.168.3.0/24'
+ network_acl_rule_item_model['destination_port_max'] = 22
+ network_acl_rule_item_model['destination_port_min'] = 22
+ network_acl_rule_item_model['protocol'] = 'udp'
+ network_acl_rule_item_model['source_port_max'] = 65535
+ network_acl_rule_item_model['source_port_min'] = 49152
+
+ subnet_reference_deleted_model = {} # SubnetReferenceDeleted
+ subnet_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+
+ subnet_reference_model = {} # SubnetReference
+ subnet_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
+ subnet_reference_model['deleted'] = subnet_reference_deleted_model
+ subnet_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
+ subnet_reference_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
+ subnet_reference_model['name'] = 'my-subnet'
+ subnet_reference_model['resource_type'] = 'subnet'
+
+ vpc_reference_deleted_model = {} # VPCReferenceDeleted
+ vpc_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+
+ vpc_reference_model = {} # VPCReference
+ vpc_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b'
+ vpc_reference_model['deleted'] = vpc_reference_deleted_model
+ vpc_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b'
+ vpc_reference_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b'
+ vpc_reference_model['name'] = 'my-vpc'
+ vpc_reference_model['resource_type'] = 'vpc'
+
+ # Construct a json representation of a 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-mythology'
+ default_network_acl_model_json['resource_group'] = resource_group_reference_model
+ default_network_acl_model_json['rules'] = [network_acl_rule_item_model]
+ default_network_acl_model_json['subnets'] = [subnet_reference_model]
+ 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 default_network_acl_model == default_network_acl_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
+
+
+class TestModel_DefaultRoutingTable:
+ """
+ Test Class for DefaultRoutingTable
+ """
+
+ def test_default_routing_table_serialization(self):
+ """
+ Test serialization/deserialization for DefaultRoutingTable
+ """
+
+ # Construct dict forms of any model objects needed in order to build this model.
+
+ resource_filter_model = {} # ResourceFilter
+ resource_filter_model['resource_type'] = 'vpn_server'
+
+ 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/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840/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'
+ subnet_reference_model['resource_type'] = 'subnet'
+
+ # Construct a json representation of a DefaultRoutingTable model
+ default_routing_table_model_json = {}
+ default_routing_table_model_json['accept_routes_from'] = [resource_filter_model]
+ default_routing_table_model_json['advertise_routes_to'] = ['transit_gateway', 'direct_link']
+ 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_internet_ingress'] = True
+ default_routing_table_model_json['route_transit_gateway_ingress'] = True
+ default_routing_table_model_json['route_vpc_zone_ingress'] = True
+ default_routing_table_model_json['routes'] = [route_reference_model]
+ 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 default_routing_table_model == default_routing_table_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
+
+
+class TestModel_DefaultSecurityGroup:
+ """
+ Test Class for DefaultSecurityGroup
+ """
+
+ def test_default_security_group_serialization(self):
+ """
+ Test serialization/deserialization for DefaultSecurityGroup
+ """
+
+ # 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'
+
+ 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-instance-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'
+ vpc_reference_model['resource_type'] = '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['targets'] = [security_group_target_reference_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 default_security_group_model == default_security_group_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
+
+
+class TestModel_EncryptionKeyReference:
+ """
+ Test Class for EncryptionKeyReference
+ """
+
+ def test_encryption_key_reference_serialization(self):
+ """
+ Test serialization/deserialization for EncryptionKeyReference
+ """
+
+ # 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/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179'
+
+ # 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 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 encryption_key_reference_model == encryption_key_reference_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
+
+
+class TestModel_EndpointGateway:
+ """
+ Test Class for EndpointGateway
+ """
+
+ def test_endpoint_gateway_serialization(self):
+ """
+ Test serialization/deserialization for EndpointGateway
+ """
+
+ # Construct dict forms of any model objects needed in order to build this model.
+
+ reserved_ip_reference_deleted_model = {} # ReservedIPReferenceDeleted
+ reserved_ip_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+
+ reserved_ip_reference_model = {} # ReservedIPReference
+ reserved_ip_reference_model['address'] = '192.168.3.4'
+ reserved_ip_reference_model['deleted'] = reserved_ip_reference_deleted_model
+ reserved_ip_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb'
+ reserved_ip_reference_model['id'] = '6d353a0f-aeb1-4ae1-832e-1110d10981bb'
+ reserved_ip_reference_model['name'] = 'my-reserved-ip'
+ reserved_ip_reference_model['resource_type'] = 'subnet_reserved_ip'
+
+ endpoint_gateway_lifecycle_reason_model = {} # EndpointGatewayLifecycleReason
+ endpoint_gateway_lifecycle_reason_model['code'] = 'dns_resolution_binding_pending'
+ endpoint_gateway_lifecycle_reason_model['message'] = 'The resource has been suspended. Contact IBM support with the CRN for next steps.'
+ endpoint_gateway_lifecycle_reason_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#resource-suspension'
+
+ 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'
+ vpc_reference_model['resource_type'] = 'vpc'
+
+ # Construct a json representation of a EndpointGateway model
+ endpoint_gateway_model_json = {}
+ endpoint_gateway_model_json['allow_dns_resolution_binding'] = True
+ 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:r134-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/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5'
+ endpoint_gateway_model_json['id'] = 'r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5'
+ endpoint_gateway_model_json['ips'] = [reserved_ip_reference_model]
+ endpoint_gateway_model_json['lifecycle_reasons'] = [endpoint_gateway_lifecycle_reason_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 endpoint_gateway_model == endpoint_gateway_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
+
+
+class TestModel_EndpointGatewayCollection:
+ """
+ Test Class for EndpointGatewayCollection
+ """
+
+ def test_endpoint_gateway_collection_serialization(self):
+ """
+ Test serialization/deserialization for EndpointGatewayCollection
+ """
+
+ # Construct dict forms of any model objects needed in order to build this model.
+
+ reserved_ip_reference_deleted_model = {} # ReservedIPReferenceDeleted
+ reserved_ip_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+
+ reserved_ip_reference_model = {} # ReservedIPReference
+ reserved_ip_reference_model['address'] = '192.168.3.4'
+ reserved_ip_reference_model['deleted'] = reserved_ip_reference_deleted_model
+ reserved_ip_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb'
+ reserved_ip_reference_model['id'] = '6d353a0f-aeb1-4ae1-832e-1110d10981bb'
+ reserved_ip_reference_model['name'] = 'my-reserved-ip'
+ reserved_ip_reference_model['resource_type'] = 'subnet_reserved_ip'
+
+ endpoint_gateway_lifecycle_reason_model = {} # EndpointGatewayLifecycleReason
+ endpoint_gateway_lifecycle_reason_model['code'] = 'dns_resolution_binding_pending'
+ endpoint_gateway_lifecycle_reason_model['message'] = 'The resource has been suspended. Contact IBM support with the CRN for next steps.'
+ endpoint_gateway_lifecycle_reason_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#resource-suspension'
+
+ 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'
+ vpc_reference_model['resource_type'] = 'vpc'
+
+ endpoint_gateway_model = {} # EndpointGateway
+ endpoint_gateway_model['allow_dns_resolution_binding'] = True
+ 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:r134-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/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5'
+ endpoint_gateway_model['id'] = 'r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5'
+ endpoint_gateway_model['ips'] = [reserved_ip_reference_model]
+ endpoint_gateway_model['lifecycle_reasons'] = [endpoint_gateway_lifecycle_reason_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
+
+ endpoint_gateway_collection_first_model = {} # EndpointGatewayCollectionFirst
+ endpoint_gateway_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways?limit=20'
+
+ 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 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 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 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 endpoint_gateway_collection_model == endpoint_gateway_collection_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
+
+
+class TestModel_EndpointGatewayCollectionFirst:
+ """
+ Test Class for EndpointGatewayCollectionFirst
+ """
+
+ def test_endpoint_gateway_collection_first_serialization(self):
+ """
+ Test serialization/deserialization for EndpointGatewayCollectionFirst
+ """
+
+ # 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 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
+
+ # 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)
+
+ # Verify the model instances are equivalent
+ assert endpoint_gateway_collection_first_model == endpoint_gateway_collection_first_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
+
+
+class TestModel_EndpointGatewayCollectionNext:
+ """
+ Test Class for EndpointGatewayCollectionNext
+ """
+
+ def test_endpoint_gateway_collection_next_serialization(self):
+ """
+ Test serialization/deserialization for EndpointGatewayCollectionNext
+ """
+
+ # 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 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 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 endpoint_gateway_collection_next_model == endpoint_gateway_collection_next_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
+
+
+class TestModel_EndpointGatewayLifecycleReason:
+ """
+ Test Class for EndpointGatewayLifecycleReason
+ """
+
+ def test_endpoint_gateway_lifecycle_reason_serialization(self):
"""
- Test serialization/deserialization for AddressPrefixCollectionFirst
+ Test serialization/deserialization for EndpointGatewayLifecycleReason
"""
- # 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 EndpointGatewayLifecycleReason model
+ endpoint_gateway_lifecycle_reason_model_json = {}
+ endpoint_gateway_lifecycle_reason_model_json['code'] = 'dns_resolution_binding_pending'
+ endpoint_gateway_lifecycle_reason_model_json['message'] = 'The resource has been suspended. Contact IBM support with the CRN for next steps.'
+ endpoint_gateway_lifecycle_reason_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#resource-suspension'
- # 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 EndpointGatewayLifecycleReason by calling from_dict on the json representation
+ endpoint_gateway_lifecycle_reason_model = EndpointGatewayLifecycleReason.from_dict(endpoint_gateway_lifecycle_reason_model_json)
+ assert endpoint_gateway_lifecycle_reason_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 EndpointGatewayLifecycleReason by calling from_dict on the json representation
+ endpoint_gateway_lifecycle_reason_model_dict = EndpointGatewayLifecycleReason.from_dict(endpoint_gateway_lifecycle_reason_model_json).__dict__
+ endpoint_gateway_lifecycle_reason_model2 = EndpointGatewayLifecycleReason(**endpoint_gateway_lifecycle_reason_model_dict)
# Verify the model instances are equivalent
- assert address_prefix_collection_first_model == address_prefix_collection_first_model2
+ assert endpoint_gateway_lifecycle_reason_model == endpoint_gateway_lifecycle_reason_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
+ endpoint_gateway_lifecycle_reason_model_json2 = endpoint_gateway_lifecycle_reason_model.to_dict()
+ assert endpoint_gateway_lifecycle_reason_model_json2 == endpoint_gateway_lifecycle_reason_model_json
-class TestModel_AddressPrefixCollectionNext:
+class TestModel_EndpointGatewayPatch:
"""
- Test Class for AddressPrefixCollectionNext
+ Test Class for EndpointGatewayPatch
"""
- def test_address_prefix_collection_next_serialization(self):
+ def test_endpoint_gateway_patch_serialization(self):
"""
- Test serialization/deserialization for AddressPrefixCollectionNext
+ Test serialization/deserialization for EndpointGatewayPatch
"""
- # 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 json representation of a EndpointGatewayPatch model
+ endpoint_gateway_patch_model_json = {}
+ endpoint_gateway_patch_model_json['allow_dns_resolution_binding'] = True
+ endpoint_gateway_patch_model_json['name'] = 'my-endpoint-gateway'
- # 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 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 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 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 address_prefix_collection_next_model == address_prefix_collection_next_model2
+ assert endpoint_gateway_patch_model == endpoint_gateway_patch_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
+ endpoint_gateway_patch_model_json2 = endpoint_gateway_patch_model.to_dict()
+ assert endpoint_gateway_patch_model_json2 == endpoint_gateway_patch_model_json
-class TestModel_AddressPrefixPatch:
+class TestModel_EndpointGatewayReferenceDeleted:
"""
- Test Class for AddressPrefixPatch
+ Test Class for EndpointGatewayReferenceDeleted
"""
- def test_address_prefix_patch_serialization(self):
+ def test_endpoint_gateway_reference_deleted_serialization(self):
"""
- Test serialization/deserialization for AddressPrefixPatch
+ Test serialization/deserialization for EndpointGatewayReferenceDeleted
"""
- # 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-1'
+ # 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 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 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 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 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 address_prefix_patch_model == address_prefix_patch_model2
+ assert endpoint_gateway_reference_deleted_model == endpoint_gateway_reference_deleted_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
+ 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_BackupPolicy:
+class TestModel_EndpointGatewayReferenceRemote:
"""
- Test Class for BackupPolicy
+ Test Class for EndpointGatewayReferenceRemote
"""
- def test_backup_policy_serialization(self):
+ def test_endpoint_gateway_reference_remote_serialization(self):
"""
- Test serialization/deserialization for BackupPolicy
+ Test serialization/deserialization for EndpointGatewayReferenceRemote
"""
# Construct dict forms of any model objects needed in order to build this model.
- backup_policy_health_reason_model = {} # BackupPolicyHealthReason
- backup_policy_health_reason_model['code'] = 'missing_service_authorization_policies'
- backup_policy_health_reason_model['message'] = 'One or more accounts are missing service authorization policies'
- backup_policy_health_reason_model['more_info'] = 'https://cloud.ibm.com/docs/vpc?topic=vpc-backup-service-about&interface=ui'
-
- backup_policy_plan_reference_deleted_model = {} # BackupPolicyPlanReferenceDeleted
- backup_policy_plan_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ account_reference_model = {} # AccountReference
+ account_reference_model['id'] = 'aa2432b1fa4d4ace891e9b80fc104e34'
+ account_reference_model['resource_type'] = 'account'
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'
- backup_policy_plan_remote_model = {} # BackupPolicyPlanRemote
- backup_policy_plan_remote_model['region'] = region_reference_model
-
- backup_policy_plan_reference_model = {} # BackupPolicyPlanReference
- backup_policy_plan_reference_model['deleted'] = backup_policy_plan_reference_deleted_model
- backup_policy_plan_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178'
- backup_policy_plan_reference_model['id'] = 'r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178'
- backup_policy_plan_reference_model['name'] = 'my-policy-plan'
- backup_policy_plan_reference_model['remote'] = backup_policy_plan_remote_model
- backup_policy_plan_reference_model['resource_type'] = 'backup_policy_plan'
-
- 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'
-
- backup_policy_scope_model = {} # BackupPolicyScopeEnterpriseReference
- backup_policy_scope_model['crn'] = 'crn:v1:bluemix:public:enterprise::a/123456::enterprise:ebc2b430240943458b9e91e1432cfcce'
- backup_policy_scope_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
- backup_policy_scope_model['resource_type'] = 'enterprise'
+ endpoint_gateway_remote_model = {} # EndpointGatewayRemote
+ endpoint_gateway_remote_model['account'] = account_reference_model
+ endpoint_gateway_remote_model['region'] = region_reference_model
- # Construct a json representation of a BackupPolicy model
- backup_policy_model_json = {}
- backup_policy_model_json['created_at'] = '2019-01-01T12:00:00Z'
- backup_policy_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::backup-policy:r134-076191ba-49c2-4763-94fd-c70de73ee2e6'
- backup_policy_model_json['health_reasons'] = [backup_policy_health_reason_model]
- backup_policy_model_json['health_state'] = 'ok'
- backup_policy_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6'
- backup_policy_model_json['id'] = 'r134-076191ba-49c2-4763-94fd-c70de73ee2e6'
- backup_policy_model_json['last_job_completed_at'] = '2019-01-01T12:00:00Z'
- backup_policy_model_json['lifecycle_state'] = 'stable'
- backup_policy_model_json['match_resource_types'] = ['volume']
- backup_policy_model_json['match_user_tags'] = ['my-daily-backup-policy']
- backup_policy_model_json['name'] = 'my-backup-policy'
- backup_policy_model_json['plans'] = [backup_policy_plan_reference_model]
- backup_policy_model_json['resource_group'] = resource_group_reference_model
- backup_policy_model_json['resource_type'] = 'backup_policy'
- backup_policy_model_json['scope'] = backup_policy_scope_model
+ # Construct a json representation of a EndpointGatewayReferenceRemote model
+ endpoint_gateway_reference_remote_model_json = {}
+ endpoint_gateway_reference_remote_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5'
+ endpoint_gateway_reference_remote_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5'
+ endpoint_gateway_reference_remote_model_json['id'] = 'r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5'
+ endpoint_gateway_reference_remote_model_json['name'] = 'my-endpoint-gateway'
+ endpoint_gateway_reference_remote_model_json['remote'] = endpoint_gateway_remote_model
+ endpoint_gateway_reference_remote_model_json['resource_type'] = 'endpoint_gateway'
- # Construct a model instance of BackupPolicy by calling from_dict on the json representation
- backup_policy_model = BackupPolicy.from_dict(backup_policy_model_json)
- assert backup_policy_model != False
+ # Construct a model instance of EndpointGatewayReferenceRemote by calling from_dict on the json representation
+ endpoint_gateway_reference_remote_model = EndpointGatewayReferenceRemote.from_dict(endpoint_gateway_reference_remote_model_json)
+ assert endpoint_gateway_reference_remote_model != False
- # Construct a model instance of BackupPolicy by calling from_dict on the json representation
- backup_policy_model_dict = BackupPolicy.from_dict(backup_policy_model_json).__dict__
- backup_policy_model2 = BackupPolicy(**backup_policy_model_dict)
+ # Construct a model instance of EndpointGatewayReferenceRemote by calling from_dict on the json representation
+ endpoint_gateway_reference_remote_model_dict = EndpointGatewayReferenceRemote.from_dict(endpoint_gateway_reference_remote_model_json).__dict__
+ endpoint_gateway_reference_remote_model2 = EndpointGatewayReferenceRemote(**endpoint_gateway_reference_remote_model_dict)
# Verify the model instances are equivalent
- assert backup_policy_model == backup_policy_model2
+ assert endpoint_gateway_reference_remote_model == endpoint_gateway_reference_remote_model2
# Convert model instance back to dict and verify no loss of data
- backup_policy_model_json2 = backup_policy_model.to_dict()
- assert backup_policy_model_json2 == backup_policy_model_json
+ endpoint_gateway_reference_remote_model_json2 = endpoint_gateway_reference_remote_model.to_dict()
+ assert endpoint_gateway_reference_remote_model_json2 == endpoint_gateway_reference_remote_model_json
-class TestModel_BackupPolicyCollection:
+class TestModel_EndpointGatewayRemote:
"""
- Test Class for BackupPolicyCollection
+ Test Class for EndpointGatewayRemote
"""
- def test_backup_policy_collection_serialization(self):
+ def test_endpoint_gateway_remote_serialization(self):
"""
- Test serialization/deserialization for BackupPolicyCollection
+ Test serialization/deserialization for EndpointGatewayRemote
"""
# Construct dict forms of any model objects needed in order to build this model.
- backup_policy_health_reason_model = {} # BackupPolicyHealthReason
- backup_policy_health_reason_model['code'] = 'missing_service_authorization_policies'
- backup_policy_health_reason_model['message'] = 'One or more accounts are missing service authorization policies'
- backup_policy_health_reason_model['more_info'] = 'https://cloud.ibm.com/docs/vpc?topic=vpc-backup-service-about&interface=ui'
-
- backup_policy_plan_reference_deleted_model = {} # BackupPolicyPlanReferenceDeleted
- backup_policy_plan_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ account_reference_model = {} # AccountReference
+ account_reference_model['id'] = 'aa2432b1fa4d4ace891e9b80fc104e34'
+ account_reference_model['resource_type'] = 'account'
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'
- backup_policy_plan_remote_model = {} # BackupPolicyPlanRemote
- backup_policy_plan_remote_model['region'] = region_reference_model
+ # Construct a json representation of a EndpointGatewayRemote model
+ endpoint_gateway_remote_model_json = {}
+ endpoint_gateway_remote_model_json['account'] = account_reference_model
+ endpoint_gateway_remote_model_json['region'] = region_reference_model
- backup_policy_plan_reference_model = {} # BackupPolicyPlanReference
- backup_policy_plan_reference_model['deleted'] = backup_policy_plan_reference_deleted_model
- backup_policy_plan_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178'
- backup_policy_plan_reference_model['id'] = 'r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178'
- backup_policy_plan_reference_model['name'] = 'my-policy-plan'
- backup_policy_plan_reference_model['remote'] = backup_policy_plan_remote_model
- backup_policy_plan_reference_model['resource_type'] = 'backup_policy_plan'
+ # Construct a model instance of EndpointGatewayRemote by calling from_dict on the json representation
+ endpoint_gateway_remote_model = EndpointGatewayRemote.from_dict(endpoint_gateway_remote_model_json)
+ assert endpoint_gateway_remote_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 EndpointGatewayRemote by calling from_dict on the json representation
+ endpoint_gateway_remote_model_dict = EndpointGatewayRemote.from_dict(endpoint_gateway_remote_model_json).__dict__
+ endpoint_gateway_remote_model2 = EndpointGatewayRemote(**endpoint_gateway_remote_model_dict)
- backup_policy_scope_model = {} # BackupPolicyScopeEnterpriseReference
- backup_policy_scope_model['crn'] = 'crn:v1:bluemix:public:enterprise::a/123456::enterprise:ebc2b430240943458b9e91e1432cfcce'
- backup_policy_scope_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
- backup_policy_scope_model['resource_type'] = 'enterprise'
+ # Verify the model instances are equivalent
+ assert endpoint_gateway_remote_model == endpoint_gateway_remote_model2
- backup_policy_model = {} # BackupPolicy
- backup_policy_model['created_at'] = '2019-01-01T12:00:00Z'
- backup_policy_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::backup-policy:r134-076191ba-49c2-4763-94fd-c70de73ee2e6'
- backup_policy_model['health_reasons'] = [backup_policy_health_reason_model]
- backup_policy_model['health_state'] = 'ok'
- backup_policy_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6'
- backup_policy_model['id'] = 'r134-076191ba-49c2-4763-94fd-c70de73ee2e6'
- backup_policy_model['last_job_completed_at'] = '2019-01-01T12:00:00Z'
- backup_policy_model['lifecycle_state'] = 'stable'
- backup_policy_model['match_resource_types'] = ['volume']
- backup_policy_model['match_user_tags'] = ['my-daily-backup-policy']
- backup_policy_model['name'] = 'my-backup-policy'
- backup_policy_model['plans'] = [backup_policy_plan_reference_model]
- backup_policy_model['resource_group'] = resource_group_reference_model
- backup_policy_model['resource_type'] = 'backup_policy'
- backup_policy_model['scope'] = backup_policy_scope_model
+ # Convert model instance back to dict and verify no loss of data
+ endpoint_gateway_remote_model_json2 = endpoint_gateway_remote_model.to_dict()
+ assert endpoint_gateway_remote_model_json2 == endpoint_gateway_remote_model_json
- backup_policy_collection_first_model = {} # BackupPolicyCollectionFirst
- backup_policy_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/backup_policies?limit=20'
- backup_policy_collection_next_model = {} # BackupPolicyCollectionNext
- backup_policy_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/backup_policies?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
+class TestModel_FloatingIP:
+ """
+ Test Class for FloatingIP
+ """
- # Construct a json representation of a BackupPolicyCollection model
- backup_policy_collection_model_json = {}
- backup_policy_collection_model_json['backup_policies'] = [backup_policy_model]
- backup_policy_collection_model_json['first'] = backup_policy_collection_first_model
- backup_policy_collection_model_json['limit'] = 20
- backup_policy_collection_model_json['next'] = backup_policy_collection_next_model
- backup_policy_collection_model_json['total_count'] = 132
+ def test_floating_ip_serialization(self):
+ """
+ Test serialization/deserialization for FloatingIP
+ """
- # Construct a model instance of BackupPolicyCollection by calling from_dict on the json representation
- backup_policy_collection_model = BackupPolicyCollection.from_dict(backup_policy_collection_model_json)
- assert backup_policy_collection_model != False
+ # Construct dict forms of any model objects needed in order to build this model.
- # Construct a model instance of BackupPolicyCollection by calling from_dict on the json representation
- backup_policy_collection_model_dict = BackupPolicyCollection.from_dict(backup_policy_collection_model_json).__dict__
- backup_policy_collection_model2 = BackupPolicyCollection(**backup_policy_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 backup_policy_collection_model == backup_policy_collection_model2
+ network_interface_reference_deleted_model = {} # NetworkInterfaceReferenceDeleted
+ network_interface_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
- backup_policy_collection_model_json2 = backup_policy_collection_model.to_dict()
- assert backup_policy_collection_model_json2 == backup_policy_collection_model_json
+ 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'
-class TestModel_BackupPolicyCollectionFirst:
- """
- Test Class for BackupPolicyCollectionFirst
- """
+ 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-instance-network-interface'
+ floating_ip_target_model['primary_ip'] = reserved_ip_reference_model
+ floating_ip_target_model['resource_type'] = 'network_interface'
- def test_backup_policy_collection_first_serialization(self):
- """
- Test serialization/deserialization for BackupPolicyCollectionFirst
- """
+ 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 BackupPolicyCollectionFirst model
- backup_policy_collection_first_model_json = {}
- backup_policy_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/backup_policies?limit=20'
+ # 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 BackupPolicyCollectionFirst by calling from_dict on the json representation
- backup_policy_collection_first_model = BackupPolicyCollectionFirst.from_dict(backup_policy_collection_first_model_json)
- assert backup_policy_collection_first_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 BackupPolicyCollectionFirst by calling from_dict on the json representation
- backup_policy_collection_first_model_dict = BackupPolicyCollectionFirst.from_dict(backup_policy_collection_first_model_json).__dict__
- backup_policy_collection_first_model2 = BackupPolicyCollectionFirst(**backup_policy_collection_first_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 backup_policy_collection_first_model == backup_policy_collection_first_model2
+ assert floating_ip_model == floating_ip_model2
# Convert model instance back to dict and verify no loss of data
- backup_policy_collection_first_model_json2 = backup_policy_collection_first_model.to_dict()
- assert backup_policy_collection_first_model_json2 == backup_policy_collection_first_model_json
+ floating_ip_model_json2 = floating_ip_model.to_dict()
+ assert floating_ip_model_json2 == floating_ip_model_json
-class TestModel_BackupPolicyCollectionNext:
+class TestModel_FloatingIPCollection:
"""
- Test Class for BackupPolicyCollectionNext
+ Test Class for FloatingIPCollection
"""
- def test_backup_policy_collection_next_serialization(self):
+ def test_floating_ip_collection_serialization(self):
"""
- Test serialization/deserialization for BackupPolicyCollectionNext
+ Test serialization/deserialization for FloatingIPCollection
"""
- # Construct a json representation of a BackupPolicyCollectionNext model
- backup_policy_collection_next_model_json = {}
- backup_policy_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/backup_policies?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
+ # Construct dict forms of any model objects needed in order to build this model.
- # Construct a model instance of BackupPolicyCollectionNext by calling from_dict on the json representation
- backup_policy_collection_next_model = BackupPolicyCollectionNext.from_dict(backup_policy_collection_next_model_json)
- assert backup_policy_collection_next_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 BackupPolicyCollectionNext by calling from_dict on the json representation
- backup_policy_collection_next_model_dict = BackupPolicyCollectionNext.from_dict(backup_policy_collection_next_model_json).__dict__
- backup_policy_collection_next_model2 = BackupPolicyCollectionNext(**backup_policy_collection_next_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 backup_policy_collection_next_model == backup_policy_collection_next_model2
+ network_interface_reference_deleted_model = {} # NetworkInterfaceReferenceDeleted
+ network_interface_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
- backup_policy_collection_next_model_json2 = backup_policy_collection_next_model.to_dict()
- assert backup_policy_collection_next_model_json2 == backup_policy_collection_next_model_json
+ 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'
-class TestModel_BackupPolicyHealthReason:
- """
- Test Class for BackupPolicyHealthReason
- """
+ 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-instance-network-interface'
+ floating_ip_target_model['primary_ip'] = reserved_ip_reference_model
+ floating_ip_target_model['resource_type'] = 'network_interface'
- def test_backup_policy_health_reason_serialization(self):
- """
- Test serialization/deserialization for BackupPolicyHealthReason
- """
+ 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 BackupPolicyHealthReason model
- backup_policy_health_reason_model_json = {}
- backup_policy_health_reason_model_json['code'] = 'missing_service_authorization_policies'
- backup_policy_health_reason_model_json['message'] = 'One or more accounts are missing service authorization policies'
- backup_policy_health_reason_model_json['more_info'] = 'https://cloud.ibm.com/docs/vpc?topic=vpc-backup-service-about&interface=ui'
+ 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 model instance of BackupPolicyHealthReason by calling from_dict on the json representation
- backup_policy_health_reason_model = BackupPolicyHealthReason.from_dict(backup_policy_health_reason_model_json)
- assert backup_policy_health_reason_model != False
+ 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 model instance of BackupPolicyHealthReason by calling from_dict on the json representation
- backup_policy_health_reason_model_dict = BackupPolicyHealthReason.from_dict(backup_policy_health_reason_model_json).__dict__
- backup_policy_health_reason_model2 = BackupPolicyHealthReason(**backup_policy_health_reason_model_dict)
+ # 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 backup_policy_health_reason_model == backup_policy_health_reason_model2
+ assert floating_ip_collection_model == floating_ip_collection_model2
# Convert model instance back to dict and verify no loss of data
- backup_policy_health_reason_model_json2 = backup_policy_health_reason_model.to_dict()
- assert backup_policy_health_reason_model_json2 == backup_policy_health_reason_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_BackupPolicyJob:
+class TestModel_FloatingIPCollectionFirst:
"""
- Test Class for BackupPolicyJob
+ Test Class for FloatingIPCollectionFirst
"""
- def test_backup_policy_job_serialization(self):
+ def test_floating_ip_collection_first_serialization(self):
"""
- Test serialization/deserialization for BackupPolicyJob
+ Test serialization/deserialization for FloatingIPCollectionFirst
"""
- # Construct dict forms of any model objects needed in order to build this model.
-
- backup_policy_plan_reference_deleted_model = {} # BackupPolicyPlanReferenceDeleted
- backup_policy_plan_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
-
- 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'
-
- backup_policy_plan_remote_model = {} # BackupPolicyPlanRemote
- backup_policy_plan_remote_model['region'] = region_reference_model
-
- backup_policy_plan_reference_model = {} # BackupPolicyPlanReference
- backup_policy_plan_reference_model['deleted'] = backup_policy_plan_reference_deleted_model
- backup_policy_plan_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178'
- backup_policy_plan_reference_model['id'] = 'r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178'
- backup_policy_plan_reference_model['name'] = 'my-policy-plan'
- backup_policy_plan_reference_model['remote'] = backup_policy_plan_remote_model
- backup_policy_plan_reference_model['resource_type'] = 'backup_policy_plan'
-
- volume_reference_deleted_model = {} # VolumeReferenceDeleted
- volume_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
-
- volume_remote_model = {} # VolumeRemote
- volume_remote_model['region'] = region_reference_model
+ # 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'
- backup_policy_job_source_model = {} # BackupPolicyJobSourceVolumeReference
- backup_policy_job_source_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
- backup_policy_job_source_model['deleted'] = volume_reference_deleted_model
- backup_policy_job_source_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
- backup_policy_job_source_model['id'] = '1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
- backup_policy_job_source_model['name'] = 'my-volume'
- backup_policy_job_source_model['remote'] = volume_remote_model
- backup_policy_job_source_model['resource_type'] = 'volume'
+ # 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
- backup_policy_job_status_reason_model = {} # BackupPolicyJobStatusReason
- backup_policy_job_status_reason_model['code'] = 'source_volume_busy'
- backup_policy_job_status_reason_model['message'] = 'testString'
- backup_policy_job_status_reason_model['more_info'] = 'https://cloud.ibm.com/docs/vpc?topic=vpc-troubleshooting-backup-for-vpc'
+ # 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)
- snapshot_reference_deleted_model = {} # SnapshotReferenceDeleted
- snapshot_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ # Verify the model instances are equivalent
+ assert floating_ip_collection_first_model == floating_ip_collection_first_model2
- snapshot_remote_model = {} # SnapshotRemote
- snapshot_remote_model['region'] = region_reference_model
+ # 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
- 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['remote'] = snapshot_remote_model
- snapshot_reference_model['resource_type'] = 'snapshot'
- # Construct a json representation of a BackupPolicyJob model
- backup_policy_job_model_json = {}
- backup_policy_job_model_json['auto_delete'] = True
- backup_policy_job_model_json['auto_delete_after'] = 90
- backup_policy_job_model_json['backup_policy_plan'] = backup_policy_plan_reference_model
- backup_policy_job_model_json['completed_at'] = '2019-01-01T12:00:00Z'
- backup_policy_job_model_json['created_at'] = '2019-01-01T12:00:00Z'
- backup_policy_job_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/backup_policies/0fe9e5d8-0a4d-4818-96ec-e99708644a58/jobs/4cf9171a-0043-4434-8727-15b53dbc374c'
- backup_policy_job_model_json['id'] = '4cf9171a-0043-4434-8727-15b53dbc374c'
- backup_policy_job_model_json['job_type'] = 'creation'
- backup_policy_job_model_json['resource_type'] = 'backup_policy_job'
- backup_policy_job_model_json['source'] = backup_policy_job_source_model
- backup_policy_job_model_json['status'] = 'failed'
- backup_policy_job_model_json['status_reasons'] = [backup_policy_job_status_reason_model]
- backup_policy_job_model_json['target_snapshots'] = [snapshot_reference_model]
+class TestModel_FloatingIPCollectionNext:
+ """
+ Test Class for FloatingIPCollectionNext
+ """
- # Construct a model instance of BackupPolicyJob by calling from_dict on the json representation
- backup_policy_job_model = BackupPolicyJob.from_dict(backup_policy_job_model_json)
- assert backup_policy_job_model != False
+ def test_floating_ip_collection_next_serialization(self):
+ """
+ Test serialization/deserialization for FloatingIPCollectionNext
+ """
- # Construct a model instance of BackupPolicyJob by calling from_dict on the json representation
- backup_policy_job_model_dict = BackupPolicyJob.from_dict(backup_policy_job_model_json).__dict__
- backup_policy_job_model2 = BackupPolicyJob(**backup_policy_job_model_dict)
+ # 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 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 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 backup_policy_job_model == backup_policy_job_model2
+ assert floating_ip_collection_next_model == floating_ip_collection_next_model2
# Convert model instance back to dict and verify no loss of data
- backup_policy_job_model_json2 = backup_policy_job_model.to_dict()
- assert backup_policy_job_model_json2 == backup_policy_job_model_json
+ 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_BackupPolicyJobCollection:
+class TestModel_FloatingIPCollectionVirtualNetworkInterfaceContext:
"""
- Test Class for BackupPolicyJobCollection
+ Test Class for FloatingIPCollectionVirtualNetworkInterfaceContext
"""
- def test_backup_policy_job_collection_serialization(self):
+ def test_floating_ip_collection_virtual_network_interface_context_serialization(self):
"""
- Test serialization/deserialization for BackupPolicyJobCollection
+ Test serialization/deserialization for FloatingIPCollectionVirtualNetworkInterfaceContext
"""
# Construct dict forms of any model objects needed in order to build this model.
- backup_policy_job_collection_first_model = {} # BackupPolicyJobCollectionFirst
- backup_policy_job_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/backup_policies/7241e2a8-601f-11ea-8503-000c29475bed/jobs?limit=20'
-
- backup_policy_plan_reference_deleted_model = {} # BackupPolicyPlanReferenceDeleted
- backup_policy_plan_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
-
- 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'
+ floating_ip_collection_virtual_network_interface_context_first_model = {} # FloatingIPCollectionVirtualNetworkInterfaceContextFirst
+ floating_ip_collection_virtual_network_interface_context_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9/floating_ips?limit=20'
- backup_policy_plan_remote_model = {} # BackupPolicyPlanRemote
- backup_policy_plan_remote_model['region'] = region_reference_model
+ floating_ip_reference_deleted_model = {} # FloatingIPReferenceDeleted
+ floating_ip_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- backup_policy_plan_reference_model = {} # BackupPolicyPlanReference
- backup_policy_plan_reference_model['deleted'] = backup_policy_plan_reference_deleted_model
- backup_policy_plan_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178'
- backup_policy_plan_reference_model['id'] = 'r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178'
- backup_policy_plan_reference_model['name'] = 'my-policy-plan'
- backup_policy_plan_reference_model['remote'] = backup_policy_plan_remote_model
- backup_policy_plan_reference_model['resource_type'] = 'backup_policy_plan'
+ 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_reference_deleted_model = {} # VolumeReferenceDeleted
- volume_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ floating_ip_collection_virtual_network_interface_context_next_model = {} # FloatingIPCollectionVirtualNetworkInterfaceContextNext
+ floating_ip_collection_virtual_network_interface_context_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9/floating_ips?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
- volume_remote_model = {} # VolumeRemote
- volume_remote_model['region'] = region_reference_model
+ # Construct a json representation of a FloatingIPCollectionVirtualNetworkInterfaceContext model
+ floating_ip_collection_virtual_network_interface_context_model_json = {}
+ floating_ip_collection_virtual_network_interface_context_model_json['first'] = floating_ip_collection_virtual_network_interface_context_first_model
+ floating_ip_collection_virtual_network_interface_context_model_json['floating_ips'] = [floating_ip_reference_model]
+ floating_ip_collection_virtual_network_interface_context_model_json['limit'] = 20
+ floating_ip_collection_virtual_network_interface_context_model_json['next'] = floating_ip_collection_virtual_network_interface_context_next_model
+ floating_ip_collection_virtual_network_interface_context_model_json['total_count'] = 132
- backup_policy_job_source_model = {} # BackupPolicyJobSourceVolumeReference
- backup_policy_job_source_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
- backup_policy_job_source_model['deleted'] = volume_reference_deleted_model
- backup_policy_job_source_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
- backup_policy_job_source_model['id'] = '1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
- backup_policy_job_source_model['name'] = 'my-volume'
- backup_policy_job_source_model['remote'] = volume_remote_model
- backup_policy_job_source_model['resource_type'] = 'volume'
+ # Construct a model instance of FloatingIPCollectionVirtualNetworkInterfaceContext by calling from_dict on the json representation
+ floating_ip_collection_virtual_network_interface_context_model = FloatingIPCollectionVirtualNetworkInterfaceContext.from_dict(floating_ip_collection_virtual_network_interface_context_model_json)
+ assert floating_ip_collection_virtual_network_interface_context_model != False
- backup_policy_job_status_reason_model = {} # BackupPolicyJobStatusReason
- backup_policy_job_status_reason_model['code'] = 'source_volume_busy'
- backup_policy_job_status_reason_model['message'] = 'testString'
- backup_policy_job_status_reason_model['more_info'] = 'https://cloud.ibm.com/docs/vpc?topic=vpc-troubleshooting-backup-for-vpc'
+ # Construct a model instance of FloatingIPCollectionVirtualNetworkInterfaceContext by calling from_dict on the json representation
+ floating_ip_collection_virtual_network_interface_context_model_dict = FloatingIPCollectionVirtualNetworkInterfaceContext.from_dict(floating_ip_collection_virtual_network_interface_context_model_json).__dict__
+ floating_ip_collection_virtual_network_interface_context_model2 = FloatingIPCollectionVirtualNetworkInterfaceContext(**floating_ip_collection_virtual_network_interface_context_model_dict)
- snapshot_reference_deleted_model = {} # SnapshotReferenceDeleted
- snapshot_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ # Verify the model instances are equivalent
+ assert floating_ip_collection_virtual_network_interface_context_model == floating_ip_collection_virtual_network_interface_context_model2
- snapshot_remote_model = {} # SnapshotRemote
- snapshot_remote_model['region'] = region_reference_model
+ # Convert model instance back to dict and verify no loss of data
+ floating_ip_collection_virtual_network_interface_context_model_json2 = floating_ip_collection_virtual_network_interface_context_model.to_dict()
+ assert floating_ip_collection_virtual_network_interface_context_model_json2 == floating_ip_collection_virtual_network_interface_context_model_json
- 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['remote'] = snapshot_remote_model
- snapshot_reference_model['resource_type'] = 'snapshot'
- backup_policy_job_model = {} # BackupPolicyJob
- backup_policy_job_model['auto_delete'] = True
- backup_policy_job_model['auto_delete_after'] = 90
- backup_policy_job_model['backup_policy_plan'] = backup_policy_plan_reference_model
- backup_policy_job_model['completed_at'] = '2019-01-01T12:00:00Z'
- backup_policy_job_model['created_at'] = '2019-01-01T12:00:00Z'
- backup_policy_job_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/backup_policies/0fe9e5d8-0a4d-4818-96ec-e99708644a58/jobs/4cf9171a-0043-4434-8727-15b53dbc374c'
- backup_policy_job_model['id'] = '4cf9171a-0043-4434-8727-15b53dbc374c'
- backup_policy_job_model['job_type'] = 'creation'
- backup_policy_job_model['resource_type'] = 'backup_policy_job'
- backup_policy_job_model['source'] = backup_policy_job_source_model
- backup_policy_job_model['status'] = 'failed'
- backup_policy_job_model['status_reasons'] = [backup_policy_job_status_reason_model]
- backup_policy_job_model['target_snapshots'] = [snapshot_reference_model]
+class TestModel_FloatingIPCollectionVirtualNetworkInterfaceContextFirst:
+ """
+ Test Class for FloatingIPCollectionVirtualNetworkInterfaceContextFirst
+ """
- backup_policy_job_collection_next_model = {} # BackupPolicyJobCollectionNext
- backup_policy_job_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/backup_policies/7241e2a8-601f-11ea-8503-000c29475bed/jobss?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
+ def test_floating_ip_collection_virtual_network_interface_context_first_serialization(self):
+ """
+ Test serialization/deserialization for FloatingIPCollectionVirtualNetworkInterfaceContextFirst
+ """
- # Construct a json representation of a BackupPolicyJobCollection model
- backup_policy_job_collection_model_json = {}
- backup_policy_job_collection_model_json['first'] = backup_policy_job_collection_first_model
- backup_policy_job_collection_model_json['jobs'] = [backup_policy_job_model]
- backup_policy_job_collection_model_json['limit'] = 20
- backup_policy_job_collection_model_json['next'] = backup_policy_job_collection_next_model
- backup_policy_job_collection_model_json['total_count'] = 132
+ # Construct a json representation of a FloatingIPCollectionVirtualNetworkInterfaceContextFirst model
+ floating_ip_collection_virtual_network_interface_context_first_model_json = {}
+ floating_ip_collection_virtual_network_interface_context_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9/floating_ips?limit=20'
- # Construct a model instance of BackupPolicyJobCollection by calling from_dict on the json representation
- backup_policy_job_collection_model = BackupPolicyJobCollection.from_dict(backup_policy_job_collection_model_json)
- assert backup_policy_job_collection_model != False
+ # Construct a model instance of FloatingIPCollectionVirtualNetworkInterfaceContextFirst by calling from_dict on the json representation
+ floating_ip_collection_virtual_network_interface_context_first_model = FloatingIPCollectionVirtualNetworkInterfaceContextFirst.from_dict(floating_ip_collection_virtual_network_interface_context_first_model_json)
+ assert floating_ip_collection_virtual_network_interface_context_first_model != False
- # Construct a model instance of BackupPolicyJobCollection by calling from_dict on the json representation
- backup_policy_job_collection_model_dict = BackupPolicyJobCollection.from_dict(backup_policy_job_collection_model_json).__dict__
- backup_policy_job_collection_model2 = BackupPolicyJobCollection(**backup_policy_job_collection_model_dict)
+ # Construct a model instance of FloatingIPCollectionVirtualNetworkInterfaceContextFirst by calling from_dict on the json representation
+ floating_ip_collection_virtual_network_interface_context_first_model_dict = FloatingIPCollectionVirtualNetworkInterfaceContextFirst.from_dict(floating_ip_collection_virtual_network_interface_context_first_model_json).__dict__
+ floating_ip_collection_virtual_network_interface_context_first_model2 = FloatingIPCollectionVirtualNetworkInterfaceContextFirst(**floating_ip_collection_virtual_network_interface_context_first_model_dict)
# Verify the model instances are equivalent
- assert backup_policy_job_collection_model == backup_policy_job_collection_model2
+ assert floating_ip_collection_virtual_network_interface_context_first_model == floating_ip_collection_virtual_network_interface_context_first_model2
# Convert model instance back to dict and verify no loss of data
- backup_policy_job_collection_model_json2 = backup_policy_job_collection_model.to_dict()
- assert backup_policy_job_collection_model_json2 == backup_policy_job_collection_model_json
+ floating_ip_collection_virtual_network_interface_context_first_model_json2 = floating_ip_collection_virtual_network_interface_context_first_model.to_dict()
+ assert floating_ip_collection_virtual_network_interface_context_first_model_json2 == floating_ip_collection_virtual_network_interface_context_first_model_json
-class TestModel_BackupPolicyJobCollectionFirst:
+class TestModel_FloatingIPCollectionVirtualNetworkInterfaceContextNext:
"""
- Test Class for BackupPolicyJobCollectionFirst
+ Test Class for FloatingIPCollectionVirtualNetworkInterfaceContextNext
"""
- def test_backup_policy_job_collection_first_serialization(self):
+ def test_floating_ip_collection_virtual_network_interface_context_next_serialization(self):
"""
- Test serialization/deserialization for BackupPolicyJobCollectionFirst
+ Test serialization/deserialization for FloatingIPCollectionVirtualNetworkInterfaceContextNext
"""
- # Construct a json representation of a BackupPolicyJobCollectionFirst model
- backup_policy_job_collection_first_model_json = {}
- backup_policy_job_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/backup_policies/7241e2a8-601f-11ea-8503-000c29475bed/jobs?limit=20'
+ # Construct a json representation of a FloatingIPCollectionVirtualNetworkInterfaceContextNext model
+ floating_ip_collection_virtual_network_interface_context_next_model_json = {}
+ floating_ip_collection_virtual_network_interface_context_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9/floating_ips?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
- # Construct a model instance of BackupPolicyJobCollectionFirst by calling from_dict on the json representation
- backup_policy_job_collection_first_model = BackupPolicyJobCollectionFirst.from_dict(backup_policy_job_collection_first_model_json)
- assert backup_policy_job_collection_first_model != False
+ # Construct a model instance of FloatingIPCollectionVirtualNetworkInterfaceContextNext by calling from_dict on the json representation
+ floating_ip_collection_virtual_network_interface_context_next_model = FloatingIPCollectionVirtualNetworkInterfaceContextNext.from_dict(floating_ip_collection_virtual_network_interface_context_next_model_json)
+ assert floating_ip_collection_virtual_network_interface_context_next_model != False
- # Construct a model instance of BackupPolicyJobCollectionFirst by calling from_dict on the json representation
- backup_policy_job_collection_first_model_dict = BackupPolicyJobCollectionFirst.from_dict(backup_policy_job_collection_first_model_json).__dict__
- backup_policy_job_collection_first_model2 = BackupPolicyJobCollectionFirst(**backup_policy_job_collection_first_model_dict)
+ # Construct a model instance of FloatingIPCollectionVirtualNetworkInterfaceContextNext by calling from_dict on the json representation
+ floating_ip_collection_virtual_network_interface_context_next_model_dict = FloatingIPCollectionVirtualNetworkInterfaceContextNext.from_dict(floating_ip_collection_virtual_network_interface_context_next_model_json).__dict__
+ floating_ip_collection_virtual_network_interface_context_next_model2 = FloatingIPCollectionVirtualNetworkInterfaceContextNext(**floating_ip_collection_virtual_network_interface_context_next_model_dict)
# Verify the model instances are equivalent
- assert backup_policy_job_collection_first_model == backup_policy_job_collection_first_model2
+ assert floating_ip_collection_virtual_network_interface_context_next_model == floating_ip_collection_virtual_network_interface_context_next_model2
# Convert model instance back to dict and verify no loss of data
- backup_policy_job_collection_first_model_json2 = backup_policy_job_collection_first_model.to_dict()
- assert backup_policy_job_collection_first_model_json2 == backup_policy_job_collection_first_model_json
+ floating_ip_collection_virtual_network_interface_context_next_model_json2 = floating_ip_collection_virtual_network_interface_context_next_model.to_dict()
+ assert floating_ip_collection_virtual_network_interface_context_next_model_json2 == floating_ip_collection_virtual_network_interface_context_next_model_json
-class TestModel_BackupPolicyJobCollectionNext:
+class TestModel_FloatingIPPatch:
"""
- Test Class for BackupPolicyJobCollectionNext
+ Test Class for FloatingIPPatch
"""
- def test_backup_policy_job_collection_next_serialization(self):
+ def test_floating_ip_patch_serialization(self):
"""
- Test serialization/deserialization for BackupPolicyJobCollectionNext
+ Test serialization/deserialization for FloatingIPPatch
"""
- # Construct a json representation of a BackupPolicyJobCollectionNext model
- backup_policy_job_collection_next_model_json = {}
- backup_policy_job_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/backup_policies/7241e2a8-601f-11ea-8503-000c29475bed/jobss?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
+ # Construct dict forms of any model objects needed in order to build this model.
- # Construct a model instance of BackupPolicyJobCollectionNext by calling from_dict on the json representation
- backup_policy_job_collection_next_model = BackupPolicyJobCollectionNext.from_dict(backup_policy_job_collection_next_model_json)
- assert backup_policy_job_collection_next_model != False
+ floating_ip_target_patch_model = {} # FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityById
+ floating_ip_target_patch_model['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e'
- # Construct a model instance of BackupPolicyJobCollectionNext by calling from_dict on the json representation
- backup_policy_job_collection_next_model_dict = BackupPolicyJobCollectionNext.from_dict(backup_policy_job_collection_next_model_json).__dict__
- backup_policy_job_collection_next_model2 = BackupPolicyJobCollectionNext(**backup_policy_job_collection_next_model_dict)
+ # 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 backup_policy_job_collection_next_model == backup_policy_job_collection_next_model2
+ assert floating_ip_patch_model == floating_ip_patch_model2
# Convert model instance back to dict and verify no loss of data
- backup_policy_job_collection_next_model_json2 = backup_policy_job_collection_next_model.to_dict()
- assert backup_policy_job_collection_next_model_json2 == backup_policy_job_collection_next_model_json
+ floating_ip_patch_model_json2 = floating_ip_patch_model.to_dict()
+ assert floating_ip_patch_model_json2 == floating_ip_patch_model_json
-class TestModel_BackupPolicyJobStatusReason:
+class TestModel_FloatingIPReference:
"""
- Test Class for BackupPolicyJobStatusReason
+ Test Class for FloatingIPReference
"""
- def test_backup_policy_job_status_reason_serialization(self):
+ def test_floating_ip_reference_serialization(self):
"""
- Test serialization/deserialization for BackupPolicyJobStatusReason
+ Test serialization/deserialization for FloatingIPReference
"""
- # Construct a json representation of a BackupPolicyJobStatusReason model
- backup_policy_job_status_reason_model_json = {}
- backup_policy_job_status_reason_model_json['code'] = 'source_volume_busy'
- backup_policy_job_status_reason_model_json['message'] = 'testString'
- backup_policy_job_status_reason_model_json['more_info'] = 'https://cloud.ibm.com/docs/vpc?topic=vpc-troubleshooting-backup-for-vpc'
+ # Construct dict forms of any model objects needed in order to build this model.
- # Construct a model instance of BackupPolicyJobStatusReason by calling from_dict on the json representation
- backup_policy_job_status_reason_model = BackupPolicyJobStatusReason.from_dict(backup_policy_job_status_reason_model_json)
- assert backup_policy_job_status_reason_model != False
+ 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 BackupPolicyJobStatusReason by calling from_dict on the json representation
- backup_policy_job_status_reason_model_dict = BackupPolicyJobStatusReason.from_dict(backup_policy_job_status_reason_model_json).__dict__
- backup_policy_job_status_reason_model2 = BackupPolicyJobStatusReason(**backup_policy_job_status_reason_model_dict)
+ # 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 backup_policy_job_status_reason_model == backup_policy_job_status_reason_model2
+ assert floating_ip_reference_model == floating_ip_reference_model2
# Convert model instance back to dict and verify no loss of data
- backup_policy_job_status_reason_model_json2 = backup_policy_job_status_reason_model.to_dict()
- assert backup_policy_job_status_reason_model_json2 == backup_policy_job_status_reason_model_json
+ floating_ip_reference_model_json2 = floating_ip_reference_model.to_dict()
+ assert floating_ip_reference_model_json2 == floating_ip_reference_model_json
-class TestModel_BackupPolicyPatch:
+class TestModel_FloatingIPReferenceDeleted:
"""
- Test Class for BackupPolicyPatch
+ Test Class for FloatingIPReferenceDeleted
"""
- def test_backup_policy_patch_serialization(self):
+ def test_floating_ip_reference_deleted_serialization(self):
"""
- Test serialization/deserialization for BackupPolicyPatch
+ Test serialization/deserialization for FloatingIPReferenceDeleted
"""
- # Construct a json representation of a BackupPolicyPatch model
- backup_policy_patch_model_json = {}
- backup_policy_patch_model_json['match_user_tags'] = ['my-daily-backup-policy']
- backup_policy_patch_model_json['name'] = 'my-backup-policy'
+ # 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 BackupPolicyPatch by calling from_dict on the json representation
- backup_policy_patch_model = BackupPolicyPatch.from_dict(backup_policy_patch_model_json)
- assert backup_policy_patch_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 BackupPolicyPatch by calling from_dict on the json representation
- backup_policy_patch_model_dict = BackupPolicyPatch.from_dict(backup_policy_patch_model_json).__dict__
- backup_policy_patch_model2 = BackupPolicyPatch(**backup_policy_patch_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 backup_policy_patch_model == backup_policy_patch_model2
+ assert floating_ip_reference_deleted_model == floating_ip_reference_deleted_model2
# Convert model instance back to dict and verify no loss of data
- backup_policy_patch_model_json2 = backup_policy_patch_model.to_dict()
- assert backup_policy_patch_model_json2 == backup_policy_patch_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_BackupPolicyPlan:
+class TestModel_FloatingIPUnpaginatedCollection:
"""
- Test Class for BackupPolicyPlan
+ Test Class for FloatingIPUnpaginatedCollection
"""
- def test_backup_policy_plan_serialization(self):
+ def test_floating_ip_unpaginated_collection_serialization(self):
"""
- Test serialization/deserialization for BackupPolicyPlan
+ Test serialization/deserialization for FloatingIPUnpaginatedCollection
"""
# 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'
+ 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'
- backup_policy_plan_clone_policy_model = {} # BackupPolicyPlanClonePolicy
- backup_policy_plan_clone_policy_model['max_snapshots'] = 1
- backup_policy_plan_clone_policy_model['zones'] = [zone_reference_model]
+ network_interface_reference_deleted_model = {} # NetworkInterfaceReferenceDeleted
+ network_interface_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- backup_policy_plan_deletion_trigger_model = {} # BackupPolicyPlanDeletionTrigger
- backup_policy_plan_deletion_trigger_model['delete_after'] = 20
- backup_policy_plan_deletion_trigger_model['delete_over_count'] = 20
+ reserved_ip_reference_deleted_model = {} # ReservedIPReferenceDeleted
+ reserved_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/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179'
+ 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'
- 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'
+ 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-instance-network-interface'
+ floating_ip_target_model['primary_ip'] = reserved_ip_reference_model
+ floating_ip_target_model['resource_type'] = 'network_interface'
- backup_policy_plan_remote_region_policy_model = {} # BackupPolicyPlanRemoteRegionPolicy
- backup_policy_plan_remote_region_policy_model['delete_over_count'] = 1
- backup_policy_plan_remote_region_policy_model['encryption_key'] = encryption_key_reference_model
- backup_policy_plan_remote_region_policy_model['region'] = region_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 json representation of a BackupPolicyPlan model
- backup_policy_plan_model_json = {}
- backup_policy_plan_model_json['active'] = True
- backup_policy_plan_model_json['attach_user_tags'] = ['my-daily-backup-plan']
- backup_policy_plan_model_json['clone_policy'] = backup_policy_plan_clone_policy_model
- backup_policy_plan_model_json['copy_user_tags'] = True
- backup_policy_plan_model_json['created_at'] = '2019-01-01T12:00:00Z'
- backup_policy_plan_model_json['cron_spec'] = '30 */2 * * 1-5'
- backup_policy_plan_model_json['deletion_trigger'] = backup_policy_plan_deletion_trigger_model
- backup_policy_plan_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178'
- backup_policy_plan_model_json['id'] = 'r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178'
- backup_policy_plan_model_json['lifecycle_state'] = 'stable'
- backup_policy_plan_model_json['name'] = 'my-policy-plan'
- backup_policy_plan_model_json['remote_region_policies'] = [backup_policy_plan_remote_region_policy_model]
- backup_policy_plan_model_json['resource_type'] = 'backup_policy_plan'
+ 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 model instance of BackupPolicyPlan by calling from_dict on the json representation
- backup_policy_plan_model = BackupPolicyPlan.from_dict(backup_policy_plan_model_json)
- assert backup_policy_plan_model != False
+ # 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 BackupPolicyPlan by calling from_dict on the json representation
- backup_policy_plan_model_dict = BackupPolicyPlan.from_dict(backup_policy_plan_model_json).__dict__
- backup_policy_plan_model2 = BackupPolicyPlan(**backup_policy_plan_model_dict)
+ # 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 backup_policy_plan_model == backup_policy_plan_model2
+ assert floating_ip_unpaginated_collection_model == floating_ip_unpaginated_collection_model2
# Convert model instance back to dict and verify no loss of data
- backup_policy_plan_model_json2 = backup_policy_plan_model.to_dict()
- assert backup_policy_plan_model_json2 == backup_policy_plan_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_BackupPolicyPlanClonePolicy:
+class TestModel_FlowLogCollector:
"""
- Test Class for BackupPolicyPlanClonePolicy
+ Test Class for FlowLogCollector
"""
- def test_backup_policy_plan_clone_policy_serialization(self):
+ def test_flow_log_collector_serialization(self):
"""
- Test serialization/deserialization for BackupPolicyPlanClonePolicy
+ Test serialization/deserialization for FlowLogCollector
"""
# 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'
+ 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 BackupPolicyPlanClonePolicy model
- backup_policy_plan_clone_policy_model_json = {}
- backup_policy_plan_clone_policy_model_json['max_snapshots'] = 1
- backup_policy_plan_clone_policy_model_json['zones'] = [zone_reference_model]
+ legacy_cloud_object_storage_bucket_reference_model = {} # LegacyCloudObjectStorageBucketReference
+ legacy_cloud_object_storage_bucket_reference_model['name'] = 'bucket-27200-lwx4cfvcue'
- # Construct a model instance of BackupPolicyPlanClonePolicy by calling from_dict on the json representation
- backup_policy_plan_clone_policy_model = BackupPolicyPlanClonePolicy.from_dict(backup_policy_plan_clone_policy_model_json)
- assert backup_policy_plan_clone_policy_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 BackupPolicyPlanClonePolicy by calling from_dict on the json representation
- backup_policy_plan_clone_policy_model_dict = BackupPolicyPlanClonePolicy.from_dict(backup_policy_plan_clone_policy_model_json).__dict__
- backup_policy_plan_clone_policy_model2 = BackupPolicyPlanClonePolicy(**backup_policy_plan_clone_policy_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-instance-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'
+ vpc_reference_model['resource_type'] = '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'] = legacy_cloud_object_storage_bucket_reference_model
+ flow_log_collector_model_json['target'] = flow_log_collector_target_model
+ flow_log_collector_model_json['vpc'] = vpc_reference_model
+
+ # 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 backup_policy_plan_clone_policy_model == backup_policy_plan_clone_policy_model2
+ assert flow_log_collector_model == flow_log_collector_model2
# Convert model instance back to dict and verify no loss of data
- backup_policy_plan_clone_policy_model_json2 = backup_policy_plan_clone_policy_model.to_dict()
- assert backup_policy_plan_clone_policy_model_json2 == backup_policy_plan_clone_policy_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_BackupPolicyPlanClonePolicyPatch:
+class TestModel_FlowLogCollectorCollection:
"""
- Test Class for BackupPolicyPlanClonePolicyPatch
+ Test Class for FlowLogCollectorCollection
"""
- def test_backup_policy_plan_clone_policy_patch_serialization(self):
+ def test_flow_log_collector_collection_serialization(self):
"""
- Test serialization/deserialization for BackupPolicyPlanClonePolicyPatch
+ Test serialization/deserialization for FlowLogCollectorCollection
"""
# 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'
+ 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'
- # Construct a json representation of a BackupPolicyPlanClonePolicyPatch model
- backup_policy_plan_clone_policy_patch_model_json = {}
- backup_policy_plan_clone_policy_patch_model_json['max_snapshots'] = 1
- backup_policy_plan_clone_policy_patch_model_json['zones'] = [zone_identity_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 BackupPolicyPlanClonePolicyPatch by calling from_dict on the json representation
- backup_policy_plan_clone_policy_patch_model = BackupPolicyPlanClonePolicyPatch.from_dict(backup_policy_plan_clone_policy_patch_model_json)
- assert backup_policy_plan_clone_policy_patch_model != False
+ legacy_cloud_object_storage_bucket_reference_model = {} # LegacyCloudObjectStorageBucketReference
+ legacy_cloud_object_storage_bucket_reference_model['name'] = 'bucket-27200-lwx4cfvcue'
- # Construct a model instance of BackupPolicyPlanClonePolicyPatch by calling from_dict on the json representation
- backup_policy_plan_clone_policy_patch_model_dict = BackupPolicyPlanClonePolicyPatch.from_dict(backup_policy_plan_clone_policy_patch_model_json).__dict__
- backup_policy_plan_clone_policy_patch_model2 = BackupPolicyPlanClonePolicyPatch(**backup_policy_plan_clone_policy_patch_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'
+
+ 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-instance-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'
+ vpc_reference_model['resource_type'] = 'vpc'
+
+ 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'] = legacy_cloud_object_storage_bucket_reference_model
+ flow_log_collector_model['target'] = flow_log_collector_target_model
+ flow_log_collector_model['vpc'] = vpc_reference_model
+
+ 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 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 backup_policy_plan_clone_policy_patch_model == backup_policy_plan_clone_policy_patch_model2
+ assert flow_log_collector_collection_model == flow_log_collector_collection_model2
# Convert model instance back to dict and verify no loss of data
- backup_policy_plan_clone_policy_patch_model_json2 = backup_policy_plan_clone_policy_patch_model.to_dict()
- assert backup_policy_plan_clone_policy_patch_model_json2 == backup_policy_plan_clone_policy_patch_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_BackupPolicyPlanClonePolicyPrototype:
+class TestModel_FlowLogCollectorCollectionFirst:
"""
- Test Class for BackupPolicyPlanClonePolicyPrototype
+ Test Class for FlowLogCollectorCollectionFirst
"""
- def test_backup_policy_plan_clone_policy_prototype_serialization(self):
+ def test_flow_log_collector_collection_first_serialization(self):
"""
- Test serialization/deserialization for BackupPolicyPlanClonePolicyPrototype
+ Test serialization/deserialization for FlowLogCollectorCollectionFirst
"""
- # 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'
-
- # Construct a json representation of a BackupPolicyPlanClonePolicyPrototype model
- backup_policy_plan_clone_policy_prototype_model_json = {}
- backup_policy_plan_clone_policy_prototype_model_json['max_snapshots'] = 5
- backup_policy_plan_clone_policy_prototype_model_json['zones'] = [zone_identity_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 BackupPolicyPlanClonePolicyPrototype by calling from_dict on the json representation
- backup_policy_plan_clone_policy_prototype_model = BackupPolicyPlanClonePolicyPrototype.from_dict(backup_policy_plan_clone_policy_prototype_model_json)
- assert backup_policy_plan_clone_policy_prototype_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 BackupPolicyPlanClonePolicyPrototype by calling from_dict on the json representation
- backup_policy_plan_clone_policy_prototype_model_dict = BackupPolicyPlanClonePolicyPrototype.from_dict(backup_policy_plan_clone_policy_prototype_model_json).__dict__
- backup_policy_plan_clone_policy_prototype_model2 = BackupPolicyPlanClonePolicyPrototype(**backup_policy_plan_clone_policy_prototype_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 backup_policy_plan_clone_policy_prototype_model == backup_policy_plan_clone_policy_prototype_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
- backup_policy_plan_clone_policy_prototype_model_json2 = backup_policy_plan_clone_policy_prototype_model.to_dict()
- assert backup_policy_plan_clone_policy_prototype_model_json2 == backup_policy_plan_clone_policy_prototype_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_BackupPolicyPlanCollection:
+class TestModel_FlowLogCollectorCollectionNext:
"""
- Test Class for BackupPolicyPlanCollection
+ Test Class for FlowLogCollectorCollectionNext
"""
- def test_backup_policy_plan_collection_serialization(self):
+ def test_flow_log_collector_collection_next_serialization(self):
"""
- Test serialization/deserialization for BackupPolicyPlanCollection
+ Test serialization/deserialization for FlowLogCollectorCollectionNext
"""
- # 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'
-
- backup_policy_plan_clone_policy_model = {} # BackupPolicyPlanClonePolicy
- backup_policy_plan_clone_policy_model['max_snapshots'] = 1
- backup_policy_plan_clone_policy_model['zones'] = [zone_reference_model]
-
- backup_policy_plan_deletion_trigger_model = {} # BackupPolicyPlanDeletionTrigger
- backup_policy_plan_deletion_trigger_model['delete_after'] = 20
- backup_policy_plan_deletion_trigger_model['delete_over_count'] = 20
-
- encryption_key_reference_model = {} # EncryptionKeyReference
- encryption_key_reference_model['crn'] = 'crn:v1:bluemix:public:kms:us-south:a/123456: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'
-
- backup_policy_plan_remote_region_policy_model = {} # BackupPolicyPlanRemoteRegionPolicy
- backup_policy_plan_remote_region_policy_model['delete_over_count'] = 1
- backup_policy_plan_remote_region_policy_model['encryption_key'] = encryption_key_reference_model
- backup_policy_plan_remote_region_policy_model['region'] = region_reference_model
-
- backup_policy_plan_model = {} # BackupPolicyPlan
- backup_policy_plan_model['active'] = True
- backup_policy_plan_model['attach_user_tags'] = ['my-daily-backup-plan']
- backup_policy_plan_model['clone_policy'] = backup_policy_plan_clone_policy_model
- backup_policy_plan_model['copy_user_tags'] = True
- backup_policy_plan_model['created_at'] = '2019-01-01T12:00:00Z'
- backup_policy_plan_model['cron_spec'] = '30 */2 * * 1-5'
- backup_policy_plan_model['deletion_trigger'] = backup_policy_plan_deletion_trigger_model
- backup_policy_plan_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178'
- backup_policy_plan_model['id'] = 'r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178'
- backup_policy_plan_model['lifecycle_state'] = 'stable'
- backup_policy_plan_model['name'] = 'my-policy-plan'
- backup_policy_plan_model['remote_region_policies'] = [backup_policy_plan_remote_region_policy_model]
- backup_policy_plan_model['resource_type'] = 'backup_policy_plan'
-
- # Construct a json representation of a BackupPolicyPlanCollection model
- backup_policy_plan_collection_model_json = {}
- backup_policy_plan_collection_model_json['plans'] = [backup_policy_plan_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'
- # Construct a model instance of BackupPolicyPlanCollection by calling from_dict on the json representation
- backup_policy_plan_collection_model = BackupPolicyPlanCollection.from_dict(backup_policy_plan_collection_model_json)
- assert backup_policy_plan_collection_model != False
+ # 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 BackupPolicyPlanCollection by calling from_dict on the json representation
- backup_policy_plan_collection_model_dict = BackupPolicyPlanCollection.from_dict(backup_policy_plan_collection_model_json).__dict__
- backup_policy_plan_collection_model2 = BackupPolicyPlanCollection(**backup_policy_plan_collection_model_dict)
+ # 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)
# Verify the model instances are equivalent
- assert backup_policy_plan_collection_model == backup_policy_plan_collection_model2
+ assert flow_log_collector_collection_next_model == flow_log_collector_collection_next_model2
# Convert model instance back to dict and verify no loss of data
- backup_policy_plan_collection_model_json2 = backup_policy_plan_collection_model.to_dict()
- assert backup_policy_plan_collection_model_json2 == backup_policy_plan_collection_model_json
+ 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
-class TestModel_BackupPolicyPlanDeletionTrigger:
+class TestModel_FlowLogCollectorPatch:
"""
- Test Class for BackupPolicyPlanDeletionTrigger
+ Test Class for FlowLogCollectorPatch
"""
- def test_backup_policy_plan_deletion_trigger_serialization(self):
+ def test_flow_log_collector_patch_serialization(self):
"""
- Test serialization/deserialization for BackupPolicyPlanDeletionTrigger
+ Test serialization/deserialization for FlowLogCollectorPatch
"""
- # Construct a json representation of a BackupPolicyPlanDeletionTrigger model
- backup_policy_plan_deletion_trigger_model_json = {}
- backup_policy_plan_deletion_trigger_model_json['delete_after'] = 20
- backup_policy_plan_deletion_trigger_model_json['delete_over_count'] = 20
+ # 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 BackupPolicyPlanDeletionTrigger by calling from_dict on the json representation
- backup_policy_plan_deletion_trigger_model = BackupPolicyPlanDeletionTrigger.from_dict(backup_policy_plan_deletion_trigger_model_json)
- assert backup_policy_plan_deletion_trigger_model != False
+ # 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 BackupPolicyPlanDeletionTrigger by calling from_dict on the json representation
- backup_policy_plan_deletion_trigger_model_dict = BackupPolicyPlanDeletionTrigger.from_dict(backup_policy_plan_deletion_trigger_model_json).__dict__
- backup_policy_plan_deletion_trigger_model2 = BackupPolicyPlanDeletionTrigger(**backup_policy_plan_deletion_trigger_model_dict)
+ # 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 backup_policy_plan_deletion_trigger_model == backup_policy_plan_deletion_trigger_model2
+ assert flow_log_collector_patch_model == flow_log_collector_patch_model2
# Convert model instance back to dict and verify no loss of data
- backup_policy_plan_deletion_trigger_model_json2 = backup_policy_plan_deletion_trigger_model.to_dict()
- assert backup_policy_plan_deletion_trigger_model_json2 == backup_policy_plan_deletion_trigger_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_BackupPolicyPlanDeletionTriggerPatch:
+class TestModel_GenericResourceReferenceDeleted:
"""
- Test Class for BackupPolicyPlanDeletionTriggerPatch
+ Test Class for GenericResourceReferenceDeleted
"""
- def test_backup_policy_plan_deletion_trigger_patch_serialization(self):
+ def test_generic_resource_reference_deleted_serialization(self):
"""
- Test serialization/deserialization for BackupPolicyPlanDeletionTriggerPatch
+ Test serialization/deserialization for GenericResourceReferenceDeleted
"""
- # Construct a json representation of a BackupPolicyPlanDeletionTriggerPatch model
- backup_policy_plan_deletion_trigger_patch_model_json = {}
- backup_policy_plan_deletion_trigger_patch_model_json['delete_after'] = 20
- backup_policy_plan_deletion_trigger_patch_model_json['delete_over_count'] = 1
+ # Construct a json representation of a GenericResourceReferenceDeleted model
+ generic_resource_reference_deleted_model_json = {}
+ generic_resource_reference_deleted_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Construct a model instance of BackupPolicyPlanDeletionTriggerPatch by calling from_dict on the json representation
- backup_policy_plan_deletion_trigger_patch_model = BackupPolicyPlanDeletionTriggerPatch.from_dict(backup_policy_plan_deletion_trigger_patch_model_json)
- assert backup_policy_plan_deletion_trigger_patch_model != False
+ # Construct a model instance of GenericResourceReferenceDeleted by calling from_dict on the json representation
+ generic_resource_reference_deleted_model = GenericResourceReferenceDeleted.from_dict(generic_resource_reference_deleted_model_json)
+ assert generic_resource_reference_deleted_model != False
- # Construct a model instance of BackupPolicyPlanDeletionTriggerPatch by calling from_dict on the json representation
- backup_policy_plan_deletion_trigger_patch_model_dict = BackupPolicyPlanDeletionTriggerPatch.from_dict(backup_policy_plan_deletion_trigger_patch_model_json).__dict__
- backup_policy_plan_deletion_trigger_patch_model2 = BackupPolicyPlanDeletionTriggerPatch(**backup_policy_plan_deletion_trigger_patch_model_dict)
+ # Construct a model instance of GenericResourceReferenceDeleted by calling from_dict on the json representation
+ generic_resource_reference_deleted_model_dict = GenericResourceReferenceDeleted.from_dict(generic_resource_reference_deleted_model_json).__dict__
+ generic_resource_reference_deleted_model2 = GenericResourceReferenceDeleted(**generic_resource_reference_deleted_model_dict)
# Verify the model instances are equivalent
- assert backup_policy_plan_deletion_trigger_patch_model == backup_policy_plan_deletion_trigger_patch_model2
+ assert generic_resource_reference_deleted_model == generic_resource_reference_deleted_model2
# Convert model instance back to dict and verify no loss of data
- backup_policy_plan_deletion_trigger_patch_model_json2 = backup_policy_plan_deletion_trigger_patch_model.to_dict()
- assert backup_policy_plan_deletion_trigger_patch_model_json2 == backup_policy_plan_deletion_trigger_patch_model_json
+ generic_resource_reference_deleted_model_json2 = generic_resource_reference_deleted_model.to_dict()
+ assert generic_resource_reference_deleted_model_json2 == generic_resource_reference_deleted_model_json
-class TestModel_BackupPolicyPlanDeletionTriggerPrototype:
+class TestModel_IKEPolicy:
"""
- Test Class for BackupPolicyPlanDeletionTriggerPrototype
+ Test Class for IKEPolicy
"""
- def test_backup_policy_plan_deletion_trigger_prototype_serialization(self):
+ def test_ike_policy_serialization(self):
"""
- Test serialization/deserialization for BackupPolicyPlanDeletionTriggerPrototype
+ Test serialization/deserialization for IKEPolicy
"""
- # Construct a json representation of a BackupPolicyPlanDeletionTriggerPrototype model
- backup_policy_plan_deletion_trigger_prototype_model_json = {}
- backup_policy_plan_deletion_trigger_prototype_model_json['delete_after'] = 20
- backup_policy_plan_deletion_trigger_prototype_model_json['delete_over_count'] = 20
+ # Construct dict forms of any model objects needed in order to build this model.
- # Construct a model instance of BackupPolicyPlanDeletionTriggerPrototype by calling from_dict on the json representation
- backup_policy_plan_deletion_trigger_prototype_model = BackupPolicyPlanDeletionTriggerPrototype.from_dict(backup_policy_plan_deletion_trigger_prototype_model_json)
- assert backup_policy_plan_deletion_trigger_prototype_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 BackupPolicyPlanDeletionTriggerPrototype by calling from_dict on the json representation
- backup_policy_plan_deletion_trigger_prototype_model_dict = BackupPolicyPlanDeletionTriggerPrototype.from_dict(backup_policy_plan_deletion_trigger_prototype_model_json).__dict__
- backup_policy_plan_deletion_trigger_prototype_model2 = BackupPolicyPlanDeletionTriggerPrototype(**backup_policy_plan_deletion_trigger_prototype_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 backup_policy_plan_deletion_trigger_prototype_model == backup_policy_plan_deletion_trigger_prototype_model2
+ assert ike_policy_model == ike_policy_model2
# Convert model instance back to dict and verify no loss of data
- backup_policy_plan_deletion_trigger_prototype_model_json2 = backup_policy_plan_deletion_trigger_prototype_model.to_dict()
- assert backup_policy_plan_deletion_trigger_prototype_model_json2 == backup_policy_plan_deletion_trigger_prototype_model_json
+ ike_policy_model_json2 = ike_policy_model.to_dict()
+ assert ike_policy_model_json2 == ike_policy_model_json
-class TestModel_BackupPolicyPlanPatch:
+class TestModel_IKEPolicyCollection:
"""
- Test Class for BackupPolicyPlanPatch
+ Test Class for IKEPolicyCollection
"""
- def test_backup_policy_plan_patch_serialization(self):
+ def test_ike_policy_collection_serialization(self):
"""
- Test serialization/deserialization for BackupPolicyPlanPatch
+ Test serialization/deserialization for IKEPolicyCollection
"""
# 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'
+ ike_policy_collection_first_model = {} # IKEPolicyCollectionFirst
+ ike_policy_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/ike_policies?limit=20'
- backup_policy_plan_clone_policy_patch_model = {} # BackupPolicyPlanClonePolicyPatch
- backup_policy_plan_clone_policy_patch_model['max_snapshots'] = 1
- backup_policy_plan_clone_policy_patch_model['zones'] = [zone_identity_model]
+ vpn_gateway_connection_reference_deleted_model = {} # VPNGatewayConnectionReferenceDeleted
+ vpn_gateway_connection_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- backup_policy_plan_deletion_trigger_patch_model = {} # BackupPolicyPlanDeletionTriggerPatch
- backup_policy_plan_deletion_trigger_patch_model['delete_after'] = 20
- backup_policy_plan_deletion_trigger_patch_model['delete_over_count'] = 1
+ 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_identity_model = {} # EncryptionKeyIdentityByCRN
- encryption_key_identity_model['crn'] = 'crn:v1:bluemix:public:kms:us-south:a/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179'
+ 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'
- region_identity_model = {} # RegionIdentityByName
- region_identity_model['name'] = 'us-south'
+ 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'
- backup_policy_plan_remote_region_policy_prototype_model = {} # BackupPolicyPlanRemoteRegionPolicyPrototype
- backup_policy_plan_remote_region_policy_prototype_model['delete_over_count'] = 5
- backup_policy_plan_remote_region_policy_prototype_model['encryption_key'] = encryption_key_identity_model
- backup_policy_plan_remote_region_policy_prototype_model['region'] = region_identity_model
+ 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 BackupPolicyPlanPatch model
- backup_policy_plan_patch_model_json = {}
- backup_policy_plan_patch_model_json['active'] = True
- backup_policy_plan_patch_model_json['attach_user_tags'] = ['my-daily-backup-plan']
- backup_policy_plan_patch_model_json['clone_policy'] = backup_policy_plan_clone_policy_patch_model
- backup_policy_plan_patch_model_json['copy_user_tags'] = True
- backup_policy_plan_patch_model_json['cron_spec'] = '30 */2 * * 1-5'
- backup_policy_plan_patch_model_json['deletion_trigger'] = backup_policy_plan_deletion_trigger_patch_model
- backup_policy_plan_patch_model_json['name'] = 'my-policy-plan'
- backup_policy_plan_patch_model_json['remote_region_policies'] = [backup_policy_plan_remote_region_policy_prototype_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 BackupPolicyPlanPatch by calling from_dict on the json representation
- backup_policy_plan_patch_model = BackupPolicyPlanPatch.from_dict(backup_policy_plan_patch_model_json)
- assert backup_policy_plan_patch_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 BackupPolicyPlanPatch by calling from_dict on the json representation
- backup_policy_plan_patch_model_dict = BackupPolicyPlanPatch.from_dict(backup_policy_plan_patch_model_json).__dict__
- backup_policy_plan_patch_model2 = BackupPolicyPlanPatch(**backup_policy_plan_patch_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 backup_policy_plan_patch_model == backup_policy_plan_patch_model2
+ assert ike_policy_collection_model == ike_policy_collection_model2
# Convert model instance back to dict and verify no loss of data
- backup_policy_plan_patch_model_json2 = backup_policy_plan_patch_model.to_dict()
- assert backup_policy_plan_patch_model_json2 == backup_policy_plan_patch_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_BackupPolicyPlanPrototype:
+class TestModel_IKEPolicyCollectionFirst:
"""
- Test Class for BackupPolicyPlanPrototype
+ Test Class for IKEPolicyCollectionFirst
"""
- def test_backup_policy_plan_prototype_serialization(self):
+ def test_ike_policy_collection_first_serialization(self):
"""
- Test serialization/deserialization for BackupPolicyPlanPrototype
+ 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'
- zone_identity_model = {} # ZoneIdentityByName
- zone_identity_model['name'] = 'us-south-1'
+ # 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
- backup_policy_plan_clone_policy_prototype_model = {} # BackupPolicyPlanClonePolicyPrototype
- backup_policy_plan_clone_policy_prototype_model['max_snapshots'] = 5
- backup_policy_plan_clone_policy_prototype_model['zones'] = [zone_identity_model]
+ # 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)
- backup_policy_plan_deletion_trigger_prototype_model = {} # BackupPolicyPlanDeletionTriggerPrototype
- backup_policy_plan_deletion_trigger_prototype_model['delete_after'] = 20
- backup_policy_plan_deletion_trigger_prototype_model['delete_over_count'] = 20
+ # Verify the model instances are equivalent
+ assert ike_policy_collection_first_model == ike_policy_collection_first_model2
- encryption_key_identity_model = {} # EncryptionKeyIdentityByCRN
- encryption_key_identity_model['crn'] = 'crn:v1:bluemix:public:kms:us-south:a/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179'
+ # 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
- region_identity_model = {} # RegionIdentityByName
- region_identity_model['name'] = 'us-south'
- backup_policy_plan_remote_region_policy_prototype_model = {} # BackupPolicyPlanRemoteRegionPolicyPrototype
- backup_policy_plan_remote_region_policy_prototype_model['delete_over_count'] = 5
- backup_policy_plan_remote_region_policy_prototype_model['encryption_key'] = encryption_key_identity_model
- backup_policy_plan_remote_region_policy_prototype_model['region'] = region_identity_model
+class TestModel_IKEPolicyCollectionNext:
+ """
+ Test Class for IKEPolicyCollectionNext
+ """
- # Construct a json representation of a BackupPolicyPlanPrototype model
- backup_policy_plan_prototype_model_json = {}
- backup_policy_plan_prototype_model_json['active'] = True
- backup_policy_plan_prototype_model_json['attach_user_tags'] = ['my-daily-backup-plan']
- backup_policy_plan_prototype_model_json['clone_policy'] = backup_policy_plan_clone_policy_prototype_model
- backup_policy_plan_prototype_model_json['copy_user_tags'] = True
- backup_policy_plan_prototype_model_json['cron_spec'] = '30 */2 * * 1-5'
- backup_policy_plan_prototype_model_json['deletion_trigger'] = backup_policy_plan_deletion_trigger_prototype_model
- backup_policy_plan_prototype_model_json['name'] = 'my-policy-plan'
- backup_policy_plan_prototype_model_json['remote_region_policies'] = [backup_policy_plan_remote_region_policy_prototype_model]
+ def test_ike_policy_collection_next_serialization(self):
+ """
+ Test serialization/deserialization for IKEPolicyCollectionNext
+ """
- # Construct a model instance of BackupPolicyPlanPrototype by calling from_dict on the json representation
- backup_policy_plan_prototype_model = BackupPolicyPlanPrototype.from_dict(backup_policy_plan_prototype_model_json)
- assert backup_policy_plan_prototype_model != False
+ # 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 a model instance of BackupPolicyPlanPrototype by calling from_dict on the json representation
- backup_policy_plan_prototype_model_dict = BackupPolicyPlanPrototype.from_dict(backup_policy_plan_prototype_model_json).__dict__
- backup_policy_plan_prototype_model2 = BackupPolicyPlanPrototype(**backup_policy_plan_prototype_model_dict)
+ # 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
+
+ # 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)
# Verify the model instances are equivalent
- assert backup_policy_plan_prototype_model == backup_policy_plan_prototype_model2
+ assert ike_policy_collection_next_model == ike_policy_collection_next_model2
# Convert model instance back to dict and verify no loss of data
- backup_policy_plan_prototype_model_json2 = backup_policy_plan_prototype_model.to_dict()
- assert backup_policy_plan_prototype_model_json2 == backup_policy_plan_prototype_model_json
+ 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
-class TestModel_BackupPolicyPlanReference:
+class TestModel_IKEPolicyPatch:
"""
- Test Class for BackupPolicyPlanReference
+ Test Class for IKEPolicyPatch
"""
- def test_backup_policy_plan_reference_serialization(self):
+ def test_ike_policy_patch_serialization(self):
"""
- Test serialization/deserialization for BackupPolicyPlanReference
+ Test serialization/deserialization for IKEPolicyPatch
"""
- # Construct dict forms of any model objects needed in order to build this model.
-
- backup_policy_plan_reference_deleted_model = {} # BackupPolicyPlanReferenceDeleted
- backup_policy_plan_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
-
- 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'
-
- backup_policy_plan_remote_model = {} # BackupPolicyPlanRemote
- backup_policy_plan_remote_model['region'] = region_reference_model
-
- # Construct a json representation of a BackupPolicyPlanReference model
- backup_policy_plan_reference_model_json = {}
- backup_policy_plan_reference_model_json['deleted'] = backup_policy_plan_reference_deleted_model
- backup_policy_plan_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178'
- backup_policy_plan_reference_model_json['id'] = 'r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178'
- backup_policy_plan_reference_model_json['name'] = 'my-policy-plan'
- backup_policy_plan_reference_model_json['remote'] = backup_policy_plan_remote_model
- backup_policy_plan_reference_model_json['resource_type'] = 'backup_policy_plan'
+ # Construct a json representation of a IKEPolicyPatch model
+ ike_policy_patch_model_json = {}
+ ike_policy_patch_model_json['authentication_algorithm'] = 'sha256'
+ 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 BackupPolicyPlanReference by calling from_dict on the json representation
- backup_policy_plan_reference_model = BackupPolicyPlanReference.from_dict(backup_policy_plan_reference_model_json)
- assert backup_policy_plan_reference_model != False
+ # 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 BackupPolicyPlanReference by calling from_dict on the json representation
- backup_policy_plan_reference_model_dict = BackupPolicyPlanReference.from_dict(backup_policy_plan_reference_model_json).__dict__
- backup_policy_plan_reference_model2 = BackupPolicyPlanReference(**backup_policy_plan_reference_model_dict)
+ # 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 backup_policy_plan_reference_model == backup_policy_plan_reference_model2
+ assert ike_policy_patch_model == ike_policy_patch_model2
# Convert model instance back to dict and verify no loss of data
- backup_policy_plan_reference_model_json2 = backup_policy_plan_reference_model.to_dict()
- assert backup_policy_plan_reference_model_json2 == backup_policy_plan_reference_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_BackupPolicyPlanReferenceDeleted:
+class TestModel_IKEPolicyReference:
"""
- Test Class for BackupPolicyPlanReferenceDeleted
+ Test Class for IKEPolicyReference
"""
- def test_backup_policy_plan_reference_deleted_serialization(self):
+ def test_ike_policy_reference_serialization(self):
"""
- Test serialization/deserialization for BackupPolicyPlanReferenceDeleted
+ Test serialization/deserialization for IKEPolicyReference
"""
- # Construct a json representation of a BackupPolicyPlanReferenceDeleted model
- backup_policy_plan_reference_deleted_model_json = {}
- backup_policy_plan_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 BackupPolicyPlanReferenceDeleted by calling from_dict on the json representation
- backup_policy_plan_reference_deleted_model = BackupPolicyPlanReferenceDeleted.from_dict(backup_policy_plan_reference_deleted_model_json)
- assert backup_policy_plan_reference_deleted_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 BackupPolicyPlanReferenceDeleted by calling from_dict on the json representation
- backup_policy_plan_reference_deleted_model_dict = BackupPolicyPlanReferenceDeleted.from_dict(backup_policy_plan_reference_deleted_model_json).__dict__
- backup_policy_plan_reference_deleted_model2 = BackupPolicyPlanReferenceDeleted(**backup_policy_plan_reference_deleted_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 backup_policy_plan_reference_deleted_model == backup_policy_plan_reference_deleted_model2
+ assert ike_policy_reference_model == ike_policy_reference_model2
# Convert model instance back to dict and verify no loss of data
- backup_policy_plan_reference_deleted_model_json2 = backup_policy_plan_reference_deleted_model.to_dict()
- assert backup_policy_plan_reference_deleted_model_json2 == backup_policy_plan_reference_deleted_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_BackupPolicyPlanRemote:
+class TestModel_IKEPolicyReferenceDeleted:
"""
- Test Class for BackupPolicyPlanRemote
+ Test Class for IKEPolicyReferenceDeleted
"""
- def test_backup_policy_plan_remote_serialization(self):
+ def test_ike_policy_reference_deleted_serialization(self):
"""
- Test serialization/deserialization for BackupPolicyPlanRemote
+ Test serialization/deserialization for IKEPolicyReferenceDeleted
"""
- # 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 BackupPolicyPlanRemote model
- backup_policy_plan_remote_model_json = {}
- backup_policy_plan_remote_model_json['region'] = region_reference_model
+ # 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 BackupPolicyPlanRemote by calling from_dict on the json representation
- backup_policy_plan_remote_model = BackupPolicyPlanRemote.from_dict(backup_policy_plan_remote_model_json)
- assert backup_policy_plan_remote_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 BackupPolicyPlanRemote by calling from_dict on the json representation
- backup_policy_plan_remote_model_dict = BackupPolicyPlanRemote.from_dict(backup_policy_plan_remote_model_json).__dict__
- backup_policy_plan_remote_model2 = BackupPolicyPlanRemote(**backup_policy_plan_remote_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 backup_policy_plan_remote_model == backup_policy_plan_remote_model2
+ assert ike_policy_reference_deleted_model == ike_policy_reference_deleted_model2
# Convert model instance back to dict and verify no loss of data
- backup_policy_plan_remote_model_json2 = backup_policy_plan_remote_model.to_dict()
- assert backup_policy_plan_remote_model_json2 == backup_policy_plan_remote_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_BackupPolicyPlanRemoteRegionPolicy:
+class TestModel_IP:
"""
- Test Class for BackupPolicyPlanRemoteRegionPolicy
+ Test Class for IP
"""
- def test_backup_policy_plan_remote_region_policy_serialization(self):
+ def test_ip_serialization(self):
"""
- Test serialization/deserialization for BackupPolicyPlanRemoteRegionPolicy
+ Test serialization/deserialization for IP
"""
- # 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/123456: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'
-
- # Construct a json representation of a BackupPolicyPlanRemoteRegionPolicy model
- backup_policy_plan_remote_region_policy_model_json = {}
- backup_policy_plan_remote_region_policy_model_json['delete_over_count'] = 1
- backup_policy_plan_remote_region_policy_model_json['encryption_key'] = encryption_key_reference_model
- backup_policy_plan_remote_region_policy_model_json['region'] = region_reference_model
+ # Construct a json representation of a IP model
+ ip_model_json = {}
+ ip_model_json['address'] = '192.168.3.4'
- # Construct a model instance of BackupPolicyPlanRemoteRegionPolicy by calling from_dict on the json representation
- backup_policy_plan_remote_region_policy_model = BackupPolicyPlanRemoteRegionPolicy.from_dict(backup_policy_plan_remote_region_policy_model_json)
- assert backup_policy_plan_remote_region_policy_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 BackupPolicyPlanRemoteRegionPolicy by calling from_dict on the json representation
- backup_policy_plan_remote_region_policy_model_dict = BackupPolicyPlanRemoteRegionPolicy.from_dict(backup_policy_plan_remote_region_policy_model_json).__dict__
- backup_policy_plan_remote_region_policy_model2 = BackupPolicyPlanRemoteRegionPolicy(**backup_policy_plan_remote_region_policy_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 backup_policy_plan_remote_region_policy_model == backup_policy_plan_remote_region_policy_model2
+ assert ip_model == ip_model2
# Convert model instance back to dict and verify no loss of data
- backup_policy_plan_remote_region_policy_model_json2 = backup_policy_plan_remote_region_policy_model.to_dict()
- assert backup_policy_plan_remote_region_policy_model_json2 == backup_policy_plan_remote_region_policy_model_json
+ ip_model_json2 = ip_model.to_dict()
+ assert ip_model_json2 == ip_model_json
-class TestModel_BackupPolicyPlanRemoteRegionPolicyPrototype:
+class TestModel_IPsecPolicy:
"""
- Test Class for BackupPolicyPlanRemoteRegionPolicyPrototype
+ Test Class for IPsecPolicy
"""
- def test_backup_policy_plan_remote_region_policy_prototype_serialization(self):
+ def test_i_psec_policy_serialization(self):
"""
- Test serialization/deserialization for BackupPolicyPlanRemoteRegionPolicyPrototype
+ Test serialization/deserialization for IPsecPolicy
"""
# 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/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179'
+ vpn_gateway_connection_reference_deleted_model = {} # VPNGatewayConnectionReferenceDeleted
+ vpn_gateway_connection_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- region_identity_model = {} # RegionIdentityByName
- region_identity_model['name'] = 'us-south'
+ 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 BackupPolicyPlanRemoteRegionPolicyPrototype model
- backup_policy_plan_remote_region_policy_prototype_model_json = {}
- backup_policy_plan_remote_region_policy_prototype_model_json['delete_over_count'] = 5
- backup_policy_plan_remote_region_policy_prototype_model_json['encryption_key'] = encryption_key_identity_model
- backup_policy_plan_remote_region_policy_prototype_model_json['region'] = region_identity_model
+ 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 BackupPolicyPlanRemoteRegionPolicyPrototype by calling from_dict on the json representation
- backup_policy_plan_remote_region_policy_prototype_model = BackupPolicyPlanRemoteRegionPolicyPrototype.from_dict(backup_policy_plan_remote_region_policy_prototype_model_json)
- assert backup_policy_plan_remote_region_policy_prototype_model != False
+ # Construct a json representation of a IPsecPolicy model
+ i_psec_policy_model_json = {}
+ i_psec_policy_model_json['authentication_algorithm'] = 'disabled'
+ i_psec_policy_model_json['connections'] = [vpn_gateway_connection_reference_model]
+ i_psec_policy_model_json['created_at'] = '2019-01-01T12:00:00Z'
+ i_psec_policy_model_json['encapsulation_mode'] = 'tunnel'
+ 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 BackupPolicyPlanRemoteRegionPolicyPrototype by calling from_dict on the json representation
- backup_policy_plan_remote_region_policy_prototype_model_dict = BackupPolicyPlanRemoteRegionPolicyPrototype.from_dict(backup_policy_plan_remote_region_policy_prototype_model_json).__dict__
- backup_policy_plan_remote_region_policy_prototype_model2 = BackupPolicyPlanRemoteRegionPolicyPrototype(**backup_policy_plan_remote_region_policy_prototype_model_dict)
+ # 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 backup_policy_plan_remote_region_policy_prototype_model == backup_policy_plan_remote_region_policy_prototype_model2
+ assert i_psec_policy_model == i_psec_policy_model2
# Convert model instance back to dict and verify no loss of data
- backup_policy_plan_remote_region_policy_prototype_model_json2 = backup_policy_plan_remote_region_policy_prototype_model.to_dict()
- assert backup_policy_plan_remote_region_policy_prototype_model_json2 == backup_policy_plan_remote_region_policy_prototype_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_BareMetalServer:
+class TestModel_IPsecPolicyCollection:
"""
- Test Class for BareMetalServer
+ Test Class for IPsecPolicyCollection
"""
- def test_bare_metal_server_serialization(self):
+ def test_i_psec_policy_collection_serialization(self):
"""
- Test serialization/deserialization for BareMetalServer
+ Test serialization/deserialization for IPsecPolicyCollection
"""
# 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-server-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'] = 'fcp'
- bare_metal_server_disk_model['name'] = 'my-bare-metal-server-disk'
- bare_metal_server_disk_model['resource_type'] = 'bare_metal_server_disk'
- bare_metal_server_disk_model['size'] = 100
-
- bare_metal_server_lifecycle_reason_model = {} # BareMetalServerLifecycleReason
- bare_metal_server_lifecycle_reason_model['code'] = 'resource_suspended_by_provider'
- bare_metal_server_lifecycle_reason_model['message'] = 'The resource has been suspended. Contact IBM support with the CRN for next steps.'
- bare_metal_server_lifecycle_reason_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#resource-suspension'
-
- network_interface_bare_metal_server_context_reference_deleted_model = {} # NetworkInterfaceBareMetalServerContextReferenceDeleted
- network_interface_bare_metal_server_context_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
-
- reserved_ip_reference_deleted_model = {} # ReservedIPReferenceDeleted
- reserved_ip_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
-
- reserved_ip_reference_model = {} # ReservedIPReference
- reserved_ip_reference_model['address'] = '192.168.3.4'
- reserved_ip_reference_model['deleted'] = reserved_ip_reference_deleted_model
- reserved_ip_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb'
- reserved_ip_reference_model['id'] = '6d353a0f-aeb1-4ae1-832e-1110d10981bb'
- reserved_ip_reference_model['name'] = 'my-reserved-ip'
- reserved_ip_reference_model['resource_type'] = 'subnet_reserved_ip'
-
- subnet_reference_deleted_model = {} # SubnetReferenceDeleted
- subnet_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
-
- subnet_reference_model = {} # SubnetReference
- subnet_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
- subnet_reference_model['deleted'] = subnet_reference_deleted_model
- subnet_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
- subnet_reference_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
- subnet_reference_model['name'] = 'my-subnet'
- subnet_reference_model['resource_type'] = 'subnet'
+ 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'
- 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-bare-metal-server-network-interface'
- network_interface_bare_metal_server_context_reference_model['primary_ip'] = reserved_ip_reference_model
- network_interface_bare_metal_server_context_reference_model['resource_type'] = 'network_interface'
- network_interface_bare_metal_server_context_reference_model['subnet'] = subnet_reference_model
+ vpn_gateway_connection_reference_deleted_model = {} # VPNGatewayConnectionReferenceDeleted
+ vpn_gateway_connection_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- 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'
+ 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'
- 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'] = 'disabled'
- bare_metal_server_trusted_platform_module_model['supported_modes'] = ['disabled']
-
- vpc_reference_deleted_model = {} # VPCReferenceDeleted
- vpc_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
-
- vpc_reference_model = {} # VPCReference
- vpc_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b'
- vpc_reference_model['deleted'] = vpc_reference_deleted_model
- vpc_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b'
- vpc_reference_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b'
- vpc_reference_model['name'] = 'my-vpc'
- vpc_reference_model['resource_type'] = 'vpc'
+ i_psec_policy_model = {} # IPsecPolicy
+ i_psec_policy_model['authentication_algorithm'] = 'disabled'
+ i_psec_policy_model['connections'] = [vpn_gateway_connection_reference_model]
+ i_psec_policy_model['created_at'] = '2019-01-01T12:00:00Z'
+ i_psec_policy_model['encapsulation_mode'] = 'tunnel'
+ 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'
- 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_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 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['lifecycle_reasons'] = [bare_metal_server_lifecycle_reason_model]
- bare_metal_server_model_json['lifecycle_state'] = 'stable'
- 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'] = 'deleting'
- 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 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 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 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 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)
+ # 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 bare_metal_server_model == bare_metal_server_model2
+ assert i_psec_policy_collection_model == i_psec_policy_collection_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
+ 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_BareMetalServerCPU:
+class TestModel_IPsecPolicyCollectionFirst:
"""
- Test Class for BareMetalServerCPU
+ Test Class for IPsecPolicyCollectionFirst
"""
- def test_bare_metal_server_cpu_serialization(self):
+ def test_i_psec_policy_collection_first_serialization(self):
"""
- Test serialization/deserialization for BareMetalServerCPU
+ Test serialization/deserialization for IPsecPolicyCollectionFirst
"""
- # 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 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 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 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 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)
+ # 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)
# Verify the model instances are equivalent
- assert bare_metal_server_cpu_model == bare_metal_server_cpu_model2
+ assert i_psec_policy_collection_first_model == i_psec_policy_collection_first_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
+ 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
-class TestModel_BareMetalServerCollection:
+class TestModel_IPsecPolicyCollectionNext:
"""
- Test Class for BareMetalServerCollection
+ Test Class for IPsecPolicyCollectionNext
"""
- def test_bare_metal_server_collection_serialization(self):
+ def test_i_psec_policy_collection_next_serialization(self):
"""
- Test serialization/deserialization for BareMetalServerCollection
+ Test serialization/deserialization for IPsecPolicyCollectionNext
"""
- # 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-server-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'] = 'fcp'
- bare_metal_server_disk_model['name'] = 'my-bare-metal-server-disk'
- bare_metal_server_disk_model['resource_type'] = 'bare_metal_server_disk'
- bare_metal_server_disk_model['size'] = 100
-
- bare_metal_server_lifecycle_reason_model = {} # BareMetalServerLifecycleReason
- bare_metal_server_lifecycle_reason_model['code'] = 'resource_suspended_by_provider'
- bare_metal_server_lifecycle_reason_model['message'] = 'The resource has been suspended. Contact IBM support with the CRN for next steps.'
- bare_metal_server_lifecycle_reason_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#resource-suspension'
-
- network_interface_bare_metal_server_context_reference_deleted_model = {} # NetworkInterfaceBareMetalServerContextReferenceDeleted
- network_interface_bare_metal_server_context_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
-
- reserved_ip_reference_deleted_model = {} # ReservedIPReferenceDeleted
- reserved_ip_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
-
- reserved_ip_reference_model = {} # ReservedIPReference
- reserved_ip_reference_model['address'] = '192.168.3.4'
- reserved_ip_reference_model['deleted'] = reserved_ip_reference_deleted_model
- reserved_ip_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb'
- reserved_ip_reference_model['id'] = '6d353a0f-aeb1-4ae1-832e-1110d10981bb'
- reserved_ip_reference_model['name'] = 'my-reserved-ip'
- reserved_ip_reference_model['resource_type'] = 'subnet_reserved_ip'
-
- subnet_reference_deleted_model = {} # SubnetReferenceDeleted
- subnet_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
-
- subnet_reference_model = {} # SubnetReference
- subnet_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
- subnet_reference_model['deleted'] = subnet_reference_deleted_model
- subnet_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
- subnet_reference_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
- subnet_reference_model['name'] = 'my-subnet'
- subnet_reference_model['resource_type'] = 'subnet'
-
- 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-bare-metal-server-network-interface'
- network_interface_bare_metal_server_context_reference_model['primary_ip'] = reserved_ip_reference_model
- network_interface_bare_metal_server_context_reference_model['resource_type'] = 'network_interface'
- network_interface_bare_metal_server_context_reference_model['subnet'] = subnet_reference_model
-
- 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'
+ # 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'
- 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'] = 'disabled'
- bare_metal_server_trusted_platform_module_model['supported_modes'] = ['disabled']
+ # 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
- vpc_reference_deleted_model = {} # VPCReferenceDeleted
- vpc_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ # 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)
- vpc_reference_model = {} # VPCReference
- vpc_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b'
- vpc_reference_model['deleted'] = vpc_reference_deleted_model
- vpc_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b'
- vpc_reference_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b'
- vpc_reference_model['name'] = 'my-vpc'
- vpc_reference_model['resource_type'] = 'vpc'
+ # Verify the model instances are equivalent
+ assert i_psec_policy_collection_next_model == i_psec_policy_collection_next_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_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
- 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['lifecycle_reasons'] = [bare_metal_server_lifecycle_reason_model]
- bare_metal_server_model['lifecycle_state'] = 'stable'
- 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'] = 'deleting'
- 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'
+class TestModel_IPsecPolicyPatch:
+ """
+ Test Class for IPsecPolicyPatch
+ """
- 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'
+ def test_i_psec_policy_patch_serialization(self):
+ """
+ Test serialization/deserialization for IPsecPolicyPatch
+ """
- # 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 json representation of a IPsecPolicyPatch model
+ i_psec_policy_patch_model_json = {}
+ i_psec_policy_patch_model_json['authentication_algorithm'] = 'disabled'
+ i_psec_policy_patch_model_json['encryption_algorithm'] = 'aes128'
+ i_psec_policy_patch_model_json['key_lifetime'] = 3600
+ i_psec_policy_patch_model_json['name'] = 'my-ipsec-policy'
+ i_psec_policy_patch_model_json['pfs'] = 'disabled'
- # 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 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 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)
+ # 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 bare_metal_server_collection_model == bare_metal_server_collection_model2
+ assert i_psec_policy_patch_model == i_psec_policy_patch_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
+ 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_BareMetalServerCollectionFirst:
+class TestModel_IPsecPolicyReference:
"""
- Test Class for BareMetalServerCollectionFirst
+ Test Class for IPsecPolicyReference
"""
- def test_bare_metal_server_collection_first_serialization(self):
+ def test_i_psec_policy_reference_serialization(self):
"""
- Test serialization/deserialization for BareMetalServerCollectionFirst
+ Test serialization/deserialization for IPsecPolicyReference
"""
- # 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 dict forms of any model objects needed in order to build this model.
- # 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
+ 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 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)
+ # 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 bare_metal_server_collection_first_model == bare_metal_server_collection_first_model2
+ assert i_psec_policy_reference_model == i_psec_policy_reference_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
+ 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_BareMetalServerCollectionNext:
+class TestModel_IPsecPolicyReferenceDeleted:
"""
- Test Class for BareMetalServerCollectionNext
+ Test Class for IPsecPolicyReferenceDeleted
"""
- def test_bare_metal_server_collection_next_serialization(self):
+ def test_i_psec_policy_reference_deleted_serialization(self):
"""
- Test serialization/deserialization for BareMetalServerCollectionNext
+ Test serialization/deserialization for IPsecPolicyReferenceDeleted
"""
- # 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 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 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 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 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)
+ # 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 bare_metal_server_collection_next_model == bare_metal_server_collection_next_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
- 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
+ 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_BareMetalServerConsoleAccessToken:
+class TestModel_Image:
"""
- Test Class for BareMetalServerConsoleAccessToken
+ Test Class for Image
"""
- def test_bare_metal_server_console_access_token_serialization(self):
+ def test_image_serialization(self):
"""
- Test serialization/deserialization for BareMetalServerConsoleAccessToken
+ Test serialization/deserialization for Image
"""
- # 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 dict forms of any model objects needed in order to build this model.
- # 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
+ catalog_offering_version_reference_model = {} # CatalogOfferingVersionReference
+ catalog_offering_version_reference_model['crn'] = 'crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d'
- # Construct a 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)
+ image_catalog_offering_model = {} # ImageCatalogOffering
+ image_catalog_offering_model['managed'] = True
+ image_catalog_offering_model['version'] = catalog_offering_version_reference_model
+
+ encryption_key_reference_model = {} # EncryptionKeyReference
+ encryption_key_reference_model['crn'] = 'crn:v1:bluemix:public:kms:us-south:a/123456: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'
+
+ volume_reference_deleted_model = {} # VolumeReferenceDeleted
+ volume_reference_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_remote_model = {} # VolumeRemote
+ volume_remote_model['region'] = region_reference_model
+
+ 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'
+ volume_reference_model['remote'] = volume_remote_model
+ volume_reference_model['resource_type'] = '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'
+
+ # Construct a json representation of a Image model
+ image_model_json = {}
+ image_model_json['catalog_offering'] = image_catalog_offering_model
+ image_model_json['created_at'] = '2019-01-01T12:00:00Z'
+ image_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8'
+ image_model_json['deprecation_at'] = '2019-01-01T12:00:00Z'
+ image_model_json['encryption'] = 'user_managed'
+ image_model_json['encryption_key'] = encryption_key_reference_model
+ image_model_json['file'] = image_file_model
+ 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['obsolescence_at'] = '2019-01-01T12:00:00Z'
+ image_model_json['operating_system'] = operating_system_model
+ image_model_json['resource_group'] = resource_group_reference_model
+ image_model_json['resource_type'] = 'image'
+ 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 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 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 bare_metal_server_console_access_token_model == bare_metal_server_console_access_token_model2
+ assert image_model == image_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
+ image_model_json2 = image_model.to_dict()
+ assert image_model_json2 == image_model_json
-class TestModel_BareMetalServerDisk:
+class TestModel_ImageCatalogOffering:
"""
- Test Class for BareMetalServerDisk
+ Test Class for ImageCatalogOffering
"""
- def test_bare_metal_server_disk_serialization(self):
+ def test_image_catalog_offering_serialization(self):
"""
- Test serialization/deserialization for BareMetalServerDisk
+ Test serialization/deserialization for ImageCatalogOffering
"""
- # 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'] = 'fcp'
- bare_metal_server_disk_model_json['name'] = 'my-bare-metal-server-disk'
- bare_metal_server_disk_model_json['resource_type'] = 'bare_metal_server_disk'
- bare_metal_server_disk_model_json['size'] = 100
+ # Construct dict forms of any model objects needed in order to build this model.
- # 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
+ catalog_offering_version_reference_model = {} # CatalogOfferingVersionReference
+ catalog_offering_version_reference_model['crn'] = 'crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d'
- # Construct a 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)
+ # Construct a json representation of a ImageCatalogOffering model
+ image_catalog_offering_model_json = {}
+ image_catalog_offering_model_json['managed'] = True
+ image_catalog_offering_model_json['version'] = catalog_offering_version_reference_model
+
+ # Construct a model instance of ImageCatalogOffering by calling from_dict on the json representation
+ image_catalog_offering_model = ImageCatalogOffering.from_dict(image_catalog_offering_model_json)
+ assert image_catalog_offering_model != False
+
+ # Construct a model instance of ImageCatalogOffering by calling from_dict on the json representation
+ image_catalog_offering_model_dict = ImageCatalogOffering.from_dict(image_catalog_offering_model_json).__dict__
+ image_catalog_offering_model2 = ImageCatalogOffering(**image_catalog_offering_model_dict)
# Verify the model instances are equivalent
- assert bare_metal_server_disk_model == bare_metal_server_disk_model2
+ assert image_catalog_offering_model == image_catalog_offering_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
+ image_catalog_offering_model_json2 = image_catalog_offering_model.to_dict()
+ assert image_catalog_offering_model_json2 == image_catalog_offering_model_json
-class TestModel_BareMetalServerDiskCollection:
+class TestModel_ImageCollection:
"""
- Test Class for BareMetalServerDiskCollection
+ Test Class for ImageCollection
"""
- def test_bare_metal_server_disk_collection_serialization(self):
+ def test_image_collection_serialization(self):
"""
- Test serialization/deserialization for BareMetalServerDiskCollection
+ Test serialization/deserialization for ImageCollection
"""
# 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'] = 'fcp'
- bare_metal_server_disk_model['name'] = 'my-bare-metal-server-disk'
- bare_metal_server_disk_model['resource_type'] = 'bare_metal_server_disk'
- bare_metal_server_disk_model['size'] = 100
+ image_collection_first_model = {} # ImageCollectionFirst
+ image_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/images?limit=20'
- # 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]
+ catalog_offering_version_reference_model = {} # CatalogOfferingVersionReference
+ catalog_offering_version_reference_model['crn'] = 'crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d'
- # Construct a 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
+ image_catalog_offering_model = {} # ImageCatalogOffering
+ image_catalog_offering_model['managed'] = True
+ image_catalog_offering_model['version'] = catalog_offering_version_reference_model
- # 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)
+ encryption_key_reference_model = {} # EncryptionKeyReference
+ encryption_key_reference_model['crn'] = 'crn:v1:bluemix:public:kms:us-south:a/123456: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'
+
+ volume_reference_deleted_model = {} # VolumeReferenceDeleted
+ volume_reference_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_remote_model = {} # VolumeRemote
+ volume_remote_model['region'] = region_reference_model
+
+ 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'
+ volume_reference_model['remote'] = volume_remote_model
+ volume_reference_model['resource_type'] = '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['catalog_offering'] = image_catalog_offering_model
+ image_model['created_at'] = '2019-01-01T12:00:00Z'
+ image_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8'
+ image_model['deprecation_at'] = '2019-01-01T12:00:00Z'
+ image_model['encryption'] = 'user_managed'
+ image_model['encryption_key'] = encryption_key_reference_model
+ image_model['file'] = image_file_model
+ 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['obsolescence_at'] = '2019-01-01T12:00:00Z'
+ image_model['operating_system'] = operating_system_model
+ image_model['resource_group'] = resource_group_reference_model
+ image_model['resource_type'] = 'image'
+ 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
+ image_collection_model_json['total_count'] = 132
+
+ # 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 bare_metal_server_disk_collection_model == bare_metal_server_disk_collection_model2
+ assert image_collection_model == image_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
+ image_collection_model_json2 = image_collection_model.to_dict()
+ assert image_collection_model_json2 == image_collection_model_json
-class TestModel_BareMetalServerDiskPatch:
+class TestModel_ImageCollectionFirst:
"""
- Test Class for BareMetalServerDiskPatch
+ Test Class for ImageCollectionFirst
"""
- def test_bare_metal_server_disk_patch_serialization(self):
+ def test_image_collection_first_serialization(self):
"""
- Test serialization/deserialization for BareMetalServerDiskPatch
+ Test serialization/deserialization for ImageCollectionFirst
"""
- # 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 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 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 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 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)
+ # 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)
# Verify the model instances are equivalent
- assert bare_metal_server_disk_patch_model == bare_metal_server_disk_patch_model2
+ assert image_collection_first_model == image_collection_first_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
+ image_collection_first_model_json2 = image_collection_first_model.to_dict()
+ assert image_collection_first_model_json2 == image_collection_first_model_json
-class TestModel_BareMetalServerDiskReferenceDeleted:
+class TestModel_ImageCollectionNext:
"""
- Test Class for BareMetalServerDiskReferenceDeleted
+ Test Class for ImageCollectionNext
"""
- def test_bare_metal_server_disk_reference_deleted_serialization(self):
+ def test_image_collection_next_serialization(self):
"""
- Test serialization/deserialization for BareMetalServerDiskReferenceDeleted
+ Test serialization/deserialization for ImageCollectionNext
"""
- # 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 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 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 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 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)
+ # 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 bare_metal_server_disk_reference_deleted_model == bare_metal_server_disk_reference_deleted_model2
+ assert image_collection_next_model == image_collection_next_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
+ image_collection_next_model_json2 = image_collection_next_model.to_dict()
+ assert image_collection_next_model_json2 == image_collection_next_model_json
-class TestModel_BareMetalServerInitialization:
+class TestModel_ImageExportJob:
"""
- Test Class for BareMetalServerInitialization
+ Test Class for ImageExportJob
"""
- def test_bare_metal_server_initialization_serialization(self):
+ def test_image_export_job_serialization(self):
"""
- Test serialization/deserialization for BareMetalServerInitialization
+ Test serialization/deserialization for ImageExportJob
"""
# 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'
-
- account_reference_model = {} # AccountReference
- account_reference_model['id'] = 'aa2432b1fa4d4ace891e9b80fc104e34'
- account_reference_model['resource_type'] = 'account'
-
- 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'
-
- image_remote_model = {} # ImageRemote
- image_remote_model['account'] = account_reference_model
- image_remote_model['region'] = region_reference_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'
- image_reference_model['remote'] = image_remote_model
- image_reference_model['resource_type'] = 'image'
-
- key_reference_deleted_model = {} # KeyReferenceDeleted
- key_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ image_export_job_status_reason_model = {} # ImageExportJobStatusReason
+ image_export_job_status_reason_model['code'] = 'cannot_access_storage_bucket'
+ image_export_job_status_reason_model['message'] = 'testString'
+ image_export_job_status_reason_model['more_info'] = 'https://cloud.ibm.com/docs/vpc?topic=vpc-object-storage-prereq'
- 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'
+ cloud_object_storage_bucket_reference_model = {} # CloudObjectStorageBucketReference
+ cloud_object_storage_bucket_reference_model['crn'] = 'crn:v1:bluemix:public:cloud-object-storage:global:a/123456:1a0ec336-f391-4091-a6fb-5e084a4c56f4:bucket:my-bucket'
+ cloud_object_storage_bucket_reference_model['name'] = 'bucket-27200-lwx4cfvcue'
- 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'
+ cloud_object_storage_object_reference_model = {} # CloudObjectStorageObjectReference
+ cloud_object_storage_object_reference_model['name'] = 'my-object'
- # 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 json representation of a ImageExportJob model
+ image_export_job_model_json = {}
+ image_export_job_model_json['completed_at'] = '2019-01-01T12:00:00Z'
+ image_export_job_model_json['created_at'] = '2019-01-01T12:00:00Z'
+ image_export_job_model_json['encrypted_data_key'] = 'VGhpcyBpcyBhIG1vY2sgYnl0ZSBhcnJheSB2YWx1ZS4='
+ image_export_job_model_json['format'] = 'qcow2'
+ image_export_job_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8/export_jobs/r134-095e9baf-01d4-4e29-986e-20d26606b82a'
+ image_export_job_model_json['id'] = 'r134-095e9baf-01d4-4e29-986e-20d26606b82a'
+ image_export_job_model_json['name'] = 'my-image-export'
+ image_export_job_model_json['resource_type'] = 'image_export_job'
+ image_export_job_model_json['started_at'] = '2019-01-01T12:00:00Z'
+ image_export_job_model_json['status'] = 'deleting'
+ image_export_job_model_json['status_reasons'] = [image_export_job_status_reason_model]
+ image_export_job_model_json['storage_bucket'] = cloud_object_storage_bucket_reference_model
+ image_export_job_model_json['storage_href'] = 'cos://us-south/bucket-27200-lwx4cfvcue/my-image-export.qcow2'
+ image_export_job_model_json['storage_object'] = cloud_object_storage_object_reference_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 ImageExportJob by calling from_dict on the json representation
+ image_export_job_model = ImageExportJob.from_dict(image_export_job_model_json)
+ assert image_export_job_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)
+ # Construct a model instance of ImageExportJob by calling from_dict on the json representation
+ image_export_job_model_dict = ImageExportJob.from_dict(image_export_job_model_json).__dict__
+ image_export_job_model2 = ImageExportJob(**image_export_job_model_dict)
# Verify the model instances are equivalent
- assert bare_metal_server_initialization_model == bare_metal_server_initialization_model2
+ assert image_export_job_model == image_export_job_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
+ image_export_job_model_json2 = image_export_job_model.to_dict()
+ assert image_export_job_model_json2 == image_export_job_model_json
-class TestModel_BareMetalServerInitializationPrototype:
+class TestModel_ImageExportJobPatch:
"""
- Test Class for BareMetalServerInitializationPrototype
+ Test Class for ImageExportJobPatch
"""
- def test_bare_metal_server_initialization_prototype_serialization(self):
+ def test_image_export_job_patch_serialization(self):
"""
- Test serialization/deserialization for BareMetalServerInitializationPrototype
+ Test serialization/deserialization for ImageExportJobPatch
"""
- # 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 json representation of a ImageExportJobPatch model
+ image_export_job_patch_model_json = {}
+ image_export_job_patch_model_json['name'] = 'my-image-export'
- # 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 ImageExportJobPatch by calling from_dict on the json representation
+ image_export_job_patch_model = ImageExportJobPatch.from_dict(image_export_job_patch_model_json)
+ assert image_export_job_patch_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)
+ # Construct a model instance of ImageExportJobPatch by calling from_dict on the json representation
+ image_export_job_patch_model_dict = ImageExportJobPatch.from_dict(image_export_job_patch_model_json).__dict__
+ image_export_job_patch_model2 = ImageExportJobPatch(**image_export_job_patch_model_dict)
# Verify the model instances are equivalent
- assert bare_metal_server_initialization_prototype_model == bare_metal_server_initialization_prototype_model2
+ assert image_export_job_patch_model == image_export_job_patch_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
+ image_export_job_patch_model_json2 = image_export_job_patch_model.to_dict()
+ assert image_export_job_patch_model_json2 == image_export_job_patch_model_json
-class TestModel_BareMetalServerLifecycleReason:
+class TestModel_ImageExportJobStatusReason:
"""
- Test Class for BareMetalServerLifecycleReason
+ Test Class for ImageExportJobStatusReason
"""
- def test_bare_metal_server_lifecycle_reason_serialization(self):
+ def test_image_export_job_status_reason_serialization(self):
"""
- Test serialization/deserialization for BareMetalServerLifecycleReason
+ Test serialization/deserialization for ImageExportJobStatusReason
"""
- # Construct a json representation of a BareMetalServerLifecycleReason model
- bare_metal_server_lifecycle_reason_model_json = {}
- bare_metal_server_lifecycle_reason_model_json['code'] = 'resource_suspended_by_provider'
- bare_metal_server_lifecycle_reason_model_json['message'] = 'The resource has been suspended. Contact IBM support with the CRN for next steps.'
- bare_metal_server_lifecycle_reason_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#resource-suspension'
+ # Construct a json representation of a ImageExportJobStatusReason model
+ image_export_job_status_reason_model_json = {}
+ image_export_job_status_reason_model_json['code'] = 'cannot_access_storage_bucket'
+ image_export_job_status_reason_model_json['message'] = 'testString'
+ image_export_job_status_reason_model_json['more_info'] = 'https://cloud.ibm.com/docs/vpc?topic=vpc-object-storage-prereq'
- # Construct a model instance of BareMetalServerLifecycleReason by calling from_dict on the json representation
- bare_metal_server_lifecycle_reason_model = BareMetalServerLifecycleReason.from_dict(bare_metal_server_lifecycle_reason_model_json)
- assert bare_metal_server_lifecycle_reason_model != False
+ # Construct a model instance of ImageExportJobStatusReason by calling from_dict on the json representation
+ image_export_job_status_reason_model = ImageExportJobStatusReason.from_dict(image_export_job_status_reason_model_json)
+ assert image_export_job_status_reason_model != False
- # Construct a model instance of BareMetalServerLifecycleReason by calling from_dict on the json representation
- bare_metal_server_lifecycle_reason_model_dict = BareMetalServerLifecycleReason.from_dict(bare_metal_server_lifecycle_reason_model_json).__dict__
- bare_metal_server_lifecycle_reason_model2 = BareMetalServerLifecycleReason(**bare_metal_server_lifecycle_reason_model_dict)
+ # Construct a model instance of ImageExportJobStatusReason by calling from_dict on the json representation
+ image_export_job_status_reason_model_dict = ImageExportJobStatusReason.from_dict(image_export_job_status_reason_model_json).__dict__
+ image_export_job_status_reason_model2 = ImageExportJobStatusReason(**image_export_job_status_reason_model_dict)
# Verify the model instances are equivalent
- assert bare_metal_server_lifecycle_reason_model == bare_metal_server_lifecycle_reason_model2
+ assert image_export_job_status_reason_model == image_export_job_status_reason_model2
# Convert model instance back to dict and verify no loss of data
- bare_metal_server_lifecycle_reason_model_json2 = bare_metal_server_lifecycle_reason_model.to_dict()
- assert bare_metal_server_lifecycle_reason_model_json2 == bare_metal_server_lifecycle_reason_model_json
+ image_export_job_status_reason_model_json2 = image_export_job_status_reason_model.to_dict()
+ assert image_export_job_status_reason_model_json2 == image_export_job_status_reason_model_json
-class TestModel_BareMetalServerNetworkInterfaceCollection:
+class TestModel_ImageExportJobUnpaginatedCollection:
"""
- Test Class for BareMetalServerNetworkInterfaceCollection
+ Test Class for ImageExportJobUnpaginatedCollection
"""
- def test_bare_metal_server_network_interface_collection_serialization(self):
+ def test_image_export_job_unpaginated_collection_serialization(self):
"""
- Test serialization/deserialization for BareMetalServerNetworkInterfaceCollection
+ Test serialization/deserialization for ImageExportJobUnpaginatedCollection
"""
# 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'
+ image_export_job_status_reason_model = {} # ImageExportJobStatusReason
+ image_export_job_status_reason_model['code'] = 'cannot_access_storage_bucket'
+ image_export_job_status_reason_model['message'] = 'testString'
+ image_export_job_status_reason_model['more_info'] = 'https://cloud.ibm.com/docs/vpc?topic=vpc-object-storage-prereq'
- floating_ip_reference_deleted_model = {} # FloatingIPReferenceDeleted
- floating_ip_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ cloud_object_storage_bucket_reference_model = {} # CloudObjectStorageBucketReference
+ cloud_object_storage_bucket_reference_model['crn'] = 'crn:v1:bluemix:public:cloud-object-storage:global:a/123456:1a0ec336-f391-4091-a6fb-5e084a4c56f4:bucket:my-bucket'
+ cloud_object_storage_bucket_reference_model['name'] = 'bucket-27200-lwx4cfvcue'
- 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'
+ cloud_object_storage_object_reference_model = {} # CloudObjectStorageObjectReference
+ cloud_object_storage_object_reference_model['name'] = 'my-object'
- reserved_ip_reference_deleted_model = {} # ReservedIPReferenceDeleted
- reserved_ip_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ image_export_job_model = {} # ImageExportJob
+ image_export_job_model['completed_at'] = '2019-01-01T12:00:00Z'
+ image_export_job_model['created_at'] = '2019-01-01T12:00:00Z'
+ image_export_job_model['encrypted_data_key'] = 'VGhpcyBpcyBhIG1vY2sgYnl0ZSBhcnJheSB2YWx1ZS4='
+ image_export_job_model['format'] = 'qcow2'
+ image_export_job_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8/export_jobs/r134-095e9baf-01d4-4e29-986e-20d26606b82a'
+ image_export_job_model['id'] = 'r134-095e9baf-01d4-4e29-986e-20d26606b82a'
+ image_export_job_model['name'] = 'my-image-export'
+ image_export_job_model['resource_type'] = 'image_export_job'
+ image_export_job_model['started_at'] = '2019-01-01T12:00:00Z'
+ image_export_job_model['status'] = 'deleting'
+ image_export_job_model['status_reasons'] = [image_export_job_status_reason_model]
+ image_export_job_model['storage_bucket'] = cloud_object_storage_bucket_reference_model
+ image_export_job_model['storage_href'] = 'cos://us-south/bucket-27200-lwx4cfvcue/my-image-export.qcow2'
+ image_export_job_model['storage_object'] = cloud_object_storage_object_reference_model
- reserved_ip_reference_model = {} # ReservedIPReference
- reserved_ip_reference_model['address'] = '192.168.3.4'
- reserved_ip_reference_model['deleted'] = reserved_ip_reference_deleted_model
- reserved_ip_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb'
- reserved_ip_reference_model['id'] = '6d353a0f-aeb1-4ae1-832e-1110d10981bb'
- reserved_ip_reference_model['name'] = 'my-reserved-ip'
- reserved_ip_reference_model['resource_type'] = 'subnet_reserved_ip'
+ # Construct a json representation of a ImageExportJobUnpaginatedCollection model
+ image_export_job_unpaginated_collection_model_json = {}
+ image_export_job_unpaginated_collection_model_json['export_jobs'] = [image_export_job_model]
- 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 ImageExportJobUnpaginatedCollection by calling from_dict on the json representation
+ image_export_job_unpaginated_collection_model = ImageExportJobUnpaginatedCollection.from_dict(image_export_job_unpaginated_collection_model_json)
+ assert image_export_job_unpaginated_collection_model != False
- 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 ImageExportJobUnpaginatedCollection by calling from_dict on the json representation
+ image_export_job_unpaginated_collection_model_dict = ImageExportJobUnpaginatedCollection.from_dict(image_export_job_unpaginated_collection_model_json).__dict__
+ image_export_job_unpaginated_collection_model2 = ImageExportJobUnpaginatedCollection(**image_export_job_unpaginated_collection_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 image_export_job_unpaginated_collection_model == image_export_job_unpaginated_collection_model2
- subnet_reference_model = {} # SubnetReference
- subnet_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
- subnet_reference_model['deleted'] = subnet_reference_deleted_model
- subnet_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
- subnet_reference_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
- subnet_reference_model['name'] = 'my-subnet'
- subnet_reference_model['resource_type'] = 'subnet'
+ # Convert model instance back to dict and verify no loss of data
+ image_export_job_unpaginated_collection_model_json2 = image_export_job_unpaginated_collection_model.to_dict()
+ assert image_export_job_unpaginated_collection_model_json2 == image_export_job_unpaginated_collection_model_json
- bare_metal_server_network_interface_model = {} # BareMetalServerNetworkInterfaceByHiperSocket
- bare_metal_server_network_interface_model['allow_ip_spoofing'] = True
- bare_metal_server_network_interface_model['created_at'] = '2019-01-01T12:00:00Z'
- bare_metal_server_network_interface_model['enable_infrastructure_nat'] = True
- bare_metal_server_network_interface_model['floating_ips'] = [floating_ip_reference_model]
- bare_metal_server_network_interface_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e'
- bare_metal_server_network_interface_model['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e'
- bare_metal_server_network_interface_model['mac_address'] = '02:00:04:00:C4:6A'
- bare_metal_server_network_interface_model['name'] = 'my-bare-metal-server-network-interface'
- bare_metal_server_network_interface_model['port_speed'] = 1000
- bare_metal_server_network_interface_model['primary_ip'] = reserved_ip_reference_model
- bare_metal_server_network_interface_model['resource_type'] = 'network_interface'
- 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['interface_type'] = 'hipersocket'
- bare_metal_server_network_interface_collection_next_model = {} # BareMetalServerNetworkInterfaceCollectionNext
- bare_metal_server_network_interface_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/3b2669a2-4c2b-4003-bc91-1b81f1326267/network_interfaces?start=d3e721fd-c988-4670-9927-dbd5e7b07fc6&limit=20'
+class TestModel_ImageFile:
+ """
+ Test Class for ImageFile
+ """
- # 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
+ def test_image_file_serialization(self):
+ """
+ Test serialization/deserialization for ImageFile
+ """
- # 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 dict forms of any model objects needed in order to build this model.
- # 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)
+ 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 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 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)
# Verify the model instances are equivalent
- assert bare_metal_server_network_interface_collection_model == bare_metal_server_network_interface_collection_model2
+ assert image_file_model == image_file_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
+ image_file_model_json2 = image_file_model.to_dict()
+ assert image_file_model_json2 == image_file_model_json
-class TestModel_BareMetalServerNetworkInterfaceCollectionFirst:
+class TestModel_ImageFileChecksums:
"""
- Test Class for BareMetalServerNetworkInterfaceCollectionFirst
+ Test Class for ImageFileChecksums
"""
- def test_bare_metal_server_network_interface_collection_first_serialization(self):
+ def test_image_file_checksums_serialization(self):
"""
- Test serialization/deserialization for BareMetalServerNetworkInterfaceCollectionFirst
+ Test serialization/deserialization for ImageFileChecksums
"""
- # 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 json representation of a ImageFileChecksums model
+ image_file_checksums_model_json = {}
+ image_file_checksums_model_json['sha256'] = 'e992a84f113d3a35d2145ca3e7aca4fc95fe6daf470a08d8af3422ee59c92e15'
- # 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 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 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)
+ # 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 bare_metal_server_network_interface_collection_first_model == bare_metal_server_network_interface_collection_first_model2
+ assert image_file_checksums_model == image_file_checksums_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
+ image_file_checksums_model_json2 = image_file_checksums_model.to_dict()
+ assert image_file_checksums_model_json2 == image_file_checksums_model_json
-class TestModel_BareMetalServerNetworkInterfaceCollectionNext:
+class TestModel_ImageFilePrototype:
"""
- Test Class for BareMetalServerNetworkInterfaceCollectionNext
+ Test Class for ImageFilePrototype
"""
- def test_bare_metal_server_network_interface_collection_next_serialization(self):
+ def test_image_file_prototype_serialization(self):
"""
- Test serialization/deserialization for BareMetalServerNetworkInterfaceCollectionNext
+ Test serialization/deserialization for ImageFilePrototype
"""
- # 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 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 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 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 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)
+ # 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 bare_metal_server_network_interface_collection_next_model == bare_metal_server_network_interface_collection_next_model2
+ assert image_file_prototype_model == image_file_prototype_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
+ image_file_prototype_model_json2 = image_file_prototype_model.to_dict()
+ assert image_file_prototype_model_json2 == image_file_prototype_model_json
-class TestModel_BareMetalServerNetworkInterfacePatch:
+class TestModel_ImagePatch:
"""
- Test Class for BareMetalServerNetworkInterfacePatch
+ Test Class for ImagePatch
"""
- def test_bare_metal_server_network_interface_patch_serialization(self):
+ def test_image_patch_serialization(self):
"""
- Test serialization/deserialization for BareMetalServerNetworkInterfacePatch
+ Test serialization/deserialization for ImagePatch
"""
- # 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-bare-metal-server-network-interface'
+ # Construct a json representation of a ImagePatch model
+ image_patch_model_json = {}
+ image_patch_model_json['deprecation_at'] = '2019-01-01T12:00:00Z'
+ image_patch_model_json['name'] = 'my-image'
+ image_patch_model_json['obsolescence_at'] = '2019-01-01T12:00:00Z'
- # Construct a model instance of 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 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 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)
+ # 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 bare_metal_server_network_interface_patch_model == bare_metal_server_network_interface_patch_model2
+ assert image_patch_model == image_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
+ image_patch_model_json2 = image_patch_model.to_dict()
+ assert image_patch_model_json2 == image_patch_model_json
-class TestModel_BareMetalServerNetworkInterfaceReferenceDeleted:
+class TestModel_ImageReference:
"""
- Test Class for BareMetalServerNetworkInterfaceReferenceDeleted
+ Test Class for ImageReference
"""
- def test_bare_metal_server_network_interface_reference_deleted_serialization(self):
+ def test_image_reference_serialization(self):
"""
- Test serialization/deserialization for BareMetalServerNetworkInterfaceReferenceDeleted
+ Test serialization/deserialization for ImageReference
"""
- # Construct a json representation of a BareMetalServerNetworkInterfaceReferenceDeleted model
- bare_metal_server_network_interface_reference_deleted_model_json = {}
- bare_metal_server_network_interface_reference_deleted_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ # Construct dict forms of any model objects needed in order to build this model.
- # Construct a model instance of BareMetalServerNetworkInterfaceReferenceDeleted by calling from_dict on the json representation
- bare_metal_server_network_interface_reference_deleted_model = BareMetalServerNetworkInterfaceReferenceDeleted.from_dict(bare_metal_server_network_interface_reference_deleted_model_json)
- assert bare_metal_server_network_interface_reference_deleted_model != False
+ image_reference_deleted_model = {} # ImageReferenceDeleted
+ image_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Construct a model instance of BareMetalServerNetworkInterfaceReferenceDeleted by calling from_dict on the json representation
- bare_metal_server_network_interface_reference_deleted_model_dict = BareMetalServerNetworkInterfaceReferenceDeleted.from_dict(bare_metal_server_network_interface_reference_deleted_model_json).__dict__
- bare_metal_server_network_interface_reference_deleted_model2 = BareMetalServerNetworkInterfaceReferenceDeleted(**bare_metal_server_network_interface_reference_deleted_model_dict)
+ account_reference_model = {} # AccountReference
+ account_reference_model['id'] = 'aa2432b1fa4d4ace891e9b80fc104e34'
+ account_reference_model['resource_type'] = 'account'
+
+ 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'
+
+ image_remote_model = {} # ImageRemote
+ image_remote_model['account'] = account_reference_model
+ image_remote_model['region'] = region_reference_model
+
+ # 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'
+ image_reference_model_json['remote'] = image_remote_model
+ image_reference_model_json['resource_type'] = '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 bare_metal_server_network_interface_reference_deleted_model == bare_metal_server_network_interface_reference_deleted_model2
+ assert image_reference_model == image_reference_model2
# Convert model instance back to dict and verify no loss of data
- bare_metal_server_network_interface_reference_deleted_model_json2 = bare_metal_server_network_interface_reference_deleted_model.to_dict()
- assert bare_metal_server_network_interface_reference_deleted_model_json2 == bare_metal_server_network_interface_reference_deleted_model_json
+ image_reference_model_json2 = image_reference_model.to_dict()
+ assert image_reference_model_json2 == image_reference_model_json
-class TestModel_BareMetalServerNetworkInterfaceReferenceTargetContextDeleted:
+class TestModel_ImageReferenceDeleted:
"""
- Test Class for BareMetalServerNetworkInterfaceReferenceTargetContextDeleted
+ Test Class for ImageReferenceDeleted
"""
- def test_bare_metal_server_network_interface_reference_target_context_deleted_serialization(self):
+ def test_image_reference_deleted_serialization(self):
"""
- Test serialization/deserialization for BareMetalServerNetworkInterfaceReferenceTargetContextDeleted
+ Test serialization/deserialization for ImageReferenceDeleted
"""
- # Construct a json representation of a BareMetalServerNetworkInterfaceReferenceTargetContextDeleted model
- bare_metal_server_network_interface_reference_target_context_deleted_model_json = {}
- bare_metal_server_network_interface_reference_target_context_deleted_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ # Construct a 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 model instance of BareMetalServerNetworkInterfaceReferenceTargetContextDeleted by calling from_dict on the json representation
- bare_metal_server_network_interface_reference_target_context_deleted_model = BareMetalServerNetworkInterfaceReferenceTargetContextDeleted.from_dict(bare_metal_server_network_interface_reference_target_context_deleted_model_json)
- assert bare_metal_server_network_interface_reference_target_context_deleted_model != False
+ # Construct a model instance of 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 BareMetalServerNetworkInterfaceReferenceTargetContextDeleted by calling from_dict on the json representation
- bare_metal_server_network_interface_reference_target_context_deleted_model_dict = BareMetalServerNetworkInterfaceReferenceTargetContextDeleted.from_dict(bare_metal_server_network_interface_reference_target_context_deleted_model_json).__dict__
- bare_metal_server_network_interface_reference_target_context_deleted_model2 = BareMetalServerNetworkInterfaceReferenceTargetContextDeleted(**bare_metal_server_network_interface_reference_target_context_deleted_model_dict)
+ # 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)
# Verify the model instances are equivalent
- assert bare_metal_server_network_interface_reference_target_context_deleted_model == bare_metal_server_network_interface_reference_target_context_deleted_model2
+ assert image_reference_deleted_model == image_reference_deleted_model2
# Convert model instance back to dict and verify no loss of data
- bare_metal_server_network_interface_reference_target_context_deleted_model_json2 = bare_metal_server_network_interface_reference_target_context_deleted_model.to_dict()
- assert bare_metal_server_network_interface_reference_target_context_deleted_model_json2 == bare_metal_server_network_interface_reference_target_context_deleted_model_json
+ image_reference_deleted_model_json2 = image_reference_deleted_model.to_dict()
+ assert image_reference_deleted_model_json2 == image_reference_deleted_model_json
-class TestModel_BareMetalServerPatch:
+class TestModel_ImageRemote:
"""
- Test Class for BareMetalServerPatch
+ Test Class for ImageRemote
"""
- def test_bare_metal_server_patch_serialization(self):
+ def test_image_remote_serialization(self):
"""
- Test serialization/deserialization for BareMetalServerPatch
+ Test serialization/deserialization for ImageRemote
"""
# Construct dict forms of any model objects needed in order to build this model.
- bare_metal_server_trusted_platform_module_patch_model = {} # BareMetalServerTrustedPlatformModulePatch
- bare_metal_server_trusted_platform_module_patch_model['mode'] = 'disabled'
+ account_reference_model = {} # AccountReference
+ account_reference_model['id'] = 'aa2432b1fa4d4ace891e9b80fc104e34'
+ account_reference_model['resource_type'] = 'account'
- # Construct a json representation of a BareMetalServerPatch model
- bare_metal_server_patch_model_json = {}
- bare_metal_server_patch_model_json['enable_secure_boot'] = False
- bare_metal_server_patch_model_json['name'] = 'my-bare-metal-server'
- bare_metal_server_patch_model_json['trusted_platform_module'] = bare_metal_server_trusted_platform_module_patch_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 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 json representation of a ImageRemote model
+ image_remote_model_json = {}
+ image_remote_model_json['account'] = account_reference_model
+ image_remote_model_json['region'] = region_reference_model
- # 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)
+ # Construct a model instance of ImageRemote by calling from_dict on the json representation
+ image_remote_model = ImageRemote.from_dict(image_remote_model_json)
+ assert image_remote_model != False
+
+ # Construct a model instance of ImageRemote by calling from_dict on the json representation
+ image_remote_model_dict = ImageRemote.from_dict(image_remote_model_json).__dict__
+ image_remote_model2 = ImageRemote(**image_remote_model_dict)
# Verify the model instances are equivalent
- assert bare_metal_server_patch_model == bare_metal_server_patch_model2
+ assert image_remote_model == image_remote_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
+ image_remote_model_json2 = image_remote_model.to_dict()
+ assert image_remote_model_json2 == image_remote_model_json
-class TestModel_BareMetalServerPrimaryNetworkInterfacePrototype:
+class TestModel_ImageStatusReason:
"""
- Test Class for BareMetalServerPrimaryNetworkInterfacePrototype
+ Test Class for ImageStatusReason
"""
- def test_bare_metal_server_primary_network_interface_prototype_serialization(self):
+ def test_image_status_reason_serialization(self):
"""
- Test serialization/deserialization for BareMetalServerPrimaryNetworkInterfacePrototype
+ Test serialization/deserialization for ImageStatusReason
"""
- # Construct dict forms of any model objects needed in order to build this model.
-
- network_interface_ip_prototype_model = {} # NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext
- network_interface_ip_prototype_model['address'] = '10.0.0.5'
- network_interface_ip_prototype_model['auto_delete'] = False
- network_interface_ip_prototype_model['name'] = 'my-reserved-ip'
-
- security_group_identity_model = {} # SecurityGroupIdentityById
- security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271'
-
- subnet_identity_model = {} # SubnetIdentityById
- subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
-
- # Construct a json representation of a 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-bare-metal-server-network-interface'
- bare_metal_server_primary_network_interface_prototype_model_json['primary_ip'] = network_interface_ip_prototype_model
- bare_metal_server_primary_network_interface_prototype_model_json['security_groups'] = [security_group_identity_model]
- bare_metal_server_primary_network_interface_prototype_model_json['subnet'] = subnet_identity_model
-
- # 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 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 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)
+ # 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 bare_metal_server_primary_network_interface_prototype_model == bare_metal_server_primary_network_interface_prototype_model2
+ assert image_status_reason_model == image_status_reason_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
+ image_status_reason_model_json2 = image_status_reason_model.to_dict()
+ assert image_status_reason_model_json2 == image_status_reason_model_json
-class TestModel_BareMetalServerProfile:
+class TestModel_Instance:
"""
- Test Class for BareMetalServerProfile
+ Test Class for Instance
"""
- def test_bare_metal_server_profile_serialization(self):
+ def test_instance_serialization(self):
"""
- Test serialization/deserialization for BareMetalServerProfile
+ Test serialization/deserialization for Instance
"""
# 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
+ instance_availability_policy_model = {} # InstanceAvailabilityPolicy
+ instance_availability_policy_model['host_failure'] = 'restart'
- bare_metal_server_profile_console_types_model = {} # BareMetalServerProfileConsoleTypes
- bare_metal_server_profile_console_types_model['type'] = 'enum'
- bare_metal_server_profile_console_types_model['values'] = ['serial']
+ 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'
- 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'
+ volume_attachment_device_model = {} # VolumeAttachmentDevice
+ volume_attachment_device_model['id'] = 'a8a15363-a6f7-4f01-af60-715e85b28141'
- 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
+ volume_reference_volume_attachment_context_deleted_model = {} # VolumeReferenceVolumeAttachmentContextDeleted
+ volume_reference_volume_attachment_context_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- 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
+ volume_reference_volume_attachment_context_model = {} # VolumeReferenceVolumeAttachmentContext
+ volume_reference_volume_attachment_context_model['crn'] = 'crn:[...]'
+ volume_reference_volume_attachment_context_model['deleted'] = volume_reference_volume_attachment_context_deleted_model
+ volume_reference_volume_attachment_context_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volumes/49c5d61b-41e7-4c01-9b7a-1a97366c6916'
+ volume_reference_volume_attachment_context_model['id'] = '49c5d61b-41e7-4c01-9b7a-1a97366c6916'
+ volume_reference_volume_attachment_context_model['name'] = 'my-boot-volume'
+ volume_reference_volume_attachment_context_model['resource_type'] = 'volume'
- 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
+ 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'] = '7389-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_volume_attachment_context_model
- 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
+ catalog_offering_version_reference_model = {} # CatalogOfferingVersionReference
+ catalog_offering_version_reference_model['crn'] = 'crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d'
- bare_metal_server_profile_disk_supported_interfaces_model = {} # BareMetalServerProfileDiskSupportedInterfaces
- bare_metal_server_profile_disk_supported_interfaces_model['default'] = 'fcp'
- bare_metal_server_profile_disk_supported_interfaces_model['type'] = 'enum'
- bare_metal_server_profile_disk_supported_interfaces_model['values'] = ['fcp']
+ instance_catalog_offering_model = {} # InstanceCatalogOffering
+ instance_catalog_offering_model['version'] = catalog_offering_version_reference_model
- 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
+ dedicated_host_reference_deleted_model = {} # DedicatedHostReferenceDeleted
+ dedicated_host_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- bare_metal_server_profile_memory_model = {} # BareMetalServerProfileMemoryFixed
- bare_metal_server_profile_memory_model['type'] = 'fixed'
- bare_metal_server_profile_memory_model['value'] = 16
+ 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'
- bare_metal_server_profile_network_interface_count_model = {} # BareMetalServerProfileNetworkInterfaceCountRange
- bare_metal_server_profile_network_interface_count_model['max'] = 128
- bare_metal_server_profile_network_interface_count_model['min'] = 1
- bare_metal_server_profile_network_interface_count_model['type'] = 'range'
+ 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
- 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']
+ 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'
- 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'] = ['disabled']
+ instance_health_reason_model = {} # InstanceHealthReason
+ instance_health_reason_model['code'] = 'reservation_expired'
+ instance_health_reason_model['message'] = 'The reservation cannot be used because it has expired.'
+ instance_health_reason_model['more_info'] = 'https://cloud.ibm.com/docs/vpc?topic=vpc-virtual-server-health-status-reasons'
- # 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['console_types'] = bare_metal_server_profile_console_types_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['network_interface_count'] = bare_metal_server_profile_network_interface_count_model
- 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
+ image_reference_deleted_model = {} # ImageReferenceDeleted
+ image_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # 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
+ account_reference_model = {} # AccountReference
+ account_reference_model['id'] = 'aa2432b1fa4d4ace891e9b80fc104e34'
+ account_reference_model['resource_type'] = 'account'
- # 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)
+ 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'
- # Verify the model instances are equivalent
- assert bare_metal_server_profile_model == bare_metal_server_profile_model2
+ image_remote_model = {} # ImageRemote
+ image_remote_model['account'] = account_reference_model
+ image_remote_model['region'] = region_reference_model
- # 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
+ 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'
+ image_reference_model['remote'] = image_remote_model
+ image_reference_model['resource_type'] = 'image'
+ instance_lifecycle_reason_model = {} # InstanceLifecycleReason
+ instance_lifecycle_reason_model['code'] = 'resource_suspended_by_provider'
+ instance_lifecycle_reason_model['message'] = 'The resource has been suspended. Contact IBM support with the CRN for next steps.'
+ instance_lifecycle_reason_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#resource-suspension'
-class TestModel_BareMetalServerProfileCPUArchitecture:
- """
- Test Class for BareMetalServerProfileCPUArchitecture
- """
+ instance_metadata_service_model = {} # InstanceMetadataService
+ instance_metadata_service_model['enabled'] = True
+ instance_metadata_service_model['protocol'] = 'http'
+ instance_metadata_service_model['response_hop_limit'] = 1
- def test_bare_metal_server_profile_cpu_architecture_serialization(self):
- """
- Test serialization/deserialization for BareMetalServerProfileCPUArchitecture
- """
+ instance_network_attachment_reference_deleted_model = {} # InstanceNetworkAttachmentReferenceDeleted
+ instance_network_attachment_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # 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'
+ 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 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
+ reserved_ip_reference_model = {} # ReservedIPReference
+ reserved_ip_reference_model['address'] = '10.0.0.32'
+ reserved_ip_reference_model['deleted'] = reserved_ip_reference_deleted_model
+ reserved_ip_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/0716-b28a7e6d-a66b-4de7-8713-15dcffdce401/reserved_ips/0716-7768a27e-cd6c-4a13-a9e6-d67a964e54a5'
+ reserved_ip_reference_model['id'] = '0716-7768a27e-cd6c-4a13-a9e6-d67a964e54a5'
+ reserved_ip_reference_model['name'] = 'my-reserved-ip-1'
+ reserved_ip_reference_model['resource_type'] = 'subnet_reserved_ip'
- # 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)
+ 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 bare_metal_server_profile_cpu_architecture_model == bare_metal_server_profile_cpu_architecture_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/7389-bea6a632-5e13-42a4-b4b8-31dc877abfe4'
+ subnet_reference_model['id'] = 'bea6a632-5e13-42a4-b4b8-31dc877abfe4'
+ subnet_reference_model['name'] = 'my-subnet'
+ subnet_reference_model['resource_type'] = 'subnet'
- # 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
+ instance_network_attachment_reference_model = {} # InstanceNetworkAttachmentReference
+ instance_network_attachment_reference_model['deleted'] = instance_network_attachment_reference_deleted_model
+ instance_network_attachment_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/0fe9e5d8-0a4d-4818-96ec-e99708644a58/network_attachments/4cf9171a-0043-4434-8727-15b53dbc374c'
+ instance_network_attachment_reference_model['id'] = '4cf9171a-0043-4434-8727-15b53dbc374c'
+ instance_network_attachment_reference_model['name'] = 'my-network-attachment'
+ instance_network_attachment_reference_model['primary_ip'] = reserved_ip_reference_model
+ instance_network_attachment_reference_model['resource_type'] = 'instance_network_attachment'
+ instance_network_attachment_reference_model['subnet'] = subnet_reference_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'
-class TestModel_BareMetalServerProfileCollection:
- """
- Test Class for BareMetalServerProfileCollection
- """
+ 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_ip'] = reserved_ip_reference_model
+ network_interface_instance_context_reference_model['resource_type'] = 'network_interface'
+ network_interface_instance_context_reference_model['subnet'] = subnet_reference_model
- def test_bare_metal_server_profile_collection_serialization(self):
- """
- Test serialization/deserialization for BareMetalServerProfileCollection
- """
+ 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:[...]'
+ 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-84e4793a-7cd8-4a7b-b253-818aa19d0512'
+ instance_placement_target_model['id'] = '0787-84e4793a-7cd8-4a7b-b253-818aa19d0512'
+ instance_placement_target_model['name'] = 'test-new'
+ instance_placement_target_model['resource_type'] = 'dedicated_host'
- 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'
+ 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'
+ instance_profile_reference_model['resource_type'] = 'instance_profile'
- 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'
+ reservation_reference_deleted_model = {} # ReservationReferenceDeleted
+ reservation_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- bare_metal_server_profile_bandwidth_model = {} # BareMetalServerProfileBandwidthFixed
- bare_metal_server_profile_bandwidth_model['type'] = 'fixed'
- bare_metal_server_profile_bandwidth_model['value'] = 20000
+ reservation_reference_model = {} # ReservationReference
+ reservation_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::reservation:7187-ba49df72-37b8-43ac-98da-f8e029de0e63'
+ reservation_reference_model['deleted'] = reservation_reference_deleted_model
+ reservation_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/reservations/7187-ba49df72-37b8-43ac-98da-f8e029de0e63'
+ reservation_reference_model['id'] = '7187-ba49df72-37b8-43ac-98da-f8e029de0e63'
+ reservation_reference_model['name'] = 'my-reservation'
+ reservation_reference_model['resource_type'] = 'reservation'
- bare_metal_server_profile_console_types_model = {} # BareMetalServerProfileConsoleTypes
- bare_metal_server_profile_console_types_model['type'] = 'enum'
- bare_metal_server_profile_console_types_model['values'] = ['serial']
+ instance_reservation_affinity_model = {} # InstanceReservationAffinity
+ instance_reservation_affinity_model['policy'] = 'disabled'
+ instance_reservation_affinity_model['pool'] = [reservation_reference_model]
- 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'
+ 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'
- 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
+ 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'
- 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
+ instance_vcpu_model = {} # InstanceVCPU
+ instance_vcpu_model['architecture'] = 'amd64'
+ instance_vcpu_model['count'] = 2
+ instance_vcpu_model['manufacturer'] = 'intel'
- 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
+ vpc_reference_deleted_model = {} # VPCReferenceDeleted
+ vpc_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- 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
+ 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'
+ vpc_reference_model['resource_type'] = 'vpc'
- bare_metal_server_profile_disk_supported_interfaces_model = {} # BareMetalServerProfileDiskSupportedInterfaces
- bare_metal_server_profile_disk_supported_interfaces_model['default'] = 'fcp'
- bare_metal_server_profile_disk_supported_interfaces_model['type'] = 'enum'
- bare_metal_server_profile_disk_supported_interfaces_model['values'] = ['fcp']
+ 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_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
+ # Construct a json representation of a Instance model
+ instance_model_json = {}
+ instance_model_json['availability_policy'] = instance_availability_policy_model
+ instance_model_json['bandwidth'] = 1000
+ instance_model_json['boot_volume_attachment'] = volume_attachment_reference_instance_context_model
+ instance_model_json['catalog_offering'] = instance_catalog_offering_model
+ instance_model_json['created_at'] = '2019-01-01T12:00:00Z'
+ instance_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a'
+ instance_model_json['dedicated_host'] = dedicated_host_reference_model
+ instance_model_json['disks'] = [instance_disk_model]
+ instance_model_json['gpu'] = instance_gpu_model
+ instance_model_json['health_reasons'] = [instance_health_reason_model]
+ instance_model_json['health_state'] = 'ok'
+ instance_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a'
+ instance_model_json['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
+ instance_model_json['image'] = image_reference_model
+ instance_model_json['lifecycle_reasons'] = [instance_lifecycle_reason_model]
+ instance_model_json['lifecycle_state'] = 'stable'
+ instance_model_json['memory'] = 8
+ instance_model_json['metadata_service'] = instance_metadata_service_model
+ instance_model_json['name'] = 'my-instance'
+ instance_model_json['network_attachments'] = [instance_network_attachment_reference_model]
+ instance_model_json['network_interfaces'] = [network_interface_instance_context_reference_model]
+ instance_model_json['numa_count'] = 2
+ instance_model_json['placement_target'] = instance_placement_target_model
+ instance_model_json['primary_network_attachment'] = instance_network_attachment_reference_model
+ instance_model_json['primary_network_interface'] = network_interface_instance_context_reference_model
+ instance_model_json['profile'] = instance_profile_reference_model
+ instance_model_json['reservation'] = reservation_reference_model
+ instance_model_json['reservation_affinity'] = instance_reservation_affinity_model
+ instance_model_json['resource_group'] = resource_group_reference_model
+ instance_model_json['resource_type'] = 'instance'
+ 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
- bare_metal_server_profile_memory_model = {} # BareMetalServerProfileMemoryFixed
- bare_metal_server_profile_memory_model['type'] = 'fixed'
- bare_metal_server_profile_memory_model['value'] = 16
+ # 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
- bare_metal_server_profile_network_interface_count_model = {} # BareMetalServerProfileNetworkInterfaceCountRange
- bare_metal_server_profile_network_interface_count_model['max'] = 128
- bare_metal_server_profile_network_interface_count_model['min'] = 1
- bare_metal_server_profile_network_interface_count_model['type'] = 'range'
+ # 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)
- 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']
+ # Verify the model instances are equivalent
+ assert instance_model == instance_model2
- 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'] = ['disabled']
+ # 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
- bare_metal_server_profile_model = {} # BareMetalServerProfile
- bare_metal_server_profile_model['bandwidth'] = bare_metal_server_profile_bandwidth_model
- bare_metal_server_profile_model['console_types'] = bare_metal_server_profile_console_types_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['network_interface_count'] = bare_metal_server_profile_network_interface_count_model
- 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
+class TestModel_InstanceAction:
+ """
+ Test Class for InstanceAction
+ """
- # 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
+ def test_instance_action_serialization(self):
+ """
+ Test serialization/deserialization for InstanceAction
+ """
- # 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)
+ # 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 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 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 bare_metal_server_profile_collection_model == bare_metal_server_profile_collection_model2
+ assert instance_action_model == instance_action_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
+ instance_action_model_json2 = instance_action_model.to_dict()
+ assert instance_action_model_json2 == instance_action_model_json
-class TestModel_BareMetalServerProfileCollectionFirst:
+class TestModel_InstanceAvailabilityPolicy:
"""
- Test Class for BareMetalServerProfileCollectionFirst
+ Test Class for InstanceAvailabilityPolicy
"""
- def test_bare_metal_server_profile_collection_first_serialization(self):
+ def test_instance_availability_policy_serialization(self):
"""
- Test serialization/deserialization for BareMetalServerProfileCollectionFirst
+ Test serialization/deserialization for InstanceAvailabilityPolicy
"""
- # 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 json representation of a InstanceAvailabilityPolicy model
+ instance_availability_policy_model_json = {}
+ instance_availability_policy_model_json['host_failure'] = 'restart'
- # 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 InstanceAvailabilityPolicy by calling from_dict on the json representation
+ instance_availability_policy_model = InstanceAvailabilityPolicy.from_dict(instance_availability_policy_model_json)
+ assert instance_availability_policy_model != False
- # Construct a model instance of 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)
+ # Construct a model instance of InstanceAvailabilityPolicy by calling from_dict on the json representation
+ instance_availability_policy_model_dict = InstanceAvailabilityPolicy.from_dict(instance_availability_policy_model_json).__dict__
+ instance_availability_policy_model2 = InstanceAvailabilityPolicy(**instance_availability_policy_model_dict)
# Verify the model instances are equivalent
- assert bare_metal_server_profile_collection_first_model == bare_metal_server_profile_collection_first_model2
+ assert instance_availability_policy_model == instance_availability_policy_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
+ instance_availability_policy_model_json2 = instance_availability_policy_model.to_dict()
+ assert instance_availability_policy_model_json2 == instance_availability_policy_model_json
-class TestModel_BareMetalServerProfileCollectionNext:
+class TestModel_InstanceAvailabilityPolicyPatch:
"""
- Test Class for BareMetalServerProfileCollectionNext
+ Test Class for InstanceAvailabilityPolicyPatch
"""
- def test_bare_metal_server_profile_collection_next_serialization(self):
+ def test_instance_availability_policy_patch_serialization(self):
"""
- Test serialization/deserialization for BareMetalServerProfileCollectionNext
+ Test serialization/deserialization for InstanceAvailabilityPolicyPatch
"""
- # 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 json representation of a InstanceAvailabilityPolicyPatch model
+ instance_availability_policy_patch_model_json = {}
+ instance_availability_policy_patch_model_json['host_failure'] = 'restart'
- # Construct a model instance of 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 InstanceAvailabilityPolicyPatch by calling from_dict on the json representation
+ instance_availability_policy_patch_model = InstanceAvailabilityPolicyPatch.from_dict(instance_availability_policy_patch_model_json)
+ assert instance_availability_policy_patch_model != False
- # Construct a model instance of 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)
+ # Construct a model instance of InstanceAvailabilityPolicyPatch by calling from_dict on the json representation
+ instance_availability_policy_patch_model_dict = InstanceAvailabilityPolicyPatch.from_dict(instance_availability_policy_patch_model_json).__dict__
+ instance_availability_policy_patch_model2 = InstanceAvailabilityPolicyPatch(**instance_availability_policy_patch_model_dict)
# Verify the model instances are equivalent
- assert bare_metal_server_profile_collection_next_model == bare_metal_server_profile_collection_next_model2
+ assert instance_availability_policy_patch_model == instance_availability_policy_patch_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
+ instance_availability_policy_patch_model_json2 = instance_availability_policy_patch_model.to_dict()
+ assert instance_availability_policy_patch_model_json2 == instance_availability_policy_patch_model_json
-class TestModel_BareMetalServerProfileConsoleTypes:
+class TestModel_InstanceAvailabilityPolicyPrototype:
"""
- Test Class for BareMetalServerProfileConsoleTypes
+ Test Class for InstanceAvailabilityPolicyPrototype
"""
- def test_bare_metal_server_profile_console_types_serialization(self):
+ def test_instance_availability_policy_prototype_serialization(self):
"""
- Test serialization/deserialization for BareMetalServerProfileConsoleTypes
+ Test serialization/deserialization for InstanceAvailabilityPolicyPrototype
"""
- # Construct a json representation of a BareMetalServerProfileConsoleTypes model
- bare_metal_server_profile_console_types_model_json = {}
- bare_metal_server_profile_console_types_model_json['type'] = 'enum'
- bare_metal_server_profile_console_types_model_json['values'] = ['serial']
+ # Construct a json representation of a InstanceAvailabilityPolicyPrototype model
+ instance_availability_policy_prototype_model_json = {}
+ instance_availability_policy_prototype_model_json['host_failure'] = 'restart'
- # Construct a model instance of BareMetalServerProfileConsoleTypes by calling from_dict on the json representation
- bare_metal_server_profile_console_types_model = BareMetalServerProfileConsoleTypes.from_dict(bare_metal_server_profile_console_types_model_json)
- assert bare_metal_server_profile_console_types_model != False
+ # Construct a model instance of InstanceAvailabilityPolicyPrototype by calling from_dict on the json representation
+ instance_availability_policy_prototype_model = InstanceAvailabilityPolicyPrototype.from_dict(instance_availability_policy_prototype_model_json)
+ assert instance_availability_policy_prototype_model != False
- # Construct a model instance of BareMetalServerProfileConsoleTypes by calling from_dict on the json representation
- bare_metal_server_profile_console_types_model_dict = BareMetalServerProfileConsoleTypes.from_dict(bare_metal_server_profile_console_types_model_json).__dict__
- bare_metal_server_profile_console_types_model2 = BareMetalServerProfileConsoleTypes(**bare_metal_server_profile_console_types_model_dict)
+ # Construct a model instance of InstanceAvailabilityPolicyPrototype by calling from_dict on the json representation
+ instance_availability_policy_prototype_model_dict = InstanceAvailabilityPolicyPrototype.from_dict(instance_availability_policy_prototype_model_json).__dict__
+ instance_availability_policy_prototype_model2 = InstanceAvailabilityPolicyPrototype(**instance_availability_policy_prototype_model_dict)
# Verify the model instances are equivalent
- assert bare_metal_server_profile_console_types_model == bare_metal_server_profile_console_types_model2
+ assert instance_availability_policy_prototype_model == instance_availability_policy_prototype_model2
# Convert model instance back to dict and verify no loss of data
- bare_metal_server_profile_console_types_model_json2 = bare_metal_server_profile_console_types_model.to_dict()
- assert bare_metal_server_profile_console_types_model_json2 == bare_metal_server_profile_console_types_model_json
+ instance_availability_policy_prototype_model_json2 = instance_availability_policy_prototype_model.to_dict()
+ assert instance_availability_policy_prototype_model_json2 == instance_availability_policy_prototype_model_json
-class TestModel_BareMetalServerProfileDisk:
+class TestModel_InstanceCatalogOffering:
"""
- Test Class for BareMetalServerProfileDisk
+ Test Class for InstanceCatalogOffering
"""
- def test_bare_metal_server_profile_disk_serialization(self):
+ def test_instance_catalog_offering_serialization(self):
"""
- Test serialization/deserialization for BareMetalServerProfileDisk
+ Test serialization/deserialization for InstanceCatalogOffering
"""
# 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'] = 'fcp'
- bare_metal_server_profile_disk_supported_interfaces_model['type'] = 'enum'
- bare_metal_server_profile_disk_supported_interfaces_model['values'] = ['fcp']
+ catalog_offering_version_reference_model = {} # CatalogOfferingVersionReference
+ catalog_offering_version_reference_model['crn'] = 'crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d'
- # Construct a json representation of a 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 json representation of a InstanceCatalogOffering model
+ instance_catalog_offering_model_json = {}
+ instance_catalog_offering_model_json['version'] = catalog_offering_version_reference_model
- # Construct a model instance of 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 InstanceCatalogOffering by calling from_dict on the json representation
+ instance_catalog_offering_model = InstanceCatalogOffering.from_dict(instance_catalog_offering_model_json)
+ assert instance_catalog_offering_model != False
- # Construct a model instance of 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)
+ # Construct a model instance of InstanceCatalogOffering by calling from_dict on the json representation
+ instance_catalog_offering_model_dict = InstanceCatalogOffering.from_dict(instance_catalog_offering_model_json).__dict__
+ instance_catalog_offering_model2 = InstanceCatalogOffering(**instance_catalog_offering_model_dict)
# Verify the model instances are equivalent
- assert bare_metal_server_profile_disk_model == bare_metal_server_profile_disk_model2
+ assert instance_catalog_offering_model == instance_catalog_offering_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
+ instance_catalog_offering_model_json2 = instance_catalog_offering_model.to_dict()
+ assert instance_catalog_offering_model_json2 == instance_catalog_offering_model_json
-class TestModel_BareMetalServerProfileDiskSupportedInterfaces:
+class TestModel_InstanceCollection:
"""
- Test Class for BareMetalServerProfileDiskSupportedInterfaces
+ Test Class for InstanceCollection
"""
- def test_bare_metal_server_profile_disk_supported_interfaces_serialization(self):
+ def test_instance_collection_serialization(self):
"""
- Test serialization/deserialization for BareMetalServerProfileDiskSupportedInterfaces
+ Test serialization/deserialization for InstanceCollection
"""
- # 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'] = 'fcp'
- bare_metal_server_profile_disk_supported_interfaces_model_json['type'] = 'enum'
- bare_metal_server_profile_disk_supported_interfaces_model_json['values'] = ['fcp']
+ # Construct dict forms of any model objects needed in order to build this model.
- # 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
+ 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 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)
+ instance_availability_policy_model = {} # InstanceAvailabilityPolicy
+ instance_availability_policy_model['host_failure'] = 'restart'
- # Verify the model instances are equivalent
- assert bare_metal_server_profile_disk_supported_interfaces_model == bare_metal_server_profile_disk_supported_interfaces_model2
+ 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'
- # 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
+ volume_attachment_device_model = {} # VolumeAttachmentDevice
+ volume_attachment_device_model['id'] = '80b3e36e-41f4-40e9-bd56-beae81792a68'
+ volume_reference_volume_attachment_context_deleted_model = {} # VolumeReferenceVolumeAttachmentContextDeleted
+ volume_reference_volume_attachment_context_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
-class TestModel_BareMetalServerProfileOSArchitecture:
- """
- Test Class for BareMetalServerProfileOSArchitecture
- """
+ volume_reference_volume_attachment_context_model = {} # VolumeReferenceVolumeAttachmentContext
+ volume_reference_volume_attachment_context_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
+ volume_reference_volume_attachment_context_model['deleted'] = volume_reference_volume_attachment_context_deleted_model
+ volume_reference_volume_attachment_context_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
+ volume_reference_volume_attachment_context_model['id'] = '1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
+ volume_reference_volume_attachment_context_model['name'] = 'my-volume'
+ volume_reference_volume_attachment_context_model['resource_type'] = 'volume'
- def test_bare_metal_server_profile_os_architecture_serialization(self):
- """
- Test serialization/deserialization for BareMetalServerProfileOSArchitecture
- """
+ 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_volume_attachment_context_model
- # 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']
+ catalog_offering_version_reference_model = {} # CatalogOfferingVersionReference
+ catalog_offering_version_reference_model['crn'] = 'crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d'
- # Construct a 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
+ instance_catalog_offering_model = {} # InstanceCatalogOffering
+ instance_catalog_offering_model['version'] = catalog_offering_version_reference_model
- # 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)
+ dedicated_host_reference_deleted_model = {} # DedicatedHostReferenceDeleted
+ dedicated_host_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Verify the model instances are equivalent
- assert bare_metal_server_profile_os_architecture_model == bare_metal_server_profile_os_architecture_model2
+ 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'
- # 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
+ 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'
-class TestModel_BareMetalServerProfileReference:
- """
- Test Class for BareMetalServerProfileReference
- """
+ instance_health_reason_model = {} # InstanceHealthReason
+ instance_health_reason_model['code'] = 'reservation_expired'
+ instance_health_reason_model['message'] = 'The reservation cannot be used because it has expired.'
+ instance_health_reason_model['more_info'] = 'https://cloud.ibm.com/docs/vpc?topic=vpc-virtual-server-health-status-reasons'
- def test_bare_metal_server_profile_reference_serialization(self):
- """
- Test serialization/deserialization for BareMetalServerProfileReference
- """
+ 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 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'
+ account_reference_model = {} # AccountReference
+ account_reference_model['id'] = 'aa2432b1fa4d4ace891e9b80fc104e34'
+ account_reference_model['resource_type'] = 'account'
- # 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
+ 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 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)
+ image_remote_model = {} # ImageRemote
+ image_remote_model['account'] = account_reference_model
+ image_remote_model['region'] = region_reference_model
- # Verify the model instances are equivalent
- assert bare_metal_server_profile_reference_model == bare_metal_server_profile_reference_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'
+ image_reference_model['remote'] = image_remote_model
+ image_reference_model['resource_type'] = 'image'
- # 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
+ instance_lifecycle_reason_model = {} # InstanceLifecycleReason
+ instance_lifecycle_reason_model['code'] = 'resource_suspended_by_provider'
+ instance_lifecycle_reason_model['message'] = 'The resource has been suspended. Contact IBM support with the CRN for next steps.'
+ instance_lifecycle_reason_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#resource-suspension'
+ instance_metadata_service_model = {} # InstanceMetadataService
+ instance_metadata_service_model['enabled'] = True
+ instance_metadata_service_model['protocol'] = 'http'
+ instance_metadata_service_model['response_hop_limit'] = 1
-class TestModel_BareMetalServerProfileSupportedTrustedPlatformModuleModes:
- """
- Test Class for BareMetalServerProfileSupportedTrustedPlatformModuleModes
- """
+ instance_network_attachment_reference_deleted_model = {} # InstanceNetworkAttachmentReferenceDeleted
+ instance_network_attachment_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- def test_bare_metal_server_profile_supported_trusted_platform_module_modes_serialization(self):
- """
- Test serialization/deserialization for BareMetalServerProfileSupportedTrustedPlatformModuleModes
- """
+ 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 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'] = ['disabled']
+ 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 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
+ subnet_reference_deleted_model = {} # SubnetReferenceDeleted
+ subnet_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # 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)
+ subnet_reference_model = {} # SubnetReference
+ subnet_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
+ subnet_reference_model['deleted'] = subnet_reference_deleted_model
+ subnet_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
+ subnet_reference_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
+ subnet_reference_model['name'] = 'my-subnet'
+ subnet_reference_model['resource_type'] = 'subnet'
- # 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
+ instance_network_attachment_reference_model = {} # InstanceNetworkAttachmentReference
+ instance_network_attachment_reference_model['deleted'] = instance_network_attachment_reference_deleted_model
+ instance_network_attachment_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/5dd61d72-acaa-47c2-a336-3d849660d010/network_attachments/0767-d54eb633-98ea-459d-aa00-6a8e780175a7'
+ instance_network_attachment_reference_model['id'] = '0767-d54eb633-98ea-459d-aa00-6a8e780175a7'
+ instance_network_attachment_reference_model['name'] = 'my-instance-network-attachment'
+ instance_network_attachment_reference_model['primary_ip'] = reserved_ip_reference_model
+ instance_network_attachment_reference_model['resource_type'] = 'instance_network_attachment'
+ instance_network_attachment_reference_model['subnet'] = subnet_reference_model
- # 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
+ 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'
+
+ 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-instance-network-interface'
+ network_interface_instance_context_reference_model['primary_ip'] = reserved_ip_reference_model
+ network_interface_instance_context_reference_model['resource_type'] = 'network_interface'
+ network_interface_instance_context_reference_model['subnet'] = subnet_reference_model
+ dedicated_host_group_reference_deleted_model = {} # DedicatedHostGroupReferenceDeleted
+ dedicated_host_group_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
-class TestModel_BareMetalServerStatusReason:
- """
- Test Class for BareMetalServerStatusReason
- """
+ 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'
- def test_bare_metal_server_status_reason_serialization(self):
- """
- Test serialization/deserialization for BareMetalServerStatusReason
- """
+ instance_profile_reference_model = {} # InstanceProfileReference
+ instance_profile_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16'
+ instance_profile_reference_model['name'] = 'bx2-4x16'
+ instance_profile_reference_model['resource_type'] = 'instance_profile'
- # 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'
+ reservation_reference_deleted_model = {} # ReservationReferenceDeleted
+ reservation_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # 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
+ reservation_reference_model = {} # ReservationReference
+ reservation_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::reservation:7187-ba49df72-37b8-43ac-98da-f8e029de0e63'
+ reservation_reference_model['deleted'] = reservation_reference_deleted_model
+ reservation_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/reservations/7187-ba49df72-37b8-43ac-98da-f8e029de0e63'
+ reservation_reference_model['id'] = '7187-ba49df72-37b8-43ac-98da-f8e029de0e63'
+ reservation_reference_model['name'] = 'my-reservation'
+ reservation_reference_model['resource_type'] = 'reservation'
- # 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)
+ instance_reservation_affinity_model = {} # InstanceReservationAffinity
+ instance_reservation_affinity_model['policy'] = 'disabled'
+ instance_reservation_affinity_model['pool'] = [reservation_reference_model]
- # Verify the model instances are equivalent
- assert bare_metal_server_status_reason_model == bare_metal_server_status_reason_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
- 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
+ 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_vcpu_model = {} # InstanceVCPU
+ instance_vcpu_model['architecture'] = 'amd64'
+ instance_vcpu_model['count'] = 4
+ instance_vcpu_model['manufacturer'] = 'intel'
-class TestModel_BareMetalServerTrustedPlatformModule:
- """
- Test Class for BareMetalServerTrustedPlatformModule
- """
+ vpc_reference_deleted_model = {} # VPCReferenceDeleted
+ vpc_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- def test_bare_metal_server_trusted_platform_module_serialization(self):
- """
- Test serialization/deserialization for BareMetalServerTrustedPlatformModule
- """
+ vpc_reference_model = {} # VPCReference
+ vpc_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b'
+ vpc_reference_model['deleted'] = vpc_reference_deleted_model
+ vpc_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b'
+ vpc_reference_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b'
+ vpc_reference_model['name'] = 'my-vpc'
+ vpc_reference_model['resource_type'] = 'vpc'
- # Construct a json representation of a 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'] = 'disabled'
- bare_metal_server_trusted_platform_module_model_json['supported_modes'] = ['disabled']
+ 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 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
+ instance_model = {} # Instance
+ instance_model['availability_policy'] = instance_availability_policy_model
+ instance_model['bandwidth'] = 1000
+ instance_model['boot_volume_attachment'] = volume_attachment_reference_instance_context_model
+ instance_model['catalog_offering'] = instance_catalog_offering_model
+ instance_model['created_at'] = '2019-01-01T12:00:00Z'
+ instance_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a'
+ instance_model['dedicated_host'] = dedicated_host_reference_model
+ instance_model['disks'] = [instance_disk_model]
+ instance_model['gpu'] = instance_gpu_model
+ instance_model['health_reasons'] = [instance_health_reason_model]
+ instance_model['health_state'] = 'ok'
+ instance_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a'
+ instance_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
+ instance_model['image'] = image_reference_model
+ instance_model['lifecycle_reasons'] = [instance_lifecycle_reason_model]
+ instance_model['lifecycle_state'] = 'stable'
+ instance_model['memory'] = 8
+ instance_model['metadata_service'] = instance_metadata_service_model
+ instance_model['name'] = 'my-instance'
+ instance_model['network_attachments'] = [instance_network_attachment_reference_model]
+ instance_model['network_interfaces'] = [network_interface_instance_context_reference_model]
+ instance_model['numa_count'] = 2
+ instance_model['placement_target'] = instance_placement_target_model
+ instance_model['primary_network_attachment'] = instance_network_attachment_reference_model
+ instance_model['primary_network_interface'] = network_interface_instance_context_reference_model
+ instance_model['profile'] = instance_profile_reference_model
+ instance_model['reservation'] = reservation_reference_model
+ instance_model['reservation_affinity'] = instance_reservation_affinity_model
+ instance_model['resource_group'] = resource_group_reference_model
+ instance_model['resource_type'] = 'instance'
+ 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
- # 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)
+ 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 bare_metal_server_trusted_platform_module_model == bare_metal_server_trusted_platform_module_model2
+ assert instance_collection_model == instance_collection_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
+ instance_collection_model_json2 = instance_collection_model.to_dict()
+ assert instance_collection_model_json2 == instance_collection_model_json
-class TestModel_BareMetalServerTrustedPlatformModulePatch:
+class TestModel_InstanceCollectionFirst:
"""
- Test Class for BareMetalServerTrustedPlatformModulePatch
+ Test Class for InstanceCollectionFirst
"""
- def test_bare_metal_server_trusted_platform_module_patch_serialization(self):
+ def test_instance_collection_first_serialization(self):
"""
- Test serialization/deserialization for BareMetalServerTrustedPlatformModulePatch
+ Test serialization/deserialization for InstanceCollectionFirst
"""
- # Construct a json representation of a BareMetalServerTrustedPlatformModulePatch model
- bare_metal_server_trusted_platform_module_patch_model_json = {}
- bare_metal_server_trusted_platform_module_patch_model_json['mode'] = 'disabled'
+ # 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 BareMetalServerTrustedPlatformModulePatch by calling from_dict on the json representation
- bare_metal_server_trusted_platform_module_patch_model = BareMetalServerTrustedPlatformModulePatch.from_dict(bare_metal_server_trusted_platform_module_patch_model_json)
- assert bare_metal_server_trusted_platform_module_patch_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 BareMetalServerTrustedPlatformModulePatch by calling from_dict on the json representation
- bare_metal_server_trusted_platform_module_patch_model_dict = BareMetalServerTrustedPlatformModulePatch.from_dict(bare_metal_server_trusted_platform_module_patch_model_json).__dict__
- bare_metal_server_trusted_platform_module_patch_model2 = BareMetalServerTrustedPlatformModulePatch(**bare_metal_server_trusted_platform_module_patch_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 bare_metal_server_trusted_platform_module_patch_model == bare_metal_server_trusted_platform_module_patch_model2
+ assert instance_collection_first_model == instance_collection_first_model2
# Convert model instance back to dict and verify no loss of data
- bare_metal_server_trusted_platform_module_patch_model_json2 = bare_metal_server_trusted_platform_module_patch_model.to_dict()
- assert bare_metal_server_trusted_platform_module_patch_model_json2 == bare_metal_server_trusted_platform_module_patch_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_BareMetalServerTrustedPlatformModulePrototype:
+class TestModel_InstanceCollectionNext:
"""
- Test Class for BareMetalServerTrustedPlatformModulePrototype
+ Test Class for InstanceCollectionNext
"""
- def test_bare_metal_server_trusted_platform_module_prototype_serialization(self):
+ def test_instance_collection_next_serialization(self):
"""
- Test serialization/deserialization for BareMetalServerTrustedPlatformModulePrototype
+ Test serialization/deserialization for InstanceCollectionNext
"""
- # Construct a json representation of a BareMetalServerTrustedPlatformModulePrototype model
- bare_metal_server_trusted_platform_module_prototype_model_json = {}
- bare_metal_server_trusted_platform_module_prototype_model_json['mode'] = 'disabled'
+ # 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 BareMetalServerTrustedPlatformModulePrototype by calling from_dict on the json representation
- bare_metal_server_trusted_platform_module_prototype_model = BareMetalServerTrustedPlatformModulePrototype.from_dict(bare_metal_server_trusted_platform_module_prototype_model_json)
- assert bare_metal_server_trusted_platform_module_prototype_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 BareMetalServerTrustedPlatformModulePrototype by calling from_dict on the json representation
- bare_metal_server_trusted_platform_module_prototype_model_dict = BareMetalServerTrustedPlatformModulePrototype.from_dict(bare_metal_server_trusted_platform_module_prototype_model_json).__dict__
- bare_metal_server_trusted_platform_module_prototype_model2 = BareMetalServerTrustedPlatformModulePrototype(**bare_metal_server_trusted_platform_module_prototype_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 bare_metal_server_trusted_platform_module_prototype_model == bare_metal_server_trusted_platform_module_prototype_model2
+ assert instance_collection_next_model == instance_collection_next_model2
# Convert model instance back to dict and verify no loss of data
- bare_metal_server_trusted_platform_module_prototype_model_json2 = bare_metal_server_trusted_platform_module_prototype_model.to_dict()
- assert bare_metal_server_trusted_platform_module_prototype_model_json2 == bare_metal_server_trusted_platform_module_prototype_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_CatalogOfferingVersionReference:
+class TestModel_InstanceConsoleAccessToken:
"""
- Test Class for CatalogOfferingVersionReference
+ Test Class for InstanceConsoleAccessToken
"""
- def test_catalog_offering_version_reference_serialization(self):
+ def test_instance_console_access_token_serialization(self):
"""
- Test serialization/deserialization for CatalogOfferingVersionReference
+ Test serialization/deserialization for InstanceConsoleAccessToken
"""
- # Construct a json representation of a CatalogOfferingVersionReference model
- catalog_offering_version_reference_model_json = {}
- catalog_offering_version_reference_model_json['crn'] = 'crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d'
+ # Construct a 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 a model instance of CatalogOfferingVersionReference by calling from_dict on the json representation
- catalog_offering_version_reference_model = CatalogOfferingVersionReference.from_dict(catalog_offering_version_reference_model_json)
- assert catalog_offering_version_reference_model != False
+ # Construct a model instance of 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
- # Construct a model instance of CatalogOfferingVersionReference by calling from_dict on the json representation
- catalog_offering_version_reference_model_dict = CatalogOfferingVersionReference.from_dict(catalog_offering_version_reference_model_json).__dict__
- catalog_offering_version_reference_model2 = CatalogOfferingVersionReference(**catalog_offering_version_reference_model_dict)
+ # 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)
# Verify the model instances are equivalent
- assert catalog_offering_version_reference_model == catalog_offering_version_reference_model2
+ assert instance_console_access_token_model == instance_console_access_token_model2
# Convert model instance back to dict and verify no loss of data
- catalog_offering_version_reference_model_json2 = catalog_offering_version_reference_model.to_dict()
- assert catalog_offering_version_reference_model_json2 == catalog_offering_version_reference_model_json
+ instance_console_access_token_model_json2 = instance_console_access_token_model.to_dict()
+ assert instance_console_access_token_model_json2 == instance_console_access_token_model_json
-class TestModel_CertificateInstanceReference:
+class TestModel_InstanceDefaultTrustedProfilePrototype:
"""
- Test Class for CertificateInstanceReference
+ Test Class for InstanceDefaultTrustedProfilePrototype
"""
- def test_certificate_instance_reference_serialization(self):
+ def test_instance_default_trusted_profile_prototype_serialization(self):
"""
- Test serialization/deserialization for CertificateInstanceReference
+ Test serialization/deserialization for InstanceDefaultTrustedProfilePrototype
"""
- # Construct a json representation of a CertificateInstanceReference model
- certificate_instance_reference_model_json = {}
- certificate_instance_reference_model_json['crn'] = 'crn:v1:bluemix:public:secrets-manager:us-south:a/123456:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5'
+ # Construct dict forms of any model objects needed in order to build this model.
+
+ trusted_profile_identity_model = {} # TrustedProfileIdentityTrustedProfileById
+ trusted_profile_identity_model['id'] = 'Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5'
- # Construct a 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 json representation of a InstanceDefaultTrustedProfilePrototype model
+ instance_default_trusted_profile_prototype_model_json = {}
+ instance_default_trusted_profile_prototype_model_json['auto_link'] = False
+ instance_default_trusted_profile_prototype_model_json['target'] = trusted_profile_identity_model
- # Construct a model instance of 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 InstanceDefaultTrustedProfilePrototype by calling from_dict on the json representation
+ instance_default_trusted_profile_prototype_model = InstanceDefaultTrustedProfilePrototype.from_dict(instance_default_trusted_profile_prototype_model_json)
+ assert instance_default_trusted_profile_prototype_model != False
+
+ # Construct a model instance of InstanceDefaultTrustedProfilePrototype by calling from_dict on the json representation
+ instance_default_trusted_profile_prototype_model_dict = InstanceDefaultTrustedProfilePrototype.from_dict(instance_default_trusted_profile_prototype_model_json).__dict__
+ instance_default_trusted_profile_prototype_model2 = InstanceDefaultTrustedProfilePrototype(**instance_default_trusted_profile_prototype_model_dict)
# Verify the model instances are equivalent
- assert certificate_instance_reference_model == certificate_instance_reference_model2
+ assert instance_default_trusted_profile_prototype_model == instance_default_trusted_profile_prototype_model2
# Convert model instance back to dict and verify no loss of data
- certificate_instance_reference_model_json2 = certificate_instance_reference_model.to_dict()
- assert certificate_instance_reference_model_json2 == certificate_instance_reference_model_json
+ instance_default_trusted_profile_prototype_model_json2 = instance_default_trusted_profile_prototype_model.to_dict()
+ assert instance_default_trusted_profile_prototype_model_json2 == instance_default_trusted_profile_prototype_model_json
-class TestModel_CloudObjectStorageBucketReference:
+class TestModel_InstanceDisk:
"""
- Test Class for CloudObjectStorageBucketReference
+ Test Class for InstanceDisk
"""
- def test_cloud_object_storage_bucket_reference_serialization(self):
+ def test_instance_disk_serialization(self):
"""
- Test serialization/deserialization for CloudObjectStorageBucketReference
+ Test serialization/deserialization for InstanceDisk
"""
- # Construct a json representation of a CloudObjectStorageBucketReference model
- cloud_object_storage_bucket_reference_model_json = {}
- cloud_object_storage_bucket_reference_model_json['crn'] = 'crn:v1:bluemix:public:cloud-object-storage:global:a/123456:1a0ec336-f391-4091-a6fb-5e084a4c56f4:bucket:my-bucket'
- cloud_object_storage_bucket_reference_model_json['name'] = 'bucket-27200-lwx4cfvcue'
+ # 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 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 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 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 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 cloud_object_storage_bucket_reference_model == cloud_object_storage_bucket_reference_model2
+ assert instance_disk_model == instance_disk_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
+ instance_disk_model_json2 = instance_disk_model.to_dict()
+ assert instance_disk_model_json2 == instance_disk_model_json
-class TestModel_CloudObjectStorageObjectReference:
+class TestModel_InstanceDiskCollection:
"""
- Test Class for CloudObjectStorageObjectReference
+ Test Class for InstanceDiskCollection
"""
- def test_cloud_object_storage_object_reference_serialization(self):
+ def test_instance_disk_collection_serialization(self):
"""
- Test serialization/deserialization for CloudObjectStorageObjectReference
+ Test serialization/deserialization for InstanceDiskCollection
"""
- # Construct a json representation of a CloudObjectStorageObjectReference model
- cloud_object_storage_object_reference_model_json = {}
- cloud_object_storage_object_reference_model_json['name'] = 'my-object'
+ # Construct dict forms of any model objects needed in order to build this model.
- # Construct a model instance of CloudObjectStorageObjectReference by calling from_dict on the json representation
- cloud_object_storage_object_reference_model = CloudObjectStorageObjectReference.from_dict(cloud_object_storage_object_reference_model_json)
- assert cloud_object_storage_object_reference_model != False
+ 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 model instance of CloudObjectStorageObjectReference by calling from_dict on the json representation
- cloud_object_storage_object_reference_model_dict = CloudObjectStorageObjectReference.from_dict(cloud_object_storage_object_reference_model_json).__dict__
- cloud_object_storage_object_reference_model2 = CloudObjectStorageObjectReference(**cloud_object_storage_object_reference_model_dict)
+ # 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 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 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 cloud_object_storage_object_reference_model == cloud_object_storage_object_reference_model2
+ assert instance_disk_collection_model == instance_disk_collection_model2
# Convert model instance back to dict and verify no loss of data
- cloud_object_storage_object_reference_model_json2 = cloud_object_storage_object_reference_model.to_dict()
- assert cloud_object_storage_object_reference_model_json2 == cloud_object_storage_object_reference_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_DNSInstanceReference:
+class TestModel_InstanceDiskPatch:
"""
- Test Class for DNSInstanceReference
+ Test Class for InstanceDiskPatch
"""
- def test_dns_instance_reference_serialization(self):
+ def test_instance_disk_patch_serialization(self):
"""
- Test serialization/deserialization for DNSInstanceReference
+ Test serialization/deserialization for InstanceDiskPatch
"""
- # Construct a json representation of a DNSInstanceReference model
- dns_instance_reference_model_json = {}
- dns_instance_reference_model_json['crn'] = 'crn:v1:bluemix:public:dns-svcs:global:a/123456:6860c359-b2e2-46fa-a944-b38c28201c6e'
+ # 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 DNSInstanceReference by calling from_dict on the json representation
- dns_instance_reference_model = DNSInstanceReference.from_dict(dns_instance_reference_model_json)
- assert dns_instance_reference_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 DNSInstanceReference by calling from_dict on the json representation
- dns_instance_reference_model_dict = DNSInstanceReference.from_dict(dns_instance_reference_model_json).__dict__
- dns_instance_reference_model2 = DNSInstanceReference(**dns_instance_reference_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 dns_instance_reference_model == dns_instance_reference_model2
+ assert instance_disk_patch_model == instance_disk_patch_model2
# Convert model instance back to dict and verify no loss of data
- dns_instance_reference_model_json2 = dns_instance_reference_model.to_dict()
- assert dns_instance_reference_model_json2 == dns_instance_reference_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_DNSServer:
+class TestModel_InstanceDiskReference:
"""
- Test Class for DNSServer
+ Test Class for InstanceDiskReference
"""
- def test_dns_server_serialization(self):
+ def test_instance_disk_reference_serialization(self):
"""
- Test serialization/deserialization for DNSServer
+ Test serialization/deserialization for InstanceDiskReference
"""
# 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'
+ 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 DNSServer model
- dns_server_model_json = {}
- dns_server_model_json['address'] = '192.168.3.4'
- dns_server_model_json['zone_affinity'] = zone_reference_model
+ # 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 DNSServer by calling from_dict on the json representation
- dns_server_model = DNSServer.from_dict(dns_server_model_json)
- assert dns_server_model != False
+ # 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 DNSServer by calling from_dict on the json representation
- dns_server_model_dict = DNSServer.from_dict(dns_server_model_json).__dict__
- dns_server_model2 = DNSServer(**dns_server_model_dict)
+ # 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 dns_server_model == dns_server_model2
+ assert instance_disk_reference_model == instance_disk_reference_model2
# Convert model instance back to dict and verify no loss of data
- dns_server_model_json2 = dns_server_model.to_dict()
- assert dns_server_model_json2 == dns_server_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_DNSServerPrototype:
+class TestModel_InstanceDiskReferenceDeleted:
"""
- Test Class for DNSServerPrototype
+ Test Class for InstanceDiskReferenceDeleted
"""
- def test_dns_server_prototype_serialization(self):
+ def test_instance_disk_reference_deleted_serialization(self):
"""
- Test serialization/deserialization for DNSServerPrototype
+ Test serialization/deserialization for InstanceDiskReferenceDeleted
"""
- # 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'
-
- # Construct a json representation of a DNSServerPrototype model
- dns_server_prototype_model_json = {}
- dns_server_prototype_model_json['address'] = '192.168.3.4'
- dns_server_prototype_model_json['zone_affinity'] = zone_identity_model
+ # 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 DNSServerPrototype by calling from_dict on the json representation
- dns_server_prototype_model = DNSServerPrototype.from_dict(dns_server_prototype_model_json)
- assert dns_server_prototype_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 DNSServerPrototype by calling from_dict on the json representation
- dns_server_prototype_model_dict = DNSServerPrototype.from_dict(dns_server_prototype_model_json).__dict__
- dns_server_prototype_model2 = DNSServerPrototype(**dns_server_prototype_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 dns_server_prototype_model == dns_server_prototype_model2
+ assert instance_disk_reference_deleted_model == instance_disk_reference_deleted_model2
# Convert model instance back to dict and verify no loss of data
- dns_server_prototype_model_json2 = dns_server_prototype_model.to_dict()
- assert dns_server_prototype_model_json2 == dns_server_prototype_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_DNSZoneReference:
+class TestModel_InstanceGPU:
"""
- Test Class for DNSZoneReference
+ Test Class for InstanceGPU
"""
- def test_dns_zone_reference_serialization(self):
+ def test_instance_gpu_serialization(self):
"""
- Test serialization/deserialization for DNSZoneReference
+ Test serialization/deserialization for InstanceGPU
"""
- # Construct a json representation of a DNSZoneReference model
- dns_zone_reference_model_json = {}
- dns_zone_reference_model_json['id'] = 'd66662cc-aa23-4fe1-9987-858487a61f45'
+ # 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 DNSZoneReference by calling from_dict on the json representation
- dns_zone_reference_model = DNSZoneReference.from_dict(dns_zone_reference_model_json)
- assert dns_zone_reference_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 DNSZoneReference by calling from_dict on the json representation
- dns_zone_reference_model_dict = DNSZoneReference.from_dict(dns_zone_reference_model_json).__dict__
- dns_zone_reference_model2 = DNSZoneReference(**dns_zone_reference_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 dns_zone_reference_model == dns_zone_reference_model2
+ assert instance_gpu_model == instance_gpu_model2
# Convert model instance back to dict and verify no loss of data
- dns_zone_reference_model_json2 = dns_zone_reference_model.to_dict()
- assert dns_zone_reference_model_json2 == dns_zone_reference_model_json
+ instance_gpu_model_json2 = instance_gpu_model.to_dict()
+ assert instance_gpu_model_json2 == instance_gpu_model_json
-class TestModel_DedicatedHost:
+class TestModel_InstanceGroup:
"""
- Test Class for DedicatedHost
+ Test Class for InstanceGroup
"""
- def test_dedicated_host_serialization(self):
+ def test_instance_group_serialization(self):
"""
- Test serialization/deserialization for DedicatedHost
+ Test serialization/deserialization for InstanceGroup
"""
# 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
- vcpu_model['manufacturer'] = 'intel'
-
- 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_template_reference_deleted_model = {} # InstanceTemplateReferenceDeleted
+ instance_template_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- instance_reference_deleted_model = {} # InstanceReferenceDeleted
- instance_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'
- 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'
+ load_balancer_pool_reference_deleted_model = {} # LoadBalancerPoolReferenceDeleted
+ load_balancer_pool_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- dedicated_host_numa_node_model = {} # DedicatedHostNUMANode
- dedicated_host_numa_node_model['available_vcpu'] = 24
- dedicated_host_numa_node_model['vcpu'] = 56
+ 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'
- dedicated_host_numa_model = {} # DedicatedHostNUMA
- dedicated_host_numa_model['count'] = 2
- dedicated_host_numa_model['nodes'] = [dedicated_host_numa_node_model]
+ instance_group_manager_reference_deleted_model = {} # InstanceGroupManagerReferenceDeleted
+ instance_group_manager_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- 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'
+ 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'
- instance_profile_reference_model = {} # InstanceProfileReference
- instance_profile_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16'
- instance_profile_reference_model['name'] = 'bx2-4x16'
+ 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'
+ subnet_reference_model['resource_type'] = 'subnet'
- # 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['numa'] = dedicated_host_numa_model
- 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
+ vpc_reference_deleted_model = {} # VPCReferenceDeleted
+ vpc_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # 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
+ vpc_reference_model = {} # VPCReference
+ vpc_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b'
+ vpc_reference_model['deleted'] = vpc_reference_deleted_model
+ vpc_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b'
+ vpc_reference_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b'
+ vpc_reference_model['name'] = 'my-vpc'
+ vpc_reference_model['resource_type'] = 'vpc'
- # Construct a 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 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 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 dedicated_host_model == dedicated_host_model2
+ assert instance_group_model == instance_group_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
+ instance_group_model_json2 = instance_group_model.to_dict()
+ assert instance_group_model_json2 == instance_group_model_json
-class TestModel_DedicatedHostCollection:
+class TestModel_InstanceGroupCollection:
"""
- Test Class for DedicatedHostCollection
+ Test Class for InstanceGroupCollection
"""
- def test_dedicated_host_collection_serialization(self):
+ def test_instance_group_collection_serialization(self):
"""
- Test serialization/deserialization for DedicatedHostCollection
+ Test serialization/deserialization for InstanceGroupCollection
"""
# 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
- vcpu_model['manufacturer'] = 'intel'
-
- 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_group_collection_first_model = {} # InstanceGroupCollectionFirst
+ instance_group_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups?limit=20'
- instance_reference_deleted_model = {} # InstanceReferenceDeleted
- instance_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ instance_template_reference_deleted_model = {} # InstanceTemplateReferenceDeleted
+ instance_template_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_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'
- dedicated_host_numa_node_model = {} # DedicatedHostNUMANode
- dedicated_host_numa_node_model['available_vcpu'] = 24
- dedicated_host_numa_node_model['vcpu'] = 56
+ load_balancer_pool_reference_deleted_model = {} # LoadBalancerPoolReferenceDeleted
+ load_balancer_pool_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- dedicated_host_numa_model = {} # DedicatedHostNUMA
- dedicated_host_numa_model['count'] = 2
- dedicated_host_numa_model['nodes'] = [dedicated_host_numa_node_model]
+ 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'
- 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'
+ 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'
- instance_profile_reference_model = {} # InstanceProfileReference
- instance_profile_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16'
- instance_profile_reference_model['name'] = 'bx2-4x16'
+ 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'
+ subnet_reference_model['resource_type'] = 'subnet'
- 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['numa'] = dedicated_host_numa_model
- 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
+ vpc_reference_deleted_model = {} # VPCReferenceDeleted
+ vpc_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- dedicated_host_collection_first_model = {} # DedicatedHostCollectionFirst
- dedicated_host_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts?limit=20'
+ vpc_reference_model = {} # VPCReference
+ vpc_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b'
+ vpc_reference_model['deleted'] = vpc_reference_deleted_model
+ vpc_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b'
+ vpc_reference_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b'
+ vpc_reference_model['name'] = 'my-vpc'
+ vpc_reference_model['resource_type'] = 'vpc'
- 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'
+ 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
- # 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
+ 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 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 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 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 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 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 dedicated_host_collection_model == dedicated_host_collection_model2
+ assert instance_group_collection_model == instance_group_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
+ instance_group_collection_model_json2 = instance_group_collection_model.to_dict()
+ assert instance_group_collection_model_json2 == instance_group_collection_model_json
-class TestModel_DedicatedHostCollectionFirst:
+class TestModel_InstanceGroupCollectionFirst:
"""
- Test Class for DedicatedHostCollectionFirst
+ Test Class for InstanceGroupCollectionFirst
"""
- def test_dedicated_host_collection_first_serialization(self):
+ def test_instance_group_collection_first_serialization(self):
"""
- Test serialization/deserialization for DedicatedHostCollectionFirst
+ Test serialization/deserialization for InstanceGroupCollectionFirst
"""
- # 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 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 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 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 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 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 dedicated_host_collection_first_model == dedicated_host_collection_first_model2
+ assert instance_group_collection_first_model == instance_group_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
+ 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_DedicatedHostCollectionNext:
+class TestModel_InstanceGroupCollectionNext:
"""
- Test Class for DedicatedHostCollectionNext
+ Test Class for InstanceGroupCollectionNext
"""
- def test_dedicated_host_collection_next_serialization(self):
+ def test_instance_group_collection_next_serialization(self):
"""
- Test serialization/deserialization for DedicatedHostCollectionNext
+ Test serialization/deserialization for InstanceGroupCollectionNext
"""
- # 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 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 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 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 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 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 dedicated_host_collection_next_model == dedicated_host_collection_next_model2
+ assert instance_group_collection_next_model == instance_group_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
+ 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_DedicatedHostDisk:
+class TestModel_InstanceGroupManagerActionGroupPatch:
"""
- Test Class for DedicatedHostDisk
+ Test Class for InstanceGroupManagerActionGroupPatch
"""
- def test_dedicated_host_disk_serialization(self):
+ def test_instance_group_manager_action_group_patch_serialization(self):
"""
- Test serialization/deserialization for DedicatedHostDisk
+ Test serialization/deserialization for InstanceGroupManagerActionGroupPatch
"""
- # 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 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 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 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 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 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 dedicated_host_disk_model == dedicated_host_disk_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
- dedicated_host_disk_model_json2 = dedicated_host_disk_model.to_dict()
- assert dedicated_host_disk_model_json2 == dedicated_host_disk_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_DedicatedHostDiskCollection:
+class TestModel_InstanceGroupManagerActionManagerPatch:
"""
- Test Class for DedicatedHostDiskCollection
+ Test Class for InstanceGroupManagerActionManagerPatch
"""
- def test_dedicated_host_disk_collection_serialization(self):
+ def test_instance_group_manager_action_manager_patch_serialization(self):
"""
- Test serialization/deserialization for DedicatedHostDiskCollection
+ Test serialization/deserialization for InstanceGroupManagerActionManagerPatch
"""
- # 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 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 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 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 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)
+ # 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 dedicated_host_disk_collection_model == dedicated_host_disk_collection_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
- 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
+ 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_DedicatedHostDiskPatch:
+class TestModel_InstanceGroupManagerActionPatch:
"""
- Test Class for DedicatedHostDiskPatch
+ Test Class for InstanceGroupManagerActionPatch
"""
- def test_dedicated_host_disk_patch_serialization(self):
+ def test_instance_group_manager_action_patch_serialization(self):
"""
- Test serialization/deserialization for DedicatedHostDiskPatch
+ Test serialization/deserialization for InstanceGroupManagerActionPatch
"""
- # 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 dict forms of any model objects needed in order to build this model.
- # 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
+ instance_group_manager_action_group_patch_model = {} # InstanceGroupManagerActionGroupPatch
+ instance_group_manager_action_group_patch_model['membership_count'] = 10
- # 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)
+ 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'] = '30 */2 * * 1-5'
+ instance_group_manager_action_patch_model_json['group'] = instance_group_manager_action_group_patch_model
+ instance_group_manager_action_patch_model_json['manager'] = instance_group_manager_action_manager_patch_model
+ instance_group_manager_action_patch_model_json['name'] = 'my-instance-group-manager-action'
+ 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 dedicated_host_disk_patch_model == dedicated_host_disk_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
- 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
+ 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_DedicatedHostGroup:
+class TestModel_InstanceGroupManagerActionReference:
"""
- Test Class for DedicatedHostGroup
+ Test Class for InstanceGroupManagerActionReference
"""
- def test_dedicated_host_group_serialization(self):
+ def test_instance_group_manager_action_reference_serialization(self):
"""
- Test serialization/deserialization for DedicatedHostGroup
+ Test serialization/deserialization for InstanceGroupManagerActionReference
"""
# 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/bx2-4x16'
- instance_profile_reference_model['name'] = 'bx2-4x16'
-
- zone_reference_model = {} # ZoneReference
- zone_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1'
- zone_reference_model['name'] = 'us-south-1'
+ 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 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 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 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 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 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 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 dedicated_host_group_model == dedicated_host_group_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
- dedicated_host_group_model_json2 = dedicated_host_group_model.to_dict()
- assert dedicated_host_group_model_json2 == dedicated_host_group_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_DedicatedHostGroupCollection:
+class TestModel_InstanceGroupManagerActionReferenceDeleted:
"""
- Test Class for DedicatedHostGroupCollection
+ Test Class for InstanceGroupManagerActionReferenceDeleted
"""
- def test_dedicated_host_group_collection_serialization(self):
+ def test_instance_group_manager_action_reference_deleted_serialization(self):
"""
- Test serialization/deserialization for DedicatedHostGroupCollection
+ Test serialization/deserialization for InstanceGroupManagerActionReferenceDeleted
"""
- # Construct dict forms of any model objects needed in order to build this model.
+ # 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'
- 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'
+ # 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
- 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 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)
- 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'
+ # Verify the model instances are equivalent
+ assert instance_group_manager_action_reference_deleted_model == instance_group_manager_action_reference_deleted_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_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_reference_model = {} # InstanceProfileReference
- instance_profile_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16'
- instance_profile_reference_model['name'] = 'bx2-4x16'
- zone_reference_model = {} # ZoneReference
- zone_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1'
- zone_reference_model['name'] = 'us-south-1'
+class TestModel_InstanceGroupManagerActionsCollection:
+ """
+ Test Class for InstanceGroupManagerActionsCollection
+ """
- 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
+ def test_instance_group_manager_actions_collection_serialization(self):
+ """
+ Test serialization/deserialization for InstanceGroupManagerActionsCollection
+ """
- 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 dict forms of any model objects needed in order to build this model.
- # 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
+ instance_group_manager_scheduled_action_group_model = {} # InstanceGroupManagerScheduledActionGroup
+ instance_group_manager_scheduled_action_group_model['membership_count'] = 10
- # 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
+ 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'] = '30 */2 * * 1-5'
+ instance_group_manager_action_model['last_applied_at'] = '2019-01-01T12:00:00Z'
+ instance_group_manager_action_model['next_run_at'] = '2019-01-01T12:00:00Z'
+ instance_group_manager_action_model['group'] = instance_group_manager_scheduled_action_group_model
+
+ 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 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 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 dedicated_host_group_collection_model == dedicated_host_group_collection_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
- 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
+ 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_DedicatedHostGroupCollectionFirst:
+class TestModel_InstanceGroupManagerActionsCollectionFirst:
"""
- Test Class for DedicatedHostGroupCollectionFirst
+ Test Class for InstanceGroupManagerActionsCollectionFirst
"""
- def test_dedicated_host_group_collection_first_serialization(self):
+ def test_instance_group_manager_actions_collection_first_serialization(self):
"""
- Test serialization/deserialization for DedicatedHostGroupCollectionFirst
+ Test serialization/deserialization for InstanceGroupManagerActionsCollectionFirst
"""
- # 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 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 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 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
- # 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 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)
# Verify the model instances are equivalent
- assert dedicated_host_group_collection_first_model == dedicated_host_group_collection_first_model2
+ assert instance_group_manager_actions_collection_first_model == instance_group_manager_actions_collection_first_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
+ 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
-class TestModel_DedicatedHostGroupCollectionNext:
+class TestModel_InstanceGroupManagerActionsCollectionNext:
"""
- Test Class for DedicatedHostGroupCollectionNext
+ Test Class for InstanceGroupManagerActionsCollectionNext
"""
- def test_dedicated_host_group_collection_next_serialization(self):
+ def test_instance_group_manager_actions_collection_next_serialization(self):
"""
- Test serialization/deserialization for DedicatedHostGroupCollectionNext
+ Test serialization/deserialization for InstanceGroupManagerActionsCollectionNext
"""
- # 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 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 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 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 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)
+ # 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)
# Verify the model instances are equivalent
- assert dedicated_host_group_collection_next_model == dedicated_host_group_collection_next_model2
+ assert instance_group_manager_actions_collection_next_model == instance_group_manager_actions_collection_next_model2
# 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
+ 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
-class TestModel_DedicatedHostGroupPatch:
+class TestModel_InstanceGroupManagerCollection:
"""
- Test Class for DedicatedHostGroupPatch
+ Test Class for InstanceGroupManagerCollection
"""
- def test_dedicated_host_group_patch_serialization(self):
+ def test_instance_group_manager_collection_serialization(self):
"""
- Test serialization/deserialization for DedicatedHostGroupPatch
+ Test serialization/deserialization for InstanceGroupManagerCollection
"""
- # 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 dict forms of any model objects needed in order to build this model.
- # 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
+ 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'
- # 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)
+ 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 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 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 dedicated_host_group_patch_model == dedicated_host_group_patch_model2
+ assert instance_group_manager_collection_model == instance_group_manager_collection_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
+ 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_DedicatedHostGroupPrototypeDedicatedHostByZoneContext:
+class TestModel_InstanceGroupManagerCollectionFirst:
"""
- Test Class for DedicatedHostGroupPrototypeDedicatedHostByZoneContext
+ Test Class for InstanceGroupManagerCollectionFirst
"""
- def test_dedicated_host_group_prototype_dedicated_host_by_zone_context_serialization(self):
+ def test_instance_group_manager_collection_first_serialization(self):
"""
- Test serialization/deserialization for DedicatedHostGroupPrototypeDedicatedHostByZoneContext
+ Test serialization/deserialization for InstanceGroupManagerCollectionFirst
"""
- # 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'
-
- # 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 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 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 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 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)
+ # 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 dedicated_host_group_prototype_dedicated_host_by_zone_context_model == dedicated_host_group_prototype_dedicated_host_by_zone_context_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
- 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
+ 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_DedicatedHostGroupReference:
+class TestModel_InstanceGroupManagerCollectionNext:
"""
- Test Class for DedicatedHostGroupReference
+ Test Class for InstanceGroupManagerCollectionNext
"""
- def test_dedicated_host_group_reference_serialization(self):
+ def test_instance_group_manager_collection_next_serialization(self):
"""
- Test serialization/deserialization for DedicatedHostGroupReference
+ Test serialization/deserialization for InstanceGroupManagerCollectionNext
"""
- # 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'
-
- # 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 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 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 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 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)
+ # 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)
# Verify the model instances are equivalent
- assert dedicated_host_group_reference_model == dedicated_host_group_reference_model2
+ assert instance_group_manager_collection_next_model == instance_group_manager_collection_next_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
+ 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
-class TestModel_DedicatedHostGroupReferenceDeleted:
+class TestModel_InstanceGroupManagerPatch:
"""
- Test Class for DedicatedHostGroupReferenceDeleted
+ Test Class for InstanceGroupManagerPatch
"""
- def test_dedicated_host_group_reference_deleted_serialization(self):
+ def test_instance_group_manager_patch_serialization(self):
"""
- Test serialization/deserialization for DedicatedHostGroupReferenceDeleted
+ Test serialization/deserialization for InstanceGroupManagerPatch
"""
- # 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 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 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 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 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 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)
# Verify the model instances are equivalent
- assert dedicated_host_group_reference_deleted_model == dedicated_host_group_reference_deleted_model2
+ assert instance_group_manager_patch_model == instance_group_manager_patch_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
+ 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
-class TestModel_DedicatedHostNUMA:
+class TestModel_InstanceGroupManagerPolicyCollection:
"""
- Test Class for DedicatedHostNUMA
+ Test Class for InstanceGroupManagerPolicyCollection
"""
- def test_dedicated_host_numa_serialization(self):
+ def test_instance_group_manager_policy_collection_serialization(self):
"""
- Test serialization/deserialization for DedicatedHostNUMA
+ Test serialization/deserialization for InstanceGroupManagerPolicyCollection
"""
# Construct dict forms of any model objects needed in order to build this model.
- dedicated_host_numa_node_model = {} # DedicatedHostNUMANode
- dedicated_host_numa_node_model['available_vcpu'] = 24
- dedicated_host_numa_node_model['vcpu'] = 56
+ 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'
- # Construct a json representation of a DedicatedHostNUMA model
- dedicated_host_numa_model_json = {}
- dedicated_host_numa_model_json['count'] = 2
- dedicated_host_numa_model_json['nodes'] = [dedicated_host_numa_node_model]
+ 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'
- # Construct a model instance of DedicatedHostNUMA by calling from_dict on the json representation
- dedicated_host_numa_model = DedicatedHostNUMA.from_dict(dedicated_host_numa_model_json)
- assert dedicated_host_numa_model != False
+ 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 model instance of DedicatedHostNUMA by calling from_dict on the json representation
- dedicated_host_numa_model_dict = DedicatedHostNUMA.from_dict(dedicated_host_numa_model_json).__dict__
- dedicated_host_numa_model2 = DedicatedHostNUMA(**dedicated_host_numa_model_dict)
+ # 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 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 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)
# Verify the model instances are equivalent
- assert dedicated_host_numa_model == dedicated_host_numa_model2
+ assert instance_group_manager_policy_collection_model == instance_group_manager_policy_collection_model2
# Convert model instance back to dict and verify no loss of data
- dedicated_host_numa_model_json2 = dedicated_host_numa_model.to_dict()
- assert dedicated_host_numa_model_json2 == dedicated_host_numa_model_json
+ 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
-class TestModel_DedicatedHostNUMANode:
+class TestModel_InstanceGroupManagerPolicyCollectionFirst:
"""
- Test Class for DedicatedHostNUMANode
+ Test Class for InstanceGroupManagerPolicyCollectionFirst
"""
- def test_dedicated_host_numa_node_serialization(self):
+ def test_instance_group_manager_policy_collection_first_serialization(self):
"""
- Test serialization/deserialization for DedicatedHostNUMANode
+ Test serialization/deserialization for InstanceGroupManagerPolicyCollectionFirst
"""
- # Construct a json representation of a DedicatedHostNUMANode model
- dedicated_host_numa_node_model_json = {}
- dedicated_host_numa_node_model_json['available_vcpu'] = 24
- dedicated_host_numa_node_model_json['vcpu'] = 56
+ # 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 DedicatedHostNUMANode by calling from_dict on the json representation
- dedicated_host_numa_node_model = DedicatedHostNUMANode.from_dict(dedicated_host_numa_node_model_json)
- assert dedicated_host_numa_node_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 DedicatedHostNUMANode by calling from_dict on the json representation
- dedicated_host_numa_node_model_dict = DedicatedHostNUMANode.from_dict(dedicated_host_numa_node_model_json).__dict__
- dedicated_host_numa_node_model2 = DedicatedHostNUMANode(**dedicated_host_numa_node_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 dedicated_host_numa_node_model == dedicated_host_numa_node_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
- dedicated_host_numa_node_model_json2 = dedicated_host_numa_node_model.to_dict()
- assert dedicated_host_numa_node_model_json2 == dedicated_host_numa_node_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_DedicatedHostPatch:
+class TestModel_InstanceGroupManagerPolicyCollectionNext:
"""
- Test Class for DedicatedHostPatch
+ Test Class for InstanceGroupManagerPolicyCollectionNext
"""
- def test_dedicated_host_patch_serialization(self):
+ def test_instance_group_manager_policy_collection_next_serialization(self):
"""
- Test serialization/deserialization for DedicatedHostPatch
+ Test serialization/deserialization for InstanceGroupManagerPolicyCollectionNext
"""
- # 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 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 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 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 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)
+ # 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 dedicated_host_patch_model == dedicated_host_patch_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
- dedicated_host_patch_model_json2 = dedicated_host_patch_model.to_dict()
- assert dedicated_host_patch_model_json2 == dedicated_host_patch_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_DedicatedHostProfile:
+class TestModel_InstanceGroupManagerPolicyPatch:
"""
- Test Class for DedicatedHostProfile
+ Test Class for InstanceGroupManagerPolicyPatch
"""
- def test_dedicated_host_profile_serialization(self):
+ def test_instance_group_manager_policy_patch_serialization(self):
"""
- Test serialization/deserialization for DedicatedHostProfile
+ Test serialization/deserialization for InstanceGroupManagerPolicyPatch
"""
- # Construct dict forms of any model objects needed in order to build this model.
+ # 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'
- dedicated_host_profile_disk_interface_model = {} # DedicatedHostProfileDiskInterface
- dedicated_host_profile_disk_interface_model['type'] = 'fixed'
- dedicated_host_profile_disk_interface_model['value'] = 'nvme'
+ # 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
- 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 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)
- dedicated_host_profile_disk_size_model = {} # DedicatedHostProfileDiskSize
- dedicated_host_profile_disk_size_model['type'] = 'fixed'
- dedicated_host_profile_disk_size_model['value'] = 3200
+ # Verify the model instances are equivalent
+ assert instance_group_manager_policy_patch_model == instance_group_manager_policy_patch_model2
- 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']
+ # 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
- 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_memory_model = {} # DedicatedHostProfileMemoryFixed
- dedicated_host_profile_memory_model['type'] = 'fixed'
- dedicated_host_profile_memory_model['value'] = 16
+class TestModel_InstanceGroupManagerPolicyReference:
+ """
+ Test Class for InstanceGroupManagerPolicyReference
+ """
- dedicated_host_profile_socket_model = {} # DedicatedHostProfileSocketFixed
- dedicated_host_profile_socket_model['type'] = 'fixed'
- dedicated_host_profile_socket_model['value'] = 2
+ def test_instance_group_manager_policy_reference_serialization(self):
+ """
+ Test serialization/deserialization for InstanceGroupManagerPolicyReference
+ """
- instance_profile_reference_model = {} # InstanceProfileReference
- instance_profile_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16'
- instance_profile_reference_model['name'] = 'bx2-4x16'
+ # Construct dict forms of any model objects needed in order to build this model.
- dedicated_host_profile_vcpu_architecture_model = {} # DedicatedHostProfileVCPUArchitecture
- dedicated_host_profile_vcpu_architecture_model['type'] = 'fixed'
- dedicated_host_profile_vcpu_architecture_model['value'] = 'amd64'
+ 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'
- dedicated_host_profile_vcpu_model = {} # DedicatedHostProfileVCPUFixed
- dedicated_host_profile_vcpu_model['type'] = 'fixed'
- dedicated_host_profile_vcpu_model['value'] = 16
+ # 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'
- dedicated_host_profile_vcpu_manufacturer_model = {} # DedicatedHostProfileVCPUManufacturer
- dedicated_host_profile_vcpu_manufacturer_model['type'] = 'fixed'
- dedicated_host_profile_vcpu_manufacturer_model['value'] = 'intel'
+ # 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 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['status'] = 'current'
- 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
- dedicated_host_profile_model_json['vcpu_manufacturer'] = dedicated_host_profile_vcpu_manufacturer_model
+ # 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)
- # 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
+ # Verify the model instances are equivalent
+ assert instance_group_manager_policy_reference_model == instance_group_manager_policy_reference_model2
- # 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)
+ # 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
+
+
+class TestModel_InstanceGroupManagerPolicyReferenceDeleted:
+ """
+ Test Class for InstanceGroupManagerPolicyReferenceDeleted
+ """
+
+ def test_instance_group_manager_policy_reference_deleted_serialization(self):
+ """
+ Test serialization/deserialization for InstanceGroupManagerPolicyReferenceDeleted
+ """
+
+ # 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 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 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 dedicated_host_profile_model == dedicated_host_profile_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
- dedicated_host_profile_model_json2 = dedicated_host_profile_model.to_dict()
- assert dedicated_host_profile_model_json2 == dedicated_host_profile_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_DedicatedHostProfileCollection:
+class TestModel_InstanceGroupManagerReference:
"""
- Test Class for DedicatedHostProfileCollection
+ Test Class for InstanceGroupManagerReference
"""
- def test_dedicated_host_profile_collection_serialization(self):
+ def test_instance_group_manager_reference_serialization(self):
"""
- Test serialization/deserialization for DedicatedHostProfileCollection
+ Test serialization/deserialization for InstanceGroupManagerReference
"""
# 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']
+ instance_group_manager_reference_deleted_model = {} # InstanceGroupManagerReferenceDeleted
+ instance_group_manager_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- 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 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'
- 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 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
- 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 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)
- instance_profile_reference_model = {} # InstanceProfileReference
- instance_profile_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16'
- instance_profile_reference_model['name'] = 'bx2-4x16'
+ # Verify the model instances are equivalent
+ assert instance_group_manager_reference_model == instance_group_manager_reference_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
+ 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
- dedicated_host_profile_vcpu_model = {} # DedicatedHostProfileVCPUFixed
- dedicated_host_profile_vcpu_model['type'] = 'fixed'
- dedicated_host_profile_vcpu_model['value'] = 16
- dedicated_host_profile_vcpu_manufacturer_model = {} # DedicatedHostProfileVCPUManufacturer
- dedicated_host_profile_vcpu_manufacturer_model['type'] = 'fixed'
- dedicated_host_profile_vcpu_manufacturer_model['value'] = 'intel'
+class TestModel_InstanceGroupManagerReferenceDeleted:
+ """
+ Test Class for InstanceGroupManagerReferenceDeleted
+ """
- 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['status'] = 'current'
- 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
- dedicated_host_profile_model['vcpu_manufacturer'] = dedicated_host_profile_vcpu_manufacturer_model
+ def test_instance_group_manager_reference_deleted_serialization(self):
+ """
+ Test serialization/deserialization for InstanceGroupManagerReferenceDeleted
+ """
- # 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 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 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 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 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 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 dedicated_host_profile_collection_model == dedicated_host_profile_collection_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
- 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
+ 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_DedicatedHostProfileCollectionFirst:
+class TestModel_InstanceGroupManagerScheduledActionGroup:
"""
- Test Class for DedicatedHostProfileCollectionFirst
+ Test Class for InstanceGroupManagerScheduledActionGroup
"""
- def test_dedicated_host_profile_collection_first_serialization(self):
+ def test_instance_group_manager_scheduled_action_group_serialization(self):
"""
- Test serialization/deserialization for DedicatedHostProfileCollectionFirst
+ Test serialization/deserialization for InstanceGroupManagerScheduledActionGroup
"""
- # 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 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 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 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 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 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 dedicated_host_profile_collection_first_model == dedicated_host_profile_collection_first_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
- 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
+ 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_DedicatedHostProfileCollectionNext:
+class TestModel_InstanceGroupManagerScheduledActionGroupPrototype:
"""
- Test Class for DedicatedHostProfileCollectionNext
+ Test Class for InstanceGroupManagerScheduledActionGroupPrototype
"""
- def test_dedicated_host_profile_collection_next_serialization(self):
+ def test_instance_group_manager_scheduled_action_group_prototype_serialization(self):
"""
- Test serialization/deserialization for DedicatedHostProfileCollectionNext
+ Test serialization/deserialization for InstanceGroupManagerScheduledActionGroupPrototype
"""
- # 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 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 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 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 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 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 dedicated_host_profile_collection_next_model == dedicated_host_profile_collection_next_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
- 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
+ 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_DedicatedHostProfileDisk:
+class TestModel_InstanceGroupMembership:
"""
- Test Class for DedicatedHostProfileDisk
+ Test Class for InstanceGroupMembership
"""
- def test_dedicated_host_profile_disk_serialization(self):
+ def test_instance_group_membership_serialization(self):
"""
- Test serialization/deserialization for DedicatedHostProfileDisk
+ Test serialization/deserialization for InstanceGroupMembership
"""
# 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'
+ instance_reference_deleted_model = {} # InstanceReferenceDeleted
+ instance_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
+ 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_size_model = {} # DedicatedHostProfileDiskSize
- dedicated_host_profile_disk_size_model['type'] = 'fixed'
- dedicated_host_profile_disk_size_model['value'] = 3200
+ instance_template_reference_deleted_model = {} # InstanceTemplateReferenceDeleted
+ instance_template_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_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'
- # 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
+ 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 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
+ 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 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 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 dedicated_host_profile_disk_model == dedicated_host_profile_disk_model2
+ assert instance_group_membership_model == instance_group_membership_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
+ instance_group_membership_model_json2 = instance_group_membership_model.to_dict()
+ assert instance_group_membership_model_json2 == instance_group_membership_model_json
-class TestModel_DedicatedHostProfileDiskInterface:
+class TestModel_InstanceGroupMembershipCollection:
"""
- Test Class for DedicatedHostProfileDiskInterface
+ Test Class for InstanceGroupMembershipCollection
"""
- def test_dedicated_host_profile_disk_interface_serialization(self):
+ def test_instance_group_membership_collection_serialization(self):
"""
- Test serialization/deserialization for DedicatedHostProfileDiskInterface
+ Test serialization/deserialization for InstanceGroupMembershipCollection
"""
- # 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
+ 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'
- # 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)
+ 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 dedicated_host_profile_disk_interface_model == dedicated_host_profile_disk_interface_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
- 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
+ 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'
-class TestModel_DedicatedHostProfileDiskQuantity:
- """
- Test Class for DedicatedHostProfileDiskQuantity
- """
+ 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'
- def test_dedicated_host_profile_disk_quantity_serialization(self):
- """
- Test serialization/deserialization for DedicatedHostProfileDiskQuantity
- """
+ 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 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
+ 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'
- # 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
+ 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 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 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 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 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)
# Verify the model instances are equivalent
- assert dedicated_host_profile_disk_quantity_model == dedicated_host_profile_disk_quantity_model2
+ assert instance_group_membership_collection_model == instance_group_membership_collection_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
+ 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
-class TestModel_DedicatedHostProfileDiskSize:
+class TestModel_InstanceGroupMembershipCollectionFirst:
"""
- Test Class for DedicatedHostProfileDiskSize
+ Test Class for InstanceGroupMembershipCollectionFirst
"""
- def test_dedicated_host_profile_disk_size_serialization(self):
+ def test_instance_group_membership_collection_first_serialization(self):
"""
- Test serialization/deserialization for DedicatedHostProfileDiskSize
+ Test serialization/deserialization for InstanceGroupMembershipCollectionFirst
"""
- # 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 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 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 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 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 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 dedicated_host_profile_disk_size_model == dedicated_host_profile_disk_size_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
- 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
+ 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_DedicatedHostProfileDiskSupportedInterfaces:
+class TestModel_InstanceGroupMembershipCollectionNext:
"""
- Test Class for DedicatedHostProfileDiskSupportedInterfaces
+ Test Class for InstanceGroupMembershipCollectionNext
"""
- def test_dedicated_host_profile_disk_supported_interfaces_serialization(self):
+ def test_instance_group_membership_collection_next_serialization(self):
"""
- Test serialization/deserialization for DedicatedHostProfileDiskSupportedInterfaces
+ Test serialization/deserialization for InstanceGroupMembershipCollectionNext
"""
- # 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 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 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
+ # 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 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 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 dedicated_host_profile_disk_supported_interfaces_model == dedicated_host_profile_disk_supported_interfaces_model2
+ 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
- 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
+ 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_DedicatedHostProfileReference:
+class TestModel_InstanceGroupMembershipPatch:
"""
- Test Class for DedicatedHostProfileReference
+ Test Class for InstanceGroupMembershipPatch
"""
- def test_dedicated_host_profile_reference_serialization(self):
+ def test_instance_group_membership_patch_serialization(self):
"""
- Test serialization/deserialization for DedicatedHostProfileReference
+ Test serialization/deserialization for InstanceGroupMembershipPatch
"""
- # 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 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 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 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 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 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)
# Verify the model instances are equivalent
- assert dedicated_host_profile_reference_model == dedicated_host_profile_reference_model2
+ assert instance_group_membership_patch_model == instance_group_membership_patch_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
+ 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
-class TestModel_DedicatedHostProfileVCPUArchitecture:
+class TestModel_InstanceGroupPatch:
"""
- Test Class for DedicatedHostProfileVCPUArchitecture
+ Test Class for InstanceGroupPatch
"""
- def test_dedicated_host_profile_vcpu_architecture_serialization(self):
+ def test_instance_group_patch_serialization(self):
"""
- Test serialization/deserialization for DedicatedHostProfileVCPUArchitecture
+ Test serialization/deserialization for InstanceGroupPatch
"""
- # 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 dict forms of any model objects needed in order to build this model.
- # 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
+ instance_template_identity_model = {} # InstanceTemplateIdentityById
+ instance_template_identity_model['id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803'
+
+ load_balancer_identity_model = {} # LoadBalancerIdentityById
+ load_balancer_identity_model['id'] = 'dd754295-e9e0-4c9d-bf6c-58fbc59e5727'
+
+ 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 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 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 dedicated_host_profile_vcpu_architecture_model == dedicated_host_profile_vcpu_architecture_model2
+ assert instance_group_patch_model == instance_group_patch_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
+ instance_group_patch_model_json2 = instance_group_patch_model.to_dict()
+ assert instance_group_patch_model_json2 == instance_group_patch_model_json
-class TestModel_DedicatedHostProfileVCPUManufacturer:
+class TestModel_InstanceGroupReference:
"""
- Test Class for DedicatedHostProfileVCPUManufacturer
+ Test Class for InstanceGroupReference
"""
- def test_dedicated_host_profile_vcpu_manufacturer_serialization(self):
+ def test_instance_group_reference_serialization(self):
"""
- Test serialization/deserialization for DedicatedHostProfileVCPUManufacturer
+ Test serialization/deserialization for InstanceGroupReference
"""
- # Construct a json representation of a DedicatedHostProfileVCPUManufacturer model
- dedicated_host_profile_vcpu_manufacturer_model_json = {}
- dedicated_host_profile_vcpu_manufacturer_model_json['type'] = 'fixed'
- dedicated_host_profile_vcpu_manufacturer_model_json['value'] = 'intel'
+ # Construct dict forms of any model objects needed in order to build this model.
- # Construct a model instance of DedicatedHostProfileVCPUManufacturer by calling from_dict on the json representation
- dedicated_host_profile_vcpu_manufacturer_model = DedicatedHostProfileVCPUManufacturer.from_dict(dedicated_host_profile_vcpu_manufacturer_model_json)
- assert dedicated_host_profile_vcpu_manufacturer_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 DedicatedHostProfileVCPUManufacturer by calling from_dict on the json representation
- dedicated_host_profile_vcpu_manufacturer_model_dict = DedicatedHostProfileVCPUManufacturer.from_dict(dedicated_host_profile_vcpu_manufacturer_model_json).__dict__
- dedicated_host_profile_vcpu_manufacturer_model2 = DedicatedHostProfileVCPUManufacturer(**dedicated_host_profile_vcpu_manufacturer_model_dict)
+ # 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 dedicated_host_profile_vcpu_manufacturer_model == dedicated_host_profile_vcpu_manufacturer_model2
+ assert instance_group_reference_model == instance_group_reference_model2
# Convert model instance back to dict and verify no loss of data
- dedicated_host_profile_vcpu_manufacturer_model_json2 = dedicated_host_profile_vcpu_manufacturer_model.to_dict()
- assert dedicated_host_profile_vcpu_manufacturer_model_json2 == dedicated_host_profile_vcpu_manufacturer_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_DedicatedHostReference:
+class TestModel_InstanceGroupReferenceDeleted:
"""
- Test Class for DedicatedHostReference
+ Test Class for InstanceGroupReferenceDeleted
"""
- def test_dedicated_host_reference_serialization(self):
+ def test_instance_group_reference_deleted_serialization(self):
"""
- Test serialization/deserialization for DedicatedHostReference
+ Test serialization/deserialization for InstanceGroupReferenceDeleted
"""
- # 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'
-
- # 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 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 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 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 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)
+ # 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 dedicated_host_reference_model == dedicated_host_reference_model2
+ assert instance_group_reference_deleted_model == instance_group_reference_deleted_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
+ 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_DedicatedHostReferenceDeleted:
+class TestModel_InstanceHealthReason:
"""
- Test Class for DedicatedHostReferenceDeleted
+ Test Class for InstanceHealthReason
"""
- def test_dedicated_host_reference_deleted_serialization(self):
+ def test_instance_health_reason_serialization(self):
"""
- Test serialization/deserialization for DedicatedHostReferenceDeleted
+ Test serialization/deserialization for InstanceHealthReason
"""
- # 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 json representation of a InstanceHealthReason model
+ instance_health_reason_model_json = {}
+ instance_health_reason_model_json['code'] = 'reservation_expired'
+ instance_health_reason_model_json['message'] = 'The reservation cannot be used because it has expired.'
+ instance_health_reason_model_json['more_info'] = 'https://cloud.ibm.com/docs/vpc?topic=vpc-virtual-server-health-status-reasons'
- # 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 InstanceHealthReason by calling from_dict on the json representation
+ instance_health_reason_model = InstanceHealthReason.from_dict(instance_health_reason_model_json)
+ assert instance_health_reason_model != False
- # 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)
+ # Construct a model instance of InstanceHealthReason by calling from_dict on the json representation
+ instance_health_reason_model_dict = InstanceHealthReason.from_dict(instance_health_reason_model_json).__dict__
+ instance_health_reason_model2 = InstanceHealthReason(**instance_health_reason_model_dict)
# Verify the model instances are equivalent
- assert dedicated_host_reference_deleted_model == dedicated_host_reference_deleted_model2
+ assert instance_health_reason_model == instance_health_reason_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
+ instance_health_reason_model_json2 = instance_health_reason_model.to_dict()
+ assert instance_health_reason_model_json2 == instance_health_reason_model_json
-class TestModel_DefaultNetworkACL:
+class TestModel_InstanceInitialization:
"""
- Test Class for DefaultNetworkACL
+ Test Class for InstanceInitialization
"""
- def test_default_network_acl_serialization(self):
+ def test_instance_initialization_serialization(self):
"""
- Test serialization/deserialization for DefaultNetworkACL
+ Test serialization/deserialization for InstanceInitialization
"""
# 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'
+ trusted_profile_reference_model = {} # TrustedProfileReference
+ trusted_profile_reference_model['crn'] = 'crn:[...]'
+ trusted_profile_reference_model['id'] = 'Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5'
+ trusted_profile_reference_model['resource_type'] = 'trusted_profile'
- network_acl_rule_item_model = {} # NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP
- network_acl_rule_item_model['action'] = 'allow'
- network_acl_rule_item_model['before'] = network_acl_rule_reference_model
- network_acl_rule_item_model['created_at'] = '2019-01-01T12:00:00Z'
- 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-1'
- network_acl_rule_item_model['source'] = '192.168.3.0/24'
- network_acl_rule_item_model['destination_port_max'] = 22
- network_acl_rule_item_model['destination_port_min'] = 22
- network_acl_rule_item_model['protocol'] = 'udp'
- network_acl_rule_item_model['source_port_max'] = 65535
- network_acl_rule_item_model['source_port_min'] = 49152
+ instance_initialization_default_trusted_profile_model = {} # InstanceInitializationDefaultTrustedProfile
+ instance_initialization_default_trusted_profile_model['auto_link'] = True
+ instance_initialization_default_trusted_profile_model['target'] = trusted_profile_reference_model
- subnet_reference_deleted_model = {} # SubnetReferenceDeleted
- subnet_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ key_reference_deleted_model = {} # KeyReferenceDeleted
+ key_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- subnet_reference_model = {} # SubnetReference
- subnet_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
- subnet_reference_model['deleted'] = subnet_reference_deleted_model
- subnet_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
- subnet_reference_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
- subnet_reference_model['name'] = 'my-subnet'
- subnet_reference_model['resource_type'] = 'subnet'
+ 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'
- vpc_reference_deleted_model = {} # VPCReferenceDeleted
- vpc_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ key_identity_by_fingerprint_model = {} # KeyIdentityByFingerprint
+ key_identity_by_fingerprint_model['fingerprint'] = 'SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY'
- vpc_reference_model = {} # VPCReference
- vpc_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b'
- vpc_reference_model['deleted'] = vpc_reference_deleted_model
- vpc_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b'
- vpc_reference_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b'
- vpc_reference_model['name'] = 'my-vpc'
- vpc_reference_model['resource_type'] = 'vpc'
+ 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 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-mythology'
- default_network_acl_model_json['resource_group'] = resource_group_reference_model
- default_network_acl_model_json['rules'] = [network_acl_rule_item_model]
- default_network_acl_model_json['subnets'] = [subnet_reference_model]
- default_network_acl_model_json['vpc'] = vpc_reference_model
+ # Construct a json representation of a InstanceInitialization model
+ instance_initialization_model_json = {}
+ instance_initialization_model_json['default_trusted_profile'] = instance_initialization_default_trusted_profile_model
+ instance_initialization_model_json['keys'] = [key_reference_model]
+ instance_initialization_model_json['password'] = instance_initialization_password_model
- # 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 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 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 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 default_network_acl_model == default_network_acl_model2
+ assert instance_initialization_model == instance_initialization_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
+ instance_initialization_model_json2 = instance_initialization_model.to_dict()
+ assert instance_initialization_model_json2 == instance_initialization_model_json
-class TestModel_DefaultRoutingTable:
+class TestModel_InstanceInitializationDefaultTrustedProfile:
"""
- Test Class for DefaultRoutingTable
+ Test Class for InstanceInitializationDefaultTrustedProfile
"""
- def test_default_routing_table_serialization(self):
+ def test_instance_initialization_default_trusted_profile_serialization(self):
"""
- Test serialization/deserialization for DefaultRoutingTable
+ Test serialization/deserialization for InstanceInitializationDefaultTrustedProfile
"""
# Construct dict forms of any model objects needed in order to build this model.
- resource_filter_model = {} # ResourceFilter
- resource_filter_model['resource_type'] = 'vpn_server'
-
- 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/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840/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'
- subnet_reference_model['resource_type'] = 'subnet'
+ trusted_profile_reference_model = {} # TrustedProfileReference
+ trusted_profile_reference_model['crn'] = 'crn:v1:bluemix:public:iam-identity::a/123456::profile:Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5'
+ trusted_profile_reference_model['id'] = 'Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5'
+ trusted_profile_reference_model['resource_type'] = 'trusted_profile'
- # Construct a json representation of a DefaultRoutingTable model
- default_routing_table_model_json = {}
- default_routing_table_model_json['accept_routes_from'] = [resource_filter_model]
- 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_internet_ingress'] = True
- default_routing_table_model_json['route_transit_gateway_ingress'] = True
- default_routing_table_model_json['route_vpc_zone_ingress'] = True
- default_routing_table_model_json['routes'] = [route_reference_model]
- default_routing_table_model_json['subnets'] = [subnet_reference_model]
+ # Construct a json representation of a InstanceInitializationDefaultTrustedProfile model
+ instance_initialization_default_trusted_profile_model_json = {}
+ instance_initialization_default_trusted_profile_model_json['auto_link'] = True
+ instance_initialization_default_trusted_profile_model_json['target'] = trusted_profile_reference_model
- # Construct a model instance of 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 InstanceInitializationDefaultTrustedProfile by calling from_dict on the json representation
+ instance_initialization_default_trusted_profile_model = InstanceInitializationDefaultTrustedProfile.from_dict(instance_initialization_default_trusted_profile_model_json)
+ assert instance_initialization_default_trusted_profile_model != False
- # Construct a model instance of 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 InstanceInitializationDefaultTrustedProfile by calling from_dict on the json representation
+ instance_initialization_default_trusted_profile_model_dict = InstanceInitializationDefaultTrustedProfile.from_dict(instance_initialization_default_trusted_profile_model_json).__dict__
+ instance_initialization_default_trusted_profile_model2 = InstanceInitializationDefaultTrustedProfile(**instance_initialization_default_trusted_profile_model_dict)
# Verify the model instances are equivalent
- assert default_routing_table_model == default_routing_table_model2
+ assert instance_initialization_default_trusted_profile_model == instance_initialization_default_trusted_profile_model2
# Convert model instance back to dict and verify no loss of data
- default_routing_table_model_json2 = default_routing_table_model.to_dict()
- assert default_routing_table_model_json2 == default_routing_table_model_json
+ instance_initialization_default_trusted_profile_model_json2 = instance_initialization_default_trusted_profile_model.to_dict()
+ assert instance_initialization_default_trusted_profile_model_json2 == instance_initialization_default_trusted_profile_model_json
-class TestModel_DefaultSecurityGroup:
+class TestModel_InstanceInitializationPassword:
"""
- Test Class for DefaultSecurityGroup
+ Test Class for InstanceInitializationPassword
"""
- def test_default_security_group_serialization(self):
+ def test_instance_initialization_password_serialization(self):
"""
- Test serialization/deserialization for DefaultSecurityGroup
+ Test serialization/deserialization for InstanceInitializationPassword
"""
# 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'
+ key_identity_by_fingerprint_model = {} # KeyIdentityByFingerprint
+ key_identity_by_fingerprint_model['fingerprint'] = 'SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY'
- security_group_rule_remote_model = {} # SecurityGroupRuleRemoteIP
- security_group_rule_remote_model['address'] = '192.168.3.4'
+ # 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
- 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 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
- 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 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)
- 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-instance-network-interface'
- security_group_target_reference_model['resource_type'] = 'network_interface'
+ # Verify the model instances are equivalent
+ assert instance_initialization_password_model == instance_initialization_password_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_initialization_password_model_json2 = instance_initialization_password_model.to_dict()
+ assert instance_initialization_password_model_json2 == instance_initialization_password_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'
- vpc_reference_model['resource_type'] = '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['targets'] = [security_group_target_reference_model]
- default_security_group_model_json['vpc'] = vpc_reference_model
+class TestModel_InstanceLifecycleReason:
+ """
+ Test Class for InstanceLifecycleReason
+ """
- # 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
+ def test_instance_lifecycle_reason_serialization(self):
+ """
+ Test serialization/deserialization for InstanceLifecycleReason
+ """
- # 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 json representation of a InstanceLifecycleReason model
+ instance_lifecycle_reason_model_json = {}
+ instance_lifecycle_reason_model_json['code'] = 'resource_suspended_by_provider'
+ instance_lifecycle_reason_model_json['message'] = 'The resource has been suspended. Contact IBM support with the CRN for next steps.'
+ instance_lifecycle_reason_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#resource-suspension'
+
+ # Construct a model instance of InstanceLifecycleReason by calling from_dict on the json representation
+ instance_lifecycle_reason_model = InstanceLifecycleReason.from_dict(instance_lifecycle_reason_model_json)
+ assert instance_lifecycle_reason_model != False
+
+ # Construct a model instance of InstanceLifecycleReason by calling from_dict on the json representation
+ instance_lifecycle_reason_model_dict = InstanceLifecycleReason.from_dict(instance_lifecycle_reason_model_json).__dict__
+ instance_lifecycle_reason_model2 = InstanceLifecycleReason(**instance_lifecycle_reason_model_dict)
# Verify the model instances are equivalent
- assert default_security_group_model == default_security_group_model2
+ assert instance_lifecycle_reason_model == instance_lifecycle_reason_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
+ instance_lifecycle_reason_model_json2 = instance_lifecycle_reason_model.to_dict()
+ assert instance_lifecycle_reason_model_json2 == instance_lifecycle_reason_model_json
-class TestModel_EncryptionKeyReference:
+class TestModel_InstanceMetadataService:
"""
- Test Class for EncryptionKeyReference
+ Test Class for InstanceMetadataService
"""
- def test_encryption_key_reference_serialization(self):
+ def test_instance_metadata_service_serialization(self):
"""
- Test serialization/deserialization for EncryptionKeyReference
+ Test serialization/deserialization for InstanceMetadataService
"""
- # 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/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179'
+ # Construct a json representation of a InstanceMetadataService model
+ instance_metadata_service_model_json = {}
+ instance_metadata_service_model_json['enabled'] = True
+ instance_metadata_service_model_json['protocol'] = 'http'
+ instance_metadata_service_model_json['response_hop_limit'] = 1
- # 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 InstanceMetadataService by calling from_dict on the json representation
+ instance_metadata_service_model = InstanceMetadataService.from_dict(instance_metadata_service_model_json)
+ assert instance_metadata_service_model != False
- # Construct a model instance of 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)
+ # Construct a model instance of InstanceMetadataService by calling from_dict on the json representation
+ instance_metadata_service_model_dict = InstanceMetadataService.from_dict(instance_metadata_service_model_json).__dict__
+ instance_metadata_service_model2 = InstanceMetadataService(**instance_metadata_service_model_dict)
# Verify the model instances are equivalent
- assert encryption_key_reference_model == encryption_key_reference_model2
+ assert instance_metadata_service_model == instance_metadata_service_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
+ instance_metadata_service_model_json2 = instance_metadata_service_model.to_dict()
+ assert instance_metadata_service_model_json2 == instance_metadata_service_model_json
-class TestModel_EndpointGateway:
+class TestModel_InstanceMetadataServicePatch:
"""
- Test Class for EndpointGateway
+ Test Class for InstanceMetadataServicePatch
"""
- def test_endpoint_gateway_serialization(self):
+ def test_instance_metadata_service_patch_serialization(self):
"""
- Test serialization/deserialization for EndpointGateway
+ Test serialization/deserialization for InstanceMetadataServicePatch
"""
- # Construct dict forms of any model objects needed in order to build this model.
-
- reserved_ip_reference_deleted_model = {} # ReservedIPReferenceDeleted
- reserved_ip_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
-
- reserved_ip_reference_model = {} # ReservedIPReference
- reserved_ip_reference_model['address'] = '192.168.3.4'
- reserved_ip_reference_model['deleted'] = reserved_ip_reference_deleted_model
- reserved_ip_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb'
- reserved_ip_reference_model['id'] = '6d353a0f-aeb1-4ae1-832e-1110d10981bb'
- reserved_ip_reference_model['name'] = 'my-reserved-ip'
- reserved_ip_reference_model['resource_type'] = 'subnet_reserved_ip'
+ # Construct a json representation of a InstanceMetadataServicePatch model
+ instance_metadata_service_patch_model_json = {}
+ instance_metadata_service_patch_model_json['enabled'] = True
+ instance_metadata_service_patch_model_json['protocol'] = 'http'
+ instance_metadata_service_patch_model_json['response_hop_limit'] = 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'
+ # Construct a model instance of InstanceMetadataServicePatch by calling from_dict on the json representation
+ instance_metadata_service_patch_model = InstanceMetadataServicePatch.from_dict(instance_metadata_service_patch_model_json)
+ assert instance_metadata_service_patch_model != False
- 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 InstanceMetadataServicePatch by calling from_dict on the json representation
+ instance_metadata_service_patch_model_dict = InstanceMetadataServicePatch.from_dict(instance_metadata_service_patch_model_json).__dict__
+ instance_metadata_service_patch_model2 = InstanceMetadataServicePatch(**instance_metadata_service_patch_model_dict)
- 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'
+ # Verify the model instances are equivalent
+ assert instance_metadata_service_patch_model == instance_metadata_service_patch_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
+ instance_metadata_service_patch_model_json2 = instance_metadata_service_patch_model.to_dict()
+ assert instance_metadata_service_patch_model_json2 == instance_metadata_service_patch_model_json
- vpc_reference_deleted_model = {} # VPCReferenceDeleted
- vpc_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- vpc_reference_model = {} # VPCReference
- vpc_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b'
- vpc_reference_model['deleted'] = vpc_reference_deleted_model
- vpc_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b'
- vpc_reference_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b'
- vpc_reference_model['name'] = 'my-vpc'
- vpc_reference_model['resource_type'] = 'vpc'
+class TestModel_InstanceMetadataServicePrototype:
+ """
+ Test Class for InstanceMetadataServicePrototype
+ """
- # Construct a json representation of a EndpointGateway model
- endpoint_gateway_model_json = {}
- endpoint_gateway_model_json['allow_dns_resolution_binding'] = True
- 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:r134-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/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5'
- endpoint_gateway_model_json['id'] = 'r134-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
+ def test_instance_metadata_service_prototype_serialization(self):
+ """
+ Test serialization/deserialization for InstanceMetadataServicePrototype
+ """
- # 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 json representation of a InstanceMetadataServicePrototype model
+ instance_metadata_service_prototype_model_json = {}
+ instance_metadata_service_prototype_model_json['enabled'] = False
+ instance_metadata_service_prototype_model_json['protocol'] = 'https'
+ instance_metadata_service_prototype_model_json['response_hop_limit'] = 2
- # 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 InstanceMetadataServicePrototype by calling from_dict on the json representation
+ instance_metadata_service_prototype_model = InstanceMetadataServicePrototype.from_dict(instance_metadata_service_prototype_model_json)
+ assert instance_metadata_service_prototype_model != False
+
+ # Construct a model instance of InstanceMetadataServicePrototype by calling from_dict on the json representation
+ instance_metadata_service_prototype_model_dict = InstanceMetadataServicePrototype.from_dict(instance_metadata_service_prototype_model_json).__dict__
+ instance_metadata_service_prototype_model2 = InstanceMetadataServicePrototype(**instance_metadata_service_prototype_model_dict)
# Verify the model instances are equivalent
- assert endpoint_gateway_model == endpoint_gateway_model2
+ assert instance_metadata_service_prototype_model == instance_metadata_service_prototype_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
+ instance_metadata_service_prototype_model_json2 = instance_metadata_service_prototype_model.to_dict()
+ assert instance_metadata_service_prototype_model_json2 == instance_metadata_service_prototype_model_json
-class TestModel_EndpointGatewayCollection:
+class TestModel_InstanceNetworkAttachment:
"""
- Test Class for EndpointGatewayCollection
+ Test Class for InstanceNetworkAttachment
"""
- def test_endpoint_gateway_collection_serialization(self):
+ def test_instance_network_attachment_serialization(self):
"""
- Test serialization/deserialization for EndpointGatewayCollection
+ Test serialization/deserialization for InstanceNetworkAttachment
"""
# Construct dict forms of any model objects needed in order to build this model.
@@ -47837,9873 +57671,9848 @@ def test_endpoint_gateway_collection_serialization(self):
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['address'] = '10.0.0.5'
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['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/2302-ea5fe79f-52c3-4f05-86ae-9540a10489f5/reserved_ips/5e2c7f65-6393-4345-a5b7-3d13242ae68d'
+ reserved_ip_reference_model['id'] = '5e2c7f65-6393-4345-a5b7-3d13242ae68d'
+ reserved_ip_reference_model['name'] = 'my-reserved-ip-1'
reserved_ip_reference_model['resource_type'] = 'subnet_reserved_ip'
- resource_group_reference_model = {} # ResourceGroupReference
- resource_group_reference_model['href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/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'
- vpc_reference_model['resource_type'] = 'vpc'
-
- endpoint_gateway_model = {} # EndpointGateway
- endpoint_gateway_model['allow_dns_resolution_binding'] = True
- 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:r134-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/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5'
- endpoint_gateway_model['id'] = 'r134-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
+ subnet_reference_deleted_model = {} # SubnetReferenceDeleted
+ subnet_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- endpoint_gateway_collection_first_model = {} # EndpointGatewayCollectionFirst
- endpoint_gateway_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways?limit=20'
+ 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/2302-ea5fe79f-52c3-4f05-86ae-9540a10489f5'
+ subnet_reference_model['id'] = '2302-ea5fe79f-52c3-4f05-86ae-9540a10489f5'
+ subnet_reference_model['name'] = 'my-subnet'
+ subnet_reference_model['resource_type'] = 'subnet'
- 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'
+ virtual_network_interface_reference_attachment_context_model = {} # VirtualNetworkInterfaceReferenceAttachmentContext
+ virtual_network_interface_reference_attachment_context_model['crn'] = 'crn:[...]'
+ virtual_network_interface_reference_attachment_context_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-54eb57ee-86f2-4796-90bb-d7874e0831ef'
+ virtual_network_interface_reference_attachment_context_model['id'] = '0767-54eb57ee-86f2-4796-90bb-d7874e0831ef'
+ virtual_network_interface_reference_attachment_context_model['name'] = 'my-virtual-network-interface'
+ virtual_network_interface_reference_attachment_context_model['resource_type'] = 'virtual_network_interface'
- # 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 json representation of a InstanceNetworkAttachment model
+ instance_network_attachment_model_json = {}
+ instance_network_attachment_model_json['created_at'] = '2019-01-01T12:00:00Z'
+ instance_network_attachment_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/5dd61d72-acaa-47c2-a336-3d849660d010/network_attachments/0767-d54eb633-98ea-459d-aa00-6a8e780175a7'
+ instance_network_attachment_model_json['id'] = '0767-d54eb633-98ea-459d-aa00-6a8e780175a7'
+ instance_network_attachment_model_json['lifecycle_state'] = 'stable'
+ instance_network_attachment_model_json['name'] = 'my-instance-network-attachment'
+ instance_network_attachment_model_json['port_speed'] = 1000
+ instance_network_attachment_model_json['primary_ip'] = reserved_ip_reference_model
+ instance_network_attachment_model_json['resource_type'] = 'instance_network_attachment'
+ instance_network_attachment_model_json['subnet'] = subnet_reference_model
+ instance_network_attachment_model_json['type'] = 'primary'
+ instance_network_attachment_model_json['virtual_network_interface'] = virtual_network_interface_reference_attachment_context_model
- # 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 InstanceNetworkAttachment by calling from_dict on the json representation
+ instance_network_attachment_model = InstanceNetworkAttachment.from_dict(instance_network_attachment_model_json)
+ assert instance_network_attachment_model != False
- # 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)
+ # Construct a model instance of InstanceNetworkAttachment by calling from_dict on the json representation
+ instance_network_attachment_model_dict = InstanceNetworkAttachment.from_dict(instance_network_attachment_model_json).__dict__
+ instance_network_attachment_model2 = InstanceNetworkAttachment(**instance_network_attachment_model_dict)
# Verify the model instances are equivalent
- assert endpoint_gateway_collection_model == endpoint_gateway_collection_model2
+ assert instance_network_attachment_model == instance_network_attachment_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
+ instance_network_attachment_model_json2 = instance_network_attachment_model.to_dict()
+ assert instance_network_attachment_model_json2 == instance_network_attachment_model_json
-class TestModel_EndpointGatewayCollectionFirst:
+class TestModel_InstanceNetworkAttachmentCollection:
"""
- Test Class for EndpointGatewayCollectionFirst
+ Test Class for InstanceNetworkAttachmentCollection
"""
- def test_endpoint_gateway_collection_first_serialization(self):
+ def test_instance_network_attachment_collection_serialization(self):
"""
- Test serialization/deserialization for EndpointGatewayCollectionFirst
+ Test serialization/deserialization for InstanceNetworkAttachmentCollection
"""
- # 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 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
+ # 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_dict = EndpointGatewayCollectionFirst.from_dict(endpoint_gateway_collection_first_model_json).__dict__
- endpoint_gateway_collection_first_model2 = EndpointGatewayCollectionFirst(**endpoint_gateway_collection_first_model_dict)
+ reserved_ip_reference_deleted_model = {} # ReservedIPReferenceDeleted
+ reserved_ip_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Verify the model instances are equivalent
- assert endpoint_gateway_collection_first_model == endpoint_gateway_collection_first_model2
+ reserved_ip_reference_model = {} # ReservedIPReference
+ reserved_ip_reference_model['address'] = '10.0.0.5'
+ reserved_ip_reference_model['deleted'] = reserved_ip_reference_deleted_model
+ reserved_ip_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/2302-ea5fe79f-52c3-4f05-86ae-9540a10489f5/reserved_ips/5e2c7f65-6393-4345-a5b7-3d13242ae68d'
+ reserved_ip_reference_model['id'] = '5e2c7f65-6393-4345-a5b7-3d13242ae68d'
+ reserved_ip_reference_model['name'] = 'my-reserved-ip-1'
+ reserved_ip_reference_model['resource_type'] = 'subnet_reserved_ip'
- # 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
+ 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/2302-ea5fe79f-52c3-4f05-86ae-9540a10489f5'
+ subnet_reference_model['id'] = '2302-ea5fe79f-52c3-4f05-86ae-9540a10489f5'
+ subnet_reference_model['name'] = 'my-subnet'
+ subnet_reference_model['resource_type'] = 'subnet'
-class TestModel_EndpointGatewayCollectionNext:
- """
- Test Class for EndpointGatewayCollectionNext
- """
+ virtual_network_interface_reference_attachment_context_model = {} # VirtualNetworkInterfaceReferenceAttachmentContext
+ virtual_network_interface_reference_attachment_context_model['crn'] = 'crn:[...]'
+ virtual_network_interface_reference_attachment_context_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-54eb57ee-86f2-4796-90bb-d7874e0831ef'
+ virtual_network_interface_reference_attachment_context_model['id'] = '0767-54eb57ee-86f2-4796-90bb-d7874e0831ef'
+ virtual_network_interface_reference_attachment_context_model['name'] = 'my-virtual-network-interface'
+ virtual_network_interface_reference_attachment_context_model['resource_type'] = 'virtual_network_interface'
- def test_endpoint_gateway_collection_next_serialization(self):
- """
- Test serialization/deserialization for EndpointGatewayCollectionNext
- """
+ instance_network_attachment_model = {} # InstanceNetworkAttachment
+ instance_network_attachment_model['created_at'] = '2023-09-30T23:42:32.993000Z'
+ instance_network_attachment_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/123a490a-9e64-4254-a93b-9a3af3ede270/network_attachments/2be851a6-930e-4724-980d-f03e31b00295'
+ instance_network_attachment_model['id'] = '2be851a6-930e-4724-980d-f03e31b00295'
+ instance_network_attachment_model['lifecycle_state'] = 'stable'
+ instance_network_attachment_model['name'] = 'my-instance-network-attachment'
+ instance_network_attachment_model['port_speed'] = 1000
+ instance_network_attachment_model['primary_ip'] = reserved_ip_reference_model
+ instance_network_attachment_model['resource_type'] = 'instance_network_attachment'
+ instance_network_attachment_model['subnet'] = subnet_reference_model
+ instance_network_attachment_model['type'] = 'primary'
+ instance_network_attachment_model['virtual_network_interface'] = virtual_network_interface_reference_attachment_context_model
- # 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 InstanceNetworkAttachmentCollection model
+ instance_network_attachment_collection_model_json = {}
+ instance_network_attachment_collection_model_json['network_attachments'] = [instance_network_attachment_model]
- # 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 InstanceNetworkAttachmentCollection by calling from_dict on the json representation
+ instance_network_attachment_collection_model = InstanceNetworkAttachmentCollection.from_dict(instance_network_attachment_collection_model_json)
+ assert instance_network_attachment_collection_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 InstanceNetworkAttachmentCollection by calling from_dict on the json representation
+ instance_network_attachment_collection_model_dict = InstanceNetworkAttachmentCollection.from_dict(instance_network_attachment_collection_model_json).__dict__
+ instance_network_attachment_collection_model2 = InstanceNetworkAttachmentCollection(**instance_network_attachment_collection_model_dict)
# Verify the model instances are equivalent
- assert endpoint_gateway_collection_next_model == endpoint_gateway_collection_next_model2
+ assert instance_network_attachment_collection_model == instance_network_attachment_collection_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
+ instance_network_attachment_collection_model_json2 = instance_network_attachment_collection_model.to_dict()
+ assert instance_network_attachment_collection_model_json2 == instance_network_attachment_collection_model_json
-class TestModel_EndpointGatewayPatch:
+class TestModel_InstanceNetworkAttachmentPatch:
"""
- Test Class for EndpointGatewayPatch
+ Test Class for InstanceNetworkAttachmentPatch
"""
- def test_endpoint_gateway_patch_serialization(self):
+ def test_instance_network_attachment_patch_serialization(self):
"""
- Test serialization/deserialization for EndpointGatewayPatch
+ Test serialization/deserialization for InstanceNetworkAttachmentPatch
"""
- # Construct a json representation of a EndpointGatewayPatch model
- endpoint_gateway_patch_model_json = {}
- endpoint_gateway_patch_model_json['allow_dns_resolution_binding'] = True
- endpoint_gateway_patch_model_json['name'] = 'my-endpoint-gateway'
+ # Construct a json representation of a InstanceNetworkAttachmentPatch model
+ instance_network_attachment_patch_model_json = {}
+ instance_network_attachment_patch_model_json['name'] = 'my-instance-network-attachment-updated'
- # 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 InstanceNetworkAttachmentPatch by calling from_dict on the json representation
+ instance_network_attachment_patch_model = InstanceNetworkAttachmentPatch.from_dict(instance_network_attachment_patch_model_json)
+ assert instance_network_attachment_patch_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 InstanceNetworkAttachmentPatch by calling from_dict on the json representation
+ instance_network_attachment_patch_model_dict = InstanceNetworkAttachmentPatch.from_dict(instance_network_attachment_patch_model_json).__dict__
+ instance_network_attachment_patch_model2 = InstanceNetworkAttachmentPatch(**instance_network_attachment_patch_model_dict)
# Verify the model instances are equivalent
- assert endpoint_gateway_patch_model == endpoint_gateway_patch_model2
+ assert instance_network_attachment_patch_model == instance_network_attachment_patch_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
+ instance_network_attachment_patch_model_json2 = instance_network_attachment_patch_model.to_dict()
+ assert instance_network_attachment_patch_model_json2 == instance_network_attachment_patch_model_json
-class TestModel_EndpointGatewayReferenceDeleted:
+class TestModel_InstanceNetworkAttachmentPrototype:
"""
- Test Class for EndpointGatewayReferenceDeleted
+ Test Class for InstanceNetworkAttachmentPrototype
"""
- def test_endpoint_gateway_reference_deleted_serialization(self):
+ def test_instance_network_attachment_prototype_serialization(self):
"""
- Test serialization/deserialization for EndpointGatewayReferenceDeleted
+ Test serialization/deserialization for InstanceNetworkAttachmentPrototype
"""
- # 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
+ virtual_network_interface_ip_prototype_model = {} # VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext
+ virtual_network_interface_ip_prototype_model['address'] = '10.0.0.5'
+ virtual_network_interface_ip_prototype_model['auto_delete'] = False
+ virtual_network_interface_ip_prototype_model['name'] = 'my-reserved-ip'
- # 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)
+ virtual_network_interface_primary_ip_prototype_model = {} # VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext
+ virtual_network_interface_primary_ip_prototype_model['address'] = '10.0.0.5'
+ virtual_network_interface_primary_ip_prototype_model['auto_delete'] = False
+ virtual_network_interface_primary_ip_prototype_model['name'] = 'my-reserved-ip'
+
+ resource_group_identity_model = {} # ResourceGroupIdentityById
+ resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
+
+ security_group_identity_model = {} # SecurityGroupIdentityById
+ security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271'
+
+ subnet_identity_model = {} # SubnetIdentityById
+ subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
+
+ instance_network_attachment_prototype_virtual_network_interface_model = {} # InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeInstanceNetworkAttachmentContext
+ instance_network_attachment_prototype_virtual_network_interface_model['allow_ip_spoofing'] = True
+ instance_network_attachment_prototype_virtual_network_interface_model['auto_delete'] = False
+ instance_network_attachment_prototype_virtual_network_interface_model['enable_infrastructure_nat'] = True
+ instance_network_attachment_prototype_virtual_network_interface_model['ips'] = [virtual_network_interface_ip_prototype_model]
+ instance_network_attachment_prototype_virtual_network_interface_model['name'] = 'my-virtual-network-interface'
+ instance_network_attachment_prototype_virtual_network_interface_model['primary_ip'] = virtual_network_interface_primary_ip_prototype_model
+ instance_network_attachment_prototype_virtual_network_interface_model['resource_group'] = resource_group_identity_model
+ instance_network_attachment_prototype_virtual_network_interface_model['security_groups'] = [security_group_identity_model]
+ instance_network_attachment_prototype_virtual_network_interface_model['subnet'] = subnet_identity_model
+
+ # Construct a json representation of a InstanceNetworkAttachmentPrototype model
+ instance_network_attachment_prototype_model_json = {}
+ instance_network_attachment_prototype_model_json['name'] = 'my-instance-network-attachment'
+ instance_network_attachment_prototype_model_json['virtual_network_interface'] = instance_network_attachment_prototype_virtual_network_interface_model
+
+ # Construct a model instance of InstanceNetworkAttachmentPrototype by calling from_dict on the json representation
+ instance_network_attachment_prototype_model = InstanceNetworkAttachmentPrototype.from_dict(instance_network_attachment_prototype_model_json)
+ assert instance_network_attachment_prototype_model != False
+
+ # Construct a model instance of InstanceNetworkAttachmentPrototype by calling from_dict on the json representation
+ instance_network_attachment_prototype_model_dict = InstanceNetworkAttachmentPrototype.from_dict(instance_network_attachment_prototype_model_json).__dict__
+ instance_network_attachment_prototype_model2 = InstanceNetworkAttachmentPrototype(**instance_network_attachment_prototype_model_dict)
# Verify the model instances are equivalent
- assert endpoint_gateway_reference_deleted_model == endpoint_gateway_reference_deleted_model2
+ assert instance_network_attachment_prototype_model == instance_network_attachment_prototype_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
+ instance_network_attachment_prototype_model_json2 = instance_network_attachment_prototype_model.to_dict()
+ assert instance_network_attachment_prototype_model_json2 == instance_network_attachment_prototype_model_json
-class TestModel_EndpointGatewayReferenceRemote:
+class TestModel_InstanceNetworkAttachmentReference:
"""
- Test Class for EndpointGatewayReferenceRemote
+ Test Class for InstanceNetworkAttachmentReference
"""
- def test_endpoint_gateway_reference_remote_serialization(self):
+ def test_instance_network_attachment_reference_serialization(self):
"""
- Test serialization/deserialization for EndpointGatewayReferenceRemote
+ Test serialization/deserialization for InstanceNetworkAttachmentReference
"""
# Construct dict forms of any model objects needed in order to build this model.
- account_reference_model = {} # AccountReference
- account_reference_model['id'] = 'aa2432b1fa4d4ace891e9b80fc104e34'
- account_reference_model['resource_type'] = 'account'
+ instance_network_attachment_reference_deleted_model = {} # InstanceNetworkAttachmentReferenceDeleted
+ instance_network_attachment_reference_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'
+ reserved_ip_reference_deleted_model = {} # ReservedIPReferenceDeleted
+ reserved_ip_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- endpoint_gateway_remote_model = {} # EndpointGatewayRemote
- endpoint_gateway_remote_model['account'] = account_reference_model
- endpoint_gateway_remote_model['region'] = region_reference_model
+ reserved_ip_reference_model = {} # ReservedIPReference
+ reserved_ip_reference_model['address'] = '192.168.3.4'
+ reserved_ip_reference_model['deleted'] = reserved_ip_reference_deleted_model
+ reserved_ip_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb'
+ reserved_ip_reference_model['id'] = '6d353a0f-aeb1-4ae1-832e-1110d10981bb'
+ reserved_ip_reference_model['name'] = 'my-reserved-ip'
+ reserved_ip_reference_model['resource_type'] = 'subnet_reserved_ip'
- # Construct a json representation of a EndpointGatewayReferenceRemote model
- endpoint_gateway_reference_remote_model_json = {}
- endpoint_gateway_reference_remote_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5'
- endpoint_gateway_reference_remote_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5'
- endpoint_gateway_reference_remote_model_json['id'] = 'r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5'
- endpoint_gateway_reference_remote_model_json['name'] = 'my-endpoint-gateway'
- endpoint_gateway_reference_remote_model_json['remote'] = endpoint_gateway_remote_model
- endpoint_gateway_reference_remote_model_json['resource_type'] = 'endpoint_gateway'
+ subnet_reference_deleted_model = {} # SubnetReferenceDeleted
+ subnet_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Construct a model instance of EndpointGatewayReferenceRemote by calling from_dict on the json representation
- endpoint_gateway_reference_remote_model = EndpointGatewayReferenceRemote.from_dict(endpoint_gateway_reference_remote_model_json)
- assert endpoint_gateway_reference_remote_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'
+ subnet_reference_model['resource_type'] = 'subnet'
- # Construct a model instance of EndpointGatewayReferenceRemote by calling from_dict on the json representation
- endpoint_gateway_reference_remote_model_dict = EndpointGatewayReferenceRemote.from_dict(endpoint_gateway_reference_remote_model_json).__dict__
- endpoint_gateway_reference_remote_model2 = EndpointGatewayReferenceRemote(**endpoint_gateway_reference_remote_model_dict)
+ # Construct a json representation of a InstanceNetworkAttachmentReference model
+ instance_network_attachment_reference_model_json = {}
+ instance_network_attachment_reference_model_json['deleted'] = instance_network_attachment_reference_deleted_model
+ instance_network_attachment_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/5dd61d72-acaa-47c2-a336-3d849660d010/network_attachments/0767-d54eb633-98ea-459d-aa00-6a8e780175a7'
+ instance_network_attachment_reference_model_json['id'] = '0767-d54eb633-98ea-459d-aa00-6a8e780175a7'
+ instance_network_attachment_reference_model_json['name'] = 'my-instance-network-attachment'
+ instance_network_attachment_reference_model_json['primary_ip'] = reserved_ip_reference_model
+ instance_network_attachment_reference_model_json['resource_type'] = 'instance_network_attachment'
+ instance_network_attachment_reference_model_json['subnet'] = subnet_reference_model
+
+ # Construct a model instance of InstanceNetworkAttachmentReference by calling from_dict on the json representation
+ instance_network_attachment_reference_model = InstanceNetworkAttachmentReference.from_dict(instance_network_attachment_reference_model_json)
+ assert instance_network_attachment_reference_model != False
+
+ # Construct a model instance of InstanceNetworkAttachmentReference by calling from_dict on the json representation
+ instance_network_attachment_reference_model_dict = InstanceNetworkAttachmentReference.from_dict(instance_network_attachment_reference_model_json).__dict__
+ instance_network_attachment_reference_model2 = InstanceNetworkAttachmentReference(**instance_network_attachment_reference_model_dict)
# Verify the model instances are equivalent
- assert endpoint_gateway_reference_remote_model == endpoint_gateway_reference_remote_model2
+ assert instance_network_attachment_reference_model == instance_network_attachment_reference_model2
# Convert model instance back to dict and verify no loss of data
- endpoint_gateway_reference_remote_model_json2 = endpoint_gateway_reference_remote_model.to_dict()
- assert endpoint_gateway_reference_remote_model_json2 == endpoint_gateway_reference_remote_model_json
+ instance_network_attachment_reference_model_json2 = instance_network_attachment_reference_model.to_dict()
+ assert instance_network_attachment_reference_model_json2 == instance_network_attachment_reference_model_json
-class TestModel_EndpointGatewayRemote:
+class TestModel_InstanceNetworkAttachmentReferenceDeleted:
"""
- Test Class for EndpointGatewayRemote
+ Test Class for InstanceNetworkAttachmentReferenceDeleted
"""
- def test_endpoint_gateway_remote_serialization(self):
+ def test_instance_network_attachment_reference_deleted_serialization(self):
"""
- Test serialization/deserialization for EndpointGatewayRemote
+ Test serialization/deserialization for InstanceNetworkAttachmentReferenceDeleted
"""
- # Construct dict forms of any model objects needed in order to build this model.
-
- account_reference_model = {} # AccountReference
- account_reference_model['id'] = 'aa2432b1fa4d4ace891e9b80fc104e34'
- account_reference_model['resource_type'] = 'account'
-
- 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 EndpointGatewayRemote model
- endpoint_gateway_remote_model_json = {}
- endpoint_gateway_remote_model_json['account'] = account_reference_model
- endpoint_gateway_remote_model_json['region'] = region_reference_model
+ # Construct a json representation of a InstanceNetworkAttachmentReferenceDeleted model
+ instance_network_attachment_reference_deleted_model_json = {}
+ instance_network_attachment_reference_deleted_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Construct a model instance of EndpointGatewayRemote by calling from_dict on the json representation
- endpoint_gateway_remote_model = EndpointGatewayRemote.from_dict(endpoint_gateway_remote_model_json)
- assert endpoint_gateway_remote_model != False
+ # Construct a model instance of InstanceNetworkAttachmentReferenceDeleted by calling from_dict on the json representation
+ instance_network_attachment_reference_deleted_model = InstanceNetworkAttachmentReferenceDeleted.from_dict(instance_network_attachment_reference_deleted_model_json)
+ assert instance_network_attachment_reference_deleted_model != False
- # Construct a model instance of EndpointGatewayRemote by calling from_dict on the json representation
- endpoint_gateway_remote_model_dict = EndpointGatewayRemote.from_dict(endpoint_gateway_remote_model_json).__dict__
- endpoint_gateway_remote_model2 = EndpointGatewayRemote(**endpoint_gateway_remote_model_dict)
+ # Construct a model instance of InstanceNetworkAttachmentReferenceDeleted by calling from_dict on the json representation
+ instance_network_attachment_reference_deleted_model_dict = InstanceNetworkAttachmentReferenceDeleted.from_dict(instance_network_attachment_reference_deleted_model_json).__dict__
+ instance_network_attachment_reference_deleted_model2 = InstanceNetworkAttachmentReferenceDeleted(**instance_network_attachment_reference_deleted_model_dict)
# Verify the model instances are equivalent
- assert endpoint_gateway_remote_model == endpoint_gateway_remote_model2
+ assert instance_network_attachment_reference_deleted_model == instance_network_attachment_reference_deleted_model2
# Convert model instance back to dict and verify no loss of data
- endpoint_gateway_remote_model_json2 = endpoint_gateway_remote_model.to_dict()
- assert endpoint_gateway_remote_model_json2 == endpoint_gateway_remote_model_json
+ instance_network_attachment_reference_deleted_model_json2 = instance_network_attachment_reference_deleted_model.to_dict()
+ assert instance_network_attachment_reference_deleted_model_json2 == instance_network_attachment_reference_deleted_model_json
-class TestModel_FloatingIP:
+class TestModel_InstancePatch:
"""
- Test Class for FloatingIP
+ Test Class for InstancePatch
"""
- def test_floating_ip_serialization(self):
+ def test_instance_patch_serialization(self):
"""
- Test serialization/deserialization for FloatingIP
+ Test serialization/deserialization for InstancePatch
"""
# 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'
+ instance_availability_policy_patch_model = {} # InstanceAvailabilityPolicyPatch
+ instance_availability_policy_patch_model['host_failure'] = 'restart'
- network_interface_reference_deleted_model = {} # NetworkInterfaceReferenceDeleted
- network_interface_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ instance_metadata_service_patch_model = {} # InstanceMetadataServicePatch
+ instance_metadata_service_patch_model['enabled'] = True
+ instance_metadata_service_patch_model['protocol'] = 'http'
+ instance_metadata_service_patch_model['response_hop_limit'] = 1
- reserved_ip_reference_deleted_model = {} # ReservedIPReferenceDeleted
- reserved_ip_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ instance_placement_target_patch_model = {} # InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityById
+ instance_placement_target_patch_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
- 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'
+ instance_patch_profile_model = {} # InstancePatchProfileInstanceProfileIdentityByName
+ instance_patch_profile_model['name'] = 'bx2-4x16'
- 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-instance-network-interface'
- floating_ip_target_model['primary_ip'] = reserved_ip_reference_model
- floating_ip_target_model['resource_type'] = 'network_interface'
+ reservation_identity_model = {} # ReservationIdentityById
+ reservation_identity_model['id'] = '7187-ba49df72-37b8-43ac-98da-f8e029de0e63'
- 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_reservation_affinity_patch_model = {} # InstanceReservationAffinityPatch
+ instance_reservation_affinity_patch_model['policy'] = 'disabled'
+ instance_reservation_affinity_patch_model['pool'] = [reservation_identity_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 json representation of a InstancePatch model
+ instance_patch_model_json = {}
+ instance_patch_model_json['availability_policy'] = instance_availability_policy_patch_model
+ instance_patch_model_json['metadata_service'] = instance_metadata_service_patch_model
+ instance_patch_model_json['name'] = 'my-instance'
+ instance_patch_model_json['placement_target'] = instance_placement_target_patch_model
+ instance_patch_model_json['profile'] = instance_patch_profile_model
+ instance_patch_model_json['reservation_affinity'] = instance_reservation_affinity_patch_model
+ instance_patch_model_json['total_volume_bandwidth'] = 500
- # 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 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 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 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 floating_ip_model == floating_ip_model2
+ assert instance_patch_model == instance_patch_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
+ instance_patch_model_json2 = instance_patch_model.to_dict()
+ assert instance_patch_model_json2 == instance_patch_model_json
-class TestModel_FloatingIPCollection:
+class TestModel_InstanceProfile:
"""
- Test Class for FloatingIPCollection
+ Test Class for InstanceProfile
"""
- def test_floating_ip_collection_serialization(self):
+ def test_instance_profile_serialization(self):
"""
- Test serialization/deserialization for FloatingIPCollection
+ Test serialization/deserialization for InstanceProfile
"""
# 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'
+ instance_profile_bandwidth_model = {} # InstanceProfileBandwidthFixed
+ instance_profile_bandwidth_model['type'] = 'fixed'
+ instance_profile_bandwidth_model['value'] = 20000
- 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_disk_quantity_model = {} # InstanceProfileDiskQuantityFixed
+ instance_profile_disk_quantity_model['type'] = 'fixed'
+ instance_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'
+ instance_profile_disk_size_model = {} # InstanceProfileDiskSizeFixed
+ instance_profile_disk_size_model['type'] = 'fixed'
+ instance_profile_disk_size_model['value'] = 100
- reserved_ip_reference_deleted_model = {} # ReservedIPReferenceDeleted
- reserved_ip_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']
- 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'
+ 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
- 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-instance-network-interface'
- floating_ip_target_model['primary_ip'] = reserved_ip_reference_model
- floating_ip_target_model['resource_type'] = 'network_interface'
+ instance_profile_gpu_model = {} # InstanceProfileGPUFixed
+ instance_profile_gpu_model['type'] = 'fixed'
+ instance_profile_gpu_model['value'] = 2
- 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_profile_gpu_manufacturer_model = {} # InstanceProfileGPUManufacturer
+ instance_profile_gpu_manufacturer_model['type'] = 'enum'
+ instance_profile_gpu_manufacturer_model['values'] = ['nvidia']
- 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
+ instance_profile_gpu_memory_model = {} # InstanceProfileGPUMemoryFixed
+ instance_profile_gpu_memory_model['type'] = 'fixed'
+ instance_profile_gpu_memory_model['value'] = 16
- 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'
+ instance_profile_gpu_model_model = {} # InstanceProfileGPUModel
+ instance_profile_gpu_model_model['type'] = 'enum'
+ instance_profile_gpu_model_model['values'] = ['Tesla V100']
- # 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
+ instance_profile_memory_model = {} # InstanceProfileMemoryFixed
+ instance_profile_memory_model['type'] = 'fixed'
+ instance_profile_memory_model['value'] = 16
+
+ instance_profile_network_attachment_count_model = {} # InstanceProfileNetworkAttachmentCountRange
+ instance_profile_network_attachment_count_model['max'] = 5
+ instance_profile_network_attachment_count_model['min'] = 1
+ instance_profile_network_attachment_count_model['type'] = 'range'
+
+ instance_profile_network_interface_count_model = {} # InstanceProfileNetworkInterfaceCountRange
+ instance_profile_network_interface_count_model['max'] = 5
+ instance_profile_network_interface_count_model['min'] = 1
+ instance_profile_network_interface_count_model['type'] = 'range'
+
+ instance_profile_numa_count_model = {} # InstanceProfileNUMACountFixed
+ instance_profile_numa_count_model['type'] = 'fixed'
+ instance_profile_numa_count_model['value'] = 2
+
+ 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_reservation_terms_model = {} # InstanceProfileReservationTerms
+ instance_profile_reservation_terms_model['type'] = 'enum'
+ instance_profile_reservation_terms_model['values'] = ['one_year', 'three_year']
+
+ 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_vcpu_manufacturer_model = {} # InstanceProfileVCPUManufacturer
+ instance_profile_vcpu_manufacturer_model['default'] = 'testString'
+ instance_profile_vcpu_manufacturer_model['type'] = 'fixed'
+ instance_profile_vcpu_manufacturer_model['value'] = 'intel'
+
+ # 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/bx2-4x16'
+ instance_profile_model_json['memory'] = instance_profile_memory_model
+ instance_profile_model_json['name'] = 'bx2-4x16'
+ instance_profile_model_json['network_attachment_count'] = instance_profile_network_attachment_count_model
+ instance_profile_model_json['network_interface_count'] = instance_profile_network_interface_count_model
+ instance_profile_model_json['numa_count'] = instance_profile_numa_count_model
+ 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['reservation_terms'] = instance_profile_reservation_terms_model
+ instance_profile_model_json['resource_type'] = 'instance_profile'
+ instance_profile_model_json['status'] = 'current'
+ 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
+ instance_profile_model_json['vcpu_manufacturer'] = instance_profile_vcpu_manufacturer_model
- # 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 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 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 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 floating_ip_collection_model == floating_ip_collection_model2
+ assert instance_profile_model == instance_profile_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
+ instance_profile_model_json2 = instance_profile_model.to_dict()
+ assert instance_profile_model_json2 == instance_profile_model_json
-class TestModel_FloatingIPCollectionFirst:
+class TestModel_InstanceProfileCollection:
"""
- Test Class for FloatingIPCollectionFirst
+ Test Class for InstanceProfileCollection
"""
- def test_floating_ip_collection_first_serialization(self):
+ def test_instance_profile_collection_serialization(self):
"""
- Test serialization/deserialization for FloatingIPCollectionFirst
+ Test serialization/deserialization for InstanceProfileCollection
"""
- # 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 dict forms of any model objects needed in order to build this model.
- # 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
+ instance_profile_bandwidth_model = {} # InstanceProfileBandwidthFixed
+ instance_profile_bandwidth_model['type'] = 'fixed'
+ instance_profile_bandwidth_model['value'] = 20000
- # 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)
+ instance_profile_disk_quantity_model = {} # InstanceProfileDiskQuantityFixed
+ instance_profile_disk_quantity_model['type'] = 'fixed'
+ instance_profile_disk_quantity_model['value'] = 4
- # Verify the model instances are equivalent
- assert floating_ip_collection_first_model == floating_ip_collection_first_model2
+ instance_profile_disk_size_model = {} # InstanceProfileDiskSizeFixed
+ instance_profile_disk_size_model['type'] = 'fixed'
+ instance_profile_disk_size_model['value'] = 100
- # 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
+ 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']
+ 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
-class TestModel_FloatingIPCollectionNext:
- """
- Test Class for FloatingIPCollectionNext
- """
+ instance_profile_gpu_model = {} # InstanceProfileGPUFixed
+ instance_profile_gpu_model['type'] = 'fixed'
+ instance_profile_gpu_model['value'] = 2
- def test_floating_ip_collection_next_serialization(self):
- """
- Test serialization/deserialization for FloatingIPCollectionNext
- """
+ instance_profile_gpu_manufacturer_model = {} # InstanceProfileGPUManufacturer
+ instance_profile_gpu_manufacturer_model['type'] = 'enum'
+ instance_profile_gpu_manufacturer_model['values'] = ['nvidia']
- # 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'
+ instance_profile_gpu_memory_model = {} # InstanceProfileGPUMemoryFixed
+ instance_profile_gpu_memory_model['type'] = 'fixed'
+ instance_profile_gpu_memory_model['value'] = 16
- # 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
+ 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 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)
+ instance_profile_memory_model = {} # InstanceProfileMemoryFixed
+ instance_profile_memory_model['type'] = 'fixed'
+ instance_profile_memory_model['value'] = 16
- # Verify the model instances are equivalent
- assert floating_ip_collection_next_model == floating_ip_collection_next_model2
+ instance_profile_network_attachment_count_model = {} # InstanceProfileNetworkAttachmentCountRange
+ instance_profile_network_attachment_count_model['max'] = 5
+ instance_profile_network_attachment_count_model['min'] = 1
+ instance_profile_network_attachment_count_model['type'] = 'range'
- # 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
+ instance_profile_network_interface_count_model = {} # InstanceProfileNetworkInterfaceCountRange
+ instance_profile_network_interface_count_model['max'] = 5
+ instance_profile_network_interface_count_model['min'] = 1
+ instance_profile_network_interface_count_model['type'] = 'range'
+ instance_profile_numa_count_model = {} # InstanceProfileNUMACountFixed
+ instance_profile_numa_count_model['type'] = 'fixed'
+ instance_profile_numa_count_model['value'] = 2
-class TestModel_FloatingIPPatch:
- """
- Test Class for FloatingIPPatch
- """
+ 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']
- def test_floating_ip_patch_serialization(self):
- """
- Test serialization/deserialization for FloatingIPPatch
- """
+ instance_profile_port_speed_model = {} # InstanceProfilePortSpeedFixed
+ instance_profile_port_speed_model['type'] = 'fixed'
+ instance_profile_port_speed_model['value'] = 1000
- # Construct dict forms of any model objects needed in order to build this model.
+ instance_profile_reservation_terms_model = {} # InstanceProfileReservationTerms
+ instance_profile_reservation_terms_model['type'] = 'enum'
+ instance_profile_reservation_terms_model['values'] = ['one_year', 'three_year']
- floating_ip_target_patch_model = {} # FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityById
- floating_ip_target_patch_model['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e'
+ instance_profile_volume_bandwidth_model = {} # InstanceProfileVolumeBandwidthFixed
+ instance_profile_volume_bandwidth_model['type'] = 'fixed'
+ instance_profile_volume_bandwidth_model['value'] = 20000
- # 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
+ 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'
- # 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
+ instance_profile_vcpu_model = {} # InstanceProfileVCPUFixed
+ instance_profile_vcpu_model['type'] = 'fixed'
+ instance_profile_vcpu_model['value'] = 16
- # 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)
+ instance_profile_vcpu_manufacturer_model = {} # InstanceProfileVCPUManufacturer
+ instance_profile_vcpu_manufacturer_model['default'] = 'testString'
+ instance_profile_vcpu_manufacturer_model['type'] = 'fixed'
+ instance_profile_vcpu_manufacturer_model['value'] = 'intel'
+
+ 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/bx2-4x16'
+ instance_profile_model['memory'] = instance_profile_memory_model
+ instance_profile_model['name'] = 'bx2-4x16'
+ instance_profile_model['network_attachment_count'] = instance_profile_network_attachment_count_model
+ instance_profile_model['network_interface_count'] = instance_profile_network_interface_count_model
+ instance_profile_model['numa_count'] = instance_profile_numa_count_model
+ instance_profile_model['os_architecture'] = instance_profile_os_architecture_model
+ instance_profile_model['port_speed'] = instance_profile_port_speed_model
+ instance_profile_model['reservation_terms'] = instance_profile_reservation_terms_model
+ instance_profile_model['resource_type'] = 'instance_profile'
+ instance_profile_model['status'] = 'current'
+ 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
+ instance_profile_model['vcpu_manufacturer'] = instance_profile_vcpu_manufacturer_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 floating_ip_patch_model == floating_ip_patch_model2
+ assert instance_profile_collection_model == instance_profile_collection_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
+ instance_profile_collection_model_json2 = instance_profile_collection_model.to_dict()
+ assert instance_profile_collection_model_json2 == instance_profile_collection_model_json
-class TestModel_FloatingIPReference:
+class TestModel_InstanceProfileDisk:
"""
- Test Class for FloatingIPReference
+ Test Class for InstanceProfileDisk
"""
- def test_floating_ip_reference_serialization(self):
+ def test_instance_profile_disk_serialization(self):
"""
- Test serialization/deserialization for FloatingIPReference
+ Test serialization/deserialization for InstanceProfileDisk
"""
# 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'
+ instance_profile_disk_quantity_model = {} # InstanceProfileDiskQuantityFixed
+ instance_profile_disk_quantity_model['type'] = 'fixed'
+ instance_profile_disk_quantity_model['value'] = 4
- # 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'
+ 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 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
+ 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 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)
+ # 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 floating_ip_reference_model == floating_ip_reference_model2
+ assert instance_profile_disk_model == instance_profile_disk_model2
# 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
+ instance_profile_disk_model_json2 = instance_profile_disk_model.to_dict()
+ assert instance_profile_disk_model_json2 == instance_profile_disk_model_json
-class TestModel_FloatingIPReferenceDeleted:
+class TestModel_InstanceProfileDiskSupportedInterfaces:
"""
- Test Class for FloatingIPReferenceDeleted
+ Test Class for InstanceProfileDiskSupportedInterfaces
"""
- def test_floating_ip_reference_deleted_serialization(self):
+ def test_instance_profile_disk_supported_interfaces_serialization(self):
"""
- Test serialization/deserialization for FloatingIPReferenceDeleted
+ Test serialization/deserialization for InstanceProfileDiskSupportedInterfaces
"""
- # 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 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 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 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 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 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 floating_ip_reference_deleted_model == floating_ip_reference_deleted_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
- 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
+ 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_FloatingIPUnpaginatedCollection:
+class TestModel_InstanceProfileGPUManufacturer:
"""
- Test Class for FloatingIPUnpaginatedCollection
+ Test Class for InstanceProfileGPUManufacturer
"""
- def test_floating_ip_unpaginated_collection_serialization(self):
+ def test_instance_profile_gpu_manufacturer_serialization(self):
"""
- Test serialization/deserialization for FloatingIPUnpaginatedCollection
+ Test serialization/deserialization for InstanceProfileGPUManufacturer
"""
- # 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_interface_reference_deleted_model = {} # NetworkInterfaceReferenceDeleted
- network_interface_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
-
- reserved_ip_reference_deleted_model = {} # ReservedIPReferenceDeleted
- reserved_ip_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
-
- reserved_ip_reference_model = {} # ReservedIPReference
- reserved_ip_reference_model['address'] = '192.168.3.4'
- reserved_ip_reference_model['deleted'] = reserved_ip_reference_deleted_model
- reserved_ip_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb'
- reserved_ip_reference_model['id'] = '6d353a0f-aeb1-4ae1-832e-1110d10981bb'
- reserved_ip_reference_model['name'] = 'my-reserved-ip'
- reserved_ip_reference_model['resource_type'] = 'subnet_reserved_ip'
-
- floating_ip_target_model = {} # FloatingIPTargetNetworkInterfaceReference
- floating_ip_target_model['deleted'] = network_interface_reference_deleted_model
- floating_ip_target_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e'
- floating_ip_target_model['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e'
- floating_ip_target_model['name'] = 'my-instance-network-interface'
- floating_ip_target_model['primary_ip'] = reserved_ip_reference_model
- 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
-
- # 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 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 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 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 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 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 floating_ip_unpaginated_collection_model == floating_ip_unpaginated_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
- 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
+ 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_FlowLogCollector:
+class TestModel_InstanceProfileGPUModel:
"""
- Test Class for FlowLogCollector
+ Test Class for InstanceProfileGPUModel
"""
- def test_flow_log_collector_serialization(self):
+ def test_instance_profile_gpu_model_serialization(self):
"""
- Test serialization/deserialization for FlowLogCollector
+ Test serialization/deserialization for InstanceProfileGPUModel
"""
- # 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'
-
- legacy_cloud_object_storage_bucket_reference_model = {} # LegacyCloudObjectStorageBucketReference
- legacy_cloud_object_storage_bucket_reference_model['name'] = 'bucket-27200-lwx4cfvcue'
-
- network_interface_reference_target_context_deleted_model = {} # NetworkInterfaceReferenceTargetContextDeleted
- network_interface_reference_target_context_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
-
- 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-instance-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'
- vpc_reference_model['resource_type'] = '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'] = legacy_cloud_object_storage_bucket_reference_model
- flow_log_collector_model_json['target'] = flow_log_collector_target_model
- flow_log_collector_model_json['vpc'] = vpc_reference_model
+ # 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 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 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 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 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 flow_log_collector_model == flow_log_collector_model2
+ assert instance_profile_gpu_model_model == instance_profile_gpu_model_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
+ 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_FlowLogCollectorCollection:
+class TestModel_InstanceProfileOSArchitecture:
"""
- Test Class for FlowLogCollectorCollection
+ Test Class for InstanceProfileOSArchitecture
"""
- def test_flow_log_collector_collection_serialization(self):
+ def test_instance_profile_os_architecture_serialization(self):
"""
- Test serialization/deserialization for FlowLogCollectorCollection
+ Test serialization/deserialization for InstanceProfileOSArchitecture
"""
- # 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'
-
- legacy_cloud_object_storage_bucket_reference_model = {} # LegacyCloudObjectStorageBucketReference
- legacy_cloud_object_storage_bucket_reference_model['name'] = 'bucket-27200-lwx4cfvcue'
-
- network_interface_reference_target_context_deleted_model = {} # NetworkInterfaceReferenceTargetContextDeleted
- network_interface_reference_target_context_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
-
- 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-instance-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'
- vpc_reference_model['resource_type'] = 'vpc'
-
- 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'] = legacy_cloud_object_storage_bucket_reference_model
- flow_log_collector_model['target'] = flow_log_collector_target_model
- flow_log_collector_model['vpc'] = vpc_reference_model
-
- 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 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 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 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 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 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 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 flow_log_collector_collection_model == flow_log_collector_collection_model2
+ assert instance_profile_os_architecture_model == instance_profile_os_architecture_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
+ 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_FlowLogCollectorCollectionFirst:
+class TestModel_InstanceProfileReference:
"""
- Test Class for FlowLogCollectorCollectionFirst
+ Test Class for InstanceProfileReference
"""
- def test_flow_log_collector_collection_first_serialization(self):
+ def test_instance_profile_reference_serialization(self):
"""
- Test serialization/deserialization for FlowLogCollectorCollectionFirst
+ Test serialization/deserialization for InstanceProfileReference
"""
- # 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 InstanceProfileReference model
+ instance_profile_reference_model_json = {}
+ instance_profile_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16'
+ instance_profile_reference_model_json['name'] = 'bx2-4x16'
+ instance_profile_reference_model_json['resource_type'] = 'instance_profile'
- # 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 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 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 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 flow_log_collector_collection_first_model == flow_log_collector_collection_first_model2
+ assert instance_profile_reference_model == instance_profile_reference_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
+ instance_profile_reference_model_json2 = instance_profile_reference_model.to_dict()
+ assert instance_profile_reference_model_json2 == instance_profile_reference_model_json
-class TestModel_FlowLogCollectorCollectionNext:
+class TestModel_InstanceProfileReservationTerms:
"""
- Test Class for FlowLogCollectorCollectionNext
+ Test Class for InstanceProfileReservationTerms
"""
- def test_flow_log_collector_collection_next_serialization(self):
+ def test_instance_profile_reservation_terms_serialization(self):
"""
- Test serialization/deserialization for FlowLogCollectorCollectionNext
+ Test serialization/deserialization for InstanceProfileReservationTerms
"""
- # 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 InstanceProfileReservationTerms model
+ instance_profile_reservation_terms_model_json = {}
+ instance_profile_reservation_terms_model_json['type'] = 'enum'
+ instance_profile_reservation_terms_model_json['values'] = ['one_year', 'three_year']
- # 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 InstanceProfileReservationTerms by calling from_dict on the json representation
+ instance_profile_reservation_terms_model = InstanceProfileReservationTerms.from_dict(instance_profile_reservation_terms_model_json)
+ assert instance_profile_reservation_terms_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 InstanceProfileReservationTerms by calling from_dict on the json representation
+ instance_profile_reservation_terms_model_dict = InstanceProfileReservationTerms.from_dict(instance_profile_reservation_terms_model_json).__dict__
+ instance_profile_reservation_terms_model2 = InstanceProfileReservationTerms(**instance_profile_reservation_terms_model_dict)
# Verify the model instances are equivalent
- assert flow_log_collector_collection_next_model == flow_log_collector_collection_next_model2
+ assert instance_profile_reservation_terms_model == instance_profile_reservation_terms_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
+ instance_profile_reservation_terms_model_json2 = instance_profile_reservation_terms_model.to_dict()
+ assert instance_profile_reservation_terms_model_json2 == instance_profile_reservation_terms_model_json
-class TestModel_FlowLogCollectorPatch:
+class TestModel_InstanceProfileVCPUArchitecture:
"""
- Test Class for FlowLogCollectorPatch
+ Test Class for InstanceProfileVCPUArchitecture
"""
- def test_flow_log_collector_patch_serialization(self):
+ def test_instance_profile_vcpu_architecture_serialization(self):
"""
- Test serialization/deserialization for FlowLogCollectorPatch
+ Test serialization/deserialization for InstanceProfileVCPUArchitecture
"""
- # 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 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 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 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 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 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 flow_log_collector_patch_model == flow_log_collector_patch_model2
+ assert instance_profile_vcpu_architecture_model == instance_profile_vcpu_architecture_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
+ 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_GenericResourceReferenceDeleted:
+class TestModel_InstanceProfileVCPUManufacturer:
"""
- Test Class for GenericResourceReferenceDeleted
+ Test Class for InstanceProfileVCPUManufacturer
"""
- def test_generic_resource_reference_deleted_serialization(self):
+ def test_instance_profile_vcpu_manufacturer_serialization(self):
"""
- Test serialization/deserialization for GenericResourceReferenceDeleted
+ Test serialization/deserialization for InstanceProfileVCPUManufacturer
"""
- # Construct a json representation of a GenericResourceReferenceDeleted model
- generic_resource_reference_deleted_model_json = {}
- generic_resource_reference_deleted_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ # Construct a json representation of a InstanceProfileVCPUManufacturer model
+ instance_profile_vcpu_manufacturer_model_json = {}
+ instance_profile_vcpu_manufacturer_model_json['default'] = 'testString'
+ instance_profile_vcpu_manufacturer_model_json['type'] = 'fixed'
+ instance_profile_vcpu_manufacturer_model_json['value'] = 'intel'
- # Construct a model instance of GenericResourceReferenceDeleted by calling from_dict on the json representation
- generic_resource_reference_deleted_model = GenericResourceReferenceDeleted.from_dict(generic_resource_reference_deleted_model_json)
- assert generic_resource_reference_deleted_model != False
+ # Construct a model instance of InstanceProfileVCPUManufacturer by calling from_dict on the json representation
+ instance_profile_vcpu_manufacturer_model = InstanceProfileVCPUManufacturer.from_dict(instance_profile_vcpu_manufacturer_model_json)
+ assert instance_profile_vcpu_manufacturer_model != False
- # Construct a model instance of GenericResourceReferenceDeleted by calling from_dict on the json representation
- generic_resource_reference_deleted_model_dict = GenericResourceReferenceDeleted.from_dict(generic_resource_reference_deleted_model_json).__dict__
- generic_resource_reference_deleted_model2 = GenericResourceReferenceDeleted(**generic_resource_reference_deleted_model_dict)
+ # Construct a model instance of InstanceProfileVCPUManufacturer by calling from_dict on the json representation
+ instance_profile_vcpu_manufacturer_model_dict = InstanceProfileVCPUManufacturer.from_dict(instance_profile_vcpu_manufacturer_model_json).__dict__
+ instance_profile_vcpu_manufacturer_model2 = InstanceProfileVCPUManufacturer(**instance_profile_vcpu_manufacturer_model_dict)
# Verify the model instances are equivalent
- assert generic_resource_reference_deleted_model == generic_resource_reference_deleted_model2
+ assert instance_profile_vcpu_manufacturer_model == instance_profile_vcpu_manufacturer_model2
# Convert model instance back to dict and verify no loss of data
- generic_resource_reference_deleted_model_json2 = generic_resource_reference_deleted_model.to_dict()
- assert generic_resource_reference_deleted_model_json2 == generic_resource_reference_deleted_model_json
+ instance_profile_vcpu_manufacturer_model_json2 = instance_profile_vcpu_manufacturer_model.to_dict()
+ assert instance_profile_vcpu_manufacturer_model_json2 == instance_profile_vcpu_manufacturer_model_json
-class TestModel_IKEPolicy:
+class TestModel_InstanceReference:
"""
- Test Class for IKEPolicy
+ Test Class for InstanceReference
"""
- def test_ike_policy_serialization(self):
+ def test_instance_reference_serialization(self):
"""
- Test serialization/deserialization for IKEPolicy
+ Test serialization/deserialization for InstanceReference
"""
# 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'
+ 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 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 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 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 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 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)
+ # 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 ike_policy_model == ike_policy_model2
+ assert instance_reference_model == instance_reference_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
+ instance_reference_model_json2 = instance_reference_model.to_dict()
+ assert instance_reference_model_json2 == instance_reference_model_json
-class TestModel_IKEPolicyCollection:
+class TestModel_InstanceReferenceDeleted:
"""
- Test Class for IKEPolicyCollection
+ Test Class for InstanceReferenceDeleted
"""
- def test_ike_policy_collection_serialization(self):
+ def test_instance_reference_deleted_serialization(self):
"""
- Test serialization/deserialization for IKEPolicyCollection
+ Test serialization/deserialization for InstanceReferenceDeleted
"""
- # Construct dict forms of any model objects needed in order to build this model.
+ # 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'
- ike_policy_collection_first_model = {} # IKEPolicyCollectionFirst
- ike_policy_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/ike_policies?limit=20'
+ # 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
- 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 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)
- 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_reference_deleted_model == instance_reference_deleted_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_reference_deleted_model_json2 = instance_reference_deleted_model.to_dict()
+ assert instance_reference_deleted_model_json2 == instance_reference_deleted_model_json
- 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'
- 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'
+class TestModel_InstanceReservationAffinity:
+ """
+ Test Class for InstanceReservationAffinity
+ """
- # 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
+ def test_instance_reservation_affinity_serialization(self):
+ """
+ Test serialization/deserialization for InstanceReservationAffinity
+ """
- # 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 dict forms of any model objects needed in order to build this model.
- # 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)
+ reservation_reference_deleted_model = {} # ReservationReferenceDeleted
+ reservation_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+
+ reservation_reference_model = {} # ReservationReference
+ reservation_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::reservation:7187-ba49df72-37b8-43ac-98da-f8e029de0e63'
+ reservation_reference_model['deleted'] = reservation_reference_deleted_model
+ reservation_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/reservations/7187-ba49df72-37b8-43ac-98da-f8e029de0e63'
+ reservation_reference_model['id'] = '7187-ba49df72-37b8-43ac-98da-f8e029de0e63'
+ reservation_reference_model['name'] = 'my-reservation'
+ reservation_reference_model['resource_type'] = 'reservation'
+
+ # Construct a json representation of a InstanceReservationAffinity model
+ instance_reservation_affinity_model_json = {}
+ instance_reservation_affinity_model_json['policy'] = 'disabled'
+ instance_reservation_affinity_model_json['pool'] = [reservation_reference_model]
+
+ # Construct a model instance of InstanceReservationAffinity by calling from_dict on the json representation
+ instance_reservation_affinity_model = InstanceReservationAffinity.from_dict(instance_reservation_affinity_model_json)
+ assert instance_reservation_affinity_model != False
+
+ # Construct a model instance of InstanceReservationAffinity by calling from_dict on the json representation
+ instance_reservation_affinity_model_dict = InstanceReservationAffinity.from_dict(instance_reservation_affinity_model_json).__dict__
+ instance_reservation_affinity_model2 = InstanceReservationAffinity(**instance_reservation_affinity_model_dict)
# Verify the model instances are equivalent
- assert ike_policy_collection_model == ike_policy_collection_model2
+ assert instance_reservation_affinity_model == instance_reservation_affinity_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_reservation_affinity_model_json2 = instance_reservation_affinity_model.to_dict()
+ assert instance_reservation_affinity_model_json2 == instance_reservation_affinity_model_json
-class TestModel_IKEPolicyCollectionFirst:
+class TestModel_InstanceReservationAffinityPatch:
"""
- Test Class for IKEPolicyCollectionFirst
+ Test Class for InstanceReservationAffinityPatch
"""
- def test_ike_policy_collection_first_serialization(self):
+ def test_instance_reservation_affinity_patch_serialization(self):
"""
- Test serialization/deserialization for IKEPolicyCollectionFirst
+ Test serialization/deserialization for InstanceReservationAffinityPatch
"""
- # 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 dict forms of any model objects needed in order to build this model.
- # 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
+ reservation_identity_model = {} # ReservationIdentityById
+ reservation_identity_model['id'] = '7187-ba49df72-37b8-43ac-98da-f8e029de0e63'
- # 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 json representation of a InstanceReservationAffinityPatch model
+ instance_reservation_affinity_patch_model_json = {}
+ instance_reservation_affinity_patch_model_json['policy'] = 'disabled'
+ instance_reservation_affinity_patch_model_json['pool'] = [reservation_identity_model]
+
+ # Construct a model instance of InstanceReservationAffinityPatch by calling from_dict on the json representation
+ instance_reservation_affinity_patch_model = InstanceReservationAffinityPatch.from_dict(instance_reservation_affinity_patch_model_json)
+ assert instance_reservation_affinity_patch_model != False
+
+ # Construct a model instance of InstanceReservationAffinityPatch by calling from_dict on the json representation
+ instance_reservation_affinity_patch_model_dict = InstanceReservationAffinityPatch.from_dict(instance_reservation_affinity_patch_model_json).__dict__
+ instance_reservation_affinity_patch_model2 = InstanceReservationAffinityPatch(**instance_reservation_affinity_patch_model_dict)
# Verify the model instances are equivalent
- assert ike_policy_collection_first_model == ike_policy_collection_first_model2
+ assert instance_reservation_affinity_patch_model == instance_reservation_affinity_patch_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_reservation_affinity_patch_model_json2 = instance_reservation_affinity_patch_model.to_dict()
+ assert instance_reservation_affinity_patch_model_json2 == instance_reservation_affinity_patch_model_json
-class TestModel_IKEPolicyCollectionNext:
+class TestModel_InstanceReservationAffinityPrototype:
"""
- Test Class for IKEPolicyCollectionNext
+ Test Class for InstanceReservationAffinityPrototype
"""
- def test_ike_policy_collection_next_serialization(self):
+ def test_instance_reservation_affinity_prototype_serialization(self):
"""
- Test serialization/deserialization for IKEPolicyCollectionNext
+ Test serialization/deserialization for InstanceReservationAffinityPrototype
"""
- # 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
+ reservation_identity_model = {} # ReservationIdentityById
+ reservation_identity_model['id'] = '7187-ba49df72-37b8-43ac-98da-f8e029de0e63'
- # 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 InstanceReservationAffinityPrototype model
+ instance_reservation_affinity_prototype_model_json = {}
+ instance_reservation_affinity_prototype_model_json['policy'] = 'disabled'
+ instance_reservation_affinity_prototype_model_json['pool'] = [reservation_identity_model]
+
+ # Construct a model instance of InstanceReservationAffinityPrototype by calling from_dict on the json representation
+ instance_reservation_affinity_prototype_model = InstanceReservationAffinityPrototype.from_dict(instance_reservation_affinity_prototype_model_json)
+ assert instance_reservation_affinity_prototype_model != False
+
+ # Construct a model instance of InstanceReservationAffinityPrototype by calling from_dict on the json representation
+ instance_reservation_affinity_prototype_model_dict = InstanceReservationAffinityPrototype.from_dict(instance_reservation_affinity_prototype_model_json).__dict__
+ instance_reservation_affinity_prototype_model2 = InstanceReservationAffinityPrototype(**instance_reservation_affinity_prototype_model_dict)
# Verify the model instances are equivalent
- assert ike_policy_collection_next_model == ike_policy_collection_next_model2
+ assert instance_reservation_affinity_prototype_model == instance_reservation_affinity_prototype_model2
# 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
+ instance_reservation_affinity_prototype_model_json2 = instance_reservation_affinity_prototype_model.to_dict()
+ assert instance_reservation_affinity_prototype_model_json2 == instance_reservation_affinity_prototype_model_json
-class TestModel_IKEPolicyPatch:
+class TestModel_InstanceStatusReason:
"""
- Test Class for IKEPolicyPatch
+ Test Class for InstanceStatusReason
"""
- def test_ike_policy_patch_serialization(self):
+ def test_instance_status_reason_serialization(self):
"""
- Test serialization/deserialization for IKEPolicyPatch
+ Test serialization/deserialization for InstanceStatusReason
"""
- # Construct a json representation of a IKEPolicyPatch model
- ike_policy_patch_model_json = {}
- ike_policy_patch_model_json['authentication_algorithm'] = 'sha256'
- 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 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 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 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 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)
+ # 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 ike_policy_patch_model == ike_policy_patch_model2
+ assert instance_status_reason_model == instance_status_reason_model2
# 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
+ instance_status_reason_model_json2 = instance_status_reason_model.to_dict()
+ assert instance_status_reason_model_json2 == instance_status_reason_model_json
-class TestModel_IKEPolicyReference:
+class TestModel_InstanceTemplateCollection:
"""
- Test Class for IKEPolicyReference
+ Test Class for InstanceTemplateCollection
"""
- def test_ike_policy_reference_serialization(self):
+ def test_instance_template_collection_serialization(self):
"""
- Test serialization/deserialization for IKEPolicyReference
+ Test serialization/deserialization for InstanceTemplateCollection
"""
# Construct dict forms of any model objects needed in order to build this model.
- ike_policy_reference_deleted_model = {} # IKEPolicyReferenceDeleted
- ike_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 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'
+ instance_template_collection_next_model = {} # InstanceTemplateCollectionNext
+ instance_template_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/templates?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
+
+ instance_availability_policy_prototype_model = {} # InstanceAvailabilityPolicyPrototype
+ instance_availability_policy_prototype_model['host_failure'] = 'restart'
+
+ trusted_profile_identity_model = {} # TrustedProfileIdentityTrustedProfileById
+ trusted_profile_identity_model['id'] = 'Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5'
+
+ instance_default_trusted_profile_prototype_model = {} # InstanceDefaultTrustedProfilePrototype
+ instance_default_trusted_profile_prototype_model['auto_link'] = False
+ instance_default_trusted_profile_prototype_model['target'] = trusted_profile_identity_model
+
+ key_identity_model = {} # KeyIdentityById
+ key_identity_model['id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803'
+
+ instance_metadata_service_prototype_model = {} # InstanceMetadataServicePrototype
+ instance_metadata_service_prototype_model['enabled'] = False
+ instance_metadata_service_prototype_model['protocol'] = 'https'
+ instance_metadata_service_prototype_model['response_hop_limit'] = 2
+
+ instance_placement_target_prototype_model = {} # InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById
+ instance_placement_target_prototype_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
+
+ instance_profile_identity_model = {} # InstanceProfileIdentityByName
+ instance_profile_identity_model['name'] = 'cx2-16x32'
+
+ reservation_identity_model = {} # ReservationIdentityById
+ reservation_identity_model['id'] = '7187-ba49df72-37b8-43ac-98da-f8e029de0e63'
+
+ instance_reservation_affinity_prototype_model = {} # InstanceReservationAffinityPrototype
+ instance_reservation_affinity_prototype_model['policy'] = 'disabled'
+ instance_reservation_affinity_prototype_model['pool'] = [reservation_identity_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'
+
+ volume_attachment_prototype_volume_model = {} # VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById
+ volume_attachment_prototype_volume_model['id'] = '1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
+
+ volume_attachment_prototype_model = {} # VolumeAttachmentPrototype
+ volume_attachment_prototype_model['delete_volume_on_instance_delete'] = False
+ volume_attachment_prototype_model['name'] = 'my-volume-attachment'
+ volume_attachment_prototype_model['volume'] = volume_attachment_prototype_volume_model
+
+ vpc_identity_model = {} # VPCIdentityById
+ vpc_identity_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b'
+
+ encryption_key_identity_model = {} # EncryptionKeyIdentityByCRN
+ encryption_key_identity_model['crn'] = 'crn:v1:bluemix:public:kms:us-south:a/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179'
+
+ volume_profile_identity_model = {} # VolumeProfileIdentityByName
+ volume_profile_identity_model['name'] = 'general-purpose'
+
+ resource_group_identity_model = {} # ResourceGroupIdentityById
+ resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
+
+ volume_prototype_instance_by_image_context_model = {} # VolumePrototypeInstanceByImageContext
+ volume_prototype_instance_by_image_context_model['capacity'] = 100
+ volume_prototype_instance_by_image_context_model['encryption_key'] = encryption_key_identity_model
+ volume_prototype_instance_by_image_context_model['iops'] = 10000
+ volume_prototype_instance_by_image_context_model['name'] = 'my-volume'
+ volume_prototype_instance_by_image_context_model['profile'] = volume_profile_identity_model
+ volume_prototype_instance_by_image_context_model['resource_group'] = resource_group_identity_model
+ volume_prototype_instance_by_image_context_model['user_tags'] = []
+
+ volume_attachment_prototype_instance_by_image_context_model = {} # VolumeAttachmentPrototypeInstanceByImageContext
+ volume_attachment_prototype_instance_by_image_context_model['delete_volume_on_instance_delete'] = True
+ volume_attachment_prototype_instance_by_image_context_model['name'] = 'my-volume-attachment'
+ volume_attachment_prototype_instance_by_image_context_model['volume'] = volume_prototype_instance_by_image_context_model
+
+ image_identity_model = {} # ImageIdentityById
+ image_identity_model['id'] = 'r006-02c73baf-9abb-493d-9e41-d0f1866f4051'
+
+ zone_identity_model = {} # ZoneIdentityByName
+ zone_identity_model['name'] = 'us-south-1'
+
+ virtual_network_interface_ip_prototype_model = {} # VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext
+ virtual_network_interface_ip_prototype_model['address'] = '10.0.0.5'
+ virtual_network_interface_ip_prototype_model['auto_delete'] = False
+ virtual_network_interface_ip_prototype_model['name'] = 'my-reserved-ip'
+
+ virtual_network_interface_primary_ip_prototype_model = {} # VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext
+ virtual_network_interface_primary_ip_prototype_model['address'] = '10.0.0.5'
+ virtual_network_interface_primary_ip_prototype_model['auto_delete'] = False
+ virtual_network_interface_primary_ip_prototype_model['name'] = 'my-reserved-ip'
+
+ 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'
+
+ instance_network_attachment_prototype_virtual_network_interface_model = {} # InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeInstanceNetworkAttachmentContext
+ instance_network_attachment_prototype_virtual_network_interface_model['allow_ip_spoofing'] = True
+ instance_network_attachment_prototype_virtual_network_interface_model['auto_delete'] = False
+ instance_network_attachment_prototype_virtual_network_interface_model['enable_infrastructure_nat'] = True
+ instance_network_attachment_prototype_virtual_network_interface_model['ips'] = [virtual_network_interface_ip_prototype_model]
+ instance_network_attachment_prototype_virtual_network_interface_model['name'] = 'my-virtual-network-interface'
+ instance_network_attachment_prototype_virtual_network_interface_model['primary_ip'] = virtual_network_interface_primary_ip_prototype_model
+ instance_network_attachment_prototype_virtual_network_interface_model['resource_group'] = resource_group_identity_model
+ instance_network_attachment_prototype_virtual_network_interface_model['security_groups'] = [security_group_identity_model]
+ instance_network_attachment_prototype_virtual_network_interface_model['subnet'] = subnet_identity_model
+
+ instance_network_attachment_prototype_model = {} # InstanceNetworkAttachmentPrototype
+ instance_network_attachment_prototype_model['name'] = 'my-instance-network-attachment'
+ instance_network_attachment_prototype_model['virtual_network_interface'] = instance_network_attachment_prototype_virtual_network_interface_model
+
+ instance_template_model = {} # InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkAttachment
+ instance_template_model['availability_policy'] = instance_availability_policy_prototype_model
+ instance_template_model['created_at'] = '2019-01-01T12:00:00Z'
+ instance_template_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a'
+ instance_template_model['default_trusted_profile'] = instance_default_trusted_profile_prototype_model
+ instance_template_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a'
+ instance_template_model['id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803'
+ instance_template_model['keys'] = [key_identity_model]
+ instance_template_model['metadata_service'] = instance_metadata_service_prototype_model
+ instance_template_model['name'] = 'my-instance-template'
+ instance_template_model['placement_target'] = instance_placement_target_prototype_model
+ instance_template_model['profile'] = instance_profile_identity_model
+ instance_template_model['reservation_affinity'] = instance_reservation_affinity_prototype_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_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['zone'] = zone_identity_model
+ instance_template_model['network_attachments'] = [instance_network_attachment_prototype_model]
+ instance_template_model['primary_network_attachment'] = instance_network_attachment_prototype_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 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 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_template_collection_model == instance_template_collection_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
+
+
+class TestModel_InstanceTemplateCollectionFirst:
+ """
+ Test Class for InstanceTemplateCollectionFirst
+ """
+
+ def test_instance_template_collection_first_serialization(self):
+ """
+ Test serialization/deserialization for InstanceTemplateCollectionFirst
+ """
+
+ # 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 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 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 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)
+ # 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 ike_policy_reference_model == ike_policy_reference_model2
+ assert instance_template_collection_first_model == instance_template_collection_first_model2
# 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
+ 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_IKEPolicyReferenceDeleted:
+class TestModel_InstanceTemplateCollectionNext:
"""
- Test Class for IKEPolicyReferenceDeleted
+ Test Class for InstanceTemplateCollectionNext
"""
- def test_ike_policy_reference_deleted_serialization(self):
+ def test_instance_template_collection_next_serialization(self):
"""
- Test serialization/deserialization for IKEPolicyReferenceDeleted
+ Test serialization/deserialization for InstanceTemplateCollectionNext
"""
- # 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 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 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 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 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)
+ # 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 ike_policy_reference_deleted_model == ike_policy_reference_deleted_model2
+ assert instance_template_collection_next_model == instance_template_collection_next_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_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_IP:
+class TestModel_InstanceTemplatePatch:
"""
- Test Class for IP
+ Test Class for InstanceTemplatePatch
"""
- def test_ip_serialization(self):
+ def test_instance_template_patch_serialization(self):
"""
- Test serialization/deserialization for IP
+ Test serialization/deserialization for InstanceTemplatePatch
"""
- # 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 InstanceTemplatePatch model
+ instance_template_patch_model_json = {}
+ instance_template_patch_model_json['name'] = 'my-instance-template'
- # 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 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 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 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 ip_model == ip_model2
+ assert instance_template_patch_model == instance_template_patch_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_template_patch_model_json2 = instance_template_patch_model.to_dict()
+ assert instance_template_patch_model_json2 == instance_template_patch_model_json
-class TestModel_IPsecPolicy:
+class TestModel_InstanceTemplateReference:
"""
- Test Class for IPsecPolicy
+ Test Class for InstanceTemplateReference
"""
- def test_i_psec_policy_serialization(self):
+ def test_instance_template_reference_serialization(self):
"""
- Test serialization/deserialization for IPsecPolicy
+ Test serialization/deserialization for InstanceTemplateReference
"""
# 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'
+ instance_template_reference_deleted_model = {} # InstanceTemplateReferenceDeleted
+ instance_template_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Construct a json representation of a IPsecPolicy model
- i_psec_policy_model_json = {}
- i_psec_policy_model_json['authentication_algorithm'] = 'disabled'
- i_psec_policy_model_json['connections'] = [vpn_gateway_connection_reference_model]
- i_psec_policy_model_json['created_at'] = '2019-01-01T12:00:00Z'
- i_psec_policy_model_json['encapsulation_mode'] = 'tunnel'
- 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 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 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 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 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 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 i_psec_policy_model == i_psec_policy_model2
+ assert instance_template_reference_model == instance_template_reference_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_template_reference_model_json2 = instance_template_reference_model.to_dict()
+ assert instance_template_reference_model_json2 == instance_template_reference_model_json
-class TestModel_IPsecPolicyCollection:
+class TestModel_InstanceTemplateReferenceDeleted:
"""
- Test Class for IPsecPolicyCollection
+ Test Class for InstanceTemplateReferenceDeleted
"""
- def test_i_psec_policy_collection_serialization(self):
+ def test_instance_template_reference_deleted_serialization(self):
"""
- Test serialization/deserialization for IPsecPolicyCollection
+ Test serialization/deserialization for InstanceTemplateReferenceDeleted
"""
- # Construct dict forms of any model objects needed in order to build this model.
+ # 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'
- 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 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
- 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 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)
- 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_template_reference_deleted_model == instance_template_reference_deleted_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_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
- i_psec_policy_model = {} # IPsecPolicy
- i_psec_policy_model['authentication_algorithm'] = 'disabled'
- i_psec_policy_model['connections'] = [vpn_gateway_connection_reference_model]
- i_psec_policy_model['created_at'] = '2019-01-01T12:00:00Z'
- i_psec_policy_model['encapsulation_mode'] = 'tunnel'
- 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'
- 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'
+class TestModel_InstanceVCPU:
+ """
+ Test Class for InstanceVCPU
+ """
- # 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
+ def test_instance_vcpu_serialization(self):
+ """
+ Test serialization/deserialization for InstanceVCPU
+ """
- # 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 json representation of a InstanceVCPU model
+ instance_vcpu_model_json = {}
+ instance_vcpu_model_json['architecture'] = 'amd64'
+ instance_vcpu_model_json['count'] = 4
+ instance_vcpu_model_json['manufacturer'] = 'intel'
- # 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 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 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 i_psec_policy_collection_model == i_psec_policy_collection_model2
+ assert instance_vcpu_model == instance_vcpu_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_vcpu_model_json2 = instance_vcpu_model.to_dict()
+ assert instance_vcpu_model_json2 == instance_vcpu_model_json
-class TestModel_IPsecPolicyCollectionFirst:
+class TestModel_Key:
"""
- Test Class for IPsecPolicyCollectionFirst
+ Test Class for Key
"""
- def test_i_psec_policy_collection_first_serialization(self):
+ def test_key_serialization(self):
"""
- Test serialization/deserialization for IPsecPolicyCollectionFirst
+ Test serialization/deserialization for Key
"""
- # 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.
- # 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
+ 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 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 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'] = 'ed25519'
+
+ # 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 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 i_psec_policy_collection_first_model == i_psec_policy_collection_first_model2
+ assert key_model == key_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
+ key_model_json2 = key_model.to_dict()
+ assert key_model_json2 == key_model_json
-class TestModel_IPsecPolicyCollectionNext:
+class TestModel_KeyCollection:
"""
- Test Class for IPsecPolicyCollectionNext
+ Test Class for KeyCollection
"""
- def test_i_psec_policy_collection_next_serialization(self):
+ def test_key_collection_serialization(self):
"""
- Test serialization/deserialization for IPsecPolicyCollectionNext
+ Test serialization/deserialization for KeyCollection
"""
- # 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 dict forms of any model objects needed in order to build this model.
- # 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
+ key_collection_first_model = {} # KeyCollectionFirst
+ key_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/keys?limit=50'
- # 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)
+ 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 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 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 i_psec_policy_collection_next_model == i_psec_policy_collection_next_model2
+ assert key_collection_model == key_collection_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
+ key_collection_model_json2 = key_collection_model.to_dict()
+ assert key_collection_model_json2 == key_collection_model_json
-class TestModel_IPsecPolicyPatch:
+class TestModel_KeyCollectionFirst:
"""
- Test Class for IPsecPolicyPatch
+ Test Class for KeyCollectionFirst
"""
- def test_i_psec_policy_patch_serialization(self):
+ def test_key_collection_first_serialization(self):
"""
- Test serialization/deserialization for IPsecPolicyPatch
+ Test serialization/deserialization for KeyCollectionFirst
"""
- # Construct a json representation of a IPsecPolicyPatch model
- i_psec_policy_patch_model_json = {}
- i_psec_policy_patch_model_json['authentication_algorithm'] = 'disabled'
- i_psec_policy_patch_model_json['encryption_algorithm'] = 'aes128'
- i_psec_policy_patch_model_json['key_lifetime'] = 3600
- i_psec_policy_patch_model_json['name'] = 'my-ipsec-policy'
- i_psec_policy_patch_model_json['pfs'] = 'disabled'
+ # 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 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 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 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 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 i_psec_policy_patch_model == i_psec_policy_patch_model2
+ assert key_collection_first_model == key_collection_first_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
+ key_collection_first_model_json2 = key_collection_first_model.to_dict()
+ assert key_collection_first_model_json2 == key_collection_first_model_json
-class TestModel_IPsecPolicyReference:
+class TestModel_KeyCollectionNext:
"""
- Test Class for IPsecPolicyReference
+ Test Class for KeyCollectionNext
"""
- def test_i_psec_policy_reference_serialization(self):
+ def test_key_collection_next_serialization(self):
"""
- Test serialization/deserialization for IPsecPolicyReference
+ Test serialization/deserialization for KeyCollectionNext
"""
- # 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 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 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 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 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 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 i_psec_policy_reference_model == i_psec_policy_reference_model2
+ assert key_collection_next_model == key_collection_next_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
+ key_collection_next_model_json2 = key_collection_next_model.to_dict()
+ assert key_collection_next_model_json2 == key_collection_next_model_json
-class TestModel_IPsecPolicyReferenceDeleted:
+class TestModel_KeyPatch:
"""
- Test Class for IPsecPolicyReferenceDeleted
+ Test Class for KeyPatch
"""
- def test_i_psec_policy_reference_deleted_serialization(self):
+ def test_key_patch_serialization(self):
"""
- Test serialization/deserialization for IPsecPolicyReferenceDeleted
+ Test serialization/deserialization for KeyPatch
"""
- # 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 KeyPatch model
+ key_patch_model_json = {}
+ key_patch_model_json['name'] = 'my-key'
- # 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 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 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 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 i_psec_policy_reference_deleted_model == i_psec_policy_reference_deleted_model2
+ assert key_patch_model == key_patch_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
+ key_patch_model_json2 = key_patch_model.to_dict()
+ assert key_patch_model_json2 == key_patch_model_json
-class TestModel_Image:
+class TestModel_KeyReference:
"""
- Test Class for Image
+ Test Class for KeyReference
"""
- def test_image_serialization(self):
+ def test_key_reference_serialization(self):
"""
- Test serialization/deserialization for Image
+ Test serialization/deserialization for KeyReference
"""
# Construct dict forms of any model objects needed in order to build this model.
- catalog_offering_version_reference_model = {} # CatalogOfferingVersionReference
- catalog_offering_version_reference_model['crn'] = 'crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d'
-
- image_catalog_offering_model = {} # ImageCatalogOffering
- image_catalog_offering_model['managed'] = True
- image_catalog_offering_model['version'] = catalog_offering_version_reference_model
-
- encryption_key_reference_model = {} # EncryptionKeyReference
- encryption_key_reference_model['crn'] = 'crn:v1:bluemix:public:kms:us-south:a/123456: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
+ key_reference_deleted_model = {} # KeyReferenceDeleted
+ key_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'
+ # 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'
- 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 KeyReference by calling from_dict on the json representation
+ key_reference_model = KeyReference.from_dict(key_reference_model_json)
+ assert key_reference_model != False
- volume_reference_deleted_model = {} # VolumeReferenceDeleted
- volume_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ # 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)
- 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'
+ # Verify the model instances are equivalent
+ assert key_reference_model == key_reference_model2
- volume_remote_model = {} # VolumeRemote
- volume_remote_model['region'] = region_reference_model
+ # 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
- 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'
- volume_reference_model['remote'] = volume_remote_model
- volume_reference_model['resource_type'] = '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'
+class TestModel_KeyReferenceDeleted:
+ """
+ Test Class for KeyReferenceDeleted
+ """
- # Construct a json representation of a Image model
- image_model_json = {}
- image_model_json['catalog_offering'] = image_catalog_offering_model
- image_model_json['created_at'] = '2019-01-01T12:00:00Z'
- image_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8'
- image_model_json['deprecation_at'] = '2019-01-01T12:00:00Z'
- image_model_json['encryption'] = 'user_managed'
- image_model_json['encryption_key'] = encryption_key_reference_model
- image_model_json['file'] = image_file_model
- 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['obsolescence_at'] = '2019-01-01T12:00:00Z'
- image_model_json['operating_system'] = operating_system_model
- image_model_json['resource_group'] = resource_group_reference_model
- image_model_json['resource_type'] = 'image'
- 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'
+ def test_key_reference_deleted_serialization(self):
+ """
+ Test serialization/deserialization for KeyReferenceDeleted
+ """
- # 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 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 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 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 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 image_model == image_model2
+ assert key_reference_deleted_model == key_reference_deleted_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
+ key_reference_deleted_model_json2 = key_reference_deleted_model.to_dict()
+ assert key_reference_deleted_model_json2 == key_reference_deleted_model_json
-class TestModel_ImageCatalogOffering:
+class TestModel_LegacyCloudObjectStorageBucketReference:
"""
- Test Class for ImageCatalogOffering
+ Test Class for LegacyCloudObjectStorageBucketReference
"""
- def test_image_catalog_offering_serialization(self):
+ def test_legacy_cloud_object_storage_bucket_reference_serialization(self):
"""
- Test serialization/deserialization for ImageCatalogOffering
+ Test serialization/deserialization for LegacyCloudObjectStorageBucketReference
"""
- # Construct dict forms of any model objects needed in order to build this model.
-
- catalog_offering_version_reference_model = {} # CatalogOfferingVersionReference
- catalog_offering_version_reference_model['crn'] = 'crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d'
-
- # Construct a json representation of a ImageCatalogOffering model
- image_catalog_offering_model_json = {}
- image_catalog_offering_model_json['managed'] = True
- image_catalog_offering_model_json['version'] = catalog_offering_version_reference_model
+ # Construct a json representation of a LegacyCloudObjectStorageBucketReference model
+ legacy_cloud_object_storage_bucket_reference_model_json = {}
+ legacy_cloud_object_storage_bucket_reference_model_json['name'] = 'bucket-27200-lwx4cfvcue'
- # Construct a model instance of ImageCatalogOffering by calling from_dict on the json representation
- image_catalog_offering_model = ImageCatalogOffering.from_dict(image_catalog_offering_model_json)
- assert image_catalog_offering_model != False
+ # Construct a model instance of LegacyCloudObjectStorageBucketReference by calling from_dict on the json representation
+ legacy_cloud_object_storage_bucket_reference_model = LegacyCloudObjectStorageBucketReference.from_dict(legacy_cloud_object_storage_bucket_reference_model_json)
+ assert legacy_cloud_object_storage_bucket_reference_model != False
- # Construct a model instance of ImageCatalogOffering by calling from_dict on the json representation
- image_catalog_offering_model_dict = ImageCatalogOffering.from_dict(image_catalog_offering_model_json).__dict__
- image_catalog_offering_model2 = ImageCatalogOffering(**image_catalog_offering_model_dict)
+ # Construct a model instance of LegacyCloudObjectStorageBucketReference by calling from_dict on the json representation
+ legacy_cloud_object_storage_bucket_reference_model_dict = LegacyCloudObjectStorageBucketReference.from_dict(legacy_cloud_object_storage_bucket_reference_model_json).__dict__
+ legacy_cloud_object_storage_bucket_reference_model2 = LegacyCloudObjectStorageBucketReference(**legacy_cloud_object_storage_bucket_reference_model_dict)
# Verify the model instances are equivalent
- assert image_catalog_offering_model == image_catalog_offering_model2
+ assert legacy_cloud_object_storage_bucket_reference_model == legacy_cloud_object_storage_bucket_reference_model2
# Convert model instance back to dict and verify no loss of data
- image_catalog_offering_model_json2 = image_catalog_offering_model.to_dict()
- assert image_catalog_offering_model_json2 == image_catalog_offering_model_json
+ legacy_cloud_object_storage_bucket_reference_model_json2 = legacy_cloud_object_storage_bucket_reference_model.to_dict()
+ assert legacy_cloud_object_storage_bucket_reference_model_json2 == legacy_cloud_object_storage_bucket_reference_model_json
-class TestModel_ImageCollection:
+class TestModel_LoadBalancer:
"""
- Test Class for ImageCollection
+ Test Class for LoadBalancer
"""
- def test_image_collection_serialization(self):
+ def test_load_balancer_serialization(self):
"""
- Test serialization/deserialization for ImageCollection
+ Test serialization/deserialization for LoadBalancer
"""
# 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'
+ dns_instance_reference_model = {} # DNSInstanceReference
+ dns_instance_reference_model['crn'] = 'crn:v1:bluemix:public:dns-svcs:global:a/123456:6860c359-b2e2-46fa-a944-b38c28201c6e'
- catalog_offering_version_reference_model = {} # CatalogOfferingVersionReference
- catalog_offering_version_reference_model['crn'] = 'crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d'
+ dns_zone_reference_model = {} # DNSZoneReference
+ dns_zone_reference_model['id'] = 'd66662cc-aa23-4fe1-9987-858487a61f45'
- image_catalog_offering_model = {} # ImageCatalogOffering
- image_catalog_offering_model['managed'] = True
- image_catalog_offering_model['version'] = catalog_offering_version_reference_model
+ load_balancer_dns_model = {} # LoadBalancerDNS
+ load_balancer_dns_model['instance'] = dns_instance_reference_model
+ load_balancer_dns_model['zone'] = dns_zone_reference_model
- encryption_key_reference_model = {} # EncryptionKeyReference
- encryption_key_reference_model['crn'] = 'crn:v1:bluemix:public:kms:us-south:a/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179'
+ load_balancer_listener_reference_deleted_model = {} # LoadBalancerListenerReferenceDeleted
+ load_balancer_listener_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- image_file_checksums_model = {} # ImageFileChecksums
- image_file_checksums_model['sha256'] = 'e992a84f113d3a35d2145ca3e7aca4fc95fe6daf470a08d8af3422ee59c92e15'
+ 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'
- image_file_model = {} # ImageFile
- image_file_model['checksums'] = image_file_checksums_model
- image_file_model['size'] = 1
+ load_balancer_logging_datapath_model = {} # LoadBalancerLoggingDatapath
+ load_balancer_logging_datapath_model['active'] = True
- 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_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'
+
+ 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'
+
+ reserved_ip_reference_deleted_model = {} # ReservedIPReferenceDeleted
+ reserved_ip_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+
+ load_balancer_private_ips_item_model = {} # LoadBalancerPrivateIpsItem
+ load_balancer_private_ips_item_model['address'] = '192.168.3.4'
+ load_balancer_private_ips_item_model['deleted'] = reserved_ip_reference_deleted_model
+ load_balancer_private_ips_item_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb'
+ load_balancer_private_ips_item_model['id'] = '6d353a0f-aeb1-4ae1-832e-1110d10981bb'
+ load_balancer_private_ips_item_model['name'] = 'my-reserved-ip'
+ load_balancer_private_ips_item_model['resource_type'] = 'subnet_reserved_ip'
+
+ load_balancer_profile_reference_model = {} # LoadBalancerProfileReference
+ load_balancer_profile_reference_model['family'] = 'network'
+ load_balancer_profile_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed'
+ load_balancer_profile_reference_model['name'] = 'network-fixed'
+
+ ip_model = {} # IP
+ ip_model['address'] = '192.168.3.4'
resource_group_reference_model = {} # ResourceGroupReference
resource_group_reference_model['href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345'
resource_group_reference_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
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'
-
- 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_remote_model = {} # VolumeRemote
- volume_remote_model['region'] = region_reference_model
-
- 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'
- volume_reference_model['remote'] = volume_remote_model
- volume_reference_model['resource_type'] = 'volume'
+ security_group_reference_deleted_model = {} # SecurityGroupReferenceDeleted
+ security_group_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- 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'
+ 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'
- image_model = {} # Image
- image_model['catalog_offering'] = image_catalog_offering_model
- image_model['created_at'] = '2019-01-01T12:00:00Z'
- image_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8'
- image_model['deprecation_at'] = '2019-01-01T12:00:00Z'
- image_model['encryption'] = 'user_managed'
- image_model['encryption_key'] = encryption_key_reference_model
- image_model['file'] = image_file_model
- 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['obsolescence_at'] = '2019-01-01T12:00:00Z'
- image_model['operating_system'] = operating_system_model
- image_model['resource_group'] = resource_group_reference_model
- image_model['resource_type'] = 'image'
- image_model['source_volume'] = volume_reference_model
- image_model['status'] = 'available'
- image_model['status_reasons'] = [image_status_reason_model]
- image_model['visibility'] = 'private'
+ subnet_reference_deleted_model = {} # SubnetReferenceDeleted
+ subnet_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- image_collection_next_model = {} # ImageCollectionNext
- image_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/images?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'
+ subnet_reference_model['resource_type'] = 'subnet'
- # 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
- image_collection_model_json['total_count'] = 132
+ # 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['dns'] = load_balancer_dns_model
+ load_balancer_model_json['hostname'] = '6b88d615-us-south.lb.appdomain.cloud'
+ load_balancer_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727'
+ load_balancer_model_json['id'] = 'dd754295-e9e0-4c9d-bf6c-58fbc59e5727'
+ load_balancer_model_json['instance_groups_supported'] = False
+ 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'] = [load_balancer_private_ips_item_model]
+ load_balancer_model_json['profile'] = load_balancer_profile_reference_model
+ load_balancer_model_json['provisioning_status'] = 'active'
+ load_balancer_model_json['public_ips'] = [ip_model]
+ load_balancer_model_json['resource_group'] = resource_group_reference_model
+ load_balancer_model_json['resource_type'] = 'load_balancer'
+ load_balancer_model_json['route_mode'] = True
+ load_balancer_model_json['security_groups'] = [security_group_reference_model]
+ load_balancer_model_json['security_groups_supported'] = True
+ load_balancer_model_json['subnets'] = [subnet_reference_model]
+ load_balancer_model_json['udp_supported'] = True
- # Construct a model instance of 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 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 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)
+ # 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 image_collection_model == image_collection_model2
+ assert load_balancer_model == load_balancer_model2
# 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
+ load_balancer_model_json2 = load_balancer_model.to_dict()
+ assert load_balancer_model_json2 == load_balancer_model_json
-class TestModel_ImageCollectionFirst:
+class TestModel_LoadBalancerCollection:
"""
- Test Class for ImageCollectionFirst
+ Test Class for LoadBalancerCollection
"""
- def test_image_collection_first_serialization(self):
+ def test_load_balancer_collection_serialization(self):
"""
- Test serialization/deserialization for ImageCollectionFirst
+ Test serialization/deserialization for LoadBalancerCollection
"""
- # 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 dict forms of any model objects needed in order to build this model.
- # 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
+ load_balancer_collection_first_model = {} # LoadBalancerCollectionFirst
+ load_balancer_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers?limit=20'
- # 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)
+ dns_instance_reference_model = {} # DNSInstanceReference
+ dns_instance_reference_model['crn'] = 'crn:v1:bluemix:public:dns-svcs:global:a/123456:6860c359-b2e2-46fa-a944-b38c28201c6e'
- # Verify the model instances are equivalent
- assert image_collection_first_model == image_collection_first_model2
+ dns_zone_reference_model = {} # DNSZoneReference
+ dns_zone_reference_model['id'] = 'd66662cc-aa23-4fe1-9987-858487a61f45'
- # 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
+ load_balancer_dns_model = {} # LoadBalancerDNS
+ load_balancer_dns_model['instance'] = dns_instance_reference_model
+ load_balancer_dns_model['zone'] = dns_zone_reference_model
+ load_balancer_listener_reference_deleted_model = {} # LoadBalancerListenerReferenceDeleted
+ load_balancer_listener_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
-class TestModel_ImageCollectionNext:
- """
- Test Class for ImageCollectionNext
- """
+ 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'
- def test_image_collection_next_serialization(self):
- """
- Test serialization/deserialization for ImageCollectionNext
- """
+ load_balancer_logging_datapath_model = {} # LoadBalancerLoggingDatapath
+ load_balancer_logging_datapath_model['active'] = True
- # 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'
+ load_balancer_logging_model = {} # LoadBalancerLogging
+ load_balancer_logging_model['datapath'] = load_balancer_logging_datapath_model
- # 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
+ 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 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)
+ 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'
- # Verify the model instances are equivalent
- assert image_collection_next_model == image_collection_next_model2
+ reserved_ip_reference_deleted_model = {} # ReservedIPReferenceDeleted
+ reserved_ip_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_next_model_json2 = image_collection_next_model.to_dict()
- assert image_collection_next_model_json2 == image_collection_next_model_json
+ load_balancer_private_ips_item_model = {} # LoadBalancerPrivateIpsItem
+ load_balancer_private_ips_item_model['address'] = '192.168.3.4'
+ load_balancer_private_ips_item_model['deleted'] = reserved_ip_reference_deleted_model
+ load_balancer_private_ips_item_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb'
+ load_balancer_private_ips_item_model['id'] = '6d353a0f-aeb1-4ae1-832e-1110d10981bb'
+ load_balancer_private_ips_item_model['name'] = 'my-reserved-ip'
+ load_balancer_private_ips_item_model['resource_type'] = 'subnet_reserved_ip'
+ load_balancer_profile_reference_model = {} # LoadBalancerProfileReference
+ load_balancer_profile_reference_model['family'] = 'network'
+ load_balancer_profile_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed'
+ load_balancer_profile_reference_model['name'] = 'network-fixed'
-class TestModel_ImageExportJob:
- """
- Test Class for ImageExportJob
- """
+ ip_model = {} # IP
+ ip_model['address'] = '192.168.3.4'
- def test_image_export_job_serialization(self):
- """
- Test serialization/deserialization for ImageExportJob
- """
+ 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 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'
- image_export_job_status_reason_model = {} # ImageExportJobStatusReason
- image_export_job_status_reason_model['code'] = 'cannot_access_storage_bucket'
- image_export_job_status_reason_model['message'] = 'testString'
- image_export_job_status_reason_model['more_info'] = 'https://cloud.ibm.com/docs/vpc?topic=vpc-object-storage-prereq'
+ 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'
- cloud_object_storage_bucket_reference_model = {} # CloudObjectStorageBucketReference
- cloud_object_storage_bucket_reference_model['crn'] = 'crn:v1:bluemix:public:cloud-object-storage:global:a/123456:1a0ec336-f391-4091-a6fb-5e084a4c56f4:bucket:my-bucket'
- 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'
- cloud_object_storage_object_reference_model = {} # CloudObjectStorageObjectReference
- cloud_object_storage_object_reference_model['name'] = 'my-object'
+ subnet_reference_model = {} # SubnetReference
+ subnet_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
+ subnet_reference_model['deleted'] = subnet_reference_deleted_model
+ subnet_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
+ subnet_reference_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
+ subnet_reference_model['name'] = 'my-subnet'
+ subnet_reference_model['resource_type'] = 'subnet'
- # Construct a json representation of a ImageExportJob model
- image_export_job_model_json = {}
- image_export_job_model_json['completed_at'] = '2019-01-01T12:00:00Z'
- image_export_job_model_json['created_at'] = '2019-01-01T12:00:00Z'
- image_export_job_model_json['encrypted_data_key'] = 'VGhpcyBpcyBhIG1vY2sgYnl0ZSBhcnJheSB2YWx1ZS4='
- image_export_job_model_json['format'] = 'qcow2'
- image_export_job_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8/export_jobs/r134-095e9baf-01d4-4e29-986e-20d26606b82a'
- image_export_job_model_json['id'] = 'r134-095e9baf-01d4-4e29-986e-20d26606b82a'
- image_export_job_model_json['name'] = 'my-image-export'
- image_export_job_model_json['resource_type'] = 'image_export_job'
- image_export_job_model_json['started_at'] = '2019-01-01T12:00:00Z'
- image_export_job_model_json['status'] = 'deleting'
- image_export_job_model_json['status_reasons'] = [image_export_job_status_reason_model]
- image_export_job_model_json['storage_bucket'] = cloud_object_storage_bucket_reference_model
- image_export_job_model_json['storage_href'] = 'cos://us-south/bucket-27200-lwx4cfvcue/my-image-export.qcow2'
- image_export_job_model_json['storage_object'] = cloud_object_storage_object_reference_model
+ 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['dns'] = load_balancer_dns_model
+ load_balancer_model['hostname'] = '6b88d615-us-south.lb.appdomain.cloud'
+ load_balancer_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727'
+ load_balancer_model['id'] = 'dd754295-e9e0-4c9d-bf6c-58fbc59e5727'
+ load_balancer_model['instance_groups_supported'] = False
+ 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'] = [load_balancer_private_ips_item_model]
+ load_balancer_model['profile'] = load_balancer_profile_reference_model
+ load_balancer_model['provisioning_status'] = 'active'
+ load_balancer_model['public_ips'] = [ip_model]
+ load_balancer_model['resource_group'] = resource_group_reference_model
+ load_balancer_model['resource_type'] = 'load_balancer'
+ load_balancer_model['route_mode'] = True
+ load_balancer_model['security_groups'] = [security_group_reference_model]
+ load_balancer_model['security_groups_supported'] = True
+ load_balancer_model['subnets'] = [subnet_reference_model]
+ load_balancer_model['udp_supported'] = True
- # Construct a model instance of ImageExportJob by calling from_dict on the json representation
- image_export_job_model = ImageExportJob.from_dict(image_export_job_model_json)
- assert image_export_job_model != False
+ 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 ImageExportJob by calling from_dict on the json representation
- image_export_job_model_dict = ImageExportJob.from_dict(image_export_job_model_json).__dict__
- image_export_job_model2 = ImageExportJob(**image_export_job_model_dict)
+ # 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 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 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 image_export_job_model == image_export_job_model2
+ assert load_balancer_collection_model == load_balancer_collection_model2
# Convert model instance back to dict and verify no loss of data
- image_export_job_model_json2 = image_export_job_model.to_dict()
- assert image_export_job_model_json2 == image_export_job_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_ImageExportJobPatch:
+class TestModel_LoadBalancerCollectionFirst:
"""
- Test Class for ImageExportJobPatch
+ Test Class for LoadBalancerCollectionFirst
"""
- def test_image_export_job_patch_serialization(self):
+ def test_load_balancer_collection_first_serialization(self):
"""
- Test serialization/deserialization for ImageExportJobPatch
+ Test serialization/deserialization for LoadBalancerCollectionFirst
"""
- # Construct a json representation of a ImageExportJobPatch model
- image_export_job_patch_model_json = {}
- image_export_job_patch_model_json['name'] = 'my-image-export'
-
- # Construct a model instance of ImageExportJobPatch by calling from_dict on the json representation
- image_export_job_patch_model = ImageExportJobPatch.from_dict(image_export_job_patch_model_json)
- assert image_export_job_patch_model != False
+ # 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 ImageExportJobPatch by calling from_dict on the json representation
- image_export_job_patch_model_dict = ImageExportJobPatch.from_dict(image_export_job_patch_model_json).__dict__
- image_export_job_patch_model2 = ImageExportJobPatch(**image_export_job_patch_model_dict)
+ # 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 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 image_export_job_patch_model == image_export_job_patch_model2
+ assert load_balancer_collection_first_model == load_balancer_collection_first_model2
# Convert model instance back to dict and verify no loss of data
- image_export_job_patch_model_json2 = image_export_job_patch_model.to_dict()
- assert image_export_job_patch_model_json2 == image_export_job_patch_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_ImageExportJobStatusReason:
+class TestModel_LoadBalancerCollectionNext:
"""
- Test Class for ImageExportJobStatusReason
+ Test Class for LoadBalancerCollectionNext
"""
- def test_image_export_job_status_reason_serialization(self):
+ def test_load_balancer_collection_next_serialization(self):
"""
- Test serialization/deserialization for ImageExportJobStatusReason
+ Test serialization/deserialization for LoadBalancerCollectionNext
"""
- # Construct a json representation of a ImageExportJobStatusReason model
- image_export_job_status_reason_model_json = {}
- image_export_job_status_reason_model_json['code'] = 'cannot_access_storage_bucket'
- image_export_job_status_reason_model_json['message'] = 'testString'
- image_export_job_status_reason_model_json['more_info'] = 'https://cloud.ibm.com/docs/vpc?topic=vpc-object-storage-prereq'
+ # 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 ImageExportJobStatusReason by calling from_dict on the json representation
- image_export_job_status_reason_model = ImageExportJobStatusReason.from_dict(image_export_job_status_reason_model_json)
- assert image_export_job_status_reason_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 ImageExportJobStatusReason by calling from_dict on the json representation
- image_export_job_status_reason_model_dict = ImageExportJobStatusReason.from_dict(image_export_job_status_reason_model_json).__dict__
- image_export_job_status_reason_model2 = ImageExportJobStatusReason(**image_export_job_status_reason_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 image_export_job_status_reason_model == image_export_job_status_reason_model2
+ assert load_balancer_collection_next_model == load_balancer_collection_next_model2
# Convert model instance back to dict and verify no loss of data
- image_export_job_status_reason_model_json2 = image_export_job_status_reason_model.to_dict()
- assert image_export_job_status_reason_model_json2 == image_export_job_status_reason_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_ImageExportJobUnpaginatedCollection:
+class TestModel_LoadBalancerDNS:
"""
- Test Class for ImageExportJobUnpaginatedCollection
+ Test Class for LoadBalancerDNS
"""
- def test_image_export_job_unpaginated_collection_serialization(self):
+ def test_load_balancer_dns_serialization(self):
"""
- Test serialization/deserialization for ImageExportJobUnpaginatedCollection
+ Test serialization/deserialization for LoadBalancerDNS
"""
# Construct dict forms of any model objects needed in order to build this model.
- image_export_job_status_reason_model = {} # ImageExportJobStatusReason
- image_export_job_status_reason_model['code'] = 'cannot_access_storage_bucket'
- image_export_job_status_reason_model['message'] = 'testString'
- image_export_job_status_reason_model['more_info'] = 'https://cloud.ibm.com/docs/vpc?topic=vpc-object-storage-prereq'
-
- cloud_object_storage_bucket_reference_model = {} # CloudObjectStorageBucketReference
- cloud_object_storage_bucket_reference_model['crn'] = 'crn:v1:bluemix:public:cloud-object-storage:global:a/123456:1a0ec336-f391-4091-a6fb-5e084a4c56f4:bucket:my-bucket'
- cloud_object_storage_bucket_reference_model['name'] = 'bucket-27200-lwx4cfvcue'
-
- cloud_object_storage_object_reference_model = {} # CloudObjectStorageObjectReference
- cloud_object_storage_object_reference_model['name'] = 'my-object'
+ dns_instance_reference_model = {} # DNSInstanceReference
+ dns_instance_reference_model['crn'] = 'crn:v1:bluemix:public:dns-svcs:global:a/123456:6860c359-b2e2-46fa-a944-b38c28201c6e'
- image_export_job_model = {} # ImageExportJob
- image_export_job_model['completed_at'] = '2019-01-01T12:00:00Z'
- image_export_job_model['created_at'] = '2019-01-01T12:00:00Z'
- image_export_job_model['encrypted_data_key'] = 'VGhpcyBpcyBhIG1vY2sgYnl0ZSBhcnJheSB2YWx1ZS4='
- image_export_job_model['format'] = 'qcow2'
- image_export_job_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8/export_jobs/r134-095e9baf-01d4-4e29-986e-20d26606b82a'
- image_export_job_model['id'] = 'r134-095e9baf-01d4-4e29-986e-20d26606b82a'
- image_export_job_model['name'] = 'my-image-export'
- image_export_job_model['resource_type'] = 'image_export_job'
- image_export_job_model['started_at'] = '2019-01-01T12:00:00Z'
- image_export_job_model['status'] = 'deleting'
- image_export_job_model['status_reasons'] = [image_export_job_status_reason_model]
- image_export_job_model['storage_bucket'] = cloud_object_storage_bucket_reference_model
- image_export_job_model['storage_href'] = 'cos://us-south/bucket-27200-lwx4cfvcue/my-image-export.qcow2'
- image_export_job_model['storage_object'] = cloud_object_storage_object_reference_model
+ dns_zone_reference_model = {} # DNSZoneReference
+ dns_zone_reference_model['id'] = 'd66662cc-aa23-4fe1-9987-858487a61f45'
- # Construct a json representation of a ImageExportJobUnpaginatedCollection model
- image_export_job_unpaginated_collection_model_json = {}
- image_export_job_unpaginated_collection_model_json['export_jobs'] = [image_export_job_model]
+ # Construct a json representation of a LoadBalancerDNS model
+ load_balancer_dns_model_json = {}
+ load_balancer_dns_model_json['instance'] = dns_instance_reference_model
+ load_balancer_dns_model_json['zone'] = dns_zone_reference_model
- # Construct a model instance of ImageExportJobUnpaginatedCollection by calling from_dict on the json representation
- image_export_job_unpaginated_collection_model = ImageExportJobUnpaginatedCollection.from_dict(image_export_job_unpaginated_collection_model_json)
- assert image_export_job_unpaginated_collection_model != False
+ # Construct a model instance of LoadBalancerDNS by calling from_dict on the json representation
+ load_balancer_dns_model = LoadBalancerDNS.from_dict(load_balancer_dns_model_json)
+ assert load_balancer_dns_model != False
- # Construct a model instance of ImageExportJobUnpaginatedCollection by calling from_dict on the json representation
- image_export_job_unpaginated_collection_model_dict = ImageExportJobUnpaginatedCollection.from_dict(image_export_job_unpaginated_collection_model_json).__dict__
- image_export_job_unpaginated_collection_model2 = ImageExportJobUnpaginatedCollection(**image_export_job_unpaginated_collection_model_dict)
+ # Construct a model instance of LoadBalancerDNS by calling from_dict on the json representation
+ load_balancer_dns_model_dict = LoadBalancerDNS.from_dict(load_balancer_dns_model_json).__dict__
+ load_balancer_dns_model2 = LoadBalancerDNS(**load_balancer_dns_model_dict)
# Verify the model instances are equivalent
- assert image_export_job_unpaginated_collection_model == image_export_job_unpaginated_collection_model2
+ assert load_balancer_dns_model == load_balancer_dns_model2
# Convert model instance back to dict and verify no loss of data
- image_export_job_unpaginated_collection_model_json2 = image_export_job_unpaginated_collection_model.to_dict()
- assert image_export_job_unpaginated_collection_model_json2 == image_export_job_unpaginated_collection_model_json
+ load_balancer_dns_model_json2 = load_balancer_dns_model.to_dict()
+ assert load_balancer_dns_model_json2 == load_balancer_dns_model_json
-class TestModel_ImageFile:
+class TestModel_LoadBalancerDNSPatch:
"""
- Test Class for ImageFile
+ Test Class for LoadBalancerDNSPatch
"""
- def test_image_file_serialization(self):
+ def test_load_balancer_dns_patch_serialization(self):
"""
- Test serialization/deserialization for ImageFile
+ Test serialization/deserialization for LoadBalancerDNSPatch
"""
# 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'
+ dns_instance_identity_model = {} # DNSInstanceIdentityByCRN
+ dns_instance_identity_model['crn'] = 'crn:v1:bluemix:public:dns-svcs:global:a/123456:6860c359-b2e2-46fa-a944-b38c28201c6e'
- # 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
+ dns_zone_identity_model = {} # DNSZoneIdentityById
+ dns_zone_identity_model['id'] = 'd66662cc-aa23-4fe1-9987-858487a61f45'
- # 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 json representation of a LoadBalancerDNSPatch model
+ load_balancer_dns_patch_model_json = {}
+ load_balancer_dns_patch_model_json['instance'] = dns_instance_identity_model
+ load_balancer_dns_patch_model_json['zone'] = dns_zone_identity_model
- # 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 LoadBalancerDNSPatch by calling from_dict on the json representation
+ load_balancer_dns_patch_model = LoadBalancerDNSPatch.from_dict(load_balancer_dns_patch_model_json)
+ assert load_balancer_dns_patch_model != False
+
+ # Construct a model instance of LoadBalancerDNSPatch by calling from_dict on the json representation
+ load_balancer_dns_patch_model_dict = LoadBalancerDNSPatch.from_dict(load_balancer_dns_patch_model_json).__dict__
+ load_balancer_dns_patch_model2 = LoadBalancerDNSPatch(**load_balancer_dns_patch_model_dict)
# Verify the model instances are equivalent
- assert image_file_model == image_file_model2
+ assert load_balancer_dns_patch_model == load_balancer_dns_patch_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
+ load_balancer_dns_patch_model_json2 = load_balancer_dns_patch_model.to_dict()
+ assert load_balancer_dns_patch_model_json2 == load_balancer_dns_patch_model_json
-class TestModel_ImageFileChecksums:
+class TestModel_LoadBalancerDNSPrototype:
"""
- Test Class for ImageFileChecksums
+ Test Class for LoadBalancerDNSPrototype
"""
- def test_image_file_checksums_serialization(self):
+ def test_load_balancer_dns_prototype_serialization(self):
"""
- Test serialization/deserialization for ImageFileChecksums
+ Test serialization/deserialization for LoadBalancerDNSPrototype
"""
- # Construct a json representation of a ImageFileChecksums model
- image_file_checksums_model_json = {}
- image_file_checksums_model_json['sha256'] = 'e992a84f113d3a35d2145ca3e7aca4fc95fe6daf470a08d8af3422ee59c92e15'
+ # Construct dict forms of any model objects needed in order to build this model.
- # 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
+ dns_instance_identity_model = {} # DNSInstanceIdentityByCRN
+ dns_instance_identity_model['crn'] = 'crn:v1:bluemix:public:dns-svcs:global:a/123456:6860c359-b2e2-46fa-a944-b38c28201c6e'
- # 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)
+ dns_zone_identity_model = {} # DNSZoneIdentityById
+ dns_zone_identity_model['id'] = 'd66662cc-aa23-4fe1-9987-858487a61f45'
+
+ # Construct a json representation of a LoadBalancerDNSPrototype model
+ load_balancer_dns_prototype_model_json = {}
+ load_balancer_dns_prototype_model_json['instance'] = dns_instance_identity_model
+ load_balancer_dns_prototype_model_json['zone'] = dns_zone_identity_model
+
+ # Construct a model instance of LoadBalancerDNSPrototype by calling from_dict on the json representation
+ load_balancer_dns_prototype_model = LoadBalancerDNSPrototype.from_dict(load_balancer_dns_prototype_model_json)
+ assert load_balancer_dns_prototype_model != False
+
+ # Construct a model instance of LoadBalancerDNSPrototype by calling from_dict on the json representation
+ load_balancer_dns_prototype_model_dict = LoadBalancerDNSPrototype.from_dict(load_balancer_dns_prototype_model_json).__dict__
+ load_balancer_dns_prototype_model2 = LoadBalancerDNSPrototype(**load_balancer_dns_prototype_model_dict)
# Verify the model instances are equivalent
- assert image_file_checksums_model == image_file_checksums_model2
+ assert load_balancer_dns_prototype_model == load_balancer_dns_prototype_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
+ load_balancer_dns_prototype_model_json2 = load_balancer_dns_prototype_model.to_dict()
+ assert load_balancer_dns_prototype_model_json2 == load_balancer_dns_prototype_model_json
-class TestModel_ImageFilePrototype:
+class TestModel_LoadBalancerListener:
"""
- Test Class for ImageFilePrototype
+ Test Class for LoadBalancerListener
"""
- def test_image_file_prototype_serialization(self):
+ def test_load_balancer_listener_serialization(self):
"""
- Test serialization/deserialization for ImageFilePrototype
+ Test serialization/deserialization for LoadBalancerListener
"""
- # 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 dict forms of any model objects needed in order to build this model.
- # 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
+ certificate_instance_reference_model = {} # CertificateInstanceReference
+ certificate_instance_reference_model['crn'] = 'crn:v1:bluemix:public:secrets-manager:us-south:a/123456:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5'
- # 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)
+ 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 image_file_prototype_model == image_file_prototype_model2
+ 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'
- # 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
+ 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'
-class TestModel_ImagePatch:
- """
- Test Class for ImagePatch
- """
+ 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'
- def test_image_patch_serialization(self):
- """
- Test serialization/deserialization for ImagePatch
- """
+ 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 json representation of a ImagePatch model
- image_patch_model_json = {}
- image_patch_model_json['deprecation_at'] = '2019-01-01T12:00:00Z'
- image_patch_model_json['name'] = 'my-image'
- image_patch_model_json['obsolescence_at'] = '2019-01-01T12:00:00Z'
+ 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_policy_reference_model['name'] = 'my-policy'
- # 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 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['idle_connection_timeout'] = 100
+ 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 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)
+ # 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 image_patch_model == image_patch_model2
+ assert load_balancer_listener_model == load_balancer_listener_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
+ load_balancer_listener_model_json2 = load_balancer_listener_model.to_dict()
+ assert load_balancer_listener_model_json2 == load_balancer_listener_model_json
-class TestModel_ImageReference:
+class TestModel_LoadBalancerListenerCollection:
"""
- Test Class for ImageReference
+ Test Class for LoadBalancerListenerCollection
"""
- def test_image_reference_serialization(self):
+ def test_load_balancer_listener_collection_serialization(self):
"""
- Test serialization/deserialization for ImageReference
+ Test serialization/deserialization for LoadBalancerListenerCollection
"""
# 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'
+ certificate_instance_reference_model = {} # CertificateInstanceReference
+ certificate_instance_reference_model['crn'] = 'crn:v1:bluemix:public:secrets-manager:us-south:a/123456:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5'
- account_reference_model = {} # AccountReference
- account_reference_model['id'] = 'aa2432b1fa4d4ace891e9b80fc104e34'
- account_reference_model['resource_type'] = 'account'
+ load_balancer_pool_reference_deleted_model = {} # LoadBalancerPoolReferenceDeleted
+ load_balancer_pool_reference_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'
+ 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'
- image_remote_model = {} # ImageRemote
- image_remote_model['account'] = account_reference_model
- image_remote_model['region'] = region_reference_model
+ 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 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'
- image_reference_model_json['remote'] = image_remote_model
- image_reference_model_json['resource_type'] = 'image'
+ 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 ImageReference by calling from_dict on the json representation
- image_reference_model = ImageReference.from_dict(image_reference_model_json)
- assert image_reference_model != False
+ 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'
- # 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)
+ 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_policy_reference_model['name'] = 'my-policy'
+
+ 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['idle_connection_timeout'] = 100
+ 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 image_reference_model == image_reference_model2
+ assert load_balancer_listener_collection_model == load_balancer_listener_collection_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
+ 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_ImageReferenceDeleted:
+class TestModel_LoadBalancerListenerHTTPSRedirect:
"""
- Test Class for ImageReferenceDeleted
+ Test Class for LoadBalancerListenerHTTPSRedirect
"""
- def test_image_reference_deleted_serialization(self):
+ def test_load_balancer_listener_https_redirect_serialization(self):
"""
- Test serialization/deserialization for ImageReferenceDeleted
+ Test serialization/deserialization for LoadBalancerListenerHTTPSRedirect
"""
- # 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 dict forms of any model objects needed in order to build this model.
- # 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
+ 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 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)
+ 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 image_reference_deleted_model == image_reference_deleted_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
- image_reference_deleted_model_json2 = image_reference_deleted_model.to_dict()
- assert image_reference_deleted_model_json2 == image_reference_deleted_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_ImageRemote:
+class TestModel_LoadBalancerListenerHTTPSRedirectPatch:
"""
- Test Class for ImageRemote
+ Test Class for LoadBalancerListenerHTTPSRedirectPatch
"""
- def test_image_remote_serialization(self):
+ def test_load_balancer_listener_https_redirect_patch_serialization(self):
"""
- Test serialization/deserialization for ImageRemote
+ Test serialization/deserialization for LoadBalancerListenerHTTPSRedirectPatch
"""
# Construct dict forms of any model objects needed in order to build this model.
- account_reference_model = {} # AccountReference
- account_reference_model['id'] = 'aa2432b1fa4d4ace891e9b80fc104e34'
- account_reference_model['resource_type'] = 'account'
-
- 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'
+ load_balancer_listener_identity_model = {} # LoadBalancerListenerIdentityById
+ load_balancer_listener_identity_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004'
- # Construct a json representation of a ImageRemote model
- image_remote_model_json = {}
- image_remote_model_json['account'] = account_reference_model
- image_remote_model_json['region'] = region_reference_model
+ # 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 ImageRemote by calling from_dict on the json representation
- image_remote_model = ImageRemote.from_dict(image_remote_model_json)
- assert image_remote_model != False
+ # 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 ImageRemote by calling from_dict on the json representation
- image_remote_model_dict = ImageRemote.from_dict(image_remote_model_json).__dict__
- image_remote_model2 = ImageRemote(**image_remote_model_dict)
+ # 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 image_remote_model == image_remote_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
- image_remote_model_json2 = image_remote_model.to_dict()
- assert image_remote_model_json2 == image_remote_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_ImageStatusReason:
+class TestModel_LoadBalancerListenerHTTPSRedirectPrototype:
"""
- Test Class for ImageStatusReason
+ Test Class for LoadBalancerListenerHTTPSRedirectPrototype
"""
- def test_image_status_reason_serialization(self):
+ def test_load_balancer_listener_https_redirect_prototype_serialization(self):
"""
- Test serialization/deserialization for ImageStatusReason
+ Test serialization/deserialization for LoadBalancerListenerHTTPSRedirectPrototype
"""
- # 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
+ load_balancer_listener_identity_model = {} # LoadBalancerListenerIdentityById
+ load_balancer_listener_identity_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004'
- # 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)
+ # 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 image_status_reason_model == image_status_reason_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
- image_status_reason_model_json2 = image_status_reason_model.to_dict()
- assert image_status_reason_model_json2 == image_status_reason_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_Instance:
+class TestModel_LoadBalancerListenerPatch:
"""
- Test Class for Instance
+ Test Class for LoadBalancerListenerPatch
"""
- def test_instance_serialization(self):
+ def test_load_balancer_listener_patch_serialization(self):
"""
- Test serialization/deserialization for Instance
+ Test serialization/deserialization for LoadBalancerListenerPatch
"""
# Construct dict forms of any model objects needed in order to build this model.
- instance_availability_policy_model = {} # InstanceAvailabilityPolicy
- instance_availability_policy_model['host_failure'] = 'restart'
-
- volume_attachment_reference_instance_context_deleted_model = {} # VolumeAttachmentReferenceInstanceContextDeleted
- volume_attachment_reference_instance_context_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
-
- volume_attachment_device_model = {} # VolumeAttachmentDevice
- volume_attachment_device_model['id'] = 'a8a15363-a6f7-4f01-af60-715e85b28141'
-
- volume_reference_volume_attachment_context_deleted_model = {} # VolumeReferenceVolumeAttachmentContextDeleted
- volume_reference_volume_attachment_context_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:secrets-manager:us-south:a/123456:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5'
- volume_reference_volume_attachment_context_model = {} # VolumeReferenceVolumeAttachmentContext
- volume_reference_volume_attachment_context_model['crn'] = 'crn:[...]'
- volume_reference_volume_attachment_context_model['deleted'] = volume_reference_volume_attachment_context_deleted_model
- volume_reference_volume_attachment_context_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volumes/49c5d61b-41e7-4c01-9b7a-1a97366c6916'
- volume_reference_volume_attachment_context_model['id'] = '49c5d61b-41e7-4c01-9b7a-1a97366c6916'
- volume_reference_volume_attachment_context_model['name'] = 'my-boot-volume'
- volume_reference_volume_attachment_context_model['resource_type'] = 'volume'
+ load_balancer_pool_identity_model = {} # LoadBalancerPoolIdentityById
+ load_balancer_pool_identity_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004'
- 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'] = '7389-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_volume_attachment_context_model
+ load_balancer_listener_identity_model = {} # LoadBalancerListenerIdentityById
+ load_balancer_listener_identity_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004'
- catalog_offering_version_reference_model = {} # CatalogOfferingVersionReference
- catalog_offering_version_reference_model['crn'] = 'crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d'
+ 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'
- instance_catalog_offering_model = {} # InstanceCatalogOffering
- instance_catalog_offering_model['version'] = catalog_offering_version_reference_model
+ # 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['idle_connection_timeout'] = 100
+ 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'
- 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 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
- 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 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)
- 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 load_balancer_listener_patch_model == load_balancer_listener_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
+ 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
- image_reference_deleted_model = {} # ImageReferenceDeleted
- image_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- account_reference_model = {} # AccountReference
- account_reference_model['id'] = 'aa2432b1fa4d4ace891e9b80fc104e34'
- account_reference_model['resource_type'] = 'account'
+class TestModel_LoadBalancerListenerPolicy:
+ """
+ Test Class for LoadBalancerListenerPolicy
+ """
- 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'
+ def test_load_balancer_listener_policy_serialization(self):
+ """
+ Test serialization/deserialization for LoadBalancerListenerPolicy
+ """
- image_remote_model = {} # ImageRemote
- image_remote_model['account'] = account_reference_model
- image_remote_model['region'] = region_reference_model
+ # Construct dict forms of any model objects needed in order to build this model.
- 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'
- image_reference_model['remote'] = image_remote_model
- image_reference_model['resource_type'] = 'image'
+ 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'
- instance_lifecycle_reason_model = {} # InstanceLifecycleReason
- instance_lifecycle_reason_model['code'] = 'resource_suspended_by_provider'
- instance_lifecycle_reason_model['message'] = 'The resource has been suspended. Contact IBM support with the CRN for next steps.'
- instance_lifecycle_reason_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#resource-suspension'
+ 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'
- instance_metadata_service_model = {} # InstanceMetadataService
- instance_metadata_service_model['enabled'] = True
- instance_metadata_service_model['protocol'] = 'http'
- instance_metadata_service_model['response_hop_limit'] = 1
+ load_balancer_pool_reference_deleted_model = {} # LoadBalancerPoolReferenceDeleted
+ load_balancer_pool_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- 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_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'
- 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 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
- reserved_ip_reference_model = {} # ReservedIPReference
- reserved_ip_reference_model['address'] = '10.0.0.32'
- reserved_ip_reference_model['deleted'] = reserved_ip_reference_deleted_model
- reserved_ip_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/0716-b28a7e6d-a66b-4de7-8713-15dcffdce401/reserved_ips/0716-7768a27e-cd6c-4a13-a9e6-d67a964e54a5'
- reserved_ip_reference_model['id'] = '0716-7768a27e-cd6c-4a13-a9e6-d67a964e54a5'
- reserved_ip_reference_model['name'] = 'my-reserved-ip-1'
- reserved_ip_reference_model['resource_type'] = 'subnet_reserved_ip'
+ # 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
- subnet_reference_deleted_model = {} # SubnetReferenceDeleted
- subnet_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ # 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)
- 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'
- subnet_reference_model['resource_type'] = 'subnet'
+ # Verify the model instances are equivalent
+ assert load_balancer_listener_policy_model == load_balancer_listener_policy_model2
- 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_ip'] = reserved_ip_reference_model
- network_interface_instance_context_reference_model['resource_type'] = 'network_interface'
- network_interface_instance_context_reference_model['subnet'] = subnet_reference_model
+ # 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
- 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-84e4793a-7cd8-4a7b-b253-818aa19d0512'
- instance_placement_target_model['id'] = '0787-84e4793a-7cd8-4a7b-b253-818aa19d0512'
- instance_placement_target_model['name'] = 'test-new'
- instance_placement_target_model['resource_type'] = 'dedicated_host'
+class TestModel_LoadBalancerListenerPolicyCollection:
+ """
+ Test Class for LoadBalancerListenerPolicyCollection
+ """
- 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_load_balancer_listener_policy_collection_serialization(self):
+ """
+ Test serialization/deserialization for LoadBalancerListenerPolicyCollection
+ """
- 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'
+ 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'
- instance_vcpu_model = {} # InstanceVCPU
- instance_vcpu_model['architecture'] = 'amd64'
- instance_vcpu_model['count'] = 2
- instance_vcpu_model['manufacturer'] = 'intel'
+ 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'
- vpc_reference_deleted_model = {} # VPCReferenceDeleted
- vpc_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'
- 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'
- vpc_reference_model['resource_type'] = 'vpc'
+ 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'
- 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'
+ 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 Instance model
- instance_model_json = {}
- instance_model_json['availability_policy'] = instance_availability_policy_model
- instance_model_json['bandwidth'] = 1000
- instance_model_json['boot_volume_attachment'] = volume_attachment_reference_instance_context_model
- instance_model_json['catalog_offering'] = instance_catalog_offering_model
- instance_model_json['created_at'] = '2019-01-01T12:00:00Z'
- instance_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a'
- instance_model_json['dedicated_host'] = dedicated_host_reference_model
- 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['lifecycle_reasons'] = [instance_lifecycle_reason_model]
- instance_model_json['lifecycle_state'] = 'stable'
- instance_model_json['memory'] = 8
- instance_model_json['metadata_service'] = instance_metadata_service_model
- instance_model_json['name'] = 'my-instance'
- instance_model_json['network_interfaces'] = [network_interface_instance_context_reference_model]
- instance_model_json['numa_count'] = 2
- 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['resource_type'] = 'instance'
- 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 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 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 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 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 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_model == instance_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_model_json2 = instance_model.to_dict()
- assert instance_model_json2 == instance_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_InstanceAction:
+class TestModel_LoadBalancerListenerPolicyPatch:
"""
- Test Class for InstanceAction
+ Test Class for LoadBalancerListenerPolicyPatch
"""
- def test_instance_action_serialization(self):
+ def test_load_balancer_listener_policy_patch_serialization(self):
"""
- Test serialization/deserialization for InstanceAction
+ Test serialization/deserialization for LoadBalancerListenerPolicyPatch
"""
- # 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 dict forms of any model objects needed in order to build this model.
- # 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
+ 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 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 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 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
+
+ # 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)
# Verify the model instances are equivalent
- assert instance_action_model == instance_action_model2
+ assert load_balancer_listener_policy_patch_model == load_balancer_listener_policy_patch_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
+ 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
-class TestModel_InstanceAvailabilityPolicy:
+class TestModel_LoadBalancerListenerPolicyPrototype:
"""
- Test Class for InstanceAvailabilityPolicy
+ Test Class for LoadBalancerListenerPolicyPrototype
"""
- def test_instance_availability_policy_serialization(self):
+ def test_load_balancer_listener_policy_prototype_serialization(self):
"""
- Test serialization/deserialization for InstanceAvailabilityPolicy
+ Test serialization/deserialization for LoadBalancerListenerPolicyPrototype
"""
- # Construct a json representation of a InstanceAvailabilityPolicy model
- instance_availability_policy_model_json = {}
- instance_availability_policy_model_json['host_failure'] = 'restart'
+ # Construct dict forms of any model objects needed in order to build this model.
- # Construct a model instance of InstanceAvailabilityPolicy by calling from_dict on the json representation
- instance_availability_policy_model = InstanceAvailabilityPolicy.from_dict(instance_availability_policy_model_json)
- assert instance_availability_policy_model != False
+ 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'
- # Construct a model instance of InstanceAvailabilityPolicy by calling from_dict on the json representation
- instance_availability_policy_model_dict = InstanceAvailabilityPolicy.from_dict(instance_availability_policy_model_json).__dict__
- instance_availability_policy_model2 = InstanceAvailabilityPolicy(**instance_availability_policy_model_dict)
+ 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 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 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 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_availability_policy_model == instance_availability_policy_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_availability_policy_model_json2 = instance_availability_policy_model.to_dict()
- assert instance_availability_policy_model_json2 == instance_availability_policy_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_InstanceAvailabilityPolicyPatch:
+class TestModel_LoadBalancerListenerPolicyReference:
"""
- Test Class for InstanceAvailabilityPolicyPatch
+ Test Class for LoadBalancerListenerPolicyReference
"""
- def test_instance_availability_policy_patch_serialization(self):
+ def test_load_balancer_listener_policy_reference_serialization(self):
"""
- Test serialization/deserialization for InstanceAvailabilityPolicyPatch
+ Test serialization/deserialization for LoadBalancerListenerPolicyReference
"""
- # Construct a json representation of a InstanceAvailabilityPolicyPatch model
- instance_availability_policy_patch_model_json = {}
- instance_availability_policy_patch_model_json['host_failure'] = 'restart'
+ # Construct dict forms of any model objects needed in order to build this model.
- # Construct a model instance of InstanceAvailabilityPolicyPatch by calling from_dict on the json representation
- instance_availability_policy_patch_model = InstanceAvailabilityPolicyPatch.from_dict(instance_availability_policy_patch_model_json)
- assert instance_availability_policy_patch_model != False
+ 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 InstanceAvailabilityPolicyPatch by calling from_dict on the json representation
- instance_availability_policy_patch_model_dict = InstanceAvailabilityPolicyPatch.from_dict(instance_availability_policy_patch_model_json).__dict__
- instance_availability_policy_patch_model2 = InstanceAvailabilityPolicyPatch(**instance_availability_policy_patch_model_dict)
+ # 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_listener_policy_reference_model_json['name'] = 'my-policy'
+
+ # 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_availability_policy_patch_model == instance_availability_policy_patch_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_availability_policy_patch_model_json2 = instance_availability_policy_patch_model.to_dict()
- assert instance_availability_policy_patch_model_json2 == instance_availability_policy_patch_model_json
+ 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_InstanceAvailabilityPolicyPrototype:
+class TestModel_LoadBalancerListenerPolicyReferenceDeleted:
"""
- Test Class for InstanceAvailabilityPolicyPrototype
+ Test Class for LoadBalancerListenerPolicyReferenceDeleted
"""
- def test_instance_availability_policy_prototype_serialization(self):
+ def test_load_balancer_listener_policy_reference_deleted_serialization(self):
"""
- Test serialization/deserialization for InstanceAvailabilityPolicyPrototype
+ Test serialization/deserialization for LoadBalancerListenerPolicyReferenceDeleted
"""
- # Construct a json representation of a InstanceAvailabilityPolicyPrototype model
- instance_availability_policy_prototype_model_json = {}
- instance_availability_policy_prototype_model_json['host_failure'] = 'restart'
+ # 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 InstanceAvailabilityPolicyPrototype by calling from_dict on the json representation
- instance_availability_policy_prototype_model = InstanceAvailabilityPolicyPrototype.from_dict(instance_availability_policy_prototype_model_json)
- assert instance_availability_policy_prototype_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 InstanceAvailabilityPolicyPrototype by calling from_dict on the json representation
- instance_availability_policy_prototype_model_dict = InstanceAvailabilityPolicyPrototype.from_dict(instance_availability_policy_prototype_model_json).__dict__
- instance_availability_policy_prototype_model2 = InstanceAvailabilityPolicyPrototype(**instance_availability_policy_prototype_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_availability_policy_prototype_model == instance_availability_policy_prototype_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_availability_policy_prototype_model_json2 = instance_availability_policy_prototype_model.to_dict()
- assert instance_availability_policy_prototype_model_json2 == instance_availability_policy_prototype_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_InstanceCatalogOffering:
+class TestModel_LoadBalancerListenerPolicyRule:
"""
- Test Class for InstanceCatalogOffering
+ Test Class for LoadBalancerListenerPolicyRule
"""
- def test_instance_catalog_offering_serialization(self):
+ def test_load_balancer_listener_policy_rule_serialization(self):
"""
- Test serialization/deserialization for InstanceCatalogOffering
+ Test serialization/deserialization for LoadBalancerListenerPolicyRule
"""
- # Construct dict forms of any model objects needed in order to build this model.
-
- catalog_offering_version_reference_model = {} # CatalogOfferingVersionReference
- catalog_offering_version_reference_model['crn'] = 'crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d'
-
- # Construct a json representation of a InstanceCatalogOffering model
- instance_catalog_offering_model_json = {}
- instance_catalog_offering_model_json['version'] = catalog_offering_version_reference_model
-
- # Construct a model instance of InstanceCatalogOffering by calling from_dict on the json representation
- instance_catalog_offering_model = InstanceCatalogOffering.from_dict(instance_catalog_offering_model_json)
- assert instance_catalog_offering_model != False
+ # Construct a 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 InstanceCatalogOffering by calling from_dict on the json representation
- instance_catalog_offering_model_dict = InstanceCatalogOffering.from_dict(instance_catalog_offering_model_json).__dict__
- instance_catalog_offering_model2 = InstanceCatalogOffering(**instance_catalog_offering_model_dict)
+ # 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 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_catalog_offering_model == instance_catalog_offering_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_catalog_offering_model_json2 = instance_catalog_offering_model.to_dict()
- assert instance_catalog_offering_model_json2 == instance_catalog_offering_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_InstanceCollection:
+class TestModel_LoadBalancerListenerPolicyRuleCollection:
"""
- Test Class for InstanceCollection
+ Test Class for LoadBalancerListenerPolicyRuleCollection
"""
- def test_instance_collection_serialization(self):
+ def test_load_balancer_listener_policy_rule_collection_serialization(self):
"""
- Test serialization/deserialization for InstanceCollection
+ Test serialization/deserialization for LoadBalancerListenerPolicyRuleCollection
"""
# 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'
-
- instance_availability_policy_model = {} # InstanceAvailabilityPolicy
- instance_availability_policy_model['host_failure'] = 'restart'
-
- volume_attachment_reference_instance_context_deleted_model = {} # VolumeAttachmentReferenceInstanceContextDeleted
- volume_attachment_reference_instance_context_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ 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'
- volume_attachment_device_model = {} # VolumeAttachmentDevice
- volume_attachment_device_model['id'] = '80b3e36e-41f4-40e9-bd56-beae81792a68'
+ # 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]
- volume_reference_volume_attachment_context_deleted_model = {} # VolumeReferenceVolumeAttachmentContextDeleted
- volume_reference_volume_attachment_context_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ # 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
- volume_reference_volume_attachment_context_model = {} # VolumeReferenceVolumeAttachmentContext
- volume_reference_volume_attachment_context_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
- volume_reference_volume_attachment_context_model['deleted'] = volume_reference_volume_attachment_context_deleted_model
- volume_reference_volume_attachment_context_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
- volume_reference_volume_attachment_context_model['id'] = '1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
- volume_reference_volume_attachment_context_model['name'] = 'my-volume'
- volume_reference_volume_attachment_context_model['resource_type'] = 'volume'
+ # 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)
- 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_volume_attachment_context_model
+ # Verify the model instances are equivalent
+ assert load_balancer_listener_policy_rule_collection_model == load_balancer_listener_policy_rule_collection_model2
- catalog_offering_version_reference_model = {} # CatalogOfferingVersionReference
- catalog_offering_version_reference_model['crn'] = 'crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d'
+ # 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
- instance_catalog_offering_model = {} # InstanceCatalogOffering
- instance_catalog_offering_model['version'] = catalog_offering_version_reference_model
- dedicated_host_reference_deleted_model = {} # DedicatedHostReferenceDeleted
- dedicated_host_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+class TestModel_LoadBalancerListenerPolicyRulePatch:
+ """
+ Test Class for LoadBalancerListenerPolicyRulePatch
+ """
- 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'
+ def test_load_balancer_listener_policy_rule_patch_serialization(self):
+ """
+ Test serialization/deserialization for LoadBalancerListenerPolicyRulePatch
+ """
- 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 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'
- 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 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
- image_reference_deleted_model = {} # ImageReferenceDeleted
- image_reference_deleted_model['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_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)
- account_reference_model = {} # AccountReference
- account_reference_model['id'] = 'aa2432b1fa4d4ace891e9b80fc104e34'
- account_reference_model['resource_type'] = 'account'
+ # Verify the model instances are equivalent
+ assert load_balancer_listener_policy_rule_patch_model == load_balancer_listener_policy_rule_patch_model2
- 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'
+ # 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
- image_remote_model = {} # ImageRemote
- image_remote_model['account'] = account_reference_model
- image_remote_model['region'] = region_reference_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'
- image_reference_model['remote'] = image_remote_model
- image_reference_model['resource_type'] = 'image'
+class TestModel_LoadBalancerListenerPolicyRulePrototype:
+ """
+ Test Class for LoadBalancerListenerPolicyRulePrototype
+ """
- instance_lifecycle_reason_model = {} # InstanceLifecycleReason
- instance_lifecycle_reason_model['code'] = 'resource_suspended_by_provider'
- instance_lifecycle_reason_model['message'] = 'The resource has been suspended. Contact IBM support with the CRN for next steps.'
- instance_lifecycle_reason_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#resource-suspension'
+ def test_load_balancer_listener_policy_rule_prototype_serialization(self):
+ """
+ Test serialization/deserialization for LoadBalancerListenerPolicyRulePrototype
+ """
- instance_metadata_service_model = {} # InstanceMetadataService
- instance_metadata_service_model['enabled'] = True
- instance_metadata_service_model['protocol'] = 'http'
- instance_metadata_service_model['response_hop_limit'] = 1
+ # 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'
- 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 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
- 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 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)
- 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'
+ # Verify the model instances are equivalent
+ assert load_balancer_listener_policy_rule_prototype_model == load_balancer_listener_policy_rule_prototype_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_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
- subnet_reference_model = {} # SubnetReference
- subnet_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
- subnet_reference_model['deleted'] = subnet_reference_deleted_model
- subnet_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
- subnet_reference_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
- subnet_reference_model['name'] = 'my-subnet'
- subnet_reference_model['resource_type'] = 'subnet'
- 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-instance-network-interface'
- network_interface_instance_context_reference_model['primary_ip'] = reserved_ip_reference_model
- network_interface_instance_context_reference_model['resource_type'] = 'network_interface'
- network_interface_instance_context_reference_model['subnet'] = subnet_reference_model
+class TestModel_LoadBalancerListenerPolicyRuleReference:
+ """
+ Test Class for LoadBalancerListenerPolicyRuleReference
+ """
- dedicated_host_group_reference_deleted_model = {} # DedicatedHostGroupReferenceDeleted
- dedicated_host_group_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ def test_load_balancer_listener_policy_rule_reference_serialization(self):
+ """
+ Test serialization/deserialization for LoadBalancerListenerPolicyRuleReference
+ """
- 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'
+ # Construct dict forms of any model objects needed in order to build this model.
- instance_profile_reference_model = {} # InstanceProfileReference
- instance_profile_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16'
- instance_profile_reference_model['name'] = 'bx2-4x16'
+ 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'
- 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 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
- instance_vcpu_model = {} # InstanceVCPU
- instance_vcpu_model['architecture'] = 'amd64'
- instance_vcpu_model['count'] = 4
- instance_vcpu_model['manufacturer'] = 'intel'
+ # 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)
- 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 load_balancer_listener_policy_rule_reference_model == load_balancer_listener_policy_rule_reference_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'
- vpc_reference_model['resource_type'] = 'vpc'
+ # 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
- 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['availability_policy'] = instance_availability_policy_model
- instance_model['bandwidth'] = 1000
- instance_model['boot_volume_attachment'] = volume_attachment_reference_instance_context_model
- instance_model['catalog_offering'] = instance_catalog_offering_model
- instance_model['created_at'] = '2019-01-01T12:00:00Z'
- instance_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a'
- instance_model['dedicated_host'] = dedicated_host_reference_model
- 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['lifecycle_reasons'] = [instance_lifecycle_reason_model]
- instance_model['lifecycle_state'] = 'stable'
- instance_model['memory'] = 8
- instance_model['metadata_service'] = instance_metadata_service_model
- instance_model['name'] = 'my-instance'
- instance_model['network_interfaces'] = [network_interface_instance_context_reference_model]
- instance_model['numa_count'] = 2
- 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['resource_type'] = 'instance'
- 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_LoadBalancerListenerPolicyRuleReferenceDeleted:
+ """
+ Test Class for LoadBalancerListenerPolicyRuleReferenceDeleted
+ """
- 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_load_balancer_listener_policy_rule_reference_deleted_serialization(self):
+ """
+ Test serialization/deserialization for LoadBalancerListenerPolicyRuleReferenceDeleted
+ """
- # 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 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 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 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 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 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 instance_collection_model == instance_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
- instance_collection_model_json2 = instance_collection_model.to_dict()
- assert instance_collection_model_json2 == instance_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_InstanceCollectionFirst:
+class TestModel_LoadBalancerListenerPrototypeLoadBalancerContext:
"""
- Test Class for InstanceCollectionFirst
+ Test Class for LoadBalancerListenerPrototypeLoadBalancerContext
"""
- def test_instance_collection_first_serialization(self):
+ def test_load_balancer_listener_prototype_load_balancer_context_serialization(self):
"""
- Test serialization/deserialization for InstanceCollectionFirst
+ Test serialization/deserialization for LoadBalancerListenerPrototypeLoadBalancerContext
"""
- # 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 dict forms of any model objects needed in order to build this model.
- # 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
+ certificate_instance_identity_model = {} # CertificateInstanceIdentityByCRN
+ certificate_instance_identity_model['crn'] = 'crn:v1:bluemix:public:secrets-manager:us-south:a/123456:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5'
- # 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)
+ load_balancer_pool_identity_by_name_model = {} # LoadBalancerPoolIdentityByName
+ load_balancer_pool_identity_by_name_model['name'] = 'my-load-balancer-pool'
+
+ load_balancer_listener_identity_model = {} # LoadBalancerListenerIdentityById
+ load_balancer_listener_identity_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004'
+
+ load_balancer_listener_https_redirect_prototype_model = {} # LoadBalancerListenerHTTPSRedirectPrototype
+ load_balancer_listener_https_redirect_prototype_model['http_status_code'] = 301
+ load_balancer_listener_https_redirect_prototype_model['listener'] = load_balancer_listener_identity_model
+ load_balancer_listener_https_redirect_prototype_model['uri'] = '/example?doc=get'
+
+ # Construct a json representation of a LoadBalancerListenerPrototypeLoadBalancerContext model
+ load_balancer_listener_prototype_load_balancer_context_model_json = {}
+ load_balancer_listener_prototype_load_balancer_context_model_json['accept_proxy_protocol'] = True
+ load_balancer_listener_prototype_load_balancer_context_model_json['certificate_instance'] = certificate_instance_identity_model
+ load_balancer_listener_prototype_load_balancer_context_model_json['connection_limit'] = 2000
+ load_balancer_listener_prototype_load_balancer_context_model_json['default_pool'] = load_balancer_pool_identity_by_name_model
+ load_balancer_listener_prototype_load_balancer_context_model_json['https_redirect'] = load_balancer_listener_https_redirect_prototype_model
+ load_balancer_listener_prototype_load_balancer_context_model_json['idle_connection_timeout'] = 100
+ 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 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 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 instance_collection_first_model == instance_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
- instance_collection_first_model_json2 = instance_collection_first_model.to_dict()
- assert instance_collection_first_model_json2 == instance_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_InstanceCollectionNext:
+class TestModel_LoadBalancerListenerReference:
"""
- Test Class for InstanceCollectionNext
+ Test Class for LoadBalancerListenerReference
"""
- def test_instance_collection_next_serialization(self):
+ def test_load_balancer_listener_reference_serialization(self):
"""
- Test serialization/deserialization for InstanceCollectionNext
+ Test serialization/deserialization for LoadBalancerListenerReference
"""
- # 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 dict forms of any model objects needed in order to build this model.
- # 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
+ 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 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 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 instance_collection_next_model == instance_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
- instance_collection_next_model_json2 = instance_collection_next_model.to_dict()
- assert instance_collection_next_model_json2 == instance_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_InstanceConsoleAccessToken:
+class TestModel_LoadBalancerListenerReferenceDeleted:
"""
- Test Class for InstanceConsoleAccessToken
+ Test Class for LoadBalancerListenerReferenceDeleted
"""
- def test_instance_console_access_token_serialization(self):
+ def test_load_balancer_listener_reference_deleted_serialization(self):
"""
- Test serialization/deserialization for InstanceConsoleAccessToken
+ Test serialization/deserialization for LoadBalancerListenerReferenceDeleted
"""
- # 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 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 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
+ # 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 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 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 instance_console_access_token_model == instance_console_access_token_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
- 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
+ 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_InstanceDefaultTrustedProfilePrototype:
+class TestModel_LoadBalancerLogging:
"""
- Test Class for InstanceDefaultTrustedProfilePrototype
+ Test Class for LoadBalancerLogging
"""
- def test_instance_default_trusted_profile_prototype_serialization(self):
+ def test_load_balancer_logging_serialization(self):
"""
- Test serialization/deserialization for InstanceDefaultTrustedProfilePrototype
+ Test serialization/deserialization for LoadBalancerLogging
"""
# Construct dict forms of any model objects needed in order to build this model.
- trusted_profile_identity_model = {} # TrustedProfileIdentityTrustedProfileById
- trusted_profile_identity_model['id'] = 'Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5'
+ load_balancer_logging_datapath_model = {} # LoadBalancerLoggingDatapath
+ load_balancer_logging_datapath_model['active'] = True
- # Construct a json representation of a InstanceDefaultTrustedProfilePrototype model
- instance_default_trusted_profile_prototype_model_json = {}
- instance_default_trusted_profile_prototype_model_json['auto_link'] = False
- instance_default_trusted_profile_prototype_model_json['target'] = trusted_profile_identity_model
+ # Construct a 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 InstanceDefaultTrustedProfilePrototype by calling from_dict on the json representation
- instance_default_trusted_profile_prototype_model = InstanceDefaultTrustedProfilePrototype.from_dict(instance_default_trusted_profile_prototype_model_json)
- assert instance_default_trusted_profile_prototype_model != False
+ # Construct a model instance of 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 InstanceDefaultTrustedProfilePrototype by calling from_dict on the json representation
- instance_default_trusted_profile_prototype_model_dict = InstanceDefaultTrustedProfilePrototype.from_dict(instance_default_trusted_profile_prototype_model_json).__dict__
- instance_default_trusted_profile_prototype_model2 = InstanceDefaultTrustedProfilePrototype(**instance_default_trusted_profile_prototype_model_dict)
+ # 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 instance_default_trusted_profile_prototype_model == instance_default_trusted_profile_prototype_model2
+ assert load_balancer_logging_model == load_balancer_logging_model2
# Convert model instance back to dict and verify no loss of data
- instance_default_trusted_profile_prototype_model_json2 = instance_default_trusted_profile_prototype_model.to_dict()
- assert instance_default_trusted_profile_prototype_model_json2 == instance_default_trusted_profile_prototype_model_json
+ load_balancer_logging_model_json2 = load_balancer_logging_model.to_dict()
+ assert load_balancer_logging_model_json2 == load_balancer_logging_model_json
-class TestModel_InstanceDisk:
+class TestModel_LoadBalancerLoggingDatapath:
"""
- Test Class for InstanceDisk
+ Test Class for LoadBalancerLoggingDatapath
"""
- def test_instance_disk_serialization(self):
+ def test_load_balancer_logging_datapath_serialization(self):
"""
- Test serialization/deserialization for InstanceDisk
+ Test serialization/deserialization for LoadBalancerLoggingDatapath
"""
- # 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 LoadBalancerLoggingDatapath model
+ load_balancer_logging_datapath_model_json = {}
+ load_balancer_logging_datapath_model_json['active'] = True
- # 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 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 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 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 instance_disk_model == instance_disk_model2
+ assert load_balancer_logging_datapath_model == load_balancer_logging_datapath_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
+ 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_InstanceDiskCollection:
+class TestModel_LoadBalancerLoggingDatapathPatch:
"""
- Test Class for InstanceDiskCollection
+ Test Class for LoadBalancerLoggingDatapathPatch
"""
- def test_instance_disk_collection_serialization(self):
+ def test_load_balancer_logging_datapath_patch_serialization(self):
"""
- Test serialization/deserialization for InstanceDiskCollection
+ Test serialization/deserialization for LoadBalancerLoggingDatapathPatch
"""
- # 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 json representation of a LoadBalancerLoggingDatapathPatch model
+ load_balancer_logging_datapath_patch_model_json = {}
+ load_balancer_logging_datapath_patch_model_json['active'] = True
- # 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 LoadBalancerLoggingDatapathPatch by calling from_dict on the json representation
+ load_balancer_logging_datapath_patch_model = LoadBalancerLoggingDatapathPatch.from_dict(load_balancer_logging_datapath_patch_model_json)
+ assert load_balancer_logging_datapath_patch_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 LoadBalancerLoggingDatapathPatch by calling from_dict on the json representation
+ load_balancer_logging_datapath_patch_model_dict = LoadBalancerLoggingDatapathPatch.from_dict(load_balancer_logging_datapath_patch_model_json).__dict__
+ load_balancer_logging_datapath_patch_model2 = LoadBalancerLoggingDatapathPatch(**load_balancer_logging_datapath_patch_model_dict)
# Verify the model instances are equivalent
- assert instance_disk_collection_model == instance_disk_collection_model2
+ assert load_balancer_logging_datapath_patch_model == load_balancer_logging_datapath_patch_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
+ load_balancer_logging_datapath_patch_model_json2 = load_balancer_logging_datapath_patch_model.to_dict()
+ assert load_balancer_logging_datapath_patch_model_json2 == load_balancer_logging_datapath_patch_model_json
-class TestModel_InstanceDiskPatch:
+class TestModel_LoadBalancerLoggingDatapathPrototype:
"""
- Test Class for InstanceDiskPatch
+ Test Class for LoadBalancerLoggingDatapathPrototype
"""
- def test_instance_disk_patch_serialization(self):
+ def test_load_balancer_logging_datapath_prototype_serialization(self):
"""
- Test serialization/deserialization for InstanceDiskPatch
+ Test serialization/deserialization for LoadBalancerLoggingDatapathPrototype
"""
- # 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 LoadBalancerLoggingDatapathPrototype model
+ load_balancer_logging_datapath_prototype_model_json = {}
+ load_balancer_logging_datapath_prototype_model_json['active'] = True
- # 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 LoadBalancerLoggingDatapathPrototype by calling from_dict on the json representation
+ load_balancer_logging_datapath_prototype_model = LoadBalancerLoggingDatapathPrototype.from_dict(load_balancer_logging_datapath_prototype_model_json)
+ assert load_balancer_logging_datapath_prototype_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 LoadBalancerLoggingDatapathPrototype by calling from_dict on the json representation
+ load_balancer_logging_datapath_prototype_model_dict = LoadBalancerLoggingDatapathPrototype.from_dict(load_balancer_logging_datapath_prototype_model_json).__dict__
+ load_balancer_logging_datapath_prototype_model2 = LoadBalancerLoggingDatapathPrototype(**load_balancer_logging_datapath_prototype_model_dict)
# Verify the model instances are equivalent
- assert instance_disk_patch_model == instance_disk_patch_model2
+ assert load_balancer_logging_datapath_prototype_model == load_balancer_logging_datapath_prototype_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
+ load_balancer_logging_datapath_prototype_model_json2 = load_balancer_logging_datapath_prototype_model.to_dict()
+ assert load_balancer_logging_datapath_prototype_model_json2 == load_balancer_logging_datapath_prototype_model_json
-class TestModel_InstanceDiskReference:
+class TestModel_LoadBalancerLoggingPatch:
"""
- Test Class for InstanceDiskReference
+ Test Class for LoadBalancerLoggingPatch
"""
- def test_instance_disk_reference_serialization(self):
+ def test_load_balancer_logging_patch_serialization(self):
"""
- Test serialization/deserialization for InstanceDiskReference
+ Test serialization/deserialization for LoadBalancerLoggingPatch
"""
# 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'
+ load_balancer_logging_datapath_patch_model = {} # LoadBalancerLoggingDatapathPatch
+ load_balancer_logging_datapath_patch_model['active'] = True
- # 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 LoadBalancerLoggingPatch model
+ load_balancer_logging_patch_model_json = {}
+ load_balancer_logging_patch_model_json['datapath'] = load_balancer_logging_datapath_patch_model
- # 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 LoadBalancerLoggingPatch by calling from_dict on the json representation
+ load_balancer_logging_patch_model = LoadBalancerLoggingPatch.from_dict(load_balancer_logging_patch_model_json)
+ assert load_balancer_logging_patch_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 LoadBalancerLoggingPatch by calling from_dict on the json representation
+ load_balancer_logging_patch_model_dict = LoadBalancerLoggingPatch.from_dict(load_balancer_logging_patch_model_json).__dict__
+ load_balancer_logging_patch_model2 = LoadBalancerLoggingPatch(**load_balancer_logging_patch_model_dict)
# Verify the model instances are equivalent
- assert instance_disk_reference_model == instance_disk_reference_model2
+ assert load_balancer_logging_patch_model == load_balancer_logging_patch_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
+ load_balancer_logging_patch_model_json2 = load_balancer_logging_patch_model.to_dict()
+ assert load_balancer_logging_patch_model_json2 == load_balancer_logging_patch_model_json
-class TestModel_InstanceDiskReferenceDeleted:
+class TestModel_LoadBalancerLoggingPrototype:
"""
- Test Class for InstanceDiskReferenceDeleted
+ Test Class for LoadBalancerLoggingPrototype
"""
- def test_instance_disk_reference_deleted_serialization(self):
+ def test_load_balancer_logging_prototype_serialization(self):
"""
- Test serialization/deserialization for InstanceDiskReferenceDeleted
+ Test serialization/deserialization for LoadBalancerLoggingPrototype
"""
- # 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 dict forms of any model objects needed in order to build this model.
- # 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
+ load_balancer_logging_datapath_prototype_model = {} # LoadBalancerLoggingDatapathPrototype
+ load_balancer_logging_datapath_prototype_model['active'] = True
- # 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 json representation of a LoadBalancerLoggingPrototype model
+ load_balancer_logging_prototype_model_json = {}
+ load_balancer_logging_prototype_model_json['datapath'] = load_balancer_logging_datapath_prototype_model
+
+ # Construct a model instance of LoadBalancerLoggingPrototype by calling from_dict on the json representation
+ load_balancer_logging_prototype_model = LoadBalancerLoggingPrototype.from_dict(load_balancer_logging_prototype_model_json)
+ assert load_balancer_logging_prototype_model != False
+
+ # Construct a model instance of LoadBalancerLoggingPrototype by calling from_dict on the json representation
+ load_balancer_logging_prototype_model_dict = LoadBalancerLoggingPrototype.from_dict(load_balancer_logging_prototype_model_json).__dict__
+ load_balancer_logging_prototype_model2 = LoadBalancerLoggingPrototype(**load_balancer_logging_prototype_model_dict)
# Verify the model instances are equivalent
- assert instance_disk_reference_deleted_model == instance_disk_reference_deleted_model2
+ assert load_balancer_logging_prototype_model == load_balancer_logging_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
+ load_balancer_logging_prototype_model_json2 = load_balancer_logging_prototype_model.to_dict()
+ assert load_balancer_logging_prototype_model_json2 == load_balancer_logging_prototype_model_json
-class TestModel_InstanceGPU:
+class TestModel_LoadBalancerPatch:
"""
- Test Class for InstanceGPU
+ Test Class for LoadBalancerPatch
"""
- def test_instance_gpu_serialization(self):
+ def test_load_balancer_patch_serialization(self):
"""
- Test serialization/deserialization for InstanceGPU
+ Test serialization/deserialization for LoadBalancerPatch
"""
- # 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
+ dns_instance_identity_model = {} # DNSInstanceIdentityByCRN
+ dns_instance_identity_model['crn'] = 'crn:v1:bluemix:public:dns-svcs:global:a/123456:6860c359-b2e2-46fa-a944-b38c28201c6e'
- # 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)
+ dns_zone_identity_model = {} # DNSZoneIdentityById
+ dns_zone_identity_model['id'] = 'd66662cc-aa23-4fe1-9987-858487a61f45'
+
+ load_balancer_dns_patch_model = {} # LoadBalancerDNSPatch
+ load_balancer_dns_patch_model['instance'] = dns_instance_identity_model
+ load_balancer_dns_patch_model['zone'] = dns_zone_identity_model
+
+ load_balancer_logging_datapath_patch_model = {} # LoadBalancerLoggingDatapathPatch
+ load_balancer_logging_datapath_patch_model['active'] = True
+
+ load_balancer_logging_patch_model = {} # LoadBalancerLoggingPatch
+ load_balancer_logging_patch_model['datapath'] = load_balancer_logging_datapath_patch_model
+
+ subnet_identity_model = {} # SubnetIdentityById
+ subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
+
+ # Construct a json representation of a LoadBalancerPatch model
+ load_balancer_patch_model_json = {}
+ load_balancer_patch_model_json['dns'] = load_balancer_dns_patch_model
+ load_balancer_patch_model_json['logging'] = load_balancer_logging_patch_model
+ load_balancer_patch_model_json['name'] = 'my-load-balancer'
+ load_balancer_patch_model_json['subnets'] = [subnet_identity_model]
+
+ # Construct a model instance of LoadBalancerPatch by calling from_dict on the json representation
+ load_balancer_patch_model = LoadBalancerPatch.from_dict(load_balancer_patch_model_json)
+ assert load_balancer_patch_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)
# Verify the model instances are equivalent
- assert instance_gpu_model == instance_gpu_model2
+ assert load_balancer_patch_model == load_balancer_patch_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
+ load_balancer_patch_model_json2 = load_balancer_patch_model.to_dict()
+ assert load_balancer_patch_model_json2 == load_balancer_patch_model_json
-class TestModel_InstanceGroup:
+class TestModel_LoadBalancerPool:
"""
- Test Class for InstanceGroup
+ Test Class for LoadBalancerPool
"""
- def test_instance_group_serialization(self):
+ def test_load_balancer_pool_serialization(self):
"""
- Test serialization/deserialization for InstanceGroup
+ Test serialization/deserialization for LoadBalancerPool
"""
# 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'
-
- 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_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'
-
- 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'
+ 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'] = '/'
- 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_reference_deleted_model = {} # InstanceGroupReferenceDeleted
+ instance_group_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'
+ 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'
- subnet_reference_model = {} # SubnetReference
- subnet_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
- subnet_reference_model['deleted'] = subnet_reference_deleted_model
- subnet_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
- subnet_reference_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
- subnet_reference_model['name'] = 'my-subnet'
- subnet_reference_model['resource_type'] = 'subnet'
+ 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'
- vpc_reference_deleted_model = {} # VPCReferenceDeleted
- vpc_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'
- vpc_reference_model = {} # VPCReference
- vpc_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b'
- vpc_reference_model['deleted'] = vpc_reference_deleted_model
- vpc_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b'
- vpc_reference_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b'
- vpc_reference_model['name'] = 'my-vpc'
- vpc_reference_model['resource_type'] = 'vpc'
+ 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 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 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 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 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 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 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 instance_group_model == instance_group_model2
+ assert load_balancer_pool_model == load_balancer_pool_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
+ load_balancer_pool_model_json2 = load_balancer_pool_model.to_dict()
+ assert load_balancer_pool_model_json2 == load_balancer_pool_model_json
-class TestModel_InstanceGroupCollection:
+class TestModel_LoadBalancerPoolCollection:
"""
- Test Class for InstanceGroupCollection
+ Test Class for LoadBalancerPoolCollection
"""
- def test_instance_group_collection_serialization(self):
+ def test_load_balancer_pool_collection_serialization(self):
"""
- Test serialization/deserialization for InstanceGroupCollection
+ Test serialization/deserialization for LoadBalancerPoolCollection
"""
# Construct dict forms of any model objects needed in order to build this model.
- instance_group_collection_first_model = {} # InstanceGroupCollectionFirst
- instance_group_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups?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'] = '/'
- instance_template_reference_deleted_model = {} # InstanceTemplateReferenceDeleted
- instance_template_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'
- 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'
+ 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_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'
+ 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'
- 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'
+ 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
- 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 LoadBalancerPoolCollection model
+ load_balancer_pool_collection_model_json = {}
+ load_balancer_pool_collection_model_json['pools'] = [load_balancer_pool_model]
- subnet_reference_deleted_model = {} # SubnetReferenceDeleted
- subnet_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ # 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
- subnet_reference_model = {} # SubnetReference
- subnet_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
- subnet_reference_model['deleted'] = subnet_reference_deleted_model
- subnet_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
- subnet_reference_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
- subnet_reference_model['name'] = 'my-subnet'
- subnet_reference_model['resource_type'] = 'subnet'
+ # Construct a 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)
- 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 load_balancer_pool_collection_model == load_balancer_pool_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'
- vpc_reference_model['resource_type'] = 'vpc'
+ # 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
- 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
- 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'
+class TestModel_LoadBalancerPoolHealthMonitor:
+ """
+ Test Class for LoadBalancerPoolHealthMonitor
+ """
- # 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
+ def test_load_balancer_pool_health_monitor_serialization(self):
+ """
+ Test serialization/deserialization for LoadBalancerPoolHealthMonitor
+ """
- # 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 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 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)
+ # 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 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)
# Verify the model instances are equivalent
- assert instance_group_collection_model == instance_group_collection_model2
+ assert load_balancer_pool_health_monitor_model == load_balancer_pool_health_monitor_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
+ 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_InstanceGroupCollectionFirst:
+class TestModel_LoadBalancerPoolHealthMonitorPatch:
"""
- Test Class for InstanceGroupCollectionFirst
+ Test Class for LoadBalancerPoolHealthMonitorPatch
"""
- def test_instance_group_collection_first_serialization(self):
+ def test_load_balancer_pool_health_monitor_patch_serialization(self):
"""
- Test serialization/deserialization for InstanceGroupCollectionFirst
+ Test serialization/deserialization for LoadBalancerPoolHealthMonitorPatch
"""
- # 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 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 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 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 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 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 instance_group_collection_first_model == instance_group_collection_first_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
- 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
+ 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_InstanceGroupCollectionNext:
+class TestModel_LoadBalancerPoolHealthMonitorPrototype:
"""
- Test Class for InstanceGroupCollectionNext
+ Test Class for LoadBalancerPoolHealthMonitorPrototype
"""
- def test_instance_group_collection_next_serialization(self):
+ def test_load_balancer_pool_health_monitor_prototype_serialization(self):
"""
- Test serialization/deserialization for InstanceGroupCollectionNext
+ Test serialization/deserialization for LoadBalancerPoolHealthMonitorPrototype
"""
- # 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 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 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 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 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 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 instance_group_collection_next_model == instance_group_collection_next_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
- 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
+ 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_InstanceGroupManagerActionGroupPatch:
+class TestModel_LoadBalancerPoolIdentityByName:
"""
- Test Class for InstanceGroupManagerActionGroupPatch
+ Test Class for LoadBalancerPoolIdentityByName
"""
- def test_instance_group_manager_action_group_patch_serialization(self):
+ def test_load_balancer_pool_identity_by_name_serialization(self):
"""
- Test serialization/deserialization for InstanceGroupManagerActionGroupPatch
+ Test serialization/deserialization for LoadBalancerPoolIdentityByName
"""
- # 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 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 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 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 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 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 instance_group_manager_action_group_patch_model == instance_group_manager_action_group_patch_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
- 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
+ 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_InstanceGroupManagerActionManagerPatch:
+class TestModel_LoadBalancerPoolMember:
"""
- Test Class for InstanceGroupManagerActionManagerPatch
+ Test Class for LoadBalancerPoolMember
"""
- def test_instance_group_manager_action_manager_patch_serialization(self):
+ def test_load_balancer_pool_member_serialization(self):
"""
- Test serialization/deserialization for InstanceGroupManagerActionManagerPatch
+ Test serialization/deserialization for LoadBalancerPoolMember
"""
- # 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
+ instance_reference_deleted_model = {} # InstanceReferenceDeleted
+ instance_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # 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)
+ 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'
+
+ # 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
+
+ # 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
+
+ # 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)
# Verify the model instances are equivalent
- assert instance_group_manager_action_manager_patch_model == instance_group_manager_action_manager_patch_model2
+ assert load_balancer_pool_member_model == load_balancer_pool_member_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
+ 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
-class TestModel_InstanceGroupManagerActionPatch:
+class TestModel_LoadBalancerPoolMemberCollection:
"""
- Test Class for InstanceGroupManagerActionPatch
+ Test Class for LoadBalancerPoolMemberCollection
"""
- def test_instance_group_manager_action_patch_serialization(self):
+ def test_load_balancer_pool_member_collection_serialization(self):
"""
- Test serialization/deserialization for InstanceGroupManagerActionPatch
+ Test serialization/deserialization for LoadBalancerPoolMemberCollection
"""
# 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_reference_deleted_model = {} # InstanceReferenceDeleted
+ instance_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- 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
+ 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'
- # Construct a json representation of a InstanceGroupManagerActionPatch model
- instance_group_manager_action_patch_model_json = {}
- instance_group_manager_action_patch_model_json['cron_spec'] = '30 */2 * * 1-5'
- instance_group_manager_action_patch_model_json['group'] = instance_group_manager_action_group_patch_model
- instance_group_manager_action_patch_model_json['manager'] = instance_group_manager_action_manager_patch_model
- instance_group_manager_action_patch_model_json['name'] = 'my-instance-group-manager-action'
- instance_group_manager_action_patch_model_json['run_at'] = '2019-01-01T12:00:00Z'
+ 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 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 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 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 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 instance_group_manager_action_patch_model == instance_group_manager_action_patch_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
- 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
+ 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_InstanceGroupManagerActionReference:
+class TestModel_LoadBalancerPoolMemberPatch:
"""
- Test Class for InstanceGroupManagerActionReference
+ Test Class for LoadBalancerPoolMemberPatch
"""
- def test_instance_group_manager_action_reference_serialization(self):
+ def test_load_balancer_pool_member_patch_serialization(self):
"""
- Test serialization/deserialization for InstanceGroupManagerActionReference
+ Test serialization/deserialization for LoadBalancerPoolMemberPatch
"""
# 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'
+ 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 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 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 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 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 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)
+ # 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)
# Verify the model instances are equivalent
- assert instance_group_manager_action_reference_model == instance_group_manager_action_reference_model2
+ assert load_balancer_pool_member_patch_model == load_balancer_pool_member_patch_model2
# 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
+ 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
-class TestModel_InstanceGroupManagerActionReferenceDeleted:
+class TestModel_LoadBalancerPoolMemberPrototype:
"""
- Test Class for InstanceGroupManagerActionReferenceDeleted
+ Test Class for LoadBalancerPoolMemberPrototype
"""
- def test_instance_group_manager_action_reference_deleted_serialization(self):
+ def test_load_balancer_pool_member_prototype_serialization(self):
"""
- Test serialization/deserialization for InstanceGroupManagerActionReferenceDeleted
+ Test serialization/deserialization for LoadBalancerPoolMemberPrototype
"""
- # 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 dict forms of any model objects needed in order to build this model.
- # 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
+ 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 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)
+ # 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 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 instance_group_manager_action_reference_deleted_model == instance_group_manager_action_reference_deleted_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
- 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
+ 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_InstanceGroupManagerActionsCollection:
+class TestModel_LoadBalancerPoolMemberReference:
"""
- Test Class for InstanceGroupManagerActionsCollection
+ Test Class for LoadBalancerPoolMemberReference
"""
- def test_instance_group_manager_actions_collection_serialization(self):
+ def test_load_balancer_pool_member_reference_serialization(self):
"""
- Test serialization/deserialization for InstanceGroupManagerActionsCollection
+ Test serialization/deserialization for LoadBalancerPoolMemberReference
"""
# 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
+ 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'
- 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'] = '30 */2 * * 1-5'
- instance_group_manager_action_model['last_applied_at'] = '2019-01-01T12:00:00Z'
- instance_group_manager_action_model['next_run_at'] = '2019-01-01T12:00:00Z'
- instance_group_manager_action_model['group'] = instance_group_manager_scheduled_action_group_model
+ # 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'
- 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'
+ # 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
- 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 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 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
+ # Verify the model instances are equivalent
+ assert load_balancer_pool_member_reference_model == load_balancer_pool_member_reference_model2
- # 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
+ # 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
- # 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)
+
+class TestModel_LoadBalancerPoolMemberReferenceDeleted:
+ """
+ Test Class for LoadBalancerPoolMemberReferenceDeleted
+ """
+
+ def test_load_balancer_pool_member_reference_deleted_serialization(self):
+ """
+ Test serialization/deserialization for LoadBalancerPoolMemberReferenceDeleted
+ """
+
+ # 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 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 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 instance_group_manager_actions_collection_model == instance_group_manager_actions_collection_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
- 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
+ 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_InstanceGroupManagerActionsCollectionFirst:
+class TestModel_LoadBalancerPoolPatch:
"""
- Test Class for InstanceGroupManagerActionsCollectionFirst
+ Test Class for LoadBalancerPoolPatch
"""
- def test_instance_group_manager_actions_collection_first_serialization(self):
+ def test_load_balancer_pool_patch_serialization(self):
"""
- Test serialization/deserialization for InstanceGroupManagerActionsCollectionFirst
+ Test serialization/deserialization for LoadBalancerPoolPatch
"""
- # 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
+ 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 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)
+ 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 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 instance_group_manager_actions_collection_first_model == instance_group_manager_actions_collection_first_model2
+ assert load_balancer_pool_patch_model == load_balancer_pool_patch_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
+ 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_InstanceGroupManagerActionsCollectionNext:
+class TestModel_LoadBalancerPoolPrototype:
"""
- Test Class for InstanceGroupManagerActionsCollectionNext
+ Test Class for LoadBalancerPoolPrototype
"""
- def test_instance_group_manager_actions_collection_next_serialization(self):
+ def test_load_balancer_pool_prototype_serialization(self):
"""
- Test serialization/deserialization for InstanceGroupManagerActionsCollectionNext
+ Test serialization/deserialization for LoadBalancerPoolPrototype
"""
- # 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 dict forms of any model objects needed in order to build this model.
- # 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
+ 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'
+
+ 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_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 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 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 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 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 instance_group_manager_actions_collection_next_model == instance_group_manager_actions_collection_next_model2
+ assert load_balancer_pool_prototype_model == load_balancer_pool_prototype_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
+ 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_InstanceGroupManagerCollection:
+class TestModel_LoadBalancerPoolReference:
"""
- Test Class for InstanceGroupManagerCollection
+ Test Class for LoadBalancerPoolReference
"""
- def test_instance_group_manager_collection_serialization(self):
+ def test_load_balancer_pool_reference_serialization(self):
"""
- Test serialization/deserialization for InstanceGroupManagerCollection
+ Test serialization/deserialization for LoadBalancerPoolReference
"""
# 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'
+ load_balancer_pool_reference_deleted_model = {} # LoadBalancerPoolReferenceDeleted
+ load_balancer_pool_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- 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 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'
- 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'
+ # 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
- 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]
+ # 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)
- 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'
+ # Verify the model instances are equivalent
+ assert load_balancer_pool_reference_model == load_balancer_pool_reference_model2
- # 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
+ # 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
- # 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 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)
+class TestModel_LoadBalancerPoolReferenceDeleted:
+ """
+ Test Class for LoadBalancerPoolReferenceDeleted
+ """
+
+ def test_load_balancer_pool_reference_deleted_serialization(self):
+ """
+ Test serialization/deserialization for LoadBalancerPoolReferenceDeleted
+ """
+
+ # 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 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 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)
# Verify the model instances are equivalent
- assert instance_group_manager_collection_model == instance_group_manager_collection_model2
+ assert load_balancer_pool_reference_deleted_model == load_balancer_pool_reference_deleted_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
+ 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
-class TestModel_InstanceGroupManagerCollectionFirst:
+class TestModel_LoadBalancerPoolSessionPersistence:
"""
- Test Class for InstanceGroupManagerCollectionFirst
+ Test Class for LoadBalancerPoolSessionPersistence
"""
- def test_instance_group_manager_collection_first_serialization(self):
+ def test_load_balancer_pool_session_persistence_serialization(self):
"""
- Test serialization/deserialization for InstanceGroupManagerCollectionFirst
+ Test serialization/deserialization for LoadBalancerPoolSessionPersistence
"""
- # 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 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 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 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 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 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 instance_group_manager_collection_first_model == instance_group_manager_collection_first_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
- 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
+ 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_InstanceGroupManagerCollectionNext:
+class TestModel_LoadBalancerPoolSessionPersistencePatch:
"""
- Test Class for InstanceGroupManagerCollectionNext
+ Test Class for LoadBalancerPoolSessionPersistencePatch
"""
- def test_instance_group_manager_collection_next_serialization(self):
+ def test_load_balancer_pool_session_persistence_patch_serialization(self):
"""
- Test serialization/deserialization for InstanceGroupManagerCollectionNext
+ Test serialization/deserialization for LoadBalancerPoolSessionPersistencePatch
"""
- # 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 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 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 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 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 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)
# Verify the model instances are equivalent
- assert instance_group_manager_collection_next_model == instance_group_manager_collection_next_model2
+ assert load_balancer_pool_session_persistence_patch_model == load_balancer_pool_session_persistence_patch_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
+ 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_InstanceGroupManagerPatch:
+class TestModel_LoadBalancerPoolSessionPersistencePrototype:
"""
- Test Class for InstanceGroupManagerPatch
+ Test Class for LoadBalancerPoolSessionPersistencePrototype
"""
- def test_instance_group_manager_patch_serialization(self):
+ def test_load_balancer_pool_session_persistence_prototype_serialization(self):
"""
- Test serialization/deserialization for InstanceGroupManagerPatch
+ Test serialization/deserialization for LoadBalancerPoolSessionPersistencePrototype
"""
- # 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 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 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 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 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 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 instance_group_manager_patch_model == instance_group_manager_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
- 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
+ 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_InstanceGroupManagerPolicyCollection:
+class TestModel_LoadBalancerPrivateIpsItem:
"""
- Test Class for InstanceGroupManagerPolicyCollection
+ Test Class for LoadBalancerPrivateIpsItem
"""
- def test_instance_group_manager_policy_collection_serialization(self):
+ def test_load_balancer_private_ips_item_serialization(self):
"""
- Test serialization/deserialization for InstanceGroupManagerPolicyCollection
+ Test serialization/deserialization for LoadBalancerPrivateIpsItem
"""
# 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'
+ 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 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 LoadBalancerPrivateIpsItem model
+ load_balancer_private_ips_item_model_json = {}
+ load_balancer_private_ips_item_model_json['address'] = '192.168.3.4'
+ load_balancer_private_ips_item_model_json['deleted'] = reserved_ip_reference_deleted_model
+ load_balancer_private_ips_item_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb'
+ load_balancer_private_ips_item_model_json['id'] = '6d353a0f-aeb1-4ae1-832e-1110d10981bb'
+ load_balancer_private_ips_item_model_json['name'] = 'my-reserved-ip'
+ load_balancer_private_ips_item_model_json['resource_type'] = 'subnet_reserved_ip'
- # Construct a model instance of 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 LoadBalancerPrivateIpsItem by calling from_dict on the json representation
+ load_balancer_private_ips_item_model = LoadBalancerPrivateIpsItem.from_dict(load_balancer_private_ips_item_model_json)
+ assert load_balancer_private_ips_item_model != False
- # Construct a model instance of 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 LoadBalancerPrivateIpsItem by calling from_dict on the json representation
+ load_balancer_private_ips_item_model_dict = LoadBalancerPrivateIpsItem.from_dict(load_balancer_private_ips_item_model_json).__dict__
+ load_balancer_private_ips_item_model2 = LoadBalancerPrivateIpsItem(**load_balancer_private_ips_item_model_dict)
# Verify the model instances are equivalent
- assert instance_group_manager_policy_collection_model == instance_group_manager_policy_collection_model2
+ assert load_balancer_private_ips_item_model == load_balancer_private_ips_item_model2
# Convert model instance back to dict and verify no loss of data
- 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
+ load_balancer_private_ips_item_model_json2 = load_balancer_private_ips_item_model.to_dict()
+ assert load_balancer_private_ips_item_model_json2 == load_balancer_private_ips_item_model_json
-class TestModel_InstanceGroupManagerPolicyCollectionFirst:
+class TestModel_LoadBalancerProfile:
"""
- Test Class for InstanceGroupManagerPolicyCollectionFirst
+ Test Class for LoadBalancerProfile
"""
- def test_instance_group_manager_policy_collection_first_serialization(self):
+ def test_load_balancer_profile_serialization(self):
"""
- Test serialization/deserialization for InstanceGroupManagerPolicyCollectionFirst
+ Test serialization/deserialization for LoadBalancerProfile
"""
- # 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
+ load_balancer_profile_instance_groups_supported_model = {} # LoadBalancerProfileInstanceGroupsSupportedFixed
+ load_balancer_profile_instance_groups_supported_model['type'] = 'fixed'
+ load_balancer_profile_instance_groups_supported_model['value'] = True
- # 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)
+ 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
+
+ load_balancer_profile_udp_supported_model = {} # LoadBalancerProfileUDPSupportedFixed
+ load_balancer_profile_udp_supported_model['type'] = 'fixed'
+ load_balancer_profile_udp_supported_model['value'] = True
+
+ # Construct a json representation of a LoadBalancerProfile model
+ load_balancer_profile_model_json = {}
+ load_balancer_profile_model_json['family'] = 'network'
+ load_balancer_profile_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed'
+ load_balancer_profile_model_json['instance_groups_supported'] = load_balancer_profile_instance_groups_supported_model
+ 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
+ load_balancer_profile_model_json['udp_supported'] = load_balancer_profile_udp_supported_model
+
+ # Construct a model instance of LoadBalancerProfile by calling from_dict on the json representation
+ load_balancer_profile_model = LoadBalancerProfile.from_dict(load_balancer_profile_model_json)
+ 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 instance_group_manager_policy_collection_first_model == instance_group_manager_policy_collection_first_model2
+ assert load_balancer_profile_model == load_balancer_profile_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
+ load_balancer_profile_model_json2 = load_balancer_profile_model.to_dict()
+ assert load_balancer_profile_model_json2 == load_balancer_profile_model_json
-class TestModel_InstanceGroupManagerPolicyCollectionNext:
+class TestModel_LoadBalancerProfileCollection:
"""
- Test Class for InstanceGroupManagerPolicyCollectionNext
+ Test Class for LoadBalancerProfileCollection
"""
- def test_instance_group_manager_policy_collection_next_serialization(self):
+ def test_load_balancer_profile_collection_serialization(self):
"""
- Test serialization/deserialization for InstanceGroupManagerPolicyCollectionNext
+ Test serialization/deserialization for LoadBalancerProfileCollection
"""
- # 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 dict forms of any model objects needed in order to build this model.
- # 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
+ 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 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)
+ 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'
- # Verify the model instances are equivalent
- assert instance_group_manager_policy_collection_next_model == instance_group_manager_policy_collection_next_model2
+ load_balancer_profile_instance_groups_supported_model = {} # LoadBalancerProfileInstanceGroupsSupportedFixed
+ load_balancer_profile_instance_groups_supported_model['type'] = 'fixed'
+ load_balancer_profile_instance_groups_supported_model['value'] = True
- # 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
+ 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
-class TestModel_InstanceGroupManagerPolicyPatch:
- """
- Test Class for InstanceGroupManagerPolicyPatch
- """
+ 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
- def test_instance_group_manager_policy_patch_serialization(self):
- """
- Test serialization/deserialization for InstanceGroupManagerPolicyPatch
- """
+ load_balancer_profile_udp_supported_model = {} # LoadBalancerProfileUDPSupportedFixed
+ load_balancer_profile_udp_supported_model['type'] = 'fixed'
+ load_balancer_profile_udp_supported_model['value'] = True
- # Construct a json representation of a 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'
+ 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['instance_groups_supported'] = load_balancer_profile_instance_groups_supported_model
+ 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
+ load_balancer_profile_model['udp_supported'] = load_balancer_profile_udp_supported_model
- # 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 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 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 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 instance_group_manager_policy_patch_model == instance_group_manager_policy_patch_model2
+ assert load_balancer_profile_collection_model == load_balancer_profile_collection_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
+ 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_InstanceGroupManagerPolicyReference:
+class TestModel_LoadBalancerProfileCollectionFirst:
"""
- Test Class for InstanceGroupManagerPolicyReference
+ Test Class for LoadBalancerProfileCollectionFirst
"""
- def test_instance_group_manager_policy_reference_serialization(self):
+ def test_load_balancer_profile_collection_first_serialization(self):
"""
- Test serialization/deserialization for InstanceGroupManagerPolicyReference
+ Test serialization/deserialization for LoadBalancerProfileCollectionFirst
"""
- # 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'
-
- # 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 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 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 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 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)
+ # 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 instance_group_manager_policy_reference_model == instance_group_manager_policy_reference_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
- 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
+ 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_InstanceGroupManagerPolicyReferenceDeleted:
+class TestModel_LoadBalancerProfileCollectionNext:
"""
- Test Class for InstanceGroupManagerPolicyReferenceDeleted
+ Test Class for LoadBalancerProfileCollectionNext
"""
- def test_instance_group_manager_policy_reference_deleted_serialization(self):
+ def test_load_balancer_profile_collection_next_serialization(self):
"""
- Test serialization/deserialization for InstanceGroupManagerPolicyReferenceDeleted
+ Test serialization/deserialization for LoadBalancerProfileCollectionNext
"""
- # 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 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 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 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 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)
+ # 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 instance_group_manager_policy_reference_deleted_model == instance_group_manager_policy_reference_deleted_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
- 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
+ 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_InstanceGroupManagerReference:
+class TestModel_LoadBalancerProfileLoggingSupported:
"""
- Test Class for InstanceGroupManagerReference
+ Test Class for LoadBalancerProfileLoggingSupported
"""
- def test_instance_group_manager_reference_serialization(self):
+ def test_load_balancer_profile_logging_supported_serialization(self):
"""
- Test serialization/deserialization for InstanceGroupManagerReference
+ Test serialization/deserialization for LoadBalancerProfileLoggingSupported
"""
- # Construct dict forms of any model objects needed in order to build this model.
-
- 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 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 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 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 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 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 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)
# Verify the model instances are equivalent
- assert instance_group_manager_reference_model == instance_group_manager_reference_model2
+ assert load_balancer_profile_logging_supported_model == load_balancer_profile_logging_supported_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
+ 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_InstanceGroupManagerReferenceDeleted:
+class TestModel_LoadBalancerProfileReference:
"""
- Test Class for InstanceGroupManagerReferenceDeleted
+ Test Class for LoadBalancerProfileReference
"""
- def test_instance_group_manager_reference_deleted_serialization(self):
+ def test_load_balancer_profile_reference_serialization(self):
"""
- Test serialization/deserialization for InstanceGroupManagerReferenceDeleted
+ Test serialization/deserialization for LoadBalancerProfileReference
"""
- # 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 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 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 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 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 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 instance_group_manager_reference_deleted_model == instance_group_manager_reference_deleted_model2
+ assert load_balancer_profile_reference_model == load_balancer_profile_reference_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
+ 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_InstanceGroupManagerScheduledActionGroup:
+class TestModel_LoadBalancerReferenceDeleted:
"""
- Test Class for InstanceGroupManagerScheduledActionGroup
+ Test Class for LoadBalancerReferenceDeleted
"""
- def test_instance_group_manager_scheduled_action_group_serialization(self):
+ def test_load_balancer_reference_deleted_serialization(self):
"""
- Test serialization/deserialization for InstanceGroupManagerScheduledActionGroup
+ Test serialization/deserialization for LoadBalancerReferenceDeleted
"""
- # 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 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 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 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 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 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 instance_group_manager_scheduled_action_group_model == instance_group_manager_scheduled_action_group_model2
+ assert load_balancer_reference_deleted_model == load_balancer_reference_deleted_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
+ 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_InstanceGroupManagerScheduledActionGroupPrototype:
+class TestModel_LoadBalancerStatistics:
"""
- Test Class for InstanceGroupManagerScheduledActionGroupPrototype
+ Test Class for LoadBalancerStatistics
"""
- def test_instance_group_manager_scheduled_action_group_prototype_serialization(self):
+ def test_load_balancer_statistics_serialization(self):
"""
- Test serialization/deserialization for InstanceGroupManagerScheduledActionGroupPrototype
+ Test serialization/deserialization for LoadBalancerStatistics
"""
- # 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 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 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 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 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 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 instance_group_manager_scheduled_action_group_prototype_model == instance_group_manager_scheduled_action_group_prototype_model2
+ assert load_balancer_statistics_model == load_balancer_statistics_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
+ load_balancer_statistics_model_json2 = load_balancer_statistics_model.to_dict()
+ assert load_balancer_statistics_model_json2 == load_balancer_statistics_model_json
-class TestModel_InstanceGroupMembership:
+class TestModel_NetworkACL:
"""
- Test Class for InstanceGroupMembership
+ Test Class for NetworkACL
"""
- def test_instance_group_membership_serialization(self):
+ def test_network_acl_serialization(self):
"""
- Test serialization/deserialization for InstanceGroupMembership
+ Test serialization/deserialization for NetworkACL
"""
# 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'
+ 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_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'
+ network_acl_rule_reference_deleted_model = {} # NetworkACLRuleReferenceDeleted
+ network_acl_rule_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- instance_template_reference_deleted_model = {} # InstanceTemplateReferenceDeleted
- instance_template_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'
- 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'
+ network_acl_rule_item_model = {} # NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP
+ network_acl_rule_item_model['action'] = 'allow'
+ network_acl_rule_item_model['before'] = network_acl_rule_reference_model
+ network_acl_rule_item_model['created_at'] = '2019-01-01T12:00:00Z'
+ 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-1'
+ network_acl_rule_item_model['source'] = '192.168.3.0/24'
+ network_acl_rule_item_model['destination_port_max'] = 22
+ network_acl_rule_item_model['destination_port_min'] = 22
+ network_acl_rule_item_model['protocol'] = 'udp'
+ network_acl_rule_item_model['source_port_max'] = 65535
+ network_acl_rule_item_model['source_port_min'] = 49152
- 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'
+ subnet_reference_deleted_model = {} # SubnetReferenceDeleted
+ subnet_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'
+ subnet_reference_model = {} # SubnetReference
+ subnet_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
+ subnet_reference_model['deleted'] = subnet_reference_deleted_model
+ subnet_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
+ subnet_reference_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
+ subnet_reference_model['name'] = 'my-subnet'
+ subnet_reference_model['resource_type'] = 'subnet'
- # Construct a json representation of a 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'
+ vpc_reference_deleted_model = {} # VPCReferenceDeleted
+ vpc_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # 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
+ vpc_reference_model = {} # VPCReference
+ vpc_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b'
+ vpc_reference_model['deleted'] = vpc_reference_deleted_model
+ vpc_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b'
+ vpc_reference_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b'
+ vpc_reference_model['name'] = 'my-vpc'
+ vpc_reference_model['resource_type'] = 'vpc'
- # Construct a 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 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 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 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 instance_group_membership_model == instance_group_membership_model2
+ assert network_acl_model == network_acl_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
+ network_acl_model_json2 = network_acl_model.to_dict()
+ assert network_acl_model_json2 == network_acl_model_json
-class TestModel_InstanceGroupMembershipCollection:
+class TestModel_NetworkACLCollection:
"""
- Test Class for InstanceGroupMembershipCollection
+ Test Class for NetworkACLCollection
"""
- def test_instance_group_membership_collection_serialization(self):
+ def test_network_acl_collection_serialization(self):
"""
- Test serialization/deserialization for InstanceGroupMembershipCollection
+ Test serialization/deserialization for NetworkACLCollection
"""
# 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'
+ network_acl_collection_first_model = {} # NetworkACLCollectionFirst
+ network_acl_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls?limit=20'
- 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'
+ 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_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'
+ 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 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
+ 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 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
+ network_acl_rule_item_model = {} # NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP
+ network_acl_rule_item_model['action'] = 'allow'
+ network_acl_rule_item_model['before'] = network_acl_rule_reference_model
+ network_acl_rule_item_model['created_at'] = '2019-01-01T12:00:00Z'
+ 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-1'
+ network_acl_rule_item_model['source'] = '192.168.3.0/24'
+ network_acl_rule_item_model['destination_port_max'] = 22
+ network_acl_rule_item_model['destination_port_min'] = 22
+ network_acl_rule_item_model['protocol'] = 'udp'
+ network_acl_rule_item_model['source_port_max'] = 65535
+ network_acl_rule_item_model['source_port_min'] = 49152
- # Construct a 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)
+ 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 instance_group_membership_collection_model == instance_group_membership_collection_model2
+ subnet_reference_model = {} # SubnetReference
+ subnet_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
+ subnet_reference_model['deleted'] = subnet_reference_deleted_model
+ subnet_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
+ subnet_reference_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
+ subnet_reference_model['name'] = 'my-subnet'
+ subnet_reference_model['resource_type'] = 'subnet'
- # 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
+ vpc_reference_deleted_model = {} # VPCReferenceDeleted
+ vpc_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ vpc_reference_model = {} # VPCReference
+ vpc_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b'
+ vpc_reference_model['deleted'] = vpc_reference_deleted_model
+ vpc_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b'
+ vpc_reference_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b'
+ vpc_reference_model['name'] = 'my-vpc'
+ vpc_reference_model['resource_type'] = 'vpc'
-class TestModel_InstanceGroupMembershipCollectionFirst:
- """
- Test Class for InstanceGroupMembershipCollectionFirst
- """
+ 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
- def test_instance_group_membership_collection_first_serialization(self):
- """
- Test serialization/deserialization for InstanceGroupMembershipCollectionFirst
- """
+ 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 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 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 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 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 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 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 instance_group_membership_collection_first_model == instance_group_membership_collection_first_model2
+ assert network_acl_collection_model == network_acl_collection_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
+ network_acl_collection_model_json2 = network_acl_collection_model.to_dict()
+ assert network_acl_collection_model_json2 == network_acl_collection_model_json
-class TestModel_InstanceGroupMembershipCollectionNext:
+class TestModel_NetworkACLCollectionFirst:
"""
- Test Class for InstanceGroupMembershipCollectionNext
+ Test Class for NetworkACLCollectionFirst
"""
- def test_instance_group_membership_collection_next_serialization(self):
+ def test_network_acl_collection_first_serialization(self):
"""
- Test serialization/deserialization for InstanceGroupMembershipCollectionNext
+ Test serialization/deserialization for NetworkACLCollectionFirst
"""
- # 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 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 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 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 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)
+ # 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 instance_group_membership_collection_next_model == instance_group_membership_collection_next_model2
+ assert network_acl_collection_first_model == network_acl_collection_first_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
+ 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_InstanceGroupMembershipPatch:
+class TestModel_NetworkACLCollectionNext:
"""
- Test Class for InstanceGroupMembershipPatch
+ Test Class for NetworkACLCollectionNext
"""
- def test_instance_group_membership_patch_serialization(self):
+ def test_network_acl_collection_next_serialization(self):
"""
- Test serialization/deserialization for InstanceGroupMembershipPatch
+ Test serialization/deserialization for NetworkACLCollectionNext
"""
- # 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 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 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 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 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 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 instance_group_membership_patch_model == instance_group_membership_patch_model2
+ assert network_acl_collection_next_model == network_acl_collection_next_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
+ 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_InstanceGroupPatch:
+class TestModel_NetworkACLPatch:
"""
- Test Class for InstanceGroupPatch
+ Test Class for NetworkACLPatch
"""
- def test_instance_group_patch_serialization(self):
+ def test_network_acl_patch_serialization(self):
"""
- Test serialization/deserialization for InstanceGroupPatch
+ Test serialization/deserialization for NetworkACLPatch
"""
- # 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'
-
- load_balancer_identity_model = {} # LoadBalancerIdentityById
- load_balancer_identity_model['id'] = 'dd754295-e9e0-4c9d-bf6c-58fbc59e5727'
-
- 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 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 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 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 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 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 instance_group_patch_model == instance_group_patch_model2
+ assert network_acl_patch_model == network_acl_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
+ network_acl_patch_model_json2 = network_acl_patch_model.to_dict()
+ assert network_acl_patch_model_json2 == network_acl_patch_model_json
-class TestModel_InstanceGroupReference:
+class TestModel_NetworkACLReference:
"""
- Test Class for InstanceGroupReference
+ Test Class for NetworkACLReference
"""
- def test_instance_group_reference_serialization(self):
+ def test_network_acl_reference_serialization(self):
"""
- Test serialization/deserialization for InstanceGroupReference
+ Test serialization/deserialization for NetworkACLReference
"""
# 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'
+ 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 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 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 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 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 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 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 instance_group_reference_model == instance_group_reference_model2
+ assert network_acl_reference_model == network_acl_reference_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
+ network_acl_reference_model_json2 = network_acl_reference_model.to_dict()
+ assert network_acl_reference_model_json2 == network_acl_reference_model_json
-class TestModel_InstanceGroupReferenceDeleted:
+class TestModel_NetworkACLReferenceDeleted:
"""
- Test Class for InstanceGroupReferenceDeleted
+ Test Class for NetworkACLReferenceDeleted
"""
- def test_instance_group_reference_deleted_serialization(self):
+ def test_network_acl_reference_deleted_serialization(self):
"""
- Test serialization/deserialization for InstanceGroupReferenceDeleted
+ Test serialization/deserialization for NetworkACLReferenceDeleted
"""
- # 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 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 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 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 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 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)
# Verify the model instances are equivalent
- assert instance_group_reference_deleted_model == instance_group_reference_deleted_model2
+ assert network_acl_reference_deleted_model == network_acl_reference_deleted_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
+ 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
-class TestModel_InstanceInitialization:
+class TestModel_NetworkACLRuleCollection:
"""
- Test Class for InstanceInitialization
+ Test Class for NetworkACLRuleCollection
"""
- def test_instance_initialization_serialization(self):
+ def test_network_acl_rule_collection_serialization(self):
"""
- Test serialization/deserialization for InstanceInitialization
+ Test serialization/deserialization for NetworkACLRuleCollection
"""
# Construct dict forms of any model objects needed in order to build this model.
- trusted_profile_reference_model = {} # TrustedProfileReference
- trusted_profile_reference_model['crn'] = 'crn:[...]'
- trusted_profile_reference_model['id'] = 'Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5'
- trusted_profile_reference_model['resource_type'] = 'trusted_profile'
-
- instance_initialization_default_trusted_profile_model = {} # InstanceInitializationDefaultTrustedProfile
- instance_initialization_default_trusted_profile_model['auto_link'] = True
- instance_initialization_default_trusted_profile_model['target'] = trusted_profile_reference_model
+ 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'
- key_reference_deleted_model = {} # KeyReferenceDeleted
- key_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'
- 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'
+ network_acl_rule_reference_deleted_model = {} # NetworkACLRuleReferenceDeleted
+ network_acl_rule_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- key_identity_by_fingerprint_model = {} # KeyIdentityByFingerprint
- key_identity_by_fingerprint_model['fingerprint'] = 'SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY'
+ 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'
- instance_initialization_password_model = {} # InstanceInitializationPassword
- instance_initialization_password_model['encrypted_password'] = 'VGhpcyBpcyBhIG1vY2sgYnl0ZSBhcnJheSB2YWx1ZS4='
- instance_initialization_password_model['encryption_key'] = key_identity_by_fingerprint_model
+ network_acl_rule_item_model = {} # NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP
+ network_acl_rule_item_model['action'] = 'allow'
+ network_acl_rule_item_model['before'] = network_acl_rule_reference_model
+ network_acl_rule_item_model['created_at'] = '2019-01-01T12:00:00Z'
+ 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-1'
+ network_acl_rule_item_model['source'] = '192.168.3.0/24'
+ network_acl_rule_item_model['destination_port_max'] = 22
+ network_acl_rule_item_model['destination_port_min'] = 22
+ network_acl_rule_item_model['protocol'] = 'udp'
+ network_acl_rule_item_model['source_port_max'] = 65535
+ network_acl_rule_item_model['source_port_min'] = 49152
- # Construct a json representation of a InstanceInitialization model
- instance_initialization_model_json = {}
- instance_initialization_model_json['default_trusted_profile'] = instance_initialization_default_trusted_profile_model
- instance_initialization_model_json['keys'] = [key_reference_model]
- instance_initialization_model_json['password'] = instance_initialization_password_model
+ # 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 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 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 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 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 instance_initialization_model == instance_initialization_model2
+ assert network_acl_rule_collection_model == network_acl_rule_collection_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
+ 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_InstanceInitializationDefaultTrustedProfile:
+class TestModel_NetworkACLRuleCollectionFirst:
"""
- Test Class for InstanceInitializationDefaultTrustedProfile
+ Test Class for NetworkACLRuleCollectionFirst
"""
- def test_instance_initialization_default_trusted_profile_serialization(self):
+ def test_network_acl_rule_collection_first_serialization(self):
"""
- Test serialization/deserialization for InstanceInitializationDefaultTrustedProfile
+ Test serialization/deserialization for NetworkACLRuleCollectionFirst
"""
- # Construct dict forms of any model objects needed in order to build this model.
-
- trusted_profile_reference_model = {} # TrustedProfileReference
- trusted_profile_reference_model['crn'] = 'crn:v1:bluemix:public:iam-identity::a/123456::profile:Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5'
- trusted_profile_reference_model['id'] = 'Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5'
- trusted_profile_reference_model['resource_type'] = 'trusted_profile'
-
- # Construct a json representation of a InstanceInitializationDefaultTrustedProfile model
- instance_initialization_default_trusted_profile_model_json = {}
- instance_initialization_default_trusted_profile_model_json['auto_link'] = True
- instance_initialization_default_trusted_profile_model_json['target'] = trusted_profile_reference_model
+ # Construct a 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 InstanceInitializationDefaultTrustedProfile by calling from_dict on the json representation
- instance_initialization_default_trusted_profile_model = InstanceInitializationDefaultTrustedProfile.from_dict(instance_initialization_default_trusted_profile_model_json)
- assert instance_initialization_default_trusted_profile_model != False
+ # Construct a model instance of 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 InstanceInitializationDefaultTrustedProfile by calling from_dict on the json representation
- instance_initialization_default_trusted_profile_model_dict = InstanceInitializationDefaultTrustedProfile.from_dict(instance_initialization_default_trusted_profile_model_json).__dict__
- instance_initialization_default_trusted_profile_model2 = InstanceInitializationDefaultTrustedProfile(**instance_initialization_default_trusted_profile_model_dict)
+ # 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 instance_initialization_default_trusted_profile_model == instance_initialization_default_trusted_profile_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
- instance_initialization_default_trusted_profile_model_json2 = instance_initialization_default_trusted_profile_model.to_dict()
- assert instance_initialization_default_trusted_profile_model_json2 == instance_initialization_default_trusted_profile_model_json
+ 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_InstanceInitializationPassword:
+class TestModel_NetworkACLRuleCollectionNext:
"""
- Test Class for InstanceInitializationPassword
+ Test Class for NetworkACLRuleCollectionNext
"""
- def test_instance_initialization_password_serialization(self):
+ def test_network_acl_rule_collection_next_serialization(self):
"""
- Test serialization/deserialization for InstanceInitializationPassword
+ Test serialization/deserialization for NetworkACLRuleCollectionNext
"""
- # 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'
-
- # 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 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 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 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 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 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 instance_initialization_password_model == instance_initialization_password_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
- instance_initialization_password_model_json2 = instance_initialization_password_model.to_dict()
- assert instance_initialization_password_model_json2 == instance_initialization_password_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_InstanceLifecycleReason:
+class TestModel_NetworkACLRulePatch:
"""
- Test Class for InstanceLifecycleReason
+ Test Class for NetworkACLRulePatch
"""
- def test_instance_lifecycle_reason_serialization(self):
+ def test_network_acl_rule_patch_serialization(self):
"""
- Test serialization/deserialization for InstanceLifecycleReason
+ Test serialization/deserialization for NetworkACLRulePatch
"""
- # Construct a json representation of a InstanceLifecycleReason model
- instance_lifecycle_reason_model_json = {}
- instance_lifecycle_reason_model_json['code'] = 'resource_suspended_by_provider'
- instance_lifecycle_reason_model_json['message'] = 'The resource has been suspended. Contact IBM support with the CRN for next steps.'
- instance_lifecycle_reason_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#resource-suspension'
+ # Construct dict forms of any model objects needed in order to build this model.
- # Construct a model instance of InstanceLifecycleReason by calling from_dict on the json representation
- instance_lifecycle_reason_model = InstanceLifecycleReason.from_dict(instance_lifecycle_reason_model_json)
- assert instance_lifecycle_reason_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 InstanceLifecycleReason by calling from_dict on the json representation
- instance_lifecycle_reason_model_dict = InstanceLifecycleReason.from_dict(instance_lifecycle_reason_model_json).__dict__
- instance_lifecycle_reason_model2 = InstanceLifecycleReason(**instance_lifecycle_reason_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-1'
+ network_acl_rule_patch_model_json['protocol'] = 'tcp'
+ network_acl_rule_patch_model_json['source'] = '192.168.3.2/32'
+ network_acl_rule_patch_model_json['source_port_max'] = 65535
+ network_acl_rule_patch_model_json['source_port_min'] = 49152
+ 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 instance_lifecycle_reason_model == instance_lifecycle_reason_model2
+ assert network_acl_rule_patch_model == network_acl_rule_patch_model2
# Convert model instance back to dict and verify no loss of data
- instance_lifecycle_reason_model_json2 = instance_lifecycle_reason_model.to_dict()
- assert instance_lifecycle_reason_model_json2 == instance_lifecycle_reason_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_InstanceMetadataService:
+class TestModel_NetworkACLRuleReference:
"""
- Test Class for InstanceMetadataService
+ Test Class for NetworkACLRuleReference
"""
- def test_instance_metadata_service_serialization(self):
+ def test_network_acl_rule_reference_serialization(self):
"""
- Test serialization/deserialization for InstanceMetadataService
+ Test serialization/deserialization for NetworkACLRuleReference
"""
- # Construct a json representation of a InstanceMetadataService model
- instance_metadata_service_model_json = {}
- instance_metadata_service_model_json['enabled'] = True
- instance_metadata_service_model_json['protocol'] = 'http'
- instance_metadata_service_model_json['response_hop_limit'] = 1
+ # Construct dict forms of any model objects needed in order to build this model.
- # Construct a model instance of InstanceMetadataService by calling from_dict on the json representation
- instance_metadata_service_model = InstanceMetadataService.from_dict(instance_metadata_service_model_json)
- assert instance_metadata_service_model != False
+ 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 InstanceMetadataService by calling from_dict on the json representation
- instance_metadata_service_model_dict = InstanceMetadataService.from_dict(instance_metadata_service_model_json).__dict__
- instance_metadata_service_model2 = InstanceMetadataService(**instance_metadata_service_model_dict)
+ # 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 instance_metadata_service_model == instance_metadata_service_model2
+ assert network_acl_rule_reference_model == network_acl_rule_reference_model2
# Convert model instance back to dict and verify no loss of data
- instance_metadata_service_model_json2 = instance_metadata_service_model.to_dict()
- assert instance_metadata_service_model_json2 == instance_metadata_service_model_json
+ 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_InstanceMetadataServicePatch:
+class TestModel_NetworkACLRuleReferenceDeleted:
"""
- Test Class for InstanceMetadataServicePatch
+ Test Class for NetworkACLRuleReferenceDeleted
"""
- def test_instance_metadata_service_patch_serialization(self):
+ def test_network_acl_rule_reference_deleted_serialization(self):
"""
- Test serialization/deserialization for InstanceMetadataServicePatch
+ Test serialization/deserialization for NetworkACLRuleReferenceDeleted
"""
- # Construct a json representation of a InstanceMetadataServicePatch model
- instance_metadata_service_patch_model_json = {}
- instance_metadata_service_patch_model_json['enabled'] = True
- instance_metadata_service_patch_model_json['protocol'] = 'http'
- instance_metadata_service_patch_model_json['response_hop_limit'] = 1
+ # 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 InstanceMetadataServicePatch by calling from_dict on the json representation
- instance_metadata_service_patch_model = InstanceMetadataServicePatch.from_dict(instance_metadata_service_patch_model_json)
- assert instance_metadata_service_patch_model != False
+ # Construct a model instance of 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 InstanceMetadataServicePatch by calling from_dict on the json representation
- instance_metadata_service_patch_model_dict = InstanceMetadataServicePatch.from_dict(instance_metadata_service_patch_model_json).__dict__
- instance_metadata_service_patch_model2 = InstanceMetadataServicePatch(**instance_metadata_service_patch_model_dict)
+ # 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 instance_metadata_service_patch_model == instance_metadata_service_patch_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
- instance_metadata_service_patch_model_json2 = instance_metadata_service_patch_model.to_dict()
- assert instance_metadata_service_patch_model_json2 == instance_metadata_service_patch_model_json
+ 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_InstanceMetadataServicePrototype:
+class TestModel_NetworkInterface:
"""
- Test Class for InstanceMetadataServicePrototype
+ Test Class for NetworkInterface
"""
- def test_instance_metadata_service_prototype_serialization(self):
+ def test_network_interface_serialization(self):
"""
- Test serialization/deserialization for InstanceMetadataServicePrototype
+ Test serialization/deserialization for NetworkInterface
"""
- # Construct a json representation of a InstanceMetadataServicePrototype model
- instance_metadata_service_prototype_model_json = {}
- instance_metadata_service_prototype_model_json['enabled'] = False
- instance_metadata_service_prototype_model_json['protocol'] = 'https'
- instance_metadata_service_prototype_model_json['response_hop_limit'] = 2
+ # Construct dict forms of any model objects needed in order to build this model.
- # Construct a model instance of InstanceMetadataServicePrototype by calling from_dict on the json representation
- instance_metadata_service_prototype_model = InstanceMetadataServicePrototype.from_dict(instance_metadata_service_prototype_model_json)
- assert instance_metadata_service_prototype_model != False
+ 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 InstanceMetadataServicePrototype by calling from_dict on the json representation
- instance_metadata_service_prototype_model_dict = InstanceMetadataServicePrototype.from_dict(instance_metadata_service_prototype_model_json).__dict__
- instance_metadata_service_prototype_model2 = InstanceMetadataServicePrototype(**instance_metadata_service_prototype_model_dict)
+ 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'
+
+ reserved_ip_reference_deleted_model = {} # ReservedIPReferenceDeleted
+ reserved_ip_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+
+ reserved_ip_reference_model = {} # ReservedIPReference
+ reserved_ip_reference_model['address'] = '10.0.0.32'
+ reserved_ip_reference_model['deleted'] = reserved_ip_reference_deleted_model
+ reserved_ip_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/0716-b28a7e6d-a66b-4de7-8713-15dcffdce401/reserved_ips/0716-7768a27e-cd6c-4a13-a9e6-d67a964e54a5'
+ reserved_ip_reference_model['id'] = '0716-7768a27e-cd6c-4a13-a9e6-d67a964e54a5'
+ reserved_ip_reference_model['name'] = 'my-reserved-ip-1'
+ reserved_ip_reference_model['resource_type'] = 'subnet_reserved_ip'
+
+ security_group_reference_deleted_model = {} # SecurityGroupReferenceDeleted
+ security_group_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+
+ 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'
+
+ subnet_reference_deleted_model = {} # SubnetReferenceDeleted
+ subnet_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+
+ subnet_reference_model = {} # SubnetReference
+ subnet_reference_model['crn'] = 'crn:[...]'
+ subnet_reference_model['deleted'] = subnet_reference_deleted_model
+ subnet_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/9270d819-c05e-4352-99e4-80c4680cdb7c'
+ subnet_reference_model['id'] = '9270d819-c05e-4352-99e4-80c4680cdb7c'
+ subnet_reference_model['name'] = 'my-subnet'
+ subnet_reference_model['resource_type'] = 'subnet'
+
+ # 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-instance-network-interface'
+ network_interface_model_json['port_speed'] = 1000
+ network_interface_model_json['primary_ip'] = reserved_ip_reference_model
+ network_interface_model_json['resource_type'] = 'network_interface'
+ 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 instance_metadata_service_prototype_model == instance_metadata_service_prototype_model2
+ assert network_interface_model == network_interface_model2
# Convert model instance back to dict and verify no loss of data
- instance_metadata_service_prototype_model_json2 = instance_metadata_service_prototype_model.to_dict()
- assert instance_metadata_service_prototype_model_json2 == instance_metadata_service_prototype_model_json
+ network_interface_model_json2 = network_interface_model.to_dict()
+ assert network_interface_model_json2 == network_interface_model_json
-class TestModel_InstancePatch:
+class TestModel_NetworkInterfaceBareMetalServerContextReference:
"""
- Test Class for InstancePatch
+ Test Class for NetworkInterfaceBareMetalServerContextReference
"""
- def test_instance_patch_serialization(self):
+ def test_network_interface_bare_metal_server_context_reference_serialization(self):
"""
- Test serialization/deserialization for InstancePatch
+ Test serialization/deserialization for NetworkInterfaceBareMetalServerContextReference
"""
# Construct dict forms of any model objects needed in order to build this model.
- instance_availability_policy_patch_model = {} # InstanceAvailabilityPolicyPatch
- instance_availability_policy_patch_model['host_failure'] = 'restart'
+ 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'
- instance_metadata_service_patch_model = {} # InstanceMetadataServicePatch
- instance_metadata_service_patch_model['enabled'] = True
- instance_metadata_service_patch_model['protocol'] = 'http'
- instance_metadata_service_patch_model['response_hop_limit'] = 1
+ reserved_ip_reference_deleted_model = {} # ReservedIPReferenceDeleted
+ reserved_ip_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- instance_placement_target_patch_model = {} # InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityById
- instance_placement_target_patch_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
+ 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'
- instance_patch_profile_model = {} # InstancePatchProfileInstanceProfileIdentityByName
- instance_patch_profile_model['name'] = 'bx2-4x16'
+ subnet_reference_deleted_model = {} # SubnetReferenceDeleted
+ subnet_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Construct a json representation of a InstancePatch model
- instance_patch_model_json = {}
- instance_patch_model_json['availability_policy'] = instance_availability_policy_patch_model
- instance_patch_model_json['metadata_service'] = instance_metadata_service_patch_model
- instance_patch_model_json['name'] = 'my-instance'
- instance_patch_model_json['placement_target'] = instance_placement_target_patch_model
- instance_patch_model_json['profile'] = instance_patch_profile_model
- instance_patch_model_json['total_volume_bandwidth'] = 500
+ subnet_reference_model = {} # SubnetReference
+ subnet_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
+ subnet_reference_model['deleted'] = subnet_reference_deleted_model
+ subnet_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
+ subnet_reference_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
+ subnet_reference_model['name'] = 'my-subnet'
+ subnet_reference_model['resource_type'] = 'subnet'
- # Construct a 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 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-bare-metal-server-network-interface'
+ network_interface_bare_metal_server_context_reference_model_json['primary_ip'] = reserved_ip_reference_model
+ network_interface_bare_metal_server_context_reference_model_json['resource_type'] = 'network_interface'
+ network_interface_bare_metal_server_context_reference_model_json['subnet'] = subnet_reference_model
- # 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 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 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 instance_patch_model == instance_patch_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
- instance_patch_model_json2 = instance_patch_model.to_dict()
- assert instance_patch_model_json2 == instance_patch_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_InstanceProfile:
+class TestModel_NetworkInterfaceBareMetalServerContextReferenceDeleted:
"""
- Test Class for InstanceProfile
+ Test Class for NetworkInterfaceBareMetalServerContextReferenceDeleted
"""
- def test_instance_profile_serialization(self):
+ def test_network_interface_bare_metal_server_context_reference_deleted_serialization(self):
"""
- Test serialization/deserialization for InstanceProfile
+ Test serialization/deserialization for NetworkInterfaceBareMetalServerContextReferenceDeleted
"""
- # 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
-
- 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']
-
- 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 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'
- instance_profile_gpu_model = {} # InstanceProfileGPUFixed
- instance_profile_gpu_model['type'] = 'fixed'
- instance_profile_gpu_model['value'] = 2
+ # 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
- instance_profile_gpu_manufacturer_model = {} # InstanceProfileGPUManufacturer
- instance_profile_gpu_manufacturer_model['type'] = 'enum'
- instance_profile_gpu_manufacturer_model['values'] = ['nvidia']
+ # 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)
- instance_profile_gpu_memory_model = {} # InstanceProfileGPUMemoryFixed
- instance_profile_gpu_memory_model['type'] = 'fixed'
- instance_profile_gpu_memory_model['value'] = 16
+ # Verify the model instances are equivalent
+ assert network_interface_bare_metal_server_context_reference_deleted_model == network_interface_bare_metal_server_context_reference_deleted_model2
- instance_profile_gpu_model_model = {} # InstanceProfileGPUModel
- instance_profile_gpu_model_model['type'] = 'enum'
- instance_profile_gpu_model_model['values'] = ['Tesla V100']
+ # Convert model instance back to dict and verify no loss of data
+ 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
- instance_profile_memory_model = {} # InstanceProfileMemoryFixed
- instance_profile_memory_model['type'] = 'fixed'
- instance_profile_memory_model['value'] = 16
- instance_profile_network_interface_count_model = {} # InstanceProfileNetworkInterfaceCountRange
- instance_profile_network_interface_count_model['max'] = 5
- instance_profile_network_interface_count_model['min'] = 1
- instance_profile_network_interface_count_model['type'] = 'range'
+class TestModel_NetworkInterfaceInstanceContextReference:
+ """
+ Test Class for NetworkInterfaceInstanceContextReference
+ """
- instance_profile_numa_count_model = {} # InstanceProfileNUMACountFixed
- instance_profile_numa_count_model['type'] = 'fixed'
- instance_profile_numa_count_model['value'] = 2
+ def test_network_interface_instance_context_reference_serialization(self):
+ """
+ Test serialization/deserialization for NetworkInterfaceInstanceContextReference
+ """
- 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']
+ # Construct dict forms of any model objects needed in order to build this model.
- instance_profile_port_speed_model = {} # InstanceProfilePortSpeedFixed
- instance_profile_port_speed_model['type'] = 'fixed'
- instance_profile_port_speed_model['value'] = 1000
+ 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'
- instance_profile_volume_bandwidth_model = {} # InstanceProfileVolumeBandwidthFixed
- instance_profile_volume_bandwidth_model['type'] = 'fixed'
- instance_profile_volume_bandwidth_model['value'] = 20000
+ reserved_ip_reference_deleted_model = {} # ReservedIPReferenceDeleted
+ reserved_ip_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'
+ 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'
- instance_profile_vcpu_model = {} # InstanceProfileVCPUFixed
- instance_profile_vcpu_model['type'] = 'fixed'
- instance_profile_vcpu_model['value'] = 16
+ subnet_reference_deleted_model = {} # SubnetReferenceDeleted
+ subnet_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- instance_profile_vcpu_manufacturer_model = {} # InstanceProfileVCPUManufacturer
- instance_profile_vcpu_manufacturer_model['default'] = 'testString'
- instance_profile_vcpu_manufacturer_model['type'] = 'fixed'
- instance_profile_vcpu_manufacturer_model['value'] = 'intel'
+ subnet_reference_model = {} # SubnetReference
+ subnet_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
+ subnet_reference_model['deleted'] = subnet_reference_deleted_model
+ subnet_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
+ subnet_reference_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
+ subnet_reference_model['name'] = 'my-subnet'
+ subnet_reference_model['resource_type'] = 'subnet'
- # Construct a json representation of a 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/bx2-4x16'
- instance_profile_model_json['memory'] = instance_profile_memory_model
- instance_profile_model_json['name'] = 'bx2-4x16'
- instance_profile_model_json['network_interface_count'] = instance_profile_network_interface_count_model
- instance_profile_model_json['numa_count'] = instance_profile_numa_count_model
- 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['status'] = 'current'
- 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
- instance_profile_model_json['vcpu_manufacturer'] = instance_profile_vcpu_manufacturer_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-instance-network-interface'
+ network_interface_instance_context_reference_model_json['primary_ip'] = reserved_ip_reference_model
+ network_interface_instance_context_reference_model_json['resource_type'] = 'network_interface'
+ network_interface_instance_context_reference_model_json['subnet'] = subnet_reference_model
- # 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 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 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 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 instance_profile_model == instance_profile_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
- instance_profile_model_json2 = instance_profile_model.to_dict()
- assert instance_profile_model_json2 == instance_profile_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_InstanceProfileCollection:
+class TestModel_NetworkInterfaceInstanceContextReferenceDeleted:
"""
- Test Class for InstanceProfileCollection
+ Test Class for NetworkInterfaceInstanceContextReferenceDeleted
"""
- def test_instance_profile_collection_serialization(self):
+ def test_network_interface_instance_context_reference_deleted_serialization(self):
"""
- Test serialization/deserialization for InstanceProfileCollection
+ Test serialization/deserialization for NetworkInterfaceInstanceContextReferenceDeleted
"""
- # Construct dict forms of any model objects needed in order to build this model.
+ # 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'
- instance_profile_bandwidth_model = {} # InstanceProfileBandwidthFixed
- instance_profile_bandwidth_model['type'] = 'fixed'
- instance_profile_bandwidth_model['value'] = 20000
+ # 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
- 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 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)
- instance_profile_disk_size_model = {} # InstanceProfileDiskSizeFixed
- instance_profile_disk_size_model['type'] = 'fixed'
- instance_profile_disk_size_model['value'] = 100
+ # Verify the model instances are equivalent
+ assert network_interface_instance_context_reference_deleted_model == network_interface_instance_context_reference_deleted_model2
- 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']
+ # 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
- 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
- instance_profile_gpu_model = {} # InstanceProfileGPUFixed
- instance_profile_gpu_model['type'] = 'fixed'
- instance_profile_gpu_model['value'] = 2
+class TestModel_NetworkInterfacePatch:
+ """
+ Test Class for NetworkInterfacePatch
+ """
- instance_profile_gpu_manufacturer_model = {} # InstanceProfileGPUManufacturer
- instance_profile_gpu_manufacturer_model['type'] = 'enum'
- instance_profile_gpu_manufacturer_model['values'] = ['nvidia']
+ def test_network_interface_patch_serialization(self):
+ """
+ Test serialization/deserialization for NetworkInterfacePatch
+ """
- 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 NetworkInterfacePatch model
+ network_interface_patch_model_json = {}
+ network_interface_patch_model_json['allow_ip_spoofing'] = True
+ network_interface_patch_model_json['name'] = 'my-instance-network-interface'
- 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 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
- instance_profile_memory_model = {} # InstanceProfileMemoryFixed
- instance_profile_memory_model['type'] = 'fixed'
- instance_profile_memory_model['value'] = 16
+ # 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)
- instance_profile_network_interface_count_model = {} # InstanceProfileNetworkInterfaceCountRange
- instance_profile_network_interface_count_model['max'] = 5
- instance_profile_network_interface_count_model['min'] = 1
- instance_profile_network_interface_count_model['type'] = 'range'
+ # Verify the model instances are equivalent
+ assert network_interface_patch_model == network_interface_patch_model2
- instance_profile_numa_count_model = {} # InstanceProfileNUMACountFixed
- instance_profile_numa_count_model['type'] = 'fixed'
- instance_profile_numa_count_model['value'] = 2
+ # 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
- 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
+class TestModel_NetworkInterfacePrototype:
+ """
+ Test Class for NetworkInterfacePrototype
+ """
- instance_profile_volume_bandwidth_model = {} # InstanceProfileVolumeBandwidthFixed
- instance_profile_volume_bandwidth_model['type'] = 'fixed'
- instance_profile_volume_bandwidth_model['value'] = 20000
+ def test_network_interface_prototype_serialization(self):
+ """
+ Test serialization/deserialization for NetworkInterfacePrototype
+ """
- 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'
+ # Construct dict forms of any model objects needed in order to build this model.
- instance_profile_vcpu_model = {} # InstanceProfileVCPUFixed
- instance_profile_vcpu_model['type'] = 'fixed'
- instance_profile_vcpu_model['value'] = 16
+ network_interface_ip_prototype_model = {} # NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext
+ network_interface_ip_prototype_model['address'] = '10.0.0.5'
+ network_interface_ip_prototype_model['auto_delete'] = False
+ network_interface_ip_prototype_model['name'] = 'my-reserved-ip'
- instance_profile_vcpu_manufacturer_model = {} # InstanceProfileVCPUManufacturer
- instance_profile_vcpu_manufacturer_model['default'] = 'testString'
- instance_profile_vcpu_manufacturer_model['type'] = 'fixed'
- instance_profile_vcpu_manufacturer_model['value'] = 'intel'
+ security_group_identity_model = {} # SecurityGroupIdentityById
+ security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271'
- 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/bx2-4x16'
- instance_profile_model['memory'] = instance_profile_memory_model
- instance_profile_model['name'] = 'bx2-4x16'
- instance_profile_model['network_interface_count'] = instance_profile_network_interface_count_model
- instance_profile_model['numa_count'] = instance_profile_numa_count_model
- instance_profile_model['os_architecture'] = instance_profile_os_architecture_model
- instance_profile_model['port_speed'] = instance_profile_port_speed_model
- instance_profile_model['status'] = 'current'
- 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
- instance_profile_model['vcpu_manufacturer'] = instance_profile_vcpu_manufacturer_model
+ subnet_identity_model = {} # SubnetIdentityById
+ subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
- # 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 NetworkInterfacePrototype model
+ network_interface_prototype_model_json = {}
+ network_interface_prototype_model_json['allow_ip_spoofing'] = True
+ network_interface_prototype_model_json['name'] = 'my-instance-network-interface'
+ network_interface_prototype_model_json['primary_ip'] = network_interface_ip_prototype_model
+ network_interface_prototype_model_json['security_groups'] = [security_group_identity_model]
+ network_interface_prototype_model_json['subnet'] = subnet_identity_model
- # 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 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 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 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 instance_profile_collection_model == instance_profile_collection_model2
+ assert network_interface_prototype_model == network_interface_prototype_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
+ network_interface_prototype_model_json2 = network_interface_prototype_model.to_dict()
+ assert network_interface_prototype_model_json2 == network_interface_prototype_model_json
-class TestModel_InstanceProfileDisk:
+class TestModel_NetworkInterfaceReferenceDeleted:
"""
- Test Class for InstanceProfileDisk
+ Test Class for NetworkInterfaceReferenceDeleted
"""
- def test_instance_profile_disk_serialization(self):
+ def test_network_interface_reference_deleted_serialization(self):
"""
- Test serialization/deserialization for InstanceProfileDisk
+ Test serialization/deserialization for NetworkInterfaceReferenceDeleted
"""
- # 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 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 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 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 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 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 instance_profile_disk_model == instance_profile_disk_model2
+ assert network_interface_reference_deleted_model == network_interface_reference_deleted_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
+ 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_InstanceProfileDiskSupportedInterfaces:
+class TestModel_NetworkInterfaceReferenceTargetContextDeleted:
"""
- Test Class for InstanceProfileDiskSupportedInterfaces
+ Test Class for NetworkInterfaceReferenceTargetContextDeleted
"""
- def test_instance_profile_disk_supported_interfaces_serialization(self):
+ def test_network_interface_reference_target_context_deleted_serialization(self):
"""
- Test serialization/deserialization for InstanceProfileDiskSupportedInterfaces
+ Test serialization/deserialization for NetworkInterfaceReferenceTargetContextDeleted
"""
- # 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 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 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 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 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 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 instance_profile_disk_supported_interfaces_model == instance_profile_disk_supported_interfaces_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
- 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
+ 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_InstanceProfileGPUManufacturer:
+class TestModel_NetworkInterfaceUnpaginatedCollection:
"""
- Test Class for InstanceProfileGPUManufacturer
+ Test Class for NetworkInterfaceUnpaginatedCollection
"""
- def test_instance_profile_gpu_manufacturer_serialization(self):
+ def test_network_interface_unpaginated_collection_serialization(self):
"""
- Test serialization/deserialization for InstanceProfileGPUManufacturer
+ Test serialization/deserialization for NetworkInterfaceUnpaginatedCollection
"""
- # 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.
+
+ 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'] = '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'
+
+ reserved_ip_reference_deleted_model = {} # ReservedIPReferenceDeleted
+ reserved_ip_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+
+ reserved_ip_reference_model = {} # ReservedIPReference
+ reserved_ip_reference_model['address'] = '10.0.0.32'
+ reserved_ip_reference_model['deleted'] = reserved_ip_reference_deleted_model
+ reserved_ip_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/0716-b28a7e6d-a66b-4de7-8713-15dcffdce401/reserved_ips/0716-7768a27e-cd6c-4a13-a9e6-d67a964e54a5'
+ reserved_ip_reference_model['id'] = '0716-7768a27e-cd6c-4a13-a9e6-d67a964e54a5'
+ reserved_ip_reference_model['name'] = 'my-reserved-ip-1'
+ reserved_ip_reference_model['resource_type'] = 'subnet_reserved_ip'
+
+ security_group_reference_deleted_model = {} # SecurityGroupReferenceDeleted
+ security_group_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+
+ 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'
+
+ subnet_reference_deleted_model = {} # SubnetReferenceDeleted
+ subnet_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+
+ subnet_reference_model = {} # SubnetReference
+ subnet_reference_model['crn'] = 'crn:[...]'
+ subnet_reference_model['deleted'] = subnet_reference_deleted_model
+ subnet_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/9270d819-c05e-4352-99e4-80c4680cdb7c'
+ subnet_reference_model['id'] = '9270d819-c05e-4352-99e4-80c4680cdb7c'
+ subnet_reference_model['name'] = 'my-subnet'
+ subnet_reference_model['resource_type'] = 'subnet'
+
+ 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_ip'] = reserved_ip_reference_model
+ network_interface_model['resource_type'] = 'network_interface'
+ network_interface_model['security_groups'] = [security_group_reference_model]
+ network_interface_model['status'] = 'available'
+ network_interface_model['subnet'] = subnet_reference_model
+ network_interface_model['type'] = 'primary'
+
+ # 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 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 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 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)
+ # 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 instance_profile_gpu_manufacturer_model == instance_profile_gpu_manufacturer_model2
+ assert network_interface_unpaginated_collection_model == network_interface_unpaginated_collection_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
+ 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_InstanceProfileGPUModel:
+class TestModel_OperatingSystem:
"""
- Test Class for InstanceProfileGPUModel
+ Test Class for OperatingSystem
"""
- def test_instance_profile_gpu_model_serialization(self):
+ def test_operating_system_serialization(self):
"""
- Test serialization/deserialization for InstanceProfileGPUModel
+ Test serialization/deserialization for OperatingSystem
"""
- # 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 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 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 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 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)
+ # 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 instance_profile_gpu_model_model == instance_profile_gpu_model_model2
+ assert operating_system_model == operating_system_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
+ operating_system_model_json2 = operating_system_model.to_dict()
+ assert operating_system_model_json2 == operating_system_model_json
-class TestModel_InstanceProfileOSArchitecture:
+class TestModel_OperatingSystemCollection:
"""
- Test Class for InstanceProfileOSArchitecture
+ Test Class for OperatingSystemCollection
"""
- def test_instance_profile_os_architecture_serialization(self):
+ def test_operating_system_collection_serialization(self):
"""
- Test serialization/deserialization for InstanceProfileOSArchitecture
+ Test serialization/deserialization for OperatingSystemCollection
"""
- # 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
+ operating_system_collection_first_model = {} # OperatingSystemCollectionFirst
+ operating_system_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/operating_systems?limit=20'
- # 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)
+ 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'
+
+ 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 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]
+ operating_system_collection_model_json['total_count'] = 132
+
+ # 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 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 instance_profile_os_architecture_model == instance_profile_os_architecture_model2
+ assert operating_system_collection_model == operating_system_collection_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
+ operating_system_collection_model_json2 = operating_system_collection_model.to_dict()
+ assert operating_system_collection_model_json2 == operating_system_collection_model_json
-class TestModel_InstanceProfileReference:
+class TestModel_OperatingSystemCollectionFirst:
"""
- Test Class for InstanceProfileReference
+ Test Class for OperatingSystemCollectionFirst
"""
- def test_instance_profile_reference_serialization(self):
+ def test_operating_system_collection_first_serialization(self):
"""
- Test serialization/deserialization for InstanceProfileReference
+ Test serialization/deserialization for OperatingSystemCollectionFirst
"""
- # 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/bx2-4x16'
- instance_profile_reference_model_json['name'] = 'bx2-4x16'
+ # 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 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 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 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 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 instance_profile_reference_model == instance_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
- instance_profile_reference_model_json2 = instance_profile_reference_model.to_dict()
- assert instance_profile_reference_model_json2 == instance_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_InstanceProfileVCPUArchitecture:
+class TestModel_OperatingSystemCollectionNext:
"""
- Test Class for InstanceProfileVCPUArchitecture
+ Test Class for OperatingSystemCollectionNext
"""
- def test_instance_profile_vcpu_architecture_serialization(self):
+ def test_operating_system_collection_next_serialization(self):
"""
- Test serialization/deserialization for InstanceProfileVCPUArchitecture
+ Test serialization/deserialization for OperatingSystemCollectionNext
"""
- # 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 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 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 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 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 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 instance_profile_vcpu_architecture_model == instance_profile_vcpu_architecture_model2
+ assert operating_system_collection_next_model == operating_system_collection_next_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
+ 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_InstanceProfileVCPUManufacturer:
+class TestModel_PlacementGroup:
"""
- Test Class for InstanceProfileVCPUManufacturer
+ Test Class for PlacementGroup
"""
- def test_instance_profile_vcpu_manufacturer_serialization(self):
+ def test_placement_group_serialization(self):
"""
- Test serialization/deserialization for InstanceProfileVCPUManufacturer
+ Test serialization/deserialization for PlacementGroup
"""
- # Construct a json representation of a InstanceProfileVCPUManufacturer model
- instance_profile_vcpu_manufacturer_model_json = {}
- instance_profile_vcpu_manufacturer_model_json['default'] = 'testString'
- instance_profile_vcpu_manufacturer_model_json['type'] = 'fixed'
- instance_profile_vcpu_manufacturer_model_json['value'] = 'intel'
+ # Construct dict forms of any model objects needed in order to build this model.
- # Construct a model instance of InstanceProfileVCPUManufacturer by calling from_dict on the json representation
- instance_profile_vcpu_manufacturer_model = InstanceProfileVCPUManufacturer.from_dict(instance_profile_vcpu_manufacturer_model_json)
- assert instance_profile_vcpu_manufacturer_model != False
+ 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 model instance of InstanceProfileVCPUManufacturer by calling from_dict on the json representation
- instance_profile_vcpu_manufacturer_model_dict = InstanceProfileVCPUManufacturer.from_dict(instance_profile_vcpu_manufacturer_model_json).__dict__
- instance_profile_vcpu_manufacturer_model2 = InstanceProfileVCPUManufacturer(**instance_profile_vcpu_manufacturer_model_dict)
+ # 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 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 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 instance_profile_vcpu_manufacturer_model == instance_profile_vcpu_manufacturer_model2
+ assert placement_group_model == placement_group_model2
# Convert model instance back to dict and verify no loss of data
- instance_profile_vcpu_manufacturer_model_json2 = instance_profile_vcpu_manufacturer_model.to_dict()
- assert instance_profile_vcpu_manufacturer_model_json2 == instance_profile_vcpu_manufacturer_model_json
+ placement_group_model_json2 = placement_group_model.to_dict()
+ assert placement_group_model_json2 == placement_group_model_json
-class TestModel_InstanceReference:
+class TestModel_PlacementGroupCollection:
"""
- Test Class for InstanceReference
+ Test Class for PlacementGroupCollection
"""
- def test_instance_reference_serialization(self):
+ def test_placement_group_collection_serialization(self):
"""
- Test serialization/deserialization for InstanceReference
+ Test serialization/deserialization for PlacementGroupCollection
"""
# 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'
+ placement_group_collection_first_model = {} # PlacementGroupCollectionFirst
+ placement_group_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/placement_groups?limit=50'
- # 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'
+ 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'
- # 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
+ 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 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)
+ 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 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 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 instance_reference_model == instance_reference_model2
+ assert placement_group_collection_model == placement_group_collection_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
+ placement_group_collection_model_json2 = placement_group_collection_model.to_dict()
+ assert placement_group_collection_model_json2 == placement_group_collection_model_json
-class TestModel_InstanceReferenceDeleted:
+class TestModel_PlacementGroupCollectionFirst:
"""
- Test Class for InstanceReferenceDeleted
+ Test Class for PlacementGroupCollectionFirst
"""
- def test_instance_reference_deleted_serialization(self):
+ def test_placement_group_collection_first_serialization(self):
"""
- Test serialization/deserialization for InstanceReferenceDeleted
+ Test serialization/deserialization for PlacementGroupCollectionFirst
"""
- # 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 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 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 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 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)
+ # 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 instance_reference_deleted_model == instance_reference_deleted_model2
+ assert placement_group_collection_first_model == placement_group_collection_first_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
+ 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_InstanceStatusReason:
+class TestModel_PlacementGroupCollectionNext:
"""
- Test Class for InstanceStatusReason
+ Test Class for PlacementGroupCollectionNext
"""
- def test_instance_status_reason_serialization(self):
+ def test_placement_group_collection_next_serialization(self):
"""
- Test serialization/deserialization for InstanceStatusReason
+ Test serialization/deserialization for PlacementGroupCollectionNext
"""
- # 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 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 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 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 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)
+ # 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 instance_status_reason_model == instance_status_reason_model2
+ assert placement_group_collection_next_model == placement_group_collection_next_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
+ 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_InstanceTemplateCollection:
+class TestModel_PlacementGroupPatch:
"""
- Test Class for InstanceTemplateCollection
+ Test Class for PlacementGroupPatch
"""
- def test_instance_template_collection_serialization(self):
+ def test_placement_group_patch_serialization(self):
"""
- Test serialization/deserialization for InstanceTemplateCollection
+ Test serialization/deserialization for PlacementGroupPatch
"""
- # 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'
-
- instance_availability_policy_prototype_model = {} # InstanceAvailabilityPolicyPrototype
- instance_availability_policy_prototype_model['host_failure'] = 'restart'
-
- trusted_profile_identity_model = {} # TrustedProfileIdentityTrustedProfileById
- trusted_profile_identity_model['id'] = 'Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5'
-
- instance_default_trusted_profile_prototype_model = {} # InstanceDefaultTrustedProfilePrototype
- instance_default_trusted_profile_prototype_model['auto_link'] = False
- instance_default_trusted_profile_prototype_model['target'] = trusted_profile_identity_model
-
- key_identity_model = {} # KeyIdentityById
- key_identity_model['id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803'
-
- instance_metadata_service_prototype_model = {} # InstanceMetadataServicePrototype
- instance_metadata_service_prototype_model['enabled'] = False
- instance_metadata_service_prototype_model['protocol'] = 'https'
- instance_metadata_service_prototype_model['response_hop_limit'] = 2
-
- instance_placement_target_prototype_model = {} # InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById
- instance_placement_target_prototype_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
-
- instance_profile_identity_model = {} # InstanceProfileIdentityByName
- instance_profile_identity_model['name'] = 'cx2-16x32'
-
- resource_group_reference_model = {} # ResourceGroupReference
- resource_group_reference_model['href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345'
- resource_group_reference_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
- resource_group_reference_model['name'] = 'my-resource-group'
-
- volume_attachment_prototype_volume_model = {} # VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById
- volume_attachment_prototype_volume_model['id'] = '1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
-
- volume_attachment_prototype_model = {} # VolumeAttachmentPrototype
- volume_attachment_prototype_model['delete_volume_on_instance_delete'] = False
- volume_attachment_prototype_model['name'] = 'my-volume-attachment'
- volume_attachment_prototype_model['volume'] = volume_attachment_prototype_volume_model
-
- vpc_identity_model = {} # VPCIdentityById
- vpc_identity_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b'
-
- encryption_key_identity_model = {} # EncryptionKeyIdentityByCRN
- encryption_key_identity_model['crn'] = 'crn:v1:bluemix:public:kms:us-south:a/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179'
-
- volume_profile_identity_model = {} # VolumeProfileIdentityByName
- volume_profile_identity_model['name'] = 'general-purpose'
-
- resource_group_identity_model = {} # ResourceGroupIdentityById
- resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
-
- volume_prototype_instance_by_image_context_model = {} # VolumePrototypeInstanceByImageContext
- volume_prototype_instance_by_image_context_model['capacity'] = 100
- volume_prototype_instance_by_image_context_model['encryption_key'] = encryption_key_identity_model
- volume_prototype_instance_by_image_context_model['iops'] = 10000
- volume_prototype_instance_by_image_context_model['name'] = 'my-volume'
- volume_prototype_instance_by_image_context_model['profile'] = volume_profile_identity_model
- volume_prototype_instance_by_image_context_model['resource_group'] = resource_group_identity_model
- volume_prototype_instance_by_image_context_model['user_tags'] = []
-
- volume_attachment_prototype_instance_by_image_context_model = {} # VolumeAttachmentPrototypeInstanceByImageContext
- volume_attachment_prototype_instance_by_image_context_model['delete_volume_on_instance_delete'] = True
- volume_attachment_prototype_instance_by_image_context_model['name'] = 'my-volume-attachment'
- volume_attachment_prototype_instance_by_image_context_model['volume'] = volume_prototype_instance_by_image_context_model
-
- image_identity_model = {} # ImageIdentityById
- image_identity_model['id'] = 'r006-02c73baf-9abb-493d-9e41-d0f1866f4051'
-
- network_interface_ip_prototype_model = {} # NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext
- network_interface_ip_prototype_model['address'] = '10.0.0.5'
- network_interface_ip_prototype_model['auto_delete'] = False
- network_interface_ip_prototype_model['name'] = 'my-reserved-ip'
-
- security_group_identity_model = {} # SecurityGroupIdentityById
- security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271'
-
- subnet_identity_model = {} # SubnetIdentityById
- subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
-
- network_interface_prototype_model = {} # NetworkInterfacePrototype
- network_interface_prototype_model['allow_ip_spoofing'] = True
- network_interface_prototype_model['name'] = 'my-instance-network-interface'
- network_interface_prototype_model['primary_ip'] = network_interface_ip_prototype_model
- network_interface_prototype_model['security_groups'] = [security_group_identity_model]
- network_interface_prototype_model['subnet'] = subnet_identity_model
-
- zone_identity_model = {} # ZoneIdentityByName
- zone_identity_model['name'] = 'us-south-1'
-
- instance_template_model = {} # InstanceTemplateInstanceByImageInstanceTemplateContext
- instance_template_model['availability_policy'] = instance_availability_policy_prototype_model
- instance_template_model['created_at'] = '2019-01-01T12:00:00Z'
- instance_template_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a'
- instance_template_model['default_trusted_profile'] = instance_default_trusted_profile_prototype_model
- instance_template_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a'
- instance_template_model['id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803'
- instance_template_model['keys'] = [key_identity_model]
- instance_template_model['metadata_service'] = instance_metadata_service_prototype_model
- instance_template_model['name'] = 'my-instance-template'
- instance_template_model['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_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['network_interfaces'] = [network_interface_prototype_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 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 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 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 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 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 instance_template_collection_model == instance_template_collection_model2
+ assert placement_group_patch_model == placement_group_patch_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
+ placement_group_patch_model_json2 = placement_group_patch_model.to_dict()
+ assert placement_group_patch_model_json2 == placement_group_patch_model_json
-class TestModel_InstanceTemplateCollectionFirst:
+class TestModel_PlacementGroupReferenceDeleted:
"""
- Test Class for InstanceTemplateCollectionFirst
+ Test Class for PlacementGroupReferenceDeleted
"""
- def test_instance_template_collection_first_serialization(self):
+ def test_placement_group_reference_deleted_serialization(self):
"""
- Test serialization/deserialization for InstanceTemplateCollectionFirst
+ Test serialization/deserialization for PlacementGroupReferenceDeleted
"""
- # 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 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 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 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 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 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 instance_template_collection_first_model == instance_template_collection_first_model2
+ assert placement_group_reference_deleted_model == placement_group_reference_deleted_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
+ 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_InstanceTemplateCollectionNext:
+class TestModel_PublicGateway:
"""
- Test Class for InstanceTemplateCollectionNext
+ Test Class for PublicGateway
"""
- def test_instance_template_collection_next_serialization(self):
+ def test_public_gateway_serialization(self):
"""
- Test serialization/deserialization for InstanceTemplateCollectionNext
+ Test serialization/deserialization for PublicGateway
"""
- # 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 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 dict forms of any model objects needed in order to build this model.
- # 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)
+ 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 instance_template_collection_next_model == instance_template_collection_next_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
- 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
+ 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'
-class TestModel_InstanceTemplatePatch:
- """
- Test Class for InstanceTemplatePatch
- """
+ vpc_reference_model = {} # VPCReference
+ vpc_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b'
+ vpc_reference_model['deleted'] = vpc_reference_deleted_model
+ vpc_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b'
+ vpc_reference_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b'
+ vpc_reference_model['name'] = 'my-vpc'
+ vpc_reference_model['resource_type'] = 'vpc'
- def test_instance_template_patch_serialization(self):
- """
- Test serialization/deserialization for InstanceTemplatePatch
- """
+ 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 InstanceTemplatePatch model
- instance_template_patch_model_json = {}
- instance_template_patch_model_json['name'] = 'my-instance-template'
+ # 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 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 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 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 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 instance_template_patch_model == instance_template_patch_model2
+ assert public_gateway_model == public_gateway_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
+ public_gateway_model_json2 = public_gateway_model.to_dict()
+ assert public_gateway_model_json2 == public_gateway_model_json
-class TestModel_InstanceTemplateReference:
+class TestModel_PublicGatewayCollection:
"""
- Test Class for InstanceTemplateReference
+ Test Class for PublicGatewayCollection
"""
- def test_instance_template_reference_serialization(self):
+ def test_public_gateway_collection_serialization(self):
"""
- Test serialization/deserialization for InstanceTemplateReference
+ Test serialization/deserialization for PublicGatewayCollection
"""
# 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'
+ 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 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'
+ 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 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
+ 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 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)
+ 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'
- # Verify the model instances are equivalent
- assert instance_template_reference_model == instance_template_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
- instance_template_reference_model_json2 = instance_template_reference_model.to_dict()
- assert instance_template_reference_model_json2 == instance_template_reference_model_json
+ vpc_reference_deleted_model = {} # VPCReferenceDeleted
+ vpc_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ vpc_reference_model = {} # VPCReference
+ vpc_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b'
+ vpc_reference_model['deleted'] = vpc_reference_deleted_model
+ vpc_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b'
+ vpc_reference_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b'
+ vpc_reference_model['name'] = 'my-vpc'
+ vpc_reference_model['resource_type'] = 'vpc'
-class TestModel_InstanceTemplateReferenceDeleted:
- """
- Test Class for InstanceTemplateReferenceDeleted
- """
+ 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_instance_template_reference_deleted_serialization(self):
- """
- Test serialization/deserialization for InstanceTemplateReferenceDeleted
- """
+ 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 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 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 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 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 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 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 instance_template_reference_deleted_model == instance_template_reference_deleted_model2
+ assert public_gateway_collection_model == public_gateway_collection_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
+ public_gateway_collection_model_json2 = public_gateway_collection_model.to_dict()
+ assert public_gateway_collection_model_json2 == public_gateway_collection_model_json
-class TestModel_InstanceVCPU:
+class TestModel_PublicGatewayCollectionFirst:
"""
- Test Class for InstanceVCPU
+ Test Class for PublicGatewayCollectionFirst
"""
- def test_instance_vcpu_serialization(self):
+ def test_public_gateway_collection_first_serialization(self):
"""
- Test serialization/deserialization for InstanceVCPU
+ Test serialization/deserialization for PublicGatewayCollectionFirst
"""
- # Construct a json representation of a InstanceVCPU model
- instance_vcpu_model_json = {}
- instance_vcpu_model_json['architecture'] = 'amd64'
- instance_vcpu_model_json['count'] = 4
- instance_vcpu_model_json['manufacturer'] = 'intel'
+ # 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 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 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 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 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 instance_vcpu_model == instance_vcpu_model2
+ assert public_gateway_collection_first_model == public_gateway_collection_first_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
+ 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_Key:
+class TestModel_PublicGatewayCollectionNext:
"""
- Test Class for Key
+ Test Class for PublicGatewayCollectionNext
"""
- def test_key_serialization(self):
+ def test_public_gateway_collection_next_serialization(self):
"""
- Test serialization/deserialization for Key
+ Test serialization/deserialization for PublicGatewayCollectionNext
"""
- # 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'
-
- # 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'] = 'ed25519'
+ # 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 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 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 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 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 key_model == key_model2
+ assert public_gateway_collection_next_model == public_gateway_collection_next_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
+ 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_KeyCollection:
+class TestModel_PublicGatewayFloatingIp:
"""
- Test Class for KeyCollection
+ Test Class for PublicGatewayFloatingIp
"""
- def test_key_collection_serialization(self):
+ def test_public_gateway_floating_ip_serialization(self):
"""
- Test serialization/deserialization for KeyCollection
+ Test serialization/deserialization for PublicGatewayFloatingIp
"""
# 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'
+ 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 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 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 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 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 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 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 key_collection_model == key_collection_model2
+ assert public_gateway_floating_ip_model == public_gateway_floating_ip_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
+ 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_KeyCollectionFirst:
+class TestModel_PublicGatewayPatch:
"""
- Test Class for KeyCollectionFirst
+ Test Class for PublicGatewayPatch
"""
- def test_key_collection_first_serialization(self):
+ def test_public_gateway_patch_serialization(self):
"""
- Test serialization/deserialization for KeyCollectionFirst
+ Test serialization/deserialization for PublicGatewayPatch
"""
- # 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 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 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 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 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 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 key_collection_first_model == key_collection_first_model2
+ assert public_gateway_patch_model == public_gateway_patch_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
+ public_gateway_patch_model_json2 = public_gateway_patch_model.to_dict()
+ assert public_gateway_patch_model_json2 == public_gateway_patch_model_json
-class TestModel_KeyCollectionNext:
+class TestModel_PublicGatewayReference:
"""
- Test Class for KeyCollectionNext
+ Test Class for PublicGatewayReference
"""
- def test_key_collection_next_serialization(self):
+ def test_public_gateway_reference_serialization(self):
"""
- Test serialization/deserialization for KeyCollectionNext
+ Test serialization/deserialization for PublicGatewayReference
"""
- # 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
+ 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 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 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'
+
+ # 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
+
+ # 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)
# Verify the model instances are equivalent
- assert key_collection_next_model == key_collection_next_model2
+ assert public_gateway_reference_model == public_gateway_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
+ public_gateway_reference_model_json2 = public_gateway_reference_model.to_dict()
+ assert public_gateway_reference_model_json2 == public_gateway_reference_model_json
-class TestModel_KeyPatch:
+class TestModel_PublicGatewayReferenceDeleted:
"""
- Test Class for KeyPatch
+ Test Class for PublicGatewayReferenceDeleted
"""
- def test_key_patch_serialization(self):
+ def test_public_gateway_reference_deleted_serialization(self):
"""
- Test serialization/deserialization for KeyPatch
+ Test serialization/deserialization for PublicGatewayReferenceDeleted
"""
- # 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 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 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 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 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 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 key_patch_model == key_patch_model2
+ assert public_gateway_reference_deleted_model == public_gateway_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
+ 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_KeyReference:
+class TestModel_Region:
"""
- Test Class for KeyReference
+ Test Class for Region
"""
- def test_key_reference_serialization(self):
+ def test_region_serialization(self):
"""
- Test serialization/deserialization for KeyReference
+ Test serialization/deserialization for Region
"""
- # 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'
-
- # 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 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 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 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 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 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)
# Verify the model instances are equivalent
- assert key_reference_model == key_reference_model2
+ assert region_model == region_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
+ region_model_json2 = region_model.to_dict()
+ assert region_model_json2 == region_model_json
-class TestModel_KeyReferenceDeleted:
+class TestModel_RegionCollection:
"""
- Test Class for KeyReferenceDeleted
+ Test Class for RegionCollection
"""
- def test_key_reference_deleted_serialization(self):
+ def test_region_collection_serialization(self):
"""
- Test serialization/deserialization for KeyReferenceDeleted
+ Test serialization/deserialization for RegionCollection
"""
- # 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 dict forms of any model objects needed in order to build this model.
- # 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
+ 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 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 json representation of a RegionCollection model
+ region_collection_model_json = {}
+ region_collection_model_json['regions'] = [region_model]
+
+ # 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 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 key_reference_deleted_model == key_reference_deleted_model2
+ assert region_collection_model == region_collection_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
+ region_collection_model_json2 = region_collection_model.to_dict()
+ assert region_collection_model_json2 == region_collection_model_json
-class TestModel_LegacyCloudObjectStorageBucketReference:
+class TestModel_RegionReference:
"""
- Test Class for LegacyCloudObjectStorageBucketReference
+ Test Class for RegionReference
"""
- def test_legacy_cloud_object_storage_bucket_reference_serialization(self):
+ def test_region_reference_serialization(self):
"""
- Test serialization/deserialization for LegacyCloudObjectStorageBucketReference
+ Test serialization/deserialization for RegionReference
"""
- # Construct a json representation of a LegacyCloudObjectStorageBucketReference model
- legacy_cloud_object_storage_bucket_reference_model_json = {}
- legacy_cloud_object_storage_bucket_reference_model_json['name'] = 'bucket-27200-lwx4cfvcue'
+ # Construct a 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 LegacyCloudObjectStorageBucketReference by calling from_dict on the json representation
- legacy_cloud_object_storage_bucket_reference_model = LegacyCloudObjectStorageBucketReference.from_dict(legacy_cloud_object_storage_bucket_reference_model_json)
- assert legacy_cloud_object_storage_bucket_reference_model != False
+ # Construct a model instance of 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 LegacyCloudObjectStorageBucketReference by calling from_dict on the json representation
- legacy_cloud_object_storage_bucket_reference_model_dict = LegacyCloudObjectStorageBucketReference.from_dict(legacy_cloud_object_storage_bucket_reference_model_json).__dict__
- legacy_cloud_object_storage_bucket_reference_model2 = LegacyCloudObjectStorageBucketReference(**legacy_cloud_object_storage_bucket_reference_model_dict)
+ # 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 legacy_cloud_object_storage_bucket_reference_model == legacy_cloud_object_storage_bucket_reference_model2
+ assert region_reference_model == region_reference_model2
# Convert model instance back to dict and verify no loss of data
- legacy_cloud_object_storage_bucket_reference_model_json2 = legacy_cloud_object_storage_bucket_reference_model.to_dict()
- assert legacy_cloud_object_storage_bucket_reference_model_json2 == legacy_cloud_object_storage_bucket_reference_model_json
+ region_reference_model_json2 = region_reference_model.to_dict()
+ assert region_reference_model_json2 == region_reference_model_json
-class TestModel_LoadBalancer:
+class TestModel_Reservation:
"""
- Test Class for LoadBalancer
+ Test Class for Reservation
"""
- def test_load_balancer_serialization(self):
+ def test_reservation_serialization(self):
"""
- Test serialization/deserialization for LoadBalancer
+ Test serialization/deserialization for Reservation
"""
# Construct dict forms of any model objects needed in order to build this model.
- dns_instance_reference_model = {} # DNSInstanceReference
- dns_instance_reference_model['crn'] = 'crn:v1:bluemix:public:dns-svcs:global:a/123456:6860c359-b2e2-46fa-a944-b38c28201c6e'
+ reservation_capacity_model = {} # ReservationCapacity
+ reservation_capacity_model['allocated'] = 10
+ reservation_capacity_model['available'] = 2
+ reservation_capacity_model['status'] = 'allocated'
+ reservation_capacity_model['total'] = 10
+ reservation_capacity_model['used'] = 8
- dns_zone_reference_model = {} # DNSZoneReference
- dns_zone_reference_model['id'] = 'd66662cc-aa23-4fe1-9987-858487a61f45'
+ reservation_committed_use_model = {} # ReservationCommittedUse
+ reservation_committed_use_model['expiration_at'] = '2024-12-29T19:55:00Z'
+ reservation_committed_use_model['expiration_policy'] = 'renew'
+ reservation_committed_use_model['term'] = 'one_year'
- load_balancer_dns_model = {} # LoadBalancerDNS
- load_balancer_dns_model['instance'] = dns_instance_reference_model
- load_balancer_dns_model['zone'] = dns_zone_reference_model
+ reservation_profile_model = {} # ReservationProfile
+ reservation_profile_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-2x8'
+ reservation_profile_model['name'] = 'bx2-2x8'
+ reservation_profile_model['resource_type'] = 'instance_profile'
- load_balancer_listener_reference_deleted_model = {} # LoadBalancerListenerReferenceDeleted
- load_balancer_listener_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/4bbce614c13444cd8fc5e7e878ef8e21'
+ resource_group_reference_model['id'] = '4bbce614c13444cd8fc5e7e878ef8e21'
+ resource_group_reference_model['name'] = 'Default'
- 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'
+ reservation_status_reason_model = {} # ReservationStatusReason
+ reservation_status_reason_model['code'] = 'cannot_activate_no_capacity_available'
+ reservation_status_reason_model['message'] = 'The reservation cannot be activated because capacity is unavailable'
+ reservation_status_reason_model['more_info'] = 'https://cloud.ibm.com/docs/vpc?topic=vpc-reserved-capacity-status-reasons'
- load_balancer_logging_datapath_model = {} # LoadBalancerLoggingDatapath
- load_balancer_logging_datapath_model['active'] = True
+ 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'
- load_balancer_logging_model = {} # LoadBalancerLogging
- load_balancer_logging_model['datapath'] = load_balancer_logging_datapath_model
+ # Construct a json representation of a Reservation model
+ reservation_model_json = {}
+ reservation_model_json['affinity_policy'] = 'restricted'
+ reservation_model_json['capacity'] = reservation_capacity_model
+ reservation_model_json['committed_use'] = reservation_committed_use_model
+ reservation_model_json['created_at'] = '2019-01-01T12:00:00Z'
+ reservation_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::reservation:7187-ba49df72-37b8-43ac-98da-f8e029de0e63'
+ reservation_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/reservations/7187-ba49df72-37b8-43ac-98da-f8e029de0e63'
+ reservation_model_json['id'] = '7187-ba49df72-37b8-43ac-98da-f8e029de0e63'
+ reservation_model_json['lifecycle_state'] = 'stable'
+ reservation_model_json['name'] = 'my-reservation'
+ reservation_model_json['profile'] = reservation_profile_model
+ reservation_model_json['resource_group'] = resource_group_reference_model
+ reservation_model_json['resource_type'] = 'reservation'
+ reservation_model_json['status'] = 'activating'
+ reservation_model_json['status_reasons'] = [reservation_status_reason_model]
+ reservation_model_json['zone'] = zone_reference_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 model instance of Reservation by calling from_dict on the json representation
+ reservation_model = Reservation.from_dict(reservation_model_json)
+ assert reservation_model != False
- 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 Reservation by calling from_dict on the json representation
+ reservation_model_dict = Reservation.from_dict(reservation_model_json).__dict__
+ reservation_model2 = Reservation(**reservation_model_dict)
- reserved_ip_reference_deleted_model = {} # ReservedIPReferenceDeleted
- reserved_ip_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ # Verify the model instances are equivalent
+ assert reservation_model == reservation_model2
- load_balancer_private_ips_item_model = {} # LoadBalancerPrivateIpsItem
- load_balancer_private_ips_item_model['address'] = '192.168.3.4'
- load_balancer_private_ips_item_model['deleted'] = reserved_ip_reference_deleted_model
- load_balancer_private_ips_item_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb'
- load_balancer_private_ips_item_model['id'] = '6d353a0f-aeb1-4ae1-832e-1110d10981bb'
- load_balancer_private_ips_item_model['name'] = 'my-reserved-ip'
- load_balancer_private_ips_item_model['resource_type'] = 'subnet_reserved_ip'
+ # Convert model instance back to dict and verify no loss of data
+ reservation_model_json2 = reservation_model.to_dict()
+ assert reservation_model_json2 == reservation_model_json
- load_balancer_profile_reference_model = {} # LoadBalancerProfileReference
- load_balancer_profile_reference_model['family'] = 'network'
- load_balancer_profile_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed'
- load_balancer_profile_reference_model['name'] = 'network-fixed'
- ip_model = {} # IP
- ip_model['address'] = '192.168.3.4'
+class TestModel_ReservationCapacity:
+ """
+ Test Class for ReservationCapacity
+ """
- 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_reservation_capacity_serialization(self):
+ """
+ Test serialization/deserialization for ReservationCapacity
+ """
- 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 ReservationCapacity model
+ reservation_capacity_model_json = {}
+ reservation_capacity_model_json['allocated'] = 10
+ reservation_capacity_model_json['available'] = 2
+ reservation_capacity_model_json['status'] = 'allocated'
+ reservation_capacity_model_json['total'] = 10
+ reservation_capacity_model_json['used'] = 8
- 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 ReservationCapacity by calling from_dict on the json representation
+ reservation_capacity_model = ReservationCapacity.from_dict(reservation_capacity_model_json)
+ assert reservation_capacity_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 ReservationCapacity by calling from_dict on the json representation
+ reservation_capacity_model_dict = ReservationCapacity.from_dict(reservation_capacity_model_json).__dict__
+ reservation_capacity_model2 = ReservationCapacity(**reservation_capacity_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'
- subnet_reference_model['resource_type'] = 'subnet'
+ # Verify the model instances are equivalent
+ assert reservation_capacity_model == reservation_capacity_model2
- # 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['dns'] = load_balancer_dns_model
- load_balancer_model_json['hostname'] = '6b88d615-us-south.lb.appdomain.cloud'
- load_balancer_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727'
- load_balancer_model_json['id'] = 'dd754295-e9e0-4c9d-bf6c-58fbc59e5727'
- load_balancer_model_json['instance_groups_supported'] = False
- 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'] = [load_balancer_private_ips_item_model]
- load_balancer_model_json['profile'] = load_balancer_profile_reference_model
- load_balancer_model_json['provisioning_status'] = 'active'
- load_balancer_model_json['public_ips'] = [ip_model]
- load_balancer_model_json['resource_group'] = resource_group_reference_model
- load_balancer_model_json['resource_type'] = 'load_balancer'
- load_balancer_model_json['route_mode'] = True
- load_balancer_model_json['security_groups'] = [security_group_reference_model]
- load_balancer_model_json['security_groups_supported'] = True
- load_balancer_model_json['subnets'] = [subnet_reference_model]
- load_balancer_model_json['udp_supported'] = True
+ # Convert model instance back to dict and verify no loss of data
+ reservation_capacity_model_json2 = reservation_capacity_model.to_dict()
+ assert reservation_capacity_model_json2 == reservation_capacity_model_json
- # 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 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)
+class TestModel_ReservationCapacityPatch:
+ """
+ Test Class for ReservationCapacityPatch
+ """
+
+ def test_reservation_capacity_patch_serialization(self):
+ """
+ Test serialization/deserialization for ReservationCapacityPatch
+ """
+
+ # Construct a json representation of a ReservationCapacityPatch model
+ reservation_capacity_patch_model_json = {}
+ reservation_capacity_patch_model_json['total'] = 10
+
+ # Construct a model instance of ReservationCapacityPatch by calling from_dict on the json representation
+ reservation_capacity_patch_model = ReservationCapacityPatch.from_dict(reservation_capacity_patch_model_json)
+ assert reservation_capacity_patch_model != False
+
+ # Construct a model instance of ReservationCapacityPatch by calling from_dict on the json representation
+ reservation_capacity_patch_model_dict = ReservationCapacityPatch.from_dict(reservation_capacity_patch_model_json).__dict__
+ reservation_capacity_patch_model2 = ReservationCapacityPatch(**reservation_capacity_patch_model_dict)
# Verify the model instances are equivalent
- assert load_balancer_model == load_balancer_model2
+ assert reservation_capacity_patch_model == reservation_capacity_patch_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
+ reservation_capacity_patch_model_json2 = reservation_capacity_patch_model.to_dict()
+ assert reservation_capacity_patch_model_json2 == reservation_capacity_patch_model_json
-class TestModel_LoadBalancerCollection:
+class TestModel_ReservationCapacityPrototype:
"""
- Test Class for LoadBalancerCollection
+ Test Class for ReservationCapacityPrototype
"""
- def test_load_balancer_collection_serialization(self):
+ def test_reservation_capacity_prototype_serialization(self):
"""
- Test serialization/deserialization for LoadBalancerCollection
+ Test serialization/deserialization for ReservationCapacityPrototype
"""
- # 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'
+ # Construct a json representation of a ReservationCapacityPrototype model
+ reservation_capacity_prototype_model_json = {}
+ reservation_capacity_prototype_model_json['total'] = 10
- dns_instance_reference_model = {} # DNSInstanceReference
- dns_instance_reference_model['crn'] = 'crn:v1:bluemix:public:dns-svcs:global:a/123456:6860c359-b2e2-46fa-a944-b38c28201c6e'
+ # Construct a model instance of ReservationCapacityPrototype by calling from_dict on the json representation
+ reservation_capacity_prototype_model = ReservationCapacityPrototype.from_dict(reservation_capacity_prototype_model_json)
+ assert reservation_capacity_prototype_model != False
- dns_zone_reference_model = {} # DNSZoneReference
- dns_zone_reference_model['id'] = 'd66662cc-aa23-4fe1-9987-858487a61f45'
+ # Construct a model instance of ReservationCapacityPrototype by calling from_dict on the json representation
+ reservation_capacity_prototype_model_dict = ReservationCapacityPrototype.from_dict(reservation_capacity_prototype_model_json).__dict__
+ reservation_capacity_prototype_model2 = ReservationCapacityPrototype(**reservation_capacity_prototype_model_dict)
- load_balancer_dns_model = {} # LoadBalancerDNS
- load_balancer_dns_model['instance'] = dns_instance_reference_model
- load_balancer_dns_model['zone'] = dns_zone_reference_model
+ # Verify the model instances are equivalent
+ assert reservation_capacity_prototype_model == reservation_capacity_prototype_model2
- load_balancer_listener_reference_deleted_model = {} # LoadBalancerListenerReferenceDeleted
- load_balancer_listener_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
+ reservation_capacity_prototype_model_json2 = reservation_capacity_prototype_model.to_dict()
+ assert reservation_capacity_prototype_model_json2 == reservation_capacity_prototype_model_json
- 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
+class TestModel_ReservationCollection:
+ """
+ Test Class for ReservationCollection
+ """
- load_balancer_logging_model = {} # LoadBalancerLogging
- load_balancer_logging_model['datapath'] = load_balancer_logging_datapath_model
+ def test_reservation_collection_serialization(self):
+ """
+ Test serialization/deserialization for ReservationCollection
+ """
- load_balancer_pool_reference_deleted_model = {} # LoadBalancerPoolReferenceDeleted
- load_balancer_pool_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.
- 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'
+ reservation_collection_first_model = {} # ReservationCollectionFirst
+ reservation_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/reservations?limit=50'
- reserved_ip_reference_deleted_model = {} # ReservedIPReferenceDeleted
- reserved_ip_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ reservation_collection_next_model = {} # ReservationCollectionNext
+ reservation_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/reservations?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
- load_balancer_private_ips_item_model = {} # LoadBalancerPrivateIpsItem
- load_balancer_private_ips_item_model['address'] = '192.168.3.4'
- load_balancer_private_ips_item_model['deleted'] = reserved_ip_reference_deleted_model
- load_balancer_private_ips_item_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb'
- load_balancer_private_ips_item_model['id'] = '6d353a0f-aeb1-4ae1-832e-1110d10981bb'
- load_balancer_private_ips_item_model['name'] = 'my-reserved-ip'
- load_balancer_private_ips_item_model['resource_type'] = 'subnet_reserved_ip'
+ reservation_capacity_model = {} # ReservationCapacity
+ reservation_capacity_model['allocated'] = 10
+ reservation_capacity_model['available'] = 2
+ reservation_capacity_model['status'] = 'allocated'
+ reservation_capacity_model['total'] = 10
+ reservation_capacity_model['used'] = 8
- 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'
+ reservation_committed_use_model = {} # ReservationCommittedUse
+ reservation_committed_use_model['expiration_at'] = '2024-12-29T19:55:00Z'
+ reservation_committed_use_model['expiration_policy'] = 'renew'
+ reservation_committed_use_model['term'] = 'one_year'
- ip_model = {} # IP
- ip_model['address'] = '192.168.3.4'
+ reservation_profile_model = {} # ReservationProfile
+ reservation_profile_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-2x8'
+ reservation_profile_model['name'] = 'bx2-2x8'
+ reservation_profile_model['resource_type'] = 'instance_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'
-
- 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'
+ 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'
- subnet_reference_model = {} # SubnetReference
- subnet_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
- subnet_reference_model['deleted'] = subnet_reference_deleted_model
- subnet_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
- subnet_reference_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
- subnet_reference_model['name'] = 'my-subnet'
- subnet_reference_model['resource_type'] = 'subnet'
+ reservation_status_reason_model = {} # ReservationStatusReason
+ reservation_status_reason_model['code'] = 'cannot_activate_no_capacity_available'
+ reservation_status_reason_model['message'] = 'The reservation cannot be activated because capacity is unavailable'
+ reservation_status_reason_model['more_info'] = 'https://cloud.ibm.com/docs/vpc?topic=vpc-reserved-capacity-status-reasons'
- 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['dns'] = load_balancer_dns_model
- load_balancer_model['hostname'] = '6b88d615-us-south.lb.appdomain.cloud'
- load_balancer_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727'
- load_balancer_model['id'] = 'dd754295-e9e0-4c9d-bf6c-58fbc59e5727'
- load_balancer_model['instance_groups_supported'] = False
- 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'] = [load_balancer_private_ips_item_model]
- load_balancer_model['profile'] = load_balancer_profile_reference_model
- load_balancer_model['provisioning_status'] = 'active'
- load_balancer_model['public_ips'] = [ip_model]
- load_balancer_model['resource_group'] = resource_group_reference_model
- load_balancer_model['resource_type'] = 'load_balancer'
- load_balancer_model['route_mode'] = True
- load_balancer_model['security_groups'] = [security_group_reference_model]
- load_balancer_model['security_groups_supported'] = True
- load_balancer_model['subnets'] = [subnet_reference_model]
- load_balancer_model['udp_supported'] = True
+ 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'
- 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'
+ reservation_model = {} # Reservation
+ reservation_model['affinity_policy'] = 'restricted'
+ reservation_model['capacity'] = reservation_capacity_model
+ reservation_model['committed_use'] = reservation_committed_use_model
+ reservation_model['created_at'] = '2020-12-29T19:55:00Z'
+ reservation_model['crn'] = 'crn:[...]'
+ reservation_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/reservations/7187-ba49df72-37b8-43ac-98da-f8e029de0e63'
+ reservation_model['id'] = '7187-ba49df72-37b8-43ac-98da-f8e029de0e63'
+ reservation_model['lifecycle_state'] = 'stable'
+ reservation_model['name'] = 'my-reservation'
+ reservation_model['profile'] = reservation_profile_model
+ reservation_model['resource_group'] = resource_group_reference_model
+ reservation_model['resource_type'] = 'reservation'
+ reservation_model['status'] = 'active'
+ reservation_model['status_reasons'] = [reservation_status_reason_model]
+ reservation_model['zone'] = zone_reference_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 json representation of a ReservationCollection model
+ reservation_collection_model_json = {}
+ reservation_collection_model_json['first'] = reservation_collection_first_model
+ reservation_collection_model_json['limit'] = 20
+ reservation_collection_model_json['next'] = reservation_collection_next_model
+ reservation_collection_model_json['reservations'] = [reservation_model]
+ reservation_collection_model_json['total_count'] = 132
- # 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 ReservationCollection by calling from_dict on the json representation
+ reservation_collection_model = ReservationCollection.from_dict(reservation_collection_model_json)
+ assert reservation_collection_model != False
- # 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)
+ # Construct a model instance of ReservationCollection by calling from_dict on the json representation
+ reservation_collection_model_dict = ReservationCollection.from_dict(reservation_collection_model_json).__dict__
+ reservation_collection_model2 = ReservationCollection(**reservation_collection_model_dict)
# Verify the model instances are equivalent
- assert load_balancer_collection_model == load_balancer_collection_model2
+ assert reservation_collection_model == reservation_collection_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
+ reservation_collection_model_json2 = reservation_collection_model.to_dict()
+ assert reservation_collection_model_json2 == reservation_collection_model_json
-class TestModel_LoadBalancerCollectionFirst:
+class TestModel_ReservationCollectionFirst:
"""
- Test Class for LoadBalancerCollectionFirst
+ Test Class for ReservationCollectionFirst
"""
- def test_load_balancer_collection_first_serialization(self):
+ def test_reservation_collection_first_serialization(self):
"""
- Test serialization/deserialization for LoadBalancerCollectionFirst
+ Test serialization/deserialization for ReservationCollectionFirst
"""
- # 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 ReservationCollectionFirst model
+ reservation_collection_first_model_json = {}
+ reservation_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/reservations?limit=20'
- # 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 ReservationCollectionFirst by calling from_dict on the json representation
+ reservation_collection_first_model = ReservationCollectionFirst.from_dict(reservation_collection_first_model_json)
+ assert reservation_collection_first_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 ReservationCollectionFirst by calling from_dict on the json representation
+ reservation_collection_first_model_dict = ReservationCollectionFirst.from_dict(reservation_collection_first_model_json).__dict__
+ reservation_collection_first_model2 = ReservationCollectionFirst(**reservation_collection_first_model_dict)
# Verify the model instances are equivalent
- assert load_balancer_collection_first_model == load_balancer_collection_first_model2
+ assert reservation_collection_first_model == reservation_collection_first_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
+ reservation_collection_first_model_json2 = reservation_collection_first_model.to_dict()
+ assert reservation_collection_first_model_json2 == reservation_collection_first_model_json
-class TestModel_LoadBalancerCollectionNext:
+class TestModel_ReservationCollectionNext:
"""
- Test Class for LoadBalancerCollectionNext
+ Test Class for ReservationCollectionNext
"""
- def test_load_balancer_collection_next_serialization(self):
+ def test_reservation_collection_next_serialization(self):
"""
- Test serialization/deserialization for LoadBalancerCollectionNext
+ Test serialization/deserialization for ReservationCollectionNext
"""
- # 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 ReservationCollectionNext model
+ reservation_collection_next_model_json = {}
+ reservation_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/reservations?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
- # 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 ReservationCollectionNext by calling from_dict on the json representation
+ reservation_collection_next_model = ReservationCollectionNext.from_dict(reservation_collection_next_model_json)
+ assert reservation_collection_next_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 ReservationCollectionNext by calling from_dict on the json representation
+ reservation_collection_next_model_dict = ReservationCollectionNext.from_dict(reservation_collection_next_model_json).__dict__
+ reservation_collection_next_model2 = ReservationCollectionNext(**reservation_collection_next_model_dict)
# Verify the model instances are equivalent
- assert load_balancer_collection_next_model == load_balancer_collection_next_model2
+ assert reservation_collection_next_model == reservation_collection_next_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
+ reservation_collection_next_model_json2 = reservation_collection_next_model.to_dict()
+ assert reservation_collection_next_model_json2 == reservation_collection_next_model_json
-class TestModel_LoadBalancerDNS:
+class TestModel_ReservationCommittedUse:
"""
- Test Class for LoadBalancerDNS
+ Test Class for ReservationCommittedUse
"""
- def test_load_balancer_dns_serialization(self):
+ def test_reservation_committed_use_serialization(self):
"""
- Test serialization/deserialization for LoadBalancerDNS
+ Test serialization/deserialization for ReservationCommittedUse
"""
- # Construct dict forms of any model objects needed in order to build this model.
-
- dns_instance_reference_model = {} # DNSInstanceReference
- dns_instance_reference_model['crn'] = 'crn:v1:bluemix:public:dns-svcs:global:a/123456:6860c359-b2e2-46fa-a944-b38c28201c6e'
-
- dns_zone_reference_model = {} # DNSZoneReference
- dns_zone_reference_model['id'] = 'd66662cc-aa23-4fe1-9987-858487a61f45'
-
- # Construct a json representation of a LoadBalancerDNS model
- load_balancer_dns_model_json = {}
- load_balancer_dns_model_json['instance'] = dns_instance_reference_model
- load_balancer_dns_model_json['zone'] = dns_zone_reference_model
+ # Construct a json representation of a ReservationCommittedUse model
+ reservation_committed_use_model_json = {}
+ reservation_committed_use_model_json['expiration_at'] = '2019-01-01T12:00:00Z'
+ reservation_committed_use_model_json['expiration_policy'] = 'release'
+ reservation_committed_use_model_json['term'] = 'testString'
- # Construct a model instance of LoadBalancerDNS by calling from_dict on the json representation
- load_balancer_dns_model = LoadBalancerDNS.from_dict(load_balancer_dns_model_json)
- assert load_balancer_dns_model != False
+ # Construct a model instance of ReservationCommittedUse by calling from_dict on the json representation
+ reservation_committed_use_model = ReservationCommittedUse.from_dict(reservation_committed_use_model_json)
+ assert reservation_committed_use_model != False
- # Construct a model instance of LoadBalancerDNS by calling from_dict on the json representation
- load_balancer_dns_model_dict = LoadBalancerDNS.from_dict(load_balancer_dns_model_json).__dict__
- load_balancer_dns_model2 = LoadBalancerDNS(**load_balancer_dns_model_dict)
+ # Construct a model instance of ReservationCommittedUse by calling from_dict on the json representation
+ reservation_committed_use_model_dict = ReservationCommittedUse.from_dict(reservation_committed_use_model_json).__dict__
+ reservation_committed_use_model2 = ReservationCommittedUse(**reservation_committed_use_model_dict)
# Verify the model instances are equivalent
- assert load_balancer_dns_model == load_balancer_dns_model2
+ assert reservation_committed_use_model == reservation_committed_use_model2
# Convert model instance back to dict and verify no loss of data
- load_balancer_dns_model_json2 = load_balancer_dns_model.to_dict()
- assert load_balancer_dns_model_json2 == load_balancer_dns_model_json
+ reservation_committed_use_model_json2 = reservation_committed_use_model.to_dict()
+ assert reservation_committed_use_model_json2 == reservation_committed_use_model_json
-class TestModel_LoadBalancerDNSPatch:
+class TestModel_ReservationCommittedUsePatch:
"""
- Test Class for LoadBalancerDNSPatch
+ Test Class for ReservationCommittedUsePatch
"""
- def test_load_balancer_dns_patch_serialization(self):
+ def test_reservation_committed_use_patch_serialization(self):
"""
- Test serialization/deserialization for LoadBalancerDNSPatch
+ Test serialization/deserialization for ReservationCommittedUsePatch
"""
- # Construct dict forms of any model objects needed in order to build this model.
-
- dns_instance_identity_model = {} # DNSInstanceIdentityByCRN
- dns_instance_identity_model['crn'] = 'crn:v1:bluemix:public:dns-svcs:global:a/123456:6860c359-b2e2-46fa-a944-b38c28201c6e'
-
- dns_zone_identity_model = {} # DNSZoneIdentityById
- dns_zone_identity_model['id'] = 'd66662cc-aa23-4fe1-9987-858487a61f45'
-
- # Construct a json representation of a LoadBalancerDNSPatch model
- load_balancer_dns_patch_model_json = {}
- load_balancer_dns_patch_model_json['instance'] = dns_instance_identity_model
- load_balancer_dns_patch_model_json['zone'] = dns_zone_identity_model
+ # Construct a json representation of a ReservationCommittedUsePatch model
+ reservation_committed_use_patch_model_json = {}
+ reservation_committed_use_patch_model_json['expiration_policy'] = 'release'
+ reservation_committed_use_patch_model_json['term'] = 'testString'
- # Construct a model instance of LoadBalancerDNSPatch by calling from_dict on the json representation
- load_balancer_dns_patch_model = LoadBalancerDNSPatch.from_dict(load_balancer_dns_patch_model_json)
- assert load_balancer_dns_patch_model != False
+ # Construct a model instance of ReservationCommittedUsePatch by calling from_dict on the json representation
+ reservation_committed_use_patch_model = ReservationCommittedUsePatch.from_dict(reservation_committed_use_patch_model_json)
+ assert reservation_committed_use_patch_model != False
- # Construct a model instance of LoadBalancerDNSPatch by calling from_dict on the json representation
- load_balancer_dns_patch_model_dict = LoadBalancerDNSPatch.from_dict(load_balancer_dns_patch_model_json).__dict__
- load_balancer_dns_patch_model2 = LoadBalancerDNSPatch(**load_balancer_dns_patch_model_dict)
+ # Construct a model instance of ReservationCommittedUsePatch by calling from_dict on the json representation
+ reservation_committed_use_patch_model_dict = ReservationCommittedUsePatch.from_dict(reservation_committed_use_patch_model_json).__dict__
+ reservation_committed_use_patch_model2 = ReservationCommittedUsePatch(**reservation_committed_use_patch_model_dict)
# Verify the model instances are equivalent
- assert load_balancer_dns_patch_model == load_balancer_dns_patch_model2
+ assert reservation_committed_use_patch_model == reservation_committed_use_patch_model2
# Convert model instance back to dict and verify no loss of data
- load_balancer_dns_patch_model_json2 = load_balancer_dns_patch_model.to_dict()
- assert load_balancer_dns_patch_model_json2 == load_balancer_dns_patch_model_json
+ reservation_committed_use_patch_model_json2 = reservation_committed_use_patch_model.to_dict()
+ assert reservation_committed_use_patch_model_json2 == reservation_committed_use_patch_model_json
-class TestModel_LoadBalancerDNSPrototype:
+class TestModel_ReservationCommittedUsePrototype:
"""
- Test Class for LoadBalancerDNSPrototype
+ Test Class for ReservationCommittedUsePrototype
"""
- def test_load_balancer_dns_prototype_serialization(self):
+ def test_reservation_committed_use_prototype_serialization(self):
"""
- Test serialization/deserialization for LoadBalancerDNSPrototype
+ Test serialization/deserialization for ReservationCommittedUsePrototype
"""
- # Construct dict forms of any model objects needed in order to build this model.
-
- dns_instance_identity_model = {} # DNSInstanceIdentityByCRN
- dns_instance_identity_model['crn'] = 'crn:v1:bluemix:public:dns-svcs:global:a/123456:6860c359-b2e2-46fa-a944-b38c28201c6e'
-
- dns_zone_identity_model = {} # DNSZoneIdentityById
- dns_zone_identity_model['id'] = 'd66662cc-aa23-4fe1-9987-858487a61f45'
-
- # Construct a json representation of a LoadBalancerDNSPrototype model
- load_balancer_dns_prototype_model_json = {}
- load_balancer_dns_prototype_model_json['instance'] = dns_instance_identity_model
- load_balancer_dns_prototype_model_json['zone'] = dns_zone_identity_model
+ # Construct a json representation of a ReservationCommittedUsePrototype model
+ reservation_committed_use_prototype_model_json = {}
+ reservation_committed_use_prototype_model_json['expiration_policy'] = 'release'
+ reservation_committed_use_prototype_model_json['term'] = 'testString'
- # Construct a model instance of LoadBalancerDNSPrototype by calling from_dict on the json representation
- load_balancer_dns_prototype_model = LoadBalancerDNSPrototype.from_dict(load_balancer_dns_prototype_model_json)
- assert load_balancer_dns_prototype_model != False
+ # Construct a model instance of ReservationCommittedUsePrototype by calling from_dict on the json representation
+ reservation_committed_use_prototype_model = ReservationCommittedUsePrototype.from_dict(reservation_committed_use_prototype_model_json)
+ assert reservation_committed_use_prototype_model != False
- # Construct a model instance of LoadBalancerDNSPrototype by calling from_dict on the json representation
- load_balancer_dns_prototype_model_dict = LoadBalancerDNSPrototype.from_dict(load_balancer_dns_prototype_model_json).__dict__
- load_balancer_dns_prototype_model2 = LoadBalancerDNSPrototype(**load_balancer_dns_prototype_model_dict)
+ # Construct a model instance of ReservationCommittedUsePrototype by calling from_dict on the json representation
+ reservation_committed_use_prototype_model_dict = ReservationCommittedUsePrototype.from_dict(reservation_committed_use_prototype_model_json).__dict__
+ reservation_committed_use_prototype_model2 = ReservationCommittedUsePrototype(**reservation_committed_use_prototype_model_dict)
# Verify the model instances are equivalent
- assert load_balancer_dns_prototype_model == load_balancer_dns_prototype_model2
+ assert reservation_committed_use_prototype_model == reservation_committed_use_prototype_model2
# Convert model instance back to dict and verify no loss of data
- load_balancer_dns_prototype_model_json2 = load_balancer_dns_prototype_model.to_dict()
- assert load_balancer_dns_prototype_model_json2 == load_balancer_dns_prototype_model_json
+ reservation_committed_use_prototype_model_json2 = reservation_committed_use_prototype_model.to_dict()
+ assert reservation_committed_use_prototype_model_json2 == reservation_committed_use_prototype_model_json
-class TestModel_LoadBalancerListener:
+class TestModel_ReservationPatch:
"""
- Test Class for LoadBalancerListener
+ Test Class for ReservationPatch
"""
- def test_load_balancer_listener_serialization(self):
+ def test_reservation_patch_serialization(self):
"""
- Test serialization/deserialization for LoadBalancerListener
+ Test serialization/deserialization for ReservationPatch
"""
# 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:secrets-manager:us-south:a/123456:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5'
+ reservation_capacity_patch_model = {} # ReservationCapacityPatch
+ reservation_capacity_patch_model['total'] = 10
- load_balancer_pool_reference_deleted_model = {} # LoadBalancerPoolReferenceDeleted
- load_balancer_pool_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ reservation_committed_use_patch_model = {} # ReservationCommittedUsePatch
+ reservation_committed_use_patch_model['expiration_policy'] = 'renew'
+ reservation_committed_use_patch_model['term'] = 'testString'
- 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'
+ reservation_profile_patch_model = {} # ReservationProfilePatch
+ reservation_profile_patch_model['name'] = 'bx2-4x16'
+ reservation_profile_patch_model['resource_type'] = 'instance_profile'
- 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 json representation of a ReservationPatch model
+ reservation_patch_model_json = {}
+ reservation_patch_model_json['capacity'] = reservation_capacity_patch_model
+ reservation_patch_model_json['committed_use'] = reservation_committed_use_patch_model
+ reservation_patch_model_json['name'] = 'my-reservation'
+ reservation_patch_model_json['profile'] = reservation_profile_patch_model
- 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 ReservationPatch by calling from_dict on the json representation
+ reservation_patch_model = ReservationPatch.from_dict(reservation_patch_model_json)
+ assert reservation_patch_model != False
- 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'
+ # Construct a model instance of ReservationPatch by calling from_dict on the json representation
+ reservation_patch_model_dict = ReservationPatch.from_dict(reservation_patch_model_json).__dict__
+ reservation_patch_model2 = ReservationPatch(**reservation_patch_model_dict)
- 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'
+ # Verify the model instances are equivalent
+ assert reservation_patch_model == reservation_patch_model2
- 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_policy_reference_model['name'] = 'testString'
+ # Convert model instance back to dict and verify no loss of data
+ reservation_patch_model_json2 = reservation_patch_model.to_dict()
+ assert reservation_patch_model_json2 == reservation_patch_model_json
- # 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['idle_connection_timeout'] = 100
- 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
+class TestModel_ReservationProfile:
+ """
+ Test Class for ReservationProfile
+ """
- # 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)
+ def test_reservation_profile_serialization(self):
+ """
+ Test serialization/deserialization for ReservationProfile
+ """
+
+ # Construct a json representation of a ReservationProfile model
+ reservation_profile_model_json = {}
+ reservation_profile_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16'
+ reservation_profile_model_json['name'] = 'bx2-4x16'
+ reservation_profile_model_json['resource_type'] = 'instance_profile'
+
+ # Construct a model instance of ReservationProfile by calling from_dict on the json representation
+ reservation_profile_model = ReservationProfile.from_dict(reservation_profile_model_json)
+ assert reservation_profile_model != False
+
+ # Construct a model instance of ReservationProfile by calling from_dict on the json representation
+ reservation_profile_model_dict = ReservationProfile.from_dict(reservation_profile_model_json).__dict__
+ reservation_profile_model2 = ReservationProfile(**reservation_profile_model_dict)
# Verify the model instances are equivalent
- assert load_balancer_listener_model == load_balancer_listener_model2
+ assert reservation_profile_model == reservation_profile_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
+ reservation_profile_model_json2 = reservation_profile_model.to_dict()
+ assert reservation_profile_model_json2 == reservation_profile_model_json
-class TestModel_LoadBalancerListenerCollection:
+class TestModel_ReservationProfilePatch:
"""
- Test Class for LoadBalancerListenerCollection
+ Test Class for ReservationProfilePatch
"""
- def test_load_balancer_listener_collection_serialization(self):
+ def test_reservation_profile_patch_serialization(self):
"""
- Test serialization/deserialization for LoadBalancerListenerCollection
+ Test serialization/deserialization for ReservationProfilePatch
"""
- # 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:secrets-manager:us-south:a/123456:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5'
-
- load_balancer_pool_reference_deleted_model = {} # LoadBalancerPoolReferenceDeleted
- load_balancer_pool_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ # Construct a json representation of a ReservationProfilePatch model
+ reservation_profile_patch_model_json = {}
+ reservation_profile_patch_model_json['name'] = 'bx2-4x16'
+ reservation_profile_patch_model_json['resource_type'] = 'instance_profile'
- 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 ReservationProfilePatch by calling from_dict on the json representation
+ reservation_profile_patch_model = ReservationProfilePatch.from_dict(reservation_profile_patch_model_json)
+ assert reservation_profile_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 ReservationProfilePatch by calling from_dict on the json representation
+ reservation_profile_patch_model_dict = ReservationProfilePatch.from_dict(reservation_profile_patch_model_json).__dict__
+ reservation_profile_patch_model2 = ReservationProfilePatch(**reservation_profile_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 reservation_profile_patch_model == reservation_profile_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
+ reservation_profile_patch_model_json2 = reservation_profile_patch_model.to_dict()
+ assert reservation_profile_patch_model_json2 == reservation_profile_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'
- 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_policy_reference_model['name'] = 'testString'
+class TestModel_ReservationProfilePrototype:
+ """
+ Test Class for ReservationProfilePrototype
+ """
- 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['idle_connection_timeout'] = 100
- 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'
+ def test_reservation_profile_prototype_serialization(self):
+ """
+ Test serialization/deserialization for ReservationProfilePrototype
+ """
- # 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 json representation of a ReservationProfilePrototype model
+ reservation_profile_prototype_model_json = {}
+ reservation_profile_prototype_model_json['name'] = 'bx2-4x16'
+ reservation_profile_prototype_model_json['resource_type'] = 'instance_profile'
- # 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 ReservationProfilePrototype by calling from_dict on the json representation
+ reservation_profile_prototype_model = ReservationProfilePrototype.from_dict(reservation_profile_prototype_model_json)
+ assert reservation_profile_prototype_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)
+ # Construct a model instance of ReservationProfilePrototype by calling from_dict on the json representation
+ reservation_profile_prototype_model_dict = ReservationProfilePrototype.from_dict(reservation_profile_prototype_model_json).__dict__
+ reservation_profile_prototype_model2 = ReservationProfilePrototype(**reservation_profile_prototype_model_dict)
# Verify the model instances are equivalent
- assert load_balancer_listener_collection_model == load_balancer_listener_collection_model2
+ assert reservation_profile_prototype_model == reservation_profile_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
+ reservation_profile_prototype_model_json2 = reservation_profile_prototype_model.to_dict()
+ assert reservation_profile_prototype_model_json2 == reservation_profile_prototype_model_json
-class TestModel_LoadBalancerListenerHTTPSRedirect:
+class TestModel_ReservationReference:
"""
- Test Class for LoadBalancerListenerHTTPSRedirect
+ Test Class for ReservationReference
"""
- def test_load_balancer_listener_https_redirect_serialization(self):
+ def test_reservation_reference_serialization(self):
"""
- Test serialization/deserialization for LoadBalancerListenerHTTPSRedirect
+ Test serialization/deserialization for ReservationReference
"""
# 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'
+ reservation_reference_deleted_model = {} # ReservationReferenceDeleted
+ reservation_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 ReservationReference model
+ reservation_reference_model_json = {}
+ reservation_reference_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::reservation:7187-ba49df72-37b8-43ac-98da-f8e029de0e63'
+ reservation_reference_model_json['deleted'] = reservation_reference_deleted_model
+ reservation_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/reservations/7187-ba49df72-37b8-43ac-98da-f8e029de0e63'
+ reservation_reference_model_json['id'] = '7187-ba49df72-37b8-43ac-98da-f8e029de0e63'
+ reservation_reference_model_json['name'] = 'my-reservation'
+ reservation_reference_model_json['resource_type'] = 'reservation'
- # 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 ReservationReference by calling from_dict on the json representation
+ reservation_reference_model = ReservationReference.from_dict(reservation_reference_model_json)
+ assert reservation_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 ReservationReference by calling from_dict on the json representation
+ reservation_reference_model_dict = ReservationReference.from_dict(reservation_reference_model_json).__dict__
+ reservation_reference_model2 = ReservationReference(**reservation_reference_model_dict)
# Verify the model instances are equivalent
- assert load_balancer_listener_https_redirect_model == load_balancer_listener_https_redirect_model2
+ assert reservation_reference_model == reservation_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
+ reservation_reference_model_json2 = reservation_reference_model.to_dict()
+ assert reservation_reference_model_json2 == reservation_reference_model_json
-class TestModel_LoadBalancerListenerHTTPSRedirectPatch:
+class TestModel_ReservationReferenceDeleted:
"""
- Test Class for LoadBalancerListenerHTTPSRedirectPatch
+ Test Class for ReservationReferenceDeleted
"""
- def test_load_balancer_listener_https_redirect_patch_serialization(self):
+ def test_reservation_reference_deleted_serialization(self):
"""
- Test serialization/deserialization for LoadBalancerListenerHTTPSRedirectPatch
+ Test serialization/deserialization for ReservationReferenceDeleted
"""
- # 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 ReservationReferenceDeleted model
+ reservation_reference_deleted_model_json = {}
+ reservation_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 ReservationReferenceDeleted by calling from_dict on the json representation
+ reservation_reference_deleted_model = ReservationReferenceDeleted.from_dict(reservation_reference_deleted_model_json)
+ assert reservation_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 ReservationReferenceDeleted by calling from_dict on the json representation
+ reservation_reference_deleted_model_dict = ReservationReferenceDeleted.from_dict(reservation_reference_deleted_model_json).__dict__
+ reservation_reference_deleted_model2 = ReservationReferenceDeleted(**reservation_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 reservation_reference_deleted_model == reservation_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
+ reservation_reference_deleted_model_json2 = reservation_reference_deleted_model.to_dict()
+ assert reservation_reference_deleted_model_json2 == reservation_reference_deleted_model_json
-class TestModel_LoadBalancerListenerHTTPSRedirectPrototype:
+class TestModel_ReservationStatusReason:
"""
- Test Class for LoadBalancerListenerHTTPSRedirectPrototype
+ Test Class for ReservationStatusReason
"""
- def test_load_balancer_listener_https_redirect_prototype_serialization(self):
+ def test_reservation_status_reason_serialization(self):
"""
- Test serialization/deserialization for LoadBalancerListenerHTTPSRedirectPrototype
+ Test serialization/deserialization for ReservationStatusReason
"""
- # 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 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 json representation of a ReservationStatusReason model
+ reservation_status_reason_model_json = {}
+ reservation_status_reason_model_json['code'] = 'cannot_activate_no_capacity_available'
+ reservation_status_reason_model_json['message'] = 'The reservation cannot be activated because capacity is unavailable'
+ reservation_status_reason_model_json['more_info'] = 'https://cloud.ibm.com/docs/vpc?topic=vpc-reserved-capacity-status-reasons'
- # 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 ReservationStatusReason by calling from_dict on the json representation
+ reservation_status_reason_model = ReservationStatusReason.from_dict(reservation_status_reason_model_json)
+ assert reservation_status_reason_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)
+ # Construct a model instance of ReservationStatusReason by calling from_dict on the json representation
+ reservation_status_reason_model_dict = ReservationStatusReason.from_dict(reservation_status_reason_model_json).__dict__
+ reservation_status_reason_model2 = ReservationStatusReason(**reservation_status_reason_model_dict)
# Verify the model instances are equivalent
- assert load_balancer_listener_https_redirect_prototype_model == load_balancer_listener_https_redirect_prototype_model2
+ assert reservation_status_reason_model == reservation_status_reason_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
+ reservation_status_reason_model_json2 = reservation_status_reason_model.to_dict()
+ assert reservation_status_reason_model_json2 == reservation_status_reason_model_json
-class TestModel_LoadBalancerListenerPatch:
+class TestModel_ReservedIP:
"""
- Test Class for LoadBalancerListenerPatch
+ Test Class for ReservedIP
"""
- def test_load_balancer_listener_patch_serialization(self):
+ def test_reserved_ip_serialization(self):
"""
- Test serialization/deserialization for LoadBalancerListenerPatch
+ Test serialization/deserialization for ReservedIP
"""
# Construct dict forms of any model objects needed in order to build this model.
- certificate_instance_identity_model = {} # CertificateInstanceIdentityByCRN
- certificate_instance_identity_model['crn'] = 'crn:v1:bluemix:public:secrets-manager:us-south:a/123456:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5'
-
- load_balancer_pool_identity_model = {} # LoadBalancerPoolIdentityById
- load_balancer_pool_identity_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004'
-
- load_balancer_listener_identity_model = {} # LoadBalancerListenerIdentityById
- load_balancer_listener_identity_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004'
+ endpoint_gateway_reference_deleted_model = {} # EndpointGatewayReferenceDeleted
+ endpoint_gateway_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- 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'
+ reserved_ip_target_model = {} # ReservedIPTargetEndpointGatewayReference
+ reserved_ip_target_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5'
+ reserved_ip_target_model['deleted'] = endpoint_gateway_reference_deleted_model
+ reserved_ip_target_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5'
+ reserved_ip_target_model['id'] = 'r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5'
+ reserved_ip_target_model['name'] = 'my-endpoint-gateway'
+ reserved_ip_target_model['resource_type'] = 'endpoint_gateway'
- # 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['idle_connection_timeout'] = 100
- 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 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['lifecycle_state'] = 'stable'
+ reserved_ip_model_json['name'] = 'my-reserved-ip'
+ reserved_ip_model_json['owner'] = 'user'
+ reserved_ip_model_json['resource_type'] = 'subnet_reserved_ip'
+ reserved_ip_model_json['target'] = reserved_ip_target_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 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 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 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 load_balancer_listener_patch_model == load_balancer_listener_patch_model2
+ assert reserved_ip_model == reserved_ip_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
+ reserved_ip_model_json2 = reserved_ip_model.to_dict()
+ assert reserved_ip_model_json2 == reserved_ip_model_json
-class TestModel_LoadBalancerListenerPolicy:
+class TestModel_ReservedIPCollection:
"""
- Test Class for LoadBalancerListenerPolicy
+ Test Class for ReservedIPCollection
"""
- def test_load_balancer_listener_policy_serialization(self):
+ def test_reserved_ip_collection_serialization(self):
"""
- Test serialization/deserialization for LoadBalancerListenerPolicy
+ Test serialization/deserialization for ReservedIPCollection
"""
# 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'
+ 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'
- 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'
+ 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'
- load_balancer_pool_reference_deleted_model = {} # LoadBalancerPoolReferenceDeleted
- load_balancer_pool_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ endpoint_gateway_reference_deleted_model = {} # EndpointGatewayReferenceDeleted
+ endpoint_gateway_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'
+ reserved_ip_target_model = {} # ReservedIPTargetEndpointGatewayReference
+ reserved_ip_target_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5'
+ reserved_ip_target_model['deleted'] = endpoint_gateway_reference_deleted_model
+ reserved_ip_target_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5'
+ reserved_ip_target_model['id'] = 'r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5'
+ reserved_ip_target_model['name'] = 'my-endpoint-gateway'
+ reserved_ip_target_model['resource_type'] = 'endpoint_gateway'
- # 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
+ reserved_ip_model = {} # ReservedIP
+ reserved_ip_model['address'] = '192.168.3.4'
+ reserved_ip_model['auto_delete'] = False
+ reserved_ip_model['created_at'] = '2019-01-01T12:00:00Z'
+ reserved_ip_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb'
+ reserved_ip_model['id'] = '6d353a0f-aeb1-4ae1-832e-1110d10981bb'
+ reserved_ip_model['lifecycle_state'] = 'stable'
+ reserved_ip_model['name'] = 'my-reserved-ip'
+ reserved_ip_model['owner'] = 'user'
+ reserved_ip_model['resource_type'] = 'subnet_reserved_ip'
+ reserved_ip_model['target'] = reserved_ip_target_model
- # 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 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 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 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 load_balancer_listener_policy_model == load_balancer_listener_policy_model2
+ assert reserved_ip_collection_model == reserved_ip_collection_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
+ reserved_ip_collection_model_json2 = reserved_ip_collection_model.to_dict()
+ assert reserved_ip_collection_model_json2 == reserved_ip_collection_model_json
-class TestModel_LoadBalancerListenerPolicyCollection:
+class TestModel_ReservedIPCollectionBareMetalServerNetworkInterfaceContext:
"""
- Test Class for LoadBalancerListenerPolicyCollection
+ Test Class for ReservedIPCollectionBareMetalServerNetworkInterfaceContext
"""
- def test_load_balancer_listener_policy_collection_serialization(self):
+ def test_reserved_ip_collection_bare_metal_server_network_interface_context_serialization(self):
"""
- Test serialization/deserialization for LoadBalancerListenerPolicyCollection
+ Test serialization/deserialization for ReservedIPCollectionBareMetalServerNetworkInterfaceContext
"""
# 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'
+ reserved_ip_collection_bare_metal_server_network_interface_context_first_model = {} # ReservedIPCollectionBareMetalServerNetworkInterfaceContextFirst
+ reserved_ip_collection_bare_metal_server_network_interface_context_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e/ips?limit=20'
- 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'
+ endpoint_gateway_reference_deleted_model = {} # EndpointGatewayReferenceDeleted
+ endpoint_gateway_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'
+ reserved_ip_target_model = {} # ReservedIPTargetEndpointGatewayReference
+ reserved_ip_target_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5'
+ reserved_ip_target_model['deleted'] = endpoint_gateway_reference_deleted_model
+ reserved_ip_target_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5'
+ reserved_ip_target_model['id'] = 'r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5'
+ reserved_ip_target_model['name'] = 'my-endpoint-gateway'
+ reserved_ip_target_model['resource_type'] = 'endpoint_gateway'
- 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'
+ reserved_ip_model = {} # ReservedIP
+ reserved_ip_model['address'] = '192.168.3.4'
+ reserved_ip_model['auto_delete'] = False
+ reserved_ip_model['created_at'] = '2019-01-01T12:00:00Z'
+ reserved_ip_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb'
+ reserved_ip_model['id'] = '6d353a0f-aeb1-4ae1-832e-1110d10981bb'
+ reserved_ip_model['lifecycle_state'] = 'stable'
+ reserved_ip_model['name'] = 'my-reserved-ip'
+ reserved_ip_model['owner'] = 'user'
+ reserved_ip_model['resource_type'] = 'subnet_reserved_ip'
+ reserved_ip_model['target'] = reserved_ip_target_model
- 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
+ reserved_ip_collection_bare_metal_server_network_interface_context_next_model = {} # ReservedIPCollectionBareMetalServerNetworkInterfaceContextNext
+ reserved_ip_collection_bare_metal_server_network_interface_context_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e/ips?start=a404e343444b4e1095c9edba76672d67&limit=20'
- # Construct a json representation of a LoadBalancerListenerPolicyCollection model
- load_balancer_listener_policy_collection_model_json = {}
- load_balancer_listener_policy_collection_model_json['policies'] = [load_balancer_listener_policy_model]
+ # Construct a json representation of a ReservedIPCollectionBareMetalServerNetworkInterfaceContext model
+ reserved_ip_collection_bare_metal_server_network_interface_context_model_json = {}
+ reserved_ip_collection_bare_metal_server_network_interface_context_model_json['first'] = reserved_ip_collection_bare_metal_server_network_interface_context_first_model
+ reserved_ip_collection_bare_metal_server_network_interface_context_model_json['ips'] = [reserved_ip_model]
+ reserved_ip_collection_bare_metal_server_network_interface_context_model_json['limit'] = 20
+ reserved_ip_collection_bare_metal_server_network_interface_context_model_json['next'] = reserved_ip_collection_bare_metal_server_network_interface_context_next_model
+ reserved_ip_collection_bare_metal_server_network_interface_context_model_json['total_count'] = 132
- # Construct a model instance of 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 ReservedIPCollectionBareMetalServerNetworkInterfaceContext by calling from_dict on the json representation
+ reserved_ip_collection_bare_metal_server_network_interface_context_model = ReservedIPCollectionBareMetalServerNetworkInterfaceContext.from_dict(reserved_ip_collection_bare_metal_server_network_interface_context_model_json)
+ assert reserved_ip_collection_bare_metal_server_network_interface_context_model != False
- # Construct a model instance of 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 ReservedIPCollectionBareMetalServerNetworkInterfaceContext by calling from_dict on the json representation
+ reserved_ip_collection_bare_metal_server_network_interface_context_model_dict = ReservedIPCollectionBareMetalServerNetworkInterfaceContext.from_dict(reserved_ip_collection_bare_metal_server_network_interface_context_model_json).__dict__
+ reserved_ip_collection_bare_metal_server_network_interface_context_model2 = ReservedIPCollectionBareMetalServerNetworkInterfaceContext(**reserved_ip_collection_bare_metal_server_network_interface_context_model_dict)
# Verify the model instances are equivalent
- assert load_balancer_listener_policy_collection_model == load_balancer_listener_policy_collection_model2
+ assert reserved_ip_collection_bare_metal_server_network_interface_context_model == reserved_ip_collection_bare_metal_server_network_interface_context_model2
# Convert model instance back to dict and verify no loss of data
- 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
+ reserved_ip_collection_bare_metal_server_network_interface_context_model_json2 = reserved_ip_collection_bare_metal_server_network_interface_context_model.to_dict()
+ assert reserved_ip_collection_bare_metal_server_network_interface_context_model_json2 == reserved_ip_collection_bare_metal_server_network_interface_context_model_json
-class TestModel_LoadBalancerListenerPolicyPatch:
+class TestModel_ReservedIPCollectionBareMetalServerNetworkInterfaceContextFirst:
"""
- Test Class for LoadBalancerListenerPolicyPatch
+ Test Class for ReservedIPCollectionBareMetalServerNetworkInterfaceContextFirst
"""
- def test_load_balancer_listener_policy_patch_serialization(self):
+ def test_reserved_ip_collection_bare_metal_server_network_interface_context_first_serialization(self):
"""
- Test serialization/deserialization for LoadBalancerListenerPolicyPatch
+ Test serialization/deserialization for ReservedIPCollectionBareMetalServerNetworkInterfaceContextFirst
"""
- # Construct dict forms of any model objects needed in order to build this model.
-
- load_balancer_listener_policy_target_patch_model = {} # LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityById
- load_balancer_listener_policy_target_patch_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004'
-
- # 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 json representation of a ReservedIPCollectionBareMetalServerNetworkInterfaceContextFirst model
+ reserved_ip_collection_bare_metal_server_network_interface_context_first_model_json = {}
+ reserved_ip_collection_bare_metal_server_network_interface_context_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e/ips?limit=20'
- # Construct a model instance of 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
+ # Construct a model instance of ReservedIPCollectionBareMetalServerNetworkInterfaceContextFirst by calling from_dict on the json representation
+ reserved_ip_collection_bare_metal_server_network_interface_context_first_model = ReservedIPCollectionBareMetalServerNetworkInterfaceContextFirst.from_dict(reserved_ip_collection_bare_metal_server_network_interface_context_first_model_json)
+ assert reserved_ip_collection_bare_metal_server_network_interface_context_first_model != False
- # Construct a model instance of 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)
+ # Construct a model instance of ReservedIPCollectionBareMetalServerNetworkInterfaceContextFirst by calling from_dict on the json representation
+ reserved_ip_collection_bare_metal_server_network_interface_context_first_model_dict = ReservedIPCollectionBareMetalServerNetworkInterfaceContextFirst.from_dict(reserved_ip_collection_bare_metal_server_network_interface_context_first_model_json).__dict__
+ reserved_ip_collection_bare_metal_server_network_interface_context_first_model2 = ReservedIPCollectionBareMetalServerNetworkInterfaceContextFirst(**reserved_ip_collection_bare_metal_server_network_interface_context_first_model_dict)
# Verify the model instances are equivalent
- assert load_balancer_listener_policy_patch_model == load_balancer_listener_policy_patch_model2
+ assert reserved_ip_collection_bare_metal_server_network_interface_context_first_model == reserved_ip_collection_bare_metal_server_network_interface_context_first_model2
# Convert model instance back to dict and verify no loss of data
- 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
+ reserved_ip_collection_bare_metal_server_network_interface_context_first_model_json2 = reserved_ip_collection_bare_metal_server_network_interface_context_first_model.to_dict()
+ assert reserved_ip_collection_bare_metal_server_network_interface_context_first_model_json2 == reserved_ip_collection_bare_metal_server_network_interface_context_first_model_json
-class TestModel_LoadBalancerListenerPolicyPrototype:
+class TestModel_ReservedIPCollectionBareMetalServerNetworkInterfaceContextNext:
"""
- Test Class for LoadBalancerListenerPolicyPrototype
+ Test Class for ReservedIPCollectionBareMetalServerNetworkInterfaceContextNext
"""
- def test_load_balancer_listener_policy_prototype_serialization(self):
+ def test_reserved_ip_collection_bare_metal_server_network_interface_context_next_serialization(self):
"""
- Test serialization/deserialization for LoadBalancerListenerPolicyPrototype
+ Test serialization/deserialization for ReservedIPCollectionBareMetalServerNetworkInterfaceContextNext
"""
- # 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_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 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 json representation of a ReservedIPCollectionBareMetalServerNetworkInterfaceContextNext model
+ reserved_ip_collection_bare_metal_server_network_interface_context_next_model_json = {}
+ reserved_ip_collection_bare_metal_server_network_interface_context_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e/ips?start=a404e343444b4e1095c9edba76672d67&limit=20'
- # Construct a model instance of 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 ReservedIPCollectionBareMetalServerNetworkInterfaceContextNext by calling from_dict on the json representation
+ reserved_ip_collection_bare_metal_server_network_interface_context_next_model = ReservedIPCollectionBareMetalServerNetworkInterfaceContextNext.from_dict(reserved_ip_collection_bare_metal_server_network_interface_context_next_model_json)
+ assert reserved_ip_collection_bare_metal_server_network_interface_context_next_model != False
- # Construct a model instance of 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 ReservedIPCollectionBareMetalServerNetworkInterfaceContextNext by calling from_dict on the json representation
+ reserved_ip_collection_bare_metal_server_network_interface_context_next_model_dict = ReservedIPCollectionBareMetalServerNetworkInterfaceContextNext.from_dict(reserved_ip_collection_bare_metal_server_network_interface_context_next_model_json).__dict__
+ reserved_ip_collection_bare_metal_server_network_interface_context_next_model2 = ReservedIPCollectionBareMetalServerNetworkInterfaceContextNext(**reserved_ip_collection_bare_metal_server_network_interface_context_next_model_dict)
# Verify the model instances are equivalent
- assert load_balancer_listener_policy_prototype_model == load_balancer_listener_policy_prototype_model2
+ assert reserved_ip_collection_bare_metal_server_network_interface_context_next_model == reserved_ip_collection_bare_metal_server_network_interface_context_next_model2
# Convert model instance back to dict and verify no loss of data
- 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
+ reserved_ip_collection_bare_metal_server_network_interface_context_next_model_json2 = reserved_ip_collection_bare_metal_server_network_interface_context_next_model.to_dict()
+ assert reserved_ip_collection_bare_metal_server_network_interface_context_next_model_json2 == reserved_ip_collection_bare_metal_server_network_interface_context_next_model_json
-class TestModel_LoadBalancerListenerPolicyReference:
+class TestModel_ReservedIPCollectionEndpointGatewayContext:
"""
- Test Class for LoadBalancerListenerPolicyReference
+ Test Class for ReservedIPCollectionEndpointGatewayContext
"""
- def test_load_balancer_listener_policy_reference_serialization(self):
+ def test_reserved_ip_collection_endpoint_gateway_context_serialization(self):
"""
- Test serialization/deserialization for LoadBalancerListenerPolicyReference
+ Test serialization/deserialization for ReservedIPCollectionEndpointGatewayContext
"""
# 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'
+ 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 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_listener_policy_reference_model_json['name'] = 'testString'
+ 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 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
+ reserved_ip_target_model = {} # ReservedIPTargetEndpointGatewayReference
+ reserved_ip_target_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5'
+ reserved_ip_target_model['deleted'] = endpoint_gateway_reference_deleted_model
+ reserved_ip_target_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5'
+ reserved_ip_target_model['id'] = 'r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5'
+ reserved_ip_target_model['name'] = 'my-endpoint-gateway'
+ reserved_ip_target_model['resource_type'] = 'endpoint_gateway'
+
+ reserved_ip_model = {} # ReservedIP
+ reserved_ip_model['address'] = '192.168.3.4'
+ reserved_ip_model['auto_delete'] = False
+ reserved_ip_model['created_at'] = '2019-01-01T12:00:00Z'
+ reserved_ip_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb'
+ reserved_ip_model['id'] = '6d353a0f-aeb1-4ae1-832e-1110d10981bb'
+ reserved_ip_model['lifecycle_state'] = 'stable'
+ reserved_ip_model['name'] = 'my-reserved-ip'
+ reserved_ip_model['owner'] = 'user'
+ reserved_ip_model['resource_type'] = 'subnet_reserved_ip'
+ reserved_ip_model['target'] = reserved_ip_target_model
+
+ reserved_ip_collection_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 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)
+ # 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 load_balancer_listener_policy_reference_model == load_balancer_listener_policy_reference_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
- 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
+ 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_LoadBalancerListenerPolicyReferenceDeleted:
+class TestModel_ReservedIPCollectionEndpointGatewayContextFirst:
"""
- Test Class for LoadBalancerListenerPolicyReferenceDeleted
+ Test Class for ReservedIPCollectionEndpointGatewayContextFirst
"""
- def test_load_balancer_listener_policy_reference_deleted_serialization(self):
+ def test_reserved_ip_collection_endpoint_gateway_context_first_serialization(self):
"""
- Test serialization/deserialization for LoadBalancerListenerPolicyReferenceDeleted
+ Test serialization/deserialization for ReservedIPCollectionEndpointGatewayContextFirst
"""
- # 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 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 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 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 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 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 load_balancer_listener_policy_reference_deleted_model == load_balancer_listener_policy_reference_deleted_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
- 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
+ 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_LoadBalancerListenerPolicyRule:
+class TestModel_ReservedIPCollectionEndpointGatewayContextNext:
"""
- Test Class for LoadBalancerListenerPolicyRule
+ Test Class for ReservedIPCollectionEndpointGatewayContextNext
"""
- def test_load_balancer_listener_policy_rule_serialization(self):
+ def test_reserved_ip_collection_endpoint_gateway_context_next_serialization(self):
"""
- Test serialization/deserialization for LoadBalancerListenerPolicyRule
+ Test serialization/deserialization for ReservedIPCollectionEndpointGatewayContextNext
"""
- # 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 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 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 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 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 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 load_balancer_listener_policy_rule_model == load_balancer_listener_policy_rule_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
- 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
+ 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_LoadBalancerListenerPolicyRuleCollection:
+class TestModel_ReservedIPCollectionFirst:
"""
- Test Class for LoadBalancerListenerPolicyRuleCollection
+ Test Class for ReservedIPCollectionFirst
"""
- def test_load_balancer_listener_policy_rule_collection_serialization(self):
+ def test_reserved_ip_collection_first_serialization(self):
"""
- Test serialization/deserialization for LoadBalancerListenerPolicyRuleCollection
+ Test serialization/deserialization for ReservedIPCollectionFirst
"""
- # Construct dict forms of any model objects needed in order to build this model.
-
- 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 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 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 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 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 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)
+ # 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 load_balancer_listener_policy_rule_collection_model == load_balancer_listener_policy_rule_collection_model2
+ assert reserved_ip_collection_first_model == reserved_ip_collection_first_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
+ 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_LoadBalancerListenerPolicyRulePatch:
+class TestModel_ReservedIPCollectionInstanceNetworkInterfaceContext:
"""
- Test Class for LoadBalancerListenerPolicyRulePatch
+ Test Class for ReservedIPCollectionInstanceNetworkInterfaceContext
"""
- def test_load_balancer_listener_policy_rule_patch_serialization(self):
+ def test_reserved_ip_collection_instance_network_interface_context_serialization(self):
"""
- Test serialization/deserialization for LoadBalancerListenerPolicyRulePatch
+ Test serialization/deserialization for ReservedIPCollectionInstanceNetworkInterfaceContext
"""
- # 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 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 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 dict forms of any model objects needed in order to build this model.
- # Verify the model instances are equivalent
- assert load_balancer_listener_policy_rule_patch_model == load_balancer_listener_policy_rule_patch_model2
+ reserved_ip_collection_instance_network_interface_context_first_model = {} # ReservedIPCollectionInstanceNetworkInterfaceContextFirst
+ reserved_ip_collection_instance_network_interface_context_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e/ips?limit=20'
- # 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
+ endpoint_gateway_reference_deleted_model = {} # EndpointGatewayReferenceDeleted
+ endpoint_gateway_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ reserved_ip_target_model = {} # ReservedIPTargetEndpointGatewayReference
+ reserved_ip_target_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5'
+ reserved_ip_target_model['deleted'] = endpoint_gateway_reference_deleted_model
+ reserved_ip_target_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5'
+ reserved_ip_target_model['id'] = 'r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5'
+ reserved_ip_target_model['name'] = 'my-endpoint-gateway'
+ reserved_ip_target_model['resource_type'] = 'endpoint_gateway'
-class TestModel_LoadBalancerListenerPolicyRulePrototype:
- """
- Test Class for LoadBalancerListenerPolicyRulePrototype
- """
+ reserved_ip_model = {} # ReservedIP
+ reserved_ip_model['address'] = '192.168.3.4'
+ reserved_ip_model['auto_delete'] = False
+ reserved_ip_model['created_at'] = '2019-01-01T12:00:00Z'
+ reserved_ip_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb'
+ reserved_ip_model['id'] = '6d353a0f-aeb1-4ae1-832e-1110d10981bb'
+ reserved_ip_model['lifecycle_state'] = 'stable'
+ reserved_ip_model['name'] = 'my-reserved-ip'
+ reserved_ip_model['owner'] = 'user'
+ reserved_ip_model['resource_type'] = 'subnet_reserved_ip'
+ reserved_ip_model['target'] = reserved_ip_target_model
- def test_load_balancer_listener_policy_rule_prototype_serialization(self):
- """
- Test serialization/deserialization for LoadBalancerListenerPolicyRulePrototype
- """
+ reserved_ip_collection_instance_network_interface_context_next_model = {} # ReservedIPCollectionInstanceNetworkInterfaceContextNext
+ reserved_ip_collection_instance_network_interface_context_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e/ips?start=a404e343444b4e1095c9edba76672d67&limit=20'
- # Construct a json representation of a 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 ReservedIPCollectionInstanceNetworkInterfaceContext model
+ reserved_ip_collection_instance_network_interface_context_model_json = {}
+ reserved_ip_collection_instance_network_interface_context_model_json['first'] = reserved_ip_collection_instance_network_interface_context_first_model
+ reserved_ip_collection_instance_network_interface_context_model_json['ips'] = [reserved_ip_model]
+ reserved_ip_collection_instance_network_interface_context_model_json['limit'] = 20
+ reserved_ip_collection_instance_network_interface_context_model_json['next'] = reserved_ip_collection_instance_network_interface_context_next_model
+ reserved_ip_collection_instance_network_interface_context_model_json['total_count'] = 132
- # Construct a model instance of 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 ReservedIPCollectionInstanceNetworkInterfaceContext by calling from_dict on the json representation
+ reserved_ip_collection_instance_network_interface_context_model = ReservedIPCollectionInstanceNetworkInterfaceContext.from_dict(reserved_ip_collection_instance_network_interface_context_model_json)
+ assert reserved_ip_collection_instance_network_interface_context_model != False
- # Construct a model instance of 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 ReservedIPCollectionInstanceNetworkInterfaceContext by calling from_dict on the json representation
+ reserved_ip_collection_instance_network_interface_context_model_dict = ReservedIPCollectionInstanceNetworkInterfaceContext.from_dict(reserved_ip_collection_instance_network_interface_context_model_json).__dict__
+ reserved_ip_collection_instance_network_interface_context_model2 = ReservedIPCollectionInstanceNetworkInterfaceContext(**reserved_ip_collection_instance_network_interface_context_model_dict)
# Verify the model instances are equivalent
- assert load_balancer_listener_policy_rule_prototype_model == load_balancer_listener_policy_rule_prototype_model2
+ assert reserved_ip_collection_instance_network_interface_context_model == reserved_ip_collection_instance_network_interface_context_model2
# Convert model instance back to dict and verify no loss of data
- 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
+ reserved_ip_collection_instance_network_interface_context_model_json2 = reserved_ip_collection_instance_network_interface_context_model.to_dict()
+ assert reserved_ip_collection_instance_network_interface_context_model_json2 == reserved_ip_collection_instance_network_interface_context_model_json
-class TestModel_LoadBalancerListenerPolicyRuleReference:
+class TestModel_ReservedIPCollectionInstanceNetworkInterfaceContextFirst:
"""
- Test Class for LoadBalancerListenerPolicyRuleReference
+ Test Class for ReservedIPCollectionInstanceNetworkInterfaceContextFirst
"""
- def test_load_balancer_listener_policy_rule_reference_serialization(self):
+ def test_reserved_ip_collection_instance_network_interface_context_first_serialization(self):
"""
- Test serialization/deserialization for LoadBalancerListenerPolicyRuleReference
+ Test serialization/deserialization for ReservedIPCollectionInstanceNetworkInterfaceContextFirst
"""
- # 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'
-
- # 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 json representation of a ReservedIPCollectionInstanceNetworkInterfaceContextFirst model
+ reserved_ip_collection_instance_network_interface_context_first_model_json = {}
+ reserved_ip_collection_instance_network_interface_context_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e/ips?limit=20'
- # Construct a model instance of 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 ReservedIPCollectionInstanceNetworkInterfaceContextFirst by calling from_dict on the json representation
+ reserved_ip_collection_instance_network_interface_context_first_model = ReservedIPCollectionInstanceNetworkInterfaceContextFirst.from_dict(reserved_ip_collection_instance_network_interface_context_first_model_json)
+ assert reserved_ip_collection_instance_network_interface_context_first_model != False
- # Construct a model instance of 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)
+ # Construct a model instance of ReservedIPCollectionInstanceNetworkInterfaceContextFirst by calling from_dict on the json representation
+ reserved_ip_collection_instance_network_interface_context_first_model_dict = ReservedIPCollectionInstanceNetworkInterfaceContextFirst.from_dict(reserved_ip_collection_instance_network_interface_context_first_model_json).__dict__
+ reserved_ip_collection_instance_network_interface_context_first_model2 = ReservedIPCollectionInstanceNetworkInterfaceContextFirst(**reserved_ip_collection_instance_network_interface_context_first_model_dict)
# Verify the model instances are equivalent
- assert load_balancer_listener_policy_rule_reference_model == load_balancer_listener_policy_rule_reference_model2
+ assert reserved_ip_collection_instance_network_interface_context_first_model == reserved_ip_collection_instance_network_interface_context_first_model2
# Convert model instance back to dict and verify no loss of data
- 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
+ reserved_ip_collection_instance_network_interface_context_first_model_json2 = reserved_ip_collection_instance_network_interface_context_first_model.to_dict()
+ assert reserved_ip_collection_instance_network_interface_context_first_model_json2 == reserved_ip_collection_instance_network_interface_context_first_model_json
-class TestModel_LoadBalancerListenerPolicyRuleReferenceDeleted:
+class TestModel_ReservedIPCollectionInstanceNetworkInterfaceContextNext:
"""
- Test Class for LoadBalancerListenerPolicyRuleReferenceDeleted
+ Test Class for ReservedIPCollectionInstanceNetworkInterfaceContextNext
"""
- def test_load_balancer_listener_policy_rule_reference_deleted_serialization(self):
+ def test_reserved_ip_collection_instance_network_interface_context_next_serialization(self):
"""
- Test serialization/deserialization for LoadBalancerListenerPolicyRuleReferenceDeleted
+ Test serialization/deserialization for ReservedIPCollectionInstanceNetworkInterfaceContextNext
"""
- # 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 ReservedIPCollectionInstanceNetworkInterfaceContextNext model
+ reserved_ip_collection_instance_network_interface_context_next_model_json = {}
+ reserved_ip_collection_instance_network_interface_context_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e/ips?start=a404e343444b4e1095c9edba76672d67&limit=20'
- # Construct a model instance of 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 ReservedIPCollectionInstanceNetworkInterfaceContextNext by calling from_dict on the json representation
+ reserved_ip_collection_instance_network_interface_context_next_model = ReservedIPCollectionInstanceNetworkInterfaceContextNext.from_dict(reserved_ip_collection_instance_network_interface_context_next_model_json)
+ assert reserved_ip_collection_instance_network_interface_context_next_model != False
- # Construct a model instance of 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 ReservedIPCollectionInstanceNetworkInterfaceContextNext by calling from_dict on the json representation
+ reserved_ip_collection_instance_network_interface_context_next_model_dict = ReservedIPCollectionInstanceNetworkInterfaceContextNext.from_dict(reserved_ip_collection_instance_network_interface_context_next_model_json).__dict__
+ reserved_ip_collection_instance_network_interface_context_next_model2 = ReservedIPCollectionInstanceNetworkInterfaceContextNext(**reserved_ip_collection_instance_network_interface_context_next_model_dict)
# Verify the model instances are equivalent
- assert load_balancer_listener_policy_rule_reference_deleted_model == load_balancer_listener_policy_rule_reference_deleted_model2
+ assert reserved_ip_collection_instance_network_interface_context_next_model == reserved_ip_collection_instance_network_interface_context_next_model2
# Convert model instance back to dict and verify no loss of data
- 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
+ reserved_ip_collection_instance_network_interface_context_next_model_json2 = reserved_ip_collection_instance_network_interface_context_next_model.to_dict()
+ assert reserved_ip_collection_instance_network_interface_context_next_model_json2 == reserved_ip_collection_instance_network_interface_context_next_model_json
-class TestModel_LoadBalancerListenerPrototypeLoadBalancerContext:
+class TestModel_ReservedIPCollectionNext:
"""
- Test Class for LoadBalancerListenerPrototypeLoadBalancerContext
+ Test Class for ReservedIPCollectionNext
"""
- def test_load_balancer_listener_prototype_load_balancer_context_serialization(self):
+ def test_reserved_ip_collection_next_serialization(self):
"""
- Test serialization/deserialization for LoadBalancerListenerPrototypeLoadBalancerContext
+ Test serialization/deserialization for ReservedIPCollectionNext
"""
- # Construct dict forms of any model objects needed in order to build this model.
-
- certificate_instance_identity_model = {} # CertificateInstanceIdentityByCRN
- certificate_instance_identity_model['crn'] = 'crn:v1:bluemix:public:secrets-manager:us-south:a/123456:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5'
-
- load_balancer_pool_identity_by_name_model = {} # LoadBalancerPoolIdentityByName
- load_balancer_pool_identity_by_name_model['name'] = 'my-load-balancer-pool'
-
- load_balancer_listener_identity_model = {} # LoadBalancerListenerIdentityById
- load_balancer_listener_identity_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004'
-
- load_balancer_listener_https_redirect_prototype_model = {} # LoadBalancerListenerHTTPSRedirectPrototype
- load_balancer_listener_https_redirect_prototype_model['http_status_code'] = 301
- load_balancer_listener_https_redirect_prototype_model['listener'] = load_balancer_listener_identity_model
- load_balancer_listener_https_redirect_prototype_model['uri'] = '/example?doc=get'
-
- # Construct a json representation of a LoadBalancerListenerPrototypeLoadBalancerContext model
- load_balancer_listener_prototype_load_balancer_context_model_json = {}
- load_balancer_listener_prototype_load_balancer_context_model_json['accept_proxy_protocol'] = True
- load_balancer_listener_prototype_load_balancer_context_model_json['certificate_instance'] = certificate_instance_identity_model
- load_balancer_listener_prototype_load_balancer_context_model_json['connection_limit'] = 2000
- load_balancer_listener_prototype_load_balancer_context_model_json['default_pool'] = load_balancer_pool_identity_by_name_model
- load_balancer_listener_prototype_load_balancer_context_model_json['https_redirect'] = load_balancer_listener_https_redirect_prototype_model
- load_balancer_listener_prototype_load_balancer_context_model_json['idle_connection_timeout'] = 100
- 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 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 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 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 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)
+ # 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 load_balancer_listener_prototype_load_balancer_context_model == load_balancer_listener_prototype_load_balancer_context_model2
+ assert reserved_ip_collection_next_model == reserved_ip_collection_next_model2
# 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
+ 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_LoadBalancerListenerReference:
+class TestModel_ReservedIPCollectionVirtualNetworkInterfaceContext:
"""
- Test Class for LoadBalancerListenerReference
+ Test Class for ReservedIPCollectionVirtualNetworkInterfaceContext
"""
- def test_load_balancer_listener_reference_serialization(self):
+ def test_reserved_ip_collection_virtual_network_interface_context_serialization(self):
"""
- Test serialization/deserialization for LoadBalancerListenerReference
+ Test serialization/deserialization for ReservedIPCollectionVirtualNetworkInterfaceContext
"""
# 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'
-
- # 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 load_balancer_listener_reference_model == load_balancer_listener_reference_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
+ reserved_ip_collection_virtual_network_interface_context_first_model = {} # ReservedIPCollectionVirtualNetworkInterfaceContextFirst
+ reserved_ip_collection_virtual_network_interface_context_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e/ips?limit=20'
+ reserved_ip_reference_deleted_model = {} # ReservedIPReferenceDeleted
+ reserved_ip_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
-class TestModel_LoadBalancerListenerReferenceDeleted:
- """
- Test Class for LoadBalancerListenerReferenceDeleted
- """
+ 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'
- def test_load_balancer_listener_reference_deleted_serialization(self):
- """
- Test serialization/deserialization for LoadBalancerListenerReferenceDeleted
- """
+ reserved_ip_collection_virtual_network_interface_context_next_model = {} # ReservedIPCollectionVirtualNetworkInterfaceContextNext
+ reserved_ip_collection_virtual_network_interface_context_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e/ips?start=a404e343444b4e1095c9edba76672d67&limit=20'
- # Construct a json representation of a 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 ReservedIPCollectionVirtualNetworkInterfaceContext model
+ reserved_ip_collection_virtual_network_interface_context_model_json = {}
+ reserved_ip_collection_virtual_network_interface_context_model_json['first'] = reserved_ip_collection_virtual_network_interface_context_first_model
+ reserved_ip_collection_virtual_network_interface_context_model_json['ips'] = [reserved_ip_reference_model]
+ reserved_ip_collection_virtual_network_interface_context_model_json['limit'] = 20
+ reserved_ip_collection_virtual_network_interface_context_model_json['next'] = reserved_ip_collection_virtual_network_interface_context_next_model
+ reserved_ip_collection_virtual_network_interface_context_model_json['total_count'] = 132
- # 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 ReservedIPCollectionVirtualNetworkInterfaceContext by calling from_dict on the json representation
+ reserved_ip_collection_virtual_network_interface_context_model = ReservedIPCollectionVirtualNetworkInterfaceContext.from_dict(reserved_ip_collection_virtual_network_interface_context_model_json)
+ assert reserved_ip_collection_virtual_network_interface_context_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 ReservedIPCollectionVirtualNetworkInterfaceContext by calling from_dict on the json representation
+ reserved_ip_collection_virtual_network_interface_context_model_dict = ReservedIPCollectionVirtualNetworkInterfaceContext.from_dict(reserved_ip_collection_virtual_network_interface_context_model_json).__dict__
+ reserved_ip_collection_virtual_network_interface_context_model2 = ReservedIPCollectionVirtualNetworkInterfaceContext(**reserved_ip_collection_virtual_network_interface_context_model_dict)
# Verify the model instances are equivalent
- assert load_balancer_listener_reference_deleted_model == load_balancer_listener_reference_deleted_model2
+ assert reserved_ip_collection_virtual_network_interface_context_model == reserved_ip_collection_virtual_network_interface_context_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
+ reserved_ip_collection_virtual_network_interface_context_model_json2 = reserved_ip_collection_virtual_network_interface_context_model.to_dict()
+ assert reserved_ip_collection_virtual_network_interface_context_model_json2 == reserved_ip_collection_virtual_network_interface_context_model_json
-class TestModel_LoadBalancerLogging:
+class TestModel_ReservedIPCollectionVirtualNetworkInterfaceContextFirst:
"""
- Test Class for LoadBalancerLogging
+ Test Class for ReservedIPCollectionVirtualNetworkInterfaceContextFirst
"""
- def test_load_balancer_logging_serialization(self):
+ def test_reserved_ip_collection_virtual_network_interface_context_first_serialization(self):
"""
- Test serialization/deserialization for LoadBalancerLogging
+ Test serialization/deserialization for ReservedIPCollectionVirtualNetworkInterfaceContextFirst
"""
- # 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 ReservedIPCollectionVirtualNetworkInterfaceContextFirst model
+ reserved_ip_collection_virtual_network_interface_context_first_model_json = {}
+ reserved_ip_collection_virtual_network_interface_context_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e/ips?limit=20'
- # Construct a model instance of 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 ReservedIPCollectionVirtualNetworkInterfaceContextFirst by calling from_dict on the json representation
+ reserved_ip_collection_virtual_network_interface_context_first_model = ReservedIPCollectionVirtualNetworkInterfaceContextFirst.from_dict(reserved_ip_collection_virtual_network_interface_context_first_model_json)
+ assert reserved_ip_collection_virtual_network_interface_context_first_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 ReservedIPCollectionVirtualNetworkInterfaceContextFirst by calling from_dict on the json representation
+ reserved_ip_collection_virtual_network_interface_context_first_model_dict = ReservedIPCollectionVirtualNetworkInterfaceContextFirst.from_dict(reserved_ip_collection_virtual_network_interface_context_first_model_json).__dict__
+ reserved_ip_collection_virtual_network_interface_context_first_model2 = ReservedIPCollectionVirtualNetworkInterfaceContextFirst(**reserved_ip_collection_virtual_network_interface_context_first_model_dict)
# Verify the model instances are equivalent
- assert load_balancer_logging_model == load_balancer_logging_model2
+ assert reserved_ip_collection_virtual_network_interface_context_first_model == reserved_ip_collection_virtual_network_interface_context_first_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
+ reserved_ip_collection_virtual_network_interface_context_first_model_json2 = reserved_ip_collection_virtual_network_interface_context_first_model.to_dict()
+ assert reserved_ip_collection_virtual_network_interface_context_first_model_json2 == reserved_ip_collection_virtual_network_interface_context_first_model_json
-class TestModel_LoadBalancerLoggingDatapath:
+class TestModel_ReservedIPCollectionVirtualNetworkInterfaceContextNext:
"""
- Test Class for LoadBalancerLoggingDatapath
+ Test Class for ReservedIPCollectionVirtualNetworkInterfaceContextNext
"""
- def test_load_balancer_logging_datapath_serialization(self):
+ def test_reserved_ip_collection_virtual_network_interface_context_next_serialization(self):
"""
- Test serialization/deserialization for LoadBalancerLoggingDatapath
+ Test serialization/deserialization for ReservedIPCollectionVirtualNetworkInterfaceContextNext
"""
- # 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 ReservedIPCollectionVirtualNetworkInterfaceContextNext model
+ reserved_ip_collection_virtual_network_interface_context_next_model_json = {}
+ reserved_ip_collection_virtual_network_interface_context_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e/ips?start=a404e343444b4e1095c9edba76672d67&limit=20'
- # Construct a model instance of 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 ReservedIPCollectionVirtualNetworkInterfaceContextNext by calling from_dict on the json representation
+ reserved_ip_collection_virtual_network_interface_context_next_model = ReservedIPCollectionVirtualNetworkInterfaceContextNext.from_dict(reserved_ip_collection_virtual_network_interface_context_next_model_json)
+ assert reserved_ip_collection_virtual_network_interface_context_next_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 ReservedIPCollectionVirtualNetworkInterfaceContextNext by calling from_dict on the json representation
+ reserved_ip_collection_virtual_network_interface_context_next_model_dict = ReservedIPCollectionVirtualNetworkInterfaceContextNext.from_dict(reserved_ip_collection_virtual_network_interface_context_next_model_json).__dict__
+ reserved_ip_collection_virtual_network_interface_context_next_model2 = ReservedIPCollectionVirtualNetworkInterfaceContextNext(**reserved_ip_collection_virtual_network_interface_context_next_model_dict)
# Verify the model instances are equivalent
- assert load_balancer_logging_datapath_model == load_balancer_logging_datapath_model2
+ assert reserved_ip_collection_virtual_network_interface_context_next_model == reserved_ip_collection_virtual_network_interface_context_next_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
+ reserved_ip_collection_virtual_network_interface_context_next_model_json2 = reserved_ip_collection_virtual_network_interface_context_next_model.to_dict()
+ assert reserved_ip_collection_virtual_network_interface_context_next_model_json2 == reserved_ip_collection_virtual_network_interface_context_next_model_json
-class TestModel_LoadBalancerLoggingDatapathPatch:
+class TestModel_ReservedIPPatch:
"""
- Test Class for LoadBalancerLoggingDatapathPatch
+ Test Class for ReservedIPPatch
"""
- def test_load_balancer_logging_datapath_patch_serialization(self):
+ def test_reserved_ip_patch_serialization(self):
"""
- Test serialization/deserialization for LoadBalancerLoggingDatapathPatch
+ Test serialization/deserialization for ReservedIPPatch
"""
- # Construct a json representation of a LoadBalancerLoggingDatapathPatch model
- load_balancer_logging_datapath_patch_model_json = {}
- load_balancer_logging_datapath_patch_model_json['active'] = True
+ # 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 LoadBalancerLoggingDatapathPatch by calling from_dict on the json representation
- load_balancer_logging_datapath_patch_model = LoadBalancerLoggingDatapathPatch.from_dict(load_balancer_logging_datapath_patch_model_json)
- assert load_balancer_logging_datapath_patch_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 LoadBalancerLoggingDatapathPatch by calling from_dict on the json representation
- load_balancer_logging_datapath_patch_model_dict = LoadBalancerLoggingDatapathPatch.from_dict(load_balancer_logging_datapath_patch_model_json).__dict__
- load_balancer_logging_datapath_patch_model2 = LoadBalancerLoggingDatapathPatch(**load_balancer_logging_datapath_patch_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 load_balancer_logging_datapath_patch_model == load_balancer_logging_datapath_patch_model2
+ assert reserved_ip_patch_model == reserved_ip_patch_model2
# Convert model instance back to dict and verify no loss of data
- load_balancer_logging_datapath_patch_model_json2 = load_balancer_logging_datapath_patch_model.to_dict()
- assert load_balancer_logging_datapath_patch_model_json2 == load_balancer_logging_datapath_patch_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_LoadBalancerLoggingDatapathPrototype:
+class TestModel_ReservedIPReference:
"""
- Test Class for LoadBalancerLoggingDatapathPrototype
+ Test Class for ReservedIPReference
"""
- def test_load_balancer_logging_datapath_prototype_serialization(self):
+ def test_reserved_ip_reference_serialization(self):
"""
- Test serialization/deserialization for LoadBalancerLoggingDatapathPrototype
+ Test serialization/deserialization for ReservedIPReference
"""
- # Construct a json representation of a LoadBalancerLoggingDatapathPrototype model
- load_balancer_logging_datapath_prototype_model_json = {}
- load_balancer_logging_datapath_prototype_model_json['active'] = True
+ # Construct dict forms of any model objects needed in order to build this model.
- # Construct a model instance of LoadBalancerLoggingDatapathPrototype by calling from_dict on the json representation
- load_balancer_logging_datapath_prototype_model = LoadBalancerLoggingDatapathPrototype.from_dict(load_balancer_logging_datapath_prototype_model_json)
- assert load_balancer_logging_datapath_prototype_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 LoadBalancerLoggingDatapathPrototype by calling from_dict on the json representation
- load_balancer_logging_datapath_prototype_model_dict = LoadBalancerLoggingDatapathPrototype.from_dict(load_balancer_logging_datapath_prototype_model_json).__dict__
- load_balancer_logging_datapath_prototype_model2 = LoadBalancerLoggingDatapathPrototype(**load_balancer_logging_datapath_prototype_model_dict)
+ # 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'
+
+ # 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
+
+ # 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)
# Verify the model instances are equivalent
- assert load_balancer_logging_datapath_prototype_model == load_balancer_logging_datapath_prototype_model2
+ assert reserved_ip_reference_model == reserved_ip_reference_model2
# Convert model instance back to dict and verify no loss of data
- load_balancer_logging_datapath_prototype_model_json2 = load_balancer_logging_datapath_prototype_model.to_dict()
- assert load_balancer_logging_datapath_prototype_model_json2 == load_balancer_logging_datapath_prototype_model_json
+ reserved_ip_reference_model_json2 = reserved_ip_reference_model.to_dict()
+ assert reserved_ip_reference_model_json2 == reserved_ip_reference_model_json
-class TestModel_LoadBalancerLoggingPatch:
+class TestModel_ReservedIPReferenceDeleted:
"""
- Test Class for LoadBalancerLoggingPatch
+ Test Class for ReservedIPReferenceDeleted
"""
- def test_load_balancer_logging_patch_serialization(self):
+ def test_reserved_ip_reference_deleted_serialization(self):
"""
- Test serialization/deserialization for LoadBalancerLoggingPatch
+ Test serialization/deserialization for ReservedIPReferenceDeleted
"""
- # Construct dict forms of any model objects needed in order to build this model.
-
- load_balancer_logging_datapath_patch_model = {} # LoadBalancerLoggingDatapathPatch
- load_balancer_logging_datapath_patch_model['active'] = True
-
- # Construct a json representation of a LoadBalancerLoggingPatch model
- load_balancer_logging_patch_model_json = {}
- load_balancer_logging_patch_model_json['datapath'] = load_balancer_logging_datapath_patch_model
+ # 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 LoadBalancerLoggingPatch by calling from_dict on the json representation
- load_balancer_logging_patch_model = LoadBalancerLoggingPatch.from_dict(load_balancer_logging_patch_model_json)
- assert load_balancer_logging_patch_model != False
+ # 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 LoadBalancerLoggingPatch by calling from_dict on the json representation
- load_balancer_logging_patch_model_dict = LoadBalancerLoggingPatch.from_dict(load_balancer_logging_patch_model_json).__dict__
- load_balancer_logging_patch_model2 = LoadBalancerLoggingPatch(**load_balancer_logging_patch_model_dict)
+ # 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 load_balancer_logging_patch_model == load_balancer_logging_patch_model2
+ assert reserved_ip_reference_deleted_model == reserved_ip_reference_deleted_model2
# Convert model instance back to dict and verify no loss of data
- load_balancer_logging_patch_model_json2 = load_balancer_logging_patch_model.to_dict()
- assert load_balancer_logging_patch_model_json2 == load_balancer_logging_patch_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_LoadBalancerLoggingPrototype:
+class TestModel_ResourceFilter:
"""
- Test Class for LoadBalancerLoggingPrototype
+ Test Class for ResourceFilter
"""
- def test_load_balancer_logging_prototype_serialization(self):
+ def test_resource_filter_serialization(self):
"""
- Test serialization/deserialization for LoadBalancerLoggingPrototype
+ Test serialization/deserialization for ResourceFilter
"""
- # Construct dict forms of any model objects needed in order to build this model.
-
- load_balancer_logging_datapath_prototype_model = {} # LoadBalancerLoggingDatapathPrototype
- load_balancer_logging_datapath_prototype_model['active'] = True
-
- # Construct a json representation of a LoadBalancerLoggingPrototype model
- load_balancer_logging_prototype_model_json = {}
- load_balancer_logging_prototype_model_json['datapath'] = load_balancer_logging_datapath_prototype_model
+ # Construct a json representation of a ResourceFilter model
+ resource_filter_model_json = {}
+ resource_filter_model_json['resource_type'] = 'vpn_gateway'
- # Construct a model instance of LoadBalancerLoggingPrototype by calling from_dict on the json representation
- load_balancer_logging_prototype_model = LoadBalancerLoggingPrototype.from_dict(load_balancer_logging_prototype_model_json)
- assert load_balancer_logging_prototype_model != False
+ # Construct a model instance of ResourceFilter by calling from_dict on the json representation
+ resource_filter_model = ResourceFilter.from_dict(resource_filter_model_json)
+ assert resource_filter_model != False
- # Construct a model instance of LoadBalancerLoggingPrototype by calling from_dict on the json representation
- load_balancer_logging_prototype_model_dict = LoadBalancerLoggingPrototype.from_dict(load_balancer_logging_prototype_model_json).__dict__
- load_balancer_logging_prototype_model2 = LoadBalancerLoggingPrototype(**load_balancer_logging_prototype_model_dict)
+ # Construct a model instance of ResourceFilter by calling from_dict on the json representation
+ resource_filter_model_dict = ResourceFilter.from_dict(resource_filter_model_json).__dict__
+ resource_filter_model2 = ResourceFilter(**resource_filter_model_dict)
# Verify the model instances are equivalent
- assert load_balancer_logging_prototype_model == load_balancer_logging_prototype_model2
+ assert resource_filter_model == resource_filter_model2
# Convert model instance back to dict and verify no loss of data
- load_balancer_logging_prototype_model_json2 = load_balancer_logging_prototype_model.to_dict()
- assert load_balancer_logging_prototype_model_json2 == load_balancer_logging_prototype_model_json
+ resource_filter_model_json2 = resource_filter_model.to_dict()
+ assert resource_filter_model_json2 == resource_filter_model_json
-class TestModel_LoadBalancerPatch:
+class TestModel_ResourceGroupReference:
"""
- Test Class for LoadBalancerPatch
+ Test Class for ResourceGroupReference
"""
- def test_load_balancer_patch_serialization(self):
+ def test_resource_group_reference_serialization(self):
"""
- Test serialization/deserialization for LoadBalancerPatch
+ Test serialization/deserialization for ResourceGroupReference
"""
- # Construct dict forms of any model objects needed in order to build this model.
-
- dns_instance_identity_model = {} # DNSInstanceIdentityByCRN
- dns_instance_identity_model['crn'] = 'crn:v1:bluemix:public:dns-svcs:global:a/123456:6860c359-b2e2-46fa-a944-b38c28201c6e'
-
- dns_zone_identity_model = {} # DNSZoneIdentityById
- dns_zone_identity_model['id'] = 'd66662cc-aa23-4fe1-9987-858487a61f45'
-
- load_balancer_dns_patch_model = {} # LoadBalancerDNSPatch
- load_balancer_dns_patch_model['instance'] = dns_instance_identity_model
- load_balancer_dns_patch_model['zone'] = dns_zone_identity_model
-
- load_balancer_logging_datapath_patch_model = {} # LoadBalancerLoggingDatapathPatch
- load_balancer_logging_datapath_patch_model['active'] = True
-
- load_balancer_logging_patch_model = {} # LoadBalancerLoggingPatch
- load_balancer_logging_patch_model['datapath'] = load_balancer_logging_datapath_patch_model
-
- subnet_identity_model = {} # SubnetIdentityById
- subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
-
- # Construct a json representation of a LoadBalancerPatch model
- load_balancer_patch_model_json = {}
- load_balancer_patch_model_json['dns'] = load_balancer_dns_patch_model
- load_balancer_patch_model_json['logging'] = load_balancer_logging_patch_model
- load_balancer_patch_model_json['name'] = 'my-load-balancer'
- load_balancer_patch_model_json['subnets'] = [subnet_identity_model]
+ # 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 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 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 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 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 load_balancer_patch_model == load_balancer_patch_model2
+ assert resource_group_reference_model == resource_group_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
+ resource_group_reference_model_json2 = resource_group_reference_model.to_dict()
+ assert resource_group_reference_model_json2 == resource_group_reference_model_json
-class TestModel_LoadBalancerPool:
+class TestModel_Route:
"""
- Test Class for LoadBalancerPool
+ Test Class for Route
"""
- def test_load_balancer_pool_serialization(self):
+ def test_route_serialization(self):
"""
- Test serialization/deserialization for LoadBalancerPool
+ Test serialization/deserialization for Route
"""
# 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'
+ route_next_hop_model = {} # RouteNextHopIP
+ route_next_hop_model['address'] = '192.168.3.4'
- 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'
+ 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 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 json representation of a Route model
+ route_model_json = {}
+ route_model_json['action'] = 'delegate'
+ route_model_json['advertise'] = True
+ 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/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840/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['priority'] = 1
+ route_model_json['zone'] = zone_reference_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 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 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 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 load_balancer_pool_model == load_balancer_pool_model2
+ assert route_model == route_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
+ route_model_json2 = route_model.to_dict()
+ assert route_model_json2 == route_model_json
-class TestModel_LoadBalancerPoolCollection:
+class TestModel_RouteCollection:
"""
- Test Class for LoadBalancerPoolCollection
+ Test Class for RouteCollection
"""
- def test_load_balancer_pool_collection_serialization(self):
+ def test_route_collection_serialization(self):
"""
- Test serialization/deserialization for LoadBalancerPoolCollection
+ Test serialization/deserialization for RouteCollection
"""
# 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'
+ 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'
- 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'
+ 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'
- 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'
+ route_next_hop_model = {} # RouteNextHopIP
+ route_next_hop_model['address'] = '192.168.3.4'
- 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'
+ 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'
- 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
+ route_model = {} # Route
+ route_model['action'] = 'delegate'
+ route_model['advertise'] = True
+ 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/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840/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['priority'] = 1
+ route_model['zone'] = zone_reference_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 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 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 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 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 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 load_balancer_pool_collection_model == load_balancer_pool_collection_model2
+ assert route_collection_model == route_collection_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
+ route_collection_model_json2 = route_collection_model.to_dict()
+ assert route_collection_model_json2 == route_collection_model_json
-class TestModel_LoadBalancerPoolHealthMonitor:
+class TestModel_RouteCollectionFirst:
"""
- Test Class for LoadBalancerPoolHealthMonitor
+ Test Class for RouteCollectionFirst
"""
- def test_load_balancer_pool_health_monitor_serialization(self):
+ def test_route_collection_first_serialization(self):
"""
- Test serialization/deserialization for LoadBalancerPoolHealthMonitor
+ Test serialization/deserialization for RouteCollectionFirst
"""
- # 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 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 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 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 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 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 load_balancer_pool_health_monitor_model == load_balancer_pool_health_monitor_model2
+ assert route_collection_first_model == route_collection_first_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
+ route_collection_first_model_json2 = route_collection_first_model.to_dict()
+ assert route_collection_first_model_json2 == route_collection_first_model_json
-class TestModel_LoadBalancerPoolHealthMonitorPatch:
+class TestModel_RouteCollectionNext:
"""
- Test Class for LoadBalancerPoolHealthMonitorPatch
+ Test Class for RouteCollectionNext
"""
- def test_load_balancer_pool_health_monitor_patch_serialization(self):
+ def test_route_collection_next_serialization(self):
"""
- Test serialization/deserialization for LoadBalancerPoolHealthMonitorPatch
+ Test serialization/deserialization for RouteCollectionNext
"""
- # 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 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 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 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 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 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 load_balancer_pool_health_monitor_patch_model == load_balancer_pool_health_monitor_patch_model2
+ assert route_collection_next_model == route_collection_next_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
+ route_collection_next_model_json2 = route_collection_next_model.to_dict()
+ assert route_collection_next_model_json2 == route_collection_next_model_json
-class TestModel_LoadBalancerPoolHealthMonitorPrototype:
+class TestModel_RouteCollectionVPCContext:
"""
- Test Class for LoadBalancerPoolHealthMonitorPrototype
+ Test Class for RouteCollectionVPCContext
"""
- def test_load_balancer_pool_health_monitor_prototype_serialization(self):
+ def test_route_collection_vpc_context_serialization(self):
"""
- Test serialization/deserialization for LoadBalancerPoolHealthMonitorPrototype
+ Test serialization/deserialization for RouteCollectionVPCContext
"""
- # 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 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 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 dict forms of any model objects needed in order to build this model.
- # Verify the model instances are equivalent
- assert load_balancer_pool_health_monitor_prototype_model == load_balancer_pool_health_monitor_prototype_model2
+ route_collection_vpc_context_first_model = {} # RouteCollectionVPCContextFirst
+ route_collection_vpc_context_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'
- # 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
+ route_collection_vpc_context_next_model = {} # RouteCollectionVPCContextNext
+ route_collection_vpc_context_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'
+ route_next_hop_model = {} # RouteNextHopIP
+ route_next_hop_model['address'] = '192.168.3.4'
-class TestModel_LoadBalancerPoolIdentityByName:
- """
- Test Class for LoadBalancerPoolIdentityByName
- """
+ 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_load_balancer_pool_identity_by_name_serialization(self):
- """
- Test serialization/deserialization for LoadBalancerPoolIdentityByName
- """
+ route_collection_vpc_context_routes_item_model = {} # RouteCollectionVPCContextRoutesItem
+ route_collection_vpc_context_routes_item_model['action'] = 'delegate'
+ route_collection_vpc_context_routes_item_model['advertise'] = True
+ route_collection_vpc_context_routes_item_model['created_at'] = '2019-01-01T12:00:00Z'
+ route_collection_vpc_context_routes_item_model['destination'] = '192.168.3.0/24'
+ route_collection_vpc_context_routes_item_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531'
+ route_collection_vpc_context_routes_item_model['id'] = '1a15dca5-7e33-45e1-b7c5-bc690e569531'
+ route_collection_vpc_context_routes_item_model['lifecycle_state'] = 'stable'
+ route_collection_vpc_context_routes_item_model['name'] = 'my-route-1'
+ route_collection_vpc_context_routes_item_model['next_hop'] = route_next_hop_model
+ route_collection_vpc_context_routes_item_model['priority'] = 1
+ route_collection_vpc_context_routes_item_model['zone'] = zone_reference_model
- # 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 RouteCollectionVPCContext model
+ route_collection_vpc_context_model_json = {}
+ route_collection_vpc_context_model_json['first'] = route_collection_vpc_context_first_model
+ route_collection_vpc_context_model_json['limit'] = 20
+ route_collection_vpc_context_model_json['next'] = route_collection_vpc_context_next_model
+ route_collection_vpc_context_model_json['routes'] = [route_collection_vpc_context_routes_item_model]
+ route_collection_vpc_context_model_json['total_count'] = 132
- # 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 RouteCollectionVPCContext by calling from_dict on the json representation
+ route_collection_vpc_context_model = RouteCollectionVPCContext.from_dict(route_collection_vpc_context_model_json)
+ assert route_collection_vpc_context_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 RouteCollectionVPCContext by calling from_dict on the json representation
+ route_collection_vpc_context_model_dict = RouteCollectionVPCContext.from_dict(route_collection_vpc_context_model_json).__dict__
+ route_collection_vpc_context_model2 = RouteCollectionVPCContext(**route_collection_vpc_context_model_dict)
# Verify the model instances are equivalent
- assert load_balancer_pool_identity_by_name_model == load_balancer_pool_identity_by_name_model2
+ assert route_collection_vpc_context_model == route_collection_vpc_context_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
+ route_collection_vpc_context_model_json2 = route_collection_vpc_context_model.to_dict()
+ assert route_collection_vpc_context_model_json2 == route_collection_vpc_context_model_json
-class TestModel_LoadBalancerPoolMember:
+class TestModel_RouteCollectionVPCContextFirst:
"""
- Test Class for LoadBalancerPoolMember
+ Test Class for RouteCollectionVPCContextFirst
"""
- def test_load_balancer_pool_member_serialization(self):
+ def test_route_collection_vpc_context_first_serialization(self):
"""
- Test serialization/deserialization for LoadBalancerPoolMember
+ Test serialization/deserialization for RouteCollectionVPCContextFirst
"""
- # 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'
-
- 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'
-
- # 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
+ # Construct a json representation of a RouteCollectionVPCContextFirst model
+ route_collection_vpc_context_first_model_json = {}
+ route_collection_vpc_context_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 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
+ # Construct a model instance of RouteCollectionVPCContextFirst by calling from_dict on the json representation
+ route_collection_vpc_context_first_model = RouteCollectionVPCContextFirst.from_dict(route_collection_vpc_context_first_model_json)
+ assert route_collection_vpc_context_first_model != False
- # 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)
+ # Construct a model instance of RouteCollectionVPCContextFirst by calling from_dict on the json representation
+ route_collection_vpc_context_first_model_dict = RouteCollectionVPCContextFirst.from_dict(route_collection_vpc_context_first_model_json).__dict__
+ route_collection_vpc_context_first_model2 = RouteCollectionVPCContextFirst(**route_collection_vpc_context_first_model_dict)
# Verify the model instances are equivalent
- assert load_balancer_pool_member_model == load_balancer_pool_member_model2
+ assert route_collection_vpc_context_first_model == route_collection_vpc_context_first_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
+ route_collection_vpc_context_first_model_json2 = route_collection_vpc_context_first_model.to_dict()
+ assert route_collection_vpc_context_first_model_json2 == route_collection_vpc_context_first_model_json
-class TestModel_LoadBalancerPoolMemberCollection:
+class TestModel_RouteCollectionVPCContextNext:
"""
- Test Class for LoadBalancerPoolMemberCollection
+ Test Class for RouteCollectionVPCContextNext
"""
- def test_load_balancer_pool_member_collection_serialization(self):
+ def test_route_collection_vpc_context_next_serialization(self):
"""
- Test serialization/deserialization for LoadBalancerPoolMemberCollection
+ Test serialization/deserialization for RouteCollectionVPCContextNext
"""
- # 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'
-
- 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 json representation of a RouteCollectionVPCContextNext model
+ route_collection_vpc_context_next_model_json = {}
+ route_collection_vpc_context_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 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 RouteCollectionVPCContextNext by calling from_dict on the json representation
+ route_collection_vpc_context_next_model = RouteCollectionVPCContextNext.from_dict(route_collection_vpc_context_next_model_json)
+ assert route_collection_vpc_context_next_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 RouteCollectionVPCContextNext by calling from_dict on the json representation
+ route_collection_vpc_context_next_model_dict = RouteCollectionVPCContextNext.from_dict(route_collection_vpc_context_next_model_json).__dict__
+ route_collection_vpc_context_next_model2 = RouteCollectionVPCContextNext(**route_collection_vpc_context_next_model_dict)
# Verify the model instances are equivalent
- assert load_balancer_pool_member_collection_model == load_balancer_pool_member_collection_model2
+ assert route_collection_vpc_context_next_model == route_collection_vpc_context_next_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
+ route_collection_vpc_context_next_model_json2 = route_collection_vpc_context_next_model.to_dict()
+ assert route_collection_vpc_context_next_model_json2 == route_collection_vpc_context_next_model_json
-class TestModel_LoadBalancerPoolMemberPatch:
+class TestModel_RouteCollectionVPCContextRoutesItem:
"""
- Test Class for LoadBalancerPoolMemberPatch
+ Test Class for RouteCollectionVPCContextRoutesItem
"""
- def test_load_balancer_pool_member_patch_serialization(self):
+ def test_route_collection_vpc_context_routes_item_serialization(self):
"""
- Test serialization/deserialization for LoadBalancerPoolMemberPatch
+ Test serialization/deserialization for RouteCollectionVPCContextRoutesItem
"""
# 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'
+ route_next_hop_model = {} # RouteNextHopIP
+ route_next_hop_model['address'] = '192.168.3.4'
- # 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
+ 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 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 json representation of a RouteCollectionVPCContextRoutesItem model
+ route_collection_vpc_context_routes_item_model_json = {}
+ route_collection_vpc_context_routes_item_model_json['action'] = 'delegate'
+ route_collection_vpc_context_routes_item_model_json['advertise'] = True
+ route_collection_vpc_context_routes_item_model_json['created_at'] = '2019-01-01T12:00:00Z'
+ route_collection_vpc_context_routes_item_model_json['destination'] = '192.168.3.0/24'
+ route_collection_vpc_context_routes_item_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531'
+ route_collection_vpc_context_routes_item_model_json['id'] = '1a15dca5-7e33-45e1-b7c5-bc690e569531'
+ route_collection_vpc_context_routes_item_model_json['lifecycle_state'] = 'stable'
+ route_collection_vpc_context_routes_item_model_json['name'] = 'my-route-1'
+ route_collection_vpc_context_routes_item_model_json['next_hop'] = route_next_hop_model
+ route_collection_vpc_context_routes_item_model_json['priority'] = 1
+ route_collection_vpc_context_routes_item_model_json['zone'] = zone_reference_model
- # 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 RouteCollectionVPCContextRoutesItem by calling from_dict on the json representation
+ route_collection_vpc_context_routes_item_model = RouteCollectionVPCContextRoutesItem.from_dict(route_collection_vpc_context_routes_item_model_json)
+ assert route_collection_vpc_context_routes_item_model != False
+
+ # Construct a model instance of RouteCollectionVPCContextRoutesItem by calling from_dict on the json representation
+ route_collection_vpc_context_routes_item_model_dict = RouteCollectionVPCContextRoutesItem.from_dict(route_collection_vpc_context_routes_item_model_json).__dict__
+ route_collection_vpc_context_routes_item_model2 = RouteCollectionVPCContextRoutesItem(**route_collection_vpc_context_routes_item_model_dict)
# Verify the model instances are equivalent
- assert load_balancer_pool_member_patch_model == load_balancer_pool_member_patch_model2
+ assert route_collection_vpc_context_routes_item_model == route_collection_vpc_context_routes_item_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
+ route_collection_vpc_context_routes_item_model_json2 = route_collection_vpc_context_routes_item_model.to_dict()
+ assert route_collection_vpc_context_routes_item_model_json2 == route_collection_vpc_context_routes_item_model_json
-class TestModel_LoadBalancerPoolMemberPrototype:
+class TestModel_RoutePatch:
"""
- Test Class for LoadBalancerPoolMemberPrototype
+ Test Class for RoutePatch
"""
- def test_load_balancer_pool_member_prototype_serialization(self):
+ def test_route_patch_serialization(self):
"""
- Test serialization/deserialization for LoadBalancerPoolMemberPrototype
+ Test serialization/deserialization for RoutePatch
"""
# 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'
+ route_next_hop_patch_model = {} # RouteNextHopPatchRouteNextHopIPRouteNextHopIPSentinelIP
+ route_next_hop_patch_model['address'] = '0.0.0.0'
- # 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 json representation of a RoutePatch model
+ route_patch_model_json = {}
+ route_patch_model_json['advertise'] = True
+ route_patch_model_json['name'] = 'my-route-2'
+ route_patch_model_json['next_hop'] = route_next_hop_patch_model
+ route_patch_model_json['priority'] = 1
- # 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 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 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)
+ # 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 load_balancer_pool_member_prototype_model == load_balancer_pool_member_prototype_model2
+ assert route_patch_model == route_patch_model2
# 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
+ route_patch_model_json2 = route_patch_model.to_dict()
+ assert route_patch_model_json2 == route_patch_model_json
-class TestModel_LoadBalancerPoolMemberReference:
+class TestModel_RoutePrototype:
"""
- Test Class for LoadBalancerPoolMemberReference
+ Test Class for RoutePrototype
"""
- def test_load_balancer_pool_member_reference_serialization(self):
+ def test_route_prototype_serialization(self):
"""
- Test serialization/deserialization for LoadBalancerPoolMemberReference
+ Test serialization/deserialization for RoutePrototype
"""
# Construct dict forms of any model objects needed in order to build this model.
- 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'
+ route_prototype_next_hop_model = {} # RoutePrototypeNextHopRouteNextHopPrototypeRouteNextHopIPRouteNextHopPrototypeRouteNextHopIPRouteNextHopIPSentinelIP
+ route_prototype_next_hop_model['address'] = '0.0.0.0'
- # 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'
+ zone_identity_model = {} # ZoneIdentityByName
+ zone_identity_model['name'] = 'us-south-1'
- # 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 json representation of a RoutePrototype model
+ route_prototype_model_json = {}
+ route_prototype_model_json['action'] = 'deliver'
+ route_prototype_model_json['advertise'] = False
+ route_prototype_model_json['destination'] = '192.168.3.0/24'
+ route_prototype_model_json['name'] = 'my-route-1'
+ route_prototype_model_json['next_hop'] = route_prototype_next_hop_model
+ route_prototype_model_json['priority'] = 1
+ route_prototype_model_json['zone'] = zone_identity_model
- # 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 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 load_balancer_pool_member_reference_model == load_balancer_pool_member_reference_model2
+ assert route_prototype_model == route_prototype_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
+ route_prototype_model_json2 = route_prototype_model.to_dict()
+ assert route_prototype_model_json2 == route_prototype_model_json
-class TestModel_LoadBalancerPoolMemberReferenceDeleted:
+class TestModel_RouteReference:
"""
- Test Class for LoadBalancerPoolMemberReferenceDeleted
+ Test Class for RouteReference
"""
- def test_load_balancer_pool_member_reference_deleted_serialization(self):
+ def test_route_reference_serialization(self):
"""
- Test serialization/deserialization for LoadBalancerPoolMemberReferenceDeleted
+ Test serialization/deserialization for RouteReference
"""
- # 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 dict forms of any model objects needed in order to build this model.
- # 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
+ route_reference_deleted_model = {} # RouteReferenceDeleted
+ route_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # 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 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/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840/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 load_balancer_pool_member_reference_deleted_model == load_balancer_pool_member_reference_deleted_model2
+ assert route_reference_model == route_reference_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
+ route_reference_model_json2 = route_reference_model.to_dict()
+ assert route_reference_model_json2 == route_reference_model_json
-class TestModel_LoadBalancerPoolPatch:
+class TestModel_RouteReferenceDeleted:
"""
- Test Class for LoadBalancerPoolPatch
+ Test Class for RouteReferenceDeleted
"""
- def test_load_balancer_pool_patch_serialization(self):
+ def test_route_reference_deleted_serialization(self):
"""
- Test serialization/deserialization for LoadBalancerPoolPatch
+ Test serialization/deserialization for RouteReferenceDeleted
"""
- # 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 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 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 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 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 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 load_balancer_pool_patch_model == load_balancer_pool_patch_model2
+ assert route_reference_deleted_model == route_reference_deleted_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
+ route_reference_deleted_model_json2 = route_reference_deleted_model.to_dict()
+ assert route_reference_deleted_model_json2 == route_reference_deleted_model_json
-class TestModel_LoadBalancerPoolPrototype:
+class TestModel_RoutingTable:
"""
- Test Class for LoadBalancerPoolPrototype
+ Test Class for RoutingTable
"""
- def test_load_balancer_pool_prototype_serialization(self):
+ def test_routing_table_serialization(self):
"""
- Test serialization/deserialization for LoadBalancerPoolPrototype
+ Test serialization/deserialization for RoutingTable
"""
# 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'] = '/'
+ resource_filter_model = {} # ResourceFilter
+ resource_filter_model['resource_type'] = 'vpn_server'
- load_balancer_pool_member_target_prototype_model = {} # LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById
- load_balancer_pool_member_target_prototype_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
+ route_reference_deleted_model = {} # RouteReferenceDeleted
+ route_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
+ 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/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531'
+ route_reference_model['id'] = '1a15dca5-7e33-45e1-b7c5-bc690e569531'
+ route_reference_model['name'] = 'my-route-1'
- 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_deleted_model = {} # SubnetReferenceDeleted
+ subnet_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # 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
+ subnet_reference_model = {} # SubnetReference
+ subnet_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
+ subnet_reference_model['deleted'] = subnet_reference_deleted_model
+ subnet_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
+ subnet_reference_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
+ subnet_reference_model['name'] = 'my-subnet'
+ subnet_reference_model['resource_type'] = 'subnet'
- # Construct a 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 json representation of a RoutingTable model
+ routing_table_model_json = {}
+ routing_table_model_json['accept_routes_from'] = [resource_filter_model]
+ routing_table_model_json['advertise_routes_to'] = ['transit_gateway', 'direct_link']
+ 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_internet_ingress'] = True
+ routing_table_model_json['route_transit_gateway_ingress'] = True
+ routing_table_model_json['route_vpc_zone_ingress'] = True
+ routing_table_model_json['routes'] = [route_reference_model]
+ routing_table_model_json['subnets'] = [subnet_reference_model]
- # 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 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 load_balancer_pool_prototype_model == load_balancer_pool_prototype_model2
+ assert routing_table_model == routing_table_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
+ routing_table_model_json2 = routing_table_model.to_dict()
+ assert routing_table_model_json2 == routing_table_model_json
-class TestModel_LoadBalancerPoolReference:
+class TestModel_RoutingTableCollection:
"""
- Test Class for LoadBalancerPoolReference
+ Test Class for RoutingTableCollection
"""
- def test_load_balancer_pool_reference_serialization(self):
+ def test_routing_table_collection_serialization(self):
"""
- Test serialization/deserialization for LoadBalancerPoolReference
+ Test serialization/deserialization for RoutingTableCollection
"""
# 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'
+ 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'
- # 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
+ 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'
- # 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)
+ resource_filter_model = {} # ResourceFilter
+ resource_filter_model['resource_type'] = 'vpn_server'
- # Verify the model instances are equivalent
- assert load_balancer_pool_reference_model == load_balancer_pool_reference_model2
+ route_reference_deleted_model = {} # RouteReferenceDeleted
+ route_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_reference_model_json2 = load_balancer_pool_reference_model.to_dict()
- assert load_balancer_pool_reference_model_json2 == load_balancer_pool_reference_model_json
+ 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/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840/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'
-class TestModel_LoadBalancerPoolReferenceDeleted:
- """
- Test Class for LoadBalancerPoolReferenceDeleted
- """
+ subnet_reference_model = {} # SubnetReference
+ subnet_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
+ subnet_reference_model['deleted'] = subnet_reference_deleted_model
+ subnet_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
+ subnet_reference_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
+ subnet_reference_model['name'] = 'my-subnet'
+ subnet_reference_model['resource_type'] = 'subnet'
- def test_load_balancer_pool_reference_deleted_serialization(self):
- """
- Test serialization/deserialization for LoadBalancerPoolReferenceDeleted
- """
+ routing_table_model = {} # RoutingTable
+ routing_table_model['accept_routes_from'] = [resource_filter_model]
+ routing_table_model['advertise_routes_to'] = ['transit_gateway', 'direct_link']
+ 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_internet_ingress'] = True
+ routing_table_model['route_transit_gateway_ingress'] = True
+ routing_table_model['route_vpc_zone_ingress'] = True
+ routing_table_model['routes'] = [route_reference_model]
+ routing_table_model['subnets'] = [subnet_reference_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'
+ # 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 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 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 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 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 load_balancer_pool_reference_deleted_model == load_balancer_pool_reference_deleted_model2
+ assert routing_table_collection_model == routing_table_collection_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
+ routing_table_collection_model_json2 = routing_table_collection_model.to_dict()
+ assert routing_table_collection_model_json2 == routing_table_collection_model_json
-class TestModel_LoadBalancerPoolSessionPersistence:
+class TestModel_RoutingTableCollectionFirst:
"""
- Test Class for LoadBalancerPoolSessionPersistence
+ Test Class for RoutingTableCollectionFirst
"""
- def test_load_balancer_pool_session_persistence_serialization(self):
+ def test_routing_table_collection_first_serialization(self):
"""
- Test serialization/deserialization for LoadBalancerPoolSessionPersistence
+ Test serialization/deserialization for RoutingTableCollectionFirst
"""
- # 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 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 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 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)
+ # 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 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)
# Verify the model instances are equivalent
- assert load_balancer_pool_session_persistence_model == load_balancer_pool_session_persistence_model2
+ assert routing_table_collection_first_model == routing_table_collection_first_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
+ 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
-class TestModel_LoadBalancerPoolSessionPersistencePatch:
+class TestModel_RoutingTableCollectionNext:
"""
- Test Class for LoadBalancerPoolSessionPersistencePatch
+ Test Class for RoutingTableCollectionNext
"""
- def test_load_balancer_pool_session_persistence_patch_serialization(self):
+ def test_routing_table_collection_next_serialization(self):
"""
- Test serialization/deserialization for LoadBalancerPoolSessionPersistencePatch
+ Test serialization/deserialization for RoutingTableCollectionNext
"""
- # 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 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 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 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
- # 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 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)
# Verify the model instances are equivalent
- assert load_balancer_pool_session_persistence_patch_model == load_balancer_pool_session_persistence_patch_model2
+ assert routing_table_collection_next_model == routing_table_collection_next_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
+ 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
-class TestModel_LoadBalancerPoolSessionPersistencePrototype:
+class TestModel_RoutingTablePatch:
"""
- Test Class for LoadBalancerPoolSessionPersistencePrototype
+ Test Class for RoutingTablePatch
"""
- def test_load_balancer_pool_session_persistence_prototype_serialization(self):
+ def test_routing_table_patch_serialization(self):
"""
- Test serialization/deserialization for LoadBalancerPoolSessionPersistencePrototype
+ Test serialization/deserialization for RoutingTablePatch
"""
- # 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 dict forms of any model objects needed in order to build this model.
- # 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
+ resource_filter_model = {} # ResourceFilter
+ resource_filter_model['resource_type'] = 'vpn_server'
- # 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 json representation of a RoutingTablePatch model
+ routing_table_patch_model_json = {}
+ routing_table_patch_model_json['accept_routes_from'] = [resource_filter_model]
+ routing_table_patch_model_json['advertise_routes_to'] = ['transit_gateway']
+ routing_table_patch_model_json['name'] = 'my-routing-table-2'
+ routing_table_patch_model_json['route_direct_link_ingress'] = True
+ routing_table_patch_model_json['route_internet_ingress'] = True
+ routing_table_patch_model_json['route_transit_gateway_ingress'] = True
+ routing_table_patch_model_json['route_vpc_zone_ingress'] = True
+
+ # 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 load_balancer_pool_session_persistence_prototype_model == load_balancer_pool_session_persistence_prototype_model2
+ assert routing_table_patch_model == routing_table_patch_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
+ routing_table_patch_model_json2 = routing_table_patch_model.to_dict()
+ assert routing_table_patch_model_json2 == routing_table_patch_model_json
-class TestModel_LoadBalancerPrivateIpsItem:
+class TestModel_RoutingTableReference:
"""
- Test Class for LoadBalancerPrivateIpsItem
+ Test Class for RoutingTableReference
"""
- def test_load_balancer_private_ips_item_serialization(self):
+ def test_routing_table_reference_serialization(self):
"""
- Test serialization/deserialization for LoadBalancerPrivateIpsItem
+ Test serialization/deserialization for RoutingTableReference
"""
# 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'
+ 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 LoadBalancerPrivateIpsItem model
- load_balancer_private_ips_item_model_json = {}
- load_balancer_private_ips_item_model_json['address'] = '192.168.3.4'
- load_balancer_private_ips_item_model_json['deleted'] = reserved_ip_reference_deleted_model
- load_balancer_private_ips_item_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb'
- load_balancer_private_ips_item_model_json['id'] = '6d353a0f-aeb1-4ae1-832e-1110d10981bb'
- load_balancer_private_ips_item_model_json['name'] = 'my-reserved-ip'
- load_balancer_private_ips_item_model_json['resource_type'] = 'subnet_reserved_ip'
+ # Construct a 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 LoadBalancerPrivateIpsItem by calling from_dict on the json representation
- load_balancer_private_ips_item_model = LoadBalancerPrivateIpsItem.from_dict(load_balancer_private_ips_item_model_json)
- assert load_balancer_private_ips_item_model != False
+ # Construct a model instance of 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 LoadBalancerPrivateIpsItem by calling from_dict on the json representation
- load_balancer_private_ips_item_model_dict = LoadBalancerPrivateIpsItem.from_dict(load_balancer_private_ips_item_model_json).__dict__
- load_balancer_private_ips_item_model2 = LoadBalancerPrivateIpsItem(**load_balancer_private_ips_item_model_dict)
+ # 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 load_balancer_private_ips_item_model == load_balancer_private_ips_item_model2
+ assert routing_table_reference_model == routing_table_reference_model2
# Convert model instance back to dict and verify no loss of data
- load_balancer_private_ips_item_model_json2 = load_balancer_private_ips_item_model.to_dict()
- assert load_balancer_private_ips_item_model_json2 == load_balancer_private_ips_item_model_json
+ routing_table_reference_model_json2 = routing_table_reference_model.to_dict()
+ assert routing_table_reference_model_json2 == routing_table_reference_model_json
-class TestModel_LoadBalancerProfile:
+class TestModel_RoutingTableReferenceDeleted:
"""
- Test Class for LoadBalancerProfile
+ Test Class for RoutingTableReferenceDeleted
"""
- def test_load_balancer_profile_serialization(self):
+ def test_routing_table_reference_deleted_serialization(self):
"""
- Test serialization/deserialization for LoadBalancerProfile
+ Test serialization/deserialization for RoutingTableReferenceDeleted
"""
- # Construct dict forms of any model objects needed in order to build this model.
-
- load_balancer_profile_instance_groups_supported_model = {} # LoadBalancerProfileInstanceGroupsSupportedFixed
- load_balancer_profile_instance_groups_supported_model['type'] = 'fixed'
- load_balancer_profile_instance_groups_supported_model['value'] = True
-
- 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
-
- load_balancer_profile_udp_supported_model = {} # LoadBalancerProfileUDPSupportedFixed
- load_balancer_profile_udp_supported_model['type'] = 'fixed'
- load_balancer_profile_udp_supported_model['value'] = True
-
- # Construct a json representation of a LoadBalancerProfile model
- load_balancer_profile_model_json = {}
- load_balancer_profile_model_json['family'] = 'network'
- load_balancer_profile_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed'
- load_balancer_profile_model_json['instance_groups_supported'] = load_balancer_profile_instance_groups_supported_model
- 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
- load_balancer_profile_model_json['udp_supported'] = load_balancer_profile_udp_supported_model
+ # 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 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 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 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 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 load_balancer_profile_model == load_balancer_profile_model2
+ assert routing_table_reference_deleted_model == routing_table_reference_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
+ 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_LoadBalancerProfileCollection:
+class TestModel_SecurityGroup:
"""
- Test Class for LoadBalancerProfileCollection
+ Test Class for SecurityGroup
"""
- def test_load_balancer_profile_collection_serialization(self):
+ def test_security_group_serialization(self):
"""
- Test serialization/deserialization for LoadBalancerProfileCollection
+ Test serialization/deserialization for SecurityGroup
"""
# 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'
-
- 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'
+ 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_profile_instance_groups_supported_model = {} # LoadBalancerProfileInstanceGroupsSupportedFixed
- load_balancer_profile_instance_groups_supported_model['type'] = 'fixed'
- load_balancer_profile_instance_groups_supported_model['value'] = True
+ security_group_rule_remote_model = {} # SecurityGroupRuleRemoteIP
+ security_group_rule_remote_model['address'] = '192.168.3.4'
- 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_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'
- 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
+ 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'
- 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
+ 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-instance-network-interface'
+ security_group_target_reference_model['resource_type'] = 'network_interface'
- load_balancer_profile_udp_supported_model = {} # LoadBalancerProfileUDPSupportedFixed
- load_balancer_profile_udp_supported_model['type'] = 'fixed'
- load_balancer_profile_udp_supported_model['value'] = True
+ vpc_reference_deleted_model = {} # VPCReferenceDeleted
+ vpc_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['instance_groups_supported'] = load_balancer_profile_instance_groups_supported_model
- 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
- load_balancer_profile_model['udp_supported'] = load_balancer_profile_udp_supported_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'
+ vpc_reference_model['resource_type'] = 'vpc'
- # 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 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['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 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 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 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 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 load_balancer_profile_collection_model == load_balancer_profile_collection_model2
+ assert security_group_model == security_group_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
+ security_group_model_json2 = security_group_model.to_dict()
+ assert security_group_model_json2 == security_group_model_json
-class TestModel_LoadBalancerProfileCollectionFirst:
+class TestModel_SecurityGroupCollection:
"""
- Test Class for LoadBalancerProfileCollectionFirst
+ Test Class for SecurityGroupCollection
"""
- def test_load_balancer_profile_collection_first_serialization(self):
+ def test_security_group_collection_serialization(self):
"""
- Test serialization/deserialization for LoadBalancerProfileCollectionFirst
+ Test serialization/deserialization for SecurityGroupCollection
"""
- # 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 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 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_profile_collection_first_model == load_balancer_profile_collection_first_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
-
+ # Construct dict forms of any model objects needed in order to build this model.
-class TestModel_LoadBalancerProfileCollectionNext:
- """
- Test Class for LoadBalancerProfileCollectionNext
- """
+ security_group_collection_first_model = {} # SecurityGroupCollectionFirst
+ security_group_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups?limit=20'
- def test_load_balancer_profile_collection_next_serialization(self):
- """
- Test serialization/deserialization for LoadBalancerProfileCollectionNext
- """
+ 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'
- # 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'
+ 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 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
+ security_group_rule_remote_model = {} # SecurityGroupRuleRemoteIP
+ security_group_rule_remote_model['address'] = '192.168.3.4'
- # 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)
+ 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 load_balancer_profile_collection_next_model == load_balancer_profile_collection_next_model2
+ 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'
- # 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
+ 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-instance-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'
-class TestModel_LoadBalancerProfileLoggingSupported:
- """
- Test Class for LoadBalancerProfileLoggingSupported
- """
+ vpc_reference_model = {} # VPCReference
+ vpc_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b'
+ vpc_reference_model['deleted'] = vpc_reference_deleted_model
+ vpc_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b'
+ vpc_reference_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b'
+ vpc_reference_model['name'] = 'my-vpc'
+ vpc_reference_model['resource_type'] = 'vpc'
- def test_load_balancer_profile_logging_supported_serialization(self):
- """
- Test serialization/deserialization for LoadBalancerProfileLoggingSupported
- """
+ 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['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 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 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 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 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 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 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 load_balancer_profile_logging_supported_model == load_balancer_profile_logging_supported_model2
+ assert security_group_collection_model == security_group_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
+ security_group_collection_model_json2 = security_group_collection_model.to_dict()
+ assert security_group_collection_model_json2 == security_group_collection_model_json
-class TestModel_LoadBalancerProfileReference:
+class TestModel_SecurityGroupCollectionFirst:
"""
- Test Class for LoadBalancerProfileReference
+ Test Class for SecurityGroupCollectionFirst
"""
- def test_load_balancer_profile_reference_serialization(self):
+ def test_security_group_collection_first_serialization(self):
"""
- Test serialization/deserialization for LoadBalancerProfileReference
+ Test serialization/deserialization for SecurityGroupCollectionFirst
"""
- # 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 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 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 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 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 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 load_balancer_profile_reference_model == load_balancer_profile_reference_model2
+ assert security_group_collection_first_model == security_group_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
+ 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_LoadBalancerReferenceDeleted:
+class TestModel_SecurityGroupCollectionNext:
"""
- Test Class for LoadBalancerReferenceDeleted
+ Test Class for SecurityGroupCollectionNext
"""
- def test_load_balancer_reference_deleted_serialization(self):
+ def test_security_group_collection_next_serialization(self):
"""
- Test serialization/deserialization for LoadBalancerReferenceDeleted
+ Test serialization/deserialization for SecurityGroupCollectionNext
"""
- # 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 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 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 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 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 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 load_balancer_reference_deleted_model == load_balancer_reference_deleted_model2
+ assert security_group_collection_next_model == security_group_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
+ 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_LoadBalancerStatistics:
+class TestModel_SecurityGroupPatch:
"""
- Test Class for LoadBalancerStatistics
+ Test Class for SecurityGroupPatch
"""
- def test_load_balancer_statistics_serialization(self):
+ def test_security_group_patch_serialization(self):
"""
- Test serialization/deserialization for LoadBalancerStatistics
+ Test serialization/deserialization for SecurityGroupPatch
"""
- # 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 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 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 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 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 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 load_balancer_statistics_model == load_balancer_statistics_model2
+ assert security_group_patch_model == security_group_patch_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
+ security_group_patch_model_json2 = security_group_patch_model.to_dict()
+ assert security_group_patch_model_json2 == security_group_patch_model_json
-class TestModel_NetworkACL:
+class TestModel_SecurityGroupReference:
"""
- Test Class for NetworkACL
+ Test Class for SecurityGroupReference
"""
- def test_network_acl_serialization(self):
+ def test_security_group_reference_serialization(self):
"""
- Test serialization/deserialization for NetworkACL
+ Test serialization/deserialization for SecurityGroupReference
"""
# 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'
+ security_group_reference_deleted_model = {} # SecurityGroupReferenceDeleted
+ security_group_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- 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 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'
- 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 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
- network_acl_rule_item_model = {} # NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP
- network_acl_rule_item_model['action'] = 'allow'
- network_acl_rule_item_model['before'] = network_acl_rule_reference_model
- network_acl_rule_item_model['created_at'] = '2019-01-01T12:00:00Z'
- 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-1'
- network_acl_rule_item_model['source'] = '192.168.3.0/24'
- network_acl_rule_item_model['destination_port_max'] = 22
- network_acl_rule_item_model['destination_port_min'] = 22
- network_acl_rule_item_model['protocol'] = 'udp'
- network_acl_rule_item_model['source_port_max'] = 65535
- network_acl_rule_item_model['source_port_min'] = 49152
+ # Construct a 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)
- 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 security_group_reference_model == security_group_reference_model2
- subnet_reference_model = {} # SubnetReference
- subnet_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
- subnet_reference_model['deleted'] = subnet_reference_deleted_model
- subnet_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
- subnet_reference_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
- subnet_reference_model['name'] = 'my-subnet'
- subnet_reference_model['resource_type'] = 'subnet'
+ # 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_reference_deleted_model = {} # VPCReferenceDeleted
- vpc_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- vpc_reference_model = {} # VPCReference
- vpc_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b'
- vpc_reference_model['deleted'] = vpc_reference_deleted_model
- vpc_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b'
- vpc_reference_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b'
- vpc_reference_model['name'] = 'my-vpc'
- vpc_reference_model['resource_type'] = 'vpc'
+class TestModel_SecurityGroupReferenceDeleted:
+ """
+ Test Class for SecurityGroupReferenceDeleted
+ """
- # 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
+ def test_security_group_reference_deleted_serialization(self):
+ """
+ Test serialization/deserialization for SecurityGroupReferenceDeleted
+ """
- # 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 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 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 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 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 network_acl_model == network_acl_model2
+ assert security_group_reference_deleted_model == security_group_reference_deleted_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
+ 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_NetworkACLCollection:
+class TestModel_SecurityGroupRuleCollection:
"""
- Test Class for NetworkACLCollection
+ Test Class for SecurityGroupRuleCollection
"""
- def test_network_acl_collection_serialization(self):
+ def test_security_group_rule_collection_serialization(self):
"""
- Test serialization/deserialization for NetworkACLCollection
+ Test serialization/deserialization for SecurityGroupRuleCollection
"""
# 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'
+ security_group_rule_remote_model = {} # SecurityGroupRuleRemoteIP
+ security_group_rule_remote_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'
+ 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_rule_reference_deleted_model = {} # NetworkACLRuleReferenceDeleted
- network_acl_rule_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]
- 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 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
- network_acl_rule_item_model = {} # NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP
- network_acl_rule_item_model['action'] = 'allow'
- network_acl_rule_item_model['before'] = network_acl_rule_reference_model
- network_acl_rule_item_model['created_at'] = '2019-01-01T12:00:00Z'
- 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-1'
- network_acl_rule_item_model['source'] = '192.168.3.0/24'
- network_acl_rule_item_model['destination_port_max'] = 22
- network_acl_rule_item_model['destination_port_min'] = 22
- network_acl_rule_item_model['protocol'] = 'udp'
- network_acl_rule_item_model['source_port_max'] = 65535
- network_acl_rule_item_model['source_port_min'] = 49152
+ # Construct a 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)
- 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 security_group_rule_collection_model == security_group_rule_collection_model2
- subnet_reference_model = {} # SubnetReference
- subnet_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
- subnet_reference_model['deleted'] = subnet_reference_deleted_model
- subnet_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
- subnet_reference_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
- subnet_reference_model['name'] = 'my-subnet'
- subnet_reference_model['resource_type'] = 'subnet'
+ # 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_deleted_model = {} # VPCReferenceDeleted
- vpc_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- vpc_reference_model = {} # VPCReference
- vpc_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b'
- vpc_reference_model['deleted'] = vpc_reference_deleted_model
- vpc_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b'
- vpc_reference_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b'
- vpc_reference_model['name'] = 'my-vpc'
- vpc_reference_model['resource_type'] = 'vpc'
+class TestModel_SecurityGroupRulePatch:
+ """
+ Test Class for SecurityGroupRulePatch
+ """
- 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
+ def test_security_group_rule_patch_serialization(self):
+ """
+ Test serialization/deserialization for SecurityGroupRulePatch
+ """
- 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 dict forms of any model objects needed in order to build this model.
- # 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
+ security_group_rule_remote_patch_model = {} # SecurityGroupRuleRemotePatchCIDR
+ security_group_rule_remote_patch_model['cidr_block'] = '10.0.0.0/16'
- # 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 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 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)
+ # 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 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 network_acl_collection_model == network_acl_collection_model2
+ assert security_group_rule_patch_model == security_group_rule_patch_model2
# 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
+ 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_NetworkACLCollectionFirst:
+class TestModel_SecurityGroupTargetCollection:
"""
- Test Class for NetworkACLCollectionFirst
+ Test Class for SecurityGroupTargetCollection
"""
- def test_network_acl_collection_first_serialization(self):
+ def test_security_group_target_collection_serialization(self):
"""
- Test serialization/deserialization for NetworkACLCollectionFirst
+ Test serialization/deserialization for SecurityGroupTargetCollection
"""
- # 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 dict forms of any model objects needed in order to build this model.
- # 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
+ 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 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)
+ 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-instance-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 network_acl_collection_first_model == network_acl_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
- 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
+ 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_NetworkACLCollectionNext:
+class TestModel_SecurityGroupTargetCollectionFirst:
"""
- Test Class for NetworkACLCollectionNext
+ Test Class for SecurityGroupTargetCollectionFirst
"""
- def test_network_acl_collection_next_serialization(self):
+ def test_security_group_target_collection_first_serialization(self):
"""
- Test serialization/deserialization for NetworkACLCollectionNext
+ Test serialization/deserialization for SecurityGroupTargetCollectionFirst
"""
- # 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 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 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 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 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 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 network_acl_collection_next_model == network_acl_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
- 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
+ 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_NetworkACLPatch:
+class TestModel_SecurityGroupTargetCollectionNext:
"""
- Test Class for NetworkACLPatch
+ Test Class for SecurityGroupTargetCollectionNext
"""
- def test_network_acl_patch_serialization(self):
+ def test_security_group_target_collection_next_serialization(self):
"""
- Test serialization/deserialization for NetworkACLPatch
+ Test serialization/deserialization for SecurityGroupTargetCollectionNext
"""
- # 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 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 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 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 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 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 network_acl_patch_model == network_acl_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
- network_acl_patch_model_json2 = network_acl_patch_model.to_dict()
- assert network_acl_patch_model_json2 == network_acl_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_NetworkACLReference:
+class TestModel_Share:
"""
- Test Class for NetworkACLReference
+ Test Class for Share
"""
- def test_network_acl_reference_serialization(self):
+ def test_share_serialization(self):
"""
- Test serialization/deserialization for NetworkACLReference
+ Test serialization/deserialization for Share
"""
# 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'
+ encryption_key_reference_model = {} # EncryptionKeyReference
+ encryption_key_reference_model['crn'] = 'crn:v1:bluemix:public:kms:us-south:a/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179'
- # 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'
+ share_job_status_reason_model = {} # ShareJobStatusReason
+ share_job_status_reason_model['code'] = 'cannot_reach_source_share'
+ share_job_status_reason_model['message'] = 'The replication failover failed because the source share cannot be reached.'
+ share_job_status_reason_model['more_info'] = 'https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning'
- # Construct a 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
+ share_job_model = {} # ShareJob
+ share_job_model['status'] = 'cancelled'
+ share_job_model['status_reasons'] = [share_job_status_reason_model]
+ share_job_model['type'] = 'replication_failover'
- # 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)
+ share_latest_sync_model = {} # ShareLatestSync
+ share_latest_sync_model['completed_at'] = '2019-01-01T12:00:00Z'
+ share_latest_sync_model['data_transferred'] = 0
+ share_latest_sync_model['started_at'] = '2019-01-01T12:00:00Z'
- # Verify the model instances are equivalent
- assert network_acl_reference_model == network_acl_reference_model2
+ share_mount_target_reference_deleted_model = {} # ShareMountTargetReferenceDeleted
+ share_mount_target_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_model_json2 = network_acl_reference_model.to_dict()
- assert network_acl_reference_model_json2 == network_acl_reference_model_json
+ share_mount_target_reference_model = {} # ShareMountTargetReference
+ share_mount_target_reference_model['deleted'] = share_mount_target_reference_deleted_model
+ share_mount_target_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c'
+ share_mount_target_reference_model['id'] = '4cf9171a-0043-4434-8727-15b53dbc374c'
+ share_mount_target_reference_model['name'] = 'my-share-mount-target'
+ share_mount_target_reference_model['resource_type'] = 'share_mount_target'
+ share_profile_reference_model = {} # ShareProfileReference
+ share_profile_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops'
+ share_profile_reference_model['name'] = 'tier-3iops'
+ share_profile_reference_model['resource_type'] = 'share_profile'
-class TestModel_NetworkACLReferenceDeleted:
- """
- Test Class for NetworkACLReferenceDeleted
- """
+ share_reference_deleted_model = {} # ShareReferenceDeleted
+ share_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- def test_network_acl_reference_deleted_serialization(self):
- """
- Test serialization/deserialization for NetworkACLReferenceDeleted
- """
+ 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 NetworkACLReferenceDeleted model
- network_acl_reference_deleted_model_json = {}
- network_acl_reference_deleted_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ share_remote_model = {} # ShareRemote
+ share_remote_model['region'] = region_reference_model
- # 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
+ share_reference_model = {} # ShareReference
+ share_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58'
+ share_reference_model['deleted'] = share_reference_deleted_model
+ share_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58'
+ share_reference_model['id'] = '0fe9e5d8-0a4d-4818-96ec-e99708644a58'
+ share_reference_model['name'] = 'my-share'
+ share_reference_model['remote'] = share_remote_model
+ share_reference_model['resource_type'] = 'share'
- # 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)
+ share_replication_status_reason_model = {} # ShareReplicationStatusReason
+ share_replication_status_reason_model['code'] = 'cannot_reach_source_share'
+ share_replication_status_reason_model['message'] = 'The replication failover failed because the source share cannot be reached.'
+ share_replication_status_reason_model['more_info'] = 'https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning'
+
+ resource_group_reference_model = {} # ResourceGroupReference
+ resource_group_reference_model['href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345'
+ resource_group_reference_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
+ resource_group_reference_model['name'] = 'my-resource-group'
+
+ zone_reference_model = {} # ZoneReference
+ zone_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1'
+ zone_reference_model['name'] = 'us-south-1'
+
+ # Construct a json representation of a Share model
+ share_model_json = {}
+ share_model_json['access_control_mode'] = 'security_group'
+ share_model_json['created_at'] = '2019-01-01T12:00:00Z'
+ share_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58'
+ share_model_json['encryption'] = 'provider_managed'
+ share_model_json['encryption_key'] = encryption_key_reference_model
+ share_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58'
+ share_model_json['id'] = '0fe9e5d8-0a4d-4818-96ec-e99708644a58'
+ share_model_json['iops'] = 100
+ share_model_json['latest_job'] = share_job_model
+ share_model_json['latest_sync'] = share_latest_sync_model
+ share_model_json['lifecycle_state'] = 'stable'
+ share_model_json['mount_targets'] = [share_mount_target_reference_model]
+ share_model_json['name'] = 'my-share'
+ share_model_json['profile'] = share_profile_reference_model
+ share_model_json['replica_share'] = share_reference_model
+ share_model_json['replication_cron_spec'] = '0 */5 * * *'
+ share_model_json['replication_role'] = 'none'
+ share_model_json['replication_status'] = 'active'
+ share_model_json['replication_status_reasons'] = [share_replication_status_reason_model]
+ share_model_json['resource_group'] = resource_group_reference_model
+ share_model_json['resource_type'] = 'share'
+ share_model_json['size'] = 200
+ share_model_json['source_share'] = share_reference_model
+ share_model_json['user_tags'] = ['testString']
+ share_model_json['zone'] = zone_reference_model
+
+ # Construct a model instance of Share by calling from_dict on the json representation
+ share_model = Share.from_dict(share_model_json)
+ assert share_model != False
+
+ # Construct a model instance of Share by calling from_dict on the json representation
+ share_model_dict = Share.from_dict(share_model_json).__dict__
+ share_model2 = Share(**share_model_dict)
# Verify the model instances are equivalent
- assert network_acl_reference_deleted_model == network_acl_reference_deleted_model2
+ assert share_model == share_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
+ share_model_json2 = share_model.to_dict()
+ assert share_model_json2 == share_model_json
-class TestModel_NetworkACLRuleCollection:
+class TestModel_ShareCollection:
"""
- Test Class for NetworkACLRuleCollection
+ Test Class for ShareCollection
"""
- def test_network_acl_rule_collection_serialization(self):
+ def test_share_collection_serialization(self):
"""
- Test serialization/deserialization for NetworkACLRuleCollection
+ Test serialization/deserialization for ShareCollection
"""
# 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'
+ share_collection_first_model = {} # ShareCollectionFirst
+ share_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/shares?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'
+ share_collection_next_model = {} # ShareCollectionNext
+ share_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/shares?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'
+ encryption_key_reference_model = {} # EncryptionKeyReference
+ encryption_key_reference_model['crn'] = 'crn:v1:bluemix:public:kms:us-south:a/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179'
- 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'
+ share_job_status_reason_model = {} # ShareJobStatusReason
+ share_job_status_reason_model['code'] = 'cannot_reach_source_share'
+ share_job_status_reason_model['message'] = 'The replication failover failed because the source share cannot be reached.'
+ share_job_status_reason_model['more_info'] = 'https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning'
- network_acl_rule_item_model = {} # NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP
- network_acl_rule_item_model['action'] = 'allow'
- network_acl_rule_item_model['before'] = network_acl_rule_reference_model
- network_acl_rule_item_model['created_at'] = '2019-01-01T12:00:00Z'
- 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-1'
- network_acl_rule_item_model['source'] = '192.168.3.0/24'
- network_acl_rule_item_model['destination_port_max'] = 22
- network_acl_rule_item_model['destination_port_min'] = 22
- network_acl_rule_item_model['protocol'] = 'udp'
- network_acl_rule_item_model['source_port_max'] = 65535
- network_acl_rule_item_model['source_port_min'] = 49152
+ share_job_model = {} # ShareJob
+ share_job_model['status'] = 'cancelled'
+ share_job_model['status_reasons'] = [share_job_status_reason_model]
+ share_job_model['type'] = 'replication_failover'
- # 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
+ share_latest_sync_model = {} # ShareLatestSync
+ share_latest_sync_model['completed_at'] = '2019-01-01T12:00:00Z'
+ share_latest_sync_model['data_transferred'] = 0
+ share_latest_sync_model['started_at'] = '2019-01-01T12:00:00Z'
- # 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
+ share_mount_target_reference_deleted_model = {} # ShareMountTargetReferenceDeleted
+ share_mount_target_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Construct a 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)
+ share_mount_target_reference_model = {} # ShareMountTargetReference
+ share_mount_target_reference_model['deleted'] = share_mount_target_reference_deleted_model
+ share_mount_target_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c'
+ share_mount_target_reference_model['id'] = '4cf9171a-0043-4434-8727-15b53dbc374c'
+ share_mount_target_reference_model['name'] = 'my-share-mount-target'
+ share_mount_target_reference_model['resource_type'] = 'share_mount_target'
+
+ share_profile_reference_model = {} # ShareProfileReference
+ share_profile_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops'
+ share_profile_reference_model['name'] = 'tier-3iops'
+ share_profile_reference_model['resource_type'] = 'share_profile'
+
+ share_reference_deleted_model = {} # ShareReferenceDeleted
+ share_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+
+ 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'
+
+ share_remote_model = {} # ShareRemote
+ share_remote_model['region'] = region_reference_model
+
+ share_reference_model = {} # ShareReference
+ share_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58'
+ share_reference_model['deleted'] = share_reference_deleted_model
+ share_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58'
+ share_reference_model['id'] = '0fe9e5d8-0a4d-4818-96ec-e99708644a58'
+ share_reference_model['name'] = 'my-share'
+ share_reference_model['remote'] = share_remote_model
+ share_reference_model['resource_type'] = 'share'
+
+ share_replication_status_reason_model = {} # ShareReplicationStatusReason
+ share_replication_status_reason_model['code'] = 'cannot_reach_source_share'
+ share_replication_status_reason_model['message'] = 'The replication failover failed because the source share cannot be reached.'
+ share_replication_status_reason_model['more_info'] = 'https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning'
+
+ resource_group_reference_model = {} # ResourceGroupReference
+ resource_group_reference_model['href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345'
+ resource_group_reference_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
+ resource_group_reference_model['name'] = 'my-resource-group'
+
+ zone_reference_model = {} # ZoneReference
+ zone_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1'
+ zone_reference_model['name'] = 'us-south-1'
+
+ share_model = {} # Share
+ share_model['access_control_mode'] = 'security_group'
+ share_model['created_at'] = '2019-01-01T12:00:00Z'
+ share_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58'
+ share_model['encryption'] = 'provider_managed'
+ share_model['encryption_key'] = encryption_key_reference_model
+ share_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58'
+ share_model['id'] = '0fe9e5d8-0a4d-4818-96ec-e99708644a58'
+ share_model['iops'] = 100
+ share_model['latest_job'] = share_job_model
+ share_model['latest_sync'] = share_latest_sync_model
+ share_model['lifecycle_state'] = 'stable'
+ share_model['mount_targets'] = [share_mount_target_reference_model]
+ share_model['name'] = 'my-share'
+ share_model['profile'] = share_profile_reference_model
+ share_model['replica_share'] = share_reference_model
+ share_model['replication_cron_spec'] = '0 */5 * * *'
+ share_model['replication_role'] = 'none'
+ share_model['replication_status'] = 'active'
+ share_model['replication_status_reasons'] = [share_replication_status_reason_model]
+ share_model['resource_group'] = resource_group_reference_model
+ share_model['resource_type'] = 'share'
+ share_model['size'] = 200
+ share_model['source_share'] = share_reference_model
+ share_model['user_tags'] = ['testString']
+ share_model['zone'] = zone_reference_model
+
+ # Construct a json representation of a ShareCollection model
+ share_collection_model_json = {}
+ share_collection_model_json['first'] = share_collection_first_model
+ share_collection_model_json['limit'] = 20
+ share_collection_model_json['next'] = share_collection_next_model
+ share_collection_model_json['shares'] = [share_model]
+ share_collection_model_json['total_count'] = 132
+
+ # Construct a model instance of ShareCollection by calling from_dict on the json representation
+ share_collection_model = ShareCollection.from_dict(share_collection_model_json)
+ assert share_collection_model != False
+
+ # Construct a model instance of ShareCollection by calling from_dict on the json representation
+ share_collection_model_dict = ShareCollection.from_dict(share_collection_model_json).__dict__
+ share_collection_model2 = ShareCollection(**share_collection_model_dict)
# Verify the model instances are equivalent
- assert network_acl_rule_collection_model == network_acl_rule_collection_model2
+ assert share_collection_model == share_collection_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
+ share_collection_model_json2 = share_collection_model.to_dict()
+ assert share_collection_model_json2 == share_collection_model_json
-class TestModel_NetworkACLRuleCollectionFirst:
+class TestModel_ShareCollectionFirst:
"""
- Test Class for NetworkACLRuleCollectionFirst
+ Test Class for ShareCollectionFirst
"""
- def test_network_acl_rule_collection_first_serialization(self):
+ def test_share_collection_first_serialization(self):
"""
- Test serialization/deserialization for NetworkACLRuleCollectionFirst
+ Test serialization/deserialization for ShareCollectionFirst
"""
- # 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 json representation of a ShareCollectionFirst model
+ share_collection_first_model_json = {}
+ share_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/shares?limit=20'
- # Construct a model instance of 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 ShareCollectionFirst by calling from_dict on the json representation
+ share_collection_first_model = ShareCollectionFirst.from_dict(share_collection_first_model_json)
+ assert share_collection_first_model != False
- # Construct a model instance of 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)
+ # Construct a model instance of ShareCollectionFirst by calling from_dict on the json representation
+ share_collection_first_model_dict = ShareCollectionFirst.from_dict(share_collection_first_model_json).__dict__
+ share_collection_first_model2 = ShareCollectionFirst(**share_collection_first_model_dict)
# Verify the model instances are equivalent
- assert network_acl_rule_collection_first_model == network_acl_rule_collection_first_model2
+ assert share_collection_first_model == share_collection_first_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
+ share_collection_first_model_json2 = share_collection_first_model.to_dict()
+ assert share_collection_first_model_json2 == share_collection_first_model_json
-class TestModel_NetworkACLRuleCollectionNext:
+class TestModel_ShareCollectionNext:
"""
- Test Class for NetworkACLRuleCollectionNext
+ Test Class for ShareCollectionNext
"""
- def test_network_acl_rule_collection_next_serialization(self):
+ def test_share_collection_next_serialization(self):
"""
- Test serialization/deserialization for NetworkACLRuleCollectionNext
+ Test serialization/deserialization for ShareCollectionNext
"""
- # 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 ShareCollectionNext model
+ share_collection_next_model_json = {}
+ share_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/shares?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
- # Construct a model instance of 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 ShareCollectionNext by calling from_dict on the json representation
+ share_collection_next_model = ShareCollectionNext.from_dict(share_collection_next_model_json)
+ assert share_collection_next_model != False
- # Construct a model instance of 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 ShareCollectionNext by calling from_dict on the json representation
+ share_collection_next_model_dict = ShareCollectionNext.from_dict(share_collection_next_model_json).__dict__
+ share_collection_next_model2 = ShareCollectionNext(**share_collection_next_model_dict)
# Verify the model instances are equivalent
- assert network_acl_rule_collection_next_model == network_acl_rule_collection_next_model2
+ assert share_collection_next_model == share_collection_next_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
+ share_collection_next_model_json2 = share_collection_next_model.to_dict()
+ assert share_collection_next_model_json2 == share_collection_next_model_json
-class TestModel_NetworkACLRulePatch:
+class TestModel_ShareInitialOwner:
"""
- Test Class for NetworkACLRulePatch
+ Test Class for ShareInitialOwner
"""
- def test_network_acl_rule_patch_serialization(self):
+ def test_share_initial_owner_serialization(self):
"""
- Test serialization/deserialization for NetworkACLRulePatch
+ Test serialization/deserialization for ShareInitialOwner
"""
- # 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-1'
- network_acl_rule_patch_model_json['protocol'] = 'tcp'
- network_acl_rule_patch_model_json['source'] = '192.168.3.2/32'
- network_acl_rule_patch_model_json['source_port_max'] = 65535
- network_acl_rule_patch_model_json['source_port_min'] = 49152
- network_acl_rule_patch_model_json['type'] = 8
+ # Construct a json representation of a ShareInitialOwner model
+ share_initial_owner_model_json = {}
+ share_initial_owner_model_json['gid'] = 50
+ share_initial_owner_model_json['uid'] = 50
- # Construct a model instance of 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 ShareInitialOwner by calling from_dict on the json representation
+ share_initial_owner_model = ShareInitialOwner.from_dict(share_initial_owner_model_json)
+ assert share_initial_owner_model != False
- # Construct a model instance of 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 ShareInitialOwner by calling from_dict on the json representation
+ share_initial_owner_model_dict = ShareInitialOwner.from_dict(share_initial_owner_model_json).__dict__
+ share_initial_owner_model2 = ShareInitialOwner(**share_initial_owner_model_dict)
# Verify the model instances are equivalent
- assert network_acl_rule_patch_model == network_acl_rule_patch_model2
+ assert share_initial_owner_model == share_initial_owner_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
+ share_initial_owner_model_json2 = share_initial_owner_model.to_dict()
+ assert share_initial_owner_model_json2 == share_initial_owner_model_json
-class TestModel_NetworkACLRuleReference:
+class TestModel_ShareJob:
"""
- Test Class for NetworkACLRuleReference
+ Test Class for ShareJob
"""
- def test_network_acl_rule_reference_serialization(self):
+ def test_share_job_serialization(self):
"""
- Test serialization/deserialization for NetworkACLRuleReference
+ Test serialization/deserialization for ShareJob
"""
# 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'
+ share_job_status_reason_model = {} # ShareJobStatusReason
+ share_job_status_reason_model['code'] = 'cannot_reach_source_share'
+ share_job_status_reason_model['message'] = 'The replication failover failed because the source share cannot be reached.'
+ share_job_status_reason_model['more_info'] = 'https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning'
- # Construct a json representation of a 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 ShareJob model
+ share_job_model_json = {}
+ share_job_model_json['status'] = 'cancelled'
+ share_job_model_json['status_reasons'] = [share_job_status_reason_model]
+ share_job_model_json['type'] = 'replication_failover'
- # Construct a model instance of 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 ShareJob by calling from_dict on the json representation
+ share_job_model = ShareJob.from_dict(share_job_model_json)
+ assert share_job_model != False
- # Construct a model instance of 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 ShareJob by calling from_dict on the json representation
+ share_job_model_dict = ShareJob.from_dict(share_job_model_json).__dict__
+ share_job_model2 = ShareJob(**share_job_model_dict)
# Verify the model instances are equivalent
- assert network_acl_rule_reference_model == network_acl_rule_reference_model2
+ assert share_job_model == share_job_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
+ share_job_model_json2 = share_job_model.to_dict()
+ assert share_job_model_json2 == share_job_model_json
-class TestModel_NetworkACLRuleReferenceDeleted:
+class TestModel_ShareJobStatusReason:
"""
- Test Class for NetworkACLRuleReferenceDeleted
+ Test Class for ShareJobStatusReason
"""
- def test_network_acl_rule_reference_deleted_serialization(self):
+ def test_share_job_status_reason_serialization(self):
"""
- Test serialization/deserialization for NetworkACLRuleReferenceDeleted
+ Test serialization/deserialization for ShareJobStatusReason
"""
- # 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 ShareJobStatusReason model
+ share_job_status_reason_model_json = {}
+ share_job_status_reason_model_json['code'] = 'cannot_reach_source_share'
+ share_job_status_reason_model_json['message'] = 'The replication failover failed because the source share cannot be reached.'
+ share_job_status_reason_model_json['more_info'] = 'https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning'
- # Construct a model instance of 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 ShareJobStatusReason by calling from_dict on the json representation
+ share_job_status_reason_model = ShareJobStatusReason.from_dict(share_job_status_reason_model_json)
+ assert share_job_status_reason_model != False
- # Construct a model instance of 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 ShareJobStatusReason by calling from_dict on the json representation
+ share_job_status_reason_model_dict = ShareJobStatusReason.from_dict(share_job_status_reason_model_json).__dict__
+ share_job_status_reason_model2 = ShareJobStatusReason(**share_job_status_reason_model_dict)
# Verify the model instances are equivalent
- assert network_acl_rule_reference_deleted_model == network_acl_rule_reference_deleted_model2
+ assert share_job_status_reason_model == share_job_status_reason_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
+ share_job_status_reason_model_json2 = share_job_status_reason_model.to_dict()
+ assert share_job_status_reason_model_json2 == share_job_status_reason_model_json
-class TestModel_NetworkInterface:
+class TestModel_ShareLatestSync:
"""
- Test Class for NetworkInterface
+ Test Class for ShareLatestSync
"""
- def test_network_interface_serialization(self):
+ def test_share_latest_sync_serialization(self):
"""
- Test serialization/deserialization for NetworkInterface
+ Test serialization/deserialization for ShareLatestSync
"""
- # Construct dict forms of any model objects needed in order to build this model.
-
- floating_ip_reference_deleted_model = {} # FloatingIPReferenceDeleted
- floating_ip_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
-
- floating_ip_reference_model = {} # FloatingIPReference
- floating_ip_reference_model['address'] = '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'
-
- reserved_ip_reference_deleted_model = {} # ReservedIPReferenceDeleted
- reserved_ip_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
-
- reserved_ip_reference_model = {} # ReservedIPReference
- reserved_ip_reference_model['address'] = '10.0.0.32'
- reserved_ip_reference_model['deleted'] = reserved_ip_reference_deleted_model
- reserved_ip_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/0716-b28a7e6d-a66b-4de7-8713-15dcffdce401/reserved_ips/0716-7768a27e-cd6c-4a13-a9e6-d67a964e54a5'
- reserved_ip_reference_model['id'] = '0716-7768a27e-cd6c-4a13-a9e6-d67a964e54a5'
- reserved_ip_reference_model['name'] = 'my-reserved-ip-1'
- reserved_ip_reference_model['resource_type'] = 'subnet_reserved_ip'
-
- security_group_reference_deleted_model = {} # SecurityGroupReferenceDeleted
- security_group_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
-
- 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'
-
- subnet_reference_deleted_model = {} # SubnetReferenceDeleted
- subnet_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
-
- subnet_reference_model = {} # SubnetReference
- subnet_reference_model['crn'] = 'crn:[...]'
- subnet_reference_model['deleted'] = subnet_reference_deleted_model
- subnet_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/9270d819-c05e-4352-99e4-80c4680cdb7c'
- subnet_reference_model['id'] = '9270d819-c05e-4352-99e4-80c4680cdb7c'
- subnet_reference_model['name'] = 'my-subnet'
- subnet_reference_model['resource_type'] = 'subnet'
-
- # 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-instance-network-interface'
- network_interface_model_json['port_speed'] = 1000
- network_interface_model_json['primary_ip'] = reserved_ip_reference_model
- network_interface_model_json['resource_type'] = 'network_interface'
- 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 json representation of a ShareLatestSync model
+ share_latest_sync_model_json = {}
+ share_latest_sync_model_json['completed_at'] = '2019-01-01T12:00:00Z'
+ share_latest_sync_model_json['data_transferred'] = 0
+ share_latest_sync_model_json['started_at'] = '2019-01-01T12:00:00Z'
- # 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 ShareLatestSync by calling from_dict on the json representation
+ share_latest_sync_model = ShareLatestSync.from_dict(share_latest_sync_model_json)
+ assert share_latest_sync_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)
+ # Construct a model instance of ShareLatestSync by calling from_dict on the json representation
+ share_latest_sync_model_dict = ShareLatestSync.from_dict(share_latest_sync_model_json).__dict__
+ share_latest_sync_model2 = ShareLatestSync(**share_latest_sync_model_dict)
# Verify the model instances are equivalent
- assert network_interface_model == network_interface_model2
+ assert share_latest_sync_model == share_latest_sync_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
+ share_latest_sync_model_json2 = share_latest_sync_model.to_dict()
+ assert share_latest_sync_model_json2 == share_latest_sync_model_json
-class TestModel_NetworkInterfaceBareMetalServerContextReference:
+class TestModel_ShareMountTarget:
"""
- Test Class for NetworkInterfaceBareMetalServerContextReference
+ Test Class for ShareMountTarget
"""
- def test_network_interface_bare_metal_server_context_reference_serialization(self):
+ def test_share_mount_target_serialization(self):
"""
- Test serialization/deserialization for NetworkInterfaceBareMetalServerContextReference
+ Test serialization/deserialization for ShareMountTarget
"""
# Construct dict forms of any model objects needed in order to build this model.
- network_interface_bare_metal_server_context_reference_deleted_model = {} # NetworkInterfaceBareMetalServerContextReferenceDeleted
- network_interface_bare_metal_server_context_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
-
reserved_ip_reference_deleted_model = {} # ReservedIPReferenceDeleted
reserved_ip_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
@@ -57726,76 +67535,70 @@ def test_network_interface_bare_metal_server_context_reference_serialization(sel
subnet_reference_model['name'] = 'my-subnet'
subnet_reference_model['resource_type'] = 'subnet'
- # 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-bare-metal-server-network-interface'
- network_interface_bare_metal_server_context_reference_model_json['primary_ip'] = reserved_ip_reference_model
- network_interface_bare_metal_server_context_reference_model_json['resource_type'] = 'network_interface'
- network_interface_bare_metal_server_context_reference_model_json['subnet'] = subnet_reference_model
-
- # 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 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 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
- 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
-
+ virtual_network_interface_reference_attachment_context_model = {} # VirtualNetworkInterfaceReferenceAttachmentContext
+ virtual_network_interface_reference_attachment_context_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9'
+ virtual_network_interface_reference_attachment_context_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9'
+ virtual_network_interface_reference_attachment_context_model['id'] = '0767-fa41aecb-4f21-423d-8082-630bfba1e1d9'
+ virtual_network_interface_reference_attachment_context_model['name'] = 'my-virtual-network-interface'
+ virtual_network_interface_reference_attachment_context_model['resource_type'] = 'virtual_network_interface'
-class TestModel_NetworkInterfaceBareMetalServerContextReferenceDeleted:
- """
- Test Class for NetworkInterfaceBareMetalServerContextReferenceDeleted
- """
+ vpc_reference_deleted_model = {} # VPCReferenceDeleted
+ vpc_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- def test_network_interface_bare_metal_server_context_reference_deleted_serialization(self):
- """
- Test serialization/deserialization for NetworkInterfaceBareMetalServerContextReferenceDeleted
- """
+ vpc_reference_model = {} # VPCReference
+ vpc_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b'
+ vpc_reference_model['deleted'] = vpc_reference_deleted_model
+ vpc_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b'
+ vpc_reference_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b'
+ vpc_reference_model['name'] = 'my-vpc'
+ vpc_reference_model['resource_type'] = 'vpc'
- # Construct a json representation of a 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 json representation of a ShareMountTarget model
+ share_mount_target_model_json = {}
+ share_mount_target_model_json['access_control_mode'] = 'security_group'
+ share_mount_target_model_json['created_at'] = '2019-01-01T12:00:00Z'
+ share_mount_target_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c'
+ share_mount_target_model_json['id'] = '4cf9171a-0043-4434-8727-15b53dbc374c'
+ share_mount_target_model_json['lifecycle_state'] = 'stable'
+ share_mount_target_model_json['mount_path'] = '10.240.1.23:/nxg_s_voll_mz7121_58e7e963_8f4b_4a0c_b71a_8ba8d9cd1e2e'
+ share_mount_target_model_json['name'] = 'my-share-mount-target'
+ share_mount_target_model_json['primary_ip'] = reserved_ip_reference_model
+ share_mount_target_model_json['resource_type'] = 'share_mount_target'
+ share_mount_target_model_json['subnet'] = subnet_reference_model
+ share_mount_target_model_json['transit_encryption'] = 'none'
+ share_mount_target_model_json['virtual_network_interface'] = virtual_network_interface_reference_attachment_context_model
+ share_mount_target_model_json['vpc'] = vpc_reference_model
- # Construct a model instance of 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 ShareMountTarget by calling from_dict on the json representation
+ share_mount_target_model = ShareMountTarget.from_dict(share_mount_target_model_json)
+ assert share_mount_target_model != False
- # Construct a model instance of 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)
+ # Construct a model instance of ShareMountTarget by calling from_dict on the json representation
+ share_mount_target_model_dict = ShareMountTarget.from_dict(share_mount_target_model_json).__dict__
+ share_mount_target_model2 = ShareMountTarget(**share_mount_target_model_dict)
# Verify the model instances are equivalent
- assert network_interface_bare_metal_server_context_reference_deleted_model == network_interface_bare_metal_server_context_reference_deleted_model2
+ assert share_mount_target_model == share_mount_target_model2
# Convert model instance back to dict and verify no loss of data
- 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
+ share_mount_target_model_json2 = share_mount_target_model.to_dict()
+ assert share_mount_target_model_json2 == share_mount_target_model_json
-class TestModel_NetworkInterfaceInstanceContextReference:
+class TestModel_ShareMountTargetCollection:
"""
- Test Class for NetworkInterfaceInstanceContextReference
+ Test Class for ShareMountTargetCollection
"""
- def test_network_interface_instance_context_reference_serialization(self):
+ def test_share_mount_target_collection_serialization(self):
"""
- Test serialization/deserialization for NetworkInterfaceInstanceContextReference
+ Test serialization/deserialization for ShareMountTargetCollection
"""
# 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'
+ share_mount_target_collection_first_model = {} # ShareMountTargetCollectionFirst
+ share_mount_target_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets?limit=20'
reserved_ip_reference_deleted_model = {} # ReservedIPReferenceDeleted
reserved_ip_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
@@ -57819,5106 +67622,5397 @@ def test_network_interface_instance_context_reference_serialization(self):
subnet_reference_model['name'] = 'my-subnet'
subnet_reference_model['resource_type'] = 'subnet'
- # 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-instance-network-interface'
- network_interface_instance_context_reference_model_json['primary_ip'] = reserved_ip_reference_model
- network_interface_instance_context_reference_model_json['resource_type'] = 'network_interface'
- network_interface_instance_context_reference_model_json['subnet'] = subnet_reference_model
+ virtual_network_interface_reference_attachment_context_model = {} # VirtualNetworkInterfaceReferenceAttachmentContext
+ virtual_network_interface_reference_attachment_context_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9'
+ virtual_network_interface_reference_attachment_context_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9'
+ virtual_network_interface_reference_attachment_context_model['id'] = '0767-fa41aecb-4f21-423d-8082-630bfba1e1d9'
+ virtual_network_interface_reference_attachment_context_model['name'] = 'my-virtual-network-interface'
+ virtual_network_interface_reference_attachment_context_model['resource_type'] = 'virtual_network_interface'
- # 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
+ vpc_reference_deleted_model = {} # VPCReferenceDeleted
+ vpc_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # 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)
+ vpc_reference_model = {} # VPCReference
+ vpc_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b'
+ vpc_reference_model['deleted'] = vpc_reference_deleted_model
+ vpc_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b'
+ vpc_reference_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b'
+ vpc_reference_model['name'] = 'my-vpc'
+ vpc_reference_model['resource_type'] = 'vpc'
+
+ share_mount_target_model = {} # ShareMountTarget
+ share_mount_target_model['access_control_mode'] = 'security_group'
+ share_mount_target_model['created_at'] = '2019-01-01T12:00:00Z'
+ share_mount_target_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c'
+ share_mount_target_model['id'] = '4cf9171a-0043-4434-8727-15b53dbc374c'
+ share_mount_target_model['lifecycle_state'] = 'stable'
+ share_mount_target_model['mount_path'] = '10.240.1.23:/nxg_s_voll_mz7121_58e7e963_8f4b_4a0c_b71a_8ba8d9cd1e2e'
+ share_mount_target_model['name'] = 'my-share-mount-target'
+ share_mount_target_model['primary_ip'] = reserved_ip_reference_model
+ share_mount_target_model['resource_type'] = 'share_mount_target'
+ share_mount_target_model['subnet'] = subnet_reference_model
+ share_mount_target_model['transit_encryption'] = 'none'
+ share_mount_target_model['virtual_network_interface'] = virtual_network_interface_reference_attachment_context_model
+ share_mount_target_model['vpc'] = vpc_reference_model
+
+ share_mount_target_collection_next_model = {} # ShareMountTargetCollectionNext
+ share_mount_target_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
+
+ # Construct a json representation of a ShareMountTargetCollection model
+ share_mount_target_collection_model_json = {}
+ share_mount_target_collection_model_json['first'] = share_mount_target_collection_first_model
+ share_mount_target_collection_model_json['limit'] = 20
+ share_mount_target_collection_model_json['mount_targets'] = [share_mount_target_model]
+ share_mount_target_collection_model_json['next'] = share_mount_target_collection_next_model
+ share_mount_target_collection_model_json['total_count'] = 132
+
+ # Construct a model instance of ShareMountTargetCollection by calling from_dict on the json representation
+ share_mount_target_collection_model = ShareMountTargetCollection.from_dict(share_mount_target_collection_model_json)
+ assert share_mount_target_collection_model != False
+
+ # Construct a model instance of ShareMountTargetCollection by calling from_dict on the json representation
+ share_mount_target_collection_model_dict = ShareMountTargetCollection.from_dict(share_mount_target_collection_model_json).__dict__
+ share_mount_target_collection_model2 = ShareMountTargetCollection(**share_mount_target_collection_model_dict)
# Verify the model instances are equivalent
- assert network_interface_instance_context_reference_model == network_interface_instance_context_reference_model2
+ assert share_mount_target_collection_model == share_mount_target_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
+ share_mount_target_collection_model_json2 = share_mount_target_collection_model.to_dict()
+ assert share_mount_target_collection_model_json2 == share_mount_target_collection_model_json
-class TestModel_NetworkInterfaceInstanceContextReferenceDeleted:
+class TestModel_ShareMountTargetCollectionFirst:
"""
- Test Class for NetworkInterfaceInstanceContextReferenceDeleted
+ Test Class for ShareMountTargetCollectionFirst
"""
- def test_network_interface_instance_context_reference_deleted_serialization(self):
+ def test_share_mount_target_collection_first_serialization(self):
"""
- Test serialization/deserialization for NetworkInterfaceInstanceContextReferenceDeleted
+ Test serialization/deserialization for ShareMountTargetCollectionFirst
"""
- # 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 json representation of a ShareMountTargetCollectionFirst model
+ share_mount_target_collection_first_model_json = {}
+ share_mount_target_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets?limit=20'
- # Construct a model instance of 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 ShareMountTargetCollectionFirst by calling from_dict on the json representation
+ share_mount_target_collection_first_model = ShareMountTargetCollectionFirst.from_dict(share_mount_target_collection_first_model_json)
+ assert share_mount_target_collection_first_model != False
- # Construct a model instance of 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)
+ # Construct a model instance of ShareMountTargetCollectionFirst by calling from_dict on the json representation
+ share_mount_target_collection_first_model_dict = ShareMountTargetCollectionFirst.from_dict(share_mount_target_collection_first_model_json).__dict__
+ share_mount_target_collection_first_model2 = ShareMountTargetCollectionFirst(**share_mount_target_collection_first_model_dict)
# Verify the model instances are equivalent
- assert network_interface_instance_context_reference_deleted_model == network_interface_instance_context_reference_deleted_model2
+ assert share_mount_target_collection_first_model == share_mount_target_collection_first_model2
# Convert model instance back to dict and verify no loss of data
- 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
+ share_mount_target_collection_first_model_json2 = share_mount_target_collection_first_model.to_dict()
+ assert share_mount_target_collection_first_model_json2 == share_mount_target_collection_first_model_json
-class TestModel_NetworkInterfacePatch:
+class TestModel_ShareMountTargetCollectionNext:
"""
- Test Class for NetworkInterfacePatch
+ Test Class for ShareMountTargetCollectionNext
"""
- def test_network_interface_patch_serialization(self):
+ def test_share_mount_target_collection_next_serialization(self):
"""
- Test serialization/deserialization for NetworkInterfacePatch
+ Test serialization/deserialization for ShareMountTargetCollectionNext
"""
- # 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-instance-network-interface'
+ # Construct a json representation of a ShareMountTargetCollectionNext model
+ share_mount_target_collection_next_model_json = {}
+ share_mount_target_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
- # Construct a model instance of 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 ShareMountTargetCollectionNext by calling from_dict on the json representation
+ share_mount_target_collection_next_model = ShareMountTargetCollectionNext.from_dict(share_mount_target_collection_next_model_json)
+ assert share_mount_target_collection_next_model != False
- # Construct a model instance of 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 ShareMountTargetCollectionNext by calling from_dict on the json representation
+ share_mount_target_collection_next_model_dict = ShareMountTargetCollectionNext.from_dict(share_mount_target_collection_next_model_json).__dict__
+ share_mount_target_collection_next_model2 = ShareMountTargetCollectionNext(**share_mount_target_collection_next_model_dict)
# Verify the model instances are equivalent
- assert network_interface_patch_model == network_interface_patch_model2
+ assert share_mount_target_collection_next_model == share_mount_target_collection_next_model2
# Convert model instance back to dict and verify no loss of data
- network_interface_patch_model_json2 = network_interface_patch_model.to_dict()
- assert network_interface_patch_model_json2 == network_interface_patch_model_json
+ share_mount_target_collection_next_model_json2 = share_mount_target_collection_next_model.to_dict()
+ assert share_mount_target_collection_next_model_json2 == share_mount_target_collection_next_model_json
-class TestModel_NetworkInterfacePrototype:
+class TestModel_ShareMountTargetPatch:
"""
- Test Class for NetworkInterfacePrototype
+ Test Class for ShareMountTargetPatch
"""
- def test_network_interface_prototype_serialization(self):
+ def test_share_mount_target_patch_serialization(self):
"""
- Test serialization/deserialization for NetworkInterfacePrototype
+ Test serialization/deserialization for ShareMountTargetPatch
+ """
+
+ # Construct a json representation of a ShareMountTargetPatch model
+ share_mount_target_patch_model_json = {}
+ share_mount_target_patch_model_json['name'] = 'my-share-mount-target'
+
+ # Construct a model instance of ShareMountTargetPatch by calling from_dict on the json representation
+ share_mount_target_patch_model = ShareMountTargetPatch.from_dict(share_mount_target_patch_model_json)
+ assert share_mount_target_patch_model != False
+
+ # Construct a model instance of ShareMountTargetPatch by calling from_dict on the json representation
+ share_mount_target_patch_model_dict = ShareMountTargetPatch.from_dict(share_mount_target_patch_model_json).__dict__
+ share_mount_target_patch_model2 = ShareMountTargetPatch(**share_mount_target_patch_model_dict)
+
+ # Verify the model instances are equivalent
+ assert share_mount_target_patch_model == share_mount_target_patch_model2
+
+ # Convert model instance back to dict and verify no loss of data
+ share_mount_target_patch_model_json2 = share_mount_target_patch_model.to_dict()
+ assert share_mount_target_patch_model_json2 == share_mount_target_patch_model_json
+
+
+class TestModel_ShareMountTargetReference:
+ """
+ Test Class for ShareMountTargetReference
+ """
+
+ def test_share_mount_target_reference_serialization(self):
+ """
+ Test serialization/deserialization for ShareMountTargetReference
"""
# Construct dict forms of any model objects needed in order to build this model.
- network_interface_ip_prototype_model = {} # NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext
- network_interface_ip_prototype_model['address'] = '10.0.0.5'
- network_interface_ip_prototype_model['auto_delete'] = False
- network_interface_ip_prototype_model['name'] = 'my-reserved-ip'
+ share_mount_target_reference_deleted_model = {} # ShareMountTargetReferenceDeleted
+ share_mount_target_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- security_group_identity_model = {} # SecurityGroupIdentityById
- security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271'
+ # Construct a json representation of a ShareMountTargetReference model
+ share_mount_target_reference_model_json = {}
+ share_mount_target_reference_model_json['deleted'] = share_mount_target_reference_deleted_model
+ share_mount_target_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c'
+ share_mount_target_reference_model_json['id'] = '4cf9171a-0043-4434-8727-15b53dbc374c'
+ share_mount_target_reference_model_json['name'] = 'my-share-mount-target'
+ share_mount_target_reference_model_json['resource_type'] = 'share_mount_target'
- subnet_identity_model = {} # SubnetIdentityById
- subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
+ # Construct a model instance of ShareMountTargetReference by calling from_dict on the json representation
+ share_mount_target_reference_model = ShareMountTargetReference.from_dict(share_mount_target_reference_model_json)
+ assert share_mount_target_reference_model != False
- # Construct a 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-instance-network-interface'
- network_interface_prototype_model_json['primary_ip'] = network_interface_ip_prototype_model
- network_interface_prototype_model_json['security_groups'] = [security_group_identity_model]
- network_interface_prototype_model_json['subnet'] = subnet_identity_model
+ # Construct a model instance of ShareMountTargetReference by calling from_dict on the json representation
+ share_mount_target_reference_model_dict = ShareMountTargetReference.from_dict(share_mount_target_reference_model_json).__dict__
+ share_mount_target_reference_model2 = ShareMountTargetReference(**share_mount_target_reference_model_dict)
- # 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
+ # Verify the model instances are equivalent
+ assert share_mount_target_reference_model == share_mount_target_reference_model2
- # 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)
+ # Convert model instance back to dict and verify no loss of data
+ share_mount_target_reference_model_json2 = share_mount_target_reference_model.to_dict()
+ assert share_mount_target_reference_model_json2 == share_mount_target_reference_model_json
+
+
+class TestModel_ShareMountTargetReferenceDeleted:
+ """
+ Test Class for ShareMountTargetReferenceDeleted
+ """
+
+ def test_share_mount_target_reference_deleted_serialization(self):
+ """
+ Test serialization/deserialization for ShareMountTargetReferenceDeleted
+ """
+
+ # Construct a json representation of a ShareMountTargetReferenceDeleted model
+ share_mount_target_reference_deleted_model_json = {}
+ share_mount_target_reference_deleted_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+
+ # Construct a model instance of ShareMountTargetReferenceDeleted by calling from_dict on the json representation
+ share_mount_target_reference_deleted_model = ShareMountTargetReferenceDeleted.from_dict(share_mount_target_reference_deleted_model_json)
+ assert share_mount_target_reference_deleted_model != False
+
+ # Construct a model instance of ShareMountTargetReferenceDeleted by calling from_dict on the json representation
+ share_mount_target_reference_deleted_model_dict = ShareMountTargetReferenceDeleted.from_dict(share_mount_target_reference_deleted_model_json).__dict__
+ share_mount_target_reference_deleted_model2 = ShareMountTargetReferenceDeleted(**share_mount_target_reference_deleted_model_dict)
# Verify the model instances are equivalent
- assert network_interface_prototype_model == network_interface_prototype_model2
+ assert share_mount_target_reference_deleted_model == share_mount_target_reference_deleted_model2
# Convert model instance back to dict and verify no loss of data
- network_interface_prototype_model_json2 = network_interface_prototype_model.to_dict()
- assert network_interface_prototype_model_json2 == network_interface_prototype_model_json
+ share_mount_target_reference_deleted_model_json2 = share_mount_target_reference_deleted_model.to_dict()
+ assert share_mount_target_reference_deleted_model_json2 == share_mount_target_reference_deleted_model_json
-class TestModel_NetworkInterfaceReferenceDeleted:
+class TestModel_SharePatch:
"""
- Test Class for NetworkInterfaceReferenceDeleted
+ Test Class for SharePatch
"""
- def test_network_interface_reference_deleted_serialization(self):
+ def test_share_patch_serialization(self):
"""
- Test serialization/deserialization for NetworkInterfaceReferenceDeleted
+ Test serialization/deserialization for SharePatch
"""
- # 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 dict forms of any model objects needed in order to build this model.
- # 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
+ share_profile_identity_model = {} # ShareProfileIdentityByName
+ share_profile_identity_model['name'] = 'tier-3iops'
- # 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 json representation of a SharePatch model
+ share_patch_model_json = {}
+ share_patch_model_json['access_control_mode'] = 'security_group'
+ share_patch_model_json['iops'] = 100
+ share_patch_model_json['name'] = 'my-share'
+ share_patch_model_json['profile'] = share_profile_identity_model
+ share_patch_model_json['replication_cron_spec'] = '0 */5 * * *'
+ share_patch_model_json['size'] = 200
+ share_patch_model_json['user_tags'] = ['testString']
+
+ # Construct a model instance of SharePatch by calling from_dict on the json representation
+ share_patch_model = SharePatch.from_dict(share_patch_model_json)
+ assert share_patch_model != False
+
+ # Construct a model instance of SharePatch by calling from_dict on the json representation
+ share_patch_model_dict = SharePatch.from_dict(share_patch_model_json).__dict__
+ share_patch_model2 = SharePatch(**share_patch_model_dict)
# Verify the model instances are equivalent
- assert network_interface_reference_deleted_model == network_interface_reference_deleted_model2
+ assert share_patch_model == share_patch_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
+ share_patch_model_json2 = share_patch_model.to_dict()
+ assert share_patch_model_json2 == share_patch_model_json
-class TestModel_NetworkInterfaceReferenceTargetContextDeleted:
+class TestModel_ShareProfile:
"""
- Test Class for NetworkInterfaceReferenceTargetContextDeleted
+ Test Class for ShareProfile
"""
- def test_network_interface_reference_target_context_deleted_serialization(self):
+ def test_share_profile_serialization(self):
"""
- Test serialization/deserialization for NetworkInterfaceReferenceTargetContextDeleted
+ Test serialization/deserialization for ShareProfile
"""
- # 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 dict forms of any model objects needed in order to build this model.
- # 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
+ share_profile_capacity_model = {} # ShareProfileCapacityFixed
+ share_profile_capacity_model['type'] = 'fixed'
+ share_profile_capacity_model['value'] = 4800
- # 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)
+ share_profile_iops_model = {} # ShareProfileIOPSFixed
+ share_profile_iops_model['type'] = 'fixed'
+ share_profile_iops_model['value'] = 4000
+
+ # Construct a json representation of a ShareProfile model
+ share_profile_model_json = {}
+ share_profile_model_json['capacity'] = share_profile_capacity_model
+ share_profile_model_json['family'] = 'defined_performance'
+ share_profile_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops'
+ share_profile_model_json['iops'] = share_profile_iops_model
+ share_profile_model_json['name'] = 'tier-3iops'
+ share_profile_model_json['resource_type'] = 'share_profile'
+
+ # Construct a model instance of ShareProfile by calling from_dict on the json representation
+ share_profile_model = ShareProfile.from_dict(share_profile_model_json)
+ assert share_profile_model != False
+
+ # Construct a model instance of ShareProfile by calling from_dict on the json representation
+ share_profile_model_dict = ShareProfile.from_dict(share_profile_model_json).__dict__
+ share_profile_model2 = ShareProfile(**share_profile_model_dict)
# Verify the model instances are equivalent
- assert network_interface_reference_target_context_deleted_model == network_interface_reference_target_context_deleted_model2
+ assert share_profile_model == share_profile_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
+ share_profile_model_json2 = share_profile_model.to_dict()
+ assert share_profile_model_json2 == share_profile_model_json
-class TestModel_NetworkInterfaceUnpaginatedCollection:
+class TestModel_ShareProfileCollection:
"""
- Test Class for NetworkInterfaceUnpaginatedCollection
+ Test Class for ShareProfileCollection
"""
- def test_network_interface_unpaginated_collection_serialization(self):
+ def test_share_profile_collection_serialization(self):
"""
- Test serialization/deserialization for NetworkInterfaceUnpaginatedCollection
+ Test serialization/deserialization for ShareProfileCollection
"""
# 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'
+ share_profile_collection_first_model = {} # ShareProfileCollectionFirst
+ share_profile_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/share/profiles?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'
+ share_profile_collection_next_model = {} # ShareProfileCollectionNext
+ share_profile_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/share/profiles?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
- reserved_ip_reference_deleted_model = {} # ReservedIPReferenceDeleted
- reserved_ip_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ share_profile_capacity_model = {} # ShareProfileCapacityFixed
+ share_profile_capacity_model['type'] = 'fixed'
+ share_profile_capacity_model['value'] = 4800
- reserved_ip_reference_model = {} # ReservedIPReference
- reserved_ip_reference_model['address'] = '10.0.0.32'
- reserved_ip_reference_model['deleted'] = reserved_ip_reference_deleted_model
- reserved_ip_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/0716-b28a7e6d-a66b-4de7-8713-15dcffdce401/reserved_ips/0716-7768a27e-cd6c-4a13-a9e6-d67a964e54a5'
- reserved_ip_reference_model['id'] = '0716-7768a27e-cd6c-4a13-a9e6-d67a964e54a5'
- reserved_ip_reference_model['name'] = 'my-reserved-ip-1'
- reserved_ip_reference_model['resource_type'] = 'subnet_reserved_ip'
+ share_profile_iops_model = {} # ShareProfileIOPSFixed
+ share_profile_iops_model['type'] = 'fixed'
+ share_profile_iops_model['value'] = 4000
- security_group_reference_deleted_model = {} # SecurityGroupReferenceDeleted
- security_group_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ share_profile_model = {} # ShareProfile
+ share_profile_model['capacity'] = share_profile_capacity_model
+ share_profile_model['family'] = 'defined_performance'
+ share_profile_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops'
+ share_profile_model['iops'] = share_profile_iops_model
+ share_profile_model['name'] = 'tier-3iops'
+ share_profile_model['resource_type'] = 'share_profile'
- 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 json representation of a ShareProfileCollection model
+ share_profile_collection_model_json = {}
+ share_profile_collection_model_json['first'] = share_profile_collection_first_model
+ share_profile_collection_model_json['limit'] = 20
+ share_profile_collection_model_json['next'] = share_profile_collection_next_model
+ share_profile_collection_model_json['profiles'] = [share_profile_model]
+ share_profile_collection_model_json['total_count'] = 132
- subnet_reference_deleted_model = {} # SubnetReferenceDeleted
- subnet_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ # Construct a model instance of ShareProfileCollection by calling from_dict on the json representation
+ share_profile_collection_model = ShareProfileCollection.from_dict(share_profile_collection_model_json)
+ assert share_profile_collection_model != False
- subnet_reference_model = {} # SubnetReference
- subnet_reference_model['crn'] = 'crn:[...]'
- subnet_reference_model['deleted'] = subnet_reference_deleted_model
- subnet_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/9270d819-c05e-4352-99e4-80c4680cdb7c'
- subnet_reference_model['id'] = '9270d819-c05e-4352-99e4-80c4680cdb7c'
- subnet_reference_model['name'] = 'my-subnet'
- subnet_reference_model['resource_type'] = 'subnet'
+ # Construct a model instance of ShareProfileCollection by calling from_dict on the json representation
+ share_profile_collection_model_dict = ShareProfileCollection.from_dict(share_profile_collection_model_json).__dict__
+ share_profile_collection_model2 = ShareProfileCollection(**share_profile_collection_model_dict)
- 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_ip'] = reserved_ip_reference_model
- network_interface_model['resource_type'] = 'network_interface'
- network_interface_model['security_groups'] = [security_group_reference_model]
- network_interface_model['status'] = 'available'
- network_interface_model['subnet'] = subnet_reference_model
- network_interface_model['type'] = 'primary'
+ # Verify the model instances are equivalent
+ assert share_profile_collection_model == share_profile_collection_model2
- # 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]
+ # Convert model instance back to dict and verify no loss of data
+ share_profile_collection_model_json2 = share_profile_collection_model.to_dict()
+ assert share_profile_collection_model_json2 == share_profile_collection_model_json
- # 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 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)
+class TestModel_ShareProfileCollectionFirst:
+ """
+ Test Class for ShareProfileCollectionFirst
+ """
+
+ def test_share_profile_collection_first_serialization(self):
+ """
+ Test serialization/deserialization for ShareProfileCollectionFirst
+ """
+
+ # Construct a json representation of a ShareProfileCollectionFirst model
+ share_profile_collection_first_model_json = {}
+ share_profile_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/share/profiles?limit=20'
+
+ # Construct a model instance of ShareProfileCollectionFirst by calling from_dict on the json representation
+ share_profile_collection_first_model = ShareProfileCollectionFirst.from_dict(share_profile_collection_first_model_json)
+ assert share_profile_collection_first_model != False
+
+ # Construct a model instance of ShareProfileCollectionFirst by calling from_dict on the json representation
+ share_profile_collection_first_model_dict = ShareProfileCollectionFirst.from_dict(share_profile_collection_first_model_json).__dict__
+ share_profile_collection_first_model2 = ShareProfileCollectionFirst(**share_profile_collection_first_model_dict)
# Verify the model instances are equivalent
- assert network_interface_unpaginated_collection_model == network_interface_unpaginated_collection_model2
+ assert share_profile_collection_first_model == share_profile_collection_first_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
+ share_profile_collection_first_model_json2 = share_profile_collection_first_model.to_dict()
+ assert share_profile_collection_first_model_json2 == share_profile_collection_first_model_json
-class TestModel_OperatingSystem:
+class TestModel_ShareProfileCollectionNext:
"""
- Test Class for OperatingSystem
+ Test Class for ShareProfileCollectionNext
+ """
+
+ def test_share_profile_collection_next_serialization(self):
+ """
+ Test serialization/deserialization for ShareProfileCollectionNext
+ """
+
+ # Construct a json representation of a ShareProfileCollectionNext model
+ share_profile_collection_next_model_json = {}
+ share_profile_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/share/profiles?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
+
+ # Construct a model instance of ShareProfileCollectionNext by calling from_dict on the json representation
+ share_profile_collection_next_model = ShareProfileCollectionNext.from_dict(share_profile_collection_next_model_json)
+ assert share_profile_collection_next_model != False
+
+ # Construct a model instance of ShareProfileCollectionNext by calling from_dict on the json representation
+ share_profile_collection_next_model_dict = ShareProfileCollectionNext.from_dict(share_profile_collection_next_model_json).__dict__
+ share_profile_collection_next_model2 = ShareProfileCollectionNext(**share_profile_collection_next_model_dict)
+
+ # Verify the model instances are equivalent
+ assert share_profile_collection_next_model == share_profile_collection_next_model2
+
+ # Convert model instance back to dict and verify no loss of data
+ share_profile_collection_next_model_json2 = share_profile_collection_next_model.to_dict()
+ assert share_profile_collection_next_model_json2 == share_profile_collection_next_model_json
+
+
+class TestModel_ShareProfileReference:
+ """
+ Test Class for ShareProfileReference
"""
- def test_operating_system_serialization(self):
+ def test_share_profile_reference_serialization(self):
"""
- Test serialization/deserialization for OperatingSystem
+ Test serialization/deserialization for ShareProfileReference
"""
- # 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 ShareProfileReference model
+ share_profile_reference_model_json = {}
+ share_profile_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops'
+ share_profile_reference_model_json['name'] = 'tier-3iops'
+ share_profile_reference_model_json['resource_type'] = 'share_profile'
- # Construct a model instance of 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 ShareProfileReference by calling from_dict on the json representation
+ share_profile_reference_model = ShareProfileReference.from_dict(share_profile_reference_model_json)
+ assert share_profile_reference_model != False
- # Construct a model instance of 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 ShareProfileReference by calling from_dict on the json representation
+ share_profile_reference_model_dict = ShareProfileReference.from_dict(share_profile_reference_model_json).__dict__
+ share_profile_reference_model2 = ShareProfileReference(**share_profile_reference_model_dict)
# Verify the model instances are equivalent
- assert operating_system_model == operating_system_model2
+ assert share_profile_reference_model == share_profile_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
+ share_profile_reference_model_json2 = share_profile_reference_model.to_dict()
+ assert share_profile_reference_model_json2 == share_profile_reference_model_json
-class TestModel_OperatingSystemCollection:
+class TestModel_SharePrototypeShareContext:
"""
- Test Class for OperatingSystemCollection
+ Test Class for SharePrototypeShareContext
"""
- def test_operating_system_collection_serialization(self):
+ def test_share_prototype_share_context_serialization(self):
"""
- Test serialization/deserialization for OperatingSystemCollection
+ Test serialization/deserialization for SharePrototypeShareContext
"""
# 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'
+ virtual_network_interface_ip_prototype_model = {} # VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext
+ virtual_network_interface_ip_prototype_model['address'] = '10.0.0.5'
+ virtual_network_interface_ip_prototype_model['auto_delete'] = False
+ virtual_network_interface_ip_prototype_model['name'] = 'my-reserved-ip'
- 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'
+ virtual_network_interface_primary_ip_prototype_model = {} # VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext
+ virtual_network_interface_primary_ip_prototype_model['address'] = '10.0.0.5'
+ virtual_network_interface_primary_ip_prototype_model['auto_delete'] = False
+ virtual_network_interface_primary_ip_prototype_model['name'] = 'my-reserved-ip'
- 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_identity_model = {} # ResourceGroupIdentityById
+ resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
- # 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]
- operating_system_collection_model_json['total_count'] = 132
+ security_group_identity_model = {} # SecurityGroupIdentityById
+ security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271'
- # 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
+ subnet_identity_model = {} # SubnetIdentityById
+ subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
- # 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)
+ share_mount_target_virtual_network_interface_prototype_model = {} # ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfacePrototypeShareMountTargetContext
+ share_mount_target_virtual_network_interface_prototype_model['allow_ip_spoofing'] = True
+ share_mount_target_virtual_network_interface_prototype_model['auto_delete'] = False
+ share_mount_target_virtual_network_interface_prototype_model['enable_infrastructure_nat'] = True
+ share_mount_target_virtual_network_interface_prototype_model['ips'] = [virtual_network_interface_ip_prototype_model]
+ share_mount_target_virtual_network_interface_prototype_model['name'] = 'my-virtual-network-interface'
+ share_mount_target_virtual_network_interface_prototype_model['primary_ip'] = virtual_network_interface_primary_ip_prototype_model
+ share_mount_target_virtual_network_interface_prototype_model['resource_group'] = resource_group_identity_model
+ share_mount_target_virtual_network_interface_prototype_model['security_groups'] = [security_group_identity_model]
+ share_mount_target_virtual_network_interface_prototype_model['subnet'] = subnet_identity_model
+
+ share_mount_target_prototype_model = {} # ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup
+ share_mount_target_prototype_model['name'] = 'my-share-mount-target'
+ share_mount_target_prototype_model['transit_encryption'] = 'none'
+ share_mount_target_prototype_model['virtual_network_interface'] = share_mount_target_virtual_network_interface_prototype_model
+
+ share_profile_identity_model = {} # ShareProfileIdentityByName
+ share_profile_identity_model['name'] = 'tier-3iops'
+
+ zone_identity_model = {} # ZoneIdentityByName
+ zone_identity_model['name'] = 'us-south-1'
+
+ # Construct a json representation of a SharePrototypeShareContext model
+ share_prototype_share_context_model_json = {}
+ share_prototype_share_context_model_json['iops'] = 100
+ share_prototype_share_context_model_json['mount_targets'] = [share_mount_target_prototype_model]
+ share_prototype_share_context_model_json['name'] = 'my-share'
+ share_prototype_share_context_model_json['profile'] = share_profile_identity_model
+ share_prototype_share_context_model_json['replication_cron_spec'] = '0 */5 * * *'
+ share_prototype_share_context_model_json['resource_group'] = resource_group_identity_model
+ share_prototype_share_context_model_json['user_tags'] = []
+ share_prototype_share_context_model_json['zone'] = zone_identity_model
+
+ # Construct a model instance of SharePrototypeShareContext by calling from_dict on the json representation
+ share_prototype_share_context_model = SharePrototypeShareContext.from_dict(share_prototype_share_context_model_json)
+ assert share_prototype_share_context_model != False
+
+ # Construct a model instance of SharePrototypeShareContext by calling from_dict on the json representation
+ share_prototype_share_context_model_dict = SharePrototypeShareContext.from_dict(share_prototype_share_context_model_json).__dict__
+ share_prototype_share_context_model2 = SharePrototypeShareContext(**share_prototype_share_context_model_dict)
# Verify the model instances are equivalent
- assert operating_system_collection_model == operating_system_collection_model2
+ assert share_prototype_share_context_model == share_prototype_share_context_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
+ share_prototype_share_context_model_json2 = share_prototype_share_context_model.to_dict()
+ assert share_prototype_share_context_model_json2 == share_prototype_share_context_model_json
-class TestModel_OperatingSystemCollectionFirst:
+class TestModel_ShareReference:
"""
- Test Class for OperatingSystemCollectionFirst
+ Test Class for ShareReference
"""
- def test_operating_system_collection_first_serialization(self):
+ def test_share_reference_serialization(self):
"""
- Test serialization/deserialization for OperatingSystemCollectionFirst
+ Test serialization/deserialization for ShareReference
"""
- # 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 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 = OperatingSystemCollectionFirst.from_dict(operating_system_collection_first_model_json)
- assert operating_system_collection_first_model != False
+ share_reference_deleted_model = {} # ShareReferenceDeleted
+ share_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # 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)
+ 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'
+
+ share_remote_model = {} # ShareRemote
+ share_remote_model['region'] = region_reference_model
+
+ # Construct a json representation of a ShareReference model
+ share_reference_model_json = {}
+ share_reference_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58'
+ share_reference_model_json['deleted'] = share_reference_deleted_model
+ share_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58'
+ share_reference_model_json['id'] = '0fe9e5d8-0a4d-4818-96ec-e99708644a58'
+ share_reference_model_json['name'] = 'my-share'
+ share_reference_model_json['remote'] = share_remote_model
+ share_reference_model_json['resource_type'] = 'share'
+
+ # Construct a model instance of ShareReference by calling from_dict on the json representation
+ share_reference_model = ShareReference.from_dict(share_reference_model_json)
+ assert share_reference_model != False
+
+ # Construct a model instance of ShareReference by calling from_dict on the json representation
+ share_reference_model_dict = ShareReference.from_dict(share_reference_model_json).__dict__
+ share_reference_model2 = ShareReference(**share_reference_model_dict)
# Verify the model instances are equivalent
- assert operating_system_collection_first_model == operating_system_collection_first_model2
+ assert share_reference_model == share_reference_model2
# 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
+ share_reference_model_json2 = share_reference_model.to_dict()
+ assert share_reference_model_json2 == share_reference_model_json
-class TestModel_OperatingSystemCollectionNext:
+class TestModel_ShareReferenceDeleted:
"""
- Test Class for OperatingSystemCollectionNext
+ Test Class for ShareReferenceDeleted
"""
- def test_operating_system_collection_next_serialization(self):
+ def test_share_reference_deleted_serialization(self):
"""
- Test serialization/deserialization for OperatingSystemCollectionNext
+ Test serialization/deserialization for ShareReferenceDeleted
"""
- # 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 ShareReferenceDeleted model
+ share_reference_deleted_model_json = {}
+ share_reference_deleted_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Construct a model instance of 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 ShareReferenceDeleted by calling from_dict on the json representation
+ share_reference_deleted_model = ShareReferenceDeleted.from_dict(share_reference_deleted_model_json)
+ assert share_reference_deleted_model != False
- # Construct a model instance of 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 ShareReferenceDeleted by calling from_dict on the json representation
+ share_reference_deleted_model_dict = ShareReferenceDeleted.from_dict(share_reference_deleted_model_json).__dict__
+ share_reference_deleted_model2 = ShareReferenceDeleted(**share_reference_deleted_model_dict)
# Verify the model instances are equivalent
- assert operating_system_collection_next_model == operating_system_collection_next_model2
+ assert share_reference_deleted_model == share_reference_deleted_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
+ share_reference_deleted_model_json2 = share_reference_deleted_model.to_dict()
+ assert share_reference_deleted_model_json2 == share_reference_deleted_model_json
-class TestModel_PlacementGroup:
+class TestModel_ShareRemote:
"""
- Test Class for PlacementGroup
+ Test Class for ShareRemote
"""
- def test_placement_group_serialization(self):
+ def test_share_remote_serialization(self):
"""
- Test serialization/deserialization for PlacementGroup
+ Test serialization/deserialization for ShareRemote
"""
# 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'
+ 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 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 ShareRemote model
+ share_remote_model_json = {}
+ share_remote_model_json['region'] = region_reference_model
- # 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 ShareRemote by calling from_dict on the json representation
+ share_remote_model = ShareRemote.from_dict(share_remote_model_json)
+ assert share_remote_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 ShareRemote by calling from_dict on the json representation
+ share_remote_model_dict = ShareRemote.from_dict(share_remote_model_json).__dict__
+ share_remote_model2 = ShareRemote(**share_remote_model_dict)
# Verify the model instances are equivalent
- assert placement_group_model == placement_group_model2
+ assert share_remote_model == share_remote_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
+ share_remote_model_json2 = share_remote_model.to_dict()
+ assert share_remote_model_json2 == share_remote_model_json
-class TestModel_PlacementGroupCollection:
+class TestModel_ShareReplicationStatusReason:
"""
- Test Class for PlacementGroupCollection
+ Test Class for ShareReplicationStatusReason
"""
- def test_placement_group_collection_serialization(self):
+ def test_share_replication_status_reason_serialization(self):
"""
- Test serialization/deserialization for PlacementGroupCollection
+ Test serialization/deserialization for ShareReplicationStatusReason
"""
- # 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 ShareReplicationStatusReason model
+ share_replication_status_reason_model_json = {}
+ share_replication_status_reason_model_json['code'] = 'cannot_reach_source_share'
+ share_replication_status_reason_model_json['message'] = 'The replication failover failed because the source share cannot be reached.'
+ share_replication_status_reason_model_json['more_info'] = 'https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning'
- # Construct a model instance of 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 ShareReplicationStatusReason by calling from_dict on the json representation
+ share_replication_status_reason_model = ShareReplicationStatusReason.from_dict(share_replication_status_reason_model_json)
+ assert share_replication_status_reason_model != False
- # Construct a model instance of 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 ShareReplicationStatusReason by calling from_dict on the json representation
+ share_replication_status_reason_model_dict = ShareReplicationStatusReason.from_dict(share_replication_status_reason_model_json).__dict__
+ share_replication_status_reason_model2 = ShareReplicationStatusReason(**share_replication_status_reason_model_dict)
# Verify the model instances are equivalent
- assert placement_group_collection_model == placement_group_collection_model2
+ assert share_replication_status_reason_model == share_replication_status_reason_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
+ share_replication_status_reason_model_json2 = share_replication_status_reason_model.to_dict()
+ assert share_replication_status_reason_model_json2 == share_replication_status_reason_model_json
-class TestModel_PlacementGroupCollectionFirst:
+class TestModel_Snapshot:
"""
- Test Class for PlacementGroupCollectionFirst
+ Test Class for Snapshot
"""
- def test_placement_group_collection_first_serialization(self):
+ def test_snapshot_serialization(self):
"""
- Test serialization/deserialization for PlacementGroupCollectionFirst
+ Test serialization/deserialization for Snapshot
"""
- # 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
+ backup_policy_plan_reference_deleted_model = {} # BackupPolicyPlanReferenceDeleted
+ backup_policy_plan_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # 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)
+ 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'
- # Verify the model instances are equivalent
- assert placement_group_collection_first_model == placement_group_collection_first_model2
+ backup_policy_plan_remote_model = {} # BackupPolicyPlanRemote
+ backup_policy_plan_remote_model['region'] = region_reference_model
- # 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
+ backup_policy_plan_reference_model = {} # BackupPolicyPlanReference
+ backup_policy_plan_reference_model['deleted'] = backup_policy_plan_reference_deleted_model
+ backup_policy_plan_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178'
+ backup_policy_plan_reference_model['id'] = 'r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178'
+ backup_policy_plan_reference_model['name'] = 'my-policy-plan'
+ backup_policy_plan_reference_model['remote'] = backup_policy_plan_remote_model
+ backup_policy_plan_reference_model['resource_type'] = 'backup_policy_plan'
+ 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_PlacementGroupCollectionNext:
- """
- Test Class for PlacementGroupCollectionNext
- """
+ snapshot_clone_model = {} # SnapshotClone
+ snapshot_clone_model['available'] = True
+ snapshot_clone_model['created_at'] = '2019-01-01T12:00:00Z'
+ snapshot_clone_model['zone'] = zone_reference_model
- def test_placement_group_collection_next_serialization(self):
- """
- Test serialization/deserialization for PlacementGroupCollectionNext
- """
+ 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 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'
+ snapshot_remote_model = {} # SnapshotRemote
+ snapshot_remote_model['region'] = region_reference_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
+ snapshot_copies_item_model = {} # SnapshotCopiesItem
+ snapshot_copies_item_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263'
+ snapshot_copies_item_model['deleted'] = snapshot_reference_deleted_model
+ snapshot_copies_item_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263'
+ snapshot_copies_item_model['id'] = 'r134-f6bfa329-0e36-433f-a3bb-0df632e79263'
+ snapshot_copies_item_model['name'] = 'my-snapshot'
+ snapshot_copies_item_model['remote'] = snapshot_remote_model
+ snapshot_copies_item_model['resource_type'] = 'snapshot'
- # 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)
+ encryption_key_reference_model = {} # EncryptionKeyReference
+ encryption_key_reference_model['crn'] = 'crn:v1:bluemix:public:kms:us-south:a/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179'
- # Verify the model instances are equivalent
- assert placement_group_collection_next_model == placement_group_collection_next_model2
+ 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'
- # 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
+ 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'
+ snapshot_consistency_group_reference_deleted_model = {} # SnapshotConsistencyGroupReferenceDeleted
+ snapshot_consistency_group_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
-class TestModel_PlacementGroupPatch:
- """
- Test Class for PlacementGroupPatch
- """
+ snapshot_consistency_group_reference_model = {} # SnapshotConsistencyGroupReference
+ snapshot_consistency_group_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::snapshot-consistency-group:r134-fa329f6b-0e36-433f-a3bb-0df632e79263'
+ snapshot_consistency_group_reference_model['deleted'] = snapshot_consistency_group_reference_deleted_model
+ snapshot_consistency_group_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/snapshot_consistency_groups/r134-fa329f6b-0e36-433f-a3bb-0df632e79263'
+ snapshot_consistency_group_reference_model['id'] = 'r134-fa329f6b-0e36-433f-a3bb-0df632e79263'
+ snapshot_consistency_group_reference_model['name'] = 'my-snapshot-consistency-group'
+ snapshot_consistency_group_reference_model['resource_type'] = 'snapshot_consistency_group'
- def test_placement_group_patch_serialization(self):
- """
- Test serialization/deserialization for PlacementGroupPatch
- """
+ 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 PlacementGroupPatch model
- placement_group_patch_model_json = {}
- placement_group_patch_model_json['name'] = 'my-placement-group'
+ account_reference_model = {} # AccountReference
+ account_reference_model['id'] = 'aa2432b1fa4d4ace891e9b80fc104e34'
+ account_reference_model['resource_type'] = 'account'
- # 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
+ image_remote_model = {} # ImageRemote
+ image_remote_model['account'] = account_reference_model
+ image_remote_model['region'] = region_reference_model
- # 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)
+ 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'
+ image_reference_model['remote'] = image_remote_model
+ image_reference_model['resource_type'] = 'image'
+
+ snapshot_source_snapshot_model = {} # SnapshotSourceSnapshot
+ snapshot_source_snapshot_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263'
+ snapshot_source_snapshot_model['deleted'] = snapshot_reference_deleted_model
+ snapshot_source_snapshot_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263'
+ snapshot_source_snapshot_model['id'] = 'r134-f6bfa329-0e36-433f-a3bb-0df632e79263'
+ snapshot_source_snapshot_model['name'] = 'my-snapshot'
+ snapshot_source_snapshot_model['remote'] = snapshot_remote_model
+ snapshot_source_snapshot_model['resource_type'] = 'snapshot'
+
+ volume_reference_deleted_model = {} # VolumeReferenceDeleted
+ volume_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+
+ volume_remote_model = {} # VolumeRemote
+ volume_remote_model['region'] = region_reference_model
+
+ 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'
+ volume_reference_model['remote'] = volume_remote_model
+ volume_reference_model['resource_type'] = 'volume'
+
+ # Construct a json representation of a Snapshot model
+ snapshot_model_json = {}
+ snapshot_model_json['backup_policy_plan'] = backup_policy_plan_reference_model
+ snapshot_model_json['bootable'] = True
+ snapshot_model_json['captured_at'] = '2019-01-01T12:00:00Z'
+ snapshot_model_json['clones'] = [snapshot_clone_model]
+ snapshot_model_json['copies'] = [snapshot_copies_item_model]
+ 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['service_tags'] = ['testString']
+ snapshot_model_json['size'] = 1
+ snapshot_model_json['snapshot_consistency_group'] = snapshot_consistency_group_reference_model
+ snapshot_model_json['source_image'] = image_reference_model
+ snapshot_model_json['source_snapshot'] = snapshot_source_snapshot_model
+ snapshot_model_json['source_volume'] = volume_reference_model
+ snapshot_model_json['user_tags'] = ['testString']
+
+ # Construct a model instance of Snapshot by calling from_dict on the json representation
+ snapshot_model = Snapshot.from_dict(snapshot_model_json)
+ assert snapshot_model != False
+
+ # 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 placement_group_patch_model == placement_group_patch_model2
+ assert snapshot_model == snapshot_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
+ snapshot_model_json2 = snapshot_model.to_dict()
+ assert snapshot_model_json2 == snapshot_model_json
-class TestModel_PlacementGroupReferenceDeleted:
+class TestModel_SnapshotClone:
"""
- Test Class for PlacementGroupReferenceDeleted
+ Test Class for SnapshotClone
"""
- def test_placement_group_reference_deleted_serialization(self):
+ def test_snapshot_clone_serialization(self):
"""
- Test serialization/deserialization for PlacementGroupReferenceDeleted
+ Test serialization/deserialization for SnapshotClone
"""
- # 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
+ 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 SnapshotClone model
+ snapshot_clone_model_json = {}
+ snapshot_clone_model_json['available'] = True
+ snapshot_clone_model_json['created_at'] = '2019-01-01T12:00:00Z'
+ snapshot_clone_model_json['zone'] = zone_reference_model
+
+ # Construct a model instance of SnapshotClone by calling from_dict on the json representation
+ snapshot_clone_model = SnapshotClone.from_dict(snapshot_clone_model_json)
+ assert snapshot_clone_model != False
- # 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)
+ # Construct a model instance of SnapshotClone by calling from_dict on the json representation
+ snapshot_clone_model_dict = SnapshotClone.from_dict(snapshot_clone_model_json).__dict__
+ snapshot_clone_model2 = SnapshotClone(**snapshot_clone_model_dict)
# Verify the model instances are equivalent
- assert placement_group_reference_deleted_model == placement_group_reference_deleted_model2
+ assert snapshot_clone_model == snapshot_clone_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
+ snapshot_clone_model_json2 = snapshot_clone_model.to_dict()
+ assert snapshot_clone_model_json2 == snapshot_clone_model_json
-class TestModel_PublicGateway:
+class TestModel_SnapshotCloneCollection:
"""
- Test Class for PublicGateway
+ Test Class for SnapshotCloneCollection
"""
- def test_public_gateway_serialization(self):
+ def test_snapshot_clone_collection_serialization(self):
"""
- Test serialization/deserialization for PublicGateway
+ Test serialization/deserialization for SnapshotCloneCollection
"""
# 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_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'
- vpc_reference_model['resource_type'] = 'vpc'
-
zone_reference_model = {} # ZoneReference
zone_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1'
zone_reference_model['name'] = 'us-south-1'
- # Construct a json representation of a 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
+ snapshot_clone_model = {} # SnapshotClone
+ snapshot_clone_model['available'] = True
+ snapshot_clone_model['created_at'] = '2019-01-01T12:00:00Z'
+ snapshot_clone_model['zone'] = zone_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 SnapshotCloneCollection model
+ snapshot_clone_collection_model_json = {}
+ snapshot_clone_collection_model_json['clones'] = [snapshot_clone_model]
- # 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 SnapshotCloneCollection by calling from_dict on the json representation
+ snapshot_clone_collection_model = SnapshotCloneCollection.from_dict(snapshot_clone_collection_model_json)
+ assert snapshot_clone_collection_model != False
+
+ # Construct a model instance of SnapshotCloneCollection by calling from_dict on the json representation
+ snapshot_clone_collection_model_dict = SnapshotCloneCollection.from_dict(snapshot_clone_collection_model_json).__dict__
+ snapshot_clone_collection_model2 = SnapshotCloneCollection(**snapshot_clone_collection_model_dict)
# Verify the model instances are equivalent
- assert public_gateway_model == public_gateway_model2
+ assert snapshot_clone_collection_model == snapshot_clone_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
+ snapshot_clone_collection_model_json2 = snapshot_clone_collection_model.to_dict()
+ assert snapshot_clone_collection_model_json2 == snapshot_clone_collection_model_json
-class TestModel_PublicGatewayCollection:
+class TestModel_SnapshotClonePrototype:
"""
- Test Class for PublicGatewayCollection
+ Test Class for SnapshotClonePrototype
"""
- def test_public_gateway_collection_serialization(self):
+ def test_snapshot_clone_prototype_serialization(self):
"""
- Test serialization/deserialization for PublicGatewayCollection
+ Test serialization/deserialization for SnapshotClonePrototype
"""
# Construct dict forms of any model objects needed in order to build this model.
- public_gateway_collection_first_model = {} # PublicGatewayCollectionFirst
- public_gateway_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/public_gateways?limit=20'
+ zone_identity_model = {} # ZoneIdentityByName
+ zone_identity_model['name'] = 'us-south-1'
- 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 json representation of a SnapshotClonePrototype model
+ snapshot_clone_prototype_model_json = {}
+ snapshot_clone_prototype_model_json['zone'] = zone_identity_model
- 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 SnapshotClonePrototype by calling from_dict on the json representation
+ snapshot_clone_prototype_model = SnapshotClonePrototype.from_dict(snapshot_clone_prototype_model_json)
+ assert snapshot_clone_prototype_model != False
- 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'
+ # Construct a model instance of SnapshotClonePrototype by calling from_dict on the json representation
+ snapshot_clone_prototype_model_dict = SnapshotClonePrototype.from_dict(snapshot_clone_prototype_model_json).__dict__
+ snapshot_clone_prototype_model2 = SnapshotClonePrototype(**snapshot_clone_prototype_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 snapshot_clone_prototype_model == snapshot_clone_prototype_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
+ snapshot_clone_prototype_model_json2 = snapshot_clone_prototype_model.to_dict()
+ assert snapshot_clone_prototype_model_json2 == snapshot_clone_prototype_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'
- vpc_reference_model['resource_type'] = 'vpc'
- zone_reference_model = {} # ZoneReference
- zone_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1'
- zone_reference_model['name'] = 'us-south-1'
+class TestModel_SnapshotCollection:
+ """
+ Test Class for SnapshotCollection
+ """
- 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
+ def test_snapshot_collection_serialization(self):
+ """
+ Test serialization/deserialization for SnapshotCollection
+ """
- # 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 dict forms of any model objects needed in order to build this model.
- # 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
+ 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 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)
+ 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 public_gateway_collection_model == public_gateway_collection_model2
+ backup_policy_plan_reference_deleted_model = {} # BackupPolicyPlanReferenceDeleted
+ backup_policy_plan_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
- public_gateway_collection_model_json2 = public_gateway_collection_model.to_dict()
- assert public_gateway_collection_model_json2 == public_gateway_collection_model_json
+ 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'
+ backup_policy_plan_remote_model = {} # BackupPolicyPlanRemote
+ backup_policy_plan_remote_model['region'] = region_reference_model
-class TestModel_PublicGatewayCollectionFirst:
- """
- Test Class for PublicGatewayCollectionFirst
- """
+ backup_policy_plan_reference_model = {} # BackupPolicyPlanReference
+ backup_policy_plan_reference_model['deleted'] = backup_policy_plan_reference_deleted_model
+ backup_policy_plan_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178'
+ backup_policy_plan_reference_model['id'] = 'r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178'
+ backup_policy_plan_reference_model['name'] = 'my-policy-plan'
+ backup_policy_plan_reference_model['remote'] = backup_policy_plan_remote_model
+ backup_policy_plan_reference_model['resource_type'] = 'backup_policy_plan'
- def test_public_gateway_collection_first_serialization(self):
- """
- Test serialization/deserialization for PublicGatewayCollectionFirst
- """
+ 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 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'
+ snapshot_clone_model = {} # SnapshotClone
+ snapshot_clone_model['available'] = True
+ snapshot_clone_model['created_at'] = '2019-01-01T12:00:00Z'
+ snapshot_clone_model['zone'] = zone_reference_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
+ snapshot_reference_deleted_model = {} # SnapshotReferenceDeleted
+ snapshot_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)
+ snapshot_remote_model = {} # SnapshotRemote
+ snapshot_remote_model['region'] = region_reference_model
- # Verify the model instances are equivalent
- assert public_gateway_collection_first_model == public_gateway_collection_first_model2
+ snapshot_copies_item_model = {} # SnapshotCopiesItem
+ snapshot_copies_item_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263'
+ snapshot_copies_item_model['deleted'] = snapshot_reference_deleted_model
+ snapshot_copies_item_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263'
+ snapshot_copies_item_model['id'] = 'r134-f6bfa329-0e36-433f-a3bb-0df632e79263'
+ snapshot_copies_item_model['name'] = 'my-snapshot'
+ snapshot_copies_item_model['remote'] = snapshot_remote_model
+ snapshot_copies_item_model['resource_type'] = 'snapshot'
- # 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
+ encryption_key_reference_model = {} # EncryptionKeyReference
+ encryption_key_reference_model['crn'] = 'crn:v1:bluemix:public:kms:us-south:a/123456: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'
-class TestModel_PublicGatewayCollectionNext:
- """
- Test Class for PublicGatewayCollectionNext
- """
+ 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_public_gateway_collection_next_serialization(self):
- """
- Test serialization/deserialization for PublicGatewayCollectionNext
- """
+ snapshot_consistency_group_reference_deleted_model = {} # SnapshotConsistencyGroupReferenceDeleted
+ snapshot_consistency_group_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # 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'
+ snapshot_consistency_group_reference_model = {} # SnapshotConsistencyGroupReference
+ snapshot_consistency_group_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::snapshot-consistency-group:r134-fa329f6b-0e36-433f-a3bb-0df632e79263'
+ snapshot_consistency_group_reference_model['deleted'] = snapshot_consistency_group_reference_deleted_model
+ snapshot_consistency_group_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/snapshot_consistency_groups/r134-fa329f6b-0e36-433f-a3bb-0df632e79263'
+ snapshot_consistency_group_reference_model['id'] = 'r134-fa329f6b-0e36-433f-a3bb-0df632e79263'
+ snapshot_consistency_group_reference_model['name'] = 'my-snapshot-consistency-group'
+ snapshot_consistency_group_reference_model['resource_type'] = 'snapshot_consistency_group'
- # 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
+ image_reference_deleted_model = {} # ImageReferenceDeleted
+ image_reference_deleted_model['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_dict = PublicGatewayCollectionNext.from_dict(public_gateway_collection_next_model_json).__dict__
- public_gateway_collection_next_model2 = PublicGatewayCollectionNext(**public_gateway_collection_next_model_dict)
+ account_reference_model = {} # AccountReference
+ account_reference_model['id'] = 'aa2432b1fa4d4ace891e9b80fc104e34'
+ account_reference_model['resource_type'] = 'account'
- # Verify the model instances are equivalent
- assert public_gateway_collection_next_model == public_gateway_collection_next_model2
+ image_remote_model = {} # ImageRemote
+ image_remote_model['account'] = account_reference_model
+ image_remote_model['region'] = region_reference_model
- # 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
+ 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'
+ image_reference_model['remote'] = image_remote_model
+ image_reference_model['resource_type'] = 'image'
+ snapshot_source_snapshot_model = {} # SnapshotSourceSnapshot
+ snapshot_source_snapshot_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263'
+ snapshot_source_snapshot_model['deleted'] = snapshot_reference_deleted_model
+ snapshot_source_snapshot_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263'
+ snapshot_source_snapshot_model['id'] = 'r134-f6bfa329-0e36-433f-a3bb-0df632e79263'
+ snapshot_source_snapshot_model['name'] = 'my-snapshot'
+ snapshot_source_snapshot_model['remote'] = snapshot_remote_model
+ snapshot_source_snapshot_model['resource_type'] = 'snapshot'
-class TestModel_PublicGatewayFloatingIp:
- """
- Test Class for PublicGatewayFloatingIp
- """
+ volume_reference_deleted_model = {} # VolumeReferenceDeleted
+ volume_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- def test_public_gateway_floating_ip_serialization(self):
- """
- Test serialization/deserialization for PublicGatewayFloatingIp
- """
+ volume_remote_model = {} # VolumeRemote
+ volume_remote_model['region'] = region_reference_model
- # Construct dict forms of any model objects needed in order to build this model.
+ 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'
+ volume_reference_model['remote'] = volume_remote_model
+ volume_reference_model['resource_type'] = 'volume'
- floating_ip_reference_deleted_model = {} # FloatingIPReferenceDeleted
- floating_ip_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ snapshot_model = {} # Snapshot
+ snapshot_model['backup_policy_plan'] = backup_policy_plan_reference_model
+ snapshot_model['bootable'] = True
+ snapshot_model['captured_at'] = '2019-01-01T12:00:00Z'
+ snapshot_model['clones'] = [snapshot_clone_model]
+ snapshot_model['copies'] = [snapshot_copies_item_model]
+ 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['service_tags'] = ['testString']
+ snapshot_model['size'] = 1
+ snapshot_model['snapshot_consistency_group'] = snapshot_consistency_group_reference_model
+ snapshot_model['source_image'] = image_reference_model
+ snapshot_model['source_snapshot'] = snapshot_source_snapshot_model
+ snapshot_model['source_volume'] = volume_reference_model
+ snapshot_model['user_tags'] = ['testString']
- # 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 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 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 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 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 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 public_gateway_floating_ip_model == public_gateway_floating_ip_model2
+ assert snapshot_collection_model == snapshot_collection_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
+ snapshot_collection_model_json2 = snapshot_collection_model.to_dict()
+ assert snapshot_collection_model_json2 == snapshot_collection_model_json
-class TestModel_PublicGatewayPatch:
+class TestModel_SnapshotCollectionFirst:
"""
- Test Class for PublicGatewayPatch
+ Test Class for SnapshotCollectionFirst
"""
- def test_public_gateway_patch_serialization(self):
+ def test_snapshot_collection_first_serialization(self):
"""
- Test serialization/deserialization for PublicGatewayPatch
+ Test serialization/deserialization for SnapshotCollectionFirst
"""
- # Construct a json representation of a PublicGatewayPatch model
- public_gateway_patch_model_json = {}
- public_gateway_patch_model_json['name'] = 'my-public-gateway'
+ # 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 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 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 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)
+ # 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)
# Verify the model instances are equivalent
- assert public_gateway_patch_model == public_gateway_patch_model2
+ assert snapshot_collection_first_model == snapshot_collection_first_model2
# 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
+ snapshot_collection_first_model_json2 = snapshot_collection_first_model.to_dict()
+ assert snapshot_collection_first_model_json2 == snapshot_collection_first_model_json
-class TestModel_PublicGatewayReference:
+class TestModel_SnapshotCollectionNext:
"""
- Test Class for PublicGatewayReference
+ Test Class for SnapshotCollectionNext
"""
- def test_public_gateway_reference_serialization(self):
+ def test_snapshot_collection_next_serialization(self):
"""
- Test serialization/deserialization for PublicGatewayReference
+ Test serialization/deserialization for SnapshotCollectionNext
"""
- # Construct dict forms of any model objects needed in order to build this model.
-
- 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 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'
+ # 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 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
+ # 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 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)
+ # 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 public_gateway_reference_model == public_gateway_reference_model2
+ assert snapshot_collection_next_model == snapshot_collection_next_model2
# 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
+ snapshot_collection_next_model_json2 = snapshot_collection_next_model.to_dict()
+ assert snapshot_collection_next_model_json2 == snapshot_collection_next_model_json
-class TestModel_PublicGatewayReferenceDeleted:
+class TestModel_SnapshotConsistencyGroup:
"""
- Test Class for PublicGatewayReferenceDeleted
+ Test Class for SnapshotConsistencyGroup
"""
- def test_public_gateway_reference_deleted_serialization(self):
+ def test_snapshot_consistency_group_serialization(self):
"""
- Test serialization/deserialization for PublicGatewayReferenceDeleted
+ Test serialization/deserialization for SnapshotConsistencyGroup
"""
- # 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 dict forms of any model objects needed in order to build this model.
- # 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)
+ backup_policy_plan_reference_deleted_model = {} # BackupPolicyPlanReferenceDeleted
+ backup_policy_plan_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Verify the model instances are equivalent
- assert public_gateway_reference_deleted_model == public_gateway_reference_deleted_model2
+ 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'
- # 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
+ backup_policy_plan_remote_model = {} # BackupPolicyPlanRemote
+ backup_policy_plan_remote_model['region'] = region_reference_model
+ backup_policy_plan_reference_model = {} # BackupPolicyPlanReference
+ backup_policy_plan_reference_model['deleted'] = backup_policy_plan_reference_deleted_model
+ backup_policy_plan_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178'
+ backup_policy_plan_reference_model['id'] = 'r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178'
+ backup_policy_plan_reference_model['name'] = 'my-policy-plan'
+ backup_policy_plan_reference_model['remote'] = backup_policy_plan_remote_model
+ backup_policy_plan_reference_model['resource_type'] = 'backup_policy_plan'
-class TestModel_Region:
- """
- Test Class for Region
- """
+ 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_region_serialization(self):
- """
- Test serialization/deserialization for Region
- """
+ 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 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'
+ snapshot_remote_model = {} # SnapshotRemote
+ snapshot_remote_model['region'] = region_reference_model
- # 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
+ snapshot_consistency_group_snapshots_item_model = {} # SnapshotConsistencyGroupSnapshotsItem
+ snapshot_consistency_group_snapshots_item_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263'
+ snapshot_consistency_group_snapshots_item_model['deleted'] = snapshot_reference_deleted_model
+ snapshot_consistency_group_snapshots_item_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263'
+ snapshot_consistency_group_snapshots_item_model['id'] = 'r134-f6bfa329-0e36-433f-a3bb-0df632e79263'
+ snapshot_consistency_group_snapshots_item_model['name'] = 'my-snapshot'
+ snapshot_consistency_group_snapshots_item_model['remote'] = snapshot_remote_model
+ snapshot_consistency_group_snapshots_item_model['resource_type'] = 'snapshot'
- # 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 json representation of a SnapshotConsistencyGroup model
+ snapshot_consistency_group_model_json = {}
+ snapshot_consistency_group_model_json['backup_policy_plan'] = backup_policy_plan_reference_model
+ snapshot_consistency_group_model_json['created_at'] = '2019-01-01T12:00:00Z'
+ snapshot_consistency_group_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::snapshot-consistency-group:r134-fa329f6b-0e36-433f-a3bb-0df632e79263'
+ snapshot_consistency_group_model_json['delete_snapshots_on_delete'] = True
+ snapshot_consistency_group_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/snapshot_consistency_groups/r134-fa329f6b-0e36-433f-a3bb-0df632e79263'
+ snapshot_consistency_group_model_json['id'] = 'r134-fa329f6b-0e36-433f-a3bb-0df632e79263'
+ snapshot_consistency_group_model_json['lifecycle_state'] = 'stable'
+ snapshot_consistency_group_model_json['name'] = 'my-snapshot-consistency-group'
+ snapshot_consistency_group_model_json['resource_group'] = resource_group_reference_model
+ snapshot_consistency_group_model_json['resource_type'] = 'snapshot_consistency_group'
+ snapshot_consistency_group_model_json['service_tags'] = ['testString']
+ snapshot_consistency_group_model_json['snapshots'] = [snapshot_consistency_group_snapshots_item_model]
+
+ # Construct a model instance of SnapshotConsistencyGroup by calling from_dict on the json representation
+ snapshot_consistency_group_model = SnapshotConsistencyGroup.from_dict(snapshot_consistency_group_model_json)
+ assert snapshot_consistency_group_model != False
+
+ # Construct a model instance of SnapshotConsistencyGroup by calling from_dict on the json representation
+ snapshot_consistency_group_model_dict = SnapshotConsistencyGroup.from_dict(snapshot_consistency_group_model_json).__dict__
+ snapshot_consistency_group_model2 = SnapshotConsistencyGroup(**snapshot_consistency_group_model_dict)
# Verify the model instances are equivalent
- assert region_model == region_model2
+ assert snapshot_consistency_group_model == snapshot_consistency_group_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
+ snapshot_consistency_group_model_json2 = snapshot_consistency_group_model.to_dict()
+ assert snapshot_consistency_group_model_json2 == snapshot_consistency_group_model_json
-class TestModel_RegionCollection:
+class TestModel_SnapshotConsistencyGroupCollection:
"""
- Test Class for RegionCollection
+ Test Class for SnapshotConsistencyGroupCollection
"""
- def test_region_collection_serialization(self):
+ def test_snapshot_consistency_group_collection_serialization(self):
"""
- Test serialization/deserialization for RegionCollection
+ Test serialization/deserialization for SnapshotConsistencyGroupCollection
"""
# 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'
+ snapshot_consistency_group_collection_first_model = {} # SnapshotConsistencyGroupCollectionFirst
+ snapshot_consistency_group_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/snapshot_consistency_groups?limit=20'
- # Construct a json representation of a RegionCollection model
- region_collection_model_json = {}
- region_collection_model_json['regions'] = [region_model]
+ snapshot_consistency_group_collection_next_model = {} # SnapshotConsistencyGroupCollectionNext
+ snapshot_consistency_group_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/snapshot_consistency_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
+ backup_policy_plan_reference_deleted_model = {} # BackupPolicyPlanReferenceDeleted
+ backup_policy_plan_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # 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)
+ 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'
- # Verify the model instances are equivalent
- assert region_collection_model == region_collection_model2
+ backup_policy_plan_remote_model = {} # BackupPolicyPlanRemote
+ backup_policy_plan_remote_model['region'] = region_reference_model
- # 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
+ backup_policy_plan_reference_model = {} # BackupPolicyPlanReference
+ backup_policy_plan_reference_model['deleted'] = backup_policy_plan_reference_deleted_model
+ backup_policy_plan_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178'
+ backup_policy_plan_reference_model['id'] = 'r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178'
+ backup_policy_plan_reference_model['name'] = 'my-policy-plan'
+ backup_policy_plan_reference_model['remote'] = backup_policy_plan_remote_model
+ backup_policy_plan_reference_model['resource_type'] = 'backup_policy_plan'
+ 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_RegionReference:
- """
- Test Class for RegionReference
- """
+ snapshot_reference_deleted_model = {} # SnapshotReferenceDeleted
+ snapshot_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- def test_region_reference_serialization(self):
- """
- Test serialization/deserialization for RegionReference
- """
+ snapshot_remote_model = {} # SnapshotRemote
+ snapshot_remote_model['region'] = region_reference_model
- # 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'
+ snapshot_consistency_group_snapshots_item_model = {} # SnapshotConsistencyGroupSnapshotsItem
+ snapshot_consistency_group_snapshots_item_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263'
+ snapshot_consistency_group_snapshots_item_model['deleted'] = snapshot_reference_deleted_model
+ snapshot_consistency_group_snapshots_item_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263'
+ snapshot_consistency_group_snapshots_item_model['id'] = 'r134-f6bfa329-0e36-433f-a3bb-0df632e79263'
+ snapshot_consistency_group_snapshots_item_model['name'] = 'my-snapshot'
+ snapshot_consistency_group_snapshots_item_model['remote'] = snapshot_remote_model
+ snapshot_consistency_group_snapshots_item_model['resource_type'] = 'snapshot'
- # 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
+ snapshot_consistency_group_model = {} # SnapshotConsistencyGroup
+ snapshot_consistency_group_model['backup_policy_plan'] = backup_policy_plan_reference_model
+ snapshot_consistency_group_model['created_at'] = '2019-01-01T12:00:00Z'
+ snapshot_consistency_group_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::snapshot-consistency-group:r134-fa329f6b-0e36-433f-a3bb-0df632e79263'
+ snapshot_consistency_group_model['delete_snapshots_on_delete'] = True
+ snapshot_consistency_group_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/snapshot_consistency_groups/r134-fa329f6b-0e36-433f-a3bb-0df632e79263'
+ snapshot_consistency_group_model['id'] = 'r134-fa329f6b-0e36-433f-a3bb-0df632e79263'
+ snapshot_consistency_group_model['lifecycle_state'] = 'stable'
+ snapshot_consistency_group_model['name'] = 'my-snapshot-consistency-group'
+ snapshot_consistency_group_model['resource_group'] = resource_group_reference_model
+ snapshot_consistency_group_model['resource_type'] = 'snapshot_consistency_group'
+ snapshot_consistency_group_model['service_tags'] = ['testString']
+ snapshot_consistency_group_model['snapshots'] = [snapshot_consistency_group_snapshots_item_model]
- # 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 json representation of a SnapshotConsistencyGroupCollection model
+ snapshot_consistency_group_collection_model_json = {}
+ snapshot_consistency_group_collection_model_json['first'] = snapshot_consistency_group_collection_first_model
+ snapshot_consistency_group_collection_model_json['limit'] = 20
+ snapshot_consistency_group_collection_model_json['next'] = snapshot_consistency_group_collection_next_model
+ snapshot_consistency_group_collection_model_json['snapshot_consistency_groups'] = [snapshot_consistency_group_model]
+ snapshot_consistency_group_collection_model_json['total_count'] = 132
+
+ # Construct a model instance of SnapshotConsistencyGroupCollection by calling from_dict on the json representation
+ snapshot_consistency_group_collection_model = SnapshotConsistencyGroupCollection.from_dict(snapshot_consistency_group_collection_model_json)
+ assert snapshot_consistency_group_collection_model != False
+
+ # Construct a model instance of SnapshotConsistencyGroupCollection by calling from_dict on the json representation
+ snapshot_consistency_group_collection_model_dict = SnapshotConsistencyGroupCollection.from_dict(snapshot_consistency_group_collection_model_json).__dict__
+ snapshot_consistency_group_collection_model2 = SnapshotConsistencyGroupCollection(**snapshot_consistency_group_collection_model_dict)
# Verify the model instances are equivalent
- assert region_reference_model == region_reference_model2
+ assert snapshot_consistency_group_collection_model == snapshot_consistency_group_collection_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
+ snapshot_consistency_group_collection_model_json2 = snapshot_consistency_group_collection_model.to_dict()
+ assert snapshot_consistency_group_collection_model_json2 == snapshot_consistency_group_collection_model_json
-class TestModel_ReservedIP:
+class TestModel_SnapshotConsistencyGroupCollectionFirst:
"""
- Test Class for ReservedIP
+ Test Class for SnapshotConsistencyGroupCollectionFirst
"""
- def test_reserved_ip_serialization(self):
+ def test_snapshot_consistency_group_collection_first_serialization(self):
"""
- Test serialization/deserialization for ReservedIP
+ Test serialization/deserialization for SnapshotConsistencyGroupCollectionFirst
"""
- # 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:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5'
- reserved_ip_target_model['deleted'] = endpoint_gateway_reference_deleted_model
- reserved_ip_target_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5'
- reserved_ip_target_model['id'] = 'r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5'
- reserved_ip_target_model['name'] = 'my-endpoint-gateway'
- reserved_ip_target_model['resource_type'] = 'endpoint_gateway'
-
- # 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['lifecycle_state'] = 'stable'
- reserved_ip_model_json['name'] = 'my-reserved-ip'
- reserved_ip_model_json['owner'] = 'user'
- reserved_ip_model_json['resource_type'] = 'subnet_reserved_ip'
- reserved_ip_model_json['target'] = reserved_ip_target_model
+ # Construct a json representation of a SnapshotConsistencyGroupCollectionFirst model
+ snapshot_consistency_group_collection_first_model_json = {}
+ snapshot_consistency_group_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/snapshot_consistency_groups?limit=20'
- # 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 SnapshotConsistencyGroupCollectionFirst by calling from_dict on the json representation
+ snapshot_consistency_group_collection_first_model = SnapshotConsistencyGroupCollectionFirst.from_dict(snapshot_consistency_group_collection_first_model_json)
+ assert snapshot_consistency_group_collection_first_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 SnapshotConsistencyGroupCollectionFirst by calling from_dict on the json representation
+ snapshot_consistency_group_collection_first_model_dict = SnapshotConsistencyGroupCollectionFirst.from_dict(snapshot_consistency_group_collection_first_model_json).__dict__
+ snapshot_consistency_group_collection_first_model2 = SnapshotConsistencyGroupCollectionFirst(**snapshot_consistency_group_collection_first_model_dict)
# Verify the model instances are equivalent
- assert reserved_ip_model == reserved_ip_model2
+ assert snapshot_consistency_group_collection_first_model == snapshot_consistency_group_collection_first_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
+ snapshot_consistency_group_collection_first_model_json2 = snapshot_consistency_group_collection_first_model.to_dict()
+ assert snapshot_consistency_group_collection_first_model_json2 == snapshot_consistency_group_collection_first_model_json
-class TestModel_ReservedIPCollection:
+class TestModel_SnapshotConsistencyGroupCollectionNext:
"""
- Test Class for ReservedIPCollection
+ Test Class for SnapshotConsistencyGroupCollectionNext
"""
- def test_reserved_ip_collection_serialization(self):
+ def test_snapshot_consistency_group_collection_next_serialization(self):
"""
- Test serialization/deserialization for ReservedIPCollection
+ Test serialization/deserialization for SnapshotConsistencyGroupCollectionNext
"""
- # Construct dict forms of any model objects needed in order to build this model.
+ # Construct a json representation of a SnapshotConsistencyGroupCollectionNext model
+ snapshot_consistency_group_collection_next_model_json = {}
+ snapshot_consistency_group_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/snapshot_consistency_groups?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
- 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'
+ # Construct a model instance of SnapshotConsistencyGroupCollectionNext by calling from_dict on the json representation
+ snapshot_consistency_group_collection_next_model = SnapshotConsistencyGroupCollectionNext.from_dict(snapshot_consistency_group_collection_next_model_json)
+ assert snapshot_consistency_group_collection_next_model != False
- 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'
+ # Construct a model instance of SnapshotConsistencyGroupCollectionNext by calling from_dict on the json representation
+ snapshot_consistency_group_collection_next_model_dict = SnapshotConsistencyGroupCollectionNext.from_dict(snapshot_consistency_group_collection_next_model_json).__dict__
+ snapshot_consistency_group_collection_next_model2 = SnapshotConsistencyGroupCollectionNext(**snapshot_consistency_group_collection_next_model_dict)
- endpoint_gateway_reference_deleted_model = {} # EndpointGatewayReferenceDeleted
- endpoint_gateway_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ # Verify the model instances are equivalent
+ assert snapshot_consistency_group_collection_next_model == snapshot_consistency_group_collection_next_model2
- reserved_ip_target_model = {} # ReservedIPTargetEndpointGatewayReference
- reserved_ip_target_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5'
- reserved_ip_target_model['deleted'] = endpoint_gateway_reference_deleted_model
- reserved_ip_target_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5'
- reserved_ip_target_model['id'] = 'r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5'
- reserved_ip_target_model['name'] = 'my-endpoint-gateway'
- reserved_ip_target_model['resource_type'] = 'endpoint_gateway'
+ # Convert model instance back to dict and verify no loss of data
+ snapshot_consistency_group_collection_next_model_json2 = snapshot_consistency_group_collection_next_model.to_dict()
+ assert snapshot_consistency_group_collection_next_model_json2 == snapshot_consistency_group_collection_next_model_json
- reserved_ip_model = {} # ReservedIP
- reserved_ip_model['address'] = '192.168.3.4'
- reserved_ip_model['auto_delete'] = False
- reserved_ip_model['created_at'] = '2019-01-01T12:00:00Z'
- reserved_ip_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb'
- reserved_ip_model['id'] = '6d353a0f-aeb1-4ae1-832e-1110d10981bb'
- reserved_ip_model['lifecycle_state'] = 'stable'
- reserved_ip_model['name'] = 'my-reserved-ip'
- reserved_ip_model['owner'] = 'user'
- reserved_ip_model['resource_type'] = 'subnet_reserved_ip'
- reserved_ip_model['target'] = reserved_ip_target_model
- # 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
+class TestModel_SnapshotConsistencyGroupPatch:
+ """
+ Test Class for SnapshotConsistencyGroupPatch
+ """
- # 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
+ def test_snapshot_consistency_group_patch_serialization(self):
+ """
+ Test serialization/deserialization for SnapshotConsistencyGroupPatch
+ """
- # 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 json representation of a SnapshotConsistencyGroupPatch model
+ snapshot_consistency_group_patch_model_json = {}
+ snapshot_consistency_group_patch_model_json['delete_snapshots_on_delete'] = True
+ snapshot_consistency_group_patch_model_json['name'] = 'my-snapshot-consistency-group'
+
+ # Construct a model instance of SnapshotConsistencyGroupPatch by calling from_dict on the json representation
+ snapshot_consistency_group_patch_model = SnapshotConsistencyGroupPatch.from_dict(snapshot_consistency_group_patch_model_json)
+ assert snapshot_consistency_group_patch_model != False
+
+ # Construct a model instance of SnapshotConsistencyGroupPatch by calling from_dict on the json representation
+ snapshot_consistency_group_patch_model_dict = SnapshotConsistencyGroupPatch.from_dict(snapshot_consistency_group_patch_model_json).__dict__
+ snapshot_consistency_group_patch_model2 = SnapshotConsistencyGroupPatch(**snapshot_consistency_group_patch_model_dict)
# Verify the model instances are equivalent
- assert reserved_ip_collection_model == reserved_ip_collection_model2
+ assert snapshot_consistency_group_patch_model == snapshot_consistency_group_patch_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
+ snapshot_consistency_group_patch_model_json2 = snapshot_consistency_group_patch_model.to_dict()
+ assert snapshot_consistency_group_patch_model_json2 == snapshot_consistency_group_patch_model_json
-class TestModel_ReservedIPCollectionBareMetalServerNetworkInterfaceContext:
+class TestModel_SnapshotConsistencyGroupReference:
"""
- Test Class for ReservedIPCollectionBareMetalServerNetworkInterfaceContext
+ Test Class for SnapshotConsistencyGroupReference
"""
- def test_reserved_ip_collection_bare_metal_server_network_interface_context_serialization(self):
+ def test_snapshot_consistency_group_reference_serialization(self):
"""
- Test serialization/deserialization for ReservedIPCollectionBareMetalServerNetworkInterfaceContext
+ Test serialization/deserialization for SnapshotConsistencyGroupReference
"""
# Construct dict forms of any model objects needed in order to build this model.
- reserved_ip_collection_bare_metal_server_network_interface_context_first_model = {} # ReservedIPCollectionBareMetalServerNetworkInterfaceContextFirst
- reserved_ip_collection_bare_metal_server_network_interface_context_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e/ips?limit=20'
-
- endpoint_gateway_reference_deleted_model = {} # EndpointGatewayReferenceDeleted
- endpoint_gateway_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
-
- reserved_ip_target_model = {} # ReservedIPTargetEndpointGatewayReference
- reserved_ip_target_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5'
- reserved_ip_target_model['deleted'] = endpoint_gateway_reference_deleted_model
- reserved_ip_target_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5'
- reserved_ip_target_model['id'] = 'r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5'
- reserved_ip_target_model['name'] = 'my-endpoint-gateway'
- reserved_ip_target_model['resource_type'] = 'endpoint_gateway'
-
- reserved_ip_model = {} # ReservedIP
- reserved_ip_model['address'] = '192.168.3.4'
- reserved_ip_model['auto_delete'] = False
- reserved_ip_model['created_at'] = '2019-01-01T12:00:00Z'
- reserved_ip_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb'
- reserved_ip_model['id'] = '6d353a0f-aeb1-4ae1-832e-1110d10981bb'
- reserved_ip_model['lifecycle_state'] = 'stable'
- reserved_ip_model['name'] = 'my-reserved-ip'
- reserved_ip_model['owner'] = 'user'
- reserved_ip_model['resource_type'] = 'subnet_reserved_ip'
- reserved_ip_model['target'] = reserved_ip_target_model
-
- reserved_ip_collection_bare_metal_server_network_interface_context_next_model = {} # ReservedIPCollectionBareMetalServerNetworkInterfaceContextNext
- reserved_ip_collection_bare_metal_server_network_interface_context_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e/ips?start=a404e343444b4e1095c9edba76672d67&limit=20'
+ snapshot_consistency_group_reference_deleted_model = {} # SnapshotConsistencyGroupReferenceDeleted
+ snapshot_consistency_group_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Construct a json representation of a ReservedIPCollectionBareMetalServerNetworkInterfaceContext model
- reserved_ip_collection_bare_metal_server_network_interface_context_model_json = {}
- reserved_ip_collection_bare_metal_server_network_interface_context_model_json['first'] = reserved_ip_collection_bare_metal_server_network_interface_context_first_model
- reserved_ip_collection_bare_metal_server_network_interface_context_model_json['ips'] = [reserved_ip_model]
- reserved_ip_collection_bare_metal_server_network_interface_context_model_json['limit'] = 20
- reserved_ip_collection_bare_metal_server_network_interface_context_model_json['next'] = reserved_ip_collection_bare_metal_server_network_interface_context_next_model
- reserved_ip_collection_bare_metal_server_network_interface_context_model_json['total_count'] = 132
+ # Construct a json representation of a SnapshotConsistencyGroupReference model
+ snapshot_consistency_group_reference_model_json = {}
+ snapshot_consistency_group_reference_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::snapshot-consistency-group:r134-fa329f6b-0e36-433f-a3bb-0df632e79263'
+ snapshot_consistency_group_reference_model_json['deleted'] = snapshot_consistency_group_reference_deleted_model
+ snapshot_consistency_group_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/snapshot_consistency_groups/r134-fa329f6b-0e36-433f-a3bb-0df632e79263'
+ snapshot_consistency_group_reference_model_json['id'] = 'r134-fa329f6b-0e36-433f-a3bb-0df632e79263'
+ snapshot_consistency_group_reference_model_json['name'] = 'my-snapshot-consistency-group'
+ snapshot_consistency_group_reference_model_json['resource_type'] = 'snapshot_consistency_group'
- # Construct a model instance of ReservedIPCollectionBareMetalServerNetworkInterfaceContext by calling from_dict on the json representation
- reserved_ip_collection_bare_metal_server_network_interface_context_model = ReservedIPCollectionBareMetalServerNetworkInterfaceContext.from_dict(reserved_ip_collection_bare_metal_server_network_interface_context_model_json)
- assert reserved_ip_collection_bare_metal_server_network_interface_context_model != False
+ # Construct a model instance of SnapshotConsistencyGroupReference by calling from_dict on the json representation
+ snapshot_consistency_group_reference_model = SnapshotConsistencyGroupReference.from_dict(snapshot_consistency_group_reference_model_json)
+ assert snapshot_consistency_group_reference_model != False
- # Construct a model instance of ReservedIPCollectionBareMetalServerNetworkInterfaceContext by calling from_dict on the json representation
- reserved_ip_collection_bare_metal_server_network_interface_context_model_dict = ReservedIPCollectionBareMetalServerNetworkInterfaceContext.from_dict(reserved_ip_collection_bare_metal_server_network_interface_context_model_json).__dict__
- reserved_ip_collection_bare_metal_server_network_interface_context_model2 = ReservedIPCollectionBareMetalServerNetworkInterfaceContext(**reserved_ip_collection_bare_metal_server_network_interface_context_model_dict)
+ # Construct a model instance of SnapshotConsistencyGroupReference by calling from_dict on the json representation
+ snapshot_consistency_group_reference_model_dict = SnapshotConsistencyGroupReference.from_dict(snapshot_consistency_group_reference_model_json).__dict__
+ snapshot_consistency_group_reference_model2 = SnapshotConsistencyGroupReference(**snapshot_consistency_group_reference_model_dict)
# Verify the model instances are equivalent
- assert reserved_ip_collection_bare_metal_server_network_interface_context_model == reserved_ip_collection_bare_metal_server_network_interface_context_model2
+ assert snapshot_consistency_group_reference_model == snapshot_consistency_group_reference_model2
# Convert model instance back to dict and verify no loss of data
- reserved_ip_collection_bare_metal_server_network_interface_context_model_json2 = reserved_ip_collection_bare_metal_server_network_interface_context_model.to_dict()
- assert reserved_ip_collection_bare_metal_server_network_interface_context_model_json2 == reserved_ip_collection_bare_metal_server_network_interface_context_model_json
+ snapshot_consistency_group_reference_model_json2 = snapshot_consistency_group_reference_model.to_dict()
+ assert snapshot_consistency_group_reference_model_json2 == snapshot_consistency_group_reference_model_json
-class TestModel_ReservedIPCollectionBareMetalServerNetworkInterfaceContextFirst:
+class TestModel_SnapshotConsistencyGroupReferenceDeleted:
"""
- Test Class for ReservedIPCollectionBareMetalServerNetworkInterfaceContextFirst
+ Test Class for SnapshotConsistencyGroupReferenceDeleted
"""
- def test_reserved_ip_collection_bare_metal_server_network_interface_context_first_serialization(self):
+ def test_snapshot_consistency_group_reference_deleted_serialization(self):
"""
- Test serialization/deserialization for ReservedIPCollectionBareMetalServerNetworkInterfaceContextFirst
+ Test serialization/deserialization for SnapshotConsistencyGroupReferenceDeleted
"""
- # Construct a json representation of a ReservedIPCollectionBareMetalServerNetworkInterfaceContextFirst model
- reserved_ip_collection_bare_metal_server_network_interface_context_first_model_json = {}
- reserved_ip_collection_bare_metal_server_network_interface_context_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e/ips?limit=20'
+ # Construct a json representation of a SnapshotConsistencyGroupReferenceDeleted model
+ snapshot_consistency_group_reference_deleted_model_json = {}
+ snapshot_consistency_group_reference_deleted_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Construct a model instance of ReservedIPCollectionBareMetalServerNetworkInterfaceContextFirst by calling from_dict on the json representation
- reserved_ip_collection_bare_metal_server_network_interface_context_first_model = ReservedIPCollectionBareMetalServerNetworkInterfaceContextFirst.from_dict(reserved_ip_collection_bare_metal_server_network_interface_context_first_model_json)
- assert reserved_ip_collection_bare_metal_server_network_interface_context_first_model != False
+ # Construct a model instance of SnapshotConsistencyGroupReferenceDeleted by calling from_dict on the json representation
+ snapshot_consistency_group_reference_deleted_model = SnapshotConsistencyGroupReferenceDeleted.from_dict(snapshot_consistency_group_reference_deleted_model_json)
+ assert snapshot_consistency_group_reference_deleted_model != False
- # Construct a model instance of ReservedIPCollectionBareMetalServerNetworkInterfaceContextFirst by calling from_dict on the json representation
- reserved_ip_collection_bare_metal_server_network_interface_context_first_model_dict = ReservedIPCollectionBareMetalServerNetworkInterfaceContextFirst.from_dict(reserved_ip_collection_bare_metal_server_network_interface_context_first_model_json).__dict__
- reserved_ip_collection_bare_metal_server_network_interface_context_first_model2 = ReservedIPCollectionBareMetalServerNetworkInterfaceContextFirst(**reserved_ip_collection_bare_metal_server_network_interface_context_first_model_dict)
+ # Construct a model instance of SnapshotConsistencyGroupReferenceDeleted by calling from_dict on the json representation
+ snapshot_consistency_group_reference_deleted_model_dict = SnapshotConsistencyGroupReferenceDeleted.from_dict(snapshot_consistency_group_reference_deleted_model_json).__dict__
+ snapshot_consistency_group_reference_deleted_model2 = SnapshotConsistencyGroupReferenceDeleted(**snapshot_consistency_group_reference_deleted_model_dict)
# Verify the model instances are equivalent
- assert reserved_ip_collection_bare_metal_server_network_interface_context_first_model == reserved_ip_collection_bare_metal_server_network_interface_context_first_model2
+ assert snapshot_consistency_group_reference_deleted_model == snapshot_consistency_group_reference_deleted_model2
# Convert model instance back to dict and verify no loss of data
- reserved_ip_collection_bare_metal_server_network_interface_context_first_model_json2 = reserved_ip_collection_bare_metal_server_network_interface_context_first_model.to_dict()
- assert reserved_ip_collection_bare_metal_server_network_interface_context_first_model_json2 == reserved_ip_collection_bare_metal_server_network_interface_context_first_model_json
+ snapshot_consistency_group_reference_deleted_model_json2 = snapshot_consistency_group_reference_deleted_model.to_dict()
+ assert snapshot_consistency_group_reference_deleted_model_json2 == snapshot_consistency_group_reference_deleted_model_json
-class TestModel_ReservedIPCollectionBareMetalServerNetworkInterfaceContextNext:
+class TestModel_SnapshotConsistencyGroupSnapshotsItem:
"""
- Test Class for ReservedIPCollectionBareMetalServerNetworkInterfaceContextNext
+ Test Class for SnapshotConsistencyGroupSnapshotsItem
"""
- def test_reserved_ip_collection_bare_metal_server_network_interface_context_next_serialization(self):
+ def test_snapshot_consistency_group_snapshots_item_serialization(self):
"""
- Test serialization/deserialization for ReservedIPCollectionBareMetalServerNetworkInterfaceContextNext
+ Test serialization/deserialization for SnapshotConsistencyGroupSnapshotsItem
"""
- # Construct a json representation of a ReservedIPCollectionBareMetalServerNetworkInterfaceContextNext model
- reserved_ip_collection_bare_metal_server_network_interface_context_next_model_json = {}
- reserved_ip_collection_bare_metal_server_network_interface_context_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e/ips?start=a404e343444b4e1095c9edba76672d67&limit=20'
+ # Construct dict forms of any model objects needed in order to build this model.
- # Construct a model instance of ReservedIPCollectionBareMetalServerNetworkInterfaceContextNext by calling from_dict on the json representation
- reserved_ip_collection_bare_metal_server_network_interface_context_next_model = ReservedIPCollectionBareMetalServerNetworkInterfaceContextNext.from_dict(reserved_ip_collection_bare_metal_server_network_interface_context_next_model_json)
- assert reserved_ip_collection_bare_metal_server_network_interface_context_next_model != False
+ snapshot_reference_deleted_model = {} # SnapshotReferenceDeleted
+ snapshot_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Construct a model instance of ReservedIPCollectionBareMetalServerNetworkInterfaceContextNext by calling from_dict on the json representation
- reserved_ip_collection_bare_metal_server_network_interface_context_next_model_dict = ReservedIPCollectionBareMetalServerNetworkInterfaceContextNext.from_dict(reserved_ip_collection_bare_metal_server_network_interface_context_next_model_json).__dict__
- reserved_ip_collection_bare_metal_server_network_interface_context_next_model2 = ReservedIPCollectionBareMetalServerNetworkInterfaceContextNext(**reserved_ip_collection_bare_metal_server_network_interface_context_next_model_dict)
+ 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'
+
+ snapshot_remote_model = {} # SnapshotRemote
+ snapshot_remote_model['region'] = region_reference_model
+
+ # Construct a json representation of a SnapshotConsistencyGroupSnapshotsItem model
+ snapshot_consistency_group_snapshots_item_model_json = {}
+ snapshot_consistency_group_snapshots_item_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263'
+ snapshot_consistency_group_snapshots_item_model_json['deleted'] = snapshot_reference_deleted_model
+ snapshot_consistency_group_snapshots_item_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263'
+ snapshot_consistency_group_snapshots_item_model_json['id'] = 'r134-f6bfa329-0e36-433f-a3bb-0df632e79263'
+ snapshot_consistency_group_snapshots_item_model_json['name'] = 'my-snapshot'
+ snapshot_consistency_group_snapshots_item_model_json['remote'] = snapshot_remote_model
+ snapshot_consistency_group_snapshots_item_model_json['resource_type'] = 'snapshot'
+
+ # Construct a model instance of SnapshotConsistencyGroupSnapshotsItem by calling from_dict on the json representation
+ snapshot_consistency_group_snapshots_item_model = SnapshotConsistencyGroupSnapshotsItem.from_dict(snapshot_consistency_group_snapshots_item_model_json)
+ assert snapshot_consistency_group_snapshots_item_model != False
+
+ # Construct a model instance of SnapshotConsistencyGroupSnapshotsItem by calling from_dict on the json representation
+ snapshot_consistency_group_snapshots_item_model_dict = SnapshotConsistencyGroupSnapshotsItem.from_dict(snapshot_consistency_group_snapshots_item_model_json).__dict__
+ snapshot_consistency_group_snapshots_item_model2 = SnapshotConsistencyGroupSnapshotsItem(**snapshot_consistency_group_snapshots_item_model_dict)
# Verify the model instances are equivalent
- assert reserved_ip_collection_bare_metal_server_network_interface_context_next_model == reserved_ip_collection_bare_metal_server_network_interface_context_next_model2
+ assert snapshot_consistency_group_snapshots_item_model == snapshot_consistency_group_snapshots_item_model2
# Convert model instance back to dict and verify no loss of data
- reserved_ip_collection_bare_metal_server_network_interface_context_next_model_json2 = reserved_ip_collection_bare_metal_server_network_interface_context_next_model.to_dict()
- assert reserved_ip_collection_bare_metal_server_network_interface_context_next_model_json2 == reserved_ip_collection_bare_metal_server_network_interface_context_next_model_json
+ snapshot_consistency_group_snapshots_item_model_json2 = snapshot_consistency_group_snapshots_item_model.to_dict()
+ assert snapshot_consistency_group_snapshots_item_model_json2 == snapshot_consistency_group_snapshots_item_model_json
-class TestModel_ReservedIPCollectionEndpointGatewayContext:
+class TestModel_SnapshotCopiesItem:
"""
- Test Class for ReservedIPCollectionEndpointGatewayContext
+ Test Class for SnapshotCopiesItem
"""
- def test_reserved_ip_collection_endpoint_gateway_context_serialization(self):
+ def test_snapshot_copies_item_serialization(self):
"""
- Test serialization/deserialization for ReservedIPCollectionEndpointGatewayContext
+ Test serialization/deserialization for SnapshotCopiesItem
"""
# 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:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5'
- reserved_ip_target_model['deleted'] = endpoint_gateway_reference_deleted_model
- reserved_ip_target_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5'
- reserved_ip_target_model['id'] = 'r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5'
- reserved_ip_target_model['name'] = 'my-endpoint-gateway'
- reserved_ip_target_model['resource_type'] = 'endpoint_gateway'
+ snapshot_reference_deleted_model = {} # SnapshotReferenceDeleted
+ snapshot_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- reserved_ip_model = {} # ReservedIP
- reserved_ip_model['address'] = '192.168.3.4'
- reserved_ip_model['auto_delete'] = False
- reserved_ip_model['created_at'] = '2019-01-01T12:00:00Z'
- reserved_ip_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb'
- reserved_ip_model['id'] = '6d353a0f-aeb1-4ae1-832e-1110d10981bb'
- reserved_ip_model['lifecycle_state'] = 'stable'
- reserved_ip_model['name'] = 'my-reserved-ip'
- reserved_ip_model['owner'] = 'user'
- reserved_ip_model['resource_type'] = 'subnet_reserved_ip'
- reserved_ip_model['target'] = reserved_ip_target_model
+ 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'
- 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'
+ snapshot_remote_model = {} # SnapshotRemote
+ snapshot_remote_model['region'] = region_reference_model
- # 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 SnapshotCopiesItem model
+ snapshot_copies_item_model_json = {}
+ snapshot_copies_item_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263'
+ snapshot_copies_item_model_json['deleted'] = snapshot_reference_deleted_model
+ snapshot_copies_item_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263'
+ snapshot_copies_item_model_json['id'] = 'r134-f6bfa329-0e36-433f-a3bb-0df632e79263'
+ snapshot_copies_item_model_json['name'] = 'my-snapshot'
+ snapshot_copies_item_model_json['remote'] = snapshot_remote_model
+ snapshot_copies_item_model_json['resource_type'] = 'snapshot'
- # 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 SnapshotCopiesItem by calling from_dict on the json representation
+ snapshot_copies_item_model = SnapshotCopiesItem.from_dict(snapshot_copies_item_model_json)
+ assert snapshot_copies_item_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 SnapshotCopiesItem by calling from_dict on the json representation
+ snapshot_copies_item_model_dict = SnapshotCopiesItem.from_dict(snapshot_copies_item_model_json).__dict__
+ snapshot_copies_item_model2 = SnapshotCopiesItem(**snapshot_copies_item_model_dict)
# Verify the model instances are equivalent
- assert reserved_ip_collection_endpoint_gateway_context_model == reserved_ip_collection_endpoint_gateway_context_model2
+ assert snapshot_copies_item_model == snapshot_copies_item_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
+ snapshot_copies_item_model_json2 = snapshot_copies_item_model.to_dict()
+ assert snapshot_copies_item_model_json2 == snapshot_copies_item_model_json
-class TestModel_ReservedIPCollectionEndpointGatewayContextFirst:
+class TestModel_SnapshotPatch:
"""
- Test Class for ReservedIPCollectionEndpointGatewayContextFirst
+ Test Class for SnapshotPatch
"""
- def test_reserved_ip_collection_endpoint_gateway_context_first_serialization(self):
+ def test_snapshot_patch_serialization(self):
"""
- Test serialization/deserialization for ReservedIPCollectionEndpointGatewayContextFirst
+ Test serialization/deserialization for SnapshotPatch
"""
- # 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 json representation of a SnapshotPatch model
+ snapshot_patch_model_json = {}
+ snapshot_patch_model_json['name'] = 'my-snapshot'
+ snapshot_patch_model_json['user_tags'] = ['testString']
- # Construct a model instance of 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 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 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)
+ # 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 reserved_ip_collection_endpoint_gateway_context_first_model == reserved_ip_collection_endpoint_gateway_context_first_model2
+ assert snapshot_patch_model == snapshot_patch_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
+ snapshot_patch_model_json2 = snapshot_patch_model.to_dict()
+ assert snapshot_patch_model_json2 == snapshot_patch_model_json
-class TestModel_ReservedIPCollectionEndpointGatewayContextNext:
+class TestModel_SnapshotPrototypeSnapshotConsistencyGroupContext:
"""
- Test Class for ReservedIPCollectionEndpointGatewayContextNext
+ Test Class for SnapshotPrototypeSnapshotConsistencyGroupContext
"""
- def test_reserved_ip_collection_endpoint_gateway_context_next_serialization(self):
+ def test_snapshot_prototype_snapshot_consistency_group_context_serialization(self):
"""
- Test serialization/deserialization for ReservedIPCollectionEndpointGatewayContextNext
+ Test serialization/deserialization for SnapshotPrototypeSnapshotConsistencyGroupContext
"""
- # 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 dict forms of any model objects needed in order to build this model.
- # 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
+ volume_identity_model = {} # VolumeIdentityById
+ volume_identity_model['id'] = '1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
- # 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 json representation of a SnapshotPrototypeSnapshotConsistencyGroupContext model
+ snapshot_prototype_snapshot_consistency_group_context_model_json = {}
+ snapshot_prototype_snapshot_consistency_group_context_model_json['name'] = 'my-snapshot'
+ snapshot_prototype_snapshot_consistency_group_context_model_json['source_volume'] = volume_identity_model
+ snapshot_prototype_snapshot_consistency_group_context_model_json['user_tags'] = ['testString']
+
+ # Construct a model instance of SnapshotPrototypeSnapshotConsistencyGroupContext by calling from_dict on the json representation
+ snapshot_prototype_snapshot_consistency_group_context_model = SnapshotPrototypeSnapshotConsistencyGroupContext.from_dict(snapshot_prototype_snapshot_consistency_group_context_model_json)
+ assert snapshot_prototype_snapshot_consistency_group_context_model != False
+
+ # Construct a model instance of SnapshotPrototypeSnapshotConsistencyGroupContext by calling from_dict on the json representation
+ snapshot_prototype_snapshot_consistency_group_context_model_dict = SnapshotPrototypeSnapshotConsistencyGroupContext.from_dict(snapshot_prototype_snapshot_consistency_group_context_model_json).__dict__
+ snapshot_prototype_snapshot_consistency_group_context_model2 = SnapshotPrototypeSnapshotConsistencyGroupContext(**snapshot_prototype_snapshot_consistency_group_context_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 snapshot_prototype_snapshot_consistency_group_context_model == snapshot_prototype_snapshot_consistency_group_context_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
+ snapshot_prototype_snapshot_consistency_group_context_model_json2 = snapshot_prototype_snapshot_consistency_group_context_model.to_dict()
+ assert snapshot_prototype_snapshot_consistency_group_context_model_json2 == snapshot_prototype_snapshot_consistency_group_context_model_json
-class TestModel_ReservedIPCollectionFirst:
+class TestModel_SnapshotReference:
"""
- Test Class for ReservedIPCollectionFirst
+ Test Class for SnapshotReference
"""
- def test_reserved_ip_collection_first_serialization(self):
+ def test_snapshot_reference_serialization(self):
"""
- Test serialization/deserialization for ReservedIPCollectionFirst
+ Test serialization/deserialization for SnapshotReference
"""
- # 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
+ snapshot_reference_deleted_model = {} # SnapshotReferenceDeleted
+ snapshot_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # 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)
+ 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'
+
+ snapshot_remote_model = {} # SnapshotRemote
+ snapshot_remote_model['region'] = region_reference_model
+
+ # 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['remote'] = snapshot_remote_model
+ snapshot_reference_model_json['resource_type'] = 'snapshot'
+
+ # 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 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 reserved_ip_collection_first_model == reserved_ip_collection_first_model2
+ assert snapshot_reference_model == snapshot_reference_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
+ snapshot_reference_model_json2 = snapshot_reference_model.to_dict()
+ assert snapshot_reference_model_json2 == snapshot_reference_model_json
-class TestModel_ReservedIPCollectionInstanceNetworkInterfaceContext:
+class TestModel_SnapshotReferenceDeleted:
"""
- Test Class for ReservedIPCollectionInstanceNetworkInterfaceContext
+ Test Class for SnapshotReferenceDeleted
"""
- def test_reserved_ip_collection_instance_network_interface_context_serialization(self):
+ def test_snapshot_reference_deleted_serialization(self):
"""
- Test serialization/deserialization for ReservedIPCollectionInstanceNetworkInterfaceContext
+ Test serialization/deserialization for SnapshotReferenceDeleted
"""
- # Construct dict forms of any model objects needed in order to build this model.
-
- reserved_ip_collection_instance_network_interface_context_first_model = {} # ReservedIPCollectionInstanceNetworkInterfaceContextFirst
- reserved_ip_collection_instance_network_interface_context_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e/ips?limit=20'
-
- endpoint_gateway_reference_deleted_model = {} # EndpointGatewayReferenceDeleted
- endpoint_gateway_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
-
- reserved_ip_target_model = {} # ReservedIPTargetEndpointGatewayReference
- reserved_ip_target_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5'
- reserved_ip_target_model['deleted'] = endpoint_gateway_reference_deleted_model
- reserved_ip_target_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5'
- reserved_ip_target_model['id'] = 'r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5'
- reserved_ip_target_model['name'] = 'my-endpoint-gateway'
- reserved_ip_target_model['resource_type'] = 'endpoint_gateway'
-
- reserved_ip_model = {} # ReservedIP
- reserved_ip_model['address'] = '192.168.3.4'
- reserved_ip_model['auto_delete'] = False
- reserved_ip_model['created_at'] = '2019-01-01T12:00:00Z'
- reserved_ip_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb'
- reserved_ip_model['id'] = '6d353a0f-aeb1-4ae1-832e-1110d10981bb'
- reserved_ip_model['lifecycle_state'] = 'stable'
- reserved_ip_model['name'] = 'my-reserved-ip'
- reserved_ip_model['owner'] = 'user'
- reserved_ip_model['resource_type'] = 'subnet_reserved_ip'
- reserved_ip_model['target'] = reserved_ip_target_model
-
- reserved_ip_collection_instance_network_interface_context_next_model = {} # ReservedIPCollectionInstanceNetworkInterfaceContextNext
- reserved_ip_collection_instance_network_interface_context_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e/ips?start=a404e343444b4e1095c9edba76672d67&limit=20'
-
- # Construct a json representation of a ReservedIPCollectionInstanceNetworkInterfaceContext model
- reserved_ip_collection_instance_network_interface_context_model_json = {}
- reserved_ip_collection_instance_network_interface_context_model_json['first'] = reserved_ip_collection_instance_network_interface_context_first_model
- reserved_ip_collection_instance_network_interface_context_model_json['ips'] = [reserved_ip_model]
- reserved_ip_collection_instance_network_interface_context_model_json['limit'] = 20
- reserved_ip_collection_instance_network_interface_context_model_json['next'] = reserved_ip_collection_instance_network_interface_context_next_model
- reserved_ip_collection_instance_network_interface_context_model_json['total_count'] = 132
+ # Construct a 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 ReservedIPCollectionInstanceNetworkInterfaceContext by calling from_dict on the json representation
- reserved_ip_collection_instance_network_interface_context_model = ReservedIPCollectionInstanceNetworkInterfaceContext.from_dict(reserved_ip_collection_instance_network_interface_context_model_json)
- assert reserved_ip_collection_instance_network_interface_context_model != False
+ # Construct a model instance of 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 ReservedIPCollectionInstanceNetworkInterfaceContext by calling from_dict on the json representation
- reserved_ip_collection_instance_network_interface_context_model_dict = ReservedIPCollectionInstanceNetworkInterfaceContext.from_dict(reserved_ip_collection_instance_network_interface_context_model_json).__dict__
- reserved_ip_collection_instance_network_interface_context_model2 = ReservedIPCollectionInstanceNetworkInterfaceContext(**reserved_ip_collection_instance_network_interface_context_model_dict)
+ # 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 reserved_ip_collection_instance_network_interface_context_model == reserved_ip_collection_instance_network_interface_context_model2
+ assert snapshot_reference_deleted_model == snapshot_reference_deleted_model2
# Convert model instance back to dict and verify no loss of data
- reserved_ip_collection_instance_network_interface_context_model_json2 = reserved_ip_collection_instance_network_interface_context_model.to_dict()
- assert reserved_ip_collection_instance_network_interface_context_model_json2 == reserved_ip_collection_instance_network_interface_context_model_json
+ snapshot_reference_deleted_model_json2 = snapshot_reference_deleted_model.to_dict()
+ assert snapshot_reference_deleted_model_json2 == snapshot_reference_deleted_model_json
-class TestModel_ReservedIPCollectionInstanceNetworkInterfaceContextFirst:
+class TestModel_SnapshotRemote:
"""
- Test Class for ReservedIPCollectionInstanceNetworkInterfaceContextFirst
+ Test Class for SnapshotRemote
"""
- def test_reserved_ip_collection_instance_network_interface_context_first_serialization(self):
+ def test_snapshot_remote_serialization(self):
"""
- Test serialization/deserialization for ReservedIPCollectionInstanceNetworkInterfaceContextFirst
+ Test serialization/deserialization for SnapshotRemote
"""
- # Construct a json representation of a ReservedIPCollectionInstanceNetworkInterfaceContextFirst model
- reserved_ip_collection_instance_network_interface_context_first_model_json = {}
- reserved_ip_collection_instance_network_interface_context_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e/ips?limit=20'
+ # Construct dict forms of any model objects needed in order to build this model.
- # Construct a model instance of ReservedIPCollectionInstanceNetworkInterfaceContextFirst by calling from_dict on the json representation
- reserved_ip_collection_instance_network_interface_context_first_model = ReservedIPCollectionInstanceNetworkInterfaceContextFirst.from_dict(reserved_ip_collection_instance_network_interface_context_first_model_json)
- assert reserved_ip_collection_instance_network_interface_context_first_model != False
+ 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 model instance of ReservedIPCollectionInstanceNetworkInterfaceContextFirst by calling from_dict on the json representation
- reserved_ip_collection_instance_network_interface_context_first_model_dict = ReservedIPCollectionInstanceNetworkInterfaceContextFirst.from_dict(reserved_ip_collection_instance_network_interface_context_first_model_json).__dict__
- reserved_ip_collection_instance_network_interface_context_first_model2 = ReservedIPCollectionInstanceNetworkInterfaceContextFirst(**reserved_ip_collection_instance_network_interface_context_first_model_dict)
+ # Construct a json representation of a SnapshotRemote model
+ snapshot_remote_model_json = {}
+ snapshot_remote_model_json['region'] = region_reference_model
+
+ # Construct a model instance of SnapshotRemote by calling from_dict on the json representation
+ snapshot_remote_model = SnapshotRemote.from_dict(snapshot_remote_model_json)
+ assert snapshot_remote_model != False
+
+ # Construct a model instance of SnapshotRemote by calling from_dict on the json representation
+ snapshot_remote_model_dict = SnapshotRemote.from_dict(snapshot_remote_model_json).__dict__
+ snapshot_remote_model2 = SnapshotRemote(**snapshot_remote_model_dict)
# Verify the model instances are equivalent
- assert reserved_ip_collection_instance_network_interface_context_first_model == reserved_ip_collection_instance_network_interface_context_first_model2
+ assert snapshot_remote_model == snapshot_remote_model2
# Convert model instance back to dict and verify no loss of data
- reserved_ip_collection_instance_network_interface_context_first_model_json2 = reserved_ip_collection_instance_network_interface_context_first_model.to_dict()
- assert reserved_ip_collection_instance_network_interface_context_first_model_json2 == reserved_ip_collection_instance_network_interface_context_first_model_json
+ snapshot_remote_model_json2 = snapshot_remote_model.to_dict()
+ assert snapshot_remote_model_json2 == snapshot_remote_model_json
-class TestModel_ReservedIPCollectionInstanceNetworkInterfaceContextNext:
+class TestModel_SnapshotSourceSnapshot:
"""
- Test Class for ReservedIPCollectionInstanceNetworkInterfaceContextNext
+ Test Class for SnapshotSourceSnapshot
"""
- def test_reserved_ip_collection_instance_network_interface_context_next_serialization(self):
+ def test_snapshot_source_snapshot_serialization(self):
"""
- Test serialization/deserialization for ReservedIPCollectionInstanceNetworkInterfaceContextNext
+ Test serialization/deserialization for SnapshotSourceSnapshot
"""
- # Construct a json representation of a ReservedIPCollectionInstanceNetworkInterfaceContextNext model
- reserved_ip_collection_instance_network_interface_context_next_model_json = {}
- reserved_ip_collection_instance_network_interface_context_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e/ips?start=a404e343444b4e1095c9edba76672d67&limit=20'
+ # Construct dict forms of any model objects needed in order to build this model.
- # Construct a model instance of ReservedIPCollectionInstanceNetworkInterfaceContextNext by calling from_dict on the json representation
- reserved_ip_collection_instance_network_interface_context_next_model = ReservedIPCollectionInstanceNetworkInterfaceContextNext.from_dict(reserved_ip_collection_instance_network_interface_context_next_model_json)
- assert reserved_ip_collection_instance_network_interface_context_next_model != False
+ snapshot_reference_deleted_model = {} # SnapshotReferenceDeleted
+ snapshot_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Construct a model instance of ReservedIPCollectionInstanceNetworkInterfaceContextNext by calling from_dict on the json representation
- reserved_ip_collection_instance_network_interface_context_next_model_dict = ReservedIPCollectionInstanceNetworkInterfaceContextNext.from_dict(reserved_ip_collection_instance_network_interface_context_next_model_json).__dict__
- reserved_ip_collection_instance_network_interface_context_next_model2 = ReservedIPCollectionInstanceNetworkInterfaceContextNext(**reserved_ip_collection_instance_network_interface_context_next_model_dict)
+ 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'
+
+ snapshot_remote_model = {} # SnapshotRemote
+ snapshot_remote_model['region'] = region_reference_model
+
+ # Construct a json representation of a SnapshotSourceSnapshot model
+ snapshot_source_snapshot_model_json = {}
+ snapshot_source_snapshot_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263'
+ snapshot_source_snapshot_model_json['deleted'] = snapshot_reference_deleted_model
+ snapshot_source_snapshot_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263'
+ snapshot_source_snapshot_model_json['id'] = 'r134-f6bfa329-0e36-433f-a3bb-0df632e79263'
+ snapshot_source_snapshot_model_json['name'] = 'my-snapshot'
+ snapshot_source_snapshot_model_json['remote'] = snapshot_remote_model
+ snapshot_source_snapshot_model_json['resource_type'] = 'snapshot'
+
+ # Construct a model instance of SnapshotSourceSnapshot by calling from_dict on the json representation
+ snapshot_source_snapshot_model = SnapshotSourceSnapshot.from_dict(snapshot_source_snapshot_model_json)
+ assert snapshot_source_snapshot_model != False
+
+ # Construct a model instance of SnapshotSourceSnapshot by calling from_dict on the json representation
+ snapshot_source_snapshot_model_dict = SnapshotSourceSnapshot.from_dict(snapshot_source_snapshot_model_json).__dict__
+ snapshot_source_snapshot_model2 = SnapshotSourceSnapshot(**snapshot_source_snapshot_model_dict)
# Verify the model instances are equivalent
- assert reserved_ip_collection_instance_network_interface_context_next_model == reserved_ip_collection_instance_network_interface_context_next_model2
+ assert snapshot_source_snapshot_model == snapshot_source_snapshot_model2
# Convert model instance back to dict and verify no loss of data
- reserved_ip_collection_instance_network_interface_context_next_model_json2 = reserved_ip_collection_instance_network_interface_context_next_model.to_dict()
- assert reserved_ip_collection_instance_network_interface_context_next_model_json2 == reserved_ip_collection_instance_network_interface_context_next_model_json
+ snapshot_source_snapshot_model_json2 = snapshot_source_snapshot_model.to_dict()
+ assert snapshot_source_snapshot_model_json2 == snapshot_source_snapshot_model_json
-class TestModel_ReservedIPCollectionNext:
+class TestModel_Subnet:
"""
- Test Class for ReservedIPCollectionNext
+ Test Class for Subnet
"""
- def test_reserved_ip_collection_next_serialization(self):
+ def test_subnet_serialization(self):
"""
- Test serialization/deserialization for ReservedIPCollectionNext
+ Test serialization/deserialization for Subnet
"""
- # 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 dict forms of any model objects needed in order to build this model.
- # 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
+ network_acl_reference_deleted_model = {} # NetworkACLReferenceDeleted
+ network_acl_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # 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)
+ 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'
- # Verify the model instances are equivalent
- assert reserved_ip_collection_next_model == reserved_ip_collection_next_model2
+ public_gateway_reference_deleted_model = {} # PublicGatewayReferenceDeleted
+ public_gateway_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_collection_next_model_json2 = reserved_ip_collection_next_model.to_dict()
- assert reserved_ip_collection_next_model_json2 == reserved_ip_collection_next_model_json
+ 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'
+
+ 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'
+ routing_table_reference_deleted_model = {} # RoutingTableReferenceDeleted
+ routing_table_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
-class TestModel_ReservedIPPatch:
- """
- Test Class for ReservedIPPatch
- """
+ 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_reserved_ip_patch_serialization(self):
- """
- Test serialization/deserialization for ReservedIPPatch
- """
+ 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 ReservedIPPatch model
- reserved_ip_patch_model_json = {}
- reserved_ip_patch_model_json['auto_delete'] = False
- reserved_ip_patch_model_json['name'] = 'my-reserved-ip'
+ vpc_reference_model = {} # VPCReference
+ vpc_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b'
+ vpc_reference_model['deleted'] = vpc_reference_deleted_model
+ vpc_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b'
+ vpc_reference_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b'
+ vpc_reference_model['name'] = 'my-vpc'
+ vpc_reference_model['resource_type'] = 'vpc'
- # Construct a 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
+ 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 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 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['resource_type'] = 'subnet'
+ 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 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 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 reserved_ip_patch_model == reserved_ip_patch_model2
+ assert subnet_model == subnet_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
+ subnet_model_json2 = subnet_model.to_dict()
+ assert subnet_model_json2 == subnet_model_json
-class TestModel_ReservedIPReference:
+class TestModel_SubnetCollection:
"""
- Test Class for ReservedIPReference
+ Test Class for SubnetCollection
"""
- def test_reserved_ip_reference_serialization(self):
+ def test_subnet_collection_serialization(self):
"""
- Test serialization/deserialization for ReservedIPReference
+ Test serialization/deserialization for SubnetCollection
"""
# 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'
+ subnet_collection_first_model = {} # SubnetCollectionFirst
+ subnet_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets?limit=20'
- # 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'
+ subnet_collection_next_model = {} # SubnetCollectionNext
+ subnet_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
- # 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
+ network_acl_reference_deleted_model = {} # NetworkACLReferenceDeleted
+ network_acl_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_dict = ReservedIPReference.from_dict(reserved_ip_reference_model_json).__dict__
- reserved_ip_reference_model2 = ReservedIPReference(**reserved_ip_reference_model_dict)
+ 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'
- # Verify the model instances are equivalent
- assert reserved_ip_reference_model == reserved_ip_reference_model2
+ public_gateway_reference_deleted_model = {} # PublicGatewayReferenceDeleted
+ public_gateway_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
+ 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'
+ 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_ReservedIPReferenceDeleted:
- """
- Test Class for ReservedIPReferenceDeleted
- """
+ routing_table_reference_deleted_model = {} # RoutingTableReferenceDeleted
+ routing_table_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
- """
+ 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'
- # 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'
+ vpc_reference_deleted_model = {} # VPCReferenceDeleted
+ vpc_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # 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
+ vpc_reference_model = {} # VPCReference
+ vpc_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b'
+ vpc_reference_model['deleted'] = vpc_reference_deleted_model
+ vpc_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b'
+ vpc_reference_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b'
+ vpc_reference_model['name'] = 'my-vpc'
+ vpc_reference_model['resource_type'] = 'vpc'
- # Construct a 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)
+ 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_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['resource_type'] = 'subnet'
+ 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 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 reserved_ip_reference_deleted_model == reserved_ip_reference_deleted_model2
+ assert subnet_collection_model == subnet_collection_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
+ subnet_collection_model_json2 = subnet_collection_model.to_dict()
+ assert subnet_collection_model_json2 == subnet_collection_model_json
-class TestModel_ResourceFilter:
+class TestModel_SubnetCollectionFirst:
"""
- Test Class for ResourceFilter
+ Test Class for SubnetCollectionFirst
"""
- def test_resource_filter_serialization(self):
+ def test_subnet_collection_first_serialization(self):
"""
- Test serialization/deserialization for ResourceFilter
+ Test serialization/deserialization for SubnetCollectionFirst
"""
- # Construct a json representation of a ResourceFilter model
- resource_filter_model_json = {}
- resource_filter_model_json['resource_type'] = 'vpn_gateway'
+ # 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 ResourceFilter by calling from_dict on the json representation
- resource_filter_model = ResourceFilter.from_dict(resource_filter_model_json)
- assert resource_filter_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 ResourceFilter by calling from_dict on the json representation
- resource_filter_model_dict = ResourceFilter.from_dict(resource_filter_model_json).__dict__
- resource_filter_model2 = ResourceFilter(**resource_filter_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 resource_filter_model == resource_filter_model2
+ assert subnet_collection_first_model == subnet_collection_first_model2
# Convert model instance back to dict and verify no loss of data
- resource_filter_model_json2 = resource_filter_model.to_dict()
- assert resource_filter_model_json2 == resource_filter_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_ResourceGroupReference:
+class TestModel_SubnetCollectionNext:
"""
- Test Class for ResourceGroupReference
+ Test Class for SubnetCollectionNext
"""
- def test_resource_group_reference_serialization(self):
+ def test_subnet_collection_next_serialization(self):
"""
- Test serialization/deserialization for ResourceGroupReference
+ Test serialization/deserialization for SubnetCollectionNext
"""
- # 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 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 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 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 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)
+ # 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 resource_group_reference_model == resource_group_reference_model2
+ assert subnet_collection_next_model == subnet_collection_next_model2
# 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
+ subnet_collection_next_model_json2 = subnet_collection_next_model.to_dict()
+ assert subnet_collection_next_model_json2 == subnet_collection_next_model_json
-class TestModel_Route:
+class TestModel_SubnetPatch:
"""
- Test Class for Route
+ Test Class for SubnetPatch
"""
- def test_route_serialization(self):
+ def test_subnet_patch_serialization(self):
"""
- Test serialization/deserialization for Route
+ Test serialization/deserialization for SubnetPatch
"""
# Construct dict forms of any model objects needed in order to build this model.
- route_next_hop_model = {} # RouteNextHopIP
- route_next_hop_model['address'] = '192.168.3.4'
+ network_acl_identity_model = {} # NetworkACLIdentityById
+ network_acl_identity_model['id'] = 'a4e28308-8ee7-46ab-8108-9f881f22bdbf'
- 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_public_gateway_patch_model = {} # SubnetPublicGatewayPatchPublicGatewayIdentityById
+ subnet_public_gateway_patch_model['id'] = 'dc5431ef-1fc6-4861-adc9-a59d077d1241'
- # 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/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840/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['priority'] = 1
- route_model_json['zone'] = zone_reference_model
+ routing_table_identity_model = {} # RoutingTableIdentityById
+ routing_table_identity_model['id'] = '6885e83f-03b2-4603-8a86-db2a0f55c840'
- # 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 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 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 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 route_model == route_model2
+ assert subnet_patch_model == subnet_patch_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
+ subnet_patch_model_json2 = subnet_patch_model.to_dict()
+ assert subnet_patch_model_json2 == subnet_patch_model_json
-class TestModel_RouteCollection:
+class TestModel_SubnetReference:
"""
- Test Class for RouteCollection
+ Test Class for SubnetReference
"""
- def test_route_collection_serialization(self):
+ def test_subnet_reference_serialization(self):
"""
- Test serialization/deserialization for RouteCollection
+ Test serialization/deserialization for SubnetReference
"""
# Construct dict forms of any model objects needed in order to build this model.
- 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'
+ subnet_reference_deleted_model = {} # SubnetReferenceDeleted
+ subnet_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- 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 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'
+ subnet_reference_model_json['resource_type'] = 'subnet'
- route_next_hop_model = {} # RouteNextHopIP
- route_next_hop_model['address'] = '192.168.3.4'
+ # 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
- 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 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)
- 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/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840/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['priority'] = 1
- route_model['zone'] = zone_reference_model
+ # Verify the model instances are equivalent
+ assert subnet_reference_model == subnet_reference_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
+
+
+class TestModel_SubnetReferenceDeleted:
+ """
+ Test Class for SubnetReferenceDeleted
+ """
+
+ def test_subnet_reference_deleted_serialization(self):
+ """
+ Test serialization/deserialization for SubnetReferenceDeleted
+ """
- # 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 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 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 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 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 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 route_collection_model == route_collection_model2
+ assert subnet_reference_deleted_model == subnet_reference_deleted_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
+ subnet_reference_deleted_model_json2 = subnet_reference_deleted_model.to_dict()
+ assert subnet_reference_deleted_model_json2 == subnet_reference_deleted_model_json
-class TestModel_RouteCollectionFirst:
+class TestModel_TrustedProfileReference:
"""
- Test Class for RouteCollectionFirst
+ Test Class for TrustedProfileReference
"""
- def test_route_collection_first_serialization(self):
+ def test_trusted_profile_reference_serialization(self):
"""
- Test serialization/deserialization for RouteCollectionFirst
+ Test serialization/deserialization for TrustedProfileReference
"""
- # 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 TrustedProfileReference model
+ trusted_profile_reference_model_json = {}
+ trusted_profile_reference_model_json['crn'] = 'crn:v1:bluemix:public:iam-identity::a/123456::profile:Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5'
+ trusted_profile_reference_model_json['id'] = 'Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5'
+ trusted_profile_reference_model_json['resource_type'] = 'trusted_profile'
- # Construct a model instance of 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 TrustedProfileReference by calling from_dict on the json representation
+ trusted_profile_reference_model = TrustedProfileReference.from_dict(trusted_profile_reference_model_json)
+ assert trusted_profile_reference_model != False
- # Construct a model instance of 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 TrustedProfileReference by calling from_dict on the json representation
+ trusted_profile_reference_model_dict = TrustedProfileReference.from_dict(trusted_profile_reference_model_json).__dict__
+ trusted_profile_reference_model2 = TrustedProfileReference(**trusted_profile_reference_model_dict)
# Verify the model instances are equivalent
- assert route_collection_first_model == route_collection_first_model2
+ assert trusted_profile_reference_model == trusted_profile_reference_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
+ trusted_profile_reference_model_json2 = trusted_profile_reference_model.to_dict()
+ assert trusted_profile_reference_model_json2 == trusted_profile_reference_model_json
-class TestModel_RouteCollectionNext:
+class TestModel_VCPU:
"""
- Test Class for RouteCollectionNext
+ Test Class for VCPU
"""
- def test_route_collection_next_serialization(self):
+ def test_vcpu_serialization(self):
"""
- Test serialization/deserialization for RouteCollectionNext
+ Test serialization/deserialization for VCPU
"""
- # 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 json representation of a VCPU model
+ vcpu_model_json = {}
+ vcpu_model_json['architecture'] = 'amd64'
+ vcpu_model_json['count'] = 4
+ vcpu_model_json['manufacturer'] = 'intel'
- # 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 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 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 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 route_collection_next_model == route_collection_next_model2
+ assert vcpu_model == vcpu_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
+ vcpu_model_json2 = vcpu_model.to_dict()
+ assert vcpu_model_json2 == vcpu_model_json
-class TestModel_RouteCollectionVPCContext:
+class TestModel_VPC:
"""
- Test Class for RouteCollectionVPCContext
+ Test Class for VPC
"""
- def test_route_collection_vpc_context_serialization(self):
+ def test_vpc_serialization(self):
"""
- Test serialization/deserialization for RouteCollectionVPCContext
+ Test serialization/deserialization for VPC
"""
# Construct dict forms of any model objects needed in order to build this model.
- route_collection_vpc_context_first_model = {} # RouteCollectionVPCContextFirst
- route_collection_vpc_context_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'
-
- route_collection_vpc_context_next_model = {} # RouteCollectionVPCContextNext
- route_collection_vpc_context_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'
-
- route_next_hop_model = {} # RouteNextHopIP
- route_next_hop_model['address'] = '192.168.3.4'
+ 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'
- route_collection_vpc_context_routes_item_model = {} # RouteCollectionVPCContextRoutesItem
- route_collection_vpc_context_routes_item_model['action'] = 'delegate'
- route_collection_vpc_context_routes_item_model['created_at'] = '2019-01-01T12:00:00Z'
- route_collection_vpc_context_routes_item_model['destination'] = '192.168.3.0/24'
- route_collection_vpc_context_routes_item_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531'
- route_collection_vpc_context_routes_item_model['id'] = '1a15dca5-7e33-45e1-b7c5-bc690e569531'
- route_collection_vpc_context_routes_item_model['lifecycle_state'] = 'stable'
- route_collection_vpc_context_routes_item_model['name'] = 'my-route-1'
- route_collection_vpc_context_routes_item_model['next_hop'] = route_next_hop_model
- route_collection_vpc_context_routes_item_model['priority'] = 1
- route_collection_vpc_context_routes_item_model['zone'] = zone_reference_model
+ vpccse_source_ip_model = {} # VPCCSESourceIP
+ vpccse_source_ip_model['ip'] = ip_model
+ vpccse_source_ip_model['zone'] = zone_reference_model
- # Construct a json representation of a RouteCollectionVPCContext model
- route_collection_vpc_context_model_json = {}
- route_collection_vpc_context_model_json['first'] = route_collection_vpc_context_first_model
- route_collection_vpc_context_model_json['limit'] = 20
- route_collection_vpc_context_model_json['next'] = route_collection_vpc_context_next_model
- route_collection_vpc_context_model_json['routes'] = [route_collection_vpc_context_routes_item_model]
- route_collection_vpc_context_model_json['total_count'] = 132
+ network_acl_reference_deleted_model = {} # NetworkACLReferenceDeleted
+ network_acl_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Construct a model instance of RouteCollectionVPCContext by calling from_dict on the json representation
- route_collection_vpc_context_model = RouteCollectionVPCContext.from_dict(route_collection_vpc_context_model_json)
- assert route_collection_vpc_context_model != False
+ 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 RouteCollectionVPCContext by calling from_dict on the json representation
- route_collection_vpc_context_model_dict = RouteCollectionVPCContext.from_dict(route_collection_vpc_context_model_json).__dict__
- route_collection_vpc_context_model2 = RouteCollectionVPCContext(**route_collection_vpc_context_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 route_collection_vpc_context_model == route_collection_vpc_context_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
- route_collection_vpc_context_model_json2 = route_collection_vpc_context_model.to_dict()
- assert route_collection_vpc_context_model_json2 == route_collection_vpc_context_model_json
+ 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'
-class TestModel_RouteCollectionVPCContextFirst:
- """
- Test Class for RouteCollectionVPCContextFirst
- """
+ dns_server_model = {} # DNSServer
+ dns_server_model['address'] = '192.168.3.4'
+ dns_server_model['zone_affinity'] = zone_reference_model
- def test_route_collection_vpc_context_first_serialization(self):
- """
- Test serialization/deserialization for RouteCollectionVPCContextFirst
- """
+ vpc_reference_dns_resolver_context_deleted_model = {} # VPCReferenceDNSResolverContextDeleted
+ vpc_reference_dns_resolver_context_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Construct a json representation of a RouteCollectionVPCContextFirst model
- route_collection_vpc_context_first_model_json = {}
- route_collection_vpc_context_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'
+ account_reference_model = {} # AccountReference
+ account_reference_model['id'] = 'aa2432b1fa4d4ace891e9b80fc104e34'
+ account_reference_model['resource_type'] = 'account'
- # Construct a model instance of RouteCollectionVPCContextFirst by calling from_dict on the json representation
- route_collection_vpc_context_first_model = RouteCollectionVPCContextFirst.from_dict(route_collection_vpc_context_first_model_json)
- assert route_collection_vpc_context_first_model != False
+ 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 model instance of RouteCollectionVPCContextFirst by calling from_dict on the json representation
- route_collection_vpc_context_first_model_dict = RouteCollectionVPCContextFirst.from_dict(route_collection_vpc_context_first_model_json).__dict__
- route_collection_vpc_context_first_model2 = RouteCollectionVPCContextFirst(**route_collection_vpc_context_first_model_dict)
+ vpc_remote_model = {} # VPCRemote
+ vpc_remote_model['account'] = account_reference_model
+ vpc_remote_model['region'] = region_reference_model
- # Verify the model instances are equivalent
- assert route_collection_vpc_context_first_model == route_collection_vpc_context_first_model2
+ vpc_reference_dns_resolver_context_model = {} # VPCReferenceDNSResolverContext
+ vpc_reference_dns_resolver_context_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b'
+ vpc_reference_dns_resolver_context_model['deleted'] = vpc_reference_dns_resolver_context_deleted_model
+ vpc_reference_dns_resolver_context_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b'
+ vpc_reference_dns_resolver_context_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b'
+ vpc_reference_dns_resolver_context_model['name'] = 'my-vpc'
+ vpc_reference_dns_resolver_context_model['remote'] = vpc_remote_model
+ vpc_reference_dns_resolver_context_model['resource_type'] = 'vpc'
- # Convert model instance back to dict and verify no loss of data
- route_collection_vpc_context_first_model_json2 = route_collection_vpc_context_first_model.to_dict()
- assert route_collection_vpc_context_first_model_json2 == route_collection_vpc_context_first_model_json
+ vpcdns_resolver_model = {} # VPCDNSResolverTypeDelegated
+ vpcdns_resolver_model['servers'] = [dns_server_model]
+ vpcdns_resolver_model['type'] = 'delegated'
+ vpcdns_resolver_model['vpc'] = vpc_reference_dns_resolver_context_model
+ vpcdns_model = {} # VPCDNS
+ vpcdns_model['enable_hub'] = True
+ vpcdns_model['resolution_binding_count'] = 0
+ vpcdns_model['resolver'] = vpcdns_resolver_model
-class TestModel_RouteCollectionVPCContextNext:
- """
- Test Class for RouteCollectionVPCContextNext
- """
+ vpc_health_reason_model = {} # VPCHealthReason
+ vpc_health_reason_model['code'] = 'dns_resolution_binding_failed'
+ vpc_health_reason_model['message'] = 'The VPC specified in the DNS resolution binding has been disconnected.'
+ vpc_health_reason_model['more_info'] = 'https://cloud.ibm.com/docs/vpc?topic=vpc-troubleshoot-hub-spoke-1'
- def test_route_collection_vpc_context_next_serialization(self):
- """
- Test serialization/deserialization for RouteCollectionVPCContextNext
- """
+ 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 RouteCollectionVPCContextNext model
- route_collection_vpc_context_next_model_json = {}
- route_collection_vpc_context_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 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['dns'] = vpcdns_model
+ vpc_model_json['health_reasons'] = [vpc_health_reason_model]
+ vpc_model_json['health_state'] = 'ok'
+ 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['resource_type'] = 'vpc'
+ vpc_model_json['status'] = 'available'
- # Construct a model instance of RouteCollectionVPCContextNext by calling from_dict on the json representation
- route_collection_vpc_context_next_model = RouteCollectionVPCContextNext.from_dict(route_collection_vpc_context_next_model_json)
- assert route_collection_vpc_context_next_model != False
+ # 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 RouteCollectionVPCContextNext by calling from_dict on the json representation
- route_collection_vpc_context_next_model_dict = RouteCollectionVPCContextNext.from_dict(route_collection_vpc_context_next_model_json).__dict__
- route_collection_vpc_context_next_model2 = RouteCollectionVPCContextNext(**route_collection_vpc_context_next_model_dict)
+ # 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 route_collection_vpc_context_next_model == route_collection_vpc_context_next_model2
+ assert vpc_model == vpc_model2
# Convert model instance back to dict and verify no loss of data
- route_collection_vpc_context_next_model_json2 = route_collection_vpc_context_next_model.to_dict()
- assert route_collection_vpc_context_next_model_json2 == route_collection_vpc_context_next_model_json
+ vpc_model_json2 = vpc_model.to_dict()
+ assert vpc_model_json2 == vpc_model_json
-class TestModel_RouteCollectionVPCContextRoutesItem:
+class TestModel_VPCCSESourceIP:
"""
- Test Class for RouteCollectionVPCContextRoutesItem
+ Test Class for VPCCSESourceIP
"""
- def test_route_collection_vpc_context_routes_item_serialization(self):
+ def test_vpccse_source_ip_serialization(self):
"""
- Test serialization/deserialization for RouteCollectionVPCContextRoutesItem
+ Test serialization/deserialization for VPCCSESourceIP
"""
# Construct dict forms of any model objects needed in order to build this model.
- route_next_hop_model = {} # RouteNextHopIP
- route_next_hop_model['address'] = '192.168.3.4'
+ 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'
- # Construct a json representation of a RouteCollectionVPCContextRoutesItem model
- route_collection_vpc_context_routes_item_model_json = {}
- route_collection_vpc_context_routes_item_model_json['action'] = 'delegate'
- route_collection_vpc_context_routes_item_model_json['created_at'] = '2019-01-01T12:00:00Z'
- route_collection_vpc_context_routes_item_model_json['destination'] = '192.168.3.0/24'
- route_collection_vpc_context_routes_item_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531'
- route_collection_vpc_context_routes_item_model_json['id'] = '1a15dca5-7e33-45e1-b7c5-bc690e569531'
- route_collection_vpc_context_routes_item_model_json['lifecycle_state'] = 'stable'
- route_collection_vpc_context_routes_item_model_json['name'] = 'my-route-1'
- route_collection_vpc_context_routes_item_model_json['next_hop'] = route_next_hop_model
- route_collection_vpc_context_routes_item_model_json['priority'] = 1
- route_collection_vpc_context_routes_item_model_json['zone'] = zone_reference_model
+ # 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
- # Construct a model instance of RouteCollectionVPCContextRoutesItem by calling from_dict on the json representation
- route_collection_vpc_context_routes_item_model = RouteCollectionVPCContextRoutesItem.from_dict(route_collection_vpc_context_routes_item_model_json)
- assert route_collection_vpc_context_routes_item_model != False
+ # 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
- # Construct a model instance of RouteCollectionVPCContextRoutesItem by calling from_dict on the json representation
- route_collection_vpc_context_routes_item_model_dict = RouteCollectionVPCContextRoutesItem.from_dict(route_collection_vpc_context_routes_item_model_json).__dict__
- route_collection_vpc_context_routes_item_model2 = RouteCollectionVPCContextRoutesItem(**route_collection_vpc_context_routes_item_model_dict)
+ # 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)
# Verify the model instances are equivalent
- assert route_collection_vpc_context_routes_item_model == route_collection_vpc_context_routes_item_model2
+ assert vpccse_source_ip_model == vpccse_source_ip_model2
# Convert model instance back to dict and verify no loss of data
- route_collection_vpc_context_routes_item_model_json2 = route_collection_vpc_context_routes_item_model.to_dict()
- assert route_collection_vpc_context_routes_item_model_json2 == route_collection_vpc_context_routes_item_model_json
+ vpccse_source_ip_model_json2 = vpccse_source_ip_model.to_dict()
+ assert vpccse_source_ip_model_json2 == vpccse_source_ip_model_json
-class TestModel_RoutePatch:
+class TestModel_VPCCollection:
"""
- Test Class for RoutePatch
+ Test Class for VPCCollection
"""
- def test_route_patch_serialization(self):
+ def test_vpc_collection_serialization(self):
"""
- Test serialization/deserialization for RoutePatch
+ Test serialization/deserialization for VPCCollection
"""
# Construct dict forms of any model objects needed in order to build this model.
- route_next_hop_patch_model = {} # RouteNextHopPatchRouteNextHopIPRouteNextHopIPSentinelIP
- route_next_hop_patch_model['address'] = '0.0.0.0'
+ vpc_collection_first_model = {} # VPCCollectionFirst
+ vpc_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs?limit=20'
- # Construct a json representation of a RoutePatch model
- route_patch_model_json = {}
- route_patch_model_json['name'] = 'my-route-2'
- route_patch_model_json['next_hop'] = route_next_hop_patch_model
- route_patch_model_json['priority'] = 1
+ vpc_collection_next_model = {} # VPCCollectionNext
+ vpc_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
- # 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
+ ip_model = {} # IP
+ ip_model['address'] = '192.168.3.4'
- # 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)
+ 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 route_patch_model == route_patch_model2
+ vpccse_source_ip_model = {} # VPCCSESourceIP
+ vpccse_source_ip_model['ip'] = ip_model
+ vpccse_source_ip_model['zone'] = zone_reference_model
- # 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
+ 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'
-class TestModel_RoutePrototype:
- """
- Test Class for RoutePrototype
- """
+ routing_table_reference_deleted_model = {} # RoutingTableReferenceDeleted
+ routing_table_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- def test_route_prototype_serialization(self):
- """
- Test serialization/deserialization for RoutePrototype
- """
+ 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'
- # 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'
- route_prototype_next_hop_model = {} # RoutePrototypeNextHopRouteNextHopPrototypeRouteNextHopIPRouteNextHopPrototypeRouteNextHopIPRouteNextHopIPSentinelIP
- route_prototype_next_hop_model['address'] = '0.0.0.0'
+ 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'
- zone_identity_model = {} # ZoneIdentityByName
- zone_identity_model['name'] = 'us-south-1'
+ dns_server_model = {} # DNSServer
+ dns_server_model['address'] = '192.168.3.4'
+ dns_server_model['zone_affinity'] = zone_reference_model
- # 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-1'
- route_prototype_model_json['next_hop'] = route_prototype_next_hop_model
- route_prototype_model_json['priority'] = 1
- route_prototype_model_json['zone'] = zone_identity_model
+ vpc_reference_dns_resolver_context_deleted_model = {} # VPCReferenceDNSResolverContextDeleted
+ vpc_reference_dns_resolver_context_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 = RoutePrototype.from_dict(route_prototype_model_json)
- assert route_prototype_model != False
+ account_reference_model = {} # AccountReference
+ account_reference_model['id'] = 'aa2432b1fa4d4ace891e9b80fc104e34'
+ account_reference_model['resource_type'] = 'account'
- # 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)
+ 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'
- # Verify the model instances are equivalent
- assert route_prototype_model == route_prototype_model2
+ vpc_remote_model = {} # VPCRemote
+ vpc_remote_model['account'] = account_reference_model
+ vpc_remote_model['region'] = region_reference_model
- # 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
+ vpc_reference_dns_resolver_context_model = {} # VPCReferenceDNSResolverContext
+ vpc_reference_dns_resolver_context_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b'
+ vpc_reference_dns_resolver_context_model['deleted'] = vpc_reference_dns_resolver_context_deleted_model
+ vpc_reference_dns_resolver_context_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b'
+ vpc_reference_dns_resolver_context_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b'
+ vpc_reference_dns_resolver_context_model['name'] = 'my-vpc'
+ vpc_reference_dns_resolver_context_model['remote'] = vpc_remote_model
+ vpc_reference_dns_resolver_context_model['resource_type'] = 'vpc'
+ vpcdns_resolver_model = {} # VPCDNSResolverTypeDelegated
+ vpcdns_resolver_model['servers'] = [dns_server_model]
+ vpcdns_resolver_model['type'] = 'delegated'
+ vpcdns_resolver_model['vpc'] = vpc_reference_dns_resolver_context_model
-class TestModel_RouteReference:
- """
- Test Class for RouteReference
- """
+ vpcdns_model = {} # VPCDNS
+ vpcdns_model['enable_hub'] = True
+ vpcdns_model['resolution_binding_count'] = 0
+ vpcdns_model['resolver'] = vpcdns_resolver_model
- def test_route_reference_serialization(self):
- """
- Test serialization/deserialization for RouteReference
- """
+ vpc_health_reason_model = {} # VPCHealthReason
+ vpc_health_reason_model['code'] = 'dns_resolution_binding_failed'
+ vpc_health_reason_model['message'] = 'The VPC specified in the DNS resolution binding has been disconnected.'
+ vpc_health_reason_model['more_info'] = 'https://cloud.ibm.com/docs/vpc?topic=vpc-troubleshoot-hub-spoke-1'
- # 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'
+ 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['dns'] = vpcdns_model
+ vpc_model['health_reasons'] = [vpc_health_reason_model]
+ vpc_model['health_state'] = 'ok'
+ 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['resource_type'] = 'vpc'
+ vpc_model['status'] = 'available'
- # 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/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840/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 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 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 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 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 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 route_reference_model == route_reference_model2
+ assert vpc_collection_model == vpc_collection_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
+ # 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
-class TestModel_RouteReferenceDeleted:
+class TestModel_VPCCollectionFirst:
"""
- Test Class for RouteReferenceDeleted
+ Test Class for VPCCollectionFirst
"""
- def test_route_reference_deleted_serialization(self):
+ def test_vpc_collection_first_serialization(self):
"""
- Test serialization/deserialization for RouteReferenceDeleted
+ Test serialization/deserialization for VPCCollectionFirst
"""
- # 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 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 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 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 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)
+ # 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 route_reference_deleted_model == route_reference_deleted_model2
+ assert vpc_collection_first_model == vpc_collection_first_model2
# 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
+ vpc_collection_first_model_json2 = vpc_collection_first_model.to_dict()
+ assert vpc_collection_first_model_json2 == vpc_collection_first_model_json
-class TestModel_RoutingTable:
+class TestModel_VPCCollectionNext:
"""
- Test Class for RoutingTable
+ Test Class for VPCCollectionNext
"""
- def test_routing_table_serialization(self):
+ def test_vpc_collection_next_serialization(self):
"""
- Test serialization/deserialization for RoutingTable
+ Test serialization/deserialization for VPCCollectionNext
"""
- # Construct dict forms of any model objects needed in order to build this model.
-
- resource_filter_model = {} # ResourceFilter
- resource_filter_model['resource_type'] = 'vpn_server'
-
- 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/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840/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'
- subnet_reference_model['resource_type'] = 'subnet'
-
- # Construct a json representation of a RoutingTable model
- routing_table_model_json = {}
- routing_table_model_json['accept_routes_from'] = [resource_filter_model]
- 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_internet_ingress'] = True
- routing_table_model_json['route_transit_gateway_ingress'] = True
- routing_table_model_json['route_vpc_zone_ingress'] = True
- routing_table_model_json['routes'] = [route_reference_model]
- routing_table_model_json['subnets'] = [subnet_reference_model]
+ # 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 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 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 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 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 routing_table_model == routing_table_model2
+ assert vpc_collection_next_model == vpc_collection_next_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
+ vpc_collection_next_model_json2 = vpc_collection_next_model.to_dict()
+ assert vpc_collection_next_model_json2 == vpc_collection_next_model_json
-class TestModel_RoutingTableCollection:
+class TestModel_VPCDNS:
"""
- Test Class for RoutingTableCollection
+ Test Class for VPCDNS
"""
- def test_routing_table_collection_serialization(self):
+ def test_vpcdns_serialization(self):
"""
- Test serialization/deserialization for RoutingTableCollection
+ Test serialization/deserialization for VPCDNS
"""
# 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'
+ 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'
- 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'
+ dns_server_model = {} # DNSServer
+ dns_server_model['address'] = '192.168.3.4'
+ dns_server_model['zone_affinity'] = zone_reference_model
- resource_filter_model = {} # ResourceFilter
- resource_filter_model['resource_type'] = 'vpn_server'
+ vpc_reference_dns_resolver_context_deleted_model = {} # VPCReferenceDNSResolverContextDeleted
+ vpc_reference_dns_resolver_context_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- route_reference_deleted_model = {} # RouteReferenceDeleted
- route_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ account_reference_model = {} # AccountReference
+ account_reference_model['id'] = 'aa2432b1fa4d4ace891e9b80fc104e34'
+ account_reference_model['resource_type'] = 'account'
- 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/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531'
- route_reference_model['id'] = '1a15dca5-7e33-45e1-b7c5-bc690e569531'
- route_reference_model['name'] = 'my-route-1'
+ 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'
- subnet_reference_deleted_model = {} # SubnetReferenceDeleted
- subnet_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ vpc_remote_model = {} # VPCRemote
+ vpc_remote_model['account'] = account_reference_model
+ vpc_remote_model['region'] = region_reference_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'
- subnet_reference_model['resource_type'] = 'subnet'
+ vpc_reference_dns_resolver_context_model = {} # VPCReferenceDNSResolverContext
+ vpc_reference_dns_resolver_context_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b'
+ vpc_reference_dns_resolver_context_model['deleted'] = vpc_reference_dns_resolver_context_deleted_model
+ vpc_reference_dns_resolver_context_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b'
+ vpc_reference_dns_resolver_context_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b'
+ vpc_reference_dns_resolver_context_model['name'] = 'my-vpc'
+ vpc_reference_dns_resolver_context_model['remote'] = vpc_remote_model
+ vpc_reference_dns_resolver_context_model['resource_type'] = 'vpc'
- routing_table_model = {} # RoutingTable
- routing_table_model['accept_routes_from'] = [resource_filter_model]
- 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_internet_ingress'] = True
- routing_table_model['route_transit_gateway_ingress'] = True
- routing_table_model['route_vpc_zone_ingress'] = True
- routing_table_model['routes'] = [route_reference_model]
- routing_table_model['subnets'] = [subnet_reference_model]
+ vpcdns_resolver_model = {} # VPCDNSResolverTypeDelegated
+ vpcdns_resolver_model['servers'] = [dns_server_model]
+ vpcdns_resolver_model['type'] = 'delegated'
+ vpcdns_resolver_model['vpc'] = vpc_reference_dns_resolver_context_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 VPCDNS model
+ vpcdns_model_json = {}
+ vpcdns_model_json['enable_hub'] = True
+ vpcdns_model_json['resolution_binding_count'] = 0
+ vpcdns_model_json['resolver'] = vpcdns_resolver_model
- # 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 VPCDNS by calling from_dict on the json representation
+ vpcdns_model = VPCDNS.from_dict(vpcdns_model_json)
+ assert vpcdns_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 VPCDNS by calling from_dict on the json representation
+ vpcdns_model_dict = VPCDNS.from_dict(vpcdns_model_json).__dict__
+ vpcdns_model2 = VPCDNS(**vpcdns_model_dict)
# Verify the model instances are equivalent
- assert routing_table_collection_model == routing_table_collection_model2
+ assert vpcdns_model == vpcdns_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
+ vpcdns_model_json2 = vpcdns_model.to_dict()
+ assert vpcdns_model_json2 == vpcdns_model_json
-class TestModel_RoutingTableCollectionFirst:
+class TestModel_VPCDNSPatch:
"""
- Test Class for RoutingTableCollectionFirst
+ Test Class for VPCDNSPatch
"""
- def test_routing_table_collection_first_serialization(self):
+ def test_vpcdns_patch_serialization(self):
"""
- Test serialization/deserialization for RoutingTableCollectionFirst
+ Test serialization/deserialization for VPCDNSPatch
"""
- # 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 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 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)
-
- # Verify the model instances are equivalent
- assert routing_table_collection_first_model == routing_table_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
- 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
+ zone_identity_model = {} # ZoneIdentityByName
+ zone_identity_model['name'] = 'us-south-1'
+ dns_server_prototype_model = {} # DNSServerPrototype
+ dns_server_prototype_model['address'] = '192.168.3.4'
+ dns_server_prototype_model['zone_affinity'] = zone_identity_model
-class TestModel_RoutingTableCollectionNext:
- """
- Test Class for RoutingTableCollectionNext
- """
+ vpcdns_resolver_vpc_patch_model = {} # VPCDNSResolverVPCPatchVPCIdentityById
+ vpcdns_resolver_vpc_patch_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b'
- def test_routing_table_collection_next_serialization(self):
- """
- Test serialization/deserialization for RoutingTableCollectionNext
- """
+ vpcdns_resolver_patch_model = {} # VPCDNSResolverPatch
+ vpcdns_resolver_patch_model['manual_servers'] = [dns_server_prototype_model]
+ vpcdns_resolver_patch_model['type'] = 'delegated'
+ vpcdns_resolver_patch_model['vpc'] = vpcdns_resolver_vpc_patch_model
- # 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 a json representation of a VPCDNSPatch model
+ vpcdns_patch_model_json = {}
+ vpcdns_patch_model_json['enable_hub'] = True
+ vpcdns_patch_model_json['resolver'] = vpcdns_resolver_patch_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
+ # Construct a model instance of VPCDNSPatch by calling from_dict on the json representation
+ vpcdns_patch_model = VPCDNSPatch.from_dict(vpcdns_patch_model_json)
+ assert vpcdns_patch_model != False
- # 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 model instance of VPCDNSPatch by calling from_dict on the json representation
+ vpcdns_patch_model_dict = VPCDNSPatch.from_dict(vpcdns_patch_model_json).__dict__
+ vpcdns_patch_model2 = VPCDNSPatch(**vpcdns_patch_model_dict)
# Verify the model instances are equivalent
- assert routing_table_collection_next_model == routing_table_collection_next_model2
+ assert vpcdns_patch_model == vpcdns_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
+ vpcdns_patch_model_json2 = vpcdns_patch_model.to_dict()
+ assert vpcdns_patch_model_json2 == vpcdns_patch_model_json
-class TestModel_RoutingTablePatch:
+class TestModel_VPCDNSPrototype:
"""
- Test Class for RoutingTablePatch
+ Test Class for VPCDNSPrototype
"""
- def test_routing_table_patch_serialization(self):
+ def test_vpcdns_prototype_serialization(self):
"""
- Test serialization/deserialization for RoutingTablePatch
+ Test serialization/deserialization for VPCDNSPrototype
"""
# Construct dict forms of any model objects needed in order to build this model.
- resource_filter_model = {} # ResourceFilter
- resource_filter_model['resource_type'] = 'vpn_server'
+ zone_identity_model = {} # ZoneIdentityByName
+ zone_identity_model['name'] = 'us-south-1'
- # Construct a json representation of a RoutingTablePatch model
- routing_table_patch_model_json = {}
- routing_table_patch_model_json['accept_routes_from'] = [resource_filter_model]
- routing_table_patch_model_json['name'] = 'my-routing-table-2'
- routing_table_patch_model_json['route_direct_link_ingress'] = True
- routing_table_patch_model_json['route_internet_ingress'] = True
- routing_table_patch_model_json['route_transit_gateway_ingress'] = True
- routing_table_patch_model_json['route_vpc_zone_ingress'] = True
+ dns_server_prototype_model = {} # DNSServerPrototype
+ dns_server_prototype_model['address'] = '192.168.3.4'
+ dns_server_prototype_model['zone_affinity'] = zone_identity_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
+ vpcdns_resolver_prototype_model = {} # VPCDNSResolverPrototypeVPCDNSResolverTypeManualPrototype
+ vpcdns_resolver_prototype_model['manual_servers'] = [dns_server_prototype_model]
+ vpcdns_resolver_prototype_model['type'] = 'manual'
- # 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 VPCDNSPrototype model
+ vpcdns_prototype_model_json = {}
+ vpcdns_prototype_model_json['enable_hub'] = False
+ vpcdns_prototype_model_json['resolver'] = vpcdns_resolver_prototype_model
+
+ # Construct a model instance of VPCDNSPrototype by calling from_dict on the json representation
+ vpcdns_prototype_model = VPCDNSPrototype.from_dict(vpcdns_prototype_model_json)
+ assert vpcdns_prototype_model != False
+
+ # Construct a model instance of VPCDNSPrototype by calling from_dict on the json representation
+ vpcdns_prototype_model_dict = VPCDNSPrototype.from_dict(vpcdns_prototype_model_json).__dict__
+ vpcdns_prototype_model2 = VPCDNSPrototype(**vpcdns_prototype_model_dict)
# Verify the model instances are equivalent
- assert routing_table_patch_model == routing_table_patch_model2
+ assert vpcdns_prototype_model == vpcdns_prototype_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
+ vpcdns_prototype_model_json2 = vpcdns_prototype_model.to_dict()
+ assert vpcdns_prototype_model_json2 == vpcdns_prototype_model_json
-class TestModel_RoutingTableReference:
+class TestModel_VPCDNSResolutionBinding:
"""
- Test Class for RoutingTableReference
+ Test Class for VPCDNSResolutionBinding
"""
- def test_routing_table_reference_serialization(self):
+ def test_vpcdns_resolution_binding_serialization(self):
"""
- Test serialization/deserialization for RoutingTableReference
+ Test serialization/deserialization for VPCDNSResolutionBinding
"""
# 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 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)
+ account_reference_model = {} # AccountReference
+ account_reference_model['id'] = 'aa2432b1fa4d4ace891e9b80fc104e34'
+ account_reference_model['resource_type'] = 'account'
- # Verify the model instances are equivalent
- assert routing_table_reference_model == routing_table_reference_model2
+ 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'
- # 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
+ endpoint_gateway_remote_model = {} # EndpointGatewayRemote
+ endpoint_gateway_remote_model['account'] = account_reference_model
+ endpoint_gateway_remote_model['region'] = region_reference_model
+ endpoint_gateway_reference_remote_model = {} # EndpointGatewayReferenceRemote
+ endpoint_gateway_reference_remote_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5'
+ endpoint_gateway_reference_remote_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5'
+ endpoint_gateway_reference_remote_model['id'] = 'r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5'
+ endpoint_gateway_reference_remote_model['name'] = 'my-endpoint-gateway'
+ endpoint_gateway_reference_remote_model['remote'] = endpoint_gateway_remote_model
+ endpoint_gateway_reference_remote_model['resource_type'] = 'endpoint_gateway'
-class TestModel_RoutingTableReferenceDeleted:
- """
- Test Class for RoutingTableReferenceDeleted
- """
+ vpc_remote_model = {} # VPCRemote
+ vpc_remote_model['account'] = account_reference_model
+ vpc_remote_model['region'] = region_reference_model
- def test_routing_table_reference_deleted_serialization(self):
- """
- Test serialization/deserialization for RoutingTableReferenceDeleted
- """
+ vpc_reference_remote_model = {} # VPCReferenceRemote
+ vpc_reference_remote_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b'
+ vpc_reference_remote_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b'
+ vpc_reference_remote_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b'
+ vpc_reference_remote_model['name'] = 'my-vpc'
+ vpc_reference_remote_model['remote'] = vpc_remote_model
+ vpc_reference_remote_model['resource_type'] = 'vpc'
- # 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 VPCDNSResolutionBinding model
+ vpcdns_resolution_binding_model_json = {}
+ vpcdns_resolution_binding_model_json['created_at'] = '2019-01-01T12:00:00Z'
+ vpcdns_resolution_binding_model_json['endpoint_gateways'] = [endpoint_gateway_reference_remote_model]
+ vpcdns_resolution_binding_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-982d72b7-db1b-4606-afb2-ed6bd4b0bed1/dns_resolution_bindings/r006-8a524686-fcf6-4947-a59b-188c1ed78ad1'
+ vpcdns_resolution_binding_model_json['id'] = 'r006-8a524686-fcf6-4947-a59b-188c1ed78ad1'
+ vpcdns_resolution_binding_model_json['lifecycle_state'] = 'stable'
+ vpcdns_resolution_binding_model_json['name'] = 'my-dns-resolution-binding'
+ vpcdns_resolution_binding_model_json['resource_type'] = 'vpc_dns_resolution_binding'
+ vpcdns_resolution_binding_model_json['vpc'] = vpc_reference_remote_model
- # 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 VPCDNSResolutionBinding by calling from_dict on the json representation
+ vpcdns_resolution_binding_model = VPCDNSResolutionBinding.from_dict(vpcdns_resolution_binding_model_json)
+ assert vpcdns_resolution_binding_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 VPCDNSResolutionBinding by calling from_dict on the json representation
+ vpcdns_resolution_binding_model_dict = VPCDNSResolutionBinding.from_dict(vpcdns_resolution_binding_model_json).__dict__
+ vpcdns_resolution_binding_model2 = VPCDNSResolutionBinding(**vpcdns_resolution_binding_model_dict)
# Verify the model instances are equivalent
- assert routing_table_reference_deleted_model == routing_table_reference_deleted_model2
+ assert vpcdns_resolution_binding_model == vpcdns_resolution_binding_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
+ vpcdns_resolution_binding_model_json2 = vpcdns_resolution_binding_model.to_dict()
+ assert vpcdns_resolution_binding_model_json2 == vpcdns_resolution_binding_model_json
-class TestModel_SecurityGroup:
+class TestModel_VPCDNSResolutionBindingCollection:
"""
- Test Class for SecurityGroup
+ Test Class for VPCDNSResolutionBindingCollection
"""
- def test_security_group_serialization(self):
+ def test_vpcdns_resolution_binding_collection_serialization(self):
"""
- Test serialization/deserialization for SecurityGroup
+ Test serialization/deserialization for VPCDNSResolutionBindingCollection
"""
# 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'
+ account_reference_model = {} # AccountReference
+ account_reference_model['id'] = 'aa2432b1fa4d4ace891e9b80fc104e34'
+ account_reference_model['resource_type'] = 'account'
- security_group_rule_remote_model = {} # SecurityGroupRuleRemoteIP
- security_group_rule_remote_model['address'] = '192.168.3.4'
+ 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'
- 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'
+ endpoint_gateway_remote_model = {} # EndpointGatewayRemote
+ endpoint_gateway_remote_model['account'] = account_reference_model
+ endpoint_gateway_remote_model['region'] = region_reference_model
- network_interface_reference_target_context_deleted_model = {} # NetworkInterfaceReferenceTargetContextDeleted
- network_interface_reference_target_context_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ endpoint_gateway_reference_remote_model = {} # EndpointGatewayReferenceRemote
+ endpoint_gateway_reference_remote_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5'
+ endpoint_gateway_reference_remote_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5'
+ endpoint_gateway_reference_remote_model['id'] = 'r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5'
+ endpoint_gateway_reference_remote_model['name'] = 'my-endpoint-gateway'
+ endpoint_gateway_reference_remote_model['remote'] = endpoint_gateway_remote_model
+ endpoint_gateway_reference_remote_model['resource_type'] = 'endpoint_gateway'
- 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-instance-network-interface'
- security_group_target_reference_model['resource_type'] = 'network_interface'
+ vpc_remote_model = {} # VPCRemote
+ vpc_remote_model['account'] = account_reference_model
+ vpc_remote_model['region'] = region_reference_model
- vpc_reference_deleted_model = {} # VPCReferenceDeleted
- vpc_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ vpc_reference_remote_model = {} # VPCReferenceRemote
+ vpc_reference_remote_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b'
+ vpc_reference_remote_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b'
+ vpc_reference_remote_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b'
+ vpc_reference_remote_model['name'] = 'my-vpc'
+ vpc_reference_remote_model['remote'] = vpc_remote_model
+ vpc_reference_remote_model['resource_type'] = 'vpc'
- vpc_reference_model = {} # VPCReference
- vpc_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b'
- vpc_reference_model['deleted'] = vpc_reference_deleted_model
- vpc_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b'
- vpc_reference_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b'
- vpc_reference_model['name'] = 'my-vpc'
- vpc_reference_model['resource_type'] = 'vpc'
+ vpcdns_resolution_binding_model = {} # VPCDNSResolutionBinding
+ vpcdns_resolution_binding_model['created_at'] = '2019-01-01T12:00:00Z'
+ vpcdns_resolution_binding_model['endpoint_gateways'] = [endpoint_gateway_reference_remote_model]
+ vpcdns_resolution_binding_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-982d72b7-db1b-4606-afb2-ed6bd4b0bed1/dns_resolution_bindings/r006-8a524686-fcf6-4947-a59b-188c1ed78ad1'
+ vpcdns_resolution_binding_model['id'] = 'r006-8a524686-fcf6-4947-a59b-188c1ed78ad1'
+ vpcdns_resolution_binding_model['lifecycle_state'] = 'stable'
+ vpcdns_resolution_binding_model['name'] = 'my-dns-resolution-binding'
+ vpcdns_resolution_binding_model['resource_type'] = 'vpc_dns_resolution_binding'
+ vpcdns_resolution_binding_model['vpc'] = vpc_reference_remote_model
- # 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['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
+ vpcdns_resolution_binding_collection_first_model = {} # VPCDNSResolutionBindingCollectionFirst
+ vpcdns_resolution_binding_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-982d72b7-db1b-4606-afb2-ed6bd4b0bed1/dns_resolution_bindings?limit=20'
+
+ vpcdns_resolution_binding_collection_next_model = {} # VPCDNSResolutionBindingCollectionNext
+ vpcdns_resolution_binding_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-982d72b7-db1b-4606-afb2-ed6bd4b0bed1/dns_resolution_bindings?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
- # 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 VPCDNSResolutionBindingCollection model
+ vpcdns_resolution_binding_collection_model_json = {}
+ vpcdns_resolution_binding_collection_model_json['dns_resolution_bindings'] = [vpcdns_resolution_binding_model]
+ vpcdns_resolution_binding_collection_model_json['first'] = vpcdns_resolution_binding_collection_first_model
+ vpcdns_resolution_binding_collection_model_json['limit'] = 20
+ vpcdns_resolution_binding_collection_model_json['next'] = vpcdns_resolution_binding_collection_next_model
+ vpcdns_resolution_binding_collection_model_json['total_count'] = 132
- # 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 VPCDNSResolutionBindingCollection by calling from_dict on the json representation
+ vpcdns_resolution_binding_collection_model = VPCDNSResolutionBindingCollection.from_dict(vpcdns_resolution_binding_collection_model_json)
+ assert vpcdns_resolution_binding_collection_model != False
+
+ # Construct a model instance of VPCDNSResolutionBindingCollection by calling from_dict on the json representation
+ vpcdns_resolution_binding_collection_model_dict = VPCDNSResolutionBindingCollection.from_dict(vpcdns_resolution_binding_collection_model_json).__dict__
+ vpcdns_resolution_binding_collection_model2 = VPCDNSResolutionBindingCollection(**vpcdns_resolution_binding_collection_model_dict)
# Verify the model instances are equivalent
- assert security_group_model == security_group_model2
+ assert vpcdns_resolution_binding_collection_model == vpcdns_resolution_binding_collection_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
+ vpcdns_resolution_binding_collection_model_json2 = vpcdns_resolution_binding_collection_model.to_dict()
+ assert vpcdns_resolution_binding_collection_model_json2 == vpcdns_resolution_binding_collection_model_json
-class TestModel_SecurityGroupCollection:
+class TestModel_VPCDNSResolutionBindingCollectionFirst:
"""
- Test Class for SecurityGroupCollection
+ Test Class for VPCDNSResolutionBindingCollectionFirst
"""
- def test_security_group_collection_serialization(self):
+ def test_vpcdns_resolution_binding_collection_first_serialization(self):
"""
- Test serialization/deserialization for SecurityGroupCollection
+ Test serialization/deserialization for VPCDNSResolutionBindingCollectionFirst
"""
- # 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'
-
- 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 VPCDNSResolutionBindingCollectionFirst model
+ vpcdns_resolution_binding_collection_first_model_json = {}
+ vpcdns_resolution_binding_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-982d72b7-db1b-4606-afb2-ed6bd4b0bed1/dns_resolution_bindings?limit=20'
- security_group_rule_remote_model = {} # SecurityGroupRuleRemoteIP
- security_group_rule_remote_model['address'] = '192.168.3.4'
+ # Construct a model instance of VPCDNSResolutionBindingCollectionFirst by calling from_dict on the json representation
+ vpcdns_resolution_binding_collection_first_model = VPCDNSResolutionBindingCollectionFirst.from_dict(vpcdns_resolution_binding_collection_first_model_json)
+ assert vpcdns_resolution_binding_collection_first_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 VPCDNSResolutionBindingCollectionFirst by calling from_dict on the json representation
+ vpcdns_resolution_binding_collection_first_model_dict = VPCDNSResolutionBindingCollectionFirst.from_dict(vpcdns_resolution_binding_collection_first_model_json).__dict__
+ vpcdns_resolution_binding_collection_first_model2 = VPCDNSResolutionBindingCollectionFirst(**vpcdns_resolution_binding_collection_first_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 vpcdns_resolution_binding_collection_first_model == vpcdns_resolution_binding_collection_first_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-instance-network-interface'
- security_group_target_reference_model['resource_type'] = 'network_interface'
+ # Convert model instance back to dict and verify no loss of data
+ vpcdns_resolution_binding_collection_first_model_json2 = vpcdns_resolution_binding_collection_first_model.to_dict()
+ assert vpcdns_resolution_binding_collection_first_model_json2 == vpcdns_resolution_binding_collection_first_model_json
- vpc_reference_deleted_model = {} # VPCReferenceDeleted
- vpc_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- vpc_reference_model = {} # VPCReference
- vpc_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b'
- vpc_reference_model['deleted'] = vpc_reference_deleted_model
- vpc_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b'
- vpc_reference_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b'
- vpc_reference_model['name'] = 'my-vpc'
- vpc_reference_model['resource_type'] = 'vpc'
+class TestModel_VPCDNSResolutionBindingCollectionNext:
+ """
+ Test Class for VPCDNSResolutionBindingCollectionNext
+ """
- 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['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_vpcdns_resolution_binding_collection_next_serialization(self):
+ """
+ Test serialization/deserialization for VPCDNSResolutionBindingCollectionNext
+ """
- # 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 json representation of a VPCDNSResolutionBindingCollectionNext model
+ vpcdns_resolution_binding_collection_next_model_json = {}
+ vpcdns_resolution_binding_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-982d72b7-db1b-4606-afb2-ed6bd4b0bed1/dns_resolution_bindings?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
- # 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 VPCDNSResolutionBindingCollectionNext by calling from_dict on the json representation
+ vpcdns_resolution_binding_collection_next_model = VPCDNSResolutionBindingCollectionNext.from_dict(vpcdns_resolution_binding_collection_next_model_json)
+ assert vpcdns_resolution_binding_collection_next_model != False
- # 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)
+ # Construct a model instance of VPCDNSResolutionBindingCollectionNext by calling from_dict on the json representation
+ vpcdns_resolution_binding_collection_next_model_dict = VPCDNSResolutionBindingCollectionNext.from_dict(vpcdns_resolution_binding_collection_next_model_json).__dict__
+ vpcdns_resolution_binding_collection_next_model2 = VPCDNSResolutionBindingCollectionNext(**vpcdns_resolution_binding_collection_next_model_dict)
# Verify the model instances are equivalent
- assert security_group_collection_model == security_group_collection_model2
+ assert vpcdns_resolution_binding_collection_next_model == vpcdns_resolution_binding_collection_next_model2
# 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
+ vpcdns_resolution_binding_collection_next_model_json2 = vpcdns_resolution_binding_collection_next_model.to_dict()
+ assert vpcdns_resolution_binding_collection_next_model_json2 == vpcdns_resolution_binding_collection_next_model_json
-class TestModel_SecurityGroupCollectionFirst:
+class TestModel_VPCDNSResolutionBindingPatch:
"""
- Test Class for SecurityGroupCollectionFirst
+ Test Class for VPCDNSResolutionBindingPatch
"""
- def test_security_group_collection_first_serialization(self):
+ def test_vpcdns_resolution_binding_patch_serialization(self):
"""
- Test serialization/deserialization for SecurityGroupCollectionFirst
+ Test serialization/deserialization for VPCDNSResolutionBindingPatch
"""
- # 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 json representation of a VPCDNSResolutionBindingPatch model
+ vpcdns_resolution_binding_patch_model_json = {}
+ vpcdns_resolution_binding_patch_model_json['name'] = 'my-dns-resolution-binding-updated'
- # 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 VPCDNSResolutionBindingPatch by calling from_dict on the json representation
+ vpcdns_resolution_binding_patch_model = VPCDNSResolutionBindingPatch.from_dict(vpcdns_resolution_binding_patch_model_json)
+ assert vpcdns_resolution_binding_patch_model != False
- # 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)
+ # Construct a model instance of VPCDNSResolutionBindingPatch by calling from_dict on the json representation
+ vpcdns_resolution_binding_patch_model_dict = VPCDNSResolutionBindingPatch.from_dict(vpcdns_resolution_binding_patch_model_json).__dict__
+ vpcdns_resolution_binding_patch_model2 = VPCDNSResolutionBindingPatch(**vpcdns_resolution_binding_patch_model_dict)
# Verify the model instances are equivalent
- assert security_group_collection_first_model == security_group_collection_first_model2
+ assert vpcdns_resolution_binding_patch_model == vpcdns_resolution_binding_patch_model2
# 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
+ vpcdns_resolution_binding_patch_model_json2 = vpcdns_resolution_binding_patch_model.to_dict()
+ assert vpcdns_resolution_binding_patch_model_json2 == vpcdns_resolution_binding_patch_model_json
-class TestModel_SecurityGroupCollectionNext:
+class TestModel_VPCDNSResolverPatch:
"""
- Test Class for SecurityGroupCollectionNext
+ Test Class for VPCDNSResolverPatch
"""
- def test_security_group_collection_next_serialization(self):
+ def test_vpcdns_resolver_patch_serialization(self):
"""
- Test serialization/deserialization for SecurityGroupCollectionNext
+ Test serialization/deserialization for VPCDNSResolverPatch
"""
- # 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 dict forms of any model objects needed in order to build this 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
+ zone_identity_model = {} # ZoneIdentityByName
+ zone_identity_model['name'] = 'us-south-1'
- # 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)
+ dns_server_prototype_model = {} # DNSServerPrototype
+ dns_server_prototype_model['address'] = '192.168.3.4'
+ dns_server_prototype_model['zone_affinity'] = zone_identity_model
+
+ vpcdns_resolver_vpc_patch_model = {} # VPCDNSResolverVPCPatchVPCIdentityById
+ vpcdns_resolver_vpc_patch_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b'
+
+ # Construct a json representation of a VPCDNSResolverPatch model
+ vpcdns_resolver_patch_model_json = {}
+ vpcdns_resolver_patch_model_json['manual_servers'] = [dns_server_prototype_model]
+ vpcdns_resolver_patch_model_json['type'] = 'delegated'
+ vpcdns_resolver_patch_model_json['vpc'] = vpcdns_resolver_vpc_patch_model
+
+ # Construct a model instance of VPCDNSResolverPatch by calling from_dict on the json representation
+ vpcdns_resolver_patch_model = VPCDNSResolverPatch.from_dict(vpcdns_resolver_patch_model_json)
+ assert vpcdns_resolver_patch_model != False
+
+ # Construct a model instance of VPCDNSResolverPatch by calling from_dict on the json representation
+ vpcdns_resolver_patch_model_dict = VPCDNSResolverPatch.from_dict(vpcdns_resolver_patch_model_json).__dict__
+ vpcdns_resolver_patch_model2 = VPCDNSResolverPatch(**vpcdns_resolver_patch_model_dict)
# Verify the model instances are equivalent
- assert security_group_collection_next_model == security_group_collection_next_model2
+ assert vpcdns_resolver_patch_model == vpcdns_resolver_patch_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
+ vpcdns_resolver_patch_model_json2 = vpcdns_resolver_patch_model.to_dict()
+ assert vpcdns_resolver_patch_model_json2 == vpcdns_resolver_patch_model_json
-class TestModel_SecurityGroupPatch:
+class TestModel_VPCHealthReason:
"""
- Test Class for SecurityGroupPatch
+ Test Class for VPCHealthReason
"""
- def test_security_group_patch_serialization(self):
+ def test_vpc_health_reason_serialization(self):
"""
- Test serialization/deserialization for SecurityGroupPatch
+ Test serialization/deserialization for VPCHealthReason
"""
- # 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 VPCHealthReason model
+ vpc_health_reason_model_json = {}
+ vpc_health_reason_model_json['code'] = 'dns_resolution_binding_failed'
+ vpc_health_reason_model_json['message'] = 'The VPC specified in the DNS resolution binding has been disconnected.'
+ vpc_health_reason_model_json['more_info'] = 'https://cloud.ibm.com/docs/vpc?topic=vpc-troubleshoot-hub-spoke-1'
- # 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 VPCHealthReason by calling from_dict on the json representation
+ vpc_health_reason_model = VPCHealthReason.from_dict(vpc_health_reason_model_json)
+ assert vpc_health_reason_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 VPCHealthReason by calling from_dict on the json representation
+ vpc_health_reason_model_dict = VPCHealthReason.from_dict(vpc_health_reason_model_json).__dict__
+ vpc_health_reason_model2 = VPCHealthReason(**vpc_health_reason_model_dict)
# Verify the model instances are equivalent
- assert security_group_patch_model == security_group_patch_model2
+ assert vpc_health_reason_model == vpc_health_reason_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_health_reason_model_json2 = vpc_health_reason_model.to_dict()
+ assert vpc_health_reason_model_json2 == vpc_health_reason_model_json
-class TestModel_SecurityGroupReference:
+class TestModel_VPCPatch:
"""
- Test Class for SecurityGroupReference
+ Test Class for VPCPatch
"""
- def test_security_group_reference_serialization(self):
+ def test_vpc_patch_serialization(self):
"""
- Test serialization/deserialization for SecurityGroupReference
+ Test serialization/deserialization for VPCPatch
"""
# 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'
+ zone_identity_model = {} # ZoneIdentityByName
+ zone_identity_model['name'] = 'us-south-1'
- # 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'
+ dns_server_prototype_model = {} # DNSServerPrototype
+ dns_server_prototype_model['address'] = '192.168.3.4'
+ dns_server_prototype_model['zone_affinity'] = zone_identity_model
- # 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
+ vpcdns_resolver_vpc_patch_model = {} # VPCDNSResolverVPCPatchVPCIdentityById
+ vpcdns_resolver_vpc_patch_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b'
- # 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)
+ vpcdns_resolver_patch_model = {} # VPCDNSResolverPatch
+ vpcdns_resolver_patch_model['manual_servers'] = [dns_server_prototype_model]
+ vpcdns_resolver_patch_model['type'] = 'delegated'
+ vpcdns_resolver_patch_model['vpc'] = vpcdns_resolver_vpc_patch_model
+
+ vpcdns_patch_model = {} # VPCDNSPatch
+ vpcdns_patch_model['enable_hub'] = True
+ vpcdns_patch_model['resolver'] = vpcdns_resolver_patch_model
+
+ # Construct a json representation of a VPCPatch model
+ vpc_patch_model_json = {}
+ vpc_patch_model_json['dns'] = vpcdns_patch_model
+ vpc_patch_model_json['name'] = 'my-vpc'
+
+ # 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 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_model == security_group_reference_model2
+ assert vpc_patch_model == vpc_patch_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_patch_model_json2 = vpc_patch_model.to_dict()
+ assert vpc_patch_model_json2 == vpc_patch_model_json
-class TestModel_SecurityGroupReferenceDeleted:
+class TestModel_VPCReference:
"""
- Test Class for SecurityGroupReferenceDeleted
+ Test Class for VPCReference
"""
- def test_security_group_reference_deleted_serialization(self):
+ def test_vpc_reference_serialization(self):
"""
- Test serialization/deserialization for SecurityGroupReferenceDeleted
+ Test serialization/deserialization for VPCReference
"""
- # 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 dict forms of any model objects needed in order to build this model.
- # 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
+ vpc_reference_deleted_model = {} # VPCReferenceDeleted
+ vpc_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # 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 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'
+ vpc_reference_model_json['resource_type'] = 'vpc'
+
+ # 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 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_reference_deleted_model == security_group_reference_deleted_model2
+ assert vpc_reference_model == vpc_reference_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_reference_model_json2 = vpc_reference_model.to_dict()
+ assert vpc_reference_model_json2 == vpc_reference_model_json
-class TestModel_SecurityGroupRuleCollection:
+class TestModel_VPCReferenceDNSResolverContext:
"""
- Test Class for SecurityGroupRuleCollection
+ Test Class for VPCReferenceDNSResolverContext
"""
- def test_security_group_rule_collection_serialization(self):
+ def test_vpc_reference_dns_resolver_context_serialization(self):
"""
- Test serialization/deserialization for SecurityGroupRuleCollection
+ Test serialization/deserialization for VPCReferenceDNSResolverContext
"""
# 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'
+ vpc_reference_dns_resolver_context_deleted_model = {} # VPCReferenceDNSResolverContextDeleted
+ vpc_reference_dns_resolver_context_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'
+ account_reference_model = {} # AccountReference
+ account_reference_model['id'] = 'aa2432b1fa4d4ace891e9b80fc104e34'
+ account_reference_model['resource_type'] = 'account'
- # 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]
+ 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 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
+ vpc_remote_model = {} # VPCRemote
+ vpc_remote_model['account'] = account_reference_model
+ vpc_remote_model['region'] = region_reference_model
- # 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 json representation of a VPCReferenceDNSResolverContext model
+ vpc_reference_dns_resolver_context_model_json = {}
+ vpc_reference_dns_resolver_context_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b'
+ vpc_reference_dns_resolver_context_model_json['deleted'] = vpc_reference_dns_resolver_context_deleted_model
+ vpc_reference_dns_resolver_context_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b'
+ vpc_reference_dns_resolver_context_model_json['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b'
+ vpc_reference_dns_resolver_context_model_json['name'] = 'my-vpc'
+ vpc_reference_dns_resolver_context_model_json['remote'] = vpc_remote_model
+ vpc_reference_dns_resolver_context_model_json['resource_type'] = 'vpc'
+
+ # Construct a model instance of VPCReferenceDNSResolverContext by calling from_dict on the json representation
+ vpc_reference_dns_resolver_context_model = VPCReferenceDNSResolverContext.from_dict(vpc_reference_dns_resolver_context_model_json)
+ assert vpc_reference_dns_resolver_context_model != False
+
+ # Construct a model instance of VPCReferenceDNSResolverContext by calling from_dict on the json representation
+ vpc_reference_dns_resolver_context_model_dict = VPCReferenceDNSResolverContext.from_dict(vpc_reference_dns_resolver_context_model_json).__dict__
+ vpc_reference_dns_resolver_context_model2 = VPCReferenceDNSResolverContext(**vpc_reference_dns_resolver_context_model_dict)
# Verify the model instances are equivalent
- assert security_group_rule_collection_model == security_group_rule_collection_model2
+ assert vpc_reference_dns_resolver_context_model == vpc_reference_dns_resolver_context_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_dns_resolver_context_model_json2 = vpc_reference_dns_resolver_context_model.to_dict()
+ assert vpc_reference_dns_resolver_context_model_json2 == vpc_reference_dns_resolver_context_model_json
-class TestModel_SecurityGroupRulePatch:
+class TestModel_VPCReferenceDNSResolverContextDeleted:
"""
- Test Class for SecurityGroupRulePatch
+ Test Class for VPCReferenceDNSResolverContextDeleted
"""
- def test_security_group_rule_patch_serialization(self):
+ def test_vpc_reference_dns_resolver_context_deleted_serialization(self):
"""
- Test serialization/deserialization for SecurityGroupRulePatch
+ Test serialization/deserialization for VPCReferenceDNSResolverContextDeleted
"""
- # 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 VPCReferenceDNSResolverContextDeleted model
+ vpc_reference_dns_resolver_context_deleted_model_json = {}
+ vpc_reference_dns_resolver_context_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 VPCReferenceDNSResolverContextDeleted by calling from_dict on the json representation
+ vpc_reference_dns_resolver_context_deleted_model = VPCReferenceDNSResolverContextDeleted.from_dict(vpc_reference_dns_resolver_context_deleted_model_json)
+ assert vpc_reference_dns_resolver_context_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 VPCReferenceDNSResolverContextDeleted by calling from_dict on the json representation
+ vpc_reference_dns_resolver_context_deleted_model_dict = VPCReferenceDNSResolverContextDeleted.from_dict(vpc_reference_dns_resolver_context_deleted_model_json).__dict__
+ vpc_reference_dns_resolver_context_deleted_model2 = VPCReferenceDNSResolverContextDeleted(**vpc_reference_dns_resolver_context_deleted_model_dict)
# Verify the model instances are equivalent
- assert security_group_rule_patch_model == security_group_rule_patch_model2
+ assert vpc_reference_dns_resolver_context_deleted_model == vpc_reference_dns_resolver_context_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_dns_resolver_context_deleted_model_json2 = vpc_reference_dns_resolver_context_deleted_model.to_dict()
+ assert vpc_reference_dns_resolver_context_deleted_model_json2 == vpc_reference_dns_resolver_context_deleted_model_json
-class TestModel_SecurityGroupTargetCollection:
+class TestModel_VPCReferenceDeleted:
"""
- Test Class for SecurityGroupTargetCollection
+ Test Class for VPCReferenceDeleted
"""
- def test_security_group_target_collection_serialization(self):
+ def test_vpc_reference_deleted_serialization(self):
"""
- Test serialization/deserialization for SecurityGroupTargetCollection
+ Test serialization/deserialization for VPCReferenceDeleted
"""
- # 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'
+ # 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'
- 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'
+ # 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
- 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 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)
- 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-instance-network-interface'
- security_group_target_reference_model['resource_type'] = 'network_interface'
+ # Verify the model instances are equivalent
+ assert vpc_reference_deleted_model == vpc_reference_deleted_model2
- # 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
+ # 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
- # 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)
+class TestModel_VPCReferenceRemote:
+ """
+ Test Class for VPCReferenceRemote
+ """
- # Verify the model instances are equivalent
- assert security_group_target_collection_model == security_group_target_collection_model2
+ def test_vpc_reference_remote_serialization(self):
+ """
+ Test serialization/deserialization for VPCReferenceRemote
+ """
- # 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
+ # Construct dict forms of any model objects needed in order to build this model.
+ account_reference_model = {} # AccountReference
+ account_reference_model['id'] = 'aa2432b1fa4d4ace891e9b80fc104e34'
+ account_reference_model['resource_type'] = 'account'
-class TestModel_SecurityGroupTargetCollectionFirst:
- """
- Test Class for SecurityGroupTargetCollectionFirst
- """
+ 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'
- def test_security_group_target_collection_first_serialization(self):
- """
- Test serialization/deserialization for SecurityGroupTargetCollectionFirst
- """
+ vpc_remote_model = {} # VPCRemote
+ vpc_remote_model['account'] = account_reference_model
+ vpc_remote_model['region'] = region_reference_model
- # 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 VPCReferenceRemote model
+ vpc_reference_remote_model_json = {}
+ vpc_reference_remote_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b'
+ vpc_reference_remote_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b'
+ vpc_reference_remote_model_json['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b'
+ vpc_reference_remote_model_json['name'] = 'my-vpc'
+ vpc_reference_remote_model_json['remote'] = vpc_remote_model
+ vpc_reference_remote_model_json['resource_type'] = 'vpc'
- # 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 VPCReferenceRemote by calling from_dict on the json representation
+ vpc_reference_remote_model = VPCReferenceRemote.from_dict(vpc_reference_remote_model_json)
+ assert vpc_reference_remote_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 VPCReferenceRemote by calling from_dict on the json representation
+ vpc_reference_remote_model_dict = VPCReferenceRemote.from_dict(vpc_reference_remote_model_json).__dict__
+ vpc_reference_remote_model2 = VPCReferenceRemote(**vpc_reference_remote_model_dict)
# Verify the model instances are equivalent
- assert security_group_target_collection_first_model == security_group_target_collection_first_model2
+ assert vpc_reference_remote_model == vpc_reference_remote_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
+ vpc_reference_remote_model_json2 = vpc_reference_remote_model.to_dict()
+ assert vpc_reference_remote_model_json2 == vpc_reference_remote_model_json
-class TestModel_SecurityGroupTargetCollectionNext:
+class TestModel_VPCRemote:
"""
- Test Class for SecurityGroupTargetCollectionNext
+ Test Class for VPCRemote
"""
- def test_security_group_target_collection_next_serialization(self):
+ def test_vpc_remote_serialization(self):
"""
- Test serialization/deserialization for SecurityGroupTargetCollectionNext
+ Test serialization/deserialization for VPCRemote
"""
- # 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 dict forms of any model objects needed in order to build this model.
- # 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
+ account_reference_model = {} # AccountReference
+ account_reference_model['id'] = 'aa2432b1fa4d4ace891e9b80fc104e34'
+ account_reference_model['resource_type'] = 'account'
- # 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)
+ 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 VPCRemote model
+ vpc_remote_model_json = {}
+ vpc_remote_model_json['account'] = account_reference_model
+ vpc_remote_model_json['region'] = region_reference_model
+
+ # Construct a model instance of VPCRemote by calling from_dict on the json representation
+ vpc_remote_model = VPCRemote.from_dict(vpc_remote_model_json)
+ assert vpc_remote_model != False
+
+ # Construct a model instance of VPCRemote by calling from_dict on the json representation
+ vpc_remote_model_dict = VPCRemote.from_dict(vpc_remote_model_json).__dict__
+ vpc_remote_model2 = VPCRemote(**vpc_remote_model_dict)
# Verify the model instances are equivalent
- assert security_group_target_collection_next_model == security_group_target_collection_next_model2
+ assert vpc_remote_model == vpc_remote_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
+ vpc_remote_model_json2 = vpc_remote_model.to_dict()
+ assert vpc_remote_model_json2 == vpc_remote_model_json
-class TestModel_Share:
+class TestModel_VPNGatewayCollection:
"""
- Test Class for Share
+ Test Class for VPNGatewayCollection
"""
- def test_share_serialization(self):
+ def test_vpn_gateway_collection_serialization(self):
"""
- Test serialization/deserialization for Share
+ Test serialization/deserialization for VPNGatewayCollection
"""
# 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/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179'
+ vpn_gateway_collection_first_model = {} # VPNGatewayCollectionFirst
+ vpn_gateway_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways?limit=20'
- share_job_status_reason_model = {} # ShareJobStatusReason
- share_job_status_reason_model['code'] = 'cannot_reach_source_share'
- share_job_status_reason_model['message'] = 'The replication failover failed because the source share cannot be reached.'
- share_job_status_reason_model['more_info'] = 'https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning'
+ 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'
- share_job_model = {} # ShareJob
- share_job_model['status'] = 'cancelled'
- share_job_model['status_reasons'] = [share_job_status_reason_model]
- share_job_model['type'] = 'replication_failover'
+ vpn_gateway_connection_reference_deleted_model = {} # VPNGatewayConnectionReferenceDeleted
+ vpn_gateway_connection_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- share_mount_target_reference_deleted_model = {} # ShareMountTargetReferenceDeleted
- share_mount_target_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'
- share_mount_target_reference_model = {} # ShareMountTargetReference
- share_mount_target_reference_model['deleted'] = share_mount_target_reference_deleted_model
- share_mount_target_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c'
- share_mount_target_reference_model['id'] = '4cf9171a-0043-4434-8727-15b53dbc374c'
- share_mount_target_reference_model['name'] = 'my-share-mount-target'
- share_mount_target_reference_model['resource_type'] = 'share_mount_target'
+ vpn_gateway_health_reason_model = {} # VPNGatewayHealthReason
+ vpn_gateway_health_reason_model['code'] = 'cannot_reserve_ip_address'
+ vpn_gateway_health_reason_model['message'] = 'IP address exhaustion (release addresses on the VPN\'s subnet).'
+ vpn_gateway_health_reason_model['more_info'] = 'https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health'
- share_profile_reference_model = {} # ShareProfileReference
- share_profile_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops'
- share_profile_reference_model['name'] = 'tier-3iops'
- share_profile_reference_model['resource_type'] = 'share_profile'
+ vpn_gateway_lifecycle_reason_model = {} # VPNGatewayLifecycleReason
+ vpn_gateway_lifecycle_reason_model['code'] = 'resource_suspended_by_provider'
+ vpn_gateway_lifecycle_reason_model['message'] = 'The resource has been suspended. Contact IBM support with the CRN for next steps.'
+ vpn_gateway_lifecycle_reason_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#resource-suspension'
- share_reference_deleted_model = {} # ShareReferenceDeleted
- share_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ vpn_gateway_member_health_reason_model = {} # VPNGatewayMemberHealthReason
+ vpn_gateway_member_health_reason_model['code'] = 'cannot_reserve_ip_address'
+ vpn_gateway_member_health_reason_model['message'] = 'IP address exhaustion (release addresses on the VPN\'s subnet).'
+ vpn_gateway_member_health_reason_model['more_info'] = 'https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health'
- share_reference_model = {} # ShareReference
- share_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58'
- share_reference_model['deleted'] = share_reference_deleted_model
- share_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58'
- share_reference_model['id'] = '0fe9e5d8-0a4d-4818-96ec-e99708644a58'
- share_reference_model['name'] = 'my-share'
- share_reference_model['resource_type'] = 'share'
+ vpn_gateway_member_lifecycle_reason_model = {} # VPNGatewayMemberLifecycleReason
+ vpn_gateway_member_lifecycle_reason_model['code'] = 'resource_suspended_by_provider'
+ vpn_gateway_member_lifecycle_reason_model['message'] = 'The resource has been suspended. Contact IBM support with the CRN for next steps.'
+ vpn_gateway_member_lifecycle_reason_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#resource-suspension'
- share_replication_status_reason_model = {} # ShareReplicationStatusReason
- share_replication_status_reason_model['code'] = 'cannot_reach_source_share'
- share_replication_status_reason_model['message'] = 'The replication failover failed because the source share cannot be reached.'
- share_replication_status_reason_model['more_info'] = 'https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning'
+ 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'
+
+ ip_model = {} # IP
+ ip_model['address'] = '192.168.3.4'
+
+ vpn_gateway_member_model = {} # VPNGatewayMember
+ vpn_gateway_member_model['health_reasons'] = [vpn_gateway_member_health_reason_model]
+ vpn_gateway_member_model['health_state'] = 'ok'
+ vpn_gateway_member_model['lifecycle_reasons'] = [vpn_gateway_member_lifecycle_reason_model]
+ vpn_gateway_member_model['lifecycle_state'] = 'stable'
+ vpn_gateway_member_model['private_ip'] = reserved_ip_reference_model
+ vpn_gateway_member_model['public_ip'] = ip_model
+ vpn_gateway_member_model['role'] = 'active'
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'
+ subnet_reference_deleted_model = {} # SubnetReferenceDeleted
+ subnet_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Construct a json representation of a Share model
- share_model_json = {}
- share_model_json['access_control_mode'] = 'security_group'
- share_model_json['created_at'] = '2019-01-01T12:00:00Z'
- share_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58'
- share_model_json['encryption'] = 'provider_managed'
- share_model_json['encryption_key'] = encryption_key_reference_model
- share_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58'
- share_model_json['id'] = '0fe9e5d8-0a4d-4818-96ec-e99708644a58'
- share_model_json['iops'] = 100
- share_model_json['latest_job'] = share_job_model
- share_model_json['lifecycle_state'] = 'stable'
- share_model_json['mount_targets'] = [share_mount_target_reference_model]
- share_model_json['name'] = 'my-share'
- share_model_json['profile'] = share_profile_reference_model
- share_model_json['replica_share'] = share_reference_model
- share_model_json['replication_cron_spec'] = '0 */5 * * *'
- share_model_json['replication_role'] = 'none'
- share_model_json['replication_status'] = 'active'
- share_model_json['replication_status_reasons'] = [share_replication_status_reason_model]
- share_model_json['resource_group'] = resource_group_reference_model
- share_model_json['resource_type'] = 'share'
- share_model_json['size'] = 200
- share_model_json['source_share'] = share_reference_model
- share_model_json['user_tags'] = ['testString']
- share_model_json['zone'] = zone_reference_model
+ subnet_reference_model = {} # SubnetReference
+ subnet_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
+ subnet_reference_model['deleted'] = subnet_reference_deleted_model
+ subnet_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
+ subnet_reference_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
+ subnet_reference_model['name'] = 'my-subnet'
+ subnet_reference_model['resource_type'] = 'subnet'
- # Construct a model instance of Share by calling from_dict on the json representation
- share_model = Share.from_dict(share_model_json)
- assert share_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 Share by calling from_dict on the json representation
- share_model_dict = Share.from_dict(share_model_json).__dict__
- share_model2 = Share(**share_model_dict)
+ vpc_reference_model = {} # VPCReference
+ vpc_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b'
+ vpc_reference_model['deleted'] = vpc_reference_deleted_model
+ vpc_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b'
+ vpc_reference_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b'
+ vpc_reference_model['name'] = 'my-vpc'
+ vpc_reference_model['resource_type'] = 'vpc'
+
+ vpn_gateway_model = {} # VPNGatewayRouteMode
+ vpn_gateway_model['connections'] = [vpn_gateway_connection_reference_model]
+ vpn_gateway_model['created_at'] = '2019-01-01T12:00:00Z'
+ vpn_gateway_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b'
+ vpn_gateway_model['health_reasons'] = [vpn_gateway_health_reason_model]
+ vpn_gateway_model['health_state'] = 'ok'
+ 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['lifecycle_reasons'] = [vpn_gateway_lifecycle_reason_model]
+ vpn_gateway_model['lifecycle_state'] = 'stable'
+ 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['subnet'] = subnet_reference_model
+ vpn_gateway_model['vpc'] = vpc_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 share_model == share_model2
+ assert vpn_gateway_collection_model == vpn_gateway_collection_model2
# Convert model instance back to dict and verify no loss of data
- share_model_json2 = share_model.to_dict()
- assert share_model_json2 == share_model_json
+ vpn_gateway_collection_model_json2 = vpn_gateway_collection_model.to_dict()
+ assert vpn_gateway_collection_model_json2 == vpn_gateway_collection_model_json
-class TestModel_ShareCollection:
+class TestModel_VPNGatewayCollectionFirst:
"""
- Test Class for ShareCollection
+ Test Class for VPNGatewayCollectionFirst
"""
- def test_share_collection_serialization(self):
+ def test_vpn_gateway_collection_first_serialization(self):
"""
- Test serialization/deserialization for ShareCollection
+ Test serialization/deserialization for VPNGatewayCollectionFirst
"""
- # Construct dict forms of any model objects needed in order to build this model.
-
- share_collection_first_model = {} # ShareCollectionFirst
- share_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/shares?limit=20'
-
- share_collection_next_model = {} # ShareCollectionNext
- share_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/shares?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
-
- encryption_key_reference_model = {} # EncryptionKeyReference
- encryption_key_reference_model['crn'] = 'crn:v1:bluemix:public:kms:us-south:a/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179'
-
- share_job_status_reason_model = {} # ShareJobStatusReason
- share_job_status_reason_model['code'] = 'cannot_reach_source_share'
- share_job_status_reason_model['message'] = 'The replication failover failed because the source share cannot be reached.'
- share_job_status_reason_model['more_info'] = 'https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning'
-
- share_job_model = {} # ShareJob
- share_job_model['status'] = 'cancelled'
- share_job_model['status_reasons'] = [share_job_status_reason_model]
- share_job_model['type'] = 'replication_failover'
-
- share_mount_target_reference_deleted_model = {} # ShareMountTargetReferenceDeleted
- share_mount_target_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
-
- share_mount_target_reference_model = {} # ShareMountTargetReference
- share_mount_target_reference_model['deleted'] = share_mount_target_reference_deleted_model
- share_mount_target_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c'
- share_mount_target_reference_model['id'] = '4cf9171a-0043-4434-8727-15b53dbc374c'
- share_mount_target_reference_model['name'] = 'my-share-mount-target'
- share_mount_target_reference_model['resource_type'] = 'share_mount_target'
+ # 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'
- share_profile_reference_model = {} # ShareProfileReference
- share_profile_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops'
- share_profile_reference_model['name'] = 'tier-3iops'
- share_profile_reference_model['resource_type'] = 'share_profile'
+ # 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
- share_reference_deleted_model = {} # ShareReferenceDeleted
- share_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ # 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)
- share_reference_model = {} # ShareReference
- share_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58'
- share_reference_model['deleted'] = share_reference_deleted_model
- share_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58'
- share_reference_model['id'] = '0fe9e5d8-0a4d-4818-96ec-e99708644a58'
- share_reference_model['name'] = 'my-share'
- share_reference_model['resource_type'] = 'share'
+ # Verify the model instances are equivalent
+ assert vpn_gateway_collection_first_model == vpn_gateway_collection_first_model2
- share_replication_status_reason_model = {} # ShareReplicationStatusReason
- share_replication_status_reason_model['code'] = 'cannot_reach_source_share'
- share_replication_status_reason_model['message'] = 'The replication failover failed because the source share cannot be reached.'
- share_replication_status_reason_model['more_info'] = 'https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning'
+ # 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
- 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'
+class TestModel_VPNGatewayCollectionNext:
+ """
+ Test Class for VPNGatewayCollectionNext
+ """
- share_model = {} # Share
- share_model['access_control_mode'] = 'security_group'
- share_model['created_at'] = '2019-01-01T12:00:00Z'
- share_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58'
- share_model['encryption'] = 'provider_managed'
- share_model['encryption_key'] = encryption_key_reference_model
- share_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58'
- share_model['id'] = '0fe9e5d8-0a4d-4818-96ec-e99708644a58'
- share_model['iops'] = 100
- share_model['latest_job'] = share_job_model
- share_model['lifecycle_state'] = 'stable'
- share_model['mount_targets'] = [share_mount_target_reference_model]
- share_model['name'] = 'my-share'
- share_model['profile'] = share_profile_reference_model
- share_model['replica_share'] = share_reference_model
- share_model['replication_cron_spec'] = '0 */5 * * *'
- share_model['replication_role'] = 'none'
- share_model['replication_status'] = 'active'
- share_model['replication_status_reasons'] = [share_replication_status_reason_model]
- share_model['resource_group'] = resource_group_reference_model
- share_model['resource_type'] = 'share'
- share_model['size'] = 200
- share_model['source_share'] = share_reference_model
- share_model['user_tags'] = ['testString']
- share_model['zone'] = zone_reference_model
+ def test_vpn_gateway_collection_next_serialization(self):
+ """
+ Test serialization/deserialization for VPNGatewayCollectionNext
+ """
- # Construct a json representation of a ShareCollection model
- share_collection_model_json = {}
- share_collection_model_json['first'] = share_collection_first_model
- share_collection_model_json['limit'] = 20
- share_collection_model_json['next'] = share_collection_next_model
- share_collection_model_json['shares'] = [share_model]
- share_collection_model_json['total_count'] = 132
+ # Construct a 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 ShareCollection by calling from_dict on the json representation
- share_collection_model = ShareCollection.from_dict(share_collection_model_json)
- assert share_collection_model != False
+ # Construct a model instance of 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 ShareCollection by calling from_dict on the json representation
- share_collection_model_dict = ShareCollection.from_dict(share_collection_model_json).__dict__
- share_collection_model2 = ShareCollection(**share_collection_model_dict)
+ # 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 share_collection_model == share_collection_model2
+ assert vpn_gateway_collection_next_model == vpn_gateway_collection_next_model2
# Convert model instance back to dict and verify no loss of data
- share_collection_model_json2 = share_collection_model.to_dict()
- assert share_collection_model_json2 == share_collection_model_json
+ 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_ShareCollectionFirst:
+class TestModel_VPNGatewayConnectionCollection:
"""
- Test Class for ShareCollectionFirst
+ Test Class for VPNGatewayConnectionCollection
"""
- def test_share_collection_first_serialization(self):
+ def test_vpn_gateway_connection_collection_serialization(self):
"""
- Test serialization/deserialization for ShareCollectionFirst
+ Test serialization/deserialization for VPNGatewayConnectionCollection
"""
- # Construct a json representation of a ShareCollectionFirst model
- share_collection_first_model_json = {}
- share_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/shares?limit=20'
+ # Construct dict forms of any model objects needed in order to build this model.
- # Construct a model instance of ShareCollectionFirst by calling from_dict on the json representation
- share_collection_first_model = ShareCollectionFirst.from_dict(share_collection_first_model_json)
- assert share_collection_first_model != False
+ 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
- # Construct a model instance of ShareCollectionFirst by calling from_dict on the json representation
- share_collection_first_model_dict = ShareCollectionFirst.from_dict(share_collection_first_model_json).__dict__
- share_collection_first_model2 = ShareCollectionFirst(**share_collection_first_model_dict)
+ ike_policy_reference_deleted_model = {} # IKEPolicyReferenceDeleted
+ ike_policy_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Verify the model instances are equivalent
- assert share_collection_first_model == share_collection_first_model2
+ 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'
- # Convert model instance back to dict and verify no loss of data
- share_collection_first_model_json2 = share_collection_first_model.to_dict()
- assert share_collection_first_model_json2 == share_collection_first_model_json
+ 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'
+ vpn_gateway_connection_status_reason_model = {} # VPNGatewayConnectionStatusReason
+ vpn_gateway_connection_status_reason_model['code'] = 'cannot_authenticate_connection'
+ vpn_gateway_connection_status_reason_model['message'] = 'Failed to authenticate a connection because of mismatched IKE ID and PSK.'
+ vpn_gateway_connection_status_reason_model['more_info'] = 'https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health'
-class TestModel_ShareCollectionNext:
- """
- Test Class for ShareCollectionNext
- """
+ ip_model = {} # IP
+ ip_model['address'] = '192.168.3.4'
- def test_share_collection_next_serialization(self):
- """
- Test serialization/deserialization for ShareCollectionNext
- """
+ vpn_gateway_connection_tunnel_status_reason_model = {} # VPNGatewayConnectionTunnelStatusReason
+ vpn_gateway_connection_tunnel_status_reason_model['code'] = 'cannot_authenticate_connection'
+ vpn_gateway_connection_tunnel_status_reason_model['message'] = 'Failed to authenticate a connection because of mismatched IKE ID and PSK.'
+ vpn_gateway_connection_tunnel_status_reason_model['more_info'] = 'https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health'
- # Construct a json representation of a ShareCollectionNext model
- share_collection_next_model_json = {}
- share_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/shares?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
+ 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_static_route_mode_tunnel_model['status_reasons'] = [vpn_gateway_connection_tunnel_status_reason_model]
- # Construct a model instance of ShareCollectionNext by calling from_dict on the json representation
- share_collection_next_model = ShareCollectionNext.from_dict(share_collection_next_model_json)
- assert share_collection_next_model != False
+ 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['status_reasons'] = [vpn_gateway_connection_status_reason_model]
+ 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 ShareCollectionNext by calling from_dict on the json representation
- share_collection_next_model_dict = ShareCollectionNext.from_dict(share_collection_next_model_json).__dict__
- share_collection_next_model2 = ShareCollectionNext(**share_collection_next_model_dict)
+ # 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 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 share_collection_next_model == share_collection_next_model2
+ assert vpn_gateway_connection_collection_model == vpn_gateway_connection_collection_model2
# Convert model instance back to dict and verify no loss of data
- share_collection_next_model_json2 = share_collection_next_model.to_dict()
- assert share_collection_next_model_json2 == share_collection_next_model_json
+ 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_ShareInitialOwner:
+class TestModel_VPNGatewayConnectionDPD:
"""
- Test Class for ShareInitialOwner
+ Test Class for VPNGatewayConnectionDPD
"""
- def test_share_initial_owner_serialization(self):
+ def test_vpn_gateway_connection_dpd_serialization(self):
"""
- Test serialization/deserialization for ShareInitialOwner
+ Test serialization/deserialization for VPNGatewayConnectionDPD
"""
- # Construct a json representation of a ShareInitialOwner model
- share_initial_owner_model_json = {}
- share_initial_owner_model_json['gid'] = 50
- share_initial_owner_model_json['uid'] = 50
+ # Construct a 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 a model instance of ShareInitialOwner by calling from_dict on the json representation
- share_initial_owner_model = ShareInitialOwner.from_dict(share_initial_owner_model_json)
- assert share_initial_owner_model != False
+ # Construct a model instance of 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
- # Construct a model instance of ShareInitialOwner by calling from_dict on the json representation
- share_initial_owner_model_dict = ShareInitialOwner.from_dict(share_initial_owner_model_json).__dict__
- share_initial_owner_model2 = ShareInitialOwner(**share_initial_owner_model_dict)
+ # 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)
# Verify the model instances are equivalent
- assert share_initial_owner_model == share_initial_owner_model2
+ assert vpn_gateway_connection_dpd_model == vpn_gateway_connection_dpd_model2
# Convert model instance back to dict and verify no loss of data
- share_initial_owner_model_json2 = share_initial_owner_model.to_dict()
- assert share_initial_owner_model_json2 == share_initial_owner_model_json
+ 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
-class TestModel_ShareJob:
+class TestModel_VPNGatewayConnectionDPDPatch:
"""
- Test Class for ShareJob
+ Test Class for VPNGatewayConnectionDPDPatch
"""
- def test_share_job_serialization(self):
+ def test_vpn_gateway_connection_dpd_patch_serialization(self):
"""
- Test serialization/deserialization for ShareJob
+ Test serialization/deserialization for VPNGatewayConnectionDPDPatch
"""
- # Construct dict forms of any model objects needed in order to build this model.
-
- share_job_status_reason_model = {} # ShareJobStatusReason
- share_job_status_reason_model['code'] = 'cannot_reach_source_share'
- share_job_status_reason_model['message'] = 'The replication failover failed because the source share cannot be reached.'
- share_job_status_reason_model['more_info'] = 'https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning'
-
- # Construct a json representation of a ShareJob model
- share_job_model_json = {}
- share_job_model_json['status'] = 'cancelled'
- share_job_model_json['status_reasons'] = [share_job_status_reason_model]
- share_job_model_json['type'] = 'replication_failover'
+ # Construct a 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 ShareJob by calling from_dict on the json representation
- share_job_model = ShareJob.from_dict(share_job_model_json)
- assert share_job_model != False
+ # Construct a model instance of 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 ShareJob by calling from_dict on the json representation
- share_job_model_dict = ShareJob.from_dict(share_job_model_json).__dict__
- share_job_model2 = ShareJob(**share_job_model_dict)
+ # 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 share_job_model == share_job_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
- share_job_model_json2 = share_job_model.to_dict()
- assert share_job_model_json2 == share_job_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_ShareJobStatusReason:
+class TestModel_VPNGatewayConnectionDPDPrototype:
"""
- Test Class for ShareJobStatusReason
+ Test Class for VPNGatewayConnectionDPDPrototype
"""
- def test_share_job_status_reason_serialization(self):
+ def test_vpn_gateway_connection_dpd_prototype_serialization(self):
"""
- Test serialization/deserialization for ShareJobStatusReason
+ Test serialization/deserialization for VPNGatewayConnectionDPDPrototype
"""
- # Construct a json representation of a ShareJobStatusReason model
- share_job_status_reason_model_json = {}
- share_job_status_reason_model_json['code'] = 'cannot_reach_source_share'
- share_job_status_reason_model_json['message'] = 'The replication failover failed because the source share cannot be reached.'
- share_job_status_reason_model_json['more_info'] = 'https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning'
+ # Construct a 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 ShareJobStatusReason by calling from_dict on the json representation
- share_job_status_reason_model = ShareJobStatusReason.from_dict(share_job_status_reason_model_json)
- assert share_job_status_reason_model != False
+ # Construct a model instance of 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 ShareJobStatusReason by calling from_dict on the json representation
- share_job_status_reason_model_dict = ShareJobStatusReason.from_dict(share_job_status_reason_model_json).__dict__
- share_job_status_reason_model2 = ShareJobStatusReason(**share_job_status_reason_model_dict)
+ # 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 share_job_status_reason_model == share_job_status_reason_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
- share_job_status_reason_model_json2 = share_job_status_reason_model.to_dict()
- assert share_job_status_reason_model_json2 == share_job_status_reason_model_json
+ 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_ShareMountTarget:
+class TestModel_VPNGatewayConnectionLocalCIDRs:
"""
- Test Class for ShareMountTarget
+ Test Class for VPNGatewayConnectionLocalCIDRs
"""
- def test_share_mount_target_serialization(self):
+ def test_vpn_gateway_connection_local_cid_rs_serialization(self):
"""
- Test serialization/deserialization for ShareMountTarget
+ Test serialization/deserialization for VPNGatewayConnectionLocalCIDRs
"""
- # Construct dict forms of any model objects needed in order to build this model.
-
- reserved_ip_reference_deleted_model = {} # ReservedIPReferenceDeleted
- reserved_ip_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
-
- reserved_ip_reference_model = {} # ReservedIPReference
- reserved_ip_reference_model['address'] = '192.168.3.4'
- reserved_ip_reference_model['deleted'] = reserved_ip_reference_deleted_model
- reserved_ip_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb'
- reserved_ip_reference_model['id'] = '6d353a0f-aeb1-4ae1-832e-1110d10981bb'
- reserved_ip_reference_model['name'] = 'my-reserved-ip'
- reserved_ip_reference_model['resource_type'] = 'subnet_reserved_ip'
-
- subnet_reference_deleted_model = {} # SubnetReferenceDeleted
- subnet_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
-
- subnet_reference_model = {} # SubnetReference
- subnet_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
- subnet_reference_model['deleted'] = subnet_reference_deleted_model
- subnet_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
- subnet_reference_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
- subnet_reference_model['name'] = 'my-subnet'
- subnet_reference_model['resource_type'] = 'subnet'
-
- virtual_network_interface_reference_attachment_context_model = {} # VirtualNetworkInterfaceReferenceAttachmentContext
- virtual_network_interface_reference_attachment_context_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9'
- virtual_network_interface_reference_attachment_context_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9'
- virtual_network_interface_reference_attachment_context_model['id'] = '0767-fa41aecb-4f21-423d-8082-630bfba1e1d9'
- virtual_network_interface_reference_attachment_context_model['name'] = 'my-virtual-network-interface'
- virtual_network_interface_reference_attachment_context_model['resource_type'] = 'virtual_network_interface'
-
- vpc_reference_deleted_model = {} # VPCReferenceDeleted
- vpc_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
-
- vpc_reference_model = {} # VPCReference
- vpc_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b'
- vpc_reference_model['deleted'] = vpc_reference_deleted_model
- vpc_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b'
- vpc_reference_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b'
- vpc_reference_model['name'] = 'my-vpc'
- vpc_reference_model['resource_type'] = 'vpc'
-
- # Construct a json representation of a ShareMountTarget model
- share_mount_target_model_json = {}
- share_mount_target_model_json['access_control_mode'] = 'security_group'
- share_mount_target_model_json['created_at'] = '2019-01-01T12:00:00Z'
- share_mount_target_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c'
- share_mount_target_model_json['id'] = '4cf9171a-0043-4434-8727-15b53dbc374c'
- share_mount_target_model_json['lifecycle_state'] = 'stable'
- share_mount_target_model_json['mount_path'] = '10.240.1.23:/nxg_s_voll_mz7121_58e7e963_8f4b_4a0c_b71a_8ba8d9cd1e2e'
- share_mount_target_model_json['name'] = 'my-share-mount-target'
- share_mount_target_model_json['primary_ip'] = reserved_ip_reference_model
- share_mount_target_model_json['resource_type'] = 'share_mount_target'
- share_mount_target_model_json['subnet'] = subnet_reference_model
- share_mount_target_model_json['transit_encryption'] = 'none'
- share_mount_target_model_json['virtual_network_interface'] = virtual_network_interface_reference_attachment_context_model
- share_mount_target_model_json['vpc'] = vpc_reference_model
+ # Construct a 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 ShareMountTarget by calling from_dict on the json representation
- share_mount_target_model = ShareMountTarget.from_dict(share_mount_target_model_json)
- assert share_mount_target_model != False
+ # Construct a model instance of 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 ShareMountTarget by calling from_dict on the json representation
- share_mount_target_model_dict = ShareMountTarget.from_dict(share_mount_target_model_json).__dict__
- share_mount_target_model2 = ShareMountTarget(**share_mount_target_model_dict)
+ # 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 share_mount_target_model == share_mount_target_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
- share_mount_target_model_json2 = share_mount_target_model.to_dict()
- assert share_mount_target_model_json2 == share_mount_target_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_ShareMountTargetCollection:
+class TestModel_VPNGatewayConnectionPatch:
"""
- Test Class for ShareMountTargetCollection
+ Test Class for VPNGatewayConnectionPatch
"""
- def test_share_mount_target_collection_serialization(self):
+ def test_vpn_gateway_connection_patch_serialization(self):
"""
- Test serialization/deserialization for ShareMountTargetCollection
+ Test serialization/deserialization for VPNGatewayConnectionPatch
"""
# Construct dict forms of any model objects needed in order to build this model.
- share_mount_target_collection_first_model = {} # ShareMountTargetCollectionFirst
- share_mount_target_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets?limit=20'
-
- reserved_ip_reference_deleted_model = {} # ReservedIPReferenceDeleted
- reserved_ip_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
-
- reserved_ip_reference_model = {} # ReservedIPReference
- reserved_ip_reference_model['address'] = '192.168.3.4'
- reserved_ip_reference_model['deleted'] = reserved_ip_reference_deleted_model
- reserved_ip_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb'
- reserved_ip_reference_model['id'] = '6d353a0f-aeb1-4ae1-832e-1110d10981bb'
- reserved_ip_reference_model['name'] = 'my-reserved-ip'
- reserved_ip_reference_model['resource_type'] = 'subnet_reserved_ip'
-
- subnet_reference_deleted_model = {} # SubnetReferenceDeleted
- subnet_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
-
- subnet_reference_model = {} # SubnetReference
- subnet_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
- subnet_reference_model['deleted'] = subnet_reference_deleted_model
- subnet_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
- subnet_reference_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
- subnet_reference_model['name'] = 'my-subnet'
- subnet_reference_model['resource_type'] = 'subnet'
-
- virtual_network_interface_reference_attachment_context_model = {} # VirtualNetworkInterfaceReferenceAttachmentContext
- virtual_network_interface_reference_attachment_context_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9'
- virtual_network_interface_reference_attachment_context_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9'
- virtual_network_interface_reference_attachment_context_model['id'] = '0767-fa41aecb-4f21-423d-8082-630bfba1e1d9'
- virtual_network_interface_reference_attachment_context_model['name'] = 'my-virtual-network-interface'
- virtual_network_interface_reference_attachment_context_model['resource_type'] = 'virtual_network_interface'
-
- vpc_reference_deleted_model = {} # VPCReferenceDeleted
- vpc_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
-
- vpc_reference_model = {} # VPCReference
- vpc_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b'
- vpc_reference_model['deleted'] = vpc_reference_deleted_model
- vpc_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b'
- vpc_reference_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b'
- vpc_reference_model['name'] = 'my-vpc'
- vpc_reference_model['resource_type'] = 'vpc'
+ vpn_gateway_connection_dpd_patch_model = {} # VPNGatewayConnectionDPDPatch
+ vpn_gateway_connection_dpd_patch_model['action'] = 'restart'
+ vpn_gateway_connection_dpd_patch_model['interval'] = 30
+ vpn_gateway_connection_dpd_patch_model['timeout'] = 120
- share_mount_target_model = {} # ShareMountTarget
- share_mount_target_model['access_control_mode'] = 'security_group'
- share_mount_target_model['created_at'] = '2019-01-01T12:00:00Z'
- share_mount_target_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c'
- share_mount_target_model['id'] = '4cf9171a-0043-4434-8727-15b53dbc374c'
- share_mount_target_model['lifecycle_state'] = 'stable'
- share_mount_target_model['mount_path'] = '10.240.1.23:/nxg_s_voll_mz7121_58e7e963_8f4b_4a0c_b71a_8ba8d9cd1e2e'
- share_mount_target_model['name'] = 'my-share-mount-target'
- share_mount_target_model['primary_ip'] = reserved_ip_reference_model
- share_mount_target_model['resource_type'] = 'share_mount_target'
- share_mount_target_model['subnet'] = subnet_reference_model
- share_mount_target_model['transit_encryption'] = 'none'
- share_mount_target_model['virtual_network_interface'] = virtual_network_interface_reference_attachment_context_model
- share_mount_target_model['vpc'] = vpc_reference_model
+ vpn_gateway_connection_ike_policy_patch_model = {} # VPNGatewayConnectionIKEPolicyPatchIKEPolicyIdentityById
+ vpn_gateway_connection_ike_policy_patch_model['id'] = 'ddf51bec-3424-11e8-b467-0ed5f89f718b'
- share_mount_target_collection_next_model = {} # ShareMountTargetCollectionNext
- share_mount_target_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
+ vpn_gateway_connection_i_psec_policy_patch_model = {} # VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityById
+ vpn_gateway_connection_i_psec_policy_patch_model['id'] = 'ddf51bec-3424-11e8-b467-0ed5f89f718b'
- # Construct a json representation of a ShareMountTargetCollection model
- share_mount_target_collection_model_json = {}
- share_mount_target_collection_model_json['first'] = share_mount_target_collection_first_model
- share_mount_target_collection_model_json['limit'] = 20
- share_mount_target_collection_model_json['mount_targets'] = [share_mount_target_model]
- share_mount_target_collection_model_json['next'] = share_mount_target_collection_next_model
- share_mount_target_collection_model_json['total_count'] = 132
+ # Construct a json representation of a VPNGatewayConnectionPatch model
+ vpn_gateway_connection_patch_model_json = {}
+ vpn_gateway_connection_patch_model_json['admin_state_up'] = True
+ vpn_gateway_connection_patch_model_json['dead_peer_detection'] = vpn_gateway_connection_dpd_patch_model
+ vpn_gateway_connection_patch_model_json['ike_policy'] = vpn_gateway_connection_ike_policy_patch_model
+ vpn_gateway_connection_patch_model_json['ipsec_policy'] = vpn_gateway_connection_i_psec_policy_patch_model
+ vpn_gateway_connection_patch_model_json['name'] = 'my-vpn-connection'
+ vpn_gateway_connection_patch_model_json['peer_address'] = '169.21.50.5'
+ vpn_gateway_connection_patch_model_json['psk'] = 'lkj14b1oi0alcniejkso'
+ vpn_gateway_connection_patch_model_json['routing_protocol'] = 'none'
- # Construct a model instance of ShareMountTargetCollection by calling from_dict on the json representation
- share_mount_target_collection_model = ShareMountTargetCollection.from_dict(share_mount_target_collection_model_json)
- assert share_mount_target_collection_model != False
+ # Construct a model instance of VPNGatewayConnectionPatch by calling from_dict on the json representation
+ vpn_gateway_connection_patch_model = VPNGatewayConnectionPatch.from_dict(vpn_gateway_connection_patch_model_json)
+ assert vpn_gateway_connection_patch_model != False
- # Construct a model instance of ShareMountTargetCollection by calling from_dict on the json representation
- share_mount_target_collection_model_dict = ShareMountTargetCollection.from_dict(share_mount_target_collection_model_json).__dict__
- share_mount_target_collection_model2 = ShareMountTargetCollection(**share_mount_target_collection_model_dict)
+ # Construct a model instance of VPNGatewayConnectionPatch by calling from_dict on the json representation
+ vpn_gateway_connection_patch_model_dict = VPNGatewayConnectionPatch.from_dict(vpn_gateway_connection_patch_model_json).__dict__
+ vpn_gateway_connection_patch_model2 = VPNGatewayConnectionPatch(**vpn_gateway_connection_patch_model_dict)
# Verify the model instances are equivalent
- assert share_mount_target_collection_model == share_mount_target_collection_model2
+ assert vpn_gateway_connection_patch_model == vpn_gateway_connection_patch_model2
# Convert model instance back to dict and verify no loss of data
- share_mount_target_collection_model_json2 = share_mount_target_collection_model.to_dict()
- assert share_mount_target_collection_model_json2 == share_mount_target_collection_model_json
+ vpn_gateway_connection_patch_model_json2 = vpn_gateway_connection_patch_model.to_dict()
+ assert vpn_gateway_connection_patch_model_json2 == vpn_gateway_connection_patch_model_json
-class TestModel_ShareMountTargetCollectionFirst:
+class TestModel_VPNGatewayConnectionPeerCIDRs:
"""
- Test Class for ShareMountTargetCollectionFirst
+ Test Class for VPNGatewayConnectionPeerCIDRs
"""
- def test_share_mount_target_collection_first_serialization(self):
+ def test_vpn_gateway_connection_peer_cid_rs_serialization(self):
"""
- Test serialization/deserialization for ShareMountTargetCollectionFirst
+ Test serialization/deserialization for VPNGatewayConnectionPeerCIDRs
"""
- # Construct a json representation of a ShareMountTargetCollectionFirst model
- share_mount_target_collection_first_model_json = {}
- share_mount_target_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets?limit=20'
+ # Construct a 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 ShareMountTargetCollectionFirst by calling from_dict on the json representation
- share_mount_target_collection_first_model = ShareMountTargetCollectionFirst.from_dict(share_mount_target_collection_first_model_json)
- assert share_mount_target_collection_first_model != False
+ # Construct a model instance of 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 ShareMountTargetCollectionFirst by calling from_dict on the json representation
- share_mount_target_collection_first_model_dict = ShareMountTargetCollectionFirst.from_dict(share_mount_target_collection_first_model_json).__dict__
- share_mount_target_collection_first_model2 = ShareMountTargetCollectionFirst(**share_mount_target_collection_first_model_dict)
+ # 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 share_mount_target_collection_first_model == share_mount_target_collection_first_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
- share_mount_target_collection_first_model_json2 = share_mount_target_collection_first_model.to_dict()
- assert share_mount_target_collection_first_model_json2 == share_mount_target_collection_first_model_json
+ 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_ShareMountTargetCollectionNext:
+class TestModel_VPNGatewayConnectionReference:
"""
- Test Class for ShareMountTargetCollectionNext
+ Test Class for VPNGatewayConnectionReference
"""
- def test_share_mount_target_collection_next_serialization(self):
+ def test_vpn_gateway_connection_reference_serialization(self):
"""
- Test serialization/deserialization for ShareMountTargetCollectionNext
+ Test serialization/deserialization for VPNGatewayConnectionReference
"""
- # Construct a json representation of a ShareMountTargetCollectionNext model
- share_mount_target_collection_next_model_json = {}
- share_mount_target_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
+ # Construct dict forms of any model objects needed in order to build this model.
- # Construct a model instance of ShareMountTargetCollectionNext by calling from_dict on the json representation
- share_mount_target_collection_next_model = ShareMountTargetCollectionNext.from_dict(share_mount_target_collection_next_model_json)
- assert share_mount_target_collection_next_model != False
+ 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 ShareMountTargetCollectionNext by calling from_dict on the json representation
- share_mount_target_collection_next_model_dict = ShareMountTargetCollectionNext.from_dict(share_mount_target_collection_next_model_json).__dict__
- share_mount_target_collection_next_model2 = ShareMountTargetCollectionNext(**share_mount_target_collection_next_model_dict)
+ # 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 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 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 share_mount_target_collection_next_model == share_mount_target_collection_next_model2
+ assert vpn_gateway_connection_reference_model == vpn_gateway_connection_reference_model2
# Convert model instance back to dict and verify no loss of data
- share_mount_target_collection_next_model_json2 = share_mount_target_collection_next_model.to_dict()
- assert share_mount_target_collection_next_model_json2 == share_mount_target_collection_next_model_json
+ 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_ShareMountTargetPatch:
+class TestModel_VPNGatewayConnectionReferenceDeleted:
"""
- Test Class for ShareMountTargetPatch
+ Test Class for VPNGatewayConnectionReferenceDeleted
"""
- def test_share_mount_target_patch_serialization(self):
+ def test_vpn_gateway_connection_reference_deleted_serialization(self):
"""
- Test serialization/deserialization for ShareMountTargetPatch
+ Test serialization/deserialization for VPNGatewayConnectionReferenceDeleted
"""
- # Construct a json representation of a ShareMountTargetPatch model
- share_mount_target_patch_model_json = {}
- share_mount_target_patch_model_json['name'] = 'my-share-mount-target'
+ # Construct a 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 ShareMountTargetPatch by calling from_dict on the json representation
- share_mount_target_patch_model = ShareMountTargetPatch.from_dict(share_mount_target_patch_model_json)
- assert share_mount_target_patch_model != False
+ # Construct a model instance of 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 ShareMountTargetPatch by calling from_dict on the json representation
- share_mount_target_patch_model_dict = ShareMountTargetPatch.from_dict(share_mount_target_patch_model_json).__dict__
- share_mount_target_patch_model2 = ShareMountTargetPatch(**share_mount_target_patch_model_dict)
+ # 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 share_mount_target_patch_model == share_mount_target_patch_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
- share_mount_target_patch_model_json2 = share_mount_target_patch_model.to_dict()
- assert share_mount_target_patch_model_json2 == share_mount_target_patch_model_json
+ 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_ShareMountTargetReference:
+class TestModel_VPNGatewayConnectionStaticRouteModeTunnel:
"""
- Test Class for ShareMountTargetReference
+ Test Class for VPNGatewayConnectionStaticRouteModeTunnel
"""
- def test_share_mount_target_reference_serialization(self):
+ def test_vpn_gateway_connection_static_route_mode_tunnel_serialization(self):
"""
- Test serialization/deserialization for ShareMountTargetReference
+ Test serialization/deserialization for VPNGatewayConnectionStaticRouteModeTunnel
"""
# Construct dict forms of any model objects needed in order to build this model.
- share_mount_target_reference_deleted_model = {} # ShareMountTargetReferenceDeleted
- share_mount_target_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ ip_model = {} # IP
+ ip_model['address'] = '192.168.3.4'
- # Construct a json representation of a ShareMountTargetReference model
- share_mount_target_reference_model_json = {}
- share_mount_target_reference_model_json['deleted'] = share_mount_target_reference_deleted_model
- share_mount_target_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c'
- share_mount_target_reference_model_json['id'] = '4cf9171a-0043-4434-8727-15b53dbc374c'
- share_mount_target_reference_model_json['name'] = 'my-share-mount-target'
- share_mount_target_reference_model_json['resource_type'] = 'share_mount_target'
+ vpn_gateway_connection_tunnel_status_reason_model = {} # VPNGatewayConnectionTunnelStatusReason
+ vpn_gateway_connection_tunnel_status_reason_model['code'] = 'cannot_authenticate_connection'
+ vpn_gateway_connection_tunnel_status_reason_model['message'] = 'Failed to authenticate a connection because of mismatched IKE ID and PSK.'
+ vpn_gateway_connection_tunnel_status_reason_model['more_info'] = 'https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health'
- # Construct a model instance of ShareMountTargetReference by calling from_dict on the json representation
- share_mount_target_reference_model = ShareMountTargetReference.from_dict(share_mount_target_reference_model_json)
- assert share_mount_target_reference_model != False
+ # Construct a 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'
+ vpn_gateway_connection_static_route_mode_tunnel_model_json['status_reasons'] = [vpn_gateway_connection_tunnel_status_reason_model]
- # Construct a model instance of ShareMountTargetReference by calling from_dict on the json representation
- share_mount_target_reference_model_dict = ShareMountTargetReference.from_dict(share_mount_target_reference_model_json).__dict__
- share_mount_target_reference_model2 = ShareMountTargetReference(**share_mount_target_reference_model_dict)
+ # 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 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)
# Verify the model instances are equivalent
- assert share_mount_target_reference_model == share_mount_target_reference_model2
+ assert vpn_gateway_connection_static_route_mode_tunnel_model == vpn_gateway_connection_static_route_mode_tunnel_model2
# Convert model instance back to dict and verify no loss of data
- share_mount_target_reference_model_json2 = share_mount_target_reference_model.to_dict()
- assert share_mount_target_reference_model_json2 == share_mount_target_reference_model_json
+ 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
-class TestModel_ShareMountTargetReferenceDeleted:
+class TestModel_VPNGatewayConnectionStatusReason:
"""
- Test Class for ShareMountTargetReferenceDeleted
+ Test Class for VPNGatewayConnectionStatusReason
"""
- def test_share_mount_target_reference_deleted_serialization(self):
+ def test_vpn_gateway_connection_status_reason_serialization(self):
"""
- Test serialization/deserialization for ShareMountTargetReferenceDeleted
+ Test serialization/deserialization for VPNGatewayConnectionStatusReason
"""
- # Construct a json representation of a ShareMountTargetReferenceDeleted model
- share_mount_target_reference_deleted_model_json = {}
- share_mount_target_reference_deleted_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ # Construct a json representation of a VPNGatewayConnectionStatusReason model
+ vpn_gateway_connection_status_reason_model_json = {}
+ vpn_gateway_connection_status_reason_model_json['code'] = 'cannot_authenticate_connection'
+ vpn_gateway_connection_status_reason_model_json['message'] = 'Failed to authenticate a connection because of mismatched IKE ID and PSK.'
+ vpn_gateway_connection_status_reason_model_json['more_info'] = 'https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health'
- # Construct a model instance of ShareMountTargetReferenceDeleted by calling from_dict on the json representation
- share_mount_target_reference_deleted_model = ShareMountTargetReferenceDeleted.from_dict(share_mount_target_reference_deleted_model_json)
- assert share_mount_target_reference_deleted_model != False
+ # Construct a model instance of VPNGatewayConnectionStatusReason by calling from_dict on the json representation
+ vpn_gateway_connection_status_reason_model = VPNGatewayConnectionStatusReason.from_dict(vpn_gateway_connection_status_reason_model_json)
+ assert vpn_gateway_connection_status_reason_model != False
- # Construct a model instance of ShareMountTargetReferenceDeleted by calling from_dict on the json representation
- share_mount_target_reference_deleted_model_dict = ShareMountTargetReferenceDeleted.from_dict(share_mount_target_reference_deleted_model_json).__dict__
- share_mount_target_reference_deleted_model2 = ShareMountTargetReferenceDeleted(**share_mount_target_reference_deleted_model_dict)
+ # Construct a model instance of VPNGatewayConnectionStatusReason by calling from_dict on the json representation
+ vpn_gateway_connection_status_reason_model_dict = VPNGatewayConnectionStatusReason.from_dict(vpn_gateway_connection_status_reason_model_json).__dict__
+ vpn_gateway_connection_status_reason_model2 = VPNGatewayConnectionStatusReason(**vpn_gateway_connection_status_reason_model_dict)
# Verify the model instances are equivalent
- assert share_mount_target_reference_deleted_model == share_mount_target_reference_deleted_model2
+ assert vpn_gateway_connection_status_reason_model == vpn_gateway_connection_status_reason_model2
# Convert model instance back to dict and verify no loss of data
- share_mount_target_reference_deleted_model_json2 = share_mount_target_reference_deleted_model.to_dict()
- assert share_mount_target_reference_deleted_model_json2 == share_mount_target_reference_deleted_model_json
+ vpn_gateway_connection_status_reason_model_json2 = vpn_gateway_connection_status_reason_model.to_dict()
+ assert vpn_gateway_connection_status_reason_model_json2 == vpn_gateway_connection_status_reason_model_json
-class TestModel_SharePatch:
+class TestModel_VPNGatewayConnectionTunnelStatusReason:
"""
- Test Class for SharePatch
+ Test Class for VPNGatewayConnectionTunnelStatusReason
"""
- def test_share_patch_serialization(self):
+ def test_vpn_gateway_connection_tunnel_status_reason_serialization(self):
"""
- Test serialization/deserialization for SharePatch
+ Test serialization/deserialization for VPNGatewayConnectionTunnelStatusReason
"""
- # Construct dict forms of any model objects needed in order to build this model.
-
- share_profile_identity_model = {} # ShareProfileIdentityByName
- share_profile_identity_model['name'] = 'tier-3iops'
-
- # Construct a json representation of a SharePatch model
- share_patch_model_json = {}
- share_patch_model_json['access_control_mode'] = 'security_group'
- share_patch_model_json['iops'] = 100
- share_patch_model_json['name'] = 'my-share'
- share_patch_model_json['profile'] = share_profile_identity_model
- share_patch_model_json['replication_cron_spec'] = '0 */5 * * *'
- share_patch_model_json['size'] = 200
- share_patch_model_json['user_tags'] = ['testString']
+ # Construct a json representation of a VPNGatewayConnectionTunnelStatusReason model
+ vpn_gateway_connection_tunnel_status_reason_model_json = {}
+ vpn_gateway_connection_tunnel_status_reason_model_json['code'] = 'cannot_authenticate_connection'
+ vpn_gateway_connection_tunnel_status_reason_model_json['message'] = 'Failed to authenticate a connection because of mismatched IKE ID and PSK.'
+ vpn_gateway_connection_tunnel_status_reason_model_json['more_info'] = 'https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health'
- # Construct a model instance of SharePatch by calling from_dict on the json representation
- share_patch_model = SharePatch.from_dict(share_patch_model_json)
- assert share_patch_model != False
+ # Construct a model instance of VPNGatewayConnectionTunnelStatusReason by calling from_dict on the json representation
+ vpn_gateway_connection_tunnel_status_reason_model = VPNGatewayConnectionTunnelStatusReason.from_dict(vpn_gateway_connection_tunnel_status_reason_model_json)
+ assert vpn_gateway_connection_tunnel_status_reason_model != False
- # Construct a model instance of SharePatch by calling from_dict on the json representation
- share_patch_model_dict = SharePatch.from_dict(share_patch_model_json).__dict__
- share_patch_model2 = SharePatch(**share_patch_model_dict)
+ # Construct a model instance of VPNGatewayConnectionTunnelStatusReason by calling from_dict on the json representation
+ vpn_gateway_connection_tunnel_status_reason_model_dict = VPNGatewayConnectionTunnelStatusReason.from_dict(vpn_gateway_connection_tunnel_status_reason_model_json).__dict__
+ vpn_gateway_connection_tunnel_status_reason_model2 = VPNGatewayConnectionTunnelStatusReason(**vpn_gateway_connection_tunnel_status_reason_model_dict)
# Verify the model instances are equivalent
- assert share_patch_model == share_patch_model2
+ assert vpn_gateway_connection_tunnel_status_reason_model == vpn_gateway_connection_tunnel_status_reason_model2
# Convert model instance back to dict and verify no loss of data
- share_patch_model_json2 = share_patch_model.to_dict()
- assert share_patch_model_json2 == share_patch_model_json
+ vpn_gateway_connection_tunnel_status_reason_model_json2 = vpn_gateway_connection_tunnel_status_reason_model.to_dict()
+ assert vpn_gateway_connection_tunnel_status_reason_model_json2 == vpn_gateway_connection_tunnel_status_reason_model_json
-class TestModel_ShareProfile:
+class TestModel_VPNGatewayHealthReason:
"""
- Test Class for ShareProfile
+ Test Class for VPNGatewayHealthReason
"""
- def test_share_profile_serialization(self):
+ def test_vpn_gateway_health_reason_serialization(self):
"""
- Test serialization/deserialization for ShareProfile
+ Test serialization/deserialization for VPNGatewayHealthReason
"""
- # Construct dict forms of any model objects needed in order to build this model.
+ # Construct a json representation of a VPNGatewayHealthReason model
+ vpn_gateway_health_reason_model_json = {}
+ vpn_gateway_health_reason_model_json['code'] = 'cannot_reserve_ip_address'
+ vpn_gateway_health_reason_model_json['message'] = 'IP address exhaustion (release addresses on the VPN\'s subnet).'
+ vpn_gateway_health_reason_model_json['more_info'] = 'https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health'
- share_profile_capacity_model = {} # ShareProfileCapacityFixed
- share_profile_capacity_model['type'] = 'fixed'
- share_profile_capacity_model['value'] = 4800
+ # Construct a model instance of VPNGatewayHealthReason by calling from_dict on the json representation
+ vpn_gateway_health_reason_model = VPNGatewayHealthReason.from_dict(vpn_gateway_health_reason_model_json)
+ assert vpn_gateway_health_reason_model != False
- share_profile_iops_model = {} # ShareProfileIOPSFixed
- share_profile_iops_model['type'] = 'fixed'
- share_profile_iops_model['value'] = 4000
+ # Construct a model instance of VPNGatewayHealthReason by calling from_dict on the json representation
+ vpn_gateway_health_reason_model_dict = VPNGatewayHealthReason.from_dict(vpn_gateway_health_reason_model_json).__dict__
+ vpn_gateway_health_reason_model2 = VPNGatewayHealthReason(**vpn_gateway_health_reason_model_dict)
- # Construct a json representation of a ShareProfile model
- share_profile_model_json = {}
- share_profile_model_json['capacity'] = share_profile_capacity_model
- share_profile_model_json['family'] = 'defined_performance'
- share_profile_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops'
- share_profile_model_json['iops'] = share_profile_iops_model
- share_profile_model_json['name'] = 'tier-3iops'
- share_profile_model_json['resource_type'] = 'share_profile'
+ # Verify the model instances are equivalent
+ assert vpn_gateway_health_reason_model == vpn_gateway_health_reason_model2
- # Construct a model instance of ShareProfile by calling from_dict on the json representation
- share_profile_model = ShareProfile.from_dict(share_profile_model_json)
- assert share_profile_model != False
+ # Convert model instance back to dict and verify no loss of data
+ vpn_gateway_health_reason_model_json2 = vpn_gateway_health_reason_model.to_dict()
+ assert vpn_gateway_health_reason_model_json2 == vpn_gateway_health_reason_model_json
- # Construct a model instance of ShareProfile by calling from_dict on the json representation
- share_profile_model_dict = ShareProfile.from_dict(share_profile_model_json).__dict__
- share_profile_model2 = ShareProfile(**share_profile_model_dict)
+
+class TestModel_VPNGatewayLifecycleReason:
+ """
+ Test Class for VPNGatewayLifecycleReason
+ """
+
+ def test_vpn_gateway_lifecycle_reason_serialization(self):
+ """
+ Test serialization/deserialization for VPNGatewayLifecycleReason
+ """
+
+ # Construct a json representation of a VPNGatewayLifecycleReason model
+ vpn_gateway_lifecycle_reason_model_json = {}
+ vpn_gateway_lifecycle_reason_model_json['code'] = 'resource_suspended_by_provider'
+ vpn_gateway_lifecycle_reason_model_json['message'] = 'The resource has been suspended. Contact IBM support with the CRN for next steps.'
+ vpn_gateway_lifecycle_reason_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#resource-suspension'
+
+ # Construct a model instance of VPNGatewayLifecycleReason by calling from_dict on the json representation
+ vpn_gateway_lifecycle_reason_model = VPNGatewayLifecycleReason.from_dict(vpn_gateway_lifecycle_reason_model_json)
+ assert vpn_gateway_lifecycle_reason_model != False
+
+ # Construct a model instance of VPNGatewayLifecycleReason by calling from_dict on the json representation
+ vpn_gateway_lifecycle_reason_model_dict = VPNGatewayLifecycleReason.from_dict(vpn_gateway_lifecycle_reason_model_json).__dict__
+ vpn_gateway_lifecycle_reason_model2 = VPNGatewayLifecycleReason(**vpn_gateway_lifecycle_reason_model_dict)
# Verify the model instances are equivalent
- assert share_profile_model == share_profile_model2
+ assert vpn_gateway_lifecycle_reason_model == vpn_gateway_lifecycle_reason_model2
# Convert model instance back to dict and verify no loss of data
- share_profile_model_json2 = share_profile_model.to_dict()
- assert share_profile_model_json2 == share_profile_model_json
+ vpn_gateway_lifecycle_reason_model_json2 = vpn_gateway_lifecycle_reason_model.to_dict()
+ assert vpn_gateway_lifecycle_reason_model_json2 == vpn_gateway_lifecycle_reason_model_json
-class TestModel_ShareProfileCollection:
+class TestModel_VPNGatewayMember:
"""
- Test Class for ShareProfileCollection
+ Test Class for VPNGatewayMember
"""
- def test_share_profile_collection_serialization(self):
+ def test_vpn_gateway_member_serialization(self):
"""
- Test serialization/deserialization for ShareProfileCollection
+ Test serialization/deserialization for VPNGatewayMember
"""
# Construct dict forms of any model objects needed in order to build this model.
- share_profile_collection_first_model = {} # ShareProfileCollectionFirst
- share_profile_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/share/profiles?limit=20'
+ vpn_gateway_member_health_reason_model = {} # VPNGatewayMemberHealthReason
+ vpn_gateway_member_health_reason_model['code'] = 'cannot_reserve_ip_address'
+ vpn_gateway_member_health_reason_model['message'] = 'IP address exhaustion (release addresses on the VPN\'s subnet).'
+ vpn_gateway_member_health_reason_model['more_info'] = 'https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health'
- share_profile_collection_next_model = {} # ShareProfileCollectionNext
- share_profile_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/share/profiles?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
+ vpn_gateway_member_lifecycle_reason_model = {} # VPNGatewayMemberLifecycleReason
+ vpn_gateway_member_lifecycle_reason_model['code'] = 'resource_suspended_by_provider'
+ vpn_gateway_member_lifecycle_reason_model['message'] = 'The resource has been suspended. Contact IBM support with the CRN for next steps.'
+ vpn_gateway_member_lifecycle_reason_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#resource-suspension'
- share_profile_capacity_model = {} # ShareProfileCapacityFixed
- share_profile_capacity_model['type'] = 'fixed'
- share_profile_capacity_model['value'] = 4800
+ reserved_ip_reference_deleted_model = {} # ReservedIPReferenceDeleted
+ reserved_ip_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- share_profile_iops_model = {} # ShareProfileIOPSFixed
- share_profile_iops_model['type'] = 'fixed'
- share_profile_iops_model['value'] = 4000
+ 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'
- share_profile_model = {} # ShareProfile
- share_profile_model['capacity'] = share_profile_capacity_model
- share_profile_model['family'] = 'defined_performance'
- share_profile_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops'
- share_profile_model['iops'] = share_profile_iops_model
- share_profile_model['name'] = 'tier-3iops'
- share_profile_model['resource_type'] = 'share_profile'
+ ip_model = {} # IP
+ ip_model['address'] = '192.168.3.4'
- # Construct a json representation of a ShareProfileCollection model
- share_profile_collection_model_json = {}
- share_profile_collection_model_json['first'] = share_profile_collection_first_model
- share_profile_collection_model_json['limit'] = 20
- share_profile_collection_model_json['next'] = share_profile_collection_next_model
- share_profile_collection_model_json['profiles'] = [share_profile_model]
- share_profile_collection_model_json['total_count'] = 132
+ # Construct a json representation of a VPNGatewayMember model
+ vpn_gateway_member_model_json = {}
+ vpn_gateway_member_model_json['health_reasons'] = [vpn_gateway_member_health_reason_model]
+ vpn_gateway_member_model_json['health_state'] = 'ok'
+ vpn_gateway_member_model_json['lifecycle_reasons'] = [vpn_gateway_member_lifecycle_reason_model]
+ vpn_gateway_member_model_json['lifecycle_state'] = 'stable'
+ vpn_gateway_member_model_json['private_ip'] = reserved_ip_reference_model
+ vpn_gateway_member_model_json['public_ip'] = ip_model
+ vpn_gateway_member_model_json['role'] = 'active'
- # Construct a model instance of ShareProfileCollection by calling from_dict on the json representation
- share_profile_collection_model = ShareProfileCollection.from_dict(share_profile_collection_model_json)
- assert share_profile_collection_model != False
+ # Construct a model instance of 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 ShareProfileCollection by calling from_dict on the json representation
- share_profile_collection_model_dict = ShareProfileCollection.from_dict(share_profile_collection_model_json).__dict__
- share_profile_collection_model2 = ShareProfileCollection(**share_profile_collection_model_dict)
+ # 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 share_profile_collection_model == share_profile_collection_model2
+ assert vpn_gateway_member_model == vpn_gateway_member_model2
# Convert model instance back to dict and verify no loss of data
- share_profile_collection_model_json2 = share_profile_collection_model.to_dict()
- assert share_profile_collection_model_json2 == share_profile_collection_model_json
+ vpn_gateway_member_model_json2 = vpn_gateway_member_model.to_dict()
+ assert vpn_gateway_member_model_json2 == vpn_gateway_member_model_json
-class TestModel_ShareProfileCollectionFirst:
+class TestModel_VPNGatewayMemberHealthReason:
"""
- Test Class for ShareProfileCollectionFirst
+ Test Class for VPNGatewayMemberHealthReason
"""
- def test_share_profile_collection_first_serialization(self):
+ def test_vpn_gateway_member_health_reason_serialization(self):
"""
- Test serialization/deserialization for ShareProfileCollectionFirst
+ Test serialization/deserialization for VPNGatewayMemberHealthReason
"""
- # Construct a json representation of a ShareProfileCollectionFirst model
- share_profile_collection_first_model_json = {}
- share_profile_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/share/profiles?limit=20'
+ # Construct a json representation of a VPNGatewayMemberHealthReason model
+ vpn_gateway_member_health_reason_model_json = {}
+ vpn_gateway_member_health_reason_model_json['code'] = 'cannot_reserve_ip_address'
+ vpn_gateway_member_health_reason_model_json['message'] = 'IP address exhaustion (release addresses on the VPN\'s subnet).'
+ vpn_gateway_member_health_reason_model_json['more_info'] = 'https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health'
- # Construct a model instance of ShareProfileCollectionFirst by calling from_dict on the json representation
- share_profile_collection_first_model = ShareProfileCollectionFirst.from_dict(share_profile_collection_first_model_json)
- assert share_profile_collection_first_model != False
+ # Construct a model instance of VPNGatewayMemberHealthReason by calling from_dict on the json representation
+ vpn_gateway_member_health_reason_model = VPNGatewayMemberHealthReason.from_dict(vpn_gateway_member_health_reason_model_json)
+ assert vpn_gateway_member_health_reason_model != False
- # Construct a model instance of ShareProfileCollectionFirst by calling from_dict on the json representation
- share_profile_collection_first_model_dict = ShareProfileCollectionFirst.from_dict(share_profile_collection_first_model_json).__dict__
- share_profile_collection_first_model2 = ShareProfileCollectionFirst(**share_profile_collection_first_model_dict)
+ # Construct a model instance of VPNGatewayMemberHealthReason by calling from_dict on the json representation
+ vpn_gateway_member_health_reason_model_dict = VPNGatewayMemberHealthReason.from_dict(vpn_gateway_member_health_reason_model_json).__dict__
+ vpn_gateway_member_health_reason_model2 = VPNGatewayMemberHealthReason(**vpn_gateway_member_health_reason_model_dict)
# Verify the model instances are equivalent
- assert share_profile_collection_first_model == share_profile_collection_first_model2
+ assert vpn_gateway_member_health_reason_model == vpn_gateway_member_health_reason_model2
# Convert model instance back to dict and verify no loss of data
- share_profile_collection_first_model_json2 = share_profile_collection_first_model.to_dict()
- assert share_profile_collection_first_model_json2 == share_profile_collection_first_model_json
+ vpn_gateway_member_health_reason_model_json2 = vpn_gateway_member_health_reason_model.to_dict()
+ assert vpn_gateway_member_health_reason_model_json2 == vpn_gateway_member_health_reason_model_json
-class TestModel_ShareProfileCollectionNext:
+class TestModel_VPNGatewayMemberLifecycleReason:
"""
- Test Class for ShareProfileCollectionNext
+ Test Class for VPNGatewayMemberLifecycleReason
"""
- def test_share_profile_collection_next_serialization(self):
+ def test_vpn_gateway_member_lifecycle_reason_serialization(self):
"""
- Test serialization/deserialization for ShareProfileCollectionNext
+ Test serialization/deserialization for VPNGatewayMemberLifecycleReason
"""
- # Construct a json representation of a ShareProfileCollectionNext model
- share_profile_collection_next_model_json = {}
- share_profile_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/share/profiles?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
+ # Construct a json representation of a VPNGatewayMemberLifecycleReason model
+ vpn_gateway_member_lifecycle_reason_model_json = {}
+ vpn_gateway_member_lifecycle_reason_model_json['code'] = 'resource_suspended_by_provider'
+ vpn_gateway_member_lifecycle_reason_model_json['message'] = 'The resource has been suspended. Contact IBM support with the CRN for next steps.'
+ vpn_gateway_member_lifecycle_reason_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#resource-suspension'
- # Construct a model instance of ShareProfileCollectionNext by calling from_dict on the json representation
- share_profile_collection_next_model = ShareProfileCollectionNext.from_dict(share_profile_collection_next_model_json)
- assert share_profile_collection_next_model != False
+ # Construct a model instance of VPNGatewayMemberLifecycleReason by calling from_dict on the json representation
+ vpn_gateway_member_lifecycle_reason_model = VPNGatewayMemberLifecycleReason.from_dict(vpn_gateway_member_lifecycle_reason_model_json)
+ assert vpn_gateway_member_lifecycle_reason_model != False
- # Construct a model instance of ShareProfileCollectionNext by calling from_dict on the json representation
- share_profile_collection_next_model_dict = ShareProfileCollectionNext.from_dict(share_profile_collection_next_model_json).__dict__
- share_profile_collection_next_model2 = ShareProfileCollectionNext(**share_profile_collection_next_model_dict)
+ # Construct a model instance of VPNGatewayMemberLifecycleReason by calling from_dict on the json representation
+ vpn_gateway_member_lifecycle_reason_model_dict = VPNGatewayMemberLifecycleReason.from_dict(vpn_gateway_member_lifecycle_reason_model_json).__dict__
+ vpn_gateway_member_lifecycle_reason_model2 = VPNGatewayMemberLifecycleReason(**vpn_gateway_member_lifecycle_reason_model_dict)
# Verify the model instances are equivalent
- assert share_profile_collection_next_model == share_profile_collection_next_model2
+ assert vpn_gateway_member_lifecycle_reason_model == vpn_gateway_member_lifecycle_reason_model2
# Convert model instance back to dict and verify no loss of data
- share_profile_collection_next_model_json2 = share_profile_collection_next_model.to_dict()
- assert share_profile_collection_next_model_json2 == share_profile_collection_next_model_json
+ vpn_gateway_member_lifecycle_reason_model_json2 = vpn_gateway_member_lifecycle_reason_model.to_dict()
+ assert vpn_gateway_member_lifecycle_reason_model_json2 == vpn_gateway_member_lifecycle_reason_model_json
-class TestModel_ShareProfileReference:
+class TestModel_VPNGatewayPatch:
"""
- Test Class for ShareProfileReference
+ Test Class for VPNGatewayPatch
"""
- def test_share_profile_reference_serialization(self):
+ def test_vpn_gateway_patch_serialization(self):
"""
- Test serialization/deserialization for ShareProfileReference
+ Test serialization/deserialization for VPNGatewayPatch
"""
- # Construct a json representation of a ShareProfileReference model
- share_profile_reference_model_json = {}
- share_profile_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops'
- share_profile_reference_model_json['name'] = 'tier-3iops'
- share_profile_reference_model_json['resource_type'] = 'share_profile'
+ # Construct a json representation of a VPNGatewayPatch model
+ vpn_gateway_patch_model_json = {}
+ vpn_gateway_patch_model_json['name'] = 'my-vpn-gateway'
- # Construct a model instance of ShareProfileReference by calling from_dict on the json representation
- share_profile_reference_model = ShareProfileReference.from_dict(share_profile_reference_model_json)
- assert share_profile_reference_model != False
+ # Construct a model instance of 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 ShareProfileReference by calling from_dict on the json representation
- share_profile_reference_model_dict = ShareProfileReference.from_dict(share_profile_reference_model_json).__dict__
- share_profile_reference_model2 = ShareProfileReference(**share_profile_reference_model_dict)
+ # 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)
# Verify the model instances are equivalent
- assert share_profile_reference_model == share_profile_reference_model2
+ assert vpn_gateway_patch_model == vpn_gateway_patch_model2
# Convert model instance back to dict and verify no loss of data
- share_profile_reference_model_json2 = share_profile_reference_model.to_dict()
- assert share_profile_reference_model_json2 == share_profile_reference_model_json
+ vpn_gateway_patch_model_json2 = vpn_gateway_patch_model.to_dict()
+ assert vpn_gateway_patch_model_json2 == vpn_gateway_patch_model_json
-class TestModel_SharePrototypeShareContext:
+class TestModel_VPNGatewayReferenceDeleted:
"""
- Test Class for SharePrototypeShareContext
+ Test Class for VPNGatewayReferenceDeleted
"""
- def test_share_prototype_share_context_serialization(self):
+ def test_vpn_gateway_reference_deleted_serialization(self):
"""
- Test serialization/deserialization for SharePrototypeShareContext
+ Test serialization/deserialization for VPNGatewayReferenceDeleted
"""
- # Construct dict forms of any model objects needed in order to build this model.
-
- virtual_network_interface_primary_ip_prototype_model = {} # VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext
- virtual_network_interface_primary_ip_prototype_model['address'] = '10.0.0.5'
- virtual_network_interface_primary_ip_prototype_model['auto_delete'] = False
- virtual_network_interface_primary_ip_prototype_model['name'] = 'my-reserved-ip'
-
- resource_group_identity_model = {} # ResourceGroupIdentityById
- resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
-
- security_group_identity_model = {} # SecurityGroupIdentityById
- security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271'
-
- subnet_identity_model = {} # SubnetIdentityById
- subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
-
- share_mount_target_virtual_network_interface_prototype_model = {} # ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfacePrototypeShareMountTargetContext
- share_mount_target_virtual_network_interface_prototype_model['name'] = 'my-virtual-network-interface'
- share_mount_target_virtual_network_interface_prototype_model['primary_ip'] = virtual_network_interface_primary_ip_prototype_model
- share_mount_target_virtual_network_interface_prototype_model['resource_group'] = resource_group_identity_model
- share_mount_target_virtual_network_interface_prototype_model['security_groups'] = [security_group_identity_model]
- share_mount_target_virtual_network_interface_prototype_model['subnet'] = subnet_identity_model
-
- share_mount_target_prototype_model = {} # ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup
- share_mount_target_prototype_model['name'] = 'my-share-mount-target'
- share_mount_target_prototype_model['transit_encryption'] = 'none'
- share_mount_target_prototype_model['virtual_network_interface'] = share_mount_target_virtual_network_interface_prototype_model
-
- share_profile_identity_model = {} # ShareProfileIdentityByName
- share_profile_identity_model['name'] = 'tier-3iops'
-
- zone_identity_model = {} # ZoneIdentityByName
- zone_identity_model['name'] = 'us-south-1'
-
- # Construct a json representation of a SharePrototypeShareContext model
- share_prototype_share_context_model_json = {}
- share_prototype_share_context_model_json['iops'] = 100
- share_prototype_share_context_model_json['mount_targets'] = [share_mount_target_prototype_model]
- share_prototype_share_context_model_json['name'] = 'my-share'
- share_prototype_share_context_model_json['profile'] = share_profile_identity_model
- share_prototype_share_context_model_json['replication_cron_spec'] = '0 */5 * * *'
- share_prototype_share_context_model_json['resource_group'] = resource_group_identity_model
- share_prototype_share_context_model_json['user_tags'] = []
- share_prototype_share_context_model_json['zone'] = zone_identity_model
+ # Construct a json representation of a VPNGatewayReferenceDeleted model
+ vpn_gateway_reference_deleted_model_json = {}
+ vpn_gateway_reference_deleted_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Construct a model instance of SharePrototypeShareContext by calling from_dict on the json representation
- share_prototype_share_context_model = SharePrototypeShareContext.from_dict(share_prototype_share_context_model_json)
- assert share_prototype_share_context_model != False
+ # Construct a model instance of VPNGatewayReferenceDeleted by calling from_dict on the json representation
+ vpn_gateway_reference_deleted_model = VPNGatewayReferenceDeleted.from_dict(vpn_gateway_reference_deleted_model_json)
+ assert vpn_gateway_reference_deleted_model != False
- # Construct a model instance of SharePrototypeShareContext by calling from_dict on the json representation
- share_prototype_share_context_model_dict = SharePrototypeShareContext.from_dict(share_prototype_share_context_model_json).__dict__
- share_prototype_share_context_model2 = SharePrototypeShareContext(**share_prototype_share_context_model_dict)
+ # Construct a model instance of VPNGatewayReferenceDeleted by calling from_dict on the json representation
+ vpn_gateway_reference_deleted_model_dict = VPNGatewayReferenceDeleted.from_dict(vpn_gateway_reference_deleted_model_json).__dict__
+ vpn_gateway_reference_deleted_model2 = VPNGatewayReferenceDeleted(**vpn_gateway_reference_deleted_model_dict)
# Verify the model instances are equivalent
- assert share_prototype_share_context_model == share_prototype_share_context_model2
+ assert vpn_gateway_reference_deleted_model == vpn_gateway_reference_deleted_model2
# Convert model instance back to dict and verify no loss of data
- share_prototype_share_context_model_json2 = share_prototype_share_context_model.to_dict()
- assert share_prototype_share_context_model_json2 == share_prototype_share_context_model_json
+ vpn_gateway_reference_deleted_model_json2 = vpn_gateway_reference_deleted_model.to_dict()
+ assert vpn_gateway_reference_deleted_model_json2 == vpn_gateway_reference_deleted_model_json
-class TestModel_ShareReference:
+class TestModel_VPNServer:
"""
- Test Class for ShareReference
+ Test Class for VPNServer
"""
- def test_share_reference_serialization(self):
+ def test_vpn_server_serialization(self):
"""
- Test serialization/deserialization for ShareReference
+ Test serialization/deserialization for VPNServer
"""
# Construct dict forms of any model objects needed in order to build this model.
- share_reference_deleted_model = {} # ShareReferenceDeleted
- share_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
-
- # Construct a json representation of a ShareReference model
- share_reference_model_json = {}
- share_reference_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58'
- share_reference_model_json['deleted'] = share_reference_deleted_model
- share_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58'
- share_reference_model_json['id'] = '0fe9e5d8-0a4d-4818-96ec-e99708644a58'
- share_reference_model_json['name'] = 'my-share'
- share_reference_model_json['resource_type'] = 'share'
-
- # Construct a model instance of ShareReference by calling from_dict on the json representation
- share_reference_model = ShareReference.from_dict(share_reference_model_json)
- assert share_reference_model != False
+ certificate_instance_reference_model = {} # CertificateInstanceReference
+ certificate_instance_reference_model['crn'] = 'crn:v1:bluemix:public:secrets-manager:us-south:a/123456:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5'
- # Construct a model instance of ShareReference by calling from_dict on the json representation
- share_reference_model_dict = ShareReference.from_dict(share_reference_model_json).__dict__
- share_reference_model2 = ShareReference(**share_reference_model_dict)
+ vpn_server_authentication_by_username_id_provider_model = {} # VPNServerAuthenticationByUsernameIdProviderByIAM
+ vpn_server_authentication_by_username_id_provider_model['provider_type'] = 'iam'
- # Verify the model instances are equivalent
- assert share_reference_model == share_reference_model2
+ vpn_server_authentication_model = {} # VPNServerAuthenticationByUsername
+ vpn_server_authentication_model['method'] = 'certificate'
+ vpn_server_authentication_model['identity_provider'] = vpn_server_authentication_by_username_id_provider_model
- # Convert model instance back to dict and verify no loss of data
- share_reference_model_json2 = share_reference_model.to_dict()
- assert share_reference_model_json2 == share_reference_model_json
+ ip_model = {} # IP
+ ip_model['address'] = '192.168.3.4'
+ vpn_server_health_reason_model = {} # VPNServerHealthReason
+ vpn_server_health_reason_model['code'] = 'cannot_access_server_certificate'
+ vpn_server_health_reason_model['message'] = 'Failed to get VPN server\'s server certificate from Secrets Manager.'
+ vpn_server_health_reason_model['more_info'] = 'https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-health'
-class TestModel_ShareReferenceDeleted:
- """
- Test Class for ShareReferenceDeleted
- """
+ vpn_server_lifecycle_reason_model = {} # VPNServerLifecycleReason
+ vpn_server_lifecycle_reason_model['code'] = 'resource_suspended_by_provider'
+ vpn_server_lifecycle_reason_model['message'] = 'The resource has been suspended. Contact IBM support with the CRN for next steps.'
+ vpn_server_lifecycle_reason_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#resource-suspension'
- def test_share_reference_deleted_serialization(self):
- """
- Test serialization/deserialization for ShareReferenceDeleted
- """
+ 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 ShareReferenceDeleted model
- share_reference_deleted_model_json = {}
- share_reference_deleted_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ reserved_ip_reference_model = {} # ReservedIPReference
+ reserved_ip_reference_model['address'] = '192.168.3.4'
+ reserved_ip_reference_model['deleted'] = reserved_ip_reference_deleted_model
+ reserved_ip_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb'
+ reserved_ip_reference_model['id'] = '6d353a0f-aeb1-4ae1-832e-1110d10981bb'
+ reserved_ip_reference_model['name'] = 'my-reserved-ip'
+ reserved_ip_reference_model['resource_type'] = 'subnet_reserved_ip'
- # Construct a model instance of ShareReferenceDeleted by calling from_dict on the json representation
- share_reference_deleted_model = ShareReferenceDeleted.from_dict(share_reference_deleted_model_json)
- assert share_reference_deleted_model != False
+ 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 ShareReferenceDeleted by calling from_dict on the json representation
- share_reference_deleted_model_dict = ShareReferenceDeleted.from_dict(share_reference_deleted_model_json).__dict__
- share_reference_deleted_model2 = ShareReferenceDeleted(**share_reference_deleted_model_dict)
+ 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 share_reference_deleted_model == share_reference_deleted_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
- share_reference_deleted_model_json2 = share_reference_deleted_model.to_dict()
- assert share_reference_deleted_model_json2 == share_reference_deleted_model_json
+ subnet_reference_deleted_model = {} # SubnetReferenceDeleted
+ subnet_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ subnet_reference_model = {} # SubnetReference
+ subnet_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
+ subnet_reference_model['deleted'] = subnet_reference_deleted_model
+ subnet_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
+ subnet_reference_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
+ subnet_reference_model['name'] = 'my-subnet'
+ subnet_reference_model['resource_type'] = 'subnet'
-class TestModel_ShareReplicationStatusReason:
- """
- Test Class for ShareReplicationStatusReason
- """
+ vpc_reference_deleted_model = {} # VPCReferenceDeleted
+ vpc_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- def test_share_replication_status_reason_serialization(self):
- """
- Test serialization/deserialization for ShareReplicationStatusReason
- """
+ vpc_reference_model = {} # VPCReference
+ vpc_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b'
+ vpc_reference_model['deleted'] = vpc_reference_deleted_model
+ vpc_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b'
+ vpc_reference_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b'
+ vpc_reference_model['name'] = 'my-vpc'
+ vpc_reference_model['resource_type'] = 'vpc'
- # Construct a json representation of a ShareReplicationStatusReason model
- share_replication_status_reason_model_json = {}
- share_replication_status_reason_model_json['code'] = 'cannot_reach_source_share'
- share_replication_status_reason_model_json['message'] = 'The replication failover failed because the source share cannot be reached.'
- share_replication_status_reason_model_json['more_info'] = 'https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning'
+ # Construct a json representation of a VPNServer model
+ vpn_server_model_json = {}
+ vpn_server_model_json['certificate'] = certificate_instance_reference_model
+ vpn_server_model_json['client_authentication'] = [vpn_server_authentication_model]
+ vpn_server_model_json['client_auto_delete'] = True
+ vpn_server_model_json['client_auto_delete_timeout'] = 1
+ vpn_server_model_json['client_dns_server_ips'] = [ip_model]
+ vpn_server_model_json['client_idle_timeout'] = 600
+ vpn_server_model_json['client_ip_pool'] = '172.16.0.0/16'
+ vpn_server_model_json['created_at'] = '2019-01-01T12:00:00Z'
+ vpn_server_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpn-server:r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5'
+ vpn_server_model_json['enable_split_tunneling'] = True
+ vpn_server_model_json['health_reasons'] = [vpn_server_health_reason_model]
+ vpn_server_model_json['health_state'] = 'ok'
+ vpn_server_model_json['hostname'] = 'a8506291.us-south.vpn-server.appdomain.cloud'
+ vpn_server_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5'
+ vpn_server_model_json['id'] = 'r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5'
+ vpn_server_model_json['lifecycle_reasons'] = [vpn_server_lifecycle_reason_model]
+ vpn_server_model_json['lifecycle_state'] = 'stable'
+ vpn_server_model_json['name'] = 'my-vpn-server'
+ vpn_server_model_json['port'] = 443
+ vpn_server_model_json['private_ips'] = [reserved_ip_reference_model]
+ vpn_server_model_json['protocol'] = 'udp'
+ vpn_server_model_json['resource_group'] = resource_group_reference_model
+ vpn_server_model_json['resource_type'] = 'vpn_server'
+ vpn_server_model_json['security_groups'] = [security_group_reference_model]
+ vpn_server_model_json['subnets'] = [subnet_reference_model]
+ vpn_server_model_json['vpc'] = vpc_reference_model
- # Construct a model instance of ShareReplicationStatusReason by calling from_dict on the json representation
- share_replication_status_reason_model = ShareReplicationStatusReason.from_dict(share_replication_status_reason_model_json)
- assert share_replication_status_reason_model != False
+ # Construct a model instance of VPNServer by calling from_dict on the json representation
+ vpn_server_model = VPNServer.from_dict(vpn_server_model_json)
+ assert vpn_server_model != False
- # Construct a model instance of ShareReplicationStatusReason by calling from_dict on the json representation
- share_replication_status_reason_model_dict = ShareReplicationStatusReason.from_dict(share_replication_status_reason_model_json).__dict__
- share_replication_status_reason_model2 = ShareReplicationStatusReason(**share_replication_status_reason_model_dict)
+ # Construct a model instance of VPNServer by calling from_dict on the json representation
+ vpn_server_model_dict = VPNServer.from_dict(vpn_server_model_json).__dict__
+ vpn_server_model2 = VPNServer(**vpn_server_model_dict)
# Verify the model instances are equivalent
- assert share_replication_status_reason_model == share_replication_status_reason_model2
+ assert vpn_server_model == vpn_server_model2
# Convert model instance back to dict and verify no loss of data
- share_replication_status_reason_model_json2 = share_replication_status_reason_model.to_dict()
- assert share_replication_status_reason_model_json2 == share_replication_status_reason_model_json
+ vpn_server_model_json2 = vpn_server_model.to_dict()
+ assert vpn_server_model_json2 == vpn_server_model_json
-class TestModel_Snapshot:
+class TestModel_VPNServerClient:
"""
- Test Class for Snapshot
+ Test Class for VPNServerClient
"""
- def test_snapshot_serialization(self):
+ def test_vpn_server_client_serialization(self):
"""
- Test serialization/deserialization for Snapshot
+ Test serialization/deserialization for VPNServerClient
"""
# Construct dict forms of any model objects needed in order to build this model.
- backup_policy_plan_reference_deleted_model = {} # BackupPolicyPlanReferenceDeleted
- backup_policy_plan_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
-
- 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'
-
- backup_policy_plan_remote_model = {} # BackupPolicyPlanRemote
- backup_policy_plan_remote_model['region'] = region_reference_model
-
- backup_policy_plan_reference_model = {} # BackupPolicyPlanReference
- backup_policy_plan_reference_model['deleted'] = backup_policy_plan_reference_deleted_model
- backup_policy_plan_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178'
- backup_policy_plan_reference_model['id'] = 'r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178'
- backup_policy_plan_reference_model['name'] = 'my-policy-plan'
- backup_policy_plan_reference_model['remote'] = backup_policy_plan_remote_model
- backup_policy_plan_reference_model['resource_type'] = 'backup_policy_plan'
-
- 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'
-
- snapshot_clone_model = {} # SnapshotClone
- snapshot_clone_model['available'] = True
- snapshot_clone_model['created_at'] = '2019-01-01T12:00:00Z'
- snapshot_clone_model['zone'] = zone_reference_model
-
- snapshot_reference_deleted_model = {} # SnapshotReferenceDeleted
- snapshot_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ ip_model = {} # IP
+ ip_model['address'] = '192.168.3.4'
- snapshot_remote_model = {} # SnapshotRemote
- snapshot_remote_model['region'] = region_reference_model
+ # Construct a json representation of a VPNServerClient model
+ vpn_server_client_model_json = {}
+ vpn_server_client_model_json['client_ip'] = ip_model
+ vpn_server_client_model_json['common_name'] = 'testString'
+ vpn_server_client_model_json['created_at'] = '2019-01-01T12:00:00Z'
+ vpn_server_client_model_json['disconnected_at'] = '2019-01-01T12:00:00Z'
+ vpn_server_client_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/8e454ead-0db7-48ac-9a8b-2698d8c470a7/clients/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531'
+ vpn_server_client_model_json['id'] = 'r006-1a15dca5-7e33-45e1-b7c5-bc690e569531'
+ vpn_server_client_model_json['remote_ip'] = ip_model
+ vpn_server_client_model_json['remote_port'] = 22
+ vpn_server_client_model_json['resource_type'] = 'vpn_server_client'
+ vpn_server_client_model_json['status'] = 'connected'
+ vpn_server_client_model_json['username'] = 'testString'
- snapshot_copies_item_model = {} # SnapshotCopiesItem
- snapshot_copies_item_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263'
- snapshot_copies_item_model['deleted'] = snapshot_reference_deleted_model
- snapshot_copies_item_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263'
- snapshot_copies_item_model['id'] = 'r134-f6bfa329-0e36-433f-a3bb-0df632e79263'
- snapshot_copies_item_model['name'] = 'my-snapshot'
- snapshot_copies_item_model['remote'] = snapshot_remote_model
- snapshot_copies_item_model['resource_type'] = 'snapshot'
+ # Construct a model instance of VPNServerClient by calling from_dict on the json representation
+ vpn_server_client_model = VPNServerClient.from_dict(vpn_server_client_model_json)
+ assert vpn_server_client_model != False
- encryption_key_reference_model = {} # EncryptionKeyReference
- encryption_key_reference_model['crn'] = 'crn:v1:bluemix:public:kms:us-south:a/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179'
+ # Construct a model instance of VPNServerClient by calling from_dict on the json representation
+ vpn_server_client_model_dict = VPNServerClient.from_dict(vpn_server_client_model_json).__dict__
+ vpn_server_client_model2 = VPNServerClient(**vpn_server_client_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 vpn_server_client_model == vpn_server_client_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
+ vpn_server_client_model_json2 = vpn_server_client_model.to_dict()
+ assert vpn_server_client_model_json2 == vpn_server_client_model_json
- image_reference_deleted_model = {} # ImageReferenceDeleted
- image_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- account_reference_model = {} # AccountReference
- account_reference_model['id'] = 'aa2432b1fa4d4ace891e9b80fc104e34'
- account_reference_model['resource_type'] = 'account'
+class TestModel_VPNServerClientCollection:
+ """
+ Test Class for VPNServerClientCollection
+ """
- image_remote_model = {} # ImageRemote
- image_remote_model['account'] = account_reference_model
- image_remote_model['region'] = region_reference_model
+ def test_vpn_server_client_collection_serialization(self):
+ """
+ Test serialization/deserialization for VPNServerClientCollection
+ """
- 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'
- image_reference_model['remote'] = image_remote_model
- image_reference_model['resource_type'] = 'image'
+ # Construct dict forms of any model objects needed in order to build this model.
- snapshot_source_snapshot_model = {} # SnapshotSourceSnapshot
- snapshot_source_snapshot_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263'
- snapshot_source_snapshot_model['deleted'] = snapshot_reference_deleted_model
- snapshot_source_snapshot_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263'
- snapshot_source_snapshot_model['id'] = 'r134-f6bfa329-0e36-433f-a3bb-0df632e79263'
- snapshot_source_snapshot_model['name'] = 'my-snapshot'
- snapshot_source_snapshot_model['remote'] = snapshot_remote_model
- snapshot_source_snapshot_model['resource_type'] = 'snapshot'
+ 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'
+ vpn_server_client_model = {} # VPNServerClient
+ vpn_server_client_model['client_ip'] = ip_model
+ vpn_server_client_model['common_name'] = 'testString'
+ vpn_server_client_model['created_at'] = '2019-01-01T12:00:00Z'
+ vpn_server_client_model['disconnected_at'] = '2019-01-01T12:00:00Z'
+ vpn_server_client_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/8e454ead-0db7-48ac-9a8b-2698d8c470a7/clients/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531'
+ vpn_server_client_model['id'] = 'r006-1a15dca5-7e33-45e1-b7c5-bc690e569531'
+ vpn_server_client_model['remote_ip'] = ip_model
+ vpn_server_client_model['remote_port'] = 22
+ vpn_server_client_model['resource_type'] = 'vpn_server_client'
+ vpn_server_client_model['status'] = 'connected'
+ vpn_server_client_model['username'] = 'testString'
- volume_remote_model = {} # VolumeRemote
- volume_remote_model['region'] = region_reference_model
+ vpn_server_client_collection_first_model = {} # VPNServerClientCollectionFirst
+ vpn_server_client_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-982d72b7-db1b-4606-afb2-ed6bd4b0bed1/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531/clients?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'
- volume_reference_model['remote'] = volume_remote_model
- volume_reference_model['resource_type'] = 'volume'
+ vpn_server_client_collection_next_model = {} # VPNServerClientCollectionNext
+ vpn_server_client_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-982d72b7-db1b-4606-afb2-ed6bd4b0bed1/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531/clients?start=a5e812a2-62c0-4555-86a5-907106760c56&limit=20'
- # Construct a json representation of a Snapshot model
- snapshot_model_json = {}
- snapshot_model_json['backup_policy_plan'] = backup_policy_plan_reference_model
- snapshot_model_json['bootable'] = True
- snapshot_model_json['captured_at'] = '2019-01-01T12:00:00Z'
- snapshot_model_json['clones'] = [snapshot_clone_model]
- snapshot_model_json['copies'] = [snapshot_copies_item_model]
- 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['service_tags'] = ['testString']
- snapshot_model_json['size'] = 1
- snapshot_model_json['source_image'] = image_reference_model
- snapshot_model_json['source_snapshot'] = snapshot_source_snapshot_model
- snapshot_model_json['source_volume'] = volume_reference_model
- snapshot_model_json['user_tags'] = ['testString']
+ # Construct a json representation of a VPNServerClientCollection model
+ vpn_server_client_collection_model_json = {}
+ vpn_server_client_collection_model_json['clients'] = [vpn_server_client_model]
+ vpn_server_client_collection_model_json['first'] = vpn_server_client_collection_first_model
+ vpn_server_client_collection_model_json['limit'] = 20
+ vpn_server_client_collection_model_json['next'] = vpn_server_client_collection_next_model
+ vpn_server_client_collection_model_json['total_count'] = 132
- # 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 VPNServerClientCollection by calling from_dict on the json representation
+ vpn_server_client_collection_model = VPNServerClientCollection.from_dict(vpn_server_client_collection_model_json)
+ assert vpn_server_client_collection_model != False
- # 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 VPNServerClientCollection by calling from_dict on the json representation
+ vpn_server_client_collection_model_dict = VPNServerClientCollection.from_dict(vpn_server_client_collection_model_json).__dict__
+ vpn_server_client_collection_model2 = VPNServerClientCollection(**vpn_server_client_collection_model_dict)
# Verify the model instances are equivalent
- assert snapshot_model == snapshot_model2
+ assert vpn_server_client_collection_model == vpn_server_client_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_server_client_collection_model_json2 = vpn_server_client_collection_model.to_dict()
+ assert vpn_server_client_collection_model_json2 == vpn_server_client_collection_model_json
-class TestModel_SnapshotClone:
+class TestModel_VPNServerClientCollectionFirst:
"""
- Test Class for SnapshotClone
+ Test Class for VPNServerClientCollectionFirst
"""
- def test_snapshot_clone_serialization(self):
+ def test_vpn_server_client_collection_first_serialization(self):
"""
- Test serialization/deserialization for SnapshotClone
+ Test serialization/deserialization for VPNServerClientCollectionFirst
"""
- # 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 SnapshotClone model
- snapshot_clone_model_json = {}
- snapshot_clone_model_json['available'] = True
- snapshot_clone_model_json['created_at'] = '2019-01-01T12:00:00Z'
- snapshot_clone_model_json['zone'] = zone_reference_model
+ # Construct a json representation of a VPNServerClientCollectionFirst model
+ vpn_server_client_collection_first_model_json = {}
+ vpn_server_client_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-982d72b7-db1b-4606-afb2-ed6bd4b0bed1/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531/clients?limit=20'
- # Construct a model instance of SnapshotClone by calling from_dict on the json representation
- snapshot_clone_model = SnapshotClone.from_dict(snapshot_clone_model_json)
- assert snapshot_clone_model != False
+ # Construct a model instance of VPNServerClientCollectionFirst by calling from_dict on the json representation
+ vpn_server_client_collection_first_model = VPNServerClientCollectionFirst.from_dict(vpn_server_client_collection_first_model_json)
+ assert vpn_server_client_collection_first_model != False
- # Construct a model instance of SnapshotClone by calling from_dict on the json representation
- snapshot_clone_model_dict = SnapshotClone.from_dict(snapshot_clone_model_json).__dict__
- snapshot_clone_model2 = SnapshotClone(**snapshot_clone_model_dict)
+ # Construct a model instance of VPNServerClientCollectionFirst by calling from_dict on the json representation
+ vpn_server_client_collection_first_model_dict = VPNServerClientCollectionFirst.from_dict(vpn_server_client_collection_first_model_json).__dict__
+ vpn_server_client_collection_first_model2 = VPNServerClientCollectionFirst(**vpn_server_client_collection_first_model_dict)
# Verify the model instances are equivalent
- assert snapshot_clone_model == snapshot_clone_model2
+ assert vpn_server_client_collection_first_model == vpn_server_client_collection_first_model2
# Convert model instance back to dict and verify no loss of data
- snapshot_clone_model_json2 = snapshot_clone_model.to_dict()
- assert snapshot_clone_model_json2 == snapshot_clone_model_json
+ vpn_server_client_collection_first_model_json2 = vpn_server_client_collection_first_model.to_dict()
+ assert vpn_server_client_collection_first_model_json2 == vpn_server_client_collection_first_model_json
-class TestModel_SnapshotCloneCollection:
+class TestModel_VPNServerClientCollectionNext:
"""
- Test Class for SnapshotCloneCollection
+ Test Class for VPNServerClientCollectionNext
"""
- def test_snapshot_clone_collection_serialization(self):
+ def test_vpn_server_client_collection_next_serialization(self):
"""
- Test serialization/deserialization for SnapshotCloneCollection
+ Test serialization/deserialization for VPNServerClientCollectionNext
"""
- # 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'
-
- snapshot_clone_model = {} # SnapshotClone
- snapshot_clone_model['available'] = True
- snapshot_clone_model['created_at'] = '2019-01-01T12:00:00Z'
- snapshot_clone_model['zone'] = zone_reference_model
-
- # Construct a json representation of a SnapshotCloneCollection model
- snapshot_clone_collection_model_json = {}
- snapshot_clone_collection_model_json['clones'] = [snapshot_clone_model]
+ # Construct a json representation of a VPNServerClientCollectionNext model
+ vpn_server_client_collection_next_model_json = {}
+ vpn_server_client_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-982d72b7-db1b-4606-afb2-ed6bd4b0bed1/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531/clients?start=a5e812a2-62c0-4555-86a5-907106760c56&limit=20'
- # Construct a model instance of SnapshotCloneCollection by calling from_dict on the json representation
- snapshot_clone_collection_model = SnapshotCloneCollection.from_dict(snapshot_clone_collection_model_json)
- assert snapshot_clone_collection_model != False
+ # Construct a model instance of VPNServerClientCollectionNext by calling from_dict on the json representation
+ vpn_server_client_collection_next_model = VPNServerClientCollectionNext.from_dict(vpn_server_client_collection_next_model_json)
+ assert vpn_server_client_collection_next_model != False
- # Construct a model instance of SnapshotCloneCollection by calling from_dict on the json representation
- snapshot_clone_collection_model_dict = SnapshotCloneCollection.from_dict(snapshot_clone_collection_model_json).__dict__
- snapshot_clone_collection_model2 = SnapshotCloneCollection(**snapshot_clone_collection_model_dict)
+ # Construct a model instance of VPNServerClientCollectionNext by calling from_dict on the json representation
+ vpn_server_client_collection_next_model_dict = VPNServerClientCollectionNext.from_dict(vpn_server_client_collection_next_model_json).__dict__
+ vpn_server_client_collection_next_model2 = VPNServerClientCollectionNext(**vpn_server_client_collection_next_model_dict)
# Verify the model instances are equivalent
- assert snapshot_clone_collection_model == snapshot_clone_collection_model2
+ assert vpn_server_client_collection_next_model == vpn_server_client_collection_next_model2
# Convert model instance back to dict and verify no loss of data
- snapshot_clone_collection_model_json2 = snapshot_clone_collection_model.to_dict()
- assert snapshot_clone_collection_model_json2 == snapshot_clone_collection_model_json
+ vpn_server_client_collection_next_model_json2 = vpn_server_client_collection_next_model.to_dict()
+ assert vpn_server_client_collection_next_model_json2 == vpn_server_client_collection_next_model_json
-class TestModel_SnapshotClonePrototype:
+class TestModel_VPNServerCollection:
"""
- Test Class for SnapshotClonePrototype
+ Test Class for VPNServerCollection
"""
- def test_snapshot_clone_prototype_serialization(self):
+ def test_vpn_server_collection_serialization(self):
"""
- Test serialization/deserialization for SnapshotClonePrototype
+ Test serialization/deserialization for VPNServerCollection
"""
# 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'
+ vpn_server_collection_first_model = {} # VPNServerCollectionFirst
+ vpn_server_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpn_servers?limit=20'
- # Construct a json representation of a SnapshotClonePrototype model
- snapshot_clone_prototype_model_json = {}
- snapshot_clone_prototype_model_json['zone'] = zone_identity_model
+ vpn_server_collection_next_model = {} # VPNServerCollectionNext
+ vpn_server_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpn_servers?start=ffd653466e284937896724b2dd044c9c&limit=20'
- # Construct a model instance of SnapshotClonePrototype by calling from_dict on the json representation
- snapshot_clone_prototype_model = SnapshotClonePrototype.from_dict(snapshot_clone_prototype_model_json)
- assert snapshot_clone_prototype_model != False
+ certificate_instance_reference_model = {} # CertificateInstanceReference
+ certificate_instance_reference_model['crn'] = 'crn:v1:bluemix:public:secrets-manager:us-south:a/123456:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5'
- # Construct a model instance of SnapshotClonePrototype by calling from_dict on the json representation
- snapshot_clone_prototype_model_dict = SnapshotClonePrototype.from_dict(snapshot_clone_prototype_model_json).__dict__
- snapshot_clone_prototype_model2 = SnapshotClonePrototype(**snapshot_clone_prototype_model_dict)
+ vpn_server_authentication_by_username_id_provider_model = {} # VPNServerAuthenticationByUsernameIdProviderByIAM
+ vpn_server_authentication_by_username_id_provider_model['provider_type'] = 'iam'
- # Verify the model instances are equivalent
- assert snapshot_clone_prototype_model == snapshot_clone_prototype_model2
+ vpn_server_authentication_model = {} # VPNServerAuthenticationByUsername
+ vpn_server_authentication_model['method'] = 'certificate'
+ vpn_server_authentication_model['identity_provider'] = vpn_server_authentication_by_username_id_provider_model
- # Convert model instance back to dict and verify no loss of data
- snapshot_clone_prototype_model_json2 = snapshot_clone_prototype_model.to_dict()
- assert snapshot_clone_prototype_model_json2 == snapshot_clone_prototype_model_json
+ ip_model = {} # IP
+ ip_model['address'] = '192.168.3.4'
+ vpn_server_health_reason_model = {} # VPNServerHealthReason
+ vpn_server_health_reason_model['code'] = 'cannot_access_server_certificate'
+ vpn_server_health_reason_model['message'] = 'Failed to get VPN server\'s server certificate from Secrets Manager.'
+ vpn_server_health_reason_model['more_info'] = 'https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-health'
-class TestModel_SnapshotCollection:
- """
- Test Class for SnapshotCollection
- """
+ vpn_server_lifecycle_reason_model = {} # VPNServerLifecycleReason
+ vpn_server_lifecycle_reason_model['code'] = 'resource_suspended_by_provider'
+ vpn_server_lifecycle_reason_model['message'] = 'The resource has been suspended. Contact IBM support with the CRN for next steps.'
+ vpn_server_lifecycle_reason_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#resource-suspension'
- def test_snapshot_collection_serialization(self):
- """
- Test serialization/deserialization for SnapshotCollection
- """
+ reserved_ip_reference_deleted_model = {} # ReservedIPReferenceDeleted
+ reserved_ip_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.
+ 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'
- snapshot_collection_first_model = {} # SnapshotCollectionFirst
- snapshot_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/snapshots?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'
- snapshot_collection_next_model = {} # SnapshotCollectionNext
- snapshot_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/snapshots?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
+ security_group_reference_deleted_model = {} # SecurityGroupReferenceDeleted
+ security_group_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- backup_policy_plan_reference_deleted_model = {} # BackupPolicyPlanReferenceDeleted
- backup_policy_plan_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'
- 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'
+ subnet_reference_deleted_model = {} # SubnetReferenceDeleted
+ subnet_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- backup_policy_plan_remote_model = {} # BackupPolicyPlanRemote
- backup_policy_plan_remote_model['region'] = region_reference_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'
+ subnet_reference_model['resource_type'] = 'subnet'
- backup_policy_plan_reference_model = {} # BackupPolicyPlanReference
- backup_policy_plan_reference_model['deleted'] = backup_policy_plan_reference_deleted_model
- backup_policy_plan_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178'
- backup_policy_plan_reference_model['id'] = 'r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178'
- backup_policy_plan_reference_model['name'] = 'my-policy-plan'
- backup_policy_plan_reference_model['remote'] = backup_policy_plan_remote_model
- backup_policy_plan_reference_model['resource_type'] = 'backup_policy_plan'
+ vpc_reference_deleted_model = {} # VPCReferenceDeleted
+ vpc_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'
+ vpc_reference_model = {} # VPCReference
+ vpc_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b'
+ vpc_reference_model['deleted'] = vpc_reference_deleted_model
+ vpc_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b'
+ vpc_reference_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b'
+ vpc_reference_model['name'] = 'my-vpc'
+ vpc_reference_model['resource_type'] = 'vpc'
- snapshot_clone_model = {} # SnapshotClone
- snapshot_clone_model['available'] = True
- snapshot_clone_model['created_at'] = '2019-01-01T12:00:00Z'
- snapshot_clone_model['zone'] = zone_reference_model
+ vpn_server_model = {} # VPNServer
+ vpn_server_model['certificate'] = certificate_instance_reference_model
+ vpn_server_model['client_authentication'] = [vpn_server_authentication_model]
+ vpn_server_model['client_auto_delete'] = True
+ vpn_server_model['client_auto_delete_timeout'] = 1
+ vpn_server_model['client_dns_server_ips'] = [ip_model]
+ vpn_server_model['client_idle_timeout'] = 600
+ vpn_server_model['client_ip_pool'] = '172.16.0.0/16'
+ vpn_server_model['created_at'] = '2019-01-01T12:00:00Z'
+ vpn_server_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpn-server:r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5'
+ vpn_server_model['enable_split_tunneling'] = True
+ vpn_server_model['health_reasons'] = [vpn_server_health_reason_model]
+ vpn_server_model['health_state'] = 'ok'
+ vpn_server_model['hostname'] = 'a8506291.us-south.vpn-server.appdomain.cloud'
+ vpn_server_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5'
+ vpn_server_model['id'] = 'r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5'
+ vpn_server_model['lifecycle_reasons'] = [vpn_server_lifecycle_reason_model]
+ vpn_server_model['lifecycle_state'] = 'stable'
+ vpn_server_model['name'] = 'my-vpn-server'
+ vpn_server_model['port'] = 443
+ vpn_server_model['private_ips'] = [reserved_ip_reference_model]
+ vpn_server_model['protocol'] = 'udp'
+ vpn_server_model['resource_group'] = resource_group_reference_model
+ vpn_server_model['resource_type'] = 'vpn_server'
+ vpn_server_model['security_groups'] = [security_group_reference_model]
+ vpn_server_model['subnets'] = [subnet_reference_model]
+ vpn_server_model['vpc'] = vpc_reference_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 VPNServerCollection model
+ vpn_server_collection_model_json = {}
+ vpn_server_collection_model_json['first'] = vpn_server_collection_first_model
+ vpn_server_collection_model_json['limit'] = 20
+ vpn_server_collection_model_json['next'] = vpn_server_collection_next_model
+ vpn_server_collection_model_json['total_count'] = 132
+ vpn_server_collection_model_json['vpn_servers'] = [vpn_server_model]
- snapshot_remote_model = {} # SnapshotRemote
- snapshot_remote_model['region'] = region_reference_model
+ # Construct a model instance of VPNServerCollection by calling from_dict on the json representation
+ vpn_server_collection_model = VPNServerCollection.from_dict(vpn_server_collection_model_json)
+ assert vpn_server_collection_model != False
- snapshot_copies_item_model = {} # SnapshotCopiesItem
- snapshot_copies_item_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263'
- snapshot_copies_item_model['deleted'] = snapshot_reference_deleted_model
- snapshot_copies_item_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263'
- snapshot_copies_item_model['id'] = 'r134-f6bfa329-0e36-433f-a3bb-0df632e79263'
- snapshot_copies_item_model['name'] = 'my-snapshot'
- snapshot_copies_item_model['remote'] = snapshot_remote_model
- snapshot_copies_item_model['resource_type'] = 'snapshot'
+ # Construct a model instance of VPNServerCollection by calling from_dict on the json representation
+ vpn_server_collection_model_dict = VPNServerCollection.from_dict(vpn_server_collection_model_json).__dict__
+ vpn_server_collection_model2 = VPNServerCollection(**vpn_server_collection_model_dict)
- encryption_key_reference_model = {} # EncryptionKeyReference
- encryption_key_reference_model['crn'] = 'crn:v1:bluemix:public:kms:us-south:a/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179'
+ # Verify the model instances are equivalent
+ assert vpn_server_collection_model == vpn_server_collection_model2
- 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'
+ # Convert model instance back to dict and verify no loss of data
+ vpn_server_collection_model_json2 = vpn_server_collection_model.to_dict()
+ assert vpn_server_collection_model_json2 == vpn_server_collection_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'
- image_reference_deleted_model = {} # ImageReferenceDeleted
- image_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+class TestModel_VPNServerCollectionFirst:
+ """
+ Test Class for VPNServerCollectionFirst
+ """
- account_reference_model = {} # AccountReference
- account_reference_model['id'] = 'aa2432b1fa4d4ace891e9b80fc104e34'
- account_reference_model['resource_type'] = 'account'
+ def test_vpn_server_collection_first_serialization(self):
+ """
+ Test serialization/deserialization for VPNServerCollectionFirst
+ """
- image_remote_model = {} # ImageRemote
- image_remote_model['account'] = account_reference_model
- image_remote_model['region'] = region_reference_model
+ # Construct a json representation of a VPNServerCollectionFirst model
+ vpn_server_collection_first_model_json = {}
+ vpn_server_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpn_servers?limit=20'
- 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'
- image_reference_model['remote'] = image_remote_model
- image_reference_model['resource_type'] = 'image'
+ # Construct a model instance of VPNServerCollectionFirst by calling from_dict on the json representation
+ vpn_server_collection_first_model = VPNServerCollectionFirst.from_dict(vpn_server_collection_first_model_json)
+ assert vpn_server_collection_first_model != False
- snapshot_source_snapshot_model = {} # SnapshotSourceSnapshot
- snapshot_source_snapshot_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263'
- snapshot_source_snapshot_model['deleted'] = snapshot_reference_deleted_model
- snapshot_source_snapshot_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263'
- snapshot_source_snapshot_model['id'] = 'r134-f6bfa329-0e36-433f-a3bb-0df632e79263'
- snapshot_source_snapshot_model['name'] = 'my-snapshot'
- snapshot_source_snapshot_model['remote'] = snapshot_remote_model
- snapshot_source_snapshot_model['resource_type'] = 'snapshot'
+ # Construct a model instance of VPNServerCollectionFirst by calling from_dict on the json representation
+ vpn_server_collection_first_model_dict = VPNServerCollectionFirst.from_dict(vpn_server_collection_first_model_json).__dict__
+ vpn_server_collection_first_model2 = VPNServerCollectionFirst(**vpn_server_collection_first_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 vpn_server_collection_first_model == vpn_server_collection_first_model2
- volume_remote_model = {} # VolumeRemote
- volume_remote_model['region'] = region_reference_model
+ # Convert model instance back to dict and verify no loss of data
+ vpn_server_collection_first_model_json2 = vpn_server_collection_first_model.to_dict()
+ assert vpn_server_collection_first_model_json2 == vpn_server_collection_first_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'
- volume_reference_model['remote'] = volume_remote_model
- volume_reference_model['resource_type'] = 'volume'
- snapshot_model = {} # Snapshot
- snapshot_model['backup_policy_plan'] = backup_policy_plan_reference_model
- snapshot_model['bootable'] = True
- snapshot_model['captured_at'] = '2019-01-01T12:00:00Z'
- snapshot_model['clones'] = [snapshot_clone_model]
- snapshot_model['copies'] = [snapshot_copies_item_model]
- 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['service_tags'] = ['testString']
- snapshot_model['size'] = 1
- snapshot_model['source_image'] = image_reference_model
- snapshot_model['source_snapshot'] = snapshot_source_snapshot_model
- snapshot_model['source_volume'] = volume_reference_model
- snapshot_model['user_tags'] = ['testString']
+class TestModel_VPNServerCollectionNext:
+ """
+ Test Class for VPNServerCollectionNext
+ """
- # 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
+ def test_vpn_server_collection_next_serialization(self):
+ """
+ Test serialization/deserialization for VPNServerCollectionNext
+ """
- # 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 json representation of a VPNServerCollectionNext model
+ vpn_server_collection_next_model_json = {}
+ vpn_server_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpn_servers?start=ffd653466e284937896724b2dd044c9c&limit=20'
- # 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 VPNServerCollectionNext by calling from_dict on the json representation
+ vpn_server_collection_next_model = VPNServerCollectionNext.from_dict(vpn_server_collection_next_model_json)
+ assert vpn_server_collection_next_model != False
+
+ # Construct a model instance of VPNServerCollectionNext by calling from_dict on the json representation
+ vpn_server_collection_next_model_dict = VPNServerCollectionNext.from_dict(vpn_server_collection_next_model_json).__dict__
+ vpn_server_collection_next_model2 = VPNServerCollectionNext(**vpn_server_collection_next_model_dict)
# Verify the model instances are equivalent
- assert snapshot_collection_model == snapshot_collection_model2
+ assert vpn_server_collection_next_model == vpn_server_collection_next_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_server_collection_next_model_json2 = vpn_server_collection_next_model.to_dict()
+ assert vpn_server_collection_next_model_json2 == vpn_server_collection_next_model_json
-class TestModel_SnapshotCollectionFirst:
+class TestModel_VPNServerHealthReason:
"""
- Test Class for SnapshotCollectionFirst
+ Test Class for VPNServerHealthReason
"""
- def test_snapshot_collection_first_serialization(self):
+ def test_vpn_server_health_reason_serialization(self):
"""
- Test serialization/deserialization for SnapshotCollectionFirst
+ Test serialization/deserialization for VPNServerHealthReason
"""
- # 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 VPNServerHealthReason model
+ vpn_server_health_reason_model_json = {}
+ vpn_server_health_reason_model_json['code'] = 'cannot_access_server_certificate'
+ vpn_server_health_reason_model_json['message'] = 'Failed to get VPN server\'s server certificate from Secrets Manager.'
+ vpn_server_health_reason_model_json['more_info'] = 'https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-health'
- # 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 VPNServerHealthReason by calling from_dict on the json representation
+ vpn_server_health_reason_model = VPNServerHealthReason.from_dict(vpn_server_health_reason_model_json)
+ assert vpn_server_health_reason_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 VPNServerHealthReason by calling from_dict on the json representation
+ vpn_server_health_reason_model_dict = VPNServerHealthReason.from_dict(vpn_server_health_reason_model_json).__dict__
+ vpn_server_health_reason_model2 = VPNServerHealthReason(**vpn_server_health_reason_model_dict)
# Verify the model instances are equivalent
- assert snapshot_collection_first_model == snapshot_collection_first_model2
+ assert vpn_server_health_reason_model == vpn_server_health_reason_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_server_health_reason_model_json2 = vpn_server_health_reason_model.to_dict()
+ assert vpn_server_health_reason_model_json2 == vpn_server_health_reason_model_json
-class TestModel_SnapshotCollectionNext:
+class TestModel_VPNServerLifecycleReason:
"""
- Test Class for SnapshotCollectionNext
+ Test Class for VPNServerLifecycleReason
"""
- def test_snapshot_collection_next_serialization(self):
+ def test_vpn_server_lifecycle_reason_serialization(self):
"""
- Test serialization/deserialization for SnapshotCollectionNext
+ Test serialization/deserialization for VPNServerLifecycleReason
"""
- # 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 VPNServerLifecycleReason model
+ vpn_server_lifecycle_reason_model_json = {}
+ vpn_server_lifecycle_reason_model_json['code'] = 'resource_suspended_by_provider'
+ vpn_server_lifecycle_reason_model_json['message'] = 'The resource has been suspended. Contact IBM support with the CRN for next steps.'
+ vpn_server_lifecycle_reason_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#resource-suspension'
- # 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 VPNServerLifecycleReason by calling from_dict on the json representation
+ vpn_server_lifecycle_reason_model = VPNServerLifecycleReason.from_dict(vpn_server_lifecycle_reason_model_json)
+ assert vpn_server_lifecycle_reason_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 VPNServerLifecycleReason by calling from_dict on the json representation
+ vpn_server_lifecycle_reason_model_dict = VPNServerLifecycleReason.from_dict(vpn_server_lifecycle_reason_model_json).__dict__
+ vpn_server_lifecycle_reason_model2 = VPNServerLifecycleReason(**vpn_server_lifecycle_reason_model_dict)
# Verify the model instances are equivalent
- assert snapshot_collection_next_model == snapshot_collection_next_model2
+ assert vpn_server_lifecycle_reason_model == vpn_server_lifecycle_reason_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_server_lifecycle_reason_model_json2 = vpn_server_lifecycle_reason_model.to_dict()
+ assert vpn_server_lifecycle_reason_model_json2 == vpn_server_lifecycle_reason_model_json
-class TestModel_SnapshotCopiesItem:
+class TestModel_VPNServerPatch:
"""
- Test Class for SnapshotCopiesItem
+ Test Class for VPNServerPatch
"""
- def test_snapshot_copies_item_serialization(self):
+ def test_vpn_server_patch_serialization(self):
"""
- Test serialization/deserialization for SnapshotCopiesItem
+ Test serialization/deserialization for VPNServerPatch
"""
# 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'
+ certificate_instance_identity_model = {} # CertificateInstanceIdentityByCRN
+ certificate_instance_identity_model['crn'] = 'crn:v1:bluemix:public:secrets-manager:us-south:a/123456:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5'
- 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'
+ vpn_server_authentication_by_username_id_provider_model = {} # VPNServerAuthenticationByUsernameIdProviderByIAM
+ vpn_server_authentication_by_username_id_provider_model['provider_type'] = 'iam'
- snapshot_remote_model = {} # SnapshotRemote
- snapshot_remote_model['region'] = region_reference_model
+ vpn_server_authentication_prototype_model = {} # VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype
+ vpn_server_authentication_prototype_model['method'] = 'username'
+ vpn_server_authentication_prototype_model['identity_provider'] = vpn_server_authentication_by_username_id_provider_model
- # Construct a json representation of a SnapshotCopiesItem model
- snapshot_copies_item_model_json = {}
- snapshot_copies_item_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263'
- snapshot_copies_item_model_json['deleted'] = snapshot_reference_deleted_model
- snapshot_copies_item_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263'
- snapshot_copies_item_model_json['id'] = 'r134-f6bfa329-0e36-433f-a3bb-0df632e79263'
- snapshot_copies_item_model_json['name'] = 'my-snapshot'
- snapshot_copies_item_model_json['remote'] = snapshot_remote_model
- snapshot_copies_item_model_json['resource_type'] = 'snapshot'
+ ip_model = {} # IP
+ ip_model['address'] = '192.168.3.4'
- # Construct a model instance of SnapshotCopiesItem by calling from_dict on the json representation
- snapshot_copies_item_model = SnapshotCopiesItem.from_dict(snapshot_copies_item_model_json)
- assert snapshot_copies_item_model != False
+ subnet_identity_model = {} # SubnetIdentityById
+ subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
- # Construct a model instance of SnapshotCopiesItem by calling from_dict on the json representation
- snapshot_copies_item_model_dict = SnapshotCopiesItem.from_dict(snapshot_copies_item_model_json).__dict__
- snapshot_copies_item_model2 = SnapshotCopiesItem(**snapshot_copies_item_model_dict)
+ # Construct a json representation of a VPNServerPatch model
+ vpn_server_patch_model_json = {}
+ vpn_server_patch_model_json['certificate'] = certificate_instance_identity_model
+ vpn_server_patch_model_json['client_authentication'] = [vpn_server_authentication_prototype_model]
+ vpn_server_patch_model_json['client_dns_server_ips'] = [ip_model]
+ vpn_server_patch_model_json['client_idle_timeout'] = 600
+ vpn_server_patch_model_json['client_ip_pool'] = '172.16.0.0/16'
+ vpn_server_patch_model_json['enable_split_tunneling'] = True
+ vpn_server_patch_model_json['name'] = 'my-vpn-server'
+ vpn_server_patch_model_json['port'] = 443
+ vpn_server_patch_model_json['protocol'] = 'udp'
+ vpn_server_patch_model_json['subnets'] = [subnet_identity_model]
+
+ # Construct a model instance of VPNServerPatch by calling from_dict on the json representation
+ vpn_server_patch_model = VPNServerPatch.from_dict(vpn_server_patch_model_json)
+ assert vpn_server_patch_model != False
+
+ # Construct a model instance of VPNServerPatch by calling from_dict on the json representation
+ vpn_server_patch_model_dict = VPNServerPatch.from_dict(vpn_server_patch_model_json).__dict__
+ vpn_server_patch_model2 = VPNServerPatch(**vpn_server_patch_model_dict)
# Verify the model instances are equivalent
- assert snapshot_copies_item_model == snapshot_copies_item_model2
+ assert vpn_server_patch_model == vpn_server_patch_model2
# Convert model instance back to dict and verify no loss of data
- snapshot_copies_item_model_json2 = snapshot_copies_item_model.to_dict()
- assert snapshot_copies_item_model_json2 == snapshot_copies_item_model_json
+ vpn_server_patch_model_json2 = vpn_server_patch_model.to_dict()
+ assert vpn_server_patch_model_json2 == vpn_server_patch_model_json
-class TestModel_SnapshotPatch:
+class TestModel_VPNServerReferenceDeleted:
"""
- Test Class for SnapshotPatch
+ Test Class for VPNServerReferenceDeleted
"""
- def test_snapshot_patch_serialization(self):
+ def test_vpn_server_reference_deleted_serialization(self):
"""
- Test serialization/deserialization for SnapshotPatch
+ Test serialization/deserialization for VPNServerReferenceDeleted
"""
- # Construct a json representation of a SnapshotPatch model
- snapshot_patch_model_json = {}
- snapshot_patch_model_json['name'] = 'my-snapshot'
- snapshot_patch_model_json['user_tags'] = ['testString']
+ # Construct a json representation of a VPNServerReferenceDeleted model
+ vpn_server_reference_deleted_model_json = {}
+ vpn_server_reference_deleted_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # 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 VPNServerReferenceDeleted by calling from_dict on the json representation
+ vpn_server_reference_deleted_model = VPNServerReferenceDeleted.from_dict(vpn_server_reference_deleted_model_json)
+ assert vpn_server_reference_deleted_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 VPNServerReferenceDeleted by calling from_dict on the json representation
+ vpn_server_reference_deleted_model_dict = VPNServerReferenceDeleted.from_dict(vpn_server_reference_deleted_model_json).__dict__
+ vpn_server_reference_deleted_model2 = VPNServerReferenceDeleted(**vpn_server_reference_deleted_model_dict)
# Verify the model instances are equivalent
- assert snapshot_patch_model == snapshot_patch_model2
+ assert vpn_server_reference_deleted_model == vpn_server_reference_deleted_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_server_reference_deleted_model_json2 = vpn_server_reference_deleted_model.to_dict()
+ assert vpn_server_reference_deleted_model_json2 == vpn_server_reference_deleted_model_json
-class TestModel_SnapshotReference:
+class TestModel_VPNServerRoute:
"""
- Test Class for SnapshotReference
+ Test Class for VPNServerRoute
"""
- def test_snapshot_reference_serialization(self):
+ def test_vpn_server_route_serialization(self):
"""
- Test serialization/deserialization for SnapshotReference
+ Test serialization/deserialization for VPNServerRoute
"""
# 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_server_route_health_reason_model = {} # VPNServerRouteHealthReason
+ vpn_server_route_health_reason_model['code'] = 'internal_error'
+ vpn_server_route_health_reason_model['message'] = 'Internal error (contact IBM support).'
+ vpn_server_route_health_reason_model['more_info'] = 'https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-route-health'
- 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'
+ vpn_server_route_lifecycle_reason_model = {} # VPNServerRouteLifecycleReason
+ vpn_server_route_lifecycle_reason_model['code'] = 'resource_suspended_by_provider'
+ vpn_server_route_lifecycle_reason_model['message'] = 'The resource has been suspended. Contact IBM support with the CRN for next steps.'
+ vpn_server_route_lifecycle_reason_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#resource-suspension'
- snapshot_remote_model = {} # SnapshotRemote
- snapshot_remote_model['region'] = region_reference_model
+ # Construct a json representation of a VPNServerRoute model
+ vpn_server_route_model_json = {}
+ vpn_server_route_model_json['action'] = 'deliver'
+ vpn_server_route_model_json['created_at'] = '2019-01-01T12:00:00Z'
+ vpn_server_route_model_json['destination'] = '192.168.3.0/24'
+ vpn_server_route_model_json['health_reasons'] = [vpn_server_route_health_reason_model]
+ vpn_server_route_model_json['health_state'] = 'ok'
+ vpn_server_route_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531'
+ vpn_server_route_model_json['id'] = 'r006-1a15dca5-7e33-45e1-b7c5-bc690e569531'
+ vpn_server_route_model_json['lifecycle_reasons'] = [vpn_server_route_lifecycle_reason_model]
+ vpn_server_route_model_json['lifecycle_state'] = 'stable'
+ vpn_server_route_model_json['name'] = 'my-vpn-route-1'
+ vpn_server_route_model_json['resource_type'] = 'vpn_server_route'
- # 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['remote'] = snapshot_remote_model
- snapshot_reference_model_json['resource_type'] = 'snapshot'
+ # Construct a model instance of VPNServerRoute by calling from_dict on the json representation
+ vpn_server_route_model = VPNServerRoute.from_dict(vpn_server_route_model_json)
+ assert vpn_server_route_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 VPNServerRoute by calling from_dict on the json representation
+ vpn_server_route_model_dict = VPNServerRoute.from_dict(vpn_server_route_model_json).__dict__
+ vpn_server_route_model2 = VPNServerRoute(**vpn_server_route_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 vpn_server_route_model == vpn_server_route_model2
+
+ # Convert model instance back to dict and verify no loss of data
+ vpn_server_route_model_json2 = vpn_server_route_model.to_dict()
+ assert vpn_server_route_model_json2 == vpn_server_route_model_json
+
+
+class TestModel_VPNServerRouteCollection:
+ """
+ Test Class for VPNServerRouteCollection
+ """
+
+ def test_vpn_server_route_collection_serialization(self):
+ """
+ Test serialization/deserialization for VPNServerRouteCollection
+ """
+
+ # Construct dict forms of any model objects needed in order to build this model.
+
+ vpn_server_route_collection_first_model = {} # VPNServerRouteCollectionFirst
+ vpn_server_route_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routes?limit=20'
+
+ vpn_server_route_collection_next_model = {} # VPNServerRouteCollectionNext
+ vpn_server_route_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routes?start=a5e812a2-62c0-4555-86a5-907106760c56&limit=20'
+
+ vpn_server_route_health_reason_model = {} # VPNServerRouteHealthReason
+ vpn_server_route_health_reason_model['code'] = 'internal_error'
+ vpn_server_route_health_reason_model['message'] = 'Internal error (contact IBM support).'
+ vpn_server_route_health_reason_model['more_info'] = 'https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-route-health'
+
+ vpn_server_route_lifecycle_reason_model = {} # VPNServerRouteLifecycleReason
+ vpn_server_route_lifecycle_reason_model['code'] = 'resource_suspended_by_provider'
+ vpn_server_route_lifecycle_reason_model['message'] = 'The resource has been suspended. Contact IBM support with the CRN for next steps.'
+ vpn_server_route_lifecycle_reason_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#resource-suspension'
+
+ vpn_server_route_model = {} # VPNServerRoute
+ vpn_server_route_model['action'] = 'deliver'
+ vpn_server_route_model['created_at'] = '2019-01-01T12:00:00Z'
+ vpn_server_route_model['destination'] = '192.168.3.0/24'
+ vpn_server_route_model['health_reasons'] = [vpn_server_route_health_reason_model]
+ vpn_server_route_model['health_state'] = 'ok'
+ vpn_server_route_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531'
+ vpn_server_route_model['id'] = 'r006-1a15dca5-7e33-45e1-b7c5-bc690e569531'
+ vpn_server_route_model['lifecycle_reasons'] = [vpn_server_route_lifecycle_reason_model]
+ vpn_server_route_model['lifecycle_state'] = 'stable'
+ vpn_server_route_model['name'] = 'my-vpn-route-1'
+ vpn_server_route_model['resource_type'] = 'vpn_server_route'
+
+ # Construct a json representation of a VPNServerRouteCollection model
+ vpn_server_route_collection_model_json = {}
+ vpn_server_route_collection_model_json['first'] = vpn_server_route_collection_first_model
+ vpn_server_route_collection_model_json['limit'] = 20
+ vpn_server_route_collection_model_json['next'] = vpn_server_route_collection_next_model
+ vpn_server_route_collection_model_json['routes'] = [vpn_server_route_model]
+ vpn_server_route_collection_model_json['total_count'] = 132
+
+ # Construct a model instance of VPNServerRouteCollection by calling from_dict on the json representation
+ vpn_server_route_collection_model = VPNServerRouteCollection.from_dict(vpn_server_route_collection_model_json)
+ assert vpn_server_route_collection_model != False
+
+ # Construct a model instance of VPNServerRouteCollection by calling from_dict on the json representation
+ vpn_server_route_collection_model_dict = VPNServerRouteCollection.from_dict(vpn_server_route_collection_model_json).__dict__
+ vpn_server_route_collection_model2 = VPNServerRouteCollection(**vpn_server_route_collection_model_dict)
# Verify the model instances are equivalent
- assert snapshot_reference_model == snapshot_reference_model2
+ assert vpn_server_route_collection_model == vpn_server_route_collection_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_server_route_collection_model_json2 = vpn_server_route_collection_model.to_dict()
+ assert vpn_server_route_collection_model_json2 == vpn_server_route_collection_model_json
-class TestModel_SnapshotReferenceDeleted:
+class TestModel_VPNServerRouteCollectionFirst:
"""
- Test Class for SnapshotReferenceDeleted
+ Test Class for VPNServerRouteCollectionFirst
"""
- def test_snapshot_reference_deleted_serialization(self):
+ def test_vpn_server_route_collection_first_serialization(self):
"""
- Test serialization/deserialization for SnapshotReferenceDeleted
+ Test serialization/deserialization for VPNServerRouteCollectionFirst
"""
- # 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 VPNServerRouteCollectionFirst model
+ vpn_server_route_collection_first_model_json = {}
+ vpn_server_route_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routes?limit=20'
- # 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 VPNServerRouteCollectionFirst by calling from_dict on the json representation
+ vpn_server_route_collection_first_model = VPNServerRouteCollectionFirst.from_dict(vpn_server_route_collection_first_model_json)
+ assert vpn_server_route_collection_first_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 VPNServerRouteCollectionFirst by calling from_dict on the json representation
+ vpn_server_route_collection_first_model_dict = VPNServerRouteCollectionFirst.from_dict(vpn_server_route_collection_first_model_json).__dict__
+ vpn_server_route_collection_first_model2 = VPNServerRouteCollectionFirst(**vpn_server_route_collection_first_model_dict)
# Verify the model instances are equivalent
- assert snapshot_reference_deleted_model == snapshot_reference_deleted_model2
+ assert vpn_server_route_collection_first_model == vpn_server_route_collection_first_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_server_route_collection_first_model_json2 = vpn_server_route_collection_first_model.to_dict()
+ assert vpn_server_route_collection_first_model_json2 == vpn_server_route_collection_first_model_json
-class TestModel_SnapshotRemote:
+class TestModel_VPNServerRouteCollectionNext:
"""
- Test Class for SnapshotRemote
+ Test Class for VPNServerRouteCollectionNext
"""
- def test_snapshot_remote_serialization(self):
+ def test_vpn_server_route_collection_next_serialization(self):
"""
- Test serialization/deserialization for SnapshotRemote
+ Test serialization/deserialization for VPNServerRouteCollectionNext
"""
- # Construct dict forms of any model objects needed in order to build this model.
+ # Construct a json representation of a VPNServerRouteCollectionNext model
+ vpn_server_route_collection_next_model_json = {}
+ vpn_server_route_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routes?start=a5e812a2-62c0-4555-86a5-907106760c56&limit=20'
- 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 model instance of VPNServerRouteCollectionNext by calling from_dict on the json representation
+ vpn_server_route_collection_next_model = VPNServerRouteCollectionNext.from_dict(vpn_server_route_collection_next_model_json)
+ assert vpn_server_route_collection_next_model != False
- # Construct a json representation of a SnapshotRemote model
- snapshot_remote_model_json = {}
- snapshot_remote_model_json['region'] = region_reference_model
+ # Construct a model instance of VPNServerRouteCollectionNext by calling from_dict on the json representation
+ vpn_server_route_collection_next_model_dict = VPNServerRouteCollectionNext.from_dict(vpn_server_route_collection_next_model_json).__dict__
+ vpn_server_route_collection_next_model2 = VPNServerRouteCollectionNext(**vpn_server_route_collection_next_model_dict)
- # Construct a model instance of SnapshotRemote by calling from_dict on the json representation
- snapshot_remote_model = SnapshotRemote.from_dict(snapshot_remote_model_json)
- assert snapshot_remote_model != False
+ # Verify the model instances are equivalent
+ assert vpn_server_route_collection_next_model == vpn_server_route_collection_next_model2
- # Construct a model instance of SnapshotRemote by calling from_dict on the json representation
- snapshot_remote_model_dict = SnapshotRemote.from_dict(snapshot_remote_model_json).__dict__
- snapshot_remote_model2 = SnapshotRemote(**snapshot_remote_model_dict)
+ # Convert model instance back to dict and verify no loss of data
+ vpn_server_route_collection_next_model_json2 = vpn_server_route_collection_next_model.to_dict()
+ assert vpn_server_route_collection_next_model_json2 == vpn_server_route_collection_next_model_json
+
+
+class TestModel_VPNServerRouteHealthReason:
+ """
+ Test Class for VPNServerRouteHealthReason
+ """
+
+ def test_vpn_server_route_health_reason_serialization(self):
+ """
+ Test serialization/deserialization for VPNServerRouteHealthReason
+ """
+
+ # Construct a json representation of a VPNServerRouteHealthReason model
+ vpn_server_route_health_reason_model_json = {}
+ vpn_server_route_health_reason_model_json['code'] = 'internal_error'
+ vpn_server_route_health_reason_model_json['message'] = 'Internal error (contact IBM support).'
+ vpn_server_route_health_reason_model_json['more_info'] = 'https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-route-health'
+
+ # Construct a model instance of VPNServerRouteHealthReason by calling from_dict on the json representation
+ vpn_server_route_health_reason_model = VPNServerRouteHealthReason.from_dict(vpn_server_route_health_reason_model_json)
+ assert vpn_server_route_health_reason_model != False
+
+ # Construct a model instance of VPNServerRouteHealthReason by calling from_dict on the json representation
+ vpn_server_route_health_reason_model_dict = VPNServerRouteHealthReason.from_dict(vpn_server_route_health_reason_model_json).__dict__
+ vpn_server_route_health_reason_model2 = VPNServerRouteHealthReason(**vpn_server_route_health_reason_model_dict)
# Verify the model instances are equivalent
- assert snapshot_remote_model == snapshot_remote_model2
+ assert vpn_server_route_health_reason_model == vpn_server_route_health_reason_model2
# Convert model instance back to dict and verify no loss of data
- snapshot_remote_model_json2 = snapshot_remote_model.to_dict()
- assert snapshot_remote_model_json2 == snapshot_remote_model_json
+ vpn_server_route_health_reason_model_json2 = vpn_server_route_health_reason_model.to_dict()
+ assert vpn_server_route_health_reason_model_json2 == vpn_server_route_health_reason_model_json
-class TestModel_SnapshotSourceSnapshot:
+class TestModel_VPNServerRouteLifecycleReason:
"""
- Test Class for SnapshotSourceSnapshot
+ Test Class for VPNServerRouteLifecycleReason
"""
- def test_snapshot_source_snapshot_serialization(self):
+ def test_vpn_server_route_lifecycle_reason_serialization(self):
"""
- Test serialization/deserialization for SnapshotSourceSnapshot
+ Test serialization/deserialization for VPNServerRouteLifecycleReason
"""
- # Construct dict forms of any model objects needed in order to build this model.
+ # Construct a json representation of a VPNServerRouteLifecycleReason model
+ vpn_server_route_lifecycle_reason_model_json = {}
+ vpn_server_route_lifecycle_reason_model_json['code'] = 'resource_suspended_by_provider'
+ vpn_server_route_lifecycle_reason_model_json['message'] = 'The resource has been suspended. Contact IBM support with the CRN for next steps.'
+ vpn_server_route_lifecycle_reason_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#resource-suspension'
- snapshot_reference_deleted_model = {} # SnapshotReferenceDeleted
- snapshot_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ # Construct a model instance of VPNServerRouteLifecycleReason by calling from_dict on the json representation
+ vpn_server_route_lifecycle_reason_model = VPNServerRouteLifecycleReason.from_dict(vpn_server_route_lifecycle_reason_model_json)
+ assert vpn_server_route_lifecycle_reason_model != False
- 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 model instance of VPNServerRouteLifecycleReason by calling from_dict on the json representation
+ vpn_server_route_lifecycle_reason_model_dict = VPNServerRouteLifecycleReason.from_dict(vpn_server_route_lifecycle_reason_model_json).__dict__
+ vpn_server_route_lifecycle_reason_model2 = VPNServerRouteLifecycleReason(**vpn_server_route_lifecycle_reason_model_dict)
- snapshot_remote_model = {} # SnapshotRemote
- snapshot_remote_model['region'] = region_reference_model
+ # Verify the model instances are equivalent
+ assert vpn_server_route_lifecycle_reason_model == vpn_server_route_lifecycle_reason_model2
+
+ # Convert model instance back to dict and verify no loss of data
+ vpn_server_route_lifecycle_reason_model_json2 = vpn_server_route_lifecycle_reason_model.to_dict()
+ assert vpn_server_route_lifecycle_reason_model_json2 == vpn_server_route_lifecycle_reason_model_json
+
+
+class TestModel_VPNServerRoutePatch:
+ """
+ Test Class for VPNServerRoutePatch
+ """
+
+ def test_vpn_server_route_patch_serialization(self):
+ """
+ Test serialization/deserialization for VPNServerRoutePatch
+ """
- # Construct a json representation of a SnapshotSourceSnapshot model
- snapshot_source_snapshot_model_json = {}
- snapshot_source_snapshot_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263'
- snapshot_source_snapshot_model_json['deleted'] = snapshot_reference_deleted_model
- snapshot_source_snapshot_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263'
- snapshot_source_snapshot_model_json['id'] = 'r134-f6bfa329-0e36-433f-a3bb-0df632e79263'
- snapshot_source_snapshot_model_json['name'] = 'my-snapshot'
- snapshot_source_snapshot_model_json['remote'] = snapshot_remote_model
- snapshot_source_snapshot_model_json['resource_type'] = 'snapshot'
+ # Construct a json representation of a VPNServerRoutePatch model
+ vpn_server_route_patch_model_json = {}
+ vpn_server_route_patch_model_json['name'] = 'my-vpn-route-2'
- # Construct a model instance of SnapshotSourceSnapshot by calling from_dict on the json representation
- snapshot_source_snapshot_model = SnapshotSourceSnapshot.from_dict(snapshot_source_snapshot_model_json)
- assert snapshot_source_snapshot_model != False
+ # Construct a model instance of VPNServerRoutePatch by calling from_dict on the json representation
+ vpn_server_route_patch_model = VPNServerRoutePatch.from_dict(vpn_server_route_patch_model_json)
+ assert vpn_server_route_patch_model != False
- # Construct a model instance of SnapshotSourceSnapshot by calling from_dict on the json representation
- snapshot_source_snapshot_model_dict = SnapshotSourceSnapshot.from_dict(snapshot_source_snapshot_model_json).__dict__
- snapshot_source_snapshot_model2 = SnapshotSourceSnapshot(**snapshot_source_snapshot_model_dict)
+ # Construct a model instance of VPNServerRoutePatch by calling from_dict on the json representation
+ vpn_server_route_patch_model_dict = VPNServerRoutePatch.from_dict(vpn_server_route_patch_model_json).__dict__
+ vpn_server_route_patch_model2 = VPNServerRoutePatch(**vpn_server_route_patch_model_dict)
# Verify the model instances are equivalent
- assert snapshot_source_snapshot_model == snapshot_source_snapshot_model2
+ assert vpn_server_route_patch_model == vpn_server_route_patch_model2
# Convert model instance back to dict and verify no loss of data
- snapshot_source_snapshot_model_json2 = snapshot_source_snapshot_model.to_dict()
- assert snapshot_source_snapshot_model_json2 == snapshot_source_snapshot_model_json
+ vpn_server_route_patch_model_json2 = vpn_server_route_patch_model.to_dict()
+ assert vpn_server_route_patch_model_json2 == vpn_server_route_patch_model_json
-class TestModel_Subnet:
+class TestModel_VirtualNetworkInterface:
"""
- Test Class for Subnet
+ Test Class for VirtualNetworkInterface
"""
- def test_subnet_serialization(self):
+ def test_virtual_network_interface_serialization(self):
"""
- Test serialization/deserialization for Subnet
+ Test serialization/deserialization for VirtualNetworkInterface
"""
# 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'
+ reserved_ip_reference_deleted_model = {} # ReservedIPReferenceDeleted
+ reserved_ip_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'
+ reserved_ip_reference_model = {} # ReservedIPReference
+ reserved_ip_reference_model['address'] = '10.0.0.32'
+ reserved_ip_reference_model['deleted'] = reserved_ip_reference_deleted_model
+ reserved_ip_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/0716-b28a7e6d-a66b-4de7-8713-15dcffdce401/reserved_ips/0716-7768a27e-cd6c-4a13-a9e6-d67a964e54a5'
+ reserved_ip_reference_model['id'] = '0716-7768a27e-cd6c-4a13-a9e6-d67a964e54a5'
+ reserved_ip_reference_model['name'] = 'my-reserved-ip-1'
+ reserved_ip_reference_model['resource_type'] = 'subnet_reserved_ip'
- 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/4bbce614c13444cd8fc5e7e878ef8e21'
+ resource_group_reference_model['id'] = '4bbce614c13444cd8fc5e7e878ef8e21'
+ resource_group_reference_model['name'] = 'Default'
- 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'
+ security_group_reference_deleted_model = {} # SecurityGroupReferenceDeleted
+ security_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'
+ security_group_reference_model = {} # SecurityGroupReference
+ security_group_reference_model['crn'] = 'crn:[...]'
+ security_group_reference_model['deleted'] = security_group_reference_deleted_model
+ security_group_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups/a929f12d-fb45-4e5e-9864-95e171ae3589'
+ security_group_reference_model['id'] = 'a929f12d-fb45-4e5e-9864-95e171ae3589'
+ security_group_reference_model['name'] = 'my-security-group'
- routing_table_reference_deleted_model = {} # RoutingTableReferenceDeleted
- routing_table_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'
- 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_model = {} # SubnetReference
+ subnet_reference_model['crn'] = 'crn:[...]'
+ subnet_reference_model['deleted'] = subnet_reference_deleted_model
+ subnet_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/9270d819-c05e-4352-99e4-80c4680cdb7c'
+ subnet_reference_model['id'] = '9270d819-c05e-4352-99e4-80c4680cdb7c'
+ subnet_reference_model['name'] = 'my-subnet'
+ subnet_reference_model['resource_type'] = 'subnet'
+
+ share_mount_target_reference_deleted_model = {} # ShareMountTargetReferenceDeleted
+ share_mount_target_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+
+ virtual_network_interface_target_model = {} # VirtualNetworkInterfaceTargetShareMountTargetReference
+ virtual_network_interface_target_model['deleted'] = share_mount_target_reference_deleted_model
+ virtual_network_interface_target_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c'
+ virtual_network_interface_target_model['id'] = '4cf9171a-0043-4434-8727-15b53dbc374c'
+ virtual_network_interface_target_model['name'] = 'my-share-mount-target'
+ virtual_network_interface_target_model['resource_type'] = 'share_mount_target'
vpc_reference_deleted_model = {} # VPCReferenceDeleted
vpc_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
vpc_reference_model = {} # VPCReference
- vpc_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b'
+ 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/4727d842-f94f-4a2d-824a-9bc9b02c523b'
- vpc_reference_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b'
+ vpc_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/a0819609-0997-4f92-9409-86c95ddf59d3'
+ vpc_reference_model['id'] = 'a0819609-0997-4f92-9409-86c95ddf59d3'
vpc_reference_model['name'] = 'my-vpc'
vpc_reference_model['resource_type'] = 'vpc'
@@ -62926,104 +73020,117 @@ def test_subnet_serialization(self):
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 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['resource_type'] = 'subnet'
- 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 VirtualNetworkInterface model
+ virtual_network_interface_model_json = {}
+ virtual_network_interface_model_json['allow_ip_spoofing'] = True
+ virtual_network_interface_model_json['auto_delete'] = False
+ virtual_network_interface_model_json['created_at'] = '2019-01-01T12:00:00Z'
+ virtual_network_interface_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9'
+ virtual_network_interface_model_json['enable_infrastructure_nat'] = True
+ virtual_network_interface_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9'
+ virtual_network_interface_model_json['id'] = '0767-fa41aecb-4f21-423d-8082-630bfba1e1d9'
+ virtual_network_interface_model_json['ips'] = [reserved_ip_reference_model]
+ virtual_network_interface_model_json['lifecycle_state'] = 'stable'
+ virtual_network_interface_model_json['mac_address'] = '02:00:4D:45:45:4D'
+ virtual_network_interface_model_json['name'] = 'my-virtual-network-interface'
+ virtual_network_interface_model_json['primary_ip'] = reserved_ip_reference_model
+ virtual_network_interface_model_json['resource_group'] = resource_group_reference_model
+ virtual_network_interface_model_json['resource_type'] = 'virtual_network_interface'
+ virtual_network_interface_model_json['security_groups'] = [security_group_reference_model]
+ virtual_network_interface_model_json['subnet'] = subnet_reference_model
+ virtual_network_interface_model_json['target'] = virtual_network_interface_target_model
+ virtual_network_interface_model_json['vpc'] = vpc_reference_model
+ virtual_network_interface_model_json['zone'] = zone_reference_model
- # Construct a model instance of 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 VirtualNetworkInterface by calling from_dict on the json representation
+ virtual_network_interface_model = VirtualNetworkInterface.from_dict(virtual_network_interface_model_json)
+ assert virtual_network_interface_model != False
- # Construct a model instance of 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 VirtualNetworkInterface by calling from_dict on the json representation
+ virtual_network_interface_model_dict = VirtualNetworkInterface.from_dict(virtual_network_interface_model_json).__dict__
+ virtual_network_interface_model2 = VirtualNetworkInterface(**virtual_network_interface_model_dict)
# Verify the model instances are equivalent
- assert subnet_model == subnet_model2
+ assert virtual_network_interface_model == virtual_network_interface_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
+ virtual_network_interface_model_json2 = virtual_network_interface_model.to_dict()
+ assert virtual_network_interface_model_json2 == virtual_network_interface_model_json
-class TestModel_SubnetCollection:
+class TestModel_VirtualNetworkInterfaceCollection:
"""
- Test Class for SubnetCollection
+ Test Class for VirtualNetworkInterfaceCollection
"""
- def test_subnet_collection_serialization(self):
+ def test_virtual_network_interface_collection_serialization(self):
"""
- Test serialization/deserialization for SubnetCollection
+ Test serialization/deserialization for VirtualNetworkInterfaceCollection
"""
# 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'
+ virtual_network_interface_collection_first_model = {} # VirtualNetworkInterfaceCollectionFirst
+ virtual_network_interface_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces?limit=20'
- subnet_collection_next_model = {} # SubnetCollectionNext
- subnet_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
+ virtual_network_interface_collection_next_model = {} # VirtualNetworkInterfaceCollectionNext
+ virtual_network_interface_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces?start=d3e721fd-c988-4670-9927-dbd5e7b07fc6&limit=20'
- network_acl_reference_deleted_model = {} # NetworkACLReferenceDeleted
- network_acl_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'
- 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'
+ reserved_ip_reference_model = {} # ReservedIPReference
+ reserved_ip_reference_model['address'] = '10.0.0.32'
+ reserved_ip_reference_model['deleted'] = reserved_ip_reference_deleted_model
+ reserved_ip_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/0716-b28a7e6d-a66b-4de7-8713-15dcffdce401/reserved_ips/0716-7768a27e-cd6c-4a13-a9e6-d67a964e54a5'
+ reserved_ip_reference_model['id'] = '0716-7768a27e-cd6c-4a13-a9e6-d67a964e54a5'
+ reserved_ip_reference_model['name'] = 'my-reserved-ip-1'
+ reserved_ip_reference_model['resource_type'] = 'subnet_reserved_ip'
- 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/4bbce614c13444cd8fc5e7e878ef8e21'
+ resource_group_reference_model['id'] = '4bbce614c13444cd8fc5e7e878ef8e21'
+ resource_group_reference_model['name'] = 'Default'
- 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'
+ security_group_reference_deleted_model = {} # SecurityGroupReferenceDeleted
+ security_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'
+ security_group_reference_model = {} # SecurityGroupReference
+ security_group_reference_model['crn'] = 'crn:[...]'
+ security_group_reference_model['deleted'] = security_group_reference_deleted_model
+ security_group_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups/a929f12d-fb45-4e5e-9864-95e171ae3589'
+ security_group_reference_model['id'] = 'a929f12d-fb45-4e5e-9864-95e171ae3589'
+ security_group_reference_model['name'] = 'my-security-group'
- routing_table_reference_deleted_model = {} # RoutingTableReferenceDeleted
- routing_table_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'
- 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_model = {} # SubnetReference
+ subnet_reference_model['crn'] = 'crn:[...]'
+ subnet_reference_model['deleted'] = subnet_reference_deleted_model
+ subnet_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/9270d819-c05e-4352-99e4-80c4680cdb7c'
+ subnet_reference_model['id'] = '9270d819-c05e-4352-99e4-80c4680cdb7c'
+ subnet_reference_model['name'] = 'my-subnet'
+ subnet_reference_model['resource_type'] = 'subnet'
+
+ share_mount_target_reference_deleted_model = {} # ShareMountTargetReferenceDeleted
+ share_mount_target_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+
+ virtual_network_interface_target_model = {} # VirtualNetworkInterfaceTargetShareMountTargetReference
+ virtual_network_interface_target_model['deleted'] = share_mount_target_reference_deleted_model
+ virtual_network_interface_target_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c'
+ virtual_network_interface_target_model['id'] = '4cf9171a-0043-4434-8727-15b53dbc374c'
+ virtual_network_interface_target_model['name'] = 'my-share-mount-target'
+ virtual_network_interface_target_model['resource_type'] = 'share_mount_target'
vpc_reference_deleted_model = {} # VPCReferenceDeleted
vpc_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
vpc_reference_model = {} # VPCReference
- vpc_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b'
+ 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/4727d842-f94f-4a2d-824a-9bc9b02c523b'
- vpc_reference_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b'
+ vpc_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/a0819609-0997-4f92-9409-86c95ddf59d3'
+ vpc_reference_model['id'] = 'a0819609-0997-4f92-9409-86c95ddf59d3'
vpc_reference_model['name'] = 'my-vpc'
vpc_reference_model['resource_type'] = 'vpc'
@@ -63031,346 +73138,249 @@ def test_subnet_collection_serialization(self):
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_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['resource_type'] = 'subnet'
- 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 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 subnet_collection_model == subnet_collection_model2
-
- # 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
-
-
-class TestModel_SubnetCollectionFirst:
- """
- Test Class for SubnetCollectionFirst
- """
-
- def test_subnet_collection_first_serialization(self):
- """
- Test serialization/deserialization for SubnetCollectionFirst
- """
-
- # 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 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 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 subnet_collection_first_model == subnet_collection_first_model2
-
- # 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
-
-
-class TestModel_SubnetCollectionNext:
- """
- Test Class for SubnetCollectionNext
- """
-
- def test_subnet_collection_next_serialization(self):
- """
- Test serialization/deserialization for SubnetCollectionNext
- """
+ virtual_network_interface_model = {} # VirtualNetworkInterface
+ virtual_network_interface_model['allow_ip_spoofing'] = False
+ virtual_network_interface_model['auto_delete'] = True
+ virtual_network_interface_model['created_at'] = '2019-01-31T03:42:32.993000Z'
+ virtual_network_interface_model['crn'] = 'crn:[...]'
+ virtual_network_interface_model['enable_infrastructure_nat'] = False
+ virtual_network_interface_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-54eb57ee-86f2-4796-90bb-d7874e0831ef'
+ virtual_network_interface_model['id'] = '0767-54eb57ee-86f2-4796-90bb-d7874e0831ef'
+ virtual_network_interface_model['ips'] = [reserved_ip_reference_model]
+ virtual_network_interface_model['lifecycle_state'] = 'stable'
+ virtual_network_interface_model['mac_address'] = '02:00:04:00:C4:6A'
+ virtual_network_interface_model['name'] = 'my-virtual-network-interface'
+ virtual_network_interface_model['primary_ip'] = reserved_ip_reference_model
+ virtual_network_interface_model['resource_group'] = resource_group_reference_model
+ virtual_network_interface_model['resource_type'] = 'virtual_network_interface'
+ virtual_network_interface_model['security_groups'] = [security_group_reference_model]
+ virtual_network_interface_model['subnet'] = subnet_reference_model
+ virtual_network_interface_model['target'] = virtual_network_interface_target_model
+ virtual_network_interface_model['vpc'] = vpc_reference_model
+ virtual_network_interface_model['zone'] = zone_reference_model
- # Construct a json representation of a 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 VirtualNetworkInterfaceCollection model
+ virtual_network_interface_collection_model_json = {}
+ virtual_network_interface_collection_model_json['first'] = virtual_network_interface_collection_first_model
+ virtual_network_interface_collection_model_json['limit'] = 20
+ virtual_network_interface_collection_model_json['next'] = virtual_network_interface_collection_next_model
+ virtual_network_interface_collection_model_json['total_count'] = 132
+ virtual_network_interface_collection_model_json['virtual_network_interfaces'] = [virtual_network_interface_model]
- # Construct a model instance of 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 VirtualNetworkInterfaceCollection by calling from_dict on the json representation
+ virtual_network_interface_collection_model = VirtualNetworkInterfaceCollection.from_dict(virtual_network_interface_collection_model_json)
+ assert virtual_network_interface_collection_model != False
- # Construct a model instance of 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 VirtualNetworkInterfaceCollection by calling from_dict on the json representation
+ virtual_network_interface_collection_model_dict = VirtualNetworkInterfaceCollection.from_dict(virtual_network_interface_collection_model_json).__dict__
+ virtual_network_interface_collection_model2 = VirtualNetworkInterfaceCollection(**virtual_network_interface_collection_model_dict)
# Verify the model instances are equivalent
- assert subnet_collection_next_model == subnet_collection_next_model2
+ assert virtual_network_interface_collection_model == virtual_network_interface_collection_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
+ virtual_network_interface_collection_model_json2 = virtual_network_interface_collection_model.to_dict()
+ assert virtual_network_interface_collection_model_json2 == virtual_network_interface_collection_model_json
-class TestModel_SubnetPatch:
+class TestModel_VirtualNetworkInterfaceCollectionFirst:
"""
- Test Class for SubnetPatch
+ Test Class for VirtualNetworkInterfaceCollectionFirst
"""
- def test_subnet_patch_serialization(self):
+ def test_virtual_network_interface_collection_first_serialization(self):
"""
- Test serialization/deserialization for SubnetPatch
+ Test serialization/deserialization for VirtualNetworkInterfaceCollectionFirst
"""
- # 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'
-
- 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 json representation of a VirtualNetworkInterfaceCollectionFirst model
+ virtual_network_interface_collection_first_model_json = {}
+ virtual_network_interface_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces?limit=20'
- # Construct a model instance of 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 VirtualNetworkInterfaceCollectionFirst by calling from_dict on the json representation
+ virtual_network_interface_collection_first_model = VirtualNetworkInterfaceCollectionFirst.from_dict(virtual_network_interface_collection_first_model_json)
+ assert virtual_network_interface_collection_first_model != False
- # Construct a model instance of 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 VirtualNetworkInterfaceCollectionFirst by calling from_dict on the json representation
+ virtual_network_interface_collection_first_model_dict = VirtualNetworkInterfaceCollectionFirst.from_dict(virtual_network_interface_collection_first_model_json).__dict__
+ virtual_network_interface_collection_first_model2 = VirtualNetworkInterfaceCollectionFirst(**virtual_network_interface_collection_first_model_dict)
# Verify the model instances are equivalent
- assert subnet_patch_model == subnet_patch_model2
+ assert virtual_network_interface_collection_first_model == virtual_network_interface_collection_first_model2
# Convert model instance back to dict and verify no loss of data
- subnet_patch_model_json2 = subnet_patch_model.to_dict()
- assert subnet_patch_model_json2 == subnet_patch_model_json
+ virtual_network_interface_collection_first_model_json2 = virtual_network_interface_collection_first_model.to_dict()
+ assert virtual_network_interface_collection_first_model_json2 == virtual_network_interface_collection_first_model_json
-class TestModel_SubnetReference:
+class TestModel_VirtualNetworkInterfaceCollectionNext:
"""
- Test Class for SubnetReference
+ Test Class for VirtualNetworkInterfaceCollectionNext
"""
- def test_subnet_reference_serialization(self):
+ def test_virtual_network_interface_collection_next_serialization(self):
"""
- Test serialization/deserialization for SubnetReference
+ Test serialization/deserialization for VirtualNetworkInterfaceCollectionNext
"""
- # 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'
-
- # 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'
- subnet_reference_model_json['resource_type'] = 'subnet'
+ # Construct a json representation of a VirtualNetworkInterfaceCollectionNext model
+ virtual_network_interface_collection_next_model_json = {}
+ virtual_network_interface_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces?start=d3e721fd-c988-4670-9927-dbd5e7b07fc6&limit=20'
- # Construct a model instance of 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 VirtualNetworkInterfaceCollectionNext by calling from_dict on the json representation
+ virtual_network_interface_collection_next_model = VirtualNetworkInterfaceCollectionNext.from_dict(virtual_network_interface_collection_next_model_json)
+ assert virtual_network_interface_collection_next_model != False
- # Construct a model instance of 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)
+ # Construct a model instance of VirtualNetworkInterfaceCollectionNext by calling from_dict on the json representation
+ virtual_network_interface_collection_next_model_dict = VirtualNetworkInterfaceCollectionNext.from_dict(virtual_network_interface_collection_next_model_json).__dict__
+ virtual_network_interface_collection_next_model2 = VirtualNetworkInterfaceCollectionNext(**virtual_network_interface_collection_next_model_dict)
# Verify the model instances are equivalent
- assert subnet_reference_model == subnet_reference_model2
+ assert virtual_network_interface_collection_next_model == virtual_network_interface_collection_next_model2
# Convert model instance back to dict and verify no loss of data
- subnet_reference_model_json2 = subnet_reference_model.to_dict()
- assert subnet_reference_model_json2 == subnet_reference_model_json
+ virtual_network_interface_collection_next_model_json2 = virtual_network_interface_collection_next_model.to_dict()
+ assert virtual_network_interface_collection_next_model_json2 == virtual_network_interface_collection_next_model_json
-class TestModel_SubnetReferenceDeleted:
+class TestModel_VirtualNetworkInterfacePatch:
"""
- Test Class for SubnetReferenceDeleted
+ Test Class for VirtualNetworkInterfacePatch
"""
- def test_subnet_reference_deleted_serialization(self):
+ def test_virtual_network_interface_patch_serialization(self):
"""
- Test serialization/deserialization for SubnetReferenceDeleted
+ Test serialization/deserialization for VirtualNetworkInterfacePatch
"""
- # 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 VirtualNetworkInterfacePatch model
+ virtual_network_interface_patch_model_json = {}
+ virtual_network_interface_patch_model_json['allow_ip_spoofing'] = True
+ virtual_network_interface_patch_model_json['auto_delete'] = False
+ virtual_network_interface_patch_model_json['enable_infrastructure_nat'] = True
+ virtual_network_interface_patch_model_json['name'] = 'my-virtual-network-interface'
- # 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 VirtualNetworkInterfacePatch by calling from_dict on the json representation
+ virtual_network_interface_patch_model = VirtualNetworkInterfacePatch.from_dict(virtual_network_interface_patch_model_json)
+ assert virtual_network_interface_patch_model != False
- # Construct a model instance of 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 VirtualNetworkInterfacePatch by calling from_dict on the json representation
+ virtual_network_interface_patch_model_dict = VirtualNetworkInterfacePatch.from_dict(virtual_network_interface_patch_model_json).__dict__
+ virtual_network_interface_patch_model2 = VirtualNetworkInterfacePatch(**virtual_network_interface_patch_model_dict)
# Verify the model instances are equivalent
- assert subnet_reference_deleted_model == subnet_reference_deleted_model2
+ assert virtual_network_interface_patch_model == virtual_network_interface_patch_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
+ virtual_network_interface_patch_model_json2 = virtual_network_interface_patch_model.to_dict()
+ assert virtual_network_interface_patch_model_json2 == virtual_network_interface_patch_model_json
-class TestModel_TrustedProfileReference:
+class TestModel_VirtualNetworkInterfaceReferenceAttachmentContext:
"""
- Test Class for TrustedProfileReference
+ Test Class for VirtualNetworkInterfaceReferenceAttachmentContext
"""
- def test_trusted_profile_reference_serialization(self):
+ def test_virtual_network_interface_reference_attachment_context_serialization(self):
"""
- Test serialization/deserialization for TrustedProfileReference
+ Test serialization/deserialization for VirtualNetworkInterfaceReferenceAttachmentContext
"""
- # Construct a json representation of a TrustedProfileReference model
- trusted_profile_reference_model_json = {}
- trusted_profile_reference_model_json['crn'] = 'crn:v1:bluemix:public:iam-identity::a/123456::profile:Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5'
- trusted_profile_reference_model_json['id'] = 'Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5'
- trusted_profile_reference_model_json['resource_type'] = 'trusted_profile'
+ # Construct a json representation of a VirtualNetworkInterfaceReferenceAttachmentContext model
+ virtual_network_interface_reference_attachment_context_model_json = {}
+ virtual_network_interface_reference_attachment_context_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9'
+ virtual_network_interface_reference_attachment_context_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9'
+ virtual_network_interface_reference_attachment_context_model_json['id'] = '0767-fa41aecb-4f21-423d-8082-630bfba1e1d9'
+ virtual_network_interface_reference_attachment_context_model_json['name'] = 'my-virtual-network-interface'
+ virtual_network_interface_reference_attachment_context_model_json['resource_type'] = 'virtual_network_interface'
- # Construct a model instance of TrustedProfileReference by calling from_dict on the json representation
- trusted_profile_reference_model = TrustedProfileReference.from_dict(trusted_profile_reference_model_json)
- assert trusted_profile_reference_model != False
+ # Construct a model instance of VirtualNetworkInterfaceReferenceAttachmentContext by calling from_dict on the json representation
+ virtual_network_interface_reference_attachment_context_model = VirtualNetworkInterfaceReferenceAttachmentContext.from_dict(virtual_network_interface_reference_attachment_context_model_json)
+ assert virtual_network_interface_reference_attachment_context_model != False
- # Construct a model instance of TrustedProfileReference by calling from_dict on the json representation
- trusted_profile_reference_model_dict = TrustedProfileReference.from_dict(trusted_profile_reference_model_json).__dict__
- trusted_profile_reference_model2 = TrustedProfileReference(**trusted_profile_reference_model_dict)
+ # Construct a model instance of VirtualNetworkInterfaceReferenceAttachmentContext by calling from_dict on the json representation
+ virtual_network_interface_reference_attachment_context_model_dict = VirtualNetworkInterfaceReferenceAttachmentContext.from_dict(virtual_network_interface_reference_attachment_context_model_json).__dict__
+ virtual_network_interface_reference_attachment_context_model2 = VirtualNetworkInterfaceReferenceAttachmentContext(**virtual_network_interface_reference_attachment_context_model_dict)
# Verify the model instances are equivalent
- assert trusted_profile_reference_model == trusted_profile_reference_model2
+ assert virtual_network_interface_reference_attachment_context_model == virtual_network_interface_reference_attachment_context_model2
# Convert model instance back to dict and verify no loss of data
- trusted_profile_reference_model_json2 = trusted_profile_reference_model.to_dict()
- assert trusted_profile_reference_model_json2 == trusted_profile_reference_model_json
+ virtual_network_interface_reference_attachment_context_model_json2 = virtual_network_interface_reference_attachment_context_model.to_dict()
+ assert virtual_network_interface_reference_attachment_context_model_json2 == virtual_network_interface_reference_attachment_context_model_json
-class TestModel_VCPU:
+class TestModel_VirtualNetworkInterfaceReferenceDeleted:
"""
- Test Class for VCPU
+ Test Class for VirtualNetworkInterfaceReferenceDeleted
"""
- def test_vcpu_serialization(self):
+ def test_virtual_network_interface_reference_deleted_serialization(self):
"""
- Test serialization/deserialization for VCPU
+ Test serialization/deserialization for VirtualNetworkInterfaceReferenceDeleted
"""
- # Construct a json representation of a VCPU model
- vcpu_model_json = {}
- vcpu_model_json['architecture'] = 'amd64'
- vcpu_model_json['count'] = 4
- vcpu_model_json['manufacturer'] = 'intel'
+ # Construct a json representation of a VirtualNetworkInterfaceReferenceDeleted model
+ virtual_network_interface_reference_deleted_model_json = {}
+ virtual_network_interface_reference_deleted_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Construct a model instance of 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 VirtualNetworkInterfaceReferenceDeleted by calling from_dict on the json representation
+ virtual_network_interface_reference_deleted_model = VirtualNetworkInterfaceReferenceDeleted.from_dict(virtual_network_interface_reference_deleted_model_json)
+ assert virtual_network_interface_reference_deleted_model != False
- # Construct a model instance of 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 VirtualNetworkInterfaceReferenceDeleted by calling from_dict on the json representation
+ virtual_network_interface_reference_deleted_model_dict = VirtualNetworkInterfaceReferenceDeleted.from_dict(virtual_network_interface_reference_deleted_model_json).__dict__
+ virtual_network_interface_reference_deleted_model2 = VirtualNetworkInterfaceReferenceDeleted(**virtual_network_interface_reference_deleted_model_dict)
# Verify the model instances are equivalent
- assert vcpu_model == vcpu_model2
+ assert virtual_network_interface_reference_deleted_model == virtual_network_interface_reference_deleted_model2
# Convert model instance back to dict and verify no loss of data
- vcpu_model_json2 = vcpu_model.to_dict()
- assert vcpu_model_json2 == vcpu_model_json
+ virtual_network_interface_reference_deleted_model_json2 = virtual_network_interface_reference_deleted_model.to_dict()
+ assert virtual_network_interface_reference_deleted_model_json2 == virtual_network_interface_reference_deleted_model_json
-class TestModel_VPC:
+class TestModel_Volume:
"""
- Test Class for VPC
+ Test Class for Volume
"""
- def test_vpc_serialization(self):
+ def test_volume_serialization(self):
"""
- Test serialization/deserialization for VPC
+ Test serialization/deserialization for Volume
"""
# 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'
+ encryption_key_reference_model = {} # EncryptionKeyReference
+ encryption_key_reference_model['crn'] = 'crn:v1:bluemix:public:kms:us-south:a/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179'
- 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'
+ volume_health_reason_model = {} # VolumeHealthReason
+ volume_health_reason_model['code'] = 'initializing_from_snapshot'
+ volume_health_reason_model['message'] = 'Performance will be degraded while this volume is being initialized from its snapshot'
+ volume_health_reason_model['more_info'] = 'https://cloud.ibm.com/docs/vpc?topic=vpc-snapshots-vpc-troubleshooting&interface=ui#snapshot_ts_degraded_perf'
- security_group_reference_deleted_model = {} # SecurityGroupReferenceDeleted
- security_group_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'
- 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_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'
- dns_server_model = {} # DNSServer
- dns_server_model['address'] = '192.168.3.4'
- dns_server_model['zone_affinity'] = zone_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'
- vpc_reference_dns_resolver_context_deleted_model = {} # VPCReferenceDNSResolverContextDeleted
- vpc_reference_dns_resolver_context_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'
account_reference_model = {} # AccountReference
account_reference_model['id'] = 'aa2432b1fa4d4ace891e9b80fc104e34'
@@ -63380,569 +73390,687 @@ def test_vpc_serialization(self):
region_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south'
region_reference_model['name'] = 'us-south'
- vpc_remote_model = {} # VPCRemote
- vpc_remote_model['account'] = account_reference_model
- vpc_remote_model['region'] = region_reference_model
-
- vpc_reference_dns_resolver_context_model = {} # VPCReferenceDNSResolverContext
- vpc_reference_dns_resolver_context_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b'
- vpc_reference_dns_resolver_context_model['deleted'] = vpc_reference_dns_resolver_context_deleted_model
- vpc_reference_dns_resolver_context_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b'
- vpc_reference_dns_resolver_context_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b'
- vpc_reference_dns_resolver_context_model['name'] = 'my-vpc'
- vpc_reference_dns_resolver_context_model['remote'] = vpc_remote_model
- vpc_reference_dns_resolver_context_model['resource_type'] = 'vpc'
-
- vpcdns_resolver_model = {} # VPCDNSResolverTypeDelegated
- vpcdns_resolver_model['servers'] = [dns_server_model]
- vpcdns_resolver_model['type'] = 'delegated'
- vpcdns_resolver_model['vpc'] = vpc_reference_dns_resolver_context_model
-
- vpcdns_model = {} # VPCDNS
- vpcdns_model['enable_hub'] = True
- vpcdns_model['resolution_binding_count'] = 0
- vpcdns_model['resolver'] = vpcdns_resolver_model
-
- vpc_health_reason_model = {} # VPCHealthReason
- vpc_health_reason_model['code'] = 'internal_error'
- vpc_health_reason_model['message'] = 'Internal error (contact IBM support).'
- vpc_health_reason_model['more_info'] = 'https://cloud.ibm.com/docs/vpc?topic=vpc-troubleshoot-hub-spoke-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'
+ image_remote_model = {} # ImageRemote
+ image_remote_model['account'] = account_reference_model
+ image_remote_model['region'] = region_reference_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['dns'] = vpcdns_model
- vpc_model_json['health_reasons'] = [vpc_health_reason_model]
- vpc_model_json['health_state'] = 'ok'
- 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['resource_type'] = 'vpc'
- vpc_model_json['status'] = 'available'
+ 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'
+ image_reference_model['remote'] = image_remote_model
+ image_reference_model['resource_type'] = 'image'
- # 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
+ snapshot_reference_deleted_model = {} # SnapshotReferenceDeleted
+ snapshot_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # 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)
+ snapshot_remote_model = {} # SnapshotRemote
+ snapshot_remote_model['region'] = region_reference_model
- # Verify the model instances are equivalent
- assert vpc_model == vpc_model2
+ 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['remote'] = snapshot_remote_model
+ snapshot_reference_model['resource_type'] = 'snapshot'
- # 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_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'
+ 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_VPCCSESourceIP:
- """
- Test Class for VPCCSESourceIP
- """
+ volume_attachment_device_model = {} # VolumeAttachmentDevice
+ volume_attachment_device_model['id'] = '80b3e36e-41f4-40e9-bd56-beae81792a68'
- def test_vpccse_source_ip_serialization(self):
- """
- Test serialization/deserialization for VPCCSESourceIP
- """
+ instance_reference_deleted_model = {} # InstanceReferenceDeleted
+ instance_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_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'
- ip_model = {} # IP
- ip_model['address'] = '192.168.3.4'
+ 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'
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 VPCCSESourceIP model
- vpccse_source_ip_model_json = {}
- vpccse_source_ip_model_json['ip'] = ip_model
- vpccse_source_ip_model_json['zone'] = zone_reference_model
+ # Construct a json representation of a Volume model
+ volume_model_json = {}
+ volume_model_json['active'] = True
+ volume_model_json['attachment_state'] = 'attached'
+ 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['health_reasons'] = [volume_health_reason_model]
+ volume_model_json['health_state'] = 'ok'
+ volume_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
+ volume_model_json['id'] = '1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
+ volume_model_json['iops'] = 10000
+ volume_model_json['name'] = 'my-volume'
+ volume_model_json['operating_system'] = operating_system_model
+ volume_model_json['profile'] = volume_profile_reference_model
+ volume_model_json['resource_group'] = resource_group_reference_model
+ volume_model_json['resource_type'] = 'volume'
+ 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['user_tags'] = ['testString']
+ volume_model_json['volume_attachments'] = [volume_attachment_reference_volume_context_model]
+ volume_model_json['zone'] = zone_reference_model
- # 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
+ # 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 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 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 vpccse_source_ip_model == vpccse_source_ip_model2
+ assert volume_model == volume_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_model_json2 = volume_model.to_dict()
+ assert volume_model_json2 == volume_model_json
-class TestModel_VPCCollection:
+class TestModel_VolumeAttachment:
"""
- Test Class for VPCCollection
+ Test Class for VolumeAttachment
"""
- def test_vpc_collection_serialization(self):
+ def test_volume_attachment_serialization(self):
"""
- Test serialization/deserialization for VPCCollection
+ Test serialization/deserialization for VolumeAttachment
"""
# 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'
+ volume_attachment_device_model = {} # VolumeAttachmentDevice
+ volume_attachment_device_model['id'] = '80b3e36e-41f4-40e9-bd56-beae81792a68'
- vpc_collection_next_model = {} # VPCCollectionNext
- vpc_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
+ volume_reference_volume_attachment_context_deleted_model = {} # VolumeReferenceVolumeAttachmentContextDeleted
+ volume_reference_volume_attachment_context_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- ip_model = {} # IP
- ip_model['address'] = '192.168.3.4'
+ volume_reference_volume_attachment_context_model = {} # VolumeReferenceVolumeAttachmentContext
+ volume_reference_volume_attachment_context_model['crn'] = 'crn:[...]'
+ volume_reference_volume_attachment_context_model['deleted'] = volume_reference_volume_attachment_context_deleted_model
+ volume_reference_volume_attachment_context_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volumes/ca4b6df3-f5a8-4667-b5f2-f3b9b4160781'
+ volume_reference_volume_attachment_context_model['id'] = 'ca4b6df3-f5a8-4667-b5f2-f3b9b4160781'
+ volume_reference_volume_attachment_context_model['name'] = 'my-data-volume'
+ volume_reference_volume_attachment_context_model['resource_type'] = '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 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_volume_attachment_context_model
- vpccse_source_ip_model = {} # VPCCSESourceIP
- vpccse_source_ip_model['ip'] = ip_model
- vpccse_source_ip_model['zone'] = zone_reference_model
+ # 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
- network_acl_reference_deleted_model = {} # NetworkACLReferenceDeleted
- network_acl_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ # 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)
- 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'
+ # Verify the model instances are equivalent
+ assert volume_attachment_model == volume_attachment_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
+ volume_attachment_model_json2 = volume_attachment_model.to_dict()
+ assert volume_attachment_model_json2 == volume_attachment_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'
- security_group_reference_deleted_model = {} # SecurityGroupReferenceDeleted
- security_group_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+class TestModel_VolumeAttachmentCollection:
+ """
+ Test Class for VolumeAttachmentCollection
+ """
- 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_volume_attachment_collection_serialization(self):
+ """
+ Test serialization/deserialization for VolumeAttachmentCollection
+ """
- dns_server_model = {} # DNSServer
- dns_server_model['address'] = '192.168.3.4'
- dns_server_model['zone_affinity'] = zone_reference_model
+ # Construct dict forms of any model objects needed in order to build this model.
- vpc_reference_dns_resolver_context_deleted_model = {} # VPCReferenceDNSResolverContextDeleted
- vpc_reference_dns_resolver_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'
- account_reference_model = {} # AccountReference
- account_reference_model['id'] = 'aa2432b1fa4d4ace891e9b80fc104e34'
- account_reference_model['resource_type'] = 'account'
+ volume_reference_volume_attachment_context_deleted_model = {} # VolumeReferenceVolumeAttachmentContextDeleted
+ volume_reference_volume_attachment_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_reference_volume_attachment_context_model = {} # VolumeReferenceVolumeAttachmentContext
+ volume_reference_volume_attachment_context_model['crn'] = 'crn:[...]'
+ volume_reference_volume_attachment_context_model['deleted'] = volume_reference_volume_attachment_context_deleted_model
+ volume_reference_volume_attachment_context_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volumes/ac0b16a5-ccc2-47dd-90e2-b9e5f367b6c6'
+ volume_reference_volume_attachment_context_model['id'] = 'ac0b16a5-ccc2-47dd-90e2-b9e5f367b6c6'
+ volume_reference_volume_attachment_context_model['name'] = 'my-boot-volume'
+ volume_reference_volume_attachment_context_model['resource_type'] = 'volume'
- vpc_remote_model = {} # VPCRemote
- vpc_remote_model['account'] = account_reference_model
- vpc_remote_model['region'] = region_reference_model
+ 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_volume_attachment_context_model
- vpc_reference_dns_resolver_context_model = {} # VPCReferenceDNSResolverContext
- vpc_reference_dns_resolver_context_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b'
- vpc_reference_dns_resolver_context_model['deleted'] = vpc_reference_dns_resolver_context_deleted_model
- vpc_reference_dns_resolver_context_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b'
- vpc_reference_dns_resolver_context_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b'
- vpc_reference_dns_resolver_context_model['name'] = 'my-vpc'
- vpc_reference_dns_resolver_context_model['remote'] = vpc_remote_model
- vpc_reference_dns_resolver_context_model['resource_type'] = 'vpc'
+ # Construct a json representation of a VolumeAttachmentCollection model
+ volume_attachment_collection_model_json = {}
+ volume_attachment_collection_model_json['volume_attachments'] = [volume_attachment_model]
- vpcdns_resolver_model = {} # VPCDNSResolverTypeDelegated
- vpcdns_resolver_model['servers'] = [dns_server_model]
- vpcdns_resolver_model['type'] = 'delegated'
- vpcdns_resolver_model['vpc'] = vpc_reference_dns_resolver_context_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
- vpcdns_model = {} # VPCDNS
- vpcdns_model['enable_hub'] = True
- vpcdns_model['resolution_binding_count'] = 0
- vpcdns_model['resolver'] = vpcdns_resolver_model
+ # 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)
- vpc_health_reason_model = {} # VPCHealthReason
- vpc_health_reason_model['code'] = 'internal_error'
- vpc_health_reason_model['message'] = 'Internal error (contact IBM support).'
- vpc_health_reason_model['more_info'] = 'https://cloud.ibm.com/docs/vpc?topic=vpc-troubleshoot-hub-spoke-1'
+ # Verify the model instances are equivalent
+ assert volume_attachment_collection_model == volume_attachment_collection_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
+ volume_attachment_collection_model_json2 = volume_attachment_collection_model.to_dict()
+ assert volume_attachment_collection_model_json2 == volume_attachment_collection_model_json
- 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['dns'] = vpcdns_model
- vpc_model['health_reasons'] = [vpc_health_reason_model]
- vpc_model['health_state'] = 'ok'
- 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['resource_type'] = 'vpc'
- vpc_model['status'] = 'available'
- # 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]
+class TestModel_VolumeAttachmentDevice:
+ """
+ Test Class for VolumeAttachmentDevice
+ """
- # 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
+ def test_volume_attachment_device_serialization(self):
+ """
+ Test serialization/deserialization for VolumeAttachmentDevice
+ """
+
+ # 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 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 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 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 vpc_collection_model == vpc_collection_model2
+ assert volume_attachment_device_model == volume_attachment_device_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_device_model_json2 = volume_attachment_device_model.to_dict()
+ assert volume_attachment_device_model_json2 == volume_attachment_device_model_json
-class TestModel_VPCCollectionFirst:
+class TestModel_VolumeAttachmentPatch:
"""
- Test Class for VPCCollectionFirst
+ Test Class for VolumeAttachmentPatch
"""
- def test_vpc_collection_first_serialization(self):
+ def test_volume_attachment_patch_serialization(self):
"""
- Test serialization/deserialization for VPCCollectionFirst
+ Test serialization/deserialization for VolumeAttachmentPatch
"""
- # 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 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 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 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 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)
+ # 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 vpc_collection_first_model == vpc_collection_first_model2
+ assert volume_attachment_patch_model == volume_attachment_patch_model2
# 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_patch_model_json2 = volume_attachment_patch_model.to_dict()
+ assert volume_attachment_patch_model_json2 == volume_attachment_patch_model_json
-class TestModel_VPCCollectionNext:
+class TestModel_VolumeAttachmentPrototype:
"""
- Test Class for VPCCollectionNext
+ Test Class for VolumeAttachmentPrototype
"""
- def test_vpc_collection_next_serialization(self):
+ def test_volume_attachment_prototype_serialization(self):
"""
- Test serialization/deserialization for VPCCollectionNext
+ Test serialization/deserialization for VolumeAttachmentPrototype
"""
- # 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 dict forms of any model objects needed in order to build this model.
- # 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
+ volume_attachment_prototype_volume_model = {} # VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById
+ volume_attachment_prototype_volume_model['id'] = '1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
- # 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 json representation of a VolumeAttachmentPrototype model
+ volume_attachment_prototype_model_json = {}
+ volume_attachment_prototype_model_json['delete_volume_on_instance_delete'] = False
+ volume_attachment_prototype_model_json['name'] = 'my-volume-attachment'
+ volume_attachment_prototype_model_json['volume'] = volume_attachment_prototype_volume_model
+
+ # Construct a model instance of VolumeAttachmentPrototype by calling from_dict on the json representation
+ volume_attachment_prototype_model = VolumeAttachmentPrototype.from_dict(volume_attachment_prototype_model_json)
+ assert volume_attachment_prototype_model != False
+
+ # Construct a model instance of VolumeAttachmentPrototype by calling from_dict on the json representation
+ volume_attachment_prototype_model_dict = VolumeAttachmentPrototype.from_dict(volume_attachment_prototype_model_json).__dict__
+ volume_attachment_prototype_model2 = VolumeAttachmentPrototype(**volume_attachment_prototype_model_dict)
# Verify the model instances are equivalent
- assert vpc_collection_next_model == vpc_collection_next_model2
+ assert volume_attachment_prototype_model == volume_attachment_prototype_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_prototype_model_json2 = volume_attachment_prototype_model.to_dict()
+ assert volume_attachment_prototype_model_json2 == volume_attachment_prototype_model_json
-class TestModel_VPCDNS:
+class TestModel_VolumeAttachmentPrototypeInstanceByImageContext:
"""
- Test Class for VPCDNS
+ Test Class for VolumeAttachmentPrototypeInstanceByImageContext
"""
- def test_vpcdns_serialization(self):
+ def test_volume_attachment_prototype_instance_by_image_context_serialization(self):
"""
- Test serialization/deserialization for VPCDNS
+ Test serialization/deserialization for VolumeAttachmentPrototypeInstanceByImageContext
"""
# 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'
+ encryption_key_identity_model = {} # EncryptionKeyIdentityByCRN
+ encryption_key_identity_model['crn'] = 'crn:v1:bluemix:public:kms:us-south:a/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179'
- dns_server_model = {} # DNSServer
- dns_server_model['address'] = '192.168.3.4'
- dns_server_model['zone_affinity'] = zone_reference_model
+ volume_profile_identity_model = {} # VolumeProfileIdentityByName
+ volume_profile_identity_model['name'] = 'general-purpose'
- vpc_reference_dns_resolver_context_deleted_model = {} # VPCReferenceDNSResolverContextDeleted
- vpc_reference_dns_resolver_context_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ resource_group_identity_model = {} # ResourceGroupIdentityById
+ resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
- account_reference_model = {} # AccountReference
- account_reference_model['id'] = 'aa2432b1fa4d4ace891e9b80fc104e34'
- account_reference_model['resource_type'] = 'account'
+ volume_prototype_instance_by_image_context_model = {} # VolumePrototypeInstanceByImageContext
+ volume_prototype_instance_by_image_context_model['capacity'] = 100
+ volume_prototype_instance_by_image_context_model['encryption_key'] = encryption_key_identity_model
+ volume_prototype_instance_by_image_context_model['iops'] = 10000
+ volume_prototype_instance_by_image_context_model['name'] = 'my-volume'
+ volume_prototype_instance_by_image_context_model['profile'] = volume_profile_identity_model
+ volume_prototype_instance_by_image_context_model['resource_group'] = resource_group_identity_model
+ volume_prototype_instance_by_image_context_model['user_tags'] = []
- 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 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
- vpc_remote_model = {} # VPCRemote
- vpc_remote_model['account'] = account_reference_model
- vpc_remote_model['region'] = region_reference_model
+ # 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
- vpc_reference_dns_resolver_context_model = {} # VPCReferenceDNSResolverContext
- vpc_reference_dns_resolver_context_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b'
- vpc_reference_dns_resolver_context_model['deleted'] = vpc_reference_dns_resolver_context_deleted_model
- vpc_reference_dns_resolver_context_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b'
- vpc_reference_dns_resolver_context_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b'
- vpc_reference_dns_resolver_context_model['name'] = 'my-vpc'
- vpc_reference_dns_resolver_context_model['remote'] = vpc_remote_model
- vpc_reference_dns_resolver_context_model['resource_type'] = 'vpc'
+ # 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)
- vpcdns_resolver_model = {} # VPCDNSResolverTypeDelegated
- vpcdns_resolver_model['servers'] = [dns_server_model]
- vpcdns_resolver_model['type'] = 'delegated'
- vpcdns_resolver_model['vpc'] = vpc_reference_dns_resolver_context_model
+ # Verify the model instances are equivalent
+ assert volume_attachment_prototype_instance_by_image_context_model == volume_attachment_prototype_instance_by_image_context_model2
- # Construct a json representation of a VPCDNS model
- vpcdns_model_json = {}
- vpcdns_model_json['enable_hub'] = True
- vpcdns_model_json['resolution_binding_count'] = 0
- vpcdns_model_json['resolver'] = vpcdns_resolver_model
+ # 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
- # Construct a model instance of VPCDNS by calling from_dict on the json representation
- vpcdns_model = VPCDNS.from_dict(vpcdns_model_json)
- assert vpcdns_model != False
- # Construct a model instance of VPCDNS by calling from_dict on the json representation
- vpcdns_model_dict = VPCDNS.from_dict(vpcdns_model_json).__dict__
- vpcdns_model2 = VPCDNS(**vpcdns_model_dict)
+class TestModel_VolumeAttachmentPrototypeInstanceBySourceSnapshotContext:
+ """
+ Test Class for VolumeAttachmentPrototypeInstanceBySourceSnapshotContext
+ """
+
+ def test_volume_attachment_prototype_instance_by_source_snapshot_context_serialization(self):
+ """
+ Test serialization/deserialization for VolumeAttachmentPrototypeInstanceBySourceSnapshotContext
+ """
+
+ # 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/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179'
+
+ volume_profile_identity_model = {} # VolumeProfileIdentityByName
+ volume_profile_identity_model['name'] = 'general-purpose'
+
+ resource_group_identity_model = {} # ResourceGroupIdentityById
+ resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
+
+ snapshot_identity_model = {} # SnapshotIdentityById
+ snapshot_identity_model['id'] = '349a61d8-7ab1-420f-a690-5fed76ef9d4f'
+
+ volume_prototype_instance_by_source_snapshot_context_model = {} # VolumePrototypeInstanceBySourceSnapshotContext
+ volume_prototype_instance_by_source_snapshot_context_model['capacity'] = 100
+ volume_prototype_instance_by_source_snapshot_context_model['encryption_key'] = encryption_key_identity_model
+ volume_prototype_instance_by_source_snapshot_context_model['iops'] = 10000
+ volume_prototype_instance_by_source_snapshot_context_model['name'] = 'my-volume'
+ volume_prototype_instance_by_source_snapshot_context_model['profile'] = volume_profile_identity_model
+ volume_prototype_instance_by_source_snapshot_context_model['resource_group'] = resource_group_identity_model
+ volume_prototype_instance_by_source_snapshot_context_model['source_snapshot'] = snapshot_identity_model
+ volume_prototype_instance_by_source_snapshot_context_model['user_tags'] = []
+
+ # Construct a json representation of a VolumeAttachmentPrototypeInstanceBySourceSnapshotContext model
+ volume_attachment_prototype_instance_by_source_snapshot_context_model_json = {}
+ volume_attachment_prototype_instance_by_source_snapshot_context_model_json['delete_volume_on_instance_delete'] = True
+ volume_attachment_prototype_instance_by_source_snapshot_context_model_json['name'] = 'my-volume-attachment'
+ volume_attachment_prototype_instance_by_source_snapshot_context_model_json['volume'] = volume_prototype_instance_by_source_snapshot_context_model
+
+ # Construct a model instance of VolumeAttachmentPrototypeInstanceBySourceSnapshotContext by calling from_dict on the json representation
+ volume_attachment_prototype_instance_by_source_snapshot_context_model = VolumeAttachmentPrototypeInstanceBySourceSnapshotContext.from_dict(volume_attachment_prototype_instance_by_source_snapshot_context_model_json)
+ assert volume_attachment_prototype_instance_by_source_snapshot_context_model != False
+
+ # Construct a model instance of VolumeAttachmentPrototypeInstanceBySourceSnapshotContext by calling from_dict on the json representation
+ volume_attachment_prototype_instance_by_source_snapshot_context_model_dict = VolumeAttachmentPrototypeInstanceBySourceSnapshotContext.from_dict(volume_attachment_prototype_instance_by_source_snapshot_context_model_json).__dict__
+ volume_attachment_prototype_instance_by_source_snapshot_context_model2 = VolumeAttachmentPrototypeInstanceBySourceSnapshotContext(**volume_attachment_prototype_instance_by_source_snapshot_context_model_dict)
# Verify the model instances are equivalent
- assert vpcdns_model == vpcdns_model2
+ assert volume_attachment_prototype_instance_by_source_snapshot_context_model == volume_attachment_prototype_instance_by_source_snapshot_context_model2
# Convert model instance back to dict and verify no loss of data
- vpcdns_model_json2 = vpcdns_model.to_dict()
- assert vpcdns_model_json2 == vpcdns_model_json
+ volume_attachment_prototype_instance_by_source_snapshot_context_model_json2 = volume_attachment_prototype_instance_by_source_snapshot_context_model.to_dict()
+ assert volume_attachment_prototype_instance_by_source_snapshot_context_model_json2 == volume_attachment_prototype_instance_by_source_snapshot_context_model_json
-class TestModel_VPCDNSPatch:
+class TestModel_VolumeAttachmentPrototypeInstanceByVolumeContext:
"""
- Test Class for VPCDNSPatch
+ Test Class for VolumeAttachmentPrototypeInstanceByVolumeContext
"""
- def test_vpcdns_patch_serialization(self):
+ def test_volume_attachment_prototype_instance_by_volume_context_serialization(self):
"""
- Test serialization/deserialization for VPCDNSPatch
+ Test serialization/deserialization for VolumeAttachmentPrototypeInstanceByVolumeContext
"""
# 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'
-
- dns_server_prototype_model = {} # DNSServerPrototype
- dns_server_prototype_model['address'] = '192.168.3.4'
- dns_server_prototype_model['zone_affinity'] = zone_identity_model
-
- vpcdns_resolver_vpc_patch_model = {} # VPCDNSResolverVPCPatchVPCIdentityById
- vpcdns_resolver_vpc_patch_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b'
-
- vpcdns_resolver_patch_model = {} # VPCDNSResolverPatch
- vpcdns_resolver_patch_model['manual_servers'] = [dns_server_prototype_model]
- vpcdns_resolver_patch_model['type'] = 'delegated'
- vpcdns_resolver_patch_model['vpc'] = vpcdns_resolver_vpc_patch_model
+ volume_identity_model = {} # VolumeIdentityById
+ volume_identity_model['id'] = '1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
- # Construct a json representation of a VPCDNSPatch model
- vpcdns_patch_model_json = {}
- vpcdns_patch_model_json['enable_hub'] = True
- vpcdns_patch_model_json['resolver'] = vpcdns_resolver_patch_model
+ # Construct a json representation of a VolumeAttachmentPrototypeInstanceByVolumeContext model
+ volume_attachment_prototype_instance_by_volume_context_model_json = {}
+ volume_attachment_prototype_instance_by_volume_context_model_json['delete_volume_on_instance_delete'] = False
+ volume_attachment_prototype_instance_by_volume_context_model_json['name'] = 'my-volume-attachment'
+ volume_attachment_prototype_instance_by_volume_context_model_json['volume'] = volume_identity_model
- # Construct a model instance of VPCDNSPatch by calling from_dict on the json representation
- vpcdns_patch_model = VPCDNSPatch.from_dict(vpcdns_patch_model_json)
- assert vpcdns_patch_model != False
+ # 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 VPCDNSPatch by calling from_dict on the json representation
- vpcdns_patch_model_dict = VPCDNSPatch.from_dict(vpcdns_patch_model_json).__dict__
- vpcdns_patch_model2 = VPCDNSPatch(**vpcdns_patch_model_dict)
+ # 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 vpcdns_patch_model == vpcdns_patch_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
- vpcdns_patch_model_json2 = vpcdns_patch_model.to_dict()
- assert vpcdns_patch_model_json2 == vpcdns_patch_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_VPCDNSPrototype:
+class TestModel_VolumeAttachmentReferenceInstanceContext:
"""
- Test Class for VPCDNSPrototype
+ Test Class for VolumeAttachmentReferenceInstanceContext
"""
- def test_vpcdns_prototype_serialization(self):
+ def test_volume_attachment_reference_instance_context_serialization(self):
"""
- Test serialization/deserialization for VPCDNSPrototype
+ Test serialization/deserialization for VolumeAttachmentReferenceInstanceContext
"""
# 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'
+ 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'
- dns_server_prototype_model = {} # DNSServerPrototype
- dns_server_prototype_model['address'] = '192.168.3.4'
- dns_server_prototype_model['zone_affinity'] = zone_identity_model
+ volume_attachment_device_model = {} # VolumeAttachmentDevice
+ volume_attachment_device_model['id'] = '80b3e36e-41f4-40e9-bd56-beae81792a68'
- vpcdns_resolver_prototype_model = {} # VPCDNSResolverPrototypeVPCDNSResolverTypeManualPrototype
- vpcdns_resolver_prototype_model['manual_servers'] = [dns_server_prototype_model]
- vpcdns_resolver_prototype_model['type'] = 'manual'
+ volume_reference_volume_attachment_context_deleted_model = {} # VolumeReferenceVolumeAttachmentContextDeleted
+ volume_reference_volume_attachment_context_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Construct a json representation of a VPCDNSPrototype model
- vpcdns_prototype_model_json = {}
- vpcdns_prototype_model_json['enable_hub'] = False
- vpcdns_prototype_model_json['resolver'] = vpcdns_resolver_prototype_model
+ volume_reference_volume_attachment_context_model = {} # VolumeReferenceVolumeAttachmentContext
+ volume_reference_volume_attachment_context_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
+ volume_reference_volume_attachment_context_model['deleted'] = volume_reference_volume_attachment_context_deleted_model
+ volume_reference_volume_attachment_context_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
+ volume_reference_volume_attachment_context_model['id'] = '1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
+ volume_reference_volume_attachment_context_model['name'] = 'my-volume'
+ volume_reference_volume_attachment_context_model['resource_type'] = 'volume'
- # Construct a model instance of VPCDNSPrototype by calling from_dict on the json representation
- vpcdns_prototype_model = VPCDNSPrototype.from_dict(vpcdns_prototype_model_json)
- assert vpcdns_prototype_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_volume_attachment_context_model
- # Construct a model instance of VPCDNSPrototype by calling from_dict on the json representation
- vpcdns_prototype_model_dict = VPCDNSPrototype.from_dict(vpcdns_prototype_model_json).__dict__
- vpcdns_prototype_model2 = VPCDNSPrototype(**vpcdns_prototype_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 vpcdns_prototype_model == vpcdns_prototype_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
- vpcdns_prototype_model_json2 = vpcdns_prototype_model.to_dict()
- assert vpcdns_prototype_model_json2 == vpcdns_prototype_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_VPCDNSResolutionBinding:
+class TestModel_VolumeAttachmentReferenceInstanceContextDeleted:
"""
- Test Class for VPCDNSResolutionBinding
+ Test Class for VolumeAttachmentReferenceInstanceContextDeleted
"""
- def test_vpcdns_resolution_binding_serialization(self):
+ def test_volume_attachment_reference_instance_context_deleted_serialization(self):
"""
- Test serialization/deserialization for VPCDNSResolutionBinding
+ Test serialization/deserialization for VolumeAttachmentReferenceInstanceContextDeleted
+ """
+
+ # 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 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 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 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
+ 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_VolumeAttachmentReferenceVolumeContext:
+ """
+ Test Class for VolumeAttachmentReferenceVolumeContext
+ """
+
+ def test_volume_attachment_reference_volume_context_serialization(self):
+ """
+ Test serialization/deserialization for VolumeAttachmentReferenceVolumeContext
"""
# Construct dict forms of any model objects needed in order to build this model.
- account_reference_model = {} # AccountReference
- account_reference_model['id'] = 'aa2432b1fa4d4ace891e9b80fc104e34'
- account_reference_model['resource_type'] = 'account'
+ 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'
- endpoint_gateway_remote_model = {} # EndpointGatewayRemote
- endpoint_gateway_remote_model['account'] = account_reference_model
- endpoint_gateway_remote_model['region'] = region_reference_model
+ instance_reference_deleted_model = {} # InstanceReferenceDeleted
+ instance_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- endpoint_gateway_reference_remote_model = {} # EndpointGatewayReferenceRemote
- endpoint_gateway_reference_remote_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5'
- endpoint_gateway_reference_remote_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5'
- endpoint_gateway_reference_remote_model['id'] = 'r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5'
- endpoint_gateway_reference_remote_model['name'] = 'my-endpoint-gateway'
- endpoint_gateway_reference_remote_model['remote'] = endpoint_gateway_remote_model
- endpoint_gateway_reference_remote_model['resource_type'] = 'endpoint_gateway'
+ 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'
- vpc_remote_model = {} # VPCRemote
- vpc_remote_model['account'] = account_reference_model
- vpc_remote_model['region'] = region_reference_model
+ # 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'
- vpc_reference_remote_model = {} # VPCReferenceRemote
- vpc_reference_remote_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b'
- vpc_reference_remote_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b'
- vpc_reference_remote_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b'
- vpc_reference_remote_model['name'] = 'my-vpc'
- vpc_reference_remote_model['remote'] = vpc_remote_model
- vpc_reference_remote_model['resource_type'] = 'vpc'
+ # 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 json representation of a VPCDNSResolutionBinding model
- vpcdns_resolution_binding_model_json = {}
- vpcdns_resolution_binding_model_json['created_at'] = '2019-01-01T12:00:00Z'
- vpcdns_resolution_binding_model_json['endpoint_gateways'] = [endpoint_gateway_reference_remote_model]
- vpcdns_resolution_binding_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-982d72b7-db1b-4606-afb2-ed6bd4b0bed1/dns_resolution_bindings/r006-8a524686-fcf6-4947-a59b-188c1ed78ad1'
- vpcdns_resolution_binding_model_json['id'] = 'r006-8a524686-fcf6-4947-a59b-188c1ed78ad1'
- vpcdns_resolution_binding_model_json['lifecycle_state'] = 'stable'
- vpcdns_resolution_binding_model_json['name'] = 'my-dns-resolution-binding'
- vpcdns_resolution_binding_model_json['resource_type'] = 'vpc_dns_resolution_binding'
- vpcdns_resolution_binding_model_json['vpc'] = vpc_reference_remote_model
+ # 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 model instance of VPCDNSResolutionBinding by calling from_dict on the json representation
- vpcdns_resolution_binding_model = VPCDNSResolutionBinding.from_dict(vpcdns_resolution_binding_model_json)
- assert vpcdns_resolution_binding_model != False
+ # Verify the model instances are equivalent
+ assert volume_attachment_reference_volume_context_model == volume_attachment_reference_volume_context_model2
- # Construct a model instance of VPCDNSResolutionBinding by calling from_dict on the json representation
- vpcdns_resolution_binding_model_dict = VPCDNSResolutionBinding.from_dict(vpcdns_resolution_binding_model_json).__dict__
- vpcdns_resolution_binding_model2 = VPCDNSResolutionBinding(**vpcdns_resolution_binding_model_dict)
+ # 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
+
+
+class TestModel_VolumeAttachmentReferenceVolumeContextDeleted:
+ """
+ Test Class for VolumeAttachmentReferenceVolumeContextDeleted
+ """
+
+ def test_volume_attachment_reference_volume_context_deleted_serialization(self):
+ """
+ Test serialization/deserialization for VolumeAttachmentReferenceVolumeContextDeleted
+ """
+
+ # 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 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 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 vpcdns_resolution_binding_model == vpcdns_resolution_binding_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
- vpcdns_resolution_binding_model_json2 = vpcdns_resolution_binding_model.to_dict()
- assert vpcdns_resolution_binding_model_json2 == vpcdns_resolution_binding_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_VPCDNSResolutionBindingCollection:
+class TestModel_VolumeCollection:
"""
- Test Class for VPCDNSResolutionBindingCollection
+ Test Class for VolumeCollection
"""
- def test_vpcdns_resolution_binding_collection_serialization(self):
+ def test_volume_collection_serialization(self):
"""
- Test serialization/deserialization for VPCDNSResolutionBindingCollection
+ Test serialization/deserialization for VolumeCollection
"""
# Construct dict forms of any model objects needed in order to build this model.
+ volume_collection_first_model = {} # VolumeCollectionFirst
+ volume_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volumes?limit=20'
+
+ volume_collection_next_model = {} # VolumeCollectionNext
+ volume_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volumes?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
+
+ encryption_key_reference_model = {} # EncryptionKeyReference
+ encryption_key_reference_model['crn'] = 'crn:v1:bluemix:public:kms:us-south:a/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179'
+
+ volume_health_reason_model = {} # VolumeHealthReason
+ volume_health_reason_model['code'] = 'initializing_from_snapshot'
+ volume_health_reason_model['message'] = 'Performance will be degraded while this volume is being initialized from its snapshot'
+ volume_health_reason_model['more_info'] = 'https://cloud.ibm.com/docs/vpc?topic=vpc-snapshots-vpc-troubleshooting&interface=ui#snapshot_ts_degraded_perf'
+
+ operating_system_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'
+
+ 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'
+
+ image_reference_deleted_model = {} # ImageReferenceDeleted
+ image_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+
account_reference_model = {} # AccountReference
account_reference_model['id'] = 'aa2432b1fa4d4ace891e9b80fc104e34'
account_reference_model['resource_type'] = 'account'
@@ -63951,1242 +74079,1478 @@ def test_vpcdns_resolution_binding_collection_serialization(self):
region_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south'
region_reference_model['name'] = 'us-south'
- endpoint_gateway_remote_model = {} # EndpointGatewayRemote
- endpoint_gateway_remote_model['account'] = account_reference_model
- endpoint_gateway_remote_model['region'] = region_reference_model
+ image_remote_model = {} # ImageRemote
+ image_remote_model['account'] = account_reference_model
+ image_remote_model['region'] = region_reference_model
- endpoint_gateway_reference_remote_model = {} # EndpointGatewayReferenceRemote
- endpoint_gateway_reference_remote_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5'
- endpoint_gateway_reference_remote_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5'
- endpoint_gateway_reference_remote_model['id'] = 'r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5'
- endpoint_gateway_reference_remote_model['name'] = 'my-endpoint-gateway'
- endpoint_gateway_reference_remote_model['remote'] = endpoint_gateway_remote_model
- endpoint_gateway_reference_remote_model['resource_type'] = 'endpoint_gateway'
+ 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'
+ image_reference_model['remote'] = image_remote_model
+ image_reference_model['resource_type'] = 'image'
- vpc_remote_model = {} # VPCRemote
- vpc_remote_model['account'] = account_reference_model
- vpc_remote_model['region'] = region_reference_model
+ snapshot_reference_deleted_model = {} # SnapshotReferenceDeleted
+ snapshot_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- vpc_reference_remote_model = {} # VPCReferenceRemote
- vpc_reference_remote_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b'
- vpc_reference_remote_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b'
- vpc_reference_remote_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b'
- vpc_reference_remote_model['name'] = 'my-vpc'
- vpc_reference_remote_model['remote'] = vpc_remote_model
- vpc_reference_remote_model['resource_type'] = 'vpc'
+ snapshot_remote_model = {} # SnapshotRemote
+ snapshot_remote_model['region'] = region_reference_model
- vpcdns_resolution_binding_model = {} # VPCDNSResolutionBinding
- vpcdns_resolution_binding_model['created_at'] = '2019-01-01T12:00:00Z'
- vpcdns_resolution_binding_model['endpoint_gateways'] = [endpoint_gateway_reference_remote_model]
- vpcdns_resolution_binding_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-982d72b7-db1b-4606-afb2-ed6bd4b0bed1/dns_resolution_bindings/r006-8a524686-fcf6-4947-a59b-188c1ed78ad1'
- vpcdns_resolution_binding_model['id'] = 'r006-8a524686-fcf6-4947-a59b-188c1ed78ad1'
- vpcdns_resolution_binding_model['lifecycle_state'] = 'stable'
- vpcdns_resolution_binding_model['name'] = 'my-dns-resolution-binding'
- vpcdns_resolution_binding_model['resource_type'] = 'vpc_dns_resolution_binding'
- vpcdns_resolution_binding_model['vpc'] = vpc_reference_remote_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['remote'] = snapshot_remote_model
+ snapshot_reference_model['resource_type'] = 'snapshot'
- vpcdns_resolution_binding_collection_first_model = {} # VPCDNSResolutionBindingCollectionFirst
- vpcdns_resolution_binding_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-982d72b7-db1b-4606-afb2-ed6bd4b0bed1/dns_resolution_bindings?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'
- vpcdns_resolution_binding_collection_next_model = {} # VPCDNSResolutionBindingCollectionNext
- vpcdns_resolution_binding_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-982d72b7-db1b-4606-afb2-ed6bd4b0bed1/dns_resolution_bindings?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
+ 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 VPCDNSResolutionBindingCollection model
- vpcdns_resolution_binding_collection_model_json = {}
- vpcdns_resolution_binding_collection_model_json['dns_resolution_bindings'] = [vpcdns_resolution_binding_model]
- vpcdns_resolution_binding_collection_model_json['first'] = vpcdns_resolution_binding_collection_first_model
- vpcdns_resolution_binding_collection_model_json['limit'] = 20
- vpcdns_resolution_binding_collection_model_json['next'] = vpcdns_resolution_binding_collection_next_model
- vpcdns_resolution_binding_collection_model_json['total_count'] = 132
+ volume_attachment_device_model = {} # VolumeAttachmentDevice
+ volume_attachment_device_model['id'] = '80b3e36e-41f4-40e9-bd56-beae81792a68'
- # Construct a model instance of VPCDNSResolutionBindingCollection by calling from_dict on the json representation
- vpcdns_resolution_binding_collection_model = VPCDNSResolutionBindingCollection.from_dict(vpcdns_resolution_binding_collection_model_json)
- assert vpcdns_resolution_binding_collection_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 VPCDNSResolutionBindingCollection by calling from_dict on the json representation
- vpcdns_resolution_binding_collection_model_dict = VPCDNSResolutionBindingCollection.from_dict(vpcdns_resolution_binding_collection_model_json).__dict__
- vpcdns_resolution_binding_collection_model2 = VPCDNSResolutionBindingCollection(**vpcdns_resolution_binding_collection_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'
+
+ 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'
+
+ 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_model = {} # Volume
+ volume_model['active'] = True
+ volume_model['attachment_state'] = 'attached'
+ 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['health_reasons'] = [volume_health_reason_model]
+ volume_model['health_state'] = 'ok'
+ volume_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
+ volume_model['id'] = '1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
+ volume_model['iops'] = 10000
+ volume_model['name'] = 'my-volume'
+ volume_model['operating_system'] = operating_system_model
+ volume_model['profile'] = volume_profile_reference_model
+ volume_model['resource_group'] = resource_group_reference_model
+ volume_model['resource_type'] = 'volume'
+ 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['user_tags'] = ['testString']
+ volume_model['volume_attachments'] = [volume_attachment_reference_volume_context_model]
+ volume_model['zone'] = zone_reference_model
+
+ # 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['total_count'] = 132
+ 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 vpcdns_resolution_binding_collection_model == vpcdns_resolution_binding_collection_model2
+ assert volume_collection_model == volume_collection_model2
# Convert model instance back to dict and verify no loss of data
- vpcdns_resolution_binding_collection_model_json2 = vpcdns_resolution_binding_collection_model.to_dict()
- assert vpcdns_resolution_binding_collection_model_json2 == vpcdns_resolution_binding_collection_model_json
+ volume_collection_model_json2 = volume_collection_model.to_dict()
+ assert volume_collection_model_json2 == volume_collection_model_json
-class TestModel_VPCDNSResolutionBindingCollectionFirst:
+class TestModel_VolumeCollectionFirst:
"""
- Test Class for VPCDNSResolutionBindingCollectionFirst
+ Test Class for VolumeCollectionFirst
"""
- def test_vpcdns_resolution_binding_collection_first_serialization(self):
+ def test_volume_collection_first_serialization(self):
"""
- Test serialization/deserialization for VPCDNSResolutionBindingCollectionFirst
+ Test serialization/deserialization for VolumeCollectionFirst
"""
- # Construct a json representation of a VPCDNSResolutionBindingCollectionFirst model
- vpcdns_resolution_binding_collection_first_model_json = {}
- vpcdns_resolution_binding_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-982d72b7-db1b-4606-afb2-ed6bd4b0bed1/dns_resolution_bindings?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 VPCDNSResolutionBindingCollectionFirst by calling from_dict on the json representation
- vpcdns_resolution_binding_collection_first_model = VPCDNSResolutionBindingCollectionFirst.from_dict(vpcdns_resolution_binding_collection_first_model_json)
- assert vpcdns_resolution_binding_collection_first_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 VPCDNSResolutionBindingCollectionFirst by calling from_dict on the json representation
- vpcdns_resolution_binding_collection_first_model_dict = VPCDNSResolutionBindingCollectionFirst.from_dict(vpcdns_resolution_binding_collection_first_model_json).__dict__
- vpcdns_resolution_binding_collection_first_model2 = VPCDNSResolutionBindingCollectionFirst(**vpcdns_resolution_binding_collection_first_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 vpcdns_resolution_binding_collection_first_model == vpcdns_resolution_binding_collection_first_model2
+ assert volume_collection_first_model == volume_collection_first_model2
# Convert model instance back to dict and verify no loss of data
- vpcdns_resolution_binding_collection_first_model_json2 = vpcdns_resolution_binding_collection_first_model.to_dict()
- assert vpcdns_resolution_binding_collection_first_model_json2 == vpcdns_resolution_binding_collection_first_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_VPCDNSResolutionBindingCollectionNext:
+class TestModel_VolumeCollectionNext:
"""
- Test Class for VPCDNSResolutionBindingCollectionNext
+ Test Class for VolumeCollectionNext
"""
- def test_vpcdns_resolution_binding_collection_next_serialization(self):
+ def test_volume_collection_next_serialization(self):
"""
- Test serialization/deserialization for VPCDNSResolutionBindingCollectionNext
+ Test serialization/deserialization for VolumeCollectionNext
"""
- # Construct a json representation of a VPCDNSResolutionBindingCollectionNext model
- vpcdns_resolution_binding_collection_next_model_json = {}
- vpcdns_resolution_binding_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-982d72b7-db1b-4606-afb2-ed6bd4b0bed1/dns_resolution_bindings?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
+ # 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 VPCDNSResolutionBindingCollectionNext by calling from_dict on the json representation
- vpcdns_resolution_binding_collection_next_model = VPCDNSResolutionBindingCollectionNext.from_dict(vpcdns_resolution_binding_collection_next_model_json)
- assert vpcdns_resolution_binding_collection_next_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 VPCDNSResolutionBindingCollectionNext by calling from_dict on the json representation
- vpcdns_resolution_binding_collection_next_model_dict = VPCDNSResolutionBindingCollectionNext.from_dict(vpcdns_resolution_binding_collection_next_model_json).__dict__
- vpcdns_resolution_binding_collection_next_model2 = VPCDNSResolutionBindingCollectionNext(**vpcdns_resolution_binding_collection_next_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 vpcdns_resolution_binding_collection_next_model == vpcdns_resolution_binding_collection_next_model2
+ assert volume_collection_next_model == volume_collection_next_model2
# Convert model instance back to dict and verify no loss of data
- vpcdns_resolution_binding_collection_next_model_json2 = vpcdns_resolution_binding_collection_next_model.to_dict()
- assert vpcdns_resolution_binding_collection_next_model_json2 == vpcdns_resolution_binding_collection_next_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_VPCDNSResolutionBindingPatch:
+class TestModel_VolumeHealthReason:
"""
- Test Class for VPCDNSResolutionBindingPatch
+ Test Class for VolumeHealthReason
"""
- def test_vpcdns_resolution_binding_patch_serialization(self):
+ def test_volume_health_reason_serialization(self):
"""
- Test serialization/deserialization for VPCDNSResolutionBindingPatch
+ Test serialization/deserialization for VolumeHealthReason
"""
- # Construct a json representation of a VPCDNSResolutionBindingPatch model
- vpcdns_resolution_binding_patch_model_json = {}
- vpcdns_resolution_binding_patch_model_json['name'] = 'my-dns-resolution-binding-updated'
+ # Construct a json representation of a VolumeHealthReason model
+ volume_health_reason_model_json = {}
+ volume_health_reason_model_json['code'] = 'initializing_from_snapshot'
+ volume_health_reason_model_json['message'] = 'Performance will be degraded while this volume is being initialized from its snapshot'
+ volume_health_reason_model_json['more_info'] = 'https://cloud.ibm.com/docs/vpc?topic=vpc-snapshots-vpc-troubleshooting&interface=ui#snapshot_ts_degraded_perf'
- # Construct a model instance of VPCDNSResolutionBindingPatch by calling from_dict on the json representation
- vpcdns_resolution_binding_patch_model = VPCDNSResolutionBindingPatch.from_dict(vpcdns_resolution_binding_patch_model_json)
- assert vpcdns_resolution_binding_patch_model != False
+ # Construct a model instance of VolumeHealthReason by calling from_dict on the json representation
+ volume_health_reason_model = VolumeHealthReason.from_dict(volume_health_reason_model_json)
+ assert volume_health_reason_model != False
- # Construct a model instance of VPCDNSResolutionBindingPatch by calling from_dict on the json representation
- vpcdns_resolution_binding_patch_model_dict = VPCDNSResolutionBindingPatch.from_dict(vpcdns_resolution_binding_patch_model_json).__dict__
- vpcdns_resolution_binding_patch_model2 = VPCDNSResolutionBindingPatch(**vpcdns_resolution_binding_patch_model_dict)
+ # Construct a model instance of VolumeHealthReason by calling from_dict on the json representation
+ volume_health_reason_model_dict = VolumeHealthReason.from_dict(volume_health_reason_model_json).__dict__
+ volume_health_reason_model2 = VolumeHealthReason(**volume_health_reason_model_dict)
# Verify the model instances are equivalent
- assert vpcdns_resolution_binding_patch_model == vpcdns_resolution_binding_patch_model2
+ assert volume_health_reason_model == volume_health_reason_model2
# Convert model instance back to dict and verify no loss of data
- vpcdns_resolution_binding_patch_model_json2 = vpcdns_resolution_binding_patch_model.to_dict()
- assert vpcdns_resolution_binding_patch_model_json2 == vpcdns_resolution_binding_patch_model_json
+ volume_health_reason_model_json2 = volume_health_reason_model.to_dict()
+ assert volume_health_reason_model_json2 == volume_health_reason_model_json
-class TestModel_VPCDNSResolverPatch:
+class TestModel_VolumePatch:
"""
- Test Class for VPCDNSResolverPatch
+ Test Class for VolumePatch
"""
- def test_vpcdns_resolver_patch_serialization(self):
+ def test_volume_patch_serialization(self):
"""
- Test serialization/deserialization for VPCDNSResolverPatch
+ Test serialization/deserialization for VolumePatch
"""
# 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'
-
- dns_server_prototype_model = {} # DNSServerPrototype
- dns_server_prototype_model['address'] = '192.168.3.4'
- dns_server_prototype_model['zone_affinity'] = zone_identity_model
-
- vpcdns_resolver_vpc_patch_model = {} # VPCDNSResolverVPCPatchVPCIdentityById
- vpcdns_resolver_vpc_patch_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b'
+ volume_profile_identity_model = {} # VolumeProfileIdentityByName
+ volume_profile_identity_model['name'] = 'general-purpose'
- # Construct a json representation of a VPCDNSResolverPatch model
- vpcdns_resolver_patch_model_json = {}
- vpcdns_resolver_patch_model_json['manual_servers'] = [dns_server_prototype_model]
- vpcdns_resolver_patch_model_json['type'] = 'delegated'
- vpcdns_resolver_patch_model_json['vpc'] = vpcdns_resolver_vpc_patch_model
+ # 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
+ volume_patch_model_json['user_tags'] = ['testString']
- # Construct a model instance of VPCDNSResolverPatch by calling from_dict on the json representation
- vpcdns_resolver_patch_model = VPCDNSResolverPatch.from_dict(vpcdns_resolver_patch_model_json)
- assert vpcdns_resolver_patch_model != False
+ # 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 VPCDNSResolverPatch by calling from_dict on the json representation
- vpcdns_resolver_patch_model_dict = VPCDNSResolverPatch.from_dict(vpcdns_resolver_patch_model_json).__dict__
- vpcdns_resolver_patch_model2 = VPCDNSResolverPatch(**vpcdns_resolver_patch_model_dict)
+ # 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 vpcdns_resolver_patch_model == vpcdns_resolver_patch_model2
+ assert volume_patch_model == volume_patch_model2
# Convert model instance back to dict and verify no loss of data
- vpcdns_resolver_patch_model_json2 = vpcdns_resolver_patch_model.to_dict()
- assert vpcdns_resolver_patch_model_json2 == vpcdns_resolver_patch_model_json
+ volume_patch_model_json2 = volume_patch_model.to_dict()
+ assert volume_patch_model_json2 == volume_patch_model_json
-class TestModel_VPCHealthReason:
+class TestModel_VolumeProfile:
"""
- Test Class for VPCHealthReason
+ Test Class for VolumeProfile
"""
- def test_vpc_health_reason_serialization(self):
+ def test_volume_profile_serialization(self):
"""
- Test serialization/deserialization for VPCHealthReason
+ Test serialization/deserialization for VolumeProfile
"""
- # Construct a json representation of a VPCHealthReason model
- vpc_health_reason_model_json = {}
- vpc_health_reason_model_json['code'] = 'internal_error'
- vpc_health_reason_model_json['message'] = 'Internal error (contact IBM support).'
- vpc_health_reason_model_json['more_info'] = 'https://cloud.ibm.com/docs/vpc?topic=vpc-troubleshoot-hub-spoke-1'
+ # 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 VPCHealthReason by calling from_dict on the json representation
- vpc_health_reason_model = VPCHealthReason.from_dict(vpc_health_reason_model_json)
- assert vpc_health_reason_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 VPCHealthReason by calling from_dict on the json representation
- vpc_health_reason_model_dict = VPCHealthReason.from_dict(vpc_health_reason_model_json).__dict__
- vpc_health_reason_model2 = VPCHealthReason(**vpc_health_reason_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 vpc_health_reason_model == vpc_health_reason_model2
+ assert volume_profile_model == volume_profile_model2
# Convert model instance back to dict and verify no loss of data
- vpc_health_reason_model_json2 = vpc_health_reason_model.to_dict()
- assert vpc_health_reason_model_json2 == vpc_health_reason_model_json
+ volume_profile_model_json2 = volume_profile_model.to_dict()
+ assert volume_profile_model_json2 == volume_profile_model_json
-class TestModel_VPCPatch:
+class TestModel_VolumeProfileCollection:
"""
- Test Class for VPCPatch
+ Test Class for VolumeProfileCollection
"""
- def test_vpc_patch_serialization(self):
+ def test_volume_profile_collection_serialization(self):
"""
- Test serialization/deserialization for VPCPatch
+ Test serialization/deserialization for VolumeProfileCollection
"""
# 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'
-
- dns_server_prototype_model = {} # DNSServerPrototype
- dns_server_prototype_model['address'] = '192.168.3.4'
- dns_server_prototype_model['zone_affinity'] = zone_identity_model
-
- vpcdns_resolver_vpc_patch_model = {} # VPCDNSResolverVPCPatchVPCIdentityById
- vpcdns_resolver_vpc_patch_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b'
+ volume_profile_collection_first_model = {} # VolumeProfileCollectionFirst
+ volume_profile_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volume/profiles?limit=20'
- vpcdns_resolver_patch_model = {} # VPCDNSResolverPatch
- vpcdns_resolver_patch_model['manual_servers'] = [dns_server_prototype_model]
- vpcdns_resolver_patch_model['type'] = 'delegated'
- vpcdns_resolver_patch_model['vpc'] = vpcdns_resolver_vpc_patch_model
+ 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'
- vpcdns_patch_model = {} # VPCDNSPatch
- vpcdns_patch_model['enable_hub'] = True
- vpcdns_patch_model['resolver'] = vpcdns_resolver_patch_model
+ 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 VPCPatch model
- vpc_patch_model_json = {}
- vpc_patch_model_json['dns'] = vpcdns_patch_model
- vpc_patch_model_json['name'] = 'my-vpc'
+ # 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 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 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 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 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 vpc_patch_model == vpc_patch_model2
+ assert volume_profile_collection_model == volume_profile_collection_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_profile_collection_model_json2 = volume_profile_collection_model.to_dict()
+ assert volume_profile_collection_model_json2 == volume_profile_collection_model_json
-class TestModel_VPCReference:
+class TestModel_VolumeProfileCollectionFirst:
"""
- Test Class for VPCReference
+ Test Class for VolumeProfileCollectionFirst
"""
- def test_vpc_reference_serialization(self):
+ def test_volume_profile_collection_first_serialization(self):
"""
- Test serialization/deserialization for VPCReference
+ Test serialization/deserialization for VolumeProfileCollectionFirst
"""
- # 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'
-
- # 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'
- vpc_reference_model_json['resource_type'] = 'vpc'
+ # 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 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 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 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)
+ # 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 vpc_reference_model == vpc_reference_model2
+ assert volume_profile_collection_first_model == volume_profile_collection_first_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_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_VPCReferenceDNSResolverContext:
+class TestModel_VolumeProfileCollectionNext:
"""
- Test Class for VPCReferenceDNSResolverContext
+ Test Class for VolumeProfileCollectionNext
"""
- def test_vpc_reference_dns_resolver_context_serialization(self):
+ def test_volume_profile_collection_next_serialization(self):
"""
- Test serialization/deserialization for VPCReferenceDNSResolverContext
+ Test serialization/deserialization for VolumeProfileCollectionNext
"""
- # Construct dict forms of any model objects needed in order to build this model.
-
- vpc_reference_dns_resolver_context_deleted_model = {} # VPCReferenceDNSResolverContextDeleted
- vpc_reference_dns_resolver_context_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
-
- account_reference_model = {} # AccountReference
- account_reference_model['id'] = 'aa2432b1fa4d4ace891e9b80fc104e34'
- account_reference_model['resource_type'] = 'account'
-
- 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'
-
- vpc_remote_model = {} # VPCRemote
- vpc_remote_model['account'] = account_reference_model
- vpc_remote_model['region'] = region_reference_model
-
- # Construct a json representation of a VPCReferenceDNSResolverContext model
- vpc_reference_dns_resolver_context_model_json = {}
- vpc_reference_dns_resolver_context_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b'
- vpc_reference_dns_resolver_context_model_json['deleted'] = vpc_reference_dns_resolver_context_deleted_model
- vpc_reference_dns_resolver_context_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b'
- vpc_reference_dns_resolver_context_model_json['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b'
- vpc_reference_dns_resolver_context_model_json['name'] = 'my-vpc'
- vpc_reference_dns_resolver_context_model_json['remote'] = vpc_remote_model
- vpc_reference_dns_resolver_context_model_json['resource_type'] = 'vpc'
+ # 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 VPCReferenceDNSResolverContext by calling from_dict on the json representation
- vpc_reference_dns_resolver_context_model = VPCReferenceDNSResolverContext.from_dict(vpc_reference_dns_resolver_context_model_json)
- assert vpc_reference_dns_resolver_context_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 VPCReferenceDNSResolverContext by calling from_dict on the json representation
- vpc_reference_dns_resolver_context_model_dict = VPCReferenceDNSResolverContext.from_dict(vpc_reference_dns_resolver_context_model_json).__dict__
- vpc_reference_dns_resolver_context_model2 = VPCReferenceDNSResolverContext(**vpc_reference_dns_resolver_context_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 vpc_reference_dns_resolver_context_model == vpc_reference_dns_resolver_context_model2
+ assert volume_profile_collection_next_model == volume_profile_collection_next_model2
# Convert model instance back to dict and verify no loss of data
- vpc_reference_dns_resolver_context_model_json2 = vpc_reference_dns_resolver_context_model.to_dict()
- assert vpc_reference_dns_resolver_context_model_json2 == vpc_reference_dns_resolver_context_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_VPCReferenceDNSResolverContextDeleted:
+class TestModel_VolumeProfileReference:
"""
- Test Class for VPCReferenceDNSResolverContextDeleted
+ Test Class for VolumeProfileReference
"""
- def test_vpc_reference_dns_resolver_context_deleted_serialization(self):
+ def test_volume_profile_reference_serialization(self):
"""
- Test serialization/deserialization for VPCReferenceDNSResolverContextDeleted
+ Test serialization/deserialization for VolumeProfileReference
"""
- # Construct a json representation of a VPCReferenceDNSResolverContextDeleted model
- vpc_reference_dns_resolver_context_deleted_model_json = {}
- vpc_reference_dns_resolver_context_deleted_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
-
- # Construct a model instance of VPCReferenceDNSResolverContextDeleted by calling from_dict on the json representation
- vpc_reference_dns_resolver_context_deleted_model = VPCReferenceDNSResolverContextDeleted.from_dict(vpc_reference_dns_resolver_context_deleted_model_json)
- assert vpc_reference_dns_resolver_context_deleted_model != False
+ # 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 VPCReferenceDNSResolverContextDeleted by calling from_dict on the json representation
- vpc_reference_dns_resolver_context_deleted_model_dict = VPCReferenceDNSResolverContextDeleted.from_dict(vpc_reference_dns_resolver_context_deleted_model_json).__dict__
- vpc_reference_dns_resolver_context_deleted_model2 = VPCReferenceDNSResolverContextDeleted(**vpc_reference_dns_resolver_context_deleted_model_dict)
+ # 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 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 vpc_reference_dns_resolver_context_deleted_model == vpc_reference_dns_resolver_context_deleted_model2
+ assert volume_profile_reference_model == volume_profile_reference_model2
# Convert model instance back to dict and verify no loss of data
- vpc_reference_dns_resolver_context_deleted_model_json2 = vpc_reference_dns_resolver_context_deleted_model.to_dict()
- assert vpc_reference_dns_resolver_context_deleted_model_json2 == vpc_reference_dns_resolver_context_deleted_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_VPCReferenceDeleted:
+class TestModel_VolumePrototypeInstanceByImageContext:
"""
- Test Class for VPCReferenceDeleted
+ Test Class for VolumePrototypeInstanceByImageContext
"""
- def test_vpc_reference_deleted_serialization(self):
+ def test_volume_prototype_instance_by_image_context_serialization(self):
"""
- Test serialization/deserialization for VPCReferenceDeleted
+ Test serialization/deserialization for VolumePrototypeInstanceByImageContext
"""
- # 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 dict forms of any model objects needed in order to build this model.
- # 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
+ encryption_key_identity_model = {} # EncryptionKeyIdentityByCRN
+ encryption_key_identity_model['crn'] = 'crn:v1:bluemix:public:kms:us-south:a/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179'
- # 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)
+ volume_profile_identity_model = {} # VolumeProfileIdentityByName
+ volume_profile_identity_model['name'] = 'general-purpose'
+
+ resource_group_identity_model = {} # ResourceGroupIdentityById
+ resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
+
+ # 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'] = 100
+ 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
+ volume_prototype_instance_by_image_context_model_json['resource_group'] = resource_group_identity_model
+ volume_prototype_instance_by_image_context_model_json['user_tags'] = []
+
+ # 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 vpc_reference_deleted_model == vpc_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
- vpc_reference_deleted_model_json2 = vpc_reference_deleted_model.to_dict()
- assert vpc_reference_deleted_model_json2 == vpc_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_VPCReferenceRemote:
+class TestModel_VolumePrototypeInstanceBySourceSnapshotContext:
"""
- Test Class for VPCReferenceRemote
+ Test Class for VolumePrototypeInstanceBySourceSnapshotContext
"""
- def test_vpc_reference_remote_serialization(self):
+ def test_volume_prototype_instance_by_source_snapshot_context_serialization(self):
"""
- Test serialization/deserialization for VPCReferenceRemote
+ Test serialization/deserialization for VolumePrototypeInstanceBySourceSnapshotContext
"""
# Construct dict forms of any model objects needed in order to build this model.
- account_reference_model = {} # AccountReference
- account_reference_model['id'] = 'aa2432b1fa4d4ace891e9b80fc104e34'
- account_reference_model['resource_type'] = 'account'
+ encryption_key_identity_model = {} # EncryptionKeyIdentityByCRN
+ encryption_key_identity_model['crn'] = 'crn:v1:bluemix:public:kms:us-south:a/123456: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'
+ volume_profile_identity_model = {} # VolumeProfileIdentityByName
+ volume_profile_identity_model['name'] = 'general-purpose'
- vpc_remote_model = {} # VPCRemote
- vpc_remote_model['account'] = account_reference_model
- vpc_remote_model['region'] = region_reference_model
+ resource_group_identity_model = {} # ResourceGroupIdentityById
+ resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
- # Construct a json representation of a VPCReferenceRemote model
- vpc_reference_remote_model_json = {}
- vpc_reference_remote_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b'
- vpc_reference_remote_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b'
- vpc_reference_remote_model_json['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b'
- vpc_reference_remote_model_json['name'] = 'my-vpc'
- vpc_reference_remote_model_json['remote'] = vpc_remote_model
- vpc_reference_remote_model_json['resource_type'] = 'vpc'
+ snapshot_identity_model = {} # SnapshotIdentityById
+ snapshot_identity_model['id'] = '349a61d8-7ab1-420f-a690-5fed76ef9d4f'
- # Construct a model instance of VPCReferenceRemote by calling from_dict on the json representation
- vpc_reference_remote_model = VPCReferenceRemote.from_dict(vpc_reference_remote_model_json)
- assert vpc_reference_remote_model != False
+ # Construct a json representation of a VolumePrototypeInstanceBySourceSnapshotContext model
+ volume_prototype_instance_by_source_snapshot_context_model_json = {}
+ volume_prototype_instance_by_source_snapshot_context_model_json['capacity'] = 100
+ volume_prototype_instance_by_source_snapshot_context_model_json['encryption_key'] = encryption_key_identity_model
+ volume_prototype_instance_by_source_snapshot_context_model_json['iops'] = 10000
+ volume_prototype_instance_by_source_snapshot_context_model_json['name'] = 'my-volume'
+ volume_prototype_instance_by_source_snapshot_context_model_json['profile'] = volume_profile_identity_model
+ volume_prototype_instance_by_source_snapshot_context_model_json['resource_group'] = resource_group_identity_model
+ volume_prototype_instance_by_source_snapshot_context_model_json['source_snapshot'] = snapshot_identity_model
+ volume_prototype_instance_by_source_snapshot_context_model_json['user_tags'] = []
- # Construct a model instance of VPCReferenceRemote by calling from_dict on the json representation
- vpc_reference_remote_model_dict = VPCReferenceRemote.from_dict(vpc_reference_remote_model_json).__dict__
- vpc_reference_remote_model2 = VPCReferenceRemote(**vpc_reference_remote_model_dict)
+ # Construct a model instance of VolumePrototypeInstanceBySourceSnapshotContext by calling from_dict on the json representation
+ volume_prototype_instance_by_source_snapshot_context_model = VolumePrototypeInstanceBySourceSnapshotContext.from_dict(volume_prototype_instance_by_source_snapshot_context_model_json)
+ assert volume_prototype_instance_by_source_snapshot_context_model != False
+
+ # Construct a model instance of VolumePrototypeInstanceBySourceSnapshotContext by calling from_dict on the json representation
+ volume_prototype_instance_by_source_snapshot_context_model_dict = VolumePrototypeInstanceBySourceSnapshotContext.from_dict(volume_prototype_instance_by_source_snapshot_context_model_json).__dict__
+ volume_prototype_instance_by_source_snapshot_context_model2 = VolumePrototypeInstanceBySourceSnapshotContext(**volume_prototype_instance_by_source_snapshot_context_model_dict)
# Verify the model instances are equivalent
- assert vpc_reference_remote_model == vpc_reference_remote_model2
+ assert volume_prototype_instance_by_source_snapshot_context_model == volume_prototype_instance_by_source_snapshot_context_model2
# Convert model instance back to dict and verify no loss of data
- vpc_reference_remote_model_json2 = vpc_reference_remote_model.to_dict()
- assert vpc_reference_remote_model_json2 == vpc_reference_remote_model_json
+ volume_prototype_instance_by_source_snapshot_context_model_json2 = volume_prototype_instance_by_source_snapshot_context_model.to_dict()
+ assert volume_prototype_instance_by_source_snapshot_context_model_json2 == volume_prototype_instance_by_source_snapshot_context_model_json
-class TestModel_VPCRemote:
+class TestModel_VolumeReference:
"""
- Test Class for VPCRemote
+ Test Class for VolumeReference
"""
- def test_vpc_remote_serialization(self):
+ def test_volume_reference_serialization(self):
"""
- Test serialization/deserialization for VPCRemote
+ Test serialization/deserialization for VolumeReference
"""
# Construct dict forms of any model objects needed in order to build this model.
- account_reference_model = {} # AccountReference
- account_reference_model['id'] = 'aa2432b1fa4d4ace891e9b80fc104e34'
- account_reference_model['resource_type'] = 'account'
+ volume_reference_deleted_model = {} # VolumeReferenceDeleted
+ volume_reference_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'
- # Construct a json representation of a VPCRemote model
- vpc_remote_model_json = {}
- vpc_remote_model_json['account'] = account_reference_model
- vpc_remote_model_json['region'] = region_reference_model
+ volume_remote_model = {} # VolumeRemote
+ volume_remote_model['region'] = region_reference_model
- # Construct a model instance of VPCRemote by calling from_dict on the json representation
- vpc_remote_model = VPCRemote.from_dict(vpc_remote_model_json)
- assert vpc_remote_model != False
+ # 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'
+ volume_reference_model_json['remote'] = volume_remote_model
+ volume_reference_model_json['resource_type'] = 'volume'
- # Construct a model instance of VPCRemote by calling from_dict on the json representation
- vpc_remote_model_dict = VPCRemote.from_dict(vpc_remote_model_json).__dict__
- vpc_remote_model2 = VPCRemote(**vpc_remote_model_dict)
+ # 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 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 vpc_remote_model == vpc_remote_model2
+ assert volume_reference_model == volume_reference_model2
# Convert model instance back to dict and verify no loss of data
- vpc_remote_model_json2 = vpc_remote_model.to_dict()
- assert vpc_remote_model_json2 == vpc_remote_model_json
+ volume_reference_model_json2 = volume_reference_model.to_dict()
+ assert volume_reference_model_json2 == volume_reference_model_json
-class TestModel_VPNGatewayCollection:
+class TestModel_VolumeReferenceDeleted:
"""
- Test Class for VPNGatewayCollection
+ Test Class for VolumeReferenceDeleted
"""
- def test_vpn_gateway_collection_serialization(self):
+ def test_volume_reference_deleted_serialization(self):
"""
- Test serialization/deserialization for VPNGatewayCollection
+ Test serialization/deserialization for VolumeReferenceDeleted
"""
- # 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'
+ # 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'
- 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'
+ # 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
- 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 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)
- 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 volume_reference_deleted_model == volume_reference_deleted_model2
- vpn_gateway_health_reason_model = {} # VPNGatewayHealthReason
- vpn_gateway_health_reason_model['code'] = 'cannot_reserve_ip_address'
- vpn_gateway_health_reason_model['message'] = 'IP address exhaustion (release addresses on the VPN\'s subnet).'
- vpn_gateway_health_reason_model['more_info'] = 'https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health'
+ # 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
- vpn_gateway_lifecycle_reason_model = {} # VPNGatewayLifecycleReason
- vpn_gateway_lifecycle_reason_model['code'] = 'resource_suspended_by_provider'
- vpn_gateway_lifecycle_reason_model['message'] = 'The resource has been suspended. Contact IBM support with the CRN for next steps.'
- vpn_gateway_lifecycle_reason_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#resource-suspension'
- vpn_gateway_member_health_reason_model = {} # VPNGatewayMemberHealthReason
- vpn_gateway_member_health_reason_model['code'] = 'cannot_reserve_ip_address'
- vpn_gateway_member_health_reason_model['message'] = 'IP address exhaustion (release addresses on the VPN\'s subnet).'
- vpn_gateway_member_health_reason_model['more_info'] = 'https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health'
+class TestModel_VolumeReferenceVolumeAttachmentContext:
+ """
+ Test Class for VolumeReferenceVolumeAttachmentContext
+ """
- vpn_gateway_member_lifecycle_reason_model = {} # VPNGatewayMemberLifecycleReason
- vpn_gateway_member_lifecycle_reason_model['code'] = 'resource_suspended_by_provider'
- vpn_gateway_member_lifecycle_reason_model['message'] = 'The resource has been suspended. Contact IBM support with the CRN for next steps.'
- vpn_gateway_member_lifecycle_reason_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#resource-suspension'
+ def test_volume_reference_volume_attachment_context_serialization(self):
+ """
+ Test serialization/deserialization for VolumeReferenceVolumeAttachmentContext
+ """
- reserved_ip_reference_deleted_model = {} # ReservedIPReferenceDeleted
- reserved_ip_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.
- 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'
+ volume_reference_volume_attachment_context_deleted_model = {} # VolumeReferenceVolumeAttachmentContextDeleted
+ volume_reference_volume_attachment_context_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- ip_model = {} # IP
- ip_model['address'] = '192.168.3.4'
+ # Construct a json representation of a VolumeReferenceVolumeAttachmentContext model
+ volume_reference_volume_attachment_context_model_json = {}
+ volume_reference_volume_attachment_context_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
+ volume_reference_volume_attachment_context_model_json['deleted'] = volume_reference_volume_attachment_context_deleted_model
+ volume_reference_volume_attachment_context_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
+ volume_reference_volume_attachment_context_model_json['id'] = '1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
+ volume_reference_volume_attachment_context_model_json['name'] = 'my-volume'
+ volume_reference_volume_attachment_context_model_json['resource_type'] = 'volume'
- vpn_gateway_member_model = {} # VPNGatewayMember
- vpn_gateway_member_model['health_reasons'] = [vpn_gateway_member_health_reason_model]
- vpn_gateway_member_model['health_state'] = 'ok'
- vpn_gateway_member_model['lifecycle_reasons'] = [vpn_gateway_member_lifecycle_reason_model]
- vpn_gateway_member_model['lifecycle_state'] = 'stable'
- vpn_gateway_member_model['private_ip'] = reserved_ip_reference_model
- vpn_gateway_member_model['public_ip'] = ip_model
- vpn_gateway_member_model['role'] = 'active'
+ # Construct a model instance of VolumeReferenceVolumeAttachmentContext by calling from_dict on the json representation
+ volume_reference_volume_attachment_context_model = VolumeReferenceVolumeAttachmentContext.from_dict(volume_reference_volume_attachment_context_model_json)
+ assert volume_reference_volume_attachment_context_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 VolumeReferenceVolumeAttachmentContext by calling from_dict on the json representation
+ volume_reference_volume_attachment_context_model_dict = VolumeReferenceVolumeAttachmentContext.from_dict(volume_reference_volume_attachment_context_model_json).__dict__
+ volume_reference_volume_attachment_context_model2 = VolumeReferenceVolumeAttachmentContext(**volume_reference_volume_attachment_context_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 volume_reference_volume_attachment_context_model == volume_reference_volume_attachment_context_model2
- subnet_reference_model = {} # SubnetReference
- subnet_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
- subnet_reference_model['deleted'] = subnet_reference_deleted_model
- subnet_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
- subnet_reference_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
- subnet_reference_model['name'] = 'my-subnet'
- subnet_reference_model['resource_type'] = 'subnet'
+ # Convert model instance back to dict and verify no loss of data
+ volume_reference_volume_attachment_context_model_json2 = volume_reference_volume_attachment_context_model.to_dict()
+ assert volume_reference_volume_attachment_context_model_json2 == volume_reference_volume_attachment_context_model_json
- vpc_reference_deleted_model = {} # VPCReferenceDeleted
- vpc_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- vpc_reference_model = {} # VPCReference
- vpc_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b'
- vpc_reference_model['deleted'] = vpc_reference_deleted_model
- vpc_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b'
- vpc_reference_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b'
- vpc_reference_model['name'] = 'my-vpc'
- vpc_reference_model['resource_type'] = 'vpc'
+class TestModel_VolumeReferenceVolumeAttachmentContextDeleted:
+ """
+ Test Class for VolumeReferenceVolumeAttachmentContextDeleted
+ """
- 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['health_reasons'] = [vpn_gateway_health_reason_model]
- vpn_gateway_model['health_state'] = 'ok'
- 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['lifecycle_reasons'] = [vpn_gateway_lifecycle_reason_model]
- vpn_gateway_model['lifecycle_state'] = 'stable'
- 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['subnet'] = subnet_reference_model
- vpn_gateway_model['vpc'] = vpc_reference_model
- vpn_gateway_model['mode'] = 'route'
+ def test_volume_reference_volume_attachment_context_deleted_serialization(self):
+ """
+ Test serialization/deserialization for VolumeReferenceVolumeAttachmentContextDeleted
+ """
- # 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 json representation of a VolumeReferenceVolumeAttachmentContextDeleted model
+ volume_reference_volume_attachment_context_deleted_model_json = {}
+ volume_reference_volume_attachment_context_deleted_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # 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 VolumeReferenceVolumeAttachmentContextDeleted by calling from_dict on the json representation
+ volume_reference_volume_attachment_context_deleted_model = VolumeReferenceVolumeAttachmentContextDeleted.from_dict(volume_reference_volume_attachment_context_deleted_model_json)
+ assert volume_reference_volume_attachment_context_deleted_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)
+ # Construct a model instance of VolumeReferenceVolumeAttachmentContextDeleted by calling from_dict on the json representation
+ volume_reference_volume_attachment_context_deleted_model_dict = VolumeReferenceVolumeAttachmentContextDeleted.from_dict(volume_reference_volume_attachment_context_deleted_model_json).__dict__
+ volume_reference_volume_attachment_context_deleted_model2 = VolumeReferenceVolumeAttachmentContextDeleted(**volume_reference_volume_attachment_context_deleted_model_dict)
# Verify the model instances are equivalent
- assert vpn_gateway_collection_model == vpn_gateway_collection_model2
+ assert volume_reference_volume_attachment_context_deleted_model == volume_reference_volume_attachment_context_deleted_model2
# 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
+ volume_reference_volume_attachment_context_deleted_model_json2 = volume_reference_volume_attachment_context_deleted_model.to_dict()
+ assert volume_reference_volume_attachment_context_deleted_model_json2 == volume_reference_volume_attachment_context_deleted_model_json
-class TestModel_VPNGatewayCollectionFirst:
+class TestModel_VolumeRemote:
"""
- Test Class for VPNGatewayCollectionFirst
+ Test Class for VolumeRemote
"""
- def test_vpn_gateway_collection_first_serialization(self):
+ def test_volume_remote_serialization(self):
"""
- Test serialization/deserialization for VPNGatewayCollectionFirst
+ Test serialization/deserialization for VolumeRemote
"""
- # 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 dict forms of any model objects needed in order to build this model.
- # 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
+ 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 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 VolumeRemote model
+ volume_remote_model_json = {}
+ volume_remote_model_json['region'] = region_reference_model
+
+ # Construct a model instance of VolumeRemote by calling from_dict on the json representation
+ volume_remote_model = VolumeRemote.from_dict(volume_remote_model_json)
+ assert volume_remote_model != False
+
+ # Construct a model instance of VolumeRemote by calling from_dict on the json representation
+ volume_remote_model_dict = VolumeRemote.from_dict(volume_remote_model_json).__dict__
+ volume_remote_model2 = VolumeRemote(**volume_remote_model_dict)
# Verify the model instances are equivalent
- assert vpn_gateway_collection_first_model == vpn_gateway_collection_first_model2
+ assert volume_remote_model == volume_remote_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_remote_model_json2 = volume_remote_model.to_dict()
+ assert volume_remote_model_json2 == volume_remote_model_json
-class TestModel_VPNGatewayCollectionNext:
+class TestModel_VolumeStatusReason:
"""
- Test Class for VPNGatewayCollectionNext
+ Test Class for VolumeStatusReason
"""
- def test_vpn_gateway_collection_next_serialization(self):
+ def test_volume_status_reason_serialization(self):
"""
- Test serialization/deserialization for VPNGatewayCollectionNext
+ Test serialization/deserialization for VolumeStatusReason
"""
- # 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 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 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 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 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 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_collection_next_model == vpn_gateway_collection_next_model2
+ assert volume_status_reason_model == volume_status_reason_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_status_reason_model_json2 = volume_status_reason_model.to_dict()
+ assert volume_status_reason_model_json2 == volume_status_reason_model_json
-class TestModel_VPNGatewayConnectionCollection:
+class TestModel_Zone:
"""
- Test Class for VPNGatewayConnectionCollection
+ Test Class for Zone
"""
- def test_vpn_gateway_connection_collection_serialization(self):
+ def test_zone_serialization(self):
"""
- Test serialization/deserialization for VPNGatewayConnectionCollection
+ Test serialization/deserialization for Zone
"""
# 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
+ 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'
- ike_policy_reference_deleted_model = {} # IKEPolicyReferenceDeleted
- ike_policy_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ # 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'
- 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'
+ # 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
- 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 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)
- 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'
+ # Verify the model instances are equivalent
+ assert zone_model == zone_model2
- vpn_gateway_connection_status_reason_model = {} # VPNGatewayConnectionStatusReason
- vpn_gateway_connection_status_reason_model['code'] = 'cannot_authenticate_connection'
- vpn_gateway_connection_status_reason_model['message'] = 'Failed to authenticate a connection because of mismatched IKE ID and PSK.'
- vpn_gateway_connection_status_reason_model['more_info'] = 'https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health'
+ # 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
- ip_model = {} # IP
- ip_model['address'] = '192.168.3.4'
- vpn_gateway_connection_tunnel_status_reason_model = {} # VPNGatewayConnectionTunnelStatusReason
- vpn_gateway_connection_tunnel_status_reason_model['code'] = 'cannot_authenticate_connection'
- vpn_gateway_connection_tunnel_status_reason_model['message'] = 'Failed to authenticate a connection because of mismatched IKE ID and PSK.'
- vpn_gateway_connection_tunnel_status_reason_model['more_info'] = 'https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health'
+class TestModel_ZoneCollection:
+ """
+ Test Class for ZoneCollection
+ """
- 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_static_route_mode_tunnel_model['status_reasons'] = [vpn_gateway_connection_tunnel_status_reason_model]
+ def test_zone_collection_serialization(self):
+ """
+ Test serialization/deserialization for ZoneCollection
+ """
- 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['status_reasons'] = [vpn_gateway_connection_status_reason_model]
- vpn_gateway_connection_model['routing_protocol'] = 'none'
- vpn_gateway_connection_model['tunnels'] = [vpn_gateway_connection_static_route_mode_tunnel_model]
+ # 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 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 ZoneCollection model
+ zone_collection_model_json = {}
+ zone_collection_model_json['zones'] = [zone_model]
- # 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 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 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 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)
# Verify the model instances are equivalent
- assert vpn_gateway_connection_collection_model == vpn_gateway_connection_collection_model2
+ assert zone_collection_model == zone_collection_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
+ zone_collection_model_json2 = zone_collection_model.to_dict()
+ assert zone_collection_model_json2 == zone_collection_model_json
-class TestModel_VPNGatewayConnectionDPD:
+class TestModel_ZoneReference:
"""
- Test Class for VPNGatewayConnectionDPD
+ Test Class for ZoneReference
"""
- def test_vpn_gateway_connection_dpd_serialization(self):
+ def test_zone_reference_serialization(self):
"""
- Test serialization/deserialization for VPNGatewayConnectionDPD
+ Test serialization/deserialization for ZoneReference
"""
- # 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 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 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
+ # 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 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 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 vpn_gateway_connection_dpd_model == vpn_gateway_connection_dpd_model2
+ assert zone_reference_model == zone_reference_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
+ zone_reference_model_json2 = zone_reference_model.to_dict()
+ assert zone_reference_model_json2 == zone_reference_model_json
-class TestModel_VPNGatewayConnectionDPDPatch:
+class TestModel_BackupPolicyJobSourceInstanceReference:
"""
- Test Class for VPNGatewayConnectionDPDPatch
+ Test Class for BackupPolicyJobSourceInstanceReference
"""
- def test_vpn_gateway_connection_dpd_patch_serialization(self):
+ def test_backup_policy_job_source_instance_reference_serialization(self):
"""
- Test serialization/deserialization for VPNGatewayConnectionDPDPatch
+ Test serialization/deserialization for BackupPolicyJobSourceInstanceReference
"""
- # 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 dict forms of any model objects needed in order to build this model.
- # 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
+ instance_reference_deleted_model = {} # InstanceReferenceDeleted
+ instance_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # 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 json representation of a BackupPolicyJobSourceInstanceReference model
+ backup_policy_job_source_instance_reference_model_json = {}
+ backup_policy_job_source_instance_reference_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a'
+ backup_policy_job_source_instance_reference_model_json['deleted'] = instance_reference_deleted_model
+ backup_policy_job_source_instance_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a'
+ backup_policy_job_source_instance_reference_model_json['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
+ backup_policy_job_source_instance_reference_model_json['name'] = 'my-instance'
+
+ # Construct a model instance of BackupPolicyJobSourceInstanceReference by calling from_dict on the json representation
+ backup_policy_job_source_instance_reference_model = BackupPolicyJobSourceInstanceReference.from_dict(backup_policy_job_source_instance_reference_model_json)
+ assert backup_policy_job_source_instance_reference_model != False
+
+ # Construct a model instance of BackupPolicyJobSourceInstanceReference by calling from_dict on the json representation
+ backup_policy_job_source_instance_reference_model_dict = BackupPolicyJobSourceInstanceReference.from_dict(backup_policy_job_source_instance_reference_model_json).__dict__
+ backup_policy_job_source_instance_reference_model2 = BackupPolicyJobSourceInstanceReference(**backup_policy_job_source_instance_reference_model_dict)
# Verify the model instances are equivalent
- assert vpn_gateway_connection_dpd_patch_model == vpn_gateway_connection_dpd_patch_model2
+ assert backup_policy_job_source_instance_reference_model == backup_policy_job_source_instance_reference_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
+ backup_policy_job_source_instance_reference_model_json2 = backup_policy_job_source_instance_reference_model.to_dict()
+ assert backup_policy_job_source_instance_reference_model_json2 == backup_policy_job_source_instance_reference_model_json
-class TestModel_VPNGatewayConnectionDPDPrototype:
+class TestModel_BackupPolicyJobSourceVolumeReference:
"""
- Test Class for VPNGatewayConnectionDPDPrototype
+ Test Class for BackupPolicyJobSourceVolumeReference
"""
- def test_vpn_gateway_connection_dpd_prototype_serialization(self):
+ def test_backup_policy_job_source_volume_reference_serialization(self):
"""
- Test serialization/deserialization for VPNGatewayConnectionDPDPrototype
+ Test serialization/deserialization for BackupPolicyJobSourceVolumeReference
"""
- # 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_reference_deleted_model = {} # VolumeReferenceDeleted
+ volume_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # 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)
+ 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_remote_model = {} # VolumeRemote
+ volume_remote_model['region'] = region_reference_model
+
+ # Construct a json representation of a BackupPolicyJobSourceVolumeReference model
+ backup_policy_job_source_volume_reference_model_json = {}
+ backup_policy_job_source_volume_reference_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
+ backup_policy_job_source_volume_reference_model_json['deleted'] = volume_reference_deleted_model
+ backup_policy_job_source_volume_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
+ backup_policy_job_source_volume_reference_model_json['id'] = '1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
+ backup_policy_job_source_volume_reference_model_json['name'] = 'my-volume'
+ backup_policy_job_source_volume_reference_model_json['remote'] = volume_remote_model
+ backup_policy_job_source_volume_reference_model_json['resource_type'] = 'volume'
+
+ # Construct a model instance of BackupPolicyJobSourceVolumeReference by calling from_dict on the json representation
+ backup_policy_job_source_volume_reference_model = BackupPolicyJobSourceVolumeReference.from_dict(backup_policy_job_source_volume_reference_model_json)
+ assert backup_policy_job_source_volume_reference_model != False
+
+ # Construct a model instance of BackupPolicyJobSourceVolumeReference by calling from_dict on the json representation
+ backup_policy_job_source_volume_reference_model_dict = BackupPolicyJobSourceVolumeReference.from_dict(backup_policy_job_source_volume_reference_model_json).__dict__
+ backup_policy_job_source_volume_reference_model2 = BackupPolicyJobSourceVolumeReference(**backup_policy_job_source_volume_reference_model_dict)
# Verify the model instances are equivalent
- assert vpn_gateway_connection_dpd_prototype_model == vpn_gateway_connection_dpd_prototype_model2
+ assert backup_policy_job_source_volume_reference_model == backup_policy_job_source_volume_reference_model2
# Convert model instance back to dict and verify no loss of data
- 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
+ backup_policy_job_source_volume_reference_model_json2 = backup_policy_job_source_volume_reference_model.to_dict()
+ assert backup_policy_job_source_volume_reference_model_json2 == backup_policy_job_source_volume_reference_model_json
-class TestModel_VPNGatewayConnectionLocalCIDRs:
+class TestModel_BackupPolicyMatchResourceTypeInstance:
"""
- Test Class for VPNGatewayConnectionLocalCIDRs
+ Test Class for BackupPolicyMatchResourceTypeInstance
"""
- def test_vpn_gateway_connection_local_cid_rs_serialization(self):
+ def test_backup_policy_match_resource_type_instance_serialization(self):
"""
- Test serialization/deserialization for VPNGatewayConnectionLocalCIDRs
+ Test serialization/deserialization for BackupPolicyMatchResourceTypeInstance
"""
- # 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 dict forms of any model objects needed in order to build this model.
- # 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
+ backup_policy_health_reason_model = {} # BackupPolicyHealthReason
+ backup_policy_health_reason_model['code'] = 'missing_service_authorization_policies'
+ backup_policy_health_reason_model['message'] = 'One or more accounts are missing service authorization policies'
+ backup_policy_health_reason_model['more_info'] = 'https://cloud.ibm.com/docs/vpc?topic=vpc-backup-service-about&interface=ui'
- # 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)
+ backup_policy_plan_reference_deleted_model = {} # BackupPolicyPlanReferenceDeleted
+ backup_policy_plan_reference_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'
+
+ backup_policy_plan_remote_model = {} # BackupPolicyPlanRemote
+ backup_policy_plan_remote_model['region'] = region_reference_model
+
+ backup_policy_plan_reference_model = {} # BackupPolicyPlanReference
+ backup_policy_plan_reference_model['deleted'] = backup_policy_plan_reference_deleted_model
+ backup_policy_plan_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178'
+ backup_policy_plan_reference_model['id'] = 'r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178'
+ backup_policy_plan_reference_model['name'] = 'my-policy-plan'
+ backup_policy_plan_reference_model['remote'] = backup_policy_plan_remote_model
+ backup_policy_plan_reference_model['resource_type'] = 'backup_policy_plan'
+
+ 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'
+
+ backup_policy_scope_model = {} # BackupPolicyScopeEnterpriseReference
+ backup_policy_scope_model['crn'] = 'crn:v1:bluemix:public:enterprise::a/123456::enterprise:ebc2b430240943458b9e91e1432cfcce'
+ backup_policy_scope_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
+ backup_policy_scope_model['resource_type'] = 'enterprise'
+
+ # Construct a json representation of a BackupPolicyMatchResourceTypeInstance model
+ backup_policy_match_resource_type_instance_model_json = {}
+ backup_policy_match_resource_type_instance_model_json['created_at'] = '2019-01-01T12:00:00Z'
+ backup_policy_match_resource_type_instance_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::backup-policy:r134-076191ba-49c2-4763-94fd-c70de73ee2e6'
+ backup_policy_match_resource_type_instance_model_json['health_reasons'] = [backup_policy_health_reason_model]
+ backup_policy_match_resource_type_instance_model_json['health_state'] = 'ok'
+ backup_policy_match_resource_type_instance_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6'
+ backup_policy_match_resource_type_instance_model_json['id'] = 'r134-076191ba-49c2-4763-94fd-c70de73ee2e6'
+ backup_policy_match_resource_type_instance_model_json['last_job_completed_at'] = '2019-01-01T12:00:00Z'
+ backup_policy_match_resource_type_instance_model_json['lifecycle_state'] = 'stable'
+ backup_policy_match_resource_type_instance_model_json['match_user_tags'] = ['my-daily-backup-policy']
+ backup_policy_match_resource_type_instance_model_json['name'] = 'my-backup-policy'
+ backup_policy_match_resource_type_instance_model_json['plans'] = [backup_policy_plan_reference_model]
+ backup_policy_match_resource_type_instance_model_json['resource_group'] = resource_group_reference_model
+ backup_policy_match_resource_type_instance_model_json['resource_type'] = 'backup_policy'
+ backup_policy_match_resource_type_instance_model_json['scope'] = backup_policy_scope_model
+ backup_policy_match_resource_type_instance_model_json['included_content'] = ['data_volumes']
+ backup_policy_match_resource_type_instance_model_json['match_resource_type'] = 'instance'
+
+ # Construct a model instance of BackupPolicyMatchResourceTypeInstance by calling from_dict on the json representation
+ backup_policy_match_resource_type_instance_model = BackupPolicyMatchResourceTypeInstance.from_dict(backup_policy_match_resource_type_instance_model_json)
+ assert backup_policy_match_resource_type_instance_model != False
+
+ # Construct a model instance of BackupPolicyMatchResourceTypeInstance by calling from_dict on the json representation
+ backup_policy_match_resource_type_instance_model_dict = BackupPolicyMatchResourceTypeInstance.from_dict(backup_policy_match_resource_type_instance_model_json).__dict__
+ backup_policy_match_resource_type_instance_model2 = BackupPolicyMatchResourceTypeInstance(**backup_policy_match_resource_type_instance_model_dict)
# Verify the model instances are equivalent
- assert vpn_gateway_connection_local_cid_rs_model == vpn_gateway_connection_local_cid_rs_model2
+ assert backup_policy_match_resource_type_instance_model == backup_policy_match_resource_type_instance_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
+ backup_policy_match_resource_type_instance_model_json2 = backup_policy_match_resource_type_instance_model.to_dict()
+ assert backup_policy_match_resource_type_instance_model_json2 == backup_policy_match_resource_type_instance_model_json
-class TestModel_VPNGatewayConnectionPeerCIDRs:
+class TestModel_BackupPolicyMatchResourceTypeVolume:
"""
- Test Class for VPNGatewayConnectionPeerCIDRs
+ Test Class for BackupPolicyMatchResourceTypeVolume
"""
- def test_vpn_gateway_connection_peer_cid_rs_serialization(self):
+ def test_backup_policy_match_resource_type_volume_serialization(self):
"""
- Test serialization/deserialization for VPNGatewayConnectionPeerCIDRs
+ Test serialization/deserialization for BackupPolicyMatchResourceTypeVolume
"""
- # 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 dict forms of any model objects needed in order to build this model.
- # 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
+ backup_policy_health_reason_model = {} # BackupPolicyHealthReason
+ backup_policy_health_reason_model['code'] = 'missing_service_authorization_policies'
+ backup_policy_health_reason_model['message'] = 'One or more accounts are missing service authorization policies'
+ backup_policy_health_reason_model['more_info'] = 'https://cloud.ibm.com/docs/vpc?topic=vpc-backup-service-about&interface=ui'
- # 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)
+ backup_policy_plan_reference_deleted_model = {} # BackupPolicyPlanReferenceDeleted
+ backup_policy_plan_reference_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'
+
+ backup_policy_plan_remote_model = {} # BackupPolicyPlanRemote
+ backup_policy_plan_remote_model['region'] = region_reference_model
+
+ backup_policy_plan_reference_model = {} # BackupPolicyPlanReference
+ backup_policy_plan_reference_model['deleted'] = backup_policy_plan_reference_deleted_model
+ backup_policy_plan_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178'
+ backup_policy_plan_reference_model['id'] = 'r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178'
+ backup_policy_plan_reference_model['name'] = 'my-policy-plan'
+ backup_policy_plan_reference_model['remote'] = backup_policy_plan_remote_model
+ backup_policy_plan_reference_model['resource_type'] = 'backup_policy_plan'
+
+ 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'
+
+ backup_policy_scope_model = {} # BackupPolicyScopeEnterpriseReference
+ backup_policy_scope_model['crn'] = 'crn:v1:bluemix:public:enterprise::a/123456::enterprise:ebc2b430240943458b9e91e1432cfcce'
+ backup_policy_scope_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
+ backup_policy_scope_model['resource_type'] = 'enterprise'
+
+ # Construct a json representation of a BackupPolicyMatchResourceTypeVolume model
+ backup_policy_match_resource_type_volume_model_json = {}
+ backup_policy_match_resource_type_volume_model_json['created_at'] = '2019-01-01T12:00:00Z'
+ backup_policy_match_resource_type_volume_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::backup-policy:r134-076191ba-49c2-4763-94fd-c70de73ee2e6'
+ backup_policy_match_resource_type_volume_model_json['health_reasons'] = [backup_policy_health_reason_model]
+ backup_policy_match_resource_type_volume_model_json['health_state'] = 'ok'
+ backup_policy_match_resource_type_volume_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6'
+ backup_policy_match_resource_type_volume_model_json['id'] = 'r134-076191ba-49c2-4763-94fd-c70de73ee2e6'
+ backup_policy_match_resource_type_volume_model_json['last_job_completed_at'] = '2019-01-01T12:00:00Z'
+ backup_policy_match_resource_type_volume_model_json['lifecycle_state'] = 'stable'
+ backup_policy_match_resource_type_volume_model_json['match_user_tags'] = ['my-daily-backup-policy']
+ backup_policy_match_resource_type_volume_model_json['name'] = 'my-backup-policy'
+ backup_policy_match_resource_type_volume_model_json['plans'] = [backup_policy_plan_reference_model]
+ backup_policy_match_resource_type_volume_model_json['resource_group'] = resource_group_reference_model
+ backup_policy_match_resource_type_volume_model_json['resource_type'] = 'backup_policy'
+ backup_policy_match_resource_type_volume_model_json['scope'] = backup_policy_scope_model
+ backup_policy_match_resource_type_volume_model_json['match_resource_type'] = 'volume'
+
+ # Construct a model instance of BackupPolicyMatchResourceTypeVolume by calling from_dict on the json representation
+ backup_policy_match_resource_type_volume_model = BackupPolicyMatchResourceTypeVolume.from_dict(backup_policy_match_resource_type_volume_model_json)
+ assert backup_policy_match_resource_type_volume_model != False
+
+ # Construct a model instance of BackupPolicyMatchResourceTypeVolume by calling from_dict on the json representation
+ backup_policy_match_resource_type_volume_model_dict = BackupPolicyMatchResourceTypeVolume.from_dict(backup_policy_match_resource_type_volume_model_json).__dict__
+ backup_policy_match_resource_type_volume_model2 = BackupPolicyMatchResourceTypeVolume(**backup_policy_match_resource_type_volume_model_dict)
# Verify the model instances are equivalent
- assert vpn_gateway_connection_peer_cid_rs_model == vpn_gateway_connection_peer_cid_rs_model2
+ assert backup_policy_match_resource_type_volume_model == backup_policy_match_resource_type_volume_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
+ backup_policy_match_resource_type_volume_model_json2 = backup_policy_match_resource_type_volume_model.to_dict()
+ assert backup_policy_match_resource_type_volume_model_json2 == backup_policy_match_resource_type_volume_model_json
-class TestModel_VPNGatewayConnectionReference:
+class TestModel_BackupPolicyPrototypeBackupPolicyMatchResourceTypeInstancePrototype:
"""
- Test Class for VPNGatewayConnectionReference
+ Test Class for BackupPolicyPrototypeBackupPolicyMatchResourceTypeInstancePrototype
"""
- def test_vpn_gateway_connection_reference_serialization(self):
+ def test_backup_policy_prototype_backup_policy_match_resource_type_instance_prototype_serialization(self):
"""
- Test serialization/deserialization for VPNGatewayConnectionReference
+ Test serialization/deserialization for BackupPolicyPrototypeBackupPolicyMatchResourceTypeInstancePrototype
"""
# 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'
+ zone_identity_model = {} # ZoneIdentityByName
+ zone_identity_model['name'] = 'us-south-1'
- # 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'
+ backup_policy_plan_clone_policy_prototype_model = {} # BackupPolicyPlanClonePolicyPrototype
+ backup_policy_plan_clone_policy_prototype_model['max_snapshots'] = 5
+ backup_policy_plan_clone_policy_prototype_model['zones'] = [zone_identity_model]
- # 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
+ backup_policy_plan_deletion_trigger_prototype_model = {} # BackupPolicyPlanDeletionTriggerPrototype
+ backup_policy_plan_deletion_trigger_prototype_model['delete_after'] = 20
+ backup_policy_plan_deletion_trigger_prototype_model['delete_over_count'] = 20
- # 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)
+ encryption_key_identity_model = {} # EncryptionKeyIdentityByCRN
+ encryption_key_identity_model['crn'] = 'crn:v1:bluemix:public:kms:us-south:a/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179'
+
+ region_identity_model = {} # RegionIdentityByName
+ region_identity_model['name'] = 'us-south'
+
+ backup_policy_plan_remote_region_policy_prototype_model = {} # BackupPolicyPlanRemoteRegionPolicyPrototype
+ backup_policy_plan_remote_region_policy_prototype_model['delete_over_count'] = 5
+ backup_policy_plan_remote_region_policy_prototype_model['encryption_key'] = encryption_key_identity_model
+ backup_policy_plan_remote_region_policy_prototype_model['region'] = region_identity_model
+
+ backup_policy_plan_prototype_model = {} # BackupPolicyPlanPrototype
+ backup_policy_plan_prototype_model['active'] = True
+ backup_policy_plan_prototype_model['attach_user_tags'] = ['my-daily-backup-plan']
+ backup_policy_plan_prototype_model['clone_policy'] = backup_policy_plan_clone_policy_prototype_model
+ backup_policy_plan_prototype_model['copy_user_tags'] = True
+ backup_policy_plan_prototype_model['cron_spec'] = '30 */2 * * 1-5'
+ backup_policy_plan_prototype_model['deletion_trigger'] = backup_policy_plan_deletion_trigger_prototype_model
+ backup_policy_plan_prototype_model['name'] = 'my-policy-plan'
+ backup_policy_plan_prototype_model['remote_region_policies'] = [backup_policy_plan_remote_region_policy_prototype_model]
+
+ resource_group_identity_model = {} # ResourceGroupIdentityById
+ resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
+
+ backup_policy_scope_prototype_model = {} # BackupPolicyScopePrototypeEnterpriseIdentityEnterpriseIdentityByCRN
+ backup_policy_scope_prototype_model['crn'] = 'crn:v1:bluemix:public:enterprise::a/123456::enterprise:ebc2b430240943458b9e91e1432cfcce'
+
+ # Construct a json representation of a BackupPolicyPrototypeBackupPolicyMatchResourceTypeInstancePrototype model
+ backup_policy_prototype_backup_policy_match_resource_type_instance_prototype_model_json = {}
+ backup_policy_prototype_backup_policy_match_resource_type_instance_prototype_model_json['match_user_tags'] = ['my-daily-backup-policy']
+ backup_policy_prototype_backup_policy_match_resource_type_instance_prototype_model_json['name'] = 'my-backup-policy'
+ backup_policy_prototype_backup_policy_match_resource_type_instance_prototype_model_json['plans'] = [backup_policy_plan_prototype_model]
+ backup_policy_prototype_backup_policy_match_resource_type_instance_prototype_model_json['resource_group'] = resource_group_identity_model
+ backup_policy_prototype_backup_policy_match_resource_type_instance_prototype_model_json['scope'] = backup_policy_scope_prototype_model
+ backup_policy_prototype_backup_policy_match_resource_type_instance_prototype_model_json['included_content'] = ['boot_volume', 'data_volumes']
+ backup_policy_prototype_backup_policy_match_resource_type_instance_prototype_model_json['match_resource_type'] = 'instance'
+
+ # Construct a model instance of BackupPolicyPrototypeBackupPolicyMatchResourceTypeInstancePrototype by calling from_dict on the json representation
+ backup_policy_prototype_backup_policy_match_resource_type_instance_prototype_model = BackupPolicyPrototypeBackupPolicyMatchResourceTypeInstancePrototype.from_dict(backup_policy_prototype_backup_policy_match_resource_type_instance_prototype_model_json)
+ assert backup_policy_prototype_backup_policy_match_resource_type_instance_prototype_model != False
+
+ # Construct a model instance of BackupPolicyPrototypeBackupPolicyMatchResourceTypeInstancePrototype by calling from_dict on the json representation
+ backup_policy_prototype_backup_policy_match_resource_type_instance_prototype_model_dict = BackupPolicyPrototypeBackupPolicyMatchResourceTypeInstancePrototype.from_dict(backup_policy_prototype_backup_policy_match_resource_type_instance_prototype_model_json).__dict__
+ backup_policy_prototype_backup_policy_match_resource_type_instance_prototype_model2 = BackupPolicyPrototypeBackupPolicyMatchResourceTypeInstancePrototype(**backup_policy_prototype_backup_policy_match_resource_type_instance_prototype_model_dict)
# Verify the model instances are equivalent
- assert vpn_gateway_connection_reference_model == vpn_gateway_connection_reference_model2
+ assert backup_policy_prototype_backup_policy_match_resource_type_instance_prototype_model == backup_policy_prototype_backup_policy_match_resource_type_instance_prototype_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
+ backup_policy_prototype_backup_policy_match_resource_type_instance_prototype_model_json2 = backup_policy_prototype_backup_policy_match_resource_type_instance_prototype_model.to_dict()
+ assert backup_policy_prototype_backup_policy_match_resource_type_instance_prototype_model_json2 == backup_policy_prototype_backup_policy_match_resource_type_instance_prototype_model_json
-class TestModel_VPNGatewayConnectionReferenceDeleted:
+class TestModel_BackupPolicyPrototypeBackupPolicyMatchResourceTypeVolumePrototype:
"""
- Test Class for VPNGatewayConnectionReferenceDeleted
+ Test Class for BackupPolicyPrototypeBackupPolicyMatchResourceTypeVolumePrototype
"""
- def test_vpn_gateway_connection_reference_deleted_serialization(self):
+ def test_backup_policy_prototype_backup_policy_match_resource_type_volume_prototype_serialization(self):
"""
- Test serialization/deserialization for VPNGatewayConnectionReferenceDeleted
+ Test serialization/deserialization for BackupPolicyPrototypeBackupPolicyMatchResourceTypeVolumePrototype
"""
- # 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
+ zone_identity_model = {} # ZoneIdentityByName
+ zone_identity_model['name'] = 'us-south-1'
- # 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)
+ backup_policy_plan_clone_policy_prototype_model = {} # BackupPolicyPlanClonePolicyPrototype
+ backup_policy_plan_clone_policy_prototype_model['max_snapshots'] = 5
+ backup_policy_plan_clone_policy_prototype_model['zones'] = [zone_identity_model]
+
+ backup_policy_plan_deletion_trigger_prototype_model = {} # BackupPolicyPlanDeletionTriggerPrototype
+ backup_policy_plan_deletion_trigger_prototype_model['delete_after'] = 20
+ backup_policy_plan_deletion_trigger_prototype_model['delete_over_count'] = 20
+
+ encryption_key_identity_model = {} # EncryptionKeyIdentityByCRN
+ encryption_key_identity_model['crn'] = 'crn:v1:bluemix:public:kms:us-south:a/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179'
+
+ region_identity_model = {} # RegionIdentityByName
+ region_identity_model['name'] = 'us-south'
+
+ backup_policy_plan_remote_region_policy_prototype_model = {} # BackupPolicyPlanRemoteRegionPolicyPrototype
+ backup_policy_plan_remote_region_policy_prototype_model['delete_over_count'] = 5
+ backup_policy_plan_remote_region_policy_prototype_model['encryption_key'] = encryption_key_identity_model
+ backup_policy_plan_remote_region_policy_prototype_model['region'] = region_identity_model
+
+ backup_policy_plan_prototype_model = {} # BackupPolicyPlanPrototype
+ backup_policy_plan_prototype_model['active'] = True
+ backup_policy_plan_prototype_model['attach_user_tags'] = ['my-daily-backup-plan']
+ backup_policy_plan_prototype_model['clone_policy'] = backup_policy_plan_clone_policy_prototype_model
+ backup_policy_plan_prototype_model['copy_user_tags'] = True
+ backup_policy_plan_prototype_model['cron_spec'] = '30 */2 * * 1-5'
+ backup_policy_plan_prototype_model['deletion_trigger'] = backup_policy_plan_deletion_trigger_prototype_model
+ backup_policy_plan_prototype_model['name'] = 'my-policy-plan'
+ backup_policy_plan_prototype_model['remote_region_policies'] = [backup_policy_plan_remote_region_policy_prototype_model]
+
+ resource_group_identity_model = {} # ResourceGroupIdentityById
+ resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
+
+ backup_policy_scope_prototype_model = {} # BackupPolicyScopePrototypeEnterpriseIdentityEnterpriseIdentityByCRN
+ backup_policy_scope_prototype_model['crn'] = 'crn:v1:bluemix:public:enterprise::a/123456::enterprise:ebc2b430240943458b9e91e1432cfcce'
+
+ # Construct a json representation of a BackupPolicyPrototypeBackupPolicyMatchResourceTypeVolumePrototype model
+ backup_policy_prototype_backup_policy_match_resource_type_volume_prototype_model_json = {}
+ backup_policy_prototype_backup_policy_match_resource_type_volume_prototype_model_json['match_user_tags'] = ['my-daily-backup-policy']
+ backup_policy_prototype_backup_policy_match_resource_type_volume_prototype_model_json['name'] = 'my-backup-policy'
+ backup_policy_prototype_backup_policy_match_resource_type_volume_prototype_model_json['plans'] = [backup_policy_plan_prototype_model]
+ backup_policy_prototype_backup_policy_match_resource_type_volume_prototype_model_json['resource_group'] = resource_group_identity_model
+ backup_policy_prototype_backup_policy_match_resource_type_volume_prototype_model_json['scope'] = backup_policy_scope_prototype_model
+ backup_policy_prototype_backup_policy_match_resource_type_volume_prototype_model_json['match_resource_type'] = 'volume'
+
+ # Construct a model instance of BackupPolicyPrototypeBackupPolicyMatchResourceTypeVolumePrototype by calling from_dict on the json representation
+ backup_policy_prototype_backup_policy_match_resource_type_volume_prototype_model = BackupPolicyPrototypeBackupPolicyMatchResourceTypeVolumePrototype.from_dict(backup_policy_prototype_backup_policy_match_resource_type_volume_prototype_model_json)
+ assert backup_policy_prototype_backup_policy_match_resource_type_volume_prototype_model != False
+
+ # Construct a model instance of BackupPolicyPrototypeBackupPolicyMatchResourceTypeVolumePrototype by calling from_dict on the json representation
+ backup_policy_prototype_backup_policy_match_resource_type_volume_prototype_model_dict = BackupPolicyPrototypeBackupPolicyMatchResourceTypeVolumePrototype.from_dict(backup_policy_prototype_backup_policy_match_resource_type_volume_prototype_model_json).__dict__
+ backup_policy_prototype_backup_policy_match_resource_type_volume_prototype_model2 = BackupPolicyPrototypeBackupPolicyMatchResourceTypeVolumePrototype(**backup_policy_prototype_backup_policy_match_resource_type_volume_prototype_model_dict)
# Verify the model instances are equivalent
- assert vpn_gateway_connection_reference_deleted_model == vpn_gateway_connection_reference_deleted_model2
+ assert backup_policy_prototype_backup_policy_match_resource_type_volume_prototype_model == backup_policy_prototype_backup_policy_match_resource_type_volume_prototype_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
+ backup_policy_prototype_backup_policy_match_resource_type_volume_prototype_model_json2 = backup_policy_prototype_backup_policy_match_resource_type_volume_prototype_model.to_dict()
+ assert backup_policy_prototype_backup_policy_match_resource_type_volume_prototype_model_json2 == backup_policy_prototype_backup_policy_match_resource_type_volume_prototype_model_json
-class TestModel_VPNGatewayConnectionStaticRouteModeTunnel:
+class TestModel_BackupPolicyScopeAccountReference:
"""
- Test Class for VPNGatewayConnectionStaticRouteModeTunnel
+ Test Class for BackupPolicyScopeAccountReference
"""
- def test_vpn_gateway_connection_static_route_mode_tunnel_serialization(self):
+ def test_backup_policy_scope_account_reference_serialization(self):
"""
- Test serialization/deserialization for VPNGatewayConnectionStaticRouteModeTunnel
+ Test serialization/deserialization for BackupPolicyScopeAccountReference
"""
- # Construct dict forms of any model objects needed in order to build this model.
-
- ip_model = {} # IP
- ip_model['address'] = '192.168.3.4'
-
- vpn_gateway_connection_tunnel_status_reason_model = {} # VPNGatewayConnectionTunnelStatusReason
- vpn_gateway_connection_tunnel_status_reason_model['code'] = 'cannot_authenticate_connection'
- vpn_gateway_connection_tunnel_status_reason_model['message'] = 'Failed to authenticate a connection because of mismatched IKE ID and PSK.'
- vpn_gateway_connection_tunnel_status_reason_model['more_info'] = 'https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health'
-
- # 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'
- vpn_gateway_connection_static_route_mode_tunnel_model_json['status_reasons'] = [vpn_gateway_connection_tunnel_status_reason_model]
+ # Construct a json representation of a BackupPolicyScopeAccountReference model
+ backup_policy_scope_account_reference_model_json = {}
+ backup_policy_scope_account_reference_model_json['id'] = 'aa2432b1fa4d4ace891e9b80fc104e34'
+ backup_policy_scope_account_reference_model_json['resource_type'] = 'account'
- # 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 BackupPolicyScopeAccountReference by calling from_dict on the json representation
+ backup_policy_scope_account_reference_model = BackupPolicyScopeAccountReference.from_dict(backup_policy_scope_account_reference_model_json)
+ assert backup_policy_scope_account_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 BackupPolicyScopeAccountReference by calling from_dict on the json representation
+ backup_policy_scope_account_reference_model_dict = BackupPolicyScopeAccountReference.from_dict(backup_policy_scope_account_reference_model_json).__dict__
+ backup_policy_scope_account_reference_model2 = BackupPolicyScopeAccountReference(**backup_policy_scope_account_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 backup_policy_scope_account_reference_model == backup_policy_scope_account_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
+ backup_policy_scope_account_reference_model_json2 = backup_policy_scope_account_reference_model.to_dict()
+ assert backup_policy_scope_account_reference_model_json2 == backup_policy_scope_account_reference_model_json
-class TestModel_VPNGatewayConnectionStatusReason:
+class TestModel_BackupPolicyScopeEnterpriseReference:
"""
- Test Class for VPNGatewayConnectionStatusReason
+ Test Class for BackupPolicyScopeEnterpriseReference
"""
- def test_vpn_gateway_connection_status_reason_serialization(self):
+ def test_backup_policy_scope_enterprise_reference_serialization(self):
"""
- Test serialization/deserialization for VPNGatewayConnectionStatusReason
+ Test serialization/deserialization for BackupPolicyScopeEnterpriseReference
"""
- # Construct a json representation of a VPNGatewayConnectionStatusReason model
- vpn_gateway_connection_status_reason_model_json = {}
- vpn_gateway_connection_status_reason_model_json['code'] = 'cannot_authenticate_connection'
- vpn_gateway_connection_status_reason_model_json['message'] = 'Failed to authenticate a connection because of mismatched IKE ID and PSK.'
- vpn_gateway_connection_status_reason_model_json['more_info'] = 'https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health'
+ # Construct a json representation of a BackupPolicyScopeEnterpriseReference model
+ backup_policy_scope_enterprise_reference_model_json = {}
+ backup_policy_scope_enterprise_reference_model_json['crn'] = 'crn:v1:bluemix:public:enterprise::a/123456::enterprise:ebc2b430240943458b9e91e1432cfcce'
+ backup_policy_scope_enterprise_reference_model_json['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
+ backup_policy_scope_enterprise_reference_model_json['resource_type'] = 'enterprise'
- # Construct a model instance of VPNGatewayConnectionStatusReason by calling from_dict on the json representation
- vpn_gateway_connection_status_reason_model = VPNGatewayConnectionStatusReason.from_dict(vpn_gateway_connection_status_reason_model_json)
- assert vpn_gateway_connection_status_reason_model != False
+ # Construct a model instance of BackupPolicyScopeEnterpriseReference by calling from_dict on the json representation
+ backup_policy_scope_enterprise_reference_model = BackupPolicyScopeEnterpriseReference.from_dict(backup_policy_scope_enterprise_reference_model_json)
+ assert backup_policy_scope_enterprise_reference_model != False
- # Construct a model instance of VPNGatewayConnectionStatusReason by calling from_dict on the json representation
- vpn_gateway_connection_status_reason_model_dict = VPNGatewayConnectionStatusReason.from_dict(vpn_gateway_connection_status_reason_model_json).__dict__
- vpn_gateway_connection_status_reason_model2 = VPNGatewayConnectionStatusReason(**vpn_gateway_connection_status_reason_model_dict)
+ # Construct a model instance of BackupPolicyScopeEnterpriseReference by calling from_dict on the json representation
+ backup_policy_scope_enterprise_reference_model_dict = BackupPolicyScopeEnterpriseReference.from_dict(backup_policy_scope_enterprise_reference_model_json).__dict__
+ backup_policy_scope_enterprise_reference_model2 = BackupPolicyScopeEnterpriseReference(**backup_policy_scope_enterprise_reference_model_dict)
# Verify the model instances are equivalent
- assert vpn_gateway_connection_status_reason_model == vpn_gateway_connection_status_reason_model2
+ assert backup_policy_scope_enterprise_reference_model == backup_policy_scope_enterprise_reference_model2
# Convert model instance back to dict and verify no loss of data
- vpn_gateway_connection_status_reason_model_json2 = vpn_gateway_connection_status_reason_model.to_dict()
- assert vpn_gateway_connection_status_reason_model_json2 == vpn_gateway_connection_status_reason_model_json
+ backup_policy_scope_enterprise_reference_model_json2 = backup_policy_scope_enterprise_reference_model.to_dict()
+ assert backup_policy_scope_enterprise_reference_model_json2 == backup_policy_scope_enterprise_reference_model_json
-class TestModel_VPNGatewayConnectionTunnelStatusReason:
+class TestModel_BareMetalServerBootTargetBareMetalServerDiskReference:
"""
- Test Class for VPNGatewayConnectionTunnelStatusReason
+ Test Class for BareMetalServerBootTargetBareMetalServerDiskReference
"""
- def test_vpn_gateway_connection_tunnel_status_reason_serialization(self):
+ def test_bare_metal_server_boot_target_bare_metal_server_disk_reference_serialization(self):
"""
- Test serialization/deserialization for VPNGatewayConnectionTunnelStatusReason
+ Test serialization/deserialization for BareMetalServerBootTargetBareMetalServerDiskReference
"""
- # Construct a json representation of a VPNGatewayConnectionTunnelStatusReason model
- vpn_gateway_connection_tunnel_status_reason_model_json = {}
- vpn_gateway_connection_tunnel_status_reason_model_json['code'] = 'cannot_authenticate_connection'
- vpn_gateway_connection_tunnel_status_reason_model_json['message'] = 'Failed to authenticate a connection because of mismatched IKE ID and PSK.'
- vpn_gateway_connection_tunnel_status_reason_model_json['more_info'] = 'https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health'
+ # Construct dict forms of any model objects needed in order to build this model.
- # Construct a model instance of VPNGatewayConnectionTunnelStatusReason by calling from_dict on the json representation
- vpn_gateway_connection_tunnel_status_reason_model = VPNGatewayConnectionTunnelStatusReason.from_dict(vpn_gateway_connection_tunnel_status_reason_model_json)
- assert vpn_gateway_connection_tunnel_status_reason_model != False
+ 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 model instance of VPNGatewayConnectionTunnelStatusReason by calling from_dict on the json representation
- vpn_gateway_connection_tunnel_status_reason_model_dict = VPNGatewayConnectionTunnelStatusReason.from_dict(vpn_gateway_connection_tunnel_status_reason_model_json).__dict__
- vpn_gateway_connection_tunnel_status_reason_model2 = VPNGatewayConnectionTunnelStatusReason(**vpn_gateway_connection_tunnel_status_reason_model_dict)
+ # 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-server-disk'
+ bare_metal_server_boot_target_bare_metal_server_disk_reference_model_json['resource_type'] = 'bare_metal_server_disk'
+
+ # Construct a model instance of BareMetalServerBootTargetBareMetalServerDiskReference by calling from_dict on the json representation
+ 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 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 vpn_gateway_connection_tunnel_status_reason_model == vpn_gateway_connection_tunnel_status_reason_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
- vpn_gateway_connection_tunnel_status_reason_model_json2 = vpn_gateway_connection_tunnel_status_reason_model.to_dict()
- assert vpn_gateway_connection_tunnel_status_reason_model_json2 == vpn_gateway_connection_tunnel_status_reason_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_VPNGatewayHealthReason:
+class TestModel_BareMetalServerInitializationUserAccountBareMetalServerInitializationHostUserAccount:
"""
- Test Class for VPNGatewayHealthReason
+ Test Class for BareMetalServerInitializationUserAccountBareMetalServerInitializationHostUserAccount
"""
- def test_vpn_gateway_health_reason_serialization(self):
+ def test_bare_metal_server_initialization_user_account_bare_metal_server_initialization_host_user_account_serialization(self):
"""
- Test serialization/deserialization for VPNGatewayHealthReason
+ Test serialization/deserialization for BareMetalServerInitializationUserAccountBareMetalServerInitializationHostUserAccount
"""
- # Construct a json representation of a VPNGatewayHealthReason model
- vpn_gateway_health_reason_model_json = {}
- vpn_gateway_health_reason_model_json['code'] = 'cannot_reserve_ip_address'
- vpn_gateway_health_reason_model_json['message'] = 'IP address exhaustion (release addresses on the VPN\'s subnet).'
- vpn_gateway_health_reason_model_json['more_info'] = 'https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health'
+ # Construct dict forms of any model objects needed in order to build this model.
- # Construct a model instance of VPNGatewayHealthReason by calling from_dict on the json representation
- vpn_gateway_health_reason_model = VPNGatewayHealthReason.from_dict(vpn_gateway_health_reason_model_json)
- assert vpn_gateway_health_reason_model != False
+ 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'
+
+ # 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 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 VPNGatewayHealthReason by calling from_dict on the json representation
- vpn_gateway_health_reason_model_dict = VPNGatewayHealthReason.from_dict(vpn_gateway_health_reason_model_json).__dict__
- vpn_gateway_health_reason_model2 = VPNGatewayHealthReason(**vpn_gateway_health_reason_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 vpn_gateway_health_reason_model == vpn_gateway_health_reason_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
- vpn_gateway_health_reason_model_json2 = vpn_gateway_health_reason_model.to_dict()
- assert vpn_gateway_health_reason_model_json2 == vpn_gateway_health_reason_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_VPNGatewayLifecycleReason:
+class TestModel_BareMetalServerNetworkAttachmentByPCI:
"""
- Test Class for VPNGatewayLifecycleReason
+ Test Class for BareMetalServerNetworkAttachmentByPCI
"""
- def test_vpn_gateway_lifecycle_reason_serialization(self):
+ def test_bare_metal_server_network_attachment_by_pci_serialization(self):
"""
- Test serialization/deserialization for VPNGatewayLifecycleReason
+ Test serialization/deserialization for BareMetalServerNetworkAttachmentByPCI
"""
- # Construct a json representation of a VPNGatewayLifecycleReason model
- vpn_gateway_lifecycle_reason_model_json = {}
- vpn_gateway_lifecycle_reason_model_json['code'] = 'resource_suspended_by_provider'
- vpn_gateway_lifecycle_reason_model_json['message'] = 'The resource has been suspended. Contact IBM support with the CRN for next steps.'
- vpn_gateway_lifecycle_reason_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#resource-suspension'
+ # Construct dict forms of any model objects needed in order to build this model.
- # Construct a model instance of VPNGatewayLifecycleReason by calling from_dict on the json representation
- vpn_gateway_lifecycle_reason_model = VPNGatewayLifecycleReason.from_dict(vpn_gateway_lifecycle_reason_model_json)
- assert vpn_gateway_lifecycle_reason_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 VPNGatewayLifecycleReason by calling from_dict on the json representation
- vpn_gateway_lifecycle_reason_model_dict = VPNGatewayLifecycleReason.from_dict(vpn_gateway_lifecycle_reason_model_json).__dict__
- vpn_gateway_lifecycle_reason_model2 = VPNGatewayLifecycleReason(**vpn_gateway_lifecycle_reason_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'
+
+ subnet_reference_deleted_model = {} # SubnetReferenceDeleted
+ subnet_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+
+ subnet_reference_model = {} # SubnetReference
+ subnet_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
+ subnet_reference_model['deleted'] = subnet_reference_deleted_model
+ subnet_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
+ subnet_reference_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
+ subnet_reference_model['name'] = 'my-subnet'
+ subnet_reference_model['resource_type'] = 'subnet'
+
+ virtual_network_interface_reference_attachment_context_model = {} # VirtualNetworkInterfaceReferenceAttachmentContext
+ virtual_network_interface_reference_attachment_context_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9'
+ virtual_network_interface_reference_attachment_context_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9'
+ virtual_network_interface_reference_attachment_context_model['id'] = '0767-fa41aecb-4f21-423d-8082-630bfba1e1d9'
+ virtual_network_interface_reference_attachment_context_model['name'] = 'my-virtual-network-interface'
+ virtual_network_interface_reference_attachment_context_model['resource_type'] = 'virtual_network_interface'
+
+ # Construct a json representation of a BareMetalServerNetworkAttachmentByPCI model
+ bare_metal_server_network_attachment_by_pci_model_json = {}
+ bare_metal_server_network_attachment_by_pci_model_json['created_at'] = '2019-01-01T12:00:00Z'
+ bare_metal_server_network_attachment_by_pci_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/2302-f7a2bf57-af7c-49d9-b599-b2c91293d30c/network_attachments/2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6'
+ bare_metal_server_network_attachment_by_pci_model_json['id'] = '2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6'
+ bare_metal_server_network_attachment_by_pci_model_json['lifecycle_state'] = 'stable'
+ bare_metal_server_network_attachment_by_pci_model_json['name'] = 'my-bare-metal-server-network-attachment'
+ bare_metal_server_network_attachment_by_pci_model_json['port_speed'] = 1000
+ bare_metal_server_network_attachment_by_pci_model_json['primary_ip'] = reserved_ip_reference_model
+ bare_metal_server_network_attachment_by_pci_model_json['resource_type'] = 'bare_metal_server_network_attachment'
+ bare_metal_server_network_attachment_by_pci_model_json['subnet'] = subnet_reference_model
+ bare_metal_server_network_attachment_by_pci_model_json['type'] = 'primary'
+ bare_metal_server_network_attachment_by_pci_model_json['virtual_network_interface'] = virtual_network_interface_reference_attachment_context_model
+ bare_metal_server_network_attachment_by_pci_model_json['allowed_vlans'] = [4]
+ bare_metal_server_network_attachment_by_pci_model_json['interface_type'] = 'pci'
+
+ # Construct a model instance of BareMetalServerNetworkAttachmentByPCI by calling from_dict on the json representation
+ bare_metal_server_network_attachment_by_pci_model = BareMetalServerNetworkAttachmentByPCI.from_dict(bare_metal_server_network_attachment_by_pci_model_json)
+ assert bare_metal_server_network_attachment_by_pci_model != False
+
+ # Construct a model instance of BareMetalServerNetworkAttachmentByPCI by calling from_dict on the json representation
+ bare_metal_server_network_attachment_by_pci_model_dict = BareMetalServerNetworkAttachmentByPCI.from_dict(bare_metal_server_network_attachment_by_pci_model_json).__dict__
+ bare_metal_server_network_attachment_by_pci_model2 = BareMetalServerNetworkAttachmentByPCI(**bare_metal_server_network_attachment_by_pci_model_dict)
# Verify the model instances are equivalent
- assert vpn_gateway_lifecycle_reason_model == vpn_gateway_lifecycle_reason_model2
+ assert bare_metal_server_network_attachment_by_pci_model == bare_metal_server_network_attachment_by_pci_model2
# Convert model instance back to dict and verify no loss of data
- vpn_gateway_lifecycle_reason_model_json2 = vpn_gateway_lifecycle_reason_model.to_dict()
- assert vpn_gateway_lifecycle_reason_model_json2 == vpn_gateway_lifecycle_reason_model_json
+ bare_metal_server_network_attachment_by_pci_model_json2 = bare_metal_server_network_attachment_by_pci_model.to_dict()
+ assert bare_metal_server_network_attachment_by_pci_model_json2 == bare_metal_server_network_attachment_by_pci_model_json
-class TestModel_VPNGatewayMember:
+class TestModel_BareMetalServerNetworkAttachmentByVLAN:
"""
- Test Class for VPNGatewayMember
+ Test Class for BareMetalServerNetworkAttachmentByVLAN
"""
- def test_vpn_gateway_member_serialization(self):
+ def test_bare_metal_server_network_attachment_by_vlan_serialization(self):
"""
- Test serialization/deserialization for VPNGatewayMember
+ Test serialization/deserialization for BareMetalServerNetworkAttachmentByVLAN
"""
# Construct dict forms of any model objects needed in order to build this model.
- vpn_gateway_member_health_reason_model = {} # VPNGatewayMemberHealthReason
- vpn_gateway_member_health_reason_model['code'] = 'cannot_reserve_ip_address'
- vpn_gateway_member_health_reason_model['message'] = 'IP address exhaustion (release addresses on the VPN\'s subnet).'
- vpn_gateway_member_health_reason_model['more_info'] = 'https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health'
-
- vpn_gateway_member_lifecycle_reason_model = {} # VPNGatewayMemberLifecycleReason
- vpn_gateway_member_lifecycle_reason_model['code'] = 'resource_suspended_by_provider'
- vpn_gateway_member_lifecycle_reason_model['message'] = 'The resource has been suspended. Contact IBM support with the CRN for next steps.'
- vpn_gateway_member_lifecycle_reason_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#resource-suspension'
-
reserved_ip_reference_deleted_model = {} # ReservedIPReferenceDeleted
reserved_ip_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
@@ -65198,193 +75562,269 @@ def test_vpn_gateway_member_serialization(self):
reserved_ip_reference_model['name'] = 'my-reserved-ip'
reserved_ip_reference_model['resource_type'] = 'subnet_reserved_ip'
- ip_model = {} # IP
- ip_model['address'] = '192.168.3.4'
+ subnet_reference_deleted_model = {} # SubnetReferenceDeleted
+ subnet_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Construct a json representation of a VPNGatewayMember model
- vpn_gateway_member_model_json = {}
- vpn_gateway_member_model_json['health_reasons'] = [vpn_gateway_member_health_reason_model]
- vpn_gateway_member_model_json['health_state'] = 'ok'
- vpn_gateway_member_model_json['lifecycle_reasons'] = [vpn_gateway_member_lifecycle_reason_model]
- vpn_gateway_member_model_json['lifecycle_state'] = 'stable'
- vpn_gateway_member_model_json['private_ip'] = reserved_ip_reference_model
- vpn_gateway_member_model_json['public_ip'] = ip_model
- vpn_gateway_member_model_json['role'] = 'active'
+ subnet_reference_model = {} # SubnetReference
+ subnet_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
+ subnet_reference_model['deleted'] = subnet_reference_deleted_model
+ subnet_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
+ subnet_reference_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
+ subnet_reference_model['name'] = 'my-subnet'
+ subnet_reference_model['resource_type'] = 'subnet'
- # Construct a 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
+ virtual_network_interface_reference_attachment_context_model = {} # VirtualNetworkInterfaceReferenceAttachmentContext
+ virtual_network_interface_reference_attachment_context_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9'
+ virtual_network_interface_reference_attachment_context_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9'
+ virtual_network_interface_reference_attachment_context_model['id'] = '0767-fa41aecb-4f21-423d-8082-630bfba1e1d9'
+ virtual_network_interface_reference_attachment_context_model['name'] = 'my-virtual-network-interface'
+ virtual_network_interface_reference_attachment_context_model['resource_type'] = 'virtual_network_interface'
- # 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 json representation of a BareMetalServerNetworkAttachmentByVLAN model
+ bare_metal_server_network_attachment_by_vlan_model_json = {}
+ bare_metal_server_network_attachment_by_vlan_model_json['created_at'] = '2019-01-01T12:00:00Z'
+ bare_metal_server_network_attachment_by_vlan_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/2302-f7a2bf57-af7c-49d9-b599-b2c91293d30c/network_attachments/2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6'
+ bare_metal_server_network_attachment_by_vlan_model_json['id'] = '2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6'
+ bare_metal_server_network_attachment_by_vlan_model_json['lifecycle_state'] = 'stable'
+ bare_metal_server_network_attachment_by_vlan_model_json['name'] = 'my-bare-metal-server-network-attachment'
+ bare_metal_server_network_attachment_by_vlan_model_json['port_speed'] = 1000
+ bare_metal_server_network_attachment_by_vlan_model_json['primary_ip'] = reserved_ip_reference_model
+ bare_metal_server_network_attachment_by_vlan_model_json['resource_type'] = 'bare_metal_server_network_attachment'
+ bare_metal_server_network_attachment_by_vlan_model_json['subnet'] = subnet_reference_model
+ bare_metal_server_network_attachment_by_vlan_model_json['type'] = 'primary'
+ bare_metal_server_network_attachment_by_vlan_model_json['virtual_network_interface'] = virtual_network_interface_reference_attachment_context_model
+ bare_metal_server_network_attachment_by_vlan_model_json['allow_to_float'] = False
+ bare_metal_server_network_attachment_by_vlan_model_json['interface_type'] = 'vlan'
+ bare_metal_server_network_attachment_by_vlan_model_json['vlan'] = 4
+
+ # Construct a model instance of BareMetalServerNetworkAttachmentByVLAN by calling from_dict on the json representation
+ bare_metal_server_network_attachment_by_vlan_model = BareMetalServerNetworkAttachmentByVLAN.from_dict(bare_metal_server_network_attachment_by_vlan_model_json)
+ assert bare_metal_server_network_attachment_by_vlan_model != False
+
+ # Construct a model instance of BareMetalServerNetworkAttachmentByVLAN by calling from_dict on the json representation
+ bare_metal_server_network_attachment_by_vlan_model_dict = BareMetalServerNetworkAttachmentByVLAN.from_dict(bare_metal_server_network_attachment_by_vlan_model_json).__dict__
+ bare_metal_server_network_attachment_by_vlan_model2 = BareMetalServerNetworkAttachmentByVLAN(**bare_metal_server_network_attachment_by_vlan_model_dict)
# Verify the model instances are equivalent
- assert vpn_gateway_member_model == vpn_gateway_member_model2
+ assert bare_metal_server_network_attachment_by_vlan_model == bare_metal_server_network_attachment_by_vlan_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
+ bare_metal_server_network_attachment_by_vlan_model_json2 = bare_metal_server_network_attachment_by_vlan_model.to_dict()
+ assert bare_metal_server_network_attachment_by_vlan_model_json2 == bare_metal_server_network_attachment_by_vlan_model_json
-class TestModel_VPNGatewayMemberHealthReason:
+class TestModel_BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeBareMetalServerNetworkAttachmentContext:
"""
- Test Class for VPNGatewayMemberHealthReason
+ Test Class for BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeBareMetalServerNetworkAttachmentContext
"""
- def test_vpn_gateway_member_health_reason_serialization(self):
+ def test_bare_metal_server_network_attachment_prototype_virtual_network_interface_virtual_network_interface_prototype_bare_metal_server_network_attachment_context_serialization(self):
"""
- Test serialization/deserialization for VPNGatewayMemberHealthReason
+ Test serialization/deserialization for BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeBareMetalServerNetworkAttachmentContext
"""
- # Construct a json representation of a VPNGatewayMemberHealthReason model
- vpn_gateway_member_health_reason_model_json = {}
- vpn_gateway_member_health_reason_model_json['code'] = 'cannot_reserve_ip_address'
- vpn_gateway_member_health_reason_model_json['message'] = 'IP address exhaustion (release addresses on the VPN\'s subnet).'
- vpn_gateway_member_health_reason_model_json['more_info'] = 'https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health'
+ # Construct dict forms of any model objects needed in order to build this model.
- # Construct a model instance of VPNGatewayMemberHealthReason by calling from_dict on the json representation
- vpn_gateway_member_health_reason_model = VPNGatewayMemberHealthReason.from_dict(vpn_gateway_member_health_reason_model_json)
- assert vpn_gateway_member_health_reason_model != False
+ virtual_network_interface_ip_prototype_model = {} # VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext
+ virtual_network_interface_ip_prototype_model['address'] = '10.0.0.5'
+ virtual_network_interface_ip_prototype_model['auto_delete'] = False
+ virtual_network_interface_ip_prototype_model['name'] = 'my-reserved-ip'
- # Construct a model instance of VPNGatewayMemberHealthReason by calling from_dict on the json representation
- vpn_gateway_member_health_reason_model_dict = VPNGatewayMemberHealthReason.from_dict(vpn_gateway_member_health_reason_model_json).__dict__
- vpn_gateway_member_health_reason_model2 = VPNGatewayMemberHealthReason(**vpn_gateway_member_health_reason_model_dict)
+ virtual_network_interface_primary_ip_prototype_model = {} # VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext
+ virtual_network_interface_primary_ip_prototype_model['address'] = '10.0.0.5'
+ virtual_network_interface_primary_ip_prototype_model['auto_delete'] = False
+ virtual_network_interface_primary_ip_prototype_model['name'] = 'my-reserved-ip'
+
+ resource_group_identity_model = {} # ResourceGroupIdentityById
+ resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
+
+ security_group_identity_model = {} # SecurityGroupIdentityById
+ security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271'
+
+ subnet_identity_model = {} # SubnetIdentityById
+ subnet_identity_model['id'] = '2302-ea5fe79f-52c3-4f05-86ae-9540a10489f5'
+
+ # Construct a json representation of a BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeBareMetalServerNetworkAttachmentContext model
+ bare_metal_server_network_attachment_prototype_virtual_network_interface_virtual_network_interface_prototype_bare_metal_server_network_attachment_context_model_json = {}
+ bare_metal_server_network_attachment_prototype_virtual_network_interface_virtual_network_interface_prototype_bare_metal_server_network_attachment_context_model_json['allow_ip_spoofing'] = True
+ bare_metal_server_network_attachment_prototype_virtual_network_interface_virtual_network_interface_prototype_bare_metal_server_network_attachment_context_model_json['auto_delete'] = False
+ bare_metal_server_network_attachment_prototype_virtual_network_interface_virtual_network_interface_prototype_bare_metal_server_network_attachment_context_model_json['enable_infrastructure_nat'] = True
+ bare_metal_server_network_attachment_prototype_virtual_network_interface_virtual_network_interface_prototype_bare_metal_server_network_attachment_context_model_json['ips'] = [virtual_network_interface_ip_prototype_model]
+ bare_metal_server_network_attachment_prototype_virtual_network_interface_virtual_network_interface_prototype_bare_metal_server_network_attachment_context_model_json['name'] = 'my-virtual-network-interface'
+ bare_metal_server_network_attachment_prototype_virtual_network_interface_virtual_network_interface_prototype_bare_metal_server_network_attachment_context_model_json['primary_ip'] = virtual_network_interface_primary_ip_prototype_model
+ bare_metal_server_network_attachment_prototype_virtual_network_interface_virtual_network_interface_prototype_bare_metal_server_network_attachment_context_model_json['resource_group'] = resource_group_identity_model
+ bare_metal_server_network_attachment_prototype_virtual_network_interface_virtual_network_interface_prototype_bare_metal_server_network_attachment_context_model_json['security_groups'] = [security_group_identity_model]
+ bare_metal_server_network_attachment_prototype_virtual_network_interface_virtual_network_interface_prototype_bare_metal_server_network_attachment_context_model_json['subnet'] = subnet_identity_model
+
+ # Construct a model instance of BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeBareMetalServerNetworkAttachmentContext by calling from_dict on the json representation
+ bare_metal_server_network_attachment_prototype_virtual_network_interface_virtual_network_interface_prototype_bare_metal_server_network_attachment_context_model = BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeBareMetalServerNetworkAttachmentContext.from_dict(bare_metal_server_network_attachment_prototype_virtual_network_interface_virtual_network_interface_prototype_bare_metal_server_network_attachment_context_model_json)
+ assert bare_metal_server_network_attachment_prototype_virtual_network_interface_virtual_network_interface_prototype_bare_metal_server_network_attachment_context_model != False
+
+ # Construct a model instance of BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeBareMetalServerNetworkAttachmentContext by calling from_dict on the json representation
+ bare_metal_server_network_attachment_prototype_virtual_network_interface_virtual_network_interface_prototype_bare_metal_server_network_attachment_context_model_dict = BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeBareMetalServerNetworkAttachmentContext.from_dict(bare_metal_server_network_attachment_prototype_virtual_network_interface_virtual_network_interface_prototype_bare_metal_server_network_attachment_context_model_json).__dict__
+ bare_metal_server_network_attachment_prototype_virtual_network_interface_virtual_network_interface_prototype_bare_metal_server_network_attachment_context_model2 = BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeBareMetalServerNetworkAttachmentContext(**bare_metal_server_network_attachment_prototype_virtual_network_interface_virtual_network_interface_prototype_bare_metal_server_network_attachment_context_model_dict)
# Verify the model instances are equivalent
- assert vpn_gateway_member_health_reason_model == vpn_gateway_member_health_reason_model2
+ assert bare_metal_server_network_attachment_prototype_virtual_network_interface_virtual_network_interface_prototype_bare_metal_server_network_attachment_context_model == bare_metal_server_network_attachment_prototype_virtual_network_interface_virtual_network_interface_prototype_bare_metal_server_network_attachment_context_model2
# Convert model instance back to dict and verify no loss of data
- vpn_gateway_member_health_reason_model_json2 = vpn_gateway_member_health_reason_model.to_dict()
- assert vpn_gateway_member_health_reason_model_json2 == vpn_gateway_member_health_reason_model_json
+ bare_metal_server_network_attachment_prototype_virtual_network_interface_virtual_network_interface_prototype_bare_metal_server_network_attachment_context_model_json2 = bare_metal_server_network_attachment_prototype_virtual_network_interface_virtual_network_interface_prototype_bare_metal_server_network_attachment_context_model.to_dict()
+ assert bare_metal_server_network_attachment_prototype_virtual_network_interface_virtual_network_interface_prototype_bare_metal_server_network_attachment_context_model_json2 == bare_metal_server_network_attachment_prototype_virtual_network_interface_virtual_network_interface_prototype_bare_metal_server_network_attachment_context_model_json
-class TestModel_VPNGatewayMemberLifecycleReason:
+class TestModel_BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByPCIPrototype:
"""
- Test Class for VPNGatewayMemberLifecycleReason
+ Test Class for BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByPCIPrototype
"""
- def test_vpn_gateway_member_lifecycle_reason_serialization(self):
+ def test_bare_metal_server_network_attachment_prototype_bare_metal_server_network_attachment_by_pci_prototype_serialization(self):
"""
- Test serialization/deserialization for VPNGatewayMemberLifecycleReason
+ Test serialization/deserialization for BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByPCIPrototype
"""
- # Construct a json representation of a VPNGatewayMemberLifecycleReason model
- vpn_gateway_member_lifecycle_reason_model_json = {}
- vpn_gateway_member_lifecycle_reason_model_json['code'] = 'resource_suspended_by_provider'
- vpn_gateway_member_lifecycle_reason_model_json['message'] = 'The resource has been suspended. Contact IBM support with the CRN for next steps.'
- vpn_gateway_member_lifecycle_reason_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#resource-suspension'
-
- # Construct a model instance of VPNGatewayMemberLifecycleReason by calling from_dict on the json representation
- vpn_gateway_member_lifecycle_reason_model = VPNGatewayMemberLifecycleReason.from_dict(vpn_gateway_member_lifecycle_reason_model_json)
- assert vpn_gateway_member_lifecycle_reason_model != False
+ # Construct dict forms of any model objects needed in order to build this model.
- # Construct a model instance of VPNGatewayMemberLifecycleReason by calling from_dict on the json representation
- vpn_gateway_member_lifecycle_reason_model_dict = VPNGatewayMemberLifecycleReason.from_dict(vpn_gateway_member_lifecycle_reason_model_json).__dict__
- vpn_gateway_member_lifecycle_reason_model2 = VPNGatewayMemberLifecycleReason(**vpn_gateway_member_lifecycle_reason_model_dict)
+ virtual_network_interface_ip_prototype_model = {} # VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext
+ virtual_network_interface_ip_prototype_model['address'] = '10.0.0.5'
+ virtual_network_interface_ip_prototype_model['auto_delete'] = False
+ virtual_network_interface_ip_prototype_model['name'] = 'my-reserved-ip'
- # Verify the model instances are equivalent
- assert vpn_gateway_member_lifecycle_reason_model == vpn_gateway_member_lifecycle_reason_model2
+ virtual_network_interface_primary_ip_prototype_model = {} # VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext
+ virtual_network_interface_primary_ip_prototype_model['address'] = '10.0.0.5'
+ virtual_network_interface_primary_ip_prototype_model['auto_delete'] = False
+ virtual_network_interface_primary_ip_prototype_model['name'] = 'my-reserved-ip'
- # Convert model instance back to dict and verify no loss of data
- vpn_gateway_member_lifecycle_reason_model_json2 = vpn_gateway_member_lifecycle_reason_model.to_dict()
- assert vpn_gateway_member_lifecycle_reason_model_json2 == vpn_gateway_member_lifecycle_reason_model_json
+ resource_group_identity_model = {} # ResourceGroupIdentityById
+ resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
+ security_group_identity_model = {} # SecurityGroupIdentityById
+ security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271'
-class TestModel_VPNGatewayPatch:
- """
- Test Class for VPNGatewayPatch
- """
+ subnet_identity_model = {} # SubnetIdentityById
+ subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
- def test_vpn_gateway_patch_serialization(self):
- """
- Test serialization/deserialization for VPNGatewayPatch
- """
+ bare_metal_server_network_attachment_prototype_virtual_network_interface_model = {} # BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeBareMetalServerNetworkAttachmentContext
+ bare_metal_server_network_attachment_prototype_virtual_network_interface_model['allow_ip_spoofing'] = True
+ bare_metal_server_network_attachment_prototype_virtual_network_interface_model['auto_delete'] = False
+ bare_metal_server_network_attachment_prototype_virtual_network_interface_model['enable_infrastructure_nat'] = True
+ bare_metal_server_network_attachment_prototype_virtual_network_interface_model['ips'] = [virtual_network_interface_ip_prototype_model]
+ bare_metal_server_network_attachment_prototype_virtual_network_interface_model['name'] = 'my-virtual-network-interface'
+ bare_metal_server_network_attachment_prototype_virtual_network_interface_model['primary_ip'] = virtual_network_interface_primary_ip_prototype_model
+ bare_metal_server_network_attachment_prototype_virtual_network_interface_model['resource_group'] = resource_group_identity_model
+ bare_metal_server_network_attachment_prototype_virtual_network_interface_model['security_groups'] = [security_group_identity_model]
+ bare_metal_server_network_attachment_prototype_virtual_network_interface_model['subnet'] = subnet_identity_model
- # 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 BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByPCIPrototype model
+ bare_metal_server_network_attachment_prototype_bare_metal_server_network_attachment_by_pci_prototype_model_json = {}
+ bare_metal_server_network_attachment_prototype_bare_metal_server_network_attachment_by_pci_prototype_model_json['name'] = 'my-bare-metal-server-network-attachment'
+ bare_metal_server_network_attachment_prototype_bare_metal_server_network_attachment_by_pci_prototype_model_json['virtual_network_interface'] = bare_metal_server_network_attachment_prototype_virtual_network_interface_model
+ bare_metal_server_network_attachment_prototype_bare_metal_server_network_attachment_by_pci_prototype_model_json['allowed_vlans'] = []
+ bare_metal_server_network_attachment_prototype_bare_metal_server_network_attachment_by_pci_prototype_model_json['interface_type'] = 'pci'
- # 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 BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByPCIPrototype by calling from_dict on the json representation
+ bare_metal_server_network_attachment_prototype_bare_metal_server_network_attachment_by_pci_prototype_model = BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByPCIPrototype.from_dict(bare_metal_server_network_attachment_prototype_bare_metal_server_network_attachment_by_pci_prototype_model_json)
+ assert bare_metal_server_network_attachment_prototype_bare_metal_server_network_attachment_by_pci_prototype_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 BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByPCIPrototype by calling from_dict on the json representation
+ bare_metal_server_network_attachment_prototype_bare_metal_server_network_attachment_by_pci_prototype_model_dict = BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByPCIPrototype.from_dict(bare_metal_server_network_attachment_prototype_bare_metal_server_network_attachment_by_pci_prototype_model_json).__dict__
+ bare_metal_server_network_attachment_prototype_bare_metal_server_network_attachment_by_pci_prototype_model2 = BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByPCIPrototype(**bare_metal_server_network_attachment_prototype_bare_metal_server_network_attachment_by_pci_prototype_model_dict)
# Verify the model instances are equivalent
- assert vpn_gateway_patch_model == vpn_gateway_patch_model2
+ assert bare_metal_server_network_attachment_prototype_bare_metal_server_network_attachment_by_pci_prototype_model == bare_metal_server_network_attachment_prototype_bare_metal_server_network_attachment_by_pci_prototype_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
+ bare_metal_server_network_attachment_prototype_bare_metal_server_network_attachment_by_pci_prototype_model_json2 = bare_metal_server_network_attachment_prototype_bare_metal_server_network_attachment_by_pci_prototype_model.to_dict()
+ assert bare_metal_server_network_attachment_prototype_bare_metal_server_network_attachment_by_pci_prototype_model_json2 == bare_metal_server_network_attachment_prototype_bare_metal_server_network_attachment_by_pci_prototype_model_json
-class TestModel_VPNGatewayReferenceDeleted:
+class TestModel_BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByVLANPrototype:
"""
- Test Class for VPNGatewayReferenceDeleted
+ Test Class for BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByVLANPrototype
"""
- def test_vpn_gateway_reference_deleted_serialization(self):
+ def test_bare_metal_server_network_attachment_prototype_bare_metal_server_network_attachment_by_vlan_prototype_serialization(self):
"""
- Test serialization/deserialization for VPNGatewayReferenceDeleted
+ Test serialization/deserialization for BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByVLANPrototype
"""
- # Construct a json representation of a VPNGatewayReferenceDeleted model
- vpn_gateway_reference_deleted_model_json = {}
- vpn_gateway_reference_deleted_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ # Construct dict forms of any model objects needed in order to build this model.
- # Construct a model instance of VPNGatewayReferenceDeleted by calling from_dict on the json representation
- vpn_gateway_reference_deleted_model = VPNGatewayReferenceDeleted.from_dict(vpn_gateway_reference_deleted_model_json)
- assert vpn_gateway_reference_deleted_model != False
+ virtual_network_interface_ip_prototype_model = {} # VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext
+ virtual_network_interface_ip_prototype_model['address'] = '10.0.0.5'
+ virtual_network_interface_ip_prototype_model['auto_delete'] = False
+ virtual_network_interface_ip_prototype_model['name'] = 'my-reserved-ip'
- # Construct a model instance of VPNGatewayReferenceDeleted by calling from_dict on the json representation
- vpn_gateway_reference_deleted_model_dict = VPNGatewayReferenceDeleted.from_dict(vpn_gateway_reference_deleted_model_json).__dict__
- vpn_gateway_reference_deleted_model2 = VPNGatewayReferenceDeleted(**vpn_gateway_reference_deleted_model_dict)
+ virtual_network_interface_primary_ip_prototype_model = {} # VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext
+ virtual_network_interface_primary_ip_prototype_model['address'] = '10.0.0.5'
+ virtual_network_interface_primary_ip_prototype_model['auto_delete'] = False
+ virtual_network_interface_primary_ip_prototype_model['name'] = 'my-reserved-ip'
+
+ resource_group_identity_model = {} # ResourceGroupIdentityById
+ resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
+
+ security_group_identity_model = {} # SecurityGroupIdentityById
+ security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271'
+
+ subnet_identity_model = {} # SubnetIdentityById
+ subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
+
+ bare_metal_server_network_attachment_prototype_virtual_network_interface_model = {} # BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeBareMetalServerNetworkAttachmentContext
+ bare_metal_server_network_attachment_prototype_virtual_network_interface_model['allow_ip_spoofing'] = True
+ bare_metal_server_network_attachment_prototype_virtual_network_interface_model['auto_delete'] = False
+ bare_metal_server_network_attachment_prototype_virtual_network_interface_model['enable_infrastructure_nat'] = True
+ bare_metal_server_network_attachment_prototype_virtual_network_interface_model['ips'] = [virtual_network_interface_ip_prototype_model]
+ bare_metal_server_network_attachment_prototype_virtual_network_interface_model['name'] = 'my-virtual-network-interface'
+ bare_metal_server_network_attachment_prototype_virtual_network_interface_model['primary_ip'] = virtual_network_interface_primary_ip_prototype_model
+ bare_metal_server_network_attachment_prototype_virtual_network_interface_model['resource_group'] = resource_group_identity_model
+ bare_metal_server_network_attachment_prototype_virtual_network_interface_model['security_groups'] = [security_group_identity_model]
+ bare_metal_server_network_attachment_prototype_virtual_network_interface_model['subnet'] = subnet_identity_model
+
+ # Construct a json representation of a BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByVLANPrototype model
+ bare_metal_server_network_attachment_prototype_bare_metal_server_network_attachment_by_vlan_prototype_model_json = {}
+ bare_metal_server_network_attachment_prototype_bare_metal_server_network_attachment_by_vlan_prototype_model_json['name'] = 'my-bare-metal-server-network-attachment'
+ bare_metal_server_network_attachment_prototype_bare_metal_server_network_attachment_by_vlan_prototype_model_json['virtual_network_interface'] = bare_metal_server_network_attachment_prototype_virtual_network_interface_model
+ bare_metal_server_network_attachment_prototype_bare_metal_server_network_attachment_by_vlan_prototype_model_json['allow_to_float'] = False
+ bare_metal_server_network_attachment_prototype_bare_metal_server_network_attachment_by_vlan_prototype_model_json['interface_type'] = 'vlan'
+ bare_metal_server_network_attachment_prototype_bare_metal_server_network_attachment_by_vlan_prototype_model_json['vlan'] = 4
+
+ # Construct a model instance of BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByVLANPrototype by calling from_dict on the json representation
+ bare_metal_server_network_attachment_prototype_bare_metal_server_network_attachment_by_vlan_prototype_model = BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByVLANPrototype.from_dict(bare_metal_server_network_attachment_prototype_bare_metal_server_network_attachment_by_vlan_prototype_model_json)
+ assert bare_metal_server_network_attachment_prototype_bare_metal_server_network_attachment_by_vlan_prototype_model != False
+
+ # Construct a model instance of BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByVLANPrototype by calling from_dict on the json representation
+ bare_metal_server_network_attachment_prototype_bare_metal_server_network_attachment_by_vlan_prototype_model_dict = BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByVLANPrototype.from_dict(bare_metal_server_network_attachment_prototype_bare_metal_server_network_attachment_by_vlan_prototype_model_json).__dict__
+ bare_metal_server_network_attachment_prototype_bare_metal_server_network_attachment_by_vlan_prototype_model2 = BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByVLANPrototype(**bare_metal_server_network_attachment_prototype_bare_metal_server_network_attachment_by_vlan_prototype_model_dict)
# Verify the model instances are equivalent
- assert vpn_gateway_reference_deleted_model == vpn_gateway_reference_deleted_model2
+ assert bare_metal_server_network_attachment_prototype_bare_metal_server_network_attachment_by_vlan_prototype_model == bare_metal_server_network_attachment_prototype_bare_metal_server_network_attachment_by_vlan_prototype_model2
# Convert model instance back to dict and verify no loss of data
- vpn_gateway_reference_deleted_model_json2 = vpn_gateway_reference_deleted_model.to_dict()
- assert vpn_gateway_reference_deleted_model_json2 == vpn_gateway_reference_deleted_model_json
+ bare_metal_server_network_attachment_prototype_bare_metal_server_network_attachment_by_vlan_prototype_model_json2 = bare_metal_server_network_attachment_prototype_bare_metal_server_network_attachment_by_vlan_prototype_model.to_dict()
+ assert bare_metal_server_network_attachment_prototype_bare_metal_server_network_attachment_by_vlan_prototype_model_json2 == bare_metal_server_network_attachment_prototype_bare_metal_server_network_attachment_by_vlan_prototype_model_json
-class TestModel_VPNServer:
+class TestModel_BareMetalServerNetworkInterfaceByHiperSocket:
"""
- Test Class for VPNServer
+ Test Class for BareMetalServerNetworkInterfaceByHiperSocket
"""
- def test_vpn_server_serialization(self):
+ def test_bare_metal_server_network_interface_by_hiper_socket_serialization(self):
"""
- Test serialization/deserialization for VPNServer
+ Test serialization/deserialization for BareMetalServerNetworkInterfaceByHiperSocket
"""
# 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:secrets-manager:us-south:a/123456:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5'
-
- vpn_server_authentication_by_username_id_provider_model = {} # VPNServerAuthenticationByUsernameIdProviderByIAM
- vpn_server_authentication_by_username_id_provider_model['provider_type'] = 'iam'
-
- vpn_server_authentication_model = {} # VPNServerAuthenticationByUsername
- vpn_server_authentication_model['method'] = 'certificate'
- vpn_server_authentication_model['identity_provider'] = vpn_server_authentication_by_username_id_provider_model
-
- ip_model = {} # IP
- ip_model['address'] = '192.168.3.4'
-
- vpn_server_health_reason_model = {} # VPNServerHealthReason
- vpn_server_health_reason_model['code'] = 'cannot_access_server_certificate'
- vpn_server_health_reason_model['message'] = 'Failed to get VPN server\'s server certificate from Secrets Manager.'
- vpn_server_health_reason_model['more_info'] = 'https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-health'
+ floating_ip_reference_deleted_model = {} # FloatingIPReferenceDeleted
+ floating_ip_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- vpn_server_lifecycle_reason_model = {} # VPNServerLifecycleReason
- vpn_server_lifecycle_reason_model['code'] = 'resource_suspended_by_provider'
- vpn_server_lifecycle_reason_model['message'] = 'The resource has been suspended. Contact IBM support with the CRN for next steps.'
- vpn_server_lifecycle_reason_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#resource-suspension'
+ floating_ip_reference_model = {} # FloatingIPReference
+ floating_ip_reference_model['address'] = '203.0.113.1'
+ floating_ip_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689'
+ floating_ip_reference_model['deleted'] = floating_ip_reference_deleted_model
+ floating_ip_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689'
+ floating_ip_reference_model['id'] = '39300233-9995-4806-89a5-3c1b6eb88689'
+ floating_ip_reference_model['name'] = 'my-floating-ip'
reserved_ip_reference_deleted_model = {} # ReservedIPReferenceDeleted
reserved_ip_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
@@ -65397,11 +75837,6 @@ def test_vpn_server_serialization(self):
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'
@@ -65423,265 +75858,154 @@ def test_vpn_server_serialization(self):
subnet_reference_model['name'] = 'my-subnet'
subnet_reference_model['resource_type'] = 'subnet'
- vpc_reference_deleted_model = {} # VPCReferenceDeleted
- vpc_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
-
- vpc_reference_model = {} # VPCReference
- vpc_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b'
- vpc_reference_model['deleted'] = vpc_reference_deleted_model
- vpc_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b'
- vpc_reference_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b'
- vpc_reference_model['name'] = 'my-vpc'
- vpc_reference_model['resource_type'] = 'vpc'
-
- # Construct a json representation of a VPNServer model
- vpn_server_model_json = {}
- vpn_server_model_json['certificate'] = certificate_instance_reference_model
- vpn_server_model_json['client_authentication'] = [vpn_server_authentication_model]
- vpn_server_model_json['client_auto_delete'] = True
- vpn_server_model_json['client_auto_delete_timeout'] = 1
- vpn_server_model_json['client_dns_server_ips'] = [ip_model]
- vpn_server_model_json['client_idle_timeout'] = 600
- vpn_server_model_json['client_ip_pool'] = '172.16.0.0/16'
- vpn_server_model_json['created_at'] = '2019-01-01T12:00:00Z'
- vpn_server_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpn-server:r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5'
- vpn_server_model_json['enable_split_tunneling'] = True
- vpn_server_model_json['health_reasons'] = [vpn_server_health_reason_model]
- vpn_server_model_json['health_state'] = 'ok'
- vpn_server_model_json['hostname'] = 'a8506291.us-south.vpn-server.appdomain.cloud'
- vpn_server_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5'
- vpn_server_model_json['id'] = 'r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5'
- vpn_server_model_json['lifecycle_reasons'] = [vpn_server_lifecycle_reason_model]
- vpn_server_model_json['lifecycle_state'] = 'stable'
- vpn_server_model_json['name'] = 'my-vpn-server'
- vpn_server_model_json['port'] = 443
- vpn_server_model_json['private_ips'] = [reserved_ip_reference_model]
- vpn_server_model_json['protocol'] = 'udp'
- vpn_server_model_json['resource_group'] = resource_group_reference_model
- vpn_server_model_json['resource_type'] = 'vpn_server'
- vpn_server_model_json['security_groups'] = [security_group_reference_model]
- vpn_server_model_json['subnets'] = [subnet_reference_model]
- vpn_server_model_json['vpc'] = vpc_reference_model
-
- # Construct a model instance of VPNServer by calling from_dict on the json representation
- vpn_server_model = VPNServer.from_dict(vpn_server_model_json)
- assert vpn_server_model != False
-
- # Construct a model instance of VPNServer by calling from_dict on the json representation
- vpn_server_model_dict = VPNServer.from_dict(vpn_server_model_json).__dict__
- vpn_server_model2 = VPNServer(**vpn_server_model_dict)
-
- # Verify the model instances are equivalent
- assert vpn_server_model == vpn_server_model2
-
- # Convert model instance back to dict and verify no loss of data
- vpn_server_model_json2 = vpn_server_model.to_dict()
- assert vpn_server_model_json2 == vpn_server_model_json
-
-
-class TestModel_VPNServerClient:
- """
- Test Class for VPNServerClient
- """
-
- def test_vpn_server_client_serialization(self):
- """
- Test serialization/deserialization for VPNServerClient
- """
-
- # 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 VPNServerClient model
- vpn_server_client_model_json = {}
- vpn_server_client_model_json['client_ip'] = ip_model
- vpn_server_client_model_json['common_name'] = 'testString'
- vpn_server_client_model_json['created_at'] = '2019-01-01T12:00:00Z'
- vpn_server_client_model_json['disconnected_at'] = '2019-01-01T12:00:00Z'
- vpn_server_client_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/8e454ead-0db7-48ac-9a8b-2698d8c470a7/clients/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531'
- vpn_server_client_model_json['id'] = 'r006-1a15dca5-7e33-45e1-b7c5-bc690e569531'
- vpn_server_client_model_json['remote_ip'] = ip_model
- vpn_server_client_model_json['remote_port'] = 22
- vpn_server_client_model_json['resource_type'] = 'vpn_server_client'
- vpn_server_client_model_json['status'] = 'connected'
- vpn_server_client_model_json['username'] = 'testString'
+ # Construct a json representation of a BareMetalServerNetworkInterfaceByHiperSocket model
+ bare_metal_server_network_interface_by_hiper_socket_model_json = {}
+ bare_metal_server_network_interface_by_hiper_socket_model_json['allow_ip_spoofing'] = True
+ bare_metal_server_network_interface_by_hiper_socket_model_json['created_at'] = '2019-01-01T12:00:00Z'
+ bare_metal_server_network_interface_by_hiper_socket_model_json['enable_infrastructure_nat'] = True
+ bare_metal_server_network_interface_by_hiper_socket_model_json['floating_ips'] = [floating_ip_reference_model]
+ bare_metal_server_network_interface_by_hiper_socket_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e'
+ bare_metal_server_network_interface_by_hiper_socket_model_json['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e'
+ bare_metal_server_network_interface_by_hiper_socket_model_json['mac_address'] = '02:00:04:00:C4:6A'
+ bare_metal_server_network_interface_by_hiper_socket_model_json['name'] = 'my-bare-metal-server-network-interface'
+ bare_metal_server_network_interface_by_hiper_socket_model_json['port_speed'] = 1000
+ bare_metal_server_network_interface_by_hiper_socket_model_json['primary_ip'] = reserved_ip_reference_model
+ bare_metal_server_network_interface_by_hiper_socket_model_json['resource_type'] = 'network_interface'
+ bare_metal_server_network_interface_by_hiper_socket_model_json['security_groups'] = [security_group_reference_model]
+ bare_metal_server_network_interface_by_hiper_socket_model_json['status'] = 'available'
+ bare_metal_server_network_interface_by_hiper_socket_model_json['subnet'] = subnet_reference_model
+ bare_metal_server_network_interface_by_hiper_socket_model_json['type'] = 'primary'
+ bare_metal_server_network_interface_by_hiper_socket_model_json['interface_type'] = 'hipersocket'
- # Construct a model instance of VPNServerClient by calling from_dict on the json representation
- vpn_server_client_model = VPNServerClient.from_dict(vpn_server_client_model_json)
- assert vpn_server_client_model != False
+ # Construct a model instance of BareMetalServerNetworkInterfaceByHiperSocket by calling from_dict on the json representation
+ bare_metal_server_network_interface_by_hiper_socket_model = BareMetalServerNetworkInterfaceByHiperSocket.from_dict(bare_metal_server_network_interface_by_hiper_socket_model_json)
+ assert bare_metal_server_network_interface_by_hiper_socket_model != False
- # Construct a model instance of VPNServerClient by calling from_dict on the json representation
- vpn_server_client_model_dict = VPNServerClient.from_dict(vpn_server_client_model_json).__dict__
- vpn_server_client_model2 = VPNServerClient(**vpn_server_client_model_dict)
+ # Construct a model instance of BareMetalServerNetworkInterfaceByHiperSocket by calling from_dict on the json representation
+ bare_metal_server_network_interface_by_hiper_socket_model_dict = BareMetalServerNetworkInterfaceByHiperSocket.from_dict(bare_metal_server_network_interface_by_hiper_socket_model_json).__dict__
+ bare_metal_server_network_interface_by_hiper_socket_model2 = BareMetalServerNetworkInterfaceByHiperSocket(**bare_metal_server_network_interface_by_hiper_socket_model_dict)
# Verify the model instances are equivalent
- assert vpn_server_client_model == vpn_server_client_model2
+ assert bare_metal_server_network_interface_by_hiper_socket_model == bare_metal_server_network_interface_by_hiper_socket_model2
# Convert model instance back to dict and verify no loss of data
- vpn_server_client_model_json2 = vpn_server_client_model.to_dict()
- assert vpn_server_client_model_json2 == vpn_server_client_model_json
+ bare_metal_server_network_interface_by_hiper_socket_model_json2 = bare_metal_server_network_interface_by_hiper_socket_model.to_dict()
+ assert bare_metal_server_network_interface_by_hiper_socket_model_json2 == bare_metal_server_network_interface_by_hiper_socket_model_json
-class TestModel_VPNServerClientCollection:
+class TestModel_BareMetalServerNetworkInterfaceByPCI:
"""
- Test Class for VPNServerClientCollection
+ Test Class for BareMetalServerNetworkInterfaceByPCI
"""
- def test_vpn_server_client_collection_serialization(self):
+ def test_bare_metal_server_network_interface_by_pci_serialization(self):
"""
- Test serialization/deserialization for VPNServerClientCollection
+ Test serialization/deserialization for BareMetalServerNetworkInterfaceByPCI
"""
# Construct dict forms of any model objects needed in order to build this model.
- ip_model = {} # IP
- ip_model['address'] = '192.168.3.4'
-
- vpn_server_client_model = {} # VPNServerClient
- vpn_server_client_model['client_ip'] = ip_model
- vpn_server_client_model['common_name'] = 'testString'
- vpn_server_client_model['created_at'] = '2019-01-01T12:00:00Z'
- vpn_server_client_model['disconnected_at'] = '2019-01-01T12:00:00Z'
- vpn_server_client_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/8e454ead-0db7-48ac-9a8b-2698d8c470a7/clients/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531'
- vpn_server_client_model['id'] = 'r006-1a15dca5-7e33-45e1-b7c5-bc690e569531'
- vpn_server_client_model['remote_ip'] = ip_model
- vpn_server_client_model['remote_port'] = 22
- vpn_server_client_model['resource_type'] = 'vpn_server_client'
- vpn_server_client_model['status'] = 'connected'
- vpn_server_client_model['username'] = 'testString'
-
- vpn_server_client_collection_first_model = {} # VPNServerClientCollectionFirst
- vpn_server_client_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-982d72b7-db1b-4606-afb2-ed6bd4b0bed1/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531/clients?limit=20'
-
- vpn_server_client_collection_next_model = {} # VPNServerClientCollectionNext
- vpn_server_client_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-982d72b7-db1b-4606-afb2-ed6bd4b0bed1/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531/clients?start=a5e812a2-62c0-4555-86a5-907106760c56&limit=20'
-
- # Construct a json representation of a VPNServerClientCollection model
- vpn_server_client_collection_model_json = {}
- vpn_server_client_collection_model_json['clients'] = [vpn_server_client_model]
- vpn_server_client_collection_model_json['first'] = vpn_server_client_collection_first_model
- vpn_server_client_collection_model_json['limit'] = 20
- vpn_server_client_collection_model_json['next'] = vpn_server_client_collection_next_model
- vpn_server_client_collection_model_json['total_count'] = 132
-
- # Construct a model instance of VPNServerClientCollection by calling from_dict on the json representation
- vpn_server_client_collection_model = VPNServerClientCollection.from_dict(vpn_server_client_collection_model_json)
- assert vpn_server_client_collection_model != False
-
- # Construct a model instance of VPNServerClientCollection by calling from_dict on the json representation
- vpn_server_client_collection_model_dict = VPNServerClientCollection.from_dict(vpn_server_client_collection_model_json).__dict__
- vpn_server_client_collection_model2 = VPNServerClientCollection(**vpn_server_client_collection_model_dict)
-
- # Verify the model instances are equivalent
- assert vpn_server_client_collection_model == vpn_server_client_collection_model2
-
- # Convert model instance back to dict and verify no loss of data
- vpn_server_client_collection_model_json2 = vpn_server_client_collection_model.to_dict()
- assert vpn_server_client_collection_model_json2 == vpn_server_client_collection_model_json
-
-
-class TestModel_VPNServerClientCollectionFirst:
- """
- Test Class for VPNServerClientCollectionFirst
- """
-
- def test_vpn_server_client_collection_first_serialization(self):
- """
- Test serialization/deserialization for VPNServerClientCollectionFirst
- """
-
- # Construct a json representation of a VPNServerClientCollectionFirst model
- vpn_server_client_collection_first_model_json = {}
- vpn_server_client_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-982d72b7-db1b-4606-afb2-ed6bd4b0bed1/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531/clients?limit=20'
+ 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 VPNServerClientCollectionFirst by calling from_dict on the json representation
- vpn_server_client_collection_first_model = VPNServerClientCollectionFirst.from_dict(vpn_server_client_collection_first_model_json)
- assert vpn_server_client_collection_first_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 VPNServerClientCollectionFirst by calling from_dict on the json representation
- vpn_server_client_collection_first_model_dict = VPNServerClientCollectionFirst.from_dict(vpn_server_client_collection_first_model_json).__dict__
- vpn_server_client_collection_first_model2 = VPNServerClientCollectionFirst(**vpn_server_client_collection_first_model_dict)
+ reserved_ip_reference_deleted_model = {} # ReservedIPReferenceDeleted
+ reserved_ip_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Verify the model instances are equivalent
- assert vpn_server_client_collection_first_model == vpn_server_client_collection_first_model2
+ 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'
- # Convert model instance back to dict and verify no loss of data
- vpn_server_client_collection_first_model_json2 = vpn_server_client_collection_first_model.to_dict()
- assert vpn_server_client_collection_first_model_json2 == vpn_server_client_collection_first_model_json
+ 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'
-class TestModel_VPNServerClientCollectionNext:
- """
- Test Class for VPNServerClientCollectionNext
- """
+ subnet_reference_deleted_model = {} # SubnetReferenceDeleted
+ subnet_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- def test_vpn_server_client_collection_next_serialization(self):
- """
- Test serialization/deserialization for VPNServerClientCollectionNext
- """
+ subnet_reference_model = {} # SubnetReference
+ subnet_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
+ subnet_reference_model['deleted'] = subnet_reference_deleted_model
+ subnet_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
+ subnet_reference_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
+ subnet_reference_model['name'] = 'my-subnet'
+ subnet_reference_model['resource_type'] = 'subnet'
- # Construct a json representation of a VPNServerClientCollectionNext model
- vpn_server_client_collection_next_model_json = {}
- vpn_server_client_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-982d72b7-db1b-4606-afb2-ed6bd4b0bed1/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531/clients?start=a5e812a2-62c0-4555-86a5-907106760c56&limit=20'
+ # Construct a json representation of a BareMetalServerNetworkInterfaceByPCI model
+ bare_metal_server_network_interface_by_pci_model_json = {}
+ bare_metal_server_network_interface_by_pci_model_json['allow_ip_spoofing'] = True
+ bare_metal_server_network_interface_by_pci_model_json['created_at'] = '2019-01-01T12:00:00Z'
+ bare_metal_server_network_interface_by_pci_model_json['enable_infrastructure_nat'] = True
+ bare_metal_server_network_interface_by_pci_model_json['floating_ips'] = [floating_ip_reference_model]
+ bare_metal_server_network_interface_by_pci_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e'
+ bare_metal_server_network_interface_by_pci_model_json['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e'
+ bare_metal_server_network_interface_by_pci_model_json['mac_address'] = '02:00:04:00:C4:6A'
+ bare_metal_server_network_interface_by_pci_model_json['name'] = 'my-bare-metal-server-network-interface'
+ bare_metal_server_network_interface_by_pci_model_json['port_speed'] = 1000
+ bare_metal_server_network_interface_by_pci_model_json['primary_ip'] = reserved_ip_reference_model
+ bare_metal_server_network_interface_by_pci_model_json['resource_type'] = 'network_interface'
+ bare_metal_server_network_interface_by_pci_model_json['security_groups'] = [security_group_reference_model]
+ bare_metal_server_network_interface_by_pci_model_json['status'] = 'available'
+ bare_metal_server_network_interface_by_pci_model_json['subnet'] = subnet_reference_model
+ bare_metal_server_network_interface_by_pci_model_json['type'] = 'primary'
+ bare_metal_server_network_interface_by_pci_model_json['allowed_vlans'] = [4]
+ bare_metal_server_network_interface_by_pci_model_json['interface_type'] = 'pci'
- # Construct a model instance of VPNServerClientCollectionNext by calling from_dict on the json representation
- vpn_server_client_collection_next_model = VPNServerClientCollectionNext.from_dict(vpn_server_client_collection_next_model_json)
- assert vpn_server_client_collection_next_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 VPNServerClientCollectionNext by calling from_dict on the json representation
- vpn_server_client_collection_next_model_dict = VPNServerClientCollectionNext.from_dict(vpn_server_client_collection_next_model_json).__dict__
- vpn_server_client_collection_next_model2 = VPNServerClientCollectionNext(**vpn_server_client_collection_next_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 vpn_server_client_collection_next_model == vpn_server_client_collection_next_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
- vpn_server_client_collection_next_model_json2 = vpn_server_client_collection_next_model.to_dict()
- assert vpn_server_client_collection_next_model_json2 == vpn_server_client_collection_next_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_VPNServerCollection:
+class TestModel_BareMetalServerNetworkInterfaceByVLAN:
"""
- Test Class for VPNServerCollection
+ Test Class for BareMetalServerNetworkInterfaceByVLAN
"""
- def test_vpn_server_collection_serialization(self):
+ def test_bare_metal_server_network_interface_by_vlan_serialization(self):
"""
- Test serialization/deserialization for VPNServerCollection
+ Test serialization/deserialization for BareMetalServerNetworkInterfaceByVLAN
"""
# Construct dict forms of any model objects needed in order to build this model.
- vpn_server_collection_first_model = {} # VPNServerCollectionFirst
- vpn_server_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpn_servers?limit=20'
-
- vpn_server_collection_next_model = {} # VPNServerCollectionNext
- vpn_server_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpn_servers?start=ffd653466e284937896724b2dd044c9c&limit=20'
-
- certificate_instance_reference_model = {} # CertificateInstanceReference
- certificate_instance_reference_model['crn'] = 'crn:v1:bluemix:public:secrets-manager:us-south:a/123456:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5'
-
- vpn_server_authentication_by_username_id_provider_model = {} # VPNServerAuthenticationByUsernameIdProviderByIAM
- vpn_server_authentication_by_username_id_provider_model['provider_type'] = 'iam'
-
- vpn_server_authentication_model = {} # VPNServerAuthenticationByUsername
- vpn_server_authentication_model['method'] = 'certificate'
- vpn_server_authentication_model['identity_provider'] = vpn_server_authentication_by_username_id_provider_model
-
- ip_model = {} # IP
- ip_model['address'] = '192.168.3.4'
-
- vpn_server_health_reason_model = {} # VPNServerHealthReason
- vpn_server_health_reason_model['code'] = 'cannot_access_server_certificate'
- vpn_server_health_reason_model['message'] = 'Failed to get VPN server\'s server certificate from Secrets Manager.'
- vpn_server_health_reason_model['more_info'] = 'https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-health'
+ floating_ip_reference_deleted_model = {} # FloatingIPReferenceDeleted
+ floating_ip_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- vpn_server_lifecycle_reason_model = {} # VPNServerLifecycleReason
- vpn_server_lifecycle_reason_model['code'] = 'resource_suspended_by_provider'
- vpn_server_lifecycle_reason_model['message'] = 'The resource has been suspended. Contact IBM support with the CRN for next steps.'
- vpn_server_lifecycle_reason_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#resource-suspension'
+ floating_ip_reference_model = {} # FloatingIPReference
+ floating_ip_reference_model['address'] = '203.0.113.1'
+ floating_ip_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689'
+ floating_ip_reference_model['deleted'] = floating_ip_reference_deleted_model
+ floating_ip_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689'
+ floating_ip_reference_model['id'] = '39300233-9995-4806-89a5-3c1b6eb88689'
+ floating_ip_reference_model['name'] = 'my-floating-ip'
reserved_ip_reference_deleted_model = {} # ReservedIPReferenceDeleted
reserved_ip_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
@@ -65694,11 +76018,6 @@ def test_vpn_server_collection_serialization(self):
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'
@@ -65720,2733 +76039,2609 @@ def test_vpn_server_collection_serialization(self):
subnet_reference_model['name'] = 'my-subnet'
subnet_reference_model['resource_type'] = 'subnet'
- vpc_reference_deleted_model = {} # VPCReferenceDeleted
- vpc_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
-
- vpc_reference_model = {} # VPCReference
- vpc_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b'
- vpc_reference_model['deleted'] = vpc_reference_deleted_model
- vpc_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b'
- vpc_reference_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b'
- vpc_reference_model['name'] = 'my-vpc'
- vpc_reference_model['resource_type'] = 'vpc'
-
- vpn_server_model = {} # VPNServer
- vpn_server_model['certificate'] = certificate_instance_reference_model
- vpn_server_model['client_authentication'] = [vpn_server_authentication_model]
- vpn_server_model['client_auto_delete'] = True
- vpn_server_model['client_auto_delete_timeout'] = 1
- vpn_server_model['client_dns_server_ips'] = [ip_model]
- vpn_server_model['client_idle_timeout'] = 600
- vpn_server_model['client_ip_pool'] = '172.16.0.0/16'
- vpn_server_model['created_at'] = '2019-01-01T12:00:00Z'
- vpn_server_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpn-server:r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5'
- vpn_server_model['enable_split_tunneling'] = True
- vpn_server_model['health_reasons'] = [vpn_server_health_reason_model]
- vpn_server_model['health_state'] = 'ok'
- vpn_server_model['hostname'] = 'a8506291.us-south.vpn-server.appdomain.cloud'
- vpn_server_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5'
- vpn_server_model['id'] = 'r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5'
- vpn_server_model['lifecycle_reasons'] = [vpn_server_lifecycle_reason_model]
- vpn_server_model['lifecycle_state'] = 'stable'
- vpn_server_model['name'] = 'my-vpn-server'
- vpn_server_model['port'] = 443
- vpn_server_model['private_ips'] = [reserved_ip_reference_model]
- vpn_server_model['protocol'] = 'udp'
- vpn_server_model['resource_group'] = resource_group_reference_model
- vpn_server_model['resource_type'] = 'vpn_server'
- vpn_server_model['security_groups'] = [security_group_reference_model]
- vpn_server_model['subnets'] = [subnet_reference_model]
- vpn_server_model['vpc'] = vpc_reference_model
-
- # Construct a json representation of a VPNServerCollection model
- vpn_server_collection_model_json = {}
- vpn_server_collection_model_json['first'] = vpn_server_collection_first_model
- vpn_server_collection_model_json['limit'] = 20
- vpn_server_collection_model_json['next'] = vpn_server_collection_next_model
- vpn_server_collection_model_json['total_count'] = 132
- vpn_server_collection_model_json['vpn_servers'] = [vpn_server_model]
+ # 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['mac_address'] = '02:00:04:00:C4:6A'
+ bare_metal_server_network_interface_by_vlan_model_json['name'] = 'my-bare-metal-server-network-interface'
+ bare_metal_server_network_interface_by_vlan_model_json['port_speed'] = 1000
+ bare_metal_server_network_interface_by_vlan_model_json['primary_ip'] = reserved_ip_reference_model
+ bare_metal_server_network_interface_by_vlan_model_json['resource_type'] = 'network_interface'
+ 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['interface_type'] = 'vlan'
+ bare_metal_server_network_interface_by_vlan_model_json['vlan'] = 4
- # Construct a model instance of VPNServerCollection by calling from_dict on the json representation
- vpn_server_collection_model = VPNServerCollection.from_dict(vpn_server_collection_model_json)
- assert vpn_server_collection_model != False
+ # 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 VPNServerCollection by calling from_dict on the json representation
- vpn_server_collection_model_dict = VPNServerCollection.from_dict(vpn_server_collection_model_json).__dict__
- vpn_server_collection_model2 = VPNServerCollection(**vpn_server_collection_model_dict)
+ # 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 vpn_server_collection_model == vpn_server_collection_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
- vpn_server_collection_model_json2 = vpn_server_collection_model.to_dict()
- assert vpn_server_collection_model_json2 == vpn_server_collection_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_VPNServerCollectionFirst:
+class TestModel_BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype:
"""
- Test Class for VPNServerCollectionFirst
+ Test Class for BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype
"""
- def test_vpn_server_collection_first_serialization(self):
+ def test_bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_hiper_socket_prototype_serialization(self):
"""
- Test serialization/deserialization for VPNServerCollectionFirst
+ Test serialization/deserialization for BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype
"""
- # Construct a json representation of a VPNServerCollectionFirst model
- vpn_server_collection_first_model_json = {}
- vpn_server_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpn_servers?limit=20'
-
- # Construct a model instance of VPNServerCollectionFirst by calling from_dict on the json representation
- vpn_server_collection_first_model = VPNServerCollectionFirst.from_dict(vpn_server_collection_first_model_json)
- assert vpn_server_collection_first_model != False
-
- # Construct a model instance of VPNServerCollectionFirst by calling from_dict on the json representation
- vpn_server_collection_first_model_dict = VPNServerCollectionFirst.from_dict(vpn_server_collection_first_model_json).__dict__
- vpn_server_collection_first_model2 = VPNServerCollectionFirst(**vpn_server_collection_first_model_dict)
-
- # Verify the model instances are equivalent
- assert vpn_server_collection_first_model == vpn_server_collection_first_model2
-
- # Convert model instance back to dict and verify no loss of data
- vpn_server_collection_first_model_json2 = vpn_server_collection_first_model.to_dict()
- assert vpn_server_collection_first_model_json2 == vpn_server_collection_first_model_json
+ # Construct dict forms of any model objects needed in order to build this model.
+ network_interface_ip_prototype_model = {} # NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext
+ network_interface_ip_prototype_model['address'] = '10.0.0.5'
+ network_interface_ip_prototype_model['auto_delete'] = False
+ network_interface_ip_prototype_model['name'] = 'my-reserved-ip'
-class TestModel_VPNServerCollectionNext:
- """
- Test Class for VPNServerCollectionNext
- """
+ security_group_identity_model = {} # SecurityGroupIdentityById
+ security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271'
- def test_vpn_server_collection_next_serialization(self):
- """
- Test serialization/deserialization for VPNServerCollectionNext
- """
+ subnet_identity_model = {} # SubnetIdentityById
+ subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
- # Construct a json representation of a VPNServerCollectionNext model
- vpn_server_collection_next_model_json = {}
- vpn_server_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpn_servers?start=ffd653466e284937896724b2dd044c9c&limit=20'
+ # Construct a json representation of a BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype model
+ bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_hiper_socket_prototype_model_json = {}
+ bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_hiper_socket_prototype_model_json['allow_ip_spoofing'] = True
+ bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_hiper_socket_prototype_model_json['enable_infrastructure_nat'] = True
+ bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_hiper_socket_prototype_model_json['name'] = 'my-bare-metal-server-network-interface'
+ bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_hiper_socket_prototype_model_json['primary_ip'] = network_interface_ip_prototype_model
+ bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_hiper_socket_prototype_model_json['security_groups'] = [security_group_identity_model]
+ bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_hiper_socket_prototype_model_json['subnet'] = subnet_identity_model
+ bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_hiper_socket_prototype_model_json['interface_type'] = 'hipersocket'
- # Construct a model instance of VPNServerCollectionNext by calling from_dict on the json representation
- vpn_server_collection_next_model = VPNServerCollectionNext.from_dict(vpn_server_collection_next_model_json)
- assert vpn_server_collection_next_model != False
+ # Construct a model instance of BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype by calling from_dict on the json representation
+ bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_hiper_socket_prototype_model = BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype.from_dict(bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_hiper_socket_prototype_model_json)
+ assert bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_hiper_socket_prototype_model != False
- # Construct a model instance of VPNServerCollectionNext by calling from_dict on the json representation
- vpn_server_collection_next_model_dict = VPNServerCollectionNext.from_dict(vpn_server_collection_next_model_json).__dict__
- vpn_server_collection_next_model2 = VPNServerCollectionNext(**vpn_server_collection_next_model_dict)
+ # Construct a model instance of BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype by calling from_dict on the json representation
+ bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_hiper_socket_prototype_model_dict = BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype.from_dict(bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_hiper_socket_prototype_model_json).__dict__
+ bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_hiper_socket_prototype_model2 = BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype(**bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_hiper_socket_prototype_model_dict)
# Verify the model instances are equivalent
- assert vpn_server_collection_next_model == vpn_server_collection_next_model2
+ assert bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_hiper_socket_prototype_model == bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_hiper_socket_prototype_model2
# Convert model instance back to dict and verify no loss of data
- vpn_server_collection_next_model_json2 = vpn_server_collection_next_model.to_dict()
- assert vpn_server_collection_next_model_json2 == vpn_server_collection_next_model_json
+ bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_hiper_socket_prototype_model_json2 = bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_hiper_socket_prototype_model.to_dict()
+ assert bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_hiper_socket_prototype_model_json2 == bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_hiper_socket_prototype_model_json
-class TestModel_VPNServerHealthReason:
+class TestModel_BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPCIPrototype:
"""
- Test Class for VPNServerHealthReason
+ Test Class for BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPCIPrototype
"""
- def test_vpn_server_health_reason_serialization(self):
+ def test_bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_pci_prototype_serialization(self):
"""
- Test serialization/deserialization for VPNServerHealthReason
+ Test serialization/deserialization for BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPCIPrototype
"""
- # Construct a json representation of a VPNServerHealthReason model
- vpn_server_health_reason_model_json = {}
- vpn_server_health_reason_model_json['code'] = 'cannot_access_server_certificate'
- vpn_server_health_reason_model_json['message'] = 'Failed to get VPN server\'s server certificate from Secrets Manager.'
- vpn_server_health_reason_model_json['more_info'] = 'https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-health'
+ # Construct dict forms of any model objects needed in order to build this model.
- # Construct a model instance of VPNServerHealthReason by calling from_dict on the json representation
- vpn_server_health_reason_model = VPNServerHealthReason.from_dict(vpn_server_health_reason_model_json)
- assert vpn_server_health_reason_model != False
+ network_interface_ip_prototype_model = {} # NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext
+ network_interface_ip_prototype_model['address'] = '10.0.0.5'
+ network_interface_ip_prototype_model['auto_delete'] = False
+ network_interface_ip_prototype_model['name'] = 'my-reserved-ip'
- # Construct a model instance of VPNServerHealthReason by calling from_dict on the json representation
- vpn_server_health_reason_model_dict = VPNServerHealthReason.from_dict(vpn_server_health_reason_model_json).__dict__
- vpn_server_health_reason_model2 = VPNServerHealthReason(**vpn_server_health_reason_model_dict)
+ 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 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['name'] = 'my-bare-metal-server-network-interface'
+ bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_pci_prototype_model_json['primary_ip'] = network_interface_ip_prototype_model
+ bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_pci_prototype_model_json['security_groups'] = [security_group_identity_model]
+ bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_pci_prototype_model_json['subnet'] = subnet_identity_model
+ bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_pci_prototype_model_json['allowed_vlans'] = []
+ bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_pci_prototype_model_json['interface_type'] = 'pci'
+
+ # 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 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 vpn_server_health_reason_model == vpn_server_health_reason_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
- vpn_server_health_reason_model_json2 = vpn_server_health_reason_model.to_dict()
- assert vpn_server_health_reason_model_json2 == vpn_server_health_reason_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_VPNServerLifecycleReason:
+class TestModel_BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVLANPrototype:
"""
- Test Class for VPNServerLifecycleReason
+ Test Class for BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVLANPrototype
"""
- def test_vpn_server_lifecycle_reason_serialization(self):
+ def test_bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_vlan_prototype_serialization(self):
"""
- Test serialization/deserialization for VPNServerLifecycleReason
+ Test serialization/deserialization for BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVLANPrototype
"""
- # Construct a json representation of a VPNServerLifecycleReason model
- vpn_server_lifecycle_reason_model_json = {}
- vpn_server_lifecycle_reason_model_json['code'] = 'resource_suspended_by_provider'
- vpn_server_lifecycle_reason_model_json['message'] = 'The resource has been suspended. Contact IBM support with the CRN for next steps.'
- vpn_server_lifecycle_reason_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#resource-suspension'
+ # Construct dict forms of any model objects needed in order to build this model.
- # Construct a model instance of VPNServerLifecycleReason by calling from_dict on the json representation
- vpn_server_lifecycle_reason_model = VPNServerLifecycleReason.from_dict(vpn_server_lifecycle_reason_model_json)
- assert vpn_server_lifecycle_reason_model != False
+ network_interface_ip_prototype_model = {} # NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext
+ network_interface_ip_prototype_model['address'] = '10.0.0.5'
+ network_interface_ip_prototype_model['auto_delete'] = False
+ network_interface_ip_prototype_model['name'] = 'my-reserved-ip'
- # Construct a model instance of VPNServerLifecycleReason by calling from_dict on the json representation
- vpn_server_lifecycle_reason_model_dict = VPNServerLifecycleReason.from_dict(vpn_server_lifecycle_reason_model_json).__dict__
- vpn_server_lifecycle_reason_model2 = VPNServerLifecycleReason(**vpn_server_lifecycle_reason_model_dict)
+ 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 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['name'] = 'my-bare-metal-server-network-interface'
+ bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_vlan_prototype_model_json['primary_ip'] = network_interface_ip_prototype_model
+ bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_vlan_prototype_model_json['security_groups'] = [security_group_identity_model]
+ bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_vlan_prototype_model_json['subnet'] = subnet_identity_model
+ 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['interface_type'] = 'vlan'
+ bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_vlan_prototype_model_json['vlan'] = 4
+
+ # 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 vpn_server_lifecycle_reason_model == vpn_server_lifecycle_reason_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
- vpn_server_lifecycle_reason_model_json2 = vpn_server_lifecycle_reason_model.to_dict()
- assert vpn_server_lifecycle_reason_model_json2 == vpn_server_lifecycle_reason_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_VPNServerPatch:
+class TestModel_BareMetalServerPrimaryNetworkAttachmentPrototypeBareMetalServerPrimaryNetworkAttachmentByPCIPrototype:
"""
- Test Class for VPNServerPatch
+ Test Class for BareMetalServerPrimaryNetworkAttachmentPrototypeBareMetalServerPrimaryNetworkAttachmentByPCIPrototype
"""
- def test_vpn_server_patch_serialization(self):
+ def test_bare_metal_server_primary_network_attachment_prototype_bare_metal_server_primary_network_attachment_by_pci_prototype_serialization(self):
"""
- Test serialization/deserialization for VPNServerPatch
+ Test serialization/deserialization for BareMetalServerPrimaryNetworkAttachmentPrototypeBareMetalServerPrimaryNetworkAttachmentByPCIPrototype
"""
# Construct dict forms of any model objects needed in order to build this model.
- certificate_instance_identity_model = {} # CertificateInstanceIdentityByCRN
- certificate_instance_identity_model['crn'] = 'crn:v1:bluemix:public:secrets-manager:us-south:a/123456:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5'
+ virtual_network_interface_ip_prototype_model = {} # VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext
+ virtual_network_interface_ip_prototype_model['address'] = '10.0.0.5'
+ virtual_network_interface_ip_prototype_model['auto_delete'] = False
+ virtual_network_interface_ip_prototype_model['name'] = 'my-reserved-ip'
- vpn_server_authentication_by_username_id_provider_model = {} # VPNServerAuthenticationByUsernameIdProviderByIAM
- vpn_server_authentication_by_username_id_provider_model['provider_type'] = 'iam'
+ virtual_network_interface_primary_ip_prototype_model = {} # VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext
+ virtual_network_interface_primary_ip_prototype_model['address'] = '10.0.0.5'
+ virtual_network_interface_primary_ip_prototype_model['auto_delete'] = False
+ virtual_network_interface_primary_ip_prototype_model['name'] = 'my-reserved-ip'
- vpn_server_authentication_prototype_model = {} # VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype
- vpn_server_authentication_prototype_model['method'] = 'username'
- vpn_server_authentication_prototype_model['identity_provider'] = vpn_server_authentication_by_username_id_provider_model
+ resource_group_identity_model = {} # ResourceGroupIdentityById
+ resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
- ip_model = {} # IP
- ip_model['address'] = '192.168.3.4'
+ 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 VPNServerPatch model
- vpn_server_patch_model_json = {}
- vpn_server_patch_model_json['certificate'] = certificate_instance_identity_model
- vpn_server_patch_model_json['client_authentication'] = [vpn_server_authentication_prototype_model]
- vpn_server_patch_model_json['client_dns_server_ips'] = [ip_model]
- vpn_server_patch_model_json['client_idle_timeout'] = 600
- vpn_server_patch_model_json['client_ip_pool'] = '172.16.0.0/16'
- vpn_server_patch_model_json['enable_split_tunneling'] = True
- vpn_server_patch_model_json['name'] = 'my-vpn-server'
- vpn_server_patch_model_json['port'] = 443
- vpn_server_patch_model_json['protocol'] = 'udp'
- vpn_server_patch_model_json['subnets'] = [subnet_identity_model]
+ bare_metal_server_network_attachment_prototype_virtual_network_interface_model = {} # BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeBareMetalServerNetworkAttachmentContext
+ bare_metal_server_network_attachment_prototype_virtual_network_interface_model['allow_ip_spoofing'] = True
+ bare_metal_server_network_attachment_prototype_virtual_network_interface_model['auto_delete'] = False
+ bare_metal_server_network_attachment_prototype_virtual_network_interface_model['enable_infrastructure_nat'] = True
+ bare_metal_server_network_attachment_prototype_virtual_network_interface_model['ips'] = [virtual_network_interface_ip_prototype_model]
+ bare_metal_server_network_attachment_prototype_virtual_network_interface_model['name'] = 'my-virtual-network-interface'
+ bare_metal_server_network_attachment_prototype_virtual_network_interface_model['primary_ip'] = virtual_network_interface_primary_ip_prototype_model
+ bare_metal_server_network_attachment_prototype_virtual_network_interface_model['resource_group'] = resource_group_identity_model
+ bare_metal_server_network_attachment_prototype_virtual_network_interface_model['security_groups'] = [security_group_identity_model]
+ bare_metal_server_network_attachment_prototype_virtual_network_interface_model['subnet'] = subnet_identity_model
- # Construct a model instance of VPNServerPatch by calling from_dict on the json representation
- vpn_server_patch_model = VPNServerPatch.from_dict(vpn_server_patch_model_json)
- assert vpn_server_patch_model != False
+ # Construct a json representation of a BareMetalServerPrimaryNetworkAttachmentPrototypeBareMetalServerPrimaryNetworkAttachmentByPCIPrototype model
+ bare_metal_server_primary_network_attachment_prototype_bare_metal_server_primary_network_attachment_by_pci_prototype_model_json = {}
+ bare_metal_server_primary_network_attachment_prototype_bare_metal_server_primary_network_attachment_by_pci_prototype_model_json['name'] = 'my-bare-metal-server-network-attachment'
+ bare_metal_server_primary_network_attachment_prototype_bare_metal_server_primary_network_attachment_by_pci_prototype_model_json['virtual_network_interface'] = bare_metal_server_network_attachment_prototype_virtual_network_interface_model
+ bare_metal_server_primary_network_attachment_prototype_bare_metal_server_primary_network_attachment_by_pci_prototype_model_json['allowed_vlans'] = []
+ bare_metal_server_primary_network_attachment_prototype_bare_metal_server_primary_network_attachment_by_pci_prototype_model_json['interface_type'] = 'pci'
- # Construct a model instance of VPNServerPatch by calling from_dict on the json representation
- vpn_server_patch_model_dict = VPNServerPatch.from_dict(vpn_server_patch_model_json).__dict__
- vpn_server_patch_model2 = VPNServerPatch(**vpn_server_patch_model_dict)
+ # Construct a model instance of BareMetalServerPrimaryNetworkAttachmentPrototypeBareMetalServerPrimaryNetworkAttachmentByPCIPrototype by calling from_dict on the json representation
+ bare_metal_server_primary_network_attachment_prototype_bare_metal_server_primary_network_attachment_by_pci_prototype_model = BareMetalServerPrimaryNetworkAttachmentPrototypeBareMetalServerPrimaryNetworkAttachmentByPCIPrototype.from_dict(bare_metal_server_primary_network_attachment_prototype_bare_metal_server_primary_network_attachment_by_pci_prototype_model_json)
+ assert bare_metal_server_primary_network_attachment_prototype_bare_metal_server_primary_network_attachment_by_pci_prototype_model != False
+
+ # Construct a model instance of BareMetalServerPrimaryNetworkAttachmentPrototypeBareMetalServerPrimaryNetworkAttachmentByPCIPrototype by calling from_dict on the json representation
+ bare_metal_server_primary_network_attachment_prototype_bare_metal_server_primary_network_attachment_by_pci_prototype_model_dict = BareMetalServerPrimaryNetworkAttachmentPrototypeBareMetalServerPrimaryNetworkAttachmentByPCIPrototype.from_dict(bare_metal_server_primary_network_attachment_prototype_bare_metal_server_primary_network_attachment_by_pci_prototype_model_json).__dict__
+ bare_metal_server_primary_network_attachment_prototype_bare_metal_server_primary_network_attachment_by_pci_prototype_model2 = BareMetalServerPrimaryNetworkAttachmentPrototypeBareMetalServerPrimaryNetworkAttachmentByPCIPrototype(**bare_metal_server_primary_network_attachment_prototype_bare_metal_server_primary_network_attachment_by_pci_prototype_model_dict)
# Verify the model instances are equivalent
- assert vpn_server_patch_model == vpn_server_patch_model2
+ assert bare_metal_server_primary_network_attachment_prototype_bare_metal_server_primary_network_attachment_by_pci_prototype_model == bare_metal_server_primary_network_attachment_prototype_bare_metal_server_primary_network_attachment_by_pci_prototype_model2
# Convert model instance back to dict and verify no loss of data
- vpn_server_patch_model_json2 = vpn_server_patch_model.to_dict()
- assert vpn_server_patch_model_json2 == vpn_server_patch_model_json
+ bare_metal_server_primary_network_attachment_prototype_bare_metal_server_primary_network_attachment_by_pci_prototype_model_json2 = bare_metal_server_primary_network_attachment_prototype_bare_metal_server_primary_network_attachment_by_pci_prototype_model.to_dict()
+ assert bare_metal_server_primary_network_attachment_prototype_bare_metal_server_primary_network_attachment_by_pci_prototype_model_json2 == bare_metal_server_primary_network_attachment_prototype_bare_metal_server_primary_network_attachment_by_pci_prototype_model_json
-class TestModel_VPNServerReferenceDeleted:
+class TestModel_BareMetalServerProfileBandwidthDependent:
"""
- Test Class for VPNServerReferenceDeleted
+ Test Class for BareMetalServerProfileBandwidthDependent
"""
- def test_vpn_server_reference_deleted_serialization(self):
+ def test_bare_metal_server_profile_bandwidth_dependent_serialization(self):
"""
- Test serialization/deserialization for VPNServerReferenceDeleted
+ Test serialization/deserialization for BareMetalServerProfileBandwidthDependent
"""
- # Construct a json representation of a VPNServerReferenceDeleted model
- vpn_server_reference_deleted_model_json = {}
- vpn_server_reference_deleted_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ # 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'
- # Construct a model instance of VPNServerReferenceDeleted by calling from_dict on the json representation
- vpn_server_reference_deleted_model = VPNServerReferenceDeleted.from_dict(vpn_server_reference_deleted_model_json)
- assert vpn_server_reference_deleted_model != False
+ # 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
- # Construct a model instance of VPNServerReferenceDeleted by calling from_dict on the json representation
- vpn_server_reference_deleted_model_dict = VPNServerReferenceDeleted.from_dict(vpn_server_reference_deleted_model_json).__dict__
- vpn_server_reference_deleted_model2 = VPNServerReferenceDeleted(**vpn_server_reference_deleted_model_dict)
+ # 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)
# Verify the model instances are equivalent
- assert vpn_server_reference_deleted_model == vpn_server_reference_deleted_model2
+ assert bare_metal_server_profile_bandwidth_dependent_model == bare_metal_server_profile_bandwidth_dependent_model2
# Convert model instance back to dict and verify no loss of data
- vpn_server_reference_deleted_model_json2 = vpn_server_reference_deleted_model.to_dict()
- assert vpn_server_reference_deleted_model_json2 == vpn_server_reference_deleted_model_json
+ 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
-class TestModel_VPNServerRoute:
+class TestModel_BareMetalServerProfileBandwidthEnum:
"""
- Test Class for VPNServerRoute
+ Test Class for BareMetalServerProfileBandwidthEnum
"""
- def test_vpn_server_route_serialization(self):
+ def test_bare_metal_server_profile_bandwidth_enum_serialization(self):
"""
- Test serialization/deserialization for VPNServerRoute
+ Test serialization/deserialization for BareMetalServerProfileBandwidthEnum
"""
- # Construct dict forms of any model objects needed in order to build this model.
+ # 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]
- vpn_server_route_health_reason_model = {} # VPNServerRouteHealthReason
- vpn_server_route_health_reason_model['code'] = 'internal_error'
- vpn_server_route_health_reason_model['message'] = 'Internal error (contact IBM support).'
- vpn_server_route_health_reason_model['more_info'] = 'https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-route-health'
+ # 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
- vpn_server_route_lifecycle_reason_model = {} # VPNServerRouteLifecycleReason
- vpn_server_route_lifecycle_reason_model['code'] = 'resource_suspended_by_provider'
- vpn_server_route_lifecycle_reason_model['message'] = 'The resource has been suspended. Contact IBM support with the CRN for next steps.'
- vpn_server_route_lifecycle_reason_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#resource-suspension'
+ # 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)
- # Construct a json representation of a VPNServerRoute model
- vpn_server_route_model_json = {}
- vpn_server_route_model_json['action'] = 'deliver'
- vpn_server_route_model_json['created_at'] = '2019-01-01T12:00:00Z'
- vpn_server_route_model_json['destination'] = '192.168.3.0/24'
- vpn_server_route_model_json['health_reasons'] = [vpn_server_route_health_reason_model]
- vpn_server_route_model_json['health_state'] = 'ok'
- vpn_server_route_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531'
- vpn_server_route_model_json['id'] = 'r006-1a15dca5-7e33-45e1-b7c5-bc690e569531'
- vpn_server_route_model_json['lifecycle_reasons'] = [vpn_server_route_lifecycle_reason_model]
- vpn_server_route_model_json['lifecycle_state'] = 'stable'
- vpn_server_route_model_json['name'] = 'my-vpn-route-1'
- vpn_server_route_model_json['resource_type'] = 'vpn_server_route'
+ # Verify the model instances are equivalent
+ assert bare_metal_server_profile_bandwidth_enum_model == bare_metal_server_profile_bandwidth_enum_model2
- # Construct a model instance of VPNServerRoute by calling from_dict on the json representation
- vpn_server_route_model = VPNServerRoute.from_dict(vpn_server_route_model_json)
- assert vpn_server_route_model != False
+ # Convert model instance back to dict and verify no loss of data
+ 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
- # Construct a model instance of VPNServerRoute by calling from_dict on the json representation
- vpn_server_route_model_dict = VPNServerRoute.from_dict(vpn_server_route_model_json).__dict__
- vpn_server_route_model2 = VPNServerRoute(**vpn_server_route_model_dict)
+
+class TestModel_BareMetalServerProfileBandwidthFixed:
+ """
+ Test Class for BareMetalServerProfileBandwidthFixed
+ """
+
+ def test_bare_metal_server_profile_bandwidth_fixed_serialization(self):
+ """
+ Test serialization/deserialization for BareMetalServerProfileBandwidthFixed
+ """
+
+ # 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 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 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 vpn_server_route_model == vpn_server_route_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
- vpn_server_route_model_json2 = vpn_server_route_model.to_dict()
- assert vpn_server_route_model_json2 == vpn_server_route_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_VPNServerRouteCollection:
+class TestModel_BareMetalServerProfileBandwidthRange:
"""
- Test Class for VPNServerRouteCollection
+ Test Class for BareMetalServerProfileBandwidthRange
"""
- def test_vpn_server_route_collection_serialization(self):
+ def test_bare_metal_server_profile_bandwidth_range_serialization(self):
"""
- Test serialization/deserialization for VPNServerRouteCollection
+ 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'
- vpn_server_route_collection_first_model = {} # VPNServerRouteCollectionFirst
- vpn_server_route_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routes?limit=20'
+ # 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
- vpn_server_route_collection_next_model = {} # VPNServerRouteCollectionNext
- vpn_server_route_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routes?start=a5e812a2-62c0-4555-86a5-907106760c56&limit=20'
+ # 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)
- vpn_server_route_health_reason_model = {} # VPNServerRouteHealthReason
- vpn_server_route_health_reason_model['code'] = 'internal_error'
- vpn_server_route_health_reason_model['message'] = 'Internal error (contact IBM support).'
- vpn_server_route_health_reason_model['more_info'] = 'https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-route-health'
+ # Verify the model instances are equivalent
+ assert bare_metal_server_profile_bandwidth_range_model == bare_metal_server_profile_bandwidth_range_model2
- vpn_server_route_lifecycle_reason_model = {} # VPNServerRouteLifecycleReason
- vpn_server_route_lifecycle_reason_model['code'] = 'resource_suspended_by_provider'
- vpn_server_route_lifecycle_reason_model['message'] = 'The resource has been suspended. Contact IBM support with the CRN for next steps.'
- vpn_server_route_lifecycle_reason_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#resource-suspension'
+ # 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
- vpn_server_route_model = {} # VPNServerRoute
- vpn_server_route_model['action'] = 'deliver'
- vpn_server_route_model['created_at'] = '2019-01-01T12:00:00Z'
- vpn_server_route_model['destination'] = '192.168.3.0/24'
- vpn_server_route_model['health_reasons'] = [vpn_server_route_health_reason_model]
- vpn_server_route_model['health_state'] = 'ok'
- vpn_server_route_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531'
- vpn_server_route_model['id'] = 'r006-1a15dca5-7e33-45e1-b7c5-bc690e569531'
- vpn_server_route_model['lifecycle_reasons'] = [vpn_server_route_lifecycle_reason_model]
- vpn_server_route_model['lifecycle_state'] = 'stable'
- vpn_server_route_model['name'] = 'my-vpn-route-1'
- vpn_server_route_model['resource_type'] = 'vpn_server_route'
- # Construct a json representation of a VPNServerRouteCollection model
- vpn_server_route_collection_model_json = {}
- vpn_server_route_collection_model_json['first'] = vpn_server_route_collection_first_model
- vpn_server_route_collection_model_json['limit'] = 20
- vpn_server_route_collection_model_json['next'] = vpn_server_route_collection_next_model
- vpn_server_route_collection_model_json['routes'] = [vpn_server_route_model]
- vpn_server_route_collection_model_json['total_count'] = 132
+class TestModel_BareMetalServerProfileCPUCoreCountDependent:
+ """
+ Test Class for BareMetalServerProfileCPUCoreCountDependent
+ """
- # Construct a model instance of VPNServerRouteCollection by calling from_dict on the json representation
- vpn_server_route_collection_model = VPNServerRouteCollection.from_dict(vpn_server_route_collection_model_json)
- assert vpn_server_route_collection_model != False
+ def test_bare_metal_server_profile_cpu_core_count_dependent_serialization(self):
+ """
+ Test serialization/deserialization for BareMetalServerProfileCPUCoreCountDependent
+ """
- # Construct a model instance of VPNServerRouteCollection by calling from_dict on the json representation
- vpn_server_route_collection_model_dict = VPNServerRouteCollection.from_dict(vpn_server_route_collection_model_json).__dict__
- vpn_server_route_collection_model2 = VPNServerRouteCollection(**vpn_server_route_collection_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 vpn_server_route_collection_model == vpn_server_route_collection_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
- vpn_server_route_collection_model_json2 = vpn_server_route_collection_model.to_dict()
- assert vpn_server_route_collection_model_json2 == vpn_server_route_collection_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_VPNServerRouteCollectionFirst:
+class TestModel_BareMetalServerProfileCPUCoreCountEnum:
"""
- Test Class for VPNServerRouteCollectionFirst
+ Test Class for BareMetalServerProfileCPUCoreCountEnum
"""
- def test_vpn_server_route_collection_first_serialization(self):
+ def test_bare_metal_server_profile_cpu_core_count_enum_serialization(self):
"""
- Test serialization/deserialization for VPNServerRouteCollectionFirst
+ Test serialization/deserialization for BareMetalServerProfileCPUCoreCountEnum
"""
- # Construct a json representation of a VPNServerRouteCollectionFirst model
- vpn_server_route_collection_first_model_json = {}
- vpn_server_route_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routes?limit=20'
+ # 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 VPNServerRouteCollectionFirst by calling from_dict on the json representation
- vpn_server_route_collection_first_model = VPNServerRouteCollectionFirst.from_dict(vpn_server_route_collection_first_model_json)
- assert vpn_server_route_collection_first_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 VPNServerRouteCollectionFirst by calling from_dict on the json representation
- vpn_server_route_collection_first_model_dict = VPNServerRouteCollectionFirst.from_dict(vpn_server_route_collection_first_model_json).__dict__
- vpn_server_route_collection_first_model2 = VPNServerRouteCollectionFirst(**vpn_server_route_collection_first_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 vpn_server_route_collection_first_model == vpn_server_route_collection_first_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
- vpn_server_route_collection_first_model_json2 = vpn_server_route_collection_first_model.to_dict()
- assert vpn_server_route_collection_first_model_json2 == vpn_server_route_collection_first_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_VPNServerRouteCollectionNext:
+class TestModel_BareMetalServerProfileCPUCoreCountFixed:
"""
- Test Class for VPNServerRouteCollectionNext
+ Test Class for BareMetalServerProfileCPUCoreCountFixed
"""
- def test_vpn_server_route_collection_next_serialization(self):
+ def test_bare_metal_server_profile_cpu_core_count_fixed_serialization(self):
"""
- Test serialization/deserialization for VPNServerRouteCollectionNext
+ Test serialization/deserialization for BareMetalServerProfileCPUCoreCountFixed
"""
- # Construct a json representation of a VPNServerRouteCollectionNext model
- vpn_server_route_collection_next_model_json = {}
- vpn_server_route_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routes?start=a5e812a2-62c0-4555-86a5-907106760c56&limit=20'
+ # 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
- # Construct a model instance of VPNServerRouteCollectionNext by calling from_dict on the json representation
- vpn_server_route_collection_next_model = VPNServerRouteCollectionNext.from_dict(vpn_server_route_collection_next_model_json)
- assert vpn_server_route_collection_next_model != False
+ # 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
- # Construct a model instance of VPNServerRouteCollectionNext by calling from_dict on the json representation
- vpn_server_route_collection_next_model_dict = VPNServerRouteCollectionNext.from_dict(vpn_server_route_collection_next_model_json).__dict__
- vpn_server_route_collection_next_model2 = VPNServerRouteCollectionNext(**vpn_server_route_collection_next_model_dict)
+ # 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)
# Verify the model instances are equivalent
- assert vpn_server_route_collection_next_model == vpn_server_route_collection_next_model2
+ assert bare_metal_server_profile_cpu_core_count_fixed_model == bare_metal_server_profile_cpu_core_count_fixed_model2
# Convert model instance back to dict and verify no loss of data
- vpn_server_route_collection_next_model_json2 = vpn_server_route_collection_next_model.to_dict()
- assert vpn_server_route_collection_next_model_json2 == vpn_server_route_collection_next_model_json
+ 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
-class TestModel_VPNServerRouteHealthReason:
+class TestModel_BareMetalServerProfileCPUCoreCountRange:
"""
- Test Class for VPNServerRouteHealthReason
+ Test Class for BareMetalServerProfileCPUCoreCountRange
"""
- def test_vpn_server_route_health_reason_serialization(self):
+ def test_bare_metal_server_profile_cpu_core_count_range_serialization(self):
"""
- Test serialization/deserialization for VPNServerRouteHealthReason
+ Test serialization/deserialization for BareMetalServerProfileCPUCoreCountRange
"""
- # Construct a json representation of a VPNServerRouteHealthReason model
- vpn_server_route_health_reason_model_json = {}
- vpn_server_route_health_reason_model_json['code'] = 'internal_error'
- vpn_server_route_health_reason_model_json['message'] = 'Internal error (contact IBM support).'
- vpn_server_route_health_reason_model_json['more_info'] = 'https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-route-health'
+ # 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'
- # Construct a model instance of VPNServerRouteHealthReason by calling from_dict on the json representation
- vpn_server_route_health_reason_model = VPNServerRouteHealthReason.from_dict(vpn_server_route_health_reason_model_json)
- assert vpn_server_route_health_reason_model != False
+ # 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
- # Construct a model instance of VPNServerRouteHealthReason by calling from_dict on the json representation
- vpn_server_route_health_reason_model_dict = VPNServerRouteHealthReason.from_dict(vpn_server_route_health_reason_model_json).__dict__
- vpn_server_route_health_reason_model2 = VPNServerRouteHealthReason(**vpn_server_route_health_reason_model_dict)
+ # 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)
# Verify the model instances are equivalent
- assert vpn_server_route_health_reason_model == vpn_server_route_health_reason_model2
+ assert bare_metal_server_profile_cpu_core_count_range_model == bare_metal_server_profile_cpu_core_count_range_model2
# Convert model instance back to dict and verify no loss of data
- vpn_server_route_health_reason_model_json2 = vpn_server_route_health_reason_model.to_dict()
- assert vpn_server_route_health_reason_model_json2 == vpn_server_route_health_reason_model_json
+ 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
-class TestModel_VPNServerRouteLifecycleReason:
+class TestModel_BareMetalServerProfileCPUSocketCountDependent:
"""
- Test Class for VPNServerRouteLifecycleReason
+ Test Class for BareMetalServerProfileCPUSocketCountDependent
"""
- def test_vpn_server_route_lifecycle_reason_serialization(self):
+ def test_bare_metal_server_profile_cpu_socket_count_dependent_serialization(self):
"""
- Test serialization/deserialization for VPNServerRouteLifecycleReason
+ Test serialization/deserialization for BareMetalServerProfileCPUSocketCountDependent
"""
- # Construct a json representation of a VPNServerRouteLifecycleReason model
- vpn_server_route_lifecycle_reason_model_json = {}
- vpn_server_route_lifecycle_reason_model_json['code'] = 'resource_suspended_by_provider'
- vpn_server_route_lifecycle_reason_model_json['message'] = 'The resource has been suspended. Contact IBM support with the CRN for next steps.'
- vpn_server_route_lifecycle_reason_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#resource-suspension'
+ # 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'
- # Construct a model instance of VPNServerRouteLifecycleReason by calling from_dict on the json representation
- vpn_server_route_lifecycle_reason_model = VPNServerRouteLifecycleReason.from_dict(vpn_server_route_lifecycle_reason_model_json)
- assert vpn_server_route_lifecycle_reason_model != False
+ # 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
- # Construct a model instance of VPNServerRouteLifecycleReason by calling from_dict on the json representation
- vpn_server_route_lifecycle_reason_model_dict = VPNServerRouteLifecycleReason.from_dict(vpn_server_route_lifecycle_reason_model_json).__dict__
- vpn_server_route_lifecycle_reason_model2 = VPNServerRouteLifecycleReason(**vpn_server_route_lifecycle_reason_model_dict)
+ # 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)
# Verify the model instances are equivalent
- assert vpn_server_route_lifecycle_reason_model == vpn_server_route_lifecycle_reason_model2
+ assert bare_metal_server_profile_cpu_socket_count_dependent_model == bare_metal_server_profile_cpu_socket_count_dependent_model2
# Convert model instance back to dict and verify no loss of data
- vpn_server_route_lifecycle_reason_model_json2 = vpn_server_route_lifecycle_reason_model.to_dict()
- assert vpn_server_route_lifecycle_reason_model_json2 == vpn_server_route_lifecycle_reason_model_json
+ 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
-class TestModel_VPNServerRoutePatch:
+class TestModel_BareMetalServerProfileCPUSocketCountEnum:
"""
- Test Class for VPNServerRoutePatch
+ Test Class for BareMetalServerProfileCPUSocketCountEnum
"""
- def test_vpn_server_route_patch_serialization(self):
+ def test_bare_metal_server_profile_cpu_socket_count_enum_serialization(self):
"""
- Test serialization/deserialization for VPNServerRoutePatch
+ Test serialization/deserialization for BareMetalServerProfileCPUSocketCountEnum
"""
- # Construct a json representation of a VPNServerRoutePatch model
- vpn_server_route_patch_model_json = {}
- vpn_server_route_patch_model_json['name'] = 'my-vpn-route-2'
+ # 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 VPNServerRoutePatch by calling from_dict on the json representation
- vpn_server_route_patch_model = VPNServerRoutePatch.from_dict(vpn_server_route_patch_model_json)
- assert vpn_server_route_patch_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 = 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 VPNServerRoutePatch by calling from_dict on the json representation
- vpn_server_route_patch_model_dict = VPNServerRoutePatch.from_dict(vpn_server_route_patch_model_json).__dict__
- vpn_server_route_patch_model2 = VPNServerRoutePatch(**vpn_server_route_patch_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_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 vpn_server_route_patch_model == vpn_server_route_patch_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
- vpn_server_route_patch_model_json2 = vpn_server_route_patch_model.to_dict()
- assert vpn_server_route_patch_model_json2 == vpn_server_route_patch_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_VirtualNetworkInterface:
+class TestModel_BareMetalServerProfileCPUSocketCountFixed:
"""
- Test Class for VirtualNetworkInterface
+ Test Class for BareMetalServerProfileCPUSocketCountFixed
"""
- def test_virtual_network_interface_serialization(self):
+ def test_bare_metal_server_profile_cpu_socket_count_fixed_serialization(self):
"""
- Test serialization/deserialization for VirtualNetworkInterface
+ Test serialization/deserialization for BareMetalServerProfileCPUSocketCountFixed
"""
- # Construct dict forms of any model objects needed in order to build this model.
-
- reserved_ip_reference_deleted_model = {} # ReservedIPReferenceDeleted
- reserved_ip_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
-
- reserved_ip_reference_model = {} # ReservedIPReference
- reserved_ip_reference_model['address'] = '10.0.0.32'
- reserved_ip_reference_model['deleted'] = reserved_ip_reference_deleted_model
- reserved_ip_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/0716-b28a7e6d-a66b-4de7-8713-15dcffdce401/reserved_ips/0716-7768a27e-cd6c-4a13-a9e6-d67a964e54a5'
- reserved_ip_reference_model['id'] = '0716-7768a27e-cd6c-4a13-a9e6-d67a964e54a5'
- reserved_ip_reference_model['name'] = 'my-reserved-ip-1'
- reserved_ip_reference_model['resource_type'] = 'subnet_reserved_ip'
-
- resource_group_reference_model = {} # ResourceGroupReference
- resource_group_reference_model['href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/4bbce614c13444cd8fc5e7e878ef8e21'
- resource_group_reference_model['id'] = '4bbce614c13444cd8fc5e7e878ef8e21'
- resource_group_reference_model['name'] = 'Default'
-
- security_group_reference_deleted_model = {} # SecurityGroupReferenceDeleted
- security_group_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
-
- security_group_reference_model = {} # SecurityGroupReference
- security_group_reference_model['crn'] = 'crn:[...]'
- security_group_reference_model['deleted'] = security_group_reference_deleted_model
- security_group_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups/a929f12d-fb45-4e5e-9864-95e171ae3589'
- security_group_reference_model['id'] = 'a929f12d-fb45-4e5e-9864-95e171ae3589'
- security_group_reference_model['name'] = 'my-security-group'
+ # 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
- subnet_reference_deleted_model = {} # SubnetReferenceDeleted
- subnet_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ # 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
- subnet_reference_model = {} # SubnetReference
- subnet_reference_model['crn'] = 'crn:[...]'
- subnet_reference_model['deleted'] = subnet_reference_deleted_model
- subnet_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/9270d819-c05e-4352-99e4-80c4680cdb7c'
- subnet_reference_model['id'] = '9270d819-c05e-4352-99e4-80c4680cdb7c'
- subnet_reference_model['name'] = 'my-subnet'
- subnet_reference_model['resource_type'] = 'subnet'
+ # 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)
- share_mount_target_reference_deleted_model = {} # ShareMountTargetReferenceDeleted
- share_mount_target_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ # Verify the model instances are equivalent
+ assert bare_metal_server_profile_cpu_socket_count_fixed_model == bare_metal_server_profile_cpu_socket_count_fixed_model2
- virtual_network_interface_target_model = {} # VirtualNetworkInterfaceTargetShareMountTargetReference
- virtual_network_interface_target_model['deleted'] = share_mount_target_reference_deleted_model
- virtual_network_interface_target_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c'
- virtual_network_interface_target_model['id'] = '4cf9171a-0043-4434-8727-15b53dbc374c'
- virtual_network_interface_target_model['name'] = 'my-share-mount-target'
- virtual_network_interface_target_model['resource_type'] = 'share_mount_target'
+ # Convert model instance back to dict and verify no loss of data
+ 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
- vpc_reference_deleted_model = {} # VPCReferenceDeleted
- vpc_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- vpc_reference_model = {} # VPCReference
- vpc_reference_model['crn'] = 'crn:[...]'
- vpc_reference_model['deleted'] = vpc_reference_deleted_model
- vpc_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/a0819609-0997-4f92-9409-86c95ddf59d3'
- vpc_reference_model['id'] = 'a0819609-0997-4f92-9409-86c95ddf59d3'
- vpc_reference_model['name'] = 'my-vpc'
- vpc_reference_model['resource_type'] = 'vpc'
+class TestModel_BareMetalServerProfileCPUSocketCountRange:
+ """
+ Test Class for BareMetalServerProfileCPUSocketCountRange
+ """
- 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_bare_metal_server_profile_cpu_socket_count_range_serialization(self):
+ """
+ Test serialization/deserialization for BareMetalServerProfileCPUSocketCountRange
+ """
- # Construct a json representation of a VirtualNetworkInterface model
- virtual_network_interface_model_json = {}
- virtual_network_interface_model_json['auto_delete'] = False
- virtual_network_interface_model_json['created_at'] = '2019-01-01T12:00:00Z'
- virtual_network_interface_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9'
- virtual_network_interface_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9'
- virtual_network_interface_model_json['id'] = '0767-fa41aecb-4f21-423d-8082-630bfba1e1d9'
- virtual_network_interface_model_json['lifecycle_state'] = 'stable'
- virtual_network_interface_model_json['name'] = 'my-virtual-network-interface'
- virtual_network_interface_model_json['primary_ip'] = reserved_ip_reference_model
- virtual_network_interface_model_json['resource_group'] = resource_group_reference_model
- virtual_network_interface_model_json['resource_type'] = 'virtual_network_interface'
- virtual_network_interface_model_json['security_groups'] = [security_group_reference_model]
- virtual_network_interface_model_json['subnet'] = subnet_reference_model
- virtual_network_interface_model_json['target'] = virtual_network_interface_target_model
- virtual_network_interface_model_json['vpc'] = vpc_reference_model
- virtual_network_interface_model_json['zone'] = zone_reference_model
+ # Construct a 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 VirtualNetworkInterface by calling from_dict on the json representation
- virtual_network_interface_model = VirtualNetworkInterface.from_dict(virtual_network_interface_model_json)
- assert virtual_network_interface_model != False
+ # Construct a model instance of 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 VirtualNetworkInterface by calling from_dict on the json representation
- virtual_network_interface_model_dict = VirtualNetworkInterface.from_dict(virtual_network_interface_model_json).__dict__
- virtual_network_interface_model2 = VirtualNetworkInterface(**virtual_network_interface_model_dict)
+ # 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 virtual_network_interface_model == virtual_network_interface_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
- virtual_network_interface_model_json2 = virtual_network_interface_model.to_dict()
- assert virtual_network_interface_model_json2 == virtual_network_interface_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_VirtualNetworkInterfaceCollection:
+class TestModel_BareMetalServerProfileDiskQuantityDependent:
"""
- Test Class for VirtualNetworkInterfaceCollection
+ Test Class for BareMetalServerProfileDiskQuantityDependent
"""
- def test_virtual_network_interface_collection_serialization(self):
+ def test_bare_metal_server_profile_disk_quantity_dependent_serialization(self):
"""
- Test serialization/deserialization for VirtualNetworkInterfaceCollection
+ Test serialization/deserialization for BareMetalServerProfileDiskQuantityDependent
"""
- # Construct dict forms of any model objects needed in order to build this model.
-
- virtual_network_interface_collection_first_model = {} # VirtualNetworkInterfaceCollectionFirst
- virtual_network_interface_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces?limit=20'
-
- virtual_network_interface_collection_next_model = {} # VirtualNetworkInterfaceCollectionNext
- virtual_network_interface_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces?start=d3e721fd-c988-4670-9927-dbd5e7b07fc6&limit=20'
-
- reserved_ip_reference_deleted_model = {} # ReservedIPReferenceDeleted
- reserved_ip_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
-
- reserved_ip_reference_model = {} # ReservedIPReference
- reserved_ip_reference_model['address'] = '10.0.0.32'
- reserved_ip_reference_model['deleted'] = reserved_ip_reference_deleted_model
- reserved_ip_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/0716-b28a7e6d-a66b-4de7-8713-15dcffdce401/reserved_ips/0716-7768a27e-cd6c-4a13-a9e6-d67a964e54a5'
- reserved_ip_reference_model['id'] = '0716-7768a27e-cd6c-4a13-a9e6-d67a964e54a5'
- reserved_ip_reference_model['name'] = 'my-reserved-ip-1'
- reserved_ip_reference_model['resource_type'] = 'subnet_reserved_ip'
-
- resource_group_reference_model = {} # ResourceGroupReference
- resource_group_reference_model['href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/4bbce614c13444cd8fc5e7e878ef8e21'
- resource_group_reference_model['id'] = '4bbce614c13444cd8fc5e7e878ef8e21'
- resource_group_reference_model['name'] = 'Default'
+ # 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'
- 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 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
- security_group_reference_model = {} # SecurityGroupReference
- security_group_reference_model['crn'] = 'crn:[...]'
- security_group_reference_model['deleted'] = security_group_reference_deleted_model
- security_group_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups/a929f12d-fb45-4e5e-9864-95e171ae3589'
- security_group_reference_model['id'] = 'a929f12d-fb45-4e5e-9864-95e171ae3589'
- security_group_reference_model['name'] = 'my-security-group'
+ # 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)
- 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 bare_metal_server_profile_disk_quantity_dependent_model == bare_metal_server_profile_disk_quantity_dependent_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'
- subnet_reference_model['resource_type'] = 'subnet'
+ # Convert model instance back to dict and verify no loss of data
+ 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
- share_mount_target_reference_deleted_model = {} # ShareMountTargetReferenceDeleted
- share_mount_target_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- virtual_network_interface_target_model = {} # VirtualNetworkInterfaceTargetShareMountTargetReference
- virtual_network_interface_target_model['deleted'] = share_mount_target_reference_deleted_model
- virtual_network_interface_target_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c'
- virtual_network_interface_target_model['id'] = '4cf9171a-0043-4434-8727-15b53dbc374c'
- virtual_network_interface_target_model['name'] = 'my-share-mount-target'
- virtual_network_interface_target_model['resource_type'] = 'share_mount_target'
+class TestModel_BareMetalServerProfileDiskQuantityEnum:
+ """
+ Test Class for BareMetalServerProfileDiskQuantityEnum
+ """
- vpc_reference_deleted_model = {} # VPCReferenceDeleted
- vpc_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ def test_bare_metal_server_profile_disk_quantity_enum_serialization(self):
+ """
+ Test serialization/deserialization for BareMetalServerProfileDiskQuantityEnum
+ """
- vpc_reference_model = {} # VPCReference
- vpc_reference_model['crn'] = 'crn:[...]'
- vpc_reference_model['deleted'] = vpc_reference_deleted_model
- vpc_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/a0819609-0997-4f92-9409-86c95ddf59d3'
- vpc_reference_model['id'] = 'a0819609-0997-4f92-9409-86c95ddf59d3'
- vpc_reference_model['name'] = 'my-vpc'
- vpc_reference_model['resource_type'] = 'vpc'
+ # 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]
- 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 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
- virtual_network_interface_model = {} # VirtualNetworkInterface
- virtual_network_interface_model['auto_delete'] = True
- virtual_network_interface_model['created_at'] = '2019-01-31T03:42:32.993000Z'
- virtual_network_interface_model['crn'] = 'crn:[...]'
- virtual_network_interface_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-54eb57ee-86f2-4796-90bb-d7874e0831ef'
- virtual_network_interface_model['id'] = '0767-54eb57ee-86f2-4796-90bb-d7874e0831ef'
- virtual_network_interface_model['lifecycle_state'] = 'stable'
- virtual_network_interface_model['name'] = 'my-virtual-network-interface'
- virtual_network_interface_model['primary_ip'] = reserved_ip_reference_model
- virtual_network_interface_model['resource_group'] = resource_group_reference_model
- virtual_network_interface_model['resource_type'] = 'virtual_network_interface'
- virtual_network_interface_model['security_groups'] = [security_group_reference_model]
- virtual_network_interface_model['subnet'] = subnet_reference_model
- virtual_network_interface_model['target'] = virtual_network_interface_target_model
- virtual_network_interface_model['vpc'] = vpc_reference_model
- virtual_network_interface_model['zone'] = zone_reference_model
+ # Construct a 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)
- # Construct a json representation of a VirtualNetworkInterfaceCollection model
- virtual_network_interface_collection_model_json = {}
- virtual_network_interface_collection_model_json['first'] = virtual_network_interface_collection_first_model
- virtual_network_interface_collection_model_json['limit'] = 20
- virtual_network_interface_collection_model_json['next'] = virtual_network_interface_collection_next_model
- virtual_network_interface_collection_model_json['total_count'] = 132
- virtual_network_interface_collection_model_json['virtual_network_interfaces'] = [virtual_network_interface_model]
+ # Verify the model instances are equivalent
+ assert bare_metal_server_profile_disk_quantity_enum_model == bare_metal_server_profile_disk_quantity_enum_model2
- # Construct a model instance of VirtualNetworkInterfaceCollection by calling from_dict on the json representation
- virtual_network_interface_collection_model = VirtualNetworkInterfaceCollection.from_dict(virtual_network_interface_collection_model_json)
- assert virtual_network_interface_collection_model != False
+ # Convert model instance back to dict and verify no loss of data
+ 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
- # Construct a model instance of VirtualNetworkInterfaceCollection by calling from_dict on the json representation
- virtual_network_interface_collection_model_dict = VirtualNetworkInterfaceCollection.from_dict(virtual_network_interface_collection_model_json).__dict__
- virtual_network_interface_collection_model2 = VirtualNetworkInterfaceCollection(**virtual_network_interface_collection_model_dict)
+
+class TestModel_BareMetalServerProfileDiskQuantityFixed:
+ """
+ Test Class for BareMetalServerProfileDiskQuantityFixed
+ """
+
+ def test_bare_metal_server_profile_disk_quantity_fixed_serialization(self):
+ """
+ Test serialization/deserialization for BareMetalServerProfileDiskQuantityFixed
+ """
+
+ # 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
+
+ # 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
+
+ # 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)
# Verify the model instances are equivalent
- assert virtual_network_interface_collection_model == virtual_network_interface_collection_model2
+ assert bare_metal_server_profile_disk_quantity_fixed_model == bare_metal_server_profile_disk_quantity_fixed_model2
# Convert model instance back to dict and verify no loss of data
- virtual_network_interface_collection_model_json2 = virtual_network_interface_collection_model.to_dict()
- assert virtual_network_interface_collection_model_json2 == virtual_network_interface_collection_model_json
+ 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
-class TestModel_VirtualNetworkInterfaceCollectionFirst:
+class TestModel_BareMetalServerProfileDiskQuantityRange:
"""
- Test Class for VirtualNetworkInterfaceCollectionFirst
+ Test Class for BareMetalServerProfileDiskQuantityRange
"""
- def test_virtual_network_interface_collection_first_serialization(self):
+ def test_bare_metal_server_profile_disk_quantity_range_serialization(self):
"""
- Test serialization/deserialization for VirtualNetworkInterfaceCollectionFirst
+ Test serialization/deserialization for BareMetalServerProfileDiskQuantityRange
"""
- # Construct a json representation of a VirtualNetworkInterfaceCollectionFirst model
- virtual_network_interface_collection_first_model_json = {}
- virtual_network_interface_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces?limit=20'
+ # Construct a 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 VirtualNetworkInterfaceCollectionFirst by calling from_dict on the json representation
- virtual_network_interface_collection_first_model = VirtualNetworkInterfaceCollectionFirst.from_dict(virtual_network_interface_collection_first_model_json)
- assert virtual_network_interface_collection_first_model != False
+ # Construct a model instance of 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 VirtualNetworkInterfaceCollectionFirst by calling from_dict on the json representation
- virtual_network_interface_collection_first_model_dict = VirtualNetworkInterfaceCollectionFirst.from_dict(virtual_network_interface_collection_first_model_json).__dict__
- virtual_network_interface_collection_first_model2 = VirtualNetworkInterfaceCollectionFirst(**virtual_network_interface_collection_first_model_dict)
+ # 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 virtual_network_interface_collection_first_model == virtual_network_interface_collection_first_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
- virtual_network_interface_collection_first_model_json2 = virtual_network_interface_collection_first_model.to_dict()
- assert virtual_network_interface_collection_first_model_json2 == virtual_network_interface_collection_first_model_json
+ 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_VirtualNetworkInterfaceCollectionNext:
+class TestModel_BareMetalServerProfileDiskSizeDependent:
"""
- Test Class for VirtualNetworkInterfaceCollectionNext
+ Test Class for BareMetalServerProfileDiskSizeDependent
"""
- def test_virtual_network_interface_collection_next_serialization(self):
+ def test_bare_metal_server_profile_disk_size_dependent_serialization(self):
"""
- Test serialization/deserialization for VirtualNetworkInterfaceCollectionNext
+ Test serialization/deserialization for BareMetalServerProfileDiskSizeDependent
"""
- # Construct a json representation of a VirtualNetworkInterfaceCollectionNext model
- virtual_network_interface_collection_next_model_json = {}
- virtual_network_interface_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces?start=d3e721fd-c988-4670-9927-dbd5e7b07fc6&limit=20'
+ # Construct a 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 VirtualNetworkInterfaceCollectionNext by calling from_dict on the json representation
- virtual_network_interface_collection_next_model = VirtualNetworkInterfaceCollectionNext.from_dict(virtual_network_interface_collection_next_model_json)
- assert virtual_network_interface_collection_next_model != False
+ # Construct a model instance of 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 VirtualNetworkInterfaceCollectionNext by calling from_dict on the json representation
- virtual_network_interface_collection_next_model_dict = VirtualNetworkInterfaceCollectionNext.from_dict(virtual_network_interface_collection_next_model_json).__dict__
- virtual_network_interface_collection_next_model2 = VirtualNetworkInterfaceCollectionNext(**virtual_network_interface_collection_next_model_dict)
+ # 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 virtual_network_interface_collection_next_model == virtual_network_interface_collection_next_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
- virtual_network_interface_collection_next_model_json2 = virtual_network_interface_collection_next_model.to_dict()
- assert virtual_network_interface_collection_next_model_json2 == virtual_network_interface_collection_next_model_json
+ 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_VirtualNetworkInterfacePatch:
+class TestModel_BareMetalServerProfileDiskSizeEnum:
"""
- Test Class for VirtualNetworkInterfacePatch
+ Test Class for BareMetalServerProfileDiskSizeEnum
"""
- def test_virtual_network_interface_patch_serialization(self):
+ def test_bare_metal_server_profile_disk_size_enum_serialization(self):
"""
- Test serialization/deserialization for VirtualNetworkInterfacePatch
+ Test serialization/deserialization for BareMetalServerProfileDiskSizeEnum
"""
- # Construct a json representation of a VirtualNetworkInterfacePatch model
- virtual_network_interface_patch_model_json = {}
- virtual_network_interface_patch_model_json['name'] = 'my-virtual-network-interface'
+ # Construct a 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 VirtualNetworkInterfacePatch by calling from_dict on the json representation
- virtual_network_interface_patch_model = VirtualNetworkInterfacePatch.from_dict(virtual_network_interface_patch_model_json)
- assert virtual_network_interface_patch_model != False
+ # Construct a model instance of 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 VirtualNetworkInterfacePatch by calling from_dict on the json representation
- virtual_network_interface_patch_model_dict = VirtualNetworkInterfacePatch.from_dict(virtual_network_interface_patch_model_json).__dict__
- virtual_network_interface_patch_model2 = VirtualNetworkInterfacePatch(**virtual_network_interface_patch_model_dict)
+ # 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 virtual_network_interface_patch_model == virtual_network_interface_patch_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
- virtual_network_interface_patch_model_json2 = virtual_network_interface_patch_model.to_dict()
- assert virtual_network_interface_patch_model_json2 == virtual_network_interface_patch_model_json
+ 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_VirtualNetworkInterfaceReferenceAttachmentContext:
+class TestModel_BareMetalServerProfileDiskSizeFixed:
"""
- Test Class for VirtualNetworkInterfaceReferenceAttachmentContext
+ Test Class for BareMetalServerProfileDiskSizeFixed
"""
- def test_virtual_network_interface_reference_attachment_context_serialization(self):
+ def test_bare_metal_server_profile_disk_size_fixed_serialization(self):
"""
- Test serialization/deserialization for VirtualNetworkInterfaceReferenceAttachmentContext
+ Test serialization/deserialization for BareMetalServerProfileDiskSizeFixed
"""
- # Construct a json representation of a VirtualNetworkInterfaceReferenceAttachmentContext model
- virtual_network_interface_reference_attachment_context_model_json = {}
- virtual_network_interface_reference_attachment_context_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9'
- virtual_network_interface_reference_attachment_context_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9'
- virtual_network_interface_reference_attachment_context_model_json['id'] = '0767-fa41aecb-4f21-423d-8082-630bfba1e1d9'
- virtual_network_interface_reference_attachment_context_model_json['name'] = 'my-virtual-network-interface'
- virtual_network_interface_reference_attachment_context_model_json['resource_type'] = 'virtual_network_interface'
+ # Construct a 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 VirtualNetworkInterfaceReferenceAttachmentContext by calling from_dict on the json representation
- virtual_network_interface_reference_attachment_context_model = VirtualNetworkInterfaceReferenceAttachmentContext.from_dict(virtual_network_interface_reference_attachment_context_model_json)
- assert virtual_network_interface_reference_attachment_context_model != False
+ # Construct a model instance of 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 VirtualNetworkInterfaceReferenceAttachmentContext by calling from_dict on the json representation
- virtual_network_interface_reference_attachment_context_model_dict = VirtualNetworkInterfaceReferenceAttachmentContext.from_dict(virtual_network_interface_reference_attachment_context_model_json).__dict__
- virtual_network_interface_reference_attachment_context_model2 = VirtualNetworkInterfaceReferenceAttachmentContext(**virtual_network_interface_reference_attachment_context_model_dict)
+ # 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 virtual_network_interface_reference_attachment_context_model == virtual_network_interface_reference_attachment_context_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
- virtual_network_interface_reference_attachment_context_model_json2 = virtual_network_interface_reference_attachment_context_model.to_dict()
- assert virtual_network_interface_reference_attachment_context_model_json2 == virtual_network_interface_reference_attachment_context_model_json
+ 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_VirtualNetworkInterfaceReferenceDeleted:
+class TestModel_BareMetalServerProfileDiskSizeRange:
"""
- Test Class for VirtualNetworkInterfaceReferenceDeleted
+ Test Class for BareMetalServerProfileDiskSizeRange
"""
- def test_virtual_network_interface_reference_deleted_serialization(self):
+ def test_bare_metal_server_profile_disk_size_range_serialization(self):
"""
- Test serialization/deserialization for VirtualNetworkInterfaceReferenceDeleted
+ Test serialization/deserialization for BareMetalServerProfileDiskSizeRange
"""
- # Construct a json representation of a VirtualNetworkInterfaceReferenceDeleted model
- virtual_network_interface_reference_deleted_model_json = {}
- virtual_network_interface_reference_deleted_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ # Construct a 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 VirtualNetworkInterfaceReferenceDeleted by calling from_dict on the json representation
- virtual_network_interface_reference_deleted_model = VirtualNetworkInterfaceReferenceDeleted.from_dict(virtual_network_interface_reference_deleted_model_json)
- assert virtual_network_interface_reference_deleted_model != False
+ # Construct a model instance of 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 VirtualNetworkInterfaceReferenceDeleted by calling from_dict on the json representation
- virtual_network_interface_reference_deleted_model_dict = VirtualNetworkInterfaceReferenceDeleted.from_dict(virtual_network_interface_reference_deleted_model_json).__dict__
- virtual_network_interface_reference_deleted_model2 = VirtualNetworkInterfaceReferenceDeleted(**virtual_network_interface_reference_deleted_model_dict)
+ # 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 virtual_network_interface_reference_deleted_model == virtual_network_interface_reference_deleted_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
- virtual_network_interface_reference_deleted_model_json2 = virtual_network_interface_reference_deleted_model.to_dict()
- assert virtual_network_interface_reference_deleted_model_json2 == virtual_network_interface_reference_deleted_model_json
+ 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_Volume:
+class TestModel_BareMetalServerProfileIdentityByHref:
"""
- Test Class for Volume
+ Test Class for BareMetalServerProfileIdentityByHref
"""
- def test_volume_serialization(self):
+ def test_bare_metal_server_profile_identity_by_href_serialization(self):
"""
- Test serialization/deserialization for Volume
+ Test serialization/deserialization for BareMetalServerProfileIdentityByHref
"""
- # Construct dict forms of any model objects needed in order to build this model.
+ # 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'
- encryption_key_reference_model = {} # EncryptionKeyReference
- encryption_key_reference_model['crn'] = 'crn:v1:bluemix:public:kms:us-south:a/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179'
+ # 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
- volume_health_reason_model = {} # VolumeHealthReason
- volume_health_reason_model['code'] = 'initializing_from_snapshot'
- volume_health_reason_model['message'] = 'Performance will be degraded while this volume is being initialized from its snapshot'
- volume_health_reason_model['more_info'] = 'https://cloud.ibm.com/docs/vpc?topic=vpc-snapshots-vpc-troubleshooting&interface=ui#snapshot_ts_degraded_perf'
+ # 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)
- 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 bare_metal_server_profile_identity_by_href_model == bare_metal_server_profile_identity_by_href_model2
- 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'
+ # Convert model instance back to dict and verify no loss of data
+ 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
- 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_reference_deleted_model = {} # ImageReferenceDeleted
- image_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+class TestModel_BareMetalServerProfileIdentityByName:
+ """
+ Test Class for BareMetalServerProfileIdentityByName
+ """
- account_reference_model = {} # AccountReference
- account_reference_model['id'] = 'aa2432b1fa4d4ace891e9b80fc104e34'
- account_reference_model['resource_type'] = 'account'
+ def test_bare_metal_server_profile_identity_by_name_serialization(self):
+ """
+ Test serialization/deserialization for BareMetalServerProfileIdentityByName
+ """
- 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 BareMetalServerProfileIdentityByName model
+ bare_metal_server_profile_identity_by_name_model_json = {}
+ bare_metal_server_profile_identity_by_name_model_json['name'] = 'bx2-metal-192x768'
- image_remote_model = {} # ImageRemote
- image_remote_model['account'] = account_reference_model
- image_remote_model['region'] = region_reference_model
+ # 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
- 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'
- image_reference_model['remote'] = image_remote_model
- image_reference_model['resource_type'] = 'image'
+ # 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)
- snapshot_reference_deleted_model = {} # SnapshotReferenceDeleted
- snapshot_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ # Verify the model instances are equivalent
+ assert bare_metal_server_profile_identity_by_name_model == bare_metal_server_profile_identity_by_name_model2
- snapshot_remote_model = {} # SnapshotRemote
- snapshot_remote_model['region'] = region_reference_model
+ # Convert model instance back to dict and verify no loss of data
+ 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
- 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['remote'] = snapshot_remote_model
- snapshot_reference_model['resource_type'] = 'snapshot'
- 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'
+class TestModel_BareMetalServerProfileMemoryDependent:
+ """
+ Test Class for BareMetalServerProfileMemoryDependent
+ """
- 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'
+ def test_bare_metal_server_profile_memory_dependent_serialization(self):
+ """
+ Test serialization/deserialization for BareMetalServerProfileMemoryDependent
+ """
- volume_attachment_device_model = {} # VolumeAttachmentDevice
- volume_attachment_device_model['id'] = '80b3e36e-41f4-40e9-bd56-beae81792a68'
+ # 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'
- instance_reference_deleted_model = {} # InstanceReferenceDeleted
- instance_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ # 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
- 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 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)
- 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'
+ # Verify the model instances are equivalent
+ assert bare_metal_server_profile_memory_dependent_model == bare_metal_server_profile_memory_dependent_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
+ 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
- # Construct a json representation of a Volume model
- volume_model_json = {}
- volume_model_json['active'] = True
- volume_model_json['attachment_state'] = 'attached'
- 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['health_reasons'] = [volume_health_reason_model]
- volume_model_json['health_state'] = 'ok'
- volume_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
- volume_model_json['id'] = '1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
- volume_model_json['iops'] = 10000
- volume_model_json['name'] = 'my-volume'
- volume_model_json['operating_system'] = operating_system_model
- volume_model_json['profile'] = volume_profile_reference_model
- volume_model_json['resource_group'] = resource_group_reference_model
- volume_model_json['resource_type'] = 'volume'
- 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['user_tags'] = ['testString']
- volume_model_json['volume_attachments'] = [volume_attachment_reference_volume_context_model]
- volume_model_json['zone'] = zone_reference_model
- # 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_BareMetalServerProfileMemoryEnum:
+ """
+ Test Class for BareMetalServerProfileMemoryEnum
+ """
- # 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)
+ def test_bare_metal_server_profile_memory_enum_serialization(self):
+ """
+ Test serialization/deserialization for BareMetalServerProfileMemoryEnum
+ """
+
+ # 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 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 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 volume_model == volume_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
- volume_model_json2 = volume_model.to_dict()
- assert volume_model_json2 == volume_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_VolumeAttachment:
+class TestModel_BareMetalServerProfileMemoryFixed:
"""
- Test Class for VolumeAttachment
+ Test Class for BareMetalServerProfileMemoryFixed
"""
- def test_volume_attachment_serialization(self):
+ def test_bare_metal_server_profile_memory_fixed_serialization(self):
"""
- Test serialization/deserialization for VolumeAttachment
+ Test serialization/deserialization for BareMetalServerProfileMemoryFixed
"""
- # Construct dict forms of any model objects needed in order to build this 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
- volume_attachment_device_model = {} # VolumeAttachmentDevice
- volume_attachment_device_model['id'] = '80b3e36e-41f4-40e9-bd56-beae81792a68'
+ # 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
- volume_reference_volume_attachment_context_deleted_model = {} # VolumeReferenceVolumeAttachmentContextDeleted
- volume_reference_volume_attachment_context_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ # 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)
- volume_reference_volume_attachment_context_model = {} # VolumeReferenceVolumeAttachmentContext
- volume_reference_volume_attachment_context_model['crn'] = 'crn:[...]'
- volume_reference_volume_attachment_context_model['deleted'] = volume_reference_volume_attachment_context_deleted_model
- volume_reference_volume_attachment_context_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volumes/ca4b6df3-f5a8-4667-b5f2-f3b9b4160781'
- volume_reference_volume_attachment_context_model['id'] = 'ca4b6df3-f5a8-4667-b5f2-f3b9b4160781'
- volume_reference_volume_attachment_context_model['name'] = 'my-data-volume'
- volume_reference_volume_attachment_context_model['resource_type'] = 'volume'
+ # Verify the model instances are equivalent
+ assert bare_metal_server_profile_memory_fixed_model == bare_metal_server_profile_memory_fixed_model2
- # 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_volume_attachment_context_model
+ # Convert model instance back to dict and verify no loss of data
+ 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
- # 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 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)
+class TestModel_BareMetalServerProfileMemoryRange:
+ """
+ Test Class for BareMetalServerProfileMemoryRange
+ """
+
+ def test_bare_metal_server_profile_memory_range_serialization(self):
+ """
+ Test serialization/deserialization for BareMetalServerProfileMemoryRange
+ """
+
+ # 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 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 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 volume_attachment_model == volume_attachment_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
- volume_attachment_model_json2 = volume_attachment_model.to_dict()
- assert volume_attachment_model_json2 == volume_attachment_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_VolumeAttachmentCollection:
+class TestModel_BareMetalServerProfileNetworkAttachmentCountDependent:
"""
- Test Class for VolumeAttachmentCollection
+ Test Class for BareMetalServerProfileNetworkAttachmentCountDependent
"""
- def test_volume_attachment_collection_serialization(self):
+ def test_bare_metal_server_profile_network_attachment_count_dependent_serialization(self):
"""
- Test serialization/deserialization for VolumeAttachmentCollection
+ Test serialization/deserialization for BareMetalServerProfileNetworkAttachmentCountDependent
"""
- # 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_volume_attachment_context_deleted_model = {} # VolumeReferenceVolumeAttachmentContextDeleted
- volume_reference_volume_attachment_context_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
-
- volume_reference_volume_attachment_context_model = {} # VolumeReferenceVolumeAttachmentContext
- volume_reference_volume_attachment_context_model['crn'] = 'crn:[...]'
- volume_reference_volume_attachment_context_model['deleted'] = volume_reference_volume_attachment_context_deleted_model
- volume_reference_volume_attachment_context_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volumes/ac0b16a5-ccc2-47dd-90e2-b9e5f367b6c6'
- volume_reference_volume_attachment_context_model['id'] = 'ac0b16a5-ccc2-47dd-90e2-b9e5f367b6c6'
- volume_reference_volume_attachment_context_model['name'] = 'my-boot-volume'
- volume_reference_volume_attachment_context_model['resource_type'] = 'volume'
-
- 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_volume_attachment_context_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 json representation of a BareMetalServerProfileNetworkAttachmentCountDependent model
+ bare_metal_server_profile_network_attachment_count_dependent_model_json = {}
+ bare_metal_server_profile_network_attachment_count_dependent_model_json['type'] = 'dependent'
- # 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 BareMetalServerProfileNetworkAttachmentCountDependent by calling from_dict on the json representation
+ bare_metal_server_profile_network_attachment_count_dependent_model = BareMetalServerProfileNetworkAttachmentCountDependent.from_dict(bare_metal_server_profile_network_attachment_count_dependent_model_json)
+ assert bare_metal_server_profile_network_attachment_count_dependent_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 BareMetalServerProfileNetworkAttachmentCountDependent by calling from_dict on the json representation
+ bare_metal_server_profile_network_attachment_count_dependent_model_dict = BareMetalServerProfileNetworkAttachmentCountDependent.from_dict(bare_metal_server_profile_network_attachment_count_dependent_model_json).__dict__
+ bare_metal_server_profile_network_attachment_count_dependent_model2 = BareMetalServerProfileNetworkAttachmentCountDependent(**bare_metal_server_profile_network_attachment_count_dependent_model_dict)
# Verify the model instances are equivalent
- assert volume_attachment_collection_model == volume_attachment_collection_model2
+ assert bare_metal_server_profile_network_attachment_count_dependent_model == bare_metal_server_profile_network_attachment_count_dependent_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_profile_network_attachment_count_dependent_model_json2 = bare_metal_server_profile_network_attachment_count_dependent_model.to_dict()
+ assert bare_metal_server_profile_network_attachment_count_dependent_model_json2 == bare_metal_server_profile_network_attachment_count_dependent_model_json
-class TestModel_VolumeAttachmentDevice:
+class TestModel_BareMetalServerProfileNetworkAttachmentCountRange:
"""
- Test Class for VolumeAttachmentDevice
+ Test Class for BareMetalServerProfileNetworkAttachmentCountRange
"""
- def test_volume_attachment_device_serialization(self):
+ def test_bare_metal_server_profile_network_attachment_count_range_serialization(self):
"""
- Test serialization/deserialization for VolumeAttachmentDevice
+ Test serialization/deserialization for BareMetalServerProfileNetworkAttachmentCountRange
"""
- # 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 json representation of a BareMetalServerProfileNetworkAttachmentCountRange model
+ bare_metal_server_profile_network_attachment_count_range_model_json = {}
+ bare_metal_server_profile_network_attachment_count_range_model_json['max'] = 128
+ bare_metal_server_profile_network_attachment_count_range_model_json['min'] = 1
+ bare_metal_server_profile_network_attachment_count_range_model_json['type'] = 'range'
- # 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 BareMetalServerProfileNetworkAttachmentCountRange by calling from_dict on the json representation
+ bare_metal_server_profile_network_attachment_count_range_model = BareMetalServerProfileNetworkAttachmentCountRange.from_dict(bare_metal_server_profile_network_attachment_count_range_model_json)
+ assert bare_metal_server_profile_network_attachment_count_range_model != False
- # 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)
+ # Construct a model instance of BareMetalServerProfileNetworkAttachmentCountRange by calling from_dict on the json representation
+ bare_metal_server_profile_network_attachment_count_range_model_dict = BareMetalServerProfileNetworkAttachmentCountRange.from_dict(bare_metal_server_profile_network_attachment_count_range_model_json).__dict__
+ bare_metal_server_profile_network_attachment_count_range_model2 = BareMetalServerProfileNetworkAttachmentCountRange(**bare_metal_server_profile_network_attachment_count_range_model_dict)
# Verify the model instances are equivalent
- assert volume_attachment_device_model == volume_attachment_device_model2
+ assert bare_metal_server_profile_network_attachment_count_range_model == bare_metal_server_profile_network_attachment_count_range_model2
# 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
+ bare_metal_server_profile_network_attachment_count_range_model_json2 = bare_metal_server_profile_network_attachment_count_range_model.to_dict()
+ assert bare_metal_server_profile_network_attachment_count_range_model_json2 == bare_metal_server_profile_network_attachment_count_range_model_json
-class TestModel_VolumeAttachmentPatch:
+class TestModel_BareMetalServerProfileNetworkInterfaceCountDependent:
"""
- Test Class for VolumeAttachmentPatch
+ Test Class for BareMetalServerProfileNetworkInterfaceCountDependent
"""
- def test_volume_attachment_patch_serialization(self):
+ def test_bare_metal_server_profile_network_interface_count_dependent_serialization(self):
"""
- Test serialization/deserialization for VolumeAttachmentPatch
+ Test serialization/deserialization for BareMetalServerProfileNetworkInterfaceCountDependent
"""
- # 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 BareMetalServerProfileNetworkInterfaceCountDependent model
+ bare_metal_server_profile_network_interface_count_dependent_model_json = {}
+ bare_metal_server_profile_network_interface_count_dependent_model_json['type'] = 'dependent'
- # 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 BareMetalServerProfileNetworkInterfaceCountDependent by calling from_dict on the json representation
+ bare_metal_server_profile_network_interface_count_dependent_model = BareMetalServerProfileNetworkInterfaceCountDependent.from_dict(bare_metal_server_profile_network_interface_count_dependent_model_json)
+ assert bare_metal_server_profile_network_interface_count_dependent_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 BareMetalServerProfileNetworkInterfaceCountDependent by calling from_dict on the json representation
+ bare_metal_server_profile_network_interface_count_dependent_model_dict = BareMetalServerProfileNetworkInterfaceCountDependent.from_dict(bare_metal_server_profile_network_interface_count_dependent_model_json).__dict__
+ bare_metal_server_profile_network_interface_count_dependent_model2 = BareMetalServerProfileNetworkInterfaceCountDependent(**bare_metal_server_profile_network_interface_count_dependent_model_dict)
# Verify the model instances are equivalent
- assert volume_attachment_patch_model == volume_attachment_patch_model2
+ assert bare_metal_server_profile_network_interface_count_dependent_model == bare_metal_server_profile_network_interface_count_dependent_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_profile_network_interface_count_dependent_model_json2 = bare_metal_server_profile_network_interface_count_dependent_model.to_dict()
+ assert bare_metal_server_profile_network_interface_count_dependent_model_json2 == bare_metal_server_profile_network_interface_count_dependent_model_json
-class TestModel_VolumeAttachmentPrototype:
+class TestModel_BareMetalServerProfileNetworkInterfaceCountRange:
"""
- Test Class for VolumeAttachmentPrototype
+ Test Class for BareMetalServerProfileNetworkInterfaceCountRange
"""
- def test_volume_attachment_prototype_serialization(self):
+ def test_bare_metal_server_profile_network_interface_count_range_serialization(self):
"""
- Test serialization/deserialization for VolumeAttachmentPrototype
+ Test serialization/deserialization for BareMetalServerProfileNetworkInterfaceCountRange
"""
- # Construct dict forms of any model objects needed in order to build this model.
-
- volume_attachment_prototype_volume_model = {} # VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById
- volume_attachment_prototype_volume_model['id'] = '1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
-
- # Construct a json representation of a VolumeAttachmentPrototype model
- volume_attachment_prototype_model_json = {}
- volume_attachment_prototype_model_json['delete_volume_on_instance_delete'] = False
- volume_attachment_prototype_model_json['name'] = 'my-volume-attachment'
- volume_attachment_prototype_model_json['volume'] = volume_attachment_prototype_volume_model
+ # Construct a json representation of a BareMetalServerProfileNetworkInterfaceCountRange model
+ bare_metal_server_profile_network_interface_count_range_model_json = {}
+ bare_metal_server_profile_network_interface_count_range_model_json['max'] = 128
+ bare_metal_server_profile_network_interface_count_range_model_json['min'] = 1
+ bare_metal_server_profile_network_interface_count_range_model_json['type'] = 'range'
- # Construct a model instance of VolumeAttachmentPrototype by calling from_dict on the json representation
- volume_attachment_prototype_model = VolumeAttachmentPrototype.from_dict(volume_attachment_prototype_model_json)
- assert volume_attachment_prototype_model != False
+ # Construct a model instance of BareMetalServerProfileNetworkInterfaceCountRange by calling from_dict on the json representation
+ bare_metal_server_profile_network_interface_count_range_model = BareMetalServerProfileNetworkInterfaceCountRange.from_dict(bare_metal_server_profile_network_interface_count_range_model_json)
+ assert bare_metal_server_profile_network_interface_count_range_model != False
- # Construct a model instance of VolumeAttachmentPrototype by calling from_dict on the json representation
- volume_attachment_prototype_model_dict = VolumeAttachmentPrototype.from_dict(volume_attachment_prototype_model_json).__dict__
- volume_attachment_prototype_model2 = VolumeAttachmentPrototype(**volume_attachment_prototype_model_dict)
+ # Construct a model instance of BareMetalServerProfileNetworkInterfaceCountRange by calling from_dict on the json representation
+ bare_metal_server_profile_network_interface_count_range_model_dict = BareMetalServerProfileNetworkInterfaceCountRange.from_dict(bare_metal_server_profile_network_interface_count_range_model_json).__dict__
+ bare_metal_server_profile_network_interface_count_range_model2 = BareMetalServerProfileNetworkInterfaceCountRange(**bare_metal_server_profile_network_interface_count_range_model_dict)
# Verify the model instances are equivalent
- assert volume_attachment_prototype_model == volume_attachment_prototype_model2
+ assert bare_metal_server_profile_network_interface_count_range_model == bare_metal_server_profile_network_interface_count_range_model2
# Convert model instance back to dict and verify no loss of data
- volume_attachment_prototype_model_json2 = volume_attachment_prototype_model.to_dict()
- assert volume_attachment_prototype_model_json2 == volume_attachment_prototype_model_json
+ bare_metal_server_profile_network_interface_count_range_model_json2 = bare_metal_server_profile_network_interface_count_range_model.to_dict()
+ assert bare_metal_server_profile_network_interface_count_range_model_json2 == bare_metal_server_profile_network_interface_count_range_model_json
-class TestModel_VolumeAttachmentPrototypeInstanceByImageContext:
+class TestModel_BareMetalServerPrototypeBareMetalServerByNetworkAttachment:
"""
- Test Class for VolumeAttachmentPrototypeInstanceByImageContext
+ Test Class for BareMetalServerPrototypeBareMetalServerByNetworkAttachment
"""
- def test_volume_attachment_prototype_instance_by_image_context_serialization(self):
+ def test_bare_metal_server_prototype_bare_metal_server_by_network_attachment_serialization(self):
"""
- Test serialization/deserialization for VolumeAttachmentPrototypeInstanceByImageContext
+ Test serialization/deserialization for BareMetalServerPrototypeBareMetalServerByNetworkAttachment
"""
# 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/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179'
+ image_identity_model = {} # ImageIdentityById
+ image_identity_model['id'] = '72b27b5c-f4b0-48bb-b954-5becc7c1dcb8'
- volume_profile_identity_model = {} # VolumeProfileIdentityByName
- volume_profile_identity_model['name'] = 'general-purpose'
+ key_identity_model = {} # KeyIdentityById
+ key_identity_model['id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803'
+
+ bare_metal_server_initialization_prototype_model = {} # BareMetalServerInitializationPrototype
+ 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'
+
+ bare_metal_server_profile_identity_model = {} # BareMetalServerProfileIdentityByName
+ bare_metal_server_profile_identity_model['name'] = 'bx2-metal-192x768'
resource_group_identity_model = {} # ResourceGroupIdentityById
resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
- volume_prototype_instance_by_image_context_model = {} # VolumePrototypeInstanceByImageContext
- volume_prototype_instance_by_image_context_model['capacity'] = 100
- volume_prototype_instance_by_image_context_model['encryption_key'] = encryption_key_identity_model
- volume_prototype_instance_by_image_context_model['iops'] = 10000
- volume_prototype_instance_by_image_context_model['name'] = 'my-volume'
- volume_prototype_instance_by_image_context_model['profile'] = volume_profile_identity_model
- volume_prototype_instance_by_image_context_model['resource_group'] = resource_group_identity_model
- volume_prototype_instance_by_image_context_model['user_tags'] = []
+ bare_metal_server_trusted_platform_module_prototype_model = {} # BareMetalServerTrustedPlatformModulePrototype
+ bare_metal_server_trusted_platform_module_prototype_model['mode'] = 'disabled'
- # 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
+ vpc_identity_model = {} # VPCIdentityById
+ vpc_identity_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b'
- # 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
+ zone_identity_model = {} # ZoneIdentityByName
+ zone_identity_model['name'] = 'us-south-1'
- # 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)
+ virtual_network_interface_ip_prototype_model = {} # VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext
+ virtual_network_interface_ip_prototype_model['address'] = '10.0.0.5'
+ virtual_network_interface_ip_prototype_model['auto_delete'] = False
+ virtual_network_interface_ip_prototype_model['name'] = 'my-reserved-ip'
+
+ virtual_network_interface_primary_ip_prototype_model = {} # VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext
+ virtual_network_interface_primary_ip_prototype_model['address'] = '10.0.0.5'
+ virtual_network_interface_primary_ip_prototype_model['auto_delete'] = False
+ virtual_network_interface_primary_ip_prototype_model['name'] = 'my-reserved-ip'
+
+ 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'
+
+ bare_metal_server_network_attachment_prototype_virtual_network_interface_model = {} # BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeBareMetalServerNetworkAttachmentContext
+ bare_metal_server_network_attachment_prototype_virtual_network_interface_model['allow_ip_spoofing'] = True
+ bare_metal_server_network_attachment_prototype_virtual_network_interface_model['auto_delete'] = False
+ bare_metal_server_network_attachment_prototype_virtual_network_interface_model['enable_infrastructure_nat'] = True
+ bare_metal_server_network_attachment_prototype_virtual_network_interface_model['ips'] = [virtual_network_interface_ip_prototype_model]
+ bare_metal_server_network_attachment_prototype_virtual_network_interface_model['name'] = 'my-virtual-network-interface'
+ bare_metal_server_network_attachment_prototype_virtual_network_interface_model['primary_ip'] = virtual_network_interface_primary_ip_prototype_model
+ bare_metal_server_network_attachment_prototype_virtual_network_interface_model['resource_group'] = resource_group_identity_model
+ bare_metal_server_network_attachment_prototype_virtual_network_interface_model['security_groups'] = [security_group_identity_model]
+ bare_metal_server_network_attachment_prototype_virtual_network_interface_model['subnet'] = subnet_identity_model
+
+ bare_metal_server_network_attachment_prototype_model = {} # BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByPCIPrototype
+ bare_metal_server_network_attachment_prototype_model['name'] = 'my-bare-metal-server-network-attachment'
+ bare_metal_server_network_attachment_prototype_model['virtual_network_interface'] = bare_metal_server_network_attachment_prototype_virtual_network_interface_model
+ bare_metal_server_network_attachment_prototype_model['allowed_vlans'] = []
+ bare_metal_server_network_attachment_prototype_model['interface_type'] = 'pci'
+
+ bare_metal_server_primary_network_attachment_prototype_model = {} # BareMetalServerPrimaryNetworkAttachmentPrototypeBareMetalServerPrimaryNetworkAttachmentByPCIPrototype
+ bare_metal_server_primary_network_attachment_prototype_model['name'] = 'my-bare-metal-server-network-attachment'
+ bare_metal_server_primary_network_attachment_prototype_model['virtual_network_interface'] = bare_metal_server_network_attachment_prototype_virtual_network_interface_model
+ bare_metal_server_primary_network_attachment_prototype_model['allowed_vlans'] = []
+ bare_metal_server_primary_network_attachment_prototype_model['interface_type'] = 'pci'
+
+ # Construct a json representation of a BareMetalServerPrototypeBareMetalServerByNetworkAttachment model
+ bare_metal_server_prototype_bare_metal_server_by_network_attachment_model_json = {}
+ bare_metal_server_prototype_bare_metal_server_by_network_attachment_model_json['enable_secure_boot'] = False
+ bare_metal_server_prototype_bare_metal_server_by_network_attachment_model_json['initialization'] = bare_metal_server_initialization_prototype_model
+ bare_metal_server_prototype_bare_metal_server_by_network_attachment_model_json['name'] = 'my-bare-metal-server'
+ bare_metal_server_prototype_bare_metal_server_by_network_attachment_model_json['profile'] = bare_metal_server_profile_identity_model
+ bare_metal_server_prototype_bare_metal_server_by_network_attachment_model_json['resource_group'] = resource_group_identity_model
+ bare_metal_server_prototype_bare_metal_server_by_network_attachment_model_json['trusted_platform_module'] = bare_metal_server_trusted_platform_module_prototype_model
+ bare_metal_server_prototype_bare_metal_server_by_network_attachment_model_json['vpc'] = vpc_identity_model
+ bare_metal_server_prototype_bare_metal_server_by_network_attachment_model_json['zone'] = zone_identity_model
+ bare_metal_server_prototype_bare_metal_server_by_network_attachment_model_json['network_attachments'] = [bare_metal_server_network_attachment_prototype_model]
+ bare_metal_server_prototype_bare_metal_server_by_network_attachment_model_json['primary_network_attachment'] = bare_metal_server_primary_network_attachment_prototype_model
+
+ # Construct a model instance of BareMetalServerPrototypeBareMetalServerByNetworkAttachment by calling from_dict on the json representation
+ bare_metal_server_prototype_bare_metal_server_by_network_attachment_model = BareMetalServerPrototypeBareMetalServerByNetworkAttachment.from_dict(bare_metal_server_prototype_bare_metal_server_by_network_attachment_model_json)
+ assert bare_metal_server_prototype_bare_metal_server_by_network_attachment_model != False
+
+ # Construct a model instance of BareMetalServerPrototypeBareMetalServerByNetworkAttachment by calling from_dict on the json representation
+ bare_metal_server_prototype_bare_metal_server_by_network_attachment_model_dict = BareMetalServerPrototypeBareMetalServerByNetworkAttachment.from_dict(bare_metal_server_prototype_bare_metal_server_by_network_attachment_model_json).__dict__
+ bare_metal_server_prototype_bare_metal_server_by_network_attachment_model2 = BareMetalServerPrototypeBareMetalServerByNetworkAttachment(**bare_metal_server_prototype_bare_metal_server_by_network_attachment_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_prototype_bare_metal_server_by_network_attachment_model == bare_metal_server_prototype_bare_metal_server_by_network_attachment_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_prototype_bare_metal_server_by_network_attachment_model_json2 = bare_metal_server_prototype_bare_metal_server_by_network_attachment_model.to_dict()
+ assert bare_metal_server_prototype_bare_metal_server_by_network_attachment_model_json2 == bare_metal_server_prototype_bare_metal_server_by_network_attachment_model_json
-class TestModel_VolumeAttachmentPrototypeInstanceBySourceSnapshotContext:
+class TestModel_BareMetalServerPrototypeBareMetalServerByNetworkInterface:
"""
- Test Class for VolumeAttachmentPrototypeInstanceBySourceSnapshotContext
+ Test Class for BareMetalServerPrototypeBareMetalServerByNetworkInterface
"""
- def test_volume_attachment_prototype_instance_by_source_snapshot_context_serialization(self):
+ def test_bare_metal_server_prototype_bare_metal_server_by_network_interface_serialization(self):
"""
- Test serialization/deserialization for VolumeAttachmentPrototypeInstanceBySourceSnapshotContext
+ Test serialization/deserialization for BareMetalServerPrototypeBareMetalServerByNetworkInterface
"""
# 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/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179'
+ image_identity_model = {} # ImageIdentityById
+ image_identity_model['id'] = '72b27b5c-f4b0-48bb-b954-5becc7c1dcb8'
- volume_profile_identity_model = {} # VolumeProfileIdentityByName
- volume_profile_identity_model['name'] = 'general-purpose'
+ key_identity_model = {} # KeyIdentityById
+ key_identity_model['id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803'
+
+ bare_metal_server_initialization_prototype_model = {} # BareMetalServerInitializationPrototype
+ 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'
+
+ bare_metal_server_profile_identity_model = {} # BareMetalServerProfileIdentityByName
+ bare_metal_server_profile_identity_model['name'] = 'bx2-metal-192x768'
resource_group_identity_model = {} # ResourceGroupIdentityById
resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
- snapshot_identity_model = {} # SnapshotIdentityById
- snapshot_identity_model['id'] = '349a61d8-7ab1-420f-a690-5fed76ef9d4f'
+ bare_metal_server_trusted_platform_module_prototype_model = {} # BareMetalServerTrustedPlatformModulePrototype
+ bare_metal_server_trusted_platform_module_prototype_model['mode'] = 'disabled'
- volume_prototype_instance_by_source_snapshot_context_model = {} # VolumePrototypeInstanceBySourceSnapshotContext
- volume_prototype_instance_by_source_snapshot_context_model['capacity'] = 100
- volume_prototype_instance_by_source_snapshot_context_model['encryption_key'] = encryption_key_identity_model
- volume_prototype_instance_by_source_snapshot_context_model['iops'] = 10000
- volume_prototype_instance_by_source_snapshot_context_model['name'] = 'my-volume'
- volume_prototype_instance_by_source_snapshot_context_model['profile'] = volume_profile_identity_model
- volume_prototype_instance_by_source_snapshot_context_model['resource_group'] = resource_group_identity_model
- volume_prototype_instance_by_source_snapshot_context_model['source_snapshot'] = snapshot_identity_model
- volume_prototype_instance_by_source_snapshot_context_model['user_tags'] = []
+ vpc_identity_model = {} # VPCIdentityById
+ vpc_identity_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b'
- # Construct a json representation of a VolumeAttachmentPrototypeInstanceBySourceSnapshotContext model
- volume_attachment_prototype_instance_by_source_snapshot_context_model_json = {}
- volume_attachment_prototype_instance_by_source_snapshot_context_model_json['delete_volume_on_instance_delete'] = True
- volume_attachment_prototype_instance_by_source_snapshot_context_model_json['name'] = 'my-volume-attachment'
- volume_attachment_prototype_instance_by_source_snapshot_context_model_json['volume'] = volume_prototype_instance_by_source_snapshot_context_model
+ zone_identity_model = {} # ZoneIdentityByName
+ zone_identity_model['name'] = 'us-south-1'
- # Construct a model instance of VolumeAttachmentPrototypeInstanceBySourceSnapshotContext by calling from_dict on the json representation
- volume_attachment_prototype_instance_by_source_snapshot_context_model = VolumeAttachmentPrototypeInstanceBySourceSnapshotContext.from_dict(volume_attachment_prototype_instance_by_source_snapshot_context_model_json)
- assert volume_attachment_prototype_instance_by_source_snapshot_context_model != False
+ network_interface_ip_prototype_model = {} # NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext
+ network_interface_ip_prototype_model['address'] = '10.0.0.5'
+ network_interface_ip_prototype_model['auto_delete'] = False
+ network_interface_ip_prototype_model['name'] = 'my-reserved-ip'
- # Construct a model instance of VolumeAttachmentPrototypeInstanceBySourceSnapshotContext by calling from_dict on the json representation
- volume_attachment_prototype_instance_by_source_snapshot_context_model_dict = VolumeAttachmentPrototypeInstanceBySourceSnapshotContext.from_dict(volume_attachment_prototype_instance_by_source_snapshot_context_model_json).__dict__
- volume_attachment_prototype_instance_by_source_snapshot_context_model2 = VolumeAttachmentPrototypeInstanceBySourceSnapshotContext(**volume_attachment_prototype_instance_by_source_snapshot_context_model_dict)
+ 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'
+
+ bare_metal_server_network_interface_prototype_model = {} # BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype
+ bare_metal_server_network_interface_prototype_model['allow_ip_spoofing'] = True
+ bare_metal_server_network_interface_prototype_model['enable_infrastructure_nat'] = True
+ bare_metal_server_network_interface_prototype_model['name'] = 'my-bare-metal-server-network-interface'
+ bare_metal_server_network_interface_prototype_model['primary_ip'] = network_interface_ip_prototype_model
+ bare_metal_server_network_interface_prototype_model['security_groups'] = [security_group_identity_model]
+ bare_metal_server_network_interface_prototype_model['subnet'] = subnet_identity_model
+ bare_metal_server_network_interface_prototype_model['interface_type'] = 'hipersocket'
+
+ bare_metal_server_primary_network_interface_prototype_model = {} # BareMetalServerPrimaryNetworkInterfacePrototype
+ 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-bare-metal-server-network-interface'
+ bare_metal_server_primary_network_interface_prototype_model['primary_ip'] = network_interface_ip_prototype_model
+ bare_metal_server_primary_network_interface_prototype_model['security_groups'] = [security_group_identity_model]
+ bare_metal_server_primary_network_interface_prototype_model['subnet'] = subnet_identity_model
+
+ # Construct a json representation of a BareMetalServerPrototypeBareMetalServerByNetworkInterface model
+ bare_metal_server_prototype_bare_metal_server_by_network_interface_model_json = {}
+ bare_metal_server_prototype_bare_metal_server_by_network_interface_model_json['enable_secure_boot'] = False
+ bare_metal_server_prototype_bare_metal_server_by_network_interface_model_json['initialization'] = bare_metal_server_initialization_prototype_model
+ bare_metal_server_prototype_bare_metal_server_by_network_interface_model_json['name'] = 'my-bare-metal-server'
+ bare_metal_server_prototype_bare_metal_server_by_network_interface_model_json['profile'] = bare_metal_server_profile_identity_model
+ bare_metal_server_prototype_bare_metal_server_by_network_interface_model_json['resource_group'] = resource_group_identity_model
+ bare_metal_server_prototype_bare_metal_server_by_network_interface_model_json['trusted_platform_module'] = bare_metal_server_trusted_platform_module_prototype_model
+ bare_metal_server_prototype_bare_metal_server_by_network_interface_model_json['vpc'] = vpc_identity_model
+ bare_metal_server_prototype_bare_metal_server_by_network_interface_model_json['zone'] = zone_identity_model
+ bare_metal_server_prototype_bare_metal_server_by_network_interface_model_json['network_interfaces'] = [bare_metal_server_network_interface_prototype_model]
+ bare_metal_server_prototype_bare_metal_server_by_network_interface_model_json['primary_network_interface'] = bare_metal_server_primary_network_interface_prototype_model
+
+ # Construct a model instance of BareMetalServerPrototypeBareMetalServerByNetworkInterface by calling from_dict on the json representation
+ bare_metal_server_prototype_bare_metal_server_by_network_interface_model = BareMetalServerPrototypeBareMetalServerByNetworkInterface.from_dict(bare_metal_server_prototype_bare_metal_server_by_network_interface_model_json)
+ assert bare_metal_server_prototype_bare_metal_server_by_network_interface_model != False
+
+ # Construct a model instance of BareMetalServerPrototypeBareMetalServerByNetworkInterface by calling from_dict on the json representation
+ bare_metal_server_prototype_bare_metal_server_by_network_interface_model_dict = BareMetalServerPrototypeBareMetalServerByNetworkInterface.from_dict(bare_metal_server_prototype_bare_metal_server_by_network_interface_model_json).__dict__
+ bare_metal_server_prototype_bare_metal_server_by_network_interface_model2 = BareMetalServerPrototypeBareMetalServerByNetworkInterface(**bare_metal_server_prototype_bare_metal_server_by_network_interface_model_dict)
# Verify the model instances are equivalent
- assert volume_attachment_prototype_instance_by_source_snapshot_context_model == volume_attachment_prototype_instance_by_source_snapshot_context_model2
+ assert bare_metal_server_prototype_bare_metal_server_by_network_interface_model == bare_metal_server_prototype_bare_metal_server_by_network_interface_model2
# Convert model instance back to dict and verify no loss of data
- volume_attachment_prototype_instance_by_source_snapshot_context_model_json2 = volume_attachment_prototype_instance_by_source_snapshot_context_model.to_dict()
- assert volume_attachment_prototype_instance_by_source_snapshot_context_model_json2 == volume_attachment_prototype_instance_by_source_snapshot_context_model_json
+ bare_metal_server_prototype_bare_metal_server_by_network_interface_model_json2 = bare_metal_server_prototype_bare_metal_server_by_network_interface_model.to_dict()
+ assert bare_metal_server_prototype_bare_metal_server_by_network_interface_model_json2 == bare_metal_server_prototype_bare_metal_server_by_network_interface_model_json
-class TestModel_VolumeAttachmentPrototypeInstanceByVolumeContext:
+class TestModel_CatalogOfferingIdentityCatalogOfferingByCRN:
"""
- Test Class for VolumeAttachmentPrototypeInstanceByVolumeContext
+ Test Class for CatalogOfferingIdentityCatalogOfferingByCRN
"""
- def test_volume_attachment_prototype_instance_by_volume_context_serialization(self):
+ def test_catalog_offering_identity_catalog_offering_by_crn_serialization(self):
"""
- Test serialization/deserialization for VolumeAttachmentPrototypeInstanceByVolumeContext
+ Test serialization/deserialization for CatalogOfferingIdentityCatalogOfferingByCRN
"""
- # Construct dict forms of any model objects needed in order to build this model.
-
- volume_identity_model = {} # VolumeIdentityById
- volume_identity_model['id'] = '1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
-
- # 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_identity_model
+ # Construct a json representation of a CatalogOfferingIdentityCatalogOfferingByCRN model
+ catalog_offering_identity_catalog_offering_by_crn_model_json = {}
+ catalog_offering_identity_catalog_offering_by_crn_model_json['crn'] = 'crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:offering:00111601-0ec5-41ac-b142-96d1e64e6442'
- # Construct a model instance of 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 CatalogOfferingIdentityCatalogOfferingByCRN by calling from_dict on the json representation
+ catalog_offering_identity_catalog_offering_by_crn_model = CatalogOfferingIdentityCatalogOfferingByCRN.from_dict(catalog_offering_identity_catalog_offering_by_crn_model_json)
+ assert catalog_offering_identity_catalog_offering_by_crn_model != False
- # Construct a model instance of 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 CatalogOfferingIdentityCatalogOfferingByCRN by calling from_dict on the json representation
+ catalog_offering_identity_catalog_offering_by_crn_model_dict = CatalogOfferingIdentityCatalogOfferingByCRN.from_dict(catalog_offering_identity_catalog_offering_by_crn_model_json).__dict__
+ catalog_offering_identity_catalog_offering_by_crn_model2 = CatalogOfferingIdentityCatalogOfferingByCRN(**catalog_offering_identity_catalog_offering_by_crn_model_dict)
# Verify the model instances are equivalent
- assert volume_attachment_prototype_instance_by_volume_context_model == volume_attachment_prototype_instance_by_volume_context_model2
+ assert catalog_offering_identity_catalog_offering_by_crn_model == catalog_offering_identity_catalog_offering_by_crn_model2
# Convert model instance back to dict and verify no loss of data
- 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
+ catalog_offering_identity_catalog_offering_by_crn_model_json2 = catalog_offering_identity_catalog_offering_by_crn_model.to_dict()
+ assert catalog_offering_identity_catalog_offering_by_crn_model_json2 == catalog_offering_identity_catalog_offering_by_crn_model_json
-class TestModel_VolumeAttachmentReferenceInstanceContext:
+class TestModel_CatalogOfferingVersionIdentityCatalogOfferingVersionByCRN:
"""
- Test Class for VolumeAttachmentReferenceInstanceContext
+ Test Class for CatalogOfferingVersionIdentityCatalogOfferingVersionByCRN
"""
- def test_volume_attachment_reference_instance_context_serialization(self):
+ def test_catalog_offering_version_identity_catalog_offering_version_by_crn_serialization(self):
"""
- Test serialization/deserialization for VolumeAttachmentReferenceInstanceContext
+ Test serialization/deserialization for CatalogOfferingVersionIdentityCatalogOfferingVersionByCRN
"""
- # 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'] = '80b3e36e-41f4-40e9-bd56-beae81792a68'
-
- volume_reference_volume_attachment_context_deleted_model = {} # VolumeReferenceVolumeAttachmentContextDeleted
- volume_reference_volume_attachment_context_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
-
- volume_reference_volume_attachment_context_model = {} # VolumeReferenceVolumeAttachmentContext
- volume_reference_volume_attachment_context_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
- volume_reference_volume_attachment_context_model['deleted'] = volume_reference_volume_attachment_context_deleted_model
- volume_reference_volume_attachment_context_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
- volume_reference_volume_attachment_context_model['id'] = '1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
- volume_reference_volume_attachment_context_model['name'] = 'my-volume'
- volume_reference_volume_attachment_context_model['resource_type'] = 'volume'
-
- # 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_volume_attachment_context_model
+ # Construct a json representation of a CatalogOfferingVersionIdentityCatalogOfferingVersionByCRN model
+ catalog_offering_version_identity_catalog_offering_version_by_crn_model_json = {}
+ catalog_offering_version_identity_catalog_offering_version_by_crn_model_json['crn'] = 'crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d'
- # Construct a model instance of 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 CatalogOfferingVersionIdentityCatalogOfferingVersionByCRN by calling from_dict on the json representation
+ catalog_offering_version_identity_catalog_offering_version_by_crn_model = CatalogOfferingVersionIdentityCatalogOfferingVersionByCRN.from_dict(catalog_offering_version_identity_catalog_offering_version_by_crn_model_json)
+ assert catalog_offering_version_identity_catalog_offering_version_by_crn_model != False
- # Construct a model instance of 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 model instance of CatalogOfferingVersionIdentityCatalogOfferingVersionByCRN by calling from_dict on the json representation
+ catalog_offering_version_identity_catalog_offering_version_by_crn_model_dict = CatalogOfferingVersionIdentityCatalogOfferingVersionByCRN.from_dict(catalog_offering_version_identity_catalog_offering_version_by_crn_model_json).__dict__
+ catalog_offering_version_identity_catalog_offering_version_by_crn_model2 = CatalogOfferingVersionIdentityCatalogOfferingVersionByCRN(**catalog_offering_version_identity_catalog_offering_version_by_crn_model_dict)
# Verify the model instances are equivalent
- assert volume_attachment_reference_instance_context_model == volume_attachment_reference_instance_context_model2
+ assert catalog_offering_version_identity_catalog_offering_version_by_crn_model == catalog_offering_version_identity_catalog_offering_version_by_crn_model2
# Convert model instance back to dict and verify no loss of data
- 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
+ catalog_offering_version_identity_catalog_offering_version_by_crn_model_json2 = catalog_offering_version_identity_catalog_offering_version_by_crn_model.to_dict()
+ assert catalog_offering_version_identity_catalog_offering_version_by_crn_model_json2 == catalog_offering_version_identity_catalog_offering_version_by_crn_model_json
-class TestModel_VolumeAttachmentReferenceInstanceContextDeleted:
+class TestModel_CertificateInstanceIdentityByCRN:
"""
- Test Class for VolumeAttachmentReferenceInstanceContextDeleted
+ Test Class for CertificateInstanceIdentityByCRN
"""
- def test_volume_attachment_reference_instance_context_deleted_serialization(self):
+ def test_certificate_instance_identity_by_crn_serialization(self):
"""
- Test serialization/deserialization for VolumeAttachmentReferenceInstanceContextDeleted
+ Test serialization/deserialization for CertificateInstanceIdentityByCRN
"""
- # 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 CertificateInstanceIdentityByCRN model
+ certificate_instance_identity_by_crn_model_json = {}
+ certificate_instance_identity_by_crn_model_json['crn'] = 'crn:v1:bluemix:public:secrets-manager:us-south:a/123456:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5'
- # Construct a model instance of 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 CertificateInstanceIdentityByCRN by calling from_dict on the json representation
+ certificate_instance_identity_by_crn_model = CertificateInstanceIdentityByCRN.from_dict(certificate_instance_identity_by_crn_model_json)
+ assert certificate_instance_identity_by_crn_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 CertificateInstanceIdentityByCRN by calling from_dict on the json representation
+ certificate_instance_identity_by_crn_model_dict = CertificateInstanceIdentityByCRN.from_dict(certificate_instance_identity_by_crn_model_json).__dict__
+ certificate_instance_identity_by_crn_model2 = CertificateInstanceIdentityByCRN(**certificate_instance_identity_by_crn_model_dict)
# Verify the model instances are equivalent
- assert volume_attachment_reference_instance_context_deleted_model == volume_attachment_reference_instance_context_deleted_model2
+ assert certificate_instance_identity_by_crn_model == certificate_instance_identity_by_crn_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
+ certificate_instance_identity_by_crn_model_json2 = certificate_instance_identity_by_crn_model.to_dict()
+ assert certificate_instance_identity_by_crn_model_json2 == certificate_instance_identity_by_crn_model_json
-class TestModel_VolumeAttachmentReferenceVolumeContext:
+class TestModel_CloudObjectStorageBucketIdentityByCRN:
"""
- Test Class for VolumeAttachmentReferenceVolumeContext
+ Test Class for CloudObjectStorageBucketIdentityByCRN
"""
- def test_volume_attachment_reference_volume_context_serialization(self):
+ def test_cloud_object_storage_bucket_identity_by_crn_serialization(self):
"""
- Test serialization/deserialization for VolumeAttachmentReferenceVolumeContext
+ Test serialization/deserialization for CloudObjectStorageBucketIdentityByCRN
"""
- # Construct dict forms of any model objects needed in order to build this model.
+ # Construct a json representation of a CloudObjectStorageBucketIdentityByCRN model
+ cloud_object_storage_bucket_identity_by_crn_model_json = {}
+ cloud_object_storage_bucket_identity_by_crn_model_json['crn'] = 'crn:v1:bluemix:public:cloud-object-storage:global:a/123456:1a0ec336-f391-4091-a6fb-5e084a4c56f4:bucket:my-bucket'
- 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 CloudObjectStorageBucketIdentityByCRN by calling from_dict on the json representation
+ cloud_object_storage_bucket_identity_by_crn_model = CloudObjectStorageBucketIdentityByCRN.from_dict(cloud_object_storage_bucket_identity_by_crn_model_json)
+ assert cloud_object_storage_bucket_identity_by_crn_model != False
- volume_attachment_device_model = {} # VolumeAttachmentDevice
- volume_attachment_device_model['id'] = '80b3e36e-41f4-40e9-bd56-beae81792a68'
+ # Construct a model instance of CloudObjectStorageBucketIdentityByCRN by calling from_dict on the json representation
+ cloud_object_storage_bucket_identity_by_crn_model_dict = CloudObjectStorageBucketIdentityByCRN.from_dict(cloud_object_storage_bucket_identity_by_crn_model_json).__dict__
+ cloud_object_storage_bucket_identity_by_crn_model2 = CloudObjectStorageBucketIdentityByCRN(**cloud_object_storage_bucket_identity_by_crn_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 cloud_object_storage_bucket_identity_by_crn_model == cloud_object_storage_bucket_identity_by_crn_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
+ cloud_object_storage_bucket_identity_by_crn_model_json2 = cloud_object_storage_bucket_identity_by_crn_model.to_dict()
+ assert cloud_object_storage_bucket_identity_by_crn_model_json2 == cloud_object_storage_bucket_identity_by_crn_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'
- # 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
+class TestModel_CloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName:
+ """
+ Test Class for CloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName
+ """
- # 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)
+ def test_cloud_object_storage_bucket_identity_cloud_object_storage_bucket_identity_by_name_serialization(self):
+ """
+ Test serialization/deserialization for CloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName
+ """
+
+ # Construct a json representation of a CloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName model
+ cloud_object_storage_bucket_identity_cloud_object_storage_bucket_identity_by_name_model_json = {}
+ cloud_object_storage_bucket_identity_cloud_object_storage_bucket_identity_by_name_model_json['name'] = 'bucket-27200-lwx4cfvcue'
+
+ # Construct a model instance of CloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName by calling from_dict on the json representation
+ cloud_object_storage_bucket_identity_cloud_object_storage_bucket_identity_by_name_model = CloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName.from_dict(cloud_object_storage_bucket_identity_cloud_object_storage_bucket_identity_by_name_model_json)
+ assert cloud_object_storage_bucket_identity_cloud_object_storage_bucket_identity_by_name_model != False
+
+ # Construct a model instance of CloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName by calling from_dict on the json representation
+ cloud_object_storage_bucket_identity_cloud_object_storage_bucket_identity_by_name_model_dict = CloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName.from_dict(cloud_object_storage_bucket_identity_cloud_object_storage_bucket_identity_by_name_model_json).__dict__
+ cloud_object_storage_bucket_identity_cloud_object_storage_bucket_identity_by_name_model2 = CloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName(**cloud_object_storage_bucket_identity_cloud_object_storage_bucket_identity_by_name_model_dict)
# Verify the model instances are equivalent
- assert volume_attachment_reference_volume_context_model == volume_attachment_reference_volume_context_model2
+ assert cloud_object_storage_bucket_identity_cloud_object_storage_bucket_identity_by_name_model == cloud_object_storage_bucket_identity_cloud_object_storage_bucket_identity_by_name_model2
# Convert model instance back to dict and verify no loss of data
- 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
+ cloud_object_storage_bucket_identity_cloud_object_storage_bucket_identity_by_name_model_json2 = cloud_object_storage_bucket_identity_cloud_object_storage_bucket_identity_by_name_model.to_dict()
+ assert cloud_object_storage_bucket_identity_cloud_object_storage_bucket_identity_by_name_model_json2 == cloud_object_storage_bucket_identity_cloud_object_storage_bucket_identity_by_name_model_json
-class TestModel_VolumeAttachmentReferenceVolumeContextDeleted:
+class TestModel_DNSInstanceIdentityByCRN:
"""
- Test Class for VolumeAttachmentReferenceVolumeContextDeleted
+ Test Class for DNSInstanceIdentityByCRN
"""
- def test_volume_attachment_reference_volume_context_deleted_serialization(self):
+ def test_dns_instance_identity_by_crn_serialization(self):
"""
- Test serialization/deserialization for VolumeAttachmentReferenceVolumeContextDeleted
+ Test serialization/deserialization for DNSInstanceIdentityByCRN
"""
- # 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 DNSInstanceIdentityByCRN model
+ dns_instance_identity_by_crn_model_json = {}
+ dns_instance_identity_by_crn_model_json['crn'] = 'crn:v1:bluemix:public:dns-svcs:global:a/123456:6860c359-b2e2-46fa-a944-b38c28201c6e'
- # 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 DNSInstanceIdentityByCRN by calling from_dict on the json representation
+ dns_instance_identity_by_crn_model = DNSInstanceIdentityByCRN.from_dict(dns_instance_identity_by_crn_model_json)
+ assert dns_instance_identity_by_crn_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 DNSInstanceIdentityByCRN by calling from_dict on the json representation
+ dns_instance_identity_by_crn_model_dict = DNSInstanceIdentityByCRN.from_dict(dns_instance_identity_by_crn_model_json).__dict__
+ dns_instance_identity_by_crn_model2 = DNSInstanceIdentityByCRN(**dns_instance_identity_by_crn_model_dict)
# Verify the model instances are equivalent
- assert volume_attachment_reference_volume_context_deleted_model == volume_attachment_reference_volume_context_deleted_model2
+ assert dns_instance_identity_by_crn_model == dns_instance_identity_by_crn_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
+ dns_instance_identity_by_crn_model_json2 = dns_instance_identity_by_crn_model.to_dict()
+ assert dns_instance_identity_by_crn_model_json2 == dns_instance_identity_by_crn_model_json
-class TestModel_VolumeCollection:
+class TestModel_DNSZoneIdentityById:
"""
- Test Class for VolumeCollection
+ Test Class for DNSZoneIdentityById
"""
- def test_volume_collection_serialization(self):
+ def test_dns_zone_identity_by_id_serialization(self):
"""
- Test serialization/deserialization for VolumeCollection
+ Test serialization/deserialization for DNSZoneIdentityById
"""
- # Construct dict forms of any model objects needed in order to build this model.
+ # Construct a json representation of a DNSZoneIdentityById model
+ dns_zone_identity_by_id_model_json = {}
+ dns_zone_identity_by_id_model_json['id'] = 'd66662cc-aa23-4fe1-9987-858487a61f45'
- 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 DNSZoneIdentityById by calling from_dict on the json representation
+ dns_zone_identity_by_id_model = DNSZoneIdentityById.from_dict(dns_zone_identity_by_id_model_json)
+ assert dns_zone_identity_by_id_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 DNSZoneIdentityById by calling from_dict on the json representation
+ dns_zone_identity_by_id_model_dict = DNSZoneIdentityById.from_dict(dns_zone_identity_by_id_model_json).__dict__
+ dns_zone_identity_by_id_model2 = DNSZoneIdentityById(**dns_zone_identity_by_id_model_dict)
- encryption_key_reference_model = {} # EncryptionKeyReference
- encryption_key_reference_model['crn'] = 'crn:v1:bluemix:public:kms:us-south:a/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179'
+ # Verify the model instances are equivalent
+ assert dns_zone_identity_by_id_model == dns_zone_identity_by_id_model2
- volume_health_reason_model = {} # VolumeHealthReason
- volume_health_reason_model['code'] = 'initializing_from_snapshot'
- volume_health_reason_model['message'] = 'Performance will be degraded while this volume is being initialized from its snapshot'
- volume_health_reason_model['more_info'] = 'https://cloud.ibm.com/docs/vpc?topic=vpc-snapshots-vpc-troubleshooting&interface=ui#snapshot_ts_degraded_perf'
+ # Convert model instance back to dict and verify no loss of data
+ dns_zone_identity_by_id_model_json2 = dns_zone_identity_by_id_model.to_dict()
+ assert dns_zone_identity_by_id_model_json2 == dns_zone_identity_by_id_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'
- 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_DedicatedHostGroupIdentityByCRN:
+ """
+ Test Class for DedicatedHostGroupIdentityByCRN
+ """
- 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_dedicated_host_group_identity_by_crn_serialization(self):
+ """
+ Test serialization/deserialization for DedicatedHostGroupIdentityByCRN
+ """
- 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 DedicatedHostGroupIdentityByCRN model
+ dedicated_host_group_identity_by_crn_model_json = {}
+ 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'
- account_reference_model = {} # AccountReference
- account_reference_model['id'] = 'aa2432b1fa4d4ace891e9b80fc104e34'
- account_reference_model['resource_type'] = 'account'
+ # Construct a model instance of DedicatedHostGroupIdentityByCRN by calling from_dict on the json representation
+ dedicated_host_group_identity_by_crn_model = DedicatedHostGroupIdentityByCRN.from_dict(dedicated_host_group_identity_by_crn_model_json)
+ assert dedicated_host_group_identity_by_crn_model != False
- 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 model instance of DedicatedHostGroupIdentityByCRN by calling from_dict on the json representation
+ dedicated_host_group_identity_by_crn_model_dict = DedicatedHostGroupIdentityByCRN.from_dict(dedicated_host_group_identity_by_crn_model_json).__dict__
+ dedicated_host_group_identity_by_crn_model2 = DedicatedHostGroupIdentityByCRN(**dedicated_host_group_identity_by_crn_model_dict)
- image_remote_model = {} # ImageRemote
- image_remote_model['account'] = account_reference_model
- image_remote_model['region'] = region_reference_model
+ # Verify the model instances are equivalent
+ assert dedicated_host_group_identity_by_crn_model == dedicated_host_group_identity_by_crn_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'
- image_reference_model['remote'] = image_remote_model
- image_reference_model['resource_type'] = 'image'
+ # Convert model instance back to dict and verify no loss of data
+ dedicated_host_group_identity_by_crn_model_json2 = dedicated_host_group_identity_by_crn_model.to_dict()
+ assert dedicated_host_group_identity_by_crn_model_json2 == dedicated_host_group_identity_by_crn_model_json
- snapshot_reference_deleted_model = {} # SnapshotReferenceDeleted
- snapshot_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- snapshot_remote_model = {} # SnapshotRemote
- snapshot_remote_model['region'] = region_reference_model
+class TestModel_DedicatedHostGroupIdentityByHref:
+ """
+ Test Class for DedicatedHostGroupIdentityByHref
+ """
- 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['remote'] = snapshot_remote_model
- snapshot_reference_model['resource_type'] = 'snapshot'
+ def test_dedicated_host_group_identity_by_href_serialization(self):
+ """
+ Test serialization/deserialization for DedicatedHostGroupIdentityByHref
+ """
- 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 json representation of a DedicatedHostGroupIdentityByHref model
+ dedicated_host_group_identity_by_href_model_json = {}
+ 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'
- 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 DedicatedHostGroupIdentityByHref by calling from_dict on the json representation
+ dedicated_host_group_identity_by_href_model = DedicatedHostGroupIdentityByHref.from_dict(dedicated_host_group_identity_by_href_model_json)
+ assert dedicated_host_group_identity_by_href_model != False
- volume_attachment_device_model = {} # VolumeAttachmentDevice
- volume_attachment_device_model['id'] = '80b3e36e-41f4-40e9-bd56-beae81792a68'
+ # Construct a model instance of DedicatedHostGroupIdentityByHref by calling from_dict on the json representation
+ dedicated_host_group_identity_by_href_model_dict = DedicatedHostGroupIdentityByHref.from_dict(dedicated_host_group_identity_by_href_model_json).__dict__
+ dedicated_host_group_identity_by_href_model2 = DedicatedHostGroupIdentityByHref(**dedicated_host_group_identity_by_href_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 dedicated_host_group_identity_by_href_model == dedicated_host_group_identity_by_href_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
+ dedicated_host_group_identity_by_href_model_json2 = dedicated_host_group_identity_by_href_model.to_dict()
+ assert dedicated_host_group_identity_by_href_model_json2 == dedicated_host_group_identity_by_href_model_json
- 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'
- 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_DedicatedHostGroupIdentityById:
+ """
+ Test Class for DedicatedHostGroupIdentityById
+ """
- volume_model = {} # Volume
- volume_model['active'] = True
- volume_model['attachment_state'] = 'attached'
- 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['health_reasons'] = [volume_health_reason_model]
- volume_model['health_state'] = 'ok'
- volume_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
- volume_model['id'] = '1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
- volume_model['iops'] = 10000
- volume_model['name'] = 'my-volume'
- volume_model['operating_system'] = operating_system_model
- volume_model['profile'] = volume_profile_reference_model
- volume_model['resource_group'] = resource_group_reference_model
- volume_model['resource_type'] = 'volume'
- 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['user_tags'] = ['testString']
- volume_model['volume_attachments'] = [volume_attachment_reference_volume_context_model]
- volume_model['zone'] = zone_reference_model
+ def test_dedicated_host_group_identity_by_id_serialization(self):
+ """
+ Test serialization/deserialization for DedicatedHostGroupIdentityById
+ """
- # 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['total_count'] = 132
- volume_collection_model_json['volumes'] = [volume_model]
+ # Construct a json representation of a DedicatedHostGroupIdentityById model
+ dedicated_host_group_identity_by_id_model_json = {}
+ dedicated_host_group_identity_by_id_model_json['id'] = 'bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0'
- # 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 DedicatedHostGroupIdentityById by calling from_dict on the json representation
+ dedicated_host_group_identity_by_id_model = DedicatedHostGroupIdentityById.from_dict(dedicated_host_group_identity_by_id_model_json)
+ assert dedicated_host_group_identity_by_id_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)
+ # Construct a model instance of DedicatedHostGroupIdentityById by calling from_dict on the json representation
+ dedicated_host_group_identity_by_id_model_dict = DedicatedHostGroupIdentityById.from_dict(dedicated_host_group_identity_by_id_model_json).__dict__
+ dedicated_host_group_identity_by_id_model2 = DedicatedHostGroupIdentityById(**dedicated_host_group_identity_by_id_model_dict)
# Verify the model instances are equivalent
- assert volume_collection_model == volume_collection_model2
+ assert dedicated_host_group_identity_by_id_model == dedicated_host_group_identity_by_id_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
+ dedicated_host_group_identity_by_id_model_json2 = dedicated_host_group_identity_by_id_model.to_dict()
+ assert dedicated_host_group_identity_by_id_model_json2 == dedicated_host_group_identity_by_id_model_json
-class TestModel_VolumeCollectionFirst:
+class TestModel_DedicatedHostProfileIdentityByHref:
"""
- Test Class for VolumeCollectionFirst
+ Test Class for DedicatedHostProfileIdentityByHref
"""
- def test_volume_collection_first_serialization(self):
+ def test_dedicated_host_profile_identity_by_href_serialization(self):
"""
- Test serialization/deserialization for VolumeCollectionFirst
+ Test serialization/deserialization for DedicatedHostProfileIdentityByHref
"""
- # 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 DedicatedHostProfileIdentityByHref model
+ dedicated_host_profile_identity_by_href_model_json = {}
+ dedicated_host_profile_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/profiles/mx2-host-152x1216'
- # 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 DedicatedHostProfileIdentityByHref by calling from_dict on the json representation
+ dedicated_host_profile_identity_by_href_model = DedicatedHostProfileIdentityByHref.from_dict(dedicated_host_profile_identity_by_href_model_json)
+ assert dedicated_host_profile_identity_by_href_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 DedicatedHostProfileIdentityByHref by calling from_dict on the json representation
+ dedicated_host_profile_identity_by_href_model_dict = DedicatedHostProfileIdentityByHref.from_dict(dedicated_host_profile_identity_by_href_model_json).__dict__
+ dedicated_host_profile_identity_by_href_model2 = DedicatedHostProfileIdentityByHref(**dedicated_host_profile_identity_by_href_model_dict)
# Verify the model instances are equivalent
- assert volume_collection_first_model == volume_collection_first_model2
+ assert dedicated_host_profile_identity_by_href_model == dedicated_host_profile_identity_by_href_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
+ dedicated_host_profile_identity_by_href_model_json2 = dedicated_host_profile_identity_by_href_model.to_dict()
+ assert dedicated_host_profile_identity_by_href_model_json2 == dedicated_host_profile_identity_by_href_model_json
-class TestModel_VolumeCollectionNext:
+class TestModel_DedicatedHostProfileIdentityByName:
"""
- Test Class for VolumeCollectionNext
+ Test Class for DedicatedHostProfileIdentityByName
"""
- def test_volume_collection_next_serialization(self):
+ def test_dedicated_host_profile_identity_by_name_serialization(self):
"""
- Test serialization/deserialization for VolumeCollectionNext
+ Test serialization/deserialization for DedicatedHostProfileIdentityByName
"""
- # 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 DedicatedHostProfileIdentityByName model
+ dedicated_host_profile_identity_by_name_model_json = {}
+ dedicated_host_profile_identity_by_name_model_json['name'] = 'mx2-host-152x1216'
- # 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 DedicatedHostProfileIdentityByName by calling from_dict on the json representation
+ dedicated_host_profile_identity_by_name_model = DedicatedHostProfileIdentityByName.from_dict(dedicated_host_profile_identity_by_name_model_json)
+ assert dedicated_host_profile_identity_by_name_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 DedicatedHostProfileIdentityByName by calling from_dict on the json representation
+ dedicated_host_profile_identity_by_name_model_dict = DedicatedHostProfileIdentityByName.from_dict(dedicated_host_profile_identity_by_name_model_json).__dict__
+ dedicated_host_profile_identity_by_name_model2 = DedicatedHostProfileIdentityByName(**dedicated_host_profile_identity_by_name_model_dict)
# Verify the model instances are equivalent
- assert volume_collection_next_model == volume_collection_next_model2
+ assert dedicated_host_profile_identity_by_name_model == dedicated_host_profile_identity_by_name_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
+ dedicated_host_profile_identity_by_name_model_json2 = dedicated_host_profile_identity_by_name_model.to_dict()
+ assert dedicated_host_profile_identity_by_name_model_json2 == dedicated_host_profile_identity_by_name_model_json
-class TestModel_VolumeHealthReason:
+class TestModel_DedicatedHostProfileMemoryDependent:
"""
- Test Class for VolumeHealthReason
+ Test Class for DedicatedHostProfileMemoryDependent
"""
- def test_volume_health_reason_serialization(self):
+ def test_dedicated_host_profile_memory_dependent_serialization(self):
"""
- Test serialization/deserialization for VolumeHealthReason
+ Test serialization/deserialization for DedicatedHostProfileMemoryDependent
"""
- # Construct a json representation of a VolumeHealthReason model
- volume_health_reason_model_json = {}
- volume_health_reason_model_json['code'] = 'initializing_from_snapshot'
- volume_health_reason_model_json['message'] = 'Performance will be degraded while this volume is being initialized from its snapshot'
- volume_health_reason_model_json['more_info'] = 'https://cloud.ibm.com/docs/vpc?topic=vpc-snapshots-vpc-troubleshooting&interface=ui#snapshot_ts_degraded_perf'
+ # Construct a json representation of a DedicatedHostProfileMemoryDependent model
+ dedicated_host_profile_memory_dependent_model_json = {}
+ dedicated_host_profile_memory_dependent_model_json['type'] = 'dependent'
- # Construct a model instance of VolumeHealthReason by calling from_dict on the json representation
- volume_health_reason_model = VolumeHealthReason.from_dict(volume_health_reason_model_json)
- assert volume_health_reason_model != False
+ # Construct a model instance of DedicatedHostProfileMemoryDependent by calling from_dict on the json representation
+ dedicated_host_profile_memory_dependent_model = DedicatedHostProfileMemoryDependent.from_dict(dedicated_host_profile_memory_dependent_model_json)
+ assert dedicated_host_profile_memory_dependent_model != False
- # Construct a model instance of VolumeHealthReason by calling from_dict on the json representation
- volume_health_reason_model_dict = VolumeHealthReason.from_dict(volume_health_reason_model_json).__dict__
- volume_health_reason_model2 = VolumeHealthReason(**volume_health_reason_model_dict)
+ # Construct a model instance of DedicatedHostProfileMemoryDependent by calling from_dict on the json representation
+ dedicated_host_profile_memory_dependent_model_dict = DedicatedHostProfileMemoryDependent.from_dict(dedicated_host_profile_memory_dependent_model_json).__dict__
+ dedicated_host_profile_memory_dependent_model2 = DedicatedHostProfileMemoryDependent(**dedicated_host_profile_memory_dependent_model_dict)
# Verify the model instances are equivalent
- assert volume_health_reason_model == volume_health_reason_model2
+ assert dedicated_host_profile_memory_dependent_model == dedicated_host_profile_memory_dependent_model2
# Convert model instance back to dict and verify no loss of data
- volume_health_reason_model_json2 = volume_health_reason_model.to_dict()
- assert volume_health_reason_model_json2 == volume_health_reason_model_json
+ dedicated_host_profile_memory_dependent_model_json2 = dedicated_host_profile_memory_dependent_model.to_dict()
+ assert dedicated_host_profile_memory_dependent_model_json2 == dedicated_host_profile_memory_dependent_model_json
-class TestModel_VolumePatch:
+class TestModel_DedicatedHostProfileMemoryEnum:
"""
- Test Class for VolumePatch
+ Test Class for DedicatedHostProfileMemoryEnum
"""
- def test_volume_patch_serialization(self):
+ def test_dedicated_host_profile_memory_enum_serialization(self):
"""
- Test serialization/deserialization for VolumePatch
+ Test serialization/deserialization for DedicatedHostProfileMemoryEnum
"""
- # 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
- volume_patch_model_json['user_tags'] = ['testString']
+ # Construct a json representation of a DedicatedHostProfileMemoryEnum model
+ dedicated_host_profile_memory_enum_model_json = {}
+ dedicated_host_profile_memory_enum_model_json['default'] = 38
+ dedicated_host_profile_memory_enum_model_json['type'] = 'enum'
+ dedicated_host_profile_memory_enum_model_json['values'] = [8, 16, 32]
- # 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 DedicatedHostProfileMemoryEnum by calling from_dict on the json representation
+ dedicated_host_profile_memory_enum_model = DedicatedHostProfileMemoryEnum.from_dict(dedicated_host_profile_memory_enum_model_json)
+ assert dedicated_host_profile_memory_enum_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 DedicatedHostProfileMemoryEnum by calling from_dict on the json representation
+ dedicated_host_profile_memory_enum_model_dict = DedicatedHostProfileMemoryEnum.from_dict(dedicated_host_profile_memory_enum_model_json).__dict__
+ dedicated_host_profile_memory_enum_model2 = DedicatedHostProfileMemoryEnum(**dedicated_host_profile_memory_enum_model_dict)
# Verify the model instances are equivalent
- assert volume_patch_model == volume_patch_model2
+ assert dedicated_host_profile_memory_enum_model == dedicated_host_profile_memory_enum_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
+ dedicated_host_profile_memory_enum_model_json2 = dedicated_host_profile_memory_enum_model.to_dict()
+ assert dedicated_host_profile_memory_enum_model_json2 == dedicated_host_profile_memory_enum_model_json
-class TestModel_VolumeProfile:
+class TestModel_DedicatedHostProfileMemoryFixed:
"""
- Test Class for VolumeProfile
+ Test Class for DedicatedHostProfileMemoryFixed
"""
- def test_volume_profile_serialization(self):
+ def test_dedicated_host_profile_memory_fixed_serialization(self):
"""
- Test serialization/deserialization for VolumeProfile
+ Test serialization/deserialization for DedicatedHostProfileMemoryFixed
"""
- # 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 DedicatedHostProfileMemoryFixed model
+ dedicated_host_profile_memory_fixed_model_json = {}
+ dedicated_host_profile_memory_fixed_model_json['type'] = 'fixed'
+ dedicated_host_profile_memory_fixed_model_json['value'] = 16
- # 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 DedicatedHostProfileMemoryFixed by calling from_dict on the json representation
+ dedicated_host_profile_memory_fixed_model = DedicatedHostProfileMemoryFixed.from_dict(dedicated_host_profile_memory_fixed_model_json)
+ assert dedicated_host_profile_memory_fixed_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 DedicatedHostProfileMemoryFixed by calling from_dict on the json representation
+ dedicated_host_profile_memory_fixed_model_dict = DedicatedHostProfileMemoryFixed.from_dict(dedicated_host_profile_memory_fixed_model_json).__dict__
+ dedicated_host_profile_memory_fixed_model2 = DedicatedHostProfileMemoryFixed(**dedicated_host_profile_memory_fixed_model_dict)
# Verify the model instances are equivalent
- assert volume_profile_model == volume_profile_model2
+ assert dedicated_host_profile_memory_fixed_model == dedicated_host_profile_memory_fixed_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
+ dedicated_host_profile_memory_fixed_model_json2 = dedicated_host_profile_memory_fixed_model.to_dict()
+ assert dedicated_host_profile_memory_fixed_model_json2 == dedicated_host_profile_memory_fixed_model_json
-class TestModel_VolumeProfileCollection:
+class TestModel_DedicatedHostProfileMemoryRange:
"""
- Test Class for VolumeProfileCollection
+ Test Class for DedicatedHostProfileMemoryRange
"""
- def test_volume_profile_collection_serialization(self):
+ def test_dedicated_host_profile_memory_range_serialization(self):
"""
- Test serialization/deserialization for VolumeProfileCollection
+ Test serialization/deserialization for DedicatedHostProfileMemoryRange
"""
- # Construct dict forms of any model objects needed in order to build this model.
-
- volume_profile_collection_first_model = {} # VolumeProfileCollectionFirst
- volume_profile_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volume/profiles?limit=20'
-
- 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 json representation of a DedicatedHostProfileMemoryRange model
+ dedicated_host_profile_memory_range_model_json = {}
+ dedicated_host_profile_memory_range_model_json['default'] = 16
+ dedicated_host_profile_memory_range_model_json['max'] = 384
+ dedicated_host_profile_memory_range_model_json['min'] = 8
+ dedicated_host_profile_memory_range_model_json['step'] = 8
+ dedicated_host_profile_memory_range_model_json['type'] = 'range'
- # 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 DedicatedHostProfileMemoryRange by calling from_dict on the json representation
+ dedicated_host_profile_memory_range_model = DedicatedHostProfileMemoryRange.from_dict(dedicated_host_profile_memory_range_model_json)
+ assert dedicated_host_profile_memory_range_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)
+ # Construct a model instance of DedicatedHostProfileMemoryRange by calling from_dict on the json representation
+ dedicated_host_profile_memory_range_model_dict = DedicatedHostProfileMemoryRange.from_dict(dedicated_host_profile_memory_range_model_json).__dict__
+ dedicated_host_profile_memory_range_model2 = DedicatedHostProfileMemoryRange(**dedicated_host_profile_memory_range_model_dict)
# Verify the model instances are equivalent
- assert volume_profile_collection_model == volume_profile_collection_model2
+ assert dedicated_host_profile_memory_range_model == dedicated_host_profile_memory_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
+ dedicated_host_profile_memory_range_model_json2 = dedicated_host_profile_memory_range_model.to_dict()
+ assert dedicated_host_profile_memory_range_model_json2 == dedicated_host_profile_memory_range_model_json
-class TestModel_VolumeProfileCollectionFirst:
+class TestModel_DedicatedHostProfileSocketDependent:
"""
- Test Class for VolumeProfileCollectionFirst
+ Test Class for DedicatedHostProfileSocketDependent
"""
- def test_volume_profile_collection_first_serialization(self):
+ def test_dedicated_host_profile_socket_dependent_serialization(self):
"""
- Test serialization/deserialization for VolumeProfileCollectionFirst
+ Test serialization/deserialization for DedicatedHostProfileSocketDependent
"""
- # 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 DedicatedHostProfileSocketDependent model
+ dedicated_host_profile_socket_dependent_model_json = {}
+ dedicated_host_profile_socket_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 DedicatedHostProfileSocketDependent by calling from_dict on the json representation
+ dedicated_host_profile_socket_dependent_model = DedicatedHostProfileSocketDependent.from_dict(dedicated_host_profile_socket_dependent_model_json)
+ assert dedicated_host_profile_socket_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 DedicatedHostProfileSocketDependent by calling from_dict on the json representation
+ dedicated_host_profile_socket_dependent_model_dict = DedicatedHostProfileSocketDependent.from_dict(dedicated_host_profile_socket_dependent_model_json).__dict__
+ dedicated_host_profile_socket_dependent_model2 = DedicatedHostProfileSocketDependent(**dedicated_host_profile_socket_dependent_model_dict)
# Verify the model instances are equivalent
- assert volume_profile_collection_first_model == volume_profile_collection_first_model2
+ assert dedicated_host_profile_socket_dependent_model == dedicated_host_profile_socket_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
+ dedicated_host_profile_socket_dependent_model_json2 = dedicated_host_profile_socket_dependent_model.to_dict()
+ assert dedicated_host_profile_socket_dependent_model_json2 == dedicated_host_profile_socket_dependent_model_json
-class TestModel_VolumeProfileCollectionNext:
+class TestModel_DedicatedHostProfileSocketEnum:
"""
- Test Class for VolumeProfileCollectionNext
+ Test Class for DedicatedHostProfileSocketEnum
"""
- def test_volume_profile_collection_next_serialization(self):
+ def test_dedicated_host_profile_socket_enum_serialization(self):
"""
- Test serialization/deserialization for VolumeProfileCollectionNext
+ Test serialization/deserialization for DedicatedHostProfileSocketEnum
"""
- # 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 DedicatedHostProfileSocketEnum model
+ dedicated_host_profile_socket_enum_model_json = {}
+ dedicated_host_profile_socket_enum_model_json['default'] = 38
+ dedicated_host_profile_socket_enum_model_json['type'] = 'enum'
+ dedicated_host_profile_socket_enum_model_json['values'] = [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 DedicatedHostProfileSocketEnum by calling from_dict on the json representation
+ dedicated_host_profile_socket_enum_model = DedicatedHostProfileSocketEnum.from_dict(dedicated_host_profile_socket_enum_model_json)
+ assert dedicated_host_profile_socket_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 DedicatedHostProfileSocketEnum by calling from_dict on the json representation
+ dedicated_host_profile_socket_enum_model_dict = DedicatedHostProfileSocketEnum.from_dict(dedicated_host_profile_socket_enum_model_json).__dict__
+ dedicated_host_profile_socket_enum_model2 = DedicatedHostProfileSocketEnum(**dedicated_host_profile_socket_enum_model_dict)
# Verify the model instances are equivalent
- assert volume_profile_collection_next_model == volume_profile_collection_next_model2
+ assert dedicated_host_profile_socket_enum_model == dedicated_host_profile_socket_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
+ dedicated_host_profile_socket_enum_model_json2 = dedicated_host_profile_socket_enum_model.to_dict()
+ assert dedicated_host_profile_socket_enum_model_json2 == dedicated_host_profile_socket_enum_model_json
-class TestModel_VolumeProfileReference:
+class TestModel_DedicatedHostProfileSocketFixed:
"""
- Test Class for VolumeProfileReference
+ Test Class for DedicatedHostProfileSocketFixed
"""
- def test_volume_profile_reference_serialization(self):
+ def test_dedicated_host_profile_socket_fixed_serialization(self):
"""
- Test serialization/deserialization for VolumeProfileReference
+ Test serialization/deserialization for DedicatedHostProfileSocketFixed
"""
- # 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 DedicatedHostProfileSocketFixed model
+ dedicated_host_profile_socket_fixed_model_json = {}
+ dedicated_host_profile_socket_fixed_model_json['type'] = 'fixed'
+ dedicated_host_profile_socket_fixed_model_json['value'] = 2
- # 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 DedicatedHostProfileSocketFixed by calling from_dict on the json representation
+ dedicated_host_profile_socket_fixed_model = DedicatedHostProfileSocketFixed.from_dict(dedicated_host_profile_socket_fixed_model_json)
+ assert dedicated_host_profile_socket_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 DedicatedHostProfileSocketFixed by calling from_dict on the json representation
+ dedicated_host_profile_socket_fixed_model_dict = DedicatedHostProfileSocketFixed.from_dict(dedicated_host_profile_socket_fixed_model_json).__dict__
+ dedicated_host_profile_socket_fixed_model2 = DedicatedHostProfileSocketFixed(**dedicated_host_profile_socket_fixed_model_dict)
# Verify the model instances are equivalent
- assert volume_profile_reference_model == volume_profile_reference_model2
+ assert dedicated_host_profile_socket_fixed_model == dedicated_host_profile_socket_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
+ dedicated_host_profile_socket_fixed_model_json2 = dedicated_host_profile_socket_fixed_model.to_dict()
+ assert dedicated_host_profile_socket_fixed_model_json2 == dedicated_host_profile_socket_fixed_model_json
-class TestModel_VolumePrototypeInstanceByImageContext:
+class TestModel_DedicatedHostProfileSocketRange:
"""
- Test Class for VolumePrototypeInstanceByImageContext
+ Test Class for DedicatedHostProfileSocketRange
"""
- def test_volume_prototype_instance_by_image_context_serialization(self):
+ def test_dedicated_host_profile_socket_range_serialization(self):
"""
- Test serialization/deserialization for VolumePrototypeInstanceByImageContext
+ Test serialization/deserialization for DedicatedHostProfileSocketRange
"""
- # 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/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179'
-
- volume_profile_identity_model = {} # VolumeProfileIdentityByName
- volume_profile_identity_model['name'] = 'general-purpose'
-
- resource_group_identity_model = {} # ResourceGroupIdentityById
- resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
-
- # 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'] = 100
- 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
- volume_prototype_instance_by_image_context_model_json['resource_group'] = resource_group_identity_model
- volume_prototype_instance_by_image_context_model_json['user_tags'] = []
+ # Construct a json representation of a DedicatedHostProfileSocketRange model
+ dedicated_host_profile_socket_range_model_json = {}
+ dedicated_host_profile_socket_range_model_json['default'] = 2
+ dedicated_host_profile_socket_range_model_json['max'] = 4
+ dedicated_host_profile_socket_range_model_json['min'] = 1
+ dedicated_host_profile_socket_range_model_json['step'] = 1
+ dedicated_host_profile_socket_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 DedicatedHostProfileSocketRange by calling from_dict on the json representation
+ dedicated_host_profile_socket_range_model = DedicatedHostProfileSocketRange.from_dict(dedicated_host_profile_socket_range_model_json)
+ assert dedicated_host_profile_socket_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 DedicatedHostProfileSocketRange by calling from_dict on the json representation
+ dedicated_host_profile_socket_range_model_dict = DedicatedHostProfileSocketRange.from_dict(dedicated_host_profile_socket_range_model_json).__dict__
+ dedicated_host_profile_socket_range_model2 = DedicatedHostProfileSocketRange(**dedicated_host_profile_socket_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 dedicated_host_profile_socket_range_model == dedicated_host_profile_socket_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
+ dedicated_host_profile_socket_range_model_json2 = dedicated_host_profile_socket_range_model.to_dict()
+ assert dedicated_host_profile_socket_range_model_json2 == dedicated_host_profile_socket_range_model_json
-class TestModel_VolumePrototypeInstanceBySourceSnapshotContext:
+class TestModel_DedicatedHostProfileVCPUDependent:
"""
- Test Class for VolumePrototypeInstanceBySourceSnapshotContext
+ Test Class for DedicatedHostProfileVCPUDependent
"""
- def test_volume_prototype_instance_by_source_snapshot_context_serialization(self):
+ def test_dedicated_host_profile_vcpu_dependent_serialization(self):
"""
- Test serialization/deserialization for VolumePrototypeInstanceBySourceSnapshotContext
+ Test serialization/deserialization for DedicatedHostProfileVCPUDependent
"""
- # 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/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179'
-
- volume_profile_identity_model = {} # VolumeProfileIdentityByName
- volume_profile_identity_model['name'] = 'general-purpose'
-
- resource_group_identity_model = {} # ResourceGroupIdentityById
- resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
-
- snapshot_identity_model = {} # SnapshotIdentityById
- snapshot_identity_model['id'] = '349a61d8-7ab1-420f-a690-5fed76ef9d4f'
-
- # Construct a json representation of a VolumePrototypeInstanceBySourceSnapshotContext model
- volume_prototype_instance_by_source_snapshot_context_model_json = {}
- volume_prototype_instance_by_source_snapshot_context_model_json['capacity'] = 100
- volume_prototype_instance_by_source_snapshot_context_model_json['encryption_key'] = encryption_key_identity_model
- volume_prototype_instance_by_source_snapshot_context_model_json['iops'] = 10000
- volume_prototype_instance_by_source_snapshot_context_model_json['name'] = 'my-volume'
- volume_prototype_instance_by_source_snapshot_context_model_json['profile'] = volume_profile_identity_model
- volume_prototype_instance_by_source_snapshot_context_model_json['resource_group'] = resource_group_identity_model
- volume_prototype_instance_by_source_snapshot_context_model_json['source_snapshot'] = snapshot_identity_model
- volume_prototype_instance_by_source_snapshot_context_model_json['user_tags'] = []
+ # Construct a json representation of a DedicatedHostProfileVCPUDependent model
+ dedicated_host_profile_vcpu_dependent_model_json = {}
+ dedicated_host_profile_vcpu_dependent_model_json['type'] = 'dependent'
- # Construct a model instance of VolumePrototypeInstanceBySourceSnapshotContext by calling from_dict on the json representation
- volume_prototype_instance_by_source_snapshot_context_model = VolumePrototypeInstanceBySourceSnapshotContext.from_dict(volume_prototype_instance_by_source_snapshot_context_model_json)
- assert volume_prototype_instance_by_source_snapshot_context_model != False
+ # Construct a model instance of DedicatedHostProfileVCPUDependent by calling from_dict on the json representation
+ dedicated_host_profile_vcpu_dependent_model = DedicatedHostProfileVCPUDependent.from_dict(dedicated_host_profile_vcpu_dependent_model_json)
+ assert dedicated_host_profile_vcpu_dependent_model != False
- # Construct a model instance of VolumePrototypeInstanceBySourceSnapshotContext by calling from_dict on the json representation
- volume_prototype_instance_by_source_snapshot_context_model_dict = VolumePrototypeInstanceBySourceSnapshotContext.from_dict(volume_prototype_instance_by_source_snapshot_context_model_json).__dict__
- volume_prototype_instance_by_source_snapshot_context_model2 = VolumePrototypeInstanceBySourceSnapshotContext(**volume_prototype_instance_by_source_snapshot_context_model_dict)
+ # Construct a model instance of DedicatedHostProfileVCPUDependent by calling from_dict on the json representation
+ dedicated_host_profile_vcpu_dependent_model_dict = DedicatedHostProfileVCPUDependent.from_dict(dedicated_host_profile_vcpu_dependent_model_json).__dict__
+ dedicated_host_profile_vcpu_dependent_model2 = DedicatedHostProfileVCPUDependent(**dedicated_host_profile_vcpu_dependent_model_dict)
# Verify the model instances are equivalent
- assert volume_prototype_instance_by_source_snapshot_context_model == volume_prototype_instance_by_source_snapshot_context_model2
+ assert dedicated_host_profile_vcpu_dependent_model == dedicated_host_profile_vcpu_dependent_model2
# Convert model instance back to dict and verify no loss of data
- volume_prototype_instance_by_source_snapshot_context_model_json2 = volume_prototype_instance_by_source_snapshot_context_model.to_dict()
- assert volume_prototype_instance_by_source_snapshot_context_model_json2 == volume_prototype_instance_by_source_snapshot_context_model_json
+ dedicated_host_profile_vcpu_dependent_model_json2 = dedicated_host_profile_vcpu_dependent_model.to_dict()
+ assert dedicated_host_profile_vcpu_dependent_model_json2 == dedicated_host_profile_vcpu_dependent_model_json
-class TestModel_VolumeReference:
+class TestModel_DedicatedHostProfileVCPUEnum:
"""
- Test Class for VolumeReference
+ Test Class for DedicatedHostProfileVCPUEnum
"""
- def test_volume_reference_serialization(self):
+ def test_dedicated_host_profile_vcpu_enum_serialization(self):
"""
- Test serialization/deserialization for VolumeReference
+ Test serialization/deserialization for DedicatedHostProfileVCPUEnum
"""
- # 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'
-
- 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_remote_model = {} # VolumeRemote
- volume_remote_model['region'] = region_reference_model
-
- # 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'
- volume_reference_model_json['remote'] = volume_remote_model
- volume_reference_model_json['resource_type'] = 'volume'
+ # Construct a json representation of a DedicatedHostProfileVCPUEnum model
+ dedicated_host_profile_vcpu_enum_model_json = {}
+ dedicated_host_profile_vcpu_enum_model_json['default'] = 38
+ dedicated_host_profile_vcpu_enum_model_json['type'] = 'enum'
+ dedicated_host_profile_vcpu_enum_model_json['values'] = [2, 4, 16]
- # 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 DedicatedHostProfileVCPUEnum by calling from_dict on the json representation
+ dedicated_host_profile_vcpu_enum_model = DedicatedHostProfileVCPUEnum.from_dict(dedicated_host_profile_vcpu_enum_model_json)
+ assert dedicated_host_profile_vcpu_enum_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 DedicatedHostProfileVCPUEnum by calling from_dict on the json representation
+ dedicated_host_profile_vcpu_enum_model_dict = DedicatedHostProfileVCPUEnum.from_dict(dedicated_host_profile_vcpu_enum_model_json).__dict__
+ dedicated_host_profile_vcpu_enum_model2 = DedicatedHostProfileVCPUEnum(**dedicated_host_profile_vcpu_enum_model_dict)
# Verify the model instances are equivalent
- assert volume_reference_model == volume_reference_model2
+ assert dedicated_host_profile_vcpu_enum_model == dedicated_host_profile_vcpu_enum_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
+ dedicated_host_profile_vcpu_enum_model_json2 = dedicated_host_profile_vcpu_enum_model.to_dict()
+ assert dedicated_host_profile_vcpu_enum_model_json2 == dedicated_host_profile_vcpu_enum_model_json
-class TestModel_VolumeReferenceDeleted:
+class TestModel_DedicatedHostProfileVCPUFixed:
"""
- Test Class for VolumeReferenceDeleted
+ Test Class for DedicatedHostProfileVCPUFixed
"""
- def test_volume_reference_deleted_serialization(self):
+ def test_dedicated_host_profile_vcpu_fixed_serialization(self):
"""
- Test serialization/deserialization for VolumeReferenceDeleted
+ Test serialization/deserialization for DedicatedHostProfileVCPUFixed
"""
- # 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 DedicatedHostProfileVCPUFixed model
+ dedicated_host_profile_vcpu_fixed_model_json = {}
+ dedicated_host_profile_vcpu_fixed_model_json['type'] = 'fixed'
+ dedicated_host_profile_vcpu_fixed_model_json['value'] = 16
- # 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 DedicatedHostProfileVCPUFixed by calling from_dict on the json representation
+ dedicated_host_profile_vcpu_fixed_model = DedicatedHostProfileVCPUFixed.from_dict(dedicated_host_profile_vcpu_fixed_model_json)
+ assert dedicated_host_profile_vcpu_fixed_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 DedicatedHostProfileVCPUFixed by calling from_dict on the json representation
+ dedicated_host_profile_vcpu_fixed_model_dict = DedicatedHostProfileVCPUFixed.from_dict(dedicated_host_profile_vcpu_fixed_model_json).__dict__
+ dedicated_host_profile_vcpu_fixed_model2 = DedicatedHostProfileVCPUFixed(**dedicated_host_profile_vcpu_fixed_model_dict)
# Verify the model instances are equivalent
- assert volume_reference_deleted_model == volume_reference_deleted_model2
+ assert dedicated_host_profile_vcpu_fixed_model == dedicated_host_profile_vcpu_fixed_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
+ dedicated_host_profile_vcpu_fixed_model_json2 = dedicated_host_profile_vcpu_fixed_model.to_dict()
+ assert dedicated_host_profile_vcpu_fixed_model_json2 == dedicated_host_profile_vcpu_fixed_model_json
-class TestModel_VolumeReferenceVolumeAttachmentContext:
+class TestModel_DedicatedHostProfileVCPURange:
"""
- Test Class for VolumeReferenceVolumeAttachmentContext
+ Test Class for DedicatedHostProfileVCPURange
"""
- def test_volume_reference_volume_attachment_context_serialization(self):
+ def test_dedicated_host_profile_vcpu_range_serialization(self):
"""
- Test serialization/deserialization for VolumeReferenceVolumeAttachmentContext
+ Test serialization/deserialization for DedicatedHostProfileVCPURange
"""
- # Construct dict forms of any model objects needed in order to build this model.
-
- volume_reference_volume_attachment_context_deleted_model = {} # VolumeReferenceVolumeAttachmentContextDeleted
- volume_reference_volume_attachment_context_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
-
- # Construct a json representation of a VolumeReferenceVolumeAttachmentContext model
- volume_reference_volume_attachment_context_model_json = {}
- volume_reference_volume_attachment_context_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
- volume_reference_volume_attachment_context_model_json['deleted'] = volume_reference_volume_attachment_context_deleted_model
- volume_reference_volume_attachment_context_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
- volume_reference_volume_attachment_context_model_json['id'] = '1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
- volume_reference_volume_attachment_context_model_json['name'] = 'my-volume'
- volume_reference_volume_attachment_context_model_json['resource_type'] = 'volume'
+ # Construct a json representation of a DedicatedHostProfileVCPURange model
+ dedicated_host_profile_vcpu_range_model_json = {}
+ dedicated_host_profile_vcpu_range_model_json['default'] = 4
+ dedicated_host_profile_vcpu_range_model_json['max'] = 56
+ dedicated_host_profile_vcpu_range_model_json['min'] = 2
+ dedicated_host_profile_vcpu_range_model_json['step'] = 2
+ dedicated_host_profile_vcpu_range_model_json['type'] = 'range'
- # Construct a model instance of VolumeReferenceVolumeAttachmentContext by calling from_dict on the json representation
- volume_reference_volume_attachment_context_model = VolumeReferenceVolumeAttachmentContext.from_dict(volume_reference_volume_attachment_context_model_json)
- assert volume_reference_volume_attachment_context_model != False
+ # Construct a model instance of DedicatedHostProfileVCPURange by calling from_dict on the json representation
+ dedicated_host_profile_vcpu_range_model = DedicatedHostProfileVCPURange.from_dict(dedicated_host_profile_vcpu_range_model_json)
+ assert dedicated_host_profile_vcpu_range_model != False
- # Construct a model instance of VolumeReferenceVolumeAttachmentContext by calling from_dict on the json representation
- volume_reference_volume_attachment_context_model_dict = VolumeReferenceVolumeAttachmentContext.from_dict(volume_reference_volume_attachment_context_model_json).__dict__
- volume_reference_volume_attachment_context_model2 = VolumeReferenceVolumeAttachmentContext(**volume_reference_volume_attachment_context_model_dict)
+ # Construct a model instance of DedicatedHostProfileVCPURange by calling from_dict on the json representation
+ dedicated_host_profile_vcpu_range_model_dict = DedicatedHostProfileVCPURange.from_dict(dedicated_host_profile_vcpu_range_model_json).__dict__
+ dedicated_host_profile_vcpu_range_model2 = DedicatedHostProfileVCPURange(**dedicated_host_profile_vcpu_range_model_dict)
# Verify the model instances are equivalent
- assert volume_reference_volume_attachment_context_model == volume_reference_volume_attachment_context_model2
+ assert dedicated_host_profile_vcpu_range_model == dedicated_host_profile_vcpu_range_model2
# Convert model instance back to dict and verify no loss of data
- volume_reference_volume_attachment_context_model_json2 = volume_reference_volume_attachment_context_model.to_dict()
- assert volume_reference_volume_attachment_context_model_json2 == volume_reference_volume_attachment_context_model_json
+ dedicated_host_profile_vcpu_range_model_json2 = dedicated_host_profile_vcpu_range_model.to_dict()
+ assert dedicated_host_profile_vcpu_range_model_json2 == dedicated_host_profile_vcpu_range_model_json
-class TestModel_VolumeReferenceVolumeAttachmentContextDeleted:
+class TestModel_DedicatedHostPrototypeDedicatedHostByGroup:
"""
- Test Class for VolumeReferenceVolumeAttachmentContextDeleted
+ Test Class for DedicatedHostPrototypeDedicatedHostByGroup
"""
- def test_volume_reference_volume_attachment_context_deleted_serialization(self):
+ def test_dedicated_host_prototype_dedicated_host_by_group_serialization(self):
"""
- Test serialization/deserialization for VolumeReferenceVolumeAttachmentContextDeleted
+ Test serialization/deserialization for DedicatedHostPrototypeDedicatedHostByGroup
"""
- # Construct a json representation of a VolumeReferenceVolumeAttachmentContextDeleted model
- volume_reference_volume_attachment_context_deleted_model_json = {}
- volume_reference_volume_attachment_context_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 VolumeReferenceVolumeAttachmentContextDeleted by calling from_dict on the json representation
- volume_reference_volume_attachment_context_deleted_model = VolumeReferenceVolumeAttachmentContextDeleted.from_dict(volume_reference_volume_attachment_context_deleted_model_json)
- assert volume_reference_volume_attachment_context_deleted_model != False
+ dedicated_host_profile_identity_model = {} # DedicatedHostProfileIdentityByName
+ dedicated_host_profile_identity_model['name'] = 'mx2-host-152x1216'
- # Construct a model instance of VolumeReferenceVolumeAttachmentContextDeleted by calling from_dict on the json representation
- volume_reference_volume_attachment_context_deleted_model_dict = VolumeReferenceVolumeAttachmentContextDeleted.from_dict(volume_reference_volume_attachment_context_deleted_model_json).__dict__
- volume_reference_volume_attachment_context_deleted_model2 = VolumeReferenceVolumeAttachmentContextDeleted(**volume_reference_volume_attachment_context_deleted_model_dict)
+ resource_group_identity_model = {} # ResourceGroupIdentityById
+ resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
+
+ dedicated_host_group_identity_model = {} # DedicatedHostGroupIdentityById
+ dedicated_host_group_identity_model['id'] = 'bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0'
+
+ # Construct a json representation of a DedicatedHostPrototypeDedicatedHostByGroup model
+ dedicated_host_prototype_dedicated_host_by_group_model_json = {}
+ dedicated_host_prototype_dedicated_host_by_group_model_json['instance_placement_enabled'] = True
+ dedicated_host_prototype_dedicated_host_by_group_model_json['name'] = 'my-host'
+ dedicated_host_prototype_dedicated_host_by_group_model_json['profile'] = dedicated_host_profile_identity_model
+ dedicated_host_prototype_dedicated_host_by_group_model_json['resource_group'] = resource_group_identity_model
+ dedicated_host_prototype_dedicated_host_by_group_model_json['group'] = dedicated_host_group_identity_model
+
+ # Construct a model instance of DedicatedHostPrototypeDedicatedHostByGroup by calling from_dict on the json representation
+ dedicated_host_prototype_dedicated_host_by_group_model = DedicatedHostPrototypeDedicatedHostByGroup.from_dict(dedicated_host_prototype_dedicated_host_by_group_model_json)
+ assert dedicated_host_prototype_dedicated_host_by_group_model != False
+
+ # Construct a model instance of DedicatedHostPrototypeDedicatedHostByGroup by calling from_dict on the json representation
+ dedicated_host_prototype_dedicated_host_by_group_model_dict = DedicatedHostPrototypeDedicatedHostByGroup.from_dict(dedicated_host_prototype_dedicated_host_by_group_model_json).__dict__
+ dedicated_host_prototype_dedicated_host_by_group_model2 = DedicatedHostPrototypeDedicatedHostByGroup(**dedicated_host_prototype_dedicated_host_by_group_model_dict)
# Verify the model instances are equivalent
- assert volume_reference_volume_attachment_context_deleted_model == volume_reference_volume_attachment_context_deleted_model2
+ assert dedicated_host_prototype_dedicated_host_by_group_model == dedicated_host_prototype_dedicated_host_by_group_model2
# Convert model instance back to dict and verify no loss of data
- volume_reference_volume_attachment_context_deleted_model_json2 = volume_reference_volume_attachment_context_deleted_model.to_dict()
- assert volume_reference_volume_attachment_context_deleted_model_json2 == volume_reference_volume_attachment_context_deleted_model_json
+ dedicated_host_prototype_dedicated_host_by_group_model_json2 = dedicated_host_prototype_dedicated_host_by_group_model.to_dict()
+ assert dedicated_host_prototype_dedicated_host_by_group_model_json2 == dedicated_host_prototype_dedicated_host_by_group_model_json
-class TestModel_VolumeRemote:
+class TestModel_DedicatedHostPrototypeDedicatedHostByZone:
"""
- Test Class for VolumeRemote
+ Test Class for DedicatedHostPrototypeDedicatedHostByZone
"""
- def test_volume_remote_serialization(self):
+ def test_dedicated_host_prototype_dedicated_host_by_zone_serialization(self):
"""
- Test serialization/deserialization for VolumeRemote
+ Test serialization/deserialization for DedicatedHostPrototypeDedicatedHostByZone
"""
# 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'
+ dedicated_host_profile_identity_model = {} # DedicatedHostProfileIdentityByName
+ dedicated_host_profile_identity_model['name'] = 'mx2-host-152x1216'
- # Construct a json representation of a VolumeRemote model
- volume_remote_model_json = {}
- volume_remote_model_json['region'] = region_reference_model
+ resource_group_identity_model = {} # ResourceGroupIdentityById
+ resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
- # Construct a model instance of VolumeRemote by calling from_dict on the json representation
- volume_remote_model = VolumeRemote.from_dict(volume_remote_model_json)
- assert volume_remote_model != False
+ dedicated_host_group_prototype_dedicated_host_by_zone_context_model = {} # DedicatedHostGroupPrototypeDedicatedHostByZoneContext
+ dedicated_host_group_prototype_dedicated_host_by_zone_context_model['name'] = 'my-host-group'
+ dedicated_host_group_prototype_dedicated_host_by_zone_context_model['resource_group'] = resource_group_identity_model
- # Construct a model instance of VolumeRemote by calling from_dict on the json representation
- volume_remote_model_dict = VolumeRemote.from_dict(volume_remote_model_json).__dict__
- volume_remote_model2 = VolumeRemote(**volume_remote_model_dict)
+ zone_identity_model = {} # ZoneIdentityByName
+ zone_identity_model['name'] = 'us-south-1'
+
+ # Construct a json representation of a DedicatedHostPrototypeDedicatedHostByZone model
+ dedicated_host_prototype_dedicated_host_by_zone_model_json = {}
+ dedicated_host_prototype_dedicated_host_by_zone_model_json['instance_placement_enabled'] = True
+ dedicated_host_prototype_dedicated_host_by_zone_model_json['name'] = 'my-host'
+ dedicated_host_prototype_dedicated_host_by_zone_model_json['profile'] = dedicated_host_profile_identity_model
+ dedicated_host_prototype_dedicated_host_by_zone_model_json['resource_group'] = resource_group_identity_model
+ dedicated_host_prototype_dedicated_host_by_zone_model_json['group'] = dedicated_host_group_prototype_dedicated_host_by_zone_context_model
+ dedicated_host_prototype_dedicated_host_by_zone_model_json['zone'] = zone_identity_model
+
+ # Construct a model instance of DedicatedHostPrototypeDedicatedHostByZone by calling from_dict on the json representation
+ dedicated_host_prototype_dedicated_host_by_zone_model = DedicatedHostPrototypeDedicatedHostByZone.from_dict(dedicated_host_prototype_dedicated_host_by_zone_model_json)
+ assert dedicated_host_prototype_dedicated_host_by_zone_model != False
+
+ # Construct a model instance of DedicatedHostPrototypeDedicatedHostByZone by calling from_dict on the json representation
+ dedicated_host_prototype_dedicated_host_by_zone_model_dict = DedicatedHostPrototypeDedicatedHostByZone.from_dict(dedicated_host_prototype_dedicated_host_by_zone_model_json).__dict__
+ dedicated_host_prototype_dedicated_host_by_zone_model2 = DedicatedHostPrototypeDedicatedHostByZone(**dedicated_host_prototype_dedicated_host_by_zone_model_dict)
# Verify the model instances are equivalent
- assert volume_remote_model == volume_remote_model2
+ assert dedicated_host_prototype_dedicated_host_by_zone_model == dedicated_host_prototype_dedicated_host_by_zone_model2
# Convert model instance back to dict and verify no loss of data
- volume_remote_model_json2 = volume_remote_model.to_dict()
- assert volume_remote_model_json2 == volume_remote_model_json
+ dedicated_host_prototype_dedicated_host_by_zone_model_json2 = dedicated_host_prototype_dedicated_host_by_zone_model.to_dict()
+ assert dedicated_host_prototype_dedicated_host_by_zone_model_json2 == dedicated_host_prototype_dedicated_host_by_zone_model_json
-class TestModel_VolumeStatusReason:
+class TestModel_EncryptionKeyIdentityByCRN:
"""
- Test Class for VolumeStatusReason
+ Test Class for EncryptionKeyIdentityByCRN
"""
- def test_volume_status_reason_serialization(self):
+ def test_encryption_key_identity_by_crn_serialization(self):
"""
- Test serialization/deserialization for VolumeStatusReason
+ Test serialization/deserialization for EncryptionKeyIdentityByCRN
"""
- # 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 EncryptionKeyIdentityByCRN model
+ encryption_key_identity_by_crn_model_json = {}
+ encryption_key_identity_by_crn_model_json['crn'] = 'crn:v1:bluemix:public:kms:us-south:a/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179'
- # 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 EncryptionKeyIdentityByCRN by calling from_dict on the json representation
+ encryption_key_identity_by_crn_model = EncryptionKeyIdentityByCRN.from_dict(encryption_key_identity_by_crn_model_json)
+ assert encryption_key_identity_by_crn_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 EncryptionKeyIdentityByCRN by calling from_dict on the json representation
+ encryption_key_identity_by_crn_model_dict = EncryptionKeyIdentityByCRN.from_dict(encryption_key_identity_by_crn_model_json).__dict__
+ encryption_key_identity_by_crn_model2 = EncryptionKeyIdentityByCRN(**encryption_key_identity_by_crn_model_dict)
# Verify the model instances are equivalent
- assert volume_status_reason_model == volume_status_reason_model2
+ assert encryption_key_identity_by_crn_model == encryption_key_identity_by_crn_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
+ encryption_key_identity_by_crn_model_json2 = encryption_key_identity_by_crn_model.to_dict()
+ assert encryption_key_identity_by_crn_model_json2 == encryption_key_identity_by_crn_model_json
-class TestModel_Zone:
+class TestModel_EndpointGatewayReservedIPReservedIPPrototypeTargetContext:
"""
- Test Class for Zone
+ Test Class for EndpointGatewayReservedIPReservedIPPrototypeTargetContext
"""
- def test_zone_serialization(self):
+ def test_endpoint_gateway_reserved_ip_reserved_ip_prototype_target_context_serialization(self):
"""
- Test serialization/deserialization for Zone
+ Test serialization/deserialization for EndpointGatewayReservedIPReservedIPPrototypeTargetContext
"""
# 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'
+ subnet_identity_model = {} # SubnetIdentityById
+ subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
- # 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 EndpointGatewayReservedIPReservedIPPrototypeTargetContext model
+ endpoint_gateway_reserved_ip_reserved_ip_prototype_target_context_model_json = {}
+ endpoint_gateway_reserved_ip_reserved_ip_prototype_target_context_model_json['address'] = '192.168.3.4'
+ endpoint_gateway_reserved_ip_reserved_ip_prototype_target_context_model_json['auto_delete'] = False
+ endpoint_gateway_reserved_ip_reserved_ip_prototype_target_context_model_json['name'] = 'my-reserved-ip'
+ endpoint_gateway_reserved_ip_reserved_ip_prototype_target_context_model_json['subnet'] = subnet_identity_model
- # 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 EndpointGatewayReservedIPReservedIPPrototypeTargetContext by calling from_dict on the json representation
+ endpoint_gateway_reserved_ip_reserved_ip_prototype_target_context_model = EndpointGatewayReservedIPReservedIPPrototypeTargetContext.from_dict(endpoint_gateway_reserved_ip_reserved_ip_prototype_target_context_model_json)
+ assert endpoint_gateway_reserved_ip_reserved_ip_prototype_target_context_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 EndpointGatewayReservedIPReservedIPPrototypeTargetContext by calling from_dict on the json representation
+ endpoint_gateway_reserved_ip_reserved_ip_prototype_target_context_model_dict = EndpointGatewayReservedIPReservedIPPrototypeTargetContext.from_dict(endpoint_gateway_reserved_ip_reserved_ip_prototype_target_context_model_json).__dict__
+ endpoint_gateway_reserved_ip_reserved_ip_prototype_target_context_model2 = EndpointGatewayReservedIPReservedIPPrototypeTargetContext(**endpoint_gateway_reserved_ip_reserved_ip_prototype_target_context_model_dict)
# Verify the model instances are equivalent
- assert zone_model == zone_model2
+ assert endpoint_gateway_reserved_ip_reserved_ip_prototype_target_context_model == endpoint_gateway_reserved_ip_reserved_ip_prototype_target_context_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
+ endpoint_gateway_reserved_ip_reserved_ip_prototype_target_context_model_json2 = endpoint_gateway_reserved_ip_reserved_ip_prototype_target_context_model.to_dict()
+ assert endpoint_gateway_reserved_ip_reserved_ip_prototype_target_context_model_json2 == endpoint_gateway_reserved_ip_reserved_ip_prototype_target_context_model_json
-class TestModel_ZoneCollection:
+class TestModel_EndpointGatewayTargetProviderCloudServiceReference:
"""
- Test Class for ZoneCollection
+ Test Class for EndpointGatewayTargetProviderCloudServiceReference
"""
- def test_zone_collection_serialization(self):
+ def test_endpoint_gateway_target_provider_cloud_service_reference_serialization(self):
"""
- Test serialization/deserialization for ZoneCollection
+ Test serialization/deserialization for EndpointGatewayTargetProviderCloudServiceReference
"""
- # 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 EndpointGatewayTargetProviderCloudServiceReference model
+ endpoint_gateway_target_provider_cloud_service_reference_model_json = {}
+ endpoint_gateway_target_provider_cloud_service_reference_model_json['crn'] = 'crn:v1:bluemix:public:cloudant:us-south:a/123456:3527280b-9327-4411-8020-591092e60353::'
+ endpoint_gateway_target_provider_cloud_service_reference_model_json['resource_type'] = 'provider_cloud_service'
- # 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 EndpointGatewayTargetProviderCloudServiceReference by calling from_dict on the json representation
+ endpoint_gateway_target_provider_cloud_service_reference_model = EndpointGatewayTargetProviderCloudServiceReference.from_dict(endpoint_gateway_target_provider_cloud_service_reference_model_json)
+ assert endpoint_gateway_target_provider_cloud_service_reference_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 EndpointGatewayTargetProviderCloudServiceReference by calling from_dict on the json representation
+ endpoint_gateway_target_provider_cloud_service_reference_model_dict = EndpointGatewayTargetProviderCloudServiceReference.from_dict(endpoint_gateway_target_provider_cloud_service_reference_model_json).__dict__
+ endpoint_gateway_target_provider_cloud_service_reference_model2 = EndpointGatewayTargetProviderCloudServiceReference(**endpoint_gateway_target_provider_cloud_service_reference_model_dict)
# Verify the model instances are equivalent
- assert zone_collection_model == zone_collection_model2
+ assert endpoint_gateway_target_provider_cloud_service_reference_model == endpoint_gateway_target_provider_cloud_service_reference_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
+ endpoint_gateway_target_provider_cloud_service_reference_model_json2 = endpoint_gateway_target_provider_cloud_service_reference_model.to_dict()
+ assert endpoint_gateway_target_provider_cloud_service_reference_model_json2 == endpoint_gateway_target_provider_cloud_service_reference_model_json
-class TestModel_ZoneReference:
+class TestModel_EndpointGatewayTargetProviderInfrastructureServiceReference:
"""
- Test Class for ZoneReference
+ Test Class for EndpointGatewayTargetProviderInfrastructureServiceReference
"""
- def test_zone_reference_serialization(self):
+ def test_endpoint_gateway_target_provider_infrastructure_service_reference_serialization(self):
"""
- Test serialization/deserialization for ZoneReference
+ Test serialization/deserialization for EndpointGatewayTargetProviderInfrastructureServiceReference
"""
- # 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 EndpointGatewayTargetProviderInfrastructureServiceReference model
+ endpoint_gateway_target_provider_infrastructure_service_reference_model_json = {}
+ endpoint_gateway_target_provider_infrastructure_service_reference_model_json['name'] = 'ibm-ntp-server'
+ endpoint_gateway_target_provider_infrastructure_service_reference_model_json['resource_type'] = 'provider_infrastructure_service'
- # 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 EndpointGatewayTargetProviderInfrastructureServiceReference by calling from_dict on the json representation
+ endpoint_gateway_target_provider_infrastructure_service_reference_model = EndpointGatewayTargetProviderInfrastructureServiceReference.from_dict(endpoint_gateway_target_provider_infrastructure_service_reference_model_json)
+ assert endpoint_gateway_target_provider_infrastructure_service_reference_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 EndpointGatewayTargetProviderInfrastructureServiceReference by calling from_dict on the json representation
+ endpoint_gateway_target_provider_infrastructure_service_reference_model_dict = EndpointGatewayTargetProviderInfrastructureServiceReference.from_dict(endpoint_gateway_target_provider_infrastructure_service_reference_model_json).__dict__
+ endpoint_gateway_target_provider_infrastructure_service_reference_model2 = EndpointGatewayTargetProviderInfrastructureServiceReference(**endpoint_gateway_target_provider_infrastructure_service_reference_model_dict)
# Verify the model instances are equivalent
- assert zone_reference_model == zone_reference_model2
+ assert endpoint_gateway_target_provider_infrastructure_service_reference_model == endpoint_gateway_target_provider_infrastructure_service_reference_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
+ endpoint_gateway_target_provider_infrastructure_service_reference_model_json2 = endpoint_gateway_target_provider_infrastructure_service_reference_model.to_dict()
+ assert endpoint_gateway_target_provider_infrastructure_service_reference_model_json2 == endpoint_gateway_target_provider_infrastructure_service_reference_model_json
-class TestModel_BackupPolicyJobSourceVolumeReference:
+class TestModel_FloatingIPPrototypeFloatingIPByTarget:
"""
- Test Class for BackupPolicyJobSourceVolumeReference
+ Test Class for FloatingIPPrototypeFloatingIPByTarget
"""
- def test_backup_policy_job_source_volume_reference_serialization(self):
+ def test_floating_ip_prototype_floating_ip_by_target_serialization(self):
"""
- Test serialization/deserialization for BackupPolicyJobSourceVolumeReference
+ Test serialization/deserialization for FloatingIPPrototypeFloatingIPByTarget
"""
# 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'
-
- 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'
+ resource_group_identity_model = {} # ResourceGroupIdentityById
+ resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
- volume_remote_model = {} # VolumeRemote
- volume_remote_model['region'] = region_reference_model
+ floating_ip_target_prototype_model = {} # FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityById
+ floating_ip_target_prototype_model['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e'
- # Construct a json representation of a BackupPolicyJobSourceVolumeReference model
- backup_policy_job_source_volume_reference_model_json = {}
- backup_policy_job_source_volume_reference_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
- backup_policy_job_source_volume_reference_model_json['deleted'] = volume_reference_deleted_model
- backup_policy_job_source_volume_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
- backup_policy_job_source_volume_reference_model_json['id'] = '1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
- backup_policy_job_source_volume_reference_model_json['name'] = 'my-volume'
- backup_policy_job_source_volume_reference_model_json['remote'] = volume_remote_model
- backup_policy_job_source_volume_reference_model_json['resource_type'] = 'volume'
+ # Construct a json representation of a FloatingIPPrototypeFloatingIPByTarget model
+ floating_ip_prototype_floating_ip_by_target_model_json = {}
+ floating_ip_prototype_floating_ip_by_target_model_json['name'] = 'my-floating-ip'
+ floating_ip_prototype_floating_ip_by_target_model_json['resource_group'] = resource_group_identity_model
+ floating_ip_prototype_floating_ip_by_target_model_json['target'] = floating_ip_target_prototype_model
- # Construct a model instance of BackupPolicyJobSourceVolumeReference by calling from_dict on the json representation
- backup_policy_job_source_volume_reference_model = BackupPolicyJobSourceVolumeReference.from_dict(backup_policy_job_source_volume_reference_model_json)
- assert backup_policy_job_source_volume_reference_model != False
+ # Construct a model instance of FloatingIPPrototypeFloatingIPByTarget by calling from_dict on the json representation
+ floating_ip_prototype_floating_ip_by_target_model = FloatingIPPrototypeFloatingIPByTarget.from_dict(floating_ip_prototype_floating_ip_by_target_model_json)
+ assert floating_ip_prototype_floating_ip_by_target_model != False
- # Construct a model instance of BackupPolicyJobSourceVolumeReference by calling from_dict on the json representation
- backup_policy_job_source_volume_reference_model_dict = BackupPolicyJobSourceVolumeReference.from_dict(backup_policy_job_source_volume_reference_model_json).__dict__
- backup_policy_job_source_volume_reference_model2 = BackupPolicyJobSourceVolumeReference(**backup_policy_job_source_volume_reference_model_dict)
+ # Construct a model instance of FloatingIPPrototypeFloatingIPByTarget by calling from_dict on the json representation
+ floating_ip_prototype_floating_ip_by_target_model_dict = FloatingIPPrototypeFloatingIPByTarget.from_dict(floating_ip_prototype_floating_ip_by_target_model_json).__dict__
+ floating_ip_prototype_floating_ip_by_target_model2 = FloatingIPPrototypeFloatingIPByTarget(**floating_ip_prototype_floating_ip_by_target_model_dict)
# Verify the model instances are equivalent
- assert backup_policy_job_source_volume_reference_model == backup_policy_job_source_volume_reference_model2
+ assert floating_ip_prototype_floating_ip_by_target_model == floating_ip_prototype_floating_ip_by_target_model2
# Convert model instance back to dict and verify no loss of data
- backup_policy_job_source_volume_reference_model_json2 = backup_policy_job_source_volume_reference_model.to_dict()
- assert backup_policy_job_source_volume_reference_model_json2 == backup_policy_job_source_volume_reference_model_json
+ floating_ip_prototype_floating_ip_by_target_model_json2 = floating_ip_prototype_floating_ip_by_target_model.to_dict()
+ assert floating_ip_prototype_floating_ip_by_target_model_json2 == floating_ip_prototype_floating_ip_by_target_model_json
-class TestModel_BackupPolicyScopeAccountReference:
+class TestModel_FloatingIPPrototypeFloatingIPByZone:
"""
- Test Class for BackupPolicyScopeAccountReference
+ Test Class for FloatingIPPrototypeFloatingIPByZone
"""
- def test_backup_policy_scope_account_reference_serialization(self):
+ def test_floating_ip_prototype_floating_ip_by_zone_serialization(self):
"""
- Test serialization/deserialization for BackupPolicyScopeAccountReference
+ Test serialization/deserialization for FloatingIPPrototypeFloatingIPByZone
"""
- # Construct a json representation of a BackupPolicyScopeAccountReference model
- backup_policy_scope_account_reference_model_json = {}
- backup_policy_scope_account_reference_model_json['id'] = 'aa2432b1fa4d4ace891e9b80fc104e34'
- backup_policy_scope_account_reference_model_json['resource_type'] = 'account'
+ # Construct dict forms of any model objects needed in order to build this model.
- # Construct a model instance of BackupPolicyScopeAccountReference by calling from_dict on the json representation
- backup_policy_scope_account_reference_model = BackupPolicyScopeAccountReference.from_dict(backup_policy_scope_account_reference_model_json)
- assert backup_policy_scope_account_reference_model != False
+ resource_group_identity_model = {} # ResourceGroupIdentityById
+ resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
- # Construct a model instance of BackupPolicyScopeAccountReference by calling from_dict on the json representation
- backup_policy_scope_account_reference_model_dict = BackupPolicyScopeAccountReference.from_dict(backup_policy_scope_account_reference_model_json).__dict__
- backup_policy_scope_account_reference_model2 = BackupPolicyScopeAccountReference(**backup_policy_scope_account_reference_model_dict)
+ zone_identity_model = {} # ZoneIdentityByName
+ zone_identity_model['name'] = 'us-south-1'
+
+ # Construct a json representation of a FloatingIPPrototypeFloatingIPByZone model
+ floating_ip_prototype_floating_ip_by_zone_model_json = {}
+ floating_ip_prototype_floating_ip_by_zone_model_json['name'] = 'my-floating-ip'
+ floating_ip_prototype_floating_ip_by_zone_model_json['resource_group'] = resource_group_identity_model
+ floating_ip_prototype_floating_ip_by_zone_model_json['zone'] = zone_identity_model
+
+ # Construct a model instance of FloatingIPPrototypeFloatingIPByZone by calling from_dict on the json representation
+ floating_ip_prototype_floating_ip_by_zone_model = FloatingIPPrototypeFloatingIPByZone.from_dict(floating_ip_prototype_floating_ip_by_zone_model_json)
+ assert floating_ip_prototype_floating_ip_by_zone_model != False
+
+ # Construct a model instance of FloatingIPPrototypeFloatingIPByZone by calling from_dict on the json representation
+ floating_ip_prototype_floating_ip_by_zone_model_dict = FloatingIPPrototypeFloatingIPByZone.from_dict(floating_ip_prototype_floating_ip_by_zone_model_json).__dict__
+ floating_ip_prototype_floating_ip_by_zone_model2 = FloatingIPPrototypeFloatingIPByZone(**floating_ip_prototype_floating_ip_by_zone_model_dict)
# Verify the model instances are equivalent
- assert backup_policy_scope_account_reference_model == backup_policy_scope_account_reference_model2
+ assert floating_ip_prototype_floating_ip_by_zone_model == floating_ip_prototype_floating_ip_by_zone_model2
# Convert model instance back to dict and verify no loss of data
- backup_policy_scope_account_reference_model_json2 = backup_policy_scope_account_reference_model.to_dict()
- assert backup_policy_scope_account_reference_model_json2 == backup_policy_scope_account_reference_model_json
+ 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_BackupPolicyScopeEnterpriseReference:
+class TestModel_FloatingIPTargetBareMetalServerNetworkInterfaceReference:
"""
- Test Class for BackupPolicyScopeEnterpriseReference
+ Test Class for FloatingIPTargetBareMetalServerNetworkInterfaceReference
"""
- def test_backup_policy_scope_enterprise_reference_serialization(self):
+ def test_floating_ip_target_bare_metal_server_network_interface_reference_serialization(self):
"""
- Test serialization/deserialization for BackupPolicyScopeEnterpriseReference
+ Test serialization/deserialization for FloatingIPTargetBareMetalServerNetworkInterfaceReference
"""
- # Construct a json representation of a BackupPolicyScopeEnterpriseReference model
- backup_policy_scope_enterprise_reference_model_json = {}
- backup_policy_scope_enterprise_reference_model_json['crn'] = 'crn:v1:bluemix:public:enterprise::a/123456::enterprise:ebc2b430240943458b9e91e1432cfcce'
- backup_policy_scope_enterprise_reference_model_json['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
- backup_policy_scope_enterprise_reference_model_json['resource_type'] = 'enterprise'
+ # Construct dict forms of any model objects needed in order to build this model.
- # Construct a model instance of BackupPolicyScopeEnterpriseReference by calling from_dict on the json representation
- backup_policy_scope_enterprise_reference_model = BackupPolicyScopeEnterpriseReference.from_dict(backup_policy_scope_enterprise_reference_model_json)
- assert backup_policy_scope_enterprise_reference_model != False
+ bare_metal_server_network_interface_reference_deleted_model = {} # BareMetalServerNetworkInterfaceReferenceDeleted
+ bare_metal_server_network_interface_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Construct a model instance of BackupPolicyScopeEnterpriseReference by calling from_dict on the json representation
- backup_policy_scope_enterprise_reference_model_dict = BackupPolicyScopeEnterpriseReference.from_dict(backup_policy_scope_enterprise_reference_model_json).__dict__
- backup_policy_scope_enterprise_reference_model2 = BackupPolicyScopeEnterpriseReference(**backup_policy_scope_enterprise_reference_model_dict)
+ reserved_ip_reference_deleted_model = {} # ReservedIPReferenceDeleted
+ reserved_ip_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+
+ reserved_ip_reference_model = {} # ReservedIPReference
+ reserved_ip_reference_model['address'] = '192.168.3.4'
+ reserved_ip_reference_model['deleted'] = reserved_ip_reference_deleted_model
+ reserved_ip_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb'
+ reserved_ip_reference_model['id'] = '6d353a0f-aeb1-4ae1-832e-1110d10981bb'
+ reserved_ip_reference_model['name'] = 'my-reserved-ip'
+ reserved_ip_reference_model['resource_type'] = 'subnet_reserved_ip'
+
+ # Construct a json representation of a FloatingIPTargetBareMetalServerNetworkInterfaceReference model
+ floating_ip_target_bare_metal_server_network_interface_reference_model_json = {}
+ floating_ip_target_bare_metal_server_network_interface_reference_model_json['deleted'] = bare_metal_server_network_interface_reference_deleted_model
+ floating_ip_target_bare_metal_server_network_interface_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e'
+ floating_ip_target_bare_metal_server_network_interface_reference_model_json['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e'
+ floating_ip_target_bare_metal_server_network_interface_reference_model_json['name'] = 'my-bare-metal-server-network-interface'
+ floating_ip_target_bare_metal_server_network_interface_reference_model_json['primary_ip'] = reserved_ip_reference_model
+ floating_ip_target_bare_metal_server_network_interface_reference_model_json['resource_type'] = 'network_interface'
+
+ # Construct a model instance of FloatingIPTargetBareMetalServerNetworkInterfaceReference by calling from_dict on the json representation
+ floating_ip_target_bare_metal_server_network_interface_reference_model = FloatingIPTargetBareMetalServerNetworkInterfaceReference.from_dict(floating_ip_target_bare_metal_server_network_interface_reference_model_json)
+ assert floating_ip_target_bare_metal_server_network_interface_reference_model != False
+
+ # Construct a model instance of FloatingIPTargetBareMetalServerNetworkInterfaceReference by calling from_dict on the json representation
+ floating_ip_target_bare_metal_server_network_interface_reference_model_dict = FloatingIPTargetBareMetalServerNetworkInterfaceReference.from_dict(floating_ip_target_bare_metal_server_network_interface_reference_model_json).__dict__
+ floating_ip_target_bare_metal_server_network_interface_reference_model2 = FloatingIPTargetBareMetalServerNetworkInterfaceReference(**floating_ip_target_bare_metal_server_network_interface_reference_model_dict)
# Verify the model instances are equivalent
- assert backup_policy_scope_enterprise_reference_model == backup_policy_scope_enterprise_reference_model2
+ assert floating_ip_target_bare_metal_server_network_interface_reference_model == floating_ip_target_bare_metal_server_network_interface_reference_model2
# Convert model instance back to dict and verify no loss of data
- backup_policy_scope_enterprise_reference_model_json2 = backup_policy_scope_enterprise_reference_model.to_dict()
- assert backup_policy_scope_enterprise_reference_model_json2 == backup_policy_scope_enterprise_reference_model_json
+ floating_ip_target_bare_metal_server_network_interface_reference_model_json2 = floating_ip_target_bare_metal_server_network_interface_reference_model.to_dict()
+ assert floating_ip_target_bare_metal_server_network_interface_reference_model_json2 == floating_ip_target_bare_metal_server_network_interface_reference_model_json
-class TestModel_BareMetalServerBootTargetBareMetalServerDiskReference:
+class TestModel_FloatingIPTargetNetworkInterfaceReference:
"""
- Test Class for BareMetalServerBootTargetBareMetalServerDiskReference
+ Test Class for FloatingIPTargetNetworkInterfaceReference
"""
- def test_bare_metal_server_boot_target_bare_metal_server_disk_reference_serialization(self):
+ def test_floating_ip_target_network_interface_reference_serialization(self):
"""
- Test serialization/deserialization for BareMetalServerBootTargetBareMetalServerDiskReference
+ Test serialization/deserialization for FloatingIPTargetNetworkInterfaceReference
"""
# 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'
+ 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 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-server-disk'
- bare_metal_server_boot_target_bare_metal_server_disk_reference_model_json['resource_type'] = 'bare_metal_server_disk'
+ 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 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
+ 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 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)
+ # Construct a json representation of a FloatingIPTargetNetworkInterfaceReference model
+ floating_ip_target_network_interface_reference_model_json = {}
+ floating_ip_target_network_interface_reference_model_json['deleted'] = network_interface_reference_deleted_model
+ floating_ip_target_network_interface_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e'
+ floating_ip_target_network_interface_reference_model_json['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e'
+ floating_ip_target_network_interface_reference_model_json['name'] = 'my-instance-network-interface'
+ floating_ip_target_network_interface_reference_model_json['primary_ip'] = reserved_ip_reference_model
+ floating_ip_target_network_interface_reference_model_json['resource_type'] = 'network_interface'
+
+ # Construct a model instance of FloatingIPTargetNetworkInterfaceReference by calling from_dict on the json representation
+ floating_ip_target_network_interface_reference_model = FloatingIPTargetNetworkInterfaceReference.from_dict(floating_ip_target_network_interface_reference_model_json)
+ assert floating_ip_target_network_interface_reference_model != False
+
+ # Construct a model instance of FloatingIPTargetNetworkInterfaceReference by calling from_dict on the json representation
+ floating_ip_target_network_interface_reference_model_dict = FloatingIPTargetNetworkInterfaceReference.from_dict(floating_ip_target_network_interface_reference_model_json).__dict__
+ floating_ip_target_network_interface_reference_model2 = FloatingIPTargetNetworkInterfaceReference(**floating_ip_target_network_interface_reference_model_dict)
# Verify the model instances are equivalent
- assert bare_metal_server_boot_target_bare_metal_server_disk_reference_model == bare_metal_server_boot_target_bare_metal_server_disk_reference_model2
+ assert floating_ip_target_network_interface_reference_model == floating_ip_target_network_interface_reference_model2
# Convert model instance back to dict and verify no loss of data
- 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
+ floating_ip_target_network_interface_reference_model_json2 = floating_ip_target_network_interface_reference_model.to_dict()
+ assert floating_ip_target_network_interface_reference_model_json2 == floating_ip_target_network_interface_reference_model_json
-class TestModel_BareMetalServerInitializationUserAccountBareMetalServerInitializationHostUserAccount:
+class TestModel_FloatingIPTargetPublicGatewayReference:
"""
- Test Class for BareMetalServerInitializationUserAccountBareMetalServerInitializationHostUserAccount
+ Test Class for FloatingIPTargetPublicGatewayReference
"""
- def test_bare_metal_server_initialization_user_account_bare_metal_server_initialization_host_user_account_serialization(self):
+ def test_floating_ip_target_public_gateway_reference_serialization(self):
"""
- Test serialization/deserialization for BareMetalServerInitializationUserAccountBareMetalServerInitializationHostUserAccount
+ Test serialization/deserialization for FloatingIPTargetPublicGatewayReference
"""
# 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: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'
+ 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 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 json representation of a FloatingIPTargetPublicGatewayReference model
+ floating_ip_target_public_gateway_reference_model_json = {}
+ floating_ip_target_public_gateway_reference_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::public-gateway:dc5431ef-1fc6-4861-adc9-a59d077d1241'
+ floating_ip_target_public_gateway_reference_model_json['deleted'] = public_gateway_reference_deleted_model
+ floating_ip_target_public_gateway_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/public_gateways/dc5431ef-1fc6-4861-adc9-a59d077d1241'
+ floating_ip_target_public_gateway_reference_model_json['id'] = 'dc5431ef-1fc6-4861-adc9-a59d077d1241'
+ floating_ip_target_public_gateway_reference_model_json['name'] = 'my-public-gateway'
+ floating_ip_target_public_gateway_reference_model_json['resource_type'] = 'public_gateway'
- # 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 FloatingIPTargetPublicGatewayReference by calling from_dict on the json representation
+ floating_ip_target_public_gateway_reference_model = FloatingIPTargetPublicGatewayReference.from_dict(floating_ip_target_public_gateway_reference_model_json)
+ assert floating_ip_target_public_gateway_reference_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_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)
+ # Construct a model instance of FloatingIPTargetPublicGatewayReference by calling from_dict on the json representation
+ floating_ip_target_public_gateway_reference_model_dict = FloatingIPTargetPublicGatewayReference.from_dict(floating_ip_target_public_gateway_reference_model_json).__dict__
+ floating_ip_target_public_gateway_reference_model2 = FloatingIPTargetPublicGatewayReference(**floating_ip_target_public_gateway_reference_model_dict)
# Verify the model instances are equivalent
- 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
+ assert floating_ip_target_public_gateway_reference_model == floating_ip_target_public_gateway_reference_model2
# Convert model instance back to dict and verify no loss of data
- 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
+ floating_ip_target_public_gateway_reference_model_json2 = floating_ip_target_public_gateway_reference_model.to_dict()
+ assert floating_ip_target_public_gateway_reference_model_json2 == floating_ip_target_public_gateway_reference_model_json
-class TestModel_BareMetalServerNetworkInterfaceByHiperSocket:
+class TestModel_FloatingIPTargetVirtualNetworkInterfaceReference:
"""
- Test Class for BareMetalServerNetworkInterfaceByHiperSocket
+ Test Class for FloatingIPTargetVirtualNetworkInterfaceReference
"""
- def test_bare_metal_server_network_interface_by_hiper_socket_serialization(self):
+ def test_floating_ip_target_virtual_network_interface_reference_serialization(self):
"""
- Test serialization/deserialization for BareMetalServerNetworkInterfaceByHiperSocket
+ Test serialization/deserialization for FloatingIPTargetVirtualNetworkInterfaceReference
"""
# Construct dict forms of any model objects needed in order to build this model.
- floating_ip_reference_deleted_model = {} # FloatingIPReferenceDeleted
- floating_ip_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
-
- floating_ip_reference_model = {} # FloatingIPReference
- floating_ip_reference_model['address'] = '203.0.113.1'
- floating_ip_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689'
- floating_ip_reference_model['deleted'] = floating_ip_reference_deleted_model
- floating_ip_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689'
- floating_ip_reference_model['id'] = '39300233-9995-4806-89a5-3c1b6eb88689'
- floating_ip_reference_model['name'] = 'my-floating-ip'
+ virtual_network_interface_reference_deleted_model = {} # VirtualNetworkInterfaceReferenceDeleted
+ virtual_network_interface_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
reserved_ip_reference_deleted_model = {} # ReservedIPReferenceDeleted
reserved_ip_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
@@ -68459,16 +78654,6 @@ def test_bare_metal_server_network_interface_by_hiper_socket_serialization(self)
reserved_ip_reference_model['name'] = 'my-reserved-ip'
reserved_ip_reference_model['resource_type'] = 'subnet_reserved_ip'
- security_group_reference_deleted_model = {} # SecurityGroupReferenceDeleted
- security_group_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
-
- security_group_reference_model = {} # SecurityGroupReference
- security_group_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271'
- security_group_reference_model['deleted'] = security_group_reference_deleted_model
- security_group_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271'
- security_group_reference_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271'
- security_group_reference_model['name'] = 'my-security-group'
-
subnet_reference_deleted_model = {} # SubnetReferenceDeleted
subnet_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
@@ -68480,63 +78665,47 @@ def test_bare_metal_server_network_interface_by_hiper_socket_serialization(self)
subnet_reference_model['name'] = 'my-subnet'
subnet_reference_model['resource_type'] = 'subnet'
- # Construct a json representation of a BareMetalServerNetworkInterfaceByHiperSocket model
- bare_metal_server_network_interface_by_hiper_socket_model_json = {}
- bare_metal_server_network_interface_by_hiper_socket_model_json['allow_ip_spoofing'] = True
- bare_metal_server_network_interface_by_hiper_socket_model_json['created_at'] = '2019-01-01T12:00:00Z'
- bare_metal_server_network_interface_by_hiper_socket_model_json['enable_infrastructure_nat'] = True
- bare_metal_server_network_interface_by_hiper_socket_model_json['floating_ips'] = [floating_ip_reference_model]
- bare_metal_server_network_interface_by_hiper_socket_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e'
- bare_metal_server_network_interface_by_hiper_socket_model_json['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e'
- bare_metal_server_network_interface_by_hiper_socket_model_json['mac_address'] = '02:00:04:00:C4:6A'
- bare_metal_server_network_interface_by_hiper_socket_model_json['name'] = 'my-bare-metal-server-network-interface'
- bare_metal_server_network_interface_by_hiper_socket_model_json['port_speed'] = 1000
- bare_metal_server_network_interface_by_hiper_socket_model_json['primary_ip'] = reserved_ip_reference_model
- bare_metal_server_network_interface_by_hiper_socket_model_json['resource_type'] = 'network_interface'
- bare_metal_server_network_interface_by_hiper_socket_model_json['security_groups'] = [security_group_reference_model]
- bare_metal_server_network_interface_by_hiper_socket_model_json['status'] = 'available'
- bare_metal_server_network_interface_by_hiper_socket_model_json['subnet'] = subnet_reference_model
- bare_metal_server_network_interface_by_hiper_socket_model_json['type'] = 'primary'
- bare_metal_server_network_interface_by_hiper_socket_model_json['interface_type'] = 'hipersocket'
+ # Construct a json representation of a FloatingIPTargetVirtualNetworkInterfaceReference model
+ floating_ip_target_virtual_network_interface_reference_model_json = {}
+ floating_ip_target_virtual_network_interface_reference_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9'
+ floating_ip_target_virtual_network_interface_reference_model_json['deleted'] = virtual_network_interface_reference_deleted_model
+ floating_ip_target_virtual_network_interface_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9'
+ floating_ip_target_virtual_network_interface_reference_model_json['id'] = '0767-fa41aecb-4f21-423d-8082-630bfba1e1d9'
+ floating_ip_target_virtual_network_interface_reference_model_json['name'] = 'my-virtual-network-interface'
+ floating_ip_target_virtual_network_interface_reference_model_json['primary_ip'] = reserved_ip_reference_model
+ floating_ip_target_virtual_network_interface_reference_model_json['resource_type'] = 'virtual_network_interface'
+ floating_ip_target_virtual_network_interface_reference_model_json['subnet'] = subnet_reference_model
- # Construct a model instance of BareMetalServerNetworkInterfaceByHiperSocket by calling from_dict on the json representation
- bare_metal_server_network_interface_by_hiper_socket_model = BareMetalServerNetworkInterfaceByHiperSocket.from_dict(bare_metal_server_network_interface_by_hiper_socket_model_json)
- assert bare_metal_server_network_interface_by_hiper_socket_model != False
+ # Construct a model instance of FloatingIPTargetVirtualNetworkInterfaceReference by calling from_dict on the json representation
+ floating_ip_target_virtual_network_interface_reference_model = FloatingIPTargetVirtualNetworkInterfaceReference.from_dict(floating_ip_target_virtual_network_interface_reference_model_json)
+ assert floating_ip_target_virtual_network_interface_reference_model != False
- # Construct a model instance of BareMetalServerNetworkInterfaceByHiperSocket by calling from_dict on the json representation
- bare_metal_server_network_interface_by_hiper_socket_model_dict = BareMetalServerNetworkInterfaceByHiperSocket.from_dict(bare_metal_server_network_interface_by_hiper_socket_model_json).__dict__
- bare_metal_server_network_interface_by_hiper_socket_model2 = BareMetalServerNetworkInterfaceByHiperSocket(**bare_metal_server_network_interface_by_hiper_socket_model_dict)
+ # Construct a model instance of FloatingIPTargetVirtualNetworkInterfaceReference by calling from_dict on the json representation
+ floating_ip_target_virtual_network_interface_reference_model_dict = FloatingIPTargetVirtualNetworkInterfaceReference.from_dict(floating_ip_target_virtual_network_interface_reference_model_json).__dict__
+ floating_ip_target_virtual_network_interface_reference_model2 = FloatingIPTargetVirtualNetworkInterfaceReference(**floating_ip_target_virtual_network_interface_reference_model_dict)
# Verify the model instances are equivalent
- assert bare_metal_server_network_interface_by_hiper_socket_model == bare_metal_server_network_interface_by_hiper_socket_model2
+ assert floating_ip_target_virtual_network_interface_reference_model == floating_ip_target_virtual_network_interface_reference_model2
# Convert model instance back to dict and verify no loss of data
- bare_metal_server_network_interface_by_hiper_socket_model_json2 = bare_metal_server_network_interface_by_hiper_socket_model.to_dict()
- assert bare_metal_server_network_interface_by_hiper_socket_model_json2 == bare_metal_server_network_interface_by_hiper_socket_model_json
+ floating_ip_target_virtual_network_interface_reference_model_json2 = floating_ip_target_virtual_network_interface_reference_model.to_dict()
+ assert floating_ip_target_virtual_network_interface_reference_model_json2 == floating_ip_target_virtual_network_interface_reference_model_json
-class TestModel_BareMetalServerNetworkInterfaceByPCI:
+class TestModel_FlowLogCollectorTargetInstanceNetworkAttachmentReference:
"""
- Test Class for BareMetalServerNetworkInterfaceByPCI
+ Test Class for FlowLogCollectorTargetInstanceNetworkAttachmentReference
"""
- def test_bare_metal_server_network_interface_by_pci_serialization(self):
+ def test_flow_log_collector_target_instance_network_attachment_reference_serialization(self):
"""
- Test serialization/deserialization for BareMetalServerNetworkInterfaceByPCI
+ Test serialization/deserialization for FlowLogCollectorTargetInstanceNetworkAttachmentReference
"""
# Construct dict forms of any model objects needed in order to build this model.
- floating_ip_reference_deleted_model = {} # FloatingIPReferenceDeleted
- floating_ip_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
-
- floating_ip_reference_model = {} # FloatingIPReference
- floating_ip_reference_model['address'] = '203.0.113.1'
- floating_ip_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689'
- floating_ip_reference_model['deleted'] = floating_ip_reference_deleted_model
- floating_ip_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689'
- floating_ip_reference_model['id'] = '39300233-9995-4806-89a5-3c1b6eb88689'
- floating_ip_reference_model['name'] = 'my-floating-ip'
+ instance_network_attachment_reference_deleted_model = {} # InstanceNetworkAttachmentReferenceDeleted
+ instance_network_attachment_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'
@@ -68549,16 +78718,6 @@ def test_bare_metal_server_network_interface_by_pci_serialization(self):
reserved_ip_reference_model['name'] = 'my-reserved-ip'
reserved_ip_reference_model['resource_type'] = 'subnet_reserved_ip'
- security_group_reference_deleted_model = {} # SecurityGroupReferenceDeleted
- security_group_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
-
- security_group_reference_model = {} # SecurityGroupReference
- security_group_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271'
- security_group_reference_model['deleted'] = security_group_reference_deleted_model
- security_group_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271'
- security_group_reference_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271'
- security_group_reference_model['name'] = 'my-security-group'
-
subnet_reference_deleted_model = {} # SubnetReferenceDeleted
subnet_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
@@ -68570,14176 +78729,14461 @@ def test_bare_metal_server_network_interface_by_pci_serialization(self):
subnet_reference_model['name'] = 'my-subnet'
subnet_reference_model['resource_type'] = 'subnet'
- # Construct a json representation of a BareMetalServerNetworkInterfaceByPCI model
- bare_metal_server_network_interface_by_pci_model_json = {}
- bare_metal_server_network_interface_by_pci_model_json['allow_ip_spoofing'] = True
- bare_metal_server_network_interface_by_pci_model_json['created_at'] = '2019-01-01T12:00:00Z'
- bare_metal_server_network_interface_by_pci_model_json['enable_infrastructure_nat'] = True
- bare_metal_server_network_interface_by_pci_model_json['floating_ips'] = [floating_ip_reference_model]
- bare_metal_server_network_interface_by_pci_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e'
- bare_metal_server_network_interface_by_pci_model_json['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e'
- bare_metal_server_network_interface_by_pci_model_json['mac_address'] = '02:00:04:00:C4:6A'
- bare_metal_server_network_interface_by_pci_model_json['name'] = 'my-bare-metal-server-network-interface'
- bare_metal_server_network_interface_by_pci_model_json['port_speed'] = 1000
- bare_metal_server_network_interface_by_pci_model_json['primary_ip'] = reserved_ip_reference_model
- bare_metal_server_network_interface_by_pci_model_json['resource_type'] = 'network_interface'
- bare_metal_server_network_interface_by_pci_model_json['security_groups'] = [security_group_reference_model]
- bare_metal_server_network_interface_by_pci_model_json['status'] = 'available'
- bare_metal_server_network_interface_by_pci_model_json['subnet'] = subnet_reference_model
- bare_metal_server_network_interface_by_pci_model_json['type'] = 'primary'
- bare_metal_server_network_interface_by_pci_model_json['allowed_vlans'] = [4]
- bare_metal_server_network_interface_by_pci_model_json['interface_type'] = 'pci'
+ # Construct a json representation of a FlowLogCollectorTargetInstanceNetworkAttachmentReference model
+ flow_log_collector_target_instance_network_attachment_reference_model_json = {}
+ flow_log_collector_target_instance_network_attachment_reference_model_json['deleted'] = instance_network_attachment_reference_deleted_model
+ flow_log_collector_target_instance_network_attachment_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/5dd61d72-acaa-47c2-a336-3d849660d010/network_attachments/0767-d54eb633-98ea-459d-aa00-6a8e780175a7'
+ flow_log_collector_target_instance_network_attachment_reference_model_json['id'] = '0767-d54eb633-98ea-459d-aa00-6a8e780175a7'
+ flow_log_collector_target_instance_network_attachment_reference_model_json['name'] = 'my-instance-network-attachment'
+ flow_log_collector_target_instance_network_attachment_reference_model_json['primary_ip'] = reserved_ip_reference_model
+ flow_log_collector_target_instance_network_attachment_reference_model_json['resource_type'] = 'instance_network_attachment'
+ flow_log_collector_target_instance_network_attachment_reference_model_json['subnet'] = subnet_reference_model
- # 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 FlowLogCollectorTargetInstanceNetworkAttachmentReference by calling from_dict on the json representation
+ flow_log_collector_target_instance_network_attachment_reference_model = FlowLogCollectorTargetInstanceNetworkAttachmentReference.from_dict(flow_log_collector_target_instance_network_attachment_reference_model_json)
+ assert flow_log_collector_target_instance_network_attachment_reference_model != False
- # Construct a model instance of BareMetalServerNetworkInterfaceByPCI by calling from_dict on the json representation
- bare_metal_server_network_interface_by_pci_model_dict = BareMetalServerNetworkInterfaceByPCI.from_dict(bare_metal_server_network_interface_by_pci_model_json).__dict__
- bare_metal_server_network_interface_by_pci_model2 = BareMetalServerNetworkInterfaceByPCI(**bare_metal_server_network_interface_by_pci_model_dict)
+ # Construct a model instance of FlowLogCollectorTargetInstanceNetworkAttachmentReference by calling from_dict on the json representation
+ flow_log_collector_target_instance_network_attachment_reference_model_dict = FlowLogCollectorTargetInstanceNetworkAttachmentReference.from_dict(flow_log_collector_target_instance_network_attachment_reference_model_json).__dict__
+ flow_log_collector_target_instance_network_attachment_reference_model2 = FlowLogCollectorTargetInstanceNetworkAttachmentReference(**flow_log_collector_target_instance_network_attachment_reference_model_dict)
# Verify the model instances are equivalent
- assert bare_metal_server_network_interface_by_pci_model == bare_metal_server_network_interface_by_pci_model2
+ assert flow_log_collector_target_instance_network_attachment_reference_model == flow_log_collector_target_instance_network_attachment_reference_model2
# Convert model instance back to dict and verify no loss of data
- bare_metal_server_network_interface_by_pci_model_json2 = bare_metal_server_network_interface_by_pci_model.to_dict()
- assert bare_metal_server_network_interface_by_pci_model_json2 == bare_metal_server_network_interface_by_pci_model_json
+ flow_log_collector_target_instance_network_attachment_reference_model_json2 = flow_log_collector_target_instance_network_attachment_reference_model.to_dict()
+ assert flow_log_collector_target_instance_network_attachment_reference_model_json2 == flow_log_collector_target_instance_network_attachment_reference_model_json
-class TestModel_BareMetalServerNetworkInterfaceByVLAN:
+class TestModel_FlowLogCollectorTargetInstanceReference:
"""
- Test Class for BareMetalServerNetworkInterfaceByVLAN
+ Test Class for FlowLogCollectorTargetInstanceReference
"""
- def test_bare_metal_server_network_interface_by_vlan_serialization(self):
+ def test_flow_log_collector_target_instance_reference_serialization(self):
"""
- Test serialization/deserialization for BareMetalServerNetworkInterfaceByVLAN
+ Test serialization/deserialization for FlowLogCollectorTargetInstanceReference
"""
# 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'
+ instance_reference_deleted_model = {} # InstanceReferenceDeleted
+ instance_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'
+ # Construct a json representation of a FlowLogCollectorTargetInstanceReference model
+ flow_log_collector_target_instance_reference_model_json = {}
+ flow_log_collector_target_instance_reference_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a'
+ flow_log_collector_target_instance_reference_model_json['deleted'] = instance_reference_deleted_model
+ flow_log_collector_target_instance_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a'
+ flow_log_collector_target_instance_reference_model_json['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
+ flow_log_collector_target_instance_reference_model_json['name'] = 'my-instance'
- 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 FlowLogCollectorTargetInstanceReference by calling from_dict on the json representation
+ flow_log_collector_target_instance_reference_model = FlowLogCollectorTargetInstanceReference.from_dict(flow_log_collector_target_instance_reference_model_json)
+ assert flow_log_collector_target_instance_reference_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 FlowLogCollectorTargetInstanceReference by calling from_dict on the json representation
+ flow_log_collector_target_instance_reference_model_dict = FlowLogCollectorTargetInstanceReference.from_dict(flow_log_collector_target_instance_reference_model_json).__dict__
+ flow_log_collector_target_instance_reference_model2 = FlowLogCollectorTargetInstanceReference(**flow_log_collector_target_instance_reference_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 flow_log_collector_target_instance_reference_model == flow_log_collector_target_instance_reference_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
+ flow_log_collector_target_instance_reference_model_json2 = flow_log_collector_target_instance_reference_model.to_dict()
+ assert flow_log_collector_target_instance_reference_model_json2 == flow_log_collector_target_instance_reference_model_json
+
+
+class TestModel_FlowLogCollectorTargetNetworkInterfaceReferenceTargetContext:
+ """
+ Test Class for FlowLogCollectorTargetNetworkInterfaceReferenceTargetContext
+ """
+
+ def test_flow_log_collector_target_network_interface_reference_target_context_serialization(self):
+ """
+ Test serialization/deserialization for FlowLogCollectorTargetNetworkInterfaceReferenceTargetContext
+ """
+
+ # Construct dict forms of any model objects needed in order to build this model.
+
+ network_interface_reference_target_context_deleted_model = {} # NetworkInterfaceReferenceTargetContextDeleted
+ network_interface_reference_target_context_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+
+ # Construct a json representation of a FlowLogCollectorTargetNetworkInterfaceReferenceTargetContext model
+ flow_log_collector_target_network_interface_reference_target_context_model_json = {}
+ flow_log_collector_target_network_interface_reference_target_context_model_json['deleted'] = network_interface_reference_target_context_deleted_model
+ flow_log_collector_target_network_interface_reference_target_context_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e'
+ flow_log_collector_target_network_interface_reference_target_context_model_json['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e'
+ flow_log_collector_target_network_interface_reference_target_context_model_json['name'] = 'my-instance-network-interface'
+ flow_log_collector_target_network_interface_reference_target_context_model_json['resource_type'] = 'network_interface'
+
+ # Construct a model instance of FlowLogCollectorTargetNetworkInterfaceReferenceTargetContext by calling from_dict on the json representation
+ flow_log_collector_target_network_interface_reference_target_context_model = FlowLogCollectorTargetNetworkInterfaceReferenceTargetContext.from_dict(flow_log_collector_target_network_interface_reference_target_context_model_json)
+ assert flow_log_collector_target_network_interface_reference_target_context_model != False
+
+ # Construct a model instance of FlowLogCollectorTargetNetworkInterfaceReferenceTargetContext by calling from_dict on the json representation
+ flow_log_collector_target_network_interface_reference_target_context_model_dict = FlowLogCollectorTargetNetworkInterfaceReferenceTargetContext.from_dict(flow_log_collector_target_network_interface_reference_target_context_model_json).__dict__
+ flow_log_collector_target_network_interface_reference_target_context_model2 = FlowLogCollectorTargetNetworkInterfaceReferenceTargetContext(**flow_log_collector_target_network_interface_reference_target_context_model_dict)
+
+ # Verify the model instances are equivalent
+ assert flow_log_collector_target_network_interface_reference_target_context_model == flow_log_collector_target_network_interface_reference_target_context_model2
+
+ # Convert model instance back to dict and verify no loss of data
+ flow_log_collector_target_network_interface_reference_target_context_model_json2 = flow_log_collector_target_network_interface_reference_target_context_model.to_dict()
+ assert flow_log_collector_target_network_interface_reference_target_context_model_json2 == flow_log_collector_target_network_interface_reference_target_context_model_json
+
+
+class TestModel_FlowLogCollectorTargetSubnetReference:
+ """
+ Test Class for FlowLogCollectorTargetSubnetReference
+ """
+
+ def test_flow_log_collector_target_subnet_reference_serialization(self):
+ """
+ Test serialization/deserialization for FlowLogCollectorTargetSubnetReference
+ """
+
+ # 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'
- subnet_reference_model = {} # SubnetReference
- subnet_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
- subnet_reference_model['deleted'] = subnet_reference_deleted_model
- subnet_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
- subnet_reference_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
- subnet_reference_model['name'] = 'my-subnet'
- subnet_reference_model['resource_type'] = 'subnet'
-
- # Construct a json representation of a 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['mac_address'] = '02:00:04:00:C4:6A'
- bare_metal_server_network_interface_by_vlan_model_json['name'] = 'my-bare-metal-server-network-interface'
- bare_metal_server_network_interface_by_vlan_model_json['port_speed'] = 1000
- bare_metal_server_network_interface_by_vlan_model_json['primary_ip'] = reserved_ip_reference_model
- bare_metal_server_network_interface_by_vlan_model_json['resource_type'] = 'network_interface'
- 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['interface_type'] = 'vlan'
- bare_metal_server_network_interface_by_vlan_model_json['vlan'] = 4
+ # Construct a json representation of a FlowLogCollectorTargetSubnetReference model
+ flow_log_collector_target_subnet_reference_model_json = {}
+ flow_log_collector_target_subnet_reference_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
+ flow_log_collector_target_subnet_reference_model_json['deleted'] = subnet_reference_deleted_model
+ flow_log_collector_target_subnet_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
+ flow_log_collector_target_subnet_reference_model_json['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
+ flow_log_collector_target_subnet_reference_model_json['name'] = 'my-subnet'
+ flow_log_collector_target_subnet_reference_model_json['resource_type'] = 'subnet'
- # 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 FlowLogCollectorTargetSubnetReference by calling from_dict on the json representation
+ flow_log_collector_target_subnet_reference_model = FlowLogCollectorTargetSubnetReference.from_dict(flow_log_collector_target_subnet_reference_model_json)
+ assert flow_log_collector_target_subnet_reference_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)
+ # Construct a model instance of FlowLogCollectorTargetSubnetReference by calling from_dict on the json representation
+ flow_log_collector_target_subnet_reference_model_dict = FlowLogCollectorTargetSubnetReference.from_dict(flow_log_collector_target_subnet_reference_model_json).__dict__
+ flow_log_collector_target_subnet_reference_model2 = FlowLogCollectorTargetSubnetReference(**flow_log_collector_target_subnet_reference_model_dict)
# Verify the model instances are equivalent
- assert bare_metal_server_network_interface_by_vlan_model == bare_metal_server_network_interface_by_vlan_model2
+ assert flow_log_collector_target_subnet_reference_model == flow_log_collector_target_subnet_reference_model2
# Convert model instance back to dict and verify no loss of data
- 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
+ flow_log_collector_target_subnet_reference_model_json2 = flow_log_collector_target_subnet_reference_model.to_dict()
+ assert flow_log_collector_target_subnet_reference_model_json2 == flow_log_collector_target_subnet_reference_model_json
-class TestModel_BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype:
+class TestModel_FlowLogCollectorTargetVPCReference:
"""
- Test Class for BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype
+ Test Class for FlowLogCollectorTargetVPCReference
"""
- def test_bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_hiper_socket_prototype_serialization(self):
+ def test_flow_log_collector_target_vpc_reference_serialization(self):
"""
- Test serialization/deserialization for BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype
+ Test serialization/deserialization for FlowLogCollectorTargetVPCReference
"""
# Construct dict forms of any model objects needed in order to build this model.
- network_interface_ip_prototype_model = {} # NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext
- network_interface_ip_prototype_model['address'] = '10.0.0.5'
- network_interface_ip_prototype_model['auto_delete'] = False
- network_interface_ip_prototype_model['name'] = 'my-reserved-ip'
-
- security_group_identity_model = {} # SecurityGroupIdentityById
- security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271'
-
- subnet_identity_model = {} # SubnetIdentityById
- subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
+ 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 BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype model
- bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_hiper_socket_prototype_model_json = {}
- bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_hiper_socket_prototype_model_json['allow_ip_spoofing'] = True
- bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_hiper_socket_prototype_model_json['enable_infrastructure_nat'] = True
- bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_hiper_socket_prototype_model_json['name'] = 'my-bare-metal-server-network-interface'
- bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_hiper_socket_prototype_model_json['primary_ip'] = network_interface_ip_prototype_model
- bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_hiper_socket_prototype_model_json['security_groups'] = [security_group_identity_model]
- bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_hiper_socket_prototype_model_json['subnet'] = subnet_identity_model
- bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_hiper_socket_prototype_model_json['interface_type'] = 'hipersocket'
+ # Construct a json representation of a FlowLogCollectorTargetVPCReference model
+ flow_log_collector_target_vpc_reference_model_json = {}
+ flow_log_collector_target_vpc_reference_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b'
+ flow_log_collector_target_vpc_reference_model_json['deleted'] = vpc_reference_deleted_model
+ flow_log_collector_target_vpc_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b'
+ flow_log_collector_target_vpc_reference_model_json['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b'
+ flow_log_collector_target_vpc_reference_model_json['name'] = 'my-vpc'
+ flow_log_collector_target_vpc_reference_model_json['resource_type'] = 'vpc'
- # Construct a model instance of BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype by calling from_dict on the json representation
- bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_hiper_socket_prototype_model = BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype.from_dict(bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_hiper_socket_prototype_model_json)
- assert bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_hiper_socket_prototype_model != False
+ # Construct a model instance of FlowLogCollectorTargetVPCReference by calling from_dict on the json representation
+ flow_log_collector_target_vpc_reference_model = FlowLogCollectorTargetVPCReference.from_dict(flow_log_collector_target_vpc_reference_model_json)
+ assert flow_log_collector_target_vpc_reference_model != False
- # Construct a model instance of BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype by calling from_dict on the json representation
- bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_hiper_socket_prototype_model_dict = BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype.from_dict(bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_hiper_socket_prototype_model_json).__dict__
- bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_hiper_socket_prototype_model2 = BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype(**bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_hiper_socket_prototype_model_dict)
+ # Construct a model instance of FlowLogCollectorTargetVPCReference by calling from_dict on the json representation
+ flow_log_collector_target_vpc_reference_model_dict = FlowLogCollectorTargetVPCReference.from_dict(flow_log_collector_target_vpc_reference_model_json).__dict__
+ flow_log_collector_target_vpc_reference_model2 = FlowLogCollectorTargetVPCReference(**flow_log_collector_target_vpc_reference_model_dict)
# Verify the model instances are equivalent
- assert bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_hiper_socket_prototype_model == bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_hiper_socket_prototype_model2
+ assert flow_log_collector_target_vpc_reference_model == flow_log_collector_target_vpc_reference_model2
# Convert model instance back to dict and verify no loss of data
- bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_hiper_socket_prototype_model_json2 = bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_hiper_socket_prototype_model.to_dict()
- assert bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_hiper_socket_prototype_model_json2 == bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_hiper_socket_prototype_model_json
+ flow_log_collector_target_vpc_reference_model_json2 = flow_log_collector_target_vpc_reference_model.to_dict()
+ assert flow_log_collector_target_vpc_reference_model_json2 == flow_log_collector_target_vpc_reference_model_json
-class TestModel_BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPCIPrototype:
+class TestModel_FlowLogCollectorTargetVirtualNetworkInterfaceReferenceAttachmentContext:
"""
- Test Class for BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPCIPrototype
+ Test Class for FlowLogCollectorTargetVirtualNetworkInterfaceReferenceAttachmentContext
"""
- def test_bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_pci_prototype_serialization(self):
+ def test_flow_log_collector_target_virtual_network_interface_reference_attachment_context_serialization(self):
"""
- Test serialization/deserialization for BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPCIPrototype
+ Test serialization/deserialization for FlowLogCollectorTargetVirtualNetworkInterfaceReferenceAttachmentContext
"""
- # Construct dict forms of any model objects needed in order to build this model.
+ # Construct a json representation of a FlowLogCollectorTargetVirtualNetworkInterfaceReferenceAttachmentContext model
+ flow_log_collector_target_virtual_network_interface_reference_attachment_context_model_json = {}
+ flow_log_collector_target_virtual_network_interface_reference_attachment_context_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9'
+ flow_log_collector_target_virtual_network_interface_reference_attachment_context_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9'
+ flow_log_collector_target_virtual_network_interface_reference_attachment_context_model_json['id'] = '0767-fa41aecb-4f21-423d-8082-630bfba1e1d9'
+ flow_log_collector_target_virtual_network_interface_reference_attachment_context_model_json['name'] = 'my-virtual-network-interface'
+ flow_log_collector_target_virtual_network_interface_reference_attachment_context_model_json['resource_type'] = 'virtual_network_interface'
- network_interface_ip_prototype_model = {} # NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext
- network_interface_ip_prototype_model['address'] = '10.0.0.5'
- network_interface_ip_prototype_model['auto_delete'] = False
- network_interface_ip_prototype_model['name'] = 'my-reserved-ip'
+ # Construct a model instance of FlowLogCollectorTargetVirtualNetworkInterfaceReferenceAttachmentContext by calling from_dict on the json representation
+ flow_log_collector_target_virtual_network_interface_reference_attachment_context_model = FlowLogCollectorTargetVirtualNetworkInterfaceReferenceAttachmentContext.from_dict(flow_log_collector_target_virtual_network_interface_reference_attachment_context_model_json)
+ assert flow_log_collector_target_virtual_network_interface_reference_attachment_context_model != False
- security_group_identity_model = {} # SecurityGroupIdentityById
- security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271'
+ # Construct a model instance of FlowLogCollectorTargetVirtualNetworkInterfaceReferenceAttachmentContext by calling from_dict on the json representation
+ flow_log_collector_target_virtual_network_interface_reference_attachment_context_model_dict = FlowLogCollectorTargetVirtualNetworkInterfaceReferenceAttachmentContext.from_dict(flow_log_collector_target_virtual_network_interface_reference_attachment_context_model_json).__dict__
+ flow_log_collector_target_virtual_network_interface_reference_attachment_context_model2 = FlowLogCollectorTargetVirtualNetworkInterfaceReferenceAttachmentContext(**flow_log_collector_target_virtual_network_interface_reference_attachment_context_model_dict)
- subnet_identity_model = {} # SubnetIdentityById
- subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
+ # Verify the model instances are equivalent
+ assert flow_log_collector_target_virtual_network_interface_reference_attachment_context_model == flow_log_collector_target_virtual_network_interface_reference_attachment_context_model2
- # 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['name'] = 'my-bare-metal-server-network-interface'
- bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_pci_prototype_model_json['primary_ip'] = network_interface_ip_prototype_model
- bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_pci_prototype_model_json['security_groups'] = [security_group_identity_model]
- bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_pci_prototype_model_json['subnet'] = subnet_identity_model
- bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_pci_prototype_model_json['allowed_vlans'] = []
- bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_pci_prototype_model_json['interface_type'] = 'pci'
+ # Convert model instance back to dict and verify no loss of data
+ flow_log_collector_target_virtual_network_interface_reference_attachment_context_model_json2 = flow_log_collector_target_virtual_network_interface_reference_attachment_context_model.to_dict()
+ assert flow_log_collector_target_virtual_network_interface_reference_attachment_context_model_json2 == flow_log_collector_target_virtual_network_interface_reference_attachment_context_model_json
- # 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 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)
+class TestModel_ImageIdentityByCRN:
+ """
+ Test Class for ImageIdentityByCRN
+ """
+
+ def test_image_identity_by_crn_serialization(self):
+ """
+ Test serialization/deserialization for ImageIdentityByCRN
+ """
+
+ # Construct a json representation of a ImageIdentityByCRN model
+ image_identity_by_crn_model_json = {}
+ image_identity_by_crn_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8'
+
+ # Construct a model instance of ImageIdentityByCRN by calling from_dict on the json representation
+ image_identity_by_crn_model = ImageIdentityByCRN.from_dict(image_identity_by_crn_model_json)
+ assert image_identity_by_crn_model != False
+
+ # Construct a model instance of ImageIdentityByCRN by calling from_dict on the json representation
+ image_identity_by_crn_model_dict = ImageIdentityByCRN.from_dict(image_identity_by_crn_model_json).__dict__
+ image_identity_by_crn_model2 = ImageIdentityByCRN(**image_identity_by_crn_model_dict)
# Verify the model instances are equivalent
- 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
+ assert image_identity_by_crn_model == image_identity_by_crn_model2
# Convert model instance back to dict and verify no loss of data
- bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_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
+ image_identity_by_crn_model_json2 = image_identity_by_crn_model.to_dict()
+ assert image_identity_by_crn_model_json2 == image_identity_by_crn_model_json
-class TestModel_BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVLANPrototype:
+class TestModel_ImageIdentityByHref:
"""
- Test Class for BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVLANPrototype
+ Test Class for ImageIdentityByHref
"""
- def test_bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_vlan_prototype_serialization(self):
+ def test_image_identity_by_href_serialization(self):
"""
- Test serialization/deserialization for BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVLANPrototype
+ Test serialization/deserialization for ImageIdentityByHref
"""
- # Construct dict forms of any model objects needed in order to build this model.
+ # Construct a json representation of a ImageIdentityByHref model
+ image_identity_by_href_model_json = {}
+ image_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8'
- network_interface_ip_prototype_model = {} # NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext
- network_interface_ip_prototype_model['address'] = '10.0.0.5'
- network_interface_ip_prototype_model['auto_delete'] = False
- network_interface_ip_prototype_model['name'] = 'my-reserved-ip'
+ # Construct a model instance of ImageIdentityByHref by calling from_dict on the json representation
+ image_identity_by_href_model = ImageIdentityByHref.from_dict(image_identity_by_href_model_json)
+ assert image_identity_by_href_model != False
- security_group_identity_model = {} # SecurityGroupIdentityById
- security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271'
+ # Construct a model instance of ImageIdentityByHref by calling from_dict on the json representation
+ image_identity_by_href_model_dict = ImageIdentityByHref.from_dict(image_identity_by_href_model_json).__dict__
+ image_identity_by_href_model2 = ImageIdentityByHref(**image_identity_by_href_model_dict)
- subnet_identity_model = {} # SubnetIdentityById
- subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
+ # Verify the model instances are equivalent
+ assert image_identity_by_href_model == image_identity_by_href_model2
- # 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['name'] = 'my-bare-metal-server-network-interface'
- bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_vlan_prototype_model_json['primary_ip'] = network_interface_ip_prototype_model
- bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_vlan_prototype_model_json['security_groups'] = [security_group_identity_model]
- bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_vlan_prototype_model_json['subnet'] = subnet_identity_model
- 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['interface_type'] = 'vlan'
- bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_vlan_prototype_model_json['vlan'] = 4
+ # Convert model instance back to dict and verify no loss of data
+ image_identity_by_href_model_json2 = image_identity_by_href_model.to_dict()
+ assert image_identity_by_href_model_json2 == image_identity_by_href_model_json
- # 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)
+class TestModel_ImageIdentityById:
+ """
+ Test Class for ImageIdentityById
+ """
+
+ def test_image_identity_by_id_serialization(self):
+ """
+ Test serialization/deserialization for ImageIdentityById
+ """
+
+ # Construct a json representation of a ImageIdentityById model
+ image_identity_by_id_model_json = {}
+ image_identity_by_id_model_json['id'] = '72b27b5c-f4b0-48bb-b954-5becc7c1dcb8'
+
+ # Construct a model instance of ImageIdentityById by calling from_dict on the json representation
+ image_identity_by_id_model = ImageIdentityById.from_dict(image_identity_by_id_model_json)
+ assert image_identity_by_id_model != False
+
+ # Construct a model instance of ImageIdentityById by calling from_dict on the json representation
+ image_identity_by_id_model_dict = ImageIdentityById.from_dict(image_identity_by_id_model_json).__dict__
+ image_identity_by_id_model2 = ImageIdentityById(**image_identity_by_id_model_dict)
# Verify the model instances are equivalent
- 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
+ assert image_identity_by_id_model == image_identity_by_id_model2
# Convert model instance back to dict and verify no loss of data
- bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_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
+ image_identity_by_id_model_json2 = image_identity_by_id_model.to_dict()
+ assert image_identity_by_id_model_json2 == image_identity_by_id_model_json
-class TestModel_BareMetalServerProfileBandwidthDependent:
+class TestModel_ImagePrototypeImageByFile:
"""
- Test Class for BareMetalServerProfileBandwidthDependent
+ Test Class for ImagePrototypeImageByFile
"""
- def test_bare_metal_server_profile_bandwidth_dependent_serialization(self):
+ def test_image_prototype_image_by_file_serialization(self):
"""
- Test serialization/deserialization for BareMetalServerProfileBandwidthDependent
+ Test serialization/deserialization for ImagePrototypeImageByFile
"""
- # 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'
+ # Construct dict forms of any model objects needed in order to build this model.
- # 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
+ resource_group_identity_model = {} # ResourceGroupIdentityById
+ resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
- # 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)
+ encryption_key_identity_model = {} # EncryptionKeyIdentityByCRN
+ encryption_key_identity_model['crn'] = 'crn:v1:bluemix:public:kms:us-south:a/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179'
+
+ image_file_prototype_model = {} # ImageFilePrototype
+ image_file_prototype_model['href'] = 'cos://us-south/custom-image-vpc-bucket/customImage-0.vhd'
+
+ operating_system_identity_model = {} # OperatingSystemIdentityByName
+ operating_system_identity_model['name'] = 'ubuntu-16-amd64'
+
+ # Construct a json representation of a ImagePrototypeImageByFile model
+ image_prototype_image_by_file_model_json = {}
+ image_prototype_image_by_file_model_json['deprecation_at'] = '2019-01-01T12:00:00Z'
+ image_prototype_image_by_file_model_json['name'] = 'my-image'
+ image_prototype_image_by_file_model_json['obsolescence_at'] = '2019-01-01T12:00:00Z'
+ image_prototype_image_by_file_model_json['resource_group'] = resource_group_identity_model
+ image_prototype_image_by_file_model_json['encrypted_data_key'] = 'testString'
+ image_prototype_image_by_file_model_json['encryption_key'] = encryption_key_identity_model
+ image_prototype_image_by_file_model_json['file'] = image_file_prototype_model
+ image_prototype_image_by_file_model_json['operating_system'] = operating_system_identity_model
+
+ # Construct a model instance of ImagePrototypeImageByFile by calling from_dict on the json representation
+ image_prototype_image_by_file_model = ImagePrototypeImageByFile.from_dict(image_prototype_image_by_file_model_json)
+ assert image_prototype_image_by_file_model != False
+
+ # Construct a model instance of ImagePrototypeImageByFile by calling from_dict on the json representation
+ image_prototype_image_by_file_model_dict = ImagePrototypeImageByFile.from_dict(image_prototype_image_by_file_model_json).__dict__
+ image_prototype_image_by_file_model2 = ImagePrototypeImageByFile(**image_prototype_image_by_file_model_dict)
# Verify the model instances are equivalent
- assert bare_metal_server_profile_bandwidth_dependent_model == bare_metal_server_profile_bandwidth_dependent_model2
+ assert image_prototype_image_by_file_model == image_prototype_image_by_file_model2
# 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
+ image_prototype_image_by_file_model_json2 = image_prototype_image_by_file_model.to_dict()
+ assert image_prototype_image_by_file_model_json2 == image_prototype_image_by_file_model_json
-class TestModel_BareMetalServerProfileBandwidthEnum:
+class TestModel_ImagePrototypeImageBySourceVolume:
"""
- Test Class for BareMetalServerProfileBandwidthEnum
+ Test Class for ImagePrototypeImageBySourceVolume
"""
- def test_bare_metal_server_profile_bandwidth_enum_serialization(self):
+ def test_image_prototype_image_by_source_volume_serialization(self):
"""
- Test serialization/deserialization for BareMetalServerProfileBandwidthEnum
+ Test serialization/deserialization for ImagePrototypeImageBySourceVolume
"""
- # 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 dict forms of any model objects needed in order to build this model.
- # 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
+ resource_group_identity_model = {} # ResourceGroupIdentityById
+ resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
- # 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)
+ encryption_key_identity_model = {} # EncryptionKeyIdentityByCRN
+ encryption_key_identity_model['crn'] = 'crn:v1:bluemix:public:kms:us-south:a/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179'
+
+ volume_identity_model = {} # VolumeIdentityById
+ volume_identity_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
+
+ # Construct a json representation of a ImagePrototypeImageBySourceVolume model
+ image_prototype_image_by_source_volume_model_json = {}
+ image_prototype_image_by_source_volume_model_json['deprecation_at'] = '2019-01-01T12:00:00Z'
+ image_prototype_image_by_source_volume_model_json['name'] = 'my-image'
+ image_prototype_image_by_source_volume_model_json['obsolescence_at'] = '2019-01-01T12:00:00Z'
+ image_prototype_image_by_source_volume_model_json['resource_group'] = resource_group_identity_model
+ image_prototype_image_by_source_volume_model_json['encryption_key'] = encryption_key_identity_model
+ image_prototype_image_by_source_volume_model_json['source_volume'] = volume_identity_model
+
+ # Construct a model instance of ImagePrototypeImageBySourceVolume by calling from_dict on the json representation
+ image_prototype_image_by_source_volume_model = ImagePrototypeImageBySourceVolume.from_dict(image_prototype_image_by_source_volume_model_json)
+ assert image_prototype_image_by_source_volume_model != False
+
+ # Construct a model instance of ImagePrototypeImageBySourceVolume by calling from_dict on the json representation
+ image_prototype_image_by_source_volume_model_dict = ImagePrototypeImageBySourceVolume.from_dict(image_prototype_image_by_source_volume_model_json).__dict__
+ image_prototype_image_by_source_volume_model2 = ImagePrototypeImageBySourceVolume(**image_prototype_image_by_source_volume_model_dict)
# Verify the model instances are equivalent
- assert bare_metal_server_profile_bandwidth_enum_model == bare_metal_server_profile_bandwidth_enum_model2
+ assert image_prototype_image_by_source_volume_model == image_prototype_image_by_source_volume_model2
# Convert model instance back to dict and verify no loss of data
- 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
+ image_prototype_image_by_source_volume_model_json2 = image_prototype_image_by_source_volume_model.to_dict()
+ assert image_prototype_image_by_source_volume_model_json2 == image_prototype_image_by_source_volume_model_json
-class TestModel_BareMetalServerProfileBandwidthFixed:
+class TestModel_InstanceCatalogOfferingPrototypeCatalogOfferingByOffering:
"""
- Test Class for BareMetalServerProfileBandwidthFixed
+ Test Class for InstanceCatalogOfferingPrototypeCatalogOfferingByOffering
"""
- def test_bare_metal_server_profile_bandwidth_fixed_serialization(self):
+ def test_instance_catalog_offering_prototype_catalog_offering_by_offering_serialization(self):
"""
- Test serialization/deserialization for BareMetalServerProfileBandwidthFixed
+ Test serialization/deserialization for InstanceCatalogOfferingPrototypeCatalogOfferingByOffering
"""
- # 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 dict forms of any model objects needed in order to build this model.
- # 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
+ catalog_offering_identity_model = {} # CatalogOfferingIdentityCatalogOfferingByCRN
+ catalog_offering_identity_model['crn'] = 'crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:offering:00111601-0ec5-41ac-b142-96d1e64e6442'
- # Construct a 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)
+ # Construct a json representation of a InstanceCatalogOfferingPrototypeCatalogOfferingByOffering model
+ instance_catalog_offering_prototype_catalog_offering_by_offering_model_json = {}
+ instance_catalog_offering_prototype_catalog_offering_by_offering_model_json['offering'] = catalog_offering_identity_model
+
+ # Construct a model instance of InstanceCatalogOfferingPrototypeCatalogOfferingByOffering by calling from_dict on the json representation
+ instance_catalog_offering_prototype_catalog_offering_by_offering_model = InstanceCatalogOfferingPrototypeCatalogOfferingByOffering.from_dict(instance_catalog_offering_prototype_catalog_offering_by_offering_model_json)
+ assert instance_catalog_offering_prototype_catalog_offering_by_offering_model != False
+
+ # Construct a model instance of InstanceCatalogOfferingPrototypeCatalogOfferingByOffering by calling from_dict on the json representation
+ instance_catalog_offering_prototype_catalog_offering_by_offering_model_dict = InstanceCatalogOfferingPrototypeCatalogOfferingByOffering.from_dict(instance_catalog_offering_prototype_catalog_offering_by_offering_model_json).__dict__
+ instance_catalog_offering_prototype_catalog_offering_by_offering_model2 = InstanceCatalogOfferingPrototypeCatalogOfferingByOffering(**instance_catalog_offering_prototype_catalog_offering_by_offering_model_dict)
# Verify the model instances are equivalent
- assert bare_metal_server_profile_bandwidth_fixed_model == bare_metal_server_profile_bandwidth_fixed_model2
+ assert instance_catalog_offering_prototype_catalog_offering_by_offering_model == instance_catalog_offering_prototype_catalog_offering_by_offering_model2
# Convert model instance back to dict and verify no loss of data
- 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
+ instance_catalog_offering_prototype_catalog_offering_by_offering_model_json2 = instance_catalog_offering_prototype_catalog_offering_by_offering_model.to_dict()
+ assert instance_catalog_offering_prototype_catalog_offering_by_offering_model_json2 == instance_catalog_offering_prototype_catalog_offering_by_offering_model_json
-class TestModel_BareMetalServerProfileBandwidthRange:
+class TestModel_InstanceCatalogOfferingPrototypeCatalogOfferingByVersion:
"""
- Test Class for BareMetalServerProfileBandwidthRange
+ Test Class for InstanceCatalogOfferingPrototypeCatalogOfferingByVersion
"""
- def test_bare_metal_server_profile_bandwidth_range_serialization(self):
+ def test_instance_catalog_offering_prototype_catalog_offering_by_version_serialization(self):
"""
- Test serialization/deserialization for BareMetalServerProfileBandwidthRange
+ Test serialization/deserialization for InstanceCatalogOfferingPrototypeCatalogOfferingByVersion
"""
- # 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'
+ # Construct dict forms of any model objects needed in order to build this model.
- # 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
+ catalog_offering_version_identity_model = {} # CatalogOfferingVersionIdentityCatalogOfferingVersionByCRN
+ catalog_offering_version_identity_model['crn'] = 'crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d'
- # Construct a 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)
+ # Construct a json representation of a InstanceCatalogOfferingPrototypeCatalogOfferingByVersion model
+ instance_catalog_offering_prototype_catalog_offering_by_version_model_json = {}
+ instance_catalog_offering_prototype_catalog_offering_by_version_model_json['version'] = catalog_offering_version_identity_model
+
+ # Construct a model instance of InstanceCatalogOfferingPrototypeCatalogOfferingByVersion by calling from_dict on the json representation
+ instance_catalog_offering_prototype_catalog_offering_by_version_model = InstanceCatalogOfferingPrototypeCatalogOfferingByVersion.from_dict(instance_catalog_offering_prototype_catalog_offering_by_version_model_json)
+ assert instance_catalog_offering_prototype_catalog_offering_by_version_model != False
+
+ # Construct a model instance of InstanceCatalogOfferingPrototypeCatalogOfferingByVersion by calling from_dict on the json representation
+ instance_catalog_offering_prototype_catalog_offering_by_version_model_dict = InstanceCatalogOfferingPrototypeCatalogOfferingByVersion.from_dict(instance_catalog_offering_prototype_catalog_offering_by_version_model_json).__dict__
+ instance_catalog_offering_prototype_catalog_offering_by_version_model2 = InstanceCatalogOfferingPrototypeCatalogOfferingByVersion(**instance_catalog_offering_prototype_catalog_offering_by_version_model_dict)
# Verify the model instances are equivalent
- assert bare_metal_server_profile_bandwidth_range_model == bare_metal_server_profile_bandwidth_range_model2
+ assert instance_catalog_offering_prototype_catalog_offering_by_version_model == instance_catalog_offering_prototype_catalog_offering_by_version_model2
# Convert model instance back to dict and verify no loss of data
- 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
+ instance_catalog_offering_prototype_catalog_offering_by_version_model_json2 = instance_catalog_offering_prototype_catalog_offering_by_version_model.to_dict()
+ assert instance_catalog_offering_prototype_catalog_offering_by_version_model_json2 == instance_catalog_offering_prototype_catalog_offering_by_version_model_json
-class TestModel_BareMetalServerProfileCPUCoreCountDependent:
+class TestModel_InstanceGroupManagerAutoScale:
"""
- Test Class for BareMetalServerProfileCPUCoreCountDependent
+ Test Class for InstanceGroupManagerAutoScale
"""
- def test_bare_metal_server_profile_cpu_core_count_dependent_serialization(self):
+ def test_instance_group_manager_auto_scale_serialization(self):
"""
- Test serialization/deserialization for BareMetalServerProfileCPUCoreCountDependent
+ Test serialization/deserialization for InstanceGroupManagerAutoScale
"""
- # 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 dict forms of any model objects needed in order to build this model.
- # 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
+ 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 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)
+ 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'
+
+ # Construct a json representation of a InstanceGroupManagerAutoScale model
+ instance_group_manager_auto_scale_model_json = {}
+ instance_group_manager_auto_scale_model_json['created_at'] = '2019-01-01T12:00:00Z'
+ instance_group_manager_auto_scale_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_auto_scale_model_json['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
+ instance_group_manager_auto_scale_model_json['management_enabled'] = True
+ instance_group_manager_auto_scale_model_json['name'] = 'my-instance-group-manager'
+ instance_group_manager_auto_scale_model_json['updated_at'] = '2019-01-01T12:00:00Z'
+ instance_group_manager_auto_scale_model_json['aggregation_window'] = 120
+ instance_group_manager_auto_scale_model_json['cooldown'] = 210
+ instance_group_manager_auto_scale_model_json['manager_type'] = 'autoscale'
+ instance_group_manager_auto_scale_model_json['max_membership_count'] = 10
+ instance_group_manager_auto_scale_model_json['min_membership_count'] = 10
+ instance_group_manager_auto_scale_model_json['policies'] = [instance_group_manager_policy_reference_model]
+
+ # Construct a model instance of InstanceGroupManagerAutoScale by calling from_dict on the json representation
+ instance_group_manager_auto_scale_model = InstanceGroupManagerAutoScale.from_dict(instance_group_manager_auto_scale_model_json)
+ assert instance_group_manager_auto_scale_model != False
+
+ # Construct a model instance of InstanceGroupManagerAutoScale by calling from_dict on the json representation
+ instance_group_manager_auto_scale_model_dict = InstanceGroupManagerAutoScale.from_dict(instance_group_manager_auto_scale_model_json).__dict__
+ instance_group_manager_auto_scale_model2 = InstanceGroupManagerAutoScale(**instance_group_manager_auto_scale_model_dict)
# Verify the model instances are equivalent
- assert bare_metal_server_profile_cpu_core_count_dependent_model == bare_metal_server_profile_cpu_core_count_dependent_model2
+ assert instance_group_manager_auto_scale_model == instance_group_manager_auto_scale_model2
# Convert model instance back to dict and verify no loss of data
- 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
+ instance_group_manager_auto_scale_model_json2 = instance_group_manager_auto_scale_model.to_dict()
+ assert instance_group_manager_auto_scale_model_json2 == instance_group_manager_auto_scale_model_json
-class TestModel_BareMetalServerProfileCPUCoreCountEnum:
+class TestModel_InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype:
"""
- Test Class for BareMetalServerProfileCPUCoreCountEnum
+ Test Class for InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype
"""
- def test_bare_metal_server_profile_cpu_core_count_enum_serialization(self):
+ def test_instance_group_manager_policy_prototype_instance_group_manager_target_policy_prototype_serialization(self):
"""
- Test serialization/deserialization for BareMetalServerProfileCPUCoreCountEnum
+ Test serialization/deserialization for InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype
"""
- # 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 json representation of a InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype model
+ instance_group_manager_policy_prototype_instance_group_manager_target_policy_prototype_model_json = {}
+ instance_group_manager_policy_prototype_instance_group_manager_target_policy_prototype_model_json['name'] = 'my-instance-group-manager-policy'
+ instance_group_manager_policy_prototype_instance_group_manager_target_policy_prototype_model_json['metric_type'] = 'cpu'
+ instance_group_manager_policy_prototype_instance_group_manager_target_policy_prototype_model_json['metric_value'] = 38
+ instance_group_manager_policy_prototype_instance_group_manager_target_policy_prototype_model_json['policy_type'] = 'target'
- # 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 InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype by calling from_dict on the json representation
+ instance_group_manager_policy_prototype_instance_group_manager_target_policy_prototype_model = InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype.from_dict(instance_group_manager_policy_prototype_instance_group_manager_target_policy_prototype_model_json)
+ assert instance_group_manager_policy_prototype_instance_group_manager_target_policy_prototype_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_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)
+ # Construct a model instance of InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype by calling from_dict on the json representation
+ instance_group_manager_policy_prototype_instance_group_manager_target_policy_prototype_model_dict = InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype.from_dict(instance_group_manager_policy_prototype_instance_group_manager_target_policy_prototype_model_json).__dict__
+ instance_group_manager_policy_prototype_instance_group_manager_target_policy_prototype_model2 = InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype(**instance_group_manager_policy_prototype_instance_group_manager_target_policy_prototype_model_dict)
# Verify the model instances are equivalent
- assert bare_metal_server_profile_cpu_core_count_enum_model == bare_metal_server_profile_cpu_core_count_enum_model2
+ assert instance_group_manager_policy_prototype_instance_group_manager_target_policy_prototype_model == instance_group_manager_policy_prototype_instance_group_manager_target_policy_prototype_model2
# Convert model instance back to dict and verify no loss of data
- 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
+ instance_group_manager_policy_prototype_instance_group_manager_target_policy_prototype_model_json2 = instance_group_manager_policy_prototype_instance_group_manager_target_policy_prototype_model.to_dict()
+ assert instance_group_manager_policy_prototype_instance_group_manager_target_policy_prototype_model_json2 == instance_group_manager_policy_prototype_instance_group_manager_target_policy_prototype_model_json
-class TestModel_BareMetalServerProfileCPUCoreCountFixed:
+class TestModel_InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy:
"""
- Test Class for BareMetalServerProfileCPUCoreCountFixed
+ Test Class for InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy
"""
- def test_bare_metal_server_profile_cpu_core_count_fixed_serialization(self):
+ def test_instance_group_manager_policy_instance_group_manager_target_policy_serialization(self):
"""
- Test serialization/deserialization for BareMetalServerProfileCPUCoreCountFixed
+ Test serialization/deserialization for InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy
"""
- # 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
+ # Construct a json representation of a InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy model
+ instance_group_manager_policy_instance_group_manager_target_policy_model_json = {}
+ instance_group_manager_policy_instance_group_manager_target_policy_model_json['created_at'] = '2019-01-01T12:00:00Z'
+ instance_group_manager_policy_instance_group_manager_target_policy_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_instance_group_manager_target_policy_model_json['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
+ instance_group_manager_policy_instance_group_manager_target_policy_model_json['name'] = 'my-instance-group-manager-policy'
+ instance_group_manager_policy_instance_group_manager_target_policy_model_json['updated_at'] = '2019-01-01T12:00:00Z'
+ instance_group_manager_policy_instance_group_manager_target_policy_model_json['metric_type'] = 'cpu'
+ instance_group_manager_policy_instance_group_manager_target_policy_model_json['metric_value'] = 38
+ instance_group_manager_policy_instance_group_manager_target_policy_model_json['policy_type'] = 'target'
- # 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
+ # Construct a model instance of InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy by calling from_dict on the json representation
+ instance_group_manager_policy_instance_group_manager_target_policy_model = InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy.from_dict(instance_group_manager_policy_instance_group_manager_target_policy_model_json)
+ assert instance_group_manager_policy_instance_group_manager_target_policy_model != False
- # 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)
+ # Construct a model instance of InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy by calling from_dict on the json representation
+ instance_group_manager_policy_instance_group_manager_target_policy_model_dict = InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy.from_dict(instance_group_manager_policy_instance_group_manager_target_policy_model_json).__dict__
+ instance_group_manager_policy_instance_group_manager_target_policy_model2 = InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy(**instance_group_manager_policy_instance_group_manager_target_policy_model_dict)
# 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
+ assert instance_group_manager_policy_instance_group_manager_target_policy_model == instance_group_manager_policy_instance_group_manager_target_policy_model2
# 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
+ instance_group_manager_policy_instance_group_manager_target_policy_model_json2 = instance_group_manager_policy_instance_group_manager_target_policy_model.to_dict()
+ assert instance_group_manager_policy_instance_group_manager_target_policy_model_json2 == instance_group_manager_policy_instance_group_manager_target_policy_model_json
-class TestModel_BareMetalServerProfileCPUCoreCountRange:
+class TestModel_InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype:
"""
- Test Class for BareMetalServerProfileCPUCoreCountRange
+ Test Class for InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype
"""
- def test_bare_metal_server_profile_cpu_core_count_range_serialization(self):
+ def test_instance_group_manager_prototype_instance_group_manager_auto_scale_prototype_serialization(self):
"""
- Test serialization/deserialization for BareMetalServerProfileCPUCoreCountRange
+ Test serialization/deserialization for InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype
"""
- # 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'
+ # Construct a json representation of a InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype model
+ instance_group_manager_prototype_instance_group_manager_auto_scale_prototype_model_json = {}
+ instance_group_manager_prototype_instance_group_manager_auto_scale_prototype_model_json['management_enabled'] = True
+ instance_group_manager_prototype_instance_group_manager_auto_scale_prototype_model_json['name'] = 'my-instance-group-manager'
+ instance_group_manager_prototype_instance_group_manager_auto_scale_prototype_model_json['aggregation_window'] = 120
+ instance_group_manager_prototype_instance_group_manager_auto_scale_prototype_model_json['cooldown'] = 210
+ instance_group_manager_prototype_instance_group_manager_auto_scale_prototype_model_json['manager_type'] = 'autoscale'
+ instance_group_manager_prototype_instance_group_manager_auto_scale_prototype_model_json['max_membership_count'] = 10
+ instance_group_manager_prototype_instance_group_manager_auto_scale_prototype_model_json['min_membership_count'] = 10
- # 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
+ # Construct a model instance of InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype by calling from_dict on the json representation
+ instance_group_manager_prototype_instance_group_manager_auto_scale_prototype_model = InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype.from_dict(instance_group_manager_prototype_instance_group_manager_auto_scale_prototype_model_json)
+ assert instance_group_manager_prototype_instance_group_manager_auto_scale_prototype_model != False
- # 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)
+ # Construct a model instance of InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype by calling from_dict on the json representation
+ instance_group_manager_prototype_instance_group_manager_auto_scale_prototype_model_dict = InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype.from_dict(instance_group_manager_prototype_instance_group_manager_auto_scale_prototype_model_json).__dict__
+ instance_group_manager_prototype_instance_group_manager_auto_scale_prototype_model2 = InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype(**instance_group_manager_prototype_instance_group_manager_auto_scale_prototype_model_dict)
# 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
+ assert instance_group_manager_prototype_instance_group_manager_auto_scale_prototype_model == instance_group_manager_prototype_instance_group_manager_auto_scale_prototype_model2
# 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
+ instance_group_manager_prototype_instance_group_manager_auto_scale_prototype_model_json2 = instance_group_manager_prototype_instance_group_manager_auto_scale_prototype_model.to_dict()
+ assert instance_group_manager_prototype_instance_group_manager_auto_scale_prototype_model_json2 == instance_group_manager_prototype_instance_group_manager_auto_scale_prototype_model_json
-class TestModel_BareMetalServerProfileCPUSocketCountDependent:
+class TestModel_InstanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype:
"""
- Test Class for BareMetalServerProfileCPUSocketCountDependent
+ Test Class for InstanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype
"""
- def test_bare_metal_server_profile_cpu_socket_count_dependent_serialization(self):
+ def test_instance_group_manager_prototype_instance_group_manager_scheduled_prototype_serialization(self):
"""
- Test serialization/deserialization for BareMetalServerProfileCPUSocketCountDependent
+ Test serialization/deserialization for InstanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype
"""
- # 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'
+ # Construct a json representation of a InstanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype model
+ instance_group_manager_prototype_instance_group_manager_scheduled_prototype_model_json = {}
+ instance_group_manager_prototype_instance_group_manager_scheduled_prototype_model_json['management_enabled'] = True
+ instance_group_manager_prototype_instance_group_manager_scheduled_prototype_model_json['name'] = 'my-instance-group-manager'
+ instance_group_manager_prototype_instance_group_manager_scheduled_prototype_model_json['manager_type'] = 'scheduled'
- # 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
+ # Construct a model instance of InstanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype by calling from_dict on the json representation
+ instance_group_manager_prototype_instance_group_manager_scheduled_prototype_model = InstanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype.from_dict(instance_group_manager_prototype_instance_group_manager_scheduled_prototype_model_json)
+ assert instance_group_manager_prototype_instance_group_manager_scheduled_prototype_model != False
- # 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)
+ # Construct a model instance of InstanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype by calling from_dict on the json representation
+ instance_group_manager_prototype_instance_group_manager_scheduled_prototype_model_dict = InstanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype.from_dict(instance_group_manager_prototype_instance_group_manager_scheduled_prototype_model_json).__dict__
+ instance_group_manager_prototype_instance_group_manager_scheduled_prototype_model2 = InstanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype(**instance_group_manager_prototype_instance_group_manager_scheduled_prototype_model_dict)
# 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
+ assert instance_group_manager_prototype_instance_group_manager_scheduled_prototype_model == instance_group_manager_prototype_instance_group_manager_scheduled_prototype_model2
# 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
+ instance_group_manager_prototype_instance_group_manager_scheduled_prototype_model_json2 = instance_group_manager_prototype_instance_group_manager_scheduled_prototype_model.to_dict()
+ assert instance_group_manager_prototype_instance_group_manager_scheduled_prototype_model_json2 == instance_group_manager_prototype_instance_group_manager_scheduled_prototype_model_json
-class TestModel_BareMetalServerProfileCPUSocketCountEnum:
+class TestModel_InstanceGroupManagerScheduled:
"""
- Test Class for BareMetalServerProfileCPUSocketCountEnum
+ Test Class for InstanceGroupManagerScheduled
"""
- def test_bare_metal_server_profile_cpu_socket_count_enum_serialization(self):
+ def test_instance_group_manager_scheduled_serialization(self):
"""
- Test serialization/deserialization for BareMetalServerProfileCPUSocketCountEnum
+ Test serialization/deserialization for InstanceGroupManagerScheduled
"""
- # 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 dict forms of any model objects needed in order to build this model.
- # 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
+ 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 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)
+ instance_group_manager_action_reference_model = {} # InstanceGroupManagerActionReference
+ instance_group_manager_action_reference_model['deleted'] = instance_group_manager_action_reference_deleted_model
+ instance_group_manager_action_reference_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_reference_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
+ instance_group_manager_action_reference_model['name'] = 'my-instance-group-manager-action'
+ instance_group_manager_action_reference_model['resource_type'] = 'instance_group_manager_action'
+
+ # Construct a json representation of a InstanceGroupManagerScheduled model
+ instance_group_manager_scheduled_model_json = {}
+ instance_group_manager_scheduled_model_json['created_at'] = '2019-01-01T12:00:00Z'
+ instance_group_manager_scheduled_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_scheduled_model_json['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
+ instance_group_manager_scheduled_model_json['management_enabled'] = True
+ instance_group_manager_scheduled_model_json['name'] = 'my-instance-group-manager'
+ instance_group_manager_scheduled_model_json['updated_at'] = '2019-01-01T12:00:00Z'
+ instance_group_manager_scheduled_model_json['actions'] = [instance_group_manager_action_reference_model]
+ instance_group_manager_scheduled_model_json['manager_type'] = 'scheduled'
+
+ # Construct a model instance of InstanceGroupManagerScheduled by calling from_dict on the json representation
+ instance_group_manager_scheduled_model = InstanceGroupManagerScheduled.from_dict(instance_group_manager_scheduled_model_json)
+ assert instance_group_manager_scheduled_model != False
+
+ # Construct a model instance of InstanceGroupManagerScheduled by calling from_dict on the json representation
+ instance_group_manager_scheduled_model_dict = InstanceGroupManagerScheduled.from_dict(instance_group_manager_scheduled_model_json).__dict__
+ instance_group_manager_scheduled_model2 = InstanceGroupManagerScheduled(**instance_group_manager_scheduled_model_dict)
# Verify the model instances are equivalent
- assert bare_metal_server_profile_cpu_socket_count_enum_model == bare_metal_server_profile_cpu_socket_count_enum_model2
+ assert instance_group_manager_scheduled_model == instance_group_manager_scheduled_model2
# Convert model instance back to dict and verify no loss of data
- 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
+ instance_group_manager_scheduled_model_json2 = instance_group_manager_scheduled_model.to_dict()
+ assert instance_group_manager_scheduled_model_json2 == instance_group_manager_scheduled_model_json
-class TestModel_BareMetalServerProfileCPUSocketCountFixed:
+class TestModel_InstanceGroupManagerScheduledActionManagerAutoScale:
"""
- Test Class for BareMetalServerProfileCPUSocketCountFixed
+ Test Class for InstanceGroupManagerScheduledActionManagerAutoScale
"""
- def test_bare_metal_server_profile_cpu_socket_count_fixed_serialization(self):
+ def test_instance_group_manager_scheduled_action_manager_auto_scale_serialization(self):
"""
- Test serialization/deserialization for BareMetalServerProfileCPUSocketCountFixed
+ Test serialization/deserialization for InstanceGroupManagerScheduledActionManagerAutoScale
"""
- # 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 dict forms of any model objects needed in order to build this model.
- # 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
+ 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 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)
+ # Construct a json representation of a InstanceGroupManagerScheduledActionManagerAutoScale model
+ instance_group_manager_scheduled_action_manager_auto_scale_model_json = {}
+ instance_group_manager_scheduled_action_manager_auto_scale_model_json['deleted'] = instance_group_manager_reference_deleted_model
+ instance_group_manager_scheduled_action_manager_auto_scale_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_scheduled_action_manager_auto_scale_model_json['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
+ instance_group_manager_scheduled_action_manager_auto_scale_model_json['name'] = 'my-instance-group-manager'
+ instance_group_manager_scheduled_action_manager_auto_scale_model_json['max_membership_count'] = 10
+ instance_group_manager_scheduled_action_manager_auto_scale_model_json['min_membership_count'] = 10
+
+ # Construct a model instance of InstanceGroupManagerScheduledActionManagerAutoScale by calling from_dict on the json representation
+ instance_group_manager_scheduled_action_manager_auto_scale_model = InstanceGroupManagerScheduledActionManagerAutoScale.from_dict(instance_group_manager_scheduled_action_manager_auto_scale_model_json)
+ assert instance_group_manager_scheduled_action_manager_auto_scale_model != False
+
+ # Construct a model instance of InstanceGroupManagerScheduledActionManagerAutoScale by calling from_dict on the json representation
+ instance_group_manager_scheduled_action_manager_auto_scale_model_dict = InstanceGroupManagerScheduledActionManagerAutoScale.from_dict(instance_group_manager_scheduled_action_manager_auto_scale_model_json).__dict__
+ instance_group_manager_scheduled_action_manager_auto_scale_model2 = InstanceGroupManagerScheduledActionManagerAutoScale(**instance_group_manager_scheduled_action_manager_auto_scale_model_dict)
# Verify the model instances are equivalent
- assert bare_metal_server_profile_cpu_socket_count_fixed_model == bare_metal_server_profile_cpu_socket_count_fixed_model2
+ assert instance_group_manager_scheduled_action_manager_auto_scale_model == instance_group_manager_scheduled_action_manager_auto_scale_model2
# Convert model instance back to dict and verify no loss of data
- 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
+ instance_group_manager_scheduled_action_manager_auto_scale_model_json2 = instance_group_manager_scheduled_action_manager_auto_scale_model.to_dict()
+ assert instance_group_manager_scheduled_action_manager_auto_scale_model_json2 == instance_group_manager_scheduled_action_manager_auto_scale_model_json
-class TestModel_BareMetalServerProfileCPUSocketCountRange:
+class TestModel_InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeInstanceNetworkAttachmentContext:
"""
- Test Class for BareMetalServerProfileCPUSocketCountRange
+ Test Class for InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeInstanceNetworkAttachmentContext
"""
- def test_bare_metal_server_profile_cpu_socket_count_range_serialization(self):
+ def test_instance_network_attachment_prototype_virtual_network_interface_virtual_network_interface_prototype_instance_network_attachment_context_serialization(self):
"""
- Test serialization/deserialization for BareMetalServerProfileCPUSocketCountRange
+ Test serialization/deserialization for InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeInstanceNetworkAttachmentContext
"""
- # 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 dict forms of any model objects needed in order to build this model.
- # 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
+ virtual_network_interface_ip_prototype_model = {} # VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext
+ virtual_network_interface_ip_prototype_model['address'] = '10.0.0.5'
+ virtual_network_interface_ip_prototype_model['auto_delete'] = False
+ virtual_network_interface_ip_prototype_model['name'] = 'my-reserved-ip'
- # 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)
+ virtual_network_interface_primary_ip_prototype_model = {} # VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext
+ virtual_network_interface_primary_ip_prototype_model['address'] = '10.0.0.5'
+ virtual_network_interface_primary_ip_prototype_model['auto_delete'] = False
+ virtual_network_interface_primary_ip_prototype_model['name'] = 'my-reserved-ip'
+
+ resource_group_identity_model = {} # ResourceGroupIdentityById
+ resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
+
+ security_group_identity_model = {} # SecurityGroupIdentityById
+ security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271'
+
+ subnet_identity_model = {} # SubnetIdentityById
+ subnet_identity_model['id'] = '2302-ea5fe79f-52c3-4f05-86ae-9540a10489f5'
+
+ # Construct a json representation of a InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeInstanceNetworkAttachmentContext model
+ instance_network_attachment_prototype_virtual_network_interface_virtual_network_interface_prototype_instance_network_attachment_context_model_json = {}
+ instance_network_attachment_prototype_virtual_network_interface_virtual_network_interface_prototype_instance_network_attachment_context_model_json['allow_ip_spoofing'] = True
+ instance_network_attachment_prototype_virtual_network_interface_virtual_network_interface_prototype_instance_network_attachment_context_model_json['auto_delete'] = False
+ instance_network_attachment_prototype_virtual_network_interface_virtual_network_interface_prototype_instance_network_attachment_context_model_json['enable_infrastructure_nat'] = True
+ instance_network_attachment_prototype_virtual_network_interface_virtual_network_interface_prototype_instance_network_attachment_context_model_json['ips'] = [virtual_network_interface_ip_prototype_model]
+ instance_network_attachment_prototype_virtual_network_interface_virtual_network_interface_prototype_instance_network_attachment_context_model_json['name'] = 'my-virtual-network-interface'
+ instance_network_attachment_prototype_virtual_network_interface_virtual_network_interface_prototype_instance_network_attachment_context_model_json['primary_ip'] = virtual_network_interface_primary_ip_prototype_model
+ instance_network_attachment_prototype_virtual_network_interface_virtual_network_interface_prototype_instance_network_attachment_context_model_json['resource_group'] = resource_group_identity_model
+ instance_network_attachment_prototype_virtual_network_interface_virtual_network_interface_prototype_instance_network_attachment_context_model_json['security_groups'] = [security_group_identity_model]
+ instance_network_attachment_prototype_virtual_network_interface_virtual_network_interface_prototype_instance_network_attachment_context_model_json['subnet'] = subnet_identity_model
+
+ # Construct a model instance of InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeInstanceNetworkAttachmentContext by calling from_dict on the json representation
+ instance_network_attachment_prototype_virtual_network_interface_virtual_network_interface_prototype_instance_network_attachment_context_model = InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeInstanceNetworkAttachmentContext.from_dict(instance_network_attachment_prototype_virtual_network_interface_virtual_network_interface_prototype_instance_network_attachment_context_model_json)
+ assert instance_network_attachment_prototype_virtual_network_interface_virtual_network_interface_prototype_instance_network_attachment_context_model != False
+
+ # Construct a model instance of InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeInstanceNetworkAttachmentContext by calling from_dict on the json representation
+ instance_network_attachment_prototype_virtual_network_interface_virtual_network_interface_prototype_instance_network_attachment_context_model_dict = InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeInstanceNetworkAttachmentContext.from_dict(instance_network_attachment_prototype_virtual_network_interface_virtual_network_interface_prototype_instance_network_attachment_context_model_json).__dict__
+ instance_network_attachment_prototype_virtual_network_interface_virtual_network_interface_prototype_instance_network_attachment_context_model2 = InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeInstanceNetworkAttachmentContext(**instance_network_attachment_prototype_virtual_network_interface_virtual_network_interface_prototype_instance_network_attachment_context_model_dict)
# Verify the model instances are equivalent
- assert bare_metal_server_profile_cpu_socket_count_range_model == bare_metal_server_profile_cpu_socket_count_range_model2
+ assert instance_network_attachment_prototype_virtual_network_interface_virtual_network_interface_prototype_instance_network_attachment_context_model == instance_network_attachment_prototype_virtual_network_interface_virtual_network_interface_prototype_instance_network_attachment_context_model2
# Convert model instance back to dict and verify no loss of data
- 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
+ instance_network_attachment_prototype_virtual_network_interface_virtual_network_interface_prototype_instance_network_attachment_context_model_json2 = instance_network_attachment_prototype_virtual_network_interface_virtual_network_interface_prototype_instance_network_attachment_context_model.to_dict()
+ assert instance_network_attachment_prototype_virtual_network_interface_virtual_network_interface_prototype_instance_network_attachment_context_model_json2 == instance_network_attachment_prototype_virtual_network_interface_virtual_network_interface_prototype_instance_network_attachment_context_model_json
-class TestModel_BareMetalServerProfileDiskQuantityDependent:
+class TestModel_InstancePatchProfileInstanceProfileIdentityByHref:
"""
- Test Class for BareMetalServerProfileDiskQuantityDependent
+ Test Class for InstancePatchProfileInstanceProfileIdentityByHref
"""
- def test_bare_metal_server_profile_disk_quantity_dependent_serialization(self):
+ def test_instance_patch_profile_instance_profile_identity_by_href_serialization(self):
"""
- Test serialization/deserialization for BareMetalServerProfileDiskQuantityDependent
+ Test serialization/deserialization for InstancePatchProfileInstanceProfileIdentityByHref
"""
- # 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 json representation of a InstancePatchProfileInstanceProfileIdentityByHref model
+ instance_patch_profile_instance_profile_identity_by_href_model_json = {}
+ instance_patch_profile_instance_profile_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16'
- # 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 InstancePatchProfileInstanceProfileIdentityByHref by calling from_dict on the json representation
+ instance_patch_profile_instance_profile_identity_by_href_model = InstancePatchProfileInstanceProfileIdentityByHref.from_dict(instance_patch_profile_instance_profile_identity_by_href_model_json)
+ assert instance_patch_profile_instance_profile_identity_by_href_model != False
- # 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)
+ # Construct a model instance of InstancePatchProfileInstanceProfileIdentityByHref by calling from_dict on the json representation
+ instance_patch_profile_instance_profile_identity_by_href_model_dict = InstancePatchProfileInstanceProfileIdentityByHref.from_dict(instance_patch_profile_instance_profile_identity_by_href_model_json).__dict__
+ instance_patch_profile_instance_profile_identity_by_href_model2 = InstancePatchProfileInstanceProfileIdentityByHref(**instance_patch_profile_instance_profile_identity_by_href_model_dict)
# Verify the model instances are equivalent
- assert bare_metal_server_profile_disk_quantity_dependent_model == bare_metal_server_profile_disk_quantity_dependent_model2
+ assert instance_patch_profile_instance_profile_identity_by_href_model == instance_patch_profile_instance_profile_identity_by_href_model2
# Convert model instance back to dict and verify no loss of data
- 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
+ instance_patch_profile_instance_profile_identity_by_href_model_json2 = instance_patch_profile_instance_profile_identity_by_href_model.to_dict()
+ assert instance_patch_profile_instance_profile_identity_by_href_model_json2 == instance_patch_profile_instance_profile_identity_by_href_model_json
-class TestModel_BareMetalServerProfileDiskQuantityEnum:
+class TestModel_InstancePatchProfileInstanceProfileIdentityByName:
"""
- Test Class for BareMetalServerProfileDiskQuantityEnum
+ Test Class for InstancePatchProfileInstanceProfileIdentityByName
"""
- def test_bare_metal_server_profile_disk_quantity_enum_serialization(self):
+ def test_instance_patch_profile_instance_profile_identity_by_name_serialization(self):
"""
- Test serialization/deserialization for BareMetalServerProfileDiskQuantityEnum
+ Test serialization/deserialization for InstancePatchProfileInstanceProfileIdentityByName
"""
- # 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 json representation of a InstancePatchProfileInstanceProfileIdentityByName model
+ instance_patch_profile_instance_profile_identity_by_name_model_json = {}
+ instance_patch_profile_instance_profile_identity_by_name_model_json['name'] = 'bx2-4x16'
- # 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 InstancePatchProfileInstanceProfileIdentityByName by calling from_dict on the json representation
+ instance_patch_profile_instance_profile_identity_by_name_model = InstancePatchProfileInstanceProfileIdentityByName.from_dict(instance_patch_profile_instance_profile_identity_by_name_model_json)
+ assert instance_patch_profile_instance_profile_identity_by_name_model != False
- # 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)
+ # Construct a model instance of InstancePatchProfileInstanceProfileIdentityByName by calling from_dict on the json representation
+ instance_patch_profile_instance_profile_identity_by_name_model_dict = InstancePatchProfileInstanceProfileIdentityByName.from_dict(instance_patch_profile_instance_profile_identity_by_name_model_json).__dict__
+ instance_patch_profile_instance_profile_identity_by_name_model2 = InstancePatchProfileInstanceProfileIdentityByName(**instance_patch_profile_instance_profile_identity_by_name_model_dict)
# Verify the model instances are equivalent
- assert bare_metal_server_profile_disk_quantity_enum_model == bare_metal_server_profile_disk_quantity_enum_model2
+ assert instance_patch_profile_instance_profile_identity_by_name_model == instance_patch_profile_instance_profile_identity_by_name_model2
# Convert model instance back to dict and verify no loss of data
- 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
+ instance_patch_profile_instance_profile_identity_by_name_model_json2 = instance_patch_profile_instance_profile_identity_by_name_model.to_dict()
+ assert instance_patch_profile_instance_profile_identity_by_name_model_json2 == instance_patch_profile_instance_profile_identity_by_name_model_json
-class TestModel_BareMetalServerProfileDiskQuantityFixed:
+class TestModel_InstancePlacementTargetDedicatedHostGroupReference:
"""
- Test Class for BareMetalServerProfileDiskQuantityFixed
+ Test Class for InstancePlacementTargetDedicatedHostGroupReference
"""
- def test_bare_metal_server_profile_disk_quantity_fixed_serialization(self):
+ def test_instance_placement_target_dedicated_host_group_reference_serialization(self):
"""
- Test serialization/deserialization for BareMetalServerProfileDiskQuantityFixed
+ Test serialization/deserialization for InstancePlacementTargetDedicatedHostGroupReference
"""
- # 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
+ # Construct dict forms of any model objects needed in order to build this model.
- # 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
+ 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 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)
+ # Construct a json representation of a InstancePlacementTargetDedicatedHostGroupReference model
+ instance_placement_target_dedicated_host_group_reference_model_json = {}
+ instance_placement_target_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'
+ instance_placement_target_dedicated_host_group_reference_model_json['deleted'] = dedicated_host_group_reference_deleted_model
+ instance_placement_target_dedicated_host_group_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0'
+ instance_placement_target_dedicated_host_group_reference_model_json['id'] = 'bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0'
+ instance_placement_target_dedicated_host_group_reference_model_json['name'] = 'my-host-group'
+ instance_placement_target_dedicated_host_group_reference_model_json['resource_type'] = 'dedicated_host_group'
+
+ # Construct a model instance of InstancePlacementTargetDedicatedHostGroupReference by calling from_dict on the json representation
+ instance_placement_target_dedicated_host_group_reference_model = InstancePlacementTargetDedicatedHostGroupReference.from_dict(instance_placement_target_dedicated_host_group_reference_model_json)
+ assert instance_placement_target_dedicated_host_group_reference_model != False
+
+ # Construct a model instance of InstancePlacementTargetDedicatedHostGroupReference by calling from_dict on the json representation
+ instance_placement_target_dedicated_host_group_reference_model_dict = InstancePlacementTargetDedicatedHostGroupReference.from_dict(instance_placement_target_dedicated_host_group_reference_model_json).__dict__
+ instance_placement_target_dedicated_host_group_reference_model2 = InstancePlacementTargetDedicatedHostGroupReference(**instance_placement_target_dedicated_host_group_reference_model_dict)
# Verify the model instances are equivalent
- assert bare_metal_server_profile_disk_quantity_fixed_model == bare_metal_server_profile_disk_quantity_fixed_model2
+ assert instance_placement_target_dedicated_host_group_reference_model == instance_placement_target_dedicated_host_group_reference_model2
# 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
+ instance_placement_target_dedicated_host_group_reference_model_json2 = instance_placement_target_dedicated_host_group_reference_model.to_dict()
+ assert instance_placement_target_dedicated_host_group_reference_model_json2 == instance_placement_target_dedicated_host_group_reference_model_json
-class TestModel_BareMetalServerProfileDiskQuantityRange:
+class TestModel_InstancePlacementTargetDedicatedHostReference:
"""
- Test Class for BareMetalServerProfileDiskQuantityRange
+ Test Class for InstancePlacementTargetDedicatedHostReference
"""
- def test_bare_metal_server_profile_disk_quantity_range_serialization(self):
+ def test_instance_placement_target_dedicated_host_reference_serialization(self):
"""
- Test serialization/deserialization for BareMetalServerProfileDiskQuantityRange
+ Test serialization/deserialization for InstancePlacementTargetDedicatedHostReference
"""
- # 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 dict forms of any model objects needed in order to build this model.
- # 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
+ 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 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)
+ # Construct a json representation of a InstancePlacementTargetDedicatedHostReference model
+ instance_placement_target_dedicated_host_reference_model_json = {}
+ instance_placement_target_dedicated_host_reference_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a'
+ instance_placement_target_dedicated_host_reference_model_json['deleted'] = dedicated_host_reference_deleted_model
+ instance_placement_target_dedicated_host_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a'
+ instance_placement_target_dedicated_host_reference_model_json['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
+ instance_placement_target_dedicated_host_reference_model_json['name'] = 'my-host'
+ instance_placement_target_dedicated_host_reference_model_json['resource_type'] = 'dedicated_host'
+
+ # Construct a model instance of InstancePlacementTargetDedicatedHostReference by calling from_dict on the json representation
+ instance_placement_target_dedicated_host_reference_model = InstancePlacementTargetDedicatedHostReference.from_dict(instance_placement_target_dedicated_host_reference_model_json)
+ assert instance_placement_target_dedicated_host_reference_model != False
+
+ # Construct a model instance of InstancePlacementTargetDedicatedHostReference by calling from_dict on the json representation
+ instance_placement_target_dedicated_host_reference_model_dict = InstancePlacementTargetDedicatedHostReference.from_dict(instance_placement_target_dedicated_host_reference_model_json).__dict__
+ instance_placement_target_dedicated_host_reference_model2 = InstancePlacementTargetDedicatedHostReference(**instance_placement_target_dedicated_host_reference_model_dict)
# Verify the model instances are equivalent
- assert bare_metal_server_profile_disk_quantity_range_model == bare_metal_server_profile_disk_quantity_range_model2
+ assert instance_placement_target_dedicated_host_reference_model == instance_placement_target_dedicated_host_reference_model2
# Convert model instance back to dict and verify no loss of data
- 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
+ instance_placement_target_dedicated_host_reference_model_json2 = instance_placement_target_dedicated_host_reference_model.to_dict()
+ assert instance_placement_target_dedicated_host_reference_model_json2 == instance_placement_target_dedicated_host_reference_model_json
-class TestModel_BareMetalServerProfileDiskSizeDependent:
+class TestModel_InstancePlacementTargetPlacementGroupReference:
"""
- Test Class for BareMetalServerProfileDiskSizeDependent
+ Test Class for InstancePlacementTargetPlacementGroupReference
"""
- def test_bare_metal_server_profile_disk_size_dependent_serialization(self):
+ def test_instance_placement_target_placement_group_reference_serialization(self):
"""
- Test serialization/deserialization for BareMetalServerProfileDiskSizeDependent
+ Test serialization/deserialization for InstancePlacementTargetPlacementGroupReference
"""
- # 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 dict forms of any model objects needed in order to build this model.
- # 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
+ placement_group_reference_deleted_model = {} # PlacementGroupReferenceDeleted
+ placement_group_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # 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)
+ # Construct a json representation of a InstancePlacementTargetPlacementGroupReference model
+ instance_placement_target_placement_group_reference_model_json = {}
+ instance_placement_target_placement_group_reference_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::placement-group:r018-418fe842-a3e9-47b9-a938-1aa5bd632871'
+ instance_placement_target_placement_group_reference_model_json['deleted'] = placement_group_reference_deleted_model
+ instance_placement_target_placement_group_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/placement_groups/r018-418fe842-a3e9-47b9-a938-1aa5bd632871'
+ instance_placement_target_placement_group_reference_model_json['id'] = 'r018-418fe842-a3e9-47b9-a938-1aa5bd632871'
+ instance_placement_target_placement_group_reference_model_json['name'] = 'my-placement-group'
+ instance_placement_target_placement_group_reference_model_json['resource_type'] = 'placement_group'
+
+ # Construct a model instance of InstancePlacementTargetPlacementGroupReference by calling from_dict on the json representation
+ instance_placement_target_placement_group_reference_model = InstancePlacementTargetPlacementGroupReference.from_dict(instance_placement_target_placement_group_reference_model_json)
+ assert instance_placement_target_placement_group_reference_model != False
+
+ # Construct a model instance of InstancePlacementTargetPlacementGroupReference by calling from_dict on the json representation
+ instance_placement_target_placement_group_reference_model_dict = InstancePlacementTargetPlacementGroupReference.from_dict(instance_placement_target_placement_group_reference_model_json).__dict__
+ instance_placement_target_placement_group_reference_model2 = InstancePlacementTargetPlacementGroupReference(**instance_placement_target_placement_group_reference_model_dict)
# Verify the model instances are equivalent
- assert bare_metal_server_profile_disk_size_dependent_model == bare_metal_server_profile_disk_size_dependent_model2
+ assert instance_placement_target_placement_group_reference_model == instance_placement_target_placement_group_reference_model2
# Convert model instance back to dict and verify no loss of data
- 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
+ instance_placement_target_placement_group_reference_model_json2 = instance_placement_target_placement_group_reference_model.to_dict()
+ assert instance_placement_target_placement_group_reference_model_json2 == instance_placement_target_placement_group_reference_model_json
-class TestModel_BareMetalServerProfileDiskSizeEnum:
+class TestModel_InstanceProfileBandwidthDependent:
"""
- Test Class for BareMetalServerProfileDiskSizeEnum
+ Test Class for InstanceProfileBandwidthDependent
"""
- def test_bare_metal_server_profile_disk_size_enum_serialization(self):
+ def test_instance_profile_bandwidth_dependent_serialization(self):
"""
- Test serialization/deserialization for BareMetalServerProfileDiskSizeEnum
+ Test serialization/deserialization for InstanceProfileBandwidthDependent
"""
- # 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 json representation of a InstanceProfileBandwidthDependent model
+ instance_profile_bandwidth_dependent_model_json = {}
+ instance_profile_bandwidth_dependent_model_json['type'] = 'dependent'
- # 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 InstanceProfileBandwidthDependent by calling from_dict on the json representation
+ instance_profile_bandwidth_dependent_model = InstanceProfileBandwidthDependent.from_dict(instance_profile_bandwidth_dependent_model_json)
+ assert instance_profile_bandwidth_dependent_model != False
- # 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)
+ # Construct a model instance of InstanceProfileBandwidthDependent by calling from_dict on the json representation
+ instance_profile_bandwidth_dependent_model_dict = InstanceProfileBandwidthDependent.from_dict(instance_profile_bandwidth_dependent_model_json).__dict__
+ instance_profile_bandwidth_dependent_model2 = InstanceProfileBandwidthDependent(**instance_profile_bandwidth_dependent_model_dict)
# Verify the model instances are equivalent
- assert bare_metal_server_profile_disk_size_enum_model == bare_metal_server_profile_disk_size_enum_model2
+ assert instance_profile_bandwidth_dependent_model == instance_profile_bandwidth_dependent_model2
# Convert model instance back to dict and verify no loss of data
- 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
+ instance_profile_bandwidth_dependent_model_json2 = instance_profile_bandwidth_dependent_model.to_dict()
+ assert instance_profile_bandwidth_dependent_model_json2 == instance_profile_bandwidth_dependent_model_json
-class TestModel_BareMetalServerProfileDiskSizeFixed:
+class TestModel_InstanceProfileBandwidthEnum:
"""
- Test Class for BareMetalServerProfileDiskSizeFixed
+ Test Class for InstanceProfileBandwidthEnum
"""
- def test_bare_metal_server_profile_disk_size_fixed_serialization(self):
+ def test_instance_profile_bandwidth_enum_serialization(self):
"""
- Test serialization/deserialization for BareMetalServerProfileDiskSizeFixed
+ Test serialization/deserialization for InstanceProfileBandwidthEnum
"""
- # 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 json representation of a InstanceProfileBandwidthEnum model
+ instance_profile_bandwidth_enum_model_json = {}
+ instance_profile_bandwidth_enum_model_json['default'] = 38
+ instance_profile_bandwidth_enum_model_json['type'] = 'enum'
+ instance_profile_bandwidth_enum_model_json['values'] = [16000, 32000, 48000]
- # 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 InstanceProfileBandwidthEnum by calling from_dict on the json representation
+ instance_profile_bandwidth_enum_model = InstanceProfileBandwidthEnum.from_dict(instance_profile_bandwidth_enum_model_json)
+ assert instance_profile_bandwidth_enum_model != False
- # 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)
+ # Construct a model instance of InstanceProfileBandwidthEnum by calling from_dict on the json representation
+ instance_profile_bandwidth_enum_model_dict = InstanceProfileBandwidthEnum.from_dict(instance_profile_bandwidth_enum_model_json).__dict__
+ instance_profile_bandwidth_enum_model2 = InstanceProfileBandwidthEnum(**instance_profile_bandwidth_enum_model_dict)
# Verify the model instances are equivalent
- assert bare_metal_server_profile_disk_size_fixed_model == bare_metal_server_profile_disk_size_fixed_model2
+ assert instance_profile_bandwidth_enum_model == instance_profile_bandwidth_enum_model2
# Convert model instance back to dict and verify no loss of data
- 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
+ instance_profile_bandwidth_enum_model_json2 = instance_profile_bandwidth_enum_model.to_dict()
+ assert instance_profile_bandwidth_enum_model_json2 == instance_profile_bandwidth_enum_model_json
-class TestModel_BareMetalServerProfileDiskSizeRange:
+class TestModel_InstanceProfileBandwidthFixed:
"""
- Test Class for BareMetalServerProfileDiskSizeRange
+ Test Class for InstanceProfileBandwidthFixed
"""
- def test_bare_metal_server_profile_disk_size_range_serialization(self):
+ def test_instance_profile_bandwidth_fixed_serialization(self):
"""
- Test serialization/deserialization for BareMetalServerProfileDiskSizeRange
+ Test serialization/deserialization for InstanceProfileBandwidthFixed
"""
- # 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 json representation of a InstanceProfileBandwidthFixed model
+ instance_profile_bandwidth_fixed_model_json = {}
+ instance_profile_bandwidth_fixed_model_json['type'] = 'fixed'
+ instance_profile_bandwidth_fixed_model_json['value'] = 20000
- # 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 InstanceProfileBandwidthFixed by calling from_dict on the json representation
+ instance_profile_bandwidth_fixed_model = InstanceProfileBandwidthFixed.from_dict(instance_profile_bandwidth_fixed_model_json)
+ assert instance_profile_bandwidth_fixed_model != False
- # 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)
+ # Construct a model instance of InstanceProfileBandwidthFixed by calling from_dict on the json representation
+ instance_profile_bandwidth_fixed_model_dict = InstanceProfileBandwidthFixed.from_dict(instance_profile_bandwidth_fixed_model_json).__dict__
+ instance_profile_bandwidth_fixed_model2 = InstanceProfileBandwidthFixed(**instance_profile_bandwidth_fixed_model_dict)
# Verify the model instances are equivalent
- assert bare_metal_server_profile_disk_size_range_model == bare_metal_server_profile_disk_size_range_model2
+ assert instance_profile_bandwidth_fixed_model == instance_profile_bandwidth_fixed_model2
# Convert model instance back to dict and verify no loss of data
- 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
+ instance_profile_bandwidth_fixed_model_json2 = instance_profile_bandwidth_fixed_model.to_dict()
+ assert instance_profile_bandwidth_fixed_model_json2 == instance_profile_bandwidth_fixed_model_json
-class TestModel_BareMetalServerProfileIdentityByHref:
+class TestModel_InstanceProfileBandwidthRange:
"""
- Test Class for BareMetalServerProfileIdentityByHref
+ Test Class for InstanceProfileBandwidthRange
"""
- def test_bare_metal_server_profile_identity_by_href_serialization(self):
+ def test_instance_profile_bandwidth_range_serialization(self):
"""
- Test serialization/deserialization for BareMetalServerProfileIdentityByHref
+ Test serialization/deserialization for InstanceProfileBandwidthRange
"""
- # 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 json representation of a InstanceProfileBandwidthRange model
+ instance_profile_bandwidth_range_model_json = {}
+ instance_profile_bandwidth_range_model_json['default'] = 10000
+ instance_profile_bandwidth_range_model_json['max'] = 80000
+ instance_profile_bandwidth_range_model_json['min'] = 1000
+ instance_profile_bandwidth_range_model_json['step'] = 1000
+ instance_profile_bandwidth_range_model_json['type'] = 'range'
- # 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 InstanceProfileBandwidthRange by calling from_dict on the json representation
+ instance_profile_bandwidth_range_model = InstanceProfileBandwidthRange.from_dict(instance_profile_bandwidth_range_model_json)
+ assert instance_profile_bandwidth_range_model != False
- # 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)
+ # Construct a model instance of InstanceProfileBandwidthRange by calling from_dict on the json representation
+ instance_profile_bandwidth_range_model_dict = InstanceProfileBandwidthRange.from_dict(instance_profile_bandwidth_range_model_json).__dict__
+ instance_profile_bandwidth_range_model2 = InstanceProfileBandwidthRange(**instance_profile_bandwidth_range_model_dict)
# Verify the model instances are equivalent
- assert bare_metal_server_profile_identity_by_href_model == bare_metal_server_profile_identity_by_href_model2
+ assert instance_profile_bandwidth_range_model == instance_profile_bandwidth_range_model2
# Convert model instance back to dict and verify no loss of data
- 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
+ instance_profile_bandwidth_range_model_json2 = instance_profile_bandwidth_range_model.to_dict()
+ assert instance_profile_bandwidth_range_model_json2 == instance_profile_bandwidth_range_model_json
-class TestModel_BareMetalServerProfileIdentityByName:
+class TestModel_InstanceProfileDiskQuantityDependent:
"""
- Test Class for BareMetalServerProfileIdentityByName
+ Test Class for InstanceProfileDiskQuantityDependent
"""
- def test_bare_metal_server_profile_identity_by_name_serialization(self):
+ def test_instance_profile_disk_quantity_dependent_serialization(self):
"""
- Test serialization/deserialization for BareMetalServerProfileIdentityByName
+ Test serialization/deserialization for InstanceProfileDiskQuantityDependent
"""
- # 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 json representation of a InstanceProfileDiskQuantityDependent model
+ instance_profile_disk_quantity_dependent_model_json = {}
+ instance_profile_disk_quantity_dependent_model_json['type'] = 'dependent'
- # 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 InstanceProfileDiskQuantityDependent by calling from_dict on the json representation
+ instance_profile_disk_quantity_dependent_model = InstanceProfileDiskQuantityDependent.from_dict(instance_profile_disk_quantity_dependent_model_json)
+ assert instance_profile_disk_quantity_dependent_model != False
- # 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)
+ # Construct a model instance of InstanceProfileDiskQuantityDependent by calling from_dict on the json representation
+ instance_profile_disk_quantity_dependent_model_dict = InstanceProfileDiskQuantityDependent.from_dict(instance_profile_disk_quantity_dependent_model_json).__dict__
+ instance_profile_disk_quantity_dependent_model2 = InstanceProfileDiskQuantityDependent(**instance_profile_disk_quantity_dependent_model_dict)
# Verify the model instances are equivalent
- assert bare_metal_server_profile_identity_by_name_model == bare_metal_server_profile_identity_by_name_model2
+ assert instance_profile_disk_quantity_dependent_model == instance_profile_disk_quantity_dependent_model2
# Convert model instance back to dict and verify no loss of data
- 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
+ instance_profile_disk_quantity_dependent_model_json2 = instance_profile_disk_quantity_dependent_model.to_dict()
+ assert instance_profile_disk_quantity_dependent_model_json2 == instance_profile_disk_quantity_dependent_model_json
-class TestModel_BareMetalServerProfileMemoryDependent:
+class TestModel_InstanceProfileDiskQuantityEnum:
"""
- Test Class for BareMetalServerProfileMemoryDependent
+ Test Class for InstanceProfileDiskQuantityEnum
"""
- def test_bare_metal_server_profile_memory_dependent_serialization(self):
+ def test_instance_profile_disk_quantity_enum_serialization(self):
"""
- Test serialization/deserialization for BareMetalServerProfileMemoryDependent
+ Test serialization/deserialization for InstanceProfileDiskQuantityEnum
"""
- # 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 json representation of a InstanceProfileDiskQuantityEnum model
+ instance_profile_disk_quantity_enum_model_json = {}
+ instance_profile_disk_quantity_enum_model_json['default'] = 38
+ instance_profile_disk_quantity_enum_model_json['type'] = 'enum'
+ instance_profile_disk_quantity_enum_model_json['values'] = [1, 2, 4, 8]
- # 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 InstanceProfileDiskQuantityEnum by calling from_dict on the json representation
+ instance_profile_disk_quantity_enum_model = InstanceProfileDiskQuantityEnum.from_dict(instance_profile_disk_quantity_enum_model_json)
+ assert instance_profile_disk_quantity_enum_model != False
- # 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)
+ # Construct a model instance of InstanceProfileDiskQuantityEnum by calling from_dict on the json representation
+ instance_profile_disk_quantity_enum_model_dict = InstanceProfileDiskQuantityEnum.from_dict(instance_profile_disk_quantity_enum_model_json).__dict__
+ instance_profile_disk_quantity_enum_model2 = InstanceProfileDiskQuantityEnum(**instance_profile_disk_quantity_enum_model_dict)
# Verify the model instances are equivalent
- assert bare_metal_server_profile_memory_dependent_model == bare_metal_server_profile_memory_dependent_model2
+ assert instance_profile_disk_quantity_enum_model == instance_profile_disk_quantity_enum_model2
# Convert model instance back to dict and verify no loss of data
- 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
+ instance_profile_disk_quantity_enum_model_json2 = instance_profile_disk_quantity_enum_model.to_dict()
+ assert instance_profile_disk_quantity_enum_model_json2 == instance_profile_disk_quantity_enum_model_json
-class TestModel_BareMetalServerProfileMemoryEnum:
+class TestModel_InstanceProfileDiskQuantityFixed:
"""
- Test Class for BareMetalServerProfileMemoryEnum
+ Test Class for InstanceProfileDiskQuantityFixed
"""
- def test_bare_metal_server_profile_memory_enum_serialization(self):
+ def test_instance_profile_disk_quantity_fixed_serialization(self):
"""
- Test serialization/deserialization for BareMetalServerProfileMemoryEnum
+ Test serialization/deserialization for InstanceProfileDiskQuantityFixed
"""
- # 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 json representation of a InstanceProfileDiskQuantityFixed model
+ instance_profile_disk_quantity_fixed_model_json = {}
+ instance_profile_disk_quantity_fixed_model_json['type'] = 'fixed'
+ instance_profile_disk_quantity_fixed_model_json['value'] = 4
- # 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 InstanceProfileDiskQuantityFixed by calling from_dict on the json representation
+ instance_profile_disk_quantity_fixed_model = InstanceProfileDiskQuantityFixed.from_dict(instance_profile_disk_quantity_fixed_model_json)
+ assert instance_profile_disk_quantity_fixed_model != False
- # 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)
+ # Construct a model instance of InstanceProfileDiskQuantityFixed by calling from_dict on the json representation
+ instance_profile_disk_quantity_fixed_model_dict = InstanceProfileDiskQuantityFixed.from_dict(instance_profile_disk_quantity_fixed_model_json).__dict__
+ instance_profile_disk_quantity_fixed_model2 = InstanceProfileDiskQuantityFixed(**instance_profile_disk_quantity_fixed_model_dict)
# Verify the model instances are equivalent
- assert bare_metal_server_profile_memory_enum_model == bare_metal_server_profile_memory_enum_model2
+ assert instance_profile_disk_quantity_fixed_model == instance_profile_disk_quantity_fixed_model2
# Convert model instance back to dict and verify no loss of data
- 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
+ instance_profile_disk_quantity_fixed_model_json2 = instance_profile_disk_quantity_fixed_model.to_dict()
+ assert instance_profile_disk_quantity_fixed_model_json2 == instance_profile_disk_quantity_fixed_model_json
-class TestModel_BareMetalServerProfileMemoryFixed:
+class TestModel_InstanceProfileDiskQuantityRange:
"""
- Test Class for BareMetalServerProfileMemoryFixed
+ Test Class for InstanceProfileDiskQuantityRange
"""
- def test_bare_metal_server_profile_memory_fixed_serialization(self):
+ def test_instance_profile_disk_quantity_range_serialization(self):
"""
- Test serialization/deserialization for BareMetalServerProfileMemoryFixed
+ Test serialization/deserialization for InstanceProfileDiskQuantityRange
"""
- # 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 json representation of a InstanceProfileDiskQuantityRange model
+ instance_profile_disk_quantity_range_model_json = {}
+ instance_profile_disk_quantity_range_model_json['default'] = 1
+ instance_profile_disk_quantity_range_model_json['max'] = 4
+ instance_profile_disk_quantity_range_model_json['min'] = 1
+ instance_profile_disk_quantity_range_model_json['step'] = 1
+ instance_profile_disk_quantity_range_model_json['type'] = 'range'
- # 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 InstanceProfileDiskQuantityRange by calling from_dict on the json representation
+ instance_profile_disk_quantity_range_model = InstanceProfileDiskQuantityRange.from_dict(instance_profile_disk_quantity_range_model_json)
+ assert instance_profile_disk_quantity_range_model != False
- # 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)
+ # Construct a model instance of InstanceProfileDiskQuantityRange by calling from_dict on the json representation
+ instance_profile_disk_quantity_range_model_dict = InstanceProfileDiskQuantityRange.from_dict(instance_profile_disk_quantity_range_model_json).__dict__
+ instance_profile_disk_quantity_range_model2 = InstanceProfileDiskQuantityRange(**instance_profile_disk_quantity_range_model_dict)
# Verify the model instances are equivalent
- assert bare_metal_server_profile_memory_fixed_model == bare_metal_server_profile_memory_fixed_model2
+ assert instance_profile_disk_quantity_range_model == instance_profile_disk_quantity_range_model2
# Convert model instance back to dict and verify no loss of data
- 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
+ instance_profile_disk_quantity_range_model_json2 = instance_profile_disk_quantity_range_model.to_dict()
+ assert instance_profile_disk_quantity_range_model_json2 == instance_profile_disk_quantity_range_model_json
-class TestModel_BareMetalServerProfileMemoryRange:
+class TestModel_InstanceProfileDiskSizeDependent:
"""
- Test Class for BareMetalServerProfileMemoryRange
+ Test Class for InstanceProfileDiskSizeDependent
"""
- def test_bare_metal_server_profile_memory_range_serialization(self):
+ def test_instance_profile_disk_size_dependent_serialization(self):
"""
- Test serialization/deserialization for BareMetalServerProfileMemoryRange
+ Test serialization/deserialization for InstanceProfileDiskSizeDependent
"""
- # 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 json representation of a InstanceProfileDiskSizeDependent model
+ instance_profile_disk_size_dependent_model_json = {}
+ instance_profile_disk_size_dependent_model_json['type'] = 'dependent'
- # 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 InstanceProfileDiskSizeDependent by calling from_dict on the json representation
+ instance_profile_disk_size_dependent_model = InstanceProfileDiskSizeDependent.from_dict(instance_profile_disk_size_dependent_model_json)
+ assert instance_profile_disk_size_dependent_model != False
- # 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)
+ # Construct a model instance of InstanceProfileDiskSizeDependent by calling from_dict on the json representation
+ instance_profile_disk_size_dependent_model_dict = InstanceProfileDiskSizeDependent.from_dict(instance_profile_disk_size_dependent_model_json).__dict__
+ instance_profile_disk_size_dependent_model2 = InstanceProfileDiskSizeDependent(**instance_profile_disk_size_dependent_model_dict)
# Verify the model instances are equivalent
- assert bare_metal_server_profile_memory_range_model == bare_metal_server_profile_memory_range_model2
+ assert instance_profile_disk_size_dependent_model == instance_profile_disk_size_dependent_model2
# Convert model instance back to dict and verify no loss of data
- 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
+ instance_profile_disk_size_dependent_model_json2 = instance_profile_disk_size_dependent_model.to_dict()
+ assert instance_profile_disk_size_dependent_model_json2 == instance_profile_disk_size_dependent_model_json
-class TestModel_BareMetalServerProfileNetworkInterfaceCountDependent:
+class TestModel_InstanceProfileDiskSizeEnum:
"""
- Test Class for BareMetalServerProfileNetworkInterfaceCountDependent
+ Test Class for InstanceProfileDiskSizeEnum
"""
- def test_bare_metal_server_profile_network_interface_count_dependent_serialization(self):
+ def test_instance_profile_disk_size_enum_serialization(self):
"""
- Test serialization/deserialization for BareMetalServerProfileNetworkInterfaceCountDependent
+ Test serialization/deserialization for InstanceProfileDiskSizeEnum
"""
- # Construct a json representation of a BareMetalServerProfileNetworkInterfaceCountDependent model
- bare_metal_server_profile_network_interface_count_dependent_model_json = {}
- bare_metal_server_profile_network_interface_count_dependent_model_json['type'] = 'dependent'
+ # Construct a json representation of a InstanceProfileDiskSizeEnum model
+ instance_profile_disk_size_enum_model_json = {}
+ instance_profile_disk_size_enum_model_json['default'] = 38
+ instance_profile_disk_size_enum_model_json['type'] = 'enum'
+ instance_profile_disk_size_enum_model_json['values'] = [1, 2, 4, 8]
- # Construct a model instance of BareMetalServerProfileNetworkInterfaceCountDependent by calling from_dict on the json representation
- bare_metal_server_profile_network_interface_count_dependent_model = BareMetalServerProfileNetworkInterfaceCountDependent.from_dict(bare_metal_server_profile_network_interface_count_dependent_model_json)
- assert bare_metal_server_profile_network_interface_count_dependent_model != False
+ # Construct a model instance of InstanceProfileDiskSizeEnum by calling from_dict on the json representation
+ instance_profile_disk_size_enum_model = InstanceProfileDiskSizeEnum.from_dict(instance_profile_disk_size_enum_model_json)
+ assert instance_profile_disk_size_enum_model != False
- # Construct a model instance of BareMetalServerProfileNetworkInterfaceCountDependent by calling from_dict on the json representation
- bare_metal_server_profile_network_interface_count_dependent_model_dict = BareMetalServerProfileNetworkInterfaceCountDependent.from_dict(bare_metal_server_profile_network_interface_count_dependent_model_json).__dict__
- bare_metal_server_profile_network_interface_count_dependent_model2 = BareMetalServerProfileNetworkInterfaceCountDependent(**bare_metal_server_profile_network_interface_count_dependent_model_dict)
+ # Construct a model instance of InstanceProfileDiskSizeEnum by calling from_dict on the json representation
+ instance_profile_disk_size_enum_model_dict = InstanceProfileDiskSizeEnum.from_dict(instance_profile_disk_size_enum_model_json).__dict__
+ instance_profile_disk_size_enum_model2 = InstanceProfileDiskSizeEnum(**instance_profile_disk_size_enum_model_dict)
# Verify the model instances are equivalent
- assert bare_metal_server_profile_network_interface_count_dependent_model == bare_metal_server_profile_network_interface_count_dependent_model2
+ assert instance_profile_disk_size_enum_model == instance_profile_disk_size_enum_model2
# Convert model instance back to dict and verify no loss of data
- bare_metal_server_profile_network_interface_count_dependent_model_json2 = bare_metal_server_profile_network_interface_count_dependent_model.to_dict()
- assert bare_metal_server_profile_network_interface_count_dependent_model_json2 == bare_metal_server_profile_network_interface_count_dependent_model_json
+ instance_profile_disk_size_enum_model_json2 = instance_profile_disk_size_enum_model.to_dict()
+ assert instance_profile_disk_size_enum_model_json2 == instance_profile_disk_size_enum_model_json
-class TestModel_BareMetalServerProfileNetworkInterfaceCountRange:
+class TestModel_InstanceProfileDiskSizeFixed:
"""
- Test Class for BareMetalServerProfileNetworkInterfaceCountRange
+ Test Class for InstanceProfileDiskSizeFixed
"""
- def test_bare_metal_server_profile_network_interface_count_range_serialization(self):
+ def test_instance_profile_disk_size_fixed_serialization(self):
"""
- Test serialization/deserialization for BareMetalServerProfileNetworkInterfaceCountRange
+ Test serialization/deserialization for InstanceProfileDiskSizeFixed
"""
- # Construct a json representation of a BareMetalServerProfileNetworkInterfaceCountRange model
- bare_metal_server_profile_network_interface_count_range_model_json = {}
- bare_metal_server_profile_network_interface_count_range_model_json['max'] = 128
- bare_metal_server_profile_network_interface_count_range_model_json['min'] = 1
- bare_metal_server_profile_network_interface_count_range_model_json['type'] = 'range'
+ # Construct a json representation of a InstanceProfileDiskSizeFixed model
+ instance_profile_disk_size_fixed_model_json = {}
+ instance_profile_disk_size_fixed_model_json['type'] = 'fixed'
+ instance_profile_disk_size_fixed_model_json['value'] = 100
- # Construct a model instance of BareMetalServerProfileNetworkInterfaceCountRange by calling from_dict on the json representation
- bare_metal_server_profile_network_interface_count_range_model = BareMetalServerProfileNetworkInterfaceCountRange.from_dict(bare_metal_server_profile_network_interface_count_range_model_json)
- assert bare_metal_server_profile_network_interface_count_range_model != False
+ # Construct a model instance of InstanceProfileDiskSizeFixed by calling from_dict on the json representation
+ instance_profile_disk_size_fixed_model = InstanceProfileDiskSizeFixed.from_dict(instance_profile_disk_size_fixed_model_json)
+ assert instance_profile_disk_size_fixed_model != False
- # Construct a model instance of BareMetalServerProfileNetworkInterfaceCountRange by calling from_dict on the json representation
- bare_metal_server_profile_network_interface_count_range_model_dict = BareMetalServerProfileNetworkInterfaceCountRange.from_dict(bare_metal_server_profile_network_interface_count_range_model_json).__dict__
- bare_metal_server_profile_network_interface_count_range_model2 = BareMetalServerProfileNetworkInterfaceCountRange(**bare_metal_server_profile_network_interface_count_range_model_dict)
+ # Construct a model instance of InstanceProfileDiskSizeFixed by calling from_dict on the json representation
+ instance_profile_disk_size_fixed_model_dict = InstanceProfileDiskSizeFixed.from_dict(instance_profile_disk_size_fixed_model_json).__dict__
+ instance_profile_disk_size_fixed_model2 = InstanceProfileDiskSizeFixed(**instance_profile_disk_size_fixed_model_dict)
# Verify the model instances are equivalent
- assert bare_metal_server_profile_network_interface_count_range_model == bare_metal_server_profile_network_interface_count_range_model2
+ assert instance_profile_disk_size_fixed_model == instance_profile_disk_size_fixed_model2
# Convert model instance back to dict and verify no loss of data
- bare_metal_server_profile_network_interface_count_range_model_json2 = bare_metal_server_profile_network_interface_count_range_model.to_dict()
- assert bare_metal_server_profile_network_interface_count_range_model_json2 == bare_metal_server_profile_network_interface_count_range_model_json
+ instance_profile_disk_size_fixed_model_json2 = instance_profile_disk_size_fixed_model.to_dict()
+ assert instance_profile_disk_size_fixed_model_json2 == instance_profile_disk_size_fixed_model_json
-class TestModel_CatalogOfferingIdentityCatalogOfferingByCRN:
+class TestModel_InstanceProfileDiskSizeRange:
"""
- Test Class for CatalogOfferingIdentityCatalogOfferingByCRN
+ Test Class for InstanceProfileDiskSizeRange
"""
- def test_catalog_offering_identity_catalog_offering_by_crn_serialization(self):
+ def test_instance_profile_disk_size_range_serialization(self):
"""
- Test serialization/deserialization for CatalogOfferingIdentityCatalogOfferingByCRN
+ Test serialization/deserialization for InstanceProfileDiskSizeRange
"""
- # Construct a json representation of a CatalogOfferingIdentityCatalogOfferingByCRN model
- catalog_offering_identity_catalog_offering_by_crn_model_json = {}
- catalog_offering_identity_catalog_offering_by_crn_model_json['crn'] = 'crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:offering:00111601-0ec5-41ac-b142-96d1e64e6442'
+ # Construct a json representation of a InstanceProfileDiskSizeRange model
+ instance_profile_disk_size_range_model_json = {}
+ instance_profile_disk_size_range_model_json['default'] = 100
+ instance_profile_disk_size_range_model_json['max'] = 1000
+ instance_profile_disk_size_range_model_json['min'] = 100
+ instance_profile_disk_size_range_model_json['step'] = 10
+ instance_profile_disk_size_range_model_json['type'] = 'range'
- # Construct a model instance of CatalogOfferingIdentityCatalogOfferingByCRN by calling from_dict on the json representation
- catalog_offering_identity_catalog_offering_by_crn_model = CatalogOfferingIdentityCatalogOfferingByCRN.from_dict(catalog_offering_identity_catalog_offering_by_crn_model_json)
- assert catalog_offering_identity_catalog_offering_by_crn_model != False
+ # Construct a model instance of InstanceProfileDiskSizeRange by calling from_dict on the json representation
+ instance_profile_disk_size_range_model = InstanceProfileDiskSizeRange.from_dict(instance_profile_disk_size_range_model_json)
+ assert instance_profile_disk_size_range_model != False
- # Construct a model instance of CatalogOfferingIdentityCatalogOfferingByCRN by calling from_dict on the json representation
- catalog_offering_identity_catalog_offering_by_crn_model_dict = CatalogOfferingIdentityCatalogOfferingByCRN.from_dict(catalog_offering_identity_catalog_offering_by_crn_model_json).__dict__
- catalog_offering_identity_catalog_offering_by_crn_model2 = CatalogOfferingIdentityCatalogOfferingByCRN(**catalog_offering_identity_catalog_offering_by_crn_model_dict)
+ # Construct a model instance of InstanceProfileDiskSizeRange by calling from_dict on the json representation
+ instance_profile_disk_size_range_model_dict = InstanceProfileDiskSizeRange.from_dict(instance_profile_disk_size_range_model_json).__dict__
+ instance_profile_disk_size_range_model2 = InstanceProfileDiskSizeRange(**instance_profile_disk_size_range_model_dict)
# Verify the model instances are equivalent
- assert catalog_offering_identity_catalog_offering_by_crn_model == catalog_offering_identity_catalog_offering_by_crn_model2
+ assert instance_profile_disk_size_range_model == instance_profile_disk_size_range_model2
# Convert model instance back to dict and verify no loss of data
- catalog_offering_identity_catalog_offering_by_crn_model_json2 = catalog_offering_identity_catalog_offering_by_crn_model.to_dict()
- assert catalog_offering_identity_catalog_offering_by_crn_model_json2 == catalog_offering_identity_catalog_offering_by_crn_model_json
+ instance_profile_disk_size_range_model_json2 = instance_profile_disk_size_range_model.to_dict()
+ assert instance_profile_disk_size_range_model_json2 == instance_profile_disk_size_range_model_json
-class TestModel_CatalogOfferingVersionIdentityCatalogOfferingVersionByCRN:
+class TestModel_InstanceProfileGPUDependent:
"""
- Test Class for CatalogOfferingVersionIdentityCatalogOfferingVersionByCRN
+ Test Class for InstanceProfileGPUDependent
"""
- def test_catalog_offering_version_identity_catalog_offering_version_by_crn_serialization(self):
+ def test_instance_profile_gpu_dependent_serialization(self):
"""
- Test serialization/deserialization for CatalogOfferingVersionIdentityCatalogOfferingVersionByCRN
+ Test serialization/deserialization for InstanceProfileGPUDependent
"""
- # Construct a json representation of a CatalogOfferingVersionIdentityCatalogOfferingVersionByCRN model
- catalog_offering_version_identity_catalog_offering_version_by_crn_model_json = {}
- catalog_offering_version_identity_catalog_offering_version_by_crn_model_json['crn'] = 'crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d'
+ # Construct a json representation of a InstanceProfileGPUDependent model
+ instance_profile_gpu_dependent_model_json = {}
+ instance_profile_gpu_dependent_model_json['type'] = 'dependent'
- # Construct a model instance of CatalogOfferingVersionIdentityCatalogOfferingVersionByCRN by calling from_dict on the json representation
- catalog_offering_version_identity_catalog_offering_version_by_crn_model = CatalogOfferingVersionIdentityCatalogOfferingVersionByCRN.from_dict(catalog_offering_version_identity_catalog_offering_version_by_crn_model_json)
- assert catalog_offering_version_identity_catalog_offering_version_by_crn_model != False
+ # Construct a model instance of InstanceProfileGPUDependent by calling from_dict on the json representation
+ instance_profile_gpu_dependent_model = InstanceProfileGPUDependent.from_dict(instance_profile_gpu_dependent_model_json)
+ assert instance_profile_gpu_dependent_model != False
- # Construct a model instance of CatalogOfferingVersionIdentityCatalogOfferingVersionByCRN by calling from_dict on the json representation
- catalog_offering_version_identity_catalog_offering_version_by_crn_model_dict = CatalogOfferingVersionIdentityCatalogOfferingVersionByCRN.from_dict(catalog_offering_version_identity_catalog_offering_version_by_crn_model_json).__dict__
- catalog_offering_version_identity_catalog_offering_version_by_crn_model2 = CatalogOfferingVersionIdentityCatalogOfferingVersionByCRN(**catalog_offering_version_identity_catalog_offering_version_by_crn_model_dict)
+ # Construct a model instance of InstanceProfileGPUDependent by calling from_dict on the json representation
+ instance_profile_gpu_dependent_model_dict = InstanceProfileGPUDependent.from_dict(instance_profile_gpu_dependent_model_json).__dict__
+ instance_profile_gpu_dependent_model2 = InstanceProfileGPUDependent(**instance_profile_gpu_dependent_model_dict)
# Verify the model instances are equivalent
- assert catalog_offering_version_identity_catalog_offering_version_by_crn_model == catalog_offering_version_identity_catalog_offering_version_by_crn_model2
+ assert instance_profile_gpu_dependent_model == instance_profile_gpu_dependent_model2
# Convert model instance back to dict and verify no loss of data
- catalog_offering_version_identity_catalog_offering_version_by_crn_model_json2 = catalog_offering_version_identity_catalog_offering_version_by_crn_model.to_dict()
- assert catalog_offering_version_identity_catalog_offering_version_by_crn_model_json2 == catalog_offering_version_identity_catalog_offering_version_by_crn_model_json
+ instance_profile_gpu_dependent_model_json2 = instance_profile_gpu_dependent_model.to_dict()
+ assert instance_profile_gpu_dependent_model_json2 == instance_profile_gpu_dependent_model_json
-class TestModel_CertificateInstanceIdentityByCRN:
+class TestModel_InstanceProfileGPUEnum:
"""
- Test Class for CertificateInstanceIdentityByCRN
+ Test Class for InstanceProfileGPUEnum
"""
- def test_certificate_instance_identity_by_crn_serialization(self):
+ def test_instance_profile_gpu_enum_serialization(self):
"""
- Test serialization/deserialization for CertificateInstanceIdentityByCRN
+ Test serialization/deserialization for InstanceProfileGPUEnum
"""
- # Construct a json representation of a CertificateInstanceIdentityByCRN model
- certificate_instance_identity_by_crn_model_json = {}
- certificate_instance_identity_by_crn_model_json['crn'] = 'crn:v1:bluemix:public:secrets-manager:us-south:a/123456:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5'
+ # Construct a json representation of a InstanceProfileGPUEnum model
+ instance_profile_gpu_enum_model_json = {}
+ instance_profile_gpu_enum_model_json['default'] = 38
+ instance_profile_gpu_enum_model_json['type'] = 'enum'
+ instance_profile_gpu_enum_model_json['values'] = [2, 4]
- # Construct a model instance of CertificateInstanceIdentityByCRN by calling from_dict on the json representation
- certificate_instance_identity_by_crn_model = CertificateInstanceIdentityByCRN.from_dict(certificate_instance_identity_by_crn_model_json)
- assert certificate_instance_identity_by_crn_model != False
+ # Construct a model instance of InstanceProfileGPUEnum by calling from_dict on the json representation
+ instance_profile_gpu_enum_model = InstanceProfileGPUEnum.from_dict(instance_profile_gpu_enum_model_json)
+ assert instance_profile_gpu_enum_model != False
- # Construct a model instance of CertificateInstanceIdentityByCRN by calling from_dict on the json representation
- certificate_instance_identity_by_crn_model_dict = CertificateInstanceIdentityByCRN.from_dict(certificate_instance_identity_by_crn_model_json).__dict__
- certificate_instance_identity_by_crn_model2 = CertificateInstanceIdentityByCRN(**certificate_instance_identity_by_crn_model_dict)
+ # Construct a model instance of InstanceProfileGPUEnum by calling from_dict on the json representation
+ instance_profile_gpu_enum_model_dict = InstanceProfileGPUEnum.from_dict(instance_profile_gpu_enum_model_json).__dict__
+ instance_profile_gpu_enum_model2 = InstanceProfileGPUEnum(**instance_profile_gpu_enum_model_dict)
# Verify the model instances are equivalent
- assert certificate_instance_identity_by_crn_model == certificate_instance_identity_by_crn_model2
+ assert instance_profile_gpu_enum_model == instance_profile_gpu_enum_model2
# Convert model instance back to dict and verify no loss of data
- certificate_instance_identity_by_crn_model_json2 = certificate_instance_identity_by_crn_model.to_dict()
- assert certificate_instance_identity_by_crn_model_json2 == certificate_instance_identity_by_crn_model_json
+ instance_profile_gpu_enum_model_json2 = instance_profile_gpu_enum_model.to_dict()
+ assert instance_profile_gpu_enum_model_json2 == instance_profile_gpu_enum_model_json
-class TestModel_CloudObjectStorageBucketIdentityByCRN:
+class TestModel_InstanceProfileGPUFixed:
"""
- Test Class for CloudObjectStorageBucketIdentityByCRN
+ Test Class for InstanceProfileGPUFixed
"""
- def test_cloud_object_storage_bucket_identity_by_crn_serialization(self):
+ def test_instance_profile_gpu_fixed_serialization(self):
"""
- Test serialization/deserialization for CloudObjectStorageBucketIdentityByCRN
+ Test serialization/deserialization for InstanceProfileGPUFixed
"""
- # Construct a json representation of a CloudObjectStorageBucketIdentityByCRN model
- cloud_object_storage_bucket_identity_by_crn_model_json = {}
- cloud_object_storage_bucket_identity_by_crn_model_json['crn'] = 'crn:v1:bluemix:public:cloud-object-storage:global:a/123456:1a0ec336-f391-4091-a6fb-5e084a4c56f4:bucket:my-bucket'
+ # Construct a json representation of a InstanceProfileGPUFixed model
+ instance_profile_gpu_fixed_model_json = {}
+ instance_profile_gpu_fixed_model_json['type'] = 'fixed'
+ instance_profile_gpu_fixed_model_json['value'] = 2
- # Construct a model instance of CloudObjectStorageBucketIdentityByCRN by calling from_dict on the json representation
- cloud_object_storage_bucket_identity_by_crn_model = CloudObjectStorageBucketIdentityByCRN.from_dict(cloud_object_storage_bucket_identity_by_crn_model_json)
- assert cloud_object_storage_bucket_identity_by_crn_model != False
+ # Construct a model instance of InstanceProfileGPUFixed by calling from_dict on the json representation
+ instance_profile_gpu_fixed_model = InstanceProfileGPUFixed.from_dict(instance_profile_gpu_fixed_model_json)
+ assert instance_profile_gpu_fixed_model != False
- # Construct a model instance of CloudObjectStorageBucketIdentityByCRN by calling from_dict on the json representation
- cloud_object_storage_bucket_identity_by_crn_model_dict = CloudObjectStorageBucketIdentityByCRN.from_dict(cloud_object_storage_bucket_identity_by_crn_model_json).__dict__
- cloud_object_storage_bucket_identity_by_crn_model2 = CloudObjectStorageBucketIdentityByCRN(**cloud_object_storage_bucket_identity_by_crn_model_dict)
+ # Construct a model instance of InstanceProfileGPUFixed by calling from_dict on the json representation
+ instance_profile_gpu_fixed_model_dict = InstanceProfileGPUFixed.from_dict(instance_profile_gpu_fixed_model_json).__dict__
+ instance_profile_gpu_fixed_model2 = InstanceProfileGPUFixed(**instance_profile_gpu_fixed_model_dict)
# Verify the model instances are equivalent
- assert cloud_object_storage_bucket_identity_by_crn_model == cloud_object_storage_bucket_identity_by_crn_model2
+ assert instance_profile_gpu_fixed_model == instance_profile_gpu_fixed_model2
# Convert model instance back to dict and verify no loss of data
- cloud_object_storage_bucket_identity_by_crn_model_json2 = cloud_object_storage_bucket_identity_by_crn_model.to_dict()
- assert cloud_object_storage_bucket_identity_by_crn_model_json2 == cloud_object_storage_bucket_identity_by_crn_model_json
+ instance_profile_gpu_fixed_model_json2 = instance_profile_gpu_fixed_model.to_dict()
+ assert instance_profile_gpu_fixed_model_json2 == instance_profile_gpu_fixed_model_json
-class TestModel_CloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName:
+class TestModel_InstanceProfileGPUMemoryDependent:
"""
- Test Class for CloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName
+ Test Class for InstanceProfileGPUMemoryDependent
"""
- def test_cloud_object_storage_bucket_identity_cloud_object_storage_bucket_identity_by_name_serialization(self):
+ def test_instance_profile_gpu_memory_dependent_serialization(self):
"""
- Test serialization/deserialization for CloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName
+ Test serialization/deserialization for InstanceProfileGPUMemoryDependent
"""
- # Construct a json representation of a CloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName model
- cloud_object_storage_bucket_identity_cloud_object_storage_bucket_identity_by_name_model_json = {}
- cloud_object_storage_bucket_identity_cloud_object_storage_bucket_identity_by_name_model_json['name'] = 'bucket-27200-lwx4cfvcue'
+ # Construct a json representation of a InstanceProfileGPUMemoryDependent model
+ instance_profile_gpu_memory_dependent_model_json = {}
+ instance_profile_gpu_memory_dependent_model_json['type'] = 'dependent'
- # Construct a model instance of CloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName by calling from_dict on the json representation
- cloud_object_storage_bucket_identity_cloud_object_storage_bucket_identity_by_name_model = CloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName.from_dict(cloud_object_storage_bucket_identity_cloud_object_storage_bucket_identity_by_name_model_json)
- assert cloud_object_storage_bucket_identity_cloud_object_storage_bucket_identity_by_name_model != False
+ # Construct a model instance of InstanceProfileGPUMemoryDependent by calling from_dict on the json representation
+ instance_profile_gpu_memory_dependent_model = InstanceProfileGPUMemoryDependent.from_dict(instance_profile_gpu_memory_dependent_model_json)
+ assert instance_profile_gpu_memory_dependent_model != False
- # Construct a model instance of CloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName by calling from_dict on the json representation
- cloud_object_storage_bucket_identity_cloud_object_storage_bucket_identity_by_name_model_dict = CloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName.from_dict(cloud_object_storage_bucket_identity_cloud_object_storage_bucket_identity_by_name_model_json).__dict__
- cloud_object_storage_bucket_identity_cloud_object_storage_bucket_identity_by_name_model2 = CloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName(**cloud_object_storage_bucket_identity_cloud_object_storage_bucket_identity_by_name_model_dict)
+ # Construct a model instance of InstanceProfileGPUMemoryDependent by calling from_dict on the json representation
+ instance_profile_gpu_memory_dependent_model_dict = InstanceProfileGPUMemoryDependent.from_dict(instance_profile_gpu_memory_dependent_model_json).__dict__
+ instance_profile_gpu_memory_dependent_model2 = InstanceProfileGPUMemoryDependent(**instance_profile_gpu_memory_dependent_model_dict)
# Verify the model instances are equivalent
- assert cloud_object_storage_bucket_identity_cloud_object_storage_bucket_identity_by_name_model == cloud_object_storage_bucket_identity_cloud_object_storage_bucket_identity_by_name_model2
+ assert instance_profile_gpu_memory_dependent_model == instance_profile_gpu_memory_dependent_model2
# Convert model instance back to dict and verify no loss of data
- cloud_object_storage_bucket_identity_cloud_object_storage_bucket_identity_by_name_model_json2 = cloud_object_storage_bucket_identity_cloud_object_storage_bucket_identity_by_name_model.to_dict()
- assert cloud_object_storage_bucket_identity_cloud_object_storage_bucket_identity_by_name_model_json2 == cloud_object_storage_bucket_identity_cloud_object_storage_bucket_identity_by_name_model_json
+ instance_profile_gpu_memory_dependent_model_json2 = instance_profile_gpu_memory_dependent_model.to_dict()
+ assert instance_profile_gpu_memory_dependent_model_json2 == instance_profile_gpu_memory_dependent_model_json
-class TestModel_DNSInstanceIdentityByCRN:
+class TestModel_InstanceProfileGPUMemoryEnum:
"""
- Test Class for DNSInstanceIdentityByCRN
+ Test Class for InstanceProfileGPUMemoryEnum
"""
- def test_dns_instance_identity_by_crn_serialization(self):
+ def test_instance_profile_gpu_memory_enum_serialization(self):
"""
- Test serialization/deserialization for DNSInstanceIdentityByCRN
+ Test serialization/deserialization for InstanceProfileGPUMemoryEnum
"""
- # Construct a json representation of a DNSInstanceIdentityByCRN model
- dns_instance_identity_by_crn_model_json = {}
- dns_instance_identity_by_crn_model_json['crn'] = 'crn:v1:bluemix:public:dns-svcs:global:a/123456:6860c359-b2e2-46fa-a944-b38c28201c6e'
+ # Construct a json representation of a InstanceProfileGPUMemoryEnum model
+ instance_profile_gpu_memory_enum_model_json = {}
+ instance_profile_gpu_memory_enum_model_json['default'] = 38
+ instance_profile_gpu_memory_enum_model_json['type'] = 'enum'
+ instance_profile_gpu_memory_enum_model_json['values'] = [16, 32]
- # Construct a model instance of DNSInstanceIdentityByCRN by calling from_dict on the json representation
- dns_instance_identity_by_crn_model = DNSInstanceIdentityByCRN.from_dict(dns_instance_identity_by_crn_model_json)
- assert dns_instance_identity_by_crn_model != False
+ # Construct a model instance of InstanceProfileGPUMemoryEnum by calling from_dict on the json representation
+ instance_profile_gpu_memory_enum_model = InstanceProfileGPUMemoryEnum.from_dict(instance_profile_gpu_memory_enum_model_json)
+ assert instance_profile_gpu_memory_enum_model != False
- # Construct a model instance of DNSInstanceIdentityByCRN by calling from_dict on the json representation
- dns_instance_identity_by_crn_model_dict = DNSInstanceIdentityByCRN.from_dict(dns_instance_identity_by_crn_model_json).__dict__
- dns_instance_identity_by_crn_model2 = DNSInstanceIdentityByCRN(**dns_instance_identity_by_crn_model_dict)
+ # Construct a model instance of InstanceProfileGPUMemoryEnum by calling from_dict on the json representation
+ instance_profile_gpu_memory_enum_model_dict = InstanceProfileGPUMemoryEnum.from_dict(instance_profile_gpu_memory_enum_model_json).__dict__
+ instance_profile_gpu_memory_enum_model2 = InstanceProfileGPUMemoryEnum(**instance_profile_gpu_memory_enum_model_dict)
# Verify the model instances are equivalent
- assert dns_instance_identity_by_crn_model == dns_instance_identity_by_crn_model2
+ assert instance_profile_gpu_memory_enum_model == instance_profile_gpu_memory_enum_model2
# Convert model instance back to dict and verify no loss of data
- dns_instance_identity_by_crn_model_json2 = dns_instance_identity_by_crn_model.to_dict()
- assert dns_instance_identity_by_crn_model_json2 == dns_instance_identity_by_crn_model_json
+ instance_profile_gpu_memory_enum_model_json2 = instance_profile_gpu_memory_enum_model.to_dict()
+ assert instance_profile_gpu_memory_enum_model_json2 == instance_profile_gpu_memory_enum_model_json
-class TestModel_DNSZoneIdentityById:
+class TestModel_InstanceProfileGPUMemoryFixed:
"""
- Test Class for DNSZoneIdentityById
+ Test Class for InstanceProfileGPUMemoryFixed
"""
- def test_dns_zone_identity_by_id_serialization(self):
+ def test_instance_profile_gpu_memory_fixed_serialization(self):
"""
- Test serialization/deserialization for DNSZoneIdentityById
+ Test serialization/deserialization for InstanceProfileGPUMemoryFixed
"""
- # Construct a json representation of a DNSZoneIdentityById model
- dns_zone_identity_by_id_model_json = {}
- dns_zone_identity_by_id_model_json['id'] = 'd66662cc-aa23-4fe1-9987-858487a61f45'
-
- # Construct a model instance of DNSZoneIdentityById by calling from_dict on the json representation
- dns_zone_identity_by_id_model = DNSZoneIdentityById.from_dict(dns_zone_identity_by_id_model_json)
- assert dns_zone_identity_by_id_model != False
+ # Construct a json representation of a InstanceProfileGPUMemoryFixed model
+ instance_profile_gpu_memory_fixed_model_json = {}
+ instance_profile_gpu_memory_fixed_model_json['type'] = 'fixed'
+ instance_profile_gpu_memory_fixed_model_json['value'] = 16
- # Construct a model instance of DNSZoneIdentityById by calling from_dict on the json representation
- dns_zone_identity_by_id_model_dict = DNSZoneIdentityById.from_dict(dns_zone_identity_by_id_model_json).__dict__
- dns_zone_identity_by_id_model2 = DNSZoneIdentityById(**dns_zone_identity_by_id_model_dict)
+ # Construct a model instance of InstanceProfileGPUMemoryFixed by calling from_dict on the json representation
+ instance_profile_gpu_memory_fixed_model = InstanceProfileGPUMemoryFixed.from_dict(instance_profile_gpu_memory_fixed_model_json)
+ assert instance_profile_gpu_memory_fixed_model != False
+
+ # Construct a model instance of InstanceProfileGPUMemoryFixed by calling from_dict on the json representation
+ instance_profile_gpu_memory_fixed_model_dict = InstanceProfileGPUMemoryFixed.from_dict(instance_profile_gpu_memory_fixed_model_json).__dict__
+ instance_profile_gpu_memory_fixed_model2 = InstanceProfileGPUMemoryFixed(**instance_profile_gpu_memory_fixed_model_dict)
# Verify the model instances are equivalent
- assert dns_zone_identity_by_id_model == dns_zone_identity_by_id_model2
+ assert instance_profile_gpu_memory_fixed_model == instance_profile_gpu_memory_fixed_model2
# Convert model instance back to dict and verify no loss of data
- dns_zone_identity_by_id_model_json2 = dns_zone_identity_by_id_model.to_dict()
- assert dns_zone_identity_by_id_model_json2 == dns_zone_identity_by_id_model_json
+ instance_profile_gpu_memory_fixed_model_json2 = instance_profile_gpu_memory_fixed_model.to_dict()
+ assert instance_profile_gpu_memory_fixed_model_json2 == instance_profile_gpu_memory_fixed_model_json
-class TestModel_DedicatedHostGroupIdentityByCRN:
+class TestModel_InstanceProfileGPUMemoryRange:
"""
- Test Class for DedicatedHostGroupIdentityByCRN
+ Test Class for InstanceProfileGPUMemoryRange
"""
- def test_dedicated_host_group_identity_by_crn_serialization(self):
+ def test_instance_profile_gpu_memory_range_serialization(self):
"""
- Test serialization/deserialization for DedicatedHostGroupIdentityByCRN
+ Test serialization/deserialization for InstanceProfileGPUMemoryRange
"""
- # Construct a json representation of a DedicatedHostGroupIdentityByCRN model
- dedicated_host_group_identity_by_crn_model_json = {}
- 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 json representation of a InstanceProfileGPUMemoryRange model
+ instance_profile_gpu_memory_range_model_json = {}
+ instance_profile_gpu_memory_range_model_json['default'] = 16
+ instance_profile_gpu_memory_range_model_json['max'] = 32
+ instance_profile_gpu_memory_range_model_json['min'] = 8
+ instance_profile_gpu_memory_range_model_json['step'] = 8
+ instance_profile_gpu_memory_range_model_json['type'] = 'range'
- # Construct a model instance of DedicatedHostGroupIdentityByCRN by calling from_dict on the json representation
- dedicated_host_group_identity_by_crn_model = DedicatedHostGroupIdentityByCRN.from_dict(dedicated_host_group_identity_by_crn_model_json)
- assert dedicated_host_group_identity_by_crn_model != False
+ # Construct a model instance of InstanceProfileGPUMemoryRange by calling from_dict on the json representation
+ instance_profile_gpu_memory_range_model = InstanceProfileGPUMemoryRange.from_dict(instance_profile_gpu_memory_range_model_json)
+ assert instance_profile_gpu_memory_range_model != False
- # Construct a model instance of DedicatedHostGroupIdentityByCRN by calling from_dict on the json representation
- dedicated_host_group_identity_by_crn_model_dict = DedicatedHostGroupIdentityByCRN.from_dict(dedicated_host_group_identity_by_crn_model_json).__dict__
- dedicated_host_group_identity_by_crn_model2 = DedicatedHostGroupIdentityByCRN(**dedicated_host_group_identity_by_crn_model_dict)
+ # Construct a model instance of InstanceProfileGPUMemoryRange by calling from_dict on the json representation
+ instance_profile_gpu_memory_range_model_dict = InstanceProfileGPUMemoryRange.from_dict(instance_profile_gpu_memory_range_model_json).__dict__
+ instance_profile_gpu_memory_range_model2 = InstanceProfileGPUMemoryRange(**instance_profile_gpu_memory_range_model_dict)
# Verify the model instances are equivalent
- assert dedicated_host_group_identity_by_crn_model == dedicated_host_group_identity_by_crn_model2
+ assert instance_profile_gpu_memory_range_model == instance_profile_gpu_memory_range_model2
# Convert model instance back to dict and verify no loss of data
- dedicated_host_group_identity_by_crn_model_json2 = dedicated_host_group_identity_by_crn_model.to_dict()
- assert dedicated_host_group_identity_by_crn_model_json2 == dedicated_host_group_identity_by_crn_model_json
+ instance_profile_gpu_memory_range_model_json2 = instance_profile_gpu_memory_range_model.to_dict()
+ assert instance_profile_gpu_memory_range_model_json2 == instance_profile_gpu_memory_range_model_json
-class TestModel_DedicatedHostGroupIdentityByHref:
+class TestModel_InstanceProfileGPURange:
"""
- Test Class for DedicatedHostGroupIdentityByHref
+ Test Class for InstanceProfileGPURange
"""
- def test_dedicated_host_group_identity_by_href_serialization(self):
+ def test_instance_profile_gpu_range_serialization(self):
"""
- Test serialization/deserialization for DedicatedHostGroupIdentityByHref
+ Test serialization/deserialization for InstanceProfileGPURange
"""
- # Construct a json representation of a DedicatedHostGroupIdentityByHref model
- dedicated_host_group_identity_by_href_model_json = {}
- 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 json representation of a InstanceProfileGPURange model
+ instance_profile_gpu_range_model_json = {}
+ instance_profile_gpu_range_model_json['default'] = 2
+ instance_profile_gpu_range_model_json['max'] = 4
+ instance_profile_gpu_range_model_json['min'] = 1
+ instance_profile_gpu_range_model_json['step'] = 1
+ instance_profile_gpu_range_model_json['type'] = 'range'
- # Construct a model instance of DedicatedHostGroupIdentityByHref by calling from_dict on the json representation
- dedicated_host_group_identity_by_href_model = DedicatedHostGroupIdentityByHref.from_dict(dedicated_host_group_identity_by_href_model_json)
- assert dedicated_host_group_identity_by_href_model != False
+ # Construct a model instance of InstanceProfileGPURange by calling from_dict on the json representation
+ instance_profile_gpu_range_model = InstanceProfileGPURange.from_dict(instance_profile_gpu_range_model_json)
+ assert instance_profile_gpu_range_model != False
- # Construct a model instance of DedicatedHostGroupIdentityByHref by calling from_dict on the json representation
- dedicated_host_group_identity_by_href_model_dict = DedicatedHostGroupIdentityByHref.from_dict(dedicated_host_group_identity_by_href_model_json).__dict__
- dedicated_host_group_identity_by_href_model2 = DedicatedHostGroupIdentityByHref(**dedicated_host_group_identity_by_href_model_dict)
+ # Construct a model instance of InstanceProfileGPURange by calling from_dict on the json representation
+ instance_profile_gpu_range_model_dict = InstanceProfileGPURange.from_dict(instance_profile_gpu_range_model_json).__dict__
+ instance_profile_gpu_range_model2 = InstanceProfileGPURange(**instance_profile_gpu_range_model_dict)
# Verify the model instances are equivalent
- assert dedicated_host_group_identity_by_href_model == dedicated_host_group_identity_by_href_model2
+ assert instance_profile_gpu_range_model == instance_profile_gpu_range_model2
# Convert model instance back to dict and verify no loss of data
- dedicated_host_group_identity_by_href_model_json2 = dedicated_host_group_identity_by_href_model.to_dict()
- assert dedicated_host_group_identity_by_href_model_json2 == dedicated_host_group_identity_by_href_model_json
+ instance_profile_gpu_range_model_json2 = instance_profile_gpu_range_model.to_dict()
+ assert instance_profile_gpu_range_model_json2 == instance_profile_gpu_range_model_json
-class TestModel_DedicatedHostGroupIdentityById:
+class TestModel_InstanceProfileIdentityByHref:
"""
- Test Class for DedicatedHostGroupIdentityById
+ Test Class for InstanceProfileIdentityByHref
"""
- def test_dedicated_host_group_identity_by_id_serialization(self):
+ def test_instance_profile_identity_by_href_serialization(self):
"""
- Test serialization/deserialization for DedicatedHostGroupIdentityById
+ Test serialization/deserialization for InstanceProfileIdentityByHref
"""
- # Construct a json representation of a DedicatedHostGroupIdentityById model
- dedicated_host_group_identity_by_id_model_json = {}
- dedicated_host_group_identity_by_id_model_json['id'] = 'bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0'
+ # Construct a json representation of a InstanceProfileIdentityByHref model
+ instance_profile_identity_by_href_model_json = {}
+ instance_profile_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16'
- # Construct a model instance of DedicatedHostGroupIdentityById by calling from_dict on the json representation
- dedicated_host_group_identity_by_id_model = DedicatedHostGroupIdentityById.from_dict(dedicated_host_group_identity_by_id_model_json)
- assert dedicated_host_group_identity_by_id_model != False
+ # Construct a model instance of InstanceProfileIdentityByHref by calling from_dict on the json representation
+ instance_profile_identity_by_href_model = InstanceProfileIdentityByHref.from_dict(instance_profile_identity_by_href_model_json)
+ assert instance_profile_identity_by_href_model != False
- # Construct a model instance of DedicatedHostGroupIdentityById by calling from_dict on the json representation
- dedicated_host_group_identity_by_id_model_dict = DedicatedHostGroupIdentityById.from_dict(dedicated_host_group_identity_by_id_model_json).__dict__
- dedicated_host_group_identity_by_id_model2 = DedicatedHostGroupIdentityById(**dedicated_host_group_identity_by_id_model_dict)
+ # Construct a model instance of InstanceProfileIdentityByHref by calling from_dict on the json representation
+ instance_profile_identity_by_href_model_dict = InstanceProfileIdentityByHref.from_dict(instance_profile_identity_by_href_model_json).__dict__
+ instance_profile_identity_by_href_model2 = InstanceProfileIdentityByHref(**instance_profile_identity_by_href_model_dict)
# Verify the model instances are equivalent
- assert dedicated_host_group_identity_by_id_model == dedicated_host_group_identity_by_id_model2
+ assert instance_profile_identity_by_href_model == instance_profile_identity_by_href_model2
# Convert model instance back to dict and verify no loss of data
- dedicated_host_group_identity_by_id_model_json2 = dedicated_host_group_identity_by_id_model.to_dict()
- assert dedicated_host_group_identity_by_id_model_json2 == dedicated_host_group_identity_by_id_model_json
+ instance_profile_identity_by_href_model_json2 = instance_profile_identity_by_href_model.to_dict()
+ assert instance_profile_identity_by_href_model_json2 == instance_profile_identity_by_href_model_json
-class TestModel_DedicatedHostProfileIdentityByHref:
+class TestModel_InstanceProfileIdentityByName:
"""
- Test Class for DedicatedHostProfileIdentityByHref
+ Test Class for InstanceProfileIdentityByName
"""
- def test_dedicated_host_profile_identity_by_href_serialization(self):
+ def test_instance_profile_identity_by_name_serialization(self):
"""
- Test serialization/deserialization for DedicatedHostProfileIdentityByHref
+ Test serialization/deserialization for InstanceProfileIdentityByName
"""
- # Construct a json representation of a DedicatedHostProfileIdentityByHref model
- dedicated_host_profile_identity_by_href_model_json = {}
- dedicated_host_profile_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/profiles/mx2-host-152x1216'
+ # Construct a json representation of a InstanceProfileIdentityByName model
+ instance_profile_identity_by_name_model_json = {}
+ instance_profile_identity_by_name_model_json['name'] = 'bx2-4x16'
- # Construct a model instance of DedicatedHostProfileIdentityByHref by calling from_dict on the json representation
- dedicated_host_profile_identity_by_href_model = DedicatedHostProfileIdentityByHref.from_dict(dedicated_host_profile_identity_by_href_model_json)
- assert dedicated_host_profile_identity_by_href_model != False
+ # Construct a model instance of InstanceProfileIdentityByName by calling from_dict on the json representation
+ instance_profile_identity_by_name_model = InstanceProfileIdentityByName.from_dict(instance_profile_identity_by_name_model_json)
+ assert instance_profile_identity_by_name_model != False
- # Construct a model instance of DedicatedHostProfileIdentityByHref by calling from_dict on the json representation
- dedicated_host_profile_identity_by_href_model_dict = DedicatedHostProfileIdentityByHref.from_dict(dedicated_host_profile_identity_by_href_model_json).__dict__
- dedicated_host_profile_identity_by_href_model2 = DedicatedHostProfileIdentityByHref(**dedicated_host_profile_identity_by_href_model_dict)
+ # Construct a model instance of InstanceProfileIdentityByName by calling from_dict on the json representation
+ instance_profile_identity_by_name_model_dict = InstanceProfileIdentityByName.from_dict(instance_profile_identity_by_name_model_json).__dict__
+ instance_profile_identity_by_name_model2 = InstanceProfileIdentityByName(**instance_profile_identity_by_name_model_dict)
# Verify the model instances are equivalent
- assert dedicated_host_profile_identity_by_href_model == dedicated_host_profile_identity_by_href_model2
+ assert instance_profile_identity_by_name_model == instance_profile_identity_by_name_model2
# Convert model instance back to dict and verify no loss of data
- dedicated_host_profile_identity_by_href_model_json2 = dedicated_host_profile_identity_by_href_model.to_dict()
- assert dedicated_host_profile_identity_by_href_model_json2 == dedicated_host_profile_identity_by_href_model_json
+ instance_profile_identity_by_name_model_json2 = instance_profile_identity_by_name_model.to_dict()
+ assert instance_profile_identity_by_name_model_json2 == instance_profile_identity_by_name_model_json
-class TestModel_DedicatedHostProfileIdentityByName:
+class TestModel_InstanceProfileMemoryDependent:
"""
- Test Class for DedicatedHostProfileIdentityByName
+ Test Class for InstanceProfileMemoryDependent
"""
- def test_dedicated_host_profile_identity_by_name_serialization(self):
+ def test_instance_profile_memory_dependent_serialization(self):
"""
- Test serialization/deserialization for DedicatedHostProfileIdentityByName
+ Test serialization/deserialization for InstanceProfileMemoryDependent
"""
- # Construct a json representation of a DedicatedHostProfileIdentityByName model
- dedicated_host_profile_identity_by_name_model_json = {}
- dedicated_host_profile_identity_by_name_model_json['name'] = 'mx2-host-152x1216'
+ # Construct a json representation of a InstanceProfileMemoryDependent model
+ instance_profile_memory_dependent_model_json = {}
+ instance_profile_memory_dependent_model_json['type'] = 'dependent'
- # Construct a model instance of DedicatedHostProfileIdentityByName by calling from_dict on the json representation
- dedicated_host_profile_identity_by_name_model = DedicatedHostProfileIdentityByName.from_dict(dedicated_host_profile_identity_by_name_model_json)
- assert dedicated_host_profile_identity_by_name_model != False
+ # Construct a model instance of InstanceProfileMemoryDependent by calling from_dict on the json representation
+ instance_profile_memory_dependent_model = InstanceProfileMemoryDependent.from_dict(instance_profile_memory_dependent_model_json)
+ assert instance_profile_memory_dependent_model != False
- # Construct a model instance of DedicatedHostProfileIdentityByName by calling from_dict on the json representation
- dedicated_host_profile_identity_by_name_model_dict = DedicatedHostProfileIdentityByName.from_dict(dedicated_host_profile_identity_by_name_model_json).__dict__
- dedicated_host_profile_identity_by_name_model2 = DedicatedHostProfileIdentityByName(**dedicated_host_profile_identity_by_name_model_dict)
+ # Construct a model instance of InstanceProfileMemoryDependent by calling from_dict on the json representation
+ instance_profile_memory_dependent_model_dict = InstanceProfileMemoryDependent.from_dict(instance_profile_memory_dependent_model_json).__dict__
+ instance_profile_memory_dependent_model2 = InstanceProfileMemoryDependent(**instance_profile_memory_dependent_model_dict)
# Verify the model instances are equivalent
- assert dedicated_host_profile_identity_by_name_model == dedicated_host_profile_identity_by_name_model2
+ assert instance_profile_memory_dependent_model == instance_profile_memory_dependent_model2
# Convert model instance back to dict and verify no loss of data
- dedicated_host_profile_identity_by_name_model_json2 = dedicated_host_profile_identity_by_name_model.to_dict()
- assert dedicated_host_profile_identity_by_name_model_json2 == dedicated_host_profile_identity_by_name_model_json
+ instance_profile_memory_dependent_model_json2 = instance_profile_memory_dependent_model.to_dict()
+ assert instance_profile_memory_dependent_model_json2 == instance_profile_memory_dependent_model_json
-class TestModel_DedicatedHostProfileMemoryDependent:
+class TestModel_InstanceProfileMemoryEnum:
"""
- Test Class for DedicatedHostProfileMemoryDependent
+ Test Class for InstanceProfileMemoryEnum
"""
- def test_dedicated_host_profile_memory_dependent_serialization(self):
+ def test_instance_profile_memory_enum_serialization(self):
"""
- Test serialization/deserialization for DedicatedHostProfileMemoryDependent
+ Test serialization/deserialization for InstanceProfileMemoryEnum
"""
- # Construct a json representation of a DedicatedHostProfileMemoryDependent model
- dedicated_host_profile_memory_dependent_model_json = {}
- dedicated_host_profile_memory_dependent_model_json['type'] = 'dependent'
+ # Construct a json representation of a InstanceProfileMemoryEnum model
+ instance_profile_memory_enum_model_json = {}
+ instance_profile_memory_enum_model_json['default'] = 38
+ instance_profile_memory_enum_model_json['type'] = 'enum'
+ instance_profile_memory_enum_model_json['values'] = [8, 16, 32]
- # Construct a model instance of DedicatedHostProfileMemoryDependent by calling from_dict on the json representation
- dedicated_host_profile_memory_dependent_model = DedicatedHostProfileMemoryDependent.from_dict(dedicated_host_profile_memory_dependent_model_json)
- assert dedicated_host_profile_memory_dependent_model != False
+ # Construct a model instance of InstanceProfileMemoryEnum by calling from_dict on the json representation
+ instance_profile_memory_enum_model = InstanceProfileMemoryEnum.from_dict(instance_profile_memory_enum_model_json)
+ assert instance_profile_memory_enum_model != False
- # Construct a model instance of DedicatedHostProfileMemoryDependent by calling from_dict on the json representation
- dedicated_host_profile_memory_dependent_model_dict = DedicatedHostProfileMemoryDependent.from_dict(dedicated_host_profile_memory_dependent_model_json).__dict__
- dedicated_host_profile_memory_dependent_model2 = DedicatedHostProfileMemoryDependent(**dedicated_host_profile_memory_dependent_model_dict)
+ # Construct a model instance of InstanceProfileMemoryEnum by calling from_dict on the json representation
+ instance_profile_memory_enum_model_dict = InstanceProfileMemoryEnum.from_dict(instance_profile_memory_enum_model_json).__dict__
+ instance_profile_memory_enum_model2 = InstanceProfileMemoryEnum(**instance_profile_memory_enum_model_dict)
# Verify the model instances are equivalent
- assert dedicated_host_profile_memory_dependent_model == dedicated_host_profile_memory_dependent_model2
+ assert instance_profile_memory_enum_model == instance_profile_memory_enum_model2
# Convert model instance back to dict and verify no loss of data
- dedicated_host_profile_memory_dependent_model_json2 = dedicated_host_profile_memory_dependent_model.to_dict()
- assert dedicated_host_profile_memory_dependent_model_json2 == dedicated_host_profile_memory_dependent_model_json
+ instance_profile_memory_enum_model_json2 = instance_profile_memory_enum_model.to_dict()
+ assert instance_profile_memory_enum_model_json2 == instance_profile_memory_enum_model_json
-class TestModel_DedicatedHostProfileMemoryEnum:
+class TestModel_InstanceProfileMemoryFixed:
"""
- Test Class for DedicatedHostProfileMemoryEnum
+ Test Class for InstanceProfileMemoryFixed
"""
- def test_dedicated_host_profile_memory_enum_serialization(self):
+ def test_instance_profile_memory_fixed_serialization(self):
"""
- Test serialization/deserialization for DedicatedHostProfileMemoryEnum
+ Test serialization/deserialization for InstanceProfileMemoryFixed
"""
- # Construct a json representation of a DedicatedHostProfileMemoryEnum model
- dedicated_host_profile_memory_enum_model_json = {}
- dedicated_host_profile_memory_enum_model_json['default'] = 38
- dedicated_host_profile_memory_enum_model_json['type'] = 'enum'
- dedicated_host_profile_memory_enum_model_json['values'] = [8, 16, 32]
+ # Construct a json representation of a InstanceProfileMemoryFixed model
+ instance_profile_memory_fixed_model_json = {}
+ instance_profile_memory_fixed_model_json['type'] = 'fixed'
+ instance_profile_memory_fixed_model_json['value'] = 16
- # Construct a model instance of DedicatedHostProfileMemoryEnum by calling from_dict on the json representation
- dedicated_host_profile_memory_enum_model = DedicatedHostProfileMemoryEnum.from_dict(dedicated_host_profile_memory_enum_model_json)
- assert dedicated_host_profile_memory_enum_model != False
+ # Construct a model instance of InstanceProfileMemoryFixed by calling from_dict on the json representation
+ instance_profile_memory_fixed_model = InstanceProfileMemoryFixed.from_dict(instance_profile_memory_fixed_model_json)
+ assert instance_profile_memory_fixed_model != False
- # Construct a model instance of DedicatedHostProfileMemoryEnum by calling from_dict on the json representation
- dedicated_host_profile_memory_enum_model_dict = DedicatedHostProfileMemoryEnum.from_dict(dedicated_host_profile_memory_enum_model_json).__dict__
- dedicated_host_profile_memory_enum_model2 = DedicatedHostProfileMemoryEnum(**dedicated_host_profile_memory_enum_model_dict)
+ # Construct a model instance of InstanceProfileMemoryFixed by calling from_dict on the json representation
+ instance_profile_memory_fixed_model_dict = InstanceProfileMemoryFixed.from_dict(instance_profile_memory_fixed_model_json).__dict__
+ instance_profile_memory_fixed_model2 = InstanceProfileMemoryFixed(**instance_profile_memory_fixed_model_dict)
# Verify the model instances are equivalent
- assert dedicated_host_profile_memory_enum_model == dedicated_host_profile_memory_enum_model2
+ assert instance_profile_memory_fixed_model == instance_profile_memory_fixed_model2
# Convert model instance back to dict and verify no loss of data
- dedicated_host_profile_memory_enum_model_json2 = dedicated_host_profile_memory_enum_model.to_dict()
- assert dedicated_host_profile_memory_enum_model_json2 == dedicated_host_profile_memory_enum_model_json
+ instance_profile_memory_fixed_model_json2 = instance_profile_memory_fixed_model.to_dict()
+ assert instance_profile_memory_fixed_model_json2 == instance_profile_memory_fixed_model_json
-class TestModel_DedicatedHostProfileMemoryFixed:
+class TestModel_InstanceProfileMemoryRange:
"""
- Test Class for DedicatedHostProfileMemoryFixed
+ Test Class for InstanceProfileMemoryRange
"""
- def test_dedicated_host_profile_memory_fixed_serialization(self):
+ def test_instance_profile_memory_range_serialization(self):
"""
- Test serialization/deserialization for DedicatedHostProfileMemoryFixed
+ Test serialization/deserialization for InstanceProfileMemoryRange
"""
- # Construct a json representation of a DedicatedHostProfileMemoryFixed model
- dedicated_host_profile_memory_fixed_model_json = {}
- dedicated_host_profile_memory_fixed_model_json['type'] = 'fixed'
- dedicated_host_profile_memory_fixed_model_json['value'] = 16
+ # Construct a json representation of a InstanceProfileMemoryRange model
+ instance_profile_memory_range_model_json = {}
+ instance_profile_memory_range_model_json['default'] = 16
+ instance_profile_memory_range_model_json['max'] = 384
+ instance_profile_memory_range_model_json['min'] = 8
+ instance_profile_memory_range_model_json['step'] = 8
+ instance_profile_memory_range_model_json['type'] = 'range'
- # Construct a model instance of DedicatedHostProfileMemoryFixed by calling from_dict on the json representation
- dedicated_host_profile_memory_fixed_model = DedicatedHostProfileMemoryFixed.from_dict(dedicated_host_profile_memory_fixed_model_json)
- assert dedicated_host_profile_memory_fixed_model != False
+ # Construct a model instance of InstanceProfileMemoryRange by calling from_dict on the json representation
+ instance_profile_memory_range_model = InstanceProfileMemoryRange.from_dict(instance_profile_memory_range_model_json)
+ assert instance_profile_memory_range_model != False
- # Construct a model instance of DedicatedHostProfileMemoryFixed by calling from_dict on the json representation
- dedicated_host_profile_memory_fixed_model_dict = DedicatedHostProfileMemoryFixed.from_dict(dedicated_host_profile_memory_fixed_model_json).__dict__
- dedicated_host_profile_memory_fixed_model2 = DedicatedHostProfileMemoryFixed(**dedicated_host_profile_memory_fixed_model_dict)
+ # Construct a model instance of InstanceProfileMemoryRange by calling from_dict on the json representation
+ instance_profile_memory_range_model_dict = InstanceProfileMemoryRange.from_dict(instance_profile_memory_range_model_json).__dict__
+ instance_profile_memory_range_model2 = InstanceProfileMemoryRange(**instance_profile_memory_range_model_dict)
# Verify the model instances are equivalent
- assert dedicated_host_profile_memory_fixed_model == dedicated_host_profile_memory_fixed_model2
+ assert instance_profile_memory_range_model == instance_profile_memory_range_model2
# Convert model instance back to dict and verify no loss of data
- dedicated_host_profile_memory_fixed_model_json2 = dedicated_host_profile_memory_fixed_model.to_dict()
- assert dedicated_host_profile_memory_fixed_model_json2 == dedicated_host_profile_memory_fixed_model_json
+ instance_profile_memory_range_model_json2 = instance_profile_memory_range_model.to_dict()
+ assert instance_profile_memory_range_model_json2 == instance_profile_memory_range_model_json
-class TestModel_DedicatedHostProfileMemoryRange:
+class TestModel_InstanceProfileNUMACountDependent:
"""
- Test Class for DedicatedHostProfileMemoryRange
+ Test Class for InstanceProfileNUMACountDependent
"""
- def test_dedicated_host_profile_memory_range_serialization(self):
+ def test_instance_profile_numa_count_dependent_serialization(self):
"""
- Test serialization/deserialization for DedicatedHostProfileMemoryRange
+ Test serialization/deserialization for InstanceProfileNUMACountDependent
"""
- # Construct a json representation of a DedicatedHostProfileMemoryRange model
- dedicated_host_profile_memory_range_model_json = {}
- dedicated_host_profile_memory_range_model_json['default'] = 16
- dedicated_host_profile_memory_range_model_json['max'] = 384
- dedicated_host_profile_memory_range_model_json['min'] = 8
- dedicated_host_profile_memory_range_model_json['step'] = 8
- dedicated_host_profile_memory_range_model_json['type'] = 'range'
+ # Construct a json representation of a InstanceProfileNUMACountDependent model
+ instance_profile_numa_count_dependent_model_json = {}
+ instance_profile_numa_count_dependent_model_json['type'] = 'dependent'
- # Construct a model instance of DedicatedHostProfileMemoryRange by calling from_dict on the json representation
- dedicated_host_profile_memory_range_model = DedicatedHostProfileMemoryRange.from_dict(dedicated_host_profile_memory_range_model_json)
- assert dedicated_host_profile_memory_range_model != False
+ # Construct a model instance of InstanceProfileNUMACountDependent by calling from_dict on the json representation
+ instance_profile_numa_count_dependent_model = InstanceProfileNUMACountDependent.from_dict(instance_profile_numa_count_dependent_model_json)
+ assert instance_profile_numa_count_dependent_model != False
- # Construct a model instance of DedicatedHostProfileMemoryRange by calling from_dict on the json representation
- dedicated_host_profile_memory_range_model_dict = DedicatedHostProfileMemoryRange.from_dict(dedicated_host_profile_memory_range_model_json).__dict__
- dedicated_host_profile_memory_range_model2 = DedicatedHostProfileMemoryRange(**dedicated_host_profile_memory_range_model_dict)
+ # Construct a model instance of InstanceProfileNUMACountDependent by calling from_dict on the json representation
+ instance_profile_numa_count_dependent_model_dict = InstanceProfileNUMACountDependent.from_dict(instance_profile_numa_count_dependent_model_json).__dict__
+ instance_profile_numa_count_dependent_model2 = InstanceProfileNUMACountDependent(**instance_profile_numa_count_dependent_model_dict)
# Verify the model instances are equivalent
- assert dedicated_host_profile_memory_range_model == dedicated_host_profile_memory_range_model2
+ assert instance_profile_numa_count_dependent_model == instance_profile_numa_count_dependent_model2
# Convert model instance back to dict and verify no loss of data
- dedicated_host_profile_memory_range_model_json2 = dedicated_host_profile_memory_range_model.to_dict()
- assert dedicated_host_profile_memory_range_model_json2 == dedicated_host_profile_memory_range_model_json
+ instance_profile_numa_count_dependent_model_json2 = instance_profile_numa_count_dependent_model.to_dict()
+ assert instance_profile_numa_count_dependent_model_json2 == instance_profile_numa_count_dependent_model_json
-class TestModel_DedicatedHostProfileSocketDependent:
+class TestModel_InstanceProfileNUMACountFixed:
"""
- Test Class for DedicatedHostProfileSocketDependent
+ Test Class for InstanceProfileNUMACountFixed
"""
- def test_dedicated_host_profile_socket_dependent_serialization(self):
+ def test_instance_profile_numa_count_fixed_serialization(self):
"""
- Test serialization/deserialization for DedicatedHostProfileSocketDependent
+ Test serialization/deserialization for InstanceProfileNUMACountFixed
"""
- # Construct a json representation of a DedicatedHostProfileSocketDependent model
- dedicated_host_profile_socket_dependent_model_json = {}
- dedicated_host_profile_socket_dependent_model_json['type'] = 'dependent'
+ # Construct a json representation of a InstanceProfileNUMACountFixed model
+ instance_profile_numa_count_fixed_model_json = {}
+ instance_profile_numa_count_fixed_model_json['type'] = 'fixed'
+ instance_profile_numa_count_fixed_model_json['value'] = 2
- # Construct a model instance of DedicatedHostProfileSocketDependent by calling from_dict on the json representation
- dedicated_host_profile_socket_dependent_model = DedicatedHostProfileSocketDependent.from_dict(dedicated_host_profile_socket_dependent_model_json)
- assert dedicated_host_profile_socket_dependent_model != False
+ # Construct a model instance of InstanceProfileNUMACountFixed by calling from_dict on the json representation
+ instance_profile_numa_count_fixed_model = InstanceProfileNUMACountFixed.from_dict(instance_profile_numa_count_fixed_model_json)
+ assert instance_profile_numa_count_fixed_model != False
- # Construct a model instance of DedicatedHostProfileSocketDependent by calling from_dict on the json representation
- dedicated_host_profile_socket_dependent_model_dict = DedicatedHostProfileSocketDependent.from_dict(dedicated_host_profile_socket_dependent_model_json).__dict__
- dedicated_host_profile_socket_dependent_model2 = DedicatedHostProfileSocketDependent(**dedicated_host_profile_socket_dependent_model_dict)
+ # Construct a model instance of InstanceProfileNUMACountFixed by calling from_dict on the json representation
+ instance_profile_numa_count_fixed_model_dict = InstanceProfileNUMACountFixed.from_dict(instance_profile_numa_count_fixed_model_json).__dict__
+ instance_profile_numa_count_fixed_model2 = InstanceProfileNUMACountFixed(**instance_profile_numa_count_fixed_model_dict)
# Verify the model instances are equivalent
- assert dedicated_host_profile_socket_dependent_model == dedicated_host_profile_socket_dependent_model2
+ assert instance_profile_numa_count_fixed_model == instance_profile_numa_count_fixed_model2
# Convert model instance back to dict and verify no loss of data
- dedicated_host_profile_socket_dependent_model_json2 = dedicated_host_profile_socket_dependent_model.to_dict()
- assert dedicated_host_profile_socket_dependent_model_json2 == dedicated_host_profile_socket_dependent_model_json
+ instance_profile_numa_count_fixed_model_json2 = instance_profile_numa_count_fixed_model.to_dict()
+ assert instance_profile_numa_count_fixed_model_json2 == instance_profile_numa_count_fixed_model_json
-class TestModel_DedicatedHostProfileSocketEnum:
+class TestModel_InstanceProfileNetworkAttachmentCountDependent:
"""
- Test Class for DedicatedHostProfileSocketEnum
+ Test Class for InstanceProfileNetworkAttachmentCountDependent
"""
- def test_dedicated_host_profile_socket_enum_serialization(self):
+ def test_instance_profile_network_attachment_count_dependent_serialization(self):
"""
- Test serialization/deserialization for DedicatedHostProfileSocketEnum
+ Test serialization/deserialization for InstanceProfileNetworkAttachmentCountDependent
"""
- # Construct a json representation of a DedicatedHostProfileSocketEnum model
- dedicated_host_profile_socket_enum_model_json = {}
- dedicated_host_profile_socket_enum_model_json['default'] = 38
- dedicated_host_profile_socket_enum_model_json['type'] = 'enum'
- dedicated_host_profile_socket_enum_model_json['values'] = [2, 4, 8]
+ # Construct a json representation of a InstanceProfileNetworkAttachmentCountDependent model
+ instance_profile_network_attachment_count_dependent_model_json = {}
+ instance_profile_network_attachment_count_dependent_model_json['type'] = 'dependent'
- # Construct a model instance of DedicatedHostProfileSocketEnum by calling from_dict on the json representation
- dedicated_host_profile_socket_enum_model = DedicatedHostProfileSocketEnum.from_dict(dedicated_host_profile_socket_enum_model_json)
- assert dedicated_host_profile_socket_enum_model != False
+ # Construct a model instance of InstanceProfileNetworkAttachmentCountDependent by calling from_dict on the json representation
+ instance_profile_network_attachment_count_dependent_model = InstanceProfileNetworkAttachmentCountDependent.from_dict(instance_profile_network_attachment_count_dependent_model_json)
+ assert instance_profile_network_attachment_count_dependent_model != False
- # Construct a model instance of DedicatedHostProfileSocketEnum by calling from_dict on the json representation
- dedicated_host_profile_socket_enum_model_dict = DedicatedHostProfileSocketEnum.from_dict(dedicated_host_profile_socket_enum_model_json).__dict__
- dedicated_host_profile_socket_enum_model2 = DedicatedHostProfileSocketEnum(**dedicated_host_profile_socket_enum_model_dict)
+ # Construct a model instance of InstanceProfileNetworkAttachmentCountDependent by calling from_dict on the json representation
+ instance_profile_network_attachment_count_dependent_model_dict = InstanceProfileNetworkAttachmentCountDependent.from_dict(instance_profile_network_attachment_count_dependent_model_json).__dict__
+ instance_profile_network_attachment_count_dependent_model2 = InstanceProfileNetworkAttachmentCountDependent(**instance_profile_network_attachment_count_dependent_model_dict)
# Verify the model instances are equivalent
- assert dedicated_host_profile_socket_enum_model == dedicated_host_profile_socket_enum_model2
+ assert instance_profile_network_attachment_count_dependent_model == instance_profile_network_attachment_count_dependent_model2
# Convert model instance back to dict and verify no loss of data
- dedicated_host_profile_socket_enum_model_json2 = dedicated_host_profile_socket_enum_model.to_dict()
- assert dedicated_host_profile_socket_enum_model_json2 == dedicated_host_profile_socket_enum_model_json
+ instance_profile_network_attachment_count_dependent_model_json2 = instance_profile_network_attachment_count_dependent_model.to_dict()
+ assert instance_profile_network_attachment_count_dependent_model_json2 == instance_profile_network_attachment_count_dependent_model_json
-class TestModel_DedicatedHostProfileSocketFixed:
+class TestModel_InstanceProfileNetworkAttachmentCountRange:
"""
- Test Class for DedicatedHostProfileSocketFixed
+ Test Class for InstanceProfileNetworkAttachmentCountRange
"""
- def test_dedicated_host_profile_socket_fixed_serialization(self):
+ def test_instance_profile_network_attachment_count_range_serialization(self):
"""
- Test serialization/deserialization for DedicatedHostProfileSocketFixed
+ Test serialization/deserialization for InstanceProfileNetworkAttachmentCountRange
"""
- # Construct a json representation of a DedicatedHostProfileSocketFixed model
- dedicated_host_profile_socket_fixed_model_json = {}
- dedicated_host_profile_socket_fixed_model_json['type'] = 'fixed'
- dedicated_host_profile_socket_fixed_model_json['value'] = 2
+ # Construct a json representation of a InstanceProfileNetworkAttachmentCountRange model
+ instance_profile_network_attachment_count_range_model_json = {}
+ instance_profile_network_attachment_count_range_model_json['max'] = 5
+ instance_profile_network_attachment_count_range_model_json['min'] = 1
+ instance_profile_network_attachment_count_range_model_json['type'] = 'range'
- # Construct a model instance of DedicatedHostProfileSocketFixed by calling from_dict on the json representation
- dedicated_host_profile_socket_fixed_model = DedicatedHostProfileSocketFixed.from_dict(dedicated_host_profile_socket_fixed_model_json)
- assert dedicated_host_profile_socket_fixed_model != False
+ # Construct a model instance of InstanceProfileNetworkAttachmentCountRange by calling from_dict on the json representation
+ instance_profile_network_attachment_count_range_model = InstanceProfileNetworkAttachmentCountRange.from_dict(instance_profile_network_attachment_count_range_model_json)
+ assert instance_profile_network_attachment_count_range_model != False
- # Construct a model instance of DedicatedHostProfileSocketFixed by calling from_dict on the json representation
- dedicated_host_profile_socket_fixed_model_dict = DedicatedHostProfileSocketFixed.from_dict(dedicated_host_profile_socket_fixed_model_json).__dict__
- dedicated_host_profile_socket_fixed_model2 = DedicatedHostProfileSocketFixed(**dedicated_host_profile_socket_fixed_model_dict)
+ # Construct a model instance of InstanceProfileNetworkAttachmentCountRange by calling from_dict on the json representation
+ instance_profile_network_attachment_count_range_model_dict = InstanceProfileNetworkAttachmentCountRange.from_dict(instance_profile_network_attachment_count_range_model_json).__dict__
+ instance_profile_network_attachment_count_range_model2 = InstanceProfileNetworkAttachmentCountRange(**instance_profile_network_attachment_count_range_model_dict)
# Verify the model instances are equivalent
- assert dedicated_host_profile_socket_fixed_model == dedicated_host_profile_socket_fixed_model2
+ assert instance_profile_network_attachment_count_range_model == instance_profile_network_attachment_count_range_model2
# Convert model instance back to dict and verify no loss of data
- dedicated_host_profile_socket_fixed_model_json2 = dedicated_host_profile_socket_fixed_model.to_dict()
- assert dedicated_host_profile_socket_fixed_model_json2 == dedicated_host_profile_socket_fixed_model_json
+ instance_profile_network_attachment_count_range_model_json2 = instance_profile_network_attachment_count_range_model.to_dict()
+ assert instance_profile_network_attachment_count_range_model_json2 == instance_profile_network_attachment_count_range_model_json
-class TestModel_DedicatedHostProfileSocketRange:
+class TestModel_InstanceProfileNetworkInterfaceCountDependent:
"""
- Test Class for DedicatedHostProfileSocketRange
+ Test Class for InstanceProfileNetworkInterfaceCountDependent
"""
- def test_dedicated_host_profile_socket_range_serialization(self):
+ def test_instance_profile_network_interface_count_dependent_serialization(self):
"""
- Test serialization/deserialization for DedicatedHostProfileSocketRange
+ Test serialization/deserialization for InstanceProfileNetworkInterfaceCountDependent
"""
- # Construct a json representation of a DedicatedHostProfileSocketRange model
- dedicated_host_profile_socket_range_model_json = {}
- dedicated_host_profile_socket_range_model_json['default'] = 2
- dedicated_host_profile_socket_range_model_json['max'] = 4
- dedicated_host_profile_socket_range_model_json['min'] = 1
- dedicated_host_profile_socket_range_model_json['step'] = 1
- dedicated_host_profile_socket_range_model_json['type'] = 'range'
+ # Construct a json representation of a InstanceProfileNetworkInterfaceCountDependent model
+ instance_profile_network_interface_count_dependent_model_json = {}
+ instance_profile_network_interface_count_dependent_model_json['type'] = 'dependent'
- # Construct a model instance of DedicatedHostProfileSocketRange by calling from_dict on the json representation
- dedicated_host_profile_socket_range_model = DedicatedHostProfileSocketRange.from_dict(dedicated_host_profile_socket_range_model_json)
- assert dedicated_host_profile_socket_range_model != False
+ # Construct a model instance of InstanceProfileNetworkInterfaceCountDependent by calling from_dict on the json representation
+ instance_profile_network_interface_count_dependent_model = InstanceProfileNetworkInterfaceCountDependent.from_dict(instance_profile_network_interface_count_dependent_model_json)
+ assert instance_profile_network_interface_count_dependent_model != False
- # Construct a model instance of DedicatedHostProfileSocketRange by calling from_dict on the json representation
- dedicated_host_profile_socket_range_model_dict = DedicatedHostProfileSocketRange.from_dict(dedicated_host_profile_socket_range_model_json).__dict__
- dedicated_host_profile_socket_range_model2 = DedicatedHostProfileSocketRange(**dedicated_host_profile_socket_range_model_dict)
+ # Construct a model instance of InstanceProfileNetworkInterfaceCountDependent by calling from_dict on the json representation
+ instance_profile_network_interface_count_dependent_model_dict = InstanceProfileNetworkInterfaceCountDependent.from_dict(instance_profile_network_interface_count_dependent_model_json).__dict__
+ instance_profile_network_interface_count_dependent_model2 = InstanceProfileNetworkInterfaceCountDependent(**instance_profile_network_interface_count_dependent_model_dict)
# Verify the model instances are equivalent
- assert dedicated_host_profile_socket_range_model == dedicated_host_profile_socket_range_model2
+ assert instance_profile_network_interface_count_dependent_model == instance_profile_network_interface_count_dependent_model2
# Convert model instance back to dict and verify no loss of data
- dedicated_host_profile_socket_range_model_json2 = dedicated_host_profile_socket_range_model.to_dict()
- assert dedicated_host_profile_socket_range_model_json2 == dedicated_host_profile_socket_range_model_json
+ instance_profile_network_interface_count_dependent_model_json2 = instance_profile_network_interface_count_dependent_model.to_dict()
+ assert instance_profile_network_interface_count_dependent_model_json2 == instance_profile_network_interface_count_dependent_model_json
-class TestModel_DedicatedHostProfileVCPUDependent:
+class TestModel_InstanceProfileNetworkInterfaceCountRange:
"""
- Test Class for DedicatedHostProfileVCPUDependent
+ Test Class for InstanceProfileNetworkInterfaceCountRange
"""
- def test_dedicated_host_profile_vcpu_dependent_serialization(self):
+ def test_instance_profile_network_interface_count_range_serialization(self):
"""
- Test serialization/deserialization for DedicatedHostProfileVCPUDependent
+ Test serialization/deserialization for InstanceProfileNetworkInterfaceCountRange
"""
- # Construct a json representation of a DedicatedHostProfileVCPUDependent model
- dedicated_host_profile_vcpu_dependent_model_json = {}
- dedicated_host_profile_vcpu_dependent_model_json['type'] = 'dependent'
+ # Construct a json representation of a InstanceProfileNetworkInterfaceCountRange model
+ instance_profile_network_interface_count_range_model_json = {}
+ instance_profile_network_interface_count_range_model_json['max'] = 5
+ instance_profile_network_interface_count_range_model_json['min'] = 1
+ instance_profile_network_interface_count_range_model_json['type'] = 'range'
- # Construct a model instance of DedicatedHostProfileVCPUDependent by calling from_dict on the json representation
- dedicated_host_profile_vcpu_dependent_model = DedicatedHostProfileVCPUDependent.from_dict(dedicated_host_profile_vcpu_dependent_model_json)
- assert dedicated_host_profile_vcpu_dependent_model != False
+ # Construct a model instance of InstanceProfileNetworkInterfaceCountRange by calling from_dict on the json representation
+ instance_profile_network_interface_count_range_model = InstanceProfileNetworkInterfaceCountRange.from_dict(instance_profile_network_interface_count_range_model_json)
+ assert instance_profile_network_interface_count_range_model != False
- # Construct a model instance of DedicatedHostProfileVCPUDependent by calling from_dict on the json representation
- dedicated_host_profile_vcpu_dependent_model_dict = DedicatedHostProfileVCPUDependent.from_dict(dedicated_host_profile_vcpu_dependent_model_json).__dict__
- dedicated_host_profile_vcpu_dependent_model2 = DedicatedHostProfileVCPUDependent(**dedicated_host_profile_vcpu_dependent_model_dict)
+ # Construct a model instance of InstanceProfileNetworkInterfaceCountRange by calling from_dict on the json representation
+ instance_profile_network_interface_count_range_model_dict = InstanceProfileNetworkInterfaceCountRange.from_dict(instance_profile_network_interface_count_range_model_json).__dict__
+ instance_profile_network_interface_count_range_model2 = InstanceProfileNetworkInterfaceCountRange(**instance_profile_network_interface_count_range_model_dict)
# Verify the model instances are equivalent
- assert dedicated_host_profile_vcpu_dependent_model == dedicated_host_profile_vcpu_dependent_model2
+ assert instance_profile_network_interface_count_range_model == instance_profile_network_interface_count_range_model2
# Convert model instance back to dict and verify no loss of data
- dedicated_host_profile_vcpu_dependent_model_json2 = dedicated_host_profile_vcpu_dependent_model.to_dict()
- assert dedicated_host_profile_vcpu_dependent_model_json2 == dedicated_host_profile_vcpu_dependent_model_json
+ instance_profile_network_interface_count_range_model_json2 = instance_profile_network_interface_count_range_model.to_dict()
+ assert instance_profile_network_interface_count_range_model_json2 == instance_profile_network_interface_count_range_model_json
-class TestModel_DedicatedHostProfileVCPUEnum:
+class TestModel_InstanceProfilePortSpeedDependent:
"""
- Test Class for DedicatedHostProfileVCPUEnum
+ Test Class for InstanceProfilePortSpeedDependent
"""
- def test_dedicated_host_profile_vcpu_enum_serialization(self):
+ def test_instance_profile_port_speed_dependent_serialization(self):
"""
- Test serialization/deserialization for DedicatedHostProfileVCPUEnum
+ Test serialization/deserialization for InstanceProfilePortSpeedDependent
"""
- # Construct a json representation of a DedicatedHostProfileVCPUEnum model
- dedicated_host_profile_vcpu_enum_model_json = {}
- dedicated_host_profile_vcpu_enum_model_json['default'] = 38
- dedicated_host_profile_vcpu_enum_model_json['type'] = 'enum'
- dedicated_host_profile_vcpu_enum_model_json['values'] = [2, 4, 16]
+ # Construct a json representation of a InstanceProfilePortSpeedDependent model
+ instance_profile_port_speed_dependent_model_json = {}
+ instance_profile_port_speed_dependent_model_json['type'] = 'dependent'
- # Construct a model instance of DedicatedHostProfileVCPUEnum by calling from_dict on the json representation
- dedicated_host_profile_vcpu_enum_model = DedicatedHostProfileVCPUEnum.from_dict(dedicated_host_profile_vcpu_enum_model_json)
- assert dedicated_host_profile_vcpu_enum_model != False
+ # Construct a model instance of InstanceProfilePortSpeedDependent by calling from_dict on the json representation
+ instance_profile_port_speed_dependent_model = InstanceProfilePortSpeedDependent.from_dict(instance_profile_port_speed_dependent_model_json)
+ assert instance_profile_port_speed_dependent_model != False
- # Construct a model instance of DedicatedHostProfileVCPUEnum by calling from_dict on the json representation
- dedicated_host_profile_vcpu_enum_model_dict = DedicatedHostProfileVCPUEnum.from_dict(dedicated_host_profile_vcpu_enum_model_json).__dict__
- dedicated_host_profile_vcpu_enum_model2 = DedicatedHostProfileVCPUEnum(**dedicated_host_profile_vcpu_enum_model_dict)
+ # Construct a model instance of InstanceProfilePortSpeedDependent by calling from_dict on the json representation
+ instance_profile_port_speed_dependent_model_dict = InstanceProfilePortSpeedDependent.from_dict(instance_profile_port_speed_dependent_model_json).__dict__
+ instance_profile_port_speed_dependent_model2 = InstanceProfilePortSpeedDependent(**instance_profile_port_speed_dependent_model_dict)
# Verify the model instances are equivalent
- assert dedicated_host_profile_vcpu_enum_model == dedicated_host_profile_vcpu_enum_model2
+ assert instance_profile_port_speed_dependent_model == instance_profile_port_speed_dependent_model2
# Convert model instance back to dict and verify no loss of data
- dedicated_host_profile_vcpu_enum_model_json2 = dedicated_host_profile_vcpu_enum_model.to_dict()
- assert dedicated_host_profile_vcpu_enum_model_json2 == dedicated_host_profile_vcpu_enum_model_json
+ instance_profile_port_speed_dependent_model_json2 = instance_profile_port_speed_dependent_model.to_dict()
+ assert instance_profile_port_speed_dependent_model_json2 == instance_profile_port_speed_dependent_model_json
-class TestModel_DedicatedHostProfileVCPUFixed:
+class TestModel_InstanceProfilePortSpeedFixed:
"""
- Test Class for DedicatedHostProfileVCPUFixed
+ Test Class for InstanceProfilePortSpeedFixed
"""
- def test_dedicated_host_profile_vcpu_fixed_serialization(self):
+ def test_instance_profile_port_speed_fixed_serialization(self):
"""
- Test serialization/deserialization for DedicatedHostProfileVCPUFixed
+ Test serialization/deserialization for InstanceProfilePortSpeedFixed
"""
- # Construct a json representation of a DedicatedHostProfileVCPUFixed model
- dedicated_host_profile_vcpu_fixed_model_json = {}
- dedicated_host_profile_vcpu_fixed_model_json['type'] = 'fixed'
- dedicated_host_profile_vcpu_fixed_model_json['value'] = 16
+ # Construct a json representation of a InstanceProfilePortSpeedFixed model
+ instance_profile_port_speed_fixed_model_json = {}
+ instance_profile_port_speed_fixed_model_json['type'] = 'fixed'
+ instance_profile_port_speed_fixed_model_json['value'] = 1000
- # Construct a model instance of DedicatedHostProfileVCPUFixed by calling from_dict on the json representation
- dedicated_host_profile_vcpu_fixed_model = DedicatedHostProfileVCPUFixed.from_dict(dedicated_host_profile_vcpu_fixed_model_json)
- assert dedicated_host_profile_vcpu_fixed_model != False
+ # Construct a model instance of InstanceProfilePortSpeedFixed by calling from_dict on the json representation
+ instance_profile_port_speed_fixed_model = InstanceProfilePortSpeedFixed.from_dict(instance_profile_port_speed_fixed_model_json)
+ assert instance_profile_port_speed_fixed_model != False
- # Construct a model instance of DedicatedHostProfileVCPUFixed by calling from_dict on the json representation
- dedicated_host_profile_vcpu_fixed_model_dict = DedicatedHostProfileVCPUFixed.from_dict(dedicated_host_profile_vcpu_fixed_model_json).__dict__
- dedicated_host_profile_vcpu_fixed_model2 = DedicatedHostProfileVCPUFixed(**dedicated_host_profile_vcpu_fixed_model_dict)
+ # Construct a model instance of InstanceProfilePortSpeedFixed by calling from_dict on the json representation
+ instance_profile_port_speed_fixed_model_dict = InstanceProfilePortSpeedFixed.from_dict(instance_profile_port_speed_fixed_model_json).__dict__
+ instance_profile_port_speed_fixed_model2 = InstanceProfilePortSpeedFixed(**instance_profile_port_speed_fixed_model_dict)
# Verify the model instances are equivalent
- assert dedicated_host_profile_vcpu_fixed_model == dedicated_host_profile_vcpu_fixed_model2
+ assert instance_profile_port_speed_fixed_model == instance_profile_port_speed_fixed_model2
# Convert model instance back to dict and verify no loss of data
- dedicated_host_profile_vcpu_fixed_model_json2 = dedicated_host_profile_vcpu_fixed_model.to_dict()
- assert dedicated_host_profile_vcpu_fixed_model_json2 == dedicated_host_profile_vcpu_fixed_model_json
+ instance_profile_port_speed_fixed_model_json2 = instance_profile_port_speed_fixed_model.to_dict()
+ assert instance_profile_port_speed_fixed_model_json2 == instance_profile_port_speed_fixed_model_json
-class TestModel_DedicatedHostProfileVCPURange:
+class TestModel_InstanceProfileVCPUDependent:
"""
- Test Class for DedicatedHostProfileVCPURange
+ Test Class for InstanceProfileVCPUDependent
"""
- def test_dedicated_host_profile_vcpu_range_serialization(self):
+ def test_instance_profile_vcpu_dependent_serialization(self):
"""
- Test serialization/deserialization for DedicatedHostProfileVCPURange
+ Test serialization/deserialization for InstanceProfileVCPUDependent
"""
- # Construct a json representation of a DedicatedHostProfileVCPURange model
- dedicated_host_profile_vcpu_range_model_json = {}
- dedicated_host_profile_vcpu_range_model_json['default'] = 4
- dedicated_host_profile_vcpu_range_model_json['max'] = 56
- dedicated_host_profile_vcpu_range_model_json['min'] = 2
- dedicated_host_profile_vcpu_range_model_json['step'] = 2
- dedicated_host_profile_vcpu_range_model_json['type'] = 'range'
+ # Construct a json representation of a InstanceProfileVCPUDependent model
+ instance_profile_vcpu_dependent_model_json = {}
+ instance_profile_vcpu_dependent_model_json['type'] = 'dependent'
- # Construct a model instance of DedicatedHostProfileVCPURange by calling from_dict on the json representation
- dedicated_host_profile_vcpu_range_model = DedicatedHostProfileVCPURange.from_dict(dedicated_host_profile_vcpu_range_model_json)
- assert dedicated_host_profile_vcpu_range_model != False
+ # Construct a model instance of InstanceProfileVCPUDependent by calling from_dict on the json representation
+ instance_profile_vcpu_dependent_model = InstanceProfileVCPUDependent.from_dict(instance_profile_vcpu_dependent_model_json)
+ assert instance_profile_vcpu_dependent_model != False
- # Construct a model instance of DedicatedHostProfileVCPURange by calling from_dict on the json representation
- dedicated_host_profile_vcpu_range_model_dict = DedicatedHostProfileVCPURange.from_dict(dedicated_host_profile_vcpu_range_model_json).__dict__
- dedicated_host_profile_vcpu_range_model2 = DedicatedHostProfileVCPURange(**dedicated_host_profile_vcpu_range_model_dict)
+ # Construct a model instance of InstanceProfileVCPUDependent by calling from_dict on the json representation
+ instance_profile_vcpu_dependent_model_dict = InstanceProfileVCPUDependent.from_dict(instance_profile_vcpu_dependent_model_json).__dict__
+ instance_profile_vcpu_dependent_model2 = InstanceProfileVCPUDependent(**instance_profile_vcpu_dependent_model_dict)
# Verify the model instances are equivalent
- assert dedicated_host_profile_vcpu_range_model == dedicated_host_profile_vcpu_range_model2
+ assert instance_profile_vcpu_dependent_model == instance_profile_vcpu_dependent_model2
# Convert model instance back to dict and verify no loss of data
- dedicated_host_profile_vcpu_range_model_json2 = dedicated_host_profile_vcpu_range_model.to_dict()
- assert dedicated_host_profile_vcpu_range_model_json2 == dedicated_host_profile_vcpu_range_model_json
+ instance_profile_vcpu_dependent_model_json2 = instance_profile_vcpu_dependent_model.to_dict()
+ assert instance_profile_vcpu_dependent_model_json2 == instance_profile_vcpu_dependent_model_json
-class TestModel_DedicatedHostPrototypeDedicatedHostByGroup:
+class TestModel_InstanceProfileVCPUEnum:
"""
- Test Class for DedicatedHostPrototypeDedicatedHostByGroup
+ Test Class for InstanceProfileVCPUEnum
"""
- def test_dedicated_host_prototype_dedicated_host_by_group_serialization(self):
+ def test_instance_profile_vcpu_enum_serialization(self):
"""
- Test serialization/deserialization for DedicatedHostPrototypeDedicatedHostByGroup
+ Test serialization/deserialization for InstanceProfileVCPUEnum
"""
- # Construct dict forms of any model objects needed in order to build this model.
-
- dedicated_host_profile_identity_model = {} # DedicatedHostProfileIdentityByName
- dedicated_host_profile_identity_model['name'] = 'mx2-host-152x1216'
-
- resource_group_identity_model = {} # ResourceGroupIdentityById
- resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
-
- dedicated_host_group_identity_model = {} # DedicatedHostGroupIdentityById
- dedicated_host_group_identity_model['id'] = 'bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0'
-
- # Construct a json representation of a DedicatedHostPrototypeDedicatedHostByGroup model
- dedicated_host_prototype_dedicated_host_by_group_model_json = {}
- dedicated_host_prototype_dedicated_host_by_group_model_json['instance_placement_enabled'] = True
- dedicated_host_prototype_dedicated_host_by_group_model_json['name'] = 'my-host'
- dedicated_host_prototype_dedicated_host_by_group_model_json['profile'] = dedicated_host_profile_identity_model
- dedicated_host_prototype_dedicated_host_by_group_model_json['resource_group'] = resource_group_identity_model
- dedicated_host_prototype_dedicated_host_by_group_model_json['group'] = dedicated_host_group_identity_model
+ # Construct a json representation of a InstanceProfileVCPUEnum model
+ instance_profile_vcpu_enum_model_json = {}
+ instance_profile_vcpu_enum_model_json['default'] = 38
+ instance_profile_vcpu_enum_model_json['type'] = 'enum'
+ instance_profile_vcpu_enum_model_json['values'] = [2, 4, 16]
- # Construct a model instance of DedicatedHostPrototypeDedicatedHostByGroup by calling from_dict on the json representation
- dedicated_host_prototype_dedicated_host_by_group_model = DedicatedHostPrototypeDedicatedHostByGroup.from_dict(dedicated_host_prototype_dedicated_host_by_group_model_json)
- assert dedicated_host_prototype_dedicated_host_by_group_model != False
+ # Construct a model instance of InstanceProfileVCPUEnum by calling from_dict on the json representation
+ instance_profile_vcpu_enum_model = InstanceProfileVCPUEnum.from_dict(instance_profile_vcpu_enum_model_json)
+ assert instance_profile_vcpu_enum_model != False
- # Construct a model instance of DedicatedHostPrototypeDedicatedHostByGroup by calling from_dict on the json representation
- dedicated_host_prototype_dedicated_host_by_group_model_dict = DedicatedHostPrototypeDedicatedHostByGroup.from_dict(dedicated_host_prototype_dedicated_host_by_group_model_json).__dict__
- dedicated_host_prototype_dedicated_host_by_group_model2 = DedicatedHostPrototypeDedicatedHostByGroup(**dedicated_host_prototype_dedicated_host_by_group_model_dict)
+ # Construct a model instance of InstanceProfileVCPUEnum by calling from_dict on the json representation
+ instance_profile_vcpu_enum_model_dict = InstanceProfileVCPUEnum.from_dict(instance_profile_vcpu_enum_model_json).__dict__
+ instance_profile_vcpu_enum_model2 = InstanceProfileVCPUEnum(**instance_profile_vcpu_enum_model_dict)
# Verify the model instances are equivalent
- assert dedicated_host_prototype_dedicated_host_by_group_model == dedicated_host_prototype_dedicated_host_by_group_model2
+ assert instance_profile_vcpu_enum_model == instance_profile_vcpu_enum_model2
# Convert model instance back to dict and verify no loss of data
- dedicated_host_prototype_dedicated_host_by_group_model_json2 = dedicated_host_prototype_dedicated_host_by_group_model.to_dict()
- assert dedicated_host_prototype_dedicated_host_by_group_model_json2 == dedicated_host_prototype_dedicated_host_by_group_model_json
+ instance_profile_vcpu_enum_model_json2 = instance_profile_vcpu_enum_model.to_dict()
+ assert instance_profile_vcpu_enum_model_json2 == instance_profile_vcpu_enum_model_json
-class TestModel_DedicatedHostPrototypeDedicatedHostByZone:
+class TestModel_InstanceProfileVCPUFixed:
"""
- Test Class for DedicatedHostPrototypeDedicatedHostByZone
+ Test Class for InstanceProfileVCPUFixed
"""
- def test_dedicated_host_prototype_dedicated_host_by_zone_serialization(self):
+ def test_instance_profile_vcpu_fixed_serialization(self):
"""
- Test serialization/deserialization for DedicatedHostPrototypeDedicatedHostByZone
+ Test serialization/deserialization for InstanceProfileVCPUFixed
"""
- # Construct dict forms of any model objects needed in order to build this model.
-
- dedicated_host_profile_identity_model = {} # DedicatedHostProfileIdentityByName
- dedicated_host_profile_identity_model['name'] = 'mx2-host-152x1216'
-
- resource_group_identity_model = {} # ResourceGroupIdentityById
- resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
-
- dedicated_host_group_prototype_dedicated_host_by_zone_context_model = {} # DedicatedHostGroupPrototypeDedicatedHostByZoneContext
- dedicated_host_group_prototype_dedicated_host_by_zone_context_model['name'] = 'my-host-group'
- dedicated_host_group_prototype_dedicated_host_by_zone_context_model['resource_group'] = resource_group_identity_model
-
- zone_identity_model = {} # ZoneIdentityByName
- zone_identity_model['name'] = 'us-south-1'
-
- # Construct a json representation of a DedicatedHostPrototypeDedicatedHostByZone model
- dedicated_host_prototype_dedicated_host_by_zone_model_json = {}
- dedicated_host_prototype_dedicated_host_by_zone_model_json['instance_placement_enabled'] = True
- dedicated_host_prototype_dedicated_host_by_zone_model_json['name'] = 'my-host'
- dedicated_host_prototype_dedicated_host_by_zone_model_json['profile'] = dedicated_host_profile_identity_model
- dedicated_host_prototype_dedicated_host_by_zone_model_json['resource_group'] = resource_group_identity_model
- dedicated_host_prototype_dedicated_host_by_zone_model_json['group'] = dedicated_host_group_prototype_dedicated_host_by_zone_context_model
- dedicated_host_prototype_dedicated_host_by_zone_model_json['zone'] = zone_identity_model
+ # Construct a json representation of a InstanceProfileVCPUFixed model
+ instance_profile_vcpu_fixed_model_json = {}
+ instance_profile_vcpu_fixed_model_json['type'] = 'fixed'
+ instance_profile_vcpu_fixed_model_json['value'] = 16
- # Construct a model instance of DedicatedHostPrototypeDedicatedHostByZone by calling from_dict on the json representation
- dedicated_host_prototype_dedicated_host_by_zone_model = DedicatedHostPrototypeDedicatedHostByZone.from_dict(dedicated_host_prototype_dedicated_host_by_zone_model_json)
- assert dedicated_host_prototype_dedicated_host_by_zone_model != False
+ # Construct a model instance of InstanceProfileVCPUFixed by calling from_dict on the json representation
+ instance_profile_vcpu_fixed_model = InstanceProfileVCPUFixed.from_dict(instance_profile_vcpu_fixed_model_json)
+ assert instance_profile_vcpu_fixed_model != False
- # Construct a model instance of DedicatedHostPrototypeDedicatedHostByZone by calling from_dict on the json representation
- dedicated_host_prototype_dedicated_host_by_zone_model_dict = DedicatedHostPrototypeDedicatedHostByZone.from_dict(dedicated_host_prototype_dedicated_host_by_zone_model_json).__dict__
- dedicated_host_prototype_dedicated_host_by_zone_model2 = DedicatedHostPrototypeDedicatedHostByZone(**dedicated_host_prototype_dedicated_host_by_zone_model_dict)
+ # Construct a model instance of InstanceProfileVCPUFixed by calling from_dict on the json representation
+ instance_profile_vcpu_fixed_model_dict = InstanceProfileVCPUFixed.from_dict(instance_profile_vcpu_fixed_model_json).__dict__
+ instance_profile_vcpu_fixed_model2 = InstanceProfileVCPUFixed(**instance_profile_vcpu_fixed_model_dict)
# Verify the model instances are equivalent
- assert dedicated_host_prototype_dedicated_host_by_zone_model == dedicated_host_prototype_dedicated_host_by_zone_model2
+ assert instance_profile_vcpu_fixed_model == instance_profile_vcpu_fixed_model2
# Convert model instance back to dict and verify no loss of data
- dedicated_host_prototype_dedicated_host_by_zone_model_json2 = dedicated_host_prototype_dedicated_host_by_zone_model.to_dict()
- assert dedicated_host_prototype_dedicated_host_by_zone_model_json2 == dedicated_host_prototype_dedicated_host_by_zone_model_json
+ instance_profile_vcpu_fixed_model_json2 = instance_profile_vcpu_fixed_model.to_dict()
+ assert instance_profile_vcpu_fixed_model_json2 == instance_profile_vcpu_fixed_model_json
-class TestModel_EncryptionKeyIdentityByCRN:
+class TestModel_InstanceProfileVCPURange:
"""
- Test Class for EncryptionKeyIdentityByCRN
+ Test Class for InstanceProfileVCPURange
"""
- def test_encryption_key_identity_by_crn_serialization(self):
+ def test_instance_profile_vcpu_range_serialization(self):
"""
- Test serialization/deserialization for EncryptionKeyIdentityByCRN
+ Test serialization/deserialization for InstanceProfileVCPURange
"""
- # Construct a json representation of a EncryptionKeyIdentityByCRN model
- encryption_key_identity_by_crn_model_json = {}
- encryption_key_identity_by_crn_model_json['crn'] = 'crn:v1:bluemix:public:kms:us-south:a/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179'
+ # Construct a json representation of a InstanceProfileVCPURange model
+ instance_profile_vcpu_range_model_json = {}
+ instance_profile_vcpu_range_model_json['default'] = 4
+ instance_profile_vcpu_range_model_json['max'] = 56
+ instance_profile_vcpu_range_model_json['min'] = 2
+ instance_profile_vcpu_range_model_json['step'] = 2
+ instance_profile_vcpu_range_model_json['type'] = 'range'
- # Construct a model instance of EncryptionKeyIdentityByCRN by calling from_dict on the json representation
- encryption_key_identity_by_crn_model = EncryptionKeyIdentityByCRN.from_dict(encryption_key_identity_by_crn_model_json)
- assert encryption_key_identity_by_crn_model != False
+ # Construct a model instance of InstanceProfileVCPURange by calling from_dict on the json representation
+ instance_profile_vcpu_range_model = InstanceProfileVCPURange.from_dict(instance_profile_vcpu_range_model_json)
+ assert instance_profile_vcpu_range_model != False
- # Construct a model instance of EncryptionKeyIdentityByCRN by calling from_dict on the json representation
- encryption_key_identity_by_crn_model_dict = EncryptionKeyIdentityByCRN.from_dict(encryption_key_identity_by_crn_model_json).__dict__
- encryption_key_identity_by_crn_model2 = EncryptionKeyIdentityByCRN(**encryption_key_identity_by_crn_model_dict)
+ # Construct a model instance of InstanceProfileVCPURange by calling from_dict on the json representation
+ instance_profile_vcpu_range_model_dict = InstanceProfileVCPURange.from_dict(instance_profile_vcpu_range_model_json).__dict__
+ instance_profile_vcpu_range_model2 = InstanceProfileVCPURange(**instance_profile_vcpu_range_model_dict)
# Verify the model instances are equivalent
- assert encryption_key_identity_by_crn_model == encryption_key_identity_by_crn_model2
+ assert instance_profile_vcpu_range_model == instance_profile_vcpu_range_model2
# Convert model instance back to dict and verify no loss of data
- encryption_key_identity_by_crn_model_json2 = encryption_key_identity_by_crn_model.to_dict()
- assert encryption_key_identity_by_crn_model_json2 == encryption_key_identity_by_crn_model_json
+ instance_profile_vcpu_range_model_json2 = instance_profile_vcpu_range_model.to_dict()
+ assert instance_profile_vcpu_range_model_json2 == instance_profile_vcpu_range_model_json
-class TestModel_EndpointGatewayReservedIPReservedIPPrototypeTargetContext:
+class TestModel_InstanceProfileVolumeBandwidthDependent:
"""
- Test Class for EndpointGatewayReservedIPReservedIPPrototypeTargetContext
+ Test Class for InstanceProfileVolumeBandwidthDependent
"""
- def test_endpoint_gateway_reserved_ip_reserved_ip_prototype_target_context_serialization(self):
+ def test_instance_profile_volume_bandwidth_dependent_serialization(self):
"""
- Test serialization/deserialization for EndpointGatewayReservedIPReservedIPPrototypeTargetContext
+ Test serialization/deserialization for InstanceProfileVolumeBandwidthDependent
"""
- # Construct dict forms of any model objects needed in order to build this model.
-
- subnet_identity_model = {} # SubnetIdentityById
- subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
-
- # Construct a json representation of a EndpointGatewayReservedIPReservedIPPrototypeTargetContext model
- endpoint_gateway_reserved_ip_reserved_ip_prototype_target_context_model_json = {}
- endpoint_gateway_reserved_ip_reserved_ip_prototype_target_context_model_json['address'] = '192.168.3.4'
- endpoint_gateway_reserved_ip_reserved_ip_prototype_target_context_model_json['auto_delete'] = False
- endpoint_gateway_reserved_ip_reserved_ip_prototype_target_context_model_json['name'] = 'my-reserved-ip'
- endpoint_gateway_reserved_ip_reserved_ip_prototype_target_context_model_json['subnet'] = subnet_identity_model
+ # Construct a json representation of a InstanceProfileVolumeBandwidthDependent model
+ instance_profile_volume_bandwidth_dependent_model_json = {}
+ instance_profile_volume_bandwidth_dependent_model_json['type'] = 'dependent'
- # Construct a model instance of EndpointGatewayReservedIPReservedIPPrototypeTargetContext by calling from_dict on the json representation
- endpoint_gateway_reserved_ip_reserved_ip_prototype_target_context_model = EndpointGatewayReservedIPReservedIPPrototypeTargetContext.from_dict(endpoint_gateway_reserved_ip_reserved_ip_prototype_target_context_model_json)
- assert endpoint_gateway_reserved_ip_reserved_ip_prototype_target_context_model != False
+ # Construct a model instance of InstanceProfileVolumeBandwidthDependent by calling from_dict on the json representation
+ instance_profile_volume_bandwidth_dependent_model = InstanceProfileVolumeBandwidthDependent.from_dict(instance_profile_volume_bandwidth_dependent_model_json)
+ assert instance_profile_volume_bandwidth_dependent_model != False
- # Construct a model instance of EndpointGatewayReservedIPReservedIPPrototypeTargetContext by calling from_dict on the json representation
- endpoint_gateway_reserved_ip_reserved_ip_prototype_target_context_model_dict = EndpointGatewayReservedIPReservedIPPrototypeTargetContext.from_dict(endpoint_gateway_reserved_ip_reserved_ip_prototype_target_context_model_json).__dict__
- endpoint_gateway_reserved_ip_reserved_ip_prototype_target_context_model2 = EndpointGatewayReservedIPReservedIPPrototypeTargetContext(**endpoint_gateway_reserved_ip_reserved_ip_prototype_target_context_model_dict)
+ # Construct a model instance of InstanceProfileVolumeBandwidthDependent by calling from_dict on the json representation
+ instance_profile_volume_bandwidth_dependent_model_dict = InstanceProfileVolumeBandwidthDependent.from_dict(instance_profile_volume_bandwidth_dependent_model_json).__dict__
+ instance_profile_volume_bandwidth_dependent_model2 = InstanceProfileVolumeBandwidthDependent(**instance_profile_volume_bandwidth_dependent_model_dict)
# Verify the model instances are equivalent
- assert endpoint_gateway_reserved_ip_reserved_ip_prototype_target_context_model == endpoint_gateway_reserved_ip_reserved_ip_prototype_target_context_model2
+ assert instance_profile_volume_bandwidth_dependent_model == instance_profile_volume_bandwidth_dependent_model2
# Convert model instance back to dict and verify no loss of data
- endpoint_gateway_reserved_ip_reserved_ip_prototype_target_context_model_json2 = endpoint_gateway_reserved_ip_reserved_ip_prototype_target_context_model.to_dict()
- assert endpoint_gateway_reserved_ip_reserved_ip_prototype_target_context_model_json2 == endpoint_gateway_reserved_ip_reserved_ip_prototype_target_context_model_json
+ instance_profile_volume_bandwidth_dependent_model_json2 = instance_profile_volume_bandwidth_dependent_model.to_dict()
+ assert instance_profile_volume_bandwidth_dependent_model_json2 == instance_profile_volume_bandwidth_dependent_model_json
-class TestModel_EndpointGatewayTargetProviderCloudServiceReference:
+class TestModel_InstanceProfileVolumeBandwidthEnum:
"""
- Test Class for EndpointGatewayTargetProviderCloudServiceReference
+ Test Class for InstanceProfileVolumeBandwidthEnum
"""
- def test_endpoint_gateway_target_provider_cloud_service_reference_serialization(self):
+ def test_instance_profile_volume_bandwidth_enum_serialization(self):
"""
- Test serialization/deserialization for EndpointGatewayTargetProviderCloudServiceReference
+ Test serialization/deserialization for InstanceProfileVolumeBandwidthEnum
"""
- # Construct a json representation of a EndpointGatewayTargetProviderCloudServiceReference model
- endpoint_gateway_target_provider_cloud_service_reference_model_json = {}
- endpoint_gateway_target_provider_cloud_service_reference_model_json['crn'] = 'crn:v1:bluemix:public:cloudant:us-south:a/123456:3527280b-9327-4411-8020-591092e60353::'
- endpoint_gateway_target_provider_cloud_service_reference_model_json['resource_type'] = 'provider_cloud_service'
+ # Construct a json representation of a InstanceProfileVolumeBandwidthEnum model
+ instance_profile_volume_bandwidth_enum_model_json = {}
+ instance_profile_volume_bandwidth_enum_model_json['default'] = 38
+ instance_profile_volume_bandwidth_enum_model_json['type'] = 'enum'
+ instance_profile_volume_bandwidth_enum_model_json['values'] = [16000, 32000, 48000]
- # Construct a model instance of EndpointGatewayTargetProviderCloudServiceReference by calling from_dict on the json representation
- endpoint_gateway_target_provider_cloud_service_reference_model = EndpointGatewayTargetProviderCloudServiceReference.from_dict(endpoint_gateway_target_provider_cloud_service_reference_model_json)
- assert endpoint_gateway_target_provider_cloud_service_reference_model != False
+ # Construct a model instance of InstanceProfileVolumeBandwidthEnum by calling from_dict on the json representation
+ instance_profile_volume_bandwidth_enum_model = InstanceProfileVolumeBandwidthEnum.from_dict(instance_profile_volume_bandwidth_enum_model_json)
+ assert instance_profile_volume_bandwidth_enum_model != False
- # Construct a model instance of EndpointGatewayTargetProviderCloudServiceReference by calling from_dict on the json representation
- endpoint_gateway_target_provider_cloud_service_reference_model_dict = EndpointGatewayTargetProviderCloudServiceReference.from_dict(endpoint_gateway_target_provider_cloud_service_reference_model_json).__dict__
- endpoint_gateway_target_provider_cloud_service_reference_model2 = EndpointGatewayTargetProviderCloudServiceReference(**endpoint_gateway_target_provider_cloud_service_reference_model_dict)
+ # Construct a model instance of InstanceProfileVolumeBandwidthEnum by calling from_dict on the json representation
+ instance_profile_volume_bandwidth_enum_model_dict = InstanceProfileVolumeBandwidthEnum.from_dict(instance_profile_volume_bandwidth_enum_model_json).__dict__
+ instance_profile_volume_bandwidth_enum_model2 = InstanceProfileVolumeBandwidthEnum(**instance_profile_volume_bandwidth_enum_model_dict)
# Verify the model instances are equivalent
- assert endpoint_gateway_target_provider_cloud_service_reference_model == endpoint_gateway_target_provider_cloud_service_reference_model2
+ assert instance_profile_volume_bandwidth_enum_model == instance_profile_volume_bandwidth_enum_model2
# Convert model instance back to dict and verify no loss of data
- endpoint_gateway_target_provider_cloud_service_reference_model_json2 = endpoint_gateway_target_provider_cloud_service_reference_model.to_dict()
- assert endpoint_gateway_target_provider_cloud_service_reference_model_json2 == endpoint_gateway_target_provider_cloud_service_reference_model_json
+ instance_profile_volume_bandwidth_enum_model_json2 = instance_profile_volume_bandwidth_enum_model.to_dict()
+ assert instance_profile_volume_bandwidth_enum_model_json2 == instance_profile_volume_bandwidth_enum_model_json
-class TestModel_EndpointGatewayTargetProviderInfrastructureServiceReference:
+class TestModel_InstanceProfileVolumeBandwidthFixed:
"""
- Test Class for EndpointGatewayTargetProviderInfrastructureServiceReference
+ Test Class for InstanceProfileVolumeBandwidthFixed
"""
- def test_endpoint_gateway_target_provider_infrastructure_service_reference_serialization(self):
+ def test_instance_profile_volume_bandwidth_fixed_serialization(self):
"""
- Test serialization/deserialization for EndpointGatewayTargetProviderInfrastructureServiceReference
+ Test serialization/deserialization for InstanceProfileVolumeBandwidthFixed
"""
- # Construct a json representation of a EndpointGatewayTargetProviderInfrastructureServiceReference model
- endpoint_gateway_target_provider_infrastructure_service_reference_model_json = {}
- endpoint_gateway_target_provider_infrastructure_service_reference_model_json['name'] = 'ibm-ntp-server'
- endpoint_gateway_target_provider_infrastructure_service_reference_model_json['resource_type'] = 'provider_infrastructure_service'
+ # Construct a json representation of a InstanceProfileVolumeBandwidthFixed model
+ instance_profile_volume_bandwidth_fixed_model_json = {}
+ instance_profile_volume_bandwidth_fixed_model_json['type'] = 'fixed'
+ instance_profile_volume_bandwidth_fixed_model_json['value'] = 20000
- # Construct a model instance of EndpointGatewayTargetProviderInfrastructureServiceReference by calling from_dict on the json representation
- endpoint_gateway_target_provider_infrastructure_service_reference_model = EndpointGatewayTargetProviderInfrastructureServiceReference.from_dict(endpoint_gateway_target_provider_infrastructure_service_reference_model_json)
- assert endpoint_gateway_target_provider_infrastructure_service_reference_model != False
+ # Construct a model instance of InstanceProfileVolumeBandwidthFixed by calling from_dict on the json representation
+ instance_profile_volume_bandwidth_fixed_model = InstanceProfileVolumeBandwidthFixed.from_dict(instance_profile_volume_bandwidth_fixed_model_json)
+ assert instance_profile_volume_bandwidth_fixed_model != False
- # Construct a model instance of EndpointGatewayTargetProviderInfrastructureServiceReference by calling from_dict on the json representation
- endpoint_gateway_target_provider_infrastructure_service_reference_model_dict = EndpointGatewayTargetProviderInfrastructureServiceReference.from_dict(endpoint_gateway_target_provider_infrastructure_service_reference_model_json).__dict__
- endpoint_gateway_target_provider_infrastructure_service_reference_model2 = EndpointGatewayTargetProviderInfrastructureServiceReference(**endpoint_gateway_target_provider_infrastructure_service_reference_model_dict)
+ # Construct a model instance of InstanceProfileVolumeBandwidthFixed by calling from_dict on the json representation
+ instance_profile_volume_bandwidth_fixed_model_dict = InstanceProfileVolumeBandwidthFixed.from_dict(instance_profile_volume_bandwidth_fixed_model_json).__dict__
+ instance_profile_volume_bandwidth_fixed_model2 = InstanceProfileVolumeBandwidthFixed(**instance_profile_volume_bandwidth_fixed_model_dict)
# Verify the model instances are equivalent
- assert endpoint_gateway_target_provider_infrastructure_service_reference_model == endpoint_gateway_target_provider_infrastructure_service_reference_model2
+ assert instance_profile_volume_bandwidth_fixed_model == instance_profile_volume_bandwidth_fixed_model2
# Convert model instance back to dict and verify no loss of data
- endpoint_gateway_target_provider_infrastructure_service_reference_model_json2 = endpoint_gateway_target_provider_infrastructure_service_reference_model.to_dict()
- assert endpoint_gateway_target_provider_infrastructure_service_reference_model_json2 == endpoint_gateway_target_provider_infrastructure_service_reference_model_json
+ instance_profile_volume_bandwidth_fixed_model_json2 = instance_profile_volume_bandwidth_fixed_model.to_dict()
+ assert instance_profile_volume_bandwidth_fixed_model_json2 == instance_profile_volume_bandwidth_fixed_model_json
-class TestModel_FloatingIPPrototypeFloatingIPByTarget:
+class TestModel_InstanceProfileVolumeBandwidthRange:
"""
- Test Class for FloatingIPPrototypeFloatingIPByTarget
+ Test Class for InstanceProfileVolumeBandwidthRange
"""
- def test_floating_ip_prototype_floating_ip_by_target_serialization(self):
+ def test_instance_profile_volume_bandwidth_range_serialization(self):
"""
- Test serialization/deserialization for FloatingIPPrototypeFloatingIPByTarget
+ Test serialization/deserialization for InstanceProfileVolumeBandwidthRange
"""
- # 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'
-
- floating_ip_target_prototype_model = {} # FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityById
- floating_ip_target_prototype_model['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e'
-
- # Construct a json representation of a FloatingIPPrototypeFloatingIPByTarget model
- floating_ip_prototype_floating_ip_by_target_model_json = {}
- floating_ip_prototype_floating_ip_by_target_model_json['name'] = 'my-floating-ip'
- floating_ip_prototype_floating_ip_by_target_model_json['resource_group'] = resource_group_identity_model
- floating_ip_prototype_floating_ip_by_target_model_json['target'] = floating_ip_target_prototype_model
+ # Construct a json representation of a InstanceProfileVolumeBandwidthRange model
+ instance_profile_volume_bandwidth_range_model_json = {}
+ instance_profile_volume_bandwidth_range_model_json['default'] = 10000
+ instance_profile_volume_bandwidth_range_model_json['max'] = 80000
+ instance_profile_volume_bandwidth_range_model_json['min'] = 1000
+ instance_profile_volume_bandwidth_range_model_json['step'] = 1000
+ instance_profile_volume_bandwidth_range_model_json['type'] = 'range'
- # Construct a model instance of FloatingIPPrototypeFloatingIPByTarget by calling from_dict on the json representation
- floating_ip_prototype_floating_ip_by_target_model = FloatingIPPrototypeFloatingIPByTarget.from_dict(floating_ip_prototype_floating_ip_by_target_model_json)
- assert floating_ip_prototype_floating_ip_by_target_model != False
+ # Construct a model instance of InstanceProfileVolumeBandwidthRange by calling from_dict on the json representation
+ instance_profile_volume_bandwidth_range_model = InstanceProfileVolumeBandwidthRange.from_dict(instance_profile_volume_bandwidth_range_model_json)
+ assert instance_profile_volume_bandwidth_range_model != False
- # Construct a model instance of FloatingIPPrototypeFloatingIPByTarget by calling from_dict on the json representation
- floating_ip_prototype_floating_ip_by_target_model_dict = FloatingIPPrototypeFloatingIPByTarget.from_dict(floating_ip_prototype_floating_ip_by_target_model_json).__dict__
- floating_ip_prototype_floating_ip_by_target_model2 = FloatingIPPrototypeFloatingIPByTarget(**floating_ip_prototype_floating_ip_by_target_model_dict)
+ # Construct a model instance of InstanceProfileVolumeBandwidthRange by calling from_dict on the json representation
+ instance_profile_volume_bandwidth_range_model_dict = InstanceProfileVolumeBandwidthRange.from_dict(instance_profile_volume_bandwidth_range_model_json).__dict__
+ instance_profile_volume_bandwidth_range_model2 = InstanceProfileVolumeBandwidthRange(**instance_profile_volume_bandwidth_range_model_dict)
# Verify the model instances are equivalent
- assert floating_ip_prototype_floating_ip_by_target_model == floating_ip_prototype_floating_ip_by_target_model2
+ assert instance_profile_volume_bandwidth_range_model == instance_profile_volume_bandwidth_range_model2
# Convert model instance back to dict and verify no loss of data
- floating_ip_prototype_floating_ip_by_target_model_json2 = floating_ip_prototype_floating_ip_by_target_model.to_dict()
- assert floating_ip_prototype_floating_ip_by_target_model_json2 == floating_ip_prototype_floating_ip_by_target_model_json
+ instance_profile_volume_bandwidth_range_model_json2 = instance_profile_volume_bandwidth_range_model.to_dict()
+ assert instance_profile_volume_bandwidth_range_model_json2 == instance_profile_volume_bandwidth_range_model_json
-class TestModel_FloatingIPPrototypeFloatingIPByZone:
+class TestModel_InstancePrototypeInstanceBySourceTemplate:
"""
- Test Class for FloatingIPPrototypeFloatingIPByZone
+ Test Class for InstancePrototypeInstanceBySourceTemplate
"""
- def test_floating_ip_prototype_floating_ip_by_zone_serialization(self):
+ def test_instance_prototype_instance_by_source_template_serialization(self):
"""
- Test serialization/deserialization for FloatingIPPrototypeFloatingIPByZone
+ Test serialization/deserialization for InstancePrototypeInstanceBySourceTemplate
"""
# 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'
+ instance_availability_policy_prototype_model = {} # InstanceAvailabilityPolicyPrototype
+ instance_availability_policy_prototype_model['host_failure'] = 'restart'
- zone_identity_model = {} # ZoneIdentityByName
- zone_identity_model['name'] = 'us-south-1'
+ trusted_profile_identity_model = {} # TrustedProfileIdentityTrustedProfileById
+ trusted_profile_identity_model['id'] = 'Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5'
- # Construct a json representation of a FloatingIPPrototypeFloatingIPByZone model
- floating_ip_prototype_floating_ip_by_zone_model_json = {}
- floating_ip_prototype_floating_ip_by_zone_model_json['name'] = 'my-floating-ip'
- floating_ip_prototype_floating_ip_by_zone_model_json['resource_group'] = resource_group_identity_model
- floating_ip_prototype_floating_ip_by_zone_model_json['zone'] = zone_identity_model
+ instance_default_trusted_profile_prototype_model = {} # InstanceDefaultTrustedProfilePrototype
+ instance_default_trusted_profile_prototype_model['auto_link'] = False
+ instance_default_trusted_profile_prototype_model['target'] = trusted_profile_identity_model
- # Construct a model instance of FloatingIPPrototypeFloatingIPByZone by calling from_dict on the json representation
- floating_ip_prototype_floating_ip_by_zone_model = FloatingIPPrototypeFloatingIPByZone.from_dict(floating_ip_prototype_floating_ip_by_zone_model_json)
- assert floating_ip_prototype_floating_ip_by_zone_model != False
+ key_identity_model = {} # KeyIdentityById
+ key_identity_model['id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803'
- # Construct a model instance of FloatingIPPrototypeFloatingIPByZone by calling from_dict on the json representation
- floating_ip_prototype_floating_ip_by_zone_model_dict = FloatingIPPrototypeFloatingIPByZone.from_dict(floating_ip_prototype_floating_ip_by_zone_model_json).__dict__
- floating_ip_prototype_floating_ip_by_zone_model2 = FloatingIPPrototypeFloatingIPByZone(**floating_ip_prototype_floating_ip_by_zone_model_dict)
+ instance_metadata_service_prototype_model = {} # InstanceMetadataServicePrototype
+ instance_metadata_service_prototype_model['enabled'] = False
+ instance_metadata_service_prototype_model['protocol'] = 'https'
+ instance_metadata_service_prototype_model['response_hop_limit'] = 2
- # Verify the model instances are equivalent
- assert floating_ip_prototype_floating_ip_by_zone_model == floating_ip_prototype_floating_ip_by_zone_model2
+ instance_placement_target_prototype_model = {} # InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById
+ instance_placement_target_prototype_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
- # Convert model instance back to dict and verify no loss of data
- 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
+ instance_profile_identity_model = {} # InstanceProfileIdentityByName
+ instance_profile_identity_model['name'] = 'cx2-16x32'
+ reservation_identity_model = {} # ReservationIdentityById
+ reservation_identity_model['id'] = '7187-ba49df72-37b8-43ac-98da-f8e029de0e63'
-class TestModel_FloatingIPTargetBareMetalServerNetworkInterfaceReference:
- """
- Test Class for FloatingIPTargetBareMetalServerNetworkInterfaceReference
- """
+ instance_reservation_affinity_prototype_model = {} # InstanceReservationAffinityPrototype
+ instance_reservation_affinity_prototype_model['policy'] = 'disabled'
+ instance_reservation_affinity_prototype_model['pool'] = [reservation_identity_model]
- def test_floating_ip_target_bare_metal_server_network_interface_reference_serialization(self):
- """
- Test serialization/deserialization for FloatingIPTargetBareMetalServerNetworkInterfaceReference
- """
+ resource_group_identity_model = {} # ResourceGroupIdentityById
+ resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
- # Construct dict forms of any model objects needed in order to build this model.
+ volume_attachment_prototype_volume_model = {} # VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById
+ volume_attachment_prototype_volume_model['id'] = '1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
- bare_metal_server_network_interface_reference_deleted_model = {} # BareMetalServerNetworkInterfaceReferenceDeleted
- bare_metal_server_network_interface_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ volume_attachment_prototype_model = {} # VolumeAttachmentPrototype
+ volume_attachment_prototype_model['delete_volume_on_instance_delete'] = False
+ volume_attachment_prototype_model['name'] = 'my-volume-attachment'
+ volume_attachment_prototype_model['volume'] = volume_attachment_prototype_volume_model
- reserved_ip_reference_deleted_model = {} # ReservedIPReferenceDeleted
- reserved_ip_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ vpc_identity_model = {} # VPCIdentityById
+ vpc_identity_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b'
- 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'
+ encryption_key_identity_model = {} # EncryptionKeyIdentityByCRN
+ encryption_key_identity_model['crn'] = 'crn:v1:bluemix:public:kms:us-south:a/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179'
- # Construct a json representation of a FloatingIPTargetBareMetalServerNetworkInterfaceReference model
- floating_ip_target_bare_metal_server_network_interface_reference_model_json = {}
- floating_ip_target_bare_metal_server_network_interface_reference_model_json['deleted'] = bare_metal_server_network_interface_reference_deleted_model
- floating_ip_target_bare_metal_server_network_interface_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e'
- floating_ip_target_bare_metal_server_network_interface_reference_model_json['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e'
- floating_ip_target_bare_metal_server_network_interface_reference_model_json['name'] = 'my-bare-metal-server-network-interface'
- floating_ip_target_bare_metal_server_network_interface_reference_model_json['primary_ip'] = reserved_ip_reference_model
- floating_ip_target_bare_metal_server_network_interface_reference_model_json['resource_type'] = 'network_interface'
+ volume_profile_identity_model = {} # VolumeProfileIdentityByName
+ volume_profile_identity_model['name'] = 'general-purpose'
- # Construct a model instance of FloatingIPTargetBareMetalServerNetworkInterfaceReference by calling from_dict on the json representation
- floating_ip_target_bare_metal_server_network_interface_reference_model = FloatingIPTargetBareMetalServerNetworkInterfaceReference.from_dict(floating_ip_target_bare_metal_server_network_interface_reference_model_json)
- assert floating_ip_target_bare_metal_server_network_interface_reference_model != False
+ volume_prototype_instance_by_image_context_model = {} # VolumePrototypeInstanceByImageContext
+ volume_prototype_instance_by_image_context_model['capacity'] = 100
+ volume_prototype_instance_by_image_context_model['encryption_key'] = encryption_key_identity_model
+ volume_prototype_instance_by_image_context_model['iops'] = 10000
+ volume_prototype_instance_by_image_context_model['name'] = 'my-volume'
+ volume_prototype_instance_by_image_context_model['profile'] = volume_profile_identity_model
+ volume_prototype_instance_by_image_context_model['resource_group'] = resource_group_identity_model
+ volume_prototype_instance_by_image_context_model['user_tags'] = []
- # Construct a model instance of FloatingIPTargetBareMetalServerNetworkInterfaceReference by calling from_dict on the json representation
- floating_ip_target_bare_metal_server_network_interface_reference_model_dict = FloatingIPTargetBareMetalServerNetworkInterfaceReference.from_dict(floating_ip_target_bare_metal_server_network_interface_reference_model_json).__dict__
- floating_ip_target_bare_metal_server_network_interface_reference_model2 = FloatingIPTargetBareMetalServerNetworkInterfaceReference(**floating_ip_target_bare_metal_server_network_interface_reference_model_dict)
+ 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
- # Verify the model instances are equivalent
- assert floating_ip_target_bare_metal_server_network_interface_reference_model == floating_ip_target_bare_metal_server_network_interface_reference_model2
+ catalog_offering_identity_model = {} # CatalogOfferingIdentityCatalogOfferingByCRN
+ catalog_offering_identity_model['crn'] = 'crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:offering:00111601-0ec5-41ac-b142-96d1e64e6442'
- # Convert model instance back to dict and verify no loss of data
- floating_ip_target_bare_metal_server_network_interface_reference_model_json2 = floating_ip_target_bare_metal_server_network_interface_reference_model.to_dict()
- assert floating_ip_target_bare_metal_server_network_interface_reference_model_json2 == floating_ip_target_bare_metal_server_network_interface_reference_model_json
+ instance_catalog_offering_prototype_model = {} # InstanceCatalogOfferingPrototypeCatalogOfferingByOffering
+ instance_catalog_offering_prototype_model['offering'] = catalog_offering_identity_model
+ image_identity_model = {} # ImageIdentityById
+ image_identity_model['id'] = 'r006-02c73baf-9abb-493d-9e41-d0f1866f4051'
-class TestModel_FloatingIPTargetNetworkInterfaceReference:
- """
- Test Class for FloatingIPTargetNetworkInterfaceReference
- """
+ virtual_network_interface_ip_prototype_model = {} # VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext
+ virtual_network_interface_ip_prototype_model['address'] = '10.0.0.5'
+ virtual_network_interface_ip_prototype_model['auto_delete'] = False
+ virtual_network_interface_ip_prototype_model['name'] = 'my-reserved-ip'
- def test_floating_ip_target_network_interface_reference_serialization(self):
- """
- Test serialization/deserialization for FloatingIPTargetNetworkInterfaceReference
- """
+ virtual_network_interface_primary_ip_prototype_model = {} # VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext
+ virtual_network_interface_primary_ip_prototype_model['address'] = '10.0.0.5'
+ virtual_network_interface_primary_ip_prototype_model['auto_delete'] = False
+ virtual_network_interface_primary_ip_prototype_model['name'] = 'my-reserved-ip'
- # 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'
- network_interface_reference_deleted_model = {} # NetworkInterfaceReferenceDeleted
- network_interface_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ subnet_identity_model = {} # SubnetIdentityById
+ subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
- reserved_ip_reference_deleted_model = {} # ReservedIPReferenceDeleted
- reserved_ip_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ instance_network_attachment_prototype_virtual_network_interface_model = {} # InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeInstanceNetworkAttachmentContext
+ instance_network_attachment_prototype_virtual_network_interface_model['allow_ip_spoofing'] = True
+ instance_network_attachment_prototype_virtual_network_interface_model['auto_delete'] = False
+ instance_network_attachment_prototype_virtual_network_interface_model['enable_infrastructure_nat'] = True
+ instance_network_attachment_prototype_virtual_network_interface_model['ips'] = [virtual_network_interface_ip_prototype_model]
+ instance_network_attachment_prototype_virtual_network_interface_model['name'] = 'my-virtual-network-interface'
+ instance_network_attachment_prototype_virtual_network_interface_model['primary_ip'] = virtual_network_interface_primary_ip_prototype_model
+ instance_network_attachment_prototype_virtual_network_interface_model['resource_group'] = resource_group_identity_model
+ instance_network_attachment_prototype_virtual_network_interface_model['security_groups'] = [security_group_identity_model]
+ instance_network_attachment_prototype_virtual_network_interface_model['subnet'] = subnet_identity_model
+
+ instance_network_attachment_prototype_model = {} # InstanceNetworkAttachmentPrototype
+ instance_network_attachment_prototype_model['name'] = 'my-instance-network-attachment'
+ instance_network_attachment_prototype_model['virtual_network_interface'] = instance_network_attachment_prototype_virtual_network_interface_model
- 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'
+ network_interface_ip_prototype_model = {} # NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext
+ network_interface_ip_prototype_model['address'] = '10.0.0.5'
+ network_interface_ip_prototype_model['auto_delete'] = False
+ network_interface_ip_prototype_model['name'] = 'my-reserved-ip'
- # Construct a json representation of a FloatingIPTargetNetworkInterfaceReference model
- floating_ip_target_network_interface_reference_model_json = {}
- floating_ip_target_network_interface_reference_model_json['deleted'] = network_interface_reference_deleted_model
- floating_ip_target_network_interface_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e'
- floating_ip_target_network_interface_reference_model_json['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e'
- floating_ip_target_network_interface_reference_model_json['name'] = 'my-instance-network-interface'
- floating_ip_target_network_interface_reference_model_json['primary_ip'] = reserved_ip_reference_model
- floating_ip_target_network_interface_reference_model_json['resource_type'] = 'network_interface'
+ network_interface_prototype_model = {} # NetworkInterfacePrototype
+ network_interface_prototype_model['allow_ip_spoofing'] = True
+ network_interface_prototype_model['name'] = 'my-instance-network-interface'
+ network_interface_prototype_model['primary_ip'] = network_interface_ip_prototype_model
+ network_interface_prototype_model['security_groups'] = [security_group_identity_model]
+ network_interface_prototype_model['subnet'] = subnet_identity_model
- # Construct a model instance of FloatingIPTargetNetworkInterfaceReference by calling from_dict on the json representation
- floating_ip_target_network_interface_reference_model = FloatingIPTargetNetworkInterfaceReference.from_dict(floating_ip_target_network_interface_reference_model_json)
- assert floating_ip_target_network_interface_reference_model != False
+ instance_template_identity_model = {} # InstanceTemplateIdentityById
+ instance_template_identity_model['id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803'
- # Construct a model instance of FloatingIPTargetNetworkInterfaceReference by calling from_dict on the json representation
- floating_ip_target_network_interface_reference_model_dict = FloatingIPTargetNetworkInterfaceReference.from_dict(floating_ip_target_network_interface_reference_model_json).__dict__
- floating_ip_target_network_interface_reference_model2 = FloatingIPTargetNetworkInterfaceReference(**floating_ip_target_network_interface_reference_model_dict)
+ zone_identity_model = {} # ZoneIdentityByName
+ zone_identity_model['name'] = 'us-south-1'
+
+ # Construct a json representation of a InstancePrototypeInstanceBySourceTemplate model
+ instance_prototype_instance_by_source_template_model_json = {}
+ instance_prototype_instance_by_source_template_model_json['availability_policy'] = instance_availability_policy_prototype_model
+ instance_prototype_instance_by_source_template_model_json['default_trusted_profile'] = instance_default_trusted_profile_prototype_model
+ instance_prototype_instance_by_source_template_model_json['keys'] = [key_identity_model]
+ instance_prototype_instance_by_source_template_model_json['metadata_service'] = instance_metadata_service_prototype_model
+ instance_prototype_instance_by_source_template_model_json['name'] = 'my-instance'
+ instance_prototype_instance_by_source_template_model_json['placement_target'] = instance_placement_target_prototype_model
+ instance_prototype_instance_by_source_template_model_json['profile'] = instance_profile_identity_model
+ instance_prototype_instance_by_source_template_model_json['reservation_affinity'] = instance_reservation_affinity_prototype_model
+ instance_prototype_instance_by_source_template_model_json['resource_group'] = resource_group_identity_model
+ instance_prototype_instance_by_source_template_model_json['total_volume_bandwidth'] = 500
+ instance_prototype_instance_by_source_template_model_json['user_data'] = 'testString'
+ instance_prototype_instance_by_source_template_model_json['volume_attachments'] = [volume_attachment_prototype_model]
+ instance_prototype_instance_by_source_template_model_json['vpc'] = vpc_identity_model
+ instance_prototype_instance_by_source_template_model_json['boot_volume_attachment'] = volume_attachment_prototype_instance_by_image_context_model
+ instance_prototype_instance_by_source_template_model_json['catalog_offering'] = instance_catalog_offering_prototype_model
+ instance_prototype_instance_by_source_template_model_json['image'] = image_identity_model
+ instance_prototype_instance_by_source_template_model_json['network_attachments'] = [instance_network_attachment_prototype_model]
+ instance_prototype_instance_by_source_template_model_json['network_interfaces'] = [network_interface_prototype_model]
+ instance_prototype_instance_by_source_template_model_json['primary_network_attachment'] = instance_network_attachment_prototype_model
+ instance_prototype_instance_by_source_template_model_json['primary_network_interface'] = network_interface_prototype_model
+ instance_prototype_instance_by_source_template_model_json['source_template'] = instance_template_identity_model
+ instance_prototype_instance_by_source_template_model_json['zone'] = zone_identity_model
+
+ # Construct a model instance of InstancePrototypeInstanceBySourceTemplate by calling from_dict on the json representation
+ instance_prototype_instance_by_source_template_model = InstancePrototypeInstanceBySourceTemplate.from_dict(instance_prototype_instance_by_source_template_model_json)
+ assert instance_prototype_instance_by_source_template_model != False
+
+ # Construct a model instance of InstancePrototypeInstanceBySourceTemplate by calling from_dict on the json representation
+ instance_prototype_instance_by_source_template_model_dict = InstancePrototypeInstanceBySourceTemplate.from_dict(instance_prototype_instance_by_source_template_model_json).__dict__
+ instance_prototype_instance_by_source_template_model2 = InstancePrototypeInstanceBySourceTemplate(**instance_prototype_instance_by_source_template_model_dict)
# Verify the model instances are equivalent
- assert floating_ip_target_network_interface_reference_model == floating_ip_target_network_interface_reference_model2
+ assert instance_prototype_instance_by_source_template_model == instance_prototype_instance_by_source_template_model2
# Convert model instance back to dict and verify no loss of data
- floating_ip_target_network_interface_reference_model_json2 = floating_ip_target_network_interface_reference_model.to_dict()
- assert floating_ip_target_network_interface_reference_model_json2 == floating_ip_target_network_interface_reference_model_json
+ instance_prototype_instance_by_source_template_model_json2 = instance_prototype_instance_by_source_template_model.to_dict()
+ assert instance_prototype_instance_by_source_template_model_json2 == instance_prototype_instance_by_source_template_model_json
-class TestModel_FloatingIPTargetPublicGatewayReference:
+class TestModel_InstanceTemplateIdentityByCRN:
"""
- Test Class for FloatingIPTargetPublicGatewayReference
+ Test Class for InstanceTemplateIdentityByCRN
"""
- def test_floating_ip_target_public_gateway_reference_serialization(self):
+ def test_instance_template_identity_by_crn_serialization(self):
"""
- Test serialization/deserialization for FloatingIPTargetPublicGatewayReference
+ Test serialization/deserialization for InstanceTemplateIdentityByCRN
"""
- # Construct dict forms of any model objects needed in order to build this model.
-
- 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 FloatingIPTargetPublicGatewayReference model
- floating_ip_target_public_gateway_reference_model_json = {}
- floating_ip_target_public_gateway_reference_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::public-gateway:dc5431ef-1fc6-4861-adc9-a59d077d1241'
- floating_ip_target_public_gateway_reference_model_json['deleted'] = public_gateway_reference_deleted_model
- floating_ip_target_public_gateway_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/public_gateways/dc5431ef-1fc6-4861-adc9-a59d077d1241'
- floating_ip_target_public_gateway_reference_model_json['id'] = 'dc5431ef-1fc6-4861-adc9-a59d077d1241'
- floating_ip_target_public_gateway_reference_model_json['name'] = 'my-public-gateway'
- floating_ip_target_public_gateway_reference_model_json['resource_type'] = 'public_gateway'
+ # Construct a json representation of a InstanceTemplateIdentityByCRN model
+ instance_template_identity_by_crn_model_json = {}
+ instance_template_identity_by_crn_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a'
- # Construct a model instance of FloatingIPTargetPublicGatewayReference by calling from_dict on the json representation
- floating_ip_target_public_gateway_reference_model = FloatingIPTargetPublicGatewayReference.from_dict(floating_ip_target_public_gateway_reference_model_json)
- assert floating_ip_target_public_gateway_reference_model != False
+ # Construct a model instance of InstanceTemplateIdentityByCRN by calling from_dict on the json representation
+ instance_template_identity_by_crn_model = InstanceTemplateIdentityByCRN.from_dict(instance_template_identity_by_crn_model_json)
+ assert instance_template_identity_by_crn_model != False
- # Construct a model instance of FloatingIPTargetPublicGatewayReference by calling from_dict on the json representation
- floating_ip_target_public_gateway_reference_model_dict = FloatingIPTargetPublicGatewayReference.from_dict(floating_ip_target_public_gateway_reference_model_json).__dict__
- floating_ip_target_public_gateway_reference_model2 = FloatingIPTargetPublicGatewayReference(**floating_ip_target_public_gateway_reference_model_dict)
+ # Construct a model instance of InstanceTemplateIdentityByCRN by calling from_dict on the json representation
+ instance_template_identity_by_crn_model_dict = InstanceTemplateIdentityByCRN.from_dict(instance_template_identity_by_crn_model_json).__dict__
+ instance_template_identity_by_crn_model2 = InstanceTemplateIdentityByCRN(**instance_template_identity_by_crn_model_dict)
# Verify the model instances are equivalent
- assert floating_ip_target_public_gateway_reference_model == floating_ip_target_public_gateway_reference_model2
+ assert instance_template_identity_by_crn_model == instance_template_identity_by_crn_model2
# Convert model instance back to dict and verify no loss of data
- floating_ip_target_public_gateway_reference_model_json2 = floating_ip_target_public_gateway_reference_model.to_dict()
- assert floating_ip_target_public_gateway_reference_model_json2 == floating_ip_target_public_gateway_reference_model_json
+ instance_template_identity_by_crn_model_json2 = instance_template_identity_by_crn_model.to_dict()
+ assert instance_template_identity_by_crn_model_json2 == instance_template_identity_by_crn_model_json
-class TestModel_FlowLogCollectorTargetInstanceReference:
+class TestModel_InstanceTemplateIdentityByHref:
"""
- Test Class for FlowLogCollectorTargetInstanceReference
+ Test Class for InstanceTemplateIdentityByHref
"""
- def test_flow_log_collector_target_instance_reference_serialization(self):
+ def test_instance_template_identity_by_href_serialization(self):
"""
- Test serialization/deserialization for FlowLogCollectorTargetInstanceReference
+ Test serialization/deserialization for InstanceTemplateIdentityByHref
"""
- # 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'
-
- # Construct a json representation of a FlowLogCollectorTargetInstanceReference model
- flow_log_collector_target_instance_reference_model_json = {}
- flow_log_collector_target_instance_reference_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a'
- flow_log_collector_target_instance_reference_model_json['deleted'] = instance_reference_deleted_model
- flow_log_collector_target_instance_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a'
- flow_log_collector_target_instance_reference_model_json['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
- flow_log_collector_target_instance_reference_model_json['name'] = 'my-instance'
+ # Construct a json representation of a InstanceTemplateIdentityByHref model
+ instance_template_identity_by_href_model_json = {}
+ instance_template_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a'
- # Construct a model instance of FlowLogCollectorTargetInstanceReference by calling from_dict on the json representation
- flow_log_collector_target_instance_reference_model = FlowLogCollectorTargetInstanceReference.from_dict(flow_log_collector_target_instance_reference_model_json)
- assert flow_log_collector_target_instance_reference_model != False
+ # Construct a model instance of InstanceTemplateIdentityByHref by calling from_dict on the json representation
+ instance_template_identity_by_href_model = InstanceTemplateIdentityByHref.from_dict(instance_template_identity_by_href_model_json)
+ assert instance_template_identity_by_href_model != False
- # Construct a model instance of FlowLogCollectorTargetInstanceReference by calling from_dict on the json representation
- flow_log_collector_target_instance_reference_model_dict = FlowLogCollectorTargetInstanceReference.from_dict(flow_log_collector_target_instance_reference_model_json).__dict__
- flow_log_collector_target_instance_reference_model2 = FlowLogCollectorTargetInstanceReference(**flow_log_collector_target_instance_reference_model_dict)
+ # Construct a model instance of InstanceTemplateIdentityByHref by calling from_dict on the json representation
+ instance_template_identity_by_href_model_dict = InstanceTemplateIdentityByHref.from_dict(instance_template_identity_by_href_model_json).__dict__
+ instance_template_identity_by_href_model2 = InstanceTemplateIdentityByHref(**instance_template_identity_by_href_model_dict)
# Verify the model instances are equivalent
- assert flow_log_collector_target_instance_reference_model == flow_log_collector_target_instance_reference_model2
+ assert instance_template_identity_by_href_model == instance_template_identity_by_href_model2
# Convert model instance back to dict and verify no loss of data
- flow_log_collector_target_instance_reference_model_json2 = flow_log_collector_target_instance_reference_model.to_dict()
- assert flow_log_collector_target_instance_reference_model_json2 == flow_log_collector_target_instance_reference_model_json
+ instance_template_identity_by_href_model_json2 = instance_template_identity_by_href_model.to_dict()
+ assert instance_template_identity_by_href_model_json2 == instance_template_identity_by_href_model_json
-class TestModel_FlowLogCollectorTargetNetworkInterfaceReferenceTargetContext:
+class TestModel_InstanceTemplateIdentityById:
"""
- Test Class for FlowLogCollectorTargetNetworkInterfaceReferenceTargetContext
+ Test Class for InstanceTemplateIdentityById
"""
- def test_flow_log_collector_target_network_interface_reference_target_context_serialization(self):
+ def test_instance_template_identity_by_id_serialization(self):
"""
- Test serialization/deserialization for FlowLogCollectorTargetNetworkInterfaceReferenceTargetContext
+ Test serialization/deserialization for InstanceTemplateIdentityById
"""
- # Construct dict forms of any model objects needed in order to build this model.
-
- network_interface_reference_target_context_deleted_model = {} # NetworkInterfaceReferenceTargetContextDeleted
- network_interface_reference_target_context_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
-
- # Construct a json representation of a FlowLogCollectorTargetNetworkInterfaceReferenceTargetContext model
- flow_log_collector_target_network_interface_reference_target_context_model_json = {}
- flow_log_collector_target_network_interface_reference_target_context_model_json['deleted'] = network_interface_reference_target_context_deleted_model
- flow_log_collector_target_network_interface_reference_target_context_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e'
- flow_log_collector_target_network_interface_reference_target_context_model_json['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e'
- flow_log_collector_target_network_interface_reference_target_context_model_json['name'] = 'my-instance-network-interface'
- flow_log_collector_target_network_interface_reference_target_context_model_json['resource_type'] = 'network_interface'
+ # Construct a json representation of a InstanceTemplateIdentityById model
+ instance_template_identity_by_id_model_json = {}
+ instance_template_identity_by_id_model_json['id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803'
- # Construct a model instance of FlowLogCollectorTargetNetworkInterfaceReferenceTargetContext by calling from_dict on the json representation
- flow_log_collector_target_network_interface_reference_target_context_model = FlowLogCollectorTargetNetworkInterfaceReferenceTargetContext.from_dict(flow_log_collector_target_network_interface_reference_target_context_model_json)
- assert flow_log_collector_target_network_interface_reference_target_context_model != False
+ # Construct a model instance of InstanceTemplateIdentityById by calling from_dict on the json representation
+ instance_template_identity_by_id_model = InstanceTemplateIdentityById.from_dict(instance_template_identity_by_id_model_json)
+ assert instance_template_identity_by_id_model != False
- # Construct a model instance of FlowLogCollectorTargetNetworkInterfaceReferenceTargetContext by calling from_dict on the json representation
- flow_log_collector_target_network_interface_reference_target_context_model_dict = FlowLogCollectorTargetNetworkInterfaceReferenceTargetContext.from_dict(flow_log_collector_target_network_interface_reference_target_context_model_json).__dict__
- flow_log_collector_target_network_interface_reference_target_context_model2 = FlowLogCollectorTargetNetworkInterfaceReferenceTargetContext(**flow_log_collector_target_network_interface_reference_target_context_model_dict)
+ # Construct a model instance of InstanceTemplateIdentityById by calling from_dict on the json representation
+ instance_template_identity_by_id_model_dict = InstanceTemplateIdentityById.from_dict(instance_template_identity_by_id_model_json).__dict__
+ instance_template_identity_by_id_model2 = InstanceTemplateIdentityById(**instance_template_identity_by_id_model_dict)
# Verify the model instances are equivalent
- assert flow_log_collector_target_network_interface_reference_target_context_model == flow_log_collector_target_network_interface_reference_target_context_model2
+ assert instance_template_identity_by_id_model == instance_template_identity_by_id_model2
# Convert model instance back to dict and verify no loss of data
- flow_log_collector_target_network_interface_reference_target_context_model_json2 = flow_log_collector_target_network_interface_reference_target_context_model.to_dict()
- assert flow_log_collector_target_network_interface_reference_target_context_model_json2 == flow_log_collector_target_network_interface_reference_target_context_model_json
+ instance_template_identity_by_id_model_json2 = instance_template_identity_by_id_model.to_dict()
+ assert instance_template_identity_by_id_model_json2 == instance_template_identity_by_id_model_json
-class TestModel_FlowLogCollectorTargetSubnetReference:
+class TestModel_InstanceTemplatePrototypeInstanceTemplateBySourceTemplate:
"""
- Test Class for FlowLogCollectorTargetSubnetReference
+ Test Class for InstanceTemplatePrototypeInstanceTemplateBySourceTemplate
"""
- def test_flow_log_collector_target_subnet_reference_serialization(self):
+ def test_instance_template_prototype_instance_template_by_source_template_serialization(self):
"""
- Test serialization/deserialization for FlowLogCollectorTargetSubnetReference
+ Test serialization/deserialization for InstanceTemplatePrototypeInstanceTemplateBySourceTemplate
"""
# 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'
+ instance_availability_policy_prototype_model = {} # InstanceAvailabilityPolicyPrototype
+ instance_availability_policy_prototype_model['host_failure'] = 'restart'
- # Construct a json representation of a FlowLogCollectorTargetSubnetReference model
- flow_log_collector_target_subnet_reference_model_json = {}
- flow_log_collector_target_subnet_reference_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
- flow_log_collector_target_subnet_reference_model_json['deleted'] = subnet_reference_deleted_model
- flow_log_collector_target_subnet_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
- flow_log_collector_target_subnet_reference_model_json['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
- flow_log_collector_target_subnet_reference_model_json['name'] = 'my-subnet'
- flow_log_collector_target_subnet_reference_model_json['resource_type'] = 'subnet'
+ trusted_profile_identity_model = {} # TrustedProfileIdentityTrustedProfileById
+ trusted_profile_identity_model['id'] = 'Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5'
- # Construct a model instance of FlowLogCollectorTargetSubnetReference by calling from_dict on the json representation
- flow_log_collector_target_subnet_reference_model = FlowLogCollectorTargetSubnetReference.from_dict(flow_log_collector_target_subnet_reference_model_json)
- assert flow_log_collector_target_subnet_reference_model != False
+ instance_default_trusted_profile_prototype_model = {} # InstanceDefaultTrustedProfilePrototype
+ instance_default_trusted_profile_prototype_model['auto_link'] = False
+ instance_default_trusted_profile_prototype_model['target'] = trusted_profile_identity_model
- # Construct a model instance of FlowLogCollectorTargetSubnetReference by calling from_dict on the json representation
- flow_log_collector_target_subnet_reference_model_dict = FlowLogCollectorTargetSubnetReference.from_dict(flow_log_collector_target_subnet_reference_model_json).__dict__
- flow_log_collector_target_subnet_reference_model2 = FlowLogCollectorTargetSubnetReference(**flow_log_collector_target_subnet_reference_model_dict)
+ key_identity_model = {} # KeyIdentityById
+ key_identity_model['id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803'
- # Verify the model instances are equivalent
- assert flow_log_collector_target_subnet_reference_model == flow_log_collector_target_subnet_reference_model2
+ instance_metadata_service_prototype_model = {} # InstanceMetadataServicePrototype
+ instance_metadata_service_prototype_model['enabled'] = False
+ instance_metadata_service_prototype_model['protocol'] = 'https'
+ instance_metadata_service_prototype_model['response_hop_limit'] = 2
- # Convert model instance back to dict and verify no loss of data
- flow_log_collector_target_subnet_reference_model_json2 = flow_log_collector_target_subnet_reference_model.to_dict()
- assert flow_log_collector_target_subnet_reference_model_json2 == flow_log_collector_target_subnet_reference_model_json
+ instance_placement_target_prototype_model = {} # InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById
+ instance_placement_target_prototype_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
+ instance_profile_identity_model = {} # InstanceProfileIdentityByName
+ instance_profile_identity_model['name'] = 'cx2-16x32'
-class TestModel_FlowLogCollectorTargetVPCReference:
- """
- Test Class for FlowLogCollectorTargetVPCReference
- """
+ reservation_identity_model = {} # ReservationIdentityById
+ reservation_identity_model['id'] = '7187-ba49df72-37b8-43ac-98da-f8e029de0e63'
- def test_flow_log_collector_target_vpc_reference_serialization(self):
- """
- Test serialization/deserialization for FlowLogCollectorTargetVPCReference
- """
+ instance_reservation_affinity_prototype_model = {} # InstanceReservationAffinityPrototype
+ instance_reservation_affinity_prototype_model['policy'] = 'disabled'
+ instance_reservation_affinity_prototype_model['pool'] = [reservation_identity_model]
- # 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'
- vpc_reference_deleted_model = {} # VPCReferenceDeleted
- vpc_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ volume_attachment_prototype_volume_model = {} # VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById
+ volume_attachment_prototype_volume_model['id'] = '1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
- # Construct a json representation of a FlowLogCollectorTargetVPCReference model
- flow_log_collector_target_vpc_reference_model_json = {}
- flow_log_collector_target_vpc_reference_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b'
- flow_log_collector_target_vpc_reference_model_json['deleted'] = vpc_reference_deleted_model
- flow_log_collector_target_vpc_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b'
- flow_log_collector_target_vpc_reference_model_json['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b'
- flow_log_collector_target_vpc_reference_model_json['name'] = 'my-vpc'
- flow_log_collector_target_vpc_reference_model_json['resource_type'] = 'vpc'
+ volume_attachment_prototype_model = {} # VolumeAttachmentPrototype
+ volume_attachment_prototype_model['delete_volume_on_instance_delete'] = False
+ volume_attachment_prototype_model['name'] = 'my-volume-attachment'
+ volume_attachment_prototype_model['volume'] = volume_attachment_prototype_volume_model
- # Construct a model instance of FlowLogCollectorTargetVPCReference by calling from_dict on the json representation
- flow_log_collector_target_vpc_reference_model = FlowLogCollectorTargetVPCReference.from_dict(flow_log_collector_target_vpc_reference_model_json)
- assert flow_log_collector_target_vpc_reference_model != False
+ vpc_identity_model = {} # VPCIdentityById
+ vpc_identity_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b'
- # Construct a model instance of FlowLogCollectorTargetVPCReference by calling from_dict on the json representation
- flow_log_collector_target_vpc_reference_model_dict = FlowLogCollectorTargetVPCReference.from_dict(flow_log_collector_target_vpc_reference_model_json).__dict__
- flow_log_collector_target_vpc_reference_model2 = FlowLogCollectorTargetVPCReference(**flow_log_collector_target_vpc_reference_model_dict)
+ encryption_key_identity_model = {} # EncryptionKeyIdentityByCRN
+ encryption_key_identity_model['crn'] = 'crn:v1:bluemix:public:kms:us-south:a/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179'
- # Verify the model instances are equivalent
- assert flow_log_collector_target_vpc_reference_model == flow_log_collector_target_vpc_reference_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
- flow_log_collector_target_vpc_reference_model_json2 = flow_log_collector_target_vpc_reference_model.to_dict()
- assert flow_log_collector_target_vpc_reference_model_json2 == flow_log_collector_target_vpc_reference_model_json
+ volume_prototype_instance_by_image_context_model = {} # VolumePrototypeInstanceByImageContext
+ volume_prototype_instance_by_image_context_model['capacity'] = 100
+ volume_prototype_instance_by_image_context_model['encryption_key'] = encryption_key_identity_model
+ volume_prototype_instance_by_image_context_model['iops'] = 10000
+ volume_prototype_instance_by_image_context_model['name'] = 'my-volume'
+ volume_prototype_instance_by_image_context_model['profile'] = volume_profile_identity_model
+ volume_prototype_instance_by_image_context_model['resource_group'] = resource_group_identity_model
+ volume_prototype_instance_by_image_context_model['user_tags'] = []
+ 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
-class TestModel_ImageIdentityByCRN:
- """
- Test Class for ImageIdentityByCRN
- """
+ catalog_offering_identity_model = {} # CatalogOfferingIdentityCatalogOfferingByCRN
+ catalog_offering_identity_model['crn'] = 'crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:offering:00111601-0ec5-41ac-b142-96d1e64e6442'
- def test_image_identity_by_crn_serialization(self):
- """
- Test serialization/deserialization for ImageIdentityByCRN
- """
+ instance_catalog_offering_prototype_model = {} # InstanceCatalogOfferingPrototypeCatalogOfferingByOffering
+ instance_catalog_offering_prototype_model['offering'] = catalog_offering_identity_model
- # Construct a json representation of a ImageIdentityByCRN model
- image_identity_by_crn_model_json = {}
- image_identity_by_crn_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8'
+ image_identity_model = {} # ImageIdentityById
+ image_identity_model['id'] = 'r006-02c73baf-9abb-493d-9e41-d0f1866f4051'
- # Construct a model instance of ImageIdentityByCRN by calling from_dict on the json representation
- image_identity_by_crn_model = ImageIdentityByCRN.from_dict(image_identity_by_crn_model_json)
- assert image_identity_by_crn_model != False
+ virtual_network_interface_ip_prototype_model = {} # VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext
+ virtual_network_interface_ip_prototype_model['address'] = '10.0.0.5'
+ virtual_network_interface_ip_prototype_model['auto_delete'] = False
+ virtual_network_interface_ip_prototype_model['name'] = 'my-reserved-ip'
- # Construct a model instance of ImageIdentityByCRN by calling from_dict on the json representation
- image_identity_by_crn_model_dict = ImageIdentityByCRN.from_dict(image_identity_by_crn_model_json).__dict__
- image_identity_by_crn_model2 = ImageIdentityByCRN(**image_identity_by_crn_model_dict)
+ virtual_network_interface_primary_ip_prototype_model = {} # VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext
+ virtual_network_interface_primary_ip_prototype_model['address'] = '10.0.0.5'
+ virtual_network_interface_primary_ip_prototype_model['auto_delete'] = False
+ virtual_network_interface_primary_ip_prototype_model['name'] = 'my-reserved-ip'
- # Verify the model instances are equivalent
- assert image_identity_by_crn_model == image_identity_by_crn_model2
+ security_group_identity_model = {} # SecurityGroupIdentityById
+ security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271'
- # Convert model instance back to dict and verify no loss of data
- image_identity_by_crn_model_json2 = image_identity_by_crn_model.to_dict()
- assert image_identity_by_crn_model_json2 == image_identity_by_crn_model_json
+ subnet_identity_model = {} # SubnetIdentityById
+ subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
+ instance_network_attachment_prototype_virtual_network_interface_model = {} # InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeInstanceNetworkAttachmentContext
+ instance_network_attachment_prototype_virtual_network_interface_model['allow_ip_spoofing'] = True
+ instance_network_attachment_prototype_virtual_network_interface_model['auto_delete'] = False
+ instance_network_attachment_prototype_virtual_network_interface_model['enable_infrastructure_nat'] = True
+ instance_network_attachment_prototype_virtual_network_interface_model['ips'] = [virtual_network_interface_ip_prototype_model]
+ instance_network_attachment_prototype_virtual_network_interface_model['name'] = 'my-virtual-network-interface'
+ instance_network_attachment_prototype_virtual_network_interface_model['primary_ip'] = virtual_network_interface_primary_ip_prototype_model
+ instance_network_attachment_prototype_virtual_network_interface_model['resource_group'] = resource_group_identity_model
+ instance_network_attachment_prototype_virtual_network_interface_model['security_groups'] = [security_group_identity_model]
+ instance_network_attachment_prototype_virtual_network_interface_model['subnet'] = subnet_identity_model
+
+ instance_network_attachment_prototype_model = {} # InstanceNetworkAttachmentPrototype
+ instance_network_attachment_prototype_model['name'] = 'my-instance-network-attachment'
+ instance_network_attachment_prototype_model['virtual_network_interface'] = instance_network_attachment_prototype_virtual_network_interface_model
-class TestModel_ImageIdentityByHref:
- """
- Test Class for ImageIdentityByHref
- """
+ network_interface_ip_prototype_model = {} # NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext
+ network_interface_ip_prototype_model['address'] = '10.0.0.5'
+ network_interface_ip_prototype_model['auto_delete'] = False
+ network_interface_ip_prototype_model['name'] = 'my-reserved-ip'
- def test_image_identity_by_href_serialization(self):
- """
- Test serialization/deserialization for ImageIdentityByHref
- """
+ network_interface_prototype_model = {} # NetworkInterfacePrototype
+ network_interface_prototype_model['allow_ip_spoofing'] = True
+ network_interface_prototype_model['name'] = 'my-instance-network-interface'
+ network_interface_prototype_model['primary_ip'] = network_interface_ip_prototype_model
+ network_interface_prototype_model['security_groups'] = [security_group_identity_model]
+ network_interface_prototype_model['subnet'] = subnet_identity_model
- # Construct a json representation of a ImageIdentityByHref model
- image_identity_by_href_model_json = {}
- image_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8'
+ instance_template_identity_model = {} # InstanceTemplateIdentityById
+ instance_template_identity_model['id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803'
- # Construct a model instance of ImageIdentityByHref by calling from_dict on the json representation
- image_identity_by_href_model = ImageIdentityByHref.from_dict(image_identity_by_href_model_json)
- assert image_identity_by_href_model != False
+ zone_identity_model = {} # ZoneIdentityByName
+ zone_identity_model['name'] = 'us-south-1'
- # Construct a model instance of ImageIdentityByHref by calling from_dict on the json representation
- image_identity_by_href_model_dict = ImageIdentityByHref.from_dict(image_identity_by_href_model_json).__dict__
- image_identity_by_href_model2 = ImageIdentityByHref(**image_identity_by_href_model_dict)
+ # Construct a json representation of a InstanceTemplatePrototypeInstanceTemplateBySourceTemplate model
+ instance_template_prototype_instance_template_by_source_template_model_json = {}
+ instance_template_prototype_instance_template_by_source_template_model_json['availability_policy'] = instance_availability_policy_prototype_model
+ instance_template_prototype_instance_template_by_source_template_model_json['default_trusted_profile'] = instance_default_trusted_profile_prototype_model
+ instance_template_prototype_instance_template_by_source_template_model_json['keys'] = [key_identity_model]
+ instance_template_prototype_instance_template_by_source_template_model_json['metadata_service'] = instance_metadata_service_prototype_model
+ instance_template_prototype_instance_template_by_source_template_model_json['name'] = 'my-instance'
+ instance_template_prototype_instance_template_by_source_template_model_json['placement_target'] = instance_placement_target_prototype_model
+ instance_template_prototype_instance_template_by_source_template_model_json['profile'] = instance_profile_identity_model
+ instance_template_prototype_instance_template_by_source_template_model_json['reservation_affinity'] = instance_reservation_affinity_prototype_model
+ instance_template_prototype_instance_template_by_source_template_model_json['resource_group'] = resource_group_identity_model
+ instance_template_prototype_instance_template_by_source_template_model_json['total_volume_bandwidth'] = 500
+ instance_template_prototype_instance_template_by_source_template_model_json['user_data'] = 'testString'
+ instance_template_prototype_instance_template_by_source_template_model_json['volume_attachments'] = [volume_attachment_prototype_model]
+ instance_template_prototype_instance_template_by_source_template_model_json['vpc'] = vpc_identity_model
+ instance_template_prototype_instance_template_by_source_template_model_json['boot_volume_attachment'] = volume_attachment_prototype_instance_by_image_context_model
+ instance_template_prototype_instance_template_by_source_template_model_json['catalog_offering'] = instance_catalog_offering_prototype_model
+ instance_template_prototype_instance_template_by_source_template_model_json['image'] = image_identity_model
+ instance_template_prototype_instance_template_by_source_template_model_json['network_attachments'] = [instance_network_attachment_prototype_model]
+ instance_template_prototype_instance_template_by_source_template_model_json['network_interfaces'] = [network_interface_prototype_model]
+ instance_template_prototype_instance_template_by_source_template_model_json['primary_network_attachment'] = instance_network_attachment_prototype_model
+ instance_template_prototype_instance_template_by_source_template_model_json['primary_network_interface'] = network_interface_prototype_model
+ instance_template_prototype_instance_template_by_source_template_model_json['source_template'] = instance_template_identity_model
+ instance_template_prototype_instance_template_by_source_template_model_json['zone'] = zone_identity_model
+
+ # Construct a model instance of InstanceTemplatePrototypeInstanceTemplateBySourceTemplate by calling from_dict on the json representation
+ instance_template_prototype_instance_template_by_source_template_model = InstanceTemplatePrototypeInstanceTemplateBySourceTemplate.from_dict(instance_template_prototype_instance_template_by_source_template_model_json)
+ assert instance_template_prototype_instance_template_by_source_template_model != False
+
+ # Construct a model instance of InstanceTemplatePrototypeInstanceTemplateBySourceTemplate by calling from_dict on the json representation
+ instance_template_prototype_instance_template_by_source_template_model_dict = InstanceTemplatePrototypeInstanceTemplateBySourceTemplate.from_dict(instance_template_prototype_instance_template_by_source_template_model_json).__dict__
+ instance_template_prototype_instance_template_by_source_template_model2 = InstanceTemplatePrototypeInstanceTemplateBySourceTemplate(**instance_template_prototype_instance_template_by_source_template_model_dict)
# Verify the model instances are equivalent
- assert image_identity_by_href_model == image_identity_by_href_model2
+ assert instance_template_prototype_instance_template_by_source_template_model == instance_template_prototype_instance_template_by_source_template_model2
# Convert model instance back to dict and verify no loss of data
- image_identity_by_href_model_json2 = image_identity_by_href_model.to_dict()
- assert image_identity_by_href_model_json2 == image_identity_by_href_model_json
+ instance_template_prototype_instance_template_by_source_template_model_json2 = instance_template_prototype_instance_template_by_source_template_model.to_dict()
+ assert instance_template_prototype_instance_template_by_source_template_model_json2 == instance_template_prototype_instance_template_by_source_template_model_json
-class TestModel_ImageIdentityById:
+class TestModel_KeyIdentityByCRN:
"""
- Test Class for ImageIdentityById
+ Test Class for KeyIdentityByCRN
"""
- def test_image_identity_by_id_serialization(self):
+ def test_key_identity_by_crn_serialization(self):
"""
- Test serialization/deserialization for ImageIdentityById
+ Test serialization/deserialization for KeyIdentityByCRN
"""
- # Construct a json representation of a ImageIdentityById model
- image_identity_by_id_model_json = {}
- image_identity_by_id_model_json['id'] = '72b27b5c-f4b0-48bb-b954-5becc7c1dcb8'
+ # Construct a json representation of a KeyIdentityByCRN model
+ key_identity_by_crn_model_json = {}
+ key_identity_by_crn_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::key:a6b1a881-2ce8-41a3-80fc-36316a73f803'
- # Construct a model instance of ImageIdentityById by calling from_dict on the json representation
- image_identity_by_id_model = ImageIdentityById.from_dict(image_identity_by_id_model_json)
- assert image_identity_by_id_model != False
+ # Construct a model instance of KeyIdentityByCRN by calling from_dict on the json representation
+ key_identity_by_crn_model = KeyIdentityByCRN.from_dict(key_identity_by_crn_model_json)
+ assert key_identity_by_crn_model != False
- # Construct a model instance of ImageIdentityById by calling from_dict on the json representation
- image_identity_by_id_model_dict = ImageIdentityById.from_dict(image_identity_by_id_model_json).__dict__
- image_identity_by_id_model2 = ImageIdentityById(**image_identity_by_id_model_dict)
+ # Construct a model instance of KeyIdentityByCRN by calling from_dict on the json representation
+ key_identity_by_crn_model_dict = KeyIdentityByCRN.from_dict(key_identity_by_crn_model_json).__dict__
+ key_identity_by_crn_model2 = KeyIdentityByCRN(**key_identity_by_crn_model_dict)
# Verify the model instances are equivalent
- assert image_identity_by_id_model == image_identity_by_id_model2
+ assert key_identity_by_crn_model == key_identity_by_crn_model2
# Convert model instance back to dict and verify no loss of data
- image_identity_by_id_model_json2 = image_identity_by_id_model.to_dict()
- assert image_identity_by_id_model_json2 == image_identity_by_id_model_json
+ key_identity_by_crn_model_json2 = key_identity_by_crn_model.to_dict()
+ assert key_identity_by_crn_model_json2 == key_identity_by_crn_model_json
-class TestModel_ImagePrototypeImageByFile:
+class TestModel_KeyIdentityByFingerprint:
"""
- Test Class for ImagePrototypeImageByFile
+ Test Class for KeyIdentityByFingerprint
"""
- def test_image_prototype_image_by_file_serialization(self):
+ def test_key_identity_by_fingerprint_serialization(self):
"""
- Test serialization/deserialization for ImagePrototypeImageByFile
+ Test serialization/deserialization for KeyIdentityByFingerprint
"""
- # 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'
-
- encryption_key_identity_model = {} # EncryptionKeyIdentityByCRN
- encryption_key_identity_model['crn'] = 'crn:v1:bluemix:public:kms:us-south:a/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179'
-
- image_file_prototype_model = {} # ImageFilePrototype
- image_file_prototype_model['href'] = 'cos://us-south/custom-image-vpc-bucket/customImage-0.vhd'
-
- operating_system_identity_model = {} # OperatingSystemIdentityByName
- operating_system_identity_model['name'] = 'ubuntu-16-amd64'
-
- # Construct a json representation of a ImagePrototypeImageByFile model
- image_prototype_image_by_file_model_json = {}
- image_prototype_image_by_file_model_json['deprecation_at'] = '2019-01-01T12:00:00Z'
- image_prototype_image_by_file_model_json['name'] = 'my-image'
- image_prototype_image_by_file_model_json['obsolescence_at'] = '2019-01-01T12:00:00Z'
- image_prototype_image_by_file_model_json['resource_group'] = resource_group_identity_model
- image_prototype_image_by_file_model_json['encrypted_data_key'] = 'testString'
- image_prototype_image_by_file_model_json['encryption_key'] = encryption_key_identity_model
- image_prototype_image_by_file_model_json['file'] = image_file_prototype_model
- image_prototype_image_by_file_model_json['operating_system'] = operating_system_identity_model
+ # Construct a json representation of a KeyIdentityByFingerprint model
+ key_identity_by_fingerprint_model_json = {}
+ key_identity_by_fingerprint_model_json['fingerprint'] = 'SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY'
- # Construct a model instance of ImagePrototypeImageByFile by calling from_dict on the json representation
- image_prototype_image_by_file_model = ImagePrototypeImageByFile.from_dict(image_prototype_image_by_file_model_json)
- assert image_prototype_image_by_file_model != False
+ # Construct a model instance of KeyIdentityByFingerprint by calling from_dict on the json representation
+ key_identity_by_fingerprint_model = KeyIdentityByFingerprint.from_dict(key_identity_by_fingerprint_model_json)
+ assert key_identity_by_fingerprint_model != False
- # Construct a model instance of ImagePrototypeImageByFile by calling from_dict on the json representation
- image_prototype_image_by_file_model_dict = ImagePrototypeImageByFile.from_dict(image_prototype_image_by_file_model_json).__dict__
- image_prototype_image_by_file_model2 = ImagePrototypeImageByFile(**image_prototype_image_by_file_model_dict)
+ # Construct a model instance of KeyIdentityByFingerprint by calling from_dict on the json representation
+ key_identity_by_fingerprint_model_dict = KeyIdentityByFingerprint.from_dict(key_identity_by_fingerprint_model_json).__dict__
+ key_identity_by_fingerprint_model2 = KeyIdentityByFingerprint(**key_identity_by_fingerprint_model_dict)
# Verify the model instances are equivalent
- assert image_prototype_image_by_file_model == image_prototype_image_by_file_model2
+ assert key_identity_by_fingerprint_model == key_identity_by_fingerprint_model2
# Convert model instance back to dict and verify no loss of data
- image_prototype_image_by_file_model_json2 = image_prototype_image_by_file_model.to_dict()
- assert image_prototype_image_by_file_model_json2 == image_prototype_image_by_file_model_json
+ key_identity_by_fingerprint_model_json2 = key_identity_by_fingerprint_model.to_dict()
+ assert key_identity_by_fingerprint_model_json2 == key_identity_by_fingerprint_model_json
-class TestModel_ImagePrototypeImageBySourceVolume:
+class TestModel_KeyIdentityByHref:
"""
- Test Class for ImagePrototypeImageBySourceVolume
+ Test Class for KeyIdentityByHref
"""
- def test_image_prototype_image_by_source_volume_serialization(self):
+ def test_key_identity_by_href_serialization(self):
"""
- Test serialization/deserialization for ImagePrototypeImageBySourceVolume
+ Test serialization/deserialization for KeyIdentityByHref
"""
- # 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'
-
- encryption_key_identity_model = {} # EncryptionKeyIdentityByCRN
- encryption_key_identity_model['crn'] = 'crn:v1:bluemix:public:kms:us-south:a/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179'
-
- volume_identity_model = {} # VolumeIdentityById
- volume_identity_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
-
- # Construct a json representation of a ImagePrototypeImageBySourceVolume model
- image_prototype_image_by_source_volume_model_json = {}
- image_prototype_image_by_source_volume_model_json['deprecation_at'] = '2019-01-01T12:00:00Z'
- image_prototype_image_by_source_volume_model_json['name'] = 'my-image'
- image_prototype_image_by_source_volume_model_json['obsolescence_at'] = '2019-01-01T12:00:00Z'
- image_prototype_image_by_source_volume_model_json['resource_group'] = resource_group_identity_model
- image_prototype_image_by_source_volume_model_json['encryption_key'] = encryption_key_identity_model
- image_prototype_image_by_source_volume_model_json['source_volume'] = volume_identity_model
+ # Construct a json representation of a KeyIdentityByHref model
+ key_identity_by_href_model_json = {}
+ key_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/keys/a6b1a881-2ce8-41a3-80fc-36316a73f803'
- # Construct a model instance of ImagePrototypeImageBySourceVolume by calling from_dict on the json representation
- image_prototype_image_by_source_volume_model = ImagePrototypeImageBySourceVolume.from_dict(image_prototype_image_by_source_volume_model_json)
- assert image_prototype_image_by_source_volume_model != False
+ # Construct a model instance of KeyIdentityByHref by calling from_dict on the json representation
+ key_identity_by_href_model = KeyIdentityByHref.from_dict(key_identity_by_href_model_json)
+ assert key_identity_by_href_model != False
- # Construct a model instance of ImagePrototypeImageBySourceVolume by calling from_dict on the json representation
- image_prototype_image_by_source_volume_model_dict = ImagePrototypeImageBySourceVolume.from_dict(image_prototype_image_by_source_volume_model_json).__dict__
- image_prototype_image_by_source_volume_model2 = ImagePrototypeImageBySourceVolume(**image_prototype_image_by_source_volume_model_dict)
+ # Construct a model instance of KeyIdentityByHref by calling from_dict on the json representation
+ key_identity_by_href_model_dict = KeyIdentityByHref.from_dict(key_identity_by_href_model_json).__dict__
+ key_identity_by_href_model2 = KeyIdentityByHref(**key_identity_by_href_model_dict)
# Verify the model instances are equivalent
- assert image_prototype_image_by_source_volume_model == image_prototype_image_by_source_volume_model2
+ assert key_identity_by_href_model == key_identity_by_href_model2
# Convert model instance back to dict and verify no loss of data
- image_prototype_image_by_source_volume_model_json2 = image_prototype_image_by_source_volume_model.to_dict()
- assert image_prototype_image_by_source_volume_model_json2 == image_prototype_image_by_source_volume_model_json
+ key_identity_by_href_model_json2 = key_identity_by_href_model.to_dict()
+ assert key_identity_by_href_model_json2 == key_identity_by_href_model_json
-class TestModel_InstanceCatalogOfferingPrototypeCatalogOfferingByOffering:
+class TestModel_KeyIdentityById:
"""
- Test Class for InstanceCatalogOfferingPrototypeCatalogOfferingByOffering
+ Test Class for KeyIdentityById
"""
- def test_instance_catalog_offering_prototype_catalog_offering_by_offering_serialization(self):
+ def test_key_identity_by_id_serialization(self):
"""
- Test serialization/deserialization for InstanceCatalogOfferingPrototypeCatalogOfferingByOffering
+ Test serialization/deserialization for KeyIdentityById
"""
- # Construct dict forms of any model objects needed in order to build this model.
-
- catalog_offering_identity_model = {} # CatalogOfferingIdentityCatalogOfferingByCRN
- catalog_offering_identity_model['crn'] = 'crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:offering:00111601-0ec5-41ac-b142-96d1e64e6442'
-
- # Construct a json representation of a InstanceCatalogOfferingPrototypeCatalogOfferingByOffering model
- instance_catalog_offering_prototype_catalog_offering_by_offering_model_json = {}
- instance_catalog_offering_prototype_catalog_offering_by_offering_model_json['offering'] = catalog_offering_identity_model
+ # Construct a json representation of a KeyIdentityById model
+ key_identity_by_id_model_json = {}
+ key_identity_by_id_model_json['id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803'
- # Construct a model instance of InstanceCatalogOfferingPrototypeCatalogOfferingByOffering by calling from_dict on the json representation
- instance_catalog_offering_prototype_catalog_offering_by_offering_model = InstanceCatalogOfferingPrototypeCatalogOfferingByOffering.from_dict(instance_catalog_offering_prototype_catalog_offering_by_offering_model_json)
- assert instance_catalog_offering_prototype_catalog_offering_by_offering_model != False
+ # Construct a model instance of KeyIdentityById by calling from_dict on the json representation
+ key_identity_by_id_model = KeyIdentityById.from_dict(key_identity_by_id_model_json)
+ assert key_identity_by_id_model != False
- # Construct a model instance of InstanceCatalogOfferingPrototypeCatalogOfferingByOffering by calling from_dict on the json representation
- instance_catalog_offering_prototype_catalog_offering_by_offering_model_dict = InstanceCatalogOfferingPrototypeCatalogOfferingByOffering.from_dict(instance_catalog_offering_prototype_catalog_offering_by_offering_model_json).__dict__
- instance_catalog_offering_prototype_catalog_offering_by_offering_model2 = InstanceCatalogOfferingPrototypeCatalogOfferingByOffering(**instance_catalog_offering_prototype_catalog_offering_by_offering_model_dict)
+ # Construct a model instance of KeyIdentityById by calling from_dict on the json representation
+ key_identity_by_id_model_dict = KeyIdentityById.from_dict(key_identity_by_id_model_json).__dict__
+ key_identity_by_id_model2 = KeyIdentityById(**key_identity_by_id_model_dict)
# Verify the model instances are equivalent
- assert instance_catalog_offering_prototype_catalog_offering_by_offering_model == instance_catalog_offering_prototype_catalog_offering_by_offering_model2
+ assert key_identity_by_id_model == key_identity_by_id_model2
# Convert model instance back to dict and verify no loss of data
- instance_catalog_offering_prototype_catalog_offering_by_offering_model_json2 = instance_catalog_offering_prototype_catalog_offering_by_offering_model.to_dict()
- assert instance_catalog_offering_prototype_catalog_offering_by_offering_model_json2 == instance_catalog_offering_prototype_catalog_offering_by_offering_model_json
+ key_identity_by_id_model_json2 = key_identity_by_id_model.to_dict()
+ assert key_identity_by_id_model_json2 == key_identity_by_id_model_json
-class TestModel_InstanceCatalogOfferingPrototypeCatalogOfferingByVersion:
+class TestModel_LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName:
"""
- Test Class for InstanceCatalogOfferingPrototypeCatalogOfferingByVersion
+ Test Class for LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName
"""
- def test_instance_catalog_offering_prototype_catalog_offering_by_version_serialization(self):
+ def test_legacy_cloud_object_storage_bucket_identity_cloud_object_storage_bucket_identity_by_name_serialization(self):
"""
- Test serialization/deserialization for InstanceCatalogOfferingPrototypeCatalogOfferingByVersion
+ Test serialization/deserialization for LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName
"""
- # Construct dict forms of any model objects needed in order to build this model.
-
- catalog_offering_version_identity_model = {} # CatalogOfferingVersionIdentityCatalogOfferingVersionByCRN
- catalog_offering_version_identity_model['crn'] = 'crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d'
-
- # Construct a json representation of a InstanceCatalogOfferingPrototypeCatalogOfferingByVersion model
- instance_catalog_offering_prototype_catalog_offering_by_version_model_json = {}
- instance_catalog_offering_prototype_catalog_offering_by_version_model_json['version'] = catalog_offering_version_identity_model
+ # Construct a json representation of a LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName model
+ legacy_cloud_object_storage_bucket_identity_cloud_object_storage_bucket_identity_by_name_model_json = {}
+ legacy_cloud_object_storage_bucket_identity_cloud_object_storage_bucket_identity_by_name_model_json['name'] = 'bucket-27200-lwx4cfvcue'
- # Construct a model instance of InstanceCatalogOfferingPrototypeCatalogOfferingByVersion by calling from_dict on the json representation
- instance_catalog_offering_prototype_catalog_offering_by_version_model = InstanceCatalogOfferingPrototypeCatalogOfferingByVersion.from_dict(instance_catalog_offering_prototype_catalog_offering_by_version_model_json)
- assert instance_catalog_offering_prototype_catalog_offering_by_version_model != False
+ # Construct a model instance of LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName by calling from_dict on the json representation
+ legacy_cloud_object_storage_bucket_identity_cloud_object_storage_bucket_identity_by_name_model = LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName.from_dict(legacy_cloud_object_storage_bucket_identity_cloud_object_storage_bucket_identity_by_name_model_json)
+ assert legacy_cloud_object_storage_bucket_identity_cloud_object_storage_bucket_identity_by_name_model != False
- # Construct a model instance of InstanceCatalogOfferingPrototypeCatalogOfferingByVersion by calling from_dict on the json representation
- instance_catalog_offering_prototype_catalog_offering_by_version_model_dict = InstanceCatalogOfferingPrototypeCatalogOfferingByVersion.from_dict(instance_catalog_offering_prototype_catalog_offering_by_version_model_json).__dict__
- instance_catalog_offering_prototype_catalog_offering_by_version_model2 = InstanceCatalogOfferingPrototypeCatalogOfferingByVersion(**instance_catalog_offering_prototype_catalog_offering_by_version_model_dict)
+ # Construct a model instance of LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName by calling from_dict on the json representation
+ legacy_cloud_object_storage_bucket_identity_cloud_object_storage_bucket_identity_by_name_model_dict = LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName.from_dict(legacy_cloud_object_storage_bucket_identity_cloud_object_storage_bucket_identity_by_name_model_json).__dict__
+ legacy_cloud_object_storage_bucket_identity_cloud_object_storage_bucket_identity_by_name_model2 = LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName(**legacy_cloud_object_storage_bucket_identity_cloud_object_storage_bucket_identity_by_name_model_dict)
# Verify the model instances are equivalent
- assert instance_catalog_offering_prototype_catalog_offering_by_version_model == instance_catalog_offering_prototype_catalog_offering_by_version_model2
+ assert legacy_cloud_object_storage_bucket_identity_cloud_object_storage_bucket_identity_by_name_model == legacy_cloud_object_storage_bucket_identity_cloud_object_storage_bucket_identity_by_name_model2
# Convert model instance back to dict and verify no loss of data
- instance_catalog_offering_prototype_catalog_offering_by_version_model_json2 = instance_catalog_offering_prototype_catalog_offering_by_version_model.to_dict()
- assert instance_catalog_offering_prototype_catalog_offering_by_version_model_json2 == instance_catalog_offering_prototype_catalog_offering_by_version_model_json
+ legacy_cloud_object_storage_bucket_identity_cloud_object_storage_bucket_identity_by_name_model_json2 = legacy_cloud_object_storage_bucket_identity_cloud_object_storage_bucket_identity_by_name_model.to_dict()
+ assert legacy_cloud_object_storage_bucket_identity_cloud_object_storage_bucket_identity_by_name_model_json2 == legacy_cloud_object_storage_bucket_identity_cloud_object_storage_bucket_identity_by_name_model_json
-class TestModel_InstanceGroupManagerAutoScale:
+class TestModel_LoadBalancerIdentityByCRN:
"""
- Test Class for InstanceGroupManagerAutoScale
+ Test Class for LoadBalancerIdentityByCRN
"""
- def test_instance_group_manager_auto_scale_serialization(self):
+ def test_load_balancer_identity_by_crn_serialization(self):
"""
- Test serialization/deserialization for InstanceGroupManagerAutoScale
+ Test serialization/deserialization for LoadBalancerIdentityByCRN
"""
- # 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_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'
-
- # Construct a json representation of a InstanceGroupManagerAutoScale model
- instance_group_manager_auto_scale_model_json = {}
- instance_group_manager_auto_scale_model_json['created_at'] = '2019-01-01T12:00:00Z'
- instance_group_manager_auto_scale_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_auto_scale_model_json['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
- instance_group_manager_auto_scale_model_json['management_enabled'] = True
- instance_group_manager_auto_scale_model_json['name'] = 'my-instance-group-manager'
- instance_group_manager_auto_scale_model_json['updated_at'] = '2019-01-01T12:00:00Z'
- instance_group_manager_auto_scale_model_json['aggregation_window'] = 120
- instance_group_manager_auto_scale_model_json['cooldown'] = 210
- instance_group_manager_auto_scale_model_json['manager_type'] = 'autoscale'
- instance_group_manager_auto_scale_model_json['max_membership_count'] = 10
- instance_group_manager_auto_scale_model_json['min_membership_count'] = 10
- instance_group_manager_auto_scale_model_json['policies'] = [instance_group_manager_policy_reference_model]
+ # Construct a json representation of a LoadBalancerIdentityByCRN model
+ load_balancer_identity_by_crn_model_json = {}
+ load_balancer_identity_by_crn_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727'
- # Construct a model instance of InstanceGroupManagerAutoScale by calling from_dict on the json representation
- instance_group_manager_auto_scale_model = InstanceGroupManagerAutoScale.from_dict(instance_group_manager_auto_scale_model_json)
- assert instance_group_manager_auto_scale_model != False
+ # Construct a model instance of LoadBalancerIdentityByCRN by calling from_dict on the json representation
+ load_balancer_identity_by_crn_model = LoadBalancerIdentityByCRN.from_dict(load_balancer_identity_by_crn_model_json)
+ assert load_balancer_identity_by_crn_model != False
- # Construct a model instance of InstanceGroupManagerAutoScale by calling from_dict on the json representation
- instance_group_manager_auto_scale_model_dict = InstanceGroupManagerAutoScale.from_dict(instance_group_manager_auto_scale_model_json).__dict__
- instance_group_manager_auto_scale_model2 = InstanceGroupManagerAutoScale(**instance_group_manager_auto_scale_model_dict)
+ # Construct a model instance of LoadBalancerIdentityByCRN by calling from_dict on the json representation
+ load_balancer_identity_by_crn_model_dict = LoadBalancerIdentityByCRN.from_dict(load_balancer_identity_by_crn_model_json).__dict__
+ load_balancer_identity_by_crn_model2 = LoadBalancerIdentityByCRN(**load_balancer_identity_by_crn_model_dict)
# Verify the model instances are equivalent
- assert instance_group_manager_auto_scale_model == instance_group_manager_auto_scale_model2
+ assert load_balancer_identity_by_crn_model == load_balancer_identity_by_crn_model2
# Convert model instance back to dict and verify no loss of data
- instance_group_manager_auto_scale_model_json2 = instance_group_manager_auto_scale_model.to_dict()
- assert instance_group_manager_auto_scale_model_json2 == instance_group_manager_auto_scale_model_json
+ load_balancer_identity_by_crn_model_json2 = load_balancer_identity_by_crn_model.to_dict()
+ assert load_balancer_identity_by_crn_model_json2 == load_balancer_identity_by_crn_model_json
-class TestModel_InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype:
+class TestModel_LoadBalancerIdentityByHref:
"""
- Test Class for InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype
+ Test Class for LoadBalancerIdentityByHref
"""
- def test_instance_group_manager_policy_prototype_instance_group_manager_target_policy_prototype_serialization(self):
+ def test_load_balancer_identity_by_href_serialization(self):
"""
- Test serialization/deserialization for InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype
+ Test serialization/deserialization for LoadBalancerIdentityByHref
"""
- # Construct a json representation of a InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype model
- instance_group_manager_policy_prototype_instance_group_manager_target_policy_prototype_model_json = {}
- instance_group_manager_policy_prototype_instance_group_manager_target_policy_prototype_model_json['name'] = 'my-instance-group-manager-policy'
- instance_group_manager_policy_prototype_instance_group_manager_target_policy_prototype_model_json['metric_type'] = 'cpu'
- instance_group_manager_policy_prototype_instance_group_manager_target_policy_prototype_model_json['metric_value'] = 38
- instance_group_manager_policy_prototype_instance_group_manager_target_policy_prototype_model_json['policy_type'] = 'target'
+ # Construct a json representation of a LoadBalancerIdentityByHref model
+ load_balancer_identity_by_href_model_json = {}
+ load_balancer_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727'
- # Construct a model instance of InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype by calling from_dict on the json representation
- instance_group_manager_policy_prototype_instance_group_manager_target_policy_prototype_model = InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype.from_dict(instance_group_manager_policy_prototype_instance_group_manager_target_policy_prototype_model_json)
- assert instance_group_manager_policy_prototype_instance_group_manager_target_policy_prototype_model != False
+ # Construct a model instance of LoadBalancerIdentityByHref by calling from_dict on the json representation
+ load_balancer_identity_by_href_model = LoadBalancerIdentityByHref.from_dict(load_balancer_identity_by_href_model_json)
+ assert load_balancer_identity_by_href_model != False
- # Construct a model instance of InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype by calling from_dict on the json representation
- instance_group_manager_policy_prototype_instance_group_manager_target_policy_prototype_model_dict = InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype.from_dict(instance_group_manager_policy_prototype_instance_group_manager_target_policy_prototype_model_json).__dict__
- instance_group_manager_policy_prototype_instance_group_manager_target_policy_prototype_model2 = InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype(**instance_group_manager_policy_prototype_instance_group_manager_target_policy_prototype_model_dict)
+ # Construct a model instance of LoadBalancerIdentityByHref by calling from_dict on the json representation
+ load_balancer_identity_by_href_model_dict = LoadBalancerIdentityByHref.from_dict(load_balancer_identity_by_href_model_json).__dict__
+ load_balancer_identity_by_href_model2 = LoadBalancerIdentityByHref(**load_balancer_identity_by_href_model_dict)
# Verify the model instances are equivalent
- assert instance_group_manager_policy_prototype_instance_group_manager_target_policy_prototype_model == instance_group_manager_policy_prototype_instance_group_manager_target_policy_prototype_model2
+ assert load_balancer_identity_by_href_model == load_balancer_identity_by_href_model2
# Convert model instance back to dict and verify no loss of data
- instance_group_manager_policy_prototype_instance_group_manager_target_policy_prototype_model_json2 = instance_group_manager_policy_prototype_instance_group_manager_target_policy_prototype_model.to_dict()
- assert instance_group_manager_policy_prototype_instance_group_manager_target_policy_prototype_model_json2 == instance_group_manager_policy_prototype_instance_group_manager_target_policy_prototype_model_json
+ load_balancer_identity_by_href_model_json2 = load_balancer_identity_by_href_model.to_dict()
+ assert load_balancer_identity_by_href_model_json2 == load_balancer_identity_by_href_model_json
-class TestModel_InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy:
+class TestModel_LoadBalancerIdentityById:
"""
- Test Class for InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy
+ Test Class for LoadBalancerIdentityById
"""
- def test_instance_group_manager_policy_instance_group_manager_target_policy_serialization(self):
+ def test_load_balancer_identity_by_id_serialization(self):
"""
- Test serialization/deserialization for InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy
+ Test serialization/deserialization for LoadBalancerIdentityById
"""
- # Construct a json representation of a InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy model
- instance_group_manager_policy_instance_group_manager_target_policy_model_json = {}
- instance_group_manager_policy_instance_group_manager_target_policy_model_json['created_at'] = '2019-01-01T12:00:00Z'
- instance_group_manager_policy_instance_group_manager_target_policy_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_instance_group_manager_target_policy_model_json['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
- instance_group_manager_policy_instance_group_manager_target_policy_model_json['name'] = 'my-instance-group-manager-policy'
- instance_group_manager_policy_instance_group_manager_target_policy_model_json['updated_at'] = '2019-01-01T12:00:00Z'
- instance_group_manager_policy_instance_group_manager_target_policy_model_json['metric_type'] = 'cpu'
- instance_group_manager_policy_instance_group_manager_target_policy_model_json['metric_value'] = 38
- instance_group_manager_policy_instance_group_manager_target_policy_model_json['policy_type'] = 'target'
+ # Construct a json representation of a LoadBalancerIdentityById model
+ load_balancer_identity_by_id_model_json = {}
+ load_balancer_identity_by_id_model_json['id'] = 'dd754295-e9e0-4c9d-bf6c-58fbc59e5727'
- # Construct a model instance of InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy by calling from_dict on the json representation
- instance_group_manager_policy_instance_group_manager_target_policy_model = InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy.from_dict(instance_group_manager_policy_instance_group_manager_target_policy_model_json)
- assert instance_group_manager_policy_instance_group_manager_target_policy_model != False
+ # Construct a model instance of LoadBalancerIdentityById by calling from_dict on the json representation
+ load_balancer_identity_by_id_model = LoadBalancerIdentityById.from_dict(load_balancer_identity_by_id_model_json)
+ assert load_balancer_identity_by_id_model != False
- # Construct a model instance of InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy by calling from_dict on the json representation
- instance_group_manager_policy_instance_group_manager_target_policy_model_dict = InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy.from_dict(instance_group_manager_policy_instance_group_manager_target_policy_model_json).__dict__
- instance_group_manager_policy_instance_group_manager_target_policy_model2 = InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy(**instance_group_manager_policy_instance_group_manager_target_policy_model_dict)
+ # Construct a model instance of LoadBalancerIdentityById by calling from_dict on the json representation
+ load_balancer_identity_by_id_model_dict = LoadBalancerIdentityById.from_dict(load_balancer_identity_by_id_model_json).__dict__
+ load_balancer_identity_by_id_model2 = LoadBalancerIdentityById(**load_balancer_identity_by_id_model_dict)
# Verify the model instances are equivalent
- assert instance_group_manager_policy_instance_group_manager_target_policy_model == instance_group_manager_policy_instance_group_manager_target_policy_model2
+ assert load_balancer_identity_by_id_model == load_balancer_identity_by_id_model2
# Convert model instance back to dict and verify no loss of data
- instance_group_manager_policy_instance_group_manager_target_policy_model_json2 = instance_group_manager_policy_instance_group_manager_target_policy_model.to_dict()
- assert instance_group_manager_policy_instance_group_manager_target_policy_model_json2 == instance_group_manager_policy_instance_group_manager_target_policy_model_json
+ load_balancer_identity_by_id_model_json2 = load_balancer_identity_by_id_model.to_dict()
+ assert load_balancer_identity_by_id_model_json2 == load_balancer_identity_by_id_model_json
-class TestModel_InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype:
+class TestModel_LoadBalancerListenerIdentityByHref:
"""
- Test Class for InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype
+ Test Class for LoadBalancerListenerIdentityByHref
"""
- def test_instance_group_manager_prototype_instance_group_manager_auto_scale_prototype_serialization(self):
+ def test_load_balancer_listener_identity_by_href_serialization(self):
"""
- Test serialization/deserialization for InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype
+ Test serialization/deserialization for LoadBalancerListenerIdentityByHref
"""
- # Construct a json representation of a InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype model
- instance_group_manager_prototype_instance_group_manager_auto_scale_prototype_model_json = {}
- instance_group_manager_prototype_instance_group_manager_auto_scale_prototype_model_json['management_enabled'] = True
- instance_group_manager_prototype_instance_group_manager_auto_scale_prototype_model_json['name'] = 'my-instance-group-manager'
- instance_group_manager_prototype_instance_group_manager_auto_scale_prototype_model_json['aggregation_window'] = 120
- instance_group_manager_prototype_instance_group_manager_auto_scale_prototype_model_json['cooldown'] = 210
- instance_group_manager_prototype_instance_group_manager_auto_scale_prototype_model_json['manager_type'] = 'autoscale'
- instance_group_manager_prototype_instance_group_manager_auto_scale_prototype_model_json['max_membership_count'] = 10
- instance_group_manager_prototype_instance_group_manager_auto_scale_prototype_model_json['min_membership_count'] = 10
+ # Construct a json representation of a LoadBalancerListenerIdentityByHref model
+ load_balancer_listener_identity_by_href_model_json = {}
+ load_balancer_listener_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004'
- # Construct a model instance of InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype by calling from_dict on the json representation
- instance_group_manager_prototype_instance_group_manager_auto_scale_prototype_model = InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype.from_dict(instance_group_manager_prototype_instance_group_manager_auto_scale_prototype_model_json)
- assert instance_group_manager_prototype_instance_group_manager_auto_scale_prototype_model != False
+ # Construct a model instance of LoadBalancerListenerIdentityByHref by calling from_dict on the json representation
+ load_balancer_listener_identity_by_href_model = LoadBalancerListenerIdentityByHref.from_dict(load_balancer_listener_identity_by_href_model_json)
+ assert load_balancer_listener_identity_by_href_model != False
- # Construct a model instance of InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype by calling from_dict on the json representation
- instance_group_manager_prototype_instance_group_manager_auto_scale_prototype_model_dict = InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype.from_dict(instance_group_manager_prototype_instance_group_manager_auto_scale_prototype_model_json).__dict__
- instance_group_manager_prototype_instance_group_manager_auto_scale_prototype_model2 = InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype(**instance_group_manager_prototype_instance_group_manager_auto_scale_prototype_model_dict)
+ # Construct a model instance of LoadBalancerListenerIdentityByHref by calling from_dict on the json representation
+ load_balancer_listener_identity_by_href_model_dict = LoadBalancerListenerIdentityByHref.from_dict(load_balancer_listener_identity_by_href_model_json).__dict__
+ load_balancer_listener_identity_by_href_model2 = LoadBalancerListenerIdentityByHref(**load_balancer_listener_identity_by_href_model_dict)
# Verify the model instances are equivalent
- assert instance_group_manager_prototype_instance_group_manager_auto_scale_prototype_model == instance_group_manager_prototype_instance_group_manager_auto_scale_prototype_model2
+ assert load_balancer_listener_identity_by_href_model == load_balancer_listener_identity_by_href_model2
# Convert model instance back to dict and verify no loss of data
- instance_group_manager_prototype_instance_group_manager_auto_scale_prototype_model_json2 = instance_group_manager_prototype_instance_group_manager_auto_scale_prototype_model.to_dict()
- assert instance_group_manager_prototype_instance_group_manager_auto_scale_prototype_model_json2 == instance_group_manager_prototype_instance_group_manager_auto_scale_prototype_model_json
+ load_balancer_listener_identity_by_href_model_json2 = load_balancer_listener_identity_by_href_model.to_dict()
+ assert load_balancer_listener_identity_by_href_model_json2 == load_balancer_listener_identity_by_href_model_json
-class TestModel_InstanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype:
+class TestModel_LoadBalancerListenerIdentityById:
"""
- Test Class for InstanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype
+ Test Class for LoadBalancerListenerIdentityById
"""
- def test_instance_group_manager_prototype_instance_group_manager_scheduled_prototype_serialization(self):
+ def test_load_balancer_listener_identity_by_id_serialization(self):
"""
- Test serialization/deserialization for InstanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype
+ Test serialization/deserialization for LoadBalancerListenerIdentityById
"""
- # Construct a json representation of a InstanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype model
- instance_group_manager_prototype_instance_group_manager_scheduled_prototype_model_json = {}
- instance_group_manager_prototype_instance_group_manager_scheduled_prototype_model_json['management_enabled'] = True
- instance_group_manager_prototype_instance_group_manager_scheduled_prototype_model_json['name'] = 'my-instance-group-manager'
- instance_group_manager_prototype_instance_group_manager_scheduled_prototype_model_json['manager_type'] = 'scheduled'
+ # Construct a json representation of a LoadBalancerListenerIdentityById model
+ load_balancer_listener_identity_by_id_model_json = {}
+ load_balancer_listener_identity_by_id_model_json['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004'
- # Construct a model instance of InstanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype by calling from_dict on the json representation
- instance_group_manager_prototype_instance_group_manager_scheduled_prototype_model = InstanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype.from_dict(instance_group_manager_prototype_instance_group_manager_scheduled_prototype_model_json)
- assert instance_group_manager_prototype_instance_group_manager_scheduled_prototype_model != False
+ # Construct a model instance of LoadBalancerListenerIdentityById by calling from_dict on the json representation
+ load_balancer_listener_identity_by_id_model = LoadBalancerListenerIdentityById.from_dict(load_balancer_listener_identity_by_id_model_json)
+ assert load_balancer_listener_identity_by_id_model != False
- # Construct a model instance of InstanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype by calling from_dict on the json representation
- instance_group_manager_prototype_instance_group_manager_scheduled_prototype_model_dict = InstanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype.from_dict(instance_group_manager_prototype_instance_group_manager_scheduled_prototype_model_json).__dict__
- instance_group_manager_prototype_instance_group_manager_scheduled_prototype_model2 = InstanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype(**instance_group_manager_prototype_instance_group_manager_scheduled_prototype_model_dict)
+ # Construct a model instance of LoadBalancerListenerIdentityById by calling from_dict on the json representation
+ load_balancer_listener_identity_by_id_model_dict = LoadBalancerListenerIdentityById.from_dict(load_balancer_listener_identity_by_id_model_json).__dict__
+ load_balancer_listener_identity_by_id_model2 = LoadBalancerListenerIdentityById(**load_balancer_listener_identity_by_id_model_dict)
# Verify the model instances are equivalent
- assert instance_group_manager_prototype_instance_group_manager_scheduled_prototype_model == instance_group_manager_prototype_instance_group_manager_scheduled_prototype_model2
+ assert load_balancer_listener_identity_by_id_model == load_balancer_listener_identity_by_id_model2
# Convert model instance back to dict and verify no loss of data
- instance_group_manager_prototype_instance_group_manager_scheduled_prototype_model_json2 = instance_group_manager_prototype_instance_group_manager_scheduled_prototype_model.to_dict()
- assert instance_group_manager_prototype_instance_group_manager_scheduled_prototype_model_json2 == instance_group_manager_prototype_instance_group_manager_scheduled_prototype_model_json
+ load_balancer_listener_identity_by_id_model_json2 = load_balancer_listener_identity_by_id_model.to_dict()
+ assert load_balancer_listener_identity_by_id_model_json2 == load_balancer_listener_identity_by_id_model_json
-class TestModel_InstanceGroupManagerScheduled:
+class TestModel_LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerHTTPSRedirectPatch:
"""
- Test Class for InstanceGroupManagerScheduled
+ Test Class for LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerHTTPSRedirectPatch
"""
- def test_instance_group_manager_scheduled_serialization(self):
+ def test_load_balancer_listener_policy_target_patch_load_balancer_listener_https_redirect_patch_serialization(self):
"""
- Test serialization/deserialization for InstanceGroupManagerScheduled
+ Test serialization/deserialization for LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerHTTPSRedirectPatch
"""
# 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_group_manager_action_reference_model = {} # InstanceGroupManagerActionReference
- instance_group_manager_action_reference_model['deleted'] = instance_group_manager_action_reference_deleted_model
- instance_group_manager_action_reference_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_reference_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
- instance_group_manager_action_reference_model['name'] = 'my-instance-group-manager-action'
- instance_group_manager_action_reference_model['resource_type'] = 'instance_group_manager_action'
+ load_balancer_listener_identity_model = {} # LoadBalancerListenerIdentityById
+ load_balancer_listener_identity_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004'
- # Construct a json representation of a InstanceGroupManagerScheduled model
- instance_group_manager_scheduled_model_json = {}
- instance_group_manager_scheduled_model_json['created_at'] = '2019-01-01T12:00:00Z'
- instance_group_manager_scheduled_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_scheduled_model_json['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
- instance_group_manager_scheduled_model_json['management_enabled'] = True
- instance_group_manager_scheduled_model_json['name'] = 'my-instance-group-manager'
- instance_group_manager_scheduled_model_json['updated_at'] = '2019-01-01T12:00:00Z'
- instance_group_manager_scheduled_model_json['actions'] = [instance_group_manager_action_reference_model]
- instance_group_manager_scheduled_model_json['manager_type'] = 'scheduled'
+ # Construct a json representation of a LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerHTTPSRedirectPatch model
+ load_balancer_listener_policy_target_patch_load_balancer_listener_https_redirect_patch_model_json = {}
+ load_balancer_listener_policy_target_patch_load_balancer_listener_https_redirect_patch_model_json['http_status_code'] = 301
+ load_balancer_listener_policy_target_patch_load_balancer_listener_https_redirect_patch_model_json['listener'] = load_balancer_listener_identity_model
+ load_balancer_listener_policy_target_patch_load_balancer_listener_https_redirect_patch_model_json['uri'] = '/example?doc=get'
- # Construct a model instance of InstanceGroupManagerScheduled by calling from_dict on the json representation
- instance_group_manager_scheduled_model = InstanceGroupManagerScheduled.from_dict(instance_group_manager_scheduled_model_json)
- assert instance_group_manager_scheduled_model != False
+ # Construct a model instance of LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerHTTPSRedirectPatch by calling from_dict on the json representation
+ load_balancer_listener_policy_target_patch_load_balancer_listener_https_redirect_patch_model = LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerHTTPSRedirectPatch.from_dict(load_balancer_listener_policy_target_patch_load_balancer_listener_https_redirect_patch_model_json)
+ assert load_balancer_listener_policy_target_patch_load_balancer_listener_https_redirect_patch_model != False
- # Construct a model instance of InstanceGroupManagerScheduled by calling from_dict on the json representation
- instance_group_manager_scheduled_model_dict = InstanceGroupManagerScheduled.from_dict(instance_group_manager_scheduled_model_json).__dict__
- instance_group_manager_scheduled_model2 = InstanceGroupManagerScheduled(**instance_group_manager_scheduled_model_dict)
+ # Construct a model instance of LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerHTTPSRedirectPatch by calling from_dict on the json representation
+ load_balancer_listener_policy_target_patch_load_balancer_listener_https_redirect_patch_model_dict = LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerHTTPSRedirectPatch.from_dict(load_balancer_listener_policy_target_patch_load_balancer_listener_https_redirect_patch_model_json).__dict__
+ load_balancer_listener_policy_target_patch_load_balancer_listener_https_redirect_patch_model2 = LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerHTTPSRedirectPatch(**load_balancer_listener_policy_target_patch_load_balancer_listener_https_redirect_patch_model_dict)
# Verify the model instances are equivalent
- assert instance_group_manager_scheduled_model == instance_group_manager_scheduled_model2
+ assert load_balancer_listener_policy_target_patch_load_balancer_listener_https_redirect_patch_model == load_balancer_listener_policy_target_patch_load_balancer_listener_https_redirect_patch_model2
# Convert model instance back to dict and verify no loss of data
- instance_group_manager_scheduled_model_json2 = instance_group_manager_scheduled_model.to_dict()
- assert instance_group_manager_scheduled_model_json2 == instance_group_manager_scheduled_model_json
+ load_balancer_listener_policy_target_patch_load_balancer_listener_https_redirect_patch_model_json2 = load_balancer_listener_policy_target_patch_load_balancer_listener_https_redirect_patch_model.to_dict()
+ assert load_balancer_listener_policy_target_patch_load_balancer_listener_https_redirect_patch_model_json2 == load_balancer_listener_policy_target_patch_load_balancer_listener_https_redirect_patch_model_json
-class TestModel_InstanceGroupManagerScheduledActionManagerAutoScale:
+class TestModel_LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerPolicyRedirectURLPatch:
"""
- Test Class for InstanceGroupManagerScheduledActionManagerAutoScale
+ Test Class for LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerPolicyRedirectURLPatch
"""
- def test_instance_group_manager_scheduled_action_manager_auto_scale_serialization(self):
+ def test_load_balancer_listener_policy_target_patch_load_balancer_listener_policy_redirect_url_patch_serialization(self):
"""
- Test serialization/deserialization for InstanceGroupManagerScheduledActionManagerAutoScale
+ Test serialization/deserialization for LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerPolicyRedirectURLPatch
"""
- # Construct dict forms of any model objects needed in order to build this model.
-
- 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 InstanceGroupManagerScheduledActionManagerAutoScale model
- instance_group_manager_scheduled_action_manager_auto_scale_model_json = {}
- instance_group_manager_scheduled_action_manager_auto_scale_model_json['deleted'] = instance_group_manager_reference_deleted_model
- instance_group_manager_scheduled_action_manager_auto_scale_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_scheduled_action_manager_auto_scale_model_json['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
- instance_group_manager_scheduled_action_manager_auto_scale_model_json['name'] = 'my-instance-group-manager'
- instance_group_manager_scheduled_action_manager_auto_scale_model_json['max_membership_count'] = 10
- instance_group_manager_scheduled_action_manager_auto_scale_model_json['min_membership_count'] = 10
+ # Construct a json representation of a LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerPolicyRedirectURLPatch model
+ load_balancer_listener_policy_target_patch_load_balancer_listener_policy_redirect_url_patch_model_json = {}
+ load_balancer_listener_policy_target_patch_load_balancer_listener_policy_redirect_url_patch_model_json['http_status_code'] = 301
+ load_balancer_listener_policy_target_patch_load_balancer_listener_policy_redirect_url_patch_model_json['url'] = 'https://www.redirect.com'
- # Construct a model instance of InstanceGroupManagerScheduledActionManagerAutoScale by calling from_dict on the json representation
- instance_group_manager_scheduled_action_manager_auto_scale_model = InstanceGroupManagerScheduledActionManagerAutoScale.from_dict(instance_group_manager_scheduled_action_manager_auto_scale_model_json)
- assert instance_group_manager_scheduled_action_manager_auto_scale_model != False
+ # Construct a model instance of LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerPolicyRedirectURLPatch by calling from_dict on the json representation
+ load_balancer_listener_policy_target_patch_load_balancer_listener_policy_redirect_url_patch_model = LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerPolicyRedirectURLPatch.from_dict(load_balancer_listener_policy_target_patch_load_balancer_listener_policy_redirect_url_patch_model_json)
+ assert load_balancer_listener_policy_target_patch_load_balancer_listener_policy_redirect_url_patch_model != False
- # Construct a model instance of InstanceGroupManagerScheduledActionManagerAutoScale by calling from_dict on the json representation
- instance_group_manager_scheduled_action_manager_auto_scale_model_dict = InstanceGroupManagerScheduledActionManagerAutoScale.from_dict(instance_group_manager_scheduled_action_manager_auto_scale_model_json).__dict__
- instance_group_manager_scheduled_action_manager_auto_scale_model2 = InstanceGroupManagerScheduledActionManagerAutoScale(**instance_group_manager_scheduled_action_manager_auto_scale_model_dict)
+ # Construct a model instance of LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerPolicyRedirectURLPatch by calling from_dict on the json representation
+ load_balancer_listener_policy_target_patch_load_balancer_listener_policy_redirect_url_patch_model_dict = LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerPolicyRedirectURLPatch.from_dict(load_balancer_listener_policy_target_patch_load_balancer_listener_policy_redirect_url_patch_model_json).__dict__
+ load_balancer_listener_policy_target_patch_load_balancer_listener_policy_redirect_url_patch_model2 = LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerPolicyRedirectURLPatch(**load_balancer_listener_policy_target_patch_load_balancer_listener_policy_redirect_url_patch_model_dict)
# Verify the model instances are equivalent
- assert instance_group_manager_scheduled_action_manager_auto_scale_model == instance_group_manager_scheduled_action_manager_auto_scale_model2
+ assert load_balancer_listener_policy_target_patch_load_balancer_listener_policy_redirect_url_patch_model == load_balancer_listener_policy_target_patch_load_balancer_listener_policy_redirect_url_patch_model2
# Convert model instance back to dict and verify no loss of data
- instance_group_manager_scheduled_action_manager_auto_scale_model_json2 = instance_group_manager_scheduled_action_manager_auto_scale_model.to_dict()
- assert instance_group_manager_scheduled_action_manager_auto_scale_model_json2 == instance_group_manager_scheduled_action_manager_auto_scale_model_json
+ load_balancer_listener_policy_target_patch_load_balancer_listener_policy_redirect_url_patch_model_json2 = load_balancer_listener_policy_target_patch_load_balancer_listener_policy_redirect_url_patch_model.to_dict()
+ assert load_balancer_listener_policy_target_patch_load_balancer_listener_policy_redirect_url_patch_model_json2 == load_balancer_listener_policy_target_patch_load_balancer_listener_policy_redirect_url_patch_model_json
-class TestModel_InstancePatchProfileInstanceProfileIdentityByHref:
+class TestModel_LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerHTTPSRedirectPrototype:
"""
- Test Class for InstancePatchProfileInstanceProfileIdentityByHref
+ Test Class for LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerHTTPSRedirectPrototype
"""
- def test_instance_patch_profile_instance_profile_identity_by_href_serialization(self):
+ def test_load_balancer_listener_policy_target_prototype_load_balancer_listener_https_redirect_prototype_serialization(self):
"""
- Test serialization/deserialization for InstancePatchProfileInstanceProfileIdentityByHref
+ Test serialization/deserialization for LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerHTTPSRedirectPrototype
"""
- # Construct a json representation of a InstancePatchProfileInstanceProfileIdentityByHref model
- instance_patch_profile_instance_profile_identity_by_href_model_json = {}
- instance_patch_profile_instance_profile_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16'
+ # Construct dict forms of any model objects needed in order to build this model.
- # Construct a model instance of InstancePatchProfileInstanceProfileIdentityByHref by calling from_dict on the json representation
- instance_patch_profile_instance_profile_identity_by_href_model = InstancePatchProfileInstanceProfileIdentityByHref.from_dict(instance_patch_profile_instance_profile_identity_by_href_model_json)
- assert instance_patch_profile_instance_profile_identity_by_href_model != False
+ load_balancer_listener_identity_model = {} # LoadBalancerListenerIdentityById
+ load_balancer_listener_identity_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004'
- # Construct a model instance of InstancePatchProfileInstanceProfileIdentityByHref by calling from_dict on the json representation
- instance_patch_profile_instance_profile_identity_by_href_model_dict = InstancePatchProfileInstanceProfileIdentityByHref.from_dict(instance_patch_profile_instance_profile_identity_by_href_model_json).__dict__
- instance_patch_profile_instance_profile_identity_by_href_model2 = InstancePatchProfileInstanceProfileIdentityByHref(**instance_patch_profile_instance_profile_identity_by_href_model_dict)
+ # Construct a json representation of a LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerHTTPSRedirectPrototype model
+ load_balancer_listener_policy_target_prototype_load_balancer_listener_https_redirect_prototype_model_json = {}
+ load_balancer_listener_policy_target_prototype_load_balancer_listener_https_redirect_prototype_model_json['http_status_code'] = 301
+ load_balancer_listener_policy_target_prototype_load_balancer_listener_https_redirect_prototype_model_json['listener'] = load_balancer_listener_identity_model
+ load_balancer_listener_policy_target_prototype_load_balancer_listener_https_redirect_prototype_model_json['uri'] = '/example?doc=get'
+
+ # Construct a model instance of LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerHTTPSRedirectPrototype by calling from_dict on the json representation
+ load_balancer_listener_policy_target_prototype_load_balancer_listener_https_redirect_prototype_model = LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerHTTPSRedirectPrototype.from_dict(load_balancer_listener_policy_target_prototype_load_balancer_listener_https_redirect_prototype_model_json)
+ assert load_balancer_listener_policy_target_prototype_load_balancer_listener_https_redirect_prototype_model != False
+
+ # Construct a model instance of LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerHTTPSRedirectPrototype by calling from_dict on the json representation
+ load_balancer_listener_policy_target_prototype_load_balancer_listener_https_redirect_prototype_model_dict = LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerHTTPSRedirectPrototype.from_dict(load_balancer_listener_policy_target_prototype_load_balancer_listener_https_redirect_prototype_model_json).__dict__
+ load_balancer_listener_policy_target_prototype_load_balancer_listener_https_redirect_prototype_model2 = LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerHTTPSRedirectPrototype(**load_balancer_listener_policy_target_prototype_load_balancer_listener_https_redirect_prototype_model_dict)
# Verify the model instances are equivalent
- assert instance_patch_profile_instance_profile_identity_by_href_model == instance_patch_profile_instance_profile_identity_by_href_model2
+ assert load_balancer_listener_policy_target_prototype_load_balancer_listener_https_redirect_prototype_model == load_balancer_listener_policy_target_prototype_load_balancer_listener_https_redirect_prototype_model2
# Convert model instance back to dict and verify no loss of data
- instance_patch_profile_instance_profile_identity_by_href_model_json2 = instance_patch_profile_instance_profile_identity_by_href_model.to_dict()
- assert instance_patch_profile_instance_profile_identity_by_href_model_json2 == instance_patch_profile_instance_profile_identity_by_href_model_json
+ load_balancer_listener_policy_target_prototype_load_balancer_listener_https_redirect_prototype_model_json2 = load_balancer_listener_policy_target_prototype_load_balancer_listener_https_redirect_prototype_model.to_dict()
+ assert load_balancer_listener_policy_target_prototype_load_balancer_listener_https_redirect_prototype_model_json2 == load_balancer_listener_policy_target_prototype_load_balancer_listener_https_redirect_prototype_model_json
-class TestModel_InstancePatchProfileInstanceProfileIdentityByName:
+class TestModel_LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyRedirectURLPrototype:
"""
- Test Class for InstancePatchProfileInstanceProfileIdentityByName
+ Test Class for LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyRedirectURLPrototype
"""
- def test_instance_patch_profile_instance_profile_identity_by_name_serialization(self):
+ def test_load_balancer_listener_policy_target_prototype_load_balancer_listener_policy_redirect_url_prototype_serialization(self):
"""
- Test serialization/deserialization for InstancePatchProfileInstanceProfileIdentityByName
+ Test serialization/deserialization for LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyRedirectURLPrototype
"""
- # Construct a json representation of a InstancePatchProfileInstanceProfileIdentityByName model
- instance_patch_profile_instance_profile_identity_by_name_model_json = {}
- instance_patch_profile_instance_profile_identity_by_name_model_json['name'] = 'bx2-4x16'
+ # Construct a json representation of a LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyRedirectURLPrototype model
+ load_balancer_listener_policy_target_prototype_load_balancer_listener_policy_redirect_url_prototype_model_json = {}
+ load_balancer_listener_policy_target_prototype_load_balancer_listener_policy_redirect_url_prototype_model_json['http_status_code'] = 301
+ load_balancer_listener_policy_target_prototype_load_balancer_listener_policy_redirect_url_prototype_model_json['url'] = 'https://www.redirect.com'
- # Construct a model instance of InstancePatchProfileInstanceProfileIdentityByName by calling from_dict on the json representation
- instance_patch_profile_instance_profile_identity_by_name_model = InstancePatchProfileInstanceProfileIdentityByName.from_dict(instance_patch_profile_instance_profile_identity_by_name_model_json)
- assert instance_patch_profile_instance_profile_identity_by_name_model != False
+ # Construct a model instance of LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyRedirectURLPrototype by calling from_dict on the json representation
+ load_balancer_listener_policy_target_prototype_load_balancer_listener_policy_redirect_url_prototype_model = LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyRedirectURLPrototype.from_dict(load_balancer_listener_policy_target_prototype_load_balancer_listener_policy_redirect_url_prototype_model_json)
+ assert load_balancer_listener_policy_target_prototype_load_balancer_listener_policy_redirect_url_prototype_model != False
- # Construct a model instance of InstancePatchProfileInstanceProfileIdentityByName by calling from_dict on the json representation
- instance_patch_profile_instance_profile_identity_by_name_model_dict = InstancePatchProfileInstanceProfileIdentityByName.from_dict(instance_patch_profile_instance_profile_identity_by_name_model_json).__dict__
- instance_patch_profile_instance_profile_identity_by_name_model2 = InstancePatchProfileInstanceProfileIdentityByName(**instance_patch_profile_instance_profile_identity_by_name_model_dict)
+ # Construct a model instance of LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyRedirectURLPrototype by calling from_dict on the json representation
+ load_balancer_listener_policy_target_prototype_load_balancer_listener_policy_redirect_url_prototype_model_dict = LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyRedirectURLPrototype.from_dict(load_balancer_listener_policy_target_prototype_load_balancer_listener_policy_redirect_url_prototype_model_json).__dict__
+ load_balancer_listener_policy_target_prototype_load_balancer_listener_policy_redirect_url_prototype_model2 = LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyRedirectURLPrototype(**load_balancer_listener_policy_target_prototype_load_balancer_listener_policy_redirect_url_prototype_model_dict)
# Verify the model instances are equivalent
- assert instance_patch_profile_instance_profile_identity_by_name_model == instance_patch_profile_instance_profile_identity_by_name_model2
+ assert load_balancer_listener_policy_target_prototype_load_balancer_listener_policy_redirect_url_prototype_model == load_balancer_listener_policy_target_prototype_load_balancer_listener_policy_redirect_url_prototype_model2
# Convert model instance back to dict and verify no loss of data
- instance_patch_profile_instance_profile_identity_by_name_model_json2 = instance_patch_profile_instance_profile_identity_by_name_model.to_dict()
- assert instance_patch_profile_instance_profile_identity_by_name_model_json2 == instance_patch_profile_instance_profile_identity_by_name_model_json
+ load_balancer_listener_policy_target_prototype_load_balancer_listener_policy_redirect_url_prototype_model_json2 = load_balancer_listener_policy_target_prototype_load_balancer_listener_policy_redirect_url_prototype_model.to_dict()
+ assert load_balancer_listener_policy_target_prototype_load_balancer_listener_policy_redirect_url_prototype_model_json2 == load_balancer_listener_policy_target_prototype_load_balancer_listener_policy_redirect_url_prototype_model_json
-class TestModel_InstancePlacementTargetDedicatedHostGroupReference:
+class TestModel_LoadBalancerListenerPolicyTargetLoadBalancerListenerHTTPSRedirect:
"""
- Test Class for InstancePlacementTargetDedicatedHostGroupReference
+ Test Class for LoadBalancerListenerPolicyTargetLoadBalancerListenerHTTPSRedirect
"""
- def test_instance_placement_target_dedicated_host_group_reference_serialization(self):
+ def test_load_balancer_listener_policy_target_load_balancer_listener_https_redirect_serialization(self):
"""
- Test serialization/deserialization for InstancePlacementTargetDedicatedHostGroupReference
+ Test serialization/deserialization for LoadBalancerListenerPolicyTargetLoadBalancerListenerHTTPSRedirect
"""
# 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'
+ 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 json representation of a InstancePlacementTargetDedicatedHostGroupReference model
- instance_placement_target_dedicated_host_group_reference_model_json = {}
- instance_placement_target_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'
- instance_placement_target_dedicated_host_group_reference_model_json['deleted'] = dedicated_host_group_reference_deleted_model
- instance_placement_target_dedicated_host_group_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0'
- instance_placement_target_dedicated_host_group_reference_model_json['id'] = 'bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0'
- instance_placement_target_dedicated_host_group_reference_model_json['name'] = 'my-host-group'
- instance_placement_target_dedicated_host_group_reference_model_json['resource_type'] = 'dedicated_host_group'
+ 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 InstancePlacementTargetDedicatedHostGroupReference by calling from_dict on the json representation
- instance_placement_target_dedicated_host_group_reference_model = InstancePlacementTargetDedicatedHostGroupReference.from_dict(instance_placement_target_dedicated_host_group_reference_model_json)
- assert instance_placement_target_dedicated_host_group_reference_model != False
+ # Construct a json representation of a LoadBalancerListenerPolicyTargetLoadBalancerListenerHTTPSRedirect model
+ load_balancer_listener_policy_target_load_balancer_listener_https_redirect_model_json = {}
+ load_balancer_listener_policy_target_load_balancer_listener_https_redirect_model_json['http_status_code'] = 301
+ load_balancer_listener_policy_target_load_balancer_listener_https_redirect_model_json['listener'] = load_balancer_listener_reference_model
+ load_balancer_listener_policy_target_load_balancer_listener_https_redirect_model_json['uri'] = '/example?doc=get'
- # Construct a model instance of InstancePlacementTargetDedicatedHostGroupReference by calling from_dict on the json representation
- instance_placement_target_dedicated_host_group_reference_model_dict = InstancePlacementTargetDedicatedHostGroupReference.from_dict(instance_placement_target_dedicated_host_group_reference_model_json).__dict__
- instance_placement_target_dedicated_host_group_reference_model2 = InstancePlacementTargetDedicatedHostGroupReference(**instance_placement_target_dedicated_host_group_reference_model_dict)
+ # Construct a model instance of LoadBalancerListenerPolicyTargetLoadBalancerListenerHTTPSRedirect by calling from_dict on the json representation
+ load_balancer_listener_policy_target_load_balancer_listener_https_redirect_model = LoadBalancerListenerPolicyTargetLoadBalancerListenerHTTPSRedirect.from_dict(load_balancer_listener_policy_target_load_balancer_listener_https_redirect_model_json)
+ assert load_balancer_listener_policy_target_load_balancer_listener_https_redirect_model != False
+
+ # Construct a model instance of LoadBalancerListenerPolicyTargetLoadBalancerListenerHTTPSRedirect by calling from_dict on the json representation
+ load_balancer_listener_policy_target_load_balancer_listener_https_redirect_model_dict = LoadBalancerListenerPolicyTargetLoadBalancerListenerHTTPSRedirect.from_dict(load_balancer_listener_policy_target_load_balancer_listener_https_redirect_model_json).__dict__
+ load_balancer_listener_policy_target_load_balancer_listener_https_redirect_model2 = LoadBalancerListenerPolicyTargetLoadBalancerListenerHTTPSRedirect(**load_balancer_listener_policy_target_load_balancer_listener_https_redirect_model_dict)
# Verify the model instances are equivalent
- assert instance_placement_target_dedicated_host_group_reference_model == instance_placement_target_dedicated_host_group_reference_model2
+ assert load_balancer_listener_policy_target_load_balancer_listener_https_redirect_model == load_balancer_listener_policy_target_load_balancer_listener_https_redirect_model2
# Convert model instance back to dict and verify no loss of data
- instance_placement_target_dedicated_host_group_reference_model_json2 = instance_placement_target_dedicated_host_group_reference_model.to_dict()
- assert instance_placement_target_dedicated_host_group_reference_model_json2 == instance_placement_target_dedicated_host_group_reference_model_json
+ load_balancer_listener_policy_target_load_balancer_listener_https_redirect_model_json2 = load_balancer_listener_policy_target_load_balancer_listener_https_redirect_model.to_dict()
+ assert load_balancer_listener_policy_target_load_balancer_listener_https_redirect_model_json2 == load_balancer_listener_policy_target_load_balancer_listener_https_redirect_model_json
-class TestModel_InstancePlacementTargetDedicatedHostReference:
+class TestModel_LoadBalancerListenerPolicyTargetLoadBalancerListenerPolicyRedirectURL:
"""
- Test Class for InstancePlacementTargetDedicatedHostReference
+ Test Class for LoadBalancerListenerPolicyTargetLoadBalancerListenerPolicyRedirectURL
"""
- def test_instance_placement_target_dedicated_host_reference_serialization(self):
+ def test_load_balancer_listener_policy_target_load_balancer_listener_policy_redirect_url_serialization(self):
"""
- Test serialization/deserialization for InstancePlacementTargetDedicatedHostReference
+ Test serialization/deserialization for LoadBalancerListenerPolicyTargetLoadBalancerListenerPolicyRedirectURL
"""
- # 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'
-
- # Construct a json representation of a InstancePlacementTargetDedicatedHostReference model
- instance_placement_target_dedicated_host_reference_model_json = {}
- instance_placement_target_dedicated_host_reference_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a'
- instance_placement_target_dedicated_host_reference_model_json['deleted'] = dedicated_host_reference_deleted_model
- instance_placement_target_dedicated_host_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a'
- instance_placement_target_dedicated_host_reference_model_json['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
- instance_placement_target_dedicated_host_reference_model_json['name'] = 'my-host'
- instance_placement_target_dedicated_host_reference_model_json['resource_type'] = 'dedicated_host'
-
- # Construct a model instance of InstancePlacementTargetDedicatedHostReference by calling from_dict on the json representation
- instance_placement_target_dedicated_host_reference_model = InstancePlacementTargetDedicatedHostReference.from_dict(instance_placement_target_dedicated_host_reference_model_json)
- assert instance_placement_target_dedicated_host_reference_model != False
+ # Construct a json representation of a LoadBalancerListenerPolicyTargetLoadBalancerListenerPolicyRedirectURL model
+ load_balancer_listener_policy_target_load_balancer_listener_policy_redirect_url_model_json = {}
+ load_balancer_listener_policy_target_load_balancer_listener_policy_redirect_url_model_json['http_status_code'] = 301
+ load_balancer_listener_policy_target_load_balancer_listener_policy_redirect_url_model_json['url'] = 'https://www.redirect.com'
- # Construct a model instance of InstancePlacementTargetDedicatedHostReference by calling from_dict on the json representation
- instance_placement_target_dedicated_host_reference_model_dict = InstancePlacementTargetDedicatedHostReference.from_dict(instance_placement_target_dedicated_host_reference_model_json).__dict__
- instance_placement_target_dedicated_host_reference_model2 = InstancePlacementTargetDedicatedHostReference(**instance_placement_target_dedicated_host_reference_model_dict)
+ # Construct a model instance of LoadBalancerListenerPolicyTargetLoadBalancerListenerPolicyRedirectURL by calling from_dict on the json representation
+ load_balancer_listener_policy_target_load_balancer_listener_policy_redirect_url_model = LoadBalancerListenerPolicyTargetLoadBalancerListenerPolicyRedirectURL.from_dict(load_balancer_listener_policy_target_load_balancer_listener_policy_redirect_url_model_json)
+ assert load_balancer_listener_policy_target_load_balancer_listener_policy_redirect_url_model != False
+
+ # Construct a model instance of LoadBalancerListenerPolicyTargetLoadBalancerListenerPolicyRedirectURL by calling from_dict on the json representation
+ load_balancer_listener_policy_target_load_balancer_listener_policy_redirect_url_model_dict = LoadBalancerListenerPolicyTargetLoadBalancerListenerPolicyRedirectURL.from_dict(load_balancer_listener_policy_target_load_balancer_listener_policy_redirect_url_model_json).__dict__
+ load_balancer_listener_policy_target_load_balancer_listener_policy_redirect_url_model2 = LoadBalancerListenerPolicyTargetLoadBalancerListenerPolicyRedirectURL(**load_balancer_listener_policy_target_load_balancer_listener_policy_redirect_url_model_dict)
# Verify the model instances are equivalent
- assert instance_placement_target_dedicated_host_reference_model == instance_placement_target_dedicated_host_reference_model2
+ assert load_balancer_listener_policy_target_load_balancer_listener_policy_redirect_url_model == load_balancer_listener_policy_target_load_balancer_listener_policy_redirect_url_model2
# Convert model instance back to dict and verify no loss of data
- instance_placement_target_dedicated_host_reference_model_json2 = instance_placement_target_dedicated_host_reference_model.to_dict()
- assert instance_placement_target_dedicated_host_reference_model_json2 == instance_placement_target_dedicated_host_reference_model_json
+ load_balancer_listener_policy_target_load_balancer_listener_policy_redirect_url_model_json2 = load_balancer_listener_policy_target_load_balancer_listener_policy_redirect_url_model.to_dict()
+ assert load_balancer_listener_policy_target_load_balancer_listener_policy_redirect_url_model_json2 == load_balancer_listener_policy_target_load_balancer_listener_policy_redirect_url_model_json
-class TestModel_InstancePlacementTargetPlacementGroupReference:
+class TestModel_LoadBalancerListenerPolicyTargetLoadBalancerPoolReference:
"""
- Test Class for InstancePlacementTargetPlacementGroupReference
+ Test Class for LoadBalancerListenerPolicyTargetLoadBalancerPoolReference
"""
- def test_instance_placement_target_placement_group_reference_serialization(self):
+ def test_load_balancer_listener_policy_target_load_balancer_pool_reference_serialization(self):
"""
- Test serialization/deserialization for InstancePlacementTargetPlacementGroupReference
+ Test serialization/deserialization for LoadBalancerListenerPolicyTargetLoadBalancerPoolReference
"""
# Construct dict forms of any model objects needed in order to build this model.
- placement_group_reference_deleted_model = {} # PlacementGroupReferenceDeleted
- placement_group_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'
- # Construct a json representation of a InstancePlacementTargetPlacementGroupReference model
- instance_placement_target_placement_group_reference_model_json = {}
- instance_placement_target_placement_group_reference_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::placement-group:r018-418fe842-a3e9-47b9-a938-1aa5bd632871'
- instance_placement_target_placement_group_reference_model_json['deleted'] = placement_group_reference_deleted_model
- instance_placement_target_placement_group_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/placement_groups/r018-418fe842-a3e9-47b9-a938-1aa5bd632871'
- instance_placement_target_placement_group_reference_model_json['id'] = 'r018-418fe842-a3e9-47b9-a938-1aa5bd632871'
- instance_placement_target_placement_group_reference_model_json['name'] = 'my-placement-group'
- instance_placement_target_placement_group_reference_model_json['resource_type'] = 'placement_group'
+ # Construct a json representation of a LoadBalancerListenerPolicyTargetLoadBalancerPoolReference model
+ load_balancer_listener_policy_target_load_balancer_pool_reference_model_json = {}
+ load_balancer_listener_policy_target_load_balancer_pool_reference_model_json['deleted'] = load_balancer_pool_reference_deleted_model
+ load_balancer_listener_policy_target_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_listener_policy_target_load_balancer_pool_reference_model_json['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004'
+ load_balancer_listener_policy_target_load_balancer_pool_reference_model_json['name'] = 'my-load-balancer-pool'
- # Construct a model instance of InstancePlacementTargetPlacementGroupReference by calling from_dict on the json representation
- instance_placement_target_placement_group_reference_model = InstancePlacementTargetPlacementGroupReference.from_dict(instance_placement_target_placement_group_reference_model_json)
- assert instance_placement_target_placement_group_reference_model != False
+ # Construct a model instance of LoadBalancerListenerPolicyTargetLoadBalancerPoolReference by calling from_dict on the json representation
+ load_balancer_listener_policy_target_load_balancer_pool_reference_model = LoadBalancerListenerPolicyTargetLoadBalancerPoolReference.from_dict(load_balancer_listener_policy_target_load_balancer_pool_reference_model_json)
+ assert load_balancer_listener_policy_target_load_balancer_pool_reference_model != False
- # Construct a model instance of InstancePlacementTargetPlacementGroupReference by calling from_dict on the json representation
- instance_placement_target_placement_group_reference_model_dict = InstancePlacementTargetPlacementGroupReference.from_dict(instance_placement_target_placement_group_reference_model_json).__dict__
- instance_placement_target_placement_group_reference_model2 = InstancePlacementTargetPlacementGroupReference(**instance_placement_target_placement_group_reference_model_dict)
+ # Construct a model instance of LoadBalancerListenerPolicyTargetLoadBalancerPoolReference by calling from_dict on the json representation
+ load_balancer_listener_policy_target_load_balancer_pool_reference_model_dict = LoadBalancerListenerPolicyTargetLoadBalancerPoolReference.from_dict(load_balancer_listener_policy_target_load_balancer_pool_reference_model_json).__dict__
+ load_balancer_listener_policy_target_load_balancer_pool_reference_model2 = LoadBalancerListenerPolicyTargetLoadBalancerPoolReference(**load_balancer_listener_policy_target_load_balancer_pool_reference_model_dict)
# Verify the model instances are equivalent
- assert instance_placement_target_placement_group_reference_model == instance_placement_target_placement_group_reference_model2
+ assert load_balancer_listener_policy_target_load_balancer_pool_reference_model == load_balancer_listener_policy_target_load_balancer_pool_reference_model2
# Convert model instance back to dict and verify no loss of data
- instance_placement_target_placement_group_reference_model_json2 = instance_placement_target_placement_group_reference_model.to_dict()
- assert instance_placement_target_placement_group_reference_model_json2 == instance_placement_target_placement_group_reference_model_json
+ load_balancer_listener_policy_target_load_balancer_pool_reference_model_json2 = load_balancer_listener_policy_target_load_balancer_pool_reference_model.to_dict()
+ assert load_balancer_listener_policy_target_load_balancer_pool_reference_model_json2 == load_balancer_listener_policy_target_load_balancer_pool_reference_model_json
-class TestModel_InstanceProfileBandwidthDependent:
+class TestModel_LoadBalancerPoolIdentityByHref:
"""
- Test Class for InstanceProfileBandwidthDependent
+ Test Class for LoadBalancerPoolIdentityByHref
"""
- def test_instance_profile_bandwidth_dependent_serialization(self):
+ def test_load_balancer_pool_identity_by_href_serialization(self):
"""
- Test serialization/deserialization for InstanceProfileBandwidthDependent
+ Test serialization/deserialization for LoadBalancerPoolIdentityByHref
"""
- # Construct a json representation of a InstanceProfileBandwidthDependent model
- instance_profile_bandwidth_dependent_model_json = {}
- instance_profile_bandwidth_dependent_model_json['type'] = 'dependent'
+ # Construct a json representation of a LoadBalancerPoolIdentityByHref model
+ load_balancer_pool_identity_by_href_model_json = {}
+ load_balancer_pool_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004'
- # Construct a model instance of InstanceProfileBandwidthDependent by calling from_dict on the json representation
- instance_profile_bandwidth_dependent_model = InstanceProfileBandwidthDependent.from_dict(instance_profile_bandwidth_dependent_model_json)
- assert instance_profile_bandwidth_dependent_model != False
+ # Construct a model instance of LoadBalancerPoolIdentityByHref by calling from_dict on the json representation
+ load_balancer_pool_identity_by_href_model = LoadBalancerPoolIdentityByHref.from_dict(load_balancer_pool_identity_by_href_model_json)
+ assert load_balancer_pool_identity_by_href_model != False
- # Construct a model instance of InstanceProfileBandwidthDependent by calling from_dict on the json representation
- instance_profile_bandwidth_dependent_model_dict = InstanceProfileBandwidthDependent.from_dict(instance_profile_bandwidth_dependent_model_json).__dict__
- instance_profile_bandwidth_dependent_model2 = InstanceProfileBandwidthDependent(**instance_profile_bandwidth_dependent_model_dict)
+ # Construct a model instance of LoadBalancerPoolIdentityByHref by calling from_dict on the json representation
+ load_balancer_pool_identity_by_href_model_dict = LoadBalancerPoolIdentityByHref.from_dict(load_balancer_pool_identity_by_href_model_json).__dict__
+ load_balancer_pool_identity_by_href_model2 = LoadBalancerPoolIdentityByHref(**load_balancer_pool_identity_by_href_model_dict)
# Verify the model instances are equivalent
- assert instance_profile_bandwidth_dependent_model == instance_profile_bandwidth_dependent_model2
+ assert load_balancer_pool_identity_by_href_model == load_balancer_pool_identity_by_href_model2
# Convert model instance back to dict and verify no loss of data
- instance_profile_bandwidth_dependent_model_json2 = instance_profile_bandwidth_dependent_model.to_dict()
- assert instance_profile_bandwidth_dependent_model_json2 == instance_profile_bandwidth_dependent_model_json
+ load_balancer_pool_identity_by_href_model_json2 = load_balancer_pool_identity_by_href_model.to_dict()
+ assert load_balancer_pool_identity_by_href_model_json2 == load_balancer_pool_identity_by_href_model_json
-class TestModel_InstanceProfileBandwidthEnum:
+class TestModel_LoadBalancerPoolIdentityById:
"""
- Test Class for InstanceProfileBandwidthEnum
+ Test Class for LoadBalancerPoolIdentityById
"""
- def test_instance_profile_bandwidth_enum_serialization(self):
+ def test_load_balancer_pool_identity_by_id_serialization(self):
"""
- Test serialization/deserialization for InstanceProfileBandwidthEnum
+ Test serialization/deserialization for LoadBalancerPoolIdentityById
"""
- # Construct a json representation of a InstanceProfileBandwidthEnum model
- instance_profile_bandwidth_enum_model_json = {}
- instance_profile_bandwidth_enum_model_json['default'] = 38
- instance_profile_bandwidth_enum_model_json['type'] = 'enum'
- instance_profile_bandwidth_enum_model_json['values'] = [16000, 32000, 48000]
+ # Construct a json representation of a LoadBalancerPoolIdentityById model
+ load_balancer_pool_identity_by_id_model_json = {}
+ load_balancer_pool_identity_by_id_model_json['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004'
- # Construct a model instance of InstanceProfileBandwidthEnum by calling from_dict on the json representation
- instance_profile_bandwidth_enum_model = InstanceProfileBandwidthEnum.from_dict(instance_profile_bandwidth_enum_model_json)
- assert instance_profile_bandwidth_enum_model != False
+ # Construct a model instance of LoadBalancerPoolIdentityById by calling from_dict on the json representation
+ load_balancer_pool_identity_by_id_model = LoadBalancerPoolIdentityById.from_dict(load_balancer_pool_identity_by_id_model_json)
+ assert load_balancer_pool_identity_by_id_model != False
- # Construct a model instance of InstanceProfileBandwidthEnum by calling from_dict on the json representation
- instance_profile_bandwidth_enum_model_dict = InstanceProfileBandwidthEnum.from_dict(instance_profile_bandwidth_enum_model_json).__dict__
- instance_profile_bandwidth_enum_model2 = InstanceProfileBandwidthEnum(**instance_profile_bandwidth_enum_model_dict)
+ # Construct a model instance of LoadBalancerPoolIdentityById by calling from_dict on the json representation
+ load_balancer_pool_identity_by_id_model_dict = LoadBalancerPoolIdentityById.from_dict(load_balancer_pool_identity_by_id_model_json).__dict__
+ load_balancer_pool_identity_by_id_model2 = LoadBalancerPoolIdentityById(**load_balancer_pool_identity_by_id_model_dict)
# Verify the model instances are equivalent
- assert instance_profile_bandwidth_enum_model == instance_profile_bandwidth_enum_model2
+ assert load_balancer_pool_identity_by_id_model == load_balancer_pool_identity_by_id_model2
# Convert model instance back to dict and verify no loss of data
- instance_profile_bandwidth_enum_model_json2 = instance_profile_bandwidth_enum_model.to_dict()
- assert instance_profile_bandwidth_enum_model_json2 == instance_profile_bandwidth_enum_model_json
+ load_balancer_pool_identity_by_id_model_json2 = load_balancer_pool_identity_by_id_model.to_dict()
+ assert load_balancer_pool_identity_by_id_model_json2 == load_balancer_pool_identity_by_id_model_json
-class TestModel_InstanceProfileBandwidthFixed:
+class TestModel_LoadBalancerPoolMemberTargetPrototypeIP:
"""
- Test Class for InstanceProfileBandwidthFixed
+ Test Class for LoadBalancerPoolMemberTargetPrototypeIP
"""
- def test_instance_profile_bandwidth_fixed_serialization(self):
+ def test_load_balancer_pool_member_target_prototype_ip_serialization(self):
"""
- Test serialization/deserialization for InstanceProfileBandwidthFixed
+ Test serialization/deserialization for LoadBalancerPoolMemberTargetPrototypeIP
"""
- # Construct a json representation of a InstanceProfileBandwidthFixed model
- instance_profile_bandwidth_fixed_model_json = {}
- instance_profile_bandwidth_fixed_model_json['type'] = 'fixed'
- instance_profile_bandwidth_fixed_model_json['value'] = 20000
+ # Construct a json representation of a LoadBalancerPoolMemberTargetPrototypeIP model
+ load_balancer_pool_member_target_prototype_ip_model_json = {}
+ load_balancer_pool_member_target_prototype_ip_model_json['address'] = '192.168.3.4'
- # Construct a model instance of InstanceProfileBandwidthFixed by calling from_dict on the json representation
- instance_profile_bandwidth_fixed_model = InstanceProfileBandwidthFixed.from_dict(instance_profile_bandwidth_fixed_model_json)
- assert instance_profile_bandwidth_fixed_model != False
+ # Construct a model instance of LoadBalancerPoolMemberTargetPrototypeIP by calling from_dict on the json representation
+ load_balancer_pool_member_target_prototype_ip_model = LoadBalancerPoolMemberTargetPrototypeIP.from_dict(load_balancer_pool_member_target_prototype_ip_model_json)
+ assert load_balancer_pool_member_target_prototype_ip_model != False
- # Construct a model instance of InstanceProfileBandwidthFixed by calling from_dict on the json representation
- instance_profile_bandwidth_fixed_model_dict = InstanceProfileBandwidthFixed.from_dict(instance_profile_bandwidth_fixed_model_json).__dict__
- instance_profile_bandwidth_fixed_model2 = InstanceProfileBandwidthFixed(**instance_profile_bandwidth_fixed_model_dict)
+ # Construct a model instance of LoadBalancerPoolMemberTargetPrototypeIP by calling from_dict on the json representation
+ load_balancer_pool_member_target_prototype_ip_model_dict = LoadBalancerPoolMemberTargetPrototypeIP.from_dict(load_balancer_pool_member_target_prototype_ip_model_json).__dict__
+ load_balancer_pool_member_target_prototype_ip_model2 = LoadBalancerPoolMemberTargetPrototypeIP(**load_balancer_pool_member_target_prototype_ip_model_dict)
# Verify the model instances are equivalent
- assert instance_profile_bandwidth_fixed_model == instance_profile_bandwidth_fixed_model2
+ assert load_balancer_pool_member_target_prototype_ip_model == load_balancer_pool_member_target_prototype_ip_model2
# Convert model instance back to dict and verify no loss of data
- instance_profile_bandwidth_fixed_model_json2 = instance_profile_bandwidth_fixed_model.to_dict()
- assert instance_profile_bandwidth_fixed_model_json2 == instance_profile_bandwidth_fixed_model_json
+ load_balancer_pool_member_target_prototype_ip_model_json2 = load_balancer_pool_member_target_prototype_ip_model.to_dict()
+ assert load_balancer_pool_member_target_prototype_ip_model_json2 == load_balancer_pool_member_target_prototype_ip_model_json
-class TestModel_InstanceProfileBandwidthRange:
+class TestModel_LoadBalancerPoolMemberTargetIP:
"""
- Test Class for InstanceProfileBandwidthRange
+ Test Class for LoadBalancerPoolMemberTargetIP
"""
- def test_instance_profile_bandwidth_range_serialization(self):
+ def test_load_balancer_pool_member_target_ip_serialization(self):
"""
- Test serialization/deserialization for InstanceProfileBandwidthRange
+ Test serialization/deserialization for LoadBalancerPoolMemberTargetIP
"""
- # Construct a json representation of a InstanceProfileBandwidthRange model
- instance_profile_bandwidth_range_model_json = {}
- instance_profile_bandwidth_range_model_json['default'] = 10000
- instance_profile_bandwidth_range_model_json['max'] = 80000
- instance_profile_bandwidth_range_model_json['min'] = 1000
- instance_profile_bandwidth_range_model_json['step'] = 1000
- instance_profile_bandwidth_range_model_json['type'] = 'range'
+ # Construct a json representation of a LoadBalancerPoolMemberTargetIP model
+ load_balancer_pool_member_target_ip_model_json = {}
+ load_balancer_pool_member_target_ip_model_json['address'] = '192.168.3.4'
- # Construct a model instance of InstanceProfileBandwidthRange by calling from_dict on the json representation
- instance_profile_bandwidth_range_model = InstanceProfileBandwidthRange.from_dict(instance_profile_bandwidth_range_model_json)
- assert instance_profile_bandwidth_range_model != False
+ # Construct a model instance of LoadBalancerPoolMemberTargetIP by calling from_dict on the json representation
+ load_balancer_pool_member_target_ip_model = LoadBalancerPoolMemberTargetIP.from_dict(load_balancer_pool_member_target_ip_model_json)
+ assert load_balancer_pool_member_target_ip_model != False
- # Construct a model instance of InstanceProfileBandwidthRange by calling from_dict on the json representation
- instance_profile_bandwidth_range_model_dict = InstanceProfileBandwidthRange.from_dict(instance_profile_bandwidth_range_model_json).__dict__
- instance_profile_bandwidth_range_model2 = InstanceProfileBandwidthRange(**instance_profile_bandwidth_range_model_dict)
+ # Construct a model instance of LoadBalancerPoolMemberTargetIP by calling from_dict on the json representation
+ load_balancer_pool_member_target_ip_model_dict = LoadBalancerPoolMemberTargetIP.from_dict(load_balancer_pool_member_target_ip_model_json).__dict__
+ load_balancer_pool_member_target_ip_model2 = LoadBalancerPoolMemberTargetIP(**load_balancer_pool_member_target_ip_model_dict)
# Verify the model instances are equivalent
- assert instance_profile_bandwidth_range_model == instance_profile_bandwidth_range_model2
+ assert load_balancer_pool_member_target_ip_model == load_balancer_pool_member_target_ip_model2
# Convert model instance back to dict and verify no loss of data
- instance_profile_bandwidth_range_model_json2 = instance_profile_bandwidth_range_model.to_dict()
- assert instance_profile_bandwidth_range_model_json2 == instance_profile_bandwidth_range_model_json
+ load_balancer_pool_member_target_ip_model_json2 = load_balancer_pool_member_target_ip_model.to_dict()
+ assert load_balancer_pool_member_target_ip_model_json2 == load_balancer_pool_member_target_ip_model_json
-class TestModel_InstanceProfileDiskQuantityDependent:
+class TestModel_LoadBalancerPoolMemberTargetInstanceReference:
"""
- Test Class for InstanceProfileDiskQuantityDependent
+ Test Class for LoadBalancerPoolMemberTargetInstanceReference
"""
- def test_instance_profile_disk_quantity_dependent_serialization(self):
+ def test_load_balancer_pool_member_target_instance_reference_serialization(self):
"""
- Test serialization/deserialization for InstanceProfileDiskQuantityDependent
+ Test serialization/deserialization for LoadBalancerPoolMemberTargetInstanceReference
"""
- # Construct a json representation of a InstanceProfileDiskQuantityDependent model
- instance_profile_disk_quantity_dependent_model_json = {}
- instance_profile_disk_quantity_dependent_model_json['type'] = 'dependent'
+ # Construct dict forms of any model objects needed in order to build this model.
- # Construct a model instance of InstanceProfileDiskQuantityDependent by calling from_dict on the json representation
- instance_profile_disk_quantity_dependent_model = InstanceProfileDiskQuantityDependent.from_dict(instance_profile_disk_quantity_dependent_model_json)
- assert instance_profile_disk_quantity_dependent_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 InstanceProfileDiskQuantityDependent by calling from_dict on the json representation
- instance_profile_disk_quantity_dependent_model_dict = InstanceProfileDiskQuantityDependent.from_dict(instance_profile_disk_quantity_dependent_model_json).__dict__
- instance_profile_disk_quantity_dependent_model2 = InstanceProfileDiskQuantityDependent(**instance_profile_disk_quantity_dependent_model_dict)
+ # Construct a json representation of a LoadBalancerPoolMemberTargetInstanceReference model
+ load_balancer_pool_member_target_instance_reference_model_json = {}
+ load_balancer_pool_member_target_instance_reference_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a'
+ load_balancer_pool_member_target_instance_reference_model_json['deleted'] = instance_reference_deleted_model
+ load_balancer_pool_member_target_instance_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a'
+ load_balancer_pool_member_target_instance_reference_model_json['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
+ load_balancer_pool_member_target_instance_reference_model_json['name'] = 'my-instance'
+
+ # Construct a model instance of LoadBalancerPoolMemberTargetInstanceReference by calling from_dict on the json representation
+ load_balancer_pool_member_target_instance_reference_model = LoadBalancerPoolMemberTargetInstanceReference.from_dict(load_balancer_pool_member_target_instance_reference_model_json)
+ assert load_balancer_pool_member_target_instance_reference_model != False
+
+ # Construct a model instance of LoadBalancerPoolMemberTargetInstanceReference by calling from_dict on the json representation
+ load_balancer_pool_member_target_instance_reference_model_dict = LoadBalancerPoolMemberTargetInstanceReference.from_dict(load_balancer_pool_member_target_instance_reference_model_json).__dict__
+ load_balancer_pool_member_target_instance_reference_model2 = LoadBalancerPoolMemberTargetInstanceReference(**load_balancer_pool_member_target_instance_reference_model_dict)
# Verify the model instances are equivalent
- assert instance_profile_disk_quantity_dependent_model == instance_profile_disk_quantity_dependent_model2
+ assert load_balancer_pool_member_target_instance_reference_model == load_balancer_pool_member_target_instance_reference_model2
# Convert model instance back to dict and verify no loss of data
- instance_profile_disk_quantity_dependent_model_json2 = instance_profile_disk_quantity_dependent_model.to_dict()
- assert instance_profile_disk_quantity_dependent_model_json2 == instance_profile_disk_quantity_dependent_model_json
+ load_balancer_pool_member_target_instance_reference_model_json2 = load_balancer_pool_member_target_instance_reference_model.to_dict()
+ assert load_balancer_pool_member_target_instance_reference_model_json2 == load_balancer_pool_member_target_instance_reference_model_json
-class TestModel_InstanceProfileDiskQuantityEnum:
+class TestModel_LoadBalancerProfileIdentityByHref:
"""
- Test Class for InstanceProfileDiskQuantityEnum
+ Test Class for LoadBalancerProfileIdentityByHref
"""
- def test_instance_profile_disk_quantity_enum_serialization(self):
+ def test_load_balancer_profile_identity_by_href_serialization(self):
"""
- Test serialization/deserialization for InstanceProfileDiskQuantityEnum
+ Test serialization/deserialization for LoadBalancerProfileIdentityByHref
"""
- # Construct a json representation of a InstanceProfileDiskQuantityEnum model
- instance_profile_disk_quantity_enum_model_json = {}
- instance_profile_disk_quantity_enum_model_json['default'] = 38
- instance_profile_disk_quantity_enum_model_json['type'] = 'enum'
- instance_profile_disk_quantity_enum_model_json['values'] = [1, 2, 4, 8]
+ # Construct a json representation of a LoadBalancerProfileIdentityByHref model
+ load_balancer_profile_identity_by_href_model_json = {}
+ load_balancer_profile_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed'
- # Construct a model instance of InstanceProfileDiskQuantityEnum by calling from_dict on the json representation
- instance_profile_disk_quantity_enum_model = InstanceProfileDiskQuantityEnum.from_dict(instance_profile_disk_quantity_enum_model_json)
- assert instance_profile_disk_quantity_enum_model != False
+ # Construct a model instance of LoadBalancerProfileIdentityByHref by calling from_dict on the json representation
+ load_balancer_profile_identity_by_href_model = LoadBalancerProfileIdentityByHref.from_dict(load_balancer_profile_identity_by_href_model_json)
+ assert load_balancer_profile_identity_by_href_model != False
- # Construct a model instance of InstanceProfileDiskQuantityEnum by calling from_dict on the json representation
- instance_profile_disk_quantity_enum_model_dict = InstanceProfileDiskQuantityEnum.from_dict(instance_profile_disk_quantity_enum_model_json).__dict__
- instance_profile_disk_quantity_enum_model2 = InstanceProfileDiskQuantityEnum(**instance_profile_disk_quantity_enum_model_dict)
+ # Construct a model instance of LoadBalancerProfileIdentityByHref by calling from_dict on the json representation
+ load_balancer_profile_identity_by_href_model_dict = LoadBalancerProfileIdentityByHref.from_dict(load_balancer_profile_identity_by_href_model_json).__dict__
+ load_balancer_profile_identity_by_href_model2 = LoadBalancerProfileIdentityByHref(**load_balancer_profile_identity_by_href_model_dict)
# Verify the model instances are equivalent
- assert instance_profile_disk_quantity_enum_model == instance_profile_disk_quantity_enum_model2
+ assert load_balancer_profile_identity_by_href_model == load_balancer_profile_identity_by_href_model2
# Convert model instance back to dict and verify no loss of data
- instance_profile_disk_quantity_enum_model_json2 = instance_profile_disk_quantity_enum_model.to_dict()
- assert instance_profile_disk_quantity_enum_model_json2 == instance_profile_disk_quantity_enum_model_json
+ load_balancer_profile_identity_by_href_model_json2 = load_balancer_profile_identity_by_href_model.to_dict()
+ assert load_balancer_profile_identity_by_href_model_json2 == load_balancer_profile_identity_by_href_model_json
-class TestModel_InstanceProfileDiskQuantityFixed:
+class TestModel_LoadBalancerProfileIdentityByName:
"""
- Test Class for InstanceProfileDiskQuantityFixed
+ Test Class for LoadBalancerProfileIdentityByName
"""
- def test_instance_profile_disk_quantity_fixed_serialization(self):
+ def test_load_balancer_profile_identity_by_name_serialization(self):
"""
- Test serialization/deserialization for InstanceProfileDiskQuantityFixed
+ Test serialization/deserialization for LoadBalancerProfileIdentityByName
"""
- # Construct a json representation of a InstanceProfileDiskQuantityFixed model
- instance_profile_disk_quantity_fixed_model_json = {}
- instance_profile_disk_quantity_fixed_model_json['type'] = 'fixed'
- instance_profile_disk_quantity_fixed_model_json['value'] = 4
+ # Construct a json representation of a LoadBalancerProfileIdentityByName model
+ load_balancer_profile_identity_by_name_model_json = {}
+ load_balancer_profile_identity_by_name_model_json['name'] = 'network-fixed'
- # Construct a model instance of InstanceProfileDiskQuantityFixed by calling from_dict on the json representation
- instance_profile_disk_quantity_fixed_model = InstanceProfileDiskQuantityFixed.from_dict(instance_profile_disk_quantity_fixed_model_json)
- assert instance_profile_disk_quantity_fixed_model != False
+ # Construct a model instance of LoadBalancerProfileIdentityByName by calling from_dict on the json representation
+ load_balancer_profile_identity_by_name_model = LoadBalancerProfileIdentityByName.from_dict(load_balancer_profile_identity_by_name_model_json)
+ assert load_balancer_profile_identity_by_name_model != False
- # Construct a model instance of InstanceProfileDiskQuantityFixed by calling from_dict on the json representation
- instance_profile_disk_quantity_fixed_model_dict = InstanceProfileDiskQuantityFixed.from_dict(instance_profile_disk_quantity_fixed_model_json).__dict__
- instance_profile_disk_quantity_fixed_model2 = InstanceProfileDiskQuantityFixed(**instance_profile_disk_quantity_fixed_model_dict)
+ # Construct a model instance of LoadBalancerProfileIdentityByName by calling from_dict on the json representation
+ load_balancer_profile_identity_by_name_model_dict = LoadBalancerProfileIdentityByName.from_dict(load_balancer_profile_identity_by_name_model_json).__dict__
+ load_balancer_profile_identity_by_name_model2 = LoadBalancerProfileIdentityByName(**load_balancer_profile_identity_by_name_model_dict)
# Verify the model instances are equivalent
- assert instance_profile_disk_quantity_fixed_model == instance_profile_disk_quantity_fixed_model2
+ assert load_balancer_profile_identity_by_name_model == load_balancer_profile_identity_by_name_model2
# Convert model instance back to dict and verify no loss of data
- instance_profile_disk_quantity_fixed_model_json2 = instance_profile_disk_quantity_fixed_model.to_dict()
- assert instance_profile_disk_quantity_fixed_model_json2 == instance_profile_disk_quantity_fixed_model_json
+ load_balancer_profile_identity_by_name_model_json2 = load_balancer_profile_identity_by_name_model.to_dict()
+ assert load_balancer_profile_identity_by_name_model_json2 == load_balancer_profile_identity_by_name_model_json
-class TestModel_InstanceProfileDiskQuantityRange:
+class TestModel_LoadBalancerProfileInstanceGroupsSupportedDependent:
"""
- Test Class for InstanceProfileDiskQuantityRange
+ Test Class for LoadBalancerProfileInstanceGroupsSupportedDependent
"""
- def test_instance_profile_disk_quantity_range_serialization(self):
+ def test_load_balancer_profile_instance_groups_supported_dependent_serialization(self):
"""
- Test serialization/deserialization for InstanceProfileDiskQuantityRange
+ Test serialization/deserialization for LoadBalancerProfileInstanceGroupsSupportedDependent
"""
- # Construct a json representation of a InstanceProfileDiskQuantityRange model
- instance_profile_disk_quantity_range_model_json = {}
- instance_profile_disk_quantity_range_model_json['default'] = 1
- instance_profile_disk_quantity_range_model_json['max'] = 4
- instance_profile_disk_quantity_range_model_json['min'] = 1
- instance_profile_disk_quantity_range_model_json['step'] = 1
- instance_profile_disk_quantity_range_model_json['type'] = 'range'
+ # Construct a json representation of a LoadBalancerProfileInstanceGroupsSupportedDependent model
+ load_balancer_profile_instance_groups_supported_dependent_model_json = {}
+ load_balancer_profile_instance_groups_supported_dependent_model_json['type'] = 'dependent'
- # Construct a model instance of InstanceProfileDiskQuantityRange by calling from_dict on the json representation
- instance_profile_disk_quantity_range_model = InstanceProfileDiskQuantityRange.from_dict(instance_profile_disk_quantity_range_model_json)
- assert instance_profile_disk_quantity_range_model != False
+ # Construct a model instance of LoadBalancerProfileInstanceGroupsSupportedDependent by calling from_dict on the json representation
+ load_balancer_profile_instance_groups_supported_dependent_model = LoadBalancerProfileInstanceGroupsSupportedDependent.from_dict(load_balancer_profile_instance_groups_supported_dependent_model_json)
+ assert load_balancer_profile_instance_groups_supported_dependent_model != False
- # Construct a model instance of InstanceProfileDiskQuantityRange by calling from_dict on the json representation
- instance_profile_disk_quantity_range_model_dict = InstanceProfileDiskQuantityRange.from_dict(instance_profile_disk_quantity_range_model_json).__dict__
- instance_profile_disk_quantity_range_model2 = InstanceProfileDiskQuantityRange(**instance_profile_disk_quantity_range_model_dict)
+ # Construct a model instance of LoadBalancerProfileInstanceGroupsSupportedDependent by calling from_dict on the json representation
+ load_balancer_profile_instance_groups_supported_dependent_model_dict = LoadBalancerProfileInstanceGroupsSupportedDependent.from_dict(load_balancer_profile_instance_groups_supported_dependent_model_json).__dict__
+ load_balancer_profile_instance_groups_supported_dependent_model2 = LoadBalancerProfileInstanceGroupsSupportedDependent(**load_balancer_profile_instance_groups_supported_dependent_model_dict)
# Verify the model instances are equivalent
- assert instance_profile_disk_quantity_range_model == instance_profile_disk_quantity_range_model2
+ assert load_balancer_profile_instance_groups_supported_dependent_model == load_balancer_profile_instance_groups_supported_dependent_model2
# Convert model instance back to dict and verify no loss of data
- instance_profile_disk_quantity_range_model_json2 = instance_profile_disk_quantity_range_model.to_dict()
- assert instance_profile_disk_quantity_range_model_json2 == instance_profile_disk_quantity_range_model_json
+ load_balancer_profile_instance_groups_supported_dependent_model_json2 = load_balancer_profile_instance_groups_supported_dependent_model.to_dict()
+ assert load_balancer_profile_instance_groups_supported_dependent_model_json2 == load_balancer_profile_instance_groups_supported_dependent_model_json
-class TestModel_InstanceProfileDiskSizeDependent:
+class TestModel_LoadBalancerProfileInstanceGroupsSupportedFixed:
"""
- Test Class for InstanceProfileDiskSizeDependent
+ Test Class for LoadBalancerProfileInstanceGroupsSupportedFixed
"""
- def test_instance_profile_disk_size_dependent_serialization(self):
+ def test_load_balancer_profile_instance_groups_supported_fixed_serialization(self):
"""
- Test serialization/deserialization for InstanceProfileDiskSizeDependent
+ Test serialization/deserialization for LoadBalancerProfileInstanceGroupsSupportedFixed
"""
- # Construct a json representation of a InstanceProfileDiskSizeDependent model
- instance_profile_disk_size_dependent_model_json = {}
- instance_profile_disk_size_dependent_model_json['type'] = 'dependent'
+ # Construct a json representation of a LoadBalancerProfileInstanceGroupsSupportedFixed model
+ load_balancer_profile_instance_groups_supported_fixed_model_json = {}
+ load_balancer_profile_instance_groups_supported_fixed_model_json['type'] = 'fixed'
+ load_balancer_profile_instance_groups_supported_fixed_model_json['value'] = True
- # Construct a model instance of InstanceProfileDiskSizeDependent by calling from_dict on the json representation
- instance_profile_disk_size_dependent_model = InstanceProfileDiskSizeDependent.from_dict(instance_profile_disk_size_dependent_model_json)
- assert instance_profile_disk_size_dependent_model != False
+ # Construct a model instance of LoadBalancerProfileInstanceGroupsSupportedFixed by calling from_dict on the json representation
+ load_balancer_profile_instance_groups_supported_fixed_model = LoadBalancerProfileInstanceGroupsSupportedFixed.from_dict(load_balancer_profile_instance_groups_supported_fixed_model_json)
+ assert load_balancer_profile_instance_groups_supported_fixed_model != False
- # Construct a model instance of InstanceProfileDiskSizeDependent by calling from_dict on the json representation
- instance_profile_disk_size_dependent_model_dict = InstanceProfileDiskSizeDependent.from_dict(instance_profile_disk_size_dependent_model_json).__dict__
- instance_profile_disk_size_dependent_model2 = InstanceProfileDiskSizeDependent(**instance_profile_disk_size_dependent_model_dict)
+ # Construct a model instance of LoadBalancerProfileInstanceGroupsSupportedFixed by calling from_dict on the json representation
+ load_balancer_profile_instance_groups_supported_fixed_model_dict = LoadBalancerProfileInstanceGroupsSupportedFixed.from_dict(load_balancer_profile_instance_groups_supported_fixed_model_json).__dict__
+ load_balancer_profile_instance_groups_supported_fixed_model2 = LoadBalancerProfileInstanceGroupsSupportedFixed(**load_balancer_profile_instance_groups_supported_fixed_model_dict)
# Verify the model instances are equivalent
- assert instance_profile_disk_size_dependent_model == instance_profile_disk_size_dependent_model2
+ assert load_balancer_profile_instance_groups_supported_fixed_model == load_balancer_profile_instance_groups_supported_fixed_model2
# Convert model instance back to dict and verify no loss of data
- instance_profile_disk_size_dependent_model_json2 = instance_profile_disk_size_dependent_model.to_dict()
- assert instance_profile_disk_size_dependent_model_json2 == instance_profile_disk_size_dependent_model_json
+ load_balancer_profile_instance_groups_supported_fixed_model_json2 = load_balancer_profile_instance_groups_supported_fixed_model.to_dict()
+ assert load_balancer_profile_instance_groups_supported_fixed_model_json2 == load_balancer_profile_instance_groups_supported_fixed_model_json
-class TestModel_InstanceProfileDiskSizeEnum:
+class TestModel_LoadBalancerProfileRouteModeSupportedDependent:
"""
- Test Class for InstanceProfileDiskSizeEnum
+ Test Class for LoadBalancerProfileRouteModeSupportedDependent
"""
- def test_instance_profile_disk_size_enum_serialization(self):
+ def test_load_balancer_profile_route_mode_supported_dependent_serialization(self):
"""
- Test serialization/deserialization for InstanceProfileDiskSizeEnum
+ Test serialization/deserialization for LoadBalancerProfileRouteModeSupportedDependent
"""
- # Construct a json representation of a InstanceProfileDiskSizeEnum model
- instance_profile_disk_size_enum_model_json = {}
- instance_profile_disk_size_enum_model_json['default'] = 38
- instance_profile_disk_size_enum_model_json['type'] = 'enum'
- instance_profile_disk_size_enum_model_json['values'] = [1, 2, 4, 8]
+ # Construct a json representation of a LoadBalancerProfileRouteModeSupportedDependent model
+ load_balancer_profile_route_mode_supported_dependent_model_json = {}
+ load_balancer_profile_route_mode_supported_dependent_model_json['type'] = 'dependent'
- # Construct a model instance of InstanceProfileDiskSizeEnum by calling from_dict on the json representation
- instance_profile_disk_size_enum_model = InstanceProfileDiskSizeEnum.from_dict(instance_profile_disk_size_enum_model_json)
- assert instance_profile_disk_size_enum_model != False
+ # Construct a model instance of LoadBalancerProfileRouteModeSupportedDependent by calling from_dict on the json representation
+ load_balancer_profile_route_mode_supported_dependent_model = LoadBalancerProfileRouteModeSupportedDependent.from_dict(load_balancer_profile_route_mode_supported_dependent_model_json)
+ assert load_balancer_profile_route_mode_supported_dependent_model != False
- # Construct a model instance of InstanceProfileDiskSizeEnum by calling from_dict on the json representation
- instance_profile_disk_size_enum_model_dict = InstanceProfileDiskSizeEnum.from_dict(instance_profile_disk_size_enum_model_json).__dict__
- instance_profile_disk_size_enum_model2 = InstanceProfileDiskSizeEnum(**instance_profile_disk_size_enum_model_dict)
+ # Construct a model instance of LoadBalancerProfileRouteModeSupportedDependent by calling from_dict on the json representation
+ load_balancer_profile_route_mode_supported_dependent_model_dict = LoadBalancerProfileRouteModeSupportedDependent.from_dict(load_balancer_profile_route_mode_supported_dependent_model_json).__dict__
+ load_balancer_profile_route_mode_supported_dependent_model2 = LoadBalancerProfileRouteModeSupportedDependent(**load_balancer_profile_route_mode_supported_dependent_model_dict)
# Verify the model instances are equivalent
- assert instance_profile_disk_size_enum_model == instance_profile_disk_size_enum_model2
+ assert load_balancer_profile_route_mode_supported_dependent_model == load_balancer_profile_route_mode_supported_dependent_model2
# Convert model instance back to dict and verify no loss of data
- instance_profile_disk_size_enum_model_json2 = instance_profile_disk_size_enum_model.to_dict()
- assert instance_profile_disk_size_enum_model_json2 == instance_profile_disk_size_enum_model_json
+ load_balancer_profile_route_mode_supported_dependent_model_json2 = load_balancer_profile_route_mode_supported_dependent_model.to_dict()
+ assert load_balancer_profile_route_mode_supported_dependent_model_json2 == load_balancer_profile_route_mode_supported_dependent_model_json
-class TestModel_InstanceProfileDiskSizeFixed:
+class TestModel_LoadBalancerProfileRouteModeSupportedFixed:
"""
- Test Class for InstanceProfileDiskSizeFixed
+ Test Class for LoadBalancerProfileRouteModeSupportedFixed
"""
- def test_instance_profile_disk_size_fixed_serialization(self):
+ def test_load_balancer_profile_route_mode_supported_fixed_serialization(self):
"""
- Test serialization/deserialization for InstanceProfileDiskSizeFixed
+ Test serialization/deserialization for LoadBalancerProfileRouteModeSupportedFixed
"""
- # Construct a json representation of a InstanceProfileDiskSizeFixed model
- instance_profile_disk_size_fixed_model_json = {}
- instance_profile_disk_size_fixed_model_json['type'] = 'fixed'
- instance_profile_disk_size_fixed_model_json['value'] = 100
+ # Construct a json representation of a LoadBalancerProfileRouteModeSupportedFixed model
+ load_balancer_profile_route_mode_supported_fixed_model_json = {}
+ load_balancer_profile_route_mode_supported_fixed_model_json['type'] = 'fixed'
+ load_balancer_profile_route_mode_supported_fixed_model_json['value'] = True
- # Construct a model instance of InstanceProfileDiskSizeFixed by calling from_dict on the json representation
- instance_profile_disk_size_fixed_model = InstanceProfileDiskSizeFixed.from_dict(instance_profile_disk_size_fixed_model_json)
- assert instance_profile_disk_size_fixed_model != False
+ # Construct a model instance of LoadBalancerProfileRouteModeSupportedFixed by calling from_dict on the json representation
+ load_balancer_profile_route_mode_supported_fixed_model = LoadBalancerProfileRouteModeSupportedFixed.from_dict(load_balancer_profile_route_mode_supported_fixed_model_json)
+ assert load_balancer_profile_route_mode_supported_fixed_model != False
- # Construct a model instance of InstanceProfileDiskSizeFixed by calling from_dict on the json representation
- instance_profile_disk_size_fixed_model_dict = InstanceProfileDiskSizeFixed.from_dict(instance_profile_disk_size_fixed_model_json).__dict__
- instance_profile_disk_size_fixed_model2 = InstanceProfileDiskSizeFixed(**instance_profile_disk_size_fixed_model_dict)
+ # Construct a model instance of LoadBalancerProfileRouteModeSupportedFixed by calling from_dict on the json representation
+ load_balancer_profile_route_mode_supported_fixed_model_dict = LoadBalancerProfileRouteModeSupportedFixed.from_dict(load_balancer_profile_route_mode_supported_fixed_model_json).__dict__
+ load_balancer_profile_route_mode_supported_fixed_model2 = LoadBalancerProfileRouteModeSupportedFixed(**load_balancer_profile_route_mode_supported_fixed_model_dict)
# Verify the model instances are equivalent
- assert instance_profile_disk_size_fixed_model == instance_profile_disk_size_fixed_model2
+ assert load_balancer_profile_route_mode_supported_fixed_model == load_balancer_profile_route_mode_supported_fixed_model2
# Convert model instance back to dict and verify no loss of data
- instance_profile_disk_size_fixed_model_json2 = instance_profile_disk_size_fixed_model.to_dict()
- assert instance_profile_disk_size_fixed_model_json2 == instance_profile_disk_size_fixed_model_json
+ load_balancer_profile_route_mode_supported_fixed_model_json2 = load_balancer_profile_route_mode_supported_fixed_model.to_dict()
+ assert load_balancer_profile_route_mode_supported_fixed_model_json2 == load_balancer_profile_route_mode_supported_fixed_model_json
-class TestModel_InstanceProfileDiskSizeRange:
+class TestModel_LoadBalancerProfileSecurityGroupsSupportedDependent:
"""
- Test Class for InstanceProfileDiskSizeRange
+ Test Class for LoadBalancerProfileSecurityGroupsSupportedDependent
"""
- def test_instance_profile_disk_size_range_serialization(self):
+ def test_load_balancer_profile_security_groups_supported_dependent_serialization(self):
"""
- Test serialization/deserialization for InstanceProfileDiskSizeRange
+ Test serialization/deserialization for LoadBalancerProfileSecurityGroupsSupportedDependent
"""
- # Construct a json representation of a InstanceProfileDiskSizeRange model
- instance_profile_disk_size_range_model_json = {}
- instance_profile_disk_size_range_model_json['default'] = 100
- instance_profile_disk_size_range_model_json['max'] = 1000
- instance_profile_disk_size_range_model_json['min'] = 100
- instance_profile_disk_size_range_model_json['step'] = 10
- instance_profile_disk_size_range_model_json['type'] = 'range'
+ # Construct a json representation of a LoadBalancerProfileSecurityGroupsSupportedDependent model
+ load_balancer_profile_security_groups_supported_dependent_model_json = {}
+ load_balancer_profile_security_groups_supported_dependent_model_json['type'] = 'dependent'
- # Construct a model instance of InstanceProfileDiskSizeRange by calling from_dict on the json representation
- instance_profile_disk_size_range_model = InstanceProfileDiskSizeRange.from_dict(instance_profile_disk_size_range_model_json)
- assert instance_profile_disk_size_range_model != False
+ # Construct a model instance of LoadBalancerProfileSecurityGroupsSupportedDependent by calling from_dict on the json representation
+ load_balancer_profile_security_groups_supported_dependent_model = LoadBalancerProfileSecurityGroupsSupportedDependent.from_dict(load_balancer_profile_security_groups_supported_dependent_model_json)
+ assert load_balancer_profile_security_groups_supported_dependent_model != False
- # Construct a model instance of InstanceProfileDiskSizeRange by calling from_dict on the json representation
- instance_profile_disk_size_range_model_dict = InstanceProfileDiskSizeRange.from_dict(instance_profile_disk_size_range_model_json).__dict__
- instance_profile_disk_size_range_model2 = InstanceProfileDiskSizeRange(**instance_profile_disk_size_range_model_dict)
+ # Construct a model instance of LoadBalancerProfileSecurityGroupsSupportedDependent by calling from_dict on the json representation
+ load_balancer_profile_security_groups_supported_dependent_model_dict = LoadBalancerProfileSecurityGroupsSupportedDependent.from_dict(load_balancer_profile_security_groups_supported_dependent_model_json).__dict__
+ load_balancer_profile_security_groups_supported_dependent_model2 = LoadBalancerProfileSecurityGroupsSupportedDependent(**load_balancer_profile_security_groups_supported_dependent_model_dict)
# Verify the model instances are equivalent
- assert instance_profile_disk_size_range_model == instance_profile_disk_size_range_model2
+ assert load_balancer_profile_security_groups_supported_dependent_model == load_balancer_profile_security_groups_supported_dependent_model2
# Convert model instance back to dict and verify no loss of data
- instance_profile_disk_size_range_model_json2 = instance_profile_disk_size_range_model.to_dict()
- assert instance_profile_disk_size_range_model_json2 == instance_profile_disk_size_range_model_json
+ load_balancer_profile_security_groups_supported_dependent_model_json2 = load_balancer_profile_security_groups_supported_dependent_model.to_dict()
+ assert load_balancer_profile_security_groups_supported_dependent_model_json2 == load_balancer_profile_security_groups_supported_dependent_model_json
-class TestModel_InstanceProfileGPUDependent:
+class TestModel_LoadBalancerProfileSecurityGroupsSupportedFixed:
"""
- Test Class for InstanceProfileGPUDependent
+ Test Class for LoadBalancerProfileSecurityGroupsSupportedFixed
"""
- def test_instance_profile_gpu_dependent_serialization(self):
+ def test_load_balancer_profile_security_groups_supported_fixed_serialization(self):
"""
- Test serialization/deserialization for InstanceProfileGPUDependent
+ Test serialization/deserialization for LoadBalancerProfileSecurityGroupsSupportedFixed
"""
- # Construct a json representation of a InstanceProfileGPUDependent model
- instance_profile_gpu_dependent_model_json = {}
- instance_profile_gpu_dependent_model_json['type'] = 'dependent'
+ # Construct a json representation of a LoadBalancerProfileSecurityGroupsSupportedFixed model
+ load_balancer_profile_security_groups_supported_fixed_model_json = {}
+ load_balancer_profile_security_groups_supported_fixed_model_json['type'] = 'fixed'
+ load_balancer_profile_security_groups_supported_fixed_model_json['value'] = True
- # Construct a model instance of InstanceProfileGPUDependent by calling from_dict on the json representation
- instance_profile_gpu_dependent_model = InstanceProfileGPUDependent.from_dict(instance_profile_gpu_dependent_model_json)
- assert instance_profile_gpu_dependent_model != False
+ # Construct a model instance of LoadBalancerProfileSecurityGroupsSupportedFixed by calling from_dict on the json representation
+ load_balancer_profile_security_groups_supported_fixed_model = LoadBalancerProfileSecurityGroupsSupportedFixed.from_dict(load_balancer_profile_security_groups_supported_fixed_model_json)
+ assert load_balancer_profile_security_groups_supported_fixed_model != False
- # Construct a model instance of InstanceProfileGPUDependent by calling from_dict on the json representation
- instance_profile_gpu_dependent_model_dict = InstanceProfileGPUDependent.from_dict(instance_profile_gpu_dependent_model_json).__dict__
- instance_profile_gpu_dependent_model2 = InstanceProfileGPUDependent(**instance_profile_gpu_dependent_model_dict)
+ # Construct a model instance of LoadBalancerProfileSecurityGroupsSupportedFixed by calling from_dict on the json representation
+ load_balancer_profile_security_groups_supported_fixed_model_dict = LoadBalancerProfileSecurityGroupsSupportedFixed.from_dict(load_balancer_profile_security_groups_supported_fixed_model_json).__dict__
+ load_balancer_profile_security_groups_supported_fixed_model2 = LoadBalancerProfileSecurityGroupsSupportedFixed(**load_balancer_profile_security_groups_supported_fixed_model_dict)
# Verify the model instances are equivalent
- assert instance_profile_gpu_dependent_model == instance_profile_gpu_dependent_model2
+ assert load_balancer_profile_security_groups_supported_fixed_model == load_balancer_profile_security_groups_supported_fixed_model2
# Convert model instance back to dict and verify no loss of data
- instance_profile_gpu_dependent_model_json2 = instance_profile_gpu_dependent_model.to_dict()
- assert instance_profile_gpu_dependent_model_json2 == instance_profile_gpu_dependent_model_json
+ load_balancer_profile_security_groups_supported_fixed_model_json2 = load_balancer_profile_security_groups_supported_fixed_model.to_dict()
+ assert load_balancer_profile_security_groups_supported_fixed_model_json2 == load_balancer_profile_security_groups_supported_fixed_model_json
-class TestModel_InstanceProfileGPUEnum:
+class TestModel_LoadBalancerProfileUDPSupportedDependent:
"""
- Test Class for InstanceProfileGPUEnum
+ Test Class for LoadBalancerProfileUDPSupportedDependent
"""
- def test_instance_profile_gpu_enum_serialization(self):
+ def test_load_balancer_profile_udp_supported_dependent_serialization(self):
"""
- Test serialization/deserialization for InstanceProfileGPUEnum
+ Test serialization/deserialization for LoadBalancerProfileUDPSupportedDependent
"""
- # Construct a json representation of a InstanceProfileGPUEnum model
- instance_profile_gpu_enum_model_json = {}
- instance_profile_gpu_enum_model_json['default'] = 38
- instance_profile_gpu_enum_model_json['type'] = 'enum'
- instance_profile_gpu_enum_model_json['values'] = [2, 4]
+ # Construct a json representation of a LoadBalancerProfileUDPSupportedDependent model
+ load_balancer_profile_udp_supported_dependent_model_json = {}
+ load_balancer_profile_udp_supported_dependent_model_json['type'] = 'dependent'
- # Construct a model instance of InstanceProfileGPUEnum by calling from_dict on the json representation
- instance_profile_gpu_enum_model = InstanceProfileGPUEnum.from_dict(instance_profile_gpu_enum_model_json)
- assert instance_profile_gpu_enum_model != False
+ # Construct a model instance of LoadBalancerProfileUDPSupportedDependent by calling from_dict on the json representation
+ load_balancer_profile_udp_supported_dependent_model = LoadBalancerProfileUDPSupportedDependent.from_dict(load_balancer_profile_udp_supported_dependent_model_json)
+ assert load_balancer_profile_udp_supported_dependent_model != False
- # Construct a model instance of InstanceProfileGPUEnum by calling from_dict on the json representation
- instance_profile_gpu_enum_model_dict = InstanceProfileGPUEnum.from_dict(instance_profile_gpu_enum_model_json).__dict__
- instance_profile_gpu_enum_model2 = InstanceProfileGPUEnum(**instance_profile_gpu_enum_model_dict)
+ # Construct a model instance of LoadBalancerProfileUDPSupportedDependent by calling from_dict on the json representation
+ load_balancer_profile_udp_supported_dependent_model_dict = LoadBalancerProfileUDPSupportedDependent.from_dict(load_balancer_profile_udp_supported_dependent_model_json).__dict__
+ load_balancer_profile_udp_supported_dependent_model2 = LoadBalancerProfileUDPSupportedDependent(**load_balancer_profile_udp_supported_dependent_model_dict)
# Verify the model instances are equivalent
- assert instance_profile_gpu_enum_model == instance_profile_gpu_enum_model2
+ assert load_balancer_profile_udp_supported_dependent_model == load_balancer_profile_udp_supported_dependent_model2
# Convert model instance back to dict and verify no loss of data
- instance_profile_gpu_enum_model_json2 = instance_profile_gpu_enum_model.to_dict()
- assert instance_profile_gpu_enum_model_json2 == instance_profile_gpu_enum_model_json
+ load_balancer_profile_udp_supported_dependent_model_json2 = load_balancer_profile_udp_supported_dependent_model.to_dict()
+ assert load_balancer_profile_udp_supported_dependent_model_json2 == load_balancer_profile_udp_supported_dependent_model_json
-class TestModel_InstanceProfileGPUFixed:
+class TestModel_LoadBalancerProfileUDPSupportedFixed:
"""
- Test Class for InstanceProfileGPUFixed
+ Test Class for LoadBalancerProfileUDPSupportedFixed
"""
- def test_instance_profile_gpu_fixed_serialization(self):
+ def test_load_balancer_profile_udp_supported_fixed_serialization(self):
"""
- Test serialization/deserialization for InstanceProfileGPUFixed
+ Test serialization/deserialization for LoadBalancerProfileUDPSupportedFixed
"""
- # Construct a json representation of a InstanceProfileGPUFixed model
- instance_profile_gpu_fixed_model_json = {}
- instance_profile_gpu_fixed_model_json['type'] = 'fixed'
- instance_profile_gpu_fixed_model_json['value'] = 2
+ # Construct a json representation of a LoadBalancerProfileUDPSupportedFixed model
+ load_balancer_profile_udp_supported_fixed_model_json = {}
+ load_balancer_profile_udp_supported_fixed_model_json['type'] = 'fixed'
+ load_balancer_profile_udp_supported_fixed_model_json['value'] = True
- # Construct a model instance of InstanceProfileGPUFixed by calling from_dict on the json representation
- instance_profile_gpu_fixed_model = InstanceProfileGPUFixed.from_dict(instance_profile_gpu_fixed_model_json)
- assert instance_profile_gpu_fixed_model != False
+ # Construct a model instance of LoadBalancerProfileUDPSupportedFixed by calling from_dict on the json representation
+ load_balancer_profile_udp_supported_fixed_model = LoadBalancerProfileUDPSupportedFixed.from_dict(load_balancer_profile_udp_supported_fixed_model_json)
+ assert load_balancer_profile_udp_supported_fixed_model != False
- # Construct a model instance of InstanceProfileGPUFixed by calling from_dict on the json representation
- instance_profile_gpu_fixed_model_dict = InstanceProfileGPUFixed.from_dict(instance_profile_gpu_fixed_model_json).__dict__
- instance_profile_gpu_fixed_model2 = InstanceProfileGPUFixed(**instance_profile_gpu_fixed_model_dict)
+ # Construct a model instance of LoadBalancerProfileUDPSupportedFixed by calling from_dict on the json representation
+ load_balancer_profile_udp_supported_fixed_model_dict = LoadBalancerProfileUDPSupportedFixed.from_dict(load_balancer_profile_udp_supported_fixed_model_json).__dict__
+ load_balancer_profile_udp_supported_fixed_model2 = LoadBalancerProfileUDPSupportedFixed(**load_balancer_profile_udp_supported_fixed_model_dict)
# Verify the model instances are equivalent
- assert instance_profile_gpu_fixed_model == instance_profile_gpu_fixed_model2
+ assert load_balancer_profile_udp_supported_fixed_model == load_balancer_profile_udp_supported_fixed_model2
# Convert model instance back to dict and verify no loss of data
- instance_profile_gpu_fixed_model_json2 = instance_profile_gpu_fixed_model.to_dict()
- assert instance_profile_gpu_fixed_model_json2 == instance_profile_gpu_fixed_model_json
+ load_balancer_profile_udp_supported_fixed_model_json2 = load_balancer_profile_udp_supported_fixed_model.to_dict()
+ assert load_balancer_profile_udp_supported_fixed_model_json2 == load_balancer_profile_udp_supported_fixed_model_json
-class TestModel_InstanceProfileGPUMemoryDependent:
+class TestModel_NetworkACLIdentityByCRN:
"""
- Test Class for InstanceProfileGPUMemoryDependent
+ Test Class for NetworkACLIdentityByCRN
"""
- def test_instance_profile_gpu_memory_dependent_serialization(self):
+ def test_network_acl_identity_by_crn_serialization(self):
"""
- Test serialization/deserialization for InstanceProfileGPUMemoryDependent
+ Test serialization/deserialization for NetworkACLIdentityByCRN
"""
- # Construct a json representation of a InstanceProfileGPUMemoryDependent model
- instance_profile_gpu_memory_dependent_model_json = {}
- instance_profile_gpu_memory_dependent_model_json['type'] = 'dependent'
+ # Construct a json representation of a NetworkACLIdentityByCRN model
+ network_acl_identity_by_crn_model_json = {}
+ network_acl_identity_by_crn_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf'
- # Construct a model instance of InstanceProfileGPUMemoryDependent by calling from_dict on the json representation
- instance_profile_gpu_memory_dependent_model = InstanceProfileGPUMemoryDependent.from_dict(instance_profile_gpu_memory_dependent_model_json)
- assert instance_profile_gpu_memory_dependent_model != False
+ # Construct a model instance of NetworkACLIdentityByCRN by calling from_dict on the json representation
+ network_acl_identity_by_crn_model = NetworkACLIdentityByCRN.from_dict(network_acl_identity_by_crn_model_json)
+ assert network_acl_identity_by_crn_model != False
- # Construct a model instance of InstanceProfileGPUMemoryDependent by calling from_dict on the json representation
- instance_profile_gpu_memory_dependent_model_dict = InstanceProfileGPUMemoryDependent.from_dict(instance_profile_gpu_memory_dependent_model_json).__dict__
- instance_profile_gpu_memory_dependent_model2 = InstanceProfileGPUMemoryDependent(**instance_profile_gpu_memory_dependent_model_dict)
+ # Construct a model instance of NetworkACLIdentityByCRN by calling from_dict on the json representation
+ network_acl_identity_by_crn_model_dict = NetworkACLIdentityByCRN.from_dict(network_acl_identity_by_crn_model_json).__dict__
+ network_acl_identity_by_crn_model2 = NetworkACLIdentityByCRN(**network_acl_identity_by_crn_model_dict)
# Verify the model instances are equivalent
- assert instance_profile_gpu_memory_dependent_model == instance_profile_gpu_memory_dependent_model2
+ assert network_acl_identity_by_crn_model == network_acl_identity_by_crn_model2
# Convert model instance back to dict and verify no loss of data
- instance_profile_gpu_memory_dependent_model_json2 = instance_profile_gpu_memory_dependent_model.to_dict()
- assert instance_profile_gpu_memory_dependent_model_json2 == instance_profile_gpu_memory_dependent_model_json
+ network_acl_identity_by_crn_model_json2 = network_acl_identity_by_crn_model.to_dict()
+ assert network_acl_identity_by_crn_model_json2 == network_acl_identity_by_crn_model_json
-class TestModel_InstanceProfileGPUMemoryEnum:
+class TestModel_NetworkACLIdentityByHref:
"""
- Test Class for InstanceProfileGPUMemoryEnum
+ Test Class for NetworkACLIdentityByHref
"""
- def test_instance_profile_gpu_memory_enum_serialization(self):
+ def test_network_acl_identity_by_href_serialization(self):
"""
- Test serialization/deserialization for InstanceProfileGPUMemoryEnum
+ Test serialization/deserialization for NetworkACLIdentityByHref
"""
- # Construct a json representation of a InstanceProfileGPUMemoryEnum model
- instance_profile_gpu_memory_enum_model_json = {}
- instance_profile_gpu_memory_enum_model_json['default'] = 38
- instance_profile_gpu_memory_enum_model_json['type'] = 'enum'
- instance_profile_gpu_memory_enum_model_json['values'] = [16, 32]
+ # Construct a json representation of a NetworkACLIdentityByHref model
+ network_acl_identity_by_href_model_json = {}
+ network_acl_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf'
- # Construct a model instance of InstanceProfileGPUMemoryEnum by calling from_dict on the json representation
- instance_profile_gpu_memory_enum_model = InstanceProfileGPUMemoryEnum.from_dict(instance_profile_gpu_memory_enum_model_json)
- assert instance_profile_gpu_memory_enum_model != False
+ # Construct a model instance of NetworkACLIdentityByHref by calling from_dict on the json representation
+ network_acl_identity_by_href_model = NetworkACLIdentityByHref.from_dict(network_acl_identity_by_href_model_json)
+ assert network_acl_identity_by_href_model != False
- # Construct a model instance of InstanceProfileGPUMemoryEnum by calling from_dict on the json representation
- instance_profile_gpu_memory_enum_model_dict = InstanceProfileGPUMemoryEnum.from_dict(instance_profile_gpu_memory_enum_model_json).__dict__
- instance_profile_gpu_memory_enum_model2 = InstanceProfileGPUMemoryEnum(**instance_profile_gpu_memory_enum_model_dict)
+ # Construct a model instance of NetworkACLIdentityByHref by calling from_dict on the json representation
+ network_acl_identity_by_href_model_dict = NetworkACLIdentityByHref.from_dict(network_acl_identity_by_href_model_json).__dict__
+ network_acl_identity_by_href_model2 = NetworkACLIdentityByHref(**network_acl_identity_by_href_model_dict)
# Verify the model instances are equivalent
- assert instance_profile_gpu_memory_enum_model == instance_profile_gpu_memory_enum_model2
+ assert network_acl_identity_by_href_model == network_acl_identity_by_href_model2
# Convert model instance back to dict and verify no loss of data
- instance_profile_gpu_memory_enum_model_json2 = instance_profile_gpu_memory_enum_model.to_dict()
- assert instance_profile_gpu_memory_enum_model_json2 == instance_profile_gpu_memory_enum_model_json
+ network_acl_identity_by_href_model_json2 = network_acl_identity_by_href_model.to_dict()
+ assert network_acl_identity_by_href_model_json2 == network_acl_identity_by_href_model_json
-class TestModel_InstanceProfileGPUMemoryFixed:
+class TestModel_NetworkACLIdentityById:
"""
- Test Class for InstanceProfileGPUMemoryFixed
+ Test Class for NetworkACLIdentityById
"""
- def test_instance_profile_gpu_memory_fixed_serialization(self):
+ def test_network_acl_identity_by_id_serialization(self):
"""
- Test serialization/deserialization for InstanceProfileGPUMemoryFixed
+ Test serialization/deserialization for NetworkACLIdentityById
"""
- # Construct a json representation of a InstanceProfileGPUMemoryFixed model
- instance_profile_gpu_memory_fixed_model_json = {}
- instance_profile_gpu_memory_fixed_model_json['type'] = 'fixed'
- instance_profile_gpu_memory_fixed_model_json['value'] = 16
+ # Construct a json representation of a NetworkACLIdentityById model
+ network_acl_identity_by_id_model_json = {}
+ network_acl_identity_by_id_model_json['id'] = 'a4e28308-8ee7-46ab-8108-9f881f22bdbf'
- # Construct a model instance of InstanceProfileGPUMemoryFixed by calling from_dict on the json representation
- instance_profile_gpu_memory_fixed_model = InstanceProfileGPUMemoryFixed.from_dict(instance_profile_gpu_memory_fixed_model_json)
- assert instance_profile_gpu_memory_fixed_model != False
+ # Construct a model instance of NetworkACLIdentityById by calling from_dict on the json representation
+ network_acl_identity_by_id_model = NetworkACLIdentityById.from_dict(network_acl_identity_by_id_model_json)
+ assert network_acl_identity_by_id_model != False
- # Construct a model instance of InstanceProfileGPUMemoryFixed by calling from_dict on the json representation
- instance_profile_gpu_memory_fixed_model_dict = InstanceProfileGPUMemoryFixed.from_dict(instance_profile_gpu_memory_fixed_model_json).__dict__
- instance_profile_gpu_memory_fixed_model2 = InstanceProfileGPUMemoryFixed(**instance_profile_gpu_memory_fixed_model_dict)
+ # Construct a model instance of NetworkACLIdentityById by calling from_dict on the json representation
+ network_acl_identity_by_id_model_dict = NetworkACLIdentityById.from_dict(network_acl_identity_by_id_model_json).__dict__
+ network_acl_identity_by_id_model2 = NetworkACLIdentityById(**network_acl_identity_by_id_model_dict)
# Verify the model instances are equivalent
- assert instance_profile_gpu_memory_fixed_model == instance_profile_gpu_memory_fixed_model2
+ assert network_acl_identity_by_id_model == network_acl_identity_by_id_model2
# Convert model instance back to dict and verify no loss of data
- instance_profile_gpu_memory_fixed_model_json2 = instance_profile_gpu_memory_fixed_model.to_dict()
- assert instance_profile_gpu_memory_fixed_model_json2 == instance_profile_gpu_memory_fixed_model_json
+ network_acl_identity_by_id_model_json2 = network_acl_identity_by_id_model.to_dict()
+ assert network_acl_identity_by_id_model_json2 == network_acl_identity_by_id_model_json
-class TestModel_InstanceProfileGPUMemoryRange:
+class TestModel_NetworkACLPrototypeNetworkACLByRules:
"""
- Test Class for InstanceProfileGPUMemoryRange
+ Test Class for NetworkACLPrototypeNetworkACLByRules
"""
- def test_instance_profile_gpu_memory_range_serialization(self):
+ def test_network_acl_prototype_network_acl_by_rules_serialization(self):
"""
- Test serialization/deserialization for InstanceProfileGPUMemoryRange
+ Test serialization/deserialization for NetworkACLPrototypeNetworkACLByRules
"""
- # Construct a json representation of a InstanceProfileGPUMemoryRange model
- instance_profile_gpu_memory_range_model_json = {}
- instance_profile_gpu_memory_range_model_json['default'] = 16
- instance_profile_gpu_memory_range_model_json['max'] = 32
- instance_profile_gpu_memory_range_model_json['min'] = 8
- instance_profile_gpu_memory_range_model_json['step'] = 8
- instance_profile_gpu_memory_range_model_json['type'] = 'range'
+ # Construct dict forms of any model objects needed in order to build this model.
- # Construct a model instance of InstanceProfileGPUMemoryRange by calling from_dict on the json representation
- instance_profile_gpu_memory_range_model = InstanceProfileGPUMemoryRange.from_dict(instance_profile_gpu_memory_range_model_json)
- assert instance_profile_gpu_memory_range_model != False
+ resource_group_identity_model = {} # ResourceGroupIdentityById
+ resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
- # Construct a model instance of InstanceProfileGPUMemoryRange by calling from_dict on the json representation
- instance_profile_gpu_memory_range_model_dict = InstanceProfileGPUMemoryRange.from_dict(instance_profile_gpu_memory_range_model_json).__dict__
- instance_profile_gpu_memory_range_model2 = InstanceProfileGPUMemoryRange(**instance_profile_gpu_memory_range_model_dict)
+ vpc_identity_model = {} # VPCIdentityById
+ vpc_identity_model['id'] = 'cf7cd5a-2f30-4336-a495-6addc820cd61'
+
+ network_acl_rule_prototype_network_acl_context_model = {} # NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype
+ network_acl_rule_prototype_network_acl_context_model['action'] = 'allow'
+ network_acl_rule_prototype_network_acl_context_model['destination'] = '192.168.3.2/32'
+ network_acl_rule_prototype_network_acl_context_model['direction'] = 'inbound'
+ 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['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 json representation of a NetworkACLPrototypeNetworkACLByRules model
+ network_acl_prototype_network_acl_by_rules_model_json = {}
+ network_acl_prototype_network_acl_by_rules_model_json['name'] = 'my-network-acl'
+ network_acl_prototype_network_acl_by_rules_model_json['resource_group'] = resource_group_identity_model
+ network_acl_prototype_network_acl_by_rules_model_json['vpc'] = vpc_identity_model
+ network_acl_prototype_network_acl_by_rules_model_json['rules'] = [network_acl_rule_prototype_network_acl_context_model]
+
+ # Construct a model instance of NetworkACLPrototypeNetworkACLByRules by calling from_dict on the json representation
+ network_acl_prototype_network_acl_by_rules_model = NetworkACLPrototypeNetworkACLByRules.from_dict(network_acl_prototype_network_acl_by_rules_model_json)
+ assert network_acl_prototype_network_acl_by_rules_model != False
+
+ # Construct a model instance of NetworkACLPrototypeNetworkACLByRules by calling from_dict on the json representation
+ network_acl_prototype_network_acl_by_rules_model_dict = NetworkACLPrototypeNetworkACLByRules.from_dict(network_acl_prototype_network_acl_by_rules_model_json).__dict__
+ network_acl_prototype_network_acl_by_rules_model2 = NetworkACLPrototypeNetworkACLByRules(**network_acl_prototype_network_acl_by_rules_model_dict)
# Verify the model instances are equivalent
- assert instance_profile_gpu_memory_range_model == instance_profile_gpu_memory_range_model2
+ assert network_acl_prototype_network_acl_by_rules_model == network_acl_prototype_network_acl_by_rules_model2
# Convert model instance back to dict and verify no loss of data
- instance_profile_gpu_memory_range_model_json2 = instance_profile_gpu_memory_range_model.to_dict()
- assert instance_profile_gpu_memory_range_model_json2 == instance_profile_gpu_memory_range_model_json
+ network_acl_prototype_network_acl_by_rules_model_json2 = network_acl_prototype_network_acl_by_rules_model.to_dict()
+ assert network_acl_prototype_network_acl_by_rules_model_json2 == network_acl_prototype_network_acl_by_rules_model_json
-class TestModel_InstanceProfileGPURange:
+class TestModel_NetworkACLPrototypeNetworkACLBySourceNetworkACL:
"""
- Test Class for InstanceProfileGPURange
+ Test Class for NetworkACLPrototypeNetworkACLBySourceNetworkACL
"""
- def test_instance_profile_gpu_range_serialization(self):
+ def test_network_acl_prototype_network_acl_by_source_network_acl_serialization(self):
"""
- Test serialization/deserialization for InstanceProfileGPURange
+ Test serialization/deserialization for NetworkACLPrototypeNetworkACLBySourceNetworkACL
"""
- # Construct a json representation of a InstanceProfileGPURange model
- instance_profile_gpu_range_model_json = {}
- instance_profile_gpu_range_model_json['default'] = 2
- instance_profile_gpu_range_model_json['max'] = 4
- instance_profile_gpu_range_model_json['min'] = 1
- instance_profile_gpu_range_model_json['step'] = 1
- instance_profile_gpu_range_model_json['type'] = 'range'
+ # Construct dict forms of any model objects needed in order to build this model.
- # Construct a model instance of InstanceProfileGPURange by calling from_dict on the json representation
- instance_profile_gpu_range_model = InstanceProfileGPURange.from_dict(instance_profile_gpu_range_model_json)
- assert instance_profile_gpu_range_model != False
+ resource_group_identity_model = {} # ResourceGroupIdentityById
+ resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
- # Construct a model instance of InstanceProfileGPURange by calling from_dict on the json representation
- instance_profile_gpu_range_model_dict = InstanceProfileGPURange.from_dict(instance_profile_gpu_range_model_json).__dict__
- instance_profile_gpu_range_model2 = InstanceProfileGPURange(**instance_profile_gpu_range_model_dict)
+ vpc_identity_model = {} # VPCIdentityById
+ vpc_identity_model['id'] = 'cf7cd5a-2f30-4336-a495-6addc820cd61'
+
+ network_acl_identity_model = {} # NetworkACLIdentityById
+ network_acl_identity_model['id'] = 'a4e28308-8ee7-46ab-8108-9f881f22bdbf'
+
+ # Construct a json representation of a NetworkACLPrototypeNetworkACLBySourceNetworkACL model
+ network_acl_prototype_network_acl_by_source_network_acl_model_json = {}
+ network_acl_prototype_network_acl_by_source_network_acl_model_json['name'] = 'my-network-acl'
+ network_acl_prototype_network_acl_by_source_network_acl_model_json['resource_group'] = resource_group_identity_model
+ network_acl_prototype_network_acl_by_source_network_acl_model_json['vpc'] = vpc_identity_model
+ network_acl_prototype_network_acl_by_source_network_acl_model_json['source_network_acl'] = network_acl_identity_model
+
+ # Construct a model instance of NetworkACLPrototypeNetworkACLBySourceNetworkACL by calling from_dict on the json representation
+ network_acl_prototype_network_acl_by_source_network_acl_model = NetworkACLPrototypeNetworkACLBySourceNetworkACL.from_dict(network_acl_prototype_network_acl_by_source_network_acl_model_json)
+ assert network_acl_prototype_network_acl_by_source_network_acl_model != False
+
+ # Construct a model instance of NetworkACLPrototypeNetworkACLBySourceNetworkACL by calling from_dict on the json representation
+ network_acl_prototype_network_acl_by_source_network_acl_model_dict = NetworkACLPrototypeNetworkACLBySourceNetworkACL.from_dict(network_acl_prototype_network_acl_by_source_network_acl_model_json).__dict__
+ network_acl_prototype_network_acl_by_source_network_acl_model2 = NetworkACLPrototypeNetworkACLBySourceNetworkACL(**network_acl_prototype_network_acl_by_source_network_acl_model_dict)
# Verify the model instances are equivalent
- assert instance_profile_gpu_range_model == instance_profile_gpu_range_model2
+ assert network_acl_prototype_network_acl_by_source_network_acl_model == network_acl_prototype_network_acl_by_source_network_acl_model2
# Convert model instance back to dict and verify no loss of data
- instance_profile_gpu_range_model_json2 = instance_profile_gpu_range_model.to_dict()
- assert instance_profile_gpu_range_model_json2 == instance_profile_gpu_range_model_json
+ network_acl_prototype_network_acl_by_source_network_acl_model_json2 = network_acl_prototype_network_acl_by_source_network_acl_model.to_dict()
+ assert network_acl_prototype_network_acl_by_source_network_acl_model_json2 == network_acl_prototype_network_acl_by_source_network_acl_model_json
-class TestModel_InstanceProfileIdentityByHref:
+class TestModel_NetworkACLRuleBeforePatchNetworkACLRuleIdentityByHref:
"""
- Test Class for InstanceProfileIdentityByHref
+ Test Class for NetworkACLRuleBeforePatchNetworkACLRuleIdentityByHref
"""
- def test_instance_profile_identity_by_href_serialization(self):
+ def test_network_acl_rule_before_patch_network_acl_rule_identity_by_href_serialization(self):
"""
- Test serialization/deserialization for InstanceProfileIdentityByHref
+ Test serialization/deserialization for NetworkACLRuleBeforePatchNetworkACLRuleIdentityByHref
"""
- # Construct a json representation of a InstanceProfileIdentityByHref model
- instance_profile_identity_by_href_model_json = {}
- instance_profile_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16'
+ # Construct a json representation of a NetworkACLRuleBeforePatchNetworkACLRuleIdentityByHref model
+ network_acl_rule_before_patch_network_acl_rule_identity_by_href_model_json = {}
+ network_acl_rule_before_patch_network_acl_rule_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9'
- # Construct a model instance of InstanceProfileIdentityByHref by calling from_dict on the json representation
- instance_profile_identity_by_href_model = InstanceProfileIdentityByHref.from_dict(instance_profile_identity_by_href_model_json)
- assert instance_profile_identity_by_href_model != False
+ # Construct a model instance of NetworkACLRuleBeforePatchNetworkACLRuleIdentityByHref by calling from_dict on the json representation
+ network_acl_rule_before_patch_network_acl_rule_identity_by_href_model = NetworkACLRuleBeforePatchNetworkACLRuleIdentityByHref.from_dict(network_acl_rule_before_patch_network_acl_rule_identity_by_href_model_json)
+ assert network_acl_rule_before_patch_network_acl_rule_identity_by_href_model != False
- # Construct a model instance of InstanceProfileIdentityByHref by calling from_dict on the json representation
- instance_profile_identity_by_href_model_dict = InstanceProfileIdentityByHref.from_dict(instance_profile_identity_by_href_model_json).__dict__
- instance_profile_identity_by_href_model2 = InstanceProfileIdentityByHref(**instance_profile_identity_by_href_model_dict)
+ # Construct a model instance of NetworkACLRuleBeforePatchNetworkACLRuleIdentityByHref by calling from_dict on the json representation
+ network_acl_rule_before_patch_network_acl_rule_identity_by_href_model_dict = NetworkACLRuleBeforePatchNetworkACLRuleIdentityByHref.from_dict(network_acl_rule_before_patch_network_acl_rule_identity_by_href_model_json).__dict__
+ network_acl_rule_before_patch_network_acl_rule_identity_by_href_model2 = NetworkACLRuleBeforePatchNetworkACLRuleIdentityByHref(**network_acl_rule_before_patch_network_acl_rule_identity_by_href_model_dict)
# Verify the model instances are equivalent
- assert instance_profile_identity_by_href_model == instance_profile_identity_by_href_model2
+ assert network_acl_rule_before_patch_network_acl_rule_identity_by_href_model == network_acl_rule_before_patch_network_acl_rule_identity_by_href_model2
# Convert model instance back to dict and verify no loss of data
- instance_profile_identity_by_href_model_json2 = instance_profile_identity_by_href_model.to_dict()
- assert instance_profile_identity_by_href_model_json2 == instance_profile_identity_by_href_model_json
+ network_acl_rule_before_patch_network_acl_rule_identity_by_href_model_json2 = network_acl_rule_before_patch_network_acl_rule_identity_by_href_model.to_dict()
+ assert network_acl_rule_before_patch_network_acl_rule_identity_by_href_model_json2 == network_acl_rule_before_patch_network_acl_rule_identity_by_href_model_json
-class TestModel_InstanceProfileIdentityByName:
+class TestModel_NetworkACLRuleBeforePatchNetworkACLRuleIdentityById:
"""
- Test Class for InstanceProfileIdentityByName
+ Test Class for NetworkACLRuleBeforePatchNetworkACLRuleIdentityById
"""
- def test_instance_profile_identity_by_name_serialization(self):
+ def test_network_acl_rule_before_patch_network_acl_rule_identity_by_id_serialization(self):
"""
- Test serialization/deserialization for InstanceProfileIdentityByName
+ Test serialization/deserialization for NetworkACLRuleBeforePatchNetworkACLRuleIdentityById
"""
- # Construct a json representation of a InstanceProfileIdentityByName model
- instance_profile_identity_by_name_model_json = {}
- instance_profile_identity_by_name_model_json['name'] = 'bx2-4x16'
+ # Construct a json representation of a NetworkACLRuleBeforePatchNetworkACLRuleIdentityById model
+ network_acl_rule_before_patch_network_acl_rule_identity_by_id_model_json = {}
+ network_acl_rule_before_patch_network_acl_rule_identity_by_id_model_json['id'] = '8daca77a-4980-4d33-8f3e-7038797be8f9'
- # Construct a model instance of InstanceProfileIdentityByName by calling from_dict on the json representation
- instance_profile_identity_by_name_model = InstanceProfileIdentityByName.from_dict(instance_profile_identity_by_name_model_json)
- assert instance_profile_identity_by_name_model != False
+ # Construct a model instance of NetworkACLRuleBeforePatchNetworkACLRuleIdentityById by calling from_dict on the json representation
+ network_acl_rule_before_patch_network_acl_rule_identity_by_id_model = NetworkACLRuleBeforePatchNetworkACLRuleIdentityById.from_dict(network_acl_rule_before_patch_network_acl_rule_identity_by_id_model_json)
+ assert network_acl_rule_before_patch_network_acl_rule_identity_by_id_model != False
- # Construct a model instance of InstanceProfileIdentityByName by calling from_dict on the json representation
- instance_profile_identity_by_name_model_dict = InstanceProfileIdentityByName.from_dict(instance_profile_identity_by_name_model_json).__dict__
- instance_profile_identity_by_name_model2 = InstanceProfileIdentityByName(**instance_profile_identity_by_name_model_dict)
+ # Construct a model instance of NetworkACLRuleBeforePatchNetworkACLRuleIdentityById by calling from_dict on the json representation
+ network_acl_rule_before_patch_network_acl_rule_identity_by_id_model_dict = NetworkACLRuleBeforePatchNetworkACLRuleIdentityById.from_dict(network_acl_rule_before_patch_network_acl_rule_identity_by_id_model_json).__dict__
+ network_acl_rule_before_patch_network_acl_rule_identity_by_id_model2 = NetworkACLRuleBeforePatchNetworkACLRuleIdentityById(**network_acl_rule_before_patch_network_acl_rule_identity_by_id_model_dict)
# Verify the model instances are equivalent
- assert instance_profile_identity_by_name_model == instance_profile_identity_by_name_model2
+ assert network_acl_rule_before_patch_network_acl_rule_identity_by_id_model == network_acl_rule_before_patch_network_acl_rule_identity_by_id_model2
# Convert model instance back to dict and verify no loss of data
- instance_profile_identity_by_name_model_json2 = instance_profile_identity_by_name_model.to_dict()
- assert instance_profile_identity_by_name_model_json2 == instance_profile_identity_by_name_model_json
+ network_acl_rule_before_patch_network_acl_rule_identity_by_id_model_json2 = network_acl_rule_before_patch_network_acl_rule_identity_by_id_model.to_dict()
+ assert network_acl_rule_before_patch_network_acl_rule_identity_by_id_model_json2 == network_acl_rule_before_patch_network_acl_rule_identity_by_id_model_json
-class TestModel_InstanceProfileMemoryDependent:
+class TestModel_NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByHref:
"""
- Test Class for InstanceProfileMemoryDependent
+ Test Class for NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByHref
"""
- def test_instance_profile_memory_dependent_serialization(self):
+ def test_network_acl_rule_before_prototype_network_acl_rule_identity_by_href_serialization(self):
"""
- Test serialization/deserialization for InstanceProfileMemoryDependent
+ Test serialization/deserialization for NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByHref
"""
- # Construct a json representation of a InstanceProfileMemoryDependent model
- instance_profile_memory_dependent_model_json = {}
- instance_profile_memory_dependent_model_json['type'] = 'dependent'
+ # Construct a json representation of a NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByHref model
+ network_acl_rule_before_prototype_network_acl_rule_identity_by_href_model_json = {}
+ network_acl_rule_before_prototype_network_acl_rule_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9'
- # Construct a model instance of InstanceProfileMemoryDependent by calling from_dict on the json representation
- instance_profile_memory_dependent_model = InstanceProfileMemoryDependent.from_dict(instance_profile_memory_dependent_model_json)
- assert instance_profile_memory_dependent_model != False
+ # Construct a model instance of NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByHref by calling from_dict on the json representation
+ network_acl_rule_before_prototype_network_acl_rule_identity_by_href_model = NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByHref.from_dict(network_acl_rule_before_prototype_network_acl_rule_identity_by_href_model_json)
+ assert network_acl_rule_before_prototype_network_acl_rule_identity_by_href_model != False
- # Construct a model instance of InstanceProfileMemoryDependent by calling from_dict on the json representation
- instance_profile_memory_dependent_model_dict = InstanceProfileMemoryDependent.from_dict(instance_profile_memory_dependent_model_json).__dict__
- instance_profile_memory_dependent_model2 = InstanceProfileMemoryDependent(**instance_profile_memory_dependent_model_dict)
+ # Construct a model instance of NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByHref by calling from_dict on the json representation
+ network_acl_rule_before_prototype_network_acl_rule_identity_by_href_model_dict = NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByHref.from_dict(network_acl_rule_before_prototype_network_acl_rule_identity_by_href_model_json).__dict__
+ network_acl_rule_before_prototype_network_acl_rule_identity_by_href_model2 = NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByHref(**network_acl_rule_before_prototype_network_acl_rule_identity_by_href_model_dict)
# Verify the model instances are equivalent
- assert instance_profile_memory_dependent_model == instance_profile_memory_dependent_model2
+ assert network_acl_rule_before_prototype_network_acl_rule_identity_by_href_model == network_acl_rule_before_prototype_network_acl_rule_identity_by_href_model2
# Convert model instance back to dict and verify no loss of data
- instance_profile_memory_dependent_model_json2 = instance_profile_memory_dependent_model.to_dict()
- assert instance_profile_memory_dependent_model_json2 == instance_profile_memory_dependent_model_json
+ network_acl_rule_before_prototype_network_acl_rule_identity_by_href_model_json2 = network_acl_rule_before_prototype_network_acl_rule_identity_by_href_model.to_dict()
+ assert network_acl_rule_before_prototype_network_acl_rule_identity_by_href_model_json2 == network_acl_rule_before_prototype_network_acl_rule_identity_by_href_model_json
-class TestModel_InstanceProfileMemoryEnum:
+class TestModel_NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityById:
"""
- Test Class for InstanceProfileMemoryEnum
+ Test Class for NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityById
"""
- def test_instance_profile_memory_enum_serialization(self):
+ def test_network_acl_rule_before_prototype_network_acl_rule_identity_by_id_serialization(self):
"""
- Test serialization/deserialization for InstanceProfileMemoryEnum
+ Test serialization/deserialization for NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityById
"""
- # Construct a json representation of a InstanceProfileMemoryEnum model
- instance_profile_memory_enum_model_json = {}
- instance_profile_memory_enum_model_json['default'] = 38
- instance_profile_memory_enum_model_json['type'] = 'enum'
- instance_profile_memory_enum_model_json['values'] = [8, 16, 32]
+ # Construct a json representation of a NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityById model
+ network_acl_rule_before_prototype_network_acl_rule_identity_by_id_model_json = {}
+ network_acl_rule_before_prototype_network_acl_rule_identity_by_id_model_json['id'] = '8daca77a-4980-4d33-8f3e-7038797be8f9'
- # Construct a model instance of InstanceProfileMemoryEnum by calling from_dict on the json representation
- instance_profile_memory_enum_model = InstanceProfileMemoryEnum.from_dict(instance_profile_memory_enum_model_json)
- assert instance_profile_memory_enum_model != False
+ # Construct a model instance of NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityById by calling from_dict on the json representation
+ network_acl_rule_before_prototype_network_acl_rule_identity_by_id_model = NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityById.from_dict(network_acl_rule_before_prototype_network_acl_rule_identity_by_id_model_json)
+ assert network_acl_rule_before_prototype_network_acl_rule_identity_by_id_model != False
- # Construct a model instance of InstanceProfileMemoryEnum by calling from_dict on the json representation
- instance_profile_memory_enum_model_dict = InstanceProfileMemoryEnum.from_dict(instance_profile_memory_enum_model_json).__dict__
- instance_profile_memory_enum_model2 = InstanceProfileMemoryEnum(**instance_profile_memory_enum_model_dict)
+ # Construct a model instance of NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityById by calling from_dict on the json representation
+ network_acl_rule_before_prototype_network_acl_rule_identity_by_id_model_dict = NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityById.from_dict(network_acl_rule_before_prototype_network_acl_rule_identity_by_id_model_json).__dict__
+ network_acl_rule_before_prototype_network_acl_rule_identity_by_id_model2 = NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityById(**network_acl_rule_before_prototype_network_acl_rule_identity_by_id_model_dict)
# Verify the model instances are equivalent
- assert instance_profile_memory_enum_model == instance_profile_memory_enum_model2
+ assert network_acl_rule_before_prototype_network_acl_rule_identity_by_id_model == network_acl_rule_before_prototype_network_acl_rule_identity_by_id_model2
# Convert model instance back to dict and verify no loss of data
- instance_profile_memory_enum_model_json2 = instance_profile_memory_enum_model.to_dict()
- assert instance_profile_memory_enum_model_json2 == instance_profile_memory_enum_model_json
+ network_acl_rule_before_prototype_network_acl_rule_identity_by_id_model_json2 = network_acl_rule_before_prototype_network_acl_rule_identity_by_id_model.to_dict()
+ assert network_acl_rule_before_prototype_network_acl_rule_identity_by_id_model_json2 == network_acl_rule_before_prototype_network_acl_rule_identity_by_id_model_json
-class TestModel_InstanceProfileMemoryFixed:
+class TestModel_NetworkACLRuleItemNetworkACLRuleProtocolAll:
"""
- Test Class for InstanceProfileMemoryFixed
+ Test Class for NetworkACLRuleItemNetworkACLRuleProtocolAll
"""
- def test_instance_profile_memory_fixed_serialization(self):
+ def test_network_acl_rule_item_network_acl_rule_protocol_all_serialization(self):
"""
- Test serialization/deserialization for InstanceProfileMemoryFixed
+ Test serialization/deserialization for NetworkACLRuleItemNetworkACLRuleProtocolAll
"""
- # Construct a json representation of a InstanceProfileMemoryFixed model
- instance_profile_memory_fixed_model_json = {}
- instance_profile_memory_fixed_model_json['type'] = 'fixed'
- instance_profile_memory_fixed_model_json['value'] = 16
+ # Construct dict forms of any model objects needed in order to build this model.
- # Construct a model instance of InstanceProfileMemoryFixed by calling from_dict on the json representation
- instance_profile_memory_fixed_model = InstanceProfileMemoryFixed.from_dict(instance_profile_memory_fixed_model_json)
- assert instance_profile_memory_fixed_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 InstanceProfileMemoryFixed by calling from_dict on the json representation
- instance_profile_memory_fixed_model_dict = InstanceProfileMemoryFixed.from_dict(instance_profile_memory_fixed_model_json).__dict__
- instance_profile_memory_fixed_model2 = InstanceProfileMemoryFixed(**instance_profile_memory_fixed_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'
+
+ # Construct a json representation of a NetworkACLRuleItemNetworkACLRuleProtocolAll model
+ network_acl_rule_item_network_acl_rule_protocol_all_model_json = {}
+ network_acl_rule_item_network_acl_rule_protocol_all_model_json['action'] = 'allow'
+ network_acl_rule_item_network_acl_rule_protocol_all_model_json['before'] = network_acl_rule_reference_model
+ network_acl_rule_item_network_acl_rule_protocol_all_model_json['created_at'] = '2019-01-01T12:00:00Z'
+ network_acl_rule_item_network_acl_rule_protocol_all_model_json['destination'] = '192.168.3.0/24'
+ network_acl_rule_item_network_acl_rule_protocol_all_model_json['direction'] = 'inbound'
+ network_acl_rule_item_network_acl_rule_protocol_all_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9'
+ network_acl_rule_item_network_acl_rule_protocol_all_model_json['id'] = '8daca77a-4980-4d33-8f3e-7038797be8f9'
+ network_acl_rule_item_network_acl_rule_protocol_all_model_json['ip_version'] = 'ipv4'
+ network_acl_rule_item_network_acl_rule_protocol_all_model_json['name'] = 'my-rule-1'
+ network_acl_rule_item_network_acl_rule_protocol_all_model_json['source'] = '192.168.3.0/24'
+ network_acl_rule_item_network_acl_rule_protocol_all_model_json['protocol'] = 'all'
+
+ # Construct a model instance of NetworkACLRuleItemNetworkACLRuleProtocolAll by calling from_dict on the json representation
+ network_acl_rule_item_network_acl_rule_protocol_all_model = NetworkACLRuleItemNetworkACLRuleProtocolAll.from_dict(network_acl_rule_item_network_acl_rule_protocol_all_model_json)
+ assert network_acl_rule_item_network_acl_rule_protocol_all_model != False
+
+ # Construct a model instance of NetworkACLRuleItemNetworkACLRuleProtocolAll by calling from_dict on the json representation
+ network_acl_rule_item_network_acl_rule_protocol_all_model_dict = NetworkACLRuleItemNetworkACLRuleProtocolAll.from_dict(network_acl_rule_item_network_acl_rule_protocol_all_model_json).__dict__
+ network_acl_rule_item_network_acl_rule_protocol_all_model2 = NetworkACLRuleItemNetworkACLRuleProtocolAll(**network_acl_rule_item_network_acl_rule_protocol_all_model_dict)
# Verify the model instances are equivalent
- assert instance_profile_memory_fixed_model == instance_profile_memory_fixed_model2
+ assert network_acl_rule_item_network_acl_rule_protocol_all_model == network_acl_rule_item_network_acl_rule_protocol_all_model2
# Convert model instance back to dict and verify no loss of data
- instance_profile_memory_fixed_model_json2 = instance_profile_memory_fixed_model.to_dict()
- assert instance_profile_memory_fixed_model_json2 == instance_profile_memory_fixed_model_json
+ network_acl_rule_item_network_acl_rule_protocol_all_model_json2 = network_acl_rule_item_network_acl_rule_protocol_all_model.to_dict()
+ assert network_acl_rule_item_network_acl_rule_protocol_all_model_json2 == network_acl_rule_item_network_acl_rule_protocol_all_model_json
-class TestModel_InstanceProfileMemoryRange:
+class TestModel_NetworkACLRuleItemNetworkACLRuleProtocolICMP:
"""
- Test Class for InstanceProfileMemoryRange
+ Test Class for NetworkACLRuleItemNetworkACLRuleProtocolICMP
"""
- def test_instance_profile_memory_range_serialization(self):
+ def test_network_acl_rule_item_network_acl_rule_protocol_icmp_serialization(self):
"""
- Test serialization/deserialization for InstanceProfileMemoryRange
+ Test serialization/deserialization for NetworkACLRuleItemNetworkACLRuleProtocolICMP
"""
- # Construct a json representation of a InstanceProfileMemoryRange model
- instance_profile_memory_range_model_json = {}
- instance_profile_memory_range_model_json['default'] = 16
- instance_profile_memory_range_model_json['max'] = 384
- instance_profile_memory_range_model_json['min'] = 8
- instance_profile_memory_range_model_json['step'] = 8
- instance_profile_memory_range_model_json['type'] = 'range'
+ # Construct dict forms of any model objects needed in order to build this model.
- # Construct a model instance of InstanceProfileMemoryRange by calling from_dict on the json representation
- instance_profile_memory_range_model = InstanceProfileMemoryRange.from_dict(instance_profile_memory_range_model_json)
- assert instance_profile_memory_range_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 InstanceProfileMemoryRange by calling from_dict on the json representation
- instance_profile_memory_range_model_dict = InstanceProfileMemoryRange.from_dict(instance_profile_memory_range_model_json).__dict__
- instance_profile_memory_range_model2 = InstanceProfileMemoryRange(**instance_profile_memory_range_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'
+
+ # Construct a json representation of a NetworkACLRuleItemNetworkACLRuleProtocolICMP model
+ network_acl_rule_item_network_acl_rule_protocol_icmp_model_json = {}
+ network_acl_rule_item_network_acl_rule_protocol_icmp_model_json['action'] = 'allow'
+ network_acl_rule_item_network_acl_rule_protocol_icmp_model_json['before'] = network_acl_rule_reference_model
+ network_acl_rule_item_network_acl_rule_protocol_icmp_model_json['created_at'] = '2019-01-01T12:00:00Z'
+ network_acl_rule_item_network_acl_rule_protocol_icmp_model_json['destination'] = '192.168.3.0/24'
+ network_acl_rule_item_network_acl_rule_protocol_icmp_model_json['direction'] = 'inbound'
+ network_acl_rule_item_network_acl_rule_protocol_icmp_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9'
+ network_acl_rule_item_network_acl_rule_protocol_icmp_model_json['id'] = '8daca77a-4980-4d33-8f3e-7038797be8f9'
+ network_acl_rule_item_network_acl_rule_protocol_icmp_model_json['ip_version'] = 'ipv4'
+ network_acl_rule_item_network_acl_rule_protocol_icmp_model_json['name'] = 'my-rule-1'
+ network_acl_rule_item_network_acl_rule_protocol_icmp_model_json['source'] = '192.168.3.0/24'
+ network_acl_rule_item_network_acl_rule_protocol_icmp_model_json['code'] = 0
+ network_acl_rule_item_network_acl_rule_protocol_icmp_model_json['protocol'] = 'icmp'
+ network_acl_rule_item_network_acl_rule_protocol_icmp_model_json['type'] = 8
+
+ # Construct a model instance of NetworkACLRuleItemNetworkACLRuleProtocolICMP by calling from_dict on the json representation
+ network_acl_rule_item_network_acl_rule_protocol_icmp_model = NetworkACLRuleItemNetworkACLRuleProtocolICMP.from_dict(network_acl_rule_item_network_acl_rule_protocol_icmp_model_json)
+ assert network_acl_rule_item_network_acl_rule_protocol_icmp_model != False
+
+ # Construct a model instance of NetworkACLRuleItemNetworkACLRuleProtocolICMP by calling from_dict on the json representation
+ network_acl_rule_item_network_acl_rule_protocol_icmp_model_dict = NetworkACLRuleItemNetworkACLRuleProtocolICMP.from_dict(network_acl_rule_item_network_acl_rule_protocol_icmp_model_json).__dict__
+ network_acl_rule_item_network_acl_rule_protocol_icmp_model2 = NetworkACLRuleItemNetworkACLRuleProtocolICMP(**network_acl_rule_item_network_acl_rule_protocol_icmp_model_dict)
# Verify the model instances are equivalent
- assert instance_profile_memory_range_model == instance_profile_memory_range_model2
+ assert network_acl_rule_item_network_acl_rule_protocol_icmp_model == network_acl_rule_item_network_acl_rule_protocol_icmp_model2
# Convert model instance back to dict and verify no loss of data
- instance_profile_memory_range_model_json2 = instance_profile_memory_range_model.to_dict()
- assert instance_profile_memory_range_model_json2 == instance_profile_memory_range_model_json
+ network_acl_rule_item_network_acl_rule_protocol_icmp_model_json2 = network_acl_rule_item_network_acl_rule_protocol_icmp_model.to_dict()
+ assert network_acl_rule_item_network_acl_rule_protocol_icmp_model_json2 == network_acl_rule_item_network_acl_rule_protocol_icmp_model_json
-class TestModel_InstanceProfileNUMACountDependent:
+class TestModel_NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP:
"""
- Test Class for InstanceProfileNUMACountDependent
+ Test Class for NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP
"""
- def test_instance_profile_numa_count_dependent_serialization(self):
+ def test_network_acl_rule_item_network_acl_rule_protocol_tcpudp_serialization(self):
"""
- Test serialization/deserialization for InstanceProfileNUMACountDependent
+ Test serialization/deserialization for NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP
"""
- # Construct a json representation of a InstanceProfileNUMACountDependent model
- instance_profile_numa_count_dependent_model_json = {}
- instance_profile_numa_count_dependent_model_json['type'] = 'dependent'
-
- # Construct a model instance of InstanceProfileNUMACountDependent by calling from_dict on the json representation
- instance_profile_numa_count_dependent_model = InstanceProfileNUMACountDependent.from_dict(instance_profile_numa_count_dependent_model_json)
- assert instance_profile_numa_count_dependent_model != False
-
- # Construct a model instance of InstanceProfileNUMACountDependent by calling from_dict on the json representation
- instance_profile_numa_count_dependent_model_dict = InstanceProfileNUMACountDependent.from_dict(instance_profile_numa_count_dependent_model_json).__dict__
- instance_profile_numa_count_dependent_model2 = InstanceProfileNUMACountDependent(**instance_profile_numa_count_dependent_model_dict)
-
- # Verify the model instances are equivalent
- assert instance_profile_numa_count_dependent_model == instance_profile_numa_count_dependent_model2
-
- # Convert model instance back to dict and verify no loss of data
- instance_profile_numa_count_dependent_model_json2 = instance_profile_numa_count_dependent_model.to_dict()
- assert instance_profile_numa_count_dependent_model_json2 == instance_profile_numa_count_dependent_model_json
-
+ # Construct dict forms of any model objects needed in order to build this model.
-class TestModel_InstanceProfileNUMACountFixed:
- """
- Test Class for InstanceProfileNUMACountFixed
- """
+ network_acl_rule_reference_deleted_model = {} # NetworkACLRuleReferenceDeleted
+ network_acl_rule_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- def test_instance_profile_numa_count_fixed_serialization(self):
- """
- Test serialization/deserialization for InstanceProfileNUMACountFixed
- """
+ 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 json representation of a InstanceProfileNUMACountFixed model
- instance_profile_numa_count_fixed_model_json = {}
- instance_profile_numa_count_fixed_model_json['type'] = 'fixed'
- instance_profile_numa_count_fixed_model_json['value'] = 2
+ # Construct a json representation of a NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP model
+ network_acl_rule_item_network_acl_rule_protocol_tcpudp_model_json = {}
+ network_acl_rule_item_network_acl_rule_protocol_tcpudp_model_json['action'] = 'allow'
+ network_acl_rule_item_network_acl_rule_protocol_tcpudp_model_json['before'] = network_acl_rule_reference_model
+ network_acl_rule_item_network_acl_rule_protocol_tcpudp_model_json['created_at'] = '2019-01-01T12:00:00Z'
+ network_acl_rule_item_network_acl_rule_protocol_tcpudp_model_json['destination'] = '192.168.3.0/24'
+ network_acl_rule_item_network_acl_rule_protocol_tcpudp_model_json['direction'] = 'inbound'
+ network_acl_rule_item_network_acl_rule_protocol_tcpudp_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9'
+ network_acl_rule_item_network_acl_rule_protocol_tcpudp_model_json['id'] = '8daca77a-4980-4d33-8f3e-7038797be8f9'
+ network_acl_rule_item_network_acl_rule_protocol_tcpudp_model_json['ip_version'] = 'ipv4'
+ network_acl_rule_item_network_acl_rule_protocol_tcpudp_model_json['name'] = 'my-rule-1'
+ network_acl_rule_item_network_acl_rule_protocol_tcpudp_model_json['source'] = '192.168.3.0/24'
+ network_acl_rule_item_network_acl_rule_protocol_tcpudp_model_json['destination_port_max'] = 22
+ network_acl_rule_item_network_acl_rule_protocol_tcpudp_model_json['destination_port_min'] = 22
+ network_acl_rule_item_network_acl_rule_protocol_tcpudp_model_json['protocol'] = 'udp'
+ network_acl_rule_item_network_acl_rule_protocol_tcpudp_model_json['source_port_max'] = 65535
+ network_acl_rule_item_network_acl_rule_protocol_tcpudp_model_json['source_port_min'] = 49152
- # Construct a model instance of InstanceProfileNUMACountFixed by calling from_dict on the json representation
- instance_profile_numa_count_fixed_model = InstanceProfileNUMACountFixed.from_dict(instance_profile_numa_count_fixed_model_json)
- assert instance_profile_numa_count_fixed_model != False
+ # Construct a model instance of NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP by calling from_dict on the json representation
+ network_acl_rule_item_network_acl_rule_protocol_tcpudp_model = NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP.from_dict(network_acl_rule_item_network_acl_rule_protocol_tcpudp_model_json)
+ assert network_acl_rule_item_network_acl_rule_protocol_tcpudp_model != False
- # Construct a model instance of InstanceProfileNUMACountFixed by calling from_dict on the json representation
- instance_profile_numa_count_fixed_model_dict = InstanceProfileNUMACountFixed.from_dict(instance_profile_numa_count_fixed_model_json).__dict__
- instance_profile_numa_count_fixed_model2 = InstanceProfileNUMACountFixed(**instance_profile_numa_count_fixed_model_dict)
+ # Construct a model instance of NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP by calling from_dict on the json representation
+ network_acl_rule_item_network_acl_rule_protocol_tcpudp_model_dict = NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP.from_dict(network_acl_rule_item_network_acl_rule_protocol_tcpudp_model_json).__dict__
+ network_acl_rule_item_network_acl_rule_protocol_tcpudp_model2 = NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP(**network_acl_rule_item_network_acl_rule_protocol_tcpudp_model_dict)
# Verify the model instances are equivalent
- assert instance_profile_numa_count_fixed_model == instance_profile_numa_count_fixed_model2
+ assert network_acl_rule_item_network_acl_rule_protocol_tcpudp_model == network_acl_rule_item_network_acl_rule_protocol_tcpudp_model2
# Convert model instance back to dict and verify no loss of data
- instance_profile_numa_count_fixed_model_json2 = instance_profile_numa_count_fixed_model.to_dict()
- assert instance_profile_numa_count_fixed_model_json2 == instance_profile_numa_count_fixed_model_json
+ network_acl_rule_item_network_acl_rule_protocol_tcpudp_model_json2 = network_acl_rule_item_network_acl_rule_protocol_tcpudp_model.to_dict()
+ assert network_acl_rule_item_network_acl_rule_protocol_tcpudp_model_json2 == network_acl_rule_item_network_acl_rule_protocol_tcpudp_model_json
-class TestModel_InstanceProfileNetworkInterfaceCountDependent:
+class TestModel_NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype:
"""
- Test Class for InstanceProfileNetworkInterfaceCountDependent
+ Test Class for NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype
"""
- def test_instance_profile_network_interface_count_dependent_serialization(self):
+ def test_network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_all_prototype_serialization(self):
"""
- Test serialization/deserialization for InstanceProfileNetworkInterfaceCountDependent
+ Test serialization/deserialization for NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype
"""
- # Construct a json representation of a InstanceProfileNetworkInterfaceCountDependent model
- instance_profile_network_interface_count_dependent_model_json = {}
- instance_profile_network_interface_count_dependent_model_json['type'] = 'dependent'
+ # Construct a json representation of a NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype model
+ network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_all_prototype_model_json = {}
+ network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_all_prototype_model_json['action'] = 'allow'
+ network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_all_prototype_model_json['destination'] = '192.168.3.2/32'
+ network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_all_prototype_model_json['direction'] = 'inbound'
+ network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_all_prototype_model_json['ip_version'] = 'ipv4'
+ network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_all_prototype_model_json['name'] = 'my-rule-2'
+ network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_all_prototype_model_json['source'] = '192.168.3.2/32'
+ network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_all_prototype_model_json['protocol'] = 'all'
- # Construct a model instance of InstanceProfileNetworkInterfaceCountDependent by calling from_dict on the json representation
- instance_profile_network_interface_count_dependent_model = InstanceProfileNetworkInterfaceCountDependent.from_dict(instance_profile_network_interface_count_dependent_model_json)
- assert instance_profile_network_interface_count_dependent_model != False
+ # Construct a model instance of NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype by calling from_dict on the json representation
+ network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_all_prototype_model = NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype.from_dict(network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_all_prototype_model_json)
+ assert network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_all_prototype_model != False
- # Construct a model instance of InstanceProfileNetworkInterfaceCountDependent by calling from_dict on the json representation
- instance_profile_network_interface_count_dependent_model_dict = InstanceProfileNetworkInterfaceCountDependent.from_dict(instance_profile_network_interface_count_dependent_model_json).__dict__
- instance_profile_network_interface_count_dependent_model2 = InstanceProfileNetworkInterfaceCountDependent(**instance_profile_network_interface_count_dependent_model_dict)
+ # Construct a model instance of NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype by calling from_dict on the json representation
+ network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_all_prototype_model_dict = NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype.from_dict(network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_all_prototype_model_json).__dict__
+ network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_all_prototype_model2 = NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype(**network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_all_prototype_model_dict)
# Verify the model instances are equivalent
- assert instance_profile_network_interface_count_dependent_model == instance_profile_network_interface_count_dependent_model2
+ assert network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_all_prototype_model == network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_all_prototype_model2
# Convert model instance back to dict and verify no loss of data
- instance_profile_network_interface_count_dependent_model_json2 = instance_profile_network_interface_count_dependent_model.to_dict()
- assert instance_profile_network_interface_count_dependent_model_json2 == instance_profile_network_interface_count_dependent_model_json
+ network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_all_prototype_model_json2 = network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_all_prototype_model.to_dict()
+ assert network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_all_prototype_model_json2 == network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_all_prototype_model_json
-class TestModel_InstanceProfileNetworkInterfaceCountRange:
+class TestModel_NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype:
"""
- Test Class for InstanceProfileNetworkInterfaceCountRange
+ Test Class for NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype
"""
- def test_instance_profile_network_interface_count_range_serialization(self):
+ def test_network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_icmp_prototype_serialization(self):
"""
- Test serialization/deserialization for InstanceProfileNetworkInterfaceCountRange
+ Test serialization/deserialization for NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype
"""
- # Construct a json representation of a InstanceProfileNetworkInterfaceCountRange model
- instance_profile_network_interface_count_range_model_json = {}
- instance_profile_network_interface_count_range_model_json['max'] = 5
- instance_profile_network_interface_count_range_model_json['min'] = 1
- instance_profile_network_interface_count_range_model_json['type'] = 'range'
+ # Construct a json representation of a NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype model
+ network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_icmp_prototype_model_json = {}
+ network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_icmp_prototype_model_json['action'] = 'allow'
+ network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_icmp_prototype_model_json['destination'] = '192.168.3.2/32'
+ network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_icmp_prototype_model_json['direction'] = 'inbound'
+ network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_icmp_prototype_model_json['ip_version'] = 'ipv4'
+ network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_icmp_prototype_model_json['name'] = 'my-rule-2'
+ network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_icmp_prototype_model_json['source'] = '192.168.3.2/32'
+ network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_icmp_prototype_model_json['code'] = 0
+ network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_icmp_prototype_model_json['protocol'] = 'icmp'
+ network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_icmp_prototype_model_json['type'] = 8
- # Construct a model instance of InstanceProfileNetworkInterfaceCountRange by calling from_dict on the json representation
- instance_profile_network_interface_count_range_model = InstanceProfileNetworkInterfaceCountRange.from_dict(instance_profile_network_interface_count_range_model_json)
- assert instance_profile_network_interface_count_range_model != False
+ # Construct a model instance of NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype by calling from_dict on the json representation
+ network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_icmp_prototype_model = NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype.from_dict(network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_icmp_prototype_model_json)
+ assert network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_icmp_prototype_model != False
- # Construct a model instance of InstanceProfileNetworkInterfaceCountRange by calling from_dict on the json representation
- instance_profile_network_interface_count_range_model_dict = InstanceProfileNetworkInterfaceCountRange.from_dict(instance_profile_network_interface_count_range_model_json).__dict__
- instance_profile_network_interface_count_range_model2 = InstanceProfileNetworkInterfaceCountRange(**instance_profile_network_interface_count_range_model_dict)
+ # Construct a model instance of NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype by calling from_dict on the json representation
+ network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_icmp_prototype_model_dict = NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype.from_dict(network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_icmp_prototype_model_json).__dict__
+ network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_icmp_prototype_model2 = NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype(**network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_icmp_prototype_model_dict)
# Verify the model instances are equivalent
- assert instance_profile_network_interface_count_range_model == instance_profile_network_interface_count_range_model2
+ assert network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_icmp_prototype_model == network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_icmp_prototype_model2
# Convert model instance back to dict and verify no loss of data
- instance_profile_network_interface_count_range_model_json2 = instance_profile_network_interface_count_range_model.to_dict()
- assert instance_profile_network_interface_count_range_model_json2 == instance_profile_network_interface_count_range_model_json
+ network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_icmp_prototype_model_json2 = network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_icmp_prototype_model.to_dict()
+ assert network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_icmp_prototype_model_json2 == network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_icmp_prototype_model_json
-class TestModel_InstanceProfilePortSpeedDependent:
+class TestModel_NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype:
"""
- Test Class for InstanceProfilePortSpeedDependent
+ Test Class for NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype
"""
- def test_instance_profile_port_speed_dependent_serialization(self):
+ def test_network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_tcpudp_prototype_serialization(self):
"""
- Test serialization/deserialization for InstanceProfilePortSpeedDependent
+ Test serialization/deserialization for NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype
"""
- # Construct a json representation of a InstanceProfilePortSpeedDependent model
- instance_profile_port_speed_dependent_model_json = {}
- instance_profile_port_speed_dependent_model_json['type'] = 'dependent'
+ # Construct a json representation of a NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype model
+ network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_tcpudp_prototype_model_json = {}
+ network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_tcpudp_prototype_model_json['action'] = 'allow'
+ network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_tcpudp_prototype_model_json['destination'] = '192.168.3.2/32'
+ network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_tcpudp_prototype_model_json['direction'] = 'inbound'
+ network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_tcpudp_prototype_model_json['ip_version'] = 'ipv4'
+ network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_tcpudp_prototype_model_json['name'] = 'my-rule-2'
+ network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_tcpudp_prototype_model_json['source'] = '192.168.3.2/32'
+ network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_tcpudp_prototype_model_json['destination_port_max'] = 22
+ network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_tcpudp_prototype_model_json['destination_port_min'] = 22
+ network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_tcpudp_prototype_model_json['protocol'] = 'udp'
+ network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_tcpudp_prototype_model_json['source_port_max'] = 65535
+ network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_tcpudp_prototype_model_json['source_port_min'] = 49152
- # Construct a model instance of InstanceProfilePortSpeedDependent by calling from_dict on the json representation
- instance_profile_port_speed_dependent_model = InstanceProfilePortSpeedDependent.from_dict(instance_profile_port_speed_dependent_model_json)
- assert instance_profile_port_speed_dependent_model != False
+ # Construct a model instance of NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype by calling from_dict on the json representation
+ network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_tcpudp_prototype_model = NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype.from_dict(network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_tcpudp_prototype_model_json)
+ assert network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_tcpudp_prototype_model != False
- # Construct a model instance of InstanceProfilePortSpeedDependent by calling from_dict on the json representation
- instance_profile_port_speed_dependent_model_dict = InstanceProfilePortSpeedDependent.from_dict(instance_profile_port_speed_dependent_model_json).__dict__
- instance_profile_port_speed_dependent_model2 = InstanceProfilePortSpeedDependent(**instance_profile_port_speed_dependent_model_dict)
+ # Construct a model instance of NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype by calling from_dict on the json representation
+ network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_tcpudp_prototype_model_dict = NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype.from_dict(network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_tcpudp_prototype_model_json).__dict__
+ network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_tcpudp_prototype_model2 = NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype(**network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_tcpudp_prototype_model_dict)
# Verify the model instances are equivalent
- assert instance_profile_port_speed_dependent_model == instance_profile_port_speed_dependent_model2
+ assert network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_tcpudp_prototype_model == network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_tcpudp_prototype_model2
# Convert model instance back to dict and verify no loss of data
- instance_profile_port_speed_dependent_model_json2 = instance_profile_port_speed_dependent_model.to_dict()
- assert instance_profile_port_speed_dependent_model_json2 == instance_profile_port_speed_dependent_model_json
+ network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_tcpudp_prototype_model_json2 = network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_tcpudp_prototype_model.to_dict()
+ assert network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_tcpudp_prototype_model_json2 == network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_tcpudp_prototype_model_json
-class TestModel_InstanceProfilePortSpeedFixed:
+class TestModel_NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype:
"""
- Test Class for InstanceProfilePortSpeedFixed
+ Test Class for NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype
"""
- def test_instance_profile_port_speed_fixed_serialization(self):
+ def test_network_acl_rule_prototype_network_acl_rule_protocol_all_prototype_serialization(self):
"""
- Test serialization/deserialization for InstanceProfilePortSpeedFixed
+ Test serialization/deserialization for NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype
"""
- # Construct a json representation of a InstanceProfilePortSpeedFixed model
- instance_profile_port_speed_fixed_model_json = {}
- instance_profile_port_speed_fixed_model_json['type'] = 'fixed'
- instance_profile_port_speed_fixed_model_json['value'] = 1000
+ # Construct dict forms of any model objects needed in order to build this model.
- # Construct a model instance of InstanceProfilePortSpeedFixed by calling from_dict on the json representation
- instance_profile_port_speed_fixed_model = InstanceProfilePortSpeedFixed.from_dict(instance_profile_port_speed_fixed_model_json)
- assert instance_profile_port_speed_fixed_model != False
+ network_acl_rule_before_prototype_model = {} # NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityById
+ network_acl_rule_before_prototype_model['id'] = '8daca77a-4980-4d33-8f3e-7038797be8f9'
- # Construct a model instance of InstanceProfilePortSpeedFixed by calling from_dict on the json representation
- instance_profile_port_speed_fixed_model_dict = InstanceProfilePortSpeedFixed.from_dict(instance_profile_port_speed_fixed_model_json).__dict__
- instance_profile_port_speed_fixed_model2 = InstanceProfilePortSpeedFixed(**instance_profile_port_speed_fixed_model_dict)
+ # Construct a json representation of a NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype model
+ network_acl_rule_prototype_network_acl_rule_protocol_all_prototype_model_json = {}
+ network_acl_rule_prototype_network_acl_rule_protocol_all_prototype_model_json['action'] = 'allow'
+ network_acl_rule_prototype_network_acl_rule_protocol_all_prototype_model_json['before'] = network_acl_rule_before_prototype_model
+ network_acl_rule_prototype_network_acl_rule_protocol_all_prototype_model_json['destination'] = '192.168.3.2/32'
+ network_acl_rule_prototype_network_acl_rule_protocol_all_prototype_model_json['direction'] = 'inbound'
+ network_acl_rule_prototype_network_acl_rule_protocol_all_prototype_model_json['ip_version'] = 'ipv4'
+ network_acl_rule_prototype_network_acl_rule_protocol_all_prototype_model_json['name'] = 'my-rule-2'
+ network_acl_rule_prototype_network_acl_rule_protocol_all_prototype_model_json['source'] = '192.168.3.2/32'
+ network_acl_rule_prototype_network_acl_rule_protocol_all_prototype_model_json['protocol'] = 'all'
+
+ # Construct a model instance of NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype by calling from_dict on the json representation
+ network_acl_rule_prototype_network_acl_rule_protocol_all_prototype_model = NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype.from_dict(network_acl_rule_prototype_network_acl_rule_protocol_all_prototype_model_json)
+ assert network_acl_rule_prototype_network_acl_rule_protocol_all_prototype_model != False
+
+ # Construct a model instance of NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype by calling from_dict on the json representation
+ network_acl_rule_prototype_network_acl_rule_protocol_all_prototype_model_dict = NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype.from_dict(network_acl_rule_prototype_network_acl_rule_protocol_all_prototype_model_json).__dict__
+ network_acl_rule_prototype_network_acl_rule_protocol_all_prototype_model2 = NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype(**network_acl_rule_prototype_network_acl_rule_protocol_all_prototype_model_dict)
# Verify the model instances are equivalent
- assert instance_profile_port_speed_fixed_model == instance_profile_port_speed_fixed_model2
+ assert network_acl_rule_prototype_network_acl_rule_protocol_all_prototype_model == network_acl_rule_prototype_network_acl_rule_protocol_all_prototype_model2
# Convert model instance back to dict and verify no loss of data
- instance_profile_port_speed_fixed_model_json2 = instance_profile_port_speed_fixed_model.to_dict()
- assert instance_profile_port_speed_fixed_model_json2 == instance_profile_port_speed_fixed_model_json
+ network_acl_rule_prototype_network_acl_rule_protocol_all_prototype_model_json2 = network_acl_rule_prototype_network_acl_rule_protocol_all_prototype_model.to_dict()
+ assert network_acl_rule_prototype_network_acl_rule_protocol_all_prototype_model_json2 == network_acl_rule_prototype_network_acl_rule_protocol_all_prototype_model_json
-class TestModel_InstanceProfileVCPUDependent:
+class TestModel_NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype:
"""
- Test Class for InstanceProfileVCPUDependent
+ Test Class for NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype
"""
- def test_instance_profile_vcpu_dependent_serialization(self):
+ def test_network_acl_rule_prototype_network_acl_rule_protocol_icmp_prototype_serialization(self):
"""
- Test serialization/deserialization for InstanceProfileVCPUDependent
+ Test serialization/deserialization for NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype
"""
- # Construct a json representation of a InstanceProfileVCPUDependent model
- instance_profile_vcpu_dependent_model_json = {}
- instance_profile_vcpu_dependent_model_json['type'] = 'dependent'
+ # Construct dict forms of any model objects needed in order to build this model.
- # Construct a model instance of InstanceProfileVCPUDependent by calling from_dict on the json representation
- instance_profile_vcpu_dependent_model = InstanceProfileVCPUDependent.from_dict(instance_profile_vcpu_dependent_model_json)
- assert instance_profile_vcpu_dependent_model != False
+ network_acl_rule_before_prototype_model = {} # NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityById
+ network_acl_rule_before_prototype_model['id'] = '8daca77a-4980-4d33-8f3e-7038797be8f9'
- # Construct a model instance of InstanceProfileVCPUDependent by calling from_dict on the json representation
- instance_profile_vcpu_dependent_model_dict = InstanceProfileVCPUDependent.from_dict(instance_profile_vcpu_dependent_model_json).__dict__
- instance_profile_vcpu_dependent_model2 = InstanceProfileVCPUDependent(**instance_profile_vcpu_dependent_model_dict)
+ # Construct a json representation of a NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype model
+ network_acl_rule_prototype_network_acl_rule_protocol_icmp_prototype_model_json = {}
+ network_acl_rule_prototype_network_acl_rule_protocol_icmp_prototype_model_json['action'] = 'allow'
+ network_acl_rule_prototype_network_acl_rule_protocol_icmp_prototype_model_json['before'] = network_acl_rule_before_prototype_model
+ network_acl_rule_prototype_network_acl_rule_protocol_icmp_prototype_model_json['destination'] = '192.168.3.2/32'
+ network_acl_rule_prototype_network_acl_rule_protocol_icmp_prototype_model_json['direction'] = 'inbound'
+ network_acl_rule_prototype_network_acl_rule_protocol_icmp_prototype_model_json['ip_version'] = 'ipv4'
+ network_acl_rule_prototype_network_acl_rule_protocol_icmp_prototype_model_json['name'] = 'my-rule-2'
+ network_acl_rule_prototype_network_acl_rule_protocol_icmp_prototype_model_json['source'] = '192.168.3.2/32'
+ network_acl_rule_prototype_network_acl_rule_protocol_icmp_prototype_model_json['code'] = 0
+ network_acl_rule_prototype_network_acl_rule_protocol_icmp_prototype_model_json['protocol'] = 'icmp'
+ network_acl_rule_prototype_network_acl_rule_protocol_icmp_prototype_model_json['type'] = 8
+
+ # Construct a model instance of NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype by calling from_dict on the json representation
+ network_acl_rule_prototype_network_acl_rule_protocol_icmp_prototype_model = NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype.from_dict(network_acl_rule_prototype_network_acl_rule_protocol_icmp_prototype_model_json)
+ assert network_acl_rule_prototype_network_acl_rule_protocol_icmp_prototype_model != False
+
+ # Construct a model instance of NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype by calling from_dict on the json representation
+ network_acl_rule_prototype_network_acl_rule_protocol_icmp_prototype_model_dict = NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype.from_dict(network_acl_rule_prototype_network_acl_rule_protocol_icmp_prototype_model_json).__dict__
+ network_acl_rule_prototype_network_acl_rule_protocol_icmp_prototype_model2 = NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype(**network_acl_rule_prototype_network_acl_rule_protocol_icmp_prototype_model_dict)
# Verify the model instances are equivalent
- assert instance_profile_vcpu_dependent_model == instance_profile_vcpu_dependent_model2
+ assert network_acl_rule_prototype_network_acl_rule_protocol_icmp_prototype_model == network_acl_rule_prototype_network_acl_rule_protocol_icmp_prototype_model2
# Convert model instance back to dict and verify no loss of data
- instance_profile_vcpu_dependent_model_json2 = instance_profile_vcpu_dependent_model.to_dict()
- assert instance_profile_vcpu_dependent_model_json2 == instance_profile_vcpu_dependent_model_json
+ network_acl_rule_prototype_network_acl_rule_protocol_icmp_prototype_model_json2 = network_acl_rule_prototype_network_acl_rule_protocol_icmp_prototype_model.to_dict()
+ assert network_acl_rule_prototype_network_acl_rule_protocol_icmp_prototype_model_json2 == network_acl_rule_prototype_network_acl_rule_protocol_icmp_prototype_model_json
-class TestModel_InstanceProfileVCPUEnum:
+class TestModel_NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype:
"""
- Test Class for InstanceProfileVCPUEnum
+ Test Class for NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype
"""
- def test_instance_profile_vcpu_enum_serialization(self):
+ def test_network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_prototype_serialization(self):
"""
- Test serialization/deserialization for InstanceProfileVCPUEnum
+ Test serialization/deserialization for NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype
"""
- # Construct a json representation of a InstanceProfileVCPUEnum model
- instance_profile_vcpu_enum_model_json = {}
- instance_profile_vcpu_enum_model_json['default'] = 38
- instance_profile_vcpu_enum_model_json['type'] = 'enum'
- instance_profile_vcpu_enum_model_json['values'] = [2, 4, 16]
+ # Construct dict forms of any model objects needed in order to build this model.
- # Construct a model instance of InstanceProfileVCPUEnum by calling from_dict on the json representation
- instance_profile_vcpu_enum_model = InstanceProfileVCPUEnum.from_dict(instance_profile_vcpu_enum_model_json)
- assert instance_profile_vcpu_enum_model != False
+ network_acl_rule_before_prototype_model = {} # NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityById
+ network_acl_rule_before_prototype_model['id'] = '8daca77a-4980-4d33-8f3e-7038797be8f9'
- # Construct a model instance of InstanceProfileVCPUEnum by calling from_dict on the json representation
- instance_profile_vcpu_enum_model_dict = InstanceProfileVCPUEnum.from_dict(instance_profile_vcpu_enum_model_json).__dict__
- instance_profile_vcpu_enum_model2 = InstanceProfileVCPUEnum(**instance_profile_vcpu_enum_model_dict)
+ # Construct a json representation of a NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype model
+ network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_prototype_model_json = {}
+ network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_prototype_model_json['action'] = 'allow'
+ network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_prototype_model_json['before'] = network_acl_rule_before_prototype_model
+ network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_prototype_model_json['destination'] = '192.168.3.2/32'
+ network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_prototype_model_json['direction'] = 'inbound'
+ network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_prototype_model_json['ip_version'] = 'ipv4'
+ network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_prototype_model_json['name'] = 'my-rule-2'
+ network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_prototype_model_json['source'] = '192.168.3.2/32'
+ network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_prototype_model_json['destination_port_max'] = 22
+ network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_prototype_model_json['destination_port_min'] = 22
+ network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_prototype_model_json['protocol'] = 'udp'
+ network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_prototype_model_json['source_port_max'] = 65535
+ network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_prototype_model_json['source_port_min'] = 49152
+
+ # Construct a model instance of NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype by calling from_dict on the json representation
+ network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_prototype_model = NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype.from_dict(network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_prototype_model_json)
+ assert network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_prototype_model != False
+
+ # Construct a model instance of NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype by calling from_dict on the json representation
+ network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_prototype_model_dict = NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype.from_dict(network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_prototype_model_json).__dict__
+ network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_prototype_model2 = NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype(**network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_prototype_model_dict)
# Verify the model instances are equivalent
- assert instance_profile_vcpu_enum_model == instance_profile_vcpu_enum_model2
+ assert network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_prototype_model == network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_prototype_model2
# Convert model instance back to dict and verify no loss of data
- instance_profile_vcpu_enum_model_json2 = instance_profile_vcpu_enum_model.to_dict()
- assert instance_profile_vcpu_enum_model_json2 == instance_profile_vcpu_enum_model_json
+ network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_prototype_model_json2 = network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_prototype_model.to_dict()
+ assert network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_prototype_model_json2 == network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_prototype_model_json
-class TestModel_InstanceProfileVCPUFixed:
+class TestModel_NetworkACLRuleNetworkACLRuleProtocolAll:
"""
- Test Class for InstanceProfileVCPUFixed
+ Test Class for NetworkACLRuleNetworkACLRuleProtocolAll
"""
- def test_instance_profile_vcpu_fixed_serialization(self):
+ def test_network_acl_rule_network_acl_rule_protocol_all_serialization(self):
"""
- Test serialization/deserialization for InstanceProfileVCPUFixed
+ Test serialization/deserialization for NetworkACLRuleNetworkACLRuleProtocolAll
"""
- # Construct a json representation of a InstanceProfileVCPUFixed model
- instance_profile_vcpu_fixed_model_json = {}
- instance_profile_vcpu_fixed_model_json['type'] = 'fixed'
- instance_profile_vcpu_fixed_model_json['value'] = 16
+ # Construct dict forms of any model objects needed in order to build this model.
- # Construct a model instance of InstanceProfileVCPUFixed by calling from_dict on the json representation
- instance_profile_vcpu_fixed_model = InstanceProfileVCPUFixed.from_dict(instance_profile_vcpu_fixed_model_json)
- assert instance_profile_vcpu_fixed_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 InstanceProfileVCPUFixed by calling from_dict on the json representation
- instance_profile_vcpu_fixed_model_dict = InstanceProfileVCPUFixed.from_dict(instance_profile_vcpu_fixed_model_json).__dict__
- instance_profile_vcpu_fixed_model2 = InstanceProfileVCPUFixed(**instance_profile_vcpu_fixed_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'
+
+ # Construct a json representation of a NetworkACLRuleNetworkACLRuleProtocolAll model
+ network_acl_rule_network_acl_rule_protocol_all_model_json = {}
+ network_acl_rule_network_acl_rule_protocol_all_model_json['action'] = 'allow'
+ network_acl_rule_network_acl_rule_protocol_all_model_json['before'] = network_acl_rule_reference_model
+ network_acl_rule_network_acl_rule_protocol_all_model_json['created_at'] = '2019-01-01T12:00:00Z'
+ network_acl_rule_network_acl_rule_protocol_all_model_json['destination'] = '192.168.3.0/24'
+ network_acl_rule_network_acl_rule_protocol_all_model_json['direction'] = 'inbound'
+ network_acl_rule_network_acl_rule_protocol_all_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9'
+ network_acl_rule_network_acl_rule_protocol_all_model_json['id'] = '8daca77a-4980-4d33-8f3e-7038797be8f9'
+ network_acl_rule_network_acl_rule_protocol_all_model_json['ip_version'] = 'ipv4'
+ network_acl_rule_network_acl_rule_protocol_all_model_json['name'] = 'my-rule-1'
+ network_acl_rule_network_acl_rule_protocol_all_model_json['source'] = '192.168.3.0/24'
+ network_acl_rule_network_acl_rule_protocol_all_model_json['protocol'] = 'all'
+
+ # Construct a model instance of NetworkACLRuleNetworkACLRuleProtocolAll by calling from_dict on the json representation
+ network_acl_rule_network_acl_rule_protocol_all_model = NetworkACLRuleNetworkACLRuleProtocolAll.from_dict(network_acl_rule_network_acl_rule_protocol_all_model_json)
+ assert network_acl_rule_network_acl_rule_protocol_all_model != False
+
+ # Construct a model instance of NetworkACLRuleNetworkACLRuleProtocolAll by calling from_dict on the json representation
+ network_acl_rule_network_acl_rule_protocol_all_model_dict = NetworkACLRuleNetworkACLRuleProtocolAll.from_dict(network_acl_rule_network_acl_rule_protocol_all_model_json).__dict__
+ network_acl_rule_network_acl_rule_protocol_all_model2 = NetworkACLRuleNetworkACLRuleProtocolAll(**network_acl_rule_network_acl_rule_protocol_all_model_dict)
# Verify the model instances are equivalent
- assert instance_profile_vcpu_fixed_model == instance_profile_vcpu_fixed_model2
+ assert network_acl_rule_network_acl_rule_protocol_all_model == network_acl_rule_network_acl_rule_protocol_all_model2
# Convert model instance back to dict and verify no loss of data
- instance_profile_vcpu_fixed_model_json2 = instance_profile_vcpu_fixed_model.to_dict()
- assert instance_profile_vcpu_fixed_model_json2 == instance_profile_vcpu_fixed_model_json
+ network_acl_rule_network_acl_rule_protocol_all_model_json2 = network_acl_rule_network_acl_rule_protocol_all_model.to_dict()
+ assert network_acl_rule_network_acl_rule_protocol_all_model_json2 == network_acl_rule_network_acl_rule_protocol_all_model_json
-class TestModel_InstanceProfileVCPURange:
+class TestModel_NetworkACLRuleNetworkACLRuleProtocolICMP:
"""
- Test Class for InstanceProfileVCPURange
+ Test Class for NetworkACLRuleNetworkACLRuleProtocolICMP
"""
- def test_instance_profile_vcpu_range_serialization(self):
+ def test_network_acl_rule_network_acl_rule_protocol_icmp_serialization(self):
"""
- Test serialization/deserialization for InstanceProfileVCPURange
+ Test serialization/deserialization for NetworkACLRuleNetworkACLRuleProtocolICMP
"""
- # Construct a json representation of a InstanceProfileVCPURange model
- instance_profile_vcpu_range_model_json = {}
- instance_profile_vcpu_range_model_json['default'] = 4
- instance_profile_vcpu_range_model_json['max'] = 56
- instance_profile_vcpu_range_model_json['min'] = 2
- instance_profile_vcpu_range_model_json['step'] = 2
- instance_profile_vcpu_range_model_json['type'] = 'range'
+ # Construct dict forms of any model objects needed in order to build this model.
- # Construct a model instance of InstanceProfileVCPURange by calling from_dict on the json representation
- instance_profile_vcpu_range_model = InstanceProfileVCPURange.from_dict(instance_profile_vcpu_range_model_json)
- assert instance_profile_vcpu_range_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 InstanceProfileVCPURange by calling from_dict on the json representation
- instance_profile_vcpu_range_model_dict = InstanceProfileVCPURange.from_dict(instance_profile_vcpu_range_model_json).__dict__
- instance_profile_vcpu_range_model2 = InstanceProfileVCPURange(**instance_profile_vcpu_range_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'
+
+ # Construct a json representation of a NetworkACLRuleNetworkACLRuleProtocolICMP model
+ network_acl_rule_network_acl_rule_protocol_icmp_model_json = {}
+ network_acl_rule_network_acl_rule_protocol_icmp_model_json['action'] = 'allow'
+ network_acl_rule_network_acl_rule_protocol_icmp_model_json['before'] = network_acl_rule_reference_model
+ network_acl_rule_network_acl_rule_protocol_icmp_model_json['created_at'] = '2019-01-01T12:00:00Z'
+ network_acl_rule_network_acl_rule_protocol_icmp_model_json['destination'] = '192.168.3.0/24'
+ network_acl_rule_network_acl_rule_protocol_icmp_model_json['direction'] = 'inbound'
+ network_acl_rule_network_acl_rule_protocol_icmp_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9'
+ network_acl_rule_network_acl_rule_protocol_icmp_model_json['id'] = '8daca77a-4980-4d33-8f3e-7038797be8f9'
+ network_acl_rule_network_acl_rule_protocol_icmp_model_json['ip_version'] = 'ipv4'
+ network_acl_rule_network_acl_rule_protocol_icmp_model_json['name'] = 'my-rule-1'
+ network_acl_rule_network_acl_rule_protocol_icmp_model_json['source'] = '192.168.3.0/24'
+ network_acl_rule_network_acl_rule_protocol_icmp_model_json['code'] = 0
+ network_acl_rule_network_acl_rule_protocol_icmp_model_json['protocol'] = 'icmp'
+ network_acl_rule_network_acl_rule_protocol_icmp_model_json['type'] = 8
+
+ # Construct a model instance of NetworkACLRuleNetworkACLRuleProtocolICMP by calling from_dict on the json representation
+ network_acl_rule_network_acl_rule_protocol_icmp_model = NetworkACLRuleNetworkACLRuleProtocolICMP.from_dict(network_acl_rule_network_acl_rule_protocol_icmp_model_json)
+ assert network_acl_rule_network_acl_rule_protocol_icmp_model != False
+
+ # Construct a model instance of NetworkACLRuleNetworkACLRuleProtocolICMP by calling from_dict on the json representation
+ network_acl_rule_network_acl_rule_protocol_icmp_model_dict = NetworkACLRuleNetworkACLRuleProtocolICMP.from_dict(network_acl_rule_network_acl_rule_protocol_icmp_model_json).__dict__
+ network_acl_rule_network_acl_rule_protocol_icmp_model2 = NetworkACLRuleNetworkACLRuleProtocolICMP(**network_acl_rule_network_acl_rule_protocol_icmp_model_dict)
# Verify the model instances are equivalent
- assert instance_profile_vcpu_range_model == instance_profile_vcpu_range_model2
+ assert network_acl_rule_network_acl_rule_protocol_icmp_model == network_acl_rule_network_acl_rule_protocol_icmp_model2
# Convert model instance back to dict and verify no loss of data
- instance_profile_vcpu_range_model_json2 = instance_profile_vcpu_range_model.to_dict()
- assert instance_profile_vcpu_range_model_json2 == instance_profile_vcpu_range_model_json
+ network_acl_rule_network_acl_rule_protocol_icmp_model_json2 = network_acl_rule_network_acl_rule_protocol_icmp_model.to_dict()
+ assert network_acl_rule_network_acl_rule_protocol_icmp_model_json2 == network_acl_rule_network_acl_rule_protocol_icmp_model_json
-class TestModel_InstanceProfileVolumeBandwidthDependent:
+class TestModel_NetworkACLRuleNetworkACLRuleProtocolTCPUDP:
"""
- Test Class for InstanceProfileVolumeBandwidthDependent
+ Test Class for NetworkACLRuleNetworkACLRuleProtocolTCPUDP
"""
- def test_instance_profile_volume_bandwidth_dependent_serialization(self):
+ def test_network_acl_rule_network_acl_rule_protocol_tcpudp_serialization(self):
"""
- Test serialization/deserialization for InstanceProfileVolumeBandwidthDependent
+ Test serialization/deserialization for NetworkACLRuleNetworkACLRuleProtocolTCPUDP
"""
- # Construct a json representation of a InstanceProfileVolumeBandwidthDependent model
- instance_profile_volume_bandwidth_dependent_model_json = {}
- instance_profile_volume_bandwidth_dependent_model_json['type'] = 'dependent'
+ # Construct dict forms of any model objects needed in order to build this model.
- # Construct a model instance of InstanceProfileVolumeBandwidthDependent by calling from_dict on the json representation
- instance_profile_volume_bandwidth_dependent_model = InstanceProfileVolumeBandwidthDependent.from_dict(instance_profile_volume_bandwidth_dependent_model_json)
- assert instance_profile_volume_bandwidth_dependent_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 InstanceProfileVolumeBandwidthDependent by calling from_dict on the json representation
- instance_profile_volume_bandwidth_dependent_model_dict = InstanceProfileVolumeBandwidthDependent.from_dict(instance_profile_volume_bandwidth_dependent_model_json).__dict__
- instance_profile_volume_bandwidth_dependent_model2 = InstanceProfileVolumeBandwidthDependent(**instance_profile_volume_bandwidth_dependent_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'
+
+ # Construct a json representation of a NetworkACLRuleNetworkACLRuleProtocolTCPUDP model
+ network_acl_rule_network_acl_rule_protocol_tcpudp_model_json = {}
+ network_acl_rule_network_acl_rule_protocol_tcpudp_model_json['action'] = 'allow'
+ network_acl_rule_network_acl_rule_protocol_tcpudp_model_json['before'] = network_acl_rule_reference_model
+ network_acl_rule_network_acl_rule_protocol_tcpudp_model_json['created_at'] = '2019-01-01T12:00:00Z'
+ network_acl_rule_network_acl_rule_protocol_tcpudp_model_json['destination'] = '192.168.3.0/24'
+ network_acl_rule_network_acl_rule_protocol_tcpudp_model_json['direction'] = 'inbound'
+ network_acl_rule_network_acl_rule_protocol_tcpudp_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9'
+ network_acl_rule_network_acl_rule_protocol_tcpudp_model_json['id'] = '8daca77a-4980-4d33-8f3e-7038797be8f9'
+ network_acl_rule_network_acl_rule_protocol_tcpudp_model_json['ip_version'] = 'ipv4'
+ network_acl_rule_network_acl_rule_protocol_tcpudp_model_json['name'] = 'my-rule-1'
+ network_acl_rule_network_acl_rule_protocol_tcpudp_model_json['source'] = '192.168.3.0/24'
+ network_acl_rule_network_acl_rule_protocol_tcpudp_model_json['destination_port_max'] = 22
+ network_acl_rule_network_acl_rule_protocol_tcpudp_model_json['destination_port_min'] = 22
+ network_acl_rule_network_acl_rule_protocol_tcpudp_model_json['protocol'] = 'udp'
+ network_acl_rule_network_acl_rule_protocol_tcpudp_model_json['source_port_max'] = 65535
+ network_acl_rule_network_acl_rule_protocol_tcpudp_model_json['source_port_min'] = 49152
+
+ # Construct a model instance of NetworkACLRuleNetworkACLRuleProtocolTCPUDP by calling from_dict on the json representation
+ network_acl_rule_network_acl_rule_protocol_tcpudp_model = NetworkACLRuleNetworkACLRuleProtocolTCPUDP.from_dict(network_acl_rule_network_acl_rule_protocol_tcpudp_model_json)
+ assert network_acl_rule_network_acl_rule_protocol_tcpudp_model != False
+
+ # Construct a model instance of NetworkACLRuleNetworkACLRuleProtocolTCPUDP by calling from_dict on the json representation
+ network_acl_rule_network_acl_rule_protocol_tcpudp_model_dict = NetworkACLRuleNetworkACLRuleProtocolTCPUDP.from_dict(network_acl_rule_network_acl_rule_protocol_tcpudp_model_json).__dict__
+ network_acl_rule_network_acl_rule_protocol_tcpudp_model2 = NetworkACLRuleNetworkACLRuleProtocolTCPUDP(**network_acl_rule_network_acl_rule_protocol_tcpudp_model_dict)
# Verify the model instances are equivalent
- assert instance_profile_volume_bandwidth_dependent_model == instance_profile_volume_bandwidth_dependent_model2
+ assert network_acl_rule_network_acl_rule_protocol_tcpudp_model == network_acl_rule_network_acl_rule_protocol_tcpudp_model2
# Convert model instance back to dict and verify no loss of data
- instance_profile_volume_bandwidth_dependent_model_json2 = instance_profile_volume_bandwidth_dependent_model.to_dict()
- assert instance_profile_volume_bandwidth_dependent_model_json2 == instance_profile_volume_bandwidth_dependent_model_json
+ network_acl_rule_network_acl_rule_protocol_tcpudp_model_json2 = network_acl_rule_network_acl_rule_protocol_tcpudp_model.to_dict()
+ assert network_acl_rule_network_acl_rule_protocol_tcpudp_model_json2 == network_acl_rule_network_acl_rule_protocol_tcpudp_model_json
-class TestModel_InstanceProfileVolumeBandwidthEnum:
+class TestModel_NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext:
"""
- Test Class for InstanceProfileVolumeBandwidthEnum
+ Test Class for NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext
"""
- def test_instance_profile_volume_bandwidth_enum_serialization(self):
+ def test_network_interface_ip_prototype_reserved_ip_prototype_network_interface_context_serialization(self):
"""
- Test serialization/deserialization for InstanceProfileVolumeBandwidthEnum
+ Test serialization/deserialization for NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext
"""
- # Construct a json representation of a InstanceProfileVolumeBandwidthEnum model
- instance_profile_volume_bandwidth_enum_model_json = {}
- instance_profile_volume_bandwidth_enum_model_json['default'] = 38
- instance_profile_volume_bandwidth_enum_model_json['type'] = 'enum'
- instance_profile_volume_bandwidth_enum_model_json['values'] = [16000, 32000, 48000]
+ # Construct a json representation of a NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext model
+ network_interface_ip_prototype_reserved_ip_prototype_network_interface_context_model_json = {}
+ network_interface_ip_prototype_reserved_ip_prototype_network_interface_context_model_json['address'] = '192.168.3.4'
+ network_interface_ip_prototype_reserved_ip_prototype_network_interface_context_model_json['auto_delete'] = False
+ network_interface_ip_prototype_reserved_ip_prototype_network_interface_context_model_json['name'] = 'my-reserved-ip'
- # Construct a model instance of InstanceProfileVolumeBandwidthEnum by calling from_dict on the json representation
- instance_profile_volume_bandwidth_enum_model = InstanceProfileVolumeBandwidthEnum.from_dict(instance_profile_volume_bandwidth_enum_model_json)
- assert instance_profile_volume_bandwidth_enum_model != False
+ # Construct a model instance of NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext by calling from_dict on the json representation
+ network_interface_ip_prototype_reserved_ip_prototype_network_interface_context_model = NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext.from_dict(network_interface_ip_prototype_reserved_ip_prototype_network_interface_context_model_json)
+ assert network_interface_ip_prototype_reserved_ip_prototype_network_interface_context_model != False
- # Construct a model instance of InstanceProfileVolumeBandwidthEnum by calling from_dict on the json representation
- instance_profile_volume_bandwidth_enum_model_dict = InstanceProfileVolumeBandwidthEnum.from_dict(instance_profile_volume_bandwidth_enum_model_json).__dict__
- instance_profile_volume_bandwidth_enum_model2 = InstanceProfileVolumeBandwidthEnum(**instance_profile_volume_bandwidth_enum_model_dict)
+ # Construct a model instance of NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext by calling from_dict on the json representation
+ network_interface_ip_prototype_reserved_ip_prototype_network_interface_context_model_dict = NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext.from_dict(network_interface_ip_prototype_reserved_ip_prototype_network_interface_context_model_json).__dict__
+ network_interface_ip_prototype_reserved_ip_prototype_network_interface_context_model2 = NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext(**network_interface_ip_prototype_reserved_ip_prototype_network_interface_context_model_dict)
# Verify the model instances are equivalent
- assert instance_profile_volume_bandwidth_enum_model == instance_profile_volume_bandwidth_enum_model2
+ assert network_interface_ip_prototype_reserved_ip_prototype_network_interface_context_model == network_interface_ip_prototype_reserved_ip_prototype_network_interface_context_model2
# Convert model instance back to dict and verify no loss of data
- instance_profile_volume_bandwidth_enum_model_json2 = instance_profile_volume_bandwidth_enum_model.to_dict()
- assert instance_profile_volume_bandwidth_enum_model_json2 == instance_profile_volume_bandwidth_enum_model_json
+ network_interface_ip_prototype_reserved_ip_prototype_network_interface_context_model_json2 = network_interface_ip_prototype_reserved_ip_prototype_network_interface_context_model.to_dict()
+ assert network_interface_ip_prototype_reserved_ip_prototype_network_interface_context_model_json2 == network_interface_ip_prototype_reserved_ip_prototype_network_interface_context_model_json
-class TestModel_InstanceProfileVolumeBandwidthFixed:
+class TestModel_OperatingSystemIdentityByHref:
"""
- Test Class for InstanceProfileVolumeBandwidthFixed
+ Test Class for OperatingSystemIdentityByHref
"""
- def test_instance_profile_volume_bandwidth_fixed_serialization(self):
+ def test_operating_system_identity_by_href_serialization(self):
"""
- Test serialization/deserialization for InstanceProfileVolumeBandwidthFixed
+ Test serialization/deserialization for OperatingSystemIdentityByHref
"""
- # Construct a json representation of a InstanceProfileVolumeBandwidthFixed model
- instance_profile_volume_bandwidth_fixed_model_json = {}
- instance_profile_volume_bandwidth_fixed_model_json['type'] = 'fixed'
- instance_profile_volume_bandwidth_fixed_model_json['value'] = 20000
+ # Construct a json representation of a OperatingSystemIdentityByHref model
+ operating_system_identity_by_href_model_json = {}
+ operating_system_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64'
- # Construct a model instance of InstanceProfileVolumeBandwidthFixed by calling from_dict on the json representation
- instance_profile_volume_bandwidth_fixed_model = InstanceProfileVolumeBandwidthFixed.from_dict(instance_profile_volume_bandwidth_fixed_model_json)
- assert instance_profile_volume_bandwidth_fixed_model != False
+ # Construct a model instance of OperatingSystemIdentityByHref by calling from_dict on the json representation
+ operating_system_identity_by_href_model = OperatingSystemIdentityByHref.from_dict(operating_system_identity_by_href_model_json)
+ assert operating_system_identity_by_href_model != False
- # Construct a model instance of InstanceProfileVolumeBandwidthFixed by calling from_dict on the json representation
- instance_profile_volume_bandwidth_fixed_model_dict = InstanceProfileVolumeBandwidthFixed.from_dict(instance_profile_volume_bandwidth_fixed_model_json).__dict__
- instance_profile_volume_bandwidth_fixed_model2 = InstanceProfileVolumeBandwidthFixed(**instance_profile_volume_bandwidth_fixed_model_dict)
+ # Construct a model instance of OperatingSystemIdentityByHref by calling from_dict on the json representation
+ operating_system_identity_by_href_model_dict = OperatingSystemIdentityByHref.from_dict(operating_system_identity_by_href_model_json).__dict__
+ operating_system_identity_by_href_model2 = OperatingSystemIdentityByHref(**operating_system_identity_by_href_model_dict)
# Verify the model instances are equivalent
- assert instance_profile_volume_bandwidth_fixed_model == instance_profile_volume_bandwidth_fixed_model2
+ assert operating_system_identity_by_href_model == operating_system_identity_by_href_model2
# Convert model instance back to dict and verify no loss of data
- instance_profile_volume_bandwidth_fixed_model_json2 = instance_profile_volume_bandwidth_fixed_model.to_dict()
- assert instance_profile_volume_bandwidth_fixed_model_json2 == instance_profile_volume_bandwidth_fixed_model_json
+ operating_system_identity_by_href_model_json2 = operating_system_identity_by_href_model.to_dict()
+ assert operating_system_identity_by_href_model_json2 == operating_system_identity_by_href_model_json
-class TestModel_InstanceProfileVolumeBandwidthRange:
+class TestModel_OperatingSystemIdentityByName:
"""
- Test Class for InstanceProfileVolumeBandwidthRange
+ Test Class for OperatingSystemIdentityByName
"""
- def test_instance_profile_volume_bandwidth_range_serialization(self):
+ def test_operating_system_identity_by_name_serialization(self):
"""
- Test serialization/deserialization for InstanceProfileVolumeBandwidthRange
+ Test serialization/deserialization for OperatingSystemIdentityByName
"""
- # Construct a json representation of a InstanceProfileVolumeBandwidthRange model
- instance_profile_volume_bandwidth_range_model_json = {}
- instance_profile_volume_bandwidth_range_model_json['default'] = 10000
- instance_profile_volume_bandwidth_range_model_json['max'] = 80000
- instance_profile_volume_bandwidth_range_model_json['min'] = 1000
- instance_profile_volume_bandwidth_range_model_json['step'] = 1000
- instance_profile_volume_bandwidth_range_model_json['type'] = 'range'
+ # Construct a json representation of a OperatingSystemIdentityByName model
+ operating_system_identity_by_name_model_json = {}
+ operating_system_identity_by_name_model_json['name'] = 'ubuntu-16-amd64'
- # Construct a model instance of InstanceProfileVolumeBandwidthRange by calling from_dict on the json representation
- instance_profile_volume_bandwidth_range_model = InstanceProfileVolumeBandwidthRange.from_dict(instance_profile_volume_bandwidth_range_model_json)
- assert instance_profile_volume_bandwidth_range_model != False
+ # Construct a model instance of OperatingSystemIdentityByName by calling from_dict on the json representation
+ operating_system_identity_by_name_model = OperatingSystemIdentityByName.from_dict(operating_system_identity_by_name_model_json)
+ assert operating_system_identity_by_name_model != False
- # Construct a model instance of InstanceProfileVolumeBandwidthRange by calling from_dict on the json representation
- instance_profile_volume_bandwidth_range_model_dict = InstanceProfileVolumeBandwidthRange.from_dict(instance_profile_volume_bandwidth_range_model_json).__dict__
- instance_profile_volume_bandwidth_range_model2 = InstanceProfileVolumeBandwidthRange(**instance_profile_volume_bandwidth_range_model_dict)
+ # Construct a model instance of OperatingSystemIdentityByName by calling from_dict on the json representation
+ operating_system_identity_by_name_model_dict = OperatingSystemIdentityByName.from_dict(operating_system_identity_by_name_model_json).__dict__
+ operating_system_identity_by_name_model2 = OperatingSystemIdentityByName(**operating_system_identity_by_name_model_dict)
# Verify the model instances are equivalent
- assert instance_profile_volume_bandwidth_range_model == instance_profile_volume_bandwidth_range_model2
+ assert operating_system_identity_by_name_model == operating_system_identity_by_name_model2
# Convert model instance back to dict and verify no loss of data
- instance_profile_volume_bandwidth_range_model_json2 = instance_profile_volume_bandwidth_range_model.to_dict()
- assert instance_profile_volume_bandwidth_range_model_json2 == instance_profile_volume_bandwidth_range_model_json
+ operating_system_identity_by_name_model_json2 = operating_system_identity_by_name_model.to_dict()
+ assert operating_system_identity_by_name_model_json2 == operating_system_identity_by_name_model_json
-class TestModel_InstancePrototypeInstanceByCatalogOffering:
+class TestModel_PublicGatewayFloatingIPPrototypeFloatingIPPrototypeTargetContext:
"""
- Test Class for InstancePrototypeInstanceByCatalogOffering
+ Test Class for PublicGatewayFloatingIPPrototypeFloatingIPPrototypeTargetContext
"""
- def test_instance_prototype_instance_by_catalog_offering_serialization(self):
+ def test_public_gateway_floating_ip_prototype_floating_ip_prototype_target_context_serialization(self):
"""
- Test serialization/deserialization for InstancePrototypeInstanceByCatalogOffering
+ Test serialization/deserialization for PublicGatewayFloatingIPPrototypeFloatingIPPrototypeTargetContext
"""
# Construct dict forms of any model objects needed in order to build this model.
- instance_availability_policy_prototype_model = {} # InstanceAvailabilityPolicyPrototype
- instance_availability_policy_prototype_model['host_failure'] = 'restart'
-
- trusted_profile_identity_model = {} # TrustedProfileIdentityTrustedProfileById
- trusted_profile_identity_model['id'] = 'Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5'
-
- instance_default_trusted_profile_prototype_model = {} # InstanceDefaultTrustedProfilePrototype
- instance_default_trusted_profile_prototype_model['auto_link'] = False
- instance_default_trusted_profile_prototype_model['target'] = trusted_profile_identity_model
-
- key_identity_model = {} # KeyIdentityById
- key_identity_model['id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803'
-
- instance_metadata_service_prototype_model = {} # InstanceMetadataServicePrototype
- instance_metadata_service_prototype_model['enabled'] = False
- instance_metadata_service_prototype_model['protocol'] = 'https'
- instance_metadata_service_prototype_model['response_hop_limit'] = 2
-
- instance_placement_target_prototype_model = {} # InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById
- instance_placement_target_prototype_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
-
- instance_profile_identity_model = {} # InstanceProfileIdentityByName
- instance_profile_identity_model['name'] = 'cx2-16x32'
-
resource_group_identity_model = {} # ResourceGroupIdentityById
resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
- volume_attachment_prototype_volume_model = {} # VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById
- volume_attachment_prototype_volume_model['id'] = '1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
-
- volume_attachment_prototype_model = {} # VolumeAttachmentPrototype
- volume_attachment_prototype_model['delete_volume_on_instance_delete'] = False
- volume_attachment_prototype_model['name'] = 'my-volume-attachment'
- volume_attachment_prototype_model['volume'] = volume_attachment_prototype_volume_model
-
- vpc_identity_model = {} # VPCIdentityById
- vpc_identity_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b'
-
- encryption_key_identity_model = {} # EncryptionKeyIdentityByCRN
- encryption_key_identity_model['crn'] = 'crn:v1:bluemix:public:kms:us-south:a/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179'
-
- volume_profile_identity_model = {} # VolumeProfileIdentityByName
- volume_profile_identity_model['name'] = 'general-purpose'
-
- volume_prototype_instance_by_image_context_model = {} # VolumePrototypeInstanceByImageContext
- volume_prototype_instance_by_image_context_model['capacity'] = 100
- volume_prototype_instance_by_image_context_model['encryption_key'] = encryption_key_identity_model
- volume_prototype_instance_by_image_context_model['iops'] = 10000
- volume_prototype_instance_by_image_context_model['name'] = 'my-volume'
- volume_prototype_instance_by_image_context_model['profile'] = volume_profile_identity_model
- volume_prototype_instance_by_image_context_model['resource_group'] = resource_group_identity_model
- volume_prototype_instance_by_image_context_model['user_tags'] = []
-
- volume_attachment_prototype_instance_by_image_context_model = {} # VolumeAttachmentPrototypeInstanceByImageContext
- volume_attachment_prototype_instance_by_image_context_model['delete_volume_on_instance_delete'] = True
- volume_attachment_prototype_instance_by_image_context_model['name'] = 'my-volume-attachment'
- volume_attachment_prototype_instance_by_image_context_model['volume'] = volume_prototype_instance_by_image_context_model
-
- catalog_offering_identity_model = {} # CatalogOfferingIdentityCatalogOfferingByCRN
- catalog_offering_identity_model['crn'] = 'crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:offering:00111601-0ec5-41ac-b142-96d1e64e6442'
-
- instance_catalog_offering_prototype_model = {} # InstanceCatalogOfferingPrototypeCatalogOfferingByOffering
- instance_catalog_offering_prototype_model['offering'] = catalog_offering_identity_model
-
- network_interface_ip_prototype_model = {} # NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext
- network_interface_ip_prototype_model['address'] = '10.0.0.5'
- network_interface_ip_prototype_model['auto_delete'] = False
- network_interface_ip_prototype_model['name'] = 'my-reserved-ip'
-
- security_group_identity_model = {} # SecurityGroupIdentityById
- security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271'
-
- subnet_identity_model = {} # SubnetIdentityById
- subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
-
- network_interface_prototype_model = {} # NetworkInterfacePrototype
- network_interface_prototype_model['allow_ip_spoofing'] = True
- network_interface_prototype_model['name'] = 'my-instance-network-interface'
- network_interface_prototype_model['primary_ip'] = network_interface_ip_prototype_model
- network_interface_prototype_model['security_groups'] = [security_group_identity_model]
- network_interface_prototype_model['subnet'] = subnet_identity_model
-
- zone_identity_model = {} # ZoneIdentityByName
- zone_identity_model['name'] = 'us-south-1'
-
- # Construct a json representation of a InstancePrototypeInstanceByCatalogOffering model
- instance_prototype_instance_by_catalog_offering_model_json = {}
- instance_prototype_instance_by_catalog_offering_model_json['availability_policy'] = instance_availability_policy_prototype_model
- instance_prototype_instance_by_catalog_offering_model_json['default_trusted_profile'] = instance_default_trusted_profile_prototype_model
- instance_prototype_instance_by_catalog_offering_model_json['keys'] = [key_identity_model]
- instance_prototype_instance_by_catalog_offering_model_json['metadata_service'] = instance_metadata_service_prototype_model
- instance_prototype_instance_by_catalog_offering_model_json['name'] = 'my-instance'
- instance_prototype_instance_by_catalog_offering_model_json['placement_target'] = instance_placement_target_prototype_model
- instance_prototype_instance_by_catalog_offering_model_json['profile'] = instance_profile_identity_model
- instance_prototype_instance_by_catalog_offering_model_json['resource_group'] = resource_group_identity_model
- instance_prototype_instance_by_catalog_offering_model_json['total_volume_bandwidth'] = 500
- instance_prototype_instance_by_catalog_offering_model_json['user_data'] = 'testString'
- instance_prototype_instance_by_catalog_offering_model_json['volume_attachments'] = [volume_attachment_prototype_model]
- instance_prototype_instance_by_catalog_offering_model_json['vpc'] = vpc_identity_model
- instance_prototype_instance_by_catalog_offering_model_json['boot_volume_attachment'] = volume_attachment_prototype_instance_by_image_context_model
- instance_prototype_instance_by_catalog_offering_model_json['catalog_offering'] = instance_catalog_offering_prototype_model
- instance_prototype_instance_by_catalog_offering_model_json['network_interfaces'] = [network_interface_prototype_model]
- instance_prototype_instance_by_catalog_offering_model_json['primary_network_interface'] = network_interface_prototype_model
- instance_prototype_instance_by_catalog_offering_model_json['zone'] = zone_identity_model
+ # Construct a json representation of a PublicGatewayFloatingIPPrototypeFloatingIPPrototypeTargetContext model
+ public_gateway_floating_ip_prototype_floating_ip_prototype_target_context_model_json = {}
+ public_gateway_floating_ip_prototype_floating_ip_prototype_target_context_model_json['name'] = 'my-floating-ip'
+ public_gateway_floating_ip_prototype_floating_ip_prototype_target_context_model_json['resource_group'] = resource_group_identity_model
- # Construct a model instance of InstancePrototypeInstanceByCatalogOffering by calling from_dict on the json representation
- instance_prototype_instance_by_catalog_offering_model = InstancePrototypeInstanceByCatalogOffering.from_dict(instance_prototype_instance_by_catalog_offering_model_json)
- assert instance_prototype_instance_by_catalog_offering_model != False
+ # Construct a model instance of PublicGatewayFloatingIPPrototypeFloatingIPPrototypeTargetContext by calling from_dict on the json representation
+ public_gateway_floating_ip_prototype_floating_ip_prototype_target_context_model = PublicGatewayFloatingIPPrototypeFloatingIPPrototypeTargetContext.from_dict(public_gateway_floating_ip_prototype_floating_ip_prototype_target_context_model_json)
+ assert public_gateway_floating_ip_prototype_floating_ip_prototype_target_context_model != False
- # Construct a model instance of InstancePrototypeInstanceByCatalogOffering by calling from_dict on the json representation
- instance_prototype_instance_by_catalog_offering_model_dict = InstancePrototypeInstanceByCatalogOffering.from_dict(instance_prototype_instance_by_catalog_offering_model_json).__dict__
- instance_prototype_instance_by_catalog_offering_model2 = InstancePrototypeInstanceByCatalogOffering(**instance_prototype_instance_by_catalog_offering_model_dict)
+ # Construct a model instance of PublicGatewayFloatingIPPrototypeFloatingIPPrototypeTargetContext by calling from_dict on the json representation
+ public_gateway_floating_ip_prototype_floating_ip_prototype_target_context_model_dict = PublicGatewayFloatingIPPrototypeFloatingIPPrototypeTargetContext.from_dict(public_gateway_floating_ip_prototype_floating_ip_prototype_target_context_model_json).__dict__
+ public_gateway_floating_ip_prototype_floating_ip_prototype_target_context_model2 = PublicGatewayFloatingIPPrototypeFloatingIPPrototypeTargetContext(**public_gateway_floating_ip_prototype_floating_ip_prototype_target_context_model_dict)
# Verify the model instances are equivalent
- assert instance_prototype_instance_by_catalog_offering_model == instance_prototype_instance_by_catalog_offering_model2
+ assert public_gateway_floating_ip_prototype_floating_ip_prototype_target_context_model == public_gateway_floating_ip_prototype_floating_ip_prototype_target_context_model2
# Convert model instance back to dict and verify no loss of data
- instance_prototype_instance_by_catalog_offering_model_json2 = instance_prototype_instance_by_catalog_offering_model.to_dict()
- assert instance_prototype_instance_by_catalog_offering_model_json2 == instance_prototype_instance_by_catalog_offering_model_json
+ 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_InstancePrototypeInstanceByImage:
+class TestModel_PublicGatewayIdentityPublicGatewayIdentityByCRN:
"""
- Test Class for InstancePrototypeInstanceByImage
+ Test Class for PublicGatewayIdentityPublicGatewayIdentityByCRN
"""
- def test_instance_prototype_instance_by_image_serialization(self):
+ def test_public_gateway_identity_public_gateway_identity_by_crn_serialization(self):
"""
- Test serialization/deserialization for InstancePrototypeInstanceByImage
+ Test serialization/deserialization for PublicGatewayIdentityPublicGatewayIdentityByCRN
"""
- # Construct dict forms of any model objects needed in order to build this model.
-
- instance_availability_policy_prototype_model = {} # InstanceAvailabilityPolicyPrototype
- instance_availability_policy_prototype_model['host_failure'] = 'restart'
-
- trusted_profile_identity_model = {} # TrustedProfileIdentityTrustedProfileById
- trusted_profile_identity_model['id'] = 'Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5'
-
- instance_default_trusted_profile_prototype_model = {} # InstanceDefaultTrustedProfilePrototype
- instance_default_trusted_profile_prototype_model['auto_link'] = False
- instance_default_trusted_profile_prototype_model['target'] = trusted_profile_identity_model
-
- key_identity_model = {} # KeyIdentityById
- key_identity_model['id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803'
-
- instance_metadata_service_prototype_model = {} # InstanceMetadataServicePrototype
- instance_metadata_service_prototype_model['enabled'] = False
- instance_metadata_service_prototype_model['protocol'] = 'https'
- instance_metadata_service_prototype_model['response_hop_limit'] = 2
-
- instance_placement_target_prototype_model = {} # InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById
- instance_placement_target_prototype_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
-
- instance_profile_identity_model = {} # InstanceProfileIdentityByName
- instance_profile_identity_model['name'] = 'cx2-16x32'
-
- resource_group_identity_model = {} # ResourceGroupIdentityById
- resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
-
- volume_attachment_prototype_volume_model = {} # VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById
- volume_attachment_prototype_volume_model['id'] = '1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
-
- volume_attachment_prototype_model = {} # VolumeAttachmentPrototype
- volume_attachment_prototype_model['delete_volume_on_instance_delete'] = False
- volume_attachment_prototype_model['name'] = 'my-volume-attachment'
- volume_attachment_prototype_model['volume'] = volume_attachment_prototype_volume_model
-
- vpc_identity_model = {} # VPCIdentityById
- vpc_identity_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b'
-
- encryption_key_identity_model = {} # EncryptionKeyIdentityByCRN
- encryption_key_identity_model['crn'] = 'crn:v1:bluemix:public:kms:us-south:a/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179'
-
- volume_profile_identity_model = {} # VolumeProfileIdentityByName
- volume_profile_identity_model['name'] = 'general-purpose'
-
- volume_prototype_instance_by_image_context_model = {} # VolumePrototypeInstanceByImageContext
- volume_prototype_instance_by_image_context_model['capacity'] = 100
- volume_prototype_instance_by_image_context_model['encryption_key'] = encryption_key_identity_model
- volume_prototype_instance_by_image_context_model['iops'] = 10000
- volume_prototype_instance_by_image_context_model['name'] = 'my-volume'
- volume_prototype_instance_by_image_context_model['profile'] = volume_profile_identity_model
- volume_prototype_instance_by_image_context_model['resource_group'] = resource_group_identity_model
- volume_prototype_instance_by_image_context_model['user_tags'] = []
-
- volume_attachment_prototype_instance_by_image_context_model = {} # VolumeAttachmentPrototypeInstanceByImageContext
- volume_attachment_prototype_instance_by_image_context_model['delete_volume_on_instance_delete'] = True
- volume_attachment_prototype_instance_by_image_context_model['name'] = 'my-volume-attachment'
- volume_attachment_prototype_instance_by_image_context_model['volume'] = volume_prototype_instance_by_image_context_model
-
- image_identity_model = {} # ImageIdentityById
- image_identity_model['id'] = 'r006-02c73baf-9abb-493d-9e41-d0f1866f4051'
-
- network_interface_ip_prototype_model = {} # NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext
- network_interface_ip_prototype_model['address'] = '10.0.0.5'
- network_interface_ip_prototype_model['auto_delete'] = False
- network_interface_ip_prototype_model['name'] = 'my-reserved-ip'
-
- security_group_identity_model = {} # SecurityGroupIdentityById
- security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271'
-
- subnet_identity_model = {} # SubnetIdentityById
- subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
-
- network_interface_prototype_model = {} # NetworkInterfacePrototype
- network_interface_prototype_model['allow_ip_spoofing'] = True
- network_interface_prototype_model['name'] = 'my-instance-network-interface'
- network_interface_prototype_model['primary_ip'] = network_interface_ip_prototype_model
- network_interface_prototype_model['security_groups'] = [security_group_identity_model]
- network_interface_prototype_model['subnet'] = subnet_identity_model
-
- zone_identity_model = {} # ZoneIdentityByName
- zone_identity_model['name'] = 'us-south-1'
-
- # Construct a json representation of a InstancePrototypeInstanceByImage model
- instance_prototype_instance_by_image_model_json = {}
- instance_prototype_instance_by_image_model_json['availability_policy'] = instance_availability_policy_prototype_model
- instance_prototype_instance_by_image_model_json['default_trusted_profile'] = instance_default_trusted_profile_prototype_model
- instance_prototype_instance_by_image_model_json['keys'] = [key_identity_model]
- instance_prototype_instance_by_image_model_json['metadata_service'] = instance_metadata_service_prototype_model
- instance_prototype_instance_by_image_model_json['name'] = 'my-instance'
- instance_prototype_instance_by_image_model_json['placement_target'] = instance_placement_target_prototype_model
- instance_prototype_instance_by_image_model_json['profile'] = instance_profile_identity_model
- instance_prototype_instance_by_image_model_json['resource_group'] = resource_group_identity_model
- instance_prototype_instance_by_image_model_json['total_volume_bandwidth'] = 500
- instance_prototype_instance_by_image_model_json['user_data'] = 'testString'
- instance_prototype_instance_by_image_model_json['volume_attachments'] = [volume_attachment_prototype_model]
- instance_prototype_instance_by_image_model_json['vpc'] = vpc_identity_model
- instance_prototype_instance_by_image_model_json['boot_volume_attachment'] = volume_attachment_prototype_instance_by_image_context_model
- instance_prototype_instance_by_image_model_json['image'] = image_identity_model
- instance_prototype_instance_by_image_model_json['network_interfaces'] = [network_interface_prototype_model]
- instance_prototype_instance_by_image_model_json['primary_network_interface'] = network_interface_prototype_model
- instance_prototype_instance_by_image_model_json['zone'] = zone_identity_model
+ # 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 InstancePrototypeInstanceByImage by calling from_dict on the json representation
- instance_prototype_instance_by_image_model = InstancePrototypeInstanceByImage.from_dict(instance_prototype_instance_by_image_model_json)
- assert instance_prototype_instance_by_image_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 InstancePrototypeInstanceByImage by calling from_dict on the json representation
- instance_prototype_instance_by_image_model_dict = InstancePrototypeInstanceByImage.from_dict(instance_prototype_instance_by_image_model_json).__dict__
- instance_prototype_instance_by_image_model2 = InstancePrototypeInstanceByImage(**instance_prototype_instance_by_image_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 instance_prototype_instance_by_image_model == instance_prototype_instance_by_image_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
- instance_prototype_instance_by_image_model_json2 = instance_prototype_instance_by_image_model.to_dict()
- assert instance_prototype_instance_by_image_model_json2 == instance_prototype_instance_by_image_model_json
+ 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_InstancePrototypeInstanceBySourceSnapshot:
+class TestModel_PublicGatewayIdentityPublicGatewayIdentityByHref:
"""
- Test Class for InstancePrototypeInstanceBySourceSnapshot
+ Test Class for PublicGatewayIdentityPublicGatewayIdentityByHref
"""
- def test_instance_prototype_instance_by_source_snapshot_serialization(self):
+ def test_public_gateway_identity_public_gateway_identity_by_href_serialization(self):
"""
- Test serialization/deserialization for InstancePrototypeInstanceBySourceSnapshot
+ Test serialization/deserialization for PublicGatewayIdentityPublicGatewayIdentityByHref
"""
- # Construct dict forms of any model objects needed in order to build this model.
-
- instance_availability_policy_prototype_model = {} # InstanceAvailabilityPolicyPrototype
- instance_availability_policy_prototype_model['host_failure'] = 'restart'
-
- trusted_profile_identity_model = {} # TrustedProfileIdentityTrustedProfileById
- trusted_profile_identity_model['id'] = 'Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5'
-
- instance_default_trusted_profile_prototype_model = {} # InstanceDefaultTrustedProfilePrototype
- instance_default_trusted_profile_prototype_model['auto_link'] = False
- instance_default_trusted_profile_prototype_model['target'] = trusted_profile_identity_model
-
- key_identity_model = {} # KeyIdentityById
- key_identity_model['id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803'
-
- instance_metadata_service_prototype_model = {} # InstanceMetadataServicePrototype
- instance_metadata_service_prototype_model['enabled'] = False
- instance_metadata_service_prototype_model['protocol'] = 'https'
- instance_metadata_service_prototype_model['response_hop_limit'] = 2
-
- instance_placement_target_prototype_model = {} # InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById
- instance_placement_target_prototype_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
-
- instance_profile_identity_model = {} # InstanceProfileIdentityByName
- instance_profile_identity_model['name'] = 'cx2-16x32'
-
- resource_group_identity_model = {} # ResourceGroupIdentityById
- resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
-
- volume_attachment_prototype_volume_model = {} # VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById
- volume_attachment_prototype_volume_model['id'] = '1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
-
- volume_attachment_prototype_model = {} # VolumeAttachmentPrototype
- volume_attachment_prototype_model['delete_volume_on_instance_delete'] = False
- volume_attachment_prototype_model['name'] = 'my-volume-attachment'
- volume_attachment_prototype_model['volume'] = volume_attachment_prototype_volume_model
-
- vpc_identity_model = {} # VPCIdentityById
- vpc_identity_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b'
-
- encryption_key_identity_model = {} # EncryptionKeyIdentityByCRN
- encryption_key_identity_model['crn'] = 'crn:v1:bluemix:public:kms:us-south:a/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179'
-
- volume_profile_identity_model = {} # VolumeProfileIdentityByName
- volume_profile_identity_model['name'] = 'general-purpose'
-
- snapshot_identity_model = {} # SnapshotIdentityById
- snapshot_identity_model['id'] = '349a61d8-7ab1-420f-a690-5fed76ef9d4f'
+ # Construct a json representation of a 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'
- volume_prototype_instance_by_source_snapshot_context_model = {} # VolumePrototypeInstanceBySourceSnapshotContext
- volume_prototype_instance_by_source_snapshot_context_model['capacity'] = 100
- volume_prototype_instance_by_source_snapshot_context_model['encryption_key'] = encryption_key_identity_model
- volume_prototype_instance_by_source_snapshot_context_model['iops'] = 10000
- volume_prototype_instance_by_source_snapshot_context_model['name'] = 'my-volume'
- volume_prototype_instance_by_source_snapshot_context_model['profile'] = volume_profile_identity_model
- volume_prototype_instance_by_source_snapshot_context_model['resource_group'] = resource_group_identity_model
- volume_prototype_instance_by_source_snapshot_context_model['source_snapshot'] = snapshot_identity_model
- volume_prototype_instance_by_source_snapshot_context_model['user_tags'] = []
+ # 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
- volume_attachment_prototype_instance_by_source_snapshot_context_model = {} # VolumeAttachmentPrototypeInstanceBySourceSnapshotContext
- volume_attachment_prototype_instance_by_source_snapshot_context_model['delete_volume_on_instance_delete'] = True
- volume_attachment_prototype_instance_by_source_snapshot_context_model['name'] = 'my-volume-attachment'
- volume_attachment_prototype_instance_by_source_snapshot_context_model['volume'] = volume_prototype_instance_by_source_snapshot_context_model
+ # 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)
- network_interface_ip_prototype_model = {} # NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext
- network_interface_ip_prototype_model['address'] = '10.0.0.5'
- network_interface_ip_prototype_model['auto_delete'] = False
- network_interface_ip_prototype_model['name'] = 'my-reserved-ip'
+ # Verify the model instances are equivalent
+ assert public_gateway_identity_public_gateway_identity_by_href_model == public_gateway_identity_public_gateway_identity_by_href_model2
- security_group_identity_model = {} # SecurityGroupIdentityById
- security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271'
+ # Convert model instance back to dict and verify no loss of data
+ 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
- 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-instance-network-interface'
- network_interface_prototype_model['primary_ip'] = network_interface_ip_prototype_model
- network_interface_prototype_model['security_groups'] = [security_group_identity_model]
- network_interface_prototype_model['subnet'] = subnet_identity_model
+class TestModel_PublicGatewayIdentityPublicGatewayIdentityById:
+ """
+ Test Class for PublicGatewayIdentityPublicGatewayIdentityById
+ """
- zone_identity_model = {} # ZoneIdentityByName
- zone_identity_model['name'] = 'us-south-1'
+ def test_public_gateway_identity_public_gateway_identity_by_id_serialization(self):
+ """
+ Test serialization/deserialization for PublicGatewayIdentityPublicGatewayIdentityById
+ """
- # Construct a json representation of a InstancePrototypeInstanceBySourceSnapshot model
- instance_prototype_instance_by_source_snapshot_model_json = {}
- instance_prototype_instance_by_source_snapshot_model_json['availability_policy'] = instance_availability_policy_prototype_model
- instance_prototype_instance_by_source_snapshot_model_json['default_trusted_profile'] = instance_default_trusted_profile_prototype_model
- instance_prototype_instance_by_source_snapshot_model_json['keys'] = [key_identity_model]
- instance_prototype_instance_by_source_snapshot_model_json['metadata_service'] = instance_metadata_service_prototype_model
- instance_prototype_instance_by_source_snapshot_model_json['name'] = 'my-instance'
- instance_prototype_instance_by_source_snapshot_model_json['placement_target'] = instance_placement_target_prototype_model
- instance_prototype_instance_by_source_snapshot_model_json['profile'] = instance_profile_identity_model
- instance_prototype_instance_by_source_snapshot_model_json['resource_group'] = resource_group_identity_model
- instance_prototype_instance_by_source_snapshot_model_json['total_volume_bandwidth'] = 500
- instance_prototype_instance_by_source_snapshot_model_json['user_data'] = 'testString'
- instance_prototype_instance_by_source_snapshot_model_json['volume_attachments'] = [volume_attachment_prototype_model]
- instance_prototype_instance_by_source_snapshot_model_json['vpc'] = vpc_identity_model
- instance_prototype_instance_by_source_snapshot_model_json['boot_volume_attachment'] = volume_attachment_prototype_instance_by_source_snapshot_context_model
- instance_prototype_instance_by_source_snapshot_model_json['network_interfaces'] = [network_interface_prototype_model]
- instance_prototype_instance_by_source_snapshot_model_json['primary_network_interface'] = network_interface_prototype_model
- instance_prototype_instance_by_source_snapshot_model_json['zone'] = zone_identity_model
+ # Construct a 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 InstancePrototypeInstanceBySourceSnapshot by calling from_dict on the json representation
- instance_prototype_instance_by_source_snapshot_model = InstancePrototypeInstanceBySourceSnapshot.from_dict(instance_prototype_instance_by_source_snapshot_model_json)
- assert instance_prototype_instance_by_source_snapshot_model != False
+ # Construct a model instance of 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 InstancePrototypeInstanceBySourceSnapshot by calling from_dict on the json representation
- instance_prototype_instance_by_source_snapshot_model_dict = InstancePrototypeInstanceBySourceSnapshot.from_dict(instance_prototype_instance_by_source_snapshot_model_json).__dict__
- instance_prototype_instance_by_source_snapshot_model2 = InstancePrototypeInstanceBySourceSnapshot(**instance_prototype_instance_by_source_snapshot_model_dict)
+ # 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 instance_prototype_instance_by_source_snapshot_model == instance_prototype_instance_by_source_snapshot_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
- instance_prototype_instance_by_source_snapshot_model_json2 = instance_prototype_instance_by_source_snapshot_model.to_dict()
- assert instance_prototype_instance_by_source_snapshot_model_json2 == instance_prototype_instance_by_source_snapshot_model_json
+ 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_InstancePrototypeInstanceBySourceTemplate:
+class TestModel_RegionIdentityByHref:
"""
- Test Class for InstancePrototypeInstanceBySourceTemplate
+ Test Class for RegionIdentityByHref
"""
- def test_instance_prototype_instance_by_source_template_serialization(self):
+ def test_region_identity_by_href_serialization(self):
"""
- Test serialization/deserialization for InstancePrototypeInstanceBySourceTemplate
+ Test serialization/deserialization for RegionIdentityByHref
"""
- # Construct dict forms of any model objects needed in order to build this model.
-
- instance_availability_policy_prototype_model = {} # InstanceAvailabilityPolicyPrototype
- instance_availability_policy_prototype_model['host_failure'] = 'restart'
-
- trusted_profile_identity_model = {} # TrustedProfileIdentityTrustedProfileById
- trusted_profile_identity_model['id'] = 'Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5'
+ # Construct a json representation of a RegionIdentityByHref model
+ region_identity_by_href_model_json = {}
+ region_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south'
- instance_default_trusted_profile_prototype_model = {} # InstanceDefaultTrustedProfilePrototype
- instance_default_trusted_profile_prototype_model['auto_link'] = False
- instance_default_trusted_profile_prototype_model['target'] = trusted_profile_identity_model
+ # Construct a model instance of RegionIdentityByHref by calling from_dict on the json representation
+ region_identity_by_href_model = RegionIdentityByHref.from_dict(region_identity_by_href_model_json)
+ assert region_identity_by_href_model != False
- key_identity_model = {} # KeyIdentityById
- key_identity_model['id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803'
+ # Construct a model instance of RegionIdentityByHref by calling from_dict on the json representation
+ region_identity_by_href_model_dict = RegionIdentityByHref.from_dict(region_identity_by_href_model_json).__dict__
+ region_identity_by_href_model2 = RegionIdentityByHref(**region_identity_by_href_model_dict)
- instance_metadata_service_prototype_model = {} # InstanceMetadataServicePrototype
- instance_metadata_service_prototype_model['enabled'] = False
- instance_metadata_service_prototype_model['protocol'] = 'https'
- instance_metadata_service_prototype_model['response_hop_limit'] = 2
+ # Verify the model instances are equivalent
+ assert region_identity_by_href_model == region_identity_by_href_model2
- instance_placement_target_prototype_model = {} # InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById
- instance_placement_target_prototype_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
+ # Convert model instance back to dict and verify no loss of data
+ region_identity_by_href_model_json2 = region_identity_by_href_model.to_dict()
+ assert region_identity_by_href_model_json2 == region_identity_by_href_model_json
- instance_profile_identity_model = {} # InstanceProfileIdentityByName
- instance_profile_identity_model['name'] = 'cx2-16x32'
- resource_group_identity_model = {} # ResourceGroupIdentityById
- resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
+class TestModel_RegionIdentityByName:
+ """
+ Test Class for RegionIdentityByName
+ """
- volume_attachment_prototype_volume_model = {} # VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById
- volume_attachment_prototype_volume_model['id'] = '1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
+ def test_region_identity_by_name_serialization(self):
+ """
+ Test serialization/deserialization for RegionIdentityByName
+ """
- volume_attachment_prototype_model = {} # VolumeAttachmentPrototype
- volume_attachment_prototype_model['delete_volume_on_instance_delete'] = False
- volume_attachment_prototype_model['name'] = 'my-volume-attachment'
- volume_attachment_prototype_model['volume'] = volume_attachment_prototype_volume_model
+ # Construct a json representation of a RegionIdentityByName model
+ region_identity_by_name_model_json = {}
+ region_identity_by_name_model_json['name'] = 'us-south'
- vpc_identity_model = {} # VPCIdentityById
- vpc_identity_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b'
+ # Construct a model instance of RegionIdentityByName by calling from_dict on the json representation
+ region_identity_by_name_model = RegionIdentityByName.from_dict(region_identity_by_name_model_json)
+ assert region_identity_by_name_model != False
- encryption_key_identity_model = {} # EncryptionKeyIdentityByCRN
- encryption_key_identity_model['crn'] = 'crn:v1:bluemix:public:kms:us-south:a/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179'
+ # Construct a model instance of RegionIdentityByName by calling from_dict on the json representation
+ region_identity_by_name_model_dict = RegionIdentityByName.from_dict(region_identity_by_name_model_json).__dict__
+ region_identity_by_name_model2 = RegionIdentityByName(**region_identity_by_name_model_dict)
- volume_profile_identity_model = {} # VolumeProfileIdentityByName
- volume_profile_identity_model['name'] = 'general-purpose'
+ # Verify the model instances are equivalent
+ assert region_identity_by_name_model == region_identity_by_name_model2
- volume_prototype_instance_by_image_context_model = {} # VolumePrototypeInstanceByImageContext
- volume_prototype_instance_by_image_context_model['capacity'] = 100
- volume_prototype_instance_by_image_context_model['encryption_key'] = encryption_key_identity_model
- volume_prototype_instance_by_image_context_model['iops'] = 10000
- volume_prototype_instance_by_image_context_model['name'] = 'my-volume'
- volume_prototype_instance_by_image_context_model['profile'] = volume_profile_identity_model
- volume_prototype_instance_by_image_context_model['resource_group'] = resource_group_identity_model
- volume_prototype_instance_by_image_context_model['user_tags'] = []
+ # Convert model instance back to dict and verify no loss of data
+ region_identity_by_name_model_json2 = region_identity_by_name_model.to_dict()
+ assert region_identity_by_name_model_json2 == region_identity_by_name_model_json
- volume_attachment_prototype_instance_by_image_context_model = {} # VolumeAttachmentPrototypeInstanceByImageContext
- volume_attachment_prototype_instance_by_image_context_model['delete_volume_on_instance_delete'] = True
- volume_attachment_prototype_instance_by_image_context_model['name'] = 'my-volume-attachment'
- volume_attachment_prototype_instance_by_image_context_model['volume'] = volume_prototype_instance_by_image_context_model
- catalog_offering_identity_model = {} # CatalogOfferingIdentityCatalogOfferingByCRN
- catalog_offering_identity_model['crn'] = 'crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:offering:00111601-0ec5-41ac-b142-96d1e64e6442'
+class TestModel_ReservationIdentityByCRN:
+ """
+ Test Class for ReservationIdentityByCRN
+ """
- instance_catalog_offering_prototype_model = {} # InstanceCatalogOfferingPrototypeCatalogOfferingByOffering
- instance_catalog_offering_prototype_model['offering'] = catalog_offering_identity_model
+ def test_reservation_identity_by_crn_serialization(self):
+ """
+ Test serialization/deserialization for ReservationIdentityByCRN
+ """
- image_identity_model = {} # ImageIdentityById
- image_identity_model['id'] = 'r006-02c73baf-9abb-493d-9e41-d0f1866f4051'
+ # Construct a json representation of a ReservationIdentityByCRN model
+ reservation_identity_by_crn_model_json = {}
+ reservation_identity_by_crn_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::reservation:7187-ba49df72-37b8-43ac-98da-f8e029de0e63'
- network_interface_ip_prototype_model = {} # NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext
- network_interface_ip_prototype_model['address'] = '10.0.0.5'
- network_interface_ip_prototype_model['auto_delete'] = False
- network_interface_ip_prototype_model['name'] = 'my-reserved-ip'
+ # Construct a model instance of ReservationIdentityByCRN by calling from_dict on the json representation
+ reservation_identity_by_crn_model = ReservationIdentityByCRN.from_dict(reservation_identity_by_crn_model_json)
+ assert reservation_identity_by_crn_model != False
- security_group_identity_model = {} # SecurityGroupIdentityById
- security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271'
+ # Construct a model instance of ReservationIdentityByCRN by calling from_dict on the json representation
+ reservation_identity_by_crn_model_dict = ReservationIdentityByCRN.from_dict(reservation_identity_by_crn_model_json).__dict__
+ reservation_identity_by_crn_model2 = ReservationIdentityByCRN(**reservation_identity_by_crn_model_dict)
- subnet_identity_model = {} # SubnetIdentityById
- subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
+ # Verify the model instances are equivalent
+ assert reservation_identity_by_crn_model == reservation_identity_by_crn_model2
- network_interface_prototype_model = {} # NetworkInterfacePrototype
- network_interface_prototype_model['allow_ip_spoofing'] = True
- network_interface_prototype_model['name'] = 'my-instance-network-interface'
- network_interface_prototype_model['primary_ip'] = network_interface_ip_prototype_model
- network_interface_prototype_model['security_groups'] = [security_group_identity_model]
- network_interface_prototype_model['subnet'] = subnet_identity_model
+ # Convert model instance back to dict and verify no loss of data
+ reservation_identity_by_crn_model_json2 = reservation_identity_by_crn_model.to_dict()
+ assert reservation_identity_by_crn_model_json2 == reservation_identity_by_crn_model_json
- instance_template_identity_model = {} # InstanceTemplateIdentityById
- instance_template_identity_model['id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803'
- zone_identity_model = {} # ZoneIdentityByName
- zone_identity_model['name'] = 'us-south-1'
+class TestModel_ReservationIdentityByHref:
+ """
+ Test Class for ReservationIdentityByHref
+ """
- # Construct a json representation of a InstancePrototypeInstanceBySourceTemplate model
- instance_prototype_instance_by_source_template_model_json = {}
- instance_prototype_instance_by_source_template_model_json['availability_policy'] = instance_availability_policy_prototype_model
- instance_prototype_instance_by_source_template_model_json['default_trusted_profile'] = instance_default_trusted_profile_prototype_model
- instance_prototype_instance_by_source_template_model_json['keys'] = [key_identity_model]
- instance_prototype_instance_by_source_template_model_json['metadata_service'] = instance_metadata_service_prototype_model
- instance_prototype_instance_by_source_template_model_json['name'] = 'my-instance'
- instance_prototype_instance_by_source_template_model_json['placement_target'] = instance_placement_target_prototype_model
- instance_prototype_instance_by_source_template_model_json['profile'] = instance_profile_identity_model
- instance_prototype_instance_by_source_template_model_json['resource_group'] = resource_group_identity_model
- instance_prototype_instance_by_source_template_model_json['total_volume_bandwidth'] = 500
- instance_prototype_instance_by_source_template_model_json['user_data'] = 'testString'
- instance_prototype_instance_by_source_template_model_json['volume_attachments'] = [volume_attachment_prototype_model]
- instance_prototype_instance_by_source_template_model_json['vpc'] = vpc_identity_model
- instance_prototype_instance_by_source_template_model_json['boot_volume_attachment'] = volume_attachment_prototype_instance_by_image_context_model
- instance_prototype_instance_by_source_template_model_json['catalog_offering'] = instance_catalog_offering_prototype_model
- instance_prototype_instance_by_source_template_model_json['image'] = image_identity_model
- instance_prototype_instance_by_source_template_model_json['network_interfaces'] = [network_interface_prototype_model]
- instance_prototype_instance_by_source_template_model_json['primary_network_interface'] = network_interface_prototype_model
- instance_prototype_instance_by_source_template_model_json['source_template'] = instance_template_identity_model
- instance_prototype_instance_by_source_template_model_json['zone'] = zone_identity_model
+ def test_reservation_identity_by_href_serialization(self):
+ """
+ Test serialization/deserialization for ReservationIdentityByHref
+ """
- # Construct a model instance of InstancePrototypeInstanceBySourceTemplate by calling from_dict on the json representation
- instance_prototype_instance_by_source_template_model = InstancePrototypeInstanceBySourceTemplate.from_dict(instance_prototype_instance_by_source_template_model_json)
- assert instance_prototype_instance_by_source_template_model != False
+ # Construct a json representation of a ReservationIdentityByHref model
+ reservation_identity_by_href_model_json = {}
+ reservation_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/reservations/7187-ba49df72-37b8-43ac-98da-f8e029de0e63'
- # Construct a model instance of InstancePrototypeInstanceBySourceTemplate by calling from_dict on the json representation
- instance_prototype_instance_by_source_template_model_dict = InstancePrototypeInstanceBySourceTemplate.from_dict(instance_prototype_instance_by_source_template_model_json).__dict__
- instance_prototype_instance_by_source_template_model2 = InstancePrototypeInstanceBySourceTemplate(**instance_prototype_instance_by_source_template_model_dict)
+ # Construct a model instance of ReservationIdentityByHref by calling from_dict on the json representation
+ reservation_identity_by_href_model = ReservationIdentityByHref.from_dict(reservation_identity_by_href_model_json)
+ assert reservation_identity_by_href_model != False
+
+ # Construct a model instance of ReservationIdentityByHref by calling from_dict on the json representation
+ reservation_identity_by_href_model_dict = ReservationIdentityByHref.from_dict(reservation_identity_by_href_model_json).__dict__
+ reservation_identity_by_href_model2 = ReservationIdentityByHref(**reservation_identity_by_href_model_dict)
# Verify the model instances are equivalent
- assert instance_prototype_instance_by_source_template_model == instance_prototype_instance_by_source_template_model2
+ assert reservation_identity_by_href_model == reservation_identity_by_href_model2
# Convert model instance back to dict and verify no loss of data
- instance_prototype_instance_by_source_template_model_json2 = instance_prototype_instance_by_source_template_model.to_dict()
- assert instance_prototype_instance_by_source_template_model_json2 == instance_prototype_instance_by_source_template_model_json
+ reservation_identity_by_href_model_json2 = reservation_identity_by_href_model.to_dict()
+ assert reservation_identity_by_href_model_json2 == reservation_identity_by_href_model_json
-class TestModel_InstancePrototypeInstanceByVolume:
+class TestModel_ReservationIdentityById:
"""
- Test Class for InstancePrototypeInstanceByVolume
+ Test Class for ReservationIdentityById
"""
- def test_instance_prototype_instance_by_volume_serialization(self):
+ def test_reservation_identity_by_id_serialization(self):
"""
- Test serialization/deserialization for InstancePrototypeInstanceByVolume
+ Test serialization/deserialization for ReservationIdentityById
"""
- # Construct dict forms of any model objects needed in order to build this model.
+ # Construct a json representation of a ReservationIdentityById model
+ reservation_identity_by_id_model_json = {}
+ reservation_identity_by_id_model_json['id'] = '7187-ba49df72-37b8-43ac-98da-f8e029de0e63'
- instance_availability_policy_prototype_model = {} # InstanceAvailabilityPolicyPrototype
- instance_availability_policy_prototype_model['host_failure'] = 'restart'
+ # Construct a model instance of ReservationIdentityById by calling from_dict on the json representation
+ reservation_identity_by_id_model = ReservationIdentityById.from_dict(reservation_identity_by_id_model_json)
+ assert reservation_identity_by_id_model != False
- trusted_profile_identity_model = {} # TrustedProfileIdentityTrustedProfileById
- trusted_profile_identity_model['id'] = 'Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5'
+ # Construct a model instance of ReservationIdentityById by calling from_dict on the json representation
+ reservation_identity_by_id_model_dict = ReservationIdentityById.from_dict(reservation_identity_by_id_model_json).__dict__
+ reservation_identity_by_id_model2 = ReservationIdentityById(**reservation_identity_by_id_model_dict)
- instance_default_trusted_profile_prototype_model = {} # InstanceDefaultTrustedProfilePrototype
- instance_default_trusted_profile_prototype_model['auto_link'] = False
- instance_default_trusted_profile_prototype_model['target'] = trusted_profile_identity_model
+ # Verify the model instances are equivalent
+ assert reservation_identity_by_id_model == reservation_identity_by_id_model2
- key_identity_model = {} # KeyIdentityById
- key_identity_model['id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803'
+ # Convert model instance back to dict and verify no loss of data
+ reservation_identity_by_id_model_json2 = reservation_identity_by_id_model.to_dict()
+ assert reservation_identity_by_id_model_json2 == reservation_identity_by_id_model_json
- instance_metadata_service_prototype_model = {} # InstanceMetadataServicePrototype
- instance_metadata_service_prototype_model['enabled'] = False
- instance_metadata_service_prototype_model['protocol'] = 'https'
- instance_metadata_service_prototype_model['response_hop_limit'] = 2
- instance_placement_target_prototype_model = {} # InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById
- instance_placement_target_prototype_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
+class TestModel_ReservedIPTargetBareMetalServerNetworkInterfaceReferenceTargetContext:
+ """
+ Test Class for ReservedIPTargetBareMetalServerNetworkInterfaceReferenceTargetContext
+ """
- instance_profile_identity_model = {} # InstanceProfileIdentityByName
- instance_profile_identity_model['name'] = 'cx2-16x32'
+ def test_reserved_ip_target_bare_metal_server_network_interface_reference_target_context_serialization(self):
+ """
+ Test serialization/deserialization for ReservedIPTargetBareMetalServerNetworkInterfaceReferenceTargetContext
+ """
- resource_group_identity_model = {} # ResourceGroupIdentityById
- resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
+ # Construct dict forms of any model objects needed in order to build this model.
- volume_attachment_prototype_volume_model = {} # VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById
- volume_attachment_prototype_volume_model['id'] = '1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
+ bare_metal_server_network_interface_reference_target_context_deleted_model = {} # BareMetalServerNetworkInterfaceReferenceTargetContextDeleted
+ bare_metal_server_network_interface_reference_target_context_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- volume_attachment_prototype_model = {} # VolumeAttachmentPrototype
- volume_attachment_prototype_model['delete_volume_on_instance_delete'] = False
- volume_attachment_prototype_model['name'] = 'my-volume-attachment'
- volume_attachment_prototype_model['volume'] = volume_attachment_prototype_volume_model
+ # Construct a json representation of a ReservedIPTargetBareMetalServerNetworkInterfaceReferenceTargetContext model
+ reserved_ip_target_bare_metal_server_network_interface_reference_target_context_model_json = {}
+ reserved_ip_target_bare_metal_server_network_interface_reference_target_context_model_json['deleted'] = bare_metal_server_network_interface_reference_target_context_deleted_model
+ reserved_ip_target_bare_metal_server_network_interface_reference_target_context_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e'
+ reserved_ip_target_bare_metal_server_network_interface_reference_target_context_model_json['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e'
+ reserved_ip_target_bare_metal_server_network_interface_reference_target_context_model_json['name'] = 'my-bare-metal-server-network-interface'
+ reserved_ip_target_bare_metal_server_network_interface_reference_target_context_model_json['resource_type'] = 'network_interface'
- vpc_identity_model = {} # VPCIdentityById
- vpc_identity_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b'
+ # Construct a model instance of ReservedIPTargetBareMetalServerNetworkInterfaceReferenceTargetContext by calling from_dict on the json representation
+ reserved_ip_target_bare_metal_server_network_interface_reference_target_context_model = ReservedIPTargetBareMetalServerNetworkInterfaceReferenceTargetContext.from_dict(reserved_ip_target_bare_metal_server_network_interface_reference_target_context_model_json)
+ assert reserved_ip_target_bare_metal_server_network_interface_reference_target_context_model != False
- volume_identity_model = {} # VolumeIdentityById
- volume_identity_model['id'] = '1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
+ # Construct a model instance of ReservedIPTargetBareMetalServerNetworkInterfaceReferenceTargetContext by calling from_dict on the json representation
+ reserved_ip_target_bare_metal_server_network_interface_reference_target_context_model_dict = ReservedIPTargetBareMetalServerNetworkInterfaceReferenceTargetContext.from_dict(reserved_ip_target_bare_metal_server_network_interface_reference_target_context_model_json).__dict__
+ reserved_ip_target_bare_metal_server_network_interface_reference_target_context_model2 = ReservedIPTargetBareMetalServerNetworkInterfaceReferenceTargetContext(**reserved_ip_target_bare_metal_server_network_interface_reference_target_context_model_dict)
- volume_attachment_prototype_instance_by_volume_context_model = {} # VolumeAttachmentPrototypeInstanceByVolumeContext
- volume_attachment_prototype_instance_by_volume_context_model['delete_volume_on_instance_delete'] = False
- volume_attachment_prototype_instance_by_volume_context_model['name'] = 'my-volume-attachment'
- volume_attachment_prototype_instance_by_volume_context_model['volume'] = volume_identity_model
+ # Verify the model instances are equivalent
+ assert reserved_ip_target_bare_metal_server_network_interface_reference_target_context_model == reserved_ip_target_bare_metal_server_network_interface_reference_target_context_model2
- network_interface_ip_prototype_model = {} # NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext
- network_interface_ip_prototype_model['address'] = '10.0.0.5'
- network_interface_ip_prototype_model['auto_delete'] = False
- network_interface_ip_prototype_model['name'] = 'my-reserved-ip'
+ # Convert model instance back to dict and verify no loss of data
+ reserved_ip_target_bare_metal_server_network_interface_reference_target_context_model_json2 = reserved_ip_target_bare_metal_server_network_interface_reference_target_context_model.to_dict()
+ assert reserved_ip_target_bare_metal_server_network_interface_reference_target_context_model_json2 == reserved_ip_target_bare_metal_server_network_interface_reference_target_context_model_json
- 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'
+class TestModel_ReservedIPTargetEndpointGatewayReference:
+ """
+ Test Class for ReservedIPTargetEndpointGatewayReference
+ """
- network_interface_prototype_model = {} # NetworkInterfacePrototype
- network_interface_prototype_model['allow_ip_spoofing'] = True
- network_interface_prototype_model['name'] = 'my-instance-network-interface'
- network_interface_prototype_model['primary_ip'] = network_interface_ip_prototype_model
- network_interface_prototype_model['security_groups'] = [security_group_identity_model]
- network_interface_prototype_model['subnet'] = subnet_identity_model
+ def test_reserved_ip_target_endpoint_gateway_reference_serialization(self):
+ """
+ Test serialization/deserialization for ReservedIPTargetEndpointGatewayReference
+ """
- zone_identity_model = {} # ZoneIdentityByName
- zone_identity_model['name'] = 'us-south-1'
+ # 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 InstancePrototypeInstanceByVolume model
- instance_prototype_instance_by_volume_model_json = {}
- instance_prototype_instance_by_volume_model_json['availability_policy'] = instance_availability_policy_prototype_model
- instance_prototype_instance_by_volume_model_json['default_trusted_profile'] = instance_default_trusted_profile_prototype_model
- instance_prototype_instance_by_volume_model_json['keys'] = [key_identity_model]
- instance_prototype_instance_by_volume_model_json['metadata_service'] = instance_metadata_service_prototype_model
- instance_prototype_instance_by_volume_model_json['name'] = 'my-instance'
- instance_prototype_instance_by_volume_model_json['placement_target'] = instance_placement_target_prototype_model
- instance_prototype_instance_by_volume_model_json['profile'] = instance_profile_identity_model
- instance_prototype_instance_by_volume_model_json['resource_group'] = resource_group_identity_model
- instance_prototype_instance_by_volume_model_json['total_volume_bandwidth'] = 500
- instance_prototype_instance_by_volume_model_json['user_data'] = 'testString'
- instance_prototype_instance_by_volume_model_json['volume_attachments'] = [volume_attachment_prototype_model]
- instance_prototype_instance_by_volume_model_json['vpc'] = vpc_identity_model
- instance_prototype_instance_by_volume_model_json['boot_volume_attachment'] = volume_attachment_prototype_instance_by_volume_context_model
- instance_prototype_instance_by_volume_model_json['network_interfaces'] = [network_interface_prototype_model]
- instance_prototype_instance_by_volume_model_json['primary_network_interface'] = network_interface_prototype_model
- instance_prototype_instance_by_volume_model_json['zone'] = zone_identity_model
+ # Construct a json representation of a ReservedIPTargetEndpointGatewayReference model
+ reserved_ip_target_endpoint_gateway_reference_model_json = {}
+ reserved_ip_target_endpoint_gateway_reference_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5'
+ reserved_ip_target_endpoint_gateway_reference_model_json['deleted'] = endpoint_gateway_reference_deleted_model
+ reserved_ip_target_endpoint_gateway_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5'
+ reserved_ip_target_endpoint_gateway_reference_model_json['id'] = 'r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5'
+ reserved_ip_target_endpoint_gateway_reference_model_json['name'] = 'my-endpoint-gateway'
+ reserved_ip_target_endpoint_gateway_reference_model_json['resource_type'] = 'endpoint_gateway'
- # Construct a model instance of InstancePrototypeInstanceByVolume by calling from_dict on the json representation
- instance_prototype_instance_by_volume_model = InstancePrototypeInstanceByVolume.from_dict(instance_prototype_instance_by_volume_model_json)
- assert instance_prototype_instance_by_volume_model != False
+ # Construct a model instance of ReservedIPTargetEndpointGatewayReference by calling from_dict on the json representation
+ reserved_ip_target_endpoint_gateway_reference_model = ReservedIPTargetEndpointGatewayReference.from_dict(reserved_ip_target_endpoint_gateway_reference_model_json)
+ assert reserved_ip_target_endpoint_gateway_reference_model != False
- # Construct a model instance of InstancePrototypeInstanceByVolume by calling from_dict on the json representation
- instance_prototype_instance_by_volume_model_dict = InstancePrototypeInstanceByVolume.from_dict(instance_prototype_instance_by_volume_model_json).__dict__
- instance_prototype_instance_by_volume_model2 = InstancePrototypeInstanceByVolume(**instance_prototype_instance_by_volume_model_dict)
+ # Construct a model instance of ReservedIPTargetEndpointGatewayReference by calling from_dict on the json representation
+ reserved_ip_target_endpoint_gateway_reference_model_dict = ReservedIPTargetEndpointGatewayReference.from_dict(reserved_ip_target_endpoint_gateway_reference_model_json).__dict__
+ reserved_ip_target_endpoint_gateway_reference_model2 = ReservedIPTargetEndpointGatewayReference(**reserved_ip_target_endpoint_gateway_reference_model_dict)
# Verify the model instances are equivalent
- assert instance_prototype_instance_by_volume_model == instance_prototype_instance_by_volume_model2
+ assert reserved_ip_target_endpoint_gateway_reference_model == reserved_ip_target_endpoint_gateway_reference_model2
# Convert model instance back to dict and verify no loss of data
- instance_prototype_instance_by_volume_model_json2 = instance_prototype_instance_by_volume_model.to_dict()
- assert instance_prototype_instance_by_volume_model_json2 == instance_prototype_instance_by_volume_model_json
+ reserved_ip_target_endpoint_gateway_reference_model_json2 = reserved_ip_target_endpoint_gateway_reference_model.to_dict()
+ assert reserved_ip_target_endpoint_gateway_reference_model_json2 == reserved_ip_target_endpoint_gateway_reference_model_json
-class TestModel_InstanceTemplateIdentityByCRN:
+class TestModel_ReservedIPTargetGenericResourceReference:
"""
- Test Class for InstanceTemplateIdentityByCRN
+ Test Class for ReservedIPTargetGenericResourceReference
"""
- def test_instance_template_identity_by_crn_serialization(self):
+ def test_reserved_ip_target_generic_resource_reference_serialization(self):
"""
- Test serialization/deserialization for InstanceTemplateIdentityByCRN
+ Test serialization/deserialization for ReservedIPTargetGenericResourceReference
"""
- # Construct a json representation of a InstanceTemplateIdentityByCRN model
- instance_template_identity_by_crn_model_json = {}
- instance_template_identity_by_crn_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a'
+ # Construct dict forms of any model objects needed in order to build this model.
- # Construct a model instance of InstanceTemplateIdentityByCRN by calling from_dict on the json representation
- instance_template_identity_by_crn_model = InstanceTemplateIdentityByCRN.from_dict(instance_template_identity_by_crn_model_json)
- assert instance_template_identity_by_crn_model != False
+ generic_resource_reference_deleted_model = {} # GenericResourceReferenceDeleted
+ generic_resource_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Construct a model instance of InstanceTemplateIdentityByCRN by calling from_dict on the json representation
- instance_template_identity_by_crn_model_dict = InstanceTemplateIdentityByCRN.from_dict(instance_template_identity_by_crn_model_json).__dict__
- instance_template_identity_by_crn_model2 = InstanceTemplateIdentityByCRN(**instance_template_identity_by_crn_model_dict)
+ # Construct a json representation of a ReservedIPTargetGenericResourceReference model
+ reserved_ip_target_generic_resource_reference_model_json = {}
+ reserved_ip_target_generic_resource_reference_model_json['crn'] = 'crn:v1:bluemix:public:containers-kubernetes:us-south:a/123456:9qtrw1peys2spdfs7agb::'
+ reserved_ip_target_generic_resource_reference_model_json['deleted'] = generic_resource_reference_deleted_model
+ reserved_ip_target_generic_resource_reference_model_json['resource_type'] = 'cloud_resource'
+
+ # Construct a model instance of ReservedIPTargetGenericResourceReference by calling from_dict on the json representation
+ reserved_ip_target_generic_resource_reference_model = ReservedIPTargetGenericResourceReference.from_dict(reserved_ip_target_generic_resource_reference_model_json)
+ assert reserved_ip_target_generic_resource_reference_model != False
+
+ # Construct a model instance of ReservedIPTargetGenericResourceReference by calling from_dict on the json representation
+ reserved_ip_target_generic_resource_reference_model_dict = ReservedIPTargetGenericResourceReference.from_dict(reserved_ip_target_generic_resource_reference_model_json).__dict__
+ reserved_ip_target_generic_resource_reference_model2 = ReservedIPTargetGenericResourceReference(**reserved_ip_target_generic_resource_reference_model_dict)
# Verify the model instances are equivalent
- assert instance_template_identity_by_crn_model == instance_template_identity_by_crn_model2
+ assert reserved_ip_target_generic_resource_reference_model == reserved_ip_target_generic_resource_reference_model2
# Convert model instance back to dict and verify no loss of data
- instance_template_identity_by_crn_model_json2 = instance_template_identity_by_crn_model.to_dict()
- assert instance_template_identity_by_crn_model_json2 == instance_template_identity_by_crn_model_json
+ reserved_ip_target_generic_resource_reference_model_json2 = reserved_ip_target_generic_resource_reference_model.to_dict()
+ assert reserved_ip_target_generic_resource_reference_model_json2 == reserved_ip_target_generic_resource_reference_model_json
-class TestModel_InstanceTemplateIdentityByHref:
+class TestModel_ReservedIPTargetLoadBalancerReference:
"""
- Test Class for InstanceTemplateIdentityByHref
+ Test Class for ReservedIPTargetLoadBalancerReference
"""
- def test_instance_template_identity_by_href_serialization(self):
+ def test_reserved_ip_target_load_balancer_reference_serialization(self):
"""
- Test serialization/deserialization for InstanceTemplateIdentityByHref
+ Test serialization/deserialization for ReservedIPTargetLoadBalancerReference
"""
- # Construct a json representation of a InstanceTemplateIdentityByHref model
- instance_template_identity_by_href_model_json = {}
- instance_template_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a'
+ # Construct dict forms of any model objects needed in order to build this model.
- # Construct a model instance of InstanceTemplateIdentityByHref by calling from_dict on the json representation
- instance_template_identity_by_href_model = InstanceTemplateIdentityByHref.from_dict(instance_template_identity_by_href_model_json)
- assert instance_template_identity_by_href_model != False
+ load_balancer_reference_deleted_model = {} # LoadBalancerReferenceDeleted
+ load_balancer_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Construct a model instance of InstanceTemplateIdentityByHref by calling from_dict on the json representation
- instance_template_identity_by_href_model_dict = InstanceTemplateIdentityByHref.from_dict(instance_template_identity_by_href_model_json).__dict__
- instance_template_identity_by_href_model2 = InstanceTemplateIdentityByHref(**instance_template_identity_by_href_model_dict)
+ # Construct a json representation of a ReservedIPTargetLoadBalancerReference model
+ reserved_ip_target_load_balancer_reference_model_json = {}
+ reserved_ip_target_load_balancer_reference_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727'
+ reserved_ip_target_load_balancer_reference_model_json['deleted'] = load_balancer_reference_deleted_model
+ reserved_ip_target_load_balancer_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727'
+ reserved_ip_target_load_balancer_reference_model_json['id'] = 'dd754295-e9e0-4c9d-bf6c-58fbc59e5727'
+ reserved_ip_target_load_balancer_reference_model_json['name'] = 'my-load-balancer'
+ reserved_ip_target_load_balancer_reference_model_json['resource_type'] = 'load_balancer'
+
+ # Construct a model instance of ReservedIPTargetLoadBalancerReference by calling from_dict on the json representation
+ reserved_ip_target_load_balancer_reference_model = ReservedIPTargetLoadBalancerReference.from_dict(reserved_ip_target_load_balancer_reference_model_json)
+ assert reserved_ip_target_load_balancer_reference_model != False
+
+ # Construct a model instance of ReservedIPTargetLoadBalancerReference by calling from_dict on the json representation
+ reserved_ip_target_load_balancer_reference_model_dict = ReservedIPTargetLoadBalancerReference.from_dict(reserved_ip_target_load_balancer_reference_model_json).__dict__
+ reserved_ip_target_load_balancer_reference_model2 = ReservedIPTargetLoadBalancerReference(**reserved_ip_target_load_balancer_reference_model_dict)
# Verify the model instances are equivalent
- assert instance_template_identity_by_href_model == instance_template_identity_by_href_model2
+ assert reserved_ip_target_load_balancer_reference_model == reserved_ip_target_load_balancer_reference_model2
# Convert model instance back to dict and verify no loss of data
- instance_template_identity_by_href_model_json2 = instance_template_identity_by_href_model.to_dict()
- assert instance_template_identity_by_href_model_json2 == instance_template_identity_by_href_model_json
+ reserved_ip_target_load_balancer_reference_model_json2 = reserved_ip_target_load_balancer_reference_model.to_dict()
+ assert reserved_ip_target_load_balancer_reference_model_json2 == reserved_ip_target_load_balancer_reference_model_json
-class TestModel_InstanceTemplateIdentityById:
+class TestModel_ReservedIPTargetNetworkInterfaceReferenceTargetContext:
"""
- Test Class for InstanceTemplateIdentityById
+ Test Class for ReservedIPTargetNetworkInterfaceReferenceTargetContext
"""
- def test_instance_template_identity_by_id_serialization(self):
+ def test_reserved_ip_target_network_interface_reference_target_context_serialization(self):
"""
- Test serialization/deserialization for InstanceTemplateIdentityById
+ Test serialization/deserialization for ReservedIPTargetNetworkInterfaceReferenceTargetContext
"""
- # Construct a json representation of a InstanceTemplateIdentityById model
- instance_template_identity_by_id_model_json = {}
- instance_template_identity_by_id_model_json['id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803'
+ # Construct dict forms of any model objects needed in order to build this model.
- # Construct a model instance of InstanceTemplateIdentityById by calling from_dict on the json representation
- instance_template_identity_by_id_model = InstanceTemplateIdentityById.from_dict(instance_template_identity_by_id_model_json)
- assert instance_template_identity_by_id_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 InstanceTemplateIdentityById by calling from_dict on the json representation
- instance_template_identity_by_id_model_dict = InstanceTemplateIdentityById.from_dict(instance_template_identity_by_id_model_json).__dict__
- instance_template_identity_by_id_model2 = InstanceTemplateIdentityById(**instance_template_identity_by_id_model_dict)
+ # Construct a json representation of a ReservedIPTargetNetworkInterfaceReferenceTargetContext model
+ reserved_ip_target_network_interface_reference_target_context_model_json = {}
+ reserved_ip_target_network_interface_reference_target_context_model_json['deleted'] = network_interface_reference_target_context_deleted_model
+ reserved_ip_target_network_interface_reference_target_context_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e'
+ reserved_ip_target_network_interface_reference_target_context_model_json['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e'
+ reserved_ip_target_network_interface_reference_target_context_model_json['name'] = 'my-instance-network-interface'
+ reserved_ip_target_network_interface_reference_target_context_model_json['resource_type'] = 'network_interface'
+
+ # Construct a model instance of ReservedIPTargetNetworkInterfaceReferenceTargetContext by calling from_dict on the json representation
+ reserved_ip_target_network_interface_reference_target_context_model = ReservedIPTargetNetworkInterfaceReferenceTargetContext.from_dict(reserved_ip_target_network_interface_reference_target_context_model_json)
+ assert reserved_ip_target_network_interface_reference_target_context_model != False
+
+ # Construct a model instance of ReservedIPTargetNetworkInterfaceReferenceTargetContext by calling from_dict on the json representation
+ reserved_ip_target_network_interface_reference_target_context_model_dict = ReservedIPTargetNetworkInterfaceReferenceTargetContext.from_dict(reserved_ip_target_network_interface_reference_target_context_model_json).__dict__
+ reserved_ip_target_network_interface_reference_target_context_model2 = ReservedIPTargetNetworkInterfaceReferenceTargetContext(**reserved_ip_target_network_interface_reference_target_context_model_dict)
# Verify the model instances are equivalent
- assert instance_template_identity_by_id_model == instance_template_identity_by_id_model2
+ assert reserved_ip_target_network_interface_reference_target_context_model == reserved_ip_target_network_interface_reference_target_context_model2
# Convert model instance back to dict and verify no loss of data
- instance_template_identity_by_id_model_json2 = instance_template_identity_by_id_model.to_dict()
- assert instance_template_identity_by_id_model_json2 == instance_template_identity_by_id_model_json
+ reserved_ip_target_network_interface_reference_target_context_model_json2 = reserved_ip_target_network_interface_reference_target_context_model.to_dict()
+ assert reserved_ip_target_network_interface_reference_target_context_model_json2 == reserved_ip_target_network_interface_reference_target_context_model_json
-class TestModel_InstanceTemplatePrototypeInstanceTemplateByCatalogOffering:
+class TestModel_ReservedIPTargetVPNGatewayReference:
"""
- Test Class for InstanceTemplatePrototypeInstanceTemplateByCatalogOffering
+ Test Class for ReservedIPTargetVPNGatewayReference
"""
- def test_instance_template_prototype_instance_template_by_catalog_offering_serialization(self):
+ def test_reserved_ip_target_vpn_gateway_reference_serialization(self):
"""
- Test serialization/deserialization for InstanceTemplatePrototypeInstanceTemplateByCatalogOffering
+ Test serialization/deserialization for ReservedIPTargetVPNGatewayReference
"""
# Construct dict forms of any model objects needed in order to build this model.
- instance_availability_policy_prototype_model = {} # InstanceAvailabilityPolicyPrototype
- instance_availability_policy_prototype_model['host_failure'] = 'restart'
+ vpn_gateway_reference_deleted_model = {} # VPNGatewayReferenceDeleted
+ vpn_gateway_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- trusted_profile_identity_model = {} # TrustedProfileIdentityTrustedProfileById
- trusted_profile_identity_model['id'] = 'Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5'
+ # Construct a json representation of a ReservedIPTargetVPNGatewayReference model
+ reserved_ip_target_vpn_gateway_reference_model_json = {}
+ reserved_ip_target_vpn_gateway_reference_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b'
+ reserved_ip_target_vpn_gateway_reference_model_json['deleted'] = vpn_gateway_reference_deleted_model
+ reserved_ip_target_vpn_gateway_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b'
+ reserved_ip_target_vpn_gateway_reference_model_json['id'] = 'ddf51bec-3424-11e8-b467-0ed5f89f718b'
+ reserved_ip_target_vpn_gateway_reference_model_json['name'] = 'my-vpn-gateway'
+ reserved_ip_target_vpn_gateway_reference_model_json['resource_type'] = 'vpn_gateway'
- instance_default_trusted_profile_prototype_model = {} # InstanceDefaultTrustedProfilePrototype
- instance_default_trusted_profile_prototype_model['auto_link'] = False
- instance_default_trusted_profile_prototype_model['target'] = trusted_profile_identity_model
+ # Construct a model instance of ReservedIPTargetVPNGatewayReference by calling from_dict on the json representation
+ reserved_ip_target_vpn_gateway_reference_model = ReservedIPTargetVPNGatewayReference.from_dict(reserved_ip_target_vpn_gateway_reference_model_json)
+ assert reserved_ip_target_vpn_gateway_reference_model != False
- key_identity_model = {} # KeyIdentityById
- key_identity_model['id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803'
+ # Construct a model instance of ReservedIPTargetVPNGatewayReference by calling from_dict on the json representation
+ reserved_ip_target_vpn_gateway_reference_model_dict = ReservedIPTargetVPNGatewayReference.from_dict(reserved_ip_target_vpn_gateway_reference_model_json).__dict__
+ reserved_ip_target_vpn_gateway_reference_model2 = ReservedIPTargetVPNGatewayReference(**reserved_ip_target_vpn_gateway_reference_model_dict)
- instance_metadata_service_prototype_model = {} # InstanceMetadataServicePrototype
- instance_metadata_service_prototype_model['enabled'] = False
- instance_metadata_service_prototype_model['protocol'] = 'https'
- instance_metadata_service_prototype_model['response_hop_limit'] = 2
+ # Verify the model instances are equivalent
+ assert reserved_ip_target_vpn_gateway_reference_model == reserved_ip_target_vpn_gateway_reference_model2
- instance_placement_target_prototype_model = {} # InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById
- instance_placement_target_prototype_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
+ # Convert model instance back to dict and verify no loss of data
+ reserved_ip_target_vpn_gateway_reference_model_json2 = reserved_ip_target_vpn_gateway_reference_model.to_dict()
+ assert reserved_ip_target_vpn_gateway_reference_model_json2 == reserved_ip_target_vpn_gateway_reference_model_json
- instance_profile_identity_model = {} # InstanceProfileIdentityByName
- instance_profile_identity_model['name'] = 'cx2-16x32'
- resource_group_identity_model = {} # ResourceGroupIdentityById
- resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
+class TestModel_ReservedIPTargetVPNServerReference:
+ """
+ Test Class for ReservedIPTargetVPNServerReference
+ """
- volume_attachment_prototype_volume_model = {} # VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById
- volume_attachment_prototype_volume_model['id'] = '1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
+ def test_reserved_ip_target_vpn_server_reference_serialization(self):
+ """
+ Test serialization/deserialization for ReservedIPTargetVPNServerReference
+ """
- volume_attachment_prototype_model = {} # VolumeAttachmentPrototype
- volume_attachment_prototype_model['delete_volume_on_instance_delete'] = False
- volume_attachment_prototype_model['name'] = 'my-volume-attachment'
- volume_attachment_prototype_model['volume'] = volume_attachment_prototype_volume_model
+ # Construct dict forms of any model objects needed in order to build this model.
- vpc_identity_model = {} # VPCIdentityById
- vpc_identity_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b'
+ vpn_server_reference_deleted_model = {} # VPNServerReferenceDeleted
+ vpn_server_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/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179'
+ # Construct a json representation of a ReservedIPTargetVPNServerReference model
+ reserved_ip_target_vpn_server_reference_model_json = {}
+ reserved_ip_target_vpn_server_reference_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpn-server:r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5'
+ reserved_ip_target_vpn_server_reference_model_json['deleted'] = vpn_server_reference_deleted_model
+ reserved_ip_target_vpn_server_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5'
+ reserved_ip_target_vpn_server_reference_model_json['id'] = 'r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5'
+ reserved_ip_target_vpn_server_reference_model_json['name'] = 'my-vpn-server'
+ reserved_ip_target_vpn_server_reference_model_json['resource_type'] = 'vpn_server'
- volume_profile_identity_model = {} # VolumeProfileIdentityByName
- volume_profile_identity_model['name'] = 'general-purpose'
+ # Construct a model instance of ReservedIPTargetVPNServerReference by calling from_dict on the json representation
+ reserved_ip_target_vpn_server_reference_model = ReservedIPTargetVPNServerReference.from_dict(reserved_ip_target_vpn_server_reference_model_json)
+ assert reserved_ip_target_vpn_server_reference_model != False
- volume_prototype_instance_by_image_context_model = {} # VolumePrototypeInstanceByImageContext
- volume_prototype_instance_by_image_context_model['capacity'] = 100
- volume_prototype_instance_by_image_context_model['encryption_key'] = encryption_key_identity_model
- volume_prototype_instance_by_image_context_model['iops'] = 10000
- volume_prototype_instance_by_image_context_model['name'] = 'my-volume'
- volume_prototype_instance_by_image_context_model['profile'] = volume_profile_identity_model
- volume_prototype_instance_by_image_context_model['resource_group'] = resource_group_identity_model
- volume_prototype_instance_by_image_context_model['user_tags'] = []
+ # Construct a model instance of ReservedIPTargetVPNServerReference by calling from_dict on the json representation
+ reserved_ip_target_vpn_server_reference_model_dict = ReservedIPTargetVPNServerReference.from_dict(reserved_ip_target_vpn_server_reference_model_json).__dict__
+ reserved_ip_target_vpn_server_reference_model2 = ReservedIPTargetVPNServerReference(**reserved_ip_target_vpn_server_reference_model_dict)
- 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
+ # Verify the model instances are equivalent
+ assert reserved_ip_target_vpn_server_reference_model == reserved_ip_target_vpn_server_reference_model2
- catalog_offering_identity_model = {} # CatalogOfferingIdentityCatalogOfferingByCRN
- catalog_offering_identity_model['crn'] = 'crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:offering:00111601-0ec5-41ac-b142-96d1e64e6442'
+ # Convert model instance back to dict and verify no loss of data
+ reserved_ip_target_vpn_server_reference_model_json2 = reserved_ip_target_vpn_server_reference_model.to_dict()
+ assert reserved_ip_target_vpn_server_reference_model_json2 == reserved_ip_target_vpn_server_reference_model_json
- instance_catalog_offering_prototype_model = {} # InstanceCatalogOfferingPrototypeCatalogOfferingByOffering
- instance_catalog_offering_prototype_model['offering'] = catalog_offering_identity_model
- network_interface_ip_prototype_model = {} # NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext
- network_interface_ip_prototype_model['address'] = '10.0.0.5'
- network_interface_ip_prototype_model['auto_delete'] = False
- network_interface_ip_prototype_model['name'] = 'my-reserved-ip'
+class TestModel_ReservedIPTargetVirtualNetworkInterfaceReferenceReservedIPTargetContext:
+ """
+ Test Class for ReservedIPTargetVirtualNetworkInterfaceReferenceReservedIPTargetContext
+ """
- security_group_identity_model = {} # SecurityGroupIdentityById
- security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271'
+ def test_reserved_ip_target_virtual_network_interface_reference_reserved_ip_target_context_serialization(self):
+ """
+ Test serialization/deserialization for ReservedIPTargetVirtualNetworkInterfaceReferenceReservedIPTargetContext
+ """
- subnet_identity_model = {} # SubnetIdentityById
- subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
+ # Construct a json representation of a ReservedIPTargetVirtualNetworkInterfaceReferenceReservedIPTargetContext model
+ reserved_ip_target_virtual_network_interface_reference_reserved_ip_target_context_model_json = {}
+ reserved_ip_target_virtual_network_interface_reference_reserved_ip_target_context_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9'
+ reserved_ip_target_virtual_network_interface_reference_reserved_ip_target_context_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9'
+ reserved_ip_target_virtual_network_interface_reference_reserved_ip_target_context_model_json['id'] = '0767-fa41aecb-4f21-423d-8082-630bfba1e1d9'
+ reserved_ip_target_virtual_network_interface_reference_reserved_ip_target_context_model_json['name'] = 'my-virtual-network-interface'
+ reserved_ip_target_virtual_network_interface_reference_reserved_ip_target_context_model_json['resource_type'] = 'virtual_network_interface'
- network_interface_prototype_model = {} # NetworkInterfacePrototype
- network_interface_prototype_model['allow_ip_spoofing'] = True
- network_interface_prototype_model['name'] = 'my-instance-network-interface'
- network_interface_prototype_model['primary_ip'] = network_interface_ip_prototype_model
- network_interface_prototype_model['security_groups'] = [security_group_identity_model]
- network_interface_prototype_model['subnet'] = subnet_identity_model
+ # Construct a model instance of ReservedIPTargetVirtualNetworkInterfaceReferenceReservedIPTargetContext by calling from_dict on the json representation
+ reserved_ip_target_virtual_network_interface_reference_reserved_ip_target_context_model = ReservedIPTargetVirtualNetworkInterfaceReferenceReservedIPTargetContext.from_dict(reserved_ip_target_virtual_network_interface_reference_reserved_ip_target_context_model_json)
+ assert reserved_ip_target_virtual_network_interface_reference_reserved_ip_target_context_model != False
- zone_identity_model = {} # ZoneIdentityByName
- zone_identity_model['name'] = 'us-south-1'
+ # Construct a model instance of ReservedIPTargetVirtualNetworkInterfaceReferenceReservedIPTargetContext by calling from_dict on the json representation
+ reserved_ip_target_virtual_network_interface_reference_reserved_ip_target_context_model_dict = ReservedIPTargetVirtualNetworkInterfaceReferenceReservedIPTargetContext.from_dict(reserved_ip_target_virtual_network_interface_reference_reserved_ip_target_context_model_json).__dict__
+ reserved_ip_target_virtual_network_interface_reference_reserved_ip_target_context_model2 = ReservedIPTargetVirtualNetworkInterfaceReferenceReservedIPTargetContext(**reserved_ip_target_virtual_network_interface_reference_reserved_ip_target_context_model_dict)
+
+ # Verify the model instances are equivalent
+ assert reserved_ip_target_virtual_network_interface_reference_reserved_ip_target_context_model == reserved_ip_target_virtual_network_interface_reference_reserved_ip_target_context_model2
+
+ # Convert model instance back to dict and verify no loss of data
+ reserved_ip_target_virtual_network_interface_reference_reserved_ip_target_context_model_json2 = reserved_ip_target_virtual_network_interface_reference_reserved_ip_target_context_model.to_dict()
+ assert reserved_ip_target_virtual_network_interface_reference_reserved_ip_target_context_model_json2 == reserved_ip_target_virtual_network_interface_reference_reserved_ip_target_context_model_json
+
+
+class TestModel_ResourceGroupIdentityById:
+ """
+ Test Class for ResourceGroupIdentityById
+ """
+
+ def test_resource_group_identity_by_id_serialization(self):
+ """
+ Test serialization/deserialization for ResourceGroupIdentityById
+ """
- # Construct a json representation of a InstanceTemplatePrototypeInstanceTemplateByCatalogOffering model
- instance_template_prototype_instance_template_by_catalog_offering_model_json = {}
- instance_template_prototype_instance_template_by_catalog_offering_model_json['availability_policy'] = instance_availability_policy_prototype_model
- instance_template_prototype_instance_template_by_catalog_offering_model_json['default_trusted_profile'] = instance_default_trusted_profile_prototype_model
- instance_template_prototype_instance_template_by_catalog_offering_model_json['keys'] = [key_identity_model]
- instance_template_prototype_instance_template_by_catalog_offering_model_json['metadata_service'] = instance_metadata_service_prototype_model
- instance_template_prototype_instance_template_by_catalog_offering_model_json['name'] = 'my-instance'
- instance_template_prototype_instance_template_by_catalog_offering_model_json['placement_target'] = instance_placement_target_prototype_model
- instance_template_prototype_instance_template_by_catalog_offering_model_json['profile'] = instance_profile_identity_model
- instance_template_prototype_instance_template_by_catalog_offering_model_json['resource_group'] = resource_group_identity_model
- instance_template_prototype_instance_template_by_catalog_offering_model_json['total_volume_bandwidth'] = 500
- instance_template_prototype_instance_template_by_catalog_offering_model_json['user_data'] = 'testString'
- instance_template_prototype_instance_template_by_catalog_offering_model_json['volume_attachments'] = [volume_attachment_prototype_model]
- instance_template_prototype_instance_template_by_catalog_offering_model_json['vpc'] = vpc_identity_model
- instance_template_prototype_instance_template_by_catalog_offering_model_json['boot_volume_attachment'] = volume_attachment_prototype_instance_by_image_context_model
- instance_template_prototype_instance_template_by_catalog_offering_model_json['catalog_offering'] = instance_catalog_offering_prototype_model
- instance_template_prototype_instance_template_by_catalog_offering_model_json['network_interfaces'] = [network_interface_prototype_model]
- instance_template_prototype_instance_template_by_catalog_offering_model_json['primary_network_interface'] = network_interface_prototype_model
- instance_template_prototype_instance_template_by_catalog_offering_model_json['zone'] = zone_identity_model
+ # Construct a json representation of a ResourceGroupIdentityById model
+ resource_group_identity_by_id_model_json = {}
+ resource_group_identity_by_id_model_json['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
- # Construct a model instance of InstanceTemplatePrototypeInstanceTemplateByCatalogOffering by calling from_dict on the json representation
- instance_template_prototype_instance_template_by_catalog_offering_model = InstanceTemplatePrototypeInstanceTemplateByCatalogOffering.from_dict(instance_template_prototype_instance_template_by_catalog_offering_model_json)
- assert instance_template_prototype_instance_template_by_catalog_offering_model != False
+ # Construct a model instance of ResourceGroupIdentityById by calling from_dict on the json representation
+ resource_group_identity_by_id_model = ResourceGroupIdentityById.from_dict(resource_group_identity_by_id_model_json)
+ assert resource_group_identity_by_id_model != False
- # Construct a model instance of InstanceTemplatePrototypeInstanceTemplateByCatalogOffering by calling from_dict on the json representation
- instance_template_prototype_instance_template_by_catalog_offering_model_dict = InstanceTemplatePrototypeInstanceTemplateByCatalogOffering.from_dict(instance_template_prototype_instance_template_by_catalog_offering_model_json).__dict__
- instance_template_prototype_instance_template_by_catalog_offering_model2 = InstanceTemplatePrototypeInstanceTemplateByCatalogOffering(**instance_template_prototype_instance_template_by_catalog_offering_model_dict)
+ # Construct a model instance of ResourceGroupIdentityById by calling from_dict on the json representation
+ resource_group_identity_by_id_model_dict = ResourceGroupIdentityById.from_dict(resource_group_identity_by_id_model_json).__dict__
+ resource_group_identity_by_id_model2 = ResourceGroupIdentityById(**resource_group_identity_by_id_model_dict)
# Verify the model instances are equivalent
- assert instance_template_prototype_instance_template_by_catalog_offering_model == instance_template_prototype_instance_template_by_catalog_offering_model2
+ assert resource_group_identity_by_id_model == resource_group_identity_by_id_model2
# Convert model instance back to dict and verify no loss of data
- instance_template_prototype_instance_template_by_catalog_offering_model_json2 = instance_template_prototype_instance_template_by_catalog_offering_model.to_dict()
- assert instance_template_prototype_instance_template_by_catalog_offering_model_json2 == instance_template_prototype_instance_template_by_catalog_offering_model_json
+ resource_group_identity_by_id_model_json2 = resource_group_identity_by_id_model.to_dict()
+ assert resource_group_identity_by_id_model_json2 == resource_group_identity_by_id_model_json
-class TestModel_InstanceTemplatePrototypeInstanceTemplateByImage:
+class TestModel_RouteCreatorVPNGatewayReference:
"""
- Test Class for InstanceTemplatePrototypeInstanceTemplateByImage
+ Test Class for RouteCreatorVPNGatewayReference
"""
- def test_instance_template_prototype_instance_template_by_image_serialization(self):
+ def test_route_creator_vpn_gateway_reference_serialization(self):
"""
- Test serialization/deserialization for InstanceTemplatePrototypeInstanceTemplateByImage
+ Test serialization/deserialization for RouteCreatorVPNGatewayReference
"""
# Construct dict forms of any model objects needed in order to build this model.
- instance_availability_policy_prototype_model = {} # InstanceAvailabilityPolicyPrototype
- instance_availability_policy_prototype_model['host_failure'] = 'restart'
-
- trusted_profile_identity_model = {} # TrustedProfileIdentityTrustedProfileById
- trusted_profile_identity_model['id'] = 'Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5'
-
- instance_default_trusted_profile_prototype_model = {} # InstanceDefaultTrustedProfilePrototype
- instance_default_trusted_profile_prototype_model['auto_link'] = False
- instance_default_trusted_profile_prototype_model['target'] = trusted_profile_identity_model
+ vpn_gateway_reference_deleted_model = {} # VPNGatewayReferenceDeleted
+ vpn_gateway_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- key_identity_model = {} # KeyIdentityById
- key_identity_model['id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803'
+ # Construct a json representation of a RouteCreatorVPNGatewayReference model
+ route_creator_vpn_gateway_reference_model_json = {}
+ route_creator_vpn_gateway_reference_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b'
+ route_creator_vpn_gateway_reference_model_json['deleted'] = vpn_gateway_reference_deleted_model
+ route_creator_vpn_gateway_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b'
+ route_creator_vpn_gateway_reference_model_json['id'] = 'ddf51bec-3424-11e8-b467-0ed5f89f718b'
+ route_creator_vpn_gateway_reference_model_json['name'] = 'my-vpn-gateway'
+ route_creator_vpn_gateway_reference_model_json['resource_type'] = 'vpn_gateway'
- instance_metadata_service_prototype_model = {} # InstanceMetadataServicePrototype
- instance_metadata_service_prototype_model['enabled'] = False
- instance_metadata_service_prototype_model['protocol'] = 'https'
- instance_metadata_service_prototype_model['response_hop_limit'] = 2
+ # Construct a model instance of RouteCreatorVPNGatewayReference by calling from_dict on the json representation
+ route_creator_vpn_gateway_reference_model = RouteCreatorVPNGatewayReference.from_dict(route_creator_vpn_gateway_reference_model_json)
+ assert route_creator_vpn_gateway_reference_model != False
- instance_placement_target_prototype_model = {} # InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById
- instance_placement_target_prototype_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
+ # Construct a model instance of RouteCreatorVPNGatewayReference by calling from_dict on the json representation
+ route_creator_vpn_gateway_reference_model_dict = RouteCreatorVPNGatewayReference.from_dict(route_creator_vpn_gateway_reference_model_json).__dict__
+ route_creator_vpn_gateway_reference_model2 = RouteCreatorVPNGatewayReference(**route_creator_vpn_gateway_reference_model_dict)
- instance_profile_identity_model = {} # InstanceProfileIdentityByName
- instance_profile_identity_model['name'] = 'cx2-16x32'
+ # Verify the model instances are equivalent
+ assert route_creator_vpn_gateway_reference_model == route_creator_vpn_gateway_reference_model2
- resource_group_identity_model = {} # ResourceGroupIdentityById
- resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
+ # Convert model instance back to dict and verify no loss of data
+ route_creator_vpn_gateway_reference_model_json2 = route_creator_vpn_gateway_reference_model.to_dict()
+ assert route_creator_vpn_gateway_reference_model_json2 == route_creator_vpn_gateway_reference_model_json
- volume_attachment_prototype_volume_model = {} # VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById
- volume_attachment_prototype_volume_model['id'] = '1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
- volume_attachment_prototype_model = {} # VolumeAttachmentPrototype
- volume_attachment_prototype_model['delete_volume_on_instance_delete'] = False
- volume_attachment_prototype_model['name'] = 'my-volume-attachment'
- volume_attachment_prototype_model['volume'] = volume_attachment_prototype_volume_model
+class TestModel_RouteCreatorVPNServerReference:
+ """
+ Test Class for RouteCreatorVPNServerReference
+ """
- vpc_identity_model = {} # VPCIdentityById
- vpc_identity_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b'
+ def test_route_creator_vpn_server_reference_serialization(self):
+ """
+ Test serialization/deserialization for RouteCreatorVPNServerReference
+ """
- encryption_key_identity_model = {} # EncryptionKeyIdentityByCRN
- encryption_key_identity_model['crn'] = 'crn:v1:bluemix:public:kms:us-south:a/123456: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.
- volume_profile_identity_model = {} # VolumeProfileIdentityByName
- volume_profile_identity_model['name'] = 'general-purpose'
+ vpn_server_reference_deleted_model = {} # VPNServerReferenceDeleted
+ vpn_server_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- volume_prototype_instance_by_image_context_model = {} # VolumePrototypeInstanceByImageContext
- volume_prototype_instance_by_image_context_model['capacity'] = 100
- volume_prototype_instance_by_image_context_model['encryption_key'] = encryption_key_identity_model
- volume_prototype_instance_by_image_context_model['iops'] = 10000
- volume_prototype_instance_by_image_context_model['name'] = 'my-volume'
- volume_prototype_instance_by_image_context_model['profile'] = volume_profile_identity_model
- volume_prototype_instance_by_image_context_model['resource_group'] = resource_group_identity_model
- volume_prototype_instance_by_image_context_model['user_tags'] = []
+ # Construct a json representation of a RouteCreatorVPNServerReference model
+ route_creator_vpn_server_reference_model_json = {}
+ route_creator_vpn_server_reference_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpn-server:r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5'
+ route_creator_vpn_server_reference_model_json['deleted'] = vpn_server_reference_deleted_model
+ route_creator_vpn_server_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5'
+ route_creator_vpn_server_reference_model_json['id'] = 'r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5'
+ route_creator_vpn_server_reference_model_json['name'] = 'my-vpn-server'
+ route_creator_vpn_server_reference_model_json['resource_type'] = 'vpn_server'
- 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
+ # Construct a model instance of RouteCreatorVPNServerReference by calling from_dict on the json representation
+ route_creator_vpn_server_reference_model = RouteCreatorVPNServerReference.from_dict(route_creator_vpn_server_reference_model_json)
+ assert route_creator_vpn_server_reference_model != False
- image_identity_model = {} # ImageIdentityById
- image_identity_model['id'] = 'r006-02c73baf-9abb-493d-9e41-d0f1866f4051'
+ # Construct a model instance of RouteCreatorVPNServerReference by calling from_dict on the json representation
+ route_creator_vpn_server_reference_model_dict = RouteCreatorVPNServerReference.from_dict(route_creator_vpn_server_reference_model_json).__dict__
+ route_creator_vpn_server_reference_model2 = RouteCreatorVPNServerReference(**route_creator_vpn_server_reference_model_dict)
- network_interface_ip_prototype_model = {} # NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext
- network_interface_ip_prototype_model['address'] = '10.0.0.5'
- network_interface_ip_prototype_model['auto_delete'] = False
- network_interface_ip_prototype_model['name'] = 'my-reserved-ip'
+ # Verify the model instances are equivalent
+ assert route_creator_vpn_server_reference_model == route_creator_vpn_server_reference_model2
- security_group_identity_model = {} # SecurityGroupIdentityById
- security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271'
+ # Convert model instance back to dict and verify no loss of data
+ route_creator_vpn_server_reference_model_json2 = route_creator_vpn_server_reference_model.to_dict()
+ assert route_creator_vpn_server_reference_model_json2 == route_creator_vpn_server_reference_model_json
- 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-instance-network-interface'
- network_interface_prototype_model['primary_ip'] = network_interface_ip_prototype_model
- network_interface_prototype_model['security_groups'] = [security_group_identity_model]
- network_interface_prototype_model['subnet'] = subnet_identity_model
+class TestModel_RouteNextHopIP:
+ """
+ Test Class for RouteNextHopIP
+ """
- zone_identity_model = {} # ZoneIdentityByName
- zone_identity_model['name'] = 'us-south-1'
+ def test_route_next_hop_ip_serialization(self):
+ """
+ Test serialization/deserialization for RouteNextHopIP
+ """
- # Construct a json representation of a InstanceTemplatePrototypeInstanceTemplateByImage model
- instance_template_prototype_instance_template_by_image_model_json = {}
- instance_template_prototype_instance_template_by_image_model_json['availability_policy'] = instance_availability_policy_prototype_model
- instance_template_prototype_instance_template_by_image_model_json['default_trusted_profile'] = instance_default_trusted_profile_prototype_model
- instance_template_prototype_instance_template_by_image_model_json['keys'] = [key_identity_model]
- instance_template_prototype_instance_template_by_image_model_json['metadata_service'] = instance_metadata_service_prototype_model
- instance_template_prototype_instance_template_by_image_model_json['name'] = 'my-instance'
- instance_template_prototype_instance_template_by_image_model_json['placement_target'] = instance_placement_target_prototype_model
- instance_template_prototype_instance_template_by_image_model_json['profile'] = instance_profile_identity_model
- instance_template_prototype_instance_template_by_image_model_json['resource_group'] = resource_group_identity_model
- instance_template_prototype_instance_template_by_image_model_json['total_volume_bandwidth'] = 500
- instance_template_prototype_instance_template_by_image_model_json['user_data'] = 'testString'
- instance_template_prototype_instance_template_by_image_model_json['volume_attachments'] = [volume_attachment_prototype_model]
- instance_template_prototype_instance_template_by_image_model_json['vpc'] = vpc_identity_model
- instance_template_prototype_instance_template_by_image_model_json['boot_volume_attachment'] = volume_attachment_prototype_instance_by_image_context_model
- instance_template_prototype_instance_template_by_image_model_json['image'] = image_identity_model
- instance_template_prototype_instance_template_by_image_model_json['network_interfaces'] = [network_interface_prototype_model]
- instance_template_prototype_instance_template_by_image_model_json['primary_network_interface'] = network_interface_prototype_model
- instance_template_prototype_instance_template_by_image_model_json['zone'] = zone_identity_model
+ # Construct a json representation of a RouteNextHopIP model
+ route_next_hop_ip_model_json = {}
+ route_next_hop_ip_model_json['address'] = '192.168.3.4'
- # Construct a model instance of InstanceTemplatePrototypeInstanceTemplateByImage by calling from_dict on the json representation
- instance_template_prototype_instance_template_by_image_model = InstanceTemplatePrototypeInstanceTemplateByImage.from_dict(instance_template_prototype_instance_template_by_image_model_json)
- assert instance_template_prototype_instance_template_by_image_model != False
+ # Construct a model instance of RouteNextHopIP by calling from_dict on the json representation
+ route_next_hop_ip_model = RouteNextHopIP.from_dict(route_next_hop_ip_model_json)
+ assert route_next_hop_ip_model != False
- # Construct a model instance of InstanceTemplatePrototypeInstanceTemplateByImage by calling from_dict on the json representation
- instance_template_prototype_instance_template_by_image_model_dict = InstanceTemplatePrototypeInstanceTemplateByImage.from_dict(instance_template_prototype_instance_template_by_image_model_json).__dict__
- instance_template_prototype_instance_template_by_image_model2 = InstanceTemplatePrototypeInstanceTemplateByImage(**instance_template_prototype_instance_template_by_image_model_dict)
+ # Construct a model instance of RouteNextHopIP by calling from_dict on the json representation
+ route_next_hop_ip_model_dict = RouteNextHopIP.from_dict(route_next_hop_ip_model_json).__dict__
+ route_next_hop_ip_model2 = RouteNextHopIP(**route_next_hop_ip_model_dict)
# Verify the model instances are equivalent
- assert instance_template_prototype_instance_template_by_image_model == instance_template_prototype_instance_template_by_image_model2
+ assert route_next_hop_ip_model == route_next_hop_ip_model2
# Convert model instance back to dict and verify no loss of data
- instance_template_prototype_instance_template_by_image_model_json2 = instance_template_prototype_instance_template_by_image_model.to_dict()
- assert instance_template_prototype_instance_template_by_image_model_json2 == instance_template_prototype_instance_template_by_image_model_json
+ route_next_hop_ip_model_json2 = route_next_hop_ip_model.to_dict()
+ assert route_next_hop_ip_model_json2 == route_next_hop_ip_model_json
-class TestModel_InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot:
+class TestModel_RouteNextHopVPNGatewayConnectionReference:
"""
- Test Class for InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot
+ Test Class for RouteNextHopVPNGatewayConnectionReference
"""
- def test_instance_template_prototype_instance_template_by_source_snapshot_serialization(self):
+ def test_route_next_hop_vpn_gateway_connection_reference_serialization(self):
"""
- Test serialization/deserialization for InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot
+ Test serialization/deserialization for RouteNextHopVPNGatewayConnectionReference
"""
# Construct dict forms of any model objects needed in order to build this model.
- instance_availability_policy_prototype_model = {} # InstanceAvailabilityPolicyPrototype
- instance_availability_policy_prototype_model['host_failure'] = 'restart'
-
- trusted_profile_identity_model = {} # TrustedProfileIdentityTrustedProfileById
- trusted_profile_identity_model['id'] = 'Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5'
-
- instance_default_trusted_profile_prototype_model = {} # InstanceDefaultTrustedProfilePrototype
- instance_default_trusted_profile_prototype_model['auto_link'] = False
- instance_default_trusted_profile_prototype_model['target'] = trusted_profile_identity_model
-
- key_identity_model = {} # KeyIdentityById
- key_identity_model['id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803'
-
- instance_metadata_service_prototype_model = {} # InstanceMetadataServicePrototype
- instance_metadata_service_prototype_model['enabled'] = False
- instance_metadata_service_prototype_model['protocol'] = 'https'
- instance_metadata_service_prototype_model['response_hop_limit'] = 2
+ vpn_gateway_connection_reference_deleted_model = {} # VPNGatewayConnectionReferenceDeleted
+ vpn_gateway_connection_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- instance_placement_target_prototype_model = {} # InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById
- instance_placement_target_prototype_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
+ # Construct a json representation of a RouteNextHopVPNGatewayConnectionReference model
+ route_next_hop_vpn_gateway_connection_reference_model_json = {}
+ route_next_hop_vpn_gateway_connection_reference_model_json['deleted'] = vpn_gateway_connection_reference_deleted_model
+ route_next_hop_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'
+ route_next_hop_vpn_gateway_connection_reference_model_json['id'] = 'a10a5771-dc23-442c-8460-c3601d8542f7'
+ route_next_hop_vpn_gateway_connection_reference_model_json['name'] = 'my-vpn-connection'
+ route_next_hop_vpn_gateway_connection_reference_model_json['resource_type'] = 'vpn_gateway_connection'
- instance_profile_identity_model = {} # InstanceProfileIdentityByName
- instance_profile_identity_model['name'] = 'cx2-16x32'
+ # Construct a model instance of RouteNextHopVPNGatewayConnectionReference by calling from_dict on the json representation
+ route_next_hop_vpn_gateway_connection_reference_model = RouteNextHopVPNGatewayConnectionReference.from_dict(route_next_hop_vpn_gateway_connection_reference_model_json)
+ assert route_next_hop_vpn_gateway_connection_reference_model != False
- resource_group_identity_model = {} # ResourceGroupIdentityById
- resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
+ # Construct a model instance of RouteNextHopVPNGatewayConnectionReference by calling from_dict on the json representation
+ route_next_hop_vpn_gateway_connection_reference_model_dict = RouteNextHopVPNGatewayConnectionReference.from_dict(route_next_hop_vpn_gateway_connection_reference_model_json).__dict__
+ route_next_hop_vpn_gateway_connection_reference_model2 = RouteNextHopVPNGatewayConnectionReference(**route_next_hop_vpn_gateway_connection_reference_model_dict)
- volume_attachment_prototype_volume_model = {} # VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById
- volume_attachment_prototype_volume_model['id'] = '1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
+ # Verify the model instances are equivalent
+ assert route_next_hop_vpn_gateway_connection_reference_model == route_next_hop_vpn_gateway_connection_reference_model2
- volume_attachment_prototype_model = {} # VolumeAttachmentPrototype
- volume_attachment_prototype_model['delete_volume_on_instance_delete'] = False
- volume_attachment_prototype_model['name'] = 'my-volume-attachment'
- volume_attachment_prototype_model['volume'] = volume_attachment_prototype_volume_model
+ # Convert model instance back to dict and verify no loss of data
+ route_next_hop_vpn_gateway_connection_reference_model_json2 = route_next_hop_vpn_gateway_connection_reference_model.to_dict()
+ assert route_next_hop_vpn_gateway_connection_reference_model_json2 == route_next_hop_vpn_gateway_connection_reference_model_json
- vpc_identity_model = {} # VPCIdentityById
- vpc_identity_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b'
- encryption_key_identity_model = {} # EncryptionKeyIdentityByCRN
- encryption_key_identity_model['crn'] = 'crn:v1:bluemix:public:kms:us-south:a/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179'
+class TestModel_RoutingTableIdentityByHref:
+ """
+ Test Class for RoutingTableIdentityByHref
+ """
- volume_profile_identity_model = {} # VolumeProfileIdentityByName
- volume_profile_identity_model['name'] = 'general-purpose'
+ def test_routing_table_identity_by_href_serialization(self):
+ """
+ Test serialization/deserialization for RoutingTableIdentityByHref
+ """
- snapshot_identity_model = {} # SnapshotIdentityById
- snapshot_identity_model['id'] = '349a61d8-7ab1-420f-a690-5fed76ef9d4f'
+ # Construct a json representation of a RoutingTableIdentityByHref model
+ routing_table_identity_by_href_model_json = {}
+ routing_table_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840'
- volume_prototype_instance_by_source_snapshot_context_model = {} # VolumePrototypeInstanceBySourceSnapshotContext
- volume_prototype_instance_by_source_snapshot_context_model['capacity'] = 100
- volume_prototype_instance_by_source_snapshot_context_model['encryption_key'] = encryption_key_identity_model
- volume_prototype_instance_by_source_snapshot_context_model['iops'] = 10000
- volume_prototype_instance_by_source_snapshot_context_model['name'] = 'my-volume'
- volume_prototype_instance_by_source_snapshot_context_model['profile'] = volume_profile_identity_model
- volume_prototype_instance_by_source_snapshot_context_model['resource_group'] = resource_group_identity_model
- volume_prototype_instance_by_source_snapshot_context_model['source_snapshot'] = snapshot_identity_model
- volume_prototype_instance_by_source_snapshot_context_model['user_tags'] = []
+ # Construct a model instance of RoutingTableIdentityByHref by calling from_dict on the json representation
+ routing_table_identity_by_href_model = RoutingTableIdentityByHref.from_dict(routing_table_identity_by_href_model_json)
+ assert routing_table_identity_by_href_model != False
- volume_attachment_prototype_instance_by_source_snapshot_context_model = {} # VolumeAttachmentPrototypeInstanceBySourceSnapshotContext
- volume_attachment_prototype_instance_by_source_snapshot_context_model['delete_volume_on_instance_delete'] = True
- volume_attachment_prototype_instance_by_source_snapshot_context_model['name'] = 'my-volume-attachment'
- volume_attachment_prototype_instance_by_source_snapshot_context_model['volume'] = volume_prototype_instance_by_source_snapshot_context_model
+ # Construct a model instance of RoutingTableIdentityByHref by calling from_dict on the json representation
+ routing_table_identity_by_href_model_dict = RoutingTableIdentityByHref.from_dict(routing_table_identity_by_href_model_json).__dict__
+ routing_table_identity_by_href_model2 = RoutingTableIdentityByHref(**routing_table_identity_by_href_model_dict)
- network_interface_ip_prototype_model = {} # NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext
- network_interface_ip_prototype_model['address'] = '10.0.0.5'
- network_interface_ip_prototype_model['auto_delete'] = False
- network_interface_ip_prototype_model['name'] = 'my-reserved-ip'
+ # Verify the model instances are equivalent
+ assert routing_table_identity_by_href_model == routing_table_identity_by_href_model2
- security_group_identity_model = {} # SecurityGroupIdentityById
- security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271'
+ # Convert model instance back to dict and verify no loss of data
+ routing_table_identity_by_href_model_json2 = routing_table_identity_by_href_model.to_dict()
+ assert routing_table_identity_by_href_model_json2 == routing_table_identity_by_href_model_json
- 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-instance-network-interface'
- network_interface_prototype_model['primary_ip'] = network_interface_ip_prototype_model
- network_interface_prototype_model['security_groups'] = [security_group_identity_model]
- network_interface_prototype_model['subnet'] = subnet_identity_model
+class TestModel_RoutingTableIdentityById:
+ """
+ Test Class for RoutingTableIdentityById
+ """
- zone_identity_model = {} # ZoneIdentityByName
- zone_identity_model['name'] = 'us-south-1'
+ def test_routing_table_identity_by_id_serialization(self):
+ """
+ Test serialization/deserialization for RoutingTableIdentityById
+ """
- # Construct a json representation of a InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot model
- instance_template_prototype_instance_template_by_source_snapshot_model_json = {}
- instance_template_prototype_instance_template_by_source_snapshot_model_json['availability_policy'] = instance_availability_policy_prototype_model
- instance_template_prototype_instance_template_by_source_snapshot_model_json['default_trusted_profile'] = instance_default_trusted_profile_prototype_model
- instance_template_prototype_instance_template_by_source_snapshot_model_json['keys'] = [key_identity_model]
- instance_template_prototype_instance_template_by_source_snapshot_model_json['metadata_service'] = instance_metadata_service_prototype_model
- instance_template_prototype_instance_template_by_source_snapshot_model_json['name'] = 'my-instance'
- instance_template_prototype_instance_template_by_source_snapshot_model_json['placement_target'] = instance_placement_target_prototype_model
- instance_template_prototype_instance_template_by_source_snapshot_model_json['profile'] = instance_profile_identity_model
- instance_template_prototype_instance_template_by_source_snapshot_model_json['resource_group'] = resource_group_identity_model
- instance_template_prototype_instance_template_by_source_snapshot_model_json['total_volume_bandwidth'] = 500
- instance_template_prototype_instance_template_by_source_snapshot_model_json['user_data'] = 'testString'
- instance_template_prototype_instance_template_by_source_snapshot_model_json['volume_attachments'] = [volume_attachment_prototype_model]
- instance_template_prototype_instance_template_by_source_snapshot_model_json['vpc'] = vpc_identity_model
- instance_template_prototype_instance_template_by_source_snapshot_model_json['boot_volume_attachment'] = volume_attachment_prototype_instance_by_source_snapshot_context_model
- instance_template_prototype_instance_template_by_source_snapshot_model_json['network_interfaces'] = [network_interface_prototype_model]
- instance_template_prototype_instance_template_by_source_snapshot_model_json['primary_network_interface'] = network_interface_prototype_model
- instance_template_prototype_instance_template_by_source_snapshot_model_json['zone'] = zone_identity_model
+ # Construct a json representation of a RoutingTableIdentityById model
+ routing_table_identity_by_id_model_json = {}
+ routing_table_identity_by_id_model_json['id'] = '1a15dca5-7e33-45e1-b7c5-bc690e569531'
- # Construct a model instance of InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot by calling from_dict on the json representation
- instance_template_prototype_instance_template_by_source_snapshot_model = InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot.from_dict(instance_template_prototype_instance_template_by_source_snapshot_model_json)
- assert instance_template_prototype_instance_template_by_source_snapshot_model != False
+ # Construct a model instance of RoutingTableIdentityById by calling from_dict on the json representation
+ routing_table_identity_by_id_model = RoutingTableIdentityById.from_dict(routing_table_identity_by_id_model_json)
+ assert routing_table_identity_by_id_model != False
- # Construct a model instance of InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot by calling from_dict on the json representation
- instance_template_prototype_instance_template_by_source_snapshot_model_dict = InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot.from_dict(instance_template_prototype_instance_template_by_source_snapshot_model_json).__dict__
- instance_template_prototype_instance_template_by_source_snapshot_model2 = InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot(**instance_template_prototype_instance_template_by_source_snapshot_model_dict)
+ # Construct a model instance of RoutingTableIdentityById by calling from_dict on the json representation
+ routing_table_identity_by_id_model_dict = RoutingTableIdentityById.from_dict(routing_table_identity_by_id_model_json).__dict__
+ routing_table_identity_by_id_model2 = RoutingTableIdentityById(**routing_table_identity_by_id_model_dict)
# Verify the model instances are equivalent
- assert instance_template_prototype_instance_template_by_source_snapshot_model == instance_template_prototype_instance_template_by_source_snapshot_model2
+ assert routing_table_identity_by_id_model == routing_table_identity_by_id_model2
# Convert model instance back to dict and verify no loss of data
- instance_template_prototype_instance_template_by_source_snapshot_model_json2 = instance_template_prototype_instance_template_by_source_snapshot_model.to_dict()
- assert instance_template_prototype_instance_template_by_source_snapshot_model_json2 == instance_template_prototype_instance_template_by_source_snapshot_model_json
+ routing_table_identity_by_id_model_json2 = routing_table_identity_by_id_model.to_dict()
+ assert routing_table_identity_by_id_model_json2 == routing_table_identity_by_id_model_json
-class TestModel_InstanceTemplatePrototypeInstanceTemplateBySourceTemplate:
+class TestModel_SecurityGroupIdentityByCRN:
"""
- Test Class for InstanceTemplatePrototypeInstanceTemplateBySourceTemplate
+ Test Class for SecurityGroupIdentityByCRN
"""
- def test_instance_template_prototype_instance_template_by_source_template_serialization(self):
+ def test_security_group_identity_by_crn_serialization(self):
"""
- Test serialization/deserialization for InstanceTemplatePrototypeInstanceTemplateBySourceTemplate
+ Test serialization/deserialization for SecurityGroupIdentityByCRN
"""
- # Construct dict forms of any model objects needed in order to build this model.
+ # Construct a json representation of a SecurityGroupIdentityByCRN model
+ security_group_identity_by_crn_model_json = {}
+ security_group_identity_by_crn_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271'
- instance_availability_policy_prototype_model = {} # InstanceAvailabilityPolicyPrototype
- instance_availability_policy_prototype_model['host_failure'] = 'restart'
+ # Construct a model instance of SecurityGroupIdentityByCRN by calling from_dict on the json representation
+ security_group_identity_by_crn_model = SecurityGroupIdentityByCRN.from_dict(security_group_identity_by_crn_model_json)
+ assert security_group_identity_by_crn_model != False
- trusted_profile_identity_model = {} # TrustedProfileIdentityTrustedProfileById
- trusted_profile_identity_model['id'] = 'Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5'
+ # Construct a model instance of SecurityGroupIdentityByCRN by calling from_dict on the json representation
+ security_group_identity_by_crn_model_dict = SecurityGroupIdentityByCRN.from_dict(security_group_identity_by_crn_model_json).__dict__
+ security_group_identity_by_crn_model2 = SecurityGroupIdentityByCRN(**security_group_identity_by_crn_model_dict)
- instance_default_trusted_profile_prototype_model = {} # InstanceDefaultTrustedProfilePrototype
- instance_default_trusted_profile_prototype_model['auto_link'] = False
- instance_default_trusted_profile_prototype_model['target'] = trusted_profile_identity_model
+ # Verify the model instances are equivalent
+ assert security_group_identity_by_crn_model == security_group_identity_by_crn_model2
- key_identity_model = {} # KeyIdentityById
- key_identity_model['id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803'
+ # Convert model instance back to dict and verify no loss of data
+ security_group_identity_by_crn_model_json2 = security_group_identity_by_crn_model.to_dict()
+ assert security_group_identity_by_crn_model_json2 == security_group_identity_by_crn_model_json
- instance_metadata_service_prototype_model = {} # InstanceMetadataServicePrototype
- instance_metadata_service_prototype_model['enabled'] = False
- instance_metadata_service_prototype_model['protocol'] = 'https'
- instance_metadata_service_prototype_model['response_hop_limit'] = 2
- instance_placement_target_prototype_model = {} # InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById
- instance_placement_target_prototype_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
+class TestModel_SecurityGroupIdentityByHref:
+ """
+ Test Class for SecurityGroupIdentityByHref
+ """
- instance_profile_identity_model = {} # InstanceProfileIdentityByName
- instance_profile_identity_model['name'] = 'cx2-16x32'
+ def test_security_group_identity_by_href_serialization(self):
+ """
+ Test serialization/deserialization for SecurityGroupIdentityByHref
+ """
- resource_group_identity_model = {} # ResourceGroupIdentityById
- resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
+ # Construct a json representation of a SecurityGroupIdentityByHref model
+ security_group_identity_by_href_model_json = {}
+ security_group_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271'
- volume_attachment_prototype_volume_model = {} # VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById
- volume_attachment_prototype_volume_model['id'] = '1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
+ # Construct a model instance of SecurityGroupIdentityByHref by calling from_dict on the json representation
+ security_group_identity_by_href_model = SecurityGroupIdentityByHref.from_dict(security_group_identity_by_href_model_json)
+ assert security_group_identity_by_href_model != False
- volume_attachment_prototype_model = {} # VolumeAttachmentPrototype
- volume_attachment_prototype_model['delete_volume_on_instance_delete'] = False
- volume_attachment_prototype_model['name'] = 'my-volume-attachment'
- volume_attachment_prototype_model['volume'] = volume_attachment_prototype_volume_model
+ # Construct a model instance of SecurityGroupIdentityByHref by calling from_dict on the json representation
+ security_group_identity_by_href_model_dict = SecurityGroupIdentityByHref.from_dict(security_group_identity_by_href_model_json).__dict__
+ security_group_identity_by_href_model2 = SecurityGroupIdentityByHref(**security_group_identity_by_href_model_dict)
- vpc_identity_model = {} # VPCIdentityById
- vpc_identity_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b'
+ # Verify the model instances are equivalent
+ assert security_group_identity_by_href_model == security_group_identity_by_href_model2
- encryption_key_identity_model = {} # EncryptionKeyIdentityByCRN
- encryption_key_identity_model['crn'] = 'crn:v1:bluemix:public:kms:us-south:a/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179'
+ # Convert model instance back to dict and verify no loss of data
+ security_group_identity_by_href_model_json2 = security_group_identity_by_href_model.to_dict()
+ assert security_group_identity_by_href_model_json2 == security_group_identity_by_href_model_json
- volume_profile_identity_model = {} # VolumeProfileIdentityByName
- volume_profile_identity_model['name'] = 'general-purpose'
- volume_prototype_instance_by_image_context_model = {} # VolumePrototypeInstanceByImageContext
- volume_prototype_instance_by_image_context_model['capacity'] = 100
- volume_prototype_instance_by_image_context_model['encryption_key'] = encryption_key_identity_model
- volume_prototype_instance_by_image_context_model['iops'] = 10000
- volume_prototype_instance_by_image_context_model['name'] = 'my-volume'
- volume_prototype_instance_by_image_context_model['profile'] = volume_profile_identity_model
- volume_prototype_instance_by_image_context_model['resource_group'] = resource_group_identity_model
- volume_prototype_instance_by_image_context_model['user_tags'] = []
+class TestModel_SecurityGroupIdentityById:
+ """
+ Test Class for SecurityGroupIdentityById
+ """
- 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_security_group_identity_by_id_serialization(self):
+ """
+ Test serialization/deserialization for SecurityGroupIdentityById
+ """
- catalog_offering_identity_model = {} # CatalogOfferingIdentityCatalogOfferingByCRN
- catalog_offering_identity_model['crn'] = 'crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:offering:00111601-0ec5-41ac-b142-96d1e64e6442'
+ # Construct a json representation of a SecurityGroupIdentityById model
+ security_group_identity_by_id_model_json = {}
+ security_group_identity_by_id_model_json['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271'
- instance_catalog_offering_prototype_model = {} # InstanceCatalogOfferingPrototypeCatalogOfferingByOffering
- instance_catalog_offering_prototype_model['offering'] = catalog_offering_identity_model
+ # Construct a model instance of SecurityGroupIdentityById by calling from_dict on the json representation
+ security_group_identity_by_id_model = SecurityGroupIdentityById.from_dict(security_group_identity_by_id_model_json)
+ assert security_group_identity_by_id_model != False
- image_identity_model = {} # ImageIdentityById
- image_identity_model['id'] = 'r006-02c73baf-9abb-493d-9e41-d0f1866f4051'
+ # Construct a model instance of SecurityGroupIdentityById by calling from_dict on the json representation
+ security_group_identity_by_id_model_dict = SecurityGroupIdentityById.from_dict(security_group_identity_by_id_model_json).__dict__
+ security_group_identity_by_id_model2 = SecurityGroupIdentityById(**security_group_identity_by_id_model_dict)
- network_interface_ip_prototype_model = {} # NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext
- network_interface_ip_prototype_model['address'] = '10.0.0.5'
- network_interface_ip_prototype_model['auto_delete'] = False
- network_interface_ip_prototype_model['name'] = 'my-reserved-ip'
+ # Verify the model instances are equivalent
+ assert security_group_identity_by_id_model == security_group_identity_by_id_model2
- security_group_identity_model = {} # SecurityGroupIdentityById
- security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271'
+ # Convert model instance back to dict and verify no loss of data
+ security_group_identity_by_id_model_json2 = security_group_identity_by_id_model.to_dict()
+ assert security_group_identity_by_id_model_json2 == security_group_identity_by_id_model_json
- 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-instance-network-interface'
- network_interface_prototype_model['primary_ip'] = network_interface_ip_prototype_model
- network_interface_prototype_model['security_groups'] = [security_group_identity_model]
- network_interface_prototype_model['subnet'] = subnet_identity_model
+class TestModel_SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll:
+ """
+ Test Class for SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll
+ """
- instance_template_identity_model = {} # InstanceTemplateIdentityById
- instance_template_identity_model['id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803'
+ def test_security_group_rule_prototype_security_group_rule_protocol_all_serialization(self):
+ """
+ Test serialization/deserialization for SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll
+ """
- zone_identity_model = {} # ZoneIdentityByName
- zone_identity_model['name'] = 'us-south-1'
+ # Construct dict forms of any model objects needed in order to build this model.
- # Construct a json representation of a InstanceTemplatePrototypeInstanceTemplateBySourceTemplate model
- instance_template_prototype_instance_template_by_source_template_model_json = {}
- instance_template_prototype_instance_template_by_source_template_model_json['availability_policy'] = instance_availability_policy_prototype_model
- instance_template_prototype_instance_template_by_source_template_model_json['default_trusted_profile'] = instance_default_trusted_profile_prototype_model
- instance_template_prototype_instance_template_by_source_template_model_json['keys'] = [key_identity_model]
- instance_template_prototype_instance_template_by_source_template_model_json['metadata_service'] = instance_metadata_service_prototype_model
- instance_template_prototype_instance_template_by_source_template_model_json['name'] = 'my-instance'
- instance_template_prototype_instance_template_by_source_template_model_json['placement_target'] = instance_placement_target_prototype_model
- instance_template_prototype_instance_template_by_source_template_model_json['profile'] = instance_profile_identity_model
- instance_template_prototype_instance_template_by_source_template_model_json['resource_group'] = resource_group_identity_model
- instance_template_prototype_instance_template_by_source_template_model_json['total_volume_bandwidth'] = 500
- instance_template_prototype_instance_template_by_source_template_model_json['user_data'] = 'testString'
- instance_template_prototype_instance_template_by_source_template_model_json['volume_attachments'] = [volume_attachment_prototype_model]
- instance_template_prototype_instance_template_by_source_template_model_json['vpc'] = vpc_identity_model
- instance_template_prototype_instance_template_by_source_template_model_json['boot_volume_attachment'] = volume_attachment_prototype_instance_by_image_context_model
- instance_template_prototype_instance_template_by_source_template_model_json['catalog_offering'] = instance_catalog_offering_prototype_model
- instance_template_prototype_instance_template_by_source_template_model_json['image'] = image_identity_model
- instance_template_prototype_instance_template_by_source_template_model_json['network_interfaces'] = [network_interface_prototype_model]
- instance_template_prototype_instance_template_by_source_template_model_json['primary_network_interface'] = network_interface_prototype_model
- instance_template_prototype_instance_template_by_source_template_model_json['source_template'] = instance_template_identity_model
- instance_template_prototype_instance_template_by_source_template_model_json['zone'] = zone_identity_model
+ security_group_rule_remote_prototype_model = {} # SecurityGroupRuleRemotePrototypeIP
+ security_group_rule_remote_prototype_model['address'] = '192.168.3.4'
- # Construct a model instance of InstanceTemplatePrototypeInstanceTemplateBySourceTemplate by calling from_dict on the json representation
- instance_template_prototype_instance_template_by_source_template_model = InstanceTemplatePrototypeInstanceTemplateBySourceTemplate.from_dict(instance_template_prototype_instance_template_by_source_template_model_json)
- assert instance_template_prototype_instance_template_by_source_template_model != False
+ # Construct a json representation of a SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll model
+ security_group_rule_prototype_security_group_rule_protocol_all_model_json = {}
+ security_group_rule_prototype_security_group_rule_protocol_all_model_json['direction'] = 'inbound'
+ security_group_rule_prototype_security_group_rule_protocol_all_model_json['ip_version'] = 'ipv4'
+ security_group_rule_prototype_security_group_rule_protocol_all_model_json['protocol'] = 'all'
+ security_group_rule_prototype_security_group_rule_protocol_all_model_json['remote'] = security_group_rule_remote_prototype_model
- # Construct a model instance of InstanceTemplatePrototypeInstanceTemplateBySourceTemplate by calling from_dict on the json representation
- instance_template_prototype_instance_template_by_source_template_model_dict = InstanceTemplatePrototypeInstanceTemplateBySourceTemplate.from_dict(instance_template_prototype_instance_template_by_source_template_model_json).__dict__
- instance_template_prototype_instance_template_by_source_template_model2 = InstanceTemplatePrototypeInstanceTemplateBySourceTemplate(**instance_template_prototype_instance_template_by_source_template_model_dict)
+ # Construct a model instance of SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll by calling from_dict on the json representation
+ security_group_rule_prototype_security_group_rule_protocol_all_model = SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll.from_dict(security_group_rule_prototype_security_group_rule_protocol_all_model_json)
+ assert security_group_rule_prototype_security_group_rule_protocol_all_model != False
+
+ # Construct a model instance of SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll by calling from_dict on the json representation
+ security_group_rule_prototype_security_group_rule_protocol_all_model_dict = SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll.from_dict(security_group_rule_prototype_security_group_rule_protocol_all_model_json).__dict__
+ security_group_rule_prototype_security_group_rule_protocol_all_model2 = SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll(**security_group_rule_prototype_security_group_rule_protocol_all_model_dict)
# Verify the model instances are equivalent
- assert instance_template_prototype_instance_template_by_source_template_model == instance_template_prototype_instance_template_by_source_template_model2
+ assert security_group_rule_prototype_security_group_rule_protocol_all_model == security_group_rule_prototype_security_group_rule_protocol_all_model2
# Convert model instance back to dict and verify no loss of data
- instance_template_prototype_instance_template_by_source_template_model_json2 = instance_template_prototype_instance_template_by_source_template_model.to_dict()
- assert instance_template_prototype_instance_template_by_source_template_model_json2 == instance_template_prototype_instance_template_by_source_template_model_json
+ security_group_rule_prototype_security_group_rule_protocol_all_model_json2 = security_group_rule_prototype_security_group_rule_protocol_all_model.to_dict()
+ assert security_group_rule_prototype_security_group_rule_protocol_all_model_json2 == security_group_rule_prototype_security_group_rule_protocol_all_model_json
-class TestModel_InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext:
+class TestModel_SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP:
"""
- Test Class for InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext
+ Test Class for SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP
"""
- def test_instance_template_instance_by_catalog_offering_instance_template_context_serialization(self):
+ def test_security_group_rule_prototype_security_group_rule_protocol_icmp_serialization(self):
"""
- Test serialization/deserialization for InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext
+ Test serialization/deserialization for SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP
"""
# Construct dict forms of any model objects needed in order to build this model.
- instance_availability_policy_prototype_model = {} # InstanceAvailabilityPolicyPrototype
- instance_availability_policy_prototype_model['host_failure'] = 'restart'
-
- trusted_profile_identity_model = {} # TrustedProfileIdentityTrustedProfileById
- trusted_profile_identity_model['id'] = 'Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5'
-
- instance_default_trusted_profile_prototype_model = {} # InstanceDefaultTrustedProfilePrototype
- instance_default_trusted_profile_prototype_model['auto_link'] = False
- instance_default_trusted_profile_prototype_model['target'] = trusted_profile_identity_model
-
- key_identity_model = {} # KeyIdentityById
- key_identity_model['id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803'
-
- instance_metadata_service_prototype_model = {} # InstanceMetadataServicePrototype
- instance_metadata_service_prototype_model['enabled'] = False
- instance_metadata_service_prototype_model['protocol'] = 'https'
- instance_metadata_service_prototype_model['response_hop_limit'] = 2
+ security_group_rule_remote_prototype_model = {} # SecurityGroupRuleRemotePrototypeIP
+ security_group_rule_remote_prototype_model['address'] = '192.168.3.4'
- instance_placement_target_prototype_model = {} # InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById
- instance_placement_target_prototype_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
+ # Construct a json representation of a SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP model
+ security_group_rule_prototype_security_group_rule_protocol_icmp_model_json = {}
+ security_group_rule_prototype_security_group_rule_protocol_icmp_model_json['code'] = 0
+ security_group_rule_prototype_security_group_rule_protocol_icmp_model_json['direction'] = 'inbound'
+ security_group_rule_prototype_security_group_rule_protocol_icmp_model_json['ip_version'] = 'ipv4'
+ security_group_rule_prototype_security_group_rule_protocol_icmp_model_json['protocol'] = 'icmp'
+ security_group_rule_prototype_security_group_rule_protocol_icmp_model_json['remote'] = security_group_rule_remote_prototype_model
+ security_group_rule_prototype_security_group_rule_protocol_icmp_model_json['type'] = 8
- instance_profile_identity_model = {} # InstanceProfileIdentityByName
- instance_profile_identity_model['name'] = 'cx2-16x32'
+ # Construct a model instance of SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP by calling from_dict on the json representation
+ security_group_rule_prototype_security_group_rule_protocol_icmp_model = SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP.from_dict(security_group_rule_prototype_security_group_rule_protocol_icmp_model_json)
+ assert security_group_rule_prototype_security_group_rule_protocol_icmp_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 SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP by calling from_dict on the json representation
+ security_group_rule_prototype_security_group_rule_protocol_icmp_model_dict = SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP.from_dict(security_group_rule_prototype_security_group_rule_protocol_icmp_model_json).__dict__
+ security_group_rule_prototype_security_group_rule_protocol_icmp_model2 = SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP(**security_group_rule_prototype_security_group_rule_protocol_icmp_model_dict)
- volume_attachment_prototype_volume_model = {} # VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById
- volume_attachment_prototype_volume_model['id'] = '1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
+ # Verify the model instances are equivalent
+ assert security_group_rule_prototype_security_group_rule_protocol_icmp_model == security_group_rule_prototype_security_group_rule_protocol_icmp_model2
- volume_attachment_prototype_model = {} # VolumeAttachmentPrototype
- volume_attachment_prototype_model['delete_volume_on_instance_delete'] = False
- volume_attachment_prototype_model['name'] = 'my-volume-attachment'
- volume_attachment_prototype_model['volume'] = volume_attachment_prototype_volume_model
+ # Convert model instance back to dict and verify no loss of data
+ security_group_rule_prototype_security_group_rule_protocol_icmp_model_json2 = security_group_rule_prototype_security_group_rule_protocol_icmp_model.to_dict()
+ assert security_group_rule_prototype_security_group_rule_protocol_icmp_model_json2 == security_group_rule_prototype_security_group_rule_protocol_icmp_model_json
- vpc_identity_model = {} # VPCIdentityById
- vpc_identity_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b'
- encryption_key_identity_model = {} # EncryptionKeyIdentityByCRN
- encryption_key_identity_model['crn'] = 'crn:v1:bluemix:public:kms:us-south:a/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179'
+class TestModel_SecurityGroupRulePrototypeSecurityGroupRuleProtocolTCPUDP:
+ """
+ Test Class for SecurityGroupRulePrototypeSecurityGroupRuleProtocolTCPUDP
+ """
- volume_profile_identity_model = {} # VolumeProfileIdentityByName
- volume_profile_identity_model['name'] = 'general-purpose'
+ def test_security_group_rule_prototype_security_group_rule_protocol_tcpudp_serialization(self):
+ """
+ Test serialization/deserialization for SecurityGroupRulePrototypeSecurityGroupRuleProtocolTCPUDP
+ """
- resource_group_identity_model = {} # ResourceGroupIdentityById
- resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
+ # Construct dict forms of any model objects needed in order to build this model.
- volume_prototype_instance_by_image_context_model = {} # VolumePrototypeInstanceByImageContext
- volume_prototype_instance_by_image_context_model['capacity'] = 100
- volume_prototype_instance_by_image_context_model['encryption_key'] = encryption_key_identity_model
- volume_prototype_instance_by_image_context_model['iops'] = 10000
- volume_prototype_instance_by_image_context_model['name'] = 'my-volume'
- volume_prototype_instance_by_image_context_model['profile'] = volume_profile_identity_model
- volume_prototype_instance_by_image_context_model['resource_group'] = resource_group_identity_model
- volume_prototype_instance_by_image_context_model['user_tags'] = []
+ security_group_rule_remote_prototype_model = {} # SecurityGroupRuleRemotePrototypeIP
+ security_group_rule_remote_prototype_model['address'] = '192.168.3.4'
- 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
+ # Construct a json representation of a SecurityGroupRulePrototypeSecurityGroupRuleProtocolTCPUDP model
+ security_group_rule_prototype_security_group_rule_protocol_tcpudp_model_json = {}
+ security_group_rule_prototype_security_group_rule_protocol_tcpudp_model_json['direction'] = 'inbound'
+ security_group_rule_prototype_security_group_rule_protocol_tcpudp_model_json['ip_version'] = 'ipv4'
+ security_group_rule_prototype_security_group_rule_protocol_tcpudp_model_json['port_max'] = 22
+ security_group_rule_prototype_security_group_rule_protocol_tcpudp_model_json['port_min'] = 22
+ security_group_rule_prototype_security_group_rule_protocol_tcpudp_model_json['protocol'] = 'udp'
+ security_group_rule_prototype_security_group_rule_protocol_tcpudp_model_json['remote'] = security_group_rule_remote_prototype_model
- catalog_offering_identity_model = {} # CatalogOfferingIdentityCatalogOfferingByCRN
- catalog_offering_identity_model['crn'] = 'crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:offering:00111601-0ec5-41ac-b142-96d1e64e6442'
+ # Construct a model instance of SecurityGroupRulePrototypeSecurityGroupRuleProtocolTCPUDP by calling from_dict on the json representation
+ security_group_rule_prototype_security_group_rule_protocol_tcpudp_model = SecurityGroupRulePrototypeSecurityGroupRuleProtocolTCPUDP.from_dict(security_group_rule_prototype_security_group_rule_protocol_tcpudp_model_json)
+ assert security_group_rule_prototype_security_group_rule_protocol_tcpudp_model != False
- instance_catalog_offering_prototype_model = {} # InstanceCatalogOfferingPrototypeCatalogOfferingByOffering
- instance_catalog_offering_prototype_model['offering'] = catalog_offering_identity_model
+ # Construct a model instance of SecurityGroupRulePrototypeSecurityGroupRuleProtocolTCPUDP by calling from_dict on the json representation
+ security_group_rule_prototype_security_group_rule_protocol_tcpudp_model_dict = SecurityGroupRulePrototypeSecurityGroupRuleProtocolTCPUDP.from_dict(security_group_rule_prototype_security_group_rule_protocol_tcpudp_model_json).__dict__
+ security_group_rule_prototype_security_group_rule_protocol_tcpudp_model2 = SecurityGroupRulePrototypeSecurityGroupRuleProtocolTCPUDP(**security_group_rule_prototype_security_group_rule_protocol_tcpudp_model_dict)
- network_interface_ip_prototype_model = {} # NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext
- network_interface_ip_prototype_model['address'] = '10.0.0.5'
- network_interface_ip_prototype_model['auto_delete'] = False
- network_interface_ip_prototype_model['name'] = 'my-reserved-ip'
+ # Verify the model instances are equivalent
+ assert security_group_rule_prototype_security_group_rule_protocol_tcpudp_model == security_group_rule_prototype_security_group_rule_protocol_tcpudp_model2
- security_group_identity_model = {} # SecurityGroupIdentityById
- security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271'
+ # Convert model instance back to dict and verify no loss of data
+ security_group_rule_prototype_security_group_rule_protocol_tcpudp_model_json2 = security_group_rule_prototype_security_group_rule_protocol_tcpudp_model.to_dict()
+ assert security_group_rule_prototype_security_group_rule_protocol_tcpudp_model_json2 == security_group_rule_prototype_security_group_rule_protocol_tcpudp_model_json
- 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-instance-network-interface'
- network_interface_prototype_model['primary_ip'] = network_interface_ip_prototype_model
- network_interface_prototype_model['security_groups'] = [security_group_identity_model]
- network_interface_prototype_model['subnet'] = subnet_identity_model
+class TestModel_SecurityGroupRuleRemotePatchCIDR:
+ """
+ Test Class for SecurityGroupRuleRemotePatchCIDR
+ """
- zone_identity_model = {} # ZoneIdentityByName
- zone_identity_model['name'] = 'us-south-1'
+ def test_security_group_rule_remote_patch_cidr_serialization(self):
+ """
+ Test serialization/deserialization for SecurityGroupRuleRemotePatchCIDR
+ """
- # Construct a json representation of a InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext model
- instance_template_instance_by_catalog_offering_instance_template_context_model_json = {}
- instance_template_instance_by_catalog_offering_instance_template_context_model_json['availability_policy'] = instance_availability_policy_prototype_model
- instance_template_instance_by_catalog_offering_instance_template_context_model_json['created_at'] = '2019-01-01T12:00:00Z'
- instance_template_instance_by_catalog_offering_instance_template_context_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a'
- instance_template_instance_by_catalog_offering_instance_template_context_model_json['default_trusted_profile'] = instance_default_trusted_profile_prototype_model
- instance_template_instance_by_catalog_offering_instance_template_context_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a'
- instance_template_instance_by_catalog_offering_instance_template_context_model_json['id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803'
- instance_template_instance_by_catalog_offering_instance_template_context_model_json['keys'] = [key_identity_model]
- instance_template_instance_by_catalog_offering_instance_template_context_model_json['metadata_service'] = instance_metadata_service_prototype_model
- instance_template_instance_by_catalog_offering_instance_template_context_model_json['name'] = 'my-instance-template'
- instance_template_instance_by_catalog_offering_instance_template_context_model_json['placement_target'] = instance_placement_target_prototype_model
- instance_template_instance_by_catalog_offering_instance_template_context_model_json['profile'] = instance_profile_identity_model
- instance_template_instance_by_catalog_offering_instance_template_context_model_json['resource_group'] = resource_group_reference_model
- instance_template_instance_by_catalog_offering_instance_template_context_model_json['total_volume_bandwidth'] = 500
- instance_template_instance_by_catalog_offering_instance_template_context_model_json['user_data'] = 'testString'
- instance_template_instance_by_catalog_offering_instance_template_context_model_json['volume_attachments'] = [volume_attachment_prototype_model]
- instance_template_instance_by_catalog_offering_instance_template_context_model_json['vpc'] = vpc_identity_model
- instance_template_instance_by_catalog_offering_instance_template_context_model_json['boot_volume_attachment'] = volume_attachment_prototype_instance_by_image_context_model
- instance_template_instance_by_catalog_offering_instance_template_context_model_json['catalog_offering'] = instance_catalog_offering_prototype_model
- instance_template_instance_by_catalog_offering_instance_template_context_model_json['network_interfaces'] = [network_interface_prototype_model]
- instance_template_instance_by_catalog_offering_instance_template_context_model_json['primary_network_interface'] = network_interface_prototype_model
- instance_template_instance_by_catalog_offering_instance_template_context_model_json['zone'] = zone_identity_model
+ # Construct a json representation of a SecurityGroupRuleRemotePatchCIDR model
+ security_group_rule_remote_patch_cidr_model_json = {}
+ security_group_rule_remote_patch_cidr_model_json['cidr_block'] = '192.168.3.0/24'
- # Construct a model instance of InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext by calling from_dict on the json representation
- instance_template_instance_by_catalog_offering_instance_template_context_model = InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext.from_dict(instance_template_instance_by_catalog_offering_instance_template_context_model_json)
- assert instance_template_instance_by_catalog_offering_instance_template_context_model != False
+ # Construct a model instance of SecurityGroupRuleRemotePatchCIDR by calling from_dict on the json representation
+ security_group_rule_remote_patch_cidr_model = SecurityGroupRuleRemotePatchCIDR.from_dict(security_group_rule_remote_patch_cidr_model_json)
+ assert security_group_rule_remote_patch_cidr_model != False
- # Construct a model instance of InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext by calling from_dict on the json representation
- instance_template_instance_by_catalog_offering_instance_template_context_model_dict = InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext.from_dict(instance_template_instance_by_catalog_offering_instance_template_context_model_json).__dict__
- instance_template_instance_by_catalog_offering_instance_template_context_model2 = InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext(**instance_template_instance_by_catalog_offering_instance_template_context_model_dict)
+ # Construct a model instance of SecurityGroupRuleRemotePatchCIDR by calling from_dict on the json representation
+ security_group_rule_remote_patch_cidr_model_dict = SecurityGroupRuleRemotePatchCIDR.from_dict(security_group_rule_remote_patch_cidr_model_json).__dict__
+ security_group_rule_remote_patch_cidr_model2 = SecurityGroupRuleRemotePatchCIDR(**security_group_rule_remote_patch_cidr_model_dict)
# Verify the model instances are equivalent
- assert instance_template_instance_by_catalog_offering_instance_template_context_model == instance_template_instance_by_catalog_offering_instance_template_context_model2
+ assert security_group_rule_remote_patch_cidr_model == security_group_rule_remote_patch_cidr_model2
# Convert model instance back to dict and verify no loss of data
- instance_template_instance_by_catalog_offering_instance_template_context_model_json2 = instance_template_instance_by_catalog_offering_instance_template_context_model.to_dict()
- assert instance_template_instance_by_catalog_offering_instance_template_context_model_json2 == instance_template_instance_by_catalog_offering_instance_template_context_model_json
+ security_group_rule_remote_patch_cidr_model_json2 = security_group_rule_remote_patch_cidr_model.to_dict()
+ assert security_group_rule_remote_patch_cidr_model_json2 == security_group_rule_remote_patch_cidr_model_json
-class TestModel_InstanceTemplateInstanceByImageInstanceTemplateContext:
+class TestModel_SecurityGroupRuleRemotePatchIP:
"""
- Test Class for InstanceTemplateInstanceByImageInstanceTemplateContext
+ Test Class for SecurityGroupRuleRemotePatchIP
"""
- def test_instance_template_instance_by_image_instance_template_context_serialization(self):
+ def test_security_group_rule_remote_patch_ip_serialization(self):
"""
- Test serialization/deserialization for InstanceTemplateInstanceByImageInstanceTemplateContext
+ Test serialization/deserialization for SecurityGroupRuleRemotePatchIP
"""
- # Construct dict forms of any model objects needed in order to build this model.
+ # Construct a json representation of a SecurityGroupRuleRemotePatchIP model
+ security_group_rule_remote_patch_ip_model_json = {}
+ security_group_rule_remote_patch_ip_model_json['address'] = '192.168.3.4'
- instance_availability_policy_prototype_model = {} # InstanceAvailabilityPolicyPrototype
- instance_availability_policy_prototype_model['host_failure'] = 'restart'
+ # Construct a model instance of SecurityGroupRuleRemotePatchIP by calling from_dict on the json representation
+ security_group_rule_remote_patch_ip_model = SecurityGroupRuleRemotePatchIP.from_dict(security_group_rule_remote_patch_ip_model_json)
+ assert security_group_rule_remote_patch_ip_model != False
- trusted_profile_identity_model = {} # TrustedProfileIdentityTrustedProfileById
- trusted_profile_identity_model['id'] = 'Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5'
+ # Construct a model instance of SecurityGroupRuleRemotePatchIP by calling from_dict on the json representation
+ security_group_rule_remote_patch_ip_model_dict = SecurityGroupRuleRemotePatchIP.from_dict(security_group_rule_remote_patch_ip_model_json).__dict__
+ security_group_rule_remote_patch_ip_model2 = SecurityGroupRuleRemotePatchIP(**security_group_rule_remote_patch_ip_model_dict)
- instance_default_trusted_profile_prototype_model = {} # InstanceDefaultTrustedProfilePrototype
- instance_default_trusted_profile_prototype_model['auto_link'] = False
- instance_default_trusted_profile_prototype_model['target'] = trusted_profile_identity_model
+ # Verify the model instances are equivalent
+ assert security_group_rule_remote_patch_ip_model == security_group_rule_remote_patch_ip_model2
- key_identity_model = {} # KeyIdentityById
- key_identity_model['id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803'
+ # Convert model instance back to dict and verify no loss of data
+ security_group_rule_remote_patch_ip_model_json2 = security_group_rule_remote_patch_ip_model.to_dict()
+ assert security_group_rule_remote_patch_ip_model_json2 == security_group_rule_remote_patch_ip_model_json
- instance_metadata_service_prototype_model = {} # InstanceMetadataServicePrototype
- instance_metadata_service_prototype_model['enabled'] = False
- instance_metadata_service_prototype_model['protocol'] = 'https'
- instance_metadata_service_prototype_model['response_hop_limit'] = 2
- instance_placement_target_prototype_model = {} # InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById
- instance_placement_target_prototype_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
+class TestModel_SecurityGroupRuleRemotePrototypeCIDR:
+ """
+ Test Class for SecurityGroupRuleRemotePrototypeCIDR
+ """
- instance_profile_identity_model = {} # InstanceProfileIdentityByName
- instance_profile_identity_model['name'] = 'cx2-16x32'
+ def test_security_group_rule_remote_prototype_cidr_serialization(self):
+ """
+ Test serialization/deserialization for SecurityGroupRuleRemotePrototypeCIDR
+ """
- 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 SecurityGroupRuleRemotePrototypeCIDR model
+ security_group_rule_remote_prototype_cidr_model_json = {}
+ security_group_rule_remote_prototype_cidr_model_json['cidr_block'] = '192.168.3.0/24'
- volume_attachment_prototype_volume_model = {} # VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById
- volume_attachment_prototype_volume_model['id'] = '1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
+ # Construct a model instance of SecurityGroupRuleRemotePrototypeCIDR by calling from_dict on the json representation
+ security_group_rule_remote_prototype_cidr_model = SecurityGroupRuleRemotePrototypeCIDR.from_dict(security_group_rule_remote_prototype_cidr_model_json)
+ assert security_group_rule_remote_prototype_cidr_model != False
- volume_attachment_prototype_model = {} # VolumeAttachmentPrototype
- volume_attachment_prototype_model['delete_volume_on_instance_delete'] = False
- volume_attachment_prototype_model['name'] = 'my-volume-attachment'
- volume_attachment_prototype_model['volume'] = volume_attachment_prototype_volume_model
+ # Construct a model instance of SecurityGroupRuleRemotePrototypeCIDR by calling from_dict on the json representation
+ security_group_rule_remote_prototype_cidr_model_dict = SecurityGroupRuleRemotePrototypeCIDR.from_dict(security_group_rule_remote_prototype_cidr_model_json).__dict__
+ security_group_rule_remote_prototype_cidr_model2 = SecurityGroupRuleRemotePrototypeCIDR(**security_group_rule_remote_prototype_cidr_model_dict)
- vpc_identity_model = {} # VPCIdentityById
- vpc_identity_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b'
+ # Verify the model instances are equivalent
+ assert security_group_rule_remote_prototype_cidr_model == security_group_rule_remote_prototype_cidr_model2
- encryption_key_identity_model = {} # EncryptionKeyIdentityByCRN
- encryption_key_identity_model['crn'] = 'crn:v1:bluemix:public:kms:us-south:a/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179'
+ # Convert model instance back to dict and verify no loss of data
+ security_group_rule_remote_prototype_cidr_model_json2 = security_group_rule_remote_prototype_cidr_model.to_dict()
+ assert security_group_rule_remote_prototype_cidr_model_json2 == security_group_rule_remote_prototype_cidr_model_json
- volume_profile_identity_model = {} # VolumeProfileIdentityByName
- volume_profile_identity_model['name'] = 'general-purpose'
- resource_group_identity_model = {} # ResourceGroupIdentityById
- resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
+class TestModel_SecurityGroupRuleRemotePrototypeIP:
+ """
+ Test Class for SecurityGroupRuleRemotePrototypeIP
+ """
- volume_prototype_instance_by_image_context_model = {} # VolumePrototypeInstanceByImageContext
- volume_prototype_instance_by_image_context_model['capacity'] = 100
- volume_prototype_instance_by_image_context_model['encryption_key'] = encryption_key_identity_model
- volume_prototype_instance_by_image_context_model['iops'] = 10000
- volume_prototype_instance_by_image_context_model['name'] = 'my-volume'
- volume_prototype_instance_by_image_context_model['profile'] = volume_profile_identity_model
- volume_prototype_instance_by_image_context_model['resource_group'] = resource_group_identity_model
- volume_prototype_instance_by_image_context_model['user_tags'] = []
+ def test_security_group_rule_remote_prototype_ip_serialization(self):
+ """
+ Test serialization/deserialization for SecurityGroupRuleRemotePrototypeIP
+ """
- 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
+ # Construct a json representation of a SecurityGroupRuleRemotePrototypeIP model
+ security_group_rule_remote_prototype_ip_model_json = {}
+ security_group_rule_remote_prototype_ip_model_json['address'] = '192.168.3.4'
- image_identity_model = {} # ImageIdentityById
- image_identity_model['id'] = 'r006-02c73baf-9abb-493d-9e41-d0f1866f4051'
+ # Construct a model instance of SecurityGroupRuleRemotePrototypeIP by calling from_dict on the json representation
+ security_group_rule_remote_prototype_ip_model = SecurityGroupRuleRemotePrototypeIP.from_dict(security_group_rule_remote_prototype_ip_model_json)
+ assert security_group_rule_remote_prototype_ip_model != False
- network_interface_ip_prototype_model = {} # NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext
- network_interface_ip_prototype_model['address'] = '10.0.0.5'
- network_interface_ip_prototype_model['auto_delete'] = False
- network_interface_ip_prototype_model['name'] = 'my-reserved-ip'
+ # Construct a model instance of SecurityGroupRuleRemotePrototypeIP by calling from_dict on the json representation
+ security_group_rule_remote_prototype_ip_model_dict = SecurityGroupRuleRemotePrototypeIP.from_dict(security_group_rule_remote_prototype_ip_model_json).__dict__
+ security_group_rule_remote_prototype_ip_model2 = SecurityGroupRuleRemotePrototypeIP(**security_group_rule_remote_prototype_ip_model_dict)
- security_group_identity_model = {} # SecurityGroupIdentityById
- security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271'
+ # Verify the model instances are equivalent
+ assert security_group_rule_remote_prototype_ip_model == security_group_rule_remote_prototype_ip_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
+ security_group_rule_remote_prototype_ip_model_json2 = security_group_rule_remote_prototype_ip_model.to_dict()
+ assert security_group_rule_remote_prototype_ip_model_json2 == security_group_rule_remote_prototype_ip_model_json
- network_interface_prototype_model = {} # NetworkInterfacePrototype
- network_interface_prototype_model['allow_ip_spoofing'] = True
- network_interface_prototype_model['name'] = 'my-instance-network-interface'
- network_interface_prototype_model['primary_ip'] = network_interface_ip_prototype_model
- network_interface_prototype_model['security_groups'] = [security_group_identity_model]
- network_interface_prototype_model['subnet'] = subnet_identity_model
- zone_identity_model = {} # ZoneIdentityByName
- zone_identity_model['name'] = 'us-south-1'
+class TestModel_SecurityGroupRuleRemoteCIDR:
+ """
+ Test Class for SecurityGroupRuleRemoteCIDR
+ """
+
+ def test_security_group_rule_remote_cidr_serialization(self):
+ """
+ Test serialization/deserialization for SecurityGroupRuleRemoteCIDR
+ """
- # Construct a json representation of a InstanceTemplateInstanceByImageInstanceTemplateContext model
- instance_template_instance_by_image_instance_template_context_model_json = {}
- instance_template_instance_by_image_instance_template_context_model_json['availability_policy'] = instance_availability_policy_prototype_model
- instance_template_instance_by_image_instance_template_context_model_json['created_at'] = '2019-01-01T12:00:00Z'
- instance_template_instance_by_image_instance_template_context_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a'
- instance_template_instance_by_image_instance_template_context_model_json['default_trusted_profile'] = instance_default_trusted_profile_prototype_model
- instance_template_instance_by_image_instance_template_context_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a'
- instance_template_instance_by_image_instance_template_context_model_json['id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803'
- instance_template_instance_by_image_instance_template_context_model_json['keys'] = [key_identity_model]
- instance_template_instance_by_image_instance_template_context_model_json['metadata_service'] = instance_metadata_service_prototype_model
- instance_template_instance_by_image_instance_template_context_model_json['name'] = 'my-instance-template'
- instance_template_instance_by_image_instance_template_context_model_json['placement_target'] = instance_placement_target_prototype_model
- instance_template_instance_by_image_instance_template_context_model_json['profile'] = instance_profile_identity_model
- instance_template_instance_by_image_instance_template_context_model_json['resource_group'] = resource_group_reference_model
- instance_template_instance_by_image_instance_template_context_model_json['total_volume_bandwidth'] = 500
- instance_template_instance_by_image_instance_template_context_model_json['user_data'] = 'testString'
- instance_template_instance_by_image_instance_template_context_model_json['volume_attachments'] = [volume_attachment_prototype_model]
- instance_template_instance_by_image_instance_template_context_model_json['vpc'] = vpc_identity_model
- instance_template_instance_by_image_instance_template_context_model_json['boot_volume_attachment'] = volume_attachment_prototype_instance_by_image_context_model
- instance_template_instance_by_image_instance_template_context_model_json['image'] = image_identity_model
- instance_template_instance_by_image_instance_template_context_model_json['network_interfaces'] = [network_interface_prototype_model]
- instance_template_instance_by_image_instance_template_context_model_json['primary_network_interface'] = network_interface_prototype_model
- instance_template_instance_by_image_instance_template_context_model_json['zone'] = zone_identity_model
+ # Construct a json representation of a SecurityGroupRuleRemoteCIDR model
+ security_group_rule_remote_cidr_model_json = {}
+ security_group_rule_remote_cidr_model_json['cidr_block'] = '192.168.3.0/24'
- # Construct a model instance of InstanceTemplateInstanceByImageInstanceTemplateContext by calling from_dict on the json representation
- instance_template_instance_by_image_instance_template_context_model = InstanceTemplateInstanceByImageInstanceTemplateContext.from_dict(instance_template_instance_by_image_instance_template_context_model_json)
- assert instance_template_instance_by_image_instance_template_context_model != False
+ # Construct a model instance of SecurityGroupRuleRemoteCIDR by calling from_dict on the json representation
+ security_group_rule_remote_cidr_model = SecurityGroupRuleRemoteCIDR.from_dict(security_group_rule_remote_cidr_model_json)
+ assert security_group_rule_remote_cidr_model != False
- # Construct a model instance of InstanceTemplateInstanceByImageInstanceTemplateContext by calling from_dict on the json representation
- instance_template_instance_by_image_instance_template_context_model_dict = InstanceTemplateInstanceByImageInstanceTemplateContext.from_dict(instance_template_instance_by_image_instance_template_context_model_json).__dict__
- instance_template_instance_by_image_instance_template_context_model2 = InstanceTemplateInstanceByImageInstanceTemplateContext(**instance_template_instance_by_image_instance_template_context_model_dict)
+ # Construct a model instance of SecurityGroupRuleRemoteCIDR by calling from_dict on the json representation
+ security_group_rule_remote_cidr_model_dict = SecurityGroupRuleRemoteCIDR.from_dict(security_group_rule_remote_cidr_model_json).__dict__
+ security_group_rule_remote_cidr_model2 = SecurityGroupRuleRemoteCIDR(**security_group_rule_remote_cidr_model_dict)
# Verify the model instances are equivalent
- assert instance_template_instance_by_image_instance_template_context_model == instance_template_instance_by_image_instance_template_context_model2
+ assert security_group_rule_remote_cidr_model == security_group_rule_remote_cidr_model2
# Convert model instance back to dict and verify no loss of data
- instance_template_instance_by_image_instance_template_context_model_json2 = instance_template_instance_by_image_instance_template_context_model.to_dict()
- assert instance_template_instance_by_image_instance_template_context_model_json2 == instance_template_instance_by_image_instance_template_context_model_json
+ security_group_rule_remote_cidr_model_json2 = security_group_rule_remote_cidr_model.to_dict()
+ assert security_group_rule_remote_cidr_model_json2 == security_group_rule_remote_cidr_model_json
-class TestModel_InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext:
+class TestModel_SecurityGroupRuleRemoteIP:
"""
- Test Class for InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext
+ Test Class for SecurityGroupRuleRemoteIP
"""
- def test_instance_template_instance_by_source_snapshot_instance_template_context_serialization(self):
+ def test_security_group_rule_remote_ip_serialization(self):
"""
- Test serialization/deserialization for InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext
+ Test serialization/deserialization for SecurityGroupRuleRemoteIP
"""
- # Construct dict forms of any model objects needed in order to build this model.
+ # Construct a json representation of a SecurityGroupRuleRemoteIP model
+ security_group_rule_remote_ip_model_json = {}
+ security_group_rule_remote_ip_model_json['address'] = '192.168.3.4'
- instance_availability_policy_prototype_model = {} # InstanceAvailabilityPolicyPrototype
- instance_availability_policy_prototype_model['host_failure'] = 'restart'
+ # Construct a model instance of SecurityGroupRuleRemoteIP by calling from_dict on the json representation
+ security_group_rule_remote_ip_model = SecurityGroupRuleRemoteIP.from_dict(security_group_rule_remote_ip_model_json)
+ assert security_group_rule_remote_ip_model != False
- trusted_profile_identity_model = {} # TrustedProfileIdentityTrustedProfileById
- trusted_profile_identity_model['id'] = 'Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5'
+ # Construct a model instance of SecurityGroupRuleRemoteIP by calling from_dict on the json representation
+ security_group_rule_remote_ip_model_dict = SecurityGroupRuleRemoteIP.from_dict(security_group_rule_remote_ip_model_json).__dict__
+ security_group_rule_remote_ip_model2 = SecurityGroupRuleRemoteIP(**security_group_rule_remote_ip_model_dict)
- instance_default_trusted_profile_prototype_model = {} # InstanceDefaultTrustedProfilePrototype
- instance_default_trusted_profile_prototype_model['auto_link'] = False
- instance_default_trusted_profile_prototype_model['target'] = trusted_profile_identity_model
+ # Verify the model instances are equivalent
+ assert security_group_rule_remote_ip_model == security_group_rule_remote_ip_model2
- key_identity_model = {} # KeyIdentityById
- key_identity_model['id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803'
+ # Convert model instance back to dict and verify no loss of data
+ security_group_rule_remote_ip_model_json2 = security_group_rule_remote_ip_model.to_dict()
+ assert security_group_rule_remote_ip_model_json2 == security_group_rule_remote_ip_model_json
- instance_metadata_service_prototype_model = {} # InstanceMetadataServicePrototype
- instance_metadata_service_prototype_model['enabled'] = False
- instance_metadata_service_prototype_model['protocol'] = 'https'
- instance_metadata_service_prototype_model['response_hop_limit'] = 2
- instance_placement_target_prototype_model = {} # InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById
- instance_placement_target_prototype_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
+class TestModel_SecurityGroupRuleRemoteSecurityGroupReference:
+ """
+ Test Class for SecurityGroupRuleRemoteSecurityGroupReference
+ """
- instance_profile_identity_model = {} # InstanceProfileIdentityByName
- instance_profile_identity_model['name'] = 'cx2-16x32'
+ def test_security_group_rule_remote_security_group_reference_serialization(self):
+ """
+ Test serialization/deserialization for SecurityGroupRuleRemoteSecurityGroupReference
+ """
- 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 dict forms of any model objects needed in order to build this model.
- volume_attachment_prototype_volume_model = {} # VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById
- volume_attachment_prototype_volume_model['id'] = '1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
+ security_group_reference_deleted_model = {} # SecurityGroupReferenceDeleted
+ security_group_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- volume_attachment_prototype_model = {} # VolumeAttachmentPrototype
- volume_attachment_prototype_model['delete_volume_on_instance_delete'] = False
- volume_attachment_prototype_model['name'] = 'my-volume-attachment'
- volume_attachment_prototype_model['volume'] = volume_attachment_prototype_volume_model
+ # Construct a json representation of a SecurityGroupRuleRemoteSecurityGroupReference model
+ security_group_rule_remote_security_group_reference_model_json = {}
+ security_group_rule_remote_security_group_reference_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271'
+ security_group_rule_remote_security_group_reference_model_json['deleted'] = security_group_reference_deleted_model
+ security_group_rule_remote_security_group_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271'
+ security_group_rule_remote_security_group_reference_model_json['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271'
+ security_group_rule_remote_security_group_reference_model_json['name'] = 'my-security-group'
- vpc_identity_model = {} # VPCIdentityById
- vpc_identity_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b'
+ # Construct a model instance of SecurityGroupRuleRemoteSecurityGroupReference by calling from_dict on the json representation
+ security_group_rule_remote_security_group_reference_model = SecurityGroupRuleRemoteSecurityGroupReference.from_dict(security_group_rule_remote_security_group_reference_model_json)
+ assert security_group_rule_remote_security_group_reference_model != False
- encryption_key_identity_model = {} # EncryptionKeyIdentityByCRN
- encryption_key_identity_model['crn'] = 'crn:v1:bluemix:public:kms:us-south:a/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179'
+ # Construct a model instance of SecurityGroupRuleRemoteSecurityGroupReference by calling from_dict on the json representation
+ security_group_rule_remote_security_group_reference_model_dict = SecurityGroupRuleRemoteSecurityGroupReference.from_dict(security_group_rule_remote_security_group_reference_model_json).__dict__
+ security_group_rule_remote_security_group_reference_model2 = SecurityGroupRuleRemoteSecurityGroupReference(**security_group_rule_remote_security_group_reference_model_dict)
- volume_profile_identity_model = {} # VolumeProfileIdentityByName
- volume_profile_identity_model['name'] = 'general-purpose'
+ # Verify the model instances are equivalent
+ assert security_group_rule_remote_security_group_reference_model == security_group_rule_remote_security_group_reference_model2
- resource_group_identity_model = {} # ResourceGroupIdentityById
- resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
+ # Convert model instance back to dict and verify no loss of data
+ security_group_rule_remote_security_group_reference_model_json2 = security_group_rule_remote_security_group_reference_model.to_dict()
+ assert security_group_rule_remote_security_group_reference_model_json2 == security_group_rule_remote_security_group_reference_model_json
- snapshot_identity_model = {} # SnapshotIdentityById
- snapshot_identity_model['id'] = '349a61d8-7ab1-420f-a690-5fed76ef9d4f'
- volume_prototype_instance_by_source_snapshot_context_model = {} # VolumePrototypeInstanceBySourceSnapshotContext
- volume_prototype_instance_by_source_snapshot_context_model['capacity'] = 100
- volume_prototype_instance_by_source_snapshot_context_model['encryption_key'] = encryption_key_identity_model
- volume_prototype_instance_by_source_snapshot_context_model['iops'] = 10000
- volume_prototype_instance_by_source_snapshot_context_model['name'] = 'my-volume'
- volume_prototype_instance_by_source_snapshot_context_model['profile'] = volume_profile_identity_model
- volume_prototype_instance_by_source_snapshot_context_model['resource_group'] = resource_group_identity_model
- volume_prototype_instance_by_source_snapshot_context_model['source_snapshot'] = snapshot_identity_model
- volume_prototype_instance_by_source_snapshot_context_model['user_tags'] = []
+class TestModel_SecurityGroupRuleSecurityGroupRuleProtocolAll:
+ """
+ Test Class for SecurityGroupRuleSecurityGroupRuleProtocolAll
+ """
- volume_attachment_prototype_instance_by_source_snapshot_context_model = {} # VolumeAttachmentPrototypeInstanceBySourceSnapshotContext
- volume_attachment_prototype_instance_by_source_snapshot_context_model['delete_volume_on_instance_delete'] = True
- volume_attachment_prototype_instance_by_source_snapshot_context_model['name'] = 'my-volume-attachment'
- volume_attachment_prototype_instance_by_source_snapshot_context_model['volume'] = volume_prototype_instance_by_source_snapshot_context_model
+ def test_security_group_rule_security_group_rule_protocol_all_serialization(self):
+ """
+ Test serialization/deserialization for SecurityGroupRuleSecurityGroupRuleProtocolAll
+ """
- network_interface_ip_prototype_model = {} # NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext
- network_interface_ip_prototype_model['address'] = '10.0.0.5'
- network_interface_ip_prototype_model['auto_delete'] = False
- network_interface_ip_prototype_model['name'] = 'my-reserved-ip'
+ # 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'
+ security_group_rule_remote_model = {} # SecurityGroupRuleRemoteIP
+ security_group_rule_remote_model['address'] = '192.168.3.4'
- subnet_identity_model = {} # SubnetIdentityById
- subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
+ # Construct a json representation of a SecurityGroupRuleSecurityGroupRuleProtocolAll model
+ security_group_rule_security_group_rule_protocol_all_model_json = {}
+ security_group_rule_security_group_rule_protocol_all_model_json['direction'] = 'inbound'
+ security_group_rule_security_group_rule_protocol_all_model_json['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_security_group_rule_protocol_all_model_json['id'] = '6f2a6efe-21e2-401c-b237-620aa26ba16a'
+ security_group_rule_security_group_rule_protocol_all_model_json['ip_version'] = 'ipv4'
+ security_group_rule_security_group_rule_protocol_all_model_json['remote'] = security_group_rule_remote_model
+ security_group_rule_security_group_rule_protocol_all_model_json['protocol'] = 'all'
- network_interface_prototype_model = {} # NetworkInterfacePrototype
- network_interface_prototype_model['allow_ip_spoofing'] = True
- network_interface_prototype_model['name'] = 'my-instance-network-interface'
- network_interface_prototype_model['primary_ip'] = network_interface_ip_prototype_model
- network_interface_prototype_model['security_groups'] = [security_group_identity_model]
- network_interface_prototype_model['subnet'] = subnet_identity_model
+ # Construct a model instance of SecurityGroupRuleSecurityGroupRuleProtocolAll by calling from_dict on the json representation
+ security_group_rule_security_group_rule_protocol_all_model = SecurityGroupRuleSecurityGroupRuleProtocolAll.from_dict(security_group_rule_security_group_rule_protocol_all_model_json)
+ assert security_group_rule_security_group_rule_protocol_all_model != False
- zone_identity_model = {} # ZoneIdentityByName
- zone_identity_model['name'] = 'us-south-1'
+ # Construct a model instance of SecurityGroupRuleSecurityGroupRuleProtocolAll by calling from_dict on the json representation
+ security_group_rule_security_group_rule_protocol_all_model_dict = SecurityGroupRuleSecurityGroupRuleProtocolAll.from_dict(security_group_rule_security_group_rule_protocol_all_model_json).__dict__
+ security_group_rule_security_group_rule_protocol_all_model2 = SecurityGroupRuleSecurityGroupRuleProtocolAll(**security_group_rule_security_group_rule_protocol_all_model_dict)
+
+ # Verify the model instances are equivalent
+ assert security_group_rule_security_group_rule_protocol_all_model == security_group_rule_security_group_rule_protocol_all_model2
- # Construct a json representation of a InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext model
- instance_template_instance_by_source_snapshot_instance_template_context_model_json = {}
- instance_template_instance_by_source_snapshot_instance_template_context_model_json['availability_policy'] = instance_availability_policy_prototype_model
- instance_template_instance_by_source_snapshot_instance_template_context_model_json['created_at'] = '2019-01-01T12:00:00Z'
- instance_template_instance_by_source_snapshot_instance_template_context_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a'
- instance_template_instance_by_source_snapshot_instance_template_context_model_json['default_trusted_profile'] = instance_default_trusted_profile_prototype_model
- instance_template_instance_by_source_snapshot_instance_template_context_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a'
- instance_template_instance_by_source_snapshot_instance_template_context_model_json['id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803'
- instance_template_instance_by_source_snapshot_instance_template_context_model_json['keys'] = [key_identity_model]
- instance_template_instance_by_source_snapshot_instance_template_context_model_json['metadata_service'] = instance_metadata_service_prototype_model
- instance_template_instance_by_source_snapshot_instance_template_context_model_json['name'] = 'my-instance-template'
- instance_template_instance_by_source_snapshot_instance_template_context_model_json['placement_target'] = instance_placement_target_prototype_model
- instance_template_instance_by_source_snapshot_instance_template_context_model_json['profile'] = instance_profile_identity_model
- instance_template_instance_by_source_snapshot_instance_template_context_model_json['resource_group'] = resource_group_reference_model
- instance_template_instance_by_source_snapshot_instance_template_context_model_json['total_volume_bandwidth'] = 500
- instance_template_instance_by_source_snapshot_instance_template_context_model_json['user_data'] = 'testString'
- instance_template_instance_by_source_snapshot_instance_template_context_model_json['volume_attachments'] = [volume_attachment_prototype_model]
- instance_template_instance_by_source_snapshot_instance_template_context_model_json['vpc'] = vpc_identity_model
- instance_template_instance_by_source_snapshot_instance_template_context_model_json['boot_volume_attachment'] = volume_attachment_prototype_instance_by_source_snapshot_context_model
- instance_template_instance_by_source_snapshot_instance_template_context_model_json['network_interfaces'] = [network_interface_prototype_model]
- instance_template_instance_by_source_snapshot_instance_template_context_model_json['primary_network_interface'] = network_interface_prototype_model
- instance_template_instance_by_source_snapshot_instance_template_context_model_json['zone'] = zone_identity_model
-
- # Construct a model instance of InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext by calling from_dict on the json representation
- instance_template_instance_by_source_snapshot_instance_template_context_model = InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext.from_dict(instance_template_instance_by_source_snapshot_instance_template_context_model_json)
- assert instance_template_instance_by_source_snapshot_instance_template_context_model != False
-
- # Construct a model instance of InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext by calling from_dict on the json representation
- instance_template_instance_by_source_snapshot_instance_template_context_model_dict = InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext.from_dict(instance_template_instance_by_source_snapshot_instance_template_context_model_json).__dict__
- instance_template_instance_by_source_snapshot_instance_template_context_model2 = InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext(**instance_template_instance_by_source_snapshot_instance_template_context_model_dict)
-
- # Verify the model instances are equivalent
- assert instance_template_instance_by_source_snapshot_instance_template_context_model == instance_template_instance_by_source_snapshot_instance_template_context_model2
-
- # Convert model instance back to dict and verify no loss of data
- instance_template_instance_by_source_snapshot_instance_template_context_model_json2 = instance_template_instance_by_source_snapshot_instance_template_context_model.to_dict()
- assert instance_template_instance_by_source_snapshot_instance_template_context_model_json2 == instance_template_instance_by_source_snapshot_instance_template_context_model_json
+ # Convert model instance back to dict and verify no loss of data
+ security_group_rule_security_group_rule_protocol_all_model_json2 = security_group_rule_security_group_rule_protocol_all_model.to_dict()
+ assert security_group_rule_security_group_rule_protocol_all_model_json2 == security_group_rule_security_group_rule_protocol_all_model_json
-class TestModel_KeyIdentityByCRN:
+class TestModel_SecurityGroupRuleSecurityGroupRuleProtocolICMP:
"""
- Test Class for KeyIdentityByCRN
+ Test Class for SecurityGroupRuleSecurityGroupRuleProtocolICMP
"""
- def test_key_identity_by_crn_serialization(self):
+ def test_security_group_rule_security_group_rule_protocol_icmp_serialization(self):
"""
- Test serialization/deserialization for KeyIdentityByCRN
+ Test serialization/deserialization for SecurityGroupRuleSecurityGroupRuleProtocolICMP
"""
- # Construct a json representation of a KeyIdentityByCRN model
- key_identity_by_crn_model_json = {}
- key_identity_by_crn_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::key:a6b1a881-2ce8-41a3-80fc-36316a73f803'
+ # Construct dict forms of any model objects needed in order to build this model.
- # Construct a model instance of KeyIdentityByCRN by calling from_dict on the json representation
- key_identity_by_crn_model = KeyIdentityByCRN.from_dict(key_identity_by_crn_model_json)
- assert key_identity_by_crn_model != False
+ security_group_rule_remote_model = {} # SecurityGroupRuleRemoteIP
+ security_group_rule_remote_model['address'] = '192.168.3.4'
- # Construct a model instance of KeyIdentityByCRN by calling from_dict on the json representation
- key_identity_by_crn_model_dict = KeyIdentityByCRN.from_dict(key_identity_by_crn_model_json).__dict__
- key_identity_by_crn_model2 = KeyIdentityByCRN(**key_identity_by_crn_model_dict)
+ # Construct a json representation of a SecurityGroupRuleSecurityGroupRuleProtocolICMP model
+ security_group_rule_security_group_rule_protocol_icmp_model_json = {}
+ security_group_rule_security_group_rule_protocol_icmp_model_json['direction'] = 'inbound'
+ security_group_rule_security_group_rule_protocol_icmp_model_json['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_security_group_rule_protocol_icmp_model_json['id'] = '6f2a6efe-21e2-401c-b237-620aa26ba16a'
+ security_group_rule_security_group_rule_protocol_icmp_model_json['ip_version'] = 'ipv4'
+ security_group_rule_security_group_rule_protocol_icmp_model_json['remote'] = security_group_rule_remote_model
+ security_group_rule_security_group_rule_protocol_icmp_model_json['code'] = 0
+ security_group_rule_security_group_rule_protocol_icmp_model_json['protocol'] = 'icmp'
+ security_group_rule_security_group_rule_protocol_icmp_model_json['type'] = 8
+
+ # Construct a model instance of SecurityGroupRuleSecurityGroupRuleProtocolICMP by calling from_dict on the json representation
+ security_group_rule_security_group_rule_protocol_icmp_model = SecurityGroupRuleSecurityGroupRuleProtocolICMP.from_dict(security_group_rule_security_group_rule_protocol_icmp_model_json)
+ assert security_group_rule_security_group_rule_protocol_icmp_model != False
+
+ # Construct a model instance of SecurityGroupRuleSecurityGroupRuleProtocolICMP by calling from_dict on the json representation
+ security_group_rule_security_group_rule_protocol_icmp_model_dict = SecurityGroupRuleSecurityGroupRuleProtocolICMP.from_dict(security_group_rule_security_group_rule_protocol_icmp_model_json).__dict__
+ security_group_rule_security_group_rule_protocol_icmp_model2 = SecurityGroupRuleSecurityGroupRuleProtocolICMP(**security_group_rule_security_group_rule_protocol_icmp_model_dict)
# Verify the model instances are equivalent
- assert key_identity_by_crn_model == key_identity_by_crn_model2
+ assert security_group_rule_security_group_rule_protocol_icmp_model == security_group_rule_security_group_rule_protocol_icmp_model2
# Convert model instance back to dict and verify no loss of data
- key_identity_by_crn_model_json2 = key_identity_by_crn_model.to_dict()
- assert key_identity_by_crn_model_json2 == key_identity_by_crn_model_json
+ security_group_rule_security_group_rule_protocol_icmp_model_json2 = security_group_rule_security_group_rule_protocol_icmp_model.to_dict()
+ assert security_group_rule_security_group_rule_protocol_icmp_model_json2 == security_group_rule_security_group_rule_protocol_icmp_model_json
-class TestModel_KeyIdentityByFingerprint:
+class TestModel_SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP:
"""
- Test Class for KeyIdentityByFingerprint
+ Test Class for SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP
"""
- def test_key_identity_by_fingerprint_serialization(self):
+ def test_security_group_rule_security_group_rule_protocol_tcpudp_serialization(self):
"""
- Test serialization/deserialization for KeyIdentityByFingerprint
+ Test serialization/deserialization for SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP
"""
- # Construct a json representation of a KeyIdentityByFingerprint model
- key_identity_by_fingerprint_model_json = {}
- key_identity_by_fingerprint_model_json['fingerprint'] = 'SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY'
+ # Construct dict forms of any model objects needed in order to build this model.
- # Construct a model instance of KeyIdentityByFingerprint by calling from_dict on the json representation
- key_identity_by_fingerprint_model = KeyIdentityByFingerprint.from_dict(key_identity_by_fingerprint_model_json)
- assert key_identity_by_fingerprint_model != False
+ security_group_rule_remote_model = {} # SecurityGroupRuleRemoteIP
+ security_group_rule_remote_model['address'] = '192.168.3.4'
- # Construct a model instance of KeyIdentityByFingerprint by calling from_dict on the json representation
- key_identity_by_fingerprint_model_dict = KeyIdentityByFingerprint.from_dict(key_identity_by_fingerprint_model_json).__dict__
- key_identity_by_fingerprint_model2 = KeyIdentityByFingerprint(**key_identity_by_fingerprint_model_dict)
+ # Construct a json representation of a SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP model
+ security_group_rule_security_group_rule_protocol_tcpudp_model_json = {}
+ security_group_rule_security_group_rule_protocol_tcpudp_model_json['direction'] = 'inbound'
+ security_group_rule_security_group_rule_protocol_tcpudp_model_json['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_security_group_rule_protocol_tcpudp_model_json['id'] = '6f2a6efe-21e2-401c-b237-620aa26ba16a'
+ security_group_rule_security_group_rule_protocol_tcpudp_model_json['ip_version'] = 'ipv4'
+ security_group_rule_security_group_rule_protocol_tcpudp_model_json['remote'] = security_group_rule_remote_model
+ security_group_rule_security_group_rule_protocol_tcpudp_model_json['port_max'] = 22
+ security_group_rule_security_group_rule_protocol_tcpudp_model_json['port_min'] = 22
+ security_group_rule_security_group_rule_protocol_tcpudp_model_json['protocol'] = 'udp'
+
+ # Construct a model instance of SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP by calling from_dict on the json representation
+ security_group_rule_security_group_rule_protocol_tcpudp_model = SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP.from_dict(security_group_rule_security_group_rule_protocol_tcpudp_model_json)
+ assert security_group_rule_security_group_rule_protocol_tcpudp_model != False
+
+ # Construct a model instance of SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP by calling from_dict on the json representation
+ security_group_rule_security_group_rule_protocol_tcpudp_model_dict = SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP.from_dict(security_group_rule_security_group_rule_protocol_tcpudp_model_json).__dict__
+ security_group_rule_security_group_rule_protocol_tcpudp_model2 = SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP(**security_group_rule_security_group_rule_protocol_tcpudp_model_dict)
# Verify the model instances are equivalent
- assert key_identity_by_fingerprint_model == key_identity_by_fingerprint_model2
+ assert security_group_rule_security_group_rule_protocol_tcpudp_model == security_group_rule_security_group_rule_protocol_tcpudp_model2
# Convert model instance back to dict and verify no loss of data
- key_identity_by_fingerprint_model_json2 = key_identity_by_fingerprint_model.to_dict()
- assert key_identity_by_fingerprint_model_json2 == key_identity_by_fingerprint_model_json
+ 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_KeyIdentityByHref:
+class TestModel_SecurityGroupTargetReferenceBareMetalServerNetworkInterfaceReferenceTargetContext:
"""
- Test Class for KeyIdentityByHref
+ Test Class for SecurityGroupTargetReferenceBareMetalServerNetworkInterfaceReferenceTargetContext
"""
- def test_key_identity_by_href_serialization(self):
+ def test_security_group_target_reference_bare_metal_server_network_interface_reference_target_context_serialization(self):
"""
- Test serialization/deserialization for KeyIdentityByHref
+ Test serialization/deserialization for SecurityGroupTargetReferenceBareMetalServerNetworkInterfaceReferenceTargetContext
"""
- # Construct a json representation of a KeyIdentityByHref model
- key_identity_by_href_model_json = {}
- key_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/keys/a6b1a881-2ce8-41a3-80fc-36316a73f803'
+ # Construct dict forms of any model objects needed in order to build this model.
- # Construct a model instance of KeyIdentityByHref by calling from_dict on the json representation
- key_identity_by_href_model = KeyIdentityByHref.from_dict(key_identity_by_href_model_json)
- assert key_identity_by_href_model != False
+ bare_metal_server_network_interface_reference_target_context_deleted_model = {} # BareMetalServerNetworkInterfaceReferenceTargetContextDeleted
+ bare_metal_server_network_interface_reference_target_context_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Construct a model instance of KeyIdentityByHref by calling from_dict on the json representation
- key_identity_by_href_model_dict = KeyIdentityByHref.from_dict(key_identity_by_href_model_json).__dict__
- key_identity_by_href_model2 = KeyIdentityByHref(**key_identity_by_href_model_dict)
+ # Construct a json representation of a SecurityGroupTargetReferenceBareMetalServerNetworkInterfaceReferenceTargetContext model
+ security_group_target_reference_bare_metal_server_network_interface_reference_target_context_model_json = {}
+ security_group_target_reference_bare_metal_server_network_interface_reference_target_context_model_json['deleted'] = bare_metal_server_network_interface_reference_target_context_deleted_model
+ security_group_target_reference_bare_metal_server_network_interface_reference_target_context_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e'
+ security_group_target_reference_bare_metal_server_network_interface_reference_target_context_model_json['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e'
+ security_group_target_reference_bare_metal_server_network_interface_reference_target_context_model_json['name'] = 'my-bare-metal-server-network-interface'
+ security_group_target_reference_bare_metal_server_network_interface_reference_target_context_model_json['resource_type'] = 'network_interface'
+
+ # Construct a model instance of SecurityGroupTargetReferenceBareMetalServerNetworkInterfaceReferenceTargetContext by calling from_dict on the json representation
+ security_group_target_reference_bare_metal_server_network_interface_reference_target_context_model = SecurityGroupTargetReferenceBareMetalServerNetworkInterfaceReferenceTargetContext.from_dict(security_group_target_reference_bare_metal_server_network_interface_reference_target_context_model_json)
+ assert security_group_target_reference_bare_metal_server_network_interface_reference_target_context_model != False
+
+ # Construct a model instance of SecurityGroupTargetReferenceBareMetalServerNetworkInterfaceReferenceTargetContext by calling from_dict on the json representation
+ security_group_target_reference_bare_metal_server_network_interface_reference_target_context_model_dict = SecurityGroupTargetReferenceBareMetalServerNetworkInterfaceReferenceTargetContext.from_dict(security_group_target_reference_bare_metal_server_network_interface_reference_target_context_model_json).__dict__
+ security_group_target_reference_bare_metal_server_network_interface_reference_target_context_model2 = SecurityGroupTargetReferenceBareMetalServerNetworkInterfaceReferenceTargetContext(**security_group_target_reference_bare_metal_server_network_interface_reference_target_context_model_dict)
# Verify the model instances are equivalent
- assert key_identity_by_href_model == key_identity_by_href_model2
+ assert security_group_target_reference_bare_metal_server_network_interface_reference_target_context_model == security_group_target_reference_bare_metal_server_network_interface_reference_target_context_model2
# Convert model instance back to dict and verify no loss of data
- key_identity_by_href_model_json2 = key_identity_by_href_model.to_dict()
- assert key_identity_by_href_model_json2 == key_identity_by_href_model_json
+ security_group_target_reference_bare_metal_server_network_interface_reference_target_context_model_json2 = security_group_target_reference_bare_metal_server_network_interface_reference_target_context_model.to_dict()
+ assert security_group_target_reference_bare_metal_server_network_interface_reference_target_context_model_json2 == security_group_target_reference_bare_metal_server_network_interface_reference_target_context_model_json
-class TestModel_KeyIdentityById:
+class TestModel_SecurityGroupTargetReferenceEndpointGatewayReference:
"""
- Test Class for KeyIdentityById
+ Test Class for SecurityGroupTargetReferenceEndpointGatewayReference
"""
- def test_key_identity_by_id_serialization(self):
+ def test_security_group_target_reference_endpoint_gateway_reference_serialization(self):
"""
- Test serialization/deserialization for KeyIdentityById
+ Test serialization/deserialization for SecurityGroupTargetReferenceEndpointGatewayReference
"""
- # Construct a json representation of a KeyIdentityById model
- key_identity_by_id_model_json = {}
- key_identity_by_id_model_json['id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803'
+ # Construct dict forms of any model objects needed in order to build this model.
- # Construct a model instance of KeyIdentityById by calling from_dict on the json representation
- key_identity_by_id_model = KeyIdentityById.from_dict(key_identity_by_id_model_json)
- assert key_identity_by_id_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 KeyIdentityById by calling from_dict on the json representation
- key_identity_by_id_model_dict = KeyIdentityById.from_dict(key_identity_by_id_model_json).__dict__
- key_identity_by_id_model2 = KeyIdentityById(**key_identity_by_id_model_dict)
+ # 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:r134-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/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5'
+ security_group_target_reference_endpoint_gateway_reference_model_json['id'] = 'r134-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 key_identity_by_id_model == key_identity_by_id_model2
+ 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
- key_identity_by_id_model_json2 = key_identity_by_id_model.to_dict()
- assert key_identity_by_id_model_json2 == key_identity_by_id_model_json
+ 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_LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName:
+class TestModel_SecurityGroupTargetReferenceLoadBalancerReference:
"""
- Test Class for LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName
+ Test Class for SecurityGroupTargetReferenceLoadBalancerReference
"""
- def test_legacy_cloud_object_storage_bucket_identity_cloud_object_storage_bucket_identity_by_name_serialization(self):
+ def test_security_group_target_reference_load_balancer_reference_serialization(self):
"""
- Test serialization/deserialization for LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName
+ Test serialization/deserialization for SecurityGroupTargetReferenceLoadBalancerReference
"""
- # Construct a json representation of a LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName model
- legacy_cloud_object_storage_bucket_identity_cloud_object_storage_bucket_identity_by_name_model_json = {}
- legacy_cloud_object_storage_bucket_identity_cloud_object_storage_bucket_identity_by_name_model_json['name'] = 'bucket-27200-lwx4cfvcue'
+ # Construct dict forms of any model objects needed in order to build this model.
- # Construct a model instance of LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName by calling from_dict on the json representation
- legacy_cloud_object_storage_bucket_identity_cloud_object_storage_bucket_identity_by_name_model = LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName.from_dict(legacy_cloud_object_storage_bucket_identity_cloud_object_storage_bucket_identity_by_name_model_json)
- assert legacy_cloud_object_storage_bucket_identity_cloud_object_storage_bucket_identity_by_name_model != False
+ load_balancer_reference_deleted_model = {} # LoadBalancerReferenceDeleted
+ load_balancer_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Construct a model instance of LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName by calling from_dict on the json representation
- legacy_cloud_object_storage_bucket_identity_cloud_object_storage_bucket_identity_by_name_model_dict = LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName.from_dict(legacy_cloud_object_storage_bucket_identity_cloud_object_storage_bucket_identity_by_name_model_json).__dict__
- legacy_cloud_object_storage_bucket_identity_cloud_object_storage_bucket_identity_by_name_model2 = LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName(**legacy_cloud_object_storage_bucket_identity_cloud_object_storage_bucket_identity_by_name_model_dict)
+ # Construct a json representation of a SecurityGroupTargetReferenceLoadBalancerReference model
+ security_group_target_reference_load_balancer_reference_model_json = {}
+ security_group_target_reference_load_balancer_reference_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727'
+ security_group_target_reference_load_balancer_reference_model_json['deleted'] = load_balancer_reference_deleted_model
+ security_group_target_reference_load_balancer_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727'
+ security_group_target_reference_load_balancer_reference_model_json['id'] = 'dd754295-e9e0-4c9d-bf6c-58fbc59e5727'
+ security_group_target_reference_load_balancer_reference_model_json['name'] = 'my-load-balancer'
+ security_group_target_reference_load_balancer_reference_model_json['resource_type'] = 'load_balancer'
+
+ # Construct a model instance of SecurityGroupTargetReferenceLoadBalancerReference by calling from_dict on the json representation
+ security_group_target_reference_load_balancer_reference_model = SecurityGroupTargetReferenceLoadBalancerReference.from_dict(security_group_target_reference_load_balancer_reference_model_json)
+ assert security_group_target_reference_load_balancer_reference_model != False
+
+ # Construct a model instance of SecurityGroupTargetReferenceLoadBalancerReference by calling from_dict on the json representation
+ security_group_target_reference_load_balancer_reference_model_dict = SecurityGroupTargetReferenceLoadBalancerReference.from_dict(security_group_target_reference_load_balancer_reference_model_json).__dict__
+ security_group_target_reference_load_balancer_reference_model2 = SecurityGroupTargetReferenceLoadBalancerReference(**security_group_target_reference_load_balancer_reference_model_dict)
# Verify the model instances are equivalent
- assert legacy_cloud_object_storage_bucket_identity_cloud_object_storage_bucket_identity_by_name_model == legacy_cloud_object_storage_bucket_identity_cloud_object_storage_bucket_identity_by_name_model2
+ assert security_group_target_reference_load_balancer_reference_model == security_group_target_reference_load_balancer_reference_model2
# Convert model instance back to dict and verify no loss of data
- legacy_cloud_object_storage_bucket_identity_cloud_object_storage_bucket_identity_by_name_model_json2 = legacy_cloud_object_storage_bucket_identity_cloud_object_storage_bucket_identity_by_name_model.to_dict()
- assert legacy_cloud_object_storage_bucket_identity_cloud_object_storage_bucket_identity_by_name_model_json2 == legacy_cloud_object_storage_bucket_identity_cloud_object_storage_bucket_identity_by_name_model_json
+ security_group_target_reference_load_balancer_reference_model_json2 = security_group_target_reference_load_balancer_reference_model.to_dict()
+ assert security_group_target_reference_load_balancer_reference_model_json2 == security_group_target_reference_load_balancer_reference_model_json
-class TestModel_LoadBalancerIdentityByCRN:
+class TestModel_SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext:
"""
- Test Class for LoadBalancerIdentityByCRN
+ Test Class for SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext
"""
- def test_load_balancer_identity_by_crn_serialization(self):
+ def test_security_group_target_reference_network_interface_reference_target_context_serialization(self):
"""
- Test serialization/deserialization for LoadBalancerIdentityByCRN
+ Test serialization/deserialization for SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext
"""
- # Construct a json representation of a LoadBalancerIdentityByCRN model
- load_balancer_identity_by_crn_model_json = {}
- load_balancer_identity_by_crn_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727'
+ # Construct dict forms of any model objects needed in order to build this model.
- # Construct a model instance of LoadBalancerIdentityByCRN by calling from_dict on the json representation
- load_balancer_identity_by_crn_model = LoadBalancerIdentityByCRN.from_dict(load_balancer_identity_by_crn_model_json)
- assert load_balancer_identity_by_crn_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 LoadBalancerIdentityByCRN by calling from_dict on the json representation
- load_balancer_identity_by_crn_model_dict = LoadBalancerIdentityByCRN.from_dict(load_balancer_identity_by_crn_model_json).__dict__
- load_balancer_identity_by_crn_model2 = LoadBalancerIdentityByCRN(**load_balancer_identity_by_crn_model_dict)
+ # Construct a json representation of a SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext model
+ security_group_target_reference_network_interface_reference_target_context_model_json = {}
+ security_group_target_reference_network_interface_reference_target_context_model_json['deleted'] = network_interface_reference_target_context_deleted_model
+ security_group_target_reference_network_interface_reference_target_context_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e'
+ security_group_target_reference_network_interface_reference_target_context_model_json['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e'
+ security_group_target_reference_network_interface_reference_target_context_model_json['name'] = 'my-instance-network-interface'
+ security_group_target_reference_network_interface_reference_target_context_model_json['resource_type'] = 'network_interface'
+
+ # Construct a model instance of SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext by calling from_dict on the json representation
+ security_group_target_reference_network_interface_reference_target_context_model = SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext.from_dict(security_group_target_reference_network_interface_reference_target_context_model_json)
+ assert security_group_target_reference_network_interface_reference_target_context_model != False
+
+ # Construct a model instance of SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext by calling from_dict on the json representation
+ security_group_target_reference_network_interface_reference_target_context_model_dict = SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext.from_dict(security_group_target_reference_network_interface_reference_target_context_model_json).__dict__
+ security_group_target_reference_network_interface_reference_target_context_model2 = SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext(**security_group_target_reference_network_interface_reference_target_context_model_dict)
# Verify the model instances are equivalent
- assert load_balancer_identity_by_crn_model == load_balancer_identity_by_crn_model2
+ assert security_group_target_reference_network_interface_reference_target_context_model == security_group_target_reference_network_interface_reference_target_context_model2
# Convert model instance back to dict and verify no loss of data
- load_balancer_identity_by_crn_model_json2 = load_balancer_identity_by_crn_model.to_dict()
- assert load_balancer_identity_by_crn_model_json2 == load_balancer_identity_by_crn_model_json
+ security_group_target_reference_network_interface_reference_target_context_model_json2 = security_group_target_reference_network_interface_reference_target_context_model.to_dict()
+ assert security_group_target_reference_network_interface_reference_target_context_model_json2 == security_group_target_reference_network_interface_reference_target_context_model_json
-class TestModel_LoadBalancerIdentityByHref:
+class TestModel_SecurityGroupTargetReferenceVPNServerReference:
"""
- Test Class for LoadBalancerIdentityByHref
+ Test Class for SecurityGroupTargetReferenceVPNServerReference
"""
- def test_load_balancer_identity_by_href_serialization(self):
+ def test_security_group_target_reference_vpn_server_reference_serialization(self):
"""
- Test serialization/deserialization for LoadBalancerIdentityByHref
+ Test serialization/deserialization for SecurityGroupTargetReferenceVPNServerReference
"""
- # Construct a json representation of a LoadBalancerIdentityByHref model
- load_balancer_identity_by_href_model_json = {}
- load_balancer_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727'
+ # Construct dict forms of any model objects needed in order to build this model.
- # Construct a model instance of LoadBalancerIdentityByHref by calling from_dict on the json representation
- load_balancer_identity_by_href_model = LoadBalancerIdentityByHref.from_dict(load_balancer_identity_by_href_model_json)
- assert load_balancer_identity_by_href_model != False
+ vpn_server_reference_deleted_model = {} # VPNServerReferenceDeleted
+ vpn_server_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Construct a model instance of LoadBalancerIdentityByHref by calling from_dict on the json representation
- load_balancer_identity_by_href_model_dict = LoadBalancerIdentityByHref.from_dict(load_balancer_identity_by_href_model_json).__dict__
- load_balancer_identity_by_href_model2 = LoadBalancerIdentityByHref(**load_balancer_identity_by_href_model_dict)
+ # Construct a json representation of a SecurityGroupTargetReferenceVPNServerReference model
+ security_group_target_reference_vpn_server_reference_model_json = {}
+ security_group_target_reference_vpn_server_reference_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpn-server:r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5'
+ security_group_target_reference_vpn_server_reference_model_json['deleted'] = vpn_server_reference_deleted_model
+ security_group_target_reference_vpn_server_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5'
+ security_group_target_reference_vpn_server_reference_model_json['id'] = 'r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5'
+ security_group_target_reference_vpn_server_reference_model_json['name'] = 'my-vpn-server'
+ security_group_target_reference_vpn_server_reference_model_json['resource_type'] = 'vpn_server'
+
+ # Construct a model instance of SecurityGroupTargetReferenceVPNServerReference by calling from_dict on the json representation
+ security_group_target_reference_vpn_server_reference_model = SecurityGroupTargetReferenceVPNServerReference.from_dict(security_group_target_reference_vpn_server_reference_model_json)
+ assert security_group_target_reference_vpn_server_reference_model != False
+
+ # Construct a model instance of SecurityGroupTargetReferenceVPNServerReference by calling from_dict on the json representation
+ security_group_target_reference_vpn_server_reference_model_dict = SecurityGroupTargetReferenceVPNServerReference.from_dict(security_group_target_reference_vpn_server_reference_model_json).__dict__
+ security_group_target_reference_vpn_server_reference_model2 = SecurityGroupTargetReferenceVPNServerReference(**security_group_target_reference_vpn_server_reference_model_dict)
# Verify the model instances are equivalent
- assert load_balancer_identity_by_href_model == load_balancer_identity_by_href_model2
+ assert security_group_target_reference_vpn_server_reference_model == security_group_target_reference_vpn_server_reference_model2
# Convert model instance back to dict and verify no loss of data
- load_balancer_identity_by_href_model_json2 = load_balancer_identity_by_href_model.to_dict()
- assert load_balancer_identity_by_href_model_json2 == load_balancer_identity_by_href_model_json
+ security_group_target_reference_vpn_server_reference_model_json2 = security_group_target_reference_vpn_server_reference_model.to_dict()
+ assert security_group_target_reference_vpn_server_reference_model_json2 == security_group_target_reference_vpn_server_reference_model_json
-class TestModel_LoadBalancerIdentityById:
+class TestModel_SecurityGroupTargetReferenceVirtualNetworkInterfaceReference:
"""
- Test Class for LoadBalancerIdentityById
+ Test Class for SecurityGroupTargetReferenceVirtualNetworkInterfaceReference
"""
- def test_load_balancer_identity_by_id_serialization(self):
+ def test_security_group_target_reference_virtual_network_interface_reference_serialization(self):
"""
- Test serialization/deserialization for LoadBalancerIdentityById
+ Test serialization/deserialization for SecurityGroupTargetReferenceVirtualNetworkInterfaceReference
"""
- # Construct a json representation of a LoadBalancerIdentityById model
- load_balancer_identity_by_id_model_json = {}
- load_balancer_identity_by_id_model_json['id'] = 'dd754295-e9e0-4c9d-bf6c-58fbc59e5727'
-
- # Construct a model instance of LoadBalancerIdentityById by calling from_dict on the json representation
- load_balancer_identity_by_id_model = LoadBalancerIdentityById.from_dict(load_balancer_identity_by_id_model_json)
- assert load_balancer_identity_by_id_model != False
-
- # Construct a model instance of LoadBalancerIdentityById by calling from_dict on the json representation
- load_balancer_identity_by_id_model_dict = LoadBalancerIdentityById.from_dict(load_balancer_identity_by_id_model_json).__dict__
- load_balancer_identity_by_id_model2 = LoadBalancerIdentityById(**load_balancer_identity_by_id_model_dict)
+ # Construct dict forms of any model objects needed in order to build this model.
- # Verify the model instances are equivalent
- assert load_balancer_identity_by_id_model == load_balancer_identity_by_id_model2
+ virtual_network_interface_reference_deleted_model = {} # VirtualNetworkInterfaceReferenceDeleted
+ virtual_network_interface_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_identity_by_id_model_json2 = load_balancer_identity_by_id_model.to_dict()
- assert load_balancer_identity_by_id_model_json2 == load_balancer_identity_by_id_model_json
+ 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'
-class TestModel_LoadBalancerListenerIdentityByHref:
- """
- Test Class for LoadBalancerListenerIdentityByHref
- """
+ subnet_reference_deleted_model = {} # SubnetReferenceDeleted
+ subnet_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- def test_load_balancer_listener_identity_by_href_serialization(self):
- """
- Test serialization/deserialization for LoadBalancerListenerIdentityByHref
- """
+ subnet_reference_model = {} # SubnetReference
+ subnet_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
+ subnet_reference_model['deleted'] = subnet_reference_deleted_model
+ subnet_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
+ subnet_reference_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
+ subnet_reference_model['name'] = 'my-subnet'
+ subnet_reference_model['resource_type'] = 'subnet'
- # Construct a json representation of a LoadBalancerListenerIdentityByHref model
- load_balancer_listener_identity_by_href_model_json = {}
- load_balancer_listener_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004'
+ # Construct a json representation of a SecurityGroupTargetReferenceVirtualNetworkInterfaceReference model
+ security_group_target_reference_virtual_network_interface_reference_model_json = {}
+ security_group_target_reference_virtual_network_interface_reference_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9'
+ security_group_target_reference_virtual_network_interface_reference_model_json['deleted'] = virtual_network_interface_reference_deleted_model
+ security_group_target_reference_virtual_network_interface_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9'
+ security_group_target_reference_virtual_network_interface_reference_model_json['id'] = '0767-fa41aecb-4f21-423d-8082-630bfba1e1d9'
+ security_group_target_reference_virtual_network_interface_reference_model_json['name'] = 'my-virtual-network-interface'
+ security_group_target_reference_virtual_network_interface_reference_model_json['primary_ip'] = reserved_ip_reference_model
+ security_group_target_reference_virtual_network_interface_reference_model_json['resource_type'] = 'virtual_network_interface'
+ security_group_target_reference_virtual_network_interface_reference_model_json['subnet'] = subnet_reference_model
- # Construct a model instance of LoadBalancerListenerIdentityByHref by calling from_dict on the json representation
- load_balancer_listener_identity_by_href_model = LoadBalancerListenerIdentityByHref.from_dict(load_balancer_listener_identity_by_href_model_json)
- assert load_balancer_listener_identity_by_href_model != False
+ # Construct a model instance of SecurityGroupTargetReferenceVirtualNetworkInterfaceReference by calling from_dict on the json representation
+ security_group_target_reference_virtual_network_interface_reference_model = SecurityGroupTargetReferenceVirtualNetworkInterfaceReference.from_dict(security_group_target_reference_virtual_network_interface_reference_model_json)
+ assert security_group_target_reference_virtual_network_interface_reference_model != False
- # Construct a model instance of LoadBalancerListenerIdentityByHref by calling from_dict on the json representation
- load_balancer_listener_identity_by_href_model_dict = LoadBalancerListenerIdentityByHref.from_dict(load_balancer_listener_identity_by_href_model_json).__dict__
- load_balancer_listener_identity_by_href_model2 = LoadBalancerListenerIdentityByHref(**load_balancer_listener_identity_by_href_model_dict)
+ # Construct a model instance of SecurityGroupTargetReferenceVirtualNetworkInterfaceReference by calling from_dict on the json representation
+ security_group_target_reference_virtual_network_interface_reference_model_dict = SecurityGroupTargetReferenceVirtualNetworkInterfaceReference.from_dict(security_group_target_reference_virtual_network_interface_reference_model_json).__dict__
+ security_group_target_reference_virtual_network_interface_reference_model2 = SecurityGroupTargetReferenceVirtualNetworkInterfaceReference(**security_group_target_reference_virtual_network_interface_reference_model_dict)
# Verify the model instances are equivalent
- assert load_balancer_listener_identity_by_href_model == load_balancer_listener_identity_by_href_model2
+ assert security_group_target_reference_virtual_network_interface_reference_model == security_group_target_reference_virtual_network_interface_reference_model2
# Convert model instance back to dict and verify no loss of data
- load_balancer_listener_identity_by_href_model_json2 = load_balancer_listener_identity_by_href_model.to_dict()
- assert load_balancer_listener_identity_by_href_model_json2 == load_balancer_listener_identity_by_href_model_json
+ security_group_target_reference_virtual_network_interface_reference_model_json2 = security_group_target_reference_virtual_network_interface_reference_model.to_dict()
+ assert security_group_target_reference_virtual_network_interface_reference_model_json2 == security_group_target_reference_virtual_network_interface_reference_model_json
-class TestModel_LoadBalancerListenerIdentityById:
+class TestModel_ShareIdentityByCRN:
"""
- Test Class for LoadBalancerListenerIdentityById
+ Test Class for ShareIdentityByCRN
"""
- def test_load_balancer_listener_identity_by_id_serialization(self):
+ def test_share_identity_by_crn_serialization(self):
"""
- Test serialization/deserialization for LoadBalancerListenerIdentityById
+ Test serialization/deserialization for ShareIdentityByCRN
"""
- # Construct a json representation of a LoadBalancerListenerIdentityById model
- load_balancer_listener_identity_by_id_model_json = {}
- load_balancer_listener_identity_by_id_model_json['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004'
+ # Construct a json representation of a ShareIdentityByCRN model
+ share_identity_by_crn_model_json = {}
+ share_identity_by_crn_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58'
- # Construct a model instance of LoadBalancerListenerIdentityById by calling from_dict on the json representation
- load_balancer_listener_identity_by_id_model = LoadBalancerListenerIdentityById.from_dict(load_balancer_listener_identity_by_id_model_json)
- assert load_balancer_listener_identity_by_id_model != False
+ # Construct a model instance of ShareIdentityByCRN by calling from_dict on the json representation
+ share_identity_by_crn_model = ShareIdentityByCRN.from_dict(share_identity_by_crn_model_json)
+ assert share_identity_by_crn_model != False
- # Construct a model instance of LoadBalancerListenerIdentityById by calling from_dict on the json representation
- load_balancer_listener_identity_by_id_model_dict = LoadBalancerListenerIdentityById.from_dict(load_balancer_listener_identity_by_id_model_json).__dict__
- load_balancer_listener_identity_by_id_model2 = LoadBalancerListenerIdentityById(**load_balancer_listener_identity_by_id_model_dict)
+ # Construct a model instance of ShareIdentityByCRN by calling from_dict on the json representation
+ share_identity_by_crn_model_dict = ShareIdentityByCRN.from_dict(share_identity_by_crn_model_json).__dict__
+ share_identity_by_crn_model2 = ShareIdentityByCRN(**share_identity_by_crn_model_dict)
# Verify the model instances are equivalent
- assert load_balancer_listener_identity_by_id_model == load_balancer_listener_identity_by_id_model2
+ assert share_identity_by_crn_model == share_identity_by_crn_model2
# Convert model instance back to dict and verify no loss of data
- load_balancer_listener_identity_by_id_model_json2 = load_balancer_listener_identity_by_id_model.to_dict()
- assert load_balancer_listener_identity_by_id_model_json2 == load_balancer_listener_identity_by_id_model_json
+ share_identity_by_crn_model_json2 = share_identity_by_crn_model.to_dict()
+ assert share_identity_by_crn_model_json2 == share_identity_by_crn_model_json
-class TestModel_LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerHTTPSRedirectPatch:
+class TestModel_ShareIdentityByHref:
"""
- Test Class for LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerHTTPSRedirectPatch
+ Test Class for ShareIdentityByHref
"""
- def test_load_balancer_listener_policy_target_patch_load_balancer_listener_https_redirect_patch_serialization(self):
+ def test_share_identity_by_href_serialization(self):
"""
- Test serialization/deserialization for LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerHTTPSRedirectPatch
+ Test serialization/deserialization for ShareIdentityByHref
"""
- # 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 LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerHTTPSRedirectPatch model
- load_balancer_listener_policy_target_patch_load_balancer_listener_https_redirect_patch_model_json = {}
- load_balancer_listener_policy_target_patch_load_balancer_listener_https_redirect_patch_model_json['http_status_code'] = 301
- load_balancer_listener_policy_target_patch_load_balancer_listener_https_redirect_patch_model_json['listener'] = load_balancer_listener_identity_model
- load_balancer_listener_policy_target_patch_load_balancer_listener_https_redirect_patch_model_json['uri'] = '/example?doc=get'
+ # Construct a json representation of a ShareIdentityByHref model
+ share_identity_by_href_model_json = {}
+ share_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58'
- # Construct a model instance of LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerHTTPSRedirectPatch by calling from_dict on the json representation
- load_balancer_listener_policy_target_patch_load_balancer_listener_https_redirect_patch_model = LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerHTTPSRedirectPatch.from_dict(load_balancer_listener_policy_target_patch_load_balancer_listener_https_redirect_patch_model_json)
- assert load_balancer_listener_policy_target_patch_load_balancer_listener_https_redirect_patch_model != False
+ # Construct a model instance of ShareIdentityByHref by calling from_dict on the json representation
+ share_identity_by_href_model = ShareIdentityByHref.from_dict(share_identity_by_href_model_json)
+ assert share_identity_by_href_model != False
- # Construct a model instance of LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerHTTPSRedirectPatch by calling from_dict on the json representation
- load_balancer_listener_policy_target_patch_load_balancer_listener_https_redirect_patch_model_dict = LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerHTTPSRedirectPatch.from_dict(load_balancer_listener_policy_target_patch_load_balancer_listener_https_redirect_patch_model_json).__dict__
- load_balancer_listener_policy_target_patch_load_balancer_listener_https_redirect_patch_model2 = LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerHTTPSRedirectPatch(**load_balancer_listener_policy_target_patch_load_balancer_listener_https_redirect_patch_model_dict)
+ # Construct a model instance of ShareIdentityByHref by calling from_dict on the json representation
+ share_identity_by_href_model_dict = ShareIdentityByHref.from_dict(share_identity_by_href_model_json).__dict__
+ share_identity_by_href_model2 = ShareIdentityByHref(**share_identity_by_href_model_dict)
# Verify the model instances are equivalent
- assert load_balancer_listener_policy_target_patch_load_balancer_listener_https_redirect_patch_model == load_balancer_listener_policy_target_patch_load_balancer_listener_https_redirect_patch_model2
+ assert share_identity_by_href_model == share_identity_by_href_model2
# Convert model instance back to dict and verify no loss of data
- load_balancer_listener_policy_target_patch_load_balancer_listener_https_redirect_patch_model_json2 = load_balancer_listener_policy_target_patch_load_balancer_listener_https_redirect_patch_model.to_dict()
- assert load_balancer_listener_policy_target_patch_load_balancer_listener_https_redirect_patch_model_json2 == load_balancer_listener_policy_target_patch_load_balancer_listener_https_redirect_patch_model_json
+ share_identity_by_href_model_json2 = share_identity_by_href_model.to_dict()
+ assert share_identity_by_href_model_json2 == share_identity_by_href_model_json
-class TestModel_LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerPolicyRedirectURLPatch:
+class TestModel_ShareIdentityById:
"""
- Test Class for LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerPolicyRedirectURLPatch
+ Test Class for ShareIdentityById
"""
- def test_load_balancer_listener_policy_target_patch_load_balancer_listener_policy_redirect_url_patch_serialization(self):
+ def test_share_identity_by_id_serialization(self):
"""
- Test serialization/deserialization for LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerPolicyRedirectURLPatch
+ Test serialization/deserialization for ShareIdentityById
"""
- # Construct a json representation of a LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerPolicyRedirectURLPatch model
- load_balancer_listener_policy_target_patch_load_balancer_listener_policy_redirect_url_patch_model_json = {}
- load_balancer_listener_policy_target_patch_load_balancer_listener_policy_redirect_url_patch_model_json['http_status_code'] = 301
- load_balancer_listener_policy_target_patch_load_balancer_listener_policy_redirect_url_patch_model_json['url'] = 'https://www.redirect.com'
+ # Construct a json representation of a ShareIdentityById model
+ share_identity_by_id_model_json = {}
+ share_identity_by_id_model_json['id'] = '0fe9e5d8-0a4d-4818-96ec-e99708644a58'
- # Construct a model instance of LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerPolicyRedirectURLPatch by calling from_dict on the json representation
- load_balancer_listener_policy_target_patch_load_balancer_listener_policy_redirect_url_patch_model = LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerPolicyRedirectURLPatch.from_dict(load_balancer_listener_policy_target_patch_load_balancer_listener_policy_redirect_url_patch_model_json)
- assert load_balancer_listener_policy_target_patch_load_balancer_listener_policy_redirect_url_patch_model != False
+ # Construct a model instance of ShareIdentityById by calling from_dict on the json representation
+ share_identity_by_id_model = ShareIdentityById.from_dict(share_identity_by_id_model_json)
+ assert share_identity_by_id_model != False
- # Construct a model instance of LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerPolicyRedirectURLPatch by calling from_dict on the json representation
- load_balancer_listener_policy_target_patch_load_balancer_listener_policy_redirect_url_patch_model_dict = LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerPolicyRedirectURLPatch.from_dict(load_balancer_listener_policy_target_patch_load_balancer_listener_policy_redirect_url_patch_model_json).__dict__
- load_balancer_listener_policy_target_patch_load_balancer_listener_policy_redirect_url_patch_model2 = LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerPolicyRedirectURLPatch(**load_balancer_listener_policy_target_patch_load_balancer_listener_policy_redirect_url_patch_model_dict)
+ # Construct a model instance of ShareIdentityById by calling from_dict on the json representation
+ share_identity_by_id_model_dict = ShareIdentityById.from_dict(share_identity_by_id_model_json).__dict__
+ share_identity_by_id_model2 = ShareIdentityById(**share_identity_by_id_model_dict)
# Verify the model instances are equivalent
- assert load_balancer_listener_policy_target_patch_load_balancer_listener_policy_redirect_url_patch_model == load_balancer_listener_policy_target_patch_load_balancer_listener_policy_redirect_url_patch_model2
+ assert share_identity_by_id_model == share_identity_by_id_model2
# Convert model instance back to dict and verify no loss of data
- load_balancer_listener_policy_target_patch_load_balancer_listener_policy_redirect_url_patch_model_json2 = load_balancer_listener_policy_target_patch_load_balancer_listener_policy_redirect_url_patch_model.to_dict()
- assert load_balancer_listener_policy_target_patch_load_balancer_listener_policy_redirect_url_patch_model_json2 == load_balancer_listener_policy_target_patch_load_balancer_listener_policy_redirect_url_patch_model_json
+ share_identity_by_id_model_json2 = share_identity_by_id_model.to_dict()
+ assert share_identity_by_id_model_json2 == share_identity_by_id_model_json
-class TestModel_LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerHTTPSRedirectPrototype:
+class TestModel_ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup:
"""
- Test Class for LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerHTTPSRedirectPrototype
+ Test Class for ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup
"""
- def test_load_balancer_listener_policy_target_prototype_load_balancer_listener_https_redirect_prototype_serialization(self):
+ def test_share_mount_target_prototype_share_mount_target_by_access_control_mode_security_group_serialization(self):
"""
- Test serialization/deserialization for LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerHTTPSRedirectPrototype
+ Test serialization/deserialization for ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup
"""
# 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'
+ virtual_network_interface_ip_prototype_model = {} # VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext
+ virtual_network_interface_ip_prototype_model['address'] = '10.0.0.5'
+ virtual_network_interface_ip_prototype_model['auto_delete'] = False
+ virtual_network_interface_ip_prototype_model['name'] = 'my-reserved-ip'
- # Construct a json representation of a LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerHTTPSRedirectPrototype model
- load_balancer_listener_policy_target_prototype_load_balancer_listener_https_redirect_prototype_model_json = {}
- load_balancer_listener_policy_target_prototype_load_balancer_listener_https_redirect_prototype_model_json['http_status_code'] = 301
- load_balancer_listener_policy_target_prototype_load_balancer_listener_https_redirect_prototype_model_json['listener'] = load_balancer_listener_identity_model
- load_balancer_listener_policy_target_prototype_load_balancer_listener_https_redirect_prototype_model_json['uri'] = '/example?doc=get'
+ virtual_network_interface_primary_ip_prototype_model = {} # VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext
+ virtual_network_interface_primary_ip_prototype_model['address'] = '10.0.0.5'
+ virtual_network_interface_primary_ip_prototype_model['auto_delete'] = False
+ virtual_network_interface_primary_ip_prototype_model['name'] = 'my-reserved-ip'
- # Construct a model instance of LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerHTTPSRedirectPrototype by calling from_dict on the json representation
- load_balancer_listener_policy_target_prototype_load_balancer_listener_https_redirect_prototype_model = LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerHTTPSRedirectPrototype.from_dict(load_balancer_listener_policy_target_prototype_load_balancer_listener_https_redirect_prototype_model_json)
- assert load_balancer_listener_policy_target_prototype_load_balancer_listener_https_redirect_prototype_model != False
+ resource_group_identity_model = {} # ResourceGroupIdentityById
+ resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
- # Construct a model instance of LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerHTTPSRedirectPrototype by calling from_dict on the json representation
- load_balancer_listener_policy_target_prototype_load_balancer_listener_https_redirect_prototype_model_dict = LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerHTTPSRedirectPrototype.from_dict(load_balancer_listener_policy_target_prototype_load_balancer_listener_https_redirect_prototype_model_json).__dict__
- load_balancer_listener_policy_target_prototype_load_balancer_listener_https_redirect_prototype_model2 = LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerHTTPSRedirectPrototype(**load_balancer_listener_policy_target_prototype_load_balancer_listener_https_redirect_prototype_model_dict)
+ security_group_identity_model = {} # SecurityGroupIdentityById
+ security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271'
+
+ subnet_identity_model = {} # SubnetIdentityById
+ subnet_identity_model['id'] = '2302-ea5fe79f-52c3-4f05-86ae-9540a10489f5'
+
+ share_mount_target_virtual_network_interface_prototype_model = {} # ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfacePrototypeShareMountTargetContext
+ share_mount_target_virtual_network_interface_prototype_model['allow_ip_spoofing'] = True
+ share_mount_target_virtual_network_interface_prototype_model['auto_delete'] = False
+ share_mount_target_virtual_network_interface_prototype_model['enable_infrastructure_nat'] = True
+ share_mount_target_virtual_network_interface_prototype_model['ips'] = [virtual_network_interface_ip_prototype_model]
+ share_mount_target_virtual_network_interface_prototype_model['name'] = 'my-virtual-network-interface'
+ share_mount_target_virtual_network_interface_prototype_model['primary_ip'] = virtual_network_interface_primary_ip_prototype_model
+ share_mount_target_virtual_network_interface_prototype_model['resource_group'] = resource_group_identity_model
+ share_mount_target_virtual_network_interface_prototype_model['security_groups'] = [security_group_identity_model]
+ share_mount_target_virtual_network_interface_prototype_model['subnet'] = subnet_identity_model
+
+ # Construct a json representation of a ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup model
+ share_mount_target_prototype_share_mount_target_by_access_control_mode_security_group_model_json = {}
+ share_mount_target_prototype_share_mount_target_by_access_control_mode_security_group_model_json['name'] = 'my-share-mount-target'
+ share_mount_target_prototype_share_mount_target_by_access_control_mode_security_group_model_json['transit_encryption'] = 'none'
+ share_mount_target_prototype_share_mount_target_by_access_control_mode_security_group_model_json['virtual_network_interface'] = share_mount_target_virtual_network_interface_prototype_model
+
+ # Construct a model instance of ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup by calling from_dict on the json representation
+ share_mount_target_prototype_share_mount_target_by_access_control_mode_security_group_model = ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup.from_dict(share_mount_target_prototype_share_mount_target_by_access_control_mode_security_group_model_json)
+ assert share_mount_target_prototype_share_mount_target_by_access_control_mode_security_group_model != False
+
+ # Construct a model instance of ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup by calling from_dict on the json representation
+ share_mount_target_prototype_share_mount_target_by_access_control_mode_security_group_model_dict = ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup.from_dict(share_mount_target_prototype_share_mount_target_by_access_control_mode_security_group_model_json).__dict__
+ share_mount_target_prototype_share_mount_target_by_access_control_mode_security_group_model2 = ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup(**share_mount_target_prototype_share_mount_target_by_access_control_mode_security_group_model_dict)
# Verify the model instances are equivalent
- assert load_balancer_listener_policy_target_prototype_load_balancer_listener_https_redirect_prototype_model == load_balancer_listener_policy_target_prototype_load_balancer_listener_https_redirect_prototype_model2
+ assert share_mount_target_prototype_share_mount_target_by_access_control_mode_security_group_model == share_mount_target_prototype_share_mount_target_by_access_control_mode_security_group_model2
# Convert model instance back to dict and verify no loss of data
- load_balancer_listener_policy_target_prototype_load_balancer_listener_https_redirect_prototype_model_json2 = load_balancer_listener_policy_target_prototype_load_balancer_listener_https_redirect_prototype_model.to_dict()
- assert load_balancer_listener_policy_target_prototype_load_balancer_listener_https_redirect_prototype_model_json2 == load_balancer_listener_policy_target_prototype_load_balancer_listener_https_redirect_prototype_model_json
+ share_mount_target_prototype_share_mount_target_by_access_control_mode_security_group_model_json2 = share_mount_target_prototype_share_mount_target_by_access_control_mode_security_group_model.to_dict()
+ assert share_mount_target_prototype_share_mount_target_by_access_control_mode_security_group_model_json2 == share_mount_target_prototype_share_mount_target_by_access_control_mode_security_group_model_json
-class TestModel_LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyRedirectURLPrototype:
+class TestModel_ShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC:
"""
- Test Class for LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyRedirectURLPrototype
+ Test Class for ShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC
"""
- def test_load_balancer_listener_policy_target_prototype_load_balancer_listener_policy_redirect_url_prototype_serialization(self):
+ def test_share_mount_target_prototype_share_mount_target_by_access_control_mode_vpc_serialization(self):
"""
- Test serialization/deserialization for LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyRedirectURLPrototype
+ Test serialization/deserialization for ShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC
"""
- # Construct a json representation of a LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyRedirectURLPrototype model
- load_balancer_listener_policy_target_prototype_load_balancer_listener_policy_redirect_url_prototype_model_json = {}
- load_balancer_listener_policy_target_prototype_load_balancer_listener_policy_redirect_url_prototype_model_json['http_status_code'] = 301
- load_balancer_listener_policy_target_prototype_load_balancer_listener_policy_redirect_url_prototype_model_json['url'] = 'https://www.redirect.com'
+ # Construct dict forms of any model objects needed in order to build this model.
- # Construct a model instance of LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyRedirectURLPrototype by calling from_dict on the json representation
- load_balancer_listener_policy_target_prototype_load_balancer_listener_policy_redirect_url_prototype_model = LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyRedirectURLPrototype.from_dict(load_balancer_listener_policy_target_prototype_load_balancer_listener_policy_redirect_url_prototype_model_json)
- assert load_balancer_listener_policy_target_prototype_load_balancer_listener_policy_redirect_url_prototype_model != False
+ vpc_identity_model = {} # VPCIdentityById
+ vpc_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
- # Construct a model instance of LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyRedirectURLPrototype by calling from_dict on the json representation
- load_balancer_listener_policy_target_prototype_load_balancer_listener_policy_redirect_url_prototype_model_dict = LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyRedirectURLPrototype.from_dict(load_balancer_listener_policy_target_prototype_load_balancer_listener_policy_redirect_url_prototype_model_json).__dict__
- load_balancer_listener_policy_target_prototype_load_balancer_listener_policy_redirect_url_prototype_model2 = LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyRedirectURLPrototype(**load_balancer_listener_policy_target_prototype_load_balancer_listener_policy_redirect_url_prototype_model_dict)
+ # Construct a json representation of a ShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC model
+ share_mount_target_prototype_share_mount_target_by_access_control_mode_vpc_model_json = {}
+ share_mount_target_prototype_share_mount_target_by_access_control_mode_vpc_model_json['name'] = 'my-share-mount-target'
+ share_mount_target_prototype_share_mount_target_by_access_control_mode_vpc_model_json['transit_encryption'] = 'none'
+ share_mount_target_prototype_share_mount_target_by_access_control_mode_vpc_model_json['vpc'] = vpc_identity_model
+
+ # Construct a model instance of ShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC by calling from_dict on the json representation
+ share_mount_target_prototype_share_mount_target_by_access_control_mode_vpc_model = ShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC.from_dict(share_mount_target_prototype_share_mount_target_by_access_control_mode_vpc_model_json)
+ assert share_mount_target_prototype_share_mount_target_by_access_control_mode_vpc_model != False
+
+ # Construct a model instance of ShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC by calling from_dict on the json representation
+ share_mount_target_prototype_share_mount_target_by_access_control_mode_vpc_model_dict = ShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC.from_dict(share_mount_target_prototype_share_mount_target_by_access_control_mode_vpc_model_json).__dict__
+ share_mount_target_prototype_share_mount_target_by_access_control_mode_vpc_model2 = ShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC(**share_mount_target_prototype_share_mount_target_by_access_control_mode_vpc_model_dict)
# Verify the model instances are equivalent
- assert load_balancer_listener_policy_target_prototype_load_balancer_listener_policy_redirect_url_prototype_model == load_balancer_listener_policy_target_prototype_load_balancer_listener_policy_redirect_url_prototype_model2
+ assert share_mount_target_prototype_share_mount_target_by_access_control_mode_vpc_model == share_mount_target_prototype_share_mount_target_by_access_control_mode_vpc_model2
# Convert model instance back to dict and verify no loss of data
- load_balancer_listener_policy_target_prototype_load_balancer_listener_policy_redirect_url_prototype_model_json2 = load_balancer_listener_policy_target_prototype_load_balancer_listener_policy_redirect_url_prototype_model.to_dict()
- assert load_balancer_listener_policy_target_prototype_load_balancer_listener_policy_redirect_url_prototype_model_json2 == load_balancer_listener_policy_target_prototype_load_balancer_listener_policy_redirect_url_prototype_model_json
+ share_mount_target_prototype_share_mount_target_by_access_control_mode_vpc_model_json2 = share_mount_target_prototype_share_mount_target_by_access_control_mode_vpc_model.to_dict()
+ assert share_mount_target_prototype_share_mount_target_by_access_control_mode_vpc_model_json2 == share_mount_target_prototype_share_mount_target_by_access_control_mode_vpc_model_json
-class TestModel_LoadBalancerListenerPolicyTargetLoadBalancerListenerHTTPSRedirect:
+class TestModel_ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfacePrototypeShareMountTargetContext:
"""
- Test Class for LoadBalancerListenerPolicyTargetLoadBalancerListenerHTTPSRedirect
+ Test Class for ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfacePrototypeShareMountTargetContext
"""
- def test_load_balancer_listener_policy_target_load_balancer_listener_https_redirect_serialization(self):
+ def test_share_mount_target_virtual_network_interface_prototype_virtual_network_interface_prototype_share_mount_target_context_serialization(self):
"""
- Test serialization/deserialization for LoadBalancerListenerPolicyTargetLoadBalancerListenerHTTPSRedirect
+ Test serialization/deserialization for ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfacePrototypeShareMountTargetContext
"""
# 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'
+ virtual_network_interface_ip_prototype_model = {} # VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext
+ virtual_network_interface_ip_prototype_model['address'] = '10.0.0.5'
+ virtual_network_interface_ip_prototype_model['auto_delete'] = False
+ virtual_network_interface_ip_prototype_model['name'] = 'my-reserved-ip'
- 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'
+ virtual_network_interface_primary_ip_prototype_model = {} # VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext
+ virtual_network_interface_primary_ip_prototype_model['address'] = '10.0.0.5'
+ virtual_network_interface_primary_ip_prototype_model['auto_delete'] = False
+ virtual_network_interface_primary_ip_prototype_model['name'] = 'my-reserved-ip'
- # Construct a json representation of a LoadBalancerListenerPolicyTargetLoadBalancerListenerHTTPSRedirect model
- load_balancer_listener_policy_target_load_balancer_listener_https_redirect_model_json = {}
- load_balancer_listener_policy_target_load_balancer_listener_https_redirect_model_json['http_status_code'] = 301
- load_balancer_listener_policy_target_load_balancer_listener_https_redirect_model_json['listener'] = load_balancer_listener_reference_model
- load_balancer_listener_policy_target_load_balancer_listener_https_redirect_model_json['uri'] = '/example?doc=get'
+ resource_group_identity_model = {} # ResourceGroupIdentityById
+ resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
- # Construct a model instance of LoadBalancerListenerPolicyTargetLoadBalancerListenerHTTPSRedirect by calling from_dict on the json representation
- load_balancer_listener_policy_target_load_balancer_listener_https_redirect_model = LoadBalancerListenerPolicyTargetLoadBalancerListenerHTTPSRedirect.from_dict(load_balancer_listener_policy_target_load_balancer_listener_https_redirect_model_json)
- assert load_balancer_listener_policy_target_load_balancer_listener_https_redirect_model != False
+ security_group_identity_model = {} # SecurityGroupIdentityById
+ security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271'
- # Construct a model instance of LoadBalancerListenerPolicyTargetLoadBalancerListenerHTTPSRedirect by calling from_dict on the json representation
- load_balancer_listener_policy_target_load_balancer_listener_https_redirect_model_dict = LoadBalancerListenerPolicyTargetLoadBalancerListenerHTTPSRedirect.from_dict(load_balancer_listener_policy_target_load_balancer_listener_https_redirect_model_json).__dict__
- load_balancer_listener_policy_target_load_balancer_listener_https_redirect_model2 = LoadBalancerListenerPolicyTargetLoadBalancerListenerHTTPSRedirect(**load_balancer_listener_policy_target_load_balancer_listener_https_redirect_model_dict)
+ subnet_identity_model = {} # SubnetIdentityById
+ subnet_identity_model['id'] = '2302-ea5fe79f-52c3-4f05-86ae-9540a10489f5'
+
+ # Construct a json representation of a ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfacePrototypeShareMountTargetContext model
+ share_mount_target_virtual_network_interface_prototype_virtual_network_interface_prototype_share_mount_target_context_model_json = {}
+ share_mount_target_virtual_network_interface_prototype_virtual_network_interface_prototype_share_mount_target_context_model_json['allow_ip_spoofing'] = True
+ share_mount_target_virtual_network_interface_prototype_virtual_network_interface_prototype_share_mount_target_context_model_json['auto_delete'] = False
+ share_mount_target_virtual_network_interface_prototype_virtual_network_interface_prototype_share_mount_target_context_model_json['enable_infrastructure_nat'] = True
+ share_mount_target_virtual_network_interface_prototype_virtual_network_interface_prototype_share_mount_target_context_model_json['ips'] = [virtual_network_interface_ip_prototype_model]
+ share_mount_target_virtual_network_interface_prototype_virtual_network_interface_prototype_share_mount_target_context_model_json['name'] = 'my-virtual-network-interface'
+ share_mount_target_virtual_network_interface_prototype_virtual_network_interface_prototype_share_mount_target_context_model_json['primary_ip'] = virtual_network_interface_primary_ip_prototype_model
+ share_mount_target_virtual_network_interface_prototype_virtual_network_interface_prototype_share_mount_target_context_model_json['resource_group'] = resource_group_identity_model
+ share_mount_target_virtual_network_interface_prototype_virtual_network_interface_prototype_share_mount_target_context_model_json['security_groups'] = [security_group_identity_model]
+ share_mount_target_virtual_network_interface_prototype_virtual_network_interface_prototype_share_mount_target_context_model_json['subnet'] = subnet_identity_model
+
+ # Construct a model instance of ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfacePrototypeShareMountTargetContext by calling from_dict on the json representation
+ share_mount_target_virtual_network_interface_prototype_virtual_network_interface_prototype_share_mount_target_context_model = ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfacePrototypeShareMountTargetContext.from_dict(share_mount_target_virtual_network_interface_prototype_virtual_network_interface_prototype_share_mount_target_context_model_json)
+ assert share_mount_target_virtual_network_interface_prototype_virtual_network_interface_prototype_share_mount_target_context_model != False
+
+ # Construct a model instance of ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfacePrototypeShareMountTargetContext by calling from_dict on the json representation
+ share_mount_target_virtual_network_interface_prototype_virtual_network_interface_prototype_share_mount_target_context_model_dict = ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfacePrototypeShareMountTargetContext.from_dict(share_mount_target_virtual_network_interface_prototype_virtual_network_interface_prototype_share_mount_target_context_model_json).__dict__
+ share_mount_target_virtual_network_interface_prototype_virtual_network_interface_prototype_share_mount_target_context_model2 = ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfacePrototypeShareMountTargetContext(**share_mount_target_virtual_network_interface_prototype_virtual_network_interface_prototype_share_mount_target_context_model_dict)
# Verify the model instances are equivalent
- assert load_balancer_listener_policy_target_load_balancer_listener_https_redirect_model == load_balancer_listener_policy_target_load_balancer_listener_https_redirect_model2
+ assert share_mount_target_virtual_network_interface_prototype_virtual_network_interface_prototype_share_mount_target_context_model == share_mount_target_virtual_network_interface_prototype_virtual_network_interface_prototype_share_mount_target_context_model2
# Convert model instance back to dict and verify no loss of data
- load_balancer_listener_policy_target_load_balancer_listener_https_redirect_model_json2 = load_balancer_listener_policy_target_load_balancer_listener_https_redirect_model.to_dict()
- assert load_balancer_listener_policy_target_load_balancer_listener_https_redirect_model_json2 == load_balancer_listener_policy_target_load_balancer_listener_https_redirect_model_json
+ share_mount_target_virtual_network_interface_prototype_virtual_network_interface_prototype_share_mount_target_context_model_json2 = share_mount_target_virtual_network_interface_prototype_virtual_network_interface_prototype_share_mount_target_context_model.to_dict()
+ assert share_mount_target_virtual_network_interface_prototype_virtual_network_interface_prototype_share_mount_target_context_model_json2 == share_mount_target_virtual_network_interface_prototype_virtual_network_interface_prototype_share_mount_target_context_model_json
-class TestModel_LoadBalancerListenerPolicyTargetLoadBalancerListenerPolicyRedirectURL:
+class TestModel_ShareProfileCapacityDependentRange:
"""
- Test Class for LoadBalancerListenerPolicyTargetLoadBalancerListenerPolicyRedirectURL
+ Test Class for ShareProfileCapacityDependentRange
"""
- def test_load_balancer_listener_policy_target_load_balancer_listener_policy_redirect_url_serialization(self):
+ def test_share_profile_capacity_dependent_range_serialization(self):
"""
- Test serialization/deserialization for LoadBalancerListenerPolicyTargetLoadBalancerListenerPolicyRedirectURL
+ Test serialization/deserialization for ShareProfileCapacityDependentRange
"""
- # Construct a json representation of a LoadBalancerListenerPolicyTargetLoadBalancerListenerPolicyRedirectURL model
- load_balancer_listener_policy_target_load_balancer_listener_policy_redirect_url_model_json = {}
- load_balancer_listener_policy_target_load_balancer_listener_policy_redirect_url_model_json['http_status_code'] = 301
- load_balancer_listener_policy_target_load_balancer_listener_policy_redirect_url_model_json['url'] = 'https://www.redirect.com'
+ # Construct a json representation of a ShareProfileCapacityDependentRange model
+ share_profile_capacity_dependent_range_model_json = {}
+ share_profile_capacity_dependent_range_model_json['max'] = 16000
+ share_profile_capacity_dependent_range_model_json['min'] = 10
+ share_profile_capacity_dependent_range_model_json['step'] = 1
+ share_profile_capacity_dependent_range_model_json['type'] = 'dependent'
- # Construct a model instance of LoadBalancerListenerPolicyTargetLoadBalancerListenerPolicyRedirectURL by calling from_dict on the json representation
- load_balancer_listener_policy_target_load_balancer_listener_policy_redirect_url_model = LoadBalancerListenerPolicyTargetLoadBalancerListenerPolicyRedirectURL.from_dict(load_balancer_listener_policy_target_load_balancer_listener_policy_redirect_url_model_json)
- assert load_balancer_listener_policy_target_load_balancer_listener_policy_redirect_url_model != False
+ # Construct a model instance of ShareProfileCapacityDependentRange by calling from_dict on the json representation
+ share_profile_capacity_dependent_range_model = ShareProfileCapacityDependentRange.from_dict(share_profile_capacity_dependent_range_model_json)
+ assert share_profile_capacity_dependent_range_model != False
- # Construct a model instance of LoadBalancerListenerPolicyTargetLoadBalancerListenerPolicyRedirectURL by calling from_dict on the json representation
- load_balancer_listener_policy_target_load_balancer_listener_policy_redirect_url_model_dict = LoadBalancerListenerPolicyTargetLoadBalancerListenerPolicyRedirectURL.from_dict(load_balancer_listener_policy_target_load_balancer_listener_policy_redirect_url_model_json).__dict__
- load_balancer_listener_policy_target_load_balancer_listener_policy_redirect_url_model2 = LoadBalancerListenerPolicyTargetLoadBalancerListenerPolicyRedirectURL(**load_balancer_listener_policy_target_load_balancer_listener_policy_redirect_url_model_dict)
+ # Construct a model instance of ShareProfileCapacityDependentRange by calling from_dict on the json representation
+ share_profile_capacity_dependent_range_model_dict = ShareProfileCapacityDependentRange.from_dict(share_profile_capacity_dependent_range_model_json).__dict__
+ share_profile_capacity_dependent_range_model2 = ShareProfileCapacityDependentRange(**share_profile_capacity_dependent_range_model_dict)
# Verify the model instances are equivalent
- assert load_balancer_listener_policy_target_load_balancer_listener_policy_redirect_url_model == load_balancer_listener_policy_target_load_balancer_listener_policy_redirect_url_model2
+ assert share_profile_capacity_dependent_range_model == share_profile_capacity_dependent_range_model2
# Convert model instance back to dict and verify no loss of data
- load_balancer_listener_policy_target_load_balancer_listener_policy_redirect_url_model_json2 = load_balancer_listener_policy_target_load_balancer_listener_policy_redirect_url_model.to_dict()
- assert load_balancer_listener_policy_target_load_balancer_listener_policy_redirect_url_model_json2 == load_balancer_listener_policy_target_load_balancer_listener_policy_redirect_url_model_json
+ share_profile_capacity_dependent_range_model_json2 = share_profile_capacity_dependent_range_model.to_dict()
+ assert share_profile_capacity_dependent_range_model_json2 == share_profile_capacity_dependent_range_model_json
-class TestModel_LoadBalancerListenerPolicyTargetLoadBalancerPoolReference:
+class TestModel_ShareProfileCapacityEnum:
"""
- Test Class for LoadBalancerListenerPolicyTargetLoadBalancerPoolReference
+ Test Class for ShareProfileCapacityEnum
"""
- def test_load_balancer_listener_policy_target_load_balancer_pool_reference_serialization(self):
+ def test_share_profile_capacity_enum_serialization(self):
"""
- Test serialization/deserialization for LoadBalancerListenerPolicyTargetLoadBalancerPoolReference
+ Test serialization/deserialization for ShareProfileCapacityEnum
"""
- # 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 LoadBalancerListenerPolicyTargetLoadBalancerPoolReference model
- load_balancer_listener_policy_target_load_balancer_pool_reference_model_json = {}
- load_balancer_listener_policy_target_load_balancer_pool_reference_model_json['deleted'] = load_balancer_pool_reference_deleted_model
- load_balancer_listener_policy_target_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_listener_policy_target_load_balancer_pool_reference_model_json['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004'
- load_balancer_listener_policy_target_load_balancer_pool_reference_model_json['name'] = 'my-load-balancer-pool'
+ # Construct a json representation of a ShareProfileCapacityEnum model
+ share_profile_capacity_enum_model_json = {}
+ share_profile_capacity_enum_model_json['default'] = 38
+ share_profile_capacity_enum_model_json['type'] = 'enum'
+ share_profile_capacity_enum_model_json['values'] = [4800, 9600, 16000, 32000]
- # Construct a model instance of LoadBalancerListenerPolicyTargetLoadBalancerPoolReference by calling from_dict on the json representation
- load_balancer_listener_policy_target_load_balancer_pool_reference_model = LoadBalancerListenerPolicyTargetLoadBalancerPoolReference.from_dict(load_balancer_listener_policy_target_load_balancer_pool_reference_model_json)
- assert load_balancer_listener_policy_target_load_balancer_pool_reference_model != False
+ # Construct a model instance of ShareProfileCapacityEnum by calling from_dict on the json representation
+ share_profile_capacity_enum_model = ShareProfileCapacityEnum.from_dict(share_profile_capacity_enum_model_json)
+ assert share_profile_capacity_enum_model != False
- # Construct a model instance of LoadBalancerListenerPolicyTargetLoadBalancerPoolReference by calling from_dict on the json representation
- load_balancer_listener_policy_target_load_balancer_pool_reference_model_dict = LoadBalancerListenerPolicyTargetLoadBalancerPoolReference.from_dict(load_balancer_listener_policy_target_load_balancer_pool_reference_model_json).__dict__
- load_balancer_listener_policy_target_load_balancer_pool_reference_model2 = LoadBalancerListenerPolicyTargetLoadBalancerPoolReference(**load_balancer_listener_policy_target_load_balancer_pool_reference_model_dict)
+ # Construct a model instance of ShareProfileCapacityEnum by calling from_dict on the json representation
+ share_profile_capacity_enum_model_dict = ShareProfileCapacityEnum.from_dict(share_profile_capacity_enum_model_json).__dict__
+ share_profile_capacity_enum_model2 = ShareProfileCapacityEnum(**share_profile_capacity_enum_model_dict)
# Verify the model instances are equivalent
- assert load_balancer_listener_policy_target_load_balancer_pool_reference_model == load_balancer_listener_policy_target_load_balancer_pool_reference_model2
+ assert share_profile_capacity_enum_model == share_profile_capacity_enum_model2
# Convert model instance back to dict and verify no loss of data
- load_balancer_listener_policy_target_load_balancer_pool_reference_model_json2 = load_balancer_listener_policy_target_load_balancer_pool_reference_model.to_dict()
- assert load_balancer_listener_policy_target_load_balancer_pool_reference_model_json2 == load_balancer_listener_policy_target_load_balancer_pool_reference_model_json
+ share_profile_capacity_enum_model_json2 = share_profile_capacity_enum_model.to_dict()
+ assert share_profile_capacity_enum_model_json2 == share_profile_capacity_enum_model_json
-class TestModel_LoadBalancerPoolIdentityByHref:
+class TestModel_ShareProfileCapacityFixed:
"""
- Test Class for LoadBalancerPoolIdentityByHref
+ Test Class for ShareProfileCapacityFixed
"""
- def test_load_balancer_pool_identity_by_href_serialization(self):
+ def test_share_profile_capacity_fixed_serialization(self):
"""
- Test serialization/deserialization for LoadBalancerPoolIdentityByHref
+ Test serialization/deserialization for ShareProfileCapacityFixed
"""
- # Construct a json representation of a LoadBalancerPoolIdentityByHref model
- load_balancer_pool_identity_by_href_model_json = {}
- load_balancer_pool_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004'
+ # Construct a json representation of a ShareProfileCapacityFixed model
+ share_profile_capacity_fixed_model_json = {}
+ share_profile_capacity_fixed_model_json['type'] = 'fixed'
+ share_profile_capacity_fixed_model_json['value'] = 4800
- # Construct a model instance of LoadBalancerPoolIdentityByHref by calling from_dict on the json representation
- load_balancer_pool_identity_by_href_model = LoadBalancerPoolIdentityByHref.from_dict(load_balancer_pool_identity_by_href_model_json)
- assert load_balancer_pool_identity_by_href_model != False
+ # Construct a model instance of ShareProfileCapacityFixed by calling from_dict on the json representation
+ share_profile_capacity_fixed_model = ShareProfileCapacityFixed.from_dict(share_profile_capacity_fixed_model_json)
+ assert share_profile_capacity_fixed_model != False
- # Construct a model instance of LoadBalancerPoolIdentityByHref by calling from_dict on the json representation
- load_balancer_pool_identity_by_href_model_dict = LoadBalancerPoolIdentityByHref.from_dict(load_balancer_pool_identity_by_href_model_json).__dict__
- load_balancer_pool_identity_by_href_model2 = LoadBalancerPoolIdentityByHref(**load_balancer_pool_identity_by_href_model_dict)
+ # Construct a model instance of ShareProfileCapacityFixed by calling from_dict on the json representation
+ share_profile_capacity_fixed_model_dict = ShareProfileCapacityFixed.from_dict(share_profile_capacity_fixed_model_json).__dict__
+ share_profile_capacity_fixed_model2 = ShareProfileCapacityFixed(**share_profile_capacity_fixed_model_dict)
# Verify the model instances are equivalent
- assert load_balancer_pool_identity_by_href_model == load_balancer_pool_identity_by_href_model2
+ assert share_profile_capacity_fixed_model == share_profile_capacity_fixed_model2
# Convert model instance back to dict and verify no loss of data
- load_balancer_pool_identity_by_href_model_json2 = load_balancer_pool_identity_by_href_model.to_dict()
- assert load_balancer_pool_identity_by_href_model_json2 == load_balancer_pool_identity_by_href_model_json
+ share_profile_capacity_fixed_model_json2 = share_profile_capacity_fixed_model.to_dict()
+ assert share_profile_capacity_fixed_model_json2 == share_profile_capacity_fixed_model_json
-class TestModel_LoadBalancerPoolIdentityById:
+class TestModel_ShareProfileCapacityRange:
"""
- Test Class for LoadBalancerPoolIdentityById
+ Test Class for ShareProfileCapacityRange
"""
- def test_load_balancer_pool_identity_by_id_serialization(self):
+ def test_share_profile_capacity_range_serialization(self):
"""
- Test serialization/deserialization for LoadBalancerPoolIdentityById
+ Test serialization/deserialization for ShareProfileCapacityRange
"""
- # Construct a json representation of a LoadBalancerPoolIdentityById model
- load_balancer_pool_identity_by_id_model_json = {}
- load_balancer_pool_identity_by_id_model_json['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004'
+ # Construct a json representation of a ShareProfileCapacityRange model
+ share_profile_capacity_range_model_json = {}
+ share_profile_capacity_range_model_json['default'] = 38
+ share_profile_capacity_range_model_json['max'] = 9600
+ share_profile_capacity_range_model_json['min'] = 5
+ share_profile_capacity_range_model_json['step'] = 1
+ share_profile_capacity_range_model_json['type'] = 'range'
- # Construct a model instance of LoadBalancerPoolIdentityById by calling from_dict on the json representation
- load_balancer_pool_identity_by_id_model = LoadBalancerPoolIdentityById.from_dict(load_balancer_pool_identity_by_id_model_json)
- assert load_balancer_pool_identity_by_id_model != False
+ # Construct a model instance of ShareProfileCapacityRange by calling from_dict on the json representation
+ share_profile_capacity_range_model = ShareProfileCapacityRange.from_dict(share_profile_capacity_range_model_json)
+ assert share_profile_capacity_range_model != False
- # Construct a model instance of LoadBalancerPoolIdentityById by calling from_dict on the json representation
- load_balancer_pool_identity_by_id_model_dict = LoadBalancerPoolIdentityById.from_dict(load_balancer_pool_identity_by_id_model_json).__dict__
- load_balancer_pool_identity_by_id_model2 = LoadBalancerPoolIdentityById(**load_balancer_pool_identity_by_id_model_dict)
+ # Construct a model instance of ShareProfileCapacityRange by calling from_dict on the json representation
+ share_profile_capacity_range_model_dict = ShareProfileCapacityRange.from_dict(share_profile_capacity_range_model_json).__dict__
+ share_profile_capacity_range_model2 = ShareProfileCapacityRange(**share_profile_capacity_range_model_dict)
# Verify the model instances are equivalent
- assert load_balancer_pool_identity_by_id_model == load_balancer_pool_identity_by_id_model2
+ assert share_profile_capacity_range_model == share_profile_capacity_range_model2
# Convert model instance back to dict and verify no loss of data
- load_balancer_pool_identity_by_id_model_json2 = load_balancer_pool_identity_by_id_model.to_dict()
- assert load_balancer_pool_identity_by_id_model_json2 == load_balancer_pool_identity_by_id_model_json
+ share_profile_capacity_range_model_json2 = share_profile_capacity_range_model.to_dict()
+ assert share_profile_capacity_range_model_json2 == share_profile_capacity_range_model_json
-class TestModel_LoadBalancerPoolMemberTargetPrototypeIP:
+class TestModel_ShareProfileIOPSDependentRange:
"""
- Test Class for LoadBalancerPoolMemberTargetPrototypeIP
+ Test Class for ShareProfileIOPSDependentRange
"""
- def test_load_balancer_pool_member_target_prototype_ip_serialization(self):
+ def test_share_profile_iops_dependent_range_serialization(self):
"""
- Test serialization/deserialization for LoadBalancerPoolMemberTargetPrototypeIP
+ Test serialization/deserialization for ShareProfileIOPSDependentRange
"""
- # Construct a json representation of a LoadBalancerPoolMemberTargetPrototypeIP model
- load_balancer_pool_member_target_prototype_ip_model_json = {}
- load_balancer_pool_member_target_prototype_ip_model_json['address'] = '192.168.3.4'
+ # Construct a json representation of a ShareProfileIOPSDependentRange model
+ share_profile_iops_dependent_range_model_json = {}
+ share_profile_iops_dependent_range_model_json['max'] = 48000
+ share_profile_iops_dependent_range_model_json['min'] = 1000
+ share_profile_iops_dependent_range_model_json['step'] = 1
+ share_profile_iops_dependent_range_model_json['type'] = 'dependent'
- # Construct a model instance of LoadBalancerPoolMemberTargetPrototypeIP by calling from_dict on the json representation
- load_balancer_pool_member_target_prototype_ip_model = LoadBalancerPoolMemberTargetPrototypeIP.from_dict(load_balancer_pool_member_target_prototype_ip_model_json)
- assert load_balancer_pool_member_target_prototype_ip_model != False
+ # Construct a model instance of ShareProfileIOPSDependentRange by calling from_dict on the json representation
+ share_profile_iops_dependent_range_model = ShareProfileIOPSDependentRange.from_dict(share_profile_iops_dependent_range_model_json)
+ assert share_profile_iops_dependent_range_model != False
- # Construct a model instance of LoadBalancerPoolMemberTargetPrototypeIP by calling from_dict on the json representation
- load_balancer_pool_member_target_prototype_ip_model_dict = LoadBalancerPoolMemberTargetPrototypeIP.from_dict(load_balancer_pool_member_target_prototype_ip_model_json).__dict__
- load_balancer_pool_member_target_prototype_ip_model2 = LoadBalancerPoolMemberTargetPrototypeIP(**load_balancer_pool_member_target_prototype_ip_model_dict)
+ # Construct a model instance of ShareProfileIOPSDependentRange by calling from_dict on the json representation
+ share_profile_iops_dependent_range_model_dict = ShareProfileIOPSDependentRange.from_dict(share_profile_iops_dependent_range_model_json).__dict__
+ share_profile_iops_dependent_range_model2 = ShareProfileIOPSDependentRange(**share_profile_iops_dependent_range_model_dict)
# Verify the model instances are equivalent
- assert load_balancer_pool_member_target_prototype_ip_model == load_balancer_pool_member_target_prototype_ip_model2
+ assert share_profile_iops_dependent_range_model == share_profile_iops_dependent_range_model2
# Convert model instance back to dict and verify no loss of data
- load_balancer_pool_member_target_prototype_ip_model_json2 = load_balancer_pool_member_target_prototype_ip_model.to_dict()
- assert load_balancer_pool_member_target_prototype_ip_model_json2 == load_balancer_pool_member_target_prototype_ip_model_json
+ share_profile_iops_dependent_range_model_json2 = share_profile_iops_dependent_range_model.to_dict()
+ assert share_profile_iops_dependent_range_model_json2 == share_profile_iops_dependent_range_model_json
-class TestModel_LoadBalancerPoolMemberTargetIP:
+class TestModel_ShareProfileIOPSEnum:
"""
- Test Class for LoadBalancerPoolMemberTargetIP
+ Test Class for ShareProfileIOPSEnum
"""
- def test_load_balancer_pool_member_target_ip_serialization(self):
+ def test_share_profile_iops_enum_serialization(self):
"""
- Test serialization/deserialization for LoadBalancerPoolMemberTargetIP
+ Test serialization/deserialization for ShareProfileIOPSEnum
"""
- # Construct a json representation of a LoadBalancerPoolMemberTargetIP model
- load_balancer_pool_member_target_ip_model_json = {}
- load_balancer_pool_member_target_ip_model_json['address'] = '192.168.3.4'
+ # Construct a json representation of a ShareProfileIOPSEnum model
+ share_profile_iops_enum_model_json = {}
+ share_profile_iops_enum_model_json['default'] = 38
+ share_profile_iops_enum_model_json['type'] = 'enum'
+ share_profile_iops_enum_model_json['values'] = [1000, 2000, 4000]
- # Construct a model instance of LoadBalancerPoolMemberTargetIP by calling from_dict on the json representation
- load_balancer_pool_member_target_ip_model = LoadBalancerPoolMemberTargetIP.from_dict(load_balancer_pool_member_target_ip_model_json)
- assert load_balancer_pool_member_target_ip_model != False
+ # Construct a model instance of ShareProfileIOPSEnum by calling from_dict on the json representation
+ share_profile_iops_enum_model = ShareProfileIOPSEnum.from_dict(share_profile_iops_enum_model_json)
+ assert share_profile_iops_enum_model != False
- # Construct a model instance of LoadBalancerPoolMemberTargetIP by calling from_dict on the json representation
- load_balancer_pool_member_target_ip_model_dict = LoadBalancerPoolMemberTargetIP.from_dict(load_balancer_pool_member_target_ip_model_json).__dict__
- load_balancer_pool_member_target_ip_model2 = LoadBalancerPoolMemberTargetIP(**load_balancer_pool_member_target_ip_model_dict)
+ # Construct a model instance of ShareProfileIOPSEnum by calling from_dict on the json representation
+ share_profile_iops_enum_model_dict = ShareProfileIOPSEnum.from_dict(share_profile_iops_enum_model_json).__dict__
+ share_profile_iops_enum_model2 = ShareProfileIOPSEnum(**share_profile_iops_enum_model_dict)
# Verify the model instances are equivalent
- assert load_balancer_pool_member_target_ip_model == load_balancer_pool_member_target_ip_model2
+ assert share_profile_iops_enum_model == share_profile_iops_enum_model2
# Convert model instance back to dict and verify no loss of data
- load_balancer_pool_member_target_ip_model_json2 = load_balancer_pool_member_target_ip_model.to_dict()
- assert load_balancer_pool_member_target_ip_model_json2 == load_balancer_pool_member_target_ip_model_json
+ share_profile_iops_enum_model_json2 = share_profile_iops_enum_model.to_dict()
+ assert share_profile_iops_enum_model_json2 == share_profile_iops_enum_model_json
-class TestModel_LoadBalancerPoolMemberTargetInstanceReference:
+class TestModel_ShareProfileIOPSFixed:
"""
- Test Class for LoadBalancerPoolMemberTargetInstanceReference
+ Test Class for ShareProfileIOPSFixed
"""
- def test_load_balancer_pool_member_target_instance_reference_serialization(self):
+ def test_share_profile_iops_fixed_serialization(self):
"""
- Test serialization/deserialization for LoadBalancerPoolMemberTargetInstanceReference
+ Test serialization/deserialization for ShareProfileIOPSFixed
"""
- # 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'
-
- # Construct a json representation of a LoadBalancerPoolMemberTargetInstanceReference model
- load_balancer_pool_member_target_instance_reference_model_json = {}
- load_balancer_pool_member_target_instance_reference_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a'
- load_balancer_pool_member_target_instance_reference_model_json['deleted'] = instance_reference_deleted_model
- load_balancer_pool_member_target_instance_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a'
- load_balancer_pool_member_target_instance_reference_model_json['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
- load_balancer_pool_member_target_instance_reference_model_json['name'] = 'my-instance'
+ # Construct a json representation of a ShareProfileIOPSFixed model
+ share_profile_iops_fixed_model_json = {}
+ share_profile_iops_fixed_model_json['type'] = 'fixed'
+ share_profile_iops_fixed_model_json['value'] = 4000
- # Construct a model instance of LoadBalancerPoolMemberTargetInstanceReference by calling from_dict on the json representation
- load_balancer_pool_member_target_instance_reference_model = LoadBalancerPoolMemberTargetInstanceReference.from_dict(load_balancer_pool_member_target_instance_reference_model_json)
- assert load_balancer_pool_member_target_instance_reference_model != False
+ # Construct a model instance of ShareProfileIOPSFixed by calling from_dict on the json representation
+ share_profile_iops_fixed_model = ShareProfileIOPSFixed.from_dict(share_profile_iops_fixed_model_json)
+ assert share_profile_iops_fixed_model != False
- # Construct a model instance of LoadBalancerPoolMemberTargetInstanceReference by calling from_dict on the json representation
- load_balancer_pool_member_target_instance_reference_model_dict = LoadBalancerPoolMemberTargetInstanceReference.from_dict(load_balancer_pool_member_target_instance_reference_model_json).__dict__
- load_balancer_pool_member_target_instance_reference_model2 = LoadBalancerPoolMemberTargetInstanceReference(**load_balancer_pool_member_target_instance_reference_model_dict)
+ # Construct a model instance of ShareProfileIOPSFixed by calling from_dict on the json representation
+ share_profile_iops_fixed_model_dict = ShareProfileIOPSFixed.from_dict(share_profile_iops_fixed_model_json).__dict__
+ share_profile_iops_fixed_model2 = ShareProfileIOPSFixed(**share_profile_iops_fixed_model_dict)
# Verify the model instances are equivalent
- assert load_balancer_pool_member_target_instance_reference_model == load_balancer_pool_member_target_instance_reference_model2
+ assert share_profile_iops_fixed_model == share_profile_iops_fixed_model2
# Convert model instance back to dict and verify no loss of data
- load_balancer_pool_member_target_instance_reference_model_json2 = load_balancer_pool_member_target_instance_reference_model.to_dict()
- assert load_balancer_pool_member_target_instance_reference_model_json2 == load_balancer_pool_member_target_instance_reference_model_json
+ share_profile_iops_fixed_model_json2 = share_profile_iops_fixed_model.to_dict()
+ assert share_profile_iops_fixed_model_json2 == share_profile_iops_fixed_model_json
-class TestModel_LoadBalancerProfileIdentityByHref:
+class TestModel_ShareProfileIOPSRange:
"""
- Test Class for LoadBalancerProfileIdentityByHref
+ Test Class for ShareProfileIOPSRange
"""
- def test_load_balancer_profile_identity_by_href_serialization(self):
+ def test_share_profile_iops_range_serialization(self):
"""
- Test serialization/deserialization for LoadBalancerProfileIdentityByHref
+ Test serialization/deserialization for ShareProfileIOPSRange
"""
- # Construct a json representation of a LoadBalancerProfileIdentityByHref model
- load_balancer_profile_identity_by_href_model_json = {}
- load_balancer_profile_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed'
+ # Construct a json representation of a ShareProfileIOPSRange model
+ share_profile_iops_range_model_json = {}
+ share_profile_iops_range_model_json['default'] = 38
+ share_profile_iops_range_model_json['max'] = 48000
+ share_profile_iops_range_model_json['min'] = 1000
+ share_profile_iops_range_model_json['step'] = 1
+ share_profile_iops_range_model_json['type'] = 'range'
- # Construct a model instance of LoadBalancerProfileIdentityByHref by calling from_dict on the json representation
- load_balancer_profile_identity_by_href_model = LoadBalancerProfileIdentityByHref.from_dict(load_balancer_profile_identity_by_href_model_json)
- assert load_balancer_profile_identity_by_href_model != False
+ # Construct a model instance of ShareProfileIOPSRange by calling from_dict on the json representation
+ share_profile_iops_range_model = ShareProfileIOPSRange.from_dict(share_profile_iops_range_model_json)
+ assert share_profile_iops_range_model != False
- # Construct a model instance of LoadBalancerProfileIdentityByHref by calling from_dict on the json representation
- load_balancer_profile_identity_by_href_model_dict = LoadBalancerProfileIdentityByHref.from_dict(load_balancer_profile_identity_by_href_model_json).__dict__
- load_balancer_profile_identity_by_href_model2 = LoadBalancerProfileIdentityByHref(**load_balancer_profile_identity_by_href_model_dict)
+ # Construct a model instance of ShareProfileIOPSRange by calling from_dict on the json representation
+ share_profile_iops_range_model_dict = ShareProfileIOPSRange.from_dict(share_profile_iops_range_model_json).__dict__
+ share_profile_iops_range_model2 = ShareProfileIOPSRange(**share_profile_iops_range_model_dict)
# Verify the model instances are equivalent
- assert load_balancer_profile_identity_by_href_model == load_balancer_profile_identity_by_href_model2
+ assert share_profile_iops_range_model == share_profile_iops_range_model2
# Convert model instance back to dict and verify no loss of data
- load_balancer_profile_identity_by_href_model_json2 = load_balancer_profile_identity_by_href_model.to_dict()
- assert load_balancer_profile_identity_by_href_model_json2 == load_balancer_profile_identity_by_href_model_json
+ share_profile_iops_range_model_json2 = share_profile_iops_range_model.to_dict()
+ assert share_profile_iops_range_model_json2 == share_profile_iops_range_model_json
-class TestModel_LoadBalancerProfileIdentityByName:
+class TestModel_ShareProfileIdentityByHref:
"""
- Test Class for LoadBalancerProfileIdentityByName
+ Test Class for ShareProfileIdentityByHref
"""
- def test_load_balancer_profile_identity_by_name_serialization(self):
+ def test_share_profile_identity_by_href_serialization(self):
"""
- Test serialization/deserialization for LoadBalancerProfileIdentityByName
+ Test serialization/deserialization for ShareProfileIdentityByHref
"""
- # Construct a json representation of a LoadBalancerProfileIdentityByName model
- load_balancer_profile_identity_by_name_model_json = {}
- load_balancer_profile_identity_by_name_model_json['name'] = 'network-fixed'
+ # Construct a json representation of a ShareProfileIdentityByHref model
+ share_profile_identity_by_href_model_json = {}
+ share_profile_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops'
- # Construct a model instance of LoadBalancerProfileIdentityByName by calling from_dict on the json representation
- load_balancer_profile_identity_by_name_model = LoadBalancerProfileIdentityByName.from_dict(load_balancer_profile_identity_by_name_model_json)
- assert load_balancer_profile_identity_by_name_model != False
+ # Construct a model instance of ShareProfileIdentityByHref by calling from_dict on the json representation
+ share_profile_identity_by_href_model = ShareProfileIdentityByHref.from_dict(share_profile_identity_by_href_model_json)
+ assert share_profile_identity_by_href_model != False
- # Construct a model instance of LoadBalancerProfileIdentityByName by calling from_dict on the json representation
- load_balancer_profile_identity_by_name_model_dict = LoadBalancerProfileIdentityByName.from_dict(load_balancer_profile_identity_by_name_model_json).__dict__
- load_balancer_profile_identity_by_name_model2 = LoadBalancerProfileIdentityByName(**load_balancer_profile_identity_by_name_model_dict)
+ # Construct a model instance of ShareProfileIdentityByHref by calling from_dict on the json representation
+ share_profile_identity_by_href_model_dict = ShareProfileIdentityByHref.from_dict(share_profile_identity_by_href_model_json).__dict__
+ share_profile_identity_by_href_model2 = ShareProfileIdentityByHref(**share_profile_identity_by_href_model_dict)
# Verify the model instances are equivalent
- assert load_balancer_profile_identity_by_name_model == load_balancer_profile_identity_by_name_model2
+ assert share_profile_identity_by_href_model == share_profile_identity_by_href_model2
# Convert model instance back to dict and verify no loss of data
- load_balancer_profile_identity_by_name_model_json2 = load_balancer_profile_identity_by_name_model.to_dict()
- assert load_balancer_profile_identity_by_name_model_json2 == load_balancer_profile_identity_by_name_model_json
+ share_profile_identity_by_href_model_json2 = share_profile_identity_by_href_model.to_dict()
+ assert share_profile_identity_by_href_model_json2 == share_profile_identity_by_href_model_json
-class TestModel_LoadBalancerProfileInstanceGroupsSupportedDependent:
+class TestModel_ShareProfileIdentityByName:
"""
- Test Class for LoadBalancerProfileInstanceGroupsSupportedDependent
+ Test Class for ShareProfileIdentityByName
"""
- def test_load_balancer_profile_instance_groups_supported_dependent_serialization(self):
+ def test_share_profile_identity_by_name_serialization(self):
"""
- Test serialization/deserialization for LoadBalancerProfileInstanceGroupsSupportedDependent
+ Test serialization/deserialization for ShareProfileIdentityByName
"""
- # Construct a json representation of a LoadBalancerProfileInstanceGroupsSupportedDependent model
- load_balancer_profile_instance_groups_supported_dependent_model_json = {}
- load_balancer_profile_instance_groups_supported_dependent_model_json['type'] = 'dependent'
+ # Construct a json representation of a ShareProfileIdentityByName model
+ share_profile_identity_by_name_model_json = {}
+ share_profile_identity_by_name_model_json['name'] = 'tier-3iops'
- # Construct a model instance of LoadBalancerProfileInstanceGroupsSupportedDependent by calling from_dict on the json representation
- load_balancer_profile_instance_groups_supported_dependent_model = LoadBalancerProfileInstanceGroupsSupportedDependent.from_dict(load_balancer_profile_instance_groups_supported_dependent_model_json)
- assert load_balancer_profile_instance_groups_supported_dependent_model != False
+ # Construct a model instance of ShareProfileIdentityByName by calling from_dict on the json representation
+ share_profile_identity_by_name_model = ShareProfileIdentityByName.from_dict(share_profile_identity_by_name_model_json)
+ assert share_profile_identity_by_name_model != False
- # Construct a model instance of LoadBalancerProfileInstanceGroupsSupportedDependent by calling from_dict on the json representation
- load_balancer_profile_instance_groups_supported_dependent_model_dict = LoadBalancerProfileInstanceGroupsSupportedDependent.from_dict(load_balancer_profile_instance_groups_supported_dependent_model_json).__dict__
- load_balancer_profile_instance_groups_supported_dependent_model2 = LoadBalancerProfileInstanceGroupsSupportedDependent(**load_balancer_profile_instance_groups_supported_dependent_model_dict)
+ # Construct a model instance of ShareProfileIdentityByName by calling from_dict on the json representation
+ share_profile_identity_by_name_model_dict = ShareProfileIdentityByName.from_dict(share_profile_identity_by_name_model_json).__dict__
+ share_profile_identity_by_name_model2 = ShareProfileIdentityByName(**share_profile_identity_by_name_model_dict)
# Verify the model instances are equivalent
- assert load_balancer_profile_instance_groups_supported_dependent_model == load_balancer_profile_instance_groups_supported_dependent_model2
+ assert share_profile_identity_by_name_model == share_profile_identity_by_name_model2
# Convert model instance back to dict and verify no loss of data
- load_balancer_profile_instance_groups_supported_dependent_model_json2 = load_balancer_profile_instance_groups_supported_dependent_model.to_dict()
- assert load_balancer_profile_instance_groups_supported_dependent_model_json2 == load_balancer_profile_instance_groups_supported_dependent_model_json
+ share_profile_identity_by_name_model_json2 = share_profile_identity_by_name_model.to_dict()
+ assert share_profile_identity_by_name_model_json2 == share_profile_identity_by_name_model_json
-class TestModel_LoadBalancerProfileInstanceGroupsSupportedFixed:
+class TestModel_SharePrototypeShareBySize:
"""
- Test Class for LoadBalancerProfileInstanceGroupsSupportedFixed
+ Test Class for SharePrototypeShareBySize
"""
- def test_load_balancer_profile_instance_groups_supported_fixed_serialization(self):
+ def test_share_prototype_share_by_size_serialization(self):
"""
- Test serialization/deserialization for LoadBalancerProfileInstanceGroupsSupportedFixed
+ Test serialization/deserialization for SharePrototypeShareBySize
"""
- # Construct a json representation of a LoadBalancerProfileInstanceGroupsSupportedFixed model
- load_balancer_profile_instance_groups_supported_fixed_model_json = {}
- load_balancer_profile_instance_groups_supported_fixed_model_json['type'] = 'fixed'
- load_balancer_profile_instance_groups_supported_fixed_model_json['value'] = True
+ # Construct dict forms of any model objects needed in order to build this model.
- # Construct a model instance of LoadBalancerProfileInstanceGroupsSupportedFixed by calling from_dict on the json representation
- load_balancer_profile_instance_groups_supported_fixed_model = LoadBalancerProfileInstanceGroupsSupportedFixed.from_dict(load_balancer_profile_instance_groups_supported_fixed_model_json)
- assert load_balancer_profile_instance_groups_supported_fixed_model != False
+ virtual_network_interface_ip_prototype_model = {} # VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext
+ virtual_network_interface_ip_prototype_model['address'] = '10.0.0.5'
+ virtual_network_interface_ip_prototype_model['auto_delete'] = False
+ virtual_network_interface_ip_prototype_model['name'] = 'my-reserved-ip'
- # Construct a model instance of LoadBalancerProfileInstanceGroupsSupportedFixed by calling from_dict on the json representation
- load_balancer_profile_instance_groups_supported_fixed_model_dict = LoadBalancerProfileInstanceGroupsSupportedFixed.from_dict(load_balancer_profile_instance_groups_supported_fixed_model_json).__dict__
- load_balancer_profile_instance_groups_supported_fixed_model2 = LoadBalancerProfileInstanceGroupsSupportedFixed(**load_balancer_profile_instance_groups_supported_fixed_model_dict)
+ virtual_network_interface_primary_ip_prototype_model = {} # VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext
+ virtual_network_interface_primary_ip_prototype_model['address'] = '10.0.0.5'
+ virtual_network_interface_primary_ip_prototype_model['auto_delete'] = False
+ virtual_network_interface_primary_ip_prototype_model['name'] = 'my-reserved-ip'
- # Verify the model instances are equivalent
- assert load_balancer_profile_instance_groups_supported_fixed_model == load_balancer_profile_instance_groups_supported_fixed_model2
+ resource_group_identity_model = {} # ResourceGroupIdentityById
+ resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
- # Convert model instance back to dict and verify no loss of data
- load_balancer_profile_instance_groups_supported_fixed_model_json2 = load_balancer_profile_instance_groups_supported_fixed_model.to_dict()
- assert load_balancer_profile_instance_groups_supported_fixed_model_json2 == load_balancer_profile_instance_groups_supported_fixed_model_json
+ 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'
-class TestModel_LoadBalancerProfileRouteModeSupportedDependent:
- """
- Test Class for LoadBalancerProfileRouteModeSupportedDependent
- """
+ share_mount_target_virtual_network_interface_prototype_model = {} # ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfacePrototypeShareMountTargetContext
+ share_mount_target_virtual_network_interface_prototype_model['allow_ip_spoofing'] = True
+ share_mount_target_virtual_network_interface_prototype_model['auto_delete'] = False
+ share_mount_target_virtual_network_interface_prototype_model['enable_infrastructure_nat'] = True
+ share_mount_target_virtual_network_interface_prototype_model['ips'] = [virtual_network_interface_ip_prototype_model]
+ share_mount_target_virtual_network_interface_prototype_model['name'] = 'my-virtual-network-interface'
+ share_mount_target_virtual_network_interface_prototype_model['primary_ip'] = virtual_network_interface_primary_ip_prototype_model
+ share_mount_target_virtual_network_interface_prototype_model['resource_group'] = resource_group_identity_model
+ share_mount_target_virtual_network_interface_prototype_model['security_groups'] = [security_group_identity_model]
+ share_mount_target_virtual_network_interface_prototype_model['subnet'] = subnet_identity_model
- def test_load_balancer_profile_route_mode_supported_dependent_serialization(self):
- """
- Test serialization/deserialization for LoadBalancerProfileRouteModeSupportedDependent
- """
+ share_mount_target_prototype_model = {} # ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup
+ share_mount_target_prototype_model['name'] = 'my-share-mount-target'
+ share_mount_target_prototype_model['transit_encryption'] = 'none'
+ share_mount_target_prototype_model['virtual_network_interface'] = share_mount_target_virtual_network_interface_prototype_model
- # Construct a json representation of a LoadBalancerProfileRouteModeSupportedDependent model
- load_balancer_profile_route_mode_supported_dependent_model_json = {}
- load_balancer_profile_route_mode_supported_dependent_model_json['type'] = 'dependent'
+ share_profile_identity_model = {} # ShareProfileIdentityByName
+ share_profile_identity_model['name'] = 'tier-3iops'
- # Construct a model instance of LoadBalancerProfileRouteModeSupportedDependent by calling from_dict on the json representation
- load_balancer_profile_route_mode_supported_dependent_model = LoadBalancerProfileRouteModeSupportedDependent.from_dict(load_balancer_profile_route_mode_supported_dependent_model_json)
- assert load_balancer_profile_route_mode_supported_dependent_model != False
+ zone_identity_model = {} # ZoneIdentityByName
+ zone_identity_model['name'] = 'us-south-1'
- # Construct a model instance of LoadBalancerProfileRouteModeSupportedDependent by calling from_dict on the json representation
- load_balancer_profile_route_mode_supported_dependent_model_dict = LoadBalancerProfileRouteModeSupportedDependent.from_dict(load_balancer_profile_route_mode_supported_dependent_model_json).__dict__
- load_balancer_profile_route_mode_supported_dependent_model2 = LoadBalancerProfileRouteModeSupportedDependent(**load_balancer_profile_route_mode_supported_dependent_model_dict)
+ share_prototype_share_context_model = {} # SharePrototypeShareContext
+ share_prototype_share_context_model['iops'] = 100
+ share_prototype_share_context_model['mount_targets'] = [share_mount_target_prototype_model]
+ share_prototype_share_context_model['name'] = 'my-share'
+ share_prototype_share_context_model['profile'] = share_profile_identity_model
+ share_prototype_share_context_model['replication_cron_spec'] = '0 */5 * * *'
+ share_prototype_share_context_model['resource_group'] = resource_group_identity_model
+ share_prototype_share_context_model['user_tags'] = []
+ share_prototype_share_context_model['zone'] = zone_identity_model
+
+ encryption_key_identity_model = {} # EncryptionKeyIdentityByCRN
+ encryption_key_identity_model['crn'] = 'crn:v1:bluemix:public:kms:us-south:a/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179'
+
+ share_initial_owner_model = {} # ShareInitialOwner
+ share_initial_owner_model['gid'] = 50
+ share_initial_owner_model['uid'] = 50
+
+ # Construct a json representation of a SharePrototypeShareBySize model
+ share_prototype_share_by_size_model_json = {}
+ share_prototype_share_by_size_model_json['iops'] = 100
+ share_prototype_share_by_size_model_json['mount_targets'] = [share_mount_target_prototype_model]
+ share_prototype_share_by_size_model_json['name'] = 'my-share'
+ share_prototype_share_by_size_model_json['profile'] = share_profile_identity_model
+ share_prototype_share_by_size_model_json['replica_share'] = share_prototype_share_context_model
+ share_prototype_share_by_size_model_json['user_tags'] = []
+ share_prototype_share_by_size_model_json['zone'] = zone_identity_model
+ share_prototype_share_by_size_model_json['access_control_mode'] = 'security_group'
+ share_prototype_share_by_size_model_json['encryption_key'] = encryption_key_identity_model
+ share_prototype_share_by_size_model_json['initial_owner'] = share_initial_owner_model
+ share_prototype_share_by_size_model_json['resource_group'] = resource_group_identity_model
+ share_prototype_share_by_size_model_json['size'] = 200
+
+ # Construct a model instance of SharePrototypeShareBySize by calling from_dict on the json representation
+ share_prototype_share_by_size_model = SharePrototypeShareBySize.from_dict(share_prototype_share_by_size_model_json)
+ assert share_prototype_share_by_size_model != False
+
+ # Construct a model instance of SharePrototypeShareBySize by calling from_dict on the json representation
+ share_prototype_share_by_size_model_dict = SharePrototypeShareBySize.from_dict(share_prototype_share_by_size_model_json).__dict__
+ share_prototype_share_by_size_model2 = SharePrototypeShareBySize(**share_prototype_share_by_size_model_dict)
# Verify the model instances are equivalent
- assert load_balancer_profile_route_mode_supported_dependent_model == load_balancer_profile_route_mode_supported_dependent_model2
+ assert share_prototype_share_by_size_model == share_prototype_share_by_size_model2
# Convert model instance back to dict and verify no loss of data
- load_balancer_profile_route_mode_supported_dependent_model_json2 = load_balancer_profile_route_mode_supported_dependent_model.to_dict()
- assert load_balancer_profile_route_mode_supported_dependent_model_json2 == load_balancer_profile_route_mode_supported_dependent_model_json
+ share_prototype_share_by_size_model_json2 = share_prototype_share_by_size_model.to_dict()
+ assert share_prototype_share_by_size_model_json2 == share_prototype_share_by_size_model_json
-class TestModel_LoadBalancerProfileRouteModeSupportedFixed:
+class TestModel_SharePrototypeShareBySourceShare:
"""
- Test Class for LoadBalancerProfileRouteModeSupportedFixed
+ Test Class for SharePrototypeShareBySourceShare
"""
- def test_load_balancer_profile_route_mode_supported_fixed_serialization(self):
+ def test_share_prototype_share_by_source_share_serialization(self):
"""
- Test serialization/deserialization for LoadBalancerProfileRouteModeSupportedFixed
+ Test serialization/deserialization for SharePrototypeShareBySourceShare
"""
- # Construct a json representation of a LoadBalancerProfileRouteModeSupportedFixed model
- load_balancer_profile_route_mode_supported_fixed_model_json = {}
- load_balancer_profile_route_mode_supported_fixed_model_json['type'] = 'fixed'
- load_balancer_profile_route_mode_supported_fixed_model_json['value'] = True
+ # Construct dict forms of any model objects needed in order to build this model.
- # Construct a model instance of LoadBalancerProfileRouteModeSupportedFixed by calling from_dict on the json representation
- load_balancer_profile_route_mode_supported_fixed_model = LoadBalancerProfileRouteModeSupportedFixed.from_dict(load_balancer_profile_route_mode_supported_fixed_model_json)
- assert load_balancer_profile_route_mode_supported_fixed_model != False
+ virtual_network_interface_ip_prototype_model = {} # VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext
+ virtual_network_interface_ip_prototype_model['address'] = '10.0.0.5'
+ virtual_network_interface_ip_prototype_model['auto_delete'] = False
+ virtual_network_interface_ip_prototype_model['name'] = 'my-reserved-ip'
+
+ virtual_network_interface_primary_ip_prototype_model = {} # VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext
+ virtual_network_interface_primary_ip_prototype_model['address'] = '10.0.0.5'
+ virtual_network_interface_primary_ip_prototype_model['auto_delete'] = False
+ virtual_network_interface_primary_ip_prototype_model['name'] = 'my-reserved-ip'
+
+ resource_group_identity_model = {} # ResourceGroupIdentityById
+ resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
+
+ security_group_identity_model = {} # SecurityGroupIdentityById
+ security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271'
+
+ subnet_identity_model = {} # SubnetIdentityById
+ subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
+
+ share_mount_target_virtual_network_interface_prototype_model = {} # ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfacePrototypeShareMountTargetContext
+ share_mount_target_virtual_network_interface_prototype_model['allow_ip_spoofing'] = True
+ share_mount_target_virtual_network_interface_prototype_model['auto_delete'] = False
+ share_mount_target_virtual_network_interface_prototype_model['enable_infrastructure_nat'] = True
+ share_mount_target_virtual_network_interface_prototype_model['ips'] = [virtual_network_interface_ip_prototype_model]
+ share_mount_target_virtual_network_interface_prototype_model['name'] = 'my-virtual-network-interface'
+ share_mount_target_virtual_network_interface_prototype_model['primary_ip'] = virtual_network_interface_primary_ip_prototype_model
+ share_mount_target_virtual_network_interface_prototype_model['resource_group'] = resource_group_identity_model
+ share_mount_target_virtual_network_interface_prototype_model['security_groups'] = [security_group_identity_model]
+ share_mount_target_virtual_network_interface_prototype_model['subnet'] = subnet_identity_model
+
+ share_mount_target_prototype_model = {} # ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup
+ share_mount_target_prototype_model['name'] = 'my-share-mount-target'
+ share_mount_target_prototype_model['transit_encryption'] = 'none'
+ share_mount_target_prototype_model['virtual_network_interface'] = share_mount_target_virtual_network_interface_prototype_model
+
+ share_profile_identity_model = {} # ShareProfileIdentityByName
+ share_profile_identity_model['name'] = 'tier-3iops'
+
+ zone_identity_model = {} # ZoneIdentityByName
+ zone_identity_model['name'] = 'us-south-1'
+
+ share_prototype_share_context_model = {} # SharePrototypeShareContext
+ share_prototype_share_context_model['iops'] = 100
+ share_prototype_share_context_model['mount_targets'] = [share_mount_target_prototype_model]
+ share_prototype_share_context_model['name'] = 'my-share'
+ share_prototype_share_context_model['profile'] = share_profile_identity_model
+ share_prototype_share_context_model['replication_cron_spec'] = '0 */5 * * *'
+ share_prototype_share_context_model['resource_group'] = resource_group_identity_model
+ share_prototype_share_context_model['user_tags'] = []
+ share_prototype_share_context_model['zone'] = zone_identity_model
+
+ encryption_key_identity_model = {} # EncryptionKeyIdentityByCRN
+ encryption_key_identity_model['crn'] = 'crn:v1:bluemix:public:kms:us-south:a/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179'
+
+ share_identity_model = {} # ShareIdentityById
+ share_identity_model['id'] = '0fe9e5d8-0a4d-4818-96ec-e99708644a58'
+
+ # Construct a json representation of a SharePrototypeShareBySourceShare model
+ share_prototype_share_by_source_share_model_json = {}
+ share_prototype_share_by_source_share_model_json['iops'] = 100
+ share_prototype_share_by_source_share_model_json['mount_targets'] = [share_mount_target_prototype_model]
+ share_prototype_share_by_source_share_model_json['name'] = 'my-share'
+ share_prototype_share_by_source_share_model_json['profile'] = share_profile_identity_model
+ share_prototype_share_by_source_share_model_json['replica_share'] = share_prototype_share_context_model
+ share_prototype_share_by_source_share_model_json['user_tags'] = []
+ share_prototype_share_by_source_share_model_json['zone'] = zone_identity_model
+ share_prototype_share_by_source_share_model_json['encryption_key'] = encryption_key_identity_model
+ share_prototype_share_by_source_share_model_json['replication_cron_spec'] = '0 */5 * * *'
+ share_prototype_share_by_source_share_model_json['resource_group'] = resource_group_identity_model
+ share_prototype_share_by_source_share_model_json['source_share'] = share_identity_model
+
+ # Construct a model instance of SharePrototypeShareBySourceShare by calling from_dict on the json representation
+ share_prototype_share_by_source_share_model = SharePrototypeShareBySourceShare.from_dict(share_prototype_share_by_source_share_model_json)
+ assert share_prototype_share_by_source_share_model != False
- # Construct a model instance of LoadBalancerProfileRouteModeSupportedFixed by calling from_dict on the json representation
- load_balancer_profile_route_mode_supported_fixed_model_dict = LoadBalancerProfileRouteModeSupportedFixed.from_dict(load_balancer_profile_route_mode_supported_fixed_model_json).__dict__
- load_balancer_profile_route_mode_supported_fixed_model2 = LoadBalancerProfileRouteModeSupportedFixed(**load_balancer_profile_route_mode_supported_fixed_model_dict)
+ # Construct a model instance of SharePrototypeShareBySourceShare by calling from_dict on the json representation
+ share_prototype_share_by_source_share_model_dict = SharePrototypeShareBySourceShare.from_dict(share_prototype_share_by_source_share_model_json).__dict__
+ share_prototype_share_by_source_share_model2 = SharePrototypeShareBySourceShare(**share_prototype_share_by_source_share_model_dict)
# Verify the model instances are equivalent
- assert load_balancer_profile_route_mode_supported_fixed_model == load_balancer_profile_route_mode_supported_fixed_model2
+ assert share_prototype_share_by_source_share_model == share_prototype_share_by_source_share_model2
# Convert model instance back to dict and verify no loss of data
- load_balancer_profile_route_mode_supported_fixed_model_json2 = load_balancer_profile_route_mode_supported_fixed_model.to_dict()
- assert load_balancer_profile_route_mode_supported_fixed_model_json2 == load_balancer_profile_route_mode_supported_fixed_model_json
+ share_prototype_share_by_source_share_model_json2 = share_prototype_share_by_source_share_model.to_dict()
+ assert share_prototype_share_by_source_share_model_json2 == share_prototype_share_by_source_share_model_json
-class TestModel_LoadBalancerProfileSecurityGroupsSupportedDependent:
+class TestModel_SnapshotConsistencyGroupPrototypeSnapshotConsistencyGroupBySnapshots:
"""
- Test Class for LoadBalancerProfileSecurityGroupsSupportedDependent
+ Test Class for SnapshotConsistencyGroupPrototypeSnapshotConsistencyGroupBySnapshots
"""
- def test_load_balancer_profile_security_groups_supported_dependent_serialization(self):
+ def test_snapshot_consistency_group_prototype_snapshot_consistency_group_by_snapshots_serialization(self):
"""
- Test serialization/deserialization for LoadBalancerProfileSecurityGroupsSupportedDependent
+ Test serialization/deserialization for SnapshotConsistencyGroupPrototypeSnapshotConsistencyGroupBySnapshots
"""
- # Construct a json representation of a LoadBalancerProfileSecurityGroupsSupportedDependent model
- load_balancer_profile_security_groups_supported_dependent_model_json = {}
- load_balancer_profile_security_groups_supported_dependent_model_json['type'] = 'dependent'
-
- # Construct a model instance of LoadBalancerProfileSecurityGroupsSupportedDependent by calling from_dict on the json representation
- load_balancer_profile_security_groups_supported_dependent_model = LoadBalancerProfileSecurityGroupsSupportedDependent.from_dict(load_balancer_profile_security_groups_supported_dependent_model_json)
- assert load_balancer_profile_security_groups_supported_dependent_model != False
-
- # Construct a model instance of LoadBalancerProfileSecurityGroupsSupportedDependent by calling from_dict on the json representation
- load_balancer_profile_security_groups_supported_dependent_model_dict = LoadBalancerProfileSecurityGroupsSupportedDependent.from_dict(load_balancer_profile_security_groups_supported_dependent_model_json).__dict__
- load_balancer_profile_security_groups_supported_dependent_model2 = LoadBalancerProfileSecurityGroupsSupportedDependent(**load_balancer_profile_security_groups_supported_dependent_model_dict)
-
- # Verify the model instances are equivalent
- assert load_balancer_profile_security_groups_supported_dependent_model == load_balancer_profile_security_groups_supported_dependent_model2
-
- # Convert model instance back to dict and verify no loss of data
- load_balancer_profile_security_groups_supported_dependent_model_json2 = load_balancer_profile_security_groups_supported_dependent_model.to_dict()
- assert load_balancer_profile_security_groups_supported_dependent_model_json2 == load_balancer_profile_security_groups_supported_dependent_model_json
+ # 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'
-class TestModel_LoadBalancerProfileSecurityGroupsSupportedFixed:
- """
- Test Class for LoadBalancerProfileSecurityGroupsSupportedFixed
- """
+ volume_identity_model = {} # VolumeIdentityById
+ volume_identity_model['id'] = '1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
- def test_load_balancer_profile_security_groups_supported_fixed_serialization(self):
- """
- Test serialization/deserialization for LoadBalancerProfileSecurityGroupsSupportedFixed
- """
+ snapshot_prototype_snapshot_consistency_group_context_model = {} # SnapshotPrototypeSnapshotConsistencyGroupContext
+ snapshot_prototype_snapshot_consistency_group_context_model['name'] = 'my-snapshot'
+ snapshot_prototype_snapshot_consistency_group_context_model['source_volume'] = volume_identity_model
+ snapshot_prototype_snapshot_consistency_group_context_model['user_tags'] = ['testString']
- # Construct a json representation of a LoadBalancerProfileSecurityGroupsSupportedFixed model
- load_balancer_profile_security_groups_supported_fixed_model_json = {}
- load_balancer_profile_security_groups_supported_fixed_model_json['type'] = 'fixed'
- load_balancer_profile_security_groups_supported_fixed_model_json['value'] = True
+ # Construct a json representation of a SnapshotConsistencyGroupPrototypeSnapshotConsistencyGroupBySnapshots model
+ snapshot_consistency_group_prototype_snapshot_consistency_group_by_snapshots_model_json = {}
+ snapshot_consistency_group_prototype_snapshot_consistency_group_by_snapshots_model_json['delete_snapshots_on_delete'] = True
+ snapshot_consistency_group_prototype_snapshot_consistency_group_by_snapshots_model_json['name'] = 'my-snapshot-consistency-group'
+ snapshot_consistency_group_prototype_snapshot_consistency_group_by_snapshots_model_json['resource_group'] = resource_group_identity_model
+ snapshot_consistency_group_prototype_snapshot_consistency_group_by_snapshots_model_json['snapshots'] = [snapshot_prototype_snapshot_consistency_group_context_model]
- # Construct a model instance of LoadBalancerProfileSecurityGroupsSupportedFixed by calling from_dict on the json representation
- load_balancer_profile_security_groups_supported_fixed_model = LoadBalancerProfileSecurityGroupsSupportedFixed.from_dict(load_balancer_profile_security_groups_supported_fixed_model_json)
- assert load_balancer_profile_security_groups_supported_fixed_model != False
+ # Construct a model instance of SnapshotConsistencyGroupPrototypeSnapshotConsistencyGroupBySnapshots by calling from_dict on the json representation
+ snapshot_consistency_group_prototype_snapshot_consistency_group_by_snapshots_model = SnapshotConsistencyGroupPrototypeSnapshotConsistencyGroupBySnapshots.from_dict(snapshot_consistency_group_prototype_snapshot_consistency_group_by_snapshots_model_json)
+ assert snapshot_consistency_group_prototype_snapshot_consistency_group_by_snapshots_model != False
- # Construct a model instance of LoadBalancerProfileSecurityGroupsSupportedFixed by calling from_dict on the json representation
- load_balancer_profile_security_groups_supported_fixed_model_dict = LoadBalancerProfileSecurityGroupsSupportedFixed.from_dict(load_balancer_profile_security_groups_supported_fixed_model_json).__dict__
- load_balancer_profile_security_groups_supported_fixed_model2 = LoadBalancerProfileSecurityGroupsSupportedFixed(**load_balancer_profile_security_groups_supported_fixed_model_dict)
+ # Construct a model instance of SnapshotConsistencyGroupPrototypeSnapshotConsistencyGroupBySnapshots by calling from_dict on the json representation
+ snapshot_consistency_group_prototype_snapshot_consistency_group_by_snapshots_model_dict = SnapshotConsistencyGroupPrototypeSnapshotConsistencyGroupBySnapshots.from_dict(snapshot_consistency_group_prototype_snapshot_consistency_group_by_snapshots_model_json).__dict__
+ snapshot_consistency_group_prototype_snapshot_consistency_group_by_snapshots_model2 = SnapshotConsistencyGroupPrototypeSnapshotConsistencyGroupBySnapshots(**snapshot_consistency_group_prototype_snapshot_consistency_group_by_snapshots_model_dict)
# Verify the model instances are equivalent
- assert load_balancer_profile_security_groups_supported_fixed_model == load_balancer_profile_security_groups_supported_fixed_model2
+ assert snapshot_consistency_group_prototype_snapshot_consistency_group_by_snapshots_model == snapshot_consistency_group_prototype_snapshot_consistency_group_by_snapshots_model2
# Convert model instance back to dict and verify no loss of data
- load_balancer_profile_security_groups_supported_fixed_model_json2 = load_balancer_profile_security_groups_supported_fixed_model.to_dict()
- assert load_balancer_profile_security_groups_supported_fixed_model_json2 == load_balancer_profile_security_groups_supported_fixed_model_json
+ snapshot_consistency_group_prototype_snapshot_consistency_group_by_snapshots_model_json2 = snapshot_consistency_group_prototype_snapshot_consistency_group_by_snapshots_model.to_dict()
+ assert snapshot_consistency_group_prototype_snapshot_consistency_group_by_snapshots_model_json2 == snapshot_consistency_group_prototype_snapshot_consistency_group_by_snapshots_model_json
-class TestModel_LoadBalancerProfileUDPSupportedDependent:
+class TestModel_SnapshotIdentityByCRN:
"""
- Test Class for LoadBalancerProfileUDPSupportedDependent
+ Test Class for SnapshotIdentityByCRN
"""
- def test_load_balancer_profile_udp_supported_dependent_serialization(self):
+ def test_snapshot_identity_by_crn_serialization(self):
"""
- Test serialization/deserialization for LoadBalancerProfileUDPSupportedDependent
+ Test serialization/deserialization for SnapshotIdentityByCRN
"""
- # Construct a json representation of a LoadBalancerProfileUDPSupportedDependent model
- load_balancer_profile_udp_supported_dependent_model_json = {}
- load_balancer_profile_udp_supported_dependent_model_json['type'] = 'dependent'
+ # Construct a json representation of a SnapshotIdentityByCRN model
+ snapshot_identity_by_crn_model_json = {}
+ snapshot_identity_by_crn_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263'
- # Construct a model instance of LoadBalancerProfileUDPSupportedDependent by calling from_dict on the json representation
- load_balancer_profile_udp_supported_dependent_model = LoadBalancerProfileUDPSupportedDependent.from_dict(load_balancer_profile_udp_supported_dependent_model_json)
- assert load_balancer_profile_udp_supported_dependent_model != False
+ # Construct a model instance of SnapshotIdentityByCRN by calling from_dict on the json representation
+ snapshot_identity_by_crn_model = SnapshotIdentityByCRN.from_dict(snapshot_identity_by_crn_model_json)
+ assert snapshot_identity_by_crn_model != False
- # Construct a model instance of LoadBalancerProfileUDPSupportedDependent by calling from_dict on the json representation
- load_balancer_profile_udp_supported_dependent_model_dict = LoadBalancerProfileUDPSupportedDependent.from_dict(load_balancer_profile_udp_supported_dependent_model_json).__dict__
- load_balancer_profile_udp_supported_dependent_model2 = LoadBalancerProfileUDPSupportedDependent(**load_balancer_profile_udp_supported_dependent_model_dict)
+ # Construct a model instance of SnapshotIdentityByCRN by calling from_dict on the json representation
+ snapshot_identity_by_crn_model_dict = SnapshotIdentityByCRN.from_dict(snapshot_identity_by_crn_model_json).__dict__
+ snapshot_identity_by_crn_model2 = SnapshotIdentityByCRN(**snapshot_identity_by_crn_model_dict)
# Verify the model instances are equivalent
- assert load_balancer_profile_udp_supported_dependent_model == load_balancer_profile_udp_supported_dependent_model2
+ assert snapshot_identity_by_crn_model == snapshot_identity_by_crn_model2
# Convert model instance back to dict and verify no loss of data
- load_balancer_profile_udp_supported_dependent_model_json2 = load_balancer_profile_udp_supported_dependent_model.to_dict()
- assert load_balancer_profile_udp_supported_dependent_model_json2 == load_balancer_profile_udp_supported_dependent_model_json
+ snapshot_identity_by_crn_model_json2 = snapshot_identity_by_crn_model.to_dict()
+ assert snapshot_identity_by_crn_model_json2 == snapshot_identity_by_crn_model_json
-class TestModel_LoadBalancerProfileUDPSupportedFixed:
+class TestModel_SnapshotIdentityByHref:
"""
- Test Class for LoadBalancerProfileUDPSupportedFixed
+ Test Class for SnapshotIdentityByHref
"""
- def test_load_balancer_profile_udp_supported_fixed_serialization(self):
+ def test_snapshot_identity_by_href_serialization(self):
"""
- Test serialization/deserialization for LoadBalancerProfileUDPSupportedFixed
+ Test serialization/deserialization for SnapshotIdentityByHref
"""
- # Construct a json representation of a LoadBalancerProfileUDPSupportedFixed model
- load_balancer_profile_udp_supported_fixed_model_json = {}
- load_balancer_profile_udp_supported_fixed_model_json['type'] = 'fixed'
- load_balancer_profile_udp_supported_fixed_model_json['value'] = True
+ # Construct a json representation of a SnapshotIdentityByHref model
+ snapshot_identity_by_href_model_json = {}
+ snapshot_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263'
- # Construct a model instance of LoadBalancerProfileUDPSupportedFixed by calling from_dict on the json representation
- load_balancer_profile_udp_supported_fixed_model = LoadBalancerProfileUDPSupportedFixed.from_dict(load_balancer_profile_udp_supported_fixed_model_json)
- assert load_balancer_profile_udp_supported_fixed_model != False
+ # Construct a model instance of SnapshotIdentityByHref by calling from_dict on the json representation
+ snapshot_identity_by_href_model = SnapshotIdentityByHref.from_dict(snapshot_identity_by_href_model_json)
+ assert snapshot_identity_by_href_model != False
- # Construct a model instance of LoadBalancerProfileUDPSupportedFixed by calling from_dict on the json representation
- load_balancer_profile_udp_supported_fixed_model_dict = LoadBalancerProfileUDPSupportedFixed.from_dict(load_balancer_profile_udp_supported_fixed_model_json).__dict__
- load_balancer_profile_udp_supported_fixed_model2 = LoadBalancerProfileUDPSupportedFixed(**load_balancer_profile_udp_supported_fixed_model_dict)
+ # Construct a model instance of SnapshotIdentityByHref by calling from_dict on the json representation
+ snapshot_identity_by_href_model_dict = SnapshotIdentityByHref.from_dict(snapshot_identity_by_href_model_json).__dict__
+ snapshot_identity_by_href_model2 = SnapshotIdentityByHref(**snapshot_identity_by_href_model_dict)
# Verify the model instances are equivalent
- assert load_balancer_profile_udp_supported_fixed_model == load_balancer_profile_udp_supported_fixed_model2
+ assert snapshot_identity_by_href_model == snapshot_identity_by_href_model2
# Convert model instance back to dict and verify no loss of data
- load_balancer_profile_udp_supported_fixed_model_json2 = load_balancer_profile_udp_supported_fixed_model.to_dict()
- assert load_balancer_profile_udp_supported_fixed_model_json2 == load_balancer_profile_udp_supported_fixed_model_json
+ snapshot_identity_by_href_model_json2 = snapshot_identity_by_href_model.to_dict()
+ assert snapshot_identity_by_href_model_json2 == snapshot_identity_by_href_model_json
-class TestModel_NetworkACLIdentityByCRN:
+class TestModel_SnapshotIdentityById:
"""
- Test Class for NetworkACLIdentityByCRN
+ Test Class for SnapshotIdentityById
"""
- def test_network_acl_identity_by_crn_serialization(self):
+ def test_snapshot_identity_by_id_serialization(self):
"""
- Test serialization/deserialization for NetworkACLIdentityByCRN
+ Test serialization/deserialization for SnapshotIdentityById
"""
- # Construct a json representation of a NetworkACLIdentityByCRN model
- network_acl_identity_by_crn_model_json = {}
- network_acl_identity_by_crn_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf'
+ # Construct a json representation of a SnapshotIdentityById model
+ snapshot_identity_by_id_model_json = {}
+ snapshot_identity_by_id_model_json['id'] = 'r134-f6bfa329-0e36-433f-a3bb-0df632e79263'
- # Construct a model instance of NetworkACLIdentityByCRN by calling from_dict on the json representation
- network_acl_identity_by_crn_model = NetworkACLIdentityByCRN.from_dict(network_acl_identity_by_crn_model_json)
- assert network_acl_identity_by_crn_model != False
+ # Construct a model instance of SnapshotIdentityById by calling from_dict on the json representation
+ snapshot_identity_by_id_model = SnapshotIdentityById.from_dict(snapshot_identity_by_id_model_json)
+ assert snapshot_identity_by_id_model != False
- # Construct a model instance of NetworkACLIdentityByCRN by calling from_dict on the json representation
- network_acl_identity_by_crn_model_dict = NetworkACLIdentityByCRN.from_dict(network_acl_identity_by_crn_model_json).__dict__
- network_acl_identity_by_crn_model2 = NetworkACLIdentityByCRN(**network_acl_identity_by_crn_model_dict)
+ # Construct a model instance of SnapshotIdentityById by calling from_dict on the json representation
+ snapshot_identity_by_id_model_dict = SnapshotIdentityById.from_dict(snapshot_identity_by_id_model_json).__dict__
+ snapshot_identity_by_id_model2 = SnapshotIdentityById(**snapshot_identity_by_id_model_dict)
# Verify the model instances are equivalent
- assert network_acl_identity_by_crn_model == network_acl_identity_by_crn_model2
+ assert snapshot_identity_by_id_model == snapshot_identity_by_id_model2
# Convert model instance back to dict and verify no loss of data
- network_acl_identity_by_crn_model_json2 = network_acl_identity_by_crn_model.to_dict()
- assert network_acl_identity_by_crn_model_json2 == network_acl_identity_by_crn_model_json
+ snapshot_identity_by_id_model_json2 = snapshot_identity_by_id_model.to_dict()
+ assert snapshot_identity_by_id_model_json2 == snapshot_identity_by_id_model_json
-class TestModel_NetworkACLIdentityByHref:
+class TestModel_SnapshotPrototypeSnapshotBySourceSnapshot:
"""
- Test Class for NetworkACLIdentityByHref
+ Test Class for SnapshotPrototypeSnapshotBySourceSnapshot
"""
- def test_network_acl_identity_by_href_serialization(self):
+ def test_snapshot_prototype_snapshot_by_source_snapshot_serialization(self):
"""
- Test serialization/deserialization for NetworkACLIdentityByHref
+ Test serialization/deserialization for SnapshotPrototypeSnapshotBySourceSnapshot
"""
- # Construct a json representation of a NetworkACLIdentityByHref model
- network_acl_identity_by_href_model_json = {}
- network_acl_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf'
-
- # Construct a model instance of NetworkACLIdentityByHref by calling from_dict on the json representation
- network_acl_identity_by_href_model = NetworkACLIdentityByHref.from_dict(network_acl_identity_by_href_model_json)
- assert network_acl_identity_by_href_model != False
-
- # Construct a model instance of NetworkACLIdentityByHref by calling from_dict on the json representation
- network_acl_identity_by_href_model_dict = NetworkACLIdentityByHref.from_dict(network_acl_identity_by_href_model_json).__dict__
- network_acl_identity_by_href_model2 = NetworkACLIdentityByHref(**network_acl_identity_by_href_model_dict)
+ # Construct dict forms of any model objects needed in order to build this model.
- # Verify the model instances are equivalent
- assert network_acl_identity_by_href_model == network_acl_identity_by_href_model2
+ zone_identity_model = {} # ZoneIdentityByName
+ zone_identity_model['name'] = 'us-south-1'
- # Convert model instance back to dict and verify no loss of data
- network_acl_identity_by_href_model_json2 = network_acl_identity_by_href_model.to_dict()
- assert network_acl_identity_by_href_model_json2 == network_acl_identity_by_href_model_json
+ snapshot_clone_prototype_model = {} # SnapshotClonePrototype
+ snapshot_clone_prototype_model['zone'] = zone_identity_model
+ resource_group_identity_model = {} # ResourceGroupIdentityById
+ resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
-class TestModel_NetworkACLIdentityById:
- """
- Test Class for NetworkACLIdentityById
- """
+ encryption_key_identity_model = {} # EncryptionKeyIdentityByCRN
+ encryption_key_identity_model['crn'] = 'crn:v1:bluemix:public:kms:us-south:a/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179'
- def test_network_acl_identity_by_id_serialization(self):
- """
- Test serialization/deserialization for NetworkACLIdentityById
- """
+ snapshot_identity_by_crn_model = {} # SnapshotIdentityByCRN
+ snapshot_identity_by_crn_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263'
- # Construct a json representation of a NetworkACLIdentityById model
- network_acl_identity_by_id_model_json = {}
- network_acl_identity_by_id_model_json['id'] = 'a4e28308-8ee7-46ab-8108-9f881f22bdbf'
+ # Construct a json representation of a SnapshotPrototypeSnapshotBySourceSnapshot model
+ snapshot_prototype_snapshot_by_source_snapshot_model_json = {}
+ snapshot_prototype_snapshot_by_source_snapshot_model_json['clones'] = [snapshot_clone_prototype_model]
+ snapshot_prototype_snapshot_by_source_snapshot_model_json['name'] = 'my-snapshot'
+ snapshot_prototype_snapshot_by_source_snapshot_model_json['resource_group'] = resource_group_identity_model
+ snapshot_prototype_snapshot_by_source_snapshot_model_json['user_tags'] = []
+ snapshot_prototype_snapshot_by_source_snapshot_model_json['encryption_key'] = encryption_key_identity_model
+ snapshot_prototype_snapshot_by_source_snapshot_model_json['source_snapshot'] = snapshot_identity_by_crn_model
- # Construct a model instance of NetworkACLIdentityById by calling from_dict on the json representation
- network_acl_identity_by_id_model = NetworkACLIdentityById.from_dict(network_acl_identity_by_id_model_json)
- assert network_acl_identity_by_id_model != False
+ # Construct a model instance of SnapshotPrototypeSnapshotBySourceSnapshot by calling from_dict on the json representation
+ snapshot_prototype_snapshot_by_source_snapshot_model = SnapshotPrototypeSnapshotBySourceSnapshot.from_dict(snapshot_prototype_snapshot_by_source_snapshot_model_json)
+ assert snapshot_prototype_snapshot_by_source_snapshot_model != False
- # Construct a model instance of NetworkACLIdentityById by calling from_dict on the json representation
- network_acl_identity_by_id_model_dict = NetworkACLIdentityById.from_dict(network_acl_identity_by_id_model_json).__dict__
- network_acl_identity_by_id_model2 = NetworkACLIdentityById(**network_acl_identity_by_id_model_dict)
+ # Construct a model instance of SnapshotPrototypeSnapshotBySourceSnapshot by calling from_dict on the json representation
+ snapshot_prototype_snapshot_by_source_snapshot_model_dict = SnapshotPrototypeSnapshotBySourceSnapshot.from_dict(snapshot_prototype_snapshot_by_source_snapshot_model_json).__dict__
+ snapshot_prototype_snapshot_by_source_snapshot_model2 = SnapshotPrototypeSnapshotBySourceSnapshot(**snapshot_prototype_snapshot_by_source_snapshot_model_dict)
# Verify the model instances are equivalent
- assert network_acl_identity_by_id_model == network_acl_identity_by_id_model2
+ assert snapshot_prototype_snapshot_by_source_snapshot_model == snapshot_prototype_snapshot_by_source_snapshot_model2
# Convert model instance back to dict and verify no loss of data
- network_acl_identity_by_id_model_json2 = network_acl_identity_by_id_model.to_dict()
- assert network_acl_identity_by_id_model_json2 == network_acl_identity_by_id_model_json
+ snapshot_prototype_snapshot_by_source_snapshot_model_json2 = snapshot_prototype_snapshot_by_source_snapshot_model.to_dict()
+ assert snapshot_prototype_snapshot_by_source_snapshot_model_json2 == snapshot_prototype_snapshot_by_source_snapshot_model_json
-class TestModel_NetworkACLPrototypeNetworkACLByRules:
+class TestModel_SnapshotPrototypeSnapshotBySourceVolume:
"""
- Test Class for NetworkACLPrototypeNetworkACLByRules
+ Test Class for SnapshotPrototypeSnapshotBySourceVolume
"""
- def test_network_acl_prototype_network_acl_by_rules_serialization(self):
+ def test_snapshot_prototype_snapshot_by_source_volume_serialization(self):
"""
- Test serialization/deserialization for NetworkACLPrototypeNetworkACLByRules
+ Test serialization/deserialization for SnapshotPrototypeSnapshotBySourceVolume
"""
# 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'
+
+ snapshot_clone_prototype_model = {} # SnapshotClonePrototype
+ snapshot_clone_prototype_model['zone'] = zone_identity_model
+
resource_group_identity_model = {} # ResourceGroupIdentityById
resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
- vpc_identity_model = {} # VPCIdentityById
- vpc_identity_model['id'] = 'cf7cd5a-2f30-4336-a495-6addc820cd61'
-
- network_acl_rule_prototype_network_acl_context_model = {} # NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype
- network_acl_rule_prototype_network_acl_context_model['action'] = 'allow'
- network_acl_rule_prototype_network_acl_context_model['destination'] = '192.168.3.2/32'
- network_acl_rule_prototype_network_acl_context_model['direction'] = 'inbound'
- 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['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
+ volume_identity_model = {} # VolumeIdentityById
+ volume_identity_model['id'] = '1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
- # Construct a json representation of a NetworkACLPrototypeNetworkACLByRules model
- network_acl_prototype_network_acl_by_rules_model_json = {}
- network_acl_prototype_network_acl_by_rules_model_json['name'] = 'my-network-acl'
- network_acl_prototype_network_acl_by_rules_model_json['resource_group'] = resource_group_identity_model
- network_acl_prototype_network_acl_by_rules_model_json['vpc'] = vpc_identity_model
- network_acl_prototype_network_acl_by_rules_model_json['rules'] = [network_acl_rule_prototype_network_acl_context_model]
+ # Construct a json representation of a SnapshotPrototypeSnapshotBySourceVolume model
+ snapshot_prototype_snapshot_by_source_volume_model_json = {}
+ snapshot_prototype_snapshot_by_source_volume_model_json['clones'] = [snapshot_clone_prototype_model]
+ snapshot_prototype_snapshot_by_source_volume_model_json['name'] = 'my-snapshot'
+ snapshot_prototype_snapshot_by_source_volume_model_json['resource_group'] = resource_group_identity_model
+ snapshot_prototype_snapshot_by_source_volume_model_json['user_tags'] = []
+ snapshot_prototype_snapshot_by_source_volume_model_json['source_volume'] = volume_identity_model
- # Construct a model instance of NetworkACLPrototypeNetworkACLByRules by calling from_dict on the json representation
- network_acl_prototype_network_acl_by_rules_model = NetworkACLPrototypeNetworkACLByRules.from_dict(network_acl_prototype_network_acl_by_rules_model_json)
- assert network_acl_prototype_network_acl_by_rules_model != False
+ # Construct a model instance of SnapshotPrototypeSnapshotBySourceVolume by calling from_dict on the json representation
+ snapshot_prototype_snapshot_by_source_volume_model = SnapshotPrototypeSnapshotBySourceVolume.from_dict(snapshot_prototype_snapshot_by_source_volume_model_json)
+ assert snapshot_prototype_snapshot_by_source_volume_model != False
- # Construct a model instance of NetworkACLPrototypeNetworkACLByRules by calling from_dict on the json representation
- network_acl_prototype_network_acl_by_rules_model_dict = NetworkACLPrototypeNetworkACLByRules.from_dict(network_acl_prototype_network_acl_by_rules_model_json).__dict__
- network_acl_prototype_network_acl_by_rules_model2 = NetworkACLPrototypeNetworkACLByRules(**network_acl_prototype_network_acl_by_rules_model_dict)
+ # Construct a model instance of SnapshotPrototypeSnapshotBySourceVolume by calling from_dict on the json representation
+ snapshot_prototype_snapshot_by_source_volume_model_dict = SnapshotPrototypeSnapshotBySourceVolume.from_dict(snapshot_prototype_snapshot_by_source_volume_model_json).__dict__
+ snapshot_prototype_snapshot_by_source_volume_model2 = SnapshotPrototypeSnapshotBySourceVolume(**snapshot_prototype_snapshot_by_source_volume_model_dict)
# Verify the model instances are equivalent
- assert network_acl_prototype_network_acl_by_rules_model == network_acl_prototype_network_acl_by_rules_model2
+ assert snapshot_prototype_snapshot_by_source_volume_model == snapshot_prototype_snapshot_by_source_volume_model2
# Convert model instance back to dict and verify no loss of data
- network_acl_prototype_network_acl_by_rules_model_json2 = network_acl_prototype_network_acl_by_rules_model.to_dict()
- assert network_acl_prototype_network_acl_by_rules_model_json2 == network_acl_prototype_network_acl_by_rules_model_json
+ snapshot_prototype_snapshot_by_source_volume_model_json2 = snapshot_prototype_snapshot_by_source_volume_model.to_dict()
+ assert snapshot_prototype_snapshot_by_source_volume_model_json2 == snapshot_prototype_snapshot_by_source_volume_model_json
-class TestModel_NetworkACLPrototypeNetworkACLBySourceNetworkACL:
+class TestModel_SubnetIdentityByCRN:
"""
- Test Class for NetworkACLPrototypeNetworkACLBySourceNetworkACL
+ Test Class for SubnetIdentityByCRN
"""
- def test_network_acl_prototype_network_acl_by_source_network_acl_serialization(self):
+ def test_subnet_identity_by_crn_serialization(self):
"""
- Test serialization/deserialization for NetworkACLPrototypeNetworkACLBySourceNetworkACL
+ Test serialization/deserialization for SubnetIdentityByCRN
"""
- # 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'
-
- vpc_identity_model = {} # VPCIdentityById
- vpc_identity_model['id'] = 'cf7cd5a-2f30-4336-a495-6addc820cd61'
-
- network_acl_identity_model = {} # NetworkACLIdentityById
- network_acl_identity_model['id'] = 'a4e28308-8ee7-46ab-8108-9f881f22bdbf'
-
- # Construct a json representation of a NetworkACLPrototypeNetworkACLBySourceNetworkACL model
- network_acl_prototype_network_acl_by_source_network_acl_model_json = {}
- network_acl_prototype_network_acl_by_source_network_acl_model_json['name'] = 'my-network-acl'
- network_acl_prototype_network_acl_by_source_network_acl_model_json['resource_group'] = resource_group_identity_model
- network_acl_prototype_network_acl_by_source_network_acl_model_json['vpc'] = vpc_identity_model
- network_acl_prototype_network_acl_by_source_network_acl_model_json['source_network_acl'] = network_acl_identity_model
+ # Construct a json representation of a SubnetIdentityByCRN model
+ subnet_identity_by_crn_model_json = {}
+ subnet_identity_by_crn_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
- # Construct a model instance of NetworkACLPrototypeNetworkACLBySourceNetworkACL by calling from_dict on the json representation
- network_acl_prototype_network_acl_by_source_network_acl_model = NetworkACLPrototypeNetworkACLBySourceNetworkACL.from_dict(network_acl_prototype_network_acl_by_source_network_acl_model_json)
- assert network_acl_prototype_network_acl_by_source_network_acl_model != False
+ # Construct a model instance of SubnetIdentityByCRN by calling from_dict on the json representation
+ subnet_identity_by_crn_model = SubnetIdentityByCRN.from_dict(subnet_identity_by_crn_model_json)
+ assert subnet_identity_by_crn_model != False
- # Construct a model instance of NetworkACLPrototypeNetworkACLBySourceNetworkACL by calling from_dict on the json representation
- network_acl_prototype_network_acl_by_source_network_acl_model_dict = NetworkACLPrototypeNetworkACLBySourceNetworkACL.from_dict(network_acl_prototype_network_acl_by_source_network_acl_model_json).__dict__
- network_acl_prototype_network_acl_by_source_network_acl_model2 = NetworkACLPrototypeNetworkACLBySourceNetworkACL(**network_acl_prototype_network_acl_by_source_network_acl_model_dict)
+ # Construct a model instance of SubnetIdentityByCRN by calling from_dict on the json representation
+ subnet_identity_by_crn_model_dict = SubnetIdentityByCRN.from_dict(subnet_identity_by_crn_model_json).__dict__
+ subnet_identity_by_crn_model2 = SubnetIdentityByCRN(**subnet_identity_by_crn_model_dict)
# Verify the model instances are equivalent
- assert network_acl_prototype_network_acl_by_source_network_acl_model == network_acl_prototype_network_acl_by_source_network_acl_model2
+ assert subnet_identity_by_crn_model == subnet_identity_by_crn_model2
# Convert model instance back to dict and verify no loss of data
- network_acl_prototype_network_acl_by_source_network_acl_model_json2 = network_acl_prototype_network_acl_by_source_network_acl_model.to_dict()
- assert network_acl_prototype_network_acl_by_source_network_acl_model_json2 == network_acl_prototype_network_acl_by_source_network_acl_model_json
+ subnet_identity_by_crn_model_json2 = subnet_identity_by_crn_model.to_dict()
+ assert subnet_identity_by_crn_model_json2 == subnet_identity_by_crn_model_json
-class TestModel_NetworkACLRuleBeforePatchNetworkACLRuleIdentityByHref:
+class TestModel_SubnetIdentityByHref:
"""
- Test Class for NetworkACLRuleBeforePatchNetworkACLRuleIdentityByHref
+ Test Class for SubnetIdentityByHref
"""
- def test_network_acl_rule_before_patch_network_acl_rule_identity_by_href_serialization(self):
+ def test_subnet_identity_by_href_serialization(self):
"""
- Test serialization/deserialization for NetworkACLRuleBeforePatchNetworkACLRuleIdentityByHref
+ Test serialization/deserialization for SubnetIdentityByHref
"""
- # Construct a json representation of a NetworkACLRuleBeforePatchNetworkACLRuleIdentityByHref model
- network_acl_rule_before_patch_network_acl_rule_identity_by_href_model_json = {}
- network_acl_rule_before_patch_network_acl_rule_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9'
+ # Construct a json representation of a SubnetIdentityByHref model
+ subnet_identity_by_href_model_json = {}
+ subnet_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
- # Construct a model instance of NetworkACLRuleBeforePatchNetworkACLRuleIdentityByHref by calling from_dict on the json representation
- network_acl_rule_before_patch_network_acl_rule_identity_by_href_model = NetworkACLRuleBeforePatchNetworkACLRuleIdentityByHref.from_dict(network_acl_rule_before_patch_network_acl_rule_identity_by_href_model_json)
- assert network_acl_rule_before_patch_network_acl_rule_identity_by_href_model != False
+ # Construct a model instance of SubnetIdentityByHref by calling from_dict on the json representation
+ subnet_identity_by_href_model = SubnetIdentityByHref.from_dict(subnet_identity_by_href_model_json)
+ assert subnet_identity_by_href_model != False
- # Construct a model instance of NetworkACLRuleBeforePatchNetworkACLRuleIdentityByHref by calling from_dict on the json representation
- network_acl_rule_before_patch_network_acl_rule_identity_by_href_model_dict = NetworkACLRuleBeforePatchNetworkACLRuleIdentityByHref.from_dict(network_acl_rule_before_patch_network_acl_rule_identity_by_href_model_json).__dict__
- network_acl_rule_before_patch_network_acl_rule_identity_by_href_model2 = NetworkACLRuleBeforePatchNetworkACLRuleIdentityByHref(**network_acl_rule_before_patch_network_acl_rule_identity_by_href_model_dict)
+ # Construct a model instance of SubnetIdentityByHref by calling from_dict on the json representation
+ subnet_identity_by_href_model_dict = SubnetIdentityByHref.from_dict(subnet_identity_by_href_model_json).__dict__
+ subnet_identity_by_href_model2 = SubnetIdentityByHref(**subnet_identity_by_href_model_dict)
# Verify the model instances are equivalent
- assert network_acl_rule_before_patch_network_acl_rule_identity_by_href_model == network_acl_rule_before_patch_network_acl_rule_identity_by_href_model2
+ assert subnet_identity_by_href_model == subnet_identity_by_href_model2
# Convert model instance back to dict and verify no loss of data
- network_acl_rule_before_patch_network_acl_rule_identity_by_href_model_json2 = network_acl_rule_before_patch_network_acl_rule_identity_by_href_model.to_dict()
- assert network_acl_rule_before_patch_network_acl_rule_identity_by_href_model_json2 == network_acl_rule_before_patch_network_acl_rule_identity_by_href_model_json
+ subnet_identity_by_href_model_json2 = subnet_identity_by_href_model.to_dict()
+ assert subnet_identity_by_href_model_json2 == subnet_identity_by_href_model_json
-class TestModel_NetworkACLRuleBeforePatchNetworkACLRuleIdentityById:
+class TestModel_SubnetIdentityById:
"""
- Test Class for NetworkACLRuleBeforePatchNetworkACLRuleIdentityById
+ Test Class for SubnetIdentityById
"""
- def test_network_acl_rule_before_patch_network_acl_rule_identity_by_id_serialization(self):
+ def test_subnet_identity_by_id_serialization(self):
"""
- Test serialization/deserialization for NetworkACLRuleBeforePatchNetworkACLRuleIdentityById
+ Test serialization/deserialization for SubnetIdentityById
"""
- # Construct a json representation of a NetworkACLRuleBeforePatchNetworkACLRuleIdentityById model
- network_acl_rule_before_patch_network_acl_rule_identity_by_id_model_json = {}
- network_acl_rule_before_patch_network_acl_rule_identity_by_id_model_json['id'] = '8daca77a-4980-4d33-8f3e-7038797be8f9'
+ # Construct a json representation of a SubnetIdentityById model
+ subnet_identity_by_id_model_json = {}
+ subnet_identity_by_id_model_json['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
- # Construct a model instance of NetworkACLRuleBeforePatchNetworkACLRuleIdentityById by calling from_dict on the json representation
- network_acl_rule_before_patch_network_acl_rule_identity_by_id_model = NetworkACLRuleBeforePatchNetworkACLRuleIdentityById.from_dict(network_acl_rule_before_patch_network_acl_rule_identity_by_id_model_json)
- assert network_acl_rule_before_patch_network_acl_rule_identity_by_id_model != False
+ # Construct a model instance of SubnetIdentityById by calling from_dict on the json representation
+ subnet_identity_by_id_model = SubnetIdentityById.from_dict(subnet_identity_by_id_model_json)
+ assert subnet_identity_by_id_model != False
- # Construct a model instance of NetworkACLRuleBeforePatchNetworkACLRuleIdentityById by calling from_dict on the json representation
- network_acl_rule_before_patch_network_acl_rule_identity_by_id_model_dict = NetworkACLRuleBeforePatchNetworkACLRuleIdentityById.from_dict(network_acl_rule_before_patch_network_acl_rule_identity_by_id_model_json).__dict__
- network_acl_rule_before_patch_network_acl_rule_identity_by_id_model2 = NetworkACLRuleBeforePatchNetworkACLRuleIdentityById(**network_acl_rule_before_patch_network_acl_rule_identity_by_id_model_dict)
+ # Construct a model instance of SubnetIdentityById by calling from_dict on the json representation
+ subnet_identity_by_id_model_dict = SubnetIdentityById.from_dict(subnet_identity_by_id_model_json).__dict__
+ subnet_identity_by_id_model2 = SubnetIdentityById(**subnet_identity_by_id_model_dict)
# Verify the model instances are equivalent
- assert network_acl_rule_before_patch_network_acl_rule_identity_by_id_model == network_acl_rule_before_patch_network_acl_rule_identity_by_id_model2
+ assert subnet_identity_by_id_model == subnet_identity_by_id_model2
# Convert model instance back to dict and verify no loss of data
- network_acl_rule_before_patch_network_acl_rule_identity_by_id_model_json2 = network_acl_rule_before_patch_network_acl_rule_identity_by_id_model.to_dict()
- assert network_acl_rule_before_patch_network_acl_rule_identity_by_id_model_json2 == network_acl_rule_before_patch_network_acl_rule_identity_by_id_model_json
+ subnet_identity_by_id_model_json2 = subnet_identity_by_id_model.to_dict()
+ assert subnet_identity_by_id_model_json2 == subnet_identity_by_id_model_json
-class TestModel_NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByHref:
+class TestModel_SubnetPrototypeSubnetByCIDR:
"""
- Test Class for NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByHref
+ Test Class for SubnetPrototypeSubnetByCIDR
"""
- def test_network_acl_rule_before_prototype_network_acl_rule_identity_by_href_serialization(self):
+ def test_subnet_prototype_subnet_by_cidr_serialization(self):
"""
- Test serialization/deserialization for NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByHref
+ Test serialization/deserialization for SubnetPrototypeSubnetByCIDR
"""
- # Construct a json representation of a NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByHref model
- network_acl_rule_before_prototype_network_acl_rule_identity_by_href_model_json = {}
- network_acl_rule_before_prototype_network_acl_rule_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9'
+ # Construct dict forms of any model objects needed in order to build this model.
- # Construct a model instance of NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByHref by calling from_dict on the json representation
- network_acl_rule_before_prototype_network_acl_rule_identity_by_href_model = NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByHref.from_dict(network_acl_rule_before_prototype_network_acl_rule_identity_by_href_model_json)
- assert network_acl_rule_before_prototype_network_acl_rule_identity_by_href_model != False
+ network_acl_identity_model = {} # NetworkACLIdentityById
+ network_acl_identity_model['id'] = 'a4e28308-8ee7-46ab-8108-9f881f22bdbf'
- # Construct a model instance of NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByHref by calling from_dict on the json representation
- network_acl_rule_before_prototype_network_acl_rule_identity_by_href_model_dict = NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByHref.from_dict(network_acl_rule_before_prototype_network_acl_rule_identity_by_href_model_json).__dict__
- network_acl_rule_before_prototype_network_acl_rule_identity_by_href_model2 = NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByHref(**network_acl_rule_before_prototype_network_acl_rule_identity_by_href_model_dict)
+ public_gateway_identity_model = {} # PublicGatewayIdentityPublicGatewayIdentityById
+ public_gateway_identity_model['id'] = 'dc5431ef-1fc6-4861-adc9-a59d077d1241'
+
+ resource_group_identity_model = {} # ResourceGroupIdentityById
+ resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
+
+ routing_table_identity_model = {} # RoutingTableIdentityById
+ routing_table_identity_model['id'] = '6885e83f-03b2-4603-8a86-db2a0f55c840'
+
+ vpc_identity_model = {} # VPCIdentityById
+ vpc_identity_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b'
+
+ zone_identity_model = {} # ZoneIdentityByName
+ zone_identity_model['name'] = 'us-south-1'
+
+ # Construct a json representation of a SubnetPrototypeSubnetByCIDR model
+ subnet_prototype_subnet_by_cidr_model_json = {}
+ subnet_prototype_subnet_by_cidr_model_json['ip_version'] = 'ipv4'
+ subnet_prototype_subnet_by_cidr_model_json['name'] = 'my-subnet'
+ subnet_prototype_subnet_by_cidr_model_json['network_acl'] = network_acl_identity_model
+ subnet_prototype_subnet_by_cidr_model_json['public_gateway'] = public_gateway_identity_model
+ subnet_prototype_subnet_by_cidr_model_json['resource_group'] = resource_group_identity_model
+ subnet_prototype_subnet_by_cidr_model_json['routing_table'] = routing_table_identity_model
+ subnet_prototype_subnet_by_cidr_model_json['vpc'] = vpc_identity_model
+ subnet_prototype_subnet_by_cidr_model_json['ipv4_cidr_block'] = '10.0.0.0/24'
+ subnet_prototype_subnet_by_cidr_model_json['zone'] = zone_identity_model
+
+ # Construct a model instance of SubnetPrototypeSubnetByCIDR by calling from_dict on the json representation
+ subnet_prototype_subnet_by_cidr_model = SubnetPrototypeSubnetByCIDR.from_dict(subnet_prototype_subnet_by_cidr_model_json)
+ assert subnet_prototype_subnet_by_cidr_model != False
+
+ # Construct a model instance of SubnetPrototypeSubnetByCIDR by calling from_dict on the json representation
+ subnet_prototype_subnet_by_cidr_model_dict = SubnetPrototypeSubnetByCIDR.from_dict(subnet_prototype_subnet_by_cidr_model_json).__dict__
+ subnet_prototype_subnet_by_cidr_model2 = SubnetPrototypeSubnetByCIDR(**subnet_prototype_subnet_by_cidr_model_dict)
# Verify the model instances are equivalent
- assert network_acl_rule_before_prototype_network_acl_rule_identity_by_href_model == network_acl_rule_before_prototype_network_acl_rule_identity_by_href_model2
+ assert subnet_prototype_subnet_by_cidr_model == subnet_prototype_subnet_by_cidr_model2
# Convert model instance back to dict and verify no loss of data
- network_acl_rule_before_prototype_network_acl_rule_identity_by_href_model_json2 = network_acl_rule_before_prototype_network_acl_rule_identity_by_href_model.to_dict()
- assert network_acl_rule_before_prototype_network_acl_rule_identity_by_href_model_json2 == network_acl_rule_before_prototype_network_acl_rule_identity_by_href_model_json
+ subnet_prototype_subnet_by_cidr_model_json2 = subnet_prototype_subnet_by_cidr_model.to_dict()
+ assert subnet_prototype_subnet_by_cidr_model_json2 == subnet_prototype_subnet_by_cidr_model_json
-class TestModel_NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityById:
+class TestModel_SubnetPrototypeSubnetByTotalCount:
"""
- Test Class for NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityById
+ Test Class for SubnetPrototypeSubnetByTotalCount
"""
- def test_network_acl_rule_before_prototype_network_acl_rule_identity_by_id_serialization(self):
+ def test_subnet_prototype_subnet_by_total_count_serialization(self):
"""
- Test serialization/deserialization for NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityById
+ Test serialization/deserialization for SubnetPrototypeSubnetByTotalCount
"""
- # Construct a json representation of a NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityById model
- network_acl_rule_before_prototype_network_acl_rule_identity_by_id_model_json = {}
- network_acl_rule_before_prototype_network_acl_rule_identity_by_id_model_json['id'] = '8daca77a-4980-4d33-8f3e-7038797be8f9'
+ # Construct dict forms of any model objects needed in order to build this model.
- # Construct a model instance of NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityById by calling from_dict on the json representation
- network_acl_rule_before_prototype_network_acl_rule_identity_by_id_model = NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityById.from_dict(network_acl_rule_before_prototype_network_acl_rule_identity_by_id_model_json)
- assert network_acl_rule_before_prototype_network_acl_rule_identity_by_id_model != False
+ network_acl_identity_model = {} # NetworkACLIdentityById
+ network_acl_identity_model['id'] = 'a4e28308-8ee7-46ab-8108-9f881f22bdbf'
- # Construct a model instance of NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityById by calling from_dict on the json representation
- network_acl_rule_before_prototype_network_acl_rule_identity_by_id_model_dict = NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityById.from_dict(network_acl_rule_before_prototype_network_acl_rule_identity_by_id_model_json).__dict__
- network_acl_rule_before_prototype_network_acl_rule_identity_by_id_model2 = NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityById(**network_acl_rule_before_prototype_network_acl_rule_identity_by_id_model_dict)
+ public_gateway_identity_model = {} # PublicGatewayIdentityPublicGatewayIdentityById
+ public_gateway_identity_model['id'] = 'dc5431ef-1fc6-4861-adc9-a59d077d1241'
+
+ resource_group_identity_model = {} # ResourceGroupIdentityById
+ resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
+
+ routing_table_identity_model = {} # RoutingTableIdentityById
+ routing_table_identity_model['id'] = '6885e83f-03b2-4603-8a86-db2a0f55c840'
+
+ vpc_identity_model = {} # VPCIdentityById
+ vpc_identity_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b'
+
+ zone_identity_model = {} # ZoneIdentityByName
+ zone_identity_model['name'] = 'us-south-1'
+
+ # Construct a json representation of a SubnetPrototypeSubnetByTotalCount model
+ subnet_prototype_subnet_by_total_count_model_json = {}
+ subnet_prototype_subnet_by_total_count_model_json['ip_version'] = 'ipv4'
+ subnet_prototype_subnet_by_total_count_model_json['name'] = 'my-subnet'
+ subnet_prototype_subnet_by_total_count_model_json['network_acl'] = network_acl_identity_model
+ subnet_prototype_subnet_by_total_count_model_json['public_gateway'] = public_gateway_identity_model
+ subnet_prototype_subnet_by_total_count_model_json['resource_group'] = resource_group_identity_model
+ subnet_prototype_subnet_by_total_count_model_json['routing_table'] = routing_table_identity_model
+ subnet_prototype_subnet_by_total_count_model_json['vpc'] = vpc_identity_model
+ subnet_prototype_subnet_by_total_count_model_json['total_ipv4_address_count'] = 256
+ subnet_prototype_subnet_by_total_count_model_json['zone'] = zone_identity_model
+
+ # Construct a model instance of SubnetPrototypeSubnetByTotalCount by calling from_dict on the json representation
+ subnet_prototype_subnet_by_total_count_model = SubnetPrototypeSubnetByTotalCount.from_dict(subnet_prototype_subnet_by_total_count_model_json)
+ assert subnet_prototype_subnet_by_total_count_model != False
+
+ # Construct a model instance of SubnetPrototypeSubnetByTotalCount by calling from_dict on the json representation
+ subnet_prototype_subnet_by_total_count_model_dict = SubnetPrototypeSubnetByTotalCount.from_dict(subnet_prototype_subnet_by_total_count_model_json).__dict__
+ subnet_prototype_subnet_by_total_count_model2 = SubnetPrototypeSubnetByTotalCount(**subnet_prototype_subnet_by_total_count_model_dict)
# Verify the model instances are equivalent
- assert network_acl_rule_before_prototype_network_acl_rule_identity_by_id_model == network_acl_rule_before_prototype_network_acl_rule_identity_by_id_model2
+ assert subnet_prototype_subnet_by_total_count_model == subnet_prototype_subnet_by_total_count_model2
# Convert model instance back to dict and verify no loss of data
- network_acl_rule_before_prototype_network_acl_rule_identity_by_id_model_json2 = network_acl_rule_before_prototype_network_acl_rule_identity_by_id_model.to_dict()
- assert network_acl_rule_before_prototype_network_acl_rule_identity_by_id_model_json2 == network_acl_rule_before_prototype_network_acl_rule_identity_by_id_model_json
+ 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_NetworkACLRuleItemNetworkACLRuleProtocolAll:
+class TestModel_SubnetPublicGatewayPatchPublicGatewayIdentityByCRN:
"""
- Test Class for NetworkACLRuleItemNetworkACLRuleProtocolAll
+ Test Class for SubnetPublicGatewayPatchPublicGatewayIdentityByCRN
"""
- def test_network_acl_rule_item_network_acl_rule_protocol_all_serialization(self):
+ def test_subnet_public_gateway_patch_public_gateway_identity_by_crn_serialization(self):
"""
- Test serialization/deserialization for NetworkACLRuleItemNetworkACLRuleProtocolAll
+ Test serialization/deserialization for SubnetPublicGatewayPatchPublicGatewayIdentityByCRN
"""
- # 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'
-
- 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 json representation of a NetworkACLRuleItemNetworkACLRuleProtocolAll model
- network_acl_rule_item_network_acl_rule_protocol_all_model_json = {}
- network_acl_rule_item_network_acl_rule_protocol_all_model_json['action'] = 'allow'
- network_acl_rule_item_network_acl_rule_protocol_all_model_json['before'] = network_acl_rule_reference_model
- network_acl_rule_item_network_acl_rule_protocol_all_model_json['created_at'] = '2019-01-01T12:00:00Z'
- network_acl_rule_item_network_acl_rule_protocol_all_model_json['destination'] = '192.168.3.0/24'
- network_acl_rule_item_network_acl_rule_protocol_all_model_json['direction'] = 'inbound'
- network_acl_rule_item_network_acl_rule_protocol_all_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9'
- network_acl_rule_item_network_acl_rule_protocol_all_model_json['id'] = '8daca77a-4980-4d33-8f3e-7038797be8f9'
- network_acl_rule_item_network_acl_rule_protocol_all_model_json['ip_version'] = 'ipv4'
- network_acl_rule_item_network_acl_rule_protocol_all_model_json['name'] = 'my-rule-1'
- network_acl_rule_item_network_acl_rule_protocol_all_model_json['source'] = '192.168.3.0/24'
- network_acl_rule_item_network_acl_rule_protocol_all_model_json['protocol'] = 'all'
+ # 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 NetworkACLRuleItemNetworkACLRuleProtocolAll by calling from_dict on the json representation
- network_acl_rule_item_network_acl_rule_protocol_all_model = NetworkACLRuleItemNetworkACLRuleProtocolAll.from_dict(network_acl_rule_item_network_acl_rule_protocol_all_model_json)
- assert network_acl_rule_item_network_acl_rule_protocol_all_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 = 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 NetworkACLRuleItemNetworkACLRuleProtocolAll by calling from_dict on the json representation
- network_acl_rule_item_network_acl_rule_protocol_all_model_dict = NetworkACLRuleItemNetworkACLRuleProtocolAll.from_dict(network_acl_rule_item_network_acl_rule_protocol_all_model_json).__dict__
- network_acl_rule_item_network_acl_rule_protocol_all_model2 = NetworkACLRuleItemNetworkACLRuleProtocolAll(**network_acl_rule_item_network_acl_rule_protocol_all_model_dict)
+ # 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 network_acl_rule_item_network_acl_rule_protocol_all_model == network_acl_rule_item_network_acl_rule_protocol_all_model2
+ 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
- network_acl_rule_item_network_acl_rule_protocol_all_model_json2 = network_acl_rule_item_network_acl_rule_protocol_all_model.to_dict()
- assert network_acl_rule_item_network_acl_rule_protocol_all_model_json2 == network_acl_rule_item_network_acl_rule_protocol_all_model_json
+ 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_NetworkACLRuleItemNetworkACLRuleProtocolICMP:
+class TestModel_SubnetPublicGatewayPatchPublicGatewayIdentityByHref:
"""
- Test Class for NetworkACLRuleItemNetworkACLRuleProtocolICMP
+ Test Class for SubnetPublicGatewayPatchPublicGatewayIdentityByHref
"""
- def test_network_acl_rule_item_network_acl_rule_protocol_icmp_serialization(self):
+ def test_subnet_public_gateway_patch_public_gateway_identity_by_href_serialization(self):
"""
- Test serialization/deserialization for NetworkACLRuleItemNetworkACLRuleProtocolICMP
+ Test serialization/deserialization for SubnetPublicGatewayPatchPublicGatewayIdentityByHref
"""
- # 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'
-
- 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 json representation of a NetworkACLRuleItemNetworkACLRuleProtocolICMP model
- network_acl_rule_item_network_acl_rule_protocol_icmp_model_json = {}
- network_acl_rule_item_network_acl_rule_protocol_icmp_model_json['action'] = 'allow'
- network_acl_rule_item_network_acl_rule_protocol_icmp_model_json['before'] = network_acl_rule_reference_model
- network_acl_rule_item_network_acl_rule_protocol_icmp_model_json['created_at'] = '2019-01-01T12:00:00Z'
- network_acl_rule_item_network_acl_rule_protocol_icmp_model_json['destination'] = '192.168.3.0/24'
- network_acl_rule_item_network_acl_rule_protocol_icmp_model_json['direction'] = 'inbound'
- network_acl_rule_item_network_acl_rule_protocol_icmp_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9'
- network_acl_rule_item_network_acl_rule_protocol_icmp_model_json['id'] = '8daca77a-4980-4d33-8f3e-7038797be8f9'
- network_acl_rule_item_network_acl_rule_protocol_icmp_model_json['ip_version'] = 'ipv4'
- network_acl_rule_item_network_acl_rule_protocol_icmp_model_json['name'] = 'my-rule-1'
- network_acl_rule_item_network_acl_rule_protocol_icmp_model_json['source'] = '192.168.3.0/24'
- network_acl_rule_item_network_acl_rule_protocol_icmp_model_json['code'] = 0
- network_acl_rule_item_network_acl_rule_protocol_icmp_model_json['protocol'] = 'icmp'
- network_acl_rule_item_network_acl_rule_protocol_icmp_model_json['type'] = 8
+ # 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 NetworkACLRuleItemNetworkACLRuleProtocolICMP by calling from_dict on the json representation
- network_acl_rule_item_network_acl_rule_protocol_icmp_model = NetworkACLRuleItemNetworkACLRuleProtocolICMP.from_dict(network_acl_rule_item_network_acl_rule_protocol_icmp_model_json)
- assert network_acl_rule_item_network_acl_rule_protocol_icmp_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 = 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 NetworkACLRuleItemNetworkACLRuleProtocolICMP by calling from_dict on the json representation
- network_acl_rule_item_network_acl_rule_protocol_icmp_model_dict = NetworkACLRuleItemNetworkACLRuleProtocolICMP.from_dict(network_acl_rule_item_network_acl_rule_protocol_icmp_model_json).__dict__
- network_acl_rule_item_network_acl_rule_protocol_icmp_model2 = NetworkACLRuleItemNetworkACLRuleProtocolICMP(**network_acl_rule_item_network_acl_rule_protocol_icmp_model_dict)
+ # 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 network_acl_rule_item_network_acl_rule_protocol_icmp_model == network_acl_rule_item_network_acl_rule_protocol_icmp_model2
+ 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
- network_acl_rule_item_network_acl_rule_protocol_icmp_model_json2 = network_acl_rule_item_network_acl_rule_protocol_icmp_model.to_dict()
- assert network_acl_rule_item_network_acl_rule_protocol_icmp_model_json2 == network_acl_rule_item_network_acl_rule_protocol_icmp_model_json
+ 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_NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP:
+class TestModel_SubnetPublicGatewayPatchPublicGatewayIdentityById:
"""
- Test Class for NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP
+ Test Class for SubnetPublicGatewayPatchPublicGatewayIdentityById
"""
- def test_network_acl_rule_item_network_acl_rule_protocol_tcpudp_serialization(self):
+ def test_subnet_public_gateway_patch_public_gateway_identity_by_id_serialization(self):
"""
- Test serialization/deserialization for NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP
+ Test serialization/deserialization for SubnetPublicGatewayPatchPublicGatewayIdentityById
"""
- # 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'
-
- 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 json representation of a NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP model
- network_acl_rule_item_network_acl_rule_protocol_tcpudp_model_json = {}
- network_acl_rule_item_network_acl_rule_protocol_tcpudp_model_json['action'] = 'allow'
- network_acl_rule_item_network_acl_rule_protocol_tcpudp_model_json['before'] = network_acl_rule_reference_model
- network_acl_rule_item_network_acl_rule_protocol_tcpudp_model_json['created_at'] = '2019-01-01T12:00:00Z'
- network_acl_rule_item_network_acl_rule_protocol_tcpudp_model_json['destination'] = '192.168.3.0/24'
- network_acl_rule_item_network_acl_rule_protocol_tcpudp_model_json['direction'] = 'inbound'
- network_acl_rule_item_network_acl_rule_protocol_tcpudp_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9'
- network_acl_rule_item_network_acl_rule_protocol_tcpudp_model_json['id'] = '8daca77a-4980-4d33-8f3e-7038797be8f9'
- network_acl_rule_item_network_acl_rule_protocol_tcpudp_model_json['ip_version'] = 'ipv4'
- network_acl_rule_item_network_acl_rule_protocol_tcpudp_model_json['name'] = 'my-rule-1'
- network_acl_rule_item_network_acl_rule_protocol_tcpudp_model_json['source'] = '192.168.3.0/24'
- network_acl_rule_item_network_acl_rule_protocol_tcpudp_model_json['destination_port_max'] = 22
- network_acl_rule_item_network_acl_rule_protocol_tcpudp_model_json['destination_port_min'] = 22
- network_acl_rule_item_network_acl_rule_protocol_tcpudp_model_json['protocol'] = 'udp'
- network_acl_rule_item_network_acl_rule_protocol_tcpudp_model_json['source_port_max'] = 65535
- network_acl_rule_item_network_acl_rule_protocol_tcpudp_model_json['source_port_min'] = 49152
+ # 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 NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP by calling from_dict on the json representation
- network_acl_rule_item_network_acl_rule_protocol_tcpudp_model = NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP.from_dict(network_acl_rule_item_network_acl_rule_protocol_tcpudp_model_json)
- assert network_acl_rule_item_network_acl_rule_protocol_tcpudp_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 = 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 NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP by calling from_dict on the json representation
- network_acl_rule_item_network_acl_rule_protocol_tcpudp_model_dict = NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP.from_dict(network_acl_rule_item_network_acl_rule_protocol_tcpudp_model_json).__dict__
- network_acl_rule_item_network_acl_rule_protocol_tcpudp_model2 = NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP(**network_acl_rule_item_network_acl_rule_protocol_tcpudp_model_dict)
+ # 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 network_acl_rule_item_network_acl_rule_protocol_tcpudp_model == network_acl_rule_item_network_acl_rule_protocol_tcpudp_model2
+ 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
- network_acl_rule_item_network_acl_rule_protocol_tcpudp_model_json2 = network_acl_rule_item_network_acl_rule_protocol_tcpudp_model.to_dict()
- assert network_acl_rule_item_network_acl_rule_protocol_tcpudp_model_json2 == network_acl_rule_item_network_acl_rule_protocol_tcpudp_model_json
+ 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_NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype:
+class TestModel_TrustedProfileIdentityTrustedProfileByCRN:
"""
- Test Class for NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype
+ Test Class for TrustedProfileIdentityTrustedProfileByCRN
"""
- def test_network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_all_prototype_serialization(self):
+ def test_trusted_profile_identity_trusted_profile_by_crn_serialization(self):
"""
- Test serialization/deserialization for NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype
+ Test serialization/deserialization for TrustedProfileIdentityTrustedProfileByCRN
"""
- # Construct a json representation of a NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype model
- network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_all_prototype_model_json = {}
- network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_all_prototype_model_json['action'] = 'allow'
- network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_all_prototype_model_json['destination'] = '192.168.3.2/32'
- network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_all_prototype_model_json['direction'] = 'inbound'
- network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_all_prototype_model_json['ip_version'] = 'ipv4'
- network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_all_prototype_model_json['name'] = 'my-rule-2'
- network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_all_prototype_model_json['source'] = '192.168.3.2/32'
- network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_all_prototype_model_json['protocol'] = 'all'
+ # Construct a json representation of a TrustedProfileIdentityTrustedProfileByCRN model
+ trusted_profile_identity_trusted_profile_by_crn_model_json = {}
+ trusted_profile_identity_trusted_profile_by_crn_model_json['crn'] = 'crn:v1:bluemix:public:iam-identity::a/123456::profile:Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5'
- # Construct a model instance of NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype by calling from_dict on the json representation
- network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_all_prototype_model = NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype.from_dict(network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_all_prototype_model_json)
- assert network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_all_prototype_model != False
+ # Construct a model instance of TrustedProfileIdentityTrustedProfileByCRN by calling from_dict on the json representation
+ trusted_profile_identity_trusted_profile_by_crn_model = TrustedProfileIdentityTrustedProfileByCRN.from_dict(trusted_profile_identity_trusted_profile_by_crn_model_json)
+ assert trusted_profile_identity_trusted_profile_by_crn_model != False
- # Construct a model instance of NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype by calling from_dict on the json representation
- network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_all_prototype_model_dict = NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype.from_dict(network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_all_prototype_model_json).__dict__
- network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_all_prototype_model2 = NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype(**network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_all_prototype_model_dict)
+ # Construct a model instance of TrustedProfileIdentityTrustedProfileByCRN by calling from_dict on the json representation
+ trusted_profile_identity_trusted_profile_by_crn_model_dict = TrustedProfileIdentityTrustedProfileByCRN.from_dict(trusted_profile_identity_trusted_profile_by_crn_model_json).__dict__
+ trusted_profile_identity_trusted_profile_by_crn_model2 = TrustedProfileIdentityTrustedProfileByCRN(**trusted_profile_identity_trusted_profile_by_crn_model_dict)
# Verify the model instances are equivalent
- assert network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_all_prototype_model == network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_all_prototype_model2
+ assert trusted_profile_identity_trusted_profile_by_crn_model == trusted_profile_identity_trusted_profile_by_crn_model2
# Convert model instance back to dict and verify no loss of data
- network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_all_prototype_model_json2 = network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_all_prototype_model.to_dict()
- assert network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_all_prototype_model_json2 == network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_all_prototype_model_json
+ trusted_profile_identity_trusted_profile_by_crn_model_json2 = trusted_profile_identity_trusted_profile_by_crn_model.to_dict()
+ assert trusted_profile_identity_trusted_profile_by_crn_model_json2 == trusted_profile_identity_trusted_profile_by_crn_model_json
-class TestModel_NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype:
+class TestModel_TrustedProfileIdentityTrustedProfileById:
"""
- Test Class for NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype
+ Test Class for TrustedProfileIdentityTrustedProfileById
"""
- def test_network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_icmp_prototype_serialization(self):
+ def test_trusted_profile_identity_trusted_profile_by_id_serialization(self):
"""
- Test serialization/deserialization for NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype
+ Test serialization/deserialization for TrustedProfileIdentityTrustedProfileById
"""
- # Construct a json representation of a NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype model
- network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_icmp_prototype_model_json = {}
- network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_icmp_prototype_model_json['action'] = 'allow'
- network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_icmp_prototype_model_json['destination'] = '192.168.3.2/32'
- network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_icmp_prototype_model_json['direction'] = 'inbound'
- network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_icmp_prototype_model_json['ip_version'] = 'ipv4'
- network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_icmp_prototype_model_json['name'] = 'my-rule-2'
- network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_icmp_prototype_model_json['source'] = '192.168.3.2/32'
- network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_icmp_prototype_model_json['code'] = 0
- network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_icmp_prototype_model_json['protocol'] = 'icmp'
- network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_icmp_prototype_model_json['type'] = 8
+ # Construct a json representation of a TrustedProfileIdentityTrustedProfileById model
+ trusted_profile_identity_trusted_profile_by_id_model_json = {}
+ trusted_profile_identity_trusted_profile_by_id_model_json['id'] = 'Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5'
- # Construct a model instance of NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype by calling from_dict on the json representation
- network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_icmp_prototype_model = NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype.from_dict(network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_icmp_prototype_model_json)
- assert network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_icmp_prototype_model != False
+ # Construct a model instance of TrustedProfileIdentityTrustedProfileById by calling from_dict on the json representation
+ trusted_profile_identity_trusted_profile_by_id_model = TrustedProfileIdentityTrustedProfileById.from_dict(trusted_profile_identity_trusted_profile_by_id_model_json)
+ assert trusted_profile_identity_trusted_profile_by_id_model != False
- # Construct a model instance of NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype by calling from_dict on the json representation
- network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_icmp_prototype_model_dict = NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype.from_dict(network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_icmp_prototype_model_json).__dict__
- network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_icmp_prototype_model2 = NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype(**network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_icmp_prototype_model_dict)
+ # Construct a model instance of TrustedProfileIdentityTrustedProfileById by calling from_dict on the json representation
+ trusted_profile_identity_trusted_profile_by_id_model_dict = TrustedProfileIdentityTrustedProfileById.from_dict(trusted_profile_identity_trusted_profile_by_id_model_json).__dict__
+ trusted_profile_identity_trusted_profile_by_id_model2 = TrustedProfileIdentityTrustedProfileById(**trusted_profile_identity_trusted_profile_by_id_model_dict)
# Verify the model instances are equivalent
- assert network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_icmp_prototype_model == network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_icmp_prototype_model2
+ assert trusted_profile_identity_trusted_profile_by_id_model == trusted_profile_identity_trusted_profile_by_id_model2
# Convert model instance back to dict and verify no loss of data
- network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_icmp_prototype_model_json2 = network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_icmp_prototype_model.to_dict()
- assert network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_icmp_prototype_model_json2 == network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_icmp_prototype_model_json
+ trusted_profile_identity_trusted_profile_by_id_model_json2 = trusted_profile_identity_trusted_profile_by_id_model.to_dict()
+ assert trusted_profile_identity_trusted_profile_by_id_model_json2 == trusted_profile_identity_trusted_profile_by_id_model_json
-class TestModel_NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype:
+class TestModel_VPCDNSResolverPrototypeVPCDNSResolverTypeManualPrototype:
"""
- Test Class for NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype
+ Test Class for VPCDNSResolverPrototypeVPCDNSResolverTypeManualPrototype
"""
- def test_network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_tcpudp_prototype_serialization(self):
+ def test_vpcdns_resolver_prototype_vpcdns_resolver_type_manual_prototype_serialization(self):
"""
- Test serialization/deserialization for NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype
+ Test serialization/deserialization for VPCDNSResolverPrototypeVPCDNSResolverTypeManualPrototype
"""
- # Construct a json representation of a NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype model
- network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_tcpudp_prototype_model_json = {}
- network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_tcpudp_prototype_model_json['action'] = 'allow'
- network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_tcpudp_prototype_model_json['destination'] = '192.168.3.2/32'
- network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_tcpudp_prototype_model_json['direction'] = 'inbound'
- network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_tcpudp_prototype_model_json['ip_version'] = 'ipv4'
- network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_tcpudp_prototype_model_json['name'] = 'my-rule-2'
- network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_tcpudp_prototype_model_json['source'] = '192.168.3.2/32'
- network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_tcpudp_prototype_model_json['destination_port_max'] = 22
- network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_tcpudp_prototype_model_json['destination_port_min'] = 22
- network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_tcpudp_prototype_model_json['protocol'] = 'udp'
- network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_tcpudp_prototype_model_json['source_port_max'] = 65535
- network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_tcpudp_prototype_model_json['source_port_min'] = 49152
+ # Construct dict forms of any model objects needed in order to build this model.
- # Construct a model instance of NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype by calling from_dict on the json representation
- network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_tcpudp_prototype_model = NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype.from_dict(network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_tcpudp_prototype_model_json)
- assert network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_tcpudp_prototype_model != False
+ zone_identity_model = {} # ZoneIdentityByName
+ zone_identity_model['name'] = 'us-south-1'
- # Construct a model instance of NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype by calling from_dict on the json representation
- network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_tcpudp_prototype_model_dict = NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype.from_dict(network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_tcpudp_prototype_model_json).__dict__
- network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_tcpudp_prototype_model2 = NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype(**network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_tcpudp_prototype_model_dict)
+ dns_server_prototype_model = {} # DNSServerPrototype
+ dns_server_prototype_model['address'] = '192.168.3.4'
+ dns_server_prototype_model['zone_affinity'] = zone_identity_model
+
+ # Construct a json representation of a VPCDNSResolverPrototypeVPCDNSResolverTypeManualPrototype model
+ vpcdns_resolver_prototype_vpcdns_resolver_type_manual_prototype_model_json = {}
+ vpcdns_resolver_prototype_vpcdns_resolver_type_manual_prototype_model_json['manual_servers'] = [dns_server_prototype_model]
+ vpcdns_resolver_prototype_vpcdns_resolver_type_manual_prototype_model_json['type'] = 'manual'
+
+ # Construct a model instance of VPCDNSResolverPrototypeVPCDNSResolverTypeManualPrototype by calling from_dict on the json representation
+ vpcdns_resolver_prototype_vpcdns_resolver_type_manual_prototype_model = VPCDNSResolverPrototypeVPCDNSResolverTypeManualPrototype.from_dict(vpcdns_resolver_prototype_vpcdns_resolver_type_manual_prototype_model_json)
+ assert vpcdns_resolver_prototype_vpcdns_resolver_type_manual_prototype_model != False
+
+ # Construct a model instance of VPCDNSResolverPrototypeVPCDNSResolverTypeManualPrototype by calling from_dict on the json representation
+ vpcdns_resolver_prototype_vpcdns_resolver_type_manual_prototype_model_dict = VPCDNSResolverPrototypeVPCDNSResolverTypeManualPrototype.from_dict(vpcdns_resolver_prototype_vpcdns_resolver_type_manual_prototype_model_json).__dict__
+ vpcdns_resolver_prototype_vpcdns_resolver_type_manual_prototype_model2 = VPCDNSResolverPrototypeVPCDNSResolverTypeManualPrototype(**vpcdns_resolver_prototype_vpcdns_resolver_type_manual_prototype_model_dict)
# Verify the model instances are equivalent
- assert network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_tcpudp_prototype_model == network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_tcpudp_prototype_model2
+ assert vpcdns_resolver_prototype_vpcdns_resolver_type_manual_prototype_model == vpcdns_resolver_prototype_vpcdns_resolver_type_manual_prototype_model2
# Convert model instance back to dict and verify no loss of data
- network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_tcpudp_prototype_model_json2 = network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_tcpudp_prototype_model.to_dict()
- assert network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_tcpudp_prototype_model_json2 == network_acl_rule_prototype_network_acl_context_network_acl_rule_protocol_tcpudp_prototype_model_json
+ vpcdns_resolver_prototype_vpcdns_resolver_type_manual_prototype_model_json2 = vpcdns_resolver_prototype_vpcdns_resolver_type_manual_prototype_model.to_dict()
+ assert vpcdns_resolver_prototype_vpcdns_resolver_type_manual_prototype_model_json2 == vpcdns_resolver_prototype_vpcdns_resolver_type_manual_prototype_model_json
-class TestModel_NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype:
+class TestModel_VPCDNSResolverPrototypeVPCDNSResolverTypeSystemPrototype:
"""
- Test Class for NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype
+ Test Class for VPCDNSResolverPrototypeVPCDNSResolverTypeSystemPrototype
"""
- def test_network_acl_rule_prototype_network_acl_rule_protocol_all_prototype_serialization(self):
+ def test_vpcdns_resolver_prototype_vpcdns_resolver_type_system_prototype_serialization(self):
"""
- Test serialization/deserialization for NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype
+ Test serialization/deserialization for VPCDNSResolverPrototypeVPCDNSResolverTypeSystemPrototype
"""
- # Construct dict forms of any model objects needed in order to build this model.
-
- network_acl_rule_before_prototype_model = {} # NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityById
- network_acl_rule_before_prototype_model['id'] = '8daca77a-4980-4d33-8f3e-7038797be8f9'
-
- # Construct a json representation of a NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype model
- network_acl_rule_prototype_network_acl_rule_protocol_all_prototype_model_json = {}
- network_acl_rule_prototype_network_acl_rule_protocol_all_prototype_model_json['action'] = 'allow'
- network_acl_rule_prototype_network_acl_rule_protocol_all_prototype_model_json['before'] = network_acl_rule_before_prototype_model
- network_acl_rule_prototype_network_acl_rule_protocol_all_prototype_model_json['destination'] = '192.168.3.2/32'
- network_acl_rule_prototype_network_acl_rule_protocol_all_prototype_model_json['direction'] = 'inbound'
- network_acl_rule_prototype_network_acl_rule_protocol_all_prototype_model_json['ip_version'] = 'ipv4'
- network_acl_rule_prototype_network_acl_rule_protocol_all_prototype_model_json['name'] = 'my-rule-2'
- network_acl_rule_prototype_network_acl_rule_protocol_all_prototype_model_json['source'] = '192.168.3.2/32'
- network_acl_rule_prototype_network_acl_rule_protocol_all_prototype_model_json['protocol'] = 'all'
+ # Construct a json representation of a VPCDNSResolverPrototypeVPCDNSResolverTypeSystemPrototype model
+ vpcdns_resolver_prototype_vpcdns_resolver_type_system_prototype_model_json = {}
+ vpcdns_resolver_prototype_vpcdns_resolver_type_system_prototype_model_json['type'] = 'system'
- # Construct a model instance of NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype by calling from_dict on the json representation
- network_acl_rule_prototype_network_acl_rule_protocol_all_prototype_model = NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype.from_dict(network_acl_rule_prototype_network_acl_rule_protocol_all_prototype_model_json)
- assert network_acl_rule_prototype_network_acl_rule_protocol_all_prototype_model != False
+ # Construct a model instance of VPCDNSResolverPrototypeVPCDNSResolverTypeSystemPrototype by calling from_dict on the json representation
+ vpcdns_resolver_prototype_vpcdns_resolver_type_system_prototype_model = VPCDNSResolverPrototypeVPCDNSResolverTypeSystemPrototype.from_dict(vpcdns_resolver_prototype_vpcdns_resolver_type_system_prototype_model_json)
+ assert vpcdns_resolver_prototype_vpcdns_resolver_type_system_prototype_model != False
- # Construct a model instance of NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype by calling from_dict on the json representation
- network_acl_rule_prototype_network_acl_rule_protocol_all_prototype_model_dict = NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype.from_dict(network_acl_rule_prototype_network_acl_rule_protocol_all_prototype_model_json).__dict__
- network_acl_rule_prototype_network_acl_rule_protocol_all_prototype_model2 = NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype(**network_acl_rule_prototype_network_acl_rule_protocol_all_prototype_model_dict)
+ # Construct a model instance of VPCDNSResolverPrototypeVPCDNSResolverTypeSystemPrototype by calling from_dict on the json representation
+ vpcdns_resolver_prototype_vpcdns_resolver_type_system_prototype_model_dict = VPCDNSResolverPrototypeVPCDNSResolverTypeSystemPrototype.from_dict(vpcdns_resolver_prototype_vpcdns_resolver_type_system_prototype_model_json).__dict__
+ vpcdns_resolver_prototype_vpcdns_resolver_type_system_prototype_model2 = VPCDNSResolverPrototypeVPCDNSResolverTypeSystemPrototype(**vpcdns_resolver_prototype_vpcdns_resolver_type_system_prototype_model_dict)
# Verify the model instances are equivalent
- assert network_acl_rule_prototype_network_acl_rule_protocol_all_prototype_model == network_acl_rule_prototype_network_acl_rule_protocol_all_prototype_model2
+ assert vpcdns_resolver_prototype_vpcdns_resolver_type_system_prototype_model == vpcdns_resolver_prototype_vpcdns_resolver_type_system_prototype_model2
# Convert model instance back to dict and verify no loss of data
- network_acl_rule_prototype_network_acl_rule_protocol_all_prototype_model_json2 = network_acl_rule_prototype_network_acl_rule_protocol_all_prototype_model.to_dict()
- assert network_acl_rule_prototype_network_acl_rule_protocol_all_prototype_model_json2 == network_acl_rule_prototype_network_acl_rule_protocol_all_prototype_model_json
+ vpcdns_resolver_prototype_vpcdns_resolver_type_system_prototype_model_json2 = vpcdns_resolver_prototype_vpcdns_resolver_type_system_prototype_model.to_dict()
+ assert vpcdns_resolver_prototype_vpcdns_resolver_type_system_prototype_model_json2 == vpcdns_resolver_prototype_vpcdns_resolver_type_system_prototype_model_json
-class TestModel_NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype:
+class TestModel_VPCDNSResolverTypeDelegated:
"""
- Test Class for NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype
+ Test Class for VPCDNSResolverTypeDelegated
"""
- def test_network_acl_rule_prototype_network_acl_rule_protocol_icmp_prototype_serialization(self):
+ def test_vpcdns_resolver_type_delegated_serialization(self):
"""
- Test serialization/deserialization for NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype
+ Test serialization/deserialization for VPCDNSResolverTypeDelegated
"""
# Construct dict forms of any model objects needed in order to build this model.
- network_acl_rule_before_prototype_model = {} # NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityById
- network_acl_rule_before_prototype_model['id'] = '8daca77a-4980-4d33-8f3e-7038797be8f9'
+ 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 NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype model
- network_acl_rule_prototype_network_acl_rule_protocol_icmp_prototype_model_json = {}
- network_acl_rule_prototype_network_acl_rule_protocol_icmp_prototype_model_json['action'] = 'allow'
- network_acl_rule_prototype_network_acl_rule_protocol_icmp_prototype_model_json['before'] = network_acl_rule_before_prototype_model
- network_acl_rule_prototype_network_acl_rule_protocol_icmp_prototype_model_json['destination'] = '192.168.3.2/32'
- network_acl_rule_prototype_network_acl_rule_protocol_icmp_prototype_model_json['direction'] = 'inbound'
- network_acl_rule_prototype_network_acl_rule_protocol_icmp_prototype_model_json['ip_version'] = 'ipv4'
- network_acl_rule_prototype_network_acl_rule_protocol_icmp_prototype_model_json['name'] = 'my-rule-2'
- network_acl_rule_prototype_network_acl_rule_protocol_icmp_prototype_model_json['source'] = '192.168.3.2/32'
- network_acl_rule_prototype_network_acl_rule_protocol_icmp_prototype_model_json['code'] = 0
- network_acl_rule_prototype_network_acl_rule_protocol_icmp_prototype_model_json['protocol'] = 'icmp'
- network_acl_rule_prototype_network_acl_rule_protocol_icmp_prototype_model_json['type'] = 8
+ dns_server_model = {} # DNSServer
+ dns_server_model['address'] = '192.168.3.4'
+ dns_server_model['zone_affinity'] = zone_reference_model
- # Construct a model instance of NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype by calling from_dict on the json representation
- network_acl_rule_prototype_network_acl_rule_protocol_icmp_prototype_model = NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype.from_dict(network_acl_rule_prototype_network_acl_rule_protocol_icmp_prototype_model_json)
- assert network_acl_rule_prototype_network_acl_rule_protocol_icmp_prototype_model != False
+ vpc_reference_dns_resolver_context_deleted_model = {} # VPCReferenceDNSResolverContextDeleted
+ vpc_reference_dns_resolver_context_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Construct a model instance of NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype by calling from_dict on the json representation
- network_acl_rule_prototype_network_acl_rule_protocol_icmp_prototype_model_dict = NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype.from_dict(network_acl_rule_prototype_network_acl_rule_protocol_icmp_prototype_model_json).__dict__
- network_acl_rule_prototype_network_acl_rule_protocol_icmp_prototype_model2 = NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype(**network_acl_rule_prototype_network_acl_rule_protocol_icmp_prototype_model_dict)
+ account_reference_model = {} # AccountReference
+ account_reference_model['id'] = 'aa2432b1fa4d4ace891e9b80fc104e34'
+ account_reference_model['resource_type'] = 'account'
+
+ 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'
+
+ vpc_remote_model = {} # VPCRemote
+ vpc_remote_model['account'] = account_reference_model
+ vpc_remote_model['region'] = region_reference_model
+
+ vpc_reference_dns_resolver_context_model = {} # VPCReferenceDNSResolverContext
+ vpc_reference_dns_resolver_context_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b'
+ vpc_reference_dns_resolver_context_model['deleted'] = vpc_reference_dns_resolver_context_deleted_model
+ vpc_reference_dns_resolver_context_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b'
+ vpc_reference_dns_resolver_context_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b'
+ vpc_reference_dns_resolver_context_model['name'] = 'my-vpc'
+ vpc_reference_dns_resolver_context_model['remote'] = vpc_remote_model
+ vpc_reference_dns_resolver_context_model['resource_type'] = 'vpc'
+
+ # Construct a json representation of a VPCDNSResolverTypeDelegated model
+ vpcdns_resolver_type_delegated_model_json = {}
+ vpcdns_resolver_type_delegated_model_json['servers'] = [dns_server_model]
+ vpcdns_resolver_type_delegated_model_json['type'] = 'delegated'
+ vpcdns_resolver_type_delegated_model_json['vpc'] = vpc_reference_dns_resolver_context_model
+
+ # Construct a model instance of VPCDNSResolverTypeDelegated by calling from_dict on the json representation
+ vpcdns_resolver_type_delegated_model = VPCDNSResolverTypeDelegated.from_dict(vpcdns_resolver_type_delegated_model_json)
+ assert vpcdns_resolver_type_delegated_model != False
+
+ # Construct a model instance of VPCDNSResolverTypeDelegated by calling from_dict on the json representation
+ vpcdns_resolver_type_delegated_model_dict = VPCDNSResolverTypeDelegated.from_dict(vpcdns_resolver_type_delegated_model_json).__dict__
+ vpcdns_resolver_type_delegated_model2 = VPCDNSResolverTypeDelegated(**vpcdns_resolver_type_delegated_model_dict)
# Verify the model instances are equivalent
- assert network_acl_rule_prototype_network_acl_rule_protocol_icmp_prototype_model == network_acl_rule_prototype_network_acl_rule_protocol_icmp_prototype_model2
+ assert vpcdns_resolver_type_delegated_model == vpcdns_resolver_type_delegated_model2
# Convert model instance back to dict and verify no loss of data
- network_acl_rule_prototype_network_acl_rule_protocol_icmp_prototype_model_json2 = network_acl_rule_prototype_network_acl_rule_protocol_icmp_prototype_model.to_dict()
- assert network_acl_rule_prototype_network_acl_rule_protocol_icmp_prototype_model_json2 == network_acl_rule_prototype_network_acl_rule_protocol_icmp_prototype_model_json
+ vpcdns_resolver_type_delegated_model_json2 = vpcdns_resolver_type_delegated_model.to_dict()
+ assert vpcdns_resolver_type_delegated_model_json2 == vpcdns_resolver_type_delegated_model_json
-class TestModel_NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype:
+class TestModel_VPCDNSResolverTypeManual:
"""
- Test Class for NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype
+ Test Class for VPCDNSResolverTypeManual
"""
- def test_network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_prototype_serialization(self):
+ def test_vpcdns_resolver_type_manual_serialization(self):
"""
- Test serialization/deserialization for NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype
+ Test serialization/deserialization for VPCDNSResolverTypeManual
"""
# Construct dict forms of any model objects needed in order to build this model.
- network_acl_rule_before_prototype_model = {} # NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityById
- network_acl_rule_before_prototype_model['id'] = '8daca77a-4980-4d33-8f3e-7038797be8f9'
+ 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 NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype model
- network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_prototype_model_json = {}
- network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_prototype_model_json['action'] = 'allow'
- network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_prototype_model_json['before'] = network_acl_rule_before_prototype_model
- network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_prototype_model_json['destination'] = '192.168.3.2/32'
- network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_prototype_model_json['direction'] = 'inbound'
- network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_prototype_model_json['ip_version'] = 'ipv4'
- network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_prototype_model_json['name'] = 'my-rule-2'
- network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_prototype_model_json['source'] = '192.168.3.2/32'
- network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_prototype_model_json['destination_port_max'] = 22
- network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_prototype_model_json['destination_port_min'] = 22
- network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_prototype_model_json['protocol'] = 'udp'
- network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_prototype_model_json['source_port_max'] = 65535
- network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_prototype_model_json['source_port_min'] = 49152
+ dns_server_model = {} # DNSServer
+ dns_server_model['address'] = '192.168.3.4'
+ dns_server_model['zone_affinity'] = zone_reference_model
- # Construct a model instance of NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype by calling from_dict on the json representation
- network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_prototype_model = NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype.from_dict(network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_prototype_model_json)
- assert network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_prototype_model != False
+ # Construct a json representation of a VPCDNSResolverTypeManual model
+ vpcdns_resolver_type_manual_model_json = {}
+ vpcdns_resolver_type_manual_model_json['servers'] = [dns_server_model]
+ vpcdns_resolver_type_manual_model_json['manual_servers'] = [dns_server_model]
+ vpcdns_resolver_type_manual_model_json['type'] = 'manual'
- # Construct a model instance of NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype by calling from_dict on the json representation
- network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_prototype_model_dict = NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype.from_dict(network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_prototype_model_json).__dict__
- network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_prototype_model2 = NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype(**network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_prototype_model_dict)
+ # Construct a model instance of VPCDNSResolverTypeManual by calling from_dict on the json representation
+ vpcdns_resolver_type_manual_model = VPCDNSResolverTypeManual.from_dict(vpcdns_resolver_type_manual_model_json)
+ assert vpcdns_resolver_type_manual_model != False
+
+ # Construct a model instance of VPCDNSResolverTypeManual by calling from_dict on the json representation
+ vpcdns_resolver_type_manual_model_dict = VPCDNSResolverTypeManual.from_dict(vpcdns_resolver_type_manual_model_json).__dict__
+ vpcdns_resolver_type_manual_model2 = VPCDNSResolverTypeManual(**vpcdns_resolver_type_manual_model_dict)
# Verify the model instances are equivalent
- assert network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_prototype_model == network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_prototype_model2
+ assert vpcdns_resolver_type_manual_model == vpcdns_resolver_type_manual_model2
# Convert model instance back to dict and verify no loss of data
- network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_prototype_model_json2 = network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_prototype_model.to_dict()
- assert network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_prototype_model_json2 == network_acl_rule_prototype_network_acl_rule_protocol_tcpudp_prototype_model_json
+ vpcdns_resolver_type_manual_model_json2 = vpcdns_resolver_type_manual_model.to_dict()
+ assert vpcdns_resolver_type_manual_model_json2 == vpcdns_resolver_type_manual_model_json
-class TestModel_NetworkACLRuleNetworkACLRuleProtocolAll:
+class TestModel_VPCDNSResolverTypeSystem:
"""
- Test Class for NetworkACLRuleNetworkACLRuleProtocolAll
+ Test Class for VPCDNSResolverTypeSystem
"""
- def test_network_acl_rule_network_acl_rule_protocol_all_serialization(self):
+ def test_vpcdns_resolver_type_system_serialization(self):
"""
- Test serialization/deserialization for NetworkACLRuleNetworkACLRuleProtocolAll
+ Test serialization/deserialization for VPCDNSResolverTypeSystem
"""
# 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'
-
- 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'
+ 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 NetworkACLRuleNetworkACLRuleProtocolAll model
- network_acl_rule_network_acl_rule_protocol_all_model_json = {}
- network_acl_rule_network_acl_rule_protocol_all_model_json['action'] = 'allow'
- network_acl_rule_network_acl_rule_protocol_all_model_json['before'] = network_acl_rule_reference_model
- network_acl_rule_network_acl_rule_protocol_all_model_json['created_at'] = '2019-01-01T12:00:00Z'
- network_acl_rule_network_acl_rule_protocol_all_model_json['destination'] = '192.168.3.0/24'
- network_acl_rule_network_acl_rule_protocol_all_model_json['direction'] = 'inbound'
- network_acl_rule_network_acl_rule_protocol_all_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9'
- network_acl_rule_network_acl_rule_protocol_all_model_json['id'] = '8daca77a-4980-4d33-8f3e-7038797be8f9'
- network_acl_rule_network_acl_rule_protocol_all_model_json['ip_version'] = 'ipv4'
- network_acl_rule_network_acl_rule_protocol_all_model_json['name'] = 'my-rule-1'
- network_acl_rule_network_acl_rule_protocol_all_model_json['source'] = '192.168.3.0/24'
- network_acl_rule_network_acl_rule_protocol_all_model_json['protocol'] = 'all'
+ dns_server_model = {} # DNSServer
+ dns_server_model['address'] = '192.168.3.4'
+ dns_server_model['zone_affinity'] = zone_reference_model
- # Construct a model instance of NetworkACLRuleNetworkACLRuleProtocolAll by calling from_dict on the json representation
- network_acl_rule_network_acl_rule_protocol_all_model = NetworkACLRuleNetworkACLRuleProtocolAll.from_dict(network_acl_rule_network_acl_rule_protocol_all_model_json)
- assert network_acl_rule_network_acl_rule_protocol_all_model != False
+ # Construct a json representation of a VPCDNSResolverTypeSystem model
+ vpcdns_resolver_type_system_model_json = {}
+ vpcdns_resolver_type_system_model_json['servers'] = [dns_server_model]
+ vpcdns_resolver_type_system_model_json['configuration'] = 'custom_resolver'
+ vpcdns_resolver_type_system_model_json['type'] = 'system'
- # Construct a model instance of NetworkACLRuleNetworkACLRuleProtocolAll by calling from_dict on the json representation
- network_acl_rule_network_acl_rule_protocol_all_model_dict = NetworkACLRuleNetworkACLRuleProtocolAll.from_dict(network_acl_rule_network_acl_rule_protocol_all_model_json).__dict__
- network_acl_rule_network_acl_rule_protocol_all_model2 = NetworkACLRuleNetworkACLRuleProtocolAll(**network_acl_rule_network_acl_rule_protocol_all_model_dict)
+ # Construct a model instance of VPCDNSResolverTypeSystem by calling from_dict on the json representation
+ vpcdns_resolver_type_system_model = VPCDNSResolverTypeSystem.from_dict(vpcdns_resolver_type_system_model_json)
+ assert vpcdns_resolver_type_system_model != False
+
+ # Construct a model instance of VPCDNSResolverTypeSystem by calling from_dict on the json representation
+ vpcdns_resolver_type_system_model_dict = VPCDNSResolverTypeSystem.from_dict(vpcdns_resolver_type_system_model_json).__dict__
+ vpcdns_resolver_type_system_model2 = VPCDNSResolverTypeSystem(**vpcdns_resolver_type_system_model_dict)
# Verify the model instances are equivalent
- assert network_acl_rule_network_acl_rule_protocol_all_model == network_acl_rule_network_acl_rule_protocol_all_model2
+ assert vpcdns_resolver_type_system_model == vpcdns_resolver_type_system_model2
# Convert model instance back to dict and verify no loss of data
- network_acl_rule_network_acl_rule_protocol_all_model_json2 = network_acl_rule_network_acl_rule_protocol_all_model.to_dict()
- assert network_acl_rule_network_acl_rule_protocol_all_model_json2 == network_acl_rule_network_acl_rule_protocol_all_model_json
+ vpcdns_resolver_type_system_model_json2 = vpcdns_resolver_type_system_model.to_dict()
+ assert vpcdns_resolver_type_system_model_json2 == vpcdns_resolver_type_system_model_json
-class TestModel_NetworkACLRuleNetworkACLRuleProtocolICMP:
+class TestModel_VPCDNSResolverVPCPatchVPCIdentityByCRN:
"""
- Test Class for NetworkACLRuleNetworkACLRuleProtocolICMP
+ Test Class for VPCDNSResolverVPCPatchVPCIdentityByCRN
"""
- def test_network_acl_rule_network_acl_rule_protocol_icmp_serialization(self):
+ def test_vpcdns_resolver_vpc_patch_vpc_identity_by_crn_serialization(self):
"""
- Test serialization/deserialization for NetworkACLRuleNetworkACLRuleProtocolICMP
+ Test serialization/deserialization for VPCDNSResolverVPCPatchVPCIdentityByCRN
"""
- # 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'
-
- 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 json representation of a NetworkACLRuleNetworkACLRuleProtocolICMP model
- network_acl_rule_network_acl_rule_protocol_icmp_model_json = {}
- network_acl_rule_network_acl_rule_protocol_icmp_model_json['action'] = 'allow'
- network_acl_rule_network_acl_rule_protocol_icmp_model_json['before'] = network_acl_rule_reference_model
- network_acl_rule_network_acl_rule_protocol_icmp_model_json['created_at'] = '2019-01-01T12:00:00Z'
- network_acl_rule_network_acl_rule_protocol_icmp_model_json['destination'] = '192.168.3.0/24'
- network_acl_rule_network_acl_rule_protocol_icmp_model_json['direction'] = 'inbound'
- network_acl_rule_network_acl_rule_protocol_icmp_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9'
- network_acl_rule_network_acl_rule_protocol_icmp_model_json['id'] = '8daca77a-4980-4d33-8f3e-7038797be8f9'
- network_acl_rule_network_acl_rule_protocol_icmp_model_json['ip_version'] = 'ipv4'
- network_acl_rule_network_acl_rule_protocol_icmp_model_json['name'] = 'my-rule-1'
- network_acl_rule_network_acl_rule_protocol_icmp_model_json['source'] = '192.168.3.0/24'
- network_acl_rule_network_acl_rule_protocol_icmp_model_json['code'] = 0
- network_acl_rule_network_acl_rule_protocol_icmp_model_json['protocol'] = 'icmp'
- network_acl_rule_network_acl_rule_protocol_icmp_model_json['type'] = 8
+ # Construct a json representation of a VPCDNSResolverVPCPatchVPCIdentityByCRN model
+ vpcdns_resolver_vpc_patch_vpc_identity_by_crn_model_json = {}
+ vpcdns_resolver_vpc_patch_vpc_identity_by_crn_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b'
- # Construct a model instance of NetworkACLRuleNetworkACLRuleProtocolICMP by calling from_dict on the json representation
- network_acl_rule_network_acl_rule_protocol_icmp_model = NetworkACLRuleNetworkACLRuleProtocolICMP.from_dict(network_acl_rule_network_acl_rule_protocol_icmp_model_json)
- assert network_acl_rule_network_acl_rule_protocol_icmp_model != False
+ # Construct a model instance of VPCDNSResolverVPCPatchVPCIdentityByCRN by calling from_dict on the json representation
+ vpcdns_resolver_vpc_patch_vpc_identity_by_crn_model = VPCDNSResolverVPCPatchVPCIdentityByCRN.from_dict(vpcdns_resolver_vpc_patch_vpc_identity_by_crn_model_json)
+ assert vpcdns_resolver_vpc_patch_vpc_identity_by_crn_model != False
- # Construct a model instance of NetworkACLRuleNetworkACLRuleProtocolICMP by calling from_dict on the json representation
- network_acl_rule_network_acl_rule_protocol_icmp_model_dict = NetworkACLRuleNetworkACLRuleProtocolICMP.from_dict(network_acl_rule_network_acl_rule_protocol_icmp_model_json).__dict__
- network_acl_rule_network_acl_rule_protocol_icmp_model2 = NetworkACLRuleNetworkACLRuleProtocolICMP(**network_acl_rule_network_acl_rule_protocol_icmp_model_dict)
+ # Construct a model instance of VPCDNSResolverVPCPatchVPCIdentityByCRN by calling from_dict on the json representation
+ vpcdns_resolver_vpc_patch_vpc_identity_by_crn_model_dict = VPCDNSResolverVPCPatchVPCIdentityByCRN.from_dict(vpcdns_resolver_vpc_patch_vpc_identity_by_crn_model_json).__dict__
+ vpcdns_resolver_vpc_patch_vpc_identity_by_crn_model2 = VPCDNSResolverVPCPatchVPCIdentityByCRN(**vpcdns_resolver_vpc_patch_vpc_identity_by_crn_model_dict)
# Verify the model instances are equivalent
- assert network_acl_rule_network_acl_rule_protocol_icmp_model == network_acl_rule_network_acl_rule_protocol_icmp_model2
+ assert vpcdns_resolver_vpc_patch_vpc_identity_by_crn_model == vpcdns_resolver_vpc_patch_vpc_identity_by_crn_model2
# Convert model instance back to dict and verify no loss of data
- network_acl_rule_network_acl_rule_protocol_icmp_model_json2 = network_acl_rule_network_acl_rule_protocol_icmp_model.to_dict()
- assert network_acl_rule_network_acl_rule_protocol_icmp_model_json2 == network_acl_rule_network_acl_rule_protocol_icmp_model_json
+ vpcdns_resolver_vpc_patch_vpc_identity_by_crn_model_json2 = vpcdns_resolver_vpc_patch_vpc_identity_by_crn_model.to_dict()
+ assert vpcdns_resolver_vpc_patch_vpc_identity_by_crn_model_json2 == vpcdns_resolver_vpc_patch_vpc_identity_by_crn_model_json
-class TestModel_NetworkACLRuleNetworkACLRuleProtocolTCPUDP:
+class TestModel_VPCDNSResolverVPCPatchVPCIdentityByHref:
"""
- Test Class for NetworkACLRuleNetworkACLRuleProtocolTCPUDP
+ Test Class for VPCDNSResolverVPCPatchVPCIdentityByHref
"""
- def test_network_acl_rule_network_acl_rule_protocol_tcpudp_serialization(self):
+ def test_vpcdns_resolver_vpc_patch_vpc_identity_by_href_serialization(self):
"""
- Test serialization/deserialization for NetworkACLRuleNetworkACLRuleProtocolTCPUDP
+ Test serialization/deserialization for VPCDNSResolverVPCPatchVPCIdentityByHref
"""
- # 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'
-
- 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 json representation of a NetworkACLRuleNetworkACLRuleProtocolTCPUDP model
- network_acl_rule_network_acl_rule_protocol_tcpudp_model_json = {}
- network_acl_rule_network_acl_rule_protocol_tcpudp_model_json['action'] = 'allow'
- network_acl_rule_network_acl_rule_protocol_tcpudp_model_json['before'] = network_acl_rule_reference_model
- network_acl_rule_network_acl_rule_protocol_tcpudp_model_json['created_at'] = '2019-01-01T12:00:00Z'
- network_acl_rule_network_acl_rule_protocol_tcpudp_model_json['destination'] = '192.168.3.0/24'
- network_acl_rule_network_acl_rule_protocol_tcpudp_model_json['direction'] = 'inbound'
- network_acl_rule_network_acl_rule_protocol_tcpudp_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9'
- network_acl_rule_network_acl_rule_protocol_tcpudp_model_json['id'] = '8daca77a-4980-4d33-8f3e-7038797be8f9'
- network_acl_rule_network_acl_rule_protocol_tcpudp_model_json['ip_version'] = 'ipv4'
- network_acl_rule_network_acl_rule_protocol_tcpudp_model_json['name'] = 'my-rule-1'
- network_acl_rule_network_acl_rule_protocol_tcpudp_model_json['source'] = '192.168.3.0/24'
- network_acl_rule_network_acl_rule_protocol_tcpudp_model_json['destination_port_max'] = 22
- network_acl_rule_network_acl_rule_protocol_tcpudp_model_json['destination_port_min'] = 22
- network_acl_rule_network_acl_rule_protocol_tcpudp_model_json['protocol'] = 'udp'
- network_acl_rule_network_acl_rule_protocol_tcpudp_model_json['source_port_max'] = 65535
- network_acl_rule_network_acl_rule_protocol_tcpudp_model_json['source_port_min'] = 49152
+ # Construct a json representation of a VPCDNSResolverVPCPatchVPCIdentityByHref model
+ vpcdns_resolver_vpc_patch_vpc_identity_by_href_model_json = {}
+ vpcdns_resolver_vpc_patch_vpc_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b'
- # Construct a model instance of NetworkACLRuleNetworkACLRuleProtocolTCPUDP by calling from_dict on the json representation
- network_acl_rule_network_acl_rule_protocol_tcpudp_model = NetworkACLRuleNetworkACLRuleProtocolTCPUDP.from_dict(network_acl_rule_network_acl_rule_protocol_tcpudp_model_json)
- assert network_acl_rule_network_acl_rule_protocol_tcpudp_model != False
+ # Construct a model instance of VPCDNSResolverVPCPatchVPCIdentityByHref by calling from_dict on the json representation
+ vpcdns_resolver_vpc_patch_vpc_identity_by_href_model = VPCDNSResolverVPCPatchVPCIdentityByHref.from_dict(vpcdns_resolver_vpc_patch_vpc_identity_by_href_model_json)
+ assert vpcdns_resolver_vpc_patch_vpc_identity_by_href_model != False
- # Construct a model instance of NetworkACLRuleNetworkACLRuleProtocolTCPUDP by calling from_dict on the json representation
- network_acl_rule_network_acl_rule_protocol_tcpudp_model_dict = NetworkACLRuleNetworkACLRuleProtocolTCPUDP.from_dict(network_acl_rule_network_acl_rule_protocol_tcpudp_model_json).__dict__
- network_acl_rule_network_acl_rule_protocol_tcpudp_model2 = NetworkACLRuleNetworkACLRuleProtocolTCPUDP(**network_acl_rule_network_acl_rule_protocol_tcpudp_model_dict)
+ # Construct a model instance of VPCDNSResolverVPCPatchVPCIdentityByHref by calling from_dict on the json representation
+ vpcdns_resolver_vpc_patch_vpc_identity_by_href_model_dict = VPCDNSResolverVPCPatchVPCIdentityByHref.from_dict(vpcdns_resolver_vpc_patch_vpc_identity_by_href_model_json).__dict__
+ vpcdns_resolver_vpc_patch_vpc_identity_by_href_model2 = VPCDNSResolverVPCPatchVPCIdentityByHref(**vpcdns_resolver_vpc_patch_vpc_identity_by_href_model_dict)
# Verify the model instances are equivalent
- assert network_acl_rule_network_acl_rule_protocol_tcpudp_model == network_acl_rule_network_acl_rule_protocol_tcpudp_model2
+ assert vpcdns_resolver_vpc_patch_vpc_identity_by_href_model == vpcdns_resolver_vpc_patch_vpc_identity_by_href_model2
# Convert model instance back to dict and verify no loss of data
- network_acl_rule_network_acl_rule_protocol_tcpudp_model_json2 = network_acl_rule_network_acl_rule_protocol_tcpudp_model.to_dict()
- assert network_acl_rule_network_acl_rule_protocol_tcpudp_model_json2 == network_acl_rule_network_acl_rule_protocol_tcpudp_model_json
+ vpcdns_resolver_vpc_patch_vpc_identity_by_href_model_json2 = vpcdns_resolver_vpc_patch_vpc_identity_by_href_model.to_dict()
+ assert vpcdns_resolver_vpc_patch_vpc_identity_by_href_model_json2 == vpcdns_resolver_vpc_patch_vpc_identity_by_href_model_json
-class TestModel_NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext:
+class TestModel_VPCDNSResolverVPCPatchVPCIdentityById:
"""
- Test Class for NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext
+ Test Class for VPCDNSResolverVPCPatchVPCIdentityById
"""
- def test_network_interface_ip_prototype_reserved_ip_prototype_network_interface_context_serialization(self):
+ def test_vpcdns_resolver_vpc_patch_vpc_identity_by_id_serialization(self):
"""
- Test serialization/deserialization for NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext
+ Test serialization/deserialization for VPCDNSResolverVPCPatchVPCIdentityById
"""
- # Construct a json representation of a NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext model
- network_interface_ip_prototype_reserved_ip_prototype_network_interface_context_model_json = {}
- network_interface_ip_prototype_reserved_ip_prototype_network_interface_context_model_json['address'] = '192.168.3.4'
- network_interface_ip_prototype_reserved_ip_prototype_network_interface_context_model_json['auto_delete'] = False
- network_interface_ip_prototype_reserved_ip_prototype_network_interface_context_model_json['name'] = 'my-reserved-ip'
+ # Construct a json representation of a VPCDNSResolverVPCPatchVPCIdentityById model
+ vpcdns_resolver_vpc_patch_vpc_identity_by_id_model_json = {}
+ vpcdns_resolver_vpc_patch_vpc_identity_by_id_model_json['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b'
- # Construct a model instance of NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext by calling from_dict on the json representation
- network_interface_ip_prototype_reserved_ip_prototype_network_interface_context_model = NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext.from_dict(network_interface_ip_prototype_reserved_ip_prototype_network_interface_context_model_json)
- assert network_interface_ip_prototype_reserved_ip_prototype_network_interface_context_model != False
+ # Construct a model instance of VPCDNSResolverVPCPatchVPCIdentityById by calling from_dict on the json representation
+ vpcdns_resolver_vpc_patch_vpc_identity_by_id_model = VPCDNSResolverVPCPatchVPCIdentityById.from_dict(vpcdns_resolver_vpc_patch_vpc_identity_by_id_model_json)
+ assert vpcdns_resolver_vpc_patch_vpc_identity_by_id_model != False
- # Construct a model instance of NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext by calling from_dict on the json representation
- network_interface_ip_prototype_reserved_ip_prototype_network_interface_context_model_dict = NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext.from_dict(network_interface_ip_prototype_reserved_ip_prototype_network_interface_context_model_json).__dict__
- network_interface_ip_prototype_reserved_ip_prototype_network_interface_context_model2 = NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext(**network_interface_ip_prototype_reserved_ip_prototype_network_interface_context_model_dict)
+ # Construct a model instance of VPCDNSResolverVPCPatchVPCIdentityById by calling from_dict on the json representation
+ vpcdns_resolver_vpc_patch_vpc_identity_by_id_model_dict = VPCDNSResolverVPCPatchVPCIdentityById.from_dict(vpcdns_resolver_vpc_patch_vpc_identity_by_id_model_json).__dict__
+ vpcdns_resolver_vpc_patch_vpc_identity_by_id_model2 = VPCDNSResolverVPCPatchVPCIdentityById(**vpcdns_resolver_vpc_patch_vpc_identity_by_id_model_dict)
# Verify the model instances are equivalent
- assert network_interface_ip_prototype_reserved_ip_prototype_network_interface_context_model == network_interface_ip_prototype_reserved_ip_prototype_network_interface_context_model2
+ assert vpcdns_resolver_vpc_patch_vpc_identity_by_id_model == vpcdns_resolver_vpc_patch_vpc_identity_by_id_model2
# Convert model instance back to dict and verify no loss of data
- network_interface_ip_prototype_reserved_ip_prototype_network_interface_context_model_json2 = network_interface_ip_prototype_reserved_ip_prototype_network_interface_context_model.to_dict()
- assert network_interface_ip_prototype_reserved_ip_prototype_network_interface_context_model_json2 == network_interface_ip_prototype_reserved_ip_prototype_network_interface_context_model_json
+ vpcdns_resolver_vpc_patch_vpc_identity_by_id_model_json2 = vpcdns_resolver_vpc_patch_vpc_identity_by_id_model.to_dict()
+ assert vpcdns_resolver_vpc_patch_vpc_identity_by_id_model_json2 == vpcdns_resolver_vpc_patch_vpc_identity_by_id_model_json
-class TestModel_OperatingSystemIdentityByHref:
+class TestModel_VPCIdentityByCRN:
"""
- Test Class for OperatingSystemIdentityByHref
+ Test Class for VPCIdentityByCRN
"""
- def test_operating_system_identity_by_href_serialization(self):
+ def test_vpc_identity_by_crn_serialization(self):
"""
- Test serialization/deserialization for OperatingSystemIdentityByHref
+ Test serialization/deserialization for VPCIdentityByCRN
"""
- # Construct a json representation of a OperatingSystemIdentityByHref model
- operating_system_identity_by_href_model_json = {}
- operating_system_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64'
+ # Construct a json representation of a VPCIdentityByCRN model
+ vpc_identity_by_crn_model_json = {}
+ vpc_identity_by_crn_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b'
- # Construct a model instance of OperatingSystemIdentityByHref by calling from_dict on the json representation
- operating_system_identity_by_href_model = OperatingSystemIdentityByHref.from_dict(operating_system_identity_by_href_model_json)
- assert operating_system_identity_by_href_model != False
+ # Construct a model instance of VPCIdentityByCRN by calling from_dict on the json representation
+ vpc_identity_by_crn_model = VPCIdentityByCRN.from_dict(vpc_identity_by_crn_model_json)
+ assert vpc_identity_by_crn_model != False
- # Construct a model instance of OperatingSystemIdentityByHref by calling from_dict on the json representation
- operating_system_identity_by_href_model_dict = OperatingSystemIdentityByHref.from_dict(operating_system_identity_by_href_model_json).__dict__
- operating_system_identity_by_href_model2 = OperatingSystemIdentityByHref(**operating_system_identity_by_href_model_dict)
+ # Construct a model instance of VPCIdentityByCRN by calling from_dict on the json representation
+ vpc_identity_by_crn_model_dict = VPCIdentityByCRN.from_dict(vpc_identity_by_crn_model_json).__dict__
+ vpc_identity_by_crn_model2 = VPCIdentityByCRN(**vpc_identity_by_crn_model_dict)
# Verify the model instances are equivalent
- assert operating_system_identity_by_href_model == operating_system_identity_by_href_model2
+ assert vpc_identity_by_crn_model == vpc_identity_by_crn_model2
# Convert model instance back to dict and verify no loss of data
- operating_system_identity_by_href_model_json2 = operating_system_identity_by_href_model.to_dict()
- assert operating_system_identity_by_href_model_json2 == operating_system_identity_by_href_model_json
+ vpc_identity_by_crn_model_json2 = vpc_identity_by_crn_model.to_dict()
+ assert vpc_identity_by_crn_model_json2 == vpc_identity_by_crn_model_json
-class TestModel_OperatingSystemIdentityByName:
+class TestModel_VPCIdentityByHref:
"""
- Test Class for OperatingSystemIdentityByName
+ Test Class for VPCIdentityByHref
"""
- def test_operating_system_identity_by_name_serialization(self):
+ def test_vpc_identity_by_href_serialization(self):
"""
- Test serialization/deserialization for OperatingSystemIdentityByName
+ Test serialization/deserialization for VPCIdentityByHref
"""
- # Construct a json representation of a OperatingSystemIdentityByName model
- operating_system_identity_by_name_model_json = {}
- operating_system_identity_by_name_model_json['name'] = 'ubuntu-16-amd64'
+ # Construct a json representation of a VPCIdentityByHref model
+ vpc_identity_by_href_model_json = {}
+ vpc_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b'
- # Construct a model instance of OperatingSystemIdentityByName by calling from_dict on the json representation
- operating_system_identity_by_name_model = OperatingSystemIdentityByName.from_dict(operating_system_identity_by_name_model_json)
- assert operating_system_identity_by_name_model != False
+ # Construct a model instance of VPCIdentityByHref by calling from_dict on the json representation
+ vpc_identity_by_href_model = VPCIdentityByHref.from_dict(vpc_identity_by_href_model_json)
+ assert vpc_identity_by_href_model != False
- # Construct a model instance of OperatingSystemIdentityByName by calling from_dict on the json representation
- operating_system_identity_by_name_model_dict = OperatingSystemIdentityByName.from_dict(operating_system_identity_by_name_model_json).__dict__
- operating_system_identity_by_name_model2 = OperatingSystemIdentityByName(**operating_system_identity_by_name_model_dict)
+ # Construct a model instance of VPCIdentityByHref by calling from_dict on the json representation
+ vpc_identity_by_href_model_dict = VPCIdentityByHref.from_dict(vpc_identity_by_href_model_json).__dict__
+ vpc_identity_by_href_model2 = VPCIdentityByHref(**vpc_identity_by_href_model_dict)
# Verify the model instances are equivalent
- assert operating_system_identity_by_name_model == operating_system_identity_by_name_model2
+ assert vpc_identity_by_href_model == vpc_identity_by_href_model2
# Convert model instance back to dict and verify no loss of data
- operating_system_identity_by_name_model_json2 = operating_system_identity_by_name_model.to_dict()
- assert operating_system_identity_by_name_model_json2 == operating_system_identity_by_name_model_json
+ vpc_identity_by_href_model_json2 = vpc_identity_by_href_model.to_dict()
+ assert vpc_identity_by_href_model_json2 == vpc_identity_by_href_model_json
-class TestModel_PublicGatewayFloatingIPPrototypeFloatingIPPrototypeTargetContext:
+class TestModel_VPCIdentityById:
"""
- Test Class for PublicGatewayFloatingIPPrototypeFloatingIPPrototypeTargetContext
+ Test Class for VPCIdentityById
"""
- def test_public_gateway_floating_ip_prototype_floating_ip_prototype_target_context_serialization(self):
+ def test_vpc_identity_by_id_serialization(self):
"""
- Test serialization/deserialization for PublicGatewayFloatingIPPrototypeFloatingIPPrototypeTargetContext
+ Test serialization/deserialization for VPCIdentityById
"""
- # 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'
-
- # Construct a json representation of a PublicGatewayFloatingIPPrototypeFloatingIPPrototypeTargetContext model
- public_gateway_floating_ip_prototype_floating_ip_prototype_target_context_model_json = {}
- public_gateway_floating_ip_prototype_floating_ip_prototype_target_context_model_json['name'] = 'my-floating-ip'
- public_gateway_floating_ip_prototype_floating_ip_prototype_target_context_model_json['resource_group'] = resource_group_identity_model
+ # Construct a json representation of a VPCIdentityById model
+ vpc_identity_by_id_model_json = {}
+ vpc_identity_by_id_model_json['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b'
- # Construct a model instance of PublicGatewayFloatingIPPrototypeFloatingIPPrototypeTargetContext by calling from_dict on the json representation
- public_gateway_floating_ip_prototype_floating_ip_prototype_target_context_model = PublicGatewayFloatingIPPrototypeFloatingIPPrototypeTargetContext.from_dict(public_gateway_floating_ip_prototype_floating_ip_prototype_target_context_model_json)
- assert public_gateway_floating_ip_prototype_floating_ip_prototype_target_context_model != False
+ # Construct a model instance of VPCIdentityById by calling from_dict on the json representation
+ vpc_identity_by_id_model = VPCIdentityById.from_dict(vpc_identity_by_id_model_json)
+ assert vpc_identity_by_id_model != False
- # Construct a model instance of PublicGatewayFloatingIPPrototypeFloatingIPPrototypeTargetContext by calling from_dict on the json representation
- public_gateway_floating_ip_prototype_floating_ip_prototype_target_context_model_dict = PublicGatewayFloatingIPPrototypeFloatingIPPrototypeTargetContext.from_dict(public_gateway_floating_ip_prototype_floating_ip_prototype_target_context_model_json).__dict__
- public_gateway_floating_ip_prototype_floating_ip_prototype_target_context_model2 = PublicGatewayFloatingIPPrototypeFloatingIPPrototypeTargetContext(**public_gateway_floating_ip_prototype_floating_ip_prototype_target_context_model_dict)
+ # Construct a model instance of VPCIdentityById by calling from_dict on the json representation
+ vpc_identity_by_id_model_dict = VPCIdentityById.from_dict(vpc_identity_by_id_model_json).__dict__
+ vpc_identity_by_id_model2 = VPCIdentityById(**vpc_identity_by_id_model_dict)
# Verify the model instances are equivalent
- assert public_gateway_floating_ip_prototype_floating_ip_prototype_target_context_model == public_gateway_floating_ip_prototype_floating_ip_prototype_target_context_model2
+ assert vpc_identity_by_id_model == vpc_identity_by_id_model2
# Convert model instance back to dict and verify no loss of data
- 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
+ vpc_identity_by_id_model_json2 = vpc_identity_by_id_model.to_dict()
+ assert vpc_identity_by_id_model_json2 == vpc_identity_by_id_model_json
-class TestModel_PublicGatewayIdentityPublicGatewayIdentityByCRN:
+class TestModel_VPNGatewayConnectionIKEPolicyPatchIKEPolicyIdentityByHref:
"""
- Test Class for PublicGatewayIdentityPublicGatewayIdentityByCRN
+ Test Class for VPNGatewayConnectionIKEPolicyPatchIKEPolicyIdentityByHref
"""
- def test_public_gateway_identity_public_gateway_identity_by_crn_serialization(self):
+ def test_vpn_gateway_connection_ike_policy_patch_ike_policy_identity_by_href_serialization(self):
"""
- Test serialization/deserialization for PublicGatewayIdentityPublicGatewayIdentityByCRN
+ Test serialization/deserialization for VPNGatewayConnectionIKEPolicyPatchIKEPolicyIdentityByHref
"""
- # 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 json representation of a VPNGatewayConnectionIKEPolicyPatchIKEPolicyIdentityByHref model
+ vpn_gateway_connection_ike_policy_patch_ike_policy_identity_by_href_model_json = {}
+ vpn_gateway_connection_ike_policy_patch_ike_policy_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b'
- # 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 VPNGatewayConnectionIKEPolicyPatchIKEPolicyIdentityByHref by calling from_dict on the json representation
+ vpn_gateway_connection_ike_policy_patch_ike_policy_identity_by_href_model = VPNGatewayConnectionIKEPolicyPatchIKEPolicyIdentityByHref.from_dict(vpn_gateway_connection_ike_policy_patch_ike_policy_identity_by_href_model_json)
+ assert vpn_gateway_connection_ike_policy_patch_ike_policy_identity_by_href_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_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)
+ # Construct a model instance of VPNGatewayConnectionIKEPolicyPatchIKEPolicyIdentityByHref by calling from_dict on the json representation
+ vpn_gateway_connection_ike_policy_patch_ike_policy_identity_by_href_model_dict = VPNGatewayConnectionIKEPolicyPatchIKEPolicyIdentityByHref.from_dict(vpn_gateway_connection_ike_policy_patch_ike_policy_identity_by_href_model_json).__dict__
+ vpn_gateway_connection_ike_policy_patch_ike_policy_identity_by_href_model2 = VPNGatewayConnectionIKEPolicyPatchIKEPolicyIdentityByHref(**vpn_gateway_connection_ike_policy_patch_ike_policy_identity_by_href_model_dict)
# Verify the model instances are equivalent
- assert public_gateway_identity_public_gateway_identity_by_crn_model == public_gateway_identity_public_gateway_identity_by_crn_model2
+ assert vpn_gateway_connection_ike_policy_patch_ike_policy_identity_by_href_model == vpn_gateway_connection_ike_policy_patch_ike_policy_identity_by_href_model2
# Convert model instance back to dict and verify no loss of data
- 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
+ vpn_gateway_connection_ike_policy_patch_ike_policy_identity_by_href_model_json2 = vpn_gateway_connection_ike_policy_patch_ike_policy_identity_by_href_model.to_dict()
+ assert vpn_gateway_connection_ike_policy_patch_ike_policy_identity_by_href_model_json2 == vpn_gateway_connection_ike_policy_patch_ike_policy_identity_by_href_model_json
-class TestModel_PublicGatewayIdentityPublicGatewayIdentityByHref:
+class TestModel_VPNGatewayConnectionIKEPolicyPatchIKEPolicyIdentityById:
"""
- Test Class for PublicGatewayIdentityPublicGatewayIdentityByHref
+ Test Class for VPNGatewayConnectionIKEPolicyPatchIKEPolicyIdentityById
"""
- def test_public_gateway_identity_public_gateway_identity_by_href_serialization(self):
+ def test_vpn_gateway_connection_ike_policy_patch_ike_policy_identity_by_id_serialization(self):
"""
- Test serialization/deserialization for PublicGatewayIdentityPublicGatewayIdentityByHref
+ Test serialization/deserialization for VPNGatewayConnectionIKEPolicyPatchIKEPolicyIdentityById
"""
- # 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 json representation of a VPNGatewayConnectionIKEPolicyPatchIKEPolicyIdentityById model
+ vpn_gateway_connection_ike_policy_patch_ike_policy_identity_by_id_model_json = {}
+ vpn_gateway_connection_ike_policy_patch_ike_policy_identity_by_id_model_json['id'] = 'ddf51bec-3424-11e8-b467-0ed5f89f718b'
- # 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 VPNGatewayConnectionIKEPolicyPatchIKEPolicyIdentityById by calling from_dict on the json representation
+ vpn_gateway_connection_ike_policy_patch_ike_policy_identity_by_id_model = VPNGatewayConnectionIKEPolicyPatchIKEPolicyIdentityById.from_dict(vpn_gateway_connection_ike_policy_patch_ike_policy_identity_by_id_model_json)
+ assert vpn_gateway_connection_ike_policy_patch_ike_policy_identity_by_id_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_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)
+ # Construct a model instance of VPNGatewayConnectionIKEPolicyPatchIKEPolicyIdentityById by calling from_dict on the json representation
+ vpn_gateway_connection_ike_policy_patch_ike_policy_identity_by_id_model_dict = VPNGatewayConnectionIKEPolicyPatchIKEPolicyIdentityById.from_dict(vpn_gateway_connection_ike_policy_patch_ike_policy_identity_by_id_model_json).__dict__
+ vpn_gateway_connection_ike_policy_patch_ike_policy_identity_by_id_model2 = VPNGatewayConnectionIKEPolicyPatchIKEPolicyIdentityById(**vpn_gateway_connection_ike_policy_patch_ike_policy_identity_by_id_model_dict)
# Verify the model instances are equivalent
- assert public_gateway_identity_public_gateway_identity_by_href_model == public_gateway_identity_public_gateway_identity_by_href_model2
+ assert vpn_gateway_connection_ike_policy_patch_ike_policy_identity_by_id_model == vpn_gateway_connection_ike_policy_patch_ike_policy_identity_by_id_model2
# Convert model instance back to dict and verify no loss of data
- 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
+ vpn_gateway_connection_ike_policy_patch_ike_policy_identity_by_id_model_json2 = vpn_gateway_connection_ike_policy_patch_ike_policy_identity_by_id_model.to_dict()
+ assert vpn_gateway_connection_ike_policy_patch_ike_policy_identity_by_id_model_json2 == vpn_gateway_connection_ike_policy_patch_ike_policy_identity_by_id_model_json
-class TestModel_PublicGatewayIdentityPublicGatewayIdentityById:
+class TestModel_VPNGatewayConnectionIKEPolicyPrototypeIKEPolicyIdentityByHref:
"""
- Test Class for PublicGatewayIdentityPublicGatewayIdentityById
+ Test Class for VPNGatewayConnectionIKEPolicyPrototypeIKEPolicyIdentityByHref
"""
- def test_public_gateway_identity_public_gateway_identity_by_id_serialization(self):
+ def test_vpn_gateway_connection_ike_policy_prototype_ike_policy_identity_by_href_serialization(self):
"""
- Test serialization/deserialization for PublicGatewayIdentityPublicGatewayIdentityById
+ Test serialization/deserialization for VPNGatewayConnectionIKEPolicyPrototypeIKEPolicyIdentityByHref
"""
- # 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 json representation of a VPNGatewayConnectionIKEPolicyPrototypeIKEPolicyIdentityByHref model
+ vpn_gateway_connection_ike_policy_prototype_ike_policy_identity_by_href_model_json = {}
+ vpn_gateway_connection_ike_policy_prototype_ike_policy_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b'
- # 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 VPNGatewayConnectionIKEPolicyPrototypeIKEPolicyIdentityByHref by calling from_dict on the json representation
+ vpn_gateway_connection_ike_policy_prototype_ike_policy_identity_by_href_model = VPNGatewayConnectionIKEPolicyPrototypeIKEPolicyIdentityByHref.from_dict(vpn_gateway_connection_ike_policy_prototype_ike_policy_identity_by_href_model_json)
+ assert vpn_gateway_connection_ike_policy_prototype_ike_policy_identity_by_href_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_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)
+ # Construct a model instance of VPNGatewayConnectionIKEPolicyPrototypeIKEPolicyIdentityByHref by calling from_dict on the json representation
+ vpn_gateway_connection_ike_policy_prototype_ike_policy_identity_by_href_model_dict = VPNGatewayConnectionIKEPolicyPrototypeIKEPolicyIdentityByHref.from_dict(vpn_gateway_connection_ike_policy_prototype_ike_policy_identity_by_href_model_json).__dict__
+ vpn_gateway_connection_ike_policy_prototype_ike_policy_identity_by_href_model2 = VPNGatewayConnectionIKEPolicyPrototypeIKEPolicyIdentityByHref(**vpn_gateway_connection_ike_policy_prototype_ike_policy_identity_by_href_model_dict)
# Verify the model instances are equivalent
- assert public_gateway_identity_public_gateway_identity_by_id_model == public_gateway_identity_public_gateway_identity_by_id_model2
+ assert vpn_gateway_connection_ike_policy_prototype_ike_policy_identity_by_href_model == vpn_gateway_connection_ike_policy_prototype_ike_policy_identity_by_href_model2
# Convert model instance back to dict and verify no loss of data
- 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
+ vpn_gateway_connection_ike_policy_prototype_ike_policy_identity_by_href_model_json2 = vpn_gateway_connection_ike_policy_prototype_ike_policy_identity_by_href_model.to_dict()
+ assert vpn_gateway_connection_ike_policy_prototype_ike_policy_identity_by_href_model_json2 == vpn_gateway_connection_ike_policy_prototype_ike_policy_identity_by_href_model_json
-class TestModel_RegionIdentityByHref:
+class TestModel_VPNGatewayConnectionIKEPolicyPrototypeIKEPolicyIdentityById:
"""
- Test Class for RegionIdentityByHref
+ Test Class for VPNGatewayConnectionIKEPolicyPrototypeIKEPolicyIdentityById
"""
- def test_region_identity_by_href_serialization(self):
+ def test_vpn_gateway_connection_ike_policy_prototype_ike_policy_identity_by_id_serialization(self):
"""
- Test serialization/deserialization for RegionIdentityByHref
+ Test serialization/deserialization for VPNGatewayConnectionIKEPolicyPrototypeIKEPolicyIdentityById
"""
- # Construct a json representation of a RegionIdentityByHref model
- region_identity_by_href_model_json = {}
- region_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south'
+ # Construct a json representation of a VPNGatewayConnectionIKEPolicyPrototypeIKEPolicyIdentityById model
+ vpn_gateway_connection_ike_policy_prototype_ike_policy_identity_by_id_model_json = {}
+ vpn_gateway_connection_ike_policy_prototype_ike_policy_identity_by_id_model_json['id'] = 'ddf51bec-3424-11e8-b467-0ed5f89f718b'
- # Construct a model instance of RegionIdentityByHref by calling from_dict on the json representation
- region_identity_by_href_model = RegionIdentityByHref.from_dict(region_identity_by_href_model_json)
- assert region_identity_by_href_model != False
+ # Construct a model instance of VPNGatewayConnectionIKEPolicyPrototypeIKEPolicyIdentityById by calling from_dict on the json representation
+ vpn_gateway_connection_ike_policy_prototype_ike_policy_identity_by_id_model = VPNGatewayConnectionIKEPolicyPrototypeIKEPolicyIdentityById.from_dict(vpn_gateway_connection_ike_policy_prototype_ike_policy_identity_by_id_model_json)
+ assert vpn_gateway_connection_ike_policy_prototype_ike_policy_identity_by_id_model != False
- # Construct a model instance of RegionIdentityByHref by calling from_dict on the json representation
- region_identity_by_href_model_dict = RegionIdentityByHref.from_dict(region_identity_by_href_model_json).__dict__
- region_identity_by_href_model2 = RegionIdentityByHref(**region_identity_by_href_model_dict)
+ # Construct a model instance of VPNGatewayConnectionIKEPolicyPrototypeIKEPolicyIdentityById by calling from_dict on the json representation
+ vpn_gateway_connection_ike_policy_prototype_ike_policy_identity_by_id_model_dict = VPNGatewayConnectionIKEPolicyPrototypeIKEPolicyIdentityById.from_dict(vpn_gateway_connection_ike_policy_prototype_ike_policy_identity_by_id_model_json).__dict__
+ vpn_gateway_connection_ike_policy_prototype_ike_policy_identity_by_id_model2 = VPNGatewayConnectionIKEPolicyPrototypeIKEPolicyIdentityById(**vpn_gateway_connection_ike_policy_prototype_ike_policy_identity_by_id_model_dict)
# Verify the model instances are equivalent
- assert region_identity_by_href_model == region_identity_by_href_model2
+ assert vpn_gateway_connection_ike_policy_prototype_ike_policy_identity_by_id_model == vpn_gateway_connection_ike_policy_prototype_ike_policy_identity_by_id_model2
# Convert model instance back to dict and verify no loss of data
- region_identity_by_href_model_json2 = region_identity_by_href_model.to_dict()
- assert region_identity_by_href_model_json2 == region_identity_by_href_model_json
+ vpn_gateway_connection_ike_policy_prototype_ike_policy_identity_by_id_model_json2 = vpn_gateway_connection_ike_policy_prototype_ike_policy_identity_by_id_model.to_dict()
+ assert vpn_gateway_connection_ike_policy_prototype_ike_policy_identity_by_id_model_json2 == vpn_gateway_connection_ike_policy_prototype_ike_policy_identity_by_id_model_json
-class TestModel_RegionIdentityByName:
+class TestModel_VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByHref:
"""
- Test Class for RegionIdentityByName
+ Test Class for VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByHref
"""
- def test_region_identity_by_name_serialization(self):
+ def test_vpn_gateway_connection_i_psec_policy_patch_i_psec_policy_identity_by_href_serialization(self):
"""
- Test serialization/deserialization for RegionIdentityByName
+ Test serialization/deserialization for VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByHref
"""
- # Construct a json representation of a RegionIdentityByName model
- region_identity_by_name_model_json = {}
- region_identity_by_name_model_json['name'] = 'us-south'
+ # Construct a json representation of a VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByHref model
+ vpn_gateway_connection_i_psec_policy_patch_i_psec_policy_identity_by_href_model_json = {}
+ vpn_gateway_connection_i_psec_policy_patch_i_psec_policy_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b'
- # Construct a model instance of RegionIdentityByName by calling from_dict on the json representation
- region_identity_by_name_model = RegionIdentityByName.from_dict(region_identity_by_name_model_json)
- assert region_identity_by_name_model != False
+ # Construct a model instance of VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByHref by calling from_dict on the json representation
+ vpn_gateway_connection_i_psec_policy_patch_i_psec_policy_identity_by_href_model = VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByHref.from_dict(vpn_gateway_connection_i_psec_policy_patch_i_psec_policy_identity_by_href_model_json)
+ assert vpn_gateway_connection_i_psec_policy_patch_i_psec_policy_identity_by_href_model != False
- # Construct a model instance of RegionIdentityByName by calling from_dict on the json representation
- region_identity_by_name_model_dict = RegionIdentityByName.from_dict(region_identity_by_name_model_json).__dict__
- region_identity_by_name_model2 = RegionIdentityByName(**region_identity_by_name_model_dict)
+ # Construct a model instance of VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByHref by calling from_dict on the json representation
+ vpn_gateway_connection_i_psec_policy_patch_i_psec_policy_identity_by_href_model_dict = VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByHref.from_dict(vpn_gateway_connection_i_psec_policy_patch_i_psec_policy_identity_by_href_model_json).__dict__
+ vpn_gateway_connection_i_psec_policy_patch_i_psec_policy_identity_by_href_model2 = VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByHref(**vpn_gateway_connection_i_psec_policy_patch_i_psec_policy_identity_by_href_model_dict)
# Verify the model instances are equivalent
- assert region_identity_by_name_model == region_identity_by_name_model2
+ assert vpn_gateway_connection_i_psec_policy_patch_i_psec_policy_identity_by_href_model == vpn_gateway_connection_i_psec_policy_patch_i_psec_policy_identity_by_href_model2
# Convert model instance back to dict and verify no loss of data
- region_identity_by_name_model_json2 = region_identity_by_name_model.to_dict()
- assert region_identity_by_name_model_json2 == region_identity_by_name_model_json
+ vpn_gateway_connection_i_psec_policy_patch_i_psec_policy_identity_by_href_model_json2 = vpn_gateway_connection_i_psec_policy_patch_i_psec_policy_identity_by_href_model.to_dict()
+ assert vpn_gateway_connection_i_psec_policy_patch_i_psec_policy_identity_by_href_model_json2 == vpn_gateway_connection_i_psec_policy_patch_i_psec_policy_identity_by_href_model_json
-class TestModel_ReservedIPTargetBareMetalServerNetworkInterfaceReferenceTargetContext:
+class TestModel_VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityById:
"""
- Test Class for ReservedIPTargetBareMetalServerNetworkInterfaceReferenceTargetContext
+ Test Class for VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityById
"""
- def test_reserved_ip_target_bare_metal_server_network_interface_reference_target_context_serialization(self):
+ def test_vpn_gateway_connection_i_psec_policy_patch_i_psec_policy_identity_by_id_serialization(self):
"""
- Test serialization/deserialization for ReservedIPTargetBareMetalServerNetworkInterfaceReferenceTargetContext
+ Test serialization/deserialization for VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityById
"""
- # Construct dict forms of any model objects needed in order to build this model.
-
- bare_metal_server_network_interface_reference_target_context_deleted_model = {} # BareMetalServerNetworkInterfaceReferenceTargetContextDeleted
- bare_metal_server_network_interface_reference_target_context_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
-
- # Construct a json representation of a ReservedIPTargetBareMetalServerNetworkInterfaceReferenceTargetContext model
- reserved_ip_target_bare_metal_server_network_interface_reference_target_context_model_json = {}
- reserved_ip_target_bare_metal_server_network_interface_reference_target_context_model_json['deleted'] = bare_metal_server_network_interface_reference_target_context_deleted_model
- reserved_ip_target_bare_metal_server_network_interface_reference_target_context_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e'
- reserved_ip_target_bare_metal_server_network_interface_reference_target_context_model_json['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e'
- reserved_ip_target_bare_metal_server_network_interface_reference_target_context_model_json['name'] = 'my-bare-metal-server-network-interface'
- reserved_ip_target_bare_metal_server_network_interface_reference_target_context_model_json['resource_type'] = 'network_interface'
+ # Construct a json representation of a VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityById model
+ vpn_gateway_connection_i_psec_policy_patch_i_psec_policy_identity_by_id_model_json = {}
+ vpn_gateway_connection_i_psec_policy_patch_i_psec_policy_identity_by_id_model_json['id'] = 'ddf51bec-3424-11e8-b467-0ed5f89f718b'
- # Construct a model instance of ReservedIPTargetBareMetalServerNetworkInterfaceReferenceTargetContext by calling from_dict on the json representation
- reserved_ip_target_bare_metal_server_network_interface_reference_target_context_model = ReservedIPTargetBareMetalServerNetworkInterfaceReferenceTargetContext.from_dict(reserved_ip_target_bare_metal_server_network_interface_reference_target_context_model_json)
- assert reserved_ip_target_bare_metal_server_network_interface_reference_target_context_model != False
+ # Construct a model instance of VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityById by calling from_dict on the json representation
+ vpn_gateway_connection_i_psec_policy_patch_i_psec_policy_identity_by_id_model = VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityById.from_dict(vpn_gateway_connection_i_psec_policy_patch_i_psec_policy_identity_by_id_model_json)
+ assert vpn_gateway_connection_i_psec_policy_patch_i_psec_policy_identity_by_id_model != False
- # Construct a model instance of ReservedIPTargetBareMetalServerNetworkInterfaceReferenceTargetContext by calling from_dict on the json representation
- reserved_ip_target_bare_metal_server_network_interface_reference_target_context_model_dict = ReservedIPTargetBareMetalServerNetworkInterfaceReferenceTargetContext.from_dict(reserved_ip_target_bare_metal_server_network_interface_reference_target_context_model_json).__dict__
- reserved_ip_target_bare_metal_server_network_interface_reference_target_context_model2 = ReservedIPTargetBareMetalServerNetworkInterfaceReferenceTargetContext(**reserved_ip_target_bare_metal_server_network_interface_reference_target_context_model_dict)
+ # Construct a model instance of VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityById by calling from_dict on the json representation
+ vpn_gateway_connection_i_psec_policy_patch_i_psec_policy_identity_by_id_model_dict = VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityById.from_dict(vpn_gateway_connection_i_psec_policy_patch_i_psec_policy_identity_by_id_model_json).__dict__
+ vpn_gateway_connection_i_psec_policy_patch_i_psec_policy_identity_by_id_model2 = VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityById(**vpn_gateway_connection_i_psec_policy_patch_i_psec_policy_identity_by_id_model_dict)
# Verify the model instances are equivalent
- assert reserved_ip_target_bare_metal_server_network_interface_reference_target_context_model == reserved_ip_target_bare_metal_server_network_interface_reference_target_context_model2
+ assert vpn_gateway_connection_i_psec_policy_patch_i_psec_policy_identity_by_id_model == vpn_gateway_connection_i_psec_policy_patch_i_psec_policy_identity_by_id_model2
# Convert model instance back to dict and verify no loss of data
- reserved_ip_target_bare_metal_server_network_interface_reference_target_context_model_json2 = reserved_ip_target_bare_metal_server_network_interface_reference_target_context_model.to_dict()
- assert reserved_ip_target_bare_metal_server_network_interface_reference_target_context_model_json2 == reserved_ip_target_bare_metal_server_network_interface_reference_target_context_model_json
+ vpn_gateway_connection_i_psec_policy_patch_i_psec_policy_identity_by_id_model_json2 = vpn_gateway_connection_i_psec_policy_patch_i_psec_policy_identity_by_id_model.to_dict()
+ assert vpn_gateway_connection_i_psec_policy_patch_i_psec_policy_identity_by_id_model_json2 == vpn_gateway_connection_i_psec_policy_patch_i_psec_policy_identity_by_id_model_json
-class TestModel_ReservedIPTargetEndpointGatewayReference:
+class TestModel_VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByHref:
"""
- Test Class for ReservedIPTargetEndpointGatewayReference
+ Test Class for VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByHref
"""
- def test_reserved_ip_target_endpoint_gateway_reference_serialization(self):
+ def test_vpn_gateway_connection_i_psec_policy_prototype_i_psec_policy_identity_by_href_serialization(self):
"""
- Test serialization/deserialization for ReservedIPTargetEndpointGatewayReference
+ Test serialization/deserialization for VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByHref
"""
- # 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 ReservedIPTargetEndpointGatewayReference model
- reserved_ip_target_endpoint_gateway_reference_model_json = {}
- reserved_ip_target_endpoint_gateway_reference_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5'
- reserved_ip_target_endpoint_gateway_reference_model_json['deleted'] = endpoint_gateway_reference_deleted_model
- reserved_ip_target_endpoint_gateway_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5'
- reserved_ip_target_endpoint_gateway_reference_model_json['id'] = 'r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5'
- reserved_ip_target_endpoint_gateway_reference_model_json['name'] = 'my-endpoint-gateway'
- reserved_ip_target_endpoint_gateway_reference_model_json['resource_type'] = 'endpoint_gateway'
+ # Construct a json representation of a VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByHref model
+ vpn_gateway_connection_i_psec_policy_prototype_i_psec_policy_identity_by_href_model_json = {}
+ vpn_gateway_connection_i_psec_policy_prototype_i_psec_policy_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b'
- # Construct a model instance of ReservedIPTargetEndpointGatewayReference by calling from_dict on the json representation
- reserved_ip_target_endpoint_gateway_reference_model = ReservedIPTargetEndpointGatewayReference.from_dict(reserved_ip_target_endpoint_gateway_reference_model_json)
- assert reserved_ip_target_endpoint_gateway_reference_model != False
+ # Construct a model instance of VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByHref by calling from_dict on the json representation
+ vpn_gateway_connection_i_psec_policy_prototype_i_psec_policy_identity_by_href_model = VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByHref.from_dict(vpn_gateway_connection_i_psec_policy_prototype_i_psec_policy_identity_by_href_model_json)
+ assert vpn_gateway_connection_i_psec_policy_prototype_i_psec_policy_identity_by_href_model != False
- # Construct a model instance of ReservedIPTargetEndpointGatewayReference by calling from_dict on the json representation
- reserved_ip_target_endpoint_gateway_reference_model_dict = ReservedIPTargetEndpointGatewayReference.from_dict(reserved_ip_target_endpoint_gateway_reference_model_json).__dict__
- reserved_ip_target_endpoint_gateway_reference_model2 = ReservedIPTargetEndpointGatewayReference(**reserved_ip_target_endpoint_gateway_reference_model_dict)
+ # Construct a model instance of VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByHref by calling from_dict on the json representation
+ vpn_gateway_connection_i_psec_policy_prototype_i_psec_policy_identity_by_href_model_dict = VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByHref.from_dict(vpn_gateway_connection_i_psec_policy_prototype_i_psec_policy_identity_by_href_model_json).__dict__
+ vpn_gateway_connection_i_psec_policy_prototype_i_psec_policy_identity_by_href_model2 = VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByHref(**vpn_gateway_connection_i_psec_policy_prototype_i_psec_policy_identity_by_href_model_dict)
# Verify the model instances are equivalent
- assert reserved_ip_target_endpoint_gateway_reference_model == reserved_ip_target_endpoint_gateway_reference_model2
+ assert vpn_gateway_connection_i_psec_policy_prototype_i_psec_policy_identity_by_href_model == vpn_gateway_connection_i_psec_policy_prototype_i_psec_policy_identity_by_href_model2
# Convert model instance back to dict and verify no loss of data
- reserved_ip_target_endpoint_gateway_reference_model_json2 = reserved_ip_target_endpoint_gateway_reference_model.to_dict()
- assert reserved_ip_target_endpoint_gateway_reference_model_json2 == reserved_ip_target_endpoint_gateway_reference_model_json
+ vpn_gateway_connection_i_psec_policy_prototype_i_psec_policy_identity_by_href_model_json2 = vpn_gateway_connection_i_psec_policy_prototype_i_psec_policy_identity_by_href_model.to_dict()
+ assert vpn_gateway_connection_i_psec_policy_prototype_i_psec_policy_identity_by_href_model_json2 == vpn_gateway_connection_i_psec_policy_prototype_i_psec_policy_identity_by_href_model_json
-class TestModel_ReservedIPTargetGenericResourceReference:
+class TestModel_VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityById:
"""
- Test Class for ReservedIPTargetGenericResourceReference
+ Test Class for VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityById
"""
- def test_reserved_ip_target_generic_resource_reference_serialization(self):
+ def test_vpn_gateway_connection_i_psec_policy_prototype_i_psec_policy_identity_by_id_serialization(self):
"""
- Test serialization/deserialization for ReservedIPTargetGenericResourceReference
+ Test serialization/deserialization for VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityById
"""
- # Construct dict forms of any model objects needed in order to build this model.
-
- generic_resource_reference_deleted_model = {} # GenericResourceReferenceDeleted
- generic_resource_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
-
- # Construct a json representation of a ReservedIPTargetGenericResourceReference model
- reserved_ip_target_generic_resource_reference_model_json = {}
- reserved_ip_target_generic_resource_reference_model_json['crn'] = 'crn:v1:bluemix:public:containers-kubernetes:us-south:a/123456:9qtrw1peys2spdfs7agb::'
- reserved_ip_target_generic_resource_reference_model_json['deleted'] = generic_resource_reference_deleted_model
- reserved_ip_target_generic_resource_reference_model_json['resource_type'] = 'cloud_resource'
+ # Construct a json representation of a VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityById model
+ vpn_gateway_connection_i_psec_policy_prototype_i_psec_policy_identity_by_id_model_json = {}
+ vpn_gateway_connection_i_psec_policy_prototype_i_psec_policy_identity_by_id_model_json['id'] = 'ddf51bec-3424-11e8-b467-0ed5f89f718b'
- # Construct a model instance of ReservedIPTargetGenericResourceReference by calling from_dict on the json representation
- reserved_ip_target_generic_resource_reference_model = ReservedIPTargetGenericResourceReference.from_dict(reserved_ip_target_generic_resource_reference_model_json)
- assert reserved_ip_target_generic_resource_reference_model != False
+ # Construct a model instance of VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityById by calling from_dict on the json representation
+ vpn_gateway_connection_i_psec_policy_prototype_i_psec_policy_identity_by_id_model = VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityById.from_dict(vpn_gateway_connection_i_psec_policy_prototype_i_psec_policy_identity_by_id_model_json)
+ assert vpn_gateway_connection_i_psec_policy_prototype_i_psec_policy_identity_by_id_model != False
- # Construct a model instance of ReservedIPTargetGenericResourceReference by calling from_dict on the json representation
- reserved_ip_target_generic_resource_reference_model_dict = ReservedIPTargetGenericResourceReference.from_dict(reserved_ip_target_generic_resource_reference_model_json).__dict__
- reserved_ip_target_generic_resource_reference_model2 = ReservedIPTargetGenericResourceReference(**reserved_ip_target_generic_resource_reference_model_dict)
+ # Construct a model instance of VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityById by calling from_dict on the json representation
+ vpn_gateway_connection_i_psec_policy_prototype_i_psec_policy_identity_by_id_model_dict = VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityById.from_dict(vpn_gateway_connection_i_psec_policy_prototype_i_psec_policy_identity_by_id_model_json).__dict__
+ vpn_gateway_connection_i_psec_policy_prototype_i_psec_policy_identity_by_id_model2 = VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityById(**vpn_gateway_connection_i_psec_policy_prototype_i_psec_policy_identity_by_id_model_dict)
# Verify the model instances are equivalent
- assert reserved_ip_target_generic_resource_reference_model == reserved_ip_target_generic_resource_reference_model2
+ assert vpn_gateway_connection_i_psec_policy_prototype_i_psec_policy_identity_by_id_model == vpn_gateway_connection_i_psec_policy_prototype_i_psec_policy_identity_by_id_model2
# Convert model instance back to dict and verify no loss of data
- reserved_ip_target_generic_resource_reference_model_json2 = reserved_ip_target_generic_resource_reference_model.to_dict()
- assert reserved_ip_target_generic_resource_reference_model_json2 == reserved_ip_target_generic_resource_reference_model_json
+ vpn_gateway_connection_i_psec_policy_prototype_i_psec_policy_identity_by_id_model_json2 = vpn_gateway_connection_i_psec_policy_prototype_i_psec_policy_identity_by_id_model.to_dict()
+ assert vpn_gateway_connection_i_psec_policy_prototype_i_psec_policy_identity_by_id_model_json2 == vpn_gateway_connection_i_psec_policy_prototype_i_psec_policy_identity_by_id_model_json
-class TestModel_ReservedIPTargetLoadBalancerReference:
+class TestModel_VPNGatewayConnectionPolicyMode:
"""
- Test Class for ReservedIPTargetLoadBalancerReference
+ Test Class for VPNGatewayConnectionPolicyMode
"""
- def test_reserved_ip_target_load_balancer_reference_serialization(self):
+ def test_vpn_gateway_connection_policy_mode_serialization(self):
"""
- Test serialization/deserialization for ReservedIPTargetLoadBalancerReference
+ Test serialization/deserialization for VPNGatewayConnectionPolicyMode
"""
# Construct dict forms of any model objects needed in order to build this model.
- load_balancer_reference_deleted_model = {} # LoadBalancerReferenceDeleted
- load_balancer_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ 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
- # Construct a json representation of a ReservedIPTargetLoadBalancerReference model
- reserved_ip_target_load_balancer_reference_model_json = {}
- reserved_ip_target_load_balancer_reference_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727'
- reserved_ip_target_load_balancer_reference_model_json['deleted'] = load_balancer_reference_deleted_model
- reserved_ip_target_load_balancer_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727'
- reserved_ip_target_load_balancer_reference_model_json['id'] = 'dd754295-e9e0-4c9d-bf6c-58fbc59e5727'
- reserved_ip_target_load_balancer_reference_model_json['name'] = 'my-load-balancer'
- reserved_ip_target_load_balancer_reference_model_json['resource_type'] = 'load_balancer'
+ 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 ReservedIPTargetLoadBalancerReference by calling from_dict on the json representation
- reserved_ip_target_load_balancer_reference_model = ReservedIPTargetLoadBalancerReference.from_dict(reserved_ip_target_load_balancer_reference_model_json)
- assert reserved_ip_target_load_balancer_reference_model != False
+ 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'
- # Construct a model instance of ReservedIPTargetLoadBalancerReference by calling from_dict on the json representation
- reserved_ip_target_load_balancer_reference_model_dict = ReservedIPTargetLoadBalancerReference.from_dict(reserved_ip_target_load_balancer_reference_model_json).__dict__
- reserved_ip_target_load_balancer_reference_model2 = ReservedIPTargetLoadBalancerReference(**reserved_ip_target_load_balancer_reference_model_dict)
+ 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'
+
+ vpn_gateway_connection_status_reason_model = {} # VPNGatewayConnectionStatusReason
+ vpn_gateway_connection_status_reason_model['code'] = 'cannot_authenticate_connection'
+ vpn_gateway_connection_status_reason_model['message'] = 'Failed to authenticate a connection because of mismatched IKE ID and PSK.'
+ vpn_gateway_connection_status_reason_model['more_info'] = 'https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health'
+
+ # Construct a json representation of a VPNGatewayConnectionPolicyMode model
+ vpn_gateway_connection_policy_mode_model_json = {}
+ vpn_gateway_connection_policy_mode_model_json['admin_state_up'] = True
+ vpn_gateway_connection_policy_mode_model_json['authentication_mode'] = 'psk'
+ vpn_gateway_connection_policy_mode_model_json['created_at'] = '2019-01-01T12:00:00Z'
+ vpn_gateway_connection_policy_mode_model_json['dead_peer_detection'] = vpn_gateway_connection_dpd_model
+ vpn_gateway_connection_policy_mode_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_policy_mode_model_json['id'] = 'a10a5771-dc23-442c-8460-c3601d8542f7'
+ vpn_gateway_connection_policy_mode_model_json['ike_policy'] = ike_policy_reference_model
+ vpn_gateway_connection_policy_mode_model_json['ipsec_policy'] = i_psec_policy_reference_model
+ vpn_gateway_connection_policy_mode_model_json['mode'] = 'route'
+ vpn_gateway_connection_policy_mode_model_json['name'] = 'my-vpn-connection'
+ vpn_gateway_connection_policy_mode_model_json['peer_address'] = '169.21.50.5'
+ vpn_gateway_connection_policy_mode_model_json['psk'] = 'lkj14b1oi0alcniejkso'
+ vpn_gateway_connection_policy_mode_model_json['resource_type'] = 'vpn_gateway_connection'
+ vpn_gateway_connection_policy_mode_model_json['status'] = 'down'
+ vpn_gateway_connection_policy_mode_model_json['status_reasons'] = [vpn_gateway_connection_status_reason_model]
+ vpn_gateway_connection_policy_mode_model_json['local_cidrs'] = ['192.168.1.0/24']
+ vpn_gateway_connection_policy_mode_model_json['peer_cidrs'] = ['10.45.1.0/24']
+
+ # Construct a model instance of VPNGatewayConnectionPolicyMode by calling from_dict on the json representation
+ vpn_gateway_connection_policy_mode_model = VPNGatewayConnectionPolicyMode.from_dict(vpn_gateway_connection_policy_mode_model_json)
+ assert vpn_gateway_connection_policy_mode_model != False
+
+ # Construct a model instance of VPNGatewayConnectionPolicyMode by calling from_dict on the json representation
+ vpn_gateway_connection_policy_mode_model_dict = VPNGatewayConnectionPolicyMode.from_dict(vpn_gateway_connection_policy_mode_model_json).__dict__
+ vpn_gateway_connection_policy_mode_model2 = VPNGatewayConnectionPolicyMode(**vpn_gateway_connection_policy_mode_model_dict)
# Verify the model instances are equivalent
- assert reserved_ip_target_load_balancer_reference_model == reserved_ip_target_load_balancer_reference_model2
+ assert vpn_gateway_connection_policy_mode_model == vpn_gateway_connection_policy_mode_model2
# Convert model instance back to dict and verify no loss of data
- reserved_ip_target_load_balancer_reference_model_json2 = reserved_ip_target_load_balancer_reference_model.to_dict()
- assert reserved_ip_target_load_balancer_reference_model_json2 == reserved_ip_target_load_balancer_reference_model_json
+ vpn_gateway_connection_policy_mode_model_json2 = vpn_gateway_connection_policy_mode_model.to_dict()
+ assert vpn_gateway_connection_policy_mode_model_json2 == vpn_gateway_connection_policy_mode_model_json
-class TestModel_ReservedIPTargetNetworkInterfaceReferenceTargetContext:
+class TestModel_VPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype:
"""
- Test Class for ReservedIPTargetNetworkInterfaceReferenceTargetContext
+ Test Class for VPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype
"""
- def test_reserved_ip_target_network_interface_reference_target_context_serialization(self):
+ def test_vpn_gateway_connection_prototype_vpn_gateway_connection_policy_mode_prototype_serialization(self):
"""
- Test serialization/deserialization for ReservedIPTargetNetworkInterfaceReferenceTargetContext
+ Test serialization/deserialization for VPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype
"""
# Construct dict forms of any model objects needed in order to build this model.
- network_interface_reference_target_context_deleted_model = {} # NetworkInterfaceReferenceTargetContextDeleted
- network_interface_reference_target_context_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ vpn_gateway_connection_dpd_prototype_model = {} # VPNGatewayConnectionDPDPrototype
+ 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 json representation of a ReservedIPTargetNetworkInterfaceReferenceTargetContext model
- reserved_ip_target_network_interface_reference_target_context_model_json = {}
- reserved_ip_target_network_interface_reference_target_context_model_json['deleted'] = network_interface_reference_target_context_deleted_model
- reserved_ip_target_network_interface_reference_target_context_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e'
- reserved_ip_target_network_interface_reference_target_context_model_json['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e'
- reserved_ip_target_network_interface_reference_target_context_model_json['name'] = 'my-instance-network-interface'
- reserved_ip_target_network_interface_reference_target_context_model_json['resource_type'] = 'network_interface'
+ vpn_gateway_connection_ike_policy_prototype_model = {} # VPNGatewayConnectionIKEPolicyPrototypeIKEPolicyIdentityById
+ vpn_gateway_connection_ike_policy_prototype_model['id'] = 'ddf51bec-3424-11e8-b467-0ed5f89f718b'
- # Construct a model instance of ReservedIPTargetNetworkInterfaceReferenceTargetContext by calling from_dict on the json representation
- reserved_ip_target_network_interface_reference_target_context_model = ReservedIPTargetNetworkInterfaceReferenceTargetContext.from_dict(reserved_ip_target_network_interface_reference_target_context_model_json)
- assert reserved_ip_target_network_interface_reference_target_context_model != False
+ vpn_gateway_connection_i_psec_policy_prototype_model = {} # VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityById
+ vpn_gateway_connection_i_psec_policy_prototype_model['id'] = 'ddf51bec-3424-11e8-b467-0ed5f89f718b'
- # Construct a model instance of ReservedIPTargetNetworkInterfaceReferenceTargetContext by calling from_dict on the json representation
- reserved_ip_target_network_interface_reference_target_context_model_dict = ReservedIPTargetNetworkInterfaceReferenceTargetContext.from_dict(reserved_ip_target_network_interface_reference_target_context_model_json).__dict__
- reserved_ip_target_network_interface_reference_target_context_model2 = ReservedIPTargetNetworkInterfaceReferenceTargetContext(**reserved_ip_target_network_interface_reference_target_context_model_dict)
+ # Construct a json representation of a VPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype model
+ vpn_gateway_connection_prototype_vpn_gateway_connection_policy_mode_prototype_model_json = {}
+ vpn_gateway_connection_prototype_vpn_gateway_connection_policy_mode_prototype_model_json['admin_state_up'] = True
+ vpn_gateway_connection_prototype_vpn_gateway_connection_policy_mode_prototype_model_json['dead_peer_detection'] = vpn_gateway_connection_dpd_prototype_model
+ vpn_gateway_connection_prototype_vpn_gateway_connection_policy_mode_prototype_model_json['ike_policy'] = vpn_gateway_connection_ike_policy_prototype_model
+ vpn_gateway_connection_prototype_vpn_gateway_connection_policy_mode_prototype_model_json['ipsec_policy'] = vpn_gateway_connection_i_psec_policy_prototype_model
+ vpn_gateway_connection_prototype_vpn_gateway_connection_policy_mode_prototype_model_json['name'] = 'my-vpn-connection'
+ vpn_gateway_connection_prototype_vpn_gateway_connection_policy_mode_prototype_model_json['peer_address'] = '169.21.50.5'
+ vpn_gateway_connection_prototype_vpn_gateway_connection_policy_mode_prototype_model_json['psk'] = 'lkj14b1oi0alcniejkso'
+ vpn_gateway_connection_prototype_vpn_gateway_connection_policy_mode_prototype_model_json['local_cidrs'] = ['192.168.1.0/24']
+ vpn_gateway_connection_prototype_vpn_gateway_connection_policy_mode_prototype_model_json['peer_cidrs'] = ['10.45.1.0/24']
+
+ # Construct a model instance of VPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype by calling from_dict on the json representation
+ vpn_gateway_connection_prototype_vpn_gateway_connection_policy_mode_prototype_model = VPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype.from_dict(vpn_gateway_connection_prototype_vpn_gateway_connection_policy_mode_prototype_model_json)
+ assert vpn_gateway_connection_prototype_vpn_gateway_connection_policy_mode_prototype_model != False
+
+ # Construct a model instance of VPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype by calling from_dict on the json representation
+ vpn_gateway_connection_prototype_vpn_gateway_connection_policy_mode_prototype_model_dict = VPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype.from_dict(vpn_gateway_connection_prototype_vpn_gateway_connection_policy_mode_prototype_model_json).__dict__
+ vpn_gateway_connection_prototype_vpn_gateway_connection_policy_mode_prototype_model2 = VPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype(**vpn_gateway_connection_prototype_vpn_gateway_connection_policy_mode_prototype_model_dict)
# Verify the model instances are equivalent
- assert reserved_ip_target_network_interface_reference_target_context_model == reserved_ip_target_network_interface_reference_target_context_model2
+ assert vpn_gateway_connection_prototype_vpn_gateway_connection_policy_mode_prototype_model == vpn_gateway_connection_prototype_vpn_gateway_connection_policy_mode_prototype_model2
# Convert model instance back to dict and verify no loss of data
- reserved_ip_target_network_interface_reference_target_context_model_json2 = reserved_ip_target_network_interface_reference_target_context_model.to_dict()
- assert reserved_ip_target_network_interface_reference_target_context_model_json2 == reserved_ip_target_network_interface_reference_target_context_model_json
+ vpn_gateway_connection_prototype_vpn_gateway_connection_policy_mode_prototype_model_json2 = vpn_gateway_connection_prototype_vpn_gateway_connection_policy_mode_prototype_model.to_dict()
+ assert vpn_gateway_connection_prototype_vpn_gateway_connection_policy_mode_prototype_model_json2 == vpn_gateway_connection_prototype_vpn_gateway_connection_policy_mode_prototype_model_json
-class TestModel_ReservedIPTargetVPNGatewayReference:
+class TestModel_VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype:
"""
- Test Class for ReservedIPTargetVPNGatewayReference
+ Test Class for VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype
"""
- def test_reserved_ip_target_vpn_gateway_reference_serialization(self):
+ def test_vpn_gateway_connection_prototype_vpn_gateway_connection_static_route_mode_prototype_serialization(self):
"""
- Test serialization/deserialization for ReservedIPTargetVPNGatewayReference
+ Test serialization/deserialization for VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype
"""
# Construct dict forms of any model objects needed in order to build this model.
- vpn_gateway_reference_deleted_model = {} # VPNGatewayReferenceDeleted
- vpn_gateway_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ vpn_gateway_connection_dpd_prototype_model = {} # VPNGatewayConnectionDPDPrototype
+ 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 json representation of a ReservedIPTargetVPNGatewayReference model
- reserved_ip_target_vpn_gateway_reference_model_json = {}
- reserved_ip_target_vpn_gateway_reference_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b'
- reserved_ip_target_vpn_gateway_reference_model_json['deleted'] = vpn_gateway_reference_deleted_model
- reserved_ip_target_vpn_gateway_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b'
- reserved_ip_target_vpn_gateway_reference_model_json['id'] = 'ddf51bec-3424-11e8-b467-0ed5f89f718b'
- reserved_ip_target_vpn_gateway_reference_model_json['name'] = 'my-vpn-gateway'
- reserved_ip_target_vpn_gateway_reference_model_json['resource_type'] = 'vpn_gateway'
+ vpn_gateway_connection_ike_policy_prototype_model = {} # VPNGatewayConnectionIKEPolicyPrototypeIKEPolicyIdentityById
+ vpn_gateway_connection_ike_policy_prototype_model['id'] = 'ddf51bec-3424-11e8-b467-0ed5f89f718b'
- # Construct a model instance of ReservedIPTargetVPNGatewayReference by calling from_dict on the json representation
- reserved_ip_target_vpn_gateway_reference_model = ReservedIPTargetVPNGatewayReference.from_dict(reserved_ip_target_vpn_gateway_reference_model_json)
- assert reserved_ip_target_vpn_gateway_reference_model != False
+ vpn_gateway_connection_i_psec_policy_prototype_model = {} # VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityById
+ vpn_gateway_connection_i_psec_policy_prototype_model['id'] = 'ddf51bec-3424-11e8-b467-0ed5f89f718b'
- # Construct a model instance of ReservedIPTargetVPNGatewayReference by calling from_dict on the json representation
- reserved_ip_target_vpn_gateway_reference_model_dict = ReservedIPTargetVPNGatewayReference.from_dict(reserved_ip_target_vpn_gateway_reference_model_json).__dict__
- reserved_ip_target_vpn_gateway_reference_model2 = ReservedIPTargetVPNGatewayReference(**reserved_ip_target_vpn_gateway_reference_model_dict)
+ # Construct a json representation of a VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype model
+ vpn_gateway_connection_prototype_vpn_gateway_connection_static_route_mode_prototype_model_json = {}
+ vpn_gateway_connection_prototype_vpn_gateway_connection_static_route_mode_prototype_model_json['admin_state_up'] = True
+ vpn_gateway_connection_prototype_vpn_gateway_connection_static_route_mode_prototype_model_json['dead_peer_detection'] = vpn_gateway_connection_dpd_prototype_model
+ vpn_gateway_connection_prototype_vpn_gateway_connection_static_route_mode_prototype_model_json['ike_policy'] = vpn_gateway_connection_ike_policy_prototype_model
+ vpn_gateway_connection_prototype_vpn_gateway_connection_static_route_mode_prototype_model_json['ipsec_policy'] = vpn_gateway_connection_i_psec_policy_prototype_model
+ vpn_gateway_connection_prototype_vpn_gateway_connection_static_route_mode_prototype_model_json['name'] = 'my-vpn-connection'
+ vpn_gateway_connection_prototype_vpn_gateway_connection_static_route_mode_prototype_model_json['peer_address'] = '169.21.50.5'
+ vpn_gateway_connection_prototype_vpn_gateway_connection_static_route_mode_prototype_model_json['psk'] = 'lkj14b1oi0alcniejkso'
+ vpn_gateway_connection_prototype_vpn_gateway_connection_static_route_mode_prototype_model_json['routing_protocol'] = 'none'
+
+ # Construct a model instance of VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype by calling from_dict on the json representation
+ vpn_gateway_connection_prototype_vpn_gateway_connection_static_route_mode_prototype_model = VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype.from_dict(vpn_gateway_connection_prototype_vpn_gateway_connection_static_route_mode_prototype_model_json)
+ assert vpn_gateway_connection_prototype_vpn_gateway_connection_static_route_mode_prototype_model != False
+
+ # Construct a model instance of VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype by calling from_dict on the json representation
+ vpn_gateway_connection_prototype_vpn_gateway_connection_static_route_mode_prototype_model_dict = VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype.from_dict(vpn_gateway_connection_prototype_vpn_gateway_connection_static_route_mode_prototype_model_json).__dict__
+ vpn_gateway_connection_prototype_vpn_gateway_connection_static_route_mode_prototype_model2 = VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype(**vpn_gateway_connection_prototype_vpn_gateway_connection_static_route_mode_prototype_model_dict)
# Verify the model instances are equivalent
- assert reserved_ip_target_vpn_gateway_reference_model == reserved_ip_target_vpn_gateway_reference_model2
+ assert vpn_gateway_connection_prototype_vpn_gateway_connection_static_route_mode_prototype_model == vpn_gateway_connection_prototype_vpn_gateway_connection_static_route_mode_prototype_model2
# Convert model instance back to dict and verify no loss of data
- reserved_ip_target_vpn_gateway_reference_model_json2 = reserved_ip_target_vpn_gateway_reference_model.to_dict()
- assert reserved_ip_target_vpn_gateway_reference_model_json2 == reserved_ip_target_vpn_gateway_reference_model_json
+ vpn_gateway_connection_prototype_vpn_gateway_connection_static_route_mode_prototype_model_json2 = vpn_gateway_connection_prototype_vpn_gateway_connection_static_route_mode_prototype_model.to_dict()
+ assert vpn_gateway_connection_prototype_vpn_gateway_connection_static_route_mode_prototype_model_json2 == vpn_gateway_connection_prototype_vpn_gateway_connection_static_route_mode_prototype_model_json
-class TestModel_ReservedIPTargetVPNServerReference:
+class TestModel_VPNGatewayConnectionStaticRouteMode:
"""
- Test Class for ReservedIPTargetVPNServerReference
+ Test Class for VPNGatewayConnectionStaticRouteMode
"""
- def test_reserved_ip_target_vpn_server_reference_serialization(self):
+ def test_vpn_gateway_connection_static_route_mode_serialization(self):
"""
- Test serialization/deserialization for ReservedIPTargetVPNServerReference
+ Test serialization/deserialization for VPNGatewayConnectionStaticRouteMode
"""
# Construct dict forms of any model objects needed in order to build this model.
- vpn_server_reference_deleted_model = {} # VPNServerReferenceDeleted
- vpn_server_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ 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
- # Construct a json representation of a ReservedIPTargetVPNServerReference model
- reserved_ip_target_vpn_server_reference_model_json = {}
- reserved_ip_target_vpn_server_reference_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpn-server:r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5'
- reserved_ip_target_vpn_server_reference_model_json['deleted'] = vpn_server_reference_deleted_model
- reserved_ip_target_vpn_server_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5'
- reserved_ip_target_vpn_server_reference_model_json['id'] = 'r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5'
- reserved_ip_target_vpn_server_reference_model_json['name'] = 'my-vpn-server'
- reserved_ip_target_vpn_server_reference_model_json['resource_type'] = 'vpn_server'
+ 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 ReservedIPTargetVPNServerReference by calling from_dict on the json representation
- reserved_ip_target_vpn_server_reference_model = ReservedIPTargetVPNServerReference.from_dict(reserved_ip_target_vpn_server_reference_model_json)
- assert reserved_ip_target_vpn_server_reference_model != False
+ 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'
- # Construct a model instance of ReservedIPTargetVPNServerReference by calling from_dict on the json representation
- reserved_ip_target_vpn_server_reference_model_dict = ReservedIPTargetVPNServerReference.from_dict(reserved_ip_target_vpn_server_reference_model_json).__dict__
- reserved_ip_target_vpn_server_reference_model2 = ReservedIPTargetVPNServerReference(**reserved_ip_target_vpn_server_reference_model_dict)
+ i_psec_policy_reference_deleted_model = {} # IPsecPolicyReferenceDeleted
+ i_psec_policy_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Verify the model instances are equivalent
- assert reserved_ip_target_vpn_server_reference_model == reserved_ip_target_vpn_server_reference_model2
+ 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'
- # Convert model instance back to dict and verify no loss of data
- reserved_ip_target_vpn_server_reference_model_json2 = reserved_ip_target_vpn_server_reference_model.to_dict()
- assert reserved_ip_target_vpn_server_reference_model_json2 == reserved_ip_target_vpn_server_reference_model_json
+ vpn_gateway_connection_status_reason_model = {} # VPNGatewayConnectionStatusReason
+ vpn_gateway_connection_status_reason_model['code'] = 'cannot_authenticate_connection'
+ vpn_gateway_connection_status_reason_model['message'] = 'Failed to authenticate a connection because of mismatched IKE ID and PSK.'
+ vpn_gateway_connection_status_reason_model['more_info'] = 'https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health'
+ ip_model = {} # IP
+ ip_model['address'] = '192.168.3.4'
-class TestModel_ReservedIPTargetVirtualNetworkInterfaceReferenceReservedIPTargetContext:
- """
- Test Class for ReservedIPTargetVirtualNetworkInterfaceReferenceReservedIPTargetContext
- """
+ vpn_gateway_connection_tunnel_status_reason_model = {} # VPNGatewayConnectionTunnelStatusReason
+ vpn_gateway_connection_tunnel_status_reason_model['code'] = 'cannot_authenticate_connection'
+ vpn_gateway_connection_tunnel_status_reason_model['message'] = 'Failed to authenticate a connection because of mismatched IKE ID and PSK.'
+ vpn_gateway_connection_tunnel_status_reason_model['more_info'] = 'https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health'
- def test_reserved_ip_target_virtual_network_interface_reference_reserved_ip_target_context_serialization(self):
- """
- Test serialization/deserialization for ReservedIPTargetVirtualNetworkInterfaceReferenceReservedIPTargetContext
- """
+ 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_static_route_mode_tunnel_model['status_reasons'] = [vpn_gateway_connection_tunnel_status_reason_model]
- # Construct a json representation of a ReservedIPTargetVirtualNetworkInterfaceReferenceReservedIPTargetContext model
- reserved_ip_target_virtual_network_interface_reference_reserved_ip_target_context_model_json = {}
- reserved_ip_target_virtual_network_interface_reference_reserved_ip_target_context_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9'
- reserved_ip_target_virtual_network_interface_reference_reserved_ip_target_context_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9'
- reserved_ip_target_virtual_network_interface_reference_reserved_ip_target_context_model_json['id'] = '0767-fa41aecb-4f21-423d-8082-630bfba1e1d9'
- reserved_ip_target_virtual_network_interface_reference_reserved_ip_target_context_model_json['name'] = 'my-virtual-network-interface'
- reserved_ip_target_virtual_network_interface_reference_reserved_ip_target_context_model_json['resource_type'] = 'virtual_network_interface'
+ # Construct a json representation of a VPNGatewayConnectionStaticRouteMode model
+ vpn_gateway_connection_static_route_mode_model_json = {}
+ vpn_gateway_connection_static_route_mode_model_json['admin_state_up'] = True
+ vpn_gateway_connection_static_route_mode_model_json['authentication_mode'] = 'psk'
+ vpn_gateway_connection_static_route_mode_model_json['created_at'] = '2019-01-01T12:00:00Z'
+ vpn_gateway_connection_static_route_mode_model_json['dead_peer_detection'] = vpn_gateway_connection_dpd_model
+ vpn_gateway_connection_static_route_mode_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_static_route_mode_model_json['id'] = 'a10a5771-dc23-442c-8460-c3601d8542f7'
+ vpn_gateway_connection_static_route_mode_model_json['ike_policy'] = ike_policy_reference_model
+ vpn_gateway_connection_static_route_mode_model_json['ipsec_policy'] = i_psec_policy_reference_model
+ vpn_gateway_connection_static_route_mode_model_json['mode'] = 'route'
+ vpn_gateway_connection_static_route_mode_model_json['name'] = 'my-vpn-connection'
+ vpn_gateway_connection_static_route_mode_model_json['peer_address'] = '169.21.50.5'
+ vpn_gateway_connection_static_route_mode_model_json['psk'] = 'lkj14b1oi0alcniejkso'
+ vpn_gateway_connection_static_route_mode_model_json['resource_type'] = 'vpn_gateway_connection'
+ vpn_gateway_connection_static_route_mode_model_json['status'] = 'down'
+ vpn_gateway_connection_static_route_mode_model_json['status_reasons'] = [vpn_gateway_connection_status_reason_model]
+ vpn_gateway_connection_static_route_mode_model_json['routing_protocol'] = 'none'
+ vpn_gateway_connection_static_route_mode_model_json['tunnels'] = [vpn_gateway_connection_static_route_mode_tunnel_model]
- # Construct a model instance of ReservedIPTargetVirtualNetworkInterfaceReferenceReservedIPTargetContext by calling from_dict on the json representation
- reserved_ip_target_virtual_network_interface_reference_reserved_ip_target_context_model = ReservedIPTargetVirtualNetworkInterfaceReferenceReservedIPTargetContext.from_dict(reserved_ip_target_virtual_network_interface_reference_reserved_ip_target_context_model_json)
- assert reserved_ip_target_virtual_network_interface_reference_reserved_ip_target_context_model != False
+ # Construct a model instance of VPNGatewayConnectionStaticRouteMode by calling from_dict on the json representation
+ vpn_gateway_connection_static_route_mode_model = VPNGatewayConnectionStaticRouteMode.from_dict(vpn_gateway_connection_static_route_mode_model_json)
+ assert vpn_gateway_connection_static_route_mode_model != False
- # Construct a model instance of ReservedIPTargetVirtualNetworkInterfaceReferenceReservedIPTargetContext by calling from_dict on the json representation
- reserved_ip_target_virtual_network_interface_reference_reserved_ip_target_context_model_dict = ReservedIPTargetVirtualNetworkInterfaceReferenceReservedIPTargetContext.from_dict(reserved_ip_target_virtual_network_interface_reference_reserved_ip_target_context_model_json).__dict__
- reserved_ip_target_virtual_network_interface_reference_reserved_ip_target_context_model2 = ReservedIPTargetVirtualNetworkInterfaceReferenceReservedIPTargetContext(**reserved_ip_target_virtual_network_interface_reference_reserved_ip_target_context_model_dict)
+ # Construct a model instance of VPNGatewayConnectionStaticRouteMode by calling from_dict on the json representation
+ vpn_gateway_connection_static_route_mode_model_dict = VPNGatewayConnectionStaticRouteMode.from_dict(vpn_gateway_connection_static_route_mode_model_json).__dict__
+ vpn_gateway_connection_static_route_mode_model2 = VPNGatewayConnectionStaticRouteMode(**vpn_gateway_connection_static_route_mode_model_dict)
# Verify the model instances are equivalent
- assert reserved_ip_target_virtual_network_interface_reference_reserved_ip_target_context_model == reserved_ip_target_virtual_network_interface_reference_reserved_ip_target_context_model2
+ assert vpn_gateway_connection_static_route_mode_model == vpn_gateway_connection_static_route_mode_model2
# Convert model instance back to dict and verify no loss of data
- reserved_ip_target_virtual_network_interface_reference_reserved_ip_target_context_model_json2 = reserved_ip_target_virtual_network_interface_reference_reserved_ip_target_context_model.to_dict()
- assert reserved_ip_target_virtual_network_interface_reference_reserved_ip_target_context_model_json2 == reserved_ip_target_virtual_network_interface_reference_reserved_ip_target_context_model_json
+ vpn_gateway_connection_static_route_mode_model_json2 = vpn_gateway_connection_static_route_mode_model.to_dict()
+ assert vpn_gateway_connection_static_route_mode_model_json2 == vpn_gateway_connection_static_route_mode_model_json
-class TestModel_ResourceGroupIdentityById:
+class TestModel_VPNGatewayPolicyMode:
"""
- Test Class for ResourceGroupIdentityById
+ Test Class for VPNGatewayPolicyMode
"""
- def test_resource_group_identity_by_id_serialization(self):
+ def test_vpn_gateway_policy_mode_serialization(self):
"""
- Test serialization/deserialization for ResourceGroupIdentityById
+ Test serialization/deserialization for VPNGatewayPolicyMode
"""
- # Construct a json representation of a ResourceGroupIdentityById model
- resource_group_identity_by_id_model_json = {}
- resource_group_identity_by_id_model_json['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
-
- # Construct a model instance of ResourceGroupIdentityById by calling from_dict on the json representation
- resource_group_identity_by_id_model = ResourceGroupIdentityById.from_dict(resource_group_identity_by_id_model_json)
- assert resource_group_identity_by_id_model != False
-
- # Construct a model instance of ResourceGroupIdentityById by calling from_dict on the json representation
- resource_group_identity_by_id_model_dict = ResourceGroupIdentityById.from_dict(resource_group_identity_by_id_model_json).__dict__
- resource_group_identity_by_id_model2 = ResourceGroupIdentityById(**resource_group_identity_by_id_model_dict)
-
- # Verify the model instances are equivalent
- assert resource_group_identity_by_id_model == resource_group_identity_by_id_model2
-
- # Convert model instance back to dict and verify no loss of data
- resource_group_identity_by_id_model_json2 = resource_group_identity_by_id_model.to_dict()
- assert resource_group_identity_by_id_model_json2 == resource_group_identity_by_id_model_json
+ # 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'
-class TestModel_RouteCreatorVPNGatewayReference:
- """
- Test Class for RouteCreatorVPNGatewayReference
- """
+ 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'
- def test_route_creator_vpn_gateway_reference_serialization(self):
- """
- Test serialization/deserialization for RouteCreatorVPNGatewayReference
- """
+ vpn_gateway_health_reason_model = {} # VPNGatewayHealthReason
+ vpn_gateway_health_reason_model['code'] = 'cannot_reserve_ip_address'
+ vpn_gateway_health_reason_model['message'] = 'IP address exhaustion (release addresses on the VPN\'s subnet).'
+ vpn_gateway_health_reason_model['more_info'] = 'https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health'
- # Construct dict forms of any model objects needed in order to build this model.
+ vpn_gateway_lifecycle_reason_model = {} # VPNGatewayLifecycleReason
+ vpn_gateway_lifecycle_reason_model['code'] = 'resource_suspended_by_provider'
+ vpn_gateway_lifecycle_reason_model['message'] = 'The resource has been suspended. Contact IBM support with the CRN for next steps.'
+ vpn_gateway_lifecycle_reason_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#resource-suspension'
- vpn_gateway_reference_deleted_model = {} # VPNGatewayReferenceDeleted
- vpn_gateway_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ vpn_gateway_member_health_reason_model = {} # VPNGatewayMemberHealthReason
+ vpn_gateway_member_health_reason_model['code'] = 'cannot_reserve_ip_address'
+ vpn_gateway_member_health_reason_model['message'] = 'IP address exhaustion (release addresses on the VPN\'s subnet).'
+ vpn_gateway_member_health_reason_model['more_info'] = 'https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health'
- # Construct a json representation of a RouteCreatorVPNGatewayReference model
- route_creator_vpn_gateway_reference_model_json = {}
- route_creator_vpn_gateway_reference_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b'
- route_creator_vpn_gateway_reference_model_json['deleted'] = vpn_gateway_reference_deleted_model
- route_creator_vpn_gateway_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b'
- route_creator_vpn_gateway_reference_model_json['id'] = 'ddf51bec-3424-11e8-b467-0ed5f89f718b'
- route_creator_vpn_gateway_reference_model_json['name'] = 'my-vpn-gateway'
- route_creator_vpn_gateway_reference_model_json['resource_type'] = 'vpn_gateway'
+ vpn_gateway_member_lifecycle_reason_model = {} # VPNGatewayMemberLifecycleReason
+ vpn_gateway_member_lifecycle_reason_model['code'] = 'resource_suspended_by_provider'
+ vpn_gateway_member_lifecycle_reason_model['message'] = 'The resource has been suspended. Contact IBM support with the CRN for next steps.'
+ vpn_gateway_member_lifecycle_reason_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#resource-suspension'
- # Construct a model instance of RouteCreatorVPNGatewayReference by calling from_dict on the json representation
- route_creator_vpn_gateway_reference_model = RouteCreatorVPNGatewayReference.from_dict(route_creator_vpn_gateway_reference_model_json)
- assert route_creator_vpn_gateway_reference_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 RouteCreatorVPNGatewayReference by calling from_dict on the json representation
- route_creator_vpn_gateway_reference_model_dict = RouteCreatorVPNGatewayReference.from_dict(route_creator_vpn_gateway_reference_model_json).__dict__
- route_creator_vpn_gateway_reference_model2 = RouteCreatorVPNGatewayReference(**route_creator_vpn_gateway_reference_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'
- # Verify the model instances are equivalent
- assert route_creator_vpn_gateway_reference_model == route_creator_vpn_gateway_reference_model2
+ ip_model = {} # IP
+ ip_model['address'] = '192.168.3.4'
- # Convert model instance back to dict and verify no loss of data
- route_creator_vpn_gateway_reference_model_json2 = route_creator_vpn_gateway_reference_model.to_dict()
- assert route_creator_vpn_gateway_reference_model_json2 == route_creator_vpn_gateway_reference_model_json
+ vpn_gateway_member_model = {} # VPNGatewayMember
+ vpn_gateway_member_model['health_reasons'] = [vpn_gateway_member_health_reason_model]
+ vpn_gateway_member_model['health_state'] = 'ok'
+ vpn_gateway_member_model['lifecycle_reasons'] = [vpn_gateway_member_lifecycle_reason_model]
+ vpn_gateway_member_model['lifecycle_state'] = 'stable'
+ vpn_gateway_member_model['private_ip'] = reserved_ip_reference_model
+ vpn_gateway_member_model['public_ip'] = ip_model
+ vpn_gateway_member_model['role'] = 'active'
+ 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_RouteCreatorVPNServerReference:
- """
- Test Class for RouteCreatorVPNServerReference
- """
+ subnet_reference_deleted_model = {} # SubnetReferenceDeleted
+ subnet_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- def test_route_creator_vpn_server_reference_serialization(self):
- """
- Test serialization/deserialization for RouteCreatorVPNServerReference
- """
+ subnet_reference_model = {} # SubnetReference
+ subnet_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
+ subnet_reference_model['deleted'] = subnet_reference_deleted_model
+ subnet_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
+ subnet_reference_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
+ subnet_reference_model['name'] = 'my-subnet'
+ subnet_reference_model['resource_type'] = 'subnet'
- # Construct 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'
- vpn_server_reference_deleted_model = {} # VPNServerReferenceDeleted
- vpn_server_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ vpc_reference_model = {} # VPCReference
+ vpc_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b'
+ vpc_reference_model['deleted'] = vpc_reference_deleted_model
+ vpc_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b'
+ vpc_reference_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b'
+ vpc_reference_model['name'] = 'my-vpc'
+ vpc_reference_model['resource_type'] = 'vpc'
- # Construct a json representation of a RouteCreatorVPNServerReference model
- route_creator_vpn_server_reference_model_json = {}
- route_creator_vpn_server_reference_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpn-server:r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5'
- route_creator_vpn_server_reference_model_json['deleted'] = vpn_server_reference_deleted_model
- route_creator_vpn_server_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5'
- route_creator_vpn_server_reference_model_json['id'] = 'r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5'
- route_creator_vpn_server_reference_model_json['name'] = 'my-vpn-server'
- route_creator_vpn_server_reference_model_json['resource_type'] = 'vpn_server'
+ # Construct a json representation of a VPNGatewayPolicyMode model
+ vpn_gateway_policy_mode_model_json = {}
+ vpn_gateway_policy_mode_model_json['connections'] = [vpn_gateway_connection_reference_model]
+ vpn_gateway_policy_mode_model_json['created_at'] = '2019-01-01T12:00:00Z'
+ vpn_gateway_policy_mode_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b'
+ vpn_gateway_policy_mode_model_json['health_reasons'] = [vpn_gateway_health_reason_model]
+ vpn_gateway_policy_mode_model_json['health_state'] = 'ok'
+ vpn_gateway_policy_mode_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b'
+ vpn_gateway_policy_mode_model_json['id'] = 'ddf51bec-3424-11e8-b467-0ed5f89f718b'
+ vpn_gateway_policy_mode_model_json['lifecycle_reasons'] = [vpn_gateway_lifecycle_reason_model]
+ vpn_gateway_policy_mode_model_json['lifecycle_state'] = 'stable'
+ vpn_gateway_policy_mode_model_json['members'] = [vpn_gateway_member_model]
+ vpn_gateway_policy_mode_model_json['name'] = 'my-vpn-gateway'
+ vpn_gateway_policy_mode_model_json['resource_group'] = resource_group_reference_model
+ vpn_gateway_policy_mode_model_json['resource_type'] = 'vpn_gateway'
+ vpn_gateway_policy_mode_model_json['subnet'] = subnet_reference_model
+ vpn_gateway_policy_mode_model_json['vpc'] = vpc_reference_model
+ vpn_gateway_policy_mode_model_json['mode'] = 'policy'
- # Construct a model instance of RouteCreatorVPNServerReference by calling from_dict on the json representation
- route_creator_vpn_server_reference_model = RouteCreatorVPNServerReference.from_dict(route_creator_vpn_server_reference_model_json)
- assert route_creator_vpn_server_reference_model != False
+ # Construct a model instance of VPNGatewayPolicyMode by calling from_dict on the json representation
+ vpn_gateway_policy_mode_model = VPNGatewayPolicyMode.from_dict(vpn_gateway_policy_mode_model_json)
+ assert vpn_gateway_policy_mode_model != False
- # Construct a model instance of RouteCreatorVPNServerReference by calling from_dict on the json representation
- route_creator_vpn_server_reference_model_dict = RouteCreatorVPNServerReference.from_dict(route_creator_vpn_server_reference_model_json).__dict__
- route_creator_vpn_server_reference_model2 = RouteCreatorVPNServerReference(**route_creator_vpn_server_reference_model_dict)
+ # Construct a model instance of VPNGatewayPolicyMode by calling from_dict on the json representation
+ vpn_gateway_policy_mode_model_dict = VPNGatewayPolicyMode.from_dict(vpn_gateway_policy_mode_model_json).__dict__
+ vpn_gateway_policy_mode_model2 = VPNGatewayPolicyMode(**vpn_gateway_policy_mode_model_dict)
# Verify the model instances are equivalent
- assert route_creator_vpn_server_reference_model == route_creator_vpn_server_reference_model2
+ assert vpn_gateway_policy_mode_model == vpn_gateway_policy_mode_model2
# Convert model instance back to dict and verify no loss of data
- route_creator_vpn_server_reference_model_json2 = route_creator_vpn_server_reference_model.to_dict()
- assert route_creator_vpn_server_reference_model_json2 == route_creator_vpn_server_reference_model_json
+ vpn_gateway_policy_mode_model_json2 = vpn_gateway_policy_mode_model.to_dict()
+ assert vpn_gateway_policy_mode_model_json2 == vpn_gateway_policy_mode_model_json
-class TestModel_RouteNextHopIP:
+class TestModel_VPNGatewayPrototypeVPNGatewayPolicyModePrototype:
"""
- Test Class for RouteNextHopIP
+ Test Class for VPNGatewayPrototypeVPNGatewayPolicyModePrototype
"""
- def test_route_next_hop_ip_serialization(self):
+ def test_vpn_gateway_prototype_vpn_gateway_policy_mode_prototype_serialization(self):
"""
- Test serialization/deserialization for RouteNextHopIP
+ Test serialization/deserialization for VPNGatewayPrototypeVPNGatewayPolicyModePrototype
"""
- # Construct a json representation of a RouteNextHopIP model
- route_next_hop_ip_model_json = {}
- route_next_hop_ip_model_json['address'] = '192.168.3.4'
+ # Construct dict forms of any model objects needed in order to build this model.
- # Construct a model instance of RouteNextHopIP by calling from_dict on the json representation
- route_next_hop_ip_model = RouteNextHopIP.from_dict(route_next_hop_ip_model_json)
- assert route_next_hop_ip_model != False
+ resource_group_identity_model = {} # ResourceGroupIdentityById
+ resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
- # Construct a model instance of RouteNextHopIP by calling from_dict on the json representation
- route_next_hop_ip_model_dict = RouteNextHopIP.from_dict(route_next_hop_ip_model_json).__dict__
- route_next_hop_ip_model2 = RouteNextHopIP(**route_next_hop_ip_model_dict)
+ subnet_identity_model = {} # SubnetIdentityById
+ subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
+
+ # Construct a json representation of a VPNGatewayPrototypeVPNGatewayPolicyModePrototype model
+ vpn_gateway_prototype_vpn_gateway_policy_mode_prototype_model_json = {}
+ vpn_gateway_prototype_vpn_gateway_policy_mode_prototype_model_json['name'] = 'my-vpn-gateway'
+ vpn_gateway_prototype_vpn_gateway_policy_mode_prototype_model_json['resource_group'] = resource_group_identity_model
+ vpn_gateway_prototype_vpn_gateway_policy_mode_prototype_model_json['subnet'] = subnet_identity_model
+ vpn_gateway_prototype_vpn_gateway_policy_mode_prototype_model_json['mode'] = 'policy'
+
+ # Construct a model instance of VPNGatewayPrototypeVPNGatewayPolicyModePrototype by calling from_dict on the json representation
+ vpn_gateway_prototype_vpn_gateway_policy_mode_prototype_model = VPNGatewayPrototypeVPNGatewayPolicyModePrototype.from_dict(vpn_gateway_prototype_vpn_gateway_policy_mode_prototype_model_json)
+ assert vpn_gateway_prototype_vpn_gateway_policy_mode_prototype_model != False
+
+ # Construct a model instance of VPNGatewayPrototypeVPNGatewayPolicyModePrototype by calling from_dict on the json representation
+ vpn_gateway_prototype_vpn_gateway_policy_mode_prototype_model_dict = VPNGatewayPrototypeVPNGatewayPolicyModePrototype.from_dict(vpn_gateway_prototype_vpn_gateway_policy_mode_prototype_model_json).__dict__
+ vpn_gateway_prototype_vpn_gateway_policy_mode_prototype_model2 = VPNGatewayPrototypeVPNGatewayPolicyModePrototype(**vpn_gateway_prototype_vpn_gateway_policy_mode_prototype_model_dict)
# Verify the model instances are equivalent
- assert route_next_hop_ip_model == route_next_hop_ip_model2
+ assert vpn_gateway_prototype_vpn_gateway_policy_mode_prototype_model == vpn_gateway_prototype_vpn_gateway_policy_mode_prototype_model2
# Convert model instance back to dict and verify no loss of data
- route_next_hop_ip_model_json2 = route_next_hop_ip_model.to_dict()
- assert route_next_hop_ip_model_json2 == route_next_hop_ip_model_json
+ vpn_gateway_prototype_vpn_gateway_policy_mode_prototype_model_json2 = vpn_gateway_prototype_vpn_gateway_policy_mode_prototype_model.to_dict()
+ assert vpn_gateway_prototype_vpn_gateway_policy_mode_prototype_model_json2 == vpn_gateway_prototype_vpn_gateway_policy_mode_prototype_model_json
-class TestModel_RouteNextHopVPNGatewayConnectionReference:
+class TestModel_VPNGatewayPrototypeVPNGatewayRouteModePrototype:
"""
- Test Class for RouteNextHopVPNGatewayConnectionReference
+ Test Class for VPNGatewayPrototypeVPNGatewayRouteModePrototype
"""
- def test_route_next_hop_vpn_gateway_connection_reference_serialization(self):
+ def test_vpn_gateway_prototype_vpn_gateway_route_mode_prototype_serialization(self):
"""
- Test serialization/deserialization for RouteNextHopVPNGatewayConnectionReference
+ Test serialization/deserialization for VPNGatewayPrototypeVPNGatewayRouteModePrototype
"""
# 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'
+ resource_group_identity_model = {} # ResourceGroupIdentityById
+ resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
- # Construct a json representation of a RouteNextHopVPNGatewayConnectionReference model
- route_next_hop_vpn_gateway_connection_reference_model_json = {}
- route_next_hop_vpn_gateway_connection_reference_model_json['deleted'] = vpn_gateway_connection_reference_deleted_model
- route_next_hop_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'
- route_next_hop_vpn_gateway_connection_reference_model_json['id'] = 'a10a5771-dc23-442c-8460-c3601d8542f7'
- route_next_hop_vpn_gateway_connection_reference_model_json['name'] = 'my-vpn-connection'
- route_next_hop_vpn_gateway_connection_reference_model_json['resource_type'] = 'vpn_gateway_connection'
+ subnet_identity_model = {} # SubnetIdentityById
+ subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
- # Construct a model instance of RouteNextHopVPNGatewayConnectionReference by calling from_dict on the json representation
- route_next_hop_vpn_gateway_connection_reference_model = RouteNextHopVPNGatewayConnectionReference.from_dict(route_next_hop_vpn_gateway_connection_reference_model_json)
- assert route_next_hop_vpn_gateway_connection_reference_model != False
+ # Construct a json representation of a VPNGatewayPrototypeVPNGatewayRouteModePrototype model
+ vpn_gateway_prototype_vpn_gateway_route_mode_prototype_model_json = {}
+ vpn_gateway_prototype_vpn_gateway_route_mode_prototype_model_json['name'] = 'my-vpn-gateway'
+ vpn_gateway_prototype_vpn_gateway_route_mode_prototype_model_json['resource_group'] = resource_group_identity_model
+ vpn_gateway_prototype_vpn_gateway_route_mode_prototype_model_json['subnet'] = subnet_identity_model
+ vpn_gateway_prototype_vpn_gateway_route_mode_prototype_model_json['mode'] = 'route'
- # Construct a model instance of RouteNextHopVPNGatewayConnectionReference by calling from_dict on the json representation
- route_next_hop_vpn_gateway_connection_reference_model_dict = RouteNextHopVPNGatewayConnectionReference.from_dict(route_next_hop_vpn_gateway_connection_reference_model_json).__dict__
- route_next_hop_vpn_gateway_connection_reference_model2 = RouteNextHopVPNGatewayConnectionReference(**route_next_hop_vpn_gateway_connection_reference_model_dict)
+ # Construct a model instance of VPNGatewayPrototypeVPNGatewayRouteModePrototype by calling from_dict on the json representation
+ vpn_gateway_prototype_vpn_gateway_route_mode_prototype_model = VPNGatewayPrototypeVPNGatewayRouteModePrototype.from_dict(vpn_gateway_prototype_vpn_gateway_route_mode_prototype_model_json)
+ assert vpn_gateway_prototype_vpn_gateway_route_mode_prototype_model != False
+
+ # Construct a model instance of VPNGatewayPrototypeVPNGatewayRouteModePrototype by calling from_dict on the json representation
+ vpn_gateway_prototype_vpn_gateway_route_mode_prototype_model_dict = VPNGatewayPrototypeVPNGatewayRouteModePrototype.from_dict(vpn_gateway_prototype_vpn_gateway_route_mode_prototype_model_json).__dict__
+ vpn_gateway_prototype_vpn_gateway_route_mode_prototype_model2 = VPNGatewayPrototypeVPNGatewayRouteModePrototype(**vpn_gateway_prototype_vpn_gateway_route_mode_prototype_model_dict)
# Verify the model instances are equivalent
- assert route_next_hop_vpn_gateway_connection_reference_model == route_next_hop_vpn_gateway_connection_reference_model2
+ assert vpn_gateway_prototype_vpn_gateway_route_mode_prototype_model == vpn_gateway_prototype_vpn_gateway_route_mode_prototype_model2
# Convert model instance back to dict and verify no loss of data
- route_next_hop_vpn_gateway_connection_reference_model_json2 = route_next_hop_vpn_gateway_connection_reference_model.to_dict()
- assert route_next_hop_vpn_gateway_connection_reference_model_json2 == route_next_hop_vpn_gateway_connection_reference_model_json
+ vpn_gateway_prototype_vpn_gateway_route_mode_prototype_model_json2 = vpn_gateway_prototype_vpn_gateway_route_mode_prototype_model.to_dict()
+ assert vpn_gateway_prototype_vpn_gateway_route_mode_prototype_model_json2 == vpn_gateway_prototype_vpn_gateway_route_mode_prototype_model_json
-class TestModel_RoutingTableIdentityByHref:
+class TestModel_VPNGatewayRouteMode:
"""
- Test Class for RoutingTableIdentityByHref
+ Test Class for VPNGatewayRouteMode
"""
- def test_routing_table_identity_by_href_serialization(self):
+ def test_vpn_gateway_route_mode_serialization(self):
"""
- Test serialization/deserialization for RoutingTableIdentityByHref
+ Test serialization/deserialization for VPNGatewayRouteMode
"""
- # Construct a json representation of a RoutingTableIdentityByHref model
- routing_table_identity_by_href_model_json = {}
- routing_table_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840'
+ # Construct dict forms of any model objects needed in order to build this model.
- # Construct a model instance of RoutingTableIdentityByHref by calling from_dict on the json representation
- routing_table_identity_by_href_model = RoutingTableIdentityByHref.from_dict(routing_table_identity_by_href_model_json)
- assert routing_table_identity_by_href_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 RoutingTableIdentityByHref by calling from_dict on the json representation
- routing_table_identity_by_href_model_dict = RoutingTableIdentityByHref.from_dict(routing_table_identity_by_href_model_json).__dict__
- routing_table_identity_by_href_model2 = RoutingTableIdentityByHref(**routing_table_identity_by_href_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 routing_table_identity_by_href_model == routing_table_identity_by_href_model2
+ vpn_gateway_health_reason_model = {} # VPNGatewayHealthReason
+ vpn_gateway_health_reason_model['code'] = 'cannot_reserve_ip_address'
+ vpn_gateway_health_reason_model['message'] = 'IP address exhaustion (release addresses on the VPN\'s subnet).'
+ vpn_gateway_health_reason_model['more_info'] = 'https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health'
- # Convert model instance back to dict and verify no loss of data
- routing_table_identity_by_href_model_json2 = routing_table_identity_by_href_model.to_dict()
- assert routing_table_identity_by_href_model_json2 == routing_table_identity_by_href_model_json
+ vpn_gateway_lifecycle_reason_model = {} # VPNGatewayLifecycleReason
+ vpn_gateway_lifecycle_reason_model['code'] = 'resource_suspended_by_provider'
+ vpn_gateway_lifecycle_reason_model['message'] = 'The resource has been suspended. Contact IBM support with the CRN for next steps.'
+ vpn_gateway_lifecycle_reason_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#resource-suspension'
+ vpn_gateway_member_health_reason_model = {} # VPNGatewayMemberHealthReason
+ vpn_gateway_member_health_reason_model['code'] = 'cannot_reserve_ip_address'
+ vpn_gateway_member_health_reason_model['message'] = 'IP address exhaustion (release addresses on the VPN\'s subnet).'
+ vpn_gateway_member_health_reason_model['more_info'] = 'https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health'
-class TestModel_RoutingTableIdentityById:
- """
- Test Class for RoutingTableIdentityById
- """
+ vpn_gateway_member_lifecycle_reason_model = {} # VPNGatewayMemberLifecycleReason
+ vpn_gateway_member_lifecycle_reason_model['code'] = 'resource_suspended_by_provider'
+ vpn_gateway_member_lifecycle_reason_model['message'] = 'The resource has been suspended. Contact IBM support with the CRN for next steps.'
+ vpn_gateway_member_lifecycle_reason_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#resource-suspension'
- def test_routing_table_identity_by_id_serialization(self):
- """
- Test serialization/deserialization for RoutingTableIdentityById
- """
+ 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 RoutingTableIdentityById model
- routing_table_identity_by_id_model_json = {}
- routing_table_identity_by_id_model_json['id'] = '1a15dca5-7e33-45e1-b7c5-bc690e569531'
+ 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 RoutingTableIdentityById by calling from_dict on the json representation
- routing_table_identity_by_id_model = RoutingTableIdentityById.from_dict(routing_table_identity_by_id_model_json)
- assert routing_table_identity_by_id_model != False
+ ip_model = {} # IP
+ ip_model['address'] = '192.168.3.4'
- # Construct a model instance of RoutingTableIdentityById by calling from_dict on the json representation
- routing_table_identity_by_id_model_dict = RoutingTableIdentityById.from_dict(routing_table_identity_by_id_model_json).__dict__
- routing_table_identity_by_id_model2 = RoutingTableIdentityById(**routing_table_identity_by_id_model_dict)
+ vpn_gateway_member_model = {} # VPNGatewayMember
+ vpn_gateway_member_model['health_reasons'] = [vpn_gateway_member_health_reason_model]
+ vpn_gateway_member_model['health_state'] = 'ok'
+ vpn_gateway_member_model['lifecycle_reasons'] = [vpn_gateway_member_lifecycle_reason_model]
+ vpn_gateway_member_model['lifecycle_state'] = 'stable'
+ vpn_gateway_member_model['private_ip'] = reserved_ip_reference_model
+ vpn_gateway_member_model['public_ip'] = ip_model
+ vpn_gateway_member_model['role'] = 'active'
- # Verify the model instances are equivalent
- assert routing_table_identity_by_id_model == routing_table_identity_by_id_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
- routing_table_identity_by_id_model_json2 = routing_table_identity_by_id_model.to_dict()
- assert routing_table_identity_by_id_model_json2 == routing_table_identity_by_id_model_json
+ subnet_reference_deleted_model = {} # SubnetReferenceDeleted
+ subnet_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ subnet_reference_model = {} # SubnetReference
+ subnet_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
+ subnet_reference_model['deleted'] = subnet_reference_deleted_model
+ subnet_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
+ subnet_reference_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
+ subnet_reference_model['name'] = 'my-subnet'
+ subnet_reference_model['resource_type'] = 'subnet'
-class TestModel_SecurityGroupIdentityByCRN:
- """
- Test Class for SecurityGroupIdentityByCRN
- """
+ vpc_reference_deleted_model = {} # VPCReferenceDeleted
+ vpc_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- def test_security_group_identity_by_crn_serialization(self):
- """
- Test serialization/deserialization for SecurityGroupIdentityByCRN
- """
+ vpc_reference_model = {} # VPCReference
+ vpc_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b'
+ vpc_reference_model['deleted'] = vpc_reference_deleted_model
+ vpc_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b'
+ vpc_reference_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b'
+ vpc_reference_model['name'] = 'my-vpc'
+ vpc_reference_model['resource_type'] = 'vpc'
- # Construct a json representation of a SecurityGroupIdentityByCRN model
- security_group_identity_by_crn_model_json = {}
- security_group_identity_by_crn_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271'
+ # Construct a json representation of a VPNGatewayRouteMode model
+ vpn_gateway_route_mode_model_json = {}
+ vpn_gateway_route_mode_model_json['connections'] = [vpn_gateway_connection_reference_model]
+ vpn_gateway_route_mode_model_json['created_at'] = '2019-01-01T12:00:00Z'
+ vpn_gateway_route_mode_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b'
+ vpn_gateway_route_mode_model_json['health_reasons'] = [vpn_gateway_health_reason_model]
+ vpn_gateway_route_mode_model_json['health_state'] = 'ok'
+ vpn_gateway_route_mode_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b'
+ vpn_gateway_route_mode_model_json['id'] = 'ddf51bec-3424-11e8-b467-0ed5f89f718b'
+ vpn_gateway_route_mode_model_json['lifecycle_reasons'] = [vpn_gateway_lifecycle_reason_model]
+ vpn_gateway_route_mode_model_json['lifecycle_state'] = 'stable'
+ vpn_gateway_route_mode_model_json['members'] = [vpn_gateway_member_model]
+ vpn_gateway_route_mode_model_json['name'] = 'my-vpn-gateway'
+ vpn_gateway_route_mode_model_json['resource_group'] = resource_group_reference_model
+ vpn_gateway_route_mode_model_json['resource_type'] = 'vpn_gateway'
+ vpn_gateway_route_mode_model_json['subnet'] = subnet_reference_model
+ vpn_gateway_route_mode_model_json['vpc'] = vpc_reference_model
+ vpn_gateway_route_mode_model_json['mode'] = 'route'
- # Construct a model instance of SecurityGroupIdentityByCRN by calling from_dict on the json representation
- security_group_identity_by_crn_model = SecurityGroupIdentityByCRN.from_dict(security_group_identity_by_crn_model_json)
- assert security_group_identity_by_crn_model != False
+ # Construct a model instance of VPNGatewayRouteMode by calling from_dict on the json representation
+ vpn_gateway_route_mode_model = VPNGatewayRouteMode.from_dict(vpn_gateway_route_mode_model_json)
+ assert vpn_gateway_route_mode_model != False
- # Construct a model instance of SecurityGroupIdentityByCRN by calling from_dict on the json representation
- security_group_identity_by_crn_model_dict = SecurityGroupIdentityByCRN.from_dict(security_group_identity_by_crn_model_json).__dict__
- security_group_identity_by_crn_model2 = SecurityGroupIdentityByCRN(**security_group_identity_by_crn_model_dict)
+ # Construct a model instance of VPNGatewayRouteMode by calling from_dict on the json representation
+ vpn_gateway_route_mode_model_dict = VPNGatewayRouteMode.from_dict(vpn_gateway_route_mode_model_json).__dict__
+ vpn_gateway_route_mode_model2 = VPNGatewayRouteMode(**vpn_gateway_route_mode_model_dict)
# Verify the model instances are equivalent
- assert security_group_identity_by_crn_model == security_group_identity_by_crn_model2
+ assert vpn_gateway_route_mode_model == vpn_gateway_route_mode_model2
# Convert model instance back to dict and verify no loss of data
- security_group_identity_by_crn_model_json2 = security_group_identity_by_crn_model.to_dict()
- assert security_group_identity_by_crn_model_json2 == security_group_identity_by_crn_model_json
+ vpn_gateway_route_mode_model_json2 = vpn_gateway_route_mode_model.to_dict()
+ assert vpn_gateway_route_mode_model_json2 == vpn_gateway_route_mode_model_json
-class TestModel_SecurityGroupIdentityByHref:
+class TestModel_VPNServerAuthenticationByCertificate:
"""
- Test Class for SecurityGroupIdentityByHref
+ Test Class for VPNServerAuthenticationByCertificate
"""
- def test_security_group_identity_by_href_serialization(self):
+ def test_vpn_server_authentication_by_certificate_serialization(self):
"""
- Test serialization/deserialization for SecurityGroupIdentityByHref
+ Test serialization/deserialization for VPNServerAuthenticationByCertificate
"""
- # Construct a json representation of a SecurityGroupIdentityByHref model
- security_group_identity_by_href_model_json = {}
- security_group_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271'
-
- # Construct a model instance of SecurityGroupIdentityByHref by calling from_dict on the json representation
- security_group_identity_by_href_model = SecurityGroupIdentityByHref.from_dict(security_group_identity_by_href_model_json)
- assert security_group_identity_by_href_model != False
-
- # Construct a model instance of SecurityGroupIdentityByHref by calling from_dict on the json representation
- security_group_identity_by_href_model_dict = SecurityGroupIdentityByHref.from_dict(security_group_identity_by_href_model_json).__dict__
- security_group_identity_by_href_model2 = SecurityGroupIdentityByHref(**security_group_identity_by_href_model_dict)
-
- # Verify the model instances are equivalent
- assert security_group_identity_by_href_model == security_group_identity_by_href_model2
-
- # Convert model instance back to dict and verify no loss of data
- security_group_identity_by_href_model_json2 = security_group_identity_by_href_model.to_dict()
- assert security_group_identity_by_href_model_json2 == security_group_identity_by_href_model_json
-
-
-class TestModel_SecurityGroupIdentityById:
- """
- Test Class for SecurityGroupIdentityById
- """
+ # Construct dict forms of any model objects needed in order to build this model.
- def test_security_group_identity_by_id_serialization(self):
- """
- Test serialization/deserialization for SecurityGroupIdentityById
- """
+ certificate_instance_reference_model = {} # CertificateInstanceReference
+ certificate_instance_reference_model['crn'] = 'crn:v1:bluemix:public:secrets-manager:us-south:a/123456:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5'
- # Construct a json representation of a SecurityGroupIdentityById model
- security_group_identity_by_id_model_json = {}
- security_group_identity_by_id_model_json['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271'
+ # Construct a json representation of a VPNServerAuthenticationByCertificate model
+ vpn_server_authentication_by_certificate_model_json = {}
+ vpn_server_authentication_by_certificate_model_json['method'] = 'certificate'
+ vpn_server_authentication_by_certificate_model_json['client_ca'] = certificate_instance_reference_model
+ vpn_server_authentication_by_certificate_model_json['crl'] = 'testString'
- # Construct a model instance of SecurityGroupIdentityById by calling from_dict on the json representation
- security_group_identity_by_id_model = SecurityGroupIdentityById.from_dict(security_group_identity_by_id_model_json)
- assert security_group_identity_by_id_model != False
+ # Construct a model instance of VPNServerAuthenticationByCertificate by calling from_dict on the json representation
+ vpn_server_authentication_by_certificate_model = VPNServerAuthenticationByCertificate.from_dict(vpn_server_authentication_by_certificate_model_json)
+ assert vpn_server_authentication_by_certificate_model != False
- # Construct a model instance of SecurityGroupIdentityById by calling from_dict on the json representation
- security_group_identity_by_id_model_dict = SecurityGroupIdentityById.from_dict(security_group_identity_by_id_model_json).__dict__
- security_group_identity_by_id_model2 = SecurityGroupIdentityById(**security_group_identity_by_id_model_dict)
+ # Construct a model instance of VPNServerAuthenticationByCertificate by calling from_dict on the json representation
+ vpn_server_authentication_by_certificate_model_dict = VPNServerAuthenticationByCertificate.from_dict(vpn_server_authentication_by_certificate_model_json).__dict__
+ vpn_server_authentication_by_certificate_model2 = VPNServerAuthenticationByCertificate(**vpn_server_authentication_by_certificate_model_dict)
# Verify the model instances are equivalent
- assert security_group_identity_by_id_model == security_group_identity_by_id_model2
+ assert vpn_server_authentication_by_certificate_model == vpn_server_authentication_by_certificate_model2
# Convert model instance back to dict and verify no loss of data
- security_group_identity_by_id_model_json2 = security_group_identity_by_id_model.to_dict()
- assert security_group_identity_by_id_model_json2 == security_group_identity_by_id_model_json
+ vpn_server_authentication_by_certificate_model_json2 = vpn_server_authentication_by_certificate_model.to_dict()
+ assert vpn_server_authentication_by_certificate_model_json2 == vpn_server_authentication_by_certificate_model_json
-class TestModel_SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll:
+class TestModel_VPNServerAuthenticationByUsername:
"""
- Test Class for SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll
+ Test Class for VPNServerAuthenticationByUsername
"""
- def test_security_group_rule_prototype_security_group_rule_protocol_all_serialization(self):
+ def test_vpn_server_authentication_by_username_serialization(self):
"""
- Test serialization/deserialization for SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll
+ Test serialization/deserialization for VPNServerAuthenticationByUsername
"""
# Construct dict forms of any model objects needed in order to build this model.
- security_group_rule_remote_prototype_model = {} # SecurityGroupRuleRemotePrototypeIP
- security_group_rule_remote_prototype_model['address'] = '192.168.3.4'
+ vpn_server_authentication_by_username_id_provider_model = {} # VPNServerAuthenticationByUsernameIdProviderByIAM
+ vpn_server_authentication_by_username_id_provider_model['provider_type'] = 'iam'
- # Construct a json representation of a SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll model
- security_group_rule_prototype_security_group_rule_protocol_all_model_json = {}
- security_group_rule_prototype_security_group_rule_protocol_all_model_json['direction'] = 'inbound'
- security_group_rule_prototype_security_group_rule_protocol_all_model_json['ip_version'] = 'ipv4'
- security_group_rule_prototype_security_group_rule_protocol_all_model_json['protocol'] = 'all'
- security_group_rule_prototype_security_group_rule_protocol_all_model_json['remote'] = security_group_rule_remote_prototype_model
+ # Construct a json representation of a VPNServerAuthenticationByUsername model
+ vpn_server_authentication_by_username_model_json = {}
+ vpn_server_authentication_by_username_model_json['method'] = 'certificate'
+ vpn_server_authentication_by_username_model_json['identity_provider'] = vpn_server_authentication_by_username_id_provider_model
- # Construct a model instance of SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll by calling from_dict on the json representation
- security_group_rule_prototype_security_group_rule_protocol_all_model = SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll.from_dict(security_group_rule_prototype_security_group_rule_protocol_all_model_json)
- assert security_group_rule_prototype_security_group_rule_protocol_all_model != False
+ # Construct a model instance of VPNServerAuthenticationByUsername by calling from_dict on the json representation
+ vpn_server_authentication_by_username_model = VPNServerAuthenticationByUsername.from_dict(vpn_server_authentication_by_username_model_json)
+ assert vpn_server_authentication_by_username_model != False
- # Construct a model instance of SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll by calling from_dict on the json representation
- security_group_rule_prototype_security_group_rule_protocol_all_model_dict = SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll.from_dict(security_group_rule_prototype_security_group_rule_protocol_all_model_json).__dict__
- security_group_rule_prototype_security_group_rule_protocol_all_model2 = SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll(**security_group_rule_prototype_security_group_rule_protocol_all_model_dict)
+ # Construct a model instance of VPNServerAuthenticationByUsername by calling from_dict on the json representation
+ vpn_server_authentication_by_username_model_dict = VPNServerAuthenticationByUsername.from_dict(vpn_server_authentication_by_username_model_json).__dict__
+ vpn_server_authentication_by_username_model2 = VPNServerAuthenticationByUsername(**vpn_server_authentication_by_username_model_dict)
# Verify the model instances are equivalent
- assert security_group_rule_prototype_security_group_rule_protocol_all_model == security_group_rule_prototype_security_group_rule_protocol_all_model2
+ assert vpn_server_authentication_by_username_model == vpn_server_authentication_by_username_model2
# Convert model instance back to dict and verify no loss of data
- security_group_rule_prototype_security_group_rule_protocol_all_model_json2 = security_group_rule_prototype_security_group_rule_protocol_all_model.to_dict()
- assert security_group_rule_prototype_security_group_rule_protocol_all_model_json2 == security_group_rule_prototype_security_group_rule_protocol_all_model_json
+ vpn_server_authentication_by_username_model_json2 = vpn_server_authentication_by_username_model.to_dict()
+ assert vpn_server_authentication_by_username_model_json2 == vpn_server_authentication_by_username_model_json
-class TestModel_SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP:
+class TestModel_VPNServerAuthenticationByUsernameIdProviderByIAM:
"""
- Test Class for SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP
+ Test Class for VPNServerAuthenticationByUsernameIdProviderByIAM
"""
- def test_security_group_rule_prototype_security_group_rule_protocol_icmp_serialization(self):
+ def test_vpn_server_authentication_by_username_id_provider_by_iam_serialization(self):
"""
- Test serialization/deserialization for SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP
+ Test serialization/deserialization for VPNServerAuthenticationByUsernameIdProviderByIAM
"""
- # Construct dict forms of any model objects needed in order to build this model.
-
- security_group_rule_remote_prototype_model = {} # SecurityGroupRuleRemotePrototypeIP
- security_group_rule_remote_prototype_model['address'] = '192.168.3.4'
-
- # Construct a json representation of a SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP model
- security_group_rule_prototype_security_group_rule_protocol_icmp_model_json = {}
- security_group_rule_prototype_security_group_rule_protocol_icmp_model_json['code'] = 0
- security_group_rule_prototype_security_group_rule_protocol_icmp_model_json['direction'] = 'inbound'
- security_group_rule_prototype_security_group_rule_protocol_icmp_model_json['ip_version'] = 'ipv4'
- security_group_rule_prototype_security_group_rule_protocol_icmp_model_json['protocol'] = 'icmp'
- security_group_rule_prototype_security_group_rule_protocol_icmp_model_json['remote'] = security_group_rule_remote_prototype_model
- security_group_rule_prototype_security_group_rule_protocol_icmp_model_json['type'] = 8
+ # Construct a json representation of a VPNServerAuthenticationByUsernameIdProviderByIAM model
+ vpn_server_authentication_by_username_id_provider_by_iam_model_json = {}
+ vpn_server_authentication_by_username_id_provider_by_iam_model_json['provider_type'] = 'iam'
- # Construct a model instance of SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP by calling from_dict on the json representation
- security_group_rule_prototype_security_group_rule_protocol_icmp_model = SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP.from_dict(security_group_rule_prototype_security_group_rule_protocol_icmp_model_json)
- assert security_group_rule_prototype_security_group_rule_protocol_icmp_model != False
+ # Construct a model instance of VPNServerAuthenticationByUsernameIdProviderByIAM by calling from_dict on the json representation
+ vpn_server_authentication_by_username_id_provider_by_iam_model = VPNServerAuthenticationByUsernameIdProviderByIAM.from_dict(vpn_server_authentication_by_username_id_provider_by_iam_model_json)
+ assert vpn_server_authentication_by_username_id_provider_by_iam_model != False
- # Construct a model instance of SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP by calling from_dict on the json representation
- security_group_rule_prototype_security_group_rule_protocol_icmp_model_dict = SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP.from_dict(security_group_rule_prototype_security_group_rule_protocol_icmp_model_json).__dict__
- security_group_rule_prototype_security_group_rule_protocol_icmp_model2 = SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP(**security_group_rule_prototype_security_group_rule_protocol_icmp_model_dict)
+ # Construct a model instance of VPNServerAuthenticationByUsernameIdProviderByIAM by calling from_dict on the json representation
+ vpn_server_authentication_by_username_id_provider_by_iam_model_dict = VPNServerAuthenticationByUsernameIdProviderByIAM.from_dict(vpn_server_authentication_by_username_id_provider_by_iam_model_json).__dict__
+ vpn_server_authentication_by_username_id_provider_by_iam_model2 = VPNServerAuthenticationByUsernameIdProviderByIAM(**vpn_server_authentication_by_username_id_provider_by_iam_model_dict)
# Verify the model instances are equivalent
- assert security_group_rule_prototype_security_group_rule_protocol_icmp_model == security_group_rule_prototype_security_group_rule_protocol_icmp_model2
+ assert vpn_server_authentication_by_username_id_provider_by_iam_model == vpn_server_authentication_by_username_id_provider_by_iam_model2
# Convert model instance back to dict and verify no loss of data
- security_group_rule_prototype_security_group_rule_protocol_icmp_model_json2 = security_group_rule_prototype_security_group_rule_protocol_icmp_model.to_dict()
- assert security_group_rule_prototype_security_group_rule_protocol_icmp_model_json2 == security_group_rule_prototype_security_group_rule_protocol_icmp_model_json
+ vpn_server_authentication_by_username_id_provider_by_iam_model_json2 = vpn_server_authentication_by_username_id_provider_by_iam_model.to_dict()
+ assert vpn_server_authentication_by_username_id_provider_by_iam_model_json2 == vpn_server_authentication_by_username_id_provider_by_iam_model_json
-class TestModel_SecurityGroupRulePrototypeSecurityGroupRuleProtocolTCPUDP:
+class TestModel_VPNServerAuthenticationPrototypeVPNServerAuthenticationByCertificatePrototype:
"""
- Test Class for SecurityGroupRulePrototypeSecurityGroupRuleProtocolTCPUDP
+ Test Class for VPNServerAuthenticationPrototypeVPNServerAuthenticationByCertificatePrototype
"""
- def test_security_group_rule_prototype_security_group_rule_protocol_tcpudp_serialization(self):
+ def test_vpn_server_authentication_prototype_vpn_server_authentication_by_certificate_prototype_serialization(self):
"""
- Test serialization/deserialization for SecurityGroupRulePrototypeSecurityGroupRuleProtocolTCPUDP
+ Test serialization/deserialization for VPNServerAuthenticationPrototypeVPNServerAuthenticationByCertificatePrototype
"""
# Construct dict forms of any model objects needed in order to build this model.
- security_group_rule_remote_prototype_model = {} # SecurityGroupRuleRemotePrototypeIP
- security_group_rule_remote_prototype_model['address'] = '192.168.3.4'
+ certificate_instance_identity_model = {} # CertificateInstanceIdentityByCRN
+ certificate_instance_identity_model['crn'] = 'crn:v1:bluemix:public:secrets-manager:us-south:a/123456:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5'
- # Construct a json representation of a SecurityGroupRulePrototypeSecurityGroupRuleProtocolTCPUDP model
- security_group_rule_prototype_security_group_rule_protocol_tcpudp_model_json = {}
- security_group_rule_prototype_security_group_rule_protocol_tcpudp_model_json['direction'] = 'inbound'
- security_group_rule_prototype_security_group_rule_protocol_tcpudp_model_json['ip_version'] = 'ipv4'
- security_group_rule_prototype_security_group_rule_protocol_tcpudp_model_json['port_max'] = 22
- security_group_rule_prototype_security_group_rule_protocol_tcpudp_model_json['port_min'] = 22
- security_group_rule_prototype_security_group_rule_protocol_tcpudp_model_json['protocol'] = 'udp'
- security_group_rule_prototype_security_group_rule_protocol_tcpudp_model_json['remote'] = security_group_rule_remote_prototype_model
+ # Construct a json representation of a VPNServerAuthenticationPrototypeVPNServerAuthenticationByCertificatePrototype model
+ vpn_server_authentication_prototype_vpn_server_authentication_by_certificate_prototype_model_json = {}
+ vpn_server_authentication_prototype_vpn_server_authentication_by_certificate_prototype_model_json['method'] = 'certificate'
+ vpn_server_authentication_prototype_vpn_server_authentication_by_certificate_prototype_model_json['client_ca'] = certificate_instance_identity_model
+ vpn_server_authentication_prototype_vpn_server_authentication_by_certificate_prototype_model_json['crl'] = 'testString'
- # Construct a model instance of SecurityGroupRulePrototypeSecurityGroupRuleProtocolTCPUDP by calling from_dict on the json representation
- security_group_rule_prototype_security_group_rule_protocol_tcpudp_model = SecurityGroupRulePrototypeSecurityGroupRuleProtocolTCPUDP.from_dict(security_group_rule_prototype_security_group_rule_protocol_tcpudp_model_json)
- assert security_group_rule_prototype_security_group_rule_protocol_tcpudp_model != False
+ # Construct a model instance of VPNServerAuthenticationPrototypeVPNServerAuthenticationByCertificatePrototype by calling from_dict on the json representation
+ vpn_server_authentication_prototype_vpn_server_authentication_by_certificate_prototype_model = VPNServerAuthenticationPrototypeVPNServerAuthenticationByCertificatePrototype.from_dict(vpn_server_authentication_prototype_vpn_server_authentication_by_certificate_prototype_model_json)
+ assert vpn_server_authentication_prototype_vpn_server_authentication_by_certificate_prototype_model != False
- # Construct a model instance of SecurityGroupRulePrototypeSecurityGroupRuleProtocolTCPUDP by calling from_dict on the json representation
- security_group_rule_prototype_security_group_rule_protocol_tcpudp_model_dict = SecurityGroupRulePrototypeSecurityGroupRuleProtocolTCPUDP.from_dict(security_group_rule_prototype_security_group_rule_protocol_tcpudp_model_json).__dict__
- security_group_rule_prototype_security_group_rule_protocol_tcpudp_model2 = SecurityGroupRulePrototypeSecurityGroupRuleProtocolTCPUDP(**security_group_rule_prototype_security_group_rule_protocol_tcpudp_model_dict)
+ # Construct a model instance of VPNServerAuthenticationPrototypeVPNServerAuthenticationByCertificatePrototype by calling from_dict on the json representation
+ vpn_server_authentication_prototype_vpn_server_authentication_by_certificate_prototype_model_dict = VPNServerAuthenticationPrototypeVPNServerAuthenticationByCertificatePrototype.from_dict(vpn_server_authentication_prototype_vpn_server_authentication_by_certificate_prototype_model_json).__dict__
+ vpn_server_authentication_prototype_vpn_server_authentication_by_certificate_prototype_model2 = VPNServerAuthenticationPrototypeVPNServerAuthenticationByCertificatePrototype(**vpn_server_authentication_prototype_vpn_server_authentication_by_certificate_prototype_model_dict)
# Verify the model instances are equivalent
- assert security_group_rule_prototype_security_group_rule_protocol_tcpudp_model == security_group_rule_prototype_security_group_rule_protocol_tcpudp_model2
+ assert vpn_server_authentication_prototype_vpn_server_authentication_by_certificate_prototype_model == vpn_server_authentication_prototype_vpn_server_authentication_by_certificate_prototype_model2
# Convert model instance back to dict and verify no loss of data
- security_group_rule_prototype_security_group_rule_protocol_tcpudp_model_json2 = security_group_rule_prototype_security_group_rule_protocol_tcpudp_model.to_dict()
- assert security_group_rule_prototype_security_group_rule_protocol_tcpudp_model_json2 == security_group_rule_prototype_security_group_rule_protocol_tcpudp_model_json
+ vpn_server_authentication_prototype_vpn_server_authentication_by_certificate_prototype_model_json2 = vpn_server_authentication_prototype_vpn_server_authentication_by_certificate_prototype_model.to_dict()
+ assert vpn_server_authentication_prototype_vpn_server_authentication_by_certificate_prototype_model_json2 == vpn_server_authentication_prototype_vpn_server_authentication_by_certificate_prototype_model_json
-class TestModel_SecurityGroupRuleRemotePatchCIDR:
+class TestModel_VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype:
"""
- Test Class for SecurityGroupRuleRemotePatchCIDR
+ Test Class for VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype
"""
- def test_security_group_rule_remote_patch_cidr_serialization(self):
+ def test_vpn_server_authentication_prototype_vpn_server_authentication_by_username_prototype_serialization(self):
"""
- Test serialization/deserialization for SecurityGroupRuleRemotePatchCIDR
+ Test serialization/deserialization for VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype
"""
- # Construct a json representation of a SecurityGroupRuleRemotePatchCIDR model
- security_group_rule_remote_patch_cidr_model_json = {}
- security_group_rule_remote_patch_cidr_model_json['cidr_block'] = '192.168.3.0/24'
+ # Construct dict forms of any model objects needed in order to build this model.
- # Construct a model instance of SecurityGroupRuleRemotePatchCIDR by calling from_dict on the json representation
- security_group_rule_remote_patch_cidr_model = SecurityGroupRuleRemotePatchCIDR.from_dict(security_group_rule_remote_patch_cidr_model_json)
- assert security_group_rule_remote_patch_cidr_model != False
+ vpn_server_authentication_by_username_id_provider_model = {} # VPNServerAuthenticationByUsernameIdProviderByIAM
+ vpn_server_authentication_by_username_id_provider_model['provider_type'] = 'iam'
- # Construct a model instance of SecurityGroupRuleRemotePatchCIDR by calling from_dict on the json representation
- security_group_rule_remote_patch_cidr_model_dict = SecurityGroupRuleRemotePatchCIDR.from_dict(security_group_rule_remote_patch_cidr_model_json).__dict__
- security_group_rule_remote_patch_cidr_model2 = SecurityGroupRuleRemotePatchCIDR(**security_group_rule_remote_patch_cidr_model_dict)
+ # Construct a json representation of a VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype model
+ vpn_server_authentication_prototype_vpn_server_authentication_by_username_prototype_model_json = {}
+ vpn_server_authentication_prototype_vpn_server_authentication_by_username_prototype_model_json['method'] = 'username'
+ vpn_server_authentication_prototype_vpn_server_authentication_by_username_prototype_model_json['identity_provider'] = vpn_server_authentication_by_username_id_provider_model
+
+ # Construct a model instance of VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype by calling from_dict on the json representation
+ vpn_server_authentication_prototype_vpn_server_authentication_by_username_prototype_model = VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype.from_dict(vpn_server_authentication_prototype_vpn_server_authentication_by_username_prototype_model_json)
+ assert vpn_server_authentication_prototype_vpn_server_authentication_by_username_prototype_model != False
+
+ # Construct a model instance of VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype by calling from_dict on the json representation
+ vpn_server_authentication_prototype_vpn_server_authentication_by_username_prototype_model_dict = VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype.from_dict(vpn_server_authentication_prototype_vpn_server_authentication_by_username_prototype_model_json).__dict__
+ vpn_server_authentication_prototype_vpn_server_authentication_by_username_prototype_model2 = VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype(**vpn_server_authentication_prototype_vpn_server_authentication_by_username_prototype_model_dict)
# Verify the model instances are equivalent
- assert security_group_rule_remote_patch_cidr_model == security_group_rule_remote_patch_cidr_model2
+ assert vpn_server_authentication_prototype_vpn_server_authentication_by_username_prototype_model == vpn_server_authentication_prototype_vpn_server_authentication_by_username_prototype_model2
# Convert model instance back to dict and verify no loss of data
- security_group_rule_remote_patch_cidr_model_json2 = security_group_rule_remote_patch_cidr_model.to_dict()
- assert security_group_rule_remote_patch_cidr_model_json2 == security_group_rule_remote_patch_cidr_model_json
+ vpn_server_authentication_prototype_vpn_server_authentication_by_username_prototype_model_json2 = vpn_server_authentication_prototype_vpn_server_authentication_by_username_prototype_model.to_dict()
+ assert vpn_server_authentication_prototype_vpn_server_authentication_by_username_prototype_model_json2 == vpn_server_authentication_prototype_vpn_server_authentication_by_username_prototype_model_json
-class TestModel_SecurityGroupRuleRemotePatchIP:
+class TestModel_VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext:
"""
- Test Class for SecurityGroupRuleRemotePatchIP
+ Test Class for VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext
"""
- def test_security_group_rule_remote_patch_ip_serialization(self):
+ def test_virtual_network_interface_ip_prototype_reserved_ip_prototype_virtual_network_interface_i_ps_context_serialization(self):
"""
- Test serialization/deserialization for SecurityGroupRuleRemotePatchIP
+ Test serialization/deserialization for VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext
"""
- # Construct a json representation of a SecurityGroupRuleRemotePatchIP model
- security_group_rule_remote_patch_ip_model_json = {}
- security_group_rule_remote_patch_ip_model_json['address'] = '192.168.3.4'
+ # Construct a json representation of a VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext model
+ virtual_network_interface_ip_prototype_reserved_ip_prototype_virtual_network_interface_i_ps_context_model_json = {}
+ virtual_network_interface_ip_prototype_reserved_ip_prototype_virtual_network_interface_i_ps_context_model_json['address'] = '192.168.3.4'
+ virtual_network_interface_ip_prototype_reserved_ip_prototype_virtual_network_interface_i_ps_context_model_json['auto_delete'] = False
+ virtual_network_interface_ip_prototype_reserved_ip_prototype_virtual_network_interface_i_ps_context_model_json['name'] = 'my-reserved-ip'
- # Construct a model instance of SecurityGroupRuleRemotePatchIP by calling from_dict on the json representation
- security_group_rule_remote_patch_ip_model = SecurityGroupRuleRemotePatchIP.from_dict(security_group_rule_remote_patch_ip_model_json)
- assert security_group_rule_remote_patch_ip_model != False
+ # Construct a model instance of VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext by calling from_dict on the json representation
+ virtual_network_interface_ip_prototype_reserved_ip_prototype_virtual_network_interface_i_ps_context_model = VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext.from_dict(virtual_network_interface_ip_prototype_reserved_ip_prototype_virtual_network_interface_i_ps_context_model_json)
+ assert virtual_network_interface_ip_prototype_reserved_ip_prototype_virtual_network_interface_i_ps_context_model != False
- # Construct a model instance of SecurityGroupRuleRemotePatchIP by calling from_dict on the json representation
- security_group_rule_remote_patch_ip_model_dict = SecurityGroupRuleRemotePatchIP.from_dict(security_group_rule_remote_patch_ip_model_json).__dict__
- security_group_rule_remote_patch_ip_model2 = SecurityGroupRuleRemotePatchIP(**security_group_rule_remote_patch_ip_model_dict)
+ # Construct a model instance of VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext by calling from_dict on the json representation
+ virtual_network_interface_ip_prototype_reserved_ip_prototype_virtual_network_interface_i_ps_context_model_dict = VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext.from_dict(virtual_network_interface_ip_prototype_reserved_ip_prototype_virtual_network_interface_i_ps_context_model_json).__dict__
+ virtual_network_interface_ip_prototype_reserved_ip_prototype_virtual_network_interface_i_ps_context_model2 = VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext(**virtual_network_interface_ip_prototype_reserved_ip_prototype_virtual_network_interface_i_ps_context_model_dict)
# Verify the model instances are equivalent
- assert security_group_rule_remote_patch_ip_model == security_group_rule_remote_patch_ip_model2
+ assert virtual_network_interface_ip_prototype_reserved_ip_prototype_virtual_network_interface_i_ps_context_model == virtual_network_interface_ip_prototype_reserved_ip_prototype_virtual_network_interface_i_ps_context_model2
# Convert model instance back to dict and verify no loss of data
- security_group_rule_remote_patch_ip_model_json2 = security_group_rule_remote_patch_ip_model.to_dict()
- assert security_group_rule_remote_patch_ip_model_json2 == security_group_rule_remote_patch_ip_model_json
+ virtual_network_interface_ip_prototype_reserved_ip_prototype_virtual_network_interface_i_ps_context_model_json2 = virtual_network_interface_ip_prototype_reserved_ip_prototype_virtual_network_interface_i_ps_context_model.to_dict()
+ assert virtual_network_interface_ip_prototype_reserved_ip_prototype_virtual_network_interface_i_ps_context_model_json2 == virtual_network_interface_ip_prototype_reserved_ip_prototype_virtual_network_interface_i_ps_context_model_json
-class TestModel_SecurityGroupRuleRemotePrototypeCIDR:
+class TestModel_VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext:
"""
- Test Class for SecurityGroupRuleRemotePrototypeCIDR
+ Test Class for VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext
"""
- def test_security_group_rule_remote_prototype_cidr_serialization(self):
+ def test_virtual_network_interface_primary_ip_prototype_reserved_ip_prototype_virtual_network_interface_primary_ip_context_serialization(self):
"""
- Test serialization/deserialization for SecurityGroupRuleRemotePrototypeCIDR
+ Test serialization/deserialization for VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext
"""
- # Construct a json representation of a SecurityGroupRuleRemotePrototypeCIDR model
- security_group_rule_remote_prototype_cidr_model_json = {}
- security_group_rule_remote_prototype_cidr_model_json['cidr_block'] = '192.168.3.0/24'
+ # Construct a json representation of a VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext model
+ virtual_network_interface_primary_ip_prototype_reserved_ip_prototype_virtual_network_interface_primary_ip_context_model_json = {}
+ virtual_network_interface_primary_ip_prototype_reserved_ip_prototype_virtual_network_interface_primary_ip_context_model_json['address'] = '192.168.3.4'
+ virtual_network_interface_primary_ip_prototype_reserved_ip_prototype_virtual_network_interface_primary_ip_context_model_json['auto_delete'] = False
+ virtual_network_interface_primary_ip_prototype_reserved_ip_prototype_virtual_network_interface_primary_ip_context_model_json['name'] = 'my-reserved-ip'
- # Construct a model instance of SecurityGroupRuleRemotePrototypeCIDR by calling from_dict on the json representation
- security_group_rule_remote_prototype_cidr_model = SecurityGroupRuleRemotePrototypeCIDR.from_dict(security_group_rule_remote_prototype_cidr_model_json)
- assert security_group_rule_remote_prototype_cidr_model != False
+ # Construct a model instance of VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext by calling from_dict on the json representation
+ virtual_network_interface_primary_ip_prototype_reserved_ip_prototype_virtual_network_interface_primary_ip_context_model = VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext.from_dict(virtual_network_interface_primary_ip_prototype_reserved_ip_prototype_virtual_network_interface_primary_ip_context_model_json)
+ assert virtual_network_interface_primary_ip_prototype_reserved_ip_prototype_virtual_network_interface_primary_ip_context_model != False
- # Construct a model instance of SecurityGroupRuleRemotePrototypeCIDR by calling from_dict on the json representation
- security_group_rule_remote_prototype_cidr_model_dict = SecurityGroupRuleRemotePrototypeCIDR.from_dict(security_group_rule_remote_prototype_cidr_model_json).__dict__
- security_group_rule_remote_prototype_cidr_model2 = SecurityGroupRuleRemotePrototypeCIDR(**security_group_rule_remote_prototype_cidr_model_dict)
+ # Construct a model instance of VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext by calling from_dict on the json representation
+ virtual_network_interface_primary_ip_prototype_reserved_ip_prototype_virtual_network_interface_primary_ip_context_model_dict = VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext.from_dict(virtual_network_interface_primary_ip_prototype_reserved_ip_prototype_virtual_network_interface_primary_ip_context_model_json).__dict__
+ virtual_network_interface_primary_ip_prototype_reserved_ip_prototype_virtual_network_interface_primary_ip_context_model2 = VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext(**virtual_network_interface_primary_ip_prototype_reserved_ip_prototype_virtual_network_interface_primary_ip_context_model_dict)
# Verify the model instances are equivalent
- assert security_group_rule_remote_prototype_cidr_model == security_group_rule_remote_prototype_cidr_model2
+ assert virtual_network_interface_primary_ip_prototype_reserved_ip_prototype_virtual_network_interface_primary_ip_context_model == virtual_network_interface_primary_ip_prototype_reserved_ip_prototype_virtual_network_interface_primary_ip_context_model2
# Convert model instance back to dict and verify no loss of data
- security_group_rule_remote_prototype_cidr_model_json2 = security_group_rule_remote_prototype_cidr_model.to_dict()
- assert security_group_rule_remote_prototype_cidr_model_json2 == security_group_rule_remote_prototype_cidr_model_json
+ virtual_network_interface_primary_ip_prototype_reserved_ip_prototype_virtual_network_interface_primary_ip_context_model_json2 = virtual_network_interface_primary_ip_prototype_reserved_ip_prototype_virtual_network_interface_primary_ip_context_model.to_dict()
+ assert virtual_network_interface_primary_ip_prototype_reserved_ip_prototype_virtual_network_interface_primary_ip_context_model_json2 == virtual_network_interface_primary_ip_prototype_reserved_ip_prototype_virtual_network_interface_primary_ip_context_model_json
-class TestModel_SecurityGroupRuleRemotePrototypeIP:
+class TestModel_VirtualNetworkInterfaceTargetBareMetalServerNetworkAttachmentReferenceVirtualNetworkInterfaceContext:
"""
- Test Class for SecurityGroupRuleRemotePrototypeIP
+ Test Class for VirtualNetworkInterfaceTargetBareMetalServerNetworkAttachmentReferenceVirtualNetworkInterfaceContext
"""
- def test_security_group_rule_remote_prototype_ip_serialization(self):
+ def test_virtual_network_interface_target_bare_metal_server_network_attachment_reference_virtual_network_interface_context_serialization(self):
"""
- Test serialization/deserialization for SecurityGroupRuleRemotePrototypeIP
+ Test serialization/deserialization for VirtualNetworkInterfaceTargetBareMetalServerNetworkAttachmentReferenceVirtualNetworkInterfaceContext
"""
- # Construct a json representation of a SecurityGroupRuleRemotePrototypeIP model
- security_group_rule_remote_prototype_ip_model_json = {}
- security_group_rule_remote_prototype_ip_model_json['address'] = '192.168.3.4'
+ # Construct a json representation of a VirtualNetworkInterfaceTargetBareMetalServerNetworkAttachmentReferenceVirtualNetworkInterfaceContext model
+ virtual_network_interface_target_bare_metal_server_network_attachment_reference_virtual_network_interface_context_model_json = {}
+ virtual_network_interface_target_bare_metal_server_network_attachment_reference_virtual_network_interface_context_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/2302-f7a2bf57-af7c-49d9-b599-b2c91293d30c/network_attachments/2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6'
+ virtual_network_interface_target_bare_metal_server_network_attachment_reference_virtual_network_interface_context_model_json['id'] = '2302-da8c43ec-b6ca-4bd2-871e-72e288c66ee6'
+ virtual_network_interface_target_bare_metal_server_network_attachment_reference_virtual_network_interface_context_model_json['name'] = 'my-bare-metal-server-network-attachment'
+ virtual_network_interface_target_bare_metal_server_network_attachment_reference_virtual_network_interface_context_model_json['resource_type'] = 'bare_metal_server_network_attachment'
- # Construct a model instance of SecurityGroupRuleRemotePrototypeIP by calling from_dict on the json representation
- security_group_rule_remote_prototype_ip_model = SecurityGroupRuleRemotePrototypeIP.from_dict(security_group_rule_remote_prototype_ip_model_json)
- assert security_group_rule_remote_prototype_ip_model != False
+ # Construct a model instance of VirtualNetworkInterfaceTargetBareMetalServerNetworkAttachmentReferenceVirtualNetworkInterfaceContext by calling from_dict on the json representation
+ virtual_network_interface_target_bare_metal_server_network_attachment_reference_virtual_network_interface_context_model = VirtualNetworkInterfaceTargetBareMetalServerNetworkAttachmentReferenceVirtualNetworkInterfaceContext.from_dict(virtual_network_interface_target_bare_metal_server_network_attachment_reference_virtual_network_interface_context_model_json)
+ assert virtual_network_interface_target_bare_metal_server_network_attachment_reference_virtual_network_interface_context_model != False
- # Construct a model instance of SecurityGroupRuleRemotePrototypeIP by calling from_dict on the json representation
- security_group_rule_remote_prototype_ip_model_dict = SecurityGroupRuleRemotePrototypeIP.from_dict(security_group_rule_remote_prototype_ip_model_json).__dict__
- security_group_rule_remote_prototype_ip_model2 = SecurityGroupRuleRemotePrototypeIP(**security_group_rule_remote_prototype_ip_model_dict)
+ # Construct a model instance of VirtualNetworkInterfaceTargetBareMetalServerNetworkAttachmentReferenceVirtualNetworkInterfaceContext by calling from_dict on the json representation
+ virtual_network_interface_target_bare_metal_server_network_attachment_reference_virtual_network_interface_context_model_dict = VirtualNetworkInterfaceTargetBareMetalServerNetworkAttachmentReferenceVirtualNetworkInterfaceContext.from_dict(virtual_network_interface_target_bare_metal_server_network_attachment_reference_virtual_network_interface_context_model_json).__dict__
+ virtual_network_interface_target_bare_metal_server_network_attachment_reference_virtual_network_interface_context_model2 = VirtualNetworkInterfaceTargetBareMetalServerNetworkAttachmentReferenceVirtualNetworkInterfaceContext(**virtual_network_interface_target_bare_metal_server_network_attachment_reference_virtual_network_interface_context_model_dict)
# Verify the model instances are equivalent
- assert security_group_rule_remote_prototype_ip_model == security_group_rule_remote_prototype_ip_model2
+ assert virtual_network_interface_target_bare_metal_server_network_attachment_reference_virtual_network_interface_context_model == virtual_network_interface_target_bare_metal_server_network_attachment_reference_virtual_network_interface_context_model2
# Convert model instance back to dict and verify no loss of data
- security_group_rule_remote_prototype_ip_model_json2 = security_group_rule_remote_prototype_ip_model.to_dict()
- assert security_group_rule_remote_prototype_ip_model_json2 == security_group_rule_remote_prototype_ip_model_json
+ virtual_network_interface_target_bare_metal_server_network_attachment_reference_virtual_network_interface_context_model_json2 = virtual_network_interface_target_bare_metal_server_network_attachment_reference_virtual_network_interface_context_model.to_dict()
+ assert virtual_network_interface_target_bare_metal_server_network_attachment_reference_virtual_network_interface_context_model_json2 == virtual_network_interface_target_bare_metal_server_network_attachment_reference_virtual_network_interface_context_model_json
-class TestModel_SecurityGroupRuleRemoteCIDR:
+class TestModel_VirtualNetworkInterfaceTargetInstanceNetworkAttachmentReferenceVirtualNetworkInterfaceContext:
"""
- Test Class for SecurityGroupRuleRemoteCIDR
+ Test Class for VirtualNetworkInterfaceTargetInstanceNetworkAttachmentReferenceVirtualNetworkInterfaceContext
"""
- def test_security_group_rule_remote_cidr_serialization(self):
+ def test_virtual_network_interface_target_instance_network_attachment_reference_virtual_network_interface_context_serialization(self):
"""
- Test serialization/deserialization for SecurityGroupRuleRemoteCIDR
+ Test serialization/deserialization for VirtualNetworkInterfaceTargetInstanceNetworkAttachmentReferenceVirtualNetworkInterfaceContext
"""
- # Construct a json representation of a SecurityGroupRuleRemoteCIDR model
- security_group_rule_remote_cidr_model_json = {}
- security_group_rule_remote_cidr_model_json['cidr_block'] = '192.168.3.0/24'
+ # Construct a json representation of a VirtualNetworkInterfaceTargetInstanceNetworkAttachmentReferenceVirtualNetworkInterfaceContext model
+ virtual_network_interface_target_instance_network_attachment_reference_virtual_network_interface_context_model_json = {}
+ virtual_network_interface_target_instance_network_attachment_reference_virtual_network_interface_context_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/5dd61d72-acaa-47c2-a336-3d849660d010/network_attachments/0767-d54eb633-98ea-459d-aa00-6a8e780175a7'
+ virtual_network_interface_target_instance_network_attachment_reference_virtual_network_interface_context_model_json['id'] = '0767-d54eb633-98ea-459d-aa00-6a8e780175a7'
+ virtual_network_interface_target_instance_network_attachment_reference_virtual_network_interface_context_model_json['name'] = 'my-instance-network-attachment'
+ virtual_network_interface_target_instance_network_attachment_reference_virtual_network_interface_context_model_json['resource_type'] = 'instance_network_attachment'
- # Construct a model instance of SecurityGroupRuleRemoteCIDR by calling from_dict on the json representation
- security_group_rule_remote_cidr_model = SecurityGroupRuleRemoteCIDR.from_dict(security_group_rule_remote_cidr_model_json)
- assert security_group_rule_remote_cidr_model != False
+ # Construct a model instance of VirtualNetworkInterfaceTargetInstanceNetworkAttachmentReferenceVirtualNetworkInterfaceContext by calling from_dict on the json representation
+ virtual_network_interface_target_instance_network_attachment_reference_virtual_network_interface_context_model = VirtualNetworkInterfaceTargetInstanceNetworkAttachmentReferenceVirtualNetworkInterfaceContext.from_dict(virtual_network_interface_target_instance_network_attachment_reference_virtual_network_interface_context_model_json)
+ assert virtual_network_interface_target_instance_network_attachment_reference_virtual_network_interface_context_model != False
- # Construct a model instance of SecurityGroupRuleRemoteCIDR by calling from_dict on the json representation
- security_group_rule_remote_cidr_model_dict = SecurityGroupRuleRemoteCIDR.from_dict(security_group_rule_remote_cidr_model_json).__dict__
- security_group_rule_remote_cidr_model2 = SecurityGroupRuleRemoteCIDR(**security_group_rule_remote_cidr_model_dict)
+ # Construct a model instance of VirtualNetworkInterfaceTargetInstanceNetworkAttachmentReferenceVirtualNetworkInterfaceContext by calling from_dict on the json representation
+ virtual_network_interface_target_instance_network_attachment_reference_virtual_network_interface_context_model_dict = VirtualNetworkInterfaceTargetInstanceNetworkAttachmentReferenceVirtualNetworkInterfaceContext.from_dict(virtual_network_interface_target_instance_network_attachment_reference_virtual_network_interface_context_model_json).__dict__
+ virtual_network_interface_target_instance_network_attachment_reference_virtual_network_interface_context_model2 = VirtualNetworkInterfaceTargetInstanceNetworkAttachmentReferenceVirtualNetworkInterfaceContext(**virtual_network_interface_target_instance_network_attachment_reference_virtual_network_interface_context_model_dict)
# Verify the model instances are equivalent
- assert security_group_rule_remote_cidr_model == security_group_rule_remote_cidr_model2
+ assert virtual_network_interface_target_instance_network_attachment_reference_virtual_network_interface_context_model == virtual_network_interface_target_instance_network_attachment_reference_virtual_network_interface_context_model2
# Convert model instance back to dict and verify no loss of data
- security_group_rule_remote_cidr_model_json2 = security_group_rule_remote_cidr_model.to_dict()
- assert security_group_rule_remote_cidr_model_json2 == security_group_rule_remote_cidr_model_json
+ virtual_network_interface_target_instance_network_attachment_reference_virtual_network_interface_context_model_json2 = virtual_network_interface_target_instance_network_attachment_reference_virtual_network_interface_context_model.to_dict()
+ assert virtual_network_interface_target_instance_network_attachment_reference_virtual_network_interface_context_model_json2 == virtual_network_interface_target_instance_network_attachment_reference_virtual_network_interface_context_model_json
-class TestModel_SecurityGroupRuleRemoteIP:
+class TestModel_VirtualNetworkInterfaceTargetShareMountTargetReference:
"""
- Test Class for SecurityGroupRuleRemoteIP
+ Test Class for VirtualNetworkInterfaceTargetShareMountTargetReference
"""
- def test_security_group_rule_remote_ip_serialization(self):
+ def test_virtual_network_interface_target_share_mount_target_reference_serialization(self):
"""
- Test serialization/deserialization for SecurityGroupRuleRemoteIP
+ Test serialization/deserialization for VirtualNetworkInterfaceTargetShareMountTargetReference
"""
- # Construct a json representation of a SecurityGroupRuleRemoteIP model
- security_group_rule_remote_ip_model_json = {}
- security_group_rule_remote_ip_model_json['address'] = '192.168.3.4'
+ # Construct dict forms of any model objects needed in order to build this model.
- # Construct a model instance of SecurityGroupRuleRemoteIP by calling from_dict on the json representation
- security_group_rule_remote_ip_model = SecurityGroupRuleRemoteIP.from_dict(security_group_rule_remote_ip_model_json)
- assert security_group_rule_remote_ip_model != False
+ share_mount_target_reference_deleted_model = {} # ShareMountTargetReferenceDeleted
+ share_mount_target_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Construct a model instance of SecurityGroupRuleRemoteIP by calling from_dict on the json representation
- security_group_rule_remote_ip_model_dict = SecurityGroupRuleRemoteIP.from_dict(security_group_rule_remote_ip_model_json).__dict__
- security_group_rule_remote_ip_model2 = SecurityGroupRuleRemoteIP(**security_group_rule_remote_ip_model_dict)
+ # Construct a json representation of a VirtualNetworkInterfaceTargetShareMountTargetReference model
+ virtual_network_interface_target_share_mount_target_reference_model_json = {}
+ virtual_network_interface_target_share_mount_target_reference_model_json['deleted'] = share_mount_target_reference_deleted_model
+ virtual_network_interface_target_share_mount_target_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c'
+ virtual_network_interface_target_share_mount_target_reference_model_json['id'] = '4cf9171a-0043-4434-8727-15b53dbc374c'
+ virtual_network_interface_target_share_mount_target_reference_model_json['name'] = 'my-share-mount-target'
+ virtual_network_interface_target_share_mount_target_reference_model_json['resource_type'] = 'share_mount_target'
+
+ # Construct a model instance of VirtualNetworkInterfaceTargetShareMountTargetReference by calling from_dict on the json representation
+ virtual_network_interface_target_share_mount_target_reference_model = VirtualNetworkInterfaceTargetShareMountTargetReference.from_dict(virtual_network_interface_target_share_mount_target_reference_model_json)
+ assert virtual_network_interface_target_share_mount_target_reference_model != False
+
+ # Construct a model instance of VirtualNetworkInterfaceTargetShareMountTargetReference by calling from_dict on the json representation
+ virtual_network_interface_target_share_mount_target_reference_model_dict = VirtualNetworkInterfaceTargetShareMountTargetReference.from_dict(virtual_network_interface_target_share_mount_target_reference_model_json).__dict__
+ virtual_network_interface_target_share_mount_target_reference_model2 = VirtualNetworkInterfaceTargetShareMountTargetReference(**virtual_network_interface_target_share_mount_target_reference_model_dict)
# Verify the model instances are equivalent
- assert security_group_rule_remote_ip_model == security_group_rule_remote_ip_model2
+ assert virtual_network_interface_target_share_mount_target_reference_model == virtual_network_interface_target_share_mount_target_reference_model2
# Convert model instance back to dict and verify no loss of data
- security_group_rule_remote_ip_model_json2 = security_group_rule_remote_ip_model.to_dict()
- assert security_group_rule_remote_ip_model_json2 == security_group_rule_remote_ip_model_json
+ virtual_network_interface_target_share_mount_target_reference_model_json2 = virtual_network_interface_target_share_mount_target_reference_model.to_dict()
+ assert virtual_network_interface_target_share_mount_target_reference_model_json2 == virtual_network_interface_target_share_mount_target_reference_model_json
-class TestModel_SecurityGroupRuleRemoteSecurityGroupReference:
+class TestModel_VolumeIdentityByCRN:
"""
- Test Class for SecurityGroupRuleRemoteSecurityGroupReference
+ Test Class for VolumeIdentityByCRN
"""
- def test_security_group_rule_remote_security_group_reference_serialization(self):
+ def test_volume_identity_by_crn_serialization(self):
"""
- Test serialization/deserialization for SecurityGroupRuleRemoteSecurityGroupReference
+ Test serialization/deserialization for VolumeIdentityByCRN
"""
- # 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 SecurityGroupRuleRemoteSecurityGroupReference model
- security_group_rule_remote_security_group_reference_model_json = {}
- security_group_rule_remote_security_group_reference_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271'
- security_group_rule_remote_security_group_reference_model_json['deleted'] = security_group_reference_deleted_model
- security_group_rule_remote_security_group_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271'
- security_group_rule_remote_security_group_reference_model_json['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271'
- security_group_rule_remote_security_group_reference_model_json['name'] = 'my-security-group'
+ # Construct a json representation of a VolumeIdentityByCRN model
+ volume_identity_by_crn_model_json = {}
+ volume_identity_by_crn_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
- # Construct a model instance of SecurityGroupRuleRemoteSecurityGroupReference by calling from_dict on the json representation
- security_group_rule_remote_security_group_reference_model = SecurityGroupRuleRemoteSecurityGroupReference.from_dict(security_group_rule_remote_security_group_reference_model_json)
- assert security_group_rule_remote_security_group_reference_model != False
+ # Construct a model instance of VolumeIdentityByCRN by calling from_dict on the json representation
+ volume_identity_by_crn_model = VolumeIdentityByCRN.from_dict(volume_identity_by_crn_model_json)
+ assert volume_identity_by_crn_model != False
- # Construct a model instance of SecurityGroupRuleRemoteSecurityGroupReference by calling from_dict on the json representation
- security_group_rule_remote_security_group_reference_model_dict = SecurityGroupRuleRemoteSecurityGroupReference.from_dict(security_group_rule_remote_security_group_reference_model_json).__dict__
- security_group_rule_remote_security_group_reference_model2 = SecurityGroupRuleRemoteSecurityGroupReference(**security_group_rule_remote_security_group_reference_model_dict)
+ # Construct a model instance of VolumeIdentityByCRN by calling from_dict on the json representation
+ volume_identity_by_crn_model_dict = VolumeIdentityByCRN.from_dict(volume_identity_by_crn_model_json).__dict__
+ volume_identity_by_crn_model2 = VolumeIdentityByCRN(**volume_identity_by_crn_model_dict)
# Verify the model instances are equivalent
- assert security_group_rule_remote_security_group_reference_model == security_group_rule_remote_security_group_reference_model2
+ assert volume_identity_by_crn_model == volume_identity_by_crn_model2
# Convert model instance back to dict and verify no loss of data
- security_group_rule_remote_security_group_reference_model_json2 = security_group_rule_remote_security_group_reference_model.to_dict()
- assert security_group_rule_remote_security_group_reference_model_json2 == security_group_rule_remote_security_group_reference_model_json
+ volume_identity_by_crn_model_json2 = volume_identity_by_crn_model.to_dict()
+ assert volume_identity_by_crn_model_json2 == volume_identity_by_crn_model_json
-class TestModel_SecurityGroupRuleSecurityGroupRuleProtocolAll:
+class TestModel_VolumeIdentityByHref:
"""
- Test Class for SecurityGroupRuleSecurityGroupRuleProtocolAll
+ Test Class for VolumeIdentityByHref
"""
- def test_security_group_rule_security_group_rule_protocol_all_serialization(self):
+ def test_volume_identity_by_href_serialization(self):
"""
- Test serialization/deserialization for SecurityGroupRuleSecurityGroupRuleProtocolAll
+ Test serialization/deserialization for VolumeIdentityByHref
"""
- # 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'
-
- # Construct a json representation of a SecurityGroupRuleSecurityGroupRuleProtocolAll model
- security_group_rule_security_group_rule_protocol_all_model_json = {}
- security_group_rule_security_group_rule_protocol_all_model_json['direction'] = 'inbound'
- security_group_rule_security_group_rule_protocol_all_model_json['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_security_group_rule_protocol_all_model_json['id'] = '6f2a6efe-21e2-401c-b237-620aa26ba16a'
- security_group_rule_security_group_rule_protocol_all_model_json['ip_version'] = 'ipv4'
- security_group_rule_security_group_rule_protocol_all_model_json['remote'] = security_group_rule_remote_model
- security_group_rule_security_group_rule_protocol_all_model_json['protocol'] = 'all'
+ # Construct a json representation of a VolumeIdentityByHref model
+ volume_identity_by_href_model_json = {}
+ volume_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
- # Construct a model instance of SecurityGroupRuleSecurityGroupRuleProtocolAll by calling from_dict on the json representation
- security_group_rule_security_group_rule_protocol_all_model = SecurityGroupRuleSecurityGroupRuleProtocolAll.from_dict(security_group_rule_security_group_rule_protocol_all_model_json)
- assert security_group_rule_security_group_rule_protocol_all_model != False
+ # Construct a model instance of VolumeIdentityByHref by calling from_dict on the json representation
+ volume_identity_by_href_model = VolumeIdentityByHref.from_dict(volume_identity_by_href_model_json)
+ assert volume_identity_by_href_model != False
- # Construct a model instance of SecurityGroupRuleSecurityGroupRuleProtocolAll by calling from_dict on the json representation
- security_group_rule_security_group_rule_protocol_all_model_dict = SecurityGroupRuleSecurityGroupRuleProtocolAll.from_dict(security_group_rule_security_group_rule_protocol_all_model_json).__dict__
- security_group_rule_security_group_rule_protocol_all_model2 = SecurityGroupRuleSecurityGroupRuleProtocolAll(**security_group_rule_security_group_rule_protocol_all_model_dict)
+ # Construct a model instance of VolumeIdentityByHref by calling from_dict on the json representation
+ volume_identity_by_href_model_dict = VolumeIdentityByHref.from_dict(volume_identity_by_href_model_json).__dict__
+ volume_identity_by_href_model2 = VolumeIdentityByHref(**volume_identity_by_href_model_dict)
# Verify the model instances are equivalent
- assert security_group_rule_security_group_rule_protocol_all_model == security_group_rule_security_group_rule_protocol_all_model2
+ assert volume_identity_by_href_model == volume_identity_by_href_model2
# Convert model instance back to dict and verify no loss of data
- security_group_rule_security_group_rule_protocol_all_model_json2 = security_group_rule_security_group_rule_protocol_all_model.to_dict()
- assert security_group_rule_security_group_rule_protocol_all_model_json2 == security_group_rule_security_group_rule_protocol_all_model_json
+ volume_identity_by_href_model_json2 = volume_identity_by_href_model.to_dict()
+ assert volume_identity_by_href_model_json2 == volume_identity_by_href_model_json
-class TestModel_SecurityGroupRuleSecurityGroupRuleProtocolICMP:
+class TestModel_VolumeIdentityById:
"""
- Test Class for SecurityGroupRuleSecurityGroupRuleProtocolICMP
+ Test Class for VolumeIdentityById
"""
- def test_security_group_rule_security_group_rule_protocol_icmp_serialization(self):
+ def test_volume_identity_by_id_serialization(self):
"""
- Test serialization/deserialization for SecurityGroupRuleSecurityGroupRuleProtocolICMP
+ Test serialization/deserialization for VolumeIdentityById
"""
- # 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'
-
- # Construct a json representation of a SecurityGroupRuleSecurityGroupRuleProtocolICMP model
- security_group_rule_security_group_rule_protocol_icmp_model_json = {}
- security_group_rule_security_group_rule_protocol_icmp_model_json['direction'] = 'inbound'
- security_group_rule_security_group_rule_protocol_icmp_model_json['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_security_group_rule_protocol_icmp_model_json['id'] = '6f2a6efe-21e2-401c-b237-620aa26ba16a'
- security_group_rule_security_group_rule_protocol_icmp_model_json['ip_version'] = 'ipv4'
- security_group_rule_security_group_rule_protocol_icmp_model_json['remote'] = security_group_rule_remote_model
- security_group_rule_security_group_rule_protocol_icmp_model_json['code'] = 0
- security_group_rule_security_group_rule_protocol_icmp_model_json['protocol'] = 'icmp'
- security_group_rule_security_group_rule_protocol_icmp_model_json['type'] = 8
+ # Construct a json representation of a VolumeIdentityById model
+ volume_identity_by_id_model_json = {}
+ volume_identity_by_id_model_json['id'] = '1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
- # Construct a model instance of SecurityGroupRuleSecurityGroupRuleProtocolICMP by calling from_dict on the json representation
- security_group_rule_security_group_rule_protocol_icmp_model = SecurityGroupRuleSecurityGroupRuleProtocolICMP.from_dict(security_group_rule_security_group_rule_protocol_icmp_model_json)
- assert security_group_rule_security_group_rule_protocol_icmp_model != False
+ # Construct a model instance of VolumeIdentityById by calling from_dict on the json representation
+ volume_identity_by_id_model = VolumeIdentityById.from_dict(volume_identity_by_id_model_json)
+ assert volume_identity_by_id_model != False
- # Construct a model instance of SecurityGroupRuleSecurityGroupRuleProtocolICMP by calling from_dict on the json representation
- security_group_rule_security_group_rule_protocol_icmp_model_dict = SecurityGroupRuleSecurityGroupRuleProtocolICMP.from_dict(security_group_rule_security_group_rule_protocol_icmp_model_json).__dict__
- security_group_rule_security_group_rule_protocol_icmp_model2 = SecurityGroupRuleSecurityGroupRuleProtocolICMP(**security_group_rule_security_group_rule_protocol_icmp_model_dict)
+ # Construct a model instance of VolumeIdentityById by calling from_dict on the json representation
+ volume_identity_by_id_model_dict = VolumeIdentityById.from_dict(volume_identity_by_id_model_json).__dict__
+ volume_identity_by_id_model2 = VolumeIdentityById(**volume_identity_by_id_model_dict)
# Verify the model instances are equivalent
- assert security_group_rule_security_group_rule_protocol_icmp_model == security_group_rule_security_group_rule_protocol_icmp_model2
+ assert volume_identity_by_id_model == volume_identity_by_id_model2
# Convert model instance back to dict and verify no loss of data
- security_group_rule_security_group_rule_protocol_icmp_model_json2 = security_group_rule_security_group_rule_protocol_icmp_model.to_dict()
- assert security_group_rule_security_group_rule_protocol_icmp_model_json2 == security_group_rule_security_group_rule_protocol_icmp_model_json
+ volume_identity_by_id_model_json2 = volume_identity_by_id_model.to_dict()
+ assert volume_identity_by_id_model_json2 == volume_identity_by_id_model_json
-class TestModel_SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP:
+class TestModel_VolumeProfileIdentityByHref:
"""
- Test Class for SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP
+ Test Class for VolumeProfileIdentityByHref
"""
- def test_security_group_rule_security_group_rule_protocol_tcpudp_serialization(self):
+ def test_volume_profile_identity_by_href_serialization(self):
"""
- Test serialization/deserialization for SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP
+ Test serialization/deserialization for VolumeProfileIdentityByHref
"""
- # 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'
-
- # Construct a json representation of a SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP model
- security_group_rule_security_group_rule_protocol_tcpudp_model_json = {}
- security_group_rule_security_group_rule_protocol_tcpudp_model_json['direction'] = 'inbound'
- security_group_rule_security_group_rule_protocol_tcpudp_model_json['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_security_group_rule_protocol_tcpudp_model_json['id'] = '6f2a6efe-21e2-401c-b237-620aa26ba16a'
- security_group_rule_security_group_rule_protocol_tcpudp_model_json['ip_version'] = 'ipv4'
- security_group_rule_security_group_rule_protocol_tcpudp_model_json['remote'] = security_group_rule_remote_model
- security_group_rule_security_group_rule_protocol_tcpudp_model_json['port_max'] = 22
- security_group_rule_security_group_rule_protocol_tcpudp_model_json['port_min'] = 22
- security_group_rule_security_group_rule_protocol_tcpudp_model_json['protocol'] = 'udp'
+ # Construct a json representation of a VolumeProfileIdentityByHref model
+ volume_profile_identity_by_href_model_json = {}
+ volume_profile_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose'
- # Construct a model instance of SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP by calling from_dict on the json representation
- security_group_rule_security_group_rule_protocol_tcpudp_model = SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP.from_dict(security_group_rule_security_group_rule_protocol_tcpudp_model_json)
- assert security_group_rule_security_group_rule_protocol_tcpudp_model != False
+ # Construct a model instance of VolumeProfileIdentityByHref by calling from_dict on the json representation
+ volume_profile_identity_by_href_model = VolumeProfileIdentityByHref.from_dict(volume_profile_identity_by_href_model_json)
+ assert volume_profile_identity_by_href_model != False
- # Construct a model instance of SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP by calling from_dict on the json representation
- security_group_rule_security_group_rule_protocol_tcpudp_model_dict = SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP.from_dict(security_group_rule_security_group_rule_protocol_tcpudp_model_json).__dict__
- security_group_rule_security_group_rule_protocol_tcpudp_model2 = SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP(**security_group_rule_security_group_rule_protocol_tcpudp_model_dict)
+ # Construct a model instance of VolumeProfileIdentityByHref by calling from_dict on the json representation
+ volume_profile_identity_by_href_model_dict = VolumeProfileIdentityByHref.from_dict(volume_profile_identity_by_href_model_json).__dict__
+ volume_profile_identity_by_href_model2 = VolumeProfileIdentityByHref(**volume_profile_identity_by_href_model_dict)
# Verify the model instances are equivalent
- assert security_group_rule_security_group_rule_protocol_tcpudp_model == security_group_rule_security_group_rule_protocol_tcpudp_model2
+ assert volume_profile_identity_by_href_model == volume_profile_identity_by_href_model2
# Convert model instance back to dict and verify no loss of data
- 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
+ volume_profile_identity_by_href_model_json2 = volume_profile_identity_by_href_model.to_dict()
+ assert volume_profile_identity_by_href_model_json2 == volume_profile_identity_by_href_model_json
-class TestModel_SecurityGroupTargetReferenceBareMetalServerNetworkInterfaceReferenceTargetContext:
+class TestModel_VolumeProfileIdentityByName:
"""
- Test Class for SecurityGroupTargetReferenceBareMetalServerNetworkInterfaceReferenceTargetContext
+ Test Class for VolumeProfileIdentityByName
"""
- def test_security_group_target_reference_bare_metal_server_network_interface_reference_target_context_serialization(self):
+ def test_volume_profile_identity_by_name_serialization(self):
"""
- Test serialization/deserialization for SecurityGroupTargetReferenceBareMetalServerNetworkInterfaceReferenceTargetContext
+ Test serialization/deserialization for VolumeProfileIdentityByName
"""
- # Construct dict forms of any model objects needed in order to build this model.
-
- bare_metal_server_network_interface_reference_target_context_deleted_model = {} # BareMetalServerNetworkInterfaceReferenceTargetContextDeleted
- bare_metal_server_network_interface_reference_target_context_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
-
- # Construct a json representation of a SecurityGroupTargetReferenceBareMetalServerNetworkInterfaceReferenceTargetContext model
- security_group_target_reference_bare_metal_server_network_interface_reference_target_context_model_json = {}
- security_group_target_reference_bare_metal_server_network_interface_reference_target_context_model_json['deleted'] = bare_metal_server_network_interface_reference_target_context_deleted_model
- security_group_target_reference_bare_metal_server_network_interface_reference_target_context_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e'
- security_group_target_reference_bare_metal_server_network_interface_reference_target_context_model_json['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e'
- security_group_target_reference_bare_metal_server_network_interface_reference_target_context_model_json['name'] = 'my-bare-metal-server-network-interface'
- security_group_target_reference_bare_metal_server_network_interface_reference_target_context_model_json['resource_type'] = 'network_interface'
+ # Construct a json representation of a VolumeProfileIdentityByName model
+ volume_profile_identity_by_name_model_json = {}
+ volume_profile_identity_by_name_model_json['name'] = 'general-purpose'
- # Construct a model instance of SecurityGroupTargetReferenceBareMetalServerNetworkInterfaceReferenceTargetContext by calling from_dict on the json representation
- security_group_target_reference_bare_metal_server_network_interface_reference_target_context_model = SecurityGroupTargetReferenceBareMetalServerNetworkInterfaceReferenceTargetContext.from_dict(security_group_target_reference_bare_metal_server_network_interface_reference_target_context_model_json)
- assert security_group_target_reference_bare_metal_server_network_interface_reference_target_context_model != False
+ # Construct a model instance of VolumeProfileIdentityByName by calling from_dict on the json representation
+ volume_profile_identity_by_name_model = VolumeProfileIdentityByName.from_dict(volume_profile_identity_by_name_model_json)
+ assert volume_profile_identity_by_name_model != False
- # Construct a model instance of SecurityGroupTargetReferenceBareMetalServerNetworkInterfaceReferenceTargetContext by calling from_dict on the json representation
- security_group_target_reference_bare_metal_server_network_interface_reference_target_context_model_dict = SecurityGroupTargetReferenceBareMetalServerNetworkInterfaceReferenceTargetContext.from_dict(security_group_target_reference_bare_metal_server_network_interface_reference_target_context_model_json).__dict__
- security_group_target_reference_bare_metal_server_network_interface_reference_target_context_model2 = SecurityGroupTargetReferenceBareMetalServerNetworkInterfaceReferenceTargetContext(**security_group_target_reference_bare_metal_server_network_interface_reference_target_context_model_dict)
+ # Construct a model instance of VolumeProfileIdentityByName by calling from_dict on the json representation
+ volume_profile_identity_by_name_model_dict = VolumeProfileIdentityByName.from_dict(volume_profile_identity_by_name_model_json).__dict__
+ volume_profile_identity_by_name_model2 = VolumeProfileIdentityByName(**volume_profile_identity_by_name_model_dict)
# Verify the model instances are equivalent
- assert security_group_target_reference_bare_metal_server_network_interface_reference_target_context_model == security_group_target_reference_bare_metal_server_network_interface_reference_target_context_model2
+ assert volume_profile_identity_by_name_model == volume_profile_identity_by_name_model2
# Convert model instance back to dict and verify no loss of data
- security_group_target_reference_bare_metal_server_network_interface_reference_target_context_model_json2 = security_group_target_reference_bare_metal_server_network_interface_reference_target_context_model.to_dict()
- assert security_group_target_reference_bare_metal_server_network_interface_reference_target_context_model_json2 == security_group_target_reference_bare_metal_server_network_interface_reference_target_context_model_json
+ volume_profile_identity_by_name_model_json2 = volume_profile_identity_by_name_model.to_dict()
+ assert volume_profile_identity_by_name_model_json2 == volume_profile_identity_by_name_model_json
-class TestModel_SecurityGroupTargetReferenceEndpointGatewayReference:
+class TestModel_VolumePrototypeVolumeByCapacity:
"""
- Test Class for SecurityGroupTargetReferenceEndpointGatewayReference
+ Test Class for VolumePrototypeVolumeByCapacity
"""
- def test_security_group_target_reference_endpoint_gateway_reference_serialization(self):
+ def test_volume_prototype_volume_by_capacity_serialization(self):
"""
- Test serialization/deserialization for SecurityGroupTargetReferenceEndpointGatewayReference
+ Test serialization/deserialization for VolumePrototypeVolumeByCapacity
"""
# 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'
+ volume_profile_identity_model = {} # VolumeProfileIdentityByName
+ volume_profile_identity_model['name'] = 'general-purpose'
- # 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:r134-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/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5'
- security_group_target_reference_endpoint_gateway_reference_model_json['id'] = 'r134-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'
+ resource_group_identity_model = {} # ResourceGroupIdentityById
+ resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
- # 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
+ zone_identity_model = {} # ZoneIdentityByName
+ zone_identity_model['name'] = 'us-south-1'
- # 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)
+ encryption_key_identity_model = {} # EncryptionKeyIdentityByCRN
+ encryption_key_identity_model['crn'] = 'crn:v1:bluemix:public:kms:us-south:a/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179'
+
+ # Construct a json representation of a VolumePrototypeVolumeByCapacity model
+ volume_prototype_volume_by_capacity_model_json = {}
+ volume_prototype_volume_by_capacity_model_json['iops'] = 10000
+ volume_prototype_volume_by_capacity_model_json['name'] = 'my-volume'
+ volume_prototype_volume_by_capacity_model_json['profile'] = volume_profile_identity_model
+ volume_prototype_volume_by_capacity_model_json['resource_group'] = resource_group_identity_model
+ volume_prototype_volume_by_capacity_model_json['user_tags'] = []
+ volume_prototype_volume_by_capacity_model_json['zone'] = zone_identity_model
+ volume_prototype_volume_by_capacity_model_json['capacity'] = 100
+ volume_prototype_volume_by_capacity_model_json['encryption_key'] = encryption_key_identity_model
+
+ # Construct a model instance of VolumePrototypeVolumeByCapacity by calling from_dict on the json representation
+ volume_prototype_volume_by_capacity_model = VolumePrototypeVolumeByCapacity.from_dict(volume_prototype_volume_by_capacity_model_json)
+ assert volume_prototype_volume_by_capacity_model != False
+
+ # Construct a model instance of VolumePrototypeVolumeByCapacity by calling from_dict on the json representation
+ volume_prototype_volume_by_capacity_model_dict = VolumePrototypeVolumeByCapacity.from_dict(volume_prototype_volume_by_capacity_model_json).__dict__
+ volume_prototype_volume_by_capacity_model2 = VolumePrototypeVolumeByCapacity(**volume_prototype_volume_by_capacity_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
+ assert volume_prototype_volume_by_capacity_model == volume_prototype_volume_by_capacity_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
+ volume_prototype_volume_by_capacity_model_json2 = volume_prototype_volume_by_capacity_model.to_dict()
+ assert volume_prototype_volume_by_capacity_model_json2 == volume_prototype_volume_by_capacity_model_json
-class TestModel_SecurityGroupTargetReferenceLoadBalancerReference:
+class TestModel_VolumePrototypeVolumeBySourceSnapshot:
"""
- Test Class for SecurityGroupTargetReferenceLoadBalancerReference
+ Test Class for VolumePrototypeVolumeBySourceSnapshot
"""
- def test_security_group_target_reference_load_balancer_reference_serialization(self):
+ def test_volume_prototype_volume_by_source_snapshot_serialization(self):
"""
- Test serialization/deserialization for SecurityGroupTargetReferenceLoadBalancerReference
+ Test serialization/deserialization for VolumePrototypeVolumeBySourceSnapshot
"""
# Construct dict forms of any model objects needed in order to build this model.
- load_balancer_reference_deleted_model = {} # LoadBalancerReferenceDeleted
- load_balancer_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ volume_profile_identity_model = {} # VolumeProfileIdentityByName
+ volume_profile_identity_model['name'] = 'general-purpose'
- # Construct a json representation of a SecurityGroupTargetReferenceLoadBalancerReference model
- security_group_target_reference_load_balancer_reference_model_json = {}
- security_group_target_reference_load_balancer_reference_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727'
- security_group_target_reference_load_balancer_reference_model_json['deleted'] = load_balancer_reference_deleted_model
- security_group_target_reference_load_balancer_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727'
- security_group_target_reference_load_balancer_reference_model_json['id'] = 'dd754295-e9e0-4c9d-bf6c-58fbc59e5727'
- security_group_target_reference_load_balancer_reference_model_json['name'] = 'my-load-balancer'
- security_group_target_reference_load_balancer_reference_model_json['resource_type'] = 'load_balancer'
+ resource_group_identity_model = {} # ResourceGroupIdentityById
+ resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
- # Construct a model instance of SecurityGroupTargetReferenceLoadBalancerReference by calling from_dict on the json representation
- security_group_target_reference_load_balancer_reference_model = SecurityGroupTargetReferenceLoadBalancerReference.from_dict(security_group_target_reference_load_balancer_reference_model_json)
- assert security_group_target_reference_load_balancer_reference_model != False
+ zone_identity_model = {} # ZoneIdentityByName
+ zone_identity_model['name'] = 'us-south-1'
- # Construct a model instance of SecurityGroupTargetReferenceLoadBalancerReference by calling from_dict on the json representation
- security_group_target_reference_load_balancer_reference_model_dict = SecurityGroupTargetReferenceLoadBalancerReference.from_dict(security_group_target_reference_load_balancer_reference_model_json).__dict__
- security_group_target_reference_load_balancer_reference_model2 = SecurityGroupTargetReferenceLoadBalancerReference(**security_group_target_reference_load_balancer_reference_model_dict)
+ encryption_key_identity_model = {} # EncryptionKeyIdentityByCRN
+ encryption_key_identity_model['crn'] = 'crn:v1:bluemix:public:kms:us-south:a/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179'
+
+ snapshot_identity_model = {} # SnapshotIdentityById
+ snapshot_identity_model['id'] = '349a61d8-7ab1-420f-a690-5fed76ef9d4f'
+
+ # Construct a json representation of a VolumePrototypeVolumeBySourceSnapshot model
+ volume_prototype_volume_by_source_snapshot_model_json = {}
+ volume_prototype_volume_by_source_snapshot_model_json['iops'] = 10000
+ volume_prototype_volume_by_source_snapshot_model_json['name'] = 'my-volume'
+ volume_prototype_volume_by_source_snapshot_model_json['profile'] = volume_profile_identity_model
+ volume_prototype_volume_by_source_snapshot_model_json['resource_group'] = resource_group_identity_model
+ volume_prototype_volume_by_source_snapshot_model_json['user_tags'] = []
+ volume_prototype_volume_by_source_snapshot_model_json['zone'] = zone_identity_model
+ volume_prototype_volume_by_source_snapshot_model_json['capacity'] = 100
+ volume_prototype_volume_by_source_snapshot_model_json['encryption_key'] = encryption_key_identity_model
+ volume_prototype_volume_by_source_snapshot_model_json['source_snapshot'] = snapshot_identity_model
+
+ # Construct a model instance of VolumePrototypeVolumeBySourceSnapshot by calling from_dict on the json representation
+ volume_prototype_volume_by_source_snapshot_model = VolumePrototypeVolumeBySourceSnapshot.from_dict(volume_prototype_volume_by_source_snapshot_model_json)
+ assert volume_prototype_volume_by_source_snapshot_model != False
+
+ # Construct a model instance of VolumePrototypeVolumeBySourceSnapshot by calling from_dict on the json representation
+ volume_prototype_volume_by_source_snapshot_model_dict = VolumePrototypeVolumeBySourceSnapshot.from_dict(volume_prototype_volume_by_source_snapshot_model_json).__dict__
+ volume_prototype_volume_by_source_snapshot_model2 = VolumePrototypeVolumeBySourceSnapshot(**volume_prototype_volume_by_source_snapshot_model_dict)
# Verify the model instances are equivalent
- assert security_group_target_reference_load_balancer_reference_model == security_group_target_reference_load_balancer_reference_model2
+ assert volume_prototype_volume_by_source_snapshot_model == volume_prototype_volume_by_source_snapshot_model2
# Convert model instance back to dict and verify no loss of data
- security_group_target_reference_load_balancer_reference_model_json2 = security_group_target_reference_load_balancer_reference_model.to_dict()
- assert security_group_target_reference_load_balancer_reference_model_json2 == security_group_target_reference_load_balancer_reference_model_json
+ volume_prototype_volume_by_source_snapshot_model_json2 = volume_prototype_volume_by_source_snapshot_model.to_dict()
+ assert volume_prototype_volume_by_source_snapshot_model_json2 == volume_prototype_volume_by_source_snapshot_model_json
-class TestModel_SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext:
+class TestModel_ZoneIdentityByHref:
"""
- Test Class for SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext
+ Test Class for ZoneIdentityByHref
"""
- def test_security_group_target_reference_network_interface_reference_target_context_serialization(self):
+ def test_zone_identity_by_href_serialization(self):
"""
- Test serialization/deserialization for SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext
+ Test serialization/deserialization for ZoneIdentityByHref
"""
- # Construct dict forms of any model objects needed in order to build this model.
-
- network_interface_reference_target_context_deleted_model = {} # NetworkInterfaceReferenceTargetContextDeleted
- network_interface_reference_target_context_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
-
- # Construct a json representation of a SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext model
- security_group_target_reference_network_interface_reference_target_context_model_json = {}
- security_group_target_reference_network_interface_reference_target_context_model_json['deleted'] = network_interface_reference_target_context_deleted_model
- security_group_target_reference_network_interface_reference_target_context_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e'
- security_group_target_reference_network_interface_reference_target_context_model_json['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e'
- security_group_target_reference_network_interface_reference_target_context_model_json['name'] = 'my-instance-network-interface'
- security_group_target_reference_network_interface_reference_target_context_model_json['resource_type'] = 'network_interface'
+ # Construct a json representation of a ZoneIdentityByHref model
+ zone_identity_by_href_model_json = {}
+ zone_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1'
- # Construct a model instance of SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext by calling from_dict on the json representation
- security_group_target_reference_network_interface_reference_target_context_model = SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext.from_dict(security_group_target_reference_network_interface_reference_target_context_model_json)
- assert security_group_target_reference_network_interface_reference_target_context_model != False
+ # Construct a model instance of ZoneIdentityByHref by calling from_dict on the json representation
+ zone_identity_by_href_model = ZoneIdentityByHref.from_dict(zone_identity_by_href_model_json)
+ assert zone_identity_by_href_model != False
- # Construct a model instance of SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext by calling from_dict on the json representation
- security_group_target_reference_network_interface_reference_target_context_model_dict = SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext.from_dict(security_group_target_reference_network_interface_reference_target_context_model_json).__dict__
- security_group_target_reference_network_interface_reference_target_context_model2 = SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext(**security_group_target_reference_network_interface_reference_target_context_model_dict)
+ # Construct a model instance of ZoneIdentityByHref by calling from_dict on the json representation
+ zone_identity_by_href_model_dict = ZoneIdentityByHref.from_dict(zone_identity_by_href_model_json).__dict__
+ zone_identity_by_href_model2 = ZoneIdentityByHref(**zone_identity_by_href_model_dict)
# Verify the model instances are equivalent
- assert security_group_target_reference_network_interface_reference_target_context_model == security_group_target_reference_network_interface_reference_target_context_model2
+ assert zone_identity_by_href_model == zone_identity_by_href_model2
# Convert model instance back to dict and verify no loss of data
- security_group_target_reference_network_interface_reference_target_context_model_json2 = security_group_target_reference_network_interface_reference_target_context_model.to_dict()
- assert security_group_target_reference_network_interface_reference_target_context_model_json2 == security_group_target_reference_network_interface_reference_target_context_model_json
+ zone_identity_by_href_model_json2 = zone_identity_by_href_model.to_dict()
+ assert zone_identity_by_href_model_json2 == zone_identity_by_href_model_json
-class TestModel_SecurityGroupTargetReferenceVPNServerReference:
+class TestModel_ZoneIdentityByName:
"""
- Test Class for SecurityGroupTargetReferenceVPNServerReference
+ Test Class for ZoneIdentityByName
"""
- def test_security_group_target_reference_vpn_server_reference_serialization(self):
+ def test_zone_identity_by_name_serialization(self):
"""
- Test serialization/deserialization for SecurityGroupTargetReferenceVPNServerReference
+ Test serialization/deserialization for ZoneIdentityByName
"""
- # Construct dict forms of any model objects needed in order to build this model.
-
- vpn_server_reference_deleted_model = {} # VPNServerReferenceDeleted
- vpn_server_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
-
- # Construct a json representation of a SecurityGroupTargetReferenceVPNServerReference model
- security_group_target_reference_vpn_server_reference_model_json = {}
- security_group_target_reference_vpn_server_reference_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpn-server:r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5'
- security_group_target_reference_vpn_server_reference_model_json['deleted'] = vpn_server_reference_deleted_model
- security_group_target_reference_vpn_server_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5'
- security_group_target_reference_vpn_server_reference_model_json['id'] = 'r006-d7cc5196-9864-48c4-82d8-3f30da41fcc5'
- security_group_target_reference_vpn_server_reference_model_json['name'] = 'my-vpn-server'
- security_group_target_reference_vpn_server_reference_model_json['resource_type'] = 'vpn_server'
+ # Construct a json representation of a ZoneIdentityByName model
+ zone_identity_by_name_model_json = {}
+ zone_identity_by_name_model_json['name'] = 'us-south-1'
- # Construct a model instance of SecurityGroupTargetReferenceVPNServerReference by calling from_dict on the json representation
- security_group_target_reference_vpn_server_reference_model = SecurityGroupTargetReferenceVPNServerReference.from_dict(security_group_target_reference_vpn_server_reference_model_json)
- assert security_group_target_reference_vpn_server_reference_model != False
+ # Construct a model instance of ZoneIdentityByName by calling from_dict on the json representation
+ zone_identity_by_name_model = ZoneIdentityByName.from_dict(zone_identity_by_name_model_json)
+ assert zone_identity_by_name_model != False
- # Construct a model instance of SecurityGroupTargetReferenceVPNServerReference by calling from_dict on the json representation
- security_group_target_reference_vpn_server_reference_model_dict = SecurityGroupTargetReferenceVPNServerReference.from_dict(security_group_target_reference_vpn_server_reference_model_json).__dict__
- security_group_target_reference_vpn_server_reference_model2 = SecurityGroupTargetReferenceVPNServerReference(**security_group_target_reference_vpn_server_reference_model_dict)
+ # Construct a model instance of ZoneIdentityByName by calling from_dict on the json representation
+ zone_identity_by_name_model_dict = ZoneIdentityByName.from_dict(zone_identity_by_name_model_json).__dict__
+ zone_identity_by_name_model2 = ZoneIdentityByName(**zone_identity_by_name_model_dict)
# Verify the model instances are equivalent
- assert security_group_target_reference_vpn_server_reference_model == security_group_target_reference_vpn_server_reference_model2
+ assert zone_identity_by_name_model == zone_identity_by_name_model2
# Convert model instance back to dict and verify no loss of data
- security_group_target_reference_vpn_server_reference_model_json2 = security_group_target_reference_vpn_server_reference_model.to_dict()
- assert security_group_target_reference_vpn_server_reference_model_json2 == security_group_target_reference_vpn_server_reference_model_json
+ zone_identity_by_name_model_json2 = zone_identity_by_name_model.to_dict()
+ assert zone_identity_by_name_model_json2 == zone_identity_by_name_model_json
-class TestModel_SecurityGroupTargetReferenceVirtualNetworkInterfaceReference:
+class TestModel_BackupPolicyScopePrototypeEnterpriseIdentityEnterpriseIdentityByCRN:
"""
- Test Class for SecurityGroupTargetReferenceVirtualNetworkInterfaceReference
+ Test Class for BackupPolicyScopePrototypeEnterpriseIdentityEnterpriseIdentityByCRN
"""
- def test_security_group_target_reference_virtual_network_interface_reference_serialization(self):
+ def test_backup_policy_scope_prototype_enterprise_identity_enterprise_identity_by_crn_serialization(self):
"""
- Test serialization/deserialization for SecurityGroupTargetReferenceVirtualNetworkInterfaceReference
+ Test serialization/deserialization for BackupPolicyScopePrototypeEnterpriseIdentityEnterpriseIdentityByCRN
"""
- # Construct dict forms of any model objects needed in order to build this model.
-
- virtual_network_interface_reference_deleted_model = {} # VirtualNetworkInterfaceReferenceDeleted
- virtual_network_interface_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
-
- reserved_ip_reference_deleted_model = {} # ReservedIPReferenceDeleted
- reserved_ip_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
-
- reserved_ip_reference_model = {} # ReservedIPReference
- reserved_ip_reference_model['address'] = '192.168.3.4'
- reserved_ip_reference_model['deleted'] = reserved_ip_reference_deleted_model
- reserved_ip_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb'
- reserved_ip_reference_model['id'] = '6d353a0f-aeb1-4ae1-832e-1110d10981bb'
- reserved_ip_reference_model['name'] = 'my-reserved-ip'
- reserved_ip_reference_model['resource_type'] = 'subnet_reserved_ip'
-
- subnet_reference_deleted_model = {} # SubnetReferenceDeleted
- subnet_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
-
- subnet_reference_model = {} # SubnetReference
- subnet_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
- subnet_reference_model['deleted'] = subnet_reference_deleted_model
- subnet_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
- subnet_reference_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
- subnet_reference_model['name'] = 'my-subnet'
- subnet_reference_model['resource_type'] = 'subnet'
-
- # Construct a json representation of a SecurityGroupTargetReferenceVirtualNetworkInterfaceReference model
- security_group_target_reference_virtual_network_interface_reference_model_json = {}
- security_group_target_reference_virtual_network_interface_reference_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9'
- security_group_target_reference_virtual_network_interface_reference_model_json['deleted'] = virtual_network_interface_reference_deleted_model
- security_group_target_reference_virtual_network_interface_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9'
- security_group_target_reference_virtual_network_interface_reference_model_json['id'] = '0767-fa41aecb-4f21-423d-8082-630bfba1e1d9'
- security_group_target_reference_virtual_network_interface_reference_model_json['name'] = 'my-virtual-network-interface'
- security_group_target_reference_virtual_network_interface_reference_model_json['primary_ip'] = reserved_ip_reference_model
- security_group_target_reference_virtual_network_interface_reference_model_json['resource_type'] = 'virtual_network_interface'
- security_group_target_reference_virtual_network_interface_reference_model_json['subnet'] = subnet_reference_model
+ # Construct a json representation of a BackupPolicyScopePrototypeEnterpriseIdentityEnterpriseIdentityByCRN model
+ backup_policy_scope_prototype_enterprise_identity_enterprise_identity_by_crn_model_json = {}
+ backup_policy_scope_prototype_enterprise_identity_enterprise_identity_by_crn_model_json['crn'] = 'crn:v1:bluemix:public:enterprise::a/123456::enterprise:ebc2b430240943458b9e91e1432cfcce'
- # Construct a model instance of SecurityGroupTargetReferenceVirtualNetworkInterfaceReference by calling from_dict on the json representation
- security_group_target_reference_virtual_network_interface_reference_model = SecurityGroupTargetReferenceVirtualNetworkInterfaceReference.from_dict(security_group_target_reference_virtual_network_interface_reference_model_json)
- assert security_group_target_reference_virtual_network_interface_reference_model != False
+ # Construct a model instance of BackupPolicyScopePrototypeEnterpriseIdentityEnterpriseIdentityByCRN by calling from_dict on the json representation
+ backup_policy_scope_prototype_enterprise_identity_enterprise_identity_by_crn_model = BackupPolicyScopePrototypeEnterpriseIdentityEnterpriseIdentityByCRN.from_dict(backup_policy_scope_prototype_enterprise_identity_enterprise_identity_by_crn_model_json)
+ assert backup_policy_scope_prototype_enterprise_identity_enterprise_identity_by_crn_model != False
- # Construct a model instance of SecurityGroupTargetReferenceVirtualNetworkInterfaceReference by calling from_dict on the json representation
- security_group_target_reference_virtual_network_interface_reference_model_dict = SecurityGroupTargetReferenceVirtualNetworkInterfaceReference.from_dict(security_group_target_reference_virtual_network_interface_reference_model_json).__dict__
- security_group_target_reference_virtual_network_interface_reference_model2 = SecurityGroupTargetReferenceVirtualNetworkInterfaceReference(**security_group_target_reference_virtual_network_interface_reference_model_dict)
+ # Construct a model instance of BackupPolicyScopePrototypeEnterpriseIdentityEnterpriseIdentityByCRN by calling from_dict on the json representation
+ backup_policy_scope_prototype_enterprise_identity_enterprise_identity_by_crn_model_dict = BackupPolicyScopePrototypeEnterpriseIdentityEnterpriseIdentityByCRN.from_dict(backup_policy_scope_prototype_enterprise_identity_enterprise_identity_by_crn_model_json).__dict__
+ backup_policy_scope_prototype_enterprise_identity_enterprise_identity_by_crn_model2 = BackupPolicyScopePrototypeEnterpriseIdentityEnterpriseIdentityByCRN(**backup_policy_scope_prototype_enterprise_identity_enterprise_identity_by_crn_model_dict)
# Verify the model instances are equivalent
- assert security_group_target_reference_virtual_network_interface_reference_model == security_group_target_reference_virtual_network_interface_reference_model2
+ assert backup_policy_scope_prototype_enterprise_identity_enterprise_identity_by_crn_model == backup_policy_scope_prototype_enterprise_identity_enterprise_identity_by_crn_model2
# Convert model instance back to dict and verify no loss of data
- security_group_target_reference_virtual_network_interface_reference_model_json2 = security_group_target_reference_virtual_network_interface_reference_model.to_dict()
- assert security_group_target_reference_virtual_network_interface_reference_model_json2 == security_group_target_reference_virtual_network_interface_reference_model_json
+ backup_policy_scope_prototype_enterprise_identity_enterprise_identity_by_crn_model_json2 = backup_policy_scope_prototype_enterprise_identity_enterprise_identity_by_crn_model.to_dict()
+ assert backup_policy_scope_prototype_enterprise_identity_enterprise_identity_by_crn_model_json2 == backup_policy_scope_prototype_enterprise_identity_enterprise_identity_by_crn_model_json
-class TestModel_ShareIdentityByCRN:
+class TestModel_BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN:
"""
- Test Class for ShareIdentityByCRN
+ Test Class for BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN
"""
- def test_share_identity_by_crn_serialization(self):
+ def test_bare_metal_server_network_attachment_prototype_virtual_network_interface_virtual_network_interface_identity_virtual_network_interface_identity_by_crn_serialization(self):
"""
- Test serialization/deserialization for ShareIdentityByCRN
+ Test serialization/deserialization for BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN
"""
- # Construct a json representation of a ShareIdentityByCRN model
- share_identity_by_crn_model_json = {}
- share_identity_by_crn_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58'
+ # Construct a json representation of a BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN model
+ bare_metal_server_network_attachment_prototype_virtual_network_interface_virtual_network_interface_identity_virtual_network_interface_identity_by_crn_model_json = {}
+ bare_metal_server_network_attachment_prototype_virtual_network_interface_virtual_network_interface_identity_virtual_network_interface_identity_by_crn_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9'
- # Construct a model instance of ShareIdentityByCRN by calling from_dict on the json representation
- share_identity_by_crn_model = ShareIdentityByCRN.from_dict(share_identity_by_crn_model_json)
- assert share_identity_by_crn_model != False
+ # Construct a model instance of BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN by calling from_dict on the json representation
+ bare_metal_server_network_attachment_prototype_virtual_network_interface_virtual_network_interface_identity_virtual_network_interface_identity_by_crn_model = BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN.from_dict(bare_metal_server_network_attachment_prototype_virtual_network_interface_virtual_network_interface_identity_virtual_network_interface_identity_by_crn_model_json)
+ assert bare_metal_server_network_attachment_prototype_virtual_network_interface_virtual_network_interface_identity_virtual_network_interface_identity_by_crn_model != False
- # Construct a model instance of ShareIdentityByCRN by calling from_dict on the json representation
- share_identity_by_crn_model_dict = ShareIdentityByCRN.from_dict(share_identity_by_crn_model_json).__dict__
- share_identity_by_crn_model2 = ShareIdentityByCRN(**share_identity_by_crn_model_dict)
+ # Construct a model instance of BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN by calling from_dict on the json representation
+ bare_metal_server_network_attachment_prototype_virtual_network_interface_virtual_network_interface_identity_virtual_network_interface_identity_by_crn_model_dict = BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN.from_dict(bare_metal_server_network_attachment_prototype_virtual_network_interface_virtual_network_interface_identity_virtual_network_interface_identity_by_crn_model_json).__dict__
+ bare_metal_server_network_attachment_prototype_virtual_network_interface_virtual_network_interface_identity_virtual_network_interface_identity_by_crn_model2 = BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN(**bare_metal_server_network_attachment_prototype_virtual_network_interface_virtual_network_interface_identity_virtual_network_interface_identity_by_crn_model_dict)
# Verify the model instances are equivalent
- assert share_identity_by_crn_model == share_identity_by_crn_model2
+ assert bare_metal_server_network_attachment_prototype_virtual_network_interface_virtual_network_interface_identity_virtual_network_interface_identity_by_crn_model == bare_metal_server_network_attachment_prototype_virtual_network_interface_virtual_network_interface_identity_virtual_network_interface_identity_by_crn_model2
# Convert model instance back to dict and verify no loss of data
- share_identity_by_crn_model_json2 = share_identity_by_crn_model.to_dict()
- assert share_identity_by_crn_model_json2 == share_identity_by_crn_model_json
+ bare_metal_server_network_attachment_prototype_virtual_network_interface_virtual_network_interface_identity_virtual_network_interface_identity_by_crn_model_json2 = bare_metal_server_network_attachment_prototype_virtual_network_interface_virtual_network_interface_identity_virtual_network_interface_identity_by_crn_model.to_dict()
+ assert bare_metal_server_network_attachment_prototype_virtual_network_interface_virtual_network_interface_identity_virtual_network_interface_identity_by_crn_model_json2 == bare_metal_server_network_attachment_prototype_virtual_network_interface_virtual_network_interface_identity_virtual_network_interface_identity_by_crn_model_json
-class TestModel_ShareIdentityByHref:
+class TestModel_BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref:
"""
- Test Class for ShareIdentityByHref
+ Test Class for BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref
"""
- def test_share_identity_by_href_serialization(self):
+ def test_bare_metal_server_network_attachment_prototype_virtual_network_interface_virtual_network_interface_identity_virtual_network_interface_identity_by_href_serialization(self):
"""
- Test serialization/deserialization for ShareIdentityByHref
+ Test serialization/deserialization for BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref
"""
- # Construct a json representation of a ShareIdentityByHref model
- share_identity_by_href_model_json = {}
- share_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58'
+ # Construct a json representation of a BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref model
+ bare_metal_server_network_attachment_prototype_virtual_network_interface_virtual_network_interface_identity_virtual_network_interface_identity_by_href_model_json = {}
+ bare_metal_server_network_attachment_prototype_virtual_network_interface_virtual_network_interface_identity_virtual_network_interface_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9'
- # Construct a model instance of ShareIdentityByHref by calling from_dict on the json representation
- share_identity_by_href_model = ShareIdentityByHref.from_dict(share_identity_by_href_model_json)
- assert share_identity_by_href_model != False
+ # Construct a model instance of BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref by calling from_dict on the json representation
+ bare_metal_server_network_attachment_prototype_virtual_network_interface_virtual_network_interface_identity_virtual_network_interface_identity_by_href_model = BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref.from_dict(bare_metal_server_network_attachment_prototype_virtual_network_interface_virtual_network_interface_identity_virtual_network_interface_identity_by_href_model_json)
+ assert bare_metal_server_network_attachment_prototype_virtual_network_interface_virtual_network_interface_identity_virtual_network_interface_identity_by_href_model != False
- # Construct a model instance of ShareIdentityByHref by calling from_dict on the json representation
- share_identity_by_href_model_dict = ShareIdentityByHref.from_dict(share_identity_by_href_model_json).__dict__
- share_identity_by_href_model2 = ShareIdentityByHref(**share_identity_by_href_model_dict)
+ # Construct a model instance of BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref by calling from_dict on the json representation
+ bare_metal_server_network_attachment_prototype_virtual_network_interface_virtual_network_interface_identity_virtual_network_interface_identity_by_href_model_dict = BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref.from_dict(bare_metal_server_network_attachment_prototype_virtual_network_interface_virtual_network_interface_identity_virtual_network_interface_identity_by_href_model_json).__dict__
+ bare_metal_server_network_attachment_prototype_virtual_network_interface_virtual_network_interface_identity_virtual_network_interface_identity_by_href_model2 = BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref(**bare_metal_server_network_attachment_prototype_virtual_network_interface_virtual_network_interface_identity_virtual_network_interface_identity_by_href_model_dict)
# Verify the model instances are equivalent
- assert share_identity_by_href_model == share_identity_by_href_model2
+ assert bare_metal_server_network_attachment_prototype_virtual_network_interface_virtual_network_interface_identity_virtual_network_interface_identity_by_href_model == bare_metal_server_network_attachment_prototype_virtual_network_interface_virtual_network_interface_identity_virtual_network_interface_identity_by_href_model2
# Convert model instance back to dict and verify no loss of data
- share_identity_by_href_model_json2 = share_identity_by_href_model.to_dict()
- assert share_identity_by_href_model_json2 == share_identity_by_href_model_json
+ bare_metal_server_network_attachment_prototype_virtual_network_interface_virtual_network_interface_identity_virtual_network_interface_identity_by_href_model_json2 = bare_metal_server_network_attachment_prototype_virtual_network_interface_virtual_network_interface_identity_virtual_network_interface_identity_by_href_model.to_dict()
+ assert bare_metal_server_network_attachment_prototype_virtual_network_interface_virtual_network_interface_identity_virtual_network_interface_identity_by_href_model_json2 == bare_metal_server_network_attachment_prototype_virtual_network_interface_virtual_network_interface_identity_virtual_network_interface_identity_by_href_model_json
-class TestModel_ShareIdentityById:
+class TestModel_BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById:
"""
- Test Class for ShareIdentityById
+ Test Class for BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById
"""
- def test_share_identity_by_id_serialization(self):
+ def test_bare_metal_server_network_attachment_prototype_virtual_network_interface_virtual_network_interface_identity_virtual_network_interface_identity_by_id_serialization(self):
"""
- Test serialization/deserialization for ShareIdentityById
+ Test serialization/deserialization for BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById
"""
- # Construct a json representation of a ShareIdentityById model
- share_identity_by_id_model_json = {}
- share_identity_by_id_model_json['id'] = '0fe9e5d8-0a4d-4818-96ec-e99708644a58'
+ # Construct a json representation of a BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById model
+ bare_metal_server_network_attachment_prototype_virtual_network_interface_virtual_network_interface_identity_virtual_network_interface_identity_by_id_model_json = {}
+ bare_metal_server_network_attachment_prototype_virtual_network_interface_virtual_network_interface_identity_virtual_network_interface_identity_by_id_model_json['id'] = '0767-fa41aecb-4f21-423d-8082-630bfba1e1d9'
- # Construct a model instance of ShareIdentityById by calling from_dict on the json representation
- share_identity_by_id_model = ShareIdentityById.from_dict(share_identity_by_id_model_json)
- assert share_identity_by_id_model != False
+ # Construct a model instance of BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById by calling from_dict on the json representation
+ bare_metal_server_network_attachment_prototype_virtual_network_interface_virtual_network_interface_identity_virtual_network_interface_identity_by_id_model = BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById.from_dict(bare_metal_server_network_attachment_prototype_virtual_network_interface_virtual_network_interface_identity_virtual_network_interface_identity_by_id_model_json)
+ assert bare_metal_server_network_attachment_prototype_virtual_network_interface_virtual_network_interface_identity_virtual_network_interface_identity_by_id_model != False
- # Construct a model instance of ShareIdentityById by calling from_dict on the json representation
- share_identity_by_id_model_dict = ShareIdentityById.from_dict(share_identity_by_id_model_json).__dict__
- share_identity_by_id_model2 = ShareIdentityById(**share_identity_by_id_model_dict)
+ # Construct a model instance of BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById by calling from_dict on the json representation
+ bare_metal_server_network_attachment_prototype_virtual_network_interface_virtual_network_interface_identity_virtual_network_interface_identity_by_id_model_dict = BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById.from_dict(bare_metal_server_network_attachment_prototype_virtual_network_interface_virtual_network_interface_identity_virtual_network_interface_identity_by_id_model_json).__dict__
+ bare_metal_server_network_attachment_prototype_virtual_network_interface_virtual_network_interface_identity_virtual_network_interface_identity_by_id_model2 = BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById(**bare_metal_server_network_attachment_prototype_virtual_network_interface_virtual_network_interface_identity_virtual_network_interface_identity_by_id_model_dict)
# Verify the model instances are equivalent
- assert share_identity_by_id_model == share_identity_by_id_model2
+ assert bare_metal_server_network_attachment_prototype_virtual_network_interface_virtual_network_interface_identity_virtual_network_interface_identity_by_id_model == bare_metal_server_network_attachment_prototype_virtual_network_interface_virtual_network_interface_identity_virtual_network_interface_identity_by_id_model2
# Convert model instance back to dict and verify no loss of data
- share_identity_by_id_model_json2 = share_identity_by_id_model.to_dict()
- assert share_identity_by_id_model_json2 == share_identity_by_id_model_json
+ bare_metal_server_network_attachment_prototype_virtual_network_interface_virtual_network_interface_identity_virtual_network_interface_identity_by_id_model_json2 = bare_metal_server_network_attachment_prototype_virtual_network_interface_virtual_network_interface_identity_virtual_network_interface_identity_by_id_model.to_dict()
+ assert bare_metal_server_network_attachment_prototype_virtual_network_interface_virtual_network_interface_identity_virtual_network_interface_identity_by_id_model_json2 == bare_metal_server_network_attachment_prototype_virtual_network_interface_virtual_network_interface_identity_virtual_network_interface_identity_by_id_model_json
-class TestModel_ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup:
+class TestModel_EndpointGatewayReservedIPReservedIPIdentityByHref:
"""
- Test Class for ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup
+ Test Class for EndpointGatewayReservedIPReservedIPIdentityByHref
"""
- def test_share_mount_target_prototype_share_mount_target_by_access_control_mode_security_group_serialization(self):
+ def test_endpoint_gateway_reserved_ip_reserved_ip_identity_by_href_serialization(self):
"""
- Test serialization/deserialization for ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup
+ Test serialization/deserialization for EndpointGatewayReservedIPReservedIPIdentityByHref
"""
- # Construct dict forms of any model objects needed in order to build this model.
+ # Construct a json representation of a EndpointGatewayReservedIPReservedIPIdentityByHref model
+ endpoint_gateway_reserved_ip_reserved_ip_identity_by_href_model_json = {}
+ endpoint_gateway_reserved_ip_reserved_ip_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb'
- virtual_network_interface_primary_ip_prototype_model = {} # VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext
- virtual_network_interface_primary_ip_prototype_model['address'] = '10.0.0.5'
- virtual_network_interface_primary_ip_prototype_model['auto_delete'] = False
- virtual_network_interface_primary_ip_prototype_model['name'] = 'my-reserved-ip'
+ # Construct a model instance of EndpointGatewayReservedIPReservedIPIdentityByHref by calling from_dict on the json representation
+ endpoint_gateway_reserved_ip_reserved_ip_identity_by_href_model = EndpointGatewayReservedIPReservedIPIdentityByHref.from_dict(endpoint_gateway_reserved_ip_reserved_ip_identity_by_href_model_json)
+ assert endpoint_gateway_reserved_ip_reserved_ip_identity_by_href_model != False
- resource_group_identity_model = {} # ResourceGroupIdentityById
- resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
+ # Construct a model instance of EndpointGatewayReservedIPReservedIPIdentityByHref by calling from_dict on the json representation
+ endpoint_gateway_reserved_ip_reserved_ip_identity_by_href_model_dict = EndpointGatewayReservedIPReservedIPIdentityByHref.from_dict(endpoint_gateway_reserved_ip_reserved_ip_identity_by_href_model_json).__dict__
+ endpoint_gateway_reserved_ip_reserved_ip_identity_by_href_model2 = EndpointGatewayReservedIPReservedIPIdentityByHref(**endpoint_gateway_reserved_ip_reserved_ip_identity_by_href_model_dict)
- security_group_identity_model = {} # SecurityGroupIdentityById
- security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271'
+ # Verify the model instances are equivalent
+ assert endpoint_gateway_reserved_ip_reserved_ip_identity_by_href_model == endpoint_gateway_reserved_ip_reserved_ip_identity_by_href_model2
- subnet_identity_model = {} # SubnetIdentityById
- subnet_identity_model['id'] = '2302-ea5fe79f-52c3-4f05-86ae-9540a10489f5'
+ # Convert model instance back to dict and verify no loss of data
+ endpoint_gateway_reserved_ip_reserved_ip_identity_by_href_model_json2 = endpoint_gateway_reserved_ip_reserved_ip_identity_by_href_model.to_dict()
+ assert endpoint_gateway_reserved_ip_reserved_ip_identity_by_href_model_json2 == endpoint_gateway_reserved_ip_reserved_ip_identity_by_href_model_json
- share_mount_target_virtual_network_interface_prototype_model = {} # ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfacePrototypeShareMountTargetContext
- share_mount_target_virtual_network_interface_prototype_model['name'] = 'my-virtual-network-interface'
- share_mount_target_virtual_network_interface_prototype_model['primary_ip'] = virtual_network_interface_primary_ip_prototype_model
- share_mount_target_virtual_network_interface_prototype_model['resource_group'] = resource_group_identity_model
- share_mount_target_virtual_network_interface_prototype_model['security_groups'] = [security_group_identity_model]
- share_mount_target_virtual_network_interface_prototype_model['subnet'] = subnet_identity_model
- # Construct a json representation of a ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup model
- share_mount_target_prototype_share_mount_target_by_access_control_mode_security_group_model_json = {}
- share_mount_target_prototype_share_mount_target_by_access_control_mode_security_group_model_json['name'] = 'my-share-mount-target'
- share_mount_target_prototype_share_mount_target_by_access_control_mode_security_group_model_json['transit_encryption'] = 'none'
- share_mount_target_prototype_share_mount_target_by_access_control_mode_security_group_model_json['virtual_network_interface'] = share_mount_target_virtual_network_interface_prototype_model
+class TestModel_EndpointGatewayReservedIPReservedIPIdentityById:
+ """
+ Test Class for EndpointGatewayReservedIPReservedIPIdentityById
+ """
- # Construct a model instance of ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup by calling from_dict on the json representation
- share_mount_target_prototype_share_mount_target_by_access_control_mode_security_group_model = ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup.from_dict(share_mount_target_prototype_share_mount_target_by_access_control_mode_security_group_model_json)
- assert share_mount_target_prototype_share_mount_target_by_access_control_mode_security_group_model != False
+ def test_endpoint_gateway_reserved_ip_reserved_ip_identity_by_id_serialization(self):
+ """
+ Test serialization/deserialization for EndpointGatewayReservedIPReservedIPIdentityById
+ """
- # Construct a model instance of ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup by calling from_dict on the json representation
- share_mount_target_prototype_share_mount_target_by_access_control_mode_security_group_model_dict = ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup.from_dict(share_mount_target_prototype_share_mount_target_by_access_control_mode_security_group_model_json).__dict__
- share_mount_target_prototype_share_mount_target_by_access_control_mode_security_group_model2 = ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup(**share_mount_target_prototype_share_mount_target_by_access_control_mode_security_group_model_dict)
+ # Construct a json representation of a EndpointGatewayReservedIPReservedIPIdentityById model
+ endpoint_gateway_reserved_ip_reserved_ip_identity_by_id_model_json = {}
+ endpoint_gateway_reserved_ip_reserved_ip_identity_by_id_model_json['id'] = '6d353a0f-aeb1-4ae1-832e-1110d10981bb'
+
+ # Construct a model instance of EndpointGatewayReservedIPReservedIPIdentityById by calling from_dict on the json representation
+ endpoint_gateway_reserved_ip_reserved_ip_identity_by_id_model = EndpointGatewayReservedIPReservedIPIdentityById.from_dict(endpoint_gateway_reserved_ip_reserved_ip_identity_by_id_model_json)
+ assert endpoint_gateway_reserved_ip_reserved_ip_identity_by_id_model != False
+
+ # Construct a model instance of EndpointGatewayReservedIPReservedIPIdentityById by calling from_dict on the json representation
+ endpoint_gateway_reserved_ip_reserved_ip_identity_by_id_model_dict = EndpointGatewayReservedIPReservedIPIdentityById.from_dict(endpoint_gateway_reserved_ip_reserved_ip_identity_by_id_model_json).__dict__
+ endpoint_gateway_reserved_ip_reserved_ip_identity_by_id_model2 = EndpointGatewayReservedIPReservedIPIdentityById(**endpoint_gateway_reserved_ip_reserved_ip_identity_by_id_model_dict)
# Verify the model instances are equivalent
- assert share_mount_target_prototype_share_mount_target_by_access_control_mode_security_group_model == share_mount_target_prototype_share_mount_target_by_access_control_mode_security_group_model2
+ assert endpoint_gateway_reserved_ip_reserved_ip_identity_by_id_model == endpoint_gateway_reserved_ip_reserved_ip_identity_by_id_model2
# Convert model instance back to dict and verify no loss of data
- share_mount_target_prototype_share_mount_target_by_access_control_mode_security_group_model_json2 = share_mount_target_prototype_share_mount_target_by_access_control_mode_security_group_model.to_dict()
- assert share_mount_target_prototype_share_mount_target_by_access_control_mode_security_group_model_json2 == share_mount_target_prototype_share_mount_target_by_access_control_mode_security_group_model_json
+ endpoint_gateway_reserved_ip_reserved_ip_identity_by_id_model_json2 = endpoint_gateway_reserved_ip_reserved_ip_identity_by_id_model.to_dict()
+ assert endpoint_gateway_reserved_ip_reserved_ip_identity_by_id_model_json2 == endpoint_gateway_reserved_ip_reserved_ip_identity_by_id_model_json
-class TestModel_ShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC:
+class TestModel_EndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRN:
"""
- Test Class for ShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC
+ Test Class for EndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRN
"""
- def test_share_mount_target_prototype_share_mount_target_by_access_control_mode_vpc_serialization(self):
+ def test_endpoint_gateway_target_prototype_provider_cloud_service_identity_provider_cloud_service_identity_by_crn_serialization(self):
"""
- Test serialization/deserialization for ShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC
+ Test serialization/deserialization for EndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRN
"""
- # Construct dict forms of any model objects needed in order to build this model.
-
- vpc_identity_model = {} # VPCIdentityById
- vpc_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
-
- # Construct a json representation of a ShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC model
- share_mount_target_prototype_share_mount_target_by_access_control_mode_vpc_model_json = {}
- share_mount_target_prototype_share_mount_target_by_access_control_mode_vpc_model_json['name'] = 'my-share-mount-target'
- share_mount_target_prototype_share_mount_target_by_access_control_mode_vpc_model_json['transit_encryption'] = 'none'
- share_mount_target_prototype_share_mount_target_by_access_control_mode_vpc_model_json['vpc'] = vpc_identity_model
+ # Construct a json representation of a EndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRN model
+ endpoint_gateway_target_prototype_provider_cloud_service_identity_provider_cloud_service_identity_by_crn_model_json = {}
+ endpoint_gateway_target_prototype_provider_cloud_service_identity_provider_cloud_service_identity_by_crn_model_json['resource_type'] = 'provider_cloud_service'
+ endpoint_gateway_target_prototype_provider_cloud_service_identity_provider_cloud_service_identity_by_crn_model_json['crn'] = 'crn:v1:bluemix:public:cloudant:us-south:a/123456:3527280b-9327-4411-8020-591092e60353::'
- # Construct a model instance of ShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC by calling from_dict on the json representation
- share_mount_target_prototype_share_mount_target_by_access_control_mode_vpc_model = ShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC.from_dict(share_mount_target_prototype_share_mount_target_by_access_control_mode_vpc_model_json)
- assert share_mount_target_prototype_share_mount_target_by_access_control_mode_vpc_model != False
+ # Construct a model instance of EndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRN by calling from_dict on the json representation
+ endpoint_gateway_target_prototype_provider_cloud_service_identity_provider_cloud_service_identity_by_crn_model = EndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRN.from_dict(endpoint_gateway_target_prototype_provider_cloud_service_identity_provider_cloud_service_identity_by_crn_model_json)
+ assert endpoint_gateway_target_prototype_provider_cloud_service_identity_provider_cloud_service_identity_by_crn_model != False
- # Construct a model instance of ShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC by calling from_dict on the json representation
- share_mount_target_prototype_share_mount_target_by_access_control_mode_vpc_model_dict = ShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC.from_dict(share_mount_target_prototype_share_mount_target_by_access_control_mode_vpc_model_json).__dict__
- share_mount_target_prototype_share_mount_target_by_access_control_mode_vpc_model2 = ShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC(**share_mount_target_prototype_share_mount_target_by_access_control_mode_vpc_model_dict)
+ # Construct a model instance of EndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRN by calling from_dict on the json representation
+ endpoint_gateway_target_prototype_provider_cloud_service_identity_provider_cloud_service_identity_by_crn_model_dict = EndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRN.from_dict(endpoint_gateway_target_prototype_provider_cloud_service_identity_provider_cloud_service_identity_by_crn_model_json).__dict__
+ endpoint_gateway_target_prototype_provider_cloud_service_identity_provider_cloud_service_identity_by_crn_model2 = EndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRN(**endpoint_gateway_target_prototype_provider_cloud_service_identity_provider_cloud_service_identity_by_crn_model_dict)
# Verify the model instances are equivalent
- assert share_mount_target_prototype_share_mount_target_by_access_control_mode_vpc_model == share_mount_target_prototype_share_mount_target_by_access_control_mode_vpc_model2
+ assert endpoint_gateway_target_prototype_provider_cloud_service_identity_provider_cloud_service_identity_by_crn_model == endpoint_gateway_target_prototype_provider_cloud_service_identity_provider_cloud_service_identity_by_crn_model2
# Convert model instance back to dict and verify no loss of data
- share_mount_target_prototype_share_mount_target_by_access_control_mode_vpc_model_json2 = share_mount_target_prototype_share_mount_target_by_access_control_mode_vpc_model.to_dict()
- assert share_mount_target_prototype_share_mount_target_by_access_control_mode_vpc_model_json2 == share_mount_target_prototype_share_mount_target_by_access_control_mode_vpc_model_json
+ endpoint_gateway_target_prototype_provider_cloud_service_identity_provider_cloud_service_identity_by_crn_model_json2 = endpoint_gateway_target_prototype_provider_cloud_service_identity_provider_cloud_service_identity_by_crn_model.to_dict()
+ assert endpoint_gateway_target_prototype_provider_cloud_service_identity_provider_cloud_service_identity_by_crn_model_json2 == endpoint_gateway_target_prototype_provider_cloud_service_identity_provider_cloud_service_identity_by_crn_model_json
-class TestModel_ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfacePrototypeShareMountTargetContext:
+class TestModel_EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityProviderInfrastructureServiceIdentityByName:
"""
- Test Class for ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfacePrototypeShareMountTargetContext
+ Test Class for EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityProviderInfrastructureServiceIdentityByName
"""
- def test_share_mount_target_virtual_network_interface_prototype_virtual_network_interface_prototype_share_mount_target_context_serialization(self):
+ def test_endpoint_gateway_target_prototype_provider_infrastructure_service_identity_provider_infrastructure_service_identity_by_name_serialization(self):
"""
- Test serialization/deserialization for ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfacePrototypeShareMountTargetContext
+ Test serialization/deserialization for EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityProviderInfrastructureServiceIdentityByName
"""
- # Construct dict forms of any model objects needed in order to build this model.
-
- virtual_network_interface_primary_ip_prototype_model = {} # VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext
- virtual_network_interface_primary_ip_prototype_model['address'] = '10.0.0.5'
- virtual_network_interface_primary_ip_prototype_model['auto_delete'] = False
- virtual_network_interface_primary_ip_prototype_model['name'] = 'my-reserved-ip'
-
- resource_group_identity_model = {} # ResourceGroupIdentityById
- resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
-
- security_group_identity_model = {} # SecurityGroupIdentityById
- security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271'
-
- subnet_identity_model = {} # SubnetIdentityById
- subnet_identity_model['id'] = '2302-ea5fe79f-52c3-4f05-86ae-9540a10489f5'
-
- # Construct a json representation of a ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfacePrototypeShareMountTargetContext model
- share_mount_target_virtual_network_interface_prototype_virtual_network_interface_prototype_share_mount_target_context_model_json = {}
- share_mount_target_virtual_network_interface_prototype_virtual_network_interface_prototype_share_mount_target_context_model_json['name'] = 'my-virtual-network-interface'
- share_mount_target_virtual_network_interface_prototype_virtual_network_interface_prototype_share_mount_target_context_model_json['primary_ip'] = virtual_network_interface_primary_ip_prototype_model
- share_mount_target_virtual_network_interface_prototype_virtual_network_interface_prototype_share_mount_target_context_model_json['resource_group'] = resource_group_identity_model
- share_mount_target_virtual_network_interface_prototype_virtual_network_interface_prototype_share_mount_target_context_model_json['security_groups'] = [security_group_identity_model]
- share_mount_target_virtual_network_interface_prototype_virtual_network_interface_prototype_share_mount_target_context_model_json['subnet'] = subnet_identity_model
+ # Construct a json representation of a EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityProviderInfrastructureServiceIdentityByName model
+ endpoint_gateway_target_prototype_provider_infrastructure_service_identity_provider_infrastructure_service_identity_by_name_model_json = {}
+ endpoint_gateway_target_prototype_provider_infrastructure_service_identity_provider_infrastructure_service_identity_by_name_model_json['resource_type'] = 'provider_cloud_service'
+ endpoint_gateway_target_prototype_provider_infrastructure_service_identity_provider_infrastructure_service_identity_by_name_model_json['name'] = 'ibm-ntp-server'
- # Construct a model instance of ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfacePrototypeShareMountTargetContext by calling from_dict on the json representation
- share_mount_target_virtual_network_interface_prototype_virtual_network_interface_prototype_share_mount_target_context_model = ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfacePrototypeShareMountTargetContext.from_dict(share_mount_target_virtual_network_interface_prototype_virtual_network_interface_prototype_share_mount_target_context_model_json)
- assert share_mount_target_virtual_network_interface_prototype_virtual_network_interface_prototype_share_mount_target_context_model != False
+ # Construct a model instance of EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityProviderInfrastructureServiceIdentityByName by calling from_dict on the json representation
+ endpoint_gateway_target_prototype_provider_infrastructure_service_identity_provider_infrastructure_service_identity_by_name_model = EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityProviderInfrastructureServiceIdentityByName.from_dict(endpoint_gateway_target_prototype_provider_infrastructure_service_identity_provider_infrastructure_service_identity_by_name_model_json)
+ assert endpoint_gateway_target_prototype_provider_infrastructure_service_identity_provider_infrastructure_service_identity_by_name_model != False
- # Construct a model instance of ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfacePrototypeShareMountTargetContext by calling from_dict on the json representation
- share_mount_target_virtual_network_interface_prototype_virtual_network_interface_prototype_share_mount_target_context_model_dict = ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfacePrototypeShareMountTargetContext.from_dict(share_mount_target_virtual_network_interface_prototype_virtual_network_interface_prototype_share_mount_target_context_model_json).__dict__
- share_mount_target_virtual_network_interface_prototype_virtual_network_interface_prototype_share_mount_target_context_model2 = ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfacePrototypeShareMountTargetContext(**share_mount_target_virtual_network_interface_prototype_virtual_network_interface_prototype_share_mount_target_context_model_dict)
+ # Construct a model instance of EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityProviderInfrastructureServiceIdentityByName by calling from_dict on the json representation
+ endpoint_gateway_target_prototype_provider_infrastructure_service_identity_provider_infrastructure_service_identity_by_name_model_dict = EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityProviderInfrastructureServiceIdentityByName.from_dict(endpoint_gateway_target_prototype_provider_infrastructure_service_identity_provider_infrastructure_service_identity_by_name_model_json).__dict__
+ endpoint_gateway_target_prototype_provider_infrastructure_service_identity_provider_infrastructure_service_identity_by_name_model2 = EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityProviderInfrastructureServiceIdentityByName(**endpoint_gateway_target_prototype_provider_infrastructure_service_identity_provider_infrastructure_service_identity_by_name_model_dict)
# Verify the model instances are equivalent
- assert share_mount_target_virtual_network_interface_prototype_virtual_network_interface_prototype_share_mount_target_context_model == share_mount_target_virtual_network_interface_prototype_virtual_network_interface_prototype_share_mount_target_context_model2
+ assert endpoint_gateway_target_prototype_provider_infrastructure_service_identity_provider_infrastructure_service_identity_by_name_model == endpoint_gateway_target_prototype_provider_infrastructure_service_identity_provider_infrastructure_service_identity_by_name_model2
# Convert model instance back to dict and verify no loss of data
- share_mount_target_virtual_network_interface_prototype_virtual_network_interface_prototype_share_mount_target_context_model_json2 = share_mount_target_virtual_network_interface_prototype_virtual_network_interface_prototype_share_mount_target_context_model.to_dict()
- assert share_mount_target_virtual_network_interface_prototype_virtual_network_interface_prototype_share_mount_target_context_model_json2 == share_mount_target_virtual_network_interface_prototype_virtual_network_interface_prototype_share_mount_target_context_model_json
+ endpoint_gateway_target_prototype_provider_infrastructure_service_identity_provider_infrastructure_service_identity_by_name_model_json2 = endpoint_gateway_target_prototype_provider_infrastructure_service_identity_provider_infrastructure_service_identity_by_name_model.to_dict()
+ assert endpoint_gateway_target_prototype_provider_infrastructure_service_identity_provider_infrastructure_service_identity_by_name_model_json2 == endpoint_gateway_target_prototype_provider_infrastructure_service_identity_provider_infrastructure_service_identity_by_name_model_json
-class TestModel_ShareProfileCapacityDependentRange:
+class TestModel_FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref:
"""
- Test Class for ShareProfileCapacityDependentRange
+ Test Class for FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref
"""
- def test_share_profile_capacity_dependent_range_serialization(self):
+ def test_floating_ip_target_patch_bare_metal_server_network_interface_identity_bare_metal_server_network_interface_identity_by_href_serialization(self):
"""
- Test serialization/deserialization for ShareProfileCapacityDependentRange
+ Test serialization/deserialization for FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref
"""
- # Construct a json representation of a ShareProfileCapacityDependentRange model
- share_profile_capacity_dependent_range_model_json = {}
- share_profile_capacity_dependent_range_model_json['max'] = 16000
- share_profile_capacity_dependent_range_model_json['min'] = 10
- share_profile_capacity_dependent_range_model_json['step'] = 1
- share_profile_capacity_dependent_range_model_json['type'] = 'dependent'
+ # Construct a json representation of a FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref model
+ floating_ip_target_patch_bare_metal_server_network_interface_identity_bare_metal_server_network_interface_identity_by_href_model_json = {}
+ floating_ip_target_patch_bare_metal_server_network_interface_identity_bare_metal_server_network_interface_identity_by_href_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'
- # Construct a model instance of ShareProfileCapacityDependentRange by calling from_dict on the json representation
- share_profile_capacity_dependent_range_model = ShareProfileCapacityDependentRange.from_dict(share_profile_capacity_dependent_range_model_json)
- assert share_profile_capacity_dependent_range_model != False
+ # Construct a model instance of FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref by calling from_dict on the json representation
+ floating_ip_target_patch_bare_metal_server_network_interface_identity_bare_metal_server_network_interface_identity_by_href_model = FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref.from_dict(floating_ip_target_patch_bare_metal_server_network_interface_identity_bare_metal_server_network_interface_identity_by_href_model_json)
+ assert floating_ip_target_patch_bare_metal_server_network_interface_identity_bare_metal_server_network_interface_identity_by_href_model != False
- # Construct a model instance of ShareProfileCapacityDependentRange by calling from_dict on the json representation
- share_profile_capacity_dependent_range_model_dict = ShareProfileCapacityDependentRange.from_dict(share_profile_capacity_dependent_range_model_json).__dict__
- share_profile_capacity_dependent_range_model2 = ShareProfileCapacityDependentRange(**share_profile_capacity_dependent_range_model_dict)
+ # Construct a model instance of FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref by calling from_dict on the json representation
+ floating_ip_target_patch_bare_metal_server_network_interface_identity_bare_metal_server_network_interface_identity_by_href_model_dict = FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref.from_dict(floating_ip_target_patch_bare_metal_server_network_interface_identity_bare_metal_server_network_interface_identity_by_href_model_json).__dict__
+ floating_ip_target_patch_bare_metal_server_network_interface_identity_bare_metal_server_network_interface_identity_by_href_model2 = FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref(**floating_ip_target_patch_bare_metal_server_network_interface_identity_bare_metal_server_network_interface_identity_by_href_model_dict)
# Verify the model instances are equivalent
- assert share_profile_capacity_dependent_range_model == share_profile_capacity_dependent_range_model2
+ assert floating_ip_target_patch_bare_metal_server_network_interface_identity_bare_metal_server_network_interface_identity_by_href_model == floating_ip_target_patch_bare_metal_server_network_interface_identity_bare_metal_server_network_interface_identity_by_href_model2
# Convert model instance back to dict and verify no loss of data
- share_profile_capacity_dependent_range_model_json2 = share_profile_capacity_dependent_range_model.to_dict()
- assert share_profile_capacity_dependent_range_model_json2 == share_profile_capacity_dependent_range_model_json
+ floating_ip_target_patch_bare_metal_server_network_interface_identity_bare_metal_server_network_interface_identity_by_href_model_json2 = floating_ip_target_patch_bare_metal_server_network_interface_identity_bare_metal_server_network_interface_identity_by_href_model.to_dict()
+ assert floating_ip_target_patch_bare_metal_server_network_interface_identity_bare_metal_server_network_interface_identity_by_href_model_json2 == floating_ip_target_patch_bare_metal_server_network_interface_identity_bare_metal_server_network_interface_identity_by_href_model_json
-class TestModel_ShareProfileCapacityEnum:
+class TestModel_FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityById:
"""
- Test Class for ShareProfileCapacityEnum
+ Test Class for FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityById
"""
- def test_share_profile_capacity_enum_serialization(self):
+ def test_floating_ip_target_patch_bare_metal_server_network_interface_identity_bare_metal_server_network_interface_identity_by_id_serialization(self):
"""
- Test serialization/deserialization for ShareProfileCapacityEnum
+ Test serialization/deserialization for FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityById
"""
- # Construct a json representation of a ShareProfileCapacityEnum model
- share_profile_capacity_enum_model_json = {}
- share_profile_capacity_enum_model_json['default'] = 38
- share_profile_capacity_enum_model_json['type'] = 'enum'
- share_profile_capacity_enum_model_json['values'] = [4800, 9600, 16000, 32000]
+ # Construct a json representation of a FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityById model
+ floating_ip_target_patch_bare_metal_server_network_interface_identity_bare_metal_server_network_interface_identity_by_id_model_json = {}
+ floating_ip_target_patch_bare_metal_server_network_interface_identity_bare_metal_server_network_interface_identity_by_id_model_json['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e'
- # Construct a model instance of ShareProfileCapacityEnum by calling from_dict on the json representation
- share_profile_capacity_enum_model = ShareProfileCapacityEnum.from_dict(share_profile_capacity_enum_model_json)
- assert share_profile_capacity_enum_model != False
+ # Construct a model instance of FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityById by calling from_dict on the json representation
+ floating_ip_target_patch_bare_metal_server_network_interface_identity_bare_metal_server_network_interface_identity_by_id_model = FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityById.from_dict(floating_ip_target_patch_bare_metal_server_network_interface_identity_bare_metal_server_network_interface_identity_by_id_model_json)
+ assert floating_ip_target_patch_bare_metal_server_network_interface_identity_bare_metal_server_network_interface_identity_by_id_model != False
- # Construct a model instance of ShareProfileCapacityEnum by calling from_dict on the json representation
- share_profile_capacity_enum_model_dict = ShareProfileCapacityEnum.from_dict(share_profile_capacity_enum_model_json).__dict__
- share_profile_capacity_enum_model2 = ShareProfileCapacityEnum(**share_profile_capacity_enum_model_dict)
+ # Construct a model instance of FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityById by calling from_dict on the json representation
+ floating_ip_target_patch_bare_metal_server_network_interface_identity_bare_metal_server_network_interface_identity_by_id_model_dict = FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityById.from_dict(floating_ip_target_patch_bare_metal_server_network_interface_identity_bare_metal_server_network_interface_identity_by_id_model_json).__dict__
+ floating_ip_target_patch_bare_metal_server_network_interface_identity_bare_metal_server_network_interface_identity_by_id_model2 = FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityById(**floating_ip_target_patch_bare_metal_server_network_interface_identity_bare_metal_server_network_interface_identity_by_id_model_dict)
# Verify the model instances are equivalent
- assert share_profile_capacity_enum_model == share_profile_capacity_enum_model2
+ assert floating_ip_target_patch_bare_metal_server_network_interface_identity_bare_metal_server_network_interface_identity_by_id_model == floating_ip_target_patch_bare_metal_server_network_interface_identity_bare_metal_server_network_interface_identity_by_id_model2
# Convert model instance back to dict and verify no loss of data
- share_profile_capacity_enum_model_json2 = share_profile_capacity_enum_model.to_dict()
- assert share_profile_capacity_enum_model_json2 == share_profile_capacity_enum_model_json
+ floating_ip_target_patch_bare_metal_server_network_interface_identity_bare_metal_server_network_interface_identity_by_id_model_json2 = floating_ip_target_patch_bare_metal_server_network_interface_identity_bare_metal_server_network_interface_identity_by_id_model.to_dict()
+ assert floating_ip_target_patch_bare_metal_server_network_interface_identity_bare_metal_server_network_interface_identity_by_id_model_json2 == floating_ip_target_patch_bare_metal_server_network_interface_identity_bare_metal_server_network_interface_identity_by_id_model_json
-class TestModel_ShareProfileCapacityFixed:
+class TestModel_FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByHref:
"""
- Test Class for ShareProfileCapacityFixed
+ Test Class for FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByHref
"""
- def test_share_profile_capacity_fixed_serialization(self):
+ def test_floating_ip_target_patch_network_interface_identity_network_interface_identity_by_href_serialization(self):
"""
- Test serialization/deserialization for ShareProfileCapacityFixed
+ Test serialization/deserialization for FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByHref
"""
- # Construct a json representation of a ShareProfileCapacityFixed model
- share_profile_capacity_fixed_model_json = {}
- share_profile_capacity_fixed_model_json['type'] = 'fixed'
- share_profile_capacity_fixed_model_json['value'] = 4800
+ # Construct a json representation of a FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByHref model
+ floating_ip_target_patch_network_interface_identity_network_interface_identity_by_href_model_json = {}
+ floating_ip_target_patch_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 ShareProfileCapacityFixed by calling from_dict on the json representation
- share_profile_capacity_fixed_model = ShareProfileCapacityFixed.from_dict(share_profile_capacity_fixed_model_json)
- assert share_profile_capacity_fixed_model != False
+ # Construct a model instance of FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByHref by calling from_dict on the json representation
+ floating_ip_target_patch_network_interface_identity_network_interface_identity_by_href_model = FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByHref.from_dict(floating_ip_target_patch_network_interface_identity_network_interface_identity_by_href_model_json)
+ assert floating_ip_target_patch_network_interface_identity_network_interface_identity_by_href_model != False
- # Construct a model instance of ShareProfileCapacityFixed by calling from_dict on the json representation
- share_profile_capacity_fixed_model_dict = ShareProfileCapacityFixed.from_dict(share_profile_capacity_fixed_model_json).__dict__
- share_profile_capacity_fixed_model2 = ShareProfileCapacityFixed(**share_profile_capacity_fixed_model_dict)
+ # Construct a model instance of FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByHref by calling from_dict on the json representation
+ floating_ip_target_patch_network_interface_identity_network_interface_identity_by_href_model_dict = FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByHref.from_dict(floating_ip_target_patch_network_interface_identity_network_interface_identity_by_href_model_json).__dict__
+ floating_ip_target_patch_network_interface_identity_network_interface_identity_by_href_model2 = FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByHref(**floating_ip_target_patch_network_interface_identity_network_interface_identity_by_href_model_dict)
# Verify the model instances are equivalent
- assert share_profile_capacity_fixed_model == share_profile_capacity_fixed_model2
+ assert floating_ip_target_patch_network_interface_identity_network_interface_identity_by_href_model == floating_ip_target_patch_network_interface_identity_network_interface_identity_by_href_model2
# Convert model instance back to dict and verify no loss of data
- share_profile_capacity_fixed_model_json2 = share_profile_capacity_fixed_model.to_dict()
- assert share_profile_capacity_fixed_model_json2 == share_profile_capacity_fixed_model_json
+ floating_ip_target_patch_network_interface_identity_network_interface_identity_by_href_model_json2 = floating_ip_target_patch_network_interface_identity_network_interface_identity_by_href_model.to_dict()
+ assert floating_ip_target_patch_network_interface_identity_network_interface_identity_by_href_model_json2 == floating_ip_target_patch_network_interface_identity_network_interface_identity_by_href_model_json
-class TestModel_ShareProfileCapacityRange:
+class TestModel_FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityById:
"""
- Test Class for ShareProfileCapacityRange
+ Test Class for FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityById
"""
- def test_share_profile_capacity_range_serialization(self):
+ def test_floating_ip_target_patch_network_interface_identity_network_interface_identity_by_id_serialization(self):
"""
- Test serialization/deserialization for ShareProfileCapacityRange
+ Test serialization/deserialization for FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityById
"""
- # Construct a json representation of a ShareProfileCapacityRange model
- share_profile_capacity_range_model_json = {}
- share_profile_capacity_range_model_json['default'] = 38
- share_profile_capacity_range_model_json['max'] = 9600
- share_profile_capacity_range_model_json['min'] = 5
- share_profile_capacity_range_model_json['step'] = 1
- share_profile_capacity_range_model_json['type'] = 'range'
+ # Construct a json representation of a FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityById model
+ floating_ip_target_patch_network_interface_identity_network_interface_identity_by_id_model_json = {}
+ floating_ip_target_patch_network_interface_identity_network_interface_identity_by_id_model_json['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e'
- # Construct a model instance of ShareProfileCapacityRange by calling from_dict on the json representation
- share_profile_capacity_range_model = ShareProfileCapacityRange.from_dict(share_profile_capacity_range_model_json)
- assert share_profile_capacity_range_model != False
+ # Construct a model instance of FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityById by calling from_dict on the json representation
+ floating_ip_target_patch_network_interface_identity_network_interface_identity_by_id_model = FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityById.from_dict(floating_ip_target_patch_network_interface_identity_network_interface_identity_by_id_model_json)
+ assert floating_ip_target_patch_network_interface_identity_network_interface_identity_by_id_model != False
- # Construct a model instance of ShareProfileCapacityRange by calling from_dict on the json representation
- share_profile_capacity_range_model_dict = ShareProfileCapacityRange.from_dict(share_profile_capacity_range_model_json).__dict__
- share_profile_capacity_range_model2 = ShareProfileCapacityRange(**share_profile_capacity_range_model_dict)
+ # Construct a model instance of FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityById by calling from_dict on the json representation
+ floating_ip_target_patch_network_interface_identity_network_interface_identity_by_id_model_dict = FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityById.from_dict(floating_ip_target_patch_network_interface_identity_network_interface_identity_by_id_model_json).__dict__
+ floating_ip_target_patch_network_interface_identity_network_interface_identity_by_id_model2 = FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityById(**floating_ip_target_patch_network_interface_identity_network_interface_identity_by_id_model_dict)
# Verify the model instances are equivalent
- assert share_profile_capacity_range_model == share_profile_capacity_range_model2
+ assert floating_ip_target_patch_network_interface_identity_network_interface_identity_by_id_model == floating_ip_target_patch_network_interface_identity_network_interface_identity_by_id_model2
# Convert model instance back to dict and verify no loss of data
- share_profile_capacity_range_model_json2 = share_profile_capacity_range_model.to_dict()
- assert share_profile_capacity_range_model_json2 == share_profile_capacity_range_model_json
+ floating_ip_target_patch_network_interface_identity_network_interface_identity_by_id_model_json2 = floating_ip_target_patch_network_interface_identity_network_interface_identity_by_id_model.to_dict()
+ assert floating_ip_target_patch_network_interface_identity_network_interface_identity_by_id_model_json2 == floating_ip_target_patch_network_interface_identity_network_interface_identity_by_id_model_json
-class TestModel_ShareProfileIOPSDependentRange:
+class TestModel_FloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN:
"""
- Test Class for ShareProfileIOPSDependentRange
+ Test Class for FloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN
"""
- def test_share_profile_iops_dependent_range_serialization(self):
+ def test_floating_ip_target_patch_virtual_network_interface_identity_virtual_network_interface_identity_by_crn_serialization(self):
"""
- Test serialization/deserialization for ShareProfileIOPSDependentRange
+ Test serialization/deserialization for FloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN
"""
- # Construct a json representation of a ShareProfileIOPSDependentRange model
- share_profile_iops_dependent_range_model_json = {}
- share_profile_iops_dependent_range_model_json['max'] = 48000
- share_profile_iops_dependent_range_model_json['min'] = 1000
- share_profile_iops_dependent_range_model_json['step'] = 1
- share_profile_iops_dependent_range_model_json['type'] = 'dependent'
+ # Construct a json representation of a FloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN model
+ floating_ip_target_patch_virtual_network_interface_identity_virtual_network_interface_identity_by_crn_model_json = {}
+ floating_ip_target_patch_virtual_network_interface_identity_virtual_network_interface_identity_by_crn_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9'
- # Construct a model instance of ShareProfileIOPSDependentRange by calling from_dict on the json representation
- share_profile_iops_dependent_range_model = ShareProfileIOPSDependentRange.from_dict(share_profile_iops_dependent_range_model_json)
- assert share_profile_iops_dependent_range_model != False
+ # Construct a model instance of FloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN by calling from_dict on the json representation
+ floating_ip_target_patch_virtual_network_interface_identity_virtual_network_interface_identity_by_crn_model = FloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN.from_dict(floating_ip_target_patch_virtual_network_interface_identity_virtual_network_interface_identity_by_crn_model_json)
+ assert floating_ip_target_patch_virtual_network_interface_identity_virtual_network_interface_identity_by_crn_model != False
- # Construct a model instance of ShareProfileIOPSDependentRange by calling from_dict on the json representation
- share_profile_iops_dependent_range_model_dict = ShareProfileIOPSDependentRange.from_dict(share_profile_iops_dependent_range_model_json).__dict__
- share_profile_iops_dependent_range_model2 = ShareProfileIOPSDependentRange(**share_profile_iops_dependent_range_model_dict)
+ # Construct a model instance of FloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN by calling from_dict on the json representation
+ floating_ip_target_patch_virtual_network_interface_identity_virtual_network_interface_identity_by_crn_model_dict = FloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN.from_dict(floating_ip_target_patch_virtual_network_interface_identity_virtual_network_interface_identity_by_crn_model_json).__dict__
+ floating_ip_target_patch_virtual_network_interface_identity_virtual_network_interface_identity_by_crn_model2 = FloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN(**floating_ip_target_patch_virtual_network_interface_identity_virtual_network_interface_identity_by_crn_model_dict)
# Verify the model instances are equivalent
- assert share_profile_iops_dependent_range_model == share_profile_iops_dependent_range_model2
+ assert floating_ip_target_patch_virtual_network_interface_identity_virtual_network_interface_identity_by_crn_model == floating_ip_target_patch_virtual_network_interface_identity_virtual_network_interface_identity_by_crn_model2
# Convert model instance back to dict and verify no loss of data
- share_profile_iops_dependent_range_model_json2 = share_profile_iops_dependent_range_model.to_dict()
- assert share_profile_iops_dependent_range_model_json2 == share_profile_iops_dependent_range_model_json
+ floating_ip_target_patch_virtual_network_interface_identity_virtual_network_interface_identity_by_crn_model_json2 = floating_ip_target_patch_virtual_network_interface_identity_virtual_network_interface_identity_by_crn_model.to_dict()
+ assert floating_ip_target_patch_virtual_network_interface_identity_virtual_network_interface_identity_by_crn_model_json2 == floating_ip_target_patch_virtual_network_interface_identity_virtual_network_interface_identity_by_crn_model_json
-class TestModel_ShareProfileIOPSEnum:
+class TestModel_FloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref:
"""
- Test Class for ShareProfileIOPSEnum
+ Test Class for FloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref
"""
- def test_share_profile_iops_enum_serialization(self):
+ def test_floating_ip_target_patch_virtual_network_interface_identity_virtual_network_interface_identity_by_href_serialization(self):
"""
- Test serialization/deserialization for ShareProfileIOPSEnum
+ Test serialization/deserialization for FloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref
"""
- # Construct a json representation of a ShareProfileIOPSEnum model
- share_profile_iops_enum_model_json = {}
- share_profile_iops_enum_model_json['default'] = 38
- share_profile_iops_enum_model_json['type'] = 'enum'
- share_profile_iops_enum_model_json['values'] = [1000, 2000, 4000]
+ # Construct a json representation of a FloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref model
+ floating_ip_target_patch_virtual_network_interface_identity_virtual_network_interface_identity_by_href_model_json = {}
+ floating_ip_target_patch_virtual_network_interface_identity_virtual_network_interface_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9'
- # Construct a model instance of ShareProfileIOPSEnum by calling from_dict on the json representation
- share_profile_iops_enum_model = ShareProfileIOPSEnum.from_dict(share_profile_iops_enum_model_json)
- assert share_profile_iops_enum_model != False
+ # Construct a model instance of FloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref by calling from_dict on the json representation
+ floating_ip_target_patch_virtual_network_interface_identity_virtual_network_interface_identity_by_href_model = FloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref.from_dict(floating_ip_target_patch_virtual_network_interface_identity_virtual_network_interface_identity_by_href_model_json)
+ assert floating_ip_target_patch_virtual_network_interface_identity_virtual_network_interface_identity_by_href_model != False
- # Construct a model instance of ShareProfileIOPSEnum by calling from_dict on the json representation
- share_profile_iops_enum_model_dict = ShareProfileIOPSEnum.from_dict(share_profile_iops_enum_model_json).__dict__
- share_profile_iops_enum_model2 = ShareProfileIOPSEnum(**share_profile_iops_enum_model_dict)
+ # Construct a model instance of FloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref by calling from_dict on the json representation
+ floating_ip_target_patch_virtual_network_interface_identity_virtual_network_interface_identity_by_href_model_dict = FloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref.from_dict(floating_ip_target_patch_virtual_network_interface_identity_virtual_network_interface_identity_by_href_model_json).__dict__
+ floating_ip_target_patch_virtual_network_interface_identity_virtual_network_interface_identity_by_href_model2 = FloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref(**floating_ip_target_patch_virtual_network_interface_identity_virtual_network_interface_identity_by_href_model_dict)
# Verify the model instances are equivalent
- assert share_profile_iops_enum_model == share_profile_iops_enum_model2
+ assert floating_ip_target_patch_virtual_network_interface_identity_virtual_network_interface_identity_by_href_model == floating_ip_target_patch_virtual_network_interface_identity_virtual_network_interface_identity_by_href_model2
# Convert model instance back to dict and verify no loss of data
- share_profile_iops_enum_model_json2 = share_profile_iops_enum_model.to_dict()
- assert share_profile_iops_enum_model_json2 == share_profile_iops_enum_model_json
+ floating_ip_target_patch_virtual_network_interface_identity_virtual_network_interface_identity_by_href_model_json2 = floating_ip_target_patch_virtual_network_interface_identity_virtual_network_interface_identity_by_href_model.to_dict()
+ assert floating_ip_target_patch_virtual_network_interface_identity_virtual_network_interface_identity_by_href_model_json2 == floating_ip_target_patch_virtual_network_interface_identity_virtual_network_interface_identity_by_href_model_json
-class TestModel_ShareProfileIOPSFixed:
+class TestModel_FloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById:
"""
- Test Class for ShareProfileIOPSFixed
+ Test Class for FloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById
"""
- def test_share_profile_iops_fixed_serialization(self):
+ def test_floating_ip_target_patch_virtual_network_interface_identity_virtual_network_interface_identity_by_id_serialization(self):
"""
- Test serialization/deserialization for ShareProfileIOPSFixed
+ Test serialization/deserialization for FloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById
"""
- # Construct a json representation of a ShareProfileIOPSFixed model
- share_profile_iops_fixed_model_json = {}
- share_profile_iops_fixed_model_json['type'] = 'fixed'
- share_profile_iops_fixed_model_json['value'] = 4000
+ # Construct a json representation of a FloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById model
+ floating_ip_target_patch_virtual_network_interface_identity_virtual_network_interface_identity_by_id_model_json = {}
+ floating_ip_target_patch_virtual_network_interface_identity_virtual_network_interface_identity_by_id_model_json['id'] = '0767-fa41aecb-4f21-423d-8082-630bfba1e1d9'
- # Construct a model instance of ShareProfileIOPSFixed by calling from_dict on the json representation
- share_profile_iops_fixed_model = ShareProfileIOPSFixed.from_dict(share_profile_iops_fixed_model_json)
- assert share_profile_iops_fixed_model != False
+ # Construct a model instance of FloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById by calling from_dict on the json representation
+ floating_ip_target_patch_virtual_network_interface_identity_virtual_network_interface_identity_by_id_model = FloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById.from_dict(floating_ip_target_patch_virtual_network_interface_identity_virtual_network_interface_identity_by_id_model_json)
+ assert floating_ip_target_patch_virtual_network_interface_identity_virtual_network_interface_identity_by_id_model != False
- # Construct a model instance of ShareProfileIOPSFixed by calling from_dict on the json representation
- share_profile_iops_fixed_model_dict = ShareProfileIOPSFixed.from_dict(share_profile_iops_fixed_model_json).__dict__
- share_profile_iops_fixed_model2 = ShareProfileIOPSFixed(**share_profile_iops_fixed_model_dict)
+ # Construct a model instance of FloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById by calling from_dict on the json representation
+ floating_ip_target_patch_virtual_network_interface_identity_virtual_network_interface_identity_by_id_model_dict = FloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById.from_dict(floating_ip_target_patch_virtual_network_interface_identity_virtual_network_interface_identity_by_id_model_json).__dict__
+ floating_ip_target_patch_virtual_network_interface_identity_virtual_network_interface_identity_by_id_model2 = FloatingIPTargetPatchVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById(**floating_ip_target_patch_virtual_network_interface_identity_virtual_network_interface_identity_by_id_model_dict)
# Verify the model instances are equivalent
- assert share_profile_iops_fixed_model == share_profile_iops_fixed_model2
+ assert floating_ip_target_patch_virtual_network_interface_identity_virtual_network_interface_identity_by_id_model == floating_ip_target_patch_virtual_network_interface_identity_virtual_network_interface_identity_by_id_model2
# Convert model instance back to dict and verify no loss of data
- share_profile_iops_fixed_model_json2 = share_profile_iops_fixed_model.to_dict()
- assert share_profile_iops_fixed_model_json2 == share_profile_iops_fixed_model_json
+ floating_ip_target_patch_virtual_network_interface_identity_virtual_network_interface_identity_by_id_model_json2 = floating_ip_target_patch_virtual_network_interface_identity_virtual_network_interface_identity_by_id_model.to_dict()
+ assert floating_ip_target_patch_virtual_network_interface_identity_virtual_network_interface_identity_by_id_model_json2 == floating_ip_target_patch_virtual_network_interface_identity_virtual_network_interface_identity_by_id_model_json
-class TestModel_ShareProfileIOPSRange:
+class TestModel_FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref:
"""
- Test Class for ShareProfileIOPSRange
+ Test Class for FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref
"""
- def test_share_profile_iops_range_serialization(self):
+ def test_floating_ip_target_prototype_bare_metal_server_network_interface_identity_bare_metal_server_network_interface_identity_by_href_serialization(self):
"""
- Test serialization/deserialization for ShareProfileIOPSRange
+ Test serialization/deserialization for FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref
"""
- # Construct a json representation of a ShareProfileIOPSRange model
- share_profile_iops_range_model_json = {}
- share_profile_iops_range_model_json['default'] = 38
- share_profile_iops_range_model_json['max'] = 48000
- share_profile_iops_range_model_json['min'] = 1000
- share_profile_iops_range_model_json['step'] = 1
- share_profile_iops_range_model_json['type'] = 'range'
+ # Construct a json representation of a FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref model
+ floating_ip_target_prototype_bare_metal_server_network_interface_identity_bare_metal_server_network_interface_identity_by_href_model_json = {}
+ floating_ip_target_prototype_bare_metal_server_network_interface_identity_bare_metal_server_network_interface_identity_by_href_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'
- # Construct a model instance of ShareProfileIOPSRange by calling from_dict on the json representation
- share_profile_iops_range_model = ShareProfileIOPSRange.from_dict(share_profile_iops_range_model_json)
- assert share_profile_iops_range_model != False
+ # Construct a model instance of FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref by calling from_dict on the json representation
+ floating_ip_target_prototype_bare_metal_server_network_interface_identity_bare_metal_server_network_interface_identity_by_href_model = FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref.from_dict(floating_ip_target_prototype_bare_metal_server_network_interface_identity_bare_metal_server_network_interface_identity_by_href_model_json)
+ assert floating_ip_target_prototype_bare_metal_server_network_interface_identity_bare_metal_server_network_interface_identity_by_href_model != False
- # Construct a model instance of ShareProfileIOPSRange by calling from_dict on the json representation
- share_profile_iops_range_model_dict = ShareProfileIOPSRange.from_dict(share_profile_iops_range_model_json).__dict__
- share_profile_iops_range_model2 = ShareProfileIOPSRange(**share_profile_iops_range_model_dict)
+ # Construct a model instance of FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref by calling from_dict on the json representation
+ floating_ip_target_prototype_bare_metal_server_network_interface_identity_bare_metal_server_network_interface_identity_by_href_model_dict = FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref.from_dict(floating_ip_target_prototype_bare_metal_server_network_interface_identity_bare_metal_server_network_interface_identity_by_href_model_json).__dict__
+ floating_ip_target_prototype_bare_metal_server_network_interface_identity_bare_metal_server_network_interface_identity_by_href_model2 = FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref(**floating_ip_target_prototype_bare_metal_server_network_interface_identity_bare_metal_server_network_interface_identity_by_href_model_dict)
# Verify the model instances are equivalent
- assert share_profile_iops_range_model == share_profile_iops_range_model2
+ assert floating_ip_target_prototype_bare_metal_server_network_interface_identity_bare_metal_server_network_interface_identity_by_href_model == floating_ip_target_prototype_bare_metal_server_network_interface_identity_bare_metal_server_network_interface_identity_by_href_model2
# Convert model instance back to dict and verify no loss of data
- share_profile_iops_range_model_json2 = share_profile_iops_range_model.to_dict()
- assert share_profile_iops_range_model_json2 == share_profile_iops_range_model_json
+ floating_ip_target_prototype_bare_metal_server_network_interface_identity_bare_metal_server_network_interface_identity_by_href_model_json2 = floating_ip_target_prototype_bare_metal_server_network_interface_identity_bare_metal_server_network_interface_identity_by_href_model.to_dict()
+ assert floating_ip_target_prototype_bare_metal_server_network_interface_identity_bare_metal_server_network_interface_identity_by_href_model_json2 == floating_ip_target_prototype_bare_metal_server_network_interface_identity_bare_metal_server_network_interface_identity_by_href_model_json
-class TestModel_ShareProfileIdentityByHref:
+class TestModel_FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityById:
"""
- Test Class for ShareProfileIdentityByHref
+ Test Class for FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityById
"""
- def test_share_profile_identity_by_href_serialization(self):
+ def test_floating_ip_target_prototype_bare_metal_server_network_interface_identity_bare_metal_server_network_interface_identity_by_id_serialization(self):
"""
- Test serialization/deserialization for ShareProfileIdentityByHref
+ Test serialization/deserialization for FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityById
"""
- # Construct a json representation of a ShareProfileIdentityByHref model
- share_profile_identity_by_href_model_json = {}
- share_profile_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops'
+ # Construct a json representation of a FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityById model
+ floating_ip_target_prototype_bare_metal_server_network_interface_identity_bare_metal_server_network_interface_identity_by_id_model_json = {}
+ floating_ip_target_prototype_bare_metal_server_network_interface_identity_bare_metal_server_network_interface_identity_by_id_model_json['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e'
- # Construct a model instance of ShareProfileIdentityByHref by calling from_dict on the json representation
- share_profile_identity_by_href_model = ShareProfileIdentityByHref.from_dict(share_profile_identity_by_href_model_json)
- assert share_profile_identity_by_href_model != False
+ # Construct a model instance of FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityById by calling from_dict on the json representation
+ floating_ip_target_prototype_bare_metal_server_network_interface_identity_bare_metal_server_network_interface_identity_by_id_model = FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityById.from_dict(floating_ip_target_prototype_bare_metal_server_network_interface_identity_bare_metal_server_network_interface_identity_by_id_model_json)
+ assert floating_ip_target_prototype_bare_metal_server_network_interface_identity_bare_metal_server_network_interface_identity_by_id_model != False
- # Construct a model instance of ShareProfileIdentityByHref by calling from_dict on the json representation
- share_profile_identity_by_href_model_dict = ShareProfileIdentityByHref.from_dict(share_profile_identity_by_href_model_json).__dict__
- share_profile_identity_by_href_model2 = ShareProfileIdentityByHref(**share_profile_identity_by_href_model_dict)
+ # Construct a model instance of FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityById by calling from_dict on the json representation
+ floating_ip_target_prototype_bare_metal_server_network_interface_identity_bare_metal_server_network_interface_identity_by_id_model_dict = FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityById.from_dict(floating_ip_target_prototype_bare_metal_server_network_interface_identity_bare_metal_server_network_interface_identity_by_id_model_json).__dict__
+ floating_ip_target_prototype_bare_metal_server_network_interface_identity_bare_metal_server_network_interface_identity_by_id_model2 = FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityById(**floating_ip_target_prototype_bare_metal_server_network_interface_identity_bare_metal_server_network_interface_identity_by_id_model_dict)
# Verify the model instances are equivalent
- assert share_profile_identity_by_href_model == share_profile_identity_by_href_model2
+ assert floating_ip_target_prototype_bare_metal_server_network_interface_identity_bare_metal_server_network_interface_identity_by_id_model == floating_ip_target_prototype_bare_metal_server_network_interface_identity_bare_metal_server_network_interface_identity_by_id_model2
# Convert model instance back to dict and verify no loss of data
- share_profile_identity_by_href_model_json2 = share_profile_identity_by_href_model.to_dict()
- assert share_profile_identity_by_href_model_json2 == share_profile_identity_by_href_model_json
+ floating_ip_target_prototype_bare_metal_server_network_interface_identity_bare_metal_server_network_interface_identity_by_id_model_json2 = floating_ip_target_prototype_bare_metal_server_network_interface_identity_bare_metal_server_network_interface_identity_by_id_model.to_dict()
+ assert floating_ip_target_prototype_bare_metal_server_network_interface_identity_bare_metal_server_network_interface_identity_by_id_model_json2 == floating_ip_target_prototype_bare_metal_server_network_interface_identity_bare_metal_server_network_interface_identity_by_id_model_json
-class TestModel_ShareProfileIdentityByName:
+class TestModel_FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref:
"""
- Test Class for ShareProfileIdentityByName
+ Test Class for FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref
"""
- def test_share_profile_identity_by_name_serialization(self):
+ def test_floating_ip_target_prototype_network_interface_identity_network_interface_identity_by_href_serialization(self):
"""
- Test serialization/deserialization for ShareProfileIdentityByName
+ Test serialization/deserialization for FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref
"""
- # Construct a json representation of a ShareProfileIdentityByName model
- share_profile_identity_by_name_model_json = {}
- share_profile_identity_by_name_model_json['name'] = 'tier-3iops'
+ # Construct a json representation of a FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref model
+ floating_ip_target_prototype_network_interface_identity_network_interface_identity_by_href_model_json = {}
+ floating_ip_target_prototype_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 ShareProfileIdentityByName by calling from_dict on the json representation
- share_profile_identity_by_name_model = ShareProfileIdentityByName.from_dict(share_profile_identity_by_name_model_json)
- assert share_profile_identity_by_name_model != False
+ # Construct a model instance of FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref by calling from_dict on the json representation
+ floating_ip_target_prototype_network_interface_identity_network_interface_identity_by_href_model = FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref.from_dict(floating_ip_target_prototype_network_interface_identity_network_interface_identity_by_href_model_json)
+ assert floating_ip_target_prototype_network_interface_identity_network_interface_identity_by_href_model != False
- # Construct a model instance of ShareProfileIdentityByName by calling from_dict on the json representation
- share_profile_identity_by_name_model_dict = ShareProfileIdentityByName.from_dict(share_profile_identity_by_name_model_json).__dict__
- share_profile_identity_by_name_model2 = ShareProfileIdentityByName(**share_profile_identity_by_name_model_dict)
+ # Construct a model instance of FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref by calling from_dict on the json representation
+ floating_ip_target_prototype_network_interface_identity_network_interface_identity_by_href_model_dict = FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref.from_dict(floating_ip_target_prototype_network_interface_identity_network_interface_identity_by_href_model_json).__dict__
+ floating_ip_target_prototype_network_interface_identity_network_interface_identity_by_href_model2 = FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref(**floating_ip_target_prototype_network_interface_identity_network_interface_identity_by_href_model_dict)
# Verify the model instances are equivalent
- assert share_profile_identity_by_name_model == share_profile_identity_by_name_model2
+ assert floating_ip_target_prototype_network_interface_identity_network_interface_identity_by_href_model == floating_ip_target_prototype_network_interface_identity_network_interface_identity_by_href_model2
# Convert model instance back to dict and verify no loss of data
- share_profile_identity_by_name_model_json2 = share_profile_identity_by_name_model.to_dict()
- assert share_profile_identity_by_name_model_json2 == share_profile_identity_by_name_model_json
+ floating_ip_target_prototype_network_interface_identity_network_interface_identity_by_href_model_json2 = floating_ip_target_prototype_network_interface_identity_network_interface_identity_by_href_model.to_dict()
+ assert floating_ip_target_prototype_network_interface_identity_network_interface_identity_by_href_model_json2 == floating_ip_target_prototype_network_interface_identity_network_interface_identity_by_href_model_json
-class TestModel_SharePrototypeShareBySize:
+class TestModel_FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityById:
"""
- Test Class for SharePrototypeShareBySize
+ Test Class for FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityById
"""
- def test_share_prototype_share_by_size_serialization(self):
+ def test_floating_ip_target_prototype_network_interface_identity_network_interface_identity_by_id_serialization(self):
"""
- Test serialization/deserialization for SharePrototypeShareBySize
+ Test serialization/deserialization for FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityById
"""
- # Construct dict forms of any model objects needed in order to build this model.
-
- virtual_network_interface_primary_ip_prototype_model = {} # VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext
- virtual_network_interface_primary_ip_prototype_model['address'] = '10.0.0.5'
- virtual_network_interface_primary_ip_prototype_model['auto_delete'] = False
- virtual_network_interface_primary_ip_prototype_model['name'] = 'my-reserved-ip'
-
- resource_group_identity_model = {} # ResourceGroupIdentityById
- resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
-
- security_group_identity_model = {} # SecurityGroupIdentityById
- security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271'
-
- subnet_identity_model = {} # SubnetIdentityById
- subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
+ # Construct a json representation of a FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityById model
+ floating_ip_target_prototype_network_interface_identity_network_interface_identity_by_id_model_json = {}
+ floating_ip_target_prototype_network_interface_identity_network_interface_identity_by_id_model_json['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e'
- share_mount_target_virtual_network_interface_prototype_model = {} # ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfacePrototypeShareMountTargetContext
- share_mount_target_virtual_network_interface_prototype_model['name'] = 'my-virtual-network-interface'
- share_mount_target_virtual_network_interface_prototype_model['primary_ip'] = virtual_network_interface_primary_ip_prototype_model
- share_mount_target_virtual_network_interface_prototype_model['resource_group'] = resource_group_identity_model
- share_mount_target_virtual_network_interface_prototype_model['security_groups'] = [security_group_identity_model]
- share_mount_target_virtual_network_interface_prototype_model['subnet'] = subnet_identity_model
+ # Construct a model instance of FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityById by calling from_dict on the json representation
+ floating_ip_target_prototype_network_interface_identity_network_interface_identity_by_id_model = FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityById.from_dict(floating_ip_target_prototype_network_interface_identity_network_interface_identity_by_id_model_json)
+ assert floating_ip_target_prototype_network_interface_identity_network_interface_identity_by_id_model != False
- share_mount_target_prototype_model = {} # ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup
- share_mount_target_prototype_model['name'] = 'my-share-mount-target'
- share_mount_target_prototype_model['transit_encryption'] = 'none'
- share_mount_target_prototype_model['virtual_network_interface'] = share_mount_target_virtual_network_interface_prototype_model
+ # Construct a model instance of FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityById by calling from_dict on the json representation
+ floating_ip_target_prototype_network_interface_identity_network_interface_identity_by_id_model_dict = FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityById.from_dict(floating_ip_target_prototype_network_interface_identity_network_interface_identity_by_id_model_json).__dict__
+ floating_ip_target_prototype_network_interface_identity_network_interface_identity_by_id_model2 = FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityById(**floating_ip_target_prototype_network_interface_identity_network_interface_identity_by_id_model_dict)
- share_profile_identity_model = {} # ShareProfileIdentityByName
- share_profile_identity_model['name'] = 'tier-3iops'
+ # Verify the model instances are equivalent
+ assert floating_ip_target_prototype_network_interface_identity_network_interface_identity_by_id_model == floating_ip_target_prototype_network_interface_identity_network_interface_identity_by_id_model2
- zone_identity_model = {} # ZoneIdentityByName
- zone_identity_model['name'] = 'us-south-1'
+ # Convert model instance back to dict and verify no loss of data
+ floating_ip_target_prototype_network_interface_identity_network_interface_identity_by_id_model_json2 = floating_ip_target_prototype_network_interface_identity_network_interface_identity_by_id_model.to_dict()
+ assert floating_ip_target_prototype_network_interface_identity_network_interface_identity_by_id_model_json2 == floating_ip_target_prototype_network_interface_identity_network_interface_identity_by_id_model_json
- share_prototype_share_context_model = {} # SharePrototypeShareContext
- share_prototype_share_context_model['iops'] = 100
- share_prototype_share_context_model['mount_targets'] = [share_mount_target_prototype_model]
- share_prototype_share_context_model['name'] = 'my-share'
- share_prototype_share_context_model['profile'] = share_profile_identity_model
- share_prototype_share_context_model['replication_cron_spec'] = '0 */5 * * *'
- share_prototype_share_context_model['resource_group'] = resource_group_identity_model
- share_prototype_share_context_model['user_tags'] = []
- share_prototype_share_context_model['zone'] = zone_identity_model
- encryption_key_identity_model = {} # EncryptionKeyIdentityByCRN
- encryption_key_identity_model['crn'] = 'crn:v1:bluemix:public:kms:us-south:a/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179'
+class TestModel_FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN:
+ """
+ Test Class for FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN
+ """
- share_initial_owner_model = {} # ShareInitialOwner
- share_initial_owner_model['gid'] = 50
- share_initial_owner_model['uid'] = 50
+ def test_floating_ip_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_crn_serialization(self):
+ """
+ Test serialization/deserialization for FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN
+ """
- # Construct a json representation of a SharePrototypeShareBySize model
- share_prototype_share_by_size_model_json = {}
- share_prototype_share_by_size_model_json['iops'] = 100
- share_prototype_share_by_size_model_json['mount_targets'] = [share_mount_target_prototype_model]
- share_prototype_share_by_size_model_json['name'] = 'my-share'
- share_prototype_share_by_size_model_json['profile'] = share_profile_identity_model
- share_prototype_share_by_size_model_json['replica_share'] = share_prototype_share_context_model
- share_prototype_share_by_size_model_json['user_tags'] = []
- share_prototype_share_by_size_model_json['zone'] = zone_identity_model
- share_prototype_share_by_size_model_json['access_control_mode'] = 'security_group'
- share_prototype_share_by_size_model_json['encryption_key'] = encryption_key_identity_model
- share_prototype_share_by_size_model_json['initial_owner'] = share_initial_owner_model
- share_prototype_share_by_size_model_json['resource_group'] = resource_group_identity_model
- share_prototype_share_by_size_model_json['size'] = 200
+ # Construct a json representation of a FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN model
+ floating_ip_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_crn_model_json = {}
+ floating_ip_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_crn_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9'
- # Construct a model instance of SharePrototypeShareBySize by calling from_dict on the json representation
- share_prototype_share_by_size_model = SharePrototypeShareBySize.from_dict(share_prototype_share_by_size_model_json)
- assert share_prototype_share_by_size_model != False
+ # Construct a model instance of FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN by calling from_dict on the json representation
+ floating_ip_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_crn_model = FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN.from_dict(floating_ip_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_crn_model_json)
+ assert floating_ip_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_crn_model != False
- # Construct a model instance of SharePrototypeShareBySize by calling from_dict on the json representation
- share_prototype_share_by_size_model_dict = SharePrototypeShareBySize.from_dict(share_prototype_share_by_size_model_json).__dict__
- share_prototype_share_by_size_model2 = SharePrototypeShareBySize(**share_prototype_share_by_size_model_dict)
+ # Construct a model instance of FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN by calling from_dict on the json representation
+ floating_ip_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_crn_model_dict = FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN.from_dict(floating_ip_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_crn_model_json).__dict__
+ floating_ip_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_crn_model2 = FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN(**floating_ip_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_crn_model_dict)
# Verify the model instances are equivalent
- assert share_prototype_share_by_size_model == share_prototype_share_by_size_model2
+ assert floating_ip_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_crn_model == floating_ip_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_crn_model2
# Convert model instance back to dict and verify no loss of data
- share_prototype_share_by_size_model_json2 = share_prototype_share_by_size_model.to_dict()
- assert share_prototype_share_by_size_model_json2 == share_prototype_share_by_size_model_json
+ floating_ip_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_crn_model_json2 = floating_ip_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_crn_model.to_dict()
+ assert floating_ip_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_crn_model_json2 == floating_ip_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_crn_model_json
-class TestModel_SharePrototypeShareBySourceShare:
+class TestModel_FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref:
"""
- Test Class for SharePrototypeShareBySourceShare
+ Test Class for FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref
"""
- def test_share_prototype_share_by_source_share_serialization(self):
+ def test_floating_ip_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_href_serialization(self):
"""
- Test serialization/deserialization for SharePrototypeShareBySourceShare
+ Test serialization/deserialization for FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref
"""
- # Construct dict forms of any model objects needed in order to build this model.
-
- virtual_network_interface_primary_ip_prototype_model = {} # VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext
- virtual_network_interface_primary_ip_prototype_model['address'] = '10.0.0.5'
- virtual_network_interface_primary_ip_prototype_model['auto_delete'] = False
- virtual_network_interface_primary_ip_prototype_model['name'] = 'my-reserved-ip'
-
- resource_group_identity_model = {} # ResourceGroupIdentityById
- resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
-
- security_group_identity_model = {} # SecurityGroupIdentityById
- security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271'
+ # Construct a json representation of a FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref model
+ floating_ip_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_href_model_json = {}
+ floating_ip_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9'
- subnet_identity_model = {} # SubnetIdentityById
- subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
+ # Construct a model instance of FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref by calling from_dict on the json representation
+ floating_ip_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_href_model = FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref.from_dict(floating_ip_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_href_model_json)
+ assert floating_ip_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_href_model != False
- share_mount_target_virtual_network_interface_prototype_model = {} # ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfacePrototypeShareMountTargetContext
- share_mount_target_virtual_network_interface_prototype_model['name'] = 'my-virtual-network-interface'
- share_mount_target_virtual_network_interface_prototype_model['primary_ip'] = virtual_network_interface_primary_ip_prototype_model
- share_mount_target_virtual_network_interface_prototype_model['resource_group'] = resource_group_identity_model
- share_mount_target_virtual_network_interface_prototype_model['security_groups'] = [security_group_identity_model]
- share_mount_target_virtual_network_interface_prototype_model['subnet'] = subnet_identity_model
+ # Construct a model instance of FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref by calling from_dict on the json representation
+ floating_ip_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_href_model_dict = FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref.from_dict(floating_ip_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_href_model_json).__dict__
+ floating_ip_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_href_model2 = FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref(**floating_ip_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_href_model_dict)
- share_mount_target_prototype_model = {} # ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup
- share_mount_target_prototype_model['name'] = 'my-share-mount-target'
- share_mount_target_prototype_model['transit_encryption'] = 'none'
- share_mount_target_prototype_model['virtual_network_interface'] = share_mount_target_virtual_network_interface_prototype_model
+ # Verify the model instances are equivalent
+ assert floating_ip_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_href_model == floating_ip_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_href_model2
- share_profile_identity_model = {} # ShareProfileIdentityByName
- share_profile_identity_model['name'] = 'tier-3iops'
+ # Convert model instance back to dict and verify no loss of data
+ floating_ip_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_href_model_json2 = floating_ip_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_href_model.to_dict()
+ assert floating_ip_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_href_model_json2 == floating_ip_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_href_model_json
- zone_identity_model = {} # ZoneIdentityByName
- zone_identity_model['name'] = 'us-south-1'
- share_prototype_share_context_model = {} # SharePrototypeShareContext
- share_prototype_share_context_model['iops'] = 100
- share_prototype_share_context_model['mount_targets'] = [share_mount_target_prototype_model]
- share_prototype_share_context_model['name'] = 'my-share'
- share_prototype_share_context_model['profile'] = share_profile_identity_model
- share_prototype_share_context_model['replication_cron_spec'] = '0 */5 * * *'
- share_prototype_share_context_model['resource_group'] = resource_group_identity_model
- share_prototype_share_context_model['user_tags'] = []
- share_prototype_share_context_model['zone'] = zone_identity_model
+class TestModel_FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById:
+ """
+ Test Class for FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById
+ """
- share_identity_model = {} # ShareIdentityById
- share_identity_model['id'] = '0fe9e5d8-0a4d-4818-96ec-e99708644a58'
+ def test_floating_ip_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_id_serialization(self):
+ """
+ Test serialization/deserialization for FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById
+ """
- # Construct a json representation of a SharePrototypeShareBySourceShare model
- share_prototype_share_by_source_share_model_json = {}
- share_prototype_share_by_source_share_model_json['iops'] = 100
- share_prototype_share_by_source_share_model_json['mount_targets'] = [share_mount_target_prototype_model]
- share_prototype_share_by_source_share_model_json['name'] = 'my-share'
- share_prototype_share_by_source_share_model_json['profile'] = share_profile_identity_model
- share_prototype_share_by_source_share_model_json['replica_share'] = share_prototype_share_context_model
- share_prototype_share_by_source_share_model_json['user_tags'] = []
- share_prototype_share_by_source_share_model_json['zone'] = zone_identity_model
- share_prototype_share_by_source_share_model_json['replication_cron_spec'] = '0 */5 * * *'
- share_prototype_share_by_source_share_model_json['resource_group'] = resource_group_identity_model
- share_prototype_share_by_source_share_model_json['source_share'] = share_identity_model
+ # Construct a json representation of a FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById model
+ floating_ip_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_id_model_json = {}
+ floating_ip_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_id_model_json['id'] = '0767-fa41aecb-4f21-423d-8082-630bfba1e1d9'
- # Construct a model instance of SharePrototypeShareBySourceShare by calling from_dict on the json representation
- share_prototype_share_by_source_share_model = SharePrototypeShareBySourceShare.from_dict(share_prototype_share_by_source_share_model_json)
- assert share_prototype_share_by_source_share_model != False
+ # Construct a model instance of FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById by calling from_dict on the json representation
+ floating_ip_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_id_model = FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById.from_dict(floating_ip_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_id_model_json)
+ assert floating_ip_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_id_model != False
- # Construct a model instance of SharePrototypeShareBySourceShare by calling from_dict on the json representation
- share_prototype_share_by_source_share_model_dict = SharePrototypeShareBySourceShare.from_dict(share_prototype_share_by_source_share_model_json).__dict__
- share_prototype_share_by_source_share_model2 = SharePrototypeShareBySourceShare(**share_prototype_share_by_source_share_model_dict)
+ # Construct a model instance of FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById by calling from_dict on the json representation
+ floating_ip_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_id_model_dict = FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById.from_dict(floating_ip_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_id_model_json).__dict__
+ floating_ip_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_id_model2 = FloatingIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById(**floating_ip_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_id_model_dict)
# Verify the model instances are equivalent
- assert share_prototype_share_by_source_share_model == share_prototype_share_by_source_share_model2
+ assert floating_ip_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_id_model == floating_ip_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_id_model2
# Convert model instance back to dict and verify no loss of data
- share_prototype_share_by_source_share_model_json2 = share_prototype_share_by_source_share_model.to_dict()
- assert share_prototype_share_by_source_share_model_json2 == share_prototype_share_by_source_share_model_json
+ floating_ip_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_id_model_json2 = floating_ip_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_id_model.to_dict()
+ assert floating_ip_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_id_model_json2 == floating_ip_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_id_model_json
-class TestModel_SnapshotIdentityByCRN:
+class TestModel_FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByCRN:
"""
- Test Class for SnapshotIdentityByCRN
+ Test Class for FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByCRN
"""
- def test_snapshot_identity_by_crn_serialization(self):
+ def test_flow_log_collector_target_prototype_instance_identity_instance_identity_by_crn_serialization(self):
"""
- Test serialization/deserialization for SnapshotIdentityByCRN
+ Test serialization/deserialization for FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByCRN
"""
- # Construct a json representation of a SnapshotIdentityByCRN model
- snapshot_identity_by_crn_model_json = {}
- snapshot_identity_by_crn_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263'
+ # Construct a json representation of a FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByCRN model
+ flow_log_collector_target_prototype_instance_identity_instance_identity_by_crn_model_json = {}
+ flow_log_collector_target_prototype_instance_identity_instance_identity_by_crn_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a'
- # Construct a model instance of SnapshotIdentityByCRN by calling from_dict on the json representation
- snapshot_identity_by_crn_model = SnapshotIdentityByCRN.from_dict(snapshot_identity_by_crn_model_json)
- assert snapshot_identity_by_crn_model != False
+ # Construct a model instance of FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByCRN by calling from_dict on the json representation
+ flow_log_collector_target_prototype_instance_identity_instance_identity_by_crn_model = FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByCRN.from_dict(flow_log_collector_target_prototype_instance_identity_instance_identity_by_crn_model_json)
+ assert flow_log_collector_target_prototype_instance_identity_instance_identity_by_crn_model != False
- # Construct a model instance of SnapshotIdentityByCRN by calling from_dict on the json representation
- snapshot_identity_by_crn_model_dict = SnapshotIdentityByCRN.from_dict(snapshot_identity_by_crn_model_json).__dict__
- snapshot_identity_by_crn_model2 = SnapshotIdentityByCRN(**snapshot_identity_by_crn_model_dict)
+ # Construct a model instance of FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByCRN by calling from_dict on the json representation
+ flow_log_collector_target_prototype_instance_identity_instance_identity_by_crn_model_dict = FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByCRN.from_dict(flow_log_collector_target_prototype_instance_identity_instance_identity_by_crn_model_json).__dict__
+ flow_log_collector_target_prototype_instance_identity_instance_identity_by_crn_model2 = FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByCRN(**flow_log_collector_target_prototype_instance_identity_instance_identity_by_crn_model_dict)
# Verify the model instances are equivalent
- assert snapshot_identity_by_crn_model == snapshot_identity_by_crn_model2
+ assert flow_log_collector_target_prototype_instance_identity_instance_identity_by_crn_model == flow_log_collector_target_prototype_instance_identity_instance_identity_by_crn_model2
# Convert model instance back to dict and verify no loss of data
- snapshot_identity_by_crn_model_json2 = snapshot_identity_by_crn_model.to_dict()
- assert snapshot_identity_by_crn_model_json2 == snapshot_identity_by_crn_model_json
+ flow_log_collector_target_prototype_instance_identity_instance_identity_by_crn_model_json2 = flow_log_collector_target_prototype_instance_identity_instance_identity_by_crn_model.to_dict()
+ assert flow_log_collector_target_prototype_instance_identity_instance_identity_by_crn_model_json2 == flow_log_collector_target_prototype_instance_identity_instance_identity_by_crn_model_json
-class TestModel_SnapshotIdentityByHref:
+class TestModel_FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByHref:
"""
- Test Class for SnapshotIdentityByHref
+ Test Class for FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByHref
"""
- def test_snapshot_identity_by_href_serialization(self):
+ def test_flow_log_collector_target_prototype_instance_identity_instance_identity_by_href_serialization(self):
"""
- Test serialization/deserialization for SnapshotIdentityByHref
+ Test serialization/deserialization for FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByHref
"""
- # Construct a json representation of a SnapshotIdentityByHref model
- snapshot_identity_by_href_model_json = {}
- snapshot_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263'
+ # Construct a json representation of a FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByHref model
+ flow_log_collector_target_prototype_instance_identity_instance_identity_by_href_model_json = {}
+ flow_log_collector_target_prototype_instance_identity_instance_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a'
- # Construct a model instance of SnapshotIdentityByHref by calling from_dict on the json representation
- snapshot_identity_by_href_model = SnapshotIdentityByHref.from_dict(snapshot_identity_by_href_model_json)
- assert snapshot_identity_by_href_model != False
+ # Construct a model instance of FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByHref by calling from_dict on the json representation
+ flow_log_collector_target_prototype_instance_identity_instance_identity_by_href_model = FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByHref.from_dict(flow_log_collector_target_prototype_instance_identity_instance_identity_by_href_model_json)
+ assert flow_log_collector_target_prototype_instance_identity_instance_identity_by_href_model != False
- # Construct a model instance of SnapshotIdentityByHref by calling from_dict on the json representation
- snapshot_identity_by_href_model_dict = SnapshotIdentityByHref.from_dict(snapshot_identity_by_href_model_json).__dict__
- snapshot_identity_by_href_model2 = SnapshotIdentityByHref(**snapshot_identity_by_href_model_dict)
+ # Construct a model instance of FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByHref by calling from_dict on the json representation
+ flow_log_collector_target_prototype_instance_identity_instance_identity_by_href_model_dict = FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByHref.from_dict(flow_log_collector_target_prototype_instance_identity_instance_identity_by_href_model_json).__dict__
+ flow_log_collector_target_prototype_instance_identity_instance_identity_by_href_model2 = FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByHref(**flow_log_collector_target_prototype_instance_identity_instance_identity_by_href_model_dict)
# Verify the model instances are equivalent
- assert snapshot_identity_by_href_model == snapshot_identity_by_href_model2
+ assert flow_log_collector_target_prototype_instance_identity_instance_identity_by_href_model == flow_log_collector_target_prototype_instance_identity_instance_identity_by_href_model2
# Convert model instance back to dict and verify no loss of data
- snapshot_identity_by_href_model_json2 = snapshot_identity_by_href_model.to_dict()
- assert snapshot_identity_by_href_model_json2 == snapshot_identity_by_href_model_json
+ flow_log_collector_target_prototype_instance_identity_instance_identity_by_href_model_json2 = flow_log_collector_target_prototype_instance_identity_instance_identity_by_href_model.to_dict()
+ assert flow_log_collector_target_prototype_instance_identity_instance_identity_by_href_model_json2 == flow_log_collector_target_prototype_instance_identity_instance_identity_by_href_model_json
-class TestModel_SnapshotIdentityById:
+class TestModel_FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityById:
"""
- Test Class for SnapshotIdentityById
+ Test Class for FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityById
"""
- def test_snapshot_identity_by_id_serialization(self):
+ def test_flow_log_collector_target_prototype_instance_identity_instance_identity_by_id_serialization(self):
"""
- Test serialization/deserialization for SnapshotIdentityById
+ Test serialization/deserialization for FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityById
"""
- # Construct a json representation of a SnapshotIdentityById model
- snapshot_identity_by_id_model_json = {}
- snapshot_identity_by_id_model_json['id'] = 'r134-f6bfa329-0e36-433f-a3bb-0df632e79263'
+ # Construct a json representation of a FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityById model
+ flow_log_collector_target_prototype_instance_identity_instance_identity_by_id_model_json = {}
+ flow_log_collector_target_prototype_instance_identity_instance_identity_by_id_model_json['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
- # Construct a model instance of SnapshotIdentityById by calling from_dict on the json representation
- snapshot_identity_by_id_model = SnapshotIdentityById.from_dict(snapshot_identity_by_id_model_json)
- assert snapshot_identity_by_id_model != False
+ # Construct a model instance of FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityById by calling from_dict on the json representation
+ flow_log_collector_target_prototype_instance_identity_instance_identity_by_id_model = FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityById.from_dict(flow_log_collector_target_prototype_instance_identity_instance_identity_by_id_model_json)
+ assert flow_log_collector_target_prototype_instance_identity_instance_identity_by_id_model != False
- # Construct a model instance of SnapshotIdentityById by calling from_dict on the json representation
- snapshot_identity_by_id_model_dict = SnapshotIdentityById.from_dict(snapshot_identity_by_id_model_json).__dict__
- snapshot_identity_by_id_model2 = SnapshotIdentityById(**snapshot_identity_by_id_model_dict)
+ # Construct a model instance of FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityById by calling from_dict on the json representation
+ flow_log_collector_target_prototype_instance_identity_instance_identity_by_id_model_dict = FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityById.from_dict(flow_log_collector_target_prototype_instance_identity_instance_identity_by_id_model_json).__dict__
+ flow_log_collector_target_prototype_instance_identity_instance_identity_by_id_model2 = FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityById(**flow_log_collector_target_prototype_instance_identity_instance_identity_by_id_model_dict)
# Verify the model instances are equivalent
- assert snapshot_identity_by_id_model == snapshot_identity_by_id_model2
+ assert flow_log_collector_target_prototype_instance_identity_instance_identity_by_id_model == flow_log_collector_target_prototype_instance_identity_instance_identity_by_id_model2
# Convert model instance back to dict and verify no loss of data
- snapshot_identity_by_id_model_json2 = snapshot_identity_by_id_model.to_dict()
- assert snapshot_identity_by_id_model_json2 == snapshot_identity_by_id_model_json
+ flow_log_collector_target_prototype_instance_identity_instance_identity_by_id_model_json2 = flow_log_collector_target_prototype_instance_identity_instance_identity_by_id_model.to_dict()
+ assert flow_log_collector_target_prototype_instance_identity_instance_identity_by_id_model_json2 == flow_log_collector_target_prototype_instance_identity_instance_identity_by_id_model_json
-class TestModel_SnapshotPrototypeSnapshotBySourceSnapshot:
+class TestModel_FlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentityInstanceNetworkAttachmentIdentityByHref:
"""
- Test Class for SnapshotPrototypeSnapshotBySourceSnapshot
+ Test Class for FlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentityInstanceNetworkAttachmentIdentityByHref
"""
- def test_snapshot_prototype_snapshot_by_source_snapshot_serialization(self):
+ def test_flow_log_collector_target_prototype_instance_network_attachment_identity_instance_network_attachment_identity_by_href_serialization(self):
"""
- Test serialization/deserialization for SnapshotPrototypeSnapshotBySourceSnapshot
+ Test serialization/deserialization for FlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentityInstanceNetworkAttachmentIdentityByHref
"""
- # Construct dict forms of any model objects needed in order to build this model.
+ # Construct a json representation of a FlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentityInstanceNetworkAttachmentIdentityByHref model
+ flow_log_collector_target_prototype_instance_network_attachment_identity_instance_network_attachment_identity_by_href_model_json = {}
+ flow_log_collector_target_prototype_instance_network_attachment_identity_instance_network_attachment_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/5dd61d72-acaa-47c2-a336-3d849660d010/network_attachments/0767-d54eb633-98ea-459d-aa00-6a8e780175a7'
- zone_identity_model = {} # ZoneIdentityByName
- zone_identity_model['name'] = 'us-south-1'
+ # Construct a model instance of FlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentityInstanceNetworkAttachmentIdentityByHref by calling from_dict on the json representation
+ flow_log_collector_target_prototype_instance_network_attachment_identity_instance_network_attachment_identity_by_href_model = FlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentityInstanceNetworkAttachmentIdentityByHref.from_dict(flow_log_collector_target_prototype_instance_network_attachment_identity_instance_network_attachment_identity_by_href_model_json)
+ assert flow_log_collector_target_prototype_instance_network_attachment_identity_instance_network_attachment_identity_by_href_model != False
- snapshot_clone_prototype_model = {} # SnapshotClonePrototype
- snapshot_clone_prototype_model['zone'] = zone_identity_model
+ # Construct a model instance of FlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentityInstanceNetworkAttachmentIdentityByHref by calling from_dict on the json representation
+ flow_log_collector_target_prototype_instance_network_attachment_identity_instance_network_attachment_identity_by_href_model_dict = FlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentityInstanceNetworkAttachmentIdentityByHref.from_dict(flow_log_collector_target_prototype_instance_network_attachment_identity_instance_network_attachment_identity_by_href_model_json).__dict__
+ flow_log_collector_target_prototype_instance_network_attachment_identity_instance_network_attachment_identity_by_href_model2 = FlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentityInstanceNetworkAttachmentIdentityByHref(**flow_log_collector_target_prototype_instance_network_attachment_identity_instance_network_attachment_identity_by_href_model_dict)
- resource_group_identity_model = {} # ResourceGroupIdentityById
- resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
+ # Verify the model instances are equivalent
+ assert flow_log_collector_target_prototype_instance_network_attachment_identity_instance_network_attachment_identity_by_href_model == flow_log_collector_target_prototype_instance_network_attachment_identity_instance_network_attachment_identity_by_href_model2
- encryption_key_identity_model = {} # EncryptionKeyIdentityByCRN
- encryption_key_identity_model['crn'] = 'crn:v1:bluemix:public:kms:us-south:a/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179'
+ # Convert model instance back to dict and verify no loss of data
+ flow_log_collector_target_prototype_instance_network_attachment_identity_instance_network_attachment_identity_by_href_model_json2 = flow_log_collector_target_prototype_instance_network_attachment_identity_instance_network_attachment_identity_by_href_model.to_dict()
+ assert flow_log_collector_target_prototype_instance_network_attachment_identity_instance_network_attachment_identity_by_href_model_json2 == flow_log_collector_target_prototype_instance_network_attachment_identity_instance_network_attachment_identity_by_href_model_json
- snapshot_identity_by_crn_model = {} # SnapshotIdentityByCRN
- snapshot_identity_by_crn_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263'
- # Construct a json representation of a SnapshotPrototypeSnapshotBySourceSnapshot model
- snapshot_prototype_snapshot_by_source_snapshot_model_json = {}
- snapshot_prototype_snapshot_by_source_snapshot_model_json['clones'] = [snapshot_clone_prototype_model]
- snapshot_prototype_snapshot_by_source_snapshot_model_json['name'] = 'my-snapshot'
- snapshot_prototype_snapshot_by_source_snapshot_model_json['resource_group'] = resource_group_identity_model
- snapshot_prototype_snapshot_by_source_snapshot_model_json['user_tags'] = []
- snapshot_prototype_snapshot_by_source_snapshot_model_json['encryption_key'] = encryption_key_identity_model
- snapshot_prototype_snapshot_by_source_snapshot_model_json['source_snapshot'] = snapshot_identity_by_crn_model
+class TestModel_FlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentityInstanceNetworkAttachmentIdentityById:
+ """
+ Test Class for FlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentityInstanceNetworkAttachmentIdentityById
+ """
- # Construct a model instance of SnapshotPrototypeSnapshotBySourceSnapshot by calling from_dict on the json representation
- snapshot_prototype_snapshot_by_source_snapshot_model = SnapshotPrototypeSnapshotBySourceSnapshot.from_dict(snapshot_prototype_snapshot_by_source_snapshot_model_json)
- assert snapshot_prototype_snapshot_by_source_snapshot_model != False
+ def test_flow_log_collector_target_prototype_instance_network_attachment_identity_instance_network_attachment_identity_by_id_serialization(self):
+ """
+ Test serialization/deserialization for FlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentityInstanceNetworkAttachmentIdentityById
+ """
- # Construct a model instance of SnapshotPrototypeSnapshotBySourceSnapshot by calling from_dict on the json representation
- snapshot_prototype_snapshot_by_source_snapshot_model_dict = SnapshotPrototypeSnapshotBySourceSnapshot.from_dict(snapshot_prototype_snapshot_by_source_snapshot_model_json).__dict__
- snapshot_prototype_snapshot_by_source_snapshot_model2 = SnapshotPrototypeSnapshotBySourceSnapshot(**snapshot_prototype_snapshot_by_source_snapshot_model_dict)
+ # Construct a json representation of a FlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentityInstanceNetworkAttachmentIdentityById model
+ flow_log_collector_target_prototype_instance_network_attachment_identity_instance_network_attachment_identity_by_id_model_json = {}
+ flow_log_collector_target_prototype_instance_network_attachment_identity_instance_network_attachment_identity_by_id_model_json['id'] = '0767-d54eb633-98ea-459d-aa00-6a8e780175a7'
+
+ # Construct a model instance of FlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentityInstanceNetworkAttachmentIdentityById by calling from_dict on the json representation
+ flow_log_collector_target_prototype_instance_network_attachment_identity_instance_network_attachment_identity_by_id_model = FlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentityInstanceNetworkAttachmentIdentityById.from_dict(flow_log_collector_target_prototype_instance_network_attachment_identity_instance_network_attachment_identity_by_id_model_json)
+ assert flow_log_collector_target_prototype_instance_network_attachment_identity_instance_network_attachment_identity_by_id_model != False
+
+ # Construct a model instance of FlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentityInstanceNetworkAttachmentIdentityById by calling from_dict on the json representation
+ flow_log_collector_target_prototype_instance_network_attachment_identity_instance_network_attachment_identity_by_id_model_dict = FlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentityInstanceNetworkAttachmentIdentityById.from_dict(flow_log_collector_target_prototype_instance_network_attachment_identity_instance_network_attachment_identity_by_id_model_json).__dict__
+ flow_log_collector_target_prototype_instance_network_attachment_identity_instance_network_attachment_identity_by_id_model2 = FlowLogCollectorTargetPrototypeInstanceNetworkAttachmentIdentityInstanceNetworkAttachmentIdentityById(**flow_log_collector_target_prototype_instance_network_attachment_identity_instance_network_attachment_identity_by_id_model_dict)
# Verify the model instances are equivalent
- assert snapshot_prototype_snapshot_by_source_snapshot_model == snapshot_prototype_snapshot_by_source_snapshot_model2
+ assert flow_log_collector_target_prototype_instance_network_attachment_identity_instance_network_attachment_identity_by_id_model == flow_log_collector_target_prototype_instance_network_attachment_identity_instance_network_attachment_identity_by_id_model2
# Convert model instance back to dict and verify no loss of data
- snapshot_prototype_snapshot_by_source_snapshot_model_json2 = snapshot_prototype_snapshot_by_source_snapshot_model.to_dict()
- assert snapshot_prototype_snapshot_by_source_snapshot_model_json2 == snapshot_prototype_snapshot_by_source_snapshot_model_json
+ flow_log_collector_target_prototype_instance_network_attachment_identity_instance_network_attachment_identity_by_id_model_json2 = flow_log_collector_target_prototype_instance_network_attachment_identity_instance_network_attachment_identity_by_id_model.to_dict()
+ assert flow_log_collector_target_prototype_instance_network_attachment_identity_instance_network_attachment_identity_by_id_model_json2 == flow_log_collector_target_prototype_instance_network_attachment_identity_instance_network_attachment_identity_by_id_model_json
-class TestModel_SnapshotPrototypeSnapshotBySourceVolume:
+class TestModel_FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref:
"""
- Test Class for SnapshotPrototypeSnapshotBySourceVolume
+ Test Class for FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref
"""
- def test_snapshot_prototype_snapshot_by_source_volume_serialization(self):
+ def test_flow_log_collector_target_prototype_network_interface_identity_network_interface_identity_by_href_serialization(self):
"""
- Test serialization/deserialization for SnapshotPrototypeSnapshotBySourceVolume
+ Test serialization/deserialization for FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref
"""
- # 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'
-
- snapshot_clone_prototype_model = {} # SnapshotClonePrototype
- snapshot_clone_prototype_model['zone'] = zone_identity_model
-
- resource_group_identity_model = {} # ResourceGroupIdentityById
- resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
-
- volume_identity_model = {} # VolumeIdentityById
- volume_identity_model['id'] = '1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
-
- # Construct a json representation of a SnapshotPrototypeSnapshotBySourceVolume model
- snapshot_prototype_snapshot_by_source_volume_model_json = {}
- snapshot_prototype_snapshot_by_source_volume_model_json['clones'] = [snapshot_clone_prototype_model]
- snapshot_prototype_snapshot_by_source_volume_model_json['name'] = 'my-snapshot'
- snapshot_prototype_snapshot_by_source_volume_model_json['resource_group'] = resource_group_identity_model
- snapshot_prototype_snapshot_by_source_volume_model_json['user_tags'] = []
- snapshot_prototype_snapshot_by_source_volume_model_json['source_volume'] = volume_identity_model
+ # Construct a json representation of a FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref model
+ flow_log_collector_target_prototype_network_interface_identity_network_interface_identity_by_href_model_json = {}
+ flow_log_collector_target_prototype_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 SnapshotPrototypeSnapshotBySourceVolume by calling from_dict on the json representation
- snapshot_prototype_snapshot_by_source_volume_model = SnapshotPrototypeSnapshotBySourceVolume.from_dict(snapshot_prototype_snapshot_by_source_volume_model_json)
- assert snapshot_prototype_snapshot_by_source_volume_model != False
+ # Construct a model instance of FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref by calling from_dict on the json representation
+ flow_log_collector_target_prototype_network_interface_identity_network_interface_identity_by_href_model = FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref.from_dict(flow_log_collector_target_prototype_network_interface_identity_network_interface_identity_by_href_model_json)
+ assert flow_log_collector_target_prototype_network_interface_identity_network_interface_identity_by_href_model != False
- # Construct a model instance of SnapshotPrototypeSnapshotBySourceVolume by calling from_dict on the json representation
- snapshot_prototype_snapshot_by_source_volume_model_dict = SnapshotPrototypeSnapshotBySourceVolume.from_dict(snapshot_prototype_snapshot_by_source_volume_model_json).__dict__
- snapshot_prototype_snapshot_by_source_volume_model2 = SnapshotPrototypeSnapshotBySourceVolume(**snapshot_prototype_snapshot_by_source_volume_model_dict)
+ # Construct a model instance of FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref by calling from_dict on the json representation
+ flow_log_collector_target_prototype_network_interface_identity_network_interface_identity_by_href_model_dict = FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref.from_dict(flow_log_collector_target_prototype_network_interface_identity_network_interface_identity_by_href_model_json).__dict__
+ flow_log_collector_target_prototype_network_interface_identity_network_interface_identity_by_href_model2 = FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref(**flow_log_collector_target_prototype_network_interface_identity_network_interface_identity_by_href_model_dict)
# Verify the model instances are equivalent
- assert snapshot_prototype_snapshot_by_source_volume_model == snapshot_prototype_snapshot_by_source_volume_model2
+ assert flow_log_collector_target_prototype_network_interface_identity_network_interface_identity_by_href_model == flow_log_collector_target_prototype_network_interface_identity_network_interface_identity_by_href_model2
# Convert model instance back to dict and verify no loss of data
- snapshot_prototype_snapshot_by_source_volume_model_json2 = snapshot_prototype_snapshot_by_source_volume_model.to_dict()
- assert snapshot_prototype_snapshot_by_source_volume_model_json2 == snapshot_prototype_snapshot_by_source_volume_model_json
+ flow_log_collector_target_prototype_network_interface_identity_network_interface_identity_by_href_model_json2 = flow_log_collector_target_prototype_network_interface_identity_network_interface_identity_by_href_model.to_dict()
+ assert flow_log_collector_target_prototype_network_interface_identity_network_interface_identity_by_href_model_json2 == flow_log_collector_target_prototype_network_interface_identity_network_interface_identity_by_href_model_json
-class TestModel_SubnetIdentityByCRN:
+class TestModel_FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityById:
"""
- Test Class for SubnetIdentityByCRN
+ Test Class for FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityById
"""
- def test_subnet_identity_by_crn_serialization(self):
+ def test_flow_log_collector_target_prototype_network_interface_identity_network_interface_identity_by_id_serialization(self):
"""
- Test serialization/deserialization for SubnetIdentityByCRN
+ Test serialization/deserialization for FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityById
"""
- # Construct a json representation of a SubnetIdentityByCRN model
- subnet_identity_by_crn_model_json = {}
- subnet_identity_by_crn_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
+ # Construct a json representation of a FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityById model
+ flow_log_collector_target_prototype_network_interface_identity_network_interface_identity_by_id_model_json = {}
+ flow_log_collector_target_prototype_network_interface_identity_network_interface_identity_by_id_model_json['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e'
- # Construct a model instance of SubnetIdentityByCRN by calling from_dict on the json representation
- subnet_identity_by_crn_model = SubnetIdentityByCRN.from_dict(subnet_identity_by_crn_model_json)
- assert subnet_identity_by_crn_model != False
+ # Construct a model instance of FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityById by calling from_dict on the json representation
+ flow_log_collector_target_prototype_network_interface_identity_network_interface_identity_by_id_model = FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityById.from_dict(flow_log_collector_target_prototype_network_interface_identity_network_interface_identity_by_id_model_json)
+ assert flow_log_collector_target_prototype_network_interface_identity_network_interface_identity_by_id_model != False
- # Construct a model instance of SubnetIdentityByCRN by calling from_dict on the json representation
- subnet_identity_by_crn_model_dict = SubnetIdentityByCRN.from_dict(subnet_identity_by_crn_model_json).__dict__
- subnet_identity_by_crn_model2 = SubnetIdentityByCRN(**subnet_identity_by_crn_model_dict)
+ # Construct a model instance of FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityById by calling from_dict on the json representation
+ flow_log_collector_target_prototype_network_interface_identity_network_interface_identity_by_id_model_dict = FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityById.from_dict(flow_log_collector_target_prototype_network_interface_identity_network_interface_identity_by_id_model_json).__dict__
+ flow_log_collector_target_prototype_network_interface_identity_network_interface_identity_by_id_model2 = FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityById(**flow_log_collector_target_prototype_network_interface_identity_network_interface_identity_by_id_model_dict)
# Verify the model instances are equivalent
- assert subnet_identity_by_crn_model == subnet_identity_by_crn_model2
+ assert flow_log_collector_target_prototype_network_interface_identity_network_interface_identity_by_id_model == flow_log_collector_target_prototype_network_interface_identity_network_interface_identity_by_id_model2
# Convert model instance back to dict and verify no loss of data
- subnet_identity_by_crn_model_json2 = subnet_identity_by_crn_model.to_dict()
- assert subnet_identity_by_crn_model_json2 == subnet_identity_by_crn_model_json
+ flow_log_collector_target_prototype_network_interface_identity_network_interface_identity_by_id_model_json2 = flow_log_collector_target_prototype_network_interface_identity_network_interface_identity_by_id_model.to_dict()
+ assert flow_log_collector_target_prototype_network_interface_identity_network_interface_identity_by_id_model_json2 == flow_log_collector_target_prototype_network_interface_identity_network_interface_identity_by_id_model_json
-class TestModel_SubnetIdentityByHref:
+class TestModel_FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByCRN:
"""
- Test Class for SubnetIdentityByHref
+ Test Class for FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByCRN
"""
- def test_subnet_identity_by_href_serialization(self):
+ def test_flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_crn_serialization(self):
"""
- Test serialization/deserialization for SubnetIdentityByHref
+ Test serialization/deserialization for FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByCRN
"""
- # Construct a json representation of a SubnetIdentityByHref model
- subnet_identity_by_href_model_json = {}
- subnet_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
+ # Construct a json representation of a FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByCRN model
+ flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_crn_model_json = {}
+ flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_crn_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
- # Construct a model instance of SubnetIdentityByHref by calling from_dict on the json representation
- subnet_identity_by_href_model = SubnetIdentityByHref.from_dict(subnet_identity_by_href_model_json)
- assert subnet_identity_by_href_model != False
+ # Construct a model instance of FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByCRN by calling from_dict on the json representation
+ flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_crn_model = FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByCRN.from_dict(flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_crn_model_json)
+ assert flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_crn_model != False
- # Construct a model instance of SubnetIdentityByHref by calling from_dict on the json representation
- subnet_identity_by_href_model_dict = SubnetIdentityByHref.from_dict(subnet_identity_by_href_model_json).__dict__
- subnet_identity_by_href_model2 = SubnetIdentityByHref(**subnet_identity_by_href_model_dict)
+ # Construct a model instance of FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByCRN by calling from_dict on the json representation
+ flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_crn_model_dict = FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByCRN.from_dict(flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_crn_model_json).__dict__
+ flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_crn_model2 = FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByCRN(**flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_crn_model_dict)
# Verify the model instances are equivalent
- assert subnet_identity_by_href_model == subnet_identity_by_href_model2
+ assert flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_crn_model == flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_crn_model2
# Convert model instance back to dict and verify no loss of data
- subnet_identity_by_href_model_json2 = subnet_identity_by_href_model.to_dict()
- assert subnet_identity_by_href_model_json2 == subnet_identity_by_href_model_json
+ flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_crn_model_json2 = flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_crn_model.to_dict()
+ assert flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_crn_model_json2 == flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_crn_model_json
-class TestModel_SubnetIdentityById:
+class TestModel_FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByHref:
"""
- Test Class for SubnetIdentityById
+ Test Class for FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByHref
"""
- def test_subnet_identity_by_id_serialization(self):
+ def test_flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_href_serialization(self):
"""
- Test serialization/deserialization for SubnetIdentityById
+ Test serialization/deserialization for FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByHref
"""
- # Construct a json representation of a SubnetIdentityById model
- subnet_identity_by_id_model_json = {}
- subnet_identity_by_id_model_json['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
+ # Construct a json representation of a FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByHref model
+ flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_href_model_json = {}
+ flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
- # Construct a model instance of SubnetIdentityById by calling from_dict on the json representation
- subnet_identity_by_id_model = SubnetIdentityById.from_dict(subnet_identity_by_id_model_json)
- assert subnet_identity_by_id_model != False
+ # Construct a model instance of FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByHref by calling from_dict on the json representation
+ flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_href_model = FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByHref.from_dict(flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_href_model_json)
+ assert flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_href_model != False
- # Construct a model instance of SubnetIdentityById by calling from_dict on the json representation
- subnet_identity_by_id_model_dict = SubnetIdentityById.from_dict(subnet_identity_by_id_model_json).__dict__
- subnet_identity_by_id_model2 = SubnetIdentityById(**subnet_identity_by_id_model_dict)
+ # Construct a model instance of FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByHref by calling from_dict on the json representation
+ flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_href_model_dict = FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByHref.from_dict(flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_href_model_json).__dict__
+ flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_href_model2 = FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByHref(**flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_href_model_dict)
# Verify the model instances are equivalent
- assert subnet_identity_by_id_model == subnet_identity_by_id_model2
+ assert flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_href_model == flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_href_model2
# Convert model instance back to dict and verify no loss of data
- subnet_identity_by_id_model_json2 = subnet_identity_by_id_model.to_dict()
- assert subnet_identity_by_id_model_json2 == subnet_identity_by_id_model_json
+ flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_href_model_json2 = flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_href_model.to_dict()
+ assert flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_href_model_json2 == flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_href_model_json
-class TestModel_SubnetPrototypeSubnetByCIDR:
+class TestModel_FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityById:
"""
- Test Class for SubnetPrototypeSubnetByCIDR
+ Test Class for FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityById
"""
- def test_subnet_prototype_subnet_by_cidr_serialization(self):
+ def test_flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_id_serialization(self):
"""
- Test serialization/deserialization for SubnetPrototypeSubnetByCIDR
+ Test serialization/deserialization for FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityById
"""
- # 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'
-
- public_gateway_identity_model = {} # PublicGatewayIdentityPublicGatewayIdentityById
- public_gateway_identity_model['id'] = 'dc5431ef-1fc6-4861-adc9-a59d077d1241'
-
- resource_group_identity_model = {} # ResourceGroupIdentityById
- resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
-
- routing_table_identity_model = {} # RoutingTableIdentityById
- routing_table_identity_model['id'] = '6885e83f-03b2-4603-8a86-db2a0f55c840'
-
- vpc_identity_model = {} # VPCIdentityById
- vpc_identity_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b'
-
- zone_identity_model = {} # ZoneIdentityByName
- zone_identity_model['name'] = 'us-south-1'
-
- # Construct a json representation of a SubnetPrototypeSubnetByCIDR model
- subnet_prototype_subnet_by_cidr_model_json = {}
- subnet_prototype_subnet_by_cidr_model_json['ip_version'] = 'ipv4'
- subnet_prototype_subnet_by_cidr_model_json['name'] = 'my-subnet'
- subnet_prototype_subnet_by_cidr_model_json['network_acl'] = network_acl_identity_model
- subnet_prototype_subnet_by_cidr_model_json['public_gateway'] = public_gateway_identity_model
- subnet_prototype_subnet_by_cidr_model_json['resource_group'] = resource_group_identity_model
- subnet_prototype_subnet_by_cidr_model_json['routing_table'] = routing_table_identity_model
- subnet_prototype_subnet_by_cidr_model_json['vpc'] = vpc_identity_model
- subnet_prototype_subnet_by_cidr_model_json['ipv4_cidr_block'] = '10.0.0.0/24'
- subnet_prototype_subnet_by_cidr_model_json['zone'] = zone_identity_model
+ # Construct a json representation of a FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityById model
+ flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_id_model_json = {}
+ flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_id_model_json['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
- # Construct a model instance of SubnetPrototypeSubnetByCIDR by calling from_dict on the json representation
- subnet_prototype_subnet_by_cidr_model = SubnetPrototypeSubnetByCIDR.from_dict(subnet_prototype_subnet_by_cidr_model_json)
- assert subnet_prototype_subnet_by_cidr_model != False
+ # Construct a model instance of FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityById by calling from_dict on the json representation
+ flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_id_model = FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityById.from_dict(flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_id_model_json)
+ assert flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_id_model != False
- # Construct a model instance of SubnetPrototypeSubnetByCIDR by calling from_dict on the json representation
- subnet_prototype_subnet_by_cidr_model_dict = SubnetPrototypeSubnetByCIDR.from_dict(subnet_prototype_subnet_by_cidr_model_json).__dict__
- subnet_prototype_subnet_by_cidr_model2 = SubnetPrototypeSubnetByCIDR(**subnet_prototype_subnet_by_cidr_model_dict)
+ # Construct a model instance of FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityById by calling from_dict on the json representation
+ flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_id_model_dict = FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityById.from_dict(flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_id_model_json).__dict__
+ flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_id_model2 = FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityById(**flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_id_model_dict)
# Verify the model instances are equivalent
- assert subnet_prototype_subnet_by_cidr_model == subnet_prototype_subnet_by_cidr_model2
+ assert flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_id_model == flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_id_model2
# Convert model instance back to dict and verify no loss of data
- subnet_prototype_subnet_by_cidr_model_json2 = subnet_prototype_subnet_by_cidr_model.to_dict()
- assert subnet_prototype_subnet_by_cidr_model_json2 == subnet_prototype_subnet_by_cidr_model_json
+ flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_id_model_json2 = flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_id_model.to_dict()
+ assert flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_id_model_json2 == flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_id_model_json
-class TestModel_SubnetPrototypeSubnetByTotalCount:
+class TestModel_FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByCRN:
"""
- Test Class for SubnetPrototypeSubnetByTotalCount
+ Test Class for FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByCRN
"""
- def test_subnet_prototype_subnet_by_total_count_serialization(self):
+ def test_flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_crn_serialization(self):
"""
- Test serialization/deserialization for SubnetPrototypeSubnetByTotalCount
+ Test serialization/deserialization for FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByCRN
"""
- # Construct dict forms of any model objects needed in order to build this model.
+ # Construct a json representation of a FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByCRN model
+ flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_crn_model_json = {}
+ flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_crn_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b'
- network_acl_identity_model = {} # NetworkACLIdentityById
- network_acl_identity_model['id'] = 'a4e28308-8ee7-46ab-8108-9f881f22bdbf'
+ # Construct a model instance of FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByCRN by calling from_dict on the json representation
+ flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_crn_model = FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByCRN.from_dict(flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_crn_model_json)
+ assert flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_crn_model != False
- public_gateway_identity_model = {} # PublicGatewayIdentityPublicGatewayIdentityById
- public_gateway_identity_model['id'] = 'dc5431ef-1fc6-4861-adc9-a59d077d1241'
+ # Construct a model instance of FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByCRN by calling from_dict on the json representation
+ flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_crn_model_dict = FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByCRN.from_dict(flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_crn_model_json).__dict__
+ flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_crn_model2 = FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByCRN(**flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_crn_model_dict)
- resource_group_identity_model = {} # ResourceGroupIdentityById
- resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
+ # Verify the model instances are equivalent
+ assert flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_crn_model == flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_crn_model2
- routing_table_identity_model = {} # RoutingTableIdentityById
- routing_table_identity_model['id'] = '6885e83f-03b2-4603-8a86-db2a0f55c840'
+ # Convert model instance back to dict and verify no loss of data
+ flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_crn_model_json2 = flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_crn_model.to_dict()
+ assert flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_crn_model_json2 == flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_crn_model_json
- vpc_identity_model = {} # VPCIdentityById
- vpc_identity_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b'
- zone_identity_model = {} # ZoneIdentityByName
- zone_identity_model['name'] = 'us-south-1'
+class TestModel_FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByHref:
+ """
+ Test Class for FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByHref
+ """
- # Construct a json representation of a SubnetPrototypeSubnetByTotalCount model
- subnet_prototype_subnet_by_total_count_model_json = {}
- subnet_prototype_subnet_by_total_count_model_json['ip_version'] = 'ipv4'
- subnet_prototype_subnet_by_total_count_model_json['name'] = 'my-subnet'
- subnet_prototype_subnet_by_total_count_model_json['network_acl'] = network_acl_identity_model
- subnet_prototype_subnet_by_total_count_model_json['public_gateway'] = public_gateway_identity_model
- subnet_prototype_subnet_by_total_count_model_json['resource_group'] = resource_group_identity_model
- subnet_prototype_subnet_by_total_count_model_json['routing_table'] = routing_table_identity_model
- subnet_prototype_subnet_by_total_count_model_json['vpc'] = vpc_identity_model
- subnet_prototype_subnet_by_total_count_model_json['total_ipv4_address_count'] = 256
- subnet_prototype_subnet_by_total_count_model_json['zone'] = zone_identity_model
+ def test_flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_href_serialization(self):
+ """
+ Test serialization/deserialization for FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByHref
+ """
- # Construct a model instance of SubnetPrototypeSubnetByTotalCount by calling from_dict on the json representation
- subnet_prototype_subnet_by_total_count_model = SubnetPrototypeSubnetByTotalCount.from_dict(subnet_prototype_subnet_by_total_count_model_json)
- assert subnet_prototype_subnet_by_total_count_model != False
+ # Construct a json representation of a FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByHref model
+ flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_href_model_json = {}
+ flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b'
- # Construct a model instance of SubnetPrototypeSubnetByTotalCount by calling from_dict on the json representation
- subnet_prototype_subnet_by_total_count_model_dict = SubnetPrototypeSubnetByTotalCount.from_dict(subnet_prototype_subnet_by_total_count_model_json).__dict__
- subnet_prototype_subnet_by_total_count_model2 = SubnetPrototypeSubnetByTotalCount(**subnet_prototype_subnet_by_total_count_model_dict)
+ # Construct a model instance of FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByHref by calling from_dict on the json representation
+ flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_href_model = FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByHref.from_dict(flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_href_model_json)
+ assert flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_href_model != False
+
+ # Construct a model instance of FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByHref by calling from_dict on the json representation
+ flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_href_model_dict = FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByHref.from_dict(flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_href_model_json).__dict__
+ flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_href_model2 = FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByHref(**flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_href_model_dict)
# Verify the model instances are equivalent
- assert subnet_prototype_subnet_by_total_count_model == subnet_prototype_subnet_by_total_count_model2
+ assert flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_href_model == flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_href_model2
# Convert model instance back to dict and verify no loss of data
- 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
+ flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_href_model_json2 = flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_href_model.to_dict()
+ assert flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_href_model_json2 == flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_href_model_json
-class TestModel_SubnetPublicGatewayPatchPublicGatewayIdentityByCRN:
+class TestModel_FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityById:
"""
- Test Class for SubnetPublicGatewayPatchPublicGatewayIdentityByCRN
+ Test Class for FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityById
"""
- def test_subnet_public_gateway_patch_public_gateway_identity_by_crn_serialization(self):
+ def test_flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_id_serialization(self):
"""
- Test serialization/deserialization for SubnetPublicGatewayPatchPublicGatewayIdentityByCRN
+ Test serialization/deserialization for FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityById
"""
- # 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 json representation of a FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityById model
+ flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_id_model_json = {}
+ flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_id_model_json['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b'
- # 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 FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityById by calling from_dict on the json representation
+ flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_id_model = FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityById.from_dict(flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_id_model_json)
+ assert flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_id_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)
+ # Construct a model instance of FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityById by calling from_dict on the json representation
+ flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_id_model_dict = FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityById.from_dict(flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_id_model_json).__dict__
+ flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_id_model2 = FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityById(**flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_id_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
+ assert flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_id_model == flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_id_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
+ flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_id_model_json2 = flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_id_model.to_dict()
+ assert flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_id_model_json2 == flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_id_model_json
-class TestModel_SubnetPublicGatewayPatchPublicGatewayIdentityByHref:
+class TestModel_FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN:
"""
- Test Class for SubnetPublicGatewayPatchPublicGatewayIdentityByHref
+ Test Class for FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN
"""
- def test_subnet_public_gateway_patch_public_gateway_identity_by_href_serialization(self):
+ def test_flow_log_collector_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_crn_serialization(self):
"""
- Test serialization/deserialization for SubnetPublicGatewayPatchPublicGatewayIdentityByHref
+ Test serialization/deserialization for FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN
"""
- # 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 json representation of a FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN model
+ flow_log_collector_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_crn_model_json = {}
+ flow_log_collector_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_crn_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9'
- # 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 FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN by calling from_dict on the json representation
+ flow_log_collector_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_crn_model = FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN.from_dict(flow_log_collector_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_crn_model_json)
+ assert flow_log_collector_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_crn_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)
+ # Construct a model instance of FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN by calling from_dict on the json representation
+ flow_log_collector_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_crn_model_dict = FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN.from_dict(flow_log_collector_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_crn_model_json).__dict__
+ flow_log_collector_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_crn_model2 = FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN(**flow_log_collector_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_crn_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
+ assert flow_log_collector_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_crn_model == flow_log_collector_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_crn_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
+ flow_log_collector_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_crn_model_json2 = flow_log_collector_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_crn_model.to_dict()
+ assert flow_log_collector_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_crn_model_json2 == flow_log_collector_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_crn_model_json
-class TestModel_SubnetPublicGatewayPatchPublicGatewayIdentityById:
+class TestModel_FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref:
"""
- Test Class for SubnetPublicGatewayPatchPublicGatewayIdentityById
+ Test Class for FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref
"""
- def test_subnet_public_gateway_patch_public_gateway_identity_by_id_serialization(self):
+ def test_flow_log_collector_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_href_serialization(self):
"""
- Test serialization/deserialization for SubnetPublicGatewayPatchPublicGatewayIdentityById
+ Test serialization/deserialization for FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref
"""
- # 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 json representation of a FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref model
+ flow_log_collector_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_href_model_json = {}
+ flow_log_collector_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9'
- # 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 FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref by calling from_dict on the json representation
+ flow_log_collector_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_href_model = FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref.from_dict(flow_log_collector_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_href_model_json)
+ assert flow_log_collector_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_href_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)
+ # Construct a model instance of FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref by calling from_dict on the json representation
+ flow_log_collector_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_href_model_dict = FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref.from_dict(flow_log_collector_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_href_model_json).__dict__
+ flow_log_collector_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_href_model2 = FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref(**flow_log_collector_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_href_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
+ assert flow_log_collector_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_href_model == flow_log_collector_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_href_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
+ flow_log_collector_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_href_model_json2 = flow_log_collector_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_href_model.to_dict()
+ assert flow_log_collector_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_href_model_json2 == flow_log_collector_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_href_model_json
-class TestModel_TrustedProfileIdentityTrustedProfileByCRN:
+class TestModel_FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById:
"""
- Test Class for TrustedProfileIdentityTrustedProfileByCRN
+ Test Class for FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById
"""
- def test_trusted_profile_identity_trusted_profile_by_crn_serialization(self):
+ def test_flow_log_collector_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_id_serialization(self):
"""
- Test serialization/deserialization for TrustedProfileIdentityTrustedProfileByCRN
+ Test serialization/deserialization for FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById
"""
- # Construct a json representation of a TrustedProfileIdentityTrustedProfileByCRN model
- trusted_profile_identity_trusted_profile_by_crn_model_json = {}
- trusted_profile_identity_trusted_profile_by_crn_model_json['crn'] = 'crn:v1:bluemix:public:iam-identity::a/123456::profile:Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5'
+ # Construct a json representation of a FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById model
+ flow_log_collector_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_id_model_json = {}
+ flow_log_collector_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_id_model_json['id'] = '0767-fa41aecb-4f21-423d-8082-630bfba1e1d9'
- # Construct a model instance of TrustedProfileIdentityTrustedProfileByCRN by calling from_dict on the json representation
- trusted_profile_identity_trusted_profile_by_crn_model = TrustedProfileIdentityTrustedProfileByCRN.from_dict(trusted_profile_identity_trusted_profile_by_crn_model_json)
- assert trusted_profile_identity_trusted_profile_by_crn_model != False
+ # Construct a model instance of FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById by calling from_dict on the json representation
+ flow_log_collector_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_id_model = FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById.from_dict(flow_log_collector_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_id_model_json)
+ assert flow_log_collector_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_id_model != False
- # Construct a model instance of TrustedProfileIdentityTrustedProfileByCRN by calling from_dict on the json representation
- trusted_profile_identity_trusted_profile_by_crn_model_dict = TrustedProfileIdentityTrustedProfileByCRN.from_dict(trusted_profile_identity_trusted_profile_by_crn_model_json).__dict__
- trusted_profile_identity_trusted_profile_by_crn_model2 = TrustedProfileIdentityTrustedProfileByCRN(**trusted_profile_identity_trusted_profile_by_crn_model_dict)
+ # Construct a model instance of FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById by calling from_dict on the json representation
+ flow_log_collector_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_id_model_dict = FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById.from_dict(flow_log_collector_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_id_model_json).__dict__
+ flow_log_collector_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_id_model2 = FlowLogCollectorTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById(**flow_log_collector_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_id_model_dict)
# Verify the model instances are equivalent
- assert trusted_profile_identity_trusted_profile_by_crn_model == trusted_profile_identity_trusted_profile_by_crn_model2
+ assert flow_log_collector_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_id_model == flow_log_collector_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_id_model2
# Convert model instance back to dict and verify no loss of data
- trusted_profile_identity_trusted_profile_by_crn_model_json2 = trusted_profile_identity_trusted_profile_by_crn_model.to_dict()
- assert trusted_profile_identity_trusted_profile_by_crn_model_json2 == trusted_profile_identity_trusted_profile_by_crn_model_json
+ flow_log_collector_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_id_model_json2 = flow_log_collector_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_id_model.to_dict()
+ assert flow_log_collector_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_id_model_json2 == flow_log_collector_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_id_model_json
-class TestModel_TrustedProfileIdentityTrustedProfileById:
+class TestModel_InstanceGroupManagerActionScheduledActionGroupTarget:
"""
- Test Class for TrustedProfileIdentityTrustedProfileById
+ Test Class for InstanceGroupManagerActionScheduledActionGroupTarget
"""
- def test_trusted_profile_identity_trusted_profile_by_id_serialization(self):
+ def test_instance_group_manager_action_scheduled_action_group_target_serialization(self):
"""
- Test serialization/deserialization for TrustedProfileIdentityTrustedProfileById
+ Test serialization/deserialization for InstanceGroupManagerActionScheduledActionGroupTarget
"""
- # Construct a json representation of a TrustedProfileIdentityTrustedProfileById model
- trusted_profile_identity_trusted_profile_by_id_model_json = {}
- trusted_profile_identity_trusted_profile_by_id_model_json['id'] = 'Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5'
+ # Construct dict forms of any model objects needed in order to build this model.
- # Construct a model instance of TrustedProfileIdentityTrustedProfileById by calling from_dict on the json representation
- trusted_profile_identity_trusted_profile_by_id_model = TrustedProfileIdentityTrustedProfileById.from_dict(trusted_profile_identity_trusted_profile_by_id_model_json)
- assert trusted_profile_identity_trusted_profile_by_id_model != False
+ instance_group_manager_scheduled_action_group_model = {} # InstanceGroupManagerScheduledActionGroup
+ instance_group_manager_scheduled_action_group_model['membership_count'] = 10
- # Construct a model instance of TrustedProfileIdentityTrustedProfileById by calling from_dict on the json representation
- trusted_profile_identity_trusted_profile_by_id_model_dict = TrustedProfileIdentityTrustedProfileById.from_dict(trusted_profile_identity_trusted_profile_by_id_model_json).__dict__
- trusted_profile_identity_trusted_profile_by_id_model2 = TrustedProfileIdentityTrustedProfileById(**trusted_profile_identity_trusted_profile_by_id_model_dict)
+ # Construct a json representation of a InstanceGroupManagerActionScheduledActionGroupTarget model
+ instance_group_manager_action_scheduled_action_group_target_model_json = {}
+ instance_group_manager_action_scheduled_action_group_target_model_json['auto_delete'] = True
+ instance_group_manager_action_scheduled_action_group_target_model_json['auto_delete_timeout'] = 24
+ instance_group_manager_action_scheduled_action_group_target_model_json['created_at'] = '2019-01-01T12:00:00Z'
+ instance_group_manager_action_scheduled_action_group_target_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_scheduled_action_group_target_model_json['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
+ instance_group_manager_action_scheduled_action_group_target_model_json['name'] = 'my-instance-group-manager-action'
+ instance_group_manager_action_scheduled_action_group_target_model_json['resource_type'] = 'instance_group_manager_action'
+ instance_group_manager_action_scheduled_action_group_target_model_json['status'] = 'active'
+ instance_group_manager_action_scheduled_action_group_target_model_json['updated_at'] = '2019-01-01T12:00:00Z'
+ instance_group_manager_action_scheduled_action_group_target_model_json['action_type'] = 'scheduled'
+ instance_group_manager_action_scheduled_action_group_target_model_json['cron_spec'] = '30 */2 * * 1-5'
+ instance_group_manager_action_scheduled_action_group_target_model_json['last_applied_at'] = '2019-01-01T12:00:00Z'
+ instance_group_manager_action_scheduled_action_group_target_model_json['next_run_at'] = '2019-01-01T12:00:00Z'
+ instance_group_manager_action_scheduled_action_group_target_model_json['group'] = instance_group_manager_scheduled_action_group_model
+
+ # Construct a model instance of InstanceGroupManagerActionScheduledActionGroupTarget by calling from_dict on the json representation
+ instance_group_manager_action_scheduled_action_group_target_model = InstanceGroupManagerActionScheduledActionGroupTarget.from_dict(instance_group_manager_action_scheduled_action_group_target_model_json)
+ assert instance_group_manager_action_scheduled_action_group_target_model != False
+
+ # Construct a model instance of InstanceGroupManagerActionScheduledActionGroupTarget by calling from_dict on the json representation
+ instance_group_manager_action_scheduled_action_group_target_model_dict = InstanceGroupManagerActionScheduledActionGroupTarget.from_dict(instance_group_manager_action_scheduled_action_group_target_model_json).__dict__
+ instance_group_manager_action_scheduled_action_group_target_model2 = InstanceGroupManagerActionScheduledActionGroupTarget(**instance_group_manager_action_scheduled_action_group_target_model_dict)
# Verify the model instances are equivalent
- assert trusted_profile_identity_trusted_profile_by_id_model == trusted_profile_identity_trusted_profile_by_id_model2
+ assert instance_group_manager_action_scheduled_action_group_target_model == instance_group_manager_action_scheduled_action_group_target_model2
# Convert model instance back to dict and verify no loss of data
- trusted_profile_identity_trusted_profile_by_id_model_json2 = trusted_profile_identity_trusted_profile_by_id_model.to_dict()
- assert trusted_profile_identity_trusted_profile_by_id_model_json2 == trusted_profile_identity_trusted_profile_by_id_model_json
+ instance_group_manager_action_scheduled_action_group_target_model_json2 = instance_group_manager_action_scheduled_action_group_target_model.to_dict()
+ assert instance_group_manager_action_scheduled_action_group_target_model_json2 == instance_group_manager_action_scheduled_action_group_target_model_json
-class TestModel_VPCDNSResolverPrototypeVPCDNSResolverTypeManualPrototype:
+class TestModel_InstanceGroupManagerActionScheduledActionManagerTarget:
"""
- Test Class for VPCDNSResolverPrototypeVPCDNSResolverTypeManualPrototype
+ Test Class for InstanceGroupManagerActionScheduledActionManagerTarget
"""
- def test_vpcdns_resolver_prototype_vpcdns_resolver_type_manual_prototype_serialization(self):
+ def test_instance_group_manager_action_scheduled_action_manager_target_serialization(self):
"""
- Test serialization/deserialization for VPCDNSResolverPrototypeVPCDNSResolverTypeManualPrototype
+ Test serialization/deserialization for InstanceGroupManagerActionScheduledActionManagerTarget
"""
# 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'
+ instance_group_manager_reference_deleted_model = {} # InstanceGroupManagerReferenceDeleted
+ instance_group_manager_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- dns_server_prototype_model = {} # DNSServerPrototype
- dns_server_prototype_model['address'] = '192.168.3.4'
- dns_server_prototype_model['zone_affinity'] = zone_identity_model
+ instance_group_manager_scheduled_action_manager_model = {} # InstanceGroupManagerScheduledActionManagerAutoScale
+ instance_group_manager_scheduled_action_manager_model['deleted'] = instance_group_manager_reference_deleted_model
+ instance_group_manager_scheduled_action_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_scheduled_action_manager_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
+ instance_group_manager_scheduled_action_manager_model['name'] = 'my-instance-group-manager'
+ instance_group_manager_scheduled_action_manager_model['max_membership_count'] = 10
+ instance_group_manager_scheduled_action_manager_model['min_membership_count'] = 10
- # Construct a json representation of a VPCDNSResolverPrototypeVPCDNSResolverTypeManualPrototype model
- vpcdns_resolver_prototype_vpcdns_resolver_type_manual_prototype_model_json = {}
- vpcdns_resolver_prototype_vpcdns_resolver_type_manual_prototype_model_json['manual_servers'] = [dns_server_prototype_model]
- vpcdns_resolver_prototype_vpcdns_resolver_type_manual_prototype_model_json['type'] = 'manual'
+ # Construct a json representation of a InstanceGroupManagerActionScheduledActionManagerTarget model
+ instance_group_manager_action_scheduled_action_manager_target_model_json = {}
+ instance_group_manager_action_scheduled_action_manager_target_model_json['auto_delete'] = True
+ instance_group_manager_action_scheduled_action_manager_target_model_json['auto_delete_timeout'] = 24
+ instance_group_manager_action_scheduled_action_manager_target_model_json['created_at'] = '2019-01-01T12:00:00Z'
+ instance_group_manager_action_scheduled_action_manager_target_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_scheduled_action_manager_target_model_json['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
+ instance_group_manager_action_scheduled_action_manager_target_model_json['name'] = 'my-instance-group-manager-action'
+ instance_group_manager_action_scheduled_action_manager_target_model_json['resource_type'] = 'instance_group_manager_action'
+ instance_group_manager_action_scheduled_action_manager_target_model_json['status'] = 'active'
+ instance_group_manager_action_scheduled_action_manager_target_model_json['updated_at'] = '2019-01-01T12:00:00Z'
+ instance_group_manager_action_scheduled_action_manager_target_model_json['action_type'] = 'scheduled'
+ instance_group_manager_action_scheduled_action_manager_target_model_json['cron_spec'] = '30 */2 * * 1-5'
+ instance_group_manager_action_scheduled_action_manager_target_model_json['last_applied_at'] = '2019-01-01T12:00:00Z'
+ instance_group_manager_action_scheduled_action_manager_target_model_json['next_run_at'] = '2019-01-01T12:00:00Z'
+ instance_group_manager_action_scheduled_action_manager_target_model_json['manager'] = instance_group_manager_scheduled_action_manager_model
- # Construct a model instance of VPCDNSResolverPrototypeVPCDNSResolverTypeManualPrototype by calling from_dict on the json representation
- vpcdns_resolver_prototype_vpcdns_resolver_type_manual_prototype_model = VPCDNSResolverPrototypeVPCDNSResolverTypeManualPrototype.from_dict(vpcdns_resolver_prototype_vpcdns_resolver_type_manual_prototype_model_json)
- assert vpcdns_resolver_prototype_vpcdns_resolver_type_manual_prototype_model != False
+ # Construct a model instance of InstanceGroupManagerActionScheduledActionManagerTarget by calling from_dict on the json representation
+ instance_group_manager_action_scheduled_action_manager_target_model = InstanceGroupManagerActionScheduledActionManagerTarget.from_dict(instance_group_manager_action_scheduled_action_manager_target_model_json)
+ assert instance_group_manager_action_scheduled_action_manager_target_model != False
- # Construct a model instance of VPCDNSResolverPrototypeVPCDNSResolverTypeManualPrototype by calling from_dict on the json representation
- vpcdns_resolver_prototype_vpcdns_resolver_type_manual_prototype_model_dict = VPCDNSResolverPrototypeVPCDNSResolverTypeManualPrototype.from_dict(vpcdns_resolver_prototype_vpcdns_resolver_type_manual_prototype_model_json).__dict__
- vpcdns_resolver_prototype_vpcdns_resolver_type_manual_prototype_model2 = VPCDNSResolverPrototypeVPCDNSResolverTypeManualPrototype(**vpcdns_resolver_prototype_vpcdns_resolver_type_manual_prototype_model_dict)
+ # Construct a model instance of InstanceGroupManagerActionScheduledActionManagerTarget by calling from_dict on the json representation
+ instance_group_manager_action_scheduled_action_manager_target_model_dict = InstanceGroupManagerActionScheduledActionManagerTarget.from_dict(instance_group_manager_action_scheduled_action_manager_target_model_json).__dict__
+ instance_group_manager_action_scheduled_action_manager_target_model2 = InstanceGroupManagerActionScheduledActionManagerTarget(**instance_group_manager_action_scheduled_action_manager_target_model_dict)
# Verify the model instances are equivalent
- assert vpcdns_resolver_prototype_vpcdns_resolver_type_manual_prototype_model == vpcdns_resolver_prototype_vpcdns_resolver_type_manual_prototype_model2
+ assert instance_group_manager_action_scheduled_action_manager_target_model == instance_group_manager_action_scheduled_action_manager_target_model2
# Convert model instance back to dict and verify no loss of data
- vpcdns_resolver_prototype_vpcdns_resolver_type_manual_prototype_model_json2 = vpcdns_resolver_prototype_vpcdns_resolver_type_manual_prototype_model.to_dict()
- assert vpcdns_resolver_prototype_vpcdns_resolver_type_manual_prototype_model_json2 == vpcdns_resolver_prototype_vpcdns_resolver_type_manual_prototype_model_json
+ instance_group_manager_action_scheduled_action_manager_target_model_json2 = instance_group_manager_action_scheduled_action_manager_target_model.to_dict()
+ assert instance_group_manager_action_scheduled_action_manager_target_model_json2 == instance_group_manager_action_scheduled_action_manager_target_model_json
-class TestModel_VPCDNSResolverPrototypeVPCDNSResolverTypeSystemPrototype:
+class TestModel_InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByHref:
"""
- Test Class for VPCDNSResolverPrototypeVPCDNSResolverTypeSystemPrototype
+ Test Class for InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByHref
"""
- def test_vpcdns_resolver_prototype_vpcdns_resolver_type_system_prototype_serialization(self):
+ def test_instance_group_manager_scheduled_action_manager_prototype_auto_scale_prototype_by_href_serialization(self):
"""
- Test serialization/deserialization for VPCDNSResolverPrototypeVPCDNSResolverTypeSystemPrototype
+ Test serialization/deserialization for InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByHref
"""
- # Construct a json representation of a VPCDNSResolverPrototypeVPCDNSResolverTypeSystemPrototype model
- vpcdns_resolver_prototype_vpcdns_resolver_type_system_prototype_model_json = {}
- vpcdns_resolver_prototype_vpcdns_resolver_type_system_prototype_model_json['type'] = 'system'
+ # Construct a json representation of a InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByHref model
+ instance_group_manager_scheduled_action_manager_prototype_auto_scale_prototype_by_href_model_json = {}
+ instance_group_manager_scheduled_action_manager_prototype_auto_scale_prototype_by_href_model_json['max_membership_count'] = 10
+ instance_group_manager_scheduled_action_manager_prototype_auto_scale_prototype_by_href_model_json['min_membership_count'] = 10
+ instance_group_manager_scheduled_action_manager_prototype_auto_scale_prototype_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/managers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727'
- # Construct a model instance of VPCDNSResolverPrototypeVPCDNSResolverTypeSystemPrototype by calling from_dict on the json representation
- vpcdns_resolver_prototype_vpcdns_resolver_type_system_prototype_model = VPCDNSResolverPrototypeVPCDNSResolverTypeSystemPrototype.from_dict(vpcdns_resolver_prototype_vpcdns_resolver_type_system_prototype_model_json)
- assert vpcdns_resolver_prototype_vpcdns_resolver_type_system_prototype_model != False
+ # Construct a model instance of InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByHref by calling from_dict on the json representation
+ instance_group_manager_scheduled_action_manager_prototype_auto_scale_prototype_by_href_model = InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByHref.from_dict(instance_group_manager_scheduled_action_manager_prototype_auto_scale_prototype_by_href_model_json)
+ assert instance_group_manager_scheduled_action_manager_prototype_auto_scale_prototype_by_href_model != False
- # Construct a model instance of VPCDNSResolverPrototypeVPCDNSResolverTypeSystemPrototype by calling from_dict on the json representation
- vpcdns_resolver_prototype_vpcdns_resolver_type_system_prototype_model_dict = VPCDNSResolverPrototypeVPCDNSResolverTypeSystemPrototype.from_dict(vpcdns_resolver_prototype_vpcdns_resolver_type_system_prototype_model_json).__dict__
- vpcdns_resolver_prototype_vpcdns_resolver_type_system_prototype_model2 = VPCDNSResolverPrototypeVPCDNSResolverTypeSystemPrototype(**vpcdns_resolver_prototype_vpcdns_resolver_type_system_prototype_model_dict)
+ # Construct a model instance of InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByHref by calling from_dict on the json representation
+ instance_group_manager_scheduled_action_manager_prototype_auto_scale_prototype_by_href_model_dict = InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByHref.from_dict(instance_group_manager_scheduled_action_manager_prototype_auto_scale_prototype_by_href_model_json).__dict__
+ instance_group_manager_scheduled_action_manager_prototype_auto_scale_prototype_by_href_model2 = InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByHref(**instance_group_manager_scheduled_action_manager_prototype_auto_scale_prototype_by_href_model_dict)
# Verify the model instances are equivalent
- assert vpcdns_resolver_prototype_vpcdns_resolver_type_system_prototype_model == vpcdns_resolver_prototype_vpcdns_resolver_type_system_prototype_model2
+ assert instance_group_manager_scheduled_action_manager_prototype_auto_scale_prototype_by_href_model == instance_group_manager_scheduled_action_manager_prototype_auto_scale_prototype_by_href_model2
# Convert model instance back to dict and verify no loss of data
- vpcdns_resolver_prototype_vpcdns_resolver_type_system_prototype_model_json2 = vpcdns_resolver_prototype_vpcdns_resolver_type_system_prototype_model.to_dict()
- assert vpcdns_resolver_prototype_vpcdns_resolver_type_system_prototype_model_json2 == vpcdns_resolver_prototype_vpcdns_resolver_type_system_prototype_model_json
+ instance_group_manager_scheduled_action_manager_prototype_auto_scale_prototype_by_href_model_json2 = instance_group_manager_scheduled_action_manager_prototype_auto_scale_prototype_by_href_model.to_dict()
+ assert instance_group_manager_scheduled_action_manager_prototype_auto_scale_prototype_by_href_model_json2 == instance_group_manager_scheduled_action_manager_prototype_auto_scale_prototype_by_href_model_json
-class TestModel_VPCDNSResolverTypeDelegated:
+class TestModel_InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeById:
"""
- Test Class for VPCDNSResolverTypeDelegated
+ Test Class for InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeById
"""
- def test_vpcdns_resolver_type_delegated_serialization(self):
+ def test_instance_group_manager_scheduled_action_manager_prototype_auto_scale_prototype_by_id_serialization(self):
"""
- Test serialization/deserialization for VPCDNSResolverTypeDelegated
+ Test serialization/deserialization for InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeById
"""
- # Construct dict forms of any model objects needed in order to build this model.
+ # Construct a json representation of a InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeById model
+ instance_group_manager_scheduled_action_manager_prototype_auto_scale_prototype_by_id_model_json = {}
+ instance_group_manager_scheduled_action_manager_prototype_auto_scale_prototype_by_id_model_json['max_membership_count'] = 10
+ instance_group_manager_scheduled_action_manager_prototype_auto_scale_prototype_by_id_model_json['min_membership_count'] = 10
+ instance_group_manager_scheduled_action_manager_prototype_auto_scale_prototype_by_id_model_json['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
- 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 InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeById by calling from_dict on the json representation
+ instance_group_manager_scheduled_action_manager_prototype_auto_scale_prototype_by_id_model = InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeById.from_dict(instance_group_manager_scheduled_action_manager_prototype_auto_scale_prototype_by_id_model_json)
+ assert instance_group_manager_scheduled_action_manager_prototype_auto_scale_prototype_by_id_model != False
- dns_server_model = {} # DNSServer
- dns_server_model['address'] = '192.168.3.4'
- dns_server_model['zone_affinity'] = zone_reference_model
+ # Construct a model instance of InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeById by calling from_dict on the json representation
+ instance_group_manager_scheduled_action_manager_prototype_auto_scale_prototype_by_id_model_dict = InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeById.from_dict(instance_group_manager_scheduled_action_manager_prototype_auto_scale_prototype_by_id_model_json).__dict__
+ instance_group_manager_scheduled_action_manager_prototype_auto_scale_prototype_by_id_model2 = InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeById(**instance_group_manager_scheduled_action_manager_prototype_auto_scale_prototype_by_id_model_dict)
- vpc_reference_dns_resolver_context_deleted_model = {} # VPCReferenceDNSResolverContextDeleted
- vpc_reference_dns_resolver_context_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ # Verify the model instances are equivalent
+ assert instance_group_manager_scheduled_action_manager_prototype_auto_scale_prototype_by_id_model == instance_group_manager_scheduled_action_manager_prototype_auto_scale_prototype_by_id_model2
- account_reference_model = {} # AccountReference
- account_reference_model['id'] = 'aa2432b1fa4d4ace891e9b80fc104e34'
- account_reference_model['resource_type'] = 'account'
+ # Convert model instance back to dict and verify no loss of data
+ 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
- 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'
- vpc_remote_model = {} # VPCRemote
- vpc_remote_model['account'] = account_reference_model
- vpc_remote_model['region'] = region_reference_model
+class TestModel_InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN:
+ """
+ Test Class for InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN
+ """
- vpc_reference_dns_resolver_context_model = {} # VPCReferenceDNSResolverContext
- vpc_reference_dns_resolver_context_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b'
- vpc_reference_dns_resolver_context_model['deleted'] = vpc_reference_dns_resolver_context_deleted_model
- vpc_reference_dns_resolver_context_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b'
- vpc_reference_dns_resolver_context_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b'
- vpc_reference_dns_resolver_context_model['name'] = 'my-vpc'
- vpc_reference_dns_resolver_context_model['remote'] = vpc_remote_model
- vpc_reference_dns_resolver_context_model['resource_type'] = 'vpc'
+ def test_instance_network_attachment_prototype_virtual_network_interface_virtual_network_interface_identity_virtual_network_interface_identity_by_crn_serialization(self):
+ """
+ Test serialization/deserialization for InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN
+ """
- # Construct a json representation of a VPCDNSResolverTypeDelegated model
- vpcdns_resolver_type_delegated_model_json = {}
- vpcdns_resolver_type_delegated_model_json['servers'] = [dns_server_model]
- vpcdns_resolver_type_delegated_model_json['type'] = 'delegated'
- vpcdns_resolver_type_delegated_model_json['vpc'] = vpc_reference_dns_resolver_context_model
+ # Construct a json representation of a InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN model
+ instance_network_attachment_prototype_virtual_network_interface_virtual_network_interface_identity_virtual_network_interface_identity_by_crn_model_json = {}
+ instance_network_attachment_prototype_virtual_network_interface_virtual_network_interface_identity_virtual_network_interface_identity_by_crn_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9'
- # Construct a model instance of VPCDNSResolverTypeDelegated by calling from_dict on the json representation
- vpcdns_resolver_type_delegated_model = VPCDNSResolverTypeDelegated.from_dict(vpcdns_resolver_type_delegated_model_json)
- assert vpcdns_resolver_type_delegated_model != False
+ # Construct a model instance of InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN by calling from_dict on the json representation
+ instance_network_attachment_prototype_virtual_network_interface_virtual_network_interface_identity_virtual_network_interface_identity_by_crn_model = InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN.from_dict(instance_network_attachment_prototype_virtual_network_interface_virtual_network_interface_identity_virtual_network_interface_identity_by_crn_model_json)
+ assert instance_network_attachment_prototype_virtual_network_interface_virtual_network_interface_identity_virtual_network_interface_identity_by_crn_model != False
- # Construct a model instance of VPCDNSResolverTypeDelegated by calling from_dict on the json representation
- vpcdns_resolver_type_delegated_model_dict = VPCDNSResolverTypeDelegated.from_dict(vpcdns_resolver_type_delegated_model_json).__dict__
- vpcdns_resolver_type_delegated_model2 = VPCDNSResolverTypeDelegated(**vpcdns_resolver_type_delegated_model_dict)
+ # Construct a model instance of InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN by calling from_dict on the json representation
+ instance_network_attachment_prototype_virtual_network_interface_virtual_network_interface_identity_virtual_network_interface_identity_by_crn_model_dict = InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN.from_dict(instance_network_attachment_prototype_virtual_network_interface_virtual_network_interface_identity_virtual_network_interface_identity_by_crn_model_json).__dict__
+ instance_network_attachment_prototype_virtual_network_interface_virtual_network_interface_identity_virtual_network_interface_identity_by_crn_model2 = InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN(**instance_network_attachment_prototype_virtual_network_interface_virtual_network_interface_identity_virtual_network_interface_identity_by_crn_model_dict)
# Verify the model instances are equivalent
- assert vpcdns_resolver_type_delegated_model == vpcdns_resolver_type_delegated_model2
+ assert instance_network_attachment_prototype_virtual_network_interface_virtual_network_interface_identity_virtual_network_interface_identity_by_crn_model == instance_network_attachment_prototype_virtual_network_interface_virtual_network_interface_identity_virtual_network_interface_identity_by_crn_model2
# Convert model instance back to dict and verify no loss of data
- vpcdns_resolver_type_delegated_model_json2 = vpcdns_resolver_type_delegated_model.to_dict()
- assert vpcdns_resolver_type_delegated_model_json2 == vpcdns_resolver_type_delegated_model_json
+ instance_network_attachment_prototype_virtual_network_interface_virtual_network_interface_identity_virtual_network_interface_identity_by_crn_model_json2 = instance_network_attachment_prototype_virtual_network_interface_virtual_network_interface_identity_virtual_network_interface_identity_by_crn_model.to_dict()
+ assert instance_network_attachment_prototype_virtual_network_interface_virtual_network_interface_identity_virtual_network_interface_identity_by_crn_model_json2 == instance_network_attachment_prototype_virtual_network_interface_virtual_network_interface_identity_virtual_network_interface_identity_by_crn_model_json
-class TestModel_VPCDNSResolverTypeManual:
+class TestModel_InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref:
"""
- Test Class for VPCDNSResolverTypeManual
+ Test Class for InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref
"""
- def test_vpcdns_resolver_type_manual_serialization(self):
+ def test_instance_network_attachment_prototype_virtual_network_interface_virtual_network_interface_identity_virtual_network_interface_identity_by_href_serialization(self):
"""
- Test serialization/deserialization for VPCDNSResolverTypeManual
+ Test serialization/deserialization for InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref
"""
- # 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'
-
- dns_server_model = {} # DNSServer
- dns_server_model['address'] = '192.168.3.4'
- dns_server_model['zone_affinity'] = zone_reference_model
-
- # Construct a json representation of a VPCDNSResolverTypeManual model
- vpcdns_resolver_type_manual_model_json = {}
- vpcdns_resolver_type_manual_model_json['servers'] = [dns_server_model]
- vpcdns_resolver_type_manual_model_json['manual_servers'] = [dns_server_model]
- vpcdns_resolver_type_manual_model_json['type'] = 'manual'
+ # Construct a json representation of a InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref model
+ instance_network_attachment_prototype_virtual_network_interface_virtual_network_interface_identity_virtual_network_interface_identity_by_href_model_json = {}
+ instance_network_attachment_prototype_virtual_network_interface_virtual_network_interface_identity_virtual_network_interface_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9'
- # Construct a model instance of VPCDNSResolverTypeManual by calling from_dict on the json representation
- vpcdns_resolver_type_manual_model = VPCDNSResolverTypeManual.from_dict(vpcdns_resolver_type_manual_model_json)
- assert vpcdns_resolver_type_manual_model != False
+ # Construct a model instance of InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref by calling from_dict on the json representation
+ instance_network_attachment_prototype_virtual_network_interface_virtual_network_interface_identity_virtual_network_interface_identity_by_href_model = InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref.from_dict(instance_network_attachment_prototype_virtual_network_interface_virtual_network_interface_identity_virtual_network_interface_identity_by_href_model_json)
+ assert instance_network_attachment_prototype_virtual_network_interface_virtual_network_interface_identity_virtual_network_interface_identity_by_href_model != False
- # Construct a model instance of VPCDNSResolverTypeManual by calling from_dict on the json representation
- vpcdns_resolver_type_manual_model_dict = VPCDNSResolverTypeManual.from_dict(vpcdns_resolver_type_manual_model_json).__dict__
- vpcdns_resolver_type_manual_model2 = VPCDNSResolverTypeManual(**vpcdns_resolver_type_manual_model_dict)
+ # Construct a model instance of InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref by calling from_dict on the json representation
+ instance_network_attachment_prototype_virtual_network_interface_virtual_network_interface_identity_virtual_network_interface_identity_by_href_model_dict = InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref.from_dict(instance_network_attachment_prototype_virtual_network_interface_virtual_network_interface_identity_virtual_network_interface_identity_by_href_model_json).__dict__
+ instance_network_attachment_prototype_virtual_network_interface_virtual_network_interface_identity_virtual_network_interface_identity_by_href_model2 = InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref(**instance_network_attachment_prototype_virtual_network_interface_virtual_network_interface_identity_virtual_network_interface_identity_by_href_model_dict)
# Verify the model instances are equivalent
- assert vpcdns_resolver_type_manual_model == vpcdns_resolver_type_manual_model2
+ assert instance_network_attachment_prototype_virtual_network_interface_virtual_network_interface_identity_virtual_network_interface_identity_by_href_model == instance_network_attachment_prototype_virtual_network_interface_virtual_network_interface_identity_virtual_network_interface_identity_by_href_model2
# Convert model instance back to dict and verify no loss of data
- vpcdns_resolver_type_manual_model_json2 = vpcdns_resolver_type_manual_model.to_dict()
- assert vpcdns_resolver_type_manual_model_json2 == vpcdns_resolver_type_manual_model_json
+ instance_network_attachment_prototype_virtual_network_interface_virtual_network_interface_identity_virtual_network_interface_identity_by_href_model_json2 = instance_network_attachment_prototype_virtual_network_interface_virtual_network_interface_identity_virtual_network_interface_identity_by_href_model.to_dict()
+ assert instance_network_attachment_prototype_virtual_network_interface_virtual_network_interface_identity_virtual_network_interface_identity_by_href_model_json2 == instance_network_attachment_prototype_virtual_network_interface_virtual_network_interface_identity_virtual_network_interface_identity_by_href_model_json
-class TestModel_VPCDNSResolverTypeSystem:
+class TestModel_InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById:
"""
- Test Class for VPCDNSResolverTypeSystem
+ Test Class for InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById
"""
- def test_vpcdns_resolver_type_system_serialization(self):
+ def test_instance_network_attachment_prototype_virtual_network_interface_virtual_network_interface_identity_virtual_network_interface_identity_by_id_serialization(self):
"""
- Test serialization/deserialization for VPCDNSResolverTypeSystem
+ Test serialization/deserialization for InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById
"""
- # 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'
-
- dns_server_model = {} # DNSServer
- dns_server_model['address'] = '192.168.3.4'
- dns_server_model['zone_affinity'] = zone_reference_model
-
- # Construct a json representation of a VPCDNSResolverTypeSystem model
- vpcdns_resolver_type_system_model_json = {}
- vpcdns_resolver_type_system_model_json['servers'] = [dns_server_model]
- vpcdns_resolver_type_system_model_json['configuration'] = 'custom_resolver'
- vpcdns_resolver_type_system_model_json['type'] = 'system'
+ # Construct a json representation of a InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById model
+ instance_network_attachment_prototype_virtual_network_interface_virtual_network_interface_identity_virtual_network_interface_identity_by_id_model_json = {}
+ instance_network_attachment_prototype_virtual_network_interface_virtual_network_interface_identity_virtual_network_interface_identity_by_id_model_json['id'] = '0767-fa41aecb-4f21-423d-8082-630bfba1e1d9'
- # Construct a model instance of VPCDNSResolverTypeSystem by calling from_dict on the json representation
- vpcdns_resolver_type_system_model = VPCDNSResolverTypeSystem.from_dict(vpcdns_resolver_type_system_model_json)
- assert vpcdns_resolver_type_system_model != False
+ # Construct a model instance of InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById by calling from_dict on the json representation
+ instance_network_attachment_prototype_virtual_network_interface_virtual_network_interface_identity_virtual_network_interface_identity_by_id_model = InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById.from_dict(instance_network_attachment_prototype_virtual_network_interface_virtual_network_interface_identity_virtual_network_interface_identity_by_id_model_json)
+ assert instance_network_attachment_prototype_virtual_network_interface_virtual_network_interface_identity_virtual_network_interface_identity_by_id_model != False
- # Construct a model instance of VPCDNSResolverTypeSystem by calling from_dict on the json representation
- vpcdns_resolver_type_system_model_dict = VPCDNSResolverTypeSystem.from_dict(vpcdns_resolver_type_system_model_json).__dict__
- vpcdns_resolver_type_system_model2 = VPCDNSResolverTypeSystem(**vpcdns_resolver_type_system_model_dict)
+ # Construct a model instance of InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById by calling from_dict on the json representation
+ instance_network_attachment_prototype_virtual_network_interface_virtual_network_interface_identity_virtual_network_interface_identity_by_id_model_dict = InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById.from_dict(instance_network_attachment_prototype_virtual_network_interface_virtual_network_interface_identity_virtual_network_interface_identity_by_id_model_json).__dict__
+ instance_network_attachment_prototype_virtual_network_interface_virtual_network_interface_identity_virtual_network_interface_identity_by_id_model2 = InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById(**instance_network_attachment_prototype_virtual_network_interface_virtual_network_interface_identity_virtual_network_interface_identity_by_id_model_dict)
# Verify the model instances are equivalent
- assert vpcdns_resolver_type_system_model == vpcdns_resolver_type_system_model2
+ assert instance_network_attachment_prototype_virtual_network_interface_virtual_network_interface_identity_virtual_network_interface_identity_by_id_model == instance_network_attachment_prototype_virtual_network_interface_virtual_network_interface_identity_virtual_network_interface_identity_by_id_model2
# Convert model instance back to dict and verify no loss of data
- vpcdns_resolver_type_system_model_json2 = vpcdns_resolver_type_system_model.to_dict()
- assert vpcdns_resolver_type_system_model_json2 == vpcdns_resolver_type_system_model_json
+ instance_network_attachment_prototype_virtual_network_interface_virtual_network_interface_identity_virtual_network_interface_identity_by_id_model_json2 = instance_network_attachment_prototype_virtual_network_interface_virtual_network_interface_identity_virtual_network_interface_identity_by_id_model.to_dict()
+ assert instance_network_attachment_prototype_virtual_network_interface_virtual_network_interface_identity_virtual_network_interface_identity_by_id_model_json2 == instance_network_attachment_prototype_virtual_network_interface_virtual_network_interface_identity_virtual_network_interface_identity_by_id_model_json
-class TestModel_VPCDNSResolverVPCPatchVPCIdentityByCRN:
+class TestModel_InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN:
"""
- Test Class for VPCDNSResolverVPCPatchVPCIdentityByCRN
+ Test Class for InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN
"""
- def test_vpcdns_resolver_vpc_patch_vpc_identity_by_crn_serialization(self):
+ def test_instance_placement_target_patch_dedicated_host_group_identity_dedicated_host_group_identity_by_crn_serialization(self):
"""
- Test serialization/deserialization for VPCDNSResolverVPCPatchVPCIdentityByCRN
+ Test serialization/deserialization for InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN
"""
- # Construct a json representation of a VPCDNSResolverVPCPatchVPCIdentityByCRN model
- vpcdns_resolver_vpc_patch_vpc_identity_by_crn_model_json = {}
- vpcdns_resolver_vpc_patch_vpc_identity_by_crn_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b'
+ # 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 VPCDNSResolverVPCPatchVPCIdentityByCRN by calling from_dict on the json representation
- vpcdns_resolver_vpc_patch_vpc_identity_by_crn_model = VPCDNSResolverVPCPatchVPCIdentityByCRN.from_dict(vpcdns_resolver_vpc_patch_vpc_identity_by_crn_model_json)
- assert vpcdns_resolver_vpc_patch_vpc_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 = 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 VPCDNSResolverVPCPatchVPCIdentityByCRN by calling from_dict on the json representation
- vpcdns_resolver_vpc_patch_vpc_identity_by_crn_model_dict = VPCDNSResolverVPCPatchVPCIdentityByCRN.from_dict(vpcdns_resolver_vpc_patch_vpc_identity_by_crn_model_json).__dict__
- vpcdns_resolver_vpc_patch_vpc_identity_by_crn_model2 = VPCDNSResolverVPCPatchVPCIdentityByCRN(**vpcdns_resolver_vpc_patch_vpc_identity_by_crn_model_dict)
+ # 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 vpcdns_resolver_vpc_patch_vpc_identity_by_crn_model == vpcdns_resolver_vpc_patch_vpc_identity_by_crn_model2
+ 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
- vpcdns_resolver_vpc_patch_vpc_identity_by_crn_model_json2 = vpcdns_resolver_vpc_patch_vpc_identity_by_crn_model.to_dict()
- assert vpcdns_resolver_vpc_patch_vpc_identity_by_crn_model_json2 == vpcdns_resolver_vpc_patch_vpc_identity_by_crn_model_json
+ 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_VPCDNSResolverVPCPatchVPCIdentityByHref:
+class TestModel_InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref:
"""
- Test Class for VPCDNSResolverVPCPatchVPCIdentityByHref
+ Test Class for InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref
"""
- def test_vpcdns_resolver_vpc_patch_vpc_identity_by_href_serialization(self):
+ def test_instance_placement_target_patch_dedicated_host_group_identity_dedicated_host_group_identity_by_href_serialization(self):
"""
- Test serialization/deserialization for VPCDNSResolverVPCPatchVPCIdentityByHref
+ Test serialization/deserialization for InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref
"""
- # Construct a json representation of a VPCDNSResolverVPCPatchVPCIdentityByHref model
- vpcdns_resolver_vpc_patch_vpc_identity_by_href_model_json = {}
- vpcdns_resolver_vpc_patch_vpc_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b'
+ # 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 VPCDNSResolverVPCPatchVPCIdentityByHref by calling from_dict on the json representation
- vpcdns_resolver_vpc_patch_vpc_identity_by_href_model = VPCDNSResolverVPCPatchVPCIdentityByHref.from_dict(vpcdns_resolver_vpc_patch_vpc_identity_by_href_model_json)
- assert vpcdns_resolver_vpc_patch_vpc_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 = 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 VPCDNSResolverVPCPatchVPCIdentityByHref by calling from_dict on the json representation
- vpcdns_resolver_vpc_patch_vpc_identity_by_href_model_dict = VPCDNSResolverVPCPatchVPCIdentityByHref.from_dict(vpcdns_resolver_vpc_patch_vpc_identity_by_href_model_json).__dict__
- vpcdns_resolver_vpc_patch_vpc_identity_by_href_model2 = VPCDNSResolverVPCPatchVPCIdentityByHref(**vpcdns_resolver_vpc_patch_vpc_identity_by_href_model_dict)
+ # 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 vpcdns_resolver_vpc_patch_vpc_identity_by_href_model == vpcdns_resolver_vpc_patch_vpc_identity_by_href_model2
+ 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
- vpcdns_resolver_vpc_patch_vpc_identity_by_href_model_json2 = vpcdns_resolver_vpc_patch_vpc_identity_by_href_model.to_dict()
- assert vpcdns_resolver_vpc_patch_vpc_identity_by_href_model_json2 == vpcdns_resolver_vpc_patch_vpc_identity_by_href_model_json
+ 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_VPCDNSResolverVPCPatchVPCIdentityById:
+class TestModel_InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityById:
"""
- Test Class for VPCDNSResolverVPCPatchVPCIdentityById
+ Test Class for InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityById
"""
- def test_vpcdns_resolver_vpc_patch_vpc_identity_by_id_serialization(self):
+ def test_instance_placement_target_patch_dedicated_host_group_identity_dedicated_host_group_identity_by_id_serialization(self):
"""
- Test serialization/deserialization for VPCDNSResolverVPCPatchVPCIdentityById
+ Test serialization/deserialization for InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityById
"""
- # Construct a json representation of a VPCDNSResolverVPCPatchVPCIdentityById model
- vpcdns_resolver_vpc_patch_vpc_identity_by_id_model_json = {}
- vpcdns_resolver_vpc_patch_vpc_identity_by_id_model_json['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b'
+ # 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 VPCDNSResolverVPCPatchVPCIdentityById by calling from_dict on the json representation
- vpcdns_resolver_vpc_patch_vpc_identity_by_id_model = VPCDNSResolverVPCPatchVPCIdentityById.from_dict(vpcdns_resolver_vpc_patch_vpc_identity_by_id_model_json)
- assert vpcdns_resolver_vpc_patch_vpc_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 = 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 VPCDNSResolverVPCPatchVPCIdentityById by calling from_dict on the json representation
- vpcdns_resolver_vpc_patch_vpc_identity_by_id_model_dict = VPCDNSResolverVPCPatchVPCIdentityById.from_dict(vpcdns_resolver_vpc_patch_vpc_identity_by_id_model_json).__dict__
- vpcdns_resolver_vpc_patch_vpc_identity_by_id_model2 = VPCDNSResolverVPCPatchVPCIdentityById(**vpcdns_resolver_vpc_patch_vpc_identity_by_id_model_dict)
+ # 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 vpcdns_resolver_vpc_patch_vpc_identity_by_id_model == vpcdns_resolver_vpc_patch_vpc_identity_by_id_model2
+ 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
- vpcdns_resolver_vpc_patch_vpc_identity_by_id_model_json2 = vpcdns_resolver_vpc_patch_vpc_identity_by_id_model.to_dict()
- assert vpcdns_resolver_vpc_patch_vpc_identity_by_id_model_json2 == vpcdns_resolver_vpc_patch_vpc_identity_by_id_model_json
+ 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_VPCIdentityByCRN:
+class TestModel_InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByCRN:
"""
- Test Class for VPCIdentityByCRN
+ Test Class for InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByCRN
"""
- def test_vpc_identity_by_crn_serialization(self):
+ def test_instance_placement_target_patch_dedicated_host_identity_dedicated_host_identity_by_crn_serialization(self):
"""
- Test serialization/deserialization for VPCIdentityByCRN
+ Test serialization/deserialization for InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByCRN
"""
- # Construct a json representation of a VPCIdentityByCRN model
- vpc_identity_by_crn_model_json = {}
- vpc_identity_by_crn_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b'
+ # 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 VPCIdentityByCRN by calling from_dict on the json representation
- vpc_identity_by_crn_model = VPCIdentityByCRN.from_dict(vpc_identity_by_crn_model_json)
- assert vpc_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 = 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 VPCIdentityByCRN by calling from_dict on the json representation
- vpc_identity_by_crn_model_dict = VPCIdentityByCRN.from_dict(vpc_identity_by_crn_model_json).__dict__
- vpc_identity_by_crn_model2 = VPCIdentityByCRN(**vpc_identity_by_crn_model_dict)
+ # 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 vpc_identity_by_crn_model == vpc_identity_by_crn_model2
+ 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
- vpc_identity_by_crn_model_json2 = vpc_identity_by_crn_model.to_dict()
- assert vpc_identity_by_crn_model_json2 == vpc_identity_by_crn_model_json
+ 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_VPCIdentityByHref:
+class TestModel_InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByHref:
"""
- Test Class for VPCIdentityByHref
+ Test Class for InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByHref
"""
- def test_vpc_identity_by_href_serialization(self):
+ def test_instance_placement_target_patch_dedicated_host_identity_dedicated_host_identity_by_href_serialization(self):
"""
- Test serialization/deserialization for VPCIdentityByHref
+ Test serialization/deserialization for InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByHref
"""
- # Construct a json representation of a VPCIdentityByHref model
- vpc_identity_by_href_model_json = {}
- vpc_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b'
+ # 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 VPCIdentityByHref by calling from_dict on the json representation
- vpc_identity_by_href_model = VPCIdentityByHref.from_dict(vpc_identity_by_href_model_json)
- assert vpc_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 = 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 VPCIdentityByHref by calling from_dict on the json representation
- vpc_identity_by_href_model_dict = VPCIdentityByHref.from_dict(vpc_identity_by_href_model_json).__dict__
- vpc_identity_by_href_model2 = VPCIdentityByHref(**vpc_identity_by_href_model_dict)
+ # 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 vpc_identity_by_href_model == vpc_identity_by_href_model2
+ 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
- vpc_identity_by_href_model_json2 = vpc_identity_by_href_model.to_dict()
- assert vpc_identity_by_href_model_json2 == vpc_identity_by_href_model_json
+ 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_VPCIdentityById:
+class TestModel_InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityById:
"""
- Test Class for VPCIdentityById
+ Test Class for InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityById
"""
- def test_vpc_identity_by_id_serialization(self):
+ def test_instance_placement_target_patch_dedicated_host_identity_dedicated_host_identity_by_id_serialization(self):
"""
- Test serialization/deserialization for VPCIdentityById
+ Test serialization/deserialization for InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityById
"""
- # Construct a json representation of a VPCIdentityById model
- vpc_identity_by_id_model_json = {}
- vpc_identity_by_id_model_json['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b'
+ # 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 VPCIdentityById by calling from_dict on the json representation
- vpc_identity_by_id_model = VPCIdentityById.from_dict(vpc_identity_by_id_model_json)
- assert vpc_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 = 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 VPCIdentityById by calling from_dict on the json representation
- vpc_identity_by_id_model_dict = VPCIdentityById.from_dict(vpc_identity_by_id_model_json).__dict__
- vpc_identity_by_id_model2 = VPCIdentityById(**vpc_identity_by_id_model_dict)
+ # 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 vpc_identity_by_id_model == vpc_identity_by_id_model2
+ 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
- vpc_identity_by_id_model_json2 = vpc_identity_by_id_model.to_dict()
- assert vpc_identity_by_id_model_json2 == vpc_identity_by_id_model_json
+ 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_VPNGatewayConnectionIKEPolicyPatchIKEPolicyIdentityByHref:
+class TestModel_InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN:
"""
- Test Class for VPNGatewayConnectionIKEPolicyPatchIKEPolicyIdentityByHref
+ Test Class for InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN
"""
- def test_vpn_gateway_connection_ike_policy_patch_ike_policy_identity_by_href_serialization(self):
+ def test_instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_crn_serialization(self):
"""
- Test serialization/deserialization for VPNGatewayConnectionIKEPolicyPatchIKEPolicyIdentityByHref
+ Test serialization/deserialization for InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN
"""
- # Construct a json representation of a VPNGatewayConnectionIKEPolicyPatchIKEPolicyIdentityByHref model
- vpn_gateway_connection_ike_policy_patch_ike_policy_identity_by_href_model_json = {}
- vpn_gateway_connection_ike_policy_patch_ike_policy_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b'
+ # Construct a json representation of a InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN model
+ instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_crn_model_json = {}
+ instance_placement_target_prototype_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 VPNGatewayConnectionIKEPolicyPatchIKEPolicyIdentityByHref by calling from_dict on the json representation
- vpn_gateway_connection_ike_policy_patch_ike_policy_identity_by_href_model = VPNGatewayConnectionIKEPolicyPatchIKEPolicyIdentityByHref.from_dict(vpn_gateway_connection_ike_policy_patch_ike_policy_identity_by_href_model_json)
- assert vpn_gateway_connection_ike_policy_patch_ike_policy_identity_by_href_model != False
+ # Construct a model instance of InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN by calling from_dict on the json representation
+ instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_crn_model = InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN.from_dict(instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_crn_model_json)
+ assert instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_crn_model != False
- # Construct a model instance of VPNGatewayConnectionIKEPolicyPatchIKEPolicyIdentityByHref by calling from_dict on the json representation
- vpn_gateway_connection_ike_policy_patch_ike_policy_identity_by_href_model_dict = VPNGatewayConnectionIKEPolicyPatchIKEPolicyIdentityByHref.from_dict(vpn_gateway_connection_ike_policy_patch_ike_policy_identity_by_href_model_json).__dict__
- vpn_gateway_connection_ike_policy_patch_ike_policy_identity_by_href_model2 = VPNGatewayConnectionIKEPolicyPatchIKEPolicyIdentityByHref(**vpn_gateway_connection_ike_policy_patch_ike_policy_identity_by_href_model_dict)
+ # Construct a model instance of InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN by calling from_dict on the json representation
+ instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_crn_model_dict = InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN.from_dict(instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_crn_model_json).__dict__
+ instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_crn_model2 = InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN(**instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_crn_model_dict)
# Verify the model instances are equivalent
- assert vpn_gateway_connection_ike_policy_patch_ike_policy_identity_by_href_model == vpn_gateway_connection_ike_policy_patch_ike_policy_identity_by_href_model2
+ assert instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_crn_model == instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_crn_model2
# Convert model instance back to dict and verify no loss of data
- vpn_gateway_connection_ike_policy_patch_ike_policy_identity_by_href_model_json2 = vpn_gateway_connection_ike_policy_patch_ike_policy_identity_by_href_model.to_dict()
- assert vpn_gateway_connection_ike_policy_patch_ike_policy_identity_by_href_model_json2 == vpn_gateway_connection_ike_policy_patch_ike_policy_identity_by_href_model_json
+ instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_crn_model_json2 = instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_crn_model.to_dict()
+ assert instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_crn_model_json2 == instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_crn_model_json
-class TestModel_VPNGatewayConnectionIKEPolicyPatchIKEPolicyIdentityById:
+class TestModel_InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref:
"""
- Test Class for VPNGatewayConnectionIKEPolicyPatchIKEPolicyIdentityById
+ Test Class for InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref
"""
- def test_vpn_gateway_connection_ike_policy_patch_ike_policy_identity_by_id_serialization(self):
+ def test_instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_href_serialization(self):
"""
- Test serialization/deserialization for VPNGatewayConnectionIKEPolicyPatchIKEPolicyIdentityById
+ Test serialization/deserialization for InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref
"""
- # Construct a json representation of a VPNGatewayConnectionIKEPolicyPatchIKEPolicyIdentityById model
- vpn_gateway_connection_ike_policy_patch_ike_policy_identity_by_id_model_json = {}
- vpn_gateway_connection_ike_policy_patch_ike_policy_identity_by_id_model_json['id'] = 'ddf51bec-3424-11e8-b467-0ed5f89f718b'
+ # Construct a json representation of a InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref model
+ instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_href_model_json = {}
+ instance_placement_target_prototype_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 VPNGatewayConnectionIKEPolicyPatchIKEPolicyIdentityById by calling from_dict on the json representation
- vpn_gateway_connection_ike_policy_patch_ike_policy_identity_by_id_model = VPNGatewayConnectionIKEPolicyPatchIKEPolicyIdentityById.from_dict(vpn_gateway_connection_ike_policy_patch_ike_policy_identity_by_id_model_json)
- assert vpn_gateway_connection_ike_policy_patch_ike_policy_identity_by_id_model != False
+ # Construct a model instance of InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref by calling from_dict on the json representation
+ instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_href_model = InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref.from_dict(instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_href_model_json)
+ assert instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_href_model != False
- # Construct a model instance of VPNGatewayConnectionIKEPolicyPatchIKEPolicyIdentityById by calling from_dict on the json representation
- vpn_gateway_connection_ike_policy_patch_ike_policy_identity_by_id_model_dict = VPNGatewayConnectionIKEPolicyPatchIKEPolicyIdentityById.from_dict(vpn_gateway_connection_ike_policy_patch_ike_policy_identity_by_id_model_json).__dict__
- vpn_gateway_connection_ike_policy_patch_ike_policy_identity_by_id_model2 = VPNGatewayConnectionIKEPolicyPatchIKEPolicyIdentityById(**vpn_gateway_connection_ike_policy_patch_ike_policy_identity_by_id_model_dict)
+ # Construct a model instance of InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref by calling from_dict on the json representation
+ instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_href_model_dict = InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref.from_dict(instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_href_model_json).__dict__
+ instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_href_model2 = InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref(**instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_href_model_dict)
# Verify the model instances are equivalent
- assert vpn_gateway_connection_ike_policy_patch_ike_policy_identity_by_id_model == vpn_gateway_connection_ike_policy_patch_ike_policy_identity_by_id_model2
+ assert instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_href_model == instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_href_model2
# Convert model instance back to dict and verify no loss of data
- vpn_gateway_connection_ike_policy_patch_ike_policy_identity_by_id_model_json2 = vpn_gateway_connection_ike_policy_patch_ike_policy_identity_by_id_model.to_dict()
- assert vpn_gateway_connection_ike_policy_patch_ike_policy_identity_by_id_model_json2 == vpn_gateway_connection_ike_policy_patch_ike_policy_identity_by_id_model_json
+ instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_href_model_json2 = instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_href_model.to_dict()
+ assert instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_href_model_json2 == instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_href_model_json
-class TestModel_VPNGatewayConnectionIKEPolicyPrototypeIKEPolicyIdentityByHref:
+class TestModel_InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityById:
"""
- Test Class for VPNGatewayConnectionIKEPolicyPrototypeIKEPolicyIdentityByHref
+ Test Class for InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityById
"""
- def test_vpn_gateway_connection_ike_policy_prototype_ike_policy_identity_by_href_serialization(self):
+ def test_instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_id_serialization(self):
"""
- Test serialization/deserialization for VPNGatewayConnectionIKEPolicyPrototypeIKEPolicyIdentityByHref
+ Test serialization/deserialization for InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityById
"""
- # Construct a json representation of a VPNGatewayConnectionIKEPolicyPrototypeIKEPolicyIdentityByHref model
- vpn_gateway_connection_ike_policy_prototype_ike_policy_identity_by_href_model_json = {}
- vpn_gateway_connection_ike_policy_prototype_ike_policy_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b'
+ # Construct a json representation of a InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityById model
+ instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_id_model_json = {}
+ instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_id_model_json['id'] = 'bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0'
- # Construct a model instance of VPNGatewayConnectionIKEPolicyPrototypeIKEPolicyIdentityByHref by calling from_dict on the json representation
- vpn_gateway_connection_ike_policy_prototype_ike_policy_identity_by_href_model = VPNGatewayConnectionIKEPolicyPrototypeIKEPolicyIdentityByHref.from_dict(vpn_gateway_connection_ike_policy_prototype_ike_policy_identity_by_href_model_json)
- assert vpn_gateway_connection_ike_policy_prototype_ike_policy_identity_by_href_model != False
+ # Construct a model instance of InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityById by calling from_dict on the json representation
+ instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_id_model = InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityById.from_dict(instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_id_model_json)
+ assert instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_id_model != False
- # Construct a model instance of VPNGatewayConnectionIKEPolicyPrototypeIKEPolicyIdentityByHref by calling from_dict on the json representation
- vpn_gateway_connection_ike_policy_prototype_ike_policy_identity_by_href_model_dict = VPNGatewayConnectionIKEPolicyPrototypeIKEPolicyIdentityByHref.from_dict(vpn_gateway_connection_ike_policy_prototype_ike_policy_identity_by_href_model_json).__dict__
- vpn_gateway_connection_ike_policy_prototype_ike_policy_identity_by_href_model2 = VPNGatewayConnectionIKEPolicyPrototypeIKEPolicyIdentityByHref(**vpn_gateway_connection_ike_policy_prototype_ike_policy_identity_by_href_model_dict)
+ # Construct a model instance of InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityById by calling from_dict on the json representation
+ instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_id_model_dict = InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityById.from_dict(instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_id_model_json).__dict__
+ instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_id_model2 = InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityById(**instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_id_model_dict)
# Verify the model instances are equivalent
- assert vpn_gateway_connection_ike_policy_prototype_ike_policy_identity_by_href_model == vpn_gateway_connection_ike_policy_prototype_ike_policy_identity_by_href_model2
+ assert instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_id_model == instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_id_model2
# Convert model instance back to dict and verify no loss of data
- vpn_gateway_connection_ike_policy_prototype_ike_policy_identity_by_href_model_json2 = vpn_gateway_connection_ike_policy_prototype_ike_policy_identity_by_href_model.to_dict()
- assert vpn_gateway_connection_ike_policy_prototype_ike_policy_identity_by_href_model_json2 == vpn_gateway_connection_ike_policy_prototype_ike_policy_identity_by_href_model_json
+ instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_id_model_json2 = instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_id_model.to_dict()
+ assert instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_id_model_json2 == instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_id_model_json
-class TestModel_VPNGatewayConnectionIKEPolicyPrototypeIKEPolicyIdentityById:
+class TestModel_InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByCRN:
"""
- Test Class for VPNGatewayConnectionIKEPolicyPrototypeIKEPolicyIdentityById
+ Test Class for InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByCRN
"""
- def test_vpn_gateway_connection_ike_policy_prototype_ike_policy_identity_by_id_serialization(self):
+ def test_instance_placement_target_prototype_dedicated_host_identity_dedicated_host_identity_by_crn_serialization(self):
"""
- Test serialization/deserialization for VPNGatewayConnectionIKEPolicyPrototypeIKEPolicyIdentityById
+ Test serialization/deserialization for InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByCRN
"""
- # Construct a json representation of a VPNGatewayConnectionIKEPolicyPrototypeIKEPolicyIdentityById model
- vpn_gateway_connection_ike_policy_prototype_ike_policy_identity_by_id_model_json = {}
- vpn_gateway_connection_ike_policy_prototype_ike_policy_identity_by_id_model_json['id'] = 'ddf51bec-3424-11e8-b467-0ed5f89f718b'
+ # Construct a json representation of a InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByCRN model
+ instance_placement_target_prototype_dedicated_host_identity_dedicated_host_identity_by_crn_model_json = {}
+ instance_placement_target_prototype_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 VPNGatewayConnectionIKEPolicyPrototypeIKEPolicyIdentityById by calling from_dict on the json representation
- vpn_gateway_connection_ike_policy_prototype_ike_policy_identity_by_id_model = VPNGatewayConnectionIKEPolicyPrototypeIKEPolicyIdentityById.from_dict(vpn_gateway_connection_ike_policy_prototype_ike_policy_identity_by_id_model_json)
- assert vpn_gateway_connection_ike_policy_prototype_ike_policy_identity_by_id_model != False
+ # Construct a model instance of InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByCRN by calling from_dict on the json representation
+ instance_placement_target_prototype_dedicated_host_identity_dedicated_host_identity_by_crn_model = InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByCRN.from_dict(instance_placement_target_prototype_dedicated_host_identity_dedicated_host_identity_by_crn_model_json)
+ assert instance_placement_target_prototype_dedicated_host_identity_dedicated_host_identity_by_crn_model != False
- # Construct a model instance of VPNGatewayConnectionIKEPolicyPrototypeIKEPolicyIdentityById by calling from_dict on the json representation
- vpn_gateway_connection_ike_policy_prototype_ike_policy_identity_by_id_model_dict = VPNGatewayConnectionIKEPolicyPrototypeIKEPolicyIdentityById.from_dict(vpn_gateway_connection_ike_policy_prototype_ike_policy_identity_by_id_model_json).__dict__
- vpn_gateway_connection_ike_policy_prototype_ike_policy_identity_by_id_model2 = VPNGatewayConnectionIKEPolicyPrototypeIKEPolicyIdentityById(**vpn_gateway_connection_ike_policy_prototype_ike_policy_identity_by_id_model_dict)
+ # Construct a model instance of InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByCRN by calling from_dict on the json representation
+ instance_placement_target_prototype_dedicated_host_identity_dedicated_host_identity_by_crn_model_dict = InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByCRN.from_dict(instance_placement_target_prototype_dedicated_host_identity_dedicated_host_identity_by_crn_model_json).__dict__
+ instance_placement_target_prototype_dedicated_host_identity_dedicated_host_identity_by_crn_model2 = InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByCRN(**instance_placement_target_prototype_dedicated_host_identity_dedicated_host_identity_by_crn_model_dict)
# Verify the model instances are equivalent
- assert vpn_gateway_connection_ike_policy_prototype_ike_policy_identity_by_id_model == vpn_gateway_connection_ike_policy_prototype_ike_policy_identity_by_id_model2
+ assert instance_placement_target_prototype_dedicated_host_identity_dedicated_host_identity_by_crn_model == instance_placement_target_prototype_dedicated_host_identity_dedicated_host_identity_by_crn_model2
# Convert model instance back to dict and verify no loss of data
- vpn_gateway_connection_ike_policy_prototype_ike_policy_identity_by_id_model_json2 = vpn_gateway_connection_ike_policy_prototype_ike_policy_identity_by_id_model.to_dict()
- assert vpn_gateway_connection_ike_policy_prototype_ike_policy_identity_by_id_model_json2 == vpn_gateway_connection_ike_policy_prototype_ike_policy_identity_by_id_model_json
+ instance_placement_target_prototype_dedicated_host_identity_dedicated_host_identity_by_crn_model_json2 = instance_placement_target_prototype_dedicated_host_identity_dedicated_host_identity_by_crn_model.to_dict()
+ assert instance_placement_target_prototype_dedicated_host_identity_dedicated_host_identity_by_crn_model_json2 == instance_placement_target_prototype_dedicated_host_identity_dedicated_host_identity_by_crn_model_json
-class TestModel_VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByHref:
+class TestModel_InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByHref:
"""
- Test Class for VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByHref
+ Test Class for InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByHref
"""
- def test_vpn_gateway_connection_i_psec_policy_patch_i_psec_policy_identity_by_href_serialization(self):
+ def test_instance_placement_target_prototype_dedicated_host_identity_dedicated_host_identity_by_href_serialization(self):
"""
- Test serialization/deserialization for VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByHref
+ Test serialization/deserialization for InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByHref
"""
- # Construct a json representation of a VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByHref model
- vpn_gateway_connection_i_psec_policy_patch_i_psec_policy_identity_by_href_model_json = {}
- vpn_gateway_connection_i_psec_policy_patch_i_psec_policy_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b'
+ # Construct a json representation of a InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByHref model
+ instance_placement_target_prototype_dedicated_host_identity_dedicated_host_identity_by_href_model_json = {}
+ instance_placement_target_prototype_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 VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByHref by calling from_dict on the json representation
- vpn_gateway_connection_i_psec_policy_patch_i_psec_policy_identity_by_href_model = VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByHref.from_dict(vpn_gateway_connection_i_psec_policy_patch_i_psec_policy_identity_by_href_model_json)
- assert vpn_gateway_connection_i_psec_policy_patch_i_psec_policy_identity_by_href_model != False
+ # Construct a model instance of InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByHref by calling from_dict on the json representation
+ instance_placement_target_prototype_dedicated_host_identity_dedicated_host_identity_by_href_model = InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByHref.from_dict(instance_placement_target_prototype_dedicated_host_identity_dedicated_host_identity_by_href_model_json)
+ assert instance_placement_target_prototype_dedicated_host_identity_dedicated_host_identity_by_href_model != False
- # Construct a model instance of VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByHref by calling from_dict on the json representation
- vpn_gateway_connection_i_psec_policy_patch_i_psec_policy_identity_by_href_model_dict = VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByHref.from_dict(vpn_gateway_connection_i_psec_policy_patch_i_psec_policy_identity_by_href_model_json).__dict__
- vpn_gateway_connection_i_psec_policy_patch_i_psec_policy_identity_by_href_model2 = VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByHref(**vpn_gateway_connection_i_psec_policy_patch_i_psec_policy_identity_by_href_model_dict)
+ # Construct a model instance of InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByHref by calling from_dict on the json representation
+ instance_placement_target_prototype_dedicated_host_identity_dedicated_host_identity_by_href_model_dict = InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByHref.from_dict(instance_placement_target_prototype_dedicated_host_identity_dedicated_host_identity_by_href_model_json).__dict__
+ instance_placement_target_prototype_dedicated_host_identity_dedicated_host_identity_by_href_model2 = InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByHref(**instance_placement_target_prototype_dedicated_host_identity_dedicated_host_identity_by_href_model_dict)
# Verify the model instances are equivalent
- assert vpn_gateway_connection_i_psec_policy_patch_i_psec_policy_identity_by_href_model == vpn_gateway_connection_i_psec_policy_patch_i_psec_policy_identity_by_href_model2
+ assert instance_placement_target_prototype_dedicated_host_identity_dedicated_host_identity_by_href_model == instance_placement_target_prototype_dedicated_host_identity_dedicated_host_identity_by_href_model2
# Convert model instance back to dict and verify no loss of data
- vpn_gateway_connection_i_psec_policy_patch_i_psec_policy_identity_by_href_model_json2 = vpn_gateway_connection_i_psec_policy_patch_i_psec_policy_identity_by_href_model.to_dict()
- assert vpn_gateway_connection_i_psec_policy_patch_i_psec_policy_identity_by_href_model_json2 == vpn_gateway_connection_i_psec_policy_patch_i_psec_policy_identity_by_href_model_json
+ instance_placement_target_prototype_dedicated_host_identity_dedicated_host_identity_by_href_model_json2 = instance_placement_target_prototype_dedicated_host_identity_dedicated_host_identity_by_href_model.to_dict()
+ assert instance_placement_target_prototype_dedicated_host_identity_dedicated_host_identity_by_href_model_json2 == instance_placement_target_prototype_dedicated_host_identity_dedicated_host_identity_by_href_model_json
-class TestModel_VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityById:
+class TestModel_InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById:
"""
- Test Class for VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityById
+ Test Class for InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById
"""
- def test_vpn_gateway_connection_i_psec_policy_patch_i_psec_policy_identity_by_id_serialization(self):
+ def test_instance_placement_target_prototype_dedicated_host_identity_dedicated_host_identity_by_id_serialization(self):
"""
- Test serialization/deserialization for VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityById
+ Test serialization/deserialization for InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById
"""
- # Construct a json representation of a VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityById model
- vpn_gateway_connection_i_psec_policy_patch_i_psec_policy_identity_by_id_model_json = {}
- vpn_gateway_connection_i_psec_policy_patch_i_psec_policy_identity_by_id_model_json['id'] = 'ddf51bec-3424-11e8-b467-0ed5f89f718b'
+ # Construct a json representation of a InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById model
+ instance_placement_target_prototype_dedicated_host_identity_dedicated_host_identity_by_id_model_json = {}
+ instance_placement_target_prototype_dedicated_host_identity_dedicated_host_identity_by_id_model_json['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
- # Construct a model instance of VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityById by calling from_dict on the json representation
- vpn_gateway_connection_i_psec_policy_patch_i_psec_policy_identity_by_id_model = VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityById.from_dict(vpn_gateway_connection_i_psec_policy_patch_i_psec_policy_identity_by_id_model_json)
- assert vpn_gateway_connection_i_psec_policy_patch_i_psec_policy_identity_by_id_model != False
+ # Construct a model instance of InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById by calling from_dict on the json representation
+ instance_placement_target_prototype_dedicated_host_identity_dedicated_host_identity_by_id_model = InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById.from_dict(instance_placement_target_prototype_dedicated_host_identity_dedicated_host_identity_by_id_model_json)
+ assert instance_placement_target_prototype_dedicated_host_identity_dedicated_host_identity_by_id_model != False
- # Construct a model instance of VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityById by calling from_dict on the json representation
- vpn_gateway_connection_i_psec_policy_patch_i_psec_policy_identity_by_id_model_dict = VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityById.from_dict(vpn_gateway_connection_i_psec_policy_patch_i_psec_policy_identity_by_id_model_json).__dict__
- vpn_gateway_connection_i_psec_policy_patch_i_psec_policy_identity_by_id_model2 = VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityById(**vpn_gateway_connection_i_psec_policy_patch_i_psec_policy_identity_by_id_model_dict)
+ # Construct a model instance of InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById by calling from_dict on the json representation
+ instance_placement_target_prototype_dedicated_host_identity_dedicated_host_identity_by_id_model_dict = InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById.from_dict(instance_placement_target_prototype_dedicated_host_identity_dedicated_host_identity_by_id_model_json).__dict__
+ instance_placement_target_prototype_dedicated_host_identity_dedicated_host_identity_by_id_model2 = InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById(**instance_placement_target_prototype_dedicated_host_identity_dedicated_host_identity_by_id_model_dict)
# Verify the model instances are equivalent
- assert vpn_gateway_connection_i_psec_policy_patch_i_psec_policy_identity_by_id_model == vpn_gateway_connection_i_psec_policy_patch_i_psec_policy_identity_by_id_model2
+ assert instance_placement_target_prototype_dedicated_host_identity_dedicated_host_identity_by_id_model == instance_placement_target_prototype_dedicated_host_identity_dedicated_host_identity_by_id_model2
# Convert model instance back to dict and verify no loss of data
- vpn_gateway_connection_i_psec_policy_patch_i_psec_policy_identity_by_id_model_json2 = vpn_gateway_connection_i_psec_policy_patch_i_psec_policy_identity_by_id_model.to_dict()
- assert vpn_gateway_connection_i_psec_policy_patch_i_psec_policy_identity_by_id_model_json2 == vpn_gateway_connection_i_psec_policy_patch_i_psec_policy_identity_by_id_model_json
+ instance_placement_target_prototype_dedicated_host_identity_dedicated_host_identity_by_id_model_json2 = instance_placement_target_prototype_dedicated_host_identity_dedicated_host_identity_by_id_model.to_dict()
+ assert instance_placement_target_prototype_dedicated_host_identity_dedicated_host_identity_by_id_model_json2 == instance_placement_target_prototype_dedicated_host_identity_dedicated_host_identity_by_id_model_json
-class TestModel_VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByHref:
+class TestModel_InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByCRN:
"""
- Test Class for VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByHref
+ Test Class for InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByCRN
"""
- def test_vpn_gateway_connection_i_psec_policy_prototype_i_psec_policy_identity_by_href_serialization(self):
+ def test_instance_placement_target_prototype_placement_group_identity_placement_group_identity_by_crn_serialization(self):
"""
- Test serialization/deserialization for VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByHref
+ Test serialization/deserialization for InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByCRN
"""
- # Construct a json representation of a VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByHref model
- vpn_gateway_connection_i_psec_policy_prototype_i_psec_policy_identity_by_href_model_json = {}
- vpn_gateway_connection_i_psec_policy_prototype_i_psec_policy_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b'
+ # Construct a json representation of a InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByCRN model
+ instance_placement_target_prototype_placement_group_identity_placement_group_identity_by_crn_model_json = {}
+ instance_placement_target_prototype_placement_group_identity_placement_group_identity_by_crn_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::placement-group:r018-418fe842-a3e9-47b9-a938-1aa5bd632871'
- # Construct a model instance of VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByHref by calling from_dict on the json representation
- vpn_gateway_connection_i_psec_policy_prototype_i_psec_policy_identity_by_href_model = VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByHref.from_dict(vpn_gateway_connection_i_psec_policy_prototype_i_psec_policy_identity_by_href_model_json)
- assert vpn_gateway_connection_i_psec_policy_prototype_i_psec_policy_identity_by_href_model != False
+ # Construct a model instance of InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByCRN by calling from_dict on the json representation
+ instance_placement_target_prototype_placement_group_identity_placement_group_identity_by_crn_model = InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByCRN.from_dict(instance_placement_target_prototype_placement_group_identity_placement_group_identity_by_crn_model_json)
+ assert instance_placement_target_prototype_placement_group_identity_placement_group_identity_by_crn_model != False
- # Construct a model instance of VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByHref by calling from_dict on the json representation
- vpn_gateway_connection_i_psec_policy_prototype_i_psec_policy_identity_by_href_model_dict = VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByHref.from_dict(vpn_gateway_connection_i_psec_policy_prototype_i_psec_policy_identity_by_href_model_json).__dict__
- vpn_gateway_connection_i_psec_policy_prototype_i_psec_policy_identity_by_href_model2 = VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByHref(**vpn_gateway_connection_i_psec_policy_prototype_i_psec_policy_identity_by_href_model_dict)
+ # Construct a model instance of InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByCRN by calling from_dict on the json representation
+ instance_placement_target_prototype_placement_group_identity_placement_group_identity_by_crn_model_dict = InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByCRN.from_dict(instance_placement_target_prototype_placement_group_identity_placement_group_identity_by_crn_model_json).__dict__
+ instance_placement_target_prototype_placement_group_identity_placement_group_identity_by_crn_model2 = InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByCRN(**instance_placement_target_prototype_placement_group_identity_placement_group_identity_by_crn_model_dict)
# Verify the model instances are equivalent
- assert vpn_gateway_connection_i_psec_policy_prototype_i_psec_policy_identity_by_href_model == vpn_gateway_connection_i_psec_policy_prototype_i_psec_policy_identity_by_href_model2
+ assert instance_placement_target_prototype_placement_group_identity_placement_group_identity_by_crn_model == instance_placement_target_prototype_placement_group_identity_placement_group_identity_by_crn_model2
# Convert model instance back to dict and verify no loss of data
- vpn_gateway_connection_i_psec_policy_prototype_i_psec_policy_identity_by_href_model_json2 = vpn_gateway_connection_i_psec_policy_prototype_i_psec_policy_identity_by_href_model.to_dict()
- assert vpn_gateway_connection_i_psec_policy_prototype_i_psec_policy_identity_by_href_model_json2 == vpn_gateway_connection_i_psec_policy_prototype_i_psec_policy_identity_by_href_model_json
+ instance_placement_target_prototype_placement_group_identity_placement_group_identity_by_crn_model_json2 = instance_placement_target_prototype_placement_group_identity_placement_group_identity_by_crn_model.to_dict()
+ assert instance_placement_target_prototype_placement_group_identity_placement_group_identity_by_crn_model_json2 == instance_placement_target_prototype_placement_group_identity_placement_group_identity_by_crn_model_json
-class TestModel_VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityById:
+class TestModel_InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByHref:
"""
- Test Class for VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityById
+ Test Class for InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByHref
"""
- def test_vpn_gateway_connection_i_psec_policy_prototype_i_psec_policy_identity_by_id_serialization(self):
+ def test_instance_placement_target_prototype_placement_group_identity_placement_group_identity_by_href_serialization(self):
"""
- Test serialization/deserialization for VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityById
+ Test serialization/deserialization for InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByHref
"""
- # Construct a json representation of a VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityById model
- vpn_gateway_connection_i_psec_policy_prototype_i_psec_policy_identity_by_id_model_json = {}
- vpn_gateway_connection_i_psec_policy_prototype_i_psec_policy_identity_by_id_model_json['id'] = 'ddf51bec-3424-11e8-b467-0ed5f89f718b'
+ # Construct a json representation of a InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByHref model
+ instance_placement_target_prototype_placement_group_identity_placement_group_identity_by_href_model_json = {}
+ instance_placement_target_prototype_placement_group_identity_placement_group_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/placement_groups/r018-418fe842-a3e9-47b9-a938-1aa5bd632871'
- # Construct a model instance of VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityById by calling from_dict on the json representation
- vpn_gateway_connection_i_psec_policy_prototype_i_psec_policy_identity_by_id_model = VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityById.from_dict(vpn_gateway_connection_i_psec_policy_prototype_i_psec_policy_identity_by_id_model_json)
- assert vpn_gateway_connection_i_psec_policy_prototype_i_psec_policy_identity_by_id_model != False
+ # Construct a model instance of InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByHref by calling from_dict on the json representation
+ instance_placement_target_prototype_placement_group_identity_placement_group_identity_by_href_model = InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByHref.from_dict(instance_placement_target_prototype_placement_group_identity_placement_group_identity_by_href_model_json)
+ assert instance_placement_target_prototype_placement_group_identity_placement_group_identity_by_href_model != False
- # Construct a model instance of VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityById by calling from_dict on the json representation
- vpn_gateway_connection_i_psec_policy_prototype_i_psec_policy_identity_by_id_model_dict = VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityById.from_dict(vpn_gateway_connection_i_psec_policy_prototype_i_psec_policy_identity_by_id_model_json).__dict__
- vpn_gateway_connection_i_psec_policy_prototype_i_psec_policy_identity_by_id_model2 = VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityById(**vpn_gateway_connection_i_psec_policy_prototype_i_psec_policy_identity_by_id_model_dict)
+ # Construct a model instance of InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByHref by calling from_dict on the json representation
+ instance_placement_target_prototype_placement_group_identity_placement_group_identity_by_href_model_dict = InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByHref.from_dict(instance_placement_target_prototype_placement_group_identity_placement_group_identity_by_href_model_json).__dict__
+ instance_placement_target_prototype_placement_group_identity_placement_group_identity_by_href_model2 = InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByHref(**instance_placement_target_prototype_placement_group_identity_placement_group_identity_by_href_model_dict)
# Verify the model instances are equivalent
- assert vpn_gateway_connection_i_psec_policy_prototype_i_psec_policy_identity_by_id_model == vpn_gateway_connection_i_psec_policy_prototype_i_psec_policy_identity_by_id_model2
+ assert instance_placement_target_prototype_placement_group_identity_placement_group_identity_by_href_model == instance_placement_target_prototype_placement_group_identity_placement_group_identity_by_href_model2
# Convert model instance back to dict and verify no loss of data
- vpn_gateway_connection_i_psec_policy_prototype_i_psec_policy_identity_by_id_model_json2 = vpn_gateway_connection_i_psec_policy_prototype_i_psec_policy_identity_by_id_model.to_dict()
- assert vpn_gateway_connection_i_psec_policy_prototype_i_psec_policy_identity_by_id_model_json2 == vpn_gateway_connection_i_psec_policy_prototype_i_psec_policy_identity_by_id_model_json
+ instance_placement_target_prototype_placement_group_identity_placement_group_identity_by_href_model_json2 = instance_placement_target_prototype_placement_group_identity_placement_group_identity_by_href_model.to_dict()
+ assert instance_placement_target_prototype_placement_group_identity_placement_group_identity_by_href_model_json2 == instance_placement_target_prototype_placement_group_identity_placement_group_identity_by_href_model_json
-class TestModel_VPNGatewayConnectionPatchVPNGatewayConnectionStaticRouteModePatch:
+class TestModel_InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityById:
"""
- Test Class for VPNGatewayConnectionPatchVPNGatewayConnectionStaticRouteModePatch
+ Test Class for InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityById
"""
- def test_vpn_gateway_connection_patch_vpn_gateway_connection_static_route_mode_patch_serialization(self):
+ def test_instance_placement_target_prototype_placement_group_identity_placement_group_identity_by_id_serialization(self):
"""
- Test serialization/deserialization for VPNGatewayConnectionPatchVPNGatewayConnectionStaticRouteModePatch
+ Test serialization/deserialization for InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityById
"""
- # Construct dict forms of any model objects needed in order to build this model.
-
- vpn_gateway_connection_dpd_patch_model = {} # VPNGatewayConnectionDPDPatch
- vpn_gateway_connection_dpd_patch_model['action'] = 'restart'
- vpn_gateway_connection_dpd_patch_model['interval'] = 30
- vpn_gateway_connection_dpd_patch_model['timeout'] = 120
-
- vpn_gateway_connection_ike_policy_patch_model = {} # VPNGatewayConnectionIKEPolicyPatchIKEPolicyIdentityById
- vpn_gateway_connection_ike_policy_patch_model['id'] = 'ddf51bec-3424-11e8-b467-0ed5f89f718b'
-
- vpn_gateway_connection_i_psec_policy_patch_model = {} # VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityById
- vpn_gateway_connection_i_psec_policy_patch_model['id'] = 'ddf51bec-3424-11e8-b467-0ed5f89f718b'
-
- # Construct a json representation of a VPNGatewayConnectionPatchVPNGatewayConnectionStaticRouteModePatch model
- vpn_gateway_connection_patch_vpn_gateway_connection_static_route_mode_patch_model_json = {}
- vpn_gateway_connection_patch_vpn_gateway_connection_static_route_mode_patch_model_json['admin_state_up'] = True
- vpn_gateway_connection_patch_vpn_gateway_connection_static_route_mode_patch_model_json['dead_peer_detection'] = vpn_gateway_connection_dpd_patch_model
- vpn_gateway_connection_patch_vpn_gateway_connection_static_route_mode_patch_model_json['ike_policy'] = vpn_gateway_connection_ike_policy_patch_model
- vpn_gateway_connection_patch_vpn_gateway_connection_static_route_mode_patch_model_json['ipsec_policy'] = vpn_gateway_connection_i_psec_policy_patch_model
- vpn_gateway_connection_patch_vpn_gateway_connection_static_route_mode_patch_model_json['name'] = 'my-vpn-connection'
- vpn_gateway_connection_patch_vpn_gateway_connection_static_route_mode_patch_model_json['peer_address'] = '169.21.50.5'
- vpn_gateway_connection_patch_vpn_gateway_connection_static_route_mode_patch_model_json['psk'] = 'lkj14b1oi0alcniejkso'
- vpn_gateway_connection_patch_vpn_gateway_connection_static_route_mode_patch_model_json['routing_protocol'] = 'none'
+ # Construct a json representation of a InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityById model
+ instance_placement_target_prototype_placement_group_identity_placement_group_identity_by_id_model_json = {}
+ instance_placement_target_prototype_placement_group_identity_placement_group_identity_by_id_model_json['id'] = 'r018-418fe842-a3e9-47b9-a938-1aa5bd632871'
- # Construct a model instance of VPNGatewayConnectionPatchVPNGatewayConnectionStaticRouteModePatch by calling from_dict on the json representation
- vpn_gateway_connection_patch_vpn_gateway_connection_static_route_mode_patch_model = VPNGatewayConnectionPatchVPNGatewayConnectionStaticRouteModePatch.from_dict(vpn_gateway_connection_patch_vpn_gateway_connection_static_route_mode_patch_model_json)
- assert vpn_gateway_connection_patch_vpn_gateway_connection_static_route_mode_patch_model != False
+ # Construct a model instance of InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityById by calling from_dict on the json representation
+ instance_placement_target_prototype_placement_group_identity_placement_group_identity_by_id_model = InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityById.from_dict(instance_placement_target_prototype_placement_group_identity_placement_group_identity_by_id_model_json)
+ assert instance_placement_target_prototype_placement_group_identity_placement_group_identity_by_id_model != False
- # Construct a model instance of VPNGatewayConnectionPatchVPNGatewayConnectionStaticRouteModePatch by calling from_dict on the json representation
- vpn_gateway_connection_patch_vpn_gateway_connection_static_route_mode_patch_model_dict = VPNGatewayConnectionPatchVPNGatewayConnectionStaticRouteModePatch.from_dict(vpn_gateway_connection_patch_vpn_gateway_connection_static_route_mode_patch_model_json).__dict__
- vpn_gateway_connection_patch_vpn_gateway_connection_static_route_mode_patch_model2 = VPNGatewayConnectionPatchVPNGatewayConnectionStaticRouteModePatch(**vpn_gateway_connection_patch_vpn_gateway_connection_static_route_mode_patch_model_dict)
+ # Construct a model instance of InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityById by calling from_dict on the json representation
+ instance_placement_target_prototype_placement_group_identity_placement_group_identity_by_id_model_dict = InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityById.from_dict(instance_placement_target_prototype_placement_group_identity_placement_group_identity_by_id_model_json).__dict__
+ instance_placement_target_prototype_placement_group_identity_placement_group_identity_by_id_model2 = InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityById(**instance_placement_target_prototype_placement_group_identity_placement_group_identity_by_id_model_dict)
# Verify the model instances are equivalent
- assert vpn_gateway_connection_patch_vpn_gateway_connection_static_route_mode_patch_model == vpn_gateway_connection_patch_vpn_gateway_connection_static_route_mode_patch_model2
+ assert instance_placement_target_prototype_placement_group_identity_placement_group_identity_by_id_model == instance_placement_target_prototype_placement_group_identity_placement_group_identity_by_id_model2
# Convert model instance back to dict and verify no loss of data
- vpn_gateway_connection_patch_vpn_gateway_connection_static_route_mode_patch_model_json2 = vpn_gateway_connection_patch_vpn_gateway_connection_static_route_mode_patch_model.to_dict()
- assert vpn_gateway_connection_patch_vpn_gateway_connection_static_route_mode_patch_model_json2 == vpn_gateway_connection_patch_vpn_gateway_connection_static_route_mode_patch_model_json
+ instance_placement_target_prototype_placement_group_identity_placement_group_identity_by_id_model_json2 = instance_placement_target_prototype_placement_group_identity_placement_group_identity_by_id_model.to_dict()
+ assert instance_placement_target_prototype_placement_group_identity_placement_group_identity_by_id_model_json2 == instance_placement_target_prototype_placement_group_identity_placement_group_identity_by_id_model_json
-class TestModel_VPNGatewayConnectionPolicyMode:
+class TestModel_InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkAttachment:
"""
- Test Class for VPNGatewayConnectionPolicyMode
+ Test Class for InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkAttachment
"""
- def test_vpn_gateway_connection_policy_mode_serialization(self):
+ def test_instance_prototype_instance_by_catalog_offering_instance_by_catalog_offering_instance_by_network_attachment_serialization(self):
"""
- Test serialization/deserialization for VPNGatewayConnectionPolicyMode
+ Test serialization/deserialization for InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkAttachment
"""
# 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
+ instance_availability_policy_prototype_model = {} # InstanceAvailabilityPolicyPrototype
+ instance_availability_policy_prototype_model['host_failure'] = 'restart'
- ike_policy_reference_deleted_model = {} # IKEPolicyReferenceDeleted
- ike_policy_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ trusted_profile_identity_model = {} # TrustedProfileIdentityTrustedProfileById
+ trusted_profile_identity_model['id'] = 'Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5'
- 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'
+ instance_default_trusted_profile_prototype_model = {} # InstanceDefaultTrustedProfilePrototype
+ instance_default_trusted_profile_prototype_model['auto_link'] = False
+ instance_default_trusted_profile_prototype_model['target'] = trusted_profile_identity_model
- i_psec_policy_reference_deleted_model = {} # IPsecPolicyReferenceDeleted
- i_psec_policy_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ key_identity_model = {} # KeyIdentityById
+ key_identity_model['id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803'
- 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'
+ instance_metadata_service_prototype_model = {} # InstanceMetadataServicePrototype
+ instance_metadata_service_prototype_model['enabled'] = False
+ instance_metadata_service_prototype_model['protocol'] = 'https'
+ instance_metadata_service_prototype_model['response_hop_limit'] = 2
- vpn_gateway_connection_status_reason_model = {} # VPNGatewayConnectionStatusReason
- vpn_gateway_connection_status_reason_model['code'] = 'cannot_authenticate_connection'
- vpn_gateway_connection_status_reason_model['message'] = 'Failed to authenticate a connection because of mismatched IKE ID and PSK.'
- vpn_gateway_connection_status_reason_model['more_info'] = 'https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health'
+ instance_placement_target_prototype_model = {} # InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById
+ instance_placement_target_prototype_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
+
+ instance_profile_identity_model = {} # InstanceProfileIdentityByName
+ instance_profile_identity_model['name'] = 'cx2-16x32'
+
+ reservation_identity_model = {} # ReservationIdentityById
+ reservation_identity_model['id'] = '7187-ba49df72-37b8-43ac-98da-f8e029de0e63'
+
+ instance_reservation_affinity_prototype_model = {} # InstanceReservationAffinityPrototype
+ instance_reservation_affinity_prototype_model['policy'] = 'disabled'
+ instance_reservation_affinity_prototype_model['pool'] = [reservation_identity_model]
+
+ resource_group_identity_model = {} # ResourceGroupIdentityById
+ resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
+
+ volume_attachment_prototype_volume_model = {} # VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById
+ volume_attachment_prototype_volume_model['id'] = '1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
+
+ volume_attachment_prototype_model = {} # VolumeAttachmentPrototype
+ volume_attachment_prototype_model['delete_volume_on_instance_delete'] = False
+ volume_attachment_prototype_model['name'] = 'my-volume-attachment'
+ volume_attachment_prototype_model['volume'] = volume_attachment_prototype_volume_model
+
+ vpc_identity_model = {} # VPCIdentityById
+ vpc_identity_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b'
- # Construct a json representation of a VPNGatewayConnectionPolicyMode model
- vpn_gateway_connection_policy_mode_model_json = {}
- vpn_gateway_connection_policy_mode_model_json['admin_state_up'] = True
- vpn_gateway_connection_policy_mode_model_json['authentication_mode'] = 'psk'
- vpn_gateway_connection_policy_mode_model_json['created_at'] = '2019-01-01T12:00:00Z'
- vpn_gateway_connection_policy_mode_model_json['dead_peer_detection'] = vpn_gateway_connection_dpd_model
- vpn_gateway_connection_policy_mode_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_policy_mode_model_json['id'] = 'a10a5771-dc23-442c-8460-c3601d8542f7'
- vpn_gateway_connection_policy_mode_model_json['ike_policy'] = ike_policy_reference_model
- vpn_gateway_connection_policy_mode_model_json['ipsec_policy'] = i_psec_policy_reference_model
- vpn_gateway_connection_policy_mode_model_json['mode'] = 'route'
- vpn_gateway_connection_policy_mode_model_json['name'] = 'my-vpn-connection'
- vpn_gateway_connection_policy_mode_model_json['peer_address'] = '169.21.50.5'
- vpn_gateway_connection_policy_mode_model_json['psk'] = 'lkj14b1oi0alcniejkso'
- vpn_gateway_connection_policy_mode_model_json['resource_type'] = 'vpn_gateway_connection'
- vpn_gateway_connection_policy_mode_model_json['status'] = 'down'
- vpn_gateway_connection_policy_mode_model_json['status_reasons'] = [vpn_gateway_connection_status_reason_model]
- vpn_gateway_connection_policy_mode_model_json['local_cidrs'] = ['192.168.1.0/24']
- vpn_gateway_connection_policy_mode_model_json['peer_cidrs'] = ['10.45.1.0/24']
+ encryption_key_identity_model = {} # EncryptionKeyIdentityByCRN
+ encryption_key_identity_model['crn'] = 'crn:v1:bluemix:public:kms:us-south:a/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179'
- # Construct a model instance of VPNGatewayConnectionPolicyMode by calling from_dict on the json representation
- vpn_gateway_connection_policy_mode_model = VPNGatewayConnectionPolicyMode.from_dict(vpn_gateway_connection_policy_mode_model_json)
- assert vpn_gateway_connection_policy_mode_model != False
+ volume_profile_identity_model = {} # VolumeProfileIdentityByName
+ volume_profile_identity_model['name'] = 'general-purpose'
- # Construct a model instance of VPNGatewayConnectionPolicyMode by calling from_dict on the json representation
- vpn_gateway_connection_policy_mode_model_dict = VPNGatewayConnectionPolicyMode.from_dict(vpn_gateway_connection_policy_mode_model_json).__dict__
- vpn_gateway_connection_policy_mode_model2 = VPNGatewayConnectionPolicyMode(**vpn_gateway_connection_policy_mode_model_dict)
+ volume_prototype_instance_by_image_context_model = {} # VolumePrototypeInstanceByImageContext
+ volume_prototype_instance_by_image_context_model['capacity'] = 100
+ volume_prototype_instance_by_image_context_model['encryption_key'] = encryption_key_identity_model
+ volume_prototype_instance_by_image_context_model['iops'] = 10000
+ volume_prototype_instance_by_image_context_model['name'] = 'my-volume'
+ volume_prototype_instance_by_image_context_model['profile'] = volume_profile_identity_model
+ volume_prototype_instance_by_image_context_model['resource_group'] = resource_group_identity_model
+ volume_prototype_instance_by_image_context_model['user_tags'] = []
- # Verify the model instances are equivalent
- assert vpn_gateway_connection_policy_mode_model == vpn_gateway_connection_policy_mode_model2
+ 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
- # Convert model instance back to dict and verify no loss of data
- vpn_gateway_connection_policy_mode_model_json2 = vpn_gateway_connection_policy_mode_model.to_dict()
- assert vpn_gateway_connection_policy_mode_model_json2 == vpn_gateway_connection_policy_mode_model_json
+ catalog_offering_identity_model = {} # CatalogOfferingIdentityCatalogOfferingByCRN
+ catalog_offering_identity_model['crn'] = 'crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:offering:00111601-0ec5-41ac-b142-96d1e64e6442'
+ instance_catalog_offering_prototype_model = {} # InstanceCatalogOfferingPrototypeCatalogOfferingByOffering
+ instance_catalog_offering_prototype_model['offering'] = catalog_offering_identity_model
-class TestModel_VPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype:
- """
- Test Class for VPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype
- """
+ zone_identity_model = {} # ZoneIdentityByName
+ zone_identity_model['name'] = 'us-south-1'
- def test_vpn_gateway_connection_prototype_vpn_gateway_connection_policy_mode_prototype_serialization(self):
- """
- Test serialization/deserialization for VPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype
- """
+ virtual_network_interface_ip_prototype_model = {} # VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext
+ virtual_network_interface_ip_prototype_model['address'] = '10.0.0.5'
+ virtual_network_interface_ip_prototype_model['auto_delete'] = False
+ virtual_network_interface_ip_prototype_model['name'] = 'my-reserved-ip'
- # Construct dict forms of any model objects needed in order to build this model.
+ virtual_network_interface_primary_ip_prototype_model = {} # VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext
+ virtual_network_interface_primary_ip_prototype_model['address'] = '10.0.0.5'
+ virtual_network_interface_primary_ip_prototype_model['auto_delete'] = False
+ virtual_network_interface_primary_ip_prototype_model['name'] = 'my-reserved-ip'
- vpn_gateway_connection_dpd_prototype_model = {} # VPNGatewayConnectionDPDPrototype
- vpn_gateway_connection_dpd_prototype_model['action'] = 'restart'
- vpn_gateway_connection_dpd_prototype_model['interval'] = 30
- vpn_gateway_connection_dpd_prototype_model['timeout'] = 120
+ security_group_identity_model = {} # SecurityGroupIdentityById
+ security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271'
- vpn_gateway_connection_ike_policy_prototype_model = {} # VPNGatewayConnectionIKEPolicyPrototypeIKEPolicyIdentityById
- vpn_gateway_connection_ike_policy_prototype_model['id'] = 'ddf51bec-3424-11e8-b467-0ed5f89f718b'
+ subnet_identity_model = {} # SubnetIdentityById
+ subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
- vpn_gateway_connection_i_psec_policy_prototype_model = {} # VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityById
- vpn_gateway_connection_i_psec_policy_prototype_model['id'] = 'ddf51bec-3424-11e8-b467-0ed5f89f718b'
+ instance_network_attachment_prototype_virtual_network_interface_model = {} # InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeInstanceNetworkAttachmentContext
+ instance_network_attachment_prototype_virtual_network_interface_model['allow_ip_spoofing'] = True
+ instance_network_attachment_prototype_virtual_network_interface_model['auto_delete'] = False
+ instance_network_attachment_prototype_virtual_network_interface_model['enable_infrastructure_nat'] = True
+ instance_network_attachment_prototype_virtual_network_interface_model['ips'] = [virtual_network_interface_ip_prototype_model]
+ instance_network_attachment_prototype_virtual_network_interface_model['name'] = 'my-virtual-network-interface'
+ instance_network_attachment_prototype_virtual_network_interface_model['primary_ip'] = virtual_network_interface_primary_ip_prototype_model
+ instance_network_attachment_prototype_virtual_network_interface_model['resource_group'] = resource_group_identity_model
+ instance_network_attachment_prototype_virtual_network_interface_model['security_groups'] = [security_group_identity_model]
+ instance_network_attachment_prototype_virtual_network_interface_model['subnet'] = subnet_identity_model
- # Construct a json representation of a VPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype model
- vpn_gateway_connection_prototype_vpn_gateway_connection_policy_mode_prototype_model_json = {}
- vpn_gateway_connection_prototype_vpn_gateway_connection_policy_mode_prototype_model_json['admin_state_up'] = True
- vpn_gateway_connection_prototype_vpn_gateway_connection_policy_mode_prototype_model_json['dead_peer_detection'] = vpn_gateway_connection_dpd_prototype_model
- vpn_gateway_connection_prototype_vpn_gateway_connection_policy_mode_prototype_model_json['ike_policy'] = vpn_gateway_connection_ike_policy_prototype_model
- vpn_gateway_connection_prototype_vpn_gateway_connection_policy_mode_prototype_model_json['ipsec_policy'] = vpn_gateway_connection_i_psec_policy_prototype_model
- vpn_gateway_connection_prototype_vpn_gateway_connection_policy_mode_prototype_model_json['name'] = 'my-vpn-connection'
- vpn_gateway_connection_prototype_vpn_gateway_connection_policy_mode_prototype_model_json['peer_address'] = '169.21.50.5'
- vpn_gateway_connection_prototype_vpn_gateway_connection_policy_mode_prototype_model_json['psk'] = 'lkj14b1oi0alcniejkso'
- vpn_gateway_connection_prototype_vpn_gateway_connection_policy_mode_prototype_model_json['local_cidrs'] = ['192.168.1.0/24']
- vpn_gateway_connection_prototype_vpn_gateway_connection_policy_mode_prototype_model_json['peer_cidrs'] = ['10.45.1.0/24']
+ instance_network_attachment_prototype_model = {} # InstanceNetworkAttachmentPrototype
+ instance_network_attachment_prototype_model['name'] = 'my-instance-network-attachment'
+ instance_network_attachment_prototype_model['virtual_network_interface'] = instance_network_attachment_prototype_virtual_network_interface_model
- # Construct a model instance of VPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype by calling from_dict on the json representation
- vpn_gateway_connection_prototype_vpn_gateway_connection_policy_mode_prototype_model = VPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype.from_dict(vpn_gateway_connection_prototype_vpn_gateway_connection_policy_mode_prototype_model_json)
- assert vpn_gateway_connection_prototype_vpn_gateway_connection_policy_mode_prototype_model != False
+ # Construct a json representation of a InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkAttachment model
+ instance_prototype_instance_by_catalog_offering_instance_by_catalog_offering_instance_by_network_attachment_model_json = {}
+ instance_prototype_instance_by_catalog_offering_instance_by_catalog_offering_instance_by_network_attachment_model_json['availability_policy'] = instance_availability_policy_prototype_model
+ instance_prototype_instance_by_catalog_offering_instance_by_catalog_offering_instance_by_network_attachment_model_json['default_trusted_profile'] = instance_default_trusted_profile_prototype_model
+ instance_prototype_instance_by_catalog_offering_instance_by_catalog_offering_instance_by_network_attachment_model_json['keys'] = [key_identity_model]
+ instance_prototype_instance_by_catalog_offering_instance_by_catalog_offering_instance_by_network_attachment_model_json['metadata_service'] = instance_metadata_service_prototype_model
+ instance_prototype_instance_by_catalog_offering_instance_by_catalog_offering_instance_by_network_attachment_model_json['name'] = 'my-instance'
+ instance_prototype_instance_by_catalog_offering_instance_by_catalog_offering_instance_by_network_attachment_model_json['placement_target'] = instance_placement_target_prototype_model
+ instance_prototype_instance_by_catalog_offering_instance_by_catalog_offering_instance_by_network_attachment_model_json['profile'] = instance_profile_identity_model
+ instance_prototype_instance_by_catalog_offering_instance_by_catalog_offering_instance_by_network_attachment_model_json['reservation_affinity'] = instance_reservation_affinity_prototype_model
+ instance_prototype_instance_by_catalog_offering_instance_by_catalog_offering_instance_by_network_attachment_model_json['resource_group'] = resource_group_identity_model
+ instance_prototype_instance_by_catalog_offering_instance_by_catalog_offering_instance_by_network_attachment_model_json['total_volume_bandwidth'] = 500
+ instance_prototype_instance_by_catalog_offering_instance_by_catalog_offering_instance_by_network_attachment_model_json['user_data'] = 'testString'
+ instance_prototype_instance_by_catalog_offering_instance_by_catalog_offering_instance_by_network_attachment_model_json['volume_attachments'] = [volume_attachment_prototype_model]
+ instance_prototype_instance_by_catalog_offering_instance_by_catalog_offering_instance_by_network_attachment_model_json['vpc'] = vpc_identity_model
+ instance_prototype_instance_by_catalog_offering_instance_by_catalog_offering_instance_by_network_attachment_model_json['boot_volume_attachment'] = volume_attachment_prototype_instance_by_image_context_model
+ instance_prototype_instance_by_catalog_offering_instance_by_catalog_offering_instance_by_network_attachment_model_json['catalog_offering'] = instance_catalog_offering_prototype_model
+ instance_prototype_instance_by_catalog_offering_instance_by_catalog_offering_instance_by_network_attachment_model_json['zone'] = zone_identity_model
+ instance_prototype_instance_by_catalog_offering_instance_by_catalog_offering_instance_by_network_attachment_model_json['network_attachments'] = [instance_network_attachment_prototype_model]
+ instance_prototype_instance_by_catalog_offering_instance_by_catalog_offering_instance_by_network_attachment_model_json['primary_network_attachment'] = instance_network_attachment_prototype_model
- # Construct a model instance of VPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype by calling from_dict on the json representation
- vpn_gateway_connection_prototype_vpn_gateway_connection_policy_mode_prototype_model_dict = VPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype.from_dict(vpn_gateway_connection_prototype_vpn_gateway_connection_policy_mode_prototype_model_json).__dict__
- vpn_gateway_connection_prototype_vpn_gateway_connection_policy_mode_prototype_model2 = VPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype(**vpn_gateway_connection_prototype_vpn_gateway_connection_policy_mode_prototype_model_dict)
+ # Construct a model instance of InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkAttachment by calling from_dict on the json representation
+ instance_prototype_instance_by_catalog_offering_instance_by_catalog_offering_instance_by_network_attachment_model = InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkAttachment.from_dict(instance_prototype_instance_by_catalog_offering_instance_by_catalog_offering_instance_by_network_attachment_model_json)
+ assert instance_prototype_instance_by_catalog_offering_instance_by_catalog_offering_instance_by_network_attachment_model != False
+
+ # Construct a model instance of InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkAttachment by calling from_dict on the json representation
+ instance_prototype_instance_by_catalog_offering_instance_by_catalog_offering_instance_by_network_attachment_model_dict = InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkAttachment.from_dict(instance_prototype_instance_by_catalog_offering_instance_by_catalog_offering_instance_by_network_attachment_model_json).__dict__
+ instance_prototype_instance_by_catalog_offering_instance_by_catalog_offering_instance_by_network_attachment_model2 = InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkAttachment(**instance_prototype_instance_by_catalog_offering_instance_by_catalog_offering_instance_by_network_attachment_model_dict)
# Verify the model instances are equivalent
- assert vpn_gateway_connection_prototype_vpn_gateway_connection_policy_mode_prototype_model == vpn_gateway_connection_prototype_vpn_gateway_connection_policy_mode_prototype_model2
+ assert instance_prototype_instance_by_catalog_offering_instance_by_catalog_offering_instance_by_network_attachment_model == instance_prototype_instance_by_catalog_offering_instance_by_catalog_offering_instance_by_network_attachment_model2
# Convert model instance back to dict and verify no loss of data
- vpn_gateway_connection_prototype_vpn_gateway_connection_policy_mode_prototype_model_json2 = vpn_gateway_connection_prototype_vpn_gateway_connection_policy_mode_prototype_model.to_dict()
- assert vpn_gateway_connection_prototype_vpn_gateway_connection_policy_mode_prototype_model_json2 == vpn_gateway_connection_prototype_vpn_gateway_connection_policy_mode_prototype_model_json
+ instance_prototype_instance_by_catalog_offering_instance_by_catalog_offering_instance_by_network_attachment_model_json2 = instance_prototype_instance_by_catalog_offering_instance_by_catalog_offering_instance_by_network_attachment_model.to_dict()
+ assert instance_prototype_instance_by_catalog_offering_instance_by_catalog_offering_instance_by_network_attachment_model_json2 == instance_prototype_instance_by_catalog_offering_instance_by_catalog_offering_instance_by_network_attachment_model_json
-class TestModel_VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype:
+class TestModel_InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkInterface:
"""
- Test Class for VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype
+ Test Class for InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkInterface
"""
- def test_vpn_gateway_connection_prototype_vpn_gateway_connection_static_route_mode_prototype_serialization(self):
+ def test_instance_prototype_instance_by_catalog_offering_instance_by_catalog_offering_instance_by_network_interface_serialization(self):
"""
- Test serialization/deserialization for VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype
+ Test serialization/deserialization for InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkInterface
"""
# Construct dict forms of any model objects needed in order to build this model.
- vpn_gateway_connection_dpd_prototype_model = {} # VPNGatewayConnectionDPDPrototype
- vpn_gateway_connection_dpd_prototype_model['action'] = 'restart'
- vpn_gateway_connection_dpd_prototype_model['interval'] = 30
- vpn_gateway_connection_dpd_prototype_model['timeout'] = 120
+ instance_availability_policy_prototype_model = {} # InstanceAvailabilityPolicyPrototype
+ instance_availability_policy_prototype_model['host_failure'] = 'restart'
- vpn_gateway_connection_ike_policy_prototype_model = {} # VPNGatewayConnectionIKEPolicyPrototypeIKEPolicyIdentityById
- vpn_gateway_connection_ike_policy_prototype_model['id'] = 'ddf51bec-3424-11e8-b467-0ed5f89f718b'
+ trusted_profile_identity_model = {} # TrustedProfileIdentityTrustedProfileById
+ trusted_profile_identity_model['id'] = 'Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5'
- vpn_gateway_connection_i_psec_policy_prototype_model = {} # VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityById
- vpn_gateway_connection_i_psec_policy_prototype_model['id'] = 'ddf51bec-3424-11e8-b467-0ed5f89f718b'
+ instance_default_trusted_profile_prototype_model = {} # InstanceDefaultTrustedProfilePrototype
+ instance_default_trusted_profile_prototype_model['auto_link'] = False
+ instance_default_trusted_profile_prototype_model['target'] = trusted_profile_identity_model
- # Construct a json representation of a VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype model
- vpn_gateway_connection_prototype_vpn_gateway_connection_static_route_mode_prototype_model_json = {}
- vpn_gateway_connection_prototype_vpn_gateway_connection_static_route_mode_prototype_model_json['admin_state_up'] = True
- vpn_gateway_connection_prototype_vpn_gateway_connection_static_route_mode_prototype_model_json['dead_peer_detection'] = vpn_gateway_connection_dpd_prototype_model
- vpn_gateway_connection_prototype_vpn_gateway_connection_static_route_mode_prototype_model_json['ike_policy'] = vpn_gateway_connection_ike_policy_prototype_model
- vpn_gateway_connection_prototype_vpn_gateway_connection_static_route_mode_prototype_model_json['ipsec_policy'] = vpn_gateway_connection_i_psec_policy_prototype_model
- vpn_gateway_connection_prototype_vpn_gateway_connection_static_route_mode_prototype_model_json['name'] = 'my-vpn-connection'
- vpn_gateway_connection_prototype_vpn_gateway_connection_static_route_mode_prototype_model_json['peer_address'] = '169.21.50.5'
- vpn_gateway_connection_prototype_vpn_gateway_connection_static_route_mode_prototype_model_json['psk'] = 'lkj14b1oi0alcniejkso'
- vpn_gateway_connection_prototype_vpn_gateway_connection_static_route_mode_prototype_model_json['routing_protocol'] = 'none'
+ key_identity_model = {} # KeyIdentityById
+ key_identity_model['id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803'
- # Construct a model instance of VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype by calling from_dict on the json representation
- vpn_gateway_connection_prototype_vpn_gateway_connection_static_route_mode_prototype_model = VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype.from_dict(vpn_gateway_connection_prototype_vpn_gateway_connection_static_route_mode_prototype_model_json)
- assert vpn_gateway_connection_prototype_vpn_gateway_connection_static_route_mode_prototype_model != False
+ instance_metadata_service_prototype_model = {} # InstanceMetadataServicePrototype
+ instance_metadata_service_prototype_model['enabled'] = False
+ instance_metadata_service_prototype_model['protocol'] = 'https'
+ instance_metadata_service_prototype_model['response_hop_limit'] = 2
- # Construct a model instance of VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype by calling from_dict on the json representation
- vpn_gateway_connection_prototype_vpn_gateway_connection_static_route_mode_prototype_model_dict = VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype.from_dict(vpn_gateway_connection_prototype_vpn_gateway_connection_static_route_mode_prototype_model_json).__dict__
- vpn_gateway_connection_prototype_vpn_gateway_connection_static_route_mode_prototype_model2 = VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype(**vpn_gateway_connection_prototype_vpn_gateway_connection_static_route_mode_prototype_model_dict)
+ instance_placement_target_prototype_model = {} # InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById
+ instance_placement_target_prototype_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
- # Verify the model instances are equivalent
- assert vpn_gateway_connection_prototype_vpn_gateway_connection_static_route_mode_prototype_model == vpn_gateway_connection_prototype_vpn_gateway_connection_static_route_mode_prototype_model2
+ instance_profile_identity_model = {} # InstanceProfileIdentityByName
+ instance_profile_identity_model['name'] = 'cx2-16x32'
- # Convert model instance back to dict and verify no loss of data
- vpn_gateway_connection_prototype_vpn_gateway_connection_static_route_mode_prototype_model_json2 = vpn_gateway_connection_prototype_vpn_gateway_connection_static_route_mode_prototype_model.to_dict()
- assert vpn_gateway_connection_prototype_vpn_gateway_connection_static_route_mode_prototype_model_json2 == vpn_gateway_connection_prototype_vpn_gateway_connection_static_route_mode_prototype_model_json
+ reservation_identity_model = {} # ReservationIdentityById
+ reservation_identity_model['id'] = '7187-ba49df72-37b8-43ac-98da-f8e029de0e63'
+ instance_reservation_affinity_prototype_model = {} # InstanceReservationAffinityPrototype
+ instance_reservation_affinity_prototype_model['policy'] = 'disabled'
+ instance_reservation_affinity_prototype_model['pool'] = [reservation_identity_model]
-class TestModel_VPNGatewayConnectionStaticRouteMode:
- """
- Test Class for VPNGatewayConnectionStaticRouteMode
- """
+ resource_group_identity_model = {} # ResourceGroupIdentityById
+ resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
- def test_vpn_gateway_connection_static_route_mode_serialization(self):
- """
- Test serialization/deserialization for VPNGatewayConnectionStaticRouteMode
- """
+ volume_attachment_prototype_volume_model = {} # VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById
+ volume_attachment_prototype_volume_model['id'] = '1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
- # Construct dict forms of any model objects needed in order to build this model.
+ volume_attachment_prototype_model = {} # VolumeAttachmentPrototype
+ volume_attachment_prototype_model['delete_volume_on_instance_delete'] = False
+ volume_attachment_prototype_model['name'] = 'my-volume-attachment'
+ volume_attachment_prototype_model['volume'] = volume_attachment_prototype_volume_model
- 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
+ vpc_identity_model = {} # VPCIdentityById
+ vpc_identity_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b'
- ike_policy_reference_deleted_model = {} # IKEPolicyReferenceDeleted
- ike_policy_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/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179'
- 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'
+ volume_profile_identity_model = {} # VolumeProfileIdentityByName
+ volume_profile_identity_model['name'] = 'general-purpose'
- i_psec_policy_reference_deleted_model = {} # IPsecPolicyReferenceDeleted
- i_psec_policy_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ volume_prototype_instance_by_image_context_model = {} # VolumePrototypeInstanceByImageContext
+ volume_prototype_instance_by_image_context_model['capacity'] = 100
+ volume_prototype_instance_by_image_context_model['encryption_key'] = encryption_key_identity_model
+ volume_prototype_instance_by_image_context_model['iops'] = 10000
+ volume_prototype_instance_by_image_context_model['name'] = 'my-volume'
+ volume_prototype_instance_by_image_context_model['profile'] = volume_profile_identity_model
+ volume_prototype_instance_by_image_context_model['resource_group'] = resource_group_identity_model
+ volume_prototype_instance_by_image_context_model['user_tags'] = []
- 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_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
- vpn_gateway_connection_status_reason_model = {} # VPNGatewayConnectionStatusReason
- vpn_gateway_connection_status_reason_model['code'] = 'cannot_authenticate_connection'
- vpn_gateway_connection_status_reason_model['message'] = 'Failed to authenticate a connection because of mismatched IKE ID and PSK.'
- vpn_gateway_connection_status_reason_model['more_info'] = 'https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health'
+ catalog_offering_identity_model = {} # CatalogOfferingIdentityCatalogOfferingByCRN
+ catalog_offering_identity_model['crn'] = 'crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:offering:00111601-0ec5-41ac-b142-96d1e64e6442'
- ip_model = {} # IP
- ip_model['address'] = '192.168.3.4'
+ instance_catalog_offering_prototype_model = {} # InstanceCatalogOfferingPrototypeCatalogOfferingByOffering
+ instance_catalog_offering_prototype_model['offering'] = catalog_offering_identity_model
- vpn_gateway_connection_tunnel_status_reason_model = {} # VPNGatewayConnectionTunnelStatusReason
- vpn_gateway_connection_tunnel_status_reason_model['code'] = 'cannot_authenticate_connection'
- vpn_gateway_connection_tunnel_status_reason_model['message'] = 'Failed to authenticate a connection because of mismatched IKE ID and PSK.'
- vpn_gateway_connection_tunnel_status_reason_model['more_info'] = 'https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health'
+ zone_identity_model = {} # ZoneIdentityByName
+ zone_identity_model['name'] = 'us-south-1'
- 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_static_route_mode_tunnel_model['status_reasons'] = [vpn_gateway_connection_tunnel_status_reason_model]
+ network_interface_ip_prototype_model = {} # NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext
+ network_interface_ip_prototype_model['address'] = '10.0.0.5'
+ network_interface_ip_prototype_model['auto_delete'] = False
+ network_interface_ip_prototype_model['name'] = 'my-reserved-ip'
- # Construct a json representation of a VPNGatewayConnectionStaticRouteMode model
- vpn_gateway_connection_static_route_mode_model_json = {}
- vpn_gateway_connection_static_route_mode_model_json['admin_state_up'] = True
- vpn_gateway_connection_static_route_mode_model_json['authentication_mode'] = 'psk'
- vpn_gateway_connection_static_route_mode_model_json['created_at'] = '2019-01-01T12:00:00Z'
- vpn_gateway_connection_static_route_mode_model_json['dead_peer_detection'] = vpn_gateway_connection_dpd_model
- vpn_gateway_connection_static_route_mode_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_static_route_mode_model_json['id'] = 'a10a5771-dc23-442c-8460-c3601d8542f7'
- vpn_gateway_connection_static_route_mode_model_json['ike_policy'] = ike_policy_reference_model
- vpn_gateway_connection_static_route_mode_model_json['ipsec_policy'] = i_psec_policy_reference_model
- vpn_gateway_connection_static_route_mode_model_json['mode'] = 'route'
- vpn_gateway_connection_static_route_mode_model_json['name'] = 'my-vpn-connection'
- vpn_gateway_connection_static_route_mode_model_json['peer_address'] = '169.21.50.5'
- vpn_gateway_connection_static_route_mode_model_json['psk'] = 'lkj14b1oi0alcniejkso'
- vpn_gateway_connection_static_route_mode_model_json['resource_type'] = 'vpn_gateway_connection'
- vpn_gateway_connection_static_route_mode_model_json['status'] = 'down'
- vpn_gateway_connection_static_route_mode_model_json['status_reasons'] = [vpn_gateway_connection_status_reason_model]
- vpn_gateway_connection_static_route_mode_model_json['routing_protocol'] = 'none'
- vpn_gateway_connection_static_route_mode_model_json['tunnels'] = [vpn_gateway_connection_static_route_mode_tunnel_model]
+ security_group_identity_model = {} # SecurityGroupIdentityById
+ security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271'
- # Construct a model instance of VPNGatewayConnectionStaticRouteMode by calling from_dict on the json representation
- vpn_gateway_connection_static_route_mode_model = VPNGatewayConnectionStaticRouteMode.from_dict(vpn_gateway_connection_static_route_mode_model_json)
- assert vpn_gateway_connection_static_route_mode_model != False
+ subnet_identity_model = {} # SubnetIdentityById
+ subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
- # Construct a model instance of VPNGatewayConnectionStaticRouteMode by calling from_dict on the json representation
- vpn_gateway_connection_static_route_mode_model_dict = VPNGatewayConnectionStaticRouteMode.from_dict(vpn_gateway_connection_static_route_mode_model_json).__dict__
- vpn_gateway_connection_static_route_mode_model2 = VPNGatewayConnectionStaticRouteMode(**vpn_gateway_connection_static_route_mode_model_dict)
+ network_interface_prototype_model = {} # NetworkInterfacePrototype
+ network_interface_prototype_model['allow_ip_spoofing'] = True
+ network_interface_prototype_model['name'] = 'my-instance-network-interface'
+ network_interface_prototype_model['primary_ip'] = network_interface_ip_prototype_model
+ network_interface_prototype_model['security_groups'] = [security_group_identity_model]
+ network_interface_prototype_model['subnet'] = subnet_identity_model
+
+ # Construct a json representation of a InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkInterface model
+ instance_prototype_instance_by_catalog_offering_instance_by_catalog_offering_instance_by_network_interface_model_json = {}
+ instance_prototype_instance_by_catalog_offering_instance_by_catalog_offering_instance_by_network_interface_model_json['availability_policy'] = instance_availability_policy_prototype_model
+ instance_prototype_instance_by_catalog_offering_instance_by_catalog_offering_instance_by_network_interface_model_json['default_trusted_profile'] = instance_default_trusted_profile_prototype_model
+ instance_prototype_instance_by_catalog_offering_instance_by_catalog_offering_instance_by_network_interface_model_json['keys'] = [key_identity_model]
+ instance_prototype_instance_by_catalog_offering_instance_by_catalog_offering_instance_by_network_interface_model_json['metadata_service'] = instance_metadata_service_prototype_model
+ instance_prototype_instance_by_catalog_offering_instance_by_catalog_offering_instance_by_network_interface_model_json['name'] = 'my-instance'
+ instance_prototype_instance_by_catalog_offering_instance_by_catalog_offering_instance_by_network_interface_model_json['placement_target'] = instance_placement_target_prototype_model
+ instance_prototype_instance_by_catalog_offering_instance_by_catalog_offering_instance_by_network_interface_model_json['profile'] = instance_profile_identity_model
+ instance_prototype_instance_by_catalog_offering_instance_by_catalog_offering_instance_by_network_interface_model_json['reservation_affinity'] = instance_reservation_affinity_prototype_model
+ instance_prototype_instance_by_catalog_offering_instance_by_catalog_offering_instance_by_network_interface_model_json['resource_group'] = resource_group_identity_model
+ instance_prototype_instance_by_catalog_offering_instance_by_catalog_offering_instance_by_network_interface_model_json['total_volume_bandwidth'] = 500
+ instance_prototype_instance_by_catalog_offering_instance_by_catalog_offering_instance_by_network_interface_model_json['user_data'] = 'testString'
+ instance_prototype_instance_by_catalog_offering_instance_by_catalog_offering_instance_by_network_interface_model_json['volume_attachments'] = [volume_attachment_prototype_model]
+ instance_prototype_instance_by_catalog_offering_instance_by_catalog_offering_instance_by_network_interface_model_json['vpc'] = vpc_identity_model
+ instance_prototype_instance_by_catalog_offering_instance_by_catalog_offering_instance_by_network_interface_model_json['boot_volume_attachment'] = volume_attachment_prototype_instance_by_image_context_model
+ instance_prototype_instance_by_catalog_offering_instance_by_catalog_offering_instance_by_network_interface_model_json['catalog_offering'] = instance_catalog_offering_prototype_model
+ instance_prototype_instance_by_catalog_offering_instance_by_catalog_offering_instance_by_network_interface_model_json['zone'] = zone_identity_model
+ instance_prototype_instance_by_catalog_offering_instance_by_catalog_offering_instance_by_network_interface_model_json['network_interfaces'] = [network_interface_prototype_model]
+ instance_prototype_instance_by_catalog_offering_instance_by_catalog_offering_instance_by_network_interface_model_json['primary_network_interface'] = network_interface_prototype_model
+
+ # Construct a model instance of InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkInterface by calling from_dict on the json representation
+ instance_prototype_instance_by_catalog_offering_instance_by_catalog_offering_instance_by_network_interface_model = InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkInterface.from_dict(instance_prototype_instance_by_catalog_offering_instance_by_catalog_offering_instance_by_network_interface_model_json)
+ assert instance_prototype_instance_by_catalog_offering_instance_by_catalog_offering_instance_by_network_interface_model != False
+
+ # Construct a model instance of InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkInterface by calling from_dict on the json representation
+ instance_prototype_instance_by_catalog_offering_instance_by_catalog_offering_instance_by_network_interface_model_dict = InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkInterface.from_dict(instance_prototype_instance_by_catalog_offering_instance_by_catalog_offering_instance_by_network_interface_model_json).__dict__
+ instance_prototype_instance_by_catalog_offering_instance_by_catalog_offering_instance_by_network_interface_model2 = InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkInterface(**instance_prototype_instance_by_catalog_offering_instance_by_catalog_offering_instance_by_network_interface_model_dict)
# Verify the model instances are equivalent
- assert vpn_gateway_connection_static_route_mode_model == vpn_gateway_connection_static_route_mode_model2
+ assert instance_prototype_instance_by_catalog_offering_instance_by_catalog_offering_instance_by_network_interface_model == instance_prototype_instance_by_catalog_offering_instance_by_catalog_offering_instance_by_network_interface_model2
# Convert model instance back to dict and verify no loss of data
- vpn_gateway_connection_static_route_mode_model_json2 = vpn_gateway_connection_static_route_mode_model.to_dict()
- assert vpn_gateway_connection_static_route_mode_model_json2 == vpn_gateway_connection_static_route_mode_model_json
+ instance_prototype_instance_by_catalog_offering_instance_by_catalog_offering_instance_by_network_interface_model_json2 = instance_prototype_instance_by_catalog_offering_instance_by_catalog_offering_instance_by_network_interface_model.to_dict()
+ assert instance_prototype_instance_by_catalog_offering_instance_by_catalog_offering_instance_by_network_interface_model_json2 == instance_prototype_instance_by_catalog_offering_instance_by_catalog_offering_instance_by_network_interface_model_json
-class TestModel_VPNGatewayPolicyMode:
+class TestModel_InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkAttachment:
"""
- Test Class for VPNGatewayPolicyMode
+ Test Class for InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkAttachment
"""
- def test_vpn_gateway_policy_mode_serialization(self):
+ def test_instance_prototype_instance_by_image_instance_by_image_instance_by_network_attachment_serialization(self):
"""
- Test serialization/deserialization for VPNGatewayPolicyMode
+ Test serialization/deserialization for InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkAttachment
"""
# 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'
+ instance_availability_policy_prototype_model = {} # InstanceAvailabilityPolicyPrototype
+ instance_availability_policy_prototype_model['host_failure'] = 'restart'
- 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'
+ trusted_profile_identity_model = {} # TrustedProfileIdentityTrustedProfileById
+ trusted_profile_identity_model['id'] = 'Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5'
- vpn_gateway_health_reason_model = {} # VPNGatewayHealthReason
- vpn_gateway_health_reason_model['code'] = 'cannot_reserve_ip_address'
- vpn_gateway_health_reason_model['message'] = 'IP address exhaustion (release addresses on the VPN\'s subnet).'
- vpn_gateway_health_reason_model['more_info'] = 'https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health'
+ instance_default_trusted_profile_prototype_model = {} # InstanceDefaultTrustedProfilePrototype
+ instance_default_trusted_profile_prototype_model['auto_link'] = False
+ instance_default_trusted_profile_prototype_model['target'] = trusted_profile_identity_model
- vpn_gateway_lifecycle_reason_model = {} # VPNGatewayLifecycleReason
- vpn_gateway_lifecycle_reason_model['code'] = 'resource_suspended_by_provider'
- vpn_gateway_lifecycle_reason_model['message'] = 'The resource has been suspended. Contact IBM support with the CRN for next steps.'
- vpn_gateway_lifecycle_reason_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#resource-suspension'
+ key_identity_model = {} # KeyIdentityById
+ key_identity_model['id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803'
- vpn_gateway_member_health_reason_model = {} # VPNGatewayMemberHealthReason
- vpn_gateway_member_health_reason_model['code'] = 'cannot_reserve_ip_address'
- vpn_gateway_member_health_reason_model['message'] = 'IP address exhaustion (release addresses on the VPN\'s subnet).'
- vpn_gateway_member_health_reason_model['more_info'] = 'https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health'
+ instance_metadata_service_prototype_model = {} # InstanceMetadataServicePrototype
+ instance_metadata_service_prototype_model['enabled'] = False
+ instance_metadata_service_prototype_model['protocol'] = 'https'
+ instance_metadata_service_prototype_model['response_hop_limit'] = 2
- vpn_gateway_member_lifecycle_reason_model = {} # VPNGatewayMemberLifecycleReason
- vpn_gateway_member_lifecycle_reason_model['code'] = 'resource_suspended_by_provider'
- vpn_gateway_member_lifecycle_reason_model['message'] = 'The resource has been suspended. Contact IBM support with the CRN for next steps.'
- vpn_gateway_member_lifecycle_reason_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#resource-suspension'
+ instance_placement_target_prototype_model = {} # InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById
+ instance_placement_target_prototype_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
- reserved_ip_reference_deleted_model = {} # ReservedIPReferenceDeleted
- reserved_ip_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ instance_profile_identity_model = {} # InstanceProfileIdentityByName
+ instance_profile_identity_model['name'] = 'cx2-16x32'
- 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'
+ reservation_identity_model = {} # ReservationIdentityById
+ reservation_identity_model['id'] = '7187-ba49df72-37b8-43ac-98da-f8e029de0e63'
- ip_model = {} # IP
- ip_model['address'] = '192.168.3.4'
+ instance_reservation_affinity_prototype_model = {} # InstanceReservationAffinityPrototype
+ instance_reservation_affinity_prototype_model['policy'] = 'disabled'
+ instance_reservation_affinity_prototype_model['pool'] = [reservation_identity_model]
- vpn_gateway_member_model = {} # VPNGatewayMember
- vpn_gateway_member_model['health_reasons'] = [vpn_gateway_member_health_reason_model]
- vpn_gateway_member_model['health_state'] = 'ok'
- vpn_gateway_member_model['lifecycle_reasons'] = [vpn_gateway_member_lifecycle_reason_model]
- vpn_gateway_member_model['lifecycle_state'] = 'stable'
- vpn_gateway_member_model['private_ip'] = reserved_ip_reference_model
- vpn_gateway_member_model['public_ip'] = ip_model
- vpn_gateway_member_model['role'] = 'active'
+ resource_group_identity_model = {} # ResourceGroupIdentityById
+ resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
- resource_group_reference_model = {} # ResourceGroupReference
- resource_group_reference_model['href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345'
- resource_group_reference_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
- resource_group_reference_model['name'] = 'my-resource-group'
+ volume_attachment_prototype_volume_model = {} # VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById
+ volume_attachment_prototype_volume_model['id'] = '1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
- subnet_reference_deleted_model = {} # SubnetReferenceDeleted
- subnet_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ volume_attachment_prototype_model = {} # VolumeAttachmentPrototype
+ volume_attachment_prototype_model['delete_volume_on_instance_delete'] = False
+ volume_attachment_prototype_model['name'] = 'my-volume-attachment'
+ volume_attachment_prototype_model['volume'] = volume_attachment_prototype_volume_model
- subnet_reference_model = {} # SubnetReference
- subnet_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
- subnet_reference_model['deleted'] = subnet_reference_deleted_model
- subnet_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
- subnet_reference_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
- subnet_reference_model['name'] = 'my-subnet'
- subnet_reference_model['resource_type'] = 'subnet'
+ vpc_identity_model = {} # VPCIdentityById
+ vpc_identity_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b'
- vpc_reference_deleted_model = {} # VPCReferenceDeleted
- vpc_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/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179'
- vpc_reference_model = {} # VPCReference
- vpc_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b'
- vpc_reference_model['deleted'] = vpc_reference_deleted_model
- vpc_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b'
- vpc_reference_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b'
- vpc_reference_model['name'] = 'my-vpc'
- vpc_reference_model['resource_type'] = 'vpc'
+ volume_profile_identity_model = {} # VolumeProfileIdentityByName
+ volume_profile_identity_model['name'] = 'general-purpose'
- # Construct a json representation of a VPNGatewayPolicyMode model
- vpn_gateway_policy_mode_model_json = {}
- vpn_gateway_policy_mode_model_json['connections'] = [vpn_gateway_connection_reference_model]
- vpn_gateway_policy_mode_model_json['created_at'] = '2019-01-01T12:00:00Z'
- vpn_gateway_policy_mode_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b'
- vpn_gateway_policy_mode_model_json['health_reasons'] = [vpn_gateway_health_reason_model]
- vpn_gateway_policy_mode_model_json['health_state'] = 'ok'
- vpn_gateway_policy_mode_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b'
- vpn_gateway_policy_mode_model_json['id'] = 'ddf51bec-3424-11e8-b467-0ed5f89f718b'
- vpn_gateway_policy_mode_model_json['lifecycle_reasons'] = [vpn_gateway_lifecycle_reason_model]
- vpn_gateway_policy_mode_model_json['lifecycle_state'] = 'stable'
- vpn_gateway_policy_mode_model_json['members'] = [vpn_gateway_member_model]
- vpn_gateway_policy_mode_model_json['name'] = 'my-vpn-gateway'
- vpn_gateway_policy_mode_model_json['resource_group'] = resource_group_reference_model
- vpn_gateway_policy_mode_model_json['resource_type'] = 'vpn_gateway'
- vpn_gateway_policy_mode_model_json['subnet'] = subnet_reference_model
- vpn_gateway_policy_mode_model_json['vpc'] = vpc_reference_model
- vpn_gateway_policy_mode_model_json['mode'] = 'policy'
+ volume_prototype_instance_by_image_context_model = {} # VolumePrototypeInstanceByImageContext
+ volume_prototype_instance_by_image_context_model['capacity'] = 100
+ volume_prototype_instance_by_image_context_model['encryption_key'] = encryption_key_identity_model
+ volume_prototype_instance_by_image_context_model['iops'] = 10000
+ volume_prototype_instance_by_image_context_model['name'] = 'my-volume'
+ volume_prototype_instance_by_image_context_model['profile'] = volume_profile_identity_model
+ volume_prototype_instance_by_image_context_model['resource_group'] = resource_group_identity_model
+ volume_prototype_instance_by_image_context_model['user_tags'] = []
- # Construct a model instance of VPNGatewayPolicyMode by calling from_dict on the json representation
- vpn_gateway_policy_mode_model = VPNGatewayPolicyMode.from_dict(vpn_gateway_policy_mode_model_json)
- assert vpn_gateway_policy_mode_model != False
+ 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
- # Construct a model instance of VPNGatewayPolicyMode by calling from_dict on the json representation
- vpn_gateway_policy_mode_model_dict = VPNGatewayPolicyMode.from_dict(vpn_gateway_policy_mode_model_json).__dict__
- vpn_gateway_policy_mode_model2 = VPNGatewayPolicyMode(**vpn_gateway_policy_mode_model_dict)
+ image_identity_model = {} # ImageIdentityById
+ image_identity_model['id'] = 'r006-02c73baf-9abb-493d-9e41-d0f1866f4051'
+
+ zone_identity_model = {} # ZoneIdentityByName
+ zone_identity_model['name'] = 'us-south-1'
+
+ virtual_network_interface_ip_prototype_model = {} # VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext
+ virtual_network_interface_ip_prototype_model['address'] = '10.0.0.5'
+ virtual_network_interface_ip_prototype_model['auto_delete'] = False
+ virtual_network_interface_ip_prototype_model['name'] = 'my-reserved-ip'
+
+ virtual_network_interface_primary_ip_prototype_model = {} # VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext
+ virtual_network_interface_primary_ip_prototype_model['address'] = '10.0.0.5'
+ virtual_network_interface_primary_ip_prototype_model['auto_delete'] = False
+ virtual_network_interface_primary_ip_prototype_model['name'] = 'my-reserved-ip'
+
+ 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'
+
+ instance_network_attachment_prototype_virtual_network_interface_model = {} # InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeInstanceNetworkAttachmentContext
+ instance_network_attachment_prototype_virtual_network_interface_model['allow_ip_spoofing'] = True
+ instance_network_attachment_prototype_virtual_network_interface_model['auto_delete'] = False
+ instance_network_attachment_prototype_virtual_network_interface_model['enable_infrastructure_nat'] = True
+ instance_network_attachment_prototype_virtual_network_interface_model['ips'] = [virtual_network_interface_ip_prototype_model]
+ instance_network_attachment_prototype_virtual_network_interface_model['name'] = 'my-virtual-network-interface'
+ instance_network_attachment_prototype_virtual_network_interface_model['primary_ip'] = virtual_network_interface_primary_ip_prototype_model
+ instance_network_attachment_prototype_virtual_network_interface_model['resource_group'] = resource_group_identity_model
+ instance_network_attachment_prototype_virtual_network_interface_model['security_groups'] = [security_group_identity_model]
+ instance_network_attachment_prototype_virtual_network_interface_model['subnet'] = subnet_identity_model
+
+ instance_network_attachment_prototype_model = {} # InstanceNetworkAttachmentPrototype
+ instance_network_attachment_prototype_model['name'] = 'my-instance-network-attachment'
+ instance_network_attachment_prototype_model['virtual_network_interface'] = instance_network_attachment_prototype_virtual_network_interface_model
+
+ # Construct a json representation of a InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkAttachment model
+ instance_prototype_instance_by_image_instance_by_image_instance_by_network_attachment_model_json = {}
+ instance_prototype_instance_by_image_instance_by_image_instance_by_network_attachment_model_json['availability_policy'] = instance_availability_policy_prototype_model
+ instance_prototype_instance_by_image_instance_by_image_instance_by_network_attachment_model_json['default_trusted_profile'] = instance_default_trusted_profile_prototype_model
+ instance_prototype_instance_by_image_instance_by_image_instance_by_network_attachment_model_json['keys'] = [key_identity_model]
+ instance_prototype_instance_by_image_instance_by_image_instance_by_network_attachment_model_json['metadata_service'] = instance_metadata_service_prototype_model
+ instance_prototype_instance_by_image_instance_by_image_instance_by_network_attachment_model_json['name'] = 'my-instance'
+ instance_prototype_instance_by_image_instance_by_image_instance_by_network_attachment_model_json['placement_target'] = instance_placement_target_prototype_model
+ instance_prototype_instance_by_image_instance_by_image_instance_by_network_attachment_model_json['profile'] = instance_profile_identity_model
+ instance_prototype_instance_by_image_instance_by_image_instance_by_network_attachment_model_json['reservation_affinity'] = instance_reservation_affinity_prototype_model
+ instance_prototype_instance_by_image_instance_by_image_instance_by_network_attachment_model_json['resource_group'] = resource_group_identity_model
+ instance_prototype_instance_by_image_instance_by_image_instance_by_network_attachment_model_json['total_volume_bandwidth'] = 500
+ instance_prototype_instance_by_image_instance_by_image_instance_by_network_attachment_model_json['user_data'] = 'testString'
+ instance_prototype_instance_by_image_instance_by_image_instance_by_network_attachment_model_json['volume_attachments'] = [volume_attachment_prototype_model]
+ instance_prototype_instance_by_image_instance_by_image_instance_by_network_attachment_model_json['vpc'] = vpc_identity_model
+ instance_prototype_instance_by_image_instance_by_image_instance_by_network_attachment_model_json['boot_volume_attachment'] = volume_attachment_prototype_instance_by_image_context_model
+ instance_prototype_instance_by_image_instance_by_image_instance_by_network_attachment_model_json['image'] = image_identity_model
+ instance_prototype_instance_by_image_instance_by_image_instance_by_network_attachment_model_json['zone'] = zone_identity_model
+ instance_prototype_instance_by_image_instance_by_image_instance_by_network_attachment_model_json['network_attachments'] = [instance_network_attachment_prototype_model]
+ instance_prototype_instance_by_image_instance_by_image_instance_by_network_attachment_model_json['primary_network_attachment'] = instance_network_attachment_prototype_model
+
+ # Construct a model instance of InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkAttachment by calling from_dict on the json representation
+ instance_prototype_instance_by_image_instance_by_image_instance_by_network_attachment_model = InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkAttachment.from_dict(instance_prototype_instance_by_image_instance_by_image_instance_by_network_attachment_model_json)
+ assert instance_prototype_instance_by_image_instance_by_image_instance_by_network_attachment_model != False
+
+ # Construct a model instance of InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkAttachment by calling from_dict on the json representation
+ instance_prototype_instance_by_image_instance_by_image_instance_by_network_attachment_model_dict = InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkAttachment.from_dict(instance_prototype_instance_by_image_instance_by_image_instance_by_network_attachment_model_json).__dict__
+ instance_prototype_instance_by_image_instance_by_image_instance_by_network_attachment_model2 = InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkAttachment(**instance_prototype_instance_by_image_instance_by_image_instance_by_network_attachment_model_dict)
# Verify the model instances are equivalent
- assert vpn_gateway_policy_mode_model == vpn_gateway_policy_mode_model2
+ assert instance_prototype_instance_by_image_instance_by_image_instance_by_network_attachment_model == instance_prototype_instance_by_image_instance_by_image_instance_by_network_attachment_model2
# Convert model instance back to dict and verify no loss of data
- vpn_gateway_policy_mode_model_json2 = vpn_gateway_policy_mode_model.to_dict()
- assert vpn_gateway_policy_mode_model_json2 == vpn_gateway_policy_mode_model_json
+ instance_prototype_instance_by_image_instance_by_image_instance_by_network_attachment_model_json2 = instance_prototype_instance_by_image_instance_by_image_instance_by_network_attachment_model.to_dict()
+ assert instance_prototype_instance_by_image_instance_by_image_instance_by_network_attachment_model_json2 == instance_prototype_instance_by_image_instance_by_image_instance_by_network_attachment_model_json
-class TestModel_VPNGatewayPrototypeVPNGatewayPolicyModePrototype:
+class TestModel_InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterface:
"""
- Test Class for VPNGatewayPrototypeVPNGatewayPolicyModePrototype
+ Test Class for InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterface
"""
- def test_vpn_gateway_prototype_vpn_gateway_policy_mode_prototype_serialization(self):
+ def test_instance_prototype_instance_by_image_instance_by_image_instance_by_network_interface_serialization(self):
"""
- Test serialization/deserialization for VPNGatewayPrototypeVPNGatewayPolicyModePrototype
+ Test serialization/deserialization for InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterface
"""
# Construct dict forms of any model objects needed in order to build this model.
+ instance_availability_policy_prototype_model = {} # InstanceAvailabilityPolicyPrototype
+ instance_availability_policy_prototype_model['host_failure'] = 'restart'
+
+ trusted_profile_identity_model = {} # TrustedProfileIdentityTrustedProfileById
+ trusted_profile_identity_model['id'] = 'Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5'
+
+ instance_default_trusted_profile_prototype_model = {} # InstanceDefaultTrustedProfilePrototype
+ instance_default_trusted_profile_prototype_model['auto_link'] = False
+ instance_default_trusted_profile_prototype_model['target'] = trusted_profile_identity_model
+
+ key_identity_model = {} # KeyIdentityById
+ key_identity_model['id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803'
+
+ instance_metadata_service_prototype_model = {} # InstanceMetadataServicePrototype
+ instance_metadata_service_prototype_model['enabled'] = False
+ instance_metadata_service_prototype_model['protocol'] = 'https'
+ instance_metadata_service_prototype_model['response_hop_limit'] = 2
+
+ instance_placement_target_prototype_model = {} # InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById
+ instance_placement_target_prototype_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
+
+ instance_profile_identity_model = {} # InstanceProfileIdentityByName
+ instance_profile_identity_model['name'] = 'cx2-16x32'
+
+ reservation_identity_model = {} # ReservationIdentityById
+ reservation_identity_model['id'] = '7187-ba49df72-37b8-43ac-98da-f8e029de0e63'
+
+ instance_reservation_affinity_prototype_model = {} # InstanceReservationAffinityPrototype
+ instance_reservation_affinity_prototype_model['policy'] = 'disabled'
+ instance_reservation_affinity_prototype_model['pool'] = [reservation_identity_model]
+
resource_group_identity_model = {} # ResourceGroupIdentityById
resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
- subnet_identity_model = {} # SubnetIdentityById
- subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
-
- # Construct a json representation of a VPNGatewayPrototypeVPNGatewayPolicyModePrototype model
- vpn_gateway_prototype_vpn_gateway_policy_mode_prototype_model_json = {}
- vpn_gateway_prototype_vpn_gateway_policy_mode_prototype_model_json['name'] = 'my-vpn-gateway'
- vpn_gateway_prototype_vpn_gateway_policy_mode_prototype_model_json['resource_group'] = resource_group_identity_model
- vpn_gateway_prototype_vpn_gateway_policy_mode_prototype_model_json['subnet'] = subnet_identity_model
- vpn_gateway_prototype_vpn_gateway_policy_mode_prototype_model_json['mode'] = 'policy'
+ volume_attachment_prototype_volume_model = {} # VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById
+ volume_attachment_prototype_volume_model['id'] = '1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
- # Construct a model instance of VPNGatewayPrototypeVPNGatewayPolicyModePrototype by calling from_dict on the json representation
- vpn_gateway_prototype_vpn_gateway_policy_mode_prototype_model = VPNGatewayPrototypeVPNGatewayPolicyModePrototype.from_dict(vpn_gateway_prototype_vpn_gateway_policy_mode_prototype_model_json)
- assert vpn_gateway_prototype_vpn_gateway_policy_mode_prototype_model != False
+ volume_attachment_prototype_model = {} # VolumeAttachmentPrototype
+ volume_attachment_prototype_model['delete_volume_on_instance_delete'] = False
+ volume_attachment_prototype_model['name'] = 'my-volume-attachment'
+ volume_attachment_prototype_model['volume'] = volume_attachment_prototype_volume_model
- # Construct a model instance of VPNGatewayPrototypeVPNGatewayPolicyModePrototype by calling from_dict on the json representation
- vpn_gateway_prototype_vpn_gateway_policy_mode_prototype_model_dict = VPNGatewayPrototypeVPNGatewayPolicyModePrototype.from_dict(vpn_gateway_prototype_vpn_gateway_policy_mode_prototype_model_json).__dict__
- vpn_gateway_prototype_vpn_gateway_policy_mode_prototype_model2 = VPNGatewayPrototypeVPNGatewayPolicyModePrototype(**vpn_gateway_prototype_vpn_gateway_policy_mode_prototype_model_dict)
+ vpc_identity_model = {} # VPCIdentityById
+ vpc_identity_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b'
- # Verify the model instances are equivalent
- assert vpn_gateway_prototype_vpn_gateway_policy_mode_prototype_model == vpn_gateway_prototype_vpn_gateway_policy_mode_prototype_model2
+ encryption_key_identity_model = {} # EncryptionKeyIdentityByCRN
+ encryption_key_identity_model['crn'] = 'crn:v1:bluemix:public:kms:us-south:a/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179'
- # Convert model instance back to dict and verify no loss of data
- vpn_gateway_prototype_vpn_gateway_policy_mode_prototype_model_json2 = vpn_gateway_prototype_vpn_gateway_policy_mode_prototype_model.to_dict()
- assert vpn_gateway_prototype_vpn_gateway_policy_mode_prototype_model_json2 == vpn_gateway_prototype_vpn_gateway_policy_mode_prototype_model_json
+ volume_profile_identity_model = {} # VolumeProfileIdentityByName
+ volume_profile_identity_model['name'] = 'general-purpose'
+ volume_prototype_instance_by_image_context_model = {} # VolumePrototypeInstanceByImageContext
+ volume_prototype_instance_by_image_context_model['capacity'] = 100
+ volume_prototype_instance_by_image_context_model['encryption_key'] = encryption_key_identity_model
+ volume_prototype_instance_by_image_context_model['iops'] = 10000
+ volume_prototype_instance_by_image_context_model['name'] = 'my-volume'
+ volume_prototype_instance_by_image_context_model['profile'] = volume_profile_identity_model
+ volume_prototype_instance_by_image_context_model['resource_group'] = resource_group_identity_model
+ volume_prototype_instance_by_image_context_model['user_tags'] = []
-class TestModel_VPNGatewayPrototypeVPNGatewayRouteModePrototype:
- """
- Test Class for VPNGatewayPrototypeVPNGatewayRouteModePrototype
- """
+ 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_vpn_gateway_prototype_vpn_gateway_route_mode_prototype_serialization(self):
- """
- Test serialization/deserialization for VPNGatewayPrototypeVPNGatewayRouteModePrototype
- """
+ image_identity_model = {} # ImageIdentityById
+ image_identity_model['id'] = 'r006-02c73baf-9abb-493d-9e41-d0f1866f4051'
- # 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'
- resource_group_identity_model = {} # ResourceGroupIdentityById
- resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
+ network_interface_ip_prototype_model = {} # NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext
+ network_interface_ip_prototype_model['address'] = '10.0.0.5'
+ network_interface_ip_prototype_model['auto_delete'] = False
+ network_interface_ip_prototype_model['name'] = 'my-reserved-ip'
+
+ security_group_identity_model = {} # SecurityGroupIdentityById
+ security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271'
subnet_identity_model = {} # SubnetIdentityById
subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
- # Construct a json representation of a VPNGatewayPrototypeVPNGatewayRouteModePrototype model
- vpn_gateway_prototype_vpn_gateway_route_mode_prototype_model_json = {}
- vpn_gateway_prototype_vpn_gateway_route_mode_prototype_model_json['name'] = 'my-vpn-gateway'
- vpn_gateway_prototype_vpn_gateway_route_mode_prototype_model_json['resource_group'] = resource_group_identity_model
- vpn_gateway_prototype_vpn_gateway_route_mode_prototype_model_json['subnet'] = subnet_identity_model
- vpn_gateway_prototype_vpn_gateway_route_mode_prototype_model_json['mode'] = 'route'
+ network_interface_prototype_model = {} # NetworkInterfacePrototype
+ network_interface_prototype_model['allow_ip_spoofing'] = True
+ network_interface_prototype_model['name'] = 'my-instance-network-interface'
+ network_interface_prototype_model['primary_ip'] = network_interface_ip_prototype_model
+ network_interface_prototype_model['security_groups'] = [security_group_identity_model]
+ network_interface_prototype_model['subnet'] = subnet_identity_model
- # Construct a model instance of VPNGatewayPrototypeVPNGatewayRouteModePrototype by calling from_dict on the json representation
- vpn_gateway_prototype_vpn_gateway_route_mode_prototype_model = VPNGatewayPrototypeVPNGatewayRouteModePrototype.from_dict(vpn_gateway_prototype_vpn_gateway_route_mode_prototype_model_json)
- assert vpn_gateway_prototype_vpn_gateway_route_mode_prototype_model != False
+ # Construct a json representation of a InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterface model
+ instance_prototype_instance_by_image_instance_by_image_instance_by_network_interface_model_json = {}
+ instance_prototype_instance_by_image_instance_by_image_instance_by_network_interface_model_json['availability_policy'] = instance_availability_policy_prototype_model
+ instance_prototype_instance_by_image_instance_by_image_instance_by_network_interface_model_json['default_trusted_profile'] = instance_default_trusted_profile_prototype_model
+ instance_prototype_instance_by_image_instance_by_image_instance_by_network_interface_model_json['keys'] = [key_identity_model]
+ instance_prototype_instance_by_image_instance_by_image_instance_by_network_interface_model_json['metadata_service'] = instance_metadata_service_prototype_model
+ instance_prototype_instance_by_image_instance_by_image_instance_by_network_interface_model_json['name'] = 'my-instance'
+ instance_prototype_instance_by_image_instance_by_image_instance_by_network_interface_model_json['placement_target'] = instance_placement_target_prototype_model
+ instance_prototype_instance_by_image_instance_by_image_instance_by_network_interface_model_json['profile'] = instance_profile_identity_model
+ instance_prototype_instance_by_image_instance_by_image_instance_by_network_interface_model_json['reservation_affinity'] = instance_reservation_affinity_prototype_model
+ instance_prototype_instance_by_image_instance_by_image_instance_by_network_interface_model_json['resource_group'] = resource_group_identity_model
+ instance_prototype_instance_by_image_instance_by_image_instance_by_network_interface_model_json['total_volume_bandwidth'] = 500
+ instance_prototype_instance_by_image_instance_by_image_instance_by_network_interface_model_json['user_data'] = 'testString'
+ instance_prototype_instance_by_image_instance_by_image_instance_by_network_interface_model_json['volume_attachments'] = [volume_attachment_prototype_model]
+ instance_prototype_instance_by_image_instance_by_image_instance_by_network_interface_model_json['vpc'] = vpc_identity_model
+ instance_prototype_instance_by_image_instance_by_image_instance_by_network_interface_model_json['boot_volume_attachment'] = volume_attachment_prototype_instance_by_image_context_model
+ instance_prototype_instance_by_image_instance_by_image_instance_by_network_interface_model_json['image'] = image_identity_model
+ instance_prototype_instance_by_image_instance_by_image_instance_by_network_interface_model_json['zone'] = zone_identity_model
+ instance_prototype_instance_by_image_instance_by_image_instance_by_network_interface_model_json['network_interfaces'] = [network_interface_prototype_model]
+ instance_prototype_instance_by_image_instance_by_image_instance_by_network_interface_model_json['primary_network_interface'] = network_interface_prototype_model
- # Construct a model instance of VPNGatewayPrototypeVPNGatewayRouteModePrototype by calling from_dict on the json representation
- vpn_gateway_prototype_vpn_gateway_route_mode_prototype_model_dict = VPNGatewayPrototypeVPNGatewayRouteModePrototype.from_dict(vpn_gateway_prototype_vpn_gateway_route_mode_prototype_model_json).__dict__
- vpn_gateway_prototype_vpn_gateway_route_mode_prototype_model2 = VPNGatewayPrototypeVPNGatewayRouteModePrototype(**vpn_gateway_prototype_vpn_gateway_route_mode_prototype_model_dict)
+ # Construct a model instance of InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterface by calling from_dict on the json representation
+ instance_prototype_instance_by_image_instance_by_image_instance_by_network_interface_model = InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterface.from_dict(instance_prototype_instance_by_image_instance_by_image_instance_by_network_interface_model_json)
+ assert instance_prototype_instance_by_image_instance_by_image_instance_by_network_interface_model != False
+
+ # Construct a model instance of InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterface by calling from_dict on the json representation
+ instance_prototype_instance_by_image_instance_by_image_instance_by_network_interface_model_dict = InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterface.from_dict(instance_prototype_instance_by_image_instance_by_image_instance_by_network_interface_model_json).__dict__
+ instance_prototype_instance_by_image_instance_by_image_instance_by_network_interface_model2 = InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterface(**instance_prototype_instance_by_image_instance_by_image_instance_by_network_interface_model_dict)
# Verify the model instances are equivalent
- assert vpn_gateway_prototype_vpn_gateway_route_mode_prototype_model == vpn_gateway_prototype_vpn_gateway_route_mode_prototype_model2
+ assert instance_prototype_instance_by_image_instance_by_image_instance_by_network_interface_model == instance_prototype_instance_by_image_instance_by_image_instance_by_network_interface_model2
# Convert model instance back to dict and verify no loss of data
- vpn_gateway_prototype_vpn_gateway_route_mode_prototype_model_json2 = vpn_gateway_prototype_vpn_gateway_route_mode_prototype_model.to_dict()
- assert vpn_gateway_prototype_vpn_gateway_route_mode_prototype_model_json2 == vpn_gateway_prototype_vpn_gateway_route_mode_prototype_model_json
+ instance_prototype_instance_by_image_instance_by_image_instance_by_network_interface_model_json2 = instance_prototype_instance_by_image_instance_by_image_instance_by_network_interface_model.to_dict()
+ assert instance_prototype_instance_by_image_instance_by_image_instance_by_network_interface_model_json2 == instance_prototype_instance_by_image_instance_by_image_instance_by_network_interface_model_json
-class TestModel_VPNGatewayRouteMode:
+class TestModel_InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkAttachment:
"""
- Test Class for VPNGatewayRouteMode
+ Test Class for InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkAttachment
"""
- def test_vpn_gateway_route_mode_serialization(self):
+ def test_instance_prototype_instance_by_source_snapshot_instance_by_source_snapshot_instance_by_network_attachment_serialization(self):
"""
- Test serialization/deserialization for VPNGatewayRouteMode
+ Test serialization/deserialization for InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkAttachment
"""
# 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'
+ instance_availability_policy_prototype_model = {} # InstanceAvailabilityPolicyPrototype
+ instance_availability_policy_prototype_model['host_failure'] = 'restart'
- 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'
+ trusted_profile_identity_model = {} # TrustedProfileIdentityTrustedProfileById
+ trusted_profile_identity_model['id'] = 'Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5'
- vpn_gateway_health_reason_model = {} # VPNGatewayHealthReason
- vpn_gateway_health_reason_model['code'] = 'cannot_reserve_ip_address'
- vpn_gateway_health_reason_model['message'] = 'IP address exhaustion (release addresses on the VPN\'s subnet).'
- vpn_gateway_health_reason_model['more_info'] = 'https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health'
+ instance_default_trusted_profile_prototype_model = {} # InstanceDefaultTrustedProfilePrototype
+ instance_default_trusted_profile_prototype_model['auto_link'] = False
+ instance_default_trusted_profile_prototype_model['target'] = trusted_profile_identity_model
- vpn_gateway_lifecycle_reason_model = {} # VPNGatewayLifecycleReason
- vpn_gateway_lifecycle_reason_model['code'] = 'resource_suspended_by_provider'
- vpn_gateway_lifecycle_reason_model['message'] = 'The resource has been suspended. Contact IBM support with the CRN for next steps.'
- vpn_gateway_lifecycle_reason_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#resource-suspension'
+ key_identity_model = {} # KeyIdentityById
+ key_identity_model['id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803'
- vpn_gateway_member_health_reason_model = {} # VPNGatewayMemberHealthReason
- vpn_gateway_member_health_reason_model['code'] = 'cannot_reserve_ip_address'
- vpn_gateway_member_health_reason_model['message'] = 'IP address exhaustion (release addresses on the VPN\'s subnet).'
- vpn_gateway_member_health_reason_model['more_info'] = 'https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health'
+ instance_metadata_service_prototype_model = {} # InstanceMetadataServicePrototype
+ instance_metadata_service_prototype_model['enabled'] = False
+ instance_metadata_service_prototype_model['protocol'] = 'https'
+ instance_metadata_service_prototype_model['response_hop_limit'] = 2
- vpn_gateway_member_lifecycle_reason_model = {} # VPNGatewayMemberLifecycleReason
- vpn_gateway_member_lifecycle_reason_model['code'] = 'resource_suspended_by_provider'
- vpn_gateway_member_lifecycle_reason_model['message'] = 'The resource has been suspended. Contact IBM support with the CRN for next steps.'
- vpn_gateway_member_lifecycle_reason_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#resource-suspension'
+ instance_placement_target_prototype_model = {} # InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById
+ instance_placement_target_prototype_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
- reserved_ip_reference_deleted_model = {} # ReservedIPReferenceDeleted
- reserved_ip_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ instance_profile_identity_model = {} # InstanceProfileIdentityByName
+ instance_profile_identity_model['name'] = 'cx2-16x32'
- 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'
+ reservation_identity_model = {} # ReservationIdentityById
+ reservation_identity_model['id'] = '7187-ba49df72-37b8-43ac-98da-f8e029de0e63'
- ip_model = {} # IP
- ip_model['address'] = '192.168.3.4'
+ instance_reservation_affinity_prototype_model = {} # InstanceReservationAffinityPrototype
+ instance_reservation_affinity_prototype_model['policy'] = 'disabled'
+ instance_reservation_affinity_prototype_model['pool'] = [reservation_identity_model]
- vpn_gateway_member_model = {} # VPNGatewayMember
- vpn_gateway_member_model['health_reasons'] = [vpn_gateway_member_health_reason_model]
- vpn_gateway_member_model['health_state'] = 'ok'
- vpn_gateway_member_model['lifecycle_reasons'] = [vpn_gateway_member_lifecycle_reason_model]
- vpn_gateway_member_model['lifecycle_state'] = 'stable'
- vpn_gateway_member_model['private_ip'] = reserved_ip_reference_model
- vpn_gateway_member_model['public_ip'] = ip_model
- vpn_gateway_member_model['role'] = 'active'
+ resource_group_identity_model = {} # ResourceGroupIdentityById
+ resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
- resource_group_reference_model = {} # ResourceGroupReference
- resource_group_reference_model['href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345'
- resource_group_reference_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
- resource_group_reference_model['name'] = 'my-resource-group'
+ volume_attachment_prototype_volume_model = {} # VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById
+ volume_attachment_prototype_volume_model['id'] = '1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
- subnet_reference_deleted_model = {} # SubnetReferenceDeleted
- subnet_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ volume_attachment_prototype_model = {} # VolumeAttachmentPrototype
+ volume_attachment_prototype_model['delete_volume_on_instance_delete'] = False
+ volume_attachment_prototype_model['name'] = 'my-volume-attachment'
+ volume_attachment_prototype_model['volume'] = volume_attachment_prototype_volume_model
- subnet_reference_model = {} # SubnetReference
- subnet_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
- subnet_reference_model['deleted'] = subnet_reference_deleted_model
- subnet_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
- subnet_reference_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
- subnet_reference_model['name'] = 'my-subnet'
- subnet_reference_model['resource_type'] = 'subnet'
+ vpc_identity_model = {} # VPCIdentityById
+ vpc_identity_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b'
- vpc_reference_deleted_model = {} # VPCReferenceDeleted
- vpc_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/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179'
- vpc_reference_model = {} # VPCReference
- vpc_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b'
- vpc_reference_model['deleted'] = vpc_reference_deleted_model
- vpc_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b'
- vpc_reference_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b'
- vpc_reference_model['name'] = 'my-vpc'
- vpc_reference_model['resource_type'] = 'vpc'
+ volume_profile_identity_model = {} # VolumeProfileIdentityByName
+ volume_profile_identity_model['name'] = 'general-purpose'
- # Construct a json representation of a VPNGatewayRouteMode model
- vpn_gateway_route_mode_model_json = {}
- vpn_gateway_route_mode_model_json['connections'] = [vpn_gateway_connection_reference_model]
- vpn_gateway_route_mode_model_json['created_at'] = '2019-01-01T12:00:00Z'
- vpn_gateway_route_mode_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b'
- vpn_gateway_route_mode_model_json['health_reasons'] = [vpn_gateway_health_reason_model]
- vpn_gateway_route_mode_model_json['health_state'] = 'ok'
- vpn_gateway_route_mode_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b'
- vpn_gateway_route_mode_model_json['id'] = 'ddf51bec-3424-11e8-b467-0ed5f89f718b'
- vpn_gateway_route_mode_model_json['lifecycle_reasons'] = [vpn_gateway_lifecycle_reason_model]
- vpn_gateway_route_mode_model_json['lifecycle_state'] = 'stable'
- vpn_gateway_route_mode_model_json['members'] = [vpn_gateway_member_model]
- vpn_gateway_route_mode_model_json['name'] = 'my-vpn-gateway'
- vpn_gateway_route_mode_model_json['resource_group'] = resource_group_reference_model
- vpn_gateway_route_mode_model_json['resource_type'] = 'vpn_gateway'
- vpn_gateway_route_mode_model_json['subnet'] = subnet_reference_model
- vpn_gateway_route_mode_model_json['vpc'] = vpc_reference_model
- vpn_gateway_route_mode_model_json['mode'] = 'route'
+ snapshot_identity_model = {} # SnapshotIdentityById
+ snapshot_identity_model['id'] = '349a61d8-7ab1-420f-a690-5fed76ef9d4f'
- # Construct a model instance of VPNGatewayRouteMode by calling from_dict on the json representation
- vpn_gateway_route_mode_model = VPNGatewayRouteMode.from_dict(vpn_gateway_route_mode_model_json)
- assert vpn_gateway_route_mode_model != False
+ volume_prototype_instance_by_source_snapshot_context_model = {} # VolumePrototypeInstanceBySourceSnapshotContext
+ volume_prototype_instance_by_source_snapshot_context_model['capacity'] = 100
+ volume_prototype_instance_by_source_snapshot_context_model['encryption_key'] = encryption_key_identity_model
+ volume_prototype_instance_by_source_snapshot_context_model['iops'] = 10000
+ volume_prototype_instance_by_source_snapshot_context_model['name'] = 'my-volume'
+ volume_prototype_instance_by_source_snapshot_context_model['profile'] = volume_profile_identity_model
+ volume_prototype_instance_by_source_snapshot_context_model['resource_group'] = resource_group_identity_model
+ volume_prototype_instance_by_source_snapshot_context_model['source_snapshot'] = snapshot_identity_model
+ volume_prototype_instance_by_source_snapshot_context_model['user_tags'] = []
- # Construct a model instance of VPNGatewayRouteMode by calling from_dict on the json representation
- vpn_gateway_route_mode_model_dict = VPNGatewayRouteMode.from_dict(vpn_gateway_route_mode_model_json).__dict__
- vpn_gateway_route_mode_model2 = VPNGatewayRouteMode(**vpn_gateway_route_mode_model_dict)
+ volume_attachment_prototype_instance_by_source_snapshot_context_model = {} # VolumeAttachmentPrototypeInstanceBySourceSnapshotContext
+ volume_attachment_prototype_instance_by_source_snapshot_context_model['delete_volume_on_instance_delete'] = True
+ volume_attachment_prototype_instance_by_source_snapshot_context_model['name'] = 'my-volume-attachment'
+ volume_attachment_prototype_instance_by_source_snapshot_context_model['volume'] = volume_prototype_instance_by_source_snapshot_context_model
- # Verify the model instances are equivalent
- assert vpn_gateway_route_mode_model == vpn_gateway_route_mode_model2
+ zone_identity_model = {} # ZoneIdentityByName
+ zone_identity_model['name'] = 'us-south-1'
- # Convert model instance back to dict and verify no loss of data
- vpn_gateway_route_mode_model_json2 = vpn_gateway_route_mode_model.to_dict()
- assert vpn_gateway_route_mode_model_json2 == vpn_gateway_route_mode_model_json
+ virtual_network_interface_ip_prototype_model = {} # VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext
+ virtual_network_interface_ip_prototype_model['address'] = '10.0.0.5'
+ virtual_network_interface_ip_prototype_model['auto_delete'] = False
+ virtual_network_interface_ip_prototype_model['name'] = 'my-reserved-ip'
+ virtual_network_interface_primary_ip_prototype_model = {} # VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext
+ virtual_network_interface_primary_ip_prototype_model['address'] = '10.0.0.5'
+ virtual_network_interface_primary_ip_prototype_model['auto_delete'] = False
+ virtual_network_interface_primary_ip_prototype_model['name'] = 'my-reserved-ip'
-class TestModel_VPNServerAuthenticationByCertificate:
- """
- Test Class for VPNServerAuthenticationByCertificate
- """
+ security_group_identity_model = {} # SecurityGroupIdentityById
+ security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271'
- def test_vpn_server_authentication_by_certificate_serialization(self):
- """
- Test serialization/deserialization for VPNServerAuthenticationByCertificate
- """
+ subnet_identity_model = {} # SubnetIdentityById
+ subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
- # Construct dict forms of any model objects needed in order to build this model.
+ instance_network_attachment_prototype_virtual_network_interface_model = {} # InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeInstanceNetworkAttachmentContext
+ instance_network_attachment_prototype_virtual_network_interface_model['allow_ip_spoofing'] = True
+ instance_network_attachment_prototype_virtual_network_interface_model['auto_delete'] = False
+ instance_network_attachment_prototype_virtual_network_interface_model['enable_infrastructure_nat'] = True
+ instance_network_attachment_prototype_virtual_network_interface_model['ips'] = [virtual_network_interface_ip_prototype_model]
+ instance_network_attachment_prototype_virtual_network_interface_model['name'] = 'my-virtual-network-interface'
+ instance_network_attachment_prototype_virtual_network_interface_model['primary_ip'] = virtual_network_interface_primary_ip_prototype_model
+ instance_network_attachment_prototype_virtual_network_interface_model['resource_group'] = resource_group_identity_model
+ instance_network_attachment_prototype_virtual_network_interface_model['security_groups'] = [security_group_identity_model]
+ instance_network_attachment_prototype_virtual_network_interface_model['subnet'] = subnet_identity_model
- certificate_instance_reference_model = {} # CertificateInstanceReference
- certificate_instance_reference_model['crn'] = 'crn:v1:bluemix:public:secrets-manager:us-south:a/123456:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5'
+ instance_network_attachment_prototype_model = {} # InstanceNetworkAttachmentPrototype
+ instance_network_attachment_prototype_model['name'] = 'my-instance-network-attachment'
+ instance_network_attachment_prototype_model['virtual_network_interface'] = instance_network_attachment_prototype_virtual_network_interface_model
- # Construct a json representation of a VPNServerAuthenticationByCertificate model
- vpn_server_authentication_by_certificate_model_json = {}
- vpn_server_authentication_by_certificate_model_json['method'] = 'certificate'
- vpn_server_authentication_by_certificate_model_json['client_ca'] = certificate_instance_reference_model
- vpn_server_authentication_by_certificate_model_json['crl'] = 'testString'
+ # Construct a json representation of a InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkAttachment model
+ instance_prototype_instance_by_source_snapshot_instance_by_source_snapshot_instance_by_network_attachment_model_json = {}
+ instance_prototype_instance_by_source_snapshot_instance_by_source_snapshot_instance_by_network_attachment_model_json['availability_policy'] = instance_availability_policy_prototype_model
+ instance_prototype_instance_by_source_snapshot_instance_by_source_snapshot_instance_by_network_attachment_model_json['default_trusted_profile'] = instance_default_trusted_profile_prototype_model
+ instance_prototype_instance_by_source_snapshot_instance_by_source_snapshot_instance_by_network_attachment_model_json['keys'] = [key_identity_model]
+ instance_prototype_instance_by_source_snapshot_instance_by_source_snapshot_instance_by_network_attachment_model_json['metadata_service'] = instance_metadata_service_prototype_model
+ instance_prototype_instance_by_source_snapshot_instance_by_source_snapshot_instance_by_network_attachment_model_json['name'] = 'my-instance'
+ instance_prototype_instance_by_source_snapshot_instance_by_source_snapshot_instance_by_network_attachment_model_json['placement_target'] = instance_placement_target_prototype_model
+ instance_prototype_instance_by_source_snapshot_instance_by_source_snapshot_instance_by_network_attachment_model_json['profile'] = instance_profile_identity_model
+ instance_prototype_instance_by_source_snapshot_instance_by_source_snapshot_instance_by_network_attachment_model_json['reservation_affinity'] = instance_reservation_affinity_prototype_model
+ instance_prototype_instance_by_source_snapshot_instance_by_source_snapshot_instance_by_network_attachment_model_json['resource_group'] = resource_group_identity_model
+ instance_prototype_instance_by_source_snapshot_instance_by_source_snapshot_instance_by_network_attachment_model_json['total_volume_bandwidth'] = 500
+ instance_prototype_instance_by_source_snapshot_instance_by_source_snapshot_instance_by_network_attachment_model_json['user_data'] = 'testString'
+ instance_prototype_instance_by_source_snapshot_instance_by_source_snapshot_instance_by_network_attachment_model_json['volume_attachments'] = [volume_attachment_prototype_model]
+ instance_prototype_instance_by_source_snapshot_instance_by_source_snapshot_instance_by_network_attachment_model_json['vpc'] = vpc_identity_model
+ instance_prototype_instance_by_source_snapshot_instance_by_source_snapshot_instance_by_network_attachment_model_json['boot_volume_attachment'] = volume_attachment_prototype_instance_by_source_snapshot_context_model
+ instance_prototype_instance_by_source_snapshot_instance_by_source_snapshot_instance_by_network_attachment_model_json['zone'] = zone_identity_model
+ instance_prototype_instance_by_source_snapshot_instance_by_source_snapshot_instance_by_network_attachment_model_json['network_attachments'] = [instance_network_attachment_prototype_model]
+ instance_prototype_instance_by_source_snapshot_instance_by_source_snapshot_instance_by_network_attachment_model_json['primary_network_attachment'] = instance_network_attachment_prototype_model
- # Construct a model instance of VPNServerAuthenticationByCertificate by calling from_dict on the json representation
- vpn_server_authentication_by_certificate_model = VPNServerAuthenticationByCertificate.from_dict(vpn_server_authentication_by_certificate_model_json)
- assert vpn_server_authentication_by_certificate_model != False
+ # Construct a model instance of InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkAttachment by calling from_dict on the json representation
+ instance_prototype_instance_by_source_snapshot_instance_by_source_snapshot_instance_by_network_attachment_model = InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkAttachment.from_dict(instance_prototype_instance_by_source_snapshot_instance_by_source_snapshot_instance_by_network_attachment_model_json)
+ assert instance_prototype_instance_by_source_snapshot_instance_by_source_snapshot_instance_by_network_attachment_model != False
- # Construct a model instance of VPNServerAuthenticationByCertificate by calling from_dict on the json representation
- vpn_server_authentication_by_certificate_model_dict = VPNServerAuthenticationByCertificate.from_dict(vpn_server_authentication_by_certificate_model_json).__dict__
- vpn_server_authentication_by_certificate_model2 = VPNServerAuthenticationByCertificate(**vpn_server_authentication_by_certificate_model_dict)
+ # Construct a model instance of InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkAttachment by calling from_dict on the json representation
+ instance_prototype_instance_by_source_snapshot_instance_by_source_snapshot_instance_by_network_attachment_model_dict = InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkAttachment.from_dict(instance_prototype_instance_by_source_snapshot_instance_by_source_snapshot_instance_by_network_attachment_model_json).__dict__
+ instance_prototype_instance_by_source_snapshot_instance_by_source_snapshot_instance_by_network_attachment_model2 = InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkAttachment(**instance_prototype_instance_by_source_snapshot_instance_by_source_snapshot_instance_by_network_attachment_model_dict)
# Verify the model instances are equivalent
- assert vpn_server_authentication_by_certificate_model == vpn_server_authentication_by_certificate_model2
+ assert instance_prototype_instance_by_source_snapshot_instance_by_source_snapshot_instance_by_network_attachment_model == instance_prototype_instance_by_source_snapshot_instance_by_source_snapshot_instance_by_network_attachment_model2
# Convert model instance back to dict and verify no loss of data
- vpn_server_authentication_by_certificate_model_json2 = vpn_server_authentication_by_certificate_model.to_dict()
- assert vpn_server_authentication_by_certificate_model_json2 == vpn_server_authentication_by_certificate_model_json
+ instance_prototype_instance_by_source_snapshot_instance_by_source_snapshot_instance_by_network_attachment_model_json2 = instance_prototype_instance_by_source_snapshot_instance_by_source_snapshot_instance_by_network_attachment_model.to_dict()
+ assert instance_prototype_instance_by_source_snapshot_instance_by_source_snapshot_instance_by_network_attachment_model_json2 == instance_prototype_instance_by_source_snapshot_instance_by_source_snapshot_instance_by_network_attachment_model_json
-class TestModel_VPNServerAuthenticationByUsername:
+class TestModel_InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkInterface:
"""
- Test Class for VPNServerAuthenticationByUsername
+ Test Class for InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkInterface
"""
- def test_vpn_server_authentication_by_username_serialization(self):
+ def test_instance_prototype_instance_by_source_snapshot_instance_by_source_snapshot_instance_by_network_interface_serialization(self):
"""
- Test serialization/deserialization for VPNServerAuthenticationByUsername
+ Test serialization/deserialization for InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkInterface
"""
# Construct dict forms of any model objects needed in order to build this model.
- vpn_server_authentication_by_username_id_provider_model = {} # VPNServerAuthenticationByUsernameIdProviderByIAM
- vpn_server_authentication_by_username_id_provider_model['provider_type'] = 'iam'
-
- # Construct a json representation of a VPNServerAuthenticationByUsername model
- vpn_server_authentication_by_username_model_json = {}
- vpn_server_authentication_by_username_model_json['method'] = 'certificate'
- vpn_server_authentication_by_username_model_json['identity_provider'] = vpn_server_authentication_by_username_id_provider_model
-
- # Construct a model instance of VPNServerAuthenticationByUsername by calling from_dict on the json representation
- vpn_server_authentication_by_username_model = VPNServerAuthenticationByUsername.from_dict(vpn_server_authentication_by_username_model_json)
- assert vpn_server_authentication_by_username_model != False
-
- # Construct a model instance of VPNServerAuthenticationByUsername by calling from_dict on the json representation
- vpn_server_authentication_by_username_model_dict = VPNServerAuthenticationByUsername.from_dict(vpn_server_authentication_by_username_model_json).__dict__
- vpn_server_authentication_by_username_model2 = VPNServerAuthenticationByUsername(**vpn_server_authentication_by_username_model_dict)
-
- # Verify the model instances are equivalent
- assert vpn_server_authentication_by_username_model == vpn_server_authentication_by_username_model2
-
- # Convert model instance back to dict and verify no loss of data
- vpn_server_authentication_by_username_model_json2 = vpn_server_authentication_by_username_model.to_dict()
- assert vpn_server_authentication_by_username_model_json2 == vpn_server_authentication_by_username_model_json
-
+ instance_availability_policy_prototype_model = {} # InstanceAvailabilityPolicyPrototype
+ instance_availability_policy_prototype_model['host_failure'] = 'restart'
-class TestModel_VPNServerAuthenticationByUsernameIdProviderByIAM:
- """
- Test Class for VPNServerAuthenticationByUsernameIdProviderByIAM
- """
+ trusted_profile_identity_model = {} # TrustedProfileIdentityTrustedProfileById
+ trusted_profile_identity_model['id'] = 'Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5'
- def test_vpn_server_authentication_by_username_id_provider_by_iam_serialization(self):
- """
- Test serialization/deserialization for VPNServerAuthenticationByUsernameIdProviderByIAM
- """
+ instance_default_trusted_profile_prototype_model = {} # InstanceDefaultTrustedProfilePrototype
+ instance_default_trusted_profile_prototype_model['auto_link'] = False
+ instance_default_trusted_profile_prototype_model['target'] = trusted_profile_identity_model
- # Construct a json representation of a VPNServerAuthenticationByUsernameIdProviderByIAM model
- vpn_server_authentication_by_username_id_provider_by_iam_model_json = {}
- vpn_server_authentication_by_username_id_provider_by_iam_model_json['provider_type'] = 'iam'
+ key_identity_model = {} # KeyIdentityById
+ key_identity_model['id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803'
- # Construct a model instance of VPNServerAuthenticationByUsernameIdProviderByIAM by calling from_dict on the json representation
- vpn_server_authentication_by_username_id_provider_by_iam_model = VPNServerAuthenticationByUsernameIdProviderByIAM.from_dict(vpn_server_authentication_by_username_id_provider_by_iam_model_json)
- assert vpn_server_authentication_by_username_id_provider_by_iam_model != False
+ instance_metadata_service_prototype_model = {} # InstanceMetadataServicePrototype
+ instance_metadata_service_prototype_model['enabled'] = False
+ instance_metadata_service_prototype_model['protocol'] = 'https'
+ instance_metadata_service_prototype_model['response_hop_limit'] = 2
- # Construct a model instance of VPNServerAuthenticationByUsernameIdProviderByIAM by calling from_dict on the json representation
- vpn_server_authentication_by_username_id_provider_by_iam_model_dict = VPNServerAuthenticationByUsernameIdProviderByIAM.from_dict(vpn_server_authentication_by_username_id_provider_by_iam_model_json).__dict__
- vpn_server_authentication_by_username_id_provider_by_iam_model2 = VPNServerAuthenticationByUsernameIdProviderByIAM(**vpn_server_authentication_by_username_id_provider_by_iam_model_dict)
+ instance_placement_target_prototype_model = {} # InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById
+ instance_placement_target_prototype_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
- # Verify the model instances are equivalent
- assert vpn_server_authentication_by_username_id_provider_by_iam_model == vpn_server_authentication_by_username_id_provider_by_iam_model2
+ instance_profile_identity_model = {} # InstanceProfileIdentityByName
+ instance_profile_identity_model['name'] = 'cx2-16x32'
- # Convert model instance back to dict and verify no loss of data
- vpn_server_authentication_by_username_id_provider_by_iam_model_json2 = vpn_server_authentication_by_username_id_provider_by_iam_model.to_dict()
- assert vpn_server_authentication_by_username_id_provider_by_iam_model_json2 == vpn_server_authentication_by_username_id_provider_by_iam_model_json
+ reservation_identity_model = {} # ReservationIdentityById
+ reservation_identity_model['id'] = '7187-ba49df72-37b8-43ac-98da-f8e029de0e63'
+ instance_reservation_affinity_prototype_model = {} # InstanceReservationAffinityPrototype
+ instance_reservation_affinity_prototype_model['policy'] = 'disabled'
+ instance_reservation_affinity_prototype_model['pool'] = [reservation_identity_model]
-class TestModel_VPNServerAuthenticationPrototypeVPNServerAuthenticationByCertificatePrototype:
- """
- Test Class for VPNServerAuthenticationPrototypeVPNServerAuthenticationByCertificatePrototype
- """
+ resource_group_identity_model = {} # ResourceGroupIdentityById
+ resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
- def test_vpn_server_authentication_prototype_vpn_server_authentication_by_certificate_prototype_serialization(self):
- """
- Test serialization/deserialization for VPNServerAuthenticationPrototypeVPNServerAuthenticationByCertificatePrototype
- """
+ volume_attachment_prototype_volume_model = {} # VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById
+ volume_attachment_prototype_volume_model['id'] = '1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
- # Construct dict forms of any model objects needed in order to build this model.
+ volume_attachment_prototype_model = {} # VolumeAttachmentPrototype
+ volume_attachment_prototype_model['delete_volume_on_instance_delete'] = False
+ volume_attachment_prototype_model['name'] = 'my-volume-attachment'
+ volume_attachment_prototype_model['volume'] = volume_attachment_prototype_volume_model
- certificate_instance_identity_model = {} # CertificateInstanceIdentityByCRN
- certificate_instance_identity_model['crn'] = 'crn:v1:bluemix:public:secrets-manager:us-south:a/123456:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5'
+ vpc_identity_model = {} # VPCIdentityById
+ vpc_identity_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b'
- # Construct a json representation of a VPNServerAuthenticationPrototypeVPNServerAuthenticationByCertificatePrototype model
- vpn_server_authentication_prototype_vpn_server_authentication_by_certificate_prototype_model_json = {}
- vpn_server_authentication_prototype_vpn_server_authentication_by_certificate_prototype_model_json['method'] = 'certificate'
- vpn_server_authentication_prototype_vpn_server_authentication_by_certificate_prototype_model_json['client_ca'] = certificate_instance_identity_model
- vpn_server_authentication_prototype_vpn_server_authentication_by_certificate_prototype_model_json['crl'] = 'testString'
+ encryption_key_identity_model = {} # EncryptionKeyIdentityByCRN
+ encryption_key_identity_model['crn'] = 'crn:v1:bluemix:public:kms:us-south:a/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179'
- # Construct a model instance of VPNServerAuthenticationPrototypeVPNServerAuthenticationByCertificatePrototype by calling from_dict on the json representation
- vpn_server_authentication_prototype_vpn_server_authentication_by_certificate_prototype_model = VPNServerAuthenticationPrototypeVPNServerAuthenticationByCertificatePrototype.from_dict(vpn_server_authentication_prototype_vpn_server_authentication_by_certificate_prototype_model_json)
- assert vpn_server_authentication_prototype_vpn_server_authentication_by_certificate_prototype_model != False
+ volume_profile_identity_model = {} # VolumeProfileIdentityByName
+ volume_profile_identity_model['name'] = 'general-purpose'
- # Construct a model instance of VPNServerAuthenticationPrototypeVPNServerAuthenticationByCertificatePrototype by calling from_dict on the json representation
- vpn_server_authentication_prototype_vpn_server_authentication_by_certificate_prototype_model_dict = VPNServerAuthenticationPrototypeVPNServerAuthenticationByCertificatePrototype.from_dict(vpn_server_authentication_prototype_vpn_server_authentication_by_certificate_prototype_model_json).__dict__
- vpn_server_authentication_prototype_vpn_server_authentication_by_certificate_prototype_model2 = VPNServerAuthenticationPrototypeVPNServerAuthenticationByCertificatePrototype(**vpn_server_authentication_prototype_vpn_server_authentication_by_certificate_prototype_model_dict)
+ snapshot_identity_model = {} # SnapshotIdentityById
+ snapshot_identity_model['id'] = '349a61d8-7ab1-420f-a690-5fed76ef9d4f'
- # Verify the model instances are equivalent
- assert vpn_server_authentication_prototype_vpn_server_authentication_by_certificate_prototype_model == vpn_server_authentication_prototype_vpn_server_authentication_by_certificate_prototype_model2
+ volume_prototype_instance_by_source_snapshot_context_model = {} # VolumePrototypeInstanceBySourceSnapshotContext
+ volume_prototype_instance_by_source_snapshot_context_model['capacity'] = 100
+ volume_prototype_instance_by_source_snapshot_context_model['encryption_key'] = encryption_key_identity_model
+ volume_prototype_instance_by_source_snapshot_context_model['iops'] = 10000
+ volume_prototype_instance_by_source_snapshot_context_model['name'] = 'my-volume'
+ volume_prototype_instance_by_source_snapshot_context_model['profile'] = volume_profile_identity_model
+ volume_prototype_instance_by_source_snapshot_context_model['resource_group'] = resource_group_identity_model
+ volume_prototype_instance_by_source_snapshot_context_model['source_snapshot'] = snapshot_identity_model
+ volume_prototype_instance_by_source_snapshot_context_model['user_tags'] = []
- # Convert model instance back to dict and verify no loss of data
- vpn_server_authentication_prototype_vpn_server_authentication_by_certificate_prototype_model_json2 = vpn_server_authentication_prototype_vpn_server_authentication_by_certificate_prototype_model.to_dict()
- assert vpn_server_authentication_prototype_vpn_server_authentication_by_certificate_prototype_model_json2 == vpn_server_authentication_prototype_vpn_server_authentication_by_certificate_prototype_model_json
+ volume_attachment_prototype_instance_by_source_snapshot_context_model = {} # VolumeAttachmentPrototypeInstanceBySourceSnapshotContext
+ volume_attachment_prototype_instance_by_source_snapshot_context_model['delete_volume_on_instance_delete'] = True
+ volume_attachment_prototype_instance_by_source_snapshot_context_model['name'] = 'my-volume-attachment'
+ volume_attachment_prototype_instance_by_source_snapshot_context_model['volume'] = volume_prototype_instance_by_source_snapshot_context_model
+ zone_identity_model = {} # ZoneIdentityByName
+ zone_identity_model['name'] = 'us-south-1'
-class TestModel_VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype:
- """
- Test Class for VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype
- """
+ network_interface_ip_prototype_model = {} # NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext
+ network_interface_ip_prototype_model['address'] = '10.0.0.5'
+ network_interface_ip_prototype_model['auto_delete'] = False
+ network_interface_ip_prototype_model['name'] = 'my-reserved-ip'
- def test_vpn_server_authentication_prototype_vpn_server_authentication_by_username_prototype_serialization(self):
- """
- Test serialization/deserialization for VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype
- """
+ security_group_identity_model = {} # SecurityGroupIdentityById
+ security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271'
- # Construct dict forms of any model objects needed in order to build this model.
+ subnet_identity_model = {} # SubnetIdentityById
+ subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
- vpn_server_authentication_by_username_id_provider_model = {} # VPNServerAuthenticationByUsernameIdProviderByIAM
- vpn_server_authentication_by_username_id_provider_model['provider_type'] = 'iam'
+ network_interface_prototype_model = {} # NetworkInterfacePrototype
+ network_interface_prototype_model['allow_ip_spoofing'] = True
+ network_interface_prototype_model['name'] = 'my-instance-network-interface'
+ network_interface_prototype_model['primary_ip'] = network_interface_ip_prototype_model
+ network_interface_prototype_model['security_groups'] = [security_group_identity_model]
+ network_interface_prototype_model['subnet'] = subnet_identity_model
- # Construct a json representation of a VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype model
- vpn_server_authentication_prototype_vpn_server_authentication_by_username_prototype_model_json = {}
- vpn_server_authentication_prototype_vpn_server_authentication_by_username_prototype_model_json['method'] = 'username'
- vpn_server_authentication_prototype_vpn_server_authentication_by_username_prototype_model_json['identity_provider'] = vpn_server_authentication_by_username_id_provider_model
+ # Construct a json representation of a InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkInterface model
+ instance_prototype_instance_by_source_snapshot_instance_by_source_snapshot_instance_by_network_interface_model_json = {}
+ instance_prototype_instance_by_source_snapshot_instance_by_source_snapshot_instance_by_network_interface_model_json['availability_policy'] = instance_availability_policy_prototype_model
+ instance_prototype_instance_by_source_snapshot_instance_by_source_snapshot_instance_by_network_interface_model_json['default_trusted_profile'] = instance_default_trusted_profile_prototype_model
+ instance_prototype_instance_by_source_snapshot_instance_by_source_snapshot_instance_by_network_interface_model_json['keys'] = [key_identity_model]
+ instance_prototype_instance_by_source_snapshot_instance_by_source_snapshot_instance_by_network_interface_model_json['metadata_service'] = instance_metadata_service_prototype_model
+ instance_prototype_instance_by_source_snapshot_instance_by_source_snapshot_instance_by_network_interface_model_json['name'] = 'my-instance'
+ instance_prototype_instance_by_source_snapshot_instance_by_source_snapshot_instance_by_network_interface_model_json['placement_target'] = instance_placement_target_prototype_model
+ instance_prototype_instance_by_source_snapshot_instance_by_source_snapshot_instance_by_network_interface_model_json['profile'] = instance_profile_identity_model
+ instance_prototype_instance_by_source_snapshot_instance_by_source_snapshot_instance_by_network_interface_model_json['reservation_affinity'] = instance_reservation_affinity_prototype_model
+ instance_prototype_instance_by_source_snapshot_instance_by_source_snapshot_instance_by_network_interface_model_json['resource_group'] = resource_group_identity_model
+ instance_prototype_instance_by_source_snapshot_instance_by_source_snapshot_instance_by_network_interface_model_json['total_volume_bandwidth'] = 500
+ instance_prototype_instance_by_source_snapshot_instance_by_source_snapshot_instance_by_network_interface_model_json['user_data'] = 'testString'
+ instance_prototype_instance_by_source_snapshot_instance_by_source_snapshot_instance_by_network_interface_model_json['volume_attachments'] = [volume_attachment_prototype_model]
+ instance_prototype_instance_by_source_snapshot_instance_by_source_snapshot_instance_by_network_interface_model_json['vpc'] = vpc_identity_model
+ instance_prototype_instance_by_source_snapshot_instance_by_source_snapshot_instance_by_network_interface_model_json['boot_volume_attachment'] = volume_attachment_prototype_instance_by_source_snapshot_context_model
+ instance_prototype_instance_by_source_snapshot_instance_by_source_snapshot_instance_by_network_interface_model_json['zone'] = zone_identity_model
+ instance_prototype_instance_by_source_snapshot_instance_by_source_snapshot_instance_by_network_interface_model_json['network_interfaces'] = [network_interface_prototype_model]
+ instance_prototype_instance_by_source_snapshot_instance_by_source_snapshot_instance_by_network_interface_model_json['primary_network_interface'] = network_interface_prototype_model
- # Construct a model instance of VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype by calling from_dict on the json representation
- vpn_server_authentication_prototype_vpn_server_authentication_by_username_prototype_model = VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype.from_dict(vpn_server_authentication_prototype_vpn_server_authentication_by_username_prototype_model_json)
- assert vpn_server_authentication_prototype_vpn_server_authentication_by_username_prototype_model != False
+ # Construct a model instance of InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkInterface by calling from_dict on the json representation
+ instance_prototype_instance_by_source_snapshot_instance_by_source_snapshot_instance_by_network_interface_model = InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkInterface.from_dict(instance_prototype_instance_by_source_snapshot_instance_by_source_snapshot_instance_by_network_interface_model_json)
+ assert instance_prototype_instance_by_source_snapshot_instance_by_source_snapshot_instance_by_network_interface_model != False
- # Construct a model instance of VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype by calling from_dict on the json representation
- vpn_server_authentication_prototype_vpn_server_authentication_by_username_prototype_model_dict = VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype.from_dict(vpn_server_authentication_prototype_vpn_server_authentication_by_username_prototype_model_json).__dict__
- vpn_server_authentication_prototype_vpn_server_authentication_by_username_prototype_model2 = VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype(**vpn_server_authentication_prototype_vpn_server_authentication_by_username_prototype_model_dict)
+ # Construct a model instance of InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkInterface by calling from_dict on the json representation
+ instance_prototype_instance_by_source_snapshot_instance_by_source_snapshot_instance_by_network_interface_model_dict = InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkInterface.from_dict(instance_prototype_instance_by_source_snapshot_instance_by_source_snapshot_instance_by_network_interface_model_json).__dict__
+ instance_prototype_instance_by_source_snapshot_instance_by_source_snapshot_instance_by_network_interface_model2 = InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkInterface(**instance_prototype_instance_by_source_snapshot_instance_by_source_snapshot_instance_by_network_interface_model_dict)
# Verify the model instances are equivalent
- assert vpn_server_authentication_prototype_vpn_server_authentication_by_username_prototype_model == vpn_server_authentication_prototype_vpn_server_authentication_by_username_prototype_model2
+ assert instance_prototype_instance_by_source_snapshot_instance_by_source_snapshot_instance_by_network_interface_model == instance_prototype_instance_by_source_snapshot_instance_by_source_snapshot_instance_by_network_interface_model2
# Convert model instance back to dict and verify no loss of data
- vpn_server_authentication_prototype_vpn_server_authentication_by_username_prototype_model_json2 = vpn_server_authentication_prototype_vpn_server_authentication_by_username_prototype_model.to_dict()
- assert vpn_server_authentication_prototype_vpn_server_authentication_by_username_prototype_model_json2 == vpn_server_authentication_prototype_vpn_server_authentication_by_username_prototype_model_json
+ instance_prototype_instance_by_source_snapshot_instance_by_source_snapshot_instance_by_network_interface_model_json2 = instance_prototype_instance_by_source_snapshot_instance_by_source_snapshot_instance_by_network_interface_model.to_dict()
+ assert instance_prototype_instance_by_source_snapshot_instance_by_source_snapshot_instance_by_network_interface_model_json2 == instance_prototype_instance_by_source_snapshot_instance_by_source_snapshot_instance_by_network_interface_model_json
-class TestModel_VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext:
+class TestModel_InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkAttachment:
"""
- Test Class for VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext
+ Test Class for InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkAttachment
"""
- def test_virtual_network_interface_primary_ip_prototype_reserved_ip_prototype_virtual_network_interface_primary_ip_context_serialization(self):
+ def test_instance_prototype_instance_by_volume_instance_by_volume_instance_by_network_attachment_serialization(self):
"""
- Test serialization/deserialization for VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext
+ Test serialization/deserialization for InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkAttachment
"""
- # Construct a json representation of a VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext model
- virtual_network_interface_primary_ip_prototype_reserved_ip_prototype_virtual_network_interface_primary_ip_context_model_json = {}
- virtual_network_interface_primary_ip_prototype_reserved_ip_prototype_virtual_network_interface_primary_ip_context_model_json['address'] = '192.168.3.4'
- virtual_network_interface_primary_ip_prototype_reserved_ip_prototype_virtual_network_interface_primary_ip_context_model_json['auto_delete'] = False
- virtual_network_interface_primary_ip_prototype_reserved_ip_prototype_virtual_network_interface_primary_ip_context_model_json['name'] = 'my-reserved-ip'
-
- # Construct a model instance of VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext by calling from_dict on the json representation
- virtual_network_interface_primary_ip_prototype_reserved_ip_prototype_virtual_network_interface_primary_ip_context_model = VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext.from_dict(virtual_network_interface_primary_ip_prototype_reserved_ip_prototype_virtual_network_interface_primary_ip_context_model_json)
- assert virtual_network_interface_primary_ip_prototype_reserved_ip_prototype_virtual_network_interface_primary_ip_context_model != False
-
- # Construct a model instance of VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext by calling from_dict on the json representation
- virtual_network_interface_primary_ip_prototype_reserved_ip_prototype_virtual_network_interface_primary_ip_context_model_dict = VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext.from_dict(virtual_network_interface_primary_ip_prototype_reserved_ip_prototype_virtual_network_interface_primary_ip_context_model_json).__dict__
- virtual_network_interface_primary_ip_prototype_reserved_ip_prototype_virtual_network_interface_primary_ip_context_model2 = VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext(**virtual_network_interface_primary_ip_prototype_reserved_ip_prototype_virtual_network_interface_primary_ip_context_model_dict)
-
- # Verify the model instances are equivalent
- assert virtual_network_interface_primary_ip_prototype_reserved_ip_prototype_virtual_network_interface_primary_ip_context_model == virtual_network_interface_primary_ip_prototype_reserved_ip_prototype_virtual_network_interface_primary_ip_context_model2
+ # 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
- virtual_network_interface_primary_ip_prototype_reserved_ip_prototype_virtual_network_interface_primary_ip_context_model_json2 = virtual_network_interface_primary_ip_prototype_reserved_ip_prototype_virtual_network_interface_primary_ip_context_model.to_dict()
- assert virtual_network_interface_primary_ip_prototype_reserved_ip_prototype_virtual_network_interface_primary_ip_context_model_json2 == virtual_network_interface_primary_ip_prototype_reserved_ip_prototype_virtual_network_interface_primary_ip_context_model_json
+ instance_availability_policy_prototype_model = {} # InstanceAvailabilityPolicyPrototype
+ instance_availability_policy_prototype_model['host_failure'] = 'restart'
+ trusted_profile_identity_model = {} # TrustedProfileIdentityTrustedProfileById
+ trusted_profile_identity_model['id'] = 'Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5'
-class TestModel_VirtualNetworkInterfaceTargetShareMountTargetReference:
- """
- Test Class for VirtualNetworkInterfaceTargetShareMountTargetReference
- """
+ instance_default_trusted_profile_prototype_model = {} # InstanceDefaultTrustedProfilePrototype
+ instance_default_trusted_profile_prototype_model['auto_link'] = False
+ instance_default_trusted_profile_prototype_model['target'] = trusted_profile_identity_model
- def test_virtual_network_interface_target_share_mount_target_reference_serialization(self):
- """
- Test serialization/deserialization for VirtualNetworkInterfaceTargetShareMountTargetReference
- """
+ key_identity_model = {} # KeyIdentityById
+ key_identity_model['id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803'
- # Construct dict forms of any model objects needed in order to build this model.
+ instance_metadata_service_prototype_model = {} # InstanceMetadataServicePrototype
+ instance_metadata_service_prototype_model['enabled'] = False
+ instance_metadata_service_prototype_model['protocol'] = 'https'
+ instance_metadata_service_prototype_model['response_hop_limit'] = 2
- share_mount_target_reference_deleted_model = {} # ShareMountTargetReferenceDeleted
- share_mount_target_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ instance_placement_target_prototype_model = {} # InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById
+ instance_placement_target_prototype_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
- # Construct a json representation of a VirtualNetworkInterfaceTargetShareMountTargetReference model
- virtual_network_interface_target_share_mount_target_reference_model_json = {}
- virtual_network_interface_target_share_mount_target_reference_model_json['deleted'] = share_mount_target_reference_deleted_model
- virtual_network_interface_target_share_mount_target_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c'
- virtual_network_interface_target_share_mount_target_reference_model_json['id'] = '4cf9171a-0043-4434-8727-15b53dbc374c'
- virtual_network_interface_target_share_mount_target_reference_model_json['name'] = 'my-share-mount-target'
- virtual_network_interface_target_share_mount_target_reference_model_json['resource_type'] = 'share_mount_target'
+ instance_profile_identity_model = {} # InstanceProfileIdentityByName
+ instance_profile_identity_model['name'] = 'cx2-16x32'
- # Construct a model instance of VirtualNetworkInterfaceTargetShareMountTargetReference by calling from_dict on the json representation
- virtual_network_interface_target_share_mount_target_reference_model = VirtualNetworkInterfaceTargetShareMountTargetReference.from_dict(virtual_network_interface_target_share_mount_target_reference_model_json)
- assert virtual_network_interface_target_share_mount_target_reference_model != False
+ reservation_identity_model = {} # ReservationIdentityById
+ reservation_identity_model['id'] = '7187-ba49df72-37b8-43ac-98da-f8e029de0e63'
- # Construct a model instance of VirtualNetworkInterfaceTargetShareMountTargetReference by calling from_dict on the json representation
- virtual_network_interface_target_share_mount_target_reference_model_dict = VirtualNetworkInterfaceTargetShareMountTargetReference.from_dict(virtual_network_interface_target_share_mount_target_reference_model_json).__dict__
- virtual_network_interface_target_share_mount_target_reference_model2 = VirtualNetworkInterfaceTargetShareMountTargetReference(**virtual_network_interface_target_share_mount_target_reference_model_dict)
+ instance_reservation_affinity_prototype_model = {} # InstanceReservationAffinityPrototype
+ instance_reservation_affinity_prototype_model['policy'] = 'disabled'
+ instance_reservation_affinity_prototype_model['pool'] = [reservation_identity_model]
- # Verify the model instances are equivalent
- assert virtual_network_interface_target_share_mount_target_reference_model == virtual_network_interface_target_share_mount_target_reference_model2
+ resource_group_identity_model = {} # ResourceGroupIdentityById
+ resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
- # Convert model instance back to dict and verify no loss of data
- virtual_network_interface_target_share_mount_target_reference_model_json2 = virtual_network_interface_target_share_mount_target_reference_model.to_dict()
- assert virtual_network_interface_target_share_mount_target_reference_model_json2 == virtual_network_interface_target_share_mount_target_reference_model_json
+ volume_attachment_prototype_volume_model = {} # VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById
+ volume_attachment_prototype_volume_model['id'] = '1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
+ volume_attachment_prototype_model = {} # VolumeAttachmentPrototype
+ volume_attachment_prototype_model['delete_volume_on_instance_delete'] = False
+ volume_attachment_prototype_model['name'] = 'my-volume-attachment'
+ volume_attachment_prototype_model['volume'] = volume_attachment_prototype_volume_model
-class TestModel_VolumeIdentityByCRN:
- """
- Test Class for VolumeIdentityByCRN
- """
+ vpc_identity_model = {} # VPCIdentityById
+ vpc_identity_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b'
- def test_volume_identity_by_crn_serialization(self):
- """
- Test serialization/deserialization for VolumeIdentityByCRN
- """
+ volume_identity_model = {} # VolumeIdentityById
+ volume_identity_model['id'] = '1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
- # Construct a json representation of a VolumeIdentityByCRN model
- volume_identity_by_crn_model_json = {}
- volume_identity_by_crn_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
+ volume_attachment_prototype_instance_by_volume_context_model = {} # VolumeAttachmentPrototypeInstanceByVolumeContext
+ volume_attachment_prototype_instance_by_volume_context_model['delete_volume_on_instance_delete'] = False
+ volume_attachment_prototype_instance_by_volume_context_model['name'] = 'my-volume-attachment'
+ volume_attachment_prototype_instance_by_volume_context_model['volume'] = volume_identity_model
- # Construct a model instance of VolumeIdentityByCRN by calling from_dict on the json representation
- volume_identity_by_crn_model = VolumeIdentityByCRN.from_dict(volume_identity_by_crn_model_json)
- assert volume_identity_by_crn_model != False
+ zone_identity_model = {} # ZoneIdentityByName
+ zone_identity_model['name'] = 'us-south-1'
- # Construct a model instance of VolumeIdentityByCRN by calling from_dict on the json representation
- volume_identity_by_crn_model_dict = VolumeIdentityByCRN.from_dict(volume_identity_by_crn_model_json).__dict__
- volume_identity_by_crn_model2 = VolumeIdentityByCRN(**volume_identity_by_crn_model_dict)
+ virtual_network_interface_ip_prototype_model = {} # VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext
+ virtual_network_interface_ip_prototype_model['address'] = '10.0.0.5'
+ virtual_network_interface_ip_prototype_model['auto_delete'] = False
+ virtual_network_interface_ip_prototype_model['name'] = 'my-reserved-ip'
- # Verify the model instances are equivalent
- assert volume_identity_by_crn_model == volume_identity_by_crn_model2
+ virtual_network_interface_primary_ip_prototype_model = {} # VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext
+ virtual_network_interface_primary_ip_prototype_model['address'] = '10.0.0.5'
+ virtual_network_interface_primary_ip_prototype_model['auto_delete'] = False
+ virtual_network_interface_primary_ip_prototype_model['name'] = 'my-reserved-ip'
- # Convert model instance back to dict and verify no loss of data
- volume_identity_by_crn_model_json2 = volume_identity_by_crn_model.to_dict()
- assert volume_identity_by_crn_model_json2 == volume_identity_by_crn_model_json
+ 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'
-class TestModel_VolumeIdentityByHref:
- """
- Test Class for VolumeIdentityByHref
- """
+ instance_network_attachment_prototype_virtual_network_interface_model = {} # InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeInstanceNetworkAttachmentContext
+ instance_network_attachment_prototype_virtual_network_interface_model['allow_ip_spoofing'] = True
+ instance_network_attachment_prototype_virtual_network_interface_model['auto_delete'] = False
+ instance_network_attachment_prototype_virtual_network_interface_model['enable_infrastructure_nat'] = True
+ instance_network_attachment_prototype_virtual_network_interface_model['ips'] = [virtual_network_interface_ip_prototype_model]
+ instance_network_attachment_prototype_virtual_network_interface_model['name'] = 'my-virtual-network-interface'
+ instance_network_attachment_prototype_virtual_network_interface_model['primary_ip'] = virtual_network_interface_primary_ip_prototype_model
+ instance_network_attachment_prototype_virtual_network_interface_model['resource_group'] = resource_group_identity_model
+ instance_network_attachment_prototype_virtual_network_interface_model['security_groups'] = [security_group_identity_model]
+ instance_network_attachment_prototype_virtual_network_interface_model['subnet'] = subnet_identity_model
- def test_volume_identity_by_href_serialization(self):
- """
- Test serialization/deserialization for VolumeIdentityByHref
- """
+ instance_network_attachment_prototype_model = {} # InstanceNetworkAttachmentPrototype
+ instance_network_attachment_prototype_model['name'] = 'my-instance-network-attachment'
+ instance_network_attachment_prototype_model['virtual_network_interface'] = instance_network_attachment_prototype_virtual_network_interface_model
- # Construct a json representation of a VolumeIdentityByHref model
- volume_identity_by_href_model_json = {}
- volume_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
+ # Construct a json representation of a InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkAttachment model
+ instance_prototype_instance_by_volume_instance_by_volume_instance_by_network_attachment_model_json = {}
+ instance_prototype_instance_by_volume_instance_by_volume_instance_by_network_attachment_model_json['availability_policy'] = instance_availability_policy_prototype_model
+ instance_prototype_instance_by_volume_instance_by_volume_instance_by_network_attachment_model_json['default_trusted_profile'] = instance_default_trusted_profile_prototype_model
+ instance_prototype_instance_by_volume_instance_by_volume_instance_by_network_attachment_model_json['keys'] = [key_identity_model]
+ instance_prototype_instance_by_volume_instance_by_volume_instance_by_network_attachment_model_json['metadata_service'] = instance_metadata_service_prototype_model
+ instance_prototype_instance_by_volume_instance_by_volume_instance_by_network_attachment_model_json['name'] = 'my-instance'
+ instance_prototype_instance_by_volume_instance_by_volume_instance_by_network_attachment_model_json['placement_target'] = instance_placement_target_prototype_model
+ instance_prototype_instance_by_volume_instance_by_volume_instance_by_network_attachment_model_json['profile'] = instance_profile_identity_model
+ instance_prototype_instance_by_volume_instance_by_volume_instance_by_network_attachment_model_json['reservation_affinity'] = instance_reservation_affinity_prototype_model
+ instance_prototype_instance_by_volume_instance_by_volume_instance_by_network_attachment_model_json['resource_group'] = resource_group_identity_model
+ instance_prototype_instance_by_volume_instance_by_volume_instance_by_network_attachment_model_json['total_volume_bandwidth'] = 500
+ instance_prototype_instance_by_volume_instance_by_volume_instance_by_network_attachment_model_json['user_data'] = 'testString'
+ instance_prototype_instance_by_volume_instance_by_volume_instance_by_network_attachment_model_json['volume_attachments'] = [volume_attachment_prototype_model]
+ instance_prototype_instance_by_volume_instance_by_volume_instance_by_network_attachment_model_json['vpc'] = vpc_identity_model
+ instance_prototype_instance_by_volume_instance_by_volume_instance_by_network_attachment_model_json['boot_volume_attachment'] = volume_attachment_prototype_instance_by_volume_context_model
+ instance_prototype_instance_by_volume_instance_by_volume_instance_by_network_attachment_model_json['zone'] = zone_identity_model
+ instance_prototype_instance_by_volume_instance_by_volume_instance_by_network_attachment_model_json['network_attachments'] = [instance_network_attachment_prototype_model]
+ instance_prototype_instance_by_volume_instance_by_volume_instance_by_network_attachment_model_json['primary_network_attachment'] = instance_network_attachment_prototype_model
- # Construct a model instance of VolumeIdentityByHref by calling from_dict on the json representation
- volume_identity_by_href_model = VolumeIdentityByHref.from_dict(volume_identity_by_href_model_json)
- assert volume_identity_by_href_model != False
+ # Construct a model instance of InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkAttachment by calling from_dict on the json representation
+ instance_prototype_instance_by_volume_instance_by_volume_instance_by_network_attachment_model = InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkAttachment.from_dict(instance_prototype_instance_by_volume_instance_by_volume_instance_by_network_attachment_model_json)
+ assert instance_prototype_instance_by_volume_instance_by_volume_instance_by_network_attachment_model != False
- # Construct a model instance of VolumeIdentityByHref by calling from_dict on the json representation
- volume_identity_by_href_model_dict = VolumeIdentityByHref.from_dict(volume_identity_by_href_model_json).__dict__
- volume_identity_by_href_model2 = VolumeIdentityByHref(**volume_identity_by_href_model_dict)
+ # Construct a model instance of InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkAttachment by calling from_dict on the json representation
+ instance_prototype_instance_by_volume_instance_by_volume_instance_by_network_attachment_model_dict = InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkAttachment.from_dict(instance_prototype_instance_by_volume_instance_by_volume_instance_by_network_attachment_model_json).__dict__
+ instance_prototype_instance_by_volume_instance_by_volume_instance_by_network_attachment_model2 = InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkAttachment(**instance_prototype_instance_by_volume_instance_by_volume_instance_by_network_attachment_model_dict)
# Verify the model instances are equivalent
- assert volume_identity_by_href_model == volume_identity_by_href_model2
+ assert instance_prototype_instance_by_volume_instance_by_volume_instance_by_network_attachment_model == instance_prototype_instance_by_volume_instance_by_volume_instance_by_network_attachment_model2
# Convert model instance back to dict and verify no loss of data
- volume_identity_by_href_model_json2 = volume_identity_by_href_model.to_dict()
- assert volume_identity_by_href_model_json2 == volume_identity_by_href_model_json
+ instance_prototype_instance_by_volume_instance_by_volume_instance_by_network_attachment_model_json2 = instance_prototype_instance_by_volume_instance_by_volume_instance_by_network_attachment_model.to_dict()
+ assert instance_prototype_instance_by_volume_instance_by_volume_instance_by_network_attachment_model_json2 == instance_prototype_instance_by_volume_instance_by_volume_instance_by_network_attachment_model_json
-class TestModel_VolumeIdentityById:
+class TestModel_InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkInterface:
"""
- Test Class for VolumeIdentityById
+ Test Class for InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkInterface
"""
- def test_volume_identity_by_id_serialization(self):
+ def test_instance_prototype_instance_by_volume_instance_by_volume_instance_by_network_interface_serialization(self):
"""
- Test serialization/deserialization for VolumeIdentityById
+ Test serialization/deserialization for InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkInterface
"""
- # Construct a json representation of a VolumeIdentityById model
- volume_identity_by_id_model_json = {}
- volume_identity_by_id_model_json['id'] = '1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
+ # Construct dict forms of any model objects needed in order to build this model.
- # Construct a model instance of VolumeIdentityById by calling from_dict on the json representation
- volume_identity_by_id_model = VolumeIdentityById.from_dict(volume_identity_by_id_model_json)
- assert volume_identity_by_id_model != False
+ instance_availability_policy_prototype_model = {} # InstanceAvailabilityPolicyPrototype
+ instance_availability_policy_prototype_model['host_failure'] = 'restart'
- # Construct a model instance of VolumeIdentityById by calling from_dict on the json representation
- volume_identity_by_id_model_dict = VolumeIdentityById.from_dict(volume_identity_by_id_model_json).__dict__
- volume_identity_by_id_model2 = VolumeIdentityById(**volume_identity_by_id_model_dict)
+ trusted_profile_identity_model = {} # TrustedProfileIdentityTrustedProfileById
+ trusted_profile_identity_model['id'] = 'Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5'
- # Verify the model instances are equivalent
- assert volume_identity_by_id_model == volume_identity_by_id_model2
+ instance_default_trusted_profile_prototype_model = {} # InstanceDefaultTrustedProfilePrototype
+ instance_default_trusted_profile_prototype_model['auto_link'] = False
+ instance_default_trusted_profile_prototype_model['target'] = trusted_profile_identity_model
- # Convert model instance back to dict and verify no loss of data
- volume_identity_by_id_model_json2 = volume_identity_by_id_model.to_dict()
- assert volume_identity_by_id_model_json2 == volume_identity_by_id_model_json
+ key_identity_model = {} # KeyIdentityById
+ key_identity_model['id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803'
+ instance_metadata_service_prototype_model = {} # InstanceMetadataServicePrototype
+ instance_metadata_service_prototype_model['enabled'] = False
+ instance_metadata_service_prototype_model['protocol'] = 'https'
+ instance_metadata_service_prototype_model['response_hop_limit'] = 2
-class TestModel_VolumeProfileIdentityByHref:
- """
- Test Class for VolumeProfileIdentityByHref
- """
+ instance_placement_target_prototype_model = {} # InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById
+ instance_placement_target_prototype_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
- def test_volume_profile_identity_by_href_serialization(self):
- """
- Test serialization/deserialization for VolumeProfileIdentityByHref
- """
+ instance_profile_identity_model = {} # InstanceProfileIdentityByName
+ instance_profile_identity_model['name'] = 'cx2-16x32'
- # Construct a json representation of a VolumeProfileIdentityByHref model
- volume_profile_identity_by_href_model_json = {}
- volume_profile_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose'
+ reservation_identity_model = {} # ReservationIdentityById
+ reservation_identity_model['id'] = '7187-ba49df72-37b8-43ac-98da-f8e029de0e63'
- # Construct a model instance of VolumeProfileIdentityByHref by calling from_dict on the json representation
- volume_profile_identity_by_href_model = VolumeProfileIdentityByHref.from_dict(volume_profile_identity_by_href_model_json)
- assert volume_profile_identity_by_href_model != False
+ instance_reservation_affinity_prototype_model = {} # InstanceReservationAffinityPrototype
+ instance_reservation_affinity_prototype_model['policy'] = 'disabled'
+ instance_reservation_affinity_prototype_model['pool'] = [reservation_identity_model]
- # Construct a model instance of VolumeProfileIdentityByHref by calling from_dict on the json representation
- volume_profile_identity_by_href_model_dict = VolumeProfileIdentityByHref.from_dict(volume_profile_identity_by_href_model_json).__dict__
- volume_profile_identity_by_href_model2 = VolumeProfileIdentityByHref(**volume_profile_identity_by_href_model_dict)
+ resource_group_identity_model = {} # ResourceGroupIdentityById
+ resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
- # Verify the model instances are equivalent
- assert volume_profile_identity_by_href_model == volume_profile_identity_by_href_model2
+ volume_attachment_prototype_volume_model = {} # VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById
+ volume_attachment_prototype_volume_model['id'] = '1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
- # Convert model instance back to dict and verify no loss of data
- volume_profile_identity_by_href_model_json2 = volume_profile_identity_by_href_model.to_dict()
- assert volume_profile_identity_by_href_model_json2 == volume_profile_identity_by_href_model_json
+ volume_attachment_prototype_model = {} # VolumeAttachmentPrototype
+ volume_attachment_prototype_model['delete_volume_on_instance_delete'] = False
+ volume_attachment_prototype_model['name'] = 'my-volume-attachment'
+ volume_attachment_prototype_model['volume'] = volume_attachment_prototype_volume_model
+ vpc_identity_model = {} # VPCIdentityById
+ vpc_identity_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b'
-class TestModel_VolumeProfileIdentityByName:
- """
- Test Class for VolumeProfileIdentityByName
- """
+ volume_identity_model = {} # VolumeIdentityById
+ volume_identity_model['id'] = '1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
- def test_volume_profile_identity_by_name_serialization(self):
- """
- Test serialization/deserialization for VolumeProfileIdentityByName
- """
+ volume_attachment_prototype_instance_by_volume_context_model = {} # VolumeAttachmentPrototypeInstanceByVolumeContext
+ volume_attachment_prototype_instance_by_volume_context_model['delete_volume_on_instance_delete'] = False
+ volume_attachment_prototype_instance_by_volume_context_model['name'] = 'my-volume-attachment'
+ volume_attachment_prototype_instance_by_volume_context_model['volume'] = volume_identity_model
- # Construct a json representation of a VolumeProfileIdentityByName model
- volume_profile_identity_by_name_model_json = {}
- volume_profile_identity_by_name_model_json['name'] = 'general-purpose'
+ zone_identity_model = {} # ZoneIdentityByName
+ zone_identity_model['name'] = 'us-south-1'
- # Construct a model instance of VolumeProfileIdentityByName by calling from_dict on the json representation
- volume_profile_identity_by_name_model = VolumeProfileIdentityByName.from_dict(volume_profile_identity_by_name_model_json)
- assert volume_profile_identity_by_name_model != False
+ network_interface_ip_prototype_model = {} # NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext
+ network_interface_ip_prototype_model['address'] = '10.0.0.5'
+ network_interface_ip_prototype_model['auto_delete'] = False
+ network_interface_ip_prototype_model['name'] = 'my-reserved-ip'
- # Construct a model instance of VolumeProfileIdentityByName by calling from_dict on the json representation
- volume_profile_identity_by_name_model_dict = VolumeProfileIdentityByName.from_dict(volume_profile_identity_by_name_model_json).__dict__
- volume_profile_identity_by_name_model2 = VolumeProfileIdentityByName(**volume_profile_identity_by_name_model_dict)
+ 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-instance-network-interface'
+ network_interface_prototype_model['primary_ip'] = network_interface_ip_prototype_model
+ network_interface_prototype_model['security_groups'] = [security_group_identity_model]
+ network_interface_prototype_model['subnet'] = subnet_identity_model
+
+ # Construct a json representation of a InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkInterface model
+ instance_prototype_instance_by_volume_instance_by_volume_instance_by_network_interface_model_json = {}
+ instance_prototype_instance_by_volume_instance_by_volume_instance_by_network_interface_model_json['availability_policy'] = instance_availability_policy_prototype_model
+ instance_prototype_instance_by_volume_instance_by_volume_instance_by_network_interface_model_json['default_trusted_profile'] = instance_default_trusted_profile_prototype_model
+ instance_prototype_instance_by_volume_instance_by_volume_instance_by_network_interface_model_json['keys'] = [key_identity_model]
+ instance_prototype_instance_by_volume_instance_by_volume_instance_by_network_interface_model_json['metadata_service'] = instance_metadata_service_prototype_model
+ instance_prototype_instance_by_volume_instance_by_volume_instance_by_network_interface_model_json['name'] = 'my-instance'
+ instance_prototype_instance_by_volume_instance_by_volume_instance_by_network_interface_model_json['placement_target'] = instance_placement_target_prototype_model
+ instance_prototype_instance_by_volume_instance_by_volume_instance_by_network_interface_model_json['profile'] = instance_profile_identity_model
+ instance_prototype_instance_by_volume_instance_by_volume_instance_by_network_interface_model_json['reservation_affinity'] = instance_reservation_affinity_prototype_model
+ instance_prototype_instance_by_volume_instance_by_volume_instance_by_network_interface_model_json['resource_group'] = resource_group_identity_model
+ instance_prototype_instance_by_volume_instance_by_volume_instance_by_network_interface_model_json['total_volume_bandwidth'] = 500
+ instance_prototype_instance_by_volume_instance_by_volume_instance_by_network_interface_model_json['user_data'] = 'testString'
+ instance_prototype_instance_by_volume_instance_by_volume_instance_by_network_interface_model_json['volume_attachments'] = [volume_attachment_prototype_model]
+ instance_prototype_instance_by_volume_instance_by_volume_instance_by_network_interface_model_json['vpc'] = vpc_identity_model
+ instance_prototype_instance_by_volume_instance_by_volume_instance_by_network_interface_model_json['boot_volume_attachment'] = volume_attachment_prototype_instance_by_volume_context_model
+ instance_prototype_instance_by_volume_instance_by_volume_instance_by_network_interface_model_json['zone'] = zone_identity_model
+ instance_prototype_instance_by_volume_instance_by_volume_instance_by_network_interface_model_json['network_interfaces'] = [network_interface_prototype_model]
+ instance_prototype_instance_by_volume_instance_by_volume_instance_by_network_interface_model_json['primary_network_interface'] = network_interface_prototype_model
+
+ # Construct a model instance of InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkInterface by calling from_dict on the json representation
+ instance_prototype_instance_by_volume_instance_by_volume_instance_by_network_interface_model = InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkInterface.from_dict(instance_prototype_instance_by_volume_instance_by_volume_instance_by_network_interface_model_json)
+ assert instance_prototype_instance_by_volume_instance_by_volume_instance_by_network_interface_model != False
+
+ # Construct a model instance of InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkInterface by calling from_dict on the json representation
+ instance_prototype_instance_by_volume_instance_by_volume_instance_by_network_interface_model_dict = InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkInterface.from_dict(instance_prototype_instance_by_volume_instance_by_volume_instance_by_network_interface_model_json).__dict__
+ instance_prototype_instance_by_volume_instance_by_volume_instance_by_network_interface_model2 = InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkInterface(**instance_prototype_instance_by_volume_instance_by_volume_instance_by_network_interface_model_dict)
# Verify the model instances are equivalent
- assert volume_profile_identity_by_name_model == volume_profile_identity_by_name_model2
+ assert instance_prototype_instance_by_volume_instance_by_volume_instance_by_network_interface_model == instance_prototype_instance_by_volume_instance_by_volume_instance_by_network_interface_model2
# Convert model instance back to dict and verify no loss of data
- volume_profile_identity_by_name_model_json2 = volume_profile_identity_by_name_model.to_dict()
- assert volume_profile_identity_by_name_model_json2 == volume_profile_identity_by_name_model_json
+ instance_prototype_instance_by_volume_instance_by_volume_instance_by_network_interface_model_json2 = instance_prototype_instance_by_volume_instance_by_volume_instance_by_network_interface_model.to_dict()
+ assert instance_prototype_instance_by_volume_instance_by_volume_instance_by_network_interface_model_json2 == instance_prototype_instance_by_volume_instance_by_volume_instance_by_network_interface_model_json
-class TestModel_VolumePrototypeVolumeByCapacity:
+class TestModel_InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkAttachment:
"""
- Test Class for VolumePrototypeVolumeByCapacity
+ Test Class for InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkAttachment
"""
- def test_volume_prototype_volume_by_capacity_serialization(self):
+ def test_instance_template_prototype_instance_template_by_catalog_offering_instance_template_by_catalog_offering_instance_by_network_attachment_serialization(self):
"""
- Test serialization/deserialization for VolumePrototypeVolumeByCapacity
+ Test serialization/deserialization for InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkAttachment
"""
# 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'
+ instance_availability_policy_prototype_model = {} # InstanceAvailabilityPolicyPrototype
+ instance_availability_policy_prototype_model['host_failure'] = 'restart'
- resource_group_identity_model = {} # ResourceGroupIdentityById
- resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
+ trusted_profile_identity_model = {} # TrustedProfileIdentityTrustedProfileById
+ trusted_profile_identity_model['id'] = 'Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5'
- zone_identity_model = {} # ZoneIdentityByName
- zone_identity_model['name'] = 'us-south-1'
+ instance_default_trusted_profile_prototype_model = {} # InstanceDefaultTrustedProfilePrototype
+ instance_default_trusted_profile_prototype_model['auto_link'] = False
+ instance_default_trusted_profile_prototype_model['target'] = trusted_profile_identity_model
- encryption_key_identity_model = {} # EncryptionKeyIdentityByCRN
- encryption_key_identity_model['crn'] = 'crn:v1:bluemix:public:kms:us-south:a/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179'
+ key_identity_model = {} # KeyIdentityById
+ key_identity_model['id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803'
- # Construct a json representation of a VolumePrototypeVolumeByCapacity model
- volume_prototype_volume_by_capacity_model_json = {}
- volume_prototype_volume_by_capacity_model_json['iops'] = 10000
- volume_prototype_volume_by_capacity_model_json['name'] = 'my-volume'
- volume_prototype_volume_by_capacity_model_json['profile'] = volume_profile_identity_model
- volume_prototype_volume_by_capacity_model_json['resource_group'] = resource_group_identity_model
- volume_prototype_volume_by_capacity_model_json['user_tags'] = []
- volume_prototype_volume_by_capacity_model_json['zone'] = zone_identity_model
- volume_prototype_volume_by_capacity_model_json['capacity'] = 100
- volume_prototype_volume_by_capacity_model_json['encryption_key'] = encryption_key_identity_model
+ instance_metadata_service_prototype_model = {} # InstanceMetadataServicePrototype
+ instance_metadata_service_prototype_model['enabled'] = False
+ instance_metadata_service_prototype_model['protocol'] = 'https'
+ instance_metadata_service_prototype_model['response_hop_limit'] = 2
- # Construct a model instance of VolumePrototypeVolumeByCapacity by calling from_dict on the json representation
- volume_prototype_volume_by_capacity_model = VolumePrototypeVolumeByCapacity.from_dict(volume_prototype_volume_by_capacity_model_json)
- assert volume_prototype_volume_by_capacity_model != False
+ instance_placement_target_prototype_model = {} # InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById
+ instance_placement_target_prototype_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
- # Construct a model instance of VolumePrototypeVolumeByCapacity by calling from_dict on the json representation
- volume_prototype_volume_by_capacity_model_dict = VolumePrototypeVolumeByCapacity.from_dict(volume_prototype_volume_by_capacity_model_json).__dict__
- volume_prototype_volume_by_capacity_model2 = VolumePrototypeVolumeByCapacity(**volume_prototype_volume_by_capacity_model_dict)
+ instance_profile_identity_model = {} # InstanceProfileIdentityByName
+ instance_profile_identity_model['name'] = 'cx2-16x32'
- # Verify the model instances are equivalent
- assert volume_prototype_volume_by_capacity_model == volume_prototype_volume_by_capacity_model2
+ reservation_identity_model = {} # ReservationIdentityById
+ reservation_identity_model['id'] = '7187-ba49df72-37b8-43ac-98da-f8e029de0e63'
- # Convert model instance back to dict and verify no loss of data
- volume_prototype_volume_by_capacity_model_json2 = volume_prototype_volume_by_capacity_model.to_dict()
- assert volume_prototype_volume_by_capacity_model_json2 == volume_prototype_volume_by_capacity_model_json
+ instance_reservation_affinity_prototype_model = {} # InstanceReservationAffinityPrototype
+ instance_reservation_affinity_prototype_model['policy'] = 'disabled'
+ instance_reservation_affinity_prototype_model['pool'] = [reservation_identity_model]
+ resource_group_identity_model = {} # ResourceGroupIdentityById
+ resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
-class TestModel_VolumePrototypeVolumeBySourceSnapshot:
- """
- Test Class for VolumePrototypeVolumeBySourceSnapshot
- """
+ volume_attachment_prototype_volume_model = {} # VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById
+ volume_attachment_prototype_volume_model['id'] = '1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
- def test_volume_prototype_volume_by_source_snapshot_serialization(self):
- """
- Test serialization/deserialization for VolumePrototypeVolumeBySourceSnapshot
- """
+ volume_attachment_prototype_model = {} # VolumeAttachmentPrototype
+ volume_attachment_prototype_model['delete_volume_on_instance_delete'] = False
+ volume_attachment_prototype_model['name'] = 'my-volume-attachment'
+ volume_attachment_prototype_model['volume'] = volume_attachment_prototype_volume_model
- # Construct dict forms of any model objects needed in order to build this model.
+ vpc_identity_model = {} # VPCIdentityById
+ vpc_identity_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b'
+
+ encryption_key_identity_model = {} # EncryptionKeyIdentityByCRN
+ encryption_key_identity_model['crn'] = 'crn:v1:bluemix:public:kms:us-south:a/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179'
volume_profile_identity_model = {} # VolumeProfileIdentityByName
volume_profile_identity_model['name'] = 'general-purpose'
- resource_group_identity_model = {} # ResourceGroupIdentityById
- resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
+ volume_prototype_instance_by_image_context_model = {} # VolumePrototypeInstanceByImageContext
+ volume_prototype_instance_by_image_context_model['capacity'] = 100
+ volume_prototype_instance_by_image_context_model['encryption_key'] = encryption_key_identity_model
+ volume_prototype_instance_by_image_context_model['iops'] = 10000
+ volume_prototype_instance_by_image_context_model['name'] = 'my-volume'
+ volume_prototype_instance_by_image_context_model['profile'] = volume_profile_identity_model
+ volume_prototype_instance_by_image_context_model['resource_group'] = resource_group_identity_model
+ volume_prototype_instance_by_image_context_model['user_tags'] = []
+
+ volume_attachment_prototype_instance_by_image_context_model = {} # VolumeAttachmentPrototypeInstanceByImageContext
+ volume_attachment_prototype_instance_by_image_context_model['delete_volume_on_instance_delete'] = True
+ volume_attachment_prototype_instance_by_image_context_model['name'] = 'my-volume-attachment'
+ volume_attachment_prototype_instance_by_image_context_model['volume'] = volume_prototype_instance_by_image_context_model
+
+ catalog_offering_identity_model = {} # CatalogOfferingIdentityCatalogOfferingByCRN
+ catalog_offering_identity_model['crn'] = 'crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:offering:00111601-0ec5-41ac-b142-96d1e64e6442'
+
+ instance_catalog_offering_prototype_model = {} # InstanceCatalogOfferingPrototypeCatalogOfferingByOffering
+ instance_catalog_offering_prototype_model['offering'] = catalog_offering_identity_model
zone_identity_model = {} # ZoneIdentityByName
zone_identity_model['name'] = 'us-south-1'
- encryption_key_identity_model = {} # EncryptionKeyIdentityByCRN
- encryption_key_identity_model['crn'] = 'crn:v1:bluemix:public:kms:us-south:a/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179'
+ virtual_network_interface_ip_prototype_model = {} # VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext
+ virtual_network_interface_ip_prototype_model['address'] = '10.0.0.5'
+ virtual_network_interface_ip_prototype_model['auto_delete'] = False
+ virtual_network_interface_ip_prototype_model['name'] = 'my-reserved-ip'
- snapshot_identity_model = {} # SnapshotIdentityById
- snapshot_identity_model['id'] = '349a61d8-7ab1-420f-a690-5fed76ef9d4f'
+ virtual_network_interface_primary_ip_prototype_model = {} # VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext
+ virtual_network_interface_primary_ip_prototype_model['address'] = '10.0.0.5'
+ virtual_network_interface_primary_ip_prototype_model['auto_delete'] = False
+ virtual_network_interface_primary_ip_prototype_model['name'] = 'my-reserved-ip'
- # Construct a json representation of a VolumePrototypeVolumeBySourceSnapshot model
- volume_prototype_volume_by_source_snapshot_model_json = {}
- volume_prototype_volume_by_source_snapshot_model_json['iops'] = 10000
- volume_prototype_volume_by_source_snapshot_model_json['name'] = 'my-volume'
- volume_prototype_volume_by_source_snapshot_model_json['profile'] = volume_profile_identity_model
- volume_prototype_volume_by_source_snapshot_model_json['resource_group'] = resource_group_identity_model
- volume_prototype_volume_by_source_snapshot_model_json['user_tags'] = []
- volume_prototype_volume_by_source_snapshot_model_json['zone'] = zone_identity_model
- volume_prototype_volume_by_source_snapshot_model_json['capacity'] = 100
- volume_prototype_volume_by_source_snapshot_model_json['encryption_key'] = encryption_key_identity_model
- volume_prototype_volume_by_source_snapshot_model_json['source_snapshot'] = snapshot_identity_model
+ security_group_identity_model = {} # SecurityGroupIdentityById
+ security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271'
- # Construct a model instance of VolumePrototypeVolumeBySourceSnapshot by calling from_dict on the json representation
- volume_prototype_volume_by_source_snapshot_model = VolumePrototypeVolumeBySourceSnapshot.from_dict(volume_prototype_volume_by_source_snapshot_model_json)
- assert volume_prototype_volume_by_source_snapshot_model != False
+ subnet_identity_model = {} # SubnetIdentityById
+ subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
- # Construct a model instance of VolumePrototypeVolumeBySourceSnapshot by calling from_dict on the json representation
- volume_prototype_volume_by_source_snapshot_model_dict = VolumePrototypeVolumeBySourceSnapshot.from_dict(volume_prototype_volume_by_source_snapshot_model_json).__dict__
- volume_prototype_volume_by_source_snapshot_model2 = VolumePrototypeVolumeBySourceSnapshot(**volume_prototype_volume_by_source_snapshot_model_dict)
+ instance_network_attachment_prototype_virtual_network_interface_model = {} # InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeInstanceNetworkAttachmentContext
+ instance_network_attachment_prototype_virtual_network_interface_model['allow_ip_spoofing'] = True
+ instance_network_attachment_prototype_virtual_network_interface_model['auto_delete'] = False
+ instance_network_attachment_prototype_virtual_network_interface_model['enable_infrastructure_nat'] = True
+ instance_network_attachment_prototype_virtual_network_interface_model['ips'] = [virtual_network_interface_ip_prototype_model]
+ instance_network_attachment_prototype_virtual_network_interface_model['name'] = 'my-virtual-network-interface'
+ instance_network_attachment_prototype_virtual_network_interface_model['primary_ip'] = virtual_network_interface_primary_ip_prototype_model
+ instance_network_attachment_prototype_virtual_network_interface_model['resource_group'] = resource_group_identity_model
+ instance_network_attachment_prototype_virtual_network_interface_model['security_groups'] = [security_group_identity_model]
+ instance_network_attachment_prototype_virtual_network_interface_model['subnet'] = subnet_identity_model
+
+ instance_network_attachment_prototype_model = {} # InstanceNetworkAttachmentPrototype
+ instance_network_attachment_prototype_model['name'] = 'my-instance-network-attachment'
+ instance_network_attachment_prototype_model['virtual_network_interface'] = instance_network_attachment_prototype_virtual_network_interface_model
+
+ # Construct a json representation of a InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkAttachment model
+ instance_template_prototype_instance_template_by_catalog_offering_instance_template_by_catalog_offering_instance_by_network_attachment_model_json = {}
+ instance_template_prototype_instance_template_by_catalog_offering_instance_template_by_catalog_offering_instance_by_network_attachment_model_json['availability_policy'] = instance_availability_policy_prototype_model
+ instance_template_prototype_instance_template_by_catalog_offering_instance_template_by_catalog_offering_instance_by_network_attachment_model_json['default_trusted_profile'] = instance_default_trusted_profile_prototype_model
+ instance_template_prototype_instance_template_by_catalog_offering_instance_template_by_catalog_offering_instance_by_network_attachment_model_json['keys'] = [key_identity_model]
+ instance_template_prototype_instance_template_by_catalog_offering_instance_template_by_catalog_offering_instance_by_network_attachment_model_json['metadata_service'] = instance_metadata_service_prototype_model
+ instance_template_prototype_instance_template_by_catalog_offering_instance_template_by_catalog_offering_instance_by_network_attachment_model_json['name'] = 'my-instance'
+ instance_template_prototype_instance_template_by_catalog_offering_instance_template_by_catalog_offering_instance_by_network_attachment_model_json['placement_target'] = instance_placement_target_prototype_model
+ instance_template_prototype_instance_template_by_catalog_offering_instance_template_by_catalog_offering_instance_by_network_attachment_model_json['profile'] = instance_profile_identity_model
+ instance_template_prototype_instance_template_by_catalog_offering_instance_template_by_catalog_offering_instance_by_network_attachment_model_json['reservation_affinity'] = instance_reservation_affinity_prototype_model
+ instance_template_prototype_instance_template_by_catalog_offering_instance_template_by_catalog_offering_instance_by_network_attachment_model_json['resource_group'] = resource_group_identity_model
+ instance_template_prototype_instance_template_by_catalog_offering_instance_template_by_catalog_offering_instance_by_network_attachment_model_json['total_volume_bandwidth'] = 500
+ instance_template_prototype_instance_template_by_catalog_offering_instance_template_by_catalog_offering_instance_by_network_attachment_model_json['user_data'] = 'testString'
+ instance_template_prototype_instance_template_by_catalog_offering_instance_template_by_catalog_offering_instance_by_network_attachment_model_json['volume_attachments'] = [volume_attachment_prototype_model]
+ instance_template_prototype_instance_template_by_catalog_offering_instance_template_by_catalog_offering_instance_by_network_attachment_model_json['vpc'] = vpc_identity_model
+ instance_template_prototype_instance_template_by_catalog_offering_instance_template_by_catalog_offering_instance_by_network_attachment_model_json['boot_volume_attachment'] = volume_attachment_prototype_instance_by_image_context_model
+ instance_template_prototype_instance_template_by_catalog_offering_instance_template_by_catalog_offering_instance_by_network_attachment_model_json['catalog_offering'] = instance_catalog_offering_prototype_model
+ instance_template_prototype_instance_template_by_catalog_offering_instance_template_by_catalog_offering_instance_by_network_attachment_model_json['zone'] = zone_identity_model
+ instance_template_prototype_instance_template_by_catalog_offering_instance_template_by_catalog_offering_instance_by_network_attachment_model_json['network_attachments'] = [instance_network_attachment_prototype_model]
+ instance_template_prototype_instance_template_by_catalog_offering_instance_template_by_catalog_offering_instance_by_network_attachment_model_json['primary_network_attachment'] = instance_network_attachment_prototype_model
+
+ # Construct a model instance of InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkAttachment by calling from_dict on the json representation
+ instance_template_prototype_instance_template_by_catalog_offering_instance_template_by_catalog_offering_instance_by_network_attachment_model = InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkAttachment.from_dict(instance_template_prototype_instance_template_by_catalog_offering_instance_template_by_catalog_offering_instance_by_network_attachment_model_json)
+ assert instance_template_prototype_instance_template_by_catalog_offering_instance_template_by_catalog_offering_instance_by_network_attachment_model != False
+
+ # Construct a model instance of InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkAttachment by calling from_dict on the json representation
+ instance_template_prototype_instance_template_by_catalog_offering_instance_template_by_catalog_offering_instance_by_network_attachment_model_dict = InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkAttachment.from_dict(instance_template_prototype_instance_template_by_catalog_offering_instance_template_by_catalog_offering_instance_by_network_attachment_model_json).__dict__
+ instance_template_prototype_instance_template_by_catalog_offering_instance_template_by_catalog_offering_instance_by_network_attachment_model2 = InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkAttachment(**instance_template_prototype_instance_template_by_catalog_offering_instance_template_by_catalog_offering_instance_by_network_attachment_model_dict)
# Verify the model instances are equivalent
- assert volume_prototype_volume_by_source_snapshot_model == volume_prototype_volume_by_source_snapshot_model2
+ assert instance_template_prototype_instance_template_by_catalog_offering_instance_template_by_catalog_offering_instance_by_network_attachment_model == instance_template_prototype_instance_template_by_catalog_offering_instance_template_by_catalog_offering_instance_by_network_attachment_model2
# Convert model instance back to dict and verify no loss of data
- volume_prototype_volume_by_source_snapshot_model_json2 = volume_prototype_volume_by_source_snapshot_model.to_dict()
- assert volume_prototype_volume_by_source_snapshot_model_json2 == volume_prototype_volume_by_source_snapshot_model_json
+ instance_template_prototype_instance_template_by_catalog_offering_instance_template_by_catalog_offering_instance_by_network_attachment_model_json2 = instance_template_prototype_instance_template_by_catalog_offering_instance_template_by_catalog_offering_instance_by_network_attachment_model.to_dict()
+ assert instance_template_prototype_instance_template_by_catalog_offering_instance_template_by_catalog_offering_instance_by_network_attachment_model_json2 == instance_template_prototype_instance_template_by_catalog_offering_instance_template_by_catalog_offering_instance_by_network_attachment_model_json
-class TestModel_ZoneIdentityByHref:
+class TestModel_InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkInterface:
"""
- Test Class for ZoneIdentityByHref
+ Test Class for InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkInterface
"""
- def test_zone_identity_by_href_serialization(self):
+ def test_instance_template_prototype_instance_template_by_catalog_offering_instance_template_by_catalog_offering_instance_by_network_interface_serialization(self):
"""
- Test serialization/deserialization for ZoneIdentityByHref
+ Test serialization/deserialization for InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkInterface
"""
- # Construct a json representation of a ZoneIdentityByHref model
- zone_identity_by_href_model_json = {}
- zone_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1'
+ # Construct dict forms of any model objects needed in order to build this model.
- # Construct a model instance of ZoneIdentityByHref by calling from_dict on the json representation
- zone_identity_by_href_model = ZoneIdentityByHref.from_dict(zone_identity_by_href_model_json)
- assert zone_identity_by_href_model != False
+ instance_availability_policy_prototype_model = {} # InstanceAvailabilityPolicyPrototype
+ instance_availability_policy_prototype_model['host_failure'] = 'restart'
- # Construct a model instance of ZoneIdentityByHref by calling from_dict on the json representation
- zone_identity_by_href_model_dict = ZoneIdentityByHref.from_dict(zone_identity_by_href_model_json).__dict__
- zone_identity_by_href_model2 = ZoneIdentityByHref(**zone_identity_by_href_model_dict)
+ trusted_profile_identity_model = {} # TrustedProfileIdentityTrustedProfileById
+ trusted_profile_identity_model['id'] = 'Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5'
- # Verify the model instances are equivalent
- assert zone_identity_by_href_model == zone_identity_by_href_model2
+ instance_default_trusted_profile_prototype_model = {} # InstanceDefaultTrustedProfilePrototype
+ instance_default_trusted_profile_prototype_model['auto_link'] = False
+ instance_default_trusted_profile_prototype_model['target'] = trusted_profile_identity_model
- # Convert model instance back to dict and verify no loss of data
- zone_identity_by_href_model_json2 = zone_identity_by_href_model.to_dict()
- assert zone_identity_by_href_model_json2 == zone_identity_by_href_model_json
+ key_identity_model = {} # KeyIdentityById
+ key_identity_model['id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803'
+ instance_metadata_service_prototype_model = {} # InstanceMetadataServicePrototype
+ instance_metadata_service_prototype_model['enabled'] = False
+ instance_metadata_service_prototype_model['protocol'] = 'https'
+ instance_metadata_service_prototype_model['response_hop_limit'] = 2
-class TestModel_ZoneIdentityByName:
- """
- Test Class for ZoneIdentityByName
- """
+ instance_placement_target_prototype_model = {} # InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById
+ instance_placement_target_prototype_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
- def test_zone_identity_by_name_serialization(self):
- """
- Test serialization/deserialization for ZoneIdentityByName
- """
+ instance_profile_identity_model = {} # InstanceProfileIdentityByName
+ instance_profile_identity_model['name'] = 'cx2-16x32'
- # Construct a json representation of a ZoneIdentityByName model
- zone_identity_by_name_model_json = {}
- zone_identity_by_name_model_json['name'] = 'us-south-1'
+ reservation_identity_model = {} # ReservationIdentityById
+ reservation_identity_model['id'] = '7187-ba49df72-37b8-43ac-98da-f8e029de0e63'
- # Construct a model instance of ZoneIdentityByName by calling from_dict on the json representation
- zone_identity_by_name_model = ZoneIdentityByName.from_dict(zone_identity_by_name_model_json)
- assert zone_identity_by_name_model != False
+ instance_reservation_affinity_prototype_model = {} # InstanceReservationAffinityPrototype
+ instance_reservation_affinity_prototype_model['policy'] = 'disabled'
+ instance_reservation_affinity_prototype_model['pool'] = [reservation_identity_model]
- # Construct a model instance of ZoneIdentityByName by calling from_dict on the json representation
- zone_identity_by_name_model_dict = ZoneIdentityByName.from_dict(zone_identity_by_name_model_json).__dict__
- zone_identity_by_name_model2 = ZoneIdentityByName(**zone_identity_by_name_model_dict)
+ resource_group_identity_model = {} # ResourceGroupIdentityById
+ resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
- # Verify the model instances are equivalent
- assert zone_identity_by_name_model == zone_identity_by_name_model2
+ volume_attachment_prototype_volume_model = {} # VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById
+ volume_attachment_prototype_volume_model['id'] = '1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
- # Convert model instance back to dict and verify no loss of data
- zone_identity_by_name_model_json2 = zone_identity_by_name_model.to_dict()
- assert zone_identity_by_name_model_json2 == zone_identity_by_name_model_json
+ volume_attachment_prototype_model = {} # VolumeAttachmentPrototype
+ volume_attachment_prototype_model['delete_volume_on_instance_delete'] = False
+ volume_attachment_prototype_model['name'] = 'my-volume-attachment'
+ volume_attachment_prototype_model['volume'] = volume_attachment_prototype_volume_model
+ vpc_identity_model = {} # VPCIdentityById
+ vpc_identity_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b'
-class TestModel_BackupPolicyScopePrototypeEnterpriseIdentityEnterpriseIdentityByCRN:
- """
- Test Class for BackupPolicyScopePrototypeEnterpriseIdentityEnterpriseIdentityByCRN
- """
+ encryption_key_identity_model = {} # EncryptionKeyIdentityByCRN
+ encryption_key_identity_model['crn'] = 'crn:v1:bluemix:public:kms:us-south:a/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179'
- def test_backup_policy_scope_prototype_enterprise_identity_enterprise_identity_by_crn_serialization(self):
- """
- Test serialization/deserialization for BackupPolicyScopePrototypeEnterpriseIdentityEnterpriseIdentityByCRN
- """
+ volume_profile_identity_model = {} # VolumeProfileIdentityByName
+ volume_profile_identity_model['name'] = 'general-purpose'
- # Construct a json representation of a BackupPolicyScopePrototypeEnterpriseIdentityEnterpriseIdentityByCRN model
- backup_policy_scope_prototype_enterprise_identity_enterprise_identity_by_crn_model_json = {}
- backup_policy_scope_prototype_enterprise_identity_enterprise_identity_by_crn_model_json['crn'] = 'crn:v1:bluemix:public:enterprise::a/123456::enterprise:ebc2b430240943458b9e91e1432cfcce'
+ volume_prototype_instance_by_image_context_model = {} # VolumePrototypeInstanceByImageContext
+ volume_prototype_instance_by_image_context_model['capacity'] = 100
+ volume_prototype_instance_by_image_context_model['encryption_key'] = encryption_key_identity_model
+ volume_prototype_instance_by_image_context_model['iops'] = 10000
+ volume_prototype_instance_by_image_context_model['name'] = 'my-volume'
+ volume_prototype_instance_by_image_context_model['profile'] = volume_profile_identity_model
+ volume_prototype_instance_by_image_context_model['resource_group'] = resource_group_identity_model
+ volume_prototype_instance_by_image_context_model['user_tags'] = []
- # Construct a model instance of BackupPolicyScopePrototypeEnterpriseIdentityEnterpriseIdentityByCRN by calling from_dict on the json representation
- backup_policy_scope_prototype_enterprise_identity_enterprise_identity_by_crn_model = BackupPolicyScopePrototypeEnterpriseIdentityEnterpriseIdentityByCRN.from_dict(backup_policy_scope_prototype_enterprise_identity_enterprise_identity_by_crn_model_json)
- assert backup_policy_scope_prototype_enterprise_identity_enterprise_identity_by_crn_model != False
+ 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
- # Construct a model instance of BackupPolicyScopePrototypeEnterpriseIdentityEnterpriseIdentityByCRN by calling from_dict on the json representation
- backup_policy_scope_prototype_enterprise_identity_enterprise_identity_by_crn_model_dict = BackupPolicyScopePrototypeEnterpriseIdentityEnterpriseIdentityByCRN.from_dict(backup_policy_scope_prototype_enterprise_identity_enterprise_identity_by_crn_model_json).__dict__
- backup_policy_scope_prototype_enterprise_identity_enterprise_identity_by_crn_model2 = BackupPolicyScopePrototypeEnterpriseIdentityEnterpriseIdentityByCRN(**backup_policy_scope_prototype_enterprise_identity_enterprise_identity_by_crn_model_dict)
+ catalog_offering_identity_model = {} # CatalogOfferingIdentityCatalogOfferingByCRN
+ catalog_offering_identity_model['crn'] = 'crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:offering:00111601-0ec5-41ac-b142-96d1e64e6442'
- # Verify the model instances are equivalent
- assert backup_policy_scope_prototype_enterprise_identity_enterprise_identity_by_crn_model == backup_policy_scope_prototype_enterprise_identity_enterprise_identity_by_crn_model2
+ instance_catalog_offering_prototype_model = {} # InstanceCatalogOfferingPrototypeCatalogOfferingByOffering
+ instance_catalog_offering_prototype_model['offering'] = catalog_offering_identity_model
- # Convert model instance back to dict and verify no loss of data
- backup_policy_scope_prototype_enterprise_identity_enterprise_identity_by_crn_model_json2 = backup_policy_scope_prototype_enterprise_identity_enterprise_identity_by_crn_model.to_dict()
- assert backup_policy_scope_prototype_enterprise_identity_enterprise_identity_by_crn_model_json2 == backup_policy_scope_prototype_enterprise_identity_enterprise_identity_by_crn_model_json
+ zone_identity_model = {} # ZoneIdentityByName
+ zone_identity_model['name'] = 'us-south-1'
+ network_interface_ip_prototype_model = {} # NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext
+ network_interface_ip_prototype_model['address'] = '10.0.0.5'
+ network_interface_ip_prototype_model['auto_delete'] = False
+ network_interface_ip_prototype_model['name'] = 'my-reserved-ip'
-class TestModel_EndpointGatewayReservedIPReservedIPIdentityByHref:
- """
- Test Class for EndpointGatewayReservedIPReservedIPIdentityByHref
- """
+ security_group_identity_model = {} # SecurityGroupIdentityById
+ security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271'
- def test_endpoint_gateway_reserved_ip_reserved_ip_identity_by_href_serialization(self):
- """
- Test serialization/deserialization for EndpointGatewayReservedIPReservedIPIdentityByHref
- """
+ subnet_identity_model = {} # SubnetIdentityById
+ subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
- # Construct a json representation of a EndpointGatewayReservedIPReservedIPIdentityByHref model
- endpoint_gateway_reserved_ip_reserved_ip_identity_by_href_model_json = {}
- endpoint_gateway_reserved_ip_reserved_ip_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb'
+ network_interface_prototype_model = {} # NetworkInterfacePrototype
+ network_interface_prototype_model['allow_ip_spoofing'] = True
+ network_interface_prototype_model['name'] = 'my-instance-network-interface'
+ network_interface_prototype_model['primary_ip'] = network_interface_ip_prototype_model
+ network_interface_prototype_model['security_groups'] = [security_group_identity_model]
+ network_interface_prototype_model['subnet'] = subnet_identity_model
- # Construct a model instance of EndpointGatewayReservedIPReservedIPIdentityByHref by calling from_dict on the json representation
- endpoint_gateway_reserved_ip_reserved_ip_identity_by_href_model = EndpointGatewayReservedIPReservedIPIdentityByHref.from_dict(endpoint_gateway_reserved_ip_reserved_ip_identity_by_href_model_json)
- assert endpoint_gateway_reserved_ip_reserved_ip_identity_by_href_model != False
+ # Construct a json representation of a InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkInterface model
+ instance_template_prototype_instance_template_by_catalog_offering_instance_template_by_catalog_offering_instance_by_network_interface_model_json = {}
+ instance_template_prototype_instance_template_by_catalog_offering_instance_template_by_catalog_offering_instance_by_network_interface_model_json['availability_policy'] = instance_availability_policy_prototype_model
+ instance_template_prototype_instance_template_by_catalog_offering_instance_template_by_catalog_offering_instance_by_network_interface_model_json['default_trusted_profile'] = instance_default_trusted_profile_prototype_model
+ instance_template_prototype_instance_template_by_catalog_offering_instance_template_by_catalog_offering_instance_by_network_interface_model_json['keys'] = [key_identity_model]
+ instance_template_prototype_instance_template_by_catalog_offering_instance_template_by_catalog_offering_instance_by_network_interface_model_json['metadata_service'] = instance_metadata_service_prototype_model
+ instance_template_prototype_instance_template_by_catalog_offering_instance_template_by_catalog_offering_instance_by_network_interface_model_json['name'] = 'my-instance'
+ instance_template_prototype_instance_template_by_catalog_offering_instance_template_by_catalog_offering_instance_by_network_interface_model_json['placement_target'] = instance_placement_target_prototype_model
+ instance_template_prototype_instance_template_by_catalog_offering_instance_template_by_catalog_offering_instance_by_network_interface_model_json['profile'] = instance_profile_identity_model
+ instance_template_prototype_instance_template_by_catalog_offering_instance_template_by_catalog_offering_instance_by_network_interface_model_json['reservation_affinity'] = instance_reservation_affinity_prototype_model
+ instance_template_prototype_instance_template_by_catalog_offering_instance_template_by_catalog_offering_instance_by_network_interface_model_json['resource_group'] = resource_group_identity_model
+ instance_template_prototype_instance_template_by_catalog_offering_instance_template_by_catalog_offering_instance_by_network_interface_model_json['total_volume_bandwidth'] = 500
+ instance_template_prototype_instance_template_by_catalog_offering_instance_template_by_catalog_offering_instance_by_network_interface_model_json['user_data'] = 'testString'
+ instance_template_prototype_instance_template_by_catalog_offering_instance_template_by_catalog_offering_instance_by_network_interface_model_json['volume_attachments'] = [volume_attachment_prototype_model]
+ instance_template_prototype_instance_template_by_catalog_offering_instance_template_by_catalog_offering_instance_by_network_interface_model_json['vpc'] = vpc_identity_model
+ instance_template_prototype_instance_template_by_catalog_offering_instance_template_by_catalog_offering_instance_by_network_interface_model_json['boot_volume_attachment'] = volume_attachment_prototype_instance_by_image_context_model
+ instance_template_prototype_instance_template_by_catalog_offering_instance_template_by_catalog_offering_instance_by_network_interface_model_json['catalog_offering'] = instance_catalog_offering_prototype_model
+ instance_template_prototype_instance_template_by_catalog_offering_instance_template_by_catalog_offering_instance_by_network_interface_model_json['zone'] = zone_identity_model
+ instance_template_prototype_instance_template_by_catalog_offering_instance_template_by_catalog_offering_instance_by_network_interface_model_json['network_interfaces'] = [network_interface_prototype_model]
+ instance_template_prototype_instance_template_by_catalog_offering_instance_template_by_catalog_offering_instance_by_network_interface_model_json['primary_network_interface'] = network_interface_prototype_model
- # Construct a model instance of EndpointGatewayReservedIPReservedIPIdentityByHref by calling from_dict on the json representation
- endpoint_gateway_reserved_ip_reserved_ip_identity_by_href_model_dict = EndpointGatewayReservedIPReservedIPIdentityByHref.from_dict(endpoint_gateway_reserved_ip_reserved_ip_identity_by_href_model_json).__dict__
- endpoint_gateway_reserved_ip_reserved_ip_identity_by_href_model2 = EndpointGatewayReservedIPReservedIPIdentityByHref(**endpoint_gateway_reserved_ip_reserved_ip_identity_by_href_model_dict)
+ # Construct a model instance of InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkInterface by calling from_dict on the json representation
+ instance_template_prototype_instance_template_by_catalog_offering_instance_template_by_catalog_offering_instance_by_network_interface_model = InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkInterface.from_dict(instance_template_prototype_instance_template_by_catalog_offering_instance_template_by_catalog_offering_instance_by_network_interface_model_json)
+ assert instance_template_prototype_instance_template_by_catalog_offering_instance_template_by_catalog_offering_instance_by_network_interface_model != False
+
+ # Construct a model instance of InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkInterface by calling from_dict on the json representation
+ instance_template_prototype_instance_template_by_catalog_offering_instance_template_by_catalog_offering_instance_by_network_interface_model_dict = InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkInterface.from_dict(instance_template_prototype_instance_template_by_catalog_offering_instance_template_by_catalog_offering_instance_by_network_interface_model_json).__dict__
+ instance_template_prototype_instance_template_by_catalog_offering_instance_template_by_catalog_offering_instance_by_network_interface_model2 = InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkInterface(**instance_template_prototype_instance_template_by_catalog_offering_instance_template_by_catalog_offering_instance_by_network_interface_model_dict)
# Verify the model instances are equivalent
- assert endpoint_gateway_reserved_ip_reserved_ip_identity_by_href_model == endpoint_gateway_reserved_ip_reserved_ip_identity_by_href_model2
+ assert instance_template_prototype_instance_template_by_catalog_offering_instance_template_by_catalog_offering_instance_by_network_interface_model == instance_template_prototype_instance_template_by_catalog_offering_instance_template_by_catalog_offering_instance_by_network_interface_model2
# Convert model instance back to dict and verify no loss of data
- endpoint_gateway_reserved_ip_reserved_ip_identity_by_href_model_json2 = endpoint_gateway_reserved_ip_reserved_ip_identity_by_href_model.to_dict()
- assert endpoint_gateway_reserved_ip_reserved_ip_identity_by_href_model_json2 == endpoint_gateway_reserved_ip_reserved_ip_identity_by_href_model_json
+ instance_template_prototype_instance_template_by_catalog_offering_instance_template_by_catalog_offering_instance_by_network_interface_model_json2 = instance_template_prototype_instance_template_by_catalog_offering_instance_template_by_catalog_offering_instance_by_network_interface_model.to_dict()
+ assert instance_template_prototype_instance_template_by_catalog_offering_instance_template_by_catalog_offering_instance_by_network_interface_model_json2 == instance_template_prototype_instance_template_by_catalog_offering_instance_template_by_catalog_offering_instance_by_network_interface_model_json
-class TestModel_EndpointGatewayReservedIPReservedIPIdentityById:
+class TestModel_InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachment:
"""
- Test Class for EndpointGatewayReservedIPReservedIPIdentityById
+ Test Class for InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachment
"""
- def test_endpoint_gateway_reserved_ip_reserved_ip_identity_by_id_serialization(self):
+ def test_instance_template_prototype_instance_template_by_image_instance_template_by_image_instance_by_network_attachment_serialization(self):
"""
- Test serialization/deserialization for EndpointGatewayReservedIPReservedIPIdentityById
+ Test serialization/deserialization for InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachment
"""
- # Construct a json representation of a EndpointGatewayReservedIPReservedIPIdentityById model
- endpoint_gateway_reserved_ip_reserved_ip_identity_by_id_model_json = {}
- endpoint_gateway_reserved_ip_reserved_ip_identity_by_id_model_json['id'] = '6d353a0f-aeb1-4ae1-832e-1110d10981bb'
+ # Construct dict forms of any model objects needed in order to build this model.
- # Construct a model instance of EndpointGatewayReservedIPReservedIPIdentityById by calling from_dict on the json representation
- endpoint_gateway_reserved_ip_reserved_ip_identity_by_id_model = EndpointGatewayReservedIPReservedIPIdentityById.from_dict(endpoint_gateway_reserved_ip_reserved_ip_identity_by_id_model_json)
- assert endpoint_gateway_reserved_ip_reserved_ip_identity_by_id_model != False
+ instance_availability_policy_prototype_model = {} # InstanceAvailabilityPolicyPrototype
+ instance_availability_policy_prototype_model['host_failure'] = 'restart'
- # Construct a model instance of EndpointGatewayReservedIPReservedIPIdentityById by calling from_dict on the json representation
- endpoint_gateway_reserved_ip_reserved_ip_identity_by_id_model_dict = EndpointGatewayReservedIPReservedIPIdentityById.from_dict(endpoint_gateway_reserved_ip_reserved_ip_identity_by_id_model_json).__dict__
- endpoint_gateway_reserved_ip_reserved_ip_identity_by_id_model2 = EndpointGatewayReservedIPReservedIPIdentityById(**endpoint_gateway_reserved_ip_reserved_ip_identity_by_id_model_dict)
+ trusted_profile_identity_model = {} # TrustedProfileIdentityTrustedProfileById
+ trusted_profile_identity_model['id'] = 'Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5'
- # Verify the model instances are equivalent
- assert endpoint_gateway_reserved_ip_reserved_ip_identity_by_id_model == endpoint_gateway_reserved_ip_reserved_ip_identity_by_id_model2
+ instance_default_trusted_profile_prototype_model = {} # InstanceDefaultTrustedProfilePrototype
+ instance_default_trusted_profile_prototype_model['auto_link'] = False
+ instance_default_trusted_profile_prototype_model['target'] = trusted_profile_identity_model
- # Convert model instance back to dict and verify no loss of data
- endpoint_gateway_reserved_ip_reserved_ip_identity_by_id_model_json2 = endpoint_gateway_reserved_ip_reserved_ip_identity_by_id_model.to_dict()
- assert endpoint_gateway_reserved_ip_reserved_ip_identity_by_id_model_json2 == endpoint_gateway_reserved_ip_reserved_ip_identity_by_id_model_json
+ key_identity_model = {} # KeyIdentityById
+ key_identity_model['id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803'
+ instance_metadata_service_prototype_model = {} # InstanceMetadataServicePrototype
+ instance_metadata_service_prototype_model['enabled'] = False
+ instance_metadata_service_prototype_model['protocol'] = 'https'
+ instance_metadata_service_prototype_model['response_hop_limit'] = 2
-class TestModel_EndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRN:
- """
- Test Class for EndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRN
- """
+ instance_placement_target_prototype_model = {} # InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById
+ instance_placement_target_prototype_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
- def test_endpoint_gateway_target_prototype_provider_cloud_service_identity_provider_cloud_service_identity_by_crn_serialization(self):
- """
- Test serialization/deserialization for EndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRN
- """
+ instance_profile_identity_model = {} # InstanceProfileIdentityByName
+ instance_profile_identity_model['name'] = 'cx2-16x32'
- # Construct a json representation of a EndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRN model
- endpoint_gateway_target_prototype_provider_cloud_service_identity_provider_cloud_service_identity_by_crn_model_json = {}
- endpoint_gateway_target_prototype_provider_cloud_service_identity_provider_cloud_service_identity_by_crn_model_json['resource_type'] = 'provider_cloud_service'
- endpoint_gateway_target_prototype_provider_cloud_service_identity_provider_cloud_service_identity_by_crn_model_json['crn'] = 'crn:v1:bluemix:public:cloudant:us-south:a/123456:3527280b-9327-4411-8020-591092e60353::'
+ reservation_identity_model = {} # ReservationIdentityById
+ reservation_identity_model['id'] = '7187-ba49df72-37b8-43ac-98da-f8e029de0e63'
- # Construct a model instance of EndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRN by calling from_dict on the json representation
- endpoint_gateway_target_prototype_provider_cloud_service_identity_provider_cloud_service_identity_by_crn_model = EndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRN.from_dict(endpoint_gateway_target_prototype_provider_cloud_service_identity_provider_cloud_service_identity_by_crn_model_json)
- assert endpoint_gateway_target_prototype_provider_cloud_service_identity_provider_cloud_service_identity_by_crn_model != False
+ instance_reservation_affinity_prototype_model = {} # InstanceReservationAffinityPrototype
+ instance_reservation_affinity_prototype_model['policy'] = 'disabled'
+ instance_reservation_affinity_prototype_model['pool'] = [reservation_identity_model]
- # Construct a model instance of EndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRN by calling from_dict on the json representation
- endpoint_gateway_target_prototype_provider_cloud_service_identity_provider_cloud_service_identity_by_crn_model_dict = EndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRN.from_dict(endpoint_gateway_target_prototype_provider_cloud_service_identity_provider_cloud_service_identity_by_crn_model_json).__dict__
- endpoint_gateway_target_prototype_provider_cloud_service_identity_provider_cloud_service_identity_by_crn_model2 = EndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRN(**endpoint_gateway_target_prototype_provider_cloud_service_identity_provider_cloud_service_identity_by_crn_model_dict)
+ resource_group_identity_model = {} # ResourceGroupIdentityById
+ resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
- # Verify the model instances are equivalent
- assert endpoint_gateway_target_prototype_provider_cloud_service_identity_provider_cloud_service_identity_by_crn_model == endpoint_gateway_target_prototype_provider_cloud_service_identity_provider_cloud_service_identity_by_crn_model2
+ volume_attachment_prototype_volume_model = {} # VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById
+ volume_attachment_prototype_volume_model['id'] = '1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
- # Convert model instance back to dict and verify no loss of data
- endpoint_gateway_target_prototype_provider_cloud_service_identity_provider_cloud_service_identity_by_crn_model_json2 = endpoint_gateway_target_prototype_provider_cloud_service_identity_provider_cloud_service_identity_by_crn_model.to_dict()
- assert endpoint_gateway_target_prototype_provider_cloud_service_identity_provider_cloud_service_identity_by_crn_model_json2 == endpoint_gateway_target_prototype_provider_cloud_service_identity_provider_cloud_service_identity_by_crn_model_json
+ volume_attachment_prototype_model = {} # VolumeAttachmentPrototype
+ volume_attachment_prototype_model['delete_volume_on_instance_delete'] = False
+ volume_attachment_prototype_model['name'] = 'my-volume-attachment'
+ volume_attachment_prototype_model['volume'] = volume_attachment_prototype_volume_model
+ vpc_identity_model = {} # VPCIdentityById
+ vpc_identity_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b'
-class TestModel_EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityProviderInfrastructureServiceIdentityByName:
- """
- Test Class for EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityProviderInfrastructureServiceIdentityByName
- """
+ encryption_key_identity_model = {} # EncryptionKeyIdentityByCRN
+ encryption_key_identity_model['crn'] = 'crn:v1:bluemix:public:kms:us-south:a/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179'
- def test_endpoint_gateway_target_prototype_provider_infrastructure_service_identity_provider_infrastructure_service_identity_by_name_serialization(self):
- """
- Test serialization/deserialization for EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityProviderInfrastructureServiceIdentityByName
- """
+ volume_profile_identity_model = {} # VolumeProfileIdentityByName
+ volume_profile_identity_model['name'] = 'general-purpose'
- # Construct a json representation of a EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityProviderInfrastructureServiceIdentityByName model
- endpoint_gateway_target_prototype_provider_infrastructure_service_identity_provider_infrastructure_service_identity_by_name_model_json = {}
- endpoint_gateway_target_prototype_provider_infrastructure_service_identity_provider_infrastructure_service_identity_by_name_model_json['resource_type'] = 'provider_cloud_service'
- endpoint_gateway_target_prototype_provider_infrastructure_service_identity_provider_infrastructure_service_identity_by_name_model_json['name'] = 'ibm-ntp-server'
+ volume_prototype_instance_by_image_context_model = {} # VolumePrototypeInstanceByImageContext
+ volume_prototype_instance_by_image_context_model['capacity'] = 100
+ volume_prototype_instance_by_image_context_model['encryption_key'] = encryption_key_identity_model
+ volume_prototype_instance_by_image_context_model['iops'] = 10000
+ volume_prototype_instance_by_image_context_model['name'] = 'my-volume'
+ volume_prototype_instance_by_image_context_model['profile'] = volume_profile_identity_model
+ volume_prototype_instance_by_image_context_model['resource_group'] = resource_group_identity_model
+ volume_prototype_instance_by_image_context_model['user_tags'] = []
- # Construct a model instance of EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityProviderInfrastructureServiceIdentityByName by calling from_dict on the json representation
- endpoint_gateway_target_prototype_provider_infrastructure_service_identity_provider_infrastructure_service_identity_by_name_model = EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityProviderInfrastructureServiceIdentityByName.from_dict(endpoint_gateway_target_prototype_provider_infrastructure_service_identity_provider_infrastructure_service_identity_by_name_model_json)
- assert endpoint_gateway_target_prototype_provider_infrastructure_service_identity_provider_infrastructure_service_identity_by_name_model != False
+ 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
- # Construct a model instance of EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityProviderInfrastructureServiceIdentityByName by calling from_dict on the json representation
- endpoint_gateway_target_prototype_provider_infrastructure_service_identity_provider_infrastructure_service_identity_by_name_model_dict = EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityProviderInfrastructureServiceIdentityByName.from_dict(endpoint_gateway_target_prototype_provider_infrastructure_service_identity_provider_infrastructure_service_identity_by_name_model_json).__dict__
- endpoint_gateway_target_prototype_provider_infrastructure_service_identity_provider_infrastructure_service_identity_by_name_model2 = EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityProviderInfrastructureServiceIdentityByName(**endpoint_gateway_target_prototype_provider_infrastructure_service_identity_provider_infrastructure_service_identity_by_name_model_dict)
+ image_identity_model = {} # ImageIdentityById
+ image_identity_model['id'] = 'r006-02c73baf-9abb-493d-9e41-d0f1866f4051'
- # Verify the model instances are equivalent
- assert endpoint_gateway_target_prototype_provider_infrastructure_service_identity_provider_infrastructure_service_identity_by_name_model == endpoint_gateway_target_prototype_provider_infrastructure_service_identity_provider_infrastructure_service_identity_by_name_model2
+ zone_identity_model = {} # ZoneIdentityByName
+ zone_identity_model['name'] = 'us-south-1'
- # Convert model instance back to dict and verify no loss of data
- endpoint_gateway_target_prototype_provider_infrastructure_service_identity_provider_infrastructure_service_identity_by_name_model_json2 = endpoint_gateway_target_prototype_provider_infrastructure_service_identity_provider_infrastructure_service_identity_by_name_model.to_dict()
- assert endpoint_gateway_target_prototype_provider_infrastructure_service_identity_provider_infrastructure_service_identity_by_name_model_json2 == endpoint_gateway_target_prototype_provider_infrastructure_service_identity_provider_infrastructure_service_identity_by_name_model_json
+ virtual_network_interface_ip_prototype_model = {} # VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext
+ virtual_network_interface_ip_prototype_model['address'] = '10.0.0.5'
+ virtual_network_interface_ip_prototype_model['auto_delete'] = False
+ virtual_network_interface_ip_prototype_model['name'] = 'my-reserved-ip'
+
+ virtual_network_interface_primary_ip_prototype_model = {} # VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext
+ virtual_network_interface_primary_ip_prototype_model['address'] = '10.0.0.5'
+ virtual_network_interface_primary_ip_prototype_model['auto_delete'] = False
+ virtual_network_interface_primary_ip_prototype_model['name'] = 'my-reserved-ip'
+
+ 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'
-class TestModel_FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref:
- """
- Test Class for FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref
- """
+ instance_network_attachment_prototype_virtual_network_interface_model = {} # InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeInstanceNetworkAttachmentContext
+ instance_network_attachment_prototype_virtual_network_interface_model['allow_ip_spoofing'] = True
+ instance_network_attachment_prototype_virtual_network_interface_model['auto_delete'] = False
+ instance_network_attachment_prototype_virtual_network_interface_model['enable_infrastructure_nat'] = True
+ instance_network_attachment_prototype_virtual_network_interface_model['ips'] = [virtual_network_interface_ip_prototype_model]
+ instance_network_attachment_prototype_virtual_network_interface_model['name'] = 'my-virtual-network-interface'
+ instance_network_attachment_prototype_virtual_network_interface_model['primary_ip'] = virtual_network_interface_primary_ip_prototype_model
+ instance_network_attachment_prototype_virtual_network_interface_model['resource_group'] = resource_group_identity_model
+ instance_network_attachment_prototype_virtual_network_interface_model['security_groups'] = [security_group_identity_model]
+ instance_network_attachment_prototype_virtual_network_interface_model['subnet'] = subnet_identity_model
- def test_floating_ip_target_patch_bare_metal_server_network_interface_identity_bare_metal_server_network_interface_identity_by_href_serialization(self):
- """
- Test serialization/deserialization for FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref
- """
+ instance_network_attachment_prototype_model = {} # InstanceNetworkAttachmentPrototype
+ instance_network_attachment_prototype_model['name'] = 'my-instance-network-attachment'
+ instance_network_attachment_prototype_model['virtual_network_interface'] = instance_network_attachment_prototype_virtual_network_interface_model
- # Construct a json representation of a FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref model
- floating_ip_target_patch_bare_metal_server_network_interface_identity_bare_metal_server_network_interface_identity_by_href_model_json = {}
- floating_ip_target_patch_bare_metal_server_network_interface_identity_bare_metal_server_network_interface_identity_by_href_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'
+ # Construct a json representation of a InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachment model
+ instance_template_prototype_instance_template_by_image_instance_template_by_image_instance_by_network_attachment_model_json = {}
+ instance_template_prototype_instance_template_by_image_instance_template_by_image_instance_by_network_attachment_model_json['availability_policy'] = instance_availability_policy_prototype_model
+ instance_template_prototype_instance_template_by_image_instance_template_by_image_instance_by_network_attachment_model_json['default_trusted_profile'] = instance_default_trusted_profile_prototype_model
+ instance_template_prototype_instance_template_by_image_instance_template_by_image_instance_by_network_attachment_model_json['keys'] = [key_identity_model]
+ instance_template_prototype_instance_template_by_image_instance_template_by_image_instance_by_network_attachment_model_json['metadata_service'] = instance_metadata_service_prototype_model
+ instance_template_prototype_instance_template_by_image_instance_template_by_image_instance_by_network_attachment_model_json['name'] = 'my-instance'
+ instance_template_prototype_instance_template_by_image_instance_template_by_image_instance_by_network_attachment_model_json['placement_target'] = instance_placement_target_prototype_model
+ instance_template_prototype_instance_template_by_image_instance_template_by_image_instance_by_network_attachment_model_json['profile'] = instance_profile_identity_model
+ instance_template_prototype_instance_template_by_image_instance_template_by_image_instance_by_network_attachment_model_json['reservation_affinity'] = instance_reservation_affinity_prototype_model
+ instance_template_prototype_instance_template_by_image_instance_template_by_image_instance_by_network_attachment_model_json['resource_group'] = resource_group_identity_model
+ instance_template_prototype_instance_template_by_image_instance_template_by_image_instance_by_network_attachment_model_json['total_volume_bandwidth'] = 500
+ instance_template_prototype_instance_template_by_image_instance_template_by_image_instance_by_network_attachment_model_json['user_data'] = 'testString'
+ instance_template_prototype_instance_template_by_image_instance_template_by_image_instance_by_network_attachment_model_json['volume_attachments'] = [volume_attachment_prototype_model]
+ instance_template_prototype_instance_template_by_image_instance_template_by_image_instance_by_network_attachment_model_json['vpc'] = vpc_identity_model
+ instance_template_prototype_instance_template_by_image_instance_template_by_image_instance_by_network_attachment_model_json['boot_volume_attachment'] = volume_attachment_prototype_instance_by_image_context_model
+ instance_template_prototype_instance_template_by_image_instance_template_by_image_instance_by_network_attachment_model_json['image'] = image_identity_model
+ instance_template_prototype_instance_template_by_image_instance_template_by_image_instance_by_network_attachment_model_json['zone'] = zone_identity_model
+ instance_template_prototype_instance_template_by_image_instance_template_by_image_instance_by_network_attachment_model_json['network_attachments'] = [instance_network_attachment_prototype_model]
+ instance_template_prototype_instance_template_by_image_instance_template_by_image_instance_by_network_attachment_model_json['primary_network_attachment'] = instance_network_attachment_prototype_model
- # Construct a model instance of FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref by calling from_dict on the json representation
- floating_ip_target_patch_bare_metal_server_network_interface_identity_bare_metal_server_network_interface_identity_by_href_model = FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref.from_dict(floating_ip_target_patch_bare_metal_server_network_interface_identity_bare_metal_server_network_interface_identity_by_href_model_json)
- assert floating_ip_target_patch_bare_metal_server_network_interface_identity_bare_metal_server_network_interface_identity_by_href_model != False
+ # Construct a model instance of InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachment by calling from_dict on the json representation
+ instance_template_prototype_instance_template_by_image_instance_template_by_image_instance_by_network_attachment_model = InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachment.from_dict(instance_template_prototype_instance_template_by_image_instance_template_by_image_instance_by_network_attachment_model_json)
+ assert instance_template_prototype_instance_template_by_image_instance_template_by_image_instance_by_network_attachment_model != False
- # Construct a model instance of FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref by calling from_dict on the json representation
- floating_ip_target_patch_bare_metal_server_network_interface_identity_bare_metal_server_network_interface_identity_by_href_model_dict = FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref.from_dict(floating_ip_target_patch_bare_metal_server_network_interface_identity_bare_metal_server_network_interface_identity_by_href_model_json).__dict__
- floating_ip_target_patch_bare_metal_server_network_interface_identity_bare_metal_server_network_interface_identity_by_href_model2 = FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref(**floating_ip_target_patch_bare_metal_server_network_interface_identity_bare_metal_server_network_interface_identity_by_href_model_dict)
+ # Construct a model instance of InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachment by calling from_dict on the json representation
+ instance_template_prototype_instance_template_by_image_instance_template_by_image_instance_by_network_attachment_model_dict = InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachment.from_dict(instance_template_prototype_instance_template_by_image_instance_template_by_image_instance_by_network_attachment_model_json).__dict__
+ instance_template_prototype_instance_template_by_image_instance_template_by_image_instance_by_network_attachment_model2 = InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachment(**instance_template_prototype_instance_template_by_image_instance_template_by_image_instance_by_network_attachment_model_dict)
# Verify the model instances are equivalent
- assert floating_ip_target_patch_bare_metal_server_network_interface_identity_bare_metal_server_network_interface_identity_by_href_model == floating_ip_target_patch_bare_metal_server_network_interface_identity_bare_metal_server_network_interface_identity_by_href_model2
+ assert instance_template_prototype_instance_template_by_image_instance_template_by_image_instance_by_network_attachment_model == instance_template_prototype_instance_template_by_image_instance_template_by_image_instance_by_network_attachment_model2
# Convert model instance back to dict and verify no loss of data
- floating_ip_target_patch_bare_metal_server_network_interface_identity_bare_metal_server_network_interface_identity_by_href_model_json2 = floating_ip_target_patch_bare_metal_server_network_interface_identity_bare_metal_server_network_interface_identity_by_href_model.to_dict()
- assert floating_ip_target_patch_bare_metal_server_network_interface_identity_bare_metal_server_network_interface_identity_by_href_model_json2 == floating_ip_target_patch_bare_metal_server_network_interface_identity_bare_metal_server_network_interface_identity_by_href_model_json
+ instance_template_prototype_instance_template_by_image_instance_template_by_image_instance_by_network_attachment_model_json2 = instance_template_prototype_instance_template_by_image_instance_template_by_image_instance_by_network_attachment_model.to_dict()
+ assert instance_template_prototype_instance_template_by_image_instance_template_by_image_instance_by_network_attachment_model_json2 == instance_template_prototype_instance_template_by_image_instance_template_by_image_instance_by_network_attachment_model_json
-class TestModel_FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityById:
+class TestModel_InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkInterface:
"""
- Test Class for FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityById
+ Test Class for InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkInterface
"""
- def test_floating_ip_target_patch_bare_metal_server_network_interface_identity_bare_metal_server_network_interface_identity_by_id_serialization(self):
+ def test_instance_template_prototype_instance_template_by_image_instance_template_by_image_instance_by_network_interface_serialization(self):
"""
- Test serialization/deserialization for FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityById
+ Test serialization/deserialization for InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkInterface
"""
- # Construct a json representation of a FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityById model
- floating_ip_target_patch_bare_metal_server_network_interface_identity_bare_metal_server_network_interface_identity_by_id_model_json = {}
- floating_ip_target_patch_bare_metal_server_network_interface_identity_bare_metal_server_network_interface_identity_by_id_model_json['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e'
+ # Construct dict forms of any model objects needed in order to build this model.
- # Construct a model instance of FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityById by calling from_dict on the json representation
- floating_ip_target_patch_bare_metal_server_network_interface_identity_bare_metal_server_network_interface_identity_by_id_model = FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityById.from_dict(floating_ip_target_patch_bare_metal_server_network_interface_identity_bare_metal_server_network_interface_identity_by_id_model_json)
- assert floating_ip_target_patch_bare_metal_server_network_interface_identity_bare_metal_server_network_interface_identity_by_id_model != False
+ instance_availability_policy_prototype_model = {} # InstanceAvailabilityPolicyPrototype
+ instance_availability_policy_prototype_model['host_failure'] = 'restart'
- # Construct a model instance of FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityById by calling from_dict on the json representation
- floating_ip_target_patch_bare_metal_server_network_interface_identity_bare_metal_server_network_interface_identity_by_id_model_dict = FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityById.from_dict(floating_ip_target_patch_bare_metal_server_network_interface_identity_bare_metal_server_network_interface_identity_by_id_model_json).__dict__
- floating_ip_target_patch_bare_metal_server_network_interface_identity_bare_metal_server_network_interface_identity_by_id_model2 = FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityById(**floating_ip_target_patch_bare_metal_server_network_interface_identity_bare_metal_server_network_interface_identity_by_id_model_dict)
+ trusted_profile_identity_model = {} # TrustedProfileIdentityTrustedProfileById
+ trusted_profile_identity_model['id'] = 'Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5'
- # Verify the model instances are equivalent
- assert floating_ip_target_patch_bare_metal_server_network_interface_identity_bare_metal_server_network_interface_identity_by_id_model == floating_ip_target_patch_bare_metal_server_network_interface_identity_bare_metal_server_network_interface_identity_by_id_model2
+ instance_default_trusted_profile_prototype_model = {} # InstanceDefaultTrustedProfilePrototype
+ instance_default_trusted_profile_prototype_model['auto_link'] = False
+ instance_default_trusted_profile_prototype_model['target'] = trusted_profile_identity_model
- # Convert model instance back to dict and verify no loss of data
- floating_ip_target_patch_bare_metal_server_network_interface_identity_bare_metal_server_network_interface_identity_by_id_model_json2 = floating_ip_target_patch_bare_metal_server_network_interface_identity_bare_metal_server_network_interface_identity_by_id_model.to_dict()
- assert floating_ip_target_patch_bare_metal_server_network_interface_identity_bare_metal_server_network_interface_identity_by_id_model_json2 == floating_ip_target_patch_bare_metal_server_network_interface_identity_bare_metal_server_network_interface_identity_by_id_model_json
+ key_identity_model = {} # KeyIdentityById
+ key_identity_model['id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803'
+ instance_metadata_service_prototype_model = {} # InstanceMetadataServicePrototype
+ instance_metadata_service_prototype_model['enabled'] = False
+ instance_metadata_service_prototype_model['protocol'] = 'https'
+ instance_metadata_service_prototype_model['response_hop_limit'] = 2
-class TestModel_FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByHref:
- """
- Test Class for FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByHref
- """
+ instance_placement_target_prototype_model = {} # InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById
+ instance_placement_target_prototype_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
- def test_floating_ip_target_patch_network_interface_identity_network_interface_identity_by_href_serialization(self):
- """
- Test serialization/deserialization for FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByHref
- """
+ instance_profile_identity_model = {} # InstanceProfileIdentityByName
+ instance_profile_identity_model['name'] = 'cx2-16x32'
- # Construct a json representation of a FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByHref model
- floating_ip_target_patch_network_interface_identity_network_interface_identity_by_href_model_json = {}
- floating_ip_target_patch_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'
+ reservation_identity_model = {} # ReservationIdentityById
+ reservation_identity_model['id'] = '7187-ba49df72-37b8-43ac-98da-f8e029de0e63'
- # Construct a model instance of FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByHref by calling from_dict on the json representation
- floating_ip_target_patch_network_interface_identity_network_interface_identity_by_href_model = FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByHref.from_dict(floating_ip_target_patch_network_interface_identity_network_interface_identity_by_href_model_json)
- assert floating_ip_target_patch_network_interface_identity_network_interface_identity_by_href_model != False
+ instance_reservation_affinity_prototype_model = {} # InstanceReservationAffinityPrototype
+ instance_reservation_affinity_prototype_model['policy'] = 'disabled'
+ instance_reservation_affinity_prototype_model['pool'] = [reservation_identity_model]
- # Construct a model instance of FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByHref by calling from_dict on the json representation
- floating_ip_target_patch_network_interface_identity_network_interface_identity_by_href_model_dict = FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByHref.from_dict(floating_ip_target_patch_network_interface_identity_network_interface_identity_by_href_model_json).__dict__
- floating_ip_target_patch_network_interface_identity_network_interface_identity_by_href_model2 = FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByHref(**floating_ip_target_patch_network_interface_identity_network_interface_identity_by_href_model_dict)
+ resource_group_identity_model = {} # ResourceGroupIdentityById
+ resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
- # Verify the model instances are equivalent
- assert floating_ip_target_patch_network_interface_identity_network_interface_identity_by_href_model == floating_ip_target_patch_network_interface_identity_network_interface_identity_by_href_model2
+ volume_attachment_prototype_volume_model = {} # VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById
+ volume_attachment_prototype_volume_model['id'] = '1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
- # Convert model instance back to dict and verify no loss of data
- floating_ip_target_patch_network_interface_identity_network_interface_identity_by_href_model_json2 = floating_ip_target_patch_network_interface_identity_network_interface_identity_by_href_model.to_dict()
- assert floating_ip_target_patch_network_interface_identity_network_interface_identity_by_href_model_json2 == floating_ip_target_patch_network_interface_identity_network_interface_identity_by_href_model_json
+ volume_attachment_prototype_model = {} # VolumeAttachmentPrototype
+ volume_attachment_prototype_model['delete_volume_on_instance_delete'] = False
+ volume_attachment_prototype_model['name'] = 'my-volume-attachment'
+ volume_attachment_prototype_model['volume'] = volume_attachment_prototype_volume_model
+ vpc_identity_model = {} # VPCIdentityById
+ vpc_identity_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b'
-class TestModel_FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityById:
- """
- Test Class for FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityById
- """
+ encryption_key_identity_model = {} # EncryptionKeyIdentityByCRN
+ encryption_key_identity_model['crn'] = 'crn:v1:bluemix:public:kms:us-south:a/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179'
- def test_floating_ip_target_patch_network_interface_identity_network_interface_identity_by_id_serialization(self):
- """
- Test serialization/deserialization for FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityById
- """
+ volume_profile_identity_model = {} # VolumeProfileIdentityByName
+ volume_profile_identity_model['name'] = 'general-purpose'
- # Construct a json representation of a FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityById model
- floating_ip_target_patch_network_interface_identity_network_interface_identity_by_id_model_json = {}
- floating_ip_target_patch_network_interface_identity_network_interface_identity_by_id_model_json['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e'
+ volume_prototype_instance_by_image_context_model = {} # VolumePrototypeInstanceByImageContext
+ volume_prototype_instance_by_image_context_model['capacity'] = 100
+ volume_prototype_instance_by_image_context_model['encryption_key'] = encryption_key_identity_model
+ volume_prototype_instance_by_image_context_model['iops'] = 10000
+ volume_prototype_instance_by_image_context_model['name'] = 'my-volume'
+ volume_prototype_instance_by_image_context_model['profile'] = volume_profile_identity_model
+ volume_prototype_instance_by_image_context_model['resource_group'] = resource_group_identity_model
+ volume_prototype_instance_by_image_context_model['user_tags'] = []
- # Construct a model instance of FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityById by calling from_dict on the json representation
- floating_ip_target_patch_network_interface_identity_network_interface_identity_by_id_model = FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityById.from_dict(floating_ip_target_patch_network_interface_identity_network_interface_identity_by_id_model_json)
- assert floating_ip_target_patch_network_interface_identity_network_interface_identity_by_id_model != False
+ 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
- # Construct a model instance of FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityById by calling from_dict on the json representation
- floating_ip_target_patch_network_interface_identity_network_interface_identity_by_id_model_dict = FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityById.from_dict(floating_ip_target_patch_network_interface_identity_network_interface_identity_by_id_model_json).__dict__
- floating_ip_target_patch_network_interface_identity_network_interface_identity_by_id_model2 = FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityById(**floating_ip_target_patch_network_interface_identity_network_interface_identity_by_id_model_dict)
+ image_identity_model = {} # ImageIdentityById
+ image_identity_model['id'] = 'r006-02c73baf-9abb-493d-9e41-d0f1866f4051'
- # Verify the model instances are equivalent
- assert floating_ip_target_patch_network_interface_identity_network_interface_identity_by_id_model == floating_ip_target_patch_network_interface_identity_network_interface_identity_by_id_model2
+ zone_identity_model = {} # ZoneIdentityByName
+ zone_identity_model['name'] = 'us-south-1'
- # Convert model instance back to dict and verify no loss of data
- floating_ip_target_patch_network_interface_identity_network_interface_identity_by_id_model_json2 = floating_ip_target_patch_network_interface_identity_network_interface_identity_by_id_model.to_dict()
- assert floating_ip_target_patch_network_interface_identity_network_interface_identity_by_id_model_json2 == floating_ip_target_patch_network_interface_identity_network_interface_identity_by_id_model_json
+ network_interface_ip_prototype_model = {} # NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext
+ network_interface_ip_prototype_model['address'] = '10.0.0.5'
+ network_interface_ip_prototype_model['auto_delete'] = False
+ network_interface_ip_prototype_model['name'] = 'my-reserved-ip'
+ security_group_identity_model = {} # SecurityGroupIdentityById
+ security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271'
-class TestModel_FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref:
- """
- Test Class for FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref
- """
+ subnet_identity_model = {} # SubnetIdentityById
+ subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
- def test_floating_ip_target_prototype_bare_metal_server_network_interface_identity_bare_metal_server_network_interface_identity_by_href_serialization(self):
- """
- Test serialization/deserialization for FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref
- """
+ network_interface_prototype_model = {} # NetworkInterfacePrototype
+ network_interface_prototype_model['allow_ip_spoofing'] = True
+ network_interface_prototype_model['name'] = 'my-instance-network-interface'
+ network_interface_prototype_model['primary_ip'] = network_interface_ip_prototype_model
+ network_interface_prototype_model['security_groups'] = [security_group_identity_model]
+ network_interface_prototype_model['subnet'] = subnet_identity_model
- # Construct a json representation of a FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref model
- floating_ip_target_prototype_bare_metal_server_network_interface_identity_bare_metal_server_network_interface_identity_by_href_model_json = {}
- floating_ip_target_prototype_bare_metal_server_network_interface_identity_bare_metal_server_network_interface_identity_by_href_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'
+ # Construct a json representation of a InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkInterface model
+ instance_template_prototype_instance_template_by_image_instance_template_by_image_instance_by_network_interface_model_json = {}
+ instance_template_prototype_instance_template_by_image_instance_template_by_image_instance_by_network_interface_model_json['availability_policy'] = instance_availability_policy_prototype_model
+ instance_template_prototype_instance_template_by_image_instance_template_by_image_instance_by_network_interface_model_json['default_trusted_profile'] = instance_default_trusted_profile_prototype_model
+ instance_template_prototype_instance_template_by_image_instance_template_by_image_instance_by_network_interface_model_json['keys'] = [key_identity_model]
+ instance_template_prototype_instance_template_by_image_instance_template_by_image_instance_by_network_interface_model_json['metadata_service'] = instance_metadata_service_prototype_model
+ instance_template_prototype_instance_template_by_image_instance_template_by_image_instance_by_network_interface_model_json['name'] = 'my-instance'
+ instance_template_prototype_instance_template_by_image_instance_template_by_image_instance_by_network_interface_model_json['placement_target'] = instance_placement_target_prototype_model
+ instance_template_prototype_instance_template_by_image_instance_template_by_image_instance_by_network_interface_model_json['profile'] = instance_profile_identity_model
+ instance_template_prototype_instance_template_by_image_instance_template_by_image_instance_by_network_interface_model_json['reservation_affinity'] = instance_reservation_affinity_prototype_model
+ instance_template_prototype_instance_template_by_image_instance_template_by_image_instance_by_network_interface_model_json['resource_group'] = resource_group_identity_model
+ instance_template_prototype_instance_template_by_image_instance_template_by_image_instance_by_network_interface_model_json['total_volume_bandwidth'] = 500
+ instance_template_prototype_instance_template_by_image_instance_template_by_image_instance_by_network_interface_model_json['user_data'] = 'testString'
+ instance_template_prototype_instance_template_by_image_instance_template_by_image_instance_by_network_interface_model_json['volume_attachments'] = [volume_attachment_prototype_model]
+ instance_template_prototype_instance_template_by_image_instance_template_by_image_instance_by_network_interface_model_json['vpc'] = vpc_identity_model
+ instance_template_prototype_instance_template_by_image_instance_template_by_image_instance_by_network_interface_model_json['boot_volume_attachment'] = volume_attachment_prototype_instance_by_image_context_model
+ instance_template_prototype_instance_template_by_image_instance_template_by_image_instance_by_network_interface_model_json['image'] = image_identity_model
+ instance_template_prototype_instance_template_by_image_instance_template_by_image_instance_by_network_interface_model_json['zone'] = zone_identity_model
+ instance_template_prototype_instance_template_by_image_instance_template_by_image_instance_by_network_interface_model_json['network_interfaces'] = [network_interface_prototype_model]
+ instance_template_prototype_instance_template_by_image_instance_template_by_image_instance_by_network_interface_model_json['primary_network_interface'] = network_interface_prototype_model
- # Construct a model instance of FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref by calling from_dict on the json representation
- floating_ip_target_prototype_bare_metal_server_network_interface_identity_bare_metal_server_network_interface_identity_by_href_model = FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref.from_dict(floating_ip_target_prototype_bare_metal_server_network_interface_identity_bare_metal_server_network_interface_identity_by_href_model_json)
- assert floating_ip_target_prototype_bare_metal_server_network_interface_identity_bare_metal_server_network_interface_identity_by_href_model != False
+ # Construct a model instance of InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkInterface by calling from_dict on the json representation
+ instance_template_prototype_instance_template_by_image_instance_template_by_image_instance_by_network_interface_model = InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkInterface.from_dict(instance_template_prototype_instance_template_by_image_instance_template_by_image_instance_by_network_interface_model_json)
+ assert instance_template_prototype_instance_template_by_image_instance_template_by_image_instance_by_network_interface_model != False
- # Construct a model instance of FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref by calling from_dict on the json representation
- floating_ip_target_prototype_bare_metal_server_network_interface_identity_bare_metal_server_network_interface_identity_by_href_model_dict = FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref.from_dict(floating_ip_target_prototype_bare_metal_server_network_interface_identity_bare_metal_server_network_interface_identity_by_href_model_json).__dict__
- floating_ip_target_prototype_bare_metal_server_network_interface_identity_bare_metal_server_network_interface_identity_by_href_model2 = FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityByHref(**floating_ip_target_prototype_bare_metal_server_network_interface_identity_bare_metal_server_network_interface_identity_by_href_model_dict)
+ # Construct a model instance of InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkInterface by calling from_dict on the json representation
+ instance_template_prototype_instance_template_by_image_instance_template_by_image_instance_by_network_interface_model_dict = InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkInterface.from_dict(instance_template_prototype_instance_template_by_image_instance_template_by_image_instance_by_network_interface_model_json).__dict__
+ instance_template_prototype_instance_template_by_image_instance_template_by_image_instance_by_network_interface_model2 = InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkInterface(**instance_template_prototype_instance_template_by_image_instance_template_by_image_instance_by_network_interface_model_dict)
# Verify the model instances are equivalent
- assert floating_ip_target_prototype_bare_metal_server_network_interface_identity_bare_metal_server_network_interface_identity_by_href_model == floating_ip_target_prototype_bare_metal_server_network_interface_identity_bare_metal_server_network_interface_identity_by_href_model2
+ assert instance_template_prototype_instance_template_by_image_instance_template_by_image_instance_by_network_interface_model == instance_template_prototype_instance_template_by_image_instance_template_by_image_instance_by_network_interface_model2
# Convert model instance back to dict and verify no loss of data
- floating_ip_target_prototype_bare_metal_server_network_interface_identity_bare_metal_server_network_interface_identity_by_href_model_json2 = floating_ip_target_prototype_bare_metal_server_network_interface_identity_bare_metal_server_network_interface_identity_by_href_model.to_dict()
- assert floating_ip_target_prototype_bare_metal_server_network_interface_identity_bare_metal_server_network_interface_identity_by_href_model_json2 == floating_ip_target_prototype_bare_metal_server_network_interface_identity_bare_metal_server_network_interface_identity_by_href_model_json
+ instance_template_prototype_instance_template_by_image_instance_template_by_image_instance_by_network_interface_model_json2 = instance_template_prototype_instance_template_by_image_instance_template_by_image_instance_by_network_interface_model.to_dict()
+ assert instance_template_prototype_instance_template_by_image_instance_template_by_image_instance_by_network_interface_model_json2 == instance_template_prototype_instance_template_by_image_instance_template_by_image_instance_by_network_interface_model_json
-class TestModel_FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityById:
+class TestModel_InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkAttachment:
"""
- Test Class for FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityById
+ Test Class for InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkAttachment
"""
- def test_floating_ip_target_prototype_bare_metal_server_network_interface_identity_bare_metal_server_network_interface_identity_by_id_serialization(self):
+ def test_instance_template_prototype_instance_template_by_source_snapshot_instance_template_by_source_snapshot_instance_by_network_attachment_serialization(self):
"""
- Test serialization/deserialization for FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityById
+ Test serialization/deserialization for InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkAttachment
"""
- # Construct a json representation of a FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityById model
- floating_ip_target_prototype_bare_metal_server_network_interface_identity_bare_metal_server_network_interface_identity_by_id_model_json = {}
- floating_ip_target_prototype_bare_metal_server_network_interface_identity_bare_metal_server_network_interface_identity_by_id_model_json['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e'
+ # Construct dict forms of any model objects needed in order to build this model.
- # Construct a model instance of FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityById by calling from_dict on the json representation
- floating_ip_target_prototype_bare_metal_server_network_interface_identity_bare_metal_server_network_interface_identity_by_id_model = FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityById.from_dict(floating_ip_target_prototype_bare_metal_server_network_interface_identity_bare_metal_server_network_interface_identity_by_id_model_json)
- assert floating_ip_target_prototype_bare_metal_server_network_interface_identity_bare_metal_server_network_interface_identity_by_id_model != False
+ instance_availability_policy_prototype_model = {} # InstanceAvailabilityPolicyPrototype
+ instance_availability_policy_prototype_model['host_failure'] = 'restart'
- # Construct a model instance of FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityById by calling from_dict on the json representation
- floating_ip_target_prototype_bare_metal_server_network_interface_identity_bare_metal_server_network_interface_identity_by_id_model_dict = FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityById.from_dict(floating_ip_target_prototype_bare_metal_server_network_interface_identity_bare_metal_server_network_interface_identity_by_id_model_json).__dict__
- floating_ip_target_prototype_bare_metal_server_network_interface_identity_bare_metal_server_network_interface_identity_by_id_model2 = FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityById(**floating_ip_target_prototype_bare_metal_server_network_interface_identity_bare_metal_server_network_interface_identity_by_id_model_dict)
+ trusted_profile_identity_model = {} # TrustedProfileIdentityTrustedProfileById
+ trusted_profile_identity_model['id'] = 'Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5'
- # Verify the model instances are equivalent
- assert floating_ip_target_prototype_bare_metal_server_network_interface_identity_bare_metal_server_network_interface_identity_by_id_model == floating_ip_target_prototype_bare_metal_server_network_interface_identity_bare_metal_server_network_interface_identity_by_id_model2
+ instance_default_trusted_profile_prototype_model = {} # InstanceDefaultTrustedProfilePrototype
+ instance_default_trusted_profile_prototype_model['auto_link'] = False
+ instance_default_trusted_profile_prototype_model['target'] = trusted_profile_identity_model
- # Convert model instance back to dict and verify no loss of data
- floating_ip_target_prototype_bare_metal_server_network_interface_identity_bare_metal_server_network_interface_identity_by_id_model_json2 = floating_ip_target_prototype_bare_metal_server_network_interface_identity_bare_metal_server_network_interface_identity_by_id_model.to_dict()
- assert floating_ip_target_prototype_bare_metal_server_network_interface_identity_bare_metal_server_network_interface_identity_by_id_model_json2 == floating_ip_target_prototype_bare_metal_server_network_interface_identity_bare_metal_server_network_interface_identity_by_id_model_json
+ key_identity_model = {} # KeyIdentityById
+ key_identity_model['id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803'
+ instance_metadata_service_prototype_model = {} # InstanceMetadataServicePrototype
+ instance_metadata_service_prototype_model['enabled'] = False
+ instance_metadata_service_prototype_model['protocol'] = 'https'
+ instance_metadata_service_prototype_model['response_hop_limit'] = 2
-class TestModel_FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref:
- """
- Test Class for FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref
- """
+ instance_placement_target_prototype_model = {} # InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById
+ instance_placement_target_prototype_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
- def test_floating_ip_target_prototype_network_interface_identity_network_interface_identity_by_href_serialization(self):
- """
- Test serialization/deserialization for FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref
- """
+ instance_profile_identity_model = {} # InstanceProfileIdentityByName
+ instance_profile_identity_model['name'] = 'cx2-16x32'
- # Construct a json representation of a FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref model
- floating_ip_target_prototype_network_interface_identity_network_interface_identity_by_href_model_json = {}
- floating_ip_target_prototype_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'
+ reservation_identity_model = {} # ReservationIdentityById
+ reservation_identity_model['id'] = '7187-ba49df72-37b8-43ac-98da-f8e029de0e63'
- # Construct a model instance of FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref by calling from_dict on the json representation
- floating_ip_target_prototype_network_interface_identity_network_interface_identity_by_href_model = FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref.from_dict(floating_ip_target_prototype_network_interface_identity_network_interface_identity_by_href_model_json)
- assert floating_ip_target_prototype_network_interface_identity_network_interface_identity_by_href_model != False
+ instance_reservation_affinity_prototype_model = {} # InstanceReservationAffinityPrototype
+ instance_reservation_affinity_prototype_model['policy'] = 'disabled'
+ instance_reservation_affinity_prototype_model['pool'] = [reservation_identity_model]
- # Construct a model instance of FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref by calling from_dict on the json representation
- floating_ip_target_prototype_network_interface_identity_network_interface_identity_by_href_model_dict = FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref.from_dict(floating_ip_target_prototype_network_interface_identity_network_interface_identity_by_href_model_json).__dict__
- floating_ip_target_prototype_network_interface_identity_network_interface_identity_by_href_model2 = FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref(**floating_ip_target_prototype_network_interface_identity_network_interface_identity_by_href_model_dict)
+ resource_group_identity_model = {} # ResourceGroupIdentityById
+ resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
- # Verify the model instances are equivalent
- assert floating_ip_target_prototype_network_interface_identity_network_interface_identity_by_href_model == floating_ip_target_prototype_network_interface_identity_network_interface_identity_by_href_model2
+ volume_attachment_prototype_volume_model = {} # VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById
+ volume_attachment_prototype_volume_model['id'] = '1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
- # Convert model instance back to dict and verify no loss of data
- floating_ip_target_prototype_network_interface_identity_network_interface_identity_by_href_model_json2 = floating_ip_target_prototype_network_interface_identity_network_interface_identity_by_href_model.to_dict()
- assert floating_ip_target_prototype_network_interface_identity_network_interface_identity_by_href_model_json2 == floating_ip_target_prototype_network_interface_identity_network_interface_identity_by_href_model_json
+ volume_attachment_prototype_model = {} # VolumeAttachmentPrototype
+ volume_attachment_prototype_model['delete_volume_on_instance_delete'] = False
+ volume_attachment_prototype_model['name'] = 'my-volume-attachment'
+ volume_attachment_prototype_model['volume'] = volume_attachment_prototype_volume_model
+ vpc_identity_model = {} # VPCIdentityById
+ vpc_identity_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b'
-class TestModel_FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityById:
- """
- Test Class for FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityById
- """
+ encryption_key_identity_model = {} # EncryptionKeyIdentityByCRN
+ encryption_key_identity_model['crn'] = 'crn:v1:bluemix:public:kms:us-south:a/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179'
- def test_floating_ip_target_prototype_network_interface_identity_network_interface_identity_by_id_serialization(self):
- """
- Test serialization/deserialization for FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityById
- """
+ volume_profile_identity_model = {} # VolumeProfileIdentityByName
+ volume_profile_identity_model['name'] = 'general-purpose'
- # Construct a json representation of a FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityById model
- floating_ip_target_prototype_network_interface_identity_network_interface_identity_by_id_model_json = {}
- floating_ip_target_prototype_network_interface_identity_network_interface_identity_by_id_model_json['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e'
+ snapshot_identity_model = {} # SnapshotIdentityById
+ snapshot_identity_model['id'] = '349a61d8-7ab1-420f-a690-5fed76ef9d4f'
- # Construct a model instance of FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityById by calling from_dict on the json representation
- floating_ip_target_prototype_network_interface_identity_network_interface_identity_by_id_model = FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityById.from_dict(floating_ip_target_prototype_network_interface_identity_network_interface_identity_by_id_model_json)
- assert floating_ip_target_prototype_network_interface_identity_network_interface_identity_by_id_model != False
+ volume_prototype_instance_by_source_snapshot_context_model = {} # VolumePrototypeInstanceBySourceSnapshotContext
+ volume_prototype_instance_by_source_snapshot_context_model['capacity'] = 100
+ volume_prototype_instance_by_source_snapshot_context_model['encryption_key'] = encryption_key_identity_model
+ volume_prototype_instance_by_source_snapshot_context_model['iops'] = 10000
+ volume_prototype_instance_by_source_snapshot_context_model['name'] = 'my-volume'
+ volume_prototype_instance_by_source_snapshot_context_model['profile'] = volume_profile_identity_model
+ volume_prototype_instance_by_source_snapshot_context_model['resource_group'] = resource_group_identity_model
+ volume_prototype_instance_by_source_snapshot_context_model['source_snapshot'] = snapshot_identity_model
+ volume_prototype_instance_by_source_snapshot_context_model['user_tags'] = []
- # Construct a model instance of FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityById by calling from_dict on the json representation
- floating_ip_target_prototype_network_interface_identity_network_interface_identity_by_id_model_dict = FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityById.from_dict(floating_ip_target_prototype_network_interface_identity_network_interface_identity_by_id_model_json).__dict__
- floating_ip_target_prototype_network_interface_identity_network_interface_identity_by_id_model2 = FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityById(**floating_ip_target_prototype_network_interface_identity_network_interface_identity_by_id_model_dict)
+ volume_attachment_prototype_instance_by_source_snapshot_context_model = {} # VolumeAttachmentPrototypeInstanceBySourceSnapshotContext
+ volume_attachment_prototype_instance_by_source_snapshot_context_model['delete_volume_on_instance_delete'] = True
+ volume_attachment_prototype_instance_by_source_snapshot_context_model['name'] = 'my-volume-attachment'
+ volume_attachment_prototype_instance_by_source_snapshot_context_model['volume'] = volume_prototype_instance_by_source_snapshot_context_model
- # Verify the model instances are equivalent
- assert floating_ip_target_prototype_network_interface_identity_network_interface_identity_by_id_model == floating_ip_target_prototype_network_interface_identity_network_interface_identity_by_id_model2
+ zone_identity_model = {} # ZoneIdentityByName
+ zone_identity_model['name'] = 'us-south-1'
- # Convert model instance back to dict and verify no loss of data
- floating_ip_target_prototype_network_interface_identity_network_interface_identity_by_id_model_json2 = floating_ip_target_prototype_network_interface_identity_network_interface_identity_by_id_model.to_dict()
- assert floating_ip_target_prototype_network_interface_identity_network_interface_identity_by_id_model_json2 == floating_ip_target_prototype_network_interface_identity_network_interface_identity_by_id_model_json
+ virtual_network_interface_ip_prototype_model = {} # VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext
+ virtual_network_interface_ip_prototype_model['address'] = '10.0.0.5'
+ virtual_network_interface_ip_prototype_model['auto_delete'] = False
+ virtual_network_interface_ip_prototype_model['name'] = 'my-reserved-ip'
+ virtual_network_interface_primary_ip_prototype_model = {} # VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext
+ virtual_network_interface_primary_ip_prototype_model['address'] = '10.0.0.5'
+ virtual_network_interface_primary_ip_prototype_model['auto_delete'] = False
+ virtual_network_interface_primary_ip_prototype_model['name'] = 'my-reserved-ip'
-class TestModel_FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByCRN:
- """
- Test Class for FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByCRN
- """
+ security_group_identity_model = {} # SecurityGroupIdentityById
+ security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271'
- def test_flow_log_collector_target_prototype_instance_identity_instance_identity_by_crn_serialization(self):
- """
- Test serialization/deserialization for FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByCRN
- """
+ subnet_identity_model = {} # SubnetIdentityById
+ subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
- # Construct a json representation of a FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByCRN model
- flow_log_collector_target_prototype_instance_identity_instance_identity_by_crn_model_json = {}
- flow_log_collector_target_prototype_instance_identity_instance_identity_by_crn_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a'
+ instance_network_attachment_prototype_virtual_network_interface_model = {} # InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeInstanceNetworkAttachmentContext
+ instance_network_attachment_prototype_virtual_network_interface_model['allow_ip_spoofing'] = True
+ instance_network_attachment_prototype_virtual_network_interface_model['auto_delete'] = False
+ instance_network_attachment_prototype_virtual_network_interface_model['enable_infrastructure_nat'] = True
+ instance_network_attachment_prototype_virtual_network_interface_model['ips'] = [virtual_network_interface_ip_prototype_model]
+ instance_network_attachment_prototype_virtual_network_interface_model['name'] = 'my-virtual-network-interface'
+ instance_network_attachment_prototype_virtual_network_interface_model['primary_ip'] = virtual_network_interface_primary_ip_prototype_model
+ instance_network_attachment_prototype_virtual_network_interface_model['resource_group'] = resource_group_identity_model
+ instance_network_attachment_prototype_virtual_network_interface_model['security_groups'] = [security_group_identity_model]
+ instance_network_attachment_prototype_virtual_network_interface_model['subnet'] = subnet_identity_model
- # Construct a model instance of FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByCRN by calling from_dict on the json representation
- flow_log_collector_target_prototype_instance_identity_instance_identity_by_crn_model = FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByCRN.from_dict(flow_log_collector_target_prototype_instance_identity_instance_identity_by_crn_model_json)
- assert flow_log_collector_target_prototype_instance_identity_instance_identity_by_crn_model != False
+ instance_network_attachment_prototype_model = {} # InstanceNetworkAttachmentPrototype
+ instance_network_attachment_prototype_model['name'] = 'my-instance-network-attachment'
+ instance_network_attachment_prototype_model['virtual_network_interface'] = instance_network_attachment_prototype_virtual_network_interface_model
- # Construct a model instance of FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByCRN by calling from_dict on the json representation
- flow_log_collector_target_prototype_instance_identity_instance_identity_by_crn_model_dict = FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByCRN.from_dict(flow_log_collector_target_prototype_instance_identity_instance_identity_by_crn_model_json).__dict__
- flow_log_collector_target_prototype_instance_identity_instance_identity_by_crn_model2 = FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByCRN(**flow_log_collector_target_prototype_instance_identity_instance_identity_by_crn_model_dict)
+ # Construct a json representation of a InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkAttachment model
+ instance_template_prototype_instance_template_by_source_snapshot_instance_template_by_source_snapshot_instance_by_network_attachment_model_json = {}
+ instance_template_prototype_instance_template_by_source_snapshot_instance_template_by_source_snapshot_instance_by_network_attachment_model_json['availability_policy'] = instance_availability_policy_prototype_model
+ instance_template_prototype_instance_template_by_source_snapshot_instance_template_by_source_snapshot_instance_by_network_attachment_model_json['default_trusted_profile'] = instance_default_trusted_profile_prototype_model
+ instance_template_prototype_instance_template_by_source_snapshot_instance_template_by_source_snapshot_instance_by_network_attachment_model_json['keys'] = [key_identity_model]
+ instance_template_prototype_instance_template_by_source_snapshot_instance_template_by_source_snapshot_instance_by_network_attachment_model_json['metadata_service'] = instance_metadata_service_prototype_model
+ instance_template_prototype_instance_template_by_source_snapshot_instance_template_by_source_snapshot_instance_by_network_attachment_model_json['name'] = 'my-instance'
+ instance_template_prototype_instance_template_by_source_snapshot_instance_template_by_source_snapshot_instance_by_network_attachment_model_json['placement_target'] = instance_placement_target_prototype_model
+ instance_template_prototype_instance_template_by_source_snapshot_instance_template_by_source_snapshot_instance_by_network_attachment_model_json['profile'] = instance_profile_identity_model
+ instance_template_prototype_instance_template_by_source_snapshot_instance_template_by_source_snapshot_instance_by_network_attachment_model_json['reservation_affinity'] = instance_reservation_affinity_prototype_model
+ instance_template_prototype_instance_template_by_source_snapshot_instance_template_by_source_snapshot_instance_by_network_attachment_model_json['resource_group'] = resource_group_identity_model
+ instance_template_prototype_instance_template_by_source_snapshot_instance_template_by_source_snapshot_instance_by_network_attachment_model_json['total_volume_bandwidth'] = 500
+ instance_template_prototype_instance_template_by_source_snapshot_instance_template_by_source_snapshot_instance_by_network_attachment_model_json['user_data'] = 'testString'
+ instance_template_prototype_instance_template_by_source_snapshot_instance_template_by_source_snapshot_instance_by_network_attachment_model_json['volume_attachments'] = [volume_attachment_prototype_model]
+ instance_template_prototype_instance_template_by_source_snapshot_instance_template_by_source_snapshot_instance_by_network_attachment_model_json['vpc'] = vpc_identity_model
+ instance_template_prototype_instance_template_by_source_snapshot_instance_template_by_source_snapshot_instance_by_network_attachment_model_json['boot_volume_attachment'] = volume_attachment_prototype_instance_by_source_snapshot_context_model
+ instance_template_prototype_instance_template_by_source_snapshot_instance_template_by_source_snapshot_instance_by_network_attachment_model_json['zone'] = zone_identity_model
+ instance_template_prototype_instance_template_by_source_snapshot_instance_template_by_source_snapshot_instance_by_network_attachment_model_json['network_attachments'] = [instance_network_attachment_prototype_model]
+ instance_template_prototype_instance_template_by_source_snapshot_instance_template_by_source_snapshot_instance_by_network_attachment_model_json['primary_network_attachment'] = instance_network_attachment_prototype_model
+
+ # Construct a model instance of InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkAttachment by calling from_dict on the json representation
+ instance_template_prototype_instance_template_by_source_snapshot_instance_template_by_source_snapshot_instance_by_network_attachment_model = InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkAttachment.from_dict(instance_template_prototype_instance_template_by_source_snapshot_instance_template_by_source_snapshot_instance_by_network_attachment_model_json)
+ assert instance_template_prototype_instance_template_by_source_snapshot_instance_template_by_source_snapshot_instance_by_network_attachment_model != False
+
+ # Construct a model instance of InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkAttachment by calling from_dict on the json representation
+ instance_template_prototype_instance_template_by_source_snapshot_instance_template_by_source_snapshot_instance_by_network_attachment_model_dict = InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkAttachment.from_dict(instance_template_prototype_instance_template_by_source_snapshot_instance_template_by_source_snapshot_instance_by_network_attachment_model_json).__dict__
+ instance_template_prototype_instance_template_by_source_snapshot_instance_template_by_source_snapshot_instance_by_network_attachment_model2 = InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkAttachment(**instance_template_prototype_instance_template_by_source_snapshot_instance_template_by_source_snapshot_instance_by_network_attachment_model_dict)
# Verify the model instances are equivalent
- assert flow_log_collector_target_prototype_instance_identity_instance_identity_by_crn_model == flow_log_collector_target_prototype_instance_identity_instance_identity_by_crn_model2
+ assert instance_template_prototype_instance_template_by_source_snapshot_instance_template_by_source_snapshot_instance_by_network_attachment_model == instance_template_prototype_instance_template_by_source_snapshot_instance_template_by_source_snapshot_instance_by_network_attachment_model2
# Convert model instance back to dict and verify no loss of data
- flow_log_collector_target_prototype_instance_identity_instance_identity_by_crn_model_json2 = flow_log_collector_target_prototype_instance_identity_instance_identity_by_crn_model.to_dict()
- assert flow_log_collector_target_prototype_instance_identity_instance_identity_by_crn_model_json2 == flow_log_collector_target_prototype_instance_identity_instance_identity_by_crn_model_json
+ instance_template_prototype_instance_template_by_source_snapshot_instance_template_by_source_snapshot_instance_by_network_attachment_model_json2 = instance_template_prototype_instance_template_by_source_snapshot_instance_template_by_source_snapshot_instance_by_network_attachment_model.to_dict()
+ assert instance_template_prototype_instance_template_by_source_snapshot_instance_template_by_source_snapshot_instance_by_network_attachment_model_json2 == instance_template_prototype_instance_template_by_source_snapshot_instance_template_by_source_snapshot_instance_by_network_attachment_model_json
-class TestModel_FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByHref:
+class TestModel_InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkInterface:
"""
- Test Class for FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByHref
+ Test Class for InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkInterface
"""
- def test_flow_log_collector_target_prototype_instance_identity_instance_identity_by_href_serialization(self):
+ def test_instance_template_prototype_instance_template_by_source_snapshot_instance_template_by_source_snapshot_instance_by_network_interface_serialization(self):
"""
- Test serialization/deserialization for FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByHref
+ Test serialization/deserialization for InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkInterface
"""
- # Construct a json representation of a FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByHref model
- flow_log_collector_target_prototype_instance_identity_instance_identity_by_href_model_json = {}
- flow_log_collector_target_prototype_instance_identity_instance_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a'
+ # Construct dict forms of any model objects needed in order to build this model.
- # Construct a model instance of FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByHref by calling from_dict on the json representation
- flow_log_collector_target_prototype_instance_identity_instance_identity_by_href_model = FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByHref.from_dict(flow_log_collector_target_prototype_instance_identity_instance_identity_by_href_model_json)
- assert flow_log_collector_target_prototype_instance_identity_instance_identity_by_href_model != False
+ instance_availability_policy_prototype_model = {} # InstanceAvailabilityPolicyPrototype
+ instance_availability_policy_prototype_model['host_failure'] = 'restart'
- # Construct a model instance of FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByHref by calling from_dict on the json representation
- flow_log_collector_target_prototype_instance_identity_instance_identity_by_href_model_dict = FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByHref.from_dict(flow_log_collector_target_prototype_instance_identity_instance_identity_by_href_model_json).__dict__
- flow_log_collector_target_prototype_instance_identity_instance_identity_by_href_model2 = FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByHref(**flow_log_collector_target_prototype_instance_identity_instance_identity_by_href_model_dict)
+ trusted_profile_identity_model = {} # TrustedProfileIdentityTrustedProfileById
+ trusted_profile_identity_model['id'] = 'Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5'
- # Verify the model instances are equivalent
- assert flow_log_collector_target_prototype_instance_identity_instance_identity_by_href_model == flow_log_collector_target_prototype_instance_identity_instance_identity_by_href_model2
+ instance_default_trusted_profile_prototype_model = {} # InstanceDefaultTrustedProfilePrototype
+ instance_default_trusted_profile_prototype_model['auto_link'] = False
+ instance_default_trusted_profile_prototype_model['target'] = trusted_profile_identity_model
- # Convert model instance back to dict and verify no loss of data
- flow_log_collector_target_prototype_instance_identity_instance_identity_by_href_model_json2 = flow_log_collector_target_prototype_instance_identity_instance_identity_by_href_model.to_dict()
- assert flow_log_collector_target_prototype_instance_identity_instance_identity_by_href_model_json2 == flow_log_collector_target_prototype_instance_identity_instance_identity_by_href_model_json
+ key_identity_model = {} # KeyIdentityById
+ key_identity_model['id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803'
+ instance_metadata_service_prototype_model = {} # InstanceMetadataServicePrototype
+ instance_metadata_service_prototype_model['enabled'] = False
+ instance_metadata_service_prototype_model['protocol'] = 'https'
+ instance_metadata_service_prototype_model['response_hop_limit'] = 2
-class TestModel_FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityById:
- """
- Test Class for FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityById
- """
+ instance_placement_target_prototype_model = {} # InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById
+ instance_placement_target_prototype_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
- def test_flow_log_collector_target_prototype_instance_identity_instance_identity_by_id_serialization(self):
- """
- Test serialization/deserialization for FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityById
- """
+ instance_profile_identity_model = {} # InstanceProfileIdentityByName
+ instance_profile_identity_model['name'] = 'cx2-16x32'
- # Construct a json representation of a FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityById model
- flow_log_collector_target_prototype_instance_identity_instance_identity_by_id_model_json = {}
- flow_log_collector_target_prototype_instance_identity_instance_identity_by_id_model_json['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
+ reservation_identity_model = {} # ReservationIdentityById
+ reservation_identity_model['id'] = '7187-ba49df72-37b8-43ac-98da-f8e029de0e63'
- # Construct a model instance of FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityById by calling from_dict on the json representation
- flow_log_collector_target_prototype_instance_identity_instance_identity_by_id_model = FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityById.from_dict(flow_log_collector_target_prototype_instance_identity_instance_identity_by_id_model_json)
- assert flow_log_collector_target_prototype_instance_identity_instance_identity_by_id_model != False
+ instance_reservation_affinity_prototype_model = {} # InstanceReservationAffinityPrototype
+ instance_reservation_affinity_prototype_model['policy'] = 'disabled'
+ instance_reservation_affinity_prototype_model['pool'] = [reservation_identity_model]
- # Construct a model instance of FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityById by calling from_dict on the json representation
- flow_log_collector_target_prototype_instance_identity_instance_identity_by_id_model_dict = FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityById.from_dict(flow_log_collector_target_prototype_instance_identity_instance_identity_by_id_model_json).__dict__
- flow_log_collector_target_prototype_instance_identity_instance_identity_by_id_model2 = FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityById(**flow_log_collector_target_prototype_instance_identity_instance_identity_by_id_model_dict)
+ resource_group_identity_model = {} # ResourceGroupIdentityById
+ resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
- # Verify the model instances are equivalent
- assert flow_log_collector_target_prototype_instance_identity_instance_identity_by_id_model == flow_log_collector_target_prototype_instance_identity_instance_identity_by_id_model2
+ volume_attachment_prototype_volume_model = {} # VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById
+ volume_attachment_prototype_volume_model['id'] = '1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
- # Convert model instance back to dict and verify no loss of data
- flow_log_collector_target_prototype_instance_identity_instance_identity_by_id_model_json2 = flow_log_collector_target_prototype_instance_identity_instance_identity_by_id_model.to_dict()
- assert flow_log_collector_target_prototype_instance_identity_instance_identity_by_id_model_json2 == flow_log_collector_target_prototype_instance_identity_instance_identity_by_id_model_json
+ volume_attachment_prototype_model = {} # VolumeAttachmentPrototype
+ volume_attachment_prototype_model['delete_volume_on_instance_delete'] = False
+ volume_attachment_prototype_model['name'] = 'my-volume-attachment'
+ volume_attachment_prototype_model['volume'] = volume_attachment_prototype_volume_model
+ vpc_identity_model = {} # VPCIdentityById
+ vpc_identity_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b'
-class TestModel_FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref:
- """
- Test Class for FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref
- """
+ encryption_key_identity_model = {} # EncryptionKeyIdentityByCRN
+ encryption_key_identity_model['crn'] = 'crn:v1:bluemix:public:kms:us-south:a/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179'
- def test_flow_log_collector_target_prototype_network_interface_identity_network_interface_identity_by_href_serialization(self):
- """
- Test serialization/deserialization for FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref
- """
+ volume_profile_identity_model = {} # VolumeProfileIdentityByName
+ volume_profile_identity_model['name'] = 'general-purpose'
- # Construct a json representation of a FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref model
- flow_log_collector_target_prototype_network_interface_identity_network_interface_identity_by_href_model_json = {}
- flow_log_collector_target_prototype_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'
+ snapshot_identity_model = {} # SnapshotIdentityById
+ snapshot_identity_model['id'] = '349a61d8-7ab1-420f-a690-5fed76ef9d4f'
- # Construct a model instance of FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref by calling from_dict on the json representation
- flow_log_collector_target_prototype_network_interface_identity_network_interface_identity_by_href_model = FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref.from_dict(flow_log_collector_target_prototype_network_interface_identity_network_interface_identity_by_href_model_json)
- assert flow_log_collector_target_prototype_network_interface_identity_network_interface_identity_by_href_model != False
+ volume_prototype_instance_by_source_snapshot_context_model = {} # VolumePrototypeInstanceBySourceSnapshotContext
+ volume_prototype_instance_by_source_snapshot_context_model['capacity'] = 100
+ volume_prototype_instance_by_source_snapshot_context_model['encryption_key'] = encryption_key_identity_model
+ volume_prototype_instance_by_source_snapshot_context_model['iops'] = 10000
+ volume_prototype_instance_by_source_snapshot_context_model['name'] = 'my-volume'
+ volume_prototype_instance_by_source_snapshot_context_model['profile'] = volume_profile_identity_model
+ volume_prototype_instance_by_source_snapshot_context_model['resource_group'] = resource_group_identity_model
+ volume_prototype_instance_by_source_snapshot_context_model['source_snapshot'] = snapshot_identity_model
+ volume_prototype_instance_by_source_snapshot_context_model['user_tags'] = []
- # Construct a model instance of FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref by calling from_dict on the json representation
- flow_log_collector_target_prototype_network_interface_identity_network_interface_identity_by_href_model_dict = FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref.from_dict(flow_log_collector_target_prototype_network_interface_identity_network_interface_identity_by_href_model_json).__dict__
- flow_log_collector_target_prototype_network_interface_identity_network_interface_identity_by_href_model2 = FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref(**flow_log_collector_target_prototype_network_interface_identity_network_interface_identity_by_href_model_dict)
+ volume_attachment_prototype_instance_by_source_snapshot_context_model = {} # VolumeAttachmentPrototypeInstanceBySourceSnapshotContext
+ volume_attachment_prototype_instance_by_source_snapshot_context_model['delete_volume_on_instance_delete'] = True
+ volume_attachment_prototype_instance_by_source_snapshot_context_model['name'] = 'my-volume-attachment'
+ volume_attachment_prototype_instance_by_source_snapshot_context_model['volume'] = volume_prototype_instance_by_source_snapshot_context_model
- # Verify the model instances are equivalent
- assert flow_log_collector_target_prototype_network_interface_identity_network_interface_identity_by_href_model == flow_log_collector_target_prototype_network_interface_identity_network_interface_identity_by_href_model2
+ zone_identity_model = {} # ZoneIdentityByName
+ zone_identity_model['name'] = 'us-south-1'
- # Convert model instance back to dict and verify no loss of data
- flow_log_collector_target_prototype_network_interface_identity_network_interface_identity_by_href_model_json2 = flow_log_collector_target_prototype_network_interface_identity_network_interface_identity_by_href_model.to_dict()
- assert flow_log_collector_target_prototype_network_interface_identity_network_interface_identity_by_href_model_json2 == flow_log_collector_target_prototype_network_interface_identity_network_interface_identity_by_href_model_json
+ network_interface_ip_prototype_model = {} # NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext
+ network_interface_ip_prototype_model['address'] = '10.0.0.5'
+ network_interface_ip_prototype_model['auto_delete'] = False
+ network_interface_ip_prototype_model['name'] = 'my-reserved-ip'
+ security_group_identity_model = {} # SecurityGroupIdentityById
+ security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271'
-class TestModel_FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityById:
- """
- Test Class for FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityById
- """
+ subnet_identity_model = {} # SubnetIdentityById
+ subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
- def test_flow_log_collector_target_prototype_network_interface_identity_network_interface_identity_by_id_serialization(self):
- """
- Test serialization/deserialization for FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityById
- """
+ network_interface_prototype_model = {} # NetworkInterfacePrototype
+ network_interface_prototype_model['allow_ip_spoofing'] = True
+ network_interface_prototype_model['name'] = 'my-instance-network-interface'
+ network_interface_prototype_model['primary_ip'] = network_interface_ip_prototype_model
+ network_interface_prototype_model['security_groups'] = [security_group_identity_model]
+ network_interface_prototype_model['subnet'] = subnet_identity_model
- # Construct a json representation of a FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityById model
- flow_log_collector_target_prototype_network_interface_identity_network_interface_identity_by_id_model_json = {}
- flow_log_collector_target_prototype_network_interface_identity_network_interface_identity_by_id_model_json['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e'
+ # Construct a json representation of a InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkInterface model
+ instance_template_prototype_instance_template_by_source_snapshot_instance_template_by_source_snapshot_instance_by_network_interface_model_json = {}
+ instance_template_prototype_instance_template_by_source_snapshot_instance_template_by_source_snapshot_instance_by_network_interface_model_json['availability_policy'] = instance_availability_policy_prototype_model
+ instance_template_prototype_instance_template_by_source_snapshot_instance_template_by_source_snapshot_instance_by_network_interface_model_json['default_trusted_profile'] = instance_default_trusted_profile_prototype_model
+ instance_template_prototype_instance_template_by_source_snapshot_instance_template_by_source_snapshot_instance_by_network_interface_model_json['keys'] = [key_identity_model]
+ instance_template_prototype_instance_template_by_source_snapshot_instance_template_by_source_snapshot_instance_by_network_interface_model_json['metadata_service'] = instance_metadata_service_prototype_model
+ instance_template_prototype_instance_template_by_source_snapshot_instance_template_by_source_snapshot_instance_by_network_interface_model_json['name'] = 'my-instance'
+ instance_template_prototype_instance_template_by_source_snapshot_instance_template_by_source_snapshot_instance_by_network_interface_model_json['placement_target'] = instance_placement_target_prototype_model
+ instance_template_prototype_instance_template_by_source_snapshot_instance_template_by_source_snapshot_instance_by_network_interface_model_json['profile'] = instance_profile_identity_model
+ instance_template_prototype_instance_template_by_source_snapshot_instance_template_by_source_snapshot_instance_by_network_interface_model_json['reservation_affinity'] = instance_reservation_affinity_prototype_model
+ instance_template_prototype_instance_template_by_source_snapshot_instance_template_by_source_snapshot_instance_by_network_interface_model_json['resource_group'] = resource_group_identity_model
+ instance_template_prototype_instance_template_by_source_snapshot_instance_template_by_source_snapshot_instance_by_network_interface_model_json['total_volume_bandwidth'] = 500
+ instance_template_prototype_instance_template_by_source_snapshot_instance_template_by_source_snapshot_instance_by_network_interface_model_json['user_data'] = 'testString'
+ instance_template_prototype_instance_template_by_source_snapshot_instance_template_by_source_snapshot_instance_by_network_interface_model_json['volume_attachments'] = [volume_attachment_prototype_model]
+ instance_template_prototype_instance_template_by_source_snapshot_instance_template_by_source_snapshot_instance_by_network_interface_model_json['vpc'] = vpc_identity_model
+ instance_template_prototype_instance_template_by_source_snapshot_instance_template_by_source_snapshot_instance_by_network_interface_model_json['boot_volume_attachment'] = volume_attachment_prototype_instance_by_source_snapshot_context_model
+ instance_template_prototype_instance_template_by_source_snapshot_instance_template_by_source_snapshot_instance_by_network_interface_model_json['zone'] = zone_identity_model
+ instance_template_prototype_instance_template_by_source_snapshot_instance_template_by_source_snapshot_instance_by_network_interface_model_json['network_interfaces'] = [network_interface_prototype_model]
+ instance_template_prototype_instance_template_by_source_snapshot_instance_template_by_source_snapshot_instance_by_network_interface_model_json['primary_network_interface'] = network_interface_prototype_model
- # Construct a model instance of FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityById by calling from_dict on the json representation
- flow_log_collector_target_prototype_network_interface_identity_network_interface_identity_by_id_model = FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityById.from_dict(flow_log_collector_target_prototype_network_interface_identity_network_interface_identity_by_id_model_json)
- assert flow_log_collector_target_prototype_network_interface_identity_network_interface_identity_by_id_model != False
+ # Construct a model instance of InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkInterface by calling from_dict on the json representation
+ instance_template_prototype_instance_template_by_source_snapshot_instance_template_by_source_snapshot_instance_by_network_interface_model = InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkInterface.from_dict(instance_template_prototype_instance_template_by_source_snapshot_instance_template_by_source_snapshot_instance_by_network_interface_model_json)
+ assert instance_template_prototype_instance_template_by_source_snapshot_instance_template_by_source_snapshot_instance_by_network_interface_model != False
- # Construct a model instance of FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityById by calling from_dict on the json representation
- flow_log_collector_target_prototype_network_interface_identity_network_interface_identity_by_id_model_dict = FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityById.from_dict(flow_log_collector_target_prototype_network_interface_identity_network_interface_identity_by_id_model_json).__dict__
- flow_log_collector_target_prototype_network_interface_identity_network_interface_identity_by_id_model2 = FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityById(**flow_log_collector_target_prototype_network_interface_identity_network_interface_identity_by_id_model_dict)
+ # Construct a model instance of InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkInterface by calling from_dict on the json representation
+ instance_template_prototype_instance_template_by_source_snapshot_instance_template_by_source_snapshot_instance_by_network_interface_model_dict = InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkInterface.from_dict(instance_template_prototype_instance_template_by_source_snapshot_instance_template_by_source_snapshot_instance_by_network_interface_model_json).__dict__
+ instance_template_prototype_instance_template_by_source_snapshot_instance_template_by_source_snapshot_instance_by_network_interface_model2 = InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkInterface(**instance_template_prototype_instance_template_by_source_snapshot_instance_template_by_source_snapshot_instance_by_network_interface_model_dict)
# Verify the model instances are equivalent
- assert flow_log_collector_target_prototype_network_interface_identity_network_interface_identity_by_id_model == flow_log_collector_target_prototype_network_interface_identity_network_interface_identity_by_id_model2
+ assert instance_template_prototype_instance_template_by_source_snapshot_instance_template_by_source_snapshot_instance_by_network_interface_model == instance_template_prototype_instance_template_by_source_snapshot_instance_template_by_source_snapshot_instance_by_network_interface_model2
# Convert model instance back to dict and verify no loss of data
- flow_log_collector_target_prototype_network_interface_identity_network_interface_identity_by_id_model_json2 = flow_log_collector_target_prototype_network_interface_identity_network_interface_identity_by_id_model.to_dict()
- assert flow_log_collector_target_prototype_network_interface_identity_network_interface_identity_by_id_model_json2 == flow_log_collector_target_prototype_network_interface_identity_network_interface_identity_by_id_model_json
+ instance_template_prototype_instance_template_by_source_snapshot_instance_template_by_source_snapshot_instance_by_network_interface_model_json2 = instance_template_prototype_instance_template_by_source_snapshot_instance_template_by_source_snapshot_instance_by_network_interface_model.to_dict()
+ assert instance_template_prototype_instance_template_by_source_snapshot_instance_template_by_source_snapshot_instance_by_network_interface_model_json2 == instance_template_prototype_instance_template_by_source_snapshot_instance_template_by_source_snapshot_instance_by_network_interface_model_json
-class TestModel_FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByCRN:
+class TestModel_InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkAttachment:
"""
- Test Class for FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByCRN
+ Test Class for InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkAttachment
"""
- def test_flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_crn_serialization(self):
+ def test_instance_template_instance_by_catalog_offering_instance_template_context_instance_by_catalog_offering_instance_template_context_instance_by_network_attachment_serialization(self):
"""
- Test serialization/deserialization for FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByCRN
+ Test serialization/deserialization for InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkAttachment
"""
- # Construct a json representation of a FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByCRN model
- flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_crn_model_json = {}
- flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_crn_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
+ # Construct dict forms of any model objects needed in order to build this model.
- # Construct a model instance of FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByCRN by calling from_dict on the json representation
- flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_crn_model = FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByCRN.from_dict(flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_crn_model_json)
- assert flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_crn_model != False
+ instance_availability_policy_prototype_model = {} # InstanceAvailabilityPolicyPrototype
+ instance_availability_policy_prototype_model['host_failure'] = 'restart'
- # Construct a model instance of FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByCRN by calling from_dict on the json representation
- flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_crn_model_dict = FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByCRN.from_dict(flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_crn_model_json).__dict__
- flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_crn_model2 = FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByCRN(**flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_crn_model_dict)
+ trusted_profile_identity_model = {} # TrustedProfileIdentityTrustedProfileById
+ trusted_profile_identity_model['id'] = 'Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5'
- # Verify the model instances are equivalent
- assert flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_crn_model == flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_crn_model2
+ instance_default_trusted_profile_prototype_model = {} # InstanceDefaultTrustedProfilePrototype
+ instance_default_trusted_profile_prototype_model['auto_link'] = False
+ instance_default_trusted_profile_prototype_model['target'] = trusted_profile_identity_model
- # Convert model instance back to dict and verify no loss of data
- flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_crn_model_json2 = flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_crn_model.to_dict()
- assert flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_crn_model_json2 == flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_crn_model_json
+ key_identity_model = {} # KeyIdentityById
+ key_identity_model['id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803'
+ instance_metadata_service_prototype_model = {} # InstanceMetadataServicePrototype
+ instance_metadata_service_prototype_model['enabled'] = False
+ instance_metadata_service_prototype_model['protocol'] = 'https'
+ instance_metadata_service_prototype_model['response_hop_limit'] = 2
-class TestModel_FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByHref:
- """
- Test Class for FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByHref
- """
+ instance_placement_target_prototype_model = {} # InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById
+ instance_placement_target_prototype_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
- def test_flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_href_serialization(self):
- """
- Test serialization/deserialization for FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByHref
- """
+ instance_profile_identity_model = {} # InstanceProfileIdentityByName
+ instance_profile_identity_model['name'] = 'cx2-16x32'
- # Construct a json representation of a FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByHref model
- flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_href_model_json = {}
- flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
+ reservation_identity_model = {} # ReservationIdentityById
+ reservation_identity_model['id'] = '7187-ba49df72-37b8-43ac-98da-f8e029de0e63'
+
+ instance_reservation_affinity_prototype_model = {} # InstanceReservationAffinityPrototype
+ instance_reservation_affinity_prototype_model['policy'] = 'disabled'
+ instance_reservation_affinity_prototype_model['pool'] = [reservation_identity_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'
+
+ volume_attachment_prototype_volume_model = {} # VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById
+ volume_attachment_prototype_volume_model['id'] = '1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
+
+ volume_attachment_prototype_model = {} # VolumeAttachmentPrototype
+ volume_attachment_prototype_model['delete_volume_on_instance_delete'] = False
+ volume_attachment_prototype_model['name'] = 'my-volume-attachment'
+ volume_attachment_prototype_model['volume'] = volume_attachment_prototype_volume_model
- # Construct a model instance of FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByHref by calling from_dict on the json representation
- flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_href_model = FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByHref.from_dict(flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_href_model_json)
- assert flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_href_model != False
+ vpc_identity_model = {} # VPCIdentityById
+ vpc_identity_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b'
- # Construct a model instance of FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByHref by calling from_dict on the json representation
- flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_href_model_dict = FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByHref.from_dict(flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_href_model_json).__dict__
- flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_href_model2 = FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByHref(**flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_href_model_dict)
+ encryption_key_identity_model = {} # EncryptionKeyIdentityByCRN
+ encryption_key_identity_model['crn'] = 'crn:v1:bluemix:public:kms:us-south:a/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179'
- # Verify the model instances are equivalent
- assert flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_href_model == flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_href_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
- flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_href_model_json2 = flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_href_model.to_dict()
- assert flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_href_model_json2 == flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_href_model_json
+ resource_group_identity_model = {} # ResourceGroupIdentityById
+ resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
+ volume_prototype_instance_by_image_context_model = {} # VolumePrototypeInstanceByImageContext
+ volume_prototype_instance_by_image_context_model['capacity'] = 100
+ volume_prototype_instance_by_image_context_model['encryption_key'] = encryption_key_identity_model
+ volume_prototype_instance_by_image_context_model['iops'] = 10000
+ volume_prototype_instance_by_image_context_model['name'] = 'my-volume'
+ volume_prototype_instance_by_image_context_model['profile'] = volume_profile_identity_model
+ volume_prototype_instance_by_image_context_model['resource_group'] = resource_group_identity_model
+ volume_prototype_instance_by_image_context_model['user_tags'] = []
-class TestModel_FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityById:
- """
- Test Class for FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityById
- """
+ 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_flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_id_serialization(self):
- """
- Test serialization/deserialization for FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityById
- """
+ catalog_offering_identity_model = {} # CatalogOfferingIdentityCatalogOfferingByCRN
+ catalog_offering_identity_model['crn'] = 'crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:offering:00111601-0ec5-41ac-b142-96d1e64e6442'
- # Construct a json representation of a FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityById model
- flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_id_model_json = {}
- flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_id_model_json['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
+ instance_catalog_offering_prototype_model = {} # InstanceCatalogOfferingPrototypeCatalogOfferingByOffering
+ instance_catalog_offering_prototype_model['offering'] = catalog_offering_identity_model
- # Construct a model instance of FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityById by calling from_dict on the json representation
- flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_id_model = FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityById.from_dict(flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_id_model_json)
- assert flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_id_model != False
+ zone_identity_model = {} # ZoneIdentityByName
+ zone_identity_model['name'] = 'us-south-1'
- # Construct a model instance of FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityById by calling from_dict on the json representation
- flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_id_model_dict = FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityById.from_dict(flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_id_model_json).__dict__
- flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_id_model2 = FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityById(**flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_id_model_dict)
+ virtual_network_interface_ip_prototype_model = {} # VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext
+ virtual_network_interface_ip_prototype_model['address'] = '10.0.0.5'
+ virtual_network_interface_ip_prototype_model['auto_delete'] = False
+ virtual_network_interface_ip_prototype_model['name'] = 'my-reserved-ip'
- # Verify the model instances are equivalent
- assert flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_id_model == flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_id_model2
+ virtual_network_interface_primary_ip_prototype_model = {} # VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext
+ virtual_network_interface_primary_ip_prototype_model['address'] = '10.0.0.5'
+ virtual_network_interface_primary_ip_prototype_model['auto_delete'] = False
+ virtual_network_interface_primary_ip_prototype_model['name'] = 'my-reserved-ip'
- # Convert model instance back to dict and verify no loss of data
- flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_id_model_json2 = flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_id_model.to_dict()
- assert flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_id_model_json2 == flow_log_collector_target_prototype_subnet_identity_subnet_identity_by_id_model_json
+ 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'
-class TestModel_FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByCRN:
- """
- Test Class for FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByCRN
- """
+ instance_network_attachment_prototype_virtual_network_interface_model = {} # InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeInstanceNetworkAttachmentContext
+ instance_network_attachment_prototype_virtual_network_interface_model['allow_ip_spoofing'] = True
+ instance_network_attachment_prototype_virtual_network_interface_model['auto_delete'] = False
+ instance_network_attachment_prototype_virtual_network_interface_model['enable_infrastructure_nat'] = True
+ instance_network_attachment_prototype_virtual_network_interface_model['ips'] = [virtual_network_interface_ip_prototype_model]
+ instance_network_attachment_prototype_virtual_network_interface_model['name'] = 'my-virtual-network-interface'
+ instance_network_attachment_prototype_virtual_network_interface_model['primary_ip'] = virtual_network_interface_primary_ip_prototype_model
+ instance_network_attachment_prototype_virtual_network_interface_model['resource_group'] = resource_group_identity_model
+ instance_network_attachment_prototype_virtual_network_interface_model['security_groups'] = [security_group_identity_model]
+ instance_network_attachment_prototype_virtual_network_interface_model['subnet'] = subnet_identity_model
- def test_flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_crn_serialization(self):
- """
- Test serialization/deserialization for FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByCRN
- """
+ instance_network_attachment_prototype_model = {} # InstanceNetworkAttachmentPrototype
+ instance_network_attachment_prototype_model['name'] = 'my-instance-network-attachment'
+ instance_network_attachment_prototype_model['virtual_network_interface'] = instance_network_attachment_prototype_virtual_network_interface_model
- # Construct a json representation of a FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByCRN model
- flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_crn_model_json = {}
- flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_crn_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b'
+ # Construct a json representation of a InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkAttachment model
+ instance_template_instance_by_catalog_offering_instance_template_context_instance_by_catalog_offering_instance_template_context_instance_by_network_attachment_model_json = {}
+ instance_template_instance_by_catalog_offering_instance_template_context_instance_by_catalog_offering_instance_template_context_instance_by_network_attachment_model_json['availability_policy'] = instance_availability_policy_prototype_model
+ instance_template_instance_by_catalog_offering_instance_template_context_instance_by_catalog_offering_instance_template_context_instance_by_network_attachment_model_json['created_at'] = '2019-01-01T12:00:00Z'
+ instance_template_instance_by_catalog_offering_instance_template_context_instance_by_catalog_offering_instance_template_context_instance_by_network_attachment_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a'
+ instance_template_instance_by_catalog_offering_instance_template_context_instance_by_catalog_offering_instance_template_context_instance_by_network_attachment_model_json['default_trusted_profile'] = instance_default_trusted_profile_prototype_model
+ instance_template_instance_by_catalog_offering_instance_template_context_instance_by_catalog_offering_instance_template_context_instance_by_network_attachment_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a'
+ instance_template_instance_by_catalog_offering_instance_template_context_instance_by_catalog_offering_instance_template_context_instance_by_network_attachment_model_json['id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803'
+ instance_template_instance_by_catalog_offering_instance_template_context_instance_by_catalog_offering_instance_template_context_instance_by_network_attachment_model_json['keys'] = [key_identity_model]
+ instance_template_instance_by_catalog_offering_instance_template_context_instance_by_catalog_offering_instance_template_context_instance_by_network_attachment_model_json['metadata_service'] = instance_metadata_service_prototype_model
+ instance_template_instance_by_catalog_offering_instance_template_context_instance_by_catalog_offering_instance_template_context_instance_by_network_attachment_model_json['name'] = 'my-instance-template'
+ instance_template_instance_by_catalog_offering_instance_template_context_instance_by_catalog_offering_instance_template_context_instance_by_network_attachment_model_json['placement_target'] = instance_placement_target_prototype_model
+ instance_template_instance_by_catalog_offering_instance_template_context_instance_by_catalog_offering_instance_template_context_instance_by_network_attachment_model_json['profile'] = instance_profile_identity_model
+ instance_template_instance_by_catalog_offering_instance_template_context_instance_by_catalog_offering_instance_template_context_instance_by_network_attachment_model_json['reservation_affinity'] = instance_reservation_affinity_prototype_model
+ instance_template_instance_by_catalog_offering_instance_template_context_instance_by_catalog_offering_instance_template_context_instance_by_network_attachment_model_json['resource_group'] = resource_group_reference_model
+ instance_template_instance_by_catalog_offering_instance_template_context_instance_by_catalog_offering_instance_template_context_instance_by_network_attachment_model_json['total_volume_bandwidth'] = 500
+ instance_template_instance_by_catalog_offering_instance_template_context_instance_by_catalog_offering_instance_template_context_instance_by_network_attachment_model_json['user_data'] = 'testString'
+ instance_template_instance_by_catalog_offering_instance_template_context_instance_by_catalog_offering_instance_template_context_instance_by_network_attachment_model_json['volume_attachments'] = [volume_attachment_prototype_model]
+ instance_template_instance_by_catalog_offering_instance_template_context_instance_by_catalog_offering_instance_template_context_instance_by_network_attachment_model_json['vpc'] = vpc_identity_model
+ instance_template_instance_by_catalog_offering_instance_template_context_instance_by_catalog_offering_instance_template_context_instance_by_network_attachment_model_json['boot_volume_attachment'] = volume_attachment_prototype_instance_by_image_context_model
+ instance_template_instance_by_catalog_offering_instance_template_context_instance_by_catalog_offering_instance_template_context_instance_by_network_attachment_model_json['catalog_offering'] = instance_catalog_offering_prototype_model
+ instance_template_instance_by_catalog_offering_instance_template_context_instance_by_catalog_offering_instance_template_context_instance_by_network_attachment_model_json['zone'] = zone_identity_model
+ instance_template_instance_by_catalog_offering_instance_template_context_instance_by_catalog_offering_instance_template_context_instance_by_network_attachment_model_json['network_attachments'] = [instance_network_attachment_prototype_model]
+ instance_template_instance_by_catalog_offering_instance_template_context_instance_by_catalog_offering_instance_template_context_instance_by_network_attachment_model_json['primary_network_attachment'] = instance_network_attachment_prototype_model
- # Construct a model instance of FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByCRN by calling from_dict on the json representation
- flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_crn_model = FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByCRN.from_dict(flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_crn_model_json)
- assert flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_crn_model != False
+ # Construct a model instance of InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkAttachment by calling from_dict on the json representation
+ instance_template_instance_by_catalog_offering_instance_template_context_instance_by_catalog_offering_instance_template_context_instance_by_network_attachment_model = InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkAttachment.from_dict(instance_template_instance_by_catalog_offering_instance_template_context_instance_by_catalog_offering_instance_template_context_instance_by_network_attachment_model_json)
+ assert instance_template_instance_by_catalog_offering_instance_template_context_instance_by_catalog_offering_instance_template_context_instance_by_network_attachment_model != False
- # Construct a model instance of FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByCRN by calling from_dict on the json representation
- flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_crn_model_dict = FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByCRN.from_dict(flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_crn_model_json).__dict__
- flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_crn_model2 = FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByCRN(**flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_crn_model_dict)
+ # Construct a model instance of InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkAttachment by calling from_dict on the json representation
+ instance_template_instance_by_catalog_offering_instance_template_context_instance_by_catalog_offering_instance_template_context_instance_by_network_attachment_model_dict = InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkAttachment.from_dict(instance_template_instance_by_catalog_offering_instance_template_context_instance_by_catalog_offering_instance_template_context_instance_by_network_attachment_model_json).__dict__
+ instance_template_instance_by_catalog_offering_instance_template_context_instance_by_catalog_offering_instance_template_context_instance_by_network_attachment_model2 = InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkAttachment(**instance_template_instance_by_catalog_offering_instance_template_context_instance_by_catalog_offering_instance_template_context_instance_by_network_attachment_model_dict)
# Verify the model instances are equivalent
- assert flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_crn_model == flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_crn_model2
+ assert instance_template_instance_by_catalog_offering_instance_template_context_instance_by_catalog_offering_instance_template_context_instance_by_network_attachment_model == instance_template_instance_by_catalog_offering_instance_template_context_instance_by_catalog_offering_instance_template_context_instance_by_network_attachment_model2
# Convert model instance back to dict and verify no loss of data
- flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_crn_model_json2 = flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_crn_model.to_dict()
- assert flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_crn_model_json2 == flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_crn_model_json
+ instance_template_instance_by_catalog_offering_instance_template_context_instance_by_catalog_offering_instance_template_context_instance_by_network_attachment_model_json2 = instance_template_instance_by_catalog_offering_instance_template_context_instance_by_catalog_offering_instance_template_context_instance_by_network_attachment_model.to_dict()
+ assert instance_template_instance_by_catalog_offering_instance_template_context_instance_by_catalog_offering_instance_template_context_instance_by_network_attachment_model_json2 == instance_template_instance_by_catalog_offering_instance_template_context_instance_by_catalog_offering_instance_template_context_instance_by_network_attachment_model_json
-class TestModel_FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByHref:
+class TestModel_InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkInterface:
"""
- Test Class for FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByHref
+ Test Class for InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkInterface
"""
- def test_flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_href_serialization(self):
+ def test_instance_template_instance_by_catalog_offering_instance_template_context_instance_by_catalog_offering_instance_template_context_instance_by_network_interface_serialization(self):
"""
- Test serialization/deserialization for FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByHref
+ Test serialization/deserialization for InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkInterface
"""
- # Construct a json representation of a FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByHref model
- flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_href_model_json = {}
- flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b'
-
- # Construct a model instance of FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByHref by calling from_dict on the json representation
- flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_href_model = FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByHref.from_dict(flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_href_model_json)
- assert flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_href_model != False
-
- # Construct a model instance of FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByHref by calling from_dict on the json representation
- flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_href_model_dict = FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByHref.from_dict(flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_href_model_json).__dict__
- flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_href_model2 = FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByHref(**flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_href_model_dict)
-
- # Verify the model instances are equivalent
- assert flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_href_model == flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_href_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
- flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_href_model_json2 = flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_href_model.to_dict()
- assert flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_href_model_json2 == flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_href_model_json
+ instance_availability_policy_prototype_model = {} # InstanceAvailabilityPolicyPrototype
+ instance_availability_policy_prototype_model['host_failure'] = 'restart'
+ trusted_profile_identity_model = {} # TrustedProfileIdentityTrustedProfileById
+ trusted_profile_identity_model['id'] = 'Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5'
-class TestModel_FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityById:
- """
- Test Class for FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityById
- """
+ instance_default_trusted_profile_prototype_model = {} # InstanceDefaultTrustedProfilePrototype
+ instance_default_trusted_profile_prototype_model['auto_link'] = False
+ instance_default_trusted_profile_prototype_model['target'] = trusted_profile_identity_model
- def test_flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_id_serialization(self):
- """
- Test serialization/deserialization for FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityById
- """
+ key_identity_model = {} # KeyIdentityById
+ key_identity_model['id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803'
- # Construct a json representation of a FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityById model
- flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_id_model_json = {}
- flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_id_model_json['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b'
+ instance_metadata_service_prototype_model = {} # InstanceMetadataServicePrototype
+ instance_metadata_service_prototype_model['enabled'] = False
+ instance_metadata_service_prototype_model['protocol'] = 'https'
+ instance_metadata_service_prototype_model['response_hop_limit'] = 2
- # Construct a model instance of FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityById by calling from_dict on the json representation
- flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_id_model = FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityById.from_dict(flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_id_model_json)
- assert flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_id_model != False
+ instance_placement_target_prototype_model = {} # InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById
+ instance_placement_target_prototype_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
- # Construct a model instance of FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityById by calling from_dict on the json representation
- flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_id_model_dict = FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityById.from_dict(flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_id_model_json).__dict__
- flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_id_model2 = FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityById(**flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_id_model_dict)
+ instance_profile_identity_model = {} # InstanceProfileIdentityByName
+ instance_profile_identity_model['name'] = 'cx2-16x32'
- # Verify the model instances are equivalent
- assert flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_id_model == flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_id_model2
+ reservation_identity_model = {} # ReservationIdentityById
+ reservation_identity_model['id'] = '7187-ba49df72-37b8-43ac-98da-f8e029de0e63'
- # Convert model instance back to dict and verify no loss of data
- flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_id_model_json2 = flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_id_model.to_dict()
- assert flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_id_model_json2 == flow_log_collector_target_prototype_vpc_identity_vpc_identity_by_id_model_json
+ instance_reservation_affinity_prototype_model = {} # InstanceReservationAffinityPrototype
+ instance_reservation_affinity_prototype_model['policy'] = 'disabled'
+ instance_reservation_affinity_prototype_model['pool'] = [reservation_identity_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'
-class TestModel_InstanceGroupManagerActionScheduledActionGroupTarget:
- """
- Test Class for InstanceGroupManagerActionScheduledActionGroupTarget
- """
+ volume_attachment_prototype_volume_model = {} # VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById
+ volume_attachment_prototype_volume_model['id'] = '1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
- def test_instance_group_manager_action_scheduled_action_group_target_serialization(self):
- """
- Test serialization/deserialization for InstanceGroupManagerActionScheduledActionGroupTarget
- """
+ volume_attachment_prototype_model = {} # VolumeAttachmentPrototype
+ volume_attachment_prototype_model['delete_volume_on_instance_delete'] = False
+ volume_attachment_prototype_model['name'] = 'my-volume-attachment'
+ volume_attachment_prototype_model['volume'] = volume_attachment_prototype_volume_model
- # Construct dict forms of any model objects needed in order to build this model.
+ vpc_identity_model = {} # VPCIdentityById
+ vpc_identity_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b'
- instance_group_manager_scheduled_action_group_model = {} # InstanceGroupManagerScheduledActionGroup
- instance_group_manager_scheduled_action_group_model['membership_count'] = 10
+ encryption_key_identity_model = {} # EncryptionKeyIdentityByCRN
+ encryption_key_identity_model['crn'] = 'crn:v1:bluemix:public:kms:us-south:a/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179'
- # Construct a json representation of a InstanceGroupManagerActionScheduledActionGroupTarget model
- instance_group_manager_action_scheduled_action_group_target_model_json = {}
- instance_group_manager_action_scheduled_action_group_target_model_json['auto_delete'] = True
- instance_group_manager_action_scheduled_action_group_target_model_json['auto_delete_timeout'] = 24
- instance_group_manager_action_scheduled_action_group_target_model_json['created_at'] = '2019-01-01T12:00:00Z'
- instance_group_manager_action_scheduled_action_group_target_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_scheduled_action_group_target_model_json['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
- instance_group_manager_action_scheduled_action_group_target_model_json['name'] = 'my-instance-group-manager-action'
- instance_group_manager_action_scheduled_action_group_target_model_json['resource_type'] = 'instance_group_manager_action'
- instance_group_manager_action_scheduled_action_group_target_model_json['status'] = 'active'
- instance_group_manager_action_scheduled_action_group_target_model_json['updated_at'] = '2019-01-01T12:00:00Z'
- instance_group_manager_action_scheduled_action_group_target_model_json['action_type'] = 'scheduled'
- instance_group_manager_action_scheduled_action_group_target_model_json['cron_spec'] = '30 */2 * * 1-5'
- instance_group_manager_action_scheduled_action_group_target_model_json['last_applied_at'] = '2019-01-01T12:00:00Z'
- instance_group_manager_action_scheduled_action_group_target_model_json['next_run_at'] = '2019-01-01T12:00:00Z'
- instance_group_manager_action_scheduled_action_group_target_model_json['group'] = instance_group_manager_scheduled_action_group_model
+ volume_profile_identity_model = {} # VolumeProfileIdentityByName
+ volume_profile_identity_model['name'] = 'general-purpose'
- # Construct a model instance of InstanceGroupManagerActionScheduledActionGroupTarget by calling from_dict on the json representation
- instance_group_manager_action_scheduled_action_group_target_model = InstanceGroupManagerActionScheduledActionGroupTarget.from_dict(instance_group_manager_action_scheduled_action_group_target_model_json)
- assert instance_group_manager_action_scheduled_action_group_target_model != False
+ resource_group_identity_model = {} # ResourceGroupIdentityById
+ resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
- # Construct a model instance of InstanceGroupManagerActionScheduledActionGroupTarget by calling from_dict on the json representation
- instance_group_manager_action_scheduled_action_group_target_model_dict = InstanceGroupManagerActionScheduledActionGroupTarget.from_dict(instance_group_manager_action_scheduled_action_group_target_model_json).__dict__
- instance_group_manager_action_scheduled_action_group_target_model2 = InstanceGroupManagerActionScheduledActionGroupTarget(**instance_group_manager_action_scheduled_action_group_target_model_dict)
+ volume_prototype_instance_by_image_context_model = {} # VolumePrototypeInstanceByImageContext
+ volume_prototype_instance_by_image_context_model['capacity'] = 100
+ volume_prototype_instance_by_image_context_model['encryption_key'] = encryption_key_identity_model
+ volume_prototype_instance_by_image_context_model['iops'] = 10000
+ volume_prototype_instance_by_image_context_model['name'] = 'my-volume'
+ volume_prototype_instance_by_image_context_model['profile'] = volume_profile_identity_model
+ volume_prototype_instance_by_image_context_model['resource_group'] = resource_group_identity_model
+ volume_prototype_instance_by_image_context_model['user_tags'] = []
- # Verify the model instances are equivalent
- assert instance_group_manager_action_scheduled_action_group_target_model == instance_group_manager_action_scheduled_action_group_target_model2
+ 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
- # Convert model instance back to dict and verify no loss of data
- instance_group_manager_action_scheduled_action_group_target_model_json2 = instance_group_manager_action_scheduled_action_group_target_model.to_dict()
- assert instance_group_manager_action_scheduled_action_group_target_model_json2 == instance_group_manager_action_scheduled_action_group_target_model_json
+ catalog_offering_identity_model = {} # CatalogOfferingIdentityCatalogOfferingByCRN
+ catalog_offering_identity_model['crn'] = 'crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:offering:00111601-0ec5-41ac-b142-96d1e64e6442'
+ instance_catalog_offering_prototype_model = {} # InstanceCatalogOfferingPrototypeCatalogOfferingByOffering
+ instance_catalog_offering_prototype_model['offering'] = catalog_offering_identity_model
-class TestModel_InstanceGroupManagerActionScheduledActionManagerTarget:
- """
- Test Class for InstanceGroupManagerActionScheduledActionManagerTarget
- """
+ zone_identity_model = {} # ZoneIdentityByName
+ zone_identity_model['name'] = 'us-south-1'
- def test_instance_group_manager_action_scheduled_action_manager_target_serialization(self):
- """
- Test serialization/deserialization for InstanceGroupManagerActionScheduledActionManagerTarget
- """
+ network_interface_ip_prototype_model = {} # NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext
+ network_interface_ip_prototype_model['address'] = '10.0.0.5'
+ network_interface_ip_prototype_model['auto_delete'] = False
+ network_interface_ip_prototype_model['name'] = 'my-reserved-ip'
- # 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'
- instance_group_manager_reference_deleted_model = {} # InstanceGroupManagerReferenceDeleted
- instance_group_manager_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ subnet_identity_model = {} # SubnetIdentityById
+ subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
- instance_group_manager_scheduled_action_manager_model = {} # InstanceGroupManagerScheduledActionManagerAutoScale
- instance_group_manager_scheduled_action_manager_model['deleted'] = instance_group_manager_reference_deleted_model
- instance_group_manager_scheduled_action_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_scheduled_action_manager_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
- instance_group_manager_scheduled_action_manager_model['name'] = 'my-instance-group-manager'
- instance_group_manager_scheduled_action_manager_model['max_membership_count'] = 10
- instance_group_manager_scheduled_action_manager_model['min_membership_count'] = 10
+ network_interface_prototype_model = {} # NetworkInterfacePrototype
+ network_interface_prototype_model['allow_ip_spoofing'] = True
+ network_interface_prototype_model['name'] = 'my-instance-network-interface'
+ network_interface_prototype_model['primary_ip'] = network_interface_ip_prototype_model
+ network_interface_prototype_model['security_groups'] = [security_group_identity_model]
+ network_interface_prototype_model['subnet'] = subnet_identity_model
- # Construct a json representation of a InstanceGroupManagerActionScheduledActionManagerTarget model
- instance_group_manager_action_scheduled_action_manager_target_model_json = {}
- instance_group_manager_action_scheduled_action_manager_target_model_json['auto_delete'] = True
- instance_group_manager_action_scheduled_action_manager_target_model_json['auto_delete_timeout'] = 24
- instance_group_manager_action_scheduled_action_manager_target_model_json['created_at'] = '2019-01-01T12:00:00Z'
- instance_group_manager_action_scheduled_action_manager_target_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_scheduled_action_manager_target_model_json['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
- instance_group_manager_action_scheduled_action_manager_target_model_json['name'] = 'my-instance-group-manager-action'
- instance_group_manager_action_scheduled_action_manager_target_model_json['resource_type'] = 'instance_group_manager_action'
- instance_group_manager_action_scheduled_action_manager_target_model_json['status'] = 'active'
- instance_group_manager_action_scheduled_action_manager_target_model_json['updated_at'] = '2019-01-01T12:00:00Z'
- instance_group_manager_action_scheduled_action_manager_target_model_json['action_type'] = 'scheduled'
- instance_group_manager_action_scheduled_action_manager_target_model_json['cron_spec'] = '30 */2 * * 1-5'
- instance_group_manager_action_scheduled_action_manager_target_model_json['last_applied_at'] = '2019-01-01T12:00:00Z'
- instance_group_manager_action_scheduled_action_manager_target_model_json['next_run_at'] = '2019-01-01T12:00:00Z'
- instance_group_manager_action_scheduled_action_manager_target_model_json['manager'] = instance_group_manager_scheduled_action_manager_model
+ # Construct a json representation of a InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkInterface model
+ instance_template_instance_by_catalog_offering_instance_template_context_instance_by_catalog_offering_instance_template_context_instance_by_network_interface_model_json = {}
+ instance_template_instance_by_catalog_offering_instance_template_context_instance_by_catalog_offering_instance_template_context_instance_by_network_interface_model_json['availability_policy'] = instance_availability_policy_prototype_model
+ instance_template_instance_by_catalog_offering_instance_template_context_instance_by_catalog_offering_instance_template_context_instance_by_network_interface_model_json['created_at'] = '2019-01-01T12:00:00Z'
+ instance_template_instance_by_catalog_offering_instance_template_context_instance_by_catalog_offering_instance_template_context_instance_by_network_interface_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a'
+ instance_template_instance_by_catalog_offering_instance_template_context_instance_by_catalog_offering_instance_template_context_instance_by_network_interface_model_json['default_trusted_profile'] = instance_default_trusted_profile_prototype_model
+ instance_template_instance_by_catalog_offering_instance_template_context_instance_by_catalog_offering_instance_template_context_instance_by_network_interface_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a'
+ instance_template_instance_by_catalog_offering_instance_template_context_instance_by_catalog_offering_instance_template_context_instance_by_network_interface_model_json['id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803'
+ instance_template_instance_by_catalog_offering_instance_template_context_instance_by_catalog_offering_instance_template_context_instance_by_network_interface_model_json['keys'] = [key_identity_model]
+ instance_template_instance_by_catalog_offering_instance_template_context_instance_by_catalog_offering_instance_template_context_instance_by_network_interface_model_json['metadata_service'] = instance_metadata_service_prototype_model
+ instance_template_instance_by_catalog_offering_instance_template_context_instance_by_catalog_offering_instance_template_context_instance_by_network_interface_model_json['name'] = 'my-instance-template'
+ instance_template_instance_by_catalog_offering_instance_template_context_instance_by_catalog_offering_instance_template_context_instance_by_network_interface_model_json['placement_target'] = instance_placement_target_prototype_model
+ instance_template_instance_by_catalog_offering_instance_template_context_instance_by_catalog_offering_instance_template_context_instance_by_network_interface_model_json['profile'] = instance_profile_identity_model
+ instance_template_instance_by_catalog_offering_instance_template_context_instance_by_catalog_offering_instance_template_context_instance_by_network_interface_model_json['reservation_affinity'] = instance_reservation_affinity_prototype_model
+ instance_template_instance_by_catalog_offering_instance_template_context_instance_by_catalog_offering_instance_template_context_instance_by_network_interface_model_json['resource_group'] = resource_group_reference_model
+ instance_template_instance_by_catalog_offering_instance_template_context_instance_by_catalog_offering_instance_template_context_instance_by_network_interface_model_json['total_volume_bandwidth'] = 500
+ instance_template_instance_by_catalog_offering_instance_template_context_instance_by_catalog_offering_instance_template_context_instance_by_network_interface_model_json['user_data'] = 'testString'
+ instance_template_instance_by_catalog_offering_instance_template_context_instance_by_catalog_offering_instance_template_context_instance_by_network_interface_model_json['volume_attachments'] = [volume_attachment_prototype_model]
+ instance_template_instance_by_catalog_offering_instance_template_context_instance_by_catalog_offering_instance_template_context_instance_by_network_interface_model_json['vpc'] = vpc_identity_model
+ instance_template_instance_by_catalog_offering_instance_template_context_instance_by_catalog_offering_instance_template_context_instance_by_network_interface_model_json['boot_volume_attachment'] = volume_attachment_prototype_instance_by_image_context_model
+ instance_template_instance_by_catalog_offering_instance_template_context_instance_by_catalog_offering_instance_template_context_instance_by_network_interface_model_json['catalog_offering'] = instance_catalog_offering_prototype_model
+ instance_template_instance_by_catalog_offering_instance_template_context_instance_by_catalog_offering_instance_template_context_instance_by_network_interface_model_json['zone'] = zone_identity_model
+ instance_template_instance_by_catalog_offering_instance_template_context_instance_by_catalog_offering_instance_template_context_instance_by_network_interface_model_json['network_interfaces'] = [network_interface_prototype_model]
+ instance_template_instance_by_catalog_offering_instance_template_context_instance_by_catalog_offering_instance_template_context_instance_by_network_interface_model_json['primary_network_interface'] = network_interface_prototype_model
- # Construct a model instance of InstanceGroupManagerActionScheduledActionManagerTarget by calling from_dict on the json representation
- instance_group_manager_action_scheduled_action_manager_target_model = InstanceGroupManagerActionScheduledActionManagerTarget.from_dict(instance_group_manager_action_scheduled_action_manager_target_model_json)
- assert instance_group_manager_action_scheduled_action_manager_target_model != False
+ # Construct a model instance of InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkInterface by calling from_dict on the json representation
+ instance_template_instance_by_catalog_offering_instance_template_context_instance_by_catalog_offering_instance_template_context_instance_by_network_interface_model = InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkInterface.from_dict(instance_template_instance_by_catalog_offering_instance_template_context_instance_by_catalog_offering_instance_template_context_instance_by_network_interface_model_json)
+ assert instance_template_instance_by_catalog_offering_instance_template_context_instance_by_catalog_offering_instance_template_context_instance_by_network_interface_model != False
- # Construct a model instance of InstanceGroupManagerActionScheduledActionManagerTarget by calling from_dict on the json representation
- instance_group_manager_action_scheduled_action_manager_target_model_dict = InstanceGroupManagerActionScheduledActionManagerTarget.from_dict(instance_group_manager_action_scheduled_action_manager_target_model_json).__dict__
- instance_group_manager_action_scheduled_action_manager_target_model2 = InstanceGroupManagerActionScheduledActionManagerTarget(**instance_group_manager_action_scheduled_action_manager_target_model_dict)
+ # Construct a model instance of InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkInterface by calling from_dict on the json representation
+ instance_template_instance_by_catalog_offering_instance_template_context_instance_by_catalog_offering_instance_template_context_instance_by_network_interface_model_dict = InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkInterface.from_dict(instance_template_instance_by_catalog_offering_instance_template_context_instance_by_catalog_offering_instance_template_context_instance_by_network_interface_model_json).__dict__
+ instance_template_instance_by_catalog_offering_instance_template_context_instance_by_catalog_offering_instance_template_context_instance_by_network_interface_model2 = InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkInterface(**instance_template_instance_by_catalog_offering_instance_template_context_instance_by_catalog_offering_instance_template_context_instance_by_network_interface_model_dict)
# Verify the model instances are equivalent
- assert instance_group_manager_action_scheduled_action_manager_target_model == instance_group_manager_action_scheduled_action_manager_target_model2
+ assert instance_template_instance_by_catalog_offering_instance_template_context_instance_by_catalog_offering_instance_template_context_instance_by_network_interface_model == instance_template_instance_by_catalog_offering_instance_template_context_instance_by_catalog_offering_instance_template_context_instance_by_network_interface_model2
# Convert model instance back to dict and verify no loss of data
- instance_group_manager_action_scheduled_action_manager_target_model_json2 = instance_group_manager_action_scheduled_action_manager_target_model.to_dict()
- assert instance_group_manager_action_scheduled_action_manager_target_model_json2 == instance_group_manager_action_scheduled_action_manager_target_model_json
+ instance_template_instance_by_catalog_offering_instance_template_context_instance_by_catalog_offering_instance_template_context_instance_by_network_interface_model_json2 = instance_template_instance_by_catalog_offering_instance_template_context_instance_by_catalog_offering_instance_template_context_instance_by_network_interface_model.to_dict()
+ assert instance_template_instance_by_catalog_offering_instance_template_context_instance_by_catalog_offering_instance_template_context_instance_by_network_interface_model_json2 == instance_template_instance_by_catalog_offering_instance_template_context_instance_by_catalog_offering_instance_template_context_instance_by_network_interface_model_json
-class TestModel_InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByHref:
+class TestModel_InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkAttachment:
"""
- Test Class for InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByHref
+ Test Class for InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkAttachment
"""
- def test_instance_group_manager_scheduled_action_manager_prototype_auto_scale_prototype_by_href_serialization(self):
+ def test_instance_template_instance_by_image_instance_template_context_instance_by_image_instance_template_context_instance_by_network_attachment_serialization(self):
"""
- Test serialization/deserialization for InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByHref
+ Test serialization/deserialization for InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkAttachment
"""
- # Construct a json representation of a InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByHref model
- instance_group_manager_scheduled_action_manager_prototype_auto_scale_prototype_by_href_model_json = {}
- instance_group_manager_scheduled_action_manager_prototype_auto_scale_prototype_by_href_model_json['max_membership_count'] = 10
- instance_group_manager_scheduled_action_manager_prototype_auto_scale_prototype_by_href_model_json['min_membership_count'] = 10
- instance_group_manager_scheduled_action_manager_prototype_auto_scale_prototype_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/managers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727'
+ # Construct dict forms of any model objects needed in order to build this model.
- # Construct a model instance of InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByHref by calling from_dict on the json representation
- instance_group_manager_scheduled_action_manager_prototype_auto_scale_prototype_by_href_model = InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByHref.from_dict(instance_group_manager_scheduled_action_manager_prototype_auto_scale_prototype_by_href_model_json)
- assert instance_group_manager_scheduled_action_manager_prototype_auto_scale_prototype_by_href_model != False
+ instance_availability_policy_prototype_model = {} # InstanceAvailabilityPolicyPrototype
+ instance_availability_policy_prototype_model['host_failure'] = 'restart'
- # Construct a model instance of InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByHref by calling from_dict on the json representation
- instance_group_manager_scheduled_action_manager_prototype_auto_scale_prototype_by_href_model_dict = InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByHref.from_dict(instance_group_manager_scheduled_action_manager_prototype_auto_scale_prototype_by_href_model_json).__dict__
- instance_group_manager_scheduled_action_manager_prototype_auto_scale_prototype_by_href_model2 = InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByHref(**instance_group_manager_scheduled_action_manager_prototype_auto_scale_prototype_by_href_model_dict)
+ trusted_profile_identity_model = {} # TrustedProfileIdentityTrustedProfileById
+ trusted_profile_identity_model['id'] = 'Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5'
- # Verify the model instances are equivalent
- assert instance_group_manager_scheduled_action_manager_prototype_auto_scale_prototype_by_href_model == instance_group_manager_scheduled_action_manager_prototype_auto_scale_prototype_by_href_model2
+ instance_default_trusted_profile_prototype_model = {} # InstanceDefaultTrustedProfilePrototype
+ instance_default_trusted_profile_prototype_model['auto_link'] = False
+ instance_default_trusted_profile_prototype_model['target'] = trusted_profile_identity_model
- # Convert model instance back to dict and verify no loss of data
- instance_group_manager_scheduled_action_manager_prototype_auto_scale_prototype_by_href_model_json2 = instance_group_manager_scheduled_action_manager_prototype_auto_scale_prototype_by_href_model.to_dict()
- assert instance_group_manager_scheduled_action_manager_prototype_auto_scale_prototype_by_href_model_json2 == instance_group_manager_scheduled_action_manager_prototype_auto_scale_prototype_by_href_model_json
+ key_identity_model = {} # KeyIdentityById
+ key_identity_model['id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803'
+ instance_metadata_service_prototype_model = {} # InstanceMetadataServicePrototype
+ instance_metadata_service_prototype_model['enabled'] = False
+ instance_metadata_service_prototype_model['protocol'] = 'https'
+ instance_metadata_service_prototype_model['response_hop_limit'] = 2
-class TestModel_InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeById:
- """
- Test Class for InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeById
- """
+ instance_placement_target_prototype_model = {} # InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById
+ instance_placement_target_prototype_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
- def test_instance_group_manager_scheduled_action_manager_prototype_auto_scale_prototype_by_id_serialization(self):
- """
- Test serialization/deserialization for InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeById
- """
+ instance_profile_identity_model = {} # InstanceProfileIdentityByName
+ instance_profile_identity_model['name'] = 'cx2-16x32'
- # Construct a json representation of a InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeById model
- instance_group_manager_scheduled_action_manager_prototype_auto_scale_prototype_by_id_model_json = {}
- instance_group_manager_scheduled_action_manager_prototype_auto_scale_prototype_by_id_model_json['max_membership_count'] = 10
- instance_group_manager_scheduled_action_manager_prototype_auto_scale_prototype_by_id_model_json['min_membership_count'] = 10
- instance_group_manager_scheduled_action_manager_prototype_auto_scale_prototype_by_id_model_json['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
+ reservation_identity_model = {} # ReservationIdentityById
+ reservation_identity_model['id'] = '7187-ba49df72-37b8-43ac-98da-f8e029de0e63'
- # Construct a model instance of InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeById by calling from_dict on the json representation
- instance_group_manager_scheduled_action_manager_prototype_auto_scale_prototype_by_id_model = InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeById.from_dict(instance_group_manager_scheduled_action_manager_prototype_auto_scale_prototype_by_id_model_json)
- assert instance_group_manager_scheduled_action_manager_prototype_auto_scale_prototype_by_id_model != False
+ instance_reservation_affinity_prototype_model = {} # InstanceReservationAffinityPrototype
+ instance_reservation_affinity_prototype_model['policy'] = 'disabled'
+ instance_reservation_affinity_prototype_model['pool'] = [reservation_identity_model]
- # Construct a model instance of InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeById by calling from_dict on the json representation
- instance_group_manager_scheduled_action_manager_prototype_auto_scale_prototype_by_id_model_dict = InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeById.from_dict(instance_group_manager_scheduled_action_manager_prototype_auto_scale_prototype_by_id_model_json).__dict__
- instance_group_manager_scheduled_action_manager_prototype_auto_scale_prototype_by_id_model2 = InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeById(**instance_group_manager_scheduled_action_manager_prototype_auto_scale_prototype_by_id_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 instance_group_manager_scheduled_action_manager_prototype_auto_scale_prototype_by_id_model == instance_group_manager_scheduled_action_manager_prototype_auto_scale_prototype_by_id_model2
+ volume_attachment_prototype_volume_model = {} # VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById
+ volume_attachment_prototype_volume_model['id'] = '1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
- # Convert model instance back to dict and verify no loss of data
- 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
+ volume_attachment_prototype_model = {} # VolumeAttachmentPrototype
+ volume_attachment_prototype_model['delete_volume_on_instance_delete'] = False
+ volume_attachment_prototype_model['name'] = 'my-volume-attachment'
+ volume_attachment_prototype_model['volume'] = volume_attachment_prototype_volume_model
+ vpc_identity_model = {} # VPCIdentityById
+ vpc_identity_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b'
-class TestModel_InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN:
- """
- Test Class for InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN
- """
+ encryption_key_identity_model = {} # EncryptionKeyIdentityByCRN
+ encryption_key_identity_model['crn'] = 'crn:v1:bluemix:public:kms:us-south:a/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179'
- def test_instance_placement_target_patch_dedicated_host_group_identity_dedicated_host_group_identity_by_crn_serialization(self):
- """
- Test serialization/deserialization for InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN
- """
+ volume_profile_identity_model = {} # VolumeProfileIdentityByName
+ volume_profile_identity_model['name'] = 'general-purpose'
- # 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'
+ resource_group_identity_model = {} # ResourceGroupIdentityById
+ resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
- # 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
+ volume_prototype_instance_by_image_context_model = {} # VolumePrototypeInstanceByImageContext
+ volume_prototype_instance_by_image_context_model['capacity'] = 100
+ volume_prototype_instance_by_image_context_model['encryption_key'] = encryption_key_identity_model
+ volume_prototype_instance_by_image_context_model['iops'] = 10000
+ volume_prototype_instance_by_image_context_model['name'] = 'my-volume'
+ volume_prototype_instance_by_image_context_model['profile'] = volume_profile_identity_model
+ volume_prototype_instance_by_image_context_model['resource_group'] = resource_group_identity_model
+ volume_prototype_instance_by_image_context_model['user_tags'] = []
- # 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)
+ 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
- # 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
+ image_identity_model = {} # ImageIdentityById
+ image_identity_model['id'] = 'r006-02c73baf-9abb-493d-9e41-d0f1866f4051'
- # 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
+ zone_identity_model = {} # ZoneIdentityByName
+ zone_identity_model['name'] = 'us-south-1'
+ virtual_network_interface_ip_prototype_model = {} # VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext
+ virtual_network_interface_ip_prototype_model['address'] = '10.0.0.5'
+ virtual_network_interface_ip_prototype_model['auto_delete'] = False
+ virtual_network_interface_ip_prototype_model['name'] = 'my-reserved-ip'
-class TestModel_InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref:
- """
- Test Class for InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref
- """
+ virtual_network_interface_primary_ip_prototype_model = {} # VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext
+ virtual_network_interface_primary_ip_prototype_model['address'] = '10.0.0.5'
+ virtual_network_interface_primary_ip_prototype_model['auto_delete'] = False
+ virtual_network_interface_primary_ip_prototype_model['name'] = 'my-reserved-ip'
- def test_instance_placement_target_patch_dedicated_host_group_identity_dedicated_host_group_identity_by_href_serialization(self):
- """
- Test serialization/deserialization for InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref
- """
+ security_group_identity_model = {} # SecurityGroupIdentityById
+ security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271'
- # 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'
+ subnet_identity_model = {} # SubnetIdentityById
+ subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
- # 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
+ instance_network_attachment_prototype_virtual_network_interface_model = {} # InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeInstanceNetworkAttachmentContext
+ instance_network_attachment_prototype_virtual_network_interface_model['allow_ip_spoofing'] = True
+ instance_network_attachment_prototype_virtual_network_interface_model['auto_delete'] = False
+ instance_network_attachment_prototype_virtual_network_interface_model['enable_infrastructure_nat'] = True
+ instance_network_attachment_prototype_virtual_network_interface_model['ips'] = [virtual_network_interface_ip_prototype_model]
+ instance_network_attachment_prototype_virtual_network_interface_model['name'] = 'my-virtual-network-interface'
+ instance_network_attachment_prototype_virtual_network_interface_model['primary_ip'] = virtual_network_interface_primary_ip_prototype_model
+ instance_network_attachment_prototype_virtual_network_interface_model['resource_group'] = resource_group_identity_model
+ instance_network_attachment_prototype_virtual_network_interface_model['security_groups'] = [security_group_identity_model]
+ instance_network_attachment_prototype_virtual_network_interface_model['subnet'] = subnet_identity_model
- # 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)
+ instance_network_attachment_prototype_model = {} # InstanceNetworkAttachmentPrototype
+ instance_network_attachment_prototype_model['name'] = 'my-instance-network-attachment'
+ instance_network_attachment_prototype_model['virtual_network_interface'] = instance_network_attachment_prototype_virtual_network_interface_model
+
+ # Construct a json representation of a InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkAttachment model
+ instance_template_instance_by_image_instance_template_context_instance_by_image_instance_template_context_instance_by_network_attachment_model_json = {}
+ instance_template_instance_by_image_instance_template_context_instance_by_image_instance_template_context_instance_by_network_attachment_model_json['availability_policy'] = instance_availability_policy_prototype_model
+ instance_template_instance_by_image_instance_template_context_instance_by_image_instance_template_context_instance_by_network_attachment_model_json['created_at'] = '2019-01-01T12:00:00Z'
+ instance_template_instance_by_image_instance_template_context_instance_by_image_instance_template_context_instance_by_network_attachment_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a'
+ instance_template_instance_by_image_instance_template_context_instance_by_image_instance_template_context_instance_by_network_attachment_model_json['default_trusted_profile'] = instance_default_trusted_profile_prototype_model
+ instance_template_instance_by_image_instance_template_context_instance_by_image_instance_template_context_instance_by_network_attachment_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a'
+ instance_template_instance_by_image_instance_template_context_instance_by_image_instance_template_context_instance_by_network_attachment_model_json['id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803'
+ instance_template_instance_by_image_instance_template_context_instance_by_image_instance_template_context_instance_by_network_attachment_model_json['keys'] = [key_identity_model]
+ instance_template_instance_by_image_instance_template_context_instance_by_image_instance_template_context_instance_by_network_attachment_model_json['metadata_service'] = instance_metadata_service_prototype_model
+ instance_template_instance_by_image_instance_template_context_instance_by_image_instance_template_context_instance_by_network_attachment_model_json['name'] = 'my-instance-template'
+ instance_template_instance_by_image_instance_template_context_instance_by_image_instance_template_context_instance_by_network_attachment_model_json['placement_target'] = instance_placement_target_prototype_model
+ instance_template_instance_by_image_instance_template_context_instance_by_image_instance_template_context_instance_by_network_attachment_model_json['profile'] = instance_profile_identity_model
+ instance_template_instance_by_image_instance_template_context_instance_by_image_instance_template_context_instance_by_network_attachment_model_json['reservation_affinity'] = instance_reservation_affinity_prototype_model
+ instance_template_instance_by_image_instance_template_context_instance_by_image_instance_template_context_instance_by_network_attachment_model_json['resource_group'] = resource_group_reference_model
+ instance_template_instance_by_image_instance_template_context_instance_by_image_instance_template_context_instance_by_network_attachment_model_json['total_volume_bandwidth'] = 500
+ instance_template_instance_by_image_instance_template_context_instance_by_image_instance_template_context_instance_by_network_attachment_model_json['user_data'] = 'testString'
+ instance_template_instance_by_image_instance_template_context_instance_by_image_instance_template_context_instance_by_network_attachment_model_json['volume_attachments'] = [volume_attachment_prototype_model]
+ instance_template_instance_by_image_instance_template_context_instance_by_image_instance_template_context_instance_by_network_attachment_model_json['vpc'] = vpc_identity_model
+ instance_template_instance_by_image_instance_template_context_instance_by_image_instance_template_context_instance_by_network_attachment_model_json['boot_volume_attachment'] = volume_attachment_prototype_instance_by_image_context_model
+ instance_template_instance_by_image_instance_template_context_instance_by_image_instance_template_context_instance_by_network_attachment_model_json['image'] = image_identity_model
+ instance_template_instance_by_image_instance_template_context_instance_by_image_instance_template_context_instance_by_network_attachment_model_json['zone'] = zone_identity_model
+ instance_template_instance_by_image_instance_template_context_instance_by_image_instance_template_context_instance_by_network_attachment_model_json['network_attachments'] = [instance_network_attachment_prototype_model]
+ instance_template_instance_by_image_instance_template_context_instance_by_image_instance_template_context_instance_by_network_attachment_model_json['primary_network_attachment'] = instance_network_attachment_prototype_model
+
+ # Construct a model instance of InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkAttachment by calling from_dict on the json representation
+ instance_template_instance_by_image_instance_template_context_instance_by_image_instance_template_context_instance_by_network_attachment_model = InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkAttachment.from_dict(instance_template_instance_by_image_instance_template_context_instance_by_image_instance_template_context_instance_by_network_attachment_model_json)
+ assert instance_template_instance_by_image_instance_template_context_instance_by_image_instance_template_context_instance_by_network_attachment_model != False
+
+ # Construct a model instance of InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkAttachment by calling from_dict on the json representation
+ instance_template_instance_by_image_instance_template_context_instance_by_image_instance_template_context_instance_by_network_attachment_model_dict = InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkAttachment.from_dict(instance_template_instance_by_image_instance_template_context_instance_by_image_instance_template_context_instance_by_network_attachment_model_json).__dict__
+ instance_template_instance_by_image_instance_template_context_instance_by_image_instance_template_context_instance_by_network_attachment_model2 = InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkAttachment(**instance_template_instance_by_image_instance_template_context_instance_by_image_instance_template_context_instance_by_network_attachment_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
+ assert instance_template_instance_by_image_instance_template_context_instance_by_image_instance_template_context_instance_by_network_attachment_model == instance_template_instance_by_image_instance_template_context_instance_by_image_instance_template_context_instance_by_network_attachment_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
+ instance_template_instance_by_image_instance_template_context_instance_by_image_instance_template_context_instance_by_network_attachment_model_json2 = instance_template_instance_by_image_instance_template_context_instance_by_image_instance_template_context_instance_by_network_attachment_model.to_dict()
+ assert instance_template_instance_by_image_instance_template_context_instance_by_image_instance_template_context_instance_by_network_attachment_model_json2 == instance_template_instance_by_image_instance_template_context_instance_by_image_instance_template_context_instance_by_network_attachment_model_json
-class TestModel_InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityById:
+class TestModel_InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkInterface:
"""
- Test Class for InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityById
+ Test Class for InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkInterface
"""
- def test_instance_placement_target_patch_dedicated_host_group_identity_dedicated_host_group_identity_by_id_serialization(self):
+ def test_instance_template_instance_by_image_instance_template_context_instance_by_image_instance_template_context_instance_by_network_interface_serialization(self):
"""
- Test serialization/deserialization for InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityById
+ Test serialization/deserialization for InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkInterface
"""
- # 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 dict forms of any model objects needed in order to build this model.
- # 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
+ instance_availability_policy_prototype_model = {} # InstanceAvailabilityPolicyPrototype
+ instance_availability_policy_prototype_model['host_failure'] = 'restart'
- # 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)
+ trusted_profile_identity_model = {} # TrustedProfileIdentityTrustedProfileById
+ trusted_profile_identity_model['id'] = 'Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5'
- # 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
+ instance_default_trusted_profile_prototype_model = {} # InstanceDefaultTrustedProfilePrototype
+ instance_default_trusted_profile_prototype_model['auto_link'] = False
+ instance_default_trusted_profile_prototype_model['target'] = trusted_profile_identity_model
- # 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
+ key_identity_model = {} # KeyIdentityById
+ key_identity_model['id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803'
+ instance_metadata_service_prototype_model = {} # InstanceMetadataServicePrototype
+ instance_metadata_service_prototype_model['enabled'] = False
+ instance_metadata_service_prototype_model['protocol'] = 'https'
+ instance_metadata_service_prototype_model['response_hop_limit'] = 2
-class TestModel_InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByCRN:
- """
- Test Class for InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByCRN
- """
+ instance_placement_target_prototype_model = {} # InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById
+ instance_placement_target_prototype_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
- def test_instance_placement_target_patch_dedicated_host_identity_dedicated_host_identity_by_crn_serialization(self):
- """
- Test serialization/deserialization for InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByCRN
- """
+ instance_profile_identity_model = {} # InstanceProfileIdentityByName
+ instance_profile_identity_model['name'] = 'cx2-16x32'
- # 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'
+ reservation_identity_model = {} # ReservationIdentityById
+ reservation_identity_model['id'] = '7187-ba49df72-37b8-43ac-98da-f8e029de0e63'
- # 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
+ instance_reservation_affinity_prototype_model = {} # InstanceReservationAffinityPrototype
+ instance_reservation_affinity_prototype_model['policy'] = 'disabled'
+ instance_reservation_affinity_prototype_model['pool'] = [reservation_identity_model]
- # 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)
+ 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 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
+ volume_attachment_prototype_volume_model = {} # VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById
+ volume_attachment_prototype_volume_model['id'] = '1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
- # 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
+ volume_attachment_prototype_model = {} # VolumeAttachmentPrototype
+ volume_attachment_prototype_model['delete_volume_on_instance_delete'] = False
+ volume_attachment_prototype_model['name'] = 'my-volume-attachment'
+ volume_attachment_prototype_model['volume'] = volume_attachment_prototype_volume_model
+ vpc_identity_model = {} # VPCIdentityById
+ vpc_identity_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b'
-class TestModel_InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByHref:
- """
- Test Class for InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByHref
- """
+ encryption_key_identity_model = {} # EncryptionKeyIdentityByCRN
+ encryption_key_identity_model['crn'] = 'crn:v1:bluemix:public:kms:us-south:a/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179'
- def test_instance_placement_target_patch_dedicated_host_identity_dedicated_host_identity_by_href_serialization(self):
- """
- Test serialization/deserialization for InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByHref
- """
+ volume_profile_identity_model = {} # VolumeProfileIdentityByName
+ volume_profile_identity_model['name'] = 'general-purpose'
- # 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'
+ resource_group_identity_model = {} # ResourceGroupIdentityById
+ resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
- # 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
+ volume_prototype_instance_by_image_context_model = {} # VolumePrototypeInstanceByImageContext
+ volume_prototype_instance_by_image_context_model['capacity'] = 100
+ volume_prototype_instance_by_image_context_model['encryption_key'] = encryption_key_identity_model
+ volume_prototype_instance_by_image_context_model['iops'] = 10000
+ volume_prototype_instance_by_image_context_model['name'] = 'my-volume'
+ volume_prototype_instance_by_image_context_model['profile'] = volume_profile_identity_model
+ volume_prototype_instance_by_image_context_model['resource_group'] = resource_group_identity_model
+ volume_prototype_instance_by_image_context_model['user_tags'] = []
- # 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)
+ 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
- # 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
+ image_identity_model = {} # ImageIdentityById
+ image_identity_model['id'] = 'r006-02c73baf-9abb-493d-9e41-d0f1866f4051'
- # 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
+ zone_identity_model = {} # ZoneIdentityByName
+ zone_identity_model['name'] = 'us-south-1'
+ network_interface_ip_prototype_model = {} # NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext
+ network_interface_ip_prototype_model['address'] = '10.0.0.5'
+ network_interface_ip_prototype_model['auto_delete'] = False
+ network_interface_ip_prototype_model['name'] = 'my-reserved-ip'
-class TestModel_InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityById:
- """
- Test Class for InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityById
- """
+ security_group_identity_model = {} # SecurityGroupIdentityById
+ security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271'
- def test_instance_placement_target_patch_dedicated_host_identity_dedicated_host_identity_by_id_serialization(self):
- """
- Test serialization/deserialization for InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityById
- """
+ subnet_identity_model = {} # SubnetIdentityById
+ subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
- # 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'
+ network_interface_prototype_model = {} # NetworkInterfacePrototype
+ network_interface_prototype_model['allow_ip_spoofing'] = True
+ network_interface_prototype_model['name'] = 'my-instance-network-interface'
+ network_interface_prototype_model['primary_ip'] = network_interface_ip_prototype_model
+ network_interface_prototype_model['security_groups'] = [security_group_identity_model]
+ network_interface_prototype_model['subnet'] = subnet_identity_model
- # 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 json representation of a InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkInterface model
+ instance_template_instance_by_image_instance_template_context_instance_by_image_instance_template_context_instance_by_network_interface_model_json = {}
+ instance_template_instance_by_image_instance_template_context_instance_by_image_instance_template_context_instance_by_network_interface_model_json['availability_policy'] = instance_availability_policy_prototype_model
+ instance_template_instance_by_image_instance_template_context_instance_by_image_instance_template_context_instance_by_network_interface_model_json['created_at'] = '2019-01-01T12:00:00Z'
+ instance_template_instance_by_image_instance_template_context_instance_by_image_instance_template_context_instance_by_network_interface_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a'
+ instance_template_instance_by_image_instance_template_context_instance_by_image_instance_template_context_instance_by_network_interface_model_json['default_trusted_profile'] = instance_default_trusted_profile_prototype_model
+ instance_template_instance_by_image_instance_template_context_instance_by_image_instance_template_context_instance_by_network_interface_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a'
+ instance_template_instance_by_image_instance_template_context_instance_by_image_instance_template_context_instance_by_network_interface_model_json['id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803'
+ instance_template_instance_by_image_instance_template_context_instance_by_image_instance_template_context_instance_by_network_interface_model_json['keys'] = [key_identity_model]
+ instance_template_instance_by_image_instance_template_context_instance_by_image_instance_template_context_instance_by_network_interface_model_json['metadata_service'] = instance_metadata_service_prototype_model
+ instance_template_instance_by_image_instance_template_context_instance_by_image_instance_template_context_instance_by_network_interface_model_json['name'] = 'my-instance-template'
+ instance_template_instance_by_image_instance_template_context_instance_by_image_instance_template_context_instance_by_network_interface_model_json['placement_target'] = instance_placement_target_prototype_model
+ instance_template_instance_by_image_instance_template_context_instance_by_image_instance_template_context_instance_by_network_interface_model_json['profile'] = instance_profile_identity_model
+ instance_template_instance_by_image_instance_template_context_instance_by_image_instance_template_context_instance_by_network_interface_model_json['reservation_affinity'] = instance_reservation_affinity_prototype_model
+ instance_template_instance_by_image_instance_template_context_instance_by_image_instance_template_context_instance_by_network_interface_model_json['resource_group'] = resource_group_reference_model
+ instance_template_instance_by_image_instance_template_context_instance_by_image_instance_template_context_instance_by_network_interface_model_json['total_volume_bandwidth'] = 500
+ instance_template_instance_by_image_instance_template_context_instance_by_image_instance_template_context_instance_by_network_interface_model_json['user_data'] = 'testString'
+ instance_template_instance_by_image_instance_template_context_instance_by_image_instance_template_context_instance_by_network_interface_model_json['volume_attachments'] = [volume_attachment_prototype_model]
+ instance_template_instance_by_image_instance_template_context_instance_by_image_instance_template_context_instance_by_network_interface_model_json['vpc'] = vpc_identity_model
+ instance_template_instance_by_image_instance_template_context_instance_by_image_instance_template_context_instance_by_network_interface_model_json['boot_volume_attachment'] = volume_attachment_prototype_instance_by_image_context_model
+ instance_template_instance_by_image_instance_template_context_instance_by_image_instance_template_context_instance_by_network_interface_model_json['image'] = image_identity_model
+ instance_template_instance_by_image_instance_template_context_instance_by_image_instance_template_context_instance_by_network_interface_model_json['zone'] = zone_identity_model
+ instance_template_instance_by_image_instance_template_context_instance_by_image_instance_template_context_instance_by_network_interface_model_json['network_interfaces'] = [network_interface_prototype_model]
+ instance_template_instance_by_image_instance_template_context_instance_by_image_instance_template_context_instance_by_network_interface_model_json['primary_network_interface'] = network_interface_prototype_model
- # 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)
+ # Construct a model instance of InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkInterface by calling from_dict on the json representation
+ instance_template_instance_by_image_instance_template_context_instance_by_image_instance_template_context_instance_by_network_interface_model = InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkInterface.from_dict(instance_template_instance_by_image_instance_template_context_instance_by_image_instance_template_context_instance_by_network_interface_model_json)
+ assert instance_template_instance_by_image_instance_template_context_instance_by_image_instance_template_context_instance_by_network_interface_model != False
+
+ # Construct a model instance of InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkInterface by calling from_dict on the json representation
+ instance_template_instance_by_image_instance_template_context_instance_by_image_instance_template_context_instance_by_network_interface_model_dict = InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkInterface.from_dict(instance_template_instance_by_image_instance_template_context_instance_by_image_instance_template_context_instance_by_network_interface_model_json).__dict__
+ instance_template_instance_by_image_instance_template_context_instance_by_image_instance_template_context_instance_by_network_interface_model2 = InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkInterface(**instance_template_instance_by_image_instance_template_context_instance_by_image_instance_template_context_instance_by_network_interface_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
+ assert instance_template_instance_by_image_instance_template_context_instance_by_image_instance_template_context_instance_by_network_interface_model == instance_template_instance_by_image_instance_template_context_instance_by_image_instance_template_context_instance_by_network_interface_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
+ instance_template_instance_by_image_instance_template_context_instance_by_image_instance_template_context_instance_by_network_interface_model_json2 = instance_template_instance_by_image_instance_template_context_instance_by_image_instance_template_context_instance_by_network_interface_model.to_dict()
+ assert instance_template_instance_by_image_instance_template_context_instance_by_image_instance_template_context_instance_by_network_interface_model_json2 == instance_template_instance_by_image_instance_template_context_instance_by_image_instance_template_context_instance_by_network_interface_model_json
-class TestModel_InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN:
+class TestModel_InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkAttachment:
"""
- Test Class for InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN
+ Test Class for InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkAttachment
"""
- def test_instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_crn_serialization(self):
+ def test_instance_template_instance_by_source_snapshot_instance_template_context_instance_by_source_snapshot_instance_template_context_instance_by_network_attachment_serialization(self):
"""
- Test serialization/deserialization for InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN
+ Test serialization/deserialization for InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkAttachment
"""
- # Construct a json representation of a InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN model
- instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_crn_model_json = {}
- instance_placement_target_prototype_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 InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN by calling from_dict on the json representation
- instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_crn_model = InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN.from_dict(instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_crn_model_json)
- assert instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_crn_model != False
-
- # Construct a model instance of InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN by calling from_dict on the json representation
- instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_crn_model_dict = InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN.from_dict(instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_crn_model_json).__dict__
- instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_crn_model2 = InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN(**instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_crn_model_dict)
-
- # Verify the model instances are equivalent
- assert instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_crn_model == instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_crn_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
- instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_crn_model_json2 = instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_crn_model.to_dict()
- assert instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_crn_model_json2 == instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_crn_model_json
+ instance_availability_policy_prototype_model = {} # InstanceAvailabilityPolicyPrototype
+ instance_availability_policy_prototype_model['host_failure'] = 'restart'
+ trusted_profile_identity_model = {} # TrustedProfileIdentityTrustedProfileById
+ trusted_profile_identity_model['id'] = 'Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5'
-class TestModel_InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref:
- """
- Test Class for InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref
- """
+ instance_default_trusted_profile_prototype_model = {} # InstanceDefaultTrustedProfilePrototype
+ instance_default_trusted_profile_prototype_model['auto_link'] = False
+ instance_default_trusted_profile_prototype_model['target'] = trusted_profile_identity_model
- def test_instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_href_serialization(self):
- """
- Test serialization/deserialization for InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref
- """
+ key_identity_model = {} # KeyIdentityById
+ key_identity_model['id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803'
- # Construct a json representation of a InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref model
- instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_href_model_json = {}
- instance_placement_target_prototype_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'
+ instance_metadata_service_prototype_model = {} # InstanceMetadataServicePrototype
+ instance_metadata_service_prototype_model['enabled'] = False
+ instance_metadata_service_prototype_model['protocol'] = 'https'
+ instance_metadata_service_prototype_model['response_hop_limit'] = 2
- # Construct a model instance of InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref by calling from_dict on the json representation
- instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_href_model = InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref.from_dict(instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_href_model_json)
- assert instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_href_model != False
+ instance_placement_target_prototype_model = {} # InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById
+ instance_placement_target_prototype_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
- # Construct a model instance of InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref by calling from_dict on the json representation
- instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_href_model_dict = InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref.from_dict(instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_href_model_json).__dict__
- instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_href_model2 = InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref(**instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_href_model_dict)
+ instance_profile_identity_model = {} # InstanceProfileIdentityByName
+ instance_profile_identity_model['name'] = 'cx2-16x32'
- # Verify the model instances are equivalent
- assert instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_href_model == instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_href_model2
+ reservation_identity_model = {} # ReservationIdentityById
+ reservation_identity_model['id'] = '7187-ba49df72-37b8-43ac-98da-f8e029de0e63'
- # Convert model instance back to dict and verify no loss of data
- instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_href_model_json2 = instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_href_model.to_dict()
- assert instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_href_model_json2 == instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_href_model_json
+ instance_reservation_affinity_prototype_model = {} # InstanceReservationAffinityPrototype
+ instance_reservation_affinity_prototype_model['policy'] = 'disabled'
+ instance_reservation_affinity_prototype_model['pool'] = [reservation_identity_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'
-class TestModel_InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityById:
- """
- Test Class for InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityById
- """
+ volume_attachment_prototype_volume_model = {} # VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById
+ volume_attachment_prototype_volume_model['id'] = '1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
- def test_instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_id_serialization(self):
- """
- Test serialization/deserialization for InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityById
- """
+ volume_attachment_prototype_model = {} # VolumeAttachmentPrototype
+ volume_attachment_prototype_model['delete_volume_on_instance_delete'] = False
+ volume_attachment_prototype_model['name'] = 'my-volume-attachment'
+ volume_attachment_prototype_model['volume'] = volume_attachment_prototype_volume_model
- # Construct a json representation of a InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityById model
- instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_id_model_json = {}
- instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_id_model_json['id'] = 'bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0'
+ vpc_identity_model = {} # VPCIdentityById
+ vpc_identity_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b'
- # Construct a model instance of InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityById by calling from_dict on the json representation
- instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_id_model = InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityById.from_dict(instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_id_model_json)
- assert instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_id_model != False
+ encryption_key_identity_model = {} # EncryptionKeyIdentityByCRN
+ encryption_key_identity_model['crn'] = 'crn:v1:bluemix:public:kms:us-south:a/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179'
- # Construct a model instance of InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityById by calling from_dict on the json representation
- instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_id_model_dict = InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityById.from_dict(instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_id_model_json).__dict__
- instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_id_model2 = InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityById(**instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_id_model_dict)
+ volume_profile_identity_model = {} # VolumeProfileIdentityByName
+ volume_profile_identity_model['name'] = 'general-purpose'
- # Verify the model instances are equivalent
- assert instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_id_model == instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_id_model2
+ resource_group_identity_model = {} # ResourceGroupIdentityById
+ resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
- # Convert model instance back to dict and verify no loss of data
- instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_id_model_json2 = instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_id_model.to_dict()
- assert instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_id_model_json2 == instance_placement_target_prototype_dedicated_host_group_identity_dedicated_host_group_identity_by_id_model_json
+ snapshot_identity_model = {} # SnapshotIdentityById
+ snapshot_identity_model['id'] = '349a61d8-7ab1-420f-a690-5fed76ef9d4f'
+ volume_prototype_instance_by_source_snapshot_context_model = {} # VolumePrototypeInstanceBySourceSnapshotContext
+ volume_prototype_instance_by_source_snapshot_context_model['capacity'] = 100
+ volume_prototype_instance_by_source_snapshot_context_model['encryption_key'] = encryption_key_identity_model
+ volume_prototype_instance_by_source_snapshot_context_model['iops'] = 10000
+ volume_prototype_instance_by_source_snapshot_context_model['name'] = 'my-volume'
+ volume_prototype_instance_by_source_snapshot_context_model['profile'] = volume_profile_identity_model
+ volume_prototype_instance_by_source_snapshot_context_model['resource_group'] = resource_group_identity_model
+ volume_prototype_instance_by_source_snapshot_context_model['source_snapshot'] = snapshot_identity_model
+ volume_prototype_instance_by_source_snapshot_context_model['user_tags'] = []
-class TestModel_InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByCRN:
- """
- Test Class for InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByCRN
- """
+ volume_attachment_prototype_instance_by_source_snapshot_context_model = {} # VolumeAttachmentPrototypeInstanceBySourceSnapshotContext
+ volume_attachment_prototype_instance_by_source_snapshot_context_model['delete_volume_on_instance_delete'] = True
+ volume_attachment_prototype_instance_by_source_snapshot_context_model['name'] = 'my-volume-attachment'
+ volume_attachment_prototype_instance_by_source_snapshot_context_model['volume'] = volume_prototype_instance_by_source_snapshot_context_model
- def test_instance_placement_target_prototype_dedicated_host_identity_dedicated_host_identity_by_crn_serialization(self):
- """
- Test serialization/deserialization for InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByCRN
- """
+ network_interface_ip_prototype_model = {} # NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext
+ network_interface_ip_prototype_model['address'] = '10.0.0.5'
+ network_interface_ip_prototype_model['auto_delete'] = False
+ network_interface_ip_prototype_model['name'] = 'my-reserved-ip'
- # Construct a json representation of a InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByCRN model
- instance_placement_target_prototype_dedicated_host_identity_dedicated_host_identity_by_crn_model_json = {}
- instance_placement_target_prototype_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'
+ security_group_identity_model = {} # SecurityGroupIdentityById
+ security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271'
- # Construct a model instance of InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByCRN by calling from_dict on the json representation
- instance_placement_target_prototype_dedicated_host_identity_dedicated_host_identity_by_crn_model = InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByCRN.from_dict(instance_placement_target_prototype_dedicated_host_identity_dedicated_host_identity_by_crn_model_json)
- assert instance_placement_target_prototype_dedicated_host_identity_dedicated_host_identity_by_crn_model != False
+ subnet_identity_model = {} # SubnetIdentityById
+ subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
- # Construct a model instance of InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByCRN by calling from_dict on the json representation
- instance_placement_target_prototype_dedicated_host_identity_dedicated_host_identity_by_crn_model_dict = InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByCRN.from_dict(instance_placement_target_prototype_dedicated_host_identity_dedicated_host_identity_by_crn_model_json).__dict__
- instance_placement_target_prototype_dedicated_host_identity_dedicated_host_identity_by_crn_model2 = InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByCRN(**instance_placement_target_prototype_dedicated_host_identity_dedicated_host_identity_by_crn_model_dict)
+ network_interface_prototype_model = {} # NetworkInterfacePrototype
+ network_interface_prototype_model['allow_ip_spoofing'] = True
+ network_interface_prototype_model['name'] = 'my-instance-network-interface'
+ network_interface_prototype_model['primary_ip'] = network_interface_ip_prototype_model
+ network_interface_prototype_model['security_groups'] = [security_group_identity_model]
+ network_interface_prototype_model['subnet'] = subnet_identity_model
- # Verify the model instances are equivalent
- assert instance_placement_target_prototype_dedicated_host_identity_dedicated_host_identity_by_crn_model == instance_placement_target_prototype_dedicated_host_identity_dedicated_host_identity_by_crn_model2
+ zone_identity_model = {} # ZoneIdentityByName
+ zone_identity_model['name'] = 'us-south-1'
- # Convert model instance back to dict and verify no loss of data
- instance_placement_target_prototype_dedicated_host_identity_dedicated_host_identity_by_crn_model_json2 = instance_placement_target_prototype_dedicated_host_identity_dedicated_host_identity_by_crn_model.to_dict()
- assert instance_placement_target_prototype_dedicated_host_identity_dedicated_host_identity_by_crn_model_json2 == instance_placement_target_prototype_dedicated_host_identity_dedicated_host_identity_by_crn_model_json
+ virtual_network_interface_ip_prototype_model = {} # VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext
+ virtual_network_interface_ip_prototype_model['address'] = '10.0.0.5'
+ virtual_network_interface_ip_prototype_model['auto_delete'] = False
+ virtual_network_interface_ip_prototype_model['name'] = 'my-reserved-ip'
+ virtual_network_interface_primary_ip_prototype_model = {} # VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext
+ virtual_network_interface_primary_ip_prototype_model['address'] = '10.0.0.5'
+ virtual_network_interface_primary_ip_prototype_model['auto_delete'] = False
+ virtual_network_interface_primary_ip_prototype_model['name'] = 'my-reserved-ip'
-class TestModel_InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByHref:
- """
- Test Class for InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByHref
- """
+ instance_network_attachment_prototype_virtual_network_interface_model = {} # InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeInstanceNetworkAttachmentContext
+ instance_network_attachment_prototype_virtual_network_interface_model['allow_ip_spoofing'] = True
+ instance_network_attachment_prototype_virtual_network_interface_model['auto_delete'] = False
+ instance_network_attachment_prototype_virtual_network_interface_model['enable_infrastructure_nat'] = True
+ instance_network_attachment_prototype_virtual_network_interface_model['ips'] = [virtual_network_interface_ip_prototype_model]
+ instance_network_attachment_prototype_virtual_network_interface_model['name'] = 'my-virtual-network-interface'
+ instance_network_attachment_prototype_virtual_network_interface_model['primary_ip'] = virtual_network_interface_primary_ip_prototype_model
+ instance_network_attachment_prototype_virtual_network_interface_model['resource_group'] = resource_group_identity_model
+ instance_network_attachment_prototype_virtual_network_interface_model['security_groups'] = [security_group_identity_model]
+ instance_network_attachment_prototype_virtual_network_interface_model['subnet'] = subnet_identity_model
- def test_instance_placement_target_prototype_dedicated_host_identity_dedicated_host_identity_by_href_serialization(self):
- """
- Test serialization/deserialization for InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByHref
- """
+ instance_network_attachment_prototype_model = {} # InstanceNetworkAttachmentPrototype
+ instance_network_attachment_prototype_model['name'] = 'my-instance-network-attachment'
+ instance_network_attachment_prototype_model['virtual_network_interface'] = instance_network_attachment_prototype_virtual_network_interface_model
- # Construct a json representation of a InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByHref model
- instance_placement_target_prototype_dedicated_host_identity_dedicated_host_identity_by_href_model_json = {}
- instance_placement_target_prototype_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 json representation of a InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkAttachment model
+ instance_template_instance_by_source_snapshot_instance_template_context_instance_by_source_snapshot_instance_template_context_instance_by_network_attachment_model_json = {}
+ instance_template_instance_by_source_snapshot_instance_template_context_instance_by_source_snapshot_instance_template_context_instance_by_network_attachment_model_json['availability_policy'] = instance_availability_policy_prototype_model
+ instance_template_instance_by_source_snapshot_instance_template_context_instance_by_source_snapshot_instance_template_context_instance_by_network_attachment_model_json['created_at'] = '2019-01-01T12:00:00Z'
+ instance_template_instance_by_source_snapshot_instance_template_context_instance_by_source_snapshot_instance_template_context_instance_by_network_attachment_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a'
+ instance_template_instance_by_source_snapshot_instance_template_context_instance_by_source_snapshot_instance_template_context_instance_by_network_attachment_model_json['default_trusted_profile'] = instance_default_trusted_profile_prototype_model
+ instance_template_instance_by_source_snapshot_instance_template_context_instance_by_source_snapshot_instance_template_context_instance_by_network_attachment_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a'
+ instance_template_instance_by_source_snapshot_instance_template_context_instance_by_source_snapshot_instance_template_context_instance_by_network_attachment_model_json['id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803'
+ instance_template_instance_by_source_snapshot_instance_template_context_instance_by_source_snapshot_instance_template_context_instance_by_network_attachment_model_json['keys'] = [key_identity_model]
+ instance_template_instance_by_source_snapshot_instance_template_context_instance_by_source_snapshot_instance_template_context_instance_by_network_attachment_model_json['metadata_service'] = instance_metadata_service_prototype_model
+ instance_template_instance_by_source_snapshot_instance_template_context_instance_by_source_snapshot_instance_template_context_instance_by_network_attachment_model_json['name'] = 'my-instance-template'
+ instance_template_instance_by_source_snapshot_instance_template_context_instance_by_source_snapshot_instance_template_context_instance_by_network_attachment_model_json['placement_target'] = instance_placement_target_prototype_model
+ instance_template_instance_by_source_snapshot_instance_template_context_instance_by_source_snapshot_instance_template_context_instance_by_network_attachment_model_json['profile'] = instance_profile_identity_model
+ instance_template_instance_by_source_snapshot_instance_template_context_instance_by_source_snapshot_instance_template_context_instance_by_network_attachment_model_json['reservation_affinity'] = instance_reservation_affinity_prototype_model
+ instance_template_instance_by_source_snapshot_instance_template_context_instance_by_source_snapshot_instance_template_context_instance_by_network_attachment_model_json['resource_group'] = resource_group_reference_model
+ instance_template_instance_by_source_snapshot_instance_template_context_instance_by_source_snapshot_instance_template_context_instance_by_network_attachment_model_json['total_volume_bandwidth'] = 500
+ instance_template_instance_by_source_snapshot_instance_template_context_instance_by_source_snapshot_instance_template_context_instance_by_network_attachment_model_json['user_data'] = 'testString'
+ instance_template_instance_by_source_snapshot_instance_template_context_instance_by_source_snapshot_instance_template_context_instance_by_network_attachment_model_json['volume_attachments'] = [volume_attachment_prototype_model]
+ instance_template_instance_by_source_snapshot_instance_template_context_instance_by_source_snapshot_instance_template_context_instance_by_network_attachment_model_json['vpc'] = vpc_identity_model
+ instance_template_instance_by_source_snapshot_instance_template_context_instance_by_source_snapshot_instance_template_context_instance_by_network_attachment_model_json['boot_volume_attachment'] = volume_attachment_prototype_instance_by_source_snapshot_context_model
+ instance_template_instance_by_source_snapshot_instance_template_context_instance_by_source_snapshot_instance_template_context_instance_by_network_attachment_model_json['network_interfaces'] = [network_interface_prototype_model]
+ instance_template_instance_by_source_snapshot_instance_template_context_instance_by_source_snapshot_instance_template_context_instance_by_network_attachment_model_json['zone'] = zone_identity_model
+ instance_template_instance_by_source_snapshot_instance_template_context_instance_by_source_snapshot_instance_template_context_instance_by_network_attachment_model_json['network_attachments'] = [instance_network_attachment_prototype_model]
+ instance_template_instance_by_source_snapshot_instance_template_context_instance_by_source_snapshot_instance_template_context_instance_by_network_attachment_model_json['primary_network_attachment'] = instance_network_attachment_prototype_model
- # Construct a model instance of InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByHref by calling from_dict on the json representation
- instance_placement_target_prototype_dedicated_host_identity_dedicated_host_identity_by_href_model = InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByHref.from_dict(instance_placement_target_prototype_dedicated_host_identity_dedicated_host_identity_by_href_model_json)
- assert instance_placement_target_prototype_dedicated_host_identity_dedicated_host_identity_by_href_model != False
+ # Construct a model instance of InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkAttachment by calling from_dict on the json representation
+ instance_template_instance_by_source_snapshot_instance_template_context_instance_by_source_snapshot_instance_template_context_instance_by_network_attachment_model = InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkAttachment.from_dict(instance_template_instance_by_source_snapshot_instance_template_context_instance_by_source_snapshot_instance_template_context_instance_by_network_attachment_model_json)
+ assert instance_template_instance_by_source_snapshot_instance_template_context_instance_by_source_snapshot_instance_template_context_instance_by_network_attachment_model != False
- # Construct a model instance of InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByHref by calling from_dict on the json representation
- instance_placement_target_prototype_dedicated_host_identity_dedicated_host_identity_by_href_model_dict = InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByHref.from_dict(instance_placement_target_prototype_dedicated_host_identity_dedicated_host_identity_by_href_model_json).__dict__
- instance_placement_target_prototype_dedicated_host_identity_dedicated_host_identity_by_href_model2 = InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByHref(**instance_placement_target_prototype_dedicated_host_identity_dedicated_host_identity_by_href_model_dict)
+ # Construct a model instance of InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkAttachment by calling from_dict on the json representation
+ instance_template_instance_by_source_snapshot_instance_template_context_instance_by_source_snapshot_instance_template_context_instance_by_network_attachment_model_dict = InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkAttachment.from_dict(instance_template_instance_by_source_snapshot_instance_template_context_instance_by_source_snapshot_instance_template_context_instance_by_network_attachment_model_json).__dict__
+ instance_template_instance_by_source_snapshot_instance_template_context_instance_by_source_snapshot_instance_template_context_instance_by_network_attachment_model2 = InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkAttachment(**instance_template_instance_by_source_snapshot_instance_template_context_instance_by_source_snapshot_instance_template_context_instance_by_network_attachment_model_dict)
# Verify the model instances are equivalent
- assert instance_placement_target_prototype_dedicated_host_identity_dedicated_host_identity_by_href_model == instance_placement_target_prototype_dedicated_host_identity_dedicated_host_identity_by_href_model2
+ assert instance_template_instance_by_source_snapshot_instance_template_context_instance_by_source_snapshot_instance_template_context_instance_by_network_attachment_model == instance_template_instance_by_source_snapshot_instance_template_context_instance_by_source_snapshot_instance_template_context_instance_by_network_attachment_model2
# Convert model instance back to dict and verify no loss of data
- instance_placement_target_prototype_dedicated_host_identity_dedicated_host_identity_by_href_model_json2 = instance_placement_target_prototype_dedicated_host_identity_dedicated_host_identity_by_href_model.to_dict()
- assert instance_placement_target_prototype_dedicated_host_identity_dedicated_host_identity_by_href_model_json2 == instance_placement_target_prototype_dedicated_host_identity_dedicated_host_identity_by_href_model_json
+ instance_template_instance_by_source_snapshot_instance_template_context_instance_by_source_snapshot_instance_template_context_instance_by_network_attachment_model_json2 = instance_template_instance_by_source_snapshot_instance_template_context_instance_by_source_snapshot_instance_template_context_instance_by_network_attachment_model.to_dict()
+ assert instance_template_instance_by_source_snapshot_instance_template_context_instance_by_source_snapshot_instance_template_context_instance_by_network_attachment_model_json2 == instance_template_instance_by_source_snapshot_instance_template_context_instance_by_source_snapshot_instance_template_context_instance_by_network_attachment_model_json
-class TestModel_InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById:
+class TestModel_InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkInterface:
"""
- Test Class for InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById
+ Test Class for InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkInterface
"""
- def test_instance_placement_target_prototype_dedicated_host_identity_dedicated_host_identity_by_id_serialization(self):
+ def test_instance_template_instance_by_source_snapshot_instance_template_context_instance_by_source_snapshot_instance_template_context_instance_by_network_interface_serialization(self):
"""
- Test serialization/deserialization for InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById
+ Test serialization/deserialization for InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkInterface
"""
- # Construct a json representation of a InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById model
- instance_placement_target_prototype_dedicated_host_identity_dedicated_host_identity_by_id_model_json = {}
- instance_placement_target_prototype_dedicated_host_identity_dedicated_host_identity_by_id_model_json['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
+ # Construct dict forms of any model objects needed in order to build this model.
- # Construct a model instance of InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById by calling from_dict on the json representation
- instance_placement_target_prototype_dedicated_host_identity_dedicated_host_identity_by_id_model = InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById.from_dict(instance_placement_target_prototype_dedicated_host_identity_dedicated_host_identity_by_id_model_json)
- assert instance_placement_target_prototype_dedicated_host_identity_dedicated_host_identity_by_id_model != False
+ instance_availability_policy_prototype_model = {} # InstanceAvailabilityPolicyPrototype
+ instance_availability_policy_prototype_model['host_failure'] = 'restart'
- # Construct a model instance of InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById by calling from_dict on the json representation
- instance_placement_target_prototype_dedicated_host_identity_dedicated_host_identity_by_id_model_dict = InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById.from_dict(instance_placement_target_prototype_dedicated_host_identity_dedicated_host_identity_by_id_model_json).__dict__
- instance_placement_target_prototype_dedicated_host_identity_dedicated_host_identity_by_id_model2 = InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById(**instance_placement_target_prototype_dedicated_host_identity_dedicated_host_identity_by_id_model_dict)
+ trusted_profile_identity_model = {} # TrustedProfileIdentityTrustedProfileById
+ trusted_profile_identity_model['id'] = 'Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5'
- # Verify the model instances are equivalent
- assert instance_placement_target_prototype_dedicated_host_identity_dedicated_host_identity_by_id_model == instance_placement_target_prototype_dedicated_host_identity_dedicated_host_identity_by_id_model2
+ instance_default_trusted_profile_prototype_model = {} # InstanceDefaultTrustedProfilePrototype
+ instance_default_trusted_profile_prototype_model['auto_link'] = False
+ instance_default_trusted_profile_prototype_model['target'] = trusted_profile_identity_model
- # Convert model instance back to dict and verify no loss of data
- instance_placement_target_prototype_dedicated_host_identity_dedicated_host_identity_by_id_model_json2 = instance_placement_target_prototype_dedicated_host_identity_dedicated_host_identity_by_id_model.to_dict()
- assert instance_placement_target_prototype_dedicated_host_identity_dedicated_host_identity_by_id_model_json2 == instance_placement_target_prototype_dedicated_host_identity_dedicated_host_identity_by_id_model_json
+ key_identity_model = {} # KeyIdentityById
+ key_identity_model['id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803'
+ instance_metadata_service_prototype_model = {} # InstanceMetadataServicePrototype
+ instance_metadata_service_prototype_model['enabled'] = False
+ instance_metadata_service_prototype_model['protocol'] = 'https'
+ instance_metadata_service_prototype_model['response_hop_limit'] = 2
-class TestModel_InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByCRN:
- """
- Test Class for InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByCRN
- """
+ instance_placement_target_prototype_model = {} # InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById
+ instance_placement_target_prototype_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
- def test_instance_placement_target_prototype_placement_group_identity_placement_group_identity_by_crn_serialization(self):
- """
- Test serialization/deserialization for InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByCRN
- """
+ instance_profile_identity_model = {} # InstanceProfileIdentityByName
+ instance_profile_identity_model['name'] = 'cx2-16x32'
- # Construct a json representation of a InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByCRN model
- instance_placement_target_prototype_placement_group_identity_placement_group_identity_by_crn_model_json = {}
- instance_placement_target_prototype_placement_group_identity_placement_group_identity_by_crn_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::placement-group:r018-418fe842-a3e9-47b9-a938-1aa5bd632871'
+ reservation_identity_model = {} # ReservationIdentityById
+ reservation_identity_model['id'] = '7187-ba49df72-37b8-43ac-98da-f8e029de0e63'
- # Construct a model instance of InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByCRN by calling from_dict on the json representation
- instance_placement_target_prototype_placement_group_identity_placement_group_identity_by_crn_model = InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByCRN.from_dict(instance_placement_target_prototype_placement_group_identity_placement_group_identity_by_crn_model_json)
- assert instance_placement_target_prototype_placement_group_identity_placement_group_identity_by_crn_model != False
+ instance_reservation_affinity_prototype_model = {} # InstanceReservationAffinityPrototype
+ instance_reservation_affinity_prototype_model['policy'] = 'disabled'
+ instance_reservation_affinity_prototype_model['pool'] = [reservation_identity_model]
- # Construct a model instance of InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByCRN by calling from_dict on the json representation
- instance_placement_target_prototype_placement_group_identity_placement_group_identity_by_crn_model_dict = InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByCRN.from_dict(instance_placement_target_prototype_placement_group_identity_placement_group_identity_by_crn_model_json).__dict__
- instance_placement_target_prototype_placement_group_identity_placement_group_identity_by_crn_model2 = InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByCRN(**instance_placement_target_prototype_placement_group_identity_placement_group_identity_by_crn_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 instance_placement_target_prototype_placement_group_identity_placement_group_identity_by_crn_model == instance_placement_target_prototype_placement_group_identity_placement_group_identity_by_crn_model2
+ volume_attachment_prototype_volume_model = {} # VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById
+ volume_attachment_prototype_volume_model['id'] = '1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
- # Convert model instance back to dict and verify no loss of data
- instance_placement_target_prototype_placement_group_identity_placement_group_identity_by_crn_model_json2 = instance_placement_target_prototype_placement_group_identity_placement_group_identity_by_crn_model.to_dict()
- assert instance_placement_target_prototype_placement_group_identity_placement_group_identity_by_crn_model_json2 == instance_placement_target_prototype_placement_group_identity_placement_group_identity_by_crn_model_json
+ volume_attachment_prototype_model = {} # VolumeAttachmentPrototype
+ volume_attachment_prototype_model['delete_volume_on_instance_delete'] = False
+ volume_attachment_prototype_model['name'] = 'my-volume-attachment'
+ volume_attachment_prototype_model['volume'] = volume_attachment_prototype_volume_model
+ vpc_identity_model = {} # VPCIdentityById
+ vpc_identity_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b'
-class TestModel_InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByHref:
- """
- Test Class for InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByHref
- """
+ encryption_key_identity_model = {} # EncryptionKeyIdentityByCRN
+ encryption_key_identity_model['crn'] = 'crn:v1:bluemix:public:kms:us-south:a/123456:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179'
- def test_instance_placement_target_prototype_placement_group_identity_placement_group_identity_by_href_serialization(self):
- """
- Test serialization/deserialization for InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByHref
- """
+ volume_profile_identity_model = {} # VolumeProfileIdentityByName
+ volume_profile_identity_model['name'] = 'general-purpose'
- # Construct a json representation of a InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByHref model
- instance_placement_target_prototype_placement_group_identity_placement_group_identity_by_href_model_json = {}
- instance_placement_target_prototype_placement_group_identity_placement_group_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/placement_groups/r018-418fe842-a3e9-47b9-a938-1aa5bd632871'
+ resource_group_identity_model = {} # ResourceGroupIdentityById
+ resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
- # Construct a model instance of InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByHref by calling from_dict on the json representation
- instance_placement_target_prototype_placement_group_identity_placement_group_identity_by_href_model = InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByHref.from_dict(instance_placement_target_prototype_placement_group_identity_placement_group_identity_by_href_model_json)
- assert instance_placement_target_prototype_placement_group_identity_placement_group_identity_by_href_model != False
+ snapshot_identity_model = {} # SnapshotIdentityById
+ snapshot_identity_model['id'] = '349a61d8-7ab1-420f-a690-5fed76ef9d4f'
- # Construct a model instance of InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByHref by calling from_dict on the json representation
- instance_placement_target_prototype_placement_group_identity_placement_group_identity_by_href_model_dict = InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByHref.from_dict(instance_placement_target_prototype_placement_group_identity_placement_group_identity_by_href_model_json).__dict__
- instance_placement_target_prototype_placement_group_identity_placement_group_identity_by_href_model2 = InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByHref(**instance_placement_target_prototype_placement_group_identity_placement_group_identity_by_href_model_dict)
+ volume_prototype_instance_by_source_snapshot_context_model = {} # VolumePrototypeInstanceBySourceSnapshotContext
+ volume_prototype_instance_by_source_snapshot_context_model['capacity'] = 100
+ volume_prototype_instance_by_source_snapshot_context_model['encryption_key'] = encryption_key_identity_model
+ volume_prototype_instance_by_source_snapshot_context_model['iops'] = 10000
+ volume_prototype_instance_by_source_snapshot_context_model['name'] = 'my-volume'
+ volume_prototype_instance_by_source_snapshot_context_model['profile'] = volume_profile_identity_model
+ volume_prototype_instance_by_source_snapshot_context_model['resource_group'] = resource_group_identity_model
+ volume_prototype_instance_by_source_snapshot_context_model['source_snapshot'] = snapshot_identity_model
+ volume_prototype_instance_by_source_snapshot_context_model['user_tags'] = []
- # Verify the model instances are equivalent
- assert instance_placement_target_prototype_placement_group_identity_placement_group_identity_by_href_model == instance_placement_target_prototype_placement_group_identity_placement_group_identity_by_href_model2
+ volume_attachment_prototype_instance_by_source_snapshot_context_model = {} # VolumeAttachmentPrototypeInstanceBySourceSnapshotContext
+ volume_attachment_prototype_instance_by_source_snapshot_context_model['delete_volume_on_instance_delete'] = True
+ volume_attachment_prototype_instance_by_source_snapshot_context_model['name'] = 'my-volume-attachment'
+ volume_attachment_prototype_instance_by_source_snapshot_context_model['volume'] = volume_prototype_instance_by_source_snapshot_context_model
- # Convert model instance back to dict and verify no loss of data
- instance_placement_target_prototype_placement_group_identity_placement_group_identity_by_href_model_json2 = instance_placement_target_prototype_placement_group_identity_placement_group_identity_by_href_model.to_dict()
- assert instance_placement_target_prototype_placement_group_identity_placement_group_identity_by_href_model_json2 == instance_placement_target_prototype_placement_group_identity_placement_group_identity_by_href_model_json
+ virtual_network_interface_ip_prototype_model = {} # VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext
+ virtual_network_interface_ip_prototype_model['address'] = '10.0.0.5'
+ virtual_network_interface_ip_prototype_model['auto_delete'] = False
+ virtual_network_interface_ip_prototype_model['name'] = 'my-reserved-ip'
+ virtual_network_interface_primary_ip_prototype_model = {} # VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext
+ virtual_network_interface_primary_ip_prototype_model['address'] = '10.0.0.5'
+ virtual_network_interface_primary_ip_prototype_model['auto_delete'] = False
+ virtual_network_interface_primary_ip_prototype_model['name'] = 'my-reserved-ip'
-class TestModel_InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityById:
- """
- Test Class for InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityById
- """
+ security_group_identity_model = {} # SecurityGroupIdentityById
+ security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271'
- def test_instance_placement_target_prototype_placement_group_identity_placement_group_identity_by_id_serialization(self):
- """
- Test serialization/deserialization for InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityById
- """
+ subnet_identity_model = {} # SubnetIdentityById
+ subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
- # Construct a json representation of a InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityById model
- instance_placement_target_prototype_placement_group_identity_placement_group_identity_by_id_model_json = {}
- instance_placement_target_prototype_placement_group_identity_placement_group_identity_by_id_model_json['id'] = 'r018-418fe842-a3e9-47b9-a938-1aa5bd632871'
+ instance_network_attachment_prototype_virtual_network_interface_model = {} # InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeInstanceNetworkAttachmentContext
+ instance_network_attachment_prototype_virtual_network_interface_model['allow_ip_spoofing'] = True
+ instance_network_attachment_prototype_virtual_network_interface_model['auto_delete'] = False
+ instance_network_attachment_prototype_virtual_network_interface_model['enable_infrastructure_nat'] = True
+ instance_network_attachment_prototype_virtual_network_interface_model['ips'] = [virtual_network_interface_ip_prototype_model]
+ instance_network_attachment_prototype_virtual_network_interface_model['name'] = 'my-virtual-network-interface'
+ instance_network_attachment_prototype_virtual_network_interface_model['primary_ip'] = virtual_network_interface_primary_ip_prototype_model
+ instance_network_attachment_prototype_virtual_network_interface_model['resource_group'] = resource_group_identity_model
+ instance_network_attachment_prototype_virtual_network_interface_model['security_groups'] = [security_group_identity_model]
+ instance_network_attachment_prototype_virtual_network_interface_model['subnet'] = subnet_identity_model
+
+ instance_network_attachment_prototype_model = {} # InstanceNetworkAttachmentPrototype
+ instance_network_attachment_prototype_model['name'] = 'my-instance-network-attachment'
+ instance_network_attachment_prototype_model['virtual_network_interface'] = instance_network_attachment_prototype_virtual_network_interface_model
- # Construct a model instance of InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityById by calling from_dict on the json representation
- instance_placement_target_prototype_placement_group_identity_placement_group_identity_by_id_model = InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityById.from_dict(instance_placement_target_prototype_placement_group_identity_placement_group_identity_by_id_model_json)
- assert instance_placement_target_prototype_placement_group_identity_placement_group_identity_by_id_model != False
+ zone_identity_model = {} # ZoneIdentityByName
+ zone_identity_model['name'] = 'us-south-1'
- # Construct a model instance of InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityById by calling from_dict on the json representation
- instance_placement_target_prototype_placement_group_identity_placement_group_identity_by_id_model_dict = InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityById.from_dict(instance_placement_target_prototype_placement_group_identity_placement_group_identity_by_id_model_json).__dict__
- instance_placement_target_prototype_placement_group_identity_placement_group_identity_by_id_model2 = InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityById(**instance_placement_target_prototype_placement_group_identity_placement_group_identity_by_id_model_dict)
+ network_interface_ip_prototype_model = {} # NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext
+ network_interface_ip_prototype_model['address'] = '10.0.0.5'
+ network_interface_ip_prototype_model['auto_delete'] = False
+ network_interface_ip_prototype_model['name'] = 'my-reserved-ip'
- # Verify the model instances are equivalent
- assert instance_placement_target_prototype_placement_group_identity_placement_group_identity_by_id_model == instance_placement_target_prototype_placement_group_identity_placement_group_identity_by_id_model2
+ network_interface_prototype_model = {} # NetworkInterfacePrototype
+ network_interface_prototype_model['allow_ip_spoofing'] = True
+ network_interface_prototype_model['name'] = 'my-instance-network-interface'
+ network_interface_prototype_model['primary_ip'] = network_interface_ip_prototype_model
+ network_interface_prototype_model['security_groups'] = [security_group_identity_model]
+ network_interface_prototype_model['subnet'] = subnet_identity_model
- # Convert model instance back to dict and verify no loss of data
- instance_placement_target_prototype_placement_group_identity_placement_group_identity_by_id_model_json2 = instance_placement_target_prototype_placement_group_identity_placement_group_identity_by_id_model.to_dict()
- assert instance_placement_target_prototype_placement_group_identity_placement_group_identity_by_id_model_json2 == instance_placement_target_prototype_placement_group_identity_placement_group_identity_by_id_model_json
+ # Construct a json representation of a InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkInterface model
+ instance_template_instance_by_source_snapshot_instance_template_context_instance_by_source_snapshot_instance_template_context_instance_by_network_interface_model_json = {}
+ instance_template_instance_by_source_snapshot_instance_template_context_instance_by_source_snapshot_instance_template_context_instance_by_network_interface_model_json['availability_policy'] = instance_availability_policy_prototype_model
+ instance_template_instance_by_source_snapshot_instance_template_context_instance_by_source_snapshot_instance_template_context_instance_by_network_interface_model_json['created_at'] = '2019-01-01T12:00:00Z'
+ instance_template_instance_by_source_snapshot_instance_template_context_instance_by_source_snapshot_instance_template_context_instance_by_network_interface_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a'
+ instance_template_instance_by_source_snapshot_instance_template_context_instance_by_source_snapshot_instance_template_context_instance_by_network_interface_model_json['default_trusted_profile'] = instance_default_trusted_profile_prototype_model
+ instance_template_instance_by_source_snapshot_instance_template_context_instance_by_source_snapshot_instance_template_context_instance_by_network_interface_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a'
+ instance_template_instance_by_source_snapshot_instance_template_context_instance_by_source_snapshot_instance_template_context_instance_by_network_interface_model_json['id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803'
+ instance_template_instance_by_source_snapshot_instance_template_context_instance_by_source_snapshot_instance_template_context_instance_by_network_interface_model_json['keys'] = [key_identity_model]
+ instance_template_instance_by_source_snapshot_instance_template_context_instance_by_source_snapshot_instance_template_context_instance_by_network_interface_model_json['metadata_service'] = instance_metadata_service_prototype_model
+ instance_template_instance_by_source_snapshot_instance_template_context_instance_by_source_snapshot_instance_template_context_instance_by_network_interface_model_json['name'] = 'my-instance-template'
+ instance_template_instance_by_source_snapshot_instance_template_context_instance_by_source_snapshot_instance_template_context_instance_by_network_interface_model_json['placement_target'] = instance_placement_target_prototype_model
+ instance_template_instance_by_source_snapshot_instance_template_context_instance_by_source_snapshot_instance_template_context_instance_by_network_interface_model_json['profile'] = instance_profile_identity_model
+ instance_template_instance_by_source_snapshot_instance_template_context_instance_by_source_snapshot_instance_template_context_instance_by_network_interface_model_json['reservation_affinity'] = instance_reservation_affinity_prototype_model
+ instance_template_instance_by_source_snapshot_instance_template_context_instance_by_source_snapshot_instance_template_context_instance_by_network_interface_model_json['resource_group'] = resource_group_reference_model
+ instance_template_instance_by_source_snapshot_instance_template_context_instance_by_source_snapshot_instance_template_context_instance_by_network_interface_model_json['total_volume_bandwidth'] = 500
+ instance_template_instance_by_source_snapshot_instance_template_context_instance_by_source_snapshot_instance_template_context_instance_by_network_interface_model_json['user_data'] = 'testString'
+ instance_template_instance_by_source_snapshot_instance_template_context_instance_by_source_snapshot_instance_template_context_instance_by_network_interface_model_json['volume_attachments'] = [volume_attachment_prototype_model]
+ instance_template_instance_by_source_snapshot_instance_template_context_instance_by_source_snapshot_instance_template_context_instance_by_network_interface_model_json['vpc'] = vpc_identity_model
+ instance_template_instance_by_source_snapshot_instance_template_context_instance_by_source_snapshot_instance_template_context_instance_by_network_interface_model_json['boot_volume_attachment'] = volume_attachment_prototype_instance_by_source_snapshot_context_model
+ instance_template_instance_by_source_snapshot_instance_template_context_instance_by_source_snapshot_instance_template_context_instance_by_network_interface_model_json['network_attachments'] = [instance_network_attachment_prototype_model]
+ instance_template_instance_by_source_snapshot_instance_template_context_instance_by_source_snapshot_instance_template_context_instance_by_network_interface_model_json['primary_network_attachment'] = instance_network_attachment_prototype_model
+ instance_template_instance_by_source_snapshot_instance_template_context_instance_by_source_snapshot_instance_template_context_instance_by_network_interface_model_json['zone'] = zone_identity_model
+ instance_template_instance_by_source_snapshot_instance_template_context_instance_by_source_snapshot_instance_template_context_instance_by_network_interface_model_json['network_interfaces'] = [network_interface_prototype_model]
+ instance_template_instance_by_source_snapshot_instance_template_context_instance_by_source_snapshot_instance_template_context_instance_by_network_interface_model_json['primary_network_interface'] = network_interface_prototype_model
+
+ # Construct a model instance of InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkInterface by calling from_dict on the json representation
+ instance_template_instance_by_source_snapshot_instance_template_context_instance_by_source_snapshot_instance_template_context_instance_by_network_interface_model = InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkInterface.from_dict(instance_template_instance_by_source_snapshot_instance_template_context_instance_by_source_snapshot_instance_template_context_instance_by_network_interface_model_json)
+ assert instance_template_instance_by_source_snapshot_instance_template_context_instance_by_source_snapshot_instance_template_context_instance_by_network_interface_model != False
+
+ # Construct a model instance of InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkInterface by calling from_dict on the json representation
+ instance_template_instance_by_source_snapshot_instance_template_context_instance_by_source_snapshot_instance_template_context_instance_by_network_interface_model_dict = InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkInterface.from_dict(instance_template_instance_by_source_snapshot_instance_template_context_instance_by_source_snapshot_instance_template_context_instance_by_network_interface_model_json).__dict__
+ instance_template_instance_by_source_snapshot_instance_template_context_instance_by_source_snapshot_instance_template_context_instance_by_network_interface_model2 = InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkInterface(**instance_template_instance_by_source_snapshot_instance_template_context_instance_by_source_snapshot_instance_template_context_instance_by_network_interface_model_dict)
+
+ # Verify the model instances are equivalent
+ assert instance_template_instance_by_source_snapshot_instance_template_context_instance_by_source_snapshot_instance_template_context_instance_by_network_interface_model == instance_template_instance_by_source_snapshot_instance_template_context_instance_by_source_snapshot_instance_template_context_instance_by_network_interface_model2
+
+ # Convert model instance back to dict and verify no loss of data
+ instance_template_instance_by_source_snapshot_instance_template_context_instance_by_source_snapshot_instance_template_context_instance_by_network_interface_model_json2 = instance_template_instance_by_source_snapshot_instance_template_context_instance_by_source_snapshot_instance_template_context_instance_by_network_interface_model.to_dict()
+ assert instance_template_instance_by_source_snapshot_instance_template_context_instance_by_source_snapshot_instance_template_context_instance_by_network_interface_model_json2 == instance_template_instance_by_source_snapshot_instance_template_context_instance_by_source_snapshot_instance_template_context_instance_by_network_interface_model_json
class TestModel_LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityByHref:
@@ -83222,6 +93666,96 @@ def test_reserved_ip_target_prototype_endpoint_gateway_identity_endpoint_gateway
assert reserved_ip_target_prototype_endpoint_gateway_identity_endpoint_gateway_identity_by_id_model_json2 == reserved_ip_target_prototype_endpoint_gateway_identity_endpoint_gateway_identity_by_id_model_json
+class TestModel_ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN:
+ """
+ Test Class for ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN
+ """
+
+ def test_reserved_ip_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_crn_serialization(self):
+ """
+ Test serialization/deserialization for ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN
+ """
+
+ # Construct a json representation of a ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN model
+ reserved_ip_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_crn_model_json = {}
+ reserved_ip_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_crn_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9'
+
+ # Construct a model instance of ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN by calling from_dict on the json representation
+ reserved_ip_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_crn_model = ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN.from_dict(reserved_ip_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_crn_model_json)
+ assert reserved_ip_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_crn_model != False
+
+ # Construct a model instance of ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN by calling from_dict on the json representation
+ reserved_ip_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_crn_model_dict = ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN.from_dict(reserved_ip_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_crn_model_json).__dict__
+ reserved_ip_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_crn_model2 = ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN(**reserved_ip_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_crn_model_dict)
+
+ # Verify the model instances are equivalent
+ assert reserved_ip_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_crn_model == reserved_ip_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_crn_model2
+
+ # Convert model instance back to dict and verify no loss of data
+ reserved_ip_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_crn_model_json2 = reserved_ip_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_crn_model.to_dict()
+ assert reserved_ip_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_crn_model_json2 == reserved_ip_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_crn_model_json
+
+
+class TestModel_ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref:
+ """
+ Test Class for ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref
+ """
+
+ def test_reserved_ip_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_href_serialization(self):
+ """
+ Test serialization/deserialization for ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref
+ """
+
+ # Construct a json representation of a ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref model
+ reserved_ip_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_href_model_json = {}
+ reserved_ip_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9'
+
+ # Construct a model instance of ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref by calling from_dict on the json representation
+ reserved_ip_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_href_model = ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref.from_dict(reserved_ip_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_href_model_json)
+ assert reserved_ip_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_href_model != False
+
+ # Construct a model instance of ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref by calling from_dict on the json representation
+ reserved_ip_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_href_model_dict = ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref.from_dict(reserved_ip_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_href_model_json).__dict__
+ reserved_ip_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_href_model2 = ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref(**reserved_ip_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_href_model_dict)
+
+ # Verify the model instances are equivalent
+ assert reserved_ip_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_href_model == reserved_ip_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_href_model2
+
+ # Convert model instance back to dict and verify no loss of data
+ reserved_ip_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_href_model_json2 = reserved_ip_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_href_model.to_dict()
+ assert reserved_ip_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_href_model_json2 == reserved_ip_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_href_model_json
+
+
+class TestModel_ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById:
+ """
+ Test Class for ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById
+ """
+
+ def test_reserved_ip_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_id_serialization(self):
+ """
+ Test serialization/deserialization for ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById
+ """
+
+ # Construct a json representation of a ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById model
+ reserved_ip_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_id_model_json = {}
+ reserved_ip_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_id_model_json['id'] = '0767-fa41aecb-4f21-423d-8082-630bfba1e1d9'
+
+ # Construct a model instance of ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById by calling from_dict on the json representation
+ reserved_ip_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_id_model = ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById.from_dict(reserved_ip_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_id_model_json)
+ assert reserved_ip_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_id_model != False
+
+ # Construct a model instance of ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById by calling from_dict on the json representation
+ reserved_ip_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_id_model_dict = ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById.from_dict(reserved_ip_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_id_model_json).__dict__
+ reserved_ip_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_id_model2 = ReservedIPTargetPrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById(**reserved_ip_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_id_model_dict)
+
+ # Verify the model instances are equivalent
+ assert reserved_ip_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_id_model == reserved_ip_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_id_model2
+
+ # Convert model instance back to dict and verify no loss of data
+ reserved_ip_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_id_model_json2 = reserved_ip_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_id_model.to_dict()
+ assert reserved_ip_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_id_model_json2 == reserved_ip_target_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_id_model_json
+
+
class TestModel_RouteNextHopPatchRouteNextHopIPRouteNextHopIPSentinelIP:
"""
Test Class for RouteNextHopPatchRouteNextHopIPRouteNextHopIPSentinelIP
@@ -83642,6 +94176,156 @@ def test_security_group_rule_remote_prototype_security_group_identity_security_g
assert security_group_rule_remote_prototype_security_group_identity_security_group_identity_by_id_model_json2 == security_group_rule_remote_prototype_security_group_identity_security_group_identity_by_id_model_json
+class TestModel_ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN:
+ """
+ Test Class for ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN
+ """
+
+ def test_share_mount_target_virtual_network_interface_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_crn_serialization(self):
+ """
+ Test serialization/deserialization for ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN
+ """
+
+ # Construct a json representation of a ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN model
+ share_mount_target_virtual_network_interface_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_crn_model_json = {}
+ share_mount_target_virtual_network_interface_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_crn_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9'
+
+ # Construct a model instance of ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN by calling from_dict on the json representation
+ share_mount_target_virtual_network_interface_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_crn_model = ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN.from_dict(share_mount_target_virtual_network_interface_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_crn_model_json)
+ assert share_mount_target_virtual_network_interface_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_crn_model != False
+
+ # Construct a model instance of ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN by calling from_dict on the json representation
+ share_mount_target_virtual_network_interface_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_crn_model_dict = ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN.from_dict(share_mount_target_virtual_network_interface_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_crn_model_json).__dict__
+ share_mount_target_virtual_network_interface_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_crn_model2 = ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByCRN(**share_mount_target_virtual_network_interface_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_crn_model_dict)
+
+ # Verify the model instances are equivalent
+ assert share_mount_target_virtual_network_interface_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_crn_model == share_mount_target_virtual_network_interface_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_crn_model2
+
+ # Convert model instance back to dict and verify no loss of data
+ share_mount_target_virtual_network_interface_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_crn_model_json2 = share_mount_target_virtual_network_interface_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_crn_model.to_dict()
+ assert share_mount_target_virtual_network_interface_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_crn_model_json2 == share_mount_target_virtual_network_interface_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_crn_model_json
+
+
+class TestModel_ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref:
+ """
+ Test Class for ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref
+ """
+
+ def test_share_mount_target_virtual_network_interface_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_href_serialization(self):
+ """
+ Test serialization/deserialization for ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref
+ """
+
+ # Construct a json representation of a ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref model
+ share_mount_target_virtual_network_interface_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_href_model_json = {}
+ share_mount_target_virtual_network_interface_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9'
+
+ # Construct a model instance of ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref by calling from_dict on the json representation
+ share_mount_target_virtual_network_interface_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_href_model = ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref.from_dict(share_mount_target_virtual_network_interface_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_href_model_json)
+ assert share_mount_target_virtual_network_interface_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_href_model != False
+
+ # Construct a model instance of ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref by calling from_dict on the json representation
+ share_mount_target_virtual_network_interface_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_href_model_dict = ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref.from_dict(share_mount_target_virtual_network_interface_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_href_model_json).__dict__
+ share_mount_target_virtual_network_interface_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_href_model2 = ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityByHref(**share_mount_target_virtual_network_interface_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_href_model_dict)
+
+ # Verify the model instances are equivalent
+ assert share_mount_target_virtual_network_interface_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_href_model == share_mount_target_virtual_network_interface_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_href_model2
+
+ # Convert model instance back to dict and verify no loss of data
+ share_mount_target_virtual_network_interface_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_href_model_json2 = share_mount_target_virtual_network_interface_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_href_model.to_dict()
+ assert share_mount_target_virtual_network_interface_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_href_model_json2 == share_mount_target_virtual_network_interface_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_href_model_json
+
+
+class TestModel_ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById:
+ """
+ Test Class for ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById
+ """
+
+ def test_share_mount_target_virtual_network_interface_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_id_serialization(self):
+ """
+ Test serialization/deserialization for ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById
+ """
+
+ # Construct a json representation of a ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById model
+ share_mount_target_virtual_network_interface_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_id_model_json = {}
+ share_mount_target_virtual_network_interface_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_id_model_json['id'] = '0767-fa41aecb-4f21-423d-8082-630bfba1e1d9'
+
+ # Construct a model instance of ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById by calling from_dict on the json representation
+ share_mount_target_virtual_network_interface_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_id_model = ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById.from_dict(share_mount_target_virtual_network_interface_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_id_model_json)
+ assert share_mount_target_virtual_network_interface_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_id_model != False
+
+ # Construct a model instance of ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById by calling from_dict on the json representation
+ share_mount_target_virtual_network_interface_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_id_model_dict = ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById.from_dict(share_mount_target_virtual_network_interface_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_id_model_json).__dict__
+ share_mount_target_virtual_network_interface_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_id_model2 = ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfaceIdentityVirtualNetworkInterfaceIdentityById(**share_mount_target_virtual_network_interface_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_id_model_dict)
+
+ # Verify the model instances are equivalent
+ assert share_mount_target_virtual_network_interface_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_id_model == share_mount_target_virtual_network_interface_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_id_model2
+
+ # Convert model instance back to dict and verify no loss of data
+ share_mount_target_virtual_network_interface_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_id_model_json2 = share_mount_target_virtual_network_interface_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_id_model.to_dict()
+ assert share_mount_target_virtual_network_interface_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_id_model_json2 == share_mount_target_virtual_network_interface_prototype_virtual_network_interface_identity_virtual_network_interface_identity_by_id_model_json
+
+
+class TestModel_VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextByHref:
+ """
+ Test Class for VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextByHref
+ """
+
+ def test_virtual_network_interface_ip_prototype_reserved_ip_identity_virtual_network_interface_i_ps_context_by_href_serialization(self):
+ """
+ Test serialization/deserialization for VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextByHref
+ """
+
+ # Construct a json representation of a VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextByHref model
+ virtual_network_interface_ip_prototype_reserved_ip_identity_virtual_network_interface_i_ps_context_by_href_model_json = {}
+ virtual_network_interface_ip_prototype_reserved_ip_identity_virtual_network_interface_i_ps_context_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb'
+
+ # Construct a model instance of VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextByHref by calling from_dict on the json representation
+ virtual_network_interface_ip_prototype_reserved_ip_identity_virtual_network_interface_i_ps_context_by_href_model = VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextByHref.from_dict(virtual_network_interface_ip_prototype_reserved_ip_identity_virtual_network_interface_i_ps_context_by_href_model_json)
+ assert virtual_network_interface_ip_prototype_reserved_ip_identity_virtual_network_interface_i_ps_context_by_href_model != False
+
+ # Construct a model instance of VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextByHref by calling from_dict on the json representation
+ virtual_network_interface_ip_prototype_reserved_ip_identity_virtual_network_interface_i_ps_context_by_href_model_dict = VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextByHref.from_dict(virtual_network_interface_ip_prototype_reserved_ip_identity_virtual_network_interface_i_ps_context_by_href_model_json).__dict__
+ virtual_network_interface_ip_prototype_reserved_ip_identity_virtual_network_interface_i_ps_context_by_href_model2 = VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextByHref(**virtual_network_interface_ip_prototype_reserved_ip_identity_virtual_network_interface_i_ps_context_by_href_model_dict)
+
+ # Verify the model instances are equivalent
+ assert virtual_network_interface_ip_prototype_reserved_ip_identity_virtual_network_interface_i_ps_context_by_href_model == virtual_network_interface_ip_prototype_reserved_ip_identity_virtual_network_interface_i_ps_context_by_href_model2
+
+ # Convert model instance back to dict and verify no loss of data
+ virtual_network_interface_ip_prototype_reserved_ip_identity_virtual_network_interface_i_ps_context_by_href_model_json2 = virtual_network_interface_ip_prototype_reserved_ip_identity_virtual_network_interface_i_ps_context_by_href_model.to_dict()
+ assert virtual_network_interface_ip_prototype_reserved_ip_identity_virtual_network_interface_i_ps_context_by_href_model_json2 == virtual_network_interface_ip_prototype_reserved_ip_identity_virtual_network_interface_i_ps_context_by_href_model_json
+
+
+class TestModel_VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextById:
+ """
+ Test Class for VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextById
+ """
+
+ def test_virtual_network_interface_ip_prototype_reserved_ip_identity_virtual_network_interface_i_ps_context_by_id_serialization(self):
+ """
+ Test serialization/deserialization for VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextById
+ """
+
+ # Construct a json representation of a VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextById model
+ virtual_network_interface_ip_prototype_reserved_ip_identity_virtual_network_interface_i_ps_context_by_id_model_json = {}
+ virtual_network_interface_ip_prototype_reserved_ip_identity_virtual_network_interface_i_ps_context_by_id_model_json['id'] = '6d353a0f-aeb1-4ae1-832e-1110d10981bb'
+
+ # Construct a model instance of VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextById by calling from_dict on the json representation
+ virtual_network_interface_ip_prototype_reserved_ip_identity_virtual_network_interface_i_ps_context_by_id_model = VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextById.from_dict(virtual_network_interface_ip_prototype_reserved_ip_identity_virtual_network_interface_i_ps_context_by_id_model_json)
+ assert virtual_network_interface_ip_prototype_reserved_ip_identity_virtual_network_interface_i_ps_context_by_id_model != False
+
+ # Construct a model instance of VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextById by calling from_dict on the json representation
+ virtual_network_interface_ip_prototype_reserved_ip_identity_virtual_network_interface_i_ps_context_by_id_model_dict = VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextById.from_dict(virtual_network_interface_ip_prototype_reserved_ip_identity_virtual_network_interface_i_ps_context_by_id_model_json).__dict__
+ virtual_network_interface_ip_prototype_reserved_ip_identity_virtual_network_interface_i_ps_context_by_id_model2 = VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextById(**virtual_network_interface_ip_prototype_reserved_ip_identity_virtual_network_interface_i_ps_context_by_id_model_dict)
+
+ # Verify the model instances are equivalent
+ assert virtual_network_interface_ip_prototype_reserved_ip_identity_virtual_network_interface_i_ps_context_by_id_model == virtual_network_interface_ip_prototype_reserved_ip_identity_virtual_network_interface_i_ps_context_by_id_model2
+
+ # Convert model instance back to dict and verify no loss of data
+ virtual_network_interface_ip_prototype_reserved_ip_identity_virtual_network_interface_i_ps_context_by_id_model_json2 = virtual_network_interface_ip_prototype_reserved_ip_identity_virtual_network_interface_i_ps_context_by_id_model.to_dict()
+ assert virtual_network_interface_ip_prototype_reserved_ip_identity_virtual_network_interface_i_ps_context_by_id_model_json2 == virtual_network_interface_ip_prototype_reserved_ip_identity_virtual_network_interface_i_ps_context_by_id_model_json
+
+
class TestModel_VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContextByHref:
"""
Test Class for VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContextByHref